aplus-fsf-4.22/0000777000265000001440000000000010774512562007113 5aplus-fsf-4.22/README0000444000265000001440000000115607261520262007701 A+ and the A+ Reference Manual are Copyright Morgan Stanley Dean Witter & Co. They are distributed under the GNU General Public License and the GNU Free Documentation License and available from http://www.aplusdev.org/. See the file LICENSE and the appendix titled GNU Free Documentation License of the reference manual regarding the terms under which A+ software and documentation is being made available. The INSTALL file describes how to build and install A+ software and documentation. Questions, comments, etc. may be sent to help@aplusdev.org. Thank you, the people who bring you A+ January 25, 2001 aplus-fsf-4.22/AUTHORS0000444000265000001440000000003007231701740010056 Arthur Whitney, et. al. aplus-fsf-4.22/COPYING0000444000265000001440000000004507231701542010047 See the GNU GPL in the file LICENSE. aplus-fsf-4.22/ChangeLog0000644000265000001440000000441210772772221010600 :::::::::::::: /usr/local/doc/aplus-fsf/CHANGES :::::::::::::: v4.22-1 03/27/08 - Many Many 64bit fixes - adap.SyncConnect v4.20-2 08/29/05 - fixed new compiler issues with gcc (thanks for Neil Roeth) - Added additional directores to tar (scripts, lisp.0, lisp.1, fonts. contrib) - Added file.+ to scripts directory v4.20-1 12/31/03 - fixed `scb for action widget - fixed segv on timer expiration - fixed compilation issues with gcc 3.3 (thanks for Neil Roeth) - fixed segv on over allocation now a WSFULL - fixed memory leak with endian conversion of mapped files - fixed msync with .m files - fixed _items{} to ignore the file-size check so it can repair files that have inadvertently been truncated or have invalid items set. - new system function _memStats{} - new system variable, `beamMSyncMode. This variable controls if and how msync() is called when a variable "beamed" read/write is updated. Valid settings `none -msync() is not called `MS_ASYNC -specifies that an update be scheduled, but the call returns immediately. `MS_SYNC -asks for an update and waits for it to complete (THIS SETTING IS VERY SLOW!!)* The default settings are: Linux `MS_ASYNC Solaris `none IRIX (SGI) `MS_ASYNC - new invocation options -c Enables core file creation -m ws_mem_stats (same as _memStats{`on} - new system function, _msyncAll{ flag } where flag can be `MS_ASYNC or `MS_SYNC. Internally this functions iterates over the all the beamed files mmapped Read/Write and performs a msync() with the flag specified. v4.18-8 12/25/01 - fixed mapped file conversion for little endian 32 to big endian 64 - improve append assignment trading off memory - fix suspension when rgb.txt can't be located - changes for MacOS X - intitialization of some unitialized MStk widgets - remove collapsible from S v4.18-7 10/12/01 - changes for 2.95.3/3.0.1 v4.18-6 7/21/01 - changes for cxx on Tru64 v4.18-5 3/31/01 - changes for Linux on Alpha - clean up fsftest.+ - fixed bug with conversion of mapped files v4.18-4 3/20/01 - changes for FreeBSD v4.18-3 2/15/01 - similiar changes for Irix with ecgs 1.1.2 v4.18-2 - changes to compile on Solaris with ecgs 1.1.2 v4.18 - Initial fsf release aplus-fsf-4.22/INSTALL0000644000265000001440000000636707774361571010104 aplus-fsf-4.20-0 December 30, 2003 A complete compiler/platform grid is found at the end of this file. Build/Install Mac OS X sed 's;missing_dir=`cd $ac_aux_dir && pwd`;missing_dir=`pwd`/$ac_aux_dir;' \ configure > configure.ok; chmod +x configure.ok CFLAGS=-O3 CXXFLAGS=-O3 ./configure.ok --prefix=/usr/local/aplus-fsf-4.20 ./fix4mac make install FreeBSD, IRIX, Linux w/gcc: CFLAGS=-O2 CXXFLAGS=-O2 ./configure --prefix=/usr/local/aplus-fsf-4.20 make install IRIX with MipsPro: CFLAGS=-Ofast CXXFLAGS=-Ofast ./configure --prefix=/usr/local/aplus-fsf-4.20 ./fix4mipspro make install NetBSD: CFLAGS=-O2 CXXFLAGS=-O2 ./configure --prefix=/usr/local/aplus-fsf-4.20 ./fix4netbsd make install Solaris: (Be sure to use GNU sed or the reference manual won't be properly installed. See http://aplusdev.org/Download/optLibs.html. If you don't have a cc command in your path, set CC=gcc.) CFLAGS=-O2 CXXFLAGS=-O2 ./configure --prefix=/usr/local/aplus-fsf-4.20 make install rm /usr/local/aplus-fsf-4.20/lib/lib*.so* g++ src/main/*.o -L /usr/local/aplus-fsf-4.20/lib \ -lAplusGUI -lIPC -lMSGUI -lMSIPC -lMSTypes -la -lcxb -lcxc \ -lcxs -lcxsys -ldap -lesf -lX11 -lnsl -lsocket -ldl \ -o /usr/local/aplus-fsf-4.20/bin/a+ AIX: CFLAGS=-O2 CXXFLAGS="-Wl,-bbigtoc -O2" \ ./configure --prefix=/usr/local/aplus-fsf-4.20 ./fix4aix make install OSF: CFLAGS=-O2 \ CXXFLAGS="-rpath /usr/local/aplus-fsf-4.20/lib -O2 -timplicit_local" \ ./configure --prefix=/usr/local/aplus-fsf-4.20 ./fix4cxx make install Test All Platforms: /usr/local/aplus-fsf-4.20/bin/a+ ./src/a/fsftest.+ # export your DISPLAY variable if testing remotely /usr/local/aplus-fsf-4.20/bin/a+ ./src/a/apter.+ Compiler/platform grid: yes - This combination works no - This combination does not work gcc 2.95.2/ cxx MipsPro 2.91.66 934.3 2.95.3 2.95.4 2.96 3.0.1 3.0.3 6.3 7.3 Redhat 6.2 / i386 yes no no no Redhat 7.1 / i386 no yes yes yes yes Redhat 7.1.94 / i386 yes yes yes Redhat 7.2 / i386 yes yes yes FreeBSD 4.3 / i386 yes yes yes NetBSD 1.5.2 / i386 yes Debian 2.2.19pre17 / i386 Redhat 7.1.93 / ia64 yes Redhat 7.1.94 / ia64 yes yes Redhat 7.0.90 / s390 yes yes yes Redhat 7.0 / alpha no yes yes Redhat 7.1 / alpha no yes yes yes yes Tru64 5.1 / alpha no yes Solaris 2.7 / sparc yes yes yes yes Solaris 2.8 / sparc yes yes yes yes IRIX 6.5.12 / mips yes yes yes yes yes yes AIX 5.1 / power2 yes Yellow Dog Linux 2.1 / ppc yes Mac OS X / ppc yes aplus-fsf-4.22/Makefile.am0000444000265000001440000000136307411760411011054 ## Process this file with automake to produce Makefile.in ############################################################################### ## ## ## Copyright (c) 2001 Morgan Stanley Dean Witter and Co. All rights reserved.## ## See ...#src#LICENSE for terms of distribution. ## ## ## ## ## ############################################################################### EXTRA_DIST = ANNOUNCE LICENSE aclocal.m4 bootstrap.sh libtool fix4mipspro \ fix4mac fix4cxx fix4netbsd fix4aix SUBDIRS = config src aplus-fsf-4.22/Makefile.in0000644000265000001440000003200610774512520011067 # Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ ############################################################################### ############################################################################### SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CXX = @CXX@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ STRIP = @STRIP@ VERSION = @VERSION@ X_INCLUDES = @X_INCLUDES@ X_LIBS = @X_LIBS@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ EXTRA_DIST = ANNOUNCE LICENSE aclocal.m4 bootstrap.sh libtool fix4mipspro \ fix4mac fix4cxx fix4netbsd fix4aix SUBDIRS = config src subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_CLEAN_FILES = DIST_SOURCES = RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ uninstall-info-recursive all-recursive install-data-recursive \ install-exec-recursive installdirs-recursive install-recursive \ uninstall-recursive check-recursive installcheck-recursive DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \ Makefile.in NEWS aclocal.m4 configure configure.in DIST_SUBDIRS = $(SUBDIRS) all: all-recursive .SUFFIXES: am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe) $(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ETAGS = etags ETAGSFLAGS = tags: TAGS 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; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ fi; \ done; \ 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; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = . distdir = $(PACKAGE)-$(VERSION) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } GZIP_ENV = --best distcleancheck_listfiles = find . -type f -print distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d $(distdir)/$$subdir \ || mkdir $(distdir)/$$subdir \ || exit 1; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" \ distdir=../$(distdir)/$$subdir \ distdir) \ || exit 1; \ fi; \ done -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -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 $(SHELL) $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist dist-all: distdir $(AMTAR) chof - $(distdir) | 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 $(am__remove_distdir) GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/=build mkdir $(distdir)/=inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/=inst && pwd` \ && 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 \ && (test `find $$dc_install_base -type f -print | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ find $$dc_install_base -type f -print ; \ exit 1; } >&2 ) \ && $(MAKE) $(AM_MAKEFLAGS) dist-gzip \ && rm -f $(distdir).tar.gz \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @echo "$(distdir).tar.gz is ready for distribution" | \ sed 'h;s/./=/g;p;x;p;x' 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 after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_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-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: info: info-recursive info-am: install-data-am: install-exec-am: install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf autom4te.cache maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool uninstall-am: uninstall-info-am uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \ clean-generic clean-libtool clean-recursive dist dist-all \ dist-gzip distcheck distclean distclean-generic \ distclean-libtool distclean-recursive distclean-tags \ distcleancheck distdir dvi dvi-am dvi-recursive info info-am \ info-recursive install install-am install-data install-data-am \ install-data-recursive install-exec install-exec-am \ install-exec-recursive install-info install-info-am \ install-info-recursive install-man install-recursive \ install-strip installcheck installcheck-am installdirs \ installdirs-am installdirs-recursive maintainer-clean \ maintainer-clean-generic maintainer-clean-recursive mostlyclean \ mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \ tags tags-recursive uninstall uninstall-am uninstall-info-am \ uninstall-info-recursive uninstall-recursive # 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: aplus-fsf-4.22/NEWS0000444000265000001440000000000007231701465007506 aplus-fsf-4.22/aclocal.m40000644000265000001440000044441110774512517010677 # aclocal.m4 generated automatically by aclocal 1.6.3 -*- Autoconf -*- # Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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. # Do all the work for Automake. -*- Autoconf -*- # 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. # Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 8 # 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... AC_PREREQ([2.52]) # Autoconf 2.50 wants to disallow AM_ names. We explicitly allow # the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl # 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_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi # 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 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) AM_MISSING_PROG(AMTAR, tar) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP # 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 _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 ]) ]) # Copyright 2002 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, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 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. AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.6"]) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION so it can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.6.3])]) # Helper functions for option handling. -*- Autoconf -*- # Copyright 2001, 2002 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, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 2 # _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], [AC_FOREACH([_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. # # Copyright 1996, 1997, 2000, 2001 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, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 3 # 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 # 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)]) # -*- Autoconf -*- # Copyright 1997, 1999, 2000, 2001 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, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 3 # 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 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # 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 ]) # AM_AUX_DIR_EXPAND # Copyright 2001 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, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # 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. # Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50]) AC_DEFUN([AM_AUX_DIR_EXPAND], [ # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. # Copyright 2001 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, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"$am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # AM_PROG_INSTALL_STRIP # Copyright 2001 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, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # 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="\${SHELL} \$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # serial 4 -*- Autoconf -*- # Copyright 1999, 2000, 2001 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, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # 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], 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 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 for depmode in $am_compiler_list; do # 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. echo '#include "conftest.h"' > conftest.c echo 'int i;' > conftest.h echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf case $depmode in 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 ;; none) break ;; esac # 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. if depmode=$depmode \ source=conftest.c object=conftest.o \ depfile=conftest.Po tmpdepfile=conftest.TPo \ $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && grep conftest.h conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then am_cv_$1_dependencies_compiler_type=$depmode break 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_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [rm -f .deps 2>/dev/null mkdir .deps 2>/dev/null if test -d .deps; then DEPDIR=.deps else # MS-DOS does not allow filenames that begin with a dot. DEPDIR=_deps fi rmdir .deps 2>/dev/null AC_SUBST([DEPDIR]) ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking Speeds up one-time builds --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]) ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright 1999, 2000, 2001, 2002 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, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. #serial 2 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [for mf in $CONFIG_FILES; 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. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue # Extract the definition of DEP_FILES from the Makefile without # running `make'. DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` test -z "$DEPDIR" && continue # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n -e '/^U = / s///p' < "$mf"` test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" # 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 -e ' /^DEP_FILES = .*\\\\$/ { s/^DEP_FILES = // :loop s/\\\\$// p n /\\\\$/ b loop p } /^DEP_FILES = / s/^DEP_FILES = //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"]) ]) # Copyright 2001 Free Software Foundation, Inc. -*- Autoconf -*- # 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, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 2 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' doit: @echo done 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 # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi AC_SUBST(am__include) AC_SUBST(am__quote) AC_MSG_RESULT($_am_result) rm -f confinc confmf ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright 1997, 2000, 2001 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, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 5 AC_PREREQ(2.52) # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE]) AC_SUBST([$1_FALSE]) 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])]) # Add --enable-maintainer-mode option to configure. # From Jim Meyering # Copyright 1996, 1998, 2000, 2001 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, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 1 AC_DEFUN([AM_MAINTAINER_MODE], [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode is disabled by default AC_ARG_ENABLE(maintainer-mode, [ --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer], USE_MAINTAINER_MODE=$enableval, USE_MAINTAINER_MODE=no) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST(MAINT)dnl ] ) # libtool.m4 - Configure libtool for the host system. -*-Shell-script-*- # serial 46 AC_PROG_LIBTOOL AC_DEFUN([AC_PROG_LIBTOOL], [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl # Prevent multiple expansion define([AC_PROG_LIBTOOL], []) ]) AC_DEFUN([AC_LIBTOOL_SETUP], [AC_PREREQ(2.13)dnl AC_REQUIRE([AC_ENABLE_SHARED])dnl AC_REQUIRE([AC_ENABLE_STATIC])dnl AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_LD])dnl AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl AC_REQUIRE([AC_PROG_NM])dnl AC_REQUIRE([LT_AC_PROG_SED])dnl AC_REQUIRE([AC_PROG_LN_S])dnl AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl AC_REQUIRE([AC_OBJEXT])dnl AC_REQUIRE([AC_EXEEXT])dnl dnl _LT_AC_PROG_ECHO_BACKSLASH # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then AC_PATH_MAGIC fi ;; esac AC_CHECK_TOOL(RANLIB, ranlib, :) AC_CHECK_TOOL(STRIP, strip, :) ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], enable_win32_dll=yes, enable_win32_dll=no) AC_ARG_ENABLE(libtool-lock, [ --disable-libtool-lock avoid locking (might break parallel builds)]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in *-*-irix6*) # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_SAVE AC_LANG_C AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_RESTORE]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], [*-*-cygwin* | *-*-mingw* | *-*-pw32*) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) # recent cygwin and mingw systems supply a stub DllMain which the user # can override, but on older systems we have to supply one AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain, [AC_TRY_LINK([], [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*); DllMain (0, 0, 0);], [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])]) case $host/$CC in *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*) # old mingw systems require "-dll" to link a DLL, while more recent ones # require "-mdll" SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -mdll" AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch, [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])]) CFLAGS="$SAVE_CFLAGS" ;; *-*-cygwin* | *-*-pw32*) # cygwin systems need to pass --dll to the linker, and not link # crt.o which will require a WinMain@16 definition. lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;; esac ;; ]) esac _LT_AC_LTCONFIG_HACK ]) # AC_LIBTOOL_HEADER_ASSERT # ------------------------ AC_DEFUN([AC_LIBTOOL_HEADER_ASSERT], [AC_CACHE_CHECK([whether $CC supports assert without backlinking], [lt_cv_func_assert_works], [case $host in *-*-solaris*) if test "$GCC" = yes && test "$with_gnu_ld" != yes; then case `$CC --version 2>/dev/null` in [[12]].*) lt_cv_func_assert_works=no ;; *) lt_cv_func_assert_works=yes ;; esac fi ;; esac]) if test "x$lt_cv_func_assert_works" = xyes; then AC_CHECK_HEADERS(assert.h) fi ])# AC_LIBTOOL_HEADER_ASSERT # _LT_AC_CHECK_DLFCN # -------------------- AC_DEFUN([_LT_AC_CHECK_DLFCN], [AC_CHECK_HEADERS(dlfcn.h) ])# _LT_AC_CHECK_DLFCN # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # --------------------------------- AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_PROG_NM]) AC_REQUIRE([AC_OBJEXT]) # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [dnl # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Transform the above into a raw symbol and a C symbol. symxfrm='\1 \2\3 \3' # Transform an extracted symbol line into a proper C declaration lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32*) symcode='[[ABCDGISTW]]' ;; hpux*) # Its linker distinguishes data from code symbols lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris* | sysv5*) symcode='[[BDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $host_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # If we're using GNU nm, then use its standard symbol codes. if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then symcode='[[ABCDGISTW]]' fi # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Write the raw and C identifiers. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if egrep ' nm_test_var$' "$nlist" >/dev/null; then if egrep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr void * #else # define lt_ptr char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr address; } lt_preloaded_symbols[[]] = { EOF sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$no_builtin_flag" if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&AC_FD_CC fi else echo "cannot find nm_test_var in $nlist" >&AC_FD_CC fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AC_FD_CC fi else echo "$progname: failed program was:" >&AC_FD_CC cat conftest.$ac_ext >&5 fi rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) global_symbol_pipe="$lt_cv_sys_global_symbol_pipe" if test -z "$lt_cv_sys_global_symbol_pipe"; then global_symbol_to_cdecl= global_symbol_to_c_name_address= else global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl" global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address" fi if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi ]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR # --------------------------------- AC_DEFUN([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR], [# Find the correct PATH separator. Usually this is `:', but # DJGPP uses `;' like DOS. if test "X${PATH_SEPARATOR+set}" != Xset; then UNAME=${UNAME-`uname 2>/dev/null`} case X$UNAME in *-DOS) lt_cv_sys_path_separator=';' ;; *) lt_cv_sys_path_separator=':' ;; esac PATH_SEPARATOR=$lt_cv_sys_path_separator fi ])# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR # _LT_AC_PROG_ECHO_BACKSLASH # -------------------------- # Add some code to the start of the generated configure script which # will find an echo command which doesn't interpret backslashes. AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], [AC_DIVERT_PUSH(NOTICE)]) _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` ;; esac echo=${ECHO-echo} if test "X[$]1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X[$]1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} fi if test "X[$]1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null && echo_test_string="`eval $cmd`" && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. IFS="${IFS= }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL [$]0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL [$]0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "[$]0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" fi AC_SUBST(ECHO) AC_DIVERT_POP ])# _LT_AC_PROG_ECHO_BACKSLASH # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ------------------------------------------------------------------ AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], [if test "$cross_compiling" = yes; then : [$4] else AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); }] EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_unknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_AC_TRY_DLOPEN_SELF # AC_LIBTOOL_DLOPEN_SELF # ------------------- AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; cygwin* | mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi ])# AC_LIBTOOL_DLOPEN_SELF AC_DEFUN([_LT_AC_LTCONFIG_HACK], [AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])dnl # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e s/^X//' sed_quote_subst='s/\([[\\"\\`$\\\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([[\\"\\`\\\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except M$VC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" need_locks="$enable_libtool_lock" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o if test x"$host" != x"$build"; then ac_tool_prefix=${host_alias}- else ac_tool_prefix= fi # Transform linux* to *-*-linux-gnu*, to support old configure scripts. case $host_os in linux-gnu*) ;; linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` esac case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" ;; *) old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi # Allow CC to be a program name with arguments. set dummy $CC compiler="[$]2" AC_MSG_CHECKING([for objdir]) rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. objdir=_libs fi rmdir .libs 2>/dev/null AC_MSG_RESULT($objdir) AC_ARG_WITH(pic, [ --with-pic try to use only PIC/non-PIC objects [default=use both]], pic_mode="$withval", pic_mode=default) test -z "$pic_mode" && pic_mode=default # We assume here that the value for lt_cv_prog_cc_pic will not be cached # in isolation, and that seeing it set (from the cache) indicates that # the associated values are set (in the cache) correctly too. AC_MSG_CHECKING([for $compiler option to produce PIC]) AC_CACHE_VAL(lt_cv_prog_cc_pic, [ lt_cv_prog_cc_pic= lt_cv_prog_cc_shlib= lt_cv_prog_cc_wl= lt_cv_prog_cc_static= lt_cv_prog_cc_no_builtin= lt_cv_prog_cc_can_build_shared=$can_build_shared if test "$GCC" = yes; then lt_cv_prog_cc_wl='-Wl,' lt_cv_prog_cc_static='-static' case $host_os in aix*) # Below there is a dirty hack to force normal static linking with -ldl # The problem is because libdl dynamically linked with both libc and # libC (AIX C++ library), which obviously doesn't included in libraries # list by gcc. This cause undefined symbols with -static flags. # This hack allows C programs to be linked with "-static -ldl", but # not sure about C++ programs. lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC" ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4' ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_cv_prog_cc_pic='-fno-common' ;; cygwin* | mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_cv_prog_cc_pic='-DDLL_EXPORT' ;; sysv4*MP*) if test -d /usr/nec; then lt_cv_prog_cc_pic=-Kconform_pic fi ;; *) lt_cv_prog_cc_pic='-fPIC' ;; esac else # PORTME Check for PIC flags for the system compiler. case $host_os in aix3* | aix4* | aix5*) lt_cv_prog_cc_wl='-Wl,' # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_cv_prog_cc_static='-Bstatic' else lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp' fi ;; hpux9* | hpux10* | hpux11*) # Is there a better lt_cv_prog_cc_static that works with the bundled CC? lt_cv_prog_cc_wl='-Wl,' lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive" lt_cv_prog_cc_pic='+Z' ;; irix5* | irix6* | nonstopux*) lt_cv_prog_cc_wl='-Wl,' lt_cv_prog_cc_static='-non_shared' # PIC (with -KPIC) is the default. ;; cygwin* | mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_cv_prog_cc_pic='-DDLL_EXPORT' ;; newsos6) lt_cv_prog_cc_pic='-KPIC' lt_cv_prog_cc_static='-Bstatic' ;; osf3* | osf4* | osf5*) # All OSF/1 code is PIC. lt_cv_prog_cc_wl='-Wl,' lt_cv_prog_cc_static='-non_shared' ;; sco3.2v5*) lt_cv_prog_cc_pic='-Kpic' lt_cv_prog_cc_static='-dn' lt_cv_prog_cc_shlib='-belf' ;; solaris*) lt_cv_prog_cc_pic='-KPIC' lt_cv_prog_cc_static='-Bstatic' lt_cv_prog_cc_wl='-Wl,' ;; sunos4*) lt_cv_prog_cc_pic='-PIC' lt_cv_prog_cc_static='-Bstatic' lt_cv_prog_cc_wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) lt_cv_prog_cc_pic='-KPIC' lt_cv_prog_cc_static='-Bstatic' lt_cv_prog_cc_wl='-Wl,' ;; uts4*) lt_cv_prog_cc_pic='-pic' lt_cv_prog_cc_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_cv_prog_cc_pic='-Kconform_pic' lt_cv_prog_cc_static='-Bstatic' fi ;; *) lt_cv_prog_cc_can_build_shared=no ;; esac fi ]) if test -z "$lt_cv_prog_cc_pic"; then AC_MSG_RESULT([none]) else AC_MSG_RESULT([$lt_cv_prog_cc_pic]) # Check to make sure the pic_flag actually works. AC_MSG_CHECKING([if $compiler PIC flag $lt_cv_prog_cc_pic works]) AC_CACHE_VAL(lt_cv_prog_cc_pic_works, [dnl save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC" AC_TRY_COMPILE([], [], [dnl case $host_os in hpux9* | hpux10* | hpux11*) # On HP-UX, both CC and GCC only warn that PIC is supported... then # they create non-PIC objects. So, if there were any warnings, we # assume that PIC is not supported. if test -s conftest.err; then lt_cv_prog_cc_pic_works=no else lt_cv_prog_cc_pic_works=yes fi ;; *) lt_cv_prog_cc_pic_works=yes ;; esac ], [dnl lt_cv_prog_cc_pic_works=no ]) CFLAGS="$save_CFLAGS" ]) if test "X$lt_cv_prog_cc_pic_works" = Xno; then lt_cv_prog_cc_pic= lt_cv_prog_cc_can_build_shared=no else lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic" fi AC_MSG_RESULT([$lt_cv_prog_cc_pic_works]) fi # Check for any special shared library compilation flags. if test -n "$lt_cv_prog_cc_shlib"; then AC_MSG_WARN([\`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries]) if echo "$old_CC $old_CFLAGS " | egrep -e "[[ ]]$lt_cv_prog_cc_shlib[[ ]]" >/dev/null; then : else AC_MSG_WARN([add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure]) lt_cv_prog_cc_can_build_shared=no fi fi AC_MSG_CHECKING([if $compiler static flag $lt_cv_prog_cc_static works]) AC_CACHE_VAL([lt_cv_prog_cc_static_works], [dnl lt_cv_prog_cc_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static" AC_TRY_LINK([], [], [lt_cv_prog_cc_static_works=yes]) LDFLAGS="$save_LDFLAGS" ]) # Belt *and* braces to stop my trousers falling down: test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static= AC_MSG_RESULT([$lt_cv_prog_cc_static_works]) pic_flag="$lt_cv_prog_cc_pic" special_shlib_compile_flags="$lt_cv_prog_cc_shlib" wl="$lt_cv_prog_cc_wl" link_static_flag="$lt_cv_prog_cc_static" no_builtin_flag="$lt_cv_prog_cc_no_builtin" can_build_shared="$lt_cv_prog_cc_can_build_shared" # Check to see if options -o and -c are simultaneously supported by compiler AC_MSG_CHECKING([if $compiler supports -c -o file.$ac_objext]) AC_CACHE_VAL([lt_cv_compiler_c_o], [ $rm -r conftest 2>/dev/null mkdir conftest cd conftest echo "int some_variable = 0;" > conftest.$ac_ext mkdir out # According to Tom Tromey, Ian Lance Taylor reported there are C compilers # that will create temporary files in the current directory regardless of # the output directory. Thus, making CWD read-only will cause this test # to fail, enabling locking or at least warning the user not to do parallel # builds. chmod -w . save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -o out/conftest2.$ac_objext" compiler_c_o=no if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s out/conftest.err; then lt_cv_compiler_c_o=no else lt_cv_compiler_c_o=yes fi else # Append any errors to the config.log. cat out/conftest.err 1>&AC_FD_CC lt_cv_compiler_c_o=no fi CFLAGS="$save_CFLAGS" chmod u+w . $rm conftest* out/* rmdir out cd .. rmdir conftest $rm -r conftest 2>/dev/null ]) compiler_c_o=$lt_cv_compiler_c_o AC_MSG_RESULT([$compiler_c_o]) if test x"$compiler_c_o" = x"yes"; then # Check to see if we can write to a .lo AC_MSG_CHECKING([if $compiler supports -c -o file.lo]) AC_CACHE_VAL([lt_cv_compiler_o_lo], [ lt_cv_compiler_o_lo=no save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -c -o conftest.lo" save_objext="$ac_objext" ac_objext=lo AC_TRY_COMPILE([], [int some_variable = 0;], [dnl # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then lt_cv_compiler_o_lo=no else lt_cv_compiler_o_lo=yes fi ]) ac_objext="$save_objext" CFLAGS="$save_CFLAGS" ]) compiler_o_lo=$lt_cv_compiler_o_lo AC_MSG_RESULT([$compiler_o_lo]) else compiler_o_lo=no fi # Check to see if we can do hard links to lock some files if needed hard_links="nottested" if test "$compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([\`$CC' does not support \`-c -o', so \`make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi if test "$GCC" = yes; then # Check to see if options -fno-rtti -fno-exceptions are supported by compiler AC_MSG_CHECKING([if $compiler supports -fno-rtti -fno-exceptions]) echo "int some_variable = 0;" > conftest.$ac_ext save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext" compiler_rtti_exceptions=no AC_TRY_COMPILE([], [int some_variable = 0;], [dnl # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then compiler_rtti_exceptions=no else compiler_rtti_exceptions=yes fi ]) CFLAGS="$save_CFLAGS" AC_MSG_RESULT([$compiler_rtti_exceptions]) if test "$compiler_rtti_exceptions" = "yes"; then no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' else no_builtin_flag=' -fno-builtin' fi fi # See if the linker supports building shared libraries. AC_MSG_CHECKING([whether the linker ($LD) supports shared libraries]) allow_undefined_flag= no_undefined_flag= need_lib_prefix=unknown need_version=unknown # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments archive_cmds= archive_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= export_dynamic_flag_spec= whole_archive_flag_spec= thread_safe_flag_spec= hardcode_into_libs=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no hardcode_shlibpath_var=unsupported runpath_var= link_all_deplibs=unknown always_export_symbols=no export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an egrep regular expression of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX, the GNU linker is very broken # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available. ld_shlibs=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32*) # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported always_export_symbols=yes extract_expsyms_cmds='test -f $output_objdir/impgen.c || \ sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~ test -f $output_objdir/impgen.exe || (cd $output_objdir && \ if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \ else $CC -o impgen impgen.c ; fi)~ $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def' old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib' # cygwin and mingw dlls have different entry points and sets of symbols # to exclude. # FIXME: what about values for MSVC? dll_entry=__cygwin_dll_entry@12 dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~ case $host_os in mingw*) # mingw values dll_entry=_DllMainCRTStartup@12 dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~ ;; esac # mingw and cygwin differ, and it's simplest to just exclude the union # of the two symbol sets. dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12 # recent cygwin and mingw systems supply a stub DllMain which the user # can override, but on older systems we have to supply one (in ltdll.c) if test "x$lt_cv_need_dllmain" = "xyes"; then ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext " ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~ test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~' else ltdll_obj= ltdll_cmds= fi # Extract the symbol export list from an `--export-all' def file, # then regenerate the def file from the symbol export list, so that # the compiled dll only exports the symbol export list. # Be careful not to strip the DATA tag left be newer dlltools. export_symbols_cmds="$ltdll_cmds"' $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~ sed -e "1,/EXPORTS/d" -e "s/ @ [[0-9]]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is. # If DATA tags from a recent dlltool are present, honour them! archive_expsym_cmds='if test "x`sed 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname-def; else echo EXPORTS > $output_objdir/$soname-def; _lt_hint=1; cat $export_symbols | while read symbol; do set dummy \$symbol; case \[$]# in 2) echo " \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;; 4) echo " \[$]2 \[$]3 \[$]4 ; " >> $output_objdir/$soname-def; _lt_hint=`expr \$_lt_hint - 1`;; *) echo " \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;; esac; _lt_hint=`expr 1 + \$_lt_hint`; done; fi~ '"$ltdll_cmds"' $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~ $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~ $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags' ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris* | sysv5*) if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = yes; then runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' case $host_os in cygwin* | mingw* | pw32*) # dlltool doesn't understand --whole-archive et. al. whole_archive_flag_spec= ;; *) # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi ;; esac fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. hardcode_direct=yes archive_cmds='' hardcode_libdir_separator=':' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct=yes else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi esac shared_flag='-shared' else # not using gcc if test "$host_cpu" = ia64; then shared_flag='${wl}-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall can do strange things, so it is better to # generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib' # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. allow_undefined_flag='${wl}-berok' # This is a bit strange, but is similar to how AIX traditionally builds # it's shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname' fi fi ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' ;; darwin* | rhapsody*) case "$host_os" in rhapsody* | darwin1.[[012]]) allow_undefined_flag='-undefined suppress' ;; *) # Darwin 1.3 on allow_undefined_flag='-flat_namespace -undefined suppress' ;; esac # FIXME: Relying on posixy $() will cause problems for # cross-compilation, but unfortunately the echo tests do not # yet detect zsh echo's removal of \ escapes. Also zsh mangles # `"' quotes if we put them in here... so don't! archive_cmds='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs && $CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib ${lib}-master.o $deplibs$linker_flags $(test .$module != .yes && echo -install_name $rpath/$soname $verstring)' # We need to add '_' to the symbols in $export_symbols first #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols' hardcode_direct=yes hardcode_shlibpath_var=no whole_archive_flag_spec='-all_load $convenience' ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9* | hpux10* | hpux11*) case $host_os in hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;; *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_minus_L=yes # Not in the search PATH, but as the default # location of the library. export_dynamic_flag_spec='${wl}-E' ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: link_all_deplibs=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; openbsd*) hardcode_direct=yes hardcode_shlibpath_var=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case "$host_os" in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' #Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; sco3.2v5*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes export_dynamic_flag_spec='${wl}-Bexport' ;; solaris*) # gcc --version < 3.0 without binutils cannot create self contained # shared libraries reliably, requiring libgcc.a to resolve some of # the object symbols generated in some cases. Libraries that use # assert need libgcc.a to resolve __eprintf, for example. Linking # a copy of libgcc.a into every shared library to guarantee resolving # such symbols causes other problems: According to Tim Van Holder # , C++ libraries end up with a separate # (to the application) exception stack for one thing. no_undefined_flag=' -z defs' if test "$GCC" = yes; then case `$CC --version 2>/dev/null` in [[12]].*) cat <&2 *** Warning: Releases of GCC earlier than version 3.0 cannot reliably *** create self contained shared libraries on Solaris systems, without *** introducing a dependency on libgcc.a. Therefore, libtool is disabling *** -no-undefined support, which will at least allow you to build shared *** libraries. However, you may find that when you link such libraries *** into an application without using GCC, you have to manually add *** \`gcc --print-libgcc-file-name\` to the link command. We urge you to *** upgrade to a newer version of GCC. Another option is to rebuild your *** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer. EOF no_undefined_flag= ;; esac fi # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv5*) no_undefined_flag=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec= hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4.2uw2*) archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=no hardcode_shlibpath_var=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; sysv5uw7* | unixware7*) no_undefined_flag='${wl}-z ${wl}text' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac fi AC_MSG_RESULT([$ld_shlibs]) test "$ld_shlibs" = no && can_build_shared=no # Check hardcoding attributes. AC_MSG_CHECKING([how to hardcode library paths into programs]) hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var"; then # We can hardcode non-existant directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$hardcode_shlibpath_var" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi AC_MSG_RESULT([$hardcode_action]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi reload_cmds='$LD$reload_flag -o $output$reload_objs' test -z "$deplibs_check_method" && deplibs_check_method=unknown # PORTME Fill in your ld.so characteristics AC_MSG_CHECKING([dynamic linker characteristics]) library_names_spec= libname_spec='lib$name' soname_spec= postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}.so$versuffix $libname.a' shlibpath_var=LIBPATH # AIX has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}.so$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can # not hardcode correct soname into executable. Probably we can # add versioning support to collect2, so additional links can # be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}.so$major' fi shlibpath_var=LIBPATH fi hardcode_into_libs=yes ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' ;; beos*) library_names_spec='${libname}.so' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi4*) version_type=linux need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" export_dynamic_flag_spec=-rdynamic # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin*) library_names_spec='$libname.dll.a' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll' postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog .libs/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' ;; yes,mingw*) library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g" -e "s,=/,/,g"` ;; yes,pw32*) library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' ;; *) library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no # FIXME: Relying on posixy $() will cause problems for # cross-compilation, but unfortunately the echo tests do not # yet detect zsh echo's removal of \ escapes. library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)' soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; *) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. dynamic_linker="$host_os dld.sl" version_type=sunos need_lib_prefix=no need_version=no shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' soname_spec='${libname}${release}.sl$major' # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) version_type=irix ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}.so$major' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" ;; # No shared lib support for Linux oldld, aout, or coff. linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) dynamic_linker=no ;; # This must be Linux ELF. linux-gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' # Find out which ABI we are using (multilib Linux x86_64 hack). libsuff= case "$host_cpu" in x86_64*|s390x*) echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *64-bit*) libsuff=64 ;; esac fi rm -rf conftest* ;; *) ;; esac sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}" sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so' soname_spec='${libname}${release}.so$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no need_version=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case "$host_os" in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH ;; os2*) libname_spec='$name' need_lib_prefix=no library_names_spec='$libname.dll $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_version=no soname_spec='${libname}${release}.so$major' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" hardcode_into_libs=yes ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}.so$major' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; uts4*) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' soname_spec='$libname.so.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no # Report the final consequences. AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case "$host_os" in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) if test "$hardcode_action" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi AC_LIBTOOL_DLOPEN_SELF if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_MSG_CHECKING([whether -lc should be explicitly linked in]) AC_CACHE_VAL([lt_cv_archive_cmds_need_lc], [$rm conftest* echo 'static int dummy;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_cv_prog_cc_wl compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if AC_TRY_EVAL(archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$save_allow_undefined_flag else cat conftest.err 1>&5 fi]) AC_MSG_RESULT([$lt_cv_archive_cmds_need_lc]) ;; esac fi need_lc=${lt_cv_archive_cmds_need_lc-yes} # The second clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then : else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. test -f Makefile && make "$ltmain" fi if test -f "$ltmain"; then trap "$rm \"${ofile}T\"; exit 1" 1 2 15 $rm -f "${ofile}T" echo creating $ofile # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS SED \ AR AR_FLAGS CC LD LN_S NM SHELL \ reload_flag reload_cmds wl \ pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \ thread_safe_flag_spec whole_archive_flag_spec libname_spec \ library_names_spec soname_spec \ RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \ old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \ postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \ old_striplib striplib file_magic_cmd export_symbols_cmds \ deplibs_check_method allow_undefined_flag no_undefined_flag \ finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \ global_symbol_to_c_name_address \ hardcode_libdir_flag_spec hardcode_libdir_separator \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do case $var in reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ export_symbols_cmds | archive_cmds | archive_expsym_cmds | \ extract_expsyms_cmds | old_archive_from_expsyms_cmds | \ postinstall_cmds | postuninstall_cmds | \ finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done cat <<__EOF__ > "${ofile}T" #! $SHELL # `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996-2000 Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 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 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # 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. # A sed that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="${SED} -e s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi # ### BEGIN LIBTOOL CONFIG # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$need_lc # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # The default C compiler. CC=$lt_CC # Is the compiler the GNU C compiler? with_gcc=$GCC # The linker used to build libraries. LD=$lt_LD # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_wl # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_pic_flag pic_mode=$pic_mode # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_compiler_c_o # Can we write directly to a .lo ? compiler_o_lo=$lt_compiler_o_lo # Must we lock files when doing compilation ? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_link_static_flag # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_no_builtin_flag # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # ### END LIBTOOL CONFIG __EOF__ case $host_os in aix3*) cat <<\EOF >> "${ofile}T" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac case $host_os in cygwin* | mingw* | pw32* | os2*) cat <<'EOF' >> "${ofile}T" # This is a source program that is used to create dlls on Windows # Don't remove nor modify the starting and closing comments # /* ltdll.c starts here */ # #define WIN32_LEAN_AND_MEAN # #include # #undef WIN32_LEAN_AND_MEAN # #include # # #ifndef __CYGWIN__ # # ifdef __CYGWIN32__ # # define __CYGWIN__ __CYGWIN32__ # # endif # #endif # # #ifdef __cplusplus # extern "C" { # #endif # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); # #ifdef __cplusplus # } # #endif # # #ifdef __CYGWIN__ # #include # DECLARE_CYGWIN_DLL( DllMain ); # #endif # HINSTANCE __hDllInstance_base; # # BOOL APIENTRY # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) # { # __hDllInstance_base = hInst; # return TRUE; # } # /* ltdll.c ends here */ # This is a source program that is used to create import libraries # on Windows for dlls which lack them. Don't remove nor modify the # starting and closing comments # /* impgen.c starts here */ # /* Copyright (C) 1999-2000 Free Software Foundation, Inc. # # This file is part of GNU libtool. # # 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # */ # # #include /* for printf() */ # #include /* for open(), lseek(), read() */ # #include /* for O_RDONLY, O_BINARY */ # #include /* for strdup() */ # # /* O_BINARY isn't required (or even defined sometimes) under Unix */ # #ifndef O_BINARY # #define O_BINARY 0 # #endif # # static unsigned int # pe_get16 (fd, offset) # int fd; # int offset; # { # unsigned char b[2]; # lseek (fd, offset, SEEK_SET); # read (fd, b, 2); # return b[0] + (b[1]<<8); # } # # static unsigned int # pe_get32 (fd, offset) # int fd; # int offset; # { # unsigned char b[4]; # lseek (fd, offset, SEEK_SET); # read (fd, b, 4); # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); # } # # static unsigned int # pe_as32 (ptr) # void *ptr; # { # unsigned char *b = ptr; # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); # } # # int # main (argc, argv) # int argc; # char *argv[]; # { # int dll; # unsigned long pe_header_offset, opthdr_ofs, num_entries, i; # unsigned long export_rva, export_size, nsections, secptr, expptr; # unsigned long name_rvas, nexp; # unsigned char *expdata, *erva; # char *filename, *dll_name; # # filename = argv[1]; # # dll = open(filename, O_RDONLY|O_BINARY); # if (dll < 1) # return 1; # # dll_name = filename; # # for (i=0; filename[i]; i++) # if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':') # dll_name = filename + i +1; # # pe_header_offset = pe_get32 (dll, 0x3c); # opthdr_ofs = pe_header_offset + 4 + 20; # num_entries = pe_get32 (dll, opthdr_ofs + 92); # # if (num_entries < 1) /* no exports */ # return 1; # # export_rva = pe_get32 (dll, opthdr_ofs + 96); # export_size = pe_get32 (dll, opthdr_ofs + 100); # nsections = pe_get16 (dll, pe_header_offset + 4 +2); # secptr = (pe_header_offset + 4 + 20 + # pe_get16 (dll, pe_header_offset + 4 + 16)); # # expptr = 0; # for (i = 0; i < nsections; i++) # { # char sname[8]; # unsigned long secptr1 = secptr + 40 * i; # unsigned long vaddr = pe_get32 (dll, secptr1 + 12); # unsigned long vsize = pe_get32 (dll, secptr1 + 16); # unsigned long fptr = pe_get32 (dll, secptr1 + 20); # lseek(dll, secptr1, SEEK_SET); # read(dll, sname, 8); # if (vaddr <= export_rva && vaddr+vsize > export_rva) # { # expptr = fptr + (export_rva - vaddr); # if (export_rva + export_size > vaddr + vsize) # export_size = vsize - (export_rva - vaddr); # break; # } # } # # expdata = (unsigned char*)malloc(export_size); # lseek (dll, expptr, SEEK_SET); # read (dll, expdata, export_size); # erva = expdata - export_rva; # # nexp = pe_as32 (expdata+24); # name_rvas = pe_as32 (expdata+32); # # printf ("EXPORTS\n"); # for (i = 0; i> "${ofile}T" || (rm -f "${ofile}T"; exit 1) mv -f "${ofile}T" "$ofile" || \ (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T") chmod +x "$ofile" fi ])# _LT_AC_LTCONFIG_HACK # AC_LIBTOOL_DLOPEN - enable checks for dlopen support AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])]) # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])]) # AC_ENABLE_SHARED - implement the --enable-shared flag # Usage: AC_ENABLE_SHARED[(DEFAULT)] # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to # `yes'. AC_DEFUN([AC_ENABLE_SHARED], [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE(shared, changequote(<<, >>)dnl << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT], changequote([, ])dnl [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," for pkg in $enableval; do if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$ac_save_ifs" ;; esac], enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl ]) # AC_DISABLE_SHARED - set the default shared flag to --disable-shared AC_DEFUN([AC_DISABLE_SHARED], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_SHARED(no)]) # AC_ENABLE_STATIC - implement the --enable-static flag # Usage: AC_ENABLE_STATIC[(DEFAULT)] # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to # `yes'. AC_DEFUN([AC_ENABLE_STATIC], [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE(static, changequote(<<, >>)dnl << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT], changequote([, ])dnl [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," for pkg in $enableval; do if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$ac_save_ifs" ;; esac], enable_static=AC_ENABLE_STATIC_DEFAULT)dnl ]) # AC_DISABLE_STATIC - set the default static flag to --disable-static AC_DEFUN([AC_DISABLE_STATIC], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_STATIC(no)]) # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)] # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to # `yes'. AC_DEFUN([AC_ENABLE_FAST_INSTALL], [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE(fast-install, changequote(<<, >>)dnl << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT], changequote([, ])dnl [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," for pkg in $enableval; do if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$ac_save_ifs" ;; esac], enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl ]) # AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install AC_DEFUN([AC_DISABLE_FAST_INSTALL], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_FAST_INSTALL(no)]) # AC_LIBTOOL_PICMODE - implement the --with-pic flag # Usage: AC_LIBTOOL_PICMODE[(MODE)] # Where MODE is either `yes' or `no'. If omitted, it defaults to # `both'. AC_DEFUN([AC_LIBTOOL_PICMODE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl pic_mode=ifelse($#,1,$1,default)]) # AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library AC_DEFUN([AC_PATH_TOOL_PREFIX], [AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in /*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; ?:/*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. ;; *) ac_save_MAGIC_CMD="$MAGIC_CMD" IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="ifelse([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | egrep "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$ac_save_ifs" MAGIC_CMD="$ac_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi ]) # AC_PATH_MAGIC - find a file program which can recognise a shared library AC_DEFUN([AC_PATH_MAGIC], [AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH) else MAGIC_CMD=: fi fi ]) # AC_PROG_LD - find the path to the GNU or non-GNU linker AC_DEFUN([AC_PROG_LD], [AC_ARG_WITH(gnu-ld, [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by GCC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | [[A-Za-z]]:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then test "$with_gnu_ld" != no && break else test "$with_gnu_ld" != yes && break fi fi done IFS="$ac_save_ifs" else lt_cv_path_LD="$LD" # Let the user override the test with a path. fi]) LD="$lt_cv_path_LD" if test -n "$LD"; then AC_MSG_RESULT($LD) else AC_MSG_RESULT(no) fi test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) AC_PROG_LD_GNU ]) # AC_PROG_LD_GNU - AC_DEFUN([AC_PROG_LD_GNU], [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld, [# I'd rather use --version here, but apparently some GNU ld's only accept -v. if $LD -v 2>&1 &5; then lt_cv_prog_gnu_ld=yes else lt_cv_prog_gnu_ld=no fi]) with_gnu_ld=$lt_cv_prog_gnu_ld ]) # AC_PROG_LD_RELOAD_FLAG - find reload flag for linker # -- PORTME Some linkers may need a different reload flag. AC_DEFUN([AC_PROG_LD_RELOAD_FLAG], [AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag, [lt_cv_ld_reload_flag='-r']) reload_flag=$lt_cv_ld_reload_flag test -n "$reload_flag" && reload_flag=" $reload_flag" ]) # AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies # -- PORTME fill in with the dynamic library characteristics AC_DEFUN([AC_DEPLIBS_CHECK_METHOD], [AC_CACHE_CHECK([how to recognise dependent libraries], lt_cv_deplibs_check_method, [lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given egrep regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix4* | aix5*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi4*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin* | mingw* | pw32*) lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library' lt_cv_file_magic_cmd='/usr/bin/file -L' case "$host_os" in rhapsody* | darwin1.[[012]]) lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1` ;; *) # Darwin 1.3 on lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib' ;; esac ;; freebsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20*|hpux11*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; irix5* | irix6* | nonstopux*) case $host_os in irix5* | nonstopux*) # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" ;; *) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1" ;; esac lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux-gnu*) case $host_cpu in alpha* | hppa* | i*86 | mips | mipsel | powerpc* | sparc* | ia64* | s390* | x86_64*) lt_cv_deplibs_check_method=pass_all ;; *) # glibc up to 2.1.1 does not perform some relocations on ARM lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; esac lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so\.[[0-9]]+\.[[0-9]]+$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; openbsd*) lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object' else lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' fi ;; osf3* | osf4* | osf5*) # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' lt_cv_file_magic_test_file=/shlib/libc.so lt_cv_deplibs_check_method=pass_all ;; sco3.2v5*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all lt_cv_file_magic_test_file=/lib/libc.so ;; sysv5uw[[78]]* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; esac ;; esac ]) file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method ]) # AC_PROG_NM - find the path to a BSD-compatible name lister AC_DEFUN([AC_PROG_NM], [AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl AC_MSG_CHECKING([for BSD-compatible nm]) AC_CACHE_VAL(lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/${ac_tool_prefix}nm if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then lt_cv_path_NM="$tmp_nm -B" break elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then lt_cv_path_NM="$tmp_nm -p" break else lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags fi fi done IFS="$ac_save_ifs" test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi]) NM="$lt_cv_path_NM" AC_MSG_RESULT([$NM]) ]) # AC_CHECK_LIBM - check for math library AC_DEFUN([AC_CHECK_LIBM], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cygwin* | *-*-pw32*) # These system don't have libm ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, main, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, main, LIBM="-lm") ;; esac ]) # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for # the libltdl convenience library and LTDLINCL to the include flags for # the libltdl header and adds --enable-ltdl-convenience to the # configure arguments. Note that LIBLTDL and LTDLINCL are not # AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not # provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed # with '${top_builddir}/' and LTDLINCL will be prefixed with # '${top_srcdir}/' (note the single quotes!). If your package is not # flat and you're not using automake, define top_builddir and # top_srcdir appropriately in the Makefiles. AC_DEFUN([AC_LIBLTDL_CONVENIENCE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl case $enable_ltdl_convenience in no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; esac LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ]) # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for # the libltdl installable library and LTDLINCL to the include flags for # the libltdl header and adds --enable-ltdl-install to the configure # arguments. Note that LIBLTDL and LTDLINCL are not AC_SUBSTed, nor is # AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed # libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will # be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed # with '${top_srcdir}/' (note the single quotes!). If your package is # not flat and you're not using automake, define top_builddir and # top_srcdir appropriately in the Makefiles. # In the future, this macro may have to be called after AC_PROG_LIBTOOL. AC_DEFUN([AC_LIBLTDL_INSTALLABLE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_CHECK_LIB(ltdl, main, [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], [if test x"$enable_ltdl_install" = xno; then AC_MSG_WARN([libltdl not installed, but installation disabled]) else enable_ltdl_install=yes fi ]) if test x"$enable_ltdl_install" = x"yes"; then ac_configure_args="$ac_configure_args --enable-ltdl-install" LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) else ac_configure_args="$ac_configure_args --enable-ltdl-install=no" LIBLTDL="-lltdl" LTDLINCL= fi # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ]) # old names AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) # This is just to silence aclocal about the macro not being used ifelse([AC_DISABLE_FAST_INSTALL]) # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # # LT_AC_PROG_SED # -------------- # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. AC_DEFUN([LT_AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_executable_p="test -f" 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_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then _sed_list="$_sed_list $as_dir/$ac_prog$ac_exec_ext" fi done done done # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. : ${TMPDIR=/tmp} { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/sedXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=$TMPDIR/sed$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 { (exit 1); exit 1; } } _max=0 _count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for _sed in $_sed_list /usr/xpg4/bin/sed; do test ! -f ${_sed} && break cat /dev/null > "$tmp/sed.in" _count=0 echo ${ECHO_N-$ac_n} "0123456789${ECHO_C-$ac_c}" >"$tmp/sed.in" # Check for GNU sed and select it if it is found. if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then lt_cv_path_SED=${_sed} break fi while true; do cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp" mv "$tmp/sed.tmp" "$tmp/sed.in" cp "$tmp/sed.in" "$tmp/sed.nl" echo >>"$tmp/sed.nl" ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break # 40000 chars as input seems more than enough test $_count -gt 10 && break _count=`expr $_count + 1` if test $_count -gt $_max; then _max=$_count lt_cv_path_SED=$_sed fi done done rm -rf "$tmp" ]) if test "X$SED" != "X"; then lt_cv_path_SED=$SED else SED=$lt_cv_path_SED fi AC_MSG_RESULT([$SED]) ]) aplus-fsf-4.22/configure0000755000265000001440000154224410774512527010753 #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.57. # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 # 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. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; 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 # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. 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 ;; 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 { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # 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 sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="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="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Find the correct PATH separator. Usually this is `:', but # DJGPP uses `;' like DOS. if test "X${PATH_SEPARATOR+set}" != Xset; then UNAME=${UNAME-`uname 2>/dev/null`} case X$UNAME in *-DOS) lt_cv_sys_path_separator=';' ;; *) lt_cv_sys_path_separator=':' ;; esac PATH_SEPARATOR=$lt_cv_sys_path_separator fi # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` ;; esac echo=${ECHO-echo} if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null && echo_test_string="`eval $cmd`" && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. IFS="${IFS= }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL $0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL $0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "$0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" fi # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="src/dap/BcdPack.c" # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE CXX CXXFLAGS ac_ct_CXX CXXDEPMODE build build_cpu build_vendor build_os host host_cpu host_vendor host_os LN_S ECHO RANLIB ac_ct_RANLIB CPP EGREP LIBTOOL LIBTOOL_DEPS LIBOBJS X_INCLUDES X_LIBS CXXCPP LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false # 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. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= 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 ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -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 | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$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 ;; -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 ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) 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 ;; -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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=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 ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 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'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac 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 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 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 # 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 its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | 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 if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CXX_set=${CXX+set} ac_env_CXX_value=$CXX ac_cv_env_CXX_set=${CXX+set} ac_cv_env_CXX_value=$CXX ac_env_CXXFLAGS_set=${CXXFLAGS+set} ac_env_CXXFLAGS_value=$CXXFLAGS ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} ac_cv_env_CXXFLAGS_value=$CXXFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP ac_env_CXXCPP_set=${CXXCPP+set} ac_env_CXXCPP_value=$CXXCPP ac_cv_env_CXXCPP_set=${CXXCPP+set} ac_cv_env_CXXCPP_value=$CXXCPP # # 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 this package 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 \`..'] _ACEOF cat <<_ACEOF 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] --datadir=DIR read-only architecture-independent data [PREFIX/share] --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] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _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 X features: --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --disable-dependency-tracking Speeds up one-time builds --enable-dependency-tracking Do not reject slow dependency extractors --enable-shared=PKGS build shared libraries default=yes --enable-static=PKGS build static libraries default=yes --enable-fast-install=PKGS optimize for fast installation default=yes --disable-libtool-lock avoid locking (might break parallel builds) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gnu-ld assume the C compiler uses GNU ld default=no --with-pic try to use only PIC/non-PIC objects default=use both --with-x use the X Window System Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CXX C++ compiler command CXXFLAGS C++ compiler flags CPP C preprocessor CXXCPP 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. _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` cd $ac_dir # Check for guested configure; otherwise get Cygnus style 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 elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 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 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.57. Invocation command line was $ $0 $@ _ACEOF { 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` hostinfo = `(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=. echo "PATH: $as_dir" done } >&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_sep= 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core core.* *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >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 # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" 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. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 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 `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; 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,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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 ac_aux_dir= for ac_dir in config $srcdir/config; 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 { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in config $srcdir/config" >&5 echo "$as_me: error: cannot find install-sh or install.sh in config $srcdir/config" >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. am__api_version="1.6" # 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" # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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/* | \ /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_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 ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done 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. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$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' echo "$as_me:$LINENO: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 # Just in case sleep 1 echo timestamp > conftest.file # 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". { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}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 $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm conftest.sed # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi 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 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$AWK" && break done echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi # Define the identity of the package. PACKAGE=aplus-fsf VERSION=4.22 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"} AMTAR=${AMTAR-"${am_missing_run}tar"} install_sh=${install_sh-"$am_aux_dir/install-sh"} # 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 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi; echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6 if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE 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 # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl 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 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out 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. echo "$as_me:$LINENO: checking for C compiler default output" >&5 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= # b.out is created by i960 compilers. for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; conftest.$ac_ext ) # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$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 echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* 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; } 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 # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ ''\ '#include ' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext 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 rm -f .deps 2>/dev/null mkdir .deps 2>/dev/null if test -d .deps; then DEPDIR=.deps else # MS-DOS does not allow filenames that begin with a dot. DEPDIR=_deps fi rmdir .deps 2>/dev/null ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' doit: @echo done END # If we don't find an include directive, just comment out the code. echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi echo "$as_me:$LINENO: result: $_am_result" >&5 echo "${ECHO_T}$_am_result" >&6 rm -f confinc confmf # Check whether --enable-dependency-tracking or --disable-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="$CC" am_compiler_list= echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 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 for depmode in $am_compiler_list; do # 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. echo '#include "conftest.h"' > conftest.c echo 'int i;' > conftest.h echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf case $depmode in 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 ;; none) break ;; esac # 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. if depmode=$depmode \ source=conftest.c object=conftest.o \ depfile=conftest.Po tmpdepfile=conftest.TPo \ $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && grep conftest.h conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then am_cv_CC_dependencies_compiler_type=$depmode break fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type ac_ext=cc 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 -n "$ac_tool_prefix"; then for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC 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 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then echo "$as_me:$LINENO: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 echo "${ECHO_T}$ac_ct_CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CXX" && break done test -n "$ac_ct_CXX" || ac_ct_CXX="g++" CXX=$ac_ct_CXX fi # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C++ compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 if test "${ac_cv_cxx_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS CXXFLAGS="-g" echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cxx_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cxx_g=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 echo "${ECHO_T}$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 for ac_declaration in \ ''\ '#include ' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h 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="$CXX" am_compiler_list= echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 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 for depmode in $am_compiler_list; do # 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. echo '#include "conftest.h"' > conftest.c echo 'int i;' > conftest.h echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf case $depmode in 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 ;; none) break ;; esac # 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. if depmode=$depmode \ source=conftest.c object=conftest.o \ depfile=conftest.Po tmpdepfile=conftest.TPo \ $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && grep conftest.h conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then am_cv_CXX_dependencies_compiler_type=$depmode break fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6 CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type # Check whether --enable-shared or --disable-shared was given. if test "${enable_shared+set}" = set; then enableval="$enable_shared" p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," for pkg in $enableval; do if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$ac_save_ifs" ;; esac else enable_shared=yes fi; # Check whether --enable-static or --disable-static was given. if test "${enable_static+set}" = set; then enableval="$enable_static" p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," for pkg in $enableval; do if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$ac_save_ifs" ;; esac else enable_static=yes fi; # Check whether --enable-fast-install or --disable-fast-install was given. if test "${enable_fast_install+set}" = set; then enableval="$enable_fast_install" p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," for pkg in $enableval; do if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$ac_save_ifs" ;; esac else enable_fast_install=yes fi; # Make sure we can run config.sub. $ac_config_sub sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 echo "$as_me: error: cannot run $ac_config_sub" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6 if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_build_alias=$build_alias test -z "$ac_cv_build_alias" && ac_cv_build_alias=`$ac_config_guess` test -z "$ac_cv_build_alias" && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6 build=$ac_cv_build build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6 if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_host_alias=$host_alias test -z "$ac_cv_host_alias" && ac_cv_host_alias=$ac_cv_build_alias ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6 host=$ac_cv_host host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` # Find the correct PATH separator. Usually this is `:', but # DJGPP uses `;' like DOS. if test "X${PATH_SEPARATOR+set}" != Xset; then UNAME=${UNAME-`uname 2>/dev/null`} case X$UNAME in *-DOS) lt_cv_sys_path_separator=';' ;; *) lt_cv_sys_path_separator=':' ;; esac PATH_SEPARATOR=$lt_cv_sys_path_separator fi # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval="$with_gnu_ld" test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi; ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo "$as_me:$LINENO: checking for ld used by GCC" >&5 echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | [A-Za-z]:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 else echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then test "$with_gnu_ld" != no && break else test "$with_gnu_ld" != yes && break fi fi done IFS="$ac_save_ifs" else lt_cv_path_LD="$LD" # Let the user override the test with a path. fi fi LD="$lt_cv_path_LD" if test -n "$LD"; then echo "$as_me:$LINENO: result: $LD" >&5 echo "${ECHO_T}$LD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. if $LD -v 2>&1 &5; then lt_cv_prog_gnu_ld=yes else lt_cv_prog_gnu_ld=no fi fi echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 with_gnu_ld=$lt_cv_prog_gnu_ld echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 if test "${lt_cv_ld_reload_flag+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_ld_reload_flag='-r' fi echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6 reload_flag=$lt_cv_ld_reload_flag test -n "$reload_flag" && reload_flag=" $reload_flag" echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6 if test "${lt_cv_path_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/${ac_tool_prefix}nm if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then lt_cv_path_NM="$tmp_nm -B" break elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then lt_cv_path_NM="$tmp_nm -p" break else lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags fi fi done IFS="$ac_save_ifs" test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi fi NM="$lt_cv_path_NM" echo "$as_me:$LINENO: result: $NM" >&5 echo "${ECHO_T}$NM" >&6 echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6 if test "${lt_cv_path_SED+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_executable_p="test -f" 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_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then _sed_list="$_sed_list $as_dir/$ac_prog$ac_exec_ext" fi done done done # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. : ${TMPDIR=/tmp} { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/sedXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=$TMPDIR/sed$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 { (exit 1); exit 1; } } _max=0 _count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for _sed in $_sed_list /usr/xpg4/bin/sed; do test ! -f ${_sed} && break cat /dev/null > "$tmp/sed.in" _count=0 echo ${ECHO_N-$ac_n} "0123456789${ECHO_C-$ac_c}" >"$tmp/sed.in" # Check for GNU sed and select it if it is found. if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then lt_cv_path_SED=${_sed} break fi while true; do cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp" mv "$tmp/sed.tmp" "$tmp/sed.in" cp "$tmp/sed.in" "$tmp/sed.nl" echo >>"$tmp/sed.nl" ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break # 40000 chars as input seems more than enough test $_count -gt 10 && break _count=`expr $_count + 1` if test $_count -gt $_max; then _max=$_count lt_cv_path_SED=$_sed fi done done rm -rf "$tmp" fi if test "X$SED" != "X"; then lt_cv_path_SED=$SED else SED=$lt_cv_path_SED fi echo "$as_me:$LINENO: result: $SED" >&5 echo "${ECHO_T}$SED" >&6 echo "$as_me:$LINENO: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no, using $LN_S" >&5 echo "${ECHO_T}no, using $LN_S" >&6 fi echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6 if test "${lt_cv_deplibs_check_method+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given egrep regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix4* | aix5*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi4*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin* | mingw* | pw32*) lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library' lt_cv_file_magic_cmd='/usr/bin/file -L' case "$host_os" in rhapsody* | darwin1.[012]) lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1` ;; *) # Darwin 1.3 on lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib' ;; esac ;; freebsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20*|hpux11*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; irix5* | irix6* | nonstopux*) case $host_os in irix5* | nonstopux*) # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" ;; *) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" ;; esac lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux-gnu*) case $host_cpu in alpha* | hppa* | i*86 | mips | mipsel | powerpc* | sparc* | ia64* | s390* | x86_64*) lt_cv_deplibs_check_method=pass_all ;; *) # glibc up to 2.1.1 does not perform some relocations on ARM lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; esac lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' else lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; openbsd*) lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object' else lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' fi ;; osf3* | osf4* | osf5*) # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' lt_cv_file_magic_test_file=/shlib/libc.so lt_cv_deplibs_check_method=pass_all ;; sco3.2v5*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all lt_cv_file_magic_test_file=/lib/libc.so ;; sysv5uw[78]* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; esac ;; esac fi echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6 file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method # Check for command to grab the raw symbol name followed by C symbol from nm. echo "$as_me:$LINENO: checking command to parse $NM output" >&5 echo $ECHO_N "checking command to parse $NM output... $ECHO_C" >&6 if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Transform the above into a raw symbol and a C symbol. symxfrm='\1 \2\3 \3' # Transform an extracted symbol line into a proper C declaration lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32*) symcode='[ABCDGISTW]' ;; hpux*) # Its linker distinguishes data from code symbols lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris* | sysv5*) symcode='[BDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $host_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # If we're using GNU nm, then use its standard symbol codes. if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then symcode='[ABCDGISTW]' fi # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Write the raw and C identifiers. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Now try to grab the symbols. nlist=conftest.nm if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if egrep ' nm_test_var$' "$nlist" >/dev/null; then if egrep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr void * #else # define lt_ptr char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr address; } lt_preloaded_symbols[] = { EOF sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$no_builtin_flag" if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi global_symbol_pipe="$lt_cv_sys_global_symbol_pipe" if test -z "$lt_cv_sys_global_symbol_pipe"; then global_symbol_to_cdecl= global_symbol_to_c_name_address= else global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl" global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address" fi if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address"; then echo "$as_me:$LINENO: result: failed" >&5 echo "${ECHO_T}failed" >&6 else echo "$as_me:$LINENO: result: ok" >&5 echo "${ECHO_T}ok" >&6 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 echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f 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 echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$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 >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } 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 echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f 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 >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #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)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF 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=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX ## ------------------------------------ ## ## Report this to bug-autoconf@gnu.org. ## ## ------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; no:yes ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX ## ------------------------------------ ## ## Report this to bug-autoconf@gnu.org. ## ## ------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in /*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; ?:/*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. ;; *) ac_save_MAGIC_CMD="$MAGIC_CMD" IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="/usr/bin:$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | egrep "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$ac_save_ifs" MAGIC_CMD="$ac_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo "$as_me:$LINENO: checking for file" >&5 echo $ECHO_N "checking for file... $ECHO_C" >&6 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in /*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; ?:/*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. ;; *) ac_save_MAGIC_CMD="$MAGIC_CMD" IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="/usr/bin:$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | egrep "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$ac_save_ifs" MAGIC_CMD="$ac_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi else MAGIC_CMD=: fi fi fi ;; esac 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 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi RANLIB=$ac_ct_RANLIB else RANLIB="$ac_cv_prog_RANLIB" fi 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 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi enable_dlopen=no enable_win32_dll=no # Check whether --enable-libtool-lock or --disable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval="$enable_libtool_lock" fi; test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in *-*-irix6*) # Find out which ABI we are using. echo '#line 4970 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 if test "${lt_cv_cc_needs_belf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then lt_cv_cc_needs_belf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_cc_needs_belf=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 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 fi echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e s/^X//' sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except M$VC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" need_locks="$enable_libtool_lock" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o if test x"$host" != x"$build"; then ac_tool_prefix=${host_alias}- else ac_tool_prefix= fi # Transform linux* to *-*-linux-gnu*, to support old configure scripts. case $host_os in linux-gnu*) ;; linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` esac case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" ;; *) old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi # Allow CC to be a program name with arguments. set dummy $CC compiler="$2" echo "$as_me:$LINENO: checking for objdir" >&5 echo $ECHO_N "checking for objdir... $ECHO_C" >&6 rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. objdir=_libs fi rmdir .libs 2>/dev/null echo "$as_me:$LINENO: result: $objdir" >&5 echo "${ECHO_T}$objdir" >&6 # Check whether --with-pic or --without-pic was given. if test "${with_pic+set}" = set; then withval="$with_pic" pic_mode="$withval" else pic_mode=default fi; test -z "$pic_mode" && pic_mode=default # We assume here that the value for lt_cv_prog_cc_pic will not be cached # in isolation, and that seeing it set (from the cache) indicates that # the associated values are set (in the cache) correctly too. echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 if test "${lt_cv_prog_cc_pic+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_cc_pic= lt_cv_prog_cc_shlib= lt_cv_prog_cc_wl= lt_cv_prog_cc_static= lt_cv_prog_cc_no_builtin= lt_cv_prog_cc_can_build_shared=$can_build_shared if test "$GCC" = yes; then lt_cv_prog_cc_wl='-Wl,' lt_cv_prog_cc_static='-static' case $host_os in aix*) # Below there is a dirty hack to force normal static linking with -ldl # The problem is because libdl dynamically linked with both libc and # libC (AIX C++ library), which obviously doesn't included in libraries # list by gcc. This cause undefined symbols with -static flags. # This hack allows C programs to be linked with "-static -ldl", but # not sure about C++ programs. lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC" ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4' ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_cv_prog_cc_pic='-fno-common' ;; cygwin* | mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_cv_prog_cc_pic='-DDLL_EXPORT' ;; sysv4*MP*) if test -d /usr/nec; then lt_cv_prog_cc_pic=-Kconform_pic fi ;; *) lt_cv_prog_cc_pic='-fPIC' ;; esac else # PORTME Check for PIC flags for the system compiler. case $host_os in aix3* | aix4* | aix5*) lt_cv_prog_cc_wl='-Wl,' # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_cv_prog_cc_static='-Bstatic' else lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp' fi ;; hpux9* | hpux10* | hpux11*) # Is there a better lt_cv_prog_cc_static that works with the bundled CC? lt_cv_prog_cc_wl='-Wl,' lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive" lt_cv_prog_cc_pic='+Z' ;; irix5* | irix6* | nonstopux*) lt_cv_prog_cc_wl='-Wl,' lt_cv_prog_cc_static='-non_shared' # PIC (with -KPIC) is the default. ;; cygwin* | mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_cv_prog_cc_pic='-DDLL_EXPORT' ;; newsos6) lt_cv_prog_cc_pic='-KPIC' lt_cv_prog_cc_static='-Bstatic' ;; osf3* | osf4* | osf5*) # All OSF/1 code is PIC. lt_cv_prog_cc_wl='-Wl,' lt_cv_prog_cc_static='-non_shared' ;; sco3.2v5*) lt_cv_prog_cc_pic='-Kpic' lt_cv_prog_cc_static='-dn' lt_cv_prog_cc_shlib='-belf' ;; solaris*) lt_cv_prog_cc_pic='-KPIC' lt_cv_prog_cc_static='-Bstatic' lt_cv_prog_cc_wl='-Wl,' ;; sunos4*) lt_cv_prog_cc_pic='-PIC' lt_cv_prog_cc_static='-Bstatic' lt_cv_prog_cc_wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) lt_cv_prog_cc_pic='-KPIC' lt_cv_prog_cc_static='-Bstatic' lt_cv_prog_cc_wl='-Wl,' ;; uts4*) lt_cv_prog_cc_pic='-pic' lt_cv_prog_cc_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_cv_prog_cc_pic='-Kconform_pic' lt_cv_prog_cc_static='-Bstatic' fi ;; *) lt_cv_prog_cc_can_build_shared=no ;; esac fi fi if test -z "$lt_cv_prog_cc_pic"; then echo "$as_me:$LINENO: result: none" >&5 echo "${ECHO_T}none" >&6 else echo "$as_me:$LINENO: result: $lt_cv_prog_cc_pic" >&5 echo "${ECHO_T}$lt_cv_prog_cc_pic" >&6 # Check to make sure the pic_flag actually works. echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_cv_prog_cc_pic works... $ECHO_C" >&6 if test "${lt_cv_prog_cc_pic_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then case $host_os in hpux9* | hpux10* | hpux11*) # On HP-UX, both CC and GCC only warn that PIC is supported... then # they create non-PIC objects. So, if there were any warnings, we # assume that PIC is not supported. if test -s conftest.err; then lt_cv_prog_cc_pic_works=no else lt_cv_prog_cc_pic_works=yes fi ;; *) lt_cv_prog_cc_pic_works=yes ;; esac else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_prog_cc_pic_works=no fi rm -f conftest.$ac_objext conftest.$ac_ext CFLAGS="$save_CFLAGS" fi if test "X$lt_cv_prog_cc_pic_works" = Xno; then lt_cv_prog_cc_pic= lt_cv_prog_cc_can_build_shared=no else lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic" fi echo "$as_me:$LINENO: result: $lt_cv_prog_cc_pic_works" >&5 echo "${ECHO_T}$lt_cv_prog_cc_pic_works" >&6 fi # Check for any special shared library compilation flags. if test -n "$lt_cv_prog_cc_shlib"; then { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" >&5 echo "$as_me: WARNING: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" >&2;} if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$lt_cv_prog_cc_shlib[ ]" >/dev/null; then : else { echo "$as_me:$LINENO: WARNING: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5 echo "$as_me: WARNING: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;} lt_cv_prog_cc_can_build_shared=no fi fi echo "$as_me:$LINENO: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_cv_prog_cc_static works... $ECHO_C" >&6 if test "${lt_cv_prog_cc_static_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_cc_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then lt_cv_prog_cc_static_works=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi # Belt *and* braces to stop my trousers falling down: test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static= echo "$as_me:$LINENO: result: $lt_cv_prog_cc_static_works" >&5 echo "${ECHO_T}$lt_cv_prog_cc_static_works" >&6 pic_flag="$lt_cv_prog_cc_pic" special_shlib_compile_flags="$lt_cv_prog_cc_shlib" wl="$lt_cv_prog_cc_wl" link_static_flag="$lt_cv_prog_cc_static" no_builtin_flag="$lt_cv_prog_cc_no_builtin" can_build_shared="$lt_cv_prog_cc_can_build_shared" # Check to see if options -o and -c are simultaneously supported by compiler echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_compiler_c_o+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else $rm -r conftest 2>/dev/null mkdir conftest cd conftest echo "int some_variable = 0;" > conftest.$ac_ext mkdir out # According to Tom Tromey, Ian Lance Taylor reported there are C compilers # that will create temporary files in the current directory regardless of # the output directory. Thus, making CWD read-only will cause this test # to fail, enabling locking or at least warning the user not to do parallel # builds. chmod -w . save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -o out/conftest2.$ac_objext" compiler_c_o=no if { (eval echo configure:5499: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s out/conftest.err; then lt_cv_compiler_c_o=no else lt_cv_compiler_c_o=yes fi else # Append any errors to the config.log. cat out/conftest.err 1>&5 lt_cv_compiler_c_o=no fi CFLAGS="$save_CFLAGS" chmod u+w . $rm conftest* out/* rmdir out cd .. rmdir conftest $rm -r conftest 2>/dev/null fi compiler_c_o=$lt_cv_compiler_c_o echo "$as_me:$LINENO: result: $compiler_c_o" >&5 echo "${ECHO_T}$compiler_c_o" >&6 if test x"$compiler_c_o" = x"yes"; then # Check to see if we can write to a .lo echo "$as_me:$LINENO: checking if $compiler supports -c -o file.lo" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.lo... $ECHO_C" >&6 if test "${lt_cv_compiler_o_lo+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_compiler_o_lo=no save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -c -o conftest.lo" save_objext="$ac_objext" ac_objext=lo cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { int some_variable = 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then lt_cv_compiler_o_lo=no else lt_cv_compiler_o_lo=yes fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext ac_objext="$save_objext" CFLAGS="$save_CFLAGS" fi compiler_o_lo=$lt_cv_compiler_o_lo echo "$as_me:$LINENO: result: $compiler_o_lo" >&5 echo "${ECHO_T}$compiler_o_lo" >&6 else compiler_o_lo=no fi # Check to see if we can do hard links to lock some files if needed hard_links="nottested" if test "$compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi if test "$GCC" = yes; then # Check to see if options -fno-rtti -fno-exceptions are supported by compiler echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 echo "int some_variable = 0;" > conftest.$ac_ext save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext" compiler_rtti_exceptions=no cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { int some_variable = 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then compiler_rtti_exceptions=no else compiler_rtti_exceptions=yes fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext CFLAGS="$save_CFLAGS" echo "$as_me:$LINENO: result: $compiler_rtti_exceptions" >&5 echo "${ECHO_T}$compiler_rtti_exceptions" >&6 if test "$compiler_rtti_exceptions" = "yes"; then no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' else no_builtin_flag=' -fno-builtin' fi fi # See if the linker supports building shared libraries. echo "$as_me:$LINENO: checking whether the linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the linker ($LD) supports shared libraries... $ECHO_C" >&6 allow_undefined_flag= no_undefined_flag= need_lib_prefix=unknown need_version=unknown # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments archive_cmds= archive_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= export_dynamic_flag_spec= whole_archive_flag_spec= thread_safe_flag_spec= hardcode_into_libs=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no hardcode_shlibpath_var=unsupported runpath_var= link_all_deplibs=unknown always_export_symbols=no export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an egrep regular expression of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX, the GNU linker is very broken # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available. ld_shlibs=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32*) # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported always_export_symbols=yes extract_expsyms_cmds='test -f $output_objdir/impgen.c || \ sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~ test -f $output_objdir/impgen.exe || (cd $output_objdir && \ if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \ else $CC -o impgen impgen.c ; fi)~ $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def' old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib' # cygwin and mingw dlls have different entry points and sets of symbols # to exclude. # FIXME: what about values for MSVC? dll_entry=__cygwin_dll_entry@12 dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~ case $host_os in mingw*) # mingw values dll_entry=_DllMainCRTStartup@12 dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~ ;; esac # mingw and cygwin differ, and it's simplest to just exclude the union # of the two symbol sets. dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12 # recent cygwin and mingw systems supply a stub DllMain which the user # can override, but on older systems we have to supply one (in ltdll.c) if test "x$lt_cv_need_dllmain" = "xyes"; then ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext " ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~ test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~' else ltdll_obj= ltdll_cmds= fi # Extract the symbol export list from an `--export-all' def file, # then regenerate the def file from the symbol export list, so that # the compiled dll only exports the symbol export list. # Be careful not to strip the DATA tag left be newer dlltools. export_symbols_cmds="$ltdll_cmds"' $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~ sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is. # If DATA tags from a recent dlltool are present, honour them! archive_expsym_cmds='if test "x`sed 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname-def; else echo EXPORTS > $output_objdir/$soname-def; _lt_hint=1; cat $export_symbols | while read symbol; do set dummy \$symbol; case \$# in 2) echo " \$2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;; 4) echo " \$2 \$3 \$4 ; " >> $output_objdir/$soname-def; _lt_hint=`expr \$_lt_hint - 1`;; *) echo " \$2 @ \$_lt_hint \$3 ; " >> $output_objdir/$soname-def;; esac; _lt_hint=`expr 1 + \$_lt_hint`; done; fi~ '"$ltdll_cmds"' $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~ $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~ $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags' ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris* | sysv5*) if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = yes; then runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' case $host_os in cygwin* | mingw* | pw32*) # dlltool doesn't understand --whole-archive et. al. whole_archive_flag_spec= ;; *) # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi ;; esac fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. hardcode_direct=yes archive_cmds='' hardcode_libdir_separator=':' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct=yes else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi esac shared_flag='-shared' else # not using gcc if test "$host_cpu" = ia64; then shared_flag='${wl}-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall can do strange things, so it is better to # generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib' # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. allow_undefined_flag='${wl}-berok' # This is a bit strange, but is similar to how AIX traditionally builds # it's shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname' fi fi ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' ;; darwin* | rhapsody*) case "$host_os" in rhapsody* | darwin1.[012]) allow_undefined_flag='-undefined suppress' ;; *) # Darwin 1.3 on allow_undefined_flag='-flat_namespace -undefined suppress' ;; esac # FIXME: Relying on posixy $() will cause problems for # cross-compilation, but unfortunately the echo tests do not # yet detect zsh echo's removal of \ escapes. Also zsh mangles # `"' quotes if we put them in here... so don't! archive_cmds='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs && $CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib ${lib}-master.o $deplibs$linker_flags $(test .$module != .yes && echo -install_name $rpath/$soname $verstring)' # We need to add '_' to the symbols in $export_symbols first #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols' hardcode_direct=yes hardcode_shlibpath_var=no whole_archive_flag_spec='-all_load $convenience' ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9* | hpux10* | hpux11*) case $host_os in hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;; *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_minus_L=yes # Not in the search PATH, but as the default # location of the library. export_dynamic_flag_spec='${wl}-E' ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: link_all_deplibs=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; openbsd*) hardcode_direct=yes hardcode_shlibpath_var=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case "$host_os" in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' #Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; sco3.2v5*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes export_dynamic_flag_spec='${wl}-Bexport' ;; solaris*) # gcc --version < 3.0 without binutils cannot create self contained # shared libraries reliably, requiring libgcc.a to resolve some of # the object symbols generated in some cases. Libraries that use # assert need libgcc.a to resolve __eprintf, for example. Linking # a copy of libgcc.a into every shared library to guarantee resolving # such symbols causes other problems: According to Tim Van Holder # , C++ libraries end up with a separate # (to the application) exception stack for one thing. no_undefined_flag=' -z defs' if test "$GCC" = yes; then case `$CC --version 2>/dev/null` in [12].*) cat <&2 *** Warning: Releases of GCC earlier than version 3.0 cannot reliably *** create self contained shared libraries on Solaris systems, without *** introducing a dependency on libgcc.a. Therefore, libtool is disabling *** -no-undefined support, which will at least allow you to build shared *** libraries. However, you may find that when you link such libraries *** into an application without using GCC, you have to manually add *** \`gcc --print-libgcc-file-name\` to the link command. We urge you to *** upgrade to a newer version of GCC. Another option is to rebuild your *** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer. EOF no_undefined_flag= ;; esac fi # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv5*) no_undefined_flag=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec= hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4.2uw2*) archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=no hardcode_shlibpath_var=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; sysv5uw7* | unixware7*) no_undefined_flag='${wl}-z ${wl}text' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac fi echo "$as_me:$LINENO: result: $ld_shlibs" >&5 echo "${ECHO_T}$ld_shlibs" >&6 test "$ld_shlibs" = no && can_build_shared=no # Check hardcoding attributes. echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var"; then # We can hardcode non-existant directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$hardcode_shlibpath_var" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action" >&5 echo "${ECHO_T}$hardcode_action" >&6 striplib= old_striplib= echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi reload_cmds='$LD$reload_flag -o $output$reload_objs' test -z "$deplibs_check_method" && deplibs_check_method=unknown # PORTME Fill in your ld.so characteristics echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}.so$versuffix $libname.a' shlibpath_var=LIBPATH # AIX has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}.so$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can # not hardcode correct soname into executable. Probably we can # add versioning support to collect2, so additional links can # be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}.so$major' fi shlibpath_var=LIBPATH fi hardcode_into_libs=yes ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' ;; beos*) library_names_spec='${libname}.so' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi4*) version_type=linux need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" export_dynamic_flag_spec=-rdynamic # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin*) library_names_spec='$libname.dll.a' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog .libs/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' ;; yes,mingw*) library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g" -e "s,=/,/,g"` ;; yes,pw32*) library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/./-/g'`${versuffix}.dll' ;; *) library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no # FIXME: Relying on posixy $() will cause problems for # cross-compilation, but unfortunately the echo tests do not # yet detect zsh echo's removal of \ escapes. library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)' soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; *) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. dynamic_linker="$host_os dld.sl" version_type=sunos need_lib_prefix=no need_version=no shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' soname_spec='${libname}${release}.sl$major' # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) version_type=irix ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}.so$major' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" ;; # No shared lib support for Linux oldld, aout, or coff. linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) dynamic_linker=no ;; # This must be Linux ELF. linux-gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' # Find out which ABI we are using (multilib Linux x86_64 hack). libsuff= case "$host_cpu" in x86_64*|s390x*) echo '#line 6683 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$ac_objext` in *64-bit*) libsuff=64 ;; esac fi rm -rf conftest* ;; *) ;; esac sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}" sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so' soname_spec='${libname}${release}.so$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no need_version=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case "$host_os" in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH ;; os2*) libname_spec='$name' need_lib_prefix=no library_names_spec='$libname.dll $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_version=no soname_spec='${libname}${release}.so$major' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" hardcode_into_libs=yes ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}.so$major' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; uts4*) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' soname_spec='$libname.so.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no # Report the final consequences. echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $can_build_shared" >&5 echo "${ECHO_T}$can_build_shared" >&6 echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case "$host_os" in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac echo "$as_me:$LINENO: result: $enable_shared" >&5 echo "${ECHO_T}$enable_shared" >&6 echo "$as_me:$LINENO: checking whether to build static libraries" >&5 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes echo "$as_me:$LINENO: result: $enable_static" >&5 echo "${ECHO_T}$enable_static" >&6 if test "$hardcode_action" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; cygwin* | mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; *) echo "$as_me:$LINENO: checking for shl_load" >&5 echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 if test "${ac_cv_func_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); /* 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_shl_load) || defined (__stub___shl_load) choke me #else char (*f) () = shl_load; #endif #ifdef __cplusplus } #endif int main () { return f != shl_load; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 echo "${ECHO_T}$ac_cv_func_shl_load" >&6 if test $ac_cv_func_shl_load = yes; then lt_cv_dlopen="shl_load" else echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); int main () { shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 if test $ac_cv_lib_dld_shl_load = yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else echo "$as_me:$LINENO: checking for dlopen" >&5 echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 if test "${ac_cv_func_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); /* 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_dlopen) || defined (__stub___dlopen) choke me #else char (*f) () = dlopen; #endif #ifdef __cplusplus } #endif int main () { return f != dlopen; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 echo "${ECHO_T}$ac_cv_func_dlopen" >&6 if test $ac_cv_func_dlopen = yes; then lt_cv_dlopen="dlopen" else echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 if test "${ac_cv_lib_svld_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 if test $ac_cv_lib_svld_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_dld_link+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dld_link (); int main () { dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_dld_link=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 if test $ac_cv_lib_dld_dld_link = yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 echo "${ECHO_T}$lt_cv_dlopen_self" >&6 if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 if test "${lt_cv_archive_cmds_need_lc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else $rm conftest* echo 'static int dummy;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_cv_prog_cc_wl compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$save_allow_undefined_flag else cat conftest.err 1>&5 fi fi echo "$as_me:$LINENO: result: $lt_cv_archive_cmds_need_lc" >&5 echo "${ECHO_T}$lt_cv_archive_cmds_need_lc" >&6 ;; esac fi need_lc=${lt_cv_archive_cmds_need_lc-yes} # The second clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then : else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. test -f Makefile && make "$ltmain" fi if test -f "$ltmain"; then trap "$rm \"${ofile}T\"; exit 1" 1 2 15 $rm -f "${ofile}T" echo creating $ofile # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS SED \ AR AR_FLAGS CC LD LN_S NM SHELL \ reload_flag reload_cmds wl \ pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \ thread_safe_flag_spec whole_archive_flag_spec libname_spec \ library_names_spec soname_spec \ RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \ old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \ postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \ old_striplib striplib file_magic_cmd export_symbols_cmds \ deplibs_check_method allow_undefined_flag no_undefined_flag \ finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \ global_symbol_to_c_name_address \ hardcode_libdir_flag_spec hardcode_libdir_separator \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do case $var in reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ export_symbols_cmds | archive_cmds | archive_expsym_cmds | \ extract_expsyms_cmds | old_archive_from_expsyms_cmds | \ postinstall_cmds | postuninstall_cmds | \ finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done cat <<__EOF__ > "${ofile}T" #! $SHELL # `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996-2000 Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 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 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # 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. # A sed that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="${SED} -e s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi # ### BEGIN LIBTOOL CONFIG # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$need_lc # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # The default C compiler. CC=$lt_CC # Is the compiler the GNU C compiler? with_gcc=$GCC # The linker used to build libraries. LD=$lt_LD # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_wl # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_pic_flag pic_mode=$pic_mode # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_compiler_c_o # Can we write directly to a .lo ? compiler_o_lo=$lt_compiler_o_lo # Must we lock files when doing compilation ? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_link_static_flag # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_no_builtin_flag # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # ### END LIBTOOL CONFIG __EOF__ case $host_os in aix3*) cat <<\EOF >> "${ofile}T" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac case $host_os in cygwin* | mingw* | pw32* | os2*) cat <<'EOF' >> "${ofile}T" # This is a source program that is used to create dlls on Windows # Don't remove nor modify the starting and closing comments # /* ltdll.c starts here */ # #define WIN32_LEAN_AND_MEAN # #include # #undef WIN32_LEAN_AND_MEAN # #include # # #ifndef __CYGWIN__ # # ifdef __CYGWIN32__ # # define __CYGWIN__ __CYGWIN32__ # # endif # #endif # # #ifdef __cplusplus # extern "C" { # #endif # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); # #ifdef __cplusplus # } # #endif # # #ifdef __CYGWIN__ # #include # DECLARE_CYGWIN_DLL( DllMain ); # #endif # HINSTANCE __hDllInstance_base; # # BOOL APIENTRY # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) # { # __hDllInstance_base = hInst; # return TRUE; # } # /* ltdll.c ends here */ # This is a source program that is used to create import libraries # on Windows for dlls which lack them. Don't remove nor modify the # starting and closing comments # /* impgen.c starts here */ # /* Copyright (C) 1999-2000 Free Software Foundation, Inc. # # This file is part of GNU libtool. # # 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # */ # # #include /* for printf() */ # #include /* for open(), lseek(), read() */ # #include /* for O_RDONLY, O_BINARY */ # #include /* for strdup() */ # # /* O_BINARY isn't required (or even defined sometimes) under Unix */ # #ifndef O_BINARY # #define O_BINARY 0 # #endif # # static unsigned int # pe_get16 (fd, offset) # int fd; # int offset; # { # unsigned char b[2]; # lseek (fd, offset, SEEK_SET); # read (fd, b, 2); # return b[0] + (b[1]<<8); # } # # static unsigned int # pe_get32 (fd, offset) # int fd; # int offset; # { # unsigned char b[4]; # lseek (fd, offset, SEEK_SET); # read (fd, b, 4); # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); # } # # static unsigned int # pe_as32 (ptr) # void *ptr; # { # unsigned char *b = ptr; # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); # } # # int # main (argc, argv) # int argc; # char *argv[]; # { # int dll; # unsigned long pe_header_offset, opthdr_ofs, num_entries, i; # unsigned long export_rva, export_size, nsections, secptr, expptr; # unsigned long name_rvas, nexp; # unsigned char *expdata, *erva; # char *filename, *dll_name; # # filename = argv[1]; # # dll = open(filename, O_RDONLY|O_BINARY); # if (dll < 1) # return 1; # # dll_name = filename; # # for (i=0; filename[i]; i++) # if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':') # dll_name = filename + i +1; # # pe_header_offset = pe_get32 (dll, 0x3c); # opthdr_ofs = pe_header_offset + 4 + 20; # num_entries = pe_get32 (dll, opthdr_ofs + 92); # # if (num_entries < 1) /* no exports */ # return 1; # # export_rva = pe_get32 (dll, opthdr_ofs + 96); # export_size = pe_get32 (dll, opthdr_ofs + 100); # nsections = pe_get16 (dll, pe_header_offset + 4 +2); # secptr = (pe_header_offset + 4 + 20 + # pe_get16 (dll, pe_header_offset + 4 + 16)); # # expptr = 0; # for (i = 0; i < nsections; i++) # { # char sname[8]; # unsigned long secptr1 = secptr + 40 * i; # unsigned long vaddr = pe_get32 (dll, secptr1 + 12); # unsigned long vsize = pe_get32 (dll, secptr1 + 16); # unsigned long fptr = pe_get32 (dll, secptr1 + 20); # lseek(dll, secptr1, SEEK_SET); # read(dll, sname, 8); # if (vaddr <= export_rva && vaddr+vsize > export_rva) # { # expptr = fptr + (export_rva - vaddr); # if (export_rva + export_size > vaddr + vsize) # export_size = vsize - (export_rva - vaddr); # break; # } # } # # expdata = (unsigned char*)malloc(export_size); # lseek (dll, expptr, SEEK_SET); # read (dll, expdata, export_size); # erva = expdata - export_rva; # # nexp = pe_as32 (expdata+24); # name_rvas = pe_as32 (expdata+32); # # printf ("EXPORTS\n"); # for (i = 0; i> "${ofile}T" || (rm -f "${ofile}T"; exit 1) mv -f "${ofile}T" "$ofile" || \ (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T") chmod +x "$ofile" fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' # Prevent multiple expansion # 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" # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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/* | \ /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_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 ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done 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. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$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' LIBS="$LIBS -lm" echo "$as_me:$LINENO: checking for main in -ldl" >&5 echo $ECHO_N "checking for main in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_main=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_main" >&5 echo "${ECHO_T}$ac_cv_lib_dl_main" >&6 if test $ac_cv_lib_dl_main = yes; then LIBS="-ldl $LIBS" fi echo "$as_me:$LINENO: checking for main in -lnsl" >&5 echo $ECHO_N "checking for main in -lnsl... $ECHO_C" >&6 if test "${ac_cv_lib_nsl_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_nsl_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_main=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_main" >&5 echo "${ECHO_T}$ac_cv_lib_nsl_main" >&6 if test $ac_cv_lib_nsl_main = yes; then LIBS="-lnsl $LIBS" fi echo "$as_me:$LINENO: checking for main in -lpthread" >&5 echo $ECHO_N "checking for main in -lpthread... $ECHO_C" >&6 if test "${ac_cv_lib_pthread_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_pthread_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread_main=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_main" >&5 echo "${ECHO_T}$ac_cv_lib_pthread_main" >&6 if test $ac_cv_lib_pthread_main = yes; then LIBS="-lpthread $LIBS" fi if test $ac_cv_c_compiler_gnu = yes; then echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6 if test "${ac_cv_prog_gcc_traditional+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_pattern="Autoconf.*'x'" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include Autoconf TIOCGETP _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then ac_cv_prog_gcc_traditional=yes else ac_cv_prog_gcc_traditional=no fi rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include Autoconf TCGETA _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then ac_cv_prog_gcc_traditional=yes fi rm -f conftest* fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6 if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi echo "$as_me:$LINENO: checking for working memcmp" >&5 echo $ECHO_N "checking for working memcmp... $ECHO_C" >&6 if test "${ac_cv_func_memcmp_working+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_memcmp_working=no else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* Some versions of memcmp are not 8-bit clean. */ char c0 = 0x40, c1 = 0x80, c2 = 0x81; if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0) exit (1); /* The Next x86 OpenStep bug shows up only when comparing 16 bytes or more and with at least one buffer not starting on a 4-byte boundary. William Lewis provided this test program. */ { char foo[21]; char bar[21]; int i; for (i = 0; i < 4; i++) { char *a = foo + i; char *b = bar + i; strcpy (a, "--------01111111"); strcpy (b, "--------10000000"); if (memcmp (a, b, 16) >= 0) exit (1); } exit (0); } ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_memcmp_working=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_memcmp_working=no fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_memcmp_working" >&5 echo "${ECHO_T}$ac_cv_func_memcmp_working" >&6 test $ac_cv_func_memcmp_working = no && LIBOBJS="$LIBOBJS memcmp.$ac_objext" for ac_header in stdlib.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX ## ------------------------------------ ## ## Report this to bug-autoconf@gnu.org. ## ## ------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; no:yes ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX ## ------------------------------------ ## ## Report this to bug-autoconf@gnu.org. ## ## ------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in getpagesize do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* 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_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for working mmap" >&5 echo $ECHO_N "checking for working mmap... $ECHO_C" >&6 if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_mmap_fixed_mapped=no else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default /* malloc might have been renamed as rpl_malloc. */ #undef malloc /* Thanks to Mike Haertel and Jim Avera for this test. Here is a matrix of mmap possibilities: mmap private not fixed mmap private fixed at somewhere currently unmapped mmap private fixed at somewhere already mapped mmap shared not fixed mmap shared fixed at somewhere currently unmapped mmap shared fixed at somewhere already mapped For private mappings, we should verify that changes cannot be read() back from the file, nor mmap's back from the file at a different address. (There have been systems where private was not correctly implemented like the infamous i386 svr4.0, and systems where the VM page cache was not coherent with the file system buffer cache like early versions of FreeBSD and possibly contemporary NetBSD.) For shared mappings, we should conversely verify that changes get propagated back to all the places they're supposed to be. Grep wants private fixed already mapped. The main things grep needs to know about mmap are: * does it exist and is it safe to write into the mmap'd area * how to use it (BSD variants) */ #include #include #if !STDC_HEADERS && !HAVE_STDLIB_H char *malloc (); #endif /* This mess was copied from the GNU getpagesize.h. */ #if !HAVE_GETPAGESIZE /* Assume that all systems that can run configure have sys/param.h. */ # if !HAVE_SYS_PARAM_H # define HAVE_SYS_PARAM_H 1 # endif # ifdef _SC_PAGESIZE # define getpagesize() sysconf(_SC_PAGESIZE) # else /* no _SC_PAGESIZE */ # if HAVE_SYS_PARAM_H # include # ifdef EXEC_PAGESIZE # define getpagesize() EXEC_PAGESIZE # else /* no EXEC_PAGESIZE */ # ifdef NBPG # define getpagesize() NBPG * CLSIZE # ifndef CLSIZE # define CLSIZE 1 # endif /* no CLSIZE */ # else /* no NBPG */ # ifdef NBPC # define getpagesize() NBPC # else /* no NBPC */ # ifdef PAGESIZE # define getpagesize() PAGESIZE # endif /* PAGESIZE */ # endif /* no NBPC */ # endif /* no NBPG */ # endif /* no EXEC_PAGESIZE */ # else /* no HAVE_SYS_PARAM_H */ # define getpagesize() 8192 /* punt totally */ # endif /* no HAVE_SYS_PARAM_H */ # endif /* no _SC_PAGESIZE */ #endif /* no HAVE_GETPAGESIZE */ int main () { char *data, *data2, *data3; int i, pagesize; int fd; pagesize = getpagesize (); /* First, make a file with some known garbage in it. */ data = (char *) malloc (pagesize); if (!data) exit (1); for (i = 0; i < pagesize; ++i) *(data + i) = rand (); umask (0); fd = creat ("conftest.mmap", 0600); if (fd < 0) exit (1); if (write (fd, data, pagesize) != pagesize) exit (1); close (fd); /* Next, try to mmap the file at a fixed address which already has something else allocated at it. If we can, also make sure that we see the same garbage. */ fd = open ("conftest.mmap", O_RDWR); if (fd < 0) exit (1); data2 = (char *) malloc (2 * pagesize); if (!data2) exit (1); data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1); if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, fd, 0L)) exit (1); for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data2 + i)) exit (1); /* Finally, make sure that changes to the mapped area do not percolate back to the file as seen by read(). (This is a bug on some variants of i386 svr4.0.) */ for (i = 0; i < pagesize; ++i) *(data2 + i) = *(data2 + i) + 1; data3 = (char *) malloc (pagesize); if (!data3) exit (1); if (read (fd, data3, pagesize) != pagesize) exit (1); for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data3 + i)) exit (1); close (fd); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_mmap_fixed_mapped=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_mmap_fixed_mapped=no fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5 echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6 if test $ac_cv_func_mmap_fixed_mapped = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MMAP 1 _ACEOF fi rm -f conftest.mmap echo "$as_me:$LINENO: checking return type of signal handlers" >&5 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6 if test "${ac_cv_type_signal+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #ifdef signal # undef signal #endif #ifdef __cplusplus extern "C" void (*signal (int, void (*)(int)))(int); #else void (*signal ()) (); #endif int main () { int i; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_signal=void else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_signal=int fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 echo "${ECHO_T}$ac_cv_type_signal" >&6 cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF for ac_func in strftime do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* 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_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else # strftime is in -lintl on SCO UNIX. echo "$as_me:$LINENO: checking for strftime in -lintl" >&5 echo $ECHO_N "checking for strftime in -lintl... $ECHO_C" >&6 if test "${ac_cv_lib_intl_strftime+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char strftime (); int main () { strftime (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_intl_strftime=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_intl_strftime=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_intl_strftime" >&5 echo "${ECHO_T}$ac_cv_lib_intl_strftime" >&6 if test $ac_cv_lib_intl_strftime = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STRFTIME 1 _ACEOF LIBS="-lintl $LIBS" fi fi done echo "$as_me:$LINENO: checking for pid_t" >&5 echo $ECHO_N "checking for pid_t... $ECHO_C" >&6 if test "${ac_cv_type_pid_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((pid_t *) 0) return 0; if (sizeof (pid_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_pid_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_pid_t=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 echo "${ECHO_T}$ac_cv_type_pid_t" >&6 if test $ac_cv_type_pid_t = yes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi for ac_header in unistd.h vfork.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX ## ------------------------------------ ## ## Report this to bug-autoconf@gnu.org. ## ## ------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; no:yes ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX ## ------------------------------------ ## ## Report this to bug-autoconf@gnu.org. ## ## ------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in fork vfork do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* 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_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test "x$ac_cv_func_fork" = xyes; then echo "$as_me:$LINENO: checking for working fork" >&5 echo $ECHO_N "checking for working fork... $ECHO_C" >&6 if test "${ac_cv_func_fork_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_fork_works=cross else cat >conftest.$ac_ext <<_ACEOF /* By Ruediger Kuhlmann. */ #include #if HAVE_UNISTD_H # include #endif /* Some systems only have a dummy stub for fork() */ int main () { if (fork() < 0) exit (1); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_fork_works=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_fork_works=no fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_fork_works" >&5 echo "${ECHO_T}$ac_cv_func_fork_works" >&6 else ac_cv_func_fork_works=$ac_cv_func_fork fi if test "x$ac_cv_func_fork_works" = xcross; then case $host in *-*-amigaos* | *-*-msdosdjgpp*) # Override, as these systems have only a dummy fork() stub ac_cv_func_fork_works=no ;; *) ac_cv_func_fork_works=yes ;; esac { echo "$as_me:$LINENO: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} fi ac_cv_func_vfork_works=$ac_cv_func_vfork if test "x$ac_cv_func_vfork" = xyes; then echo "$as_me:$LINENO: checking for working vfork" >&5 echo $ECHO_N "checking for working vfork... $ECHO_C" >&6 if test "${ac_cv_func_vfork_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_vfork_works=cross else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Thanks to Paul Eggert for this test. */ #include #include #include #include #include #if HAVE_UNISTD_H # include #endif #if HAVE_VFORK_H # include #endif /* On some sparc systems, changes by the child to local and incoming argument registers are propagated back to the parent. The compiler is told about this with #include , but some compilers (e.g. gcc -O) don't grok . Test for this by using a static variable whose address is put into a register that is clobbered by the vfork. */ static void #ifdef __cplusplus sparc_address_test (int arg) # else sparc_address_test (arg) int arg; #endif { static pid_t child; if (!child) { child = vfork (); if (child < 0) { perror ("vfork"); _exit(2); } if (!child) { arg = getpid(); write(-1, "", 0); _exit (arg); } } } int main () { pid_t parent = getpid (); pid_t child; sparc_address_test (0); child = vfork (); if (child == 0) { /* Here is another test for sparc vfork register problems. This test uses lots of local variables, at least as many local variables as main has allocated so far including compiler temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should reuse the register of parent for one of the local variables, since it will think that parent can't possibly be used any more in this routine. Assigning to the local variable will thus munge parent in the parent process. */ pid_t p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); /* Convince the compiler that p..p7 are live; otherwise, it might use the same hardware register for all 8 local variables. */ if (p != p1 || p != p2 || p != p3 || p != p4 || p != p5 || p != p6 || p != p7) _exit(1); /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent from child file descriptors. If the child closes a descriptor before it execs or exits, this munges the parent's descriptor as well. Test for this by closing stdout in the child. */ _exit(close(fileno(stdout)) != 0); } else { int status; struct stat st; while (wait(&status) != child) ; exit( /* Was there some problem with vforking? */ child < 0 /* Did the child fail? (This shouldn't happen.) */ || status /* Did the vfork/compiler bug occur? */ || parent != getpid() /* Did the file descriptor bug occur? */ || fstat(fileno(stdout), &st) != 0 ); } } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_vfork_works=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_vfork_works=no fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_vfork_works" >&5 echo "${ECHO_T}$ac_cv_func_vfork_works" >&6 fi; if test "x$ac_cv_func_fork_works" = xcross; then ac_cv_func_vfork_works=ac_cv_func_vfork { echo "$as_me:$LINENO: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} fi if test "x$ac_cv_func_vfork_works" = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_WORKING_VFORK 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define vfork fork _ACEOF fi if test "x$ac_cv_func_fork_works" = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_WORKING_FORK 1 _ACEOF fi for ac_func in vprintf do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* 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_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF echo "$as_me:$LINENO: checking for _doprnt" >&5 echo $ECHO_N "checking for _doprnt... $ECHO_C" >&6 if test "${ac_cv_func__doprnt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, which can conflict with char _doprnt (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char _doprnt (); /* 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__doprnt) || defined (__stub____doprnt) choke me #else char (*f) () = _doprnt; #endif #ifdef __cplusplus } #endif int main () { return f != _doprnt; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func__doprnt=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func__doprnt=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5 echo "${ECHO_T}$ac_cv_func__doprnt" >&6 if test $ac_cv_func__doprnt = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_DOPRNT 1 _ACEOF fi fi done for ac_func in getcwd gethostname gettimeofday getwd mktime putenv regcomp select sigaction socket strcspn strdup strerror strstr strtod strtol strtoul do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* 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_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for X" >&5 echo $ECHO_N "checking for X... $ECHO_C" >&6 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then withval="$with_x" fi; # $have_x is `yes', `no', `disabled', or empty when we do not yet know. if test "x$with_x" = xno; then # The user explicitly disabled X. have_x=disabled else if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then # Both variables are already set. have_x=yes else if test "${ac_cv_have_x+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # One or both of the vars are not set, and there is no cached value. ac_x_includes=no ac_x_libraries=no rm -fr conftest.dir if mkdir conftest.dir; then cd conftest.dir # Make sure to not put "make" in the Imakefile rules, since we grep it out. cat >Imakefile <<'_ACEOF' acfindx: @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"' _ACEOF if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} acfindx 2>/dev/null | grep -v make` # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. for ac_extension in a so sl; do if test ! -f $ac_im_usrlibdir/libX11.$ac_extension && test -f $ac_im_libdir/libX11.$ac_extension; then ac_im_usrlibdir=$ac_im_libdir; break fi done # Screen out bogus values from the imake configuration. They are # bogus both because they are the default anyway, and because # using them would break gcc on systems where it needs fixed includes. case $ac_im_incroot in /usr/include) ;; *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; esac case $ac_im_usrlibdir in /usr/lib | /lib) ;; *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; esac fi cd .. rm -fr conftest.dir fi # Standard set of common directories for X headers. # Check X11 before X11Rn because it is often a symlink to the current release. ac_x_header_dirs=' /usr/X11/include /usr/X11R6/include /usr/X11R5/include /usr/X11R4/include /usr/include/X11 /usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 /usr/local/X11/include /usr/local/X11R6/include /usr/local/X11R5/include /usr/local/X11R4/include /usr/local/include/X11 /usr/local/include/X11R6 /usr/local/include/X11R5 /usr/local/include/X11R4 /usr/X386/include /usr/x386/include /usr/XFree86/include/X11 /usr/include /usr/local/include /usr/unsupported/include /usr/athena/include /usr/local/x11r5/include /usr/lpp/Xamples/include /usr/openwin/include /usr/openwin/share/include' if test "$ac_x_includes" = no; then # Guess where to find include files, by looking for Intrinsic.h. # First, try using that file with no special directory specified. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # We can compile using X headers with no special include directory. ac_x_includes= else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 for ac_dir in $ac_x_header_dirs; do if test -r "$ac_dir/X11/Intrinsic.h"; then ac_x_includes=$ac_dir break fi done fi rm -f conftest.err conftest.$ac_ext fi # $ac_x_includes = no if test "$ac_x_libraries" = no; then # Check for the libraries. # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS=$LIBS LIBS="-lXt $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { XtMalloc (0) ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 LIBS=$ac_save_LIBS for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! for ac_extension in a so sl; do if test -r $ac_dir/libXt.$ac_extension; then ac_x_libraries=$ac_dir break 2 fi done done fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi # $ac_x_libraries = no if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then # Didn't find X anywhere. Cache the known absence of X. ac_cv_have_x="have_x=no" else # Record where we found X for the cache. ac_cv_have_x="have_x=yes \ ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" fi fi fi eval "$ac_cv_have_x" fi # $with_x != no if test "$have_x" != yes; then echo "$as_me:$LINENO: result: $have_x" >&5 echo "${ECHO_T}$have_x" >&6 no_x=yes else # If each of the values was on the command line, it overrides each guess. test "x$x_includes" = xNONE && x_includes=$ac_x_includes test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries # Update the cache value to reflect the command line values. ac_cv_have_x="have_x=yes \ ac_x_includes=$x_includes ac_x_libraries=$x_libraries" echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6 fi if test "x$no_x" = "x"; then X_INCLUDES="-I$x_includes" X_LIBS="-L$x_libraries -lX11" else X_INCLUDES="" X_LIBS="" fi ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include <$ac_hdr> int main () { if ((DIR *) 0) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo "$as_me:$LINENO: checking for library containing opendir" >&5 echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 if test "${ac_cv_search_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS ac_cv_search_opendir=no cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir (); int main () { opendir (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_opendir="none required" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext if test "$ac_cv_search_opendir" = no; then for ac_lib in dir; do LIBS="-l$ac_lib $ac_func_search_save_LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir (); int main () { opendir (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_opendir="-l$ac_lib" break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext done fi LIBS=$ac_func_search_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 echo "${ECHO_T}$ac_cv_search_opendir" >&6 if test "$ac_cv_search_opendir" != no; then test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" fi else echo "$as_me:$LINENO: checking for library containing opendir" >&5 echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 if test "${ac_cv_search_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS ac_cv_search_opendir=no cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir (); int main () { opendir (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_opendir="none required" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext if test "$ac_cv_search_opendir" = no; then for ac_lib in x; do LIBS="-l$ac_lib $ac_func_search_save_LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir (); int main () { opendir (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_opendir="-l$ac_lib" break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext done fi LIBS=$ac_func_search_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 echo "${ECHO_T}$ac_cv_search_opendir" >&6 if test "$ac_cv_search_opendir" != no; then test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" fi fi echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f 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 >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #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)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5 echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6 if test "${ac_cv_header_sys_wait_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #ifndef WEXITSTATUS # define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) #endif #ifndef WIFEXITED # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif int main () { int s; wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_sys_wait_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_sys_wait_h=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 if test $ac_cv_header_sys_wait_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SYS_WAIT_H 1 _ACEOF fi for ac_header in fcntl.h limits.h malloc.h strings.h sys/file.h sys/ioctl.h sys/time.h syslog.h unistd.h fp_class.h ieeefp.h math.h float.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX ## ------------------------------------ ## ## Report this to bug-autoconf@gnu.org. ## ## ------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; no:yes ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX ## ------------------------------------ ## ## Report this to bug-autoconf@gnu.org. ## ## ------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_ext=cc 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 ac_ext=cc 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 echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6 if test -z "$CXXCPP"; then if test "${ac_cv_prog_CXXCPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_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 >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi echo "$as_me:$LINENO: result: $CXXCPP" >&5 echo "${ECHO_T}$CXXCPP" >&6 ac_preproc_ok=false for ac_cxx_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 >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=cc 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 for ac_header in new iostream iomanip fstream sstream iosfwd do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX ## ------------------------------------ ## ## Report this to bug-autoconf@gnu.org. ## ## ------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; no:yes ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX ## ------------------------------------ ## ## Report this to bug-autoconf@gnu.org. ## ## ------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done 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 for ac_func in fpclassify do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* 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_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else echo "$as_me:$LINENO: checking for fpclassify with " >&5 echo $ECHO_N "checking for fpclassify with ... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { float f = 0.0; fpclassify(f) ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 cat >>confdefs.h <<\_ACEOF #define HAVE_FPCLASSIFY 1 _ACEOF else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi done for ac_func in finite do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* 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_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else for ac_func in isfinite do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* 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_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else echo "$as_me:$LINENO: checking for isfinite with " >&5 echo $ECHO_N "checking for isfinite with ... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { float f = 0.0; isfinite(f) ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 cat >>confdefs.h <<\_ACEOF #define HAVE_ISFINITE 1 _ACEOF else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi done fi done for ac_func in isinf do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* 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_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else echo "$as_me:$LINENO: checking for isinf with " >&5 echo $ECHO_N "checking for isinf with ... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { float f = 0.0; isinf(f) ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 cat >>confdefs.h <<\_ACEOF #define HAVE_ISINF 1 _ACEOF else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi done _cxxflags=${CXXFLAGS} _cflags=${CFLAGS} echo "$as_me:$LINENO: checking if IEEE math works out of the box" >&5 echo $ECHO_N "checking if IEEE math works out of the box... $ECHO_C" >&6 if eval "test \"\${rd_cv_ieee_works+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if HAVE_MATH_H # include #endif #if HAVE_FLOAT_H # include #endif #if HAVE_IEEEFP_H # include #endif #if HAVE_FP_CLASS_H # include #endif /* Solaris */ #if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASS)) # define HAVE_ISINF 1 # define isinf(a) (fpclass(a) == FP_NINF || fpclass(a) == FP_PINF) #endif /* Digital UNIX */ #if (! defined(HAVE_ISINF) && defined(HAVE_FP_CLASS) && defined(HAVE_FP_CLASS_H)) # define HAVE_ISINF 1 # define isinf(a) (fp_class(a) == FP_NEG_INF || fp_class(a) == FP_POS_INF) #endif /* AIX */ #if (! defined(HAVE_ISINF) && defined(HAVE_CLASS)) # define HAVE_ISINF 1 # define isinf(a) (class(a) == FP_MINUS_INF || class(a) == FP_PLUS_INF) #endif #if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_PLUS_INF) && defined(FP_MINUS_INF)) # define HAVE_ISINF 1 # define isinf(a) (fpclassify(a) == FP_MINUS_INF || fpclassify(a) == FP_PLUS_INF) #endif #if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_INFINITE)) # define HAVE_ISINF 1 # define isinf(a) (fpclassify(a) == FP_INFINITE) #endif /* IRIX */ #if (! defined(isinf) && defined(HAVE_FINITE)) # define HAVE_ISINF 1 # define isinf(a) (!finite(a)) #endif #include int main(void){ double nan,inf,c,zero; ; /* some math to see if we get a floating point exception */ zero=sin(0.0); /* don't let the compiler optimize us away */ nan=0.0/zero; /* especially here */ inf=1.0/zero; /* and here. I want to know if it can do the magic */ /* at run time without sig fpe */ c = inf + nan; c = inf / nan; if (! isnan(nan)) {printf ("not isnan(NaN) ... "); return 1;} if (nan == nan) {printf ("nan == nan ... "); return 1;} if (! isinf(inf)) {printf ("not isinf(oo) ... "); return 1;} if (! isinf(-inf)) {printf ("not isinf(-oo) ... "); return 1;} if (! inf > 0) {printf ("not inf > 0 ... "); return 1;} if (! -inf < 0) {printf ("not -inf < 0 ... "); return 1;} return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then rd_cv_ieee_works=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) rd_cv_ieee_works=no fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi if test x${rd_cv_ieee_works} = "xyes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 CXXFLAGS="$_cxxflags -ieee" CFLAGS="$_cflags -ieee" echo "$as_me:$LINENO: checking if IEEE math works with the -ieee switch" >&5 echo $ECHO_N "checking if IEEE math works with the -ieee switch... $ECHO_C" >&6 if eval "test \"\${rd_cv_ieee_switch+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if HAVE_MATH_H # include #endif #if HAVE_FLOAT_H # include #endif #if HAVE_IEEEFP_H # include #endif #if HAVE_FP_CLASS_H # include #endif /* Solaris */ #if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASS)) # define HAVE_ISINF 1 # define isinf(a) (fpclass(a) == FP_NINF || fpclass(a) == FP_PINF) #endif /* Digital UNIX */ #if (! defined(HAVE_ISINF) && defined(HAVE_FP_CLASS) && defined(HAVE_FP_CLASS_H)) # define HAVE_ISINF 1 # define isinf(a) (fp_class(a) == FP_NEG_INF || fp_class(a) == FP_POS_INF) #endif /* AIX */ #if (! defined(HAVE_ISINF) && defined(HAVE_CLASS)) # define HAVE_ISINF 1 # define isinf(a) (class(a) == FP_MINUS_INF || class(a) == FP_PLUS_INF) #endif #if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_PLUS_INF) && defined(FP_MINUS_INF)) # define HAVE_ISINF 1 # define isinf(a) (fpclassify(a) == FP_MINUS_INF || fpclassify(a) == FP_PLUS_INF) #endif #if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_INFINITE)) # define HAVE_ISINF 1 # define isinf(a) (fpclassify(a) == FP_INFINITE) #endif /* IRIX */ #if (! defined(isinf) && defined(HAVE_FINITE)) # define HAVE_ISINF 1 # define isinf(a) (!finite(a)) #endif #include int main(void){ double nan,inf,c,zero; ; /* some math to see if we get a floating point exception */ zero=sin(0.0); /* don't let the compiler optimize us away */ nan=0.0/zero; /* especially here */ inf=1.0/zero; /* and here. I want to know if it can do the magic */ /* at run time without sig fpe */ c = inf + nan; c = inf / nan; if (! isnan(nan)) {printf ("not isnan(NaN) ... "); return 1;} if (nan == nan) {printf ("nan == nan ... "); return 1;} if (! isinf(inf)) {printf ("not isinf(oo) ... "); return 1;} if (! isinf(-inf)) {printf ("not isinf(-oo) ... "); return 1;} if (! inf > 0) {printf ("not inf > 0 ... "); return 1;} if (! -inf < 0) {printf ("not -inf < 0 ... "); return 1;} return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then rd_cv_ieee_switch=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) rd_cv_ieee_switch=no fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi if test x${rd_cv_ieee_switch} = "xyes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 CXXFLAGS="$_cxxflags -qfloat=nofold" CFLAGS="$_cflags -qfloat=nofold" echo "$as_me:$LINENO: checking if IEEE math works with the -qfloat=nofold switch" >&5 echo $ECHO_N "checking if IEEE math works with the -qfloat=nofold switch... $ECHO_C" >&6 if eval "test \"\${rd_cv_ieee_nofold+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if HAVE_MATH_H # include #endif #if HAVE_FLOAT_H # include #endif #if HAVE_IEEEFP_H # include #endif #if HAVE_FP_CLASS_H # include #endif /* Solaris */ #if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASS)) # define HAVE_ISINF 1 # define isinf(a) (fpclass(a) == FP_NINF || fpclass(a) == FP_PINF) #endif /* Digital UNIX */ #if (! defined(HAVE_ISINF) && defined(HAVE_FP_CLASS) && defined(HAVE_FP_CLASS_H)) # define HAVE_ISINF 1 # define isinf(a) (fp_class(a) == FP_NEG_INF || fp_class(a) == FP_POS_INF) #endif /* AIX */ #if (! defined(HAVE_ISINF) && defined(HAVE_CLASS)) # define HAVE_ISINF 1 # define isinf(a) (class(a) == FP_MINUS_INF || class(a) == FP_PLUS_INF) #endif #if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_PLUS_INF) && defined(FP_MINUS_INF)) # define HAVE_ISINF 1 # define isinf(a) (fpclassify(a) == FP_MINUS_INF || fpclassify(a) == FP_PLUS_INF) #endif #if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_INFINITE)) # define HAVE_ISINF 1 # define isinf(a) (fpclassify(a) == FP_INFINITE) #endif /* IRIX */ #if (! defined(isinf) && defined(HAVE_FINITE)) # define HAVE_ISINF 1 # define isinf(a) (!finite(a)) #endif #include int main(void){ double nan,inf,c,zero; ; /* some math to see if we get a floating point exception */ zero=sin(0.0); /* don't let the compiler optimize us away */ nan=0.0/zero; /* especially here */ inf=1.0/zero; /* and here. I want to know if it can do the magic */ /* at run time without sig fpe */ c = inf + nan; c = inf / nan; if (! isnan(nan)) {printf ("not isnan(NaN) ... "); return 1;} if (nan == nan) {printf ("nan == nan ... "); return 1;} if (! isinf(inf)) {printf ("not isinf(oo) ... "); return 1;} if (! isinf(-inf)) {printf ("not isinf(-oo) ... "); return 1;} if (! inf > 0) {printf ("not inf > 0 ... "); return 1;} if (! -inf < 0) {printf ("not -inf < 0 ... "); return 1;} return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then rd_cv_ieee_nofold=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) rd_cv_ieee_nofold=no fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi if test x${rd_cv_ieee_nofold} = "xyes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 CXXFLAGS="$_cxxflags -w -qflttrap=enable:zerodivide" CFLAGS="$_cflags -w -qflttrap=enable:zerodivide" echo "$as_me:$LINENO: checking if IEEE math works with the -w -qflttrap=enable:zerodivide" >&5 echo $ECHO_N "checking if IEEE math works with the -w -qflttrap=enable:zerodivide... $ECHO_C" >&6 if eval "test \"\${rd_cv_ieee_flttrap+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if HAVE_MATH_H # include #endif #if HAVE_FLOAT_H # include #endif #if HAVE_IEEEFP_H # include #endif #if HAVE_FP_CLASS_H # include #endif /* Solaris */ #if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASS)) # define HAVE_ISINF 1 # define isinf(a) (fpclass(a) == FP_NINF || fpclass(a) == FP_PINF) #endif /* Digital UNIX */ #if (! defined(HAVE_ISINF) && defined(HAVE_FP_CLASS) && defined(HAVE_FP_CLASS_H)) # define HAVE_ISINF 1 # define isinf(a) (fp_class(a) == FP_NEG_INF || fp_class(a) == FP_POS_INF) #endif /* AIX */ #if (! defined(HAVE_ISINF) && defined(HAVE_CLASS)) # define HAVE_ISINF 1 # define isinf(a) (class(a) == FP_MINUS_INF || class(a) == FP_PLUS_INF) #endif #if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_PLUS_INF) && defined(FP_MINUS_INF)) # define HAVE_ISINF 1 # define isinf(a) (fpclassify(a) == FP_MINUS_INF || fpclassify(a) == FP_PLUS_INF) #endif #if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_INFINITE)) # define HAVE_ISINF 1 # define isinf(a) (fpclassify(a) == FP_INFINITE) #endif /* IRIX */ #if (! defined(isinf) && defined(HAVE_FINITE)) # define HAVE_ISINF 1 # define isinf(a) (!finite(a)) #endif #include int main(void){ double nan,inf,c,zero; ; /* some math to see if we get a floating point exception */ zero=sin(0.0); /* don't let the compiler optimize us away */ nan=0.0/zero; /* especially here */ inf=1.0/zero; /* and here. I want to know if it can do the magic */ /* at run time without sig fpe */ c = inf + nan; c = inf / nan; if (! isnan(nan)) {printf ("not isnan(NaN) ... "); return 1;} if (nan == nan) {printf ("nan == nan ... "); return 1;} if (! isinf(inf)) {printf ("not isinf(oo) ... "); return 1;} if (! isinf(-inf)) {printf ("not isinf(-oo) ... "); return 1;} if (! inf > 0) {printf ("not inf > 0 ... "); return 1;} if (! -inf < 0) {printf ("not -inf < 0 ... "); return 1;} return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then rd_cv_ieee_flttrap=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) rd_cv_ieee_flttrap=no fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi if test x${rd_cv_ieee_flttrap} = "xyes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 CXXFLAGS="$_cxxflags -mieee" CFLAGS="$_cflags -mieee" echo "$as_me:$LINENO: checking if IEEE math works with the -mieee switch" >&5 echo $ECHO_N "checking if IEEE math works with the -mieee switch... $ECHO_C" >&6 if eval "test \"\${rd_cv_ieee_mswitch+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if HAVE_MATH_H # include #endif #if HAVE_FLOAT_H # include #endif #if HAVE_IEEEFP_H # include #endif #if HAVE_FP_CLASS_H # include #endif /* Solaris */ #if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASS)) # define HAVE_ISINF 1 # define isinf(a) (fpclass(a) == FP_NINF || fpclass(a) == FP_PINF) #endif /* Digital UNIX */ #if (! defined(HAVE_ISINF) && defined(HAVE_FP_CLASS) && defined(HAVE_FP_CLASS_H)) # define HAVE_ISINF 1 # define isinf(a) (fp_class(a) == FP_NEG_INF || fp_class(a) == FP_POS_INF) #endif /* AIX */ #if (! defined(HAVE_ISINF) && defined(HAVE_CLASS)) # define HAVE_ISINF 1 # define isinf(a) (class(a) == FP_MINUS_INF || class(a) == FP_PLUS_INF) #endif #if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_PLUS_INF) && defined(FP_MINUS_INF)) # define HAVE_ISINF 1 # define isinf(a) (fpclassify(a) == FP_MINUS_INF || fpclassify(a) == FP_PLUS_INF) #endif #if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_INFINITE)) # define HAVE_ISINF 1 # define isinf(a) (fpclassify(a) == FP_INFINITE) #endif /* IRIX */ #if (! defined(isinf) && defined(HAVE_FINITE)) # define HAVE_ISINF 1 # define isinf(a) (!finite(a)) #endif #include int main(void){ double nan,inf,c,zero; ; /* some math to see if we get a floating point exception */ zero=sin(0.0); /* don't let the compiler optimize us away */ nan=0.0/zero; /* especially here */ inf=1.0/zero; /* and here. I want to know if it can do the magic */ /* at run time without sig fpe */ c = inf + nan; c = inf / nan; if (! isnan(nan)) {printf ("not isnan(NaN) ... "); return 1;} if (nan == nan) {printf ("nan == nan ... "); return 1;} if (! isinf(inf)) {printf ("not isinf(oo) ... "); return 1;} if (! isinf(-inf)) {printf ("not isinf(-oo) ... "); return 1;} if (! inf > 0) {printf ("not inf > 0 ... "); return 1;} if (! -inf < 0) {printf ("not -inf < 0 ... "); return 1;} return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then rd_cv_ieee_mswitch=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) rd_cv_ieee_mswitch=no fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi if test x${rd_cv_ieee_mswitch} = "xyes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 CXXFLAGS="$_cxxflags -q float=rndsngl" CFLAGS="$_cflags -q float=rndsngl" echo "$as_me:$LINENO: checking if IEEE math works with the -q float=rndsngl switch" >&5 echo $ECHO_N "checking if IEEE math works with the -q float=rndsngl switch... $ECHO_C" >&6 if eval "test \"\${rd_cv_ieee_qswitch+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if HAVE_MATH_H # include #endif #if HAVE_FLOAT_H # include #endif #if HAVE_IEEEFP_H # include #endif #if HAVE_FP_CLASS_H # include #endif /* Solaris */ #if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASS)) # define HAVE_ISINF 1 # define isinf(a) (fpclass(a) == FP_NINF || fpclass(a) == FP_PINF) #endif /* Digital UNIX */ #if (! defined(HAVE_ISINF) && defined(HAVE_FP_CLASS) && defined(HAVE_FP_CLASS_H)) # define HAVE_ISINF 1 # define isinf(a) (fp_class(a) == FP_NEG_INF || fp_class(a) == FP_POS_INF) #endif /* AIX */ #if (! defined(HAVE_ISINF) && defined(HAVE_CLASS)) # define HAVE_ISINF 1 # define isinf(a) (class(a) == FP_MINUS_INF || class(a) == FP_PLUS_INF) #endif #if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_PLUS_INF) && defined(FP_MINUS_INF)) # define HAVE_ISINF 1 # define isinf(a) (fpclassify(a) == FP_MINUS_INF || fpclassify(a) == FP_PLUS_INF) #endif #if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_INFINITE)) # define HAVE_ISINF 1 # define isinf(a) (fpclassify(a) == FP_INFINITE) #endif /* IRIX */ #if (! defined(isinf) && defined(HAVE_FINITE)) # define HAVE_ISINF 1 # define isinf(a) (!finite(a)) #endif #include int main(void){ double nan,inf,c,zero; ; /* some math to see if we get a floating point exception */ zero=sin(0.0); /* don't let the compiler optimize us away */ nan=0.0/zero; /* especially here */ inf=1.0/zero; /* and here. I want to know if it can do the magic */ /* at run time without sig fpe */ c = inf + nan; c = inf / nan; if (! isnan(nan)) {printf ("not isnan(NaN) ... "); return 1;} if (nan == nan) {printf ("nan == nan ... "); return 1;} if (! isinf(inf)) {printf ("not isinf(oo) ... "); return 1;} if (! isinf(-inf)) {printf ("not isinf(-oo) ... "); return 1;} if (! inf > 0) {printf ("not inf > 0 ... "); return 1;} if (! -inf < 0) {printf ("not -inf < 0 ... "); return 1;} return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then rd_cv_ieee_qswitch=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) rd_cv_ieee_qswitch=no fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi if test x${rd_cv_ieee_qswitch} = "xyes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 CXXFLAGS="$_cxxflags -OPT:IEEE_comparisons=ON" CFLAGS="$_cflags -OPT:IEEE_comparisons=ON" echo "$as_me:$LINENO: checking if IEEE math works with the -OPT:IEEE_comparisons=ON switch" >&5 echo $ECHO_N "checking if IEEE math works with the -OPT:IEEE_comparisons=ON switch... $ECHO_C" >&6 if eval "test \"\${rd_cv_ieee_ieeecmpswitch+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if HAVE_MATH_H # include #endif #if HAVE_FLOAT_H # include #endif #if HAVE_IEEEFP_H # include #endif #if HAVE_FP_CLASS_H # include #endif /* Solaris */ #if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASS)) # define HAVE_ISINF 1 # define isinf(a) (fpclass(a) == FP_NINF || fpclass(a) == FP_PINF) #endif /* Digital UNIX */ #if (! defined(HAVE_ISINF) && defined(HAVE_FP_CLASS) && defined(HAVE_FP_CLASS_H)) # define HAVE_ISINF 1 # define isinf(a) (fp_class(a) == FP_NEG_INF || fp_class(a) == FP_POS_INF) #endif /* AIX */ #if (! defined(HAVE_ISINF) && defined(HAVE_CLASS)) # define HAVE_ISINF 1 # define isinf(a) (class(a) == FP_MINUS_INF || class(a) == FP_PLUS_INF) #endif #if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_PLUS_INF) && defined(FP_MINUS_INF)) # define HAVE_ISINF 1 # define isinf(a) (fpclassify(a) == FP_MINUS_INF || fpclassify(a) == FP_PLUS_INF) #endif #if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_INFINITE)) # define HAVE_ISINF 1 # define isinf(a) (fpclassify(a) == FP_INFINITE) #endif /* IRIX */ #if (! defined(isinf) && defined(HAVE_FINITE)) # define HAVE_ISINF 1 # define isinf(a) (!finite(a)) #endif #include int main(void){ double nan,inf,c,zero; ; /* some math to see if we get a floating point exception */ zero=sin(0.0); /* don't let the compiler optimize us away */ nan=0.0/zero; /* especially here */ inf=1.0/zero; /* and here. I want to know if it can do the magic */ /* at run time without sig fpe */ c = inf + nan; c = inf / nan; if (! isnan(nan)) {printf ("not isnan(NaN) ... "); return 1;} if (nan == nan) {printf ("nan == nan ... "); return 1;} if (! isinf(inf)) {printf ("not isinf(oo) ... "); return 1;} if (! isinf(-inf)) {printf ("not isinf(-oo) ... "); return 1;} if (! inf > 0) {printf ("not inf > 0 ... "); return 1;} if (! -inf < 0) {printf ("not -inf < 0 ... "); return 1;} return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then rd_cv_ieee_ieeecmpswitch=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) rd_cv_ieee_ieeecmpswitch=no fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi if test x${rd_cv_ieee_ieeecmpswitch} = "xyes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 CXXFLAGS=$_cxxflags CFLAGS=$_cflags echo "$as_me:$LINENO: checking if IEEE math works with fpsetmask(0)" >&5 echo $ECHO_N "checking if IEEE math works with fpsetmask(0)... $ECHO_C" >&6 if eval "test \"\${rd_cv_ieee_mask+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if HAVE_MATH_H # include #endif #if HAVE_FLOAT_H # include #endif #if HAVE_IEEEFP_H # include #endif #if HAVE_FP_CLASS_H # include #endif /* Solaris */ #if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASS)) # define HAVE_ISINF 1 # define isinf(a) (fpclass(a) == FP_NINF || fpclass(a) == FP_PINF) #endif /* Digital UNIX */ #if (! defined(HAVE_ISINF) && defined(HAVE_FP_CLASS) && defined(HAVE_FP_CLASS_H)) # define HAVE_ISINF 1 # define isinf(a) (fp_class(a) == FP_NEG_INF || fp_class(a) == FP_POS_INF) #endif /* AIX */ #if (! defined(HAVE_ISINF) && defined(HAVE_CLASS)) # define HAVE_ISINF 1 # define isinf(a) (class(a) == FP_MINUS_INF || class(a) == FP_PLUS_INF) #endif #if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_PLUS_INF) && defined(FP_MINUS_INF)) # define HAVE_ISINF 1 # define isinf(a) (fpclassify(a) == FP_MINUS_INF || fpclassify(a) == FP_PLUS_INF) #endif #if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_INFINITE)) # define HAVE_ISINF 1 # define isinf(a) (fpclassify(a) == FP_INFINITE) #endif /* IRIX */ #if (! defined(isinf) && defined(HAVE_FINITE)) # define HAVE_ISINF 1 # define isinf(a) (!finite(a)) #endif #include int main(void){ double nan,inf,c,zero; fpsetmask(0); /* some math to see if we get a floating point exception */ zero=sin(0.0); /* don't let the compiler optimize us away */ nan=0.0/zero; /* especially here */ inf=1.0/zero; /* and here. I want to know if it can do the magic */ /* at run time without sig fpe */ c = inf + nan; c = inf / nan; if (! isnan(nan)) {printf ("not isnan(NaN) ... "); return 1;} if (nan == nan) {printf ("nan == nan ... "); return 1;} if (! isinf(inf)) {printf ("not isinf(oo) ... "); return 1;} if (! isinf(-inf)) {printf ("not isinf(-oo) ... "); return 1;} if (! inf > 0) {printf ("not inf > 0 ... "); return 1;} if (! -inf < 0) {printf ("not -inf < 0 ... "); return 1;} return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then rd_cv_ieee_mask=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) rd_cv_ieee_mask=no fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi if test x${rd_cv_ieee_mask} = "xyes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 echo "$as_me:$LINENO: checking if IEEE math works with signal(SIGFPE,SIG_IGN)" >&5 echo $ECHO_N "checking if IEEE math works with signal(SIGFPE,SIG_IGN)... $ECHO_C" >&6 if eval "test \"\${rd_cv_ieee_sigfpe+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if HAVE_MATH_H # include #endif #if HAVE_FLOAT_H # include #endif #if HAVE_IEEEFP_H # include #endif #if HAVE_FP_CLASS_H # include #endif /* Solaris */ #if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASS)) # define HAVE_ISINF 1 # define isinf(a) (fpclass(a) == FP_NINF || fpclass(a) == FP_PINF) #endif /* Digital UNIX */ #if (! defined(HAVE_ISINF) && defined(HAVE_FP_CLASS) && defined(HAVE_FP_CLASS_H)) # define HAVE_ISINF 1 # define isinf(a) (fp_class(a) == FP_NEG_INF || fp_class(a) == FP_POS_INF) #endif /* AIX */ #if (! defined(HAVE_ISINF) && defined(HAVE_CLASS)) # define HAVE_ISINF 1 # define isinf(a) (class(a) == FP_MINUS_INF || class(a) == FP_PLUS_INF) #endif #if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_PLUS_INF) && defined(FP_MINUS_INF)) # define HAVE_ISINF 1 # define isinf(a) (fpclassify(a) == FP_MINUS_INF || fpclassify(a) == FP_PLUS_INF) #endif #if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_INFINITE)) # define HAVE_ISINF 1 # define isinf(a) (fpclassify(a) == FP_INFINITE) #endif /* IRIX */ #if (! defined(isinf) && defined(HAVE_FINITE)) # define HAVE_ISINF 1 # define isinf(a) (!finite(a)) #endif #include int main(void){ double nan,inf,c,zero; signal(SIGFPE,SIG_IGN); /* some math to see if we get a floating point exception */ zero=sin(0.0); /* don't let the compiler optimize us away */ nan=0.0/zero; /* especially here */ inf=1.0/zero; /* and here. I want to know if it can do the magic */ /* at run time without sig fpe */ c = inf + nan; c = inf / nan; if (! isnan(nan)) {printf ("not isnan(NaN) ... "); return 1;} if (nan == nan) {printf ("nan == nan ... "); return 1;} if (! isinf(inf)) {printf ("not isinf(oo) ... "); return 1;} if (! isinf(-inf)) {printf ("not isinf(-oo) ... "); return 1;} if (! inf > 0) {printf ("not inf > 0 ... "); return 1;} if (! -inf < 0) {printf ("not -inf < 0 ... "); return 1;} return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then rd_cv_ieee_sigfpe=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) rd_cv_ieee_sigfpe=no fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi if test x${rd_cv_ieee_sigfpe} = "xyes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 { { echo "$as_me:$LINENO: error: Your Compiler does not do propper IEEE math ... Please find out how to make IEEE math work with your compiler and let me know (oetiker@ee.ethz.ch). Check config.log to see what went wrong ... " >&5 echo "$as_me: error: Your Compiler does not do propper IEEE math ... Please find out how to make IEEE math work with your compiler and let me know (oetiker@ee.ethz.ch). Check config.log to see what went wrong ... " >&2;} { (exit 1); exit 1; }; } fi fi fi fi fi fi fi fi fi echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset x; /* SunOS 4.1.1 cc rejects this. */ char const *const *ccp; char **p; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; ccp = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++ccp; p = (char**) ccp; ccp = (char const *const *) p; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; } #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6 if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF #define const _ACEOF fi echo "$as_me:$LINENO: checking for inline" >&5 echo $ECHO_N "checking for inline... $ECHO_C" >&6 if test "${ac_cv_c_inline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_inline=$ac_kw; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done fi echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 echo "${ECHO_T}$ac_cv_c_inline" >&6 case $ac_cv_c_inline in inline | yes) ;; no) cat >>confdefs.h <<\_ACEOF #define inline _ACEOF ;; *) cat >>confdefs.h <<_ACEOF #define inline $ac_cv_c_inline _ACEOF ;; esac echo "$as_me:$LINENO: checking for mode_t" >&5 echo $ECHO_N "checking for mode_t... $ECHO_C" >&6 if test "${ac_cv_type_mode_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((mode_t *) 0) return 0; if (sizeof (mode_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_mode_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_mode_t=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5 echo "${ECHO_T}$ac_cv_type_mode_t" >&6 if test $ac_cv_type_mode_t = yes; then : else cat >>confdefs.h <<_ACEOF #define mode_t int _ACEOF fi echo "$as_me:$LINENO: checking for off_t" >&5 echo $ECHO_N "checking for off_t... $ECHO_C" >&6 if test "${ac_cv_type_off_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((off_t *) 0) return 0; if (sizeof (off_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_off_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_off_t=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 echo "${ECHO_T}$ac_cv_type_off_t" >&6 if test $ac_cv_type_off_t = yes; then : else cat >>confdefs.h <<_ACEOF #define off_t long _ACEOF fi echo "$as_me:$LINENO: checking for pid_t" >&5 echo $ECHO_N "checking for pid_t... $ECHO_C" >&6 if test "${ac_cv_type_pid_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((pid_t *) 0) return 0; if (sizeof (pid_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_pid_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_pid_t=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 echo "${ECHO_T}$ac_cv_type_pid_t" >&6 if test $ac_cv_type_pid_t = yes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi echo "$as_me:$LINENO: checking for size_t" >&5 echo $ECHO_N "checking for size_t... $ECHO_C" >&6 if test "${ac_cv_type_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((size_t *) 0) return 0; if (sizeof (size_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 echo "${ECHO_T}$ac_cv_type_size_t" >&6 if test $ac_cv_type_size_t = yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned _ACEOF fi echo "$as_me:$LINENO: checking for struct stat.st_blksize" >&5 echo $ECHO_N "checking for struct stat.st_blksize... $ECHO_C" >&6 if test "${ac_cv_member_struct_stat_st_blksize+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static struct stat ac_aggr; if (ac_aggr.st_blksize) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_member_struct_stat_st_blksize=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static struct stat ac_aggr; if (sizeof ac_aggr.st_blksize) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_member_struct_stat_st_blksize=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_blksize=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blksize" >&5 echo "${ECHO_T}$ac_cv_member_struct_stat_st_blksize" >&6 if test $ac_cv_member_struct_stat_st_blksize = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_BLKSIZE 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define HAVE_ST_BLKSIZE 1 _ACEOF fi echo "$as_me:$LINENO: checking for struct stat.st_blocks" >&5 echo $ECHO_N "checking for struct stat.st_blocks... $ECHO_C" >&6 if test "${ac_cv_member_struct_stat_st_blocks+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static struct stat ac_aggr; if (ac_aggr.st_blocks) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_member_struct_stat_st_blocks=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static struct stat ac_aggr; if (sizeof ac_aggr.st_blocks) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_member_struct_stat_st_blocks=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_blocks=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blocks" >&5 echo "${ECHO_T}$ac_cv_member_struct_stat_st_blocks" >&6 if test $ac_cv_member_struct_stat_st_blocks = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_BLOCKS 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define HAVE_ST_BLOCKS 1 _ACEOF else LIBOBJS="$LIBOBJS fileblocks.$ac_objext" fi echo "$as_me:$LINENO: checking for struct stat.st_rdev" >&5 echo $ECHO_N "checking for struct stat.st_rdev... $ECHO_C" >&6 if test "${ac_cv_member_struct_stat_st_rdev+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static struct stat ac_aggr; if (ac_aggr.st_rdev) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_member_struct_stat_st_rdev=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static struct stat ac_aggr; if (sizeof ac_aggr.st_rdev) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_member_struct_stat_st_rdev=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_rdev=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_rdev" >&5 echo "${ECHO_T}$ac_cv_member_struct_stat_st_rdev" >&6 if test $ac_cv_member_struct_stat_st_rdev = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_RDEV 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define HAVE_ST_RDEV 1 _ACEOF fi echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 if test "${ac_cv_header_time+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_time=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_time=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 echo "${ECHO_T}$ac_cv_header_time" >&6 if test $ac_cv_header_time = yes; then cat >>confdefs.h <<\_ACEOF #define TIME_WITH_SYS_TIME 1 _ACEOF fi echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6 if test "${ac_cv_struct_tm+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { struct tm *tp; tp->tm_sec; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_struct_tm=time.h else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_struct_tm=sys/time.h fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 echo "${ECHO_T}$ac_cv_struct_tm" >&6 if test $ac_cv_struct_tm = sys/time.h; then cat >>confdefs.h <<\_ACEOF #define TM_IN_SYS_TIME 1 _ACEOF fi echo "$as_me:$LINENO: checking for struct tm.tm_zone" >&5 echo $ECHO_N "checking for struct tm.tm_zone... $ECHO_C" >&6 if test "${ac_cv_member_struct_tm_tm_zone+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include <$ac_cv_struct_tm> int main () { static struct tm ac_aggr; if (ac_aggr.tm_zone) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_member_struct_tm_tm_zone=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include <$ac_cv_struct_tm> int main () { static struct tm ac_aggr; if (sizeof ac_aggr.tm_zone) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_member_struct_tm_tm_zone=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_tm_tm_zone=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_zone" >&5 echo "${ECHO_T}$ac_cv_member_struct_tm_tm_zone" >&6 if test $ac_cv_member_struct_tm_tm_zone = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_TM_TM_ZONE 1 _ACEOF fi if test "$ac_cv_member_struct_tm_tm_zone" = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_TM_ZONE 1 _ACEOF else echo "$as_me:$LINENO: checking for tzname" >&5 echo $ECHO_N "checking for tzname... $ECHO_C" >&6 if test "${ac_cv_var_tzname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef tzname /* For SGI. */ extern char *tzname[]; /* RS6000 and others reject char **tzname. */ #endif int main () { atoi(*tzname); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_var_tzname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_var_tzname=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_var_tzname" >&5 echo "${ECHO_T}$ac_cv_var_tzname" >&6 if test $ac_cv_var_tzname = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_TZNAME 1 _ACEOF fi fi echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5 echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6 if test "${ac_cv_type_uid_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "uid_t" >/dev/null 2>&1; then ac_cv_type_uid_t=yes else ac_cv_type_uid_t=no fi rm -f conftest* fi echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 echo "${ECHO_T}$ac_cv_type_uid_t" >&6 if test $ac_cv_type_uid_t = no; then cat >>confdefs.h <<\_ACEOF #define uid_t int _ACEOF cat >>confdefs.h <<\_ACEOF #define gid_t int _ACEOF fi echo "$as_me:$LINENO: checking for socklen_t" >&5 echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6 if test "${ac_cv_type_socklen_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { socklen_t len = 42; return len; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_socklen_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_socklen_t=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5 echo "${ECHO_T}$ac_cv_type_socklen_t" >&6 if test $ac_cv_type_socklen_t = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SOCKLEN_T 1 _ACEOF fi echo "$as_me:$LINENO: checking for SVR4 defines" >&5 echo $ECHO_N "checking for SVR4 defines... $ECHO_C" >&6 if test "${ac_cv_define_svr4+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #if defined(_SYSTYPE_SVR4) || defined(__SYSTYPE_SVR4) || defined(_SVR4) || defined(__SVR4) return 1; #else foobar #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_define_svr4=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_define_svr4=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_define_svr4" >&5 echo "${ECHO_T}$ac_cv_define_svr4" >&6 if test $ac_cv_define_svr4 = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SVR4 1 _ACEOF fi ac_config_files="$ac_config_files Makefile config/Makefile src/Makefile src/IPC/Makefile src/cxs/Makefile src/cxb/Makefile src/AplusGUI/Makefile src/cxsys/Makefile src/cxc/Makefile src/esf/Makefile src/a/Makefile src/app-defaults/Makefile src/dap/Makefile src/MSGUI/Makefile src/MSIPC/Makefile src/MSTypes/Makefile src/main/Makefile src/lisp.0/Makefile src/fonts/Makefile src/fonts/TrueType/Makefile src/fonts/X11/Makefile src/fonts/X11/bdf/Makefile src/fonts/X11/pcf/Makefile src/html/Makefile src/html/tutorials/Makefile src/html/tutorials/graphs/Makefile src/html/tutorials/s.tutorials/Makefile src/contrib/Makefile src/scripts/Makefile src/tutorials/Makefile src/tutorials/graphs/Makefile src/tutorials/s.tutorials/Makefile src/lisp.1/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, don't put newlines in cache variables' values. # 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. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *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 \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" 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}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ 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[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then we branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. cat >confdef2opt.sed <<\_ACEOF t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g t quote s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g t quote d : quote s,[ `~#$^&*(){}\\|;'"<>?],\\&,g s,\[,\\&,g s,\],\\&,g s,\$,$$,g p _ACEOF # We use echo to avoid assuming a particular line-breaking character. # The extra dot is to prevent the shell from consuming trailing # line-breaks from the sub-command output. A line-break within # single-quotes doesn't work because, if this script is created in a # platform that uses two characters for line-breaks (e.g., DOS), tr # would break. ac_LF_and_DOT=`echo; echo .` DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` rm -f confdef2opt.sed ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; 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 # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. 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 ;; 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 { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # 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 sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="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="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by $as_me, which was generated by GNU Autoconf 2.57. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet 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 Configuration files: $config_files Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.57, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. 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=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; 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 if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # INIT-COMMANDS section. # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "config/Makefile" ) CONFIG_FILES="$CONFIG_FILES config/Makefile" ;; "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/IPC/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/IPC/Makefile" ;; "src/cxs/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/cxs/Makefile" ;; "src/cxb/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/cxb/Makefile" ;; "src/AplusGUI/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/AplusGUI/Makefile" ;; "src/cxsys/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/cxsys/Makefile" ;; "src/cxc/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/cxc/Makefile" ;; "src/esf/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/esf/Makefile" ;; "src/a/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/a/Makefile" ;; "src/app-defaults/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/app-defaults/Makefile" ;; "src/dap/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/dap/Makefile" ;; "src/MSGUI/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/MSGUI/Makefile" ;; "src/MSIPC/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/MSIPC/Makefile" ;; "src/MSTypes/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/MSTypes/Makefile" ;; "src/main/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/main/Makefile" ;; "src/lisp.0/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/lisp.0/Makefile" ;; "src/fonts/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/fonts/Makefile" ;; "src/fonts/TrueType/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/fonts/TrueType/Makefile" ;; "src/fonts/X11/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/fonts/X11/Makefile" ;; "src/fonts/X11/bdf/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/fonts/X11/bdf/Makefile" ;; "src/fonts/X11/pcf/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/fonts/X11/pcf/Makefile" ;; "src/html/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/html/Makefile" ;; "src/html/tutorials/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/html/tutorials/Makefile" ;; "src/html/tutorials/graphs/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/html/tutorials/graphs/Makefile" ;; "src/html/tutorials/s.tutorials/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/html/tutorials/s.tutorials/Makefile" ;; "src/contrib/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/contrib/Makefile" ;; "src/scripts/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/scripts/Makefile" ;; "src/tutorials/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/tutorials/Makefile" ;; "src/tutorials/graphs/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/tutorials/graphs/Makefile" ;; "src/tutorials/s.tutorials/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/tutorials/s.tutorials/Makefile" ;; "src/lisp.1/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/lisp.1/Makefile" ;; "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; 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_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 to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@PACKAGE@,$PACKAGE,;t t s,@VERSION@,$VERSION,;t t s,@ACLOCAL@,$ACLOCAL,;t t s,@AUTOCONF@,$AUTOCONF,;t t s,@AUTOMAKE@,$AUTOMAKE,;t t s,@AUTOHEADER@,$AUTOHEADER,;t t s,@MAKEINFO@,$MAKEINFO,;t t s,@AMTAR@,$AMTAR,;t t s,@install_sh@,$install_sh,;t t s,@STRIP@,$STRIP,;t t s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t s,@AWK@,$AWK,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t s,@MAINT@,$MAINT,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@DEPDIR@,$DEPDIR,;t t s,@am__include@,$am__include,;t t s,@am__quote@,$am__quote,;t t s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t s,@CCDEPMODE@,$CCDEPMODE,;t t s,@CXX@,$CXX,;t t s,@CXXFLAGS@,$CXXFLAGS,;t t s,@ac_ct_CXX@,$ac_ct_CXX,;t t s,@CXXDEPMODE@,$CXXDEPMODE,;t t s,@build@,$build,;t t s,@build_cpu@,$build_cpu,;t t s,@build_vendor@,$build_vendor,;t t s,@build_os@,$build_os,;t t s,@host@,$host,;t t s,@host_cpu@,$host_cpu,;t t s,@host_vendor@,$host_vendor,;t t s,@host_os@,$host_os,;t t s,@LN_S@,$LN_S,;t t s,@ECHO@,$ECHO,;t t s,@RANLIB@,$RANLIB,;t t s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t s,@CPP@,$CPP,;t t s,@EGREP@,$EGREP,;t t s,@LIBTOOL@,$LIBTOOL,;t t s,@LIBTOOL_DEPS@,$LIBTOOL_DEPS,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@X_INCLUDES@,$X_INCLUDES,;t t s,@X_LIBS@,$X_LIBS,;t t s,@CXXCPP@,$CXXCPP,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # 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. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; *) # Relative if test -f "$f"; then # Build tree echo $f elif test -f "$srcdir/$f"; then # Source tree echo $srcdir/$f else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;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,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_COMMANDS section. # for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue ac_dest=`echo "$ac_file" | sed 's,:.*,,'` ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_dir=`(dirname "$ac_dest") 2>/dev/null || $as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_dest" : 'X\(//\)[^/]' \| \ X"$ac_dest" : 'X\(//\)$' \| \ X"$ac_dest" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_dest" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 echo "$as_me: executing $ac_dest commands" >&6;} case $ac_dest in depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; 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. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`(dirname "$mf") 2>/dev/null || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || 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 grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue # Extract the definition of DEP_FILES from the Makefile without # running `make'. DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` test -z "$DEPDIR" && continue # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n -e '/^U = / s///p' < "$mf"` test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" # 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 -e ' /^DEP_FILES = .*\\\\$/ { s/^DEP_FILES = // :loop s/\\\\$// p n /\\\\$/ b loop p } /^DEP_FILES = / s/^DEP_FILES = //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=`(dirname "$file") 2>/dev/null || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p $dirpart/$fdir else as_dir=$dirpart/$fdir as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; esac done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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 || { (exit 1); exit 1; } fi aplus-fsf-4.22/configure.in0000644000265000001440000002060010774215370011333 dnl Process this file with autoconf to produce a configure script. dnl Copyright (c) 2003 Morgan Stanley Dean Witter and Co. All rights reserved. dnl See .../src/LICENSE for terms of distribution. AC_INIT(src/dap/BcdPack.c) AC_CONFIG_AUX_DIR(config) AM_INIT_AUTOMAKE(aplus-fsf,4.22) AM_MAINTAINER_MODE AC_PREREQ([2.50]) dnl Checks for programs. AC_PROG_CC AC_PROG_CXX AM_PROG_LIBTOOL AC_SUBST(LIBTOOL_DEPS) AC_PROG_INSTALL dnl Checks for libraries. LIBS="$LIBS -lm" AC_CHECK_LIB( dl, main, LIBS="-ldl $LIBS") AC_CHECK_LIB( nsl, main, LIBS="-lnsl $LIBS") AC_CHECK_LIB( pthread, main, LIBS="-lpthread $LIBS") dnl Checks for library functions. AC_PROG_GCC_TRADITIONAL AC_FUNC_MEMCMP AC_FUNC_MMAP AC_TYPE_SIGNAL AC_FUNC_STRFTIME AC_FUNC_VFORK AC_FUNC_VPRINTF AC_CHECK_FUNCS(getcwd gethostname gettimeofday getwd mktime putenv regcomp select sigaction socket strcspn strdup strerror strstr strtod strtol strtoul) dnl Future replacement for nsl/socket dnl AC_SEARCH_LIBS(gethostbyname, nsl) dnl AC_CHECK_FUNC(socket, , [ dnl AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket", [ dnl AC_CHECK_LIB(nsl, socket, LIBS="$LIBS -lsocket -lnsl", , -lsocket) dnl ], "$LIBS") dnl ]) dnl Checks for X headers and libs. AC_PATH_X([X11], [X11/Xlib.h], [XOpenDisplay(NULL)]) if test "x$no_x" = "x"; then X_INCLUDES="-I$x_includes" X_LIBS="-L$x_libraries -lX11" else X_INCLUDES="" X_LIBS="" fi AC_SUBST(X_INCLUDES) AC_SUBST(X_LIBS) dnl Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(fcntl.h limits.h malloc.h strings.h sys/file.h sys/ioctl.h sys/time.h syslog.h unistd.h fp_class.h ieeefp.h math.h float.h) dnl Checks for standard C++ headers AC_LANG_PUSH(C++) AC_CHECK_HEADERS(new iostream iomanip fstream sstream iosfwd) AC_LANG_POP(C++) dnl Additional m4 macros dnl test for socklen_t AC_DEFUN(AC_TYPE_SOCKLEN_T, [AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t, [ AC_TRY_COMPILE( [#include #include ], [socklen_t len = 42; return len;], ac_cv_type_socklen_t=yes, ac_cv_type_socklen_t=no) ]) if test $ac_cv_type_socklen_t = yes; then AC_DEFINE(HAVE_SOCKLEN_T, 1, [Whether you have socklen_t]) fi ]) dnl test for SVR4 defines AC_DEFUN(AC_DEFINE_SVR4, [AC_CACHE_CHECK([for SVR4 defines], ac_cv_define_svr4, [ AC_TRY_COMPILE( [], [ #if defined(_SYSTYPE_SVR4) || defined(__SYSTYPE_SVR4) || defined(_SVR4) || defined(__SVR4) return 1; #else foobar #endif ], ac_cv_define_svr4=yes, ac_cv_define_svr4=no) ]) if test $ac_cv_define_svr4 = yes; then AC_DEFINE(HAVE_SVR4, 1, [Whether is SVR4]) fi ]) dnl HP-UX 11.00 does not have finite but does have isfinite as a macro AC_CHECK_FUNCS(fpclassify, , [AC_MSG_CHECKING(for fpclassify with ) AC_TRY_LINK([#include ], [float f = 0.0; fpclassify(f)], AC_MSG_RESULT(yes) AC_DEFINE(HAVE_FPCLASSIFY), AC_MSG_RESULT(no))]) AC_CHECK_FUNCS(finite, , [AC_CHECK_FUNCS(isfinite, , [AC_MSG_CHECKING(for isfinite with ) AC_TRY_LINK([#include ], [float f = 0.0; isfinite(f)], AC_MSG_RESULT(yes) AC_DEFINE(HAVE_ISFINITE), AC_MSG_RESULT(no))])]) AC_CHECK_FUNCS(isinf, , [AC_MSG_CHECKING(for isinf with ) AC_TRY_LINK([#include ], [float f = 0.0; isinf(f)], AC_MSG_RESULT(yes) AC_DEFINE(HAVE_ISINF), AC_MSG_RESULT(no))]) dnl determine how to get IEEE math working dnl AC_IEEE(MESSAGE, set rd_cv_ieee_[var] variable, INCLUDES, dnl FUNCTION-BODY, [ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]) AC_DEFUN(AC_IEEE, AC_MSG_CHECKING([if IEEE math works $1]) AC_CACHE_VAL([rd_cv_ieee_$2], [AC_TRY_RUN([$3 #if HAVE_MATH_H # include #endif #if HAVE_FLOAT_H # include #endif #if HAVE_IEEEFP_H # include #endif #if HAVE_FP_CLASS_H # include #endif /* Solaris */ #if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASS)) # define HAVE_ISINF 1 # define isinf(a) (fpclass(a) == FP_NINF || fpclass(a) == FP_PINF) #endif /* Digital UNIX */ #if (! defined(HAVE_ISINF) && defined(HAVE_FP_CLASS) && defined(HAVE_FP_CLASS_H)) # define HAVE_ISINF 1 # define isinf(a) (fp_class(a) == FP_NEG_INF || fp_class(a) == FP_POS_INF) #endif /* AIX */ #if (! defined(HAVE_ISINF) && defined(HAVE_CLASS)) # define HAVE_ISINF 1 # define isinf(a) (class(a) == FP_MINUS_INF || class(a) == FP_PLUS_INF) #endif #if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_PLUS_INF) && defined(FP_MINUS_INF)) # define HAVE_ISINF 1 # define isinf(a) (fpclassify(a) == FP_MINUS_INF || fpclassify(a) == FP_PLUS_INF) #endif #if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_INFINITE)) # define HAVE_ISINF 1 # define isinf(a) (fpclassify(a) == FP_INFINITE) #endif /* IRIX */ #if (! defined(isinf) && defined(HAVE_FINITE)) # define HAVE_ISINF 1 # define isinf(a) (!finite(a)) #endif #include int main(void){ double nan,inf,c,zero; $4; /* some math to see if we get a floating point exception */ zero=sin(0.0); /* don't let the compiler optimize us away */ nan=0.0/zero; /* especially here */ inf=1.0/zero; /* and here. I want to know if it can do the magic */ /* at run time without sig fpe */ c = inf + nan; c = inf / nan; if (! isnan(nan)) {printf ("not isnan(NaN) ... "); return 1;} if (nan == nan) {printf ("nan == nan ... "); return 1;} if (! isinf(inf)) {printf ("not isinf(oo) ... "); return 1;} if (! isinf(-inf)) {printf ("not isinf(-oo) ... "); return 1;} if (! inf > 0) {printf ("not inf > 0 ... "); return 1;} if (! -inf < 0) {printf ("not -inf < 0 ... "); return 1;} return 0; }], rd_cv_ieee_$2=yes, rd_cv_ieee_$2=no, :)]) dnl these we run regardles is cached or not if test x${rd_cv_ieee_$2} = "xyes"; then AC_MSG_RESULT(yes) $5 else AC_MSG_RESULT(no) $6 fi ) _cxxflags=${CXXFLAGS} _cflags=${CFLAGS} AC_IEEE([out of the box], works, , , , [CXXFLAGS="$_cxxflags -ieee" CFLAGS="$_cflags -ieee" AC_IEEE([with the -ieee switch], switch, , , , [CXXFLAGS="$_cxxflags -qfloat=nofold" CFLAGS="$_cflags -qfloat=nofold" AC_IEEE([with the -qfloat=nofold switch], nofold, , , , [CXXFLAGS="$_cxxflags -w -qflttrap=enable:zerodivide" CFLAGS="$_cflags -w -qflttrap=enable:zerodivide" AC_IEEE([with the -w -qflttrap=enable:zerodivide], flttrap, , , , [CXXFLAGS="$_cxxflags -mieee" CFLAGS="$_cflags -mieee" AC_IEEE([with the -mieee switch], mswitch, , , , [CXXFLAGS="$_cxxflags -q float=rndsngl" CFLAGS="$_cflags -q float=rndsngl" AC_IEEE([with the -q float=rndsngl switch], qswitch, , , , [CXXFLAGS="$_cxxflags -OPT:IEEE_comparisons=ON" CFLAGS="$_cflags -OPT:IEEE_comparisons=ON" AC_IEEE([with the -OPT:IEEE_comparisons=ON switch], ieeecmpswitch, , , , [CXXFLAGS=$_cxxflags CFLAGS=$_cflags AC_IEEE([with fpsetmask(0)], mask, [#include ], [fpsetmask(0)], , [AC_IEEE([with signal(SIGFPE,SIG_IGN)], sigfpe, [#include ], [signal(SIGFPE,SIG_IGN)], , AC_MSG_ERROR([ Your Compiler does not do propper IEEE math ... Please find out how to make IEEE math work with your compiler and let me know (oetiker@ee.ethz.ch). Check config.log to see what went wrong ... ]))])])])])])])])]) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_INLINE AC_TYPE_MODE_T AC_TYPE_OFF_T AC_TYPE_PID_T AC_TYPE_SIZE_T AC_STRUCT_ST_BLKSIZE AC_STRUCT_ST_BLOCKS AC_STRUCT_ST_RDEV AC_HEADER_TIME AC_STRUCT_TM AC_STRUCT_TIMEZONE AC_TYPE_UID_T AC_TYPE_SOCKLEN_T AC_DEFINE_SVR4 AC_OUTPUT(\ Makefile \ config/Makefile \ src/Makefile \ src/IPC/Makefile \ src/cxs/Makefile \ src/cxb/Makefile \ src/AplusGUI/Makefile \ src/cxsys/Makefile \ src/cxc/Makefile \ src/esf/Makefile \ src/a/Makefile \ src/app-defaults/Makefile \ src/dap/Makefile \ src/MSGUI/Makefile \ src/MSIPC/Makefile \ src/MSTypes/Makefile \ src/main/Makefile \ src/lisp.0/Makefile \ src/fonts/Makefile \ src/fonts/TrueType/Makefile \ src/fonts/X11/Makefile \ src/fonts/X11/bdf/Makefile \ src/fonts/X11/pcf/Makefile \ src/html/Makefile \ src/html/tutorials/Makefile \ src/html/tutorials/graphs/Makefile \ src/html/tutorials/s.tutorials/Makefile \ src/contrib/Makefile \ src/scripts/Makefile \ src/tutorials/Makefile \ src/tutorials/graphs/Makefile \ src/tutorials/s.tutorials/Makefile \ src/lisp.1/Makefile ) aplus-fsf-4.22/ANNOUNCE0000444000265000001440000000076107261520462010155 ANNOUNCING APLUS-FSF ==================== 1. What is aplus-fsf (A+)? -------------------------- A+ is a programming language created at Morgan Stanley with an APL heritage, an IBM developed scientific programming language. It is an array oriented language interpreter with builtin APIs to GUI, interprocess communication and many other useful toolkits. For complete documentation and tutorials see: /usr/local/doc/aplus-fsf-4.18/html/index.html aplus-fsf-4.22/LICENSE0000444000265000001440000004312007225432216010024 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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 Library 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 Appendix: 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) 19yy 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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) 19yy 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 Library General Public License instead of this License. aplus-fsf-4.22/bootstrap.sh0000755000265000001440000000015007726130161011371 #!/bin/sh aclocal -I config libtoolize --force --copy automake --foreign --add-missing --copy autoconf aplus-fsf-4.22/libtool0000755000265000001440000045253710774512451010436 #! /bin/sh # libtool - Provide generalized library-building support services. # Generated automatically by (GNU aplus-fsf 4.22) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996-2000 Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 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 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # 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. # A sed that does not truncate output. SED="/bin/sed" # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="/bin/sed -e s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi # ### BEGIN LIBTOOL CONFIG # Libtool was configured on host paias709: # Shell to use when invoking shell scripts. SHELL="/bin/sh" # Whether or not to build shared libraries. build_libtool_libs=yes # Whether or not to build static libraries. build_old_libs=yes # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=no # Whether or not to optimize for fast installation. fast_install=yes # The host system. host_alias= host=i686-pc-linux-gnu # An echo program that does not interpret backslashes. echo="echo" # The archiver. AR="ar" AR_FLAGS="cru" # The default C compiler. CC="gcc" # Is the compiler the GNU C compiler? with_gcc=yes # The linker used to build libraries. LD="/ms/dist/fsf/PROJ/binutils/2.14.90/.exec/ia32.linux.2.4.glibc.2.3/bin/ld" # Whether we need hard or soft links. LN_S="ln -s" # A BSD-compatible nm program. NM="/usr/bin/nm -B" # A symbol stripping program STRIP=strip # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=file # Used on cygwin: DLL creation program. DLLTOOL="dlltool" # Used on cygwin: object dumper. OBJDUMP="objdump" # Used on cygwin: assembler. AS="as" # The name of the directory that contains temporary libtool files. objdir=.libs # How to create reloadable object files. reload_flag=" -r" reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs" # How to pass a linker flag through the compiler. wl="-Wl," # Object file suffix (normally "o"). objext="o" # Old archive suffix (normally "a"). libext="a" # Executable file suffix (normally ""). exeext="" # Additional compiler flags for building library objects. pic_flag=" -fPIC" pic_mode=default # Does compiler simultaneously support -c and -o options? compiler_c_o="yes" # Can we write directly to a .lo ? compiler_o_lo="yes" # Must we lock files when doing compilation ? need_locks="no" # Do we need the lib prefix for modules? need_lib_prefix=no # Do we need a version for libraries? need_version=no # Whether dlopen is supported. dlopen_support=unknown # Whether dlopen of programs is supported. dlopen_self=unknown # Whether dlopen of statically linked programs is supported. dlopen_self_static=unknown # Compiler flag to prevent dynamic linking. link_static_flag="-static" # Compiler flag to turn off builtin functions. no_builtin_flag=" -fno-builtin -fno-rtti -fno-exceptions" # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec="\${wl}--export-dynamic" # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive" # Compiler flag to generate thread-safe objects. thread_safe_flag_spec="" # Library versioning type. version_type=linux # Format of library name prefix. libname_spec="lib\$name" # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec="\${libname}\${release}.so\$versuffix \${libname}\${release}.so\$major \$libname.so" # The coded name of the library, if different from the real name. soname_spec="\${libname}\${release}.so\$major" # Commands used to build and install an old-style archive. RANLIB="ranlib" old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib" old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib" old_postuninstall_cmds="" # Create an old-style archive from a shared archive. old_archive_from_new_cmds="" # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds="" # Commands used to build and install a shared archive. archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib" archive_expsym_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib" postinstall_cmds="" postuninstall_cmds="" # Commands to strip libraries. old_striplib="strip --strip-debug" striplib="strip --strip-unneeded" # Method to check whether dependent libraries are shared objects. deplibs_check_method="pass_all" # Command to use when deplibs_check_method == file_magic. file_magic_cmd="\$MAGIC_CMD" # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag="" # Flag that forces no undefined symbols. no_undefined_flag="" # Commands used to finish a libtool library installation in a directory. finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir" # Same as above, but a single script fragment to be evaled but not shown. finish_eval="" # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGISTW][ABCDGISTW]*\\)[ ][ ]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'" # Transform the output of nm in a proper C declaration global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern char \\1;/p'" # Transform the output of nm in a C name address pair global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'" # This is the shared library runtime path variable. runpath_var=LD_RUN_PATH # This is the shared library path variable. shlibpath_var=LD_LIBRARY_PATH # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=no # How to hardcode a shared library path into an executable. hardcode_action=immediate # Whether we should hardcode library paths into libraries. hardcode_into_libs=yes # Flag to hardcode $libdir into a binary during linking. # This must work even if $libdir does not exist. hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir" # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator="" # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the # resulting binary. hardcode_direct=no # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=no # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=unsupported # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=unknown # Compile-time system search path for libraries sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" # Run-time system search path for libraries sys_lib_dlsearch_path_spec="/lib /usr/lib" # Fix the shell variable $srcfile for the compiler. fix_srcfile_path="" # Set to yes if exported symbols are required. always_export_symbols=no # The commands to list exported symbols. export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | sed 's/.* //' | sort | uniq > \$export_symbols" # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds="" # Symbols that should not be listed in the preloaded symbols. exclude_expsyms="_GLOBAL_OFFSET_TABLE_" # Symbols that must always be exported. include_expsyms="" # ### END LIBTOOL CONFIG # ltmain.sh - Provide generalized library-building support services. # NOTE: Changing this file will not affect anything until you rerun configure. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 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 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # 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. # Check that we have a working $echo. if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell, and then maybe $echo will work. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat <&2 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit 1 fi # Global variables. mode=$default_mode nonopt= prev= prevopt= run= show="$echo" show_help= execute_dlfiles= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" # Parse our command line options once, thoroughly. while test $# -gt 0 do arg="$1" shift case $arg in -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in execute_dlfiles) execute_dlfiles="$execute_dlfiles $arg" ;; *) eval "$prev=\$arg" ;; esac prev= prevopt= continue fi # Have we seen a non-optional argument yet? case $arg in --help) show_help=yes ;; --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" exit 0 ;; --config) ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0 exit 0 ;; --debug) echo "$progname: enabling shell trace mode" set -x ;; --dry-run | -n) run=: ;; --features) echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit 0 ;; --finish) mode="finish" ;; --mode) prevopt="--mode" prev=mode ;; --mode=*) mode="$optarg" ;; --preserve-dup-deps) duplicate_deps="yes" ;; --quiet | --silent) show=: ;; -dlopen) prevopt="-dlopen" prev=execute_dlfiles ;; -*) $echo "$modename: unrecognized option \`$arg'" 1>&2 $echo "$help" 1>&2 exit 1 ;; *) nonopt="$arg" break ;; esac done if test -n "$prevopt"; then $echo "$modename: option \`$prevopt' requires an argument" 1>&2 $echo "$help" 1>&2 exit 1 fi # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= if test -z "$show_help"; then # Infer the operation mode. if test -z "$mode"; then case $nonopt in *cc | *++ | gcc* | *-gcc* | xlc*) mode=link for arg do case $arg in -c) mode=compile break ;; esac done ;; *db | *dbx | *strace | *truss) mode=execute ;; *install*|cp|mv) mode=install ;; *rm) mode=uninstall ;; *) # If we have no mode, but dlfiles were specified, then do execute mode. test -n "$execute_dlfiles" && mode=execute # Just use the default operation mode. if test -z "$mode"; then if test -n "$nonopt"; then $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 else $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 fi fi ;; esac fi # Only execute mode is allowed to have -dlopen flags. if test -n "$execute_dlfiles" && test "$mode" != execute; then $echo "$modename: unrecognized option \`-dlopen'" 1>&2 $echo "$help" 1>&2 exit 1 fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$modename --help --mode=$mode' for more information." # These modes are in order of execution frequency so that they run quickly. case $mode in # libtool compile mode compile) modename="$modename: compile" # Get the compilation command and the source file. base_compile= prev= lastarg= srcfile="$nonopt" suppress_output= user_target=no for arg do case $prev in "") ;; xcompiler) # Aesthetically quote the previous argument. prev= lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac # Add the previous argument to base_compile. if test -z "$base_compile"; then base_compile="$lastarg" else base_compile="$base_compile $lastarg" fi continue ;; esac # Accept any command-line options. case $arg in -o) if test "$user_target" != "no"; then $echo "$modename: you cannot specify \`-o' more than once" 1>&2 exit 1 fi user_target=next ;; -static) build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; -Xcompiler) prev=xcompiler continue ;; -Wc,*) args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac lastarg="$lastarg $arg" done IFS="$save_ifs" lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` # Add the arguments to base_compile. if test -z "$base_compile"; then base_compile="$lastarg" else base_compile="$base_compile $lastarg" fi continue ;; esac case $user_target in next) # The next one is the -o target name user_target=yes continue ;; yes) # We got the output file user_target=set libobj="$arg" continue ;; esac # Accept the current argument as the source file. lastarg="$srcfile" srcfile="$arg" # Aesthetically quote the previous argument. # Backslashify any backslashes, double quotes, and dollar signs. # These are the only characters that are still specially # interpreted inside of double-quoted scrings. lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. case $lastarg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") lastarg="\"$lastarg\"" ;; esac # Add the previous argument to base_compile. if test -z "$base_compile"; then base_compile="$lastarg" else base_compile="$base_compile $lastarg" fi done case $user_target in set) ;; no) # Get the name of the library object. libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` ;; *) $echo "$modename: you must specify a target with \`-o'" 1>&2 exit 1 ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo xform='[cCFSfmso]' case $libobj in *.ada) xform=ada ;; *.adb) xform=adb ;; *.ads) xform=ads ;; *.asm) xform=asm ;; *.c++) xform=c++ ;; *.cc) xform=cc ;; *.cpp) xform=cpp ;; *.cxx) xform=cxx ;; *.f90) xform=f90 ;; *.for) xform=for ;; esac libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` case $libobj in *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; *) $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 exit 1 ;; esac if test -z "$base_compile"; then $echo "$modename: you must specify a compilation command" 1>&2 $echo "$help" 1>&2 exit 1 fi # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $libobj" else removelist="$libobj" fi $run $rm $removelist trap "$run $rm $removelist; exit 1" 1 2 15 # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" removelist="$removelist $output_obj $lockfile" trap "$run $rm $removelist; exit 1" 1 2 15 else need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $run ln "$0" "$lockfile" 2>/dev/null; do $show "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then echo "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit 1 fi echo $srcfile > "$lockfile" fi if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then # All platforms use -DPIC, to notify preprocessed assembler code. command="$base_compile $srcfile $pic_flag -DPIC" else # Don't build PIC code command="$base_compile $srcfile" fi if test "$build_old_libs" = yes; then lo_libobj="$libobj" dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$libobj"; then dir="$objdir" else dir="$dir/$objdir" fi libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` if test -d "$dir"; then $show "$rm $libobj" $run $rm $libobj else $show "$mkdir $dir" $run $mkdir $dir status=$? if test $status -ne 0 && test ! -d $dir; then exit $status fi fi fi if test "$compiler_o_lo" = yes; then output_obj="$libobj" command="$command -o $output_obj" elif test "$compiler_c_o" = yes; then output_obj="$obj" command="$command -o $output_obj" fi $run $rm "$output_obj" $show "$command" if $run eval "$command"; then : else test -n "$output_obj" && $run $rm $removelist exit 1 fi if test "$need_locks" = warn && test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit 1 fi # Just move the object if needed, then go on to compile the next one if test x"$output_obj" != x"$libobj"; then $show "$mv $output_obj $libobj" if $run $mv $output_obj $libobj; then : else error=$? $run $rm $removelist exit $error fi fi # If we have no pic_flag, then copy the object into place and finish. if (test -z "$pic_flag" || test "$pic_mode" != default) && test "$build_old_libs" = yes; then # Rename the .lo from within objdir to obj if test -f $obj; then $show $rm $obj $run $rm $obj fi $show "$mv $libobj $obj" if $run $mv $libobj $obj; then : else error=$? $run $rm $removelist exit $error fi xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$obj"; then xdir="." else xdir="$xdir" fi baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"` libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` # Now arrange that obj and lo_libobj become the same file $show "(cd $xdir && $LN_S $baseobj $libobj)" if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then # Unlock the critical section if it was locked if test "$need_locks" != no; then $run $rm "$lockfile" fi exit 0 else error=$? $run $rm $removelist exit $error fi fi # Allow error messages only from the first compilation. suppress_output=' >/dev/null 2>&1' fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $srcfile" else # All platforms use -DPIC, to notify preprocessed assembler code. command="$base_compile $srcfile $pic_flag -DPIC" fi if test "$compiler_c_o" = yes; then command="$command -o $obj" output_obj="$obj" fi # Suppress compiler output if we already did a PIC compilation. command="$command$suppress_output" $run $rm "$output_obj" $show "$command" if $run eval "$command"; then : else $run $rm $removelist exit 1 fi if test "$need_locks" = warn && test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit 1 fi # Just move the object if needed if test x"$output_obj" != x"$obj"; then $show "$mv $output_obj $obj" if $run $mv $output_obj $obj; then : else error=$? $run $rm $removelist exit $error fi fi # Create an invalid libtool object if no PIC, so that we do not # accidentally link it into a program. if test "$build_libtool_libs" != yes; then $show "echo timestamp > $libobj" $run eval "echo timestamp > \$libobj" || exit $? else # Move the .lo from within objdir $show "$mv $libobj $lo_libobj" if $run $mv $libobj $lo_libobj; then : else error=$? $run $rm $removelist exit $error fi fi fi # Unlock the critical section if it was locked if test "$need_locks" != no; then $run $rm "$lockfile" fi exit 0 ;; # libtool link mode link | relink) modename="$modename: link" case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invokation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args="$nonopt" compile_command="$nonopt" finalize_command="$nonopt" compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= avoid_version=no dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= # We need to know -static, to get the right output filenames. for arg do case $arg in -all-static | -static) if test "X$arg" = "X-all-static"; then if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2 fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi else if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi fi build_libtool_libs=no build_old_libs=yes prefer_static_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test $# -gt 0; do arg="$1" shift case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test ;; *) qarg=$arg ;; esac libtool_args="$libtool_args $qarg" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) compile_command="$compile_command @OUTPUT@" finalize_command="$finalize_command @OUTPUT@" ;; esac case $prev in dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. compile_command="$compile_command @SYMFILE@" finalize_command="$finalize_command @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" else dlprefiles="$dlprefiles $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" if test ! -f "$arg"; then $echo "$modename: symbol file \`$arg' does not exist" exit 1 fi prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit 1 ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) xrpath="$xrpath $arg" ;; esac fi prev= continue ;; xcompiler) compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; xlinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $wl$qarg" prev= compile_command="$compile_command $wl$qarg" finalize_command="$finalize_command $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n $prev prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then compile_command="$compile_command $link_static_flag" finalize_command="$finalize_command $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 continue ;; -avoid-version) avoid_version=yes continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: more than one -exported-symbols argument is not allowed" exit 1 fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | no/*-*-nonstopux*) compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" ;; esac continue ;; -L*) dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 exit 1 fi dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "*) ;; *) deplibs="$deplibs -L$dir" lib_search_path="$lib_search_path $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) case :$dllsearchpath: in *":$dir:"*) ;; *) dllsearchpath="$dllsearchpath:$dir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-pw32* | *-*-beos*) # These systems don't actually have a C or math library (as such) continue ;; *-*-mingw* | *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi deplibs="$deplibs $arg" continue ;; -module) module=yes continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) # The PATH hackery in wrapper scripts is required on Windows # in order for the loader to find any dlls it needs. $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -o) prev=output ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit 1 ;; esac case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac continue ;; -static) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -Wc,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Wl,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $wl$flag" linker_flags="$linker_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; # Some other compiler flag. -* | +*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; *.lo | *.$objext) # A library or standard object. if test "$prev" = dlfiles; then # This file was specified with -dlopen. if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $arg" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"` prev= else case $arg in *.lo) libobjs="$libobjs $arg" ;; *) objs="$objs $arg" ;; esac fi ;; *.$libext) # An archive. deplibs="$deplibs $arg" old_deplibs="$old_deplibs $arg" continue ;; *.la) # A libtool-controlled library. if test "$prev" = dlfiles; then # This library was specified with -dlopen. dlfiles="$dlfiles $arg" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. dlprefiles="$dlprefiles $arg" prev= else deplibs="$deplibs $arg" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi done # argument parsing loop if test -n "$prev"; then $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 $echo "$help" 1>&2 exit 1 fi if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi # calculate the name of the file, without its directory outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` if test "X$output_objdir" = "X$output"; then output_objdir="$objdir" else output_objdir="$output_objdir/$objdir" fi # Create the object directory. if test ! -d $output_objdir; then $show "$mkdir $output_objdir" $run $mkdir $output_objdir status=$? if test $status -ne 0 && test ! -d $output_objdir; then exit $status fi fi # Determine the type of output case $output in "") $echo "$modename: you must specify an output file" 1>&2 $echo "$help" 1>&2 exit 1 ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if test "X$duplicate_deps" = "Xyes" ; then case "$libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi libs="$libs $deplib" done deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 exit 1 ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do if test $linkmode = prog; then # Determine which files to process case $pass in dlopen) libs="$dlfiles" save_deplibs="$deplibs" # Collect dlpreopened libraries deplibs= ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi for deplib in $libs; do lib= found=no case $deplib in -l*) if test $linkmode = oldlib && test $linkmode = obj; then $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2 continue fi if test $pass = conv; then deplibs="$deplib $deplibs" continue fi name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do # Search the libtool library lib="$searchdir/lib${name}.la" if test -f "$lib"; then found=yes break fi done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi ;; # -l -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test $pass = conv && continue newdependency_libs="$deplib $newdependency_libs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; prog) if test $pass = conv; then deplibs="$deplib $deplibs" continue fi if test $pass = scan; then deplibs="$deplib $deplibs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi ;; *) $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2 ;; esac # linkmode continue ;; # -L -R*) if test $pass = link; then dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) lib="$deplib" ;; *.$libext) if test $pass = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) if test "$deplibs_check_method" != pass_all; then echo echo "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not used here." else echo echo "*** Warning: Linking the shared library $output against the" echo "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi continue ;; prog) if test $pass != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. newdlprefiles="$newdlprefiles $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else newdlfiles="$newdlfiles $deplib" fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test $found = yes || test -f "$lib"; then : else $echo "$modename: cannot find the library \`$lib'" 1>&2 exit 1 fi # Check to see that this really is a libtool archive. if (${SED} -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit 1 fi ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." dlname= dlopen= dlpreopen= libdir= library_names= old_library= # If the library was installed with an old release of libtool, # it will not redefine variable installed. installed=yes # Read the .la file case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test $linkmode = oldlib && test $linkmode = obj; }; then # Add dl[pre]opened files of deplib test -n "$dlopen" && dlfiles="$dlfiles $dlopen" test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi if test $pass = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit 1 fi # It is a libtool convenience library, so add in its objects. convenience="$convenience $ladir/$objdir/$old_library" old_convenience="$old_convenience $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done elif test $linkmode != prog && test $linkmode != lib; then $echo "$modename: \`$lib' is not a convenience library" 1>&2 exit 1 fi continue fi # $pass = conv # Get the name of the library we link against. linklib= for l in $old_library $library_names; do linklib="$l" done if test -z "$linklib"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit 1 fi # This library was specified with -dlopen. if test $pass = dlopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 exit 1 fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. dlprefiles="$dlprefiles $lib" else newdlfiles="$newdlfiles $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 abs_ladir="$ladir" fi ;; esac laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then $echo "$modename: warning: library \`$lib' was moved." 1>&2 dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$libdir" absdir="$libdir" fi else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" fi # $installed = yes name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` # This library was specified with -dlpreopen. if test $pass = dlpreopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 exit 1 fi # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then newdlprefiles="$newdlprefiles $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then newdlprefiles="$newdlprefiles $dir/$dlname" else newdlprefiles="$newdlprefiles $dir/$linklib" fi fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test $linkmode = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" fi continue fi if test $linkmode = prog && test $pass != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test esac # Need to link against all dependency_libs? if test $linkalldeplibs = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done # for deplib continue fi # $linkmode = prog... link_static=no # Whether the deplib will be linked statically if test -n "$library_names" && { test "$prefer_static_libs" = no || test -z "$old_library"; }; then # Link against this shared library if test "$linkmode,$pass" = "prog,link" || { test $linkmode = lib && test $hardcode_into_libs = yes; }; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac if test $linkmode = prog; then # We need to hardcode the library path if test -n "$shlibpath_var"; then # Make sure the rpath contains only unique directories. case "$temp_rpath " in *" $dir "*) ;; *" $absdir "*) ;; *) temp_rpath="$temp_rpath $dir" ;; esac fi fi fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi if test "$installed" = no; then notinst_deplibs="$notinst_deplibs $lib" need_relink=yes fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names realname="$2" shift; shift libname=`eval \\$echo \"$libname_spec\"` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin*) major=`expr $current - $age` versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" soname=`echo $soroot | ${SED} -e 's/^.*\///'` newlib="libimp-`echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else $show "extracting exported symbol list from \`$soname'" save_ifs="$IFS"; IFS='~' eval cmds=\"$extract_expsyms_cmds\" for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else $show "generating import library for \`$soname'" save_ifs="$IFS"; IFS='~' eval cmds=\"$old_archive_from_expsyms_cmds\" for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n $old_archive_from_expsyms_cmds if test $linkmode = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then $echo "$modename: configuration error: unsupported hardcode properties" exit 1 fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi if test $linkmode = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && \ test "$hardcode_minus_L" != yes && \ test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac fi fi fi if test $linkmode = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then # Try looking first in the location we're being installed to. add_dir= if test -n "$inst_prefix_dir"; then case "$libdir" in [\\/]*) add_dir="-L$inst_prefix_dir$libdir" ;; esac fi add_dir="-L$libdir $add_dir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac add="-l$name" else # We cannot seem to hardcode it, guess we'll fake it. # Try looking first in the location we're being installed to. add_dir= if test -n "$inst_prefix_dir"; then case "$libdir" in [\\/]*) add_dir="-L$inst_prefix_dir$libdir" ;; esac fi add_dir="-L$libdir $add_dir " add="-l$name" fi if test $linkmode = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test $linkmode = prog; then if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi # Try to link the static library # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo echo "*** Warning: This system can not link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else convenience="$convenience $dir/$old_library" old_convenience="$old_convenience $dir/$old_library" deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test $linkmode = lib; then if test -n "$dependency_libs" && { test $hardcode_into_libs != yes || test $build_old_libs = yes || test $link_static = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` case " $xrpath " in *" $temp_xrpath "*) ;; *) xrpath="$xrpath $temp_xrpath";; esac;; *) temp_deplibs="$temp_deplibs $libdir";; esac done dependency_libs="$temp_deplibs" fi newlib_search_path="$newlib_search_path $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done if test $link_all_deplibs != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do case $deplib in -L*) path="$deplib" ;; *.la) dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$deplib" && dir="." # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 absdir="$dir" fi ;; esac if grep "^installed=no" $deplib > /dev/null; then path="-L$absdir/$objdir" else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit 1 fi if test "$absdir" != "$libdir"; then $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 fi path="-L$absdir" fi ;; *) continue ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$deplibs $path" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test $pass = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test $pass != dlopen; then test $pass != scan && dependency_libs="$newdependency_libs" if test $pass != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) lib_search_path="$lib_search_path $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do case $deplib in -L*) new_libs="$deplib $new_libs" ;; *) case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) tmp_libs="$tmp_libs $deplib" ;; esac ;; *) tmp_libs="$tmp_libs $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi if test "$pass" = "conv" && { test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then libs="$deplibs" # reset libs deplibs= fi done # for pass if test $linkmode = prog; then dlfiles="$newdlfiles" dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 fi if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 fi # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" objs="$objs$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` eval libname=\"$libname_spec\" ;; *) if test "$module" = no; then $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 $echo "$help" 1>&2 exit 1 fi if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` eval libname=\"$libname_spec\" else libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 exit 1 else echo echo "*** Warning: Linking the shared library $output against the non-libtool" echo "*** objects $objs is not portable!" libobjs="$libobjs $objs" fi fi if test "$dlself" != no; then $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 fi set dummy $rpath if test $# -gt 2; then $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 fi install_libdir="$2" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. libext=al oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 fi else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 IFS="$save_ifs" if test -n "$8"; then $echo "$modename: too many parameters to \`-version-info'" 1>&2 $echo "$help" 1>&2 exit 1 fi current="$2" revision="$3" age="$4" # Check that each of the things are valid numbers. case $current in [0-9]*) ;; *) $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 ;; esac case $revision in [0-9]*) ;; *) $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 ;; esac case $age in [0-9]*) ;; *) $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 ;; esac if test $age -gt $current; then $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header major=.`expr $current - $age` versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... minor_current=`expr $current + 1` verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current"; ;; irix | nonstopux) major=`expr $current - $age + 1` case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test $loop != 0; do iface=`expr $revision - $loop` loop=`expr $loop - 1` verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) major=.`expr $current - $age` versuffix="$major.$age.$revision" ;; osf) major=.`expr $current - $age` versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test $loop != 0; do iface=`expr $current - $loop` loop=`expr $loop - 1` verstring="$verstring:${iface}.0" done # Make executables depend on our current version. verstring="$verstring:${current}.0" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. major=`expr $current - $age` versuffix="-$major" ;; *) $echo "$modename: unknown library version type \`$version_type'" 1>&2 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit 1 ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= verstring="0.0" case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring="" ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi if test "$mode" != relink; then # Remove our outputs. $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*" $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.* fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` fi # Eliminate all temporary directories. for path in $notinst_path; do lib_search_path=`echo "$lib_search_path " | ${SED} -e 's% $path % %g'` deplibs=`echo "$deplibs " | ${SED} -e 's% -L$path % %g'` dependency_libs=`echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'` done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done if test $hardcode_into_libs != yes || test $build_old_libs = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) dlfiles="$dlfiles $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) dlprefiles="$dlprefiles $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework deplibs="$deplibs -framework System" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd*) # Do not include libc due to us having libc/libc_r. ;; *) # Add libc to deplibs on all other systems if necessary. if test $build_libtool_need_lc = "yes"; then deplibs="$deplibs -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behaviour. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $rm conftest.c cat > conftest.c </dev/null` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null \ | grep " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ | ${SED} 10q \ | egrep "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done if test -n "$a_deplib" ; then droppeddeps=yes echo echo "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then echo "*** with $libname but no candidates were found. (...for file magic test)" else echo "*** with $libname and none of the candidates passed a file format test" echo "*** using a file magic. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` for a_deplib in $deplibs; do name="`expr $a_deplib : '-l\(.*\)'`" # If $name is empty we are operating on a -L argument. if test -n "$name" && test "$name" != "0"; then libname=`eval \\$echo \"$libname_spec\"` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check below in file_magic test if eval echo \"$potent_lib\" 2>/dev/null \ | ${SED} 10q \ | egrep "$match_pattern_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done if test -n "$a_deplib" ; then droppeddeps=yes echo echo "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then echo "*** with $libname but no candidates were found. (...for regex pattern test)" else echo "*** with $libname and none of the candidates passed a file format test" echo "*** using a regex pattern. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' | grep . >/dev/null; then echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes fi ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" echo "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test $allow_undefined = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then if test $hardcode_into_libs = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" dep_rpath="$dep_rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval library_names=\"$library_names_spec\" set dummy $library_names realname="$2" shift; shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi test -z "$dlname" && dlname=$soname lib="$output_objdir/$realname" for link do linknames="$linknames $link" done # Ensure that we have .o objects for linkers which dislike .lo # (e.g. aix) in case we are running --disable-static for obj in $libobjs; do xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$obj"; then xdir="." else xdir="$xdir" fi baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` if test ! -f $xdir/$oldobj; then $show "(cd $xdir && ${LN_S} $baseobj $oldobj)" $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $? fi done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols eval cmds=\"$export_symbols_cmds\" save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" if test -n "$export_symbols_regex"; then $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' $show "$mv \"${export_symbols}T\" \"$export_symbols\"" $run eval '$mv "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' fi if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" else gentop="$output_objdir/${outputname}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "mkdir $gentop" $run mkdir "$gentop" status=$? if test $status -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" for xlib in $convenience; do # Extract the objects. case $xlib in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "mkdir $xdir" $run mkdir "$xdir" status=$? if test $status -ne 0 && test ! -d "$xdir"; then exit $status fi $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` done fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" linker_flags="$linker_flags $flag" fi # Make a backup of the uninstalled library when relinking if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval cmds=\"$archive_expsym_cmds\" else save_deplibs="$deplibs" for conv in $convenience; do tmp_deplibs= for test_deplib in $deplibs; do if test "$test_deplib" != "$conv"; then tmp_deplibs="$tmp_deplibs $test_deplib" fi done deplibs="$tmp_deplibs" done eval cmds=\"$archive_cmds\" deplibs="$save_deplibs" fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? exit 0 fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 fi case $output in *.lo) if test -n "$objs$old_deplibs"; then $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 exit 1 fi libobj="$output" obj=`$echo "X$output" | $Xsed -e "$lo2o"` ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $run $rm $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" else gentop="$output_objdir/${obj}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "mkdir $gentop" $run mkdir "$gentop" status=$? if test $status -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" for xlib in $convenience; do # Extract the objects. case $xlib in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "mkdir $xdir" $run mkdir "$xdir" status=$? if test $status -ne 0 && test ! -d "$xdir"; then exit $status fi $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` done fi fi # Create the old-style object. reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" eval cmds=\"$reload_cmds\" save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit 0 fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. $show "echo timestamp > $libobj" $run eval "echo timestamp > $libobj" || exit $? exit 0 fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" eval cmds=\"$reload_cmds\" save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" else # Just create a symlink. $show $rm $libobj $run $rm $libobj xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$libobj"; then xdir="." else xdir="$xdir" fi baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` $show "(cd $xdir && $LN_S $oldobj $baseobj)" $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $? fi if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit 0 ;; prog) case $host in *cygwin*) output=`echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; esac if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 fi if test "$preload" = yes; then if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && test "$dlopen_self_static" = unknown; then $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." fi fi case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` case $host in *darwin*) # Don't allow lazy linking, it breaks C++ global constructors compile_command="$compile_command ${wl}-bind_at_load" finalize_command="$finalize_command ${wl}-bind_at_load" ;; esac ;; esac compile_command="$compile_command $compile_deplibs" finalize_command="$finalize_command $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) case :$dllsearchpath: in *":$libdir:"*) ;; *) dllsearchpath="$dllsearchpath:$libdir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` fi dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then dlsyms="${outputname}S.c" else $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 fi fi if test -n "$dlsyms"; then case $dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${outputname}.nm" $show "$rm $nlist ${nlist}S ${nlist}T" $run $rm "$nlist" "${nlist}S" "${nlist}T" # Parse the name list into a source file. $show "creating $output_objdir/$dlsyms" test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ #ifdef __cplusplus extern \"C\" { #endif /* Prevent the only kind of declaration conflicts we can make. */ #define lt_preloaded_symbols some_other_symbol /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then $show "generating symbol list for \`$output'" test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` for arg in $progfiles; do $show "extracting global C symbols from \`$arg'" $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi if test -n "$export_symbols_regex"; then $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$output.exp" $run $rm $export_symbols $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' else $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' $run eval 'mv "$nlist"T "$nlist"' fi fi for arg in $dlprefiles; do $show "extracting global C symbols from \`$arg'" name=`echo "$arg" | ${SED} -e 's%^.*/%%'` $run eval 'echo ": $name " >> "$nlist"' $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -z "$run"; then # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $mv "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if grep -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else grep -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' else echo '/* NONE */' >> "$output_objdir/$dlsyms" fi $echo >> "$output_objdir/$dlsyms" "\ #undef lt_preloaded_symbols #if defined (__STDC__) && __STDC__ # define lt_ptr void * #else # define lt_ptr char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr address; } lt_preloaded_symbols[] = {\ " eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" $echo >> "$output_objdir/$dlsyms" "\ {0, (lt_ptr) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " fi pic_flag_for_symtable= case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";; esac;; *-*-hpux*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag -DPIC";; esac esac # Now compile the dynamic symbol file. $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? # Clean up the generated files. $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" # Transform the symbol file into the correct name. compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` ;; *) $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 exit 1 ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` fi if test $need_relink = no || test "$build_libtool_libs" != yes; then # Replace the output file specification. compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. $show "$link_command" $run eval "$link_command" status=$? # Delete the generated files. if test -n "$dlsyms"; then $show "$rm $output_objdir/${outputname}S.${objext}" $run $rm "$output_objdir/${outputname}S.${objext}" fi exit $status fi if test -n "$shlibpath_var"; then # We should set the shlibpath_var rpath= for dir in $temp_rpath; do case $dir in [\\/]* | [A-Za-z]:[\\/]*) # Absolute path. rpath="$rpath$dir:" ;; *) # Relative path: add a thisdir entry. rpath="$rpath\$thisdir/$dir:" ;; esac done temp_rpath="$rpath" fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do rpath="$rpath$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $run $rm $output # Link the executable and exit $show "$link_command" $run eval "$link_command" || exit $? exit 0 fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 $echo "$modename: \`$output' will be relinked during installation" 1>&2 else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname $show "$link_command" $run eval "$link_command" || exit $? # Now create the wrapper script. $show "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` fi # Quote $echo for shipping. if test "X$echo" = "X$SHELL $0 --fallback-echo"; then case $0 in [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";; *) qecho="$SHELL `pwd`/$0 --fallback-echo";; esac qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` else qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` fi # Only actually do things if our run command is non-null. if test -z "$run"; then # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) output=`echo $output|${SED} 's,.exe$,,'` ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe ;; *) exeext= ;; esac $rm $output trap "$rm $output; exit 1" 1 2 15 $echo > $output "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variable: notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$echo are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then echo=\"$qecho\" file=\"\$0\" # Make sure echo works. if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then # Yippee, \$echo works! : else # Restart under the correct shell, and then maybe \$echo will work. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} fi fi\ " $echo >> $output "\ # Find the directory that this script lives in. thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` done # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then echo >> $output "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || \\ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $mkdir \"\$progdir\" else $rm \"\$progdir/\$file\" fi" echo >> $output "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $echo \"\$relink_command_output\" >&2 $rm \"\$progdir/\$file\" exit 1 fi fi $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $rm \"\$progdir/\$program\"; $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } $rm \"\$progdir/\$file\" fi" else echo >> $output "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi echo >> $output "\ if test -f \"\$progdir/\$program\"; then" # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $echo >> $output "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 ${SED} $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var " fi # fixup the dll searchpath if we need to. if test -n "$dllsearchpath"; then $echo >> $output "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi $echo >> $output "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. " case $host in # win32 systems need to use the prog path for dll # lookup to work *-*-cygwin* | *-*-pw32*) $echo >> $output "\ exec \$progdir/\$program \${1+\"\$@\"} " ;; # Backslashes separate directories on plain windows *-*-mingw | *-*-os2*) $echo >> $output "\ exec \$progdir\\\\\$program \${1+\"\$@\"} " ;; *) $echo >> $output "\ # Export the path to the program. PATH=\"\$progdir:\$PATH\" export PATH exec \$program \${1+\"\$@\"} " ;; esac $echo >> $output "\ \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" exit 1 fi else # The program doesn't exist. \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 \$echo \"This script is just a wrapper for \$program.\" 1>&2 echo \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " chmod +x $output fi exit 0 ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP` fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "mkdir $gentop" $run mkdir "$gentop" status=$? if test $status -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" # Add in members from convenience archives. for xlib in $addlibs; do # Extract the objects. case $xlib in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "mkdir $xdir" $run mkdir "$xdir" status=$? if test $status -ne 0 && test ! -d "$xdir"; then exit $status fi $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP` done fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then eval cmds=\"$old_archive_from_new_cmds\" else # Ensure that we have .o objects in place in case we decided # not to build a shared library, and have fallen back to building # static libs even though --disable-static was passed! for oldobj in $oldobjs; do if test ! -f $oldobj; then xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$oldobj"; then xdir="." else xdir="$xdir" fi baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'` obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` $show "(cd $xdir && ${LN_S} $obj $baseobj)" $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $? fi done eval cmds=\"$old_archive_cmds\" fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$generated"; then $show "${rm}r$generated" $run ${rm}r$generated fi # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" $show "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` # Only create the output if not a dry run. if test -z "$run"; then for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit 1 fi newdependency_libs="$newdependency_libs $libdir/$name" ;; *) newdependency_libs="$newdependency_libs $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit 1 fi newdlfiles="$newdlfiles $libdir/$name" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit 1 fi newdlprefiles="$newdlprefiles $libdir/$name" done dlprefiles="$newdlprefiles" fi $rm $output # place dlname in correct position for cygwin tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac $echo > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test $need_relink = yes; then $echo >> $output "\ relink_command=\"$relink_command\"" fi done fi # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? ;; esac exit 0 ;; # libtool install mode install) modename="$modename: install" # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then # Aesthetically quote it. arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$arg " arg="$1" shift else install_prog= arg="$nonopt" fi # The real first argument should be the name of the installation program. # Aesthetically quote it. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$install_prog$arg" # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= for arg do if test -n "$dest"; then files="$files $dest" dest="$arg" continue fi case $arg in -d) isdir=yes ;; -f) prev="-f" ;; -g) prev="-g" ;; -m) prev="-m" ;; -o) prev="-o" ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else dest="$arg" continue fi ;; esac # Aesthetically quote the argument. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$install_prog $arg" done if test -z "$install_prog"; then $echo "$modename: you must specify an install program" 1>&2 $echo "$help" 1>&2 exit 1 fi if test -n "$prev"; then $echo "$modename: the \`$prev' option requires an argument" 1>&2 $echo "$help" 1>&2 exit 1 fi if test -z "$files"; then if test -z "$dest"; then $echo "$modename: no file or destination specified" 1>&2 else $echo "$modename: you must specify a destination" 1>&2 fi $echo "$help" 1>&2 exit 1 fi # Strip any trailing slash from the destination. dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` test "X$destdir" = "X$dest" && destdir=. destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` # Not a directory, so check to see that there is only one file specified. set dummy $files if test $# -gt 2; then $echo "$modename: \`$dest' is not a directory" 1>&2 $echo "$help" 1>&2 exit 1 fi fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 $echo "$help" 1>&2 exit 1 ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. staticlibs="$staticlibs $file" ;; *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit 1 fi library_names= old_library= relink_command= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) future_libdirs="$future_libdirs $libdir" ;; esac fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ test "X$dir" = "X$file/" && dir= dir="$dir$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$echo "$destdir" | sed "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. if test "$inst_prefix_dir" = "$destdir"; then $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 exit 1 fi if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%%"` fi $echo "$modename: warning: relinking \`$file'" 1>&2 $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 exit 1 fi fi # See the names of the shared library. set dummy $library_names if test -n "$2"; then realname="$2" shift shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. $show "$install_prog $dir/$srcname $destdir/$realname" $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? if test -n "$stripme" && test -n "$striplib"; then $show "$striplib $destdir/$realname" $run eval "$striplib $destdir/$realname" || exit $? fi if test $# -gt 0; then # Delete the old symlinks, and create new ones. for linkname do if test "$linkname" != "$realname"; then $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" fi done fi # Do each command in the postinstall commands. lib="$destdir/$realname" eval cmds=\"$postinstall_cmds\" save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Install the pseudo-library for information purposes. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` instname="$dir/$name"i $show "$install_prog $instname $destdir/$name" $run eval "$install_prog $instname $destdir/$name" || exit $? # Maybe install the static library, too. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` ;; *.$objext) staticdest="$destfile" destfile= ;; *) $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 $echo "$help" 1>&2 exit 1 ;; esac # Install the libtool object if requested. if test -n "$destfile"; then $show "$install_prog $file $destfile" $run eval "$install_prog $file $destfile" || exit $? fi # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` $show "$install_prog $staticobj $staticdest" $run eval "$install_prog \$staticobj \$staticdest" || exit $? fi exit 0 ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # Do a test to see if this is really a libtool program. case $host in *cygwin*|*mingw*) wrapper=`echo $file | ${SED} -e 's,.exe$,,'` ;; *) wrapper=$file ;; esac if (${SED} -e '4q' $wrapper | egrep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then notinst_deplibs= relink_command= # If there is no directory component, then add one. case $file in */* | *\\*) . $wrapper ;; *) . ./$wrapper ;; esac # Check the variables that should have been set. if test -z "$notinst_deplibs"; then $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 exit 1 fi finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then # If there is no directory component, then add one. case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac fi libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 finalize=no fi done relink_command= # If there is no directory component, then add one. case $file in */* | *\\*) . $wrapper ;; *) . ./$wrapper ;; esac outputname= if test "$fast_install" = no && test -n "$relink_command"; then if test "$finalize" = yes && test -z "$run"; then tmpdir="/tmp" test -n "$TMPDIR" && tmpdir="$TMPDIR" tmpdir_mktemp=`mktemp -d $tmpdir/libtool-XXXXXX 2> /dev/null` if test $? = 0 ; then tmpdir="$tmpdir_mktemp" unset tmpdir_mktemp else tmpdir="$tmpdir/libtool-$$" fi if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then : else $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 continue fi file=`$echo "X$file" | $Xsed -e 's%^.*/%%'` outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 ${rm}r "$tmpdir" continue fi file="$outputname" else $echo "$modename: warning: cannot relink \`$file'" 1>&2 fi else # Install the binary that we compiled earlier. file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyways case $install_prog,$host in /usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) destfile=`echo $destfile | ${SED} -e 's,.exe$,,'` ;; esac ;; esac $show "$install_prog$stripme $file $destfile" $run eval "$install_prog\$stripme \$file \$destfile" || exit $? test -n "$outputname" && ${rm}r "$tmpdir" ;; esac done for file in $staticlibs; do name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` # Set up the ranlib parameters. oldlib="$destdir/$name" $show "$install_prog $file $oldlib" $run eval "$install_prog \$file \$oldlib" || exit $? if test -n "$stripme" && test -n "$striplib"; then $show "$old_striplib $oldlib" $run eval "$old_striplib $oldlib" || exit $? fi # Do each command in the postinstall commands. eval cmds=\"$old_postinstall_cmds\" save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$future_libdirs"; then $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 fi if test -n "$current_libdirs"; then # Maybe just do a dry run. test -n "$run" && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $0 --finish$current_libdirs' else exit 0 fi ;; # libtool finish mode finish) modename="$modename: finish" libdirs="$nonopt" admincmds= if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for dir do libdirs="$libdirs $dir" done for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. eval cmds=\"$finish_cmds\" save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || admincmds="$admincmds $cmd" done IFS="$save_ifs" fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $run eval "$cmds" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. test "$show" = ":" && exit 0 echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do echo " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" echo " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then echo " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" echo "more information, such as the ld(1) and ld.so(8) manual pages." echo "----------------------------------------------------------------------" exit 0 ;; # libtool execute mode execute) modename="$modename: execute" # The first argument is the command name. cmd="$nonopt" if test -z "$cmd"; then $echo "$modename: you must specify a COMMAND" 1>&2 $echo "$help" exit 1 fi # Handle -dlopen flags immediately. for file in $execute_dlfiles; do if test ! -f "$file"; then $echo "$modename: \`$file' is not a file" 1>&2 $echo "$help" 1>&2 exit 1 fi dir= case $file in *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit 1 fi # Read the libtool library. dlname= library_names= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" continue fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 exit 1 fi ;; *.lo) # Just add the directory containing the .lo file. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. ;; *) $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -*) ;; *) # Do a test to see if this is really a libtool program. if (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` args="$args \"$file\"" done if test -z "$run"; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved enviroment variables if test "${save_LC_ALL+set}" = set; then LC_ALL="$save_LC_ALL"; export LC_ALL fi if test "${save_LANG+set}" = set; then LANG="$save_LANG"; export LANG fi # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" $echo "export $shlibpath_var" fi $echo "$cmd$args" exit 0 fi ;; # libtool clean and uninstall mode clean | uninstall) modename="$modename: $mode" rm="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) rm="$rm $arg"; rmforce=yes ;; -*) rm="$rm $arg" ;; *) files="$files $arg" ;; esac done if test -z "$rm"; then $echo "$modename: you must specify an RM program" 1>&2 $echo "$help" 1>&2 exit 1 fi rmdirs= for file in $files; do dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$file"; then dir=. objdir="$objdir" else objdir="$dir/$objdir" fi name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` test $mode = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates if test $mode = clean; then case " $rmdirs " in *" $objdir "*) ;; *) rmdirs="$rmdirs $objdir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if (test -L "$file") >/dev/null 2>&1 \ || (test -h "$file") >/dev/null 2>&1 \ || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then . $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" if test $mode = uninstall; then if test -n "$library_names"; then # Do each command in the postuninstall commands. eval cmds=\"$postuninstall_cmds\" save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" if test $? != 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. eval cmds=\"$old_postuninstall_cmds\" save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" if test $? != 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi # FIXME: should reinstall the best remaining shared library. fi fi ;; *.lo) if test "$build_old_libs" = yes; then oldobj=`$echo "X$name" | $Xsed -e "$lo2o"` rmfiles="$rmfiles $dir/$oldobj" fi ;; *) # Do a test to see if this is a libtool program. if test $mode = clean && (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then relink_command= . $dir/$file rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then rmfiles="$rmfiles $objdir/lt-$name" fi fi ;; esac $show "$rm $rmfiles" $run $rm $rmfiles || exit_status=1 done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then $show "rmdir $dir" $run rmdir $dir >/dev/null 2>&1 fi done exit $exit_status ;; "") $echo "$modename: you must specify a MODE" 1>&2 $echo "$generic_help" 1>&2 exit 1 ;; esac if test -z "$exec_cmd"; then $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$generic_help" 1>&2 exit 1 fi fi # test -z "$show_help" if test -n "$exec_cmd"; then eval exec $exec_cmd exit 1 fi # We need to display help for each of the modes. case $mode in "") $echo \ "Usage: $modename [OPTION]... [MODE-ARG]... Provide generalized library-building support services. --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --finish same as \`--mode=finish' --help display this help message and exit --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] --quiet same as \`--silent' --silent don't print informational messages --version print version information MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for a more detailed description of MODE." exit 0 ;; clean) $echo \ "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $echo \ "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -prefer-pic try to building PIC objects only -prefer-non-pic try to building non-PIC objects only -static always build a \`.o' file suitable for static linking COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $echo \ "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $echo \ "Usage: $modename [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $echo \ "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $echo \ "Usage: $modename [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -static do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $echo \ "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$help" 1>&2 exit 1 ;; esac echo $echo "Try \`$modename --help' for more information about other modes." exit 0 # Local Variables: # mode:shell-script # sh-indentation:2 # End: aplus-fsf-4.22/fix4mipspro0000755000265000001440000000176307362324055011245 #! /bin/sh for i in cxs a cxb cxc cxsys dap esf MSTypes MSIPC MSGUI IPC AplusGUI do cd src/$i sed -e 's/^\.\(.\)\.lo:/.\1.ng:/' \ -e 's/\.lo/.o/g' \ -e 's/$(LIBTOOL) --mode=link //' \ -e 's/^LDFLAGS =/& -shared/' \ -e 's/-rm -rf .libs/& ii_files/' \ -e 's/lib\(.*\)\.la/lib\1.so.1.0/' Makefile > Makefile.mipsro mv Makefile.mipsro Makefile cd ../.. done sed -e 's/libcxs\.la/libcxs.so.1.0/g' \ -e 's/liba\.la/liba.so.1.0/g' \ -e 's/libcxb\.la/libcxb.so.1.0/g' \ -e 's/libcxc\.la/libcxc.so.1.0/g' \ -e 's/libcxsys\.la/libcxsys.so.1.0/g' \ -e 's/libdap\.la/libdap.so.1.0/g' \ -e 's/libesf\.la/libesf.so.1.0/g' \ -e 's/libAplusGUI\.la/libAplusGUI.so.1.0/g' \ -e 's/libIPC\.la/libIPC.so.1.0/g' \ -e 's/libMSGUI\.la/libMSGUI.so.1.0/g' \ -e 's/libMSIPC\.la/libMSIPC.so.1.0/g' \ -e 's/libMSTypes\.la/libMSTypes.so.1.0/g' \ src/main/Makefile > src/main/Makefile.mipsro mv src/main/Makefile.mipsro src/main/Makefile aplus-fsf-4.22/fix4mac0000755000265000001440000000231407400253314010275 #! /bin/sh for i in cxs a cxb cxc cxsys dap esf MSTypes MSIPC MSGUI IPC AplusGUI do cd src/$i sed -e 's/^\.\(.\)\.lo:/.\1.ng:/' \ -e 's/\.lo/.o/g' \ -e 's/$(LIBTOOL) --mode=link //' \ -e "s/^ \$(CXXLINK) -rpath .*/ libtool -o lib${i}.a \$(lib${i}_la_OBJECTS)/" \ -e "s/^ \$(LINK) -rpath .*/ libtool -o lib${i}.a \$(lib${i}_la_OBJECTS)/" \ -e 's/lib\(.*\)\.la/lib\1.a/' Makefile > Makefile.mac mv Makefile.mac Makefile cd ../.. done sed 's;^ \$(CXXLINK) .*; \$(CXX) -all_load \$(aplus_OBJECTS) \$(aplus_LDADD) \$(LIBS) -framework CoreServices -o \$@;' src/main/Makefile > src/main/Makefile.mac mv src/main/Makefile.mac src/main/Makefile sed -e 's/libcxs\.la/libcxs.a/g' \ -e 's/liba\.la/liba.a/g' \ -e 's/libcxb\.la/libcxb.a/g' \ -e 's/libcxc\.la/libcxc.a/g' \ -e 's/libcxsys\.la/libcxsys.a/g' \ -e 's/libdap\.la/libdap.a/g' \ -e 's/libesf\.la/libesf.a/g' \ -e 's/libAplusGUI\.la/libAplusGUI.a/g' \ -e 's/libIPC\.la/libIPC.a/g' \ -e 's/libMSGUI\.la/libMSGUI.a/g' \ -e 's/libMSIPC\.la/libMSIPC.a/g' \ -e 's/libMSTypes\.la/libMSTypes.a/g' \ src/main/Makefile > src/main/Makefile.mac mv src/main/Makefile.mac src/main/Makefile aplus-fsf-4.22/fix4cxx0000755000265000001440000000204607400272334010344 #! /bin/sh for i in cxs a cxb cxc cxsys dap esf MSTypes MSIPC MSGUI IPC AplusGUI do cd src/$i sed -e 's/^\.\(.\)\.lo:/.\1.ng:/' \ -e 's/\.lo/.o/g' \ -e 's/$(LIBTOOL) --mode=link //' \ -e 's/^LDFLAGS =/& -shared/' \ -e 's/-rm -rf .libs/& ii_files/' \ -e 's/lib\(.*\)\.la/lib\1.so.1.0/' Makefile > Makefile.cxx mv Makefile.cxx Makefile cd ../.. done sed -e 's/libcxs\.la/libcxs.so.1.0/g' \ -e 's/liba\.la/liba.so.1.0/g' \ -e 's/libcxb\.la/libcxb.so.1.0/g' \ -e 's/libcxc\.la/libcxc.so.1.0/g' \ -e 's/libcxsys\.la/libcxsys.so.1.0/g' \ -e 's/libdap\.la/libdap.so.1.0/g' \ -e 's/libesf\.la/libesf.so.1.0/g' \ -e 's/libAplusGUI\.la/libAplusGUI.so.1.0/g' \ -e 's/libIPC\.la/libIPC.so.1.0/g' \ -e 's/libMSGUI\.la/libMSGUI.so.1.0/g' \ -e 's/libMSIPC\.la/libMSIPC.so.1.0/g' \ -e 's/libMSTypes\.la/libMSTypes.so.1.0/g' \ -e 's/^CXXLINK = \$(LIBTOOL) --mode=link /CXXLINK = /' \ src/main/Makefile > src/main/Makefile.cxx mv src/main/Makefile.cxx src/main/Makefile aplus-fsf-4.22/fix4netbsd0000755000265000001440000000030307411023660011011 #! /bin/sh for i in cxs a cxb cxc cxsys dap esf MSTypes MSIPC MSGUI IPC AplusGUI do grep -v "^LIBS =" src/$i/Makefile > src/$i/Makefile.netbsd mv src/$i/Makefile.netbsd src/$i/Makefile done aplus-fsf-4.22/fix4aix0000755000265000001440000000203207412024445010317 #! /bin/sh for i in cxs a cxb cxc cxsys dap esf MSTypes MSIPC MSGUI IPC AplusGUI do cd src/$i sed -e 's/^\.\(.\)\.lo:/.\1.ng:/' \ -e 's/\.lo/.o/g' \ -e 's/$(LIBTOOL) --mode=link //' \ -e 's/^LDFLAGS =/& -shared/' \ -e "s/^ \$(CXXLINK) -rpath .*/ ar crv lib${i}.a \$(lib${i}_la_OBJECTS)/" \ -e "s/^ \$(LINK) -rpath .*/ ar crv lib${i}.a \$(lib${i}_la_OBJECTS)/" \ -e 's/lib\(.*\)\.la/lib\1.a/' Makefile > Makefile.aix mv Makefile.aix Makefile cd ../.. done sed -e 's/libcxs\.la/libcxs.a/g' \ -e 's/liba\.la/liba.a/g' \ -e 's/libcxb\.la/libcxb.a/g' \ -e 's/libcxc\.la/libcxc.a/g' \ -e 's/libcxsys\.la/libcxsys.a/g' \ -e 's/libdap\.la/libdap.a/g' \ -e 's/libesf\.la/libesf.a/g' \ -e 's/libAplusGUI\.la/libAplusGUI.a/g' \ -e 's/libIPC\.la/libIPC.a/g' \ -e 's/libMSGUI\.la/libMSGUI.a/g' \ -e 's/libMSIPC\.la/libMSIPC.a/g' \ -e 's/libMSTypes\.la/libMSTypes.a/g' \ src/main/Makefile > src/main/Makefile.aix mv src/main/Makefile.aix src/main/Makefile aplus-fsf-4.22/config/0000777000265000001440000000000010774512562010360 5aplus-fsf-4.22/config/Makefile.am0000644000265000001440000000131407227706512012326 ## Process this file with automake to produce Makefile.in ############################################################################### ## ## ## Copyright (c) 2000 Morgan Stanley Dean Witter and Co. ## ## See ....#src#LICENSE for terms of distribution. ## ## ## ## ## ############################################################################### EXTRA_DIST = config.sub ltconfig missing config.guess install-sh ltmain.sh mkinstalldirs aplus-fsf-4.22/config/Makefile.in0000644000265000001440000001354010774512520012336 # Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ ############################################################################### ############################################################################### SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CXX = @CXX@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ STRIP = @STRIP@ VERSION = @VERSION@ X_INCLUDES = @X_INCLUDES@ X_LIBS = @X_LIBS@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ EXTRA_DIST = config.sub ltconfig missing config.guess install-sh ltmain.sh mkinstalldirs subdir = config mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_CLEAN_FILES = DIST_SOURCES = DIST_COMMON = Makefile.am Makefile.in config.guess config.sub depcomp \ install-sh ltconfig ltmain.sh missing mkinstalldirs all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign config/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: tags: TAGS TAGS: DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = .. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: 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_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_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-generic clean-libtool mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool uninstall-am: uninstall-info-am .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool uninstall uninstall-am uninstall-info-am # 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: aplus-fsf-4.22/config/config.guess0000755000265000001440000012025610774512517012622 #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003 Free Software Foundation, Inc. timestamp='2003-01-10' # This file 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # 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 Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 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." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit 0 ;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; arc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; macppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvmeppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; pmax:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sgi:OpenBSD:*:*) echo mipseb-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sun3:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; wgrisc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:MicroBSD:*:*) echo ${UNAME_MACHINE}-unknown-microbsd${UNAME_RELEASE} exit 0 ;; alpha:OSF1:*:*) if test $UNAME_RELEASE = "V4.0"; then UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` fi # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. eval $set_cc_for_build cat <$dummy.s .data \$Lformat: .byte 37,100,45,37,120,10,0 # "%d-%x\n" .text .globl main .align 4 .ent main main: .frame \$30,16,\$26,0 ldgp \$29,0(\$27) .prologue 1 .long 0x47e03d80 # implver \$0 lda \$2,-1 .long 0x47e20c21 # amask \$2,\$1 lda \$16,\$Lformat mov \$0,\$17 not \$1,\$18 jsr \$26,printf ldgp \$29,0(\$26) mov 0,\$16 jsr \$26,exit .end main EOF $CC_FOR_BUILD -o $dummy $dummy.s 2>/dev/null if test "$?" = 0 ; then case `$dummy` in 0-0) UNAME_MACHINE="alpha" ;; 1-0) UNAME_MACHINE="alphaev5" ;; 1-1) UNAME_MACHINE="alphaev56" ;; 1-101) UNAME_MACHINE="alphapca56" ;; 2-303) UNAME_MACHINE="alphaev6" ;; 2-307) UNAME_MACHINE="alphaev67" ;; 2-1307) UNAME_MACHINE="alphaev68" ;; 3-1307) UNAME_MACHINE="alphaev7" ;; esac fi echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit 0 ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit 0 ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit 0;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit 0 ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit 0 ;; *:OS/390:*:*) echo i370-ibm-openedition exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit 0;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit 0 ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; DRS?6000:UNIX_SV:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7 && exit 0 ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit 0 ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit 0 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit 0 ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit 0 ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit 0 ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit 0 ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit 0 ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c \ && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ && exit 0 echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit 0 ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit 0 ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit 0 ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit 0 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit 0 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit 0 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit 0 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit 0 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit 0 ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit 0 ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit 0 ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo rs6000-ibm-aix3.2.5 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit 0 ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:*:*) echo rs6000-ibm-aix exit 0 ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit 0 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit 0 ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit 0 ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit 0 ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit 0 ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then # avoid double evaluation of $set_cc_for_build test -n "$CC_FOR_BUILD" || eval $set_cc_for_build if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit 0 ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit 0 ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit 0 ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit 0 ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit 0 ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit 0 ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit 0 ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit 0 ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; *:UNICOS/mp:*:*) echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) # Determine whether the default compiler uses glibc. eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #if __GLIBC__ >= 2 LIBC=gnu #else LIBC= #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit 0 ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; x86:Interix*:3*) echo i586-pc-interix3 exit 0 ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit 0 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit 0 ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit 0 ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit 0 ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit 0 ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit 0 ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit 0 ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit 0 ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit 0 ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit 0 ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit 0 ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit 0 ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit 0 ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit 0 ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #ifdef __INTEL_COMPILER LIBC=gnu #else LIBC=gnuaout #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit 0 ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit 0 ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit 0 ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit 0 ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit 0 ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit 0 ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit 0 ;; i*86:*:5:[78]*) case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit 0 ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit 0 ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit 0 ;; paragon:*:*:*) echo i860-intel-osf1 exit 0 ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit 0 ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit 0 ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit 0 ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit 0 ;; M68*:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4.3${OS_REL} && exit 0 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit 0 ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit 0 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit 0 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit 0 ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit 0 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit 0 ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit 0 ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit 0 ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit 0 ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit 0 ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit 0 ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit 0 ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Darwin:*:*) case `uname -p` in *86) UNAME_PROCESSOR=i686 ;; powerpc) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit 0 ;; *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit 0 ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit 0 ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit 0 ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit 0 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit 0 ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit 0 ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit 0 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit 0 ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit 0 ;; *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit 0 ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; c34*) echo c34-convex-bsd exit 0 ;; c38*) echo c38-convex-bsd exit 0 ;; c4*) echo c4-convex-bsd exit 0 ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp 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` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: aplus-fsf-4.22/config/config.sub0000755000265000001440000007201410774512517012263 #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003 Free Software Foundation, Inc. timestamp='2003-01-03' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file 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., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # 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. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 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." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit 0;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k \ | m32r | m68000 | m68k | m88k | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | msp430 \ | ns16k | ns32k \ | openrisc | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | s390 | s390x \ | sh | sh[1234] | sh3e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ | strongarm \ | tahoe | thumb | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* \ | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* \ | clipper-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* \ | m32r-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | msp430-* \ | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | s390-* | s390x-* \ | sh-* | sh[1234]-* | sh3e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* | tic30-* | tic4x-* | tic54x-* | tic80-* | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ | xtensa-* \ | ymp-* \ | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; crds | unos) basic_machine=m68k-crds ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; mmix*) basic_machine=mmix-knuth os=-mmixware ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nv1) basic_machine=nv1-cray os=-unicosmp ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; or32 | or32-*) basic_machine=or32-unknown os=-coff ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2) basic_machine=i686-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic4x | c4x*) basic_machine=tic4x-unknown os=-coff ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh3 | sh4 | sh3eb | sh4eb | sh[1234]le | sh3ele) basic_machine=sh-unknown ;; sh64) basic_machine=sh64-unknown ;; sparc | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -microbsd*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-ibm) os=-aix ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -ptx*) vendor=sequent ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: aplus-fsf-4.22/config/depcomp0000755000265000001440000002753310304464753011660 #! /bin/sh # depcomp - compile a program generating dependencies as side-effects # Copyright 1999, 2000 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, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # 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 . 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 # `libtool' can also be set to `yes' or `no'. if test -z "$depfile"; then base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'` dir=`echo "$object" | sed 's,/.*$,/,'` if test "$dir" = "$object"; then dir= fi # FIXME: should be _deps on DOS. depfile="$dir.deps/$base" fi 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 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. "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" 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. 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. stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" outname="$stripped.o" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi 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,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^$outname: \(.*\)$,\1:," < "$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" ;; 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 tmpdepfile1="$dir.libs/$base.lo.d" tmpdepfile2="$dir.libs/$base.d" "$@" -Wc,-MD else tmpdepfile1="$dir$base.o.d" tmpdepfile2="$dir$base.d" "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi if test -f "$tmpdepfile1"; then tmpdepfile="$tmpdepfile1" else tmpdepfile="$tmpdepfile2" fi if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a space and a tab 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 proprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. We will use -o /dev/null later, # however we can't do the remplacement now because # `-o $object' might simply not be used 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 "$@" -o /dev/null $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 $? # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; -*) ;; *) 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 proprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--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 '/^# [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 proprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 aplus-fsf-4.22/config/install-sh0000755000265000001440000001273607227706513012311 #!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # 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. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: chmodcmd="" else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # 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 $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 aplus-fsf-4.22/config/ltconfig0000755000265000001440000027666007400270472012041 #! /bin/sh # ltconfig - Create a system-specific libtool. # Copyright (C) 1996-1999 Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # This file 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # 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. # A lot of this script is taken from autoconf-2.10. # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} echo=echo if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell. exec "$SHELL" "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null`} case X$UNAME in *-DOS) PATH_SEPARATOR=';' ;; *) PATH_SEPARATOR=':' ;; esac fi # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if (echo_test_string="`eval $cmd`") 2>/dev/null && echo_test_string="`eval $cmd`" && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null; then break fi done fi if test "X`($echo '\t') 2>/dev/null`" != 'X\t' || test "X`($echo "$echo_test_string") 2>/dev/null`" != X"$echo_test_string"; then # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for dir in $PATH /usr/ucb; do if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && test "X`($dir/echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then echo="$dir/echo" break fi done IFS="$save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && test "X`(print -r "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running ltconfig again with it. ORIGINAL_CONFIG_SHELL="${CONFIG_SHELL-/bin/sh}" export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" --no-reexec ${1+"$@"} else # Try using printf. echo='printf "%s\n"' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && test "X`($echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then # Cool, printf works : elif test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' && test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then CONFIG_SHELL="$ORIGINAL_CONFIG_SHELL" export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL $0 --fallback-echo" elif test "X`("$CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' && test "X`("$CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then echo="$CONFIG_SHELL $0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null; then break fi prev="$cmd" done if test "$prev" != 'sed 50q "$0"'; then echo_test_string=`eval $prev` export echo_test_string exec "${ORIGINAL_CONFIG_SHELL}" "$0" ${1+"$@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e s/^X//' sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # The name of this program. progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'` # Constants: PROGRAM=ltconfig PACKAGE=libtool VERSION=1.3.5 TIMESTAMP=" (1.385.2.206 2000/05/27 11:12:27)" ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' rm="rm -f" help="Try \`$progname --help' for more information." # Global variables: default_ofile=libtool can_build_shared=yes enable_shared=yes # All known linkers require a `.a' archive for static linking (except M$VC, # which needs '.lib'). enable_static=yes enable_fast_install=yes enable_dlopen=unknown enable_win32_dll=no ltmain= silent= srcdir= ac_config_guess= ac_config_sub= host= nonopt= ofile="$default_ofile" verify_host=yes with_gcc=no with_gnu_ld=no need_locks=yes ac_ext=c objext=o libext=a exeext= cache_file= old_AR="$AR" old_CC="$CC" old_CFLAGS="$CFLAGS" old_CPPFLAGS="$CPPFLAGS" old_LDFLAGS="$LDFLAGS" old_LD="$LD" old_LN_S="$LN_S" old_LIBS="$LIBS" old_NM="$NM" old_RANLIB="$RANLIB" old_DLLTOOL="$DLLTOOL" old_OBJDUMP="$OBJDUMP" old_AS="$AS" # Parse the command line options. args= prev= for option do case "$option" in -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac # If the previous option needs an argument, assign it. if test -n "$prev"; then eval "$prev=\$option" prev= continue fi case "$option" in --help) cat <&2 echo "$help" 1>&2 exit 1 ;; *) if test -z "$ltmain"; then ltmain="$option" elif test -z "$host"; then # This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1 # if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then # echo "$progname: warning \`$option' is not a valid host type" 1>&2 # fi host="$option" else echo "$progname: too many arguments" 1>&2 echo "$help" 1>&2 exit 1 fi ;; esac done if test -z "$ltmain"; then echo "$progname: you must specify a LTMAIN file" 1>&2 echo "$help" 1>&2 exit 1 fi if test ! -f "$ltmain"; then echo "$progname: \`$ltmain' does not exist" 1>&2 echo "$help" 1>&2 exit 1 fi # Quote any args containing shell metacharacters. ltconfig_args= for arg do case "$arg" in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) ltconfig_args="$ltconfig_args '$arg'" ;; *) ltconfig_args="$ltconfig_args $arg" ;; esac done # A relevant subset of AC_INIT. # File descriptor usage: # 0 standard input # 1 file creation # 2 errors and warnings # 3 some systems may open it to /dev/tty # 4 used on the Kubota Titan # 5 compiler messages saved in config.log # 6 checking for... messages and results if test "$silent" = yes; then exec 6>/dev/null else exec 6>&1 fi exec 5>>./config.log # NLS nuisances. # Only set LANG and LC_ALL to C if already set. # These must not be set unconditionally because not all systems understand # e.g. LANG=C (notably SCO). if test "X${LC_ALL+set}" = Xset; then LC_ALL=C; export LC_ALL; fi if test "X${LANG+set}" = Xset; then LANG=C; export LANG; fi if test -n "$cache_file" && test -r "$cache_file"; then echo "loading cache $cache_file within ltconfig" . $cache_file fi if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then ac_n= ac_c=' ' ac_t=' ' else ac_n=-n ac_c= ac_t= fi else ac_n= ac_c='\c' ac_t= fi if test -z "$srcdir"; then # Assume the source directory is the same one as the path to LTMAIN. srcdir=`$echo "X$ltmain" | $Xsed -e 's%/[^/]*$%%'` test "$srcdir" = "$ltmain" && srcdir=. fi trap "$rm conftest*; exit 1" 1 2 15 if test "$verify_host" = yes; then # Check for config.guess and config.sub. ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/config.guess; then ac_aux_dir=$ac_dir break fi done if test -z "$ac_aux_dir"; then echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2 echo "$help" 1>&2 exit 1 fi ac_config_guess=$ac_aux_dir/config.guess ac_config_sub=$ac_aux_dir/config.sub # Make sure we can run config.sub. if $SHELL $ac_config_sub sun4 >/dev/null 2>&1; then : else echo "$progname: cannot run $ac_config_sub" 1>&2 echo "$help" 1>&2 exit 1 fi echo $ac_n "checking host system type""... $ac_c" 1>&6 host_alias=$host case "$host_alias" in "") if host_alias=`$SHELL $ac_config_guess`; then : else echo "$progname: cannot guess host type; you must specify one" 1>&2 echo "$help" 1>&2 exit 1 fi ;; esac host=`$SHELL $ac_config_sub $host_alias` echo "$ac_t$host" 1>&6 # Make sure the host verified. test -z "$host" && exit 1 elif test -z "$host"; then echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2 echo "$help" 1>&2 exit 1 else host_alias=$host fi # Transform linux* to *-*-linux-gnu*, to support old configure scripts. case "$host_os" in linux-gnu*) ;; linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` esac host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` case "$host_os" in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Determine commands to create old-style static archives. old_archive_cmds='$AR cru $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= # Set a sane default for `AR'. test -z "$AR" && AR=ar # Set a sane default for `OBJDUMP'. test -z "$OBJDUMP" && OBJDUMP=objdump # If RANLIB is not set, then run the test. if test "${RANLIB+set}" != "set"; then result=no echo $ac_n "checking for ranlib... $ac_c" 1>&6 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for dir in $PATH; do test -z "$dir" && dir=. if test -f $dir/ranlib || test -f $dir/ranlib$ac_exeext; then RANLIB="ranlib" result="ranlib" break fi done IFS="$save_ifs" echo "$ac_t$result" 1>&6 fi if test -n "$RANLIB"; then old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" fi # Set sane defaults for `DLLTOOL', `OBJDUMP', and `AS', used on cygwin. test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$AS" && AS=as # Check to see if we are using GCC. if test "$with_gcc" != yes || test -z "$CC"; then # If CC is not set, then try to find GCC or a usable CC. if test -z "$CC"; then echo $ac_n "checking for gcc... $ac_c" 1>&6 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for dir in $PATH; do test -z "$dir" && dir=. if test -f $dir/gcc || test -f $dir/gcc$ac_exeext; then CC="gcc" break fi done IFS="$save_ifs" if test -n "$CC"; then echo "$ac_t$CC" 1>&6 else echo "$ac_t"no 1>&6 fi fi # Not "gcc", so try "cc", rejecting "/usr/ucb/cc". if test -z "$CC"; then echo $ac_n "checking for cc... $ac_c" 1>&6 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" cc_rejected=no for dir in $PATH; do test -z "$dir" && dir=. if test -f $dir/cc || test -f $dir/cc$ac_exeext; then if test "$dir/cc" = "/usr/ucb/cc"; then cc_rejected=yes continue fi CC="cc" break fi done IFS="$save_ifs" if test $cc_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $CC shift if test $# -gt 0; then # We chose a different compiler from the bogus one. # However, it has the same name, so the bogon will be chosen # first if we set CC to just the name; use the full file name. shift set dummy "$dir/cc" "$@" shift CC="$@" fi fi if test -n "$CC"; then echo "$ac_t$CC" 1>&6 else echo "$ac_t"no 1>&6 fi if test -z "$CC"; then echo "$progname: error: no acceptable cc found in \$PATH" 1>&2 exit 1 fi fi # Now see if the compiler is really GCC. with_gcc=no echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6 echo "$progname:581: checking whether we are using GNU C" >&5 $rm conftest.c cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then with_gcc=yes fi $rm conftest.c echo "$ac_t$with_gcc" 1>&6 fi # Allow CC to be a program name with arguments. set dummy $CC compiler="$2" echo $ac_n "checking for object suffix... $ac_c" 1>&6 $rm conftest* echo 'int i = 1;' > conftest.c echo "$progname:603: checking for object suffix" >& 5 if { (eval echo $progname:604: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then # Append any warnings to the config.log. cat conftest.err 1>&5 for ac_file in conftest.*; do case $ac_file in *.c) ;; *) objext=`echo $ac_file | sed -e s/conftest.//` ;; esac done else cat conftest.err 1>&5 echo "$progname: failed program was:" >&5 cat conftest.c >&5 fi $rm conftest* echo "$ac_t$objext" 1>&6 echo $ac_n "checking for executable suffix... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_exeext="no" $rm conftest* echo 'main () { return 0; }' > conftest.c echo "$progname:629: checking for executable suffix" >& 5 if { (eval echo $progname:630: \"$ac_link\") 1>&5; (eval $ac_link) 2>conftest.err; }; then # Append any warnings to the config.log. cat conftest.err 1>&5 for ac_file in conftest.*; do case $ac_file in *.c | *.err | *.$objext ) ;; *) ac_cv_exeext=.`echo $ac_file | sed -e s/conftest.//` ;; esac done else cat conftest.err 1>&5 echo "$progname: failed program was:" >&5 cat conftest.c >&5 fi $rm conftest* fi if test "X$ac_cv_exeext" = Xno; then exeext="" else exeext="$ac_cv_exeext" fi echo "$ac_t$ac_cv_exeext" 1>&6 echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6 pic_flag= special_shlib_compile_flags= wl= link_static_flag= no_builtin_flag= if test "$with_gcc" = yes; then wl='-Wl,' link_static_flag='-static' case "$host_os" in beos* | irix5* | irix6* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; aix*) # Below there is a dirty hack to force normal static linking with -ldl # The problem is because libdl dynamically linked with both libc and # libC (AIX C++ library), which obviously doesn't included in libraries # list by gcc. This cause undefined symbols with -static flags. # This hack allows C programs to be linked with "-static -ldl", but # we not sure about C++ programs. link_static_flag="$link_static_flag ${wl}-lC" ;; cygwin* | mingw* | os2*) # We can build DLLs from non-PIC. ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. pic_flag='-m68020 -resident32 -malways-restore-a4' ;; sysv4*MP*) if test -d /usr/nec; then pic_flag=-Kconform_pic fi ;; *) pic_flag='-fPIC' ;; esac else # PORTME Check for PIC flags for the system compiler. case "$host_os" in aix3* | aix4*) # All AIX code is PIC. link_static_flag='-bnso -bI:/lib/syscalls.exp' ;; hpux9* | hpux10* | hpux11*) # Is there a better link_static_flag that works with the bundled CC? wl='-Wl,' link_static_flag="${wl}-a ${wl}archive" pic_flag='+Z' ;; irix5* | irix6*) wl='-Wl,' link_static_flag='-non_shared' # PIC (with -KPIC) is the default. ;; cygwin* | mingw* | os2*) # We can build DLLs from non-PIC. ;; osf3* | osf4* | osf5*) # All OSF/1 code is PIC. wl='-Wl,' link_static_flag='-non_shared' ;; sco3.2v5*) pic_flag='-Kpic' link_static_flag='-dn' special_shlib_compile_flags='-belf' ;; solaris*) pic_flag='-KPIC' link_static_flag='-Bstatic' wl='-Wl,' ;; sunos4*) pic_flag='-PIC' link_static_flag='-Bstatic' wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) pic_flag='-KPIC' link_static_flag='-Bstatic' wl='-Wl,' ;; uts4*) pic_flag='-pic' link_static_flag='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then pic_flag='-Kconform_pic' link_static_flag='-Bstatic' fi ;; *) can_build_shared=no ;; esac fi if test -n "$pic_flag"; then echo "$ac_t$pic_flag" 1>&6 # Check to make sure the pic_flag actually works. echo $ac_n "checking if $compiler PIC flag $pic_flag works... $ac_c" 1>&6 $rm conftest* echo "int some_variable = 0;" > conftest.c save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $pic_flag -DPIC" echo "$progname:776: checking if $compiler PIC flag $pic_flag works" >&5 if { (eval echo $progname:777: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then # Append any warnings to the config.log. cat conftest.err 1>&5 case "$host_os" in hpux9* | hpux10* | hpux11*) # On HP-UX, both CC and GCC only warn that PIC is supported... then they # create non-PIC objects. So, if there were any warnings, we assume that # PIC is not supported. if test -s conftest.err; then echo "$ac_t"no 1>&6 can_build_shared=no pic_flag= else echo "$ac_t"yes 1>&6 pic_flag=" $pic_flag" fi ;; *) echo "$ac_t"yes 1>&6 pic_flag=" $pic_flag" ;; esac else # Append any errors to the config.log. cat conftest.err 1>&5 can_build_shared=no pic_flag= echo "$ac_t"no 1>&6 fi CFLAGS="$save_CFLAGS" $rm conftest* else echo "$ac_t"none 1>&6 fi # Check to see if options -o and -c are simultaneously supported by compiler echo $ac_n "checking if $compiler supports -c -o file.o... $ac_c" 1>&6 $rm -r conftest 2>/dev/null mkdir conftest cd conftest $rm conftest* echo "int some_variable = 0;" > conftest.c mkdir out # According to Tom Tromey, Ian Lance Taylor reported there are C compilers # that will create temporary files in the current directory regardless of # the output directory. Thus, making CWD read-only will cause this test # to fail, enabling locking or at least warning the user not to do parallel # builds. chmod -w . save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -o out/conftest2.o" echo "$progname:829: checking if $compiler supports -c -o file.o" >&5 if { (eval echo $progname:830: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.o; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s out/conftest.err; then echo "$ac_t"no 1>&6 compiler_c_o=no else echo "$ac_t"yes 1>&6 compiler_c_o=yes fi else # Append any errors to the config.log. cat out/conftest.err 1>&5 compiler_c_o=no echo "$ac_t"no 1>&6 fi CFLAGS="$save_CFLAGS" chmod u+w . $rm conftest* out/* rmdir out cd .. rmdir conftest $rm -r conftest 2>/dev/null if test x"$compiler_c_o" = x"yes"; then # Check to see if we can write to a .lo echo $ac_n "checking if $compiler supports -c -o file.lo... $ac_c" 1>&6 $rm conftest* echo "int some_variable = 0;" > conftest.c save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -c -o conftest.lo" echo "$progname:862: checking if $compiler supports -c -o file.lo" >&5 if { (eval echo $progname:863: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.lo; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then echo "$ac_t"no 1>&6 compiler_o_lo=no else echo "$ac_t"yes 1>&6 compiler_o_lo=yes fi else # Append any errors to the config.log. cat conftest.err 1>&5 compiler_o_lo=no echo "$ac_t"no 1>&6 fi CFLAGS="$save_CFLAGS" $rm conftest* else compiler_o_lo=no fi # Check to see if we can do hard links to lock some files if needed hard_links="nottested" if test "$compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo $ac_n "checking if we can lock with hard links... $ac_c" 1>&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$ac_t$hard_links" 1>&6 $rm conftest* if test "$hard_links" = no; then echo "*** WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2 need_locks=warn fi else need_locks=no fi if test "$with_gcc" = yes; then # Check to see if options -fno-rtti -fno-exceptions are supported by compiler echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions ... $ac_c" 1>&6 $rm conftest* echo "int some_variable = 0;" > conftest.c save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.c" echo "$progname:914: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 if { (eval echo $progname:915: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then echo "$ac_t"no 1>&6 compiler_rtti_exceptions=no else echo "$ac_t"yes 1>&6 compiler_rtti_exceptions=yes fi else # Append any errors to the config.log. cat conftest.err 1>&5 compiler_rtti_exceptions=no echo "$ac_t"no 1>&6 fi CFLAGS="$save_CFLAGS" $rm conftest* if test "$compiler_rtti_exceptions" = "yes"; then no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' else no_builtin_flag=' -fno-builtin' fi fi # Check for any special shared library compilation flags. if test -n "$special_shlib_compile_flags"; then echo "$progname: warning: \`$CC' requires \`$special_shlib_compile_flags' to build shared libraries" 1>&2 if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$special_shlib_compile_flags[ ]" >/dev/null; then : else echo "$progname: add \`$special_shlib_compile_flags' to the CC or CFLAGS env variable and reconfigure" 1>&2 can_build_shared=no fi fi echo $ac_n "checking if $compiler static flag $link_static_flag works... $ac_c" 1>&6 $rm conftest* echo 'main(){return(0);}' > conftest.c save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $link_static_flag" echo "$progname:958: checking if $compiler static flag $link_static_flag works" >&5 if { (eval echo $progname:959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then echo "$ac_t$link_static_flag" 1>&6 else echo "$ac_t"none 1>&6 link_static_flag= fi LDFLAGS="$save_LDFLAGS" $rm conftest* if test -z "$LN_S"; then # Check to see if we can use ln -s, or we need hard links. echo $ac_n "checking whether ln -s works... $ac_c" 1>&6 $rm conftest.dat if ln -s X conftest.dat 2>/dev/null; then $rm conftest.dat LN_S="ln -s" else LN_S=ln fi if test "$LN_S" = "ln -s"; then echo "$ac_t"yes 1>&6 else echo "$ac_t"no 1>&6 fi fi # Make sure LD is an absolute path. if test -z "$LD"; then ac_prog=ld if test "$with_gcc" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC... $ac_c" 1>&6 echo "$progname:991: checking for ld used by GCC" >&5 ac_prog=`($CC -print-prog-name=ld) 2>&5` case "$ac_prog" in # Accept absolute paths. [\\/]* | [A-Za-z]:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we are not using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then echo $ac_n "checking for GNU ld... $ac_c" 1>&6 echo "$progname:1015: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 echo "$progname:1018: checking for non-GNU ld" >&5 fi if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. if "$LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then test "$with_gnu_ld" != no && break else test "$with_gnu_ld" != yes && break fi fi done IFS="$ac_save_ifs" fi if test -n "$LD"; then echo "$ac_t$LD" 1>&6 else echo "$ac_t"no 1>&6 fi if test -z "$LD"; then echo "$progname: error: no acceptable ld found in \$PATH" 1>&2 exit 1 fi fi # Check to see if it really is or is not GNU ld. echo $ac_n "checking if the linker ($LD) is GNU ld... $ac_c" 1>&6 # I'd rather use --version here, but apparently some GNU ld's only accept -v. if $LD -v 2>&1 &5; then with_gnu_ld=yes else with_gnu_ld=no fi echo "$ac_t$with_gnu_ld" 1>&6 # See if the linker supports building shared libraries. echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6 allow_undefined_flag= no_undefined_flag= need_lib_prefix=unknown need_version=unknown # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments archive_cmds= archive_expsym_cmds= old_archive_from_new_cmds= export_dynamic_flag_spec= whole_archive_flag_spec= thread_safe_flag_spec= hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no hardcode_shlibpath_var=unsupported runpath_var= always_export_symbols=no export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an egrep regular expression of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. case "$host_os" in cygwin* | mingw*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$with_gcc" != yes; then with_gnu_ld=no fi ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # See if GNU ld supports shared libraries. case "$host_os" in aix3* | aix4*) # On AIX, the GNU linker is very broken ld_shlibs=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF ;; amigaos*) archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw*) # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported always_export_symbols=yes # Extract the symbol export list from an `--export-all' def file, # then regenerate the def file from the symbol export list, so that # the compiled dll only exports the symbol export list. # Be careful not to strip the DATA tag left by newer dlltools. export_symbols_cmds='test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~ test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~ $DLLTOOL --export-all --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --output-def $objdir/$soname-def $objdir/$soname-ltdll.$objext $libobjs $convenience~ sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $objdir/$soname-def > $export_symbols' # If DATA tags from a recent dlltool are present, honour them! archive_expsym_cmds='echo EXPORTS > $objdir/$soname-def~ _lt_hint=1; cat $export_symbols | while read symbol; do set dummy \$symbol; case \$# in 2) echo " \$2 @ \$_lt_hint ; " >> $objdir/$soname-def;; *) echo " \$2 @ \$_lt_hint \$3 ; " >> $objdir/$soname-def;; esac; _lt_hint=`expr 1 + \$_lt_hint`; done~ test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~ test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~ $CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~ $CC -Wl,--base-file,$objdir/$soname-base $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~ $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts' old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a' ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else archive_cmds='$LD -Bshareable $libobjs $deplibs $linkopts -o $lib' # can we support soname and/or expsyms with a.out? -oliva fi ;; solaris* | sysv5*) if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linkopts' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = yes; then runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' case $host_os in cygwin* | mingw*) # dlltool doesn't understand --whole-archive et. al. whole_archive_flag_spec= ;; *) # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi ;; esac fi else # PORTME fill in a description of your system's linker (not GNU ld) case "$host_os" in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $objdir/$soname $libobjs $deplibs $linkopts -bE:$export_symbols -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$with_gcc" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4*) hardcode_libdir_flag_spec='${wl}-b ${wl}nolibpath ${wl}-b ${wl}libpath:$libdir:/usr/lib:/lib' hardcode_libdir_separator=':' if test "$with_gcc" = yes; then collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct=yes else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi shared_flag='-shared' else shared_flag='${wl}-bM:SRE' hardcode_direct=yes fi allow_undefined_flag=' ${wl}-berok' archive_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bexpall ${wl}-bnoentry${allow_undefined_flag}' archive_expsym_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}' case "$host_os" in aix4.[01]|aix4.[01].*) # According to Greg Wooledge, -bexpall is only supported from AIX 4.2 on always_export_symbols=yes ;; esac ;; amigaos*) archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; cygwin* | mingw*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $linkopts `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib /OUT:$oldlib$oldobjs' fix_srcfile_path='`cygpath -w $srcfile`' ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $linkopts' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9* | hpux10* | hpux11*) case "$host_os" in hpux9*) archive_cmds='$rm $objdir/$soname~$LD -b +b $install_libdir -o $objdir/$soname $libobjs $deplibs $linkopts~test $objdir/$soname = $lib || mv $objdir/$soname $lib' ;; *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linkopts' ;; esac hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_minus_L=yes # Not in the search PATH, but as the default # location of the library. export_dynamic_flag_spec='${wl}-E' ;; irix5* | irix6*) if test "$with_gcc" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' else archive_cmds='$LD -shared $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linkopts' # ELF fi hardcode_libdir_flag_spec='${wl}-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; openbsd*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $objdir/$libname.def~$echo DATA >> $objdir/$libname.def~$echo " SINGLE NONSHARED" >> $objdir/$libname.def~$echo EXPORTS >> $objdir/$libname.def~emxexp $libobjs >> $objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $linkopts $objdir/$libname.def' old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def' ;; osf3*) if test "$with_gcc" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # As osf3* with the addition of the -msym flag if test "$with_gcc" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; rhapsody*) archive_cmds='$CC -bundle -undefined suppress -o $lib $libobjs $deplibs $linkopts' hardcode_libdir_flags_spec='-L$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; sco3.2v5*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) no_undefined_flag=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp' hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case "$host_os" in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linkopts' hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $linkopts' else archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv5*) no_undefined_flag=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp' hardcode_libdir_flag_spec= hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4.2uw2*) archive_cmds='$LD -G -o $lib $libobjs $deplibs $linkopts' hardcode_direct=yes hardcode_minus_L=no hardcode_shlibpath_var=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; unixware7*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac fi echo "$ac_t$ld_shlibs" 1>&6 test "$ld_shlibs" = no && can_build_shared=no if test -z "$NM"; then echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6 case "$NM" in [\\/]* | [A-Za-z]:[\\/]*) ;; # Let the user override the test with a path. *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for ac_dir in $PATH /usr/ucb /usr/ccs/bin /bin; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then NM="$ac_dir/nm -B" break elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then NM="$ac_dir/nm -p" break else NM=${NM="$ac_dir/nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags fi fi done IFS="$ac_save_ifs" test -z "$NM" && NM=nm ;; esac echo "$ac_t$NM" 1>&6 fi # Check for command to grab the raw symbol name followed by C symbol from nm. echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6 # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Transform the above into a raw symbol and a C symbol. symxfrm='\1 \2\3 \3' # Transform an extracted symbol line into a proper C declaration global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" # Define system-specific variables. case "$host_os" in aix*) symcode='[BCDT]' ;; cygwin* | mingw*) symcode='[ABCDGISTW]' ;; hpux*) # Its linker distinguishes data from code symbols global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'" ;; irix*) symcode='[BCDEGRST]' ;; solaris*) symcode='[BDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then symcode='[ABCDGISTW]' fi # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Write the raw and C identifiers. global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode\)[ ][ ]*\($ac_symprfx\)$sympat$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no $rm conftest* cat > conftest.c <&5 if { (eval echo $progname:1654: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then # Now try to grab the symbols. nlist=conftest.nm if { echo "$progname:1657: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if egrep ' nm_test_var$' "$nlist" >/dev/null; then if egrep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.c #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$global_symbol_to_cdecl"' < "$nlist" >> conftest.c' cat <> conftest.c #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[] = { EOF sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$nlist" >> conftest.c cat <<\EOF >> conftest.c {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$objext conftstm.$objext save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="conftstm.$objext" CFLAGS="$CFLAGS$no_builtin_flag" if { (eval echo $progname:1709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then pipe_works=yes else echo "$progname: failed program was:" >&5 cat conftest.c >&5 fi LIBS="$save_LIBS" else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.c >&5 fi $rm conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else global_symbol_pipe= fi done if test "$pipe_works" = yes; then echo "${ac_t}ok" 1>&6 else echo "${ac_t}failed" 1>&6 fi if test -z "$global_symbol_pipe"; then global_symbol_to_cdecl= fi # Check hardcoding attributes. echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6 hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var"; then # We can hardcode non-existant directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$hardcode_shlibpath_var" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi echo "$ac_t$hardcode_action" 1>&6 reload_flag= reload_cmds='$LD$reload_flag -o $output$reload_objs' echo $ac_n "checking for $LD option to reload object files... $ac_c" 1>&6 # PORTME Some linkers may need a different reload flag. reload_flag='-r' echo "$ac_t$reload_flag" 1>&6 test -n "$reload_flag" && reload_flag=" $reload_flag" # PORTME Fill in your ld.so characteristics library_names_spec= libname_spec='lib$name' soname_spec= postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" file_magic_cmd= file_magic_test_file= deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [regex]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given egrep regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6 case "$host_os" in aix3*) version_type=linux library_names_spec='${libname}${release}.so$versuffix $libname.a' shlibpath_var=LIBPATH # AIX has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}.so$major' ;; aix4*) version_type=linux # AIX has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. # We preserve .a as extension for shared libraries though AIX4.2 # and later linker supports .so library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.a' shlibpath_var=LIBPATH deplibs_check_method=pass_all ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' ;; beos*) library_names_spec='${libname}.so' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH deplibs_check_method=pass_all lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; bsdi4*) version_type=linux need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' file_magic_cmd=/usr/bin/file file_magic_test_file=/shlib/libc.so sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" export_dynamic_flag_spec=-rdynamic # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw*) version_type=windows need_version=no need_lib_prefix=no if test "$with_gcc" = yes; then library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.a' else library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib' fi dynamic_linker='Win32 ld.exe' deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' file_magic_cmd='${OBJDUMP} -f' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; freebsd1*) dynamic_linker=no ;; freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case "$version_type" in freebsd-elf*) deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object' file_magic_cmd=/usr/bin/file file_magic_test_file=`echo /usr/lib/libc.so*` library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' need_version=no need_lib_prefix=no ;; freebsd-*) deplibs_check_method=unknown library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case "$host_os" in freebsd2* | freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. dynamic_linker="$host_os dld.sl" version_type=sunos need_lib_prefix=no need_version=no shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' soname_spec='${libname}${release}.sl$major' # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' case "$host_os" in hpux10.20*) # TODO: Does this work for hpux-11 too? deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' file_magic_cmd=/usr/bin/file file_magic_test_file=/usr/lib/libc.sl ;; esac ;; irix5* | irix6*) version_type=irix need_lib_prefix=no need_version=no soname_spec='${libname}${release}.so.$major' library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major ${libname}${release}.so $libname.so' case "$host_os" in irix5*) libsuff= shlibsuff= # this will be overridden with pass_all, but let us keep it just in case deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" ;; *) case "$LD" in # libtool.m4 will add one of these switches to LD *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" file_magic_cmd=/usr/bin/file file_magic_test_file=`echo /lib${libsuff}/libc.so*` deplibs_check_method='pass_all' ;; # No shared lib support for Linux oldld, aout, or coff. linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) dynamic_linker=no ;; # This must be Linux ELF. linux-gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no deplibs_check_method=pass_all if test -f /lib/ld.so.1; then dynamic_linker='GNU ld.so' else # Only the GNU ld.so supports shared libraries on MkLinux. case "$host_cpu" in powerpc*) dynamic_linker=no ;; *) dynamic_linker='Linux ld.so' ;; esac fi ;; netbsd*) version_type=sunos if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so' soname_spec='${libname}${release}.so$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH ;; openbsd*) version_type=sunos if test "$with_gnu_ld" = yes; then need_lib_prefix=no need_version=no fi library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH ;; os2*) libname_spec='$name' need_lib_prefix=no library_names_spec='$libname.dll $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_version=no soname_spec='${libname}${release}.so' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' shlibpath_var=LD_LIBRARY_PATH # this will be overridden with pass_all, but let us keep it just in case deplibs_check_method='file_magic COFF format alpha shared library' file_magic_cmd=/usr/bin/file file_magic_test_file=/shlib/libc.so deplibs_check_method='pass_all' sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rhapsody*) version_type=sunos library_names_spec='${libname}.so' soname_spec='${libname}.so' shlibpath_var=DYLD_LIBRARY_PATH deplibs_check_method=pass_all ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}.so$major' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' deplibs_check_method="file_magic ELF [0-9][0-9]-bit [LM]SB dynamic lib" file_magic_cmd=/usr/bin/file file_magic_test_file=/lib/libc.so ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH case "$host_vendor" in sequent) file_magic_cmd='/bin/file' deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; ncr) deplibs_check_method='pass_all' ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' file_magic_cmd=/usr/bin/file file_magic_test_file=`echo /usr/lib/libc.so*` ;; esac ;; uts4*) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' soname_spec='$libname.so.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; *) dynamic_linker=no ;; esac echo "$ac_t$dynamic_linker" 1>&6 test "$dynamic_linker" = no && can_build_shared=no # Report the final consequences. echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6 # Only try to build win32 dlls if AC_LIBTOOL_WIN32_DLL was used in # configure.in, otherwise build static only libraries. case "$host_os" in cygwin* | mingw* | os2*) if test x$can_build_shared = xyes; then test x$enable_win32_dll = xno && can_build_shared=no echo "checking if package supports dlls... $can_build_shared" 1>&6 fi ;; esac if test -n "$file_magic_test_file" && test -n "$file_magic_cmd"; then case "$deplibs_check_method" in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | egrep "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6 test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case "$host_os" in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4*) test "$enable_shared" = yes && enable_static=no ;; esac echo "$ac_t$enable_shared" 1>&6 # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes echo "checking whether to build static libraries... $enable_static" 1>&6 if test "$hardcode_action" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi echo $ac_n "checking for objdir... $ac_c" 1>&6 rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. objdir=_libs fi rmdir .libs 2>/dev/null echo "$ac_t$objdir" 1>&6 if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else if eval "test \"`echo '$''{'lt_cv_dlopen'+set}'`\" != set"; then lt_cv_dlopen=no lt_cv_dlopen_libs= echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 echo "$progname:2248: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dlopen""... $ac_c" 1>&6 echo "$progname:2288: checking for dlopen" >&5 if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen(); int main() { /* 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_dlopen) || defined (__stub___dlopen) choke me #else dlopen(); #endif ; return 0; } EOF if { (eval echo $progname:2318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_dlopen=yes" else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_dlopen=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then echo "$ac_t""yes" 1>&6 lt_cv_dlopen="dlopen" else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6 echo "$progname:2335: checking for dld_link in -ldld" >&5 ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" else echo "$ac_t""no" 1>&6 echo $ac_n "checking for shl_load""... $ac_c" 1>&6 echo "$progname:2375: checking for shl_load" >&5 if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load(); int main() { /* 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_shl_load) || defined (__stub___shl_load) choke me #else shl_load(); #endif ; return 0; } EOF if { (eval echo $progname:2405: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_shl_load=yes" else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_shl_load=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then echo "$ac_t""yes" 1>&6 lt_cv_dlopen="shl_load" else echo "$ac_t""no" 1>&6 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 echo "$progname:2423: checking for shl_load in -ldld" >&5 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else echo "$ac_t""no" 1>&6 fi fi fi fi fi fi if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes fi case "$lt_cv_dlopen" in dlopen) for ac_hdr in dlfcn.h; do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "$progname:2488: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int fnord = 0; EOF ac_try="$ac_compile >/dev/null 2>conftest.out" { (eval echo $progname:2498: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 else echo "$ac_t""no" 1>&6 fi done if test "x$ac_cv_header_dlfcn_h" = xyes; then CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" fi eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" LIBS="$lt_cv_dlopen_libs $LIBS" echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6 echo "$progname:2526: checking whether a program can dlopen itself" >&5 if test "${lt_cv_dlopen_self+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then lt_cv_dlopen_self=cross else cat > conftest.c < #endif #include #ifdef RTLD_GLOBAL # define LTDL_GLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LTDL_GLOBAL DL_GLOBAL # else # define LTDL_GLOBAL 0 # endif #endif /* We may have to define LTDL_LAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LTDL_LAZY_OR_NOW # ifdef RTLD_LAZY # define LTDL_LAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LTDL_LAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LTDL_LAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LTDL_LAZY_OR_NOW DL_NOW # else # define LTDL_LAZY_OR_NOW 0 # endif # endif # endif # endif #endif fnord() { int i=42;} main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord"); if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } EOF if { (eval echo $progname:2580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then lt_cv_dlopen_self=yes else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* lt_cv_dlopen_self=no fi rm -fr conftest* fi fi echo "$ac_t""$lt_cv_dlopen_self" 1>&6 if test "$lt_cv_dlopen_self" = yes; then LDFLAGS="$LDFLAGS $link_static_flag" echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6 echo "$progname:2599: checking whether a statically linked program can dlopen itself" >&5 if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then lt_cv_dlopen_self_static=cross else cat > conftest.c < #endif #include #ifdef RTLD_GLOBAL # define LTDL_GLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LTDL_GLOBAL DL_GLOBAL # else # define LTDL_GLOBAL 0 # endif #endif /* We may have to define LTDL_LAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LTDL_LAZY_OR_NOW # ifdef RTLD_LAZY # define LTDL_LAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LTDL_LAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LTDL_LAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LTDL_LAZY_OR_NOW DL_NOW # else # define LTDL_LAZY_OR_NOW 0 # endif # endif # endif # endif #endif fnord() { int i=42;} main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord"); if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } EOF if { (eval echo $progname:2653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then lt_cv_dlopen_self_static=yes else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* lt_cv_dlopen_self_static=no fi rm -fr conftest* fi fi echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6 fi ;; esac case "$lt_cv_dlopen_self" in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case "$lt_cv_dlopen_self_static" in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi # Copy echo and quote the copy, instead of the original, because it is # used later. ltecho="$echo" if test "X$ltecho" = "X$CONFIG_SHELL $0 --fallback-echo"; then ltecho="$CONFIG_SHELL \$0 --fallback-echo" fi LTSHELL="$SHELL" LTCONFIG_VERSION="$VERSION" # Only quote variables if we're using ltmain.sh. case "$ltmain" in *.sh) # Now quote all the things that may contain metacharacters. for var in ltecho old_CC old_CFLAGS old_CPPFLAGS \ old_LD old_LDFLAGS old_LIBS \ old_NM old_RANLIB old_LN_S old_DLLTOOL old_OBJDUMP old_AS \ AR CC LD LN_S NM LTSHELL LTCONFIG_VERSION \ reload_flag reload_cmds wl \ pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \ thread_safe_flag_spec whole_archive_flag_spec libname_spec \ library_names_spec soname_spec \ RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \ old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds postuninstall_cmds \ file_magic_cmd export_symbols_cmds deplibs_check_method allow_undefined_flag no_undefined_flag \ finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \ hardcode_libdir_flag_spec hardcode_libdir_separator \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do case "$var" in reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ export_symbols_cmds | archive_cmds | archive_expsym_cmds | \ postinstall_cmds | postuninstall_cmds | \ finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case "$ltecho" in *'\$0 --fallback-echo"') ltecho=`$echo "X$ltecho" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac trap "$rm \"$ofile\"; exit 1" 1 2 15 echo "creating $ofile" $rm "$ofile" cat < "$ofile" #! $SHELL # `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh. # # Copyright (C) 1996-1999 Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 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 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # 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. # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="sed -e s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi ### BEGIN LIBTOOL CONFIG EOF cfgfile="$ofile" ;; *) # Double-quote the variables that need it (for aesthetics). for var in old_CC old_CFLAGS old_CPPFLAGS \ old_LD old_LDFLAGS old_LIBS \ old_NM old_RANLIB old_LN_S old_DLLTOOL old_OBJDUMP old_AS; do eval "$var=\\\"\$var\\\"" done # Just create a config file. cfgfile="$ofile.cfg" trap "$rm \"$cfgfile\"; exit 1" 1 2 15 echo "creating $cfgfile" $rm "$cfgfile" cat < "$cfgfile" # `$echo "$cfgfile" | sed 's%^.*/%%'` - Libtool configuration file. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) EOF ;; esac cat <> "$cfgfile" # Libtool was configured as follows, on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # # CC=$old_CC CFLAGS=$old_CFLAGS CPPFLAGS=$old_CPPFLAGS \\ # LD=$old_LD LDFLAGS=$old_LDFLAGS LIBS=$old_LIBS \\ # NM=$old_NM RANLIB=$old_RANLIB LN_S=$old_LN_S \\ # DLLTOOL=$old_DLLTOOL OBJDUMP=$old_OBJDUMP AS=$old_AS \\ # $0$ltconfig_args # # Compiler and other test output produced by $progname, useful for # debugging $progname, is in ./config.log if it exists. # The version of $progname that generated this script. LTCONFIG_VERSION=$LTCONFIG_VERSION # Shell to use when invoking shell scripts. SHELL=$LTSHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$ltecho # The archiver. AR=$AR # The default C compiler. CC=$CC # The linker used to build libraries. LD=$LD # Whether we need hard or soft links. LN_S=$LN_S # A BSD-compatible nm program. NM=$NM # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$reload_flag reload_cmds=$reload_cmds # How to pass a linker flag through the compiler. wl=$wl # Object file suffix (normally "o"). objext="$objext" # Old archive suffix (normally "a"). libext="$libext" # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$pic_flag # Does compiler simultaneously support -c and -o options? compiler_c_o=$compiler_c_o # Can we write directly to a .lo ? compiler_o_lo=$compiler_o_lo # Must we lock files when doing compilation ? need_locks=$need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$link_static_flag # Compiler flag to turn off builtin functions. no_builtin_flag=$no_builtin_flag # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$whole_archive_flag_spec # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$thread_safe_flag_spec # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$library_names_spec # The coded name of the library, if different from the real name. soname_spec=$soname_spec # Commands used to build and install an old-style archive. RANLIB=$RANLIB old_archive_cmds=$old_archive_cmds old_postinstall_cmds=$old_postinstall_cmds old_postuninstall_cmds=$old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$old_archive_from_new_cmds # Commands used to build and install a shared archive. archive_cmds=$archive_cmds archive_expsym_cmds=$archive_expsym_cmds postinstall_cmds=$postinstall_cmds postuninstall_cmds=$postuninstall_cmds # Method to check whether dependent libraries are shared objects. deplibs_check_method=$deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$allow_undefined_flag # Flag that forces no undefined symbols. no_undefined_flag=$no_undefined_flag # Commands used to finish a libtool library installation in a directory. finish_cmds=$finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$global_symbol_to_cdecl # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$hardcode_libdir_flag_spec # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$hardcode_libdir_separator # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Compile-time system search path for libraries sys_lib_search_path_spec=$sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$exclude_expsyms # Symbols that must always be exported. include_expsyms=$include_expsyms EOF case "$ltmain" in *.sh) echo '### END LIBTOOL CONFIG' >> "$ofile" echo >> "$ofile" case "$host_os" in aix3*) cat <<\EOF >> "$ofile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac # Append the ltmain.sh script. sed '$q' "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1) # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? chmod +x "$ofile" ;; *) # Compile the libtool program. echo "FIXME: would compile $ltmain" ;; esac test -n "$cache_file" || exit 0 # AC_CACHE_SAVE trap '' 1 2 15 cat > confcache <<\EOF # 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. It is not useful on other systems. # If it contains results you don't want to keep, you may remove or edit it. # # By default, configure uses ./config.cache as the cache file, # creating it if it does not exist already. You can give configure # the --cache-file=FILE option to use a different cache file; that is # what configure does when it calls configure scripts in # subdirectories, so they share the cache. # Giving --cache-file=/dev/null disables caching, for debugging configure. # config.status only pays attention to the cache file if you give it the # --recheck option to rerun configure. # EOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # 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. (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote substitution # turns \\\\ into \\, and sed turns \\ into \). sed -n \ -e "s/'/'\\\\''/g" \ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' ;; esac >> confcache if cmp -s $cache_file confcache; then : else if test -w $cache_file; then echo "updating cache $cache_file" cat confcache > $cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache exit 0 # Local Variables: # mode:shell-script # sh-indentation:2 # End: aplus-fsf-4.22/config/ltmain.sh0000644000265000001440000043116510774512517012126 # ltmain.sh - Provide generalized library-building support services. # NOTE: Changing this file will not affect anything until you rerun configure. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 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 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # 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. # Check that we have a working $echo. if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell, and then maybe $echo will work. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat <&2 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit 1 fi # Global variables. mode=$default_mode nonopt= prev= prevopt= run= show="$echo" show_help= execute_dlfiles= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" # Parse our command line options once, thoroughly. while test $# -gt 0 do arg="$1" shift case $arg in -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in execute_dlfiles) execute_dlfiles="$execute_dlfiles $arg" ;; *) eval "$prev=\$arg" ;; esac prev= prevopt= continue fi # Have we seen a non-optional argument yet? case $arg in --help) show_help=yes ;; --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" exit 0 ;; --config) ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0 exit 0 ;; --debug) echo "$progname: enabling shell trace mode" set -x ;; --dry-run | -n) run=: ;; --features) echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit 0 ;; --finish) mode="finish" ;; --mode) prevopt="--mode" prev=mode ;; --mode=*) mode="$optarg" ;; --preserve-dup-deps) duplicate_deps="yes" ;; --quiet | --silent) show=: ;; -dlopen) prevopt="-dlopen" prev=execute_dlfiles ;; -*) $echo "$modename: unrecognized option \`$arg'" 1>&2 $echo "$help" 1>&2 exit 1 ;; *) nonopt="$arg" break ;; esac done if test -n "$prevopt"; then $echo "$modename: option \`$prevopt' requires an argument" 1>&2 $echo "$help" 1>&2 exit 1 fi # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= if test -z "$show_help"; then # Infer the operation mode. if test -z "$mode"; then case $nonopt in *cc | *++ | gcc* | *-gcc* | xlc*) mode=link for arg do case $arg in -c) mode=compile break ;; esac done ;; *db | *dbx | *strace | *truss) mode=execute ;; *install*|cp|mv) mode=install ;; *rm) mode=uninstall ;; *) # If we have no mode, but dlfiles were specified, then do execute mode. test -n "$execute_dlfiles" && mode=execute # Just use the default operation mode. if test -z "$mode"; then if test -n "$nonopt"; then $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 else $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 fi fi ;; esac fi # Only execute mode is allowed to have -dlopen flags. if test -n "$execute_dlfiles" && test "$mode" != execute; then $echo "$modename: unrecognized option \`-dlopen'" 1>&2 $echo "$help" 1>&2 exit 1 fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$modename --help --mode=$mode' for more information." # These modes are in order of execution frequency so that they run quickly. case $mode in # libtool compile mode compile) modename="$modename: compile" # Get the compilation command and the source file. base_compile= prev= lastarg= srcfile="$nonopt" suppress_output= user_target=no for arg do case $prev in "") ;; xcompiler) # Aesthetically quote the previous argument. prev= lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac # Add the previous argument to base_compile. if test -z "$base_compile"; then base_compile="$lastarg" else base_compile="$base_compile $lastarg" fi continue ;; esac # Accept any command-line options. case $arg in -o) if test "$user_target" != "no"; then $echo "$modename: you cannot specify \`-o' more than once" 1>&2 exit 1 fi user_target=next ;; -static) build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; -Xcompiler) prev=xcompiler continue ;; -Wc,*) args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac lastarg="$lastarg $arg" done IFS="$save_ifs" lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` # Add the arguments to base_compile. if test -z "$base_compile"; then base_compile="$lastarg" else base_compile="$base_compile $lastarg" fi continue ;; esac case $user_target in next) # The next one is the -o target name user_target=yes continue ;; yes) # We got the output file user_target=set libobj="$arg" continue ;; esac # Accept the current argument as the source file. lastarg="$srcfile" srcfile="$arg" # Aesthetically quote the previous argument. # Backslashify any backslashes, double quotes, and dollar signs. # These are the only characters that are still specially # interpreted inside of double-quoted scrings. lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. case $lastarg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") lastarg="\"$lastarg\"" ;; esac # Add the previous argument to base_compile. if test -z "$base_compile"; then base_compile="$lastarg" else base_compile="$base_compile $lastarg" fi done case $user_target in set) ;; no) # Get the name of the library object. libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` ;; *) $echo "$modename: you must specify a target with \`-o'" 1>&2 exit 1 ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo xform='[cCFSfmso]' case $libobj in *.ada) xform=ada ;; *.adb) xform=adb ;; *.ads) xform=ads ;; *.asm) xform=asm ;; *.c++) xform=c++ ;; *.cc) xform=cc ;; *.cpp) xform=cpp ;; *.cxx) xform=cxx ;; *.f90) xform=f90 ;; *.for) xform=for ;; esac libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` case $libobj in *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; *) $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 exit 1 ;; esac if test -z "$base_compile"; then $echo "$modename: you must specify a compilation command" 1>&2 $echo "$help" 1>&2 exit 1 fi # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $libobj" else removelist="$libobj" fi $run $rm $removelist trap "$run $rm $removelist; exit 1" 1 2 15 # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" removelist="$removelist $output_obj $lockfile" trap "$run $rm $removelist; exit 1" 1 2 15 else need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $run ln "$0" "$lockfile" 2>/dev/null; do $show "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then echo "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit 1 fi echo $srcfile > "$lockfile" fi if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then # All platforms use -DPIC, to notify preprocessed assembler code. command="$base_compile $srcfile $pic_flag -DPIC" else # Don't build PIC code command="$base_compile $srcfile" fi if test "$build_old_libs" = yes; then lo_libobj="$libobj" dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$libobj"; then dir="$objdir" else dir="$dir/$objdir" fi libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` if test -d "$dir"; then $show "$rm $libobj" $run $rm $libobj else $show "$mkdir $dir" $run $mkdir $dir status=$? if test $status -ne 0 && test ! -d $dir; then exit $status fi fi fi if test "$compiler_o_lo" = yes; then output_obj="$libobj" command="$command -o $output_obj" elif test "$compiler_c_o" = yes; then output_obj="$obj" command="$command -o $output_obj" fi $run $rm "$output_obj" $show "$command" if $run eval "$command"; then : else test -n "$output_obj" && $run $rm $removelist exit 1 fi if test "$need_locks" = warn && test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit 1 fi # Just move the object if needed, then go on to compile the next one if test x"$output_obj" != x"$libobj"; then $show "$mv $output_obj $libobj" if $run $mv $output_obj $libobj; then : else error=$? $run $rm $removelist exit $error fi fi # If we have no pic_flag, then copy the object into place and finish. if (test -z "$pic_flag" || test "$pic_mode" != default) && test "$build_old_libs" = yes; then # Rename the .lo from within objdir to obj if test -f $obj; then $show $rm $obj $run $rm $obj fi $show "$mv $libobj $obj" if $run $mv $libobj $obj; then : else error=$? $run $rm $removelist exit $error fi xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$obj"; then xdir="." else xdir="$xdir" fi baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"` libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` # Now arrange that obj and lo_libobj become the same file $show "(cd $xdir && $LN_S $baseobj $libobj)" if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then # Unlock the critical section if it was locked if test "$need_locks" != no; then $run $rm "$lockfile" fi exit 0 else error=$? $run $rm $removelist exit $error fi fi # Allow error messages only from the first compilation. suppress_output=' >/dev/null 2>&1' fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $srcfile" else # All platforms use -DPIC, to notify preprocessed assembler code. command="$base_compile $srcfile $pic_flag -DPIC" fi if test "$compiler_c_o" = yes; then command="$command -o $obj" output_obj="$obj" fi # Suppress compiler output if we already did a PIC compilation. command="$command$suppress_output" $run $rm "$output_obj" $show "$command" if $run eval "$command"; then : else $run $rm $removelist exit 1 fi if test "$need_locks" = warn && test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit 1 fi # Just move the object if needed if test x"$output_obj" != x"$obj"; then $show "$mv $output_obj $obj" if $run $mv $output_obj $obj; then : else error=$? $run $rm $removelist exit $error fi fi # Create an invalid libtool object if no PIC, so that we do not # accidentally link it into a program. if test "$build_libtool_libs" != yes; then $show "echo timestamp > $libobj" $run eval "echo timestamp > \$libobj" || exit $? else # Move the .lo from within objdir $show "$mv $libobj $lo_libobj" if $run $mv $libobj $lo_libobj; then : else error=$? $run $rm $removelist exit $error fi fi fi # Unlock the critical section if it was locked if test "$need_locks" != no; then $run $rm "$lockfile" fi exit 0 ;; # libtool link mode link | relink) modename="$modename: link" case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invokation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args="$nonopt" compile_command="$nonopt" finalize_command="$nonopt" compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= avoid_version=no dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= # We need to know -static, to get the right output filenames. for arg do case $arg in -all-static | -static) if test "X$arg" = "X-all-static"; then if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2 fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi else if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi fi build_libtool_libs=no build_old_libs=yes prefer_static_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test $# -gt 0; do arg="$1" shift case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test ;; *) qarg=$arg ;; esac libtool_args="$libtool_args $qarg" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) compile_command="$compile_command @OUTPUT@" finalize_command="$finalize_command @OUTPUT@" ;; esac case $prev in dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. compile_command="$compile_command @SYMFILE@" finalize_command="$finalize_command @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" else dlprefiles="$dlprefiles $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" if test ! -f "$arg"; then $echo "$modename: symbol file \`$arg' does not exist" exit 1 fi prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit 1 ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) xrpath="$xrpath $arg" ;; esac fi prev= continue ;; xcompiler) compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; xlinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $wl$qarg" prev= compile_command="$compile_command $wl$qarg" finalize_command="$finalize_command $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n $prev prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then compile_command="$compile_command $link_static_flag" finalize_command="$finalize_command $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 continue ;; -avoid-version) avoid_version=yes continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: more than one -exported-symbols argument is not allowed" exit 1 fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | no/*-*-nonstopux*) compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" ;; esac continue ;; -L*) dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 exit 1 fi dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "*) ;; *) deplibs="$deplibs -L$dir" lib_search_path="$lib_search_path $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) case :$dllsearchpath: in *":$dir:"*) ;; *) dllsearchpath="$dllsearchpath:$dir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-pw32* | *-*-beos*) # These systems don't actually have a C or math library (as such) continue ;; *-*-mingw* | *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi deplibs="$deplibs $arg" continue ;; -module) module=yes continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) # The PATH hackery in wrapper scripts is required on Windows # in order for the loader to find any dlls it needs. $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -o) prev=output ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit 1 ;; esac case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac continue ;; -static) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -Wc,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Wl,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $wl$flag" linker_flags="$linker_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; # Some other compiler flag. -* | +*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; *.lo | *.$objext) # A library or standard object. if test "$prev" = dlfiles; then # This file was specified with -dlopen. if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $arg" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"` prev= else case $arg in *.lo) libobjs="$libobjs $arg" ;; *) objs="$objs $arg" ;; esac fi ;; *.$libext) # An archive. deplibs="$deplibs $arg" old_deplibs="$old_deplibs $arg" continue ;; *.la) # A libtool-controlled library. if test "$prev" = dlfiles; then # This library was specified with -dlopen. dlfiles="$dlfiles $arg" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. dlprefiles="$dlprefiles $arg" prev= else deplibs="$deplibs $arg" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi done # argument parsing loop if test -n "$prev"; then $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 $echo "$help" 1>&2 exit 1 fi if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi # calculate the name of the file, without its directory outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` if test "X$output_objdir" = "X$output"; then output_objdir="$objdir" else output_objdir="$output_objdir/$objdir" fi # Create the object directory. if test ! -d $output_objdir; then $show "$mkdir $output_objdir" $run $mkdir $output_objdir status=$? if test $status -ne 0 && test ! -d $output_objdir; then exit $status fi fi # Determine the type of output case $output in "") $echo "$modename: you must specify an output file" 1>&2 $echo "$help" 1>&2 exit 1 ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if test "X$duplicate_deps" = "Xyes" ; then case "$libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi libs="$libs $deplib" done deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 exit 1 ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do if test $linkmode = prog; then # Determine which files to process case $pass in dlopen) libs="$dlfiles" save_deplibs="$deplibs" # Collect dlpreopened libraries deplibs= ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi for deplib in $libs; do lib= found=no case $deplib in -l*) if test $linkmode = oldlib && test $linkmode = obj; then $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2 continue fi if test $pass = conv; then deplibs="$deplib $deplibs" continue fi name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do # Search the libtool library lib="$searchdir/lib${name}.la" if test -f "$lib"; then found=yes break fi done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi ;; # -l -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test $pass = conv && continue newdependency_libs="$deplib $newdependency_libs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; prog) if test $pass = conv; then deplibs="$deplib $deplibs" continue fi if test $pass = scan; then deplibs="$deplib $deplibs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi ;; *) $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2 ;; esac # linkmode continue ;; # -L -R*) if test $pass = link; then dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) lib="$deplib" ;; *.$libext) if test $pass = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) if test "$deplibs_check_method" != pass_all; then echo echo "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not used here." else echo echo "*** Warning: Linking the shared library $output against the" echo "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi continue ;; prog) if test $pass != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. newdlprefiles="$newdlprefiles $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else newdlfiles="$newdlfiles $deplib" fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test $found = yes || test -f "$lib"; then : else $echo "$modename: cannot find the library \`$lib'" 1>&2 exit 1 fi # Check to see that this really is a libtool archive. if (${SED} -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit 1 fi ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." dlname= dlopen= dlpreopen= libdir= library_names= old_library= # If the library was installed with an old release of libtool, # it will not redefine variable installed. installed=yes # Read the .la file case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test $linkmode = oldlib && test $linkmode = obj; }; then # Add dl[pre]opened files of deplib test -n "$dlopen" && dlfiles="$dlfiles $dlopen" test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi if test $pass = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit 1 fi # It is a libtool convenience library, so add in its objects. convenience="$convenience $ladir/$objdir/$old_library" old_convenience="$old_convenience $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done elif test $linkmode != prog && test $linkmode != lib; then $echo "$modename: \`$lib' is not a convenience library" 1>&2 exit 1 fi continue fi # $pass = conv # Get the name of the library we link against. linklib= for l in $old_library $library_names; do linklib="$l" done if test -z "$linklib"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit 1 fi # This library was specified with -dlopen. if test $pass = dlopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 exit 1 fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. dlprefiles="$dlprefiles $lib" else newdlfiles="$newdlfiles $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 abs_ladir="$ladir" fi ;; esac laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then $echo "$modename: warning: library \`$lib' was moved." 1>&2 dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$libdir" absdir="$libdir" fi else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" fi # $installed = yes name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` # This library was specified with -dlpreopen. if test $pass = dlpreopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 exit 1 fi # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then newdlprefiles="$newdlprefiles $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then newdlprefiles="$newdlprefiles $dir/$dlname" else newdlprefiles="$newdlprefiles $dir/$linklib" fi fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test $linkmode = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" fi continue fi if test $linkmode = prog && test $pass != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test esac # Need to link against all dependency_libs? if test $linkalldeplibs = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done # for deplib continue fi # $linkmode = prog... link_static=no # Whether the deplib will be linked statically if test -n "$library_names" && { test "$prefer_static_libs" = no || test -z "$old_library"; }; then # Link against this shared library if test "$linkmode,$pass" = "prog,link" || { test $linkmode = lib && test $hardcode_into_libs = yes; }; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac if test $linkmode = prog; then # We need to hardcode the library path if test -n "$shlibpath_var"; then # Make sure the rpath contains only unique directories. case "$temp_rpath " in *" $dir "*) ;; *" $absdir "*) ;; *) temp_rpath="$temp_rpath $dir" ;; esac fi fi fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi if test "$installed" = no; then notinst_deplibs="$notinst_deplibs $lib" need_relink=yes fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names realname="$2" shift; shift libname=`eval \\$echo \"$libname_spec\"` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin*) major=`expr $current - $age` versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" soname=`echo $soroot | ${SED} -e 's/^.*\///'` newlib="libimp-`echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else $show "extracting exported symbol list from \`$soname'" save_ifs="$IFS"; IFS='~' eval cmds=\"$extract_expsyms_cmds\" for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else $show "generating import library for \`$soname'" save_ifs="$IFS"; IFS='~' eval cmds=\"$old_archive_from_expsyms_cmds\" for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n $old_archive_from_expsyms_cmds if test $linkmode = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then $echo "$modename: configuration error: unsupported hardcode properties" exit 1 fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi if test $linkmode = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && \ test "$hardcode_minus_L" != yes && \ test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac fi fi fi if test $linkmode = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then # Try looking first in the location we're being installed to. add_dir= if test -n "$inst_prefix_dir"; then case "$libdir" in [\\/]*) add_dir="-L$inst_prefix_dir$libdir" ;; esac fi add_dir="-L$libdir $add_dir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac add="-l$name" else # We cannot seem to hardcode it, guess we'll fake it. # Try looking first in the location we're being installed to. add_dir= if test -n "$inst_prefix_dir"; then case "$libdir" in [\\/]*) add_dir="-L$inst_prefix_dir$libdir" ;; esac fi add_dir="-L$libdir $add_dir " add="-l$name" fi if test $linkmode = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test $linkmode = prog; then if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi # Try to link the static library # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo echo "*** Warning: This system can not link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else convenience="$convenience $dir/$old_library" old_convenience="$old_convenience $dir/$old_library" deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test $linkmode = lib; then if test -n "$dependency_libs" && { test $hardcode_into_libs != yes || test $build_old_libs = yes || test $link_static = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` case " $xrpath " in *" $temp_xrpath "*) ;; *) xrpath="$xrpath $temp_xrpath";; esac;; *) temp_deplibs="$temp_deplibs $libdir";; esac done dependency_libs="$temp_deplibs" fi newlib_search_path="$newlib_search_path $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done if test $link_all_deplibs != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do case $deplib in -L*) path="$deplib" ;; *.la) dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$deplib" && dir="." # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 absdir="$dir" fi ;; esac if grep "^installed=no" $deplib > /dev/null; then path="-L$absdir/$objdir" else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit 1 fi if test "$absdir" != "$libdir"; then $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 fi path="-L$absdir" fi ;; *) continue ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$deplibs $path" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test $pass = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test $pass != dlopen; then test $pass != scan && dependency_libs="$newdependency_libs" if test $pass != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) lib_search_path="$lib_search_path $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do case $deplib in -L*) new_libs="$deplib $new_libs" ;; *) case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) tmp_libs="$tmp_libs $deplib" ;; esac ;; *) tmp_libs="$tmp_libs $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi if test "$pass" = "conv" && { test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then libs="$deplibs" # reset libs deplibs= fi done # for pass if test $linkmode = prog; then dlfiles="$newdlfiles" dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 fi if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 fi # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" objs="$objs$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` eval libname=\"$libname_spec\" ;; *) if test "$module" = no; then $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 $echo "$help" 1>&2 exit 1 fi if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` eval libname=\"$libname_spec\" else libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 exit 1 else echo echo "*** Warning: Linking the shared library $output against the non-libtool" echo "*** objects $objs is not portable!" libobjs="$libobjs $objs" fi fi if test "$dlself" != no; then $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 fi set dummy $rpath if test $# -gt 2; then $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 fi install_libdir="$2" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. libext=al oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 fi else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 IFS="$save_ifs" if test -n "$8"; then $echo "$modename: too many parameters to \`-version-info'" 1>&2 $echo "$help" 1>&2 exit 1 fi current="$2" revision="$3" age="$4" # Check that each of the things are valid numbers. case $current in [0-9]*) ;; *) $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 ;; esac case $revision in [0-9]*) ;; *) $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 ;; esac case $age in [0-9]*) ;; *) $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 ;; esac if test $age -gt $current; then $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header major=.`expr $current - $age` versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... minor_current=`expr $current + 1` verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current"; ;; irix | nonstopux) major=`expr $current - $age + 1` case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test $loop != 0; do iface=`expr $revision - $loop` loop=`expr $loop - 1` verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) major=.`expr $current - $age` versuffix="$major.$age.$revision" ;; osf) major=.`expr $current - $age` versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test $loop != 0; do iface=`expr $current - $loop` loop=`expr $loop - 1` verstring="$verstring:${iface}.0" done # Make executables depend on our current version. verstring="$verstring:${current}.0" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. major=`expr $current - $age` versuffix="-$major" ;; *) $echo "$modename: unknown library version type \`$version_type'" 1>&2 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit 1 ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= verstring="0.0" case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring="" ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi if test "$mode" != relink; then # Remove our outputs. $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*" $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.* fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` fi # Eliminate all temporary directories. for path in $notinst_path; do lib_search_path=`echo "$lib_search_path " | ${SED} -e 's% $path % %g'` deplibs=`echo "$deplibs " | ${SED} -e 's% -L$path % %g'` dependency_libs=`echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'` done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done if test $hardcode_into_libs != yes || test $build_old_libs = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) dlfiles="$dlfiles $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) dlprefiles="$dlprefiles $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework deplibs="$deplibs -framework System" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd*) # Do not include libc due to us having libc/libc_r. ;; *) # Add libc to deplibs on all other systems if necessary. if test $build_libtool_need_lc = "yes"; then deplibs="$deplibs -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behaviour. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $rm conftest.c cat > conftest.c </dev/null` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null \ | grep " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ | ${SED} 10q \ | egrep "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done if test -n "$a_deplib" ; then droppeddeps=yes echo echo "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then echo "*** with $libname but no candidates were found. (...for file magic test)" else echo "*** with $libname and none of the candidates passed a file format test" echo "*** using a file magic. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` for a_deplib in $deplibs; do name="`expr $a_deplib : '-l\(.*\)'`" # If $name is empty we are operating on a -L argument. if test -n "$name" && test "$name" != "0"; then libname=`eval \\$echo \"$libname_spec\"` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check below in file_magic test if eval echo \"$potent_lib\" 2>/dev/null \ | ${SED} 10q \ | egrep "$match_pattern_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done if test -n "$a_deplib" ; then droppeddeps=yes echo echo "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then echo "*** with $libname but no candidates were found. (...for regex pattern test)" else echo "*** with $libname and none of the candidates passed a file format test" echo "*** using a regex pattern. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' | grep . >/dev/null; then echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes fi ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" echo "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test $allow_undefined = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then if test $hardcode_into_libs = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" dep_rpath="$dep_rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval library_names=\"$library_names_spec\" set dummy $library_names realname="$2" shift; shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi test -z "$dlname" && dlname=$soname lib="$output_objdir/$realname" for link do linknames="$linknames $link" done # Ensure that we have .o objects for linkers which dislike .lo # (e.g. aix) in case we are running --disable-static for obj in $libobjs; do xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$obj"; then xdir="." else xdir="$xdir" fi baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` if test ! -f $xdir/$oldobj; then $show "(cd $xdir && ${LN_S} $baseobj $oldobj)" $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $? fi done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols eval cmds=\"$export_symbols_cmds\" save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" if test -n "$export_symbols_regex"; then $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' $show "$mv \"${export_symbols}T\" \"$export_symbols\"" $run eval '$mv "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' fi if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" else gentop="$output_objdir/${outputname}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "mkdir $gentop" $run mkdir "$gentop" status=$? if test $status -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" for xlib in $convenience; do # Extract the objects. case $xlib in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "mkdir $xdir" $run mkdir "$xdir" status=$? if test $status -ne 0 && test ! -d "$xdir"; then exit $status fi $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` done fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" linker_flags="$linker_flags $flag" fi # Make a backup of the uninstalled library when relinking if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval cmds=\"$archive_expsym_cmds\" else save_deplibs="$deplibs" for conv in $convenience; do tmp_deplibs= for test_deplib in $deplibs; do if test "$test_deplib" != "$conv"; then tmp_deplibs="$tmp_deplibs $test_deplib" fi done deplibs="$tmp_deplibs" done eval cmds=\"$archive_cmds\" deplibs="$save_deplibs" fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? exit 0 fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 fi case $output in *.lo) if test -n "$objs$old_deplibs"; then $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 exit 1 fi libobj="$output" obj=`$echo "X$output" | $Xsed -e "$lo2o"` ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $run $rm $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" else gentop="$output_objdir/${obj}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "mkdir $gentop" $run mkdir "$gentop" status=$? if test $status -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" for xlib in $convenience; do # Extract the objects. case $xlib in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "mkdir $xdir" $run mkdir "$xdir" status=$? if test $status -ne 0 && test ! -d "$xdir"; then exit $status fi $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` done fi fi # Create the old-style object. reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" eval cmds=\"$reload_cmds\" save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit 0 fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. $show "echo timestamp > $libobj" $run eval "echo timestamp > $libobj" || exit $? exit 0 fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" eval cmds=\"$reload_cmds\" save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" else # Just create a symlink. $show $rm $libobj $run $rm $libobj xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$libobj"; then xdir="." else xdir="$xdir" fi baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` $show "(cd $xdir && $LN_S $oldobj $baseobj)" $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $? fi if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit 0 ;; prog) case $host in *cygwin*) output=`echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; esac if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 fi if test "$preload" = yes; then if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && test "$dlopen_self_static" = unknown; then $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." fi fi case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` case $host in *darwin*) # Don't allow lazy linking, it breaks C++ global constructors compile_command="$compile_command ${wl}-bind_at_load" finalize_command="$finalize_command ${wl}-bind_at_load" ;; esac ;; esac compile_command="$compile_command $compile_deplibs" finalize_command="$finalize_command $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) case :$dllsearchpath: in *":$libdir:"*) ;; *) dllsearchpath="$dllsearchpath:$libdir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` fi dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then dlsyms="${outputname}S.c" else $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 fi fi if test -n "$dlsyms"; then case $dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${outputname}.nm" $show "$rm $nlist ${nlist}S ${nlist}T" $run $rm "$nlist" "${nlist}S" "${nlist}T" # Parse the name list into a source file. $show "creating $output_objdir/$dlsyms" test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ #ifdef __cplusplus extern \"C\" { #endif /* Prevent the only kind of declaration conflicts we can make. */ #define lt_preloaded_symbols some_other_symbol /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then $show "generating symbol list for \`$output'" test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` for arg in $progfiles; do $show "extracting global C symbols from \`$arg'" $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi if test -n "$export_symbols_regex"; then $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$output.exp" $run $rm $export_symbols $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' else $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' $run eval 'mv "$nlist"T "$nlist"' fi fi for arg in $dlprefiles; do $show "extracting global C symbols from \`$arg'" name=`echo "$arg" | ${SED} -e 's%^.*/%%'` $run eval 'echo ": $name " >> "$nlist"' $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -z "$run"; then # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $mv "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if grep -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else grep -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' else echo '/* NONE */' >> "$output_objdir/$dlsyms" fi $echo >> "$output_objdir/$dlsyms" "\ #undef lt_preloaded_symbols #if defined (__STDC__) && __STDC__ # define lt_ptr void * #else # define lt_ptr char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr address; } lt_preloaded_symbols[] = {\ " eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" $echo >> "$output_objdir/$dlsyms" "\ {0, (lt_ptr) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " fi pic_flag_for_symtable= case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";; esac;; *-*-hpux*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag -DPIC";; esac esac # Now compile the dynamic symbol file. $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? # Clean up the generated files. $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" # Transform the symbol file into the correct name. compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` ;; *) $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 exit 1 ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` fi if test $need_relink = no || test "$build_libtool_libs" != yes; then # Replace the output file specification. compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. $show "$link_command" $run eval "$link_command" status=$? # Delete the generated files. if test -n "$dlsyms"; then $show "$rm $output_objdir/${outputname}S.${objext}" $run $rm "$output_objdir/${outputname}S.${objext}" fi exit $status fi if test -n "$shlibpath_var"; then # We should set the shlibpath_var rpath= for dir in $temp_rpath; do case $dir in [\\/]* | [A-Za-z]:[\\/]*) # Absolute path. rpath="$rpath$dir:" ;; *) # Relative path: add a thisdir entry. rpath="$rpath\$thisdir/$dir:" ;; esac done temp_rpath="$rpath" fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do rpath="$rpath$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $run $rm $output # Link the executable and exit $show "$link_command" $run eval "$link_command" || exit $? exit 0 fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 $echo "$modename: \`$output' will be relinked during installation" 1>&2 else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname $show "$link_command" $run eval "$link_command" || exit $? # Now create the wrapper script. $show "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` fi # Quote $echo for shipping. if test "X$echo" = "X$SHELL $0 --fallback-echo"; then case $0 in [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";; *) qecho="$SHELL `pwd`/$0 --fallback-echo";; esac qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` else qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` fi # Only actually do things if our run command is non-null. if test -z "$run"; then # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) output=`echo $output|${SED} 's,.exe$,,'` ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe ;; *) exeext= ;; esac $rm $output trap "$rm $output; exit 1" 1 2 15 $echo > $output "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variable: notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$echo are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then echo=\"$qecho\" file=\"\$0\" # Make sure echo works. if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then # Yippee, \$echo works! : else # Restart under the correct shell, and then maybe \$echo will work. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} fi fi\ " $echo >> $output "\ # Find the directory that this script lives in. thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` done # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then echo >> $output "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || \\ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $mkdir \"\$progdir\" else $rm \"\$progdir/\$file\" fi" echo >> $output "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $echo \"\$relink_command_output\" >&2 $rm \"\$progdir/\$file\" exit 1 fi fi $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $rm \"\$progdir/\$program\"; $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } $rm \"\$progdir/\$file\" fi" else echo >> $output "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi echo >> $output "\ if test -f \"\$progdir/\$program\"; then" # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $echo >> $output "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 ${SED} $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var " fi # fixup the dll searchpath if we need to. if test -n "$dllsearchpath"; then $echo >> $output "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi $echo >> $output "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. " case $host in # win32 systems need to use the prog path for dll # lookup to work *-*-cygwin* | *-*-pw32*) $echo >> $output "\ exec \$progdir/\$program \${1+\"\$@\"} " ;; # Backslashes separate directories on plain windows *-*-mingw | *-*-os2*) $echo >> $output "\ exec \$progdir\\\\\$program \${1+\"\$@\"} " ;; *) $echo >> $output "\ # Export the path to the program. PATH=\"\$progdir:\$PATH\" export PATH exec \$program \${1+\"\$@\"} " ;; esac $echo >> $output "\ \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" exit 1 fi else # The program doesn't exist. \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 \$echo \"This script is just a wrapper for \$program.\" 1>&2 echo \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " chmod +x $output fi exit 0 ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP` fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "mkdir $gentop" $run mkdir "$gentop" status=$? if test $status -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" # Add in members from convenience archives. for xlib in $addlibs; do # Extract the objects. case $xlib in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "mkdir $xdir" $run mkdir "$xdir" status=$? if test $status -ne 0 && test ! -d "$xdir"; then exit $status fi $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP` done fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then eval cmds=\"$old_archive_from_new_cmds\" else # Ensure that we have .o objects in place in case we decided # not to build a shared library, and have fallen back to building # static libs even though --disable-static was passed! for oldobj in $oldobjs; do if test ! -f $oldobj; then xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$oldobj"; then xdir="." else xdir="$xdir" fi baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'` obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` $show "(cd $xdir && ${LN_S} $obj $baseobj)" $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $? fi done eval cmds=\"$old_archive_cmds\" fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$generated"; then $show "${rm}r$generated" $run ${rm}r$generated fi # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" $show "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` # Only create the output if not a dry run. if test -z "$run"; then for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit 1 fi newdependency_libs="$newdependency_libs $libdir/$name" ;; *) newdependency_libs="$newdependency_libs $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit 1 fi newdlfiles="$newdlfiles $libdir/$name" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit 1 fi newdlprefiles="$newdlprefiles $libdir/$name" done dlprefiles="$newdlprefiles" fi $rm $output # place dlname in correct position for cygwin tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac $echo > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test $need_relink = yes; then $echo >> $output "\ relink_command=\"$relink_command\"" fi done fi # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? ;; esac exit 0 ;; # libtool install mode install) modename="$modename: install" # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then # Aesthetically quote it. arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$arg " arg="$1" shift else install_prog= arg="$nonopt" fi # The real first argument should be the name of the installation program. # Aesthetically quote it. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$install_prog$arg" # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= for arg do if test -n "$dest"; then files="$files $dest" dest="$arg" continue fi case $arg in -d) isdir=yes ;; -f) prev="-f" ;; -g) prev="-g" ;; -m) prev="-m" ;; -o) prev="-o" ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else dest="$arg" continue fi ;; esac # Aesthetically quote the argument. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$install_prog $arg" done if test -z "$install_prog"; then $echo "$modename: you must specify an install program" 1>&2 $echo "$help" 1>&2 exit 1 fi if test -n "$prev"; then $echo "$modename: the \`$prev' option requires an argument" 1>&2 $echo "$help" 1>&2 exit 1 fi if test -z "$files"; then if test -z "$dest"; then $echo "$modename: no file or destination specified" 1>&2 else $echo "$modename: you must specify a destination" 1>&2 fi $echo "$help" 1>&2 exit 1 fi # Strip any trailing slash from the destination. dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` test "X$destdir" = "X$dest" && destdir=. destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` # Not a directory, so check to see that there is only one file specified. set dummy $files if test $# -gt 2; then $echo "$modename: \`$dest' is not a directory" 1>&2 $echo "$help" 1>&2 exit 1 fi fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 $echo "$help" 1>&2 exit 1 ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. staticlibs="$staticlibs $file" ;; *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit 1 fi library_names= old_library= relink_command= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) future_libdirs="$future_libdirs $libdir" ;; esac fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ test "X$dir" = "X$file/" && dir= dir="$dir$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$echo "$destdir" | sed "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. if test "$inst_prefix_dir" = "$destdir"; then $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 exit 1 fi if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%%"` fi $echo "$modename: warning: relinking \`$file'" 1>&2 $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 exit 1 fi fi # See the names of the shared library. set dummy $library_names if test -n "$2"; then realname="$2" shift shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. $show "$install_prog $dir/$srcname $destdir/$realname" $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? if test -n "$stripme" && test -n "$striplib"; then $show "$striplib $destdir/$realname" $run eval "$striplib $destdir/$realname" || exit $? fi if test $# -gt 0; then # Delete the old symlinks, and create new ones. for linkname do if test "$linkname" != "$realname"; then $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" fi done fi # Do each command in the postinstall commands. lib="$destdir/$realname" eval cmds=\"$postinstall_cmds\" save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Install the pseudo-library for information purposes. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` instname="$dir/$name"i $show "$install_prog $instname $destdir/$name" $run eval "$install_prog $instname $destdir/$name" || exit $? # Maybe install the static library, too. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` ;; *.$objext) staticdest="$destfile" destfile= ;; *) $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 $echo "$help" 1>&2 exit 1 ;; esac # Install the libtool object if requested. if test -n "$destfile"; then $show "$install_prog $file $destfile" $run eval "$install_prog $file $destfile" || exit $? fi # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` $show "$install_prog $staticobj $staticdest" $run eval "$install_prog \$staticobj \$staticdest" || exit $? fi exit 0 ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # Do a test to see if this is really a libtool program. case $host in *cygwin*|*mingw*) wrapper=`echo $file | ${SED} -e 's,.exe$,,'` ;; *) wrapper=$file ;; esac if (${SED} -e '4q' $wrapper | egrep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then notinst_deplibs= relink_command= # If there is no directory component, then add one. case $file in */* | *\\*) . $wrapper ;; *) . ./$wrapper ;; esac # Check the variables that should have been set. if test -z "$notinst_deplibs"; then $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 exit 1 fi finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then # If there is no directory component, then add one. case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac fi libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 finalize=no fi done relink_command= # If there is no directory component, then add one. case $file in */* | *\\*) . $wrapper ;; *) . ./$wrapper ;; esac outputname= if test "$fast_install" = no && test -n "$relink_command"; then if test "$finalize" = yes && test -z "$run"; then tmpdir="/tmp" test -n "$TMPDIR" && tmpdir="$TMPDIR" tmpdir_mktemp=`mktemp -d $tmpdir/libtool-XXXXXX 2> /dev/null` if test $? = 0 ; then tmpdir="$tmpdir_mktemp" unset tmpdir_mktemp else tmpdir="$tmpdir/libtool-$$" fi if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then : else $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 continue fi file=`$echo "X$file" | $Xsed -e 's%^.*/%%'` outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 ${rm}r "$tmpdir" continue fi file="$outputname" else $echo "$modename: warning: cannot relink \`$file'" 1>&2 fi else # Install the binary that we compiled earlier. file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyways case $install_prog,$host in /usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) destfile=`echo $destfile | ${SED} -e 's,.exe$,,'` ;; esac ;; esac $show "$install_prog$stripme $file $destfile" $run eval "$install_prog\$stripme \$file \$destfile" || exit $? test -n "$outputname" && ${rm}r "$tmpdir" ;; esac done for file in $staticlibs; do name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` # Set up the ranlib parameters. oldlib="$destdir/$name" $show "$install_prog $file $oldlib" $run eval "$install_prog \$file \$oldlib" || exit $? if test -n "$stripme" && test -n "$striplib"; then $show "$old_striplib $oldlib" $run eval "$old_striplib $oldlib" || exit $? fi # Do each command in the postinstall commands. eval cmds=\"$old_postinstall_cmds\" save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$future_libdirs"; then $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 fi if test -n "$current_libdirs"; then # Maybe just do a dry run. test -n "$run" && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $0 --finish$current_libdirs' else exit 0 fi ;; # libtool finish mode finish) modename="$modename: finish" libdirs="$nonopt" admincmds= if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for dir do libdirs="$libdirs $dir" done for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. eval cmds=\"$finish_cmds\" save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || admincmds="$admincmds $cmd" done IFS="$save_ifs" fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $run eval "$cmds" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. test "$show" = ":" && exit 0 echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do echo " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" echo " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then echo " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" echo "more information, such as the ld(1) and ld.so(8) manual pages." echo "----------------------------------------------------------------------" exit 0 ;; # libtool execute mode execute) modename="$modename: execute" # The first argument is the command name. cmd="$nonopt" if test -z "$cmd"; then $echo "$modename: you must specify a COMMAND" 1>&2 $echo "$help" exit 1 fi # Handle -dlopen flags immediately. for file in $execute_dlfiles; do if test ! -f "$file"; then $echo "$modename: \`$file' is not a file" 1>&2 $echo "$help" 1>&2 exit 1 fi dir= case $file in *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit 1 fi # Read the libtool library. dlname= library_names= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" continue fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 exit 1 fi ;; *.lo) # Just add the directory containing the .lo file. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. ;; *) $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -*) ;; *) # Do a test to see if this is really a libtool program. if (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` args="$args \"$file\"" done if test -z "$run"; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved enviroment variables if test "${save_LC_ALL+set}" = set; then LC_ALL="$save_LC_ALL"; export LC_ALL fi if test "${save_LANG+set}" = set; then LANG="$save_LANG"; export LANG fi # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" $echo "export $shlibpath_var" fi $echo "$cmd$args" exit 0 fi ;; # libtool clean and uninstall mode clean | uninstall) modename="$modename: $mode" rm="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) rm="$rm $arg"; rmforce=yes ;; -*) rm="$rm $arg" ;; *) files="$files $arg" ;; esac done if test -z "$rm"; then $echo "$modename: you must specify an RM program" 1>&2 $echo "$help" 1>&2 exit 1 fi rmdirs= for file in $files; do dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$file"; then dir=. objdir="$objdir" else objdir="$dir/$objdir" fi name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` test $mode = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates if test $mode = clean; then case " $rmdirs " in *" $objdir "*) ;; *) rmdirs="$rmdirs $objdir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if (test -L "$file") >/dev/null 2>&1 \ || (test -h "$file") >/dev/null 2>&1 \ || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then . $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" if test $mode = uninstall; then if test -n "$library_names"; then # Do each command in the postuninstall commands. eval cmds=\"$postuninstall_cmds\" save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" if test $? != 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. eval cmds=\"$old_postuninstall_cmds\" save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" if test $? != 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi # FIXME: should reinstall the best remaining shared library. fi fi ;; *.lo) if test "$build_old_libs" = yes; then oldobj=`$echo "X$name" | $Xsed -e "$lo2o"` rmfiles="$rmfiles $dir/$oldobj" fi ;; *) # Do a test to see if this is a libtool program. if test $mode = clean && (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then relink_command= . $dir/$file rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then rmfiles="$rmfiles $objdir/lt-$name" fi fi ;; esac $show "$rm $rmfiles" $run $rm $rmfiles || exit_status=1 done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then $show "rmdir $dir" $run rmdir $dir >/dev/null 2>&1 fi done exit $exit_status ;; "") $echo "$modename: you must specify a MODE" 1>&2 $echo "$generic_help" 1>&2 exit 1 ;; esac if test -z "$exec_cmd"; then $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$generic_help" 1>&2 exit 1 fi fi # test -z "$show_help" if test -n "$exec_cmd"; then eval exec $exec_cmd exit 1 fi # We need to display help for each of the modes. case $mode in "") $echo \ "Usage: $modename [OPTION]... [MODE-ARG]... Provide generalized library-building support services. --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --finish same as \`--mode=finish' --help display this help message and exit --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] --quiet same as \`--silent' --silent don't print informational messages --version print version information MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for a more detailed description of MODE." exit 0 ;; clean) $echo \ "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $echo \ "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -prefer-pic try to building PIC objects only -prefer-non-pic try to building non-PIC objects only -static always build a \`.o' file suitable for static linking COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $echo \ "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $echo \ "Usage: $modename [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $echo \ "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $echo \ "Usage: $modename [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -static do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $echo \ "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$help" 1>&2 exit 1 ;; esac echo $echo "Try \`$modename --help' for more information about other modes." exit 0 # Local Variables: # mode:shell-script # sh-indentation:2 # End: aplus-fsf-4.22/config/missing0000755000265000001440000001421307227706513011674 #! /bin/sh # Common stub for a few missing GNU programs while installing. # Copyright (C) 1996, 1997 Free Software Foundation, Inc. # Franc,ois 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, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi case "$1" in -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 Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' 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 lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file yacc create \`y.tab.[ch]', if possible, from existing .[ch]" ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing - GNU libit 0.0" ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; aclocal) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acinclude.m4' or \`configure.in'. 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 missing on your system. You should only need it if you modified \`configure.in'. 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 missing on your system. You should only need it if you modified \`acconfig.h' or \`configure.in'. 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.in` 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 missing on your system. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'. 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 ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' is missing on your system. 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 [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is missing on your system. 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 [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is missing on your system. 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." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi touch $file ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and you do not seem to have it handy on your system. 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 prerequirements 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 aplus-fsf-4.22/config/mkinstalldirs0000644000265000001440000000132207227706513013075 #! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain # $Id: mkinstalldirs,v 1.13 1999/01/05 03:18:55 bje Exp $ errstatus=0 for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr fi fi pathcomp="$pathcomp/" done done exit $errstatus # mkinstalldirs ends here aplus-fsf-4.22/src/0000777000265000001440000000000010774512703007677 5aplus-fsf-4.22/src/Makefile.am0000644000265000001440000000151510774510114011643 ## Process this file with automake to produce Makefile.in ############################################################################### ## ## ## Copyright (c) 2001 Morgan Stanley Dean Witter and Co. All rights reserved.## ## See .../src/LICENSE for terms of distribution. ## ## ## ## ## ############################################################################### SUBDIRS = \ IPC \ cxs \ cxb \ AplusGUI \ cxsys \ cxc \ esf \ a \ dap \ MSGUI \ MSIPC \ MSTypes \ main \ html \ contrib \ scripts \ lisp.1 \ lisp.0 \ fonts \ tutorials \ app-defaults EXTRA_DIST = LICENSE aplus-fsf-4.22/src/Makefile.in0000644000265000001440000002423410774512521011663 # Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ ############################################################################### ############################################################################### SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CXX = @CXX@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ STRIP = @STRIP@ VERSION = @VERSION@ X_INCLUDES = @X_INCLUDES@ X_LIBS = @X_LIBS@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ SUBDIRS = \ IPC \ cxs \ cxb \ AplusGUI \ cxsys \ cxc \ esf \ a \ dap \ MSGUI \ MSIPC \ MSTypes \ main \ html \ contrib \ scripts \ lisp.1 \ lisp.0 \ fonts \ tutorials \ app-defaults EXTRA_DIST = LICENSE subdir = src mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_CLEAN_FILES = DIST_SOURCES = RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ uninstall-info-recursive all-recursive install-data-recursive \ install-exec-recursive installdirs-recursive install-recursive \ uninstall-recursive check-recursive installcheck-recursive DIST_COMMON = Makefile.am Makefile.in DIST_SUBDIRS = $(SUBDIRS) all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ETAGS = etags ETAGSFLAGS = tags: TAGS 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; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ fi; \ done; \ 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; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = .. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d $(distdir)/$$subdir \ || mkdir $(distdir)/$$subdir \ || exit 1; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" \ distdir=../$(distdir)/$$subdir \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_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-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: info: info-recursive info-am: install-data-am: install-exec-am: install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool uninstall-am: uninstall-info-am uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \ clean-generic clean-libtool clean-recursive distclean \ distclean-generic distclean-libtool distclean-recursive \ distclean-tags distdir dvi dvi-am dvi-recursive info info-am \ info-recursive install install-am install-data install-data-am \ install-data-recursive install-exec install-exec-am \ install-exec-recursive install-info install-info-am \ install-info-recursive install-man install-recursive \ install-strip installcheck installcheck-am installdirs \ installdirs-am installdirs-recursive maintainer-clean \ maintainer-clean-generic maintainer-clean-recursive mostlyclean \ mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \ tags tags-recursive uninstall uninstall-am uninstall-info-am \ uninstall-info-recursive uninstall-recursive # 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: aplus-fsf-4.22/src/LICENSE0000444000265000001440000004312007225515436010621 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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 Library 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 Appendix: 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) 19yy 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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) 19yy 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 Library General Public License instead of this License. aplus-fsf-4.22/src/IPC/0000777000265000001440000000000010774512564010317 5aplus-fsf-4.22/src/IPC/Makefile.am0000444000265000001440000000304507232122711012251 ## Process this file with automake to produce Makefile.in ############################################################################### ## ## ## Copyright (c) 2001 Morgan Stanley Dean Witter & Co. All rights reserved. ## ## See .../src/LICENSE for terms of distribution. ## ## ## ## ## ############################################################################### lib_LTLIBRARIES = libIPC.la libIPC_la_SOURCES = \ AipcAttributes.C \ AipcConnection.C \ AipcHostPortProtocol.C \ AipcListener.C \ AipcService.C \ BufferUtilities.C \ IPCInterface.C \ IPCUtilities.C \ TimrConnection.C \ pA_Attributes.C \ pA_Connection.C \ pA_Listener.C \ pIpc_Connection.C \ pIpc_Listener.C \ pRaw_Connection.C \ pRaw_Listener.C \ pString_Connection.C \ pString_Listener.C \ pSimple_Connection.C \ pSimple_Listener.C \ AipcAttributes.H\ AipcConnection.H\ AipcHostPortProtocol.H\ AipcListener.H\ AipcService.H\ BufferUtilities.H\ IPCUtilities.H\ LibtUtilities.H\ TimrConnection.H\ pA_Attributes.H\ pA_Connection.H\ pA_Listener.H\ pIpc_Connection.H\ pIpc_Listener.H\ pRaw_Connection.H\ pRaw_Listener.H\ pSimple_Connection.H\ pSimple_Listener.H\ pString_Connection.H\ pString_Listener.H INCLUDES = -I.. idapdir = $(libdir) idap_DATA = idap.+ adap.+ EXTRA_DIST = idap.+ adap.+ aplus-fsf-4.22/src/IPC/Makefile.in0000644000265000001440000003544110774512521012300 # Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ ############################################################################### ############################################################################### SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CXX = @CXX@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ STRIP = @STRIP@ VERSION = @VERSION@ X_INCLUDES = @X_INCLUDES@ X_LIBS = @X_LIBS@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ lib_LTLIBRARIES = libIPC.la libIPC_la_SOURCES = \ AipcAttributes.C \ AipcConnection.C \ AipcHostPortProtocol.C \ AipcListener.C \ AipcService.C \ BufferUtilities.C \ IPCInterface.C \ IPCUtilities.C \ TimrConnection.C \ pA_Attributes.C \ pA_Connection.C \ pA_Listener.C \ pIpc_Connection.C \ pIpc_Listener.C \ pRaw_Connection.C \ pRaw_Listener.C \ pString_Connection.C \ pString_Listener.C \ pSimple_Connection.C \ pSimple_Listener.C \ AipcAttributes.H\ AipcConnection.H\ AipcHostPortProtocol.H\ AipcListener.H\ AipcService.H\ BufferUtilities.H\ IPCUtilities.H\ LibtUtilities.H\ TimrConnection.H\ pA_Attributes.H\ pA_Connection.H\ pA_Listener.H\ pIpc_Connection.H\ pIpc_Listener.H\ pRaw_Connection.H\ pRaw_Listener.H\ pSimple_Connection.H\ pSimple_Listener.H\ pString_Connection.H\ pString_Listener.H INCLUDES = -I.. idapdir = $(libdir) idap_DATA = idap.+ adap.+ EXTRA_DIST = idap.+ adap.+ subdir = src/IPC mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_CLEAN_FILES = LTLIBRARIES = $(lib_LTLIBRARIES) libIPC_la_LDFLAGS = libIPC_la_LIBADD = am_libIPC_la_OBJECTS = AipcAttributes.lo AipcConnection.lo \ AipcHostPortProtocol.lo AipcListener.lo AipcService.lo \ BufferUtilities.lo IPCInterface.lo IPCUtilities.lo \ TimrConnection.lo pA_Attributes.lo pA_Connection.lo \ pA_Listener.lo pIpc_Connection.lo pIpc_Listener.lo \ pRaw_Connection.lo pRaw_Listener.lo pString_Connection.lo \ pString_Listener.lo pSimple_Connection.lo pSimple_Listener.lo libIPC_la_OBJECTS = $(am_libIPC_la_OBJECTS) DEFS = @DEFS@ DEFAULT_INCLUDES = -I. -I$(srcdir) CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/AipcAttributes.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AipcConnection.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AipcHostPortProtocol.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AipcListener.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AipcService.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/BufferUtilities.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/IPCInterface.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/IPCUtilities.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/TimrConnection.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/pA_Attributes.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/pA_Connection.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/pA_Listener.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/pIpc_Connection.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/pIpc_Listener.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/pRaw_Connection.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/pRaw_Listener.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/pSimple_Connection.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/pSimple_Listener.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/pString_Connection.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/pString_Listener.Plo CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ CXXFLAGS = @CXXFLAGS@ CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ DIST_SOURCES = $(libIPC_la_SOURCES) DATA = $(idap_DATA) DIST_COMMON = Makefile.am Makefile.in SOURCES = $(libIPC_la_SOURCES) all: all-am .SUFFIXES: .SUFFIXES: .C .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/IPC/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) libLTLIBRARIES_INSTALL = $(INSTALL) install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(libdir) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f"; \ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p"; \ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test -z "$dir" && dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libIPC.la: $(libIPC_la_OBJECTS) $(libIPC_la_DEPENDENCIES) $(CXXLINK) -rpath $(libdir) $(libIPC_la_LDFLAGS) $(libIPC_la_OBJECTS) $(libIPC_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AipcAttributes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AipcConnection.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AipcHostPortProtocol.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AipcListener.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AipcService.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BufferUtilities.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/IPCInterface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/IPCUtilities.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TimrConnection.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pA_Attributes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pA_Connection.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pA_Listener.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pIpc_Connection.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pIpc_Listener.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pRaw_Connection.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pRaw_Listener.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pSimple_Connection.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pSimple_Listener.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pString_Connection.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pString_Listener.Plo@am__quote@ distclean-depend: -rm -rf ./$(DEPDIR) .C.o: @AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< .C.obj: @AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CXXCOMPILE) -c -o $@ `cygpath -w $<` .C.lo: @AMDEP_TRUE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(LTCXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< CXXDEPMODE = @CXXDEPMODE@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: idapDATA_INSTALL = $(INSTALL_DATA) install-idapDATA: $(idap_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(idapdir) @list='$(idap_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(idapDATA_INSTALL) $$d$$p $(DESTDIR)$(idapdir)/$$f"; \ $(idapDATA_INSTALL) $$d$$p $(DESTDIR)$(idapdir)/$$f; \ done uninstall-idapDATA: @$(NORMAL_UNINSTALL) @list='$(idap_DATA)'; for p in $$list; do \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " rm -f $(DESTDIR)$(idapdir)/$$f"; \ rm -f $(DESTDIR)$(idapdir)/$$f; \ done ETAGS = etags ETAGSFLAGS = tags: TAGS 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; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ 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; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = ../.. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(DATA) installdirs: $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(idapdir) 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_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_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-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-compile distclean-depend \ distclean-generic distclean-libtool distclean-tags dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-idapDATA install-exec-am: install-libLTLIBRARIES install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool uninstall-am: uninstall-idapDATA uninstall-info-am \ uninstall-libLTLIBRARIES .PHONY: GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool distclean distclean-compile \ distclean-depend distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am info info-am install \ install-am install-data install-data-am install-exec \ install-exec-am install-idapDATA install-info install-info-am \ install-libLTLIBRARIES install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool tags uninstall \ uninstall-am uninstall-idapDATA uninstall-info-am \ uninstall-libLTLIBRARIES # 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: aplus-fsf-4.22/src/IPC/AipcAttributes.C0000644000265000001440000000430610772770337013267 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// // // AipcAttributes // // This class contains the setable attributes of an AipcConnection. // It is a separate calss to facilitate its enclosure in a AipcListener, // from which newly spawned connecitons can be initialized. // #include #include // Static members A AipcAttributes::SetableAttrs=(A)0; A AipcAttributes::NonsetableAttrs=(A)0; AipcAttributes::AipcAttributes(void) { ipcWarn(0,"%t AipcAttributes::AipcAttributes\n"); init(); } AipcAttributes::AipcAttributes(AipcAttributes &src_) : _clientData((A)ic(src_.clientData())), _flagAttrs(src_._flagAttrs), _readPriority(src_._readPriority), _writePriority(src_._writePriority), _readBufsize(src_._readBufsize), _writeBufsize(src_._writeBufsize), _listener(src_._listener) {} AipcAttributes::~AipcAttributes(void){dc(_clientData);} void AipcAttributes::init(void) { ipcWarn(0,"%t AipcAttributes::init\n"); _flagAttrs=_readPriority=_writePriority=_readBufsize=_writeBufsize= _listener=0; _clientData=(A)0; retry(MSTrue); if(0==SetableAttrs) SetableAttrs=gvi(Et,10,MS(si("noDelay")), MS(si("readPause")),MS(si("writePause")), MS(si("readPriority")),MS(si("writePriority")), MS(si("readBufsize")),MS(si("writeBufsize")), MS(si("retry")),MS(si("clientData")),MS(si("debug"))); if(0==NonsetableAttrs) NonsetableAttrs=gvi(Et,5,MS(si("fd")),MS(si("port")), MS(si("writeStatus")),MS(si("readStatus")), MS(si("listener"))); } // M:Attribute interface int AipcAttributes::setAttrIndex(C *attr_) { int idx; A attrs=setableAttrs(); I attrsym=MS(si(attr_)); for(idx=0;idxn;++idx)if(attrsym==attrs->p[idx])break; return (idx==attrs->n)?-1:idx; } int AipcAttributes::nonsetAttrIndex(C *attr_) { int idx; A attrs=nonsetableAttrs(); I attrsym=MS(si(attr_)); for(idx=0;idxn;++idx)if(attrsym==attrs->p[idx])break; return (idx==attrs->n)?-1:idx; } aplus-fsf-4.22/src/IPC/AipcConnection.C0000644000265000001440000002560210772770340013234 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// // // AipcConnection // // This class is a sub-class of MSProtocolConnection, and intended to be // an abstract class for all libIPC connection classes which use MStk // compatible protocols. // #include #ifdef __sgi /* need for param.h who includes signal.h */ #define _BSD_COMPAT #endif #include #if defined(__sgi) || defined(_AIX) || defined(SOLARIS_CSET) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__) #include #endif #if defined(_AIX) || defined (linux) || defined(__alpha) || defined(__APPLE__) extern "C" { #include } #else extern "C" { #include } #endif #if defined(__NetBSD__) #include #endif #include #include // extern "C" int ioctl(int,unsigned int,long *); #include #include // Manually instantiate our template #if defined(__edgfe) #pragma instantiate MSProtocolConnection #elif defined(_AIX) || defined(_MSC_VER) template MSProtocolConnection; #endif // Static members I AipcConnection::ServiceType=1; AipcConnection::AipcConnection(C *name_,C *host_,I port_,A cbfunc_) : MSProtocolConnection(name_,host_,port_), AipcService(cbfunc_) { ipcWarn(0,"%t AipcConnection::AipcConnection(0)\n"); init(); } AipcConnection::AipcConnection(C *serviceName_,A cbfunc_) : MSProtocolConnection(serviceName_,(C*)0,-1), AipcService(cbfunc_) { ipcWarn(0,"%t AipcConnection::AipcConnection(1)\n"); init(); AipcHostPortProtocol ahpp(serviceName_); hostPort().set(ahpp.host(),ahpp.port()); } AipcConnection::AipcConnection(AipcHostPortProtocol &ahpp_, A cbfunc_) : MSProtocolConnection(ahpp_.service(),ahpp_.host(),ahpp_.port()), AipcService(cbfunc_) { ipcWarn(0,"%t AipcConnection::AipcConnection(2)\n"); init(); } AipcConnection::AipcConnection(C *name_,int fd_,A cbfunc_, AipcAttributes &attrs_) : MSProtocolConnection(name_,fd_), AipcService(cbfunc_), _attrs(attrs_) { ipcWarn(0,"%t AipcConnection::AipcConnection(3) fd=%d\n",fd_); init(); } AipcConnection::~AipcConnection(void) { ipcWarn(wrnlvl(),"%t AipcConnection::~AipcConnection\n"); reset(); } void AipcConnection::init(void) { ipcWarn(0,"%t AipcConnection::init\n"); initAttrs(); } void AipcConnection::initAttrs(void) { ipcWarn(0,"%t AipcConnection::initAttrs\n"); if(_attrs.readPause())turnReadPauseOn(); if(_attrs.writePause())turnWritePauseOn(); if(_attrs.retry())turnRetryOn(); if(_attrs.debug())turnDebugOn(); } // M:Flags static I setNoDelayOnFd(I handle_,int wrnlvl_,int fd_,int val_) { ipcWarn(wrnlvl_,"%t setNoDelayOnFd(%d,%d)\n",fd_,val_); char sockname[16]; int socklen=14; struct protoent *ProtoEnt=(struct protoent *)0; #if defined(APLUS_THREAD_SAFE_FUNCTIONS) struct protoent protoentStruct; char charBuf[1024]; #endif // APLUS_THREAD_SAFE_FUNCTIONS APLUS_GETPROTOBYNAME("tcp",&protoentStruct,charBuf,1024,ProtoEnt); #if defined(HAVE_SOCKLEN_T) if (getpeername(fd_,(struct sockaddr *)sockname, (socklen_t *)&socklen)) #else if (getpeername(fd_,(struct sockaddr *)sockname, &socklen)) #endif { #ifndef HAVE_STRERROR Warn("%t Getpeername failed on %d: %s\n", handle_,(errno)?sys_errlist[errno]:"unknown error"); #else char *errstr=strerror(errno); Warn("%t Getpeername failed on %d: %s\n", handle_,errstr ? errstr : "unknown error"); #endif R -1; } sockname[socklen]='\0'; int rc=setsockopt(fd_,ProtoEnt->p_proto,TCP_NODELAY,(char *)(&val_), sizeof(int)); if(0<=rc)R 0; { static char fmt[]="\343 error setting nodelay %s: errno=%d\n"; static char on[]="on"; static char off[]="off"; Warn(fmt,val_?on:off,errno); } R -2; } void AipcConnection::turnNoDelayOn(void) { if(MSFalse==isNoDelay()&& (-1==fd()||0==setNoDelayOnFd(handle(),wrnlvl(),fd(),1))) _attrs.noDelay(MSTrue); } void AipcConnection::turnNoDelayOff(void) { if(MSTrue==isNoDelay()&& 0==(-1==fd()||setNoDelayOnFd(handle(),wrnlvl(),fd(),0))) _attrs.noDelay(MSFalse); } void AipcConnection::turnReadPauseOn(void) { if(readChannel())readChannel()->disable(); set(MSProtocolConnection::ReadPause); } void AipcConnection::turnReadPauseOff(void) { if(readChannel())readChannel()->enable(); unset(MSProtocolConnection::ReadPause); } void AipcConnection::turnWritePauseOn(void) { if(writeChannel())writeChannel()->disable(); set(MSProtocolConnection::WritePause); } void AipcConnection::turnWritePauseOff(void) { if(writeChannel())writeChannel()->enable(); unset(MSProtocolConnection::WritePause); } // M:Attribute interface A AipcConnection::setableAttrlist(void) { ipcWarn(wrnlvl(),"%t AipcConnection::setableAttrlist\n"); return (A)ic(_attrs.setableAttrs()); } A AipcConnection::getableAttrlist(void) { ipcWarn(wrnlvl(),"%t AipcConnection::getableAttrlist\n"); int i,idx=0; A sattrs=_attrs.setableAttrs(); A nsattrs=_attrs.nonsetableAttrs(); A z=gv(Et,sattrs->n+nsattrs->n); for (i=0;in;++i)z->p[idx++]=sattrs->p[i]; for (i=0;in;++i)z->p[idx++]=nsattrs->p[i]; R z; } MSBoolean AipcConnection::setAttr(C *attr_,A aval_) { ipcWarn(wrnlvl(),"%t AipcConnection::setAttr\n"); int idx=_attrs.setAttrIndex(attr_); I ival; switch(idx) { CSBOOL(0,aval_,turnNoDelayOn,turnNoDelayOff); CSBOOL(1,aval_,turnReadPauseOn,turnReadPauseOff); CSBOOL(2,aval_,turnWritePauseOn,turnWritePauseOff); CS(3,ItCHK(aval_);_attrs.readPriority(ival)); CS(4,ItCHK(aval_);_attrs.writePriority(ival)); CS(5,ItCHK(aval_);_attrs.readBufsize(ival)); CS(6,ItCHK(aval_);_attrs.writeBufsize(ival)); CSBOOL(7,aval_,turnRetryOn,turnRetryOff); CS(8,_attrs.clientData((A)ic(aval_))); CSBOOL(9,aval_,turnDebugOn,turnDebugOff); default: R MSFalse; } R MSTrue; } A AipcConnection::getAttr(C *attr_) { ipcWarn(wrnlvl(),"%t AipcConnection::getAttr\n"); int idx=_attrs.setAttrIndex(attr_); if(-1!=idx) { switch(idx) { CSR(0,R gi(isNoDelay()?1:0)); CSR(1,R gi(isReadPause()?1:0)); CSR(2,R gi(isWritePause()?1:0)); CSR(3,R gi(_attrs.readPriority());); CSR(4,R gi(_attrs.writePriority());); CSR(5,R gi(_attrs.readBufsize());); CSR(6,R gi(_attrs.writeBufsize());); CSR(7,R gi(isRetry()?1:0)); CSR(8,R (A)ic(_attrs.clientData())); CSR(9,R gi(isDebug()?1:0)); default: R aplus_nl; } } else { int idx=_attrs.nonsetAttrIndex(attr_); if(-1!=idx) { switch(idx) { CSR(0,R gi(fd())); /* fd */ CSR(1,R gi(port())); /* port */ CSR(2,R writeQueueStatus()); CSR(3,R readQueueStatus()); CSR(4,R gi(_attrs.listener())); default: R aplus_nl; } } else R aplus_nl; /* subclasses call parent class here */ } } // M:Callbacks void AipcConnection::readNotify(const A &aobj_) { ACallback("read",aobj_); } void AipcConnection::doConnect(void) { if(isNoDelay())setNoDelayOnFd(handle(),wrnlvl(),fd(),1); MSProtocolConnection::doConnect(); } void AipcConnection::connectNotify(void) { turnInResetOff(); A adata=gi(_attrs.listener()); ACallback("opened",adata); dc(adata); } void AipcConnection::sentNotify(int nmsgs_) { A adata=gi(nmsgs_); ACallback("sent",adata); dc(adata); } void AipcConnection::resetNotify(MSProtocolConnection::State errstate_) { if (errstate_==MSProtocolConnection::Read) resetNotify("read"); else if (errstate_==MSProtocolConnection::Write) resetNotify("write"); else resetNotify("unknownState"); } void AipcConnection::resetNotify(const C *errmsg_) { A adata=gsym(errmsg_); ACallback("closed",adata); dc(adata); } // M:Other methods void AipcConnection::initFromListener(void) { ipcWarn(wrnlvl(),"%t AipcConnection::initFromListener\n"); turnRetryOff(); } void AipcConnection::reset(void) { ipcWarn(wrnlvl(),"%t AipcConnection::reset\n"); MSBuffer *db=readBuffer(); if(db!=0) { dc((A)(db->minofbuffer())); db->minofbuffer(0); db->clear(); } MSProtocolConnection::reset(); turnInResetOn(); } A AipcConnection::writeQueueStatus(void) { ipcWarn(wrnlvl(),"%t AipcConnection::writeQueueStatus\n"); MSNodeItem *np, *hp=writeList(); int count; for(np=hp,count=0;hp!=(np=np->next());++count) ; R gvi(It,2,count,isInWrite()?1:0); } int AipcConnection::readFileLength(void) { I slen=-1; if(-1==ioctl(fd(),FIONREAD,&slen)) { #ifndef HAVE_STRERROR ipcWarn(wrnlvl(),"%t ioctl FIONREAD failed: %s\n", (errno AipcHostPortProtocol::AipcHostPortProtocol(C *service_) : _hostport("",-1) { _service=service_; lookupService(); } extern "C" int GetService(const char *name); extern "C" int NextService(char **host, long *program, char **protocol); MSBoolean AipcHostPortProtocol::lookupService(void) { if (_service==MSString( (C *)0 )) return (-1==port())?MSFalse:MSTrue; const C *name=service(); C *host; I port; C *pcl; if (0 >= GetService(name)) {return MSFalse;} if (0 > NextService(&host,&port,&pcl)) {return MSFalse;} setHostPort(host,port); protocol(pcl); return MSTrue; } aplus-fsf-4.22/src/IPC/AipcListener.C0000644000265000001440000001127110772770340012717 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// // // AipcListener // // This class is a sub-class of MSProtocolListener, and intended to be // an abstract class for all libIPC listener classes compatible with MStk. #include #include // Static members I AipcListener::ServiceType=2; AipcListener::AipcListener(C *name_,I port_,A cbfunc_) : MSProtocolListener(name_,port_), AipcService(cbfunc_) { ipcWarn(0,"%t AipcListener::AipcListener(0)\n"); init(); } AipcListener::AipcListener(C *serviceName_,A cbfunc_) : MSProtocolListener(serviceName_,-1), AipcService(cbfunc_) { ipcWarn(0,"%t AipcListener::AipcListener(1)\n"); AipcHostPortProtocol ahpp(serviceName_); hostPort().set(ahpp.host(),ahpp.port()); init(); } AipcListener::AipcListener(AipcHostPortProtocol &ahpp_, A cbfunc_) : MSProtocolListener(ahpp_.service(),ahpp_.port()), AipcService(cbfunc_) { ipcWarn(0,"%t AipcListener::AipcListener(2)\n"); init(); } AipcListener::~AipcListener(void) { ipcWarn(wrnlvl(),"%t AipcListener::~AipcListener\n"); close(); } void AipcListener::init(void) { ipcWarn(0,"%t AipcListener::init\n"); _zeroPort=(0==port())?MSTrue:MSFalse; _attrs.listener(handle()); } // M:Attribute interface A AipcListener::setableAttrlist(void){return (A)ic(_attrs.setableAttrs());} A AipcListener::getableAttrlist(void) { int i,idx=0; A sattrs=_attrs.setableAttrs(); A nsattrs=_attrs.nonsetableAttrs(); A z=gv(Et,sattrs->n+nsattrs->n); for (i=0;in;++i)z->p[idx++]=sattrs->p[i]; for (i=0;in;++i)z->p[idx++]=nsattrs->p[i]; R z; } MSBoolean AipcListener::setAttr(C *attr_,A aval_) { ipcWarn(wrnlvl(),"%t AipcListener::setAttr\n"); int idx=_attrs.setAttrIndex(attr_); I ival; switch(idx) { CS(0,BoolCHK(aval_);_attrs.noDelay(ival?MSTrue:MSFalse)); CS(1,BoolCHK(aval_);_attrs.readPause(ival?MSTrue:MSFalse)); CS(2,BoolCHK(aval_);_attrs.writePause(ival?MSTrue:MSFalse)); CS(3,ItCHK(aval_);_attrs.readPriority(ival)); CS(4,ItCHK(aval_);_attrs.writePriority(ival)); CS(5,ItCHK(aval_);_attrs.readBufsize(ival)); CS(6,ItCHK(aval_);_attrs.writeBufsize(ival)); CS(7,BoolCHK(aval_);_attrs.retry(ival?MSTrue:MSFalse)); CS(8,_attrs.clientData((A)ic(aval_))); CS(9,BoolCHK(aval_); if(ival)turnDebugOn();else turnDebugOff(); _attrs.debug(ival?MSTrue:MSFalse)); default: R MSFalse; } R MSTrue; } A AipcListener::getAttr(C *attr_) { ipcWarn(wrnlvl(),"%t AipcListener::getAttr\n"); int idx=_attrs.setAttrIndex(attr_); if(-1!=idx) { switch(idx) { CSR(0,R gi(_attrs.noDelay()?1:0)); CSR(1,R gi(_attrs.readPause()?1:0)); CSR(2,R gi(_attrs.writePause()?1:0)); CSR(3,R gi(_attrs.readPriority());); CSR(4,R gi(_attrs.writePriority());); CSR(5,R gi(_attrs.readBufsize());); CSR(6,R gi(_attrs.writeBufsize());); CSR(7,R gi(_attrs.retry()?1:0)); CSR(8,R(A)ic(_attrs.clientData())); CSR(9,R gi(_attrs.debug()?1:0)); default: R aplus_nl; } } else { int idx=_attrs.nonsetAttrIndex(attr_); if(-1!=idx) { switch(idx) { CSR(0,R gi(fd())); /* fd */ CSR(1,R gi(port())); /* port */ default: R aplus_nl; } } else R aplus_nl; /* subclasses call parent class here */ } } // M:Callbacks void AipcListener::acceptNotify(int fd_, const struct sockaddr *peername, int peernamelen, const struct sockaddr *sockname, int socknamelen) { ipcWarn(wrnlvl(), "%t AipcListener::acceptNotify: no connection specified. fd=%d\n", fd_); /* next line is just to stop compiler from whining about unused names. */ if(0)ipcWarn(0,"",peername,peernamelen,sockname,socknamelen); } // M:Other methods; int AipcListener::getListenPort(void) { ipcWarn(wrnlvl(),"%t AipcListener::getListenPort\n"); if (-1==fd()) R -1; #if defined(HAVE_SOCKLEN_T) if(0!=(getsockname(fd(),localName(),(socklen_t *)&_localNamelen))) R -1; #else if(0!=(getsockname(fd(),localName(),&_localNamelen))) R -1; #endif struct sockaddr_in *pSockaddrIn=( sockaddr_in *)localName(); R ntohs(pSockaddrIn->sin_port); } void AipcListener::open(void) { ipcWarn(wrnlvl(),"%t AipcListener::open\n"); MSProtocolListener::open(); if (_zeroPort) { _hostPort.set(host(),getListenPort()); ipcWarn(wrnlvl(),"%t port fixed at %d\n",port()); } } void AipcListener::close(void) { ipcWarn(wrnlvl(),"%t AipcListener::close\n"); if (_zeroPort) _hostPort.set(host(),0); MSProtocolListener::close(); } aplus-fsf-4.22/src/IPC/AipcService.C0000644000265000001440000000561110772770340012533 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// // // AipcService // // This class contains code common to all AIPC connections and listeners. // It stores the callback function, and manages the Roster and handles. #include // Static members MSNodeItem *AipcService::Roster=new MSNodeItem; I AipcService::HandleSource=3210000; AipcService::AipcService(A cbfunc_) : _debug(MSFalse) { ipcWarn(0,"%t AipcService::AipcService\n"); init(cbfunc_); } AipcService::~AipcService(void) { ipcWarn(wrnlvl(),"%t AipcService::~AipcService\n"); removeFromRoster(); dc(_acbfunc); _acbfunc=(A)0; } void AipcService::init(A cbfunc_) { ipcWarn(0,"%t AipcService::init\n"); _handle=++HandleSource; _acbfunc=(A)ic(cbfunc_); addToRoster(); } void AipcService::addToRoster(void) { ipcWarn(0,"%t AipcService::addToRoster\n"); _node=new MSNodeItem(); _node->data(new AipcNodeItem(this,handle())); AipcService::Roster->insert(_node); } void AipcService::removeFromRoster(void) { _node->remove(); // delete (MSNodeItem *)_node->data(); // delete _node->data(); delete _node; _node=0; } // M:Handle functions MSBoolean AipcService::ValidateHandle(I handle_) { ipcWarn(wrnlvl(),"%t AipcService::ValidateHandle\n"); for(MSNodeItem *hp=Roster,*np=hp;hp!=(np=np->next());) { AipcNodeItem *npd=(AipcNodeItem *)np->data(); if(handle_==npd->_handle) return ((AIPC_BMASK&serviceType())==npd->_asptr->serviceType()) ? MSTrue : MSFalse; } return MSFalse; } AipcService *AipcService::lookup(I handle_) { ipcWarn(0,"%t AipcService::lookup %d\n",handle_); for(MSNodeItem *hp=Roster,*np=hp;hp!=(np=np->next());) { AipcNodeItem *npd=(AipcNodeItem *)np->data(); if(handle_==npd->_handle) return npd->_asptr; } return 0; } AipcService *AipcService::lookup(I handle_,I serviceType_) { AipcService *asptr=lookup(handle_); return(asptr&&(AIPC_BMASK&asptr->serviceType())==serviceType_)?asptr:0; } A AipcService::roster(void) { ipcWarn(0,"%t AipcService::roster\n"); int n; MSNodeItem *hp=Roster,*np; for(np=hp,n=0;hp!=(np=np->next());) n++; A z=gv(It,n); for(np=hp,n=0;hp!=(np=np->next());) z->p[n++]=((AipcNodeItem *)(np->data()))->_handle; return z; } // M:Other methods void AipcService::ACallback(const C *event_,A data_) { ipcWarn(wrnlvl(),"%t AipcService::ACallback %s\n",event_); E e=(E)ma(5); A ahandle=gi(handle()); A aevent=gsym(event_); e->n=3; e->f=(I)acbfunc(); e->a[0]=(I)ahandle; e->a[1]=(I)aevent; e->a[2]=(I)data_; dc((A)ez(ME(e))); dc(aevent); dc(ahandle); mf((I *)e); } void AipcService::serviceErrorNotify(const C *msg_) { A d=gsym(msg_); ACallback("error",d); dc(d); } aplus-fsf-4.22/src/IPC/BufferUtilities.C0000644000265000001440000000236710772770340013450 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include /* bufftobuff retrieves up to n characters from buffer sp, and puts them into buffer dp. Returns number of characters actually gotten. */ int bufftobuff(MSBuffer *sp,MSBuffer *dp,int n) { if(sp&&dp) { if(n>sp->put()-sp->get()) n=sp->put()-sp->get(); dp->stuff(sp->get(),n); sp->get(sp->get()+n); return n; } return -1; } MSBuffer *createBufferFromAobj(const A &aobj) { I headsize,datasize; int rc; rc=ExportAObjectSizePass(aobj,(char *)0,1,&headsize,&datasize); if(0!=rc) return NULL; long objsize=headsize+datasize; int nobjsize = htonl(objsize);; MSBuffer *bp=new MSBuffer(objsize+sizeof(long)); bp->stuff((char *)(&nobjsize),sizeof(nobjsize)); ExportAObjectFillPass(aobj,(char *)0,1,headsize,bp->put()); bp->put(bp->put()+objsize); return(bp); } aplus-fsf-4.22/src/IPC/IPCInterface.C0000644000265000001440000004051610772770340012575 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #undef ENTRYPOINT #define ENTRYPOINT static #include #include #include #include #include #include #include #include #include #include #include #include #include #define SRVPTR(X,MSG) AipcService *srvptr=lookupAnyHandle(X); \ ipcWarn(srvptr?srvptr->wrnlvl():0,MSG); \ if(!srvptr) return -1; #define H_SRVPTR(MSG) SRVPTR(handle_,MSG); I ipcWarnFlag=-1; static C *getString(A aobj) { C *z; if (Ct==aobj->t)z=(C *)aobj->p; else if (Et==aobj->t&&1==aobj->n&&QS(*aobj->p))z=XS(*aobj->p)->n; else z=(C *)0; return z; } static S getSymbol(A aobj) { if (Et==aobj->t&&1==aobj->n&&QS(*aobj->p))return XS(*aobj->p); return (S)0; } static void WarnFunc(C *s) { fputs(s,stderr); fflush(stderr); } static int Initialized=0; static S ProtocolList[32][2]; static void Initialize(void) { int idx=0; Initialized=1; ipcWarnFlag=-1; SetWarnFunc(0); MSMessageLog::quietMode(MSTrue); ipcWarn(0,"%t Initialize:\n"); // Protocol Name Alt Protocal Name ProtocolList[idx++][0]=si("A"); ProtocolList[idx][1]=0; ProtocolList[idx++][0]=si("raw"); ProtocolList[idx][1]=si("RAW"); ProtocolList[idx++][0]=si("tick"); ProtocolList[idx][1]=0; ProtocolList[idx++][0]=si("stream"); ProtocolList[idx][1]=0; ProtocolList[idx++][0]=si("ipc"); ProtocolList[idx][1]=0; ProtocolList[idx++][0]=si("delta"); ProtocolList[idx][1]=0; ProtocolList[idx++][0]=si("string"); ProtocolList[idx][1]=0; ProtocolList[idx++][0]=si("simple"); ProtocolList[idx][1]=0; ProtocolList[idx++][0]=(S)0; } static void InitializeIfNeeded(void) { if(!Initialized)Initialize(); } static int lookupProtocol(S sym) { int i; for(i=0;ProtocolList[i][0];++i) if((sym==ProtocolList[i][0])||sym==ProtocolList[i][1]) return i; return -1; } // static AipcConnection *lookupConnHandle(int handle_) // { // InitializeIfNeeded(); // return (AipcConnection *) // AipcService::lookup(handle_,AipcConnection::ServiceType); // } static AipcService *lookupAnyHandle(int handle_) { InitializeIfNeeded(); return (AipcService *)AipcService::lookup(handle_); } ENTRYPOINT A ipcRoster(void){return AipcService::roster();} ENTRYPOINT I ipcListenNPP(A afunc, A aname, I port, A aprotocol) { C *serviceName=getString(aname); S protocolSym=getSymbol(aprotocol); int protocolidx; AipcListener *nLstn; InitializeIfNeeded(); ipcWarn(0,"%t ipcListenNPP:\n"); if(!serviceName||!protocolSym||!QF(afunc))return -1; ipcWarn(0,"%t ipcListenNPP: name:%s port:%d protocol:%s\n",serviceName, port,protocolSym->n); protocolidx=lookupProtocol(protocolSym); switch(protocolidx) { case 0: nLstn=new pA_Listener(serviceName,port,afunc); break; case 1: nLstn=new pRaw_Listener(serviceName,port,afunc); break; case 4: nLstn=new pIpc_Listener(serviceName,port,afunc); break; case 6: nLstn=new pString_Listener(serviceName,port,afunc); break; case 7: nLstn=new pSimple_Listener(serviceName,port,afunc); break; default: /* unknown protocol */ Warn("%t ipcListenNPP: unknown protocol:%s\n",protocolSym->n); return -1; } return nLstn->handle(); } ENTRYPOINT I ipcListenN(A afunc, A aname) { C *serviceName=getString(aname); int protocolidx; AipcListener *nLstn; InitializeIfNeeded(); ipcWarn(0,"%t ipcListenN:\n"); if(!serviceName||!QF(afunc))return -1; AipcHostPortProtocol *ahpp=new AipcHostPortProtocol(serviceName); // const C *hostName=ahpp->host(); I port=ahpp->port(); S protocolSym=si((char *)ahpp->protocol()); ipcWarn(0,"%t ipcListenN: name:%s port:%d protocol:%s\n",serviceName, port,protocolSym->n); protocolidx=lookupProtocol(protocolSym); switch(protocolidx) { case 0: nLstn=new pA_Listener(*ahpp,afunc); break; case 1: nLstn=new pRaw_Listener(*ahpp,afunc); break; case 4: nLstn=new pIpc_Listener(*ahpp,afunc); break; case 6: nLstn=new pString_Listener(*ahpp,afunc); break; case 7: nLstn=new pSimple_Listener(*ahpp,afunc); break; default: /* unknown protocol */ Warn("%t ipcListenN: unknown protocol:%s\n",protocolSym->n); return -1; } return nLstn->handle(); } ENTRYPOINT I ipcListenNP(A afunc, A aname, A aprotocol) { C *serviceName=getString(aname); S protocolSym=getSymbol(aprotocol); int protocolidx; AipcListener *nLstn; InitializeIfNeeded(); ipcWarn(0,"%t ipcListenN:\n"); if(!serviceName||!QF(afunc))return -1; AipcHostPortProtocol *ahpp=new AipcHostPortProtocol(serviceName); // const C *hostName=ahpp->host(); I port=ahpp->port(); ipcWarn(0,"%t ipcListenN: name:%s port:%d protocol:%s\n",serviceName, port,protocolSym->n); protocolidx=lookupProtocol(protocolSym); switch(protocolidx) { case 0: nLstn=new pA_Listener(*ahpp,afunc); break; case 1: nLstn=new pRaw_Listener(*ahpp,afunc); break; case 4: nLstn=new pIpc_Listener(*ahpp,afunc); break; case 6: nLstn=new pString_Listener(*ahpp,afunc); break; case 7: nLstn=new pSimple_Listener(*ahpp,afunc); break; default: /* unknown protocol */ Warn("%t ipcListenN: unknown protocol:%s\n",protocolSym->n); return -1; } return nLstn->handle(); } ENTRYPOINT I ipcConnectNHPP(A afunc, A aname, A ahost, I port, A aprotocol) { C *serviceName=getString(aname); C *hostName=getString(ahost); S protocolSym=getSymbol(aprotocol); int protocolidx; AipcService *nSrv; InitializeIfNeeded(); ipcWarn(0,"%t ipcConnectNHPP:\n"); if (!serviceName||!hostName||!protocolSym||!QF(afunc))return -1; ipcWarn(0,"%t ipcConnectNHPP: name:%s host:%s port:%d protocol:%s\n", serviceName,hostName,port,protocolSym->n); protocolidx=lookupProtocol(protocolSym); switch(protocolidx) { case 0: nSrv=new pA_Connection(serviceName,hostName,port,afunc); break; case 1: nSrv=new pRaw_Connection(serviceName,hostName,port,afunc); break; case 2: Warn("%t ipcConnectHPP: unsupported protocol:%s\n",protocolSym->n); return -1; break; case 4: nSrv=new pIpc_Connection(serviceName,hostName,port,afunc); break; case 5: Warn("%t ipcConnectHPP: unsupported protocol:%s\n",protocolSym->n); return -1; break; case 6: nSrv=new pString_Connection(serviceName,hostName,port,afunc); break; case 7: nSrv=new pSimple_Connection(serviceName,hostName,port,afunc); break; default: /* unknown protocol */ Warn("%t ipcConnectHPP: unknown protocol:%s\n",protocolSym->n); return -1; } return nSrv->handle(); } ENTRYPOINT I ipcConnectN(A afunc, A aname) { C *serviceName=getString(aname); int protocolidx; AipcService *nSrv; InitializeIfNeeded(); ipcWarn(0,"%t ipcConnectN:\n"); if (!serviceName||!QF(afunc))return -1; AipcHostPortProtocol *ahpp=new AipcHostPortProtocol(serviceName); // const C *hostName=ahpp->host(); // I port=ahpp->port(); S protocolSym=si((char *)ahpp->protocol()); ipcWarn(0,"%t ipcConnectN: name:%s host:%s port:%d protocol:%s\n", serviceName,ahpp->host(),ahpp->port(),ahpp->protocol()); protocolidx=lookupProtocol(protocolSym); switch(protocolidx) { case 0: nSrv=new pA_Connection(*ahpp,afunc); break; case 1: nSrv=new pRaw_Connection(*ahpp,afunc); break; case 4: nSrv=new pIpc_Connection(*ahpp,afunc); break; case 5: { Warn("%t ipcConnectHPP: unsupported protocol:%s\n",protocolSym->n); return -1; } case 6: nSrv=new pString_Connection(*ahpp,afunc); break; case 7: nSrv=new pSimple_Connection(*ahpp,afunc); break; default: /* unknown protocol */ Warn("%t ipcConnectN: unknown protocol:%s\n",protocolSym->n); return -1; } return nSrv->handle(); } ENTRYPOINT I ipcConnectNP(A afunc, A aname, A aprotocol) { C *serviceName=getString(aname); S protocolSym=getSymbol(aprotocol); int protocolidx; AipcService *nSrv; InitializeIfNeeded(); ipcWarn(0,"%t ipcConnectN:\n"); if (!serviceName||!protocolSym||!QF(afunc))return -1; AipcHostPortProtocol *ahpp=new AipcHostPortProtocol(serviceName); ahpp->protocol(protocolSym->n); // const C *hostName=ahpp->host(); // I port=ahpp->port(); ipcWarn(0,"%t ipcConnectN: name:%s host:%s port:%d protocol:%s\n", serviceName,ahpp->host(),ahpp->port(),ahpp->protocol()); protocolidx=lookupProtocol(protocolSym); switch(protocolidx) { case 0: nSrv=new pA_Connection(*ahpp,afunc); break; case 1: nSrv=new pRaw_Connection(*ahpp,afunc); break; case 4: nSrv=new pIpc_Connection(*ahpp,afunc); break; case 6: nSrv=new pString_Connection(*ahpp,afunc); break; case 7: nSrv=new pSimple_Connection(*ahpp,afunc); break; default: /* unknown protocol */ Warn("%t ipcConnectN: unknown protocol:%s\n",protocolSym->n); return -1; } return nSrv->handle(); } ENTRYPOINT int ipcTimer(A afunc, A timeout) { InitializeIfNeeded(); ipcWarn(0,"%t ipcTimer\n"); TimrConnection *nTmr=new TimrConnection(timeout, afunc); return nTmr->handle(); } ENTRYPOINT int ipcOpen(int handle_) { H_SRVPTR("%t ipcOpen\n"); switch(srvptr->serviceType()) { case 1: /* connection */ ((AipcConnection *)srvptr)->open(); break; case 2: /* listener */ ((AipcListener *)srvptr)->open(); break; case 4: /* timer */ ((TimrConnection *)srvptr)->open(); break; default: return -1; } return 0; } ENTRYPOINT int ipcOpenSync(int handle_, int timeout_) { H_SRVPTR("%t ipcOpenSync\n"); switch(srvptr->serviceType()) { case 1: /* connection */ return ((AipcConnection *)srvptr)->openSync(timeout_); default: return -1; } return 0; } ENTRYPOINT int ipcDestroy(int handle_) { H_SRVPTR("%t ipcDestroy\n"); switch(srvptr->serviceType()) { case 1: /* connection */ delete (AipcConnection *)srvptr; break; case 2: /* listener */ delete (AipcListener *)srvptr; break; case 4: /* timer */ delete (TimrConnection *)srvptr; break; default: return -1; } return 0; } ENTRYPOINT I ipcSend(int handle_,A msg_) { H_SRVPTR("%t ipcSend\n"); switch(srvptr->serviceType()) { case 1: /* connection */ return ((AipcConnection *)srvptr)->send(msg_); default: return -1; } } ENTRYPOINT A ipcSyncSend(int handle_,A msg_,A timeout_) { AipcService *srvptr=lookupAnyHandle(handle_); ipcWarn(srvptr?srvptr->wrnlvl():0,"%t ipcSyncSend\n"); if(!srvptr) R(A)0; switch(srvptr->serviceType()) { case 1: /* connection */ return ((AipcConnection *)srvptr)->syncSendCover(msg_,timeout_); default: R(A)0; } } ENTRYPOINT A ipcSyncRead(int handle_,A timeout_) { AipcService *srvptr=lookupAnyHandle(handle_); ipcWarn(srvptr?srvptr->wrnlvl():0,"%t ipcSyncRead\n"); if(!srvptr)R(A)0; switch(srvptr->serviceType()) { case 1: /* connection */ return ((AipcConnection *)srvptr)->syncReadCover(timeout_); default: return aplus_nl; } } ENTRYPOINT A ipcGetTimeout(A aobj_) { return getAbsoluteTimeout(aobj_); } ENTRYPOINT I ipcSetDebug(I handle_,I val_) { InitializeIfNeeded(); if (0==handle_) ipcWarnFlag=val_; else { AipcService *srvptr=lookupAnyHandle(handle_); if(!srvptr)return -1; if(val_)srvptr->turnDebugOn();else srvptr->turnDebugOff(); if (-1==ipcWarnFlag) ipcWarnFlag=0; } if (ipcWarnFlag>=0) { SetWarnFunc(WarnFunc); MSMessageLog::quietMode(MSFalse); } else { SetWarnFunc(0); MSMessageLog::quietMode(MSTrue); } return val_; } ENTRYPOINT I ipcDebug(I s) { InitializeIfNeeded(); ipcWarn(0,"%t ipcDebug %d\n",s); if (s) ipcSetDebug(0,2); else ipcSetDebug(0,-1); return s; } ENTRYPOINT int ipcClose(int handle_) { H_SRVPTR("%t ipcClose\n"); switch(srvptr->serviceType()) { case 1: /* connection */ ((AipcConnection *)srvptr)->reset(); break; case 2: /* listener */ ((AipcListener *)srvptr)->close(); break; case 4: /* timer */ ((TimrConnection *)srvptr)->close(); break; default: return -1; } return 0; } ENTRYPOINT int ipcSetAttr(I handle_,A aflag_,A aval_){ H_SRVPTR("%t ipcSetAttr\n"); C *flag=getString(aflag_); MSBoolean setok; if(!flag)return -1; switch(srvptr->serviceType()) { case 1: /* connection */ setok=((AipcConnection *)srvptr)->setAttr(flag,aval_); break; case 2: /* listener */ setok=((AipcListener *)srvptr)->setAttr(flag,aval_); break; case 4: /* timer */ setok=((TimrConnection *)srvptr)->setAttr(flag,aval_); break; default: return -1; } return setok?0:-1; } ENTRYPOINT A ipcGetAttr(I handle_,A aflag_) { AipcService *srvptr=lookupAnyHandle(handle_); ipcWarn(srvptr?srvptr->wrnlvl():0,"%t ipcGetAttr\n"); C *flag=getString(aflag_); A z=(A)0; if(!srvptr)return z; if(!flag)return z; switch(srvptr->serviceType()) { case 1: /* connection */ z=((AipcConnection *)srvptr)->getAttr(flag); break; case 2: /* listener */ z=((AipcListener *)srvptr)->getAttr(flag); break; case 4: /* timer */ z=((TimrConnection *)srvptr)->getAttr(flag); break; default: break; } return z; } ENTRYPOINT A ipcAttrlists(I handle_) { AipcService *srvptr=lookupAnyHandle(handle_); ipcWarn(srvptr?srvptr->wrnlvl():0,"%t ipcAttrlists\n"); A z=(A)0; if(!srvptr)return z; switch(srvptr->serviceType()) { case 1: /* connection */ z=gvi(Et,2,((AipcConnection *)srvptr)->getableAttrlist(), ((AipcConnection *)srvptr)->setableAttrlist()); break; case 2: /* listener */ z=gvi(Et,2,((AipcListener *)srvptr)->getableAttrlist(), ((AipcListener *)srvptr)->setableAttrlist()); break; case 4: /* timer */ z=gvi(Et,2,((TimrConnection *)srvptr)->getableAttrlist(), ((TimrConnection *)srvptr)->setableAttrlist()); break; } return z; } static C*serviceNames[] = {"unknown", "connector", "listener", "libtick", "timer"}; ENTRYPOINT A ipcWhatis(I handle_) { AipcService *srvptr=lookupAnyHandle(handle_); ipcWarn(srvptr?srvptr->wrnlvl():0,"%t ipcWhatis\n"); if(srvptr==0) return gvi(Et,2,MS(si("")),MS(si(""))); return gvi(Et,2,MS(si(serviceNames[srvptr->serviceType()])), MS(si((char *)srvptr->protocol()))); } extern "C" void ipcInstall(void); void ipcInstall(void) { CX saveCx=Cx; Cx=cx("i"); install((PFI)ipcRoster, "roster", A_, 0, 0, 0, 0, 0, 0, 0,0,0); install((PFI)ipcListenNPP, "listenNPP",IV, 4, A_, A_, IV, A_, 0, 0,0,0); install((PFI)ipcListenN, "listenN", IV, 2, A_, A_, 0, 0, 0, 0,0,0); install((PFI)ipcListenNP, "listenNP", IV, 3, A_, A_, A_, 0, 0, 0,0,0); install((PFI)ipcConnectNHPP,"connectNHPP",IV, 5, A_, A_, A_, IV, A_, 0,0,0); install((PFI)ipcConnectN, "connectN", IV, 2, A_, A_, 0, 0, 0, 0,0,0); install((PFI)ipcConnectNP, "connectNP",IV, 3, A_, A_, A_, 0, 0, 0,0,0); install((PFI)ipcTimer, "timer", IV, 2, A_, A_, 0, 0, 0, 0,0,0); install((PFI)ipcOpen, "open", IV, 1, IV, 0, 0, 0, 0, 0,0,0); install((PFI)ipcOpenSync, "openSync", IV, 2, IV, IV, 0, 0, 0, 0,0,0); install((PFI)ipcSend, "send", IV, 2, IV, A_, 0, 0, 0, 0,0,0); install((PFI)ipcSyncSend, "syncsend", A_, 3, IV, A_, A_, 0, 0, 0,0,0); install((PFI)ipcSyncRead, "syncread", A_, 2, IV, A_, 0, 0, 0, 0,0,0); install((PFI)ipcGetTimeout, "timeout", A_, 1, A_, 0, 0, 0, 0, 0,0,0); install((PFI)ipcSetDebug, "setdebug", IV, 2, IV, A_, 0, 0, 0, 0,0,0); install((PFI)ipcDebug, "debug", IV, 1, IV, 0, 0, 0, 0, 0,0,0); install((PFI)ipcDestroy, "destroy", IV, 1, IV, 0, 0, 0, 0, 0,0,0); install((PFI)ipcClose, "close", IV, 1, IV, 0, 0, 0, 0, 0,0,0); install((PFI)ipcAttrlists, "attrs", A_, 1, IV, 0, 0, 0, 0, 0,0,0); install((PFI)ipcSetAttr, "setattr", IV, 3, IV, A_, A_, 0, 0, 0,0,0); install((PFI)ipcGetAttr, "getattr", A_, 2, IV, A_, 0, 0, 0, 0,0,0); install((PFI)ipcWhatis, "whatis", A_, 1, IV, 0, 0, 0, 0, 0,0,0); Cx=saveCx; { char *atree; char *ipcfile; if ((atree = getenv("ATREE")) == (char *)(0)) { atree = "/usr/local/a+"; } ipcfile = bnstring(atree, "/lib/idap.+", (char *)(0)); loadafile(ipcfile,0); bfree(ipcfile); } } aplus-fsf-4.22/src/IPC/IPCUtilities.C0000644000265000001440000000663410772770340012653 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #if !defined(__cfront) #include #endif #include #include #include #include #include #include #include #include #include #include #include /* ipcWarnFlag controls the behavior of ipcWarn() calls. Its values are: -1 = no ipcWarn or Warn messages 0 = ipcWarn messages only if the debug flag is turned on for a scb 1 = like 0, but also print messages for ipcWarn() calls with scb==0 2 = print all ipcWarn messages, regardless of scb's debug flag setting Iff ipcWarnFlag<0, then all Warn messages appear as well. The value of ipcWarnFlag is set through iDebug and iSetDebug. */ extern I ipcWarnFlag; /* warnLevel is equal to -1, 0, or 1, and represents the "terseness" level. ipcWarnFlag must exceed warnLevel for the message to be generated. */ void ipcWarn(int warnLevel_, const C *fmt_, ...) { va_list ap; va_start(ap,fmt_); if(ipcWarnFlag>warnLevel_) vWarn((char *)fmt_, ap); // Note cast va_end(ap); } I longAt(C *c){ int l; ipcWarn(0,"%t longAt\n"); memmove(((C *)(&l)),c,sizeof(l)); return ntohl(l); } I shortAt(C *c){ short s; ipcWarn(0,"%t shortAt\n"); memmove(((C *)(&s)),c,sizeof(s)); return ntohs(s); } /* * atotv * This takes an A object and a pointer to an allocated timeval struct. * If the A object is valid, the values of the timeval struct are filled * in, and a pointer to it is returned. Else NULL is returned. * * A valid aobj is either: * 1) A floating point object with one element. The element * is used to represent the time in seconds. * 2) An integer object with one element or two elements. The first * element represents a whole number of seconds. If there is a * second element, it represents the number of milliseconds. * 3) An integer object with three elements. If the third element * equals 1, the first two elements are treated as a termination * time, otherwise they are treated as in case 2) above. * * In any event, the timeval struct is filled with the termination * time. * */ struct timeval *atotv(A aobj, struct timeval *tvp) { struct timeval timeleft, now; F fseconds; ipcWarn(0,"%t atotv\n"); if (Ft==aobj->t && 1==aobj->n) { fseconds = *(F *)(aobj->p); gettimeofday(&now,NULL); timeleft.tv_sec = (int)(floor(fseconds)); timeleft.tv_usec = (int)(1000000.0*(fseconds-floor(fseconds))); tvsum(&now,&timeleft,tvp); return tvp; } else if (It==aobj->t && 1<=aobj->n && 3>=aobj->n) { if (3==aobj->n && 1==aobj->p[2]) { if (0>aobj->p[1]) return 0; tvp->tv_sec=aobj->p[0]; tvp->tv_usec=aobj->p[1]; } else { gettimeofday(&now,NULL); timeleft.tv_sec=aobj->p[0]; timeleft.tv_usec=(2<=aobj->n)?aobj->p[1]:0; tvsum(&now,&timeleft,tvp); } return tvp; } else return 0; } A getAbsoluteTimeout(A aobj_) { struct timeval gameover, *tvp; ipcWarn(0,"%t getAbsoluteTimeout\n"); tvp = atotv(aobj_, &gameover); if (NULL==tvp) return(A)0; else return gvi(It,3,tvp->tv_sec,tvp->tv_usec,1); } aplus-fsf-4.22/src/IPC/TimrConnection.C0000644000265000001440000001475010772770340013275 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include I TimrConnection::ServiceType=4; A TimrConnection::SetableAttrs=(A)0; A TimrConnection::NonsetableAttrs=(A)0; S TimrConnection::OnExpireSymbols[10]; MSBoolean TimrConnection::StaticsInitialized=MSFalse; void TimrConnection::init(A aTimeout_) { if(!StaticsInitialized) initStatics(); _timer=0; _aExpiry=(A)0; _secs=_usecs=0; _flags=0; _eventSymbol=si("timer"); _aEventData=(A)0; _onExpire=Destroy; setExpiry(aTimeout_); } void TimrConnection::initStatics(void) { SetableAttrs=gvi(Et,5,MS(si("debug")),MS(si("onExpire")),MS(si("expiry")), MS(si("eventSymbol")),MS(si("eventData"))); NonsetableAttrs=gvi(Et,1,MS(si("pending"))); int idx=0; OnExpireSymbols[idx++]=si("destroy"); OnExpireSymbols[idx++]=si("restart"); OnExpireSymbols[idx++]=si("hold"); OnExpireSymbols[idx++]=si("interval"); StaticsInitialized=MSTrue; } TimrConnection::TimrConnection(A aTimeout_, A cbfunc_) : AipcService(cbfunc_) { ipcWarn(0,"%t TimrConnection::TimrConnection\n"); init(aTimeout_); } TimrConnection::~TimrConnection(void) { ipcWarn(wrnlvl(),"%t TimrConnection::~TimrConnection\n"); if (_timer!=0){delete _timer;_timer=0;} if (_aExpiry!=0){dc(_aExpiry);_aExpiry=0;} if (_aEventData!=0){dc(_aEventData);_aEventData=0;} } void TimrConnection::goOff(void) { _timer=0; int myhandle=handle(); if(Interval==_onExpire){open();} A data=_aEventData?getEventData():getExpiry(); ACallback(_eventSymbol->n,data); dc(data); if(this!=AipcService::lookup(myhandle,TimrConnection::ServiceType))return; if(Destroy==_onExpire){delete this;return;} else if(Restart==_onExpire){open();} } MSBoolean TimrConnection::setExpiry(A aeobj_) { ipcWarn(wrnlvl(),"%t TimrConnection::setExpiry\n"); switch(aeobj_->t) { case It: _secs=(0n)?aeobj_->p[0]:0; _usecs=(1n)?aeobj_->p[1]:0; if(2n&&aeobj_->p[2])turnAbsoluteOn(); else turnAbsoluteOff(); break; case Ft: if(0==aeobj_->n) { _secs=_usecs=0; turnAbsoluteOff(); } else { F fseconds = *(F *)(aeobj_->p); _secs = (int)(floor(fseconds)); _usecs = (int)(1000000.0*(fseconds-floor(fseconds))); turnAbsoluteOff(); } break; default: return MSFalse; } if(_aExpiry!=0)dc(_aExpiry); _aExpiry=(A)ic(aeobj_); if(isAbsolute()&&(Restart==_onExpire||Interval==_onExpire))_onExpire=Hold; return MSTrue; } MSBoolean TimrConnection::setOnExpire(A aOnExpire) { ipcWarn(wrnlvl(),"%t TimrConnection::setOnExpire\n"); if(1!=aOnExpire->n||!sym(aOnExpire))return MSFalse; S oesym=XS(aOnExpire->p[0]); if(OnExpireSymbols[0]==oesym) _onExpire=Destroy; else if(OnExpireSymbols[1]==oesym) { if (isAbsolute()) return MSFalse;else _onExpire=Restart; } else if(OnExpireSymbols[2]==oesym) _onExpire=Hold; else if(OnExpireSymbols[3]==oesym) { if (isAbsolute()) return MSFalse;else _onExpire=Interval; } else return MSFalse; return MSTrue; } A TimrConnection::getOnExpire(void) { ipcWarn(wrnlvl(),"%t TimrConnection::getOnExpire\n"); A z=gs(Et); z->p[0]=MS(OnExpireSymbols[_onExpire]); return z; } MSBoolean TimrConnection::setEventSymbol(A newEventSymbol_) { ipcWarn(wrnlvl(),"%t TimrConnection::setEventSymbol\n"); if(1!=newEventSymbol_->n||!sym(newEventSymbol_))return MSFalse; _eventSymbol=XS(newEventSymbol_->p[0]); return MSTrue; } A TimrConnection::getEventSymbol(void){A z=gs(Et);*z->p=MS(_eventSymbol);return z;} MSBoolean TimrConnection::setEventData(A newEventData_) { ipcWarn(wrnlvl(),"%t TimrConnection::setEventData\n"); if(_aEventData!=0)dc(_aEventData); _aEventData=(A)ic(newEventData_); return MSTrue; } void TimrConnection::close(void) { ipcWarn(wrnlvl(),"%t TimrConnection::close\n"); if (_timer!=0){delete _timer;_timer=0;} } void TimrConnection::open(void) { ipcWarn(wrnlvl(),"%t TimrConnection::open\n"); if(isPending()) return; if(isAbsolute())_timer=new MSAbsoluteTimer(_secs,_usecs, new MSMethodCallback(this,&TimrConnection::goOff)); else _timer=new MSRegularTimer(_secs,_usecs, new MSMethodCallback(this,&TimrConnection::goOff)); } // M: from AipcAttributes int TimrConnection::timrSetAttrIndex(C *attr_) { ipcWarn(wrnlvl(),"%t TimrConnection::timrSetAttrIndex\n"); int idx; A attrs=timrSetableAttrs(); I attrsym=MS(si(attr_)); for(idx=0;idxn;++idx)if(attrsym==attrs->p[idx])break; return (idx==attrs->n)?-1:idx; } int TimrConnection::timrNonsetAttrIndex(C *attr_) { ipcWarn(wrnlvl(),"%t TimrConnection::timrNonsetAttrIndex\n"); int idx; A attrs=timrNonsetableAttrs(); I attrsym=MS(si(attr_)); for(idx=0;idxn;++idx)if(attrsym==attrs->p[idx])break; return (idx==attrs->n)?-1:idx; } // M:Attribute interface A TimrConnection::setableAttrlist(void){return (A)ic(timrSetableAttrs());} A TimrConnection::getableAttrlist(void) { ipcWarn(wrnlvl(),"%t TimrConnection::getableAttrlist\n"); int i,idx=0; A sattrs=timrSetableAttrs(); A nsattrs=timrNonsetableAttrs(); A z=gv(Et,sattrs->n+nsattrs->n); for (i=0;in;++i)z->p[idx++]=sattrs->p[i]; for (i=0;in;++i)z->p[idx++]=nsattrs->p[i]; return z; } MSBoolean TimrConnection::setAttr(C *attr_,A aval_) { ipcWarn(wrnlvl(),"%t TimrConnection::setAttr\n"); int idx=timrSetAttrIndex(attr_); I ival; switch(idx) { CSBOOL(0,aval_,turnDebugOn,turnDebugOff); CSR(1,return setOnExpire(aval_)); CSR(2,return setExpiry(aval_)); CSR(3,return setEventSymbol(aval_)); CSR(4,return setEventData(aval_)); default: return MSFalse; } return MSTrue; } A TimrConnection::getAttr(C *attr_) { ipcWarn(wrnlvl(),"%t TimrConnection::getAttr\n"); int idx=timrSetAttrIndex(attr_); if(-1!=idx) { switch(idx) { CSR(0,return gi(isDebug()?1:0)); CSR(1,return getOnExpire()); CSR(2,return getExpiry()); CSR(3,return getEventSymbol()); CSR(4,return getEventData()); default: return aplus_nl; } } else { int idx=timrNonsetAttrIndex(attr_); if(-1!=idx) { switch(idx) { CSR(0,return gi(isPending()?1:0)); default: return aplus_nl; } } else return aplus_nl; /* subclasses call parent class here */ } } aplus-fsf-4.22/src/IPC/pA_Attributes.C0000644000265000001440000000261710772770340013107 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// // // pA_Attributes // // This class contains the setable attributes of an pA_Connection. // It is a separate class to facilitate its enclosure in a pA_Listener, // from which newly spawned connecitons can be initialized. // #include #include // Static members A pA_Attributes::SetableAttrs=(A)0; A pA_Attributes::NonsetableAttrs=(A)0; pA_Attributes::pA_Attributes(void) { ipcWarn(0,"%t pA_Attributes::pA_Attributes\n"); init(); } void pA_Attributes::init(void) { ipcWarn(0,"%t pA_Attributes::init\n"); _pA_flags=0; if(0==SetableAttrs) SetableAttrs=gvi(Et,1,MS(si("burstMode"))); if(0==NonsetableAttrs) NonsetableAttrs=gvi(Et,0); } // M:Attribute interface int pA_Attributes::setAttrIndex(C *attr_) { int idx; A attrs=setableAttrs(); I attrsym=MS(si(attr_)); for(idx=0;idxn;++idx)if(attrsym==attrs->p[idx])break; return (idx==attrs->n)?-1:idx; } int pA_Attributes::nonsetAttrIndex(C *attr_) { int idx; A attrs=nonsetableAttrs(); I attrsym=MS(si(attr_)); for(idx=0;idxn;++idx)if(attrsym==attrs->p[idx])break; return (idx==attrs->n)?-1:idx; } aplus-fsf-4.22/src/IPC/pA_Connection.C0000644000265000001440000003100110772770340013045 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// // // pA_Connection // // This class is subclassed from AipcConnection. It contains the // code for the read and send functions using the `A protocol. // // The `A protocol is to send messages with two parts: the first part // is a four-byte integer of the length of the second part, which is // athe result of running sys.exp on an A-object. // #ifndef sun #include #endif #include #include #include #include #include #if HAVE_IOSTREAM #include #else #include #endif MSFds pA_Connection::Syncfds; void pA_Connection::doRead(void) { ipcWarn(wrnlvl(),"%t pA_Connection::doRead\n"); if(!ValidateHandle()||isInReset()) return; A d=(isBurstMode())?readBurst():readOne(); if((A)0!=d) { readNotify(d); // send address to conform to readNotify argument dc(d); } } static inline void dcbuffer(MSBuffer *bp) { dc((A)bp->minofbuffer()); bp->minofbuffer(0); } static inline void mfbuffer(MSBuffer *bp) { mf((I *)bp->minofbuffer()); bp->minofbuffer(0); } A pA_Connection::getAobjFromBuffer(MSBuffer *bb) { ipcWarn(wrnlvl(),"%t pA_Connection::getAobjFromBuffer\n"); MSBuffer *hb=headBuffer(); MSBuffer *db=readBuffer(); A d,z; I s; if(4>(s=hb->put()-hb->get())) { if(0>bufftobuff(bb,hb,4-s)) R(A)0; if(4>(s=hb->put()-hb->get())) R(A)0; s=longAt(hb->get()); if(0>=s) { static char fmt[]="\343 IPC warning: zero-length message found. s=%d [%d]\n"; Warn(fmt, s,handle()); hb->reset(); turnInReadOff(); R(A)0; } // create read buffer, doubled as A-object char array d=gv(Ct,s); db->minofbuffer((C *)d); db->get(db->minofbuffer()); db->put((C *)(d->p)); db->maxofbuffer(db->put()+s); } if(0>bufftobuff(bb,db,db->maxofbuffer()-db->put())) R(A)0; if(db->put()==db->maxofbuffer()) { d=(A)db->minofbuffer(); z=ImportAObject((C *)d->p, d->n, (C *)0); hb->reset(); dcbuffer(db); db->clear(); if((A)0==z){resetWithError("readImport");R(A)0;} return z; } R(A)0; } A pA_Connection::readBurst(void) { ipcWarn(wrnlvl(),"%t pA_Connection::readBurst\n"); MSBuffer bbuff; A d,z=(A)0; I slen=readFileLength(),slen1,n,s,count; if(-1==slen)R(A)0; if(0==slen) { static char fmt[]="\343 IPC warning: pA::ReadBurst: read event with no data [%d]\n"; Warn(fmt, handle()); } /* create buff to hold it. Fill buffer */ slen1=slen?slen:4; bbuff.minofbuffer(mab(slen1)); bbuff.maxofbuffer(bbuff.minofbuffer()+slen1); bbuff.reset(); if(0>(n=readTheBuffer(&bbuff,slen1))) {mfbuffer(&bbuff); R(A)0;} if(0==n&&0==slen) {turnInReadOff(); mfbuffer(&bbuff); R(A)0;} d=getAobjFromBuffer(&bbuff); if((A)0==d){mfbuffer(&bbuff); R(A)0;} // determine how many more complete A-objects lie in bbuff count=1; for(C *cp=bbuff.get();cpp[i]=(I)aplus_nl; int idx=0; z->p[idx++]=(I)d; // retrieve additional A-objects from bbuff, fill in z while(idxp[idx++]=(I)d; } if(idx(s=hb->put()-hb->get())) { if(0>readTheBuffer(hb,4-s)) R(A)0; if(4>(s=hb->put()-hb->get())) R(A)0; s=longAt(hb->get()); if(0>=s) { static char fmt[]="\343 IPC warning: zero-length A-protocol message. s=%d [%d]\n"; Warn(fmt, s,handle()); hb->reset(); turnInReadOff(); R(A)0; } d=gv(Ct,s); db->minofbuffer((C *)d); db->get(db->minofbuffer()); db->put((C *)(d->p)); db->maxofbuffer(db->put()+s); } if(0>readTheBuffer(db,db->maxofbuffer()-db->put())) R(A)0; if(db->put()==db->maxofbuffer()) { d=(A)(db->minofbuffer()); z=ImportAObject((C *)d->p, d->n, (C *)0); hb->reset(); dcbuffer(db); db->clear(); turnInReadOff(); if((A)0==z){resetWithError("readImport");R(A)0;} } return z; } int pA_Connection::send(const A &msg_) { ipcWarn(wrnlvl(),"%t pA_Connection::send\n"); if(isInReset()||readChannel()==0) return -1; MSBuffer *sb=createBufferFromAobj(msg_); if(NULL==sb) return -1; sendTheBuffer(sb); if (MSFalse==isWritePause()) writeChannel()->enable(); return doWrite(MSFalse); } // M:Attribute Interface A pA_Connection::setableAttrlist(void) { ipcWarn(wrnlvl(),"%t pA_Connection::setableAttrlist\n"); A fromParent=AipcConnection::setableAttrlist(); A fromHere=_pA_attrs.setableAttrs(); A z=gv(Et,fromParent->n+fromHere->n); int i,idx=0; for(i=0;in;++i)z->p[idx++]=fromParent->p[i]; for(i=0;in;++i)z->p[idx++]=fromHere->p[i]; dc(fromParent); return z; } A pA_Connection::getableAttrlist(void) { ipcWarn(wrnlvl(),"%t pA_Connection::getableAttrlist\n"); int i,idx=0; A fromParent=AipcConnection::getableAttrlist(); A sattrs=_pA_attrs.setableAttrs(); A nsattrs=_pA_attrs.nonsetableAttrs(); A z=gv(Et,fromParent->n+sattrs->n+nsattrs->n); for (i=0;in;++i)z->p[idx++]=fromParent->p[i]; for (i=0;in;++i)z->p[idx++]=sattrs->p[i]; for (i=0;in;++i)z->p[idx++]=nsattrs->p[i]; dc(fromParent); return z; } MSBoolean pA_Connection::setAttr(C *attr_,A aval_) { ipcWarn(wrnlvl(),"%t pA_Connection::setAttr\n"); int idx=_pA_attrs.setAttrIndex(attr_); I ival; switch(idx) { CSBOOL(0,aval_,turnBurstModeOn,turnBurstModeOff); default: return AipcConnection::setAttr(attr_,aval_); } return MSTrue; } A pA_Connection::getAttr(C *attr_) { ipcWarn(wrnlvl(),"%t pA_Connection::getAttr\n"); int idx=_pA_attrs.setAttrIndex(attr_); if(-1!=idx) { switch(idx) { CSR(0,R gi(isBurstMode()?1:0)); default: return aplus_nl; } } else { int idx=_pA_attrs.nonsetAttrIndex(attr_); if(-1!=idx) { switch(idx) { default: return aplus_nl; } } else return AipcConnection::getAttr(attr_); } } // M:Syncronous Send and Read #define LOCALCHANENBL(fds,chan) if(chan)Syncfds.fdsset(fds,chan->fd()) #define MAXBUF 256 static C errorMessage[MAXBUF]; static C errorSymbol[MAXBUF]; static A syncErrorResult(const C *sym_, const C *str_) { return gvi(Et,3,gsym("error"),gsym(sym_),gsv(0,str_)); } static I syncFillError(const C *sym, const C *fmt, ...) { va_list ap; strcpy(errorSymbol,sym); va_start(ap, fmt); (void)vsprintf(errorMessage, fmt, ap); va_end(ap); return -1; } /* syncDoWrite * returns -1 on error, 0 if not finished, 1 if finished * Note that, on a return of 0, some messages may have been sent, if * several were queued up. */ I pA_Connection::syncDoWrite(void) { I c,n=0; MSNodeItem *hp=writeList(); MSNodeItem *np; MSBuffer *bp; MSBoolean notdone=MSTrue; ipcWarn(wrnlvl(), "%t pA_Connection::syncDoWrite\n"); /* write queue to write channel */ while(notdone&&(hp!=(np=hp->next()))) { bp=(MSBuffer *)np->data(); c=bp->put()-bp->get(); while(c>0 && 0<(n=bp->write(fd(),c))) c-=n; if(bp->get() == bp->put()) { delete bp;delete np;turnInWriteOff(); } else { notdone=MSFalse;turnInWriteOn(); } if (0 > n) return syncFillError("buffwrite","buffwrite returned error %d",n); } if(hp == hp->next()) return 1; else return 0; } I pA_Connection::syncWriteLoop(struct timeval *pgameover) { I result; int rc; struct timeval timeleft, *tvp; ipcWarn(wrnlvl(), "%t pA_Connection::syncWriteLoop\n"); /* make arguments for select() */ Syncfds.fdszero(Syncfds.w()); Syncfds.fdszero(Syncfds.wa()); LOCALCHANENBL(Syncfds.w(),writeChannel()); if (pgameover != (struct timeval *)0) { tvp=&timeleft; tvdiff(pgameover,tod(),tvp); if (0>tvp->tv_sec) tvp->tv_sec=tvp->tv_usec=0; } else tvp=NULL; for(;;) { Syncfds.fdscopy(Syncfds.w(),Syncfds.wa()); if (((rc = select(Syncfds.size(), NULL, Syncfds.wa(), NULL, tvp)) < 0)) { if (-1==rc && EINTR==errno) result=syncFillError("interrupt","select() received an interrupt"); else result=syncFillError("select", "select() returned error code %d. errno=%d", rc, errno); break; } if (rc) { if (Syncfds.fdsisset(Syncfds.wa(), fd())) { if (result=syncDoWrite()) break; } else { result=syncFillError("fdsisset","unexpected event broke select()"); break; } } /* check for timeout and reset timeleft */ if (NULL != tvp) { tvdiff(pgameover,tod(),tvp); if (0>tvp->tv_sec) tvp->tv_sec=tvp->tv_usec=0; if (0==tvp->tv_sec && 0==tvp->tv_usec) { result=syncFillError("timeout","Syncwrite loop timed out"); break; } } } /* end forever loop */ return result; } I pA_Connection::syncDoRead(A *pdataobj) { I result; MSBuffer *hb=headBuffer(); MSBuffer *db=readBuffer(); ipcWarn(wrnlvl(),"%t pA_Connection::syncDoRead\n"); *pdataobj=readOne(); if(*pdataobj==(A)0) { if(isInReset()) result=syncFillError("reset","Reset occurred. No message read."); else result=0; } else result=1; return result; } A pA_Connection::syncReadLoop(struct timeval *pgameover) { A result=(A)0, dataobj; int rc; struct timeval timeleft, *tvp; ipcWarn(wrnlvl(), "%t pA_Connection::syncReadLoop\n"); /* make arguments for select() */ Syncfds.fdszero(Syncfds.r()); Syncfds.fdszero(Syncfds.ra()); LOCALCHANENBL(Syncfds.r(),readChannel()); if (pgameover != (struct timeval *)0) { tvp=&timeleft; tvdiff(pgameover,tod(),tvp); if (0>tvp->tv_sec) tvp->tv_sec=tvp->tv_usec=0; } else tvp=NULL; for(;;) { Syncfds.fdscopy(Syncfds.r(),Syncfds.ra()); if (((rc = select(Syncfds.size(), Syncfds.ra(), NULL, NULL, tvp)) < 0)) { if (EINTR==errno) syncFillError("interrupt","select() received an interrupt"); else syncFillError("select", "select() returned error code %d. errno=%d", rc, errno); break; } if (rc) { if (Syncfds.fdsisset(Syncfds.ra(), fd())) { rc=syncDoRead(&dataobj); if (0tvp->tv_sec) tvp->tv_sec=tvp->tv_usec=0; if (0==tvp->tv_sec && 0==tvp->tv_usec) { syncFillError("timeout","Syncread loop timed out"); break; } } } /* end for(;;) loop */ return result; } A pA_Connection::syncSendCover(A msg_, A aTimeout) { struct timeval gameover, *tvp; I rc; ipcWarn(wrnlvl(),"%t pA_Connection::syncSend\n"); tvp = atotv(aTimeout, &gameover); if(writeChannel()==0) return syncErrorResult("nochan","channel is null"); /* put stuff on queue */ MSBuffer *sb=createBufferFromAobj(msg_); if(NULL==sb) return syncErrorResult("export","Export routine failed."); sendTheBuffer(sb); /* while loop on select() until timeout or write queue empty */ rc=syncWriteLoop(tvp); if(0>rc) return syncErrorResult(errorSymbol,errorMessage); else return gvi(Et,3,gsym("OK"),gi(rc),writeQueueStatus()); } A pA_Connection::syncReadCover(A aTimeout) { struct timeval gameover, *tvp; A dataobj; ipcWarn(wrnlvl(),"%t pA_Connection::SyncRead\n"); tvp = atotv(aTimeout, &gameover); if(readChannel()==0) return syncErrorResult("nochan","channel is null"); /* while loop on select() until timeout or complete message received */ dataobj=syncReadLoop(tvp); if (dataobj) return gvi(Et,3,gsym("OK"),dataobj,aplus_nl); else return syncErrorResult(errorSymbol, errorMessage); } aplus-fsf-4.22/src/IPC/pA_Listener.C0000644000265000001440000000522010772770340012537 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// // // pA_Listener // // This class is a sub-class of AipcListener. // #include #include // Static members pA_Listener::pA_Listener(C *serviceName_,A cbfunc_) : AipcListener(serviceName_,cbfunc_) { ipcWarn(0,"%t pA_Listener::pA_Listener(1)\n"); AipcHostPortProtocol ahpp(serviceName_); hostPort().set(ahpp.host(),ahpp.port()); } // M:Attribute interface A pA_Listener::setableAttrlist(void) { A fromParent=AipcListener::setableAttrlist(); A fromHere=_pA_attrs.setableAttrs(); A z=gv(Et,fromParent->n+fromHere->n); int i,idx=0; for(i=0;in;++i)z->p[idx++]=fromParent->p[i]; for(i=0;in;++i)z->p[idx++]=fromHere->p[i]; dc(fromParent); return z; } A pA_Listener::getableAttrlist(void) { int i,idx=0; A fromParent=AipcListener::getableAttrlist(); A sattrs=_pA_attrs.setableAttrs(); A nsattrs=_pA_attrs.nonsetableAttrs(); A z=gv(Et,fromParent->n+sattrs->n+nsattrs->n); for (i=0;in;++i)z->p[idx++]=fromParent->p[i]; for (i=0;in;++i)z->p[idx++]=sattrs->p[i]; for (i=0;in;++i)z->p[idx++]=nsattrs->p[i]; dc(fromParent); R z; } MSBoolean pA_Listener::setAttr(C *attr_,A aval_) { ipcWarn(wrnlvl(),"%t pA_Listener::setAttr\n"); int idx=_pA_attrs.setAttrIndex(attr_); I ival; switch(idx) { CS(0,BoolCHK(aval_);_pA_attrs.burstMode(ival?MSTrue:MSFalse)); default: R AipcListener::setAttr(attr_,aval_); } R MSTrue; } A pA_Listener::getAttr(C *attr_) { ipcWarn(wrnlvl(),"%t pA_Listener::getAttr\n"); int idx=_pA_attrs.setAttrIndex(attr_); if(-1!=idx) { switch(idx) { CSR(0,R gi(_pA_attrs.burstMode()?1:0)); default: R aplus_nl; } } else { int idx=_pA_attrs.nonsetAttrIndex(attr_); if(-1!=idx) { switch(idx) { default: R aplus_nl; } } else R AipcListener::getAttr(attr_); } } // M:Callbacks void pA_Listener::acceptNotify(int fd_, const struct sockaddr *peername, int peernamelen, const struct sockaddr *sockname, int socknamelen) { pA_Connection *ncA=new pA_Connection(name(),fd_,acbfunc(),_attrs,_pA_attrs); ipcWarn(wrnlvl(), "%t pA_Listener::acceptNotify: created connection %d. fd=%d\n", ncA->handle(),fd_); ncA->initFromListener(); /* next line is just to stop compiler from whining about unused names. */ if(0)ipcWarn(0,"",peername,peernamelen,sockname,socknamelen); } aplus-fsf-4.22/src/IPC/pIpc_Connection.C0000644000265000001440000000467210772770340013416 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// // // pIpc_Connection // // This class is subclassed from pA_Connection. It contains the // code for the read and send functions using the `ipc protocol. // // The `A protocol is to send messages with two parts: the first part // is a four-byte integer of the length of the second part, which is // athe result of running sys.exp on an A-object. // #include A pIpc_Connection::readBurst(void) { ipcWarn(wrnlvl(),"%t pIpc_Connection::readBurst\n"); A d=readOne(); R d?gvi(Et,1,d):(A)0; } A pIpc_Connection::readOne(void) { ipcWarn(wrnlvl(),"%t pIpc_Connection::readOne\n"); A d,d0,d1,z; C *c; MSBuffer *hb=headBuffer(); MSBuffer *db=readBuffer(); I s; if(16>(s=hb->put()-hb->get())){ if(0>readTheBuffer(hb,16-s)) R(A)0; if(16>(s=hb->put()-hb->get())) R(A)0; c = hb->get(); d=gv(Et,2); d->p[0]=(I)(d0=gv(It,5)); d0->p[0]=longAt(c); d0->p[1]=longAt(c+4); d0->p[2]=shortAt(c+8); d0->p[3]=shortAt(c+10); d0->p[4]=longAt(c+12); d->p[1]=(I)(d1=gv(Ct,s=d0->p[4])); db->minofbuffer((C *)(d)); db->get(db->minofbuffer()); db->put((C *)(d1->p)); db->maxofbuffer(db->put()+s); } if(0>readTheBuffer(db,db->maxofbuffer()-db->put())) R(A)0; if(db->put() == db->maxofbuffer()) { z=(A)(db->minofbuffer()); hb->reset(); db->minofbuffer(0); db->clear(); turnInReadOff(); R z; } R(A)0; } int pIpc_Connection::send(const A &msg_) { I t; A rhdr, rdat; short s; ipcWarn(wrnlvl(),"%t pIpc_Connection::send\n"); if(isInReset()||readChannel()==0) return -1; if((msg_->t!=Et)||(msg_->n!=2)) R -1; rhdr=(A)(msg_->p[0]); if((rhdr->t!=It)||(2!=rhdr->n)) R -1; rdat=(A)(msg_->p[1]); if((rdat->t!=Ct)||(rdat->r!=1)) R -1; MSBuffer *bp=new MSBuffer(16+rdat->n); bp->stuff("MGMG",4); /* magic cookie */ t=todsec(); bp->stuff((char *)&t,4); /* time of day */ s=rhdr->p[0]; bp->stuff((char *)&s,2); /* sequence number */ s=rhdr->p[1]; bp->stuff((char *)&s,2); /* subject */ bp->stuff((char *)&rdat->n,4); /* msg len */ bp->stuff((C *)(rdat->p),rdat->n); sendTheBuffer(bp); if (MSFalse==isWritePause()) writeChannel()->enable(); return doWrite(MSFalse); } aplus-fsf-4.22/src/IPC/pIpc_Listener.C0000644000265000001440000000167110772770340013100 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// // // pIpc_Listener // // This class is a sub-class of pA_Listener. // #include #include // M:Callbacks void pIpc_Listener::acceptNotify(int fd_, const struct sockaddr *peername, int peernamelen, const struct sockaddr *sockname, int socknamelen) { ipcWarn(wrnlvl(), "%t pIpc_Listener::acceptNotify: creating connection. fd=%d\n", fd_); pIpc_Connection *ncR=new pIpc_Connection(name(),fd_,acbfunc(), _attrs,_pA_attrs); ncR->initFromListener(); /* next line is just to stop compiler from whining about unused names. */ if(0)ipcWarn(0,"",peername,peernamelen,sockname,socknamelen); } aplus-fsf-4.22/src/IPC/pRaw_Connection.C0000644000265000001440000000452210772770340013426 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// // // pRaw_Connection // // This class is subclassed from pA_Connection. It contains the // code for the read and send functions using the `raw protocol. // // The `A protocol is to send messages with two parts: the first part // is a four-byte integer of the length of the second part, which is // athe result of running sys.exp on an A-object. // #include #include #include #if defined(_AIX) || defined(linux) || defined(__alpha) extern "C" { #include #include } #else extern "C" { #include #include } #endif A pRaw_Connection::readBurst(void) { ipcWarn(wrnlvl(),"%t pRaw_Connection::readBurst\n"); A d=readOne(); R d?gvi(Et,1,d):(A)0; } A pRaw_Connection::readOne(void) { ipcWarn(wrnlvl(),"%t pRaw_Connection::readOne\n"); MSBuffer bbuff; A z; I slen=0,slen1,rlen; if(-1==ioctl(fd(),FIONREAD,&slen)) { // ipcWarn(wrnlvl(),"%t ioctl FIONREAD failed: %s\n", // (errnop); bbuff.maxofbuffer(bbuff.minofbuffer()+slen1); bbuff.reset(); if(0>(rlen=readTheBuffer(&bbuff,slen))) {dc(z);z=(A)0;} else if(0>=bbuff.put()-bbuff.get()) {dc(z);z=(A)0;} else {z->n=z->d[0]=rlen;((C*)z->p)[rlen]='\0';} turnInReadOff(); bbuff.minofbuffer(0); bbuff.maxofbuffer(0); bbuff.reset(); R z; } int pRaw_Connection::send(const A &msg_) { ipcWarn(wrnlvl(),"%t pRaw_Connection::send\n"); if(isInReset()||readChannel()==0) return -1; if(Ct!=msg_->t||1!=msg_->r) R -1; MSBuffer *bp=new MSBuffer(msg_->n); bp->stuff((C*)msg_->p,msg_->n); sendTheBuffer(bp); if (MSFalse==isWritePause()) writeChannel()->enable(); return doWrite(MSFalse); } aplus-fsf-4.22/src/IPC/pRaw_Listener.C0000644000265000001440000000167110772770340013116 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// // // pRaw_Listener // // This class is a sub-class of pA_Listener. // #include #include // M:Callbacks void pRaw_Listener::acceptNotify(int fd_, const struct sockaddr *peername, int peernamelen, const struct sockaddr *sockname, int socknamelen) { ipcWarn(wrnlvl(), "%t pRaw_Listener::acceptNotify: creating connection. fd=%d\n", fd_); pRaw_Connection *ncR=new pRaw_Connection(name(),fd_,acbfunc(), _attrs,_pA_attrs); ncR->initFromListener(); /* next line is just to stop compiler from whining about unused names. */ if(0)ipcWarn(0,"",peername,peernamelen,sockname,socknamelen); } aplus-fsf-4.22/src/IPC/pString_Connection.C0000644000265000001440000002546210774212275014151 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// // // pString_Connection // // This class is subclassed from pA_Connection. It contains the // code for the read and send functions using the `string protocol. // // The `string protocol is to send messages with two parts: the first // part is a four-byte integer of the length of the second part, which // is the contents of the message, as a char string. // #include //#if defined(__edgfe) || defined( __sgi) || defined(_AIX) || defined(SOLARIS_CSET) #include //#endif #include #include static inline void mfbuffer(MSBuffer *bp) { mf((I *)bp->minofbuffer()); bp->minofbuffer(0); } A pString_Connection::getAobjFromBuffer(MSBuffer *bb) { ipcWarn(wrnlvl(),"%t pString_Connection::getAobjFromBuffer\n"); MSBuffer *hb=headBuffer(); MSBuffer *db=readBuffer(); A d,z; I s; if(4>(s=hb->put()-hb->get())) { if(0>bufftobuff(bb,hb,4-s)) R(A)0; if(4>(s=hb->put()-hb->get())) R(A)0; s=longAt(hb->get()); if(0>=s) { static char fmt[]="\343 IPC warning: zero-length message found. s=%d [%d]\n"; Warn(fmt, s,handle()); hb->reset(); turnInReadOff(); R(A)0; } // create read buffer, doubled as A-object char array d=gv(Ct,s); db->minofbuffer((C *)d); db->get(db->minofbuffer()); db->put((C *)(d->p)); db->maxofbuffer(db->put()+s); } if(0>bufftobuff(bb,db,db->maxofbuffer()-db->put())) R(A)0; if(db->put()==db->maxofbuffer()) { z=(A)db->minofbuffer(); hb->reset(); db->minofbuffer(0); db->clear(); return z; } R(A)0; } A pString_Connection::readBurst(void) { ipcWarn(wrnlvl(),"%t pString_Connection::readBurst\n"); MSBuffer bbuff; A d,z=(A)0; I slen=readFileLength(),slen1,n,s,count; if(-1==slen)R(A)0; if(0==slen) { static char fmt[]="\343 IPC warning: pA::ReadBurst: read event with no data [%d]\n"; Warn(fmt, handle()); } /* create buff to hold it. Fill buffer */ slen1=slen?slen:4; bbuff.minofbuffer(mab(slen1)); bbuff.maxofbuffer(bbuff.minofbuffer()+slen1); bbuff.reset(); if(0>(n=readTheBuffer(&bbuff,slen1))) {mfbuffer(&bbuff); R(A)0;} if(0==n&&0==slen) {turnInReadOff(); mfbuffer(&bbuff); R(A)0;} d=getAobjFromBuffer(&bbuff); if((A)0==d){mfbuffer(&bbuff); R(A)0;} // determine how many more complete A-objects lie in bbuff count=1; for(C *cp=bbuff.get();cpp[i]=(I)aplus_nl; int idx=0; z->p[idx++]=(I)d; // retrieve additional A-objects from bbuff, fill in z while(idxp[idx++]=(I)d; } if(idx(slen=hb->put()-hb->get())) { if(0>readTheBuffer(hb,4-slen)) return (A)0; if(4>(slen=hb->put()-hb->get())) return (A)0; slen=longAt(hb->get()); if(0>=slen) { static char fmt[]="\343 IPC warning: zero-length string message. slen=%d [%d]\n"; Warn(fmt, slen,handle()); hb->reset(); turnInReadOff(); return (A)0; } d=gv(Ct,slen); db->minofbuffer((C *)d); db->get(db->minofbuffer()); db->put((C *)(d->p)); db->maxofbuffer(db->put()+slen); } if(0>readTheBuffer(db,db->maxofbuffer()-db->put())) return (A)0; if(db->put()==db->maxofbuffer()) { z=(A)db->minofbuffer(); hb->reset(); db->minofbuffer(0); db->clear(); return z; } return (A)0; } int pString_Connection::send(const A &msg_) { ipcWarn(wrnlvl(),"%t pString_Connection::send\n"); if(isInReset()||readChannel()==0) return -1; if(Ct!=msg_->t) return -1; MSBuffer *sb=new MSBuffer(msg_->n+sizeof(int)); if(NULL==sb) return -1; int msgLen=htonl((int)msg_->n); sb->stuff((char *)(&msgLen),sizeof(int)); sb->stuff((const char *)msg_->p, msg_->n); sendTheBuffer(sb); if (MSFalse==isWritePause()) writeChannel()->enable(); return doWrite(MSFalse); } // M:Syncronous Send and Read #define LOCALCHANENBL(fds,chan) if(chan)Syncfds.fdsset(fds,chan->fd()) #define MAXBUF 256 static C errorMessage[MAXBUF]; static C errorSymbol[MAXBUF]; static const int HeaderLength=4; static A syncErrorResult(const C *sym_, const C *str_) { return gvi(Et,3,gsym("error"),gsym(sym_),gsv(0,str_)); } static I syncFillError(const C *sym, const C *fmt, ...) { va_list ap; strcpy(errorSymbol,sym); va_start(ap, fmt); (void)vsprintf(errorMessage, fmt, ap); va_end(ap); return -1; } /* syncDoWrite * returns -1 on error, 0 if not finished, 1 if finished * Note that, on a return of 0, some messages may have been sent, if * several were queued up. */ I pString_Connection::syncDoWrite(void) { I c,n=0; MSNodeItem *hp=writeList(); MSNodeItem *np; MSBuffer *bp; MSBoolean notdone=MSTrue; ipcWarn(wrnlvl(), "%t pString_Connection::syncDoWrite\n"); /* write queue to write channel */ while(notdone&&(hp!=(np=hp->next()))) { bp=(MSBuffer *)np->data(); c=bp->put()-bp->get(); while(c>0 && 0<(n=bp->write(fd(),c))) c-=n; if(bp->get() == bp->put()) { delete bp;delete np;turnInWriteOff(); } else { notdone=MSFalse;turnInWriteOn(); } if (0 > n) return syncFillError("buffwrite","buffwrite returned error %d",n); } if(hp == hp->next()) return 1; else return 0; } I pString_Connection::syncWriteLoop(struct timeval *pgameover) { I result; int rc; struct timeval timeleft, *tvp; ipcWarn(wrnlvl(), "%t pString_Connection::syncWriteLoop\n"); /* make arguments for select() */ Syncfds.fdszero(Syncfds.w()); Syncfds.fdszero(Syncfds.wa()); LOCALCHANENBL(Syncfds.w(),writeChannel()); if (pgameover != (struct timeval *)0) { tvp=&timeleft; tvdiff(pgameover,tod(),tvp); if (0>tvp->tv_sec) tvp->tv_sec=tvp->tv_usec=0; } else tvp=NULL; for(;;) { Syncfds.fdscopy(Syncfds.w(),Syncfds.wa()); if (((rc = select(Syncfds.size(), NULL, Syncfds.wa(), NULL, tvp)) < 0)) { if (-1==rc && EINTR==errno) result=syncFillError("interrupt","select() received an interrupt"); else result=syncFillError("select", "select() returned error code %d. errno=%d", rc, errno); break; } if (rc) { if (Syncfds.fdsisset(Syncfds.wa(), fd())) { if (result=syncDoWrite()) break; } else { result=syncFillError("fdsisset","unexpected event broke select()"); break; } } /* check for timeout and reset timeleft */ if (NULL != tvp) { tvdiff(pgameover,tod(),tvp); if (0>tvp->tv_sec) tvp->tv_sec=tvp->tv_usec=0; if (0==tvp->tv_sec && 0==tvp->tv_usec) { result=syncFillError("timeout","Syncwrite loop timed out"); break; } } } /* end forever loop */ return result; } I pString_Connection::syncDoRead(A *pdataobj) { I result; MSBuffer *hb=headBuffer(); MSBuffer *db=readBuffer(); ipcWarn(wrnlvl(),"%t pString_Connection::syncDoRead\n"); *pdataobj=readOne(); if(*pdataobj==(A)0) { if(isInReset()) result=syncFillError("reset","Reset occurred. No message read."); else result=0; } else result=1; return result; } A pString_Connection::syncReadLoop(struct timeval *pgameover) { A result=(A)0, dataobj; int rc; struct timeval timeleft, *tvp; ipcWarn(wrnlvl(), "%t pString_Connection::syncReadLoop\n"); /* make arguments for select() */ Syncfds.fdszero(Syncfds.r()); Syncfds.fdszero(Syncfds.ra()); LOCALCHANENBL(Syncfds.r(),readChannel()); if (pgameover != (struct timeval *)0) { tvp=&timeleft; tvdiff(pgameover,tod(),tvp); if (0>tvp->tv_sec) tvp->tv_sec=tvp->tv_usec=0; } else tvp=NULL; for(;;) { Syncfds.fdscopy(Syncfds.r(),Syncfds.ra()); if (((rc = select(Syncfds.size(), Syncfds.ra(), NULL, NULL, tvp)) < 0)) { if (EINTR==errno) syncFillError("interrupt","select() received an interrupt"); else syncFillError("select", "select() returned error code %d. errno=%d", rc, errno); break; } if (rc) { if (Syncfds.fdsisset(Syncfds.ra(), fd())) { rc=syncDoRead(&dataobj); if (0tvp->tv_sec) tvp->tv_sec=tvp->tv_usec=0; if (0==tvp->tv_sec && 0==tvp->tv_usec) { syncFillError("timeout","Syncread loop timed out"); break; } } } /* end for(;;) loop */ return result; } A pString_Connection::syncSendCover(A msg_, A aTimeout) { struct timeval gameover, *tvp; I rc; ipcWarn(wrnlvl(),"%t pString_Connection::syncSend\n"); tvp = atotv(aTimeout, &gameover); if(writeChannel()==0) return syncErrorResult("nochan","channel is null"); /* put stuff on queue */ int dataSize = msg_->n; int bufferSize = HeaderLength +dataSize; int temp = htonl(dataSize); MSBuffer *sb=new MSBuffer( bufferSize); if(NULL==sb) return syncErrorResult("Buffer","new MSBuffer routine failed."); sb->stuff((char *)(&temp), HeaderLength); sb->stuff((const char *)msg_->p, dataSize); sendTheBuffer(sb); /* while loop on select() until timeout or write queue empty */ rc=syncWriteLoop(tvp); if(0>rc) return syncErrorResult(errorSymbol,errorMessage); else return gvi(Et,3,gsym("OK"),gi(rc),writeQueueStatus()); } A pString_Connection::syncReadCover(A aTimeout) { struct timeval gameover, *tvp; A dataobj; ipcWarn(wrnlvl(),"%t pString_Connection::SyncRead\n"); tvp = atotv(aTimeout, &gameover); if(readChannel()==0) return syncErrorResult("nochan","channel is null"); /* while loop on select() until timeout or complete message received */ dataobj=syncReadLoop(tvp); if (dataobj) return gvi(Et,3,gsym("OK"),dataobj,aplus_nl); else return syncErrorResult(errorSymbol, errorMessage); } aplus-fsf-4.22/src/IPC/pString_Listener.C0000644000265000001440000000171510772770341013633 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// // // pString_Listener // // This class is a sub-class of pA_Listener. // #include #include // M:Callbacks void pString_Listener::acceptNotify(int fd_, const struct sockaddr *peername, int peernamelen, const struct sockaddr *sockname, int socknamelen) { ipcWarn(wrnlvl(), "%t pString_Listener::acceptNotify: creating connection. fd=%d\n", fd_); pString_Connection *ncS=new pString_Connection(name(),fd_,acbfunc(), _attrs,_pA_attrs); ncS->initFromListener(); /* next line is just to stop compiler from whining about unused names. */ if(0)ipcWarn(0,"",peername,peernamelen,sockname,socknamelen); } aplus-fsf-4.22/src/IPC/pSimple_Connection.C0000644000265000001440000001165710772770341014136 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// // // pSimple_Connection // // This class is subclassed from pA_Connection. It contains the // code for the read and send functions using the `simple protocol. // // The `simple protocol is to send messages with two parts: the first // part is a four-byte integer of the length of the second part, which // is the contents of the message, as a simple (non-nested) A+ object. // #include #if defined(__edgfe) || defined( __sgi) || defined(_AIX) || defined(SOLARIS_CSET) #include #endif #include #include static inline void mfbuffer(MSBuffer *bp) { mf((I *)bp->minofbuffer()); bp->minofbuffer(0); } A pSimple_Connection::getAobjFromBuffer(MSBuffer *bb) { ipcWarn(wrnlvl(),"%t pSimple_Connection::getAobjFromBuffer\n"); MSBuffer *hb=headBuffer(); MSBuffer *db=readBuffer(); A d,z; I s; if(4>(s=hb->put()-hb->get())) { if(0>bufftobuff(bb,hb,4-s)) R(A)0; if(4>(s=hb->put()-hb->get())) R(A)0; s=longAt(hb->get()); if(0>=s) { static char fmt[]="\343 IPC warning: zero-length message found. s=%d [%d]\n"; Warn(fmt, s,handle()); hb->reset(); turnInReadOff(); R(A)0; } // create read buffer, doubled as A-object char array d=gv(Ct,s); db->minofbuffer((C *)d); db->get(db->minofbuffer()); db->put((C *)(d)); db->maxofbuffer(db->put()+s); } if(0>bufftobuff(bb,db,db->maxofbuffer()-db->put())) R(A)0; if(db->put()==db->maxofbuffer()) { z=(A)db->minofbuffer(); z->c=1; hb->reset(); db->minofbuffer(0); db->clear(); return z; } R(A)0; } A pSimple_Connection::readBurst(void) { ipcWarn(wrnlvl(),"%t pSimple_Connection::readBurst\n"); MSBuffer bbuff; A d,z=(A)0; I slen=readFileLength(),slen1,n,s,count; if(-1==slen)R(A)0; if(0==slen) { static char fmt[]="\343 IPC warning: pA::ReadBurst: read event with no data [%d]\n"; Warn(fmt,handle()); } /* create buff to hold it. Fill buffer */ slen1=slen?slen:4; bbuff.minofbuffer(mab(slen1)); bbuff.maxofbuffer(bbuff.minofbuffer()+slen1); bbuff.reset(); if(0>(n=readTheBuffer(&bbuff,slen1))) {mfbuffer(&bbuff); R(A)0;} if(0==n&&0==slen) {turnInReadOff(); mfbuffer(&bbuff); R(A)0;} d=getAobjFromBuffer(&bbuff); if((A)0==d){mfbuffer(&bbuff); R(A)0;} // determine how many more complete A-objects lie in bbuff count=1; for(C *cp=bbuff.get();cpp[i]=(I)aplus_nl; int idx=0; z->p[idx++]=(I)d; // retrieve additional A-objects from bbuff, fill in z while(idxp[idx++]=(I)d; } if(idx(slen=hb->put()-hb->get())) { if(0>readTheBuffer(hb,4-slen)) return (A)0; if(4>(slen=hb->put()-hb->get())) return (A)0; slen=longAt(hb->get()); if(0>=slen) { static char fmt[]="\343 IPC warning: zero-length simple message. slen=%d [%d]\n"; Warn(fmt, slen,handle()); hb->reset(); turnInReadOff(); return (A)0; } d=gv(Ct,slen); db->minofbuffer((C *)d); db->get(db->minofbuffer()); db->put((C *)(d)); db->maxofbuffer(db->put()+slen); } if(0>readTheBuffer(db,db->maxofbuffer()-db->put())) return (A)0; if(db->put()==db->maxofbuffer()) { z=(A)db->minofbuffer(); z->c=1; hb->reset(); db->minofbuffer(0); db->clear(); return z; } return (A)0; } int pSimple_Connection::send(const A &msg_) { ipcWarn(wrnlvl(),"%t pSimple_Connection::send\n"); if(isInReset()||readChannel()==0) return -1; if(Et<=msg_->t) return -1; long len=AH+Tt(msg_->t,msg_->n)+((Ct==msg_->t)?1:0); MSBuffer *sb=new MSBuffer(len+sizeof(long)); if(NULL==sb) return -1; long msgLen=htonl(len); sb->stuff((char *)(&msgLen),sizeof(long)); sb->stuff((const char *)msg_, len); sendTheBuffer(sb); if (MSFalse==isWritePause()) writeChannel()->enable(); return doWrite(MSFalse); } aplus-fsf-4.22/src/IPC/pSimple_Listener.C0000644000265000001440000000171510772770341013616 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// // // pSimple_Listener // // This class is a sub-class of pA_Listener. // #include #include // M:Callbacks void pSimple_Listener::acceptNotify(int fd_, const struct sockaddr *peername, int peernamelen, const struct sockaddr *sockname, int socknamelen) { ipcWarn(wrnlvl(), "%t pSimple_Listener::acceptNotify: creating connection. fd=%d\n", fd_); pSimple_Connection *ncS=new pSimple_Connection(name(),fd_,acbfunc(), _attrs,_pA_attrs); ncS->initFromListener(); /* next line is just to stop compiler from whining about unused names. */ if(0)ipcWarn(0,"",peername,peernamelen,sockname,socknamelen); } aplus-fsf-4.22/src/IPC/AipcAttributes.H0000644000265000001440000000563510772770341013275 #ifndef __AipcAttributes_H #define __AipcAttributes_H /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include // ACFLAG_ macros are individual bits within the _flagsAttr integer. // Bits equal or below 0x80 are reserved for AipcConnection. Bits // equal or above 0x010000 may be defined and used by subclasses of this // class. #define ACFLAG_NODELAY 0x01 #define ACFLAG_READPAUSE 0x02 #define ACFLAG_WRITEPAUSE 0x04 #define ACFLAG_RETRY 0x08 #define ACFLAG_DEBUG 0x10 class AipcAttributes { protected: static A SetableAttrs; static A NonsetableAttrs; A _clientData; int _flagAttrs; int _readPriority; int _writePriority; int _readBufsize; int _writeBufsize; int _listener; // private methods void init(void); public: // AipcAttributes (Service Control Block) Constructors AipcAttributes(void); AipcAttributes(AipcAttributes &src_); virtual ~AipcAttributes(void); // M:Flags void noDelay(MSBoolean b_){if(b_)_flagAttrs|=ACFLAG_NODELAY; else _flagAttrs&=~ACFLAG_NODELAY;} MSBoolean noDelay(void) {R (_flagAttrs&ACFLAG_NODELAY)?MSTrue:MSFalse;} void readPause(MSBoolean b_){if(b_)_flagAttrs|=ACFLAG_READPAUSE; else _flagAttrs&=~ACFLAG_READPAUSE;} MSBoolean readPause(void){R (_flagAttrs&ACFLAG_READPAUSE)?MSTrue:MSFalse;} void writePause(MSBoolean b_){if(b_)_flagAttrs|=ACFLAG_WRITEPAUSE; else _flagAttrs&=~ACFLAG_WRITEPAUSE;} MSBoolean writePause(void){R (_flagAttrs&ACFLAG_WRITEPAUSE)?MSTrue:MSFalse;} void retry(MSBoolean b_){if(b_)_flagAttrs|=ACFLAG_RETRY; else _flagAttrs&=~ACFLAG_RETRY;} MSBoolean retry(void){R (_flagAttrs&ACFLAG_RETRY)?MSTrue:MSFalse;} void debug(MSBoolean b_){if(b_)_flagAttrs|=ACFLAG_DEBUG; else _flagAttrs&=~ACFLAG_DEBUG;} MSBoolean debug(void){R (_flagAttrs&ACFLAG_DEBUG)?MSTrue:MSFalse;} // M:Other Attributes void readPriority(int val_){_readPriority=val_;} int readPriority(void){return _readPriority;} void writePriority(int val_){_writePriority=val_;} int writePriority(void){return _writePriority;} void readBufsize(int val_){_readBufsize=val_;} int readBufsize(void){return _readBufsize;} void writeBufsize(int val_){_writeBufsize=val_;} int writeBufsize(void){return _writeBufsize;} void clientData(A aobj_){dc(_clientData);_clientData=aobj_;} A clientData(void){return _clientData;} void listener(int val_){_listener=val_;} int listener(void){return _listener;} // M:Attribute interface A setableAttrs(void){R SetableAttrs;} A nonsetableAttrs(void){R NonsetableAttrs;} int setAttrIndex(C *attr_); int nonsetAttrIndex(C *attr_); }; #endif aplus-fsf-4.22/src/IPC/AipcConnection.H0000644000265000001440000000712210772770341013237 #ifndef __AipcConnection_H #define __AipcConnection_H /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #if defined(_AIX) #include #endif #include #include #include #include class AipcConnection : public MSProtocolConnection, public AipcService { public: static I ServiceType; protected: AipcAttributes _attrs; // subroutine methods void init(void); void initAttrs(void); int readFileLength(void); public: // AipcConnection (Service Control Block) Constructors; AipcConnection(C *name_,C *host_,I port_,A cbfunc_); AipcConnection(C *name_, A cbfunc_); AipcConnection(AipcHostPortProtocol &ahpp_, A cbfunc_); AipcConnection(C *name_,int fd_, A cbfunc_,AipcAttributes &attrs_); virtual ~AipcConnection(void); // M:Flags; void turnNoDelayOn(void); void turnNoDelayOff(void); MSBoolean isNoDelay(void) {return _attrs.noDelay();} void turnInReadOn(void) {set(MSProtocolConnection::Read);} void turnInReadOff(void) {unset(MSProtocolConnection::Read);} MSBoolean isInRead(void) {return isSet(MSProtocolConnection::Read);} void turnInWriteOn(void) {set(MSProtocolConnection::Write);} void turnInWriteOff(void) {unset(MSProtocolConnection::Write);} MSBoolean isInWrite(void) {return isSet(MSProtocolConnection::Write);} void turnReadPauseOn(void); void turnReadPauseOff(void); MSBoolean isReadPause(void) { return isSet(MSProtocolConnection::ReadPause);} void turnWritePauseOn(void); void turnWritePauseOff(void); MSBoolean isWritePause(void) { return isSet(MSProtocolConnection::WritePause);} void turnRetryOn(void) {_retry=MSConnection::Yes;} void turnRetryOff(void) {_retry=MSConnection::No;} MSBoolean isRetry(void) {return (MSConnection::Yes==_retry)?MSTrue:MSFalse;} void turnInResetOn(void) {set(MSProtocolConnection::Reset);} void turnInResetOff(void) {unset(MSProtocolConnection::Reset);} MSBoolean isInReset(void) {return isSet(MSProtocolConnection::Reset);} // M:Attribute interface; virtual A setableAttrlist(void); virtual A getableAttrlist(void); virtual MSBoolean setAttr(C *attr_,A aobj); virtual A getAttr(C *attr_); // M:Callbacks; virtual void readNotify(const A&); virtual void doConnect(void); virtual void connectNotify(void); virtual void sentNotify(int); virtual void resetNotify(MSProtocolConnection::State); virtual void resetNotify(const C *errmsg_); virtual void resetWithError(const C *errmsg_){reset();resetNotify(errmsg_);} virtual void resetWithError(State){resetWithError("unknown State");} // M:Other methods; // C *name(void) {return (C*)MSProtocolConnection::name().string();} virtual void initFromListener(void); virtual I serviceType(void) {return AipcConnection::ServiceType;} virtual int send(const A &aobj) { static char fmt[]="this connection does not send\n"; Warn(fmt); return aobj?0:0; } virtual void reset(void); MSBoolean isOpen(void) {return(-1==fd())?MSFalse:MSTrue;} A writeQueueStatus(void); A readQueueStatus(void); // M:Syncronous Send and Read; virtual A syncSendCover(A,A){R aplus_nl;} virtual A syncReadCover(A){R aplus_nl;} virtual A syncTimeout(A){R aplus_nl;} int openSync(int timeout); }; #endif aplus-fsf-4.22/src/IPC/AipcHostPortProtocol.H0000644000265000001440000000223610772770341014445 #ifndef __AipcHostPortProtocol_H #define __AipcHostPortProtocol_H /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include class AipcHostPortProtocol { private: MSHostPort _hostport; MSString _service; MSString _protocol; public: // Constructors AipcHostPortProtocol(C *host_,I port_,C *protocol_=(C*)0) : _hostport(host_,port_) {_protocol=protocol_;_service=0;} AipcHostPortProtocol(C *service_); // Accessors and Mutators const C *protocol(void) {return _protocol.string();} void protocol(C *new_) { _protocol=new_; } const C *service(void) {return _service.string();} void service(C *new_) { _service=new_; } const C *host(void) {return _hostport.host().string();} int port(void) {return _hostport.port();} void setHostPort(C *host_,I port_){_hostport.set(host_,port_);} // Other methods MSBoolean lookupService(void); }; #endif aplus-fsf-4.22/src/IPC/AipcListener.H0000644000265000001440000000310710772770341012724 #ifndef __AipcListener_H #define __AipcListener_H /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #if defined(_AIX) #include #endif #include #include #include #include class AipcListener : public MSProtocolListener, public AipcService { public: static I ServiceType; protected: AipcAttributes _attrs; MSBoolean _zeroPort; // private methods void init(void); public: // AipcListener (Service Control Block) Constructors AipcListener(C *name_,I port_,A cbfunc_); AipcListener(C *name_, A cbfunc_); AipcListener(AipcHostPortProtocol &ahpp_, A cbfunc_); virtual ~AipcListener(void); // M:Attribute interface public: virtual A setableAttrlist(void); virtual A getableAttrlist(void); virtual MSBoolean setAttr(C *attr_,A aobj); virtual A getAttr(C *attr_); // M:Callbacks virtual void acceptNotify(int,const struct sockaddr *,int, const struct sockaddr *,int); // M:Other methods C*name(void) {return (C*)MSProtocolListener::name().string();} virtual I serviceType(void) {return AipcListener::ServiceType;} MSBoolean isOpen(void) {return(-1==fd())?MSFalse:MSTrue;} int getListenPort(void); void open(void); void close(void); }; #endif aplus-fsf-4.22/src/IPC/AipcService.H0000644000265000001440000000361510772770341012543 #ifndef __AipcService_H #define __AipcService_H /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #define AIPC_BMASK 0xff class AipcService { private: static MSNodeItem *Roster; static I HandleSource; MSNodeItem *_node; A _acbfunc; I _handle; MSBoolean _debug; // private methods void init(A cbfunc_); void addToRoster(void); void removeFromRoster(void); public: // AipcService (Service Control Block) Constructors AipcService(A cbfunc_); virtual ~AipcService(void); // Accessors and Mutators A acbfunc(void) { return _acbfunc;} void acbfunc(A _new) { dc(_acbfunc); _acbfunc=(A)ic(_new); } // M:Debug functions void turnDebugOn(void){_debug=MSTrue;} void turnDebugOff(void){_debug=MSFalse;} MSBoolean isDebug(void){return _debug;} int wrnlvl(void){return _debug?-1:1;} // M:Handle functions virtual I serviceType(void) {return 0;} virtual I handle(void) { return _handle; } MSBoolean ValidateHandle(I handle_); MSBoolean ValidateHandle(void){return ValidateHandle(handle());} static AipcService *lookup(I handle_); static AipcService *lookup(I handle_,I serviceType_); static A roster(void); // M:Other methods virtual void ACallback(const C *event_,A data_=aplus_nl); virtual void serviceErrorNotify(const C *msg_); virtual const C *protocol(void){ return "unknown";} }; class AipcNodeItem { public: AipcService *_asptr; I _handle; AipcNodeItem(AipcService *asptr_,I handle_) : _asptr(asptr_), _handle(handle_) {} }; #endif aplus-fsf-4.22/src/IPC/BufferUtilities.H0000644000265000001440000000071210772770341013446 #ifndef __BufferUtilities_H #define __BufferUtilities_H /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// extern int bufftobuff(MSBuffer *sp,MSBuffer *dp,int n); extern MSBuffer *createBufferFromAobj(const A &aobj); #endif aplus-fsf-4.22/src/IPC/IPCUtilities.H0000644000265000001440000000174110772770341012653 #ifndef __IPCUtilities_H #define __IPCUtilities_H /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #if !defined(__cfront) #include #endif extern void ipcWarn(int warnLevel_, const C *fmt_, ...); extern I longAt(C *c); extern I shortAt(C *c); extern struct timeval *atotv(A aobj, struct timeval *tvp); extern A getAbsoluteTimeout(A aobj_); // M:Attribute interface #define ItCHK(aval) if (It!=aval->t||1!=aval->n||0>(ival=*aval->p)) \ return MSFalse; #define RtCHK(aval,range) ItCHK(aval); if(range #include #include #define TIMR_ABSOLUTE 0x01 class TimrConnection : public AipcService { public: static I ServiceType; enum OnExpire{Destroy=0, Restart, Hold, Interval}; protected: static A SetableAttrs; static A NonsetableAttrs; static S OnExpireSymbols[10]; static MSBoolean StaticsInitialized; protected: MSTimer *_timer; A _aExpiry; int _secs; int _usecs; int _flags; S _eventSymbol; A _aEventData; OnExpire _onExpire; public: // TimrConnection Constructors and Destructor TimrConnection(A aTimeout_, A cbfunc_); virtual ~TimrConnection(void); private: void init(A aTimeout_); void initStatics(void); protected: void goOff(void); // M:Flags MSBoolean isPending(void){return (_timer==0)?MSFalse:MSTrue;} void turnAbsoluteOn(void){_flags |= TIMR_ABSOLUTE;} void turnAbsoluteOff(void){_flags &= ~TIMR_ABSOLUTE;} MSBoolean isAbsolute(void){return (_flags&TIMR_ABSOLUTE)?MSTrue:MSFalse;} MSBoolean setOnExpire(A aOnExpire); A getOnExpire(void); MSBoolean setExpiry(A newExpiry_); A getExpiry(void){return(A)ic(_aExpiry);} MSBoolean setEventSymbol(A newEventSymbol_); A getEventSymbol(void); MSBoolean setEventData(A newEventData_); A getEventData(void){return(A)ic(_aEventData);} public: void close(void); void open(void); // M: from AipcAttributes; protected: A timrSetableAttrs(void){return SetableAttrs;} A timrNonsetableAttrs(void){return NonsetableAttrs;} int timrSetAttrIndex(C *attr_); int timrNonsetAttrIndex(C *attr_); // M:Attribute interface; public: A setableAttrlist(void); A getableAttrlist(void); MSBoolean setAttr(C *attr_,A aobj); A getAttr(C *attr_); // M:Other methods virtual I serviceType(void) {return TimrConnection::ServiceType;} virtual const C *protocol(void){ return _eventSymbol->n;} }; #endif aplus-fsf-4.22/src/IPC/pA_Attributes.H0000644000265000001440000000216010772770341013106 #ifndef __pA_Attributes_H #define __pA_Attributes_H /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #define PAFLAG_BURSTMODE 0x01 class pA_Attributes { protected: static A SetableAttrs; static A NonsetableAttrs; int _pA_flags; // private methods void init(void); public: // AipcAttributes (Service Control Block) Constructors pA_Attributes(void); // M:Flags void burstMode(MSBoolean b_){if(b_)_pA_flags|=PAFLAG_BURSTMODE; else _pA_flags&=~PAFLAG_BURSTMODE;} MSBoolean burstMode(void){ return (_pA_flags&PAFLAG_BURSTMODE)?MSTrue:MSFalse;} // M:Other Attributes // M:Attribute interface A setableAttrs(void){return SetableAttrs;} A nonsetableAttrs(void){return NonsetableAttrs;} int setAttrIndex(C *attr_); int nonsetAttrIndex(C *attr_); }; #endif aplus-fsf-4.22/src/IPC/pA_Connection.H0000644000265000001440000000356210772770341013066 #ifndef __pA_Connection_H #define __pA_Connection_H /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include class pA_Connection : public AipcConnection { protected: static MSFds Syncfds; pA_Attributes _pA_attrs; virtual void doRead(void); virtual A getAobjFromBuffer(MSBuffer *bb); virtual A readBurst(void); virtual A readOne(void); public: // Constructors pA_Connection(C *name_,C *host_,I port_,A cbfunc_) :AipcConnection(name_,host_,port_,cbfunc_){} pA_Connection(C *serviceName_,A cbfunc_) :AipcConnection(serviceName_,cbfunc_){} pA_Connection(AipcHostPortProtocol &ahpp_,A cbfunc_) :AipcConnection(ahpp_,cbfunc_){} pA_Connection(C *name_,int fd_,A cbfunc_, AipcAttributes &attrs_,pA_Attributes &pA_attrs_) : AipcConnection(name_,fd_,cbfunc_,attrs_), _pA_attrs(pA_attrs_) {} // Flags; void turnBurstModeOn(void) {_pA_attrs.burstMode(MSTrue);} void turnBurstModeOff(void) {_pA_attrs.burstMode(MSFalse);} MSBoolean isBurstMode(void) {return _pA_attrs.burstMode();} // M:Attribute interface; virtual A setableAttrlist(void); virtual A getableAttrlist(void); virtual MSBoolean setAttr(C *attr_,A aobj); virtual A getAttr(C *attr_); // Other Methods; virtual int send(const A &); // M:Syncronous Send and Read; protected: I syncDoWrite(void); I syncWriteLoop(struct timeval *pgameover); I syncDoRead(A *paobj); A syncReadLoop(struct timeval *pgameover); public: virtual A syncSendCover(A msg_, A timeout_); virtual A syncReadCover(A timeout_); virtual const C *protocol(void){ return "A";} }; #endif aplus-fsf-4.22/src/IPC/pA_Listener.H0000644000265000001440000000234110772770341012546 #ifndef __pA_Listener_H #define __pA_Listener_H /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include class pA_Listener : public AipcListener { protected: pA_Attributes _pA_attrs; // private methods void init(void); public: // pA_Listener (Service Control Block) Constructors pA_Listener(C *name_,I port_,A cbfunc_) : AipcListener(name_,port_,cbfunc_){} pA_Listener(C *name_, A cbfunc_); pA_Listener(AipcHostPortProtocol &ahpp_, A cbfunc_) : AipcListener(ahpp_,cbfunc_){} // M:Attribute interface public: virtual A setableAttrlist(void); virtual A getableAttrlist(void); virtual MSBoolean setAttr(C *attr_,A aobj); virtual A getAttr(C *attr_); // M:Callbacks virtual void acceptNotify(int,const struct sockaddr *,int, const struct sockaddr *,int); virtual const C *protocol(void){ return "A";} }; #endif aplus-fsf-4.22/src/IPC/pIpc_Connection.H0000644000265000001440000000216610772770342013421 #ifndef __pIpc_Connection_H #define __pIpc_Connection_H /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #define ACFLAG_BURST 0x010000 class pIpc_Connection : public pA_Connection { protected: virtual A readBurst(void); virtual A readOne(void); public: // Constructors pIpc_Connection(C *name_,C *host_,I port_,A cbfunc_) :pA_Connection(name_,host_,port_,cbfunc_){} pIpc_Connection(C *serviceName_,A cbfunc_) :pA_Connection(serviceName_,cbfunc_){} pIpc_Connection(AipcHostPortProtocol &ahpp_,A cbfunc_) :pA_Connection(ahpp_,cbfunc_){} pIpc_Connection(C *name_,int fd_,A cbfunc_, AipcAttributes &attrs_,pA_Attributes &pA_attrs_) : pA_Connection(name_,fd_,cbfunc_,attrs_,pA_attrs_){} // Flags // M:Attribute interface // Other Methods virtual int send(const A &msg_); virtual const C *protocol(void){ return "ipc";} }; #endif aplus-fsf-4.22/src/IPC/pIpc_Listener.H0000644000265000001440000000175610772770342013113 #ifndef __pIpc_Listener_H #define __pIpc_Listener_H /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include class pIpc_Listener : public pA_Listener { protected: public: // pIpc_Listener (Service Control Block) Constructors pIpc_Listener(C *name_,I port_,A cbfunc_) : pA_Listener(name_,port_,cbfunc_){} pIpc_Listener(C *name_, A cbfunc_) : pA_Listener(name_,cbfunc_){} pIpc_Listener(AipcHostPortProtocol &ahpp_, A cbfunc_) : pA_Listener(ahpp_,cbfunc_){} // M:Callbacks virtual void acceptNotify(int,const struct sockaddr *,int, const struct sockaddr *,int); virtual const C *protocol(void){ return "ipc";} }; #endif aplus-fsf-4.22/src/IPC/pRaw_Connection.H0000644000265000001440000000216710772770342013440 #ifndef __pRaw_Connection_H #define __pRaw_Connection_H /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #define ACFLAG_BURST 0x010000 class pRaw_Connection : public pA_Connection { protected: virtual A readBurst(void); virtual A readOne(void); public: // Constructors pRaw_Connection(C *name_,C *host_,I port_,A cbfunc_) :pA_Connection(name_,host_,port_,cbfunc_){} pRaw_Connection(C *serviceName_,A cbfunc_) :pA_Connection(serviceName_,cbfunc_){} pRaw_Connection(AipcHostPortProtocol &ahpp_,A cbfunc_) :pA_Connection(ahpp_,cbfunc_){} pRaw_Connection(C *name_,int fd_,A cbfunc_, AipcAttributes &attrs_,pA_Attributes &pA_attrs_) : pA_Connection(name_,fd_,cbfunc_,attrs_,pA_attrs_) {} // Flags // M:Attribute interface // Other Methods virtual int send(const A &msg_); virtual const C *protocol(void){ return "raw";} }; #endif aplus-fsf-4.22/src/IPC/pRaw_Listener.H0000644000265000001440000000175610772770342013131 #ifndef __pRaw_Listener_H #define __pRaw_Listener_H /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include class pRaw_Listener : public pA_Listener { protected: public: // pRaw_Listener (Service Control Block) Constructors pRaw_Listener(C *name_,I port_,A cbfunc_) : pA_Listener(name_,port_,cbfunc_){} pRaw_Listener(C *name_, A cbfunc_) : pA_Listener(name_,cbfunc_){} pRaw_Listener(AipcHostPortProtocol &ahpp_, A cbfunc_) : pA_Listener(ahpp_,cbfunc_){} // M:Callbacks virtual void acceptNotify(int,const struct sockaddr *,int, const struct sockaddr *,int); virtual const C *protocol(void){ return "raw";} }; #endif aplus-fsf-4.22/src/IPC/pSimple_Connection.H0000644000265000001440000000223510772770342014134 #ifndef __pSimple_Connection_H #define __pSimple_Connection_H /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include class pSimple_Connection : public pA_Connection { protected: virtual A getAobjFromBuffer(MSBuffer *bb); virtual A readBurst(void); virtual A readOne(void); public: // Constructors pSimple_Connection(C *name_,C *host_,I port_,A cbfunc_) :pA_Connection(name_,host_,port_,cbfunc_){} pSimple_Connection(C *serviceName_,A cbfunc_) :pA_Connection(serviceName_,cbfunc_){} pSimple_Connection(AipcHostPortProtocol &ahpp_,A cbfunc_) :pA_Connection(ahpp_,cbfunc_){} pSimple_Connection(C *name_,int fd_,A cbfunc_, AipcAttributes &attrs_,pA_Attributes &pA_attrs_) : pA_Connection(name_,fd_,cbfunc_,attrs_,pA_attrs_) {} // Flags // M:Attribute interface // Other Methods virtual int send(const A &msg_); virtual const C *protocol(void){ return "simple";} }; #endif aplus-fsf-4.22/src/IPC/pSimple_Listener.H0000644000265000001440000000200610772770342013616 #ifndef __pSimple_Listener_H #define __pSimple_Listener_H /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include class pSimple_Listener : public pA_Listener { protected: public: // pSimple_Listener (Service Control Block) Constructors pSimple_Listener(C *name_,I port_,A cbfunc_) : pA_Listener(name_,port_,cbfunc_){} pSimple_Listener(C *name_, A cbfunc_) : pA_Listener(name_,cbfunc_){} pSimple_Listener(AipcHostPortProtocol &ahpp_, A cbfunc_) : pA_Listener(ahpp_,cbfunc_){} // M:Callbacks virtual void acceptNotify(int,const struct sockaddr *,int, const struct sockaddr *,int); virtual const C *protocol(void){ return "simple";} }; #endif aplus-fsf-4.22/src/IPC/pString_Connection.H0000644000265000001440000000271310772770342014152 #ifndef __pString_Connection_H #define __pString_Connection_H /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include class pString_Connection : public pA_Connection { protected: virtual A getAobjFromBuffer(MSBuffer *bb); virtual A readBurst(void); virtual A readOne(void); public: // Constructors pString_Connection(C *name_,C *host_,I port_,A cbfunc_) :pA_Connection(name_,host_,port_,cbfunc_){} pString_Connection(C *serviceName_,A cbfunc_) :pA_Connection(serviceName_,cbfunc_){} pString_Connection(AipcHostPortProtocol &ahpp_,A cbfunc_) :pA_Connection(ahpp_,cbfunc_){} pString_Connection(C *name_,int fd_,A cbfunc_, AipcAttributes &attrs_,pA_Attributes &pA_attrs_) : pA_Connection(name_,fd_,cbfunc_,attrs_,pA_attrs_) {} // Flags // M:Attribute interface // Other Methods virtual int send(const A &msg_); virtual const C *protocol(void){ return "string";} // M:Syncronous Send and Read; protected: I syncDoWrite(void); I syncWriteLoop(struct timeval *pgameover); I syncDoRead(A *paobj); A syncReadLoop(struct timeval *pgameover); // Other Methods public: virtual A syncSendCover(A msg_, A timeout_); virtual A syncReadCover(A timeout_); }; #endif aplus-fsf-4.22/src/IPC/pString_Listener.H0000644000265000001440000000200610772770342013633 #ifndef __pString_Listener_H #define __pString_Listener_H /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include class pString_Listener : public pA_Listener { protected: public: // pString_Listener (Service Control Block) Constructors pString_Listener(C *name_,I port_,A cbfunc_) : pA_Listener(name_,port_,cbfunc_){} pString_Listener(C *name_, A cbfunc_) : pA_Listener(name_,cbfunc_){} pString_Listener(AipcHostPortProtocol &ahpp_, A cbfunc_) : pA_Listener(ahpp_,cbfunc_){} // M:Callbacks virtual void acceptNotify(int,const struct sockaddr *,int, const struct sockaddr *,int); virtual const C *protocol(void){ return "string";} }; #endif aplus-fsf-4.22/src/IPC/idap.+0000644000265000001440000001571410772770342011232 Copyright (c) 1990-2008 Morgan Stanley All rights reserved. See .../src/LICENSE for terms of distribution. $cx adap ltoa{list}:(>list[;0];(list2!list)[;1]) getopt{list;key;default}:if (key0list) keylist else default getretryarg{service}:4if (`retry0sf_alsf service) `retrysf else 1 CBFunctions(); CBHandles0; TweakAArgument{a}:{ newsyms`opened`closed; oldsyms`connected`reset; if((~`syma)(~(0)a)) a else if (anewsyms) oldsyms[newsymsa] else a } ConnectionCallbackPassthru{h;a;d}:{ aTweakAArgument{a}; if (`connecteda) { if (~hadap.CBHandles) { lstni.getattr{h;`listener}; if ((~0lstn)^(~()lstn)) { adap.CBHandlesadap.CBHandles,h; adap.CBFunctionsadap.CBFunctions,adap.CBFunctions[adap.CBHandleslstn]; } else { " Warning `connect event received for an unknown possibly closed handle:",h; (); }; }; }; if (hadap.CBHandles) (adap.CBFunctions[adap.CBHandlesh]){h;a;d} else adap.ConnectCBFunction{h;a;d}; } filterConnectArgs{name;host;port;protocol}:{ if(protocol`RAW) protocol`raw; if(host()) host`localhost; (name;host;port;protocol) } Connect{service_descriptor;callbackfn}:{ servicearg_alsf service_descriptor; hostgetopt{servicearg;`host;`localhost}; portgetopt{servicearg;`port;}; protocolgetopt{servicearg;`protocol;`A}; namegetopt{servicearg;`name;`None}; (name;host;port;protocol)filterConnectArgs{name;host;port;protocol}; adap.ConnectCBFunctioncallbackfn; if(()port) { if(^/`name`protocol0servicearg) { hi.connectNP{adap.ConnectionCallbackPassthru;name;protocol}; } else if (`name0servicearg) { hi.connectN{adap.ConnectionCallbackPassthru;name} } else h1; } else { hi.connectNHPP{adap.ConnectionCallbackPassthru;name;host;port;protocol} }; if(1h) { adap.CBHandlesadap.CBHandles,h; adap.CBFunctionsadap.CBFunctions,<{callbackfn}; i.open h; }; h } SyncConnect{service_descriptor;callbackfn}:{ if (`null=_nc{`i;`openSync}) "This build of a+/adap does not support adap.SyncConnect"; servicearg_alsf service_descriptor; hostgetopt{servicearg;`host;`localhost}; portgetopt{servicearg;`port;}; timeout getopt{servicearg;`timeout;5}; protocolgetopt{servicearg;`protocol;`A}; namegetopt{servicearg;`name;`None}; (name;host;port;protocol)filterConnectArgs{name;host;port;protocol}; adap.ConnectCBFunctioncallbackfn; if(()port) { if(^/`name`protocol0servicearg) { hi.connectNP{adap.ConnectionCallbackPassthru;name;protocol}; } else if (`name0servicearg) { hi.connectN{adap.ConnectionCallbackPassthru;name} } else h1; } else { hi.connectNHPP{adap.ConnectionCallbackPassthru;name;host;port;protocol} }; if(1h) { adap.CBHandlesadap.CBHandles,h; adap.CBFunctionsadap.CBFunctions,<{callbackfn}; conn i.openSync{h;timeout}; if (conn0) { " Error: adap.SyncConnect failed after",(,timeout)," secs";0}; }; h } Listen{service_descriptor;callbackfn}:{ servicearg_alsf service_descriptor; retryarggetopt{servicearg;`retry;1}; portgetopt{servicearg;`port;}; protocolgetopt{servicearg;`protocol;`A}; namegetopt{servicearg;`name;`None}; (name;junk;port;protocol)filterConnectArgs{name;`localhost;port;protocol}; adap.ConnectCBFunctioncallbackfn; if(()port) { if(^/`name`protocol0servicearg) { hi.listenNP{adap.ConnectionCallbackPassthru;name;protocol}; } else if (`name0servicearg) { hi.listenN{adap.ConnectionCallbackPassthru;name} } else h1; } else { hi.listenNPP{adap.ConnectionCallbackPassthru;name;port;protocol} }; hi.listenNPP{adap.ConnectionCallbackPassthru;name;port;protocol}; if(1h) { i.setattr{h;`retry;retryarg}; adap.CBHandlesadap.CBHandles,h; adap.CBFunctionsadap.CBFunctions,<{callbackfn}; i.open h; }; h } Export a:if(()asys.exp{a}){''} else {a} Import a:if(()asys.imp{a}){''} else {a} adap.SyncXch{h;outgoing;to}:{ timeout to; if ((()timeout)^~()to) `domain; readPausei.getattr{h;`readPause}; if(readPause=0) i.setattr{h;`readPause;1}; resi.syncsend{h;outgoing;timeout}; if(`error0res) { if(readPause=0) i.setattr{h;`readPause;readPause}; res,<`send; }; resi.syncread{h;timeout}; if(readPause=0) i.setattr{h;`readPause;readPause}; if(`error0res) res,<`read; 0 1#res } WriteQueueStatus{h}:{i.getattr{h;`writeStatus}} ReadQueueStatus{h}:{i.getattr{h;`readStatus}} xfs functions SetDebug{h;val}: i.setdebug{h;val} Debug{val}: i.debug{val} Reset{h}: i.close{h} Send{h;msg}: i.send{h;msg} TimerCallbackPassthru{h;a;d}:{ if(~()ddi.getattr{h;`expiry}) ddd; if(hadap.CBHandles) { idxadap.CBHandlesh; (adap.CBFunctions[idx]){h;a;d}; idxadap.CBHandlesh; recalc idx if CB does adap.close{} if( idx<#adap.CBHandles ) { b(#adap.CBHandles)1; b[idx]0; adap.CBFunctionsb/adap.CBFunctions; adap.CBHandlesb/adap.CBHandles; }; } else { adap.TimerCBFunction{h;a;d};} } SetTimer{name;callbackfn;secs}:{ adap.TimerCBFunctioncallbackfn; hi.timer{TimerCallbackPassthru;secs}; i.setattr{h;`eventSymbol;name}; if(1h) { adap.CBHandlesadap.CBHandles,h; adap.CBFunctionsadap.CBFunctions,<{callbackfn}; i.open h; }; h } Close{h}: { zi.destroy{h}; if(0badap.CBHandlesh) { adap.CBFunctionsb/adap.CBFunctions; adap.CBHandlesb/adap.CBHandles; }; z } SetClientData{h;val}: { attr`clientData`eventData[`timer0#i.whatis{h}]; i.setattr{h;attr;val} } ModifyTimer{h;name;secs}:{ if(()zi.getattr{h;`pending}) z1; Invalid Handle if(z=1) i.close h; if(z1) zi.setattr{h;`eventSymbol;name}; if(z1) zi.setattr{h;`expiry;secs}; if(z1) zi.open{h}; z } GetClientData{h}:{ attr`clientData`eventData[`timer0#i.whatis{h}]; i.getattr{h;attr} } Syncread{h;timeout}: i.syncread{h;timeout} Syncsend{h;msg;timeout}: i.syncsend{h;msg;timeout} Getfd{h}: i.getattr{h;`fd} GetTimeout{timeout}: i.timeout{timeout} GetPort{h}: i.getattr{h;`port} ATTRMAT2!(`rPriority `readPriority `wPriority `writePriority `rQueueStatus `readStatus `wQueueStatus `writeStatus `rPause `readPause `wPause `writePause `rBufsize `readBufsize `wBufsize `writeBufsize `rEventMode `burstMode `wNoDelay `noDelay) adap2ipc{attr}:if((#ATTRMAT)>idxATTRMAT[;0]attr) ATTRMAT[idx;1] else attr Of{h;arg}:{ zif (`listarg) i.attrs{h} else i.getattr{h;adap2ipc arg}; if((`rEventModearg)^(z0)z1)z`single`burst[z]; z } setattrCover{h;arg;val}:{ if(`rEventModearg)valval`burst; i.setattr{h;adap2ipc arg;val} } Has{h;arg}:{ sf_alsf arg; (i#0sf) do setattrCover{h;i0sf;i1sf}; } GetTickProto{}: i.getTickProto{} SetTickProto{val}: i.setTickProto{val} SetTickDebug{val}: i.setTickDebug{val} enqueue{h;msg}: if(`null=_nc{`i;`enqueue}) 1 else i.enqueue{h;msg} bufferCount{h}: if(`null=_nc{`i;`bufferCount}) 1 else i.bufferCount{h} aplus-fsf-4.22/src/IPC/adap.+0000644000265000001440000000031410772770342011210 Copyright (c) 1990-2008 Morgan Stanley All rights reserved. See .../src/LICENSE for terms of distribution. This file is just to protect people who unnecessarily do $load adap. $load idap aplus-fsf-4.22/src/cxs/0000777000265000001440000000000010774512564010501 5aplus-fsf-4.22/src/cxs/Makefile.am0000444000265000001440000000142407400252406012434 ## Process this file with automake to produce Makefile.in ############################################################################### ## ## ## Copyright (c) 2001 Morgan Stanley Dean Witter & Co. All rights reserved. ## ## See .../src/LICENSE for terms of distribution. ## ## ## ## ## ############################################################################### lib_LTLIBRARIES = libcxs.la libcxs_la_SOURCES = S.c INCLUDES = -I.. sdir = $(libdir) s_DATA = disp.+ s.+ bigs.+ EXTRA_DIST = disp.+ s.+ bigs.+ aplus-fsf-4.22/src/cxs/Makefile.in0000644000265000001440000002547310774512522012467 # Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ ############################################################################### ############################################################################### SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CXX = @CXX@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ STRIP = @STRIP@ VERSION = @VERSION@ X_INCLUDES = @X_INCLUDES@ X_LIBS = @X_LIBS@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ lib_LTLIBRARIES = libcxs.la libcxs_la_SOURCES = S.c INCLUDES = -I.. sdir = $(libdir) s_DATA = disp.+ s.+ bigs.+ EXTRA_DIST = disp.+ s.+ bigs.+ subdir = src/cxs mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_CLEAN_FILES = LTLIBRARIES = $(lib_LTLIBRARIES) libcxs_la_LDFLAGS = libcxs_la_LIBADD = am_libcxs_la_OBJECTS = S.lo libcxs_la_OBJECTS = $(am_libcxs_la_OBJECTS) DEFS = @DEFS@ DEFAULT_INCLUDES = -I. -I$(srcdir) CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/S.Plo COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ CFLAGS = @CFLAGS@ DIST_SOURCES = $(libcxs_la_SOURCES) DATA = $(s_DATA) DIST_COMMON = Makefile.am Makefile.in SOURCES = $(libcxs_la_SOURCES) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/cxs/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) libLTLIBRARIES_INSTALL = $(INSTALL) install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(libdir) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f"; \ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p"; \ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test -z "$dir" && dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libcxs.la: $(libcxs_la_OBJECTS) $(libcxs_la_DEPENDENCIES) $(LINK) -rpath $(libdir) $(libcxs_la_LDFLAGS) $(libcxs_la_OBJECTS) $(libcxs_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/S.Plo@am__quote@ distclean-depend: -rm -rf ./$(DEPDIR) .c.o: @AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< .c.obj: @AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(COMPILE) -c `cygpath -w $<` .c.lo: @AMDEP_TRUE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< CCDEPMODE = @CCDEPMODE@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: sDATA_INSTALL = $(INSTALL_DATA) install-sDATA: $(s_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(sdir) @list='$(s_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(sDATA_INSTALL) $$d$$p $(DESTDIR)$(sdir)/$$f"; \ $(sDATA_INSTALL) $$d$$p $(DESTDIR)$(sdir)/$$f; \ done uninstall-sDATA: @$(NORMAL_UNINSTALL) @list='$(s_DATA)'; for p in $$list; do \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " rm -f $(DESTDIR)$(sdir)/$$f"; \ rm -f $(DESTDIR)$(sdir)/$$f; \ done ETAGS = etags ETAGSFLAGS = tags: TAGS 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; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ 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; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = ../.. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(DATA) installdirs: $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(sdir) 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_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_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-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-compile distclean-depend \ distclean-generic distclean-libtool distclean-tags dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-sDATA install-exec-am: install-libLTLIBRARIES install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES uninstall-sDATA .PHONY: GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool distclean distclean-compile \ distclean-depend distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am info info-am install \ install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am \ install-libLTLIBRARIES install-man install-sDATA install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool tags uninstall \ uninstall-am uninstall-info-am uninstall-libLTLIBRARIES \ uninstall-sDATA # 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: aplus-fsf-4.22/src/cxs/S.c0000644000265000001440000000160210772770342010760 /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved. */ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #include #include #include /* external function definitions */ void sInstall() { char *atree; char *sfile; if ((atree = getenv("ATREE")) == (char *)(0)) { atree = "/usr/local/a+"; } sfile = bnstring(atree, "/lib/s.+", (char *)(0)); loadafile(sfile,0); bfree(sfile); return; } aplus-fsf-4.22/src/cxs/disp.+0000644000265000001440000001236110772770342011431 Copyright (c) 1990-2008 Morgan Stanley All rights reserved. See .../src/LICENSE for terms of distribution. $cx disp Remove blank columns slice{x}:(~^/x=' ')/@1 x Center array x in y positions center{y;x}:if (y#x) x else (-.5y-#x)yx Determine matching initial sub-arrays and elide up to the first non-match same{x}: { if ((~SAME)0x) (x;0); (x;z) (#x z0) do if (^/x@(1+#x)0#x) {x0#x;zz+1} else (x;z) } ,@y / x idiom encat{y;x}:if (0=x) x else 0#@y x) do zz,@y >(i+1)#@y x Convert simple character array to character matrix with traditional APL inter-array spacing rank2{x}:if (0x) (((1Ӣ1+#x)0),0)' ' else (02-#x)zrank2_{x} rank2_{x}: { case (#x) { 0; 1 1x; 1; (1,#x)x; 2; x; & !@3 x,@2 ' ' } } Optional _fmt{} formatter quadFmt{x}: { case (x) { `int; if (0<#INT) _fmt{INT;x} else 1@1 x; `float; if (0<#FLOAT) _fmt{FLOAT;x} else 1@1 x; x } } Generate displays for simple character, integer, and float arrays char{x}:{(a;b)same{x};frame{rank2{a};x;'"';b}} int{x}:{(a;b)same{x};frame{rank2{if (IOTA) iota{a;''} else quadFmt{a}};x;'i';b}} float{x}:{(a;b)same{x};frame{rank2{if (IOTA) iota{a;'1.0'} else quadFmt{a}};x;'f';b}} iota{x;y}: { if ((,0)nx) y,'00' else if (0n) y,'0' else if (0=#n) y,1x else if (3>#v,x) y,1v else if (~xi+(jv[1]-iv[0])nx) y,1v else y,(if (i=0) '' else (1i),'+'),(if (j=1) '' else (1j),''),'',1n } Generate display for arrays of type symbol sym{x}:if (0ҡx; r(x)(1x)//@1s[;;0]; c(x)(#x)//s[;;1]; if (VER) xcenter{r;x} else xr١x; if (HOR) xcenter@1{1+c;x} else x(1+c)@1x; <1@1>encat{x;encat@1{1;x}} } Generate display for nested array box{x}: { (a;b)same{x}; zdisp{a}; zif (0=#z) >z else rank2{>(/>#z)١(/,>1աҡz)@1z} z,plane @2{z} if (1=#z) z(1,#z)z; frame{z;x;(`sym `box `funcɩx)#'`';b} } Generate display for null array null{x}:frame{0 0' ';x;'';0} Generate display for function array func{x}:if ((0#x)0i#a;i}; if (0(1+#a)#a}; zlabel{z;typ;1+#z;r}; (isam) do zif (ii#a;i} else label{z;'';0;r+#>i#a} }; z } Main disp{x}:((x)FUNCS)x lay{x}:if (TREE>0) tree{(Leaf1{disp}){,x}} else disp{x} tree diagrammer (f Leaf1)r:if (0=r)f r else f &r tree{x}:if (TREE=2) branch{(Leaf1{leaf}){x}} else top{branch2{(Leaf1{leaf2}){x}}} top{x}:x if (1b bI=(HOR(;0))#x) ((HOR(b/HOR#x;0))#x)HOR#LI,TI leaf{x}: { x(21 1,x)x; xV,@1(H,x,H),@1 V; x[0;0,1+1x](HOR#TI,LI),TR; x[1+#x;0,1+1x]BL,BR; x } branch{x}: { if (0=x) x else { if (1d0<ؽx,x) (d/x)&{d/x}; cHOR;ec#1 9;fc#9 1;dc2; x((c#ҡx)@f(#x)1 functional attributes **** reportStyleFunc - ret_flat_scalar_client{} commented out **** add scrollfg, and filter out inherited from state **** array scrollsize: make v and h same size **** if multiple servers, s.WS must be a vector **** arrowkey callback on f5-f8 - replace with shift-arrow callbacks **** filter_default_tablist{}: g_widgetOrder instead of g_varWid **** implement `cols for hmenu and vmenu **** implement `rows for hmenu, vmenu, choice **** or (nuc): `majororder;(`row/`col;n) (default = () (`col;1) **** `auto-x: 1 or 0 if (`null_nc{`s;`SERVER}) { ' S already $loaded'; _abortload{}; }; $cx s functions{}: { cx_gsv{`cx}; cx,'.iss.is'; cx,'.frees.free'; cx,'.shows.show'; cx,'.hides.hide'; cx,'.ofs.of'; cx,'.hass.has'; } *** Basic S functions is{s;c}: is_object{s;c} free{s}: free_from_use@0{q_n{free_instance{s;}}} show{s}: show_id{new_widget{new_symbol{s;;1}}} hide{s}: if (0widwidget{s}) hide_id{wid} of{r;s}: of_result{get{cx;var;id;cls;r;1};rnk;shp;dep} (cx;var;id;cls;r;rnk;shp;dep)of_arguments{r;s} has{s;o}: cxvar set{cx;var;id;cls;r;v;1} (cx;var;id;cls;r;v)has_arguments{s;o} .isis .freefree .showshow .hidehide .ofof .hashas *** are{} are{x;y}: { s.ARE(;); if (`null=x) (); if (`symy) print_abort{;;'invalid right argument to are{}'}; if (`symx) print_abort{;;'invalid left argument to are{}'}; lacase (#x) { 0; ,ab (a;b)c_c{x}; 1; a[;0]a[;1] ac_c@0{x}; 2; x[;0]x[;1]; print_abort{;;'invalid left argument to are{}'}; }; ra(#x)y; s.ARE(la;ۡra); zis_object@0 0{la;ra}; s.ARE(;); z } *** Copy copy{fr;to}: { if ((0=#fr)0=#to) (); (fcx;fvar)c_c{'',fr}; frfcxfvar; tvarsif (2=#to) to else c_c@0{,to}; totvars[;0]tvars[;1]; if (~_nc{fcx;fvar}`vars `deps) print_abort{fcx;fvar;'not a variable'}; if (~G_bound{fr}) print_abort{fcx;fvar;'not bound'}; tnc_nc@0{tvars[;0];tvars[;1]}; if (~^/tnc`vars `deps `null) print_abort{fcx;fvar;'bad target variable(s)'}; (i#j(tnc=`null)/#tnc) do (%j[i]#to)fcx%fvar; sfG_settings{fr;}; has@0 1{to;sf} } *** in/out functions for tio, dio, qio in{s;d;i;p;c;v}: { case (flat_super{0of{,`class;c,v}}) { `scalar `hscale `vscale; in_scalar{s;d;i;p;c;v}; `array `tableField `matrix; in_array{s;d;i;p;c;v}; `slot; in_slot{s;d;i;p;c;v}; } } out{s;d;i;p;c;v}: { case (flat_super{0of{,`class;c,v}}) { `scalar `hscale `vscale; out_scalar{s;d;i;p;c;v}; `array `tableField `matrix; out_array{s;d;i;p;c;v}; `slot; out_slot{s;d;i;p;c;v}; } } in_scalar{s;d;i;p;c;v}: { (rc;za)do s{(d;(c,v) _get `s.io)}; if (0=rc) z (c,v) _set (`s.io;a) (z;a)za } out_scalar{s;d;i;p;c;v}:s{(d;(c,v) _get `s.io)} in_array{s;d;i;p;c;v}: { if (()a(c,v) _get `s.io) a(c%v)<(); gGf{1}; (rc;za)do s{(d;>i#a)}; Gf{g}; if (0=rc) z (c,v) _set (`s.io;a) (i#a)i#a)}) z else s{d}; Gf{g}; z } in_slot{s;d;i;p;c;v}: { if (()a(c,v) _get `s.io) a(#0c%v)a; j(0c%v)p; (rc;za)do s{(d;ja)}; if (0=rc) z (c,v) _set (`s.io;a) (ja)b (z;b)za } out_slot{s;d;i;p;c;v}:if (()a a(c,v) _get `s.io) s{d} else s{(d;>((0c%v)p)#a)} *** "of"/"has" argument/result processors of_result{z;rnk;shp;dep}:if ((OF=1)dep>0) z else shpz of_arguments{r;s}: { if (`syms) print_abort{;;'right argument to of{} must be symbolic'}; if (~((ayby) has_default_value{cls;k;b/by} z[,]kb/bx; if (clsprimitives{}) (%ro)_get{ro;`s.reference_data} ro`sreference_object{cls}; (cls;q_n{c_c{vars}}; z(); (i#vars) do { vi#vars; zz,b/cv) bb/b/atx; zzzz,if (1b b~b) if (1bb((b/cv)b/cv) bb/b/atx; zz }; }; z } attributesOfClass{vars;cls}:((q_n{c_c{vars}})/(1ءofClass{atts;cls} shells{}: shell_objects{is_shell} popups{}: shell_objects{bIsPopup} toplevels{}: shell_objects{bIsTopLevel} subClasses{x}: if (0<#cs((iCLASSESc) sym_sort{iATTRIBUTES} properties{x}: sym_sort{editable_attributes{class_of_symbol{x;0}}} objects{}: sym_sort{q_n{(~SYMBOLSreference_objects{})/SYMBOLS}} beep{s}: if (`null_nc{`s;`SERVER}) if (0#1z)/z (1z)1z z_alsf{resetDefaults{classes{}}} which{sf}: (of{(<,r);obs}(b/c),b/s b0<>#s *** Scroll group presets new_old{s;d;i;p;c;v}: { newoldif (`vars=_nc{c;v}) c%v; if ((i())^p()) newd else if (i()) (pnew)d else if (`int=i) (i#,pnew)d else if (10=0do (i#pnew)d) (pnew)[,]d; (cnew;cold) } vScroll{s;d;i;p;c;v}:d scroll_group{s;d;i;p;c;v;`setrow`setfirstrow`vscrollwith} hScroll{s;d;i;p;c;v}:d scroll_group{s;d;i;p;c;v;`setcol`setfirstcol`hscrollwith} scroll_group{s;d;i;p;c;v;atts}: { (it;fit;grp)atts; (new;old)new_old{s;d;i;p;c;v}; if (~(^/newold)^^/oldnew) { (j#sub(~oldnew)/old) do has{j#sub;(grp;;it;0;fit;0)}; (j#add(~newold)/new) do has{j#add;(grp;(newj#add)/new;it;1;fit;1)}; (j#upd(newold)/new) do has{j#upd;(grp;(newj#upd)/new)}; }; } *** "free" subfunctions free_if{cx;var;vars}: { if (0=#vars) 0 2() else { symsmatrify{c_v{cx;_flat{vars}}}; if (~1b0widget@1{syms}) 0 2() else free_instance{<@1b/syms;nar)/nar; if (0=#nar) (); hlg_shadowThickness{wid}; if (~abflag) { (fw;fh)grflag(g_width;g_height); (fp;fq)grflag(g_y;g_x); xs0; yhl; (i#nar) do { xhl; ysy; (j#itm,inar) do { cidbe_container_child{cx;var;j#itm;wid;grflagy,x;`yx;1}; xx+fw{cid}; ysysfh{cid}+fp{cid}; xsxsfw{cid}+fq{cid}; }; yys; }; (ys;xs)grflaghl+ys,xs; } else { print_alert{cx;var;'"autobuild" is on'}; (ul;xt;yx)trim_coordinates{>,where_widgets{wids}}; (i#nar) do if (0<#itm,inar) (j#itm) do be_container_child{cx;var;j#itm;wid;hl+(i;0 1)#yx;`yx;1}; (ys;xs)xt+2hl; if (zero_parent{wid}) S_yx{g_topLevel{wid};0(2ul)-hl} }; s_height{wid;ys}; s_width{wid;xs}; }; } be_layout_parent{cx;var;nar;wid;pflag}: { if (0nar) (); (rc;fnar)do _flat{nar}; if (0fnar) (); if ((`symfnar)rc0) { free_instance{cx,var;}; print_abort{cx;var;'atoms of a ',(,g_varClass{cx,var}),' must be symbols'}; }; widswidget@1{c_v{cx;_flat{nar}}}; sflag(1#nar)^0=nar; abflag(1=pflag)^G_containerBuild{wid}; apflagpflagG_containerPosition{wid}; if (sflag^~abflagapflag) (i#nar,nar) do be_container_child{cx;var;i#nar;wid;1 1 1 1;`at;0} else { if (~abflag) if (sflag) narۡnar; if ((2=#nar)^0,where_widgets{wids}}; yx[;0 2]sticky_grid{yx[;0];yx[;2];xt[0]}; yx[;1 3]sticky_grid{yx[;1];yx[;3];xt[1]}; (i#nar,nar) do if (0<#itm,inar) (j#itm) do be_container_child{cx;var;j#itm;wid;i#yx;`at;0}; if (zero_parent{wid}) S_yx{g_topLevel{wid};0(2ul)-SHELL_TITLE_SPACE,0} }; }; } be_notebook_parent{cx;var;nar;wid}: { if (0nar) (); (rc;fnar)do _flat{nar}; if (0fnar) (); if ((`symfnar)rc0) { free_instance{cx,var;}; print_abort{cx;var;'atoms of a ',(,g_varClass{cx,var}),' must be symbols'}; }; nar_flat{nar}; (i#nar) do be_notebook_child{cx;var;i#nar;wid}; widswidget@1{c_v{cx;nar}}; bNotebookPermute{g_varWid{cx,var};wids}; } be_child{cx;cvar;wid}: { if (0=idg_varWid{cx,cvar}) g_varWid{be_child_undefined{pcx;pvar;cx;cvar;wid}} (pcx;pvar)g_data{wid} else if (~idwid,G_ancestors{wid}) id else print_abort{cx;cvar;'circularity detected - object freed'} free{cx,cvar} } index_map{y;x}:if (~xy) if (0,y1) <(y)b0 else (k#z z,y) do if (~()r r&{>k#z}) (<(y)k),r else `pick index_pick{y;x}:if (0=y) (index_map{y;x};) else (i;p) ipm ppick_vec{m} mindex_map{y;x} safe_ip{cx;var;x0;x1}: { gGf{1}; valcx%var; z if (0=rc (rc;z)do index_pick{val;x0}) z else if (0=rc (rc;z)do index_pick{val;x1}) z else print_abort{cx;var;'child symbol not found in container'}; Gf{g}; z } be_child_undefined{pcx;pvar;cx;cvar;wid}: { (fn;s)2G_be{pcx,pvar}; if (`null=fn) is_object_0{cx;cvar;wid;class_of_symbol{cx,cvar;1};SHELL} else q_n{apply{fn;(s;cxcvar;i;p;pcx;pvar)}} (i;p)safe_ip{pcx;pvar;cvar;cxcvar} } be_container_child{cx;var;cvar;wid;ext;att;mf}: { if (cvar=`) (); (cx;cvar)c_v{cx;cvar}; free_if_undefined{cx;var;cvar}; cidbe_child{cx;cvar;wid}; idre_parent{cx;cvar;cid;wid}; if (~^/ext=1) { if (mf) if (~bBeenMapped{cid}) bMap{cid}; if(~()att) set_attributes{cx;cvar;id;g_varClass{cx,cvar};,att;,g_notebookPageTitle{wid;cwid}) { t>`title of cx,cvar; if (validate_title{t}) s_notebookPageTitle{wid;cwid;t}; } } free_if_undefined{cx;var;cvar}: { if (is_variable{cx;cvar}) (); free_instance{cx,var;}; print_abort{cx;var;'children of a container must be variables'}; } where_widgets{wid}: { if (0=wid) 1 1 1 1; yG_Y{wid}; xG_X{wid}; ysg_height{wid}; xsg_width{wid}; if (~at_able{wid}) y,x,ys,xs else ((y,x)-g_shadowThickness{g_parent{wid}}),ys,xs } trim_coordinates{yx}: { b~yx@1ۢ1 1 1 1; if (~1b) (0 0;1 1;yx); yxb/yx; ul/yx[;2]; yx[;2]yx[;2]-@1 ul; xt/yx[;2]+yx[;2 3]; yxb\yx; ((~b)/yx)1; (ul;xt;yx) } sticky_grid{a;b;c}: ((0,+\(cLAYOUT_CT)LAYOUT_CT)a-.5LAYOUT_CT)~.5+bLAYOUT_CT array_geometry{nar}: if (1w0,,(lcm{v}vw/v)/w/nar reduce_row{f;m}: { (i#m) do (j1m) do ((i;j)#m)case (n(i;j)#m) { 1; matrify{n}; 2; if (1 1n>n) n else n} }; if (f) m else lcm_replicate{<@1 m} } lcm_replicate{b}: { ((`null=ةb)/b)<`; bmatrify{b}; c0#ҡb; ecҡlcm{c}c; fe/b; gf; h(1ءҡb)@1 g; matrify{h} } reduce_to_canonical{x}: { zx; while (1) { zreduce_row{0;reduce_row{0;xz}}; if (zx) (z)_flat{z} }; } *** Built-in set callbacks old_new{c;o;n}: { old(old`)/old oldunique{old}/old_flat{o}; new(new`)/new newunique{new}/new_flat{n}; ovarmif (0<#old) matrify{c_v{c;old}} else 0 2(); nvarmif (0<#new) matrify{c_v{c;new}} else 0 2(); o(~ovarmnvarm)/ovarm; n(~nvarmovarm)/nvarm; (o;n) } set_menu{s;d;i;p;c;v}: () set_table{s;d;i;p;c;v}: set_v_container{c;v;s;1} set_graph{s;d;i;p;c;v}: set_v_container{c;v;s;1} set_v_container{cx;var;was;flag}: { wsWS; newcx%var; (ovarm;nvarm)old_new{cx;was;new}; clsg_varClass{cx,var}; print_alert{cx;var;(cls),' assignment'}; dls0#contains_of{cls}; els`array; funset_of_class{cls}; widg_varWid{cx,var}; mflagG_mapped{wid}; if (mflag) if (fflag0=g_freeze{wid}) s_freeze{wid;1}; ovarsovarm[;0]ovarm[;1]; nvarsnvarm[;0]nvarm[;1]; fvarsfree_if{cx;var;nvars}; if ((cx,var)fvars) print_abort{cx;var;'circularity detected - object freed'}; recouple_object{cx;var;cls;wid}; decouple_object{cx;ovars}; (i#nvars) do couple_object{cx;i#nvars;dls;}; rpflagif (flag) G_containerReparent{wid} else 0; rsflagG_containerReshow{wid}; if (rpflag) { cids0; if (0<#els) (i#ovars) do { (ocx;ovar)c_v{cx;i#ovars}; cidscids,be_of_class{ocx;ovar;els;SHELL}; }; }; restore_title{cx;cxovars}; set_callback{cx;var;cls;new}; if (mflag) { if (fflag) s_freeze{wid;0}; if (rpflag^rsflag) show_id{cids}; }; if (0<#ws) if (0=#WS) s.WSg_data{g_topLevel{wid}}; trigger_workspace_tree{}; } set_grid{s;d;i;p;c;v}:set_atContainer{s;d;i;p;c;v} set_atContainer{s;d;i;p;c;v}: { wsWS; newc%v; clsg_varClass{c,v}; (ovarm;nvarm)old_new{c;s;new}; print_alert{c;v;(,cls),' assignment'}; if (0<#nvarm) remove_v_children{c;nvarm}; widg_varWid{c,v}; mflagG_mapped{wid}; pidg_parent{wid}; rpflagG_containerReparent{wid}; rsflagG_containerReshow{wid}; nsflagG_containerNewshow{wid}; if (0<#ovarm) { if (rpflag) { mflagsbMapped@0{oidsg_varWid@1{ovarm}}; if (aflagG_containerBuild{wid}^(1#s)^0=s) yxG_YX@0{oids}-@1 SHELL_TITLE_SPACE,0; } }; if (mflag) if (fflag0=g_freeze{wid}) s_freeze{wid;1}; be_of_class{c;v;cls;pid}; if (0<#ovarm) { if (~rpflag) free{<@1 ovarm} else { rpflagsoids=g_varWid@1{ovarm}; re_parent_to_default{rpflags/ovarm[;0];rpflags/ovarm[;1]}; if (aflag) S_yx@0 1{oids;yx}; if (rsflag) show_id{(mflags^rpflags)/oids}; }; }; if (0<#nvarm) { nflagsnsflagbMapped@0{nidsg_varWid@1{nvarm}}; show_id{nflags/nids}; }; if (0<#ws) if (0=#WS) s.WSg_data{g_topLevel{wid}}; if (mflag) if (fflag) s_freeze{wid;0}; trigger_workspace_tree{}; } set_notebook{s;d;i;p;c;v}:{ (ovarm;nvarm)old_new{c;s;c%v}; widg_varWid{c,v}; mflagG_mapped{wid}; if (mflag) if (fflag0=g_freeze{wid}) s_freeze{wid;1}; set_atContainer{s;d;i;p;c;v}; if ((`notebookg_varClass{wid})^(widg_topLevel{wid})) (i#nvarm) do s_notebookPageTitle{wid;g_varWid{nvarm[i]};0`title of nvarm[i]}; if (mflag) if (fflag) s_freeze{wid;0}; } set_window{s;d;i;p;c;v}: { wsWS; newc%v; clsg_varClass{c,v}; (ovarm;nvarm),old_new{c;s;new}; print_alert{c;v;(,cls),' assignment'}; if (0<#nvarm) remove_v_children{c;1 2nvarm}; widg_varWid{c,v}; mflagG_mapped{wid}; pidg_parent{wid}; rpflagG_containerReparent{wid}; rsflagG_containerReshow{wid}; nsflagG_containerNewshow{wid}; if (0<#ovarm) if (rpflag) mflagsbMapped{oidg_varWid{ovarm}}; if (mflag) if (fflag0=g_freeze{wid}) s_freeze{wid;1}; be_of_class{c;v;cls;pid}; if (0<#ovarm) { if (~rpflag) free{ovarm} else { if (oid=g_varWid{ovarm}) re_parent_to_default{0#ovarm;1#ovarm}; if (rsflag^mflags) show_id{oid}; }; }; if (0<#nvarm) if (nflag nflagnsflagbMapped{nidg_varWid{nvarm}}) show_id{nid}; if (0<#ws) if (0=#WS) s.WSg_data{g_topLevel{wid}}; if (mflag) if (fflag) s_freeze{wid;0}; trigger_workspace_tree{}; } remove_v_children{cx;syms}: { if (1b0wids widswidget@1{syms}) { pidsg_parent@0{b/wids}; clssclass_of_id@0{pids}; c2=container_type @0{clss}; (k#nm#b/#b mc/#c) do { (pcx;pvar)symbol{m[k]#pids}; (pcx%pvar)remove_symbols{(pcx;pcx%pvar);1 2n[k]#syms} } } } *** Mapping -- map/unmap from top down map{id}: bMap{id} unmap{id}: bunMap{id} showable{id}: if (id=0) 0 else if (`symdg_data{id}) 0 else if (`symcg_varClass{d}) 0 else ~cNON_WIDGETS hide_id{id}: if (showable{id}) sub_hide_id{id} sub_hide_id{id}: unmap{1zero_self{id}} show_id{id}: if (showable{id}) sub_show_id{id;1} sub_show_id{id;flag}: if (flag^bBeenMapped{id}) map{zero_self{id}} else show_id_recursively{id;flag} show_id_recursively{id;flag}: { &{real_children_of{id};0}; map{if (flag) zero_self{id} else id}; } syncshow_id{id}: if (showable{id}) sub_syncshow_id{id;1} sub_syncshow_id{id;flag}: if (flag^bBeenMapped{id}) bShowAndWaitForMap{zero_self{id}} else syncshow_id_recursively{id;flag} syncshow_id_recursively{id;flag}: { &{real_children_of{id};0}; bShowAndWaitForMap{if (flag) zero_self{id} else id}; } *** Funny stuff zero_self{id}: if (0id) if (0=pidg_parent{id}) id else if (0=g_parent{pid}) pid,id else id zero_parent{id}:if (0=id) 0 else g_parent{id}=g_topLevel{id} *** Widget create/destroy create_object{cls;par;cx;var;scflag}: { if (()par) parSHELL; wsflagif (par>0) 0 else if (0<#WS) 0 else if (0=G_ws{cx,var}) 0 else 1 par0; zif (0<#funccreate_of_class{cls}) func{par} else print_abort{cx;var;'cannot create'}; if (~clsNON_WIDGETS) { if (1container_type{cls}) bAddTab{g_topLevel{z};z}; if (wsflag) if (cx`s) create_workspace{cx;var;g_parent{z}}; s_hlColor{z;color_to_pixel{s.YELLOW}}; }; if (scflag) couple_object{cx;var;cls;z}; z } destroy_object{x}: { (sym;id)if (`sym=x) (x;g_varWid{x}) else (g_data{x};x); if (/is_a{sym;NON_WIDGETS}) if (/is_a{sym;OBJECT_CLASS}) { bDestroy{id}; clssdecouple_object{sym[0];sym[1]}; (1 2sym;,clss) } else { trG_descendents{id}; syms>(jr`class) { S_class{cx,var;clsjv}; idg_varWid{cx,var}; (r;v)(w; if (1c) doesNotUse{cx,var;c/s}; if (0c) uses{cx,var;(<~c)/(s;w)}; (b/r)s; if (0c) (b/v)w ((~c)/w)%(~c)/w; (r;v) } } set_attributes{cx;var;id;cls;rr;vv;zf}: { (funs;cnvs;iflags;eflags;dflts)sets_of{cx;var;cls;rr}; (rr;vv)defaults_of_class{cx;var;cls;rr;vv;dflts}; hflag`scx; if (hflag) if (hflagG_varHas{cx,var}) print_alert{;;(cxvar),' has ('}; (i#rr) do { (fun;cnv;iflag;eflag;dflt;r;v)iء(funs;cnvs;iflags;eflags;dflts;rr;vv); if (()v) vdflt; if (0=#fun) print_error{cx;var;'not defined: ',(cxvar),' has (`',(r),';...)'} else { if (~(0id)^0v<())^~>w<())/w; (r;v) } access_id{cx;var;id;r;iflag;wflag;zflag}: { if (iflag1) id; zif (0=pidg_parent{id}) id else if (0=gpidg_parent{pid}) { case (iflag) { 2; pid; 3; if (~G_iconic{pid}) pid; 4; if (G_iconic{pid}) pid } }; if ((0<#z)0=wflag) z else if (1=zflag) if (~(cx,var)reference_objects{}) print_error{cx;var;'cannot access `',(,r),' of object'} } *** couple and decouple variable/widget pairs decouple_object{cx;var}: { (cx;var)c_v{cx;var}; b~SYMBOLS@1 cx,var; s.SYMBOLSb/SYMBOLS; clsg_varClass{cx,var}; if (~clsNON_WIDGETS) reset_null_title{cx;var}; s_varClass{cx,var;}; cls } recouple_object{cx;var;cls;wid}:define_object{cx;var;cls;wid;1} couple_object{cx;var;cls;wid}:define_object{cx;var;cls;wid;0} define_object{cx;var;cls;wid;rcflag}: { (cx;var)c_v{cx;var}; if (flag~(cx,var)SYMBOLS) s.SYMBOLSSYMBOLS,cx,var; s_varClass{cx,var;cls}; if (0=#wid) widg_varWid{cx,var}; if (wflag0wid) link_variable_to_widget{cx;var;wid}; if (~clsNON_WIDGETS) set_null_title{cx;var}; drsif (flag) set_class_defaults{cx;var;wid;cls}; if (~rcflag) set_global_defaults{cx;var;wid;cls;drs}; if (flag) restore_yourself{cx;var}; trigger_workspace_tree{}; } set_class_defaults{cx;var;wid;cls}: { (rr;vv)get_class_defaults{cls}; ss(CLASSES`variable)ATTRIBUTES; ss(ss`title)/ss; if (1kssrr) { ssk/ss; dvget_attributes{`s;`VARIABLE;;`variable;ss;0}; ovget_attributes{cx;var;wid;cls;ss;0}; ss(~>dvov)/ss; (rr;vv)(<~rrss)/(rr;vv) }; if (0<#rr) rr set_attributes{cx;var;wid;cls;rr;vv;0} } set_global_defaults{cx;var;wid;cls;srs}: { if (~/b0<>#dfs dfsidxDEFAULTS idxCLASSEScls) (); dfsb/dfs; (trs;tys;wdg;gfs;gft;cgs)(#gfs)/gft; wbwin; jj#trs; argsif (0wid) wb#(cx,var;wid) else if (0wb) (#jj)dfs;`s.attribute}; cty>cvs; oty>ovs; if (1b(tys=2)^(`funccty)^(cvs=ovs)`null=cty) set_attributes{cx;var;wid;cls;b/trs;(+/b)();0}; if (1b(~b)^(cvs=ovs)(`null=cty)`null=oty) set_attributes{cx;var;wid;cls;b/trs;(+/b)();0}; } } get_null{cx;var;cls;arg;r;wi;gf;cg}: { if (`func=gf) if (0<#argaccess_id{cx;var;arg;r;wi;0;0}) cg{apply{gf;(arg;1;cls)}} } set_null{cx;var;cls;arg;r;wi;gf;sf;df}: { if (`func=sf) if (0<#argaccess_id{cx;var;arg;r;wi;0;0}) if ((2df)2if (`func=gf) apply{gf;(arg;;cls)}) apply{sf;(arg;;cls)}; } call_scv{cv;sym}: if (~()0(fun;s)2_get{c,v;sym} (c;v)cv) apply{fun;(s;c;v)} link_variable_to_widget{cx;var;wid}: { s_varWid{cx,var;wid}; s_data{wid;cx,var}; if (0pidg_parent{wid}) if (0=g_parent{pid}) s_data{pid;cx,var}; } F reset_null_title sets the title to null if the title is set to var or cxvar. F used when reparenting tablefields removed from a table, for example. reset_null_title{cx;var}: { tg_varTitle{cx,var}; if ( (tvar) tcxvar ) s_varTitle{cx,var;} } set_null_title{cx;var}:if (()namg_varTitle{cx,var}) S_varTitle{cx,var;variable_name{cx;var}} restore_title{d;var}: { if (d=c (c;v)var) { if (c`) if (g_varTitle{c,v}v) s_varTitle{c,v;variable_name{c;v}} } else { if (c=`) if (g_varTitle{c,v}cv) s_varTitle{c,v;variable_name{c;v}} }; } *** preset callbacks preset_fail{cx;var;cls;msg}: print_abort{cx;var;' refused -- ', if (0<#msg) msg else 'would not be a ',,cls} preset_variable{s;d;i;p;c;v}: preset_object{s;d;i;p;c;v;verify_variable;0 0} preset_radio{s;d;i;p;c;v}: preset_object{s;d;i;p;c;v;verify_slotfiller;1 0} preset_slotfiller{s;d;i;p;c;v}: preset_object{c;d;i;p;c;v;verify_slotfiller;0 0} preset_v_container{s;d;i;p;c;v}: preset_object{c;d;i;p;c;v;verify_v_container;0 1} preset_container{s;d;i;p;c;v}: preset_object{c;d;i;p;c;v;verify_container;0 1} preset_grid{s;d;i;p;c;v}: preset_object{c;d;i;p;c;v;verify_grid;0 1} preset_window{s;d;i;p;c;v}: preset_object{c;d;i;p;c;v;verify_window;0 1} preset_object{c;d;i;p;cx;var;vfn;flags}: { if (()clsg_varClass{cx,var}) d; newoldcx%var; if ((i())^p()) newd else if ((i())^0=0#flags) (pnew)d else if (0=0#flags) { if (`int=i) (i#,pnew)d else if (10=0do (i#pnew)d) (pnew)[,]d; } else { if (0=#d) d; if (d1) if ((#k)>j(k1old)1) ((1,j)new)0; if (i()) (pnew)d else if (`int=i) (i#,pnew)d else if (10=0do (i#pnew)d) (pnew)[,]d; }; zif (newold) d else { s.JUNK if (0=1#flags) new else qualify_symbols{cx;new}; (pcx;pvar)`s`JUNK; if (0=vfn{pcx;pvar;cls}) preset_fail{cx;var;cls;} else d }; z } *** Verification -- v_data{} is external verify_variable{cx;var;cls}: { fnverify_of_class{cls}; if (`funcfn) 1 else fn{cx;var;cls} } verify_data{cx;var;cls}: { (rc;rs)do v_data{reference_widget{cls};cx,var}; if (rc0) verify_failure{cx;var;rs} else rs } verify_failure{cx;var;rs}:0 print_error{cx;var;rs} verify_children{cx;var;vals}: { (rc;rs) if (0=#p_flat{vals}) (1;) else if (~punique{p}/p) (0;'object contains duplicate symbol') else if (0_nc@0{`;p}`vars `deps) (0;'symbol is not a variable') else (1;) %p; if (rc=1) 1 else verify_failure{cx;var;rs} } verify_slotfiller{cx;var;cls}: { if (0=verify_data{cx;var;cls}) 0 else if (0=#syms0valscx%var) 1 else ^/unique{syms} } verify_menu{cx;var;cls}:verify_slotfiller{cx;var;cls} verify_not_reference{vars}:~/NON_WIDGETSg_varClass{vars} verify_window{cx;var;cls}: { if (0=verify_container{cx;var;cls}) 0 else (1#val)^1#val valcx%var } verify_container{cx;var;cls}: { if (0=verify_data{cx;var;cls}) 0 else if (()valscx%var) 1 else if (0=is_symbolic{vals}) 0 else if (~^/is_variable@0{cx;vars} vars_flat{vals}) 0 else verify_not_reference{cxvars} } verify_grid{cx;var;cls}:if (1<#cx%var) 0 else verify_container{cx;var;cls} verify_v_container{cx;var;cls}: { if (0=is_symbolic{valscx%var}) 0 else if (()vals) 1 else if (0=verify_children{cx;var;qualify_symbols{cx;vals}}) 0 else if (0=verify_data{cx;var;cls}) 0 else if (~^/is_variable@0{cx;vars} vars_flat{vals}) 0 else verify_not_reference{cxvars} } *** Internal S utilities trigger{}: s.SYMBOLS[]SYMBOLS bOut_sdipcv{s;d;i;p;c;v}:bOut{cv;d} out_function{s}: { case (zg_varOutFunc{s}) { `null; (out_default;); `func; 2z; (bOut_sdipcv;z) } } class_of_id{x}: { if (0=#x) `real else if (0=x) `real else if (0=#sg_data{x}) `real else if (0=g_parent{x}) `real else if (0=#cg_varClass{s}) `real else c } inherited_attributes{id;sf}: { if (1b0=#1sf) (b/1sf)G_cb{id;b/0sf}; if (~1b0=#1sf) sf else if (is_shell{pid} pidg_parent{id}) sf else &{pid;sf} } container_type{x}: (CLASSESx)#CONTAINER at_type{x}: (CLASSESx)#AT_TYPE reference_object{x}: (CLASSESx)#REFERENCE_OBJECTS primitives_in{id}: if (0<#chG_Descendents{id}) ((clontological_classes{1})^~clcontainers{})/ch clg_varClass@0{ch} create_of_class{x}: (CLASSESx)CLASS_FNS space_of_class{x}: (CLASSESx)SPACE_FNS verify_of_class{x}: (CLASSESx)VERIFY_FNS set_of_class{x}: (CLASSESx)SET_FNS contains_of{x}: (CLASSESx)CONTAINS attributes_of_class{x}: (CLASSESx)ATTRIBUTES proper_flat_super{x}: ,(CLASSESx)PROPER_SUPER proper_flat_sub{x}: ,(CLASSESx)PROPER_SUB flat_super{x}: ,(CLASSESx)SUPER flat_sub{x}: ,(CLASSESx)SUB get_class_defaults{x}: get_class_defs{x;CLASS_DEFAULTS} get_class_defaults_0{x}:get_class_defs{x;CLASS_DEFAULTS_0} get_class_defs{x;y}: ,(CLASSESx)y object_attributes{}: (CLASSES`variable)ATTRIBUTES is_shell{pid}: bIsTopLevel{pid}bIsPopup{pid} shell_objects{f}: (f@0{g_parent@0{g_varWid@0{obs}}})/obsobjects{} ontological_classes{n}: sym_sort{(n=ONTOLOGY)/CLASSES} children_of{wid}: (wid=g_parent{ids})/idsg_varWid@1{SYMBOLS} is_real_container{wid}: 1=container_type{class_of_id{wid}} real_children_of{wid}: if (is_real_container{wid}) (wid=g_parent{ids})/idsg_varWid@1{SYMBOLS} siblings_of{cx;var}: pcx_flat{pcx%pvar} (pcx;pvar)g_data{g_parent{g_varWid{cx,var}}} at_able{wid}: at_type{class_of_id{g_parent{wid}}} reference_objects{}: `s~((REFERENCE_OBJECTS`)/REFERENCE_OBJECTS),`WM_SAVE_YOURSELF stolen_classes{}: ((0<#PRESET_FNS)0<#SET_FNS)/CLASSES contained_by{cl}: if (1b>/CONTAINSšis_a{x;k((jCLASSESc)ATTRIBUTES)r) (j;k) else if ((#0ATTRIBUTES)>k(0ATTRIBUTES)r) (0;k) else print_abort{;;(,c),' attribute-set does not include ','`',r} } internal_get_of{cls;r}: internal_fun_of{cls;r;INTERNAL_GETS} internal_set_of{cls;r}: internal_fun_of{cls;r;INTERNAL_SETS} internal_fun_of{c;r;fs}:(j#ifs;default_of{j#iDEFAULTS}) j(iATTRIBUTES)r iCLASSESif (0<#c) c else `variable sets_of{cx;var;c;r}: funs_of{cx;var;c;r;SETS;CONVERTER_SETS} gets_of{cx;var;c;r}: funs_of{cx;var;c;r;GETS;CONVERTER_GETS} funs_of{cx;var;c;r;fs;cnvs}: { if (1b(#at)=j(at(iCLASSESc)ATTRIBUTES)r) print_error{cx;var;'unknown attributes: ','`',Ρb/r}; (j#(ifs),<();(j#(iCONVERTER),0)#cnvs;j#(iWIDGETABLE),1;j#(iEDITABLE),0;default_of{j#(iDEFAULTS),<()}) } indices_of_atts{c;r}: (i;j) j(iATTRIBUTES)r iCLASSESc atts_of_atts{c;r;x}: { (i;j)indices_of_atts{c;r}; if (^/bj<#zix) j#z else print_abort{;c;'unknown attribute(s): ','`',Ρ(~b)/r} } default_of{x}:if (`sym=x) if (`null_nc{c;v} (c;v)c_c{x}) c%v *** variable name F variable_name returns cxvar, unless variable is parented to another var in same context, in which case F just var is returned. variable_name{cx;var}: { if (0widg_varWid{cx,var}) if (~zero_parent{wid}) if (cx01g_data{g_parent{wid}}) cx` else if (cx`) cx`.; (if (`cx),(cx),if (`.cx) '.'),var } variable_title{cx;var}: (,cx),'.',,var shell_title{cx;var}: if (~WScx,var) variable_name{cx;var} else if (0=#z01._argv) WSNAME else z variable_symbol{x}: if ((`sym=x)^(1#x)^(2#x)^0<#x) c_c{x} is_variable{cx;var}: { if (`symvar) 0 else if (`1(cx;var)c_v{cx;var}) 1 else z if ((BINDING=0)^0=z_nc{cx;var}`vars `deps) print_error{cx;var;'symbol is not a variable'} } is_symbolic{x}: { if (0=x) (x)`sym `null else { if (f0=_gsv `Gf) `Gf _ssv 1; (rc;z)do _flat{x}; if (f) `Gf _ssv 0; if (0rc) 0 else (z)`sym `null } } qualify_symbols{cx;val}: { case (val) { `sym; if (0=val) cxval else &{cx;val}; `box; &{cx;val}; val } } structure_match{a;b}: { if ((a)b) 0 else if ((#a)#b) 0 else if (~(a)b) 0 else if ((a)b) 0 else if (0=a) 1 else ^/&{,a;,b} } *** Reference-object of class functions reference_widget{cl}: { iCLASSEScl; rflag~clNON_WIDGETS; widi#REFERENCE_WIDGETS; if (0=wid) { vari#REFERENCE_OBJECTS; widif (~dflag1=i#ONTOLOGY) { if (0=#sclcontained_by{cl}) print_abort{;cl;'virtual container class not defined'}; g_varWid{`s,0#_flat{`s%1g_data{&{scl}}}} } else { widcreate_object{cl;0;`s;var;1}; if (2=i#CONTAINER) { cn,iCONTAINS; sv,`s%var; (j#cn) do couple_object{`s;j#sv;j#cn;}; }; if (~rflag) { map{wid}; unmap{wid}; }; wid }; (i#s.REFERENCE_WIDGETS)wid; if (~rflag) { if (1=+/0pixel_value{SERVER;(x' ')/x<@1x}; `sym; >pixel_value{SERVER;Ρx}; `box; >pixel_value{SERVER;x}; x } } pixels_to_colors{x}: { if (`intx) x else if (^/t=`sym t>zh_c_exact{bgetColorString{SERVER;x}}) >z else if (^/t=`char) >(/>#z)١z else z } char_to_int{x}: if (0=#x) 0 else 0#1,`intx int_to_char{x}: if (x=0) '' else `char0#1,x sym_to_char{x}: if (`sym=x) ,x else x *** Pseudo-attributes S_recursively{var;x}: has{var,G_Descendents{g_varWid{var}};t)(#t)`char) } S_varPageTitle{wid;x}:{ notset" -- `pagetitle cannot be set"; notchildmsg"variable not child of `notebook",notset; (cx;var)g_data{wid}; if((~`intwid)(0wid)) print_error{cx;var;notchildmsg}; pidg_parent{wid}; if (~validate_title{x}) print_error{cx;var;"pagetitle argument of incompatible type",notset}; if ("Untitled"x) print_error{cx;var;"argument 'Untitled' not allowed",notset}; if (0=pid) print_error{cx;var;notchildmsg}; if (~`notebookg_varClass{g_data{pid}}) print_error{cx;var;notchildmsg}; if(pid=g_topLevel{pid}) print_error{cx;var;notchildmsg}; s_notebookPageTitle{pid;wid;x}; } G_varPageSelection{wid}:{ if((~`intwid)(0wid)) (); pidg_parent{wid}; if (0=pid) (); if (~`notebookg_varClass{g_data{pid}}) (); if(pid=g_topLevel{pid}) (); g_notebookPageSelection{pid;wid} } S_varPageSelection{wid;x}:{ notset" -- `pageselection cannot be set"; notchildmsg"variable not child of `notebook",notset; (cx;var)g_data{wid}; if((~`intwid)(0wid)) print_error{cx;var;notchildmsg}; pidg_parent{wid}; if (0=pid) print_error{cx;var;notchildmsg}; if (~`notebookg_varClass{g_data{pid}}) print_error{cx;var;notchildmsg}; if(pid=g_topLevel{pid}) print_error{cx;var;notchildmsg}; s_notebookPageSelection{pid;wid;x}; } Pixel positioning and extent G_X{wid}: G_abs_pos{wid;<{g_x}} G_Y{wid}: G_abs_pos{wid;<{g_y}} G_YX{wid}: G_Y{wid},G_X{wid} G_abs_pos{wid;func}: if (0=wid) 0 else func{wid}+&{g_parent{wid};func} G_y_pos{wid}: G_pos{wid;<{g_y}} G_x_pos{wid}: G_pos{wid;<{g_x}} S_y_pos{wid;x}: S_pos{wid;<{s_y};x} S_x_pos{wid;x}: S_pos{wid;<{s_x};x} G_pos{wid;func}: func{if (zero_parent{wid}) g_topLevel{wid} else wid} S_pos{wid;func;x}: if (~()x) func{if (zero_parent{wid}) g_topLevel{wid} else wid pos_warn{wid};x} pos_warn{id}: if (at_able{id}) print_alert{id;;'`yx in a layout is unstable'} G_yx{wid}: G_y_pos{wid},G_x_pos{wid} S_yx{wid;x}: if (~()x) bMoveTo{if (zero_parent{wid}) g_topLevel{wid} else wid;1#x;0#x} x2x S_ys{wid;x}: S_Extent{wid;x;<{s_height}} S_xs{wid;x}: S_Extent{wid;x;<{s_width}} G_yxs{wid}: g_height{wid},g_width{wid} S_yxs{wid;x}: S_Extent{wid;x;<{bResize}} G_extent{wid}: G_yx{wid},G_yxs{wid} S_extent{wid;x}: if (~()x) S_yxs{wid;2x},S_yx{wid;2x} x4x S_Extent{wid;x;fn}: { if (()x) (); if (~bBeenMapped{wid}) S_realize{wid;1}; case (_valence{fn}) { 2; fn{wid;x}; 3; fn{wid;xs;ys} (ys;xs)2x; } } S_yxsPixeled{wid;x}: if (0<#x) bResize{wid;xs;ys} (ys;xs)2x S_ysPixeled{wid;x}: if (~()x) s_height{wid;x} S_xsPixeled{wid;x}: if (~()x) s_width{wid;x} Selection S_request{wid;x}: bRequestPrimary{wid} Miscellaneous S_textNumVisibleRows{wid;x}: if (~()x) s_textNumVisibleRows{wid;x} S_textNumVisibleCols{wid;x}: if (~()x) s_textNumVisibleCols{wid;x} S_vectorSize{wid;x}: s_numVisibleRows{wid;g_numVisibleRows{wid}} S_iconName{wid;x}: if (~()x) s_iconName{wid;x} S_refresh{wid;x}: if (~x0) bRefresh{wid} G_state{s}: state_has{cx;var;1} (cx;var)s G_stateSelf{s}: state_has{cx;var;0} (cx;var)s S_sensitive{wid;x}: s_sensitive{wid,if (is_real_container{wid}) G_descendents{wid};x} S_freeze{wid;x}: s_freeze{wid,if (is_real_container{wid}) G_descendents{wid};x} G_atSector{tid}: { if (1 1rc rcdesktop{}) 1 1 else if ((0=z)^0=1z zg_virtualScreen{tid}) here{} else ,rc΢1+z } S_atSector{tid;x}: { if (()x) (); if (1 1rc rcdesktop{}) print_error{;;'desktop not supported'} else s_virtualScreen{tid;z} zif (x`here) bVirtualScreen{SERVER} else 1+rc2!,x } S_fullscreen{tid;x}: if ((~x0)^(~x())) S_yxs{tid;SCREEN-SHELL_BORDER_SPACE+SHELL_TITLE_SPACE,0} S_yx{tid;0 0} G_fullscreen{tid}: (G_yx{tid},G_yxs{tid})0 0,SCREEN-SHELL_BORDER_SPACE+SHELL_TITLE_SPACE,0 G_is{var}: _get{var;`s.is} S_is{var;x}: _set{var;(`s.is;x)} G_layoutStructure{wid}: G_position_properties{wid;G_at} S_layoutStructure{wid;x}: S_position_properties{wid;x;S_at} G_gridStructure{wid}: G_position_properties{wid;G_extent} S_gridStructure{wid;x}: S_position_properties{wid;x;S_extent} G_layoutConstraints{wid}: G_position_properties{wid;G_resize} S_layoutConstraints{wid;x}: S_position_properties{wid;x;S_resize} S_layoutMargin{wid;x}: S_Null{wid;x;s_layoutMargin;`margin} G_position_properties{wid;fn}: (v;fn{g_varWid@0{v}}) vcxunique{v}/v_flat{cx%var} (cx;var)g_data{wid} S_position_properties{wid;x;fn}: { if (0=#x) (); if (0=#v (v;z)(#mcolor_to_pixel@0{x}) m((.5#m),2)m G_graphSelected{wid}: if (0igf; igfb/igf; isfb/iINTERNAL_SETS; rb/iATTRIBUTES; gfb/iGETS; vvv(#gf)(); j0; (k#v) do { (kv)(kgf){wid}; (kvv)(kigf){}; if (~(kv)kvv) (kisf){kv}; }; (v;vv;isf) } localize_print{v;vv;isf}:(k#v) do if (~(kv)kvv) (kisf){kvv} Report Attributes -- PrintText Handlers S_fieldBreakText{wid;val}:{ ptwidsC_APrintTextVec{val}; s_fieldBreakText{wid;val;ptwids}; } S_tableGrandTotalText{wid;val}:{ ptwidsC_APrintText{val}; s_tableGrandTotalText{wid;val;ptwids}; } C_APrintText{arg}:{ zwidc_APrintText{}; if(0rc (rc;pta)do _alsf arg) zwid; (syms;vals)pta; (i#syms) do ((s.PT_ATTRSsyms[i])s.PT_SETS){zwid;ivals}; zwid } ith_item{idx;form;val}:{ if (`scalarform) { if (0=#val) 0 else (idxĢ1+#val)val } else if (`nullval) "" else if ((val)`box`sym) (idxĢ1+#val)val else val } C_APrintTextVec{arg}:{ if(0rc (rc;pta)do _alsf arg) ,C_APrintText{()}; (syms;vals)pta; howmany0; forms(#syms)`; (i#syms) do howmanyhowmany( if((`scalarforms[i]s.PT_FORMS[s.PT_ATTRSsyms[i]])(valivals)`box`sym`null) #val else 1); zwidshowmany0; (jhowmany) do { zwids[j]c_APrintText{}; (i#syms) do ((s.PT_ATTRSsyms[i])s.PT_SETS){zwids[j];ith_item{j;forms[i];ivals}} }; zwids } S_reportPrint{wid;val}: { s_reportPrint{wid}; } S_reportCancel{wid;val}: { s_reportCancel{wid}; } *** "at" routines G_vrow{wid}: 0#G_at{wid} G_vcol{wid}: 1#G_at{wid} G_vrows{wid}: 2#G_at{wid} G_vcols{wid}: 3#G_at{wid} S_vrow{wid;y}: S_at{wid;y,1 1 1} S_vcol{wid;y}: S_at{wid;1,y,1 1} S_vrows{wid;y}: S_at{wid;1 1,y,1} S_vcols{wid;y}: S_at{wid;1 1 1,y} S_at{wid;x}: { if (~at_able{wid}) print_error{wid;;'parent is not a layout, `at not set'}; if (~x1 1 1 1) { if (()x) x0 0 1 1 else if (1x4x) (b/x)(bx=1)/G_at{wid} else x[b/2 3](bx[2 3]=0)/1 1; bPositionChild{wid;0#x;1#x;2#x;3#x;g_resizeOptions{wid}}; }; } G_at{wid}: { if (~at_able{wid}) 1 1 1 1 else g_layoutRow{wid},g_layoutCol{wid},g_layoutVspan{wid},g_layoutHspan{wid} } G_l{wid}:'l'G_resize{wid} G_r{wid}:'r'G_resize{wid} G_t{wid}:'t'G_resize{wid} G_b{wid}:'b'G_resize{wid} G_h{wid}:'h'G_resize{wid} G_w{wid}:'w'G_resize{wid} G_H{wid}:'H'G_resize{wid} G_W{wid}:'W'G_resize{wid} S_l{wid;x}:S_Resize{wid;x;'l'} S_r{wid;x}:S_Resize{wid;x;'r'} S_t{wid;x}:S_Resize{wid;x;'t'} S_b{wid;x}:S_Resize{wid;x;'b'} S_h{wid;x}:S_Resize{wid;x;'h'} S_w{wid;x}:S_Resize{wid;x;'w'} S_H{wid;x}:S_Resize{wid;x;'H'} S_W{wid;x}:S_Resize{wid;x;'W'} S_Resize{wid;x;y}:S_resize{wid;if (x1) G_resize{wid},y else (ty)/tG_resize{wid}} G_resize{wid}:G_resize_core{wid;1} top_resize{wid}:(2,((2+#RESIZE)2),g_resizeOptions{wid})/RESIZE bot_resize{x}:''1`int+/(RESIZEx)#(2*2+#RESIZE),0 G_resize_core{wid;acc}: { otop_resize{wid}; sfget_class_defaults{class_of_id{wid}}; if (~acc) o else if (~`resize0sf) o else if (~o`resizesf) o } S_resize{wid;c}:S_resize_core{wid;c;~'.'c} S_resize_core{wid;c;acc}: { ccase (c) { `null; if (~`resize0sfget_class_defaults{class_of_id{wid}}) '' else if (`null=c`resizesf) '' else c; `char; if (0=#c) '' else if (~acc) c else unique{c}/cc,top_resize{wid} }; s_resizeOptions{wid;bot_resize{c}}; } *** Shell controls S_shellIconData{wid;x}: { if (0=wid) print_error{;;'unknown object'}; if (()x) (); xif (0x) print_error{wid;;'`presence incorrect -- setting ignored'}; s_shellWorkspacePresence{wid;x} } G_shellWSPresence{wid}:{g_shellWorkspacePresence{wid}} *** Tab controls G_tabFrom{wid}: if (widxg_tabList{g_topLevel{wid}}) q_n{g_data{((xwid)#1#x)#x}} S_tabFrom{wid;x}: if (~()x) s_metaTab{g_varWid{c_v{0#g_data{wid};x}};wid} G_tabTo{wid}: if (0<#xg_metaTab{wid}) if (0<#x(x0)/x) q_n{g_data{x}} S_tabTo{wid;x}: if (~()x) s_metaTab{wid;g_varWid{c_v{0#g_data{wid};x}}} G_tabList{tid}: if (0<#xg_tabList{tid}) if (0<#x(x0)/x) q_n{g_data@0{x}} S_tabList{tid;x}: { if (x()) s_tabList{tid;0} else { if (x`) xnatural_tab_order{tid}; s_tabList{tid;(z0)/zg_varWid@1{c_v{0#g_data{tid};x}}}; }; } natural_tab_order{id}:(>1q)#0qG_Extents{if (is_shell{id}) id else g_parent{id};0} G_arrowList{tid}: { if (()dG_Descendents{g_varWid{g_data{tid}}}) 0 3(); m0 3(); m[,]arrow_matrix{d;`s.leftTo;`left}; m[,]arrow_matrix{d;`s.rightTo;`right}; m[,]arrow_matrix{d;`s.upTo;`up}; m[,]arrow_matrix{d;`s.downTo;`down}; nnatural_arrow_order{tid}; if (~(m)n) m else if ((^/mn)^^/nm) ` else m } arrow_matrix{d;dir;sdir}: { zd _getdir; if (()z(b`null>z)/z) 0 3(); (b/d),sdir~q_n{z} } S_arrowList{tid;x}: { if (()dG_Descendents{g_varWid{g_data{tid}}}) (); if (x()) x0 3() else { if (x`) xnatural_arrow_order{tid}; if (0<#x) x[;0 2]q_n@1{c_c@0{x[;0 2]}}; }; (i#d) do { d[i] _set (`s.leftTo;if ((#x)>jx[;0 1]d[i],`left) x[j;2]); d[i] _set (`s.rightTo;if ((#x)>jx[;0 1]d[i],`right) x[j;2]); d[i] _set (`s.upTo;if ((#x)>jx[;0 1]d[i],`up) x[j;2]); d[i] _set (`s.downTo;if ((#x)>jx[;0 1]d[i],`down) x[j;2]); }; } natural_arrow_order{tid}: { z0 3(); if (0<#s (s;e)G_Extents{tid;0}) { e>e; l@1 r2!((e),0)#s; u@1 d2!((@1 e),0)#s; z[,]l[;0],`left~l[;1]; z[,]r[;0],`right~r[;1]; z[,]u[;0],`up~u[;1]; z[,]d[;0],`down~d[;1]; }; z } *** Leader/follower controls G_leader{wid}: if (0<#zg_windowGroup{wid}) if (0z) if (widz) q_n{g_data{z}} S_leader{wid;x}: { if (0=wid) print_error{;;'unknown object'}; (fcx;fvar)g_data{wid}; if (`s=fcx) (); if ((0=#x)^0=#WS) s_windowGroup{wid;g_defaultLeader{}} else { if (0=#x) xWS; (cx;var)c_c{x}; if ((cx,var)fcx,fvar) s_windowGroup{wid;0} else if (is_variable{cx;var}) { if (0=xwidg_varWid{cx,var}) print_error{cx;var;'leader variable not bound'}; if (is_a{cx,var;OBJECT_CLASS}) print_error{cx;var;'reference object cannot lead'}; if (is_one_of{cx,var;REPORT_CLASSES}) print_error{cx;var;'report object cannot lead'}; pxwidg_parent{xwid}; if (0z} S_followers{wid;x}: { if (0=wid) print_error{;;'unknown object'}; (cx;var)g_data{wid}; flsG_followers{wid}; nflsif (0<#x) q_n{c_v{cx;x}}; if (0<#nfls) nfls(~is_a@0{nfls;OBJECT_CLASS})/nfls; if (0<#nfls) nfls(~is_one_of@0 1{nfls;REPORT_CLASSES})/nfls; if (1b~flsnfls) S_leader{g_parent{g_varWid{b/fls}};#s) bl else d#s in_default_exec{s;d;i;p;c;v}: { if (G_literal{c,v}) >execute{'<',d} else case (typi#valpc%v) { `int `float; if (^/d=' ') (`int `floattyp)(0;0.0) else in_numeric{d;c;v}; `char; if (1#val) d else (1#val)d; if (^/d=' ') typNA else execute{d} } } in_numeric{d;c;v}:if (1=G_varExecute{c,v}) execute{d} else _sfi{d} out_default{s;d;i;p;c;v}: { (bl;na)(G_varBlank{c,v};G_varNa{c,v}); z if ((~bl())^dna) bl else if ((`char=s)^2=#s) out_lookup{s;d;i;p;c;v;if (()bl) '' else bl} else out_default_exec{if (~()s) ret_scalar_client{s;d;i;p;c;v};d;i;p;c;v}; if (1=G_respace{c,v}) if (g_varCw{c,v}<#z) S_varCw{c,v;#z}; z } out_default_exec{s;d;i;p;c;v}: { if (1=d) d<{d}; z,if (G_literal{c,v}) box{d} else case (d) { `int `float; { if (0<#d) box{d} else if (0=#s) 1d else if ((s)`char `sym) _sfmt{s;d} else if (1`int `float=s) sd else box{d} }; `char; if (1#d) d else box{d}; box{d} }; z } ret_slot_label{s;d;i;p;c;v}: { if (()s) p else case (zslot_index{s;d;i;p;c;v;1}) { `null; p; `sym; z; `char; z; `int `float; z; box{z} } } ret_flat_scalar_client{s;d;i;p;c;v}:_flat{ret_scalar_client{if (0=s) (ۡ(s)|i)#s slot_index{s;d;i;p;c;v;q}: if (1=_issf{s}) slot_pick{s;d;i;p;c;v;q} else slot_from{s;d;i;p;c;v;q} slot_pick{s;d;i;p;c;v;q}: if (p0s) ps else if (q) p slot_from{s;d;i;p;c;v;q}: { r0c%v; jrp; s,if (2=#s) <@1 s else if ((`char=s)^1#s) <,s else s; if (q^j#s) p else ((#s)|j)s } ret_matrix_space{s;d;i;p;c;v}: if (s1) xmatrix_spacing{c;v} else (1s),(1#c%v)(1<#s)s ret_trace_linecolor{s;d;i;p;c;v}: ((0=#s)(ret_trace_within;ret_trace_across)){s;d;i;p;c;v;LINEPIXELS;`white} ret_trace_fillcolor{s;d;i;p;c;v}: ((0=#s)(ret_trace_within;ret_trace_across)){s;d;i;p;c;v;FILLPIXELS;`white} ret_trace_symbol{s;d;i;p;c;v}: ((0=#s)(ret_trace_within;ret_trace_across)){s;d;i;p;c;v;TRACESYMBOLS;`cross} non_text_siblings{cx;var}: (~(<1 2)ҡ%cvars)/cvarssiblings_of{cx;var} ret_trace_linestyle{s;d;i;p;c;v}: ret_trace_within{s;d;i;p;c;v;(1#non_text_siblings{c;v})/LINESTYLES;`solid} ret_trace_across{s;d;i;p;c;v;glo;dfl}: { cvarsnon_text_siblings{c;v}; if (1=#cvars) ret_trace_within{s;d;i;p;c;v;glo;dfl} else ((#s)|0cvarscv)#,sif (0<#glo) glo else dfl } ret_trace_within{s;d;i;p;c;v;glo;dfl}: { if (0=#s) s,if (0<#glo) glo else dfl; if ((1#s)^`char=s) ss; jif ((;)i i2i) 0 else if (()1i) (#s)|0i else if (()0i) (#s)|0Ӣ1+1i else (#s)|0i; j#,s } ret_trace_client{s;d;i;p;c;v}: if (0<#s) (if (0=#i) 0 else (#s)|0Ӣ1+i)#,s ret_trace_legend{s;d;i;p;c;v}: { if (s()) variable_name{c;v},(if (2=#d),':',11+i) else if (s'') s else { zif (1=#d) s else { fun(s)(#;); laif (~(1#s)^`char=s) if (0=#i) 0 else (#s)|0Ӣ1+i; raif (0<#s) s else ,s; fun{la;ra} }; if (`sym=z) z else z } } geo_compute{s;d;i;p;c;v}: { if (0=#s) (#0d)1 else if ((2s)s`horizontal) #0c%v else s!(n),(0s-s|n#0d)Ң1 if (s`vertical) s1 } G_fieldReportAttrs{wid;f;g}: if (0<#zg{wid}) z else f{wid} S_fieldReportAttrs{wid;x;f;g}: {case (x){`null;{f{wid;};g{wid;};};`func;{g{wid;2x}};{g{wid;};f{wid;x};};};} G_fieldBreakFont{wid}: G_fieldReportAttrs{wid;g_fieldBreakFont;g_fieldBreakFontFunc} G_fieldBreakLeading{wid}: G_fieldReportAttrs{wid;g_fieldBreakLeading;g_fieldBreakLeadingFunc} G_fieldBreakOffset{wid}: G_fieldReportAttrs{wid;g_fieldBreakOffset;g_fieldBreakOffsetFunc} G_fieldBreakStyle{wid}: G_fieldReportAttrs{wid;g_fieldBreakStyle;g_fieldBreakStyleFunc} G_fieldFgGrayScale{wid}: G_fieldReportAttrs{wid;g_fieldFgGrayScale;g_fieldFgGrayScaleFunc} G_fieldBgGrayScale{wid}: G_fieldReportAttrs{wid;g_fieldBgGrayScale;g_fieldBgGrayScaleFunc} G_fieldBreakFgGrayScale{wid}: G_fieldReportAttrs{wid;g_fieldBreakFgGrayScale;g_fieldBreakFgGrayScaleFunc} G_fieldBreakBgGrayScale{wid}: G_fieldReportAttrs{wid;g_fieldBreakBgGrayScale;g_fieldBreakBgGrayScaleFunc} G_fieldReportFont{wid}: G_fieldReportAttrs{wid;g_fieldReportFont;g_fieldReportFontFunc} G_fieldStyle{wid}: G_fieldReportAttrs{wid;g_fieldStyle;g_fieldStyleFunc} S_fieldBreakFont{wid;x}: S_fieldReportAttrs{wid;x;s_fieldBreakFont;s_fieldBreakFontFunc} S_fieldBreakLeading{wid;x}: S_fieldReportAttrs{wid;x;s_fieldBreakLeading;s_fieldBreakLeadingFunc} S_fieldBreakOffset{wid;x}: S_fieldReportAttrs{wid;x;s_fieldBreakOffset;s_fieldBreakOffsetFunc} S_fieldBreakStyle{wid;x}: S_fieldReportAttrs{wid;x;s_fieldBreakStyle;s_fieldBreakStyleFunc} S_fieldFgGrayScale{wid;x}: S_fieldReportAttrs{wid;x;s_fieldFgGrayScale;s_fieldFgGrayScaleFunc} S_fieldBgGrayScale{wid;x}: S_fieldReportAttrs{wid;x;s_fieldBgGrayScale;s_fieldBgGrayScaleFunc} S_fieldBreakFgGrayScale{wid;x}: S_fieldReportAttrs{wid;x;s_fieldBreakFgGrayScale;s_fieldBreakFgGrayScaleFunc} S_fieldBreakBgGrayScale{wid;x}: S_fieldReportAttrs{wid;x;s_fieldBreakBgGrayScale;s_fieldBreakBgGrayScaleFunc} S_fieldReportFont{wid;x}: S_fieldReportAttrs{wid;x;s_fieldReportFont;s_fieldReportFontFunc} S_fieldStyle{wid;x}: S_fieldReportAttrs{wid;x;s_fieldStyle;s_fieldStyleFunc} G_cycleColors{wid;f;g}: if (0<#zg{wid}) z else f{wid} S_cycleColors{wid;x;f;g}: {case (x){`null;{f{wid;};g{wid;};};`func;{g{wid;2x}};{g{wid;};f{wid;x};};};} G_arrayCycleColors{wid}: G_cycleColors{wid;g_arrayCycleColors;g_arrayCycleFunc} G_fieldCycleColors{wid}: G_cycleColors{wid;g_fieldCycleColors;g_fieldCycleFunc} G_slotCycleColors{wid}: G_cycleColors{wid;g_slotCycleColors;g_slotCycleFunc} G_scalarCycleColors{wid}: G_cycleColors{wid;g_scalarCycleColors;g_scalarCycleFunc} S_arrayCycleColors{wid;x}: S_cycleColors{wid;x;s_arrayCycleColors;s_arrayCycleFunc} S_fieldCycleColors{wid;x}: S_cycleColors{wid;x;s_fieldCycleColors;s_fieldCycleFunc} S_slotCycleColors{wid;x}: S_cycleColors{wid;x;s_slotCycleColors;s_slotCycleFunc} S_scalarCycleColors{wid;x}: S_cycleColors{wid;x;s_scalarCycleColors;s_scalarCycleFunc} G_fieldCycleInterval{wid}: g_arrayCycleInterval{g_parent{wid}} S_fieldCycleInterval{wid;x}: S_arrayCycleInterval{g_parent{wid};x} G_varOutFunc{var;x}: if (()x) G_func_flagged{var;`out;1} else call_default_out{var;x} G_varInFunc{var;x}: if (()x) G_func{var;`in} else call_default_in{var;x} G_varFgFunc{var}: G_varDefaultedFunc{var;`fg;1#COLORS;pixel_to_color} G_varBgFunc{var}: G_varDefaultedFunc{var;`bg;0#COLORS;pixel_to_color} G_varFontFunc{var}: G_varDefaultedFunc{var;`font;FONT;id_to_font} G_varTitleColorFunc{var}: G_varDefaultedFunc{var;`labelfg;1#COLORS;pixel_to_color} G_varTitleFontFunc{var}: G_varDefaultedFunc{var;`labelfont;FONT;id_to_font} G_varGeoFunc{var}: G_func{var;`geometry} G_varRoFunc{var}: if (()zG_func{var;`protect}) 0 else z G_varTitleFunc{var}: G_func{var;`label} G_varTitle{var}: G_cons{var;`title} G_varReportFontFunc{var}: G_func{var;`reportfont} G_varReportStyleFunc{var}: G_func{var;`reportstyle} G_matrixColSpaceFunc{wid}: G_func{wid;`colspace} G_matrixTitleFontFunc{var}: if (~()zG_varTitleFontFunc{var}) z else G_varFontFunc{var} G_traceLineStyleFunc{wid}: G_func{wid;`linestyle} G_traceLineColorFunc{wid}: G_func{wid;`linecolor} G_traceFillColorFunc{wid}: G_func{wid;`fillcolor} G_traceLegendFunc{wid}: G_func{wid;`legend} G_traceLineWidthFunc{wid}: G_func{wid;`linewidth} G_traceStyleFunc{wid}: G_func{wid;`style} G_traceSymbolFunc{wid}: G_func{wid;`symbol} G_traceYYaxisFunc{wid}: G_func{wid;`yaxis} G_traceXaxisFunc{wid}: G_func{wid;`xaxis} G_traceSymbolSizeFunc{wid}: G_func{wid;`symbolsize} G_traceGradientFunc{wid}: G_func{wid;`gradient} G_graphXlabelFunc{wid}: G_func{wid;`xlabel} G_graphXXlabelFunc{wid}: G_func{wid;`Xlabel} G_graphYlabelFunc{wid}: G_func{wid;`ylabel} G_graphYYlabelFunc{wid}: G_func{wid;`Ylabel} G_graphXsubLabelFunc{wid}: G_func{wid;`xsublabel} G_graphXXsubLabelFunc{wid}: G_func{wid;`Xsublabel} G_pageIndexFunc{wid}: if (~0zG_func{wid;`color}) z G_pageBoldFunc{wid}: G_func{wid;`bold} G_pageBlinkFunc{wid}: G_func{wid;`blink} G_pageUnderlineFunc{wid}: G_func{wid;`underline} G_varEw{var}: EDITSPACEg_varEw{var} G_graphXlabelFormatFunc{wid}: G_func{wid;`xlabelout} G_graphXXlabelFormatFunc{wid}: G_func{wid;`Xlabelout} G_graphYlabelFormatFunc{wid}: G_func{wid;`ylabelout} G_graphYYlabelFormatFunc{wid}: G_func{wid;`Ylabelout} G_graphXsubLabelFormatFunc{wid}: G_func{wid;`xsublabelout} G_graphXXsubLabelFormatFunc{wid}: G_func{wid;`Xsublabelout} G_scaleLabelOut{wid}: G_func{wid;`labelout} G_varDefaultedFunc{var;r;d;f}: if (()zG_func{var;r}) d else if_convert{z;f} G_cons{var;r}: { (cx;var)var; (gf;df)internal_get_of{class_of_symbol{cx,var;0};r}; if (()zgf{cx,var}) >df else z } G_func{u;r}:G_func_flagged{u;r;0} G_func_flagged{u;r;flag}: { (cx;var)c_c{if (`sym=u) u else g_data{u}}; (gf;df)internal_get_of{class_of_symbol{cx,var;0};r}; (fn;cd)2if (1`func `null=zgf{u}) z else df else z } S_traceLineColorFunc{wid;x}: S_func{wid;`linecolor;x;ret_trace_linecolor;0;0;} S_traceFillColorFunc{wid;x}: S_func{wid;`fillcolor;x;ret_trace_fillcolor;0;0;} S_traceLineStyleFunc{wid;x}: S_func{wid;`linestyle;x;ret_trace_linestyle;0;0;} S_traceSymbolFunc{wid;x}: S_func{wid;`symbol;x;ret_trace_symbol;0;0;} S_traceLegendFunc{wid;x}: S_func{wid;`legend;x;ret_trace_legend;0;0;} S_traceLineWidthFunc{wid;x}: S_func{wid;`linewidth;x;ret_trace_client;0;0;} S_traceStyleFunc{wid;x}: S_func{wid;`style;x;ret_trace_client;0;0;} S_traceYYaxisFunc{wid;x}: S_func{wid;`yaxis;x;ret_trace_client;0;0;} S_traceXaxisFunc{wid;x}: S_func{wid;`xaxis;x;ret_trace_client;0;0;} S_traceSymbolSizeFunc{wid;x}: S_func{wid;`symbolsize;x;ret_trace_client;0;0;} S_traceGradientFunc{wid;x}: S_func{wid;`gradient;x;ret_trace_client;0;0;} S_graphXlabelFunc{wid;x}: S_func{wid;`xlabel;x;ret_client;0;0;} S_graphXXlabelFunc{wid;x}: S_func{wid;`Xlabel;x;ret_client;0;0;} S_graphYlabelFunc{wid;x}: S_func{wid;`ylabel;x;ret_client;0;0;} S_graphYYlabelFunc{wid;x}: S_func{wid;`Ylabel;x;ret_client;0;0;} S_graphXsubLabelFunc{wid;x}: S_func{wid;`xsublabel;x;ret_client;0;0;} S_graphXXsubLabelFunc{wid;x}: S_func{wid;`Xsublabel;x;ret_client;0;0;} S_pageIndexFunc{wid;x}: S_func{wid;`color;if (()x) 0 else x;ret_page_client;0;0;} S_pageBoldFunc{wid;x}: S_func{wid;`bold;x;ret_page_client;0;0;} S_pageBlinkFunc{wid;x}: S_func{wid;`blink;x;ret_page_client;0;0;} S_pageUnderlineFunc{wid;x}: S_func{wid;`underline;x;ret_page_client;0;0;} S_matrixColSpaceFunc{wid;x}: S_func{wid;`colspace;x;ret_matrix_space;0;0;} S_graphXlabelFormatFunc{wid;x}: S_func{wid;`xlabelout;G_Null{wid;x;`xlabelout};out_default;0;1;} S_graphXXlabelFormatFunc{wid;x}: S_func{wid;`Xlabelout;G_Null{wid;x;`Xlabelout};out_default;0;1;} S_graphYlabelFormatFunc{wid;x}: S_func{wid;`ylabelout;G_Null{wid;x;`ylabelout};out_default;0;1;} S_graphYYlabelFormatFunc{wid;x}: S_func{wid;`Ylabelout;G_Null{wid;x;`Ylabelout};out_default;0;1;} S_graphXsubLabelFormatFunc{wid;x}: S_func{wid;`xsublabelout;G_Null{wid;x;`xsublabelout};out_default;0;1;} S_graphXXsubLabelFormatFunc{wid;x}: S_func{wid;`Xsublabelout;G_Null{wid;x;`Xsublabelout};out_default;0;1;} S_scaleLabelOut{wid;x}: S_func{wid;`labelout;G_Null{wid;x;`labelout};out_default;0;1;} S_varRoFunc{var;x}: S_func{var;`protect;x;ret_scalar_client;1;2;} S_varFontFunc{var;x}: S_func{var;`font;convert_if{x;font_to_id};ret_scalar_client;1;2;} S_varFgFunc{var;x}: S_func{var;`fg;convert_if{x;color_to_pixel};ret_scalar_client;1;2;} S_varBgFunc{var;x}: S_func{var;`bg;convert_if{x;color_to_pixel};ret_scalar_client;1;2;} S_varReportFontFunc{var;x}: S_func{var;`reportfont;x;ret_scalar_client;0;2;} S_varReportStyleFunc{var;x}: S_func{var;`reportstyle;x;ret_flat_scalar_client;0;0;} S_varTitleColorFunc{var;x}: S_indexed_func{var;`labelfg;convert_if{x;color_to_pixel};`matrix;(ret_matrix_client;ret_scalar_client);0;1;0;0} S_varTitleFontFunc{var;x}: S_indexed_func{var;`labelfont;convert_if{x;font_to_id};`matrix;(ret_matrix_client;ret_scalar_client);0;1;0;0} S_varInFunc{var;x}: S_indexed_func{var;`in;x;;in_default;0;0;0;0} S_varTitleFunc{var;x}: S_indexed_func{var;`label;x;`matrix;(ret_matrix_label;ret_slot_label);0;0;0;1} S_varOutFunc{var;x}: S_indexed_func{var;`out;x;;out_default;1;0;1;1} reset_out_func{var}: S_indexed_func{var;`out;G_varOutFunc{var;};;out_default;0;0;1;1} S_varGeoFunc{var;x}: { (fn;cd) if (`func=x) 2x else if (`null=x) (geo_compute;x) else if (0<#x) (ret_geo_client;x) else (geo_compute;x); s_varGeoFunc{var;fn,df; if (~()xif (`sym=x) x else x) sf{cx,var;x}; cls } eval_space{cx;var}:if (0=G_evaluate{cx,var}) (0;) else (1;cx%var) matrix_spacing{cx;var}: { (fn;cd)out_function{cx,var}; (gn;dd)2g_varTitleFunc{cx,var}; flag0<#gn; if (0=rc (rc;val)eval_space{cx;var}) DATASPACE; zif (flag) 0#1apply{gn;(dd;;(;);;cx;var)} else if (0=#val) 1 else 1+##val; (i#j1#val) do { d(;ki#j)#val; twif (flag) 0#1apply{gn;(dd;;(;k);;cx;var)} else (1+k)26; zz,if (~((val)`float `int `char)^(cd())^internal{fn}) tw#,apply{fn;(cd;0#1,1d;(0;k);;cx;var)} else if (WP=0) twDATASPACE else tw`int0#0 1w_p{if ((WP=1)WP#d) d else WPd} }; `intz } S_varCw{var;x}: { (cx;var)var; if (()x) xcompute_width{cx;var;class_of_symbol{cx,var;0}}; if (1x) xg_varCw{cx,var}compute_width{cx;var;class_of_symbol{cx,var;0}}; s_varCw{cx,var;x}; if (g_varEw{cx,var}0) s_varEw{cx,var;AUTOEDITSPACE#x,EDITSPACE}; } S_varEw{var;x}: s_varEw{var;if (0x) g_varCw{var} else EDITSPACE} if (0=#x) xAUTOEDITSPACE adjust_width{cx;var;cls}: if (0cwg_varCw{cx,var}compute_width{cx;var;cls}) S_varCw{cx,var;cw} compute_width{cx;var;cls}: if (0=#cls) 1 else if (0=#fnspace_of_class{cls}) 1 else 1fn{cx;var} adjust_matrix_width{cx;var}: if (0widg_varWid{cx,var}) if (1G_matrixColSpaceFunc{wid}) S_matrixColSpaceFunc{wid;1} slot_width{cx;var}: { (fn;cd)out_function{cx,var}; if (0=rc (rc;d)eval_space{cx;var}) DATASPACE; (syms;vals),d; zDATASPACE; (i#syms) do if (0=valivals) zz#,apply{fn;(cd;val;;i#syms;cx;var)}; z } scalar_width{cx;var}: { (fn;cd)out_function{cx,var}; if (0=rc (rc;d)eval_space{cx;var}) DATASPACE; typd; if (~(096)^123>h`int1h c3h{c3}: if (1c3) () else '#',(,16 16`intc3)#'0123456789ABCDEF' cc3{c}: if (()c) 1 1 1 else if ((#COLOR_NAMES)=iCOLOR_NAMESc) 1 1 1 else i#COLOR_NUMBERS c3c{c3}: if (1c3) () else if ((#COLOR_NUMBERS)=iCOLOR_NUMBERSc3) () else i#COLOR_NAMES hc{h}: if (()h) () else (t/t+/@1(COLOR_NUMBERS -@1 hc3{h})*2)#COLOR_NAMES ch{c}: if (()c) () else c3h{cc3{c}} h_c_exact{h}: if ('#'1h) h else if ((#COLOR_NUMBERS)=iCOLOR_NUMBERShc3{h}) h else i#COLOR_NAMES shade{n;x}: c3h@1{0a,a+@1+\(1n-1)/1!(b-a)1n-1} bcc3{1#x} acc3{0#x} closest{c3}: hc{c3h{c3}} *** Brian's forking cover unix_exec{x}:if (0=#x,if (0=x) tokens{x} else x) 0 else sys.sfe{0x;(>c.ptr{x}),0} unix_read{argv}: { z''; if (0<#fdunix_exec{argv}) { buf1024''; while (0(/>#x)١x vtom{y;x}:etom{vtoe{y;x}} vtoe{y;x}:if (0<#x) 1ա((~quoted{x})^x=y)xy,x dltb{x}:((\x' ')^\x' ')/x deb{x}:(quoted{x}(x' ')x1x)/x db{x}:dltb{deb{x}} *** Polyadic function apply apply{f;x}: { case (_valence{f} if (1=f) f<{f}) { 0; f{}; 1; f{0x}; 2; f{0x;1x}; 3; f{0x;1x;2x}; 4; f{0x;1x;2x;3x}; 5; f{0x;1x;2x;3x;4x}; 6; f{0x;1x;2x;3x;4x;5x}; 7; f{0x;1x;2x;3x;4x;5x;6x}; 8; f{0x;1x;2x;3x;4x;5x;6x;7x}; 9; f{0x;1x;2x;3x;4x;5x;6x;7x;8x}; `valence } } *** Boxed array formatting execute{x}: { if (0=#x,x) () else if (0=#z(~quoted{x})/x) zx else if (~/(1١1ա(z=' ')z' ',z)0 1 2 5#ALPHA_NUM) zx else `domain; if (0zx) z else `domain } box{x}: boxArray{if (1=x) <{x} else x;1} boxArray{x;y}: { one1=tsx/sxx; smp~bxd0#v,x) y,1v else if (~xi+(jv[1]-iv[0])nx) y,1v else y,(if (i=0) '' else (1i),'+'),(if (j=1) '' else (1j),''),'',1n } boxSym{x}: if (^/(z`charx)'.',0 1 2 3#ALPHA_NUM) '`',z else '''',z,'''' boxSymVec{x}: { if (1=#x) x else if (^/b'`'=,0ءx) x else { b~b; (br;c)(1b),0;x); c(<',('),c,')'; if (1br) (br/c)(br/c),','; (b/x)c; zx; (','=1z)z } } function_name{x}:if (0=0zdo _name{x}) 1z else x pretty_print{x}:'(',(NEWLINE,(+/@12!1,1mask{x}^x=';')x1բ1x),NEWLINE,')' mask{x}: mask_parens{x}^mask_quotes{x} mask_parens{x}: ~r1r0(+\x='(')++\1x=')' mask_quotes{x}: ~(r1r2|+\'"'=x)r1r2|+\''''=x double_quote{x}:(1+x='''')/x *** Warnings and errors print_message{cx;var;x;pfx}: { if (`int=cx) (cx;var)g_data{cx}; msgpfx,variable_print_name{cx;var},,x; if (0<#MSG) ((0#MSG)%1#MSG)msg else ' ',,msg; } print_alert{cx;var;x}: if (QUIET=0) print_message{cx;var;x;' '} print_error{cx;var;x}: if (ERROR=1 if (QUIET0 1) print_message{cx;var;x;'! '}) abort{} print_abort{cx;var;x}: abort{} if (QUIET0 1 2) print_message{cx;var;x;'!! '} abort{}: if (ABORT=1 beep{()}) () else 'S error' variable_print_name{cx;var}: { if (0=#var) (); if (`s`JUNKcx,var) (); if (`int=var) (cx;var)g_data{var}; if (0=#cx) cx`; variable_title{cx;var},': ' } *** Assorted utilities sdipcv{cx}: header{cx;'s;d;i;p;c;v'} scv{cx}: header{cx;'s;c;v'} header{cx;hdr}: { z(); (i#a_nl{cx;`fns}) do if ((1++/';'=hdr)=_valence{fn<{cx%i#a}}) if (hdr(1+fmt'{')(fmt'}')fmtfn) zz,i#a; z } internal{f}: `s0#c_c{_name{f}} unique{z}: (zz)=#z matrify{x}: (21 1,x)x arrayify{x;y}: ((-y)(y1),x)x lcm{x}: 1+(/x.|1+ɫ/xunique{x}/x)0 wrap{v;n}: 1NEWLINE,ء(1,1b1b(+\((+/c)n)n)+\c>#v)v wrap_n{x;y;w}: z (i#x z()) do zz,<_ssr{wrap{ix;y};NEWLINE;NEWLINE,w' '} touches{a;b}: topos{a;b;0} overlaps{a;b}: topos{a;b;1} topos{a;b;f}: { apa[0 0 1 1]+0 1 0 1\a[2 3]; bpb[0 0 1 1]+0 1 0 1\b[2 3]; map.-bp; z^/((0=t[0])/t[0]t,m[0 1;0 1]),(0=t[0])/t[0]t,m[2 3;2 3]; if (f) zz^~/ap=bp[1 0 3 2]; z } *** Safe indexing index{i;v}:if (^/i<#v) i#v *** Nested array of character vectors to indented character matrix nested_to_indented{x}: { if (0=x) xx) (/1աҡx)@1x(2١1,1,ҡx)ҡx else (/>1#ҡz)@1z(2١1,1,ҡz)ҡz(t)#((~t)/x),' ',@1&{t/x}; (21 1,z)z } *** Go for it Gf{x}:z `Gf _ssv x z_gsv `Gf *** Protected pick pick{x;y}: { gGf{1}; (rc;z)do xy; Gf{g}; if (rc=0) z } *** Nested association-list to slot-filler (recursive) rsf{o}:z Gf{g} zrsf_recurse{o} gGf{1} rsf_recurse{o}:if (0rc (rc;z)do _alsf{o}) o else (r;v) if (1b0<ؽv (r;v)z) (b/v)&{b/v} *** Nested slot-filler to association-list (recursive) ral{o}:if (~_issf{o}) o else (<0z),<@01z z(0o;&1o) *** Generate all paths of a nested slot-filler rsf_paths{sf}:if (_issf{sf}) (ۡ0sf),if (1b`null>1sf)((/>#z)١z zimt_recurse{y;x} imt_recurse{y;x}: { symsΡ0x; vals(#0x)(); b>_issf{1x}; if (1b) (b/vals)y,&{y;b/1x}; b(~b)^`null>1x; if (1b) (b/syms)(b/syms),':',box{b/1x}; (':'šnams; b(>#nams)>i i>namsɡ':'; if (1b) (b/nams)(b/i)١b/nams (b/vals)(b/i+1)աb/nams; syms>¡nams; if (1b b~b) (b/vals)&{y;1@11աb/vm}; (syms;vals) } } *** Dag depths; i.e. dag_depth HERITAGE; returns (nodes;depths) dag_depth{x}: { uunique{,x}/,x; z(u;ۡ(#u)Ң1); (i#u) do zdag_depth_{x;i#u;z}; z } dag_depth_{x;u;z}: { (uz)if (1uz) uz else if (~1bx[;1]=u) 0 else { kb/x[;0]; (i#k) do z&{x;i#k;z}; 1+/>>((0z)k)#1#z }; z } *** Untab untab{x;y}: { dels(1xTAB,NEWLINE)/#x; ld((dels,#x)-0,dels)/0,dels; ns1+y|1+ld-#x; ((tabsx=TAB)/x)' '; (1+tabsns-1)/x } *** Self access (simulates "slot" attribute of variables) of_widget{r;wid}: { (s;v)2g_sflags{wid}; if ((#s)>isr) iv } widget_has{wid;r;x}: { (s;v)2g_sflags{wid}; if ((#s)>isr) (iv)x else (s;v)(s,r;v,syn)/>att } *** State-script save and load script{}: { obs(G_script@0{obs})/obsobjects{}; if (0<#swtstateOfSwitches{}) swtswt,NEWLINE; if (0<#parstateOfParameters{}) parpar,NEWLINE; if (0<#cststateOfClass{realClasses{}}) cstcst,NEWLINE; if (0<#odfstateOfObjects{obs}) odfodf,NEWLINE; obs(obs=pars)/obs(0<#parsG_Parent{g_varWid@0{obs}})/obs; if (0<#stsG_state{obs}) stssts,NEWLINE; swt,par,cst,sts,odf } save{file}:write{file;script{}} write{file;text}: { if (2=#text) text,text,@1"\n"; fdsys.open{file;`O_CREAT `O_TRUNC `O_RDWR;8 8 810 10 10666}; if (0>sys.write{fd;text;text}) 'write failed'; sys.close{fd}; } load{file}: { rosreference_objects{}; old(~oldros)/oldSYMBOLS; _load{file}; new(~newros)/newSYMBOLS; add(~newold)/new; rmv(~oldnew)/old; (q_n{add};q_n{rmv}) } *** State-script construction state{cx;var}:state_of_object{cx;var;g_varClass{cx,var};g_varWid{cx,var};} state_of_object{cx;var;cls;id;r}: { pclsclass_of_id{g_parent{id}}; zflagzero_parent{id}; vflag~clsrealClasses{}; gflag1`vgrid `hgridpcls; aflag`positionedflat_super{pcls}; pflag(`windowpcls)zflag`pixeledflat_super{cls}; rm(); if (~zflag) rmrm,`yx; if (~pflag) rmrm,`yxs; if (~aflag) rmrm,`at; if (~gflag) rmrm,`extent; rif (rflag()r) editable_attributes{cls} else ,r; if (rflag) if (`extentrm) if (~/`yxs`yxrm) if (^/`yxs`yxr) rm`yx`yxs,(rm`extent)/rm; if (rflag) r(~rrm)/r; wget_attributes{cx;var;id;cls;`r;0}; b`sym=>w; (s;w)(diDEFAULTS) { (s;w)(ir`extent) if (0 02kiv) (r;v)(`yxs,b/r;(<2k),(bi#r)/v); (r;v) } filter_default_colors{cx;var;r;v;cls}: { (rr;dd)(''CLASSEScls)ء(ATTRIBUTES;DOMAIN_SYMS); (i#COLORS) do (r;v)(<~(r(>dd'color',1i)/rr)^>vi#COLORS)/(r;v); (r;v) } filter_default_font{cx;var;r;v;cls}: { (rr;dd)(''CLASSEScls)ء(ATTRIBUTES;DOMAIN_SYMS); (<~(r(>dd`font)/rr)^>vi; (i;pd)(ir`verify) if (clsstolen_classes{}) (r;v)(b/r;(bi#r)/v); (r;v) } filter_default_colspace{cx;var;r;v;cls}: { if ((#r)>ir`colspace) if (matrix_spacing{cx;var},iv) (i#v)<1; (r;v) } filter_default_attributes{cx;var;r;v;cls;rr;vv}: { (j#rr) do if ((#r)>irj#rr) if ((,jvv),iv) (r;v)(b/r;(bi#r)/v); (r;v) } filter_default_tablist{cx;var;r;v;cls}: { if (~zero_parent{widg_varWid{cx,var}}) (r;v) else if ((#r)=ir`tablist) (r;v) else if (~((,iv),cxvar)(,iv),(g_varWid@0{pi})#piprimitives_in{wid}) (r;v) else if ((1<#iv)^(,iv)natural_tab_order{wid}) (r;v) (iv)` else (b/r;(bi#r)/v) } filter_default_iconic{cx;var;r;v;cls}: { if ((#r)>ir`iconic) if ((WScx,var)((,0),iv)) (r;v)(r;b\(bi#r)/v); (r;v) } filter_default_rows_cols{cx;var;r;v;cl}: { if (is_subclass_of{cl;`vector}) { if ((#r)>ir`rows) if (((drs<5)^rsdrsfilter_rows{cx;var;cl})5rsiv) vb\(bi#r)/v; if ((#r)>ir`cols) if (((dcs<2)^csdcsfilter_cols{cx;var;cl})2csiv) vb\(bi#r)/v; }; (r;v) } filter_rows{cx;var;cl}: { case (flat_super{cl}) { `array `view; #cx%var; `table; if (0=#dcx%var) 0 else #0,d } } filter_cols{cx;var;cl}: { case (flat_super{cl}) { `array; case (#dcx%var) { 0 1; 1; 2; 1#d }; `view; 1#cx%var; `table; #cx%var } } *** Virtual creates C_AXGraphTrace{par}: g_varWid{`s.GRAPH_TRACE} C_AXTableField{par}: g_varWid{`s.TABLE_FIELD} C_AXMenuPulldown{par}: g_varWid{`s.MENU_PULLDOWN} C_AXMenuSeparator{par}: g_varWid{`s.MENU_SEPARATOR} C_AXMenuToggle{par}: g_varWid{`s.MENU_TOGGLE} C_AXMenuButton{par}: g_varWid{`s.MENU_BUTTON} *** Initialization initialize_array{v}: { z(;;;0;0;0;0;;;;); if (0=s#v) z; nsp#z; m0,+\(1+n)p; zib1 b`s0#_name@0{0z}) iءz remove_eval{cx;var;typ}:if (~()zeval_callback{cx;var;typ}) remove_reference{cx;var;typ;0z} append_eval{cx;var;typ;x}: { remove_eval{cx;var;typ}; append_reference{cx;var;typ;0x;1x} x2x; } *** Reference callback list processing reference_type{typ}:typ((__gprcb;__sprcb;pre_reference_callback);(__grcb;__srcb;reference_callback)) append_reference{cx;var;typ;fun;cd}: { if (()fun) (); (fn;k;scb)analyze_reference{cx;var;typ;fun;cd}; if (0=#k) k,b/cv) set_attributes{cx;var;id;cls;bb/b/at;(+/bb)();0}; if (1b b~b) if (1bb((b/cv)b/cv) set_attributes{cx;var;id;cls;bb/b/at;(+/bb)ivarscxvar) (cx,var) has (iatts;i,WM_SAVE_YOURSELF_DAT); } } save_yourself_file{s;d;i;p;c;v}: { s.WM_SAVE_YOURSELF if (d()) save_yourself_variables{()} else if (()stsave_yourself_state{d}) <{save_yourself_scv} save_yourself_variables{()} else <{save_yourself_scv} save_yourself_variables{st}; } save_yourself_state{d}: { gGf{1}; if (0rc (rc;z)do sys.imp{d}) z(); Gf{g}; z } save_yourself_variables{x}: { (a;b)2x; s.WM_SAVE_YOURSELF_CTL2a; s.WM_SAVE_YOURSELF_DATb; } save_yourself_scv{s;c;v}: { (vars;atts)2WM_SAVE_YOURSELF_CTL; z(); (i#vars) do z[,]<(iatts) of i#vars; s.WM_SAVE_YOURSELF_DATz; WM_SAVE_YOURSELF_FILEsys.exp{(WM_SAVE_YOURSELF_CTL;WM_SAVE_YOURSELF_DAT)}; } set_save_yourself_callback{}: { append_reference{`s;`WM_SAVE_YOURSELF;1;<{set_wm_save_yourself};}; is_object{`s`WM_SAVE_YOURSELF;OBJECT_CLASS}; s.WM_SAVE_YOURSELFWM_SAVE_YOURSELF; if (0s_savewmWindow{g_parent{g_varWid{`s`WM_SAVE_YOURSELF}}}) print_abort{`s;`WM_SAVE_WINDOW;'cannot receive signal'}; _scb{`s.WM_SAVE_YOURSELF_FILE;(save_yourself_file;)}; _spcb{`s.WM_SAVE_YOURSELF_CTL;(save_yourself_ctl;)}; } save_yourself_ctl{s;d;i;p;c;v}:z (0z)_gsv{`cx}0z z_alsf{d} set_wm_save_yourself{s;d;i;p;c;v}: { if (1=d) d<{d}; if ((;)2d) d<{wm_save_yourself}; S_cb{g_parent{g_varWid{c,v}};`saveyourself;2d}; } wm_save_yourself{s;c;v}:print_alert{c;v;'signal detected - no action'} *** System utilities hasScheme{sym;sf}: { (c;v)c_c{sym}; sf_alsf{sf}; vars(cv),G_Descendents{widget{c,v}}; clssg_varClass@0{vars}; uclss((clssclss)=#clss)/clss; atts(uclssclss)#attributesOfClass{<,0sf;uclss}; vars has@0 1 (ءatts),@0(<@1>#>atts)/<,1sf; } set_gray{s;d;i;p;c;v}: s_busyTitleState{d} set_clock{s;d;i;p;c;v}: s_busyClockState{d} set_busy{s;d;i;p;c;v}: s_busyState{d} set_quiet{s;d;i;p;c;v}: bGraphDebug{0d} set_beep{s;d;i;p;c;v}: s.BEEP0 beep{()} set_menuDefaultMnemonic{s;d;i;p;c;v}: bsetMenuDefaultMnemonic{d} set_doubleClickInterval{s;d;i;p;c;v}: bsetDoubleClickInterval{d} set_backingstore{s;d;i;p;c;v}: bsetBackingStoreOption{d} reset_data{s;d;i;p;c;v}:if (s1=d) (j#SYMBOLS) do s_data{g_varWid{cx,var};cx,var} (cx;var)j#SYMBOLS construct_tree{}: { s.SUPERunique{t}/t_flat{superClasses{CLASSES}}; s.SUBunique{t}/t_flat{subClasses{CLASSES}}; s.PROPER_SUBproper_subclasses{CLASSES}; } inherit_attributes{i;j;r}: { riiATTRIBUTES; b~rir; (is.ATTRIBUTES) b/ri; (is.GETS) b/iGETS; (is.SETS) b/iSETS; (is.CONVERTER) b/iCONVERTER; (is.EDITABLE) b/iEDITABLE; (is.WIDGETABLE) b/iWIDGETABLE; (is.ATTRIBUTE_TYPES) b/iATTRIBUTE_TYPES; (is.INTERNAL_GETS) b/iINTERNAL_GETS; (is.INTERNAL_SETS) b/iINTERNAL_SETS; (is.SYNTHESIZED) b/iSYNTHESIZED; (is.DOMAIN_SYMS) b/iDOMAIN_SYMS; (is.DEFAULTS) b/iDEFAULTS; inherit_structure{i;j}; } flat_structure{}: { cls(0=>#PROPER_SUB)/CLASSES; stk(); (i#cls) do stkrecurse_structure{i#cls;stk}; } recurse_structure{cl;stk}: { stk[,]cl; iCLASSEScl; pcliPROPER_SUPER; (j#pcl) do { if (~pcl[j]stk) stk&{pcl[j];stk}; inherit_structure{i;CLASSESpcl[j]}; }; stk } inherit_structure{i;k}: { if (0=#iSET_FNS) if (0<#sfkSET_FNS) (is.SET_FNS)sf; if (0=#iPRESET_FNS) if (0<#pfkPRESET_FNS) (is.PRESET_FNS)pf; if (0=#iVERIFY_FNS) if (0<#vfkVERIFY_FNS) (is.VERIFY_FNS)vf; if (0=#iSPACE_FNS) if (0<#spfkSPACE_FNS) (is.SPACE_FNS)spf; (is.NULL_DEFAULTS)t,(~ndtis.NULL_DEFAULTS)/ndks.NULL_DEFAULTS; rjkATTRIBUTES; riiATTRIBUTES; if (1b~rjri) { (is.ATTRIBUTES) (is.ATTRIBUTES), b/rj; (is.GETS) (is.GETS), b/kGETS; (is.SETS) (is.SETS), b/kSETS; (is.CONVERTER) (is.CONVERTER), b/kCONVERTER; (is.EDITABLE) (is.EDITABLE), b/kEDITABLE; (is.WIDGETABLE) (is.WIDGETABLE), b/kWIDGETABLE; (is.ATTRIBUTE_TYPES) (is.ATTRIBUTE_TYPES), b/kATTRIBUTE_TYPES; (is.INTERNAL_GETS) (is.INTERNAL_GETS), b/kINTERNAL_GETS; (is.INTERNAL_SETS) (is.INTERNAL_SETS), b/kINTERNAL_SETS; (is.DOMAIN_SYMS) (is.DOMAIN_SYMS), b/kDOMAIN_SYMS; (is.DEFAULTS) (is.DEFAULTS), b/kDEFAULTS; (is.SYNTHESIZED) (is.SYNTHESIZED), (+/b)0; } } *** Documentation functions begin. doc{file}: { write{file; docOfBindings{}, docOfFunctions{}, docOfSwitches{}, docOfParameters{}, docOfErrors{}, docOfDomains{}, docOfKey{}, docOfClasses{}, docOfAttributes{}, docOfTypes{} } } docOfBindings{}: { NEWLINE, (40'='),' bindings ',(40'='), NEWLINE, NEWLINE, "default class bindings (show `a, a not bound):", NEWLINE, "", NEWLINE, NEWLINE, " if (type = `box) `radio `check `slot `layout `array `scalar", NEWLINE, " else if (type = `func) `button", NEWLINE, " else if (rank = 2) `layout `array `scalar", NEWLINE, " else if (rank = 1) `table `graph `layout `array `scalar", NEWLINE, " else `scalar", NEWLINE } docOfFunctions{}: { NEWLINE, (40'='),' functions ',(40'='), NEWLINE, NEWLINE, " object = `cx.var or `cx`var; `var (current_context),`var", NEWLINE, " class = primitive or derived S display class", NEWLINE, " att(s) = symbolic vector of attribute name(s)", NEWLINE, " sfal = slotfiller or association-list", NEWLINE, " gs = ((g_func;s_func); ... ;(g_func;s_func))", NEWLINE, " ags = (`att ... `att;gs)", NEWLINE, NEWLINE, " `obj has (`att;val) ... attribution", NEWLINE, " `obj has `.att `cx.var ... electric attribution", NEWLINE, " `class s.Has (`att;val) ... class defaulting", NEWLINE, " `class s.Has `.att `cx.var ... electric class defaulting", NEWLINE, NEWLINE, "in the . context:", NEWLINE, "", NEWLINE, "objectobject is class ... bind object to class", NEWLINE, "objectsfree object ... unbind object, return objects freed", NEWLINE, NEWLINE, "objectobject has sfal ... object has attributes in sfal", NEWLINE, "vals[sfal or atts] of object ... values of attributes in 0sfal or atts", NEWLINE, NEWLINE, "show object ... display object; bind to default if free", NEWLINE, "hide object ... remove object from screen if shown", NEWLINE, NEWLINE, "in the s. context:", NEWLINE, "", NEWLINE, "objectsobjects are classes ... guided top-down multiple binding", NEWLINE, NEWLINE, "tofrom copy to ... copy S attributes to a set of variables", NEWLINE, "var call event ... call the default callback for event on var", NEWLINE, NEWLINE, "classclass Has sfal ... attributes of class have variable types", NEWLINE, "typesatts Of class ... variable types of attributes of class", NEWLINE, NEWLINE, "class classHas ags ... define or remove attributes from a class", NEWLINE, "gsatts ofClass class ... g_/s_ functions of attributes of a class", NEWLINE, NEWLINE, "object parentHas sfal ... parent of object has attributes", NEWLINE, "valsatts ofParent object ... retrieve value of attributes of parent of object", NEWLINE, NEWLINE, "obsreset{} ... free all objects", NEWLINE, "(classes;atts)Reset{} ... reset all default attributes (slotfiller result)", NEWLINE, NEWLINE, "(1/0)var canBe class ... can variable be bound to class?", NEWLINE, "boolsclass canHave atts ... can class-instance have attributes?", NEWLINE, NEWLINE, "attsattributes class ... attributes of class, including protected", NEWLINE, "attsproperties object ... editable attributes of object", NEWLINE, "valsclass domainOf att ... values in domain of att for class", NEWLINE, NEWLINE, "attsprimitiveTo class ... attributes primitive to class", NEWLINE, "classesclass derivedFrom atts ... classes attributes derived from for class", NEWLINE, NEWLINE, "attsvars attributesOf object ... attributes which have values of variables", NEWLINE, "attsvars attributesOfClass class ... attributes of class which use variables", NEWLINE, NEWLINE, "charvecscript{} ... charvec reconstructs current S environment", NEWLINE, "(bound;free)load file ... load file, return objects bound, free", NEWLINE, "save file ... save script to file", NEWLINE, NEWLINE, "objectsboundTo class ... objects bound to class", NEWLINE, NEWLINE, "objectsobjects{} ... objects bound", NEWLINE, "objectsshells{} ... shells among objects", NEWLINE, "objectstoplevels{} ... toplevel shells among objects", NEWLINE, "objectspopups{} ... popup shells among objects", NEWLINE, NEWLINE, "classesclasses{} ... classes", NEWLINE, "classesrealClasses{} ... classes which can be directly instantiated", NEWLINE, "classesvirtualClasses{} ... classes which cannot be directly instantiated", NEWLINE, "classesmetaClasses{} ... classes which cannot be instantiated", NEWLINE, NEWLINE, "nestedsuperClasses class ... nested array of superclasses of class", NEWLINE, "nestedsubClasses classes ... nested array of subclasses of class", NEWLINE, NEWLINE, "classesvirtualContainers{} ... virtual container classes", NEWLINE, "classesrealContainers{} ... real container classes", NEWLINE, "classescontainers{} ... container classes", NEWLINE, "classesprimitives{} ... non-container classes", NEWLINE, NEWLINE, "objectthis{} ... window which has focus", NEWLINE, "objectswhich sfal ... which objects satisfy attributes-values sfal?", NEWLINE, NEWLINE, "rows colsdesktop{} ... geometry of OLVWM desktop", NEWLINE, "row colhere{} ... this sector of desktop", NEWLINE, "objectbeHere object ... object has `atsector `here", NEWLINE, "goThere{row,col} ... traverse to sector row,col", NEWLINE, "natural{} ... every shell has `naturalsize", NEWLINE, NEWLINE, "refresh{} ... for real object o, o has `refresh", NEWLINE, NEWLINE, "rgbhc3 hex ... hex ('#rrggbb') to rgb (n1,n2,n3)", NEWLINE, "hexc3h rgb ... rgb to hex", NEWLINE, "rgbcc3 clr ... color (`color_symbol) to rgb", NEWLINE, "clrc3c rgb ... rgb to color", NEWLINE, "clrhc hex ... hex to color", NEWLINE, "hexch clr ... color to hex", NEWLINE, "clrsby shade ... interpolate colors", NEWLINE, "clrclosest rgb ... rgb to closest named color", NEWLINE, NEWLINE, "pix/clrcolor clr/pix ... interconvert color and pixel", NEWLINE, "id/fontfont font/id ... interconvert font and font-id", NEWLINE, "pix/1isColor sharpton ... allocate color or fail with 1", NEWLINE, "freeColor pix ... free color", NEWLINE, NEWLINE, "slotrsf assoc ... nested association list to slotfiller", NEWLINE, "assocral slot ... nested slotfiller to association list", NEWLINE, "matdel imt slot ... nested slotfiller to indented matrix", NEWLINE, "slotdel nsf mat ... indented matrix to nested slotfiller", NEWLINE, NEWLINE, "objectwstree symbol ... symbol is tree of objects", NEWLINE, NEWLINE, "dvScroll{s;d;i;p;c;v} ... vertical scrollgroup preset callback", NEWLINE, "dhScroll{s;d;i;p;c;v} ... horizontal scrollgroup preset callback", NEWLINE, NEWLINE, "doc file ... produce this document", NEWLINE, NEWLINE, "CLASS_TREE: ... tree of class hierarchy", NEWLINE, "CLASS_DAG: ... dag of class hierarchy", NEWLINE } docOfSwitches{}: { NEWLINE, (40'='),' switches ',(40'='), NEWLINE, NEWLINE, "s.AUTOPOSITION 1 ... if 1, simple layout vectors stack children vertically", NEWLINE, "s.AUTOBUILD 0 ... if 1, simple layout vectors invoke autobuilder", NEWLINE, "s.AUTOREPARENT 1 ... if 1, orphaned child is reparented to top-level", NEWLINE, "s.AUTORESHOW 1 ... if 1, reparented child is shown if shown in parent", NEWLINE, "s.AUTONEWSHOW 0 ... if 1, newly parented child is always shown", NEWLINE, "s.AUTOEVALUATE 1 ... if 0, avoid evaluation via %", NEWLINE, "s.AUTOEDITSPACE 1 ... if 1, editspace is infinite (EDITSPACE)", NEWLINE, "s.AUTORESPACE 0 ... if 1, increase space in default `out if necessary", NEWLINE, "s.AUTOSCRIPT 1 ... if 1, script{} records variable binding", NEWLINE, "s.AUTOWS 1 ... if 1, s.WS is next window created when s.WS is ()", NEWLINE, "s.AUTOPRINTABLE 1 ... if 1, default printability is 1", NEWLINE, "s.AUTOEXECUTE 1 ... if 1, allow type-change on input, else use _scfi{}", NEWLINE, "s.AUTOCOPY 0 ... if 1, copy on insert, else use na value", NEWLINE, "s.AUTOLITERAL 0 ... if 1, format/validate as a boxed type", NEWLINE, "s.AUTOHAS 0 ... if 1, report every attribute setting", NEWLINE, "s.AUTOBLANK () ... if not (), na value interconverts to AUTOBLANK", NEWLINE, "s.AUTODOC '' ... Default `doc of object", NEWLINE } docOfParameters{}: { NEWLINE, (40'='),' parameters ',(40'='), NEWLINE, NEWLINE, "s.WP 100 ... run format width routine on first WP numbers", NEWLINE, "s.EDITSPACE 256 ... size of infinite edit buffer", NEWLINE, "s.DATASPACE 9 ... default `space", NEWLINE, "s.WS () ... all windows follow the workspace", NEWLINE, "s.WSNAME 'A+' ... default `shelltitle for s.WS", NEWLINE, "s.SHELL 1 ... default shelltype (1 = popup, 0 = toplevel)", NEWLINE, "s.GRAY 1 ... if 1, gray title when busy", NEWLINE, "s.CLOCK 1 ... if 1, clock cursor when busy", NEWLINE, "s.BUSY 0 ... turn busy state on (1) and off (0)", NEWLINE, "s.QUIET 0 ... if 0, all messages; if 1, errors + aborts; if 2, aborts", NEWLINE, "s.ABORT 1 ... if 1, abort, else suspend", NEWLINE, "s.ERROR 0 ... if 1, abort or suspend on error", NEWLINE, "s.MSG () ... error message variable", NEWLINE, "s.BEEP 0 ... emit type n sound", NEWLINE, "s.EXIT () ... if scalar integer, default `exit = _exit{EXIT}", NEWLINE, "s.VERIFY 0 ... if 1, verify all updates to bound variables", NEWLINE, "s.DISCONNECT 0 ... _exit{DISCONNECT} on server disconnect", NEWLINE, "s.SCREEN: ys,xs ... pixel dimensions of screen", NEWLINE, "s.MENUDEFAULTMNEMONIC0 ... use default underlining in menus", NEWLINE, "s.DOUBLECLICKINTERVAL250 ... the interval between clicks for double click event", NEWLINE, "s.BACKINGSTORE 1 ... if 1, backing-store used for all widgets", NEWLINE, "s.OF 0 ... 1 (version 2) or 0 (of{x;y} = x)", NEWLINE, "s.ARE(objects;classes) ... guided top-down multiple binding", NEWLINE, NEWLINE, "s.WM_SAVE_YOURSELF() ... foo{s;c;v} = save yourself callback", NEWLINE, "s.WM_SAVE_YOURSELF_FILE() ... file in which to save state", NEWLINE, "s.WM_SAVE_YOURSELF_CTL() ... slotfiller of (variables;attributes)", NEWLINE, "s.WM_SAVE_YOURSELF_DAT() ... values of attributes in WM_SAVE_YOURSELF_CTL", NEWLINE, NEWLINE, "s.COLOR_NAMES: ... symbols of colors", NEWLINE, "s.COLOR_NUMBERS: ... rgb values of colors", NEWLINE, "s.FONT_NAMES: ... character matrix of fonts", NEWLINE, "s.REPORT_FONT_NAMES: ... character matrix of report fonts", NEWLINE, NEWLINE, "s.NA ... default NA slotfiller for `insertabove, `insertbelow", NEWLINE, NEWLINE, "s.LINECOLORS ... default trace linecolors", NEWLINE, "s.FILLCOLORS ... default trace fillcolors", NEWLINE, "s.LINESTYLES ... default trace linestyles", NEWLINE, "s.TRACESYMBOLS ... default trace scatter symbols", NEWLINE, NEWLINE, "s.DISPLAY ... symbol of current display", NEWLINE, "s.SERVER: ... server id of current display", NEWLINE, "s.CONNECTED ... slotfiller of display-server connections", NEWLINE, NEWLINE, "s.HERITAGE: ... dag of subclassing relations in S", NEWLINE, NEWLINE, "s.IO `tio `dio `qio ... contexts of `s.io-based in/out routines", NEWLINE, NEWLINE, "s.COLORS `grey `black `pink `lightsteelblue3 `mediumaquamarine `yellow", NEWLINE, NEWLINE, "s.GREY: COLORS[0]", NEWLINE, "s.BLACK: COLORS[1]", NEWLINE, "s.RED: COLORS[2]", NEWLINE, "s.GREEN: COLORS[3]", NEWLINE, "s.BLUE: COLORS[4]", NEWLINE, "s.YELLOW: COLORS[5]", NEWLINE, NEWLINE, "s.FONT 'kaplgallant-19'", NEWLINE } docOfTypes{}: { zNEWLINE,(40'='),' types ',(40'='),NEWLINE; zdocOfGlobalAttributes{COLOR_ATTRIBUTES;'COLORS';1;z}; zdocOfGlobalAttributes{,i#atts; if (1b0<>#bts) { mwrap_n{'`',Ρb/bts;64;23}; m(15١Ρb/clss),':',(<3' '),m; tNEWLINE,' ',t,NEWLINE,' ',(1+#tstr,(if (flag) '[',(1i),']'),':')''; zz,NEWLINE,t,NEWLINE,(<' '),m; }; }; z } docOfKey{}: { atsATTRIBUTES; atypsATTRIBUTE_TYPES; cnvrtCONVERTER; NEWLINE, (40'='),' classes ',(40'='), NEWLINE, NEWLINE, " (class) = metaclass", NEWLINE, " [class] = virtual class", NEWLINE, NEWLINE, " = protected attribute", NEWLINE, " * = persistent attribute", NEWLINE, ' o = "`attribute of `object" is defined', NEWLINE, ' h = "`object has `attribute" is defined', NEWLINE, ' = ambivalent "of": val(`attribute;parm) of `object', NEWLINE, ' = if (), inherit value from parent (e.g. `bg) or self (e.g. `scrollbg)', NEWLINE, NEWLINE, ' [...] = domain of attribute', NEWLINE, ' () ... = null converted to ...', NEWLINE, NEWLINE, " real classes:", NEWLINE, NEWLINE, (1NEWLINE,<@1 75!(75(#t)75)tآ15١Ρclasses{}), NEWLINE, NEWLINE, (90'.'), NEWLINE, NEWLINE, " foo{s;c;v} = event callback:", NEWLINE, NEWLINE, " s = static data, i.e. `object has (`event;(foo;s))", NEWLINE, " c = context symbol", NEWLINE, " v = variable symbol", NEWLINE, NEWLINE, (1NEWLINE,<@1 75!(75(#t)75)tآ15١Ρsym_sort{unique{t}/t((3cnvrt)^atyps=1)/ats}), NEWLINE, NEWLINE, (90'.'), NEWLINE, NEWLINE, " foo{s;c;v} = event callback, boolean default switch:", NEWLINE, NEWLINE, " `object has (;1) = turn on default callback", NEWLINE, " `object has (;0) = turn off default callback", NEWLINE, NEWLINE, (1NEWLINE,<@1 75!(75(#t)75)tآ15١Ρsym_sort{unique{t}/t((3=cnvrt)^atyps=1)/ats}), NEWLINE, NEWLINE, (90'.'), NEWLINE, NEWLINE, " {z}foo{s;d;i;p;c;v} = variable callback:", NEWLINE, NEWLINE, " s,c,v = same as event callback", NEWLINE, " d i#pc%v", NEWLINE, NEWLINE, (1NEWLINE,<@1 75!(75(#t)75)tآ15١Ρsym_sort{unique{t}/t(atyps=2)/ats}), NEWLINE, NEWLINE, (90'.'), NEWLINE } docOfDomains{}: { z''; zz,NEWLINE,(40'='),' domains ',(40'='); zz,NEWLINE; (i#syms syms(~syms`font `color `reportfont,¡(<`color),1ա#COLORS)/syms syms0DOMAINS) do { desc0domainOf{j#CLASSES;((jk)1)#jATTRIBUTES} j(>/kDOMAIN_SYMSš<(#CONVERTER_DESC; (atts;sfns;gfns;edit;cnva;dfls)(')); sfgf((sig#jgfns)#' o'),':',(#jsfns)#' h'; ambiif (sig) (1<_valence{jgfns})#' ' else ' '; zzzz,NEWLINE,' ',((251+wa+1+2#lp)star,lp,(,j#atts),rp),' ',sfgf,' ',ambi,' ',iot,' ',' ... ',dmn,cnv,desc; }; }; z,zz } *** Documentation functions end. add_connection{z;s}: { remove_reference{`s;`CONNECTED;0;<{connected_event}}; s.CONNECTEDCONNECTED,(z;#NULL_DEFAULTS; clss[,]n/CLASSES; atts[,]NULL_DEFAULTS; vals[,](+/n)(); uclsunique{clss}/clss; (i#ucls) do { scls(i#ucls),_flat{subClasses{i#ucls}}; jCLASSESscls; (uatts;uvals)("; `resize ;"constrain v/h behavior on resize (cumulative unless '.' string)"; `vrow ;"virtual row in layout"; `vcol ;"virtual column in layout"; `vrows ;"number of virtual rows in layout"; `vcols ;"number of virtual columns in layout"; `w ;"if 1, make initial width in layout = natural width"; `W ;"if 1, do not change width when layout is resized"; `h ;"if 1, make initial height in layout = natural height"; `H ;"if 1, do not change height when layout is resized"; `l ;"if 1, left-justify object in virtual cell"; `r ;"if 1, right-justify object in virtual cell"; `t ;"if 1, top-justify object in virtual cell"; `b ;"if 1, bottom-justify object in virtual cell"; `R ;"if 1, make virtual rows = maximum virtual row"; `C ;"if 1, make virtual columns = maximum virtual column"; `ys ;"number of pixels in the y-direction"; `xs ;"number of pixels in the x-direction"; `yxs ;" of object"; `y ;"y position of top-left corner"; `x ;"x position of top-left corner"; `yx ;"-position of top-left corner"; `Y ;"absolute y position of top-left corner"; `X ;"absolute x position of top-left corner"; `YX ;"absolute -position of top-left corner"; `extent ;""; `icontitle ;"title of icon"; `icon ;"nm bitmap or (rs;cs;encoded-int-vector) of icon pattern"; `shelltitle ;"title of shell"; `resizeable ;"if 1, shell can be resized"; `leftfoot ;"text of left window-footer"; `rightfoot ;"text of right window-footer"; `foot ;"if 1, show window-footer"; `head ;"if 1, show window-hooder"; `pin ;"if 1, popup shell is pinned"; `iconic ;"if 1, window is a top-level shell"; `leader ;"leader of window"; `followers ;"followers of window"; `followertree ;"nested array of followers of window"; `tablist ;"vector of objects in order of traversal"; `arrowlist ;"matrix of [`from dir `to], where dir `left `right `up `down"; `exit ;"0 or 1, or foo{s;c;v} is called on quit or dismiss event"; `atsector ;"place window at sector (i,j) of virtual desktop (`here for here)"; `fullscreen ;"make window exactly as large as the screen"; `extents ;"(`a ... `z;(y,x,ys,xs;...;y,x,ys,xs)) of real non-containers in shell"; `bg ;"background color of object"; `stars ;"if 1, then if space < out, fill with stars"; `hl ;"color of object when object has focus"; `hlthickness ;"width in pixels of focus color"; `shadowthickness ;"width in pixels of shadow around object"; `state ;"state of object expressed as a script (recursive on containers)"; `stateself ;"state of object expressed as a script (not recursive on containers)"; `settings ;"slot-filler of all or specified current non-default settings of object"; `show ;"action -- map objects and shell"; `realize ;"action -- map objects but not shell"; `hide ;"action -- unmap objects and shell"; `sensitive ;"if 0, window and children insensitive"; `dynamic ;"if 1, window and children resize dynamically"; `focus ;"give object focus (traverse to object)"; `naturalsize ;"recompute natural size of object; on a container --> on children"; `acceptfocus ;"if 1, accept focus"; `tabto ;"object tabs to object specified"; `tabfrom ;"object tabs from object specified"; `leftto ;"object arrows left to object specified"; `rightto ;"object arrows right to object specified"; `upto ;"object arrows up to object specified"; `downto ;"object arrows down to object specified"; `refresh ;"refresh display-related attributes, e.g. `fg and `out"; `insertabove ;"0 or 1, or foo{s;c;v} is called on insertabove event"; `insertbelow ;"0 or 1, or foo{s;c;v} is called on insertbelow event"; `delete ;"0 or 1, or foo{s;c;v} is called on delete event"; `is ;"foo{s;c;v} is called after object is bound"; `in ;"valuefoo{s;d;i;p;c;v} is called to convert a string"; `out ;"stringfoo{s;d;i;p;c;v} is called to convert a value"; `blank ;"value of print-representation of na-value"; `doc ;"documentation on variable (recommended: character vector or matrix)"; `execute ;"if 0, use _scfi{} to retain numeric typing"; `has ;"if 1, report every attribute setting on variable"; `copy ;"if 0, use na value, else copy on insert"; `done ;"foo{s;d;i;p;c;v} is called when screen-update cycle is finished"; `na ;"na value for `insertabove, `insertbelow"; `protect ;"booleanfoo{s;d;i;p;c;v} is called to protect a value"; `protected ;"1 if protected, else 0"; `fg ;"colorfoo{s;d;i;p;c;v} is called for foreground of object"; `font ;"fontfoo{s;d;i;p;c;v} is called for font of object"; `geometry ;"geometryfoo{s;d;i;p;c;v} is called for geometry of slot-filler"; `title ;"title of object"; `titlefg ;"foreground of title of object"; `titlefont ;"font of title of object"; `label ;"stringfoo{s;d;i;p;c;v} is called for label of object"; `labelfg ;"colorfoo{s;d;i;p;c;v} is called for foreground of label"; `labelfont ;"fontfoo{s;d;i;p;c;v} is called for font of label"; `editspace ;"if 0, the same as `space, else infinite"; `space ;"width of data display"; `respace ;"if 1, increase space on default `out if necessary"; `evaluate ;"if 0, avoid evaluation on this variable via %"; `script ;"if 1, s.script{} derives S expression for object"; `set ;"foo{s;d;i;p;c;v} is called after variable is assigned (_scb{})"; `preset ;"valuefoo{s;d;i;p;c;v} is called before variable is assigned (_spcb{})"; `eval ;"foo{s;d;i;p;c;v} is called after variable is evaluated"; `class ;"class to which object is bound"; `bound ;"1 if object is bound, else 0"; `ws ;"if 1, allow object to be WS"; `printable ;"if 1, object is printable"; `children ;"objects contained in object"; `recursively ;"apply (`attribute;value) to self and all descendents"; `descendents ;"vector of objects contained in object"; `familytree ;"nested slotfiller of descendents represents container-hierarchy"; `reparent ;"if 1, orphaned object reparented to top-level, else freed"; `reshow ;"if 1, reparented object shown if originally shown, else hidden"; `newshow ;"if 1, newly parented object is unconditionally shown"; `rowbg ;"background color of selected row"; `selectbg ;"background color of selected cell"; `selected ;"element selected"; `row ;"row selected"; `col ;"column selected"; `firstrow ;"first row displayed"; `firstcol ;"first column displayed"; `rows ;"number of rows displayed"; `cols ;"number of columns displayed"; `size ;"restore current size"; `index ;'vector of indices of flagged ("indexed") rows'; `indexbg ;"background color of indexed rows"; `scrollsize ;"scrollbar width"; `vscrollsize ;"vertical scrollbar width"; `hscrollsize ;"horizontal scrollbar width"; `scrollfg ;"scrollbar foreground"; `rowsep ;"row separators every n rows"; `colsep ;"column separators every n columns"; `cycle ;"milliseconds of color-cycle timer"; `colors ;"colorsfoo{s;d;i;p;c;v} or color-vector to cycle on update to cell"; `editbg ;"background color of editor"; `editfg ;"foreground color of editor"; `colspace ;"foo{s;d;i;p;c;v} returns a vector of matrix column spaces"; `collabelrows ;"number of rows in column labels of a matrix"; `rowindex ;'vector of indices of flagged ("indexed") row labels'; `colindex ;'vector of indices of flagged ("indexed") column labels'; `rowindexbg ;"background color of indexed row labels"; `colindexbg ;"background color of indexed column labels"; `cornerindex ;"1 if corner label is indexed, else 0"; `cornerindexbg ;"background color of indexed corner label"; `valid ;"password validity (0/1)"; `validate ;"foo{s;c;v} is called when password entered"; `fill ;"character scalar to fill password, or '' for no fill"; `save ;"0 or 1, or foo{s;c;v} for `text is called on Ctl-s"; `edit ;"turn editor on (1) or off (0)"; `buffer ;"contents of command/text buffer (character vector)"; `cursor ;"position of cursor in command buffer"; `justify ;; `margin ;"margin around label in pixels (default = 2)"; `position ;"if 1, simple vector layout v ݡv, else objects at 0 0 1 1"; `build ;"if 1, simple vector layout uses autobuilder"; `lockposition ;"if 1, do not reposition cells of a layout"; `locksize ;"if 1, do not resize layout or notebook"; `structure ;"slotfiller of `at of each of children of object"; `constraints ;"slotfiller of `resize of each of children of object"; `vrowspace ;"space between virtual rows of a layout"; `vcolspace ;"space between virtual columns of a layout"; `titlejustify ;; `valuejustify ;; `subtitlejustify ;; `mintitlejustify ;; `maxtitlejustify ;; `displayjustify ;; `valuefont ;; `mintitlefont ;; `maxtitlefont ;; `subtitlefont ;; `labelout ;; `sliderbg ;; `valuefg ;; `subtitlefg ;; `mintitlefg ;; `maxtitlefg ;; `displayfg ;; `displayfont ;; `mintitle ;; `maxtitle ;; `min ;; `max ;; `inc ;; `pageinc ;; `displayinc ;; `sliderheight ;; `sliderwidth ;; `majorticksize ;; `minorticksize ;; `minortickcount ;; `colormap ;"(n2) matrix of `bg `fg index-colors"; `cursor ;"(row,col) of cursor"; `color ;"matrix of indices into `colormap"; `bold ;"boolean matrix of normal/bold"; `blink ;"boolean matrix of normal/blink"; `blinkrate ;"blink rate in milliseconds"; `underline ;"boolean matrix of normal/underline"; `box ;"matrix of of boxes"; `line ;"matrix of of lines"; `linewidth ;"percentage of space character allotted for line"; `boxcolor ;"vector of colors of boxes"; `rband ;"foo{s;c;v} is called when rubberband box created"; `rbandbox ;" of rubberband box"; `keysym ;"keysym = (ascii_code;boolean_vector)"; `referpoint ;"foo{s;c;v} on reference to point in trace"; `selectfield ;"foo{s;c;v} is called when field label is selected"; `field ;"field selected (col#table)"; `selectedfield ;"(row;field) selected"; `firstfield ;"first field displayed (firstcol)"; `fields ;"number of fields displayed (cols)"; `fixedfields ;"number of fixed fields"; `selectcol ;"0 or 1 or foo{s;c;v} is called when col label is selected"; `selectrow ;"0 or 1 or foo{s;c;v} is called when row label is selected"; `selectcorner ;"0 or 1 or foo{s;c;v} is called when corner label is selected"; `movelimit ;"movement direction constraints `none `x `y"; `selectable ;"if 1, trace can be selected and manipulated by the mouse pointer"; `style ;"foo{s;d;i;p;c;v} `line `scatter `ls `bar `close `hl `hlc `hloc `candle"; `linewidth ;"line_widthfoo{}"; `linestyle ;"foo{s;d;i;p;c;v} `solid `dash `dotdash `dot"; `linecolor ;"trace_colorfoo{}"; `fillcolor ;"fill_colorfoo{}"; `legend ;"legend_stringfoo{}"; `symbol ;; `symbolsize ;"size in pixels of (scatter) symbol (0 symbolsize 100)"; `textactivate ;"foo{s;c;v} is called when a text-trace creation-event is detected"; `gradient ;"if 1, line and fillcolor function called at every point"; `yaxis ;; `xaxis ;; `mode ;; `left ;"distance between left axis and window - fraction of graph width"; `right ;"distance between right axis and window - fraction of graph width"; `top ;"distance between top axis and window - fraction of graph width"; `bottom ;"distance between bottom axis and window - fraction of graph width"; `xleft ;"distance between left x axis and trace - fraction of graph width"; `xright ;"distance between right x axis and trace - fraction of graph width"; `Xleft ;"distance between left X axis and trace - fraction of graph width"; `Xright ;"distance between right X axis and trace - fraction of graph width"; `ytop ;"distance between top y axis and trace - fraction of graph width"; `ybottom ;"distance between bottom y axis and trace - fraction of graph width"; `Ytop ;"distance between top Y axis and trace - fraction of graph width"; `Ybottom ;"distance between bottom Y axis and trace - fraction of graph width"; `barwidth ;"maximum bar width for all bar type traces"; `depth ;"not yet implemented"; `titlejustify ;; `selectdistance ;"distance in pixels from which a point may be selected for moving"; `subtitle ;"subtitle text"; `subtitlefg ;"foreground color of subtitle"; `subtitlefont ;"font of subtitle"; `subtitlejustify ;; `footnote ;"footnote text"; `footnotefg ;"foreground color of footnote"; `footnotefont ;"font of footnote"; `footnotejustify ;"justification of footnote"; `legendfont ;"font of legend text"; `legendstyle ;; `legend ;; `ylegend ;"y-coordinate of top-left corner of legend when `legendpos is `xy"; `ytickstyle ;; `xlegend ;"x-coordinate of top-left corner of legend when `legendpos is `xy"; `xtickstyle ;; `axis ;; `xtitlefont ;"font of x axis title"; `xfg ;"foreground color of x axis"; `ytitlefont ;"font of y axis title"; `yfg ;"foreground color of y axis"; `Xtitlefont ;"font of X axis title"; `Xfg ;"foreground color of X axis"; `Ytitlefont ;"font of Y axis title"; `Yfg ;"foreground color of Y axis"; `xlabelheight ;"height in pixels of x label"; `xlabelwidth ;"width in pixels of x axis label"; `xlabelfont ;"font of x axis label"; `ylabelheight ;"height in pixels of y axis label"; `ylabelwidth ;"width in pixels of y axis label"; `ylabelfont ;"font of y axis label"; `Xlabelheight ;"height in pixels of X axis label"; `Xlabelwidth ;"width in pixels of X axis label"; `Xlabelfont ;"font of X axis label"; `Ylabelheight ;"height in pixels of Y axis label"; `Ylabelwidth ;"width in pixels of Y axis label"; `Ylabelfont ;"font of Y axis label"; `ymode ;; `Ymode ;; `rule ;; `rulewidth ;"width in pixels of rule"; `grid ;; `gridstyle ;; `gridfg ;"foreground color of grid"; `gridwidth ;"width in pixels of grid line"; `zero ;; `zerostyle ;; `zerofg ;"foreground color of zero"; `zerowidth ;"width in pixels of zero line"; `xmajorticksize ;"length in pixels of x major ticks"; `xminorticksize ;"length in pixels of x minor ticks"; `ymajorticksize ;"length in pixels of y major ticks"; `yminorticksize ;"length in pixels of y minor ticks"; `Xmajorticksize ;"length in pixels of X major ticks"; `Xminorticksize ;"length in pixels of X minor ticks"; `Ymajorticksize ;"length in pixels of Y major ticks"; `Yminorticksize ;"length in pixels of Y minor ticks"; `xtitle ;"x-axis title"; `xtitlefg ;"foreground color of x-axis title"; `xtitlejustify ;; `xlabel ;"labelfoo{s;d;i;p;c;v} is called for x axis label vector"; `xlabelout ;; `xlabeljustify ;; `xmin ;"minimum x value"; `xmax ;"maximum x value"; `xinc ;"x increment value"; `xminorticks ;"number of minor ticks between majorticks on x axis"; `xextent ;"returns min, max, and scale values for the x axis"; `Xtitle ;"X axis title"; `Xtitlefg ;"foreground color of X axis title"; `Xtitlejustify ;; `Xlabel ;"labelfoo{s;d;i;p;c;v} is called for X axis label vector"; `Xlabelout ;; `Xlabeljustify ;; `Xmin ;"minimum X value"; `Xmax ;"maximum X value"; `Xinc ;"X increment value"; `Xminorticks ;"number of minor ticks between majorticks on X axis"; `Xextent ;"returns min, max, and scale values for the X axis"; `ytitle ;"y axis title"; `ytitlefg ;"foreground color of y axis title"; `ytitlejustify ;; `ytitlestyle ;; `ylabel ;"labelfoo{s;d;i;p;c;v} is called for y axis label vector"; `ylabelout ;; `ylabeljustify ;; `ymin ;"minimum y value"; `ymax ;"maximum y value"; `yinc ;"y increment value"; `yminorticks ;"number of minor ticks between majorticks on y axis"; `yextent ;"returns min, max, and scale values for the y axis"; `Ytitle ;"Y axis title"; `Ytitlefg ;"foreground color of Y axis title"; `Ytitlejustify ;; `Ytickstyle ;; `Ytitlestyle ;; `Ylabel ;"labelfoo{s;d;i;p;c;v} is called for Y axis label vector"; `Ylabelout ;; `Ylabeljustify ;; `Ymin ;"minimum Y value"; `Ymax ;"maximum Y value"; `Yinc ;"Y increment value"; `Yminorticks ;"number of minor ticks between majorticks on Y axis"; `Yextent ;"returns min, max, and scale values for the Y axis"; `xsublabel ;"labelfoo{s;d;i;p;c;v} is called for x axis sublabel vector"; `xsublabeljustify;; `xsublabelout ;; `Xsublabel ;"labelfoo{s;d;i;p;c;v} is called for X axis sublabel vector"; `Xsublabeljustify;; `Xsublabelout ;; `Xtickstyle ;; `Xtickstyle ;; `legendbg ;"background color of graph legend"; `legendfg ;"foreground color of graph legend"; `legendhlthickness;"width in pixels of legend focus color"; `legendshadowthickness;"width in pixels of shadow around legend"; `coordinate ;"returns matrix of referenced x,y coordinates in `graph"; `Coordinate ;"returns matrix of referenced X,Y coordinates in `graph"; `addtrace ;"foo{s;d;i;p;c;v} called on addtrace event"; `copytrace ;"foo{s;d;i;p;c;v} called on copytrace event"; `addtexttrace ;"foo{s;d;i;p;c;v} called on addtexttrace event"; `copytexttrace ;"foo{s;d;i;p;c;v} called on copytexttrace event"; `addpoint ;"foo{s;d;i;p;c;v} called on addpoint event"; `showtabs ;"boolean-show notebook tabs"; `showpopup ;"boolean-show notebook popup-menu on right button"; `showbinding ;"boolean-show the spiral notebook part"; `borderheight ;"for notebook, separation of top/bottom edges from the widget"; `borderwidth ;"for notebook, separation of left/right edges from the widget"; `backpagebg ;"color of the unselected pages of a notebook"; `backpagefg ;"color of page edges in notebook"; `selectedpagefg ;"color of selected page title"; `selectedpagebg ;"color of selected page tab and edging"; `pagetitle ;"for notebook children, text on notebook tabs"; `pageselection ;"boolean-for notebook children, allow selection"; `orientation ;"`horizontal or `vertical, the general alignment of the widget"; `bindingwidth ;"the width of the spiral notebook part"; `framethickness ;"the shading area around the selected page"; `framebg ;"the color of the 'punched hole' area"; `marginheight ;"between the edges of the selected page and its widget"; `marginwidth ;"between the edges of the selected page and its widget"; `backpages ;"how many shadowed pages to draw"; `backpagethickness;"how thick the shadowed pages are"; `backpagebg ;"the color of the shadowed pages"; `backpagefg ;"the color of the edges of the shadowed pages-not tab titles"; `currentpage ;"the symbol of the currently selected page-null if none"; ) }; } store{f}: { s`s_nl{`s;`fns`vars`ops`deps}; s[,]`.show `.hide `.is `.free `.of `.has; sunique{s}/s; p.fnew{f;s}; } activate{}: { set_quiet_callback{}; set_connected_callback{}; append_reference{`s;`COLORS;1;<{set_toolkit_colors};}; append_reference{`s;`FONT;1;<{set_toolkit_font};}; append_reference{`s;`COLORS;0;<{preset_toolkit_colors};}; append_reference{`s;`FONT;0;<{preset_toolkit_font};}; set_color_alias_callback{}; set_auto_workspace_callback{}; set_message_callback{}; append_reference{`s;`VERIFY;1;<{set_verify};}; append_reference{`s;`GRAY;1;<{set_gray};}; append_reference{`s;`BUSY;1;<{set_busy};}; append_reference{`s;`CLOCK;1;<{set_clock};}; append_reference{`s;`BEEP;1;<{set_beep};}; append_reference{`s;`MENUDEFAULTMNEMONIC;1;<{set_menuDefaultMnemonic};}; append_reference{`s;`DOUBLECLICKINTERVAL;1;<{set_doubleClickInterval};}; append_reference{`s;`BACKINGSTORE;1;<{set_backingstore};}; s.MENUDEFAULTMNEMONICs.MENUDEFAULTMNEMONIC; To initialize the value in C++ land. set_save_yourself_callback{}; } *** Initialize script initialize{} $ex initialize $ex initialize_globals $ex initialize_def $ex documentation_variables _wa `coalesce aplus-fsf-4.22/src/cxs/bigs.+0000644000265000001440000005345710772770343011432 Copyright (c) 1990-2008 Morgan Stanley All rights reserved. See .../src/LICENSE for terms of distribution. $cx S geometry how variable_name load_s{}: if (`vars_nc{`s;`SERVER}) {'$loading s ...';'$load s'} title and out covers format{sym}: s.al_to_sf{format_out{sym},format_title{sym}} format_out{sym}: { (cx;var)s.c_c{sym}; case (s.g_varClass{cx,var}) { `array; format_out_array{cx;var}; `table; format_out_table{cx;var} } } format_title{sym}: { (cx;var)s.c_c{sym}; case (s.g_varClass{cx,var}) { `array; format_title_array{cx;var}; `table; format_title_table{cx;var} } } format_title_object{cx;var}: { (fn;cd)2s.g_varTitleFunc{cx,var}; cws.g_varCw{cx,var}; zfn{cd;;;}; if (2=#z) z else (21 1,z)z } format_title_array{cx;var}: (`title;format_title_object{cx;var}) format_title_table{cx;var}: { zformat_title_array{cx;var}; zz(); (i#dcx%var) do zzzz,(/>#x)١x btom2{x}: {x(2١1,1,ҡx)ҡx;(/1աҡx)@1x} vtoe{y;x}: if (`null=x) x else 1ա(xy)x((~(1x)y)/1y),x vtom{y;x}: btom{vtoe{y;x}} rstrip{x}: if (0,x) ((#x)0)'' else (-/(@1' '=x)@10)@1x ljust{x}: ((x=' ')@10)@0 1x db{x}: (x' ')/x encode{y;x}: z(1z)(1zyx)+(1,#x)1|x ttom{x}: { if (0=x) xx) btom2{x} else { z(t)#((~t)/x),' ',@1&{t/x}; z(2١1,1,ҡz)ҡz; (/>1#ҡz)@1z }; (21 1,z)z } mtot{x}: { if (~0cx[;0]' ') rstrip{<@1 x} else { a(c)x; brstrip{0#a}; (0#@y x; (i1+#@y x) do zz,@y >(i+1)#@y x }; ҡx; r(x)(1x)//@1s[;;0]; c(x)(#x)//s[;;1]; if (Vertical) xcenter{r;x} else xr١x; if (Horizontal) xcenter@1{1+c;x} else x(1+c)@1x; <1@1>encat{x;encat@1{1;x}} } Generate display for nested array box{x}: { (a;b)same{x}; zdisp{a}; zif (0=#z) >z else { if (1=#z) z(1,#z)z; z,plane @2{z}; rank2{>(/>#z)١(/,>1աҡz)@1z} }; frame{z;x;(`sym `box `funcɩx)#'`b',0#Apl;x;b} } Generate display for null array null{x}:frame{1 1' ';x;'n';x;0} Generate display for function array func{x}:if ((0#x)0i#a;i}; if (0(1+#a)#a}; zlabel{z;typ;1+#z;r}; (isam) do zif (ii#a;i} else label{z;1#Apl;0;r+#>i#a} }; z } disp{x}:((TYPESɩx)#FUNCS)x display{x}:if (Tree>0) tree{(Leaf1{disp}){,x}} else disp{x} tree diagrammer (f Leaf1)r:if (0=r)f r else f &r tree{x}:if (Tree=2) branch{(Leaf1{leaf}){x}} else branch2{(Leaf1{leaf2}){x}} line_drawing_characters{}: { (S.N;S.V;S.H;S.TL;S.TR;S.BL;S.BR;S.I;S.TI;S.BI;S.LI;S.RI)Font( '|-',9'+'; `char4 179 196 218 191 192 217 197 194 193 195 180; '|-<>+'; `char4 186 205 201 187 200 188 206 203 202 204 185 ); S.Drawif (Font=0) '--||<..`''' else H,H,V,V,N,TL,TR,BL,BR; S.Aplif (Font=0) 'ǽ' else `char183 207 236 230; } leaf{x}: { x(21 1,x)x; xV,@1(H,x,H),@1 V; x[0;0,1+1x](Horizontal#TI,LI),TR; x[1+#x;0,1+1x]BL,BR; x } branch{x}: { if (0=x) x else { if (1d0<ؽx,x) (d/x)&{d/x}; cHorizontal;ec#1 9;fc#9 1;dc2; x((c#ҡx)@f(#x)';`titlefont;'helvetica-boldoblique-18')}; .has{`S.Display;(`font;'kaplscreen-bold';`title;'';`titlefont;'helvetica-boldoblique-18')}; .has{`S.Layout;(`handle;'S.how';`title;'';`titlefont;'helvetica-boldoblique-18')}; .show{`S.Layout}; } ** Widget works :-) works{obj}: { load_s{}; s.EG1; S.Classest[ts.createable_classes{}]; S.Objectsif (0<#obj) s.c_c{obj},0.of{`descendents;}; S.Resources(;); S.Data(); S.Window`Resources; S.Msg''; S.LoadS.SaveS.Work20' '; S.Works(`Msg;`Classes `Objects;`Data;`Window;`Load;`Save;`Work); _scb{`S.Data;(S.modify_data;)}; _scb{`S.Resources;(S.modify_resource;)}; _scb{`S.Load;(S.load_file;)}; _scb{`S.Save;(S.save_file;)}; _scb{`S.Work;(S.work_instance;)}; .is{`S.Msg;`label}; .is{`S.Classes;`array}; .is{`S.Objects;`array}; .is{`S.Data;`scalar}; .is{`S.Resources;`slot}; .is{`S.Window;`window}; .is{`S.Load;`scalar}; .is{`S.Save;`scalar}; .is{`S.Work;`scalar}; .is{`S.Works;`layout}; .has{`S.Classes;(`space;15;`middledown;instantiate_class;`insert;`off;`insertup;`off;`delete;`off;`protect;1;`title;`Classes;`titlefont;'helvetica-boldoblique-18';`font;'kaplscreen-bold')}; .has{`S.Objects;(`space;15;`middledown;edit_instance;`insert;`off;`insertup;`off;`delete;free_instance;`title;`Objects;`in;change_name;`titlefont;'helvetica-boldoblique-18';`font;'kaplscreen-bold')}; .has{`S.Data;(`titleratio;15;`out;s.out_a;`in;s.in_a;`title;`Data;`titlefont;'helvetica-boldoblique-18';`font;'kaplscreen-bold')}; .has{`S.Resources;(`out;s.out_a;`in;s.in_a;`titlefont;'kaplscreen-bold';`titleratio;40)}; .has{`S.Works;(`title;'')}; .has{`S.Load;(`titleratio;15;`title;'Load';`titlefont;'helvetica-boldoblique-18';`font;'kaplscreen-bold')}; .has{`S.Save;(`titleratio;15;`title;'Save';`titlefont;'helvetica-boldoblique-18';`font;'kaplscreen-bold')}; .has{`S.Work;(`titleratio;15;`title;'Work';`titlefont;'helvetica-boldoblique-18';`font;'kaplscreen-bold')}; .has{`S.Msg;(`font;'kaplscreen-bold')}; .show{`S.Works}; .hide{`S.Resources}; } load_file{c;d;i;p}: { if (/d' ') { clear_editor{}; (bobs;fobs)s.load{d}; S.Objects(~Objectsfobs)/Objects; S.ObjectsObjects,bobs; S.Msg((d' ')/d),' loaded' }; } work_instance{c;d;i;p}: { if (0<#d(d' ')/d) { clear_editor{}; obd; if (obs.objects{}) { obsob,0.of{`descendents;ob}; obs(~obsObjects)/obs; if (0<#obs) { row#Objects; S.ObjectsObjects,obs; .has{`Objects;(`row;row)}; S.Msg((d' ')/d),' selected' }; }; }; } save_file{c;d;i;p}: { if (/d' ') { if (0>i0.of{`row;`S.Objects}) (); (cx;var)s.c_c{i#S.Objects}; s.save{.state{cx,var};d(d' ')/d}; S.Msgs.variable_name{cx;var},' saved to ',d,if (~'.'d) '.+' }; } instantiate_class{c}: { if (0>i0.of{`row;`S.Classes}) (); clear_editor{}; clsi#Classes; vals.eg{cls}; (cx;var)s.generate_symbol{`;val}; S.ObjectsS.Objects,s.u_n{cx,var}; .is{cx,var;cls}; .show{cx,var}; S.Msgs.variable_name{cx;var},' is ',cls; } change_name{c;d;i;p}: { oldi#S.Objects; if (0=#d) old else { newd; if (newold) old else { (cx;var)s.c_c{new}; if (`null_nc{cx;var}) old else { (ocx;ovar)s.c_c{old}; (cx%var)ocx%ovar; ocls0.of{`class;ocx,ovar}; clear_editor{}; s.free{ocx,ovar}; s.is{cx,var;ocls}; s.show{cx,var}; new } } } } free_instance{c}: { if (0>i0.of{`row;`S.Objects}) (); if (`insi#Objects) { clear_editor{}; (cx;var)s.c_c{ins}; fins.free{cx,var}; S.Objects(~Objectsfins)/Objects; S.Msgs.variable_name{cx;var},' freed' }; } edit_instance{c}: { if (0>i0.of{`row;`S.Objects}) (); clear_editor{}; insi#Objects; (cx;var)s.c_c{ins}; _scb{`S.Data;(;)}; S.Datacx%var; _scb{`S.Data;(S.modify_data;cx,var)}; S.Resourcess.get{cx,var}; _scb{`S.Resources;(S.modify_resource;cx,var)}; .show{`S.Resources}; S.Msgs.variable_name{cx;var},' in edit'; } clear_editor{}: { .hide{`S.Resources}; _scb{`S.Data;(S.modify_data;)}; S.Data(); _scb{`S.Resources;(S.modify_resource;)}; S.Resources(;); } modify_data{c;d;i;p}: { if (()c) (); (cx;var)c; (cx%var)d; S.msgs.variable_name{cx;var},' assigned'; } modify_resource{c;d;i;p}: { if (()c) (); (cx;var)c; .has{cx,var;(p;pResources)}; S.Msgs.variable_name{cx;var},' has resource'; } *** Quote parser out_quote{x}: { (val;typ;pfx)3x; if (0=#val) 0 7' '; if (0=#typ) typ`decimal; if (0=#pfx) pfx' '; case (typ) { `decimal; { pfx,,_fmt{0FORMATS;val} }; `32nd `320th; { sgn(0>val)/'-';val|val; den(yb`32nd `320thtyp)#256 320; val(.5+denval)den; pdelyb#'/`'; pint,_fmt{1FORMATS;val}; val321|val; p32,_fmt{2FORMATS;val}; pfrc13.1(yb#.8 1)1|val; pfrcif ((yb^pfrc='5')(~yb)^pfrc='4') '+' else if (pfrc='0') '' else pfrc; if BLANK if (0=#pfrc) if (^/p32='0') (pdel;p32)('';''); pfx,sgn,pint,pdel,p32,pfrc }; `128th `64th; { den(yb`128th `64thtyp)#128 64; pdelyb#'=\'; sgn(0>val)/'-';val|val; (pint;p128)encode{0,den;den(.5+denval)den}; pint,_fmt{1FORMATS;pint}; p128,_fmt{(~yb)2FORMATS;p128}; if BLANK if (^/p128='0') (pdel;p128)('';''); pfx,sgn,pint,pdel,p128 } } } in_quote{x}: { if (0=#x) (00.0;;''); (ftyp;pat;str)d.form{x;MACHINE}; if (ftyp()) `form; (val;typ;pfx)(0.0;ftyp;''); if (0<#pat) case (ftyp) { `decimal; { if (1=0#pat) pfx0str; val(1pat)/str }; `32nd `320th; { if (1=0#pat) pfx0str; sgn(3pat)#1 1; fden(`32nd `320thftyp)#256 320; n64if (4pat) 164 else 0; valsgnn64+if (2pat) { case (#k(0=pat)/#pat) { 0; 0; 1; if ((pat2)k) (kstr) else quote_fraction{kstr;fden}; 2; (k[0]str)+quote_fraction{k[1]str;fden} } } else if (0pat) (pat0)str else 0 }; `128th `64th; { den(yb`128th `64thftyp)#128 64; if (1=0#pat) pfx0str; val((3pat)#1 1)if (2=+/0=pat) +/((pat=0)/str)1,den else if ((#str)kpat0) 0 else (kstr)1((pat2)(>stringši#symbols)ɡ1)<#isymbols) { s0;v0,p; while ((s0)^0<#v1v) s(s;0#v)#istates; if (1s) { if (11s#istates) { par1,1p1p; (i#names;>0#parp;parstring) } } } }; (;;) } represent{x}: { xif (`sym=x) (x),'.form' else x; saasys.readmat{x}; a,a; asab\(b~a`char9 10)/a; arstrip{ljust{a}}; namif (0<#tdb{(1+t':'),(a[;#t]@1 t'name:')/a}) t else '! form name'; orif (0<#tdb{(1+t':'),(a[;#t]@1 t'or:')/a}) 0#,t else '|'; sepif (0<#tdb{(1+t':'),(a[;#t]@1 t'sep:')/a}) 0#,t else ','; tif (1ua[;#t]@1 t'let:') vtoe{':';<@1 ljust{(1+t':')@1 u/a}} else (;); (lsym;lval)if (0<#0t) (0ءt;1ءt) else (;); blocksif (~1b(a[;#t]@1 t'form:')a[;0]='')'! form' else (t/b)(t~^\~b)/a; namessymbolsstatessnames(); (i#blocks) do { fnamif (0<#t(1+t':')tdb{0#ziblocks}) t else '! form symbol'; z(/@1 z' ')/z; zvtoe{"\n";_gsr{db{,"\n",@11z};lsym;lval;'._'}}; fsta(tzɡ':')١z;z(1+t)աz; zdb{vtoe{sep;vtoe{or;z}}}; fsym(`char=>t)/ts.unique{t}/t0ء2١z; r((#fsta),2+#fsym)Ң1; (j#z) do { ajz; caء#a; if (1two2=>#ca) ((j;k)#r)(kfsym0ءb)#fsta1ءbtwo/a; if (1one(1=>#ca)^~>0šca) ((j;2+1#r)#r)0#fsta0ءone/a; if (0ca) ((j;1+1#r)#r)2 }; namesnames,fnam; symbolssymbols, #if defined(_AIX) || defined(HAVE_SVR4) #define iszero(X) (X==0.0) #endif #include #if defined(__cplusplus) #include #else #include #endif #include #include #include #include #include #undef ENTRYPOINT #define ENTRYPOINT static #define REG register /************************************************************************ * * Comparision routines * */ static int Itemcount; static int bs_Ccmp( s1, s2) UC *s1, *s2; { REG int count=Itemcount, diff=0; while (count-- && !diff) diff = *s1++ - *s2++; return(diff); } static int bs_Icmp( s1, s2) I *s1, *s2; { REG int count=Itemcount, diff=0; while (count-- && !diff) diff = *s1++ - *s2++; return(diff); } #define CT (1+1e-13) #if defined(_AIX) || defined(HAVE_SVR4) || defined(__osf__) || defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__) #define isnegative(x) (x<0.0) #else #define isnegative(x) (signbit(x)&&!iszero(x)) #endif static int bs_FcmpCT( s1, s2) F *s1, *s2; { REG int count=Itemcount; REG int result=0; REG F a, b; while(count-- && !result) { a=*s1++; b=*s2++; if (isnegative(b) != (result = isnegative(a))) { result = (result)?-1:1; break; } if (result) { a=-a; b=-b; } if (a comp) hi = mid; else if (0 < comp) lo = mid+1; else return(mid); } return(tabsize); } /* Program: bsu */ SUBROUTINE int bsi( key, table, tabsize, itemsize, cmpfn) /* bsi: find first */ char *key, *table; int tabsize, itemsize; int (*cmpfn)(); { REG int comp; REG int mid; REG int lo=0; REG int hi=tabsize; REG int result=tabsize; if (Range_Setting.flag) { lo=Range_Setting.lo; hi=result=Range_Setting.hi; } while (lo comp) hi = mid; else { if (inequality || 0 == comp) result = mid; lo = mid+1; } /* printf ("bse hi:%d lo:%d mid:%d comp:%d res:%d\n", hi, lo, mid, comp, result); */ } return(result); } /* Program: bse */ static int CoResult; SUBROUTINE int bsr( key, table, tabsize, itemsize, cmpfn) /* bsr: find range */ char *key, *table; int tabsize, itemsize; int (*cmpfn)(); { REG int comp, mid, lo=0, hi=tabsize; REG int lo1, hi1, result=tabsize; CoResult = result-1; while (lo comp) hi = mid; else if (0 < comp) { lo = mid+1; if (inequality) result=mid; } else { result = CoResult = mid; lo1 = lo; hi1 = hi; while (lo comp) hi = mid; else { if (0 == comp) CoResult = mid; lo = mid+1; } } } } CoResult -= result-1; return(result); } /* Program: bsr */ static I *Indexes; static int IdxCount; SUBROUTINE int bsp( key, table, tabsize, itemsize, cmpfn) /* bsp: with permutaion vector */ char *key, *table; int tabsize, itemsize; int (*cmpfn)(); { REG int comp, mid, lo=0, hi=IdxCount; REG int result=IdxCount; if (Range_Setting.flag) { lo=Range_Setting.lo; hi=result=Range_Setting.hi; } while (lo Indexes[mid] || Indexes[mid] >= tabsize) ERROUT(ERR_INDEX); comp = (*cmpfn)( key, table+(itemsize*Indexes[mid])); /*printf ("hi:%d lo:%d mid:%d comp:%d\n", hi, lo, mid, comp);*/ if (0 < comp) lo = mid+1; else { if (inequality || 0 == comp) result = mid; hi = mid; } } return(result); } /* Program: bsp */ SUBROUTINE int bspe( key, table, tabsize, itemsize, cmpfn) /* bspe: last, w permute vec */ char *key, *table; int tabsize, itemsize; int (*cmpfn)(); { REG int comp, mid, lo=0, hi=IdxCount; REG int result=(inequality)?-1:IdxCount; if (Range_Setting.flag) { lo=Range_Setting.lo; hi=Range_Setting.hi; result=(inequality)?lo-1:hi;} while (lo Indexes[mid] || Indexes[mid] >= tabsize) ERROUT(ERR_INDEX); comp = (*cmpfn)( key, table+(itemsize*Indexes[mid])); /*printf ("hi:%d lo:%d mid:%d comp:%d\n", hi, lo, mid, comp);*/ if (0 > comp) hi = mid; else { if (inequality || 0 == comp) result = mid; lo = mid+1; } } return(result); } /* Program: bspe */ /* bspr - binary search with permutation and ranging */ SUBROUTINE int bspr( key, table, tabsize, itemsize, cmpfn) char *key, *table; int tabsize, itemsize; int (*cmpfn)(); { REG int comp, mid, lo=0, hi=IdxCount; REG int lo1, hi1, result=IdxCount; CoResult = result-1; while (lo comp) hi = mid; else if (0 < comp) lo = mid+1; else { result = CoResult = mid; lo1 = lo; hi1 = hi; while (lo Indexes[mid] || Indexes[mid] >= tabsize) ERROUT(ERR_INDEX); comp = (*cmpfn)( key, table+(itemsize*Indexes[mid])); /*printf ("hi:%d lo:%d mid:%d comp:%d\n", hi, lo, mid, comp);*/ if (0 < comp) lo = mid+1; else { if (inequality || 0 == comp) result = mid; hi=mid; } } lo = lo1; hi = hi1; while (lo Indexes[mid] || Indexes[mid] >= tabsize) ERROUT(ERR_INDEX); comp = (*cmpfn)( key, table+(itemsize*Indexes[mid])); /*printf ("hi:%d lo:%d mid:%d comp:%d\n", hi, lo, mid, comp);*/ if (0 > comp) hi = mid; else { if (inequality || 0 == comp) CoResult = mid; lo = mid+1; } } } } CoResult -= result-1; return(result); } /* Program: bspr */ /* */ /************************************************************************ * * Cover routines * */ static int Itemsize; /* Binary Search Types -- these map one to one with Binary search routines */ #define BIN_I 1 /* return first occurance */ #define BIN_E 2 /* return last occurance */ #define BIN_R 3 /* return range: (first occurance, #occurances) */ SUBROUTINE int bin_validate( source, target, presult, pntarget, pnsource) A source, target, *presult; I *pnsource; int *pntarget; { REG int res, i, ti; /* Validation */ if ( !QA(source) || !QA(target) ) return(ERR_NONCE); /* if (0 == source->d[0]) return(gi(0)); */ if (source->t >= Et) return(ERR_NONCE); if (source->t != target->t) return(ERR_TYPE); if (source->r > 1+target->r) return(ERR_RANK); Itemcount = 1; i=source->r; ti=target->r; while(i>1) { if( source->d[--i] != target->d[--ti]) return(ERR_LENGTH); Itemcount *= source->d[i]; } Itemsize = Itemcount * SIZEOFITEM(source->t); for(res=1, i=0; id[i]; if (NULL != presult) { if (bothends) { (*presult) = ga( It, ti+1, res*2, target->d-1); (*presult)->d[0] = 2; } else (*presult) = ga( It, ti, res, target->d); } if (NULL != pntarget) (*pntarget) = res; if (NULL != pnsource) (*pnsource) = indexvector?IdxCount:source->d[0]; return(0); } /* Program: bin_validate */ SUBROUTINE A a_binary( source, target, bsfn) A source, target; int (*bsfn)(); { REG int i; REG int ti; int res; int itemsize; A result; RANGE_SEARCH_UNSET; /* Validation */ /* if (0 == source->d[0]) return(gi(0)); */ if (source->t >= Et) ERROUT(ERR_NONCE); if (source->t != target->t) ERROUT(ERR_TYPE); if (source->r > 1+target->r) ERROUT(ERR_RANK); Itemcount = 1; i=source->r; ti=target->r; while(i>1) { if( source->d[--i] != target->d[--ti]) ERROUT(ERR_LENGTH); Itemcount *= source->d[i]; } itemsize = Itemcount * SIZEOFITEM(source->t); for(res=1, i=0; id[i]; if (bothends) { result = ga( It, ti+1, res*2, target->d-1); result->d[0] = 2; } else result = ga( It, ti, res, target->d); if (0 == source->d[0]) { bzero(result->p, result->n*sizeof(I)); return(result); } /* search */ for (i=0; it) { case Ct: result->p[i] = (*bsfn)((char *)target->p+(i*itemsize), (char *) source->p, source->d[0], itemsize, bs_Ccmp); break; case It: result->p[i] = (*bsfn)((char *)target->p+(i*itemsize), (char *) source->p, source->d[0], itemsize, bs_Icmp); break; case Ft: result->p[i] = (*bsfn)((char *)target->p+(i*itemsize), (char *) source->p, source->d[0], itemsize, bs_FcmpCT); break; } if (bothends) result->p[res+i] = CoResult; } return(result); } /* Program: a_binary */ SUBROUTINE int range_search(source, target, nsource, ntarget, loes, hies, flag) A source, target; I nsource; int ntarget, flag; I *loes, *hies; { REG int i, rc; int nexpected; I nsexpected; int (*bsfni)(), (*bsfne)(); if (flag) { rc=bin_validate(source, target, NULL, &nexpected, &nsexpected); if (rc) return(rc); if (nexpected != ntarget) return(ERR_MISMATCH); if (nsexpected != nsource) return(ERR_MISMATCH); } /* search */ if (indexvector) { bsfni=bsp; bsfne=bspe; } else { bsfni=bsi; bsfne=bse; } for (i=0; it) { case Ct: loes[i] = (*bsfni)((char *)target->p+(i*Itemsize), (char *) source->p, source->d[0], Itemsize, bs_Ccmp); hies[i] = 1+(*bsfne)((char *)target->p+(i*Itemsize), (char *) source->p, source->d[0], Itemsize, bs_Ccmp); break; case It: loes[i] = (*bsfni)((char *)target->p+(i*Itemsize), (char *) source->p, source->d[0], Itemsize, bs_Icmp); hies[i] = 1+(*bsfne)((char *)target->p+(i*Itemsize), (char *) source->p, source->d[0], Itemsize, bs_Icmp); break; case Ft: loes[i] = (*bsfni)((char *)target->p+(i*Itemsize), (char *) source->p, source->d[0], Itemsize, bs_FcmpCT); hies[i] = 1+(*bsfne)((char *)target->p+(i*Itemsize), (char *) source->p, source->d[0], Itemsize, bs_FcmpCT); break; } if ((!inequality) && loes[i] == Range_Setting.hi) loes[i]=hies[i]=-1; /* printf("range loop:%d loes:%d hies:%d \n", i, loes[i], hies[i]); */ } return(0); } /* Program: range_search */ SUBROUTINE A nest_binary( source, target, btype) A source, target; int btype; { I *loes, *hies; int ntarget; I nsource; A result=NULL; REG int i, rc; /* Top-level validation */ if (source->t != Et || target->t != Et) ERROUT(ERR_TYPE); if ( 1 < source->r || 1 < target->r ) ERROUT(ERR_RANK); if (source->n < target->n) ERROUT(ERR_MISMATCH); rc=bin_validate( (A)*source->p, (A)*target->p, &result, &ntarget, &nsource); if (rc) ERROUT(rc); loes=ma(ntarget); hies=ma(ntarget); bzero(loes, ntarget*sizeof(I)); for (i=0; in && !rc; ++i) { rc = range_search( (A)source->p[i], (A)target->p[i], nsource, ntarget, loes, hies, (i)?1:0); /* printf("check:loop:%d lo:%d hi:%d \n",i,loes[0], hies[0]); */ } if (rc) { mf(loes); mf(hies); dc(result); ERROUT(rc); } switch (btype) { case BIN_I: for (i=0; ip[i]=(inequality||loes[i]p[i]=(inequality||loes[i]p[i]=(inequality||loes[i]p[ntarget+i] = (loes[i]t) return(nest_binary(source, target, BIN_I)); else return( a_binary( source, target, bsi)); } ENTRYPOINT A ep_bge( source, target) A source, target; { indexvector=FALSE; inequality=TRUE; bothends=FALSE; if (Et==target->t) return(nest_binary(source, target, BIN_I)); else return( a_binary( source, target, bsi)); } ENTRYPOINT A ep_be( source, target) A source, target; { indexvector=FALSE; inequality=FALSE; bothends=FALSE; if (Et==target->t) return(nest_binary(source, target, BIN_E)); else return( a_binary( source, target, bse)); } ENTRYPOINT A ep_ble( source, target) A source, target; { indexvector=FALSE; inequality=TRUE; bothends=FALSE; if (Et==target->t) return(nest_binary(source, target, BIN_E)); else return( a_binary( source, target, bse)); } ENTRYPOINT A ep_br( source, target) A source, target; { indexvector=FALSE; inequality=FALSE; bothends=TRUE; if (Et==target->t) return( nest_binary( source, target, BIN_R)); else return( a_binary( source, target, bsr)); } ENTRYPOINT A ep_bp( source, ind, target) A source, ind, target; { if (1 != ind->r) ERROUT(ERR_RANK); IdxCount = ind->n; Indexes = ind->p; indexvector=TRUE; inequality=FALSE; bothends=FALSE; if (Et==target->t) return(nest_binary(source, target, BIN_I)); else return( a_binary( source, target, bsp)); } ENTRYPOINT A ep_bpe( source, ind, target) A source, ind, target; { if (1 != ind->r) ERROUT(ERR_RANK); IdxCount = ind->n; Indexes = ind->p; indexvector=TRUE; inequality=FALSE; bothends=FALSE; if (Et==target->t) return(nest_binary(source, target, BIN_E)); else return( a_binary( source, target, bspe)); } ENTRYPOINT A ep_bpr( source, ind, target) A source, ind, target; { if (1 != ind->r) ERROUT(ERR_RANK); IdxCount = ind->n; Indexes = ind->p; indexvector=TRUE; inequality=FALSE; bothends=TRUE; if (Et==target->t) return(nest_binary(source, target, BIN_R)); else return( a_binary( source, target, bspr)); } ENTRYPOINT A ep_bpge( source, ind, target) A source, ind, target; { if (1 != ind->r) ERROUT(ERR_RANK); IdxCount = ind->n; Indexes = ind->p; indexvector=TRUE; inequality=TRUE; bothends=FALSE; if (Et==target->t) return(nest_binary(source, target, BIN_I)); else return( a_binary( source, target, bsp)); } ENTRYPOINT A ep_bple( source, ind, target) A source, ind, target; { if (1 != ind->r) ERROUT(ERR_RANK); IdxCount = ind->n; Indexes = ind->p; indexvector=TRUE; inequality=TRUE; bothends=FALSE; if (Et==target->t) return(nest_binary(source, target, BIN_E)); else return( a_binary( source, target, bspe)); } void binaryInstall() { CX saveCx=Cx; Cx=cx("b"); install((PFI)ep_bu, "u", A_,2,A_,A_, 0,0,0,0,0,0); install((PFI)ep_bi, "i", A_,2,A_,A_, 0,0,0,0,0,0); install((PFI)ep_be, "e", A_,2,A_,A_, 0,0,0,0,0,0); install((PFI)ep_br, "r", A_,2,A_,A_, 0,0,0,0,0,0); install((PFI)ep_bp, "p", A_,3,A_,IA,A_,0,0,0,0,0); install((PFI)ep_bpr, "pr", A_,3,A_,IA,A_,0,0,0,0,0); install((PFI)ep_bge, "ge", A_,2,A_,A_, 0,0,0,0,0,0); install((PFI)ep_ble, "le", A_,2,A_,A_, 0,0,0,0,0,0); install((PFI)ep_bpge, "pge", A_,3,A_,IA,A_,0,0,0,0,0); install((PFI)ep_bple, "ple", A_,3,A_,IA,A_,0,0,0,0,0); install((PFI)ep_bpe, "pe", A_,3,A_,IA,A_,0,0,0,0,0); Cx=saveCx; return; } aplus-fsf-4.22/src/AplusGUI/0000777000265000001440000000000010774512571011333 5aplus-fsf-4.22/src/AplusGUI/Makefile.am0000444000265000001440000000521707235624243013304 ## Process this file with automake to produce Makefile.in ############################################################################### ## ## ## Copyright (c) 2001 Morgan Stanley Dean Witter & Co. All rights reserved. ## ## See .../src/LICENSE for terms of distribution. ## ## ## ## ## ############################################################################### lib_LTLIBRARIES = libAplusGUI.la libAplusGUI_la_SOURCES= \ AGIF.C \ AGIFGraph.C\ AGIFmstk.C \ AGIFPrint.C \ AplusApplication.C \ AplusArray.C \ AplusButton.C \ AplusButtonBox.C\ AplusCallback.C \ AplusCheckBox.C\ AplusChoice.C\ AplusCollapsible.C\ AplusCommand.C\ AplusCommon.C \ AplusConvert.C\ AplusDisplayServer.C\ AplusEntryField.C \ AplusEnumConverter.C \ AplusEvent.C \ AplusFormatter.C\ AplusGraph.C\ AplusHashTable.C \ AplusLabel.C \ AplusLabelOut.C \ AplusLayout.C \ AplusManager.C\ AplusMatrix.C\ AplusMenu.C\ AplusModel.C \ AplusNotebook.C\ AplusPage.C\ AplusPanes.C\ AplusParagraph.C \ AplusPassword.C\ AplusPopup.C \ AplusPrintColumn.C \ AplusPrintText.C \ AplusPrintTool.C \ AplusRadioBox.C\ AplusReference.C \ AplusReportAlgo.C\ AplusReportEnum.C\ AplusRulePrintItem.C \ AplusScale.C\ AplusScrolledWindow.C\ AplusShell.C \ AplusSlot.C\ AplusTable.C \ AplusTableColumn.C\ AplusText.C\ AplusTrace.C\ AplusTreeView.C\ AplusUpdateQueue.C\ AplusView.C\ EnumTables.C\ aplKeys.C\ AGIF.H\ AGIFGraph.H\ AGIFmstk.H\ AplusApplication.H\ AplusArray.H\ AplusButton.H\ AplusButtonBox.H\ AplusCallback.H\ AplusCheckBox.H\ AplusChoice.H\ AplusCollapsible.H\ AplusCommand.H\ AplusCommon.H\ AplusConvert.H\ AplusDialog.H\ AplusDisplayServer.H\ AplusEntryField.H\ AplusEnumConverter.H\ AplusErrorDialog.H\ AplusEvent.H\ AplusFormatter.H\ AplusGraph.H\ AplusHashTable.H\ AplusLabel.H\ AplusLabelOut.H\ AplusLayout.H\ AplusManager.H\ AplusMatrix.H\ AplusMenu.H\ AplusModel.H\ AplusNotebook.H\ AplusPage.H\ AplusPanes.H\ AplusParagraph.H\ AplusPassword.H\ AplusPopup.H\ AplusPrintColumn.H\ AplusPrintText.H\ AplusPrintTool.H\ AplusRadioBox.H\ AplusReference.H\ AplusReportAlgo.H\ AplusReportEnum.H\ AplusRulePrintItem.H\ AplusScale.H\ AplusScrolledWindow.H\ AplusShell.H\ AplusSlot.H\ AplusTable.H\ AplusTableColumn.H\ AplusText.H\ AplusTrace.H\ AplusTreeView.H\ AplusUpdateQueue.H\ AplusView.H\ EnumTables.H\ Macros.H INCLUDES = -I.. -I/usr/X11R6/include aplus-fsf-4.22/src/AplusGUI/Makefile.in0000644000265000001440000004766310774512520013326 # Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ ############################################################################### ############################################################################### SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CXX = @CXX@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ STRIP = @STRIP@ VERSION = @VERSION@ X_INCLUDES = @X_INCLUDES@ X_LIBS = @X_LIBS@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ lib_LTLIBRARIES = libAplusGUI.la libAplusGUI_la_SOURCES = \ AGIF.C \ AGIFGraph.C\ AGIFmstk.C \ AGIFPrint.C \ AplusApplication.C \ AplusArray.C \ AplusButton.C \ AplusButtonBox.C\ AplusCallback.C \ AplusCheckBox.C\ AplusChoice.C\ AplusCollapsible.C\ AplusCommand.C\ AplusCommon.C \ AplusConvert.C\ AplusDisplayServer.C\ AplusEntryField.C \ AplusEnumConverter.C \ AplusEvent.C \ AplusFormatter.C\ AplusGraph.C\ AplusHashTable.C \ AplusLabel.C \ AplusLabelOut.C \ AplusLayout.C \ AplusManager.C\ AplusMatrix.C\ AplusMenu.C\ AplusModel.C \ AplusNotebook.C\ AplusPage.C\ AplusPanes.C\ AplusParagraph.C \ AplusPassword.C\ AplusPopup.C \ AplusPrintColumn.C \ AplusPrintText.C \ AplusPrintTool.C \ AplusRadioBox.C\ AplusReference.C \ AplusReportAlgo.C\ AplusReportEnum.C\ AplusRulePrintItem.C \ AplusScale.C\ AplusScrolledWindow.C\ AplusShell.C \ AplusSlot.C\ AplusTable.C \ AplusTableColumn.C\ AplusText.C\ AplusTrace.C\ AplusTreeView.C\ AplusUpdateQueue.C\ AplusView.C\ EnumTables.C\ aplKeys.C\ AGIF.H\ AGIFGraph.H\ AGIFmstk.H\ AplusApplication.H\ AplusArray.H\ AplusButton.H\ AplusButtonBox.H\ AplusCallback.H\ AplusCheckBox.H\ AplusChoice.H\ AplusCollapsible.H\ AplusCommand.H\ AplusCommon.H\ AplusConvert.H\ AplusDialog.H\ AplusDisplayServer.H\ AplusEntryField.H\ AplusEnumConverter.H\ AplusErrorDialog.H\ AplusEvent.H\ AplusFormatter.H\ AplusGraph.H\ AplusHashTable.H\ AplusLabel.H\ AplusLabelOut.H\ AplusLayout.H\ AplusManager.H\ AplusMatrix.H\ AplusMenu.H\ AplusModel.H\ AplusNotebook.H\ AplusPage.H\ AplusPanes.H\ AplusParagraph.H\ AplusPassword.H\ AplusPopup.H\ AplusPrintColumn.H\ AplusPrintText.H\ AplusPrintTool.H\ AplusRadioBox.H\ AplusReference.H\ AplusReportAlgo.H\ AplusReportEnum.H\ AplusRulePrintItem.H\ AplusScale.H\ AplusScrolledWindow.H\ AplusShell.H\ AplusSlot.H\ AplusTable.H\ AplusTableColumn.H\ AplusText.H\ AplusTrace.H\ AplusTreeView.H\ AplusUpdateQueue.H\ AplusView.H\ EnumTables.H\ Macros.H INCLUDES = -I.. -I/usr/X11R6/include subdir = src/AplusGUI mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_CLEAN_FILES = LTLIBRARIES = $(lib_LTLIBRARIES) libAplusGUI_la_LDFLAGS = libAplusGUI_la_LIBADD = am_libAplusGUI_la_OBJECTS = AGIF.lo AGIFGraph.lo AGIFmstk.lo \ AGIFPrint.lo AplusApplication.lo AplusArray.lo AplusButton.lo \ AplusButtonBox.lo AplusCallback.lo AplusCheckBox.lo \ AplusChoice.lo AplusCollapsible.lo AplusCommand.lo \ AplusCommon.lo AplusConvert.lo AplusDisplayServer.lo \ AplusEntryField.lo AplusEnumConverter.lo AplusEvent.lo \ AplusFormatter.lo AplusGraph.lo AplusHashTable.lo AplusLabel.lo \ AplusLabelOut.lo AplusLayout.lo AplusManager.lo AplusMatrix.lo \ AplusMenu.lo AplusModel.lo AplusNotebook.lo AplusPage.lo \ AplusPanes.lo AplusParagraph.lo AplusPassword.lo AplusPopup.lo \ AplusPrintColumn.lo AplusPrintText.lo AplusPrintTool.lo \ AplusRadioBox.lo AplusReference.lo AplusReportAlgo.lo \ AplusReportEnum.lo AplusRulePrintItem.lo AplusScale.lo \ AplusScrolledWindow.lo AplusShell.lo AplusSlot.lo AplusTable.lo \ AplusTableColumn.lo AplusText.lo AplusTrace.lo AplusTreeView.lo \ AplusUpdateQueue.lo AplusView.lo EnumTables.lo aplKeys.lo libAplusGUI_la_OBJECTS = $(am_libAplusGUI_la_OBJECTS) DEFS = @DEFS@ DEFAULT_INCLUDES = -I. -I$(srcdir) CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/AGIF.Plo ./$(DEPDIR)/AGIFGraph.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AGIFPrint.Plo ./$(DEPDIR)/AGIFmstk.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusApplication.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusArray.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusButton.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusButtonBox.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusCallback.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusCheckBox.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusChoice.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusCollapsible.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusCommand.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusCommon.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusConvert.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusDisplayServer.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusEntryField.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusEnumConverter.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusEvent.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusFormatter.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusGraph.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusHashTable.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusLabel.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusLabelOut.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusLayout.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusManager.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusMatrix.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusMenu.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusModel.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusNotebook.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusPage.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusPanes.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusParagraph.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusPassword.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusPopup.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusPrintColumn.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusPrintText.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusPrintTool.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusRadioBox.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusReference.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusReportAlgo.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusReportEnum.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusRulePrintItem.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusScale.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusScrolledWindow.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusShell.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusSlot.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusTable.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusTableColumn.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusText.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusTrace.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusTreeView.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusUpdateQueue.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/AplusView.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/EnumTables.Plo ./$(DEPDIR)/aplKeys.Plo CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ CXXFLAGS = @CXXFLAGS@ CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ DIST_SOURCES = $(libAplusGUI_la_SOURCES) DIST_COMMON = Makefile.am Makefile.in SOURCES = $(libAplusGUI_la_SOURCES) all: all-am .SUFFIXES: .SUFFIXES: .C .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/AplusGUI/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) libLTLIBRARIES_INSTALL = $(INSTALL) install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(libdir) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f"; \ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p"; \ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test -z "$dir" && dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libAplusGUI.la: $(libAplusGUI_la_OBJECTS) $(libAplusGUI_la_DEPENDENCIES) $(CXXLINK) -rpath $(libdir) $(libAplusGUI_la_LDFLAGS) $(libAplusGUI_la_OBJECTS) $(libAplusGUI_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AGIF.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AGIFGraph.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AGIFPrint.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AGIFmstk.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusApplication.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusArray.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusButton.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusButtonBox.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusCallback.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusCheckBox.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusChoice.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusCollapsible.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusCommand.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusCommon.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusConvert.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusDisplayServer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusEntryField.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusEnumConverter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusEvent.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusFormatter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusGraph.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusHashTable.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusLabel.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusLabelOut.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusLayout.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusManager.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusMatrix.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusMenu.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusModel.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusNotebook.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusPage.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusPanes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusParagraph.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusPassword.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusPopup.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusPrintColumn.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusPrintText.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusPrintTool.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusRadioBox.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusReference.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusReportAlgo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusReportEnum.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusRulePrintItem.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusScale.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusScrolledWindow.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusShell.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusSlot.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusTable.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusTableColumn.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusText.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusTrace.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusTreeView.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusUpdateQueue.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AplusView.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/EnumTables.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aplKeys.Plo@am__quote@ distclean-depend: -rm -rf ./$(DEPDIR) .C.o: @AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< .C.obj: @AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CXXCOMPILE) -c -o $@ `cygpath -w $<` .C.lo: @AMDEP_TRUE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(LTCXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< CXXDEPMODE = @CXXDEPMODE@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ETAGS = etags ETAGSFLAGS = tags: TAGS 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; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ 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; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = ../.. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: $(mkinstalldirs) $(DESTDIR)$(libdir) 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_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_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-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-compile distclean-depend \ distclean-generic distclean-libtool distclean-tags dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-exec-am: install-libLTLIBRARIES install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES .PHONY: GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool distclean distclean-compile \ distclean-depend distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am info info-am install \ install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am \ install-libLTLIBRARIES install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool tags uninstall \ uninstall-am uninstall-info-am uninstall-libLTLIBRARIES # 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: aplus-fsf-4.22/src/AplusGUI/AGIF.C0000644000265000001440000015347410772770343012100 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #if HAVE_IOSTREAM #include #else #include #endif #if HAVE_NEW #include #else #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include extern long dbg_tmstk; extern MSString applicationVersionString(void); int AplusEvaluationDepth=0; typedef void *XCallArg; typedef void *XClientArg; ////////////////////////////////////////////////////////////////////////////// int DefaultPixelValue=0; static MSChannel *stdinChannel_g; static AplusFormatter OutputObject; void serverExitFunction(AplusDisplayServer *server_) { if (server_!=0) { // MSDeleteQueue::allowDelete(MSFalse); E e; e=(E)ma(3); e->n=1; e->f=(I)server_->exitFunc()->function(); e->a[0]=(I)server_->exitFunc()->data(); dc((A)ez(ME(e))); mf((I *)e); // MSDeleteQueue::allowDelete(MSTrue); } } static char *g_mstkVersion(void) { return (char *)applicationVersionString().string(); } static void s_scbTraceHook(A func) { AScbTraceHook::function(func); return; } static void s_XSynchronize(AplusDisplayServer *server_, I mode_) { if(server_) XSynchronize(server_->display(),mode_?True:False); return; } static void s_exitFunc(AplusDisplayServer *server_,A fc_) { if (fc_->t==Et&&fc_->n==2) { I f=fc_->p[0]; I c=fc_->p[1]; AExitFunc *exitFunc=new AExitFunc((A)f,(A)c); server_->exitFunc(exitFunc); } } static A g_exitFunc(AplusDisplayServer *server_) { A r=aplus_nl; if (server_!=0) { r=gv(Et,2); r->p[0]=ic(server_->exitFunc()->function()); r->p[1]=ic(server_->exitFunc()->data()); } return (A)r; } // Setting Server defaults static A g_defaultPixelValue() { return gi(DefaultPixelValue); } static A g_defaultFontValue() { return gi((I)MSDisplayServer::defaultDisplayServer()->defaultFont()); } static A g_colorMapDefaultBg(MSDisplayServer *server_) { A z=aplus_nl; if (server_!=0) z=gi(server_->defaultBackground()); return z; } static void s_colorMapDefaultBg(MSDisplayServer *server_, unsigned long color_) { server_->defaultBackground(server_->colorName(color_)); } static A g_colorMapDefaultFg(MSDisplayServer *server_) { A z=aplus_nl; if (server_!=0) z=gi(server_->defaultForeground()); return z; } static void s_colorMapDefaultFg(MSDisplayServer * server_, unsigned long color_) { server_->defaultForeground(server_->colorName(color_)); } static A g_colorMapDefaultHlColor(MSDisplayServer *) { return (A) gi(AVariableData::defaultHlColor()); } static void s_colorMapDefaultHlColor(MSDisplayServer *,unsigned long color_) { AVariableData::defaultHlColor(color_); } // Index Color is not supported, call RowColor instead static A g_colorMapDefaultIdxColor(MSDisplayServer *) { return (A) gi(AVariableData::defaultRowColor()); } static void s_colorMapDefaultIdxColor(MSDisplayServer *,unsigned long) { return; } static A g_colorMapDefaultRowColor(MSDisplayServer *) { return (A) gi(AVariableData::defaultRowColor()); } static void s_colorMapDefaultRowColor(MSDisplayServer *,unsigned long color_) { AVariableData::defaultRowColor(color_); } static A g_colorMapDefaultMatrixColor(MSDisplayServer *) { return (A) gi(AVariableData::defaultMatrixColor()); } static void s_colorMapDefaultMatrixColor(MSDisplayServer *,unsigned long color_) { AVariableData::defaultMatrixColor(color_); } static A g_serverDefaultFont(MSDisplayServer *server_) { A z=aplus_nl; if (server_!=0) z=gi(server_->defaultFont()); return z; } static void s_serverDefaultFont(MSDisplayServer *server_, Font f_) { server_->defaultFont(server_->fontName(f_)); } static A q_outputFormats(void) { return (A)OutputObject.formats(); } static A sfmt(A fmt_,A data_) { return (A)OutputObject.sfmt(fmt_,data_); } A cdipv(AClientData *ac_,A data_,A index_,A pick_,V v_) { // ++AplusEvaluationDepth; fix in mstk if(AScbTraceHook::function()) { AScbTraceHook::run(ac_->function(),(I)ac_->data(),(I)data_,(I)index_,(I)pick_,v_); } A r=af4(ac_->function(),(I)ac_->data(),(I)data_,(I)index_,(I)pick_,v_); // --AplusEvaluationDepth; fix in mstk if (r==0) showError(qs); return r; } A cdipvFmt(AClientData *ac_,A data_,A,A,V) { A r=OutputObject.fmt(ac_->data(),data_); if (r==0) showError(qs); return r; } static A cdipvThorn(AClientData *ac_,A data_,A,A,V) { A r=(data_->t<=Ft)?OutputObject.thorn(ac_->data(),data_):aplus_nl; if (r==0) showError(qs); return r; } static A cdipvSymbol(AClientData *ac_,A data_,A,A,V) { A r=OutputObject.formatOutput(ac_->data(),data_); if (r==0) showError(qs); return r; } AVariableData *getVarData(A a_) { V v=getV(a_); if (v==0) { return 0; } AVariableData *varData; if (v->attr!=0) { varData = (AVariableData *)v->attr; } else { varData = new AVariableData; v->attr = (void *)varData; } return varData; } static void s_varOutFunc(A a_,A fc_) { AVariableData *varData=getVarData(a_); if (QS(fc_)) { A sym=gs(Et); sym->p[0]=(I)fc_; A fmt=gv(It,2); int f=(int)OutputObject.format(fc_); if (f==0) { V v=getV(a_); cerr<<" ! "; if (v!=0) cerr<<(char*)v->cx->s->n<<"."<<(char*)v->s->n; cerr<<": invalid symbol"<p[0]=(I)f; fmt->p[1]=(I)OutputObject.defaultPrecision(); AClientData *ac=new AClientData((A)aplus_nl,(A)fmt,(A)sym); varData->outFunc((AFunc)cdipvSymbol,ac); } else if (QA(fc_)) { if (fc_->t==Ct) { AClientData *ac=new AClientData((A)aplus_nl,(A)fc_,(A)fc_); varData->outFunc((AFunc)cdipvFmt,ac); } else if (fc_->t==It||fc_->t==Ft) { P p; p.i=fc_->p; double dfmt=(fc_->t==Ft)?(double)p.f[0]:(double)p.i[0]; int ifmt=(int)(10.0*dfmt); A fmt=(A)gv(It,2); int width=(int)floor(dfmt); int precision=(ifmt-(width*10)); fmt->p[0]=(I)width; fmt->p[1]=(I)precision; AClientData *ac=new AClientData((A)aplus_nl,(A)fmt,(A)fc_); varData->outFunc((AFunc)cdipvThorn,ac); } else if (fc_->t==Et&&fc_->n>0) { P p; p.i=fc_->p; if (QS(p.a[0])) { A fmt=gv(It,2); int f=(int)OutputObject.format(p.a[0]); if (f==0) { V v=getV(a_); cerr<<" ! "; if (v!=0) cerr<<(char*)v->cx->s->n<<"."<<(char*)v->s->n; cerr<<": invalid symbol"<p[0]=(I)f; fmt->p[1]=(I)(fc_->n==2)?(int)p.a[1]->p[0]: OutputObject.defaultPrecision(); AClientData *ac=new AClientData((A)aplus_nl,(A)fmt,(A)fc_); varData->outFunc((AFunc)cdipvSymbol,ac); } else if (fc_->t==Et&&fc_->n==2) { AClientData *ac=new AClientData((A)p.a[0],(A)p.a[1],(A)fc_); varData->outFunc((AFunc)cdipv,ac); } else showError("Invalid 'out' Function Specification"); } else if (fc_->t==Et&&fc_->n==0) varData->outFunc((AFunc)0,0); else showError("Invalid 'out' Function Specification"); } else showError("Invalid 'out' Function Specification"); } static A getVarFunc(AClientData *ac_) { A r=aplus_nl; if (ac_!=0) { if (isNull(ac_->actualData())==MSFalse) r=(A)ic(ac_->actualData()); else { r=gv(Et,2); r->p[0]=ic(ac_->function()); r->p[1]=ic(ac_->data()); } } return (A)r; } void setBusyState(MSBoolean); // Safe Object Assignment function int safeAset(V v_,A d_,A i_,A p_) { setBusyState(MSTrue); // MSDeleteQueue::allowDelete(MSFalse); int r=(int)aset((I)v_,(I)d_,(I)i_,(I)p_); // MSDeleteQueue::allowDelete(MSTrue); setBusyState(MSFalse); return r; } // Safe Object Destruction function extern "C" void aplusDestroy(MSWidgetView *pWidgetView_); void aplusdestroy(MSWidgetView *pWidgetView_) { AVariableData *vd = 0; // Need to clear pWidgetView_ right away, can't wait for deleteQueue to process if (pWidgetView_) { AplusModel *pModel = (AplusModel *)pWidgetView_->model(); if (pModel) { vd = pModel->aplusVar() ? pModel->pAVarData() : 0; } } pWidgetView_->safeDestroy(pWidgetView_); if (vd) vd->pWidgetView(0); } // Variable Destruction function extern "C" void destroyVar(V v_); void destroyVar(V v_) { if (v_!=0) { AVariableData *varData = pAVarDataFromV(v_); if (varData!=0) delete varData; v_->attr=0; } } // CDE Window Manager Functions static A StringVectorToNestedArray(const MSStringVector &svec_) { unsigned const len=svec_.length(); A z=len?gv(Et,len):aplus_nl; for(int i=0;ip[i]=(I)gsv(0,(char *)svec_(i).string()); return z; } static MSStringVector NestedArrayToStringVector(A aobj_) { MSStringVector svec; A aelement; for (int i=0;in;++i) { aelement=(A)aobj_->p[i]; svec.append(MSString((Ct==aelement->t)?(char *)aelement->p:"")); } return svec; } static I g_serverIsCDERunning(AplusDisplayServer *server_) { return server_->isCDERunning()?1:0; } static char *g_serverCurrentWorkspace(AplusDisplayServer *server_) { return (char *) server_->currentWorkspaceName().string(); } static A g_serverWorkspaceNames(AplusDisplayServer *server_) { return StringVectorToNestedArray(server_->workspaceNames()); } static I s_serverCurrentWorkspace(AplusDisplayServer *server_,char *name_) { return server_->changeWorkspaceTo(MSString(name_))?1:0; } // misc functions static Font getFontID(MSDisplayServer *server_,const char *fontString_) { return server_->fontID(fontString_); } static char *getFontString(MSDisplayServer *server_,Font fontID_) { return (char *) server_->fontName(fontID_); } static unsigned long getPixelValue(MSDisplayServer *server_,const char *colorString_) { return server_->pixel(colorString_); } static char *getColorString(MSDisplayServer *server_,unsigned long p_) { return (char *) server_->colorName(p_); } // misc window functions static void mapW(MSWidgetView *pWidgetView_) // NEED RTTI { MSModel *pModel = pWidgetView_->model(); if (pModel!=0 && pModel->type()==AplusModel::symbol()) { AplusModel *aplusModel=(AplusModel *)pModel; aplusModel->evaluate(); } pWidgetView_->show(); } static void unmapW(MSWidgetView *pWidgetView_) { pWidgetView_->unmap(); } static void wRaise(MSWidgetView *pWidgetView_) { pWidgetView_->raise(); } static void wLower(MSWidgetView *pWidgetView_) { pWidgetView_->lower(); } static void naturalSize(MSWidgetView *pWidgetView_) { pWidgetView_->naturalSize(); } static I mapped(MSWidgetView *pWidgetView_) { return MSTrue==pWidgetView_->mapped() ? 1 : 0; } static I beenMapped(MSWidgetView *pWidgetView_) { return MSTrue==pWidgetView_->firstMap()? 1 : 0 ; } static MSWidgetView *parent(MSWidgetView *pWidgetView_) { return (MSWidgetView *)pWidgetView_->owner(); } static MSDisplayServer *server(MSWidgetView *pWidgetView_) { return pWidgetView_->server(); } static void resize(MSWidgetView *pWidgetView_,int w_,int h_) { pWidgetView_->resize(w_,h_); } static void moveTo(MSWidgetView *pWidgetView_,int x_,int y_) { pWidgetView_->moveTo(x_,y_); } static I warpPointer(MSWidgetView *pWidgetView_) { if (pWidgetView_!=0 && pWidgetView_->mapped()==MSTrue) { XWarpPointer(pWidgetView_->display(),None,pWidgetView_->window(),0,0,0,0,0,0); return 0; } else { return -1; } } static void positionChild(MSWidgetView *pWidgetView_,int r_,int c_,int vspan_, int hspan_,int opts_) { enum ResizeOptions { Center=0,Left=4,Right=8,Top=16,Bottom=32, SmallWidth=64,SmallHeight=128,LikeWidth=256,LikeHeight=512}; unsigned long constraint = At::Default; if (opts_ & Left ) constraint |= At::Left; if (opts_ & Right ) constraint |= At::Right; if (opts_ & Top ) constraint |= At::Top; if (opts_ & Bottom ) constraint |= At::Bottom; if (opts_ & SmallWidth ) constraint |= At::MinimizeWidth; if (opts_ & SmallHeight) constraint |= At::MinimizeHeight; if (opts_ & LikeWidth ) constraint |= At::MaintainWidth; if (opts_ & LikeHeight ) constraint |= At::MaintainHeight; pWidgetView_->at(At(r_, c_, vspan_, hspan_, constraint)); } static void wRefresh(MSWidgetView *pWidgetView_) { pWidgetView_->redraw(); } static void wDefaultBgColorChanged(MSWidgetView *w_, unsigned long new_) { if (w_->background()==MSDisplayServer::defaultDisplayServer()->defaultBackground()) w_->background(new_); } static void wDefaultFgColorChanged(MSWidgetView *w_, unsigned long new_) { if (w_->foreground()==MSDisplayServer::defaultDisplayServer()->defaultForeground()) w_->foreground(new_); } static void wDefaultHlColorChanged(MSWidgetView *w_, unsigned long new_) { if (w_->widgetType()==AplusSlot::symbol()) { AplusSlot *sl = (AplusSlot *)w_; if (sl->highlightColor()==AVariableData::defaultHlColor()) sl->highlightColor(new_); } else { if (w_) { if (w_->highlightColor()==AVariableData::defaultHlColor()) w_->highlightColor(new_); } } } // Index color is no longer supported. Only row color is honored. static void wDefaultIdxColorChanged(MSWidgetView *, unsigned long) { return; } static void wDefaultRowColorChanged(MSWidgetView *w_, unsigned long new_) { if (w_->widgetType()==AplusArray::symbol() || w_->widgetType()==AplusTable::symbol() || w_->widgetType()==AplusView::symbol() || w_->widgetType()==AplusMatrix::symbol()) { MSArrayView *av = (MSArrayView *)w_; if (av->selectedRowBackground()==AVariableData::defaultRowColor()) av->selectedRowBackground(new_); } } static void wDefaultMatrixColorChanged(MSWidgetView *w_, unsigned long new_) { if (w_->widgetType()==AplusMatrix::symbol()) { AplusMatrix *am = (AplusMatrix *)w_; if (am->rowIndexBg()==AVariableData::defaultMatrixColor() && am->colIndexBg()==AVariableData::defaultMatrixColor() && am->cornerIndexBg()==AVariableData::defaultMatrixColor()) { am->rowIndexBg(new_); am->colIndexBg(new_); am->cornerIndexBg(new_); } } } static void wDefaultFontChanged(MSWidgetView *pWidgetView_, Font new_) { if (pWidgetView_->font()==MSDisplayServer::defaultDisplayServer()->defaultFont()) pWidgetView_->font(new_); const MSSymbol& sym = pWidgetView_->widgetType(); if (sym==AplusTableColumn::symbol()) { AplusTableColumn *pColumn = (AplusTableColumn *)pWidgetView_; if (pColumn->headingFont()==MSDisplayServer::defaultDisplayServer()->defaultFont()) { pColumn->headingFont(new_); } } else if (sym!=AplusTraceSet::symbol()) // a regular widget, derived from MSWidgetCommon { MSWidgetCommon *pWidget = (MSWidgetCommon *)pWidgetView_; if (pWidget->titleFont()==MSDisplayServer::defaultDisplayServer()->defaultFont()) { pWidget->titleFont(new_); } } } void ACallback(XCallArg,XClientArg client_) { // MSDeleteQueue::allowDelete(MSFalse); AClientData *ac=(AClientData *)client_; if(AScbTraceHook::function()) { AScbTraceHook::run(ac->function(),(I)ac->data(),0,0,0,ac->aplusVar()); } A r=af4(ac->function(),(I)ac->data(),0,0,0,ac->aplusVar()); if (r==0) showError(qs); else dc(r); // MSDeleteQueue::allowDelete(MSTrue); } extern "C" void stdinDisable(void); extern "C" void stdinEnable(void); static MSBoolean stdinOn=MSTrue; void stdinDisable(void ) { stdinOn=MSFalse; stdinChannel_g->disable(); } void stdinEnable(void ) { stdinOn=MSTrue; stdinChannel_g->enable(); } static void AStdinCB(XCallArg) { tf(); if (stdinOn==MSTrue) stdinChannel_g->enable(); } // generate row col index for cdip functions A grc(A av_,int r,int c) { A a=av_; I n=a->r-(a->t==Ct&&a->r); a=gv(Et,n); if (1<=n) { a->p[0]=(r==-1)?(I)aplus_nl:(I)gi(r); if(2<=n) { a->p[1]=(c==-1)?(I)aplus_nl:(I)gi(c); } } return a; } static A getCB(MSWidgetView *pWidgetView_,A cbname_) { A r=aplus_nl; char *cbnamep; if (cbname_->t==Ct) cbnamep=(char *)cbname_->p; else if (cbname_->t==Et&&QS(*cbname_->p)) cbnamep=XS(*cbname_->p)->n; AplusCallback *acb=0; if ((acb=(AplusCallback *)pWidgetView_->callback(cbnamep))!=0) { AClientData *ac=acb->ac(); if (ac!=0) { r=gv(Et,2); r->p[0]=ic(ac->function()); r->p[1]=ic(ac->data()); } } return (A)r; } // use AXCommon::addAClientData&&AXCommon::removeAClientData to // insure that fc_ gets dc when the window is destroyed - the // PViewdow cb mechanism will not delete the client data - so we do // it separately here. static void addCB(MSWidgetView *pWidgetView_,A cbname_,A fc_) // NEED RTTI { char *cbnamep; if (cbname_->t==Ct) cbnamep=(char *)cbname_->p; else if (cbname_->t==Et&&QS(*cbname_->p)) cbnamep=XS(*cbname_->p)->n; AClientData *ac=0; if (fc_->t==Et&&fc_->n==2) { I f=fc_->p[0]; I c=fc_->p[1]; if (pWidgetView_->model()) ac=new AClientData(((AplusModel *)pWidgetView_->model())->aplusVar(),(A)f,(A)c); else ac=new AClientData((V) 0,(A)f,(A)c); pWidgetView_->callback(cbnamep,new AplusCallback(ac)); } else { pWidgetView_->callback(cbnamep, (MSCallback *)0); // Clear the callback } } /* * 'A' variable attribute functions for descendents of AXCommon */ static void s_varInFunc(A a_,A fc_) { AVariableData *varData=getVarData(a_); if (fc_->t==Et&&fc_->n==2) { I f=fc_->p[0]; I c=fc_->p[1]; AClientData *ac=new AClientData((A)f,(A)c); varData->inFunc((AFunc)cdipv,ac); } else if (isNull(fc_)==MSTrue) varData->inFunc((AFunc)0,0); else showError("Invalid 'in' Function Specification"); } static void s_varGeoFunc(A a_,A fc_) { AVariableData *varData=getVarData(a_); if (fc_->t==Et&&fc_->n==2) { I f=fc_->p[0]; I c=fc_->p[1]; AClientData *ac=new AClientData((A)f,(A)c); varData->geoFunc((AFunc)cdipv,ac); } else if (isNull(fc_)==MSTrue) varData->geoFunc((AFunc)0,0); else showError("Invalid 'geometry' Function Specification"); } static void s_varDoneFunc(A a_,A fc_) { AVariableData *varData=getVarData(a_); if (fc_->t==Et&&fc_->n==2) { I f=fc_->p[0]; I c=fc_->p[1]; AClientData *ac=new AClientData((A)f,(A)c); varData->doneFunc((AFunc)cdipv,ac); } else if (isNull(fc_)==MSTrue) varData->doneFunc((AFunc)0,0); else showError("Invalid 'done' Function Specification"); } /* static void s_varOutFunc(A a_,A fc_) { AVariableData *varData=getVarData(a_); if (fc_->t==Et&&fc_->n==2) { I f=fc_->p[0]; I c=fc_->p[1]; AClientData *ac=new AClientData((A)f,(A)c); varData->outFunc((AFunc)cdipv,ac); } else if (isNull(fc_)==MSTrue) varData->outFunc((AFunc)0,0); else showError("Invalid 'out' Function Specification"); } */ static void s_varTitleFunc(A a_,A fc_) { AVariableData *varData=getVarData(a_); if (fc_->t==Et&&fc_->n==2) { I f=fc_->p[0]; I c=fc_->p[1]; AClientData *ac=new AClientData((A)f,(A)c); varData->titleFunc((AFunc)cdipv,ac); } else if (isNull(fc_)==MSTrue) varData->titleFunc((AFunc)0,0); else showError("Invalid 'title' Function Specification"); } static void s_varFgFunc(A a_,A fc_) { AVariableData *varData=getVarData(a_); if (fc_->t==Et && fc_->n==2) { I f=fc_->p[0]; I c=fc_->p[1]; AClientData *ac=new AClientData((A)f,(A)c); varData->fgFunc((AFunc)cdipv,ac); } else if (It==fc_->t && 1==fc_->n || isNull(fc_)==MSTrue) varData->foreground(fc_); else showError("Invalid 'color' Function Specification"); } static void s_varBgFunc(A a_,A fc_) { AVariableData *varData=getVarData(a_); if (fc_->t==Et && fc_->n==2) { I f=fc_->p[0]; I c=fc_->p[1]; AClientData *ac=new AClientData((A)f,(A)c); varData->bgFunc((AFunc)cdipv,ac); } else if (It==fc_->t && 1==fc_->n || isNull(fc_)==MSTrue) varData->background(fc_); else showError("Invalid 'color' Function Specification"); } static void s_varTitleColorFunc(A a_,A fc_) { AVariableData *varData=getVarData(a_); if (fc_->t==Et&&fc_->n==2) { I f=fc_->p[0]; I c=fc_->p[1]; AClientData *ac=new AClientData((A)f,(A)c); varData->titleColorFunc((AFunc)cdipv,ac); } else if (isNull(fc_)==MSTrue) varData->titleColorFunc((AFunc)0,0); else showError("Invalid 'titleColor' Function Specification"); } static void s_varRoFunc(A a_,A fc_) { AVariableData *varData=getVarData(a_); if (fc_->t==Et&&fc_->n==2) { I f=fc_->p[0]; I c=fc_->p[1]; AClientData *ac=new AClientData((A)f,(A)c); varData->roFunc((AFunc)cdipv,ac); } else if (It==fc_->t&&1==fc_->n) varData->setReadOnly((int)fc_->p[0]); else if (isNull(fc_)==MSTrue) varData->setReadOnly(0); else showError("Invalid 'protect' Function Specification"); } static void s_varFontFunc(A a_,A fc_) { AVariableData *varData=getVarData(a_); if (fc_->t==Et&&fc_->n==2) { I f=fc_->p[0]; I c=fc_->p[1]; AClientData *ac=new AClientData((A)f,(A)c); varData->fontFunc((AFunc)cdipv,ac); } else if (It==fc_->t && 1==fc_->n || isNull(fc_)==MSTrue) varData->font(fc_); else showError("Invalid 'font' Function Specification"); } static void s_varTitleFontFunc(A a_,A fc_) { AVariableData *varData=getVarData(a_); if (fc_->t==Et&&fc_->n==2) { I f=fc_->p[0]; I c=fc_->p[1]; AClientData *ac=new AClientData((A)f,(A)c); varData->titleFontFunc((AFunc)cdipv,ac); } else if (isNull(fc_)==MSTrue) varData->titleFontFunc((AFunc)0,0); else showError("Invalid 'titleFont' Function Specification"); } static A g_varInFunc(A a_) {return (A)getVarFunc((AClientData *)getVarData(a_)->inFunc()->arg()); } static A g_varGeoFunc(A a_) {return (A)getVarFunc((AClientData *)getVarData(a_)->geoFunc()->arg()); } static A g_varOutFunc(A a_) {return (A)getVarFunc((AClientData *)getVarData(a_)->outFunc()->arg()); } static A g_varTitleFunc(A a_) {return (A)getVarFunc((AClientData *)getVarData(a_)->titleFunc()->arg()); } static A g_varFgFunc(A a_) // really returns foreground { AVariableData *varData=getVarData(a_); A z=(A)getVarFunc((AClientData *)varData->fgFunc()->arg()); if (isNull(z)==MSTrue) return (A)ic(varData->fgA()); return z; } static A g_varBgFunc(A a_) // really returns background { AVariableData *varData=getVarData(a_); A z=(A)getVarFunc((AClientData *)varData->bgFunc()->arg()); if (isNull(z)==MSTrue) return (A)ic(varData->bgA()); return z; } static A g_varFontFunc(A a_) { AVariableData *varData=getVarData(a_); A z=(A)getVarFunc((AClientData *)varData->fontFunc()->arg()); if (isNull(z)==MSTrue) return (A)ic(varData->fontA()); return z; } // static A g_varFontFunc(A a_) // {return (A)getVarFunc((AClientData *)getVarData(a_)->fontFunc()->arg()); } static A g_varTitleColorFunc(A a_) {return (A)getVarFunc((AClientData *)getVarData(a_)->titleColorFunc()->arg());} static A g_varRoFunc(A a_) { AVariableData *varData=getVarData(a_); A z=(A)getVarFunc((AClientData *)varData->roFunc()->arg()); if (isNull(z)==MSTrue) return (A) gi(varData->readOnly()); return z; } static A g_varTitleFontFunc(A a_) {return (A)getVarFunc((AClientData *)getVarData(a_)->titleFontFunc()->arg());} static A g_varDoneFunc(A a_) {return (A)getVarFunc((AClientData *)getVarData(a_)->doneFunc()->arg()); } /* Variable set Functions */ static void s_varClass(A a_,A class_) { (isNull(class_)==MSTrue||Et!=class_->t||1>class_->n) ? getVarData(a_)->varClass((S)0):getVarData(a_)->varClass(XS(*class_->p)); } static void s_varBg(A a_,A bg_) { getVarData(a_)->background(bg_); } static void s_varStars(A a_,MSBoolean b_) { getVarData(a_)->stars(b_); } static void s_varCw(A a_,int w_) { getVarData(a_)->colWidth(w_); } static void s_varEw(A a_,int w_) { getVarData(a_)->editWidth(w_); } static void s_varWid(A a_,MSWidgetView *pWidgetView_) { getVarData(a_)->pWidgetView(pWidgetView_); } static void s_varTitle(A a_,A str_) { getVarData(a_)->title(str_); } static void s_varTitleColor(A a_,A fg_) { getVarData(a_)->titleFg(fg_); } static void s_varTitleFont(A a_,A fid_) { getVarData(a_)->titleFont(fid_); } /* Variable get Functions */ static A g_varClass(A a_) { AVariableData *pVarData=getVarData(a_); if (pVarData==0) { return aplus_nl; } S sym=pVarData->varClass(); return (sym!=0)?gsym(sym->n):aplus_nl; } static A g_varBg(A a_) { A ap=getVarData(a_)->bgA(); return (QA(ap)&&isNull(ap)==MSFalse)?(A)ic(ap):ap; } static I g_varStars(A a_) { return MSTrue==getVarData(a_)->stars() ? 1 :0; } static I g_varCw(A a_) { return (I) getVarData(a_)->colWidth(); } static I g_varEw(A a_) { return (I) getVarData(a_)->editWidth(); } static MSWidgetView *g_varWid(A a_) { return getVarData(a_)->pWidgetView(); } static A g_varTitle(A a_) { A ap=getVarData(a_)->title(); return (QA(ap) && isNull(ap)==MSFalse) ? (A)ic(ap) : ap; } static A g_varTitleColor(A a_) { A ap=getVarData(a_)->titleAFg(); return (QA(ap) && isNull(ap)==MSFalse) ? (A)ic(ap) : ap; } static A g_varTitleFont(A a_) { A ap=getVarData(a_)->titleAFont(); return (QA(ap)&&isNull(ap)==MSFalse)?(A)ic(ap):ap; } extern "C" void update(V,A,A,A,I,I); void update(V v_,A data_,A index_,A pick_,I ravel_,I immediateUpdate_) { // This function must take care to prevent re-entrance into the GUI code // during dependency re-evaluation. There are 2 flags, which are used // to detect if we are currently in the middle of some GUI update and // delay update processing, placing the event onto the update queue instead. // // 1) immediateUpdate_ argument indicates whether the update should be processed // immediately or not. It's set to 0 in liba during nested dependency // evaluation. // // 2) AplusEvaluationDepth is a global flag incremented in AplusModel::evaluate() // before gt() is called and decremented after gt() is done. If a non-zero value // indicates that this update came from a dependency re-evaluation in AplusGUI. // if (immediateUpdate_==0 || AplusEvaluationDepth>0) { addToUpdateQueue(v_,data_,index_,pick_,ravel_); } else // if the call is not recursive { setBusyState(MSTrue); AplusUpdate upd(v_,data_,index_,pick_,ravel_); upd.send(); processUpdateQueue(); setBusyState(MSFalse); } } static A g_data(MSWidgetView *pWidgetView_) { V arg; if (pWidgetView_->model()==0) { if (dbg_tmstk) cout << "Widget with no model" << endl; arg = 0; } else { arg = ((AplusModel *) pWidgetView_->model())->aplusVar(); } return (A) getSymWithContext(arg); } void s_data(MSWidgetView *pWidgetView_,A aobject_) { V aplusVar = getVfromA(aobject_); // Special Hack job for Shell and Popups. if (pWidgetView_->widgetType() == AplusShell::symbol() || pWidgetView_->widgetType() == AplusPopup::symbol()) { ((AplusModel*)pWidgetView_->model())->aplusVar(aplusVar); return; } if (aplusVar!=0 && gt(aplusVar)) // ok to call gt() directly as aplusVar is not bound to widget yet { AplusModel *pModel = new AplusModel(aplusVar); pModel->coupleWidgetView(pWidgetView_); } } I v_data(MSWidgetView *pWidgetView_,A a_) { V v=getV(a_); if (v==0) { return 0; } AplusVerifyEvent ave(v, (A)gt(v)); if (pWidgetView_!=0 && pWidgetView_->model()!=0) { // we can call receiveEvent() on the widget-view directly instead of // calling sendEvent() on the model, but for that we need to // cast the widget-view to MSEventReceiver, since MSView::receiveEvent() // is protected ((MSEventReceiver *)pWidgetView_)->receiveEvent(ave); return MSTrue==ave.result() ? 1 : 0; } else { if (dbg_tmstk) cout << "No model defined in v_data" << endl; return 1; } } extern "C" int verify(V v_,A a_); int verify(V v_,A a_) { MSBoolean r=MSFalse; if (v_->attr!=0) { AVariableData *varData=pAVarDataFromV(v_); AplusVerifyEvent ave(v_, a_); MSWidgetView *pWidgetView = varData->pWidgetView(); if (pWidgetView && pWidgetView->model()) { // see the comment in v_data() ((MSEventReceiver *)pWidgetView)->receiveEvent(ave); r = ave.result(); } else { if (dbg_tmstk) cout << "Warning: No model defined in verify" << endl; r=MSFalse; } } return (int) MSTrue==r ? 1 : 0; } extern "C" void flush(void); void flush(void) { MSApplication::application()->flush(); } static void bFlush(void) { MSApplication::application()->flush(); } static void bBeep(MSDisplayServer *server_) { server_->bell(); } static I bVirtualScreen(AplusDisplayServer *server_) {return (I) server_->virtualScreen();} static A bVirtualGeometry(AplusDisplayServer *server_) { int r,c; server_->virtualGeometry(r,c); A av=gv(It,2); av->p[0]=(I)r; av->p[1]=(I)c; return av; } static void bRequestPrimary(MSWidgetView *pWidgetView_) { pWidgetView_->convertSelection(); } static A g_primary(MSWidgetView *pWidgetView_) { return (A)(pWidgetView_->server()->pasteBuffer().length()>0)? gsv(0,(char *)pWidgetView_->server()->pasteBuffer().string()):gsv(0,""); } static void s_primary(MSWidgetView *pWidgetView_, A data_) { if (QA(data_)&&data_->t==Ct) { if (data_->r==2) { int slen=(int)(data_->n+data_->d[0]); char *str=new char[slen+1]; char *cp=(char *)data_->p; int c=0,col=0; for (int i=0;in;i++) { if (col==data_->d[1]) {str[c++]='\n';col=0;} str[c++]=cp[i]; col++; } str[c++]='\n'; str[slen]='\0'; (void)pWidgetView_->copyPrimary(str,slen); delete [] str; } else (void)pWidgetView_->copyPrimary((char *)data_->p,(int)data_->n); } } static I bIsTopLevel(MSTopLevel *); static I bIsPopup(MSTopLevel *); // Shell 'A' interface functions static void s_virtualScreen(MSTopLevel *top_, A screen_) { if (bIsTopLevel(top_)==1) // if this is a shell { ((AplusShell *)top_)->virtualScreen(screen_); } else if (bIsPopup(top_)==1) // if this is a popup { ((AplusPopup *)top_)->virtualScreen(screen_); } } static A g_virtualScreen(MSTopLevel *top_) { if (bIsTopLevel(top_)==1) // if this is a shell { return ((AplusShell *)top_)->virtualScreen(); } else if (bIsPopup(top_)==1) // if this is a popup { return ((AplusPopup *)top_)->virtualScreen(); } else { return gi(-1); } } // Left and Right Footers won't be supported anymore //static void s_shellLeftFooter(MSShell *sh_,const char *s_) { sh_->leftFooter(s_); } //static void s_shellRightFooter(MSShell *sh_,const char *s_){ sh_->rightFooter(s_); } //static char *g_shellLeftFooter(MSShell *sh_) {return(char *)sh_->leftFooter();} //static char *g_shellRightFooter(MSShell *sh_){return(char *)sh_->rightFooter();} static const char *DefaultFooter = ""; static const char *DefaultHeader = ""; static void s_shellLeftFooter(MSTopLevel *,const char *) { return; } static void s_shellRightFooter(MSTopLevel *,const char *){ return; } static char *g_shellLeftFooter(MSTopLevel *) {return (char *) DefaultFooter;} static char *g_shellRightFooter(MSTopLevel *) {return(char *) DefaultHeader;} static void s_shellFooter(MSTopLevel *sh_, MSBoolean b_) { sh_->footer(b_); } static void s_shellHeader(MSTopLevel *sh_, MSBoolean b_) { sh_->header(b_); } static I g_shellFooter(MSShell *sh_) { return MSTrue==sh_->footer() ? 1 : 0; } static I g_shellHeader(MSShell *sh_) { return MSTrue==sh_->header() ? 1 : 0; } static A g_shellWorkspacePresence(MSTopLevel *sh_) { return StringVectorToNestedArray(sh_->workspacePresence()); } static void s_shellWorkspacePresence(MSTopLevel *sh_,A names_) { if (Ct==names_->t) sh_->workspacePresence(MSString((char *)names_->p)); else if (Et==names_->t) { MSStringVector svec=NestedArrayToStringVector(names_); sh_->workspacePresence(svec); } } static void s_shellResizeable(MSTopLevel *sh_,MSBoolean b_) {sh_->resizeable((MSBoolean)b_); } static I s_windowGroup(MSShell *tl_,MSShell *gr_) { return MSTrue==tl_->windowGroup(gr_) ? 1 : 0; } static MSShell *g_windowGroup(MSShell *tl_) {return tl_->windowGroup();} static A g_followers(MSShell *tl_) { const MSWidgetVector &wv = tl_->followerList(); A r = aplus_nl; if (wv.length()>0) r = gv(It, wv.length()); for (unsigned i = 0; i < wv.length(); i++) { if (wv(i)!=(MSWidgetView *) tl_) // The widget itself is not a follower in A+ r->p[i] = (unsigned long) wv(i); } return r; } static void s_pushPinState(MSPopup *pw_,MSBoolean state_) { (state_==MSTrue)?pw_->pinIn():pw_->pinOut(); } static I g_pushPinState(MSPopup *pw_) { return (pw_->pushPinState()==MSTrue) ? 1 : 0; } static MSShell *g_topLevel(MSWidgetView *pWidgetView_) { while (pWidgetView_->owner()!=0) { pWidgetView_ = (MSWidgetView *)pWidgetView_->owner(); } return (MSShell *)pWidgetView_; } static I bIsTopLevel(MSTopLevel *top_) /* Should be bIsShell */ { if (top_->widgetType() == AplusShell::symbol()) return 1; else return 0; } static I bIsPopup(MSTopLevel *top_) { if (top_->widgetType() == AplusPopup::symbol()) return 1; else return 0; } // We still need a BusyCount, despite ref counting of MSApplicationBusy; // Otherwise we don't know when to clear the pointer bp; static MSApplicationBusy *bp=0; static MSBoolean BusyEnable = MSTrue; static int BusyCount=0; void busyEnable(MSBoolean state_) {BusyEnable=state_;} MSBoolean busyEnable(void) {return BusyEnable;} static void s_busyState(I state_) { if (state_) { ++BusyCount; if (bp==0) bp=new MSApplicationBusy; } else if (BusyCount>0) { BusyCount--; if(0==BusyCount){if (bp!=0) delete bp;bp=0;} } } void setBusyState(MSBoolean state_) { s_busyState((state_==MSTrue && BusyEnable==MSTrue)?1:0); } static I g_busyCount(void) {return BusyCount;} // Busy Title no longer exists static void s_busyTitleState(MSBoolean) {} static I g_busyTitleState(void) { return 0; } static void s_busyClockState(I state_) { BusyEnable=state_ ? MSTrue : MSFalse; if (BusyEnable == MSFalse) { delete bp; } } static I g_busyClockState(void) { return MSTrue==BusyEnable ? 1 : 0; } static void s_shellIconData(MSShell *sh_,A a_) { if (QA(a_)&&a_->t==Et&&a_->n==3) { P p; p.i=a_->p; if (p.a[0]->t==It&&p.a[0]->r==0&& p.a[1]->t==It&&p.a[1]->r==0&& p.a[2]->t==It&&p.a[2]->r==1) { int width=(int)p.a[0]->p[0]; int height=(int)p.a[1]->p[0]; char *bits=new char[p.a[2]->n]; for (int i=0;in;i++) bits[i]=(char)p.a[2]->p[i]; Pixmap bitmap=XCreateBitmapFromData(sh_->display(),sh_->window(),bits,width,height); sh_->iconPixmap(MSPixmap(sh_->server(), "iconPixelMap", bits, width, height, sh_->foreground(),sh_->background())); } } } static void traverseFocus(MSWidgetView *pWidgetView_) { (void)g_topLevel(pWidgetView_)->traverseFocus(pWidgetView_); } static A g_tabList(MSShell *sh_) { A r = aplus_nl; const MSWidgetVector &wv = sh_->traversalList(); r = gv(It, wv.length()); for (int i = 0; i < wv.length(); i++) { r->p[i] = (unsigned long) wv(i); } return r; } static void s_tabList(MSShell *sh_, A a_) { if (a_==0) { return; } if (isNull(a_) || a_->t==It) { MSWidgetVector wv; P p; p.i=a_->p; for (int ind=0; indn; ++ind) { wv << (MSWidgetView *)p.i[ind]; } sh_->traversalList(wv); } } static MSWidgetView *g_metaTab(MSWidgetView *pWidgetView_) { MSShell *top = g_topLevel(pWidgetView_); MSWidget *pFocusWidget=0; if (top->widgetType()==AplusShell::symbol()) { pFocusWidget = ((AplusShell *)top)->getNextFocusAfter(pWidgetView_); } else if (top->widgetType() == AplusPopup::symbol()) { pFocusWidget = ((AplusPopup *)top)->getNextFocusAfter(pWidgetView_); } // Make sure that we have an A+ widget here, not an MStk widget. This // especially applies to composite A+ widgets, such as AplusSlot, since // in MStk every field is also a widget. If pFocusWidget is an MStk // widget (e.g., a slot field), then go up the widget hierarchy until // we find an A+ widget. // while (pFocusWidget!=0 && isAplusWidget(pFocusWidget)==MSFalse) { pFocusWidget = pFocusWidget->owner(); } // Either the A+ widget that has the focus or 0 will be returned to s; // s should handle the null pointer case properly. // return (MSWidgetView *)pFocusWidget; } static void s_metaTab(MSWidgetView *from_, MSWidgetView *to_) { MSShell *top = g_topLevel(from_); if (top->widgetType() == AplusShell::symbol()) { ((AplusShell *)top)->insertFocusAfter(from_, to_); } else if (top->widgetType() == AplusPopup::symbol()) { ((AplusPopup *)top)->insertFocusAfter(from_, to_); } } static void bShowAndWaitForMap(MSWidgetView *pWidgetView_) { MSShell *top = g_topLevel(pWidgetView_); if (top->widgetType() == AplusShell::symbol()) ((AplusShell *)top)->showAndWaitForMap(); else if (top->widgetType() == AplusPopup::symbol()) ((AplusPopup *)top)->showAndWaitForMap(); } static void bAddTab(MSShell *,MSWidgetView *pWidgetView_){pWidgetView_->addToFocusList();} static void bRemoveTab(MSShell *,MSWidgetView *pWidgetView_) { pWidgetView_->removeFromFocusList(); } static MSDisplayServer *DefaultXServer(void) { if (MSDisplayServer::defaultDisplayServer()==0) { cerr<<"No Default Server Established: exit in DefaultXServer()"<connection(); } A xwindowHashStat(MSDisplayServer *server_) { if (server_==0) server_=MSDisplayServer::defaultDisplayServer(); int size=server_->widgetHashTable()->size(); A r=gv(It,size); for (int i=0;ip[i]=(I)server_->widgetHashTable()->chainLength(i); return r; } A shadowHashStat(MSDisplayServer *server_) { if (server_==0) server_=MSDisplayServer::defaultDisplayServer(); int size=server_->shadowHashTable()->size(); A r=gv(It,size); for (int i=0;ip[i]=(I)server_->shadowHashTable()->chainLength(i); return r; } A shadowReferenceStat(MSDisplayServer *) { /* if (server_==0) server_=MSDisplayServer::defaultDisplayServer(); MSHashTable *ht=server_->shadowHashTable(); int c=0; int i; for (i=0;isize();i++) c+=ht->chainLength(i); A r=gv(It,c); c=0; for (i=0;isize();i++) { MSHashEntry *entry=ht->bucket(i); while (entry!=0) { MSShadowColors *data=(MSShadowColors *)entry->value(); r->p[c++]=(I)data->count(); entry=entry->next(); } } return r; */ return aplus_nl; } static I bServerConnection(MSDisplayServer *server_) { return (I) serverConnection(server_); } static I bServerNoDelay(MSDisplayServer *server_,MSBoolean b_) { return MSTrue==serverNoDelay(server_,b_) ? 1 : 0; } static A bXWindowHashStat(MSDisplayServer *server_) { return xwindowHashStat(server_); } static A bShadowHashStat(MSDisplayServer *server_) { return shadowHashStat(server_); } static A bShadowReferenceStat(MSDisplayServer *server_) { return shadowReferenceStat(server_); } static A bPixmapHashStat(void) { /* int size=MSPixmap::table()->size(); A r=gv(It,size); for (int i=0;ip[i]=(I)MSPixmap::table()->chainLength(i); return r; */ return aplus_nl; } static A bPixmapReferenceStat(void) { /* MSHashTable *ht=MSPixmap::table(); int c=0; int i; for (i=0;isize();i++) c+=ht->chainLength(i); A r=gv(It,c); c=0; for (i=0;isize();i++) { MSHashEntry *entry=ht->bucket(i); while (entry!=0) { MSPixmapData *data=(MSPixmapData *)entry->value(); r->p[c++]=(I)data->count(); entry=entry->next(); } } return r; */ return aplus_nl; } static A bXGCReferenceStat(void) { A r=gv(It,MSGC::xgcList().count()); for (int i=0;ip[i]=(I)MSGC::xgcList().data(i)->count(); return r; } static void bPrintLayoutInfo(MSLayoutManager *) { if (dbg_tmstk) cout << "PrintLayoutInfo is currently unsupported." << endl; return; } static void s_doubleClickInterval(unsigned long t_) { MSApplication::application()->doubleClickInterval(t_); } static unsigned long g_doubleClickInterval(void) { return MSApplication::application()->doubleClickInterval(); } static void s_menuDefaultMnemonic(MSBoolean b_) { MSMenuItem::defaultMnemonic(b_); } static I g_menuDefaultMnemonic(void) { return MSTrue==MSMenuItem::defaultMnemonic() ? 1 : 0; } extern "C" A mj(A); // return a float representing width.precision static A w_p(A a_) { return (A)mj(a_); } static A bOut(A a_,A data_) { AVariableData *varData=getVarData(a_); AOutFunction *f=varData->outFunc(); return (f->func()!=0)?(*f->func())(f->arg(),data_,aplus_nl,aplus_nl,(V)0):(A)gsv(0,""); } extern "C" I g_backingStoreOption(void); extern "C" void s_backingStoreOption(int o_); void s_backingStoreOption(int o_) { MSApplication::backingStoreOption(0==o_?MSFalse:MSTrue); } I g_backingStoreOption(void) { return MSTrue==MSApplication::backingStoreOption() ? 1 : 0; } A q_shadowStyle(void) { AplusShadowStyleConverter converter; return converter.stringDomain(); } /////////////////////////////////////////////////////////////////////////////// void AGIFInstall(void) { CX context=Cx; Cx=cx("s"); install((PFI)g_mstkVersion,"g_mstkVersion",CP,0,0,0,0,0,0,0,0,0); install((PFI)s_scbTraceHook,"s_scbTraceHook",V_,1,A_,0,0,0,0,0,0,0); install((PFI)s_varClass,"s_varClass",V_,2,A_,A_,0,0,0,0,0,0); install((PFI)s_varBg,"s_varBg",V_,2,A_,A_,0,0,0,0,0,0); install((PFI)s_varStars,"s_varStars",V_,2,A_,IV,0,0,0,0,0,0); install((PFI)s_varCw,"s_varCw",V_,2,A_,IV,0,0,0,0,0,0); install((PFI)s_varEw,"s_varEw",V_,2,A_,IV,0,0,0,0,0,0); install((PFI)s_varWid,"s_varWid",V_,2,A_,IV,0,0,0,0,0,0); install((PFI)s_varOutFunc,"s_varOutFunc",V_,2,A_,A_,0,0,0,0,0,0); install((PFI)s_varTitleFunc,"s_varTitleFunc",V_,2,A_,A_,0,0,0,0,0,0); install((PFI)s_varGeoFunc,"s_varGeoFunc",V_,2,A_,A_,0,0,0,0,0,0); install((PFI)s_varDoneFunc,"s_varDoneFunc",V_,2,A_,A_,0,0,0,0,0,0); install((PFI)s_varInFunc,"s_varInFunc",V_,2,A_,A_,0,0,0,0,0,0); install((PFI)s_varFgFunc,"s_varFgFunc",V_,2,A_,0,A_,0,0,0,0,0); install((PFI)s_varBgFunc,"s_varBgFunc",V_,2,A_,0,A_,0,0,0,0,0); install((PFI)s_varTitleColorFunc,"s_varTitleColorFunc",V_,2,A_,0,A_,0,0,0,0,0); install((PFI)s_varRoFunc,"s_varRoFunc",V_,2,A_,A_,0,0,0,0,0,0); install((PFI)s_varFontFunc,"s_varFontFunc",V_,2,A_,A_,0,0,0,0,0,0); install((PFI)s_varTitleFontFunc,"s_varTitleFontFunc",V_,2,A_,A_,0,0,0,0,0,0); install((PFI)s_varTitle,"s_varTitle",V_,2,A_,A_,0,0,0,0,0,0); install((PFI)s_varTitleColor,"s_varTitleColor",V_,2,A_,A_,0,0,0,0,0,0); install((PFI)s_varTitleFont,"s_varTitleFont",V_,2,A_,A_,0,0,0,0,0,0); install((PFI)g_varWid,"g_varWid",IV,1,A_,0,0,0,0,0,0,0); install((PFI)g_varBg,"g_varBg",A_,1,A_,0,0,0,0,0,0,0); install((PFI)g_varStars,"g_varStars",IV,1,A_,0,0,0,0,0,0,0); install((PFI)g_varCw,"g_varCw",IV,1,A_,0,0,0,0,0,0,0); install((PFI)g_varEw,"g_varEw",IV,1,A_,0,0,0,0,0,0,0); install((PFI)g_varClass,"g_varClass",A_,1,A_,0,0,0,0,0,0,0); install((PFI)g_varGeoFunc,"g_varGeoFunc",A_,1,A_,0,0,0,0,0,0,0); install((PFI)g_varDoneFunc,"g_varDoneFunc",A_,1,A_,0,0,0,0,0,0,0); install((PFI)g_varOutFunc,"g_varOutFunc",A_,1,A_,0,0,0,0,0,0,0); install((PFI)g_varTitleFunc,"g_varTitleFunc",A_,1,A_,0,0,0,0,0,0,0); install((PFI)g_varInFunc,"g_varInFunc",A_,1,A_,0,0,0,0,0,0,0); install((PFI)g_varFgFunc,"g_varFgFunc",A_,1,0,0,A_,0,0,0,0,0); install((PFI)g_varBgFunc,"g_varBgFunc",A_,1,0,0,A_,0,0,0,0,0); install((PFI)g_varTitleColorFunc,"g_varTitleColorFunc",A_,1,0,0,A_,0,0,0,0,0); install((PFI)g_varRoFunc,"g_varRoFunc",A_,1,A_,0,0,0,0,0,0,0); install((PFI)g_varFontFunc,"g_varFontFunc",A_,1,A_,0,0,0,0,0,0,0); install((PFI)g_varTitleFontFunc,"g_varTitleFontFunc",A_,1,A_,0,0,0,0,0,0,0); install((PFI)g_varTitle,"g_varTitle",A_,1,A_,0,0,0,0,0,0,0); install((PFI)g_varTitleColor,"g_varTitleColor",A_,1,A_,0,0,0,0,0,0,0); install((PFI)g_varTitleFont,"g_varTitleFont",A_,1,A_,0,0,0,0,0,0,0); install((PFI)s_XSynchronize,"s_XSynchronize",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)s_exitFunc,"s_exitFunc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_exitFunc,"g_exitFunc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)g_defaultPixelValue,"bDefaultPixelValue",A_,0,0,0,0,0,0,0,0,0); install((PFI)g_defaultFontValue,"bDefaultFontValue",A_,0,0,0,0,0,0,0,0,0); install((PFI)s_colorMapDefaultBg,"s_defaultBg",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_colorMapDefaultBg,"g_defaultBg",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_colorMapDefaultFg,"s_defaultFg",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_colorMapDefaultFg,"g_defaultFg",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_colorMapDefaultHlColor,"s_defaultHlColor",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_colorMapDefaultHlColor,"g_defaultHlColor",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_colorMapDefaultIdxColor,"s_defaultIdxColor",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_colorMapDefaultIdxColor,"g_defaultIdxColor",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_colorMapDefaultRowColor,"s_defaultRowColor",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_colorMapDefaultRowColor,"g_defaultRowColor",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_colorMapDefaultMatrixColor,"s_defaultMatrixColor",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_colorMapDefaultMatrixColor,"g_defaultMatrixColor",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_serverDefaultFont,"s_defaultFont",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_serverDefaultFont,"g_defaultFont",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_data,"s_data",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_data,"g_data",A_,1,IV,0,0,0,0,0,0,0); install((PFI)v_data,"v_data",IV,2,IV,A_,0,0,0,0,0,0); install((PFI)s_windowGroup,"s_windowGroup",IV,2,IV,IV,0,0,0,0,0,0); install((PFI)g_windowGroup,"g_windowGroup",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_followers,"g_followers",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_pushPinState,"s_pushPinState",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_pushPinState,"g_pushPinState",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_shellIconData,"s_shellIconData",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)s_busyState,"s_busyState",V_,1,IV,0,0,0,0,0,0,0); install((PFI)g_busyCount,"g_busyCount",IV,0, 0,0,0,0,0,0,0,0); install((PFI)s_busyTitleState,"s_busyTitleState",V_,1,IV,0,0,0,0,0,0,0); install((PFI)g_busyTitleState,"g_busyTitleState",IV,0,0,0,0,0,0,0,0,0); install((PFI)s_busyClockState,"s_busyClockState",V_,1,IV,0,0,0,0,0,0,0); install((PFI)g_busyClockState,"g_busyClockState",IV,0,0,0,0,0,0,0,0,0); install((PFI)g_topLevel,"g_topLevel",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_tabList,"g_tabList",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_tabList,"s_tabList",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)s_virtualScreen,"s_virtualScreen",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_virtualScreen,"g_virtualScreen",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_shellLeftFooter,"s_shellLeftFooter",V_,2,IV,CP,0,0,0,0,0,0); install((PFI)s_shellRightFooter,"s_shellRightFooter",V_,2,IV,CP,0,0,0,0,0,0); install((PFI)s_shellFooter,"s_shellFooter",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)s_shellHeader,"s_shellHeader",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)s_shellResizeable,"s_shellResizeable",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_shellFooter,"g_shellFooter",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_shellHeader,"g_shellHeader",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_shellLeftFooter,"g_shellLeftFooter",CP,1,IV,0,0,0,0,0,0,0); install((PFI)g_shellRightFooter,"g_shellRightFooter",CP,1,IV,0,0,0,0,0,0,0); install((PFI)g_shellWorkspacePresence,"g_shellWorkspacePresence",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_shellWorkspacePresence,"s_shellWorkspacePresence",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)bShowAndWaitForMap,"bShowAndWaitForMap",V_,1,IV,0,0,0,0,0,0,0); install((PFI)s_metaTab,"s_metaTab",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_metaTab,"g_metaTab",IV,1,IV,0,0,0,0,0,0,0); install((PFI)traverseFocus,"bTraverseFocus",V_,1,IV,0,0,0,0,0,0,0); install((PFI)bRequestPrimary,"bRequestPrimary",V_,1,IV,0,0,0,0,0,0,0); install((PFI)s_primary,"s_primary",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_primary,"g_primary",A_,1,IV,0,0,0,0,0,0,0); install((PFI)bIsTopLevel,"bIsTopLevel",IV,1,IV,0,0,0,0,0,0,0); install((PFI)bIsPopup,"bIsPopup",IV,1,IV,0,0,0,0,0,0,0); install((PFI)bAddTab,"bAddTab",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)bRemoveTab,"bRemoveTab",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)bOut,"bOut",A_,2,A_,A_,0,0,0,0,0,0); install((PFI)sfmt,"sfmt",A_,2,A_,A_,0,0,0,0,0,0); install((PFI)q_outputFormats,"q_outputFormats",A_,0,0,0,0,0,0,0,0,0); install((PFI)bBeep,"bBeep",V_,1,IV,0,0,0,0,0,0,0); install((PFI)aplusdestroy,"bDestroy",V_,1,IV,0,0,0,0,0,0,0); install((PFI)mapW,"bMap",V_,1,IV,0,0,0,0,0,0,0); install((PFI)unmapW,"bunMap",V_,1,IV,0,0,0,0,0,0,0); install((PFI)wRaise,"bRaise",V_,1,IV,0,0,0,0,0,0,0); install((PFI)wLower,"bLower",V_,1,IV,0,0,0,0,0,0,0); install((PFI)naturalSize,"bNaturalSize",V_,1,IV,0,0,0,0,0,0,0); install((PFI)parent,"bParent",IV,1,IV,0,0,0,0,0,0,0); install((PFI)mapped,"bMapped",IV,1,IV,0,0,0,0,0,0,0); install((PFI)beenMapped,"bBeenMapped",IV,1,IV,0,0,0,0,0,0,0); install((PFI)server,"bServer",IV,1,IV,0,0,0,0,0,0,0); install((PFI)bFlush,"bFlush",V_,0,0,0,0,0,0,0,0,0); install((PFI)resize,"bResize",V_,3,IV,IV,IV,0,0,0,0,0); install((PFI)moveTo,"bMoveTo",V_,3,IV,IV,IV,0,0,0,0,0); install((PFI)warpPointer,"bWarpPointer",IV,1,IV,0,0,0,0,0,0,0); install((PFI)addCB,"bAddCB",V_,3,IV,A_,A_,0,0,0,0,0); install((PFI)getCB,"bGetCB",A_,2,IV,A_,0,0,0,0,0,0); install((PFI)positionChild,"bPositionChild",V_,6,IV,IV,IV,IV,IV,IV,0,0); install((PFI)wRefresh,"bRefresh",V_,1,IV,0,0,0,0,0,0,0); install((PFI)wDefaultBgColorChanged,"bDefaultBgColorChanged",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)wDefaultFgColorChanged,"bDefaultFgColorChanged",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)wDefaultHlColorChanged,"bDefaultHlColorChanged",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)wDefaultIdxColorChanged,"bDefaultIdxColorChanged",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)wDefaultRowColorChanged,"bDefaultRowColorChanged",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)wDefaultMatrixColorChanged,"bDefaultMatrixColorChanged",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)wDefaultFontChanged,"bDefaultFontChanged",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_serverIsCDERunning,"g_serverIsCDERunning",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_serverCurrentWorkspace,"g_serverCurrentWorkspace",CP,1,IV,0,0,0,0,0,0,0); install((PFI)g_serverWorkspaceNames,"g_serverWorkspaceNames",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_serverCurrentWorkspace,"s_serverCurrentWorkspace",IV,2,IV,CP,0,0,0,0,0,0); install((PFI)getFontID,"bgetFontID",IV,2,IV,CP,0,0,0,0,0,0); install((PFI)getFontString,"bgetFontString",CP,2,IV,IV,0,0,0,0,0,0); install((PFI)getPixelValue,"bgetPixelValue",IV,2,IV,CP,0,0,0,0,0,0); install((PFI)getColorString,"bgetColorString",CP,2,IV,IV,0,0,0,0,0,0); install((PFI)w_p,"w_p",A_,1,A_,0,0,0,0,0,0,0); install((PFI)bVirtualScreen,"bVirtualScreen",IV,1,IV,0,0,0,0,0,0,0); install((PFI)bVirtualGeometry,"bVirtualGeometry",A_,1,IV,0,0,0,0,0,0,0); install((PFI)bServerConnection,"bServerConnection",IV,1,IV,0,0,0,0,0,0,0); install((PFI)bServerNoDelay,"bServerNoDelay",IV,2,IV,IV,0,0,0,0,0,0); install((PFI)bXWindowHashStat,"bXWindowHashStat",A_,1,IV,0,0,0,0,0,0,0); install((PFI)bShadowHashStat,"bShadowHashStat",A_,1,IV,0,0,0,0,0,0,0); install((PFI)bShadowReferenceStat,"bShadowReferenceStat",A_,1,IV,0,0,0,0,0,0,0); install((PFI)bPixmapHashStat,"bPixmapHashStat",A_,0,0,0,0,0,0,0,0,0); install((PFI)bPixmapReferenceStat,"bPixmapReferenceStat",A_,0,0,0,0,0,0,0,0,0); install((PFI)bXGCReferenceStat,"bXGCReferenceStat",A_,0,0,0,0,0,0,0,0,0); install((PFI)bPrintLayoutInfo,"bPrintLayoutInfo",V_,1,IV,0,0,0,0,0,0,0); install((PFI)s_doubleClickInterval, "bsetDoubleClickInterval",V_,1,IV,0,0,0,0,0,0,0); install((PFI)g_doubleClickInterval, "bgetDoubleClickInterval",IV,0,0,0,0,0,0,0,0,0); install((PFI)g_menuDefaultMnemonic, "bgetMenuDefaultMnemonic",IV,0,0,0,0,0,0,0,0,0); install((PFI)s_menuDefaultMnemonic, "bsetMenuDefaultMnemonic",V_,1,IV,0,0,0,0,0,0,0); install((PFI)g_backingStoreOption, "bgetBackingStoreOption",IV,0,0,0,0,0,0,0,0,0); install((PFI)s_backingStoreOption, "bsetBackingStoreOption",V_,1,IV,0,0,0,0,0,0,0); install((PFI)q_shadowStyle, "q_shadowStyle", A_,1,0,0,0,0,0,0,0,0); Cx=context; } extern void AGIFmstkInstall(void); extern void AGIFGraphInstall(void); extern void AGIFPrintInstall(void); typedef void (*PFV)(void*); extern "C" void XaInstall(void); void XaInstall(void) { AGIFInstall(); AGIFmstkInstall(); AGIFGraphInstall(); AGIFPrintInstall(); stdinChannel_g=new MSChannel("stdin",0,MSChannel::Default,MSChannel::Read,new AplusStdinCallback((PFV)AStdinCB)); stdinChannel_g->enable(); } extern "C" void CppInstall(void); A ep_gfmtsym(void) { return (A)OutputObject.formats(); } A ep_sfmt(A fmt_,A data_) { return (A)OutputObject.sfmt(fmt_,data_); } void CppInstall(void) { CX context=Cx; Cx=Rx; install((PFI)ep_gfmtsym,"_gfmtsym",A_,0,0,0,0,0,0,0,0,0); install((PFI)ep_sfmt,"_sfmt",A_,2,A_,A_,0,0,0,0,0,0); Cx=context; } aplus-fsf-4.22/src/AplusGUI/AGIFGraph.C0000644000265000001440000024350710772770343013057 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #if HAVE_IOSTREAM #include #else #include #endif #if HAVE_NEW #include #else #include #endif #include #include #include #include #include extern A cdipv(AClientData *,A,A,A,V); extern A cdipvFmt(AClientData *,A,A,A,V); extern A getVarFunc(AClientData *); extern const int MSPointsPerInch; /* * XTrace access functions */ static void s_traceLineStyleFunc(AplusTraceSet *tp_,A fc_) { if (fc_->t==Et&&fc_->n==2) tp_->lineStyleFunc((AFunc)cdipv,fc_); else if (isNull(fc_)==MSTrue) tp_->lineStyleFunc((AFunc)0,0); else showError("Invalid 'lineStyle' Function Specification"); } static A g_traceLineStyleFunc(AplusTraceSet *tp_) { return (A) getVarFunc((AClientData *) tp_->lineStyleFunc()->arg()); } static void s_traceLineWidthFunc(AplusTraceSet *tp_,A fc_) { if (fc_->t==Et&&fc_->n==2) tp_->lineWidthFunc((AFunc)cdipv,fc_); else if (isNull(fc_)==MSTrue) tp_->lineWidthFunc((AFunc)0,0); else showError("Invalid 'lineWidth' Function Specification"); } static A g_traceLineWidthFunc(AplusTraceSet *tp_) { return (A) getVarFunc((AClientData *) tp_->lineWidthFunc()->arg()); } /*** pieOffset attribute should not be functional static void s_tracePieOffsetFunc(AplusTraceSet *tp_,A fc_) { if (fc_->t==Et&&fc_->n==2) tp_->pieOffsetFunc((AFunc)cdipv,fc_); else if (isNull(fc_)==MSTrue) tp_->pieOffsetFunc((AFunc)0,0); else showError("Invalid 'pieOffset' Function Specification"); } static A g_tracePieOffsetFunc(AplusTraceSet *tp_) { return (A) getVarFunc((AClientData *) tp_->pieOffsetFunc()->arg()); } ***/ static void s_traceLineColorFunc(AplusTraceSet *tp_,A fc_) { if (fc_->t==Et&&fc_->n==2) tp_->lineColorFunc((AFunc)cdipv,fc_); else if (isNull(fc_)==MSTrue) tp_->lineColorFunc((AFunc)0,0); else showError("Invalid 'lineColor' Function Specification"); } static A g_traceLineColorFunc(AplusTraceSet *tp_) { AColorFunction *f = (AColorFunction *) tp_->lineColorFunc(); // Need to cast away constness return (A) getVarFunc((AClientData *) f->arg()); } static void s_traceFillColorFunc(AplusTraceSet *tp_,A fc_) { if (fc_->t==Et&&fc_->n==2) tp_->fillColorFunc((AFunc)cdipv,fc_); else if (isNull(fc_)==MSTrue) tp_->fillColorFunc((AFunc)0,0); else showError("Invalid 'fillColor' Function Specification"); } static A g_traceFillColorFunc(AplusTraceSet *tp_) { AColorFunction *f = (AColorFunction *) tp_->fillColorFunc(); // Need to cast away constness return (A) getVarFunc((AClientData *) f->arg()); } static void s_traceLegendFunc(AplusTraceSet *tp_,A fc_) { if (fc_->t==Et&&fc_->n==2) tp_->legendFunc((AFunc)cdipv,fc_); else if (isNull(fc_)==MSTrue) tp_->legendFunc((AFunc)0,0); else showError("Invalid 'legend' Function Specification"); } static A g_traceLegendFunc(AplusTraceSet *tp_) { return (A) getVarFunc((AClientData *) tp_->legendFunc()->arg()); } static void s_traceStyleFunc(AplusTraceSet *tp_,A fc_) { if (fc_->t==Et&&fc_->n==2) tp_->traceStyleFunc((AFunc)cdipv,fc_); else if (isNull(fc_)==MSTrue) tp_->traceStyleFunc((AFunc)0,0); else showError("Invalid 'traceStyle' Function Specification"); } static A g_traceStyleFunc(AplusTraceSet *tp_) { return (A) getVarFunc((AClientData *) tp_->traceStyleFunc()->arg()); } static void s_traceSymbolFunc(AplusTraceSet *tp_,A fc_) { if (fc_->t==Et&&fc_->n==2) tp_->traceSymbolFunc((AFunc)cdipv,fc_); else if (isNull(fc_)==MSTrue) tp_->traceSymbolFunc((AFunc)0,0); else showError("Invalid 'traceSymbol' Function Specification"); } static A g_traceSymbolFunc(AplusTraceSet *tp_) { return (A) getVarFunc((AClientData *) tp_->traceSymbolFunc()->arg()); } static void s_traceSymbolSizeFunc(AplusTraceSet *tp_,A fc_) { if (fc_->t==Et&&fc_->n==2) tp_->traceSymbolSizeFunc((AFunc)cdipv,fc_); else if (isNull(fc_)==MSTrue) tp_->traceSymbolSizeFunc((AFunc)0,0); else showError("Invalid 'traceSymbolSize' Function Specification"); } static A g_traceSymbolSizeFunc(AplusTraceSet *tp_) { return (A) getVarFunc((AClientData *) tp_->traceSymbolSizeFunc()->arg()); } static void s_traceYaxisFunc(AplusTraceSet *tp_,A fc_) { if (fc_->t==Et&&fc_->n==2) tp_->altYaxisFunc((AFunc)cdipv,fc_); else if (isNull(fc_)==MSTrue) tp_->altYaxisFunc((AFunc)0,0); else showError("Invalid 'altYaxis' Function Specification"); } static A g_traceYaxisFunc(AplusTraceSet *tp_) { return (A) getVarFunc((AClientData *) tp_->altYaxisFunc()->arg()); } static void s_traceXaxisFunc(AplusTraceSet *tp_,A fc_) { if (fc_->t==Et&&fc_->n==2) tp_->altXaxisFunc((AFunc)cdipv,fc_); else if (isNull(fc_)==MSTrue) tp_->altXaxisFunc((AFunc)0,0); else showError("Invalid 'altXaxis' Function Specification"); } static A g_traceXaxisFunc(AplusTraceSet *tp_) { return (A) getVarFunc((AClientData *) tp_->altXaxisFunc()->arg()); } static void s_traceGradientFunc(AplusTraceSet *tp_,A fc_) { if (fc_->t==Et&&fc_->n==2) tp_->gradientFunc((AFunc)cdipv,fc_); else if (isNull(fc_)==MSTrue) tp_->gradientFunc((AFunc)0,0); else showError("Invalid 'gradient' Function Specification"); } static A g_traceGradientFunc(AplusTraceSet *tp_) { return (A) getVarFunc((AClientData *) tp_->gradientFunc()->arg()); } static void s_traceCoordinate(AplusTraceSet *,A) {} // static void s_traceCoordinate(AplusTraceSet *tp_,A value_) // { if (!QS(value_)&&(value_->t==It || value_->t==Ft)&&value_->n==2) // { P p; p.i=value_->p; tp_->x_offset(value_->t==Ft?p.f[0]:(double)p.i[0]); // tp_->y_offset(value_->t==Ft?p.f[1]:(double)p.i[1]); } } static A g_traceCoordinate(AplusTraceSet *tp_) { return tp_->coordinate(); } static void s_tracePieAngle(AplusTraceSet *tp_,A value_) { if (!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; tp_->pieAngle(value_->t==Ft?(int)p.f[0]:p.i[0]); } } static A g_tracePieAngle(AplusTraceSet *tp_) { A r=gf(tp_->pieAngle()); return r; } static void s_tracePieOffsets(AplusTraceSet *pTraceSet_, A value_) { if (!QS(value_) && value_->r<2 && (value_->t==It || value_->t==Ft)) // if it's an int or float scalar or vector { if (value_->r==0) // if it's a scalar (as opposed to a one-element vector) { double offset = (value_->t==Ft) ? *(double*)value_->p : *(I*)value_->p; pTraceSet_->pieOffsets(MSFloatVector(1,offset)); } else { MSFloatVector offsets(AplusConvert::asMSFloatVector(value_)); if (offsets.length() > 0) { pTraceSet_->pieOffsets(offsets); } } } } static A g_tracePieOffsets(AplusTraceSet *pTraceSet_) { MSFloatVector *offsets = pTraceSet_->pieOffsets(); return (offsets==0) ? (A)gf(pTraceSet_->pieOffset()) : AplusConvert::asA(*offsets); } static void s_tracePieAspectRatio(AplusTraceSet *tp_,A value_) { if (!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; tp_->pieAspectRatio(value_->t==Ft?p.f[0]:(double)p.i[0]); } } static A g_tracePieAspectRatio(AplusTraceSet *tp_) { A r=gf(tp_->pieAspectRatio()); return r; } static void s_tracePieDepthFactor(AplusTraceSet *tp_,A value_) { if (!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; tp_->pieDepthFactor(value_->t==Ft?p.f[0]:(double)p.i[0]); } } static A g_tracePieDepthFactor(AplusTraceSet *tp_) { A r=gf(tp_->pieDepthFactor()); return r; } static void s_tracePieProfiles(AplusTraceSet *pTraceSet_, A value_) { if (!QS(value_) && value_->r<2 && (value_->t==It || value_->t==Ft)) // if it's an int or float scalar or vector { if (value_->r==0) // if it's a scalar (as opposed to a one-element vector) { double profile = (value_->t==Ft) ? *(double*)value_->p : *(I*)value_->p; pTraceSet_->pieProfiles(MSFloatVector(1,profile)); } else { MSFloatVector profiles(AplusConvert::asMSFloatVector(value_)); if (profiles.length() > 0) { pTraceSet_->pieProfiles(profiles); } } } } static A g_tracePieProfiles(AplusTraceSet *pTraceSet_) { MSFloatVector *profiles = pTraceSet_->pieProfiles(); return (profiles==0) ? (A)gf(1.0) : AplusConvert::asA(*profiles); } static void s_tracePieLegendAlign(AplusTraceSet *pTraceSet_, A align_) { pTraceSet_->pieLegendAlignment(GUIEnum.alignFormat(align_)); } static A g_tracePieLegendAlign(AplusTraceSet *pTraceSet_) { return GUIEnum.alignFormat(pTraceSet_->pieLegendAlignment()); } static void s_tracePieValueAlign(AplusTraceSet *pTraceSet_, A align_) { pTraceSet_->pieValueAlignment(GUIEnum.alignFormat(align_)); } static A g_tracePieValueAlign(AplusTraceSet *pTraceSet_) { return GUIEnum.alignFormat(pTraceSet_->pieValueAlignment()); } static void s_tracePiePercentAlign(AplusTraceSet *pTraceSet_, A align_) { pTraceSet_->piePercentAlignment(GUIEnum.alignFormat(align_)); } static A g_tracePiePercentAlign(AplusTraceSet *pTraceSet_) { return GUIEnum.alignFormat(pTraceSet_->piePercentAlignment()); } static void s_tracePrimarySlice(AplusTraceSet *pTraceSet_, int slice_) { pTraceSet_->primarySlice(slice_); } static I g_tracePrimarySlice(AplusTraceSet *pTraceSet_) { return (I) pTraceSet_->primarySlice(); } static void s_tracePrimarySliceAlign(AplusTraceSet *pTraceSet_, A align_) { pTraceSet_->primarySliceAlignment((MSAlignment)GUIEnum.alignFormat(align_)); } static A g_tracePrimarySliceAlign(AplusTraceSet *pTraceSet_) { return GUIEnum.alignFormat(pTraceSet_->primarySliceAlignment()); } static void s_traceConstraint(AplusTraceSet *tp_,A value_){tp_->constraint(value_);} static A g_traceConstraint(AplusTraceSet *tp_) { return tp_->constraintSym(); } static void s_traceSelectable(AplusTraceSet *tp_,MSBoolean value_) { tp_->selectable(value_); } static I g_traceSelectable(AplusTraceSet *tp_) { return MSTrue==tp_->selectable() ? 1 : 0; } static char *g_traceText(AplusTraceSet *tp_) { return (char *) tp_->graph()->editorString(); } static void s_traceSelected(AplusTraceSet *tp_,A value_) { tp_->selected(value_); } static A g_traceSelected(AplusTraceSet *tp_) { return (A)tp_->selected(); } static void s_traceTextFont(AplusTraceSet *ts_, Font font_) { ts_->textFont(font_); } static Font g_traceTextFont(AplusTraceSet *ts_) { return ts_->textFont(); } static void s_traceTextFg(AplusTraceSet *ts_, unsigned long fg_) { ts_->textForeground(fg_); } static unsigned long g_traceTextFg(AplusTraceSet *ts_) { return ts_->textForeground(); } // // XGraph access functions // // Label Format Functions void graphYlabelFormatFunc(AplusGraph *gr_,A fc_,int axis_) { if (QA(fc_) && fc_->t==Ct) { AClientData *ac=new AClientData((A)aplus_nl,(A)fc_,(A)fc_); gr_->y_labelFormatFunc((AFunc)cdipvFmt,ac); } else if (!QS(fc_)&&(fc_->t==Et&&fc_->n>0&&QS(*fc_->p))) { gr_->y_labelFormat(fc_,axis_); } else if (fc_->t==Et&&fc_->n==2) { P p; p.i = fc_->p; if (QA(p.a[0])&&(p.a[0]->t==Et&&p.a[0]->n>0&&QS(*p.a[0]->p))) { P pp; pp.i = p.a[1]->p; if (pp.i!=0) gr_->y_labelFormat(p.a[0], axis_, (int)pp.i[0]); else gr_->y_labelFormat(p.a[0],axis_); } else { AClientData *ac=new AClientData(p.a[0],p.a[1]); gr_->y_labelFormatFunc((AFunc)cdipv,ac,axis_); } } else if (isNull(fc_)==MSTrue) gr_->y_labelFormatFunc((AFunc)0,0,axis_); else showError("Invalid 'y format label' Function Specification"); } static void s_graphYlabelFormatFunc(AplusGraph *gr_,A fc_) { graphYlabelFormatFunc(gr_,fc_,0); } static A g_graphYlabelFormatFunc(AplusGraph *gr_) { A ac=(A)getVarFunc((AClientData *)gr_->y_labelFormatFunc(0)->arg()); return (isNull(ac)==MSTrue) ? gr_->y_labelFormatSym(0) : ac; } static void s_graphYYlabelFormatFunc(AplusGraph *gr_,A fc_) { graphYlabelFormatFunc(gr_,fc_,1); } static A g_graphYYlabelFormatFunc(AplusGraph *gr_) { A ac=(A)getVarFunc((AClientData *)gr_->y_labelFormatFunc(1)->arg()); return (isNull(ac)==MSTrue) ? gr_->y_labelFormatSym(1) : ac; } void graphXlabelFormatFunc(AplusGraph *gr_,A fc_,int axis_) { if (QA(fc_) && fc_->t==Ct) { AClientData *ac=new AClientData((A)aplus_nl,(A)fc_,(A)fc_); gr_->x_labelFormatFunc((AFunc)cdipvFmt,ac); } else if (!QS(fc_)&&(fc_->t==Et&&fc_->n>0&&QS(*fc_->p))) { gr_->x_labelFormat(fc_,axis_); } else if (fc_->t==Et&&fc_->n==2) { P p; p.i = fc_->p; if (QA(p.a[0])&&(p.a[0]->t==Et&&p.a[0]->n>0&&QS(*p.a[0]->p))) { P pp; pp.i = p.a[1]->p; if (pp.i!=0) gr_->x_labelFormat(p.a[0], axis_, (int)pp.i[0]); else gr_->x_labelFormat(p.a[0], axis_); } else { AClientData *ac=new AClientData(p.a[0],p.a[1]); gr_->x_labelFormatFunc((AFunc)cdipv,ac,axis_); } } else if (isNull(fc_)==MSTrue) gr_->x_labelFormatFunc((AFunc)0,0,axis_); else showError("Invalid 'x format label' Function Specification"); } static void s_graphXlabelFormatFunc(AplusGraph *gr_,A fc_) { graphXlabelFormatFunc(gr_,fc_,0); } static A g_graphXlabelFormatFunc(AplusGraph *gr_) { A ac=(A)getVarFunc((AClientData *)gr_->x_labelFormatFunc(0)->arg()); return (isNull(ac)==MSTrue) ? gr_->x_labelFormatSym(0) : ac; } static void s_graphXXlabelFormatFunc(AplusGraph *gr_,A fc_) { graphXlabelFormatFunc(gr_,fc_,1); } static A g_graphXXlabelFormatFunc(AplusGraph *gr_) { A ac=(A)getVarFunc((AClientData *)gr_->x_labelFormatFunc(1)->arg()); return (isNull(ac)==MSTrue) ? gr_->x_labelFormatSym(0) : ac; } void graphXsubLabelFormatFunc(AplusGraph *gr_,A fc_,int axis_) { if (QA(fc_) && fc_->t==Ct) { AClientData *ac=new AClientData((A)aplus_nl,(A)fc_,(A)fc_); gr_->x_subLabelFormatFunc((AFunc)cdipvFmt,ac); } else if (!QS(fc_)&&(fc_->t==Et&&fc_->n>0&&QS(*fc_->p))) { gr_->x_subLabelFormat(fc_,axis_); } else if (fc_->t==Et&&fc_->n==2) { P p; p.i = fc_->p; if (QA(p.a[0])&&(p.a[0]->t==Et&&p.a[0]->n>0&&QS(*p.a[0]->p))) { P pp; pp.i = p.a[1]->p; if (pp.i!=0) gr_->x_subLabelFormat(p.a[0], axis_, (int)pp.i[0]); else gr_->x_subLabelFormat(p.a[0],axis_); } else { AClientData *ac=new AClientData(p.a[0],p.a[1]); gr_->x_subLabelFormatFunc((AFunc)cdipv,ac,axis_); } } else if (isNull(fc_)==MSTrue) gr_->x_labelFormatFunc((AFunc)0,0,axis_); else showError("Invalid 'x format label' Function Specification"); } static void s_graphXsubLabelFormatFunc(AplusGraph *gr_,A fc_) { graphXsubLabelFormatFunc(gr_,fc_,0); } static A g_graphXsubLabelFormatFunc(AplusGraph *gr_) { A ac=(A)getVarFunc((AClientData *)gr_->x_subLabelFormatFunc(0)->arg()); return (isNull(ac)==MSTrue) ? gr_->x_subLabelFormatSym(0) : ac; } static void s_graphXXsubLabelFormatFunc(AplusGraph *gr_,A fc_) { graphXsubLabelFormatFunc(gr_,fc_,1); } static A g_graphXXsubLabelFormatFunc(AplusGraph *gr_) { A ac=(A)getVarFunc((AClientData *)gr_->x_subLabelFormatFunc(1)->arg()); return (isNull(ac)==MSTrue) ? gr_->x_subLabelFormatSym(1) : ac; } // Label Functions void graphYlabelFunc(AplusGraph *gr_,A fc_,int axis_) { if (fc_->t==Et&&fc_->n==2) { P p; p.i=fc_->p; AClientData *ac=new AClientData(p.a[0],p.a[1]); gr_->y_labelFunc((AFunc)cdipv,ac,axis_); } else if (isNull(fc_)==MSTrue) gr_->y_labelFunc((AFunc)0,0,axis_); else showError("Invalid 'y label' Function Specification"); } static void s_graphYlabelFunc(AplusGraph *gr_,A fc_) {graphYlabelFunc(gr_,fc_,0);} static A g_graphYlabelFunc(AplusGraph *gr_) { return (A) getVarFunc((AClientData *) gr_->y_labelFunc(0)->arg()); } static void s_graphYYlabelFunc(AplusGraph *gr_,A fc_) {graphYlabelFunc(gr_,fc_,1);} static A g_graphYYlabelFunc(AplusGraph *gr_) { return (A) getVarFunc((AClientData *) gr_->y_labelFunc(1)->arg()); } void graphXsubLabelFunc(AplusGraph *gr_,A fc_,int axis_) { if (fc_->t==Et&&fc_->n==2) { P p; p.i=fc_->p; AClientData *ac=new AClientData(p.a[0],p.a[1]); gr_->x_subLabelFunc((AFunc)cdipv,ac,axis_); } else if (isNull(fc_)==MSTrue) gr_->x_subLabelFunc((AFunc)0,0,axis_); else showError("Invalid 'x label' Function Specification"); } static void s_graphXsubLabelFunc(AplusGraph *gr_,A fc_) { graphXsubLabelFunc(gr_,fc_,0); } static A g_graphXsubLabelFunc(AplusGraph *gr_) { return (A) getVarFunc((AClientData *) gr_->x_subLabelFunc()->arg()); } static void s_graphXXsubLabelFunc(AplusGraph *gr_,A fc_) { graphXsubLabelFunc(gr_,fc_,1); } static A g_graphXXsubLabelFunc(AplusGraph *gr_) { return (A) getVarFunc((AClientData *) gr_->x_subLabelFunc(1)->arg()); } void graphXlabelFunc(AplusGraph *gr_,A fc_,int axis_) { if (fc_->t==Et&&fc_->n==2) { P p; p.i=fc_->p; AClientData *ac=new AClientData(p.a[0],p.a[1]); gr_->x_labelFunc((AFunc)cdipv,ac,axis_); } else if (isNull(fc_)==MSTrue) gr_->x_labelFunc((AFunc)0,0,axis_); else showError("Invalid 'x label' Function Specification"); } static void s_graphXlabelFunc(AplusGraph *gr_,A fc_) {graphXlabelFunc(gr_,fc_,0);} static A g_graphXlabelFunc(AplusGraph *gr_) { return (A) getVarFunc((AClientData *) gr_->x_labelFunc()->arg()); } static void s_graphXXlabelFunc(AplusGraph *gr_,A fc_) {graphXlabelFunc(gr_,fc_,1);} static A g_graphXXlabelFunc(AplusGraph *gr_) { return (A) getVarFunc((AClientData *) gr_->x_labelFunc(1)->arg()); } A q_traceStyle(AplusTraceSet *tp_) { return tp_->enumSymbols("traceStyle"); } A q_traceLineStyle(AplusTraceSet *tp_) { return tp_->enumSymbols("traceLineStyle");} A q_traceSymbol(AplusTraceSet *tp_) { return tp_->enumSymbols("traceSymbol"); } A q_traceConstraint(AplusTraceSet *tp_) { return tp_->enumSymbols("traceConstraint");} A q_graphMode(AplusGraph *gr_) { return gr_->enumSymbols("graphMode"); } A q_graphUIMode(AplusGraph *gr_) { return gr_->enumSymbols("graphUIMode"); } A q_graphStyle(AplusGraph *gr_) { return gr_->enumSymbols("graphStyle"); } A q_graphAxis(AplusGraph *gr_) { return gr_->enumSymbols("axis"); } A q_graphYmode(AplusGraph *gr_) { return gr_->enumSymbols("ymode"); } A q_graphRule(AplusGraph *gr_) { return gr_->enumSymbols("rule"); } A q_graphGrid(AplusGraph *gr_) { return gr_->enumSymbols("grid"); } A q_graphZero(AplusGraph *gr_) { return gr_->enumSymbols("grid"); } A q_graphGridStyle(AplusGraph *gr_) { return gr_->enumSymbols("gridStyle"); } A q_graphZeroStyle(AplusGraph *gr_) { return gr_->enumSymbols("gridStyle"); } A q_graphTickStyle(AplusGraph *gr_) { return gr_->enumSymbols("tickStyle"); } A q_graphLegendPosition(void) { AplusGraph::LegendAlignConverter converter; return converter.stringDomain(); } A q_graphLegendStyle(AplusGraph *gr_) { return gr_->enumSymbols("legendStyle"); } A q_graphYtitleStyle(AplusGraph *gr_) { return gr_->enumSymbols("ylabelStyle"); } static A g_graphXextents(AplusGraph *gr_) { return gr_->xExtents(0); } static A g_graphXXextents(AplusGraph *gr_) { return gr_->xExtents(1); } static A g_graphYextents(AplusGraph *gr_) { return gr_->yExtents(0); } static A g_graphYYextents(AplusGraph *gr_) { return gr_->yExtents(1); } static A g_graphXlabelWidth(AplusGraph *gr_,A value_) { return gr_->xLabelWidth(value_,0); } static A g_graphXXlabelWidth(AplusGraph *gr_,A value_){ return gr_->xLabelWidth(value_,1); } static A g_graphYlabelWidth(AplusGraph *gr_,A value_) { return gr_->yLabelWidth(value_,0); } static A g_graphYYlabelWidth(AplusGraph *gr_,A value_){ return gr_->yLabelWidth(value_,1); } static A g_graphXlabelHeight(AplusGraph *gr_) { return gr_->xLabelHeight(0); } static A g_graphXXlabelHeight(AplusGraph *gr_) { return gr_->xLabelHeight(1); } static A g_graphYlabelHeight(AplusGraph *gr_) { return gr_->yLabelHeight(0); } static A g_graphYYlabelHeight(AplusGraph *gr_) { return gr_->yLabelHeight(1); } void bGraphDebug(MSBoolean flag_) { MSGraph::debug(flag_==MSTrue?MSFalse:MSTrue); } static I g_graphTraceCount(AplusGraph *gr_) { return (I) gr_->traceCount(); } static void s_graphXYcoordinate(AplusGraph *gr_,A value_) { if (!QS(value_)&&(value_->t==It || value_->t==Ft)&&value_->n==2) { P p; p.i=value_->p; gr_->xCursorValue(MSBottom, value_->t==Ft?p.f[0]:(double)p.i[0]); gr_->yCursorValue(MSLeft, value_->t==Ft?p.f[1]:(double)p.i[1]); } } static A g_graphXYcoordinate(AplusGraph *gr_) { return gr_->coordinate(0);} static void s_graphXXYYcoordinate(AplusGraph *gr_, A value_) { if (!QS(value_)&&(value_->t==It || value_->t==Ft)&&value_->n==2) { P p; p.i=value_->p; gr_->xCursorValue(MSTop, value_->t==Ft?p.f[0]:(double)p.i[0]); gr_->yCursorValue(MSRight, value_->t==Ft?p.f[1]:(double)p.i[1]); } } static A g_graphXXYYcoordinate(AplusGraph *gr_) { return gr_->coordinate(1);} static void s_graphSessionPeriod(AplusGraph *gr_,A value_) { if (!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; gr_->sessionPeriod(value_->t==Ft?p.f[0]:(double)p.i[0]);} } static A g_graphSessionPeriod(AplusGraph *gr_) { A r=gf(gr_->sessionPeriod()); return r; } static void s_graphSessionOffset(AplusGraph *gr_,A value_) { if (!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; gr_->sessionOffset(value_->t==Ft?p.f[0]:(double)p.i[0]); } } static A g_graphSessionOffset(AplusGraph *gr_) { A r=gf(gr_->sessionOffset()); return r; } static void s_graphTpoPriceInc(AplusGraph *gr_,A value_) { if (!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; gr_->tpoPriceInc(value_->t==Ft?p.f[0]:(double)p.i[0]); } } static A g_graphTpoPriceInc(AplusGraph *gr_) { A r=gf(gr_->tpoPriceInc()); return r; } static void s_graphTpoPeriod(AplusGraph *gr_,A value_) { if (!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; gr_->tpoPeriod(value_->t==Ft?p.f[0]:(double)p.i[0]);} } static A g_graphTpoPeriod(AplusGraph *gr_) { A r=gf(gr_->tpoPeriod()); return r; } static void s_graphTpoOpen(AplusGraph *gr_,A value_) { if (!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; gr_->tpoOpen(value_->t==Ft?p.f[0]:(double)p.i[0]); } } static A g_graphTpoOpen(AplusGraph *gr_) { A r=gf(gr_->tpoOpen()); return r; } static void s_graphTpoClose(AplusGraph *gr_,A value_) { if (!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; gr_->tpoClose(value_->t==Ft?p.f[0]:(double)p.i[0]);} } static A g_graphTpoClose(AplusGraph *gr_) { A r=gf(gr_->tpoClose()); return r; } static void s_graphXminimum(AplusGraph *gr_,A value_) { if (isNull(value_)==MSTrue) { gr_->axisMinimum(MSGraph::Unset, MSBottom); return; } if (!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; gr_->axisMinimum(value_->t==Ft?p.f[0]:(double)p.i[0], MSBottom); } } static A g_graphXminimum(AplusGraph *gr_) { A r=gf(gr_->axisMinimum(MSBottom)); return r; } static void s_graphXXminimum(AplusGraph *gr_,A value_) { if (isNull(value_)==MSTrue) { gr_->axisMinimum(MSGraph::Unset, MSTop); return; } if (!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; gr_->axisMinimum(value_->t==Ft?p.f[0]:(double)p.i[0],MSTop); } } static A g_graphXXminimum(AplusGraph *gr_) { A r=gf(gr_->axisMinimum(MSTop)); return r; } static void s_graphXmaximum(AplusGraph *gr_,A value_) { if (isNull(value_)==MSTrue) { gr_->axisMaximum(MSGraph::Unset, MSBottom); return; } if (!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; gr_->axisMaximum(value_->t==Ft?p.f[0]:(double)p.i[0], MSBottom);} } static A g_graphXmaximum(AplusGraph *gr_) { A r=gf(gr_->axisMaximum(MSBottom)); return r; } static void s_graphXXmaximum(AplusGraph *gr_,A value_) { if (isNull(value_)==MSTrue) { gr_->axisMaximum(MSGraph::Unset, MSTop); return; } if (!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; gr_->axisMaximum(value_->t==Ft?p.f[0]:(double)p.i[0],MSTop);} } static A g_graphXXmaximum(AplusGraph *gr_) {A r=gf(gr_->axisMaximum(MSTop)); return r;} static void s_graphYminimum(AplusGraph *gr_,A value_) { if (isNull(value_)==MSTrue) { gr_->axisMinimum(MSGraph::Unset, MSLeft); return; } if (!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; gr_->axisMinimum(value_->t==Ft?p.f[0]:(double)p.i[0], MSLeft);} } static A g_graphYminimum(AplusGraph *gr_) { A r=gf(gr_->axisMinimum(MSLeft)); return r; } static void s_graphYYminimum(AplusGraph *gr_,A value_) { if (isNull(value_)==MSTrue) { gr_->axisMinimum(MSGraph::Unset, MSRight); return; } if (!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; gr_->axisMinimum(value_->t==Ft?p.f[0]:(double)p.i[0],MSRight); } } static A g_graphYYminimum(AplusGraph *gr_) { A r=gf(gr_->axisMinimum(MSRight)); return r;} static void s_graphYmaximum(AplusGraph *gr_,A value_) { if (isNull(value_)==MSTrue) { gr_->axisMaximum(MSGraph::Unset, MSLeft); return; } if (!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; gr_->axisMaximum(value_->t==Ft?p.f[0]:(double)p.i[0], MSLeft);} } static A g_graphYmaximum(AplusGraph *gr_) { A r=gf(gr_->axisMaximum(MSLeft)); return r; } static void s_graphYYmaximum(AplusGraph *gr_,A value_) { if (isNull(value_)==MSTrue) { gr_->axisMaximum(MSGraph::Unset, MSRight); return; } if (!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; gr_->axisMaximum(value_->t==Ft?p.f[0]:(double)p.i[0], MSRight); } } static A g_graphYYmaximum(AplusGraph *gr_) {A r=gf(gr_->axisMaximum(MSRight)); return r;} static void s_graphXincrement(AplusGraph *gr_,A value_) { if (!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; gr_->axisLabelIncrement(value_->t==Ft?p.f[0]:(double)p.i[0], MSBottom); } } static A g_graphXincrement(AplusGraph *gr_){A r=gf(gr_->axisLabelIncrement(MSBottom)); return r;} static void s_graphXXincrement(AplusGraph *gr_,A value_) { if (!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; gr_->axisLabelIncrement(value_->t==Ft?p.f[0]:(double)p.i[0],MSTop); } } static A g_graphXXincrement(AplusGraph *gr_) { A r=gf(gr_->axisLabelIncrement(MSTop)); return r; } static void s_graphYincrement(AplusGraph *gr_,A value_) { if (!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; gr_->axisLabelIncrement(value_->t==Ft?p.f[0]:(double)p.i[0], MSLeft); } } static A g_graphYincrement(AplusGraph *gr_) { A r=gf(gr_->axisLabelIncrement(MSLeft)); return r; } static void s_graphYYincrement(AplusGraph *gr_,A value_) { if (!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; gr_->axisLabelIncrement(value_->t==Ft?p.f[0]:(double)p.i[0],MSRight); } } static A g_graphYYincrement(AplusGraph *gr_) { A r=gf(gr_->axisLabelIncrement(MSRight)); return r; } static void s_graphMode(AplusGraph *gr_,A mode_) { gr_->graphAMode(mode_); } static A g_graphMode(AplusGraph *gr_) { return (A) gr_->graphAMode(); } static void s_graphUIMode(AplusGraph *gr_,A mode_) { gr_->graphAUIMode(mode_); } static A g_graphUIMode(AplusGraph *gr_) { return (A) gr_->graphAUIMode(); } static void s_graphStyle(MSWidgetView *pWidget_,A value_) { AplusReportStyleConverter converter; unsigned long style = converter(value_); if (style!=converter.enumNotFound()) { ((AplusGraph *)pWidget_)->style(style); } } static A g_graphStyle(MSWidgetView *pWidget_) { AplusReportStyleConverter converter; return converter(((AplusGraph *)pWidget_)->style()); } static void s_graphAxis(AplusGraph *gr_,A style_) { gr_->axisAMode(style_); } static A g_graphAxis(AplusGraph *gr_) { return (A) gr_->axisAMode(); } static void s_graphYmode(AplusGraph *gr_,A style_) { gr_->yAMode(style_,MSLeft); } static A g_graphYmode(AplusGraph *gr_) { return (A) gr_->yAMode(MSLeft); } static void s_graphYYmode(AplusGraph *gr_,A style_) { gr_->yAMode(style_,MSRight); } static A g_graphYYmode(AplusGraph *gr_) { return (A) gr_->yAMode(MSRight); } static void s_graphRule(AplusGraph *gr_,A style_) { gr_->axisARule(style_); } static A g_graphRule(AplusGraph *gr_) { return (A) gr_->axisARule(); } static void s_graphGrid(AplusGraph *gr_,A style_) { gr_->gridA(style_); } static A g_graphGrid(AplusGraph *gr_) { return (A) gr_->gridA(); } static void s_graphGridStyle(AplusGraph *gr_,A style_) { gr_->gridAStyle(style_); } static A g_graphGridStyle(AplusGraph *gr_) { return (A) gr_->gridAStyle(); } static void s_graphZero(AplusGraph *gr_,A style_) { gr_->zeroA(style_); } static A g_graphZero(AplusGraph *gr_) { return (A) gr_->zeroA(); } static void s_graphZeroStyle(AplusGraph *gr_,A style_) { gr_->zeroAStyle(style_); } static A g_graphZeroStyle(AplusGraph *gr_) { return (A) gr_->zeroAStyle(); } static void s_graphScreenLeftMargin(AplusGraph *gr_,A value_) { if (!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; gr_->margin(value_->t==Ft?p.f[0]:(double)p.i[0],MSLeft); } } static A g_graphScreenLeftMargin(const AplusGraph *gr_) { A r=gf(gr_->margin(MSLeft)); return r; } static void s_graphScreenRightMargin(AplusGraph *gr_,A value_) { if (!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; gr_->margin(value_->t==Ft?p.f[0]:(double)p.i[0],MSRight); } } static A g_graphScreenRightMargin(const AplusGraph *gr_) { A r=gf(gr_->margin(MSRight)); return r; } static void s_graphScreenTopMargin(AplusGraph *gr_,A value_) { if (!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; gr_->margin(value_->t==Ft?p.f[0]:(double)p.i[0],MSTop); } } static A g_graphScreenTopMargin(const AplusGraph *gr_) { A r=gf(gr_->margin(MSTop)); return r; } static void s_graphScreenBottomMargin(AplusGraph *gr_,A value_) { if (!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; gr_->margin(value_->t==Ft?p.f[0]:(double)p.i[0],MSBottom); } } static A g_graphScreenBottomMargin(const AplusGraph *gr_) {A r=gf(gr_->margin(MSBottom)); return r;} static void s_graphXleftMargin(AplusGraph *gr_,A value_) { if (!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; gr_->bottomAxisDataMargin(value_->t==Ft?p.f[0]:(double)p.i[0], MSLeft); } } static A g_graphXleftMargin(AplusGraph *gr_) {A r=gf(gr_->bottomAxisDataMargin(MSLeft));return r;} static void s_graphXrightMargin(AplusGraph *gr_,A value_) { if (!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; gr_->bottomAxisDataMargin(value_->t==Ft?p.f[0]:(double)p.i[0], MSRight); } } static A g_graphXrightMargin(AplusGraph *gr_){A r=gf(gr_->bottomAxisDataMargin(MSRight));return r;} static void s_graphXXleftMargin(AplusGraph *gr_,A value_) { if (!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; gr_->topAxisDataMargin(value_->t==Ft?p.f[0]:(double)p.i[0], MSLeft); } } static A g_graphXXleftMargin(AplusGraph *gr_){A r=gf(gr_->topAxisDataMargin(MSLeft));return r;} static void s_graphXXrightMargin(AplusGraph *gr_,A value_) { if (!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; gr_->topAxisDataMargin(value_->t==Ft?p.f[0]:(double)p.i[0], MSRight); } } static A g_graphXXrightMargin(AplusGraph *gr_) { A r=gf(gr_->topAxisDataMargin(MSRight)); return r; } static void s_graphYtopMargin(AplusGraph *gr_,A value_) { if (!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; gr_->leftAxisDataMargin(value_->t==Ft?p.f[0]:(double)p.i[0],MSTop); } } static A g_graphYtopMargin(AplusGraph *gr_){A r=gf(gr_->leftAxisDataMargin(MSTop)); return r;} static void s_graphYbottomMargin(AplusGraph *gr_,A value_) { if (!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; gr_->leftAxisDataMargin(value_->t==Ft?p.f[0]:(double)p.i[0],MSBottom); } } static A g_graphYbottomMargin(AplusGraph *gr_) {A r=gf(gr_->leftAxisDataMargin(MSBottom));return r; } static void s_graphYYtopMargin(AplusGraph *gr_,A value_) { if (!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; gr_->rightAxisDataMargin(value_->t==Ft?p.f[0]:(double)p.i[0],MSTop); } } static A g_graphYYtopMargin(AplusGraph *gr_) {A r=gf(gr_->rightAxisDataMargin(MSTop));return r;} static void s_graphYYbottomMargin(AplusGraph *gr_,A value_) { if (!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; gr_->rightAxisDataMargin(value_->t==Ft?p.f[0]:(double)p.i[0],MSBottom); } } static A g_graphYYbottomMargin(AplusGraph *gr_) { A r=gf(gr_->rightAxisDataMargin(MSBottom)); return r; } static void s_graphLegendHlThickness(AplusGraph *gr_,int width_) { gr_->legendHighlightThickness(width_); } static I g_graphLegendHlThickness(AplusGraph *gr_) { return (I) gr_->legendHighlightThickness(); } static void s_graphLegendShadowThickness(AplusGraph *gr_,int width_) { gr_->legendShadowThickness(width_); } static I g_graphLegendShadowThickness(AplusGraph *gr_) { return (I) gr_->legendShadowThickness(); } static void s_graphLegendBg(AplusGraph *gr_,unsigned long color_) { gr_->legendBackground(color_); } static unsigned long g_graphLegendBg(AplusGraph *gr_) { return (unsigned long) gr_->legendBackground(); } static void s_graphLegendFg(AplusGraph *gr_,unsigned long color_) { gr_->legendForeground(color_); } static unsigned long g_graphLegendFg(AplusGraph *gr_) { return (unsigned long) gr_->legendForeground(); } static void s_graphLegendPosition(MSWidgetView *pWidget_, A value_) { AplusGraph::LegendAlignConverter converter; unsigned long align = converter(value_); if (align!=converter.enumNotFound()) { AplusGraph *pGraph = (AplusGraph *)pWidget_; pGraph->xLegendPosition(0); // flush the precise position settings first pGraph->yLegendPosition(0); ((AplusGraph *)pWidget_)->legendAlignment(align); } } static A g_graphLegendPosition(MSWidgetView *pWidget_) { AplusGraph::LegendAlignConverter converter; return converter(((AplusGraph *)pWidget_)->legendAlignment()); } static void s_graphLegendStyle(AplusGraph *gr_,A style_){gr_->legendAStyle(style_);} static A g_graphLegendStyle(AplusGraph *gr_) { return (A) gr_->legendAStyle(); } static void s_graphLegendFont(AplusGraph *gr_,Font font_) { gr_->legendFont(font_); } static Font g_graphLegendFont(AplusGraph *gr_) { return (Font) gr_->legendFont(); } static void s_graphYtitleStyle(AplusGraph *gr_,A style_) { gr_->yTitleAStyle(style_,MSLeft); } static A g_graphYtitleStyle(AplusGraph *gr_) {return (A) gr_->yTitleAStyle(MSLeft);} static void s_graphYYtitleStyle(AplusGraph *gr_,A style_) { gr_->yTitleAStyle(style_,MSRight); } static A g_graphYYtitleStyle(AplusGraph *gr_){return (A) gr_->yTitleAStyle(MSRight);} static void s_graphXlegend(AplusGraph *gr_,A value_) { if (!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; gr_->xLegendPosition(value_->t==Ft?p.f[0]:(double)p.i[0]); } } static A g_graphXlegend(AplusGraph *gr_) { A r=gf(gr_->xLegendPosition()); return r; } static void s_graphYlegend(AplusGraph *gr_,A value_) { if (!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; gr_->yLegendPosition(value_->t==Ft?p.f[0]:(double)p.i[0]); } } static A g_graphYlegend(AplusGraph *gr_) { A r=gf(gr_->yLegendPosition()); return r; } static void s_graphTitleAlign(AplusGraph *gr_,A just_) { gr_->titleAlignment(GUIEnum.alignFormat(just_)); } static A g_graphTitleAlign(AplusGraph *gr_) { return GUIEnum.alignFormat(gr_->titleAlignment()); } static void s_graphSubtitle(AplusGraph *gr_,A title_) { gr_->subTitleA(title_); } static A g_graphSubtitle(AplusGraph *gr_) { A ap=gr_->subTitleA(); return(QA(ap)&&isNull(ap)==MSFalse)?(A)ic(ap):ap; } static void s_graphSubtitleColor(AplusGraph *gr_,unsigned long color_) { gr_->subtitleForeground(color_); } static unsigned long g_graphSubtitleColor(AplusGraph *gr_) { return (unsigned long) gr_->subtitleForeground(); } static void s_graphSubtitleFont(AplusGraph *gr_,Font id_) {gr_->subtitleFont(id_);} static Font g_graphSubtitleFont(AplusGraph *gr_){return(Font)gr_->subtitleFont(); } static void s_graphSubtitleAlign(AplusGraph *gr_, A just_){ gr_->subtitleAlignment((MSAlignment)GUIEnum.alignFormat(just_));} static A g_graphSubtitleAlign(AplusGraph *gr_) { return GUIEnum.alignFormat(gr_->subtitleAlignment()); } static void s_graphFootnote(AplusGraph *gr_,A title_) { gr_->footnoteA(title_); } static A g_graphFootnote(AplusGraph *gr_) { A ap=gr_->footnoteA(); return(QA(ap)&&isNull(ap)==MSFalse)?(A)ic(ap):ap; } static void s_graphFootnoteColor(AplusGraph *gr_,unsigned long color_) { gr_->footnoteForeground(color_); } static unsigned long g_graphFootnoteColor(AplusGraph *gr_) { return (unsigned long) gr_->footnoteForeground(); } static void s_graphFootnoteFont(AplusGraph *gr_,Font id_) {gr_->footnoteFont(id_);} static Font g_graphFootnoteFont(AplusGraph *gr_) {return(Font)gr_->footnoteFont();} static void s_graphFootnoteAlign(AplusGraph *gr_, A just_) { gr_->footnoteAlignment((MSAlignment)GUIEnum.alignFormat(just_));} static A g_graphFootnoteAlign(AplusGraph *gr_) { return GUIEnum.alignFormat(gr_->footnoteAlignment());} static void s_graphXsubLabelAlign(AplusGraph *gr_, A just_) { gr_->axisSubLabelAlignment((MSAlignment)GUIEnum.alignFormat(just_), MSBottom);} static A g_graphXsubLabelAlign(AplusGraph *gr_) { return GUIEnum.alignFormat(gr_->axisSubLabelAlignment(MSBottom)); } static void s_graphXXsubLabelAlign(AplusGraph *gr_, A just_) { gr_->axisSubLabelAlignment((MSAlignment)GUIEnum.alignFormat(just_), MSTop);} static A g_graphXXsubLabelAlign(AplusGraph *gr_) { return GUIEnum.alignFormat(gr_->axisSubLabelAlignment(MSTop)); } static void s_graphXlabelAlign(AplusGraph *gr_, A just_) { gr_->axisLabelAlignment((MSAlignment)GUIEnum.alignFormat(just_), MSBottom);} static A g_graphXlabelAlign(AplusGraph *gr_) { return GUIEnum.alignFormat(gr_->axisLabelAlignment(MSBottom)); } static void s_graphXXlabelAlign(AplusGraph *gr_, A just_) { gr_->axisLabelAlignment((MSAlignment)GUIEnum.alignFormat(just_), MSTop);} static A g_graphXXlabelAlign(AplusGraph *gr_) { return GUIEnum.alignFormat(gr_->axisLabelAlignment(MSTop)); } static void s_graphYlabelAlign(AplusGraph *gr_, A just_) { gr_->axisLabelAlignment((MSAlignment)GUIEnum.alignFormat(just_), MSLeft);} static A g_graphYlabelAlign(AplusGraph *gr_) { return GUIEnum.alignFormat(gr_->axisLabelAlignment(MSLeft)); } static void s_graphYYlabelAlign(AplusGraph *gr_, A just_) { gr_->axisLabelAlignment((MSAlignment)GUIEnum.alignFormat(just_), MSRight);} static A g_graphYYlabelAlign(AplusGraph *gr_) { return GUIEnum.alignFormat(gr_->axisLabelAlignment(MSRight)); } static void s_graphXtitle(AplusGraph *gr_,char *title_) { gr_->axisTitle(title_, MSBottom); } static const char *g_graphXtitle(AplusGraph *gr_) { return gr_->axisTitle(MSBottom).asString(); } static void s_graphXXtitle(AplusGraph *gr_,char *title_) {gr_->axisTitle(title_,MSTop); } static const char *g_graphXXtitle(AplusGraph *gr_) { return gr_->axisTitle(MSTop).asString(); } static void s_graphYtitle(AplusGraph *gr_,char *title_) { gr_->axisTitle(title_, MSLeft); } static const char *g_graphYtitle(AplusGraph *gr_) { return gr_->axisTitle(MSLeft).asString(); } static void s_graphYYtitle(AplusGraph *gr_,char *title_) { gr_->axisTitle(title_,MSRight); } static const char *g_graphYYtitle(AplusGraph *gr_) { return gr_->axisTitle(MSRight).asString(); } static void s_graphXtitleColor(AplusGraph *gr_,unsigned long color_) { gr_->axisTitleForeground(color_, MSBottom); } static unsigned long g_graphXtitleColor(AplusGraph *gr_) { return (unsigned long) gr_->axisTitleForeground(MSBottom); } static void s_graphXXtitleColor(AplusGraph *gr_,unsigned long color_) { gr_->axisTitleForeground(color_,MSTop); } static unsigned long g_graphXXtitleColor(AplusGraph *gr_) { return (unsigned long) gr_->axisTitleForeground(MSTop); } static void s_graphYtitleColor(AplusGraph *gr_,unsigned long color_) { gr_->axisTitleForeground(color_, MSLeft); } static unsigned long g_graphYtitleColor(AplusGraph *gr_) { return (unsigned long) gr_->axisTitleForeground(MSLeft); } static void s_graphYYtitleColor(AplusGraph *gr_,unsigned long color_) { gr_->axisTitleForeground(color_,MSRight); } static unsigned long g_graphYYtitleColor(AplusGraph *gr_) { return (unsigned long) gr_->axisTitleForeground(MSRight); } static void s_graphXtitleFont(AplusGraph *gr_,Font id_) { gr_->axisTitleFont(id_, MSBottom); } static Font g_graphXtitleFont(AplusGraph *gr_) {return (Font) gr_->axisTitleFont(MSBottom); } static void s_graphXXtitleFont(AplusGraph *gr_,Font id_) {gr_->axisTitleFont(id_,MSTop);} static Font g_graphXXtitleFont(AplusGraph *gr_){return(Font)gr_->axisTitleFont(MSTop); } static void s_graphYtitleFont(AplusGraph *gr_,Font id_) { gr_->axisTitleFont(id_, MSLeft); } static Font g_graphYtitleFont(AplusGraph *gr_) {return(Font)gr_->axisTitleFont(MSLeft); } static void s_graphYYtitleFont(AplusGraph *gr_,Font id_) { gr_->axisTitleFont(id_,MSRight);} static Font g_graphYYtitleFont(AplusGraph *gr_) {return(Font)gr_->axisTitleFont(MSRight);} static void s_graphXtitleAlign(AplusGraph *gr_, A just_) { gr_->axisTitleAlignment((MSAlignment)GUIEnum.alignFormat(just_),MSBottom); } static A g_graphXtitleAlign(AplusGraph *gr_) { return GUIEnum.alignFormat(gr_->axisTitleAlignment(MSBottom)); } static void s_graphXXtitleAlign(AplusGraph *gr_, A just_) { gr_->axisTitleAlignment((MSAlignment)GUIEnum.alignFormat(just_),MSTop); } static A g_graphXXtitleAlign(AplusGraph *gr_) { return GUIEnum.alignFormat(gr_->axisTitleAlignment(MSTop)); } static void s_graphYtitleAlign(AplusGraph *gr_, A just_) { unsigned long oldAlign = gr_->axisTitleAlignment(MSLeft); unsigned long newAlign = GUIEnum.alignFormat(just_); if (MSG::Vertical & oldAlign) newAlign|=MSG::Vertical; // Need to preserver the style bits else newAlign|=MSG::Horizontal; gr_->axisTitleAlignment(newAlign,MSLeft); } static A g_graphYtitleAlign(AplusGraph *gr_) { return GUIEnum.alignFormat(gr_->axisTitleAlignment(MSLeft)); } static void s_graphYYtitleAlign(AplusGraph *gr_, A just_) { unsigned long oldAlign = gr_->axisTitleAlignment(MSRight); unsigned long newAlign = GUIEnum.alignFormat(just_); if (MSG::Vertical & oldAlign) newAlign|=MSG::Vertical; // Need to preserver the style bits else newAlign|=MSG::Horizontal; gr_->axisTitleAlignment(newAlign,MSRight); } static A g_graphYYtitleAlign(AplusGraph *gr_) { return GUIEnum.alignFormat(gr_->axisTitleAlignment(MSRight)); } static void s_graphXcolor(AplusGraph *gr_,unsigned long color_) { gr_->axisForeground(color_, MSBottom); } static unsigned long g_graphXcolor(AplusGraph *gr_) { return (unsigned long) gr_->axisForeground(MSBottom); } static void s_graphXXcolor(AplusGraph *gr_,unsigned long color_) {gr_->axisForeground(color_,MSTop); } static unsigned long g_graphXXcolor(AplusGraph *gr_) { return (unsigned long) gr_->axisForeground(MSTop); } static void s_graphYcolor(AplusGraph *gr_,unsigned long color_) { gr_->axisForeground(color_, MSLeft); } static unsigned long g_graphYcolor(AplusGraph *gr_) { return (unsigned long) gr_->axisForeground(MSLeft); } static void s_graphYYcolor(AplusGraph *gr_,unsigned long color_) { gr_->axisForeground(color_,MSRight); } static unsigned long g_graphYYcolor(AplusGraph *gr_) { return (unsigned long) gr_->axisForeground(MSRight); } static void s_graphXlabelFont(AplusGraph *gr_,Font id_) { gr_->axisLabelFont(id_, MSBottom); } static Font g_graphXlabelFont(AplusGraph *gr_) {return (Font) gr_->axisLabelFont(MSBottom); } static void s_graphXXlabelFont(AplusGraph *gr_,Font id_) {gr_->axisLabelFont(id_,MSTop);} static Font g_graphXXlabelFont(AplusGraph *gr_) {return(Font)gr_->axisLabelFont(MSTop);} static void s_graphYlabelFont(AplusGraph *gr_,Font id_) { gr_->axisLabelFont(id_, MSLeft); } static Font g_graphYlabelFont(AplusGraph *gr_) {return (Font) gr_->axisLabelFont(MSLeft); } static void s_graphYYlabelFont(AplusGraph *gr_,Font id_) {gr_->axisLabelFont(id_,MSRight);} static Font g_graphYYlabelFont(AplusGraph *gr_) {return(Font)gr_->axisLabelFont(MSRight); } static void s_graphRuleWidth(AplusGraph *gr_,int value_) {gr_->axisRuleWidth(value_); } static I g_graphRuleWidth(AplusGraph *gr_) { return (I) gr_->axisRuleWidth(); } static void s_graphGridWidth(AplusGraph *gr_,int value_) {gr_->gridWidth(value_); } static I g_graphGridWidth(AplusGraph *gr_) { return (I) gr_->gridWidth(); } static void s_graphGridColor(AplusGraph *gr_,unsigned long color_) { gr_->gridForeground(color_); } static unsigned long g_graphGridColor(AplusGraph *gr_) { return (unsigned long) gr_->gridForeground(); } static void s_graphZeroWidth(AplusGraph *gr_,int value_) {gr_->zeroAxisWidth(value_);} static I g_graphZeroWidth(AplusGraph *gr_) { return (I) gr_->zeroAxisWidth(); } static void s_graphZeroColor(AplusGraph *gr_,unsigned long color_) { gr_->zeroAxisForeground(color_); } static unsigned long g_graphZeroColor(AplusGraph *gr_) { return (unsigned long) gr_->zeroAxisForeground(); } static void s_graphXtickStyle(AplusGraph *gr_,A position_) { gr_->tickStyleA(position_, MSBottom); } static A g_graphXtickStyle(AplusGraph *gr_) { return (A) gr_->tickStyleA(MSBottom); } static void s_graphXXtickStyle(AplusGraph *gr_,A position_) { gr_->tickStyleA(position_,MSTop); } static A g_graphXXtickStyle(AplusGraph *gr_) { return (A) gr_->tickStyleA(MSTop); } static void s_graphYtickStyle(AplusGraph *gr_,A position_) { gr_->tickStyleA(position_, MSLeft); } static A g_graphYtickStyle(AplusGraph *gr_) { return (A) gr_->tickStyleA(MSLeft); } static void s_graphYYtickStyle(AplusGraph *gr_,A position_) { gr_->tickStyleA(position_,MSRight); } static A g_graphYYtickStyle(AplusGraph *gr_) { return (A) gr_->tickStyleA(MSRight); } static void s_graphXminorTicks(AplusGraph *gr_,int value_) { gr_->minorTicks(value_,MSBottom); } static I g_graphXminorTicks(AplusGraph *gr_) { return (I) gr_->minorTicks(MSBottom);} static void s_graphXXminorTicks(AplusGraph *gr_,int value_) { gr_->minorTicks(value_,MSTop); } static I g_graphXXminorTicks(AplusGraph *gr_) { return(I)gr_->minorTicks(MSTop);} static void s_graphYminorTicks(AplusGraph *gr_,int value_) { gr_->minorTicks(value_,MSLeft); } static I g_graphYminorTicks(AplusGraph *gr_) { return (I) gr_->minorTicks(MSLeft);} static void s_graphYYminorTicks(AplusGraph *gr_,int value_) { gr_->minorTicks(value_,MSRight); } static I g_graphYYminorTicks(AplusGraph *gr_) { return(I)gr_->minorTicks(MSRight);} static void s_graphXmajorTickSize(AplusGraph *gr_,int val_) { gr_->majorTickSize(val_,MSBottom); } static I g_graphXmajorTickSize(AplusGraph *gr_) { return(I)gr_->majorTickSize(MSBottom); } static void s_graphXXmajorTickSize(AplusGraph *gr_,int val_) { gr_->majorTickSize(val_,MSTop); } static I g_graphXXmajorTickSize(AplusGraph *gr_) { return (I) gr_->majorTickSize(MSTop); } static void s_graphYmajorTickSize(AplusGraph *gr_,int val_) { gr_->majorTickSize(val_,MSLeft); } static I g_graphYmajorTickSize(AplusGraph *gr_) { return (I) gr_->majorTickSize(MSLeft); } static void s_graphYYmajorTickSize(AplusGraph *gr_,int val_) { gr_->majorTickSize(val_,MSRight); } static I g_graphYYmajorTickSize(AplusGraph *gr_) { return (I) gr_->majorTickSize(MSRight); } static void s_graphXminorTickSize(AplusGraph *gr_,int val_) { gr_->minorTickSize(val_,MSBottom); } static I g_graphXminorTickSize(AplusGraph *gr_) { return (I) gr_->minorTickSize(MSBottom); } static void s_graphXXminorTickSize(AplusGraph *gr_,int val_) { gr_->minorTickSize(val_,MSTop); } static I g_graphXXminorTickSize(AplusGraph *gr_) { return (I) gr_->minorTickSize(MSTop); } static void s_graphYminorTickSize(AplusGraph *gr_,int val_) { gr_->minorTickSize(val_,MSLeft); } static I g_graphYminorTickSize(AplusGraph *gr_) { return (I) gr_->minorTickSize(MSLeft); } static void s_graphYYminorTickSize(AplusGraph *gr_,int val_) { gr_->minorTickSize(val_,MSRight); } static I g_graphYYminorTickSize(AplusGraph *gr_) { return (I) gr_->minorTickSize(MSRight); } static void s_graphBarWidth(AplusGraph *gr_,int value_) {gr_->maxBarWidth(value_);} static I g_graphBarWidth(AplusGraph *gr_) { return (I) gr_->maxBarWidth(); } static void s_graphDepth(AplusGraph *gr_,int value_) { gr_->graphDepth(value_); } static I g_graphDepth(AplusGraph *gr_) { return (I) gr_->graphDepth(); } static void s_longPressTime(AplusGraph *gr_,int value_) { gr_->longPressTime(value_); } static long g_longPressTime(AplusGraph *gr_) { return gr_->longPressTime(); } static void s_graphSelectDistance(AplusGraph *gr_,unsigned long value_) { gr_->selectDistance(value_); } static unsigned long g_graphSelectDistance(AplusGraph *gr_) { return (unsigned long) gr_->selectDistance(); } MSWidgetCommon *g_graphSelected(AplusGraph *gr_) { if (gr_->selectTrace()!=0) { AplusTrace *atp = (AplusTrace *) gr_->selectTrace(); AVariableData *varData = pAVarDataFromV(atp->aplusVar()); return (MSWidgetCommon *)varData->pWidgetView(); } else return 0; } static void s_graphPieOffsetMargin(AplusGraph *pGraph_, A value_) { if (QS(value_)==0) { if (value_->t==Ft) { pGraph_->pieOffsetMargin(*(double*)value_->p); } else if (value_->t==It) { pGraph_->pieOffsetMargin((double)*(I*)value_->p); } } } static A g_graphPieOffsetMargin(AplusGraph *pGraph_) { return gf(pGraph_->pieOffsetMargin()); } // Reporting attributes static void s_graphLeftMargin(MSWidgetView *pWidget_, A value_) { if (!QS(value_)) { AplusGraph *pGraph = (AplusGraph *)pWidget_; if (value_->t==Ft) // if it's a floating point value { pGraph->leftMargin(*(double*)value_->p); } else if (value_->t==It) // it's an integer { pGraph->leftMargin((double)*(I*)value_->p); } } } static A g_graphLeftMargin(MSWidgetView *pWidget_) { // A fix for a small MStk problem - to be fixed in MStk for release 2.6: // margins in inches are calculated based on the corresponding pixel offset values; // the default pixel offset is -1 (meaning that it's inherited from the report's pixel offset); // thus, the default margin is -0.0139, which is confusing to the user - it should also be -1. double margin = ((const AplusGraph *)pWidget_)->leftMargin(); return gf((margin<0)?-1:margin); } static void s_graphRightMargin(MSWidgetView *pWidget_, A value_) { if (!QS(value_)) { AplusGraph *pGraph = (AplusGraph *)pWidget_; if (value_->t==Ft) // if it's a floating point value { pGraph->rightMargin(*(double*)value_->p); } else if (value_->t==It) // it's an integer { pGraph->rightMargin((double)*(I*)value_->p); } } } static A g_graphRightMargin(MSWidgetView *pWidget_) { // A fix for a small MStk problem - to be fixed in MStk for release 2.6: // margins in inches are calculated based on the corresponding pixel offset values; // the default pixel offset is -1 (meaning that it's inherited from the report's pixel offset); // thus, the default margin is -0.0139, which is confusing to the user - it should also be -1. double margin = ((const AplusGraph *)pWidget_)->rightMargin(); return gf((margin<0)?-1:margin); } static void s_graphTopOffset(MSWidgetView *pWidget_, A value_) { if (!QS(value_)) { AplusGraph *pGraph = (AplusGraph *)pWidget_; if (value_->t==Ft) // if it's a floating point value { pGraph->topOffset(*(double*)value_->p); } else if (value_->t==It) // it's an integer { pGraph->topOffset((double)*(I*)value_->p); } } } static A g_graphTopOffset(MSWidgetView *pWidget_) { // A fix for an MStk bug to be fixed in MStk 2.6: // MSPrintItem::topOffset() and MSPrintItem::bottomOffset() methods do the cast to double incorrectly // so the decimal part gets truncated double offset = ((AplusGraph *)pWidget_)->topPixel(); return gf(offset/MSPointsPerInch); } static void s_graphBottomOffset(MSWidgetView *pWidget_, A value_) { if (!QS(value_)) { AplusGraph *pGraph = (AplusGraph *)pWidget_; if (value_->t==Ft) // if it's a floating point value { pGraph->bottomOffset(*(double*)value_->p); } else if (value_->t==It) // it's an integer { pGraph->bottomOffset((double)*(I*)value_->p); } } } static A g_graphBottomOffset(MSWidgetView *pWidget_) { // A fix for an MStk bug to be fixed in MStk 2.6: // MSPrintItem::topOffset() and MSPrintItem::bottomOffset() methods do the cast to double incorrectly // so the decimal part gets truncated double offset = ((AplusGraph *)pWidget_)->bottomPixel(); return gf(offset/MSPointsPerInch); } static void s_graphPrintRow(MSWidgetView *pWidget_, int value_) { ((AplusGraph *)pWidget_)->printRow(value_); } static I g_graphPrintRow(MSWidgetView *pWidget_) { return (I) ((AplusGraph *)pWidget_)->printRow(); } static void s_graphPrintColumn(MSWidgetView *pWidget_, int value_) { ((AplusGraph *)pWidget_)->printColumn(value_); } static I g_graphPrintColumn(MSWidgetView *pWidget_) { return (I) ((AplusGraph *)pWidget_)->printColumn(); } static void s_graphJustify(MSWidgetView *pWidget_, A value_) { AplusAlignmentConverter converter; unsigned long justify = converter(value_); if (justify!=converter.enumNotFound()) { ((AplusGraph *)pWidget_)->justification(justify); } } static A g_graphJustify(MSWidgetView *pWidget_) { AplusAlignmentConverter converter; return converter(((AplusGraph *)pWidget_)->justification()); } static void s_graphPageAlign(MSWidgetView *pWidget_, A value_) { AplusAlignmentConverter converter; unsigned long align = converter(value_); if (align!=converter.enumNotFound()) { ((AplusGraph *)pWidget_)->pageAlignment(align); } } static A g_graphPageAlign(MSWidgetView *pWidget_) { AplusAlignmentConverter converter; return converter(((AplusGraph *)pWidget_)->pageAlignment()); } extern MSWidgetView *validateParent(MSWidgetView *parent_); MSWidgetView *c_AXGraph(MSWidgetView *parent_) { return (MSWidgetView *) new AplusGraph(validateParent(parent_)); } MSWidgetView *c_AXTrace(MSWidgetView *parent_) // This Function shouldn't get called { return (MSWidgetView *) new AplusTraceSet((MSGraph *)validateParent(parent_)); } void AGIFGraphInstall(void) { CX context=Cx; Cx=cx("s"); install((PFI)c_AXGraph,"c_AXGraph",IV,1,IV,0,0,0,0,0,0,0); install((PFI)c_AXTrace,"c_AXTrace",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_traceLineStyleFunc,"s_traceLineStyleFunc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_traceLineStyleFunc,"g_traceLineStyleFunc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_traceLineWidthFunc,"s_traceLineWidthFunc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_traceLineWidthFunc,"g_traceLineWidthFunc",A_,1,IV,0,0,0,0,0,0,0); // install((PFI)s_tracePieOffsetFunc,"s_tracePieOffsetFunc",V_,2,IV,A_,0,0,0,0,0,0); // install((PFI)g_tracePieOffsetFunc,"g_tracePieOffsetFunc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_traceLineColorFunc,"s_traceLineColorFunc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_traceLineColorFunc,"g_traceLineColorFunc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_traceLegendFunc,"s_traceLegendFunc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_traceLegendFunc,"g_traceLegendFunc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_traceStyleFunc,"s_traceStyleFunc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_traceStyleFunc,"g_traceStyleFunc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_traceSymbolFunc,"s_traceSymbolFunc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_traceSymbolFunc,"g_traceSymbolFunc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_traceSymbolSizeFunc,"s_traceSymbolSizeFunc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_traceSymbolSizeFunc,"g_traceSymbolSizeFunc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_traceFillColorFunc,"s_traceFillColorFunc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_traceFillColorFunc,"g_traceFillColorFunc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_traceYaxisFunc,"s_traceYYaxisFunc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_traceYaxisFunc,"g_traceYYaxisFunc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_traceXaxisFunc,"s_traceXaxisFunc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_traceXaxisFunc,"g_traceXaxisFunc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_traceGradientFunc,"s_traceGradientFunc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_traceGradientFunc,"g_traceGradientFunc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)g_traceText,"g_traceText",CP,1,IV,0,0,0,0,0,0,0); install((PFI)s_traceSelected,"s_traceSelected",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_traceSelected,"g_traceSelected",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_traceCoordinate,"s_traceCoordinate",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_traceCoordinate,"g_traceCoordinate",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_traceConstraint,"s_traceConstraint",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_traceConstraint,"g_traceConstraint",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_traceSelectable,"s_traceSelectable",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_traceSelectable,"g_traceSelectable",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_tracePieAngle,"s_tracePieAngle",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_tracePieAngle,"g_tracePieAngle",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_tracePieOffsets,"s_tracePieOffsets",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_tracePieOffsets,"g_tracePieOffsets",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_tracePieAspectRatio,"s_tracePieAspectRatio",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_tracePieAspectRatio,"g_tracePieAspectRatio",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_tracePieDepthFactor,"s_tracePieDepthFactor",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_tracePieDepthFactor,"g_tracePieDepthFactor",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_tracePieProfiles,"s_tracePieProfiles",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_tracePieProfiles,"g_tracePieProfiles",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_tracePieLegendAlign,"s_tracePieLegendAlign",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_tracePieLegendAlign,"g_tracePieLegendAlign",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_tracePieValueAlign,"s_tracePieValueAlign",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_tracePieValueAlign,"g_tracePieValueAlign",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_tracePiePercentAlign,"s_tracePiePercentAlign",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_tracePiePercentAlign,"g_tracePiePercentAlign",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_tracePrimarySlice,"s_tracePrimarySlice",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_tracePrimarySlice,"g_tracePrimarySlice",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_tracePrimarySliceAlign,"s_tracePrimarySliceAlign",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_tracePrimarySliceAlign,"g_tracePrimarySliceAlign",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_traceTextFont,"s_traceTextFont",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_traceTextFont,"g_traceTextFont",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_traceTextFg,"s_traceTextFg",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_traceTextFg,"g_traceTextFg",IV,1,IV,0,0,0,0,0,0,0); install((PFI)q_traceStyle,"q_traceStyle",A_,1,IV,0,0,0,0,0,0,0); install((PFI)q_traceLineStyle,"q_traceLineStyle",A_,1,IV,0,0,0,0,0,0,0); install((PFI)q_traceSymbol,"q_traceSymbol",A_,1,IV,0,0,0,0,0,0,0); install((PFI)q_traceConstraint,"q_traceConstraint",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphYlabelFormatFunc,"s_graphYlabelFormatFunc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphYlabelFormatFunc,"g_graphYlabelFormatFunc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphYYlabelFormatFunc,"s_graphYYlabelFormatFunc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphYYlabelFormatFunc,"g_graphYYlabelFormatFunc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphXsubLabelFormatFunc,"s_graphXsubLabelFormatFunc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphXsubLabelFormatFunc,"g_graphXsubLabelFormatFunc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphXXsubLabelFormatFunc,"s_graphXXsubLabelFormatFunc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphXXsubLabelFormatFunc,"g_graphXXsubLabelFormatFunc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphXlabelFormatFunc,"s_graphXlabelFormatFunc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphXlabelFormatFunc,"g_graphXlabelFormatFunc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphXXlabelFormatFunc,"s_graphXXlabelFormatFunc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphXXlabelFormatFunc,"g_graphXXlabelFormatFunc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphYlabelFunc,"s_graphYlabelFunc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphYlabelFunc,"g_graphYlabelFunc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphYYlabelFunc,"s_graphYYlabelFunc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphYYlabelFunc,"g_graphYYlabelFunc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphXlabelFunc,"s_graphXlabelFunc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphXlabelFunc,"g_graphXlabelFunc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphXXlabelFunc,"s_graphXXlabelFunc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphXXlabelFunc,"g_graphXXlabelFunc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphXsubLabelFunc,"s_graphXsubLabelFunc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphXsubLabelFunc,"g_graphXsubLabelFunc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphXXsubLabelFunc,"s_graphXXsubLabelFunc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphXXsubLabelFunc,"g_graphXXsubLabelFunc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)g_graphXlabelWidth,"g_graphXlabelWidth",A_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphXXlabelWidth,"g_graphXXlabelWidth",A_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphYlabelWidth,"g_graphYlabelWidth",A_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphYYlabelWidth,"g_graphYYlabelWidth",A_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphXlabelHeight,"g_graphXlabelHeight",A_,1,IV,0,0,0,0,0,0,0); install((PFI)g_graphXXlabelHeight,"g_graphXXlabelHeight",A_,1,IV,0,0,0,0,0,0,0); install((PFI)g_graphYlabelHeight,"g_graphYlabelHeight",A_,1,IV,0,0,0,0,0,0,0); install((PFI)g_graphYYlabelHeight,"g_graphYYlabelHeight",A_,1,IV,0,0,0,0,0,0,0); install((PFI)g_graphSelected,"g_graphSelected",IV,1,IV,0,0,0,0,0,0,0); install((PFI)q_graphMode,"q_graphMode",A_,1,IV,0,0,0,0,0,0,0); install((PFI)q_graphStyle,"q_graphStyle",A_,1,IV,0,0,0,0,0,0,0); install((PFI)q_graphAxis,"q_graphAxis",A_,1,IV,0,0,0,0,0,0,0); install((PFI)q_graphYmode,"q_graphYmode",A_,1,IV,0,0,0,0,0,0,0); install((PFI)q_graphRule,"q_graphRule",A_,1,IV,0,0,0,0,0,0,0); install((PFI)q_graphGrid,"q_graphGrid",A_,1,IV,0,0,0,0,0,0,0); install((PFI)q_graphGridStyle,"q_graphGridStyle",A_,1,IV,0,0,0,0,0,0,0); install((PFI)q_graphZero,"q_graphZero",A_,1,IV,0,0,0,0,0,0,0); install((PFI)q_graphZeroStyle,"q_graphZeroStyle",A_,1,IV,0,0,0,0,0,0,0); install((PFI)q_graphTickStyle,"q_graphTickStyle",A_,1,IV,0,0,0,0,0,0,0); install((PFI)q_graphLegendPosition,"q_graphLegendPosition",A_,1,IV,0,0,0,0,0,0,0); install((PFI)q_graphLegendStyle,"q_graphLegendStyle",A_,1,IV,0,0,0,0,0,0,0); install((PFI)q_graphYtitleStyle,"q_graphYtitleStyle",A_,1,IV,0,0,0,0,0,0,0); install((PFI)g_graphXextents,"g_graphXextents",A_,1,IV,0,0,0,0,0,0,0); install((PFI)g_graphXXextents,"g_graphXXextents",A_,1,IV,0,0,0,0,0,0,0); install((PFI)g_graphYextents,"g_graphYextents",A_,1,IV,0,0,0,0,0,0,0); install((PFI)g_graphYYextents,"g_graphYYextents",A_,1,IV,0,0,0,0,0,0,0); install((PFI)bGraphDebug,"bGraphDebug",V_,1,IV,0,0,0,0,0,0,0); install((PFI)g_graphTraceCount,"g_graphTraceCount",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphXYcoordinate,"s_graphXYcoordinate",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphXYcoordinate,"g_graphXYcoordinate",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphXYcoordinate,"s_graphCoordinate",V_,2,IV,A_,0,0,0,0,0,0); // temp install((PFI)g_graphXYcoordinate,"g_graphCoordinate",A_,1,IV,0,0,0,0,0,0,0);// temp install((PFI)s_graphXXYYcoordinate,"s_graphXXYYcoordinate",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphXXYYcoordinate,"g_graphXXYYcoordinate",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphSessionPeriod,"s_graphSessionPeriod",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphSessionPeriod,"g_graphSessionPeriod",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphSessionOffset,"s_graphSessionOffset",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphSessionOffset,"g_graphSessionOffset",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphTpoPriceInc,"s_graphTpoPriceInc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphTpoPriceInc,"g_graphTpoPriceInc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphTpoPeriod,"s_graphTpoPeriod",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphTpoPeriod,"g_graphTpoPeriod",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphTpoOpen,"s_graphTpoOpen",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphTpoOpen,"g_graphTpoOpen",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphTpoClose,"s_graphTpoClose",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphTpoClose,"g_graphTpoClose",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphXminimum,"s_graphXminimum",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphXminimum,"g_graphXminimum",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphXXminimum,"s_graphXXminimum",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphXXminimum,"g_graphXXminimum",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphXmaximum,"s_graphXmaximum",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphXmaximum,"g_graphXmaximum",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphXXmaximum,"s_graphXXmaximum",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphXXmaximum,"g_graphXXmaximum",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphYminimum,"s_graphYminimum",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphYminimum,"g_graphYminimum",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphYYminimum,"s_graphYYminimum",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphYYminimum,"g_graphYYminimum",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphYmaximum,"s_graphYmaximum",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphYmaximum,"g_graphYmaximum",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphYYmaximum,"s_graphYYmaximum",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphYYmaximum,"g_graphYYmaximum",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphXincrement,"s_graphXincrement",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphXincrement,"g_graphXincrement",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphXXincrement,"s_graphXXincrement",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphXXincrement,"g_graphXXincrement",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphYincrement,"s_graphYincrement",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphYincrement,"g_graphYincrement",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphYYincrement,"s_graphYYincrement",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphYYincrement,"g_graphYYincrement",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphRuleWidth,"s_graphRuleWidth",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphRuleWidth,"g_graphRuleWidth",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphMode,"s_graphMode",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphMode,"g_graphMode",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphUIMode,"s_graphUIMode",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphUIMode,"g_graphUIMode",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphStyle,"s_graphStyle",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphStyle,"g_graphStyle",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphAxis,"s_graphAxis",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphAxis,"g_graphAxis",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphYmode,"s_graphYmode",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphYmode,"g_graphYmode",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphYYmode,"s_graphYYmode",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphYYmode,"g_graphYYmode",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphRule,"s_graphRule",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphRule,"g_graphRule",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphGrid,"s_graphGrid",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphGrid,"g_graphGrid",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphGridWidth,"s_graphGridWidth",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphGridWidth,"g_graphGridWidth",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphGridStyle,"s_graphGridStyle",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphGridStyle,"g_graphGridStyle",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphZero,"s_graphZero",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphZero,"g_graphZero",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphZeroWidth,"s_graphZeroWidth",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphZeroWidth,"g_graphZeroWidth",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphZeroStyle,"s_graphZeroStyle",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphZeroStyle,"g_graphZeroStyle",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphScreenTopMargin,"s_graphScreenTopMargin",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphScreenTopMargin,"g_graphScreenTopMargin",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphScreenBottomMargin,"s_graphScreenBottomMargin",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphScreenBottomMargin,"g_graphScreenBottomMargin",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphScreenLeftMargin,"s_graphScreenLeftMargin",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphScreenLeftMargin,"g_graphScreenLeftMargin",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphScreenRightMargin,"s_graphScreenRightMargin",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphScreenRightMargin,"g_graphScreenRightMargin",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphXleftMargin,"s_graphXleftMargin",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphXleftMargin,"g_graphXleftMargin",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphXrightMargin,"s_graphXrightMargin",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphXrightMargin,"g_graphXrightMargin",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphXXleftMargin,"s_graphXXleftMargin",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphXXleftMargin,"g_graphXXleftMargin",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphXXrightMargin,"s_graphXXrightMargin",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphXXrightMargin,"g_graphXXrightMargin",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphYtopMargin,"s_graphYtopMargin",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphYtopMargin,"g_graphYtopMargin",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphYbottomMargin,"s_graphYbottomMargin",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphYbottomMargin,"g_graphYbottomMargin",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphYYtopMargin,"s_graphYYtopMargin",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphYYtopMargin,"g_graphYYtopMargin",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphYYbottomMargin,"s_graphYYbottomMargin",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphYYbottomMargin,"g_graphYYbottomMargin",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphLegendHlThickness,"s_graphLegendHlThickness",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphLegendHlThickness,"g_graphLegendHlThickness",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphLegendShadowThickness,"s_graphLegendShadowThickness",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphLegendShadowThickness,"g_graphLegendShadowThickness",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphLegendBg,"s_graphLegendBg",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphLegendBg,"g_graphLegendBg",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphLegendFg,"s_graphLegendFg",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphLegendFg,"g_graphLegendFg",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphLegendPosition,"s_graphLegendPosition",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphLegendPosition,"g_graphLegendPosition",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphLegendStyle,"s_graphLegendStyle",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphLegendStyle,"g_graphLegendStyle",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphLegendFont,"s_graphLegendFont",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphLegendFont,"g_graphLegendFont",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphYtitleStyle,"s_graphYtitleStyle",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphYtitleStyle,"g_graphYtitleStyle",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphYYtitleStyle,"s_graphYYtitleStyle",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphYYtitleStyle,"g_graphYYtitleStyle",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphXlegend,"s_graphXlegend",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphXlegend,"g_graphXlegend",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphYlegend,"s_graphYlegend",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphYlegend,"g_graphYlegend",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphTitleAlign,"s_graphTitleAlign",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphTitleAlign,"g_graphTitleAlign",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphSubtitle,"s_graphSubtitle",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphSubtitle,"g_graphSubtitle",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphSubtitleColor,"s_graphSubtitleColor",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphSubtitleColor,"g_graphSubtitleColor",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphSubtitleFont,"s_graphSubtitleFont",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphSubtitleFont,"g_graphSubtitleFont",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphSubtitleAlign,"s_graphSubtitleAlign",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphSubtitleAlign,"g_graphSubtitleAlign",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphFootnote,"s_graphFootnote",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphFootnote,"g_graphFootnote",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphFootnoteColor,"s_graphFootnoteColor",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphFootnoteColor,"g_graphFootnoteColor",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphFootnoteFont,"s_graphFootnoteFont",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphFootnoteFont,"g_graphFootnoteFont",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphFootnoteAlign,"s_graphFootnoteAlign",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphFootnoteAlign,"g_graphFootnoteAlign",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphXsubLabelAlign,"s_graphXsubLabelAlign",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphXsubLabelAlign,"g_graphXsubLabelAlign",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphXXsubLabelAlign,"s_graphXXsubLabelAlign",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphXXsubLabelAlign,"g_graphXXsubLabelAlign",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphXlabelAlign,"s_graphXlabelAlign",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphXlabelAlign,"g_graphXlabelAlign",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphXXlabelAlign,"s_graphXXlabelAlign",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphXXlabelAlign,"g_graphXXlabelAlign",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphYlabelAlign,"s_graphYlabelAlign",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphYlabelAlign,"g_graphYlabelAlign",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphYYlabelAlign,"s_graphYYlabelAlign",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphYYlabelAlign,"g_graphYYlabelAlign",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphXtitle,"s_graphXtitle",V_,2,IV,CP,0,0,0,0,0,0); install((PFI)g_graphXtitle,"g_graphXtitle",CP,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphXXtitle,"s_graphXXtitle",V_,2,IV,CP,0,0,0,0,0,0); install((PFI)g_graphXXtitle,"g_graphXXtitle",CP,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphYtitle,"s_graphYtitle",V_,2,IV,CP,0,0,0,0,0,0); install((PFI)g_graphYtitle,"g_graphYtitle",CP,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphYYtitle,"s_graphYYtitle",V_,2,IV,CP,0,0,0,0,0,0); install((PFI)g_graphYYtitle,"g_graphYYtitle",CP,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphXtitleColor,"s_graphXtitleColor",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphXtitleColor,"g_graphXtitleColor",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphXXtitleColor,"s_graphXXtitleColor",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphXXtitleColor,"g_graphXXtitleColor",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphYtitleColor,"s_graphYtitleColor",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphYtitleColor,"g_graphYtitleColor",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphYYtitleColor,"s_graphYYtitleColor",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphYYtitleColor,"g_graphYYtitleColor",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphXtitleFont,"s_graphXtitleFont",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphXtitleFont,"g_graphXtitleFont",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphXXtitleFont,"s_graphXXtitleFont",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphXXtitleFont,"g_graphXXtitleFont",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphYtitleFont,"s_graphYtitleFont",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphYtitleFont,"g_graphYtitleFont",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphYYtitleFont,"s_graphYYtitleFont",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphYYtitleFont,"g_graphYYtitleFont",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphXtitleAlign,"s_graphXtitleAlign",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphXtitleAlign,"g_graphXtitleAlign",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphXXtitleAlign,"s_graphXXtitleAlign",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphXXtitleAlign,"g_graphXXtitleAlign",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphYtitleAlign,"s_graphYtitleAlign",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphYtitleAlign,"g_graphYtitleAlign",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphYYtitleAlign,"s_graphYYtitleAlign",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphYYtitleAlign,"g_graphYYtitleAlign",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphXcolor,"s_graphXcolor",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphXcolor,"g_graphXcolor",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphXXcolor,"s_graphXXcolor",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphXXcolor,"g_graphXXcolor",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphYcolor,"s_graphYcolor",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphYcolor,"g_graphYcolor",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphYYcolor,"s_graphYYcolor",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphYYcolor,"g_graphYYcolor",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphXlabelFont,"s_graphXlabelFont",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphXlabelFont,"g_graphXlabelFont",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphXXlabelFont,"s_graphXXlabelFont",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphXXlabelFont,"g_graphXXlabelFont",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphYlabelFont,"s_graphYlabelFont",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphYlabelFont,"g_graphYlabelFont",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphYYlabelFont,"s_graphYYlabelFont",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphYYlabelFont,"g_graphYYlabelFont",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphGridColor,"s_graphGridColor",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphGridColor,"g_graphGridColor",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphZeroColor,"s_graphZeroColor",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphZeroColor,"g_graphZeroColor",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphXtickStyle,"s_graphXtickStyle",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphXtickStyle,"g_graphXtickStyle",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphXXtickStyle,"s_graphXXtickStyle",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphXXtickStyle,"g_graphXXtickStyle",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphYtickStyle,"s_graphYtickStyle",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphYtickStyle,"g_graphYtickStyle",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphYYtickStyle,"s_graphYYtickStyle",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphYYtickStyle,"g_graphYYtickStyle",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphXminorTicks,"s_graphXminorTicks",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphXminorTicks,"g_graphXminorTicks",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphXXminorTicks,"s_graphXXminorTicks",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphXXminorTicks,"g_graphXXminorTicks",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphYminorTicks,"s_graphYminorTicks",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphYminorTicks,"g_graphYminorTicks",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphYYminorTicks,"s_graphYYminorTicks",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphYYminorTicks,"g_graphYYminorTicks",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphXminorTickSize,"s_graphXminorTickSize",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphXminorTickSize,"g_graphXminorTickSize",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphXXminorTickSize,"s_graphXXminorTickSize",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphXXminorTickSize,"g_graphXXminorTickSize",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphYminorTickSize,"s_graphYminorTickSize",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphYminorTickSize,"g_graphYminorTickSize",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphYYminorTickSize,"s_graphYYminorTickSize",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphYYminorTickSize,"g_graphYYminorTickSize",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphXmajorTickSize,"s_graphXmajorTickSize",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphXmajorTickSize,"g_graphXmajorTickSize",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphXXmajorTickSize,"s_graphXXmajorTickSize",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphXXmajorTickSize,"g_graphXXmajorTickSize",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphYmajorTickSize,"s_graphYmajorTickSize",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphYmajorTickSize,"g_graphYmajorTickSize",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphYYmajorTickSize,"s_graphYYmajorTickSize",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphYYmajorTickSize,"g_graphYYmajorTickSize",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphBarWidth,"s_graphBarWidth",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphBarWidth,"g_graphBarWidth",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphDepth,"s_graphDepth",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphDepth,"g_graphDepth",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_longPressTime,"s_longPressTime",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_longPressTime,"g_longPressTime",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphSelectDistance,"s_graphSelectDistance",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphSelectDistance,"g_graphSelectDistance",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphPieOffsetMargin,"s_graphPieOffsetMargin",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphPieOffsetMargin,"g_graphPieOffsetMargin",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphLeftMargin,"s_graphLeftMargin",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphLeftMargin,"g_graphLeftMargin",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphRightMargin,"s_graphRightMargin",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphRightMargin,"g_graphRightMargin",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphTopOffset,"s_graphTopOffset",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphTopOffset,"g_graphTopOffset",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphBottomOffset,"s_graphBottomOffset",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphBottomOffset,"g_graphBottomOffset",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphPrintRow,"s_graphPrintRow",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphPrintRow,"g_graphPrintRow",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphPrintColumn,"s_graphPrintColumn",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_graphPrintColumn,"g_graphPrintColumn",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphJustify,"s_graphJustify",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphJustify,"g_graphJustify",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_graphPageAlign,"s_graphPageAlign",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_graphPageAlign,"g_graphPageAlign",A_,1,IV,0,0,0,0,0,0,0); Cx=context; } aplus-fsf-4.22/src/AplusGUI/AGIFmstk.C0000644000265000001440000046045410772770343012776 ////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #if HAVE_IOSTREAM #include #else #include #endif #if HAVE_NEW #include #else #include #endif #include #include #include #include #include #include #include #include #include extern const int MSPointsPerInch; extern void asTitleStringVector(MSStringVector &, A); extern AVariableData *getVarData(A); extern int AplusEvaluationDepth; static A cdipv(AClientData *ac_,A data_,A index_,A pick_,V v_) { // ++AplusEvaluationDepth; fix in mstk if(AScbTraceHook::function()) { AScbTraceHook::run(ac_->function(),(I)ac_->data(),(I)data_,(I)index_,(I)pick_,v_); } A r=af4(ac_->function(),(I)ac_->data(),(I)data_,(I)index_,(I)pick_,v_); // --AplusEvaluationDepth; fix in mstk if (r==0) showError(qs); return r; } A getVarFunc(AClientData *ac_) { A r=aplus_nl; if (ac_!=0) { if (isNull(ac_->actualData())==MSFalse) r=(A)ic(ac_->actualData()); else { r=gv(Et,2); r->p[0]=ic(ac_->function()); r->p[1]=ic(ac_->data()); } } return (A)r; } // MSWidgetView 'A' interface functions static void s_width(MSWidgetView *pWidgetView_,int w_) { pWidgetView_->width(w_); } static I g_width(MSWidgetView *pWidgetView_) { return (I) pWidgetView_->width(); } static void s_height(MSWidgetView *pWidgetView_,int h_) { pWidgetView_->height(h_); } static I g_height(MSWidgetView *pWidgetView_) { return (I) pWidgetView_->height(); } static void s_x(MSWidgetView *pWidgetView_,int x_) {pWidgetView_->moveTo(x_,pWidgetView_->y_origin());} static I g_x(MSWidgetView *pWidgetView_) {return (I) pWidgetView_->x_origin();} static void s_y(MSWidgetView *pWidgetView_,int y_) {pWidgetView_->moveTo(pWidgetView_->x_origin(),y_);} static I g_y(MSWidgetView *pWidgetView_) {return (I) pWidgetView_->y_origin();} static void s_acceptFocus(MSWidgetView *pWidgetView_,MSBoolean b_) {pWidgetView_->acceptFocus(b_);} static I g_acceptFocus(MSWidgetView *pWidgetView_) {return MSTrue==pWidgetView_->acceptFocus() ? 1 : 0;} static void s_defaultLeader(MSShell *leader_) {MSShell::defaultLeader(leader_);} static MSShell *g_defaultLeader(void) {return MSShell::defaultLeader();} static I s_saveYourselfWindow(MSTopLevel *tl_) { static MSTopLevel *_saveYourSelf = 0; if (0!=_saveYourSelf) return -1; _saveYourSelf = tl_; // Need to get around protected MSToplevel::setWMSaveYourself() if (tl_->widgetType() == AplusShell::symbol()) { ((AplusShell *) tl_)->setWMSaveYourself(); } else if (tl_->widgetType() == AplusPopup::symbol()) { ((AplusPopup *) tl_)->setWMSaveYourself(); } return 0; } static MSTopLevel *g_saveYourselfWindow(void) { return (MSTopLevel *) 0; } //static MSTopLevel *g_saveYourselfWindow(void) { /* FIX THIS */ // return TopLevelW::saveYourselfWindow();} static void s_parent(MSWidgetView *pWidgetView_,MSWidgetView *p_) { if (p_==0) { MSShell *p=new AplusShell;(void)p->windowGroup(g_defaultLeader()); p_=p; } else if (p_==(MSWidgetView *)-1) { MSPopup *p=new AplusPopup;(void)p->windowGroup(g_defaultLeader()); p_=p; } pWidgetView_->reparent(p_); } static void s_resizeOptions(MSWidgetView *pWidgetView_,unsigned long opts_) { enum ResizeOptions { Center=0,Left=4,Right=8,Top=16,Bottom=32, SmallWidth=64,SmallHeight=128,LikeWidth=256,LikeHeight=512}; unsigned long constraint = At::Default; if (opts_ & Left ) constraint |= At::Left; if (opts_ & Right ) constraint |= At::Right; if (opts_ & Top ) constraint |= At::Top; if (opts_ & Bottom ) constraint |= At::Bottom; if (opts_ & SmallWidth ) constraint |= At::MinimizeWidth; if (opts_ & SmallHeight) constraint |= At::MinimizeHeight; if (opts_ & LikeWidth ) constraint |= At::MaintainWidth; if (opts_ & LikeHeight ) constraint |= At::MaintainHeight; pWidgetView_->resizeConstraints(constraint); } static unsigned long g_resizeOptions(MSWidgetView *pWidgetView_) { enum ResizeOptions { Center=0,Left=4,Right=8,Top=16,Bottom=32, SmallWidth=64,SmallHeight=128,LikeWidth=256,LikeHeight=512}; unsigned long constraint = pWidgetView_->resizeConstraints(); unsigned long result = Center; if (constraint & At::Left ) result |= Left; if (constraint & At::Right ) result |= Right; if (constraint & At::Top ) result |= Top; if (constraint & At::Bottom ) result |= Bottom; if (constraint & At::MinimizeWidth ) result |= SmallWidth; if (constraint & At::MinimizeHeight) result |= SmallHeight; if (constraint & At::MaintainWidth ) result |= LikeWidth; if (constraint & At::MaintainHeight) result |= LikeHeight; return result; } static void s_sflags(MSWidgetCommon *pWidgetView_,A flags_) { if (pWidgetView_->model()) ((AplusModel*)pWidgetView_->model())->sflags(flags_); } static A g_sflags(MSWidgetCommon *pWidgetView_) { if (pWidgetView_->model()) return ((AplusModel*)pWidgetView_->model())->sflags(); else return aplus_nl; } /* TO MAKE THINGS COMPILABLE */ static void s_colorBgPixel(void *,unsigned long ) {} static void s_colorBgString(void *,char *) {} static unsigned long g_colorBgPixel(void *) { return 0;} static A g_colorBgString(void *) { return aplus_nl; } static void s_colorFgPixel(void *,unsigned long) {} static void s_colorFgString(void *,char *) {} static unsigned long g_colorFgPixel(void *) { return 0;} static A g_colorFgString(void *) {return aplus_nl;} // ColorObject is non-existent in MSTK /* FIX THIS */ /* static void s_colorBgPixel(ColorObject *win_,unsigned long pixel_) {win_->setColorBg(pixel_);} static void s_colorBgString(ColorObject *win_,char *str_) {win_->setColorBg(str_);} static unsigned long g_colorBgPixel(ColorObject *win_) {return win_->pixelBgValue();} static A g_colorBgString(ColorObject *win_) {return (A)(gsv(0,(char *)win_->colorBg()));} static void s_colorFgPixel(ColorObject *win_,unsigned long pixel_) {win_->setColorFg(pixel_);} static void s_colorFgString(ColorObject *win_,char *str_) {win_->setColorFg(str_);} static unsigned long g_colorFgPixel(ColorObject *win_) {return win_->pixelFgValue();} static A g_colorFgString(ColorObject *win_) {return (A)(gsv(0,(char *)win_->colorFg()));} */ int bServerParseColor(MSDisplayServer *s_,char * cp_) { XColor rgb; XParseColor(s_->display(),s_->colorManager()->colormap(),cp_,&rgb); return rgb.pixel; } int bAllocColor(MSDisplayServer *s_,char *cp_) { static XColor rgb; XParseColor(s_->display(),s_->colorManager()->colormap(),cp_,&rgb); int status=XAllocColor(s_->display(),s_->colorManager()->colormap(),&rgb); return (status!=0)?(int)rgb.pixel:-1; } static void bFreeColor(MSDisplayServer *s_,unsigned long pixel_) { XFreeColors(s_->display(),s_->colorManager()->colormap(),&pixel_,1,0); } static MSWidgetView *g_parent(MSWidgetView *pWidgetView_) { return (MSWidgetView *)pWidgetView_->owner(); } static MSWidgetView *g_focus(MSWidgetView *pWidgetView_) { MSWidget *pFocusWidget=pWidgetView_->inputFocus(); // // Make sure that we have an A+ widget here, not an MStk widget. This // especially applies to composite A+ widgets, such as AplusSlot, since // in MStk every field is also a widget. If pFocusWidget is an MStk // widget (e.g., a slot field), then go up the widget hierarchy until // we find an A+ widget. // while (pFocusWidget!=0 && isAplusWidget(pFocusWidget)==MSFalse) { pFocusWidget = pFocusWidget->owner(); } // Either the A+ widget that has the focus or 0 will be returned to s; // s should handle the null pointer case properly. // return (MSWidgetView *)pFocusWidget; } static MSWidgetView *g_focusWindow(void) { return (MSWidgetView *)MSWidget::focusWindow(); } static I g_freeze(MSWidgetView *pWidgetView_) { return MSTrue==pWidgetView_->frozen() ? 1 : 0; } static I g_visible(MSWidgetView *pWidgetView_) { return MSTrue==pWidgetView_->visible() ? 1 : 0; } static I g_sensitive(MSWidgetView *pWidgetView_) { return MSTrue==pWidgetView_->sensitive() ? 1 : 0; } static I g_dynamic(MSWidgetView *pWidgetView_) { return MSTrue==pWidgetView_->dynamic() ? 1 : 0; } static void s_sensitive(MSWidgetView *pWidgetView_,MSBoolean b_) { pWidgetView_->sensitive(b_); } static void s_dynamic(MSWidgetView *pWidgetView_,MSBoolean b_) { pWidgetView_->dynamic(b_); } static void s_background(MSWidgetView *pWidgetView_,unsigned long p_) {pWidgetView_->background(p_);} static unsigned long g_background(MSWidgetView *pWidgetView_) {return pWidgetView_->background();} static void s_foreground(MSWidgetView *pWidgetView_,unsigned long p_) { pWidgetView_->foreground(p_); } static unsigned long g_foreground(MSWidgetView *pWidgetView_) {return pWidgetView_->foreground();} static void s_hlColor(MSWidgetView *pWidgetView_,unsigned long p_) { if (pWidgetView_!=0) pWidgetView_->highlightColor(p_); } static unsigned long g_hlColor(MSWidgetView *pWidgetView_) {return (pWidgetView_!=0) ? pWidgetView_->highlightColor() : 0;} static void s_hlThickness(MSWidgetView *pWidgetView_,int ht_) { if (pWidgetView_!=0) pWidgetView_->highlightThickness(ht_); } static I g_hlThickness(MSWidgetView *pWidgetView_) {return (pWidgetView_!=0) ? (I) pWidgetView_->highlightThickness() : 0;} static void s_shadowThickness(MSWidgetView *pWidgetView_,int st_) { if (pWidgetView_!=0) pWidgetView_->shadowThickness(st_); } static int g_shadowThickness(MSWidgetView *pWidgetView_) {return (pWidgetView_!=0) ? pWidgetView_->shadowThickness() : 0;} static void s_shadowStyle(MSWidgetView *pWidgetView_, A value_) { AplusShadowStyleConverter converter; unsigned long style = converter(value_); if (style!=converter.enumNotFound()) { pWidgetView_->shadowStyle((MSShadowStyle)style); } } static A g_shadowStyle(MSWidgetView *pWidgetView_) { AplusShadowStyleConverter converter; return converter(pWidgetView_->shadowStyle()); } static void s_titleAlign(MSWidgetView *pWidgetView_, A value_) { const MSSymbol& type(pWidgetView_->widgetType()); // // need RTTI here to effectively determine if pWidgetView_ is derived // from MSWidgetCommon since that's where titleAlignment() is defined; // AplusTableColumn and AplusTraceSet are the only A+ widgets *not* // derived from MSWidgetCommon // if (type==AplusTableColumn::symbol() || type==AplusTraceSet::symbol()) { // the way it's set up in s this should never happen because `titlejustify // attribute is defined only for `real classes, which `tableField and `graphTrace // are *not*, but we check here just in case // return; } AplusAlignmentConverter converter; unsigned long justify = converter(value_); if (justify!=converter.enumNotFound()) { ((MSWidgetCommon *)pWidgetView_)->titleAlignment(justify); } } static A g_titleAlign(MSWidgetView *pWidgetView_) { const MSSymbol& type(pWidgetView_->widgetType()); // // need RTTI here to effectively determine if pWidgetView_ is derived // from MSWidgetCommon since that's where titleAlignment() is defined; // AplusTableColumn and AplusTraceSet are the only A+ widgets *not* // derived from MSWidgetCommon // if (type==AplusTableColumn::symbol() || type==AplusTraceSet::symbol()) { // the way it's set up in s this should never happen because `titlejustify // attribute is defined only for `real classes, which `tableField and `graphTrace // are *not*, but we check here just in case // return aplus_nl; } AplusAlignmentConverter converter; return converter(((MSWidgetCommon *)pWidgetView_)->titleAlignment()); } static void s_font(MSWidgetView *pWidgetView_,Font id_) {pWidgetView_->font(id_);} static Font g_font(MSWidgetView *pWidgetView_) { return pWidgetView_->font(); } static void s_windowName(MSTopLevel *pWidgetView_,char *name_) { pWidgetView_->windowTitle(name_); } static void s_iconName(MSTopLevel *pWidgetView_,char *name_) { pWidgetView_->iconTitle(name_); } static A g_windowName(MSTopLevel *pWidgetView_) { MSString name(pWidgetView_->windowTitle()); A r=gsv(0,(char *)name.string()); return r; } static A g_iconName(MSTopLevel *pWidgetView_) { MSString name(pWidgetView_->iconTitle()); A r=gsv(0,(char *)name.string()); return r; } static void s_freeze(MSWidgetView *pWidgetView_,MSBoolean b_) { if (b_==MSTrue) pWidgetView_->freeze(); else { pWidgetView_->unfreeze(); pWidgetView_->redraw(); } } // MSDisplayServer 'A' interface functions static Display *g_serverDisplay(MSDisplayServer *server_) {return server_->display();} static I g_screenWidth(MSDisplayServer *server_) {return (I) server_->width();} static I g_screenHeight(MSDisplayServer *server_) {return (I) server_->height();} // AplusCollapsible interface functions static void s_handleBg(MSCollapsibleLayout *cl_, unsigned long bg_) { cl_->handleBackground(bg_); } static unsigned long g_handleBg(MSCollapsibleLayout *cl_) { return cl_->handleBackground(); } static void s_handleSize(MSCollapsibleLayout *cl_, unsigned long size_) { cl_->handleSize(size_); } static unsigned long g_handleSize(MSCollapsibleLayout *cl_) { return cl_->handleSize(); } static void s_open(MSCollapsibleLayout *cl_, A open_) { if( open_ && QA( open_) ) { int childCount=cl_->children().length(); if( open_->t==Et && open_->n==childCount ) { for(int i=0; in; i++) { A wrk=(A)open_->p[i]; if( wrk && QA(wrk) && wrk->t==It && wrk->n==1) wrk->p[0] ? cl_->open(cl_->children()(i)): cl_->close(cl_->children()(i)); } } else if(open_->t==It && open_->n==1) { for(int i=0; ip[0] ? cl_->open(cl_->children()(i)): cl_->close(cl_->children()(i)); } } } static A g_open(MSCollapsibleLayout *cl_) { int childCount=cl_->children().length(); A z=gv(Et,childCount); for(int i=0; ip[i]=(I)gi( MSTrue==cl_->isOpened(cl_->children()(i)) ? 1:0); return z; } static void s_toolTip(MSCollapsibleLayout *cl_, A toolTip_) { if( toolTip_ && QA( toolTip_) ) { int childCount=cl_->children().length(); if( toolTip_->t==Et && toolTip_->n==childCount ) { for(int i=0; in; i++) { A wrk=(A)toolTip_->p[i]; if( wrk && QA(wrk) && wrk->t==Ct) { MSString tip((char *)wrk->p,wrk->n); MSStringVector tips; tips<handleToolTip(cl_->children()(i),tips); } } } else if(toolTip_->t==Ct) { for(int i=0; ip,toolTip_->n); MSStringVector tips; tips<handleToolTip(cl_->children()(i),tips); } } } } static A g_toolTip(MSCollapsibleLayout *cl_) { int childCount=cl_->children().length(); A z=gv(Et,childCount); for(int i=0; ihandleToolTip(cl_->children()(i)); MSString tip; for(int j=0; jp[i]=(I)gsv(0,(char *)tip.string()); } return z; } // AXPassword interface functions static I g_passwordValidity(AplusPassword *o_) { return MSTrue==o_->valid() ? 1 : 0; } static I g_passwordFillChar(AplusPassword *o_) { return (I)o_->fillChar(); } static void s_passwordFillChar(AplusPassword *o_,int ch_) { o_->fillChar((char)ch_); } // AplusTreeView interface functions static void s_treeSelectedNode(AplusTreeView *tv_, A value_) { tv_->selectedNodeA(value_); } static A g_treeSelectedNode(AplusTreeView *tv_) { return tv_->selectedNodeA(); } static void s_treeNodeFg(AplusTreeView *tv_,unsigned long fg_) {tv_->nodeForeground(fg_);} static unsigned long g_treeNodeFg(AplusTreeView *tv_) {return tv_->nodeForeground();} static void s_treeNodeBg(AplusTreeView *tv_,unsigned long bg_) {tv_->nodeBackground(bg_);} static unsigned long g_treeNodeBg(AplusTreeView *tv_) {return tv_->nodeBackground();} static void s_treeSelectedNodeFg(AplusTreeView *tv_,unsigned long fg_) {tv_->selectedNodeForeground(fg_);} static unsigned long g_treeSelectedNodeFg(AplusTreeView *tv_) {return tv_->selectedNodeForeground();} static void s_treeSelectedNodeBg(AplusTreeView *tv_,unsigned long bg_) {tv_->selectedNodeBackground(bg_);} static unsigned long g_treeSelectedNodeBg(AplusTreeView *tv_) {return tv_->selectedNodeBackground();} static void s_treeVerticalSpace(AplusTreeView *tv_,int num_) {tv_->verticalSpacing(0verticalSpacing();} static void s_treeHorizontalSpace(AplusTreeView *tv_,int num_) {tv_->horizontalSpacing(0horizontalSpacing();} static void s_treeOrientation(AplusTreeView *tv_, A sym_) { if (!QS(sym_)&&(sym_->t==Et&&sym_->n>0&&QS(*sym_->p))) { if(XS(*sym_->p)==si("vertical")) tv_->orientation(AplusTreeView::Vertical); else if(XS(*sym_->p)==si("horizontal")) tv_->orientation(AplusTreeView::Horizontal); } } static A g_treeOrientation(AplusTreeView *tv_) { return gsym((AplusTreeView::Vertical==tv_->orientation())?"vertical":"horizontal"); } static void s_treeShowButtons(AplusTreeView *tv_, MSBoolean b_) { tv_->showButtons(b_); } static I g_treeShowButtons(AplusTreeView *tv_) { return MSTrue==tv_->showButtons() ? 1 : 0; } static void s_treeLineColor(AplusTreeView *tv_, unsigned long color_) { tv_->lineForeground(color_); } static unsigned long g_treeLineColor(AplusTreeView *tv_) { return tv_->lineForeground(); } // AplusTextM interface functions extern "C" A gst(I x, C *s); static A g_textBuffer(AplusText *o_) { return (A)gst(0,(char *)o_->string()); } static I g_textNumVisibleRows(AplusText *mp_) { return (I) mp_->rows();} static void s_textNumVisibleRows(AplusText *mp_,int num_) { mp_->rows(num_); } static I g_textNumVisibleCols(AplusText *mp_) { return (I) mp_->columns();} static void s_textNumVisibleCols(AplusText *mp_,int num_) { mp_->columns(num_); } static I g_textCursorPosition(AplusText *o_) { return (I) o_->cursorPosition();} static void s_textCursorPosition(AplusText *o_,int cp_) { o_->cursorPosition(cp_);} // AXCommand interface functions static char *g_commandBuffer(AplusCommand *o_) {return (char *)o_->buffer(); } static void s_commandBuffer(AplusCommand *o_,A a_) { o_->buffer(a_); } static I g_commandCursorPosition(AplusCommand *o_) {return (I) o_->cursorPosition();} static void s_commandCursorPosition(AplusCommand *o_,int cp_) { o_->cursorPosition(cp_); } // AXPage interface functions static A g_pageCursor(AplusPage *p_) { return p_->cursorPosition(); } static unsigned long g_pageBlinkRate(AplusPage *p_) { return p_->blinkRate(); } static void s_pageBlinkRate(AplusPage *p_,unsigned long r_) { p_->blinkRate(r_); } static A g_pageColorTable(AplusPage *p_) { return p_->colorTable(); } static void s_pageColorTable(AplusPage *p_,A ct_) { p_->colorTable(ct_); } static A g_pageBoxes(AplusPage *p_) { return p_->boxes(); } static void s_pageBoxes(AplusPage *p_,A b_) { p_->boxes(b_); } static A g_pageLines(AplusPage *p_) { return p_->lines(); } static void s_pageLines(AplusPage *p_,A b_) { p_->lines(b_); } static I g_pageLineWidth(AplusPage *p_) { return (I) p_->lineWidth(); } static void s_pageLineWidth(AplusPage *p_,int lw_) { p_->lineWidth(lw_); } static A g_pageBoxColors(AplusPage *p_) { return p_->boxColorVector(); } static void s_pageBoxColors(AplusPage *p_,A b_) { p_->boxColorVector(b_); } static A g_pageRubberBand(AplusPage *p_) { return p_->rBand(); } static A g_pageKeyBuffer(AplusPage *p_) { return p_->keyBuf(); } static void s_pageIndexFunc(AplusPage *page_,A fc_) { if (fc_->t==Et && fc_->n==2) { I f=fc_->p[0]; I c=fc_->p[1]; AClientData *ac=new AClientData((A)f,(A)c); page_->indexFunc((AFunc)cdipv,ac); } else if (isNull(fc_)==MSTrue) page_->indexFunc((AFunc)0,0); else showError("Invalid 'pageIndex' Function Specification"); } static A g_pageIndexFunc(AplusPage *page_) { return (A)getVarFunc((AClientData *)page_->indexFunc()->arg()); } static void s_pageBoldFunc(AplusPage *page_,A fc_) { if (fc_->t==Et && fc_->n==2) { I f=fc_->p[0]; I c=fc_->p[1]; AClientData *ac=new AClientData((A)f,(A)c); page_->boldFunc((AFunc)cdipv,ac); } else if (isNull(fc_)==MSTrue) page_->boldFunc((AFunc)0,0); else showError("Invalid 'pageBold' Function Specification"); } static A g_pageBoldFunc(AplusPage *page_) { return (A)getVarFunc((AClientData *)page_->boldFunc()->arg()); } static void s_pageBlinkFunc(AplusPage *page_,A fc_) { if (fc_->t==Et && fc_->n==2) { I f=fc_->p[0]; I c=fc_->p[1]; AClientData *ac=new AClientData((A)f,(A)c); page_->blinkFunc((AFunc)cdipv,ac); } else if (isNull(fc_)==MSTrue) page_->blinkFunc((AFunc)0,0); else showError("Invalid 'pageBlink' Function Specification"); } static A g_pageBlinkFunc(AplusPage *page_) { return (A)getVarFunc((AClientData *)page_->blinkFunc()->arg()); } static void s_pageUnderlineFunc(AplusPage *page_,A fc_) { if (fc_->t==Et && fc_->n==2) { I f=fc_->p[0]; I c=fc_->p[1]; AClientData *ac=new AClientData((A)f,(A)c); page_->underlineFunc((AFunc)cdipv,ac); } else if (isNull(fc_)==MSTrue) page_->underlineFunc((AFunc)0,0); else showError("Invalid 'pageUnderline' Function Specification"); } static A g_pageUnderlineFunc(AplusPage *page_) { return (A)getVarFunc((AClientData *)page_->underlineFunc()->arg()); } // XManager 'A' interface functions static I g_numChildren(AplusManager *mp_) { return (I) mp_->childCount(); } static char *g_serverName(MSDisplayServer *server_) {return (char *) server_->name();} // AXBtnBox 'A' interface functions /* maps to MSButtonBox */ static void s_actionBoxOptions(AplusButtonBox *ab_,A sym_) { ab_->alignment(GUIEnum.alignFormat(sym_));} static A g_actionBoxOptions(AplusButtonBox *ab_) { return GUIEnum.alignFormat((unsigned long)ab_->alignment()); } static void s_actionHlColor(AplusButtonBox *o_, unsigned long c_) { o_->highlightColor(c_); } static unsigned long g_actionHlColor(AplusButtonBox *o_) { return o_->highlightColor(); } static void s_actionHlThickness(AplusButtonBox *o_, int t_) { o_->buttonHighlightThickness(t_); } static I g_actionHlThickness(AplusButtonBox *o_) { return (I) o_->buttonHighlightThickness(); } static void s_actionButtonShadowThickness(AplusButtonBox *o_, int t_) { o_->buttonShadowThickness(t_); } static I g_actionButtonShadowThickness(AplusButtonBox *o_) { return (I) o_->buttonShadowThickness(); } static void s_checkHlColor(AplusCheckBox *o_, unsigned long c_) { o_->highlightColor(c_); } static unsigned long g_checkHlColor(AplusCheckBox *o_) { return o_->highlightColor(); } static void s_checkHlThickness(AplusCheckBox *o_, int t_) { o_->buttonHighlightThickness(t_); } static I g_checkHlThickness(AplusCheckBox *o_) { return (I) o_->buttonHighlightThickness(); } static void s_radioHlColor(AplusRadioBox *o_, unsigned long c_) { o_->highlightColor(c_); } static unsigned long g_radioHlColor(AplusRadioBox *o_) { return o_->highlightColor(); } static void s_radioHlThickness(AplusRadioBox *o_, int t_) { o_->buttonHighlightThickness(t_); } static I g_radioHlThickness(AplusRadioBox *o_) { return (I) o_->buttonHighlightThickness(); } // XTextObject 'A' interface functions /* maps to MSPrimitiveText */ static void s_labelOptions(MSPrimitiveText *pt_,A x_) { pt_->alignment(GUIEnum.alignFormat(x_)); } static A g_labelOptions(MSPrimitiveText *pt_) { return GUIEnum.alignFormat((unsigned long) pt_->alignment()); } // XManager attribute access functions static void s_mgrDoubleClickTime(AplusManager *,unsigned long time_) { MSApplication::doubleClickInterval(time_); } static unsigned long g_mgrDoubleClickTime(AplusManager *) { return MSApplication::doubleClickInterval(); } static void s_mgrLongPressTime(AplusManager *,unsigned long) {} static unsigned long g_mgrLongPressTime(AplusManager *) { return 0;} //static void s_mgrLongPressTime(XManager *mgr_,unsigned long time_) /* Non-existent */ //{ mgr_->longPressTime(time_); } //static unsigned long g_mgrLongPressTime(XManager *mgr_) //{ return (unsigned long) mgr_->longPressTime(); } /* * XScale access functions */ static void s_scaleValueMin(MSScale *sp_,A value_) { if (!QS(value_)&&(value_->t==It||value_->t==Ft)) { P p; p.i=value_->p; sp_->valueMin(value_->t==Ft?p.f[0]:(double)p.i[0]); } } static A g_scaleValueMin(MSScale *sp_) { A r=gf(sp_->valueMin()); return r; } static void s_scaleValueMax(MSScale *sp_,A value_) { if (!QS(value_)&&(value_->t==It||value_->t==Ft)) { P p; p.i=value_->p; sp_->valueMax(value_->t==Ft?p.f[0]:(double)p.i[0]); } } static A g_scaleValueMax(MSScale *sp_) { A r=gf(sp_->valueMax()); return r; } static void s_scaleValueInc(MSScale *sp_,A value_) { if (!QS(value_)&&(value_->t==It||value_->t==Ft)) { P p; p.i=value_->p; sp_->valueInc(value_->t==Ft?p.f[0]:(double)p.i[0]); } } static A g_scaleValueInc(MSScale *sp_) { A r=gf(sp_->valueInc()); return r; } static void s_scaleValuePageInc(MSScale *sp_,A value_) { if (!QS(value_)&&(value_->t==It||value_->t==Ft)) { P p; p.i=value_->p; sp_->valuePageInc(value_->t==Ft?p.f[0]:(double)p.i[0]); } } static A g_scaleValuePageInc(MSScale *sp_) { A r=gf(sp_->valuePageInc()); return r; } static void s_scaleValueFont(MSScale *sp_,Font font_) { sp_->valueFont(font_); } static Font g_scaleValueFont(MSScale *sp_) { return (Font)sp_->valueFont(); } static void s_scaleValueFg(MSScale *sp_,unsigned long fg_) { sp_->valueForeground(fg_); } static unsigned long g_scaleValueFg(MSScale *sp_) { return sp_->valueForeground(); } static void s_scaleValueAlign(MSScale *sp_,A sym_){ sp_->valueAlignment(GUIEnum.alignFormat(sym_)); } static A g_scaleValueAlign(MSScale *sp_) { return GUIEnum.alignFormat(sp_->valueAlignment()); } static void s_scaleSliderBg(MSScale *sp_,unsigned long bg_) { sp_->sliderBackground(bg_); } static unsigned long g_scaleSliderBg(MSScale *sp_) { return sp_->sliderBackground(); } // SliderHeight and sliderwidth will call sliderSize static void s_scaleSliderHeight(MSScale *sp_,A value_) { if (!QS(value_)&&(value_->t==It||value_->t==Ft)) { P p; p.i=value_->p; sp_->sliderSize((int)(value_->t==Ft?p.f[0]:p.i[0])); } } static A g_scaleSliderHeight(MSScale *sp_) { A r=gf(sp_->sliderSize()); return r; } static void s_scaleSliderWidth(MSScale *sp_,A value_) { if (!QS(value_)&&(value_->t==It||value_->t==Ft)) { P p; p.i=value_->p; sp_->sliderSize((int)(value_->t==Ft?p.f[0]:p.i[0])); } } static A g_scaleSliderWidth(MSScale *sp_) { A r=gf(sp_->sliderSize()); return r; } static void s_scaleTitleAlign(MSScale *sp_,A x_){ sp_->titleAlignment(GUIEnum.alignFormat(x_));} static A g_scaleTitleAlign(MSScale *sp_) { return GUIEnum.alignFormat(sp_->titleAlignment()); } static void s_scaleSubtitle(MSScale *sp_,A title_) { MSStringVector t; asTitleStringVector(t, title_); sp_->subtitle(t); } static A g_scaleSubtitle(MSScale *sp_) { A ap = aplus_nl; const MSStringVector &t=sp_->subtitle(); long d[MAXR]={ 0, 0, 0, 0, 0, 0, 0, 0, 0 }; long xrho=t.length(); d[0]=xrho; ap = ga(Et, 1, xrho, d); for (long i=0; ip[i]=(long) gc(Ct, 1, t.elementAt(i).length(), d, (long *)t.elementAt(i).string()); } return ap; } static void s_scaleSubtitleFont(MSScale *sp_,Font font_) { sp_->subtitleFont(font_); } static Font g_scaleSubtitleFont(MSScale *sp_) { return (Font)sp_->subtitleFont(); } static void s_scaleSubtitleAlign(MSScale *sp_,A x_) { sp_->subtitleAlignment(GUIEnum.alignFormat(x_)); } static A g_scaleSubtitleAlign(MSScale *sp_) { return GUIEnum.alignFormat(sp_->subtitleAlignment()); } static void s_scaleSubtitleFg(MSScale *sp_,unsigned long fg_) { sp_->subtitleForeground(fg_); } static unsigned long g_scaleSubtitleFg(MSScale *sp_) { return sp_->subtitleForeground(); } static void s_scaleMintitle(MSScale *sp_,A title_) { MSStringVector t; asTitleStringVector(t, title_); sp_->mintitle(t); } static A g_scaleMintitle(MSScale *sp_) { A ap = aplus_nl; const MSStringVector &t=sp_->mintitle(); long d[MAXR]={ 0, 0, 0, 0, 0, 0, 0, 0, 0 }; long xrho=t.length(); d[0]=xrho; ap = ga(Et, 1, xrho, d); for (long i=0; ip[i]=(long) gc(Ct, 1, t.elementAt(i).length(), d, (long *)t.elementAt(i).string()); } return ap; } static void s_scaleMintitleFg(MSScale *sp_,unsigned long fg_) { sp_->mintitleForeground(fg_); } static unsigned long g_scaleMintitleFg(MSScale *sp_) { return sp_->mintitleForeground(); } static void s_scaleMintitleAlign(MSScale *sp_,A x_) { sp_->mintitleAlignment(GUIEnum.alignFormat(x_)); } static A g_scaleMintitleAlign(MSScale *sp_) { return GUIEnum.alignFormat(sp_->mintitleAlignment()); } static void s_scaleMintitleFont(MSScale *sp_,Font font_) { sp_->mintitleFont(font_); } static Font g_scaleMintitleFont(MSScale *sp_) { return (Font)sp_->mintitleFont(); } static void s_scaleMaxtitle(MSScale *sp_,A title_) { MSStringVector t; asTitleStringVector(t, title_); sp_->maxtitle(t); } static A g_scaleMaxtitle(MSScale *sp_) { A ap = aplus_nl; const MSStringVector &t=sp_->maxtitle(); long d[MAXR]={ 0, 0, 0, 0, 0, 0, 0, 0, 0 }; long xrho=t.length(); d[0]=xrho; ap = ga(Et, 1, xrho, d); for (long i=0; ip[i]=(long) gc(Ct, 1, t.elementAt(i).length(), d, (long *)t.elementAt(i).string()); } return ap; } static void s_scaleMaxtitleFg(MSScale *sp_,unsigned long fg_) { sp_->maxtitleForeground(fg_); } static unsigned long g_scaleMaxtitleFg(MSScale *sp_) { return sp_->maxtitleForeground(); } static void s_scaleMaxtitleAlign(MSScale *sp_,A x_) { sp_->maxtitleAlignment(GUIEnum.alignFormat(x_)); } static A g_scaleMaxtitleAlign(MSScale *sp_) { return GUIEnum.alignFormat(sp_->maxtitleAlignment()); } static void s_scaleMaxtitleFont(MSScale *sp_,Font font_) { sp_->maxtitleFont(font_); } static Font g_scaleMaxtitleFont(MSScale *sp_) { return (Font)sp_->maxtitleFont(); } static void s_scaleLabelInc(MSScale *sp_,A value_) { if (!QS(value_)&&(value_->t==It||value_->t==Ft)) { P p; p.i=value_->p; sp_->labelInc(value_->t==Ft?p.f[0]:(double)p.i[0]); } } static A g_scaleLabelInc(MSScale *sp_) { A r=gf(sp_->labelInc()); return r; } static void s_scaleLabelFont(MSScale *sp_,Font font_) { sp_->labelFont(font_); } static Font g_scaleLabelFont(MSScale *sp_) { return (Font)sp_->labelFont(); } static void s_scaleLabelFg(MSScale *sp_,unsigned long fg_) { sp_->labelForeground(fg_); } static unsigned long g_scaleLabelFg(MSScale *sp_) { return sp_->labelForeground(); } static void s_scaleLabelAlign(MSScale *sp_,A x_) { sp_->labelAlignment(GUIEnum.alignFormat(x_)); } static A g_scaleLabelAlign(MSScale *sp_) { return GUIEnum.alignFormat(sp_->labelAlignment()); } static void s_scaleLabelOut(MSScale *,A ) {} //void s_scaleLabelOut(MSScale *sp_,A fc_) //{ // if (!QS(fc_)&&(fc_->t==Et&&fc_->n>0&&QS(*fc_->p))) // { // sp_->labelFormat(fc_); // } // else if (fc_->t==Et&&fc_->n==2) // { // P p; p.i = fc_->p; // if (QA(p.a[0])&&(p.a[0]->t==Et&&p.a[0]->n>0&&QS(*p.a[0]->p))) // { // sp_->labelFormat(p.a[0]); // P pp; pp.i = p.a[1]->p; // if (pp.i!=0) sp_->labelPrecision((int)pp.i[0]); // } // else sp_->labelFormatFunc((AFunc)cdipv,fc_); // } // else if (isNull(fc_)==MSTrue) sp_->labelFormatFunc((AFunc)0,0); // else showError("Invalid 'label format' Function Specification"); //} static A g_scaleLabelOut(MSScale *) { return aplus_nl; } //A g_scaleLabelOut(MSScale *sp_) //{ // A ac=(A)getVarFunc((AClientData *)sp_->labelFormatFunc()->arg()); // return (isNull(ac)==MSTrue) ? sp_->labelFormatSym() : ac; //} static void s_scaleMajorTickSize(MSScale *sp_,int val_) { sp_->majorTickSize(val_); } static I g_scaleMajorTickSize(MSScale *sp_) { return (I)sp_->majorTickSize(); } static void s_scaleMinorTickSize(MSScale *sp_,int val_) { sp_->minorTickSize(val_); } static I g_scaleMinorTickSize(MSScale *sp_) { return (I)sp_->minorTickSize(); } static void s_scaleMinorTickCt(MSScale *sp_,int val_) { sp_->minorTickCount(val_); } static I g_scaleMinorTickCt(MSScale *sp_) { return (I)sp_->minorTickCount(); } static void s_scaleEditorBg(MSScale *,unsigned long) { } static void s_scaleEditorFg(MSScale *,unsigned long) { } static unsigned long g_scaleEditorBg(MSScale *) { return 0; } static unsigned long g_scaleEditorFg(MSScale *) { return 0; } // void s_scaleEditorBg(MSScale *sp_,unsigned long fg_) { sp_->editor()->background(fg_); } // void s_scaleEditorFg(MSScale *sp_,unsigned long fg_) { sp_->editor()->foreground(fg_); } // unsigned long g_scaleEditorBg(MSScale *sp_) { return sp_->editor()->background(); } // unsigned long g_scaleEditorFg(MSScale *sp_) { return sp_->editor()->foreground(); } static void s_scaleEdit(MSScale *,MSBoolean) { // if (b_==MSTrue) // { // sp_->editor()->font(sp_->valueFont()); // sp_->editor()->resize(sp_->valueWin()->width(),sp_->valueWin()->height()); // sp_->editor()->moveTo(sp_->valueWin()->x_origin(),sp_->valueWin()->y_origin()); // sp_->editor()->string(sp_->valueStr()); // sp_->editor()->map(); // sp_->editor()->focusIn(); // sp_->editor()->obtainFocus(); // } // else // { // sp_->editorActivate(); // } } static I g_scaleEdit(MSScale *){ return 0; } // MSFalse // MSBoolean g_scaleEdit(MSScale *sp_){ return sp_->editor()->mapped(); } // AXTableVar 'A' interface functions /* MSTableColumn */ static void s_fieldColumnAlignment(MSWidgetView *o_, A sym_) { AplusTableColumn *tc = (AplusTableColumn *)o_; if (tc) tc->columnAlignment((MSAlignment)GUIEnum.alignFormat(sym_)); } static A g_fieldColumnAlignment(MSWidgetView *o_) { A result=aplus_nl; AplusTableColumn *tc = (AplusTableColumn *)o_; if (tc) result = GUIEnum.alignFormat((unsigned long)tc->columnAlignment()); return result; } static void s_fieldCycleFunc(MSWidgetView *o_, A fc_) { AplusTableColumn *tc = (AplusTableColumn *)o_; V v = (tc->model()!=0)?((AplusModel*)tc->model())->aplusVar():0; AVariableData *varData = pAVarDataFromV(v); if (varData) { if (fc_->t==Et&&fc_->n==2) { AClientData *ac=new AClientData((A)fc_->p[0],(A)fc_->p[1]); varData->cycleFunc((AFunc)cdipv,ac); } else if (isNull(fc_)==MSTrue) varData->cycleFunc((AFunc)0,0); else showError("Invalid 'array' Cycle Function Specification"); } } static A g_fieldCycleFunc(MSWidgetView *o_) { AplusTableColumn *tc = (AplusTableColumn *)o_; A out = aplus_nl; V v = (tc->model()!=0)?((AplusModel*)tc->model())->aplusVar():0; AVariableData *varData = pAVarDataFromV(v); if (varData) { out = (A)getVarFunc(varData->cycleFunc()->arg()); } return out; } static void s_fieldCycleColors(MSWidgetView *o_,A a_) { AplusTableColumn *tc = (AplusTableColumn *)o_; if (QA(a_)) { MSUnsignedLongVector uv; for (unsigned i = 0; i < a_->n; i++) uv << (unsigned long) a_->p[i]; tc->cycleColors(uv); } } static A g_fieldCycleColors(MSWidgetView *o_) { AplusTableColumn *tc = (AplusTableColumn *)o_; A cv = aplus_nl; MSUnsignedLongVector uv= tc->cycleColors(); if (uv.length() > 0) { long d[MAXR]={ 0, 0, 0, 0, 0, 0, 0, 0, 0 }; d[0]=uv.length(); cv = ga(It, 1, uv.length(), d); for(unsigned i = 0; i < uv.length(); i++) { cv->p[i] = (unsigned long)uv(i); } } return cv; } static void s_fieldBreakText(MSWidgetView *o_, A sym_, A printTextVtr_) { AplusTableColumn *tc = (AplusTableColumn *)o_; if (QA(printTextVtr_) && printTextVtr_->t==It && printTextVtr_->n>0) { tc->removeAllBreakText(); for (unsigned i = 0; i < printTextVtr_->n; i++) { P p; p.i=printTextVtr_->p; AplusPrintText *pt = (AplusPrintText *) p.i[i]; tc->addBreakText(*pt); } tc->breakText((A) ic(sym_)); } } static A g_fieldBreakText(MSWidgetView *o_) { AplusTableColumn *tc = (AplusTableColumn *)o_; return (A) ic(tc->breakText()); } ////////////////////////////////////////////////////////////////////////////// static void s_fieldBgGrayScale(MSWidgetView *o_, A value_) { AplusTableColumn *tc = (AplusTableColumn *)o_; if(!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; tc->bgGrayScale(value_->t==Ft?p.f[0]:(double)p.i[0]); } } static A g_fieldBgGrayScale(MSWidgetView *o_) { AplusTableColumn *tc = (AplusTableColumn *)o_; return (A) gf(tc->bgGrayScale()); } static void s_fieldBgGrayScaleFunc(MSWidgetView *o_, A fc_) { AplusTableColumn *tc = (AplusTableColumn *)o_; V v = (tc->model()!=0)?((AplusModel*)tc->model())->aplusVar():0; if (fc_->t==Et&&fc_->n==2) { AClientData *ac=new AClientData((A)fc_->p[0],(A)fc_->p[1]); tc->bgGrayScaleFunc((AFunc)cdipv,ac); } else if (isNull(fc_)==MSTrue) tc->bgGrayScaleFunc((AFunc)0,0); else showError("Invalid 'field' BgGrayScale Function Specification"); } static A g_fieldBgGrayScaleFunc(MSWidgetView *o_) { A out = aplus_nl; AplusTableColumn *tc = (AplusTableColumn *)o_; V v = (tc->model()!=0)?((AplusModel*)tc->model())->aplusVar():0; out = (A)getVarFunc(tc->bgGrayScaleFunc()->arg()); return out; } ////////////////////////////////////////////////////////////////////////////// static void s_fieldBreakBgGrayScale(MSWidgetView *o_, A value_) { AplusTableColumn *tc = (AplusTableColumn *)o_; if(!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; tc->breakBgGrayScale(value_->t==Ft?p.f[0]:(double)p.i[0]); } } static A g_fieldBreakBgGrayScale(MSWidgetView *o_) { AplusTableColumn *tc = (AplusTableColumn *)o_; return (A) gf(tc->breakBgGrayScale()); } static void s_fieldBreakBgGrayScaleFunc(MSWidgetView *o_, A fc_) { AplusTableColumn *tc = (AplusTableColumn *)o_; V v = (tc->model()!=0)?((AplusModel*)tc->model())->aplusVar():0; if (fc_->t==Et&&fc_->n==2) { AClientData *ac=new AClientData((A)fc_->p[0],(A)fc_->p[1]); tc->breakBgGrayScaleFunc((AFunc)cdipv,ac); } else if (isNull(fc_)==MSTrue) tc->bgGrayScaleFunc((AFunc)0,0); else showError("Invalid 'field' BreakBgGrayScale Function Specification"); } static A g_fieldBreakBgGrayScaleFunc(MSWidgetView *o_) { A out = aplus_nl; AplusTableColumn *tc = (AplusTableColumn *)o_; V v = (tc->model()!=0)?((AplusModel*)tc->model())->aplusVar():0; out = (A)getVarFunc(tc->breakBgGrayScaleFunc()->arg()); return out; } ////////////////////////////////////////////////////////////////////////////// static void s_fieldBreakFont(MSWidgetView *o_, A a_) { AplusTableColumn *tc = (AplusTableColumn *)o_; tc->breakFont((const char *)AplusConvert::asMSString(a_)); } static A g_fieldBreakFont(MSWidgetView *o_) { AplusTableColumn *tc = (AplusTableColumn *)o_; return AplusConvert::asA(MSString(tc->breakFont())); } static void s_fieldBreakFontFunc(MSWidgetView *o_, A fc_) { AplusTableColumn *tc = (AplusTableColumn *)o_; V v = (tc->model()!=0)?((AplusModel*)tc->model())->aplusVar():0; if (fc_->t==Et&&fc_->n==2) { AClientData *ac=new AClientData((A)fc_->p[0],(A)fc_->p[1]); tc->breakFontFunc((AFunc)cdipv,ac); } else if (isNull(fc_)==MSTrue) tc->breakFontFunc((AFunc)0,0); else showError("Invalid 'field' BreakFont Function Specification"); } static A g_fieldBreakFontFunc(MSWidgetView *o_) { A out = aplus_nl; AplusTableColumn *tc = (AplusTableColumn *)o_; V v = (tc->model()!=0)?((AplusModel*)tc->model())->aplusVar():0; out = (A)getVarFunc(tc->breakFontFunc()->arg()); return out; } ////////////////////////////////////////////////////////////////////////////// static void s_fieldBreakLeading(MSWidgetView *o_, int x_) { AplusTableColumn *tc = (AplusTableColumn *)o_; tc->breakLeading(x_); } static I g_fieldBreakLeading(MSWidgetView *o_) { AplusTableColumn *tc = (AplusTableColumn *)o_; return (I) tc->breakLeading(); } static void s_fieldBreakLeadingFunc(MSWidgetView *o_, A fc_) { AplusTableColumn *tc = (AplusTableColumn *)o_; V v = (tc->model()!=0)?((AplusModel*)tc->model())->aplusVar():0; if (fc_->t==Et&&fc_->n==2) { AClientData *ac=new AClientData((A)fc_->p[0],(A)fc_->p[1]); tc->breakLeadingFunc((AFunc)cdipv,ac); } else if (isNull(fc_)==MSTrue) tc->breakLeadingFunc((AFunc)0,0); else showError("Invalid 'field' BreakLeading Function Specification"); } static A g_fieldBreakLeadingFunc(MSWidgetView *o_) { A out = aplus_nl; AplusTableColumn *tc = (AplusTableColumn *)o_; V v = (tc->model()!=0)?((AplusModel*)tc->model())->aplusVar():0; out = (A)getVarFunc(tc->breakLeadingFunc()->arg()); return out; } ////////////////////////////////////////////////////////////////////////////// static void s_fieldBreakOffset(MSWidgetView *o_, int x_) { AplusTableColumn *tc = (AplusTableColumn *)o_; tc->breakOffset(x_); } static I g_fieldBreakOffset(MSWidgetView *o_) { AplusTableColumn *tc = (AplusTableColumn *)o_; return (I) tc->breakOffset(); } static void s_fieldBreakOffsetFunc(MSWidgetView *o_, A fc_) { AplusTableColumn *tc = (AplusTableColumn *)o_; V v = (tc->model()!=0)?((AplusModel*)tc->model())->aplusVar():0; if (fc_->t==Et&&fc_->n==2) { AClientData *ac=new AClientData((A)fc_->p[0],(A)fc_->p[1]); tc->breakOffsetFunc((AFunc)cdipv,ac); } else if (isNull(fc_)==MSTrue) tc->breakOffsetFunc((AFunc)0,0); else showError("Invalid 'field' BreakOffset Function Specification"); } static A g_fieldBreakOffsetFunc(MSWidgetView *o_) { A out = aplus_nl; AplusTableColumn *tc = (AplusTableColumn *)o_; V v = (tc->model()!=0)?((AplusModel*)tc->model())->aplusVar():0; out = (A)getVarFunc(tc->breakOffsetFunc()->arg()); return out; } ////////////////////////////////////////////////////////////////////////////// static void s_fieldBreakOn(MSWidgetView *o_, MSBoolean a_) { AplusTableColumn *tc = (AplusTableColumn *)o_; tc->breakOn(a_); } static I g_fieldBreakOn(MSWidgetView *o_) { AplusTableColumn *tc = (AplusTableColumn *)o_; return MSTrue==tc->breakOn() ? 1 : 0; } static void s_fieldBreakProcessOn(MSWidgetView *o_, MSBoolean a_) { AplusTableColumn *tc = (AplusTableColumn *)o_; tc->breakProcessOn(a_); } static I g_fieldBreakProcessOn(MSWidgetView *o_) { AplusTableColumn *tc = (AplusTableColumn *)o_; return MSTrue==tc->breakProcessOn() ? 1 : 0; } ////////////////////////////////////////////////////////////////////////////// static void s_fieldBreakStyle(MSWidgetView *o_, A a_) { AplusTableColumn *tc = (AplusTableColumn *)o_; tc->breakStyle(GUIEnum.formatStyle(a_)); } static A g_fieldBreakStyle(MSWidgetView *o_) { AplusTableColumn *tc = (AplusTableColumn *)o_; return GUIEnum.formatStyle(tc->breakStyle()); } static void s_fieldBreakStyleFunc(MSWidgetView *o_, A fc_) { AplusTableColumn *tc = (AplusTableColumn *)o_; V v = (tc->model()!=0)?((AplusModel*)tc->model())->aplusVar():0; if (fc_->t==Et&&fc_->n==2) { AClientData *ac=new AClientData((A)fc_->p[0],(A)fc_->p[1]); tc->breakStyleFunc((AFunc)cdipv,ac); } else if (isNull(fc_)==MSTrue) tc->breakStyleFunc((AFunc)0,0); else showError("Invalid 'field' BreakStyle Function Specification"); } static A g_fieldBreakStyleFunc(MSWidgetView *o_) { A out = aplus_nl; AplusTableColumn *tc = (AplusTableColumn *)o_; V v = (tc->model()!=0)?((AplusModel*)tc->model())->aplusVar():0; out = (A)getVarFunc(tc->breakStyleFunc()->arg()); return out; } ////////////////////////////////////////////////////////////////////////////// static void s_fieldFgGrayScale(MSWidgetView *o_, A value_) { AplusTableColumn *tc = (AplusTableColumn *)o_; if(!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; tc->fgGrayScale(value_->t==Ft?p.f[0]:(double)p.i[0]); } } static A g_fieldFgGrayScale(MSWidgetView *o_) { AplusTableColumn *tc = (AplusTableColumn *)o_; return (A) gf(tc->fgGrayScale()); } static void s_fieldFgGrayScaleFunc(MSWidgetView *o_, A fc_) { AplusTableColumn *tc = (AplusTableColumn *)o_; V v = (tc->model()!=0)?((AplusModel*)tc->model())->aplusVar():0; if (fc_->t==Et&&fc_->n==2) { AClientData *ac=new AClientData((A)fc_->p[0],(A)fc_->p[1]); tc->fgGrayScaleFunc((AFunc)cdipv,ac); } else if (isNull(fc_)==MSTrue) tc->fgGrayScaleFunc((AFunc)0,0); else showError("Invalid 'field' FgGrayScale Function Specification"); } static A g_fieldFgGrayScaleFunc(MSWidgetView *o_) { A out = aplus_nl; AplusTableColumn *tc = (AplusTableColumn *)o_; V v = (tc->model()!=0)?((AplusModel*)tc->model())->aplusVar():0; out = (A)getVarFunc(tc->fgGrayScaleFunc()->arg()); return out; } ////////////////////////////////////////////////////////////////////////////// static void s_fieldBreakFgGrayScale(MSWidgetView *o_, A value_) { AplusTableColumn *tc = (AplusTableColumn *)o_; if(!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; tc->breakFgGrayScale(value_->t==Ft?p.f[0]:(double)p.i[0]); } } static A g_fieldBreakFgGrayScale(MSWidgetView *o_) { AplusTableColumn *tc = (AplusTableColumn *)o_; return (A) gf(tc->breakFgGrayScale()); } static void s_fieldBreakFgGrayScaleFunc(MSWidgetView *o_, A fc_) { AplusTableColumn *tc = (AplusTableColumn *)o_; V v = (tc->model()!=0)?((AplusModel*)tc->model())->aplusVar():0; if (fc_->t==Et&&fc_->n==2) { AClientData *ac=new AClientData((A)fc_->p[0],(A)fc_->p[1]); tc->fgGrayScaleFunc((AFunc)cdipv,ac); } else if (isNull(fc_)==MSTrue) tc->breakFgGrayScaleFunc((AFunc)0,0); else showError("Invalid 'field' BreakFgGrayScale Function Specification"); } static A g_fieldBreakFgGrayScaleFunc(MSWidgetView *o_) { A out = aplus_nl; AplusTableColumn *tc = (AplusTableColumn *)o_; V v = (tc->model()!=0)?((AplusModel*)tc->model())->aplusVar():0; out = (A)getVarFunc(tc->breakFgGrayScaleFunc()->arg()); return out; } ////////////////////////////////////////////////////////////////////////////// static void s_fieldBreakProcessFunc(MSWidgetView *o_, A fc_) { AplusTableColumn *tc = (AplusTableColumn *)o_; V v = (tc->model()!=0)?((AplusModel*)tc->model())->aplusVar():0; if (fc_->t==Et&&fc_->n==2) { AClientData *ac=new AClientData((A)fc_->p[0],(A)fc_->p[1]); tc->breakProcessFunc((AFunc)cdipv,ac); } else if (isNull(fc_)==MSTrue) tc->breakProcessFunc((AFunc)0,0); else showError("Invalid 'field' BreakProcess Function Specification"); } static A g_fieldBreakProcessFunc(MSWidgetView *o_) { A out = aplus_nl; AplusTableColumn *tc = (AplusTableColumn *)o_; V v = (tc->model()!=0)?((AplusModel*)tc->model())->aplusVar():0; out = (A)getVarFunc(tc->breakProcessFunc()->arg()); return out; } static void s_fieldFormatBreakFunc(MSWidgetView *o_, A fc_) { AplusTableColumn *tc = (AplusTableColumn *)o_; V v = (tc->model()!=0)?((AplusModel*)tc->model())->aplusVar():0; if (fc_->t==Et&&fc_->n==2) { AClientData *ac=new AClientData((A)fc_->p[0],(A)fc_->p[1]); tc->formatBreakFunc((AFunc)cdipv,ac); } else if (isNull(fc_)==MSTrue) tc->formatBreakFunc((AFunc)0,0); else showError("Invalid 'field' FormatBreak Function Specification"); } static A g_fieldFormatBreakFunc(MSWidgetView *o_) { A out = aplus_nl; AplusTableColumn *tc = (AplusTableColumn *)o_; V v = (tc->model()!=0)?((AplusModel*)tc->model())->aplusVar():0; out = (A)getVarFunc(tc->formatBreakFunc()->arg()); return out; } static void s_fieldBreakCriteriaFunc(MSWidgetView *o_, A fc_) { AplusTableColumn *tc = (AplusTableColumn *)o_; V v = (tc->model()!=0)?((AplusModel*)tc->model())->aplusVar():0; if (fc_->t==Et&&fc_->n==2) { AClientData *ac=new AClientData((A)fc_->p[0],(A)fc_->p[1]); tc->breakCriteriaFunc((AFunc)cdipv,ac); } else if (isNull(fc_)==MSTrue) tc->breakCriteriaFunc((AFunc)0,0); else showError("Invalid 'field' FormatBreak Function Specification"); } static A g_fieldBreakCriteriaFunc(MSWidgetView *o_) { A out = aplus_nl; AplusTableColumn *tc = (AplusTableColumn *)o_; V v = (tc->model()!=0)?((AplusModel*)tc->model())->aplusVar():0; out = (A)getVarFunc(tc->breakCriteriaFunc()->arg()); return out; } ////////////////////////////////////////////////////////////////////////////// static void s_fieldHeadingStyle(MSWidgetView *o_, A a_) { AplusTableColumn *tc = (AplusTableColumn *)o_; tc->headingStyle(GUIEnum.formatStyle(a_)); } static A g_fieldHeadingStyle(MSWidgetView *o_) { AplusTableColumn *tc = (AplusTableColumn *)o_; return GUIEnum.formatStyle(tc->headingStyle()); } static void s_fieldHeadingFgGrayScale(MSWidgetView *o_, A value_) { AplusTableColumn *tc = (AplusTableColumn *)o_; if(!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; tc->headingFgGrayScale(value_->t==Ft?p.f[0]:(double)p.i[0]); } } static A g_fieldHeadingFgGrayScale(MSWidgetView *o_) { AplusTableColumn *tc = (AplusTableColumn *)o_; return (A) gf(tc->headingFgGrayScale()); } static void s_fieldHeadingBgGrayScale(MSWidgetView *o_, A value_) { AplusTableColumn *tc = (AplusTableColumn *)o_; if(!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; tc->headingBgGrayScale(value_->t==Ft?p.f[0]:(double)p.i[0]); } } static A g_fieldHeadingBgGrayScale(MSWidgetView *o_) { AplusTableColumn *tc = (AplusTableColumn *)o_; return (A) gf(tc->headingBgGrayScale()); } static void s_fieldPageBreakOn(MSWidgetView *o_, MSBoolean a_) { AplusTableColumn *tc = (AplusTableColumn *)o_; tc->pageBreakOn(a_); } static I g_fieldPageBreakOn(MSWidgetView *o_) { AplusTableColumn *tc = (AplusTableColumn *)o_; return MSTrue==tc->pageBreakOn() ? 1 : 0; } ////////////////////////////////////////////////////////////////////////////// static void s_fieldReportFont(MSWidgetView *o_, A a_) { AplusTableColumn *tc = (AplusTableColumn *)o_; tc->reportFont(AplusConvert::asMSString(a_)); } static A g_fieldReportFont(MSWidgetView *o_) { AplusTableColumn *tc = (AplusTableColumn *)o_; return AplusConvert::asA(MSString(tc->reportFont())); } static void s_fieldReportFontFunc(MSWidgetView *o_, A fc_) { AplusTableColumn *tc = (AplusTableColumn *)o_; V v = (tc->model()!=0)?((AplusModel*)tc->model())->aplusVar():0; if (fc_->t==Et&&fc_->n==2) { AClientData *ac=new AClientData((A)fc_->p[0],(A)fc_->p[1]); tc->reportFontFunc((AFunc)cdipv,ac); } else if (isNull(fc_)==MSTrue) tc->reportFontFunc((AFunc)0,0); else showError("Invalid 'field' ReportFont Function Specification"); } static A g_fieldReportFontFunc(MSWidgetView *o_) { A out = aplus_nl; AplusTableColumn *tc = (AplusTableColumn *)o_; V v = (tc->model()!=0)?((AplusModel*)tc->model())->aplusVar():0; out = (A)getVarFunc(tc->reportFontFunc()->arg()); return out; } ////////////////////////////////////////////////////////////////////////////// static void s_fieldReportHeadingFont(MSWidgetView *o_, A a_) { AplusTableColumn *tc = (AplusTableColumn *)o_; tc->reportHeadingFont(AplusConvert::asMSString(a_)); } static A g_fieldReportHeadingFont(MSWidgetView *o_) { AplusTableColumn *tc = (AplusTableColumn *)o_; return AplusConvert::asA(tc->reportHeadingFont()); } ////////////////////////////////////////////////////////////////////////////// static void s_fieldStyle(MSWidgetView *o_, A a_) { AplusTableColumn *tc = (AplusTableColumn *)o_; tc->style(GUIEnum.formatStyle(a_)); } static A g_fieldStyle(MSWidgetView *o_) { AplusTableColumn *tc = (AplusTableColumn *)o_; return GUIEnum.formatStyle(tc->style()); } static void s_fieldStyleFunc(MSWidgetView *o_, A fc_) { AplusTableColumn *tc = (AplusTableColumn *)o_; V v = (tc->model()!=0)?((AplusModel*)tc->model())->aplusVar():0; if (fc_->t==Et&&fc_->n==2) { AClientData *ac=new AClientData((A)fc_->p[0],(A)fc_->p[1]); tc->styleFunc((AFunc)cdipv,ac); } else if (isNull(fc_)==MSTrue) tc->styleFunc((AFunc)0,0); else showError("Invalid 'field' Style Function Specification"); } static A g_fieldStyleFunc(MSWidgetView *o_) { A out = aplus_nl; AplusTableColumn *tc = (AplusTableColumn *)o_; V v = (tc->model()!=0)?((AplusModel*)tc->model())->aplusVar():0; out = (A)getVarFunc(tc->styleFunc()->arg()); return out; } static void s_fieldSuppressDuplicate(MSWidgetView *o_, MSBoolean suppress_) { AplusTableColumn *tc = (AplusTableColumn *)o_; tc->suppressDuplicate(suppress_); } static I g_fieldSuppressDuplicate(MSWidgetView *o_) { AplusTableColumn *tc = (AplusTableColumn *)o_; return MSTrue==tc->suppressDuplicate()? 1 : 0; } static void s_fieldComputationMode(MSWidgetView *o_, A cm_) { AplusTableColumn *tc = (AplusTableColumn *)o_; tc->compMode(GUIEnum.formatCompMode(cm_)); } static A g_fieldComputationMode(MSWidgetView *o_) { AplusTableColumn *tc = (AplusTableColumn *)o_; return GUIEnum.formatCompMode(tc->compMode()); } static void s_fieldHeadingFg(MSTableColumn *pColumn_, unsigned long value_) { pColumn_->headingForeground(value_); } static unsigned long g_fieldHeadingFg(MSTableColumn *pColumn_) { return pColumn_->headingForeground(); } static void s_fieldHeading(MSTableColumn *pColumn_, A value_) { pColumn_->heading(AplusConvert::asMSStringVector(value_)); } static A g_fieldHeading(MSTableColumn *pColumn_) { return AplusConvert::asA(pColumn_->heading()); } // Table Column Reporting functions static void s_fieldBreakString(MSTableColumn *pColumn_, A value_) { pColumn_->breakString(AplusConvert::asMSStringVector(value_)); } static A g_fieldBreakString(MSTableColumn *pColumn_) { return AplusConvert::asA(pColumn_->breakString()); } static A g_fieldBreakIndex(const MSTableColumn *pColumn_) { return AplusConvert::asA(pColumn_->breakIndex()); } static void s_fieldBreakFg(MSTableColumn *pColumn_, A value_) { if (value_->t==Et && value_->n==1 && QS(*value_->p)) { pColumn_->breakFg(((S)XS(*value_->p))->n); } else if (value_->t==Ct) { pColumn_->breakFg((char *)value_->p); } } static A g_fieldBreakFg(MSTableColumn *pColumn_) { return AplusConvert::asA(pColumn_->breakFgString()); } static void s_fieldBreakBg(MSTableColumn *pColumn_, A value_) { if (value_->t==Et && value_->n==1 && QS(*value_->p)) { pColumn_->breakBg(((S)XS(*value_->p))->n); } else if (value_->t==Ct) { pColumn_->breakBg((char *)value_->p); } } static A g_fieldBreakBg(MSTableColumn *pColumn_) { return AplusConvert::asA(pColumn_->breakBgString()); } ////////////////////////////////////////////////////////////////////////////// // AXHMenu 'A' interface functions static void s_hmenuMnemonics(AplusMenu *o_, A mnemonics_) { o_->mnemonics(mnemonics_); } static A g_hmenuMnemonics(AplusMenu *o_) { return o_->mnemonics(); } // AXChoice 'A' interface functions /* MSOptionMenu */ static void s_choiceNumCols(AplusChoice *o_,int n_) { o_->columns(n_); } static I g_choiceNumCols(AplusChoice *o_) { return (I) o_->columns(); } // AXCross 'A' interface functions /* AplusMatrix */ static void s_matrixRowIndex(AplusMatrix *o_,A a_) { o_->rowIndex(a_); } static A g_matrixRowIndex(AplusMatrix *o_) { return o_->rowIndexVector(); } static void s_matrixColIndex(AplusMatrix *o_,A a_) { o_->colIndex(a_); } static A g_matrixColIndex(AplusMatrix *o_) { return o_->colIndexVector(); } static void s_matrixCornerIndex(AplusMatrix *o_,MSBoolean b_){o_->cornerIndex(b_);} static I g_matrixCornerIndex(AplusMatrix *o_) { return MSTrue==o_->cornerIndex() ? 1 : 0; } static void s_matrixRowIndexBg(AplusMatrix *o_,unsigned long bg_) { o_->rowIndexBg(bg_); } static unsigned long g_matrixRowIndexBg(AplusMatrix *o_) {return o_->rowIndexBg();} static void s_matrixColIndexBg(AplusMatrix *o_,unsigned long bg_) { o_->colIndexBg(bg_); } static unsigned long g_matrixColIndexBg(AplusMatrix *o_) {return o_->colIndexBg();} static void s_matrixCornerIndexBg(AplusMatrix *o_,unsigned long bg_) { o_->cornerIndexBg(bg_); } static unsigned long g_matrixCornerIndexBg(AplusMatrix *o_) { return o_->cornerIndexBg(); } static I g_matrixNumHeadingRows(AplusMatrix *mp_) { return (I) mp_->numHeadings(); } static void s_matrixNumHeadingRows(AplusMatrix *mp_,int num_) { mp_->numHeadings(num_); } static A g_matrixColSpace(AplusMatrix *mp_) { return mp_->colSpace(); } static void s_matrixColSpace(AplusMatrix *mp_,A a_) { mp_->colSpace(a_); } static void s_matrixColSpaceFunc(AplusMatrix *o_,A fc_) { if (fc_->t==Et&&fc_->n==2) { I f=fc_->p[0]; I c=fc_->p[1]; AClientData *ac=new AClientData((A)f,(A)c); o_->spaceFunc((AFunc)cdipv,ac); } else if (isNull(fc_)==MSTrue) o_->spaceFunc((AFunc)0,0); else showError("Invalid 'colSpace' Function Specification"); } static A g_matrixColSpaceFunc(AplusMatrix *o_) { return (A)getVarFunc((AClientData *)o_->spaceFunc()->arg()); } // AXSObject 'A' interface functions /* MSRowColumnView */ static I g_numVisibleRows(MSRowColumnView *mp_) { return (I) mp_->rows(); } static void s_numVisibleRows(MSRowColumnView *mp_,int num_) {mp_->rows(num_); } static I g_numVisibleCols(MSRowColumnView *mp_) { return (I) mp_->columns(); } static void s_numVisibleCols(MSRowColumnView *mp_,int num_) {mp_->columns(num_); } static void s_arrayCycleFunc(MSRowColumnView *o_, A fc_) { V v = (o_->model()!=0)?((AplusModel*)o_->model())->aplusVar():0; AVariableData *varData = pAVarDataFromV(v); if (varData) { if (fc_->t==Et&&fc_->n==2) { AClientData *ac=new AClientData((A)fc_->p[0],(A)fc_->p[1]); varData->cycleFunc((AFunc)cdipv,ac); } else if (isNull(fc_)==MSTrue) varData->cycleFunc((AFunc)0,0); else showError("Invalid 'array' Cycle Function Specification"); } } static A g_arrayCycleFunc(MSRowColumnView *o_) { A out = aplus_nl; V v = (o_->model()!=0)?((AplusModel*)o_->model())->aplusVar():0; AVariableData *varData = pAVarDataFromV(v); if (varData) { out = (A)getVarFunc(varData->cycleFunc()->arg()); } return out; } static void s_arrayCycleColors(MSRowColumnView *o_,A a_) { if (QA(a_)) { MSUnsignedLongVector uv; for (unsigned i = 0; i < a_->n; i++) uv << (unsigned long) a_->p[i]; o_->cycleColors(uv); } } static A g_arrayCycleColors(MSRowColumnView *o_) { A cv = aplus_nl; MSUnsignedLongVector uv= o_->cycleColors(); if (uv.length() > 0) { long d[MAXR]={ 0, 0, 0, 0, 0, 0, 0, 0, 0 }; d[0]=uv.length(); cv = ga(It, 1, uv.length(), d); for(unsigned i = 0; i < uv.length(); i++) { cv->p[i] = (unsigned long)uv(i); } } return cv; } static void s_arrayCycleInterval(MSRowColumnView *o_,unsigned long i_) { o_->cycleInterval(i_); } static unsigned long g_arrayCycleInterval(MSRowColumnView *o_) { return o_->cycleInterval(); } static void s_arrayCycleColorMode(MSRowColumnView *o_, A cm_) { MSCycleColorMode mode=GUIEnum.cycleColorMode(cm_); if (-1!=(int)mode) o_->cycleColorMode(mode); } static A g_arrayCycleColorMode(MSRowColumnView *o_) { return GUIEnum.cycleColorMode(o_->cycleColorMode()); } static void s_arrayVsbBg(MSRowColumnView *o_,unsigned long pixel_) { o_->vsbBackground(pixel_); } static void s_arrayHsbBg(MSRowColumnView *o_,unsigned long pixel_) { o_->hsbBackground(pixel_); } static unsigned long g_arrayVsbBg(MSRowColumnView *o_) {return o_->vsbBackground();} static unsigned long g_arrayHsbBg(MSRowColumnView *o_) {return o_->hsbBackground();} static void s_arrayRowBg(MSRowColumnView *o_,unsigned long p_) { o_->selectedRowBackground(p_); } static void s_arraySelectVectorBg(MSRowColumnView *o_,unsigned long p_) // Supported by Selection Vector { o_->selectedRowBackground(p_); } static unsigned long g_arrayRowBg(MSRowColumnView *o_){return o_->selectedRowBackground();} static unsigned long g_arraySelectVectorBg(MSRowColumnView *o_) { return o_->selectedRowBackground();} static void s_arrayEditorBg(MSRowColumnView *o_,unsigned long p_) { o_->editorBackground(p_); } static void s_arrayEditorFg(MSRowColumnView *o_,unsigned long p_) { o_->editorForeground(p_); } static unsigned long g_arrayEditorBg(MSRowColumnView *o_) { return o_->editorBackground(); } static unsigned long g_arrayEditorFg(MSRowColumnView *o_) { return o_->editorForeground(); } static void s_arraySelectRow(MSRowColumnView *o_,int row_) { if(MSFalse==o_->editing())o_->selectedRow(row_); else showError("Invalid row selection: array in edit mode"); } static void s_arrayFirstRow(MSRowColumnView *o_,int row_) { o_->firstRow(row_); } static void s_arrayFirstCol(MSRowColumnView *o_,int col_) { o_->firstColumn(col_); } static void s_arraySbSize(MSRowColumnView *o_,int size_) { o_->vsbSize(size_); o_->hsbSize(size_); } static void s_arrayHsbSize(MSRowColumnView *o_,int size_) { o_->hsbSize(size_); } static void s_arrayVsbSize(MSRowColumnView *o_,int size_) { o_->vsbSize(size_); } static I g_arraySelectRow(MSRowColumnView *o_) { return (I) o_->selectedRow(); } static I g_arrayFirstRow(MSRowColumnView *o_) { return (I) o_->firstRow(); } static I g_arrayFirstCol(MSRowColumnView *o_) { return (I) o_->firstColumn(); } static I g_arraySbSize(MSRowColumnView *o_) { return (I) o_->hsbSize(); } static I g_arrayHsbSize(MSRowColumnView *o_) { return (I) o_->hsbSize(); } static I g_arrayVsbSize(MSRowColumnView *o_) { return (I) o_->vsbSize(); } static void s_arraySelectionMode(MSRowColumnView *o_,A sym_) { if (!QS(sym_)&&(sym_->t==Et&&sym_->n>0&&QS(*sym_->p))) { if (strcmp((char *) XS(sym_->p[0])->n, "single") == 0) o_->selectionMode(MSSingle); else if (strcmp((char *) XS(sym_->p[0])->n, "multiple") == 0) o_->selectionMode(MSMultiple); } } static A g_arraySelectionMode(MSRowColumnView *o_) { MSSelectionMode mod = o_->selectionMode(); A a=gs(Et); if (mod == MSMultiple) *a->p=MS(si("multiple")); else *a->p=MS(si("single")); return a; } static I g_arrayEdit(MSRowColumnView *o_) {return MSTrue==o_->editing() ? 1 : 0;} static void s_arrayEdit(MSRowColumnView *o_,MSBoolean b_) { if (b_==MSTrue) o_->edit(); else { o_->editorActivate(); } return; } static void s_arraySelectVector(MSRowColumnView *o_,A a_) { MSIndexVector iv; unsigned *d = (a_&&(a_->t == It))?(unsigned*)a_->p:0; int n = ((int) a_->n > 0)? (int) a_->n: 0; if (d) for(;n>0;n--,d++) iv<<(unsigned)*d; o_->selectionVector(iv); } static A g_arraySelectVector(MSRowColumnView *o_) // Convert IndexVector to A { A sv = aplus_nl; MSIndexVector uv= o_->selectionVector(); long d[MAXR]={ 0, 0, 0, 0, 0, 0, 0, 0, 0 }; d[0] = uv.length(); sv = ga(It, 1, uv.length(), d); for(unsigned i = 0; i < uv.length(); i++) { sv->p[i] = (unsigned long)uv(i); } return sv; } // /* MSArrayView */ static void s_arraySelectBg(MSArrayView *o_,unsigned long p_) {o_->selectedCellBackground(p_);} static unsigned long g_arraySelectBg(MSArrayView *o_) {return o_->selectedCellBackground(); } static void s_arraySelectCol(MSArrayView *o_,int col_) { if(MSFalse==o_->editing())o_->selectedColumn(col_); else showError("Invalid column selection: array in edit mode"); } static I g_arraySelectCol(MSArrayView *o_) { return (I) o_->selectedColumn(); } static void s_arraySeparatorInterval(MSArrayView *o_,int inc_) {o_->rowSeparator(inc_); } static I g_arraySeparatorInterval(MSArrayView *o_) {return (I) o_->rowSeparator();} static void s_arrayColSeparator(MSArrayView *o_,int inc_) {o_->columnSeparator(inc_);} static I g_arrayColSeparator(MSArrayView *o_) {return (I) o_->columnSeparator();} // AXTable fns /* MSTable */ static void s_tableNumFixedFields(MSArrayView *o_,int n_) { o_->fixedColumns(n_); } static I g_tableNumFixedFields(MSArrayView *o_) {return (I) o_->fixedColumns(); } static void s_tableColumnDragDrop(MSArrayView *o_, MSBoolean b_) { ((MSTable *)o_)->columnDragDrop(b_); } static I g_tableColumnDragDrop(MSArrayView *o_) { return MSTrue==((MSTable *)o_)->columnDragDrop() ? 1 : 0; } static void s_tableColumnResize(MSArrayView *o_, MSBoolean b_) { ((MSTable *)o_)->columnResize(b_); } static I g_tableColumnResize(MSArrayView *o_) { return MSTrue==((MSTable *)o_)->columnResize() ? 1 : 0; } static void s_tableBreakFont(MSArrayView *o_, A x_) { ((MSTable *) o_)->breakFont(AplusConvert::asMSString(x_)); } static A g_tableBreakFont(MSArrayView *o_) { return AplusConvert::asA(((MSTable *) o_)->breakFont()); } static void s_tableBreakStyle(MSArrayView *o_, A x_) { ((MSTable *) o_)->breakStyle(GUIEnum.formatStyle(x_)); } static A g_tableBreakStyle(MSArrayView *o_) { return GUIEnum.formatStyle(((MSTable *) o_)->breakStyle()); } static void s_tableFixedReportColumns(MSArrayView *o_, int x_) { ((MSTable *) o_)->MSReportTable::fixedReportColumns(x_); } static I g_tableFixedReportColumns(MSArrayView *o_) { return (I) ((MSTable *) o_)->fixedReportColumns(); } static void s_tableGroupHeading(MSArrayView *o_, A x_) { if(o_ && x_ && QA(x_)) if( isNull(x_)==MSTrue ) { // add a dummy entry so can do a removeAllGroupHeadngs ((MSTable *) o_)->MSReportTable::addGroupHeading("dummy"); ((MSTable *) o_)->MSReportTable::removeAllGroupHeadings(); } else if(x_->t==Et && QS(x_->p[0])) // single (`groupheading;`a) { // add a dummy entry so can do a removeAllGroupHeadngs ((MSTable *) o_)->MSReportTable::addGroupHeading("dummy"); ((MSTable *) o_)->MSReportTable::removeAllGroupHeadings(); AplusParagraph *ap = ((AplusParagraph *)getVarData(x_)->pWidgetView()); if(ap && ap->widgetType()==AplusParagraph::symbol()) { ((MSTable *) o_)->MSReportTable::addGroupHeading(*ap). text(AplusConvert::asMSStringVector(ap->model()->a())). column(ap->column()). columnSpan(ap->columnSpan()); } } else // vector (`groupheading;(`a;`b;`c)) { int i; // add a dummy entry so can do a removeAllGroupHeadngs ((MSTable *) o_)->MSReportTable::addGroupHeading("dummy"); ((MSTable *) o_)->MSReportTable::removeAllGroupHeadings(); for( i=0; in; i++) { A ax=(A)x_->p[i]; if( ax && QA(ax) && ax->t==Et && QS(ax->p[0]) ) { AplusParagraph *ap = ((AplusParagraph *)getVarData(ax)->pWidgetView()); if(ap && ap->widgetType()==AplusParagraph::symbol()) { ((MSTable *) o_)->MSReportTable::addGroupHeading(*ap). text(AplusConvert::asMSStringVector(ap->model()->a())). column(ap->column()). columnSpan(ap->columnSpan()); } } } } } static A g_tableGroupHeading(MSArrayView *o_) { return aplus_nl; } static I g_tableGrandTotal(MSArrayView *o_) { return (I) ((MSTable *) o_)->grandTotal(); } static I g_tableCurrentBreakColumn(MSArrayView *o_) { MSTable *t=(MSTable *) o_; if (t->breakColumn().length()>0) return (I) t->breakColumn().lastElement(); return -1; } static void s_tableGrandTotalText(MSArrayView *o_, A sym_, A printText_) { AplusTable *t = (AplusTable *) o_; if (QA(printText_) && printText_->t==It && printText_->n==1) { P p; p.i=printText_->p; AplusPrintText *pt = (AplusPrintText *) p.i[0]; t->grandTotalText() =*pt; // FIX THIS t->grandTotalTextA((A) ic(sym_)); delete pt; } } static A g_tableGrandTotalText(MSArrayView *o_) { return (A) ic(((AplusTable *)o_)->grandTotalTextA()); } static void s_tableHeadingStyle(MSArrayView *o_, A x_) { ((MSTable *) o_)->headingStyle(GUIEnum.formatStyle(x_)); } static A g_tableHeadingStyle(MSArrayView *o_) { return GUIEnum.formatStyle(((MSTable *) o_)->headingStyle()); } static void s_tableReportFont(MSArrayView *o_, A x_) { ((MSTable *) o_)->reportFont(AplusConvert::asMSString(x_)); } static A g_tableReportFont(MSArrayView *o_) { return AplusConvert::asA(((MSTable *) o_)->reportFont()); } static void s_tableReportGrandTotalOn(MSArrayView *o_, MSBoolean x_) { ((MSTable *) o_)->reportGrandTotalOn(x_); } static I g_tableReportGrandTotalOn(MSArrayView *o_) { return MSTrue==((MSTable *) o_)->reportGrandTotalOn() ? 1 : 0; } static void s_tableReportHeadingFont(MSArrayView *o_, A x_) { ((MSTable *) o_)->reportHeadingFont(AplusConvert::asMSString(x_)); } static A g_tableReportHeadingFont(MSArrayView *o_) { return AplusConvert::asA(((MSTable *) o_)->reportHeadingFont()); } static void s_tableReportTotalOn(MSArrayView *o_, MSBoolean x_) { ((MSTable *) o_)->reportTotalOn(x_); } static I g_tableReportTotalOn(MSArrayView *o_) { return MSTrue==((MSTable *) o_)->reportTotalOn() ? 1 : 0; } static void s_tableReportTotalFont(MSArrayView *o_, A x_) { ((MSTable *) o_)->reportTotalFont(AplusConvert::asMSString(x_)); } static A g_tableReportTotalFont(MSArrayView *o_) { return AplusConvert::asA(((MSTable *) o_)->reportTotalFont()); } static void s_tableReportTotalLeading(MSArrayView *o_, int x_) { ((MSTable *) o_)->reportTotalLeading(x_); } static I g_tableReportTotalLeading(MSArrayView *o_) { return (I) ((MSTable *) o_)->reportTotalLeading(); } static void s_tableReportTotalStyle(MSArrayView *o_, A x_) { ((MSTable *) o_)->reportTotalStyle(GUIEnum.formatStyle(x_)); } static A g_tableReportTotalStyle(MSArrayView *o_) { return GUIEnum.formatStyle(((MSTable *) o_)->reportTotalStyle()); } static void s_tableStyle(MSArrayView *o_, A x_) { ((MSTable *) o_)->style(GUIEnum.formatStyle(x_)); } static A g_tableStyle(MSArrayView *o_) { return GUIEnum.formatStyle(((MSTable *) o_)->style()); } static void s_tableRowControl(MSArrayView *o_, A vals_) { ((MSTable *)o_)->rowControl(AplusConvert::asMSUnsignedVector(vals_)); } static A g_tableRowControl(MSArrayView *o_) { return AplusConvert::asA(((MSTable *)o_)->rowControl()); } static void s_tableRowPageSpan(MSArrayView *o_, int rowPageSpan_) { ((MSTable *)o_)->rowPageSpan(rowPageSpan_); } static I g_tableRowPageSpan(MSArrayView *o_) { return (I) ((MSTable *)o_)->rowPageSpan(); } static void s_tableColumnControl(MSArrayView *o_, A vals_) { ((MSTable *)o_)->columnControl(AplusConvert::asMSUnsignedVector(vals_)); } static A g_tableColumnControl(MSArrayView *o_) { return AplusConvert::asA(((MSTable *)o_)->columnControl()); } static void s_tableColumnPageSpan(MSArrayView *o_, unsigned columnPageSpan_) { ((MSTable *)o_)->columnPageSpan(columnPageSpan_); } static I g_tableColumnPageSpan(MSArrayView *o_) { return (I) ((MSTable *)o_)->columnPageSpan(); } static void s_tableNewspaperColumn(MSArrayView *o_, int x_) { ((MSTable *) o_)->newspaperColumns(x_); } static I g_tableNewspaperColumn(MSArrayView *o_) { return (I) ((MSTable *) o_)->newspaperColumns(); } static A g_tableColumnSpacing(MSArrayView *o_) { return AplusConvert::asA(((MSTable *)o_)->reportColumnSpacing()); } static void s_tableColumnSpacing(MSArrayView *o_, A floats_) { ((MSTable *)o_)->reportColumnSpacing(AplusConvert::asMSFloatVector(floats_)); } static I g_tableFrameLineWidth(MSArrayView *o_) { return (I) ((MSTable *)o_)->frameLineWidth(); } static void s_tableFrameLineWidth(MSArrayView *o_, int flw_) { ((MSTable *)o_)->frameLineWidth(flw_); } static I g_tableFrameOffset(MSArrayView *o_) { return (I) ((MSTable *)o_)->frameOffset(); } static void s_tableFrameOffset(MSArrayView *o_, int fo_) { ((MSTable *)o_)->frameOffset(fo_); } static A g_tableFrameStyle(MSArrayView *o_) { return GUIEnum.formatStyle(((MSTable *)o_)->frameStyle()); } static void s_tableFrameStyle(MSArrayView *o_, A sym_) { ((MSTable *)o_)->frameStyle(GUIEnum.formatStyle(sym_)); } static A g_tableLeading(MSArrayView *o_) { return AplusConvert::asA(((MSTable *)o_)->leading()); } static void s_tableLeading(MSArrayView *o_, A vals_) { ((MSTable *)o_)->leading(AplusConvert::asMSUnsignedVector(vals_)); } static A g_tableOutputStyle(MSArrayView *o_) { A r=aplus_nl; int i,j,count=0; char *str; MSTable *t=(MSTable *) o_; unsigned long style = t->outputStyle(); for (i=2; i<=MSP::NoHeadings; i*=2) { if (GUIEnum.reportStyleEnumHashTable()->lookup((unsigned long)(style&i))!=0) count++; } if (count>0) { r=gv(Et,count); for (j=0,i=2; i<=MSP::NoHeadings; i*=2) { if ((str=(char*)GUIEnum.reportStyleEnumHashTable()->lookup((unsigned long)(style&i)))!=0) r->p[j++]=MS(si(str)); } } return r; } static void s_tableOutputStyle(MSArrayView *o_, A sym_) { MSTable *t=(MSTable *)o_; unsigned long style=0; if (sym_!=0) { A *p=(A *)sym_->p; for (int i=0; i<(int)sym_->n; i++) { char *s = (char *) XS(sym_->p[i])->n; if (QS(p[i])) style|=(unsigned long)GUIEnum.reportStyleStringHashTable()->lookup(s); else { cerr << " ! "; if (s!=0) cerr << s; cerr << ": invalid symbol" << endl; } } } t->outputStyle(style); } // Reporting methods static void s_tableLeftMargin(MSWidgetView *pWidget_, A value_) { if (!QS(value_)) { AplusTable *pTable = (AplusTable *)pWidget_; if (value_->t==Ft) // if it's a floating point value { pTable->leftMargin(*(double*)value_->p); } else if (value_->t==It) // it's an integer { pTable->leftMargin((double)*(I*)value_->p); } } } static A g_tableLeftMargin(MSWidgetView *pWidget_) { // A fix for a small MStk problem - to be fixed in MStk for release 2.6: // margins in inches are calculated based on the corresponding pixel offset values; // the default pixel offset is -1 (meaning that it's inherited from the report's pixel offset); // thus, the default margin is -0.0139, which is confusing to the user - it should also be -1. double margin = ((AplusTable *)pWidget_)->leftMargin(); return gf((margin<0)?-1:margin); } static void s_tableRightMargin(MSWidgetView *pWidget_, A value_) { if (!QS(value_)) { AplusTable *pTable = (AplusTable *)pWidget_; if (value_->t==Ft) // if it's a floating point value { pTable->rightMargin(*(double*)value_->p); } else if (value_->t==It) // it's an integer { pTable->rightMargin((double)*(I*)value_->p); } } } static A g_tableRightMargin(MSWidgetView *pWidget_) { // A fix for a small MStk problem - to be fixed in MStk for release 2.6: // margins in inches are calculated based on the corresponding pixel offset values; // the default pixel offset is -1 (meaning that it's inherited from the report's pixel offset); // thus, the default margin is -0.0139, which is confusing to the user - it should also be -1. double margin = ((AplusTable *)pWidget_)->rightMargin(); return gf((margin<0)?-1:margin); } static void s_tableTopOffset(MSWidgetView *pWidget_, A value_) { if (!QS(value_)) { AplusTable *pTable = (AplusTable *)pWidget_; if (value_->t==Ft) // if it's a floating point value { pTable->topOffset(*(double*)value_->p); } else if (value_->t==It) // it's an integer { pTable->topOffset((double)*(I*)value_->p); } } } static A g_tableTopOffset(MSWidgetView *pWidget_) { // A fix for an MStk bug to be fixed in MStk 2.6: // MSPrintItem::topOffset() and MSPrintItem::bottomOffset() methods do the cast to double incorrectly // so the decimal part gets truncated double offset = ((AplusTable *)pWidget_)->topPixel(); return gf(offset/MSPointsPerInch); } static void s_tableBottomOffset(MSWidgetView *pWidget_, A value_) { if (!QS(value_)) { AplusTable *pTable = (AplusTable *)pWidget_; if (value_->t==Ft) // if it's a floating point value { pTable->bottomOffset(*(double*)value_->p); } else if (value_->t==It) // it's an integer { pTable->bottomOffset((double)*(I*)value_->p); } } } static A g_tableBottomOffset(MSWidgetView *pWidget_) { // A fix for an MStk bug to be fixed in MStk 2.6: // MSPrintItem::topOffset() and MSPrintItem::bottomOffset() methods do the cast to double incorrectly // so the decimal part gets truncated double offset = ((AplusTable *)pWidget_)->bottomPixel(); return gf(offset/MSPointsPerInch); } static void s_tablePrintRow(MSWidgetView *pWidget_, int value_) { ((AplusTable *)pWidget_)->printRow(value_); } static I g_tablePrintRow(MSWidgetView *pWidget_) { return (I) ((AplusTable *)pWidget_)->printRow(); } static void s_tablePrintColumn(MSWidgetView *pWidget_, int value_) { ((AplusTable *)pWidget_)->printColumn(value_); } static I g_tablePrintColumn(MSWidgetView *pWidget_) { return (I) ((AplusTable *)pWidget_)->printColumn(); } static void s_tableJustify(MSWidgetView *pWidget_, A value_) { AplusAlignmentConverter converter; unsigned long justify = converter(value_); if (justify!=converter.enumNotFound()) { ((AplusTable *)pWidget_)->justification(justify); } } static A g_tableJustify(MSWidgetView *pWidget_) { AplusAlignmentConverter converter; return converter(((AplusTable *)pWidget_)->justification()); } static void s_tablePageAlign(MSWidgetView *pWidget_, A value_) { AplusAlignmentConverter converter; unsigned long align = converter(value_); if (align!=converter.enumNotFound()) { ((AplusTable *)pWidget_)->pageAlignment(align); } } static A g_tablePageAlign(MSWidgetView *pWidget_) { AplusAlignmentConverter converter; return converter(((AplusTable *)pWidget_)->pageAlignment()); } static A g_tableBreakTextColumn(MSWidgetView *pWidget_) { return AplusConvert::asA(((AplusTable *)pWidget_)->breakTextColumn()); } static A g_tableBreakColumn(MSWidgetView *pWidget_) { return AplusConvert::asA(((AplusTable *)pWidget_)->breakColumn()); } static A g_tableBreakIndex(MSWidgetView *pWidget_) { return AplusConvert::asA(((AplusTable *)pWidget_)->breakIndex()); } static A g_tablePageBreakIndex(MSWidgetView *pWidget_) { return AplusConvert::asA(((AplusTable *)pWidget_)->pageBreakIndex()); } static void s_tableFgGrayScale(MSWidgetView *pWidget_, A value_) { if (QS(value_)==0) { AplusTable *pTable = (AplusTable *)pWidget_; if (value_->t==Ft) // if it's a floating point value { pTable->fgGrayScale(*(double*)value_->p); } else if (value_->t==It) // it's an integer { pTable->fgGrayScale((double)*(I*)value_->p); } } } static A g_tableFgGrayScale(MSWidgetView *pWidget_) { return gf(((AplusTable *)pWidget_)->fgGrayScale()); } static void s_tableBgGrayScale(MSWidgetView *pWidget_, A value_) { if (QS(value_)==0) { AplusTable *pTable = (AplusTable *)pWidget_; if (value_->t==Ft) // if it's a floating point value { pTable->bgGrayScale(*(double*)value_->p); } else if (value_->t==It) // it's an integer { pTable->bgGrayScale((double)*(I*)value_->p); } } } static A g_tableBgGrayScale(MSWidgetView *pWidget_) { return gf(((AplusTable *)pWidget_)->bgGrayScale()); } static void s_tableHeadingFgGrayScale(MSWidgetView *pWidget_, A value_) { if (QS(value_)==0) { AplusTable *pTable = (AplusTable *)pWidget_; if (value_->t==Ft) // if it's a floating point value { pTable->headingFgGrayScale(*(double*)value_->p); } else if (value_->t==It) // it's an integer { pTable->headingFgGrayScale((double)*(I*)value_->p); } } } static A g_tableHeadingFgGrayScale(MSWidgetView *pWidget_) { return gf(((AplusTable *)pWidget_)->headingFgGrayScale()); } static void s_tableHeadingBgGrayScale(MSWidgetView *pWidget_, A value_) { if (QS(value_)==0) { AplusTable *pTable = (AplusTable *)pWidget_; if (value_->t==Ft) // if it's a floating point value { pTable->headingBgGrayScale(*(double*)value_->p); } else if (value_->t==It) // it's an integer { pTable->headingBgGrayScale((double)*(I*)value_->p); } } } static A g_tableHeadingBgGrayScale(MSWidgetView *pWidget_) { return gf(((AplusTable *)pWidget_)->headingBgGrayScale()); } static void s_tableBreakOffset(MSWidgetView *pWidget_, int value_) { ((AplusTable *)pWidget_)->breakOffset(value_); } static I g_tableBreakOffset(MSWidgetView *pWidget_) { return (I) ((AplusTable *)pWidget_)->breakOffset(); } static void s_tableBreakLeading(MSWidgetView *pWidget_, int value_) { ((AplusTable *)pWidget_)->breakLeading(value_); } static I g_tableBreakLeading(MSWidgetView *pWidget_) { return (I) ((AplusTable *)pWidget_)->breakLeading(); } static void s_tableReportHeadingOffset(MSWidgetView *pWidget_, int value_) { ((AplusTable *)pWidget_)->reportHeadingOffset(value_); } static I g_tableReportHeadingOffset(MSWidgetView *pWidget_) { return (I) ((AplusTable *)pWidget_)->reportHeadingOffset(); } static void s_tableComputeBreaks(MSWidgetView *pWidget_) { ((AplusTable *)pWidget_)->computeBreaks(); } static void s_tableDynamicRecompute(MSWidgetView *pWidget_, MSBoolean value_) { ((AplusTable *)pWidget_)->dynamicRecompute(value_); } static I g_tableDynamicRecompute(MSWidgetView *pWidget_) { return MSTrue==((AplusTable *)pWidget_)->dynamicRecompute() ? 1 : 0; } static void s_tableShowBreaks(MSWidgetView *pWidget_, MSBoolean value_) { ((AplusTable *)pWidget_)->showBreaks(value_); } static I g_tableShowBreaks(MSWidgetView *pWidget_) { return MSTrue==((AplusTable *)pWidget_)->showBreaks() ? 1 : 0; } static void s_tableHeadingFg(MSWidgetView *pWidget_, unsigned long value_) { ((AplusTable *)pWidget_)->headingForeground(value_); } static unsigned long g_tableHeadingFg(MSWidgetView *pWidget_) { return ((AplusTable *)pWidget_)->headingForeground(); } static void s_tableDelimiter(MSWidgetView *pWidget_, A value_) { AplusTable *pTable=(AplusTable *)pWidget_; if (isNull(value_)==MSTrue) { pTable->delimiter(" "); } else { pTable->delimiter(AplusConvert::asMSString(value_)); } } static A g_tableDelimiter(MSWidgetView *pWidget_) { return AplusConvert::asA(((AplusTable *)pWidget_)->delimiter()); } /*** MSReportTable::breakTextIndex() is protected in MStk 2.6; uncomment if it is made public in the future ***/ // //static A g_tableBreakTextIndex(MSWidgetView *pWidget_) //{ return AplusConvert::asA(((AplusTable *)pWidget_)->breakTextIndex()); } // XScrollW fns /* MSScrolledWindow */ static I g_windowSbSize(MSScrolledWindow *w_) { return (I) w_->scrollBarSize(); } static void s_windowSbSize(MSScrolledWindow *w_,int s_) { w_->scrollBarSize(s_); } static void s_windowVsbBg(MSScrolledWindow *w_,unsigned long p_) {w_->vsbBackground(p_); } static void s_windowHsbBg(MSScrolledWindow *w_,unsigned long p_) { w_->hsbBackground(p_); } static unsigned long g_windowVsbBg(MSScrolledWindow *) {return 0;} static unsigned long g_windowHsbBg(MSScrolledWindow *) {return 0;} //static unsigned long g_windowVsbBg(MSScrolledWindow *w_) {return w_->vsbBackground();} //static unsigned long g_windowHsbBg(MSScrolledWindow *w_) {return w_->hsbBackground();} // AXPushB fns /* MSButton */ static void s_buttonMargin(MSButton *btn_,int m_) { btn_->margin(m_); } static I g_buttonMargin(MSButton *btn_) { return (I) btn_->margin(); } // AXLabelM fns /* MSLabel */ static void s_labelMargin(AplusLabel *btn_,int m_) { btn_->margin(m_); } static I g_labelMargin(AplusLabel *btn_) { return (I) btn_->margin(); } // AXScalar fns /* MSEntryField */ static void s_scalarEditorBg(AplusEntryField *o_,unsigned long p_) { o_->editorBackground(p_); } static void s_scalarEditorFg(AplusEntryField *o_,unsigned long p_) { o_->editorForeground(p_); } static unsigned long g_scalarEditorBg(AplusEntryField *o_) { return o_->editorBackground(); } static unsigned long g_scalarEditorFg(AplusEntryField *o_){ return o_->editorForeground(); } static void s_scalarEdit(AplusEntryField *o_,MSBoolean b_){ (b_==MSTrue)?o_->edit():(void)o_->activateEditor(); } static I g_scalarEdit(AplusEntryField *o_) { return MSTrue==o_->editing() ? 1 : 0; } static void s_scalarArrowButtons(AplusEntryField *o_, MSBoolean b_) { o_->arrowButtons(b_); } static I g_scalarArrowButtons(AplusEntryField *o_) { return MSTrue==o_->arrowButtons() ? 1 : 0; } static void s_scalarCycleFunc(AplusEntryField *o_,A fc_) { V v = (o_->model()!=0)?((AplusModel*)o_->model())->aplusVar():0; AVariableData *varData = pAVarDataFromV(v); if (varData) { if (fc_->t==Et&&fc_->n==2) { AClientData *ac=new AClientData((A)fc_->p[0],(A)fc_->p[1]); varData->cycleFunc((AFunc)cdipv,ac); } else if (isNull(fc_)==MSTrue) varData->cycleFunc((AFunc)0,0); else showError("Invalid 'scalar' Cycle Function Specification"); } } static A g_scalarCycleFunc(AplusEntryField *o_) { A out = aplus_nl; V v = (o_->model()!=0)?((AplusModel*)o_->model())->aplusVar():0; AVariableData *varData = pAVarDataFromV(v); if (varData) { out = (A)getVarFunc(varData->cycleFunc()->arg()); } return out; } static void s_scalarCycleColors(AplusEntryField *o_,A a_) { if (QA(a_)) { MSUnsignedLongVector uv; for (unsigned i = 0; i < a_->n; i++) uv << (unsigned long) a_->p[i]; o_->cycleColors(uv); } } static A g_scalarCycleColors(AplusEntryField *o_) { A cv = aplus_nl; MSUnsignedLongVector uv= o_->cycleColors(); if (uv.length() > 0) { long d[MAXR]={ 0, 0, 0, 0, 0, 0, 0, 0, 0 }; d[0]=uv.length(); cv = ga(It, 1, uv.length(), d); for(unsigned i = 0; i < uv.length(); i++) { cv->p[i] = (unsigned long)uv(i); } } return cv; } static void s_scalarCycleInterval(AplusEntryField *o_,unsigned long i_) { o_->cycleInterval(i_); } static unsigned long g_scalarCycleInterval(AplusEntryField *o_) { return o_->cycleInterval(); } static void s_scalarValueBg(AplusEntryField *ef_, unsigned long bg_) { ef_->valueBackground(bg_); } static unsigned long g_scalarValueBg(AplusEntryField *ef_) { return ef_->valueBackground(); } static void s_scalarValueFont(AplusEntryField *ef_, Font font_) { ef_->valueFont(font_); } static Font g_scalarValueFont(AplusEntryField *ef_) { return ef_->valueFont(); } static void s_scalarValueAlign(AplusEntryField *ef_, A alignment_) { AplusAlignmentConverter converter; unsigned long align = converter(alignment_); if (align!=converter.enumNotFound()) { ef_->valueAlignment((MSAlignment)align); } } static A g_scalarValueAlign(AplusEntryField *ef_) { AplusAlignmentConverter converter; return converter(ef_->valueAlignment()); } static void s_scalarValueShadowStyle(AplusEntryField *ef_, A value_) { AplusShadowStyleConverter converter; unsigned long style = converter(value_); if (style!=converter.enumNotFound()) { ef_->valueShadowStyle((MSShadowStyle)style); } } static A g_scalarValueShadowStyle(AplusEntryField *ef_) { AplusShadowStyleConverter converter; return converter(ef_->valueShadowStyle()); } static void s_scalarValueShadowThickness(AplusEntryField *ef_, int value_) { ef_->valueShadowThickness(value_); } static I g_scalarValueShadowThickness(AplusEntryField *ef_) { return (I) ef_->valueShadowThickness(); } // cycleColorMode() method does not yet exist for MSEntryField, but will. // static void s_scalarCycleColorMode(AplusEntryField *o_, A cm_) // { o_->cycleColorMode(GUIEnum.cycleColorMode(cm_)); } // static A g_scalarCycleColorMode(AplusEntryField *o_) // { return GUIEnum.cycleColorMode(o_->cycleColorMode()); } // AXSlot fns static void s_slotCycleFunc(AplusSlot *o_,A fc_) { if (fc_->t==Et&&fc_->n==2) { AClientData *ac=new AClientData((A)fc_->p[0],(A)fc_->p[1]); o_->cycleFunc((AFunc)cdipv,ac); } else if (isNull(fc_)==MSTrue) o_->cycleFunc((AFunc)0,0); else showError("Invalid 'slot' Cycle Function Specification"); } static A g_slotCycleFunc(AplusSlot *o_) { return (A)getVarFunc((AClientData *)o_->cycleFunc()->arg()); } static void s_slotCycleColors(AplusSlot *o_,A a_) { o_->cycleColors(a_); } static A g_slotCycleColors(AplusSlot *o_) { return o_->cycleColors(); } static void s_slotCycleInterval(AplusSlot *o_,unsigned long i_) { o_->cycleInterval(i_); } static unsigned long g_slotCycleInterval(AplusSlot *o_) {return o_->cycleInterval(); } // cycleColorMode() method does not yet exist for MSEntryField, but will. // static void s_slotCycleColorMode(AplusSlot *o_, A cm_) // { o_->cycleColorMode(GUIEnum.cycleColorMode(cm_)); } // static A g_slotCycleColorMode(AplusSlot *o_) // { return GUIEnum.cycleColorMode(o_->cycleColorMode()); } static void s_slotEditorBg(AplusSlot *o_,unsigned long p_) { o_->editorBackground(p_); } static void s_slotEditorFg(AplusSlot *o_,unsigned long p_) { o_->editorForeground(p_); } static unsigned long g_slotEditorBg(AplusSlot *o_){return o_->editorBackground();} static unsigned long g_slotEditorFg(AplusSlot *o_){return o_->editorForeground();} static void s_slotEdit(AplusSlot *o_,MSBoolean b_) { (b_==MSTrue)?o_->startEditing():o_->stopEditing(); } static I g_slotEdit(AplusSlot *o_) { return MSTrue==o_->editing() ? 1 : 0; } static void s_slotSelected(AplusSlot *o_,int index_) { o_->selectedItem(index_); } static I g_slotSelected(AplusSlot *o_) { return (I) o_->selectedItem(); } static void s_slotHlColor(AplusSlot *o_, unsigned long c_) { o_->highlightColor(c_); } static unsigned long g_slotHlColor(AplusSlot *o_) { return o_->highlightColor(); } static void s_slotHlThickness(AplusSlot *o_, int t_) { o_->highlightThickness(t_); } static I g_slotHlThickness(AplusSlot *o_) { return (I) o_->highlightThickness(); } static void s_slotShadowThickness(AplusSlot *o_, int t_) { o_->shadowThickness(t_); } static I g_slotShadowThickness(AplusSlot *o_) { return (I) o_->shadowThickness(); } static void s_slotArrowButtons(AplusSlot *o_, A states_) { o_->arrowButtons((A)ic(states_)); } static A g_slotArrowButtons(AplusSlot *o_) { return (A)ic(o_->arrowButtons()); } // AXBox fns static void s_boxSelected(AplusButtonBox *o_,int index_) { o_->selectedItem(index_); } static I g_boxSelected(AplusButtonBox *o_) { return (I) o_->selectedItem(); } ////////////////////////////////////////////////////////////////////////////// // XTable extractor functions /* MSLayoutManager */ static void s_layoutRowSpace(MSLayoutManager *tp_,A x_) { if (!QS(x_)&&(x_->t==It||x_->t==Ft)) { P p; p.i=x_->p; tp_->rowSpacing((int)(x_->t==Ft?p.f[0]:p.i[0])); } } static A g_layoutRowSpace(MSLayoutManager *tp_) { A r=gf(tp_->rowSpacing()); return r; } static void s_layoutColSpace(MSLayoutManager *tp_,A x_) { if (!QS(x_)&&(x_->t==It||x_->t==Ft)) { P p; p.i=x_->p; tp_->columnSpacing((int)(x_->t==Ft?p.f[0]:p.i[0])); } } static A g_layoutColSpace(MSLayoutManager *tp_) { A r=gf(tp_->columnSpacing()); return r; } static I g_layoutRow(MSWidgetView *pWidgetView_) { MSLayoutManager *tp=(MSLayoutManager *) pWidgetView_->owner(); return (I) tp->row((MSWidgetView *)pWidgetView_); } static I g_layoutCol(MSWidgetView *pWidgetView_) { MSLayoutManager *tp=(MSLayoutManager *) pWidgetView_->owner(); return (I) tp->column((MSWidgetView *)pWidgetView_); } static I g_layoutHspan(MSWidgetView *pWidgetView_) { MSLayoutManager *tp=(MSLayoutManager *) pWidgetView_->owner(); return (I) tp->columnSpan((MSWidgetView *)pWidgetView_); } static I g_layoutVspan(MSWidgetView *pWidgetView_) { MSLayoutManager *tp=(MSLayoutManager *) pWidgetView_->owner(); return (I) tp->rowSpan((MSWidgetView *)pWidgetView_); } static unsigned long g_layoutOptions(MSWidgetView *pWidgetView_) { MSLayoutManager *tp=(MSLayoutManager *) pWidgetView_->owner(); return tp->options(pWidgetView_); } static I g_layoutUniformRows(MSLayoutManager *tb_) { return MSTrue==tb_->uniformRows() ? 1 : 0; } static I g_layoutUniformCols(MSLayoutManager *tb_) { return MSTrue==tb_->uniformColumns() ? 1 : 0; } static I g_layoutLockSize(MSLayoutManager *tb_) { return MSTrue==tb_->lockSize() ? 1 : 0; } static I g_layoutLockPositions(MSLayoutManager *tb_) {return MSTrue==tb_->lockPositions() ? 1 : 0;} static void s_layoutUniformRows(MSLayoutManager *tb_,MSBoolean b_) { tb_->uniformRows(b_);} static void s_layoutUniformCols(MSLayoutManager *tb_,MSBoolean b_) {tb_->uniformColumns(b_);} static void s_layoutLockSize(MSLayoutManager *tb_,MSBoolean b_) {tb_->lockSize(b_);} static void s_layoutLockPositions(MSLayoutManager *tb_,MSBoolean b_) {tb_->lockPositions(b_); } static void s_layoutMargin(MSLayoutManager *pWidgetView_, int margin_) { pWidgetView_->margin(margin_); } static I g_layoutMargin(MSLayoutManager *pWidgetView_) { return (I) pWidgetView_->margin(); } // AplusNotebook 'A' interface functions static A g_notebookOrientation(AplusNotebook *nb_) { return gsym((MSNotebook::Vertical==nb_->orientation())?"vertical":"horizontal"); } static I g_notebookShowBinding(AplusNotebook *nb_) { return MSTrue== nb_->showBinding() ? 1 : 0; } static unsigned g_notebookBindingWidth(AplusNotebook *nb_) { return nb_->bindingWidth(); } static unsigned g_notebookFrameThickness(AplusNotebook *nb_) { return nb_->frameThickness(); } static unsigned g_notebookMarginHeight(AplusNotebook *nb_) { return nb_->marginHeight(); } static unsigned g_notebookMarginWidth(AplusNotebook *nb_) { return nb_->marginWidth(); } static unsigned g_notebookBackpages(AplusNotebook *nb_) { return nb_->backpages(); } static unsigned g_notebookBackpageThickness(AplusNotebook *nb_) { return nb_->backpageThickness(); } static unsigned long g_notebookBackpageFg(AplusNotebook *nb_) { return nb_->backpageForeground(); } static unsigned long g_notebookBackpageBg(AplusNotebook *nb_) { return nb_->backpageBackground(); } static unsigned long g_notebookFrameBackground(AplusNotebook *nb_) { return nb_->frameBackground(); } static A g_notebookCurrentPage(AplusNotebook *nb_) { MSWidgetView *pWidgetView = (MSWidgetView *)nb_->currentWidget(); if (pWidgetView) { AplusModel *m = (AplusModel *)pWidgetView->model(); if (m) { V v = m->aplusVar(); if (v!=0) { A a=(A)gs(Et); // create an A object to store the symbol a->p[0]=(I)MS(symjoin(v->cx->s,v->s)); // join the context and the symbol into dotted pair and store in a return a; } } } return aplus_nl; } static char *g_notebookPageTitle(AplusNotebook *nb_, MSWidgetView *page_) { return (char *)nb_->titleFromWidget(page_); } static I g_notebookPageSelection(AplusNotebook *nb_, MSWidgetView *page_) { return MSTrue==nb_->tabAttribute(page_).sensitive() ? 1 : 0; } static I g_notebookShowTabs(AplusNotebook *nb_) { return MSTrue==nb_->showTabs() ? 1 : 0; } static I g_notebookShowPopup(AplusNotebook *nb_) { return MSTrue==nb_->showPopup() ? 1 : 0; } static unsigned g_notebookBorderWidth(AplusNotebook *nb_) { return nb_->borderWidth(); } static unsigned g_notebookBorderHeight(AplusNotebook *nb_) { return nb_->borderHeight(); } static unsigned long g_notebookSelectedPageFg(AplusNotebook *nb_) { return nb_->selectedPageForeground(); } static unsigned long g_notebookSelectedPageBg(AplusNotebook *nb_) { return nb_->selectedPageBackground(); } static I g_notebookLockSize(AplusNotebook *nb_) { return MSTrue==nb_->lockSize() ? 1 : 0; } static void s_notebookOrientation(AplusNotebook *nb_, A sym_) { if (!QS(sym_)&&(sym_->t==Et&&sym_->n>0&&QS(*sym_->p))) { if(XS(*sym_->p)==si("vertical")) nb_->orientation(MSNotebook::Vertical); else if(XS(*sym_->p)==si("horizontal")) nb_->orientation(MSNotebook::Horizontal); } } static void s_notebookShowBinding(AplusNotebook *nb_, MSBoolean b_) { nb_->showBinding(b_); } static void s_notebookBindingWidth(AplusNotebook *nb_, unsigned w_) { nb_->bindingWidth(w_); } static void s_notebookFrameThickness(AplusNotebook *nb_, unsigned t_) { nb_->frameThickness(t_); } static void s_notebookMarginHeight(AplusNotebook *nb_, unsigned h_) { nb_->marginHeight(h_); } static void s_notebookMarginWidth(AplusNotebook *nb_, unsigned w_) { nb_->marginWidth(w_); } static void s_notebookBackpages(AplusNotebook *nb_, unsigned n_) { nb_->backpages(n_); } static void s_notebookBackpageThickness(AplusNotebook *nb_, unsigned t_) { nb_->backpageThickness(t_); } static void s_notebookBackpageFg(AplusNotebook *nb_, unsigned long fg_) { nb_->backpageForeground(fg_); } static void s_notebookBackpageBg(AplusNotebook *nb_, unsigned long bg_) { nb_->backpageBackground(bg_); } static void s_notebookFrameBackground(AplusNotebook *nb_, unsigned long bg_) { nb_->frameBackground(bg_); } static void s_notebookCurrentPage(AplusNotebook *nb_, A sym_) { if (isNull(sym_)==MSTrue) // make none of the pages selected { nb_->currentWidget(0); } else { AVariableData *pVarData=getVarData(sym_); if (pVarData!=0) { MSWidgetView *pWidgetView=pVarData->pWidgetView(); if (pWidgetView!=0) { nb_->currentWidget(pVarData->pWidgetView()); return; } } showError("Invalid notebook page"); } } static void s_notebookPageTitle(AplusNotebook *nb_, MSWidgetView *widget_, A title_) { if (QS(title_)) { return; } if (title_->t==Ct) { nb_->pageTitle(widget_,(char *)title_->p); } else if (title_->t==Et) // nested array of strings { MSStringVector sv(AplusConvert::asMSStringVector(title_)); if (sv.length()>0) { // since notebook's pageTitle() method accepts only (const char *), // we need to break up the string vector into a single string with // embedded '\n' separators // nb_->pageTitle(widget_,sv.asString('\n').string()); } } } static void s_notebookPageSelection(AplusNotebook *nb_, MSWidgetView *widget_, MSBoolean flag_) { MSNotebookTabAttribute tab(nb_); tab.sensitive(flag_); nb_->tabAttribute(widget_, tab); } static void s_notebookShowTabs(AplusNotebook *nb_, MSBoolean flag_) { nb_->showTabs(flag_); } static void s_notebookShowPopup(AplusNotebook *nb_, MSBoolean flag_) { nb_->showPopup(flag_); } static void s_notebookBorderWidth(AplusNotebook *nb_, unsigned width_) { nb_->borderWidth(width_); } static void s_notebookBorderHeight(AplusNotebook *nb_, unsigned height_) { nb_->borderHeight(height_); } static void s_notebookSelectedPageFg(AplusNotebook *nb_, unsigned long fg_) { nb_->selectedPageForeground(fg_); } static void s_notebookSelectedPageBg(AplusNotebook *nb_, unsigned long bg_) { nb_->selectedPageBackground(bg_); } static void s_notebookLockSize(AplusNotebook *nb_, MSBoolean flag_) { nb_->lockSize(flag_); } static MSWidgetVector AIntArrayToWidgetVector(A aobj_) { MSWidgetVector svec; if(It!=aobj_->t) return svec; for (int i=0;in;++i) svec.append((MSWidget *)aobj_->p[i]); return svec; } static void bNotebookPermute(AplusNotebook *nb_, A wids_) { nb_->permuteWidgets(AIntArrayToWidgetVector(wids_)); } ////////////////////////////////////////////////////////////////////////////// // Widget Creation Functions static AplusDisplayServer *c_XServer(char *dpyName_) { AplusDisplayServer *server; if (dpyName_!=0) server=new AplusDisplayServer(dpyName_); else server=new AplusDisplayServer; return server; } static MSShell *c_ShellW(MSDisplayServer *server_) { MSShell *sp; if (server_==0) sp=new AplusShell; else sp=new AplusShell(server_); (void)sp->windowGroup(g_defaultLeader()); return sp; } static MSPopup *c_XPopupW(MSDisplayServer *server_) { MSPopup *pw; if (server_==0) pw=new AplusPopup; else pw=new AplusPopup(server_); (void)pw->windowGroup(g_defaultLeader()); return pw; } // generate a shell as the parent if parent==0 -- ref: zero parent MSWidgetView *validateParent(MSWidgetView *parent_) { MSWidgetView *pp=parent_; if (pp==0) { MSShell *sp=new AplusShell; (void)sp->windowGroup(g_defaultLeader()); pp=sp;} else if (pp==(MSWidgetView *)-1) { MSPopup *po=new AplusPopup; (void)po->windowGroup(g_defaultLeader()); pp=po;} return pp; } static MSWidgetView *c_AXReference(MSWidgetView *parent_) { return (MSWidgetView *) new AplusReference(validateParent(parent_)); } static MSWidgetView *c_AXLabelM (MSWidgetView *parent_) { return (MSWidgetView *) new AplusLabel(validateParent(parent_)); } static MSWidgetView *c_AXScalar(MSWidgetView *parent_) { return (MSWidgetView *) new AplusEntryField(validateParent(parent_)); } static MSWidgetView *c_AXPushB(MSWidgetView *parent_) { return (MSWidgetView *) new AplusButton(validateParent(parent_)); } static MSWidgetView *c_AXLayout(MSWidgetView *parent_) { return (MSWidgetView *) new AplusLayout(validateParent(parent_)); } static MSWidgetView *c_AXArray(MSWidgetView *parent_) { return (MSWidgetView *) new AplusArray(validateParent(parent_)); } static MSWidgetView *c_AXTextM (MSWidgetView *parent_) { return (MSWidgetView *) new AplusText(validateParent(parent_)); } static MSWidgetView *c_XScrollW(MSWidgetView *parent_) { return (MSWidgetView *) new AplusScrolledWindow(validateParent(parent_)); } static MSWidgetView *c_AXField(MSWidgetView *parent_) { return (MSWidgetView *) new AplusTableColumn((AplusTable *)validateParent(parent_)); } static MSWidgetView *c_AXTable(MSWidgetView *parent_) { return (MSWidgetView *) new AplusTable(validateParent(parent_)); } static MSWidgetView *c_AXCollapsibleW(MSWidgetView *parent_) { return (MSWidgetView *) new AplusCollapsible(validateParent(parent_)); } static MSWidgetView *c_AXPaneW(MSWidgetView *parent_) { return (MSWidgetView *) new AplusPane(validateParent(parent_)); } static MSWidgetView *c_AXVPaneW(MSWidgetView *parent_) { return (MSWidgetView *) new AplusVPane(validateParent(parent_)); } static MSWidgetView *c_AXHPaneW(MSWidgetView *parent_) { return (MSWidgetView *) new AplusHPane(validateParent(parent_)); } static MSWidgetView *c_Notebook(MSWidgetView *parent_) { return (MSWidgetView *) new AplusNotebook(validateParent(parent_)); } static MSWidgetView *c_AXBtnBox(MSWidgetView *parent_) { return (MSWidgetView *) new AplusButtonBox(validateParent(parent_)); } static MSWidgetView *c_AXCheckBox(MSWidgetView *parent_) { return (MSWidgetView *) new AplusCheckBox(validateParent(parent_)); } static MSWidgetView *c_AXRadioBox(MSWidgetView *parent_) { return (MSWidgetView *) new AplusRadioBox(validateParent(parent_)); } static MSWidgetView *c_AXPage(MSWidgetView *parent_) { return (MSWidgetView *) new AplusPage(validateParent(parent_)); } static MSWidgetView *c_AXTree(MSWidgetView *parent_) { return (MSWidgetView *) new AplusTreeView(validateParent(parent_)); } static MSWidgetView *c_AXPassword(MSWidgetView *parent_) { return (MSWidgetView *) new AplusPassword(validateParent(parent_)); } static MSWidgetView *c_AXSlot(MSWidgetView *parent_) { return (MSWidgetView *) new AplusSlot(validateParent(parent_)); } static MSWidgetView *c_AXCommand(MSWidgetView *parent_) { return (MSWidgetView *) new AplusCommand(validateParent(parent_)); } static MSWidgetView *c_AXView(MSWidgetView *parent_) { return (MSWidgetView *) new AplusView(validateParent(parent_)); } static MSWidgetView *c_AXChoice(MSWidgetView *parent_) { return (MSWidgetView *) new AplusChoice(validateParent(parent_)); } static MSWidgetView *c_AXHMenu(MSWidgetView *parent_) { return (MSWidgetView *) new AplusMenu(validateParent(parent_)); } static MSWidgetView *c_AXVMenu(MSWidgetView *parent_) { return (MSWidgetView *) new AplusMenu(validateParent(parent_),AplusMenu::Vertical); } static MSWidgetView *c_XManager(MSWidgetView *parent_) { return (MSWidgetView *) new AplusManager(validateParent(parent_)); } static MSWidgetView *c_AXCross(MSWidgetView *parent_) { return (MSWidgetView *) new AplusMatrix(validateParent(parent_)); } static MSWidgetView *c_AXVScale(MSWidgetView *parent_) { return (MSWidgetView *) new AplusVScale(validateParent(parent_)); } static MSWidgetView *c_AXHScale(MSWidgetView *parent_) { return (MSWidgetView *) new AplusHScale(validateParent(parent_)); } static MSWidgetView *c_AXHGauge(MSWidgetView *parent_) { return (MSWidgetView *) new AplusHGauge(validateParent(parent_)); } static MSWidgetView *c_AXVGauge(MSWidgetView *parent_) { return (MSWidgetView *) new AplusVGauge(validateParent(parent_)); } static void *c_AColorObject(MSWidgetView *) { return (void *) 0; } /* static ColorObject *c_AColorObject(MSWidgetView *parent_) { return (ColorObject *) new ColorObject(validateParent(parent_)); } */ static void installC_Commands(void) { install((PFI)c_XServer,"c_XServer",IV,1,CP,0,0,0,0,0,0,0); install((PFI)c_ShellW,"c_ShellW",IV,1,IV,0,0,0,0,0,0,0); install((PFI)c_XPopupW,"c_XPopupW",IV,1,IV,0,0,0,0,0,0,0); install((PFI)c_AXReference,"c_AXReference",IV,1,IV,0,0,0,0,0,0,0); install((PFI)c_AXVMenu,"c_AXVMenu",IV,1,IV,0,0,0,0,0,0,0); install((PFI)c_AXHMenu,"c_AXHMenu",IV,1,IV,0,0,0,0,0,0,0); install((PFI)c_AXTree,"c_AXTree",IV,1,IV,0,0,0,0,0,0,0); install((PFI)c_AXCommand,"c_AXCommand",IV,1,IV,0,0,0,0,0,0,0); install((PFI)c_AXPassword,"c_AXPassword",IV,1,IV,0,0,0,0,0,0,0); install((PFI)c_XManager,"c_XManager",IV,1,IV,0,0,0,0,0,0,0); install((PFI)c_AXLayout,"c_XLayout",IV,1,IV,0,0,0,0,0,0,0); install((PFI)c_AXPage,"c_AXPage",IV,1,IV,0,0,0,0,0,0,0); install((PFI)c_AXCollapsibleW,"c_AXCollapsibleW",IV,1,IV,0,0,0,0,0,0,0); install((PFI)c_AXPaneW,"c_AXPaneW",IV,1,IV,0,0,0,0,0,0,0); install((PFI)c_AXHPaneW,"c_AXHPaneW",IV,1,IV,0,0,0,0,0,0,0); install((PFI)c_AXVPaneW,"c_AXVPaneW",IV,1,IV,0,0,0,0,0,0,0); install((PFI)c_AXTextM,"c_AXTextM",IV,1,IV,0,0,0,0,0,0,0); install((PFI)c_AXLabelM,"c_AXLabelM",IV,1,IV,0,0,0,0,0,0,0); install((PFI)c_AXBtnBox,"c_AXBtnBox",IV,1,IV,0,0,0,0,0,0,0); install((PFI)c_XScrollW,"c_XScrollW",IV,1,IV,0,0,0,0,0,0,0); install((PFI)c_AXTable,"c_AXTable",IV,1,IV,0,0,0,0,0,0,0); install((PFI)c_AXField,"c_AXField",IV,1,IV,0,0,0,0,0,0,0); install((PFI)c_AXCross,"c_AXCross",IV,1,IV,0,0,0,0,0,0,0); install((PFI)c_AXArray,"c_AXArray",IV,1,IV,0,0,0,0,0,0,0); install((PFI)c_AXView,"c_AXView",IV,1,IV,0,0,0,0,0,0,0); install((PFI)c_AXScalar,"c_AXScalar",IV,1,IV,0,0,0,0,0,0,0); install((PFI)c_AXChoice,"c_AXChoice",IV,1,IV,0,0,0,0,0,0,0); install((PFI)c_AColorObject,"c_AColorObject",IV,1,IV,0,0,0,0,0,0,0); install((PFI)c_AXHScale,"c_AXHScale",IV,1,IV,0,0,0,0,0,0,0); install((PFI)c_AXVScale,"c_AXVScale",IV,1,IV,0,0,0,0,0,0,0); install((PFI)c_AXHGauge,"c_AXHGauge",IV,1,IV,0,0,0,0,0,0,0); install((PFI)c_AXVGauge,"c_AXVGauge",IV,1,IV,0,0,0,0,0,0,0); install((PFI)c_AXPushB,"c_AXPushB",IV,1,IV,0,0,0,0,0,0,0); install((PFI)c_AXRadioBox,"c_AXRadioBox",IV,1,IV,0,0,0,0,0,0,0); install((PFI)c_AXCheckBox,"c_AXCheckBox",IV,1,IV,0,0,0,0,0,0,0); install((PFI)c_AXSlot,"c_AXSlot",IV,1,IV,0,0,0,0,0,0,0); install((PFI)c_Notebook,"c_Notebook",IV,1,IV,0,0,0,0,0,0,0); } static void installTextCommands(void) { install((PFI)g_textBuffer,"g_textBuffer",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_textNumVisibleRows,"s_textNumVisibleRows",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)s_textNumVisibleCols,"s_textNumVisibleCols",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_textNumVisibleRows,"g_textNumVisibleRows",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_textNumVisibleCols,"g_textNumVisibleCols",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_textCursorPosition,"s_textCursorPosition",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_textCursorPosition,"g_textCursorPosition",IV,1,IV,0,0,0,0,0,0,0); } static void installWidgetCommands(void) { install((PFI)s_width,"s_width",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)s_height,"s_height",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)s_x,"s_x",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)s_y,"s_y",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)s_acceptFocus,"s_acceptFocus",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_width,"g_width",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_height,"g_height",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_parent,"s_parent",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_parent,"g_parent",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_x,"g_x",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_y,"g_y",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_acceptFocus,"g_acceptFocus",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_sflags,"s_sflags",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_sflags,"g_sflags",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_resizeOptions,"s_resizeOptions",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_resizeOptions,"g_resizeOptions",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_background,"s_background",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_background,"g_background",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_foreground,"s_foreground",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_foreground,"g_foreground",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_hlColor,"s_hlColor",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_hlColor,"g_hlColor",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_hlThickness,"s_hlThickness",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_hlThickness,"g_hlThickness",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_shadowThickness,"s_shadowThickness",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_shadowThickness,"g_shadowThickness",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_shadowStyle,"s_shadowStyle",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_shadowStyle,"g_shadowStyle",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_titleAlign,"s_titleAlign",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_titleAlign,"g_titleAlign",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_font,"s_font",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_font,"g_font",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_freeze,"s_freeze",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_freeze,"g_freeze",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_focus,"g_focus",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_focusWindow,"g_focusWindow",IV,0,0,0,0,0,0,0,0,0); install((PFI)g_visible,"g_visible",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_sensitive,"g_sensitive",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_sensitive,"s_sensitive",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_dynamic,"g_dynamic",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_dynamic,"s_dynamic",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)s_defaultLeader,"s_defaultLeader",V_,1,IV,0,0,0,0,0,0,0); install((PFI)g_defaultLeader,"g_defaultLeader",IV,0,0,0,0,0,0,0,0,0); install((PFI)s_saveYourselfWindow,"s_savewmWindow",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_saveYourselfWindow,"g_savewmWindow",IV,0,0,0,0,0,0,0,0,0); } static void installPasswordCommands(void) { install((PFI)g_passwordValidity,"g_passwordValidity",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_passwordFillChar,"s_passwordFillChar",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_passwordFillChar,"g_passwordFillChar",IV,1,IV,0,0,0,0,0,0,0); } static void installTreeCommands(void) { install((PFI)s_treeSelectedNode,"s_treeSelectedNode",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_treeSelectedNode,"g_treeSelectedNode",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_treeOrientation,"s_treeOrientation",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_treeOrientation,"g_treeOrientation",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_treeVerticalSpace,"s_treeVerticalSpace",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_treeVerticalSpace,"g_treeVerticalSpace",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_treeHorizontalSpace,"s_treeHorizontalSpace",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_treeHorizontalSpace,"g_treeHorizontalSpace",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_treeNodeBg,"s_treeNodeBg",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)s_treeNodeFg,"s_treeNodeFg",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_treeNodeBg,"g_treeNodeBg",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_treeNodeFg,"g_treeNodeFg",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_treeSelectedNodeBg,"s_treeSelectedNodeBg",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)s_treeSelectedNodeFg,"s_treeSelectedNodeFg",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_treeSelectedNodeBg,"g_treeSelectedNodeBg",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_treeSelectedNodeFg,"g_treeSelectedNodeFg",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_treeShowButtons,"s_treeShowButtons",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_treeShowButtons,"g_treeShowButtons",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_treeLineColor,"s_treeLineColor",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_treeLineColor,"g_treeLineColor",IV,1,IV,0,0,0,0,0,0,0); } static void installCommandCommands(void) { install((PFI)s_commandCursorPosition,"s_commandCursorPosition",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_commandCursorPosition,"g_commandCursorPosition",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_commandBuffer,"g_commandBuffer",CP,1,IV,0,0,0,0,0,0,0); install((PFI)s_commandBuffer,"s_commandBuffer",V_,2,IV,A_,0,0,0,0,0,0); } static void installPageCommands(void) { install((PFI)g_pageCursor,"g_pageCursor",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_pageBlinkRate,"s_pageBlinkRate",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_pageBlinkRate,"g_pageBlinkRate",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_pageColorTable,"s_pageColorTable",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_pageColorTable,"g_pageColorTable",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_pageBoxes,"s_pageBoxes",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_pageBoxes,"g_pageBoxes",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_pageLines,"s_pageLines",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_pageLines,"g_pageLines",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_pageLineWidth,"s_pageLineWidth",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_pageLineWidth,"g_pageLineWidth",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_pageBoxColors,"s_pageBoxColors",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_pageBoxColors,"g_pageBoxColors",A_,1,IV,0,0,0,0,0,0,0); install((PFI)g_pageRubberBand,"g_pageRubberBand",A_,1,IV,0,0,0,0,0,0,0); install((PFI)g_pageKeyBuffer,"g_pageKeyBuffer",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_pageIndexFunc,"s_pageIndexFunc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_pageIndexFunc,"g_pageIndexFunc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_pageBoldFunc,"s_pageBoldFunc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_pageBoldFunc,"g_pageBoldFunc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_pageBlinkFunc,"s_pageBlinkFunc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_pageBlinkFunc,"g_pageBlinkFunc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_pageUnderlineFunc,"s_pageUnderlineFunc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_pageUnderlineFunc,"g_pageUnderlineFunc",A_,1,IV,0,0,0,0,0,0,0); } static void installArrayCommands(void) { install((PFI)s_numVisibleRows,"s_numVisibleRows",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)s_numVisibleCols,"s_numVisibleCols",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_numVisibleRows,"g_numVisibleRows",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_numVisibleCols,"g_numVisibleCols",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_numChildren,"g_numChildren",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_arrayCycleFunc,"s_arrayCycleFunc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_arrayCycleFunc,"g_arrayCycleFunc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_arrayCycleColors,"s_arrayCycleColors",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_arrayCycleColors,"g_arrayCycleColors",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_arrayCycleInterval,"s_arrayCycleInterval",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_arrayCycleInterval,"g_arrayCycleInterval",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_arrayCycleColorMode,"s_arrayCycleColorMode",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_arrayCycleColorMode,"g_arrayCycleColorMode",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_arraySelectVector,"s_arraySelectVector",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_arraySelectVector,"g_arraySelectVector",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_arrayRowBg,"s_arrayRowBg",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_arrayRowBg,"g_arrayRowBg",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_arraySelectBg,"s_arraySelectBg",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_arraySelectBg,"g_arraySelectBg",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_arraySelectVectorBg,"s_arraySelectVectorBg",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_arraySelectVectorBg,"g_arraySelectVectorBg",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_arrayVsbBg,"s_arrayVsbBg",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)s_arrayHsbBg,"s_arrayHsbBg",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_arrayVsbBg,"g_arrayVsbBg",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_arrayHsbBg,"g_arrayHsbBg",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_arrayEditorBg,"s_arrayEditorBg",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)s_arrayEditorFg,"s_arrayEditorFg",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_arrayEditorBg,"g_arrayEditorBg",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_arrayEditorFg,"g_arrayEditorFg",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_arraySelectRow,"s_arraySelectRow",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)s_arraySelectCol,"s_arraySelectCol",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)s_arrayFirstRow,"s_arrayFirstRow",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)s_arrayFirstCol,"s_arrayFirstCol",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)s_arraySbSize,"s_arraySbSize",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)s_arrayVsbSize,"s_arrayVsbSize",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)s_arrayHsbSize,"s_arrayHsbSize",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)s_arraySeparatorInterval,"s_arraySeparatorInterval",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)s_arrayColSeparator,"s_arrayColSeparator",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_arraySelectRow,"g_arraySelectRow",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_arraySelectCol,"g_arraySelectCol",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_arrayFirstRow,"g_arrayFirstRow",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_arrayFirstCol,"g_arrayFirstCol",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_arraySbSize,"g_arraySbSize",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_arrayVsbSize,"g_arrayVsbSize",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_arrayHsbSize,"g_arrayHsbSize",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_arraySeparatorInterval,"g_arraySeparatorInterval",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_arrayColSeparator,"g_arrayColSeparator",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_arrayEdit,"s_arrayEdit",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_arrayEdit,"g_arrayEdit",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_arraySelectionMode,"s_arraySelectionMode",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_arraySelectionMode,"g_arraySelectionMode",A_,1,IV,0,0,0,0,0,0,0); } static void installPrimitiveTextCommands(void) { install((PFI)s_labelOptions,"s_labelOptions",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_labelOptions,"g_labelOptions",A_,1,IV,0,0,0,0,0,0,0); } static void installButtonBoxCommands(void) { install((PFI)s_actionBoxOptions,"s_actionBoxOptions",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_actionBoxOptions,"g_actionBoxOptions",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_boxSelected,"s_boxSelected",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_boxSelected,"g_boxSelected",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_actionHlColor,"s_actionHlColor",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_actionHlColor,"g_actionHlColor",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_actionHlThickness,"s_actionHlThickness",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_actionHlThickness,"g_actionHlThickness",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_actionButtonShadowThickness,"s_actionButtonShadowThickness",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_actionButtonShadowThickness,"g_actionButtonShadowThickness",IV,1,IV,0,0,0,0,0,0,0); } static void installCheckBoxCommands(void) { install((PFI)s_checkHlColor,"s_checkHlColor",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_checkHlColor,"g_checkHlColor",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_checkHlThickness,"s_checkHlThickness",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_checkHlThickness,"g_checkHlThickness",IV,1,IV,0,0,0,0,0,0,0); } static void installRadioBoxCommands(void) { install((PFI)s_radioHlColor,"s_radioHlColor",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_radioHlColor,"g_radioHlColor",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_radioHlThickness,"s_radioHlThickness",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_radioHlThickness,"g_radioHlThickness",IV,1,IV,0,0,0,0,0,0,0); } static void installDisplayServerCommands(void) { install((PFI)g_serverDisplay,"g_serverDisplay",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_screenWidth,"g_screenWidth",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_screenHeight,"g_screenHeight",IV,1,IV,0,0,0,0,0,0,0); } static void installManagerCommands(void) { install((PFI)s_mgrDoubleClickTime,"s_mgrDoubleClickTime",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_mgrDoubleClickTime,"g_mgrDoubleClickTime",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_mgrLongPressTime,"s_mgrLongPressTime",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_mgrLongPressTime,"g_mgrLongPressTime",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_serverName,"g_serverName",CP,1,IV,0,0,0,0,0,0,0); } static void installColorObjectCommands(void) { install((PFI)s_colorBgString,"s_colorBgString",V_,2,IV,CP,0,0,0,0,0,0); install((PFI)s_colorBgPixel,"s_colorBgPixel",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_colorBgString,"g_colorBgString",A_,1,IV,0,0,0,0,0,0,0); install((PFI)g_colorBgPixel,"g_colorBgPixel",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_colorFgString,"s_colorFgString",V_,2,IV,CP,0,0,0,0,0,0); install((PFI)s_colorFgPixel,"s_colorFgPixel",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_colorFgString,"g_colorFgString",A_,1,IV,0,0,0,0,0,0,0); install((PFI)g_colorFgPixel,"g_colorFgPixel",IV,1,IV,0,0,0,0,0,0,0); install((PFI)bServerParseColor,"bServerParseColor",IV,2,IV,CP,0,0,0,0,0,0); install((PFI)bAllocColor,"bAllocColor",IV,2,IV,CP,0,0,0,0,0,0); install((PFI)bFreeColor,"bFreeColor",V_,2,IV,IV,0,0,0,0,0,0); } static void installScaleCommands(void) { install((PFI)s_scaleValueMin,"s_scaleValueMin",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_scaleValueMin,"g_scaleValueMin",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_scaleValueMax,"s_scaleValueMax",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_scaleValueMax,"g_scaleValueMax",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_scaleValueInc,"s_scaleValueInc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_scaleValueInc,"g_scaleValueInc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_scaleValuePageInc,"s_scaleValuePageInc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_scaleValuePageInc,"g_scaleValuePageInc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_scaleValueFont,"s_scaleValueFont",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_scaleValueFont,"g_scaleValueFont",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_scaleValueFg,"s_scaleValueFg",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_scaleValueFg,"g_scaleValueFg",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_scaleValueAlign,"s_scaleValueAlign",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_scaleValueAlign,"g_scaleValueAlign",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_scaleSliderBg,"s_scaleSliderBg",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_scaleSliderBg,"g_scaleSliderBg",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_scaleSliderHeight,"s_scaleSliderHeight",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_scaleSliderHeight,"g_scaleSliderHeight",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_scaleSliderWidth,"s_scaleSliderWidth",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_scaleSliderWidth,"g_scaleSliderWidth",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_scaleTitleAlign,"s_scaleTitleAlign",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_scaleTitleAlign,"g_scaleTitleAlign",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_scaleSubtitle,"s_scaleSubtitle",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_scaleSubtitle,"g_scaleSubtitle",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_scaleSubtitleFont,"s_scaleSubtitleFont",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_scaleSubtitleFont,"g_scaleSubtitleFont",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_scaleSubtitleFg,"s_scaleSubtitleFg",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_scaleSubtitleFg,"g_scaleSubtitleFg",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_scaleSubtitleAlign,"s_scaleSubtitleAlign",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_scaleSubtitleAlign,"g_scaleSubtitleAlign",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_scaleMintitle,"s_scaleMintitle",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_scaleMintitle,"g_scaleMintitle",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_scaleMintitleFg,"s_scaleMintitleFg",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_scaleMintitleFg,"g_scaleMintitleFg",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_scaleMintitleAlign,"s_scaleMintitleAlign",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_scaleMintitleAlign,"g_scaleMintitleAlign",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_scaleMintitleFont,"s_scaleMintitleFont",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_scaleMintitleFont,"g_scaleMintitleFont",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_scaleMaxtitle,"s_scaleMaxtitle",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_scaleMaxtitle,"g_scaleMaxtitle",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_scaleMaxtitleFg,"s_scaleMaxtitleFg",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_scaleMaxtitleFg,"g_scaleMaxtitleFg",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_scaleMaxtitleAlign,"s_scaleMaxtitleAlign",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_scaleMaxtitleAlign,"g_scaleMaxtitleAlign",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_scaleMaxtitleFont,"s_scaleMaxtitleFont",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_scaleMaxtitleFont,"g_scaleMaxtitleFont",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_scaleLabelInc,"s_scaleLabelInc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_scaleLabelInc,"g_scaleLabelInc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_scaleLabelFont,"s_scaleLabelFont",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_scaleLabelFont,"g_scaleLabelFont",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_scaleLabelFg,"s_scaleLabelFg",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_scaleLabelFg,"g_scaleLabelFg",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_scaleLabelAlign,"s_scaleLabelAlign",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_scaleLabelAlign,"g_scaleLabelAlign",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_scaleLabelOut,"s_scaleLabelOut",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_scaleLabelOut,"g_scaleLabelOut",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_scaleMajorTickSize,"s_scaleMajorTickSize",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_scaleMajorTickSize,"g_scaleMajorTickSize",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_scaleMinorTickSize,"s_scaleMinorTickSize",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_scaleMinorTickSize,"g_scaleMinorTickSize",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_scaleMinorTickCt,"s_scaleMinorTickCt",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_scaleMinorTickCt,"g_scaleMinorTickCt",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_scaleEditorBg,"s_scaleEditorBg",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)s_scaleEditorFg,"s_scaleEditorFg",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_scaleEditorBg,"g_scaleEditorBg",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_scaleEditorFg,"g_scaleEditorFg",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_scaleEdit,"s_scaleEdit",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_scaleEdit,"g_scaleEdit",IV,1,IV,0,0,0,0,0,0,0); } static void installMenuCommands(void) { install((PFI)s_hmenuMnemonics,"s_hmenuMnemonics",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_hmenuMnemonics,"g_hmenuMnemonics",A_,1,IV,0,0,0,0,0,0,0); } static void installChoiceCommands(void) { install((PFI)s_choiceNumCols,"s_choiceNumCols",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_choiceNumCols,"g_choiceNumCols",IV,1,IV,0,0,0,0,0,0,0); } static void installMatrixCommands(void) { install((PFI)s_matrixRowIndex,"s_matrixRowIndex",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_matrixRowIndex,"g_matrixRowIndex",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_matrixColIndex,"s_matrixColIndex",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_matrixColIndex,"g_matrixColIndex",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_matrixCornerIndex,"s_matrixCornerIndex",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_matrixCornerIndex,"g_matrixCornerIndex",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_matrixRowIndexBg,"s_matrixRowIndexBg",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_matrixRowIndexBg,"g_matrixRowIndexBg",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_matrixColIndexBg,"s_matrixColIndexBg",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_matrixColIndexBg,"g_matrixColIndexBg",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_matrixCornerIndexBg,"s_matrixCornerIndexBg",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_matrixCornerIndexBg,"g_matrixCornerIndexBg",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_matrixColSpace,"s_matrixColSpace",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_matrixColSpace,"g_matrixColSpace",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_matrixNumHeadingRows,"s_matrixNumHeadingRows",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_matrixNumHeadingRows,"g_matrixNumHeadingRows",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_matrixColSpaceFunc,"s_matrixColSpaceFunc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_matrixColSpaceFunc,"g_matrixColSpaceFunc",A_,1,IV,0,0,0,0,0,0,0); } static void installTableColumnCommands(void) { install((PFI)s_fieldColumnAlignment, "s_fieldColumnAlignment", V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_fieldColumnAlignment, "g_fieldColumnAlignment", A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_fieldCycleFunc,"s_fieldCycleFunc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_fieldCycleFunc,"g_fieldCycleFunc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_fieldCycleColors,"s_fieldCycleColors",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_fieldCycleColors,"g_fieldCycleColors",A_,1,IV,0,0,0,0,0,0,0); // Report Commands install((PFI)s_fieldBgGrayScale,"s_fieldBgGrayScale",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_fieldBgGrayScale,"g_fieldBgGrayScale",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_fieldBgGrayScaleFunc,"s_fieldBgGrayScaleFunc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_fieldBgGrayScaleFunc,"g_fieldBgGrayScaleFunc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_fieldBreakBgGrayScale,"s_fieldBreakBgGrayScale",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_fieldBreakBgGrayScale,"g_fieldBreakBgGrayScale",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_fieldBreakBgGrayScaleFunc,"s_fieldBreakBgGrayScaleFunc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_fieldBreakBgGrayScaleFunc,"g_fieldBreakBgGrayScaleFunc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_fieldBreakText,"s_fieldBreakText",V_,3,IV,A_,A_,0,0,0,0,0); install((PFI)g_fieldBreakText,"g_fieldBreakText",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_fieldBreakFont,"s_fieldBreakFont",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_fieldBreakFont,"g_fieldBreakFont",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_fieldBreakFontFunc,"s_fieldBreakFontFunc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_fieldBreakFontFunc,"g_fieldBreakFontFunc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_fieldBreakLeading,"s_fieldBreakLeading",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_fieldBreakLeading,"g_fieldBreakLeading",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_fieldBreakLeadingFunc,"s_fieldBreakLeadingFunc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_fieldBreakLeadingFunc,"g_fieldBreakLeadingFunc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_fieldBreakOffset,"s_fieldBreakOffset",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_fieldBreakOffset,"g_fieldBreakOffset",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_fieldBreakOffsetFunc,"s_fieldBreakOffsetFunc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_fieldBreakOffsetFunc,"g_fieldBreakOffsetFunc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_fieldBreakOn,"s_fieldBreakOn",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_fieldBreakOn,"g_fieldBreakOn",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_fieldBreakProcessOn,"s_fieldBreakProcessOn",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_fieldBreakProcessOn,"g_fieldBreakProcessOn",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_fieldBreakStyle,"s_fieldBreakStyle",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_fieldBreakStyle,"g_fieldBreakStyle",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_fieldBreakStyleFunc,"s_fieldBreakStyleFunc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_fieldBreakStyleFunc,"g_fieldBreakStyleFunc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_fieldFgGrayScale,"s_fieldFgGrayScale",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_fieldFgGrayScale,"g_fieldFgGrayScale",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_fieldFgGrayScaleFunc,"s_fieldFgGrayScaleFunc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_fieldFgGrayScaleFunc,"g_fieldFgGrayScaleFunc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_fieldBreakFgGrayScale,"s_fieldBreakFgGrayScale",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_fieldBreakFgGrayScale,"g_fieldBreakFgGrayScale",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_fieldBreakFgGrayScaleFunc,"s_fieldBreakFgGrayScaleFunc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_fieldBreakFgGrayScaleFunc,"g_fieldBreakFgGrayScaleFunc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_fieldBreakProcessFunc,"s_fieldBreakProcessFunc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_fieldBreakProcessFunc,"g_fieldBreakProcessFunc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_fieldFormatBreakFunc,"s_fieldFormatBreakFunc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_fieldFormatBreakFunc,"g_fieldFormatBreakFunc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_fieldHeadingStyle,"s_fieldHeadingStyle",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_fieldHeadingStyle,"g_fieldHeadingStyle",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_fieldHeadingFgGrayScale,"s_fieldHeadingFgGrayScale",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_fieldHeadingFgGrayScale,"g_fieldHeadingFgGrayScale",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_fieldHeadingBgGrayScale,"s_fieldHeadingBgGrayScale",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_fieldHeadingBgGrayScale,"g_fieldHeadingBgGrayScale",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_fieldPageBreakOn,"s_fieldPageBreakOn",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_fieldPageBreakOn,"g_fieldPageBreakOn",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_fieldReportFont,"s_fieldReportFont",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_fieldReportFont,"g_fieldReportFont",A_,1,IV,0,0,0,0,0,0,0); install((PFI)g_fieldReportFontFunc,"g_fieldReportFontFunc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_fieldReportFontFunc,"s_fieldReportFontFunc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)s_fieldReportHeadingFont,"s_fieldReportHeadingFont",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_fieldReportHeadingFont,"g_fieldReportHeadingFont",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_fieldStyle,"s_fieldStyle",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_fieldStyle,"g_fieldStyle",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_fieldStyleFunc,"s_fieldStyleFunc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_fieldStyleFunc,"g_fieldStyleFunc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_fieldSuppressDuplicate,"s_fieldSuppressDuplicate",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_fieldSuppressDuplicate,"g_fieldSuppressDuplicate",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_fieldComputationMode,"s_fieldComputationMode",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_fieldComputationMode,"g_fieldComputationMode",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_fieldHeading,"s_fieldHeading",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_fieldHeading,"g_fieldHeading",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_fieldHeadingFg,"s_fieldHeadingFg",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_fieldHeadingFg,"g_fieldHeadingFg",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_fieldBreakCriteriaFunc,"s_fieldBreakCriteriaFunc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_fieldBreakCriteriaFunc, "g_fieldBreakCriteriaFunc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_fieldBreakString,"s_fieldBreakString",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_fieldBreakString,"g_fieldBreakString",A_,1,IV,0,0,0,0,0,0,0); install((PFI)g_fieldBreakIndex,"g_fieldBreakIndex",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_fieldBreakFg,"s_fieldBreakFg",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_fieldBreakFg,"g_fieldBreakFg",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_fieldBreakBg,"s_fieldBreakBg",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_fieldBreakBg,"g_fieldBreakBg",A_,1,IV,0,0,0,0,0,0,0); } static void installTableCommands(void) { install((PFI)s_tableNumFixedFields,"s_tableNumFixedFields",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_tableNumFixedFields,"g_tableNumFixedFields",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_tableColumnDragDrop, "s_tableColumnDragDrop", V_,2,IV,IV,0,0,0,0,0,0); install((PFI)s_tableColumnResize, "s_tableColumnResize", V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_tableColumnDragDrop, "g_tableColumnDragDrop",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_tableColumnResize, "g_tableColumnResize", IV,1,IV,0,0,0,0,0,0,0); // Report Commands install((PFI)s_tableBreakFont, "s_tableBreakFont",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_tableBreakFont,"g_tableBreakFont",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_tableBreakStyle,"s_tableBreakStyle",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_tableBreakStyle,"g_tableBreakStyle",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_tableFixedReportColumns,"s_tableFixedReportColumns",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_tableFixedReportColumns,"g_tableFixedReportColumns",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_tableGroupHeading,"s_tableGroupHeading",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_tableGroupHeading,"g_tableGroupHeading",A_,1,IV,0,0,0,0,0,0,0); install((PFI)g_tableGrandTotal,"g_tableGrandTotal",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_tableCurrentBreakColumn, "g_tableCurrentBreakColumn",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_tableGrandTotalText,"s_tableGrandTotalText",V_,3,IV,A_,A_,0,0,0,0,0); install((PFI)g_tableGrandTotalText,"g_tableGrandTotalText",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_tableHeadingStyle,"s_tableHeadingStyle",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_tableHeadingStyle,"g_tableHeadingStyle",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_tableReportFont,"s_tableReportFont",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_tableReportFont,"g_tableReportFont",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_tableReportGrandTotalOn,"s_tableReportGrandTotalOn",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_tableReportGrandTotalOn,"g_tableReportGrandTotalOn",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_tableReportHeadingFont,"s_tableReportHeadingFont",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_tableReportHeadingFont,"g_tableReportHeadingFont",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_tableReportTotalOn,"s_tableReportTotalOn",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_tableReportTotalOn,"g_tableReportTotalOn",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_tableReportTotalFont,"s_tableReportTotalFont",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_tableReportTotalFont,"g_tableReportTotalFont",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_tableReportTotalLeading,"s_tableReportTotalLeading",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_tableReportTotalLeading,"g_tableReportTotalLeading",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_tableReportTotalStyle,"s_tableReportTotalStyle",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_tableReportTotalStyle,"g_tableReportTotalStyle",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_tableStyle,"s_tableStyle",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_tableStyle,"g_tableStyle",A_,1,IV,0,0,0,0,0,0,0); install((PFI)g_tableColumnControl,"g_tableColumnControl",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_tableColumnControl,"s_tableColumnControl",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_tableColumnPageSpan,"g_tableColumnPageSpan",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_tableColumnPageSpan,"s_tableColumnPageSpan",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_tableRowControl,"g_tableRowControl",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_tableRowControl,"s_tableRowControl",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_tableRowPageSpan,"g_tableRowPageSpan",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_tableRowPageSpan,"s_tableRowPageSpan",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)s_tableNewspaperColumn,"s_tableNewspaperColumn",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_tableNewspaperColumn,"g_tableNewspaperColumn",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_tableColumnSpacing,"g_tableColumnSpacing",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_tableColumnSpacing,"s_tableColumnSpacing",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_tableFrameLineWidth,"g_tableFrameLineWidth",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_tableFrameLineWidth,"s_tableFrameLineWidth",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_tableFrameOffset,"g_tableFrameOffset",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_tableFrameOffset,"s_tableFrameOffset",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_tableFrameStyle,"g_tableFrameStyle",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_tableFrameStyle,"s_tableFrameStyle",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_tableLeading,"g_tableLeading",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_tableLeading,"s_tableLeading",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_tableOutputStyle,"g_tableOutputStyle",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_tableOutputStyle,"s_tableOutputStyle",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)s_tableLeftMargin,"s_tableLeftMargin",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_tableLeftMargin,"g_tableLeftMargin",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_tableRightMargin,"s_tableRightMargin",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_tableRightMargin,"g_tableRightMargin",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_tableTopOffset,"s_tableTopOffset",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_tableTopOffset,"g_tableTopOffset",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_tableBottomOffset,"s_tableBottomOffset",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_tableBottomOffset,"g_tableBottomOffset",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_tablePrintRow,"s_tablePrintRow",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_tablePrintRow,"g_tablePrintRow",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_tablePrintColumn,"s_tablePrintColumn",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_tablePrintColumn,"g_tablePrintColumn",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_tableJustify,"s_tableJustify",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_tableJustify,"g_tableJustify",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_tablePageAlign,"s_tablePageAlign",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_tablePageAlign,"g_tablePageAlign",A_,1,IV,0,0,0,0,0,0,0); install((PFI)g_tableBreakTextColumn,"g_tableBreakTextColumn",A_,1,IV,0,0,0,0,0,0,0); install((PFI)g_tableBreakColumn,"g_tableBreakColumn",A_,1,IV,0,0,0,0,0,0,0); install((PFI)g_tableBreakIndex,"g_tableBreakIndex",A_,1,IV,0,0,0,0,0,0,0); install((PFI)g_tablePageBreakIndex,"g_tablePageBreakIndex",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_tableFgGrayScale,"s_tableFgGrayScale",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_tableFgGrayScale,"g_tableFgGrayScale",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_tableBgGrayScale,"s_tableBgGrayScale",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_tableBgGrayScale,"g_tableBgGrayScale",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_tableHeadingFgGrayScale,"s_tableHeadingFgGrayScale",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_tableHeadingFgGrayScale,"g_tableHeadingFgGrayScale",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_tableHeadingBgGrayScale,"s_tableHeadingBgGrayScale",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_tableHeadingBgGrayScale,"g_tableHeadingBgGrayScale",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_tableBreakOffset,"s_tableBreakOffset",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_tableBreakOffset,"g_tableBreakOffset",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_tableBreakLeading,"s_tableBreakLeading",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_tableBreakLeading,"g_tableBreakLeading",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_tableReportHeadingOffset,"s_tableReportHeadingOffset",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_tableReportHeadingOffset,"g_tableReportHeadingOffset",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_tableComputeBreaks,"s_tableComputeBreaks",V_,1,IV,0,0,0,0,0,0,0); install((PFI)s_tableDynamicRecompute,"s_tableDynamicRecompute",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_tableDynamicRecompute,"g_tableDynamicRecompute",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_tableShowBreaks,"s_tableShowBreaks",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_tableShowBreaks,"g_tableShowBreaks",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_tableHeadingFg,"s_tableHeadingFg",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_tableHeadingFg,"g_tableHeadingFg",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_tableDelimiter,"g_tableDelimiter",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_tableDelimiter,"s_tableDelimiter",V_,2,IV,A_,0,0,0,0,0,0); // install((PFI)g_tableBreakTextIndex,"g_tableBreakTextIndex",A_,1,IV,0,0,0,0,0,0,0); } static void installScrolledWindowCommands(void) { install((PFI)s_windowVsbBg,"s_windowVsbBg",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)s_windowHsbBg,"s_windowHsbBg",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_windowVsbBg,"g_windowVsbBg",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_windowHsbBg,"g_windowHsbBg",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_windowSbSize,"g_windowSbSize",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_windowSbSize,"s_windowSbSize",V_,2,IV,IV,0,0,0,0,0,0); } static void installButtonCommands(void) { install((PFI)s_buttonMargin,"s_buttonMargin",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_buttonMargin,"g_buttonMargin",IV,1,IV,0,0,0,0,0,0,0); } static void installLabelCommands(void) { install((PFI)s_labelMargin,"s_labelMargin",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_labelMargin,"g_labelMargin",IV,1,IV,0,0,0,0,0,0,0); } static void installScalarCommands(void) { install((PFI)s_scalarEditorBg,"s_scalarEditorBg",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)s_scalarEditorFg,"s_scalarEditorFg",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_scalarEditorBg,"g_scalarEditorBg",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_scalarEditorFg,"g_scalarEditorFg",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_scalarEdit,"s_scalarEdit",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_scalarEdit,"g_scalarEdit",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_scalarArrowButtons, "s_scalarArrowButtons",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_scalarArrowButtons, "g_scalarArrowButtons",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_scalarCycleFunc,"s_scalarCycleFunc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_scalarCycleFunc,"g_scalarCycleFunc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_scalarCycleColors,"s_scalarCycleColors",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_scalarCycleColors,"g_scalarCycleColors", A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_scalarCycleInterval,"s_scalarCycleInterval",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_scalarCycleInterval,"g_scalarCycleInterval",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_scalarValueBg,"s_scalarValueBg",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_scalarValueBg,"g_scalarValueBg",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_scalarValueFont,"s_scalarValueFont",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_scalarValueFont,"g_scalarValueFont",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_scalarValueAlign,"s_scalarValueAlign",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_scalarValueAlign,"g_scalarValueAlign",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_scalarValueShadowStyle,"s_scalarValueShadowStyle",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_scalarValueShadowStyle,"g_scalarValueShadowStyle",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_scalarValueShadowThickness,"s_scalarValueShadowThickness",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_scalarValueShadowThickness,"g_scalarValueShadowThickness",IV,1,IV,0,0,0,0,0,0,0); // cycleColorMode() method does not yet exist for MSEntryField, but will. // install((PFI)s_scalarCycleColorMode,"s_scalarCycleColorMode",V_,2,IV,A_,0,0,0,0,0,0); // install((PFI)g_scalarCycleColorMode,"g_scalarCycleColorMode",A_,1,IV,0,0,0,0,0,0,0); } static void installSlotCommands(void) { install((PFI)s_slotCycleFunc,"s_slotCycleFunc",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_slotCycleFunc,"g_slotCycleFunc",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_slotCycleColors,"s_slotCycleColors",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_slotCycleColors,"g_slotCycleColors",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_slotCycleInterval,"s_slotCycleInterval",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_slotCycleInterval,"g_slotCycleInterval",IV,1,IV,0,0,0,0,0,0,0); // cycleColorMode() method does not yet exist for MSEntryField, but will. // install((PFI)s_slotCycleColorMode,"s_slotCycleColorMode",V_,2,IV,A_,0,0,0,0,0,0); // install((PFI)g_slotCycleColorMode,"g_slotCycleColorMode",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_slotEditorBg,"s_slotEditorBg",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)s_slotEditorFg,"s_slotEditorFg",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_slotEditorBg,"g_slotEditorBg",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_slotEditorFg,"g_slotEditorFg",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_slotEdit,"s_slotEdit",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_slotEdit,"g_slotEdit",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_slotSelected,"s_slotSelected",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_slotSelected,"g_slotSelected",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_slotHlColor,"s_slotHlColor",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_slotHlColor,"g_slotHlColor",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_slotHlThickness,"s_slotHlThickness",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_slotHlThickness,"g_slotHlThickness",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_slotShadowThickness,"s_slotShadowThickness",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_slotShadowThickness,"g_slotShadowThickness",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_slotArrowButtons,"s_slotArrowButtons",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_slotArrowButtons,"g_slotArrowButtons",A_,1,IV,0,0,0,0,0,0,0); } static void installTopLevelCommands(void) { install((PFI)s_windowName,"s_windowName",V_,2,IV,CP,0,0,0,0,0,0); install((PFI)g_windowName,"g_windowName",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_iconName,"s_iconName",V_,2,IV,CP,0,0,0,0,0,0); install((PFI)g_iconName,"g_iconName",A_,1,IV,0,0,0,0,0,0,0); } static void installCollapsibleCommands(void) { install((PFI)s_handleBg,"s_handleBg",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_handleBg,"g_handleBg",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_handleSize,"s_handleSize",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_handleSize,"g_handleSize",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_open,"s_open",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_open,"g_open",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_toolTip,"s_toolTip",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_toolTip,"g_toolTip",A_,1,IV,0,0,0,0,0,0,0); } static void installLayoutCommands(void) { install((PFI)s_layoutRowSpace,"s_layoutRowSpace",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)s_layoutColSpace,"s_layoutColSpace",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_layoutRowSpace,"g_layoutRowSpace",A_,1,IV,0,0,0,0,0,0,0); install((PFI)g_layoutColSpace,"g_layoutColSpace",A_,1,IV,0,0,0,0,0,0,0); install((PFI)g_layoutRow,"g_layoutRow",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_layoutCol,"g_layoutCol",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_layoutHspan,"g_layoutHspan",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_layoutVspan,"g_layoutVspan",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_layoutOptions,"g_layoutOptions",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_layoutUniformRows,"g_layoutUniformRows",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_layoutUniformCols,"g_layoutUniformCols",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_layoutLockSize,"g_layoutLockSize",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_layoutLockPositions,"g_layoutLockPositions",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_layoutUniformRows,"s_layoutUniformRows",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)s_layoutUniformCols,"s_layoutUniformCols",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)s_layoutLockSize,"s_layoutLockSize",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)s_layoutLockPositions,"s_layoutLockPositions",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)s_layoutMargin,"s_layoutMargin",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_layoutMargin,"g_layoutMargin",IV,1,IV,0,0,0,0,0,0,0); } static void installNoteBookCommands(void) { install((PFI)g_notebookOrientation,"g_notebookOrientation",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_notebookOrientation,"s_notebookOrientation",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_notebookShowBinding,"g_notebookShowBinding",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_notebookShowBinding,"s_notebookShowBinding",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_notebookBindingWidth,"g_notebookBindingWidth",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_notebookBindingWidth,"s_notebookBindingWidth",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_notebookFrameThickness,"g_notebookFrameThickness",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_notebookFrameThickness,"s_notebookFrameThickness",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_notebookMarginHeight,"g_notebookMarginHeight",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_notebookMarginHeight,"s_notebookMarginHeight",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_notebookMarginWidth,"g_notebookMarginWidth",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_notebookMarginWidth,"s_notebookMarginWidth",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_notebookBackpages,"g_notebookBackpages",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_notebookBackpages,"s_notebookBackpages",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_notebookBackpageThickness,"g_notebookBackpageThickness",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_notebookBackpageThickness,"s_notebookBackpageThickness",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_notebookBackpageFg,"g_notebookBackpageFg",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_notebookBackpageFg,"s_notebookBackpageFg",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_notebookBackpageBg,"g_notebookBackpageBg",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_notebookBackpageBg,"s_notebookBackpageBg",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_notebookFrameBackground,"g_notebookFrameBackground",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_notebookFrameBackground,"s_notebookFrameBackground",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_notebookCurrentPage,"g_notebookCurrentPage",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_notebookCurrentPage,"s_notebookCurrentPage",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_notebookPageTitle,"g_notebookPageTitle",CP,2,IV,IV,0,0,0,0,0,0); install((PFI)s_notebookPageTitle,"s_notebookPageTitle",V_,3,IV,IV,A_,0,0,0,0,0); install((PFI)g_notebookPageSelection,"g_notebookPageSelection",IV,2,IV,IV,0,0,0,0,0,0); install((PFI)s_notebookPageSelection,"s_notebookPageSelection",V_,3,IV,IV,IV,0,0,0,0,0); install((PFI)g_notebookShowTabs,"g_notebookShowTabs",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_notebookShowTabs,"s_notebookShowTabs",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_notebookShowPopup,"g_notebookShowPopup",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_notebookShowPopup,"s_notebookShowPopup",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_notebookBorderWidth,"g_notebookBorderWidth",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_notebookBorderWidth,"s_notebookBorderWidth",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_notebookBorderHeight,"g_notebookBorderHeight",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_notebookBorderHeight,"s_notebookBorderHeight",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_notebookSelectedPageFg,"g_notebookSelectedPageFg",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_notebookSelectedPageFg,"s_notebookSelectedPageFg",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_notebookSelectedPageBg,"g_notebookSelectedPageBg",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_notebookSelectedPageBg,"s_notebookSelectedPageBg",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_notebookLockSize,"g_notebookLockSize",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_notebookLockSize,"s_notebookLockSize",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)bNotebookPermute,"bNotebookPermute",V_,2,IV,A_,0,0,0,0,0,0); } void AGIFmstkInstall(void) { CX context=Cx; Cx=cx("s"); installC_Commands(); installTextCommands(); installWidgetCommands(); installPasswordCommands(); installTreeCommands(); installPageCommands(); installArrayCommands(); installPrimitiveTextCommands(); installButtonBoxCommands(); installCheckBoxCommands(); installRadioBoxCommands(); installDisplayServerCommands(); installMatrixCommands(); installManagerCommands(); installScaleCommands(); installMenuCommands(); installChoiceCommands(); installTableColumnCommands(); installTableCommands(); installScrolledWindowCommands(); installButtonCommands(); installLabelCommands(); installScalarCommands(); installSlotCommands(); installTopLevelCommands(); installLayoutCommands(); installNoteBookCommands(); installCommandCommands(); installCollapsibleCommands(); Cx=context; } aplus-fsf-4.22/src/AplusGUI/AGIFPrint.C0000644000265000001440000022710410772770343013105 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #if HAVE_IOSTREAM #include #else #include #endif #if HAVE_NEW #include #else #include #endif #include #include #include #include #include #include #include #include #include #include #include #include extern const int MSPointsPerInch; extern MSWidgetView *validateParent(MSWidgetView *); //////////////////////////////////////////////////////////////////////////////// // Print Stuff // //////////////////////////////////////////////////////////////////////////////// static A q_printDisclaimer(void) { return (A) GUIEnum.enumSymbols("disclaimer"); } static A q_printPageOrientation(void) { return (A) GUIEnum.enumSymbols("orientation"); } static A q_printPageSize(void) { return (A) GUIEnum.enumSymbols("pageSize"); } static A q_printMode(void) { return (A) GUIEnum.enumSymbols("printMode"); } static A q_printPaperTray(void) { return (A) GUIEnum.enumSymbols("paperTray"); } static A q_printOutputMode(void) { return (A) GUIEnum.enumSymbols("outputMode"); } // // XPrint access functions // unsigned long generateOrientation(A sym_) { if (!QS(sym_)&&(sym_->t==Et&&sym_->n>0&&QS(*sym_->p))) { MSP::PageOrientation k; char *s = (char *) XS(sym_->p[0])->n; if ((k=(MSP::PageOrientation)(long)GUIEnum.printEnumHashTable()->lookup(s))>=0 && (k==MSP::Portrait||k==MSP::Landscape)) return k; } return 0; } A generateSym(int enumType_, MSHashTable *table_) { A a=gs(Et); *a->p=MS(si((char *)table_->lookup(enumType_))); return a; } A generatePageSizeSym(int enumType_) { return generateSym(enumType_, GUIEnum.pageSizeEnumHashTable()); } A generatePageOrientationSym(int enumType_) { return generateSym(enumType_, GUIEnum.stringEnumHashTable()); } A generatePrintModeSym(int enumType_) { return generateSym(enumType_, GUIEnum.stringEnumHashTable()); } A generateOutputModeSym(int enumType_) { return generateSym(enumType_, GUIEnum.stringEnumHashTable()); } A generateDisclaimerStyleSym(int enumType_) { return generateSym(enumType_, GUIEnum.stringEnumHashTable()); } static void s_printPageOrientation(A style_) { MSP::PageOrientation k; k = (MSP::PageOrientation) generateOrientation(style_); if (k) MSWidgetOutput::displayPrint()->pageOrientation(k); } static A g_printPageOrientation(void) { return generatePageOrientationSym(MSWidgetOutput::displayPrint()->pageOrientation()); } static void s_printDisOrientation(A style_) { MSP::PageOrientation k; k= (MSP::PageOrientation) generateOrientation(style_); if (k) MSWidgetOutput::displayPrint()->disclaimer().orientation(k); } static A g_printDisOrientation(void) { return (A) generatePageOrientationSym(MSWidgetOutput::displayPrint()->disclaimer().orientation()); } static void s_printPagesize(A sym_) { if (!QS(sym_)&&(sym_->t==Et&&sym_->n>0&&QS(*sym_->p))) { MSP::PageSize k; char *s = (char *) XS(sym_->p[0])->n; if ((k=(MSP::PageSize)(long)GUIEnum.pageSizeStringHashTable()->lookup(s))>=0&& (k>=MSP::Letter&&k<=MSP::B)) { MSWidgetOutput::displayPrint()->pageSize(k); } else { cerr << " ! "; if (s!=0) cerr << s; cerr << ": invalid symbol" << endl; } } } static A g_printPagesize(void) { return (A) generatePageSizeSym(MSWidgetOutput::displayPrint()->pageSize()); } static void s_printDefaultPaperTray(A) {} /* FIX THIS */ static A g_printDefaultPaperTray(void) { return (A) aplus_nl; } /* FIX THIS */ static void s_printMode(A sym_) { if (!QS(sym_)&&(sym_->t==Et&&sym_->n>0&&QS(*sym_->p))) { MSP::PrintMode k; char *s = (char *) XS(sym_->p[0])->n; if ((k=(MSP::PrintMode)(long)GUIEnum.printEnumHashTable()->lookup(s))>=0&& (k>=MSP::Mono&&k<=MSP::Reverse)) { MSWidgetOutput::displayPrint()->printMode(k); } else { cerr << " ! "; if (s!=0) cerr << s; cerr << ": invalid symbol" << endl; } } } static A g_printMode(void) { return (A) generatePrintModeSym(MSWidgetOutput::displayPrint()->printMode()); } static void s_printOutputMode(A sym_) { if (!QS(sym_)&&(sym_->t==Et&&sym_->n>0&&QS(*sym_->p))) { MSP::OutputMode k; char *s = (char *) XS(sym_->p[0])->n; if ((k=(MSP::OutputMode)(long)GUIEnum.printEnumHashTable()->lookup(s))>=0&& (k>=MSP::PS&&k<=MSP::PPM)) { MSWidgetOutput::displayPrint()->outputMode(k); } else { cerr << " ! "; if (s!=0) cerr << s; cerr << ": invalid symbol" << endl; } } } static A g_printOutputMode(void) { return (A) generateOutputModeSym(MSWidgetOutput::displayPrint()->outputMode()); } static void s_printPageAlign(A x_) {MSWidgetOutput::displayPrint()->pageLayout(GUIEnum.alignFormat(x_));} A g_printPageAlign(void) {return GUIEnum.alignFormat(MSWidgetOutput::displayPrint()->pageLayout());} static void s_printDisclaimerStyle(A sym_) { if (!QS(sym_)&&(sym_->t==Et&&sym_->n>0&&QS(*sym_->p))) { MSP::DisclaimerStyle k; char *s = (char *) XS(sym_->p[0])->n; if ((k=(MSP::DisclaimerStyle)(long)GUIEnum.printEnumHashTable()->lookup(s))>=0&& (k>=MSP::Text&&k<=MSP::Box||k==MSP::NoDisclaimer)) { MSWidgetOutput::displayPrint()->disclaimer().style(k); } else { cerr << " ! "; if (s!=0) cerr << s; cerr << ": invalid symbol" << endl; } } } static A g_printDisclaimerStyle(void) { return (A) generateDisclaimerStyleSym(MSWidgetOutput::displayPrint()->disclaimer().style()); } static void s_printDefaultFont(Font id_) { MSWidgetOutput::displayPrint()->defaultFont(id_); } static Font g_printDefaultFont(void) { return (Font) MSWidgetOutput::displayPrint()->defaultFont(); } static void s_printDisclaimerFont(Font id_) { const char *fn = MSDisplayServer::defaultDisplayServer()->fontName(id_); if (fn==0||*fn==0) fn=MSDisplayServer::defaultDisplayServer()->fontName(MSDisplayServer::defaultDisplayServer()->defaultFont()); MSWidgetOutput::displayPrint()->disclaimer().font(fn); } static Font g_printDisclaimerFont(void) { const char *fn = MSWidgetOutput::displayPrint()->disclaimer().fontName(); if (fn==0||*fn==0) return MSDisplayServer::defaultDisplayServer()->defaultFont(); return MSDisplayServer::defaultDisplayServer()->fontID(fn); } static void s_printLeftMargin(A value_) { if (!QS(value_) && value_->r==0) { P p; p.i=value_->p; if (value_->t==Ft) MSWidgetOutput::displayPrint()->leftMargin(p.f[0]); else MSWidgetOutput::displayPrint()->leftMargin((double)p.i[0]); } } static A g_printLeftMargin(void) { A r=gf(MSWidgetOutput::displayPrint()->leftMargin()); return r; } static void s_printRightMargin(A value_) { if (!QS(value_) && value_->r==0) { P p; p.i=value_->p; if (value_->t==Ft) MSWidgetOutput::displayPrint()->rightMargin(p.f[0]); else MSWidgetOutput::displayPrint()->rightMargin((double)p.i[0]); } } static A g_printRightMargin(void) { A r=gf(MSWidgetOutput::displayPrint()->rightMargin()); return r; } static void s_printTopMargin(A value_) { if (!QS(value_) && value_->r==0) { P p; p.i=value_->p; if (value_->t==Ft) MSWidgetOutput::displayPrint()->topMargin(p.f[0]); else MSWidgetOutput::displayPrint()->topMargin((double)p.i[0]); } } static A g_printTopMargin(void) { A r=gf(MSWidgetOutput::displayPrint()->topMargin()); return r; } static void s_printBottomMargin(A value_) { if (!QS(value_) && value_->r==0) { P p; p.i=value_->p; if (value_->t==Ft) MSWidgetOutput::displayPrint()->bottomMargin(p.f[0]); else MSWidgetOutput::displayPrint()->bottomMargin((double)p.i[0]); } } static A g_printBottomMargin(void) { A r=gf(MSWidgetOutput::displayPrint()->bottomMargin()); return r; } static void s_printMargins(A value_) { if (!QS(value_) && value_->r==0) { P p; p.i=value_->p; if (value_->t==Ft) { MSWidgetOutput::displayPrint()->leftMargin((double)p.f[0]); MSWidgetOutput::displayPrint()->rightMargin((double)p.f[0]); MSWidgetOutput::displayPrint()->topMargin((double)p.f[0]); MSWidgetOutput::displayPrint()->bottomMargin((double)p.f[0]); } else { MSWidgetOutput::displayPrint()->leftMargin((double)p.i[0]); MSWidgetOutput::displayPrint()->rightMargin((double)p.i[0]); MSWidgetOutput::displayPrint()->topMargin((double)p.i[0]); MSWidgetOutput::displayPrint()->bottomMargin((double)p.i[0]); } } } static void s_printDisLeftMargin(A value_) { if (!QS(value_) && value_->r==0) { P p; p.i=value_->p; if (value_->t==Ft) MSWidgetOutput::displayPrint()->disclaimer().leftMargin(p.f[0]); else MSWidgetOutput::displayPrint()->disclaimer().leftMargin((double)p.i[0]); } } static A g_printDisLeftMargin(void) { A r=gf(MSWidgetOutput::displayPrint()->disclaimer().leftMargin()); return r; } static void s_printDisRightMargin(A value_) { if (!QS(value_) && value_->r==0) { P p; p.i=value_->p; if (value_->t==Ft) MSWidgetOutput::displayPrint()->disclaimer().rightMargin(p.f[0]); else MSWidgetOutput::displayPrint()->disclaimer().rightMargin((double)p.i[0]); } } static A g_printDisRightMargin(void) { A r=gf(MSWidgetOutput::displayPrint()->disclaimer().rightMargin()); return r; } static void s_printDisTopMargin(A value_) { if (!QS(value_) && value_->r==0) { P p; p.i=value_->p; if (value_->t==Ft) MSWidgetOutput::displayPrint()->disclaimer().topMargin(p.f[0]); else MSWidgetOutput::displayPrint()->disclaimer().topMargin((double)p.i[0]); } } static A g_printDisTopMargin(void) { A r=gf(MSWidgetOutput::displayPrint()->disclaimer().topMargin()); return r; } static void s_printDisBottomMargin(A value_) { if (!QS(value_) && value_->r==0) { P p; p.i=value_->p; if (value_->t==Ft) MSWidgetOutput::displayPrint()->disclaimer().bottomMargin(p.f[0]); else MSWidgetOutput::displayPrint()->disclaimer().bottomMargin((double)p.i[0]); } } static A g_printDisBottomMargin(void) { A r=gf(MSWidgetOutput::displayPrint()->disclaimer().bottomMargin()); return r; } static void s_printFile(A file_) { if (file_!=0&&file_->n!=0&&file_->t==Ct) { MSWidgetOutput::displayPrint()->fileName((char *) file_->p); } } static A g_printFile(void) { return (A) gsv(0,(char *)MSWidgetOutput::displayPrint()->fileName().string()); } static void s_printDisclaimerFile(A file_) { if (file_!=0&&file_->n!=0&&file_->t==Ct) { MSWidgetOutput::displayPrint()->disclaimer().fileName((char *) file_->p); } } static A g_printDisclaimerFile(void) { return (A)gsv(0,(char*)MSWidgetOutput::displayPrint()->disclaimer().fileName().string()); } static void s_printDisRuleWidth(int value_) { MSWidgetOutput::displayPrint()->disclaimer().lineWidth(value_); } static I g_printDisRuleWidth(void) { return (I)MSWidgetOutput::displayPrint()->disclaimer().lineWidth(); } static void bprint(MSWidget *xwin_) { xwin_->print(); } //////////////////////////////////////////////////////////////////////////////// // AplusReport Stuff // //////////////////////////////////////////////////////////////////////////////// static A q_reportPageOrientation(void) { AplusReportPageOrientationConverter converter; return converter.stringDomain(); } static A q_reportPageSize(void) { AplusReportPageSizeConverter converter; return converter.stringDomain(); } static A q_reportOutputMode(void) { AplusReportOutputModeConverter converter; return converter.stringDomain(); } static A q_reportDisclaimerStyle(void) { AplusReportDisclaimerStyleConverter converter; return converter.stringDomain(); } static A q_reportStyle(void) { AplusReportStyleConverter converter; return converter.stringDomain(); } static A q_reportOccurrence(void) { AplusReportOccurrenceConverter converter; return converter.stringDomain(); } static A q_reportCompMode(void) { AplusReportCompModeConverter converter; return converter.stringDomain(); } static void s_reportPageOrientation(AplusPrintTool *pTool_, A value_) { AplusReportPageOrientationConverter converter; unsigned long style = converter(value_); if (style!=converter.enumNotFound()) { pTool_->pageOrientation((MSP::PageOrientation)style); } } static A g_reportPageOrientation(AplusPrintTool *pTool_) { AplusReportPageOrientationConverter converter; return converter(pTool_->pageOrientation()); } static void s_reportDisclaimerOrientation(AplusPrintTool *pTool_, A value_) { AplusReportPageOrientationConverter converter; unsigned long style = converter(value_); if (style!=converter.enumNotFound()) { pTool_->disclaimer().orientation((MSP::PageOrientation)style); } } static A g_reportDisclaimerOrientation(AplusPrintTool *pTool_) { AplusReportPageOrientationConverter converter; return converter(pTool_->disclaimer().orientation()); } static void s_reportPagesize(AplusPrintTool *pTool_, A value_) { AplusReportPageSizeConverter converter; unsigned long size = converter(value_); if (size!=converter.enumNotFound()) { pTool_->pageSize((MSP::PageSize)size); } } static A g_reportPagesize(AplusPrintTool *pTool_) { AplusReportPageSizeConverter converter; return converter(pTool_->pageSize()); } static void s_reportOutputMode(AplusPrintTool *pTool_, A value_) { AplusReportOutputModeConverter converter; unsigned long mode = converter(value_); if (mode!=converter.enumNotFound()) { pTool_->MSReport::outputMode((MSP::OutputMode)mode); } } static A g_reportOutputMode(AplusPrintTool *pTool_) { AplusReportOutputModeConverter converter; return converter(pTool_->MSReport::outputMode()); } static void s_reportDisclaimerStyle(AplusPrintTool *pTool_, A value_) { AplusReportDisclaimerStyleConverter converter; unsigned long style = converter(value_); if (style!=converter.enumNotFound()) { pTool_->disclaimer().style((MSP::DisclaimerStyle)style); } } static A g_reportDisclaimerStyle(AplusPrintTool *pTool_) { AplusReportDisclaimerStyleConverter converter; return converter(pTool_->disclaimer().style()); } static void s_reportLeftMargin(AplusPrintTool *pTool_, A value_) { if (!QS(value_) && value_->r==0) { P p; p.i=value_->p; if (value_->t==Ft) { pTool_->leftMargin(p.f[0]); } else { pTool_->leftMargin((double)p.i[0]); } } } static A g_reportLeftMargin(AplusPrintTool *pTool_) { return gf(pTool_->leftMargin()); } static void s_reportRightMargin(AplusPrintTool *pTool_, A value_) { if (!QS(value_) && value_->r==0) { P p; p.i=value_->p; if (value_->t==Ft) { pTool_->rightMargin(p.f[0]); } else { pTool_->rightMargin((double)p.i[0]); } } } static A g_reportRightMargin(AplusPrintTool *pTool_) { return gf(pTool_->rightMargin()); } static void s_reportTopMargin(AplusPrintTool *pTool_, A value_) { if (!QS(value_) && value_->r==0) { P p; p.i=value_->p; if (value_->t==Ft) { pTool_->topMargin(p.f[0]); } else { pTool_->topMargin((double)p.i[0]); } } } static A g_reportTopMargin(AplusPrintTool *pTool_) { return gf(pTool_->topMargin()); } static void s_reportBottomMargin(AplusPrintTool *pTool_, A value_) { if (!QS(value_) && value_->r==0) { P p; p.i=value_->p; if (value_->t==Ft) { pTool_->bottomMargin(p.f[0]); } else { pTool_->bottomMargin((double)p.i[0]); } } } static A g_reportBottomMargin(AplusPrintTool *pTool_) { return gf(pTool_->bottomMargin()); } static void s_reportMargins(AplusPrintTool *pTool_, A value_) { if (!QS(value_) && value_->r==0) { P p; p.i=value_->p; if (value_->t==Ft) { pTool_->leftMargin((double)p.f[0]); pTool_->rightMargin((double)p.f[0]); pTool_->topMargin((double)p.f[0]); pTool_->bottomMargin((double)p.f[0]); } else { pTool_->leftMargin((double)p.i[0]); pTool_->rightMargin((double)p.i[0]); pTool_->topMargin((double)p.i[0]); pTool_->bottomMargin((double)p.i[0]); } } } static void s_reportDisclaimerLeftMargin(AplusPrintTool *pTool_, A value_) { if (!QS(value_) && value_->r==0) { P p; p.i=value_->p; if (value_->t==Ft) { pTool_->disclaimer().leftMargin(p.f[0]); } else { pTool_->disclaimer().leftMargin((double)p.i[0]); } } } static A g_reportDisclaimerLeftMargin(AplusPrintTool *pTool_) { return gf(pTool_->disclaimer().leftMargin()); } static void s_reportDisclaimerRightMargin(AplusPrintTool *pTool_, A value_) { if (!QS(value_) && value_->r==0) { P p; p.i=value_->p; if (value_->t==Ft) { pTool_->disclaimer().rightMargin(p.f[0]); } else { pTool_->disclaimer().rightMargin((double)p.i[0]); } } } static A g_reportDisclaimerRightMargin(AplusPrintTool *pTool_) { return gf(pTool_->disclaimer().rightMargin()); } static void s_reportDisclaimerTopMargin(AplusPrintTool *pTool_, A value_) { if (!QS(value_) && value_->r==0) { P p; p.i=value_->p; if (value_->t==Ft) { pTool_->disclaimer().topMargin(p.f[0]); } else { pTool_->disclaimer().topMargin((double)p.i[0]); } } } static A g_reportDisclaimerTopMargin(AplusPrintTool *pTool_) { return gf(pTool_->disclaimer().topMargin()); } static void s_reportDisclaimerBottomMargin(AplusPrintTool *pTool_, A value_) { if (!QS(value_) && value_->r==0) { P p; p.i=value_->p; if (value_->t==Ft) { pTool_->disclaimer().bottomMargin(p.f[0]); } else { pTool_->disclaimer().bottomMargin((double)p.i[0]); } } } static A g_reportDisclaimerBottomMargin(AplusPrintTool *pTool_) { return gf(pTool_->disclaimer().bottomMargin()); } static void s_reportFileName(AplusPrintTool *pTool_, A value_) { if (value_!=0&&value_->n!=0&&value_->t==Ct) { pTool_->fileName((char *)value_->p); } } static A g_reportFileName(AplusPrintTool *pTool_) { return (A)gsv(0,(char *)pTool_->fileName().string()); } static void s_reportDisclaimerFile(AplusPrintTool *pTool_, A value_) { if (value_!=0 && value_->n!=0 && value_->t==Ct) { pTool_->disclaimer().fileName((char *)value_->p); } } static A g_reportDisclaimerFile(AplusPrintTool *pTool_) { return (A)gsv(0,(char*)pTool_->disclaimer().fileName().string()); } static void s_reportDisclaimerRuleWidth(AplusPrintTool *pTool_, int value_) { pTool_->disclaimer().lineWidth(value_); } static I g_reportDisclaimerRuleWidth(AplusPrintTool *pTool_) { return (I) pTool_->disclaimer().lineWidth(); } // // Assume that we get a an A which contains the value and an a vector of PrintText * // static A g_reportFooter(AplusPrintTool *pTool_) { return (A)ic(pTool_->footers()); } static void s_reportFooter(AplusPrintTool *pTool_, A val_) { pTool_->footers(val_); } static A g_reportHeader(AplusPrintTool *pTool_) { return (A)ic(pTool_->headers()); } static void s_reportHeader(AplusPrintTool *pTool_, A val_) { pTool_->headers(val_); } static void s_reportBanner(AplusPrintTool *pt_, A value_) { pt_->banner(value_); } static A g_reportBanner(AplusPrintTool *pt_) { return (A)ic(pt_->banner()); } static void s_reportCancel(AplusPrintTool *pTool_) { pTool_->cancelReport(); } static void s_reportFooterOffset(AplusPrintTool *pTool_, int value_) { pTool_->footerOffset(value_); } static I g_reportFooterOffset(AplusPrintTool *pTool_) { return (I) pTool_->footerOffset(); } static void s_reportPageFrameLineWidth(AplusPrintTool *pTool_, int value_) { pTool_->pageFrameLineWidth(value_); } static I g_reportPageFrameLineWidth(AplusPrintTool *pTool_) { return (I) pTool_->pageFrameLineWidth(); } static void s_reportPageFrameOffset(AplusPrintTool *pTool_, int value_) { pTool_->pageFrameOffset(value_); } static I g_reportPageFrameOffset(AplusPrintTool *pTool_) { return (I) pTool_->pageFrameOffset(); } static void s_reportPageFrameStyle(AplusPrintTool *pTool_, A value_) { AplusReportStyleConverter converter; unsigned long style=converter(value_); if (style!=converter.enumNotFound()) { pTool_->pageFrameStyle(style); } } static A g_reportPageFrameStyle(AplusPrintTool *pTool_) { AplusReportStyleConverter converter; return converter(pTool_->pageFrameStyle()); } static void s_reportHeaderOffset(AplusPrintTool *pTool_, int value_) { pTool_->headerOffset(value_); } static I g_reportHeaderOffset(AplusPrintTool *pTool_) { return (I) pTool_->headerOffset();} static I g_reportPageCount(AplusPrintTool *pTool_) { return (I) pTool_->pageCount(); } static I g_reportPageCountTotal(AplusPrintTool *pTool_) { return (I) pTool_->pageCountTotal(); } static void s_reportPageNumbers(AplusPrintTool *pTool_, A value_) { pTool_->pageNumbers(AplusConvert::asMSUnsignedVector(value_)); } static A g_reportPageNumbers(AplusPrintTool *pTool_) { return AplusConvert::asA(pTool_->pageNumbers()); } static void s_reportPageNumbering(AplusPrintTool *pTool_, MSBoolean value_) { pTool_->pageNumbering(value_); } static I g_reportPageNumbering(AplusPrintTool *pTool_) { return MSTrue==pTool_->pageNumbering() ? 1 : 0; } static void s_reportPageNumberText(AplusPrintTool *pTool_, A value_) { pTool_->pageNumberText() = AplusConvert::asMSStringVector(value_); } static A g_reportPageNumberText(AplusPrintTool *pTool_) { return AplusConvert::asA(pTool_->pageNumberText()); } static void s_reportPageNumber(AplusPrintTool *pTool_, A value_) { pTool_->pageNumber(value_); } static A g_reportPageNumber(AplusPrintTool *pTool_) { return (A)ic(pTool_->pageNumber()); } static void s_reportUniformScaling(AplusPrintTool *pTool_, MSBoolean value_) { pTool_->uniformScaling(value_); } static I g_reportUniformScaling(AplusPrintTool *pTool_) { return MSTrue==pTool_->uniformScaling() ? 1 : 0; } static void addReportCB(AplusPrintTool *pTool_, A cbname_, A fc_) // NEED RTTI { char *cbnamep; if (pTool_->widgetType()==AplusPrintTool::symbol()) { if (cbname_->t==Ct) cbnamep=(char *)cbname_->p; else if (cbname_->t==Et&&QS(*cbname_->p)) cbnamep=XS(*cbname_->p)->n; AClientData *ac=0; if (fc_->t==Et&&fc_->n==2) { I f=fc_->p[0]; I c=fc_->p[1]; if (pTool_->model()) { ac=new AClientData(pTool_->model()->aplusVar(),(A)f,(A)c); } else { ac=new AClientData((V) 0,(A)f,(A)c); } pTool_->MSReport::callback(cbnamep,new AplusCallback(ac)); } else { pTool_->MSReport::callback(cbnamep, (MSCallback *)0); // Clear the callback } } } static A getReportCB(AplusPrintTool *pTool_, A cbname_) { A r=aplus_nl; char *cbnamep; if (cbname_->t==Ct) cbnamep=(char *)cbname_->p; else if (cbname_->t==Et&&QS(*cbname_->p)) cbnamep=XS(*cbname_->p)->n; AplusCallback *acb=0; if ((acb=(AplusCallback *)pTool_->MSReport::callback(cbnamep))!=0) { AClientData *ac=acb->ac(); if (ac!=0) { r=gv(Et,2); r->p[0]=ic(ac->function()); r->p[1]=ic(ac->data()); } } return (A)r; } static void s_reportPrint(AplusPrintTool *pt_) { pt_->constructReport(); pt_->MSPrintTool::print(); // have to qualify the print() method explicitly; otherwise, it's ambiguous } static void s_reportPageNumberOffset(AplusPrintTool *pTool_, int value_) { pTool_->pageNumberOffset(value_); } static I g_reportPageNumberOffset(AplusPrintTool *pTool_) { return (I) pTool_->pageNumberOffset(); } static I g_reportFontSize(AplusPrintTool *pTool_) { return (I) pTool_->fontSize(); } static void s_reportPrintMode(AplusPrintTool *pTool_, A value_) { AplusReportPrintModeConverter converter; unsigned long mode=converter(value_); if (mode!=converter.enumNotFound()) { MSWidgetOutput::displayPrint()->printMode((MSP::PrintMode)mode); } } static A g_reportPrintMode(AplusPrintTool *pTool_) { AplusReportPrintModeConverter converter; return converter(MSWidgetOutput::displayPrint()->printMode()); } ///////////////////////////////// // PrintText Class Attributes // // // // text Strings // // fontName String // // foreground String // // background String // // justification // // style // // fontsize unsigned // // leading unsigned // // topPixel unsigned // // bottomPixel unsigned // // fontScale double // // fgGrayScale double // // bgGrayScale double // // xPixel unsigned // // yPixel unsigned // // lineWidth unsigned // // row unsigned // // column unsigned // // firstColumn unsigned // // mode // // xOrigin double // // yOrigin double // // topOffset double // // bottomOffset double // // // ////////////////////////////////// void s_printtextText(MSPrintText *printText_, A x_) { printText_->text(AplusConvert::asMSStringVector(x_)); } A g_printtextText(MSPrintText *printText_) { return AplusConvert::asA(printText_->text()); } void s_printtextFont(MSPrintText *printText_, A sym_) { MSString f = AplusConvert::asMSString(sym_); if (f.length()>0) printText_->font(f); } A g_printtextFont(MSPrintText *printText_) { return AplusConvert::asA(printText_->fontName()); } void s_printtextForeground(MSPrintText *printText_, A x_) { MSString f = AplusConvert::asMSString(x_); if (f.length()>0) printText_->foreground(f); } A g_printtextForeground(MSPrintText *printText_) { return AplusConvert::asA(printText_->foreground()); } void s_printtextBackground(MSPrintText *printText_, A x_) { MSString b = AplusConvert::asMSString(x_); if (b.length()>0) printText_->background(b); } A g_printtextBackground(MSPrintText *printText_) { return AplusConvert::asA(printText_->background()); } void s_printtextJustification(MSPrintText *printText_, A sym_) { printText_->justification(GUIEnum.alignFormat(sym_)); } A g_printtextJustification(MSPrintText *printText_) { return GUIEnum.alignFormat(printText_->justification()); } void s_printtextStyle(MSPrintText *printText_, A x_) { printText_->style(GUIEnum.formatStyle(x_)); } A g_printtextStyle(MSPrintText *printText_) { return GUIEnum.formatStyle(printText_->style()); } void s_printtextMode(MSPrintText *printText_, A sym_) { printText_->occurrence(AplusPrintText::convertMode(sym_)); } A g_printtextMode(MSPrintText *printText_) { return AplusPrintText::convertMode(printText_->occurrence()); } void s_printtextFontSize(MSPrintText *printText_, unsigned x_) { printText_->fontSize(x_); } unsigned g_printtextFontSize(MSPrintText *printText_) { return printText_->fontSize(); } void s_printtextLeading(MSPrintText *printText_, unsigned x_) { printText_->leading(x_); } unsigned g_printtextLeading(MSPrintText *printText_) { return printText_->leading(); } void s_printtextTopPixel(MSPrintText *printText_, unsigned x_) { printText_->topPixel(x_); } unsigned long g_printtextTopPixel(MSPrintText *printText_) { return printText_->topPixel(); } void s_printtextBottomPixel(MSPrintText *printText_, unsigned x_) { printText_->bottomPixel(x_); } unsigned g_printtextBottomPixel(MSPrintText *printText_) { return printText_->bottomPixel(); } void s_printtextFontScale(MSPrintText *printText_, A value_) { if(!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; printText_->fontScale(value_->t==Ft?p.f[0]:(double)p.i[0]); } } A g_printtextFontScale(MSPrintText *printText_) { return (A) gf(printText_->fontScale()); } void s_printtextFgGrayScale(MSPrintText *printText_, A value_) { if(!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; printText_->fgGrayScale(value_->t==Ft?p.f[0]:(double)p.i[0]); } } A g_printtextFgGrayScale(MSPrintText *printText_) { return (A) gf(printText_->fgGrayScale()); } void s_printtextBgGrayScale(MSPrintText *printText_, A value_) { if(!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; printText_->bgGrayScale(value_->t==Ft?p.f[0]:(double)p.i[0]); } } A g_printtextBgGrayScale(MSPrintText *printText_) { return (A) gf(printText_->bgGrayScale()); } void s_printtextLineWidth(MSPrintText *printText_, unsigned x_) { printText_->lineWidth(x_); } unsigned g_printtextLineWidth(MSPrintText *printText_) { return printText_->lineWidth(); } void s_printtextRow(MSPrintText *printText_, unsigned x_) { printText_->row(x_); } unsigned g_printtextRow(MSPrintText *printText_) { return printText_->row(); } void s_printtextColumn(MSPrintText *printText_, unsigned x_) { printText_->column(x_); } unsigned g_printtextColumn(MSPrintText *printText_) { return printText_->column(); } void s_printtextFirstColumn(MSPrintText *printText_, unsigned x_) { printText_->column(x_); } unsigned g_printtextFirstColumn(MSPrintText *printText_) { return printText_->column(); } void s_printtextxOrigin(MSPrintText *printText_, A value_) { if(!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; printText_->xOrigin(value_->t==Ft?p.f[0]:(double)p.i[0]); } } A g_printtextxOrigin(MSPrintText *printText_) { return (A) gf(printText_->xOrigin()); } void s_printtextyOrigin(MSPrintText *printText_, A value_) { if(!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; printText_->yOrigin(value_->t==Ft?p.f[0]:(double)p.i[0]); } } A g_printtextyOrigin(MSPrintText *printText_) { return (A) gf(printText_->yOrigin()); } void s_printtextTopOffset(MSPrintText *printText_, A value_) { if(!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; printText_->topOffset(value_->t==Ft?p.f[0]:(double)p.i[0]); } } A g_printtextTopOffset(MSPrintText *printText_) { return (A) gf(printText_->topOffset()); } void s_printtextBottomOffset(MSPrintText *printText_, A value_) { if(!QS(value_)&&(value_->t==It || value_->t==Ft)) { P p; p.i=value_->p; printText_->bottomOffset(value_->t==Ft?p.f[0]:(double)p.i[0]); } } A g_printtextBottomOffset(MSPrintText *printText_) { return (A) gf(printText_->bottomOffset()); } //************************* ReportParagraph attributes ******************************* static void s_reportParagraphLeftMargin(MSWidgetView *pWidget_, A value_) { if (!QS(value_)) { AplusParagraph *paragraph = (AplusParagraph *)pWidget_; if (value_->t==Ft) // if it's a floating point value { paragraph->leftMargin(*(double*)value_->p); } else if (value_->t==It) // it's an integer { paragraph->leftMargin((double)*(I*)value_->p); } } } static A g_reportParagraphLeftMargin(MSWidgetView *pWidget_) { // A fix for a small MStk problem - to be fixed in MStk for release 2.6: // margins in inches are calculated based on the corresponding pixel offset values; // the default pixel offset is -1 (meaning that it's inherited from the report's pixel offset); // thus, the default margin is -0.0139, which is confusing to the user - it should also be -1. double margin = ((AplusParagraph *)pWidget_)->leftMargin(); return gf((margin<0)?-1:margin); } static void s_reportParagraphRightMargin(MSWidgetView *pWidget_, A value_) { if (!QS(value_)) { AplusParagraph *paragraph = (AplusParagraph *)pWidget_; if (value_->t==Ft) // if it's a floating point value { paragraph->rightMargin(*(double*)value_->p); } else if (value_->t==It) // it's an integer { paragraph->rightMargin((double)*(I*)value_->p); } } } static A g_reportParagraphRightMargin(MSWidgetView *pWidget_) { // A fix for a small MStk problem - to be fixed in MStk for release 2.6: // margins in inches are calculated based on the corresponding pixel offset values; // the default pixel offset is -1 (meaning that it's inherited from the report's pixel offset); // thus, the default margin is -0.0139, which is confusing to the user - it should also be -1. double margin = ((AplusParagraph *)pWidget_)->rightMargin(); return gf((margin<0)?-1:margin); } static void s_reportParagraphTopOffset(MSWidgetView *pWidget_, A value_) { if (!QS(value_)) { AplusParagraph *paragraph = (AplusParagraph *)pWidget_; if (value_->t==Ft) // if it's a floating point value { paragraph->topOffset(*(double*)value_->p); } else if (value_->t==It) // it's an integer { paragraph->topOffset((double)*(I*)value_->p); } } } static A g_reportParagraphTopOffset(MSWidgetView *pWidget_) { // A fix for an MStk bug to be fixed in MStk 2.6: // MSPrintItem::topOffset() and MSPrintItem::bottomOffset() methods do the cast to double incorrectly // so the decimal part gets truncated double offset = ((AplusParagraph *)pWidget_)->topPixel(); return gf(offset/MSPointsPerInch); } static void s_reportParagraphBottomOffset(MSWidgetView *pWidget_, A value_) { if (!QS(value_)) { AplusParagraph *paragraph = (AplusParagraph *)pWidget_; if (value_->t==Ft) // if it's a floating point value { paragraph->bottomOffset(*(double*)value_->p); } else if (value_->t==It) // it's an integer { paragraph->bottomOffset((double)*(I*)value_->p); } } } static A g_reportParagraphBottomOffset(MSWidgetView *pWidget_) { // A fix for an MStk bug to be fixed in MStk 2.6: // MSPrintItem::topOffset() and MSPrintItem::bottomOffset() methods do the cast to double incorrectly // so the decimal part gets truncated double offset = ((AplusParagraph *)pWidget_)->bottomPixel(); return gf(offset/MSPointsPerInch); } static void s_reportParagraphReportFont(MSWidgetView *pWidget_, A value_) { ((AplusParagraph *)pWidget_)->printFont(AplusConvert::asMSString(value_)); } static A g_reportParagraphReportFont(MSWidgetView *pWidget_) { return AplusConvert::asA(((AplusParagraph *)pWidget_)->printFont()); } static void s_reportParagraphPrintRow(MSWidgetView *pWidget_, int value_) { ((MSPrintItem *)(AplusParagraph *)pWidget_)->printRow(value_); } static I g_reportParagraphPrintRow(MSWidgetView *pWidget_) { return ((MSPrintItem *)(AplusParagraph *)pWidget_)->printRow(); } static void s_reportParagraphPrintColumn(MSWidgetView *pWidget_, int value_) { ((MSPrintItem *)(AplusParagraph *)pWidget_)->printColumn(value_); } static I g_reportParagraphPrintColumn(MSWidgetView *pWidget_) { return ((MSPrintItem *)(AplusParagraph *)pWidget_)->printColumn(); } static void s_reportParagraphJustify(MSWidgetView *pWidget_, A value_) { AplusAlignmentConverter converter; unsigned long justify = converter(value_); if (justify!=converter.enumNotFound()) { ((AplusParagraph *)pWidget_)->justification(justify); } } static A g_reportParagraphJustify(MSWidgetView *pWidget_) { AplusAlignmentConverter converter; return converter(((AplusParagraph *)pWidget_)->justification()); } static void s_reportParagraphPageAlign(MSWidgetView *pWidget_, A value_) { AplusAlignmentConverter converter; unsigned long align = converter(value_); if (align!=converter.enumNotFound()) { ((AplusParagraph *)pWidget_)->pageAlignment(align); } } static A g_reportParagraphPageAlign(MSWidgetView *pWidget_) { AplusAlignmentConverter converter; return converter(((AplusParagraph *)pWidget_)->pageAlignment()); } static void s_reportParagraphOccurrence(MSWidgetView *pWidget_, A value_) { AplusReportOccurrenceConverter converter; unsigned long occur = converter(value_); if (occur!=converter.enumNotFound()) { ((AplusParagraph *)pWidget_)->occurrence(occur); } } static A g_reportParagraphOccurrence(MSWidgetView *pWidget_) { AplusReportOccurrenceConverter converter; return converter(((AplusParagraph *)pWidget_)->occurrence()); } static void s_reportParagraphFirstLineIndent(MSWidgetView *pWidget_, A value_) { if (!QS(value_)) { AplusParagraph *paragraph = (AplusParagraph *)pWidget_; if (value_->t==Ft) // if it's a floating point value { paragraph->firstLineIndent(*(double*)value_->p); } else if (value_->t==It) // it's an integer { paragraph->firstLineIndent((double)*(I*)value_->p); } } } static A g_reportParagraphFirstLineIndent(MSWidgetView *pWidget_) { return gf(((AplusParagraph *)pWidget_)->firstLineIndent()); } static void s_reportParagraphLeading(MSWidgetView *pWidget_, unsigned value_) { ((AplusParagraph *)pWidget_)->leading(value_); } static unsigned g_reportParagraphLeading(MSWidgetView *pWidget_) { return ((AplusParagraph *)pWidget_)->leading(); } static void s_reportParagraphLineWidth(MSWidgetView *pWidget_, unsigned value_) { ((AplusParagraph *)pWidget_)->lineWidth(value_); } static unsigned g_reportParagraphLineWidth(MSWidgetView *pWidget_) { return ((AplusParagraph *)pWidget_)->lineWidth(); } static void s_reportParagraphFgGrayScale(MSWidgetView *pWidget_, A value_) { if (!QS(value_)) { AplusParagraph *paragraph = (AplusParagraph *)pWidget_; if (value_->t==Ft) // if it's a floating point value { paragraph->fgGrayScale(*(double*)value_->p); } else if (value_->t==It) // it's an integer { paragraph->fgGrayScale((double)*(I*)value_->p); } } } static A g_reportParagraphFgGrayScale(MSWidgetView *pWidget_) { return gf(((AplusParagraph *)pWidget_)->fgGrayScale()); } static void s_reportParagraphBgGrayScale(MSWidgetView *pWidget_, A value_) { if (!QS(value_)) { AplusParagraph *paragraph = (AplusParagraph *)pWidget_; if (value_->t==Ft) // if it's a floating point value { paragraph->bgGrayScale(*(double*)value_->p); } else if (value_->t==It) // it's an integer { paragraph->bgGrayScale((double)*(I*)value_->p); } } } static A g_reportParagraphBgGrayScale(MSWidgetView *pWidget_) { return gf(((AplusParagraph *)pWidget_)->bgGrayScale()); } static void s_reportParagraphOrphanRows(MSWidgetView *pWidget_, unsigned value_) { ((AplusParagraph *)pWidget_)->orphanRows(value_); } static unsigned g_reportParagraphOrphanRows(MSWidgetView *pWidget_) { return ((AplusParagraph *)pWidget_)->orphanRows(); } static void s_reportParagraphWidowRows(MSWidgetView *pWidget_, unsigned value_) { ((AplusParagraph *)pWidget_)->widowRows(value_); } static unsigned g_reportParagraphWidowRows(MSWidgetView *pWidget_) { return ((AplusParagraph *)pWidget_)->widowRows(); } static void s_reportParagraphStyle(MSWidgetView *pWidget_, A value_) { AplusReportStyleConverter converter; unsigned long style = converter(value_); if (style!=converter.enumNotFound()) { ((AplusParagraph *)pWidget_)->style(style); } } static A g_reportParagraphStyle(MSWidgetView *pWidget_) { AplusReportStyleConverter converter; return converter(((AplusParagraph *)pWidget_)->style()); } static void s_reportParagraphColumn(MSWidgetView *pWidget_, A value_) { if (QA(value_)) { AplusParagraph *paragraph = (AplusParagraph *)pWidget_; if (value_->t==Ft) // if it's a floating point value paragraph->column((long)*(double*)value_->p); else if (value_->t==It) // it's an integer paragraph->column(*(long*)value_->p); } } static I g_reportParagraphColumn(MSWidgetView *pWidget_) { return (I) ((AplusParagraph *)pWidget_)->column(); } static void s_reportParagraphColumnSpan(MSWidgetView *pWidget_, A value_) { if (QA(value_)) { AplusParagraph *paragraph = (AplusParagraph *)pWidget_; if (value_->t==Ft) // if it's a floating point value paragraph->columnSpan((long)*(double*)value_->p); else if (value_->t==It) // it's an integer paragraph->columnSpan(*(long*)value_->p); } } static I g_reportParagraphColumnSpan(MSWidgetView *pWidget_) { return (I) ((AplusParagraph *)pWidget_)->columnSpan(); } //************** ReportColumn attributes ******************** static void s_reportColumnLeftMargin(MSWidgetView *pWidget_, A value_) { if (!QS(value_)) { AplusPrintColumn *pColumn = (AplusPrintColumn *)pWidget_; if (value_->t==Ft) // if it's a floating point value { pColumn->leftMargin(*(double*)value_->p); } else if (value_->t==It) // it's an integer { pColumn->leftMargin((double)*(I*)value_->p); } } } static A g_reportColumnLeftMargin(MSWidgetView *pWidget_) { // A fix for a small MStk problem - to be fixed in MStk for release 2.6: // margins in inches are calculated based on the corresponding pixel offset values; // the default pixel offset is -1 (meaning that it's inherited from the report's pixel offset); // thus, the default margin is -0.0139, which is confusing to the user - it should also be -1. double margin = ((AplusPrintColumn *)pWidget_)->leftMargin(); return gf((margin<0)?-1:margin); } static void s_reportColumnRightMargin(MSWidgetView *pWidget_, A value_) { if (!QS(value_)) { AplusPrintColumn *pColumn = (AplusPrintColumn *)pWidget_; if (value_->t==Ft) // if it's a floating point value { pColumn->rightMargin(*(double*)value_->p); } else if (value_->t==It) // it's an integer { pColumn->rightMargin((double)*(I*)value_->p); } } } static A g_reportColumnRightMargin(MSWidgetView *pWidget_) { // A fix for a small MStk problem - to be fixed in MStk for release 2.6: // margins in inches are calculated based on the corresponding pixel offset values; // the default pixel offset is -1 (meaning that it's inherited from the report's pixel offset); // thus, the default margin is -0.0139, which is confusing to the user - it should also be -1. double margin = ((AplusPrintColumn *)pWidget_)->rightMargin(); return gf((margin<0)?-1:margin); } static void s_reportColumnTopOffset(MSWidgetView *pWidget_, A value_) { if (!QS(value_)) { AplusPrintColumn *pColumn = (AplusPrintColumn *)pWidget_; if (value_->t==Ft) // if it's a floating point value { pColumn->topOffset(*(double*)value_->p); } else if (value_->t==It) // it's an integer { pColumn->topOffset((double)*(I*)value_->p); } } } static A g_reportColumnTopOffset(MSWidgetView *pWidget_) { // A fix for an MStk bug to be fixed in MStk 2.6: // MSPrintItem::topOffset() and MSPrintItem::bottomOffset() methods do the cast to double incorrectly // so the decimal part gets truncated double offset = ((AplusPrintColumn *)pWidget_)->topPixel(); return gf(offset/MSPointsPerInch); } static void s_reportColumnBottomOffset(MSWidgetView *pWidget_, A value_) { if (!QS(value_)) { AplusPrintColumn *pColumn = (AplusPrintColumn *)pWidget_; if (value_->t==Ft) // if it's a floating point value { pColumn->bottomOffset(*(double*)value_->p); } else if (value_->t==It) // it's an integer { pColumn->bottomOffset((double)*(I*)value_->p); } } } static A g_reportColumnBottomOffset(MSWidgetView *pWidget_) { // A fix for an MStk bug to be fixed in MStk 2.6: // MSPrintItem::topOffset() and MSPrintItem::bottomOffset() methods do the cast to double incorrectly // so the decimal part gets truncated double offset = ((AplusPrintColumn *)pWidget_)->bottomPixel(); return gf(offset/MSPointsPerInch); } static void s_reportColumnReportFont(MSWidgetView *pWidget_, A value_) { ((AplusPrintColumn *)pWidget_)->printFont(AplusConvert::asMSString(value_)); } static A g_reportColumnReportFont(MSWidgetView *pWidget_) { return AplusConvert::asA(((AplusPrintColumn *)pWidget_)->printFont()); } static void s_reportColumnPrintRow(MSWidgetView *pWidget_, int value_) { ((AplusPrintColumn *)pWidget_)->printRow(value_); } static I g_reportColumnPrintRow(MSWidgetView *pWidget_) { return (I) ((AplusPrintColumn *)pWidget_)->printRow(); } static void s_reportColumnPrintColumn(MSWidgetView *pWidget_, int value_) { ((AplusPrintColumn *)pWidget_)->printColumn(value_); } static I g_reportColumnPrintColumn(MSWidgetView *pWidget_) { return (I) ((AplusPrintColumn *)pWidget_)->printColumn(); } static void s_reportColumnJustify(MSWidgetView *pWidget_, A value_) { AplusAlignmentConverter converter; unsigned long justify = converter(value_); if (justify!=converter.enumNotFound()) { ((AplusPrintColumn *)pWidget_)->justification(justify); } } static A g_reportColumnJustify(MSWidgetView *pWidget_) { AplusAlignmentConverter converter; return converter(((AplusPrintColumn *)pWidget_)->justification()); } static void s_reportColumnPageAlign(MSWidgetView *pWidget_, A value_) { AplusAlignmentConverter converter; unsigned long align = converter(value_); if (align!=converter.enumNotFound()) { ((AplusPrintColumn *)pWidget_)->pageAlignment(align); } } static A g_reportColumnPageAlign(MSWidgetView *pWidget_) { AplusAlignmentConverter converter; return converter(((AplusPrintColumn *)pWidget_)->pageAlignment()); } static void s_reportColumnOccurrence(MSWidgetView *pWidget_, A value_) { AplusReportOccurrenceConverter converter; unsigned long occur = converter(value_); if (occur!=converter.enumNotFound()) { ((AplusPrintColumn *)pWidget_)->occurrence(occur); } } static A g_reportColumnOccurrence(MSWidgetView *pWidget_) { AplusReportOccurrenceConverter converter; return converter(((AplusPrintColumn *)pWidget_)->occurrence()); } static void s_reportColumnColumnWidths(MSWidgetView *pWidget_, A value_) { if (!QS(value_) && value_->r<2 && (value_->t==It || value_->t==Ft)) // if it's an int or float scalar or vector { AplusPrintColumn *pColumn = (AplusPrintColumn *)pWidget_; if (value_->r==0) // if it's a scalar (as opposed to a one-element vector) { double width = (value_->t==Ft) ? *(double*)value_->p : *(I*)value_->p; pColumn->columnWidths(MSFloatVector(1,width)); } else { MSFloatVector widths(AplusConvert::asMSFloatVector(value_)); if (widths.length() > 0) { pColumn->columnWidths(widths); } } } } static A g_reportColumnColumnWidths(MSWidgetView *pWidget_) { return AplusConvert::asA(((AplusPrintColumn *)pWidget_)->columnWidths()); } static void s_reportColumnNumColumns(MSWidgetView *pWidget_, unsigned value_) { ((AplusPrintColumn *)pWidget_)->numColumns(value_); } static unsigned g_reportColumnNumColumns(MSWidgetView *pWidget_) { return ((AplusPrintColumn *)pWidget_)->numColumns(); } static void s_reportColumnStyle(MSWidgetView *pWidget_, A value_) { AplusReportStyleConverter converter; unsigned long style = converter(value_); if (style!=converter.enumNotFound()) { ((AplusPrintColumn *)pWidget_)->style(style); } } static A g_reportColumnStyle(MSWidgetView *pWidget_) { AplusReportStyleConverter converter; return converter(((AplusPrintColumn *)pWidget_)->style()); } //**************** ReportRule attributes ********************* static void s_reportRuleLeftMargin(MSWidgetView *pWidget_, A value_) { if (!QS(value_)) { AplusRulePrintItem *pRule = (AplusRulePrintItem *)pWidget_; if (value_->t==Ft) // if it's a floating point value { pRule->leftMargin(*(double*)value_->p); } else if (value_->t==It) // it's an integer { pRule->leftMargin((double)*(I*)value_->p); } } } static A g_reportRuleLeftMargin(MSWidgetView *pWidget_) { // A fix for a small MStk problem - to be fixed in MStk for release 2.6: // margins in inches are calculated based on the corresponding pixel offset values; // the default pixel offset is -1 (meaning that it's inherited from the report's pixel offset); // thus, the default margin is -0.0139, which is confusing to the user - it should also be -1. double margin = ((AplusRulePrintItem *)pWidget_)->leftMargin(); return gf((margin<0)?-1:margin); } static void s_reportRuleRightMargin(MSWidgetView *pWidget_, A value_) { if (!QS(value_)) { AplusRulePrintItem *pRule = (AplusRulePrintItem *)pWidget_; if (value_->t==Ft) // if it's a floating point value { pRule->rightMargin(*(double*)value_->p); } else if (value_->t==It) // it's an integer { pRule->rightMargin((double)*(I*)value_->p); } } } static A g_reportRuleRightMargin(MSWidgetView *pWidget_) { // A fix for a small MStk problem - to be fixed in MStk for release 2.6: // margins in inches are calculated based on the corresponding pixel offset values; // the default pixel offset is -1 (meaning that it's inherited from the report's pixel offset); // thus, the default margin is -0.0139, which is confusing to the user - it should also be -1. double margin = ((AplusRulePrintItem *)pWidget_)->rightMargin(); return gf((margin<0)?-1:margin); } static void s_reportRuleTopOffset(MSWidgetView *pWidget_, A value_) { if (!QS(value_)) { AplusRulePrintItem *pRule = (AplusRulePrintItem *)pWidget_; if (value_->t==Ft) // if it's a floating point value { pRule->topOffset(*(double*)value_->p); } else if (value_->t==It) // it's an integer { pRule->topOffset((double)*(I*)value_->p); } } } static A g_reportRuleTopOffset(MSWidgetView *pWidget_) { // A fix for an MStk bug to be fixed in MStk 2.6: // MSPrintItem::topOffset() and MSPrintItem::bottomOffset() methods do the cast to double incorrectly // so the decimal part gets truncated double offset = ((AplusRulePrintItem *)pWidget_)->topPixel(); return gf(offset/MSPointsPerInch); } static void s_reportRuleBottomOffset(MSWidgetView *pWidget_, A value_) { if (!QS(value_)) { AplusRulePrintItem *pRule = (AplusRulePrintItem *)pWidget_; if (value_->t==Ft) // if it's a floating point value { pRule->bottomOffset(*(double*)value_->p); } else if (value_->t==It) // it's an integer { pRule->bottomOffset((double)*(I*)value_->p); } } } static A g_reportRuleBottomOffset(MSWidgetView *pWidget_) { // A fix for an MStk bug to be fixed in MStk 2.6: // MSPrintItem::topOffset() and MSPrintItem::bottomOffset() methods do the cast to double incorrectly // so the decimal part gets truncated double offset = ((AplusRulePrintItem *)pWidget_)->bottomPixel(); return gf(offset/MSPointsPerInch); } static void s_reportRuleFgGrayScale(MSWidgetView *pWidget_, A value_) { if (!QS(value_)) { AplusRulePrintItem *pRule = (AplusRulePrintItem *)pWidget_; if (value_->t==Ft) // if it's a floating point value { pRule->fgGrayScale(*(double*)value_->p); } else if (value_->t==It) // it's an integer { pRule->fgGrayScale((double)*(I*)value_->p); } } } static A g_reportRuleFgGrayScale(MSWidgetView *pWidget_) { return gf(((AplusRulePrintItem *)pWidget_)->fgGrayScale()); } static void s_reportRuleRuleWidth(MSWidgetView *pWidget_, unsigned value_) { ((AplusRulePrintItem *)pWidget_)->ruleWidth(value_); } static unsigned g_reportRuleRuleWidth(MSWidgetView *pWidget_) { return ((AplusRulePrintItem *)pWidget_)->ruleWidth(); } //////////////////////////////////////////////////////////////////////////////// static MSPrintText *c_APrintText(void) { return new AplusPrintText();} static MSWidgetView *c_AXReportParagraph(MSWidgetView *parent_) { return (MSWidgetView *)new AplusParagraph(validateParent(parent_)); } static MSWidgetView *c_AXReportRule(MSWidgetView *parent_) { return (MSWidgetView *)new AplusRulePrintItem(validateParent(parent_)); } static MSWidgetView *c_AXReportColumn(MSWidgetView *parent_) { return (MSWidgetView *)new AplusPrintColumn(validateParent(parent_)); } static MSWidgetView *c_AXReport(MSWidgetView *parent_) { return (MSWidgetView *)new AplusPrintTool(validateParent(parent_)); } //////////////////////////////////////////////////////////////////////////////// void installPrintCommands(void) { // Print Commands install((PFI)s_printPageOrientation,"s_printPageOrientation",V_,1,A_,0,0,0,0,0,0,0); install((PFI)g_printPageOrientation,"g_printPageOrientation",A_,0,0,0,0,0,0,0,0,0); install((PFI)s_printPagesize,"s_printPagesize",V_,1,A_,0,0,0,0,0,0,0); install((PFI)g_printPagesize,"g_printPagesize",A_,0,0,0,0,0,0,0,0,0); install((PFI)s_printMode,"s_printMode",V_,1,A_,0,0,0,0,0,0,0); install((PFI)g_printMode,"g_printMode",A_,0,0,0,0,0,0,0,0,0); install((PFI)s_printOutputMode,"s_printOutputMode",V_,1,A_,0,0,0,0,0,0,0); install((PFI)g_printOutputMode,"g_printOutputMode",A_,0,0,0,0,0,0,0,0,0); install((PFI)s_printPageAlign,"s_printPageStyle",V_,1,A_,0,0,0,0,0,0,0); install((PFI)g_printPageAlign,"g_printPageStyle",A_,0,0,0,0,0,0,0,0,0); install((PFI)s_printDefaultFont,"s_printDefaultFont",V_,1,IV,0,0,0,0,0,0,0); install((PFI)g_printDefaultFont,"g_printDefaultFont",IV,0,0,0,0,0,0,0,0,0); install((PFI)s_printLeftMargin,"s_printLeftMargin",V_,1,A_,0,0,0,0,0,0,0); install((PFI)g_printLeftMargin,"g_printLeftMargin",A_,0,0,0,0,0,0,0,0,0); install((PFI)s_printRightMargin,"s_printRightMargin",V_,1,A_,0,0,0,0,0,0,0); install((PFI)g_printRightMargin,"g_printRightMargin",A_,0,0,0,0,0,0,0,0,0); install((PFI)s_printTopMargin,"s_printTopMargin",V_,1,A_,0,0,0,0,0,0,0); install((PFI)g_printTopMargin,"g_printTopMargin",A_,0,0,0,0,0,0,0,0,0); install((PFI)s_printBottomMargin,"s_printBottomMargin",V_,1,A_,0,0,0,0,0,0,0); install((PFI)g_printBottomMargin,"g_printBottomMargin",A_,0,0,0,0,0,0,0,0,0); install((PFI)s_printMargins,"s_printMargins",V_,1,A_,0,0,0,0,0,0,0); install((PFI)s_printFile,"s_printFile",V_,1,A_,0,0,0,0,0,0,0); install((PFI)g_printFile,"g_printFile",A_,0,0,0,0,0,0,0,0,0); install((PFI)s_printDisOrientation,"s_printDisOrientation",V_,1,A_,0,0,0,0,0,0,0); install((PFI)g_printDisOrientation,"g_printDisOrientation",A_,0,0,0,0,0,0,0,0,0); install((PFI)s_printDisclaimerStyle,"s_printDisclaimerStyle",V_,1,A_,0,0,0,0,0,0,0); install((PFI)g_printDisclaimerStyle,"g_printDisclaimerStyle",A_,0,0,0,0,0,0,0,0,0); install((PFI)s_printDisclaimerFile,"s_printDisclaimerFile",V_,1,A_,0,0,0,0,0,0,0); install((PFI)g_printDisclaimerFile,"g_printDisclaimerFile",A_,0,0,0,0,0,0,0,0,0); install((PFI)s_printDisclaimerFont,"s_printDisclaimerFont",V_,1,IV,0,0,0,0,0,0,0); install((PFI)g_printDisclaimerFont,"g_printDisclaimerFont",IV,0,0,0,0,0,0,0,0,0); install((PFI)s_printDisLeftMargin,"s_printDisLeftMargin",V_,1,A_,0,0,0,0,0,0,0); install((PFI)g_printDisLeftMargin,"g_printDisLeftMargin",A_,0,0,0,0,0,0,0,0,0); install((PFI)s_printDisRightMargin,"s_printDisRightMargin",V_,1,A_,0,0,0,0,0,0,0); install((PFI)g_printDisRightMargin,"g_printDisRightMargin",A_,0,0,0,0,0,0,0,0,0); install((PFI)s_printDisTopMargin,"s_printDisTopMargin",V_,1,A_,0,0,0,0,0,0,0); install((PFI)g_printDisTopMargin,"g_printDisTopMargin",A_,0,0,0,0,0,0,0,0,0); install((PFI)s_printDisBottomMargin,"s_printDisBottomMargin",V_,1,A_,0,0,0,0,0,0,0); install((PFI)g_printDisBottomMargin,"g_printDisBottomMargin",A_,0,0,0,0,0,0,0,0,0); install((PFI)s_printDisRuleWidth,"s_printDisRuleWidth",V_,1,IV,0,0,0,0,0,0,0); install((PFI)g_printDisRuleWidth,"g_printDisRuleWidth",IV,0,0,0,0,0,0,0,0,0); install((PFI)bprint,"bprint",V_,1,IV,0,0,0,0,0,0,0); install((PFI)q_printDisclaimer,"q_printDisclaimer",A_,0,0,0,0,0,0,0,0,0); install((PFI)q_printPageOrientation,"q_printDisOrientation",A_,0,0,0,0,0,0,0,0,0); install((PFI)q_printPageOrientation,"q_printPageOrientation",A_,0,0,0,0,0,0,0,0,0); install((PFI)q_printPageSize,"q_printPageSize",A_,0,0,0,0,0,0,0,0,0); install((PFI)q_printMode,"q_printMode",A_,0,0,0,0,0,0,0,0,0); install((PFI)q_printPaperTray,"q_printPaperTray",A_,0,0,0,0,0,0,0,0,0); install((PFI)q_printOutputMode,"q_printOutputMode",A_,0,0,0,0,0,0,0,0,0); } void installReportParagraphCommands(void) { install((PFI)c_AXReportParagraph, "c_AXReportParagraph",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportParagraphLeftMargin,"s_reportParagraphLeftMargin",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportParagraphLeftMargin,"g_reportParagraphLeftMargin",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportParagraphRightMargin,"s_reportParagraphRightMargin",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportParagraphRightMargin,"g_reportParagraphRightMargin",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportParagraphTopOffset,"s_reportParagraphTopOffset",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportParagraphTopOffset,"g_reportParagraphTopOffset",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportParagraphBottomOffset,"s_reportParagraphBottomOffset",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportParagraphBottomOffset,"g_reportParagraphBottomOffset",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportParagraphReportFont,"s_reportParagraphReportFont",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportParagraphReportFont,"g_reportParagraphReportFont",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportParagraphPrintRow,"s_reportParagraphPrintRow",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_reportParagraphPrintRow,"g_reportParagraphPrintRow",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportParagraphPrintColumn,"s_reportParagraphPrintColumn",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_reportParagraphPrintColumn,"g_reportParagraphPrintColumn",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportParagraphJustify,"s_reportParagraphJustify",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportParagraphJustify,"g_reportParagraphJustify",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportParagraphPageAlign,"s_reportParagraphPageAlign",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportParagraphPageAlign,"g_reportParagraphPageAlign",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportParagraphOccurrence,"s_reportParagraphOccurrence",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportParagraphOccurrence,"g_reportParagraphOccurrence",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportParagraphFirstLineIndent,"s_reportParagraphFirstLineIndent",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportParagraphFirstLineIndent,"g_reportParagraphFirstLineIndent",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportParagraphLeading,"s_reportParagraphLeading",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_reportParagraphLeading,"g_reportParagraphLeading",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportParagraphLineWidth,"s_reportParagraphLineWidth",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_reportParagraphLineWidth,"g_reportParagraphLineWidth",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportParagraphFgGrayScale,"s_reportParagraphFgGrayScale",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportParagraphFgGrayScale,"g_reportParagraphFgGrayScale",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportParagraphBgGrayScale,"s_reportParagraphBgGrayScale",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportParagraphBgGrayScale,"g_reportParagraphBgGrayScale",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportParagraphOrphanRows,"s_reportParagraphOrphanRows",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_reportParagraphOrphanRows,"g_reportParagraphOrphanRows",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportParagraphWidowRows,"s_reportParagraphWidowRows",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_reportParagraphWidowRows,"g_reportParagraphWidowRows",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportParagraphStyle,"s_reportParagraphStyle",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportParagraphStyle,"g_reportParagraphStyle",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportParagraphColumn,"s_reportParagraphColumn",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportParagraphColumn,"g_reportParagraphColumn",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportParagraphColumnSpan,"s_reportParagraphColumnSpan",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportParagraphColumnSpan,"g_reportParagraphColumnSpan",IV,1,IV,0,0,0,0,0,0,0); } void installReportColumnCommands(void) { install((PFI)c_AXReportColumn, "c_AXReportColumn",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportColumnLeftMargin,"s_reportColumnLeftMargin",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportColumnLeftMargin,"g_reportColumnLeftMargin",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportColumnRightMargin,"s_reportColumnRightMargin",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportColumnRightMargin,"g_reportColumnRightMargin",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportColumnTopOffset,"s_reportColumnTopOffset",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportColumnTopOffset,"g_reportColumnTopOffset",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportColumnBottomOffset,"s_reportColumnBottomOffset",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportColumnBottomOffset,"g_reportColumnBottomOffset",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportColumnReportFont,"s_reportColumnReportFont",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportColumnReportFont,"g_reportColumnReportFont",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportColumnPrintRow,"s_reportColumnPrintRow",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_reportColumnPrintRow,"g_reportColumnPrintRow",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportColumnPrintColumn,"s_reportColumnPrintColumn",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_reportColumnPrintColumn,"g_reportColumnPrintColumn",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportColumnJustify,"s_reportColumnJustify",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportColumnJustify,"g_reportColumnJustify",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportColumnPageAlign,"s_reportColumnPageAlign",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportColumnPageAlign,"g_reportColumnPageAlign",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportColumnOccurrence,"s_reportColumnOccurrence",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportColumnOccurrence,"g_reportColumnOccurrence",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportColumnColumnWidths,"s_reportColumnColumnWidths",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportColumnColumnWidths,"g_reportColumnColumnWidths",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportColumnNumColumns,"s_reportColumnNumColumns",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_reportColumnNumColumns,"g_reportColumnNumColumns",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportColumnStyle,"s_reportColumnStyle",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportColumnStyle,"g_reportColumnStyle",A_,1,IV,0,0,0,0,0,0,0); } void installReportRuleCommands(void) { install((PFI)c_AXReportRule, "c_AXReportRule",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportRuleLeftMargin,"s_reportRuleLeftMargin",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportRuleLeftMargin,"g_reportRuleLeftMargin",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportRuleRightMargin,"s_reportRuleRightMargin",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportRuleRightMargin,"g_reportRuleRightMargin",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportRuleTopOffset,"s_reportRuleTopOffset",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportRuleTopOffset,"g_reportRuleTopOffset",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportRuleBottomOffset,"s_reportRuleBottomOffset",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportRuleBottomOffset,"g_reportRuleBottomOffset",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportRuleFgGrayScale,"s_reportRuleFgGrayScale",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportRuleFgGrayScale,"g_reportRuleFgGrayScale",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportRuleRuleWidth,"s_reportRuleRuleWidth",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_reportRuleRuleWidth,"g_reportRuleRuleWidth",IV,1,IV,0,0,0,0,0,0,0); } void installPrintTextCommands(void) { install((PFI)s_printtextText,"s_printtextText",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_printtextText,"g_printtextText",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_printtextFont,"s_printtextFont",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_printtextFont,"g_printtextFont",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_printtextForeground,"s_printtextForeground",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_printtextForeground,"g_printtextForeground",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_printtextBackground,"s_printtextBackground",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_printtextBackground,"g_printtextBackground",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_printtextJustification,"s_printtextJustification",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_printtextJustification,"g_printtextJustification",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_printtextStyle,"s_printtextStyle",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_printtextStyle,"g_printtextStyle",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_printtextMode,"s_printtextMode",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_printtextMode,"g_printtextMode",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_printtextFontSize,"s_printtextFontSize",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_printtextFontSize,"g_printtextFontSize",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_printtextLeading,"s_printtextLeading",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_printtextLeading,"g_printtextLeading",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_printtextTopPixel,"s_printtextTopPixel",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_printtextTopPixel,"g_printtextTopPixel",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_printtextBottomPixel,"s_printtextBottomPixel",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_printtextBottomPixel,"g_printtextBottomPixel",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_printtextFontScale,"s_printtextFontScale",V_,2,IV,A_,0,0,0,0,0,0); // DOUBLEs install((PFI)g_printtextFontScale,"g_printtextFontScale",A_,1,IV,0,0,0,0,0,0,0); // DOUBLEs install((PFI)s_printtextFgGrayScale,"s_printtextFgGrayScale",V_,2,IV,A_,0,0,0,0,0,0); // DOUBLEs install((PFI)g_printtextFgGrayScale,"g_printtextFgGrayScale",A_,1,IV,0,0,0,0,0,0,0); // DOUBLEs install((PFI)s_printtextBgGrayScale,"s_printtextBgGrayScale",V_,2,IV,A_,0,0,0,0,0,0); // DOUBLEs install((PFI)g_printtextBgGrayScale,"g_printtextBgGrayScale",A_,1,IV,0,0,0,0,0,0,0); // DOUBLEs install((PFI)s_printtextLineWidth,"s_printtextLineWidth",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_printtextLineWidth,"g_printtextLineWidth",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_printtextRow,"s_printtextRow",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_printtextRow,"g_printtextRow",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_printtextColumn,"s_printtextColumn",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_printtextColumn,"g_printtextColumn",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_printtextFirstColumn,"s_printtextFirstColumn",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_printtextFirstColumn,"g_printtextFirstColumn",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_printtextxOrigin,"s_printtextxOrigin",V_,2,IV,A_,0,0,0,0,0,0); // DOUBLEs install((PFI)g_printtextxOrigin,"g_printtextxOrigin",A_,1,IV,0,0,0,0,0,0,0); // DOUBLEs install((PFI)s_printtextyOrigin,"s_printtextyOrigin",V_,2,IV,A_,0,0,0,0,0,0); // DOUBLEs install((PFI)g_printtextyOrigin,"g_printtextyOrigin",A_,1,IV,0,0,0,0,0,0,0); // DOUBLEs install((PFI)s_printtextTopOffset,"s_printtextTopOffset",V_,2,IV,A_,0,0,0,0,0,0); // DOUBLEs install((PFI)g_printtextTopOffset,"g_printtextTopOffset",A_,1,IV,0,0,0,0,0,0,0); // DOUBLEs install((PFI)s_printtextBottomOffset,"s_printtextBottomOffset",V_,2,IV,A_,0,0,0,0,0,0); // DOUBLEs install((PFI)g_printtextBottomOffset,"g_printtextBottomOffset",A_,1,IV,0,0,0,0,0,0,0); // DOUBLEs install((PFI)c_APrintText, "c_APrintText",IV,0,0,0,0,0,0,0,0,0); } void installReportCommands(void) { // Report Commands install((PFI)s_reportPageOrientation,"s_reportPageOrientation",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportPageOrientation,"g_reportPageOrientation",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportDisclaimerOrientation,"s_reportDisclaimerOrientation",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportDisclaimerOrientation,"g_reportDisclaimerOrientation",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportPagesize,"s_reportPagesize",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportPagesize,"g_reportPagesize",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportOutputMode,"s_reportOutputMode",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportOutputMode,"g_reportOutputMode",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportDisclaimerStyle,"s_reportDisclaimerStyle",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportDisclaimerStyle,"g_reportDisclaimerStyle",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportLeftMargin,"s_reportLeftMargin",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportLeftMargin,"g_reportLeftMargin",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportRightMargin,"s_reportRightMargin",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportRightMargin,"g_reportRightMargin",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportTopMargin,"s_reportTopMargin",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportTopMargin,"g_reportTopMargin",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportBottomMargin,"s_reportBottomMargin",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportBottomMargin,"g_reportBottomMargin",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportMargins,"s_reportMargins",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)s_reportDisclaimerLeftMargin,"s_reportDisclaimerLeftMargin",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportDisclaimerLeftMargin,"g_reportDisclaimerLeftMargin",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportDisclaimerRightMargin,"s_reportDisclaimerRightMargin",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportDisclaimerRightMargin,"g_reportDisclaimerRightMargin",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportDisclaimerTopMargin,"s_reportDisclaimerTopMargin",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportDisclaimerTopMargin,"g_reportDisclaimerTopMargin",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportDisclaimerBottomMargin,"s_reportDisclaimerBottomMargin",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportDisclaimerBottomMargin,"g_reportDisclaimerBottomMargin",A_,1,IV,0,0,0,0,0,0,0); install((PFI)g_reportFileName,"g_reportFileName",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportFileName,"s_reportFileName",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportDisclaimerFile,"g_reportDisclaimerFile",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportDisclaimerFile,"s_reportDisclaimerFile",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportDisclaimerRuleWidth,"g_reportDisclaimerRuleWidth",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportDisclaimerRuleWidth,"s_reportDisclaimerRuleWidth",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_reportFooter,"g_reportFooter",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportFooter,"s_reportFooter",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportHeader,"g_reportHeader",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportHeader,"s_reportHeader",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportBanner,"g_reportBanner",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportBanner,"s_reportBanner",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)s_reportCancel,"s_reportCancel",V_,1,IV,0,0,0,0,0,0,0); install((PFI)g_reportFooterOffset,"g_reportFooterOffset",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportFooterOffset,"s_reportFooterOffset",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_reportPageFrameLineWidth,"g_reportPageFrameLineWidth",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportPageFrameLineWidth,"s_reportPageFrameLineWidth",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_reportPageFrameOffset,"g_reportPageFrameOffset",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportPageFrameOffset,"s_reportPageFrameOffset",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_reportPageFrameStyle,"g_reportPageFrameStyle",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportPageFrameStyle,"s_reportPageFrameStyle",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportHeaderOffset,"g_reportHeaderOffset",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportHeaderOffset,"s_reportHeaderOffset",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_reportPageCount,"g_reportPageCount",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_reportPageCountTotal,"g_reportPageCountTotal",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_reportPageNumbers,"g_reportPageNumbers",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportPageNumbers,"s_reportPageNumbers",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportPageNumbering,"g_reportPageNumbering",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportPageNumbering,"s_reportPageNumbering",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_reportPageNumberText,"g_reportPageNumberText",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportPageNumberText,"s_reportPageNumberText",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportPageNumber,"g_reportPageNumber",A_,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportPageNumber,"s_reportPageNumber",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportUniformScaling,"g_reportUniformScaling",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportUniformScaling,"s_reportUniformScaling",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)s_reportPrint,"s_reportPrint",V_,1,IV,0,0,0,0,0,0,0); install((PFI)addReportCB,"bAddReportCB",V_,3,IV,A_,A_,0,0,0,0,0); install((PFI)getReportCB,"bGetReportCB",A_,2,IV,A_,0,0,0,0,0,0); install((PFI)s_reportPageNumberOffset,"s_reportPageNumberOffset",V_,2,IV,IV,0,0,0,0,0,0); install((PFI)g_reportPageNumberOffset,"g_reportPageNumberOffset",IV,1,IV,0,0,0,0,0,0,0); install((PFI)g_reportFontSize,"g_reportFontSize",IV,1,IV,0,0,0,0,0,0,0); install((PFI)s_reportPrintMode,"s_reportPrintMode",V_,2,IV,A_,0,0,0,0,0,0); install((PFI)g_reportPrintMode,"g_reportPrintMode",A_,1,IV,0,0,0,0,0,0,0); install((PFI)q_reportPageOrientation,"q_reportPageOrientation",A_,0,0,0,0,0,0,0,0,0); install((PFI)q_reportPageSize,"q_reportPageSize",A_,0,0,0,0,0,0,0,0,0); install((PFI)q_reportOutputMode,"q_reportOutputMode",A_,0,0,0,0,0,0,0,0,0); install((PFI)q_reportDisclaimerStyle,"q_reportDisclaimerStyle",A_,0,0,0,0,0,0,0,0,0); install((PFI)q_reportStyle,"q_reportStyle",A_,0,0,0,0,0,0,0,0,0); install((PFI)q_reportOccurrence,"q_reportOccurrence",A_,0,0,0,0,0,0,0,0,0); install((PFI)q_reportCompMode,"q_reportCompMode",A_,0,0,0,0,0,0,0,0,0); install((PFI)c_AXReport, "c_AXReport",IV,1,IV,0,0,0,0,0,0,0); installPrintTextCommands(); installReportParagraphCommands(); installReportRuleCommands(); installReportColumnCommands(); } void AGIFPrintInstall(void) { CX context=Cx; Cx=cx("s"); installPrintCommands(); installReportCommands(); Cx=context; } /******************************************************************************** MSReportTable Attributes ======================== Method Arg Type Type ------ ------------------- ---------------- AddGroupHeading breakColumn Index Vector r only breakFont string r/w breakIndex Index Vector r only breakStyle unsigned r/w breakTextColumn Index Vector r only generateReport void r only grandTotal void r only grandTotalText print text sf r/w groupHeading PROBABLY DOESN'T WORK headingStyle unsigned r/w pageBreakIndex Index Vector r only pageTotalOn boolean r/w reportFont string r/w reportGrandTotalOn boolean r/w reportHeadingFont string r/w reportTitle string vector r/w reportTotalFont string r/w reportTotalLeading unsigned r/w reportTotalOn boolean r/w reportTotalStyle unsigned r/w style unsigned r/w MSTableColumn ================= Method Arg Type Type ------ ------------------- ---------------- addBreakText PrintTextSlotFiller w only bgGrayScale double r/w breakFont string r/w breakIndex index vector r only breakLeading int r/w breakOffset int r/w breakon Boolean r/w breakProcessOn Boolean r/w breakString string vector r/w breakStyle unsigned r/w breaktext unsigned (returns sf) r only fgGrayScale double r/w headingStyle unsigned r/w pageBreakOn Boolean r/w removeAllBreakText void r only removeBreakText unsigned r only reportFont string r/w style unsigned r/w suppressDuplicate boolean r/w virtual functions - - - - - - - - - formatBreak functional attribute r/w isDuplicate bool func attr r/w style breakStyle breakOffset breakLeading reportFont breakFont fgGrayScale bgGrayScale */ aplus-fsf-4.22/src/AplusGUI/AplusApplication.C0000644000265000001440000001215510772770344014631 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #include "AplusApplication.H" #include #ifdef __VISUAL_C_2_0__ #define select(a1, a2, a3, a4, a5) __MSTK_select(a1,a2,a3,a4,a5) static int __winx_timer_ID = -1; extern int SetWindowsTimer(int nmilliseconds); extern void KillWindowsTimer(int id); static int __MSTK_select(unsigned long,void *,void *,void *, struct timeval *timeout) { int nmsecs = timeout ? (1000*timeout->tv_sec + timeout->tv_usec/1000) : 0; if (nmsecs) { if (__winx_timer_ID != -1) KillWindowsTimer(__winx_timer_ID); __winx_timer_ID = SetWindowsTimer(nmsecs); printf("Timer %d = %d msecs\n", __winx_timer_ID, nmsecs); } return 1; } #endif extern "C" void AplusLoop(long, char**, int); extern "C" int chanproc(void); extern "C" int timerproc(void); extern "C" int sgnlproc(void); extern fd_set *fds_r; extern fd_set *fds_w; extern fd_set *fds_x; extern fd_set *fds_ra; extern fd_set *fds_wa; extern fd_set *fds_xa; extern int fds_size; extern "C" void pr(void); extern "C" struct timeval *timernext(); extern MSBoolean processAVariables(void); extern MSBoolean processDeleteQueue(void); // AplusApplication has a different main loop than // MSApplication. It deletes the *mainLoop created // by the constructor of MSApplication and make it // Point to a AplusMainLoop AplusApplication::AplusApplication(void) { if (mainLoop()!=0) { delete mainLoop(); } _mainLoop=new AplusMainLoop(this); } AplusApplication::AplusApplication(int argc_,char **argv_) : MSApplication(argc_, argv_) { if (mainLoop()!=0) { delete mainLoop(); } _mainLoop=new AplusMainLoop(this); } AplusApplication::~AplusApplication(void) {} AplusMainLoop::AplusMainLoop(MSApplication *pApplication_) : MSApplicationMainLoop(pApplication_) {} AplusMainLoop::~AplusMainLoop(void) {} MSBoolean AplusMainLoop::processTimers(void) { (void)timerproc(); MSBoolean rc=MSMainLoop::processTimers(); return rc; } void AplusMainLoop::innerLoopFlush(MSBoolean) { if (flush()==MSTrue||processAVariables()==MSTrue) zeroTimeOut(MSTrue); else zeroTimeOut(MSFalse); } void AplusMainLoop::selectAndProcess(void) { struct timeval timeout; struct timeval *tvpnext; struct timeval *tvp; int rc; // Merging MSTK and Dap File Descriptors // Copy Enabled to Abled MSChannel::fds()->fdsor(fds_r,MSChannel::fds()->r(),MSChannel::fds()->ra()); MSChannel::fds()->fdsor(fds_w,MSChannel::fds()->w(),MSChannel::fds()->wa()); MSChannel::fds()->fdsor(fds_x,MSChannel::fds()->x(),MSChannel::fds()->xa()); // set up timeout if (zeroTimeOut()==MSTrue) { tvp=&timeout; tvp->tv_sec=tvp->tv_usec=(long)(0); } // Have to check both MSTK timers and Dap timers to determine a proper timeout value else if ((tvpnext=MSTimer::nextTimeVal())==(struct timeval *)(0)&& (tvpnext=timernext())==(struct timeval *)(0)) { tvp=(struct timeval *)(0); } else { tvp=&timeout; (void) tvdiff(tvpnext,tod(),tvp); if (tvp->tv_sec<0) tvp->tv_sec=tvp->tv_usec=(long)(0); } rc=MSChannel::select(tvp); // Need to copy the result to fds_*a so dap can know which descriptor popped. MSChannel::fds()->fdscopy(MSChannel::fds()->ra(),fds_ra); MSChannel::fds()->fdscopy(MSChannel::fds()->wa(),fds_wa); MSChannel::fds()->fdscopy(MSChannel::fds()->xa(),fds_xa); if ((rc<0)&&(errno!=EINTR)) { if (MSMessageLog::quietMode()!=MSTrue) { perror("MSMainLoop: error: select() exiting..."); fprintf(stderr,"MSMainLoop: error: select()\n"); exit(1); } } if (rc<=0) { MSChannel::fds()->fdszero(fds_ra); MSChannel::fds()->fdszero(fds_wa); MSChannel::fds()->fdszero(fds_xa); MSChannel::fdszero(); } (void) MSChannel::processChannels(); // Handle MStk Events (void) chanproc(); // Process Dap Channels (void) sgnlproc(); // Process Dap Signals } extern const char *MSAltDefaultFont; const char *aplKeyTranslationFunction(const XEvent *); // Settings to mimic the Aplus "btk" look instead of MStk void setAplusAppDefaults(void) { MSDefaultBackgroundColorSpec="grey"; MSDefaultForegroundColorSpec="black"; MSDefaultFont="kaplgallant-19"; MSAltDefaultFont="fixed"; } // Add KeyTranslation Function void loadAplusTextKeyTranslations(void) { MSTextField::keyTranslationFunction(aplKeyTranslationFunction); } void AplusLoop(long argc_,char **argv_, int i_) { setAplusAppDefaults(); loadAplusTextKeyTranslations(); AplusApplication ap(argc_, argv_); if (i_ < argc_ && argv_[i_] && *argv_[i_]) loadafile(argv_[i_],0); /* load script */ if (Tf) pr(); /* initial prompt */ ap.loop(); } aplus-fsf-4.22/src/AplusGUI/AplusArray.C0000644000265000001440000003603110772770344013443 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include A convertToPixels(const MSWidgetCommon *, A); A grc(A,int,int); extern long dbg_tmstk; AplusArray::AplusArray(MSWidget *widget_) : MSArrayView(widget_) { AplusModel *am=new AplusModel(0); INTERNAL_COUPLE(am); selectedRowBackground(AVariableData::defaultRowColor()); // // Translating MSCallbacks to AplusCallbacks. // callback(MSWidgetCallback::doubleclick, new MSMethodCallback(this, &AplusArray::referenceCB)); } AplusArray::~AplusArray(void) { } MSBoolean AplusArray::verifyData(V,A a_) { MSBoolean r = MSFalse; if ( 0!=a_ && QA(a_) ) if (a_->t <= Et && a_->r <= 2) r = MSTrue; return r; } MSBoolean AplusArray::validate(const char *string_, unsigned row_, unsigned col_) { V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; return validate(v, string_, row_, col_); } MSBoolean AplusArray::validate(V v_, const char *string_, unsigned row_,unsigned col_) { extern int safeAset(V,A,A,A); if (v_!=0) { AInFunction *inFunc; A inData=aplus_nl; if ((inFunc=AplusModel::getInFunc(v_))!=0) inData=inFunc->invoke(v_,(char *)string_,(int)row_,(int)col_); else inData=defaultInFunc(v_,string_); if (inData!=0 && isNull(inData)==MSFalse) { A index=grc((A)v_->a,row_,col_); inData=(A)ic(inData); if (safeAset(v_,inData,index,0)==0) { showError(qs); dc(inData); if (index!=0) dc(index); return MSFalse; } else { ((AplusModel*)model())->doneCB(v_,inData,index,0); dc(inData); if (index!=0) dc(index); return MSTrue; } } } return MSFalse; } void AplusArray::addSenderNotify(MSEventSender *m_) { INTERNAL_COUPLE(((AplusModel*)m_)); updateData(); } void AplusArray::receiveEvent(MSEvent& event_) { const MSSymbol& eventType = event_.type(); if (eventType==AplusEvent::symbol()) { if (dbg_tmstk) cout << "Received UpdateEvent in AplusArray" << endl; AplusEvent *ave = (AplusEvent *) &event_; V v = ((AplusModel *)model())->aplusVar(); A index = ave->index(); A pick = ave->pick(); I ravel = ave->ravel();; update(v,index, pick, ravel); } else if (eventType==AplusVerifyEvent::symbol()) { if (dbg_tmstk) cout << "Received VerifyEvent in AplusArray" << endl; AplusVerifyEvent *ave = (AplusVerifyEvent *) &event_; ave->result(verifyData(ave->aplusVar(), ave->a())); } else if (eventType==AplusUpdateDataEvent::symbol()) { if (dbg_tmstk) cout << "Received UpdateDataEvent in AplusArray" << endl; V v = ((AplusModel *)model())->aplusVar(); if (v) { AVariableData *varData = ::pAVarDataFromV(v); if (varData) { columnWidth(varData->colWidth()); redraw(); // cause a redraw in case `stars attribute was set } } } else if (eventType==AplusUpdateTitleEvent::symbol()) { if (dbg_tmstk) cout << "Received UpdateTitleEvent in AplusArray" << endl; updateTitle(); } } A AplusArray::defaultInFunc(V v_,const char *string_) { char *ptrchar=0; long lnum=0; double dnum=0.0; int n=0; A av,r=aplus_nl; if (v_!=0) { av=(A)v_->a; switch(av->t) { case It: lnum=strtol((char *)string_,&ptrchar,10); // Base 10 if (ptrchar==(char *)string_) { r=aplus_nl; showError("Unknown Number: Integer Expected"); } else r=gi((int)lnum); break; case Ft: dnum=strtod((char *)string_,&ptrchar); if (ptrchar==(char *)string_) { r=aplus_nl; showError("Unknown Number: Float Expected"); } else r=gf((double)dnum); break; case Ct: n=(av->r==1?(int)av->d[0]:(int)av->d[1]); r=gv(Ct,n); (void) memset((char *)r->p,' ',n); // ' ' == 0x20 == 32 --> blankspace strncpy((char *)r->p,(char *)string_,strlen((char *)string_)); break; case Et: // no attempt at conversion - nesting level ???? r=gsv(0,(char *)string_); break; default: break; } } return (A) r; } const char *AplusArray::formatOutput(MSString& str_, unsigned i, unsigned j) { static const char blank[]={" "}; V v = (model()==0)?0:((AplusModel*)model())->aplusVar(); ACharStrFunction *outFunc = AplusModel::getOutFunc(v); A outStr; AVariableData *vd = ::pAVarDataFromV(v); unsigned long type = (model()!=0)?((AplusModel*)model())->a_type():0; int charlength = (model()!=0)?((AplusModel*)model())->charLength():0; int rank = (model()!=0)?((AplusModel*)model())->rank():0; P p; p.i = (model()!=0)?((AplusModel*)model())->data():0; int nCols = numColumns(); int w = (rank==2)?nCols:1; int offset; int n; offset=(i*w)+j; switch(type) { case It: if (outFunc!=0) outStr=outFunc->invoke(v,(int)p.i[offset],i,j); break; case Ft: if (outFunc!=0) outStr=outFunc->invoke(v,(double)p.f[offset],i,j); break; case Ct: n=charlength; offset=i*n; if (outFunc!=0) outStr=outFunc->invoke(v,p.c+(offset),n,i,j); break; case Et: if ((model()==0)?0:((AplusModel*)model())->numElmts()>0) { A d=gs(Et); *d->p=ic(p.a[offset]); if (outFunc!=0) outStr=outFunc->invoke(v,d,i,j); dc(d); } break; } str_ = (Ct==outStr->t) ? (char *)outStr->p : blank; dc(outStr); return str_; } void AplusArray::update(V v_,int row_,int col_,UpdateType type_) { unsigned a_type = ((AplusModel*)model())->a_type(); unsigned rank = ((AplusModel*)model())->rank(); if (type_==ValueUpdate&&v_!=0) { if (row_==-1&&col_==-1) redrawImmediately(); else { if (row_==-1) { if (a_type==Ct) col_=0; cycleColumn(col_); } else if (col_==-1) { if (a_type==Ct&&rank==1) row_=0; (rank==1)?cycleRowColumn(row_,0):cycleRow(row_); } else { if (a_type==Ct) { col_=0; if (rank==1) row_=0; } cycleRowColumn(row_,col_); } } } else if (type_==ShapeUpdate) shapeUpdate(); else if (type_==AppendUpdate) appendUpdate(); } void AplusArray::update(V v_,A index_,A,I ravel_) { if(!index_) shapeUpdate(); else if(ravel_) // ravel update { A a=(A)v_->a; if(a->r==2&&a->n==1) { int n=(int)a->d[1]; int k=(int)index_->p[0]; int j=k/n; update(v_,j,k-n*j,ValueUpdate); } else redrawImmediately(); } else { A r=index_->t==It?index_:index_->n?(A)*index_->p:aplus_nl; A c=index_->t==Et&&index_->n>1?(A)index_->p[1]:aplus_nl; int i,j; if(isNull(c)==MSTrue) // c is aplus_nl - all cols are updated { if(isNull(r)==MSTrue) redrawImmediately(); else { for(i=0;i<(int)r->n;i++) if ((int)r->p[i]>=vsb()->max()) appendUpdate(); for(i=0;i<(int)r->n;i++) update(v_,(int)r->p[i],-1,ValueUpdate); } } else if(isNull(r)==MSTrue) // r is aplus_nl - all rows are updated { for(i=0;i<(int)c->n;i++) update(v_,-1,(int)c->p[i],ValueUpdate); } else { for(i=0;i<(int)r->n;i++) if ((int)r->p[i]>=vsb()->max()) appendUpdate(); for(j=0;j<(int)r->n;j++) { for(i=0;i<(int)c->n;i++) { update(v_,(int)r->p[j],(int)c->p[i],ValueUpdate); } } } } } MSBoolean AplusArray::isCellProtected(unsigned row_, unsigned col_) { char *buf; V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; AVariableData *varData = ::pAVarDataFromV(v); MSBoolean ro=(varData!=0)?varData->readOnly():MSTrue; AReadOnlyFunction *roFunc=AplusModel::getReadOnlyFunc(v); if (v && roFunc!=0&&row_data(); int rank = ((AplusModel*)model())->rank(); int type = ((AplusModel*)model())->a_type(); int charLength = ((AplusModel*)model())->charLength(); int n = ((AplusModel*)model())->numElmts(); int w=rank==2?numColumns():1; int offset=row_*w+col_; switch (type) { case It: ro=(MSBoolean) roFunc->invoke(v,(int)p.i[offset],row_,col_); break; case Ft: ro=(MSBoolean) roFunc->invoke(v,(double)p.f[offset],row_,col_); break; case Ct: offset=selectedRow() * charLength; buf=new char[charLength+1]; strncpy(buf,p.c+(offset),charLength); buf[charLength]= '\0'; ro=(MSBoolean) roFunc->invoke(v,(char *)buf,row_,col_); delete [] buf; break; case Et: if (n>0) { A d=gs(Et); *d->p=ic(p.a[offset]); ro=(MSBoolean) roFunc->invoke(v,d,row_,col_); dc(d); } break; } } return ro; } void AplusArray::createCycle(int row_, int col_) { AplusModel *pModel=(AplusModel *)model(); if (pModel==0) { return; } V v = pModel->aplusVar(); if (v==0) { return; } if (pModel->numElmts()>0) { ACycleFunction *cycleFunc=AplusModel::getCycleFunc(v); if (cycleFunc!=0 && cycleFunc->func()!=0) { cycleColors(getCycleColors(row_,col_)); } MSArrayView::createCycle(row_,col_); } } MSUnsignedLongVector AplusArray::getCycleColors(int row_, int col_) { char *buf; A r=aplus_nl; V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; ACycleFunction *cycleFunc = AplusModel::getCycleFunc(v); if (cycleFunc && cycleFunc->func()!=0&&(row_data(); int rank = ((AplusModel *)model())->rank(); int type = ((AplusModel *)model())->a_type(); int w=rank==2?numColumns():1; int offset=row_*w+col_; int n=0; switch(type) { case It: r=cycleFunc->invoke(v,(int)p.i[offset],row_,col_); break; case Ft: r=cycleFunc->invoke(v,(double)p.f[offset],row_,col_); break; case Ct: n=((AplusModel*)model())->charLength(); offset=row_*n; buf=new char[n+1]; strncpy(buf,p.c+(offset),n); buf[n]= '\0'; r=cycleFunc->invoke(v,(char *)buf,row_,col_); delete [] buf; break; case Et: if (((AplusModel*)model())->numElmts()>0) { A d=gs(Et); *d->p=ic(p.a[offset]); r=cycleFunc->invoke(v,d,row_,col_); dc(d); } break; } } A pixelColors = (isNull(r)==MSFalse) ? convertToPixels(this,r) : r; MSUnsignedLongVector uv; if (isNull(pixelColors)==MSFalse) { for (unsigned i = 0; i < pixelColors->n; i++) uv << (unsigned long) pixelColors->p[i]; dc(pixelColors); } return uv; } unsigned long AplusArray::cellForeground(unsigned row_, unsigned col_) { AplusModel *m = (AplusModel*) model(); unsigned long fgcolor=foreground(); int n=0; char *buf; if (m) { V v = m->aplusVar(); AColorFunction *fgFunc=AplusModel::getFgFunc(v); if (fgFunc==0) return foreground(); int w = m->rank()==2?numColumns():1; P p; p.i = m->data(); int offset = (row_*w)+col_; switch(m->a_type()) { case It: fgcolor=fgFunc->invoke(v,(int)p.i[offset],row_,col_); break; case Ft: fgcolor=fgFunc->invoke(v,(double)p.f[offset],row_,col_); break; case Ct: n=m->charLength(); offset=row_*n; buf=new char[n+1]; strncpy(buf,p.c+(offset),n); buf[n]= '\0'; fgcolor=fgFunc->invoke(v,(char *)buf,row_,col_); delete [] buf; break; case Et: if (m->numElmts()>0) { A d=gs(Et); *d->p=ic(p.a[offset]); fgcolor=fgFunc->invoke(v,d,row_,col_); dc(d); } break; } } return fgcolor; } unsigned long AplusArray::cellBackground(unsigned row_, unsigned col_) { AplusModel *m = (AplusModel*) model(); unsigned long bgcolor=background(); int n=0; char *buf; if (m) { V v = m->aplusVar(); AColorFunction *bgFunc=AplusModel::getBgFunc(v); if (bgFunc==0) return background(); int w = m->rank()==2?numColumns():1; P p; p.i = m->data(); int offset = (row_*w)+col_; switch(m->a_type()) { case It: bgcolor=bgFunc->invoke(v,(int)p.i[offset],row_,col_); break; case Ft: bgcolor=bgFunc->invoke(v,(double)p.f[offset],row_,col_); break; case Ct: n=m->charLength(); offset=row_*n; buf=new char[n+1]; strncpy(buf,p.c+(offset),n); buf[n]= '\0'; bgcolor=bgFunc->invoke(v,(char *)buf,row_,col_); delete [] buf; break; case Et: if (m->numElmts()>0) { A d=gs(Et); *d->p=ic(p.a[offset]); bgcolor=bgFunc->invoke(v,d,row_,col_); dc(d); } break; } } return bgcolor; } Font AplusArray::cellFont(unsigned row_, unsigned col_) { AplusModel *m=(AplusModel *)model(); Font fid=font(); int n=0; char *buf; if (m) { V v = m->aplusVar(); AFontFunction *fontFunc=AplusModel::getFontFunc(v); if (fontFunc==0) return fid; int w = m->rank()==2?numColumns():1; P p; p.i = m->data(); int offset = (row_*w)+col_; switch(m->a_type()) { case It: fid=fontFunc->invoke(v,(int)p.i[offset],row_,col_); break; case Ft: fid=fontFunc->invoke(v,(double)p.f[offset],row_,col_); break; case Ct: n=m->charLength(); offset=row_*n; buf=new char[n+1]; strncpy(buf,p.c+(offset),n); buf[n]= '\0'; fid=fontFunc->invoke(v,(char *)buf,row_,col_); delete [] buf; break; case Et: if (m->numElmts()>0) { A d=gs(Et); *d->p=ic(p.a[offset]); fid=fontFunc->invoke(v,d,row_,col_); dc(d); } break; } } return fid; } MSClipMode AplusArray::columnClipMode(unsigned) const { AplusModel *pModel=(AplusModel *)model(); if (pModel!=0) { V v=pModel->aplusVar(); if (v!=0) { AVariableData *varData = ::pAVarDataFromV(v); if (varData->stars()==MSTrue) { return MSClipStars; } } } return MSNoClipping; } void AplusArray::updateForeground(unsigned long oldfg_) { MSCompositeText::updateForeground(oldfg_); redrawImmediately(); } void AplusArray::updateFont(Font oldfid_) { MSCompositeText::updateFont(oldfid_); _rowHeight=textHeight()+(2*rowSpacing()); if (firstMap()==MSTrue) { if (dynamic()==MSTrue || mapped()!=MSTrue) { computeSize(); } else if (mapped()==MSTrue) { adjustNumVisible(); redrawImmediately(); } } } const MSSymbol& AplusArray::widgetType(void) const { return symbol(); } const MSSymbol& AplusArray::symbol(void) { static MSSymbol sym("AplusArray"); return sym; } void AplusArray::defaultButton3Behavior(const XEvent *pEvent_) { startEditing(pEvent_); } void AplusArray::referenceCB(void) { activateCallback(MSWidgetCallback::reference); } unsigned AplusArray::numRows(void) const { return (model()==0)?0:((AplusModel*) model())->numRows(); } unsigned AplusArray::numColumns(void) const { return (model()==0)?0:((AplusModel*) model())->numCols(); } aplus-fsf-4.22/src/AplusGUI/AplusButton.C0000644000265000001440000001256710772770344013650 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include extern long dbg_tmstk; AplusButton::AplusButton(MSWidget *widget_) : MSButton(widget_) { AplusModel *am = new AplusModel(0); INTERNAL_COUPLE(am); } AplusButton::~AplusButton(void) {} void AplusButton::receiveEvent(MSEvent& event_) { const MSSymbol& eventType=event_.type(); if (eventType==AplusEvent::symbol()) { if (dbg_tmstk) cout << "Received UpdateEvent in AplusButton" << endl; MSLabel::updateData(); } else if (eventType==AplusVerifyEvent::symbol()) { if (dbg_tmstk) cout << "Received VerifyEvent in AplusButton" << endl; AplusVerifyEvent *ave = (AplusVerifyEvent *) &event_; ave->result(verifyData(ave->aplusVar(), ave->a())); } else if (eventType==AplusUpdateTitleEvent::symbol()) { if (dbg_tmstk) cout << "Received UpdateTitleEvent in AplusButton" << endl; updateTitle(); } } void AplusButton::addSenderNotify(MSEventSender *m_) { INTERNAL_COUPLE(((AplusModel*)m_)); updateData(); updateTitle(); } MSBoolean AplusButton::verifyData(V,A a_) { MSBoolean r=MSFalse; if (0!=a_&&QA(a_)&&a_->t==Et) { if (a_->n==0) r=MSTrue; else if (a_->n<=2) { A *ap=(A *)a_->p; A fun=(A)ap[0]; if (QA(fun)&&fun->t>=Xt) r=MSTrue; } } return r; } void AplusButton::activate(void) { V v=(model()!=0)?((AplusModel*)model())->aplusVar():0; if (armed()==MSTrue&&v!=0) { A av=((AplusModel *)model())->a(); if (av->n>0) { A cd=aplus_nl; A *ap=(A *)av->p; A fun=(A)ap[0]; if (av->n>=2) cd=(A)ap[1]; callAFunc(fun,cd); } } activateCallback(MSWidgetCallback::activate); } void AplusButton::updateTitle(void) { V v=(model()!=0)?((AplusModel *)model())->aplusVar():0; if (v) { AVariableData *varData = pAVarDataFromV(v); if (isNull(varData->titleAFont())==MSTrue) { font(server()->defaultFont()); } else font(varData->titleFont()); if (isNull(varData->titleAFg())==MSFalse) foreground(varData->titleFg()); updateData(); } } A AplusButton::getTitle(void) const { A r=aplus_nl; V v=(model()!=0)?((AplusModel *)model())->aplusVar():0; if (v) { AVariableData *varData = pAVarDataFromV(v); r=varData->title(); } return r; } void AplusButton::callAFunc(A fun_,A cd_) { typedef void *XClientArg; typedef void *XCallArg; extern void ACallback(XCallArg,XClientArg); AClientData *ac=new AClientData(model()->aplusVar(),(A)fun_,(A)cd_); ACallback(this,ac); delete ac; } MSBoolean AplusButton::isProtected(void) const { V v = model()->aplusVar(); A a = model()->a(); AVariableData *varData = pAVarDataFromV(v); AReadOnlyFunction *roFunc=model()->getReadOnlyFunc(v); // return (roFunc!=0)?(MSBoolean)roFunc->invoke(v,a):varData->readOnly(); if ( roFunc!=0 ) return (MSBoolean)roFunc->invoke(v,a); else if ( varData->readOnly()==MSTrue || sensitive()==MSFalse ) return MSTrue; else return MSFalse; } int AplusButton::numRows(void) const { A a = getTitle(); if (a!=0) { int type = a->t; int rank = a->r; int n = a->n; if (type==Et) return (int)n; else if (type==Ct) return (rank<=1)?1:(int)a->d[0]; } return 0; } int AplusButton::numColumns(int row_) const { A a = getTitle(); if (a!=0&&row_t; int rank = a->r; I *data = a->p; if (type==Et) { P p; p.i=data; A ra=p.a[row_]; return (ra->r==0)?1:(int)ra->d[0]; } else if (type==Ct) { if (rank==0) return 1; else if (rank==1) return (int)a->d[0]; else return (int)a->d[1]; } } return 0; } int AplusButton::numColumns(void) const { A a = getTitle(); if (a!=0) { int type = a->t; int rank = a->r; int n = a->n; I *data = a->p; if (type==Et) { P p; p.i=data; int r=0; for (int i=0;ir==0) r=(1>r)?1:r; else r=(p.a[i]->d[0]>r)?(int)p.a[i]->d[0]:r; } return r; } else if (type==Ct) { if (rank==0) return 1; else if (rank==1) return (int)a->d[0]; else return (int)a->d[1]; } } return 0; } const char *AplusButton::formatOutput(MSString& str_, int row_) { A a = getTitle(); // MSString *buf = (MSString *) &_buffer; if (a!=0&&row_t; int rank = a->r; I *data = a->p; P p; p.i=data; int len=numColumns(row_); switch (type) { case Ct: if (rank<=1) str_ = MSString((char *)p.c, len); else if (rank==2) str_ = MSString (((char *)p.c+(row_*len)),len); break; case Et: str_ = MSString ((char *)p.a[row_]->p,len); break; default: break; } } return str_; } const MSSymbol& AplusButton::widgetType(void) const { return symbol(); } const MSSymbol& AplusButton::symbol(void) { static MSSymbol sym("AplusButton"); return sym; } aplus-fsf-4.22/src/AplusGUI/AplusButtonBox.C0000644000265000001440000004225410772770344014315 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include extern MSBoolean isSlotFiller(A); extern long dbg_tmstk; //////////////////////////////////////////////////////////////////////////////// AplusActionButton::AplusActionButton(MSWidget *xwin_, const char *title_) : MSActionButton(xwin_, title_) { dynamic(MSTrue); // make it resize on changes (font changes, etc.) highlightColor(AVariableData::defaultHlColor()); } AplusActionButton::~AplusActionButton(void) {} void AplusActionButton::focusIn(void) { if (buttonBox()) buttonBox()->selectedItem(buttonBox()->buttons().indexOf((unsigned long)(MSWidget *)this)); MSActionButton::focusIn(); } MSBoolean AplusActionButton::isProtected(void) const { if (buttonBox()->readOnly(buttonBox()->buttons().indexOf((unsigned long)(MSWidget *)this))==MSFalse && sensitive()==MSTrue) { return MSFalse; } else // readOnly()==MSTrue || sensitive()==MSFalse { return MSTrue; } } //////////////////////////////////////////////////////////////////////////////// AplusButtonBox::AplusButtonBox(MSWidget *xwin_) : MSActionBox(xwin_) { _selectedItem=-1; _geometry=aplus_nl; AplusModel *am=new AplusModel(0); INTERNAL_COUPLE(am); } AplusButtonBox::~AplusButtonBox(void) { if (geometry()!=0) dc(geometry());} void AplusButtonBox::addSenderNotify(MSEventSender *m_) { INTERNAL_COUPLE(((AplusModel *) m_)); } void AplusButtonBox::receiveEvent(MSEvent& event_) { const MSSymbol& eventType=event_.type(); if (eventType==AplusEvent::symbol()) { if (dbg_tmstk) cout << "Received UpdateEvent in AplusButtonBox" << endl; AplusEvent *ave = (AplusEvent *) &event_; V v = ((AplusModel *)model())->aplusVar(); A index = ave->index(); A pick = ave->pick(); I ravel = ave->ravel();; update(v,index, pick, ravel); } else if (eventType==AplusVerifyEvent::symbol()) { if (dbg_tmstk) cout << "Received VerifyEvent in AplusButtonBox" << endl; AplusVerifyEvent *ave = (AplusVerifyEvent *) &event_; ave->result(verifyData(ave->aplusVar(), ave->a())); } else if (eventType==AplusUpdateTitleEvent::symbol()) { if (dbg_tmstk) cout << "Received UpdateTitleEvent in AplusButtonBox" << endl; updateTitle(); } } MSBoolean AplusButtonBox::verifyData(V,A a_) { return isSlotFiller(a_); } extern "C" A gpix(A,A); void AplusButtonBox::update(V v_,A,A pick_,I) { V oldV = (model()!=0)?((AplusModel*)model())->aplusVar():0; if (pick_!=0) { if (QA(pick_)) { A pick=(A)gpix(pick_,(A)v_->a); if (pick!=0&&QA(pick)&&pick->t==It&&pick->r<=1) { if (pick->r==1) { if (pick->n>0) for (int i=0;in;i+=2)updateValue((int)pick->p[i+1]); else updateValues(); } else { if (pick->p[0]==1) updateValues(); else if (v_==oldV) updateData(); } } else if (pick==0) cerr<<"action: pick assignment error in update."<redraw(); } void AplusButtonBox::updateValues(void) { if (model() && ((AplusModel*)model())->aplusVar()!=0) { int nr=numRows(); for(int i=0;iaplusVar()!=0) { P p; p.i=((AplusModel*)model())->data(); A p0=p.a[0]; r=(int)p0->n; } return r; } MSActionButton *AplusButtonBox::newButton(void) { return new AplusActionButton((MSWidget *)this,""); } void AplusButtonBox::updateData(void) { if (model() && ((AplusModel*) model())->aplusVar()) { int nr=numRows(); MSActionButton *btn; A str; MSBoolean doMap; MSBoolean change=(childCount()==nr)?MSFalse:MSTrue; freeze(); // Set Managed WidgetVector size for (;buttons().length() < nr; buttons()<<(unsigned long)0); // remove extra buttons if (childCount()-nr>0) { int extra = childCount()-nr; for(int i = nr; i < extra+nr; i++) { ((MSWidget *)buttons()(i))->destroy(); buttons()[i] = 0; } } P p; p.i=((AplusModel*)model())->data(); A val=(A)p.a[1]; P pv; pv.i=val->p; for (int r=0;rfont(titleFont(r)); btn->foreground(titleColor(r)); if (widgetType()==AplusCheckBox::symbol()) ((MSToggleButton *)btn)->selectColor(color(r)); str = itemLabel(r); if (isNull(str)==MSFalse) { btn->label((char *)str->p); dc(str); } setButtonState(btn,*pv.a[r]->p); btn->integerTag(r); if (doMap==MSTrue && btn->mapped()==MSFalse) btn->map(); } if (change==MSTrue) naturalSize(); unfreeze(); } } A AplusButtonBox::itemLabel(int row_) { A outStr=aplus_nl; V v=(model()==0)?0:((AplusModel*)model())->aplusVar(); int n=(model()==0)?0:((AplusModel*)model())->numElmts(); if (v!=0&&n==2) { AOutFunction *titleFunc=AplusModel::getTitleFunc(v); if (titleFunc!=0) { P p; p.i=((AplusModel*)model())->data(); A as=p.a[0]; A av=p.a[1]; if (row_>=0&&row_<(int)av->n) { A attr=(A)as->p[row_]; // used as the pick A val =(A)av->p[row_]; outStr=(A) titleFunc->invoke(v,(A)val,(A)attr); outStr =(outStr->t==Ct)?outStr:aplus_nl; } } } return outStr; } Font AplusButtonBox::titleFont(int row_) { Font fid=font(); V v=(model()==0)?0:((AplusModel*)model())->aplusVar(); int n=(model()==0)?0:((AplusModel*)model())->numElmts(); if (v!=0&&n==2); { AFontFunction *titleFontFunc=AplusModel::getTitleFontFunc(v); if (titleFontFunc!=0) { P p; p.i=((AplusModel*)model())->data(); A as=p.a[0]; A av=p.a[1]; if (row_>=0&&row_<(int)av->n) { A attr=(A)as->p[row_]; // used as the pick A val =(A)av->p[row_]; fid=(Font) titleFontFunc->invoke(v,(A)val,(A)attr); } } } return fid; } void AplusButtonBox::activate(void) { MSActionButton *entry=activeButton(); unsigned pos = buttons().indexOf((unsigned long)(MSWidget*)entry); if (entry!=0) { P p; p.i=((AplusModel*)model())->data(); A as=p.a[0]; A attr=(A)as->p[pos]; // used as the pick A val=p.a[1]; A pick=(A)gs(Et); *pick->p=(I)attr; A data=(A)val->p[pos]; (void)callAset(((AplusModel*)model())->aplusVar(),(A)ic(data),0,pick); dc(pick); } } int AplusButtonBox::callAset(V v_,A d_,A i_,A p_) { extern int safeAset(V,A,A,A); int r; busyOn(); d_=(A)ic(d_); if ((r=safeAset(v_,d_,i_,p_))==0) showError(qs); else AplusModel::doneCB(v_,d_,i_,p_); dc(d_); busyOff(); return r; } void AplusButtonBox::updateTitle(void) { int nr = childCount(); MSBoolean changed = MSFalse; A str; if (model() && ((AplusModel*) model())->aplusVar()) { for(int i=0; i < nr; i++) { MSActionButton *btn = (MSActionButton *)(MSWidget *)buttons()(i); if(btn) { str = itemLabel(i); if (isNull(str)==MSFalse) { if (btn->label()!=MSStringVector((char *) str->p)) { changed = MSTrue; btn->label((char *)str->p); } dc(str); } Font fid = titleFont(i); if (btn->font()!=fid) { changed = MSTrue; btn->font(fid); } btn->foreground(titleColor(i)); } } if (changed) naturalSize(); } MSActionBox::updateTitle(); } void AplusButtonBox::naturalSize(void) { freeze(); setGeometry(); MSActionBox::naturalSize(); unfreeze(); } unsigned long AplusButtonBox::titleColor(int row_) { unsigned long fg=foreground(); V v=(model()==0)?0:((AplusModel*)model())->aplusVar(); int n=(model()==0)?0:((AplusModel*)model())->numElmts(); if (v!=0&&n==2) { AColorFunction *titleColorFunc=AplusModel::getTitleColorFunc(v); if (titleColorFunc!=0) { P p; p.i=((AplusModel*)model())->data(); A as=p.a[0]; A av=p.a[1]; if (row_>=0&&row_<(int)av->n) { A attr=(A)as->p[row_]; // used as the pick A val =(A)av->p[row_]; fg=(unsigned long) titleColorFunc->invoke(v,(A)val,(A)attr); } } } return fg; } MSBoolean AplusButtonBox::readOnly(int row_) const { V v=(model()==0)?0:((AplusModel*)model())->aplusVar(); int n=(model()==0)?0:((AplusModel*)model())->numElmts(); AVariableData *varData = pAVarDataFromV(v); AReadOnlyFunction *roFunc=AplusModel::getReadOnlyFunc(v); MSBoolean ro=(varData!=0)?varData->readOnly():MSFalse; if (roFunc!=0&&n==2) { P p; p.i=((AplusModel*)model())->data(); A as=p.a[0]; A av=p.a[1]; if (row_>=0&&row_<(int)av->n) { A attr=(A)as->p[row_]; // used as the pick A val =(A)av->p[row_]; ro=(MSBoolean) roFunc->invoke(v,(A)val,(A)attr); } } return ro; } // compute the least common multiple of x and y // from: Wirth,Programming in MODULA-2 int lcm(int x_,int y_) { int u=x_; int v=y_; while (x_!=y_) { if (x_>y_) { x_-=y_; u+=v; } else { y_-=x_; v+=u; } } return (int)(u+v)>>1; } // compute lcm on a vector of numbers int lcm (A span_) { int n=(int)span_->n; int i=0; P p; p.i=span_->p; int x=((int)p.i[0]>0)?(int)p.i[0]:1; for (i=0;i0)?(int)p.i[i+1]:1); return x; } MSBoolean AplusButtonBox::setGeometry(void) { V v=(model()==0)?0:((AplusModel*)model())->aplusVar(); A a=(model()==0)?0:((AplusModel*)model())->a(); if (v) { AGeometryFunction *geoFunc=AplusModel::getGeometryFunc(v); if (geoFunc!=0&&numRows()>0) { A ag=(A)geoFunc->invoke(v,a); if (isNull(ag)==MSFalse && ag->t==It) { if (compareGeometry(ag)==MSTrue) dc(ag); else { geometry(ag); (void) setPositions(); return MSTrue; } } } } return MSFalse; } MSBoolean AplusButtonBox::compareGeometry(A ag_) { A cg=geometry(); if (cg->t==It) { if (cg->t==ag_->t&&cg->n==ag_->n&&cg->r==ag_->r) { for (int r=0;rr;r++) { if (cg->d[r]!=ag_->d[r]) return MSFalse; } for (int i=0;in;i++) { if (cg->p[i]!=ag_->p[i]) return MSFalse; } return MSTrue; } else return MSFalse; } else return MSFalse; } MSBoolean AplusButtonBox::setPositions(void) { V v=(model()==0)?0:((AplusModel*)model())->aplusVar(); A a=(model()==0)?0:((AplusModel*)model())->a(); MSBoolean change=MSFalse; if (v!=0) { AGeometryFunction *geoFunc=AplusModel::getGeometryFunc(v); if (geoFunc!=0&&numRows()>0) { P p; p.i=((AplusModel*)model())->data(); A ag=(A)geoFunc->invoke(v,a); if (isNull(ag)==MSFalse && ag->t==It) { P pg; pg.i=ag->p; A am=ag; P pm; int r=0; int c=0; int nRows=0; int nCols=0; if (ag->r<=1) // vector or scalar form else canonical - matrix { if (ag->r==0) { nRows=1; nCols=(int)pg.i[0]; } else { nRows=(int)ag->n; nCols=lcm(ag); } int w=nCols; int span=0; int i=0; int index=0; am=gm(It,nRows,nCols); P pm; pm.i=am->p; for (r=0;r0)?(int)pg.i[r]:1); for (c=0;cp; int row=0; int col=0; int hspan=0; int vspan=0; int ax,ay,v_span,h_span; MSBoolean mstat; int nr=numRows(); MSActionButton *btn; for (r=0;rat(); ax=btnGeo.row(); ay=btnGeo.column(); h_span=btnGeo.columnSpan(); v_span=btnGeo.rowSpan(); mstat=btn->mapped(); btn->at(At(row, col, vspan, hspan, btn->resizeConstraints())); // preserve the constraints if (hspan==0||vspan==0) { btn->unmap(); btn->at(At(row, col, 1, 1, btn->resizeConstraints())); // preserve the constraints } else if (btn->mapped()==MSFalse) btn->map(); if(ax !=btn->at().row() || ay !=btn->at().column() || h_span!=btn->at().columnSpan() || v_span!=btn->at().rowSpan() || mstat !=btn->mapped()) change=MSTrue; } } if (ag->r<=1) dc(am); } dc(ag); } } return change; } void AplusButtonBox::rowSpan(int index_,A am_,int *row_,int *span_) { int r=0; int c=0; int w=(int)am_->d[1]; int span=0; int row=0; P p; p.i=am_->p; if (am_->r==2) { for (c=0;cd[1]&&span==0;c++) { for (r=0;rd[0];r++) { if (p.i[r*w+c]==index_) { if (span==0) row=r; span++; } } } } *row_=row; *span_=span; } void AplusButtonBox::colSpan(int index_,A am_,int *col_,int *span_) { int r=0; int c=0; int w=(int)am_->d[1]; int span=0; int col=0; P p; p.i=am_->p; if (am_->r==2) { for (r=0;rd[0]&&span==0;r++) { for (c=0;cd[1];c++) { if (p.i[r*w+c]==index_) { if (span==0) col=c; span++; } } } } *col_=col; *span_=span; } void AplusButtonBox::valueChange(MSWidget *btn_,MSBoolean value_) { unsigned index = buttons().indexOf((unsigned long)btn_); V v=(model()==0)?0:((AplusModel*)model())->aplusVar(); if (btn_) { P p; p.i=((AplusModel *)model())->data(); A as=p.a[0]; A attr=(A)as->p[index]; // used as the pick A pick=(A)gs(Et); *pick->p=(I)attr; A sd=gi((int)value_); (void)callAset(v,sd,0,pick); dc(pick); } } unsigned long AplusButtonBox::color(unsigned row_) { unsigned long fg=foreground(); V v=(model()==0)?0:((AplusModel*)model())->aplusVar(); int n=(model()==0)?0:((AplusModel*)model())->numElmts(); if (v!=0&&n==2) { AColorFunction *fgFunc=AplusModel::getFgFunc(v); if (fgFunc!=0) { P p; p.i=((AplusModel*)model())->data(); A as=p.a[0]; A av=p.a[1]; if (row_>=0&&row_<(int)av->n) { A attr=(A)as->p[row_]; // used as the pick A val =(A)av->p[row_]; fg=(unsigned long) fgFunc->invoke(v,(A)val,(A)attr); } } } return fg; } void AplusButtonBox::buttonHighlightThickness(int t_) { unsigned numButtons=buttons().length(); if (numButtons>0) { AplusActionButton *btn; for (int i=0; ihighlightThickness(t_); } } } void AplusButtonBox::buttonShadowThickness(int t_) { unsigned numButtons=buttons().length(); if (numButtons>0) { AplusActionButton *btn; for (int i=0; ishadowThickness(t_); } } } void AplusButtonBox::highlightColor(unsigned long hlc_) { if (buttons().length()>0) { if (highlightColor()!=hlc_) { AplusActionButton *btn; unsigned numButtons=buttons().length(); for (int i=0; ihighlightColor(hlc_); } } } MSActionBox::highlightColor(hlc_); } int AplusButtonBox::buttonHighlightThickness(void) { if (buttons().length()>0) { MSWidgetOutput *btn; btn=(MSWidgetOutput *)(MSWidget *)buttons()(0); if (btn) return btn->highlightThickness(); } return MSActionBox::highlightThickness(); } int AplusButtonBox::buttonShadowThickness(void) { if (buttons().length()>0) { MSWidgetOutput *btn; btn=(MSWidgetOutput *)(MSWidget *)buttons()(0); if (btn) return btn->shadowThickness(); } return MSActionBox::shadowThickness(); } unsigned long AplusButtonBox::highlightColor(void) { return MSActionBox::highlightColor(); } void AplusButtonBox::updateSensitivity(void) { unsigned numButtons=buttons().length(); if (numButtons>0) { AplusActionButton *btn; MSBoolean sensitivity=sensitive(); for (int i=0; isensitive(sensitivity); } } } const MSSymbol& AplusButtonBox::widgetType(void) const { return symbol(); } const MSSymbol& AplusButtonBox::symbol(void) { // static MSSymbol sym("AplusButtonBox"); // return sym; return MSActionBox::symbol(); } aplus-fsf-4.22/src/AplusGUI/AplusCallback.C0000644000265000001440000000142710772770344014062 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include AplusCallback::AplusCallback(AClientData *ac_) { _ac = ac_; } AplusCallback::~AplusCallback(void) { delete _ac;} void AplusCallback::process(void) { // MSDeleteQueue::allowDelete(MSFalse); if(AScbTraceHook::function()) { AScbTraceHook::run(ac()->function(),(I)ac()->data(),0,0,0,ac()->aplusVar()); } A r=af4(ac()->function(),(I)ac()->data(),0,0,0,ac()->aplusVar()); if (r==0) showError(qs); else dc(r); // MSDeleteQueue::allowDelete(MSTrue); } aplus-fsf-4.22/src/AplusGUI/AplusCheckBox.C0000644000265000001440000000661410772770344014057 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include extern MSBoolean isSlotFiller(A); AplusCheckButton::AplusCheckButton(MSWidget *owner_) : MSCheckButton(owner_, "") { dynamic(MSTrue); // AplusModel *am = new AplusModel(0); // INTERNAL_COUPLE(am); } AplusCheckButton::~AplusCheckButton(void) {} void AplusCheckButton::checkBoxArm(void) { AplusCheckBox *cbox=(AplusCheckBox *)owner(); if (cbox!=0) cbox->arm(this); } void AplusCheckButton::checkBoxDisarm(void) { AplusCheckBox *cbox=(AplusCheckBox *)owner(); if (cbox!=0) cbox->disarm(this); } void AplusCheckButton::up(void) { if (checkBox()) checkBox()->up(); } void AplusCheckButton::down(void){ if (checkBox()) checkBox()->down(); } void AplusCheckButton::left(void){ if (checkBox()) checkBox()->left(); } void AplusCheckButton::right(void){ if (checkBox()) checkBox()->right(); } void AplusCheckButton::focusIn(void) { if (checkBox()) checkBox()->selectedItem(checkBox()->buttons().indexOf((unsigned long)(MSWidget *)this)); MSCheckButton::focusIn(); } MSBoolean AplusCheckButton::isProtected(void) const { if (checkBox()->readOnly(checkBox()->buttons().indexOf((unsigned long)(MSWidget *)this))==MSFalse && sensitive()==MSTrue) { return MSFalse; } else // readOnly()==MSTrue || sensitive()==MSFalse { return MSTrue; } } AplusCheckBox::AplusCheckBox(MSWidget *owner_) : AplusButtonBox(owner_) {} AplusCheckBox::~AplusCheckBox(void) {} void AplusCheckBox::arm(MSCheckButton *checkButton_) { valueChange(checkButton_, MSTrue); } void AplusCheckBox::disarm(MSCheckButton *checkButton_) { valueChange(checkButton_, MSFalse); } const MSSymbol& AplusCheckBox::widgetType(void) const { return symbol(); } const MSSymbol& AplusCheckBox::symbol(void) { static MSSymbol sym("AplusCheckBox"); return sym; } MSBoolean AplusCheckBox::verifyData(V,A a_) { if (isSlotFiller(a_)==MSTrue) { P p; p.i=a_->p; A val=p.a[1]; P pv; pv.i=val->p; for (int row=0;row<(int)val->n;row++) { if (QS(pv.a[row])) return MSFalse; else if (pv.a[row]->t!=It||pv.a[row]->r!=0) return MSFalse; else if ((int)*pv.a[row]->p<0||(int)*pv.a[row]->p>1) return MSFalse; } return MSTrue; } return MSFalse; } void AplusCheckBox::updateValue(int row_) { V v=(model()==0)?0:((AplusModel*)model())->aplusVar(); if (v!=0) { P p; p.i=((AplusModel*)model())->data(); A val=(A)p.a[1]; P pv; pv.i=val->p; MSCheckButton *btn=(MSCheckButton *)(MSWidget *)buttons()(row_); if (btn!=0) (*pv.a[row_]->p==0)?btn->state(MSFalse):btn->state(MSTrue); } } MSActionButton *AplusCheckBox::newButton(void) { return new AplusCheckButton((MSWidget *)this); } void AplusCheckBox::setButtonState(MSActionButton *btn_, unsigned long val_) { AplusCheckButton *abtn = (AplusCheckButton *) btn_; if (abtn) (val_==0)?abtn->setDisarmState():abtn->setArmState(); } void AplusCheckBox::updateForeground(unsigned long) { for (int i = 0; i < buttons().length(); i++) { AplusCheckButton *btn = (AplusCheckButton *) (MSWidget *)buttons()(i); if(btn) btn->selectColor(color(i)); } } aplus-fsf-4.22/src/AplusGUI/AplusChoice.C0000644000265000001440000002632510772770344013564 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include extern long dbg_tmstk; AplusChoice::AplusChoice(MSWidget *widget_) : MSOptionMenu(widget_) { _itemVal = aplus_nl; dynamic(MSTrue); AplusModel *am = new AplusModel(0); INTERNAL_COUPLE(am); } AplusChoice::~AplusChoice(void) { dc(_itemVal); } MSBoolean AplusChoice::verifyData(V, A a_) { MSBoolean r=MSFalse; if (0!=a_&&QA(a_)&&a_->t==Et&&a_->n==2&&a_->r==1) { P p; p.i=a_->p; A val=p.a[1]; A attr=p.a[0]; int row; if (val->t==Et&&val->n==0&&attr->t==Et&&attr->n==0) r=MSTrue; else if (val->n==attr->n&&val->t==Et&&attr->t==Et&&val->r<=1) { r=MSTrue; for (row=0;row<(int)attr->n&&r==MSTrue;row++) { if (!QS(attr->p[row])) r=MSFalse; } if (r==MSTrue) { P pv; pv.i=val->p; int trueCount=0; for (row=0;row<(int)val->n&&r==MSTrue;row++) { if (QS(pv.a[row])) r=MSFalse; else if (pv.a[row]->t!=It||pv.a[row]->r!=0) r=MSFalse; else { if ((int)*pv.a[row]->p==1) trueCount++; else if ((int)*pv.a[row]->p!=0) r=MSFalse; } } if (trueCount==0||trueCount>1) r=MSFalse; } else if (val->t==Et&&val->n==0&&attr->t==Et&&attr->n==0) r=MSTrue; else r=MSFalse; } } return r; } void AplusChoice::addSenderNotify(MSEventSender *m_) { INTERNAL_COUPLE(((AplusModel*)m_)); setWidth(); updateTitle(); updateData(); } void AplusChoice::receiveEvent(MSEvent &event_) { const MSSymbol& eventType=event_.type(); if (eventType==AplusEvent::symbol()) { if (dbg_tmstk) cout << "Received UpdateEvent in AplusChoice" << endl; AplusEvent *ave = (AplusEvent *) &event_; V v = model()->aplusVar(); A index = ave->index(); A pick = ave->pick(); I ravel = ave->ravel();; update(v,index, pick, ravel); } else if (eventType==AplusVerifyEvent::symbol()) { if (dbg_tmstk) cout << "Received VerifyEvent in AplusChoice" << endl; AplusVerifyEvent *ave = (AplusVerifyEvent *) &event_; ave->result(verifyData(ave->aplusVar(), ave->a())); } else if (eventType==AplusUpdateDataEvent::symbol()) { if (dbg_tmstk) cout << "Received UpdateDataEvent in AplusChoice" << endl; setWidth(); } else if (eventType==AplusUpdateTitleEvent::symbol()) { if (dbg_tmstk) cout << "Received UpdateTitleEvent in AplusChoice" << endl; updateTitle(); } } void AplusChoice::updateData(void) { if (model()!=0) { V v = model()->aplusVar(); if (v) { P p; p.i =model()->data(); updateModelVector(p.a[0]); } else { MSEventBlocker block(&_modelBuffer); modelBuffer().removeAll(); } optionsModel(modelBuffer()); updateOptions(); } } void AplusChoice::updateModelVector(A attr_) { if (attr_!=0) { int itemCount = ((int)attr_->n); A sym; MSEventBlocker block(&_modelBuffer); _modelBuffer.removeAll(); _modelBuffer.reshape(itemCount); for (unsigned int i=0; ip[i]; _modelBuffer.replaceAt(i,((char *)((S)XS(sym))->n)); } } } extern "C" A gpix(A,A); void AplusChoice::update(V v_,A,A pick_,I) { V v = (model()!=0)?model()->aplusVar():0; if (pick_==0) updateData(); else { if (QA(pick_)) { A pick=(A)gpix(pick_,(A)v_->a); if (pick!=0&&QA(pick)&&pick->t==It&&pick->r<=1) { if (pick->r==1) { if (pick->n>0&&selectedItem()>=0) { P p; p.i=model()->data(); P pv; pv.i=p.a[1]->p; int r; for (int i=0;in;i+=2) { r=(int)pick->p[i+1]; if (r!=selectedItem()&&*pv.a[r]->p==1) { *un((A *)(un((A *)(un((A *)(&v->a))->p+1))->p+selectedItem()))->p=0; } } } } else { if (pick->p[0]==1) { P p; p.i=model()->data(); P pv; pv.i=p.a[1]->p; int ni=numberOfItems(); MSBoolean one=MSFalse; for (int i=0;ip==1) { if (one==MSFalse) one=MSTrue; else *un((A *)(un((A *)(un((A *)(&v->a))->p+1))->p+i))->p=0; } } } else updateData(); } } else if (pick==0) cerr<<"choice: pick assignment error in update."<font(font()); if (dynamic()==MSTrue) computeSize(); else redraw(); } void AplusChoice::updateTitle(void) { V v = (model()!=0)?model()->aplusVar():0; // UpdateTitle - OptionMenu uses label rather than title if (v!=0) { AVariableData *varData = pAVarDataFromV(v); A str=varData->title(); if (isNull(str)==MSFalse && str->t==Ct) { label((char*)str->p); } // UpdateTitleFont - OptionMenu uses label rather than title Font fid = varData->titleFont(); if (fid && fid != labelFont()) { labelFont(fid); } // UpdateTitleForeground - OptionMenu uses label rather than title unsigned long fg = titleForeground(); labelForeground(fg); } updateOptions(); } void AplusChoice::updateOptions(void) { V v = (model()!=0)?model()->aplusVar():0; A a = (model()!=0)?model()->a():0; int n = model()->numElmts(); if (v!=0 && n==2 && optionMenu()!=0) { AOutFunction *titleFunc=AplusModel::getTitleFunc(v); AFontFunction *titleFontFunc=AplusModel::getTitleFontFunc(v); AColorFunction *titleColorFunc=AplusModel::getTitleColorFunc(v); unsigned long fg; MSMenuItem *mi; A outStr; P p; p.i=model()->data(); A as=p.a[0]; A av=p.a[1]; A attr,val; Font fid=(titleFontFunc!=0)?titleFontFunc->invoke(v,a):dataFont(); for (int i=0;ip[i]; // used as the pick val=(A)av->p[i]; mi=optionMenu()->taggedMenuItem(i); outStr=(titleFunc!=0)?titleFunc->invoke(v,(A)val,(A)attr):aplus_nl; fg=(titleColorFunc!=0)? titleColorFunc->invoke(v,(A)val,(A)attr):foreground(); mi->foreground(fg); if (outStr->t==Ct) mi->label((char *)outStr->p); if (isNull(outStr)==MSFalse) dc(outStr); } if (optionMenu()->font()!=fid) optionMenu()->font(fid); else optionMenu()->naturalSize(); setChoice(); } } Font AplusChoice::dataFont(void) { V v = (model()!=0)?model()->aplusVar():0; A a = (model()!=0)?model()->a():0; if (v) { AFontFunction *fontFunc=AplusModel::getFontFunc(v); if (fontFunc!=0) return (Font) fontFunc->invoke(v,a); } return font(); } void AplusChoice::setChoice(void) { V v = model()->aplusVar(); if (v!=0) { P p; p.i=model()->data(); A val=p.a[1]; P pv; pv.i=val->p; int i; for(i=0;in;i++) { if ((int)*pv.a[i]->p==1) { selectedItem(i); break; } } } } void AplusChoice::activate(int choice_) { extern int safeAset(V,A,A,A); V v = (model()!=0)?model()->aplusVar():0; if (v&&choice_>=0&&choice_=0&&selectedItem()a))->p+1))->p+selectedItem()))->p=0; } P p; p.i=model()->data(); A as=p.a[0]; A attr=(A)as->p[choice_]; // used as the pick A pick=(A)gs(Et); *pick->p=(I)attr; A data=(A)gi(1); selectedItem(-1); freeze(); // MSDeleteQueue::allowDelete(MSFalse); data=(A)ic(data); if (safeAset(v,data,0,pick)==0) showError(qs); else { model()->doneCB(v, data, 0, pick); } dc(data); dc(pick); unfreeze(); redraw(); // MSDeleteQueue::allowDelete(MSTrue); busyOff(); } } A AplusChoice::itemValue(int row_) { V v = (model()!=0)?model()->aplusVar():0; int n = (model()!=0)?model()->numElmts():0; if (v!=0&&n==2) { AOutFunction *titleFunc=AplusModel::getTitleFunc(v); if (titleFunc!=0) { P p; p.i=model()->data(); A as=p.a[0]; A av=p.a[1]; if (row_>=0&&row_<(int)av->n) { _itemVal=(A)titleFunc->invoke(v,(A)av->p[row_],(A)as->p[row_]); _itemVal=(_itemVal->t==Ct)?_itemVal:aplus_nl; } } } return _itemVal; } unsigned long AplusChoice::itemForeground(unsigned row_) { unsigned long fg = foreground(); V v = (model()!=0)?model()->aplusVar():0; int n = (model()!=0)?model()->numElmts():0; if (v!=0 && n ==2) { AColorFunction *fgFunc=AplusModel::getFgFunc(v); if (fgFunc!=0) { P p; p.i=model()->data(); A as=p.a[0]; A av=p.a[1]; if (row_>=0&&row_<(int)av->n) fg = fgFunc->invoke(v,(A)av->p[row_], (A) as->p[row_]); } } return fg; } const char *AplusChoice::formatOutput(MSString& str_) { static const char blank[]={" "}; A outStr = itemValue(selectedItem()); str_ = (Ct==outStr->t) ? (char *)outStr->p : blank; return str_; } const char *AplusChoice::itemLabel(unsigned row_) { A outStr = itemValue(row_); return (char *) outStr->p; } void AplusChoice::updateForeground(unsigned long oldfg_) { MSComposite::updateForeground(oldfg_); _fieldValue->foreground(foreground()); redraw(); } MSBoolean AplusChoice::isProtected(void) const { V v=(model()==0)?0:model()->aplusVar(); int n=(model()==0)?0:model()->numElmts(); AVariableData *varData = pAVarDataFromV(v); AReadOnlyFunction *roFunc=AplusModel::getReadOnlyFunc(v); MSBoolean ro=(varData!=0)?varData->readOnly():MSFalse; if (roFunc!=0&&n==2) { P p; p.i=model()->data(); A av=p.a[1]; //A as=p.a[0]; // A attr=(A)as->p; // used as the pick A val =(A)av->p; ro=(MSBoolean) roFunc->invoke(v,val,aplus_nl); } return ro; } void AplusChoice::setWidth(void) { AplusModel *pModel = (AplusModel *)model(); if (pModel!=0 && pModel->aplusVar()!=0) { int width = pModel->pAVarData()->colWidth(); if (width<0) // width has not been set { // Set value width to 0, which will set it // to the length of the longest option string // valueWidth(0); } else // width has already been set { // Set the value width to the value of the // persistent "space" attribute // valueWidth((unsigned int)width); } } } MSBoolean AplusChoice::hasModel(void) const { // Override hasModel() method to fool MSOptionMenu to believe that it has no model. // An MSString model support was added to MSOptionMenu in MStk 2.7 to be able to // have an automatically synchronized current selection. // return MSFalse; } const MSSymbol& AplusChoice::widgetType(void) const { return symbol(); } const MSSymbol& AplusChoice::symbol(void) { static MSSymbol sym("AplusChoice"); return sym; } aplus-fsf-4.22/src/AplusGUI/AplusCollapsible.C0000644000265000001440000000272710772770344014623 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include extern long dbg_tmstk; AplusCollapsible::AplusCollapsible(MSWidget *xwin_) : MSCollapsibleLayout(xwin_) {} AplusCollapsible::~AplusCollapsible(void) {} void AplusCollapsible::addSenderNotify(MSEventSender *m_) { INTERNAL_COUPLE(((AplusModel *) m_)); } void AplusCollapsible::receiveEvent(MSEvent &event_) { if (event_.type()==MSIndexedEvent::symbol()) { MSIndexedEvent &ev=(MSIndexedEvent&)event_; update(ev.index()); } else if (event_.type()==MSNullEvent::symbol()) update(MSIndexVector::nullVector()); else if (event_.type() == AplusEvent::symbol()) { if (dbg_tmstk) cout << "Received UpdateEvent in " << "AplusCollapsible" << endl; redraw(); } if (event_.type() == AplusVerifyEvent::symbol()) { if (dbg_tmstk) cout << "Received VerifyEvent in AplusCollapsible" << endl; AplusVerifyEvent *ave = (AplusVerifyEvent *) &event_; ave->result(verifyData(ave->aplusVar(), ave->a())); } } const MSSymbol& AplusCollapsible::widgetType(void) const { return symbol(); } const MSSymbol& AplusCollapsible::symbol(void) { static MSSymbol sym("AplusCollapsible"); return sym; } aplus-fsf-4.22/src/AplusGUI/AplusCommand.C0000644000265000001440000000373710772770344013752 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include AplusCommand::AplusCommand(MSWidget *owner_) : AplusEntryField(owner_) {} AplusCommand::~AplusCommand(void) {} MSBoolean AplusCommand::verifyData(V,A a_) { return (0!=a_ && QA(a_) && a_->t==Ct && a_->r<=1)?MSTrue:MSFalse; } const char *AplusCommand::buffer(void) { return fieldEditor()->string(); } void AplusCommand::buffer(A buf_) { if (QA(buf_)&&buf_->t==Ct&&fieldEditor()->mapped()==MSTrue) { fieldEditor()->string((char *)buf_->p); } } int AplusCommand::cursorPosition(void) { return fieldEditor()->cursorPosition(); } void AplusCommand::cursorPosition(int cp_) { fieldEditor()->cursorPosition(cp_); } void AplusCommand::keyPress(const XEvent *e_,KeySym k_,unsigned int s_,const char * b_) { if (fieldEditor()->mapped()==MSTrue) { AplusEntryField::keyPress(e_, k_, s_, b_); activateCallback(MSSymbol("keypress")); } else { if (k_==XK_Return) reference(); else if (sensitive()==MSTrue) { if (k_==XK_Insert) { MSString s; const char *str = formatOutput(s); if (str != 0) { fieldEditor()->string(str); } else fieldEditor()->string(""); mapEditor(); } else if (k_==XK_BackSpace) { clearEditor(); mapEditor(); } else if (strlen(b_)>0) { clearEditor(); AplusEntryField::keyPress(e_, k_, s_, b_); if (fieldEditor()->length()>0) { mapEditor(); activateCallback(MSSymbol("keypress")); } } } } } const MSSymbol& AplusCommand::widgetType(void) const { return symbol(); } const MSSymbol& AplusCommand::symbol(void) { static MSSymbol sym("AplusCommand"); return sym; } aplus-fsf-4.22/src/AplusGUI/AplusCommon.C0000644000265000001440000004651210772770344013622 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #if HAVE_IOSTREAM #include #else #include #endif #include #include #include #include #include #include extern void setBusyState(MSBoolean); extern A grc(A,int,int); unsigned long AVariableData::_defaultHlColor = ULONG_MAX; unsigned long AVariableData::_defaultRowColor = ULONG_MAX; unsigned long AVariableData::_defaultMatrixColor = ULONG_MAX; A AScbTraceHook::_function=0; A AOutFunction::callFunc(V v_,A a_,int row_,int col_,A p_) { A i=(row_==-1&&col_==-1)?0:(A)grc((A)v_->a,row_,col_); A r=(_func!=0)?(A)(*_func)(_arg,a_,i,p_,v_):(A)gsv(0,""); if (i!=0) dc((A)i); if (a_!=0) dc((A)a_); return r; } A ACharStrFunction::callFunc(V v_,A a_,int row_,int col_,A p_) { A r=AOutFunction::callFunc(v_, a_, row_, col_, p_); if(!r)return aplus_nl; if(isNull(r)==MSFalse && Ct!=r->t) { showError("non-character result from out function"); dc(r); r=aplus_nl; } return r; } MSBoolean processAVariables(void) { AVariableData *varData; MSBoolean done=MSFalse; MSBoolean didWork=MSFalse; int i; V v; // the update queue may have some updates waiting to be processed // processUpdateQueue(); while(done==MSFalse) { done=MSTrue; for (i=0;iz==0) { varData = ::pAVarDataFromV(v); if (varData!=0&&varData->pWidgetView()!=0) { if (varData->pWidgetView()->visible()==MSTrue) { didWork=MSTrue; setBusyState(MSTrue); done=MSFalse; ::gt(v); // // the update queue should be empty by this time, but // let's process it just in case; if the queue is empty, // this will be a no-op // processUpdateQueue(); setBusyState(MSFalse); } } } } } return didWork; } unsigned long AColorFunction::callFunc(V v_,A a_,int row_,int col_,A p_) { AVariableData *vd = ::pAVarDataFromV(v_); unsigned long pixel=vd->pWidgetView()->foreground(); A r=0; A i=(row_==-1&&col_==-1)?0:grc((A)v_->a,row_,col_); if (func()!=0) { r=(A)(*func())(arg(),a_,i,p_,v_); if (r!=0) { if (QS(r)) pixel=(unsigned long)vd->pWidgetView()->server()->pixel((char *)XS(r)->n); else if (r->t==It) pixel=(unsigned long)r->p[0]; else if (r->t==Ct&&vd->pWidgetView()!=0) pixel=(unsigned long)vd->pWidgetView()->server()->pixel((char *)r->p); else if (r->t==Et&&r->n>0&&QS(*r->p)&&vd->pWidgetView()!=0) pixel=(unsigned long)vd->pWidgetView()->server()->pixel((char *)XS(*r->p)->n); } if (!QS(r)) dc((A)r); } if (i!=0) dc((A)i); if (a_!=0) dc((A)a_); return pixel; } Font AFontFunction::callFunc(V v_,A a_,int row_,int col_,A p_) { AVariableData *vd = ::pAVarDataFromV(v_); Font fid=vd->pWidgetView()->font(); A r=0; A i=(row_==-1&&col_==-1)?0:grc((A)v_->a,row_,col_); if (func()!=0) { r=(A) (*func())(arg(),a_,i,p_,v_); if (r!=0) { if (QS(r)) fid=(Font)vd->pWidgetView()->server()->fontID((char *)XS(r)->n); else if (r->t==It) fid=(Font)r->p[0]; else if (r->t==Ct&&vd->pWidgetView()!=0) fid=(Font)vd->pWidgetView()->server()->fontID((char *)r->p); else if (r->t==Et&&r->n>0&&QS(*r->p)&&vd->pWidgetView()!=0) fid=(Font)vd->pWidgetView()->server()->fontID((char *)XS(*r->p)->n); } if (!QS(r)) dc((A)r); } if (i!=0) dc((A)i); if (a_!=0) dc((A)a_); return fid; } MSBoolean AReadOnlyFunction::callFunc(V v_,A a_,int row_,int col_,A p_) { AVariableData *vd = ::pAVarDataFromV(v_); MSBoolean ro=MSFalse; A r=0; A i=0; if (row_==-1&&col_==-1) i=0; else i=grc((A)v_->a,row_,col_); if (func()!=0) { r=(A) (*func())(arg(),a_,i,p_,v_); if (r!=0&&r->t==It) ro=(MSBoolean)r->p[0]; dc((A)r); } if (i!=0) dc((A)i); if (a_!=0) dc((A)a_); return ro; } // utility functions for dealing with vars/symbols and context // get a v from a symbol V av(A a_) { V v; if (a_->n==1) v=getVFromSym(Cx,(S)XS(*a_->p)); else { int n=(int) a_->n-1; S s; v=vi(XS(a_->p[n]),n?(s=XS(*a_->p),cxi(*s->n?s:si(""))):Cx); } return v; } V getV(A a_) { if (isNull(a_)==MSTrue || (!QS(a_) && a_->t!=Et)) { return 0; } S s=(S)XS(*a_->p); return (a_->n<=1) ? getVFromSym(Cx,s) : vi(XS(a_->p[a_->n-1]),a_->n-1?cxi(*s->n?s:si("")):Cx); } // get the symbol for a v as a scalar: `symbol A getSym(V v_) { A ar; if (v_==0) ar=aplus_nl; else { ar=(A)gs(Et); ar->p[0]=(I)MS(v_->s); // symbol } return (A) ar; } // get the symbol for a v as an enclosed type with the context: `context `symbol A getSymWithContext(V v_) { A ar; if (v_==0 ) ar=aplus_nl; else { ar=(A)gv(Et,2); // context if(v_->cx==0) ar->p[0]=(I)MS(si("")); else ar->p[0]=(I)MS(v_->cx==cx("")?si(""):v_->cx->s); // symbol if(v_->s==0) ar->p[1]=(I)MS(si("")); else ar->p[1]=(I)MS(v_->s); } return (A) ar; } extern "C" V sv(CX context_, S sym_); V getVFromSym(CX context_,S sym_) { return sv(context_, sym_); } AVariableData::AVariableData(void) { _pWidgetView=0; _colWidth=-1; _editWidth=-1; _class=0; _stars=MSTrue; _bg=aplus_nl; _fg=aplus_nl; _font=aplus_nl; _titleFg=aplus_nl; _titleFont=aplus_nl; _title=aplus_nl; _readOnly=MSFalse; } AVariableData::~AVariableData(void) { if (QA(titleA()) && isNl(titleA())==MSFalse) dc(titleA()); if (QA(titleAFg()) && isNl(titleAFg())==MSFalse) dc(titleAFg()); if (QA(titleAFont())&& isNl(titleAFont())==MSFalse) dc(titleAFont()); if (QA(bgA()) && isNl(bgA())==MSFalse) dc(bgA()); if (QA(fgA()) && isNl(fgA())==MSFalse) dc(fgA()); if (QA(fontA()) && isNl(fontA())==MSFalse) dc(fontA()); } void AVariableData::colWidth(int cw_, MSBoolean sendEvent_) { _colWidth=cw_; if (_pWidgetView && _pWidgetView->model()!=0 && sendEvent_==MSTrue) { AplusUpdateDataEvent aude; ((MSEventReceiver *)_pWidgetView)->receiveEvent(aude); } } void asTitleStringVector(MSStringVector &t_, A title_) { if (isNull(title_)==MSTrue) goto out; if (title_->t == Ct) { if (title_->r<=1) { t_ << MSString((char *)title_->p, (unsigned) title_->n); } else if (title_->r==2) { unsigned dim = title_->d[0]; unsigned len = title_->d[1]; int offset=0; for (int i = 0; i < dim; i++, offset+=len) { t_ << MSString(((char *)title_->p + offset), len); } } } else if (title_->t ==Et) { if (QS(*title_->p)) { goto out; } for (int i = 0 ; i < title_->n; i++) { A a = (A) title_->p[i]; if (a && a->t == Ct) { MSStringVector t; asTitleStringVector (t, a); t_ << t; } } } else { cout << "Non charType in asTitleStringVector" << endl; } out: if (t_.maxLength()==0) t_.removeAll(); return; } void AVariableData::title(A title_) { if (!QS(title_)) { if (QA(titleA()) && isNull(titleA())==MSFalse) dc(titleA()); _title=QA(title_)?(A)ic(title_):title_; if (_pWidgetView!=0) { MSStringVector t; asTitleStringVector(t, title_); const MSSymbol& sym = _pWidgetView->widgetType(); if (sym==AplusTableColumn::symbol()) { ((AplusTableColumn *)_pWidgetView)->heading(t); } else if (sym==AplusTraceSet::symbol()) { ((AplusTraceSet *)_pWidgetView)->textBuffer(t); } else // a subclass of MSWidgetCommon { ((MSWidgetCommon *)_pWidgetView)->title(t); } } } } void AVariableData::setReadOnly(int i_) { roFunc((AFunc)0,0); _readOnly=(0!=i_)?MSTrue:MSFalse; if (_pWidgetView!=0) { AplusProtectEvent event; ((MSEventReceiver *)pWidgetView())->receiveEvent(event); } } void AVariableData::stars(MSBoolean b_) { if (b_!=stars()) { _stars=b_; if (pWidgetView()!=0) { AplusUpdateDataEvent event; ((MSEventReceiver *)pWidgetView())->receiveEvent(event); } } } unsigned long AVariableData::titleFg(void) { if (isNull(titleAFg())==MSTrue) { if (pWidgetView()!=0) return pWidgetView()->server()->defaultForeground(); else return MSDisplayServer::defaultDisplayServer()->defaultForeground(); } else return (unsigned long) titleAFg()->p[0]; } Font AVariableData::titleFont(void) { if (isNull(titleAFont())==MSTrue) { if (pWidgetView()!=0) return pWidgetView()->server()->defaultFont(); else return MSDisplayServer::defaultDisplayServer()->defaultFont(); } else return (Font) titleAFont()->p[0]; } void AVariableData::titleFg(A fg_) { A fg=aplus_nl; if (_pWidgetView!=0) { if (QS(fg_)) { fg=gi((I)_pWidgetView->server()->pixel((char *)XS(fg_)->n)); } else if (fg_->t==It) { fg=gi((I)fg_->p[0]); } else if (fg_->t==Ct) { fg=gi((I)_pWidgetView->server()->pixel((char *)fg_->p)); } else if (fg_->t==Et&&fg_->n>0&&QS(*fg_->p)) { fg=gi((I)_pWidgetView->server()->pixel((char *)XS(*fg_->p)->n)); } } else if (QA(fg_)&&fg_->t==It) { fg=gi((I)fg_->p[0]); } if (isNull(titleAFg())==MSFalse) { dc(titleAFg()); } _titleFg=fg; if (_pWidgetView!=0) { const MSSymbol& sym = _pWidgetView->widgetType(); if (sym==AplusTableColumn::symbol()) { ((AplusTableColumn *)_pWidgetView)->headingForeground((unsigned long)titleFg()); } else if (sym==AplusTraceSet::symbol()) { ((AplusTraceSet *)_pWidgetView)->textForeground((unsigned long)titleFg()); } else // a subclass of MSWidgetCommon { ((MSWidgetCommon *)_pWidgetView)->titleForeground((unsigned long)titleFg()); } } } void AVariableData::titleFont(A fid_) { if (isNull(fid_)==MSTrue) { return; } A fid=aplus_nl; if (_pWidgetView!=0) { if (QS(fid_)) { fid=gi((I)_pWidgetView->server()->fontID((char *)XS(fid_)->n)); } else if (fid_->t==It) { fid=gi((I)fid_->p[0]); } else if (fid_->t==Ct) { fid=gi((I)_pWidgetView->server()->fontID((char *)fid_->p)); } else if (fid_->t==Et&&fid_->n>0&&QS(*fid_->p)) { fid=gi((I)_pWidgetView->server()->fontID((char *)XS(*fid_->p)->n)); } } else if (QA(fid_)&&fid_->t==It) { fid=gi((I)fid_->p[0]); } if (isNull(titleAFont())==MSFalse) { dc(titleAFont()); } _titleFont=fid; if (_pWidgetView!=0) { const MSSymbol& sym = _pWidgetView->widgetType(); if (sym==AplusTableColumn::symbol()) { ((AplusTableColumn *)_pWidgetView)->headingFont((Font)fid->p[0]); } else if (sym==AplusTraceSet::symbol()) { ((AplusTraceSet *)_pWidgetView)->textFont((Font)fid->p[0]); } else // a subclass of MSWidgetCommon { ((MSWidgetCommon *)_pWidgetView)->titleFont((Font)fid->p[0]); } } } void AVariableData::pWidgetView(MSWidgetView *pWidgetView_) { if (_pWidgetView!=pWidgetView_) { _pWidgetView = pWidgetView_; if (_pWidgetView!=0) { _pWidgetView->background(background()); _pWidgetView->foreground(foreground()); _pWidgetView->font(font()); MSStringVector tit; asTitleStringVector(tit, title()); const MSSymbol& sym = _pWidgetView->widgetType(); if (sym==AplusTableColumn::symbol()) { AplusTableColumn *pColumn = (AplusTableColumn *)_pWidgetView; if (isNull(titleA())==MSFalse) { pColumn->heading(tit); } if (isNull(titleAFont())==MSFalse) { pColumn->headingFont(titleFont()); } if (isNull(titleAFg())==MSFalse) { pColumn->headingForeground(titleFg()); } } else if (sym!=AplusTraceSet::symbol()) // a subclass of MSWidgetCommon { MSWidgetCommon *pWidget = (MSWidgetCommon *)_pWidgetView; if (isNull(titleA())==MSFalse) { pWidget->title(tit); } if (isNull(titleAFont())==MSFalse) { pWidget->titleFont(titleFont()); } if (isNull(titleAFg())==MSFalse) { pWidget->titleForeground(titleFg()); } } } } } void AVariableData::foreground(A fg_) { A fg=aplus_nl; if (pWidgetView()!=0) { if (QS(fg_)) fg=gi((I)pWidgetView()->server()->pixel((char *)XS(fg_)->n)); else if (fg_->t==It) fg=gi((I)fg_->p[0]); else if (fg_->t==Ct) fg=gi((I)pWidgetView()->server()->pixel((char *)fg_->p)); else if (fg_->t==Et&&fg_->n>0&&QS(*fg_->p)) fg=gi((I)pWidgetView()->server()->pixel((char *)XS(*fg_->p)->n)); } else if (QA(fg_)&&fg_->t==It) fg=gi((I)fg_->p[0]); if (isNull(fgA())==MSFalse) dc(fgA()); _fg=fg; if (pWidgetView()!=0) pWidgetView()->foreground((isNull(fg)==MSTrue) ? MSDisplayServer::defaultDisplayServer()->defaultForeground() : foreground()); fgFunc((AFunc)0,0); } void AVariableData::background(A bg_) { A bg=aplus_nl; if (pWidgetView()!=0) { if (QS(bg_)) bg=gi((I)pWidgetView()->server()->pixel((char *)XS(bg_)->n)); else if (bg_->t==It) bg=gi((I)bg_->p[0]); else if (bg_->t==Ct) bg=gi((I)pWidgetView()->server()->pixel((char *)bg_->p)); else if (bg_->t==Et&&bg_->n>0&&QS(*bg_->p)) bg=gi((I)pWidgetView()->server()->pixel((char *)XS(*bg_->p)->n)); } else if (QA(bg_)&&bg_->t==It) bg=gi((I)bg_->p[0]); if (isNull(bgA())==MSFalse) dc(bgA()); _bg=bg; if (pWidgetView()!=0) pWidgetView()->background( (isNull(bg)==MSTrue) ? MSDisplayServer::defaultDisplayServer()->defaultBackground() : background()); bgFunc((AFunc)0,0); } void AVariableData::font(A fa_) { A afid=aplus_nl; if (pWidgetView()!=0) { if(QS(fa_))afid=gi((I)pWidgetView()->server()->fontID((char *)XS(fa_)->n)); else if (It==fa_->t) afid=gi((I)fa_->p[0]); else if (Ct==fa_->t) afid=gi((I)pWidgetView()->server()->fontID((char *)fa_->p)); } else if (QA(fa_)&&It==fa_->t) afid=gi((I)fa_->p[0]); if (isNull(fontA())==MSFalse) dc(fontA()); _font=afid; if (0!=pWidgetView()) pWidgetView()->font((isNull(afid)==MSTrue) ? MSDisplayServer::defaultDisplayServer()->defaultFont() : font()); fontFunc((AFunc)0,0); } ACharStrFunction *AVariableData::outFunc(void) { return &_outFunc; } void AVariableData::outFunc(AFunc func_,AClientData *arg_) { outFunc()->set(func_,arg_); if (pWidgetView()!=0) pWidgetView()->redraw(); } AInFunction *AVariableData::inFunc(void) { return &_inFunc; } void AVariableData::inFunc(AFunc func_,AClientData *arg_) { inFunc()->set(func_,arg_); } AColorFunction *AVariableData::fgFunc(void) { return &_fgFunc; } void AVariableData::fgFunc(AFunc func_,AClientData *arg_) { fgFunc()->set(func_,arg_); if (pWidgetView()!=0) { pWidgetView()->updateForeground(pWidgetView()->foreground()); } } AColorFunction *AVariableData::bgFunc(void) { return &_bgFunc; } void AVariableData::bgFunc(AFunc func_,AClientData *arg_) { bgFunc()->set(func_,arg_); if (pWidgetView()!=0) { pWidgetView()->updateForeground(pWidgetView()->foreground()); } } AFontFunction *AVariableData::fontFunc(void) { return &_fontFunc; } void AVariableData::fontFunc(AFunc func_,AClientData *arg_) { fontFunc()->set(func_,arg_); if (pWidgetView()!=0) { pWidgetView()->updateFont(pWidgetView()->font()); } } AFontFunction *AVariableData::titleFontFunc(void) { return &_titleFontFunc; } void AVariableData::titleFontFunc(AFunc func_,AClientData *arg_) { titleFontFunc()->set(func_,arg_); if (_pWidgetView!=0) { AplusUpdateTitleEvent event; ((MSEventReceiver *)_pWidgetView)->receiveEvent(event); } } AColorFunction *AVariableData::titleColorFunc(void) {return &_titleColorFunc; } void AVariableData::titleColorFunc(AFunc func_,AClientData *arg_) { titleColorFunc()->set(func_,arg_); if (_pWidgetView!=0) { AplusUpdateTitleEvent event; ((MSEventReceiver *)_pWidgetView)->receiveEvent(event); } } AOutFunction *AVariableData::titleFunc(void) { return &_titleFunc; } //#include void AVariableData::titleFunc(AFunc func_,AClientData *arg_) { titleFunc()->set(func_,arg_); if (_pWidgetView!=0) { AplusUpdateTitleEvent event; ((MSEventReceiver *)_pWidgetView)->receiveEvent(event); } } AReadOnlyFunction *AVariableData::roFunc(void) { return &_roFunc; } void AVariableData::roFunc(AFunc func_,AClientData *arg_) { _readOnly=MSFalse; roFunc()->set(func_,arg_); } AGeometryFunction *AVariableData::geoFunc(void) { return &_geoFunc; } void AVariableData::geoFunc(AFunc func_,AClientData *arg_) { geoFunc()->set(func_,arg_); if (pWidgetView()!=0) pWidgetView()->naturalSize(); } AFunction *AVariableData::doneFunc(void) { return &_doneFunc; } void AVariableData::doneFunc(AFunc func_,AClientData *arg_) { doneFunc()->set(func_,arg_); } ACycleFunction *AVariableData::cycleFunc(void) { return &_cycleFunc; } void AVariableData::cycleFunc(AFunc func_,AClientData *arg_) { cycleFunc()->set(func_,arg_); } unsigned long AVariableData::defaultHlColor(void) { if (_defaultHlColor==ULONG_MAX) { _defaultHlColor = MSDisplayServer::defaultDisplayServer()->pixel("yellow"); } return _defaultHlColor; } unsigned long AVariableData::defaultRowColor(void) { if (_defaultRowColor==ULONG_MAX) { _defaultRowColor = MSDisplayServer::defaultDisplayServer()->pixel("lightsteelblue3"); } return _defaultRowColor; } unsigned long AVariableData::defaultMatrixColor(void) { if (_defaultMatrixColor==ULONG_MAX) { _defaultMatrixColor = MSDisplayServer::defaultDisplayServer()->pixel("mediumaquamarine"); } return _defaultMatrixColor; } extern "C" int ep_issf(A); MSBoolean isSlotFiller(A a_) { return (ep_issf(a_)==1)?MSTrue:MSFalse; } MSBoolean isAplusWidget(const MSWidget *pWidget_) { // This is a somewhat kludgy way of determining if a widget is really an A+ // widget or an MStk widget. All A+ widget classes have to implement the // widgetType() method. // MSString aplusPrefix("Aplus"); if (aplusPrefix.isAbbreviationFor(pWidget_->widgetType().symbolName())==MSTrue) { return MSTrue; } else { return MSFalse; } } void showError(const char *msg_, int flag_) { if (msg_!=0) { cout << ""; switch (flag_) { case 0: cout << " A+ error: " << msg_ << endl; break; case 1: cout << " A+ warning: " << msg_ << endl; break; default: cout << " " << msg_ << endl; break; } } } // utility function for converting a symbol or vector of symbols to // a pixel value or vector of pixel values // A convertToPixels(const MSWidgetCommon *xwin_,A a_) { // cast away the const-ness of server() in order to be able to call // pixel() method on it, which is non-const // MSDisplayServer *pServer=(MSDisplayServer *)xwin_->server(); A rr; if (QS(a_)) { rr=gs(It); rr->p[0]=(I)pServer->pixel((char *)XS(a_)->n); return rr; } else if (a_->t==It&&a_->r<=1) return a_; else if (a_->t==Et&&a_->n>0) { int i; for (i=0;in;i++) if (!QS(a_->p[i])) return aplus_nl; rr=gv(It,a_->n); for (i=0;in;i++) { rr->p[i]=(I)pServer->pixel((char *)XS(a_->p[i])->n); } dc(a_); return rr; } return a_; } aplus-fsf-4.22/src/AplusGUI/AplusConvert.C0000644000265000001440000001232010772770344014000 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #if HAVE_IOSTREAM #include #else #include #endif #include #include extern long dbg_tmstk; MSA AplusConvert::_convert; MSFloat AplusConvert::asMSFloat(A var_) { ic(var_); _convert.aStructPtr((MSA::a *) var_); MSFloat result = _convert.asMSFloat(); _convert.aStructPtr((MSA::a *)0); return result; } MSString AplusConvert::asMSString(A var_) { MSString result; if (QA(var_) && var_->t==Ct) { if (var_->r==0) { P p; p.i=var_->p; result = MSString(p.c); } else if (var_->r==1 && var_->n>0) { P p; p.i=var_->p; result = p.c; } } else if (!QS(var_)&&(var_->t==Et&&var_->n>0&&QS(*var_->p))) { result = (char *) XS(var_->p[0])->n; } return result; } // // Vector Conversions // MSStringVector AplusConvert::asMSStringVector(A var_) { MSStringVector result; if (isNull(var_)==MSTrue) goto out; if (var_->t == Ct) { if (var_->r<=1) { result << MSString((char *)var_->p, (unsigned) var_->n); } else if (var_->r==2) { unsigned dim = var_->d[0]; unsigned len = var_->d[1]; int offset=0; for (int i = 0; i < dim; i++, offset+=len) { result << MSString(((char *)var_->p + offset), len); } } } else if (var_->t ==Et) { if (QS(*var_->p)) { goto out; } for (int i = 0 ; i < var_->n; i++) { A a = (A) var_->p[i]; if (a && a->t == Ct) { MSStringVector t = AplusConvert::asMSStringVector(a); result << t; } } } else { if (dbg_tmstk) cerr << "Non charType in AplusConvert::asMSStringVector" << endl; } out: if (result.maxLength()==0) result.removeAll(); return result; } MSFloatVector AplusConvert::asMSFloatVector(A var_) { MSFloatVector result; if (var_->t==Ft) { ic(var_); _convert.aStructPtr((MSA::a *) var_); result = _convert.asMSFloatVector(); _convert.aStructPtr((MSA::a *)0); } else if (var_->t==It) { ic(var_); _convert.aStructPtr((MSA::a *) var_); MSUnsignedLongVector uv = _convert.asMSUnsignedLongVector(); _convert.aStructPtr((MSA::a *)0); for (unsigned i =0; i < uv.length();i++) result << (double)uv(i); } return result; } MSIntVector AplusConvert::asMSIntVector(A var_) { ic(var_); _convert.aStructPtr((MSA::a *) var_); MSIntVector result = _convert.asMSIntVector(); _convert.aStructPtr((MSA::a *)0); return result; } MSUnsignedLongVector AplusConvert::asMSUnsignedLongVector(A var_) { ic(var_); _convert.aStructPtr((MSA::a *) var_); MSUnsignedLongVector result = _convert.asMSUnsignedLongVector(); _convert.aStructPtr((MSA::a *)0); return result; } MSIndexVector AplusConvert::asMSIndexVector(A var_) { MSUnsignedLongVector uv = asMSUnsignedLongVector(var_); MSIndexVector iv; for(unsigned i =0; i < uv.length(); i++) iv << uv(i); return iv; } MSUnsignedVector AplusConvert::asMSUnsignedVector(A var_) { MSUnsignedLongVector uv = asMSUnsignedLongVector(var_); MSUnsignedVector iv; for(unsigned i =0; i < uv.length(); i++) iv << (unsigned int)uv(i); return iv; } // Matrix Conversions MSFloatMatrix AplusConvert::asMSFloatMatrix(A var_) { ic(var_); _convert.aStructPtr((MSA::a *) var_); MSFloatMatrix result = _convert.asMSFloatMatrix(); _convert.aStructPtr((MSA::a *)0); return result; } MSIntMatrix AplusConvert::asMSIntMatrix(A var_) { ic(var_); _convert.aStructPtr((MSA::a *) var_); MSIntMatrix result = _convert.asMSIntMatrix(); _convert.aStructPtr((MSA::a *)0); return result; } // A Conversions A AplusConvert::asA(const MSString &s_) { A a = aplus_nl; long d[MAXR]={ 0, 0, 0, 0, 0, 0, 0, 0, 0 }; if (s_.length()>0) { d[0] = s_.length(); a = gc(Ct, 1, s_.length(), d, (long *) (const char *) s_); } return a; } A AplusConvert::asA(const MSFloat &f_) { A a = aplus_nl; a = gf((float)f_); return a; } A AplusConvert::asA(const MSStringVector &sv_) { A ap = aplus_nl; long d[MAXR]={ 0, 0, 0, 0, 0, 0, 0, 0, 0 }; long xrho=sv_.length(); d[0]=xrho; if (xrho>0) { ap = ga(Et, 1, xrho, d); for (long i=0; ip[i]=(long) gc(Ct, 1, sv_(i).length(), d, (long *)sv_(i).string()); } } return ap; } A AplusConvert::asA(const MSFloatVector &fv_) { A ap = aplus_nl; long xrho=fv_.length(); if (xrho>0) { ap = gv(Ft, xrho); P p; p.i = ap->p; for (long i=0; i0) { ap = gv(It, xrho); P p; p.i = ap->p; for (long i=0; i0) { ap = gv(It, xrho); P p; p.i = ap->p; for (long i=0; i #include #include static const char *_XA_DT_WORKSPACE_LIST="_DT_WORKSPACE_LIST"; Atom *AplusDisplayServer::workspaceAtoms(void) const { Atom *xAtoms=0, *atoms=0; Atom actualType; int actualFormat; unsigned long lcount; unsigned long leftover; Atom wsListAtom = XInternAtom(display(),_XA_DT_WORKSPACE_LIST,False); int status=XGetWindowProperty(display(),_mwmWindow, wsListAtom,0L,(long)BUFSIZ, False,XA_ATOM, &actualType,&actualFormat, &lcount,&leftover, (unsigned char**)&xAtoms); if (status==Success && actualType==XA_ATOM && lcount>0) { atoms = new Atom[lcount]; memcpy(atoms,xAtoms,(int)lcount*sizeof(Atom)); // copy the new atoms } if (xAtoms!=0) { XFree((char*)xAtoms); } return atoms; } int AplusDisplayServer::workspaceNumber(const char *wsName_) const { MSStringVector wsNames(workspaceNames()); int n=numberOfWorkspaces(); for (int i=0; i0) { data=(int *)actData; screen=(int)data[0]; } if (data!=0) XFree((char *)actData); return screen; } } int AplusDisplayServer::virtualScreen(void) { if (isCDERunning()==MSTrue) { return workspaceNumber(currentWorkspaceName()); } else // CDE is not running { return virtualScreen(root()); } } void AplusDisplayServer::virtualGeometry(int& x_,int& y_) { if (isCDERunning()==MSTrue) { // With TED's current implementation, changes in the virtual geometry are not written to // the resource database (where the number of rows is stored) until auto-save takes place. // Hopefully, in the future, TED will have a property that we can query for the number of // rows. Trying to force the database update manually proved to be too time-consuming. // char coverStr[256]; char *coverClass = NULL; char *coverType[256]; XrmValue value; char *serverString = XResourceManagerString(_dpy); if (serverString==0) { x_=1; y_=1; return; } XrmDatabase serverDB = XrmGetStringDatabase(serverString); sprintf(coverStr,"Dtwm*%d*gwmRows",screenNum()); Bool rc = XrmGetResource(serverDB, coverStr, coverClass, coverType, &value); if (rc==True) { if( 0== (x_ = atoi(MSString(value.addr,value.size).string()) )) { x_=1; y_=1; } else y_ = numberOfWorkspaces()/x_; } else { x_=1; y_=1; } } else // CDE is not running { Atom actualTarget; int actualFormat; int status; unsigned long numItems; unsigned long bytesRemaining; unsigned char *actData; int *data=0; long len=2*((sizeof(int)+3)/4); Atom atom = XInternAtom(display(),"WM_VIRTUAL_GEOMETRY",False); status=XGetWindowProperty(display(),root(),atom, 0L,len,False,XA_INTEGER, &actualTarget,&actualFormat,&numItems, &bytesRemaining,&actData); if (status==Success&&actualTarget==XA_INTEGER&&actualFormat==32&&numItems>0) { data=(int *)actData; x_=(int)data[0]; y_=(int)data[1]; } else { x_=1; y_=1; } if (data!=0) XFree((char *)actData); } } aplus-fsf-4.22/src/AplusGUI/AplusEntryField.C0000644000265000001440000002127210772770344014433 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include extern long dbg_tmstk; int safeAset(V,A,A,A); A convertToPixels(const MSWidgetCommon *, A); AplusEntryField::AplusEntryField(MSWidget *widget_) : MSEntryFieldPlus(widget_) { backingStore(WhenMapped); AplusModel *am= new AplusModel(0); dynamic(MSTrue); supportPasting(MSFalse); INTERNAL_COUPLE(am); } AplusEntryField::~AplusEntryField(void) {} MSBoolean AplusEntryField::verifyData(V,A) { return MSTrue; } void AplusEntryField::edit(void) { MSEntryFieldPlus::edit(); } MSBoolean AplusEntryField::activateEditor(void) { return MSEntryFieldPlus::activateEditor(); } MSBoolean AplusEntryField::validate(const char *string_) { if (model() && ((AplusModel*)model())->aplusVar()!=0) { V v=((AplusModel*)model())->aplusVar(); A r=aplus_nl; AInFunction *inFunc; if ((inFunc=((AplusModel *) model())->getInFunc(v))!=0) r=inFunc->invoke(v,(char *)string_,-1,-1); else r=defaultInFunc(v,string_); if (r==0 || isNull(r)==MSTrue) return MSFalse; else { r=(A)ic(r); if (safeAset(v,r,0,0)==0) { showError(qs); dc(r); return MSFalse; } else { ((AplusModel*)model())->doneCB(v,r,0,0); dc(r); return MSTrue; } } } return MSFalse; } void AplusEntryField::receiveEvent(MSEvent &event_) { const MSSymbol& eventType = event_.type(); if (eventType==AplusEvent::symbol()) { if (dbg_tmstk) cout << "Received UpdateEvent in AplusEntryField" << endl; update(MSIndexVector::nullVector()); } else if (eventType==AplusVerifyEvent::symbol()) { if (dbg_tmstk) cout << "Received VerifyEvent in AplusEntryField" << endl; AplusVerifyEvent *ave = (AplusVerifyEvent *) &event_; ave->result(verifyData(ave->aplusVar(), ave->a())); } else if (eventType==AplusUpdateDataEvent::symbol()) { if (dbg_tmstk) cout << "Received UpdateDataEvent in AplusEntryField" << endl; setClipMode(); } else if (eventType==AplusUpdateTitleEvent::symbol()) { if (dbg_tmstk) cout << "Received UpdateDataEvent in AplusEntryField" << endl; updateTitle(); } } const char *AplusEntryField::formatOutput(MSString& str_) { static const char blank[]={" "}; A outStr=aplus_nl; if (model() && ((AplusModel *)model())->aplusVar()) { V v=((AplusModel*)model())->aplusVar(); A a=((AplusModel*)model())->a(); ACharStrFunction *outFunc=((AplusModel *)model())->getOutFunc(v); if (outFunc!=0) { outStr=(A)outFunc->invoke(v,a); outStr=(outStr->t==Ct)?outStr:aplus_nl; } } if (isNull(outStr)==MSTrue) return (char *) 0; str_ = (Ct==outStr->t) ? (const char *)outStr->p : blank; dc(outStr); return str_; } void AplusEntryField::addSenderNotify(MSEventSender *m_) { INTERNAL_COUPLE(((AplusModel *)m_)); label(itemLabel()); setClipMode(); updateTitle(); } A AplusEntryField::defaultInFunc(V v_,const char *string_) { if (v_==0) return aplus_nl; char *ptrchar=0; long lnum=0; double dnum=0.0; A r=aplus_nl; A av=(A)v_->a; switch(av->t) { case It: lnum=strtol((char *)string_,&ptrchar,10); // Base 10 if (ptrchar==(char *)string_) { r=aplus_nl; showError("Unknown Number: Integer Expected"); } else r=gi((int)lnum); break; case Ft: dnum=strtod((char *)string_,&ptrchar); if (ptrchar==(char *)string_) { r=aplus_nl; showError("Unknown Number: Float Expected"); } else r=gf((double)dnum); break; case Ct: r=gsv(0,(char *)string_); break; case Et: // possible null object if (av->n==0) r=gsv(0,(char *)string_); break; default: break; } return (A) r; } const char *AplusEntryField::itemLabel(void) { A outStr=aplus_nl; V v=(model()!=0)?((AplusModel*)model())->aplusVar():0; if (v!=0) { AVariableData *varData = ::pAVarDataFromV(v); A str=varData->title(); if (isNull(str)==MSFalse && str->t==Ct) outStr=(A)ic(str); } return (isNull(outStr)==MSFalse) ? (char *)outStr->p : 0; } void AplusEntryField::setClipMode(void) { AplusModel *pModel=(AplusModel *)model(); if (pModel!=0) { V v=pModel->aplusVar(); if (v!=0) { AVariableData *varData = ::pAVarDataFromV(v); if (varData->stars()==MSTrue) { clipMode(MSClipStars); } else { clipMode(MSNoClipping); } } } } void AplusEntryField::updateTitle(void) { V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; MSBoolean changed = MSFalse; if (v) { AVariableData *varData = ::pAVarDataFromV(v); const char *l = itemLabel(); if (l&&label()!=MSStringVector(l)) { changed = MSTrue; label(itemLabel()); } // UpdateTitleFont Font fid = varData->titleFont(); if (fid && fid != labelFont()) { if (labelFont()!=fid) { changed=MSTrue; labelFont(fid); } } //UpdateTitleForeground unsigned long fg = titleForeground(); labelForeground(fg); if (changed==MSTrue) { if (dynamic()==MSTrue) computeSize(); else redraw(); } } } void AplusEntryField::firstMapNotify(void) { MSString str; const char *pString = formatOutput(str); // Make sure the first string fits in the field if (pString!=0) { AplusModel *pModel = (AplusModel *)model(); if (pModel!=0 && pModel->aplusVar()!=0) { AVariableData *vd = pModel->pAVarData(); valueWidth(vd->colWidth()); } } MSEntryFieldPlus::firstMapNotify(); } MSBoolean AplusEntryField::isProtected(void) const { MSBoolean ro = MSFalse; V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; A a = (model()!=0)?((AplusModel*)model())->a():aplus_nl; if (v) { AVariableData *varData = ::pAVarDataFromV(v); ro=varData->readOnly(); AReadOnlyFunction *roFunc=AplusModel::getReadOnlyFunc(v); if (roFunc!=0) ro=(MSBoolean) roFunc->invoke(v,a); } return ro; } void AplusEntryField::createCycle(void) { V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; A a = (model()!=0)?((AplusModel*)model())->a():aplus_nl; ACycleFunction *cycleFunc = AplusModel::getCycleFunc(v); MSUnsignedLongVector uv; if (v!=0) { if (cycleFunc && cycleFunc->func()!=0) { A colors = cycleFunc->invoke(v,a); A pixelColors = (isNull(colors)==MSFalse) ? convertToPixels(this,colors) : colors; if (isNull(pixelColors)==MSFalse) { for (unsigned i = 0; i < pixelColors->n; i++) uv << (unsigned long) pixelColors->p[i]; dc(pixelColors); } cycleColors(uv); } } MSEntryFieldPlus::createCycle(); } void AplusEntryField::updateForeground(unsigned long oldfg_) { MSComposite::updateForeground(oldfg_); if (oldfg_==editorBackground()) editorBackground(foreground()); _fieldValue->foreground(foreground()); redraw(); } void AplusEntryField::updateFont(Font oldfid_) { MSComposite::updateFont(oldfid_); _fieldValue->font(font()); XSetFont(display(),drawGC(),font()); if (dynamic()==MSTrue) computeSize(); else redraw(); } void AplusEntryField::increment(void) { if (callback(MSWidgetCallback::increment)!=0) { activateCallback(MSWidgetCallback::increment); } else { activateCallback(MSWidgetCallback::reference); } } void AplusEntryField::decrement(void) { if (callback(MSWidgetCallback::decrement)!=0) { activateCallback(MSWidgetCallback::decrement); } else { activateCallback(MSWidgetCallback::reference); } } void AplusEntryField::currentColors(unsigned long &fg_, unsigned long &bg_) { if (cycle()!=0 && cycle()->count()numCycles()) // cycle colors { fg_=cycle()->color(cycle()->count()); bg_=valueBackground(); } else // regular colors { fg_=foreground(); V v = (model()!=0)?((AplusModel *)model())->aplusVar():0; if (v) { AColorFunction *fgFunc=AplusModel::getFgFunc(v); if (fgFunc!=0) { fg_=(unsigned long)fgFunc->invoke(v,(A)v->a); } } bg_=valueBackground(); } } const MSSymbol& AplusEntryField::widgetType(void) const { return symbol(); } const MSSymbol& AplusEntryField::symbol(void) { static MSSymbol sym("AplusEntryField"); return sym; } aplus-fsf-4.22/src/AplusGUI/AplusEnumConverter.C0000644000265000001440000001536710772770344015172 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #if HAVE_IOSTREAM #include #else #include #endif #include #include #include #include #include unsigned long AplusEnumConverter::convert(A symbols_) const { unsigned long enums=enumNotFound(); // initialize enums with an invalid value if (symbols_!=0) { I *p=symbols_->p; for (int i=0; i<(int)symbols_->n; i++) { char *s=(char *)XS(p[i])->n; if (QS(p[i])) { unsigned long val = enumLookup(s); if (val==enumNotFound()) { cerr << " ! "; if (s!=0) cerr<>=1; bit<<=1; } if (count>0) { char *str; A symbols=gv(Et,count); x=enums_; bit=0x1; count=0; while (x!=0) { if (x & 0x1) { str = (char *)stringLookup(bit); if (str!=stringNotFound()) { symbols->p[count++]=MS(si(str)); } } x>>=1; bit<<=1; } return symbols; } else // count==0 { char *str = (char *)stringLookup(0); // check for `none symbol or something similar if (str==stringNotFound()) // there is no `none equivalent { return aplus_nl; } else // found the string in the hash table => there is a `none equivalent { A symbol=gs(Et); *symbol->p = MS(si(str)); return symbol; } } } unsigned long AplusHashEnumConverter::enumLookup(const char *str_) const { return (unsigned long)enumTable().lookup(str_); } unsigned long AplusHashEnumConverter::enumNotFound(void) const { return enumTable().notFound(); } const char *AplusHashEnumConverter::stringLookup(unsigned long enum_) const { return (const char *)stringTable().lookup(enum_); } const char *AplusHashEnumConverter::stringNotFound(void) const { return (const char *)stringTable().notFound(); } unsigned long AplusHashSingleEnumConverter::convert(A sym_) const { if (!QS(sym_) && sym_->t==Et && sym_->n>0 && QS(*sym_->p)) { return fromString((char *)XS(sym_->p[0])->n); } else { return enumNotFound(); } } A AplusHashSingleEnumConverter::convert(unsigned long enum_) const { A a = gs(Et); *a->p = MS(si((char *)toString(enum_))); return a; } unsigned long AplusHashSingleEnumConverter::fromString(const char *str_) const { unsigned long en = enumLookup(str_); if (en==enumNotFound()) { cerr << " ! "; if (str_!=0) cerr< AplusEvent::~AplusEvent(void) {} A AplusEvent::index(void) { return _index; } A AplusEvent::pick(void) { return _pick; } I AplusEvent::ravel(void) { return _ravel; } const MSSymbol& AplusEvent::symbol(void) { static MSSymbol sym("AplusEvent"); return sym; } AplusVerifyEvent::~AplusVerifyEvent(void) {} A AplusVerifyEvent::a(void) { return _a; } V AplusVerifyEvent::aplusVar(void) { return _aplusVar; } MSBoolean AplusVerifyEvent::result(void) { return _result; } void AplusVerifyEvent::result(MSBoolean r_) { _result = r_; } const MSSymbol& AplusVerifyEvent::symbol(void) { static MSSymbol sym("AplusVerifyEvent"); return sym; } const MSSymbol& AplusUpdateDataEvent::symbol(void) { static MSSymbol sym("AplusUpdateDataEvent"); return sym; } AplusProtectEvent::AplusProtectEvent(void) : MSEvent(AplusProtectEvent::symbol()) {} AplusProtectEvent::~AplusProtectEvent(void) {} const MSSymbol& AplusProtectEvent::symbol(void) { static MSSymbol sym("AplusProtectEvent"); return sym; } AplusUpdateTitleEvent::AplusUpdateTitleEvent(void) : MSEvent(AplusUpdateTitleEvent::symbol()) {} AplusUpdateTitleEvent::~AplusUpdateTitleEvent(void) {} const MSSymbol& AplusUpdateTitleEvent::symbol(void) { static MSSymbol sym("AplusUpdateTitleEvent"); return sym; } aplus-fsf-4.22/src/AplusGUI/AplusFormatter.C0000644000265000001440000004545210772770345014340 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #if HAVE_IOSTREAM #include #else #include #endif #if HAVE_SSTREAM && HAVE_IOSFWD #include # if HAVE_IOSFWD #include # else # error "Must have iosfwd with sstream" # endif #else #include #endif #include #include #include const int EnumHashTableSize=128; const int DefaultOutputPrecision=6; int AplusFormatter::_count=0; AplusHashTable *AplusFormatter::_enumHashTable=0; AplusHashTable *AplusFormatter::_stringEnumHashTable=0; struct tm AplusFormatter::_aTimeStruct; AplusFormatter::AplusFormatter(void) { if (count()==0) { initHashTable(); initStringHashTable(); } _count++; } AplusFormatter::~AplusFormatter(void) { _count--; if (count()==0) { delete _enumHashTable; delete _stringEnumHashTable; _enumHashTable=0; _stringEnumHashTable=0; } } AplusFormatter::OutputFormat AplusFormatter::format(const char *str_) { if (str_!=0) { if (str_[0]=='\0') return NoFormat; else return (OutputFormat)(unsigned long)enumHashTable()->lookup(str_); } else return BadFormat; } char *AplusFormatter::formatEnumString(int fmt_) { return (char *)stringEnumHashTable()->lookup((OutputFormat)fmt_); } AplusFormatter::OutputFormat AplusFormatter::format(A str_) { if (QS(str_)) return format((char *)XS(str_)->n); else if (str_->t==Ct) return format((char *)str_->p); else if (str_->t==Et&&str_->n>0&&QS(*str_->p)) return format((char *)XS(*str_->p)->n); else return BadFormat; } A AplusFormatter::formats(void) { return stringEnumHashTable()->listAllEntries(); } void AplusFormatter::initHashTable(void) { _enumHashTable=new AplusHashTable(EnumHashTableSize); enumHashTable()->notFound((unsigned long)BadFormat); enumHashTable()->add("none",(void*)NoFormat); enumHashTable()->add("float",(void*)Float); enumHashTable()->add("fixed",(void*)Fixed); enumHashTable()->add("frac",(void*)Fraction); enumHashTable()->add("32nd",(void*)Price32); enumHashTable()->add("64th",(void*)Price64); enumHashTable()->add("128th",(void*)Price128); enumHashTable()->add("320th",(void*)Price320); enumHashTable()->add("328th",(void*)Price328); enumHashTable()->add("hr",(void*)hh); enumHashTable()->add("hr24",(void*)hh24); enumHashTable()->add("min",(void*)mm); enumHashTable()->add("sec",(void*)ss); enumHashTable()->add("hrmin",(void*)hhmm); enumHashTable()->add("hrmin24",(void*)hhmm24); enumHashTable()->add("minsec",(void*)mmss); enumHashTable()->add("hrminsec",(void*)hhmmss); enumHashTable()->add("hrminsec24",(void*)hhmmss24); enumHashTable()->add("day7_u",(void*)D_u); enumHashTable()->add("day365_u",(void*)DDD_u); enumHashTable()->add("day31_u",(void*)DD_u); enumHashTable()->add("m12_u",(void*)MM_u); enumHashTable()->add("m_u",(void*)MO_u); enumHashTable()->add("y2_u",(void*)Y2_u); enumHashTable()->add("y4_u",(void*)Y4_u); enumHashTable()->add("mdy_u",(void*)DMDDYYYY_u); enumHashTable()->add("dmy2_u",(void*)DDMMYY_u); enumHashTable()->add("dmy4_u",(void*)DDMMYYYY_u); enumHashTable()->add("mdy2_u",(void*)MMDDYY_u); enumHashTable()->add("mdy4_u",(void*)MMDDYYYY_u); enumHashTable()->add("day7",(void*)D); enumHashTable()->add("day365",(void*)DDD); enumHashTable()->add("day31",(void*)DD); enumHashTable()->add("m12",(void*)MM); enumHashTable()->add("m",(void*)MO); enumHashTable()->add("y2",(void*)Y2); enumHashTable()->add("y4",(void*)Y4); enumHashTable()->add("mdy",(void*)DMDDYYYY); enumHashTable()->add("dmy2",(void*)DDMMYY); enumHashTable()->add("dmy4",(void*)DDMMYYYY); enumHashTable()->add("mdy2",(void*)MMDDYY); enumHashTable()->add("mdy4",(void*)MMDDYYYY); } void AplusFormatter::initStringHashTable(void) { _stringEnumHashTable=new AplusHashTable(EnumHashTableSize); stringEnumHashTable()->notFound((int)0); stringEnumHashTable()->add(NoFormat,(void*)"none"); stringEnumHashTable()->add(Float,(void*)"float"); stringEnumHashTable()->add(Fixed,(void*)"fixed"); stringEnumHashTable()->add(Fraction,(void*)"frac"); stringEnumHashTable()->add(Price32,(void*)"32nd"); stringEnumHashTable()->add(Price64,(void*)"64th"); stringEnumHashTable()->add(Price128,(void*)"128th"); stringEnumHashTable()->add(Price320,(void*)"320th"); stringEnumHashTable()->add(Price328,(void*)"328th"); stringEnumHashTable()->add(hh,(void*)"hr"); stringEnumHashTable()->add(hh24,(void*)"hr24"); stringEnumHashTable()->add(mm,(void*)"min"); stringEnumHashTable()->add(ss,(void*)"sec"); stringEnumHashTable()->add(hhmm,(void*)"hrmin"); stringEnumHashTable()->add(hhmm24,(void*)"hrmin24"); stringEnumHashTable()->add(mmss,(void*)"minsec"); stringEnumHashTable()->add(hhmmss,(void*)"hrminsec"); stringEnumHashTable()->add(hhmmss24,(void*)"hrminsec24"); stringEnumHashTable()->add(D_u,(void*)"day7_u"); stringEnumHashTable()->add(DDD_u,(void*)"day365_u"); stringEnumHashTable()->add(DD_u,(void*)"day31_u"); stringEnumHashTable()->add(MM_u,(void*)"m12_u"); stringEnumHashTable()->add(MO_u,(void*)"m_u"); stringEnumHashTable()->add(Y2_u,(void*)"y2_u"); stringEnumHashTable()->add(Y4_u,(void*)"y4_u"); stringEnumHashTable()->add(DMDDYYYY_u,(void*)"mdy_u"); stringEnumHashTable()->add(DDMMYY_u,(void*)"dmy2_u"); stringEnumHashTable()->add(DDMMYYYY_u,(void*)"dmy4_u"); stringEnumHashTable()->add(MMDDYY_u,(void*)"mdy2_u"); stringEnumHashTable()->add(MMDDYYYY_u,(void*)"mdy4_u"); stringEnumHashTable()->add(D,(void*)"day7"); stringEnumHashTable()->add(DDD,(void*)"day365"); stringEnumHashTable()->add(DD,(void*)"day31"); stringEnumHashTable()->add(MM,(void*)"m12"); stringEnumHashTable()->add(MO,(void*)"m"); stringEnumHashTable()->add(Y2,(void*)"y2"); stringEnumHashTable()->add(Y4,(void*)"y4"); stringEnumHashTable()->add(DMDDYYYY,(void*)"mdy"); stringEnumHashTable()->add(DDMMYY,(void*)"dmy2"); stringEnumHashTable()->add(DDMMYYYY,(void*)"dmy4"); stringEnumHashTable()->add(MMDDYY,(void*)"mdy2"); stringEnumHashTable()->add(MMDDYYYY,(void*)"mdy4"); } extern "C" A ep_fmt(unsigned char *,A); int AplusFormatter::defaultPrecision(void) { return DefaultOutputPrecision; } A AplusFormatter::fmt(A str_,A data_) { return ep_fmt((unsigned char *)str_->p,data_); } A AplusFormatter::thorn(A fmt_,A data_) { static char buf[128]; if (QA(fmt_)&&fmt_->t==It&&fmt_->n==2) { P p;p.i=data_->p; buf[0]='\0'; sprintf(buf,"%*.*f",(int)fmt_->p[0],(int)fmt_->p[1],(data_->t==Ft)?p.f[0]:(double)p.i[0]); return (A)gsv(0,buf); } else return aplus_nl; } const char *AplusFormatter::formatOutput(OutputFormat fmt_,double v_,int p_,MSBoolean showPos_) { static char microSymbol[] ={' ','1','2','3','+','5','6','7'}; static const char *day[] ={"Sun","Mon","Tue","Wed","Thu","Fri","Sat"}; static const char *month[]={"Jan","Feb","Mar","Apr","May","Jun", "Jul","Aug","Sep","Oct","Nov" ,"Dec"}; #if HAVE_SSTREAM static string bufstr; static ostringstream os(bufstr,ios::out); #else static char buf[64]; static ostrstream os(buf,64,ios::out); #endif static char plus[1]; static char minus[1]; int i,j; int denom,num,whole; int found=0; int frac,small,tiny; time_t date; double fraction,r; double value=v_; int precision=p_; struct tm *when; #ifdef APLUS_THREAD_SAFE_FUNCTIONS struct tm tmp; #endif // APLUS_THREAD_SAFE_FUNCTIONS AplusFormatter::OutputFormat format=fmt_; plus[0]=(value>=0.0&&showPos_==MSTrue)?'+':'\0'; minus[0]=(value<0.0)?'-':'\0'; os.precision(precision); os.setf(ios::right,ios::adjustfield); os.seekp(ios::beg); if (format>=D&&format<=MMDDYYYY) { when=parseDate(value); os.fill('0'); } else if (format>=Price32&&format<=Price328&&value<0.0) { value*=-1; } else if (format>Price328) { os.fill('0'); if (value>=0&&valuetm_hour>=12)?1:0; j=when->tm_hour%12; } else if (format>D_u) { when=julianDay(value); } else format=Float; } else os.fill(' '); switch (format) { case BadFormat: case NoFormat: os.setf(ios::fixed,ios::floatfield); os<tm_hour<tm_min<tm_sec<tm_min; os<<((i==1)?"pm":"am")<tm_hour<<":"; os.width(2); os<tm_min<tm_min<<":" ; os.width(2); os<tm_sec<tm_min<<":" ; os.width(2); os<tm_sec; os<<((i==1)?"pm":"am")<tm_hour<<":"; os.width(2); os<tm_min<<":"; os.width(2); os<tm_sec<tm_wday]<tm_yday+1<tm_mday<tm_mon+1<tm_mon]<tm_year%100)<tm_year+1900<tm_wday]<<" "; os<tm_mon]<<" "; os.width(2); os<tm_mday<<", "; os<tm_year+1900<tm_mday<<"/"; os.width(2); os<tm_mon+1<<"/"; os.width(2); os<<(when->tm_year%100)<tm_mday<<"/"; os.width(2); os<tm_mon+1<<"/"; os<tm_year+1900<tm_mon+1<<"/"; os.width(2); os<tm_mday<<"/"; os.width(2); os<<(when->tm_year%100)<tm_mon+1<<"/"; os.width(2); os<tm_mday<<"/"; os<tm_year+1900<tm_wday>=0&&when->tm_wday<7)?when->tm_wday:0]<tm_yday<tm_mday<tm_mon+1<tm_mon>=0&&when->tm_mon<12)?when->tm_mon:0]<tm_year%100)<tm_year<tm_wday>=0&&when->tm_wday<7)?when->tm_wday:0]<<" "; os<tm_mon>=0&&when->tm_mon<12)?when->tm_mon:0]<<" "; os.width(2); os<tm_mday<<", "; os.width(4); os<tm_year<tm_mday<<"/"; os.width(2); os<tm_mon+1<<"/"; os.width(2); os<< (when->tm_year%100)<tm_mday<<"/"; os.width(2); os<tm_mon+1<<"/"; os.width(4); os<tm_year<tm_mon+1<<"/"; os.width(2); os<tm_mday<<"/"; os.width(2); os<< (when->tm_year%100)<tm_mon+1<<"/"; os.width(2); os<tm_mday<<"/"; os.width(4); os<tm_year<t==It&&fmt_->n==2) { format=(OutputFormat)fmt_->p[0]; precision=(int)fmt_->p[1]; } else return aplus_nl; if (QA(data_)&&data_->t<=Ft) { P p;p.i=data_->p; value=(data_->t==Ft)?p.f[0]:(double)p.i[0]; } else return aplus_nl; return (A)gsv(0,(char *)formatOutput(format,value,precision,MSFalse)); } A AplusFormatter::sfmt(A fmt_,A data_) { if (QA(fmt_)) { if (fmt_->t==Ct) return fmt(fmt_,data_); else if (fmt_->t==It||fmt_->t==Ft) { P p; p.i=fmt_->p; double dfmt=(fmt_->t==Ft)?(double)p.f[0]:(double)p.i[0]; int ifmt=(int)(10.0*dfmt); A fmt=(A)gv(It,2); int width=(int)floor(dfmt); int precision=(ifmt-(width*10)); fmt->p[0]=(I)width; fmt->p[1]=(I)precision; A r=(data_->t==It||data_->t==Ft)?thorn(fmt,data_):0; dc(fmt); if (r==0) q=6; return r; } else if (fmt_->t==Et&&fmt_->n>0) { P p; p.i=fmt_->p; if (QS(p.a[0])|| (QA(p.a[0])&&(p.a[0]->t==Et&&p.a[0]->n>0&&QS(*p.a[0]->p)))) { A r=0; if (QA(data_)&&data_->t<=Ft) { P pp;pp.i=data_->p; double value=(data_->t==Ft)?pp.f[0]:(double)pp.i[0]; int pr=(fmt_->n==2&&QA(p.a[1])&&It==p.a[1]->t)? (int)p.a[1]->p[0]:defaultPrecision(); r=(A)gsv(0,(char *)formatOutput(format(p.a[0]),value,pr,MSFalse)); } if (r==0) q=9; // domain error return r; } } } q=6; // type error return 0; } struct tm *AplusFormatter::parseDate(double ymd_) { static int mdays[]={31,28,31,30,31,30,31,31,30,31,30,31}; MSBoolean leapyr=MSFalse; int yr=(int)(ymd_*0.0001); double temp=(ymd_-yr*10000); int mmx=(int)(temp*0.01); int yday=0; int dd=(int)((mmx>=1 && mmx <=12)?temp-(mmx*100):0); if ((yr%4==0&&yr%100!=0)||yr%400==0) leapyr=MSTrue; int century, wday; if (mmx >= 1 && mmx <= 12 && dd >= 1 && dd <= ((leapyr==MSTrue && mmx==2) ? 29 : mdays[mmx-1]) ) { for (int i=0;i2) yday++; yday+=dd; century=2001>yr?0:(yr-2001)/100; wday=(yday+(yr-1900)+((yr-1901)/4)-(century-century/4))%7; } else // An invalid date will return 00/00/0000 { yr = mmx = dd = yday = wday = 0; } _aTimeStruct.tm_sec=0; _aTimeStruct.tm_min=0; _aTimeStruct.tm_hour=0; _aTimeStruct.tm_mday=dd; _aTimeStruct.tm_mon=mmx-1; _aTimeStruct.tm_yday=yday; _aTimeStruct.tm_wday=wday; _aTimeStruct.tm_year=yr; return &_aTimeStruct; } struct tm *AplusFormatter::julianDay(double value_) { _aTimeStruct.tm_sec=0; _aTimeStruct.tm_min=0; _aTimeStruct.tm_hour=0; int offset=2440588; // offset from sept 14 1752 // convert value (unix sec) to julian day // Convert Gregorian calendar date to the corresponding Julian day // number j. Algorithm 199 from Communications of the ACM, Volume 6, No. // 8, (Aug. 1963), p. 444. Gregorian calendar started on Sep. 14, 1752. unsigned long jday= (unsigned long)(offset+value_/86400-1721119); int wday=(int)((((jday+3)%7)+6)%7); int yr=(int)(((jday<<2)-1)/146097); jday=(jday<<2)-1-146097*yr; unsigned long d=(jday>>2); jday=((d<<2)+3)/1461; d=(d<<2)+3-1461*jday; d=(d+4)>>2; int month=(int)(5*d-3)/153; d=5*d-3-153*month; yr=(int)(100*yr+jday); if (month<10) month+=3; else { month-=9; yr++; } _aTimeStruct.tm_wday=wday==7?0:wday; _aTimeStruct.tm_mday=(int)((d+5)/5); _aTimeStruct.tm_mon=month-1; _aTimeStruct.tm_year=yr-1900; return &_aTimeStruct; } aplus-fsf-4.22/src/AplusGUI/AplusGraph.C0000644000265000001440000012275210772770345013435 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include extern long dbg_tmstk; const unsigned long EnumHashTableSize = 128; MSBoolean AplusGraph::_initialized = MSFalse; EnumError AplusGraph::_enumError; MSHashTable AplusGraph::_enumHashTable(EnumHashTableSize); MSHashTable AplusGraph::_stringEnumHashTable(EnumHashTableSize); MSHashTable AplusGraph::_gridEnumHashTable(EnumHashTableSize); MSHashTable AplusGraph::_legendEnumHashTable(EnumHashTableSize); AplusFormatter AplusGraph::_outFormat; //////////////////////////////////////////////////////////////////////////////// EnumError::EnumError(void) { _lamp = "\343"; _attrmsg = ": unknown attributes: `"; _symmsg = ": invalid symbol"; } AplusGraph::AplusGraph(MSWidget *owner_) : MSGraph(owner_) { if (_initialized == MSFalse) { _initialized = MSTrue; initEnumHashTable(); initStringEnumHashTable(); initGridEnumHashTable(); initLegendEnumHashTable(); } _axisAMode = "std"; _axisARule = "std"; _gridAStyle = "dash"; _zeroAStyle = "dot1"; for (int i=0; i<2; i++) // jmiz { // jmiz _y_labelFormat[i]= AplusFormatter::BadFormat; // jmiz _x_labelFormat[i]= AplusFormatter::BadFormat; // jmiz _x_subLabelFormat[i]= AplusFormatter::BadFormat; // jmiz } // jmiz foreground(server()->pixel("black")); gridForeground(server()->pixel("slategray")); zeroAxisForeground(server()->pixel("slategray")); unsigned long fg = server()->pixel("black"); axisForeground(fg, MSTop | MSBottom | MSLeft | MSRight); legendAlignment(MSG::Inside|MSTop|MSLeft); AplusModel *am=new AplusModel(0); INTERNAL_COUPLE(am); } AplusGraph::~AplusGraph(void) {} void AplusGraph::initEnumHashTable( void ) { enumHashTable()->notFound((int)0); enumHashTable()->add("" ,(void*)MSNone); enumHashTable()->add("axis" ,(void*)_Axis); enumHashTable()->add("ymode" ,(void*)_YAxis); enumHashTable()->add("rule" ,(void*)_Rule); enumHashTable()->add("grid" ,(void*)_Grid); enumHashTable()->add("gridStyle" ,(void*)_LineStyle); enumHashTable()->add("tickStyle" ,(void*)_TickStyle); enumHashTable()->add("legendPosition" ,(void*)_LegendPosition); enumHashTable()->add("legendPlacement" ,(void*)_LegendPlacement); enumHashTable()->add("legendStyle" ,(void*)_LegendStyle); enumHashTable()->add("ylabelStyle" ,(void*)_DisplayStyle); enumHashTable()->add("standard" ,(void*)MSGraph::Standard); enumHashTable()->add("normalize" ,(void*)MSGraph::Normalize); enumHashTable()->add("optimize" ,(void*)MSGraph::Optimize); enumHashTable()->add("piechart" ,(void*)MSGraph::PieChart); enumHashTable()->add("normal" ,(void*)MSGraph::Normal); enumHashTable()->add("addtrace" ,(void*)MSGraph::AddTrace); enumHashTable()->add("addtexttrace" ,(void*)MSGraph::AddTextTrace); enumHashTable()->add("solid" ,(void*)Solid); enumHashTable()->add("dash" ,(void*)Dash3); enumHashTable()->add("dash1" ,(void*)Dash0); enumHashTable()->add("dash2" ,(void*)Dash1); enumHashTable()->add("dash3" ,(void*)Dash2); enumHashTable()->add("dash4" ,(void*)Dash3); enumHashTable()->add("dash5" ,(void*)Dash4); enumHashTable()->add("dotdash" ,(void*)DotDash3); enumHashTable()->add("dotdash1" ,(void*)DotDash0); enumHashTable()->add("dotdash2" ,(void*)DotDash1); enumHashTable()->add("dotdash3" ,(void*)DotDash2); enumHashTable()->add("dotdash4" ,(void*)DotDash3); enumHashTable()->add("dotdash5" ,(void*)DotDash4); enumHashTable()->add("dot" ,(void*)Dot3); enumHashTable()->add("dot1" ,(void*)Dot0); enumHashTable()->add("dot2" ,(void*)Dot1); enumHashTable()->add("dot3" ,(void*)Dot2); enumHashTable()->add("dot4" ,(void*)Dot3); enumHashTable()->add("dot5" ,(void*)Dot4); enumHashTable()->add("ver" ,(void*)MSG::Vertical); enumHashTable()->add("hor" ,(void*)MSG::Horizontal); enumHashTable()->add("lastvalue" ,(void*)MSG::LastValue); enumHashTable()->add("none" ,(void*)MSNone); enumHashTable()->add("in" ,(void*)MSG::Inside); enumHashTable()->add("out" ,(void*)MSG::Outside); enumHashTable()->add("inout" ,(void*)(MSG::Inside | MSG::Outside)); enumHashTable()->add("tl" ,(void*)(MSTop | MSLeft)); enumHashTable()->add("tc" ,(void*)(MSTop | MSCenter)); enumHashTable()->add("tr" ,(void*)(MSTop | MSRight)); enumHashTable()->add("bl" ,(void*)(MSBottom | MSLeft)); enumHashTable()->add("bc" ,(void*)(MSBottom | MSCenter)); enumHashTable()->add("br" ,(void*)(MSBottom | MSRight)); enumHashTable()->add("std" ,(void*)MSG::Std); enumHashTable()->add("box" ,(void*)MSG::Box); enumHashTable()->add("x" ,(void*)MSBottom); enumHashTable()->add("X" ,(void*)MSTop); enumHashTable()->add("y" ,(void*)MSLeft); enumHashTable()->add("Y" ,(void*)MSRight); enumHashTable()->add("XY" ,(void*)(MSTop | MSRight)); enumHashTable()->add("xY" ,(void*)(MSBottom | MSRight)); enumHashTable()->add("Xy" ,(void*)(MSTop | MSLeft)); enumHashTable()->add("xy" ,(void*)(MSBottom | MSLeft)); enumHashTable()->add("ascend" ,(void*)MSG::Ascending); enumHashTable()->add("descend" ,(void*)MSG::Descending); enumHashTable()->add("inside" ,(void*)MSG::Inside); enumHashTable()->add("outsidevertical" ,(void*)(MSG::Outside | MSG::Vertical)); enumHashTable()->add("outsidehorizontal" ,(void*)(MSG::Outside | MSG::Horizontal)); } void AplusGraph::initStringEnumHashTable( void ) { stringEnumHashTable()->notFound((int)0); // GraphModes stringEnumHashTable()->add((unsigned long)MSGraph::Standard ,(void*)"standard"); // 1 stringEnumHashTable()->add((unsigned long)MSGraph::Normalize ,(void*)"normalize"); // 2 stringEnumHashTable()->add((unsigned long)MSGraph::Optimize ,(void*)"optimize"); // 4 stringEnumHashTable()->add((unsigned long)MSGraph::PieChart ,(void*)"piechart"); // 8 // GraphUIModes stringEnumHashTable()->add((unsigned long)MSGraph::Normal ,(void*)"normal"); // 16 stringEnumHashTable()->add((unsigned long)MSGraph::AddTrace ,(void*)"addtrace"); // 32 stringEnumHashTable()->add((unsigned long)MSGraph::AddTextTrace ,(void*)"addtexttrace"); // 2048 // LinesStyles stringEnumHashTable()->add(Solid ,(void*)"solid"); // 600 stringEnumHashTable()->add(Dash0 ,(void*)"dash1"); // 601 stringEnumHashTable()->add(Dash1 ,(void*)"dash2"); // 602 stringEnumHashTable()->add(Dash2 ,(void*)"dash"); // 603 stringEnumHashTable()->add(Dash3 ,(void*)"dash4"); // 604 stringEnumHashTable()->add(Dash4 ,(void*)"dash5"); // 605 stringEnumHashTable()->add(DotDash0 ,(void*)"dotdash1"); // 606 stringEnumHashTable()->add(DotDash1 ,(void*)"dotdash2"); // 607 stringEnumHashTable()->add(DotDash2 ,(void*)"dotdash"); // 608 stringEnumHashTable()->add(DotDash3 ,(void*)"dotdash4"); // 609 stringEnumHashTable()->add(DotDash4 ,(void*)"dotdash5"); // 610 stringEnumHashTable()->add(Dot0 ,(void*)"dot1"); // 611 stringEnumHashTable()->add(Dot1 ,(void*)"dot2"); // 612 stringEnumHashTable()->add(Dot2 ,(void*)"dot"); // 613 stringEnumHashTable()->add(Dot3 ,(void*)"dot4"); // 614 stringEnumHashTable()->add(Dot4 ,(void*)"dot5"); // 615 stringEnumHashTable()->add(MSG::Vertical ,(void*)"ver"); // 64 stringEnumHashTable()->add(MSG::Horizontal ,(void*)"hor"); // 128 // GraphStyles stringEnumHashTable()->add(MSG::LastValue ,(void*)"lastvalue"); // 256 stringEnumHashTable()->add(MSG::Outside ,(void*)"out"); // 512 stringEnumHashTable()->add(MSG::Inside ,(void*)"in"); // 1024 stringEnumHashTable()->add(MSG::Inside | MSG::Outside ,(void*)"inout"); // 1536 } void AplusGraph::initGridEnumHashTable( void ) { gridEnumHashTable()->notFound((int)0); // Grid gridEnumHashTable()->add((unsigned long)MSNone ,(void*)"none"); // 1 gridEnumHashTable()->add((unsigned long)MSBottom ,(void*)"x"); // 32 gridEnumHashTable()->add((unsigned long)MSTop ,(void*)"X"); // 16 gridEnumHashTable()->add((unsigned long)MSLeft ,(void*)"y"); // 4 gridEnumHashTable()->add((unsigned long)MSRight ,(void*)"Y"); // 8 gridEnumHashTable()->add((unsigned long)MSTop | MSLeft ,(void*)"Xy"); // 20 gridEnumHashTable()->add((unsigned long)MSTop | MSRight ,(void*)"XY"); // 24 gridEnumHashTable()->add((unsigned long)MSBottom | MSLeft ,(void*)"xy"); // 36 gridEnumHashTable()->add((unsigned long)MSBottom | MSRight ,(void*)"xY"); // 40 } void AplusGraph::initLegendEnumHashTable(void) { legendEnumHashTable()->notFound((int)0); // Legend Position has been moved to AplusGraph::LegendAlignConverter hash tables // // Axis Mode legendEnumHashTable()->add((unsigned long)MSG::Ascending ,(void*)"ascend"); // 0 legendEnumHashTable()->add((unsigned long)MSG::Descending ,(void*)"descend"); // 1 } // Format Labelout Functions (uses AplusLabelOut) void AplusGraph::y_labelFormatFunc(AFunc func_,AClientData *ac_,int axis_) { y_labelFormatFunc(axis_)->func(func_); y_labelFormatFunc(axis_)->arg(ac_); AplusLabelOut *alo = (AplusLabelOut *)(MSLabelOut *)axisLabelOut((axis_==0)?MSLeft:MSRight); AplusFuncLabelOut *aflo = new AplusFuncLabelOut(y_labelFormatFunc(axis_), ((AplusModel*)model())->aplusVar(), alo); axisLabelOut(aflo, (axis_==0)?MSLeft:MSRight); y_labelFormat(axis_==1?YYFunc:YFunc,axis_); redrawImmediately(); } void AplusGraph::x_labelFormatFunc(AFunc func_,AClientData *ac_,int axis_) { x_labelFormatFunc(axis_)->func(func_); x_labelFormatFunc(axis_)->arg(ac_); AplusLabelOut *alo = (AplusLabelOut *)(MSLabelOut *)axisLabelOut((axis_==0)?MSBottom:MSTop); AplusFuncLabelOut *aflo = new AplusFuncLabelOut(x_labelFormatFunc(axis_), ((AplusModel*)model())->aplusVar(), alo); axisLabelOut(aflo, (axis_==0)?MSBottom:MSTop); x_labelFormat(axis_==1?XXFunc:XFunc,axis_); redrawImmediately(); } void AplusGraph::x_subLabelFormatFunc(AFunc func_,AClientData *ac_,int axis_) { x_subLabelFormatFunc(axis_)->func(func_); x_subLabelFormatFunc(axis_)->arg(ac_); AplusLabelOut *alo = (AplusLabelOut *)(MSLabelOut *)axisSubLabelOut((axis_==0)?MSBottom:MSTop); AplusFuncLabelOut *aflo = new AplusFuncLabelOut(x_subLabelFormatFunc(axis_), ((AplusModel*)model())->aplusVar(), alo); axisSubLabelOut(aflo, (axis_==0)?MSBottom:MSTop); x_subLabelFormat(axis_==1?XXSubFunc:XSubFunc,axis_); redrawImmediately(); } // LabelFuncs uses AplusFuncLabel void AplusGraph::x_subLabelFunc(AFunc func_,AClientData *ac_,int axis_) { x_subLabelFunc(axis_)->func(func_); x_subLabelFunc(axis_)->arg(ac_); V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; if (v) { ::A a = x_subLabelFunc(axis_)->invoke(v, (::A)v->a); AplusLabelOut *alo = (AplusLabelOut *)(MSLabelOut *)axisSubLabelOut((axis_==0)?MSBottom:MSTop); AplusFuncLabel *afl = new AplusFuncLabel(a, alo); axisSubLabelOut(afl, (axis_==0)?MSBottom:MSTop); } } void AplusGraph::x_labelFunc(AFunc func_,AClientData *ac_,int axis_) { x_labelFunc(axis_)->func(func_); x_labelFunc(axis_)->arg(ac_); V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; if (v) { ::A a = x_labelFunc(axis_)->invoke(v, (::A)v->a); AplusLabelOut *alo = (AplusLabelOut *)(MSLabelOut *)axisLabelOut((axis_==0)?MSBottom:MSTop); AplusFuncLabel *afl = new AplusFuncLabel(a, alo); axisLabelOut(afl, (axis_==0)?MSBottom:MSTop); } } void AplusGraph::y_labelFunc(AFunc func_,AClientData *ac_,int axis_) { y_labelFunc(axis_)->func(func_); y_labelFunc(axis_)->arg(ac_); V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; if (v) { ::A a = y_labelFunc(axis_)->invoke(v, (::A)v->a); AplusLabelOut *alo = (AplusLabelOut *)(MSLabelOut *)axisLabelOut((axis_==0)?MSLeft:MSRight); AplusFuncLabel *afl = new AplusFuncLabel(a, alo); axisLabelOut(afl, (axis_==0)?MSLeft:MSRight); } } //////////////////////////////////////////////////////////////////////////////// void AplusGraph::y_labelFormat(::A sym_, int axis_, int precision_) { AplusFormatter::OutputFormat k; if ((k=outFmt()->format(sym_))!=AplusFormatter::BadFormat) { _y_labelFormat[axis_]=(int)k; _y_labelPrecision[axis_]=precision_; AplusLabelOut *alo = (AplusLabelOut *)(MSLabelOut *)axisLabelOut((axis_==0)?MSLeft:MSRight); AplusFormatLabelOut *afl = new AplusFormatLabelOut(k, precision_, alo); axisLabelOut(afl, (axis_==0)?MSLeft:MSRight); redrawImmediately(); } else enumError()->showError(((AplusModel*)model())->aplusVar(),(char *)XS(sym_->p[0])->n); } ::A AplusGraph::y_labelFormatSym(int axis_) { if (y_labelFormat(axis_)==YFunc||y_labelFormat(axis_)==YYFunc) return generateFuncSym(); else return generateSym(outFmt()->formatEnumString(y_labelFormat(axis_)), y_labelFormat(axis_)==outFmt()->Fixed?y_labelPrecision(axis_):-1); } void AplusGraph::x_subLabelFormat(::A sym_,int axis_, int precision_) { AplusFormatter::OutputFormat k; if ((k=outFmt()->format(sym_))!=AplusFormatter::BadFormat) { _x_subLabelFormat[axis_]=(int)k; _x_subLabelPrecision[axis_]=(int)precision_; AplusLabelOut *alo = (AplusLabelOut *)(MSLabelOut *)axisSubLabelOut((axis_==0)?MSBottom:MSTop); AplusFormatLabelOut *afl = new AplusFormatLabelOut(k, precision_, alo); axisSubLabelOut(afl, (axis_==0)?MSBottom:MSTop); redrawImmediately(); } else enumError()->showError(((AplusModel*)model())->aplusVar(),(char *)XS(sym_->p[0])->n); } ::A AplusGraph::x_subLabelFormatSym(int axis_) { if (x_subLabelFormat(axis_)==XFunc) return generateFuncSym(); else return generateSym(outFmt()->formatEnumString(x_subLabelFormat(axis_)), x_subLabelFormat(axis_)==outFmt()->Fixed?x_subLabelPrecision(axis_):-1); } void AplusGraph::x_labelFormat(::A sym_,int axis_, int precision_) { AplusFormatter::OutputFormat k; if ((k=outFmt()->format(sym_))!=AplusFormatter::BadFormat) { _x_labelFormat[axis_]=(int)k; _x_labelPrecision[axis_]=precision_; AplusLabelOut *alo = (AplusLabelOut *)(MSLabelOut *)axisLabelOut((axis_==0)?MSBottom:MSTop); AplusFormatLabelOut *afl = new AplusFormatLabelOut(k, precision_, alo); axisLabelOut(afl, (axis_==0)?MSBottom:MSTop); redrawImmediately(); } else enumError()->showError(((AplusModel*)model())->aplusVar(),(char *)XS(sym_->p[0])->n); } ::A AplusGraph::x_labelFormatSym(int axis_) { if (x_labelFormat(axis_)==XFunc || x_labelFormat(axis_)==XXFunc) return generateFuncSym(); else return generateSym(outFmt()->formatEnumString(x_labelFormat(axis_)), x_labelFormat(axis_)==outFmt()->Fixed?x_labelPrecision(axis_):-1); } ::A AplusGraph::generateFuncSym() { ::A a=gs(Et); *a->p=MS(si((char *)"func")); return a; } //////////////////////////////////////////////////////////////////////////////// ::A AplusGraph::enumSymbols(const char *str_) { ::A r=aplus_nl; GraphEnum k; if ((k=(GraphEnum)(unsigned long)enumHashTable()->lookup(str_))>0&& (k>=_GraphMode&&k<=_DisplayStyle)) { switch(k) { case _GraphStyle: r=gv(Et,2); r->p[0]=MS(si("ver")); r->p[1]=MS(si("hor")); break; case _GraphMode: r=gv(Et,3); r->p[0]=MS(si((char *)stringEnumHashTable()->lookup((unsigned long)MSGraph::Normal))); r->p[1]=MS(si((char *)stringEnumHashTable()->lookup((unsigned long)MSGraph::AddTrace))); r->p[2]=MS(si((char *)stringEnumHashTable()->lookup((unsigned long)MSGraph::AddTextTrace))); break; case _YAxis: r=gv(Et,2); r->p[0]=MS(si((char *)legendEnumHashTable()->lookup((unsigned long)MSG::Ascending))); r->p[1]=MS(si((char *)legendEnumHashTable()->lookup((unsigned long)MSG::Descending))); break; case _Axis: case _Rule: r=gv(Et,18); r->p[0]=MS(si("x")); r->p[1]=MS(si("y")); r->p[2]=MS(si("X")); r->p[3]=MS(si("Y")); r->p[4]=MS(si("yY")); r->p[5]=MS(si("xy")); r->p[6]=MS(si("xX")); r->p[7]=MS(si("xY")); r->p[8]=MS(si("Xy")); r->p[9]=MS(si("XY")); r->p[10]=MS(si("xXy")); r->p[11]=MS(si("xXY")); r->p[12]=MS(si("xyY")); r->p[13]=MS(si("XyY")); r->p[14]=MS(si("xXyY")); r->p[15]=MS(si(k==_Rule?"axis":"std")); r->p[16]=MS(si("box")); r->p[17]=MS(si("none")); break; case _Grid: r=gv(Et,9); r->p[0]=MS(si((char *)gridEnumHashTable()->lookup((unsigned long)MSNone))); r->p[1]=MS(si((char *)gridEnumHashTable()->lookup((unsigned long)MSBottom))); r->p[2]=MS(si((char *)gridEnumHashTable()->lookup((unsigned long)MSTop))); r->p[3]=MS(si((char *)gridEnumHashTable()->lookup((unsigned long)MSLeft))); r->p[4]=MS(si((char *)gridEnumHashTable()->lookup((unsigned long)MSRight))); r->p[5]=MS(si((char *)gridEnumHashTable()->lookup((unsigned long)MSTop | MSRight))); r->p[6]=MS(si((char *)gridEnumHashTable()->lookup((unsigned long)MSBottom | MSRight))); r->p[7]=MS(si((char *)gridEnumHashTable()->lookup((unsigned long)MSTop | MSLeft))); r->p[8]=MS(si((char *)gridEnumHashTable()->lookup((unsigned long)MSBottom | MSLeft))); break; case _LineStyle: r=gv(Et,4); r->p[0]=MS(si((char *)stringEnumHashTable()->lookup((unsigned long)Solid))); r->p[1]=MS(si((char *)stringEnumHashTable()->lookup((unsigned long)Dash3))); r->p[2]=MS(si((char *)stringEnumHashTable()->lookup((unsigned long)DotDash3))); r->p[3]=MS(si((char *)stringEnumHashTable()->lookup((unsigned long)Dot3))); break; case _TickStyle: r=gv(Et,3); r->p[0]=MS(si((char *)stringEnumHashTable()->lookup((unsigned long)MSG::Outside))); r->p[1]=MS(si((char *)stringEnumHashTable()->lookup((unsigned long)MSG::Inside))); r->p[2]=MS(si((char *)stringEnumHashTable()->lookup((unsigned long)MSG::Inside | MSG::Outside))); break; case _LegendStyle: r=gv(Et,3); r->p[0]=MS(si("ver")); r->p[1]=MS(si("hor")); r->p[2]=MS(si((char *)stringEnumHashTable()->lookup((unsigned long)MSG::LastValue))); break; case _DisplayStyle: r=gv(Et,2); r->p[1]=MS(si("ver")); r->p[0]=MS(si("hor")); break; } } return r; } //////////////////////////////////////////////////////////////////////////////// ::A AplusGraph::xExtents(int axis_) { ::A axisData=gv(Ft,3); ((F *)axisData->p)[0]=xMinData(axis_); ((F *)axisData->p)[1]=xMaxData(axis_); ((F *)axisData->p)[2]=xScale(axis_); return axisData; } ::A AplusGraph::yExtents(int axis_) { ::A axisData=gv(Ft,3); ((F *)axisData->p)[0]=yMinData(axis_); ((F *)axisData->p)[1]=yMaxData(axis_); ((F *)axisData->p)[2]=yScale(axis_); return axisData; } ::A AplusGraph::xLabelHeight(int axis_) { ::A h=gs(It); XFontStruct *fontInfo; fontInfo=(XFontStruct *)server()->fontStruct(xLabelFont(axis_)); *h->p=fontInfo->ascent+fontInfo->descent; return h; } ::A AplusGraph::yLabelHeight(int axis_) { ::A h=gs(It); XFontStruct *fontInfo; fontInfo=(XFontStruct *)server()->fontStruct(yLabelFont(axis_)); *h->p=fontInfo->ascent+fontInfo->descent; return h; } ::A AplusGraph::xLabelWidth(::A text_,int axis_) { XFontStruct *fontInfo=(XFontStruct*)server()->fontStruct(xLabelFont(axis_)); return labelWidth(text_,fontInfo); } ::A AplusGraph::yLabelWidth(::A text_,int axis_) { XFontStruct *fontInfo=(XFontStruct*)server()->fontStruct(yLabelFont(axis_)); return labelWidth(text_,fontInfo); } ::A AplusGraph::labelWidth(::A text_,XFontStruct *fi_) { ::A w=aplus_nl; P p; int i,n,offset; if (text_!=0&&text_->n!=0) { if (text_->t==Ct) { if (text_->r==2) { w=gv(It,(int)text_->d[0]); n=(int)text_->d[1]; p.i=text_->p; for (i=0; id[0]; i++) { offset=i*n; w->p[i]=XTextWidth(fi_,(char *)p.c+offset,n); } } else { w=gs(It); *w->p=XTextWidth(fi_,(char *)text_->p,(int)text_->n); } } else if (text_->t==Et) { w=gv(It,(int)text_->n); p.i=text_->p; for (i=0; i<(int)text_->n; i++) { w->p[i]=XTextWidth(fi_,(char *)p.a[i]->p,(int)p.a[i]->n); } } } return w; } ::A AplusGraph::coordinate(int axis_) // Call xCursorValue and yCursorValue { int offset=0; double x,y; ::A r; P p; if (graphUIMode()==AddTrace) { r=gm(Ft,nt(selectLine())->pointCount(),2); p.i=r->p; for (int i=0; ipointCount(); i++) { x = xPixelToValue(nt(selectLine())->points(i)->x, axis_); y = yPixelToValue(nt(selectLine())->points(i)->y, axis_); p.f[offset++]=x; p.f[offset++]=y; } } else { r=gm(Ft,1,2); p.i=r->p; p.f[0]=xCursorValue(axis_==0?MSLeft:MSRight); p.f[1]=yCursorValue(axis_==0?MSBottom:MSTop); } return r; } ::A AplusGraph::generateSym(char *str_,int prec_=-1) { if (str_==0) return aplus_nl; ::A a,s=gs(Et); *s->p=MS(si(str_)); if (prec_>=0) { a=gv(Et,2); a->p[0]=(I)s; a->p[1]=(I)gi(prec_); } else a=s; return a; } ::A AplusGraph::generateSym(MSHashTable *table_, int enumType_) { ::A a=gs(Et); *a->p=MS(si((char *)table_->lookup((unsigned long)enumType_))); return a; } ::A AplusGraph::generateGraphModeSym(unsigned long mode_) { unsigned i=0,n=0; if (mode_==Standard) n++; if (mode_&Normalize) n++; if (mode_&Optimize) n++; if (mode_&PieChart) n++; if (n>0) { ::A a=gv(Et,n); if (mode_==Standard) a->p[i++]=MS(si((char *)stringEnumHashTable()->lookup(mode_&Standard))); if (mode_&Normalize) a->p[i++]=MS(si((char *)stringEnumHashTable()->lookup(mode_&Normalize))); if (mode_&Optimize) a->p[i++]=MS(si((char *)stringEnumHashTable()->lookup(mode_&Optimize))); if (mode_&PieChart) a->p[i++]=MS(si((char *)stringEnumHashTable()->lookup(mode_&PieChart))); return a; } return aplus_nl; } ::A AplusGraph::generateGraphUIModeSym(int enumType_) { return generateSym(stringEnumHashTable(), enumType_); } ::A AplusGraph::generateAxisModeSym(AxisMode enumType_) { return generateSym(legendEnumHashTable(), enumType_); } ::A AplusGraph::generateGridSym(unsigned long enumType_) { return generateSym(gridEnumHashTable(), enumType_); } ::A AplusGraph::generateLegendStyleSym(unsigned long enumType_) { return generateSym(stringEnumHashTable(), enumType_); } ::A AplusGraph::generateTickStyleSym(unsigned long enumType_) { return generateSym(stringEnumHashTable(), enumType_); } void AplusGraph::graphAMode(::A sym_) // Need to look up symbol in hashtable and call graphUIMode() { if (!QS(sym_)&&(sym_->t==Et&&sym_->n>0&&QS(*sym_->p))) { unsigned long k,mode=0; for (unsigned i=0;in;i++) { if ((k=(unsigned long)enumHashTable()->lookup((char *)XS(sym_->p[i])->n))>0) mode+=k; else enumError()->showError(((AplusModel*)model())->aplusVar(),(char *)XS(sym_->p[i])->n); } graphMode(mode); } } ::A AplusGraph::graphAMode(void) // See graphModeSym in XGraph.H { return generateGraphModeSym(graphMode()); } void AplusGraph::graphAUIMode(::A sym_) // Need to look up symbol in hashtable and call graphUIMode() { if (!QS(sym_)&&(sym_->t==Et&&sym_->n>0&&QS(*sym_->p))) { GraphUIMode k; if ((k=(GraphUIMode)(unsigned long)enumHashTable()->lookup((char *)XS(sym_->p[0])->n))>0&& (k>=MSGraph::Normal&&k<=MSGraph::AddTextTrace)) { graphUIMode(k); } else enumError()->showError(((AplusModel*)model())->aplusVar(),(char *)XS(sym_->p[0])->n); } } ::A AplusGraph::graphAUIMode(void) // See graphModeSym in XGraph.H { return generateGraphUIModeSym(graphUIMode()); } void AplusGraph::axisAMode(::A sym_) // Need to look up symbol in hashtable and call axisMode() { unsigned long mode; if (!QS(sym_)&&(sym_->t==Et&&sym_->n>0&&QS(*sym_->p))) { char *style=(char *)XS(sym_->p[0])->n; mode=(unsigned long)enumHashTable()->lookup(style); if (mode==Std) { axis(Std); } else if (mode==MSG::Box) { axis(MSG::Box); } else { if (strpbrk(style,"x")!=0) mode |= MSBottom; if (strpbrk(style,"X")!=0) mode |= MSTop; if (strpbrk(style,"y")!=0) mode |= MSLeft; if (strpbrk(style,"Y")!=0) mode |= MSRight; axis(mode); } if (mode==MSNone) _axisAMode = "none"; else if (style) _axisAMode = style; } } ::A AplusGraph::axisAMode(void) // See axisSym in XGraph.H { ::A out = gs(Et); *out->p=MS(si((char *)(const char *)_axisAMode)); return out; } void AplusGraph::yAMode(::A sym_, MSAlignment a_) // Need to look up symbol in hashtable and call yMode() { if (!QS(sym_)&&(sym_->t==Et&&sym_->n>0&&QS(*sym_->p))) { AxisMode k; k=(AxisMode)(unsigned long)enumHashTable()->lookup((char *)XS(sym_->p[0])->n); if (k>=MSG::Ascending && k<=MSG::Descending) { axisMode(k, a_); } else enumError()->showError(((AplusModel*)model())->aplusVar(),(char *)XS(sym_->p[0])->n); } } ::A AplusGraph::yAMode(MSAlignment a_) // See axisSym in XGraph.H { return generateAxisModeSym(axisMode(a_));} void AplusGraph::axisARule(::A sym_) // Need to look up symbol in hashtable and call axisRule() { unsigned long mode = axisRule(); if (!QS(sym_)&&(sym_->t==Et&&sym_->n>0&&QS(*sym_->p))) { char *style=(char *)XS(sym_->p[0])->n; if ((mode=(unsigned long)enumHashTable()->lookup(style))==MSNone) { axisRule(MSNone); } else if (mode==Axis||mode==MSG::Box) { axisRule(mode); } else { if (strpbrk(style,"x")!=0) mode |= MSBottom; if (strpbrk(style,"X")!=0) mode |= MSTop; if (strpbrk(style,"y")!=0) mode |= MSLeft; if (strpbrk(style,"Y")!=0) mode |= MSRight; axisRule(mode); } if(mode==MSNone) _axisARule = "none"; else if (style) _axisARule = style; } } ::A AplusGraph::axisARule(void) { ::A out = gs(Et); *out->p=MS(si((char *)(const char *)_axisARule)); return out; } void AplusGraph::gridA(::A sym_) // Need to look up symbol in hashtable and call grid() { if (!QS(sym_)&&(sym_->t==Et&&sym_->n>0&&QS(*sym_->p))) { unsigned long k; if ((k=(unsigned long)enumHashTable()->lookup((char *)XS(sym_->p[0])->n))>=0&& (k == MSNone || k & (MSTop | MSBottom | MSRight | MSLeft))) { grid(k); } else enumError()->showError(((AplusModel*)model())->aplusVar(),(char *)XS(sym_->p[0])->n); } } ::A AplusGraph::gridA(void) // See axisSym in XGraph.H { return generateGridSym(grid()); } MSBoolean AplusGraph::styleConvert(LineStyle s_, unsigned long &lineStyle_, unsigned long &weight_) { if (s_>=Solid&&s_<=Dot5) { switch(s_) { case Solid: lineStyle_ = MSSolid; break; case Dash0: case Dash1: case Dash2: case Dash3: case Dash4: lineStyle_ = MSDash; break; case DotDash0: case DotDash1: case DotDash2: case DotDash3: case DotDash4: lineStyle_ = (MSDot | MSDash); break; case Dot0: case Dot1: case Dot2: case Dot3: case Dot4: case Dot5: lineStyle_ = MSDot; break; default: lineStyle_ = MSSolid; break; } switch(s_) { case Solid: case Dash0: case DotDash0: case Dot0: weight_ = 0; break; case Dash1: case DotDash1: case Dot1: weight_ = 1; break; case Dash2: case DotDash2: case Dot2: weight_ = 2; break; case Dash3: case DotDash3: case Dot3: weight_ = 3; break; case Dash4: case DotDash4: case Dot4: case Dot5: weight_ = 4; break; default: weight_ = 0; break; } return MSTrue; } return MSFalse; } void AplusGraph::gridAStyle(::A sym_) { if (!QS(sym_)&&(sym_->t==Et&&sym_->n>0&&QS(*sym_->p))) { unsigned long lineStyle, weight; LineStyle k; if ((k=(LineStyle)(unsigned long)enumHashTable()->lookup((char *)XS(sym_->p[0])->n))>0&& styleConvert(k, lineStyle, weight)==MSTrue) { freeze(); gridStyle(lineStyle); unfreeze(); gridWeight(weight); _gridAStyle = (const char *) XS(sym_->p[0])->n; } else enumError()->showError(((AplusModel*)model())->aplusVar(),(char *)XS(sym_->p[0])->n); } } ::A AplusGraph::gridAStyle(void) // call gridStyle and gridWeight { ::A out = gs(Et); *out->p=MS(si((char *)(const char *)_gridAStyle)); return out; } void AplusGraph::zeroA(::A sym_) { if (!QS(sym_)&&(sym_->t==Et&&sym_->n>0&&QS(*sym_->p))) { unsigned long k; if ((k=(unsigned long)enumHashTable()->lookup((char *)XS(sym_->p[0])->n))>=0&& (k == MSNone || k & (MSTop | MSBottom | MSRight | MSLeft))) { zeroAxis(k); } else enumError()->showError(((AplusModel*)model())->aplusVar(),(char *)XS(sym_->p[0])->n); } } ::A AplusGraph::zeroA(void) { return generateGridSym( zeroAxis()); } void AplusGraph::zeroAStyle(::A sym_) { if (!QS(sym_)&&(sym_->t==Et&&sym_->n>0&&QS(*sym_->p))) { unsigned long lineStyle, weight; LineStyle k; if ((k=(LineStyle)(unsigned long)enumHashTable()->lookup((char *)XS(sym_->p[0])->n))>0&& styleConvert(k, lineStyle, weight)==MSTrue) { freeze(); zeroAxisStyle(lineStyle); unfreeze(); zeroAxisWeight(weight); _zeroAStyle = (const char *)XS(sym_->p[0])->n; } else enumError()->showError(((AplusModel*)model())->aplusVar(),(char *)XS(sym_->p[0])->n); } } ::A AplusGraph::zeroAStyle(void) { ::A out = gs(Et); *out->p=MS(si((char *)(const char *)_zeroAStyle)); return out; } void AplusGraph::legendAStyle(::A sym_) { if (!QS(sym_)&&(sym_->t==Et&&sym_->n>0&&QS(*sym_->p))) { unsigned long k; if ((k=(unsigned long)enumHashTable()->lookup((char *)XS(sym_->p[0])->n))>0&& (k>=Vertical || k<=LastValue)) { legendStyle(k); } else enumError()->showError(((::AplusModel*)model())->aplusVar(),(char *)XS(sym_->p[0])->n); } } ::A AplusGraph::legendAStyle(void) { return generateLegendStyleSym(legendStyle()); } void AplusGraph::yTitleAStyle(::A sym_, MSAlignment axis_) { V v = (model()!=0)?((AplusModel *)model())->aplusVar():0; if (!QS(sym_)&&(sym_->t==Et&&sym_->n>0&&QS(*sym_->p))) { unsigned long k; if ((k=(unsigned long) enumHashTable()->lookup((char *)XS(sym_->p[0])->n))>0&& (k==MSG::Horizontal||k==MSG::Vertical)) { unsigned long oldStyle = axisTitleAlignment(axis_); if (k == MSG::Horizontal) { oldStyle|=(unsigned long) MSG::Horizontal; oldStyle&= ~(unsigned long) MSG::Vertical; } else { oldStyle|=(unsigned long) MSG::Vertical; oldStyle&= ~(unsigned long) MSG::Horizontal; } axisTitleAlignment(oldStyle, (unsigned long) axis_); } else enumError()->showError(v,(char *)XS(sym_->p[0])->n); } } ::A AplusGraph::yTitleAStyle(MSAlignment axis_) { ::A r = aplus_nl; unsigned long style = axisTitleAlignment(axis_); if (style&MSG::Vertical) { r=gv(Et,1); r->p[0] = MS(si("ver")); } else { r=gv(Et,1); r->p[0] = MS(si("hor")); } return r; } void AplusGraph::subTitleA(::A str_) { MSStringVector sv = AplusConvert::asMSStringVector(str_); subtitle(sv); } ::A AplusGraph::subTitleA(void) { ::A ap = aplus_nl; const MSStringVector &t=subtitle(); long d[MAXR]={ 0, 0, 0, 0, 0, 0, 0, 0, 0 }; long xrho=t.length(); d[0]=xrho; ap = ga(Et, 1, xrho, d); for (long i=0; ip[i]=(long) gc(Ct, 1, t.elementAt(i).length(), d, (long *)t.elementAt(i).string()); } return ap; } void AplusGraph::footnoteA(::A str_) { footnote(AplusConvert::asMSStringVector(str_)); } ::A AplusGraph::footnoteA(void) { ::A ap = aplus_nl; const MSStringVector &t=footnote(); long d[MAXR]={ 0, 0, 0, 0, 0, 0, 0, 0, 0 }; long xrho=t.length(); d[0]=xrho; ap = ga(Et, 1, xrho, d); for (long i=0; ip[i]=(long) gc(Ct, 1, t.elementAt(i).length(), d, (long *)t.elementAt(i).string()); } return ap; } void AplusGraph::tickStyleA(::A sym_, MSAlignment axis_) { if (!QS(sym_)&&(sym_->t==Et&&sym_->n>0&&QS(*sym_->p))) { unsigned long k; if ((k=(unsigned long)enumHashTable()->lookup((char *)XS(sym_->p[0])->n))>0&& (k==MSG::Inside || k==MSG::Outside)) { tickStyle(k, axis_); } else enumError()->showError(((AplusModel*)model())->aplusVar(),(char *)XS(sym_->p[0])->n); } } ::A AplusGraph::tickStyleA(MSAlignment axis_) { return generateTickStyleSym(tickStyle(axis_)); } MSBoolean AplusGraph::verifyTraceSet(::A a_) { return (a_!=0&&(a_->t==Ft||a_->t==It)&&a_->r<3)?MSTrue:MSFalse; } MSBoolean AplusGraph::verifyData(V v_,::A a_) { MSBoolean r=MSFalse; if (a_!=0&&QA(a_)&&a_->t==Et) { r=MSTrue; ::A as; V sv; ::A *p=(::A *)a_->p; for (int i=0; in&&r==MSTrue; i++) { if (QS(p[i])) { sv=(V) getVFromSym(v_->cx,(S)XS(p[i])); as=(::A)gt(sv); r=verifyTraceSet(as); } else r=MSFalse; } } return r; } void AplusGraph::addSenderNotify(MSEventSender *m_) { INTERNAL_COUPLE(((AplusModel *) m_)); } void AplusGraph::receiveEvent(MSEvent &event_) { if (event_.type() == AplusEvent::symbol()) { if (dbg_tmstk) cout << "Received UpdateEvent in AplusGraph" << endl; AplusEvent *ave = (AplusEvent *) &event_; V v = ((AplusModel *)model())->aplusVar(); ::A index = ave->index(); ::A pick = ave->pick(); I ravel = ave->ravel();; update(v,index, pick, ravel); } if (event_.type() == AplusVerifyEvent::symbol()) { if (dbg_tmstk) cout << "Received VerifyEvent in AplusGraph" << endl; AplusVerifyEvent *ave = (AplusVerifyEvent *) &event_; ave->result(verifyData(ave->aplusVar(), ave->a())); } if (event_.type() == AplusUpdateDataEvent::symbol()) { if (dbg_tmstk) cout << "Received updateDataEvent in AplusGraph" << endl; updateData(); } } void AplusGraph::updateData(void) { AplusModel *pModel=(AplusModel *)model(); if (pModel==0) { return; } V v = pModel->aplusVar(); if (v!=0) { ::A av = pModel->a(); // will re-evaluate the variable if necessary AplusTraceSet *traceSet; int i,j; int numTraceSets=(int)av->n; V *vt=new V[numTraceSets]; ::A *p=(::A *)av->p; MSBoolean found=MSFalse,selectTraceFound=MSFalse; for (i=0; icx,(S)XS(p[i])); (void) gt(vt[i]); // ok to call gt() directly, since vt[i] is not bound to a widget yet } } MSUnsignedLongVector deleteList; for (i = 0; i < traceSetList().count(); i++) { found=MSFalse; traceSet=(AplusTraceSet *) graphTraceSet(i); for (j=0; jmodel())->aplusVar()==vt[j]) { found=MSTrue; if (traceSet->trace(0)==selectTrace()) selectTraceFound=MSTrue; } } if (found==MSFalse) { deleteList << (unsigned long) traceSet; } } // Remove from delete list for (i = 0; i < deleteList.length(); i++) { traceSet = (AplusTraceSet *) deleteList(i); // Removing object association from the V of the traceset AplusModel *pOldModel = (AplusModel*)traceSet->model(); if (pOldModel && pOldModel->aplusVar() && pOldModel->pAVarData()) { pOldModel->pAVarData()->pWidgetView(0); pOldModel->aplusVar()->o = 0; safeDestroy(traceSet); } } for (i=0; imodel())->aplusVar()==vt[i]) break; else traceSet=0; } if (traceSet==0) { traceSet=new AplusTraceSet(this); if (visible()==MSTrue) traceSet->visibilityUnobscured(); AplusModel *apm = new AplusModel(vt[i]); apm->coupleWidgetView(traceSet); traceSet->lastDataCount(traceSet->dataCount()); } } updateLegendStatus(MSTrue); redrawImmediately(); delete [] vt; } } void AplusGraph::insertChild(MSWidget *widget_) { if (editor()!=0&&dataWin()!=0&&legend()!=0) { MSTraceSet *ts=(MSTraceSet *)widget_; traceSetList().add(ts); MSGraph::updateData(); updateLegendStatus(MSTrue); } } void AplusGraph::update(V v_,::A index_,::A,I ravel_) { if(index_==(::A)MP(22)) update(v_,-1,-1,AppendUpdate); else if(!index_) update(v_,-1,-1,ShapeUpdate); else if(ravel_) // ravel update { ::A a=(::A)v_->a; if(a->r==2&&a->n==1) { int n=(int)a->d[1]; int k=(int)index_->p[0]; int j=k/n; update(v_,j,k-n*j,ValueUpdate); } else update(v_,-1,-1,ValueUpdate); } else { ::A r=index_->t==It?index_:index_->n?(::A)*index_->p:aplus_nl; ::A c=index_->t==Et&&index_->n>1?(::A)index_->p[1]:aplus_nl; if(isNull(c)==MSTrue) // c is aplus_nl - all cols are updated { if(isNull(r)==MSTrue) update(v_,-1,-1,ValueUpdate); else { for(int i=0;i<(int)r->n;i++) update(v_,(int)r->p[i],-1,ValueUpdate); } } else if(isNull(r)==MSTrue) // r is aplus_nl - all rows are updated { for(int i=0;i<(int)c->n;i++) update(v_,-1,(int)c->p[i],ValueUpdate); } else { for(int j=0;j<(int)r->n;j++) { for(int i=0;i<(int)c->n;i++) { update(v_,(int)r->p[j],(int)c->p[i],ValueUpdate); } } } } } void AplusGraph::removeChild(MSWidget *widget_) { AplusTraceSet *ts=(AplusTraceSet *)widget_; unsigned before = traceSetList().count(); traceSetList().remove(ts); unsigned after = traceSetList().count(); if (before != after) { ts->deleteTraces(); if (mapped()==MSTrue&&frozen()==MSFalse) updateData(); updateLegendStatus(MSTrue); } } void AplusGraph::printDebugInfo(const char *str_) { V v = (model()!=0)?((AplusModel *)model())->aplusVar():0; if (v) cout<<" "<<(char*)v->cx->s->n<<"."<<(char*)v->s->n<<": "< #include #include AplusHashTable::AplusHashTable(unsigned int size_) : MSHashTable(size_) {} AplusHashTable::~AplusHashTable(void) {} A AplusHashTable::listAllEntries(void) const { unsigned int sz=size(), count=0; unsigned int i ; for (i=0; i0 A entries=gv(Et,count); for (i=0, count=0; ip[count++]=MS(si((char *)entry->value())); entry=entry->next(); } } return entries; } aplus-fsf-4.22/src/AplusGUI/AplusLabel.C0000644000265000001440000001222710772770345013406 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include extern long dbg_tmstk; AplusLabel::AplusLabel(MSWidget *widget_) : MSLabel(widget_) { AplusModel *am=new AplusModel(0); INTERNAL_COUPLE(am); } AplusLabel::~AplusLabel(void) {} int AplusLabel::numRows(void) const { if (_model == 0) return 0; A a = ((AplusModel *)_model)->a(); int type = ((AplusModel *)_model)->a_type(); int rank = ((AplusModel *)_model)->rank(); int n = ((AplusModel *)_model)->numElmts(); if (a!=0) { if (type==Et) return (int)n; else if (type==Ct) return (rank<=1)?1:(int)a->d[0]; } return 0; } int AplusLabel::numColumns(int row_) const { A a = ((AplusModel *)_model)->a(); int type = ((AplusModel *)_model)->a_type(); int rank = ((AplusModel *)_model)->rank(); int n = ((AplusModel *)_model)->numElmts(); I *data = ((AplusModel *)_model)->data(); if (a!=0&&row_r==0)?1:(int)ra->d[0]; } else if (type==Ct) { if (rank==0) return 1; else if (rank==1) return (int)a->d[0]; else return (int)a->d[1]; } } return 0; } int AplusLabel::numColumns(void) const { if (_model == 0) return 0; A a = ((AplusModel *)_model)->a(); int type = ((AplusModel *)_model)->a_type(); int rank = ((AplusModel *)_model)->rank(); int n = ((AplusModel *)_model)->numElmts(); I *data = ((AplusModel *)_model)->data(); if (a!=0) { if (type==Et) { P p; p.i=data; int r=0; for (int i=0;ir==0) r=(1>r)?1:r; else r=(p.a[i]->d[0]>r)?(int)p.a[i]->d[0]:r; } return r; } else if (type==Ct) { if (rank==0) return 1; else if (rank==1) return (int)a->d[0]; else return (int)a->d[1]; } } return 0; } const char *AplusLabel::formatOutput(MSString& str_, int row_) { if (_model == 0) return 0; A a = ((AplusModel *)_model)->a(); int type = ((AplusModel *)_model)->a_type(); int rank = ((AplusModel *)_model)->rank(); int n = ((AplusModel *)_model)->numElmts(); I *data = ((AplusModel *)_model)->data(); if (a!=0&&row_p, len); break; default: break; } } return str_; } void AplusLabel::receiveEvent(MSEvent &event_) { if (event_.type() == AplusEvent::symbol()) { if (dbg_tmstk) cout << "Received UpdateEvent in AplusLabel" << endl; MSLabel::updateData(); } if (event_.type() == AplusVerifyEvent::symbol()) { if (dbg_tmstk) cout << "Received VerifyEvent in AplusLabel" << endl; AplusVerifyEvent *ave = (AplusVerifyEvent *) &event_; ave->result(verifyData(ave->aplusVar(), ave->a())); } } static MSBoolean checkNull(A a_) { return (QA(a_)&&a_->t==Et&&a_->n==0)?MSTrue:MSFalse; } MSBoolean AplusLabel::verifyData(V,A a_) { if (a_!=0&&QA(a_)) { if (a_->t==Et) { P p; p.i=a_->p; for (int i=0;in;i++) { if (checkNull(p.a[i])==MSFalse) { if (!QA(p.a[i])||p.a[i]->r>1||p.a[i]->t!=Ct) return MSFalse; } } return MSTrue; } else if (a_->t==Ct&&a_->r<=2) return MSTrue; } return MSFalse; } void AplusLabel::addSenderNotify(MSEventSender *m_) { INTERNAL_COUPLE(((AplusModel *) m_)); } // drawRow() is overriden in order to support functional foreground // void AplusLabel::drawRow(int row_) { MSLabel::drawRow(row_); } void AplusLabel::drawRow(int row_,int column_,const char *pString_,int len_) { XSetForeground(display(),textGC(),rowForeground(row_)); MSLabel::drawRow(row_,column_,pString_,len_); } unsigned long AplusLabel::rowForeground(int row_) const { unsigned long fg=foreground(); AplusModel *m=(AplusModel *)model(); if (m==0) { return fg; } V v=m->aplusVar(); if (v==0) { return fg; } AColorFunction *colorFunc=AplusModel::getFgFunc(v); if (colorFunc!=0 && row_a; P p; p.i=a->p; switch(a->t) { case Ct: { int len = numColumns(row_); int start = (a->r<2) ? 0 : row_*len; fg=(unsigned long)colorFunc->invoke(v,(char *)MSString(p.c+start,len).string(),row_,0); break; } case Et: { A d=gs(Et); *d->p=ic(p.a[row_]); fg=(unsigned long)colorFunc->invoke(v,d,row_,0); dc(d); break; } default: break; } } return fg; } const MSSymbol& AplusLabel::widgetType(void) const { return symbol(); } const MSSymbol& AplusLabel::symbol(void) { static MSSymbol sym("AplusLabel"); return sym; } aplus-fsf-4.22/src/AplusGUI/AplusLabelOut.C0000644000265000001440000001106610772770345014076 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include AplusLabelOut::AplusLabelOut(void) : MSLabelOut(), _outFunc(0), _v(0), _precision(-1), _format(AplusFormatter::BadFormat), _a(0), _tick(0), _grid(0), _value(0) {} AplusLabelOut::~AplusLabelOut(void) { if (a()!=0) dc(a()); } const char *AplusLabelOut::formatOutput(MSString& buf_, double data_) { if (_outFunc != 0) { A outStr=aplus_nl; if (_outFunc->func()!=0) { if ((outStr=(A)_outFunc->invoke(v(),data_,0,0))!=0) { if (isNull(outStr)==MSFalse && outStr->t==Ct) { buf_ = (char *) outStr->p; } else { buf_ = data_; } } } else { buf_ = data_; } return buf_; } else if (format() != AplusFormatter::BadFormat) { buf_ = AplusGraph::outFmt()->formatOutput(format(), data_, precision(), MSFalse); return buf_; } else { return MSLabelOut::formatOutput(buf_,data_); } } unsigned AplusLabelOut::tickSizeLength(void) const { return (_tick!=0)?_tick->n:0; } unsigned AplusLabelOut::gridWidthLength(void) const { return (_grid!=0)?_grid->n:0; } unsigned AplusLabelOut::tickPositionLength(void) const { return (_value!=0)?_value->n:0; } double AplusLabelOut::tickSize(unsigned index_) const { P p; int i; if (_tick!=0) { i=(int)(index_<_tick->n?index_:index_%_tick->n); p.i=_tick->p; } return _tick!=0?((double)p.f[i]):1.; } unsigned AplusLabelOut::gridWidth(unsigned index_) const { P p; int i; if (_grid!=0) { i=(int)(index_<_grid->n?index_:index_%_grid->n); p.i=_grid->p; } return _grid!=0?p.i[i]:0; } double AplusLabelOut::tickPosition(unsigned index_) const { P p; if (_value!=0&&index_<=_value->n) p.i=_value->p; return _value!=0?(_value->t==Ft?(double)p.f[index_]:(double)p.i[index_]):0; } /////////////////////////////////////////////////////////////////////////////// AplusFuncLabelOut::AplusFuncLabelOut(AOutFunction *outFunc_, V v_, AplusLabelOut *alo_) : AplusLabelOut() { outFunc(outFunc_); v(v_); if (alo_!=0 && alo_->a()!=0) { a((A)ic(alo_->a())); tick(alo_->tick()); grid(alo_->grid()); value(alo_->value()); } } AplusFuncLabelOut::~AplusFuncLabelOut(void) {} /////////////////////////////////////////////////////////////////////////////// AplusFormatLabelOut::AplusFormatLabelOut(AplusFormatter::OutputFormat format_, int precision_, AplusLabelOut *alo_) : AplusLabelOut() { format(format_); precision(precision_); if (alo_!=0 && alo_->a()!=0) { a((A)ic(alo_->a())); tick(alo_->tick()); grid(alo_->grid()); value(alo_->value()); } } AplusFormatLabelOut::~AplusFormatLabelOut(void) {} /////////////////////////////////////////////////////////////////////////////// AplusFuncLabel::AplusFuncLabel(A a_, AplusLabelOut *alo_) : AplusLabelOut() { if (alo_!=0 && alo_->outFunc()!=0) { outFunc(alo_->outFunc()); v(alo_->v()); } if (alo_!=0 && alo_->format()!=AplusFormatter::BadFormat) { format(alo_->format()); precision(alo_->precision()); } if (verify(a_)==MSTrue) { a((A) ic(a_)); } else { MSStringVector emptyStringVector; a((A)0); tick((A)0); grid((A)0); value((A)0); labels(emptyStringVector); } } AplusFuncLabel::~AplusFuncLabel(void) {} MSBoolean AplusFuncLabel::verify(A a_) { MSBoolean ticks, r=MSFalse; int i,j; if (a_!=0&&a_->n!=0&&QA(a_)&&(a_->t==Ft||a_->t==It||a_->t==Et)) { P p; p.i=a_->p; if (a_->t==Et&&QA(p.a[0])&&(p.a[0]->t==Ft||p.a[0]->t==It)) { r=MSTrue; value(p.a[0]); for (i=1; in; i++) { if (isNull(p.a[i])==MSFalse) { switch(p.a[i]->t) { case Ct: case Et: label((A)p.a[i]); break; case Ft: ticks=MSFalse; P pt; pt.i=p.a[i]->p; for (j=0; jn; j++) { if (pt.f[j]<1) ticks=MSTrue; } if (ticks==MSTrue) tick((A)p.a[i]); else grid((A)p.a[i]); break; case It: grid((A)p.a[i]); break; default: break; } } } } else if (a_->t==Ft||a_->t==It) { value(a_); r=MSTrue; } } return r; } void AplusFuncLabel::label(A a_) {labels(AplusConvert::asMSStringVector(a_));} aplus-fsf-4.22/src/AplusGUI/AplusLayout.C0000644000265000001440000000271310772770345013643 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include extern long dbg_tmstk; AplusLayout::AplusLayout(MSWidget *xwin_) : MSLayout(xwin_) { AplusModel *am=new AplusModel(0); INTERNAL_COUPLE(am); } AplusLayout::~AplusLayout(void) {} void AplusLayout::addSenderNotify(MSEventSender *m_) { INTERNAL_COUPLE(((AplusModel *) m_)); } void AplusLayout::receiveEvent(MSEvent &event_) { if (event_.type()==MSIndexedEvent::symbol()) { MSIndexedEvent &ev=(MSIndexedEvent&)event_; update(ev.index()); } else if (event_.type()==MSNullEvent::symbol()) update(MSIndexVector::nullVector()); else if (event_.type() == AplusEvent::symbol()) { if (dbg_tmstk) cout << "Received UpdateEvent in AplusLayout" << endl; redraw(); } if (event_.type() == AplusVerifyEvent::symbol()) { if (dbg_tmstk) cout << "Received VerifyEvent in AplusLayout" << endl; AplusVerifyEvent *ave = (AplusVerifyEvent *) &event_; ave->result(verifyData(ave->aplusVar(), ave->a())); } } const MSSymbol& AplusLayout::widgetType(void) const { return symbol(); } const MSSymbol& AplusLayout::symbol(void) { static MSSymbol sym("AplusLayout"); return sym; } aplus-fsf-4.22/src/AplusGUI/AplusManager.C0000644000265000001440000000237110772770345013740 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include extern long dbg_tmstk; AplusManager::AplusManager(MSWidget *owner_) : MSManager(owner_) { AplusModel *am=new AplusModel(0); INTERNAL_COUPLE(am); } AplusManager::~AplusManager(void) {} void AplusManager::addSenderNotify(MSEventSender *m_) { INTERNAL_COUPLE(((AplusModel *) m_)); } void AplusManager::receiveEvent(MSEvent &event_) { if (event_.type() == AplusEvent::symbol()) { if (dbg_tmstk) cout << "Received UpdateEvent in AplusManager" << endl; redraw(); } if (event_.type() == AplusVerifyEvent::symbol()) { if (dbg_tmstk) cout << "Received VerifyEvent in AplusManager" << endl; AplusVerifyEvent *ave = (AplusVerifyEvent *) &event_; ave->result(verifyData(ave->aplusVar(), ave->a())); } } const MSSymbol& AplusManager::widgetType(void) const { return symbol(); } const MSSymbol& AplusManager::symbol(void) { static MSSymbol sym("AplusManager"); return sym; } aplus-fsf-4.22/src/AplusGUI/AplusMatrix.C0000644000265000001440000003762110772770345013640 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include static const int AplusMatrixDefaultColumnSpacing = 9; AplusMatrix::AplusMatrix(MSWidget *w_) : AplusArray(w_) { unsigned long icolor = AVariableData::defaultMatrixColor(); _numHeadings=1; _labelLength=AplusMatrixDefaultColumnSpacing; _spaceVector=aplus_nl; _rowIndex=(A)gv(It,0); _colIndex=(A)gv(It,0); _cornerIndex=MSFalse; _rowIndexBg = icolor; _colIndexBg = icolor; _cornerIndexBg = icolor; _rowIndexXGC=0; _colIndexXGC=0; _cornerIndexXGC=0; } AplusMatrix::~AplusMatrix(void) { if (rowIndexXGC()!=0) delete _rowIndexXGC; if (colIndexXGC()!=0) delete _colIndexXGC; if (cornerIndexXGC()!=0) delete _cornerIndexXGC; dc(spaceVector()); dc(rowIndex()); dc(colIndex()); } MSBoolean AplusMatrix::verifyData(V v_,A a_) { return (0!=v_&&0!=a_&&QA(a_)&&(Et==a_->t||((a_->t==Ft||a_->t==It)&&a_->r==2)))?MSTrue:MSFalse; } void AplusMatrix::spaceFunc(AFunc func_,AClientData *arg_) { spaceFunc()->func(func_); spaceFunc()->arg(arg_); updateColSpace(); redrawImmediately(); } void AplusMatrix::colSpace(A a_) { dc(spaceVector()); _spaceVector=aplus_nl; if (a_!=0&&a_->t==It&&a_->r<=1) _spaceVector=(A)ic(a_); if (isNull(spaceVector())==MSFalse) _labelLength=(int)spaceVector()->p[0]; else { V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; if (v) { AVariableData *vd = ::pAVarDataFromV(v); if (vd!=0) _labelLength=vd->colWidth(); else _labelLength=AplusMatrixDefaultColumnSpacing; } } sizeUpdate(); } void AplusMatrix::numHeadings(int n_) { if (n_!=numHeadings()) { _numHeadings=n_;placement(); redrawImmediately(); } } // We have to override redrawImmediately() to ensure that the corner label gets drawn // every time the window is redrawn. // void AplusMatrix::redrawImmediately(void) { MSArrayView::redrawImmediately(); drawLabel(panner()->window()); } void AplusMatrix::drawLabel(Window xid_) { if (mapped()==MSTrue&&frozen()==MSFalse) { int offset=panner()->highlightThickness()+panner()->shadowThickness(); int y=offset; int x=offset; int nc=numColumns(); MSRect rect; A str=rowLabel(-1); int cw=labelWidth(); int w=panner()->width()-(offset<<1); XFillRectangle(display(),xid_,(cornerIndex()==MSTrue)?cornerIndexGC():backgroundShadowGC(), x,y,(cw>w)?w:cw-columnSpacing(),headingsHeight()-rowSpacing()); if (isNull(str)==MSFalse && ((str->t==Ct&&str->r<=2)||(str->t==Et))) { unsigned long fg=labelColor(-1); Font fid=labelFont(-1); int len=labelLength(); rect.configuration(x+columnSpacing(),y+rowSpacing(), (cw>w)?w:cw,headingsHeight()-(rowSpacing()<<1)); drawFieldHeading(xid_,str,fg,fid,rect); } if (str!=0) dc(str); } } void AplusMatrix::drawLabels(Window xid_,int rs_,int re_) { if (mapped()==MSTrue&&frozen()==MSFalse&&inRowRange(rs_)==MSTrue&&inRowRange(re_)==MSTrue) { int po=panner()->highlightThickness()+panner()->shadowThickness(); int x=po; int y=computeYCoord(rs_); int iy=y; int nr=numRows(); int w=labelWidth(),h; int rthickness=(rowSpacing()>>1); int cthickness=(columnSpacing()>>1); int n=0; int count=re_-rs_+1; XRectangle *top=new XRectangle[count]; XRectangle *bottom=new XRectangle[count]; A str; int len=labelLength(); w=(w<=panner()->width()-(po<<1))?w:panner()->width()-(po<<1); XRectangle clipRect[1]; clipRect[0].x=0; clipRect[0].y=0; clipRect[0].width=w; clipRect[0].height=rowHeight(); for (int i=rs_;i<=re_&&ip,(int)str->n); y+=rowHeight(); dc(str); } clipRect[0].width=panner()->width()-(po<<1); clipRect[0].height=panner()->height()-(po<<1); XSetClipRectangles(display(),textGC(),po,po,&clipRect[0],1,Unsorted); if (n>0) { XBFillRectangles(display(),xid_,bottomShadowGC(),top,n); XFillRectangles(display(),xid_,topShadowGC(),bottom,n); } if (y>iy&&cthickness>0) { x+=labelWidth(); if (x>panner()->width()-po) x=panner()->width()-po; x-=columnSpacing(); XBFillRectangle(display(),xid_,bottomShadowGC(), x,po,columnSpacing(),panner()->height()-(po<<1)); } delete [] top; delete [] bottom; } } void AplusMatrix::drawHeadings(Window xid_,int cs_,int ce_) { if (mapped()==MSTrue&&frozen()==MSFalse&&inColRange(cs_)==MSTrue&&inColRange(ce_)==MSTrue) { drawFieldHeadings(xid_,cs_,ce_); } } void AplusMatrix::drawFieldHeadings(Window xid_,int cs_,int ce_) { V v = (model()!=0)?((AplusModel *)model())->aplusVar():0; A a = (model()!=0)?((AplusModel *)model())->a():aplus_nl; if (v!=0 && isNull(a)==MSFalse) { int offset=panner()->highlightThickness()+panner()->shadowThickness(); int y=offset; int x=computeXCoord(cs_) - (columnSpacing()<<1); int len=0,cw=0; int j,w=0; int nc=numColumns(); MSRect rect; unsigned long fg; Font fid; A str; for (j=cs_;j<=ce_&&jwidth()-(offset<<1); if ((str->t==Ct&&str->r<=2)||(str->t==Et)) { fg=headingColor(j); fid=headingFont(j); len=columnLength(j); XFillRectangle(display(),xid_, (isColIndexed(j)==MSTrue)?colIndexGC():backgroundShadowGC(), x,y,(cw>w)?w:cw,headingsHeight()-rowSpacing()); if(isNull(str)==MSFalse) { rect.configuration(x,y+rowSpacing(), (cw>w)?w:cw,headingsHeight()-2*rowSpacing()); drawFieldHeading(xid_,str,fg,fid,rect); } } x+=cw; if (str!=0) dc(str); } if (w>0) XBFillRectangle(display(),xid_,bottomShadowGC(), offset,offset+headingsHeight()-rowSpacing(),w,rowSpacing()); } } A AplusMatrix::rowLabel(int row_) { static MSString buf; A outStr=aplus_nl; V v = (model()!=0)?((AplusModel *)model())->aplusVar():0; if (v!=0) { AOutFunction *titleFunc=AplusModel::getTitleFunc(v); if (titleFunc!=0) { outStr=(A)titleFunc->invoke(v,(A)aplus_nl,row_,-1); outStr=(outStr->t==Ct)?outStr:aplus_nl; } else if (row_>=0) { buf = MSInt(row_).asString(); outStr=gsv(0,(char *)(const char *) buf); } } return outStr; } Font AplusMatrix::labelFont(int row_) { V v = (model()!=0)?((AplusModel *)model())->aplusVar():0; if (v!=0) { AFontFunction *titleFontFunc=AplusModel::getTitleFontFunc(v); if (titleFontFunc!=0) return titleFontFunc->invoke(v,(A)aplus_nl,row_,-1); } return font(); } unsigned long AplusMatrix::labelColor(int row_) { V v = (model()!=0)?((AplusModel *)model())->aplusVar():0; if (v!=0) { AColorFunction *titleColorFunc=AplusModel::getTitleColorFunc(v); if (titleColorFunc!=0) return titleColorFunc->invoke(v,(A)aplus_nl,row_,-1); } return foreground(); } A AplusMatrix::heading(int col_) { V v = (model()!=0)?((AplusModel *)model())->aplusVar():0; A outStr=aplus_nl; if (v!=0) { AOutFunction *titleFunc=AplusModel::getTitleFunc(v); if (titleFunc!=0) outStr=(A)titleFunc->invoke(v,(A)aplus_nl,-1,col_); else { int ci=(col_!=0)?(col_%26):0; int l=(col_/26)+1; char *cp=new char[l+1]; int i ; for (i=0;iaplusVar():0; if (v!=0) { AFontFunction *titleFontFunc=AplusModel::getTitleFontFunc(v); if (titleFontFunc!=0) return titleFontFunc->invoke(v,(A)aplus_nl,-1,col_); } return font(); } unsigned long AplusMatrix::headingColor(int col_) { V v = (model()!=0)?((AplusModel *)model())->aplusVar():0; if (v!=0) { AColorFunction *titleColorFunc=AplusModel::getTitleColorFunc(v); if (titleColorFunc!=0) return titleColorFunc->invoke(v,(A)aplus_nl,-1,col_); } return foreground(); } void AplusMatrix::drawFieldHeading(Window xid_,A str_,unsigned long fg_, Font fid_, MSRect& rect_) { P p; p.i=str_->p; char *cp; int nc=0; int xdelta,ydelta; int y,tw,cw=rect_.width(); XSetForeground(display(),textGC(),fg_); XSetBackground(display(),textGC(),background()); XSetFont(display(),textGC(),fid_); if (str_->t==Ct) { if (str_->r<=1) { nc=(str_->r==0)?1:(int)str_->n; if (nc>0) { tw=XTextWidth(textFontStruct(),p.c,nc); ydelta=rect_.height()-textHeight(); ydelta=(ydelta>0)?ydelta>>1:0; if (tw>cw) { nc=computeMaxTextLength((XFontStruct*)textFontStruct(),p.c,cw,nc); xdelta=0; } else xdelta=(cw>tw)?(cw-tw)>>1:0; XDrawString(display(),xid_,textGC(),textFontStruct(), rect_.x()+xdelta,rect_.y()+ydelta+textFontStruct()->max_bounds.ascent,p.c,nc); } } else { ydelta=rect_.height()-numHeadings()*textHeight(); ydelta=(ydelta>0)?ydelta>>1:0; y=rect_.y()+ydelta; for(int i=0;id[0]&&id[1]; cp=p.c+(i*nc); tw=XTextWidth(textFontStruct(),cp,nc); if (tw>cw) { nc=computeMaxTextLength((XFontStruct*)textFontStruct(),cp,cw,nc); xdelta=0; } else xdelta=(cw>tw)?(cw-tw)>>1:0; XDrawString(display(),xid_,textGC(),textFontStruct(), rect_.x()+xdelta,y+textFontStruct()->max_bounds.ascent,cp,nc); y+=textHeight(); } } } else if (str_->t==Et) { ydelta=rect_.height()-numHeadings()*textHeight(); ydelta=(ydelta>0)?ydelta>>1:0; y=rect_.y()+ydelta; for (int i=0;in&&ip; if (p.a[i]->r==0) { nc=1; tw=XTextWidth(textFontStruct(),cp,nc); } else if (p.a[i]->r==1) { nc=(int)p.a[i]->n; tw=XTextWidth(textFontStruct(),cp,nc); } if (nc>0) { if (tw>cw) { nc=computeMaxTextLength((XFontStruct*)textFontStruct(),cp,cw,nc); xdelta=0; } else xdelta=(cw>tw)?(cw-tw)>>1:0; XDrawString(display(),xid_,textGC(),textFontStruct(), rect_.x()+xdelta,y+textFontStruct()->max_bounds.ascent,cp,nc); } y+=textHeight(); } } } unsigned AplusMatrix::columnLength(unsigned col_) { V v = (model()!=0)?((AplusModel *)model())->aplusVar():0; if (v!=0&&col_>=0) { if (isNull(spaceVector())==MSFalse) { if (col_+1n) return (int)spaceVector()->p[col_+1]; else return labelLength(); } } return AplusMatrixDefaultColumnSpacing; } MSBoolean AplusMatrix::isRowIndexed(int row_) { A sv=rowIndex(); for (int i=0;in;i++) { if (sv->p[i]==row_) return MSTrue; } return MSFalse; } MSBoolean AplusMatrix::isColIndexed(int col_) { A sv=colIndex(); for (int i=0;in;i++) { if (sv->p[i]==col_) return MSTrue; } return MSFalse; } void AplusMatrix::rowIndex(A sv_) { if ((sv_->t==It&&sv_->r<=1)||(sv_->t==Et&&sv_->n==0)) { A sv=rowIndex(); int i,r; _rowIndex=(A)ic(sv_); for (i=0;in;i++) { r=(int)sv->p[i]; if (isRowIndexed(r)==MSFalse) drawLabels(panner()->window(),r,r); } dc(sv); sv=rowIndex(); if (rowIndexXGC()==0&&sv->n>0) createRowIndexXGC(); for (i=0;in;i++) drawLabels(panner()->window(),(int)sv->p[i],(int)sv->p[i]); } } void AplusMatrix::colIndex(A sv_) { if ((sv_->t==It&&sv_->r<=1)||(sv_->t==Et&&sv_->n==0)) { A sv=colIndex(); int i,c; _colIndex=(A)ic(sv_); for (i=0;in;i++) { c=(int)sv->p[i]; if (isColIndexed(c)==MSFalse) drawHeadings(panner()->window(),c,c); } dc(sv); sv=colIndex(); if (colIndexXGC()==0&&sv->n>0) createColIndexXGC(); for (i=0;in;i++) drawHeadings(panner()->window(),(int)sv->p[i],(int)sv->p[i]); } } void AplusMatrix::cornerIndex(MSBoolean b_) { if (cornerIndex()!=b_) { _cornerIndex=b_; if (cornerIndexXGC()==0) createCornerIndexXGC(); drawLabel(panner()->window()); } } void AplusMatrix::rowIndexBg(unsigned long bg_) { if (rowIndexBg()!=bg_) { _rowIndexBg=bg_; if (rowIndexXGC()==0) createRowIndexXGC(); else rowIndexXGC()->foreground(rowIndexBg()); A sv=rowIndex(); for (int i=0;in;i++) drawLabels(panner()->window(),(int)sv->p[i],(int)sv->p[i]); } } void AplusMatrix::colIndexBg(unsigned long bg_) { if (colIndexBg()!=bg_) { _colIndexBg=bg_; if (colIndexXGC()==0) createColIndexXGC(); else colIndexXGC()->foreground(colIndexBg()); A sv=colIndex(); for (int i=0;in;i++) drawHeadings(panner()->window(),(int)sv->p[i],(int)sv->p[i]); } } void AplusMatrix::cornerIndexBg(unsigned long bg_) { if (cornerIndexBg()!=bg_) { _cornerIndexBg=bg_; if (cornerIndexXGC()==0) createCornerIndexXGC(); else cornerIndexXGC()->foreground(cornerIndexBg()); drawLabel(panner()->window()); } } void AplusMatrix::createRowIndexXGC(void) { if (rowIndexXGC()==0) { XGCValues values; values.foreground=rowIndexBg(); _rowIndexXGC=new MSGC(server(),MSTrue,&values,GCForeground); } } void AplusMatrix::createColIndexXGC(void) { if (colIndexXGC()==0) { XGCValues values; values.foreground=colIndexBg(); _colIndexXGC=new MSGC(server(),MSTrue,&values,GCForeground); } } void AplusMatrix::createCornerIndexXGC(void) { if (cornerIndexXGC()==0) { XGCValues values; values.foreground=cornerIndexBg(); _cornerIndexXGC=new MSGC(server(),MSTrue,&values,GCForeground); } } void AplusMatrix::shapeUpdate(void) { updateColSpace(); AplusArray::shapeUpdate(); } void AplusMatrix::firstMapNotify(void) { updateColSpace(); AplusArray::firstMapNotify(); } void AplusMatrix::updateColSpace(void) { A newColSpace; V v = (model()!=0)?((AplusModel *)model())->aplusVar():0; A a = (model()!=0)?((AplusModel *)model())->a():aplus_nl; if (spaceFunc()->func()!=0) { freeze(); newColSpace=spaceFunc()->invoke(v,a); colSpace(newColSpace); dc(newColSpace); unfreeze(); } } void AplusMatrix::updateTitle(void) { AplusArray::updateTitle(); if (mapped()==MSTrue&&frozen()==MSFalse) { drawLabel(panner()->window()); drawHeadings(panner()->window(),firstColumn(),lastColumn()); drawLabels(panner()->window(),firstRow(),lastRow()); } } void AplusMatrix::sizeUpdate(void) { if (mapped()==MSTrue) { adjustNumVisible(); redrawImmediately(); } } const MSSymbol& AplusMatrix::widgetType(void) const { return symbol(); } const MSSymbol& AplusMatrix::symbol(void) { static MSSymbol sym("AplusMatrix"); return sym; } aplus-fsf-4.22/src/AplusGUI/AplusMenu.C0000644000265000001440000002072710772770345013277 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include extern long dbg_tmstk; /////////////////////////////////////////////////////////////////////////////// static const int AplusMenuItemDefaultMarginHeight = 0; AplusMenu::AplusMenu(MSWidget *widget_, AplusMenu::Orientation orientation_) : MSMenuBar(widget_) { orientation(orientation_); font(widget_->font()); AplusModel *am = new AplusModel(0); INTERNAL_COUPLE(am); } AplusMenu::~AplusMenu(void) {} MSBoolean AplusMenu::verifyData(V,A a_) { return isSlotFiller(a_); } void AplusMenu::addSenderNotify(MSEventSender *m_) { INTERNAL_COUPLE(((AplusModel*)m_)); updateData(); } void AplusMenu::receiveEvent(MSEvent &event_) { if (event_.type() == AplusEvent::symbol()) { if (dbg_tmstk) cout << "Received UpdateEvent in AplusMenu" << endl; AplusEvent *ave = (AplusEvent *) &event_; V v = ((AplusModel *)model())->aplusVar(); A index = ave->index(); A pick = ave->pick(); I ravel = ave->ravel();; update(v,index, pick, ravel); } if (event_.type() == AplusVerifyEvent::symbol()) { if (dbg_tmstk) cout << "Received VerifyEvent in AplusMenu" << endl; AplusVerifyEvent *ave = (AplusVerifyEvent *) &event_; ave->result(verifyData(ave->aplusVar(), ave->a())); } } void AplusMenu::updateData(void) { V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; if (v!=0) { P p; p.i=((AplusModel*)model())->data(); A attr=p.a[0]; A val=p.a[1]; removeAllItems(); freeze(); buildMenu(attr,val); unfreeze(); computeSize(); redraw(); } } void AplusMenu::buildMenu(A attr_, A val_) { if (attr_!=0&&val_!=0) { MSMenuBarItem *mi; MSBoolean cascade; A value; A sym; S s; S *syms=new S[1]; int itemCount = (int)attr_->n; for (int i=0;ip[i]; // used as the pick value=(A)val_->p[i]; s=XS(sym); cascade=isSlotFiller(value); mi=newMenuBarItem((char*)s->n); if (cascade==MSTrue) { syms[0]=s; buildPullDown(mi, value,syms,1); } } delete [] syms; } } MSMenuBarItem *AplusMenu::newMenuBarItem(const char *title_) { MSMenuBarItem *pItem = new MSMenuBarItem(this,title_); pItem->font(font()); pItem->marginHeight(AplusMenuItemDefaultMarginHeight); return pItem; } void AplusMenu::buildPullDown(MSMenuBarItem *menuHead_, A data_, S *syms_, int numSyms_) { if (isSlotFiller(data_)==MSTrue) { MSPulldownMenu *pd = new MSPulldownMenu(menuHead_); pd->font(menuHead_->font()); buildCascades(pd, data_, syms_, numSyms_); } } void AplusMenu::buildCascadePullDown(MSCascadeMenuItem *menuHead_,A data_, S *syms_,int numSyms_) { if (isSlotFiller(data_)==MSTrue) { MSCascadeMenu *pd = new MSCascadeMenu(menuHead_); pd->font(menuHead_->font()); buildCascades(pd, data_, syms_, numSyms_); } } void AplusMenu::buildCascades(MSMenu *menuHead_,A data_,S *syms_,int numSyms_) { if (isSlotFiller(data_)==MSTrue) { MSCascadeMenuItem *mci; MSMenuItem *mi; MSBoolean cascade; S s; P p; p.i=data_->p; A attr=p.a[0]; A val=p.a[1]; A sym; A value; S *syms=new S[numSyms_+1]; int i; for(i=0;in; for (i=0;ip[i]; // used as the pick; value=(A)val->p[i]; s=XS(sym); cascade=isSlotFiller(value); if (cascade==MSTrue) { mi=mci=new MSCascadeMenuItem(menuHead_, (char *)s->n); syms[numSyms_]=s; buildCascadePullDown(mci, value, syms, numSyms_+1); } else mi=new MSMenuItem(menuHead_, (char *)s->n); mi->marginHeight(AplusMenuItemDefaultMarginHeight); } delete [] syms; } } void AplusMenu::update(V,A,A,I) { removeAllItems(); updateData(); } void AplusMenu::formSymbolVector(MSStringVector &sv_) { MSMenu *m = selectedMenu(); while(m!=this) { MSMenuItem *sel = m->activeMenuItem(); if (sel!=0) { sv_.appendSingle(sel->label()); } m = sel->menu()->parentMenuItem()->menu(); } sv_.appendSingle(activeMenuItem()->label()); sv_.reverse(); } extern "C" A ep_gp(A,A); extern I dbg_tscb; void AplusMenu::activate(void) { extern int safeAset(V,A,A,A); extern void setBusyState(MSBoolean); releaseGrab(); V v = (model()!=0)?((AplusModel *)model())->aplusVar():0; if(v) { MSStringVector sv; formSymbolVector(sv); if (sv.length()>0) { A pick = gv(Et, sv.length()); P ppick; ppick.i=pick->p; // Form Pick; for(int k=0; k < sv.length(); k++) { const char *str = sv(k); ppick.a[k] = (A) MS(si((char *)str)); } // Form New Value; A val=ep_gp(pick,(A)v->a); if(0==val) val=aplus_nl; setBusyState(MSTrue); if(Sf&&v->f) { A res; if(dbg_tscb)cbtrc(v,0); v->z=2; if(AScbTraceHook::function()) { AScbTraceHook::run((A)v->f,v->c,(I)val,0,(I)pick,v); } res=af4((A)v->f,v->c,(I)val,0,(I)pick,v); v->z=1; if(0==res)showError(qs); dc(res); } ((AplusModel*)model())->doneCB(v, val, 0, pick); dc(val);dc(pick); setBusyState(MSFalse); } } MSMenuBar::activate(); } void AplusMenu::mnemonics(A a_) { if (verifyMnemonic(this, a_) == MSTrue) { setMnemonic(this, a_); } } A AplusMenu::mnemonics(void) { return getMnemonic(this); } A AplusMenu::getMnemonic(MSMenu *m_) { int childcount = m_->children().length(); A st=gv(Et,2); A attr=(childcount>0)?gv(Et,childcount):aplus_nl; A val=(childcount>0)?gv(Et,childcount):aplus_nl; char str[2]; str[1]='\0'; MSMenuItem *item; for(int i = 0; i < childcount; i++) { item = (MSMenuItem *) m_->children()(i); str[0] = item->mnemonic(); if (str[0]!=0) attr->p[i] = MS(si(str)); else attr->p[i] = (unsigned long) aplus_nl; if (item->cascade()) { val->p[i]= (unsigned long) getMnemonic((MSMenu *)item->children()(0)); } else val->p[i]=(unsigned long) aplus_nl; } st->p[0] = (unsigned long) attr; st->p[1] = (unsigned long) val; return st; } void AplusMenu::setMnemonic(MSMenu *m_, A a_) { int childcount = m_->children().length(); if (isNull(a_)==MSTrue) { for (int i=0; ichildren()(i); item->mnemonic('\0'); if (item->cascade()) { setMnemonic((MSMenu *)item->children()(0), aplus_nl); } } } else { P p; p.i=a_->p; A attr=p.a[0]; A val=p.a[1]; MSMenuItem *item; for(int i = 0; i < childcount; i++) { item = (MSMenuItem *) m_->children()(i); if (isNull(attr)==MSTrue) { item->mnemonic('\0'); } else if (!QS(attr)&&(attr->t==Et&&attr->n>0&&QS(*attr->p))) { item->mnemonic(((char *) XS(attr->p[i])->n)[0]); } else if (attr->t == Ct) { char *c = (char *) attr->p[0]; item->mnemonic(c[0]); } if (item->cascade()) { setMnemonic((MSMenu *)item->children()(0), (A)val->p[i]); } } } redraw(); } MSBoolean AplusMenu::verifyMnemonic(MSMenu *m_, A a_) { if (isNull(a_)==MSTrue) // null is a valid value for mnemonics { return MSTrue; } int childcount = m_->children().length(); if (a_->n==2 && a_->t==Et) { P p; p.i=a_->p; A attr=p.a[0]; A val=p.a[1]; if (attr->n!=childcount) { showError("Mnemonic error"); return MSFalse; } MSMenuItem *item; for(int i = 0; i < childcount; i++) { item = (MSMenuItem *) m_->children()(i); if (item->cascade()) { assert(item->children().length()==1); return verifyMnemonic((MSMenu *)item->children()(0), (A)val->p[i]); } } return MSTrue; } else showError("Mnemonic type error"); return MSFalse; } const MSSymbol& AplusMenu::widgetType(void) const { return symbol(); } const MSSymbol& AplusMenu::symbol(void) { static MSSymbol sym("AplusMenu"); return sym; } aplus-fsf-4.22/src/AplusGUI/AplusModel.C0000644000265000001440000002045410772770345013430 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include extern long dbg_tkerr; extern long dbg_tmstk; // private default constructor to make sure that AplusModel is always constructed // with an explicit argument AplusModel::AplusModel() {} AplusModel::AplusModel(V var_) { _aplusVar = var_; // the following line creates a problem for table columns and graph trace sets; // see todo.txt for details // // if (_aplusVar!=0) _aplusVar->o=0; _sflags = aplus_nl; } AplusModel::~AplusModel( void ) { if (aplusVar()!=0) { unbindWidgetView(); aplusVar(0); } dc(_sflags); } MSString AplusModel::asString(void) const { return MSString(); } MSString AplusModel::asDebugInfo(void) const { return MSString(); } MSString AplusModel::asMSF(void) const { return MSString(); } MSString AplusModel::className(void) const { return MSString("AplusModel"); } const MSSymbol& AplusModel::type(void) const { return symbol(); } MSModel *AplusModel::clone(void) const { return new AplusModel(aplusVar()); } MSModel *AplusModel::create(void) const { return new AplusModel(); } void AplusModel::assign(const MSModel& aModel_) { aplusVar(((AplusModel&)aModel_).aplusVar()); } long AplusModel::compare(const MSModel&) const { if (dbg_tmstk) cout << "Warning: AplusModel::compare called" << endl; return 1; } MSError::ErrorStatus AplusModel::set(const char *) { if (dbg_tmstk) cout << "Warning: AplusModel::set called" << endl; return MSError::MSSuccess; } MSError::ErrorStatus AplusModel::setFromMSF(const char *) { if (dbg_tmstk) cout << "Warning: AplusModel::setFromMSF called" << endl; return MSError::MSSuccess; } const MSSymbol& AplusModel::symbol(void) { static MSSymbol sym("AplusModel"); return sym; } AplusModel& AplusModel::operator=(const AplusModel& aModel_) { if (dbg_tmstk) cout << "WARNING: AplusModel::operator= called" << endl; return *this; } void AplusModel::bindWidgetView(MSWidgetView *pWidgetView_) { if (_aplusVar!=0) { if (pAVarData()==0) { _aplusVar->attr = new AVariableData; } pAVarData()->pWidgetView(pWidgetView_); _aplusVar->o=1; aplusVarList().append((unsigned long)_aplusVar); } } void AplusModel::unbindWidgetView(void) { if (_aplusVar!=0) { if (dbg_tmstk) cout << "Removing Object Association" << endl; _aplusVar->o=0; AVariableData *pVarData = pAVarData(); if (pVarData!=0) { pVarData->pWidgetView(0); } MSUnsignedLongVector &varList = aplusVarList(); varList.removeAt(varList.indexOf((unsigned long)_aplusVar)); } } MSBoolean AplusModel::coupleWidgetView(MSWidgetView *pWidgetView_) { AplusModel *pOldModel = (AplusModel *)pWidgetView_->model(); V oldVar = (pOldModel==0) ? 0 : pOldModel->aplusVar(); if (_aplusVar==0 || _aplusVar->a==0) { if (dbg_tkerr) showError("Null V or A in AplusModel::coupleWidgetView"); return MSFalse; } if (evaluate()==MSFalse) { if (dbg_tkerr) showError("Error during dependency evaluation in AplusModel::coupleWidgetView"); return MSFalse; } // Verify the data to see if it is bindable AplusVerifyEvent ave(_aplusVar,a()); ((MSEventReceiver *)pWidgetView_)->receiveEvent(ave); if (ave.result()==MSTrue) { if (_aplusVar!=oldVar) { if (pOldModel!=0) { pOldModel->unbindWidgetView(); } bindWidgetView(pWidgetView_); return addReceiver(pWidgetView_); } else { AplusUpdateDataEvent aude; ((MSEventReceiver *)pWidgetView_)->receiveEvent(aude); return MSTrue; } } else { if (dbg_tmstk) cout << "Verify failed in AplusModel::setData"<< endl; // the following line may possibly be moved to constructor; look for the // comment in constructor // if (_aplusVar!=0) _aplusVar->o=0; aplusVar(oldVar); return MSFalse; } } MSUnsignedLongVector & AplusModel::aplusVarList(void) { static MSUnsignedLongVector list; return list; } int AplusModel::numRows(void) const { int t = a_type(); int r = rank(); if (t==Ct && r==1) return 1; else if (r==1 || r==2) return d0(); else if (t==Et) return numElmts(); else if (r==0) return 1; else return d0(); } int AplusModel::numCols( void ) const { int t = a_type(); int r = rank(); if (t==Ct || r==0) return 1; else if (r==2) return d1(); else if (t==Et && isNull(a())==MSTrue) return 0; else if (t==Et) return 1; else if (r==1) return 1; else return d1(); } int AplusModel::charLength( void ) const { if (a_type()!=Ct) return 0; else if (_aplusVar==0) return 0; else if (rank()==0) return numElmts(); else if (rank()==1) return d0(); else return d1(); } void AplusModel::doneCB(V v_,A d_,A i_,A p_) { AFunction *doneFunc=getDoneFunc(v_); if (doneFunc!=0) { doneFunc->execute(v_,(d_!=0)?(A)ic(d_):d_, (i_!=0)?(A)ic(i_):i_,(p_!=0)?(A)ic(p_):p_); if (d_!=0) dc(d_); if (i_!=0) dc(i_); if (p_!=0) dc(p_); } } AInFunction *AplusModel::getInFunc(V v_) { if (v_!=0) { AVariableData *pVarData = ::pAVarDataFromV(v_); if (pVarData!=0 && pVarData->inFunc()->func()!=0) return pVarData->inFunc(); } return 0; } ACharStrFunction *AplusModel::getOutFunc(V v_) { if (v_!=0) { AVariableData *pVarData = ::pAVarDataFromV(v_); if (pVarData!=0 && pVarData->outFunc()->func()!=0) { return pVarData->outFunc(); } } return 0; } AOutFunction *AplusModel::getTitleFunc(V v_) { if (v_!=0) { AVariableData *pVarData = ::pAVarDataFromV(v_); if (pVarData!=0 && pVarData->titleFunc()->func()!=0) { return pVarData->titleFunc(); } } return 0; } AColorFunction *AplusModel::getFgFunc(V v_) { if (v_!=0) { AVariableData *pVarData = ::pAVarDataFromV(v_); if (pVarData!=0 && pVarData->fgFunc()->func()!=0) { return pVarData->fgFunc(); } } return 0; } AColorFunction *AplusModel::getBgFunc(V v_) { if (v_!=0) { AVariableData *pVarData = ::pAVarDataFromV(v_); if (pVarData!=0 && pVarData->bgFunc()->func()!=0) { return pVarData->bgFunc(); } } return 0; } AColorFunction *AplusModel::getTitleColorFunc(V v_) { if (v_!=0) { AVariableData *pVarData = ::pAVarDataFromV(v_); if (pVarData!=0 && pVarData->titleColorFunc()->func()!=0) { return pVarData->titleColorFunc(); } } return 0; } AFontFunction *AplusModel::getFontFunc(V v_) { if (v_!=0) { AVariableData *pVarData = ::pAVarDataFromV(v_); if (pVarData!=0 && pVarData->fontFunc()->func()!=0) { return pVarData->fontFunc(); } } return 0; } AFontFunction *AplusModel::getTitleFontFunc(V v_) { if (v_!=0) { AVariableData *pVarData = ::pAVarDataFromV(v_); if (pVarData!=0 && pVarData->titleFontFunc()->func()!=0) { return pVarData->titleFontFunc(); } } return 0; } AReadOnlyFunction *AplusModel::getReadOnlyFunc(V v_) { if (v_!=0) { AVariableData *pVarData = ::pAVarDataFromV(v_); if (pVarData!=0 && pVarData->roFunc()->func()!=0) { return pVarData->roFunc(); } } return 0; } AGeometryFunction *AplusModel::getGeometryFunc(V v_) { if (v_!=0) { AVariableData *pVarData = ::pAVarDataFromV(v_); if (pVarData!=0 && pVarData->geoFunc()->func()!=0) { return pVarData->geoFunc(); } } return 0; } AFunction *AplusModel::getDoneFunc(V v_) { if (v_!=0) { AVariableData *pVarData = ::pAVarDataFromV(v_); if (pVarData!=0 && pVarData->doneFunc()->func()!=0) { return pVarData->doneFunc(); } } return 0; } ACycleFunction *AplusModel::getCycleFunc(V v_) { if (v_!=0) { AVariableData *pVarData = ::pAVarDataFromV(v_); if (pVarData!=0 && pVarData->cycleFunc()->func()!=0) { return pVarData->cycleFunc(); } } return 0; } aplus-fsf-4.22/src/AplusGUI/AplusNotebook.C0000644000265000001440000000274210772770345014150 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include extern long dbg_tmstk; AplusNotebook::AplusNotebook(MSWidget *xwin_) : MSNotebook(xwin_) { AplusModel *am=new AplusModel(0); INTERNAL_COUPLE(am); } AplusNotebook::~AplusNotebook(void) {} void AplusNotebook::addSenderNotify(MSEventSender *m_) { INTERNAL_COUPLE(((AplusModel *) m_)); } void AplusNotebook::receiveEvent(MSEvent &event_) { if (event_.type()==MSIndexedEvent::symbol()) { MSIndexedEvent &ev=(MSIndexedEvent&)event_; update(ev.index()); } else if (event_.type()==MSNullEvent::symbol()) update(MSIndexVector::nullVector()); else if (event_.type() == AplusEvent::symbol()) { if (dbg_tmstk) cout << "Received UpdateEvent in AplusNotebook" << endl; redraw(); } if (event_.type() == AplusVerifyEvent::symbol()) { if (dbg_tmstk) cout << "Received VerifyEvent in AplusNotebook" << endl; AplusVerifyEvent *ave = (AplusVerifyEvent *) &event_; ave->result(verifyData(ave->aplusVar(), ave->a())); } } const MSSymbol& AplusNotebook::widgetType(void) const { return symbol(); } const MSSymbol& AplusNotebook::symbol(void) { static MSSymbol sym("AplusNotebook"); return sym; } aplus-fsf-4.22/src/AplusGUI/AplusPage.C0000644000265000001440000010336210772770345013244 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include extern MSBoolean isMatrix(A); extern void setBusyState(MSBoolean); extern long dbg_tmstk; const unsigned long AplusPageEventMask=(ExposureMask|ButtonPressMask| ButtonReleaseMask|Button1MotionMask); const int AplusPageDefaultHighlightThickness=2; const int AplusPageDefaultShadowThickness=0; const int AplusPageDefaultMargin=2; const int AplusPageDefaultRows=80; const int AplusPageDefaultCols=25; const char *AplusPageDefaultFont="courier-14"; const unsigned long AplusPageDefaultBlinkRate=250; // 250 milliseconds static MSBoolean isMatrix(A a_,I type_) { return (a_!=0&&QA(a_)&&a_->t==type_&&a_->r==2)?MSTrue:MSFalse; } AplusBlinkTimer::AplusBlinkTimer(AplusPage *page_,unsigned long interval_) : MSIntervalTimer(interval_) { _page = page_; } AplusBlinkTimer::~AplusBlinkTimer(void) {} void AplusBlinkTimer::process(void) { page()->processBlinkTimer(); } AplusPage::AplusPage(MSWidget *parent_) : MSCompositeText(parent_) { _highlightThickness=AplusPageDefaultHighlightThickness; _shadowThickness=AplusPageDefaultShadowThickness; _margin=AplusPageDefaultMargin; _blinkTimer=0; _blinkRate=AplusPageDefaultBlinkRate; _blink=aplus_nl; _blinkPhase=Normal; _boxMatrix=aplus_nl; _lineMatrix=aplus_nl; _lineWidth=10; // 10 percent _boxColors=aplus_nl; _keyBuf=aplus_nl; _boldFontID=0; _x_cursor=-1; _y_cursor=-1; AplusModel *am=new AplusModel(0); INTERNAL_COUPLE(am); backingStore(WhenMapped); shadowStyle(MSEtchedOut); acceptFocus(MSTrue); acceptTab(MSTrue); sensitive(MSTrue); addColor(0,foreground(),background()); selectInput(AplusPageEventMask); freeze(); } AplusPage::~AplusPage(void) { stopBlinkTimer(); MSNodeItem *hp=colorListHead(); MSNodeItem *np; ColorCell *cc; while((np=hp->next())!=hp) { cc=(ColorCell *)np->data(); delete np; delete cc; } if (isNull(blink())==MSFalse) dc(blink()); if (isNull(boxMatrix())==MSFalse) dc(boxMatrix()); if (isNull(lineMatrix())==MSFalse) dc(lineMatrix()); if (isNull(boxColors())==MSFalse) dc(boxColors()); if (isNull(keyBuffer())==MSFalse) dc(keyBuffer()); } ColorCell *AplusPage::colorCell(int index_) { MSNodeItem *hp=colorListHead(); MSNodeItem *np=hp; ColorCell *cc=0; while((np=np->next())!=hp) { cc=(ColorCell *)np->data(); if (cc->id()==index_) np=hp->prev(); else cc=0; } return cc; } void AplusPage::addColor(int index_,unsigned long fg_,unsigned long bg_) { ColorCell *cc=colorCell(index_); if (cc!=0) { cc->fg(fg_); cc->bg(bg_); } else { cc=new ColorCell(index_,fg_,bg_); MSNodeItem *np=new MSNodeItem((void *)cc); np->insert(colorListHead()); // fifo list } } void AplusPage::colorTable(A ct_) { if (QA(ct_)) { MSNodeItem *hp=colorListHead(); MSNodeItem *np=hp; ColorCell *cc; if (ct_->t==It&&ct_->r==(I)2&&ct_->d[1]==(I)2) { while((np=np->next())!=hp) { cc=(ColorCell *)np->data(); if (cc->id()>=(int)ct_->d[0]) { delete np; delete cc; np=hp; } } P p; p.i=ct_->p; for (int i=0;i<(int)ct_->d[0];i++) addColor(i,(unsigned long)p.i[2*i], (unsigned long)p.i[(2*i)+1]); redraw(); } else if (ct_->t==Et&&ct_->n==0) { while((np=hp->next())!=hp) { cc=(ColorCell *)np->data(); delete np; delete cc; } redraw(); } } } A AplusPage::rBand(void) { A r=gv(It,4); r->p[0]=(I)rubberBand()->y(); r->p[1]=(I)rubberBand()->x(); r->p[2]=(I)rubberBand()->ys(); r->p[3]=(I)rubberBand()->xs(); return r; } A AplusPage::colorTable(void) { MSNodeItem *hp=colorListHead(); MSNodeItem *np=hp; ColorCell *cc=0; int count=0; while((np=np->next())!=hp) count++; np=hp; A r=gm(It,count,2); count=0; while((np=np->next())!=hp) { cc=(ColorCell *)np->data(); r->p[count++]=(I)cc->fg(); r->p[count++]=(I)cc->bg(); } return r; } void AplusPage::computeSize(void) { int offset=(highlightThickness()+shadowThickness()+margin()+1)<<1; resize(numCols()*charWidth()+offset,numRows()*textHeight()+offset); } void AplusPage::configure(void) { int offset=highlightThickness()+shadowThickness()+margin(); XRectangle clipRect[1]; clipRect[0].x=0; clipRect[0].y=0; clipRect[0].width=drawWidth(); clipRect[0].height=drawHeight(); XSetClipRectangles(display(),textGC(),offset,offset,&clipRect[0],1,Unsorted); refresh(); } void AplusPage::redraw(void) { if (mapped()==MSTrue&&frozen()==MSFalse) { screenRedraw(); drawShadow(); } } void AplusPage::refresh(void) { if (mapped()==MSTrue) { clear(); blinkPhase(Normal); redraw(); } } void AplusPage::updateForeground(unsigned long) { V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; A a = (model()!=0)?((AplusModel*)model())->a():0; AColorFunction *fgFunc=AplusModel::getFgFunc(v); if (fgFunc!=0) foreground(fgFunc->invoke(v,a)); } extern const char *DefaultFont; extern const char *AltDefaultFont; void AplusPage::updateFont(Font oldfid_) { V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; A a = (model()!=0)?((AplusModel*)model())->a():0; Font fid=font(); AFontFunction *fontFunc=AplusModel::getFontFunc(v); if (fontFunc!=0) fid=(Font)fontFunc->invoke(v,a); if (oldfid_!=font()) { MSCompositeText::updateFont(oldfid_); const char *fontString=server()->fontName(fid); if (fontString!=0) { MSString fs(fontString); int pos=fs.indexOf("-bold", 0); if (pos==fs.length()) { int ipos=fs.length(); if ((pos=fs.indexOf('-',0))fontID(fs); if (fsid!=server()->defaultFont()) boldFontID(fsid); else boldFontID(0); } else boldFontID(fid); } if (firstMap()==MSTrue) { if (dynamic()==MSTrue) computeSize(); else refresh(); } } } void AplusPage::firstMapNotify(void) { freeze(); updateFont(font()); computeSize(); unfreeze(); } void AplusPage::updateData(void) { V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; if (v!=0) refresh(); } void AplusPage::update(V,int,int,UpdateType type_) { if (type_==ShapeUpdate) updateData(); } int AplusPage::computeYCoord(int row_) { int offset=highlightThickness()+shadowThickness()+margin()+textAscent(); return offset+(row_*textHeight()); } int AplusPage::computeXCoord(int,int col_) { int offset=highlightThickness()+shadowThickness()+margin(); return offset+(col_*charWidth()); } int AplusPage::drawWidth(void) { int offset=(highlightThickness()+shadowThickness()+margin())<<1; return width()-offset; } int AplusPage::drawHeight(void) { int offset=(highlightThickness()+shadowThickness()+margin())<<1; return height()-offset; } int AplusPage::numRows(void) { A a = (model()!=0)?((AplusModel*)model())->a():0; int d0 = (model()!=0)?((AplusModel*)model())->d0():0; return (a==0||isNull(a)==MSTrue)?0:d0; } int AplusPage::numCols(void) { A a = (model()!=0)?((AplusModel*)model())->a():0; int d1 = (model()!=0)?((AplusModel*)model())->d1():0; return (a==0||isNull(a)==MSTrue)?0:d1; } MSBoolean AplusPage::verifyData(V,A a_) { return (isNull(a_)||isMatrix(a_,Ct))?MSTrue:MSFalse; } char *AplusPage::string(int row_) { A a = (model()!=0)?((AplusModel*)model())->a():0; char *cp=0; if (a!=0&&row_data():0; int len=numCols(); cp=new char[len+1]; int offset=row_*len; strncpy(cp,p.c+offset,len); cp[len]='\0'; } return cp; } void AplusPage::blinkRate(unsigned long rate_) { if (rate_!=blinkRate()) { MSBoolean stop=(blinkTimer()==0)?MSTrue:MSFalse; if (blinkTimer()!=0) delete _blinkTimer; _blinkRate=rate_; _blinkTimer=new AplusBlinkTimer(this, (unsigned long) blinkRate()); if (stop==MSTrue) blinkTimer()->stop(); } } void AplusPage::startBlinkTimer(void) { if (blinkTimer()!=0) blinkTimer()->reset(); else _blinkTimer=new AplusBlinkTimer(this,(unsigned long)blinkRate()); } void AplusPage::stopBlinkTimer(void) { if (blinkTimer()!=0) delete blinkTimer(); _blinkTimer=0; } void AplusPage::processBlinkTimer(void) { blinkTimeOut(); } void AplusPage::commonUpdate(V v_,A index_,A,I ravel_) { if(index_==(A)MP(22)) update(v_,-1,-1,AppendUpdate); else if(!index_) update(v_,-1,-1,ShapeUpdate); else if(ravel_) // ravel update { A a=(A)v_->a; if(a->r==2&&a->n==1) { int n=(int)a->d[1]; int k=(int)index_->p[0]; int j=k/n; update(v_,j,k-n*j,ValueUpdate); } else update(v_,-1,-1,ValueUpdate); } else { A r=index_->t==It?index_:index_->n?(A)*index_->p:aplus_nl; A c=index_->t==Et&&index_->n>1?(A)index_->p[1]:aplus_nl; if(isNull(c)==MSTrue) // c is aplus_nl - all cols are updated { if(isNull(r)==MSTrue) update(v_,-1,-1,ValueUpdate); else { for(int i=0;i<(int)r->n;i++) update(v_,(int)r->p[i],-1,ValueUpdate); } } else if(isNull(r)==MSTrue) // r is aplus_nl - all rows are updated { for(int i=0;i<(int)c->n;i++) update(v_,-1,(int)c->p[i],ValueUpdate); } else { for(int j=0;j<(int)r->n;j++) { for(int i=0;i<(int)c->n;i++) { update(v_,(int)r->p[j],(int)c->p[i],ValueUpdate); } } } } } void AplusPage::update(V v_,A index_,A pick_,I ravel_) { if (ravel_) { A av=(A)v_->a; if(av->r==2&&index_->r==1) { int nc=(int)av->d[1]; int i=0,k=0; int co=0; int row=0,cc=0; A index,col; for (row=0;row<(int)av->d[0];row++) { for (i=0;in;i++) { if (co<=index_->p[i]&&index_->p[i]0) { index=gv(Et,2); index->p[0]=(I)gi(row); col=gv(It,cc); index->p[1]=(I)col; for (i=0,k=0;in;i++) { if (co<=index_->p[i]&&index_->p[i]p[k++]=(index_->p[i]-co); } screenUpdate(index); dc(index); } co+=nc; cc=0; } } else screenUpdate(aplus_nl); } else if (!index_) commonUpdate(v_,index_,pick_,ravel_); else screenUpdate(index_); } MSBoolean AplusPage::verifyA(A a_) { A a = (model()!=0)?((AplusModel*)model())->a():0; int rank = (model()!=0)?((AplusModel*)model())->rank():0; int n = (model()!=0)?((AplusModel*)model())->numElmts():0; return (0!=a_&&QA(a_)&&a_->t==It&&a_->r==rank&&a_->n==n&& a_->d[0]==numRows()&&a_->d[1]==numCols())?MSTrue:MSFalse; } MSBoolean AplusPage::verifyA(A a_,A r_,A c_) { if (isNull(r_)==MSTrue&&isNull(c_)==MSTrue) return verifyA(a_); else if (isNull(r_)==MSTrue) { if (0!=a_&&QA(a_)&&a_->n==c_->n*numRows()&&a_->d[0]==numRows()) return MSTrue; } else if (isNull(c_)==MSTrue) { if (0!=a_&&QA(a_)&&a_->n==r_->n*numCols()&&a_->d[0]==numCols()) return MSTrue; } else if (0!=a_&&QA(a_)&&a_->n==r_->n*c_->n) return MSTrue; return MSFalse; } void AplusPage::drawAllRowsCols(A index_) { V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; A r=index_->t==It?index_:index_->n?(A)*index_->p:aplus_nl; A c=index_->t==Et&&index_->n>1?(A)index_->p[1]:aplus_nl; if (isNull(r)==MSTrue&&isNull(c)==MSTrue) { A colorA=indexFunc()->invoke(v,aplus_nl); A boldA=boldFunc()->invoke(v,aplus_nl); A ulineA=underlineFunc()->invoke(v,aplus_nl); int color,nextColor; MSBoolean bold,nextBold; MSBoolean uline,nextUline; P p; p.i=((AplusModel*)model())->data(); int nc=numCols(); int nr=numRows(); int offset=0; int len=1; MSBoolean useColor=verifyA(colorA,aplus_nl,aplus_nl); MSBoolean useBold=verifyA(boldA,aplus_nl,aplus_nl); MSBoolean useUline=verifyA(ulineA,aplus_nl,aplus_nl); for(int i=0;ip[offset+j]:0; bold=(useBold==MSTrue&&boldA->p[offset+j]==1)?MSTrue:MSFalse; uline=(useUline==MSTrue&&ulineA->p[offset+j]==1)?MSTrue:MSFalse; len=1; while(j+lenp[offset+(len+j)]:0; nextBold=(useBold==MSTrue&&boldA->p[offset+(len+j)]==1)?MSTrue:MSFalse; nextUline=(useUline==MSTrue&&ulineA->p[offset+(len+j)]==1)?MSTrue:MSFalse; if (nextColor==color&&nextBold==bold&&nextUline==uline) len++; else break; } drawRow(i,j,p.c+(offset+j),len,color,bold,Normal,uline); } offset+=nc; } dc(colorA); dc(boldA); dc(ulineA); } } void AplusPage::drawAllRows(A index_) { V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; A r=index_->t==It?index_:index_->n?(A)*index_->p:aplus_nl; A c=index_->t==Et&&index_->n>1?(A)index_->p[1]:aplus_nl; if (isNull(r)==MSTrue) // update all rows { A colorA=indexFunc()->invoke(v,aplus_nl); A boldA=boldFunc()->invoke(v,aplus_nl); A ulineA=underlineFunc()->invoke(v,aplus_nl); int col,len,color,nextCol,nextColor; MSBoolean bold,nextBold; MSBoolean uline,nextUline; P p; p.i=((AplusModel*)model())->data(); int nc=numCols(); int nr=numRows(); int offset=0; MSBoolean useColor=verifyA(colorA,aplus_nl,aplus_nl); MSBoolean useBold=verifyA(boldA,aplus_nl,aplus_nl); MSBoolean useUline=verifyA(ulineA,aplus_nl,aplus_nl); for(int i=0;in;j+=len) { col=(int)c->p[j]; color=(useColor==MSTrue)?(int)colorA->p[offset+col]:0; bold=(useBold==MSTrue&&boldA->p[offset+col]==1)?MSTrue:MSFalse; uline=(useUline==MSTrue&&ulineA->p[offset+col]==1)?MSTrue:MSFalse; len=1; while(col+lenn) { nextCol=(int)c->p[j+len]; if (nextCol==col+len) { nextColor=(useColor==MSTrue)?(int)colorA->p[offset+(col+len)]:0; nextBold=(useBold==MSTrue&&boldA->p[offset+(col+len)]==1)?MSTrue:MSFalse; nextUline=(useUline==MSTrue&&ulineA->p[offset+(col+len)]==1)?MSTrue:MSFalse; if (nextColor==color&&nextBold==bold&&nextUline==uline) len++; else break; } else break; } drawRow(i,col,p.c+(offset+col),len,color,bold,Normal,uline); } offset+=nc; } dc(colorA); dc(boldA); dc(ulineA); } } void AplusPage::drawAllCols(A index_) { V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; A r=index_->t==It?index_:index_->n?(A)*index_->p:aplus_nl; A c=index_->t==Et&&index_->n>1?(A)index_->p[1]:aplus_nl; if (isNull(c)==MSTrue) // update all cols { A colorA=indexFunc()->invoke(v,aplus_nl); A boldA=boldFunc()->invoke(v,aplus_nl); A ulineA=underlineFunc()->invoke(v,aplus_nl); int len,color,nextColor; MSBoolean bold,nextBold; MSBoolean uline,nextUline; P p; p.i=((AplusModel*) model())->data(); int nc=numCols(); int nr=numRows(); int offset=0; int row; MSBoolean useColor=verifyA(colorA,aplus_nl,aplus_nl); MSBoolean useBold=verifyA(boldA,aplus_nl,aplus_nl); MSBoolean useUline=verifyA(ulineA,aplus_nl,aplus_nl); for(int i=0;i<(int)r->n;i++) { len=1; row=(int)r->p[i]; offset=row*nc; for(int j=0;jp[offset+j]:0; bold=(useBold==MSTrue&&boldA->p[offset+j])?MSTrue:MSFalse; uline=(useUline==MSTrue&&ulineA->p[offset+j]==1)?MSTrue:MSFalse; len=1; while(j+lenp[offset+(j+len)]:0; nextBold=(useBold==MSTrue&&boldA->p[offset+(j+len)]==1)?MSTrue:MSFalse; nextUline=(useUline==MSTrue&&ulineA->p[offset+(j+len)]==1)?MSTrue:MSFalse; if (nextColor==color&&nextBold==bold&&nextUline==uline) len++; else break; } drawRow(row,j,p.c+(offset+j),len,color,bold,Normal,uline); } } dc(colorA); dc(boldA); dc(ulineA); } } void AplusPage::drawIndexed(A index_) { V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; A r = index_->t==It?index_:index_->n?(A)*index_->p:aplus_nl; A c = index_->t==Et&&index_->n>1?(A)index_->p[1]:aplus_nl; if (isNull(r)==MSFalse&&isNull(c)==MSFalse) { A colorA=indexFunc()->invoke(v,aplus_nl); A boldA=boldFunc()->invoke(v,aplus_nl); A ulineA=underlineFunc()->invoke(v,aplus_nl); int row,col,color,nextColor; MSBoolean bold,nextBold; MSBoolean uline,nextUline; P p; p.i=((AplusModel*)model())->data(); MSBoolean useColor=verifyA(colorA,aplus_nl,aplus_nl); MSBoolean useBold=verifyA(boldA,aplus_nl,aplus_nl); MSBoolean useUline=verifyA(ulineA,aplus_nl,aplus_nl); int nc=numCols(); int nr=numRows(); int offset; for(int i=0;i<(int)r->n;i++) { row=(int)r->p[i]; offset=row*nc; if (c->n<=2) { for(int j=0;j<(int)c->n;j++) { col=(int)c->p[j]; color=(useColor==MSTrue)?(int)colorA->p[offset+col]:0; bold=(useBold==MSTrue&&boldA->p[offset+col]==1)?MSTrue:MSFalse; uline=(useUline==MSTrue&&ulineA->p[offset+col]==1)?MSTrue:MSFalse; drawRow(row,col,p.c+(offset+col),1,color,bold,Normal,uline); } } else { int sc=(int)c->p[0]; int ec=(int)c->p[0]; int j; for (j=0;j<(int)c->n;j++) { sc=(c->p[j]p[j]:sc; ec=(c->p[j]>ec)?(int)c->p[j]:ec; } ec=(ec=0)?sc:0; int len=0; for (j=sc;j<=ec;j+=len) { color=(useColor==MSTrue)?(int)colorA->p[offset+j]:0; bold=(useBold==MSTrue&&boldA->p[offset+j])?MSTrue:MSFalse; uline=(useUline==MSTrue&&ulineA->p[offset+j]==1)?MSTrue:MSFalse; len=1; while(j+len<=ec) { nextColor=(useColor==MSTrue)?(int)colorA->p[offset+(j+len)]:0; nextBold=(useBold==MSTrue&&boldA->p[offset+(j+len)]==1)?MSTrue:MSFalse; nextUline=(useUline==MSTrue&&ulineA->p[offset+(j+len)]==1)?MSTrue:MSFalse; if (nextColor==color&&nextBold==bold&&nextUline==uline) len++; else break; } drawRow(row,j,p.c+(offset+j),len,color,bold,Normal,uline); } } } dc(colorA); dc(boldA); dc(ulineA); } } MSBoolean AplusPage::verifyBlink(A b_) { return verifyA(b_); } // called after each data update void AplusPage::blinkUpdate(void) { V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; if (blinkFunc()->func()!=0) { A newBlink=blinkFunc()->invoke(v,aplus_nl); if (verifyBlink(newBlink)==MSTrue) { MSBoolean stopTimer=MSTrue; if (blinkTimer()!=0) { if (blinkPhase()==Normal) { for (int i=0;in;i++) { if (newBlink->p[i]==1) { stopTimer=MSFalse; break; } } } else // reverse { if (isNull(blink())==MSFalse) { int k=0; P p; p.i=((AplusModel*)model())->data(); int delta; int color; MSBoolean bold; MSBoolean uline; A colorA=indexFunc()->invoke(v,aplus_nl); A boldA=boldFunc()->invoke(v,aplus_nl); A ulineA=underlineFunc()->invoke(v,aplus_nl); MSBoolean useColor=verifyA(colorA); MSBoolean useBold=verifyA(boldA); MSBoolean useUline=verifyA(ulineA); for (int i=0;id[0];i++) { for (int j=0;jd[1];j++) { if (newBlink->p[k]==1) stopTimer=MSFalse; delta=(int)(newBlink->p[k]-blink()->p[k]); if (delta==-1||delta==1) { color=(useColor==MSTrue)?(int)colorA->p[k]:0; bold=(useBold==MSTrue&&boldA->p[k]==1)?MSTrue:MSFalse; uline=(useUline==MSTrue&&ulineA->p[k]==1)?MSTrue:MSFalse; drawRow(i,j,(char *)p.c+k,1,color,bold, (delta==1)?Reverse:Normal,uline); } k++; } } dc(colorA); dc(boldA); dc(ulineA); } } blink(newBlink); if (stopTimer==MSTrue) stopBlinkTimer(); } else // timer not running { if (drawBlink(newBlink,Reverse)==MSTrue) { blinkPhase(Reverse); blink(newBlink); startBlinkTimer(); } } } dc(newBlink); } } void AplusPage::blinkTimeOut(void) { V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; if (blinkPhase()==Normal) { A newBlink=blinkFunc()->invoke(v,aplus_nl); if (verifyBlink(newBlink)==MSTrue) { MSBoolean stopTimer=(drawBlink(newBlink,Reverse)==MSTrue)?MSFalse:MSTrue; blink(newBlink); toggleBlinkPhase(); if (stopTimer==MSTrue) stopBlinkTimer(); } dc(newBlink); } else // reverse { (void)drawBlink(blink(),Normal); toggleBlinkPhase(); } } MSBoolean AplusPage::drawBlink(A blink_,BlinkPhase phase_) { V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; MSBoolean status=MSFalse; if (verifyBlink(blink_)==MSTrue) { int k=0; P p; p.i=((AplusModel*)model())->data(); int color,nextColor; MSBoolean bold,nextBold; MSBoolean uline,nextUline; int len; int nc=numCols(); int nr=numRows(); A colorA=indexFunc()->invoke(v,aplus_nl); A boldA=boldFunc()->invoke(v,aplus_nl); A ulineA=underlineFunc()->invoke(v,aplus_nl); MSBoolean useColor=verifyA(colorA); MSBoolean useBold=verifyA(boldA); MSBoolean useUline=verifyA(ulineA); for (int i=0;id[0];i++) { len=1; for (int j=0;jd[1];j+=len) { len=1; if ((int)blink_->p[k]==1) { status=MSTrue; color=(useColor==MSTrue)?(int)colorA->p[k]:0; bold=(useBold==MSTrue&&boldA->p[k]==1)?MSTrue:MSFalse; uline=(useUline==MSTrue&&ulineA->p[k]==1)?MSTrue:MSFalse; while(j+lenp[k+len]==1) { nextColor=(useColor==MSTrue)?(int)colorA->p[k+len]:0; nextBold=(useBold==MSTrue&&boldA->p[k+len]==1)?MSTrue:MSFalse; nextUline=(useUline==MSTrue&&ulineA->p[k+len]==1)?MSTrue:MSFalse; if (nextColor==color&&nextBold==bold&&nextUline==uline) len++; else break; } else break; } drawRow(i,j,(char *)p.c+k,len,color,bold,phase_,uline); } k+=len; } } dc(colorA); dc(boldA); dc(ulineA); } if (status==MSTrue) drawBoxes(MSFalse); return status; } void AplusPage::screenUpdate(A index_) { if (mapped()==MSTrue) { A r=index_->t==It?index_:index_->n?(A)*index_->p:aplus_nl; A c=index_->t==Et&&index_->n>1?(A)index_->p[1]:aplus_nl; if (isNull(r)==MSTrue&&isNull(c)==MSTrue) drawAllRowsCols(index_); else if (isNull(r)==MSTrue) drawAllRows(index_); else if (isNull(c)==MSTrue) drawAllCols(index_); else drawIndexed(index_); drawLines(MSFalse); blinkUpdate(); drawBoxes(MSFalse); } } void AplusPage::drawRow(int row_,int col_,const char *str_,int len_, int index_,MSBoolean bold_,BlinkPhase phase_,MSBoolean underline_) { if (str_!=0) { int y=computeYCoord(row_); int x=computeXCoord(row_,col_>=0?col_:0); int tw=len_*charWidth(); int lastRowAdjustment=(numRows()-1==row_)?1:0; int lastColAdjustment=(numCols()==col_+len_)?1:0; ColorCell *cc=colorCell(index_); unsigned long fg; unsigned long bg; if (cc!=0) { fg=cc->fg(); bg=cc->bg(); } else { fg=foreground(); bg=background(); } if (phase_==Reverse) { XSetForeground(display(),textGC(),fg); XSetBackground(display(),textGC(),bg); } else { XSetForeground(display(),textGC(),bg); XSetBackground(display(),textGC(),fg); } XFillRectangle(display(),window(),textGC(),x,y-textAscent(), tw+lastColAdjustment,textHeight()+lastRowAdjustment); if (phase_==Reverse) { XSetForeground(display(),textGC(),bg); XSetBackground(display(),textGC(),fg); } else { XSetForeground(display(),textGC(),fg); XSetBackground(display(),textGC(),bg); } Font fid=(bold_==MSTrue&&boldFontID()!=0)?boldFontID():font(); XSetFont(display(),textGC(),fid); const XFontStruct *fs=server()->fontStruct(fid); XDrawString(display(),window(),textGC(),fs,x,y,str_,len_); if (bold_==MSTrue&&boldFontID()==0) XDrawString(display(),window(),textGC(),fs,x+1,y,str_,len_); if (underline_==MSTrue) XDrawLine(display(),window(),textGC(),x,y+textDescent()-1,x+tw-1,y+textDescent()-1); } } void AplusPage::screenRedraw(void) { A a = (model()!=0)?((AplusModel*)model())->a():0; if (mapped()==MSTrue&&a!=0) { screenUpdate(aplus_nl); drawLines(MSFalse); drawBoxes(MSFalse); } } int AplusPage::yToRow(int y_) { y_-=highlightThickness()+shadowThickness()+margin(); if (y_<0) return 0; else if (y_>drawHeight()) return numRows(); return (y_/textHeight()); } int AplusPage::xToCol(int x_) { x_-=highlightThickness()+shadowThickness()+margin(); if (x_<0) return 0; else if (x_>drawWidth()) return numCols(); return (x_/charWidth()); } void AplusPage::buttonPress(const XEvent *event_) { x_cursor(xToCol(event_->xbutton.x)); y_cursor(yToRow(event_->xbutton.y)); if (sensitive()==MSTrue&&event_->xbutton.button==Button1&& acceptFocus()==MSTrue&&traverseFocus(this)==MSTrue) { unsigned int keys; unsigned int mask=Button1Mask; MSBoolean moved=MSTrue; // change in spec--always produce callback Window root,child; int ix,iy; int rx,ry; GC gc=XCreateGC(display(),window(),0,0); XSetFunction(display(),gc,GXxor); XSetForeground(display(),gc,WhitePixelOfScreen(screen())^background()); XSetBackground(display(),gc,0); int offset=highlightThickness()+shadowThickness()+margin(); int ex=offset+xToCol(event_->xbutton.x)*charWidth(); int ey=offset+yToRow(event_->xbutton.y)*textHeight(); int ox=ex; int oy=ey; XEvent ne,*ce; drawRect(gc,ex,ey,0,0); XQueryPointer(display(),window(),&root,&child,&rx,&ry,&ix,&iy,&keys); while (keys&mask) { if (abs(ex-ix)>5&&abs(ey-iy)>5) moved=MSTrue; if (ix!=ox||iy!=oy) { if (ox>ex) { (oy>ey)?drawRect(gc,ex,ey,(ox-ex),(oy-ey)): drawRect(gc,ex,oy,(ox-ex),(ey-oy)); } else { (oy>ey)?drawRect(gc,ox,ey,(ex-ox),(oy-ey)): drawRect(gc,ox,oy,(ex-ox),(ey-oy)); } ox=ix; oy=iy; if (ox>ex) { (oy>ey)?drawRect(gc,ex,ey,(ox-ex),(oy-ey)): drawRect(gc,ex,oy,(ox-ex),(ey-oy)); } else { (oy>ey)?drawRect(gc,ox,ey,(ex-ox),(oy-ey)): drawRect(gc,ox,oy,(ex-ox),(ey-oy)); } } XNextEvent(display(),&ne); if (ne.type==MotionNotify) { ce=compressMotion(&ne); ix=ce->xmotion.x; iy=ce->xmotion.y; } else if (ne.type==ButtonRelease) { keys=0; ix=ne.xbutton.x; iy=ne.xbutton.y; } } if (ox>ex) { (oy>ey)?drawRect(gc,ex,ey,(ox-ex),(oy-ey)): drawRect(gc,ex,oy,(ox-ex),(ey-oy)); } else { (oy>ey)?drawRect(gc,ox,ey,(ex-ox),(oy-ey)): drawRect(gc,ox,oy,(ex-ox),(ey-oy)); } XFreeGC(display(),gc); if (moved==MSTrue) { int x=xToCol((ix>ex)?ex:ix); int xs=xToCol((ix>ex)?ix:ex)-x; int y=yToRow((iy>ey)?ey:iy); int ys=yToRow((iy>ey)?iy:ey)-y; ys=(y+ys<=numRows())?ys:numRows()-y; xs=(x+xs<=numCols())?xs:numCols()-x; rubberBand()->configure(x,y,xs,ys); activateCallback(MSSymbol("rband")); } else rubberBand()->configure(0,0,0,0); } else if (sensitive()==MSTrue) { if (event_->xbutton.button==Button2) { activateCallback(MSSymbol("button2down")); } else if (event_->xbutton.button==Button3) { activateCallback(MSSymbol("button3down")); } } } void AplusPage::buttonRelease(const XEvent *event_) { if (sensitive()==MSTrue) { if (event_->xbutton.button==Button2) { activateCallback(MSSymbol("button2up")); } else if (event_->xbutton.button==Button3) { activateCallback(MSSymbol("button3up")); } } } void AplusPage::drawBoxes(MSBoolean clear_) { if (isNull(boxMatrix())==MSFalse) { int x,y,ys,xs,w,h; int k=0; int offset=highlightThickness()+shadowThickness()+margin(); for(int i=0;id[0];i++) { y=(int)boxMatrix()->p[k]; x=(int)boxMatrix()->p[k+1]; ys=(int)boxMatrix()->p[k+2]; xs=(int)boxMatrix()->p[k+3]; h=ys*textHeight(); w=xs*charWidth(); y=offset+y*textHeight(); x=offset+x*charWidth(); (clear_==MSTrue)?XSetForeground(display(),textGC(),background()): XSetForeground(display(),textGC(),boxColor(i)); k+=(int)boxMatrix()->d[1]; drawRect(textGC(),x,y,w,h); } } } void AplusPage::drawLines(MSBoolean clear_) { if (isNull(lineMatrix())==MSFalse && lineMatrix()->d[0]>0) { int x,y,w,h,ys,xs; int k=0; int offset=highlightThickness()+shadowThickness()+margin(); int lw; int delta; for(int i=0;id[0];i++) { y=(int)lineMatrix()->p[k]; x=(int)lineMatrix()->p[k+1]; ys=(int)lineMatrix()->p[k+2]; xs=(int)lineMatrix()->p[k+3]; if (xs!=0&&ys!=0) xs=0; y=offset+(y*textHeight()); x=offset+(x*charWidth()); if (xs==0) { lw=(int)((lineWidth()*charWidth())/100); lw=(lw>0)?lw:1; delta=charWidth()-lw; delta=(delta>0)?delta>>1:0; x+=delta; w=lw; h=(ys*textHeight()); } else { lw=(int)((lineWidth()*textHeight())/100); lw=(lw>0)?lw:1; delta=textHeight()-lw; delta=(delta>0)?delta>>1:0; y+=delta; h=lw; w=(xs*charWidth()); } k+=(int)lineMatrix()->d[1]; (clear_==MSTrue)?XSetForeground(display(),textGC(),background()): XSetForeground(display(),textGC(),foreground()); XFillRectangle(display(),window(),textGC(),x,y,w,h); } } } A AplusPage::boxColorVector(void) { return (isNull(boxColors())==MSTrue) ? aplus_nl : (A)ic(boxColors()); } void AplusPage::boxColorVector(A colors_) { if (QA(colors_)) { drawBoxes(MSTrue); if (colors_->t==It&&colors_->r==1) { if (isNull(boxColors())==MSFalse) dc(boxColors()); _boxColors=(A)ic(colors_); } else if (isNull(colors_)==MSTrue) { if (isNull(boxColors())==MSFalse) dc(boxColors()); _boxColors=aplus_nl; } else cerr << "Page Widget: invalid bounding box color vector specified." << endl; drawBoxes(MSFalse); } } A AplusPage::lines(void) { return (isNull(lineMatrix())==MSTrue) ? aplus_nl : (A)ic(lineMatrix()); } void AplusPage::lines(A lines_) { if (QA(lines_)) { if (lines_->t==It&&lines_->r==2&&lines_->d[1]==4) { dc(lineMatrix()); _lineMatrix=(A)ic(lines_); } else if (isNull(lines_)==MSTrue) { dc(lineMatrix()); _lineMatrix=aplus_nl; } else cerr << "Page Widget: invalid line specified." << endl; redraw(); } } A AplusPage::boxes(void) { return (isNull(boxMatrix())==MSTrue) ? gm(It,0,4) : (A)ic(boxMatrix()); } void AplusPage::boxes(A boxes_) { if (QA(boxes_)) { if (boxes_->t==It&&boxes_->r==2&&boxes_->d[1]==4) { dc(boxMatrix()); _boxMatrix=(A)ic(boxes_); } else if (isNull(boxes_)==MSTrue) { dc(boxMatrix()); _boxMatrix=aplus_nl; } else cerr << "Page Widget: invalid bounding box specified." << endl; redraw(); } } A AplusPage::keyBuf(void) { return (isNull(keyBuffer())==MSTrue) ? aplus_nl : (A)ic(keyBuffer()); } void AplusPage::keyPress(const XEvent *,KeySym k_,unsigned int s_,const char *b_) { if (sensitive()==MSTrue) { if (strlen(b_)>0) { if (isNull(keyBuffer())==MSFalse) dc(keyBuffer()); _keyBuf=gv(Et,2); A k=gs(It); k->p[0]=(I)(0xff&k_); A state=gv(It,8); unsigned int mask=ShiftMask; for (int i=0;i<8;i++,mask<<=1) state->p[i]=(I)((mask&s_)?1:0); _keyBuf->p[0]=(I)k; _keyBuf->p[1]=(I)state; activateCallback(MSSymbol("keypress")); } } } void AplusPage::addSenderNotify(MSEventSender *m_) { INTERNAL_COUPLE(((AplusModel *) m_)); } void AplusPage::receiveEvent(MSEvent &event_) { if (event_.type() == AplusEvent::symbol()) { if (dbg_tmstk) cout << "Received UpdateEvent in AplusPage" << endl; AplusEvent *ave = (AplusEvent *) &event_; V v = ((AplusModel *)model())->aplusVar(); A index = ave->index(); A pick = ave->pick(); I ravel = ave->ravel();; update(v,index, pick, ravel); } if (event_.type() == AplusVerifyEvent::symbol()) { if (dbg_tmstk) cout << "Received VerifyEvent in AplusPage" << endl; AplusVerifyEvent *ave = (AplusVerifyEvent *) &event_; ave->result(verifyData(ave->aplusVar(), ave->a())); } } void AplusPage::print(const char *file_) { MSBoolean fileOpen=MSFalse; MSBoolean open=MSTrue; setBusyState(MSTrue); if (outputMode()==Draw) { if (file_!=0) displayPrintFileName(file_); if ((open=displayPrintOpen(this))==MSTrue) { fileOpen=MSTrue; outputMode(Print); displayPrintXorigin(0); displayPrintYorigin(0); } } if (open==MSTrue) { redraw(); if (fileOpen==MSTrue) { displayPrintClose(); outputMode(Draw); } } setBusyState(MSFalse); } const MSSymbol& AplusPage::widgetType(void) const { return symbol(); } const MSSymbol& AplusPage::symbol(void) { static MSSymbol sym("AplusPage"); return sym; } aplus-fsf-4.22/src/AplusGUI/AplusPanes.C0000644000265000001440000000314210772770345013431 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include extern long dbg_tmstk; #define PANES_MACROS(PANETYPE, PANEPARENTTYPE, PANENAME) \ \ PANETYPE::PANETYPE(MSWidget *xwin_) : PANEPARENTTYPE(xwin_)\ {\ }\ \ \ PANETYPE::~PANETYPE(void)\ {}\ \ void PANETYPE::addSenderNotify(MSEventSender *m_)\ {\ INTERNAL_COUPLE(((AplusModel *) m_));\ }\ \ void PANETYPE::receiveEvent(MSEvent &event_)\ {\ if (event_.type()==MSIndexedEvent::symbol())\ {\ MSIndexedEvent &ev=(MSIndexedEvent&)event_;\ update(ev.index());\ }\ else if (event_.type()==MSNullEvent::symbol())\ update(MSIndexVector::nullVector());\ else if (event_.type() == AplusEvent::symbol())\ {\ if (dbg_tmstk) cout << "Received UpdateEvent in " << PANENAME << endl; \ redraw();\ }\ if (event_.type() == AplusVerifyEvent::symbol())\ {\ if (dbg_tmstk) cout << "Received VerifyEvent in PANETYPE" << endl;\ AplusVerifyEvent *ave = (AplusVerifyEvent *) &event_;\ ave->result(verifyData(ave->aplusVar(), ave->a()));\ }\ }\ \ const MSSymbol& PANETYPE::widgetType(void) const\ {\ return symbol();\ }\ \ \ const MSSymbol& PANETYPE::symbol(void)\ {\ static MSSymbol sym(#PANETYPE);\ return sym;\ }\ PANES_MACROS(AplusPane, MSPane, "Pane") PANES_MACROS(AplusVPane, MSVPane, "VPane") PANES_MACROS(AplusHPane, MSHPane, "HPane") aplus-fsf-4.22/src/AplusGUI/AplusParagraph.C0000644000265000001440000000341510772770346014274 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include extern long dbg_tmstk; AplusParagraph::AplusParagraph(MSWidget *owner_) : MSWidgetView(owner_), MSParagraph() { AplusModel *am=new AplusModel(0); INTERNAL_COUPLE(am); } AplusParagraph::~AplusParagraph(void) {} void AplusParagraph::addSenderNotify(MSEventSender *sender_) { INTERNAL_COUPLE(((AplusModel *)sender_)); } void AplusParagraph::receiveEvent(MSEvent &event_) { if (event_.type()==AplusEvent::symbol()) { if (dbg_tmstk) showError("Received UpdateEvent in AplusParagraph",2); // print info message } if (event_.type()==AplusVerifyEvent::symbol()) { if (dbg_tmstk) showError("Received VerifyEvent in AplusParagraph",2); // print info message AplusVerifyEvent *ave = (AplusVerifyEvent *)&event_; ave->result(verifyData(ave->aplusVar(), ave->a())); } } MSBoolean AplusParagraph::verifyData(V v_, ::A a_) { if (a_==0) { return MSFalse; } else if (a_->t==Ct) // if it's a string { return MSTrue; } else if (a_->t==Et) // check if it's a string vector { ::A *p=(::A *)a_->p; for (int i=0; in; ++i) { if (!QA(p[i]) || p[i]->t!=Ct) // if any of the elements is not a string { return MSFalse; } } return MSTrue; } else { return MSFalse; } } const MSSymbol& AplusParagraph::widgetType(void) const { return symbol(); } const MSSymbol& AplusParagraph::symbol(void) { static MSSymbol sym("AplusParagraph"); return sym; } aplus-fsf-4.22/src/AplusGUI/AplusPassword.C0000644000265000001440000000704010772770346014167 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include PasswordEditor::PasswordEditor(MSWidget *owner_) : MSEntryField::FieldEditor(owner_) { _fillChar='*'; } PasswordEditor::~PasswordEditor(void) {} const char *PasswordEditor::string(void) { if (length()!=_stringBuffer.length()) { _stringBuffer.leftJustify(length(), fillChar()); } return _stringBuffer; } void PasswordEditor::fillChar(char ch_) { if (fillChar()!=ch_) { _fillChar=(ch_>0)?ch_:'\0'; _stringBuffer=MSString(0,length(),_fillChar); clearTextArea(); redraw(); } } AplusPassword::AplusPassword(MSWidget *owner_) : AplusEntryField(owner_) { _valid=MSFalse; if (passwordEditor()!=0) delete _editor; _editor=new PasswordEditor(this); } AplusPassword::~AplusPassword(void) {} void AplusPassword::fillChar(char ch_) { passwordEditor()->fillChar(ch_); } MSBoolean AplusPassword::verifyData(V v_,A a_) { return (0!=v_&&0!=a_&&QA(a_)&&a_->t==Ct&&a_->r<=1)?MSTrue:MSFalse; } void AplusPassword::button1Press(const XEvent *pEvent_) { if (activateCallback(MSWidgetCallback::reference)==MSFalse) { AplusEntryField::button1Press(pEvent_); } } // We have to override activate() method in order to change what is passed to validateInput(): // MSEntryField::activate() uses _editor->string(), but that will return '*' characters for // the password field; we need to use _editor->text(), which will return the actual string that // was typed. // void AplusPassword::activate(void) { if (_editor->mapped()==MSTrue) { if (hasModel()==MSTrue) { MSString aString=_editor->text(); if (validateInput(aString)==MSTrue) { unmapEditor(); valueChange(); } } else { escape(); } } } MSBoolean AplusPassword::validate(const char *string_) { AplusModel *pModel=(AplusModel *)model(); if (pModel!=0) { A a=pModel->a(); if (a!=0 && a->t==Ct && isNull(a)==MSFalse) { busyOn(); _valid=checkPassword((const char *)a->p,string_); busyOff(); } } return MSTrue; } #ifdef _AIX extern "C" const char *crypt(const char *key_,const char *salt_); #else // extern "C" char *crypt(const char *key_,const char *salt_); #endif extern "C" int kerberosCheck(const char *, const char *); MSBoolean AplusPassword::checkPassword(const char *username_,const char *password_) { struct passwd *pwd; #if defined(APLUS_THREAD_SAFE_FUNCTIONS) struct passwd pwdStruct; char charBuf[1024]; #endif //APLUS_THREAD_SAFE_FUNCTIONS // check for missing or unknown user APLUS_GETPWNAM(username_,&pwdStruct,charBuf,1024,pwd); if ((username_==0)||pwd==(struct passwd *)(0)) { return MSFalse; } // check for trivial password protection on this user if ((pwd->pw_passwd==0)||(pwd->pw_passwd[0]=='\0')) { return MSTrue; } // check for no password provided or incorrect password provided if (strcmp(pwd->pw_passwd,"*")==0) { if (kerberosCheck(username_,password_)!=0) return MSFalse; } else { // if (strcmp(crypt(password_,(const char *)pwd->pw_passwd),pwd->pw_passwd)!=0) return MSFalse; } return MSTrue; } const MSSymbol& AplusPassword::widgetType(void) const { return symbol(); } const MSSymbol& AplusPassword::symbol(void) { static MSSymbol sym("AplusPassword"); return sym; } aplus-fsf-4.22/src/AplusGUI/AplusPopup.C0000644000265000001440000001371410772770346013475 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include static const char *_XA_VUE_WORKSPACE_HINTS ="_DT_WORKSPACE_HINTS"; extern long dbg_tmstk; AplusPopup::AplusPopup(void) : MSPopup() { AplusModel *am=new AplusModel(0); INTERNAL_COUPLE(am); } AplusPopup::AplusPopup(MSDisplayServer *server_) : MSPopup(server_) { AplusModel *am=new AplusModel(0); INTERNAL_COUPLE(am); } AplusPopup::~AplusPopup(void) { if (MSShell::defaultLeader()==(MSShell *)this) { MSShell::defaultLeader(0); } } void AplusPopup::addSenderNotify(MSEventSender *m_) { INTERNAL_COUPLE(((AplusModel *) m_)); } void AplusPopup::receiveEvent(MSEvent &event_) { if (event_.type() == AplusEvent::symbol()) { if (dbg_tmstk) cout << "Received UpdateEvent in AplusPopup" << endl; redraw(); } if (event_.type() == AplusVerifyEvent::symbol()) { if (dbg_tmstk) cout << "Received VerifyEvent in AplusPopup" << endl; AplusVerifyEvent *ave = (AplusVerifyEvent *) &event_; ave->result(verifyData(ave->aplusVar(), ave->a())); } } void AplusPopup::decoupleWidget(void) { if (model()) { delete _model; _model=0; } } MSWidgetView *AplusPopup::getNextFocusAfter(MSWidgetView *pWidgetView_) { if (traversalList().length()>0) { MSWidget *pWidget=0; unsigned i,index=traversalList().indexOf((unsigned long)pWidgetView_,0); if (index==traversalList().length()) index=0; for (i=index+1;iprocessOneEvent(); if (ev.type==MapNotify&&ev.xmap.window==window()) { server()->flush(); return; } } } else show(); } void AplusPopup::virtualScreen(A screen_) { if (server()->isCDERunning()==MSTrue) { if (!QA(screen_) || screen_->t!=It) { return; } int n=(int)screen_->n; unsigned long wsCount=server()->numberOfWorkspaces(); if (n>0 && wsCount>0) { Atom *wsAtoms=((AplusDisplayServer *)server())->workspaceAtoms(); if (wsAtoms==0) { return; } Atom *atoms=new Atom[n]; int wsNum; for (unsigned int i=0; ip[i]-1; // workspace numbers are 1-based if (wsNumworkspaceAtoms() method } } else // CDE is not running { if (QA(screen_) && screen_->t==It) { Atom atom = XInternAtom(display(), "WM_VIRTUAL_SCREEN", False); XChangeProperty(display(),window(),atom,XA_INTEGER,32,PropModeReplace, (unsigned char *)screen_->p,1); } } } A AplusPopup::virtualScreen(void) { if (server()->isCDERunning()==MSTrue) { A presence=gv(It,_workspacePresenceCount); unsigned long wsCount=server()->numberOfWorkspaces(); if (wsCount==0) { return gi(-1); // this should never happen } Atom *wsAtoms=((AplusDisplayServer *)server())->workspaceAtoms(); if (wsAtoms==0) { return gi(-1); // this should never happen } unsigned i ; for (i=0; i<_workspacePresenceCount; ++i) { unsigned j ; for (j=0; jp[i]=j+1; // workspace numbers are 1-based break; } } if (j==wsCount) // i-th atom could not be found -> it is invalid { presence->p[i]=0; } } delete [] wsAtoms; // wsAtoms were allocated by server()->workspaceAtoms() method return presence; } else // CDE is not running { return gi(((AplusDisplayServer *)server())->virtualScreen(window())); } } const MSSymbol& AplusPopup::widgetType(void) const { return symbol(); } const MSSymbol& AplusPopup::symbol(void) { static MSSymbol sym("AplusPopup"); return sym; } aplus-fsf-4.22/src/AplusGUI/AplusPrintColumn.C0000644000265000001440000000447610772770346014651 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include extern long dbg_tmstk; AplusPrintColumn::AplusPrintColumn(MSWidget *owner_) : MSWidgetView(owner_), MSPrintColumn(0) { destroyable(MSFalse); AplusModel *am=new AplusModel(0); INTERNAL_COUPLE(am); } AplusPrintColumn::~AplusPrintColumn(void) {} void AplusPrintColumn::addSenderNotify(MSEventSender *sender_) { INTERNAL_COUPLE(((AplusModel *)sender_)); } void AplusPrintColumn::receiveEvent(MSEvent &event_) { if (event_.type()==AplusEvent::symbol()) { if (dbg_tmstk) showError("Received UpdateEvent in AplusPrintColumn",2); // print info message } if (event_.type()==AplusVerifyEvent::symbol()) { if (dbg_tmstk) showError("Received VerifyEvent in AplusPrintColumn",2); // print info message AplusVerifyEvent *ave = (AplusVerifyEvent *)&event_; ave->result(verifyData(ave->aplusVar(), ave->a())); } } MSBoolean AplusPrintColumn::verifyData(V v_, ::A a_) { if (a_==0) { return MSFalse; } else if (a_->t==Ct || a_->t==Et) // a single paragraph item or a list of items { return MSTrue; } else { return MSFalse; } } const MSSymbol& AplusPrintColumn::widgetType(void) const { return symbol(); } const MSSymbol& AplusPrintColumn::symbol(void) { static MSSymbol sym("AplusPrintColumn"); return sym; } // This function should somehow be combined with AplusPrintTool::constructBody(); they do same things void AplusPrintColumn::constructColumn(void) { ::A aItems=model()->a(); if (verifyData(model()->aplusVar(),aItems)==MSFalse) { if (dbg_tmstk) showError("Invalid `reportcolumn format",1); // print warning message return; } AplusPrintTool::constructPrintManager(this, aItems); if (aItems->t==Ct) // it's a single text item { numColumns(1); } else // it's a list or a vector of print items { if (numColumns()==0) // if the number of columns hasn't been set by the user { numColumns(aItems->n); } } } aplus-fsf-4.22/src/AplusGUI/AplusRadioBox.C0000644000265000001440000001610110772770346014072 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include extern MSBoolean isSlotFiller(A); AplusRadioButton::AplusRadioButton(MSWidget *owner_) : MSRadioButton((MSRadioBox *)owner_, "") { dynamic(MSTrue); // AplusModel *am = new AplusModel(0); // INTERNAL_COUPLE(am); } AplusRadioButton::~AplusRadioButton(void) {} void AplusRadioButton::radioBoxArm(void) { AplusRadioBox *rbox=(AplusRadioBox *)owner(); if (rbox!=0) rbox->arm(this); } void AplusRadioButton::radioBoxDisarm(void) { AplusRadioBox *rbox=(AplusRadioBox *)owner(); if (rbox!=0) rbox->disarm(); } void AplusRadioButton::radioBoxActivate(void) {} void AplusRadioButton::up(void) { if (radioBox()) radioBox()->up(); } void AplusRadioButton::down(void){ if (radioBox()) radioBox()->down(); } void AplusRadioButton::left(void){ if (radioBox()) radioBox()->left(); } void AplusRadioButton::right(void){ if (radioBox()) radioBox()->right(); } void AplusRadioButton::focusIn(void) { if (radioBox()) radioBox()->selectedItem(radioBox()->buttons().indexOf((unsigned long)(MSWidget *)this)); MSRadioButton::focusIn(); } MSBoolean AplusRadioButton::isProtected(void) const { if (radioBox()->readOnly(radioBox()->buttons().indexOf((unsigned long)(MSWidget *)this))==MSFalse && sensitive()==MSTrue) { return MSFalse; } else // readOnly()==MSTrue || sensitive()==MSFalse { return MSTrue; } } AplusRadioBox::AplusRadioBox(MSWidget *owner_) : AplusButtonBox(owner_) { _armedButton = 0;} AplusRadioBox::~AplusRadioBox(void) {} void AplusRadioBox::arm(MSRadioButton *radioButton_) { V v = ((AplusModel *) model())->aplusVar(); if (v) { disarm(); _activeButton=radioButton_; if (activeButton()!=0) activeButton()->state(MSTrue); if (armedButton()!=0) { unsigned buttonIndex = buttons().indexOf((unsigned long)armedButton()); *un((A *)(un((A *)(un((A *)(&v->a))->p+1))->p+buttonIndex))->p=0; armedButton()->state(MSFalse); _armedButton=0; } radioButton_->state(MSTrue); valueChange(radioButton_,MSTrue); } } void AplusRadioBox::disarm(void) { if (activeButton()!=0) activeButton()->state(MSFalse); _activeButton=0; } void AplusRadioBox::firstMapNotify(void) { MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; MSLayoutEntry *entry; MSRadioButton *radioButton; unsigned count=0; while ((np=np->next())!=hp) { entry=(MSLayoutEntry *)np->data(); radioButton=(MSRadioButton *)entry->widget(); if (radioButton->state()==MSTrue) { if (count==0) _activeButton=radioButton; count++; } if (count>1) radioButton->state(MSFalse); } if (count==0&&(np=np->next())!=hp) { entry=(MSLayoutEntry *)np->data(); radioButton=(MSRadioButton *)entry->widget(); radioButton->state(MSTrue); _activeButton=radioButton; } MSActionBox::firstMapNotify(); } MSActionButton *AplusRadioBox::newButton(void) { return new AplusRadioButton((MSWidget *) this); } MSBoolean AplusRadioBox::verifyData(V,A a_) { if (isSlotFiller(a_)==MSTrue) { P p; p.i=a_->p; A val=p.a[1]; A attr=p.a[0]; P pv; pv.i=val->p; int trueCount=0; if (val->t==Et&&val->n==0&&attr->t==Et&&attr->n==0) return MSTrue; for (int row=0;row<(int)val->n;row++) { if (QS(pv.a[row])) return MSFalse; else if (pv.a[row]->t!=It||pv.a[row]->r!=0) return MSFalse; else { if ((int)*pv.a[row]->p==1) trueCount++; else if ((int)*pv.a[row]->p!=0) return MSFalse; } } return (trueCount==0||trueCount>1)?MSFalse:MSTrue; } return MSFalse; } void AplusRadioBox::updateValue(int row_) { V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; if (v!=0) { AplusRadioButton *btn; P p; p.i=((AplusModel*)model())->data(); A val=(A)p.a[1]; P pv; pv.i=val->p; btn = (AplusRadioButton *)buttons()(row_); if (btn) { if (*pv.a[row_]->p==0) btn->disarm(); else { if (armedButton()!=0&&armedButton()!=btn) { unsigned buttonIndex = buttons().indexOf((unsigned long)armedButton()); *un((A *)(un((A *)(un((A *)(&v->a))->p+1))->p+buttonIndex))->p=0; /* Watch out!!! p, val and pv are not what they seem */ /* *pv.a[row(_armedBtn)]->p=0; */ armedButton()->state(MSFalse); } _armedButton=btn; btn->state(MSTrue); } } } } void AplusRadioBox::updateData(void) { if (model() && ((AplusModel*) model())->aplusVar()) { int nr=numRows(); AplusRadioButton *btn; A str; MSBoolean doMap; MSBoolean change=(childCount()==nr)?MSFalse:MSTrue; MSBoolean one = MSFalse; V v=(model()!=0)?((AplusModel*)model())->aplusVar():0; freeze(); // Set Managed WidgetVector size for (;buttons().length() < nr; buttons()<<(unsigned long)0); // remove extra buttons if (childCount()-nr>0) { int extra = childCount()-nr; for(int i = nr; i < extra+nr; i++) { ((MSWidget *)buttons()(i))->destroy(); buttons()[i] = 0; } } P p; p.i=((AplusModel*)model())->data(); A val=(A)p.a[1]; P pv; pv.i=val->p; for (int r=0;rselectColor(color(r)); btn->font(titleFont(r)); btn->background(background()); btn->foreground(titleColor(r)); str = itemLabel(r); if (isNull(str)==MSFalse) { btn->label((char *)str->p); dc(str); } setButtonState(btn,*pv.a[r]->p); btn->integerTag(r); if (*pv.a[r]->p==1&&one==MSFalse) { _armedButton=btn; btn->state(MSTrue); one=MSTrue; } else if (*pv.a[r]->p==1) { *un((A *)(un((A *)(un((A *)(&v->a))->p+1))->p+r))->p=0; p.i=((AplusModel*)model())->data(); val=(A)p.a[1]; pv.i=val->p; btn->state(MSFalse); } else btn->state(MSFalse); if (doMap==MSTrue && btn->mapped()==MSFalse) btn->map(); } if (change==MSTrue) naturalSize(); unfreeze(); } } void AplusRadioBox::setButtonState(MSActionButton *btn_, unsigned long val_) { AplusRadioButton *abtn = (AplusRadioButton *) btn_; if (abtn) (val_==0)?abtn->setDisarmState():abtn->setArmState(); } void AplusRadioBox::updateForeground(unsigned long) { for (int i = 0; i < buttons().length(); i++) { AplusRadioButton *btn = (AplusRadioButton *) (MSWidget *)buttons()(i); if (btn) btn->selectColor(color(i)); } } const MSSymbol& AplusRadioBox::widgetType(void) const { return symbol(); } const MSSymbol& AplusRadioBox::symbol(void) { static MSSymbol sym("AplusRadioBox"); return sym; } aplus-fsf-4.22/src/AplusGUI/AplusPrintText.C0000644000265000001440000000443410772770346014332 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include "AplusPrintText.H" static const unsigned EnumHashTableSize = 128; MSHashTable AplusPrintText::_stringEnumHashTable(EnumHashTableSize); MSHashTable AplusPrintText::_enumHashTable(EnumHashTableSize); MSBoolean AplusPrintText::_initialized = MSFalse; AplusPrintText::AplusPrintText(void) { if (_initialized == MSFalse) { _initialized = MSTrue; initEnumHashTable(); initStringEnumHashTable(); } } AplusPrintText::~AplusPrintText(void) {} void AplusPrintText::initEnumHashTable(void) { enumHashTable()->notFound((int)0); enumHashTable()->add("Evenpage" ,(void*)EvenPage); enumHashTable()->add("oddpage" ,(void*)OddPage); enumHashTable()->add("evenpage" ,(void*)EvenPage); enumHashTable()->add("diagonal" ,(void*)Diagonal); enumHashTable()->add("repetitive" ,(void*)Repetitive); } void AplusPrintText::initStringEnumHashTable(void) { stringEnumHashTable()->notFound((int)0); stringEnumHashTable()->add(EveryPage, (void*)"everypage"); stringEnumHashTable()->add(OddPage, (void*)"oddpage"); stringEnumHashTable()->add(EvenPage, (void*)"evenpage"); stringEnumHashTable()->add(Diagonal, (void*)"diagonal"); stringEnumHashTable()->add(Repetitive, (void*)"repetitive"); } ::A AplusPrintText::convertMode(unsigned long mode_) { ::A r=aplus_nl; int i,j,s=0,count=0; char *str; for (i=2; i<=MSBottom; i*=2) { if (stringEnumHashTable()->lookup((unsigned long)(mode_&i))!=0) count++; } if (count>0) { r=gv(Et,count); for (j=0,i=2; i<=MSBottom; i*=2) { if ((str=(char *)stringEnumHashTable()->lookup((unsigned long)(mode_&i)))!=0) r->p[j++]=MS(si(str)); } } return r; } unsigned long AplusPrintText::convertMode(::A sym_) { unsigned long mode=0; if (sym_!=0) { ::A *p=(::A *)sym_->p; for (int i=0; i<(int)sym_->n; i++) { if (QS(p[i])) mode|=(unsigned long)enumHashTable()->lookup((char *)XS(sym_->p[i])->n); } } return mode; } aplus-fsf-4.22/src/AplusGUI/AplusPrintTool.C0000644000265000001440000004244210772770346014324 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include extern long dbg_tmstk; AplusPrintTool::AplusPrintTool(MSWidget *owner_) : MSWidgetView(owner_), MSPrintTool(), _headers(aplus_nl), _footers(aplus_nl), _banner(aplus_nl), _pageNumber(aplus_nl) { AplusModel *am=new AplusModel(0); INTERNAL_COUPLE(am); } AplusPrintTool::~AplusPrintTool(void) { dc(_headers); dc(_footers); dc(_banner); dc(_pageNumber); } void AplusPrintTool::addSenderNotify(MSEventSender *sender_) { INTERNAL_COUPLE(((AplusModel *)sender_)); } void AplusPrintTool::receiveEvent(MSEvent &event_) { if (event_.type()==AplusEvent::symbol()) { if (dbg_tmstk) showError("Received UpdateEvent in AplusPrintTool",2); // print info message } if (event_.type()==AplusVerifyEvent::symbol()) { if (dbg_tmstk) showError("Received VerifyEvent in AplusPrintTool",2); // print info message AplusVerifyEvent *ave = (AplusVerifyEvent *)&event_; ave->result(verifyData(ave->aplusVar(), ave->a())); } } MSBoolean AplusPrintTool::verifyData(V v_, ::A a_) { if (a_==0) { return MSFalse; } else if (a_->t==Ct || a_->t==Et) // a single paragraph item or a list of items { return MSTrue; } else { return MSFalse; } } void AplusPrintTool::constructReport(void) { removeAllHeaders(); constructHeaders(); removeAll(); constructBody(); removeAllFooters(); constructFooters(); constructBanner(); constructPageNumber(); } void AplusPrintTool::constructBody(void) { V v=model()->aplusVar(); ::A a=model()->a(); if (verifyData(v,a)==MSFalse) { if (dbg_tmstk) showError("Invalid report format"); // print error message return; } constructPrintManager(this, a); } void AplusPrintTool::constructPrintManager(MSPrintManager *pManager_, ::A aItems_) { if (aItems_->t==Ct) // it's a single text item { pManager_->addParagraph(AplusConvert::asMSStringVector(aItems_)); } else // it's a list or vector of print items { int i, n=aItems_->n; ::A *p=(::A *)aItems_->p; for (i=0; it) { case Ct: pManager_->addParagraph(AplusConvert::asMSStringVector(aItem_)); break; case Et: if (isNull(aItem_)==MSTrue) // null item => this is a page break { pManager_->addPageBreak(); } else if (aItem_->n==1 && QS(*aItem_->p)) // this is a single print item { constructPrintItem(pManager_, (S)XS(*aItem_->p)); } else // this is a print column { if (AplusPrintColumn::verifyData(0,aItem_)==MSFalse) { if (dbg_tmstk) showError("Invalid print column format in report",1); // print warning message return; } MSPrintColumn *pColumn = new MSPrintColumn(pManager_, aItem_->n); constructPrintManager(pColumn, aItem_); } break; default: if (dbg_tmstk) showError("Invalid print item format in report",1); // print warning message break; } } void AplusPrintTool::constructPrintItem(MSPrintManager *pManager_, S sym_) { if (sym_==si("")) // empty symbol => this is a page break { pManager_->addPageBreak(); } else // handle all other print items { V vItem = (V)getVFromSym(Cx,sym_); // if no V is present for sym_, a dummy one will be created for it //ASSERTION: vItem!=0 if (vItem->attr!=0) { MSWidgetView *printItem = ((AVariableData *)vItem->attr)->pWidgetView(); // This situation (vItem->attr!=0, but printItem==0) can happen if there has been an attempt to // bind the variable to a non-existing widget class. In that case, attr member would be created // for the A+ variable, but _pWidgetView pointer would be zero. This seems to be a side effect // of s.is function in A+ and should probably be addressed there, but for the time being we'll // fix it here. // if (printItem==0) { if (dbg_tmstk) { MSString err("`"); err << sym_->n << " has not been bound to any print item class"; showError(err.string(),1); // print warning message } return; } const MSSymbol& type(printItem->widgetType()); // check for the type of the print item and add it to the print manager if (type==AplusParagraph::symbol()) { AplusParagraph& paragraph = *(AplusParagraph *)printItem; // ASSERTION: paragraph's model and A object are valid paragraph.text(AplusConvert::asMSStringVector(paragraph.model()->a())); // set the paragraph's text pManager_->addParagraph(paragraph); } else if (type==AplusPrintColumn::symbol()) { AplusPrintColumn *pColumn=(AplusPrintColumn *)printItem; pManager_->addPrintItem(pColumn); pColumn->removeAll(); pColumn->constructColumn(); } else if (type==AplusTable::symbol()) { pManager_->addPrintItem((AplusTable *)printItem); } else if (type==AplusGraph::symbol()) { AplusGraph *pGraph = (AplusGraph *)printItem; // clear the print width to fix a bug in MStk (version 2.5.3), where width calculations get // screwed up if graph is in a print column and the column widths are changed pGraph->printWidth(0); pManager_->addPrintItem(pGraph); } else if (type==AplusRulePrintItem::symbol()) { // MStk does not allow the same print item to be used in several places in a report; // since a rule item is something that one may want reuse, create a new one every time pManager_->addPrintItem(new AplusRulePrintItem(*(AplusRulePrintItem *)printItem)); } else { if (dbg_tmstk) { MSString err("`"); err << sym_->n << " has invalid print item type"; showError(err.string(),1); // print warning message } } } else { if (dbg_tmstk) { MSString err("`"); err << sym_->n << " has not been bound to any print item class"; showError(err.string(),1); // print warning message } } } } void AplusPrintTool::constructHeaders(void) { if (verifyData(getVfromA(_headers),_headers)==MSFalse) // should we have a separate function, verifyHeaders()? { if (dbg_tmstk) showError("Invalid header format in report",1); // print warning message return; } if (_headers->t==Ct) // it's a single text item { addHeader(AplusConvert::asMSStringVector(_headers)); } else // it's a list or vector of print items { int i, n=_headers->n; ::A *p=(::A *)_headers->p; ::A aItem; for (i=0; it==Ct) // a paragraph item { addHeader(AplusConvert::asMSStringVector(aItem)); } else if (aItem->t==Et) { if (isNull(aItem)==MSFalse) { if (aItem->n==1 && QS(*aItem->p)) // a single print item { constructHeaderItem((S)XS(*aItem->p)); } else // a print column { MSPrintColumn *pColumn = new MSPrintColumn(aItem->n); addHeader(pColumn); constructPrintManager(pColumn, aItem); } } } } else if (QS(aItem)) { constructHeaderItem((S)XS(aItem)); } } } } void AplusPrintTool::constructHeaderItem(S sym_) { V vItem = (V)getVFromSym(Cx,sym_); //ASSERTION: vItem!=0 if (vItem->attr!=0) { MSWidgetView *printItem = ((AVariableData *)vItem->attr)->pWidgetView(); // See the comment in a simliar section of code in constructPrintItem() method for explanation // of why we need to check for null widget pointer here if (printItem==0) { if (dbg_tmstk) { MSString err("The header item `"); err << sym_->n << " has not been bound to any class"; showError(err.string(),1); // print warning message } return; } const MSSymbol& type(printItem->widgetType()); // check for the type of the print item and add it as a header if (type==AplusParagraph::symbol()) { AplusParagraph& paragraph = *(AplusParagraph *)printItem; // ASSERTION: paragraph's model and A object are valid paragraph.text(AplusConvert::asMSStringVector(paragraph.model()->a())); // set the paragraph's text addHeader(paragraph); } else if (type==AplusPrintColumn::symbol()) { AplusPrintColumn *pColumn=(AplusPrintColumn *)printItem; addHeader(pColumn); pColumn->removeAll(); pColumn->constructColumn(); } else if (type==AplusRulePrintItem::symbol()) { // currently, as of version 2.5.3 of MStk, a rule item cannot be used as a header or footer; // this will be fixed in MStk 2.6; for now we fake it here by creating a column with a single rule item // inside, but this will have to be synch'ed up with MStk when 2.6 comes out MSPrintColumn *pColumn = new MSPrintColumn(1); pColumn->addPrintItem(new AplusRulePrintItem(*(AplusRulePrintItem *)printItem)); addHeader(pColumn); } else { if (dbg_tmstk) { MSString err("The header item `"); err << sym_->n << " has invalid type"; showError(err.string(),1); // print warning message } } } else { if (dbg_tmstk) { MSString err("The header item `"); err << sym_->n << " has not been bound to any class"; showError(err.string(),1); // print warning message } } } void AplusPrintTool::constructFooters(void) { if (verifyData(getVfromA(_footers),_footers)==MSFalse) // should we have a separate function, verifyFooters()? { if (dbg_tmstk) showError("Invalid footer format in report",1); // print warning message return; } if (_footers->t==Ct) // it's a single text item { addFooter(AplusConvert::asMSStringVector(_footers)); } else // it's a list or vector of print items { int i, n=_footers->n; ::A *p=(::A *)_footers->p; ::A aItem; for (i=0; it==Ct) // a paragraph item { addFooter(AplusConvert::asMSStringVector(aItem)); } else if (aItem->t==Et) { if (isNull(aItem)==MSFalse) { if (aItem->n==1 && QS(*aItem->p)) // a single print item { constructFooterItem((S)XS(*aItem->p)); } else // a print column { MSPrintColumn *pColumn = new MSPrintColumn(aItem->n); addFooter(pColumn); constructPrintManager(pColumn, aItem); } } } } else if (QS(aItem)) { constructFooterItem((S)XS(aItem)); } } } } void AplusPrintTool::constructFooterItem(S sym_) { V vItem = (V)getVFromSym(Cx,sym_); //ASSERTION: vItem!=0 if (vItem->attr!=0) { MSWidgetView *printItem = ((AVariableData *)vItem->attr)->pWidgetView(); // See the comment in a simliar section of code in constructPrintItem() method for explanation // of why we need to check for null widget pointer here if (printItem==0) { if (dbg_tmstk) { MSString err("The footer item `"); err << sym_->n << " has not been bound to any class"; showError(err.string(),1); // print warning message } return; } const MSSymbol& type(printItem->widgetType()); // check for the type of the print item and add it as a footer if (type==AplusParagraph::symbol()) { AplusParagraph& paragraph = *(AplusParagraph *)printItem; // ASSERTION: paragraph's model and A object are valid paragraph.text(AplusConvert::asMSStringVector(paragraph.model()->a())); // set the paragraph's text addFooter(paragraph); } else if (type==AplusPrintColumn::symbol()) { AplusPrintColumn *pColumn=(AplusPrintColumn *)printItem; addFooter(pColumn); pColumn->removeAll(); pColumn->constructColumn(); } else if (type==AplusRulePrintItem::symbol()) { // currently, as of version 2.5.3 of MStk, a rule item cannot be used as a header or footer; // this will be fixed in MStk 2.6; for now we fake it here by creating a column with a single rule item // inside, but this will have to be synch'ed up with MStk when 2.6 comes out MSPrintColumn *pColumn = new MSPrintColumn(1); pColumn->addPrintItem(new AplusRulePrintItem(*(AplusRulePrintItem *)printItem)); addFooter(pColumn); } else { if (dbg_tmstk) { MSString err("The footer `"); err << sym_->n << " has invalid type"; showError(err.string(),1); // print warning message } } } else { if (dbg_tmstk) { MSString err("The footer item `"); err << sym_->n << " has not been bound to any class"; showError(err.string(),1); // print warning message } } } void AplusPrintTool::constructBanner(void) { V vBanner=getVfromA(_banner); if (verifyData(vBanner,_banner)==MSFalse) // should we have a separate function verifyBanner()? { if (dbg_tmstk) showError("Invalid banner format in report",1); // warning return; } if (_banner->n==1 && _banner->t==Et && QS(*_banner->p)) // it's a single paragraph { S sym=(S)XS(*_banner->p); V v = (V)getVFromSym(Cx,sym); //ASSERTION: vItem!=0 if (v->attr!=0) { MSWidgetView *printItem = ((AVariableData *)v->attr)->pWidgetView(); // See the comment in a simliar section of code in constructPrintItem() method for explanation // of why we need to check for null widget pointer here if (printItem==0) { if (dbg_tmstk) { MSString err("The banner `"); err << sym->n << " has not been bound to reportparagraph"; showError(err.string(),1); // print warning message } return; } // check for the type of the print item and add it as a banner if (printItem->widgetType()==AplusParagraph::symbol()) { AplusParagraph& paragraph = *(AplusParagraph *)printItem; // ASSERTION: paragraph's model and A object are valid paragraph.text(AplusConvert::asMSStringVector(paragraph.model()->a())); // set the paragraph's text MSPrintTool::banner(paragraph); } else { if (dbg_tmstk) { MSString err("The banner `"); err << sym->n << " is not bound to reportparagraph"; showError(err.string(),1); // print warning message } } } else { if (dbg_tmstk) { MSString err("The banner `"); err << sym->n << " has not been bound to reportparagraph"; showError(err.string(),1); // print warning message } } } else { MSStringVector b(AplusConvert::asMSStringVector(_banner)); MSPrintTool::banner(b); } } void AplusPrintTool::constructPageNumber(void) { V vPageNumber=getVfromA(_pageNumber); if (verifyData(vPageNumber,_pageNumber)==MSFalse) // should we have a separate function verifyPageNumber()? { if (dbg_tmstk) showError("Invalid page number format in report",1); return; } if (_pageNumber->n==1 && _pageNumber->t==Et && QS(*_pageNumber->p)) // it's a single paragraph { S sym=(S)XS(*_pageNumber->p); V v = (V)getVFromSym(Cx,sym); //ASSERTION: vItem!=0 if (v->attr!=0) { MSWidgetView *printItem = ((AVariableData *)v->attr)->pWidgetView(); // See the comment in a simliar section of code in constructPrintItem() method for explanation // of why we need to check for null widget pointer here if (printItem==0) { if (dbg_tmstk) { MSString err("The page number `"); err << sym->n << " has not been bound to reportparagraph"; showError(err.string(),1); // print warning message } return; } // check for the type of the print item and add it as a pageNumber if (printItem->widgetType()==AplusParagraph::symbol()) { AplusParagraph& paragraph = *(AplusParagraph *)printItem; // ASSERTION: paragraph's model and A object are valid paragraph.text(AplusConvert::asMSStringVector(paragraph.model()->a())); // set the paragraph's text MSPrintTool::pageNumber(paragraph); } else { if (dbg_tmstk) { MSString err("The page number `"); err << sym->n << " is not bound to reportparagraph"; showError(err.string(),1); // print warning message } } } else { if (dbg_tmstk) { MSString err("The page number `"); err << sym->n << " has not been bound to reportparagraph"; showError(err.string(),1); // print warning message } } } else { MSStringVector b(AplusConvert::asMSStringVector(_pageNumber)); MSPrintTool::pageNumber(b); } } const MSSymbol& AplusPrintTool::widgetType(void) const { return symbol(); } const MSSymbol& AplusPrintTool::symbol(void) { static MSSymbol sym("AplusPrintTool"); return sym; } aplus-fsf-4.22/src/AplusGUI/AplusReference.C0000644000265000001440000000245110772770346014264 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include extern long dbg_tmstk; AplusReference::AplusReference(MSWidget *owner_) : MSWidgetCommon(owner_) { visible(MSTrue); AplusModel *am=new AplusModel(0); INTERNAL_COUPLE(am); } AplusReference::~AplusReference(void) {} void AplusReference::addSenderNotify(MSEventSender *m_) { INTERNAL_COUPLE(((AplusModel *) m_)); } void AplusReference::receiveEvent(MSEvent &event_) { if (event_.type() == AplusEvent::symbol()) { if (dbg_tmstk) cout << "Received UpdateEvent in AplusReference" << endl; redraw(); } if (event_.type() == AplusVerifyEvent::symbol()) { if (dbg_tmstk) cout << "Received VerifyEvent in AplusReference" << endl; AplusVerifyEvent *ave = (AplusVerifyEvent *) &event_; ave->result(verifyData(ave->aplusVar(), ave->a())); } } const MSSymbol& AplusReference::widgetType(void) const { return symbol(); } const MSSymbol& AplusReference::symbol(void) { static MSSymbol sym("AplusReference"); return sym; } aplus-fsf-4.22/src/AplusGUI/AplusReportAlgo.C0000644000265000001440000001131110772770346014437 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include "AplusReportAlgo.H" #include AplusReportSumAlgorithm *AplusReportSumAlgorithm::_reportSum=0; AplusReportMaxAlgorithm *AplusReportMaxAlgorithm::_reportMax=0; AplusReportMinAlgorithm *AplusReportMinAlgorithm::_reportMin=0; AplusReportAvgAlgorithm *AplusReportAvgAlgorithm::_reportAvg=0; AplusReportStdDevAlgorithm *AplusReportStdDevAlgorithm::_reportStdDev=0; AplusReportVarianceAlgorithm *AplusReportVarianceAlgorithm::_reportVariance=0; AplusReportMedianAlgorithm *AplusReportMedianAlgorithm::_reportMedian=0; AplusReportAlgorithm::AplusReportAlgorithm(void) {} AplusReportAlgorithm::~AplusReportAlgorithm(void) {} MSFloatVector AplusReportAlgorithm::convert(A vals_, int begin_, int end_) { MSFloatVector result; if (QA(vals_)&&(vals_->t==It || vals_->t==Ft)&&vals_->n>0) { P p; p.i = vals_->p; if (begin_==-1||end_==-1) { begin_=0; end_=vals_->n; } for (int j=begin_; jt) { case It: result << (double) p.i[j]; break; case Ft: result << p.f[j]; break; } } } return result; } AplusReportSumAlgorithm::AplusReportSumAlgorithm(void) {} AplusReportSumAlgorithm::~AplusReportSumAlgorithm(void) { if (_reportSum!=0) delete _reportSum; } double AplusReportSumAlgorithm::computeValue(A vals_, int begin_, int end_) { MSFloatVector fv = convert(vals_,begin_,end_); return fv.sum(); } AplusReportSumAlgorithm *AplusReportSumAlgorithm::reportSum(void) { if (_reportSum == 0) _reportSum = new AplusReportSumAlgorithm; return _reportSum; } AplusReportMaxAlgorithm::AplusReportMaxAlgorithm(void) {} AplusReportMaxAlgorithm::~AplusReportMaxAlgorithm(void) { if (_reportMax!=0) delete _reportMax; } double AplusReportMaxAlgorithm::computeValue(A vals_, int begin_, int end_) { MSFloatVector fv = convert(vals_,begin_,end_); return fv.max(); } AplusReportMaxAlgorithm *AplusReportMaxAlgorithm::reportMax(void) { if (_reportMax == 0) _reportMax = new AplusReportMaxAlgorithm; return _reportMax; } AplusReportMinAlgorithm::AplusReportMinAlgorithm(void) {} AplusReportMinAlgorithm::~AplusReportMinAlgorithm(void) { if (_reportMin!=0) delete _reportMin; } double AplusReportMinAlgorithm::computeValue(A vals_, int begin_, int end_) { MSFloatVector fv = convert(vals_,begin_,end_); return fv.min(); } AplusReportMinAlgorithm *AplusReportMinAlgorithm::reportMin(void) { if (_reportMin == 0) _reportMin = new AplusReportMinAlgorithm; return _reportMin; } AplusReportAvgAlgorithm::AplusReportAvgAlgorithm(void) {} AplusReportAvgAlgorithm::~AplusReportAvgAlgorithm(void) { if (_reportAvg!=0) delete _reportAvg; } double AplusReportAvgAlgorithm::computeValue(A vals_, int begin_, int end_) { MSFloatVector fv = convert(vals_,begin_,end_); return fv.avg(); } AplusReportAvgAlgorithm *AplusReportAvgAlgorithm::reportAvg(void) { if (_reportAvg == 0) _reportAvg = new AplusReportAvgAlgorithm; return _reportAvg; } AplusReportStdDevAlgorithm::AplusReportStdDevAlgorithm(void) {} AplusReportStdDevAlgorithm::~AplusReportStdDevAlgorithm(void) { if (_reportStdDev!=0) delete _reportStdDev; } double AplusReportStdDevAlgorithm::computeValue(A vals_, int begin_, int end_) { MSFloatVector fv = convert(vals_,begin_,end_); return fv.stdDeviation(); } AplusReportStdDevAlgorithm *AplusReportStdDevAlgorithm::reportStdDev(void) { if (_reportStdDev == 0) _reportStdDev = new AplusReportStdDevAlgorithm; return _reportStdDev; } AplusReportVarianceAlgorithm::AplusReportVarianceAlgorithm(void) {} AplusReportVarianceAlgorithm::~AplusReportVarianceAlgorithm(void) { if (_reportVariance!=0) delete _reportVariance; } double AplusReportVarianceAlgorithm::computeValue(A vals_, int begin_, int end_) { MSFloatVector fv = convert(vals_,begin_,end_); return fv.variance(); } AplusReportVarianceAlgorithm *AplusReportVarianceAlgorithm::reportVariance(void) { if (_reportVariance == 0) _reportVariance = new AplusReportVarianceAlgorithm; return _reportVariance; } AplusReportMedianAlgorithm::AplusReportMedianAlgorithm(void) {} AplusReportMedianAlgorithm::~AplusReportMedianAlgorithm(void) { if (_reportMedian!=0) delete _reportMedian; } double AplusReportMedianAlgorithm::computeValue(A vals_, int begin_, int end_) { MSFloatVector fv = convert(vals_,begin_,end_); return fv.median(); } AplusReportMedianAlgorithm *AplusReportMedianAlgorithm::reportMedian(void) { if (_reportMedian == 0) _reportMedian = new AplusReportMedianAlgorithm; return _reportMedian; } aplus-fsf-4.22/src/AplusGUI/AplusReportEnum.C0000644000265000001440000002507710772770346014477 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include const AplusHashTable& AplusReportCompModeConverter::enumTable(void) const { static int initialized=0; static AplusHashTable table(8); if (initialized==0) { table.notFound((unsigned long)0x5f5f5f); table.add("sum", (void *)AplusReportAlgorithm::Sum); table.add("min", (void *)AplusReportAlgorithm::Min); table.add("max", (void *)AplusReportAlgorithm::Max); table.add("avg", (void *)AplusReportAlgorithm::Avg); table.add("stddev", (void *)AplusReportAlgorithm::StdDev); table.add("variance", (void *)AplusReportAlgorithm::Variance); initialized = 1; } return table; } const AplusHashTable& AplusReportCompModeConverter::stringTable(void) const { static int initialized=0; static AplusHashTable table(8); if (initialized==0) { table.notFound((unsigned long)0); table.add(AplusReportAlgorithm::Sum, (void *)"sum"); table.add(AplusReportAlgorithm::Min, (void *)"min"); table.add(AplusReportAlgorithm::Max, (void *)"max"); table.add(AplusReportAlgorithm::Avg, (void *)"avg"); table.add(AplusReportAlgorithm::StdDev, (void *)"stddev"); table.add(AplusReportAlgorithm::Variance, (void *)"variance"); initialized = 1; } return table; } const char *AplusReportCompModeConverter::type(void) const { return "compmode"; } const AplusHashTable& AplusReportOccurrenceConverter::enumTable(void) const { static int initialized=0; static AplusHashTable table(8); if (initialized==0) { table.notFound((unsigned long)0x5f5f5f); table.add("everypage", (void *)MSP::EveryPage); table.add("oddpage", (void *)MSP::OddPage); table.add("evenpage", (void *)MSP::EvenPage); table.add("firstpage", (void *)MSP::FirstPage); table.add("lastpage", (void *)MSP::LastPage); table.add("anybutfirstandlast", (void *)MSP::AnyButFirstAndLast); table.add("diagonal", (void *)MSP::Diagonal); initialized = 1; } return table; } const AplusHashTable& AplusReportOccurrenceConverter::stringTable(void) const { static int initialized=0; static AplusHashTable table(8); if (initialized==0) { table.notFound((unsigned long)0); table.add(MSP::EveryPage, (void *)"everypage"); table.add(MSP::OddPage, (void *)"oddpage"); table.add(MSP::EvenPage, (void *)"evenpage"); table.add(MSP::FirstPage, (void *)"firstpage"); table.add(MSP::LastPage, (void *)"lastpage"); table.add(MSP::AnyButFirstAndLast, (void *)"anybutfirstandlast"); table.add(MSP::Diagonal, (void *)"diagonal"); initialized = 1; } return table; } const char *AplusReportOccurrenceConverter::type(void) const { return "reportoccurrence"; } const AplusHashTable& AplusReportStyleConverter::enumTable(void) const { static int initialized=0; static AplusHashTable table(16); if (initialized==0) { table.notFound((unsigned long)0x5f5f5f); table.add("none", (void *)MSNone); table.add("dunderline", (void *)MSP::Underline); table.add("dul", (void *)MSP::DUnderline); table.add("superscript", (void *)MSP::Superscript); table.add("subscript", (void *)MSP::Subscript); table.add("outline", (void *)MSP::Outline); table.add("smallcap", (void *)MSP::Smallcap); table.add("strikethru", (void *)MSP::Strikethru); table.add("boxl", (void *)MSP::BoxL); table.add("boxr", (void *)MSP::BoxR); table.add("boxt", (void *)MSP::BoxT); table.add("boxb", (void *)MSP::BoxB); table.add("box", (void *)MSP::Box); table.add("cell", (void *)MSP::Cell); table.add("stipple", (void *)MSP::Stipple); initialized = 1; } return table; } const AplusHashTable& AplusReportStyleConverter::stringTable(void) const { static int initialized=0; static AplusHashTable table(16); if (initialized==0) { table.notFound((unsigned long)0); table.add((unsigned long)MSNone, (void *)"none"); table.add(MSP::Underline, (void *)"underline"); table.add(MSP::DUnderline, (void *)"dunderline"); table.add(MSP::Superscript, (void *)"superscript"); table.add(MSP::Subscript, (void *)"subscript"); table.add(MSP::Outline, (void *)"outline"); table.add(MSP::Smallcap, (void *)"smallcap"); table.add(MSP::Strikethru, (void *)"strikethru"); table.add(MSP::BoxL, (void *)"boxl"); table.add(MSP::BoxR, (void *)"boxr"); table.add(MSP::BoxT, (void *)"boxt"); table.add(MSP::BoxB, (void *)"boxb"); table.add(MSP::Box, (void *)"box"); table.add(MSP::Cell, (void *)"cell"); table.add(MSP::Stipple, (void *)"stipple"); initialized = 1; } return table; } const char *AplusReportStyleConverter::type(void) const { return "reportstyle"; } const AplusHashTable& AplusReportPageOrientationConverter::enumTable(void) const { static int initialized=0; static AplusHashTable table(8); if (initialized==0) { table.notFound((unsigned long)0x5f5f5f); table.add("portrait", (void *)MSP::Portrait); table.add("landscape", (void *)MSP::Landscape); table.add("upsidedown", (void *)MSP::UpsideDown); table.add("seascape", (void *)MSP::Seascape); table.add("default", (void *)MSP::Default); initialized = 1; } return table; } const AplusHashTable& AplusReportPageOrientationConverter::stringTable(void) const { static int initialized=0; static AplusHashTable table(8); if (initialized==0) { table.notFound((unsigned long)0); table.add(MSP::Portrait, (void *)"portrait"); table.add(MSP::Landscape, (void *)"landscape"); table.add(MSP::UpsideDown, (void *)"upsidedown"); table.add(MSP::Seascape, (void *)"seascape"); table.add(MSP::Default, (void *)"default"); initialized = 1; } return table; } const char *AplusReportPageOrientationConverter::type(void) const { return "pageorientation"; } const AplusHashTable& AplusReportPageSizeConverter::enumTable(void) const { static int initialized=0; static AplusHashTable table(8); if (initialized==0) { table.notFound((unsigned long)0x5f5f5f); table.add("letter", (void *)MSP::Letter); table.add("legal", (void *)MSP::Legal); table.add("a4", (void *)MSP::A4); table.add("b5", (void *)MSP::B5); table.add("a", (void *)MSP::A); table.add("b", (void *)MSP::B); initialized = 1; } return table; } const AplusHashTable& AplusReportPageSizeConverter::stringTable(void) const { static int initialized=0; static AplusHashTable table(8); if (initialized==0) { table.notFound((unsigned long)0); table.add(MSP::Letter, (void *)"letter"); table.add(MSP::Legal, (void *)"legal"); table.add(MSP::A4, (void *)"a4"); table.add(MSP::B5, (void *)"b5"); table.add(MSP::A, (void *)"a"); table.add(MSP::B, (void *)"b"); initialized = 1; } return table; } const char *AplusReportPageSizeConverter::type(void) const { return "pagesize"; } const AplusHashTable& AplusReportOutputModeConverter::enumTable(void) const { static int initialized=0; static AplusHashTable table(4); if (initialized==0) { table.notFound((unsigned long)0x5f5f5f); table.add("ps", (void *)MSP::PS); table.add("eps", (void *)MSP::EPS); table.add("ppm", (void *)MSP::PPM); table.add("ascii", (void *)MSP::ASCII); initialized = 1; } return table; } const AplusHashTable& AplusReportOutputModeConverter::stringTable(void) const { static int initialized=0; static AplusHashTable table(4); if (initialized==0) { table.notFound((unsigned long)0); table.add(MSP::PS, (void *)"ps"); table.add(MSP::EPS, (void *)"eps"); table.add(MSP::PPM, (void *)"ppm"); table.add(MSP::ASCII, (void *)"ascii"); initialized = 1; } return table; } const char *AplusReportOutputModeConverter::type(void) const { return "outputmode"; } const AplusHashTable& AplusReportDisclaimerStyleConverter::enumTable(void) const { static int initialized=0; static AplusHashTable table(8); if (initialized==0) { table.notFound((unsigned long)0x5f5f5f); table.add("text", (void *)MSP::Text); table.add("rule", (void *)MSP::Rule); table.add("toprule", (void *)MSP::Toprule); table.add("appendbox", (void *)MSP::AppendBox); table.add("append", (void *)MSP::Append); table.add("box", (void *)MSP::Box); table.add("none", (void *)MSP::NoDisclaimer); initialized = 1; } return table; } const AplusHashTable& AplusReportDisclaimerStyleConverter::stringTable(void) const { static int initialized=0; static AplusHashTable table(8); if (initialized==0) { table.notFound((unsigned long)0); table.add(MSP::Text, (void *)"text"); table.add(MSP::Rule, (void *)"rule"); table.add(MSP::Toprule, (void *)"toprule"); table.add(MSP::AppendBox, (void *)"appendbox"); table.add(MSP::Append, (void *)"append"); table.add(MSP::Box, (void *)"box"); table.add(MSP::NoDisclaimer, (void *)"none"); initialized = 1; } return table; } const char *AplusReportDisclaimerStyleConverter::type(void) const { return "disclaimerstyle"; } const AplusHashTable& AplusReportPrintModeConverter::enumTable(void) const { static int initialized=0; static AplusHashTable table(4); if (initialized==0) { table.notFound((unsigned long)0x5f5f5f); table.add("mono", (void *)MSP::Mono); table.add("color", (void *)MSP::Color); table.add("colorfg", (void *)MSP::Colorfg); table.add("reverse", (void *)MSP::Reverse); initialized = 1; } return table; } const AplusHashTable& AplusReportPrintModeConverter::stringTable(void) const { static int initialized=0; static AplusHashTable table(4); if (initialized==0) { table.notFound((unsigned long)0); table.add(MSP::Mono, (void *)"mono"); table.add(MSP::Color, (void *)"color"); table.add(MSP::Colorfg, (void *)"colorfg"); table.add(MSP::Reverse, (void *)"reverse"); initialized = 1; } return table; } const char *AplusReportPrintModeConverter::type(void) const { return "printmode"; } aplus-fsf-4.22/src/AplusGUI/AplusRulePrintItem.C0000644000265000001440000000327510772770346015136 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include extern long dbg_tmstk; AplusRulePrintItem::AplusRulePrintItem(MSWidget *owner_) : MSWidgetView(owner_), MSRulePrintItem() { AplusModel *am=new AplusModel(0); INTERNAL_COUPLE(am); } // MSRulePrintItem does not currently have a copy constructor, so just emulate it here for now AplusRulePrintItem::AplusRulePrintItem(const AplusRulePrintItem& rule_) : MSWidgetView(), MSRulePrintItem(rule_) { ruleWidth(rule_.ruleWidth()); fgGrayScale(rule_.fgGrayScale()); } AplusRulePrintItem::~AplusRulePrintItem(void) {} void AplusRulePrintItem::addSenderNotify(MSEventSender *sender_) { INTERNAL_COUPLE(((AplusModel *)sender_)); } void AplusRulePrintItem::receiveEvent(MSEvent &event_) { if (event_.type()==AplusEvent::symbol()) { if (dbg_tmstk) showError("Received UpdateEvent in AplusRulePrintItem",2); // print info message } if (event_.type()==AplusVerifyEvent::symbol()) { if (dbg_tmstk) showError("Received VerifyEvent in AplusRulePrintItem",2); // print info message AplusVerifyEvent *ave = (AplusVerifyEvent *)&event_; ave->result(verifyData(ave->aplusVar(), ave->a())); } } MSBoolean AplusRulePrintItem::verifyData(V v_, ::A a_) { return MSTrue; } const MSSymbol& AplusRulePrintItem::widgetType(void) const { return symbol(); } const MSSymbol& AplusRulePrintItem::symbol(void) { static MSSymbol sym("AplusRulePrintItem"); return sym; } aplus-fsf-4.22/src/AplusGUI/AplusScale.C0000644000265000001440000001042010772770346013410 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include extern long dbg_tmstk; extern void busyEnable(MSBoolean); extern MSBoolean busyEnable(void); #define SliderMethodsMacro(AplusSliderType, Type) \ \ AplusFormatter AplusSliderType::_outFormat;\ \ AplusSliderType::AplusSliderType(MSWidget *owner_) : Type(owner_)\ {\ }\ \ AplusSliderType::~AplusSliderType(void)\ {}\ \ void AplusSliderType::receiveEvent(MSEvent &event_)\ {\ if (event_.type() == AplusEvent::symbol())\ {\ if (dbg_tmstk) cout << "Received UpdateEvent in AplusSliderType" << endl;\ update(MSIndexVector::nullVector());\ }\ if (event_.type() == AplusVerifyEvent::symbol())\ {\ if (dbg_tmstk) cout << "Received VerifyEvent in AplusSliderType" << endl;\ \ AplusVerifyEvent *ave = (AplusVerifyEvent *) &event_;\ ave->result(verifyData(ave->aplusVar(), ave->a()));\ }\ }\ \ void AplusSliderType::addSenderNotify(MSEventSender *m_)\ {\ INTERNAL_COUPLE(((AplusModel *) m_));\ }\ \ double AplusSliderType::currentValue(void) const \ {\ /* this method should never be called from within aplus */ \ return 0.0;\ }\ \ double AplusSliderType::currentValue(void)\ {\ double x=0;\ \ if (model() && model()->aplusVar()!=0)\ {\ A av=(A)model()->aplusVar()->a; \ if (av->r==0&&av->n==1) \ {\ P p; p.i=av->p;\ x=av->t==It?(double)p.i[0]:p.f[0];\ }\ }\ return x>valueMax()?valueMax():xaplusVar():0;\ MSBoolean success = MSFalse;\ \ if (v)\ {\ A r = aplus_nl;\ AInFunction *inFunc;\ if ((inFunc=AplusModel::getInFunc(v))!=0)\ r=inFunc->invoke(v,(char*)str_,-1,-1);\ else r=defaultInFunc(v,str_);\ if (r!=0) \ {\ if (aset((I)v,(I)r,0,0)==0) showError(qs);\ else\ {\ AplusModel::doneCB(v,r,0,0);\ success=MSTrue;\ }\ }\ }\ busyEnable(busyState); \ return success;\ }\ \ MSBoolean AplusSliderType::assignValue(double x_)\ {\ MSBoolean busyState=busyEnable();\ busyEnable(MSFalse); \ extern int safeAset(V,A,A,A);\ MSBoolean success = MSFalse;\ V v = (model()!=0)?model()->aplusVar():0;\ \ if (v)\ {\ double x=x_>valueMax()?valueMax():x_a;\ A r=av->t==It?gi((int)x):gf((double)x);\ if (aset((I)v,(I)r,0,0)==0) showError(qs); \ else success = MSTrue;\ }\ busyEnable(busyState); \ return success;\ }\ \ \ A AplusSliderType::defaultInFunc(V v_,const char *string_)\ {\ A r=aplus_nl;\ if (v_!=0)\ {\ char *ptrchar=0;\ A av=(A)v_->a;\ double num;\ \ if (av->t==It)\ {\ num=strtol((char *)string_,&ptrchar,10); /* Base 10 */ \ if (ptrchar==(char *)string_) \ {\ r = aplus_nl;\ showError("Unknown Number: Integer Expected");\ }\ else r=gi((int)num );\ }\ else if (av->t==Ft)\ {\ num=strtod((char *)string_,&ptrchar);\ if (ptrchar==(char *)string_) \ {\ r=aplus_nl;\ showError("Unknown Number: Float Expected");\ }\ else r=gf((double)num);\ }\ }\ return (A)r;\ }\ \ \ void AplusSliderType::editValue(const char *pString_)\ {\ Type::editValue(pString_);\ if (editor()->mapped()==MSTrue)\ {\ activateCallback(MSWidgetCallback::editbegin);\ }\ }\ \ \ void AplusSliderType::editorEscape(void)\ {\ MSBoolean mapped = editor()->mapped();\ Type::editorEscape();\ if (mapped==MSTrue && editor()->mapped()==MSFalse)\ {\ activateCallback(MSWidgetCallback::editend);\ }\ }\ \ \ const MSSymbol& AplusSliderType::widgetType(void) const\ {\ return symbol();\ }\ \ \ const MSSymbol& AplusSliderType::symbol(void)\ {\ static MSSymbol sym(#AplusSliderType);\ return sym;\ }\ SliderMethodsMacro(AplusVScale, MSVScale) SliderMethodsMacro(AplusHScale, MSHScale) SliderMethodsMacro(AplusVGauge, MSVGauge) SliderMethodsMacro(AplusHGauge, MSHGauge) aplus-fsf-4.22/src/AplusGUI/AplusScrolledWindow.C0000644000265000001440000000306510772770346015327 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include extern long dbg_tmstk; AplusScrolledWindow::AplusScrolledWindow(MSWidget *xwin_) : MSScrolledWindow(xwin_) { AplusModel *am=new AplusModel(0); INTERNAL_COUPLE(am); } AplusScrolledWindow::~AplusScrolledWindow(void) {} void AplusScrolledWindow::addSenderNotify(MSEventSender *m_) { INTERNAL_COUPLE(((AplusModel *) m_)); } void AplusScrolledWindow::receiveEvent(MSEvent &event_) { if (event_.type()==MSIndexedEvent::symbol()) { MSIndexedEvent &ev=(MSIndexedEvent&)event_; update(ev.index()); } else if (event_.type()==MSNullEvent::symbol()) update(MSIndexVector::nullVector()); else if (event_.type() == AplusEvent::symbol()) { if (dbg_tmstk) cout << "Received UpdateEvent in AplusScrolledWindow" << endl; redraw(); } if (event_.type() == AplusVerifyEvent::symbol()) { if (dbg_tmstk) cout << "Received VerifyEvent in AplusScrolledWindow" << endl; AplusVerifyEvent *ave = (AplusVerifyEvent *) &event_; ave->result(verifyData(ave->aplusVar(), ave->a())); } } const MSSymbol& AplusScrolledWindow::widgetType(void) const { return symbol(); } const MSSymbol& AplusScrolledWindow::symbol(void) { static MSSymbol sym("AplusScrolledWindow"); return sym; } aplus-fsf-4.22/src/AplusGUI/AplusShell.C0000644000265000001440000001412510772770346013436 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include static const char *_XA_VUE_WORKSPACE_HINTS ="_DT_WORKSPACE_HINTS"; extern long dbg_tmstk; MSBoolean AplusShell::_allowNestedTraversal = MSFalse; AplusShell::AplusShell(void) : MSShell() { AplusModel *am=new AplusModel(0); INTERNAL_COUPLE(am); } AplusShell::AplusShell(MSDisplayServer *server_) : MSShell(server_) { AplusModel *am=new AplusModel(0); INTERNAL_COUPLE(am); } AplusShell::~AplusShell(void) { if (MSShell::defaultLeader()==(MSShell *)this) { MSShell::defaultLeader(0); } } void AplusShell::addSenderNotify(MSEventSender *m_) { INTERNAL_COUPLE(((AplusModel *) m_)); } void AplusShell::receiveEvent(MSEvent &event_) { if (event_.type() == AplusEvent::symbol()) { if (dbg_tmstk) cout << "Received UpdateEvent in AplusShell" << endl; redraw(); } if (event_.type() == AplusVerifyEvent::symbol()) { if (dbg_tmstk) cout << "Received VerifyEvent in AplusShell" << endl; AplusVerifyEvent *ave = (AplusVerifyEvent *) &event_; ave->result(verifyData(ave->aplusVar(), ave->a())); } } void AplusShell::decoupleWidget(void) { if (model()) { delete _model; _model=0; } } MSWidgetView *AplusShell::getNextFocusAfter(MSWidgetView *pWidgetView_) { if (traversalList().length()>0) { MSWidget *pWidget=0; unsigned i,index=traversalList().indexOf((unsigned long)pWidgetView_,0); if (index==traversalList().length()) index=0; for (i=index+1;iprocessOneEvent(); if (ev.type==MapNotify&&ev.xmap.window==window()) { server()->flush(); return; } } } else show(); } void AplusShell::save(void) { MSShell::save(); // this will activate the "saveyourself" callback windowManagerCommand(getenv("AW_WM_COMMAND")); } void AplusShell::virtualScreen(A screen_) { if (server()->isCDERunning()==MSTrue) { if (!QA(screen_) || screen_->t!=It) { return; } int n=(int)screen_->n; unsigned long wsCount=server()->numberOfWorkspaces(); if (n>0 && wsCount>0) { Atom *wsAtoms=((AplusDisplayServer *)server())->workspaceAtoms(); if (wsAtoms==0) { return; } Atom *atoms=new Atom[n]; int wsNum; for (unsigned int i=0; ip[i]-1; // workspace numbers are 1-based if (wsNumworkspaceAtoms() method } } else // CDE is not running { Atom atom = XInternAtom(display(), "WM_VIRTUAL_SCREEN", False); XChangeProperty(display(),window(),atom,XA_INTEGER,32,PropModeReplace, (unsigned char *)screen_->p,1); } } A AplusShell::virtualScreen(void) { if (server()->isCDERunning()==MSTrue) { unsigned long wsCount=server()->numberOfWorkspaces(); if (wsCount==0) { return gi(-1); // this should never happen } Atom *wsAtoms=((AplusDisplayServer *)server())->workspaceAtoms(); if (wsAtoms==0) { return gi(-1); // this should never happen } A presence=gv(It,_workspacePresenceCount); unsigned i ; for (i=0; i<_workspacePresenceCount; ++i) { unsigned j ; for (j=0; jp[i]=j+1; // workspace numbers are 1-based break; } } if (j==wsCount) // i-th atom could not be found -> it is invalid { presence->p[i]=0; } } delete [] wsAtoms; // wsAtoms were allocated by server()->workspaceAtoms() method return presence; } else // CDE is not running { return gi(((AplusDisplayServer *)server())->virtualScreen(window())); } } const MSSymbol& AplusShell::widgetType(void) const { return symbol(); } const MSSymbol& AplusShell::symbol(void) { static MSSymbol sym("AplusShell"); return sym; } aplus-fsf-4.22/src/AplusGUI/AplusSlot.C0000644000265000001440000007760610772770347013326 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include extern int lcm(int,int); extern int lcm (A); extern MSBoolean isSlotFiller(A); extern A convertToPixels(const MSWidgetCommon *, A); extern long dbg_tmstk; const unsigned long AplusSlotDefaultCycleInterval=1000; AplusSlotEntryField::AplusSlotEntryField(MSWidget *owner_) : MSStringEntryField(owner_) { acceptTab(MSTrue); highlightColor(AVariableData::defaultHlColor()); dynamic(MSTrue); supportPasting(MSFalse); } AplusSlotEntryField::~AplusSlotEntryField(void) { } MSBoolean AplusSlotEntryField::validate(const char *string_) { return slot()->validate(this, string_); } // Need to override updateForeground so the label does not change color // void AplusSlotEntryField::updateForeground(unsigned long oldfg_) { MSComposite::updateForeground(oldfg_); _fieldValue->foreground(foreground()); if (oldfg_==editorBackground()) editorBackground(foreground()); redraw(); } void AplusSlotEntryField::up(void) { if (_editor->mapped()==MSTrue) { if (activateEditor()==MSTrue) { activateCallback(MSWidgetCallback::activate); slot()->up(); } } else slot()->up(); } void AplusSlotEntryField::down(void) { if (_editor->mapped()==MSTrue) { if (activateEditor()==MSTrue) { activateCallback(MSWidgetCallback::activate); slot()->down(); } } else slot()->down(); } void AplusSlotEntryField::left(void) { slot()->left(); } void AplusSlotEntryField::right(void) { slot()->right(); } void AplusSlotEntryField::focusIn(void) { if (slot()) { unsigned long cFld=slot()->fields().indexOf((unsigned long)(MSWidget *)this); if (cFld!=slot()->selectedItem()) { slot()->selectedItem(cFld); activateCallback(slot(),MSWidgetCallback::selection); } else slot()->selectedItem(cFld); } MSStringEntryField::focusIn(); } void AplusSlotEntryField::keyPress(const XEvent *event_, KeySym keysym_, unsigned int state_, const char *pString_) { MSStringEntryField::keyPress(event_, keysym_, state_, pString_); if (sensitive()==MSTrue && _editor->mapped()==MSFalse) { // Normally the up/down cursor keys skip over protected fields, however // if one is selected with the mouse the following allows the // currsor keys to move off the protected field // In version 2 you can't select a protected field with the mouse if (isProtected()==MSTrue) { if (keysym_==XK_Up) slot()->up(); else if (keysym_==XK_Down) slot()->down(); } if (keysym_==XK_Tab) { unsigned int state=(state_&(ShiftMask|ControlMask|Mod1Mask)); if (state==ShiftMask) slot()->shiftTab(); else slot()->tab(); } } } MSBoolean AplusSlotEntryField::isProtected(void) const { return slot()->readOnly(slot()->fields().indexOf((unsigned long)(MSWidget *)this)); } void AplusSlotEntryField::increment(void) { if (slot()->callback(MSWidgetCallback::increment)!=0) { slot()->activateCallback(MSWidgetCallback::increment); } else { slot()->activateCallback(MSWidgetCallback::reference); } } void AplusSlotEntryField::decrement(void) { if (slot()->callback(MSWidgetCallback::decrement)!=0) { slot()->activateCallback(MSWidgetCallback::decrement); } else { slot()->activateCallback(MSWidgetCallback::reference); } } void AplusSlotEntryField::label(const char *pString_) { unsigned vw=fieldValue()->width(); MSStringEntryField::label(pString_); fieldValue()->width(vw); } /////////////////////////////////////////////////////////////////////////////// AplusSlot::AplusSlot(MSWidget *owner_) : MSCompositeFieldBox(owner_) { _cycleColors=aplus_nl; _cycleInterval=AplusSlotDefaultCycleInterval; _geometry = aplus_nl; _selectedItem = -1; _arrowButtons = aplus_nl; acceptTab(MSTrue); childInFocus(MSFalse); AplusModel *am=new AplusModel(0); INTERNAL_COUPLE(am); backingStore(WhenMapped); } AplusSlot::~AplusSlot(void) { removeAllCycles(); if (isNull(_cycleColors)==MSFalse) dc(_cycleColors); if (isNull(geometry())==MSFalse) dc(geometry()); } MSBoolean AplusSlot::freezeIfUnfrozen(void) { MSBoolean rc=frozen(); freeze(); return rc; } void AplusSlot::unfreezeIfUnfrozen(MSBoolean bool_) { if(MSFalse==bool_)unfreeze(); } void AplusSlot::updateFunctionalAttributes(int row_) { V v=(model()==0)?0:((AplusModel*)model())->aplusVar(); AplusSlotEntryField *fld = (AplusSlotEntryField *)(MSWidget *)fields()(row_); if (fld) { AColorFunction *fgFunc=AplusModel::getFgFunc(v); if (fgFunc!=0) fld->foreground(color(row_)); fgFunc=AplusModel::getTitleColorFunc(v); if (fgFunc!=0) fld->labelForeground(titleColor(row_)); AFontFunction *fontFunc=AplusModel::getFontFunc(v); if (fontFunc!=0) fld->font(valueFont(row_)); fontFunc=AplusModel::getTitleFontFunc(v); if (fontFunc!=0) fld->labelFont(titleFont(row_)); } } void AplusSlot::updateData(void) { removeAllCycles(); V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; if (v) { MSBoolean wasFrozen=freezeIfUnfrozen(); int nr=numRows(); AplusSlotEntryField *fld=0; A str; MSBoolean change=(childCount()==nr)?MSFalse:MSTrue; // Set Managed WidgetVector size for (;fields().length() < nr; fields()<<(unsigned long)0); // remove extra buttons if (childCount()-nr>0) { int extra = childCount()-nr; for(int i = nr; i < extra+nr; i++) { ((MSWidget *)fields()(i))->destroy(); fields()[i] = 0; } fields().reshape(nr); } MSBoolean doMap; unsigned vallen=valueLength(); for (int r=0;rvalueWidth()) { fld->valueWidth(vallen); change=MSTrue; } } fld->resizeConstraints(At::Top|At::MaintainHeight); str = itemLabel(r); if (isNull(str)==MSFalse && str->t==Ct) { fld->label((char *)str->p); dc(str); } str = itemValue(r); if (isNull(str)==MSFalse) { fld->value((char *)str->p); dc(str); } updateFunctionalAttributes(r); if (doMap==MSTrue&&fld->mapped()==MSFalse) fld->map(); } if (change==MSTrue) naturalSize(); unfreezeIfUnfrozen(wasFrozen); } } void AplusSlot::updateValue(int row_) { V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; if (v!=0&&row_value((char *)str->p); dc(str); } str = itemLabel(row_); if(isNull(str)==MSFalse) fld->label((char *)str->p),dc(str); updateFunctionalAttributes(row_); } } } void AplusSlot::updateValues(void) { V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; if (v) { AplusSlotEntryField *fld; A str; for (int i = 0; i < fields().length(); i++) { fld=(AplusSlotEntryField *) (MSWidget *) fields()(i); str = itemValue(i); if (isNull(str)==MSFalse) { (void)fld->value((char *)str->p); dc(str); } } } } void AplusSlot::updateFont(Font) { V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; if (v!=0) { AplusSlotEntryField *fld; MSBoolean wasFrozen=freezeIfUnfrozen(); for (int i = 0; i < fields().length(); i++) { fld=(AplusSlotEntryField *) (MSWidget *) fields()(i); fld->font(valueFont(i)); } unfreezeIfUnfrozen(wasFrozen); } } void AplusSlot::updateSensitivity(void) { V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; if (v!=0) { AplusSlotEntryField *fld; MSBoolean wasFrozen=freezeIfUnfrozen(); for (int i = 0; i < fields().length(); i++) { fld=(AplusSlotEntryField *) (MSWidget *) fields()(i); fld->sensitive(sensitive()); } unfreezeIfUnfrozen(wasFrozen); } } void AplusSlot::highlightThickness(int t_) { if (fields().length()>0) { if (highlightThickness()!=t_) { AplusSlotEntryField *fld; MSBoolean wasFrozen=freezeIfUnfrozen(); for (int i = 0; i < fields().length(); i++) { fld=(AplusSlotEntryField *) (MSWidget *) fields()(i); if (fld->highlightThickness()!=t_) fld->highlightThickness(t_); } unfreezeIfUnfrozen(wasFrozen); if(MSFalse==wasFrozen)redraw(); } } } void AplusSlot::shadowThickness(int t_) { if (fields().length()>0) { if (shadowThickness()!=t_) { AplusSlotEntryField *fld; MSBoolean wasFrozen=freezeIfUnfrozen(); for (int i = 0; i < fields().length(); i++) { fld=(AplusSlotEntryField *) (MSWidget *) fields()(i); if (fld->shadowThickness()!=t_) fld->shadowThickness(t_); } unfreezeIfUnfrozen(wasFrozen); if(MSFalse==wasFrozen)redraw(); } } } void AplusSlot::highlightColor(unsigned long hlc_) { if (fields().length()>0) { if (highlightColor()!=hlc_) { AplusSlotEntryField *fld; MSBoolean wasFrozen=freezeIfUnfrozen(); for (int i = 0; i < fields().length(); i++) { fld=(AplusSlotEntryField *) (MSWidget *) fields()(i); if (fld->highlightColor()!=hlc_) fld->highlightColor(hlc_); } unfreezeIfUnfrozen(wasFrozen); if(MSFalse==wasFrozen)redraw(); } } MSCompositeFieldBox::highlightColor(hlc_); } int AplusSlot::highlightThickness(void) { if (fields().length()>0) { AplusSlotEntryField *fld; fld=(AplusSlotEntryField *) (MSWidget *) fields()(0); return fld->highlightThickness(); } else return MSCompositeFieldBox::highlightThickness(); } int AplusSlot::shadowThickness(void) { if (fields().length()>0) { AplusSlotEntryField *fld; fld=(AplusSlotEntryField *) (MSWidget *) fields()(0); return fld->shadowThickness(); } else return MSCompositeFieldBox::shadowThickness(); } unsigned long AplusSlot::highlightColor(void) { return MSCompositeFieldBox::highlightColor(); } void AplusSlot::firstMapNotify(void) { V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; int i; unsigned max = 9; unsigned vallen=valueLength(); unsigned len; if (v) { AplusSlotEntryField *fld; A str; for (i = 0; i < fields().length(); i++) { fld=(AplusSlotEntryField *) (MSWidget *) fields()(i); str = itemValue(i); if (isNull(str)==MSFalse) fld->value((char *) str->p); if(0==vallen) { len = strlen((char*)str->p); max=(len>max)?len:max; } dc(str); } if(0==vallen)vallen=max; for (i = 0; i < fields().length(); i++) { fld=(AplusSlotEntryField *) (MSWidget *) fields()(i); fld->valueWidth(vallen); fld->naturalSize(); } alignLabels(); } } void AplusSlot::naturalSize(void) { setGeometry(); MSCompositeFieldBox::naturalSize(); } void AplusSlot::updateTitle(void) { V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; if (v!=0) { AplusSlotEntryField *fld; A str; MSBoolean wasFrozen=freezeIfUnfrozen(); for (int i = 0; i < fields().length(); i++) { fld = (AplusSlotEntryField *)(MSWidget *) fields()(i); str = itemLabel(i); if(isNull(str)==MSFalse) { fld->label((char *)str->p); dc(str); } fld->labelFont(titleFont(i)); fld->labelForeground(titleColor(i)); } alignLabels(); unfreezeIfUnfrozen(wasFrozen); } MSCompositeFieldBox::updateTitle(); } MSBoolean AplusSlot::setGeometry(void) { V v=(model()==0)?0:((AplusModel*)model())->aplusVar(); A a=(model()==0)?0:((AplusModel*)model())->a(); if (v) { AGeometryFunction *geoFunc=AplusModel::getGeometryFunc(v); if (geoFunc!=0&&numRows()>0) { A ag=(A)geoFunc->invoke(v,a); if (isNull(ag)==MSFalse && ag->t==It) { if (compareGeometry(ag)==MSTrue) dc(ag); else { geometry(ag); (void) setPositions(); return MSTrue; } } } } return MSFalse; } MSBoolean AplusSlot::compareGeometry(A ag_) { A cg=geometry(); if (cg->t==It) { if (cg->t==ag_->t&&cg->n==ag_->n&&cg->r==ag_->r) { for (int r=0;rr;r++) { if (cg->d[r]!=ag_->d[r]) return MSFalse; } for (int i=0;in;i++) { if (cg->p[i]!=ag_->p[i]) return MSFalse; } return MSTrue; } else return MSFalse; } else return MSFalse; } MSBoolean AplusSlot::setPositions(void) { V v=(model()==0)?0:((AplusModel*)model())->aplusVar(); A a=(model()==0)?0:((AplusModel*)model())->a(); MSBoolean change=MSFalse; if (v!=0) { AGeometryFunction *geoFunc=AplusModel::getGeometryFunc(v); if (geoFunc!=0&&numRows()>0) { A ag=(A)geoFunc->invoke(v,a); if (isNull(ag)==MSFalse && ag->t==It) { P pg; pg.i=ag->p; A am=ag; int r=0; int c=0; int nRows=0; int nCols=0; if (ag->r<=1) // vector or scalar form else canonical - matrix { if (ag->r==0) { nRows=1; nCols=(int)pg.i[0]; } else { nRows=(int)ag->n; nCols=lcm(ag); } int w=nCols; int span=0; int i=0; int index=0; am=gm(It,nRows,nCols); P pm; pm.i=am->p; for (r=0;r0)?(int)pg.i[r]:1); for (c=0;cat(); ax=fldGeo.row(); ay=fldGeo.column(); h_span=fldGeo.columnSpan(); v_span=fldGeo.rowSpan(); mstat=fld->mapped(); fld->at(At(row, col, vspan, hspan, fld->resizeConstraints())); // preserve the constraints if (hspan==0||vspan==0) { fld->unmap(); fld->at(At(row, col, 1, 1, fld->resizeConstraints())); // preserve the constraints } else if (fld->mapped()==MSFalse) fld->map(); if(ax !=fld->at().row() || ay !=fld->at().column() || h_span!=fld->at().columnSpan() || v_span!=fld->at().rowSpan() || mstat !=fld->mapped()) change=MSTrue; } } if (ag->r<=1) dc(am); } dc(ag); } } return change; } void AplusSlot::rowSpan(int index_,A am_,int *row_,int *span_) { int r=0; int c=0; int w=(int)am_->d[1]; int span=0; int row=0; P p; p.i=am_->p; if (am_->r==2) { for (c=0;cd[1]&&span==0;c++) { for (r=0;rd[0];r++) { if (p.i[r*w+c]==index_) { if (span==0) row=r; span++; } } } } *row_=row; *span_=span; } void AplusSlot::colSpan(int index_,A am_,int *col_,int *span_) { int r=0; int c=0; int w=(int)am_->d[1]; int span=0; int col=0; P p; p.i=am_->p; if (am_->r==2) { for (r=0;rd[0]&&span==0;r++) { for (c=0;cd[1];c++) { if (p.i[r*w+c]==index_) { if (span==0) col=c; span++; } } } } *col_=col; *span_=span; } unsigned long AplusSlot::titleColor(int row_) { unsigned long fg=foreground(); V v=(model()==0)?0:((AplusModel*)model())->aplusVar(); int n=(model()==0)?0:((AplusModel*)model())->numElmts(); if (v!=0&&n==2) { AColorFunction *titleColorFunc=AplusModel::getTitleColorFunc(v); if (titleColorFunc!=0) { P p; p.i=((AplusModel*)model())->data(); A as=p.a[0]; A av=p.a[1]; if (row_>=0&&row_<(int)av->n) { A attr=(A)as->p[row_]; // used as the pick A val =(A)av->p[row_]; fg=(unsigned long) titleColorFunc->invoke(v,(A)val,(A)attr); } } } return fg; } A AplusSlot::itemLabel(int row_) { A outStr=aplus_nl; V v=(model()==0)?0:((AplusModel*)model())->aplusVar(); int n=(model()==0)?0:((AplusModel*)model())->numElmts(); if (v!=0&&n==2) { AOutFunction *titleFunc=AplusModel::getTitleFunc(v); if (titleFunc!=0) { P p; p.i=((AplusModel*)model())->data(); A as=p.a[0]; A av=p.a[1]; if (row_>=0&&row_<(int)av->n) { A attr=(A)as->p[row_]; // used as the pick A val =(A)av->p[row_]; outStr=(A) titleFunc->invoke(v,(A)val,(A)attr); outStr =(outStr->t==Ct)?outStr:aplus_nl; } } } return outStr; } Font AplusSlot::titleFont(int row_) { Font fid=font(); V v=(model()==0)?0:((AplusModel*)model())->aplusVar(); int n=(model()==0)?0:((AplusModel*)model())->numElmts(); if (v!=0&&n==2); { AFontFunction *titleFontFunc=AplusModel::getTitleFontFunc(v); if (titleFontFunc!=0) { P p; p.i=((AplusModel*)model())->data(); A as=p.a[0]; A av=p.a[1]; if (row_>=0&&row_<(int)av->n) { A attr=(A)as->p[row_]; // used as the pick A val =(A)av->p[row_]; fid=(Font) titleFontFunc->invoke(v,(A)val,(A)attr); } } } return fid; } MSBoolean AplusSlot::readOnly(int row_) const { V v=(model()==0)?0:((AplusModel*)model())->aplusVar(); int n=(model()==0)?0:((AplusModel*)model())->numElmts(); AVariableData *varData = ::pAVarDataFromV(v); AReadOnlyFunction *roFunc=AplusModel::getReadOnlyFunc(v); MSBoolean ro=(varData!=0)?varData->readOnly():MSFalse; if (roFunc!=0&&n==2) { P p; p.i=((AplusModel*)model())->data(); A as=p.a[0]; A av=p.a[1]; if (row_>=0&&row_<(int)av->n) { A attr=(A)as->p[row_]; // used as the pick A val =(A)av->p[row_]; ro=(MSBoolean) roFunc->invoke(v,(A)val,(A)attr); } } return ro; } Font AplusSlot::valueFont(int row_) { Font fid=font(); V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; int n = (model()!=0)?((AplusModel*)model())->numElmts():0; if (v!=0&&n==2) { AFontFunction *fontFunc=AplusModel::getFontFunc(v); if (fontFunc!=0) { P p; p.i=((AplusModel *)model())->data(); A as=p.a[0]; A av=p.a[1]; if (row_>=0&&row_<(int)av->n) { A attr=(A)as->p[row_]; // used as the pick A val =(A)av->p[row_]; fid=(Font) fontFunc->invoke(v,(A)val,(A)attr); } } } return fid; } unsigned long AplusSlot::editorBackground(void) { if (fields().length()!=0) { return ((AplusSlotEntryField *)(MSWidget *)fields()(0))->editorBackground(); } else return server()->defaultBackground(); } unsigned long AplusSlot::editorForeground(void) { if (fields().length()!=0) { return ((AplusSlotEntryField *)(MSWidget *)fields()(0))->editorForeground(); } else return server()->defaultForeground(); } void AplusSlot::editorBackground(unsigned long pixel_) { for (int i = 0; i < fields().length(); i++) ((AplusSlotEntryField *)(MSWidget *)fields()(i))->editorBackground(pixel_); } void AplusSlot::editorForeground(unsigned long pixel_) { for (int i = 0; i < fields().length(); i++) ((AplusSlotEntryField *)(MSWidget *)fields()(i))->editorForeground(pixel_); } MSBoolean AplusSlot::validate(AplusSlotEntryField *slot_, const char *string_) { extern int safeAset(V,A,A,A); MSBoolean success = MSFalse; int row = fields().indexOf((unsigned long)(MSWidget *)slot_); V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; if (v!=0&&row!=fields().length()) { busyOn(); P p; p.i=((AplusModel*)model())->data(); A as=p.a[0]; A attr=(A)as->p[row]; // used as the pick A pick=(A)gs(Et); *pick->p=(I)attr; AInFunction *inFunc; A r=aplus_nl; if ((inFunc=AplusModel::getInFunc(v))!=0) r=inFunc->invoke(v,(char *)string_,pick); else r=defaultInFunc(string_,row); if (r!=0 && isNull(r)==MSFalse) { r=(A)ic(r); if (safeAset(v,r,0,pick)==0) showError(qs); else { AplusModel::doneCB(v,r,0,pick); success=MSTrue; } dc(r); } dc(pick); } busyOff(); return success; } A AplusSlot::defaultInFunc(const char *string_,int row_) { char *ptrchar=0; long lnum=0; double dnum=0.0; A r=aplus_nl; V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; if (v!=0&&row_data(); A val=p.a[1]; P pv; pv.i=val->p; A scalar=pv.a[row_]; switch(scalar->t) { case It: lnum=strtol((char *)string_,&ptrchar,10); // Base 10 if (ptrchar==(char *)string_) { r=aplus_nl; showError("Unknown Number: Integer Expected"); } else r=gi((int)lnum); break; case Ft: dnum=strtod((char *)string_,&ptrchar); if (ptrchar==(char *)string_) { r=aplus_nl; showError("Unknown Number: Float Expected"); } else r=gf((double)dnum); break; case Ct: r=gsv(0,(char *)string_); break; case Et: // possible null object if (scalar->n==0) r=gsv(0,(char *)string_); break; default: break; } } return (A) r; } A AplusSlot::itemValue(int row_) { V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; A outStr=aplus_nl; if (v!=0) { ACharStrFunction *outFunc=AplusModel::getOutFunc(v); if (outFunc!=0) { P p; p.i=((AplusModel*)model())->data(); A as=p.a[0]; A av=p.a[1]; A attr=(A)as->p[row_]; // used as the pick A val=(A)av->p[row_]; outStr=(A)outFunc->invoke(v,(A)val,(A)attr); outStr=(outStr->t==Ct)?outStr:aplus_nl; } } return outStr; } extern "C" A gpix(A,A); void AplusSlot::updateForeground(unsigned long oldfg_) { AplusSlotEntryField *fld; V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; if (v!=0) updateValues(); MSLayout::updateForeground(oldfg_); for (int i = 0; i < fields().length(); i++) { fld = (AplusSlotEntryField *) (MSWidget *)fields()(i); fld->foreground(color(i)); } } void AplusSlot::updateBackground(unsigned long oldbg_) { AplusSlotEntryField *fld; MSLayout::updateBackground(oldbg_); for (int i = 0; i < fields().length(); i++) { fld = (AplusSlotEntryField *) (MSWidget *)fields()(i); fld->background(background()); } } void AplusSlot::update(V v_,A,A pick_,I) { V oldV = (model()!=0)?((AplusModel*)model())->aplusVar():0; if (pick_!=0) { if (QA(pick_)) { A pick=(A)gpix(pick_,(A)v_->a); if (pick!=0&&QA(pick)&&pick->t==It&&pick->r<=1) { if (pick->r==1) { if (pick->n>0) for (int i=0;in;i+=2) createCycle((int)pick->p[i+1]); else createCycle(-1); } else { if (pick->p[0]==1) createCycle(-1); else if (v_ ==oldV) updateData(); } } else if (pick==0) cerr << "slot: pick assignment error in update." << endl; else cerr << "slot: pick assignment error in update." << endl; if (pick!=0) dc(pick); } else cerr << "slot: pick assignment error in update." << endl; } else if (v_ == oldV)updateData(); } void AplusSlot::removeAllCycles(void) { // Set each entryfield's cyclecolors to nothing AplusSlotEntryField *fld; MSUnsignedLongVector empty; for (int i = 0; i < fields().length(); i++) { fld = (AplusSlotEntryField *) (MSWidget *) fields()(i); fld->cycleColors(empty); } } void AplusSlot::createCycle(int row_) { if (dbg_tmstk) cout << "CreateCycle(" << row_ << ")" << endl; V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; if (v!=0) { A colors; int nr=numRows(); if (row_>=0&&row_func()==0)?cycleColors():cycleColor(row_); if (isNull(colors)==MSFalse) { startCycle(row_,colors); if (colors!=0) dc(colors); } else updateValue(row_); } else if (row_==-1) { if (cycleFunc()->func()==0) { colors=cycleColors(); if (isNull(colors)==MSFalse) { startCycle(row_,colors); if (colors!=0) dc(colors); } else updateValues(); } else { for (int r=0;rcycleInterval(interval_); } } void AplusSlot::startCycle(int row_,A colors_) { MSUnsignedLongVector colors; AplusSlotEntryField *fld; if (colors_->t == It && colors_->n > 0) { for (int i = 0; i < colors_->n; i ++) colors << (unsigned long) colors_->p[i]; fld = (AplusSlotEntryField *) (MSWidget *)fields()(row_); fld->cycleColors(colors); updateValue(row_); } } A AplusSlot::cycleColor(int row_) { A r=aplus_nl; V v = (model()!=0)?((AplusModel *)model())->aplusVar():0; if (cycleFunc()->func()!=0&&row_data(); A as=p.a[0]; A av=p.a[1]; A attr=(A)as->p[row_]; // used as the pick A val=(A)av->p[row_]; r=cycleFunc()->invoke(v,(A)val,(A)attr); } return (isNull(r)==MSFalse) ? convertToPixels(this,r) : r; } void AplusSlot::cycleColors(A colors_) { if ((colors_->t==It&&colors_->r<=1)||(colors_->t==Et&&colors_->n==0)) { removeAllCycles(); if (_cycleColors!=0) dc(_cycleColors); _cycleColors=(A)ic(colors_); } } A AplusSlot::cycleColors(void) { return (_cycleColors->n>0)?(A)ic(_cycleColors):aplus_nl; } void AplusSlot::addSenderNotify(MSEventSender *m_) { INTERNAL_COUPLE(((AplusModel *)m_)); setClipMode(); updateTitle(); } MSBoolean AplusSlot::verifyData(V, A a_) { return isSlotFiller(a_); } void AplusSlot::receiveEvent(MSEvent& event_) { const MSSymbol& eventType=event_.type(); if (eventType==AplusEvent::symbol()) { if (dbg_tmstk) cout << "Received UpdateEvent in AplusSlot" << endl; AplusEvent *ave = (AplusEvent *) &event_; V v = ((AplusModel *)model())->aplusVar(); A index = ave->index(); A pick = ave->pick(); I ravel = ave->ravel();; update(v,index, pick, ravel); } else if (eventType==AplusVerifyEvent::symbol()) { if (dbg_tmstk) cout << "Received VerifyEvent in AplusSlot" << endl; AplusVerifyEvent *ave = (AplusVerifyEvent *) &event_; ave->result(verifyData(ave->aplusVar(), ave->a())); } else if (eventType==AplusUpdateDataEvent::symbol()) // Size update Event { if (dbg_tmstk) cout << "Received UpdateDataEvent in AplusArray" << endl; setClipMode(); updateData(); } else if (eventType==AplusUpdateTitleEvent::symbol()) { if (dbg_tmstk) cout << "Received UpdateTitleEvent in AplusArray" << endl; updateTitle(); } } void AplusSlot::setClipMode(void) { AplusModel *pModel=(AplusModel *)model(); if (pModel!=0) { V v=pModel->aplusVar(); if (v!=0) { unsigned int numFields=fields().length(); AplusSlotEntryField *fld; AVariableData *varData = ::pAVarDataFromV(v); if (varData->stars()==MSTrue) { for (unsigned int i=0; iclipMode(MSClipStars); } } else { for (unsigned int i=0; iclipMode(MSNoClipping); } } } } } int AplusSlot::numRows(void) { int r=0; if (model() && ((AplusModel*)model())->aplusVar()!=0) { P p; p.i=((AplusModel*)model())->data(); A p0=p.a[0]; r=(int)p0->n; } return r; } int AplusSlot::valueLength(void) { V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; if (v) { AVariableData *varData = ::pAVarDataFromV(v); return varData->colWidth(); } return 0; } int AplusSlot::editLength(void) { V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; if (v) { AVariableData *varData = ::pAVarDataFromV(v); return varData->editWidth(); } return 0; } unsigned long AplusSlot::color(unsigned row_) { unsigned long fg=foreground(); V v=(model()==0)?0:((AplusModel*)model())->aplusVar(); int n=(model()==0)?0:((AplusModel*)model())->numElmts(); if (v!=0&&n==2) { AColorFunction *fgFunc=AplusModel::getFgFunc(v); if (fgFunc!=0) { P p; p.i=((AplusModel*)model())->data(); A as=p.a[0]; A av=p.a[1]; if (row_>=0&&row_<(int)av->n) { A attr=(A)as->p[row_]; // used as the pick A val =(A)av->p[row_]; fg=(unsigned long) fgFunc->invoke(v,(A)val,(A)attr); } } } return fg; } MSBoolean AplusSlot::editing(void) { for(int i = 0; i < fields().length(); i++) { AplusSlotEntryField *f = (AplusSlotEntryField *)(MSWidget *)fields()(i); if (f->editing()==MSTrue) { return MSTrue; } } return MSFalse; } void AplusSlot::startEditing(void) { MSWidget *focusWidget = inputFocus(); for(int i = 0; i < fields().length(); i++) { if (focusWidget ==(MSWidget *)fields()(i)) { AplusSlotEntryField *f = (AplusSlotEntryField *)(MSWidget *)fields()(i); f->editSelection(); return; } } } void AplusSlot::stopEditing(void) { for(int i = 0; i < fields().length(); i++) { AplusSlotEntryField *f = (AplusSlotEntryField *)(MSWidget *)fields()(i); if (f->editing()==MSTrue) { f->returnKey(); } } } void AplusSlot::tab(void) { const MSUnsignedLongVector& aVector=fields(); MSWidget *w = inputFocus(); unsigned i = fields().indexOf((unsigned long) w); int len=fields().length(); if (i < len ) { for(int j=1; jisProtected()) { traverseFocus((MSWidget *)aVector(fld)); break; } } } } void AplusSlot::shiftTab(void) { const MSUnsignedLongVector& aVector=fields(); MSWidget *w=inputFocus(); unsigned i=fields().indexOf((unsigned long)w); int len=fields().length(); if (i < len ) { for(int j=1; jisProtected()) { traverseFocus((MSWidget *)aVector(fld)); break; } } } } void AplusSlot::takeFocus(void) { AplusShell::allowNestedTraversal(MSTrue); if (fields().length()>0 && childInFocus()==MSFalse) { AplusSlotEntryField *f = (AplusSlotEntryField *)(MSWidget *)fields()(0); traverseFocus(f); childInFocus(MSTrue); } else { childInFocus(MSFalse); traverseToNext(); } AplusShell::allowNestedTraversal(MSFalse); } void AplusSlot::arrowButtons(A states_) { if (QA(states_) && (isNull(states_)==MSTrue || states_->t==It)) { dc(_arrowButtons); _arrowButtons = states_; for (unsigned i=0;ir?((in)?states_->p[i]:0):*states_->p)?MSTrue:MSFalse; AplusSlotEntryField *f = (AplusSlotEntryField *)(MSWidget *)fields()(i); f->arrowButtons(enable); } } } void AplusSlot::redraw(void) { updateValues(); } const MSSymbol& AplusSlot::widgetType(void) const { return symbol(); } const MSSymbol& AplusSlot::symbol(void) { static MSSymbol sym("AplusSlot"); return sym; } aplus-fsf-4.22/src/AplusGUI/AplusTable.C0000644000265000001440000003237510772770347013426 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include extern ::A convertToPixels(const MSWidgetCommon *, ::A); extern long dbg_tmstk; AplusTable::AplusTable(MSWidget *widget_) : MSTable(widget_) { if (dbg_tmstk) cout << "Creating AplusTable" << endl; AplusModel *am=new AplusModel(0); INTERNAL_COUPLE(am); columnResize(MSFalse); columnDragDrop(MSFalse); // // Translating MSCallbacks to AplusCallbacks. // callback(MSWidgetCallback::doubleclick, new MSMethodCallback(this, &AplusTable::referenceCB)); } AplusTable::~AplusTable(void) {} void AplusTable::receiveEvent(MSEvent &event_) { const MSSymbol& eventType=event_.type(); if (eventType==AplusEvent::symbol()) { if (dbg_tmstk) cout << "Received UpdateEvent in AplusTable" << endl; AplusEvent *ave = (AplusEvent *) &event_; V v = ((AplusModel *)model())->aplusVar(); ::A index = ave->index(); ::A pick = ave->pick(); I ravel = ave->ravel();; update(v,index, pick, ravel); } else if (eventType==AplusVerifyEvent::symbol()) { if (dbg_tmstk) cout << "Received VerifyEvent in AplusTable" << endl; AplusVerifyEvent *ave = (AplusVerifyEvent *) &event_; ave->result(verifyData(ave->aplusVar(), ave->a())); } else if (eventType==AplusUpdateDataEvent::symbol()) { if (dbg_tmstk) cout << "Received UpdateDataEvent in AplusTable" << endl; updateData(); } else if (eventType==AplusProtectEvent::symbol()) { if (dbg_tmstk) cout << "Received an AplusProtectEvent in AplusTable" << endl; V v = ((AplusModel *)model())->aplusVar(); AVariableData *varData = ::pAVarDataFromV(v); if (varData) { readOnly(varData->readOnly()); } } } MSBoolean AplusTable::verifyData(V v_,::A a_) { MSBoolean r=MSFalse; if (a_->t==Et) { r=MSTrue; ::A as; V sv; ::A *p=(::A *)a_->p; for (int i=0;in&&r==MSTrue;i++) { if (QS(p[i])) { sv=(V) getVFromSym(v_->cx,(S)XS((::A)p[i])); as=(::A)sv->a; r=verifyColumn(as); } else r=MSFalse; } } return r; } MSBoolean AplusTable::verifyColumn(::A a_) { if (a_!=0&&!QS(a_)) { if (a_->t==Et) return MSTrue; else if (a_->r==1&&a_->t!=Ct) return MSTrue; else if (a_->t==Ct&&a_->r>=1&&a_->r<=2) return MSTrue; } return MSFalse; } void AplusTable::addSenderNotify(MSEventSender *m_) { if (dbg_tmstk) cout << "AplusTable::addSenderNotify" << endl; INTERNAL_COUPLE(((AplusModel *) m_)); } void AplusTable::updateData(void) { V var = (model()!=0)?((AplusModel*)model())->aplusVar():0; MSBoolean wasFrozen=frozen(); if (editor()->mapped()==MSTrue) unmapEditor(); if (var) { if (MSFalse==wasFrozen)freeze(); ::A a=(::A)var->a; int nVars=(int)a->n; if (nVars==0) variables(0,0); else { ::A *p=(::A *)a->p; V *v=new V[nVars]; for (int i=0;icx,(S)XS((::A)p[i])); variables(v,nVars); delete [] v; } calculateRowHeight(); calculateHeadingsHeight(); adjustNumVisible(); if(MSFalse==wasFrozen)unfreeze(); redrawImmediately(); } } void AplusTable::update(V,int r_,int c_,UpdateType t_) { if (r_==-1&&c_==-1&&t_==ValueUpdate) redrawImmediately(); else if (t_==ShapeUpdate||t_==AppendUpdate) updateData(); } void AplusTable::update(V v_,::A index_,::A,I ravel_) { if(index_==(::A)MP(22)) update(v_,-1,-1,AppendUpdate); else if(!index_) update(v_,-1,-1,ShapeUpdate); else if(ravel_) // ravel update { ::A a=(::A)v_->a; if(a->r==2&&a->n==1) { int n=(int)a->d[1]; int k=(int)index_->p[0]; int j=k/n; update(v_,j,k-n*j,ValueUpdate); } else update(v_,-1,-1,ValueUpdate); } else { ::A r=index_->t==It?index_:index_->n?(::A)*index_->p:aplus_nl; ::A c=index_->t==Et&&index_->n>1?(::A)index_->p[1]:aplus_nl; if(isNull(c)==MSTrue) // c is aplus_nl - all cols are updated { if(isNull(r)==MSTrue) update(v_,-1,-1,ValueUpdate); else { for(int i=0;i<(int)r->n;i++) update(v_,(int)r->p[i],-1,ValueUpdate); } } else if(isNull(r)==MSTrue) // r is aplus_nl - all rows are updated { for(int i=0;i<(int)c->n;i++) update(v_,-1,(int)c->p[i],ValueUpdate); } else { for(int j=0;j<(int)r->n;j++) { for(int i=0;i<(int)c->n;i++) { update(v_,(int)r->p[j],(int)c->p[i],ValueUpdate); } } } } } void AplusTable::variables(V *v_,int numVars_) { int i,j; int nc=numColumns(); AplusTableColumn *var; if (numVars_>0) { AplusTableColumn **old_columns = 0; AplusTableColumn **vars=new AplusTableColumn*[numVars_]; MSBoolean found; if (nc > 0) // Copy all existing columns to old_columns { old_columns=new AplusTableColumn*[nc]; for(i=0; i < nc; i++) old_columns[i] = (AplusTableColumn *)tableColumn(i); } for (i=0;imodel()&&((AplusModel*)var->model())->aplusVar()==v_[j]) { vars[j]=var; found=MSTrue; break; } } removeChild(var); if (found==MSFalse) { // Removing object association from the V of the column AplusModel *pOldModel = (AplusModel*)var->model(); if (pOldModel && pOldModel->aplusVar() && pOldModel->pAVarData()) { pOldModel->pAVarData()->pWidgetView(0); pOldModel->aplusVar()->o = 0; safeDestroy(var); } } } for (i=0;icoupleWidgetView(vars[i]); } else // insertChild doesn't set the column value, but removeChild sets it to zero. Bug? { vars[i]->column(i); } insertChild(vars[i]); } delete [] vars; if (old_columns) delete [] old_columns; } else { for (i=0;ipWidgetView()) fid=varData->pWidgetView()->font(); else fid=server()->defaultFont(); return (server()->defaultFont()==fid)?font():fid; } void AplusTable::updateBackground(unsigned long oldbg_) { MSArrayView::updateBackground(oldbg_); unsigned i,n=numColumns(); for (i=0;isetBg(background()); n=hiddenColumnList()->count(); for (i=n-1;iarray(i); ((AplusTableColumn*)tc)->setBg(background()); } } void AplusTable::updateFont(Font oldfont_) { MSCompositeText::updateFont(oldfont_); freeze(); unsigned i,n=numColumns(); for (i=0;isetFont(font()); n=hiddenColumnList()->count(); for (i=n-1;iarray(i); ((AplusTableColumn*)tc)->setFont(font()); } unfreeze(); } void AplusTable::updateTitle(void) { Font fid = titleFont(); int n = numColumns(); for (int i = 0; i < n; i++) { AplusModel *pModel = (AplusModel *)tableColumn(i)->model(); if (pModel) { AVariableData *vd = ::pAVarDataFromV(pModel->aplusVar()); if (isNull(vd->titleAFg())==MSTrue) { tableColumn(i)->headingForeground(titleForeground()); } if (isNull(vd->titleAFont())==MSTrue) { tableColumn(i)->headingFont(fid); } } } MSTable::updateTitle(); } void AplusTable::updateForeground(unsigned long oldfg_) { MSCompositeText::updateForeground(oldfg_); redrawImmediately(); } // Cellforeground will attempt to get the color from the table column. // if the table column doesn't have a colorfunc, it will try to evaluate // it's own colorfunc. unsigned long AplusTable::cellForeground(unsigned row_,unsigned column_) { AplusTableColumn *pTableColumn = (AplusTableColumn *) tableColumn(column_); if (pTableColumn==0) { if (foregroundColors().length()==0) return foreground(); else return foregroundColors()(row_%foregroundColors().length()); } if (pTableColumn->model()!=0) { V v = ((AplusModel *)pTableColumn->model())->aplusVar(); AVariableData *pAVarData = ::pAVarDataFromV(v); // If a color was set before or if there's a color function if ((pAVarData && isNull(pAVarData->fgA())==MSFalse) || AplusModel::getFgFunc(v)) return pTableColumn->cellForeground(row_); else { v = ((AplusModel*)model())->aplusVar(); ::A a = ((AplusModel*)model())->a(); AColorFunction *fgFunc = AplusModel::getFgFunc(v); return (fgFunc!=0)?fgFunc->invoke(v,a):foreground(); } } return server()->defaultForeground(); } // When functional background comes around, edit this function unsigned long AplusTable::cellBackground(unsigned row_, unsigned column_) { return MSTable::cellBackground(row_,column_); } // Cyclecolors with Table is quite complicated. // // If the TableColumn has a cycle color function, it is used // else, if it has a colors vector, it is used // else, if the Table has a cycle color function, it is used // else, if the Table has a colors vector, it is used // else do not cycle // void AplusTable::createCycle(int row_,int column_) { if (column_<0) { return; } AplusModel *pModel=(AplusModel *)model(); if (pModel==0) { return; } V v = pModel->aplusVar(); if (v==0) { return; } if (pModel->numElmts()>0) { ACycleFunction *tableCycleFunc=AplusModel::getCycleFunc(v); AplusTableColumn *pColumn = (AplusTableColumn *)tableColumn(column_); if (pColumn!=0) { V columnV = (pColumn->model()!=0)?((AplusModel*)pColumn->model())->aplusVar():0; if (columnV==0) { return; } ACycleFunction *columnCycleFunc = AplusModel::getCycleFunc(columnV); if (columnCycleFunc!=0 && columnCycleFunc->func()!=0) { pColumn->cycleColors(pColumn->getCycleColors(row_)); // use the column's cycle colors function } else if (pColumn->cycleColors().length()==0 && tableCycleFunc!=0 && tableCycleFunc->func()!=0) { cycleColors(getCycleColors(row_, column_)); // use the table's cycle colors function } MSTable::createCycle(row_,column_); } } } MSUnsignedLongVector AplusTable::getCycleColors(int row_, int col_) const { char *buf; ::A r=aplus_nl; V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; ACycleFunction *cycleFunc = AplusModel::getCycleFunc(v); if (cycleFunc && cycleFunc->func()!=0&&(row_data(); int rank = ((AplusModel *)model())->rank(); int type = ((AplusModel *)model())->a_type(); int w=rank==2?numColumns():1; int offset=row_*w+col_; int n=0; switch(type) { case It: r=cycleFunc->invoke(v,(int)p.i[offset],row_,col_); break; case Ft: r=cycleFunc->invoke(v,(double)p.f[offset],row_,col_); break; case Ct: n=((AplusModel*)model())->charLength(); offset=row_*n; buf=new char[n+1]; strncpy(buf,p.c+(offset),n); buf[n]= '\0'; r=cycleFunc->invoke(v,(char *)buf,row_,col_); delete [] buf; break; case Et: if (((AplusModel*)model())->numElmts()>0) { ::A d=gs(Et); *d->p=ic(p.a[offset]); r=cycleFunc->invoke(v,d,row_,col_); dc(d); } break; } } ::A pixelColors = (isNull(r)==MSFalse) ? convertToPixels(this,r) : r; MSUnsignedLongVector uv; if (isNull(pixelColors)==MSFalse) { for (unsigned i = 0; i < pixelColors->n; i++) uv << (unsigned long) pixelColors->p[i]; dc(pixelColors); } return uv; } void AplusTable::shuffleColumns(MSIndexVector &aIndexVector_) { extern int safeAset(V,::A,::A,::A); V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; if (v) { ::A old = ((AplusModel*)model())->a(); ::A r = aplus_nl; long d[MAXR]={ 0, 0, 0, 0, 0, 0, 0, 0, 0 }; d[0] = aIndexVector_.length(); r = ga(Et, 1, aIndexVector_.length(), d); for (int i = 0; i < aIndexVector_.length(); i++) r->p[i] = (long) ic((::A) old->p[aIndexVector_(i)]); if (safeAset(v, r, 0, 0)==0) { showError(qs); } else { activateCallback(MSWidgetCallback::permutecolumns); } } } const MSSymbol& AplusTable::widgetType(void) const { return symbol(); } const MSSymbol& AplusTable::symbol(void) { static MSSymbol sym("AplusTable"); return sym; } void AplusTable::referenceCB(void) { activateCallback(MSWidgetCallback::reference); } aplus-fsf-4.22/src/AplusGUI/AplusTableColumn.C0000644000265000001440000006347410772770347014610 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include extern A convertToPixels(const MSWidgetCommon *, A); extern long dbg_tmstk; extern A grc(A,int,int); AplusTableColumn::AplusTableColumn(AplusTable *owner_) : MSTableColumn((MSTable *)owner_), _breakText(aplus_nl) { _columnAlignment=MSLeft; _outStr=aplus_nl; _compMode = AplusReportAlgorithm::Sum; _algorithm = AplusReportSumAlgorithm::reportSum(); AplusModel *am=new AplusModel(0); INTERNAL_COUPLE(am); if (owner()==0) { headingForeground(server()->defaultForeground()); _headingFont=server()->defaultFont(); } else { headingForeground(((MSTable *)owner())->titleForeground()); _headingFont=((MSTable *)owner())->titleFont(); } callback(MSWidgetCallback::columnresize, new MSMethodCallback(this,&AplusTableColumn::columnResizeCB)); } AplusTableColumn::~AplusTableColumn(void) { dc(_outStr); } void AplusTableColumn::receiveEvent(MSEvent &event_) { if (event_.type() == AplusEvent::symbol()) { if (dbg_tmstk) cout << "Received UpdateEvent in AplusTableColumn" << endl; AplusEvent *ave = (AplusEvent *) &event_; V v = ((AplusModel *)model())->aplusVar(); A index = ave->index(); A pick = ave->pick(); I ravel = ave->ravel();; update(v,index, pick, ravel); } if (event_.type() == AplusVerifyEvent::symbol()) { if (dbg_tmstk) cout << "Received VerifyEvent in AplusTableColumn" << endl; AplusVerifyEvent *ave = (AplusVerifyEvent *) &event_; ave->result(verifyData(ave->aplusVar(), ave->a())); } if (event_.type() == AplusUpdateDataEvent::symbol()) // Size update Event { if (dbg_tmstk) cout << "Received UpdateDataEvent in AplusTableColumn" << endl; V v = ((AplusModel *)model())->aplusVar(); AVariableData *varData = ::pAVarDataFromV(v); if (varData) { columnWidth(varData->colWidth()); setClipMode(); } } } MSBoolean AplusTableColumn::verifyData(V,A a_) { if (a_!=0&&QA(a_)) { if (a_->t==Et) return MSTrue; else if (a_->r==1&&a_->t!=Ct) return MSTrue; else if (a_->t==Ct&&a_->r>=1&&a_->r<=2) return MSTrue; } return MSFalse; } void AplusTableColumn::addSenderNotify(MSEventSender *m_) { if (dbg_tmstk) cout << "AplusTableColumn::addSenderNotify" << endl; INTERNAL_COUPLE(((AplusModel *) m_)); V v=(model()!=0)?((AplusModel*)model())->aplusVar():0; if (v) { setClipMode(); if (isNull(getVarData()->bgA())==MSTrue) { background(table()->background()); } headingFont(titleFont()); } } MSBoolean AplusTableColumn::validate(const char *string_, unsigned row_) { V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; return validate(v, string_, row_); } MSBoolean AplusTableColumn::validate(V v_, const char *string_, unsigned row_) { extern int safeAset(V,A,A,A); if (v_!=0) { AInFunction *inFunc; A inData=aplus_nl; if ((inFunc=AplusModel::getInFunc(v_))!=0) inData=inFunc->invoke(v_,(char *)string_,(int)row_, 0); else inData=defaultInFunc(v_,string_); if (inData!=0 && isNull(inData)==MSFalse) { A index=grc((A)v_->a,row_,0); inData=(A)ic(inData); if (safeAset(v_,inData,index,0)==0) { showError(qs); dc(inData); if (index!=0) dc(index); return MSFalse; } else { ((AplusModel*)model())->doneCB(v_,inData,index,0); dc(inData); if (index!=0) dc(index); return MSTrue; } } } return MSFalse; } A AplusTableColumn::defaultInFunc(V v_,const char *string_) { char *ptrchar=0; long lnum=0; double dnum=0.0; int n=0; A av,r=aplus_nl; if (v_!=0) { av=(A)v_->a; switch(av->t) { case It: lnum=strtol((char *)string_,&ptrchar,10); // Base 10 if (ptrchar==(char *)string_) { r=aplus_nl; showError("Unknown Number: Integer Expected"); } else r=gi((int)lnum); break; case Ft: dnum=strtod((char *)string_,&ptrchar); if (ptrchar==(char *)string_) { r=aplus_nl; showError("Unknown Number: Float Expected"); } else r=gf((double)dnum); break; case Ct: n=(av->r==1?(int)av->d[0]:(int)av->d[1]); r=gv(Ct,n); (void) memset((char *)r->p,' ',n); // ' ' == 0x20 == 32 --> blankspace strncpy((char *)r->p,(char *)string_,strlen((char *)string_)); break; case Et: // no attempt at conversion - nesting level ???? r=gsv(0,(char *)string_); break; default: break; } } return (A) r; } const char *AplusTableColumn::formatOutput(MSString& str_, unsigned row_) { static const char blank[]={" "}; V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; ACharStrFunction *outFunc = AplusModel::getOutFunc(v); AVariableData *vd = ::pAVarDataFromV(v); invokeFunction(outFunc, row_); str_ = (Ct==_outStr->t) ? (char *)_outStr->p : blank; dc(_outStr); _outStr=aplus_nl; return str_; } void AplusTableColumn::invokeFunction(AOutFunction *outFunc_, unsigned row_) { invokeFunction(outFunc_,row_,-1); } void AplusTableColumn::invokeFunction(AOutFunction *outFunc_, unsigned row_, unsigned col_) { I *data = ((model()!=0)?((AplusModel*)model())->data():0); invokeFunction(outFunc_, row_, col_, data); } void AplusTableColumn::invokeFunction(AOutFunction *outFunc_, unsigned row_, unsigned col_, I *data_) { V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; unsigned long type = (model()!=0)?((AplusModel*)model())->a_type():0; int charlength = (model()!=0)?((AplusModel*)model())->charLength():0; int rank = (model()!=0)?((AplusModel*)model())->rank():0; P p; p.i = data_; char *buf; if (outFunc_!=0 && row_invoke(v,(int)p.i[offset],row_,col_); break; case Ft: _outStr=(A)outFunc_->invoke(v,(double)p.f[offset],row_,col_); break; case Ct: n=charlength; offset=row_ * n; buf=new char[n+1]; strncpy(buf,p.c+(offset),n); buf[n]= '\0'; _outStr=(A)outFunc_->invoke(v,(char *)buf,row_,col_); delete [] buf; break; case Et: d=gs(Et); *d->p=ic(p.a[offset]); _outStr=(A)outFunc_->invoke(v,d,row_,col_); dc(d); break; } } } void AplusTableColumn::invokeFunction(AFormatBreakFunction *outFunc_, unsigned row_, unsigned col_, A data_) { V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; unsigned long type = data_->t; P p; p.i = data_->p; unsigned len; char *buf; if (outFunc_!=0) { switch(type) { case It: _outStr=(A)outFunc_->invoke(v,(int)p.i[0],row_,col_); break; case Ft: _outStr=(A)outFunc_->invoke(v,(double)p.f[0],row_,col_); break; case Ct: if (p.c && (len=strlen((char *)p.c))!=0) { buf = new char[len+1]; strcpy(buf, (char *)p.c); buf[len]='\0'; _outStr=(A)outFunc_->invoke(v,buf,row_,col_); delete [] buf; } break; case Et: ic(data_); _outStr=(A)outFunc_->invoke(v,data_,row_,col_); dc(data_); break; } } } MSBoolean AplusTableColumn::isCellProtected(unsigned row_) { char *buf; AVariableData *varData=getVarData(); V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; MSBoolean ro=(varData!=0)?varData->readOnly():MSFalse; AReadOnlyFunction *roFunc=AplusModel::getReadOnlyFunc(v); unsigned long type = (model()!=0)?((AplusModel*)model())->a_type():0; int charlength = (model()!=0)?((AplusModel*)model())->charLength():0; int rank = (model()!=0)?((AplusModel*)model())->rank():0; P p; p.i = (model()!=0)?((AplusModel*)model())->data():0; if (roFunc!=0&&row_invoke(v,(int)p.i[offset],r,0); break; case Ft: ro=(MSBoolean) roFunc->invoke(v,(double)p.f[offset],r,0); break; case Ct: n=charlength; offset=row_ * n; buf=new char[n+1]; strncpy(buf,p.c+(offset),n); buf[n]= '\0'; ro=(MSBoolean) roFunc->invoke(v,(char *)buf,r,0); delete [] buf; break; case Et: d=gs(Et); *d->p=ic(p.a[offset]); ro=(MSBoolean) roFunc->invoke(v,d,r,0); dc(d); break; } } return ro; } void AplusTableColumn::update(const MSIndexVector &v_) { MSTableColumn::update(v_); } void AplusTableColumn::update(V v_,int r_,int,UpdateType t_) { if (v_!=0) { if (t_==ShapeUpdate||t_==AppendUpdate) ((AplusTable *)table())->columnUpdate(column()); else if (t_==ValueUpdate) { if (column()==0&&numRows()>=((AplusTable*)table())->numRows()) ((AplusTable*)table())->appendUpdate(); if (r_==-1) ((AplusTable*)table())->cycleColumn(column()); else ((AplusTable*)table())->cycleRowColumn(r_,column()); } } } Font AplusTableColumn::cellFont(unsigned row_) { char *buf; Font fid; V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; unsigned long type = (model()!=0)?((AplusModel*)model())->a_type():0; int charlength = (model()!=0)?((AplusModel*)model())->charLength():0; int rank = (model()!=0)?((AplusModel*)model())->rank():0; P p; p.i = (model()!=0)?((AplusModel*)model())->data():0; AFontFunction *fontFunc=AplusModel::getFontFunc(v); if (fontFunc!=0&&row_invoke(v,(int)p.i[offset],row_,0); break; case Ft: fid=(Font)fontFunc->invoke(v,(double)p.f[offset],row_,0); break; case Ct: n=charlength; offset=row_ * n; buf=new char[n+1]; strncpy(buf,p.c+(offset),n); buf[n]= '\0'; fid=(Font)fontFunc->invoke(v,(char *)buf,row_,0); delete [] buf; break; case Et: d=gs(Et); *d->p=ic(p.a[offset]); fid=(Font)fontFunc->invoke(v,d,row_,0); dc(d); break; } } else fid=((AplusTable*)table())->getVFont(v); return fid; } void AplusTableColumn::update(V v_,A index_,A,I ravel_) { if(index_==(A)MP(22)) update(v_,-1,-1,AppendUpdate); else if(!index_) update(v_,-1,-1,ShapeUpdate); else if(ravel_) // ravel update { A a=(A)v_->a; if(a->r==2&&a->n==1) { int n=(int)a->d[1]; int k=(int)index_->p[0]; int j=k/n; update(v_,j,k-n*j,ValueUpdate); } else update(v_,-1,-1,ValueUpdate); } else { A r=index_->t==It?index_:index_->n?(A)*index_->p:aplus_nl; A c=index_->t==Et&&index_->n>1?(A)index_->p[1]:aplus_nl; if(isNull(c)==MSTrue) // c is aplus_nl - all cols are updated { if(isNull(r)==MSTrue) update(v_,-1,-1,ValueUpdate); else { for(int i=0;i<(int)r->n;i++) update(v_,(int)r->p[i],-1,ValueUpdate); } } else if(isNull(r)==MSTrue) // r is aplus_nl - all rows are updated { for(int i=0;i<(int)c->n;i++) update(v_,-1,(int)c->p[i],ValueUpdate); } else { for(int j=0;j<(int)r->n;j++) { for(int i=0;i<(int)c->n;i++) { update(v_,(int)r->p[j],(int)c->p[i],ValueUpdate); } } } } } Font AplusTableColumn::titleFont(void) { if (model() && ((AplusModel*)model())->aplusVar()!=0) { AVariableData *avar = getVarData(); if (avar && isNull(avar->titleAFont())==MSFalse) return avar->titleFont(); else return table()->titleFont(); } return font(); } void AplusTableColumn::setBg(unsigned long bg_) { if (isNull(getVarData()->bgA())==MSTrue) background(bg_); } void AplusTableColumn::setFont(Font fid_) { if (isNull(getVarData()->fontA())==MSTrue) font(fid_); } unsigned long AplusTableColumn::cellForeground(unsigned row_) { AplusModel *m=(AplusModel *)model(); unsigned long fgcolor=foreground(); if(m) { V v = m->aplusVar(); AColorFunction *fgFunc=AplusModel::getFgFunc(v); P p; p.i = m->data(); char *buf; if (fgFunc!=0&&row_rank())?numColumns():1; int offset=row_*w; A d; switch(m->a_type()) { case It: fgcolor=(unsigned long)fgFunc->invoke(v,(int)p.i[offset],row_,0); break; case Ft: fgcolor=(unsigned long)fgFunc->invoke(v,(double)p.f[offset],row_,0); break; case Ct: w=m->charLength(); offset=row_ * w; buf=new char[w+1]; memcpy(buf,p.c+(offset),w); buf[w]= '\0'; fgcolor=(unsigned long) fgFunc->invoke(v,(char *)buf,row_,0); delete [] buf; break; case Et: d=gs(Et); *d->p=ic(p.a[offset]); fgcolor=(unsigned long) fgFunc->invoke(v,d,row_,0); dc(d); break; } } } return fgcolor; } unsigned long AplusTableColumn::cellBackground(unsigned row_) { AplusModel *m=(AplusModel *)model(); unsigned long bgcolor; // Inherit bg from table for `tableField has ( `bg;() ) if (isNull(getVarData()->bgA())==MSTrue) bgcolor=table()->background(); else bgcolor=background(); if(m) { V v = m->aplusVar(); AColorFunction *bgFunc=AplusModel::getBgFunc(v); P p; p.i = m->data(); char *buf; if (bgFunc!=0&&row_rank())?numColumns():1; int offset=row_*w; A d; switch(m->a_type()) { case It: bgcolor=(unsigned long)bgFunc->invoke(v,(int)p.i[offset],row_,0); break; case Ft: bgcolor=(unsigned long)bgFunc->invoke(v,(double)p.f[offset],row_,0); break; case Ct: w=m->charLength(); offset=row_ * w; buf=new char[w+1]; memcpy(buf,p.c+(offset),w); buf[w]= '\0'; bgcolor=(unsigned long) bgFunc->invoke(v,(char *)buf,row_,0); delete [] buf; break; case Et: d=gs(Et); *d->p=ic(p.a[offset]); bgcolor=(unsigned long) bgFunc->invoke(v,d,row_,0); dc(d); break; } } } return bgcolor; } MSUnsignedLongVector AplusTableColumn::getCycleColors(int row_) const { char *buf; A r=aplus_nl; V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; ACycleFunction *cycleFunc = AplusModel::getCycleFunc(v); if (cycleFunc && cycleFunc->func()!=0&&(row_data(); int rank = ((AplusModel *)model())->rank(); int type = ((AplusModel *)model())->a_type(); int w=rank==2?numColumns():1; int offset=row_*w; int n=0; switch(type) { case It: r=cycleFunc->invoke(v,(int)p.i[offset],row_,0); break; case Ft: r=cycleFunc->invoke(v,(double)p.f[offset],row_,0); break; case Ct: n=((AplusModel*)model())->charLength(); offset=row_*n; buf=new char[n+1]; strncpy(buf,p.c+(offset),n); buf[n]= '\0'; r=cycleFunc->invoke(v,(char *)buf,row_,0); delete [] buf; break; case Et: if (((AplusModel*)model())->numElmts()>0) { A d=gs(Et); *d->p=ic(p.a[offset]); r=cycleFunc->invoke(v,d,row_,0); dc(d); } break; } } A pixelColors = (isNull(r)==MSFalse) ? convertToPixels(table(),r) : r; MSUnsignedLongVector uv; if (isNull(pixelColors)==MSFalse) { for (unsigned i = 0; i < pixelColors->n; i++) uv << (unsigned long) pixelColors->p[i]; dc(pixelColors); } return uv; } // // Report Stuff // MSBoolean AplusTableColumn::breakCriteria(unsigned row_) // FIX THIS { if (breakCriteriaFunc()->func()!=0) { invokeFunction(breakCriteriaFunc(),row_); if (_outStr->t!=It) { dc(_outStr); _outStr=aplus_nl; showError("Non-integer (boolean) value in breakCriteria function"); return MSFalse; } else { P p; p.i=_outStr->p; MSBoolean r = (p.i[0]==0)?MSFalse:MSTrue; dc(_outStr); _outStr=aplus_nl; return r; } } else { if (isNumericColumn()) return MSFalse; else { // Don't break on first row // Break if the row is a duplicate OR last row // else, don't break return (row_!=0)? (isDuplicate(row_)==MSFalse)||row_==((numRows())-1)?MSTrue:MSFalse:MSFalse; } } } MSBoolean AplusTableColumn::isDuplicate(unsigned row_) { if (row_==0) return MSFalse; MSString str; char *str1=(char *)formatOutput(str,row_); char *tmp=0; if (str1!=0) { tmp=new char[strlen(str1)+1]; strcpy(tmp,str1); } char *str2=(char *)formatOutput(str,row_-1); if (tmp&&str2&&strcmp(tmp,str2)==0) { delete tmp; return MSTrue; } if (tmp) delete tmp; if (tmp==0&&str2==0) return MSTrue; return MSFalse; } unsigned long AplusTableColumn::style(unsigned row_) { if (styleFunc()->func()!=0) { invokeFunction(styleFunc(),row_); unsigned style = GUIEnum.formatStyle(_outStr); dc(_outStr); _outStr=aplus_nl; return style; } else return style(); } const char *AplusTableColumn::reportFont(unsigned row_) { if (reportFontFunc()->func()!=0) { invokeFunction(reportFontFunc(),row_); _reportFontStringBuffer = (char *) _outStr->p; dc(_outStr); _outStr=aplus_nl; return _reportFontStringBuffer; } else return reportFont(); } double AplusTableColumn::fgGrayScale(unsigned row_) { if (fgGrayScaleFunc()->func()!=0) { invokeFunction(fgGrayScaleFunc(),row_); if (_outStr->t == Ft || _outStr->t==It) { double r; P p; p.i = _outStr->p; if (_outStr->t==Ft) r = p.f[0]; else r = ((double)p.i[0]) / 100.0; dc(_outStr); _outStr=aplus_nl; return r; } else showError("Non-numeric value in fgGrayScale Function"); } return fgGrayScale(); } double AplusTableColumn::bgGrayScale(unsigned row_) { if (bgGrayScaleFunc()->func()!=0) { invokeFunction(bgGrayScaleFunc(),row_); if (_outStr->t == Ft || _outStr->t==It) { double r; P p; p.i = _outStr->p; if (_outStr->t==Ft) r = p.f[0]; else r = ((double)p.i[0]) / 100.0; dc(_outStr); _outStr=aplus_nl; return r; } else showError("Non-numeric value in bgGrayScale Function"); } return bgGrayScale(); } double AplusTableColumn::breakFgGrayScale(unsigned row_) { if (breakFgGrayScaleFunc()->func()!=0) { invokeFunction(breakFgGrayScaleFunc(),row_); if (_outStr->t == Ft || _outStr->t==It) { double r; P p; p.i = _outStr->p; if (_outStr->t==Ft) r = p.f[0]; else r = ((double)p.i[0]) / 100.0; dc(_outStr); _outStr=aplus_nl; return r; } else showError("Non-numeric value in breakFgGrayScale Function"); } return breakFgGrayScale(); } double AplusTableColumn::breakBgGrayScale(unsigned row_) { if (breakBgGrayScaleFunc()->func()!=0) { invokeFunction(breakBgGrayScaleFunc(),row_); if (_outStr->t == Ft || _outStr->t==It) { double r; P p; p.i = _outStr->p; if (_outStr->t==Ft) r = p.f[0]; else r = ((double)p.i[0]) / 100.0; dc(_outStr); _outStr=aplus_nl; return r; } else showError("Non-numeric value in breakBgGrayScale Function"); } return breakBgGrayScale(); } unsigned long AplusTableColumn::breakStyle(unsigned row_) { if (breakStyleFunc()->func()!=0) { invokeFunction(breakStyleFunc(),row_); unsigned style = GUIEnum.formatStyle(_outStr); dc(_outStr); _outStr=aplus_nl; return style; } else return breakStyle(); } int AplusTableColumn::breakOffset(unsigned row_) { if (breakOffsetFunc()->func()!=0) { invokeFunction(breakOffsetFunc(),row_); if (_outStr->t == It) { int r; r = (int) _outStr->p[0]; dc(_outStr); _outStr=aplus_nl; return r; } } return breakOffset(); } int AplusTableColumn::breakLeading(unsigned row_) { if (breakLeadingFunc()->func()!=0) { invokeFunction(breakLeadingFunc(),row_); if (_outStr->t == It) { int r; r = (int) _outStr->p[0]; dc(_outStr); _outStr=aplus_nl; return r; } } return breakLeading(); } const char *AplusTableColumn::breakFont(unsigned row_) { if (breakFontFunc()->func()!=0) { invokeFunction(breakFontFunc(),row_); _breakFontStringBuffer = (char *) _outStr->p; dc(_outStr); _outStr=aplus_nl; return _breakFontStringBuffer; } else return breakFont(); } MSBoolean AplusTableColumn::isNumericColumn(void) { AplusModel *m = (AplusModel *) model(); if (m) { if (m->a_type()==Ft||m->a_type()==It) return MSTrue; return MSFalse; } return MSFalse; } void AplusTableColumn::breakProcess(MSIndexVector & i_) { if (breakProcessFunc()->func()!=0) { MSIndexVector t=MSIndexVector::take(i_,-2); invokeFunction(breakProcessFunc(),t(0),t(1)); if (isNull(_outStr)==MSFalse) { _breakProcessStringBuffer=(char *) _outStr->p; breakString()<<_breakProcessStringBuffer; dc(_outStr); _outStr=aplus_nl; } } else { if (isNumericColumn()) { MSFloat aFloat; aFloat = computeIndexedSum(i_); MSString buf; breakString()<func()!=0) { A data = AplusConvert::asA(breakString()(row_)); invokeFunction(formatBreakFunc(),row_,col_,data); dc(data); if (isNull(_outStr)==MSFalse) { str_=(char *)_outStr->p; dc(_outStr); _outStr=aplus_nl; } } else { if (isNumericColumn()) { if (row_breakIndex()(row_); if (col_==column()&&breakString().length()>0&&breakIndex().indexOf(index)computeValue((A)((AplusModel*)model())->a()); return sum; } return 0.0; } double AplusTableColumn::computeIndexedSum(MSIndexVector &i_) { if (isNumericColumn()) { MSIndexVector t=MSIndexVector::take(i_,-2); double sum=_algorithm->computeValue((A)((AplusModel*)model())->a(), t(0), t(1)); return sum; } return 0.0; } A ABreakFunction::callFunc(V v_, A a_, int row_, int col_,A p_) { A i=0; if (row_!=-1||col_!=-1) { i = (A)gv(It,2); P p; p.i=i->p; p.i[0]=row_; p.i[1]=col_; } A r=(_func!=0)?(A)(*_func)(_arg,a_,i,p_,v_):(A)gsv(0,""); if (i!=0) dc((A)i); if (a_!=0) dc((A)a_); return r; } void AplusTableColumn::compMode(unsigned compMode_) { _compMode = compMode_; switch(_compMode) { case AplusReportAlgorithm::Sum: _algorithm = AplusReportSumAlgorithm::reportSum(); break; case AplusReportAlgorithm::Max: _algorithm = AplusReportMaxAlgorithm::reportMax(); break; case AplusReportAlgorithm::Min: _algorithm = AplusReportMinAlgorithm::reportMin(); break; case AplusReportAlgorithm::Avg: _algorithm = AplusReportAvgAlgorithm::reportAvg(); break; case AplusReportAlgorithm::StdDev: _algorithm = AplusReportStdDevAlgorithm::reportStdDev(); break; case AplusReportAlgorithm::Variance: _algorithm = AplusReportVarianceAlgorithm::reportVariance(); break; } } void AplusTableColumn::updateFont(Font oldfont_) { if (model()!=0 && ((AplusModel*)model())->aplusVar()!=0) { // If we're using a functional font attr, use cell 0 // as the base font size. This is a limitation on // size calculation. Font f = cellFont(0); if (font()!=f) _fontID=f; } // The code below is practically copied from MSTableColumn::updateFont() // in order to turn off the MStk's feature of setting the heading font // from the column font if the heading font has not been set yet. // if (model()!=0) { MSWidget::updateFont(oldfont_); MSBoolean wasFrozen=table()->frozen(); table()->freeze(); fontStruct((XFontStruct *)server()->fontStruct(font())); table()->calculateRowHeight(); table()->adjustNumVisible(); if (wasFrozen==MSFalse) table()->unfreeze(); } } void AplusTableColumn::updateForeground(unsigned long oldfg_) { MSWidget::updateForeground(oldfg_); redraw(); } void AplusTableColumn::forceEval(void) const { if(model()!=0) { ((AplusModel*)model())->a(); } } void AplusTableColumn::columnResizeCB(void) { AplusModel *pModel = (AplusModel *)model(); if (pModel!=0) { AVariableData *pVarData = pModel->pAVarData(); if (pVarData!=0) { pVarData->colWidth(columnWidth(),MSFalse); // update colWidth and DO NOT send an event to the view activateCallback("columnresizecb"); } } } void AplusTableColumn::setClipMode(void) { AplusModel *pModel=(AplusModel *)model(); if (pModel!=0) { V v=pModel->aplusVar(); if (v!=0) { AVariableData *varData = ::pAVarDataFromV(v); if (varData->stars()==MSTrue) { clipMode(MSClipStars); } else { clipMode(MSNoClipping); } } } } unsigned AplusTableColumn::numRows(void) const { return(model()!=0)?((AplusModel*)model())->numRows():0; } unsigned AplusTableColumn::numColumns(void) const { return(model()!=0)?((AplusModel*)model())->numCols():0; } const MSSymbol& AplusTableColumn::widgetType(void) const { return symbol(); } const MSSymbol& AplusTableColumn::symbol(void) { static MSSymbol sym("AplusTableColumn"); return sym; } aplus-fsf-4.22/src/AplusGUI/AplusText.C0000644000265000001440000000717210772770347013320 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include extern long dbg_tmstk; AplusText::AplusText(MSWidget *owner_) : MSText(owner_) { AplusModel *am=new AplusModel(0); INTERNAL_COUPLE(am); } AplusText::~AplusText(void) {} MSBoolean AplusText::verifyData(V,A a_) { return (0!=a_&&QA(a_)&&a_->t==Ct&&a_->r==1)?MSTrue:MSFalse; } void AplusText::updateData(void) { AplusModel *am=(AplusModel *) model(); if (am && am->aplusVar() && am->a()) string((char *)am->a()->p); else string(""); } void AplusText::receiveEvent(MSEvent &event_) { if (event_.type() == AplusEvent::symbol()) { if (dbg_tmstk) cout << "Received UpdateEvent in AplusText" << endl; updateData(); } if (event_.type() == AplusVerifyEvent::symbol()) { if (dbg_tmstk) cout << "Received VerifyEvent in AplusText" << endl; AplusVerifyEvent *ave = (AplusVerifyEvent *) &event_; ave->result(verifyData(ave->aplusVar(), ave->a())); } } void AplusText::addSenderNotify(MSEventSender *m_) { INTERNAL_COUPLE(((AplusModel *) m_)); } void AplusText::doClearSelection() { unsigned row,col; positionToRowCol(selectionStart(),row,col); moveCursor(row,col); text().remove(selectionStart(),selectionLength()); resetLinesFrom(row); clearSelection(); return; } // keyPress() is overriden here to provide proper key translation for APL characters. // MSText widget currently does not support that. // void AplusText::keyPress(const XEvent *e_,KeySym k_,unsigned int state_,const char *b_) { MSKeyPress keyPress(k_,state_); if (isProtected()==MSFalse) { MSBoolean hasMatch = keyTranslationTable()->hasMatch(keyPress); if ((hasMatch == MSTrue)) { MSBoolean cleared=MSFalse; if (selectionLength()>0) { doClearSelection(); cleared=MSTrue; } MSBoolean done = MSFalse; if( cleared==MSTrue && (k_==XK_BackSpace || k_==XK_Delete) ) done = MSTrue; else done = keyTranslate(keyPress); if ( strlen(b_)>0 && done == MSFalse ) insertString(b_); return; } else if (MSTextField::keyTranslationFunction()!=0) { const char *tString=(*MSTextField::keyTranslationFunction())(e_); if (tString!=0) { if (selectionLength()>0) { doClearSelection(); } insertString(tString); return; } } if (strlen(b_)>0) { if (selectionLength()>0) { doClearSelection(); } insertString(b_); } } else if(sensitive() == MSTrue) { //We are "ReadOnly" but still sensitive, so process Up/Down,etc.... keyTranslate(keyPress); } } MSBoolean AplusText::isProtected(void) const { if (_model==0) { return MSFalse; } AplusModel *pModel = (AplusModel *)_model; V v = pModel->aplusVar(); if (v==0) { return MSFalse; } AVariableData *varData = ::pAVarDataFromV(v); if (varData==0) { return MSFalse; } AReadOnlyFunction *roFunc=AplusModel::getReadOnlyFunc(v); if (roFunc==0) // if there is no function installed { return varData->readOnly(); // return the stored value } else // A+ function is installed { return roFunc->invoke(v,pModel->a()); } } const MSSymbol& AplusText::widgetType(void) const { return symbol(); } const MSSymbol& AplusText::symbol(void) { static MSSymbol sym("AplusText"); return sym; } aplus-fsf-4.22/src/AplusGUI/AplusTrace.C0000644000265000001440000012002510772770347013423 /////////////////////////////////////////////////////////////////////////////// // // Copyrightg (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include extern long dbg_tmstk; extern A grc(A,int,int); extern int safeAset(V,::A,::A,::A); const int EnumHashTableSize=64; static const int DefaultTraceSymbolSize=11; MSBoolean AplusTraceSet::_initialized=MSFalse; MSHashTable AplusTraceSet::_enumHashTable(EnumHashTableSize); MSHashTable AplusTraceSet::_constraintEnumHashTable(EnumHashTableSize); MSHashTable AplusTraceSet::_styleEnumHashTable(EnumHashTableSize); MSHashTable AplusTraceSet::_symbolEnumHashTable(EnumHashTableSize); AplusTrace::AplusTrace(MSTraceSet *traceSet_,int col_,const MSSymbol& tag_): MSTrace(traceSet_,col_,tag_) { _gradient=MSFalse; } AplusTrace::~AplusTrace(void) {} V AplusTrace::aplusVar(void) { V v=0; AplusTraceSet *ats=(AplusTraceSet *) traceSet(); if (ats) v=((AplusModel *)ats->model())->aplusVar(); return v; } AplusTraceSet::AplusTraceSet(MSGraph *owner_) : MSTraceSet(owner_) { if (_initialized==MSFalse) { _initialized=MSTrue; initEnumHashTable(); initStringEnumHashTable(); } _outStr=aplus_nl; AplusModel *am=new AplusModel(0); INTERNAL_COUPLE(am); } AplusTraceSet::~AplusTraceSet(void) { dc(_outStr); } void AplusTraceSet::initEnumHashTable(void) { enumHashTable()->notFound((unsigned long)0); enumHashTable()->add("" ,(void*)MSNone); enumHashTable()->add("traceStyle" ,(void*)_TraceStyle); enumHashTable()->add("traceSymbol" ,(void*)_Symbol); enumHashTable()->add("traceConstraint",(void*)_Constraint); enumHashTable()->add("traceLineStyle" ,(void*)_LineStyle); enumHashTable()->add("none" ,(void*)MSNone); enumHashTable()->add("line" ,(void*)MSG::Line); enumHashTable()->add("outline" ,(void*)MSG::Outline); enumHashTable()->add("scatter" ,(void*)MSG::Scatter); enumHashTable()->add("linescatter" ,(void*)(MSG::Line | MSG::Scatter)); enumHashTable()->add("ls" ,(void*)(MSG::Line | MSG::Scatter)); enumHashTable()->add("area" ,(void*)MSG::Area); enumHashTable()->add("bar" ,(void*)MSG::Bar); enumHashTable()->add("c" ,(void*)MSG::Close); enumHashTable()->add("close" ,(void*)MSG::Close); enumHashTable()->add("highlow" ,(void*)MSG::HL); enumHashTable()->add("hl" ,(void*)MSG::HL); enumHashTable()->add("highlowoc" ,(void*)MSG::HLOC); enumHashTable()->add("ohlc" ,(void*)MSG::HLOC); enumHashTable()->add("highlowc" ,(void*)MSG::HLC); enumHashTable()->add("hlc" ,(void*)MSG::HLC); enumHashTable()->add("candle" ,(void*)MSG::Candle); enumHashTable()->add("stack" ,(void*)MSG::Stack); enumHashTable()->add("step" ,(void*)MSG::Step); enumHashTable()->add("stepscatter" ,(void*)(MSG::Step | MSG::Scatter)); enumHashTable()->add("ss" ,(void*)(MSG::Step | MSG::Scatter)); enumHashTable()->add("pie" ,(void*)MSG::Pie); enumHashTable()->add("osc" ,(void*)MSG::Osc); enumHashTable()->add("fill" ,(void*)MSG::Fill); enumHashTable()->add("segment" ,(void*)MSG::Segment); enumHashTable()->add("text" ,(void*)MSG::Text); enumHashTable()->add("marketprofile" ,(void*)MSG::MarketProfile); enumHashTable()->add("colorprofile" ,(void*)MSG::ColorProfile); enumHashTable()->add("mp" ,(void*)MSG::MarketProfile); enumHashTable()->add("cp" ,(void*)MSG::ColorProfile); enumHashTable()->add("circle" ,(void*)MSG::Circle); enumHashTable()->add("circlecross" ,(void*)(MSG::Cross | MSG::Circle)); enumHashTable()->add("circlediamond" ,(void*)(MSG::Diamond | MSG::Circle)); enumHashTable()->add("circletriangle" ,(void*)(MSG::Triangle | MSG::Circle)); enumHashTable()->add("circlefilled" ,(void*)(MSG::Circle | MSG::Fill)); enumHashTable()->add("cross" ,(void*)MSG::Cross); enumHashTable()->add("diamond" ,(void*)MSG::Diamond); enumHashTable()->add("diamondcross" ,(void*)(MSG::Diamond | MSG::Cross)); enumHashTable()->add("diamondfilled" ,(void*)(MSG::Diamond | MSG::Fill)); enumHashTable()->add("square" ,(void*)MSG::Square); enumHashTable()->add("squarecross" ,(void*)(MSG::Square | MSG::Cross)); enumHashTable()->add("squarecircle" ,(void*)(MSG::Square | MSG::Circle)); enumHashTable()->add("squarefilled" ,(void*)(MSG::Square | MSG::Fill)); enumHashTable()->add("star" ,(void*)(MSG::Cross | MSG::X)); enumHashTable()->add("triangle" ,(void*)MSG::Triangle); enumHashTable()->add("trianglefilled" ,(void*)(MSG::Triangle | MSG::Fill)); enumHashTable()->add("xsym" ,(void*)MSG::X); enumHashTable()->add("x" ,(void*)MSG::HoldX); enumHashTable()->add("y" ,(void*)MSG::HoldY); } void AplusTraceSet::initStringEnumHashTable(void) { constraintEnumHashTable()->notFound((unsigned long)0); constraintEnumHashTable()->add((unsigned long)MSNone,(void*)"none"); constraintEnumHashTable()->add(MSG::HoldY ,(void*)"y"); constraintEnumHashTable()->add(MSG::HoldX ,(void*)"x"); styleEnumHashTable()->notFound((unsigned long)0); styleEnumHashTable()->add((unsigned long) MSNone ,(void*)"none"); styleEnumHashTable()->add(MSG::Line ,(void*)"line"); styleEnumHashTable()->add(MSG::Outline ,(void*)"outline"); styleEnumHashTable()->add(MSG::Scatter ,(void*)"scatter"); styleEnumHashTable()->add(MSG::Line | MSG::Scatter ,(void*)"ls"); styleEnumHashTable()->add(MSG::Area ,(void*)"area"); styleEnumHashTable()->add(MSG::Bar ,(void*)"bar"); styleEnumHashTable()->add(MSG::Close ,(void*)"close"); styleEnumHashTable()->add(MSG::HL ,(void*)"hl"); styleEnumHashTable()->add(MSG::HLOC ,(void*)"ohlc"); styleEnumHashTable()->add(MSG::HLC ,(void*)"hlc"); styleEnumHashTable()->add(MSG::Candle ,(void*)"candle"); styleEnumHashTable()->add(MSG::Pie ,(void*)"pie"); styleEnumHashTable()->add(MSG::Stack ,(void*)"stack"); styleEnumHashTable()->add(MSG::Step ,(void*)"step"); styleEnumHashTable()->add(MSG::Step | MSG::Scatter ,(void*)"stepscatter"); styleEnumHashTable()->add(MSG::Osc ,(void*)"osc"); styleEnumHashTable()->add(MSG::Fill ,(void*)"fill"); styleEnumHashTable()->add(MSG::Segment ,(void*)"segment"); styleEnumHashTable()->add(MSG::Text ,(void*)"text"); styleEnumHashTable()->add(MSG::MarketProfile ,(void*)"marketprofile"); styleEnumHashTable()->add(MSG::ColorProfile ,(void*)"colorprofile"); symbolEnumHashTable()->notFound((unsigned long)0); symbolEnumHashTable()->add((unsigned long) MSNone ,(void*)"none"); symbolEnumHashTable()->add(MSG::Circle ,(void*)"circle"); symbolEnumHashTable()->add(MSG::Circle | MSG::Cross ,(void*)"circlecross"); symbolEnumHashTable()->add(MSG::Circle | MSG::Diamond ,(void*)"circlediamond"); symbolEnumHashTable()->add(MSG::Circle | MSG::Triangle ,(void*)"circletriangle"); symbolEnumHashTable()->add(MSG::Circle | MSG::Fill ,(void*)"circlefilled"); symbolEnumHashTable()->add(MSG::Cross ,(void*)"cross"); symbolEnumHashTable()->add(MSG::Diamond ,(void*)"diamond"); symbolEnumHashTable()->add(MSG::Diamond | MSG::Cross ,(void*)"diamondcross"); symbolEnumHashTable()->add(MSG::Diamond | MSG::Fill ,(void*)"diamondfilled"); symbolEnumHashTable()->add(MSG::Square ,(void*)"square"); symbolEnumHashTable()->add(MSG::Square | MSG::Cross ,(void*)"squarecross"); symbolEnumHashTable()->add(MSG::Square | MSG::Circle ,(void*)"squarecircle"); symbolEnumHashTable()->add(MSG::Square | MSG::Fill ,(void*)"squarefilled"); symbolEnumHashTable()->add(MSG::Cross | MSG::X ,(void*)"star"); symbolEnumHashTable()->add(MSG::Triangle ,(void*)"triangle"); symbolEnumHashTable()->add(MSG::Triangle | MSG::Fill ,(void*)"trianglefilled"); symbolEnumHashTable()->add(MSG::X ,(void*)"xsym"); } A AplusTraceSet::enumSymbols(const char *str_) { A r=aplus_nl; TraceEnum k; if ((k=(TraceEnum)(unsigned long)enumHashTable()->lookup(str_))>=0&& (k>=_TraceStyle&&k<=_Constraint)) { switch(k) { case _TraceStyle: r=gv(Et,20); r->p[0]=MS(si((char *) styleEnumHashTable()->lookup(MSG::Line ))); r->p[1]=MS(si((char *) styleEnumHashTable()->lookup(MSG::Outline ))); r->p[2]=MS(si((char *) styleEnumHashTable()->lookup(MSG::Scatter ))); r->p[3]=MS(si((char *) styleEnumHashTable()->lookup(MSG::Line | MSG::Scatter ))); r->p[4]=MS(si((char *) styleEnumHashTable()->lookup(MSG::Bar ))); r->p[5]=MS(si((char *) styleEnumHashTable()->lookup(MSG::Area ))); r->p[6]=MS(si((char *) styleEnumHashTable()->lookup(MSG::Close ))); r->p[7]=MS(si((char *) styleEnumHashTable()->lookup(MSG::HL ))); r->p[9]=MS(si((char *) styleEnumHashTable()->lookup(MSG::HLOC ))); r->p[8]=MS(si((char *) styleEnumHashTable()->lookup(MSG::HLC ))); r->p[10]=MS(si((char *)styleEnumHashTable()->lookup(MSG::Candle ))); r->p[10]=MS(si((char *)styleEnumHashTable()->lookup(MSG::Pie ))); r->p[11]=MS(si((char *)styleEnumHashTable()->lookup(MSG::Stack ))); r->p[12]=MS(si((char *)styleEnumHashTable()->lookup(MSG::Step ))); r->p[13]=MS(si((char *)styleEnumHashTable()->lookup(MSG::Step | MSG::Scatter ))); r->p[14]=MS(si((char *)styleEnumHashTable()->lookup(MSG::MarketProfile ))); r->p[15]=MS(si((char *)styleEnumHashTable()->lookup(MSG::ColorProfile ))); r->p[16]=MS(si((char *)styleEnumHashTable()->lookup(MSG::Fill ))); r->p[17]=MS(si((char *)styleEnumHashTable()->lookup(MSG::Segment ))); r->p[18]=MS(si((char *)styleEnumHashTable()->lookup(MSG::Text ))); r->p[19]=MS(si((char *)styleEnumHashTable()->lookup((unsigned long)MSNone ))); break; case _Symbol: r=gv(Et,12); r->p[0]=MS(si((char *) symbolEnumHashTable()->lookup(MSG::Square ))); r->p[1]=MS(si((char *) symbolEnumHashTable()->lookup(MSG::Square | MSG::Fill ))); r->p[2]=MS(si((char *) symbolEnumHashTable()->lookup(MSG::Circle ))); r->p[3]=MS(si((char *) symbolEnumHashTable()->lookup(MSG::Circle | MSG::Fill ))); r->p[4]=MS(si((char *) symbolEnumHashTable()->lookup(MSG::Diamond ))); r->p[5]=MS(si((char *) symbolEnumHashTable()->lookup(MSG::Diamond | MSG::Fill ))); r->p[6]=MS(si((char *) symbolEnumHashTable()->lookup(MSG::Cross ))); r->p[7]=MS(si((char *) symbolEnumHashTable()->lookup(MSG::X ))); r->p[8]=MS(si((char *) symbolEnumHashTable()->lookup(MSG::Cross | MSG::X ))); r->p[9]=MS(si((char *) symbolEnumHashTable()->lookup(MSG::Triangle ))); r->p[10]=MS(si((char *)symbolEnumHashTable()->lookup(MSG::Triangle | MSG::Fill ))); r->p[11]=MS(si("char")); break; case _Constraint: r=gv(Et,3); r->p[0]=MS(si((char *) constraintEnumHashTable()->lookup((unsigned long) MSNone))); r->p[1]=MS(si((char *) constraintEnumHashTable()->lookup(MSG::HoldX ))); r->p[2]=MS(si((char *) constraintEnumHashTable()->lookup(MSG::HoldY ))); break; case _LineStyle: r=gv(Et,4); r->p[0]=MS(si((char *)graph()->stringEnumHashTable()->lookup(AplusGraph::Solid))); r->p[1]=MS(si((char *)graph()->stringEnumHashTable()->lookup(AplusGraph::Dash2))); r->p[2]=MS(si((char *)graph()->stringEnumHashTable()->lookup(AplusGraph::DotDash2))); r->p[3]=MS(si((char *)graph()->stringEnumHashTable()->lookup(AplusGraph::Dot2))); break; } } else graph()->enumError()->showError(((AplusModel*)model())->aplusVar(),str_); return r; } //////////////////////////////////////////////////////////////////////////////////////////////////// // The following functions set the functions attributes //////////////////////////////////////////////////////////////////////////////////////////////////// void AplusTraceSet::lineStyleFunc(AFunc func_,A fc_) { AClientData *ac=new AClientData((A)fc_->p[0],(A)fc_->p[1]); lineStyleFunc()->func(func_); lineStyleFunc()->arg(ac); lineStyleFuncInvoke(); } void AplusTraceSet::lineWidthFunc(AFunc func_,A fc_) { AClientData *ac=new AClientData((A)fc_->p[0],(A)fc_->p[1]); lineWidthFunc()->func(func_); lineWidthFunc()->arg(ac); lineWidthFuncInvoke(); } void AplusTraceSet::pieOffsetFunc(AFunc func_,A fc_) { AClientData *ac=new AClientData((A)fc_->p[0],(A)fc_->p[1]); pieOffsetFunc()->func(func_); pieOffsetFunc()->arg(ac); pieOffsetFuncInvoke(); } void AplusTraceSet::gradientFunc(AFunc func_,A fc_) { AClientData *ac=new AClientData((A)fc_->p[0],(A)fc_->p[1]); gradientFunc()->func(func_); gradientFunc()->arg(ac); gradientFuncInvoke(); } void AplusTraceSet::fillColorFunc(AFunc func_,A fc_) { AClientData *ac=new AClientData((A)fc_->p[0],(A)fc_->p[1]); AColorFunction *f=(AColorFunction *) fillColorFunc(); f->func(func_); f->arg(ac); fillColorFuncInvoke(); } void AplusTraceSet::lineColorFunc(AFunc func_,A fc_) { AClientData *ac=new AClientData((A)fc_->p[0],(A)fc_->p[1]); AColorFunction *f=(AColorFunction *) lineColorFunc(); f->func(func_); f->arg(ac); lineColorFuncInvoke(); } void AplusTraceSet::legendFunc(AFunc func_,A fc_) { AClientData *ac=new AClientData((A)fc_->p[0],(A)fc_->p[1]); legendFunc()->func(func_); legendFunc()->arg(ac); legendFuncInvoke(); } void AplusTraceSet::traceSymbolFunc(AFunc func_,A fc_) { AClientData *ac=new AClientData((A)fc_->p[0],(A)fc_->p[1]); traceSymbolFunc()->func(func_); traceSymbolFunc()->arg(ac); traceSymbolFuncInvoke(); } void AplusTraceSet::traceSymbolSizeFunc(AFunc func_,A fc_) { AClientData *ac=new AClientData((A)fc_->p[0],(A)fc_->p[1]); traceSymbolSizeFunc()->func(func_); traceSymbolSizeFunc()->arg(ac); traceSymbolSizeFuncInvoke(); } void AplusTraceSet::altXaxisFunc(AFunc func_,A fc_) { AClientData *ac=new AClientData((A)fc_->p[0],(A)fc_->p[1]); altXaxisFunc()->func(func_); altXaxisFunc()->arg(ac); altXaxisFuncInvoke(); } void AplusTraceSet::altYaxisFunc(AFunc func_,A fc_) { AClientData *ac=new AClientData((A)fc_->p[0],(A)fc_->p[1]); altYaxisFunc()->func(func_); altYaxisFunc()->arg(ac); altYaxisFuncInvoke(); } void AplusTraceSet::traceStyleFunc(AFunc func_,A fc_) { AClientData *ac=new AClientData((A)fc_->p[0],(A)fc_->p[1]); traceStyleFunc()->func(func_); traceStyleFunc()->arg(ac); traceStyleFuncInvoke(); } //////////////////////////////////////////////////////////////////////////////////////////////////// // The following functions invoke and set the attributes //////////////////////////////////////////////////////////////////////////////////////////////////// void AplusTraceSet::lineStyleFuncInvoke(void) { if (lineStyleFunc()->func()!=0) { A sym=aplus_nl; V v=((AplusModel*)model())->aplusVar(); A a=(A)((AplusModel*)model())->a(); int rank=((AplusModel*)model())->rank(); MSUnsignedLongVector styleVector; MSUnsignedVector weightVector; unsigned long style,weight; AplusGraph::LineStyle s; if (rank==1) { sym=(A) lineStyleFunc()->invoke(v,a,-1,-1,aplus_nl); if ((s=(AplusGraph::LineStyle)(unsigned long)graph()->enumHashTable()->lookup((char *)XS(*sym->p)->n))>0&& graph()->styleConvert(s,style,weight)==MSTrue) { styleVector<<(unsigned long) style; weightVector<<(unsigned) weight; } else graph()->enumError()->showError(((AplusModel*)model())->aplusVar(),(char *)XS(sym->p[0])->n); dc(sym); } else { for(int i=0;iinvoke(v,a,-1,i+1,aplus_nl); if ((s=(AplusGraph::LineStyle)(unsigned long)graph()->enumHashTable()->lookup((char *)XS(*sym->p)->n))>0&& graph()->styleConvert(s,style,weight)==MSTrue) { styleVector<<(unsigned long) style; weightVector<<(unsigned) weight; } else graph()->enumError()->showError(((AplusModel*)model())->aplusVar(),(char *)XS(sym->p[0])->n); dc(sym); } } if (styleVector.length()>0) { freeze(); lineStyle(styleVector); unfreeze(); } if (weightVector.length()>0) lineWeight(weightVector); } } void AplusTraceSet::lineWidthFuncInvoke(void) { if (lineWidthFunc()->func()!=0) { int ret; V v=((AplusModel*)model())->aplusVar(); A a=(A)((AplusModel*)model())->a(); int rank=((AplusModel*)model())->rank(); MSUnsignedVector uv; if (rank==1) { ret=(int) lineWidthFunc()->intInvoke(v,a,-1,-1,aplus_nl); uv<<(unsigned) (ret<0?0:ret); } else { for(int i=0;iintInvoke(v,a,-1,i+1,aplus_nl); uv<<(unsigned) (ret<0?0:ret); } } if (uv.length()>0) lineWidth(uv); } } void AplusTraceSet::pieOffsetFuncInvoke(void) { if (pieOffsetFunc()->func()!=0) { int ret; V v=((AplusModel*)model())->aplusVar(); A a=(A)((AplusModel*)model())->a(); int rank=((AplusModel*)model())->rank(); MSFloatVector fv; if (rank==1) { ret= pieOffsetFunc()->intInvoke(v,a,-1,-1,aplus_nl); fv<<(double) (ret<0?0:ret); } else { for(int i=0;iintInvoke(v,a,-1,i+1,aplus_nl); fv<<(double) (ret<0?0:ret); } } if (fv.length()>0) pieOffsets(fv); } } void AplusTraceSet::gradientFuncInvoke(void) { if (gradientFunc()->func()!=0) { int ret; V v=((AplusModel*)model())->aplusVar(); A a=(A)((AplusModel*)model())->a(); int rank=((AplusModel*)model())->rank(); MSUnsignedVector uv; if (rank==1) { ret=(int) gradientFunc()->intInvoke(v,a,-1,-1,aplus_nl); uv<<(unsigned) (ret<0?0:ret); } else { for(int i=0;iintInvoke(v,a,-1,i+1,aplus_nl); uv<<(unsigned) (ret<0?0:ret); } } if (uv.length()>0) gradient(uv); } } void AplusTraceSet::fillColorFuncInvoke(void) { AColorFunction *f=(AColorFunction *) fillColorFunc(); if (f->func()!=0) { V v=((AplusModel*)model())->aplusVar(); A a=(A)((AplusModel*)model())->a(); int rank=((AplusModel*)model())->rank(); MSUnsignedLongVector uv; AplusTrace *t=trace(0); if (rank!=1) { for(int i=0;iinvoke(v,a,-1,i+1,aplus_nl); } } else if (t!=0&&t->style()==MSG::Pie) { for(int i=0;iinvoke(v,a,-1,i+1,aplus_nl); } } else uv<<(unsigned long) f->invoke(v,a,-1,-1,aplus_nl); if (uv.length()>0) MSTraceSet::fillColor(uv); } } void AplusTraceSet::lineColorFuncInvoke(void) { AColorFunction *f=(AColorFunction *)lineColorFunc(); if (f->func()!=0) { V v=((AplusModel*)model())->aplusVar(); A a=(A)((AplusModel*)model())->a(); int rank=((AplusModel*)model())->rank(); MSUnsignedLongVector uv; if (rank!=1) { for(int i=0;iinvoke(v,a,-1,i+1,aplus_nl); } } else uv<<(unsigned long) f->invoke(v,a,-1,-1,aplus_nl); if (uv.length()>0) MSTraceSet::lineColor(uv); } } void AplusTraceSet::legendFuncInvoke(void) { A outStr=aplus_nl; if (legendFunc()->func()!=0) { V v=((AplusModel*)model())->aplusVar(); A a=(A)((AplusModel*)model())->a(); int rank=((AplusModel*)model())->rank(); if (rank==1) { outStr=(A) legendFunc()->invoke(v,a,-1,-1,aplus_nl); legend((char *)outStr->p); } else { MSStringVector sv; for(int i=0;iinvoke(v,a,-1,i+1,aplus_nl); sv<p); } legend(sv); } } } void AplusTraceSet::traceStyleFuncInvoke(void) { if (traceStyleFunc()->func()!=0) { A sym=aplus_nl; V v=((AplusModel*)model())->aplusVar(); A a=(A)((AplusModel*)model())->a(); int rank=((AplusModel*)model())->rank(); MSUnsignedLongVector traceStyleVector; unsigned long s; if (rank==1) { sym=(A) traceStyleFunc()->invoke(v,a,-1,-1,aplus_nl); traceStyleVector<invoke(v,a,-1,i+1,aplus_nl); s=convertTraceStyle(sym); traceStyleVector<=MSG::Close) // If one of the 4-column styles,ignore the rest { style(s); return; } } } style(traceStyleVector); // invoke line width functions } } void AplusTraceSet::traceSymbolFuncInvoke(void) { if (traceSymbolFunc()->func()!=0) { A sym=aplus_nl; V v=((AplusModel*)model())->aplusVar(); A a=(A)((AplusModel*)model())->a(); int rank=((AplusModel*)model())->rank(); MSUnsignedLongVector symbolVector; MSStringVector textVector; unsigned long traceSym; MSString stringSymbol; if (rank==1) { sym=(A) traceSymbolFunc()->invoke(v,a,-1,-1,aplus_nl); convertTraceSymbol(sym,traceSym,stringSymbol); symbolVector<invoke(v,a,-1,i+1,aplus_nl); convertTraceSymbol(sym,traceSym,stringSymbol); symbolVector<func()!=0) { MSUnsignedVector sizeVector; unsigned ret=DefaultTraceSymbolSize; V v=((AplusModel*)model())->aplusVar(); A a=(A)((AplusModel*)model())->a(); int rank=((AplusModel*)model())->rank(); int r; if (rank==1) { r=(int) (traceSymbolSizeFunc()->intInvoke(v,a,-1,-1,aplus_nl)); sizeVector<<(unsigned) ((r<=0)?ret:r); } else { for(int i=0;iintInvoke(v,a,-1,i+1,aplus_nl)); sizeVector<<(unsigned) ((r<=0)?ret:r); } } if (sizeVector.length()>0) symbolSize(sizeVector); } } void AplusTraceSet::altXaxisFuncInvoke(void) { if (altXaxisFunc()->func()!=0) { A sym; unsigned long axis; MSUnsignedLongVector axisVector; V v=((AplusModel*)model())->aplusVar(); A a=(A)((AplusModel*)model())->a(); int rank=((AplusModel*)model())->rank(); if (rank==1) { sym=altXaxisFunc()->invoke(v,a,-1,-1,aplus_nl); if (convertXAxis(sym,axis)==MSTrue) axisVector<invoke(v,a,-1,i+1,aplus_nl); if (convertXAxis(sym,axis)==MSTrue) axisVector<0) xAxis(axisVector, MSInit); } } void AplusTraceSet::altYaxisFuncInvoke(void) { if (altYaxisFunc()->func()!=0) { A sym; unsigned long axis; MSUnsignedLongVector axisVector; V v=((AplusModel*)model())->aplusVar(); A a=(A)((AplusModel*)model())->a(); int rank=((AplusModel*)model())->rank(); if (rank==1) { sym=altYaxisFunc()->invoke(v,a,-1,-1,aplus_nl); if (convertYAxis(sym,axis)==MSTrue) axisVector<invoke(v,a,-1,i+1,aplus_nl); if (convertYAxis(sym,axis)==MSTrue) axisVector<0) yAxis(axisVector, MSInit); } } //////////////////////////////////////////////////////////////////////////////////////////////////// // The follow functions converts A symbols to the proper MSTK enums/values //////////////////////////////////////////////////////////////////////////////////////////////////// unsigned long AplusTraceSet::convertTraceStyle(A sym_) { long style=-1; V v=((AplusModel*)model())->aplusVar(); if (isNull(sym_)==MSFalse) { if (QS(sym_)) { style=(long)(enumHashTable()->lookup((char *)XS(sym_)->n)); } else if (sym_->t==Et&&sym_->n>0&&QS(*sym_->p)) { style=(long)(enumHashTable()->lookup((char *)XS(*sym_->p)->n)); } if (styleMSG::ColorProfile) { graph()->enumError()->showError(v,(char *)XS(sym_->p[0])->n); style=(long)MSG::Line; } } return style==-1?MSG::Line:(unsigned long)style; } void AplusTraceSet::convertTraceSymbol(A sym_,unsigned long&traceSym_,MSString&string_) { unsigned long symbol=MSG::Cross; if (QS(sym_)) { symbol=(unsigned long) enumHashTable()->lookup((char *)XS(sym_)->n); string_=(char *)XS(sym_)->n; } else if (sym_->t==Et&&sym_->n>0&&QS(*sym_->p)) { symbol=(unsigned long) enumHashTable()->lookup((char *)XS(*sym_->p)->n); string_=(char *)XS(*sym_->p)->n; dc(sym_); } else if (sym_->t==Ct&&sym_->n>0) { string_=(char *)sym_->p; dc(sym_); symbol=MSG::Text; } traceSym_=(symbol(MSG::Triangle | MSG::Fill))?MSG::Text:symbol; } MSBoolean AplusTraceSet::convertYAxis(A sym_,unsigned long&axis_) { if (isNull(sym_)==MSFalse && QA(sym_) && QS(*sym_->p)) { char *style=(char *)XS(sym_->p[0])->n; axis_=(strcmp(style,"Y")==0)?MSRight:(strcmp(style,"y")==0)?MSLeft:-1; V v=((AplusModel*)model())->aplusVar(); if (axis_<0) graph()->enumError()->showError(v,(char *)XS(sym_->p[0])->n); return MSTrue; } return MSFalse; } MSBoolean AplusTraceSet::convertXAxis(A sym_,unsigned long&axis_) { if (isNull(sym_)==MSFalse && QA(sym_) && QS(*sym_->p)) { char *style=(char *)XS(sym_->p[0])->n; axis_=(strcmp(style,"X")==0)?MSTop:(strcmp(style,"x")==0)?MSLeft:-1; V v=((AplusModel*)model())->aplusVar(); if (axis_<0) graph()->enumError()->showError(v,(char *)XS(sym_->p[0])->n); return MSTrue; } return MSFalse; } //////////////////////////////////////////////////////////////////////////////////////////////////// A AplusTraceSet::selected(void) // Call selectRow and selectColumn { A index=0; A av=(A)((AplusModel *)model())->aplusVar()->a; int row=selectRow(); int col=selectCol(); if (row!=-1&&col!=-1) { if (av->r==2) { index=gv(It,2); index->p[0]=(I)row; index->p[1]=(I)col+1; } else { index=gv(It,1); index->p[0]=(I)col+1; } } return index; } void AplusTraceSet::selected(A index_) { if (isNull(index_)==MSFalse && (index_->t==It||index_->t==Ft)) { P p; p.i=index_->p; A av=(A)((AplusModel *)model())->aplusVar()->a; int row=-1,col=0; if (av->r==2&&index_->n==2) { row=(int)(index_->t==Ft?p.f[0]:p.i[0]); col=(int)(index_->t==Ft?p.f[1]:p.i[1]); if (col<1||col>numColumns()) row=-1; } else if (av->r==1) { row=(int)(index_->t==Ft?p.f[0]:p.i[0]); } if (row>0&&col<(numColumns())&&rowhighlightPoint(this); } } } A AplusTraceSet::constraintSym(void) { A a=gs(Et); *a->p=MS(si((char *)constraintEnumHashTable()->lookup(constraint()))); return a; } void AplusTraceSet::constraint(A sym_) { if (!QS(sym_)&&(sym_->t==Et&&sym_->n>0&&QS(*sym_->p))) { unsigned long k; if ((k=(Constraint)(unsigned long)enumHashTable()->lookup((char *)XS(sym_->p[0])->n))>=0&& (k>=MSNone&&k<=MSG::HoldY)) { MSTraceSet::constraint(k); } else graph()->enumError()->showError(((AplusModel*)model())->aplusVar(),(char *)XS(sym_->p[0])->n); } } A AplusTraceSet::coordinate(void) { return computeAdjustedData(xOffset(),yOffset()); } //////////////////////////////////////////////////////////////////////////////////////////////////// // Virtual functions from MSTraceSet to access data //////////////////////////////////////////////////////////////////////////////////////////////////// int AplusTraceSet::numRows(void) const { return(model()!=0)?((AplusModel*)model())->numRows():0; } int AplusTraceSet::numColumns(void) const { A av=((AplusModel*)model())->a(); return (av->r<=1?1:av->d[1]<2?2:av->d[1]); } int AplusTraceSet::dataCount(void) const { A av=(A)((AplusModel*)model())->a(); return (av->r<=1)?av->n:av->r==2&&av->n==0?0:av->d[0]; } double AplusTraceSet::x(int index_) const { double r=index_; A av=(A)((AplusModel*)model())->aplusVar()->a; if (av->r==2) { P p; p.i=av->p; int offset=index_*(int)av->d[1]; r=(av->t==It)?(double)p.i[offset]:p.f[offset]; } return r; } double AplusTraceSet::y(int index_,int col_) const { double r=0.0; A av=(A)((AplusModel*)model())->aplusVar()->a; P p; p.i=av->p; if (av->r==1) { r=(av->t==It)?(double)p.i[index_]:p.f[index_]; } if (av->r==2) { int offset=index_*(int)av->d[1]+col_+1; r=(av->t==It)?(double)p.i[offset]:p.f[offset]; } return r; } unsigned long AplusTraceSet::traceLineColor(int row_,int col_) const { unsigned long ret=foreground(); V v=((AplusModel*)model())->aplusVar(); int rank=((AplusModel*)model())->rank(); A a=(A)((AplusModel*)model())->a(); AColorFunction *f=(AColorFunction *) lineColorFunc(); // Need to cast away constness AplusTrace *t=trace(col_); if (t&&t->gradient()==MSTrue&&f->func()!=0) { int c=rank==1?-1:col_; double fv=t->y(row_); ret=(unsigned long) f->invoke(v,(a->t==It)?(int)fv:fv,row_,c,aplus_nl); } else if (t) ret=MSTraceSet::lineColor(col_); return ret; } unsigned long AplusTraceSet::traceFillColor(int row_,int col_) const { unsigned long ret=foreground(); V v=((AplusModel*)model())->aplusVar(); int rank=((AplusModel*)model())->rank(); A a=(A)((AplusModel*)model())->a(); AColorFunction *f=(AColorFunction *) fillColorFunc(); // Need to cast away constness AplusTrace *t=trace(col_); if (t&&(t->gradient()==MSTrue||t->style()==Pie)&&f->func()!=0) { int c=rank==1?-1:col_; double fv=t->y(row_); ret=(unsigned long) f->invoke(v,(a->t==It)?(int)fv:fv,row_,c,aplus_nl); } else if (t) ret=MSTraceSet::fillColor(col_); return ret; } void AplusTraceSet::validate(int row_,int col_,double x_,double y_) { A av=(A)((AplusModel*)model())->aplusVar()->a; V v=((AplusModel*)model())->aplusVar(); int i,setCols; A data,index,cols; if (av->r==1) // simple vector { A i=grc(av,row_,0); A d=(av->t==It)?gi((int)y_):gf(y_); if (safeAset(v,d,i,0)==0) showError(qs); dc(i); } else if (av->r==2) // simple matrix { unsigned long traceStyle=trace(col_)->style(); col_++; if (traceStyle>=MSG::Candle && traceStyle<=MSG::HLC) { setCols=numColumns()-1; data=gv(av->t,setCols); P p; p.i=data->p; for (i=0;it==It)?(p.i[i]=(I)y_):(p.f[i]=y_); } index=gv(Et,2); cols=gv(It,setCols); p.i=index->p; p.a[0]=(A)gi(row_); p.a[1]=cols; p.i=cols->p; for (i=0;it,2); P p; p.i=data->p; (av->t==It)?(p.i[0]=(I)x_,p.i[1]=(I)y_):(p.f[0]=x_,p.f[1]=y_); index=gv(Et,2); A cols=gv(It,2); // 1 one for x,1 row for y p.i=index->p; p.a[0]=(A)gi(row_); p.a[1]=cols; p.i=cols->p; p.i[0]=0; p.i[1]=col_; } else if (constraint()==MSG::HoldX) { data=(av->t==It)?gi((int)y_):gf(y_); index=grc(av,row_,col_); } else if (constraint()==MSG::HoldY) { data=(av->t==It)?gi((int)x_):gf(x_); index=grc(av,0,col_); } if (safeAset(v,data,index,0)==0) showError(qs); dc(index); } } //////////////////////////////////////////////////////////////////////////////////////////////////// // Widget Methods //////////////////////////////////////////////////////////////////////////////////////////////////// void AplusTraceSet::updateData(void) { V v=(model()!=0)?((AplusModel*)model())->aplusVar():0; if (v) { AplusTrace *pTrace=0; int cols=numColumns()>1?numColumns()-1:numColumns(); int numTraces=traceList().count(); freeze(); for (int i=numTraces-1;i>-1;i--) { if ((pTrace=(AplusTrace *)trace(i))!=0) { if (pTrace->virtualCol()>=cols) { traceList().remove(pTrace); graph()->traceList().remove(pTrace); delete pTrace; } else pTrace->virtualCol(i); } } if (cols>numTraces) { for (int i=numTraces;itraceList().add(pTrace); traceList().add(pTrace); } } // Invoke all functional attributes legendFuncInvoke(); lineColorFuncInvoke(); fillColorFuncInvoke(); lineStyleFuncInvoke(); lineWidthFuncInvoke(); pieOffsetFuncInvoke(); gradientFuncInvoke(); traceStyleFuncInvoke(); traceSymbolFuncInvoke(); traceSymbolSizeFuncInvoke(); altXaxisFuncInvoke(); altYaxisFuncInvoke(); unfreeze(); computeExtents(); lastDataCount(dataCount()); graph()->updateLegendStatus(MSTrue); graph()->redraw(); } } void AplusTraceSet::update(V v_,A index_,A,I ravel_) { if(!index_) update(v_,-1,-1,ShapeUpdate); else if(ravel_) // ravel update { A a=(A)v_->a; if(a->r==2&&a->n==1) { int n=(int)a->d[1]; int k=(int)index_->p[0]; int j=k/n; update(v_,j,k-n*j,ValueUpdate); } else update(v_,-1,-1,ValueUpdate); } else { A r=index_->t==It?index_:index_->n?(A)*index_->p:aplus_nl; A c=index_->t==Et&&index_->n>1?(A)index_->p[1]:aplus_nl; if(isNull(c)==MSTrue) // c is aplus_nl-all cols are updated { if(isNull(r)==MSTrue) update(v_,-1,-1,ValueUpdate); else if(r->n>0) update(v_,(int)r->p[r->n-1],-1,ValueUpdate); } else if(isNull(r)==MSTrue) update(v_,-1,-1,ValueUpdate); else if (r->n>0) update(v_,(int)r->p[r->n-1],(int)c->p[c->n-1],ValueUpdate); } } void AplusTraceSet::update(V v_,int r_,int c_,UpdateType t_) { if (v_!=0&&v_==((AplusModel*)model())->aplusVar()) { if (t_==ShapeUpdate) { updateTraceStyle(trace(0)!=0?trace(0)->style():MSG::Line); graph()->legend()->redraw(); graph()->redraw(); } else if (t_==SizeUpdate) graph()->redraw(); else if (t_==ValueUpdate) { MSIndexVector i; if (c_==-1&&r_==-1) {} else if (c_==-1) { i<<(r_*(numColumns()));} else if (r_==-1) {} else i<<(r_*(numColumns())); MSTraceSet::update(i); } } } void AplusTraceSet::addSenderNotify(MSEventSender *m_) { INTERNAL_COUPLE(((AplusModel *) m_)); } void AplusTraceSet::receiveEvent(MSEvent&event_) { if (event_.type()==AplusEvent::symbol()) { if (dbg_tmstk) cout<<"Received UpdateEvent in AplusTraceSet" <aplusVar(); A index=ave->index(); A pick=ave->pick(); I ravel=ave->ravel();; update(v,index,pick,ravel); } if (event_.type()==AplusVerifyEvent::symbol()) { if (dbg_tmstk) cout<<"Received VerifyEvent in AplusTraceSet" <result(verifyData(ave->aplusVar(),ave->a())); } } MSBoolean AplusTraceSet::verifyData(V,A a_) { MSBoolean r=MSFalse; if (0!=a_ && QA(a_) && (a_->t==Ft|| a_->t==It)&&a_->r<3) // (Yv or Ym) { r=MSTrue; } return r; } void AplusTraceSet::selectable(MSBoolean b_) { MSTraceSet::selectable(b_); } const char *AplusTraceSet::formatText(MSString& str_, unsigned index_) { if (textBuffer().length()>index_) { str_ = textBuffer()(index_).asString(); } return str_; } unsigned AplusTraceSet::textLength(void) const { return _textBuffer.length(); } // Relying on s to set the title of the traceset void AplusTraceSet::validateText(const MSStringVector) { activateCallback("textactivate"); } void AplusTraceSet::updateTitle(void) { for(unsigned i=0;istyle()==MSG::Text) { graph()->redrawImmediately(); break; } } } void AplusTraceSet::textBuffer(const MSStringVector t_) { if (_textBuffer!=t_) { _textBuffer=t_; updateTitle(); } } void AplusTraceSet::gradient(const MSUnsignedVector x_) { for (int i=0;igradient(x_(i%x_.length())==1?MSTrue:MSFalse); graph()->updateLegendStatus(MSTrue); graph()->redrawImmediately(); } const char *AplusTraceSet::formatOutput(MSString& str_, unsigned row_, unsigned col_) { static const char blank[]={" "}; V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; ACharStrFunction *outFunc = AplusModel::getOutFunc(v); AVariableData *vd = ::pAVarDataFromV(v); invokeFunction(outFunc, row_, col_); str_ = (Ct==_outStr->t) ? (char *)_outStr->p : blank; dc(_outStr); _outStr=aplus_nl; return str_; } // copied from AplusTableColumn; possibly needs to be cleaned up void AplusTraceSet::invokeFunction(AOutFunction *outFunc_, unsigned row_, unsigned col_) { I *data = ((model()!=0)?((AplusModel*)model())->data():0); V v = (model()!=0)?((AplusModel*)model())->aplusVar():0; unsigned long type = (model()!=0)?((AplusModel*)model())->a_type():0; int charlength = (model()!=0)?((AplusModel*)model())->charLength():0; int rank = (model()!=0)?((AplusModel*)model())->rank():0; P p; p.i = data; char *buf; if (outFunc_!=0) { int w=1; // Always only one column int offset=row_*w; int n=0; A d; switch(type) { case It: _outStr=(A)outFunc_->invoke(v,(int)p.i[offset],row_,col_); break; case Ft: _outStr=(A)outFunc_->invoke(v,(double)p.f[offset],row_,col_); break; case Ct: n=charlength; offset=row_ * n; buf=new char[n+1]; strncpy(buf,p.c+(offset),n); buf[n]= '\0'; _outStr=(A)outFunc_->invoke(v,(char *)buf,row_,col_); delete [] buf; break; case Et: d=gs(Et); *d->p=ic(p.a[offset]); _outStr=(A)outFunc_->invoke(v,d,row_,col_); dc(d); break; } } } ::A AplusTraceSet::computeAdjustedData(double xOffset_, double yOffset_) const { ::A r=aplus_nl; P p,pp; V v = 0; int rows=dataCount(),cols,offset=0; if (rows>0) { v = ((AplusModel *)model())->aplusVar(); pp.i = ((::A)v->a)->p; cols=numColumns(); if (((::A)v->a)->r>1) // if this is a matrix { r=gm(Ft,rows,cols); p.i=r->p; for (int i=0; ia)->t==It)?pp.i[offset]:pp.f[offset]; p.f[offset++]+= (j==0)?xOffset_:-yOffset_; } } } else if (((::A)v->a)->r==1) // if it's a vector { r=gv(Ft,rows); p.i=r->p; for (int i=0; i < rows; i++) { p.f[offset]=(((::A)v->a)->t==It)?pp.i[offset]:pp.f[offset]; p.f[offset++]+=-yOffset_; } } } return r; } MSBoolean AplusTraceSet::moveTraceValidate(double xOffset_, double yOffset_) { ::A r=computeAdjustedData(xOffset_,yOffset_); if (isNull(r)==MSTrue) { return MSTrue; } V v=((AplusModel *)model())->aplusVar(); if (safeAset(v,r,0,0)==0) { showError(qs); return MSFalse; } return MSTrue; } MSFloatMatrix AplusTraceSet::asFloatMatrix(void) const { unsigned cols = numColumns(); unsigned rows = numRows(); MSFloatMatrix fm(rows, cols); for (unsigned i=0; iaplusVar(); A a =((AplusModel *)model())->a(); AVariableData *varData = pAVarDataFromV(v); AReadOnlyFunction *roFunc=((AplusModel *)model())->getReadOnlyFunc(v); if ( roFunc!=0 ) return (MSBoolean)roFunc->invoke(v,a); else if ( varData && varData->readOnly()==MSTrue ) return MSTrue; else return MSFalse; } const MSSymbol& AplusTraceSet::symbol(void) { static MSSymbol sym("AplusTraceSet"); return sym; } aplus-fsf-4.22/src/AplusGUI/AplusTreeView.C0000644000265000001440000003676310772770347014136 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #include #include #include #include #if defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma instantiate MSTabularTree #pragma instantiate MSTabularTreeCursor #pragma instantiate MSObservableTree #pragma instantiate MSObservableTreeEvent #pragma instantiate MSTreeView #endif // MS_EDG_TEMPLATE_INSTANTIATION #if defined(MS_STD_TEMPLATE_INSTANTIATION) template class MSTabularTree; template class MSTabularTreeCursor; template class MSObservableTree; template class MSObservableTreeEvent; template class MSTreeView; #endif // MS_STD_TEMPLATE_INSTANTIATION #if defined(MS_XLC_TEMPLATE_INSTANTIATION) #pragma define(MSTabularTree) #pragma define(MSTabularTreeCursor) #pragma define(MSObservableTree) #pragma define(MSObservableTreeEvent) #pragma define(MSTreeView) #endif // MS_XLC_TEMPLATE_INSTANTIATION extern int safeAset(V,A,A,A); static const int AplusTreeViewDefaultHighlightThickness=2; extern long dbg_tmstk; class Update { public: V _aplusVar; A _data; A _index; A _pick; I _ravel; Update(void) : _aplusVar(0),_data(0),_index(0),_pick(0),_ravel(0) {} Update(const Update& aUpdate_) : _aplusVar(aUpdate_._aplusVar),_data((A)ic(aUpdate_._data)), _index((A)ic(aUpdate_._index)), _pick((A)ic(aUpdate_._pick)),_ravel(aUpdate_._ravel) {} Update(V v_,A data_,A index_,A pick_,I ravel_) { _aplusVar=v_; _data=(data_!=0)?(A)ic(data_):data_; _index=(index_!=0)?(A)ic(index_):index_; _pick=(pick_!=0)?(A)ic(pick_):pick_; _ravel=ravel_; } ~Update(void) { if (_data!=0) dc(_data); if (_index!=0) dc(_index); if (_pick!=0) dc(_pick); } Update& operator=(const Update& aUpdate_) { if (this!=&aUpdate_) { A d=_data,i=_index,p=_pick; _aplusVar=aUpdate_._aplusVar; _data=(A)ic(aUpdate_._data); _index=(A)ic(aUpdate_._index); _pick=(A)ic(aUpdate_._pick); _ravel=aUpdate_._ravel; if (d!=0) dc(d); if (i!=0) dc(i); if (p!=0) dc(p); } return *this; } V aplusVar(void) {return _aplusVar;} A data(void) {return _data;} A index(void) {return _index;} A pick(void) {return _pick;} I ravel(void) {return _ravel;} }; MSError::ErrorStatus AplusTreeItem::set(const char *pString_) { return MSError::MSFailure; } const char *AplusTreeItem::format(MSString& str_) const { str_.removeAll(); if (_aSymbol!=0) { str_=_aSymbol->n; } return str_.string(); } AplusTreeView::AplusTreeView(MSWidget *pOwner_) : MSTreeView(pOwner_) { _margin=0; readOnly(MSTrue); highlightThickness(AplusTreeViewDefaultHighlightThickness); shadowThickness(0); horizontalSpacing(15); verticalSpacing(5); showRootNode(MSFalse); // // _modelTree is a mirror image of the A+ tree data model. It is used for the // interaction with MSTreeView widget. This is the easiest way of making MSTreeView // work with A+ data models. Because MSTreeView does not abstract its data model // representation (it always assumes it's MSObservableTree), unless we keep this // mirror observable tree, we would have to override most of MSTreeView to make them // accept the A+ slotfiller tree. // _modelTree.addAsRoot(AplusTreeItem()); _modelTree.addReceiver(this); AplusModel *am=new AplusModel(0); INTERNAL_COUPLE(am); // // Translating MSCallbacks to AplusCallbacks. // callback(MSWidgetCallback::doubleclick, new MSMethodCallback(this, &AplusTreeView::referenceCB)); } AplusTreeView::~AplusTreeView(void) {} void AplusTreeView::addSenderNotify(MSEventSender *m_) { MSModel *pModel=(MSModel *)m_; if (pModel->type()==AplusModel::symbol()) { AplusModel *pAplusModel=(AplusModel *)pModel; INTERNAL_COUPLE(pAplusModel); update(pAplusModel->aplusVar(),0,0,0); } } void AplusTreeView::receiveEvent(MSEvent& event_) { if (event_.type()==AplusEvent::symbol()) { if (dbg_tmstk) cout<<"Received UpdateEvent in AplusTreeView" <aplusVar(); A index=ave->index(); A pick =ave->pick(); I ravel=ave->ravel();; update(v,index,pick,ravel); } else if (event_.type()==AplusVerifyEvent::symbol()) { if (dbg_tmstk) cout<<"Received VerifyEvent in AplusTreeView" <result(verifyData(ave->aplusVar(),ave->a())); } else { MSTreeView::receiveEvent(event_); } } void AplusTreeView::rebuildTree(AplusTreeView::TreeModelCursor& aCursor_, A attr_, A val_) { _modelTree.removeAll(); _modelTree.addAsRoot(AplusTreeItem()); aCursor_.setToRoot(); buildTree(aCursor_,attr_,val_); } void AplusTreeView::buildTree(AplusTreeView::TreeModelCursor& aCursor_, A attr_, A val_) { if (attr_!=0&&val_!=0) { A value,attr; P p; for (int i=0;in;i++) { attr=(A)attr_->p[i]; // used as the pick value=(A)val_->p[i]; AplusTreeItem aTreeItem((S)XS(attr)); unsigned aPosition=i+1; _modelTree.addAsChild(aCursor_,aPosition,aTreeItem); if (isTree(value)==MSTrue) { p.i=value->p; aCursor_.setToChild(aPosition); buildTree(aCursor_,p.a[0],p.a[1]); aCursor_.setToParent(); } } } } MSBoolean AplusTreeView::checkValues(A vals_) { MSBoolean result=MSTrue; for (int i=0; result && in; ++i) { A vali=(A)vals_->p[i]; if (isSlotFiller(vali)) { result=checkValues((A)vali->p[1]); } } return result; } void AplusTreeView::updateTree(AplusTreeView::TreeModelCursor& aCursor_, A attr_, A val_, A pick_, int index_) { if (pick_->p[index_]==1) { if (pick_->n==index_) { rebuildTree(aCursor_,attr_,val_); } else { int item=(int)pick_->p[index_+1]; A attr=(A)attr_->p[item]; A val=(A)val_->p[item]; S aSymbol=XS(attr); for (; aCursor_.isValid(); _modelTree.setToNext(aCursor_,MSPreorder)) { if (aCursor_.element().symbol()==aSymbol) { break; } } P p; p.i=val->p; if (val->t!=Et || val->n<2 || checkValues(p.a[1])==MSFalse) { return; } if (pick_->n==index_+2) { rebuildTree(aCursor_,p.a[0],p.a[1]); } else { updateTree(aCursor_,p.a[0],p.a[1],pick_,index_+2); } } } else { rebuildTree(aCursor_,attr_,val_); } } void AplusTreeView::update(const MSIndexVector& v_) { MSView::update(v_); } void AplusTreeView::update(V,int r_,int c_,UpdateType type_) { if (r_==-1&&c_==-1&&type_==ValueUpdate) updateForeground(foreground()); } extern "C" A gpix(A,A); void AplusTreeView::update(V v_,A index_,A pick_,I ravel_) { V v=(model()!=0)?((AplusModel*)model())->aplusVar():0; if (v!=0) { P p; p.i=((AplusModel*)model())->data(); A attr=p.a[0]; A val=p.a[1]; TreeModelCursor aTreeCursor(_modelTree); aTreeCursor.setToRoot(); MSEventBlocker b(&_modelTree); rebuildTree(aTreeCursor,attr,val); } /*** if (frozen()==MSFalse) { updateData(); // if (pick_==0) updateData(); // else if (QA(pick_)) // { // A pick=(A)gpix(pick_,(A)v_->a); // if (pick!=0&&QA(pick)&&pick->t==It&&pick->r<=1) // { // P p; p.i=((AplusModel*)model())->data(); // Cursor aTreeCursor(elementTree()); // aTreeCursor.setToRoot(); // updateTree(aTreeCursor,p.a[0],p.a[1],pick,0); // } // else if (pick==0) cerr<<"tree: pick assignment error in update."<aplusVar():0; A a=(model()!=0)?((AplusModel*)model())->a():0; if (v!=0) { AFontFunction *fontFunc=AplusModel::getFontFunc(v); Font fid=(fontFunc!=0)?fontFunc->invoke(v,a):font(); if (fid!=oldfid_) MSTreeView::updateFont(oldfid_); } } void AplusTreeView::updateForeground(unsigned long oldfg_) { V v=(model()!=0)?((AplusModel*)model())->aplusVar():0; A a=(model()!=0)?((AplusModel*)model())->a():0; if (v!=0) { AColorFunction *fgFunc=AplusModel::getFgFunc(v); unsigned long fg=(fgFunc!=0)?fgFunc->invoke(v,a):foreground(); if (fg!=oldfg_) MSTreeView::updateForeground(oldfg_); } } void AplusTreeView::updateBackground(unsigned long oldbg_) { V v=(model()!=0)?((AplusModel*)model())->aplusVar():0; A a=(model()!=0)?((AplusModel*)model())->a():0; if (v!=0) { AColorFunction *bgFunc=AplusModel::getBgFunc(v); unsigned long bg=(bgFunc!=0)?bgFunc->invoke(v,a):background(); if (bg!=oldbg_) MSTreeView::updateBackground(oldbg_); } } MSBoolean AplusTreeView::isTree(A a_) { return isSlotFiller(a_); } MSBoolean AplusTreeView::verifyData(V,A a_) { return (isTree(a_)&&checkValues((A)a_->p[1]))?MSTrue:MSFalse; } AplusTreeView::TreeModel& AplusTreeView::modelTree(void) { return _modelTree; } const AplusTreeView::TreeModel& AplusTreeView::modelTree(void) const { return _modelTree; } MSBoolean AplusTreeView::validate(AplusTreeView::TreeModelCursor &cursor_,const char *pString_) { // // Interactive editing of the tree is not supported now. See the comment // in isProtected() method. // return MSTreeView::validate(cursor_,pString_); /*** V v=(model()!=0)?((AplusModel*)model())->aplusVar():0; busyOn(); int depth=1; TreeModelCursor aTreeCursor(cursor_); aTreeCursor.setToParent(); while (_modelTree.isRoot(aTreeCursor)==MSFalse) { depth++; aTreeCursor.setToParent(); } aTreeCursor=cursor_; A pick=gv(Et,depth); P ppick; ppick.i=pick->p; int i=depth,j; while (_modelTree.isRoot(aTreeCursor)==MSFalse) { S aSymbol=aTreeCursor.element().symbol(); ppick.a[i-1]=(A)MS(aSymbol); aTreeCursor.setToParent(); --i; } A vals,syms,val; S psym,dsym; P p; p.i=((AplusModel*)model())->data(); for (i=0;in;i++) { syms=p.a[0]; vals=p.a[1]; psym=XS(pick->p[i]); for (j=0;jn;j++) { dsym=XS(syms->p[j]); if (dsym==psym) { val=(A)vals->p[j]; break; } } p.i=val->p; } freeze(); val=(A)ic(val); if (safeAset(v,(A)ic(val),0,pick)==0) showError(qs); else AplusModel::doneCB(v,val,0,pick); dc(val); unfreeze(); // pull our update off the stack MSNodeItem *np=updateStack().pop(); Update *pUpdate; if (np!=0) { pUpdate=(Update *)np->data(); delete np; delete pUpdate; } while ((np=updateStack().pop())!=0) { pUpdate=(Update *)np->data(); delete np; update(pUpdate->aplusVar(),pUpdate->index(),pUpdate->pick(),pUpdate->ravel()); delete pUpdate; } dc(pick); busyOff(); return MSTrue; ***/ } void AplusTreeView::nodeAttribute(const TreeModelCursor& cursor_, NodeAttribute& nodeAttr_) { if (_modelTree.isLeaf(cursor_)==MSTrue) { nodeAttr_.expandable(MSFalse); nodeAttr_.expandedState(MSFalse); } else { nodeAttr_.expandable(MSTrue); nodeAttr_.expandedState(MSTrue); } } MSBoolean AplusTreeView::isNodeProtected(const TreeNode *) { // For now, only support read-only mode, just like version 2. // If editing of the nodes is to be supported, the code below // needs to be uncommented and the validate() method needs to // be fixed. // return MSTrue; /*** V v=model()->aplusVar(); if (v!=0) { AVariableData *varData = ::pAVarDataFromV(v); return varData->readOnly(); } return MSFalse; ***/ } void AplusTreeView::referenceCB(void) { activateCallback(MSWidgetCallback::reference); } A AplusTreeView::selectedNodeA(void) const { TreeModelCursor cursor(selectedNode()); if (cursor.isValid()==MSFalse) { return aplus_nl; } MSUnsignedLongVector nodePath(1,(unsigned long)cursor.element().symbol()); S sym; while (cursor.setToParent()==MSTrue) // while the parent is valid - i.e., if we haven't reached the root { sym = cursor.element().symbol(); // // since the root in an A+ tree is a special null node, we shouldn't include // it in the path // if (sym==0) { break; } nodePath << (unsigned long)sym; } I pathLen=nodePath.length(); if (pathLen==0) { return aplus_nl; } A svPath = gv(Et,pathLen); P p; p.i=svPath->p; for (I i=0; it==Et && aNode_->n>0) // if this is a symbol vector { int pathLen=aNode_->n; TreeModelCursor cursor(_modelTree); cursor.setToRoot(); for (int i=0; ip[i])) // make sure it's a symbol { if (dbg_tmstk) showError("Incorrect format for the node path - it must be a symbol vector",2); return; } do { if (cursor.element().symbol()==(S)XS(aNode_->p[i])) // if we found the node { break; } } while (cursor.setToNextExistingChild()==MSTrue); // iterate over all children } if (cursor.isValid()==MSTrue) { selectedNode(cursor); } else { if (dbg_tmstk) showError("Node with the given name not found in the tree!",2); // print a warning message return; } } else { if (dbg_tmstk) showError("Incorrect format for the node path - it must be a symbol vector",2); return; } } } const MSSymbol& AplusTreeView::widgetType(void) const { return symbol(); } const MSSymbol& AplusTreeView::symbol(void) { static MSSymbol sym("AplusTreeView"); return sym; } aplus-fsf-4.22/src/AplusGUI/AplusUpdateQueue.C0000644000265000001440000000450410772770347014617 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #if HAVE_IOSTREAM #include #else #include #endif #include #include #include AplusUpdateQueue updateQueue; AplusUpdate::AplusUpdate(V v_,A data_,A index_,A pick_,I ravel_) { _aplusVar=v_; _data=(data_!=0)?(A)ic(data_):data_; _index=(index_!=0)?(A)ic(index_):index_; _pick=(pick_!=0)?(A)ic(pick_):pick_; _ravel=ravel_; } AplusUpdate::~AplusUpdate(void) { if (_data!=0) dc(_data); if (_index!=0) dc(_index); if (_pick!=0) dc(_pick); } void AplusUpdate::send(void) { AVariableData *varData=pAVarDataFromV(_aplusVar); if (varData!=0&&varData->pWidgetView()!=0) { AplusEvent ae(_index, _pick, _ravel); // we can call receiveEvent() on the widget-view directly instead of // calling sendEvent() on the model, but for that we need to // cast the widget-view to MSEventReceiver, since MSView::receiveEvent() // is protected ((MSEventReceiver *)varData->pWidgetView())->receiveEvent(ae); } } AplusUpdateQueue::AplusUpdateQueue(void) { } AplusUpdateQueue::~AplusUpdateQueue(void) { unsigned int len=_queue.length(); AplusUpdate *upd; for (int i=0; isend(); // send the update delete upd; } len = _queue.length(); // get the new length to see if any elements have been added } while (i #include #include #include #include extern long dbg_tmstk; static const char *DefaultSelectedRowBackground="lightsteelblue3"; AplusView::AplusView(MSWidget *widget_) : MSList(widget_) { AplusModel *am = new AplusModel(0); INTERNAL_COUPLE(am); _rowSpacing = 0; _rowHeight = textHeight(); selectedRowBackground(server()->pixel(DefaultSelectedRowBackground)); // Translating MSCallbacks to AplusCallbacks // callback(MSWidgetCallback::doubleclick, new MSMethodCallback(this, &AplusView::referenceCB)); } AplusView::~AplusView(void) { } MSBoolean AplusView::verifyData(V,A a_) { return (0!=a_&&QA(a_)&&a_->t==Ct&&a_->r==2)?MSTrue:MSFalse; } void AplusView::addSenderNotify(MSEventSender *m_) { INTERNAL_COUPLE(((AplusModel*)m_)); updateData(); } void AplusView::receiveEvent(MSEvent &event_) { if (event_.type() == AplusEvent::symbol()) { if (dbg_tmstk) cout << "Received UpdateEvent in AplusView" << endl; AplusEvent *ave = (AplusEvent *) &event_; V v = ((AplusModel *)model())->aplusVar(); A index = ave->index(); A pick = ave->pick(); I ravel = ave->ravel();; update(v,index, pick, ravel); } if (event_.type() == AplusVerifyEvent::symbol()) { if (dbg_tmstk) cout << "Received VerifyEvent in AplusView" << endl; AplusVerifyEvent *ave = (AplusVerifyEvent *) &event_; ave->result(verifyData(ave->aplusVar(), ave->a())); } } const char *AplusView::formatOutput(MSString& str_, unsigned row_) { if (model()!=0) { P p; p.i=((AplusModel*)model())->data(); int cl=((AplusModel*)model())->charLength(); int offset=row_*cl; str_=MSString((const char *)(p.c+offset),cl); } return str_; } void AplusView::update(V,int row_,int,UpdateType type_) { if (type_==ValueUpdate) { if (row_) redrawImmediately(); else drawRow(row_); } else if (type_==ShapeUpdate||type_==AppendUpdate) { shapeUpdate(); redrawImmediately(); } } void AplusView::update(V v_,A index_,A,I ravel_) { if(!index_) { shapeUpdate(); redrawImmediately(); } else if(ravel_) // ravel update { A a=(A)v_->a; if(a->r==2&&a->n==1) { int n=(int)a->d[1]; int k=(int)index_->p[0]; int j=k/n; update(v_,j,k-n*j,ValueUpdate); } else redrawImmediately(); } else { A r=index_->t==It?index_:index_->n?(A)*index_->p:aplus_nl; A c=index_->t==Et&&index_->n>1?(A)index_->p[1]:aplus_nl; int i,j; if(isNull(c)==MSTrue) // c is aplus_nl - all cols are updated { if(isNull(r)==MSTrue) redrawImmediately(); else { // *** need to supply a real index vector to appendUpdate() *** // for(i=0;i<(int)r->n;i++) if ((int)r->p[i]>=vsb()->max()) appendUpdate(MSIndexVector::nullVector()); for(i=0;i<(int)r->n;i++) update(v_,(int)r->p[i],-1,ValueUpdate); } } else if(isNull(r)==MSTrue) // r is aplus_nl - all rows are updated { for(i=0;i<(int)c->n;i++) update(v_,-1,(int)c->p[i],ValueUpdate); } else { // *** need to supply a real index vector to appendUpdate() *** // for(i=0;i<(int)r->n;i++) if ((int)r->p[i]>=vsb()->max()) appendUpdate(MSIndexVector::nullVector()); for(j=0;j<(int)r->n;j++) { for(i=0;i<(int)c->n;i++) { update(v_,(int)r->p[j],(int)c->p[i],ValueUpdate); } } } } } unsigned long AplusView::selectedRowForegroundColor(int row_) { return rowForeground(row_); } void AplusView::drawSelectOutline(Window window_,int row_,MSBoolean select_,MSBoolean highlightedRow_) { // override drawSelectOutline() to do nothing as we don't want the rows to have any outline } unsigned AplusView::numRows(void) const { return (model()==0)?0:((AplusModel*) model())->numRows(); } unsigned AplusView::numColumns(void) const { return (model()==0)?0:((AplusModel*) model())->charLength(); } unsigned AplusView::maxLength(void) const { return numColumns(); } unsigned AplusView::rowLength(unsigned) const { return numColumns(); } unsigned long AplusView::rowForeground(unsigned row_) { AplusModel *m=(AplusModel *)model(); unsigned long fgcolor=foreground(); if(m) { V v = m->aplusVar(); AColorFunction *fgFunc=AplusModel::getFgFunc(v); P p; p.i = m->data(); if (fgFunc!=0&&row_a_type()) { // `view uses only char matrices, so other types not considered; // (plus we checked in if statement above cuz we are paranoid); int len=m->charLength(); char *buf=new char[len+1]; memcpy(buf,p.c+(row_*len),len); buf[len]= '\0'; fgcolor=(unsigned long) fgFunc->invoke(v,(char *)buf,row_,0); delete [] buf; } } return fgcolor; } unsigned long AplusView::rowBackground(unsigned row_) { AplusModel *m=(AplusModel *)model(); unsigned long bgcolor=background(); if(m) { V v = m->aplusVar(); AColorFunction *bgFunc=AplusModel::getBgFunc(v); P p; p.i = m->data(); if (bgFunc!=0&&row_a_type()) { // `view uses only char matrices, so other types not considered; // (plus we checked in if statement above 'cause we are paranoid); int len=m->charLength(); char *buf=new char[len+1]; memcpy(buf,p.c+(row_*len),len); buf[len]= '\0'; bgcolor=(unsigned long) bgFunc->invoke(v,(char *)buf,row_,0); delete [] buf; } } return bgcolor; } void AplusView::referenceCB(void) { activateCallback(MSWidgetCallback::reference); } const MSSymbol& AplusView::widgetType(void) const { return symbol(); } const MSSymbol& AplusView::symbol(void) { static MSSymbol sym("AplusView"); return sym; } aplus-fsf-4.22/src/AplusGUI/EnumTables.C0000644000265000001440000005410410772770347013423 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include MSHashTable *EnumTables::_printEnumHashTable=0; MSHashTable *EnumTables::_stringEnumHashTable=0; MSHashTable *EnumTables::_alignEnumHashTable=0; MSHashTable *EnumTables::_alignStringHashTable=0; MSHashTable *EnumTables::_styleEnumHashTable=0; MSHashTable *EnumTables::_styleStringHashTable=0; MSHashTable *EnumTables::_pageSizeEnumHashTable=0; MSHashTable *EnumTables::_pageSizeStringHashTable=0; MSHashTable *EnumTables::_reportStyleEnumHashTable=0; MSHashTable *EnumTables::_reportStyleStringHashTable=0; MSHashTable *EnumTables::_reportCompModeEnumHashTable=0; MSHashTable *EnumTables::_reportCompModeStringHashTable=0; MSHashTable *EnumTables::_cycleColorModeEnumHashTable=0; MSHashTable *EnumTables::_cycleColorModeStringHashTable=0; EnumTables GUIEnum; EnumTables::EnumTables(void) { _stringEnumHashTable = new MSHashTable(128); _printEnumHashTable = new MSHashTable(128); _pageSizeEnumHashTable = new MSHashTable(32); _pageSizeStringHashTable = new MSHashTable(32); _alignStringHashTable = new MSHashTable(128); _alignEnumHashTable = new MSHashTable(128); _styleEnumHashTable = new MSHashTable(128); _styleStringHashTable = new MSHashTable(128); _reportStyleEnumHashTable = new MSHashTable(16); _reportStyleStringHashTable = new MSHashTable(16); _reportCompModeEnumHashTable = new MSHashTable(16); _reportCompModeStringHashTable = new MSHashTable(16); _cycleColorModeEnumHashTable = new MSHashTable(16); _cycleColorModeStringHashTable = new MSHashTable(16); initStringEnumHashTable(); initPrintEnumHashTable(); initPageSizeHashTables(); initAlignHashTables(); initStyleHashTables(); initReportStyleHashTables(); initReportCompModeHashTables(); initCycleColorModeHashTables(); } EnumTables::~EnumTables(void) { if (_printEnumHashTable) { delete _printEnumHashTable; _printEnumHashTable = 0; } if (_stringEnumHashTable) { delete _stringEnumHashTable; _stringEnumHashTable=0; } if (_pageSizeEnumHashTable) { delete _pageSizeEnumHashTable; _pageSizeEnumHashTable=0; } if (_pageSizeStringHashTable) { delete _pageSizeStringHashTable; _pageSizeStringHashTable=0; } if (_alignStringHashTable) { delete _alignStringHashTable; _alignStringHashTable=0; } if (_alignEnumHashTable) { delete _alignEnumHashTable; _alignEnumHashTable=0; } if (_styleEnumHashTable) { delete _styleEnumHashTable; _styleEnumHashTable=0; } if (_styleStringHashTable) { delete _styleStringHashTable; _styleStringHashTable=0; } if (_reportStyleEnumHashTable) { delete _reportStyleEnumHashTable; _reportStyleEnumHashTable=0; } if (_reportStyleStringHashTable) { delete _reportStyleStringHashTable; _reportStyleStringHashTable=0; } if (_reportCompModeEnumHashTable) { delete _reportCompModeEnumHashTable; _reportCompModeEnumHashTable=0; } if (_reportCompModeStringHashTable) { delete _reportCompModeStringHashTable; _reportCompModeStringHashTable=0; } } void EnumTables::initAlignHashTables(void) { alignEnumHashTable()->notFound((unsigned long)0x5f5f5f); alignEnumHashTable()->add("none" ,(void*)MSNone); alignEnumHashTable()->add("center",(void*)MSCenter); alignEnumHashTable()->add("left" ,(void*)MSLeft); alignEnumHashTable()->add("right" ,(void*)MSRight); alignEnumHashTable()->add("top" ,(void*)MSTop); alignEnumHashTable()->add("bottom",(void*)MSBottom); alignEnumHashTable()->add("inside",(void*)MSG::Inside); alignEnumHashTable()->add("outside",(void*)MSG::Outside); alignStringHashTable()->notFound((unsigned long)0); alignStringHashTable()->add(MSCenter,(void*)"center"); alignStringHashTable()->add(MSLeft ,(void*)"left"); alignStringHashTable()->add(MSRight ,(void*)"right"); alignStringHashTable()->add(MSTop ,(void*)"top"); alignStringHashTable()->add(MSBottom,(void*)"bottom"); alignStringHashTable()->add(MSG::Inside,(void*)"inside"); alignStringHashTable()->add(MSG::Outside,(void*)"outside"); } void EnumTables::initPageSizeHashTables(void) { pageSizeEnumHashTable()->notFound(0); pageSizeEnumHashTable()->add(MSP::Letter,(void*)"letter"); pageSizeEnumHashTable()->add(MSP::Legal ,(void*)"legal"); pageSizeEnumHashTable()->add(MSP::A4 ,(void*)"a4"); pageSizeEnumHashTable()->add(MSP::B5 ,(void*)"b5"); pageSizeEnumHashTable()->add(MSP::A ,(void*)"a"); pageSizeEnumHashTable()->add(MSP::B ,(void*)"b"); pageSizeStringHashTable()->notFound(0); pageSizeStringHashTable()->add("letter" ,(void*)MSP::Letter); pageSizeStringHashTable()->add("legal" ,(void*)MSP::Legal); pageSizeStringHashTable()->add("a4" ,(void*)MSP::A4); pageSizeStringHashTable()->add("b5" ,(void*)MSP::B5); pageSizeStringHashTable()->add("a" ,(void*)MSP::A); pageSizeStringHashTable()->add("b" ,(void*)MSP::B); } void EnumTables::initStringEnumHashTable(void) { stringEnumHashTable()->notFound(0); stringEnumHashTable()->add(MSP::Portrait ,(void*) "portrait"); stringEnumHashTable()->add(MSP::Landscape ,(void*) "landscape"); stringEnumHashTable()->add(MSP::Mono ,(void*) "mono"); stringEnumHashTable()->add(MSP::Color ,(void*) "color"); stringEnumHashTable()->add(MSP::Colorfg ,(void*) "colorfg"); stringEnumHashTable()->add(MSP::Reverse ,(void*) "reverse"); stringEnumHashTable()->add(MSP::PPM ,(void*) "ppm"); stringEnumHashTable()->add(MSP::EPS ,(void*) "eps"); stringEnumHashTable()->add(MSP::PS ,(void*) "ps"); stringEnumHashTable()->add(MSP::Append ,(void*) "append"); stringEnumHashTable()->add(MSP::AppendBox ,(void*) "appendbox"); stringEnumHashTable()->add(MSP::Text ,(void*) "text"); stringEnumHashTable()->add(MSP::Box ,(void*) "box"); stringEnumHashTable()->add(MSP::Rule ,(void*) "rule"); stringEnumHashTable()->add(MSP::Toprule ,(void*) "toprule"); stringEnumHashTable()->add(MSP::NoDisclaimer,(void*) "none"); stringEnumHashTable()->add((unsigned long)MSSolid,(void*)"solid"); // stringEnumHashTable()->add(MSDash,(void*)"dash1"); // stringEnumHashTable()->add(MSDot,(void*)"dot1"); // stringEnumHashTable()->add(MSCenter,(void*)"center"); // stringEnumHashTable()->add(MSLeft,(void*)"left"); // stringEnumHashTable()->add(MSRight,(void*)"right"); stringEnumHashTable()->add(MSTop ,(void*)"top"); stringEnumHashTable()->add(MSBottom,(void*)"bottom"); } void EnumTables::initPrintEnumHashTable(void) { printEnumHashTable()->notFound((unsigned long)0); printEnumHashTable()->add("",(void*)1); printEnumHashTable()->add("portrait" ,(void*)MSP::Portrait); printEnumHashTable()->add("landscape",(void*)MSP::Landscape); printEnumHashTable()->add("mono" ,(void*)MSP::Mono); printEnumHashTable()->add("gs" ,(void*)MSP::Mono); printEnumHashTable()->add("color" ,(void*)MSP::Color); printEnumHashTable()->add("colorfg" ,(void*)MSP::Colorfg); printEnumHashTable()->add("reverse" ,(void*)MSP::Reverse); printEnumHashTable()->add("ppm" ,(void*)MSP::PPM); printEnumHashTable()->add("eps" ,(void*)MSP::EPS); printEnumHashTable()->add("ps" ,(void*)MSP::PS); printEnumHashTable()->add("append" ,(void*)MSP::Append); printEnumHashTable()->add("appendbox",(void*)MSP::AppendBox); printEnumHashTable()->add("text" ,(void*)MSP::Text); printEnumHashTable()->add("box" ,(void*)MSP::Box); printEnumHashTable()->add("rule" ,(void*)MSP::Rule); printEnumHashTable()->add("toprule" ,(void*)MSP::Toprule); printEnumHashTable()->add("solid" ,(void*)MSSolid); printEnumHashTable()->add("dash" ,(void*)MSDash); printEnumHashTable()->add("dot" ,(void*)MSDot); printEnumHashTable()->add("left" ,(void*)MSLeft); printEnumHashTable()->add("right" ,(void*)MSRight); printEnumHashTable()->add("top" ,(void*)MSTop); printEnumHashTable()->add("bottom" ,(void*)MSBottom); } void EnumTables::initStyleHashTables(void) { styleEnumHashTable()->notFound((int)0); styleEnumHashTable()->add(MSP::Underline ,(void *)"underline"); styleEnumHashTable()->add(MSP::DUnderline,(void *)"dul"); styleEnumHashTable()->add(MSP::Superscript,(void *)"superscript"); styleEnumHashTable()->add(MSP::Subscript,(void *)"subscript"); styleEnumHashTable()->add(MSP::Outline ,(void *)"outline"); styleEnumHashTable()->add(MSP::Smallcap ,(void *)"smallcap"); styleEnumHashTable()->add(MSP::Strikethru,(void *)"strikethru"); styleEnumHashTable()->add(MSP::Box ,(void *)"box"); styleEnumHashTable()->add(MSP::BoxL ,(void *)"boxl"); styleEnumHashTable()->add(MSP::BoxR ,(void *)"boxr"); styleEnumHashTable()->add(MSP::BoxT ,(void *)"boxt"); styleEnumHashTable()->add(MSP::BoxB ,(void *)"boxb"); styleEnumHashTable()->add(MSP::Cell ,(void *)"cell"); styleEnumHashTable()->add(MSP::Stipple ,(void *)"stipple"); styleEnumHashTable()->add(MSP::CharOnly ,(void *)"charonly"); styleEnumHashTable()->add(MSP::PosAbove ,(void *)"posabove"); styleEnumHashTable()->add(MSP::PosBelow ,(void *)"posbelow"); styleEnumHashTable()->add(MSLeft ,(void *)"left"); styleEnumHashTable()->add(MSRight ,(void *)"right"); styleEnumHashTable()->add(MSTop ,(void *)"top"); styleEnumHashTable()->add(MSBottom ,(void *)"bottom"); styleEnumHashTable()->add(MSCenter ,(void *)"center"); styleStringHashTable()->notFound((int)0); styleStringHashTable()->add("underline" ,(void *) MSP::Underline); styleStringHashTable()->add("dunderline" ,(void *) MSP::DUnderline); styleStringHashTable()->add("dul" ,(void *) MSP::DUnderline); styleStringHashTable()->add("superscript" ,(void *) MSP::Superscript); styleStringHashTable()->add("subscript" ,(void *) MSP::Subscript); styleStringHashTable()->add("outline" ,(void *) MSP::Outline); styleStringHashTable()->add("smallcap" ,(void *) MSP::Smallcap); styleStringHashTable()->add("strikethru" ,(void *) MSP::Strikethru); styleStringHashTable()->add("box" ,(void *) MSP::Box); styleStringHashTable()->add("boxl" ,(void *) MSP::BoxL); styleStringHashTable()->add("boxr" ,(void *) MSP::BoxR); styleStringHashTable()->add("boxt" ,(void *) MSP::BoxT); styleStringHashTable()->add("boxb" ,(void *) MSP::BoxB); styleStringHashTable()->add("cell" ,(void *) MSP::Cell); styleStringHashTable()->add("stipple" ,(void *) MSP::Stipple); styleStringHashTable()->add("charonly" ,(void *) MSP::CharOnly); styleStringHashTable()->add("posabove" ,(void *) MSP::PosAbove); styleStringHashTable()->add("posbelow" ,(void *) MSP::PosBelow); styleStringHashTable()->add("left" ,(void *) MSLeft); styleStringHashTable()->add("right" ,(void *) MSRight); styleStringHashTable()->add("top" ,(void *) MSTop); styleStringHashTable()->add("bottom" ,(void *) MSBottom); styleStringHashTable()->add("center" ,(void *) MSCenter); } void EnumTables::initReportStyleHashTables(void) { reportStyleEnumHashTable()->notFound((int)0); reportStyleEnumHashTable()->add(MSP::ColMajor ,(void *)"columnmajor"); reportStyleEnumHashTable()->add(MSP::RowMajor ,(void *)"rowmajor"); reportStyleEnumHashTable()->add(MSP::Aligned ,(void *)"aligned"); reportStyleEnumHashTable()->add(MSP::NoHeadings,(void *)"noheadings"); reportStyleStringHashTable()->notFound((int)0); reportStyleStringHashTable()->add("columnmajor",(void *)MSP::ColMajor); reportStyleStringHashTable()->add("rowmajor" ,(void *)MSP::RowMajor); reportStyleStringHashTable()->add("aligned" ,(void *)MSP::Aligned); reportStyleStringHashTable()->add("noheadings" ,(void *)MSP::NoHeadings); } void EnumTables::initReportCompModeHashTables(void) { reportCompModeEnumHashTable()->notFound((int)0); reportCompModeEnumHashTable()->add((unsigned long) AplusReportAlgorithm::Sum ,(void *)"sum"); reportCompModeEnumHashTable()->add((unsigned long) AplusReportAlgorithm::Max ,(void *)"max"); reportCompModeEnumHashTable()->add((unsigned long) AplusReportAlgorithm::Min ,(void *)"min"); reportCompModeEnumHashTable()->add((unsigned long) AplusReportAlgorithm::Avg ,(void *)"avg"); reportCompModeEnumHashTable()->add((unsigned long) AplusReportAlgorithm::StdDev ,(void *)"stddev"); reportCompModeEnumHashTable()->add((unsigned long) AplusReportAlgorithm::Variance,(void *)"variance"); reportCompModeStringHashTable()->notFound((int)0); reportCompModeStringHashTable()->add("sum" ,(void *)AplusReportAlgorithm::Sum); reportCompModeStringHashTable()->add("max" ,(void *)AplusReportAlgorithm::Max); reportCompModeStringHashTable()->add("min" ,(void *)AplusReportAlgorithm::Min); reportCompModeStringHashTable()->add("avg" ,(void *)AplusReportAlgorithm::Avg); reportCompModeStringHashTable()->add("stddev" ,(void *)AplusReportAlgorithm::StdDev); reportCompModeStringHashTable()->add("variance",(void *)AplusReportAlgorithm::Variance); } void EnumTables::initCycleColorModeHashTables(void) { cycleColorModeEnumHashTable()->notFound((int)0); cycleColorModeEnumHashTable()->add((unsigned long)MSForeground, (void *)"fg"); cycleColorModeEnumHashTable()->add((unsigned long)MSBackground, (void *)"bg"); cycleColorModeEnumHashTable()->add((unsigned long)MSReverseVideo, (void *)"reverse"); cycleColorModeStringHashTable()->notFound((int)-1); cycleColorModeStringHashTable()->add("fg", (void *)MSForeground); cycleColorModeStringHashTable()->add("bg", (void *)MSBackground); cycleColorModeStringHashTable()->add("reverse", (void *)MSReverseVideo); } A EnumTables::enumSymbols(const char *str_) { A r=aplus_nl; if (MSSymbol(str_) == MSSymbol("disclaimer")) { r=gv(Et,6); r->p[0]=MS(si((char *)stringEnumHashTable()->lookup(MSP::Text))); r->p[1]=MS(si((char *)stringEnumHashTable()->lookup(MSP::Box))); r->p[2]=MS(si((char *)stringEnumHashTable()->lookup(MSP::Rule))); r->p[3]=MS(si((char *)stringEnumHashTable()->lookup(MSP::Toprule))); r->p[4]=MS(si((char *)stringEnumHashTable()->lookup(MSP::Append))); r->p[5]=MS(si((char *)stringEnumHashTable()->lookup(MSP::NoDisclaimer))); } else if (MSSymbol(str_) == MSSymbol("orientation")) { r=gv(Et,2); r->p[0]=MS(si((char *)stringEnumHashTable()->lookup(MSP::Portrait))); r->p[1]=MS(si((char *)stringEnumHashTable()->lookup(MSP::Landscape))); } else if (MSSymbol(str_) == MSSymbol("pageSize")) { r=gv(Et,6); r->p[0]=MS(si((char *)pageSizeEnumHashTable()->lookup(MSP::Letter))); r->p[1]=MS(si((char *)pageSizeEnumHashTable()->lookup(MSP::Legal))); r->p[2]=MS(si((char *)pageSizeEnumHashTable()->lookup(MSP::A4))); r->p[3]=MS(si((char *)pageSizeEnumHashTable()->lookup(MSP::B5))); r->p[4]=MS(si((char *)pageSizeEnumHashTable()->lookup(MSP::A))); r->p[5]=MS(si((char *)pageSizeEnumHashTable()->lookup(MSP::B))); } else if (MSSymbol(str_) == MSSymbol("printMode")) { r=gv(Et,4); r->p[0]=MS(si((char *)stringEnumHashTable()->lookup(MSP::Mono))); r->p[1]=MS(si((char *)stringEnumHashTable()->lookup(MSP::Color))); r->p[2]=MS(si((char *)stringEnumHashTable()->lookup(MSP::Colorfg))); r->p[3]=MS(si((char *)stringEnumHashTable()->lookup(MSP::Reverse))); } else if (MSSymbol(str_) == MSSymbol("printTray")) { r=gv(Et,2); r->p[0]=MS(si((char *)stringEnumHashTable()->lookup(MSTop))); r->p[1]=MS(si((char *)stringEnumHashTable()->lookup(MSBottom))); } else if (MSSymbol(str_) == MSSymbol("outputMode")) { r=gv(Et,3); r->p[0]=MS(si((char *)stringEnumHashTable()->lookup(MSP::PS))); r->p[1]=MS(si((char *)stringEnumHashTable()->lookup(MSP::EPS))); r->p[2]=MS(si((char *)stringEnumHashTable()->lookup(MSP::PPM))); } else if (MSSymbol(str_) == MSSymbol("reportStyle")) { r=gv(Et,4); r->p[0]=MS(si((char *)reportStyleEnumHashTable()->lookup(MSP::ColMajor))); r->p[1]=MS(si((char *)reportStyleEnumHashTable()->lookup(MSP::RowMajor))); r->p[2]=MS(si((char *)reportStyleEnumHashTable()->lookup(MSP::Aligned))); r->p[3]=MS(si((char *)reportStyleEnumHashTable()->lookup(MSP::NoHeadings))); } else if (MSSymbol(str_) == MSSymbol("printTextStyle")) { r=gv(Et,16); r->p[0] =MS(si((char *)styleEnumHashTable()->lookup(MSP::Underline ))); r->p[1] =MS(si((char *)styleEnumHashTable()->lookup(MSP::DUnderline))); r->p[2] =MS(si((char *)styleEnumHashTable()->lookup(MSP::Superscript))); r->p[3] =MS(si((char *)styleEnumHashTable()->lookup(MSP::Subscript ))); r->p[4] =MS(si((char *)styleEnumHashTable()->lookup(MSP::Outline ))); r->p[5] =MS(si((char *)styleEnumHashTable()->lookup(MSP::Smallcap ))); r->p[6] =MS(si((char *)styleEnumHashTable()->lookup(MSP::Strikethru))); r->p[7] =MS(si((char *)styleEnumHashTable()->lookup(MSP::BoxL ))); r->p[8] =MS(si((char *)styleEnumHashTable()->lookup(MSP::BoxR ))); r->p[9] =MS(si((char *)styleEnumHashTable()->lookup(MSP::BoxT ))); r->p[10] =MS(si((char *)styleEnumHashTable()->lookup(MSP::BoxB ))); r->p[11]=MS(si((char *)styleEnumHashTable()->lookup(MSP::Cell ))); r->p[12]=MS(si((char *)styleEnumHashTable()->lookup(MSP::Stipple ))); r->p[13]=MS(si((char *)styleEnumHashTable()->lookup(MSP::CharOnly ))); r->p[14]=MS(si((char *)styleEnumHashTable()->lookup(MSP::PosAbove ))); r->p[15]=MS(si((char *)styleEnumHashTable()->lookup(MSP::PosBelow ))); } else if (MSSymbol(str_) == MSSymbol("compmode")) { r=gv(Et,6); r->p[0] =MS(si((char *)reportCompModeEnumHashTable()->lookup((unsigned long) AplusReportAlgorithm::Sum ))); r->p[1] =MS(si((char *)reportCompModeEnumHashTable()->lookup((unsigned long) AplusReportAlgorithm::Max ))); r->p[2] =MS(si((char *)reportCompModeEnumHashTable()->lookup((unsigned long) AplusReportAlgorithm::Min ))); r->p[3] =MS(si((char *)reportCompModeEnumHashTable()->lookup((unsigned long) AplusReportAlgorithm::Avg ))); r->p[4] =MS(si((char *)reportCompModeEnumHashTable()->lookup((unsigned long) AplusReportAlgorithm::StdDev ))); r->p[5] =MS(si((char *)reportCompModeEnumHashTable()->lookup((unsigned long) AplusReportAlgorithm::Variance))); } return r; } unsigned long EnumTables::alignFormat(A sym_) /* This originated from AXAlign::format */ { unsigned long align=0; if (sym_!=0) { A *p=(A *)sym_->p; for (int i=0; i<(int)sym_->n; i++) { char *s=(char *)XS(sym_->p[i])->n; if (QS(p[i])) { unsigned long val = (unsigned long)alignEnumHashTable()->lookup(s); if (val==alignEnumHashTable()->notFound()) { cerr << " ! "; if (s!=0) cerr<lookup(align)!=0) { count++; } x>>=1; align<<=1; } if (count>0) { r=gv(Et,count); x=x_; align=0x1; count=0; while (x!=0) { if (x & 0x1) { str = (char *)alignStringHashTable()->lookup(align); if (str!=0) { r->p[count++]=MS(si(str)); } } x>>=1; align<<=1; } } return r; /*** for (i=2; i<=MSBottom; i*=2) { if (alignStringHashTable()->lookup((unsigned long)(x_&i))!=0) count++; } if (count>0) { r=gv(Et,count); for (j=0,i=2; i<=MSBottom; i*=2) { if ((str=(char *)alignStringHashTable()->lookup((unsigned long)(x_&i)))!=0) r->p[j++]=MS(si(str)); } } return r; ***/ } A EnumTables::formatStyle(unsigned long x_) { A r=aplus_nl; int i,j,count=0; char *str; for (i=2; i<=MSP::PosBelow; i*=2) { if (styleEnumHashTable()->lookup((unsigned long)(x_&i))!=0) count++; } if (count>0) { r=gv(Et,count); for (j=0,i=2; i<=MSP::PosBelow; i*=2) { if ((str=(char*)styleEnumHashTable()->lookup((unsigned long)(x_&i)))!=0) r->p[j++]=MS(si(str)); } } return r; } unsigned long EnumTables::formatStyle(A sym_) { unsigned long style=0; if (sym_!=0) { A *p=(A *)sym_->p; for (int i=0; i<(int)sym_->n; i++) { char *s=(char *)XS(sym_->p[i])->n; if (QS(p[i])) { unsigned long val = (unsigned long)styleStringHashTable()->lookup(s); style|=val; if (s==0) { cerr << " ! "; if (s!=0) cerr<p; char *s=(char *)XS(sym_->p[0])->n; if (QS(p[0])) { unsigned long val=(unsigned long)reportCompModeStringHashTable()->lookup(s); mode|=val; if (val==0) { cerr << " ! "; if (s!=0) cerr<lookup(mode_))!=0) r = (A)MS(si(str)); return r; } MSCycleColorMode EnumTables::cycleColorMode(A sym_) { long mode=0; if (sym_!=0) { A *p=(A *)sym_->p; char *s=(char *)XS(sym_->p[0])->n; if (QS(p[0])) { long val=(long)cycleColorModeStringHashTable()->lookup(s); mode=val; if (val==-1) { cerr << " ! "; if (s!=0) cerr<lookup((unsigned long)mode_))!=0) r = (A)MS(si(str)); return r; } aplus-fsf-4.22/src/AplusGUI/aplKeys.C0000644000265000001440000001220210772770347012765 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #if HAVE_NEW #include #else #include #endif #include typedef struct { const char *_pTranslationString; const char *_pAPLString; } APLKeyTranslationStruct; static APLKeyTranslationStruct APLKeyTranslations[] = { { "KP_0", "0" }, { "KP_1", "1" }, { "KP_2", "2" }, { "KP_3", "3" }, { "KP_4", "4" }, { "KP_5", "5" }, { "KP_6", "6" }, { "KP_7", "7" }, { "KP_8", "8" }, { "KP_9", "9" }, { "KP_Decimal", "." }, { "!Metaa", "" }, { "!Metab", "" }, { "!Metac", "" }, { "!Metad", "" }, { "!Metae", "" }, { "!Metaf", "_" }, { "!Metag", "" }, { "!Metah", "" }, { "!Metai", "" }, { "!Metaj", "" }, { "!Metak", "'" }, { "!Metal", "" }, { "!Metam", "|" }, { "!Metan", "" }, { "!Metao", "" }, { "!Metap", "*" }, { "!Metaq", "?" }, { "!Metar", "" }, { "!Metas", "" }, { "!Metat", "~" }, { "!Metau", "" }, { "!Metav", "" }, { "!Metaw", "" }, { "!Metax", "" }, { "!Metay", "" }, { "!Metaz", "" }, { "!Meta1", "" }, { "!Meta2", "" }, { "!Meta3", "<" }, { "!Meta4", "" }, { "!Meta5", "=" }, { "!Meta6", "" }, { "!Meta7", ">" }, { "!Meta8", "" }, { "!Meta9", "" }, { "!Meta0", "^" }, { "!Shift Metaexclam", "" }, { "!Shift Metaat", "" }, { "!Shift Metanumbersign", "" }, { "!Shift Metadollar", "" }, { "!Shift Metapercent", "" }, { "!Shift Metaasciicircum", "" }, { "!Shift Metaampersand", "" }, { "!Shift Metaasterisk", "" }, { "!Shift Metaparenleft", "" }, { "!Shift Metaparenright", "" }, { "!Shift Metaunderscore", "!" }, { "!Metaminus", "" }, { "!Metaequal", "" }, { "!Metabackslash", "" }, { "!Metaquoteleft", "" }, { "!Metacomma", "" }, { "!Metabracketleft", "" }, { "!Metabracketright", "" }, { "!Metasemicolon", "" }, { "!Metaapostrophe", "" }, { "!Metaperiod", "" }, { "!Metaslash", "" }, { "!Metabraceleft", "" }, { "!Metaat", "" }, { "!Metanumbersign", "" }, { "!Metadollar", "" }, { "!Metapercent", "" }, { "!Metaasciicircum", "" }, { "!Metaampersand", "" }, { "!Metaasterisk", "" }, { "!Metaparenleft", "" }, { "!Metaparenright", "" }, { "!Metaunderscore", "!" }, { "!Shift Meta plus", "" }, { "!Shift Meta bar", "" }, { "Shift Metao", "" }, { "Shift Metaj", "" }, { "Shift Metaf", "" }, { "Shift Metae", "" }, { "Shift Metai", "" }, { "Shift Metabraceleft", "" }, { "Shift Metabraceright", "" }, { "Shift Metas", "" }, { "Shift Metag", "" }, { "Shift Metah", "" }, { "Shift Metal", "" }, { "Shift Metacolon", "" }, { "Shift Metaquotedbl", "" }, { "Shift Metac", "" }, { "Shift Metab", "" }, { "Shift Metan", "" }, { "Shift Metam", "" }, { "Shift Metagreater", "" }, { "Shift Metap", "" }, { "Shift Metay", "" }, { "Shift Metaz", "" }, { "Shift Metaq", "" }, { "Shift Metax", "X" }, { "Shift Metav", "V" }, { "Shift Metaslash", "?" }, { 0,0 } }; MSKeyPress *_keyPressTable=0; // this class helps us clean up memory when // the application exits. class StaticInitClass { public: StaticInitClass(void); ~StaticInitClass(void); }; StaticInitClass::StaticInitClass(void) {} StaticInitClass::~StaticInitClass(void) { if (_keyPressTable!=0) { delete [] (char *)_keyPressTable; _keyPressTable=0; } } static StaticInitClass _staticInitClass; static void initKeyPressTable(void) { int n = sizeof(APLKeyTranslations)/sizeof(APLKeyTranslationStruct)-1; _keyPressTable = (MSKeyPress *)new char [n*sizeof(MSKeyPress)]; for(int i=0;ixkey.state)) { return APLKeyTranslations[i]._pAPLString; } } return 0; } aplus-fsf-4.22/src/AplusGUI/AGIF.H0000644000265000001440000000067210772770347012100 #ifndef AGIFHEADER #define AGIFHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #endif // AGIFHEADER aplus-fsf-4.22/src/AplusGUI/AGIFGraph.H0000644000265000001440000000065110772770347013057 #ifndef AGIFGraphHEADER #define AGIFGraphHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #endif //AGIFGraphHEADER aplus-fsf-4.22/src/AplusGUI/AGIFmstk.H0000644000265000001440000000356610772770350012776 #ifndef AGIFmstkHEADER #define AGIFmstkHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #if HAVE_IOSTREAM #include #else #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #endif //AGIFmstkHEADER aplus-fsf-4.22/src/AplusGUI/AplusApplication.H0000644000265000001440000000173510772770350014635 #ifndef __AplusApplicaton_H #define __AplusApplicaton_H /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #if HAVE_IOSTREAM #include #else #include #endif #include #include #include #include class AplusApplication : public MSApplication { public: AplusApplication(void); AplusApplication(int argc_,char **argv_); ~AplusApplication(void); private: protected: }; class AplusMainLoop : public MSApplicationMainLoop { public: AplusMainLoop(MSApplication *pApplication_); ~AplusMainLoop(void); protected: virtual void innerLoopFlush(MSBoolean poll_); virtual MSBoolean processTimers(void); virtual void selectAndProcess(void); }; #endif aplus-fsf-4.22/src/AplusGUI/AplusArray.H0000644000265000001440000000350110772770350013441 #ifndef AplusArrayHEADER #define AplusArrayHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include class AplusArray : public MSArrayView { public: AplusArray(MSWidget *); ~AplusArray(void); virtual MSBoolean verifyData(V,A); virtual const MSSymbol& widgetType(void) const; static const MSSymbol& symbol(void); protected: virtual MSBoolean validate(const char *,unsigned,unsigned); virtual void addSenderNotify(MSEventSender *m_); virtual void receiveEvent(MSEvent &); virtual A defaultInFunc(V v_,const char *string); virtual unsigned numRows(void) const; virtual unsigned numColumns(void) const; virtual void update(V,int,int,UpdateType); virtual void update(V,A,A,I); virtual void update(const MSIndexVector &v_) { MSArrayView::update(v_); } virtual void updateForeground(unsigned long); virtual void updateFont(Font); virtual MSBoolean isCellProtected(unsigned, unsigned); virtual unsigned long cellForeground(unsigned, unsigned); virtual unsigned long cellBackground(unsigned, unsigned); virtual Font cellFont(unsigned,unsigned); virtual MSClipMode columnClipMode(unsigned) const; virtual void createCycle(int, int); MSUnsignedLongVector getCycleColors(int, int); virtual const char *formatOutput(MSString&,unsigned,unsigned); virtual MSBoolean validate(V,const char *,unsigned,unsigned); virtual void defaultButton3Behavior(const XEvent *); void referenceCB(void); STANDARD_WIDGET_METHODS_H }; #endif //AplusArrayHEADER aplus-fsf-4.22/src/AplusGUI/AplusButton.H0000644000265000001440000000232410772770350013640 #ifndef AplusButtonHEADER #define AplusButtonHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include class AplusButton : public MSButton { public: AplusButton(MSWidget *); ~AplusButton(void); virtual MSBoolean verifyData(V,A); virtual const MSSymbol& widgetType(void) const; static const MSSymbol& symbol(void); protected: virtual AplusModel *model(void) const { return (AplusModel *)_model; } virtual void updateTitle(void); virtual void addSenderNotify(MSEventSender *m_); virtual void receiveEvent(MSEvent &); virtual void activate(void); virtual int numRows(void) const; virtual int numColumns(void) const; virtual int numColumns(int row_) const; virtual const char *formatOutput(MSString& str_, int row_); A getTitle(void) const; void callAFunc(A fun_,A cd_); virtual MSBoolean isProtected(void) const; STANDARD_WIDGET_METHODS_H }; #endif // AplusButtonHEADER aplus-fsf-4.22/src/AplusGUI/AplusButtonBox.H0000644000265000001440000000642210774430515014312 #ifndef AplusButtonBoxHEADER #define AplusButtonBoxHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include class AplusButtonBox : public MSActionBox { public: AplusButtonBox(MSWidget *); ~AplusButtonBox(void); virtual void receiveEvent(MSEvent &); virtual MSBoolean verifyData(V,A); virtual void addSenderNotify(MSEventSender *); const MSUnsignedLongVector& buttons(void) const { return _buttons; } MSUnsignedLongVector& buttons(void) { return _buttons; } virtual void updateData(void); virtual void activate(void); virtual void activate(MSActionButton *b_) { MSActionBox::activate(b_); } int callAset(V,A,A,A); A geometry(void) { return _geometry; } void geometry(A a_) { if (_geometry!=0) dc(_geometry); _geometry=(A)ic(a_); } virtual void naturalSize(void); int selectedItem(void) { return _selectedItem; } void selectedItem(int selectedItem_) { _selectedItem = selectedItem_; } virtual void updateTitle(void); void buttonHighlightThickness(int); int buttonHighlightThickness(void); void buttonShadowThickness(int); int buttonShadowThickness(void); void highlightColor(unsigned long); unsigned long highlightColor(void); MSBoolean readOnly(int row_) const; virtual const MSSymbol& widgetType(void) const; static const MSSymbol& symbol(void); protected: void updateValues(void); virtual void updateValue(int); virtual void update(V,A,A,I); virtual void update(const MSIndexVector &v_) { MSActionBox::update(v_); } int numRows(void); A itemLabel(int); Font titleFont(int row_); unsigned long titleColor(int row_); void colSpan(int index_,A am_,int *col_,int *span_); void rowSpan(int index_,A am_,int *row_,int *span_); MSBoolean setPositions(void); MSBoolean compareGeometry(A ag_); MSBoolean setGeometry(void); virtual MSActionButton *newButton(void); virtual void valueChange(MSWidget *, MSBoolean); virtual void setButtonState(MSActionButton *, unsigned long) {} virtual unsigned long color(unsigned row_); MSBoolean freezeIfUnfrozen(void); void unfreezeIfUnfrozen(MSBoolean); virtual void updateSensitivity(void); private: int _selectedItem; MSUnsignedLongVector _buttons; A _geometry; STANDARD_WIDGET_METHODS_H }; class AplusActionButton : public MSActionButton { friend class AplusButtonBox; public: AplusActionButton(MSWidget *, const char *); ~AplusActionButton(void); protected: const AplusButtonBox *buttonBox(void) const { return (AplusButtonBox *) _owner; } AplusButtonBox *buttonBox(void) { return (AplusButtonBox *) _owner; } virtual void focusIn(void); virtual MSBoolean isProtected(void) const; }; inline MSBoolean AplusButtonBox::freezeIfUnfrozen(void) { MSBoolean rc=frozen(); return freeze(),rc; } inline void AplusButtonBox::unfreezeIfUnfrozen(MSBoolean bool_) { if (bool_==MSFalse) unfreeze(); } #endif // AplusButtonBoxHEADER aplus-fsf-4.22/src/AplusGUI/AplusCallback.H0000644000265000001440000000155610772770350014067 #ifndef __AplusCallback_H #define __AplusCallback_H /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include "AplusCommon.H" typedef void (*PFV)(void*); class AplusCallback : public MSCallback { public: AplusCallback(AClientData *); ~AplusCallback(void); AClientData *ac() { return _ac; } virtual void process(void); protected: AClientData *_ac; }; class AplusStdinCallback : public MSCallback { public: AplusStdinCallback(PFV func_) { _func = func_;} ~AplusStdinCallback(void) {} protected: virtual void process(void) {if (_func!=(PFV)0) (*_func)(0);} private: PFV _func; }; #endif aplus-fsf-4.22/src/AplusGUI/AplusCheckBox.H0000644000265000001440000000420610774430515014052 #ifndef AplusCheckBoxHEADER #define AplusCheckBoxHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include class AplusCheckBox : public AplusButtonBox { friend class AplusCheckButton; public: AplusCheckBox(MSWidget *); ~AplusCheckBox(void); virtual void update(V,int,int,UpdateType) {} virtual void update(V v_, A a_, A p_, I r_) { AplusButtonBox::update(v_,a_,p_,r_); } virtual void update(const MSIndexVector &v_) { AplusButtonBox::update(v_); } virtual void updateValue(int row_); virtual MSBoolean verifyData(V v_,A a_); virtual const MSSymbol& widgetType(void) const; static const MSSymbol& symbol(void); protected: virtual void arm(MSCheckButton *); virtual void disarm(MSCheckButton *); virtual void updateForeground(unsigned long); virtual MSActionButton *newButton(void); virtual void setButtonState(MSActionButton *, unsigned long); }; class AplusCheckButton : public MSCheckButton { friend class AplusCheckBox; public: AplusCheckButton(MSWidget *); ~AplusCheckButton(void); protected: virtual void checkBoxArm(void); virtual void checkBoxDisarm(void); inline const AplusCheckBox *checkBox(void) const; inline AplusCheckBox *checkBox(void); virtual void up(void); virtual void down(void); virtual void left(void); virtual void right(void); virtual void focusIn(void); virtual MSBoolean isProtected(void) const; }; inline AplusCheckBox *AplusCheckButton::checkBox(void) { return (parentWidgetType()==AplusCheckBox::symbol()?(AplusCheckBox *)owner():0); } inline const AplusCheckBox *AplusCheckButton::checkBox(void) const { return (parentWidgetType()==AplusCheckBox::symbol()?(AplusCheckBox *)owner():0); } #endif //AplusCheckBoxHEADER aplus-fsf-4.22/src/AplusGUI/AplusChoice.H0000644000265000001440000000362710772770350013566 #ifndef AplusChoiceHEADER #define AplusChoiceHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include class AplusChoice : public MSOptionMenu { public: AplusChoice(MSWidget *); ~AplusChoice(void); virtual MSBoolean verifyData(V,A); virtual const MSSymbol& widgetType(void) const; static const MSSymbol& symbol(void); protected: virtual void addSenderNotify(MSEventSender *); virtual void receiveEvent(MSEvent &); virtual void updateData(void); virtual void update(V,int,int,UpdateType) {} virtual void update(V,A,A,I); virtual void update(const MSIndexVector &v_) { MSOptionMenu::update(v_); } virtual void updateTitle(void); virtual void updateFont(Font); void updateOptions(void); Font dataFont(void); virtual const char *formatOutput(MSString&); virtual const char *itemLabel(unsigned); virtual unsigned long itemForeground(unsigned); virtual void updateForeground(unsigned long); virtual void activate(int); virtual void activate(void) { MSOptionMenu::activate(); } A itemValue(int); AplusModel *model(void) { return (AplusModel *)MSView::model(); } const AplusModel *model(void) const { return (const AplusModel *)MSView::model(); } virtual MSBoolean hasModel(void) const; // see the comment in AplusChoice.C virtual void setWidth(void); void updateModelVector(A); void setChoice(void); virtual MSBoolean isProtected(void) const; MSStringVector& modelBuffer(void) { return _modelBuffer; } MSStringVector _modelBuffer; A _itemVal; STANDARD_WIDGET_METHODS_H }; #endif //AplusGUIHEADER aplus-fsf-4.22/src/AplusGUI/AplusCollapsible.H0000644000265000001440000000160210772770350014614 #ifndef AplusCollapsibleHEADER #define AplusCollapsibleHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include class AplusCollapsible : public MSCollapsibleLayout { public: AplusCollapsible(MSWidget *); ~AplusCollapsible(void); virtual void receiveEvent(MSEvent &); virtual MSBoolean verifyData(V,A) { return MSTrue; } virtual void addSenderNotify(MSEventSender *); virtual const MSSymbol& widgetType(void) const; static const MSSymbol& symbol(void); STANDARD_WIDGET_METHODS_H }; #endif // AplusPanesHEADER aplus-fsf-4.22/src/AplusGUI/AplusCommand.H0000644000265000001440000000160110772770350013740 #ifndef AplusCommandHEADER #define AplusCommandHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include class AplusCommand : public AplusEntryField { public: AplusCommand(MSWidget *); ~AplusCommand(void); virtual MSBoolean verifyData(V v_,A a_); const char *buffer(void); void buffer(A a_); int cursorPosition(void); void cursorPosition(int cp_); virtual void keyPress(const XEvent *,KeySym,unsigned int,const char *); virtual const MSSymbol& widgetType(void) const; static const MSSymbol& symbol(void); }; #endif // AplusCommandHEADER aplus-fsf-4.22/src/AplusGUI/AplusCommon.H0000644000265000001440000004662410772770350013630 #ifndef __AplusCommon_H #define __AplusCommon_H /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include // declaration of Font #include #include #include #include #include A grc(A,int,int); void showError(const char *msg_, int flag_=0); MSBoolean processAVariables(void); void asTitleStringVector(MSStringVector &, A); inline MSBoolean isNull (A aobject_){return qz(aobject_)==0? MSFalse : MSTrue;} inline MSBoolean isNl (A aobject_) { return(aobject_==aplus_nl)?MSTrue : MSFalse; } MSBoolean isAplusWidget(const MSWidget *); class AScbTraceHook { public: static A _function; AScbTraceHook(A function_) {_function=(A)ic(function_);} AScbTraceHook(void) {_function=(A)(0);} ~AScbTraceHook(void) {dc(_function); _function=(A)0;} static void function(A function_) { if(_function) dc(_function); if(aplus_nl==function_) { _function=(A)0; } else { _function=(A)ic(function_); } }; static A function(void) { return _function; }; static void run(A f,I a,I b,I c,I d,V v) { const int numArgs=6; // Function cx.name as a symbol CX cx=(CX)f->p[f->n+2]; if((cx->s->n[0]=='s') &&(cx->s->n[1]=='\0')) return; // Ignore calls to the `s context A fn=ge(MS(symjoin(cx->s,XS(*f->d)))); // variable cx.name as a symbol A vn=ge(MS(symjoin(v->cx->s, v->s))); E e=(E)ma(numArgs+2); e->n=numArgs; e->f=(I)AScbTraceHook::_function; e->a[0]=(I)fn; // `cx.functionName e->a[1]=a?a:(I)aplus_nl; // s e->a[2]=b?b:(I)aplus_nl; // d e->a[3]=c?c:(I)aplus_nl; // i e->a[4]=d?d:(I)aplus_nl; // p e->a[5]=(I)vn; // `cx.variableNme dc((A)ez(ME(e))); mf((I *)e); dc((A)fn); dc((A)vn); return; } }; class AClientData { private: A _function; A _data; A _actualData; V _aplusVar; public: AClientData(V v_,A function_,A data_,A actualData_=aplus_nl) {_aplusVar=v_;_function=(A)ic(function_);_data=(A)ic(data_);_actualData=(A)ic(actualData_);} AClientData(A function_,A data_,A actualData_=aplus_nl) {_aplusVar=0;_function=(A)ic(function_);_data=(A)ic(data_);_actualData=(A)ic(actualData_);} ~AClientData(void) {dc(_function);dc(_data);dc(_actualData);_aplusVar=0;_aplusVar=0;_actualData=aplus_nl;_data=aplus_nl;} V aplusVar(void) { return _aplusVar; } A function(void) { return _function; } A data(void) { return _data; } A actualData(void) { return _actualData; } }; typedef A (*AFunc)(AClientData *,A,A,A,V); class AFunction { public: AFunc _func; AClientData *_arg; AFunction(void) { _arg=0; _func=0; } AFunction(AFunc func_,AClientData *arg_=0) { _func=func_; _arg=arg_; } ~AFunction(void) { if (_arg!=0) delete _arg; } void set(AFunc func_,AClientData *arg_) { _func=func_; if (_arg!=0) delete _arg; _arg=arg_; } void arg(AClientData *arg_) { if (_arg!=0) delete _arg; _arg=arg_; } void func(AFunc func_) { _func=func_; } void execute(V v_,A a_,A i_,A p_) { (void)(*func())(arg(),a_,i_,p_,v_); } AClientData *arg(void) { return _arg; } AFunc func(void) { return _func; } }; class ACycleFunction : public AFunction { public: ACycleFunction(void) { _func=0;_arg=0; } ACycleFunction(AFunc func_,AClientData *arg_=0) : AFunction(func_,arg_) {} ~ACycleFunction(void) {} A grc(V v_,int r,int c) { A av=(A)v_->a; I n=av->r-(av->t==Ct&&av->r); if(av=gv(Et,n),n)if(*av->p=r==-1?(I)aplus_nl:(I)gi(r),n==2)av->p[1]=c==-1?(I)aplus_nl:(I)gi(c); return av; } A callFunc(V v_,A a_,int row_,int col_) { A i=(row_==-1&&col_==-1)?0:grc(v_,row_,col_); A r=(func()!=0)?(A)(*func())(arg(),a_,i,aplus_nl,v_):aplus_nl; if (i!=0) dc((A)i); if (a_!=0) dc((A)a_); return r; } A invoke(V v_,A value_,A pick_) { A ap=0; A val=0; if (pick_!=0&&QS(pick_)) { ap=(A)gs(Et); *ap->p=(I)pick_; } else if (pick_!=0) { ap=(A)ic(pick_); } if (value_!=0&&QS(value_)) { val=(A)gs(Et); *val->p=(I)value_; } else if (value_!=0) { val=(A)ic(value_); } A r=(func()!=0)?(A)(*func())(arg(),val,0,ap,v_):aplus_nl; if (val!=0) dc((A)val); if (ap!=0) dc(ap); return r; } A invoke(V v_,A value_) { return (A)callFunc(v_,(A)ic(value_),-1,-1); } A invoke(V v_,int value_,int row_,int col_) { return (A)callFunc(v_,(A)gi(value_),row_,col_); } A invoke(V v_,double value_,int row_,int col_) { return (A)callFunc(v_,(A)gf(value_),row_,col_); } A invoke(V v_,char *value_,int row_,int col_) { return (A)callFunc(v_,(A)gsv(0,value_),row_,col_); } A invoke(V v_,A value_,int row_,int col_) { A val=0; if (value_!=0&&QS(value_)) { val=(A)gs(Et); *val->p=(I)value_; } else if (value_!=0) { val=(A)ic(value_); } return callFunc(v_,val,row_,col_); } }; class AColorFunction : public AFunction { public: AColorFunction(void) { _func=0; _arg=0; } AColorFunction(AFunc func_,AClientData *arg_=0) : AFunction(func_,arg_) {} ~AColorFunction(void) {} unsigned long callFunc(V v_,A a_,int row_,int col_,A p_=aplus_nl); unsigned long invoke(V v_,A value_,A pick_) { A ap=0; A val=0; if (pick_!=0&&QS(pick_)) { ap=(A)gs(Et); *ap->p=(I)pick_; } else if (pick_!=0) { ap=(A)ic(pick_); } if (value_!=0&&QS(value_)) { val=(A)gs(Et); *val->p=(I)value_; } else if (value_!=0) { val=(A)ic(value_); } unsigned long r=callFunc(v_,(A)val,-1,-1,ap); if (ap!=0) dc(ap); return r; } unsigned long invoke(V v_,A value_) { return callFunc(v_,(A)ic(value_),-1,-1); } unsigned long invoke(V v_,A value_,int row_,int col_,A pick_=aplus_nl) { A val=0; if (value_!=0&&QS(value_)) { val=(A)gs(Et); *val->p=(I)value_; } else if (value_ != 0) { val=(A)ic(value_); } return callFunc(v_,val,row_,col_,pick_); } unsigned long invoke(V v_,int value_,int row_,int col_,A pick_=aplus_nl) { A ai=(A)gi(value_); return callFunc(v_,ai,row_,col_,pick_); } unsigned long invoke(V v_,double value_,int row_,int col_,A pick_=aplus_nl) { A af=(A)gf(value_); return callFunc(v_,af,row_,col_,pick_); } unsigned long invoke(V v_,char *value_,int row_,int col_,A pick_=aplus_nl) { A str=(A)gsv(0,value_); return callFunc(v_,str,row_,col_,pick_); } unsigned long invoke(V v_,char *value_,int len_,int row_,int col_,A pick_=aplus_nl) { I len=len_; A str=gc(Ct,1,len,&len,(I*)value_); return callFunc(v_,str,row_,col_,pick_); } }; class AFontFunction : public AFunction { public: AFontFunction(void) { _func=0; _arg=0; } AFontFunction(AFunc func_,AClientData *arg_=0) : AFunction(func_,arg_) {} ~AFontFunction(void) {} virtual Font callFunc(V v_,A a_,int row_,int col_,A p_=aplus_nl); Font invoke(V v_,A value_,A pick_) { A ap=0; A val=0; if (pick_!=0&&QS(pick_)) { ap=(A)gs(Et); *ap->p=(I)pick_; } else if (pick_!=0) { ap=(A)ic(pick_); } if (value_!=0&&QS(value_)) { val=(A)gs(Et); *val->p=(I)value_; } else if (value_!=0) { val=(A)ic(value_); } Font r=callFunc(v_,(A)val,-1,-1,ap); if (ap!=0) dc(ap); return r; } Font invoke(V v_,A value_) { return callFunc(v_,(A)ic(value_),-1,-1); } Font invoke(V v_,A value_,int row_,int col_,A pick_=aplus_nl) { A val=0; if (value_!=0&&QS(value_)) { val=(A)gs(Et); *val->p=(I)value_; } else if (value_!=0) { val=(A)ic(value_); } return callFunc(v_,val,row_,col_,pick_); } Font invoke(V v_,int value_,int row_,int col_,A pick_=aplus_nl) { A ai=(A)gi(value_); return callFunc(v_,ai,row_,col_,pick_); } Font invoke(V v_,double value_,int row_,int col_,A pick_=aplus_nl) { A af=(A)gf(value_); return callFunc(v_,af,row_,col_,pick_); } Font invoke(V v_,char *value_,int row_,int col_,A pick_=aplus_nl) { A str=(A)gsv(0,value_); return callFunc(v_,str,row_,col_,pick_); } Font invoke(V v_,char *value_,int len_,int row_,int col_,A pick_=aplus_nl) { I len=len_; A str=gc(Ct,1,len,&len,(I*)value_); return callFunc(v_,str,row_,col_,pick_); } }; class AReadOnlyFunction : public AFunction { public: AReadOnlyFunction(void) { _func=0; _arg=0; } AReadOnlyFunction(AFunc func_,AClientData *arg_=0) : AFunction(func_,arg_) {} ~AReadOnlyFunction(void) {} MSBoolean callFunc(V v_,A a_,int row_,int col_,A p_=aplus_nl); MSBoolean invoke(V v_,A value_,A pick_) { A ap=0; A val=0; if (pick_!=0&&QS(pick_)) { ap=(A)gs(Et); *ap->p=(I)pick_; } else if (pick_!=0) { ap=(A)ic(pick_); } if (value_!=0&&QS(value_)) { val=(A)gs(Et); *val->p=(I)value_; } else if (value_!=0) { val=(A)ic(value_); } MSBoolean r=callFunc(v_,(A)val,-1,-1,ap); if (ap!=0) dc(ap); return r; } MSBoolean invoke(V v_,A value_,int row_,int col_,A pick_=aplus_nl) { A val=0; if (value_!=0&&QS(value_)) { val=(A)gs(Et); *val->p=(I)value_; } else if (value_!=0) { val=(A)ic(value_); } return callFunc(v_,val,row_,col_,pick_); } MSBoolean invoke(V v_,A value_) { return callFunc(v_,(A)ic(value_),-1,-1); } MSBoolean invoke(V v_,int value_,int row_,int col_,A pick_=aplus_nl) { A ai=(A)gi(value_); return callFunc(v_,ai,row_,col_,pick_); } MSBoolean invoke(V v_,double value_,int row_,int col_,A pick_=aplus_nl) { A af=(A)gf(value_); return callFunc(v_,af,row_,col_,pick_); } MSBoolean invoke(V v_,char *value_,int row_,int col_,A pick_=aplus_nl) { A str=(A)gsv(0,value_); return callFunc(v_,str,row_,col_,pick_); } MSBoolean invoke(V v_,char *value_,int len_,int row_,int col_,A pick_=aplus_nl) { I len=len_; A str=gc(Ct,1,len,&len,(I*)value_); return callFunc(v_,str,row_,col_,pick_); } }; class AOutFunction : public AFunction { public: AOutFunction(void) { _func=0; _arg=0; } AOutFunction(AFunc func_,AClientData *arg_=0) : AFunction(func_,arg_) {} ~AOutFunction(void) {} virtual A callFunc(V v_,A a_,int row_,int col_,A p_=aplus_nl); A invoke(V v_,A value_,A pick_) { A ap=0; A val=0; if (pick_!=0&&QS(pick_)) { ap=(A)gs(Et); *ap->p=(I)pick_; } else if (pick_!=0) { ap=(A)ic(pick_); } if (value_!=0&&QS(value_)) { val=(A)gs(Et); *val->p=(I)value_; } else if (value_!=0) { val=(A)ic(value_); } A r=callFunc(v_,(A)val,-1,-1,ap); if (ap!=0) dc(ap); return r; } A invoke(V v_,A value_) { return callFunc(v_,(A)ic(value_),-1,-1); } A invoke(V v_,A value_,int row_,int col_,A pick_=aplus_nl) { A val=0; if (value_!=0&&QS(value_)) { val=(A)gs(Et); *val->p=(I)value_; } else if (value_!=0) { val=(A)ic(value_); } return callFunc(v_,val,row_,col_,pick_); } A invoke(V v_,int value_,int row_,int col_,A pick_=aplus_nl) { A ai=(A)gi(value_); return (A) callFunc(v_,ai,row_,col_,pick_); } A invoke(V v_,double value_,int row_,int col_,A pick_=aplus_nl) { A af=(A)gf(value_); return (A) callFunc(v_,af,row_,col_,pick_); } A invoke(V v_,char *value_,int row_,int col_,A pick_=aplus_nl) { A str=(A)gsv(0,value_); return (A) callFunc(v_,str,row_,col_,pick_); } A invoke(V v_,char *value_,int len_,int row_,int col_,A pick_=aplus_nl) { I len=len_; A str=gc(Ct,1,len,&len,(I*)value_); return (A) callFunc(v_,str,row_,col_,pick_); } }; // ACharStrFunction is just like AOutFunction, but requires character // string output. MCA class ACharStrFunction : public AOutFunction { public: ACharStrFunction(void) { _func=0; _arg=0; } ACharStrFunction(AFunc func_,AClientData *arg_=0) : AOutFunction(func_,arg_) {} ~ACharStrFunction(void) {} virtual A callFunc(V v_,A a_,int row_,int col_,A p_=aplus_nl); }; class AGeometryFunction : public AFunction { public: AGeometryFunction(void) { _func=0; _arg=0; } AGeometryFunction(AFunc func_,AClientData *arg_=0) : AFunction(func_,arg_) {} ~AGeometryFunction(void) {} A invoke(V v_,A a_) { A r=(_func!=0&&v_->a!=0)?(A)(*_func)(_arg,(A)ic(a_),aplus_nl,aplus_nl,v_):aplus_nl; dc((A)a_); return r; } }; class AInFunction : public AFunction { public: AInFunction(void) { _func=0; _arg=0; } AInFunction(AFunc func_,AClientData *arg_=0) : AFunction(func_,arg_) {} ~AInFunction(void) {} A invoke(V v_,char *value_,int row_,int col_,A p_=aplus_nl) { A i=(row_==-1&&col_==-1)?0:(A)grc((A)v_->a,row_,col_); A a=(A)gsv(0,value_); A r=(_func!=0)?(A)(*_func)(_arg,a,i,p_,v_):aplus_nl; if (i!=0) dc((A)i); dc((A)a); return r; } A invoke(V v_,char *value_,int len_,int row_,int col_,A p_=aplus_nl) { I len=len_; A i=(row_==-1&&col_==-1)?0:(A)grc((A)v_->a,row_,col_); A a=gc(Ct,1,len,&len,(I*)value_); A r=(_func!=0)?(A)(*_func)(_arg,a,i,p_,v_):aplus_nl; if (i!=0) dc((A)i); dc((A)a); return r; } A invoke(V v_,char *value_,A pick_) { A ap=0; if (pick_!=0&&QS(pick_)) { ap=(A)gs(Et); *ap->p=(I)pick_; } else if (pick_!=0) { ap=(A)ic(pick_); } A r=invoke(v_,value_,-1,-1,ap); if (ap!=0) dc(ap); return r; } A invoke(V v_,char *value_,int len_,A pick_) { A ap=0; if (pick_!=0&&QS(pick_)) { ap=(A)gs(Et); *ap->p=(I)pick_; } else if (pick_!=0) { ap=(A)ic(pick_); } A r=invoke(v_,value_,len_,-1,-1,ap); if (ap!=0) dc(ap); return r; } }; typedef enum { ShapeUpdate =0, // the shape of the object changed - i.e. rank change SizeUpdate =1, // same shape,but change in the size - i.e. more rows or cols ValueUpdate =2, // same shape and size,but values have changed AppendUpdate=3 // same shape and size,but additional rows appended to data // row=-1 : update all rows of specified col // col=-1 : update all cols of specified row // col=-1 && row=-1 : update all values // row >= 0 && col >=0 : update specified row,col only } UpdateType; class AVariableData { protected: MSWidgetView *_pWidgetView; // window association--1:1 relationship S _class; // class of this variable - for Steve int _colWidth; // col width in chars for this variable int _editWidth; // edit width in chars for this var A _bg; // background pixel value A _fg; // foreground pixel value A _font; // data font value MSBoolean _readOnly; // true if entire var is protected MSBoolean _stars; // should output be clipped or '*' used ACharStrFunction _outFunc; // formatting function AOutFunction _titleFunc; // formatting function for title of var AInFunction _inFunc; // validate and send back the new value AColorFunction _fgFunc; // color of a cell's foreground AColorFunction _bgFunc; // color of a cell's background AColorFunction _titleColorFunc; // color for the variable title AFontFunction _fontFunc; // get the font for a value AFontFunction _titleFontFunc;// get the title font AReadOnlyFunction _roFunc; // is the cell protected AGeometryFunction _geoFunc; // get the geometry for its layout ACycleFunction _cycleFunc; // colors to cycle thru on data change AFunction _doneFunc; // notify app that input cycle is done A _title; A _titleFg; A _titleFont; static unsigned long _defaultHlColor; static unsigned long _defaultRowColor; static unsigned long _defaultMatrixColor; public: AVariableData(void); ~AVariableData(void); MSWidgetView *pWidgetView(void) {return _pWidgetView;} S varClass(void) {return _class;} A bgA(void) {return _bg;} A fgA(void) {return _fg;} A fontA(void) {return _font;} A titleAFg(void) {return _titleFg;} A titleAFont(void) {return _titleFont;} A titleA(void) {return _title;} A title(void) {return _title;} MSBoolean readOnly(void) {return _readOnly;} MSBoolean stars(void) {return _stars;} inline unsigned long background(void) { return (isNull(bgA())==MSTrue) ? MSDisplayServer::defaultDisplayServer()->defaultBackground() : bgA()->p[0]; } inline unsigned long foreground(void) { return (isNull(fgA())==MSTrue) ? MSDisplayServer::defaultDisplayServer()->defaultForeground() : fgA()->p[0];} inline Font font(void) { return (isNull(fontA())==MSTrue) ? MSDisplayServer::defaultDisplayServer()->defaultFont() : fontA()->p[0];} unsigned long titleFg(void); Font titleFont(void); void title(A title_); void titleFg(A fg_); void titleFont(A fid_); void pWidgetView(MSWidgetView *pWidgetView_); void varClass(S sym_) { _class=sym_; } void background(A bg_); void foreground(A fg_); void font(A fa_); void setReadOnly(int i_); void stars(MSBoolean); ACharStrFunction *outFunc(void); void outFunc(AFunc func_,AClientData *arg_); AInFunction *inFunc(void); void inFunc(AFunc func_,AClientData *arg_); AColorFunction *fgFunc(void); void fgFunc(AFunc func_,AClientData *arg_); AColorFunction *bgFunc(void); void bgFunc(AFunc func_,AClientData *arg_); AFontFunction *fontFunc(void); void fontFunc(AFunc func_,AClientData *arg_); AFontFunction *titleFontFunc(void); void titleFontFunc(AFunc func_,AClientData *arg_); AColorFunction *titleColorFunc(void); void titleColorFunc(AFunc func_,AClientData *arg_); AOutFunction *titleFunc(void); void titleFunc(AFunc func_,AClientData *arg_); AReadOnlyFunction *roFunc(void); void roFunc(AFunc func_,AClientData *arg_); AGeometryFunction *geoFunc(void); void geoFunc(AFunc func_,AClientData *arg_); AFunction *doneFunc(void); void doneFunc(AFunc func_,AClientData *arg_); ACycleFunction *cycleFunc(void); void cycleFunc(AFunc func_,AClientData *arg_); // always called after setting outFunction -- potential problem ??? int colWidth(void) { return _colWidth; } void colWidth(int, MSBoolean =MSTrue); int editWidth(void) { return _editWidth; } void editWidth(int ew_) { if (ew_!=editWidth()) _editWidth=ew_; } static unsigned long defaultHlColor(void); static unsigned long defaultRowColor(void); static unsigned long defaultMatrixColor(void); static void defaultHlColor(unsigned long c_) { _defaultHlColor = c_; } static void defaultRowColor(unsigned long c_) { _defaultRowColor = c_; } static void defaultMatrixColor(unsigned long c_) { _defaultMatrixColor = c_; } }; extern V getV(A a_); extern V getVFromSym(CX context_,S sym_); extern A getSym(V v_); extern A getSymWithContext(V v_); extern MSBoolean isSlotFiller(A a_); inline V getVfromA(A a_) { return (isNull(a_)==MSFalse && (QS(a_)||a_->t==Et)) ? getV(a_) : 0; } inline AVariableData *pAVarDataFromV(V v_) { return (AVariableData *)(v_==0 ? 0 : v_->attr); } #endif aplus-fsf-4.22/src/AplusGUI/AplusConvert.H0000644000265000001440000000315010772770350014003 #ifndef AplusConvertHEADER #define AplusConvertHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #include #include #include class AplusConvert { private: static MSA _convert; public: AplusConvert(void) {} ~AplusConvert(void) {} static MSFloat asMSFloat(A); static MSString asMSString(A); // Vector Conversions static MSStringVector asMSStringVector(A); static MSFloatVector asMSFloatVector(A); static MSIntVector asMSIntVector(A); static MSUnsignedLongVector asMSUnsignedLongVector(A); static MSIndexVector asMSIndexVector(A); static MSUnsignedVector asMSUnsignedVector(A); // Matrix Conversions static MSFloatMatrix asMSFloatMatrix(A); static MSIntMatrix asMSIntMatrix(A); // A Conversions static A asA(const MSString &); static A asA(const MSFloat &); static A asA(const MSStringVector &); static A asA(const MSFloatVector &); static A asA(const MSUnsignedVector &); static A asA(const MSIndexVector &); }; #endif //AplusConvertHEADER aplus-fsf-4.22/src/AplusGUI/AplusDialog.H0000644000265000001440000001057610772770350013574 #ifndef AplusDialogHEADER #define AplusDialogHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include // // AplusDialog is a dialog box that displays a message. This is a base class // for all standard dialogs, which simply provide different defaults. // This dialog has modal behavior. Use modal(MSFalse) to unset that. // This dialog will destroy itself when any button is pressed, unless destroyDialog // is overidden // // The following are the parameters to the constructor of // this dialog box: // // title_ - specified the title of the dialog. // transientFor_ - shell widget that this dialog is transient for. // msg_ - string that appears in the dialog. // showFlag_ - specifies which buttons to display, can be any combination // of DialogFlag value logically or'ed together. // focusFlag_ - specifies which button should have focus when dialog is // first shown. This button is also activated when the 'Close' // item of the window manager menu is selected. // pix_ - one of PixmapFlag. Specifies which of predefines pixmaps to display. // pixmap_ - specifies custom pixmap to use. // class MSLabel; class MSButton; class MSLayout; class AplusDialog : public MSPopup { public: enum DialogFlag { OK=1,Yes=2,No=4,Cancel=8,Help=16}; enum PixmapFlag { Error=0,Information,Question,Warning,Working }; AplusDialog(const char *title_,unsigned buttonFlag_=OK,DialogFlag focusFlag_=OK); AplusDialog(MSDisplayServer *server_,const char *title_, unsigned showFlag_=OK,DialogFlag focusFlag_=OK); AplusDialog(MSShell *transientFor_,const char *title_, unsigned showFlag_=OK,DialogFlag focusFlag_=OK); AplusDialog(const char *title_,const char *msg_, PixmapFlag pix_=Information, unsigned buttonFlag_=OK,DialogFlag focusFlag_=OK); AplusDialog(const char *title_,const char *msg_, const MSPixmap& pixmap_, unsigned showFlag_=OK,DialogFlag focusFlag_=OK); AplusDialog(MSDisplayServer *server_,const char *title_,const char *msg_, PixmapFlag pix_=Information,unsigned showFlag_=OK,DialogFlag focusFlag_=OK); AplusDialog(MSDisplayServer *server_,const char *title_,const char *msg_, const MSPixmap& pixmap_,unsigned showFlag_=OK,DialogFlag focusFlag_=OK); AplusDialog(MSShell *transientFor_,const char *title_,const char *msg_, PixmapFlag pix_,unsigned showFlag_=OK,DialogFlag focusFlag_=OK); AplusDialog(MSShell *transientFor_,const char *title_,const char *msg_, const MSPixmap& pix_,unsigned showFlag_=OK,DialogFlag focusFlag_=OK); ~AplusDialog(); virtual void show(void); virtual void naturalSize(void); DialogFlag query(void); // accessors to buttons. some may return 0 if button not used. MSButton *okButton(void) { return _okButton; } MSButton *yesButton(void) { return _yesButton; } MSButton *noButton(void) { return _noButton; } MSButton *cancelButton(void) { return _cancelButton; } MSButton *helpButton(void) { return _helpButton; } MSLayout *layout(void) { return _layout; } MSLabel *label(void) { return _label; } protected: MSLayout *_layout; MSLabel *_label; MSButton *_okButton; MSButton *_cancelButton; MSButton *_yesButton; MSButton *_noButton; MSButton *_helpButton; MSLayout *_buttonLayout; DialogFlag _focusFlag; DialogFlag focusFlag(void) const { return _focusFlag; } void init(unsigned); void buildStandardLayout(const char *, const MSPixmap&); void doOK(void) { ok(); } void doCancel(void) { cancel(); } void doYes(void) { yes(); } void doNo(void) { no(); } void doHelp(void) { help(); } virtual void dismiss(void); virtual void destroyDialog(void); // Can be ovveriden to prevent auto-destruction // Subclass can override the following actions. virtual void ok(void); // OK button activation virtual void cancel(void); // Cancel button activation virtual void yes(void); // Yes button activation virtual void no(void); // No button activation virtual void help(void); // Help button activation }; #endif aplus-fsf-4.22/src/AplusGUI/AplusDisplayServer.H0000644000265000001440000000257710772770351015174 #ifndef AplusDisplayServerHEADER #define AplusDisplayServerHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include class AExitFunc { public: AExitFunc(A function_,A data_) { _function=(A)ic(function_);_data=(A)ic(data_); } ~AExitFunc(void) { dc(_function);dc(_data); } A function(void) { return _function; } A data(void) { return _data; } private: A _function; A _data; }; class AplusDisplayServer : public MSDisplayServer { public: AplusDisplayServer(void) : MSDisplayServer(), _exitFunc(0) {} AplusDisplayServer(const char *name_) : MSDisplayServer(name_), _exitFunc(0) {} ~AplusDisplayServer(void) { if (exitFunc()!=0) delete _exitFunc;} AExitFunc *exitFunc(void) { return _exitFunc; } void exitFunc(AExitFunc *exitFunc_) { if (exitFunc()!=0) delete _exitFunc; _exitFunc=exitFunc_; } // TED-related functions // Atom *workspaceAtoms(void) const; int workspaceNumber(const char *) const; int virtualScreen(Window); int virtualScreen(void); void virtualGeometry(int& x_,int& y_); protected: AExitFunc *_exitFunc; }; #endif // AplusDisplayServerHEADER aplus-fsf-4.22/src/AplusGUI/AplusEntryField.H0000644000265000001440000000311710772770351014434 #ifndef AplusEntryFieldHEADER #define AplusEntryFieldHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include class AplusEntryField : public MSEntryFieldPlus { public: AplusEntryField(MSWidget *); ~AplusEntryField(void); virtual MSBoolean verifyData(V,A); // Override the following two functions to make them public // virtual void edit(void); virtual MSBoolean activateEditor(void); virtual const MSSymbol& widgetType(void) const; static const MSSymbol& symbol(void); protected: virtual void addSenderNotify(MSEventSender *m_); virtual void receiveEvent(MSEvent &); virtual void createCycle(void); virtual MSBoolean isProtected(void) const; virtual MSBoolean validate(const char *); virtual void firstMapNotify(void); virtual const char *formatOutput(MSString &); virtual void updateForeground(unsigned long); virtual void updateFont(Font); virtual void updateTitle(void); virtual void increment(void); virtual void decrement(void); virtual void currentColors(unsigned long&,unsigned long&); const char *itemLabel(void); A defaultInFunc(V v_,const char *string_); void setClipMode(void); private: STANDARD_WIDGET_METHODS_H }; #endif //AplusEntryFieldHEADER aplus-fsf-4.22/src/AplusGUI/AplusEnumConverter.H0000644000265000001440000000777310772770351015177 #ifndef AplusEnumConverterHEADER #define AplusEnumConverterHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include class AplusEnumConverter { protected: virtual unsigned long enumLookup(const char *) const =0; virtual const char *stringLookup(unsigned long) const =0; virtual const char *type(void) const =0; public: inline AplusEnumConverter(void); inline ~AplusEnumConverter(void); virtual unsigned long convert(A) const; virtual A convert(unsigned long) const; inline unsigned long operator()(A); inline A operator()(unsigned long); virtual unsigned long enumNotFound(void) const =0; virtual const char *stringNotFound(void) const =0; }; inline AplusEnumConverter::AplusEnumConverter(void) {} inline AplusEnumConverter::~AplusEnumConverter(void){} inline unsigned long AplusEnumConverter::operator()(A symbols_) { return convert(symbols_); } inline A AplusEnumConverter::operator()(unsigned long enums_) { return convert(enums_); } class AplusHashEnumConverter : public AplusEnumConverter { protected: virtual unsigned long enumLookup(const char *) const; virtual const char *stringLookup(unsigned long) const; virtual const AplusHashTable& enumTable(void) const =0; virtual const AplusHashTable& stringTable(void) const =0; public: inline AplusHashEnumConverter(void); inline ~AplusHashEnumConverter(void); virtual unsigned long enumNotFound(void) const; virtual const char *stringNotFound(void) const; inline A stringDomain(void) const; }; inline AplusHashEnumConverter::AplusHashEnumConverter(void) : AplusEnumConverter() {} inline AplusHashEnumConverter::~AplusHashEnumConverter(void) {} inline A AplusHashEnumConverter::stringDomain(void) const { return stringTable().listAllEntries(); } class AplusHashSingleEnumConverter : public AplusHashEnumConverter { public: inline AplusHashSingleEnumConverter(void); inline ~AplusHashSingleEnumConverter(void); virtual unsigned long convert(A) const; virtual A convert(unsigned long) const; unsigned long fromString(const char *) const; const char *toString(unsigned long) const; }; inline AplusHashSingleEnumConverter::AplusHashSingleEnumConverter(void) : AplusHashEnumConverter() {} inline AplusHashSingleEnumConverter::~AplusHashSingleEnumConverter(void) {} class AplusShadowStyleConverter : public AplusHashSingleEnumConverter { protected: virtual const AplusHashTable& enumTable(void) const; virtual const AplusHashTable& stringTable(void) const; virtual const char *type(void) const; public: inline AplusShadowStyleConverter(void); inline ~AplusShadowStyleConverter(void); }; inline AplusShadowStyleConverter::AplusShadowStyleConverter(void) : AplusHashSingleEnumConverter() {} inline AplusShadowStyleConverter::~AplusShadowStyleConverter(void) {} class AplusAlignmentConverter : public AplusHashEnumConverter { protected: virtual const AplusHashTable& enumTable(void) const; virtual const AplusHashTable& stringTable(void) const; virtual const char *type(void) const; public: inline AplusAlignmentConverter(void); inline ~AplusAlignmentConverter(void); }; inline AplusAlignmentConverter::AplusAlignmentConverter(void) : AplusHashEnumConverter() {} inline AplusAlignmentConverter::~AplusAlignmentConverter(void) {} class AplusLineStyleConverter : public AplusHashSingleEnumConverter { protected: virtual const AplusHashTable& enumTable(void) const; virtual const AplusHashTable& stringTable(void) const; virtual const char *type(void) const; public: inline AplusLineStyleConverter(void); inline ~AplusLineStyleConverter(void); }; inline AplusLineStyleConverter::AplusLineStyleConverter(void) : AplusHashSingleEnumConverter() {} inline AplusLineStyleConverter::~AplusLineStyleConverter(void) {} #endif //AplusEnumConverterHEADER aplus-fsf-4.22/src/AplusGUI/AplusErrorDialog.H0000644000265000001440000000172210772770351014600 #ifndef AplusErrorDialogHEADER #define AplusErrorDialogHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include class AplusErrorDialog : public MSDialog { public: AplusErrorDialog(MSWidget *); ~AplusErrorDialog(void); virtual MSBoolean verifyData(V,A); virtual const MSSymbol& widgetType(void) const; static const MSSymbol& symbol(void); protected: virtual AplusModel *model(void) const { return (AplusModel *)_model; } virtual void updateTitle(void); A getTitle(void) const; virtual void addSenderNotify(MSEventSender *m_); virtual void receiveEvent(MSEvent &); STANDARD_WIDGET_METHODS_H }; #endif // AplusErrorDialogHEADER aplus-fsf-4.22/src/AplusGUI/AplusEvent.H0000644000265000001440000000471510772770351013455 #ifndef AplusEventHEADER #define AplusEventHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #if HAVE_IOSTREAM #include #else #include #endif #include #include #include class AplusEvent : public MSEvent { public: AplusEvent(void); AplusEvent(AplusEvent &); AplusEvent(A,A,I); ~AplusEvent(void); A index(void); A pick(void); I ravel(void); static const MSSymbol& symbol(void); protected: A _index; A _pick; I _ravel; }; class AplusVerifyEvent : public MSEvent { public: AplusVerifyEvent(void); AplusVerifyEvent(AplusVerifyEvent &); AplusVerifyEvent(V,A); ~AplusVerifyEvent(void); A a(void); V aplusVar(void); MSBoolean result(void); void result(MSBoolean r_); static const MSSymbol& symbol(void); protected: V _aplusVar; A _a; MSBoolean _result; }; class AplusUpdateDataEvent : public MSEvent { public: AplusUpdateDataEvent(void); ~AplusUpdateDataEvent(void) {} static const MSSymbol& symbol(void); }; class AplusProtectEvent : public MSEvent { public: AplusProtectEvent(void); ~AplusProtectEvent(void); static const MSSymbol& symbol(void); }; class AplusUpdateTitleEvent : public MSEvent { public: AplusUpdateTitleEvent(void); ~AplusUpdateTitleEvent(void); static const MSSymbol& symbol(void); }; inline AplusUpdateDataEvent::AplusUpdateDataEvent(void) : MSEvent(AplusUpdateDataEvent::symbol()) {} inline AplusVerifyEvent::AplusVerifyEvent( AplusVerifyEvent &apve_) : _aplusVar(apve_.aplusVar()),_a(apve_.a()), _result(apve_.result()), MSEvent(AplusVerifyEvent::symbol()) {} inline AplusVerifyEvent::AplusVerifyEvent(void) : MSEvent(AplusVerifyEvent::symbol()) {} inline AplusVerifyEvent::AplusVerifyEvent(V v_, A a_) : _aplusVar(v_), _a(a_), _result(MSFalse), MSEvent(AplusVerifyEvent::symbol()) {} inline AplusEvent::AplusEvent( AplusEvent &ape_) : _index(ape_.index()),_pick(ape_.pick()), _ravel(ape_.ravel()), MSEvent(AplusEvent::symbol()) {} inline AplusEvent::AplusEvent(void) : MSEvent(AplusEvent::symbol()) {} inline AplusEvent::AplusEvent(A index_, A pick_, I ravel_) : _index(index_), _pick(pick_), _ravel(ravel_), MSEvent(AplusEvent::symbol()) {} #endif // AplusEventHEADER aplus-fsf-4.22/src/AplusGUI/AplusFormatter.H0000644000265000001440000000352110772770351014331 #ifndef __AplusFormatter_H #define __AplusFormatter_H /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include class AplusFormatter { public: enum OutputFormat {BadFormat=0,NoFormat=1,Float=2,Fixed=3,Fraction=4, Price32=10,Price64=11,Price128=12,Price320=13,Price328=14, hh=20,hh24=21,mm=22,ss=23,hhmm=24,hhmm24=25,mmss=26,hhmmss=27,hhmmss24=28, D=30,DDD=31,DD=32,MM=33,MO=34,Y2=35,Y4=36, DMDDYYYY=37,DDMMYY=38,DDMMYYYY=39,MMDDYY=40,MMDDYYYY=41, D_u=60,DDD_u=61,DD_u=62,MM_u=63,MO_u=64,Y2_u=65,Y4_u=66, DMDDYYYY_u=67,DDMMYY_u=68,DDMMYYYY_u=69,MMDDYY_u=70,MMDDYYYY_u=71}; // XGraph.C is dependent on the integer values assigned to the above enumerations protected: static AplusHashTable *_enumHashTable; static AplusHashTable *_stringEnumHashTable; static int _count; static struct tm _aTimeStruct; int count(void) { return _count; } AplusHashTable *enumHashTable(void) { return _enumHashTable; } AplusHashTable *stringEnumHashTable(void) { return _stringEnumHashTable; } void initHashTable(void); void initStringHashTable(void); struct tm *julianDay(double); struct tm *parseDate(double); public: AplusFormatter(void); ~AplusFormatter(void); OutputFormat format(const char *); OutputFormat format(A); A formats(void); char *formatEnumString(int); const char *formatOutput(OutputFormat,double,int,MSBoolean); A formatOutput(A,A); A fmt(A,A); A sfmt(A,A); A thorn(A,A); int defaultPrecision(void); }; #endif aplus-fsf-4.22/src/AplusGUI/AplusGraph.H0000644000265000001440000003363510772770351013440 #ifndef AplusGraphHEADER #define AplusGraphHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #if HAVE_IOSTREAM #include #else #include #endif #include #include #include #include #include #include #include #include class EnumError { protected: MSString _lamp; MSString _attrmsg; MSString _symmsg; public: EnumError(void); ~EnumError(void){} void attrmsg(const char *msg_) { _attrmsg = msg_;} const char *attrmsg(void) { return _attrmsg.string(); } void symmsg (const char *msg_) { _symmsg = msg_;} const char *symmsg (void) { return _symmsg.string(); } const char *lamp (void) { return _lamp.string(); } void showError(V v_,const char* str_) { cerr<cx->s->n<<"."<<(char*)v_->s->n; if (str_!=0) cerr<& traceList(void) {return MSGraph::traceList(); } STANDARD_WIDGET_METHODS_H }; inline AplusGraph::LegendAlignConverter::LegendAlignConverter(void) : AplusHashEnumConverter() {} inline AplusGraph::LegendAlignConverter::~LegendAlignConverter(void) {} #endif //AplusGraphHEADER aplus-fsf-4.22/src/AplusGUI/AplusHashTable.H0000644000265000001440000000113410772770351014217 #ifndef AplusHashTableHEADER #define AplusHashTableHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include class AplusHashTable : public MSHashTable { public: AplusHashTable(unsigned =0); virtual ~AplusHashTable(void); A listAllEntries(void) const; }; #endif //AplusHashTableHEADER aplus-fsf-4.22/src/AplusGUI/AplusLabel.H0000644000265000001440000000233610772770351013410 #ifndef AplusLabelHEADER #define AplusLabelHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include class AplusLabel : public MSLabel { public: AplusLabel(MSWidget *); ~AplusLabel(void); virtual MSBoolean verifyData(V,A); virtual const MSSymbol& widgetType(void) const; static const MSSymbol& symbol(void); protected: virtual AplusModel *model(void) const { return (AplusModel *)_model; } virtual void addSenderNotify(MSEventSender *); virtual void receiveEvent(MSEvent &); virtual int numRows(void) const; virtual int numColumns(void) const; virtual int numColumns(int) const; virtual const char *formatOutput(MSString&,int); // // drawRow() is overriden in order to support functional foreground // virtual void drawRow(int); virtual void drawRow(int,int,const char *,int); virtual unsigned long rowForeground(int) const; STANDARD_WIDGET_METHODS_H }; #endif // AplusLabelHEADER aplus-fsf-4.22/src/AplusGUI/AplusLabelOut.H0000644000265000001440000001311410772770351014074 #ifndef __AplusLabelOut_H #define __AplusLabelOut_H /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include /////////////////////////////////////////////////////////////////////////////// // LabelOut Architecture // // // // +------------+ // // | MSLabelOut | // // +------------+ // // | // // | // // +-------------+ // // |AplusLabelOut| // // +-------------+ // // / | \ // // / | \ // // / | \ // // / | \ // // +-------------------+ +-------------------+ +-------------------+ // // | AplusFuncLabelOut | |AplusFormatLabelOut| | AplusFuncLabel | // // +-------------------+ +-------------------+ +-------------------+ // // // // // // AplusFuncLabelOut is used when: // // `g has (`xlabelout; func) // // // // AplusFormatLabelOut is used when: // // `g has (`xlabelout; (`float; 5)) // // // // AplusFuncLabel is used when: // // `g has (`xlabel; (1 2 3; ("A"; "B"; "C"); .5 ; .2)) // // // // The data all reside in AplusLabelOut. The subclass constructors has to // // set the appropriate data members in AplusLabelOut for it to work // // correctly. // // // /////////////////////////////////////////////////////////////////////////////// class AplusLabelOut : public MSLabelOut { private: AOutFunction *_outFunc; int _precision; AplusFormatter::OutputFormat _format; A _a; P _p; A _tick; A _grid; A _value; V _v; public: AplusLabelOut(void); ~AplusLabelOut(void); // Accessors AOutFunction *outFunc(void) { return _outFunc; } int precision(void) { return _precision; } AplusFormatter::OutputFormat format(void) { return _format; } A a(void) { return _a; } P p(void) { return _p; } A tick(void) { return _tick; } A grid(void) { return _grid; } A value(void) { return _value; } V v(void) { return _v; } // Mutators void outFunc(AOutFunction *outFunc_) { _outFunc = outFunc_; } void precision(int precision_) { _precision = precision_;} void format(AplusFormatter::OutputFormat format_) { _format = format_; } void a(A a_) { _a = a_; } void p(P p_) { _p = p_; } void tick(A tick_) { _tick = tick_; } void grid(A grid_) { _grid = grid_; } void value(A value_) { _value = value_; } void v(V v_) { _v = v_; } virtual const char *label(MSString &buf_, unsigned i_) const { return MSLabelOut::label(buf_,i_);} virtual unsigned tickPositionLength(void) const; virtual unsigned gridWidthLength(void) const; virtual unsigned tickSizeLength(void) const; virtual double tickPosition(unsigned) const; virtual double tickSize(unsigned) const; virtual unsigned gridWidth(unsigned) const; virtual const char *formatOutput(MSString&, double); }; class AplusFuncLabelOut : public AplusLabelOut { public: AplusFuncLabelOut(AOutFunction *, V, AplusLabelOut *old_ = 0); ~AplusFuncLabelOut(void); }; class AplusFormatLabelOut : public AplusLabelOut { public: AplusFormatLabelOut(AplusFormatter::OutputFormat, int p_=-1,AplusLabelOut *old_=0); ~AplusFormatLabelOut(void); }; class AplusFuncLabel : public AplusLabelOut { public: AplusFuncLabel(A, AplusLabelOut *old_=0); ~AplusFuncLabel(void); void label(A); virtual const char *label(MSString& buf_, unsigned i_)const{return AplusLabelOut::label(buf_,i_);} MSBoolean verify(A); }; #endif aplus-fsf-4.22/src/AplusGUI/AplusLayout.H0000644000265000001440000000157010772770351013645 #ifndef AplusLayoutHEADER #define AplusLayoutHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include class AplusLayout : public MSLayout { public: AplusLayout(MSWidget *); ~AplusLayout(void); virtual void receiveEvent(MSEvent &); virtual MSBoolean verifyData(V,A) { return MSTrue; } virtual void addSenderNotify(MSEventSender *); virtual const MSSymbol& widgetType(void) const; static const MSSymbol& symbol(void); STANDARD_WIDGET_METHODS_H }; #endif // AplusLayoutHEADER aplus-fsf-4.22/src/AplusGUI/AplusManager.H0000644000265000001440000000176210772770351013745 #ifndef AplusManagerHEADER #define AplusManagerHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include class AplusManager : public MSManager { public: AplusManager(MSWidget *); ~AplusManager(void); virtual void addSenderNotify(MSEventSender *); virtual void receiveEvent(MSEvent &); virtual MSBoolean verifyData(V,A) { return MSTrue; } virtual void update(V,int,int,int) {} virtual void update(V,A,A,I) {} virtual void update(const MSIndexVector &v_) { MSManager::update(v_); } virtual const MSSymbol& widgetType(void) const; static const MSSymbol& symbol(void); STANDARD_WIDGET_METHODS_H }; #endif // AplusManagerHEADER aplus-fsf-4.22/src/AplusGUI/AplusMatrix.H0000644000265000001440000001047610772770352013642 #ifndef AplusMatrixHEADER #define AplusMatrixHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include class ASpaceFunction : public AFunction { public: ASpaceFunction(void) { _func=0;_arg=0; } ASpaceFunction(AFunc func_,AClientData *arg_=0) : AFunction(func_,arg_) {} ~ASpaceFunction(void) {} A callFunc(V v_,A a_) { A r=(func()!=0)?(A)(*func())(arg(),a_,aplus_nl,aplus_nl,v_):aplus_nl; if (a_!=0) dc((A)a_); return r; } A invoke(V v_,A value_) { return (A)callFunc(v_,(A)ic(value_)); } }; class AplusMatrix : public AplusArray { public: AplusMatrix(MSWidget *); ~AplusMatrix(void); virtual MSBoolean verifyData(V,A); virtual const MSSymbol& widgetType(void) const; static const MSSymbol& symbol(void); void rowIndex(A); void colIndex(A); void cornerIndex(MSBoolean); A rowIndexVector(void) { return (A)ic(rowIndex()); } A colIndexVector(void) { return (A)ic(colIndex()); } MSBoolean cornerIndex(void) { return _cornerIndex; } unsigned long rowIndexBg(void) { return _rowIndexBg; } unsigned long colIndexBg(void) { return _colIndexBg; } unsigned long cornerIndexBg(void) { return _cornerIndexBg; } void rowIndexBg(unsigned long); void colIndexBg(unsigned long); void cornerIndexBg(unsigned long); ASpaceFunction *spaceFunc(void) { return &_spaceFunc; } void spaceFunc(AFunc func_,AClientData *arg_); A colSpace(void) { return (A)ic(spaceVector()); } int numHeadings(void) { return _numHeadings; } void colSpace(A); void numHeadings(int); A heading(int); A rowLabel(int); unsigned long labelColor(int); virtual unsigned columnLength(unsigned); virtual void firstMapNotify(void); virtual void updateTitle(void); protected: int _labelLength; int _numHeadings; A _spaceVector; ASpaceFunction _spaceFunc; unsigned long _rowIndexBg; unsigned long _colIndexBg; unsigned long _cornerIndexBg; A _rowIndex; A _colIndex; MSBoolean _cornerIndex; MSGC *_rowIndexXGC; MSGC *_colIndexXGC; MSGC *_cornerIndexXGC; A spaceVector(void) { return _spaceVector; } A rowIndex(void) { return _rowIndex; } A colIndex(void) { return _colIndex; } MSGC *rowIndexXGC(void) { return _rowIndexXGC; } MSGC *colIndexXGC(void) { return _colIndexXGC; } MSGC *cornerIndexXGC(void) { return _cornerIndexXGC; } GC rowIndexGC(void) { return rowIndexXGC()->gc(); } GC colIndexGC(void) { return colIndexXGC()->gc(); } GC cornerIndexGC(void) { return cornerIndexXGC()->gc(); } int labelLength(void) { return _labelLength; } void createRowIndexXGC(void); void createColIndexXGC(void); void createCornerIndexXGC(void); virtual int labelWidth(void) { return labelLength()*charWidth()+(columnSpacing()<<1); } virtual int headingsHeight( void ) { return numHeadings()*rowHeight(); } // We have to override redrawImmediately() to ensure that the corner label gets drawn // every time the window is redrawn. // virtual void redrawImmediately(void); // Draw corner Label virtual void drawLabel() { drawLabel(panner()->window()); } virtual void drawLabel(Window); // Draw row labels virtual void drawLabels(int rs_,int re_) { drawLabels(panner()->window(),rs_,re_); } virtual void drawLabels(Window,int,int); // Draw column labels virtual void drawHeadings(Window win_) { drawHeadings(win_, firstColumn(), lastColumn()); } virtual void drawHeadings(Window,int,int); virtual void drawFieldHeadings(Window xid_,int cs_,int ce_); virtual void drawFieldHeading(Window,A,unsigned long,Font,MSRect&); virtual void shapeUpdate(void); virtual void updateColSpace(void); Font headingFont(int col_); unsigned long headingColor(int col_); Font labelFont(int row_); MSBoolean isColIndexed(int); MSBoolean isRowIndexed(int); void sizeUpdate(void); STANDARD_WIDGET_METHODS_H }; #endif //AplusMatrixHEADER aplus-fsf-4.22/src/AplusGUI/AplusMenu.H0000644000265000001440000000373010772770352013275 #ifndef AplusMenuHEADER #define AplusMenuHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #include // The AplusMenu class is a subclass of MSMenuBar. When a new variable // is coupled to the class, updateData() calls buildMenu to construct // the menu structure by recursively walking the nested slot filler. // When a menuItem is activated, the message is passed all the way up // to the menubar (unless there is a callback). // class AplusMenu : public MSMenuBar { public: AplusMenu(MSWidget *, Orientation =Horizontal); ~AplusMenu(void); virtual MSBoolean verifyData(V,A); void mnemonics(A); A mnemonics(void); virtual const MSSymbol& widgetType(void) const; static const MSSymbol& symbol(void); protected: virtual void addSenderNotify(MSEventSender *m_); virtual void receiveEvent(MSEvent &); virtual void updateData(void); virtual void update(V,int,int,UpdateType) {} virtual void update(V,A,A,I); virtual void update(const MSIndexVector &v_) { MSMenuBar::update(v_); } virtual void activate(void); void buildMenu(A,A); void buildPullDown(MSMenuBarItem *,A,S *,int); void buildCascadePullDown(MSCascadeMenuItem *,A,S *,int); void buildCascades(MSMenu *,A,S *,int); void formSymbolVector(MSStringVector &); virtual MSMenuBarItem *newMenuBarItem(const char *); MSBoolean verifyMnemonic(MSMenu *, A); void setMnemonic(MSMenu *, A); A getMnemonic(MSMenu*); STANDARD_WIDGET_METHODS_H }; #endif // AplusMenuHEADER aplus-fsf-4.22/src/AplusGUI/AplusModel.H0000644000265000001440000001051310772770352013426 #ifndef AplusModelHEADER #define AplusModelHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include class MSWidgetView; class AInFunction; class ACharStrFunction; class AOutFunction; class AColorFunction; class AFontFunction; class AGeometryFunction; class AReadOnlyFunction; class ACycleFunction; class AFunction; class AVariableData; extern int AplusEvaluationDepth; class AplusModel : public MSScalarModel { private: // private default constructor to make sure that AplusModel is always constructed // with an explicit argument AplusModel(); protected: V _aplusVar; // Aplus variable A _sflags; // flags for S layer AplusModel& operator=(const AplusModel&); public: AplusModel(V); ~AplusModel(void); inline void aplusVar(V); inline V aplusVar(void) const; inline void sflags(A pFlags_); inline A sflags(void) const; inline MSBoolean isValid(void) const; int numRows(void) const; int numCols(void) const; int charLength(void) const; inline MSBoolean evaluate(void) const; inline A a(void) const; inline int rank(void) const; inline int a_type(void) const; inline int numElmts(void) const; inline int d0(void) const; inline int d1(void) const; inline I *data(void) const; inline CX context(void) const; inline AVariableData *pAVarData(void) const; virtual MSString asString(void) const; virtual MSString asDebugInfo(void) const; virtual MSString asMSF(void) const; virtual MSString className(void) const; virtual const MSSymbol& type(void) const; virtual MSError::ErrorStatus set(const char *); virtual MSError::ErrorStatus setFromMSF(const char *); virtual MSModel *clone(void) const; virtual MSModel *create(void) const; virtual void assign(const MSModel&); virtual long compare(const MSModel&) const; static const MSSymbol& symbol(void); MSBoolean coupleWidgetView (MSWidgetView *); void bindWidgetView (MSWidgetView *); void unbindWidgetView(void); static MSUnsignedLongVector & aplusVarList(void); static void doneCB(V,A,A,A); static AInFunction *getInFunc(V); static ACharStrFunction *getOutFunc(V); static AOutFunction *getTitleFunc(V); static AColorFunction *getFgFunc(V); static AColorFunction *getBgFunc(V); static AColorFunction *getTitleColorFunc(V); static AFontFunction *getFontFunc(V); static AFontFunction *getTitleFontFunc(V); static AReadOnlyFunction *getReadOnlyFunc(V); static AGeometryFunction *getGeometryFunc(V); static ACycleFunction *getCycleFunc(V); static AFunction *getDoneFunc(V); }; inline void AplusModel::aplusVar(V var_) { _aplusVar=var_; } inline V AplusModel::aplusVar(void) const { return _aplusVar; } inline A AplusModel::a(void) const { if (_aplusVar==0) { return 0; } else { if (_aplusVar->z==0) { evaluate(); } return (A)_aplusVar->a; } } inline void AplusModel::sflags(A pFlags_) { dc(_sflags); _sflags=(A)ic(pFlags_); } inline A AplusModel::sflags(void) const { return (A) ic(_sflags); } inline MSBoolean AplusModel::isValid(void) const { return (aplusVar()->z==1)?MSTrue:MSFalse; } inline MSBoolean AplusModel::evaluate(void) const { ++AplusEvaluationDepth; gt(_aplusVar); --AplusEvaluationDepth; return (q==0)?MSTrue:MSFalse; } inline int AplusModel::rank(void) const { return (_aplusVar)?(int)a()->r:0; } inline int AplusModel::a_type(void) const { return (_aplusVar)?(int)a()->t:0; } inline int AplusModel::numElmts(void) const { return (_aplusVar)?(int)a()->n:0; } inline int AplusModel::d0(void) const { return (_aplusVar)?(int)a()->d[0]:0; } inline int AplusModel::d1(void) const { return (_aplusVar)?(int)a()->d[1]:0; } inline I *AplusModel::data(void) const { return (_aplusVar)?(I *)a()->p:0; } inline CX AplusModel::context(void) const { return (_aplusVar)?(CX)_aplusVar->cx:0; } inline AVariableData *AplusModel::pAVarData(void) const { return (AVariableData *)_aplusVar->attr; } #endif //AplusModelHEADER aplus-fsf-4.22/src/AplusGUI/AplusNotebook.H0000644000265000001440000000154110772770352014147 #ifndef AplusNotebookHEADER #define AplusNotebookHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include class AplusNotebook : public MSNotebook { public: AplusNotebook(MSWidget *); ~AplusNotebook(void); virtual void addSenderNotify(MSEventSender *); virtual void receiveEvent(MSEvent &); virtual MSBoolean verifyData(V,A) { return MSTrue; } virtual const MSSymbol& widgetType(void) const; static const MSSymbol& symbol(void); STANDARD_WIDGET_METHODS_H }; #endif //AplusNotebookHEADER aplus-fsf-4.22/src/AplusGUI/AplusPage.H0000644000265000001440000001723410772770352013251 #ifndef AplusPageHEADER #define AplusPageHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// // AplusPage class needs to be rewritten to use MStk's MSPage widget. // #include #include "Macros.H" #include "AplusEvent.H" #include "AplusCommon.H" class APageFunction : public AFunction { public: APageFunction(void) { _func=0; _arg=0; } APageFunction(AFunc func_,AClientData *arg_=0) : AFunction(func_,arg_) {} ~APageFunction(void) {} A grc(int row_,int col_) { A a=gv(Et,2); a->p[0]=(row_==-1)?(I)aplus_nl:(I)gi(row_); a->p[1]=(col_==-1)?(I)aplus_nl:(I)gi(col_); return a; } int callFunc(V v_,A a_,int row_,int col_) { int ret=0; A i; if (row_==-1 && col_==-1) i=0; else i=grc(row_,col_); if (func()!=0) { A r=(A)(*func())(arg(),a_,i,aplus_nl,v_); if (r!=0 && QA(r) && r->t==It) ret=(int)r->p[0]; if (QA(r)) dc((A)r); } if (i!=0) dc((A)i); if (a_!=0 && isNull(a_)==MSFalse) dc((A)a_); return ret; } int invoke(V v_,char value_,int row_,int col_) { A str=(A)gs(Ct); *str->p=(I)value_; return callFunc(v_,str,row_,col_); } int invoke(V v_,int row_,int col_) { return callFunc(v_,aplus_nl,row_,col_); } A invoke(V v_,A index_) { A r=aplus_nl; if (func()!=0) r=(A)(*func())(arg(),aplus_nl,index_,aplus_nl,v_); return (r!=0 && QA(r) && r->t==It)?r:aplus_nl; } }; class AplusPage; class AplusBlinkTimer : public MSIntervalTimer { private: AplusPage *_page; AplusPage *page(void) { return _page; } public: AplusBlinkTimer(AplusPage *page_,unsigned long interval_); ~AplusBlinkTimer(); virtual void process(void); }; class AplusPage : public MSCompositeText { friend class AplusBlinkTimer; public: enum BlinkPhase{Normal,Reverse}; protected: int _x_cursor; int _y_cursor; int _margin; MSNodeItem _colorListHead; AplusBlinkTimer *_blinkTimer; BlinkPhase _blinkPhase; A _blink; unsigned long _blinkRate; Font _boldFontID; APageFunction _indexFunc; APageFunction _boldFunc; APageFunction _underlineFunc; APageFunction _blinkFunc; RubberBand _rubberBand; int _lineWidth; A _boxMatrix; A _lineMatrix; A _boxColors; MSNodeItem _boxListHead; A _keyBuf; MSNodeItem *colorListHead(void) { return _colorListHead.address(); } MSNodeItem *boxListHead(void) { return _boxListHead.address(); } AplusBlinkTimer *blinkTimer(void) { return _blinkTimer; } A blink(void) { return _blink; } BlinkPhase blinkPhase(void) { return _blinkPhase; } Font boldFontID(void) { return _boldFontID; } RubberBand *rubberBand(void) { return &_rubberBand; } A boxMatrix(void) { return _boxMatrix; } A lineMatrix(void) { return _lineMatrix; } A boxColors(void) { return _boxColors; } A keyBuffer(void) { return _keyBuf; } int x_cursor(void) { return _x_cursor; } int y_cursor(void) { return _y_cursor; } unsigned long boxColor(int row_) { return (isNull(boxColors())==MSFalse && row_n)? (unsigned long)boxColors()->p[row_]:foreground(); } virtual void refresh(void); virtual void computeSize(void); virtual void screenRedraw(void); virtual void drawRow(int row_,int col_,const char *str_,int len_, int index_,MSBoolean bold_,BlinkPhase phase_,MSBoolean underline_); virtual void drawAllRowsCols(A index_); virtual void drawAllRows(A index_); virtual void drawAllCols(A index_); virtual void drawIndexed(A index_); virtual void drawBoxes(MSBoolean clear_); virtual void drawLines(MSBoolean clear_); void drawRect(GC gc_,int x_,int y_,int w_,int h_) { XDrawRectangle(display(),window(),gc_,x_,y_,w_,h_); } int computeYCoord(int row_); int computeXCoord(int row_,int col_); int xToCol(int x_); int yToRow(int y_); int drawWidth(void); int drawHeight(void); ColorCell *colorCell(int index_); void addColor(int index_,unsigned long fg_,unsigned long bg_); void x_cursor(int x_) { _x_cursor=x_; } void y_cursor(int x_) { _y_cursor=x_; } void boldFontID(Font id_) { _boldFontID=id_; } void blink(A blink_) { dc(blink()); _blink=(A)ic(blink_); } void blinkPhase(BlinkPhase b_) { _blinkPhase=b_; } void toggleBlinkPhase(void) { blinkPhase((blinkPhase()==Normal)?Reverse:Normal); } MSBoolean drawBlink(A blink_,BlinkPhase phase_); MSBoolean verifyBlink(A blink_); MSBoolean verifyA(A a_); MSBoolean verifyA(A a_,A r_,A c_); void blinkTimeOut(void); void blinkUpdate(void); void startBlinkTimer(void); void stopBlinkTimer(void); virtual void processBlinkTimer(void); public: AplusPage(MSWidget *); ~AplusPage(); virtual void receiveEvent(MSEvent &); virtual void addSenderNotify(MSEventSender *); virtual const MSSymbol& widgetType(void) const; static const MSSymbol& symbol(void); int margin(void) { return _margin; } void margin(int margin_) { if (margin()!=margin_) { _margin=margin_; refresh(); } } virtual void redraw(void); virtual int numRows(void); virtual int numCols(void); char *string(int row_); APageFunction *indexFunc(void) { return &_indexFunc; } void indexFunc(AFunc func_,AClientData *arg_) { indexFunc()->func(func_); indexFunc()->arg(arg_); redraw(); } APageFunction *boldFunc(void) { return &_boldFunc; } void boldFunc(AFunc func_,AClientData *arg_) { boldFunc()->func(func_); boldFunc()->arg(arg_); redraw(); } APageFunction *underlineFunc(void) { return &_underlineFunc; } void underlineFunc(AFunc func_,AClientData *arg_) { underlineFunc()->func(func_); underlineFunc()->arg(arg_); redraw(); } APageFunction *blinkFunc(void) { return &_blinkFunc; } void blinkFunc(AFunc func_,AClientData *arg_) { blinkFunc()->func(func_); blinkFunc()->arg(arg_); redraw(); } unsigned long blinkRate(void) { return _blinkRate; } void blinkRate(unsigned long rate_); int lineWidth(void) { return _lineWidth; } void lineWidth(int lw_) { if (lw_!=lineWidth()) { _lineWidth=lw_; redraw(); }} void colorTable(A ct_); A colorTable(void); A rBand(void); A boxes(void); A lines(void); void boxes(A boxes_); void lines(A lines_); A boxColorVector(void); void boxColorVector(A colors_); A keyBuf(void); A cursorPosition(void) {A a=gv(It,2); a->p[0]=(I)y_cursor(); a->p[1]=(I)x_cursor(); return a;} virtual void keyPress(const XEvent *,KeySym,unsigned int,const char *); virtual void buttonPress(const XEvent *); virtual void buttonRelease(const XEvent *); virtual void configure(void); virtual void firstMapNotify(void); virtual void naturalSize(void) { computeSize(); } void commonUpdate(V v_,A index_,A pick_,I ravel_); virtual void update(V v_,int row_,int col_,UpdateType type_); virtual void update(V v_,A index_,A pick_,I ravel_); virtual void update(const MSIndexVector &v_) { MSCompositeText::update(v_); } virtual void screenUpdate(A index_); virtual MSBoolean verifyData(V v_,A a_); virtual void updateData(void); virtual void updateTitle(void) {} virtual void updateFont(Font); virtual void updateForeground(unsigned long); virtual void print(const char *file_=0); STANDARD_WIDGET_METHODS_H }; #endif aplus-fsf-4.22/src/AplusGUI/AplusPanes.H0000644000265000001440000000306210772770352013435 #ifndef AplusPanesHEADER #define AplusPanesHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include class AplusPane : public MSPane { public: AplusPane(MSWidget *); ~AplusPane(void); virtual void receiveEvent(MSEvent &); virtual MSBoolean verifyData(V,A) { return MSTrue; } virtual void addSenderNotify(MSEventSender *); virtual const MSSymbol& widgetType(void) const; static const MSSymbol& symbol(void); STANDARD_WIDGET_METHODS_H }; class AplusHPane : public MSHPane { public: AplusHPane(MSWidget *); ~AplusHPane(void); virtual void receiveEvent(MSEvent &); virtual MSBoolean verifyData(V,A) { return MSTrue; } virtual void addSenderNotify(MSEventSender *); virtual const MSSymbol& widgetType(void) const; static const MSSymbol& symbol(void); STANDARD_WIDGET_METHODS_H }; class AplusVPane : public MSVPane { public: AplusVPane(MSWidget *); ~AplusVPane(void); virtual void receiveEvent(MSEvent &); virtual MSBoolean verifyData(V,A) { return MSTrue; } virtual void addSenderNotify(MSEventSender *); virtual const MSSymbol& widgetType(void) const; static const MSSymbol& symbol(void); STANDARD_WIDGET_METHODS_H }; #endif // AplusPanesHEADER aplus-fsf-4.22/src/AplusGUI/AplusParagraph.H0000644000265000001440000000217610772770352014301 #ifndef AplusParagraphHEADER #define AplusParagraphHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include class AplusParagraph : public MSWidgetView, public MSParagraph { public: AplusParagraph(MSWidget *); ~AplusParagraph(void); virtual void addSenderNotify(MSEventSender *); virtual void receiveEvent(MSEvent &); static MSBoolean verifyData(V,::A); virtual const MSSymbol& widgetType(void) const; static const MSSymbol& symbol(void); inline AplusModel *model(void); inline const AplusModel *model(void) const; STANDARD_WIDGET_METHODS_H }; inline AplusModel *AplusParagraph::model(void) { return (AplusModel *)_model; } inline const AplusModel *AplusParagraph::model(void) const { return (const AplusModel *)_model; } #endif //AplusParagraphHEADER aplus-fsf-4.22/src/AplusGUI/AplusPassword.H0000644000265000001440000000337310772770352014176 #ifndef AplusPasswordHEADER #define AplusPasswordHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include class PasswordEditor : public MSEntryField::FieldEditor { friend class AplusPassword; public: PasswordEditor(MSWidget *parent_); ~PasswordEditor(void); char fillChar( void ) const { return _fillChar; } void fillChar( char ch_ ); virtual const char *string( void ); protected: char _fillChar; MSString _stringBuffer; }; class AplusPassword : public AplusEntryField { public: AplusPassword(MSWidget *); ~AplusPassword(void); MSBoolean valid( void ) { return _valid; } char fillChar( void ) { return passwordEditor()->fillChar(); } void fillChar( char ch_ ); virtual const char *formatOutput(MSString& str_) { return 0; } virtual MSBoolean verifyData(V v_,A a_); virtual const MSSymbol& widgetType(void) const; static const MSSymbol& symbol(void); protected: MSBoolean _valid; PasswordEditor *passwordEditor( void ) { return (PasswordEditor *)_editor; } MSBoolean checkPassword(const char *username_,const char *password_); virtual void button1Press(const XEvent *); virtual MSBoolean validate(const char *); // // need to override activate() in order to do validation properly; // see the comment in the method's definition // virtual void activate(void); }; #endif // AplusPasswordHEADER aplus-fsf-4.22/src/AplusGUI/AplusPopup.H0000644000265000001440000000226210772770352013473 #ifndef AplusPopupHEADER #define AplusPopupHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include class AplusPopup : public MSPopup { public: AplusPopup(void); AplusPopup(MSDisplayServer *); ~AplusPopup(void); MSWidgetView *getNextFocusAfter(MSWidgetView *); void insertFocusAfter(MSWidgetView *, MSWidgetView *); virtual void receiveEvent(MSEvent &); virtual MSBoolean verifyData(V,A) { return MSTrue; } virtual void addSenderNotify(MSEventSender *); virtual MSBoolean traverseFocus(MSWidget *); virtual void decoupleWidget(void); void setWMSaveYourself(void) { MSTopLevel::setWMSaveYourself(); } virtual void showAndWaitForMap(void); void virtualScreen(A screen_); A virtualScreen(void); virtual const MSSymbol& widgetType(void) const; static const MSSymbol& symbol(void); }; #endif //AplusPopupHEADER aplus-fsf-4.22/src/AplusGUI/AplusPrintColumn.H0000644000265000001440000000226110772770352014641 #ifndef AplusPrintColumnHEADER #define AplusPrintColumnHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include class AplusPrintColumn : public MSWidgetView, public MSPrintColumn { public: AplusPrintColumn(MSWidget *); ~AplusPrintColumn(void); virtual void addSenderNotify(MSEventSender *); virtual void receiveEvent(MSEvent &); static MSBoolean verifyData(V,::A); virtual const MSSymbol& widgetType(void) const; static const MSSymbol& symbol(void); void constructColumn(void); inline AplusModel *model(void); inline const AplusModel *model(void) const; STANDARD_WIDGET_METHODS_H }; inline AplusModel *AplusPrintColumn::model(void) { return (AplusModel *)_model; } inline const AplusModel *AplusPrintColumn::model(void) const { return (const AplusModel *)_model; } #endif //AplusPrintColumnHEADER aplus-fsf-4.22/src/AplusGUI/AplusPrintText.H0000644000265000001440000000242510772770352014332 #ifndef AplusPrintTextHEADER #define AplusPrintTextHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include // This class should be renamed to AplusParagraph and be derived from MSParagraph. // MSPrintText class is obsolete in MStk: it has been replaced by MSParagraph; // however, for backward compatibility's sake MSPrintText is currently typedef'd // to MSParagraph, which makes compiling this code possible. class AplusPrintText : public MSPrintText { public: AplusPrintText(void); ~AplusPrintText(void); static MSHashTable *stringEnumHashTable(void) { return &_stringEnumHashTable; } static MSHashTable *enumHashTable(void) { return &_enumHashTable; } static ::A convertMode(unsigned long); static unsigned long convertMode(::A); protected: void initEnumHashTable(void); void initStringEnumHashTable(void); private: static MSHashTable _stringEnumHashTable; static MSHashTable _enumHashTable; static MSBoolean _initialized; }; #endif //AplusPrintTextHEADER aplus-fsf-4.22/src/AplusGUI/AplusPrintTool.H0000644000265000001440000000477410772770352014334 #ifndef AplusPrintToolHEADER #define AplusPrintToolHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include class AplusPrintTool : public MSWidgetView, public MSPrintTool { protected: ::A _headers; ::A _footers; ::A _banner; ::A _pageNumber; public: AplusPrintTool(MSWidget *); ~AplusPrintTool(void); virtual void addSenderNotify(MSEventSender *); virtual void receiveEvent(MSEvent &); static MSBoolean verifyData(V,::A); inline void headers(::A h_); inline ::A headers(void) const; inline void footers(::A f_); inline ::A footers(void) const; inline void banner(::A b_); inline ::A banner(void) const; inline void pageNumber(::A pn_); inline ::A pageNumber(void) const; void constructReport(void); void constructHeaders(void); void constructBody(void); void constructFooters(void); void constructBanner(void); void constructPageNumber(void); static void constructPrintManager(MSPrintManager *, ::A); static void constructPrintItem(MSPrintManager *, ::A); static void constructPrintItem(MSPrintManager *, S); void constructHeaderItem(S); void constructFooterItem(S); virtual const MSSymbol& widgetType(void) const; static const MSSymbol& symbol(void); inline AplusModel *model(void); inline const AplusModel *model(void) const; STANDARD_WIDGET_METHODS_H }; inline void AplusPrintTool::headers(::A h_) { dc(_headers); _headers=(::A)ic(h_); } inline ::A AplusPrintTool::headers(void) const { return _headers; } inline void AplusPrintTool::footers(::A f_) { dc(_footers); _footers=(::A)ic(f_); } inline ::A AplusPrintTool::footers(void) const { return _footers; } inline void AplusPrintTool::banner(::A b_) { dc(_banner); _banner=(::A)ic(b_); } inline ::A AplusPrintTool::banner(void) const { return _banner; } inline void AplusPrintTool::pageNumber(::A pn_) { dc(_pageNumber); _pageNumber=(::A)ic(pn_); } inline ::A AplusPrintTool::pageNumber(void) const { return _pageNumber; } inline AplusModel *AplusPrintTool::model(void) { return (AplusModel *)_model; } inline const AplusModel *AplusPrintTool::model(void) const { return (const AplusModel *)_model; } #endif //AplusPrintToolHEADER aplus-fsf-4.22/src/AplusGUI/AplusRadioBox.H0000644000265000001440000000516310774430532014075 #ifndef AplusRadioBoxHEADER #define AplusRadioBoxHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include //#include #include #include #include #include class AplusRadioBox : public AplusButtonBox { friend class AplusRadioButton; public: AplusRadioBox(MSWidget *); ~AplusRadioBox(void); MSRadioButton *activeButton(void); const MSRadioButton *activeButton(void) const; virtual void updateForeground(unsigned long); virtual void update(V,int,int,UpdateType) {} virtual void update(V v_, A a_, A p_, I r_) { AplusButtonBox::update(v_,a_,p_,r_); } virtual void update(const MSIndexVector &v_) { AplusButtonBox::update(v_); } virtual void updateData(void); virtual void updateValue(int row_); virtual MSBoolean verifyData(V v_,A a_); MSRadioButton *armedButton(void) { return _armedButton; } protected: virtual void firstMapNotify(void); virtual void disarm(void); virtual void arm(MSRadioButton *); virtual const MSSymbol& widgetType(void) const; static const MSSymbol& symbol(void); virtual MSActionButton *newButton(void); virtual void setButtonState(MSActionButton *, unsigned long); MSRadioButton *_armedButton; }; class AplusRadioButton : public MSRadioButton { friend class AplusRadioBox; public: AplusRadioButton(MSWidget *); ~AplusRadioButton(void); protected: virtual void radioBoxArm(void); virtual void radioBoxDisarm(void); virtual void radioBoxActivate(void); inline const AplusRadioBox *radioBox(void) const; inline AplusRadioBox *radioBox(void); virtual void up(void); virtual void down(void); virtual void left(void); virtual void right(void); virtual void focusIn(void); virtual MSBoolean isProtected(void) const; }; inline MSRadioButton *AplusRadioBox::activeButton(void) { return (MSRadioButton *)_activeButton; } inline const MSRadioButton *AplusRadioBox::activeButton(void) const { return (const MSRadioButton *)_activeButton; } inline const AplusRadioBox *AplusRadioButton::radioBox(void) const { return (parentWidgetType()==AplusRadioBox::symbol()?(AplusRadioBox *)owner():0); } inline AplusRadioBox *AplusRadioButton::radioBox(void) { return (parentWidgetType()==AplusRadioBox::symbol()?(AplusRadioBox *)owner():0); } #endif //AplusRadioBoxHEADER aplus-fsf-4.22/src/AplusGUI/AplusReference.H0000644000265000001440000000200310772770352014257 #ifndef AplusReferenceHEADER #define AplusReferenceHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include class AplusReference : public MSWidgetCommon { public: AplusReference(MSWidget *); ~AplusReference(void); virtual void addSenderNotify(MSEventSender *); virtual void receiveEvent(MSEvent &); virtual MSBoolean verifyData(V,A) { return MSTrue; } virtual void update(V,int,int,int) {} virtual void update(const MSIndexVector& v_) { MSView::update(v_); } virtual void update(V,A,A,I) {} virtual const MSSymbol& widgetType(void) const; static const MSSymbol& symbol(void); STANDARD_WIDGET_METHODS_H }; #endif // AplusReferenceHEADER aplus-fsf-4.22/src/AplusGUI/AplusReportAlgo.H0000644000265000001440000000571510772770352014454 #ifndef __AplusReportAlgo_H #define __AplusReportAlgo_H /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include "AplusCommon.H" class AplusReportAlgorithm { public: enum {Sum=1, Min=2, Max=4, Avg=8, StdDev=16, Variance=32} compMode; virtual double computeValue(A, int begin_=-1, int end_=-1) = 0; protected: AplusReportAlgorithm(void); ~AplusReportAlgorithm(void); virtual MSFloatVector convert(A, int, int); }; class AplusReportSumAlgorithm : public AplusReportAlgorithm { public: static AplusReportSumAlgorithm *reportSum(void); protected: AplusReportSumAlgorithm(void); ~AplusReportSumAlgorithm(void); virtual double computeValue(A, int begin_=-1, int end_=-1); private: static AplusReportSumAlgorithm *_reportSum; }; class AplusReportMaxAlgorithm : public AplusReportAlgorithm { public: static AplusReportMaxAlgorithm *reportMax(void); protected: AplusReportMaxAlgorithm(void); ~AplusReportMaxAlgorithm(void); virtual double computeValue(A, int begin_=-1, int end_=-1); private: static AplusReportMaxAlgorithm *_reportMax; }; class AplusReportMinAlgorithm : public AplusReportAlgorithm { public: static AplusReportMinAlgorithm *reportMin(void); protected: AplusReportMinAlgorithm(void); ~AplusReportMinAlgorithm(void); virtual double computeValue(A, int begin_=-1, int end_=-1); private: static AplusReportMinAlgorithm *_reportMin; }; class AplusReportAvgAlgorithm : public AplusReportAlgorithm { public: static AplusReportAvgAlgorithm *reportAvg(void); protected: AplusReportAvgAlgorithm(void); ~AplusReportAvgAlgorithm(void); virtual double computeValue(A, int begin_=-1, int end_=-1); private: static AplusReportAvgAlgorithm *_reportAvg; }; class AplusReportStdDevAlgorithm : public AplusReportAlgorithm { public: static AplusReportStdDevAlgorithm *reportStdDev(void); protected: AplusReportStdDevAlgorithm(void); ~AplusReportStdDevAlgorithm(void); virtual double computeValue(A, int begin_=-1, int end_=-1); private: static AplusReportStdDevAlgorithm *_reportStdDev; }; class AplusReportVarianceAlgorithm : public AplusReportAlgorithm { public: static AplusReportVarianceAlgorithm *reportVariance(void); protected: AplusReportVarianceAlgorithm(void); ~AplusReportVarianceAlgorithm(void); virtual double computeValue(A, int begin_=-1, int end_=-1); private: static AplusReportVarianceAlgorithm *_reportVariance; }; class AplusReportMedianAlgorithm : public AplusReportAlgorithm { public: static AplusReportMedianAlgorithm *reportMedian(void); protected: AplusReportMedianAlgorithm(void); ~AplusReportMedianAlgorithm(void); virtual double computeValue(A, int begin_=-1, int end_=-1); private: static AplusReportMedianAlgorithm *_reportMedian; }; #endif aplus-fsf-4.22/src/AplusGUI/AplusReportEnum.H0000644000265000001440000001115110772770352014465 #ifndef AplusReportEnumHEADER #define AplusReportEnumHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include class AplusReportCompModeConverter : public AplusHashSingleEnumConverter { protected: virtual const AplusHashTable& enumTable(void) const; virtual const AplusHashTable& stringTable(void) const; virtual const char *type(void) const; public: inline AplusReportCompModeConverter(void); inline ~AplusReportCompModeConverter(void); }; inline AplusReportCompModeConverter::AplusReportCompModeConverter(void) : AplusHashSingleEnumConverter() {} inline AplusReportCompModeConverter::~AplusReportCompModeConverter(void) {} class AplusReportOccurrenceConverter : public AplusHashEnumConverter { protected: virtual const AplusHashTable& enumTable(void) const; virtual const AplusHashTable& stringTable(void) const; virtual const char *type(void) const; public: inline AplusReportOccurrenceConverter(void); inline ~AplusReportOccurrenceConverter(void); }; inline AplusReportOccurrenceConverter::AplusReportOccurrenceConverter(void) : AplusHashEnumConverter() {} inline AplusReportOccurrenceConverter::~AplusReportOccurrenceConverter(void) {} class AplusReportStyleConverter : public AplusHashEnumConverter { protected: virtual const AplusHashTable& enumTable(void) const; virtual const AplusHashTable& stringTable(void) const; virtual const char *type(void) const; public: inline AplusReportStyleConverter(void); inline ~AplusReportStyleConverter(void); }; inline AplusReportStyleConverter::AplusReportStyleConverter(void) : AplusHashEnumConverter() {} inline AplusReportStyleConverter::~AplusReportStyleConverter(void) {} class AplusReportPageOrientationConverter : public AplusHashSingleEnumConverter { protected: virtual const AplusHashTable& enumTable(void) const; virtual const AplusHashTable& stringTable(void) const; virtual const char *type(void) const; public: inline AplusReportPageOrientationConverter(void); inline ~AplusReportPageOrientationConverter(void); }; inline AplusReportPageOrientationConverter::AplusReportPageOrientationConverter(void) : AplusHashSingleEnumConverter() {} inline AplusReportPageOrientationConverter::~AplusReportPageOrientationConverter(void) {} class AplusReportPageSizeConverter : public AplusHashSingleEnumConverter { protected: virtual const AplusHashTable& enumTable(void) const; virtual const AplusHashTable& stringTable(void) const; virtual const char *type(void) const; public: inline AplusReportPageSizeConverter(void); inline ~AplusReportPageSizeConverter(void); }; inline AplusReportPageSizeConverter::AplusReportPageSizeConverter(void) : AplusHashSingleEnumConverter() {} inline AplusReportPageSizeConverter::~AplusReportPageSizeConverter(void) {} class AplusReportOutputModeConverter : public AplusHashSingleEnumConverter { protected: virtual const AplusHashTable& enumTable(void) const; virtual const AplusHashTable& stringTable(void) const; virtual const char *type(void) const; public: inline AplusReportOutputModeConverter(void); inline ~AplusReportOutputModeConverter(void); }; inline AplusReportOutputModeConverter::AplusReportOutputModeConverter(void) : AplusHashSingleEnumConverter() {} inline AplusReportOutputModeConverter::~AplusReportOutputModeConverter(void) {} class AplusReportDisclaimerStyleConverter : public AplusHashSingleEnumConverter { protected: virtual const AplusHashTable& enumTable(void) const; virtual const AplusHashTable& stringTable(void) const; virtual const char *type(void) const; public: inline AplusReportDisclaimerStyleConverter(void); inline ~AplusReportDisclaimerStyleConverter(void); }; inline AplusReportDisclaimerStyleConverter::AplusReportDisclaimerStyleConverter(void) : AplusHashSingleEnumConverter() {} inline AplusReportDisclaimerStyleConverter::~AplusReportDisclaimerStyleConverter(void) {} class AplusReportPrintModeConverter : public AplusHashSingleEnumConverter { protected: virtual const AplusHashTable& enumTable(void) const; virtual const AplusHashTable& stringTable(void) const; virtual const char *type(void) const; public: inline AplusReportPrintModeConverter(void); inline ~AplusReportPrintModeConverter(void); }; inline AplusReportPrintModeConverter::AplusReportPrintModeConverter(void) : AplusHashSingleEnumConverter() {} inline AplusReportPrintModeConverter::~AplusReportPrintModeConverter(void) {} #endif //AplusReportEnumHEADER aplus-fsf-4.22/src/AplusGUI/AplusRulePrintItem.H0000644000265000001440000000265310772770353015140 #ifndef AplusRulePrintItemHEADER #define AplusRulePrintItemHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include class AplusRulePrintItem : public MSWidgetView, public MSRulePrintItem { public: AplusRulePrintItem(MSWidget *); AplusRulePrintItem(const AplusRulePrintItem&); ~AplusRulePrintItem(void); virtual void addSenderNotify(MSEventSender *); virtual void receiveEvent(MSEvent &); static MSBoolean verifyData(V,::A); virtual const MSSymbol& widgetType(void) const; static const MSSymbol& symbol(void); inline int topPixel(void) const; inline void topPixel(int); inline int bottomPixel(void) const; inline void bottomPixel(int); STANDARD_WIDGET_METHODS_H }; inline int AplusRulePrintItem::topPixel(void) const { return MSPrintItem::topPixel(); } inline void AplusRulePrintItem::topPixel(int i_) { MSPrintItem::topPixel(i_); } inline int AplusRulePrintItem::bottomPixel(void) const { return MSPrintItem::bottomPixel(); } inline void AplusRulePrintItem::bottomPixel(int i_) { MSPrintItem::bottomPixel(i_); } #endif //AplusRulePrintItemHEADER aplus-fsf-4.22/src/AplusGUI/AplusScale.H0000644000265000001440000000363710772770353013427 #ifndef AplusScaleHEADER #define AplusScaleHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #include #define SliderType(AplusSliderType, Type) \ class AplusSliderType : public Type\ {\ public:\ AplusSliderType(MSWidget *);\ ~AplusSliderType(void);\ \ virtual double currentValue(void);\ virtual double currentValue(void) const;\ virtual MSBoolean assignValue(double);\ \ virtual void receiveEvent(MSEvent &);\ virtual void addSenderNotify(MSEventSender *m_);\ virtual MSBoolean validate(const char *str_);\ A defaultInFunc(V, const char *);\ \ virtual AplusModel *model(void) { return (AplusModel*) _model; }\ virtual MSBoolean verifyData(V,A) { return MSTrue; }\ AplusSliderType& operator=(const MSFloat& value_) { value(value_); return *this; }\ AplusSliderType& operator=(double value_) { value(value_); return *this; }\ static AplusFormatter *outFmt(void) { return &_outFormat; }\ \ virtual const MSSymbol& widgetType(void) const;\ static const MSSymbol& symbol(void);\ \ protected:\ virtual void editValue(const char *);\ virtual void editorEscape(void);\ \ private:\ static AplusFormatter _outFormat;\ STANDARD_WIDGET_METHODS_H\ \ }; SliderType(AplusVScale, MSVScale) SliderType(AplusHScale, MSHScale) SliderType(AplusVGauge, MSVGauge) SliderType(AplusHGauge, MSHGauge) #endif //AplusScaleHEADER aplus-fsf-4.22/src/AplusGUI/AplusScrolledWindow.H0000644000265000001440000000162310772770353015330 #ifndef AplusScrolledWindowHEADER #define AplusScrolledWindowHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include class AplusScrolledWindow : public MSScrolledWindow { public: AplusScrolledWindow(MSWidget *); ~AplusScrolledWindow(void); virtual void receiveEvent(MSEvent &); virtual MSBoolean verifyData(V,A) { return MSTrue; } virtual void addSenderNotify(MSEventSender *); virtual const MSSymbol& widgetType(void) const; static const MSSymbol& symbol(void); STANDARD_WIDGET_METHODS_H }; #endif // AplusScrolledWindowHEADER aplus-fsf-4.22/src/AplusGUI/AplusShell.H0000644000265000001440000000266010772770353013442 #ifndef AplusShellHEADER #define AplusShellHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include class AplusShell : public MSShell { public: AplusShell(void); AplusShell(MSDisplayServer *); ~AplusShell(void); MSWidgetView *getNextFocusAfter(MSWidgetView *); void insertFocusAfter(MSWidgetView *, MSWidgetView *); virtual void receiveEvent(MSEvent &); virtual MSBoolean verifyData(V,A) { return MSTrue; } virtual void addSenderNotify(MSEventSender *); virtual MSBoolean traverseFocus(MSWidget *); virtual void decoupleWidget(void); void setWMSaveYourself(void) { MSTopLevel::setWMSaveYourself(); } virtual void showAndWaitForMap(void); static MSBoolean allowNestedTraversal(void) { return _allowNestedTraversal; } static void allowNestedTraversal(MSBoolean b_) { _allowNestedTraversal = b_;} void virtualScreen(A screen_); A virtualScreen(void); virtual const MSSymbol& widgetType(void) const; static const MSSymbol& symbol(void); protected: virtual void save(void); private: static MSBoolean _allowNestedTraversal; }; #endif //AplusShellHEADER aplus-fsf-4.22/src/AplusGUI/AplusSlot.H0000644000265000001440000001236210772770353013314 #ifndef AplusSlotHEADER #define AplusSlotHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include class AplusSlot; class AplusSlotEntryField : public MSStringEntryField { friend class AplusSlot; public: AplusSlotEntryField(MSWidget *); ~AplusSlotEntryField(void); AplusSlot *slot(void) { return (AplusSlot *)_owner; } const AplusSlot *slot(void) const { return (AplusSlot *)_owner; } protected: virtual void updateForeground(unsigned long); virtual void keyPress(const XEvent *, KeySym, unsigned int, const char *); virtual MSBoolean isProtected(void) const; void label(const char *pString_); virtual void up(void); virtual void down(void); virtual void left(void); virtual void right(void); virtual void focusIn(void); virtual void increment(void); virtual void decrement(void); virtual MSBoolean validate(const char *); }; ////////////////////////////////////////////////////////////////////////////// class AplusSlot : public MSCompositeFieldBox { friend class AplusSlotEntryField; protected: A _cycleColors; unsigned long _cycleInterval; ACycleFunction _cycleFunc; MSCycleColorMode _cycleColorMode; MSUnsignedLongVector _fields; A _geometry; MSBoolean _childInFocus; MSBoolean childInFocus(void) { return _childInFocus;} void childInFocus(MSBoolean childInFocus_) { _childInFocus = childInFocus_;} MSUnsignedLongVector &fields(void) { return _fields; } const MSUnsignedLongVector &fields(void) const { return _fields; } A geometry(void) { return _geometry; } void geometry(A a_) {if (_geometry!=0) dc(_geometry); _geometry=(A)ic(a_);} void removeAllCycles(void); void startCycle(int row_,A colors_); void createCycle(int row_); MSBoolean setGeometry(void); MSBoolean compareGeometry(A); MSBoolean setPositions(void); void rowSpan(int,A,int *,int *); void colSpan(int,A,int *,int *); virtual void firstMapNotify(void); unsigned long color(unsigned); virtual void tab(void); virtual void shiftTab(void); virtual void takeFocus(void); virtual MSBoolean freezeIfUnfrozen(void); virtual void unfreezeIfUnfrozen(MSBoolean bool_); void setClipMode(void); public: AplusSlot(MSWidget *owner_); ~AplusSlot(void); virtual const MSSymbol& widgetType(void) const; static const MSSymbol& symbol(void); void cycleColors(A colors_); A cycleColors(void); unsigned long cycleInterval(void) { return _cycleInterval; } void cycleInterval(unsigned long interval_); // cycleColorMode() method does not yet exist for MSEntryField, but will. // unsigned long cycleColorMode(void) { return _cycleColorMode; } // void cycleColorMode(unsigned long interval_); ACycleFunction *cycleFunc(void) { return &_cycleFunc; } void cycleFunc(AFunc func_,AClientData *arg_) { cycleFunc()->func(func_); cycleFunc()->arg(arg_); } int valueLength(void); int editLength(void); virtual Font valueFont(int); virtual A itemValue(int row_); virtual A itemLabel(int row_); virtual A cycleColor(int row_); unsigned long titleColor(int row_); Font titleFont(int row_); MSBoolean readOnly(int row_) const; virtual void updateFunctionalAttributes(int row_); virtual void update(V v_,A index_,A pick_,I ravel_); virtual void update(V,int,int,UpdateType) {} virtual void update(const MSIndexVector &v_) { MSCompositeFieldBox::update(v_); } virtual void updateValue(int row_); virtual void updateValues(void); virtual void updateTitle(void); virtual void updateFont(Font); virtual void updateForeground(unsigned long); virtual void updateBackground(unsigned long); virtual void updateSensitivity(void); virtual void updateData(void); virtual A defaultInFunc(const char *string_,int row_); void highlightThickness(int); void shadowThickness(int); void highlightColor(unsigned long); int highlightThickness(void); int shadowThickness(void); unsigned long highlightColor(void); virtual void editorBackground(unsigned long pixel_); virtual void editorForeground(unsigned long pixel_); virtual unsigned long editorBackground(void); virtual unsigned long editorForeground(void); virtual void naturalSize(void); MSBoolean validate(AplusSlotEntryField *, const char *); virtual MSBoolean verifyData(V,A); virtual void receiveEvent(MSEvent &); virtual void addSenderNotify(MSEventSender *); int numRows(void); MSBoolean editing(void); void startEditing(void); void stopEditing(void); int selectedItem(void) { return _selectedItem; } void selectedItem(int selectedItem_) { _selectedItem = selectedItem_; } A arrowButtons(void) { return _arrowButtons; } void arrowButtons(A); virtual void redraw(void); protected: A _arrowButtons; int _selectedItem; STANDARD_WIDGET_METHODS_H }; #endif //AplusSlotHEADER aplus-fsf-4.22/src/AplusGUI/AplusTable.H0000644000265000001440000000336410772770353013424 #ifndef AplusTableHEADER #define AplusTableHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include class AplusTableColumn; class AplusTable : public MSTable { friend class AplusTableColumn; public: AplusTable(MSWidget *); ~AplusTable(void); virtual const MSSymbol& widgetType(void) const; static const MSSymbol& symbol(void); void grandTotalTextA(::A grandTotalTextA_) {_grandTotalTextA=grandTotalTextA_;} ::A grandTotalTextA(void) {return _grandTotalTextA;} protected: MSBoolean verifyColumn(::A); virtual MSBoolean verifyData(V,::A); Font getVFont(V); void variables(V *,int); virtual void addSenderNotify(MSEventSender *); virtual void receiveEvent(MSEvent &); virtual void updateData(void); virtual void update(V,int,int,UpdateType); virtual void update(V,::A,::A,I); virtual void update(const MSIndexVector &v_) {MSTable::update(v_);} virtual void updateTitle(void); virtual void updateBackground(unsigned long); virtual void updateForeground(unsigned long); virtual void updateFont(Font); virtual unsigned long cellForeground(unsigned, unsigned); virtual unsigned long cellBackground(unsigned, unsigned); virtual void createCycle(int, int); virtual void shuffleColumns(MSIndexVector &); MSUnsignedLongVector getCycleColors(int, int) const; void referenceCB(void); ::A _grandTotalTextA; STANDARD_WIDGET_METHODS_H }; #endif //AplusTableHEADER aplus-fsf-4.22/src/AplusGUI/AplusTableColumn.H0000644000265000001440000002044010772770353014574 #ifndef AplusTableColumnHEADER #define AplusTableColumnHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include class ABreakFunction : public AOutFunction { public: ABreakFunction(void) { _func=0; _arg=0; } ABreakFunction(AFunc func_, AClientData *arg_=0) : AOutFunction(func_, arg_) {} ~ABreakFunction(void) {} virtual A callFunc(V v_, A a_, int row_, int col_,A p_=aplus_nl); }; class AFormatBreakFunction : public ABreakFunction { public: AFormatBreakFunction(void) {} ~AFormatBreakFunction(void) {} }; class AplusTable; class AplusTableColumn : public MSTableColumn { friend class AplusTable; public: AplusTableColumn(AplusTable *); ~AplusTableColumn(void); virtual const MSSymbol& widgetType(void) const; static const MSSymbol& symbol(void); AplusTable *table(void) const { return (AplusTable *)MSTableColumn::table(); } AOutFunction *breakOffsetFunc(void) { return &_breakOffsetFunc; } AOutFunction *breakFontFunc(void) { return &_breakFontFunc; } AOutFunction *breakStyleFunc(void) { return &_breakStyleFunc; } AOutFunction *breakLeadingFunc(void) { return &_breakLeadingFunc; } AOutFunction *fgGrayScaleFunc(void) { return &_fgGrayScaleFunc; } AOutFunction *bgGrayScaleFunc(void) { return &_bgGrayScaleFunc; } AOutFunction *breakFgGrayScaleFunc(void) { return &_breakFgGrayScaleFunc; } AOutFunction *breakBgGrayScaleFunc(void) { return &_breakBgGrayScaleFunc; } AOutFunction *reportFontFunc(void) { return &_reportFontFunc; } AOutFunction *styleFunc(void) { return &_styleFunc; } AOutFunction *breakCriteriaFunc(void) { return &_breakCriteriaFunc; } ABreakFunction *breakProcessFunc(void) { return &_breakProcessFunc; } AFormatBreakFunction *formatBreakFunc(void) { return &_formatBreakFunc; } void breakOffsetFunc(AFunc func_, AClientData *arg_) { breakOffsetFunc()->set(func_,arg_); } void breakFontFunc(AFunc func_, AClientData *arg_) { breakFontFunc()->set(func_,arg_); } void breakStyleFunc(AFunc func_, AClientData *arg_) { breakStyleFunc()->set(func_,arg_); } void breakLeadingFunc(AFunc func_, AClientData *arg_) { breakLeadingFunc()->set(func_,arg_); } void fgGrayScaleFunc(AFunc func_, AClientData *arg_) { fgGrayScaleFunc()->set(func_,arg_); } void bgGrayScaleFunc(AFunc func_, AClientData *arg_) { bgGrayScaleFunc()->set(func_,arg_); } void breakFgGrayScaleFunc(AFunc func_, AClientData *arg_) { breakFgGrayScaleFunc()->set(func_,arg_); } void breakBgGrayScaleFunc(AFunc func_, AClientData *arg_) { breakBgGrayScaleFunc()->set(func_,arg_); } void reportFontFunc(AFunc func_, AClientData *arg_) { reportFontFunc()->set(func_,arg_); } void styleFunc(AFunc func_, AClientData *arg_) { styleFunc()->set(func_,arg_); } void breakCriteriaFunc(AFunc func_, AClientData *arg_) { breakCriteriaFunc()->set(func_,arg_); } void formatBreakFunc(AFunc func_, AClientData *arg_) { formatBreakFunc()->set(func_,arg_); } void breakProcessFunc(AFunc func_, AClientData *arg_) { breakProcessFunc()->set(func_,arg_); breakString().removeAll(); } void style(unsigned long style_) { MSTableColumn::style(style_); } void reportFont(const char *font_) { MSTableColumn::reportFont(font_); } void fgGrayScale(double fg_) { MSTableColumn::fgGrayScale(fg_); } void bgGrayScale(double bg_) { MSTableColumn::bgGrayScale(bg_); } void breakFgGrayScale(double fg_) { MSTableColumn::breakFgGrayScale(fg_); } void breakBgGrayScale(double bg_) { MSTableColumn::breakBgGrayScale(bg_); } void breakStyle(unsigned long style_) { MSTableColumn::breakStyle(style_); } void breakFont(const char *font_) { MSTableColumn::breakFont(font_); } void breakOffset(int offset_) { MSTableColumn::breakOffset((long)offset_); } void breakLeading(int leading_) { MSTableColumn::breakLeading((long)leading_); } unsigned long style(void) { return MSTableColumn::style(); } const char *reportFont(void) { return MSTableColumn::reportFont(); } double fgGrayScale(void) { return MSTableColumn::fgGrayScale(); } double bgGrayScale(void) { return MSTableColumn::bgGrayScale(); } double breakFgGrayScale(void) { return MSTableColumn::breakFgGrayScale(); } double breakBgGrayScale(void) { return MSTableColumn::breakBgGrayScale(); } unsigned long breakStyle(void) { return MSTableColumn::breakStyle(); } const char *breakFont(void) { return MSTableColumn::breakFont(); } int breakOffset(void) { return MSTableColumn::breakOffset(); } int breakLeading(void) { return MSTableColumn::breakLeading(); } A breakText(void) {return _breakText;} void breakText(A breakText_) {_breakText = breakText_;} unsigned compMode(void) {return _compMode;} void compMode(unsigned); protected: virtual MSBoolean verifyData(V,A); AVariableData *getVarData(void); void setBg(unsigned long); void setFont(Font); virtual A defaultInFunc(V v_,const char *string); virtual void addSenderNotify(MSEventSender *m_); virtual void receiveEvent(MSEvent &); virtual const char *formatOutput(MSString&, unsigned); virtual MSBoolean validate(const char *,unsigned); virtual MSBoolean validate(V v_, const char *string_, unsigned row_); void forceEval(void) const; virtual unsigned numRows(void) const; virtual unsigned numColumns(void) const; virtual void update(V,A,A,I); virtual void update(V,int,int,UpdateType); virtual void update(const MSIndexVector &v_); virtual void updateForeground(unsigned long); virtual unsigned long cellForeground(unsigned); virtual unsigned long cellBackground(unsigned); virtual Font cellFont(unsigned); virtual MSBoolean isCellProtected(unsigned); Font titleFont(void); MSUnsignedLongVector getCycleColors(int) const; virtual void updateFont(Font); // Report Methods virtual MSBoolean breakCriteria(unsigned); virtual MSBoolean isDuplicate(unsigned); virtual unsigned long style(unsigned); virtual const char *reportFont(unsigned); virtual double fgGrayScale(unsigned); virtual double bgGrayScale(unsigned); virtual double breakFgGrayScale(unsigned); virtual double breakBgGrayScale(unsigned); virtual void breakProcess(MSIndexVector &); virtual const char *formatBreak(MSString &, unsigned, unsigned); virtual unsigned long breakStyle(unsigned); virtual int breakOffset(unsigned); virtual int breakLeading(unsigned); virtual const char *breakFont(unsigned); virtual double computeIndexedSum(MSIndexVector &); virtual double computeColumnTotal(void); MSBoolean isNumericColumn(void); void invokeFunction(AOutFunction *, unsigned); void invokeFunction(AOutFunction *, unsigned, unsigned); void invokeFunction(AOutFunction *, unsigned, unsigned, I *); void invokeFunction(AFormatBreakFunction *, unsigned, unsigned, A); void columnResizeCB(void); void setClipMode(void); private: AOutFunction _breakOffsetFunc; ACharStrFunction _breakFontFunc; AOutFunction _breakStyleFunc; AOutFunction _breakLeadingFunc; AOutFunction _fgGrayScaleFunc; AOutFunction _bgGrayScaleFunc; AOutFunction _breakFgGrayScaleFunc; AOutFunction _breakBgGrayScaleFunc; ACharStrFunction _reportFontFunc; AOutFunction _styleFunc; ABreakFunction _breakProcessFunc; AFormatBreakFunction _formatBreakFunc; AOutFunction _breakCriteriaFunc; A _outStr; MSString _breakProcessStringBuffer; MSString _reportFontStringBuffer; MSString _breakFontStringBuffer; A _breakText; unsigned _compMode; AplusReportAlgorithm *_algorithm; STANDARD_WIDGET_METHODS_H }; inline AVariableData *AplusTableColumn::getVarData(void) { return (model()&&((AplusModel*)model())->aplusVar()!=0) ? (AVariableData *)(((AplusModel*)model())->pAVarData()) : 0; } #endif // AplusTableColumnHEADER aplus-fsf-4.22/src/AplusGUI/AplusText.H0000644000265000001440000000213510772770353013314 #ifndef AplusTextHEADER #define AplusTextHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include class AplusText : public MSText { public: AplusText(MSWidget *); ~AplusText(void); AplusModel *model(void) { return (AplusModel*)_model; } virtual MSBoolean verifyData(V,A); virtual void updateData(void); protected: virtual void receiveEvent(MSEvent &); virtual void addSenderNotify(MSEventSender *); virtual void doClearSelection(void); virtual void keyPress(const XEvent *, KeySym, unsigned int, const char *); virtual MSBoolean isProtected(void) const; virtual const MSSymbol& widgetType(void) const; static const MSSymbol& symbol(void); STANDARD_WIDGET_METHODS_H }; #endif //AplusTextHEADER aplus-fsf-4.22/src/AplusGUI/AplusTrace.H0000644000265000001440000003211510772770353013427 #ifndef AplusTraceHEADER #define AplusTraceHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include class AObject { protected: A _a; public: AObject(A a_ = 0) { _a = 0; if (a_ != 0 && !QS(a_)) _a = (A)ic(a_); } ~AObject( void ) { if (_a != 0) dc(_a); } void a( A a_ ) { if (_a != 0 ) dc(_a); _a = 0; if (a_ != 0 && !QS(a_)) _a = (A)ic(a_); } int rank( void ) { return (_a!=0) ? (int)_a->r : 0; } int type( void ) { return (_a!=0) ? (int)_a->t : 0; } int n( void ) { return (_a!=0) ? (int)_a->n : 0; } I *data( void ) { return (_a!=0) ? (I *)_a->p : 0; } int width( void ) { return (isMatrix()) ? numCols() : 1; } int offset( int row_, int col_ = 0 ) { return row_*width() + col_; } MSBoolean isNl( void ) { return (_a==aplus_nl) ? MSTrue : MSFalse; } MSBoolean isNull( void ) { return (isEnclosed()&&n()==0) ? MSTrue : MSFalse; } MSBoolean isEnclosed( void ) { return (type()==Et) ? MSTrue : MSFalse; } MSBoolean isVector( void ) { return (rank()==1) ? MSTrue : MSFalse; } MSBoolean isMatrix( void ) { return (rank()==2) ? MSTrue : MSFalse; } MSBoolean isScalar( void ) { return ((rank()==0&&type()d[0]; } int numCols( void ) { if ( isNull() == MSTrue || _a == 0 ) return 0; else if (type() == Ct || rank()== 0) return 1; else if (isEnclosed()) return 1; else return (rank()==1)?rank():(int)_a->d[1]; } }; class ATraceFunction:public AFunction { public: ATraceFunction(void) {_func=0; _arg=0;} ATraceFunction(AFunc func_,AClientData *arg_=0):AFunction(func_,arg_) {} ~ATraceFunction(void) {} A callFunc(V v_,A value_,int row_,int col_,A pick_=aplus_nl) {A r=aplus_nl; A index=0; if (row_==-1&&col_==-1) index=0; else index=grc((A)v_->a,row_,col_); // generate r,c index if (_func!=0) r=(A)(*_func)(arg(),value_,index,pick_,v_); if (index!=0) dc((A)index); if (value_!=0) dc((A)value_); return r;} A invoke(V v_,A value_,int row_,int col_,A pick_=aplus_nl) {A val=0; if (value_!=0&&QS(value_)) {val=(A)gs(Et); *val->p=(I)value_;} else if (value_!=0) {val=(A)ic(value_);} return callFunc(v_,val,row_,col_,pick_);} long enumInvoke(V v_,A value_,int row_,int col_,A pick_=aplus_nl) { long r=0; A ar=invoke(v_,value_,row_,col_,pick_); AObject ao(ar); if (ao.type()==It &&ao.isScalar()) { P p; p.i=ao.data(); r=p.i[0];} dc((A)r); return r;} long intInvoke(V v_,A value_,int row_,int col_,A pick_=aplus_nl) { long r=1; A ar=invoke(v_,value_,row_,col_,pick_); if (isNull(ar)==MSTrue) { return -1; } if (!QS(ar)) { P p; p.i=ar->p; if (ar->t==Ft) r=(int)p.f[0]; else r=(long)p.i[0]; } if (!QS(ar)&&ar!=0) dc((A)ar); return r; } }; class AplusGraph; class AplusTrace; class AplusTraceSet : public MSTraceSet { friend class AplusGraph; static MSHashTable _enumHashTable; static MSHashTable _constraintEnumHashTable; static MSHashTable _styleEnumHashTable; static MSHashTable _symbolEnumHashTable; public: static MSBoolean _initialized; // for enumTables /* typedef enum {Xsym=20,Cross=21,Star=22,Square=23,SquareCross=24,SquareCircle=25,Circle=26, CircleCross=27,CircleDiamond=28,CircleTriangle=29,Diamond=30,DiamondCross=31, Triangle=32,Char=33,SquareFilled=34,CircleFilled=35,DiamondFilled=36, TriangleFilled=37} TraceSymbol; Xsym = MSG::X = 2 Cross = MSG::Cross = 1 Star = MSG::Cross | MSG::X = 3 Square = MSG::Square = 4 SquareCross = MSG::Square | MSG::Cross = 7 SquareCircle = MSG::Square | MSG::Circle = 12 Circle = MSG::Circle = 8 CircleCross = MSG::Cross | MSG::Circle = 11 CircleDiamond = MSG::Diamond | MSG::Circle = 24 CircleTriangle = MSG::Triangle | MSG::Circle = 40 Diamond = MSG::Diamond = 16 DiamondCross = MSG::Diamond | MSG::Cross = 17 Triangle = MSG::Triangle = 32 Char = MSG::Text = 512 SquareFilled = MSG::Square | MSG::Fill = 132 CircleFilled = MSG::Circle | MSG::Fill = 136 DiamondFilled = MSG::Diamond | MSG::Fill = 144 TriangleFilled = MSG::Triangle | MSG::Fill = 160 typedef enum {NoConstraint=1,HoldX=41,HoldY=42} Constraint; NoConstraint = MSNone = 0 HoldX = MSG::HoldX = 1 HoldY = MSG::HoldY = 2 typedef enum {Line=50,Outline=51,Scatter=52,LineScatter=53,Area=54,Bar=55,Close=56, MarketProfile=57,ColorProfile=58,HL=59,HLOC=60,HLC=61,Candle=62,Stack=63, Step=64,StepScatter=65,Osc=66,Fill=67,Segment=68,Text=69,Null=1} TraceStyle; Line = MSG::Line = 1 Outline = MSG::Outline = 2 Scatter = MSG::Scatter = 64 LineScatter = MSG::Line | MSG::Scatter = 65 Area = MSG::Area = 4 Bar = MSG::Bar = 8 Close = MSG::Close = 2048 MarketProfile = MSG::MarketProfile = 65536 ColorProfile = MSG::ColorProfile = 131072 HL = MSG::HL = 8192 HLOC = MSG::HLOC = 16384 HLC = MSG::HLC = 32768 Candle = MSG::Candle = 4096 Stack = MSG::Stack = 16 Step = MSG::Step = 32 StepScatter = MSG::Step | MSG::Scatter = 96 Osc = MSG::Osc = 1024 Fill = MSG::Fill = 128 Segment = MSG::Segment = 256 Text = MSG::Text = 512 Null = MSNone = 0 typedef enum {_TraceStyle=202,_LineStyle=203,_Symbol=204,_Constraint=205} TraceEnum; _TraceStyle =202 _LineStyle =203 _Symbol =204 _Constraint =205 */ typedef enum {_TraceStyle=202,_LineStyle=203,_Symbol=204,_Constraint=205} TraceEnum; AColorFunction _lineColorFunc; AColorFunction _fillColorFunc; AOutFunction _legendFunc; ATraceFunction _traceSymbolFunc; ATraceFunction _traceSymbolSizeFunc; ATraceFunction _traceStyleFunc; ATraceFunction _lineStyleFunc; ATraceFunction _lineWidthFunc; ATraceFunction _pieOffsetFunc; ATraceFunction _gradientFunc; ATraceFunction _altXaxisFunc; ATraceFunction _altYaxisFunc; public: AplusTraceSet(MSGraph *); ~AplusTraceSet(void); AplusTrace *trace(int i_) const { return (AplusTrace *) MSTraceSet::trace(i_); } virtual const MSSymbol& widgetType(void) const; static const MSSymbol& symbol(void); void initEnumHashTable(void); void initStringEnumHashTable(void); AplusGraph *graph(void) { return (AplusGraph *) owner(); } MSHashTable *enumHashTable(void) { return &_enumHashTable; } MSHashTable *constraintEnumHashTable(void) { return &_constraintEnumHashTable; } MSHashTable *styleEnumHashTable(void) { return &_styleEnumHashTable; } MSHashTable *symbolEnumHashTable(void) { return &_symbolEnumHashTable; } A enumSymbols(const char *); // Functional attributes ATraceFunction *lineStyleFunc(void) { return &_lineStyleFunc;} ATraceFunction *lineWidthFunc(void) { return &_lineWidthFunc;} ATraceFunction *pieOffsetFunc(void) { return &_pieOffsetFunc;} ATraceFunction *gradientFunc(void) { return &_gradientFunc;} const AColorFunction *lineColorFunc(void) const { return &_lineColorFunc;} const AColorFunction *fillColorFunc(void) const { return &_fillColorFunc;} AOutFunction *legendFunc(void) { return &_legendFunc;} ATraceFunction *traceStyleFunc(void) { return &_traceStyleFunc;} ATraceFunction *traceSymbolFunc(void) { return &_traceSymbolFunc;} ATraceFunction *traceSymbolSizeFunc(void) { return &_traceSymbolSizeFunc;} ATraceFunction *altYaxisFunc(void) { return &_altYaxisFunc;} ATraceFunction *altXaxisFunc(void) { return &_altXaxisFunc;} void lineStyleFunc(AFunc,A); void lineWidthFunc(AFunc,A); void pieOffsetFunc(AFunc,A); void gradientFunc(AFunc,A); void lineColorFunc(AFunc,A); void fillColorFunc(AFunc,A); void legendFunc(AFunc,A); void traceStyleFunc(AFunc,A); void traceSymbolFunc(AFunc,A); void traceSymbolSizeFunc(AFunc,A); void altYaxisFunc(AFunc,A); void altXaxisFunc(AFunc func_,A fc_); void lineStyleFuncInvoke(void); void lineWidthFuncInvoke(void); void pieOffsetFuncInvoke(void); void gradientFuncInvoke(void); void lineColorFuncInvoke(void); void fillColorFuncInvoke(void); void legendFuncInvoke(void); void traceStyleFuncInvoke(void); void traceSymbolFuncInvoke(void); void traceSymbolSizeFuncInvoke(void); void altYaxisFuncInvoke(void); void altXaxisFuncInvoke(void); A coordinate(void); void constraint(A); A constraintSym(void); virtual void constraint(unsigned long x_) { MSTraceSet::constraint(x_); } virtual unsigned long constraint(void) const { return MSTraceSet::constraint(); } void selected(A); A selected(void); void selected(int r_, int c_) { MSTraceSet::selected(r_,c_); } virtual void selectable(MSBoolean); virtual MSBoolean selectable(void) const { return MSTraceSet::selectable(); } void textBuffer(const MSStringVector t_); MSStringVector &textBuffer(void) { return _textBuffer; } void gradient(const MSUnsignedVector); // TraceSet methods virtual int numColumns(void) const; virtual int numRows(void) const; virtual int dataCount(void) const; virtual double x(int) const; virtual double y(int,int) const; virtual void validate(int,int,double,double); // Standard Widget Methods virtual void receiveEvent(MSEvent &); virtual void addSenderNotify(MSEventSender *); virtual void symbol(const MSUnsignedLongVector& s_) { MSTraceSet::symbol(s_); } virtual void symbol(unsigned long s_) { MSTraceSet::symbol(s_); } virtual void symbol(unsigned long x_,unsigned s_) { MSTraceSet::symbol(x_,s_); } virtual void symbol(Symbol s_) { MSTraceSet::symbol(s_); } virtual unsigned long symbol(unsigned s_) const { return MSTraceSet::symbol(s_); } // 'A' interface routines virtual void update(V,int,int,UpdateType); virtual void update(V,A,A,I); virtual void update(const MSIndexVector &v_) { MSTraceSet::update(v_); } virtual void updateData(void); virtual MSBoolean verifyData(V,A); virtual void updateTitle(void); virtual unsigned long traceLineColor(int,int) const; virtual unsigned long traceFillColor(int,int) const; virtual const char *formatText(MSString&, unsigned); virtual unsigned textLength(void) const; virtual void validateText(const MSStringVector); protected: virtual const char *formatOutput(MSString&,unsigned,unsigned); virtual void invokeFunction(AOutFunction *, unsigned, unsigned); virtual MSBoolean moveTraceValidate(double,double); virtual MSFloatMatrix asFloatMatrix(void) const; virtual MSBoolean isProtected(void) const; ::A computeAdjustedData(double,double) const; private: unsigned long convertTraceStyle(A); MSBoolean convertXAxis(A, unsigned long &); MSBoolean convertYAxis(A, unsigned long &); void convertTraceSymbol(A, unsigned long &, MSString &); A _outStr; MSStringVector _textBuffer; STANDARD_WIDGET_METHODS_H }; // This class is created so AplusTraceSet and AplusGraph can access the // protected members of MSTrace. class AplusTrace : public MSTrace { friend class AplusTraceSet; friend class AplusGraph; public: AplusTrace(MSTraceSet *,int col_=0,const MSSymbol& tag_=MSSymbol::nullSymbol()); ~AplusTrace(void); V aplusVar(void); void gradient(MSBoolean g_) { _gradient = g_; } MSBoolean gradient(void) { return _gradient; } protected: int virtualCol(void) const { return MSTrace::virtualCol(); } unsigned long style(void) const { return MSTrace::style(); } unsigned long lineColor(void) const { return MSTrace::lineColor(); } unsigned long fillColor(void) const { return MSTrace::fillColor(); } void virtualCol(int x_) { MSTrace::virtualCol(x_); } void lineColor(unsigned long c_) { MSTrace::lineColor(c_); } void fillColor(unsigned long c_) { MSTrace::fillColor(c_); } private: MSBoolean _gradient; }; #endif //AplusTraceHEADER aplus-fsf-4.22/src/AplusGUI/AplusTreeView.H0000644000265000001440000000525410772770353014127 #ifndef AplusTreeViewHEADER #define AplusTreeViewHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include class AplusTreeItem { private: S _aSymbol; public: AplusTreeItem(void) : _aSymbol(0) {} AplusTreeItem(const AplusTreeItem& aTreeItem_) : _aSymbol(aTreeItem_._aSymbol) {} AplusTreeItem(S aSymbol_) : _aSymbol(aSymbol_) {} ~AplusTreeItem(void) {_aSymbol=0;} AplusTreeItem& operator=(const AplusTreeItem& aTreeItem_) {if (&aTreeItem_!=this) _aSymbol=aTreeItem_._aSymbol; return *this;} MSString name(void) const { if (_aSymbol!=0) return MSString((const char *)_aSymbol->n); return MSString(); } S symbol(void) const {return _aSymbol;} void symbol(S aSymbol_) {_aSymbol=aSymbol_;} MSError::ErrorStatus set(const char *); const char *format(MSString&) const; }; class AplusTreeView : public MSTreeView { public: AplusTreeView(MSWidget *); ~AplusTreeView(void); virtual void receiveEvent(MSEvent &); virtual void addSenderNotify(MSEventSender *); virtual const MSSymbol& widgetType(void) const; static const MSSymbol& symbol(void); virtual void update(V v_,int r_,int c_,UpdateType type_); virtual void update(V v_,A index_,A pick_,I ravel_); virtual void update(const MSIndexVector&); virtual void updateFont(Font); virtual void updateForeground(unsigned long); virtual void updateBackground(unsigned long); virtual MSBoolean verifyData(V,A); MSBoolean isTree(A); inline AplusModel *model(void) const; A selectedNodeA(void) const; void selectedNodeA(A); protected: MSStack _updateStack; TreeModel _modelTree; MSStack& updateStack(void) {return _updateStack;} void rebuildTree(TreeModelCursor&,A attr_,A val_); void buildTree(TreeModelCursor&,A attr_,A val_); void updateTree(TreeModelCursor&,A attr_,A val_,A pick_,int index_); virtual TreeModel& modelTree(void); virtual const TreeModel& modelTree(void) const; virtual MSBoolean validate(TreeModelCursor &,const char *); virtual void nodeAttribute(const TreeModelCursor&, NodeAttribute&); virtual MSBoolean isNodeProtected(const TreeNode *); static MSBoolean checkValues(A); void referenceCB(void); STANDARD_WIDGET_METHODS_H }; inline AplusModel *AplusTreeView::model(void) const { return (AplusModel *)_model; } #endif // AplusTreeViewHEADER aplus-fsf-4.22/src/AplusGUI/AplusUpdateQueue.H0000644000265000001440000000256110772770353014622 #ifndef AplusUpdateQueueHEADER #define AplusUpdateQueueHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include inline void addToUpdateQueue(V,A,A,A,I); inline void processUpdateQueue(void); // FIFO queue class AplusUpdate { private: V _aplusVar; A _data; A _index; A _pick; I _ravel; public: AplusUpdate(V v_,A data_,A index_,A pick_,I ravel_); ~AplusUpdate(void); void send(void); }; // forward declaration for MSUnsignedLongVector template class MSTypeVector; typedef MSTypeVector MSUnsignedLongVector; class AplusUpdateQueue { protected: MSUnsignedLongVector _queue; public: AplusUpdateQueue(void); ~AplusUpdateQueue(void); inline void push(AplusUpdate *update_); void process(void); }; extern AplusUpdateQueue updateQueue; inline void AplusUpdateQueue::push(AplusUpdate *pUpdate_) { _queue.append((unsigned long)pUpdate_); } inline void addToUpdateQueue(V v_,A data_,A index_,A pick_,I ravel_) { updateQueue.push(new AplusUpdate(v_,data_,index_,pick_,ravel_)); } inline void processUpdateQueue(void) { updateQueue.process(); } #endif //AplusUpdateQueueHEADER aplus-fsf-4.22/src/AplusGUI/AplusView.H0000644000265000001440000000267510772770353013313 #ifndef AplusViewHEADER #define AplusViewHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include class AplusView : public MSList { public: AplusView(MSWidget *); ~AplusView(void); virtual MSBoolean verifyData(V,A); virtual const MSSymbol& widgetType(void) const; static const MSSymbol& symbol(void); protected: virtual void addSenderNotify(MSEventSender *m_); virtual void receiveEvent(MSEvent &); virtual unsigned numRows(void) const; virtual unsigned numColumns(void) const; virtual unsigned maxLength(void) const; virtual unsigned rowLength(unsigned) const; virtual void drawSelectOutline(Window, int, MSBoolean,MSBoolean=MSFalse); virtual unsigned long rowForeground(unsigned); virtual unsigned long rowBackground(unsigned); virtual void update(V,int,int,UpdateType); virtual void update(V,A,A,I); virtual void update(const MSIndexVector &v_) { MSList::update(v_); } virtual const char *formatOutput(MSString&,unsigned); virtual unsigned long selectedRowForegroundColor(int); void referenceCB(void); STANDARD_WIDGET_METHODS_H }; #endif //AplusViewHEADER aplus-fsf-4.22/src/AplusGUI/EnumTables.H0000644000265000001440000000637610772770353013435 #ifndef __EnumTables_H #define __EnumTables_H /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include class EnumTables { public: EnumTables(void); ~EnumTables(void); static MSHashTable *stringEnumHashTable(void) { return _stringEnumHashTable; } static MSHashTable *printEnumHashTable(void) { return _printEnumHashTable; } static MSHashTable *pageSizeEnumHashTable(void) { return _pageSizeEnumHashTable; } static MSHashTable *pageSizeStringHashTable(void) { return _pageSizeStringHashTable; } static MSHashTable *alignEnumHashTable(void) { return _alignEnumHashTable; } static MSHashTable *alignStringHashTable(void) { return _alignStringHashTable; } static MSHashTable *styleEnumHashTable(void) { return _styleEnumHashTable; } static MSHashTable *styleStringHashTable(void) { return _styleStringHashTable; } static MSHashTable *reportStyleEnumHashTable(void) { return _reportStyleEnumHashTable; } static MSHashTable *reportStyleStringHashTable(void) { return _reportStyleStringHashTable; } static MSHashTable *reportCompModeEnumHashTable(void) { return _reportCompModeEnumHashTable; } static MSHashTable *reportCompModeStringHashTable(void) { return _reportCompModeStringHashTable; } static MSHashTable *cycleColorModeEnumHashTable(void) { return _cycleColorModeEnumHashTable; } static MSHashTable *cycleColorModeStringHashTable(void) { return _cycleColorModeStringHashTable; } A enumSymbols(const char *str_); // Format Conversion unsigned long alignFormat(A); A alignFormat(unsigned long); // Style Conversion unsigned long formatStyle(A); A formatStyle(unsigned long); // Computation Mode Conversion unsigned long formatCompMode(A); A formatCompMode(unsigned long); // Color Cycle Mode Conversion MSCycleColorMode cycleColorMode(A); A cycleColorMode(MSCycleColorMode); private: void initPrintEnumHashTable(void); void initStringEnumHashTable(void); void initAlignHashTables(void); void initStyleHashTables(void); void initPageSizeHashTables(void); void initReportStyleHashTables(void); void initReportCompModeHashTables(void); void initCycleColorModeHashTables(void); static MSHashTable *_stringEnumHashTable; static MSHashTable *_printEnumHashTable; static MSHashTable *_alignEnumHashTable; static MSHashTable *_alignStringHashTable; static MSHashTable *_pageSizeEnumHashTable; static MSHashTable *_pageSizeStringHashTable; static MSHashTable *_styleEnumHashTable; static MSHashTable *_styleStringHashTable; static MSHashTable *_reportStyleEnumHashTable; static MSHashTable *_reportStyleStringHashTable; static MSHashTable *_reportCompModeEnumHashTable; static MSHashTable *_reportCompModeStringHashTable; static MSHashTable *_cycleColorModeEnumHashTable; static MSHashTable *_cycleColorModeStringHashTable; }; extern EnumTables GUIEnum; #endif aplus-fsf-4.22/src/AplusGUI/Macros.H0000644000265000001440000000165610772770353012616 #ifndef MacrosHEADER #define MacrosHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #define INTERNAL_COUPLE(X) \ { \ if (X != (AplusModel *)_model)\ {\ if (model()!=0) \ { \ MSModel *tmp=_model; \ if (_model->type()==AplusModel::symbol()) \ { \ X->sflags(((AplusModel*)model())->sflags()); \ } \ \ _model=X; \ delete tmp;\ } \ _model = X; \ _model->addReceiver(this); \ updateData(); \ } \ } #define STANDARD_WIDGET_METHODS_H \ public: \ private: \ protected: \ virtual void decoupleWidget(void)\ {\ MSModel *m=_model;\ _model=0;\ delete m;\ } // decouple(); #endif //MacrosHEADER aplus-fsf-4.22/src/cxsys/0000777000265000001440000000000010774512571011053 5aplus-fsf-4.22/src/cxsys/Makefile.am0000444000265000001440000000143107232130575013013 ## Process this file with automake to produce Makefile.in ############################################################################### ## ## ## Copyright (c) 2001 Morgan Stanley Dean Witter & Co. All rights reserved. ## ## See .../src/LICENSE for terms of distribution. ## ## ## ## ## ############################################################################### lib_LTLIBRARIES = libcxsys.la libcxsys_la_SOURCES = \ sys.c \ eponymous.c \ sfe.c \ asock.c \ millisleep.c \ microsleep.c \ impexp.c \ impexp.h INCLUDES = -I.. aplus-fsf-4.22/src/cxsys/Makefile.in0000644000265000001440000002560010774512522013033 # Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ ############################################################################### ############################################################################### SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CXX = @CXX@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ STRIP = @STRIP@ VERSION = @VERSION@ X_INCLUDES = @X_INCLUDES@ X_LIBS = @X_LIBS@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ lib_LTLIBRARIES = libcxsys.la libcxsys_la_SOURCES = \ sys.c \ eponymous.c \ sfe.c \ asock.c \ millisleep.c \ microsleep.c \ impexp.c \ impexp.h INCLUDES = -I.. subdir = src/cxsys mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_CLEAN_FILES = LTLIBRARIES = $(lib_LTLIBRARIES) libcxsys_la_LDFLAGS = libcxsys_la_LIBADD = am_libcxsys_la_OBJECTS = sys.lo eponymous.lo sfe.lo asock.lo \ millisleep.lo microsleep.lo impexp.lo libcxsys_la_OBJECTS = $(am_libcxsys_la_OBJECTS) DEFS = @DEFS@ DEFAULT_INCLUDES = -I. -I$(srcdir) CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/asock.Plo ./$(DEPDIR)/eponymous.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/impexp.Plo ./$(DEPDIR)/microsleep.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/millisleep.Plo ./$(DEPDIR)/sfe.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/sys.Plo COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ CFLAGS = @CFLAGS@ DIST_SOURCES = $(libcxsys_la_SOURCES) DIST_COMMON = Makefile.am Makefile.in SOURCES = $(libcxsys_la_SOURCES) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/cxsys/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) libLTLIBRARIES_INSTALL = $(INSTALL) install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(libdir) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f"; \ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p"; \ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test -z "$dir" && dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libcxsys.la: $(libcxsys_la_OBJECTS) $(libcxsys_la_DEPENDENCIES) $(LINK) -rpath $(libdir) $(libcxsys_la_LDFLAGS) $(libcxsys_la_OBJECTS) $(libcxsys_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asock.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eponymous.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/impexp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/microsleep.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/millisleep.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sfe.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sys.Plo@am__quote@ distclean-depend: -rm -rf ./$(DEPDIR) .c.o: @AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< .c.obj: @AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(COMPILE) -c `cygpath -w $<` .c.lo: @AMDEP_TRUE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< CCDEPMODE = @CCDEPMODE@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ETAGS = etags ETAGSFLAGS = tags: TAGS 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; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ 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; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = ../.. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: $(mkinstalldirs) $(DESTDIR)$(libdir) 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_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_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-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-compile distclean-depend \ distclean-generic distclean-libtool distclean-tags dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-exec-am: install-libLTLIBRARIES install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES .PHONY: GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool distclean distclean-compile \ distclean-depend distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am info info-am install \ install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am \ install-libLTLIBRARIES install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool tags uninstall \ uninstall-am uninstall-info-am uninstall-libLTLIBRARIES # 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: aplus-fsf-4.22/src/cxsys/sys.c0000644000265000001440000000120710772770353011753 /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ void sysInstall() { eponymousInstall(); asockInstall(); sfeInstall(); impexpInstall(); } aplus-fsf-4.22/src/cxsys/eponymous.c0000644000265000001440000012613110772770353013177 /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #include #include #include #if defined(__osf__) #undef _AIX #endif #if defined(_AIX) extern closelog(),fsync(),getsockopt(),setsockopt(); #endif #include #if defined(HAVE_SVR4) # include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifndef _AIX extern void perror(); #endif #if defined(_AIX) || defined(__osf__) # include # include # include # include #elif defined(linux) # include # include # include # include #else # include # include #endif /* # if defined(__cplusplus) || defined(_LCC_LIB) */ /* # undef __STDC__ */ /* # include */ /* # include */ /* # else */ /* # include */ /* # include */ /* # endif */ /* ************************************************* * * Error Code Table and Functions */ #if !defined(__osf__) static EnumTable ErrnoTable[] = { { 0, "OK", 0}, #if defined(_AIX) || defined (__osf__) { EPERM, "EPERM", 0}, /* Operation not permitted */ { ENOENT, "ENOENT", 0}, /* No such file or directory */ { ESRCH, "ESRCH", 0}, /* No such process */ { EINTR, "EINTR", 0}, /* interrupted system call */ { EIO, "EIO", 0}, /* I/O error */ { ENXIO, "ENXIO", 0}, /* No such device or address */ { E2BIG, "E2BIG", 0}, /* Arg list too long */ { ENOEXEC, "ENOEXEC", 0}, /* Exec format error */ { EBADF, "EBADF", 0}, /* Bad file descriptor */ { ECHILD, "ECHILD", 0}, /* No child processes */ { EAGAIN, "EAGAIN", 0}, /* Resource temporarily unavailable */ { ENOMEM, "ENOMEM", 0}, /* Not enough space */ { EACCES, "EACCES", 0}, /* Permission denied */ { EFAULT, "EFAULT", 0}, /* Bad address */ { ENOTBLK, "ENOTBLK", 0}, /* Block device required */ { EBUSY, "EBUSY", 0}, /* Resource busy */ { EEXIST, "EEXIST", 0}, /* File exists */ { EXDEV, "EXDEV", 0}, /* Improper link */ { ENODEV, "ENODEV", 0}, /* No such device */ { ENOTDIR, "ENOTDIR", 0}, /* Not a directory */ { EISDIR, "EISDIR", 0}, /* Is a directory */ { EINVAL, "EINVAL", 0}, /* Invalid argument */ { ENFILE, "ENFILE", 0}, /* Too many open files in system */ { EMFILE, "EMFILE", 0}, /* Too many open files */ { ENOTTY, "ENOTTY", 0}, /* Inappropriate I/O control op */ { ETXTBSY, "ETXTBSY", 0}, /* Text file busy */ { EFBIG, "EFBIG", 0}, /* File too large */ { ENOSPC, "ENOSPC", 0}, /* No space left on device */ { ESPIPE, "ESPIPE", 0}, /* Invalid seek */ { EROFS, "EROFS", 0}, /* Read only file system */ { EMLINK, "EMLINK", 0}, /* Too many links */ { EPIPE, "EPIPE", 0}, /* Broken pipe */ { EDOM, "EDOM", 0}, /* Domain error within math function */ { ERANGE, "ERANGE", 0}, /* Result too large */ { ENOMSG, "ENOMSG", 0}, /* No message of desired type */ { EIDRM, "EIDRM", 0}, /* Identifier removed */ { ECHRNG, "ECHRNG", 0}, /* Channel number out of range */ { EL2NSYNC, "EL2NSYNC", 0}, /* Level 2 not synchronized */ { EL3HLT, "EL3HLT", 0}, /* Level 3 halted */ { EL3RST, "EL3RST", 0}, /* Level 3 reset */ { ELNRNG, "ELNRNG", 0}, /* Link number out of range */ { EUNATCH, "EUNATCH", 0}, /* Protocol driver not attached */ { ENOCSI, "ENOCSI", 0}, /* No CSI structure available */ { EL2HLT, "EL2HLT", 0}, /* Level 2 halted */ { EDEADLK, "EDEADLK", 0}, /* Resource deadlock avoided */ { ENOTREADY, "ENOTREADY", 0}, /* Device not ready */ { EWRPROTECT, "EWRPROTECT", 0}, /* Write-protected media */ { EFORMAT, "EFORMAT", 0}, /* Unformatted media */ { ENOLCK, "ENOLCK", 0}, /* No locks available */ { ENOCONNECT, "ENOCONNECT", 0}, /* no connection */ { ESTALE, "ESTALE", 0}, /* no filesystem */ { EDIST, "EDIST", 0}, /* old, currently unused AIX errno*/ { EWOULDBLOCK,"EWOULDBLOCK", 0}, /* Operation would block */ { EINPROGRESS,"EINPROGRESS", 0}, /* Operation now in progress */ { EALREADY, "EALREADY", 0}, /* Operation already in progress */ { ENOTSOCK, "ENOTSOCK", 0}, /* Socket operation on non-socket */ { EDESTADDRREQ,"EDESTADDRREQ",0}, /* Destination address required */ { EMSGSIZE, "EMSGSIZE", 0}, /* Message too long */ { EPROTOTYPE, "EPROTOTYPE", 0}, /* Protocol wrong type for socket */ { ENOPROTOOPT,"ENOPROTOOPT", 0}, /* Protocol not available */ { EPROTONOSUPPORT,"EPROTONOSUPPORT",0},/* Protocol not supported */ { ESOCKTNOSUPPORT,"ESOCKTNOSUPPORT",0},/* Socket type not supported */ { EOPNOTSUPP, "EOPNOTSUPP", 0}, /* Operation not supported on socket */ { EPFNOSUPPORT,"EPFNOSUPPORT",0}, /* Protocol family not supported */ { EAFNOSUPPORT,"EAFNOSUPPORT",0}, /* Address family not supported */ { EADDRINUSE, "EADDRINUSE", 0}, /* Address already in use */ { EADDRNOTAVAIL,"EADDRNOTAVAIL",0}, /* Can't assign requested address */ { ENETDOWN, "ENETDOWN", 0}, /* Network is down */ { ENETUNREACH,"ENETUNREACH", 0}, /* Network is unreachable */ { ENETRESET, "ENETRESET", 0}, /* Network dropped connection on res */ { ECONNABORTED,"ECONNABORTED",0}, /* Software caused connection abort */ { ECONNRESET, "ECONNRESET", 0}, /* Connection reset by peer */ { ENOBUFS, "ENOBUFS", 0}, /* No buffer space available */ { EISCONN, "EISCONN", 0}, /* Socket is already connected */ { ENOTCONN, "ENOTCONN", 0}, /* Socket is not connected */ { ESHUTDOWN, "ESHUTDOWN", 0}, /* Can't send after socket shutdown */ { ETIMEDOUT, "ETIMEDOUT", 0}, /* Connection timed out */ { ECONNREFUSED,"ECONNREFUSED",0}, /* Connection refused */ { EHOSTDOWN, "EHOSTDOWN", 0}, /* Host is down */ { EHOSTUNREACH,"EHOSTUNREACH",0}, /* No route to host */ { ERESTART, "ERESTART", 0}, /* restart the system call */ { EPROCLIM, "EPROCLIM", 0}, /* Too many processes */ { EUSERS, "EUSERS", 0}, /* Too many users */ { ELOOP, "ELOOP", 0}, /* Too many levels of symbolic links */ { ENAMETOOLONG,"ENAMETOOLONG",0}, /* File name too long */ { ENOTEMPTY, "ENOTEMPTY", 0}, /* Directory not empty */ { EDQUOT, "EDQUOT", 0}, /* Disc quota exceeded */ { EREMOTE, "EREMOTE", 0}, /* Item is not local to host */ { ENOSYS, "ENOSYS", 0}, /* Function not implemented POSIX */ { EMEDIA, "EMEDIA", 0}, /* media surface error */ { ESOFT, "ESOFT", 0}, /* I/O completed, but needs relocat */ { ENOATTR, "ENOATTR", 0}, /* no attribute found */ { ESAD, "ESAD", 0}, /* security authentication denied */ { ENOTRUST, "ENOTRUST", 0}, /* not a trusted program */ { ETOOMANYREFS,"ETOOMANYREFS",0}, /* Too many references: can't splice */ { EILSEQ, "EILSEQ", 0}, /* Invalid wide character */ { ECANCELED, "ECANCELED", 0}, /* asynchronous i/o cancelled */ { ENOSR, "ENOSR", 0}, /* temp out of streams resources */ { ETIME, "ETIME", 0}, /* I_STR ioctl timed out */ { EBADMSG, "EBADMSG", 0}, /* wrong message type at stream head */ { EPROTO, "EPROTO", 0}, /* STREAMS protocol error */ { ENODATA, "ENODATA", 0}, /* no message ready at stream head */ { ENOSTR, "ENOSTR", 0}, /* fd is not a stream */ { ECLONEME, "ECLONEME", 0}, /* this is the way we clone a stream */ #else { EPERM, "EPERM", 0}, /* Not owner */ { ENOENT, "ENOENT", 0}, /* No such file or directory */ { ESRCH, "ESRCH", 0}, /* No such process */ { EINTR, "EINTR", 0}, /* Interrupted system call */ { EIO, "EIO", 0}, /* I/O error */ { ENXIO, "ENXIO", 0}, /* No such device or address */ { E2BIG, "E2BIG", 0}, /* Arg list too long */ { ENOEXEC, "ENOEXEC", 0}, /* Exec format error */ { EBADF, "EBADF", 0}, /* Bad file number */ { ECHILD, "ECHILD", 0}, /* No children */ { EAGAIN, "EAGAIN", 0}, /* No more processes */ { ENOMEM, "ENOMEM", 0}, /* Not enough core */ { EACCES, "EACCES", 0}, /* Permission denied */ { EFAULT, "EFAULT", 0}, /* Bad address */ { ENOTBLK, "ENOTBLK", 0}, /* Block device required */ { EBUSY, "EBUSY", 0}, /* Mount device busy */ { EEXIST, "EEXIST", 0}, /* File exists */ { EXDEV, "EXDEV", 0}, /* Cross-device link */ { ENODEV, "ENODEV", 0}, /* No such device */ { ENOTDIR, "ENOTDIR", 0}, /* Not a directory*/ { EISDIR, "EISDIR", 0}, /* Is a directory */ { EINVAL, "EINVAL", 0}, /* Invalid argument */ { ENFILE, "ENFILE", 0}, /* File table overflow */ { EMFILE, "EMFILE", 0}, /* Too many open files */ { ENOTTY, "ENOTTY", 0}, /* Not a typewriter */ { ETXTBSY, "ETXTBSY", 0}, /* Text file busy */ { EFBIG, "EFBIG", 0}, /* File too large */ { ENOSPC, "ENOSPC", 0}, /* No space left on device */ { ESPIPE, "ESPIPE", 0}, /* Illegal seek */ { EROFS, "EROFS", 0}, /* Read-only file system */ { EMLINK, "EMLINK", 0}, /* Too many links */ { EPIPE, "EPIPE", 0}, /* Broken pipe */ { EDOM, "EDOM", 0}, /* Argument too large */ { ERANGE, "ERANGE", 0}, /* Result too large */ { EWOULDBLOCK,"EWOULDBLOCK", 0}, /* Operation would block */ { EINPROGRESS,"EINPROGRESS", 0}, /* Operation now in progress */ { EALREADY, "EALREADY", 0}, /* Operation already in progress */ { ENOTSOCK, "ENOTSOCK", 0}, /* Socket operation on non-socket */ { EDESTADDRREQ,"EDESTADDRREQ",0}, /* Destination address required */ { EMSGSIZE, "EMSGSIZE", 0}, /* Message too long */ { EPROTOTYPE, "EPROTOTYPE", 0}, /* Protocol wrong type for socket */ { ENOPROTOOPT,"ENOPROTOOPT", 0}, /* Protocol not available */ { EPROTONOSUPPORT,"EPROTONOSUPPORT",0},/* Protocol not supported */ { ESOCKTNOSUPPORT,"ESOCKTNOSUPPORT",0},/* Socket type not supported */ { EOPNOTSUPP, "EOPNOTSUPP", 0}, /* Operation not supported on socket */ { EPFNOSUPPORT,"EPFNOSUPPORT",0}, /* Protocol family not supporte */ { EAFNOSUPPORT,"EAFNOSUPPORT",0}, /* Address family not supported */ { EADDRINUSE, "EADDRINUSE", 0}, /* Address already in use */ { EADDRNOTAVAIL,"EADDRNOTAVAIL",0}, /* Can't assign requested add */ { ENETDOWN, "ENETDOWN", 0}, /* Network is down */ { ENETUNREACH,"ENETUNREACH", 0}, /* Network is unreachable */ { ENETRESET, "ENETRESET", 0}, /* Network dropped connection on res*/ { ECONNABORTED,"ECONNABORTED",0}, /* Software caused connection a */ { ECONNRESET, "ECONNRESET", 0}, /* Connection reset by peer */ { ENOBUFS, "ENOBUFS", 0}, /* No buffer space available */ { EISCONN, "EISCONN", 0}, /* Socket is already connected */ { ENOTCONN, "ENOTCONN", 0}, /* Socket is not connected */ { ESHUTDOWN, "ESHUTDOWN", 0}, /* Can't send after socket shutdown */ { ETOOMANYREFS,"ETOOMANYREFS",0}, /* Too many references */ { ETIMEDOUT, "ETIMEDOUT", 0}, /* Connection timed out */ { ECONNREFUSED,"ECONNREFUSED",0}, /* Connection refused */ { ELOOP, "ELOOP", 0}, /* Too many levels of symbolic links */ { ENAMETOOLONG,"ENAMETOOLONG",0}, /* File name too long */ { EHOSTDOWN, "EHOSTDOWN", 0}, /* Host is down */ { EHOSTUNREACH,"EHOSTUNREACH",0}, /* No route to host */ { ENOTEMPTY, "ENOTEMPTY", 0}, /* Directory not empty */ { EUSERS, "EUSERS", 0}, /* Too many users */ { ESTALE, "ESTALE", 0}, /* Stale NFS file handle */ { EREMOTE, "EREMOTE", 0}, /* Too many levels of remote in path */ { EDEADLK, "EDEADLK", 0}, /* Deadlock condition. */ { ENOLCK, "ENOLCK", 0}, /* No record locks available. */ { ENOSYS, "ENOSYS", 0}, /* function not implemented */ #endif { 0, (char *)0, 0} }; #endif I sysErrno() { R errno; } #if defined (__osf__) A sysErrsym(n) { A r ; r = gs(Et) ; *r->p = MS(si(strerror(n))) ; R r; } #else A sysErrsym(n){A z=EnumToSymbol(ErrnoTable,n);R qz(z)?(A)gsym("unknown"):z;} #endif A aselect(rfd, wfd, xfd, tmo) A rfd, wfd, xfd, tmo; { A z, retcode, errcode, arfd, awfd, axfd; int width; fd_set *rfds, *wfds, *xfds; struct timeval *tvp; int rc; I *p, *q; I n, i, j; struct timeval tv; width = -1; retcode = gs(It); errcode = gs(It); n = rfd->n; p = rfd->p; for (i = 0; i < n; i++) if (p[i] > width) width = p[i]; arfd = gv(It, n); arfd->n = arfd->d[0] = 0; n = wfd->n; p = wfd->p; for (i = 0; i < n; i++) if (p[i] > width) width = p[i]; awfd = gv(It, n); awfd->n = awfd->d[0] = 0; n = xfd->n; p = xfd->p; for (i = 0; i < n; i++) if (p[i] > width) width = p[i]; axfd = gv(It, n); axfd->n = axfd->d[0] = 0; z = gv(Et, (I)5); p = z->p; *(A *)(p) = retcode; *(A *)(p + 1) = errcode; *(A *)(p + 2) = arfd; *(A *)(p + 3) = awfd; *(A *)(p + 4) = axfd; width += 1; if (width > 0) { int sz; I *tmp; sz = howmany(width, NFDBITS); tmp = k_tm(3 * sz); bzero((char *)tmp, 3 * sizeof(I) * sz); rfds = (fd_set *)(tmp); wfds = (fd_set *)(tmp + sz); xfds = (fd_set *)(tmp + (2 * sz)); } else { rfds = (fd_set *)(0); wfds = (fd_set *)(0); xfds = (fd_set *)(0); } n = rfd->n; p = rfd->p; for (i = 0; i < n; i++) FD_SET(p[i], rfds); n = wfd->n; p = wfd->p; for (i = 0; i < n; i++) FD_SET(p[i], wfds); n = xfd->n; p = xfd->p; for (i = 0; i < n; i++) FD_SET(p[i], xfds); n = tmo->n; p = tmo->p; if (n > 0) { tv.tv_sec = p[0]; tv.tv_usec = (n > 1) ? p[1] : 0; tvp = &tv; } else { tvp = (struct timeval *)(0); } rc = select(width, rfds, wfds, xfds, tvp); retcode->p[0] = rc; errcode->p[0] = rc < 0 ? errno : 0; if (rc > 0) { n = rfd->n; p = rfd->p; q = arfd->p; for (i = 0, j = 0; i < n; i++) { if (FD_ISSET(p[i], rfds)) q[j++] = p[i]; } arfd->n = arfd->d[0] = j; n = wfd->n; p = wfd->p; q = awfd->p; for (i = 0, j = 0; i < n; i++) { if (FD_ISSET(p[i], wfds)) q[j++] = p[i]; } awfd->n = awfd->d[0] = j; n = xfd->n; p = xfd->p; q = axfd->p; for (i = 0, j = 0; i < n; i++) { if (FD_ISSET(p[i], xfds)) q[j++] = p[i]; } axfd->n = axfd->d[0] = j; } return z; } A cpu() { I i; struct tms aTms; static int clkTck=0; A r; if(!clkTck) clkTck=sysconf(_SC_CLK_TCK); times(&aTms); r=gv(It,4); r->p[0]=(1000*aTms.tms_utime)/clkTck; r->p[1]=(1000*aTms.tms_stime)/clkTck; r->p[2]=(1000*aTms.tms_cutime)/clkTck; r->p[3]=(1000*aTms.tms_cstime)/clkTck; R r; } #ifndef _AIX static MaskTable MsyncMasks[] = { { MS_ASYNC, "MS_ASYNC", 0, 0 }, { MS_SYNC, "MS_SYNC", 0, 0 }, { MS_INVALIDATE,"MS_INVALIDATE",0, 0 }, { 0, (char *)0, 0, 0 } }; #endif I amsync(A a, A aflags) { #ifdef _AIX R 0; #else int bytes; unsigned long flags; if (SymbolsToMask(MsyncMasks, aflags, &flags) == -1) { (void)pa((V)aflags); q = ERR_DOMAIN; R 0; } bytes=mf_length(a); R bytes?msync((caddr_t)a, AH+Tt(a->t,a->n), (int)flags):0; #endif /* _AIX */ } A gettod(atz) A atz; { struct timeval tv; struct timezone tz; A z; z = gv(It, 2); if (atz->n != 2) gettimeofday(&tv,NULL); else { tz.tz_minuteswest = atz->p[0]; tz.tz_dsttime = atz->p[1]; gettimeofday(&tv, &tz); } z->p[0] = tv.tv_sec; z->p[1] = tv.tv_usec; return z; } A ts() { struct timeval tp; struct tm *lt; A z=gv(It,7); /* 7-element integer vector */ #ifdef APLUS_THREAD_SAFE_FUNCTIONS struct tm tmp; #endif /* APLUS_THREAD_SAFE_FUNCTIONS */ gettimeofday(&tp,NULL); lt = APLUS_LOCALTIME((const time_t *)&tp.tv_sec,&tmp); z->p[0] = 1900 + lt->tm_year; /* year */ z->p[1] = 1 + lt->tm_mon; /* month */ z->p[2] = lt->tm_mday; /* day */ z->p[3] = lt->tm_hour; /* hour */ z->p[4] = lt->tm_min; /* minute */ z->p[5] = lt->tm_sec; /* second */ z->p[6] = tp.tv_usec / 1000; /* millisecond */ return z; } A tsgmt() { struct timeval tp; struct tm *lt; A z=gv(It,7); /* 7-element integer vector */ #ifdef APLUS_THREAD_SAFE_FUNCTIONS struct tm tmp; #endif /* APLUS_THREAD_SAFE_FUNCTIONS */ gettimeofday(&tp,NULL); lt = APLUS_GMTIME((const time_t *)&tp.tv_sec,&tmp); z->p[0] = 1900 + lt->tm_year; /* year */ z->p[1] = 1 + lt->tm_mon; /* month */ z->p[2] = lt->tm_mday; /* day */ z->p[3] = lt->tm_hour; /* hour */ z->p[4] = lt->tm_min; /* minute */ z->p[5] = lt->tm_sec; /* second */ z->p[6] = tp.tv_usec / 1000; /* millisecond */ return z; } I mkts1(a) A a; { struct tm lt; A z; Q(a->t!=It,ERR_TYPE) Q(a->r!=1,ERR_RANK) Q(a->n!=7,ERR_LENGTH) z=gs(It); lt.tm_year=a->p[0]-1900; /* year */ lt.tm_mon=a->p[1]-1; /* month */ lt.tm_mday=a->p[2]; /* day */ lt.tm_hour=a->p[3]; /* hour */ lt.tm_min=a->p[4]; /* minute */ lt.tm_sec=a->p[5]; /* second */ lt.tm_isdst=-1; /* daylight savings */ z->p[0]=mktime(<); return (I) z; } I mkts1gmt(a) A a; { struct tm lt; A z; Q(a->t!=It,ERR_TYPE) Q(a->r!=1,ERR_RANK) Q(a->n!=7,ERR_LENGTH) z=gs(It); lt.tm_year=a->p[0]-1900; /* year */ lt.tm_mon=a->p[1]-1; /* month */ lt.tm_mday=a->p[2]; /* day */ lt.tm_hour=a->p[3]; /* hour */ lt.tm_min=a->p[4]; /* minute */ lt.tm_sec=a->p[5]; /* second */ lt.tm_isdst=0; /* daylight savings NOT in effect */ /* z->p[0]=mktime(<)-altzone; */ #if defined(_AIX) || defined(HAVE_SVR4) || defined (__osf__) || defined(HAVE_MKTIME) z->p[0]=mktime(<); if( z->p[0] != -1) z->p[0]=z->p[0]-timezone; #else z->p[0]=timegm(<); #endif return (I) z; } A ts1(clock) long clock; { struct tm *lt; A z=gv(It,7); /* 7-element integer vector */ #ifdef APLUS_THREAD_SAFE_FUNCTIONS struct tm tmp; #endif /* APLUS_THREAD_SAFE_FUNCTIONS */ time_t clockx=clock; lt = APLUS_LOCALTIME(&clockx,&tmp); z->p[0] = 1900 + lt->tm_year; /* year */ z->p[1] = 1 + lt->tm_mon; /* month */ z->p[2] = lt->tm_mday; /* day */ z->p[3] = lt->tm_hour; /* hour */ z->p[4] = lt->tm_min; /* minute */ z->p[5] = lt->tm_sec; /* second */ z->p[6] = 0; /* millisecond */ return z; } A ts1gmt(clock) long clock; { struct tm *lt; A z=gv(It,7); /* 7-element integer vector */ #ifdef APLUS_THREAD_SAFE_FUNCTIONS struct tm tmp; #endif /* APLUS_THREAD_SAFE_FUNCTIONS */ time_t clockx=clock; lt = APLUS_GMTIME(&clockx,&tmp); z->p[0] = 1900 + lt->tm_year; /* year */ z->p[1] = 1 + lt->tm_mon; /* month */ z->p[2] = lt->tm_mday; /* day */ z->p[3] = lt->tm_hour; /* hour */ z->p[4] = lt->tm_min; /* minute */ z->p[5] = lt->tm_sec; /* second */ z->p[6] = 0; /* millisecond */ return z; } time_t secs_in_epoch () { return time(NULL); } A updtime (name) char *name; { A z = gv(It,1); struct stat stbuf; if (stat(name, &stbuf) == -1) { z->p[0] = -1; return z; } z->p[0] = stbuf.st_mtime; return z; } A filesize (name) char *name; { A z = gv(It,1); struct stat stbuf; if (stat(name, &stbuf) == -1) { z->p[0] = -1; return z; } z->p[0] = stbuf.st_size; return z; } fflush_stdout() { fflush(stdout); } I ep_setenv(e)C*e;{R putenv(strdup(e));} A readenv(e) C*e; { extern C*getenv(); if((e=getenv(e))==NULL)R(A)gz();R(A)gsv(0,e); } A pathfind(pathVariable, defaultPath, fileName, mode) char *pathVariable; /* environment variable containing path */ char *defaultPath; /* default path if no environment variable */ char *fileName; /* name of file to search for in path */ int mode; /* flag to test access mode a la access(2V) */ { extern char *pfind(); A r; char *p; if ((p = pfind(pathVariable, defaultPath, fileName, mode)) == NULL) r = (A)gz(); else { r = (A)gsv(0, p); } R r; } /* * From Robert Gusick (cleaned up by Chuck Ocheret) */ #ifndef MAX #define MAX(a,b) ((a)>(b))?(a):(b) #endif /* MAX */ A readmat(name) char *name; { A result; /* 'a' character matrix */ int num_lines; /* number of rows of 'result' */ int max_line_length; /* number of columns of 'result' */ int this_line_length; /* current line length */ int descriptor; /* file descriptor */ char *c; /* index into mapped file */ char *start_c; /* start of mapped file */ char *c_start_line; /* start of current line of 'result' */ char *this_char; /* index into 'result' */ struct stat stbuf; /* file status */ if ((descriptor = open(name, O_RDONLY)) < 0) { perror("readmat open"); R (A)gz(); } if (fstat(descriptor, &stbuf) == (-1)) { perror("readmat fstat"); (void)close(descriptor); R (A)gz(); } if (S_ISDIR(stbuf.st_mode)) { H("readmat error: is directory\n"); R (A)gz(); } if (stbuf.st_size != 0) { start_c = mmap(0, stbuf.st_size, PROT_READ, MAP_SHARED, descriptor, 0); (void)close(descriptor); if ((int)start_c == -1) { perror("readmat mmap"); R (A)gz(); } max_line_length = num_lines = 0; this_line_length = 0; for (c = start_c; c != start_c + stbuf.st_size; c++) if (*c == '\n') { num_lines++; max_line_length = MAX(max_line_length, this_line_length); this_line_length = 0; } else this_line_length++; if (this_line_length != 0) { num_lines++; max_line_length = MAX(max_line_length, this_line_length); } if ((result = gm(Ct, num_lines, max_line_length)) == 0) { (void)munmap(start_c, stbuf.st_size); R 0; } this_char = c_start_line = (C *)result->p; for (c = start_c; c != start_c + stbuf.st_size; c++) { if (*c == '\n') { c_start_line += max_line_length; while (this_char != c_start_line) *this_char++ = ' '; } else *this_char++ = *c; } if (this_line_length != 0) { c_start_line += max_line_length; while (this_char != c_start_line) *this_char++ = ' '; }; (void)munmap(start_c, stbuf.st_size); R result; } else { (void) close(descriptor); R gm(Ct, 0, 0); } } /* * utilities from kwi (cleaned up by chuck ocheret) */ typedef struct stat SSTAT; typedef struct dirent DENT; typedef struct node NODE; typedef struct fs{I l;char n[MAXNAMLEN+1];} FS; DIR *opendir(); A agetdents(a) C *a; { A r; C *cp; DIR *f; FS *fs; DENT *e; NODE *hp=(NODE *)0,*np; I i,j,d[MAXR+1]; APLUS_DECLARE_DIRENT(dirEntry); /* see comment in a/k.h on usage of this macro */ bzero((C *)(d), sizeof(d)); if ((f = opendir(a)) == (DIR *)0) R ga(Ct, 2, 0, d); hp = nodealloc(); while (APLUS_READDIR(f,dirEntry,e)!=0) { #if defined(HAVE_SVR4) || defined(linux) fs = (FS *)balloc(sizeof(FS)); fs->l = strlen(e->d_name); #else fs = (FS *)balloc(sizeof(FS)); fs->l = e->d_namlen; #endif if((fs->l == 1) && (e->d_name[0] == '.')) continue; if((fs->l == 2) && (e->d_name[0] == '.') && (e->d_name[1] == '.')) continue; bcopy(e->d_name, fs->n,fs->l); d[1] = (d[1]>fs->l)?d[1]:fs->l; d[0]++; np = nodealloc(); np->d = (void *)(fs); nodeinsert(hp, np); } (void)closedir(f); j = d[1]; r = ga(Ct, 2, d[0]*j, d); memset((C *)(r->p), ' ', r->n); for (i=0, np=hp->f, cp=(C *)(r->p); if, cp+=j) { fs = (FS *)(np->d); bcopy(fs->n, cp, fs->l); bfree((C *)(np->d)); noderemove(np); nodefree(np); } nodefree(hp); R r; } Z A auxstat(a, statfunc) A a; int (*statfunc)(); { A z; SSTAT st; C *c,*f,*t; I i,j,n,r,ad[2],d[MAXR+1]; bzero((C *)(d), sizeof(d)); /* if(a->t != Ct) {z=gv(It,1); z->p[0] = -1; R z;}*/ switch (a->r) { case 0:ad[0]=1; ad[1]=1; r=1; n=13; d[0]=13; break; case 1:ad[0]=1; ad[1]=a->d[0]; r=1; n=13; d[0]=13; break; case 2:d[0]=ad[0]=a->d[0]; ad[1]=a->d[1]; d[1]=13; r=2; n=d[0]*d[1]; break; default: d[0] = ad[0] = a->d[0]; for(i=1;i<(a->r-1);i++){d[i]=a->d[i];ad[0]*=a->d[i];} ad[1]=a->d[i]; d[i]=13; r=a->r; n=13*ad[0]; break; } z=ga(It,r,n,d); bzero((C *)(z->p),4*z->n); f=(C *)balloc(ad[1]+1); for(i=0,n=0,c=(C *)(a->p);i=f)&&(*t==' ')) *(t--)='\0'; if((*statfunc)(f,&st)==-1){for(j=0;j<13;j++)z->p[n++]=0; } else { z->p[n++]=(I)(st.st_dev); z->p[n++]=(I)(st.st_ino); z->p[n++]=(I)(st.st_mode); z->p[n++]=(I)(st.st_nlink); z->p[n++]=(I)(st.st_uid); z->p[n++]=(I)(st.st_gid); z->p[n++]=(I)(st.st_rdev); z->p[n++]=(I)(st.st_size); z->p[n++]=(I)(st.st_atime); z->p[n++]=(I)(st.st_mtime); z->p[n++]=(I)(st.st_ctime); z->p[n++]=(I)(st.st_blksize); z->p[n++]=(I)(st.st_blocks); } } bfree(f); R z; } A astat(a) A a; { extern int stat(); R auxstat(a, stat); } A alstat(a) A a; { extern int lstat(); R auxstat(a, lstat); } A areadlink(a) C *a; { A r; C *b; I i,d[MAXR+1]; SSTAT st; #ifndef S_ISLNK #define S_ISLNK(m) (((m)&S_IFMT) == S_IFLNK) #endif /* S_ISLNK */ bzero((C *)(d), sizeof(d)); if (((lstat(a,&st)) == -1) || (!S_ISLNK(st.st_mode))) { r = ga(It,0,1,d); r->p[0]=-1; R r; } b=(C *)balloc(st.st_size+1); if((i=readlink(a,b,st.st_size))==-1) R gi(-1); b[i]='\0'; r=gv(Ct,i); bcopy(b,(C *)(r->p),st.st_size); bfree(b); R r; } static MaskTable SyslogMasks[] = { { LOG_EMERG, "LOG_EMERG", 0, 0 }, { LOG_ALERT, "LOG_ALERT", 0, 0 }, { LOG_CRIT, "LOG_CRIT", 0, 0 }, { LOG_ERR, "LOG_ERR", 0, 0 }, { LOG_WARNING, "LOG_WARNING", 0, 0 }, { LOG_NOTICE, "LOG_NOTICE", 0, 0 }, { LOG_INFO, "LOG_INFO", 0, 0 }, { LOG_DEBUG, "LOG_DEBUG", 0, 0 }, { LOG_KERN, "LOG_KERN", 0, 0 }, { LOG_USER, "LOG_USER", 0, 0 }, { LOG_MAIL, "LOG_MAIL", 0, 0 }, { LOG_DAEMON, "LOG_DAEMON", 0, 0 }, { LOG_AUTH, "LOG_AUTH", 0, 0 }, { LOG_SYSLOG, "LOG_SYSLOG", 0, 0 }, { LOG_LPR, "LOG_LPR", 0, 0 }, { LOG_NEWS, "LOG_NEWS", 0, 0 }, { LOG_UUCP, "LOG_UUCP", 0, 0 }, #ifndef _AIX { LOG_CRON, "LOG_CRON", 0, 0 }, #endif /* _AIX */ { LOG_LOCAL0, "LOG_LOCAL0", 0, 0 }, { LOG_LOCAL1, "LOG_LOCAL1", 0, 0 }, { LOG_LOCAL2, "LOG_LOCAL2", 0, 0 }, { LOG_LOCAL3, "LOG_LOCAL3", 0, 0 }, { LOG_LOCAL4, "LOG_LOCAL4", 0, 0 }, { LOG_LOCAL5, "LOG_LOCAL5", 0, 0 }, { LOG_LOCAL6, "LOG_LOCAL6", 0, 0 }, { LOG_LOCAL7, "LOG_LOCAL7", 0, 0 }, { 0, (char *)0, 0, 0 } }; static MaskTable SyslogOptMasks[] = { { LOG_PID, "LOG_PID", 0, 0 }, { LOG_CONS, "LOG_CONS", 0, 0 }, { LOG_NDELAY, "LOG_NDELAY", 0, 0 }, { LOG_NOWAIT, "LOG_NOWAIT", 0, 0 }, { 0, (char *)0, 0, 0 } }; I syssyslog(apriority, message) A apriority; C *message; { unsigned long priority; if (SymbolsToMask(SyslogMasks, apriority, &priority) == -1) { (void)pa((V)apriority); q = ERR_DOMAIN; R 0; } syslog(priority, message); R 1; } I sysopenlog(ident, alogopt, afacility) A ident, alogopt, afacility; { unsigned long logopt, facility; if (SymbolsToMask(SyslogMasks, afacility, &facility) == -1) { (void)pa((V)afacility); q = ERR_DOMAIN; R 0; } if (SymbolsToMask(SyslogOptMasks, alogopt, &logopt) == -1) { (void)pa((V)alogopt); q = ERR_DOMAIN; R 0; } else { /* Don't dc() in closelog, since even on closelog, the * library keeps a reference to the ident string */ Z A saved_ident = (A)(0); if (saved_ident != (A)(0)) dc(saved_ident); saved_ident = (A)ic(ident); openlog((C *)(ident->p), logopt, facility); R 1; } } static EnumTable FcntlEnums[] = { { F_DUPFD, "F_DUPFD", 0 }, { F_GETFD, "F_GETFD", 0 }, { F_SETFD, "F_SETFD", 0 }, { F_GETFL, "F_GETFL", 0 }, { F_SETFL, "F_SETFL", 0 }, { F_GETLK, "F_GETLK", 0 }, { F_SETLK, "F_SETLK", 0 }, { F_SETLKW, "F_SETLKW", 0 }, { F_GETOWN, "F_GETOWN", 0 }, { F_SETOWN, "F_SETOWN", 0 }, #ifdef _AIX { F_CLOSEM, "F_CLOSEM", 0 }, #endif { 0, (char *)0, 0 } }; I sysfcntl(fd, acmd, arg) I fd; A acmd; I arg; { unsigned long cmd; if (SymbolToEnum(FcntlEnums, acmd, &cmd)) { (void)pa((V)acmd); q = ERR_DOMAIN; R 0; } else R (I)fcntl((int)fd, (int)cmd, (int)arg); } #ifndef LEXABUG static EnumTable IoctlEnums[] = { { FIOCLEX, "FIOCLEX", 0 }, { FIONCLEX, "FIONCLEX", 0 }, { FIONREAD, "FIONREAD", 0 }, { FIONBIO, "FIONBIO", 0 }, { FIOASYNC, "FIOASYNC", 0 }, { FIOSETOWN, "FIOSETOWN", 0 }, { FIOGETOWN, "FIOGETOWN", 0 }, { TIOCGPGRP, "TIOCGPGRP", 0 }, { TIOCSPGRP, "TIOCSPGRP", 0 }, { TIOCOUTQ, "TIOCOUTQ", 0 }, { TIOCSTI, "TIOCSTI", 0 }, { TIOCGWINSZ, "TIOCGWINSZ", 0 }, { TIOCSWINSZ, "TIOCSWINSZ", 0 }, { TIOCMGET, "TIOCMGET", 0 }, { TIOCMBIS, "TIOCMBIS", 0 }, { TIOCMBIC, "TIOCMBIC", 0 }, { TIOCMSET, "TIOCMSET", 0 }, { 0, (char *)0, 0 } }; #else static EnumTable IoctlEnums[] = { { 0, "FIOCLEX", 0 }, { 0, "FIONCLEX", 0 }, { 0, "FIONREAD", 0 }, { 0, "FIONBIO", 0 }, { 0, "FIOASYNC", 0 }, { 0, "FIOSETOWN", 0 }, { 0, "FIOGETOWN", 0 }, { 0, "TCGETS", 0 }, { 0, "TCSETS", 0 }, { 0, "TCSETSW", 0 }, { 0, "TCSETSF", 0 }, { 0, "TCXONC", 0 }, { 0, "TCFLSH", 0 }, { 0, "TIOCSCTTY", 0 }, { 0, "TIOCGPGRP", 0 }, { 0, "TIOCSPGRP", 0 }, { 0, "TIOCOUTQ", 0 }, { 0, "TIOCSTI", 0 }, { 0, "TIOCGWINSZ", 0 }, { 0, "TIOCSWINSZ", 0 }, { 0, "TIOCMGET", 0 }, { 0, "TIOCMBIS", 0 }, { 0, "TIOCMBIC", 0 }, { 0, "TIOCMSET", 0 }, { 0, "TIOCGSOFTCAR", 0 }, { 0, "TIOCSSOFTCAR", 0 }, { 0, (char *)0, 0 } }; int initIoctlTable(void) { EnumTable *EnumTablePtr = IoctlEnums; EnumTablePtr->value = FIOCLEX; EnumTablePtr ++; EnumTablePtr->value = FIONCLEX; EnumTablePtr ++; EnumTablePtr->value = FIONREAD; EnumTablePtr ++; EnumTablePtr->value = FIONBIO; EnumTablePtr ++; EnumTablePtr->value = FIOASYNC; EnumTablePtr ++; EnumTablePtr->value = FIOSETOWN; EnumTablePtr ++; EnumTablePtr->value = FIOGETOWN; EnumTablePtr ++; EnumTablePtr->value = TCGETS; EnumTablePtr ++; EnumTablePtr->value = TCSETS; EnumTablePtr ++; EnumTablePtr->value = TCSETSW; EnumTablePtr ++; EnumTablePtr->value = TCSETSF; EnumTablePtr ++; EnumTablePtr->value = TCXONC; EnumTablePtr ++; EnumTablePtr->value = TCFLSH; EnumTablePtr ++; EnumTablePtr->value = TIOCSCTTY; EnumTablePtr ++; EnumTablePtr->value = TIOCGPGRP; EnumTablePtr ++; EnumTablePtr->value = TIOCSPGRP; EnumTablePtr ++; EnumTablePtr->value = TIOCOUTQ; EnumTablePtr ++; EnumTablePtr->value = TIOCSTI; EnumTablePtr ++; EnumTablePtr->value = TIOCGWINSZ; EnumTablePtr ++; EnumTablePtr->value = TIOCSWINSZ; EnumTablePtr ++; EnumTablePtr->value = TIOCMGET; EnumTablePtr ++; EnumTablePtr->value = TIOCMBIS; EnumTablePtr ++; EnumTablePtr->value = TIOCMBIC; EnumTablePtr ++; EnumTablePtr->value = TIOCMSET; EnumTablePtr ++; EnumTablePtr->value = TIOCGSOFTCAR; EnumTablePtr ++; EnumTablePtr->value = TIOCSSOFTCAR; return 0; } #endif I sysioctl(fd, arequest, arg) I fd; A arequest; I arg; { unsigned long request; #ifdef LEXABUG { static int init = 1; if (init) init = initIoctlTable(); } #endif if (SymbolToEnum(IoctlEnums, arequest, &request)) { (void)pa((V)arequest); q = ERR_DOMAIN; R 0; } else R (I)ioctl((int)fd, (int)request, (caddr_t)arg); } #if defined(HAVE_SVR4) || defined(_AIX) # ifndef LOCK_SH # define LOCK_SH 1 /* shared lock */ # define LOCK_EX 2 /* exclusive lock */ # define LOCK_NB 4 /* don't block when locking */ # define LOCK_UN 8 /* unlock */ # endif int flock(fd, operation) int fd, operation; { struct flock fl; int cmd = F_SETLKW; fl.l_whence = 0; fl.l_start = 0; fl.l_len = 0; fl.l_type = 0; if (operation & LOCK_UN) fl.l_type |= F_UNLCK; if (operation & LOCK_SH) fl.l_type |= F_RDLCK; if (operation & LOCK_EX) fl.l_type |= F_WRLCK; if (operation & LOCK_NB) cmd = F_SETLK; return(fcntl(fd, cmd, &fl)); } #endif static MaskTable FlockMasks[] = { { LOCK_SH, "LOCK_SH", 0, 0 }, { LOCK_EX, "LOCK_EX", 0, 0 }, { LOCK_NB, "LOCK_NB", 0, 0 }, { LOCK_UN, "LOCK_UN", 0, 0 }, { 0, (char *)0, 0, 0 } }; I sysflock(fd, aoperation) I fd; A aoperation; { unsigned long operation; if (SymbolsToMask(FlockMasks, aoperation, &operation)) { q = ERR_DOMAIN; R -1; } else R (I)flock((int)fd, (int)operation); } I sysgetdtablesize() { R sysconf(_SC_OPEN_MAX); } static MaskTable AccessMasks[] = { { R_OK, "R_OK", 0, 0}, { W_OK, "W_OK", 0, 0}, { X_OK, "X_OK", 0, 0}, { F_OK, "F_OK", 0, 0}, { 0, (char *)0, 0, 0} }; I sysaccess(apath, amode) A apath, amode; { char *path; unsigned long mode; if ((path = AToString(apath)) == (char *)(-1) || SymbolsToMask(AccessMasks, amode, &mode)) { q = ERR_DOMAIN; R 0; } else R (I)access(path, (int)mode); } static MaskTable OpenMasks[] = { { O_RDONLY, "O_RDONLY", 0, 0 }, { O_WRONLY, "O_WRONLY", 0, 0 }, { O_RDWR, "O_RDWR", 0, 0 }, { O_NDELAY, "O_NDELAY", 0, 0 }, { O_NOCTTY, "O_NOCTTY", 0, 0 }, { O_NONBLOCK, "O_NONBLOCK", 0, 0 }, { O_APPEND, "O_APPEND", 0, 0 }, { O_CREAT, "O_CREAT", 0, 0 }, { O_TRUNC, "O_TRUNC", 0, 0 }, { O_EXCL, "O_EXCL", 0, 0 }, { 0, (char *)0, 0, 0 } }; I sysopen(afilename, aflags, mode) A afilename; A aflags; I mode; { char *filename; unsigned long flags; if ((filename = AToString(afilename)) == (char *)(-1) || SymbolsToMask(OpenMasks, aflags, &flags)) { q = ERR_DOMAIN; R 0; } else R (I)open(filename, (int)flags, (int)mode); } A sysgetdomainname() { A r; char name[64]; r = (getdomainname(name, 64)) ? (A)gz() : (A)gsv(0, name); R r; } A sysgethostname() { A r; char name[MAXHOSTNAMELEN]; r = (gethostname(name, MAXHOSTNAMELEN)) ? (A)gz() : (A)gsv(0, name); R r; } static A username(uid) I uid; { struct passwd *pwd; #if defined(APLUS_THREAD_SAFE_FUNCTIONS) struct passwd pwdStruct; char charBuf[1024]; #endif /* APLUS_THREAD_SAFE_FUNCTIONS */ APLUS_GETPWUID(uid,&pwdStruct,charBuf,1024,pwd); if (pwd!=0 && pwd->pw_name) { R (A)gsv(0,pwd->pw_name); } else { R (A)gz(); } } static A pwinfo(aobj) A aobj; { I uid; I isint=0; C *name; struct passwd *pwd; #if defined(APLUS_THREAD_SAFE_FUNCTIONS) struct passwd pwdStruct; char charBuf[1024]; #endif /* APLUS_THREAD_SAFE_FUNCTIONS */ if(Et==aobj->t && 1==aobj->n && QS(*aobj->p)) name=XS(*aobj->p)->n; else if (Ct==aobj->t && 0n) name=(C *)aobj->p; else if (It==aobj->t && 1==aobj->n) {isint=1; uid=*aobj->p; } else ERROUT(ERR_DOMAIN); if (isint) { APLUS_GETPWUID(uid,&pwdStruct,charBuf,1024,pwd); } else { APLUS_GETPWNAM(name,&pwdStruct,charBuf,1024,pwd); } if (pwd) { A z=gv(Et,9); I *pp=z->p; pp[0]=(I)gsv(0,(pwd->pw_name)?pwd->pw_name:""); pp[1]=(I)gsv(0,(pwd->pw_passwd)?pwd->pw_passwd:""); pp[2]=(I)gi(pwd->pw_uid); pp[3]=(I)gi(pwd->pw_gid); #if defined(_AIX) || defined(__osf__) || defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__) pp[4]=(I)gsv(0,""); pp[5]=(I)gsv(0,""); #else pp[4]=(I)gsv(0,(pwd->pw_age)?pwd->pw_age:""); pp[5]=(I)gsv(0,(pwd->pw_comment)?pwd->pw_comment:""); #endif pp[6]=(I)gsv(0,(pwd->pw_gecos)?pwd->pw_gecos:""); pp[7]=(I)gsv(0,(pwd->pw_dir)?pwd->pw_dir:""); pp[8]=(I)gsv(0,(pwd->pw_shell)?pwd->pw_shell:""); R z; } R (A)gz(); } static A getusername() { struct passwd *pwd; #if defined(APLUS_THREAD_SAFE_FUNCTIONS) struct passwd pwdStruct; char charBuf[1024]; #endif /* APLUS_THREAD_SAFE_FUNCTIONS */ APLUS_GETPWUID(getuid(),&pwdStruct,charBuf,1024,pwd); if (pwd!=0 && pwd->pw_name) { R (A)gsv(0,pwd->pw_name); } else { R (A)gz(); } } static I syschdir(str)C *str; { I rc=chdir(str); if(!rc)setPWD(); R rc; } ENTRYPOINT I ep_syssleep(aobj)A aobj; { F fsecs; I isecs; if(!aobj->n)ERROUT(ERR_LENGTH); switch(aobj->t) { case It:isecs=*aobj->p;if(0>isecs)isecs=0;R sleep(isecs); case Ft: fsecs=*(F*)aobj->p; if(0.0>fsecs)fsecs=0.0; if (2147.0 0) ++count; R count; } void sysLoop() { int didwork; int saveZeroTimeout = dapZeroTimeout; dapZeroTimeout = 0; while (!q && dapbreak == 0) { dapselect(); sgnlproc(); chanproc(); timerproc(); slpqproc(); } didwork = 1; dapZeroTimeout = 1; while (didwork) { didwork = 0; dapselect(); didwork |= sgnlproc(); didwork |= chanproc(); didwork |= timerproc(); didwork |= slpqproc(); } dapZeroTimeout = saveZeroTimeout; } static EnumTable SignalEnums[] = { { SIGABRT, "SIGABRT", 0 }, { SIGALRM, "SIGALRM", 0 }, { SIGBUS, "SIGBUS", 0 }, { SIGCHLD, "SIGCHLD", 0 }, { SIGCONT, "SIGCONT", 0 }, { SIGFPE, "SIGFPE", 0 }, { SIGHUP, "SIGHUP", 0 }, { SIGILL, "SIGILL", 0 }, { SIGINT, "SIGINT", 0 }, { SIGIO, "SIGIO", 0 }, { SIGIOT, "SIGIOT", 0 }, { SIGKILL, "SIGKILL", 0 }, { SIGPIPE, "SIGPIPE", 0 }, { SIGPROF, "SIGPROF", 0 }, { SIGQUIT, "SIGQUIT", 0 }, { SIGSEGV, "SIGSEGV", 0 }, { SIGSTOP, "SIGSTOP", 0 }, { SIGTERM, "SIGTERM", 0 }, { SIGTRAP, "SIGTRAP", 0 }, { SIGTSTP, "SIGTSTP", 0 }, { SIGTTIN, "SIGTTIN", 0 }, { SIGTTOU, "SIGTTOU", 0 }, { SIGURG, "SIGURG", 0 }, { SIGUSR1, "SIGUSR1", 0 }, { SIGUSR2, "SIGUSR2", 0 }, { SIGVTALRM, "SIGVTALRM", 0 }, { SIGWINCH, "SIGWINCH", 0 }, { SIGXCPU, "SIGXCPU", 0 }, { SIGXFSZ, "SIGXFSZ", 0 }, { 0, (char *)0, 0 } }; static I sysKill(pid_, signal_) int pid_; A signal_; { int aSignal; if (SymbolToEnum(SignalEnums, signal_, &aSignal)) { (void)pa((V)signal_); q = ERR_DOMAIN; R 0; } else R (I)kill((pid_t)pid_, aSignal); } void eponymousInstall() { CX saveCx=Cx; Cx=cx("sys"); install((PFI)sysErrno, "errno", IV,0,0,0,0,0,0,0,0,0); install((PFI)sysErrsym, "errsym", A_,1,IV,0,0,0,0,0,0,0); install((PFI)sysaccess, "access", IV,2,A_,A_,0,0,0,0,0,0); install((PFI)agetdents, "agetdents", A_, 1, CP,0,0,0,0,0,0,0); install((PFI)alstat, "alstat", A_, 1, CA,0,0,0,0,0,0,0); install((PFI)amsync,"amsync", IV,2,A_,A_,0,0,0,0,0,0); install((PFI)areadlink, "areadlink", A_, 1, CP,0,0,0,0,0,0,0); install((PFI)aselect, "aselect", A_,4,IA,IA,IA,IA,0,0,0,0); install((PFI)astat, "astat", A_, 1, CA,0,0,0,0,0,0,0); install((PFI)syschdir, "chdir", IV,1,CP,0,0,0,0,0,0,0); install((PFI)chmod, "chmod", IV,2,CP,IV,0,0,0,0,0,0); install((PFI)chown, "chown", IV,3,CP,IV,IV,0,0,0,0,0); install((PFI)close, "close", IV,1,IV,0,0,0,0,0,0,0); install((PFI)closelog, "closelog", V_, 0,0,0,0,0,0,0,0,0); install((PFI)cpu, "cpu", A_,0,0,0,0,0,0,0,0,0); install((PFI)creat, "creat", IV,2,CP,IV,0,0,0,0,0,0); install((PFI)dup, "dup", IV,1,IV,0,0,0,0,0,0,0); install((PFI)dup2, "dup2", IV,2,IV,IV,0,0,0,0,0,0); install((PFI)exit, "exit", IV,1,IV,0,0,0,0,0,0,0); install((PFI)fchmod, "fchmod", IV,2,IV,IV,0,0,0,0,0,0); install((PFI)fchown, "fchown", IV,3,IV,IV,IV,0,0,0,0,0); install((PFI)sysfcntl, "fcntl", IV,3,IV,A_,IV,0,0,0,0,0); install((PFI)fflush_stdout, "fflush_stdout", IV,0,0,0,0,0,0,0,0,0); install((PFI)filesize, "filesize", A_,1,CP,0,0,0,0,0,0,0); install((PFI)sysflock, "flock", IV,2,IV,A_,0,0,0,0,0,0); install((PFI)fsync, "fsync", IV,1,IV,0,0,0,0,0,0,0); install((PFI)ftruncate, "ftruncate", IV, 2, IV, IV,0,0,0,0,0,0); install((PFI)sysgetdtablesize, "getdtablesize", IV,0,0,0,0,0,0,0,0,0); install((PFI)getgid, "getgid", IV, 0,0,0,0,0,0,0,0,0); install((PFI)getpid, "getpid", IV, 0,0,0,0,0,0,0,0,0); install((PFI)getppid, "getppid", IV, 0,0,0,0,0,0,0,0,0); install((PFI)getsockopt, "getsockopt", IV, 5, IV, IV, IV, IP, IP,0,0,0); install((PFI)gettod, "gettod", A_, 1, IA,0,0,0,0,0,0,0); install((PFI)getuid, "getuid", IV, 0,0,0,0,0,0,0,0,0); install((PFI)geteuid, "geteuid", IV, 0,0,0,0,0,0,0,0,0); install((PFI)getusername, "getusername", A_, 0,0,0,0,0,0,0,0,0); install((PFI)sysioctl, "ioctl", IV,3,IV,A_,IV,0,0,0,0,0); install((PFI)link, "link", IV,2,CP,CP,0,0,0,0,0,0); install((PFI)lseek, "lseek", IV,3,IV,IV,IV,0,0,0,0,0); install((PFI)mkdir, "mkdir", IV,2,CP,IV,0,0,0,0,0,0); install((PFI)mkts1, "mkts1", A_,1,A_,0,0,0,0,0,0,0); install((PFI)mkts1gmt, "mkts1gmt", A_,1,A_,0,0,0,0,0,0,0); install((PFI)pathfind, "pathfind", A_, 4, CP, CP, CP, IV,0,0,0,0); install((PFI)perror,"perror", V_,1,CP,0,0,0,0,0,0,0); install((PFI)read, "read", IV,3,IV,P_,IV,0,0,0,0,0); install((PFI)readenv,"readenv", A_, 1, CP,0,0,0,0,0,0,0); install((PFI)read, "readinto", IV,3,IV,IV,IV,0,0,0,0,0); install((PFI)readmat, "readmat", A_, 1, CP,0,0,0,0,0,0,0); install((PFI)rename, "rename", IV,2,CP,CP,0,0,0,0,0,0); install((PFI)rmdir, "rmdir", IV,1,CP,0,0,0,0,0,0,0); install((PFI)secs_in_epoch, "secs_in_epoch", IV,0,0,0,0,0,0,0,0,0); install((PFI)ep_setenv,"setenv", IV,1,CP,0,0,0,0,0,0,0); install((PFI)setsockopt, "setsockopt", IV, 5, IV, IV, IV, IP, IV,0,0,0); install((PFI)ep_syssleep, "sleep", IV,1,A_,0,0,0,0,0,0,0); install((PFI)symlink, "symlink", IV,2,CP,CP,0,0,0,0,0,0); install((PFI)sysgetdomainname, "getdomainname", A_,0,0,0,0,0,0,0,0,0); install((PFI)sysgethostname, "gethostname", A_,0,0,0,0,0,0,0,0,0); install((PFI)sysopen, "open", IV,3,A_,A_,IV,0,0,0,0,0); install((PFI)sysopenlog, "openlog", V_, 3, CA, A_, A_,0,0,0,0,0); install((PFI)syssyslog, "syslog", V_, 2, A_, CP,0,0,0,0,0,0); install((PFI)syst, "system", IV,1,CP,0,0,0,0,0,0,0); install((PFI)truncate, "truncate", IV, 2, CP, IV,0,0,0,0,0,0); install((PFI)ts, "ts", A_,0,0,0,0,0,0,0,0,0); install((PFI)tsgmt, "tsgmt", A_,0,0,0,0,0,0,0,0,0); install((PFI)ts1, "ts1", A_,1,IV,0,0,0,0,0,0,0); install((PFI)ts1gmt, "ts1gmt", A_,1,IV,0,0,0,0,0,0,0); install((PFI)tzset, "tzset", V_,0,0,0,0,0,0,0,0,0); install((PFI)umask, "umask", IV,1,IV,0,0,0,0,0,0,0); install((PFI)unlink, "unlink", IV,1,CP,0,0,0,0,0,0,0); install((PFI)updtime, "updtime", A_,1,CP,0,0,0,0,0,0,0); install((PFI)username, "username", A_, 1, IV,0,0,0,0,0,0,0); install((PFI)pwinfo, "pwinfo", A_, 1, A_,0,0,0,0,0,0,0); install((PFI)write, "write", IV,3,IV,P_,IV,0,0,0,0,0); install(zombiekiller, "zombiekiller", IV,0,0,0,0,0,0,0,0,0); install(sysKill, "kill", IV,2,IV,A_,0,0,0,0,0,0); Cx = saveCx; R; } aplus-fsf-4.22/src/cxsys/sfe.c0000644000265000001440000000467510772770354011727 /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /*********************************************************************\ * Source File: sockforkexec.c * Functions: sockforkexec() - Open bidirectional pipe, fork * and exec * Author: Charles A. Ocheret * Creation Date: Sat Jan 21 13:52:42 EST 1989 \*********************************************************************/ #include #include #include #include #include #include #include static void handler(fd) int fd; { char buf[256]; #ifndef HAVE_STRERROR extern char *sys_errlist[]; sprintf(buf, "handler: <%d>: %s\n", errno, sys_errlist[errno]); #else sprintf(buf, "handler: <%d>: %s\n", errno, strerror(errno)); #endif (void)write(fd, buf, strlen(buf)); } int sfe(name, argv) char *name; char *argv[]; { int fildes[2]; if (socketpair(PF_UNIX, SOCK_STREAM, 0, fildes) == -1) { fildes[0] = -1; } else { /* Fork new process */ #if defined(__sgi) switch (fork()) { #else switch (vfork()) { #endif case -1: /* Error */ fildes[0] = -1; (void)close(fildes[1]); break; case 0: /* Child process */ /* Close unneeded file descriptor */ (void)close(fildes[0]); /* Make socket the stdin of the child process */ (void)close(0); if (dup(fildes[1]) != 0) { /* handler(fildes[1]); */ _exit(1); } /* Make socket the stdout of the child process */ (void)close(1); if (dup(fildes[1]) != 1) { /* handler(fildes[1]); */ _exit(1); } (void)close(fildes[1]); /* Exec the new program */ (void)execvp(name, argv); /* Failed to exec */ handler(1); _exit(1); break; default: /* Parent process */ (void)close(fildes[1]); break; } } return fildes[0]; } void sfeInstall() { CX saveCx=Cx; Cx=cx("sys"); install((PFI)sfe, "sfe", IV,2,CP,IP,0,0,0,0,0,0); Cx = saveCx; return; } aplus-fsf-4.22/src/cxsys/asock.c0000644000265000001440000002263710772770354012250 /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #include #include #include #include #include #include #include #include #include #if defined(_AIX) || defined(__osf__) || defined(linux) #include #include #else #include #endif #include #include #include static struct timeval timeout = { 0, 0 }; /* * Handler for SIGPIPE */ static void sigpipehandler(i) int i; { return; /* Do nothing */ } /* * Opens a socket, binds it to a specified port and enables connections * Returns the file descriptor of the listening socket or -1 on error */ I socklisten(I port) { int sock; struct sockaddr_in sin; int toggle; /* Ignore signals from closing of sockets */ aplus_signal(SIGPIPE, sigpipehandler); /* Open a socket */ if ((sock = socket(AF_INET, SOCK_STREAM, 0)) == -1) { (void)perror("socket"); return -1; } /* make it ok to reuse the address */ toggle = 1; if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char *)(&toggle), sizeof(toggle)) < 0) { (void)perror("setsockopt"); } /* Bind the socket to a port */ sin.sin_port = htons((u_short)port); sin.sin_family = AF_INET; sin.sin_addr.s_addr = INADDR_ANY; if (bind(sock, (struct sockaddr *)&sin, sizeof(sin))) { (void)perror("bind"); (void)close(sock); return -1; } /* Listen at the port for connections */ if (listen(sock, 5)) { perror("listen"); (void)close(sock); return -1; } return (I)sock; } /* * Accepts connections to the specified listening socket. * If waitflag is 1 then sockaccept() blocks until a connection is made * otherwise it returns immediately. If a connection is made then * the file descriptor of the connected socket is returned. If no * connection was pending and waiflag is 0 then a -2 is returned. * A -1 is returned on error. */ I sockaccept(I sock, I waitflag) { int newsock; fd_set afd; int toggle; FD_ZERO(&afd); FD_SET(sock, &afd); if (!waitflag) { if (select(FD_SETSIZE, &afd, NULL, NULL, &timeout) < 0) { (void)perror("select"); return -1; } } if (FD_ISSET((int)sock, &afd)) { if ((newsock = accept((int)sock, NULL, NULL)) == -1) { (void)perror("accept"); return -1; } toggle = 1; if (setsockopt(newsock, SOL_SOCKET, SO_KEEPALIVE, (char *)(&toggle), sizeof(toggle)) < 0) { (void)perror("setsockopt"); } } else { return newsock = -2; } return (I)newsock; } /* * Make socket blocking or non-blocking * blockflag = 1 */ I sockblock(I sock, I blockflag) { int bf = blockflag ? 0 : 1; return ioctl((int)sock, FIONBIO, &bf); } /* * Connect to a port on a host where there is expected to be a listening * server. Returns the file descriptor of the socket or -1 on failure. */ I sockconnect(char *host, I port) { int sock; struct sockaddr_in server; int toggle; struct hostent *hp=0; #if defined(APLUS_THREAD_SAFE_FUNCTIONS) struct hostent hostentStruct; char charBuf[1024]; int err; #endif /* Open a socket */ if ((sock = socket(AF_INET, SOCK_STREAM, 0)) == -1) { (void)perror("socket"); return -1; } /* Connect to a server socket */ APLUS_GETHOSTBYNAME(host,&hostentStruct,charBuf,1024,&err,hp); if (hp==0) { (void)perror("gethostbyname"); (void)close(sock); return -1; } (void)bcopy((char *)hp->h_addr, (char *)&server.sin_addr, hp->h_length); server.sin_port = htons((u_short)port); server.sin_family = AF_INET; if (connect(sock, (struct sockaddr *)&server, sizeof(server))) { (void)perror("connect"); (void)close(sock); return -1; } toggle = 1; if (setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, (char *)(&toggle), sizeof(toggle)) < 0) { (void)perror("setsockopt"); } return (I)sock; } I awrite(I fd, A a) { int cnt; I c; char *cp = (char *)a; int bytes; switch (a->t) { case Ct: bytes = AH + a->n*sizeof(C) + 1; break; case It: bytes = AH + a->n*sizeof(I); break; case Ft: bytes = AH + a->n*sizeof(F); break; default: bytes = 0; break; }; if (c = a->c) a->c = 0; while (bytes > 0) { if ((cnt = write((int)fd, cp, bytes)) == -1) { if (errno != EWOULDBLOCK) { if (c) a->c = c; return -1; /* ERROR */ } else { if (c) a->c = c; return -2; /* WOULD BLOCK */ } } else { cp += cnt; bytes -= cnt; } } if (c) a->c = c; return 0; /* OK */ } I aread(I fd, I waitflag) { A z; struct a a; fd_set rfd; char *cp = (char *)&a; int bytes; int cnt; FD_ZERO(&rfd); FD_SET((int)fd, &rfd); if (!waitflag) { if (select(FD_SETSIZE, &rfd, NULL, NULL, &timeout) < 0) { (void)perror("select"); return gz(); } } if (FD_ISSET((int)fd, &rfd)) { bytes = AH; while (bytes > 0) { if ((cnt = read((int)fd, cp, bytes)) == -1) { if (errno != EWOULDBLOCK) return gz(); } else if (cnt == 0) { /* EOF */ return gz(); } else { cp += cnt; bytes -= cnt; } } if ((z = ga(a.t, a.r, a.n, a.d)) != NULL) { switch (a.t) { case Ct: bytes = a.n*sizeof(C) + 1; break; case It: bytes = a.n*sizeof(I); break; case Ft: bytes = a.n*sizeof(F); break; default: bytes = 0; break; } cp = (char *)z->p; while (bytes > 0) { if ((cnt = read((int)fd, cp, bytes)) == -1) { if (errno != EWOULDBLOCK) { dc(z); return gz(); } } else if (cnt == 0) { /* EOF */ dc(z); return gz(); } else { cp += cnt; bytes -= cnt; } } } } else { return gz(); } return (I)z; } I areadstat(I fd, I waitflag, A stat) { A z; struct a a; fd_set rfd; char *cp = (char *)&a; int bytes; int cnt; FD_ZERO(&rfd); FD_SET((int)fd, &rfd); if (!waitflag) { if (select(FD_SETSIZE, &rfd, NULL, NULL, &timeout) < 0) { (void)perror("select"); *stat->p = -1; return gz(); } } if (FD_ISSET((int)fd, &rfd)) { *stat->p = 0; bytes = AH; while (bytes > 0) { if ((cnt = read((int)fd, cp, bytes)) == -1) { if (errno != EWOULDBLOCK) { *stat->p = -1; return gz(); } } else if (cnt == 0) { /* EOF */ *stat->p = -1; return gz(); } else { cp += cnt; bytes -= cnt; } } if ((z = ga(a.t, a.r, a.n, a.d)) != NULL) { switch (a.t) { case Ct: bytes = a.n*sizeof(C) + 1; break; case It: bytes = a.n*sizeof(I); break; case Ft: bytes = a.n*sizeof(F); break; default: bytes = 0; break; } cp = (char *)z->p; while (bytes > 0) { if ((cnt = read((int)fd, cp, bytes)) == -1) { if (errno != EWOULDBLOCK) { dc(z); *stat->p = -1; return gz(); } } else if (cnt == 0) { /* EOF */ dc(z); *stat->p = -1; return gz(); } else { cp += cnt; bytes -= cnt; } } } } else { *stat->p = -2; /* WOULD BLOCK */ return gz(); } return (I)z; } I areadwait(I fd, I sec, I usec) { struct timeval timeout; A z; struct a a; fd_set rfd; char *cp = (char *)&a; int bytes; int cnt; int num; timeout.tv_sec = sec; timeout.tv_usec = usec; FD_ZERO(&rfd); FD_SET((int)fd, &rfd); if ((num = select(FD_SETSIZE, &rfd, NULL, NULL, &timeout)) < 0) { if (errno != EINTR) (void)perror("select"); return gz(); } if (num == 0) return gz(); if (FD_ISSET((int)fd, &rfd)) { bytes = AH; while (bytes > 0) { if ((cnt = read((int)fd, cp, bytes)) == -1) { if (errno != EWOULDBLOCK) { if (bytes != AH) { (void)perror("areadwait: corrupted"); close(fd); } return gz(); } } else if (cnt == 0) { /* EOF */ return gz(); } else { cp += cnt; bytes -= cnt; } } if ((z = ga(a.t, a.r, a.n, a.d)) != NULL) { switch (a.t) { case Ct: bytes = a.n*sizeof(C) + 1; break; case It: bytes = a.n*sizeof(I); break; case Ft: bytes = a.n*sizeof(F); break; default: bytes = 0; break; } cp = (char *)z->p; while (bytes > 0) { if ((cnt = read((int)fd, cp, bytes)) == -1) { if (errno != EWOULDBLOCK) { (void)perror("areadwait: corrupted"); close(fd); dc(z); return gz(); } } else if (cnt == 0) { /* EOF */ dc(z); return gz(); } else { cp += cnt; bytes -= cnt; } } } else { (void)perror("areadwait: corrupted"); close(fd); return gz(); } } else { return gz(); } return (I)z; } void asockInstall() { CX saveCx=Cx; Cx=cx("sys"); install(socklisten, "socklisten", IV,1,IV,0,0,0,0,0,0,0); install(sockaccept, "sockaccept", IV,2,IV,IV,0,0,0,0,0,0); install(sockblock, "sockblock", IV,2,IV,IV,0,0,0,0,0,0); install(sockconnect, "sockconnect", IV,2,CP,IV,0,0,0,0,0,0); install(awrite, "awrite", IV,2,IV,A_,0,0,0,0,0,0); install(aread, "aread", A_,2,IV,IV,0,0,0,0,0,0); install(areadstat, "areadstat", A_,3,IV,IV,A_,0,0,0,0,0); install(areadwait, "areadwait", A_,3,IV,IV,IV,0,0,0,0,0); Cx = saveCx; return; } aplus-fsf-4.22/src/cxsys/millisleep.c0000644000265000001440000000130110772770354013270 /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #include #include millisleep(i) int i; { struct timeval tv; tv.tv_sec = 0; tv.tv_usec = i*1000; select(0, NULL, NULL, NULL, &tv); } aplus-fsf-4.22/src/cxsys/microsleep.c0000644000265000001440000000150110772770354013275 /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #include #include int microsleep(int i) { struct timeval tv; if(i>1000000) { tv.tv_sec = (int) i/1000000; tv.tv_usec = i - tv.tv_sec*1000000; } else { tv.tv_sec = 0; tv.tv_usec = i; } return select(0, NULL, NULL, NULL, &tv); } aplus-fsf-4.22/src/cxsys/impexp.c0000664000265000001440000006116610772770354012454 /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #include #include #include #include #include #include #include #include #if defined(__cplusplus) #include #else #include #endif #if defined(__alpha) || defined(_WINDOWS) || defined(__i386) || defined(__ia64) #define MS_LITTLE_ENDIAN 1 #endif #if defined(__alpha) || ( defined(__sgi) && (_MIPS_SZLONG == 64)) || defined(__ia64) #define MS_64BIT 1 #endif /* Endian conversion routines */ static void ndn16copy(char *from, char *to, int n) { for(;n--;from+=2,to+=2) { to[1]=from[0];to[0]=from[1]; } } static void ndn32copy(char *from, char *to, int n) { for(;n--;from+=4,to+=4) { to[3]=from[0];to[2]=from[1];to[1]=from[2];to[0]=from[3]; } } static void ndn64copy(char *from, char *to, int n) { for(;n--;from+=8,to+=8) { to[7]=from[0];to[6]=from[1];to[5]=from[2];to[4]=from[3]; to[3]=from[4];to[2]=from[5];to[1]=from[6];to[0]=from[7]; } } static long AbortNever=0; static long *AbortFlagPtr=&AbortNever; /* Description of ExportAObject() sizepass() and fillpass() * ------------------------------------------------------- * This is to convert from A format data to Msvp format data. * The A object is converted into a character vector suitable * for transmission through msvp. The return is a 1 or 2 element * enclosed vector. The first element is a scaler integer * completion code. The second element, if present, is a character * vector. The second element is only present when the first * element is the scalar integer zero. */ /* ImportAObject() * * In a single traversal of the object, it should be possible to * convert from the CDR format to A objects. The header of the * CDR message should indicate that it is of dense form. Pointer * form messages are rejected. The CDRDLEN field is used to * index into the message and locate the data that will fill * the a objects described by the descriptors. Each descriptor * is handled in the extract pass function. If the extract pass * is called for a general array descriptor, then it will be called * recursively for each element of the general array. The conversion * from APL2 types to A types is as follows: B1, B4 and B8 are * converted to It. I2 and I4 are converted to It. E4 and E8 are * converted to Ft. E16 is rejected. E4 and E8 are assumed to be in * IEEE floating point format. J8, J16 and J32 are rejected. C1 * is converted to Ct. C4 is rejected. A8 is rejected. Pn is * rejected. Zn is rejected. X0 is ignored. G0 is converted into Et. */ /* addons assume CDRXRHOLEN and CDRRHOLEN less than or equal sizeof(I) */ #define CDRXRHOLEN 4 #define CDRRTLEN 1 #define CDRRLLEN 1 #define CDRRANKLEN 2 #define CDRRHOLEN 4 #define CDRFLAGSLEN 1 #define CDRLENLEN 3 #define CDRMEGAHDRLENLEN 4 #define CDRFLAGSMAGIC 0x80 #define CDRFLAGS64 0x01 #define CDRFLAGSLITTLE 0x02 #define CDRFLAGSMEGAHDR 0x04 #define MINIMPLEN 4 #define IMPRANK 1 #define ILEN sizeof(I) #define ISMEGAHDR(hsz) ((hsz) & 0xff000000) /* * This is a 64BIT-safe export struct header. */ typedef struct impexpHeader { int xrho; char rt; char rl; short rank; int d[MAXR]; } impexpHeader; /* Export generates I-8 integers exclusively in 64-bit mode , however, Import will read I-2, I-4, or I-8. Thus Import should read byte streams exported by 32=bit versions of A+ */ static I sizepass(a, hszp, dszp, long_bytes) A a; I *hszp, *dszp; long long_bytes; { I t; if (QS(a)) { /* turn symbol into character vector */ S s = XS(a); *hszp += (I)(CDRXRHOLEN+CDRRTLEN+CDRRLLEN+CDRRANKLEN+CDRRHOLEN); *dszp += strlen(s->n); return (I)0; } else if (QA(a)) { *hszp += (I)(CDRXRHOLEN+CDRRTLEN+CDRRLLEN+CDRRANKLEN) + (a->r * (I)CDRRHOLEN); if ((t = a->t) == Et) { I rc, *p, n, i; if ((n = a->n) == (I)0) { /*descriptor length of prototype */ *hszp += (I)(2*(CDRXRHOLEN+CDRRTLEN+CDRRLLEN+CDRRANKLEN)+CDRRHOLEN); return (I)0; } p = a->p; for (i = (I)0; i < n&&!*AbortFlagPtr; i++) { if (rc = sizepass((A)p[i], hszp, dszp, long_bytes)) return rc; } return (I)(*AbortFlagPtr)?56:0; } switch (t) { case It: { #ifdef MS_64BIT /* we going to bail out of the export here if we don't like the size of the values stuffed in 4 byte longs */ I j; /* check for data overflow now */ if(long_bytes < sizeof(I)) { for(j=0; j < a->n; j++) if(a->p[j] > INT_MAX || a->p[j] < INT_MIN) { fprintf(stderr, "\343 Error export value > 32 bits (%ld)\n", a->p[j]); return (I)54; /* exit(54) */ } } #endif *dszp += long_bytes * a->n; return (I)0; } case Ft: *dszp += (I)sizeof(F) * a->n; return (I)0; case Ct: *dszp += a->n; return (I)0; } return (I)54; } else { return (I)55; } } static I sizepasscover(a, hszp, dszp, long_bytes) A a; I *hszp, *dszp; long long_bytes; { I rc=sizepass(a, hszp, dszp, long_bytes); if (ISMEGAHDR(*hszp)) (*hszp) += CDRMEGAHDRLENLEN; return(rc); } static void fillpass(a, hpp, dpp, trp, for_a, long_bytes) A a; char **hpp, **dpp; char *trp; I for_a; long long_bytes; { /* cokelley - needed for little endian hack below */ int i ; char *hp, *dp; I xrho; I t, dlen=0, hlen=0; char rt='\0', rl='\0'; impexpHeader h; hp = *hpp; dp = *dpp; if (QS(a)) { /* turn symbol into character vector */ S s = XS(a); xrho = strlen(s->n); /* write the header */ h.xrho = htonl(xrho); h.rt = (for_a ? 'S' : 'C'); h.rl = 1; h.rank = htons((short)1); h.d[0] = htonl(xrho); hlen = CDRXRHOLEN+CDRRTLEN+CDRRLLEN+CDRRANKLEN+CDRRHOLEN; bcopy((char*)&h,hp,hlen); hp+=hlen; /* CDRDSECT */ if (trp != (char *)(0)) { char *src, *end_dp; for (src = s->n, end_dp = dp + xrho; dp != end_dp; *dp++ = trp[(unsigned)(*src++ & 0xff)]); } else { bcopy(s->n, dp, (I)xrho); dp += xrho; } *hpp = hp; *dpp = dp; return; } xrho = a->n; t = a->t; switch (t) { /* changed the rl value for type It */ case It: rt = 'I'; rl = long_bytes; dlen = (I)rl * xrho; break; case Ft: rt = 'E'; rl = sizeof(F); dlen = (I)rl * xrho; break; case Ct: rt = 'C'; rl = sizeof(C); dlen = (I)rl * xrho; break; case Et: rt = 'G'; rl = 0; break; } h.xrho = htonl(xrho); h.rt = rt; h.rl = rl; h.rank = htons((short)a->r); #if defined(MS_64BIT) || defined(MS_LITTLE_ENDIAN) /* CDRRHO */ for(i=0; i< a->r; i++) { h.d[i] = htonl(a->d[i]); } hlen = CDRXRHOLEN+CDRRTLEN+CDRRLLEN+CDRRANKLEN+a->r*CDRRHOLEN; bcopy((char*)&h,hp,hlen); hp+=hlen; #else /* 32-bit big endian optimization for eficiency so that not to copy a->d twice.*/ hlen = CDRXRHOLEN+CDRRTLEN+CDRRLLEN+CDRRANKLEN; bcopy((char*)&h,hp,hlen); hp+=hlen; hlen = (I)CDRRHOLEN * a->r; bcopy((char *)(a->d), hp, hlen); hp += hlen; #endif if (t == Et) { I i; if (xrho == (I)0) { h.xrho = htonl(1); h.rt = 'G'; h.rl = 0; h.rank = 0; hlen = CDRXRHOLEN+CDRRTLEN+CDRRLLEN+CDRRANKLEN; bcopy((char*)&h,hp,hlen); hp+=hlen; h.xrho = 0; h.rt = 'I'; h.rl = (char)long_bytes; h.rank = htons(1); h.d[0] = htonl(xrho); hlen = CDRXRHOLEN+CDRRTLEN+CDRRLLEN+CDRRANKLEN +CDRRHOLEN; bcopy((char*)&h,hp,hlen); hp+=hlen; } *hpp = hp; *dpp = dp; for (i = 0; i < xrho&&!*AbortFlagPtr; i++) { fillpass((A)a->p[i], hpp, dpp, trp, for_a,long_bytes); } return; } if ((t == Ct) && (trp != (char *)(0))) { char *src, *end_dp; for (src = (char *)(a->p), end_dp = dp + xrho; dp != end_dp; *dp++ = trp[(unsigned)(*src++ & 0xff)]); } #ifdef MS_64BIT else if(t == It && (long_bytes < sizeof(I))) { /* 32 bit backward compatibility mode */ #ifndef MS_LITTLE_ENDIAN hlen = sizeof(I)-long_bytes; #else hlen = 0; #endif for(i=0; i < xrho; i++) { bcopy((char *)(a->p+i)+hlen, dp, long_bytes); dp += long_bytes; } } #endif else { bcopy((char *)(a->p), dp, (I)dlen); dp += dlen; } *hpp = hp; *dpp = dp; return; } /* The extract pass function takes a pointer the end of the CDR * format buffer and pointers to pointers into the header and * data sections of the CDR buffer. It returns an A object that * is the importation of its part of the CDR format buffer. If * the extraction fails, a zero pointer is returned. The extract * pass handles general arrays by calling itself recursively. If * One of these calls returns zero then extract pass frees its A * object and returns zero to its caller. */ static A extractpass(hpp, dpp, endp, erp, trp, swap) char **hpp; char **dpp; char *endp; I *erp; char *trp; int swap; { char *hp, *dp; I xrho=0, rt, rl, rank, hlen; I i; A a; I d[MAXR]; impexpHeader h; /* process descriptor into ga call */ hp = *hpp; if ((endp - hp) < 8) { *erp = (I)1; return (A)0; } hlen = CDRXRHOLEN+CDRRTLEN+CDRRLLEN+CDRRANKLEN; bcopy(hp,(char*)&h,hlen); hp+=hlen; xrho = ntohl(h.xrho); rt = h.rt; rl = h.rl; rank = ntohs(h.rank); if (rank > MAXR) { *erp = (I)1; return (A)0; } if ((endp - hp) < (CDRRHOLEN * rank)) { *erp = (I)1; return (A)0; } #if defined(MS_64BIT) || defined(MS_LITTLE_ENDIAN) for(i=0; i < rank; i++) { d[i] =ntohl((int)(*(int *)hp)); hp += CDRRHOLEN; } for(i=rank; i < MAXR; i++) d[i] = 0; #else /* this is more efficient in this case */ bcopy(hp, (char *)(d), 4 * rank); hp += 4 * rank; bzero((char *)(d) + (4 * rank), 4 * (MAXR - rank)); #endif *hpp = hp; if ((rt == 'P') || (rt == 'J') || (rt == 'Z') || ((rt == 'C') && (rl == 4)) || ((rt == 'E') && (rl == 16))) { /* nonce error */ *erp = (I)1; return (A)0; } if (dpp == (char **)(0)) { /* prototype */ if ((rt == 'G') && (rl== 0)) { for (i = 0; i < xrho; i++) { (void)extractpass(hpp, dpp, endp, erp, trp,swap); if (*erp != (I)0) break; } return (A)0; } if (((rt == 'X') && (rl == 0)) || ((rt == 'I') && ((rl == 2) || (rl == 4) #ifdef MS_64BIT || (rl == 8) #endif )) || ((rt == 'B') && ((rl == 1) || (rl == 4) || (rl == 8))) || ((rt == 'E') && ((rl == 4) || (rl == 8))) || ((rt == 'C') && (rl == 1)) || ((rt == 'S') && (rl == 1))) { return (A)0; } *erp = 1; return (A)0; } if ((rt == 'G') && (rl == 0)) { A *ap; if (xrho == 0) { /* do the prototype */ (void)extractpass(hpp, (char **)(0), endp, erp, trp,swap); if (*erp != (I)0) { return (A)0; } } a = ga(Et, rank, xrho, d); ap = (A *)(a->p); bzero((char *)ap, sizeof(I) * xrho); for (i = 0; i < xrho; i++) { if ((ap[i] = extractpass(hpp, dpp, endp, erp, trp,swap)) == (A)0) { if (*erp != 0) { dc(a); return (A)0; } /* type X0 filler */ i--; } } return a; } dp = *dpp; #ifdef MS_64BIT if ((rt == 'I') && (rl == 8)) { C *ap; if ((endp - dp) < (rl * xrho)) { *erp = 1; return (A)0; } a = ga(It, rank, xrho, d); ap = (C *)(a->p); if(swap) ndn64copy(dp, ap, xrho); else bcopy(dp, ap, 8 * xrho); dp += 8 * xrho; *dpp = dp; return a; } if ((rt == 'I') && (rl == 4)) { I *ap; int itmp; if ((endp - dp) < (4 * xrho)) { *erp = 1; return (A)0; } a = ga(It, rank, xrho, d); ap = (I *)(a->p); for (i = 0; i < xrho; i++) { if(swap) ndn32copy(dp, (char *)&itmp, 1); else bcopy(dp, (char*)&itmp, 4); ap[i] = itmp; dp += 4; } *dpp = dp; return a; } #else if ((rt == 'I') && (rl == 4)) { C *ap; if ((endp - dp) < (4 * xrho)) { *erp = 1; return (A)0; } a = ga(It, rank, xrho, d); ap = (C *)(a->p); if(swap) ndn32copy(dp, ap, xrho); else bcopy(dp, ap, 4 * xrho); dp += 4 * xrho; *dpp = dp; return a; } #endif if ((rt == 'I') && (rl == 2)) { I *ap; short stmp; if ((endp - dp) < (2 * xrho)) { *erp = 1; return (A)0; } a = ga(It, rank, xrho, d); ap = (I *)(a->p); for (i = 0; i < xrho; i++) { if(swap) ndn16copy(dp, (char *)&stmp, 1); else bcopy(dp, (char*)&stmp, 2); ap[i] = stmp; dp += 2; } *dpp = dp; return a; } if ((rt == 'E') && (rl == 4)) { F *ap; float ftmp; if ((endp - dp) < (rl * xrho)) { *erp = 1; return (A)0; } a = ga(Ft, rank, xrho, d); ap = (F *)(a->p); for (i = 0; i < xrho; i++) { if(swap) ndn32copy(dp, (char *)&ftmp, 1); else bcopy(dp, (char*)&ftmp, 4); ap[i] = ftmp; dp += rl; } *dpp = dp; return a; } if ((rt == 'E') && (rl == 8)) { C *ap; if ((endp - dp) < (rl * xrho)) { *erp = 1; return (A)0; } a = ga(Ft, rank, xrho, d); ap = (C *)(a->p); if(swap) ndn64copy(dp, ap, xrho); else bcopy(dp, ap, 8 * xrho); dp += 8 * xrho; *dpp = dp; return a; } if ((rt == 'C') && (rl == 1)) { C *ap; if ((endp - dp) < xrho) { *erp = 1; return (A)0; } a = ga(Ct, rank, xrho, d); ap = (C *)(a->p); if (trp != (char *)(0)) { for (i = 0; i < xrho; i++) { ap[i] = trp[(unsigned)(*dp++ & 0xff)]; } } else { bcopy(dp, ap, xrho); dp += xrho; } *dpp = dp; return a; } if ((rt == 'S') && (rl == 1)) { C *ap; I s; if ((endp - dp) < xrho) { *erp = 1; return (A)0; } a = ga(Ct, 1, xrho, d); ap = (C *)(a->p); if (trp != (char *)(0)) { for (i = 0; i < xrho; i++) { ap[i] = trp[(unsigned)(*dp++ & 0xff)]; } } else { bcopy(dp, ap, xrho); dp += xrho; } *dpp = dp; s = MS(si(ap)); dc(a); return (A)s; } if ((rt == 'B') && (rl == 8)) { I *ap; if ((endp - dp) < xrho) { *erp = 1; return (A)0; } a = ga(It, rank, xrho, d); ap = (I *)(a->p); for (i = 0; i < xrho; i++) { ap[i] = *dp; dp += 1; } *dpp = dp; return a; } if ((rt == 'B') && (rl == 4)) { I *ap; I m; if ((endp - dp) < (xrho + 1)/2) { *erp = 1; return (A)0; } a = ga(It, rank, xrho, d); ap = (I *)(a->p); for (m = 0, i = 0; i < xrho; i++) { m = rl * (1 - (i % 2)); ap[i] = (*dp >> m) & 0x0f; dp += (m == 0); } /* skip partially used byte */ if (m != 0) dp++; *dpp = dp; return a; } if ((rt == 'B') && (rl == 1)) { I *ap; I m; if ((endp - dp) < (xrho + 7)/8) { *erp = 1; return (A)0; } a = ga(It, rank, xrho, d); ap = (I *)(a->p); for (m = 0, i = 0; i < xrho; i++) { m = 7 - (i % 8); ap[i] = (*dp >> m) & 0x01; dp += (m == 0); } /* skip partially used byte */ if (m != 0) dp++; *dpp = dp; return a; } if ((rt == 'X') && (rl == 0)) { if ((endp - dp) < xrho) { *erp = 1; return (A)0; } dp += xrho; *dpp = dp; return (A)0; } *erp = 1; return (A)0; } /* ExportAObject * * Creates a Msvp format char vector out of an A object. * * aobj is the A object to be abused. trp is a translation vector, which * must have length of 256, or be NULL. for_a is a boolean flag, if 0 A * symbols are translated to character strings, 1 uses an extention to * Msvp format. * * Result is a pointer to the character vector created. *plen is set to * the length of that vector, which may have embedded nulls. In case of * error, the result is NULL, and *plen is an error code. * */ SUBROUTINE void FillExportBuffer(aobj, hp, hsz, trp, for_a, long_bytes) A aobj; char *hp, *trp; I hsz, for_a, long_bytes; { char *dp = hp + hsz; int sz; unsigned char flag = CDRFLAGSMAGIC; /* CDRFLAGS mark export header indicating 64 or 32 bit longs and endiness */ /* MEGAHDR flag. hsz already contains extra space, if needed. */ if (ISMEGAHDR(hsz)) flag |= CDRFLAGSMEGAHDR; #ifdef MS_64BIT if(long_bytes == 8) flag |= CDRFLAGS64; #endif #ifdef MS_LITTLE_ENDIAN flag |= CDRFLAGSLITTLE; #endif *hp = flag; hp += CDRFLAGSLEN; if (ISMEGAHDR(hsz)) { bzero(hp, CDRLENLEN); hp += CDRLENLEN; sz=htonl(hsz); bcopy((char *)(&sz), hp, CDRMEGAHDRLENLEN); hp += CDRMEGAHDRLENLEN; } else { sz = htonl(hsz); /* CDRDLEN */ bcopy(((char *)(&sz))+1, hp, CDRLENLEN); hp += CDRLENLEN; } fillpass(aobj, &hp, &dp, trp, for_a, long_bytes); } #ifdef __cplusplus extern "C" char *ExportAObject(A,char *,I, I*); #endif char * ExportAObject(aobj, trp, for_a, plen) A aobj; char *trp; I for_a; I *plen; { char *cvp=NULL; /* the character vector result */ /* char *hp, *dp; */ I hsz, dsz; AbortFlagPtr = &AbortNever; /* set flagptr to static, to not abort */ hsz = CDRFLAGSLEN+CDRLENLEN; dsz = 0; /* the constant x last parameter in sizepass and fillExportBuffer forces exported longs to be x bytes */ if ((*plen = sizepasscover(aobj, &hsz, &dsz, 4)) != 0) return(NULL); *plen=hsz+dsz; /* cvp=(char *) malloc(*plen);*/ cvp=(C *)balloc(*plen); FillExportBuffer(aobj, cvp, hsz, trp, for_a, 4); return(cvp); } I ExportAObjectSizePass(aobj, trp, for_a, phsz, pdsz) A aobj; char *trp; I for_a; I *phsz, *pdsz; { I rc; AbortFlagPtr = &AbortNever; /* set flagptr to static, to not abort */ *phsz=4; *pdsz=0; /* the constant x last parameter in sizepass and fillExportBuffer forces exported longs to be x bytes */ if ((rc = sizepasscover(aobj, phsz, pdsz,4)) != 0) { return(rc); } return(0); } I ExportAObjectFillPass(aobj, trp, for_a, hsz, cvp) A aobj; char *trp; I for_a; int hsz; char *cvp; { FillExportBuffer(aobj, cvp, hsz, trp, for_a, 4); return(0); } A AExportAObject(aobj, trp, for_a, plen) A aobj; char *trp; I for_a; I *plen; { A result=NULL; /* the A object result */ I hsz, dsz; AbortFlagPtr=&q; /* set AbortFlagPtr to recognize SIGINT via global q. */ hsz = CDRFLAGSLEN+CDRLENLEN; dsz = 0; /* the constant x last parameter in sizepass and fillExportBuffer forces exported longs to be x bytes */ if ((*plen = sizepasscover(aobj, &hsz, &dsz, 4)) != 0) return(NULL); *plen=hsz+dsz; result=gv(Ct,*plen); FillExportBuffer(aobj, (char *)result->p, hsz, trp, for_a, 4); if(*AbortFlagPtr){dc(result);return(NULL);} return(result); } #ifdef MS_64BIT char * Export64AObject(aobj, trp, for_a, plen) A aobj; char *trp; I for_a; I *plen; { char *cvp=NULL; /* the character vector result */ /* char *hp, *dp; */ I hsz, dsz; AbortFlagPtr = &AbortNever; /* set flagptr to static, to not abort */ hsz = CDRFLAGSLEN+CDRLENLEN; dsz = 0; /* the constant x last parameter in sizepass and fillExportBuffer forces exported longs to be x bytes */ if ((*plen = sizepasscover(aobj, &hsz, &dsz, 8)) != 0) return(NULL); *plen=hsz+dsz; cvp=(char *) malloc(*plen); FillExportBuffer(aobj, cvp, hsz, trp, for_a, 8); return(cvp); } A AExport64AObject(aobj, trp, for_a, plen) A aobj; char *trp; I for_a; I *plen; { A result=NULL; /* the A object result */ I hsz, dsz; AbortFlagPtr=&q; /* set AbortFlagPtr to recognize SIGINT via global q. */ hsz = CDRFLAGSLEN+CDRLENLEN; dsz = 0; /* the constant x last parameter in sizepass and fillExportBuffer forces exported longs to be x bytes */ if ((*plen = sizepasscover(aobj, &hsz, &dsz, 8)) != 0) return(NULL); *plen=hsz+dsz; result=gv(Ct,*plen); FillExportBuffer(aobj, result->p, hsz, trp, for_a, 8); if(*AbortFlagPtr){dc(result);return(NULL);} return(result); } #endif /* ImportAObject * * Creates an A object out of Msvp format char vector * * cvp points to the beginning of the msvp vector. cvlen is the length * of the vector. trp is a translation vector, which must have length * of 256, or be NULL. * * Result is A object created, or (A)0 in case of error. * */ #ifdef __cplusplus extern "C" A ImportAObject(C *,I,C*); #endif A ImportAObject(cvp, cvlen, trp) char *cvp; I cvlen; char *trp; { A result; /* will be (A)0 if an error is detected */ char *endp; char *hp, *dp; I hsz, rc=0; char flag; int sz=0; int swap=0; if (MINIMPLEN>cvlen) return((A)0); hp = cvp; endp = cvp + cvlen; flag = *hp; if ((flag&0xf8) != CDRFLAGSMAGIC) return ((A)0); /* 0xf8 == 11111000 */ /* Do not accept 64 bit header if we are NOT 64 bit!. */ #if !defined(MS_64BIT) if (flag&CDRFLAGS64) return ((A)0); #endif /* Determine if we need to swap data bytes */ #if defined(MS_LITTLE_ENDIAN) if ((flag&CDRFLAGSLITTLE)==0) swap=1; #else if (flag&CDRFLAGSLITTLE) swap=1; #endif hp += CDRFLAGSLEN; /* Read header size. This is in next CDRLENLEN (3) bytes unless MEGAHDR * flag is set. In that case, skip CDRLENLEN bytes and read following * CDRMEGAHDRLENLEN (4) bytes. */ if (flag&CDRFLAGSMEGAHDR) { hp+=CDRLENLEN; bcopy(hp, ((char *)(&sz)), CDRMEGAHDRLENLEN); hsz = ntohl(sz); hp+= CDRMEGAHDRLENLEN; } else { bcopy(hp, ((char *)(&sz))+1, CDRLENLEN); hsz = ntohl(sz); hp += CDRLENLEN; } dp = cvp + hsz; result = extractpass(&hp, &dp, endp, &rc, trp, swap); return(result); } /*********************************************** * * Entrypoints * */ ENTRYPOINT A ep_ExportAObject(aobj, tr, for_a) A aobj; A tr; I for_a; { char *trp; A z; /* the object that is returned */ A cc; /* the integer scalar completion code */ A cv; /* A object of export vector */ I cvlen; /* length of character vector result */ cc = gi(1); z = gv(Et, (I)2); z->p[0] = (I)cc; z->n = z->d[0] = 1; if ((tr!=(A)0) && tr->n != 0) { if ((tr->t != Ct) || (tr->r != 1) || (tr->n != 256)) return(z); trp = (char *)(tr->p); } else trp = (char *)(0); if (NULL==(cv=AExportAObject(aobj, trp, for_a, &cvlen))) cc->p[0]=cvlen; else { z->n=z->d[0]=2; cc->p[0]=0; z->p[1]=(I)cv; } return(z); } ENTRYPOINT A ep_exp(aobj) A aobj; { A z; I cvlen; if (0==(z=AExportAObject(aobj, (C *)0, 1, &cvlen))) ERROUT((*AbortFlagPtr)?1:ERR_NONCE); R z; } #if defined(MS_64BIT) ENTRYPOINT A ep_exp64(aobj) A aobj; { A z; I cvlen; /* use this function from a machine with 64bit longs and you need to */ /* export to a 64bit long machine */ if (0==(z=(A)AExport64AObject(aobj, (C *)0, 1, &cvlen))) ERROUT(ERR_NONCE); R z; } #endif /* 64BIT */ ENTRYPOINT A ep_ImportAObject(cv, tr) A cv; A tr; { char *trp; A z; /* the object that is returned */ A cc; /* the integer scalar completion code */ A aobj; /* the imported A object */ cc = gi(1); z = gv(Et, (I)2); z->p[0] = (I)cc; z->n = z->d[0] = 1; if ((tr!=(A)0) && tr->n != 0) { if ((tr->t != Ct) || (tr->r != 1) || (tr->n != 256)) return(z); trp = (char *)(tr->p); } else trp = (char *)(0); if ((cv->t != Ct) || (cv->r != 1) || (cv->n < 4)) return(z); if ((aobj=ImportAObject((char *)cv->p, cv->n, trp))!=(A)0) { cc->p[0]=0; z->n = z->d[0] = 2; z->p[1]=(I)aobj; } return(z); } ENTRYPOINT A ep_imp(acv) A acv; { A z; if ( acv->t != Ct ) ERROUT(ERR_TYPE); if ( acv->r > 1 ) ERROUT(ERR_RANK); if ( acv->n < 4 ) ERROUT(ERR_DOMAIN); if ((A)0==(z=ImportAObject((char *)acv->p, acv->n, (C *)0))) ERROUT(ERR_DOMAIN); R z; } void impexpInstall() { CX saveCx=Cx; Cx=cx("sys"); install((PFI)ep_ExportAObject,"export", A_, 3, A_, A_, IV,0,0,0,0,0); install((PFI)ep_ImportAObject,"import", A_, 2, A_, A_, 0,0,0,0,0,0); install((PFI)ep_exp, "exp", A_, 1, A_, 0, 0,0,0,0,0,0); #if defined(MS_64BIT) install((PFI)ep_exp64, "exp64", A_, 1, A_, 0, 0,0,0,0,0,0); #endif /* MS_64BIT*/ install((PFI)ep_imp,"imp", A_, 1, A_,0,0,0,0,0,0,0); Cx=saveCx; R; } aplus-fsf-4.22/src/cxsys/impexp.h0000644000265000001440000000167110772770354012452 #ifndef included_cxsys_impexp_h #define included_cxsys_impexp_h /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #ifdef __cplusplus extern "C" { #endif extern char *ExportAObject(A, char *, I, I *); extern I ExportAObjectSizePass(A, const char *,const I, I*, I*); extern I ExportAObjectFillPass(A, const char *,const I, I, char *); extern A AExportAObject(A, char *, I, I *); extern A ImportAObject(char *, I, char *); #ifdef __cplusplus } #endif #endif aplus-fsf-4.22/src/cxc/0000777000265000001440000000000010774512572010460 5aplus-fsf-4.22/src/cxc/Makefile.am0000444000265000001440000000131407232130562012413 ## Process this file with automake to produce Makefile.in ############################################################################### ## ## ## Copyright (c) 2001 Morgan Stanley Dean Witter & Co. All rights reserved. ## ## See .../src/LICENSE for terms of distribution. ## ## ## ## ## ############################################################################### lib_LTLIBRARIES = libcxc.la libcxc_la_SOURCES = \ c.c \ cform.c \ cxc.h INCLUDES = -I.. aplus-fsf-4.22/src/cxc/Makefile.in0000644000265000001440000002427710774512522012450 # Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ ############################################################################### ############################################################################### SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CXX = @CXX@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ STRIP = @STRIP@ VERSION = @VERSION@ X_INCLUDES = @X_INCLUDES@ X_LIBS = @X_LIBS@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ lib_LTLIBRARIES = libcxc.la libcxc_la_SOURCES = \ c.c \ cform.c \ cxc.h INCLUDES = -I.. subdir = src/cxc mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_CLEAN_FILES = LTLIBRARIES = $(lib_LTLIBRARIES) libcxc_la_LDFLAGS = libcxc_la_LIBADD = am_libcxc_la_OBJECTS = c.lo cform.lo libcxc_la_OBJECTS = $(am_libcxc_la_OBJECTS) DEFS = @DEFS@ DEFAULT_INCLUDES = -I. -I$(srcdir) CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/c.Plo ./$(DEPDIR)/cform.Plo COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ CFLAGS = @CFLAGS@ DIST_SOURCES = $(libcxc_la_SOURCES) DIST_COMMON = Makefile.am Makefile.in SOURCES = $(libcxc_la_SOURCES) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/cxc/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) libLTLIBRARIES_INSTALL = $(INSTALL) install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(libdir) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f"; \ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p"; \ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test -z "$dir" && dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libcxc.la: $(libcxc_la_OBJECTS) $(libcxc_la_DEPENDENCIES) $(LINK) -rpath $(libdir) $(libcxc_la_LDFLAGS) $(libcxc_la_OBJECTS) $(libcxc_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cform.Plo@am__quote@ distclean-depend: -rm -rf ./$(DEPDIR) .c.o: @AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< .c.obj: @AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(COMPILE) -c `cygpath -w $<` .c.lo: @AMDEP_TRUE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< CCDEPMODE = @CCDEPMODE@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ETAGS = etags ETAGSFLAGS = tags: TAGS 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; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ 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; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = ../.. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: $(mkinstalldirs) $(DESTDIR)$(libdir) 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_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_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-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-compile distclean-depend \ distclean-generic distclean-libtool distclean-tags dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-exec-am: install-libLTLIBRARIES install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES .PHONY: GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool distclean distclean-compile \ distclean-depend distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am info info-am install \ install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am \ install-libLTLIBRARIES install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool tags uninstall \ uninstall-am uninstall-info-am uninstall-libLTLIBRARIES # 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: aplus-fsf-4.22/src/cxc/c.c0000644000265000001440000007350210772770354010773 /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved. */ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #include #include #include #include #include #include #include #include #include "cxc.h" static char *alignment_origin(); static A retrieve_field(); static int deposit_field(); static int field_to_index(); #define MODRNDUP(v,m) (((v)+(m))-(1+((((v)+(m))-1)%(m)))) #define INDEX_TO_OFFSET(s, i) (((A*)s->p)[3]->p[i]) #define INDEX_TO_TYPE(s, i) (((A*)s->p)[4]->p[i]) #define INDEX_TO_LENGTH(s, i) (((A*)s->p)[1]->p[i]) /* Type Codes */ #define TC_CHAR 1 #define TC_U_CHAR 2 #define TC_SHORT 3 #define TC_U_SHORT 4 #define TC_INT 5 #define TC_U_INT 6 #define TC_LONG 7 #define TC_U_LONG 8 #define TC_STRUCT1 9 #define TC_STRUCT2 10 #define TC_STRUCT4 11 #define TC_STRUCT8 12 #define TC_POINTER 13 #define TC_FLOAT 14 #define TC_DOUBLE 15 /* Type Alignments */ #ifdef mc68000 #define AL_CHAR 1 #define AL_U_CHAR 1 #define AL_SHORT 2 #define AL_U_SHORT 2 #define AL_INT 2 #define AL_U_INT 2 #define AL_LONG 2 #define AL_U_LONG 2 #define AL_STRUCT1 1 #define AL_STRUCT2 2 #define AL_STRUCT4 4 #define AL_STRUCT8 8 #define AL_POINTER 2 #define AL_FLOAT 2 #define AL_DOUBLE 2 #define STRUCT_PAD_TO 2 #else #define AL_CHAR sizeof(char) #define AL_U_CHAR sizeof(char) #define AL_SHORT sizeof(short) #define AL_U_SHORT sizeof(short) #define AL_INT sizeof(int) #define AL_U_INT sizeof(int) #define AL_LONG sizeof(long) #define AL_U_LONG sizeof(long) #define AL_STRUCT1 1 #define AL_STRUCT2 2 #define AL_STRUCT4 4 #define AL_STRUCT8 8 #define AL_POINTER sizeof(I *) #define AL_FLOAT sizeof(float) #define AL_DOUBLE sizeof(double) #define STRUCT_PAD_TO 1 #endif static struct typeinfo { char *name; int alignment; int typecode; int size; } typeinfo[] = { { "char", AL_CHAR, TC_CHAR, sizeof(char) }, { "u_char", AL_U_CHAR, TC_U_CHAR, sizeof(unsigned char) }, { "short", AL_SHORT, TC_SHORT, sizeof(short) }, { "u_short", AL_U_SHORT, TC_U_SHORT, sizeof(unsigned short) }, { "int", AL_INT, TC_INT, sizeof(int) }, { "u_int", AL_U_INT, TC_U_INT, sizeof(unsigned int) }, { "long", AL_LONG, TC_LONG, sizeof(long) }, { "u_long", AL_U_LONG, TC_U_LONG, sizeof(unsigned long) }, { "struct1", AL_STRUCT1, TC_STRUCT1, sizeof(char) }, { "struct2", AL_STRUCT2, TC_STRUCT2, sizeof(char) }, { "struct4", AL_STRUCT4, TC_STRUCT4, sizeof(char) }, { "struct8", AL_STRUCT8, TC_STRUCT8, sizeof(char) }, { "pointer", AL_POINTER, TC_POINTER, sizeof(void *) }, { "float", AL_FLOAT, TC_FLOAT, sizeof(float) }, { "double", AL_DOUBLE, TC_DOUBLE, sizeof(double) } }; #define NUM_TYPES (sizeof(typeinfo)/sizeof(struct typeinfo)) /* * Define a structure type - Do correct architecture alignment */ I structdef(fields, lengths, types) A fields; /* Symbols specifying field names */ A lengths; /* Number of elements of type in field */ A types; /* Symbols specifying field types */ { A s; /* Resulting structure template */ A offsets; /* Offsets of fields in structure */ A typecodes; /* Type codes of fields in structure */ int next_pos; /* Next byte position available in structure */ int n; /* Number of fields */ int i; /* Loop index */ /* More robust argument checks can be added later. For example, * two fields with the same name should not be allowed within a * given structure */ /* Check the lengths of the arguments */ n = fields->n; if (n != lengths->n || n != types->n) { q = ERR_LENGTH; return 0; } /* Check the types of the arguments */ if (fields->t != Et || lengths->t != It || types->t != Et) { q = ERR_TYPE; return 0; } /* Allocate vector to contain offsets and packed array size */ if (!(offsets = gv(It, n + 1))) return 0; /* WS FULL */ /* Allocate vector to contain field type codes and packed array alignment */ if (!(typecodes = gv(It, n + 1))) { dc(offsets); return 0; /* WS FULL */ } next_pos = 0; typecodes->p[n] = 0; for (i = 0; i < n; i++) { int j, k; char *tp = XS(types->p[i])->n; for (j = 0; j < NUM_TYPES; j++) { if (!strcmp(tp, typeinfo[j].name)) break; } if (j == NUM_TYPES) { /* Invalid type specified */ q = ERR_DOMAIN; dc(typecodes); dc(offsets); return 0; } else { k = typeinfo[j].alignment; offsets->p[i] = ((next_pos + k - 1) / k) * k; typecodes->p[i] = typeinfo[j].typecode; next_pos = offsets->p[i] + lengths->p[i] * typeinfo[j].size; typecodes->p[n] = MAX(typecodes->p[n], k); } #ifdef DEBUG (void)printf("field = '%s',length = %d,type = '%s',o = %d,t = %d\n", XS(fields->p[i])->n, lengths->p[i], XS(types->p[i])->n, offsets->p[i], typecodes->p[i]); #endif /* DEBUG */ } /* Store size of structure at end of offsets vector */ offsets->p[i] = MODRNDUP(next_pos, typecodes->p[n]); offsets->p[i] = MODRNDUP(offsets->p[i], STRUCT_PAD_TO); /* Create general array to contain fields, lengths, types, and offsets * and type codes */ if (!(s = gv(Et, 5))) { dc(offsets); return 0; /* WS FULL */ } ((A*)s->p)[0] = fields; ((A*)s->p)[1] = lengths; ((A*)s->p)[2] = types; ((A*)s->p)[3] = offsets; ((A*)s->p)[4] = typecodes; /* Bump reference counts */ ic(fields); ic(lengths); ic(types); return (I)s; } /* * Return size of structure in bytes */ A structsize(s) A s; { A a = ((A*)(s->p))[3]; return gi(a->p[a->n-1]); } /* * Returns an array large enough to represent * the structure defined by s. This means there must * be enough space in the array to place a properly aligned * structure. */ I structcreate(s) A s; { A a = ((A*)(s->p))[3]; A b = ((A*)(s->p))[4]; I n = a->n - 1; /* Compute structure size plus padding to guarantee room for alignment */ n = (a->p[n] + b->p[n] + sizeof(I) - 2) / sizeof(I); a = gv(It, n); zr(a); /* zero out the array */ return (I)a; } /* * Return value of fields of a in a general array. If only 1 field * is specified, then the result is simple. */ I structget(s, a, fields) A s; A a; A fields; { A z; int i; if (fields->n == 1) { z = retrieve_field(s, a, *(S*)fields->p); } else { if (z = gv(Et, fields->n)) { zr(z); for (i = 0; i < fields->n; i++) { if (!(((A*)(z->p))[i] = retrieve_field(s, a, ((S*)fields->p)[i]))) { dc(z); z = (A)0; } } } } return (I)z; } /* * Set the values of fields. If multiple fields, values must be * in a general array. If only 1 field is specified, * then the value is simple. */ I structset(s, a, fields, values) A s; A a; A fields; A values; { int i; int deposit_field(); if (fields->n == 1) { if (deposit_field(s, a, *(S*)fields->p, values)) { return 0; } } else { for (i = 0; i < fields->n; i++) { if (deposit_field(s, a, ((S*)fields->p)[i], ((A*)values->p)[i])) { return 0; } } } ic(a); return (I)a; } static A retrieve_field(s, a, f) A s; A a; S f; { int i, j, type; char *cp, *dp; A r; i = field_to_index(s, f); if (i == -1) return (A)0; cp = alignment_origin(s, a) + INDEX_TO_OFFSET(s, i); j = INDEX_TO_LENGTH(s, i); type = INDEX_TO_TYPE(s, i); switch (type) { /* XXX - should I handle TC_CHAR and TC_U_CHAR here? */ case TC_FLOAT: case TC_DOUBLE: if (j > 1) r = gv(Ft, j); else r = gs(Ft); break; default: if (j > 1) r = gv(It, j); else r = gs(It); break; } switch (type) { case TC_CHAR: for (i = 0; i < j; i++) r->p[i] = ((char *)cp)[i]; break; case TC_U_CHAR: for (i = 0; i < j; i++) r->p[i] = ((unsigned char *)cp)[i]; break; case TC_SHORT: for (i = 0; i < j; i++) r->p[i] = ((short *)cp)[i]; break; case TC_U_SHORT: for (i = 0; i < j; i++) r->p[i] = ((unsigned short *)cp)[i]; break; case TC_INT: for (i = 0; i < j; i++) r->p[i] = ((int *)cp)[i]; break; case TC_U_INT: for (i = 0; i < j; i++) r->p[i] = ((unsigned int *)cp)[i]; break; case TC_LONG: for (i = 0; i < j; i++) r->p[i] = ((long *)cp)[i]; break; case TC_U_LONG: for (i = 0; i < j; i++) r->p[i] = ((unsigned long *)cp)[i]; break; case TC_STRUCT1: dc(r); r = gv(It, (j + AL_STRUCT1 + sizeof(I) - 2) / sizeof(I)); dp = (char *)(((long)r->p + AL_STRUCT1 - 1) & ~(AL_STRUCT1 - 1)); for (i = 0; i < j; i++) dp[i] = cp[i]; break; case TC_STRUCT2: dc(r); r = gv(It, (j + AL_STRUCT2 + sizeof(I) - 2) / sizeof(I)); dp = (char *)(((long)r->p + AL_STRUCT2 - 1) & ~(AL_STRUCT2 - 1)); for (i = 0; i < j; i++) dp[i] = cp[i]; break; case TC_STRUCT4: dc(r); r = gv(It, (j + AL_STRUCT4 + sizeof(I) - 2) / sizeof(I)); dp = (char *)(((long)r->p + AL_STRUCT4 - 1) & ~(AL_STRUCT4 - 1)); for (i = 0; i < j; i++) dp[i] = cp[i]; break; case TC_STRUCT8: dc(r); r = gv(It, (j + AL_STRUCT8 + sizeof(I) - 2) / sizeof(I)); dp = (char *)(((long)r->p + AL_STRUCT8 - 1) & ~(AL_STRUCT8 - 1)); for (i = 0; i < j; i++) dp[i] = cp[i]; break; case TC_POINTER: for (i = 0; i < j; i++) r->p[i] = ((int *)cp)[i]; break; case TC_FLOAT: r->t = Ft; for (i = 0; i < j; i++) ((double *)r->p)[i] = ((float *)cp)[i]; break; case TC_DOUBLE: r->t = Ft; for (i = 0; i < j; i++) ((double *)r->p)[i] = ((double *)cp)[i]; break; default: dc(r); r = (A)0; } return r; } static int deposit_field(s, a, f, v) A s; A a; S f; A v; { int field_to_index(); int i, j, type; char *cp, *dp; i = field_to_index(s, f); if (i == -1) return -1; cp = alignment_origin(s, a) + INDEX_TO_OFFSET(s, i); j = INDEX_TO_LENGTH(s, i); type = INDEX_TO_TYPE(s, i); switch (type) { case TC_CHAR: for (i = 0; i < j; i++) ((char *)cp)[i] = (char)v->p[i]; break; case TC_U_CHAR: for (i = 0; i < j; i++) ((unsigned char *)cp)[i] = (unsigned char)v->p[i]; break; case TC_SHORT: for (i = 0; i < j; i++) ((short *)cp)[i] = (short)v->p[i]; break; case TC_U_SHORT: for (i = 0; i < j; i++) ((unsigned short *)cp)[i]=(unsigned short)v->p[i]; break; case TC_INT: for (i = 0; i < j; i++) ((int *)cp)[i] = (int)v->p[i]; break; case TC_U_INT: for (i = 0; i < j; i++) ((unsigned int *)cp)[i] = (unsigned int)v->p[i]; break; case TC_LONG: for (i = 0; i < j; i++) ((long *)cp)[i] = (long)v->p[i]; break; case TC_U_LONG: for (i = 0; i < j; i++) ((unsigned long *)cp)[i] = (unsigned long)v->p[i]; break; /* these were ints */ case TC_STRUCT1: dp = (char *)(((long)v->p + AL_STRUCT1 - 1) & ~(AL_STRUCT1 - 1)); for (i = 0; i < j; i++) cp[i] = dp[i]; break; case TC_STRUCT2: dp = (char *)(((long)v->p + AL_STRUCT2 - 1) & ~(AL_STRUCT2 - 1)); for (i = 0; i < j; i++) cp[i] = dp[i]; break; case TC_STRUCT4: dp = (char *)(((long)v->p + AL_STRUCT4 - 1) & ~(AL_STRUCT4 - 1)); for (i = 0; i < j; i++) cp[i] = dp[i]; break; case TC_STRUCT8: dp = (char *)(((long)v->p + AL_STRUCT8 - 1) & ~(AL_STRUCT8 - 1)); for (i = 0; i < j; i++) cp[i] = dp[i]; break; case TC_POINTER: for (i = 0; i < j; i++) ((int *)cp)[i] = v->p[i]; break; case TC_FLOAT: for (i = 0; i < j; i++) ((float *)cp)[i] = (float)((double *)v->p)[i]; break; case TC_DOUBLE: for (i = 0; i < j; i++) ((double *)cp)[i] = ((double *)v->p)[i]; break; default: return -1; /* Failure */ } return 0; /* Success */ } static int field_to_index(s, f) A s; S f; { int i; S *fields = (S*)(*(A*)s->p)->p; for (i = 0; i < (*(A*)s->p)->n; i++) { if (fields[i] == f) { #ifdef DEBUG (void)printf("field_to_index: field <%s>, index %d\n", XS(f)->n, i); #endif /* DEBUG */ return i; } } q = ERR_DOMAIN; return -1; } static char *alignment_origin(s, a) A s; A a; { A z = ((A*)s->p)[4]; long u = (long)a->p; long v = z->p[z->n - 1] - 1; /* Alignment factor */ /* The alignment is assumed to be a power of 2 */ v = (u + v) & (~v); #ifdef DEBUG (void)printf("alignment_origin: u %d, v %d, u - v %d\n", u, v, u-v); #endif /* DEBUG */ return (char *)v; } /* * Return a pointer (in an integer) to the beginning of the data in a struct */ I pointer(s, a) A s; A a; { return (I)gi((I)alignment_origin(s, a)); } I ptr(a) A a; {return (I)a->p;} /* * Return a packed array which is a copy of the structure * pointed to by p. Structure is defined by s. */ I struct_pointed_to_by(s, p) A s; A p; { int n, i; char *cp; char *pp = (char *)p->p[0]; A a = ((A*)(s->p))[3]; n = a->p[a->n - 1]; if (a = (A)structcreate(s)) { cp = alignment_origin(s, a); for (i = 0; i < n; i++) cp[i] = pp[i]; } return (I)a; } /* * Return (double value of) float pointed to by p */ I float_pointed_to_by(p) A p; { A z; if (z = gs(Ft)) { *(F *)z->p = (F)*(float *)(p->p[0]); } return (I)z; } /* * Return double pointed to by p */ I double_pointed_to_by(p) A p; { A z; if (z = gs(Ft)) { *(F *)z->p = *(F *)(p->p[0]); } return (I)z; } /* * Return char pointed to by p */ A char_pointed_to_by(p) A p; { return gi((I)*(char *)(p->p[0])); } /* * Return int pointed to by p */ A int_pointed_to_by(p) A p; { return gi(*(I *)(p->p[0])); } /* * Return short pointed to by p */ A short_pointed_to_by(p) A p; { return gi((I)*(short *)(p->p[0])); } /* * Return string pointed to by p */ I string_pointed_to_by(p) A p; { return (I)gsv(0, (char *)(p->p[0])); } I structtype(s) A s; { extern S si(); A z = ((A*)s->p)[4]; int alignment = z->p[z->n - 1]; S sym; switch (alignment) { case AL_STRUCT1: sym = si("struct1"); break; case AL_STRUCT2: sym = si("struct2"); break; case AL_STRUCT4: sym = si("struct4"); break; case AL_STRUCT8: sym = si("struct8"); break; default: sym = (S)0; break; } if (sym) { z = gs(Et); *z->p = MS(sym); } else { z = (A)0; } return (I)z; } /* * Display the contents of a structure in a and * described by s in a reasonable fashion */ void structprint(s, a) A a; A s; { int i; A z; A fields = ((A*)s->p)[0]; /* A lengths = ((A*)s->p)[1]; */ A types = ((A*)s->p)[2]; /* A offsets = ((A*)s->p)[3]; */ A typecodes = ((A*)s->p)[4]; /* For each field */ for (i = 0; i < ((A*)s->p)[0]->n; i++) { switch (typecodes->p[i]) { case TC_CHAR: case TC_U_CHAR: case TC_SHORT: case TC_U_SHORT: case TC_INT: case TC_U_INT: case TC_LONG: case TC_U_LONG: case TC_POINTER: case TC_FLOAT: case TC_DOUBLE: z = retrieve_field(s, a, ((S*)fields->p)[i]); (void)printf("%s:(%s):", XS(fields->p[i])->n, XS(types->p[i])->n); pa((V)z); (void)putchar('\n'); dc(z); break; case TC_STRUCT1: case TC_STRUCT2: case TC_STRUCT4: case TC_STRUCT8: (void)printf("%s:(%s): ----\n", XS(fields->p[i])->n, XS(types->p[i])->n); break; } } } void place_ints_at(ai, p) A ai; I *p; { int i; for (i = 0; i < ai->n; i++) *p++ = ai->p[i]; } void place_floats_at(af, p) A af; F *p; { int i; for (i = 0; i < af->n; i++) *p++ = ((F*)af->p)[i]; } void place_chars_at(ac, p) A ac; C *p; { int i; for (i = 0; i < ac->n; i++) *p++ = ((C*)ac->p)[i]; } A AHeader(a) A a; { A r, d; I i; static char *types[] = { "It","Ft","Ct","", "Et","","","","Xt","Xt+1","Xt+2","Xt+3" }; r = (A)gv(Et,5); ((A*)r->p)[0] = gi(a->c); ((A*)r->p)[1] = (A)gsv(0, types[a->t]); ((A*)r->p)[2] = gi(a->r); ((A*)r->p)[3] = gi(a->n); ((A*)r->p)[4] = d = gv(It, a->r); for (i = 0; i < a->r; i++) d->p[i] = a->d[i]; R r; } Z I DetermineLength(a) A a; { int i; I length, stat; /* * for It, Ft, and Ct write out * 1 char = type information ('I', 'F', 'C') * 1 char = rank * 1 I = length (times reduce rho) * rank I = dimensions * data * for Et write out * 1 char = type information ('I', 'F', 'C') * 1 char = rank * 1 I = length (times reduce rho) * rank I = dimensions * for Symbols write out * 1 char = type * 1 I = string length * symbol text */ switch (a->t) { case It: length = 2*sizeof(char) + (1 + a->r)*sizeof(I) + a->n*sizeof(I); break; case Ft: length = 2*sizeof(char) + (1 + a->r)*sizeof(I) + a->n*sizeof(F); break; case Ct: length = 2*sizeof(char) + (1 + a->r)*sizeof(I) + a->n*sizeof(C); break; case Et: length = 2*sizeof(char) + (1 + a->r)*sizeof(I); for (stat = i = 0; i < a->n && stat != -1; i++) { if (QA(((A*)a->p)[i])) length += stat = DetermineLength(((A*)a->p)[i]); else if (QS(((A*)a->p)[i])) length += (1 + strlen(XS(((A*)a->p)[i])->n))*sizeof(char) + sizeof(I); else { q = ERR_TYPE; length = stat = -1; } } break; default: R (I)(-1); } R length; } Z int PumpData(start, end, a) char *start, *end; A a; { char *cp; I i, len; cp = start; switch (a->t) { case It: if (end - start < 2*sizeof(char) + (1 + a->r)*sizeof(I) + a->n*sizeof(I)) { q = ERR_LENGTH; len = -1; } else { *cp++ = 'I'; *cp++ = (char)a->r; (void)bcopy(&a->n, cp, sizeof(I)); cp += sizeof(I); (void)bcopy(a->d, cp, (i = a->r * sizeof(I))); cp += i; (void)bcopy(a->p, cp, (i = a->n * sizeof(I))); cp += i; len = cp - start; } break; case Ft: if (end - start < 2*sizeof(char) + (1 + a->r)*sizeof(I) + a->n*sizeof(F)) { q = ERR_LENGTH; len = -1; } else { *cp++ = 'F'; *cp++ = (char)a->r; (void)bcopy(&a->n, cp, sizeof(I)); cp += sizeof(I); (void)bcopy(a->d, cp, (i = a->r * sizeof(I))); cp += i; (void)bcopy(a->p, cp, (i = a->n * sizeof(F))); cp += i; len = cp - start; } break; case Ct: if (end - start < 2*sizeof(char) + (1 + a->r)*sizeof(I) + a->n*sizeof(C)) { q = ERR_LENGTH; len = -1; } else { *cp++ = 'C'; *cp++ = (char)a->r; (void)bcopy(&a->n, cp, sizeof(I)); cp += sizeof(I); (void)bcopy(a->d, cp, (i = a->r * sizeof(I))); cp += i; (void)bcopy(a->p, cp, (i = a->n * sizeof(C))); cp += i; len = cp - start; } break; case Et: if (end - start < 2*sizeof(char) + (1 + a->r)*sizeof(I)) { q = ERR_LENGTH; len = -1; } else { *cp++ = 'E'; *cp++ = (char)a->r; (void)bcopy(&a->n, cp, sizeof(I)); cp += sizeof(I); (void)bcopy(a->d, cp, (i = a->r * sizeof(I))); cp += i; for (len = i = 0; i < a->n && len != -1; i++) { if (QA(((A*)a->p)[i])) cp += (len = PumpData(cp, end, ((A*)a->p)[i])); else if (QS(((A*)a->p)[i])) { len = strlen(XS(((A*)a->p)[i])->n) * sizeof(C); if ((end - cp) < (len + sizeof(C) + sizeof(I))) { q = ERR_LENGTH; len = -1; } else { *cp++ = 'S'; (void)bcopy(&len, cp, sizeof(I)); cp += sizeof(I); (void)bcopy(XS(((A*)a->p)[i])->n, cp, len); cp += len; } } else { q = ERR_TYPE; len = -1; } } len = cp - start; } break; default: len = -1; break; } R len; } A stuff(a) A a; { A r; I length; char *start, *end; if ((length = DetermineLength(a)) == -1) R 0; /* Add room for header info */ r = gv(Ct, length + sizeof(I)); start = (char *)r->p; end = (char *)(r->p + length + sizeof(I)); (void)bcopy(&length, start, sizeof(I)); start += sizeof(I); if (PumpData(start, end, a) == -1) { dc(r); r = (A)gz(); } R r; } Z A SuckData(start, end) char **start, *end; { char *cp; char type; int i; I d[MAXR+1], rank, length; A r=0, s; if (*start == end) { q = ERR_LENGTH; R (A)0; } cp = *start; type = *cp++; switch (type) { case 'I': case 'F': case 'C': case 'E': if (end - cp < sizeof(char) + sizeof(I) || (rank = (I)(unsigned char)*cp++) > MAXR) { q = ERR_LENGTH; R (A)0; } (void)bcopy(cp, &length, sizeof(I)); cp += sizeof(I); if (end - cp < rank * sizeof(I)) { q = ERR_LENGTH; R (A)0; } (void)bcopy(cp, d, (i = rank * sizeof(I))); cp += i; switch (type) { case 'I': r = ga(It, rank, length, d); (void)bcopy(cp, r->p, (i = length * sizeof(I))); cp += i; break; case 'F': r = ga(Ft, rank, length, d); (void)bcopy(cp, r->p, (i = length * sizeof(F))); cp += i; break; case 'C': r = ga(Ct, rank, length, d); (void)bcopy(cp, r->p, (i = length * sizeof(C))); cp += i; break; case 'E': r = ga(Et, rank, length, d); for (i = 0; i < length; i++) { if ((r->p[i] = (I)SuckData(&cp, end)) == (I)0) R (A)0; } break; } break; case 'S': if (end - cp < sizeof(I)) { q = ERR_LENGTH; R (A)0; } (void)bcopy(cp, &length, sizeof(I)); cp += sizeof(I); if (end - cp < length * sizeof(C)) { q = ERR_LENGTH; R (A)0; } s = gv(Ct, length); (void)bcopy(cp, s->p, (i = length * sizeof(C))); cp += i; r = (A)MS(si((char *)s->p)); dc(s); break; default: q = ERR_TYPE; R 0; } *start = cp; R r; } A unstuff(a) A a; { I length; char *start, *end; if (a->t != Ct) { q = ERR_TYPE; R (A)0; } if (a->n < 4) { q = ERR_LENGTH; R (A)0; } (void)bcopy(a->p, &length, sizeof(I)); start = ((char *)a->p) + sizeof(I); end = ((char *)a->p) + a->n; if (end - start != length) { q = ERR_LENGTH; R (A)0; } R SuckData(&start, end); } PointerTable *AllocPointerTable() { PointerTable *p; p = (PointerTable *)balloc(sizeof(*p)); p->length = 0; p->ptr = NULL; R p; } void FreePointerTable(p) PointerTable *p; { bfree((char *)p->ptr); bfree((char *)p); } char *AToString(a) A a; { char *string; switch (a->t) { case Ct: string = (C *)a->p; break; case It: string = (C *)*a->p; break; case Et: if (a->n == 0) string = (char *)0; else if (!QS(*a->p)) { q = ERR_TYPE; string = (char *)(-1); } else string = XS(*a->p)->n; break; default: if (a->n == 0) string = (char *)0; else { q = ERR_TYPE; string = (char *)(-1); } } R string; } void *FetchPointer(table, index) PointerTable *table; I index; { void *ptr; if (table == NULL || index < 0 || index >= table->length || (ptr = table->ptr[index]) == (void *)(-1)) ptr = (void *)(-1); R ptr; } int FetchIndex(table, ptr) PointerTable *table; void *ptr; { int i; if (table != NULL) for (i = 0; i < table->length; i++) if (table->ptr[i] == ptr) R i; R -1; } void RemovePointer(table, index) PointerTable *table; I index; { if (table != NULL && index >= 0 && index < table->length) table->ptr[index] = (void *)(-1); } I InternPointer(table, ptr) PointerTable *table; void *ptr; { I i; if (table == NULL) i = (-1); else { /* If pointer is already installed just return it */ for (i = 0; i < table->length; i++) if (table->ptr[i] == ptr) return i; for (i = 0; i < table->length; i++) if (table->ptr[i] == (void *)(-1)) break; if (i == table->length) { table->length++; table->ptr = (void **)brealloc((char *)table->ptr, table->length*sizeof(void *)); } table->ptr[i] = ptr; } R i; } void InitStructureTable(sTable) StructureTable *sTable; { int i; for (i = 0; sTable[i].string != (char *)0; i++) sTable[i].msymbol = MS(si(sTable[i].string)); } void InitEnumTable(enumTable) EnumTable *enumTable; { int i; for (i = 0; enumTable[i].string != (char *)0; i++) enumTable[i].msymbol = MS(si(enumTable[i].string)); } void InitMaskTable(maskTable) MaskTable *maskTable; { int i; for (i = 0; maskTable[i].string != (char *)0; i++) maskTable[i].msymbol = MS(si(maskTable[i].string)); } A EnumToSymbol(enumTable, value) EnumTable *enumTable; unsigned long value; { int i; A r; /* Initialize enumTable if needed */ if (enumTable[0].msymbol == 0) InitEnumTable(enumTable); for (i = 0; enumTable[i].string != (char *)0; i++) if (enumTable[i].value == value) { r = gs(Et); *r->p = enumTable[i].msymbol; R r; } R (A)gz(); } A MaskToSymbols(maskTable, mask) MaskTable *maskTable; unsigned long mask; { int i, n; A r; /* Initialize maskTable if needed */ if (maskTable[0].msymbol == 0) InitMaskTable(maskTable); for (n = i = 0; maskTable[i].string != (char *)0; i++) { if ((mask & maskTable[i].mask) == maskTable[i].mask) { maskTable[i].found = 1; n++; } else maskTable[i].found = 0; } if (n) { r = gv(Et, n); for (n = i = 0; maskTable[i].string != (char *)0; i++) if (maskTable[i].found) r->p[n++] = maskTable[i].msymbol; } else r = (A)gz(); R r; } int SymbolToEnum(enumTable, a, valuep) EnumTable *enumTable; A a; unsigned long *valuep; { int i; if (a->t == It && a->n == 1) { *valuep = (unsigned long)a->p[0]; R 0; } if (a->t != Et || (a->n >= 1 && !QS(*a->p))) R -1; /* Initialize enumTable if needed */ if (enumTable[0].msymbol == 0) InitEnumTable(enumTable); for (i = 0; enumTable[i].string != 0; i++) if (enumTable[i].msymbol == *a->p) { *valuep = enumTable[i].value; R 0; } R -1; } int SymbolsToMask(maskTable, a, maskp) MaskTable *maskTable; A a; unsigned long *maskp; { I msymbol; int i, j; if (a->t == It && a->n == 1) { *maskp = (unsigned long)a->p[0]; R 0; } if (a->t != Et) R -1; /* Initialize maskTable if needed */ if (maskTable[0].msymbol == 0) InitMaskTable(maskTable); *maskp = 0; for (i = 0; i < a->n; i++) { if (!QS(a->p[i])) R -1; msymbol = a->p[i]; for (j = 0; maskTable[j].string != (char *)0; j++) if (msymbol == maskTable[j].msymbol) { *maskp |= maskTable[j].mask; break; } if (maskTable[j].string == (char *)0) R -1; } R 0; } int AToStructure(sTable, a, valuemaskp, sp) StructureTable *sTable; A a; unsigned long *valuemaskp; char *sp; { A k, v, p; int h, i, j; unsigned long valuemask, value, mask; if (a->t != Et) { q = ERR_TYPE; R 1; } else if (a->n != 2) { q = ERR_LENGTH; R 1; } k = ((A*)a->p)[0]; v = ((A*)a->p)[1]; if (k->t != Et || v->t != Et) { q = ERR_TYPE; R 1; } else if (k->n != v->n) { q = ERR_LENGTH; R 1; } if (sTable[0].msymbol == 0) InitStructureTable(sTable); valuemask = 0; for (i = 0; i < k->n; i++) { if (!QS(k->p[i])) {q = ERR_TYPE; R 1;} for (j = 0; sTable[j].string != (char *)0; j++) { if (sTable[j].msymbol == k->p[i]) { p = ((A*)v->p)[i]; switch (sTable[j].type) { case ST_CHAR: if (p->t != It) {q = ERR_TYPE; R 1;} *((char *)(sp+sTable[j].offset)) = (char)*p->p; break; case ST_BOOL: case ST_INT: if (p->t != It) {q = ERR_TYPE; R 1;} *((int *)(sp+sTable[j].offset)) = (int)*p->p; break; case ST_INTENUM: if (SymbolToEnum((EnumTable *)sTable[j].table, p, &value)) R 1; *((int *)(sp+sTable[j].offset)) = (int)value; break; case ST_LONGMASK: if (SymbolsToMask((MaskTable *)sTable[j].table, p, &mask)) R 1; *((long *)(sp+sTable[j].offset)) = (long)mask; break; case ST_ULONG: if (p->t != It) {q = ERR_TYPE; R 1;} *((unsigned long *)(sp+sTable[j].offset)) = (unsigned long)*p->p; break; case ST_MULTIINT: if (p->t != It) {q = ERR_TYPE; R 1;} if (p->n != (I)sTable[j].table) {q = ERR_LENGTH; R 1;} for (h = 0; h < (long)sTable[j].table; h++) *(h+(int *)(sp+sTable[j].offset)) = (int)p->p[h]; break; case ST_VOID: default: break; } valuemask |= sTable[j].mask; break; } /* if */ } /* for j */ if (sTable[j].string == (char *)0) { (void)fprintf(stderr, "Warning: Unknown member `%s in\n", XS(k->p[i])->n); (void)pa((V)a); fputc('\n', stdout); } } /* for i */ *valuemaskp = valuemask; R 0; } void cInstall() { CX saveCx=Cx; Cx=cx("c"); install((PFI)structdef, "structdef", A_,3,A_,A_,A_, 0,0,0,0,0); install((PFI)structsize, "structsize", A_,1,A_, 0, 0, 0,0,0,0,0); install((PFI)structcreate, "structcreate", A_,1,A_, 0, 0, 0,0,0,0,0); install((PFI)structget, "structget", A_,3,A_,A_,A_, 0,0,0,0,0); install((PFI)structset, "structset", A_,4,A_,A_,A_,A_,0,0,0,0); install((PFI)pointer, "pointer", A_,2,A_,A_, 0, 0,0,0,0,0); install((PFI)ptr, "ptr", IV,1,A_, 0, 0, 0,0,0,0,0); install((PFI)struct_pointed_to_by, "struct_pointed_to_by", A_,2,A_,A_, 0, 0,0,0,0,0); install((PFI)double_pointed_to_by, "double_pointed_to_by", A_,1,A_, 0, 0, 0,0,0,0,0); install((PFI)float_pointed_to_by, "float_pointed_to_by" , A_,1,A_, 0, 0, 0,0,0,0,0); install((PFI)char_pointed_to_by, "char_pointed_to_by", A_,1,A_, 0, 0, 0,0,0,0,0); install((PFI)int_pointed_to_by, "int_pointed_to_by", A_,1,A_, 0, 0, 0,0,0,0,0); install((PFI)short_pointed_to_by, "short_pointed_to_by", A_,1,A_, 0, 0, 0,0,0,0,0); install((PFI)string_pointed_to_by, "string_pointed_to_by", A_,1,A_, 0, 0, 0,0,0,0,0); install((PFI)structtype, "structtype", A_,1,A_, 0, 0, 0,0,0,0,0); install((PFI)structprint, "structprint", V_,2,A_,A_, 0, 0,0,0,0,0); install((PFI)place_ints_at, "place_ints_at", V_,2,IA,IV, 0, 0,0,0,0,0); install((PFI)place_floats_at, "place_floats_at", V_,2,FA,IV, 0, 0,0,0,0,0); install((PFI)place_chars_at, "place_chars_at", V_,2,CA,IV, 0, 0,0,0,0,0); install((PFI)stuff, "stuff", A_,1,A_, 0, 0, 0,0,0,0,0); install((PFI)unstuff, "unstuff", A_,1,CA, 0, 0, 0,0,0,0,0); install((PFI)AHeader, "AHeader", A_,1,A_, 0, 0, 0,0,0,0,0); Cx=saveCx; cformInstall(); R; } aplus-fsf-4.22/src/cxc/cform.c0000644000265000001440000001174510772770354011660 /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* * This file contains the FSA machine parser for Steve's "d" system. */ #include #include #include #include #include #include #include #undef ENTRYPOINT #define ENTRYPOINT static SUBROUTINE int VetteMachine (machine) A machine; { int i, j, len; A aobj, element, subelement, tokens; if (Et != machine->t || 1 != machine->r || 4 != machine->n ) return 1; for (i=0; in; ++i) { if (!QA(machine->p[i])) return 2; } /* names */ aobj=(A) machine->p[0]; if (0==(len=aobj->n)) return 3; if (Et != aobj->t || 1 < aobj->r ) return 4; for (i=0; in; ++i) { if (!QS(aobj->p[i])) return 5; } /* tokens */ aobj=tokens=(A) machine->p[1]; if (Et != aobj->t || 1 < aobj->r || len != aobj->n ) return 6; for (i=0; in; ++i) { if (!QA(element=(A) aobj->p[i])) return 7; if (Et != element->t || 0 == element->n ) return 8; for (j=0; jn; ++j) { if (!QA(subelement=(A) element->p[j])) return 81; if (Ct != subelement->t || 0 == subelement->n ) return 82; } } /* states */ aobj=(A) machine->p[2]; if (Et != aobj->t || 1 < aobj->r || len != aobj->n ) return 9; for (i=0; in; ++i) { if (!QA(element=(A) aobj->p[i])) return 10; if (It != element->t || 2 != element->r || 0 == element->n || element->d[1] != 1+((A)tokens->p[i])->n) return 11; } /* statenames */ /* Who cares? They aren't used. */ return 0; } /* gst * Cover for A entrypoint gsv() that *always* returns a vector. */ SUBROUTINE A gst( x, s) I x; C *s; { A r=(A) gsv(x,s); r->r=1; return(r); } SUBROUTINE A MakeEmptyResult( machine) A machine; { A result; result = gv(Et,3); result->p[0] = ((A)(machine->p[0]))->p[0]; result->p[1] = (I)gv(It, 0); result->p[2] = 0; return(result); } static char buffer[512]; SUBROUTINE A MakeResult( sym, s, toktype, len) I sym; char *s; I *toktype, len; { I nparts, curtype, i, idx=0, bufidx; A result, aobj, typeobj; result=gv(Et, 3); aobj = gs(Et); aobj->p[0] = sym; result->p[0] = (I) aobj; nparts=0; curtype=-1; for (i=0; ip[idx++] = (I) gst(0, buffer); bufidx=0; } typeobj->p[idx]=curtype=toktype[i]; buffer[bufidx++] = s[i]; } result->p[1] = (I) typeobj; result->p[2] = (I) aobj; return(result); } static char tokenstr[512]; static int tokentype[512]; static int tokencount; SUBROUTINE A RunMachine( s, forms, tokenobj, statesobj) char *s; A forms, tokenobj, statesobj; { A result=NULL, curtoken; I *tokens, *statemat, slen, tklen, formno, i, j, idx, nr, nc, state; char *tokes, *s1; slen = strlen((DEV_STRARG)s); tokens = ma(slen); for (formno=0; NULL == result && formnon ; ++formno) { curtoken=(A) tokenobj->p[formno]; statemat=((A) statesobj->p[formno])->p; nr=((A) statesobj->p[formno])->d[0]; nc=((A) statesobj->p[formno])->d[1]; tokencount=curtoken->n; tokenstr[0]='\0'; idx=0; for (i=0; ip[i])->p; tklen=strlen((DEV_STRARG)tokes); for (j=0; jp[formno], s, tokens, slen); } if (NULL==result) { result=gv(Et,3); result->p[0]=(I) gv(Et,0); result->p[1]=(I) gv(Et,0); result->p[2]=(I) gv(Et,0); } mf(tokens); return(result); } ENTRYPOINT A ep_cform(s, machine) char *s; A machine; { A result; if (VetteMachine( machine)) ERRMSG("machine"); if (0==strlen((DEV_STRARG)s)) result=MakeEmptyResult(machine); else result=RunMachine(s,(A)machine->p[0],(A)machine->p[1],(A)machine->p[2]); return(result); } void cformInstall() { CX saveCx=Cx; Cx=cx("c"); install((PFI)ep_cform, "form", A_, 2, CP, A_,0,0,0,0,0,0); Cx=saveCx; return; } aplus-fsf-4.22/src/cxc/cxc.h0000644000265000001440000000413410772770354011326 #ifndef included_cxc_cxc_h #define included_cxc_cxc_h /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* "eh?" Error Codes */ #define STOP_ERROR 0 #define INTERRUPT_ERROR 1 #define WSFULL_ERROR 2 #define STACK_ERROR 3 #define VALUE_ERROR 4 #define VALENCE_ERROR 5 #define TYPE_ERROR 6 #define RANK_ERROR 7 #define LENGTH_ERROR 8 #define DOMAIN_ERROR 9 #define INDEX_ERROR 10 #define MISMATCH_ERROR 11 #define NONCE_ERROR 12 #define MAXRANK_ERROR 13 #define NONFUNCTION_ERROR 14 #define PARSE_ERROR 15 #define MAXITEMS_ERROR 16 typedef struct _PointerTable { long length; /* number of pointers allocated */ void **ptr; } PointerTable; typedef struct _MaskTable { unsigned long mask; char *string; I msymbol; char found; } MaskTable; typedef struct _EnumTable { unsigned long value; char *string; I msymbol; } EnumTable; #define ST_BOOL 0 #define ST_CHAR 1 #define ST_INT 2 #define ST_INTENUM 3 #define ST_LONGMASK 4 #define ST_ULONG 5 #define ST_MULTIINT 6 #define ST_VOID 7 typedef struct _StructureTable { unsigned long mask; char *string; unsigned int offset; int type; void *table; I msymbol; } StructureTable; extern PointerTable *AllocPointerTable(); extern void FreePointerTable(); extern char *AToString(); extern void *FetchPointer(); extern int FetchIndex(); extern void RemovePointer(); extern I InternPointer(); extern void InitStructureTable(); extern void InitEnumTable(); extern void InitMaskTable(); extern A EnumToSymbol(); extern A MaskToSymbols(); extern int SymbolToEnum(); extern int SymbolsToMask(); extern int AToStructure(); #endif /* included_cxc_cxc_h */ aplus-fsf-4.22/src/esf/0000777000265000001440000000000010774512572010460 5aplus-fsf-4.22/src/esf/Makefile.am0000444000265000001440000000146207232130633012416 ## Process this file with automake to produce Makefile.in ############################################################################### ## ## ## Copyright (c) 2001 Morgan Stanley Dean Witter & Co. All rights reserved. ## ## See .../src/LICENSE for terms of distribution. ## ## ## ## ## ############################################################################### lib_LTLIBRARIES = libesf.la libesf_la_SOURCES = \ alsf.c \ esfn.c \ fi.c \ fmt.c \ info.c \ ssr.c \ index.c \ pack.c \ primpro.c \ searchPATH.c \ kcheck.c \ dyld2.c INCLUDES = -I.. aplus-fsf-4.22/src/esf/Makefile.in0000644000265000001440000002655010774512523012445 # Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ ############################################################################### ############################################################################### SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CXX = @CXX@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ STRIP = @STRIP@ VERSION = @VERSION@ X_INCLUDES = @X_INCLUDES@ X_LIBS = @X_LIBS@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ lib_LTLIBRARIES = libesf.la libesf_la_SOURCES = \ alsf.c \ esfn.c \ fi.c \ fmt.c \ info.c \ ssr.c \ index.c \ pack.c \ primpro.c \ searchPATH.c \ kcheck.c \ dyld2.c INCLUDES = -I.. subdir = src/esf mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_CLEAN_FILES = LTLIBRARIES = $(lib_LTLIBRARIES) libesf_la_LDFLAGS = libesf_la_LIBADD = am_libesf_la_OBJECTS = alsf.lo esfn.lo fi.lo fmt.lo info.lo ssr.lo \ index.lo pack.lo primpro.lo searchPATH.lo kcheck.lo dyld2.lo libesf_la_OBJECTS = $(am_libesf_la_OBJECTS) DEFS = @DEFS@ DEFAULT_INCLUDES = -I. -I$(srcdir) CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/alsf.Plo ./$(DEPDIR)/dyld2.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/esfn.Plo ./$(DEPDIR)/fi.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/fmt.Plo ./$(DEPDIR)/index.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/info.Plo ./$(DEPDIR)/kcheck.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/pack.Plo ./$(DEPDIR)/primpro.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/searchPATH.Plo ./$(DEPDIR)/ssr.Plo COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ CFLAGS = @CFLAGS@ DIST_SOURCES = $(libesf_la_SOURCES) DIST_COMMON = Makefile.am Makefile.in SOURCES = $(libesf_la_SOURCES) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/esf/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) libLTLIBRARIES_INSTALL = $(INSTALL) install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(libdir) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f"; \ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p"; \ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test -z "$dir" && dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libesf.la: $(libesf_la_OBJECTS) $(libesf_la_DEPENDENCIES) $(LINK) -rpath $(libdir) $(libesf_la_LDFLAGS) $(libesf_la_OBJECTS) $(libesf_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dyld2.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/esfn.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fmt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/index.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/info.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kcheck.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pack.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/primpro.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/searchPATH.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssr.Plo@am__quote@ distclean-depend: -rm -rf ./$(DEPDIR) .c.o: @AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< .c.obj: @AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(COMPILE) -c `cygpath -w $<` .c.lo: @AMDEP_TRUE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< CCDEPMODE = @CCDEPMODE@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ETAGS = etags ETAGSFLAGS = tags: TAGS 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; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ 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; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = ../.. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: $(mkinstalldirs) $(DESTDIR)$(libdir) 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_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_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-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-compile distclean-depend \ distclean-generic distclean-libtool distclean-tags dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-exec-am: install-libLTLIBRARIES install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES .PHONY: GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool distclean distclean-compile \ distclean-depend distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am info info-am install \ install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am \ install-libLTLIBRARIES install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool tags uninstall \ uninstall-am uninstall-info-am uninstall-libLTLIBRARIES # 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: aplus-fsf-4.22/src/esf/alsf.c0000644000265000001440000001214610772770354011473 /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #include #include #include #include #include #include #include #include #include #undef ENTRYPOINT #define ENTRYPOINT static SUBROUTINE I flat_onepass( a, ptype) A a; I *ptype; { I i, res; if (!QA(a)) ERROUT(ERR_DOMAIN); switch(a->t) { case Ct: case It: case Ft: if (-1==*ptype) *ptype=a->t; if (a->t != *ptype) ERROUT(ERR_DOMAIN); R a->n; case Et: for (i=res=0;(!q)&&in;++i) if (QA(a->p[i])) res += flat_onepass((A)a->p[i], ptype); else { if (-1==*ptype) *ptype=a->t; if (a->t != *ptype) ERROUT(ERR_DOMAIN); ++res; } R res; default: if (-1==*ptype) *ptype=Xt; if (Xt != *ptype) ERROUT(ERR_DOMAIN); R 1; } } SUBROUTINE C *flat_twopass(a, type, ptr) A a; I type; C *ptr; { I i, n; switch(a->t) { case Ct: case It: case Ft: n=a->n*SIZEOFITEM(type); bcopy(a->p,ptr,n); R ptr+n; case Et: for (i=0;(!q)&&in;++i) if (QA(a->p[i])) ptr = flat_twopass((A)a->p[i], type, ptr); else { bcopy(a->p+i,ptr,sizeof(I)); ptr+=sizeof(I); } R ptr; default: *(I *)ptr=ic(a); R ptr+sizeof(I); } } ENTRYPOINT A ep_flat( a) register A a; { A z; I n, type=-1; n=flat_onepass(a, &type); if (q) R 0; if (-1==type) type=Et; z=gv((Xt==type)?Et:type,n); flat_twopass(a,type,(C *)z->p); if (Ct==type) ((C *)(z->p))[z->n]='\0'; R z; } Z quasisf(a)A a;{A s,d;if(!(QA(a)&&Et==a->t&&2==a->n))R 0; s=(A)*a->p;d=(A)a->p[1]; R (!QF(s))&&(!QF(d))&&(qz(s)&&qz(d)||sym(s)&&s->n==d->n&&s->r<2&&d->r<2);} /* purebox() is and/QA(a), while fsy is and/QF(a) */ Z purebox(a)A a;{if(!QA(a)||Et!=a->t)R 0;DO(a->n,if(!QA(a->p[i]))R 0)R 1;} Z nodups(a)A a;{ A iota; I i,j,nodup=1,ni=a->n; if(50>=a->n) { for(i=0;in-1;++i)for(j=i+1;jn;++j)if(a->p[i]==a->p[j])R 0; R 1; } iota=(A)fnd(a,a); for(i=1;nodup&&ip[i]!=i)nodup=0; dc(iota); R nodup; } Z issf(a)A a;{A s,d;if(!(QA(a)&&Et==a->t&&2==a->n))R 0; s=(A)*a->p;d=(A)a->p[1]; R(!QF(s))&&(!QF(d))&& (qz(s)&&qz(d)||sym(s)&&s->n==d->n&&1>=s->r&&1>=d->r&&purebox(d)&&nodups(s)); } /* this is a variation of issf() which allows duplicates. */ I issfdups(a)A a;{A s,d;if(!(QA(a)&&Et==a->t&&2==a->n))R 0; s=(A)*a->p;d=(A)a->p[1]; R(!QF(s))&&(!QF(d))&& (qz(s)&&qz(d)||sym(s)&&s->n==d->n&&1>=s->r&&1>=d->r&&purebox(d)); } ep_issf(a) register A a;{R issf(a)?1:0;} ENTRYPOINT A ep_alsf(a) register A a; { A z, t, t1; I ni, i, *ap, *z0p, *z1p;C *cp; if (quasisf(a)) { t=(A)a->p[0]; t1=(A)a->p[1]; z=gv(Et,2); z->p[0]=(I)gc(t->t,1,t->n,&t->n,t->p); z->p[1]=(I)gv(Et,t->n); z1p=((A)z->p[1])->p; /* For _alsf(`a;,1) or _alsf(`a;,`xxx) */ if (Et==t1->t || (t1->tn==1 && t1->r==1) ) { if ( t1->n==1 && t1->r==1 && (t1->t!=Et || QS(*t1->p)) ){ for(i=0;in;++i) z1p[i]=ic(t1); } else { ap=t1->p; for(i=0;in;++i){ if(QA(*ap))z1p[i]=ic((A)*ap++); else{z1p[i]=(I)gs(Et);*((A)z1p[i])->p=*ap++;} } } } else { cp=(C *)t1->p; ni=SIZEOFITEM(t1->t); for(i=0;in;++i){ z1p[i]=(I)gs(t1->t);bcopy(cp,((A)z1p[i])->p,ni);cp+=ni; } } } else { if ((!QA(a))||Et!=a->t) ERROUT(ERR_TYPE); if (1r) ERROUT(ERR_RANK); if (1==a->n&&QS(*a->p)) { z=gv(Et,2);z->p[0]=(I)gv(Et,1);*((A)z->p[0])->p=*a->p; z->p[1]=(I)gv(Et,1);*((A)z->p[1])->p=(I)aplus_nl;R z;} z=gv(Et,2); if (1>=a->n) {z->p[0]=z->p[1]=(I)aplus_nl;R z;} ni=a->n/2+(((1&a->n)&&!qz((A)a->p[a->n-1]))?1:0); ap=a->p;z->p[0]=(I)gv(Et,ni);z->p[1]=(I)gv(Et,ni); z0p=((A)z->p[0])->p;z1p=((A)z->p[1])->p; for(i=0;in||Et!=t->t||!QS(*t->p)){ A z0=(A)z->p[0],z1=(A)z->p[1]; z0->n=z0->d[0]=z1->n=z1->d[0]=i; dc(z);ERROUT(ERR_DOMAIN); } z0p[i]=*t->p; } if(i>=a->n/2) z1p[i]=(I)aplus_nl; else if(QA(*ap))z1p[i]=ic((A)*ap++); else{z1p[i]=(I)gs(Et);*((A)z1p[i])->p=*ap++;} } } #ifdef QQQ_REMDUP_YES /* remove duplicates, not implemented for now. */ { A iota;I j; iota=(A)fnd(*z->p,*z->p); for(j=i=0;in;++i,++j){ if(i!=iota->p[i]){ dc(z1p[i++]); --((A)z->p[0])->n;--((A)z->p[0])->d[0]; --((A)z->p[1])->n;--((A)z->p[1])->d[0]; } else if(j!=i){z0p[j]=z0p[i];z1p[j]=z1p[i];} } dc(iota); } #endif R z; } void dotInstall() { install((PFI)ep_flat,"_flat", A_, 1, A_,0,0,0,0,0,0,0); install((PFI)ep_issf,"_issf", IV, 1, A_,0,0,0,0,0,0,0); install((PFI)ep_alsf,"_alsf", A_, 1, A_,0,0,0,0,0,0,0); R; } aplus-fsf-4.22/src/esf/esfn.c0000644000265000001440000000131710772770354011477 /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ void esfInstall() { ssrInstall(); fiInstall(); fmtInstall(); infoInstall(); dotInstall(); tInstall(); packInstall(); profileInstall(); /* no dyld */ } aplus-fsf-4.22/src/esf/fi.c0000644000265000001440000002033410772770354011142 /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /************************************************************************* * * "Quad FI" functions for reading numbers from char matrix. * * Malcolm Austin * * Entry points: ep_fi ep_cfi ep_sfi ep_scfi * * * This function is designed to act as an input processor for A. cm is a * character matrix. n is the number of numbers each line should contain. * The result is a floating point matrix, of dimensions ((#cm),n+1), where * result[;0] is a boolean TRUE for valid inputs, and the rest of the row * is the numeric values for that row. (Invalid rows have junk contents.) * * ep_cfi is a mutant version of ep_fi with the following changes to the * way the entries are processsed: * 1) All commas and left parins are removed from the entry. * 2) Right parins and high minus are converted to low minus. * */ #include #include #include #include #include #include #include #include #include #include #undef ENTRYPOINT #define ENTRYPOINT static #ifdef FUNCNOTUSED /* insert s2 at s[pos], pasting over len chars, and moving others to right */ SUBROUTINE char * strpaste(s, s2, pos, len) char *s, *s2; int pos, len; { int i, shift; /* if( limit < strlen(s)+strlen(s2)-len ) return(NULL); */ if ( NULL == s2) s2 = ""; shift = strlen((DEV_STRARG)s2) - len; if (0 < shift) for (i=strlen((DEV_STRARG)s); i>=pos+len ; --i) *(s+(i+shift)) = *(s+i); else if (0 > shift) for (i=pos+len ; i<=strlen((DEV_STRARG)s) ; ++i) *(s+(i+shift)) = *(s+i); strncpy( s+pos, s2, strlen((DEV_STRARG)s2)); return(s); } #endif SUBROUTINE void strrubout( str, c) char *str, c; { char *res = str; while( *str && c == *str) ++str; while( *res++ = *str++ ) if (c == *str) ++str; } /* strsub replaces all occurances of target in str with repl. */ /* was subroutine, made inline for speed. */ #define strsub( str, target, repl) \ {C *tstr;for(tstr=(str);*tstr;++tstr) if ((target)==*tstr) *tstr =(repl);} #ifdef FUNCNOTUSED /* strssub does the same for strings */ SUBROUTINE void strssub( str, target, repl) char *str, *target, *repl; { int tlen=strlen((DEV_STRARG)target); while (NULL != (str=strstr(str,target))) strpaste( str, repl, 0, tlen); } #endif #define sizeofAdata(a) ( a->n * SIZEOFITEM(a->t) ) SUBROUTINE int memclearA( aobj) A aobj; { memset(aobj->p, 0, sizeofAdata(aobj)); return(0); } double strtod(); SUBROUTINE void matrix_quadfi( cm, nrows, ncol, outbool, outdata, olen, commas) char *cm; I *outbool; F *outdata; I nrows, ncol, olen, commas; { double num; char *bstart, *buffer, *rowstart = cm, *ptrchar; int i, j, wasspace, secondone; bstart=charma(1+ncol); for( i=0 ; i < nrows ; ++i) { buffer=bstart; strncpy(buffer, rowstart, ncol); buffer[ncol]='\0'; rowstart += ncol; if (commas) { strrubout(buffer, ','); strsub(buffer, '(', '-'); strsub(buffer, ')', ' '); } strsub(buffer, '', '-'); strsub(buffer, '', 'Q'); /* ugly fix for strtod() not being able to parse "00" */ wasspace=TRUE; secondone=FALSE; for ( ptrchar=buffer; *ptrchar; ++ptrchar) { if (wasspace && '0'==*ptrchar) { if (secondone) *(ptrchar-1)=' '; secondone=TRUE; } else wasspace=secondone=FALSE; if (' '==*ptrchar) wasspace=TRUE; } outbool[i] = 1; for (j=0; jd[1], nrows=cm->d[0]; char *data=(char *)cm->p; A result, bool, outdata; I dimens[1+MAXR]; if (2 < cm->r) ERROUT(ERR_RANK); if (1000 < n) ERROUT(ERR_NONCE); if (2 == cm->r) { dimens[0] = nrows; dimens[1] = n; outdata = ga(Ft, 2, nrows*n, dimens); memclearA( outdata); bool = gv(It, nrows); matrix_quadfi(data, nrows, rlen, bool->p, (F *)outdata->p, n, FALSE); } else { dimens[0] = n; outdata = ga(Ft, 1, n, dimens); memclearA( outdata); bool = gi(0); matrix_quadfi(data, (I)1, nrows, bool->p, (F *)outdata->p, n, FALSE); } result = gv(Et, 2); result->p[0] = (I) bool; result->p[1] = (I) outdata; return(result); } ENTRYPOINT A ep_cfi( cm, n) A cm; I n; { I rlen=cm->d[1], nrows=cm->d[0]; char *data=(char *)cm->p; A result, bool, outdata; I dimens[1+MAXR]; if (2 < cm->r) ERROUT(ERR_RANK); if (100 < n) ERROUT(ERR_NONCE); if (2 == cm->r) { dimens[0] = nrows; dimens[1] = n; outdata = ga(Ft, 2, nrows*n, dimens); memclearA( outdata); bool = gv(It, nrows); matrix_quadfi(data, nrows, rlen, bool->p, (F *)outdata->p, n, TRUE); } else { dimens[0] = n; outdata = ga(Ft, 1, n, dimens); memclearA( outdata); bool = gi(0); matrix_quadfi(data, (I)1, nrows, bool->p, (F *)outdata->p, n, TRUE); } result = gv(Et, 2); result->p[0] = (I) bool; result->p[1] = (I) outdata; return(result); } ENTRYPOINT A ep_sfi(aobj)A aobj; { if(1r)ERROUT(ERR_RANK); return scalar_quadfi((char *)aobj->p, FALSE, SFIBUFSIZE<=aobj->n); } ENTRYPOINT A ep_scfi(aobj)A aobj; { if(1r)ERROUT(ERR_RANK); return scalar_quadfi((char *)aobj->p, TRUE, SFIBUFSIZE<=aobj->n); } void fiInstall() { install((PFI)ep_cfi, "_cfi", A_, 2, CA, IV,0,0,0,0,0,0); install((PFI)ep_fi, "_fi", A_, 2, CA, IV,0,0,0,0,0,0); install((PFI)ep_sfi, "_sfi", A_, 1, CA,0,0,0,0,0,0,0); install((PFI)ep_scfi, "_scfi", A_, 1, CA,0,0,0,0,0,0,0); return; } aplus-fsf-4.22/src/esf/fmt.c0000644000265000001440000012642010772770354011335 /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #include #include #if !defined(__cfront) #include #endif #include #include #include #if defined(__NetBSD__) || defined(__FreeBSD) || defined (__APPLE__) #include #else #include #endif #include #include #include #define DATAINC 100 /* Token types */ #define T_EOF 0 #define T_NUM 1 #define T_STRING 2 #define T_EDIT 3 #define T_MODIFIER 4 #define T_PERIOD 5 #define T_COMMA 6 #define T_LPAREN 7 #define T_RPAREN 8 #define TOKENTYPE(t) ( ((T_EOF == t) ? "End of file" : \ (T_NUM == t) ? "Number" : \ (T_STRING == t) ? "String" : \ (T_EDIT == t) ? "Edit" : \ (T_MODIFIER == t) ? "Modifier" : \ (T_PERIOD == t) ? "Period" : \ (T_COMMA == t) ? "Comma" : \ (T_LPAREN == t) ? "Left paren" : \ (T_RPAREN == t) ? "Right Paren" : "unknown" )) #define RAWBUFSIZE 1024 #define COOKEDBUFSIZE 128 #define FINALBUFSIZE 256 #define ERRBUFSIZE 80 #define EXPSIZE 30 static char *EndOfObj; #define TooBig(x) ( (x) > EndOfObj ) ? 1 : 0 static char errmsg_fmt[ERRBUFSIZE + 1]; static char raw[RAWBUFSIZE + 1]; static struct token { int type; /* Type of token */ int ivalue; /* Integer token value */ char *svalue; /* String token value */ unsigned char *orig; /* pointer to the original string */ unsigned char *current; /* pointer to the current position */ unsigned char *last; /* end of the last token parsed */ } tok; struct format { int type; /* -1=undefined, 0=loop, I, F, E, A, X, T, ... */ int rcount; /* repeat count if loop */ int width; int precision; int scale; /* If != 0, scale number by 10 ** scale */ double fscale; /* If scale number by this (fscale=10**scale) */ char blank_if_zero; /* Blank field if value is 0 */ char zerofill; /* Fill in leading 0s */ char comma; /* Insert commas in data */ char leftj; /* Left justify field */ char *text; /* String for Text format */ char *gpattern; /* Pattern for G format */ char *nldecor; /* Negative left decoration */ char *nrdecor; /* Negative right decoration */ char *odecor; /* Format 0s as text :NOTEIT. not documented */ char *pldecor; /* Negative left decoration */ char *prdecor; /* Positive right decoration */ char *backfill; /* Background fill string */ char *symbpairs; /* Standard symbol substitution pairs */ char *symgpairs; /* "g" format symbol substitution pairs */ struct format *loop; /* Sub loop */ struct format *next; /* Next node in this loop */ }; struct column { int type; /* Data type of column */ int rows; /* Number of rows in column */ int cols; /* Distance between elements in column (# of cols in matrix) */ I *p; /* Data for the column */ }; static char empty[] = "\0"; static struct column *dataList; static int dataAllocated; /* dbg_tfmt controls the behavior of FWarn() calls. Its values are: 0 = no Warn messages 1 = Additional messages to indicate position in format string */ extern I dbg_tfmt; void FWarn(int scb, C *fmt, ...) { if (dbg_tfmt) { va_list ap; va_start(ap, fmt); Warn("\343 _fmt: ", ap); Warn(fmt, ap); if ( scb == 1 ) { /* print buffer information */ Warn("\343 _fmt: %s\n",tok.orig); Warn("\343 _fmt: %*s%*s\n", (tok.last-tok.orig)+1,"^", (tok.current-tok.last)-1,"^"); } va_end(ap); } } /* * Allocate and initialize a format structure */ static struct format *formalloc() { return (struct format *)calloc(1, sizeof(struct format)); } /* * Free space allocated for the formats */ static void freeforms(fmtlist) struct format *fmtlist; { struct format *p, *next; for (p = fmtlist; p != NULL; p = next) { if (p->type == 0) { /* This is a loop */ freeforms(p->loop); } else { if (p->text) (void)free((char *)p->text); if (p->gpattern) (void)free((char *)p->gpattern); if (p->nldecor) (void)free((char *)p->nldecor); if (p->nrdecor) (void)free((char *)p->nrdecor); if (p->pldecor) (void)free((char *)p->pldecor); if (p->prdecor) (void)free((char *)p->prdecor); if (p->odecor) (void)free((char *)p->odecor); if (p->backfill) (void)free((char *)p->backfill); if (p->symbpairs) (void)free((char *)p->symbpairs); if (p->symgpairs) (void)free((char *)p->symgpairs); } next = p->next; (void)free((char *)p); } } /* * Reverse a string in place */ static void reverse(s) char *s; { int c, i, j; for ( i=0, j=strlen((DEV_STRARG)s)-1; ip; register F *dp = (F *)d->p; register C *cp = (C *)d->p; if (d->t == Et && !QS(d->p[0])) { /* Array is enclosed and not symbols so descend and process subarrays */ for (i = 0; i < d->n; i++) { if (QA(d->p[i])) { rc = datafind(indx, maxrow, ((A*)d->p)[i]); } } } else { switch (d->r) { case 0: rows = 1; cols = 1; break; case 1: rows = d->n; cols = 1; break; case 2: rows = d->d[0]; cols = d->d[1]; break; default: for (rows = 1, i = 0; i < d->r - 1; i++) { rows *= d->d[i]; } cols = d->d[d->r - 1]; break; } for (i = 0; i < cols; i++) { if (dataAllocated <= *indx) { dataAllocated += DATAINC; dataList = (struct column *)realloc(dataList, sizeof(*dataList) * dataAllocated); } dataList[*indx].rows = rows; dataList[*indx].cols = cols; switch (dataList[*indx].type = d->t) { case Ct: dataList[(*indx)++].p = (I*)(cp++); break; case Ft: dataList[(*indx)++].p = (I*)(dp++); break; case Et: /* symbol */ case It: dataList[(*indx)++].p = p++; break; default: rc = ERR_TYPE; break; } } *maxrow = MAX(*maxrow, rows); } return rc; } /* * Retrieve tokens from a format string */ static int gettoken(f) unsigned char *f; { static unsigned char *p=NULL; /* Empty string */ static unsigned char *start=NULL; /* Use for text fields */ unsigned char uc; int i, neg = 0; register int num; static unsigned char stringstart[] = "<\244\332\241\314\354/"; static unsigned char stringend[] = ">\246\330\241\314\354/"; static unsigned char edits[] = "AEFGITXaefgitx"; static unsigned char modifiers[] = "BCKLMNOPQRSZbcklmnopqrsz"; /* The first call to gettoken is with f pointing to the string to tokenize. * Subsequent calls should be with a NULL pointer so that the tokenizing * process may continue from where it left off */ if ( f ) tok.orig = tok.current = tok.last = p = f; /* Initial call */ if ( p == NULL ) { FWarn(0, "Format string missing\n"); return ERR_DOMAIN; } while (ISspace(*p)) p++; /* Skip leading white space */ if ( !*p ) { tok.type = T_EOF; tok.current = p; return 0; } /* At End */ /* Is next token a number */ if (ISdigit(*p) || *p == '-' || *p == (unsigned char)'\242') { if (*p == '-' || *p == (unsigned char)'\242') { neg = 1; p++; if (!ISdigit(*p)) { /* need a digit after the sign */ tok.current = p; FWarn(1,"Bad number specification\n"); return ERR_DOMAIN; } } for (num = *p++ - '0'; ISdigit(*p); p++) {num *= 10; num += *p - '0';} tok.type = T_NUM; tok.ivalue = neg ? -num : num; tok.current = p; return 0; } /* * Check for text string - Delimiter pairs are: * < > * \244 and \245 * \332 and \330 * \241 * \314 * \354 * / / */ for ( i=0; iblank_if_zero = 1; break; case 'C': f->comma = 1; break; case 'K': if ( (rc = gettoken((unsigned char *)0)) || tok.type != T_NUM) { if (rc) return rc; FWarn(1,"K modifier requires a scale factor\n"); return ERR_DOMAIN; } f->scale = tok.ivalue; f->fscale = pow(10.0, (double)f->scale); break; case 'L': f->leftj = 1; break; case 'Z': f->zerofill = 1; break; default: if (( rc = gettoken((unsigned char *)0)) || tok.type != T_STRING ) { if (rc) return rc; FWarn(1,"%c modifier requires text string\n",c); return ERR_DOMAIN; } if ( strlen((DEV_STRARG)tok.svalue)==0 && (c=='R'||c=='S') ) { FWarn(1,"%c modifier a text length greater than zero\n",c); return ERR_DOMAIN; } switch (c) { case 'M': f->nldecor = tok.svalue; break; case 'N': f->nrdecor = tok.svalue; break; case 'O': f->odecor = tok.svalue; break; case 'P': f->pldecor = tok.svalue; break; case 'Q': f->prdecor = tok.svalue; break; case 'R': f->backfill = tok.svalue; break; case 'S': f->symbpairs = tok.svalue; if (strlen((DEV_STRARG)tok.svalue) & 1) { FWarn(1,"S<...> must have even number of symbols\n"); return ERR_DOMAIN; } break; } break; } if (rc = gettoken((unsigned char *)0)) return rc; } return 0; } /* * Parse edit specifiers */ static int parseedit(f) struct format *f; { int rc = 0, i; /* Set type, width, and precision fields as appropriate for edit type */ switch (f->type = tok.ivalue) { case 'A': case 'I': case 'T': /* char: int: absolute tab: */ if ( rc = gettoken((unsigned char *)0) ) return rc; if (tok.type != T_NUM || tok.ivalue <= 0) { FWarn(1,"A number greater than zero must follow format %c\n", f->type); return ERR_DOMAIN; } f->width = tok.ivalue; break; case 'X': /* Relative tab negative value is OK */ if ( rc = gettoken((unsigned char *)0) ) return rc; if (tok.type != T_NUM) { FWarn(1,"A number must follow format %c\n", f->type); return ERR_DOMAIN; } f->width = tok.ivalue; break; case 'E': case 'F': /* exponential: fixed point: */ if ( rc = gettoken((unsigned char *)0) ) return rc; if ( tok.type != T_NUM || tok.ivalue <= 0) { FWarn(1,"A number greater than 0 must follow format %c\n", f->type); return ERR_DOMAIN; } f->width = tok.ivalue; if ( rc = gettoken((unsigned char *)0) ) return rc; if ( tok.type != T_PERIOD) { FWarn(1,"%c format is missing a '.'\n", f->type); return ERR_DOMAIN; } if ( rc = gettoken((unsigned char *)0) ) return rc; if ( f->type == 'F' && (tok.type != T_NUM || tok.ivalue < 0)) { FWarn(1, "%c format requires non-negative precision\n", f->type); return ERR_DOMAIN; } if ( f->type == 'E' && (tok.type != T_NUM || tok.ivalue <= 0)) { FWarn(1, "%c format significant digits greater than 0\n", f->type); return ERR_DOMAIN; } if ( f->type != 'E' && tok.ivalue == 0) { FWarn(1,"Warning format %c has zero significant digits\n", f->type); } f->precision = tok.ivalue; if ( f->precision >= f->width ) { FWarn(1,"Field width must be greater than %s\n", (f->type == 'F') ? "precision" : "significant digits"); return ERR_DOMAIN; } break; case 'G': /* picture format */ if ( rc = gettoken((unsigned char *)0) ) return rc; if ( tok.type != T_STRING ) { FWarn(1,"%c format requires a pattern\n", f->type); return ERR_DOMAIN; } f->gpattern = tok.svalue; f->width = strlen((DEV_STRARG)tok.svalue); if (f->symbpairs) { /* separate out any formating characters */ f->symgpairs = strdup(f->symbpairs); for ( i=0; i < strlen((DEV_STRARG)f->symbpairs); i +=2) { if ( (f->symbpairs[i] == '9') || (toupper(f->symbpairs[i]) == 'Z')) { f->symbpairs[i] = f->symbpairs[i+1] = ' '; /* remove from std */ f->symgpairs[i] = toupper(f->symgpairs[i]); /* Make sure contol UC */ } else { f->symgpairs[i] = f->symgpairs[i+1] = ' '; } } } /* a few warnings messages */ if ( f->blank_if_zero ) FWarn(1,"'b' qualifier ignored with G format\n"); if ( f->comma ) FWarn(1,"'c' qualifier ignored with G format\n"); if ( f->zerofill ) FWarn(1,"'z' qualifier ignored with G format\n"); if ( f->leftj ) FWarn(1,"'l' qualifier ignored with G format\n"); if ( f->nrdecor || f->prdecor ) FWarn(1,"Right decorators ignored with G format\n"); if ( f->nldecor && ( strlen((DEV_STRARG)f->nldecor) > 1) ) FWarn(1, "Negative/Left %s chars ignored\n", &(f->nldecor[1]) ); if ( f->pldecor && ( strlen((DEV_STRARG)f->pldecor) > 1) ) FWarn(1, "Positive/Left %s chars ignored\n", &(f->pldecor[1]) ); break; } return gettoken((unsigned char *)0); } /* * Parse the format string */ static int parseform( fmtlist ) struct format **fmtlist; { int state = 0; int repeat=0; int rc = 0; struct format *head, *frm, *savf = NULL; if ((frm = head = formalloc()) == NULL) { fmtlist = NULL; return ERR_DOMAIN; } for (;;) { switch (state) { case 0: /* Start state */ switch (tok.type) { case T_NUM: if ( 1 > (repeat = tok.ivalue) ) { FWarn(1,"Repetition factor should be greater than 0\n"); state = rc = -1; break; } state = (rc = gettoken((unsigned char *)0)) ? -1 : 1; break; case T_LPAREN: repeat = 1; state = (rc = gettoken((unsigned char *)0)) ? -1 : 2; break; case T_MODIFIER: state = 3; break; case T_EDIT: state = 4; break; case T_STRING: state = 5; break; default: FWarn(1,"Format string parse error\n"); state = rc = -1; break; } break; case 1: /* A repeat count has been encountered */ switch (tok.type) { case T_LPAREN: state = (rc = gettoken((unsigned char *)0)) ? -1 : 2; break; case T_MODIFIER: frm->type = 0; /* Loop */ frm->rcount = repeat; savf = frm; state = ((savf->loop = frm = formalloc()) == NULL) ? -1 : 3; break; case T_EDIT: frm->type = 0; /* Loop */ frm->rcount = repeat; savf = frm; state = ((savf->loop = frm = formalloc()) == NULL) ? -1 : 4; break; case T_STRING: frm->type = 0; /* Loop */ frm->rcount = repeat; savf = frm; state = ((savf->loop = frm = formalloc()) == NULL) ? -1 : 5; break; default: FWarn(1,"Format string parse error\n"); state = rc = -1; break; } break; case 2: /* * Opening parentheses have been encountered. Recursively * call parseform() to parse the expression within the parens. */ frm->type = 0; /* Loop */ frm->rcount = repeat; if ( rc = parseform( &(frm->loop) ) ) { state = -1; break; } if (tok.type != T_RPAREN) { FWarn(1,"Missing right paren ')'\n"); state = rc = -1; break; } state = (rc = gettoken((unsigned char *)0)) ? -1 : 6; break; case 3: /* A modifier has been seen */ if ( rc = parsemodifiers(frm) ) { state = -1; } else if (tok.type == T_EDIT) { state = 4; } else if (tok.type == T_STRING) { state = 5; } else { FWarn(1,"Missing edit specification\n"); state = rc = -1; } break; case 4: /* An edit specifier has been seen */ if (rc = parseedit(frm)) { state = rc = -1; } else { if ( tok.type==T_COMMA || tok.type==T_EOF || tok.type==T_RPAREN ) { state = 6; } else { FWarn(1,"Format phrases must be delimited\n"); state = rc = -1; } } break; case 5: /* A string has been seen */ frm->type = '<'; /* String */ frm->text = tok.svalue; frm->width = strlen((DEV_STRARG)tok.svalue); if ( (rc = gettoken((unsigned char *)0)) ) { state = -1; } else { if ( tok.type==T_COMMA || tok.type==T_EOF || tok.type==T_RPAREN ) { state = 6; } else { FWarn(1," must be delimited\n"); state = rc = -1; } } break; case 6: if (tok.type == T_COMMA) { if (rc = gettoken((unsigned char *)0)) { state = -1; break; } if (savf) { frm = savf; savf = NULL; } frm = frm->next = formalloc(); state = 0; tok.last = tok.current; /* progress pointers into format phrase */ } else { *fmtlist = head; /* Return from recursive call */ return 0; } break; default: freeforms(head); if (rc) { return ERR_DOMAIN; } else { FWarn(1,"Format string parse error\n"); return ERR_DOMAIN; } } } } /* * Traverse format list to determine size of output */ static void trav1(f, dcols, pcols, ncol) struct format *f; /* Next node of format tree to process */ int *dcols; /* Total number data columns left to format */ int *pcols; /* Number of print columns required */ int *ncol; /* Next column where printing will take place */ { int i; do { switch (f->type) { case 0: /* LOOP */ for (i = 0; i < f->rcount; i++) { if (!*dcols) return; trav1(f->loop, dcols, pcols, ncol); } break; case '<': /* String */ *ncol += f->width; *pcols = MAX(*pcols, *ncol); break; case 'X': if ( (f->width+*ncol) < 0) { (void) FWarn(0,"Rel tab modified (%d->%d) to keep position >= zero\n", f->width, (f->width=-*ncol)); } *ncol += f->width; *pcols = MAX(*pcols, *ncol); break; case 'T': *ncol = f->width + 1; /* :NOTEIT. next field is p+1 see trav2 */ *pcols = MAX(*pcols, *ncol); break; default: if (!*dcols) return; *ncol += f->width; *pcols = MAX(*pcols, *ncol); (*dcols)--; break; } } while (f = f->next); } /* * Determine number of printed columns in output */ static int printcols(fmtlist, dcols, pcols) struct format *fmtlist; int dcols; int *pcols; { int ncol = 0, rc=0; int save_dcols; *pcols = 0; /* to repeat on dcols where: (# of format phrases) < dcols */ while (dcols) { save_dcols=dcols; trav1(fmtlist, &dcols, pcols, &ncol); /* note pcols is a (int *) */ if ( dcols == save_dcols ) { FWarn(0,"Missing format phrases for data\n"); return ERR_DOMAIN; } } return rc; } /* * Put literal text into the output */ static int textformat(cp, f, rows, cols) char *cp; struct format *f; int rows, cols; { int i; int rc = 0; if ( TooBig(cp + f->width + cols*(rows-1)) ) return ERR_DOMAIN; for (i = 0; i < rows; i++) { (void)bcopy(f->text, cp, f->width); cp += cols; } return rc; } /* * Fill an output cell with a repeated background pattern */ static int backfill(cp, f) char *cp; struct format *f; { int j, k; int rc = 0; if (f->backfill) { if ( TooBig(cp + f->width ) ) return ERR_DOMAIN; for (j = k = 0; j < f->width; j++) { if ( cp[j] == ' ' ) cp[j] = f->backfill[k++]; if (!f->backfill[k]) k = 0; /* Backfill string short */ } } return rc; } /* * Put commas into a numeric string */ static void docomma(o,i,w,l) char *o; /* cooked buffer */ char *i; /* raw buffer */ int w; /* width */ int l; /* leading comma */ { int k,j; char *omax=o+COOKEDBUFSIZE; if (l&&!(w%3)) *o++=','; for(k=0,j=(w-1)%3+1;ksymbpairs); /* change default error symbol */ (void)memset(cp, *err_char, f->width); return; } static int aformat(cp, f, d, pcols) char *cp; struct format *f; struct column *d; int pcols; { int i, len; char *pp; int rc = 0; if ( TooBig( cp + f->width + pcols * (d->rows-1) ) ) return ERR_DOMAIN; switch (d->type) { case It: for (i = 0; i < d->rows; i++, d->p += d->cols, cp += pcols) { if (rc = backfill(cp, f)) return rc; if (f->leftj) *cp = (char)*d->p; else cp[f->width-1] = (char)*d->p; } break; case Ct: for (pp=(char *)d->p,i = 0;i < d->rows; i++, pp += d->cols, cp += pcols) { if (rc = backfill(cp, f)) return rc; if (f->leftj) *cp = *pp; else cp[f->width-1] = *pp; } break; case Et: for (i = 0; i < d->rows; i++, d->p += d->cols, cp += pcols) { if (!QS(*d->p) || (len = strlen((DEV_STRARG)(pp = XS(*d->p)->n))) > f->width) { errorSet(cp, "*", f); continue; } if (rc = backfill(cp, f)) return rc; if (f->leftj) (void)bcopy(pp, cp, len); else (void)bcopy(pp,cp+f->width-len,len); } break; default: for (i = 0;i < d->rows; i++, cp += pcols) { errorSet(cp, "*", f); } break; } return rc; } #ifdef FUNCNOTUSED static int roundnearest(d) double d; { return (d < 0.0) ? (int)(d - .5) : (int)(d + .5); } #endif static int iformat(cp, f, d, pcols) char *cp; struct format *f; struct column *d; int pcols; { int i, width, leading_comma=0; double val; char cooked[COOKEDBUFSIZE + 1], final[FINALBUFSIZE + 1], *p; int rc = 0; if ( TooBig( cp + f->width + pcols * (d->rows-1) ) ) return ERR_DOMAIN; for (i = 0; i < d->rows; i++, cp += pcols) { char *prefix = empty, *suffix = empty; if (rc = backfill(cp, f)) return rc; switch (d->type) { /* Only It and Ft var valid data types */ case It: val = (double)*d->p; d->p += d->cols; break; case Ft: val = *(F*)d->p; d->p = (I*)((F*)d->p + d->cols); break; default: errorSet(cp, "?", f); d->p += d->cols; continue; } if (val == 0.0) { if (f->blank_if_zero) continue; val = 0.0; /* Take care of problems like -0.0 */ } if (f->scale) val *= f->fscale; /* scale value if needed */ if (val < 0.0) { /* handle decorators for negatives */ if (f->nldecor) prefix = f->nldecor; else prefix = APL ? "\242": "-"; if (f->nrdecor) suffix = f->nrdecor; val = -val; } else if (val >= 0.0) { if (f->pldecor) prefix = f->pldecor; if (f->prdecor) suffix = f->prdecor; } /* Compute width available for integer part */ width = f->width - strlen((DEV_STRARG)prefix) - strlen((DEV_STRARG)suffix); if (f->comma) { leading_comma = f->zerofill && !(f->leftj || (width % 4)); width -= width / 4; } if (width > 0) { if (f->zerofill && !f->leftj) { sprintf(raw, "%0*.0f", width, val); } else { sprintf(raw, "%.0f", val); } } else { errorSet(cp, "*", f); continue; } { /* reckeck for zero evaluation up to '.' */ int i; for (i=0; raw[i] && raw[i] != '.' ; i++) if ( ISdigit(raw[i]) && raw[i] != '0' ) break; if ( (!raw[i]) || (raw[i] == '.') ) { /* If got to end must all be zeros */ if (f->blank_if_zero) continue; val = 0.0; /* Take care of problems like -0.0 */ } } if (f->comma) { width = (p = (char *)strchr((DEV_STRARG)raw, '.')) ? p - raw : strlen((DEV_STRARG)raw); docomma(cooked, raw, width, leading_comma); } else { (void)strncpy(cooked, raw, COOKEDBUFSIZE); } if (val == 0.0 && f->odecor) (void)strncpy(final, f->odecor, FINALBUFSIZE); else sprintf(final, "%s%s%s", prefix, cooked, suffix); symbpairs(final, f->symbpairs); width = strlen((DEV_STRARG)final); if (width > f->width) errorSet(cp, "*", f); else if (f->leftj) strncpy(cp, final, width); else strncpy(cp+f->width-width, final, width); } return rc; } static int eformat(cp, f, d, pcols) char *cp; struct format *f; struct column *d; int pcols; { int i, width, decpt, sign; I *tmp_p; double val; char cooked[COOKEDBUFSIZE + 1], expnt[EXPSIZE+1], final[FINALBUFSIZE + 1]; int rc = 0; int largest=1; char expFmtStr[10]; int InfOrNaN=0; if ( TooBig( cp + f->width + pcols * (d->rows-1) ) ) return ERR_DOMAIN; if ( f->leftj ) { sprintf(expFmtStr,"E%%d\0"); } else { /* scan data to get largest exponent */ tmp_p = d->p; for ( i=0; i < d->rows; i++ ) { switch ( d->type ) { case It: val = (double)*tmp_p; tmp_p += d->cols; break; case Ft: val = *(F*)tmp_p; tmp_p = (I*)((F*)tmp_p + d->cols); break; default: tmp_p += d->cols; continue; } #if defined(_AIX) || defined(__sgi) || defined(linux) | defined(__FreeBSD__) || defined(__NetBSD__) || (__APPLE__) ecvt(val, f->precision, &decpt, &sign); #else econvert(val, f->precision, &decpt, &sign, raw); #endif sprintf(expnt, "%d", --decpt); largest = MAX(largest, strlen((DEV_STRARG)expnt) ); } sprintf(expFmtStr,"E%%%dd\0", largest ); } for (i = 0; i < d->rows; i++, cp += pcols) { char *prefix = empty, *suffix = empty; if (rc = backfill(cp, f)) return rc; switch (d->type) { case It: val = (double)*d->p; d->p += d->cols; break; case Ft: val = *(F*)d->p; d->p = (I*)((F*)d->p + d->cols); break; default: errorSet(cp, "?", f); d->p += d->cols; continue; } if (val == 0.0) { if (f->blank_if_zero) continue; val = 0.0; /* Take care of problems like -0.0 */ } if (f->scale) val *= f->fscale; if (val < 0.0) { if (f->nldecor) prefix = f->nldecor; else prefix = APL ? "\242": "-"; if (f->nrdecor) suffix = f->nrdecor; val = -val; } else if (val >= 0.0) { if (f->pldecor) prefix = f->pldecor; if (f->prdecor) suffix = f->prdecor; } width = f->width - strlen((DEV_STRARG)prefix) - strlen((DEV_STRARG)suffix); #if defined(_AIX) || defined(__sgi) || defined(linux) | defined(__FreeBSD__) || defined(__NetBSD__) || (__APPLE__) if (width > 0) { (void)strncpy(raw, (char *)ecvt(val, f->precision, &decpt, &sign), RAWBUFSIZE); #else if (width > 0 && econvert(val, f->precision, &decpt, &sign, raw)) { #endif if ( (!strcmp((DEV_STRARG)raw,(DEV_STRARG)"Inf")) || (!strcmp((DEV_STRARG)raw,(DEV_STRARG)"INF")) || (!strcmp((DEV_STRARG)raw,(DEV_STRARG)"NaN")) ) InfOrNaN=1; else InfOrNaN=0; if(!InfOrNaN){ if ( '0' == *raw ) { /* recheck if conversion returned a zero */ if (f->blank_if_zero) continue; val = 0.0; /* Take care of problems like -0.0 */ } sprintf(expnt, expFmtStr, --decpt); if (decpt < 0 && APL) { /* Insert negative next to exponent */ int i; for (i=1; expnt[i]; i++) if ( expnt[i] == '-') {expnt[i] = '\242'; break; } } if (f->precision <= 0) (void)strncpy(cooked, expnt, COOKEDBUFSIZE); else if (f->precision == 1) sprintf(cooked, "%c%s", raw[0], expnt); else { cooked[0]=raw[0]; cooked[1]='.'; cooked[2]='\0'; strncat(cooked,raw+1,COOKEDBUFSIZE-2); strncat(cooked,expnt,COOKEDBUFSIZE-strlen((DEV_STRARG)cooked)); } } else { (void)strncpy(cooked, raw, COOKEDBUFSIZE); } } else { errorSet(cp, "*", f); continue; } if (val == 0.0 && f->odecor) (void)strncpy(final, f->odecor, FINALBUFSIZE); else sprintf(final, "%s%s%s", prefix, cooked, suffix); if (!InfOrNaN) symbpairs(final, f->symbpairs); width = strlen((DEV_STRARG)final); if (width > f->width) errorSet(cp, "*", f); else if (f->leftj) strncpy(cp, final, width); else strncpy(cp+f->width-width, final, width); } return rc; } static int fformat(cp, f, d, pcols) char *cp; struct format *f; struct column *d; int pcols; { int i, width, leading_comma=0; double val; char cooked[COOKEDBUFSIZE + 1], final[FINALBUFSIZE + 1], *p; int rc = 0; int InfOrNaN=0; if ( TooBig( cp + f->width + pcols * (d->rows-1) ) ) return ERR_DOMAIN; for (i = 0; i < d->rows; i++, cp += pcols) { char *prefix = empty, *suffix = empty; if (rc = backfill(cp, f)) return rc; switch (d->type) { case It: val = (double)*d->p; d->p += d->cols; break; case Ft: val = *(F*)d->p; d->p = (I*)((F*)d->p + d->cols); break; default: errorSet(cp, "?", f); d->p += d->cols; continue; } if (val == 0.0) { if (f->blank_if_zero) continue; val = 0.0; /* Take care of problems like -0.0 */ } if (f->scale) val *= f->fscale; if (val < 0.0) { if (f->nldecor) prefix = f->nldecor; else prefix = APL ? "\242": "-"; if (f->nrdecor) suffix = f->nrdecor; val = -val; } else if (val >= 0.0) { if (f->pldecor) prefix = f->pldecor; if (f->prdecor) suffix = f->prdecor; } /* Compute width available for integer part */ width = f->width - f->precision - 1 - strlen((DEV_STRARG)prefix) - strlen((DEV_STRARG)suffix); if (f->comma) { leading_comma = f->zerofill && !(f->leftj || (width % 4)); width -= width / 4; } width += f->precision + 1; if (width > 0) { if (f->zerofill && !f->leftj) { sprintf(raw, "%#0*.*f", width, f->precision, val); } else { sprintf(raw, "%#.*f", f->precision, val); } } else { errorSet(cp, "*", f); continue; } { /* reckeck for zero evaluation */ int i; for (i=0; raw[i]; i++) if ( ISdigit(raw[i]) && raw[i] != '0' ) break; if ( !raw[i] ) { /* If got to end must all be zeros */ if (f->blank_if_zero) continue; val = 0.0; /* Take care of problems like -0.0 */ } } if ( (!strcmp((DEV_STRARG)raw,(DEV_STRARG)"Inf")) || (!strcmp((DEV_STRARG)raw,(DEV_STRARG)"INF")) || (!strcmp((DEV_STRARG)raw,(DEV_STRARG)"NaN"))) InfOrNaN=1; else InfOrNaN=0; if (f->comma && !InfOrNaN) { width = (p = (char *)strchr((DEV_STRARG)raw, '.')) ? p - raw : strlen((DEV_STRARG)raw); docomma(cooked, raw, width, leading_comma); } else { (void)strncpy(cooked, raw, COOKEDBUFSIZE); } if (val == 0.0 && f->odecor) (void)strncpy(final, f->odecor, FINALBUFSIZE); else sprintf(final, "%s%s%s", prefix, cooked, suffix); if(!InfOrNaN) symbpairs(final, f->symbpairs); width = strlen((DEV_STRARG)final); if ( (1 == (width - f->width)) && ('0'==*final) ){ /* shift if only 1 lead 0 */ int i; for(i=1; i f->width) errorSet(cp, "*", f); else if (f->leftj) strncpy(cp, final, width); else strncpy(cp+f->width-width, final, width); } return rc; } #define DIGIT 0 #define NOZERO 1 #define NONSIG 2 #define NUMSYMS 3 static int gformat(cp, f, d, pcols) char *cp; struct format *f; struct column *d; int pcols; { int i, j, width; double val; char final[FINALBUFSIZE + 1]; char *num_p = NULL, *fmt_p = NULL; int rc = 0; char ok, prefix_set = 0, trailing_zero; char stdsym[NUMSYMS + 1]; stdsym[DIGIT]='9'; stdsym[NOZERO]='Z'; stdsym[NONSIG]='_'; stdsym[NUMSYMS]='\0'; if ( TooBig( cp + f->width + pcols * (d->rows-1) ) ) return ERR_DOMAIN; for (i = 0; i < d->rows; i++, cp += pcols) { char *prefix; prefix = empty; switch (d->type) { /* Only It and Ft var valid data types */ case It: val = (double)*d->p; d->p += d->cols; break; case Ft: val = *(F*)d->p; d->p = (I*)((F*)d->p + d->cols); break; default: errorSet(cp, "?", f); d->p += d->cols; continue; } if (val == 0.0) { val = 0.0; /* Take care of problems like -0.0 */ } if (f->scale) val *= f->fscale; /* scale value if needed */ if (val < 0.0) { /* handle decorators for negatives */ prefix_set = 1; if (f->nldecor) prefix = f->nldecor; else prefix = APL ? "\242": "-"; val = -val; } else if (val >= 0.0) { if (f->pldecor) { prefix_set = 1; prefix = f->pldecor; } else { prefix_set=0; } } /* Compute width available for integer part */ width = f->width - strlen((DEV_STRARG)prefix); if (width > 0) { if (f->zerofill && !f->leftj) { sprintf(raw, "%0*.0f", width, val); } else { sprintf(raw, "%.0f", val); } } else { errorSet(cp, "*", f); continue; } symbpairs(stdsym, f->symgpairs); /* allow substitution for controls */ strncpy(final,f->gpattern,FINALBUFSIZE); reverse(raw); reverse(final); ok = 1; trailing_zero = 1; /* reset indicator flags */ for( fmt_p = (char *)final, num_p = (char *)raw; *fmt_p && ok; fmt_p++) { if ( *fmt_p == stdsym[DIGIT] || toupper(*fmt_p) == stdsym[DIGIT] ) { if ( ! *num_p ) { /* nothing left */ *fmt_p = '0'; if ( trailing_zero ) trailing_zero = 0; continue; } if ( ! ISdigit(*num_p) ) { ok = 0; continue; } /* error: must be a number */ if ( trailing_zero ) trailing_zero = 0; *fmt_p = *num_p; num_p++; } else if ( *fmt_p == stdsym[NOZERO] || toupper(*fmt_p) == stdsym[NOZERO] ) { if ( ! *num_p ) { /* nothing left */ *fmt_p = (prefix_set) ? *prefix : ' '; if (prefix_set) prefix_set = 0; /* set only one */ continue; } if ( ! ISdigit(*num_p) ) { ok = 0; continue; } /* error: must be a number */ if (trailing_zero) trailing_zero = (*num_p == '0') ? 1 : 0; if (trailing_zero) { *fmt_p = ' '; trailing_zero = 1; } else { *fmt_p = *num_p; } num_p++; } } reverse ( final ); if ( ok && !*num_p && !prefix_set ) { /* remove decorators not surrounded by digits */ /* by moving a 3 element window though pattern */ /* g _fmt 12 123 123456 */ /* refund 12 */ /* refund 1.23 */ /* refund 1,234.56 */ for ( j=2; j < f->width; j++){ if ( (!ISdigit(final[j-2])) || (!ISdigit(final[j])) ) { if ( (toupper(f->gpattern[j-2]) == stdsym[DIGIT] || toupper(f->gpattern[j-2]) == stdsym[NOZERO]) && (toupper(f->gpattern[j]) == stdsym[DIGIT] || toupper(f->gpattern[j]) == stdsym[NOZERO]) && (toupper(f->gpattern[j-1]) != stdsym[DIGIT] && toupper(f->gpattern[j-1]) != stdsym[NOZERO]) ){ final[j-1] = ' '; /* remove decorator */ } } } symbpairs(final, f->symbpairs); strncpy(cp, final, f->width); if (rc = backfill(cp, f)) return rc; } else { errorSet(cp, "*", f); } } return rc; } static int trav2(f, d, rows, i, dcols, ncol, pcols, buf) struct format *f; struct column *d; int rows, *i, dcols, *ncol, pcols; char *buf; { int j; static char *cp = NULL; int rc = 0; cp = buf + *ncol; do { switch (f->type) { case 0: /* LOOP */ for (j = 0; j < f->rcount; j++) { if (*i >= dcols) return rc; if (rc = trav2(f->loop, d, rows, i, dcols, ncol, pcols, buf)) return rc; } break; case '<': /* String */ if (rc = textformat(cp, f, rows, pcols)) return rc; cp += f->width; break; case 'X': cp += f->width; break; case 'T': cp = buf + f->width + 1; break; case 'A': if (*i >= dcols) return rc; if (rc = aformat(cp, f, d+*i, pcols)) return rc; cp += f->width; (*i)++; break; case 'I': if (*i >= dcols) return rc; if (rc = iformat(cp, f, d+*i, pcols)) return rc; cp += f->width; (*i)++; break; case 'E': if (*i >= dcols) return rc; if (rc = eformat(cp, f, d+*i, pcols)) return rc; cp += f->width; (*i)++; break; case 'F': if (*i >= dcols) return rc; if (rc = fformat(cp, f, d+*i, pcols)) return rc; cp += f->width; (*i)++; break; case 'G': if (*i >= dcols) return rc; if (rc = gformat(cp, f, d+*i, pcols)) return rc; cp += f->width; (*i)++; break; } *ncol = cp - buf; } while (f = f->next); return rc; } static int dofmt(fmtlist, rows, dcols, pcols, buf) struct format *fmtlist; int rows, dcols, pcols; char *buf; { int i = 0; int ncol = 0; int rc = 0; while (i < dcols) { if (rc=trav2(fmtlist, dataList, rows, &i, dcols, &ncol, pcols, buf)) { if ( rc ) FWarn(0,"Output A+ object allocation error\n"); return ERR_DOMAIN; } } return rc; } /* * Format arrays - QUAD FMT imitation */ ENTRYPOINT A ep_fmt(f, d) unsigned char *f; A d; { A a; I dims[2]; int maxrows = 0; /* maximum rows */ int dcols = 0; /* number of data columns */ int pcols; /* number of print columns */ int rc = 0; /* general return code */ struct format *fmtlist; /* tree of format phrases */ if ( 2>strlen((DEV_STRARG)f) ) { FWarn(0,"Format phase too short\n"); ERROUT(ERR_DOMAIN); } NDC1(d); /* Make a list of primitive objects (depth first) */ dataList = (struct column *)malloc(DATAINC * sizeof(*dataList)); dataAllocated = DATAINC; if ( rc = datafind(&dcols, &maxrows, d) ) { if (dataList) (void)free((char *)dataList); ERROUT(rc); } /* Parse the format specification */ fmtlist = NULL; if ( (rc = gettoken(f)) || (rc = parseform( &fmtlist )) ) { freeforms(fmtlist); if (dataList) (void)free((char *)dataList); if ( rc == ERR_MESSAGE ) ERRMSG(errmsg_fmt) else ERROUT(rc); } else { /* OK print warning if not at end */ if (tok.type != T_EOF) { (void)FWarn(0,"Extra characters at end of format ignored\n"); } } /* Determine and allocate space needed to hold formatted output */ if ( rc = printcols(fmtlist, dcols, &pcols) ){ freeforms(fmtlist); if (dataList) (void)free((char *)dataList); if ( rc == ERR_MESSAGE ) ERRMSG(errmsg_fmt) else ERROUT(rc); } dims[0] = maxrows; dims[1] = pcols; if (!(a = (A)ga(Ct,2,pcols*maxrows,dims))) { freeforms(fmtlist); if (dataList) (void)free((char *)dataList); return NULL; } (void)memset((char *)a->p, ' ', pcols*maxrows); EndOfObj = (pcols*maxrows) + (char *)a->p; /* save addr for data boundry */ /* Format the data */ if (rc = dofmt(fmtlist, maxrows, dcols, pcols, (char *)a->p)) { if ( rc == ERR_MESSAGE ) ERRMSG(errmsg_fmt) else ERROUT(rc); } freeforms(fmtlist); if (dataList) (void)free((char *)dataList); return a; } void fmtInstall() { install((PFI)ep_fmt,"_fmt", A_, 2, CP, A_,0,0,0,0,0,0); return; } #if defined(__FreeBSD__) || defined(__NetBSD__) /* ecvt.c -- an implementation of ecvt() Choose your browser's option to Save As... to download this code example. Send the program to your AS/400 using FTP or similar method and include it in your source code with the line below. #include "ecvt.c" This program was developed on a V3R7 system. There is a notable difference between this version of ecvt() and that of other platforms. This relates to the use of _INF, INFINITY, and NAN macros. None of these macros exist in AS/400 header files, so as such, are not directly supported. However, the HUGE_VAL macro is supported for the incoming Value parameter. To simulate the action of ecvt() on other platforms, the HUGE_VAL macro is translated to return "INF" as the resultant string of ecvt(). NAN is supported using another workaround, the isnan() workaround. This code fragment that is furnished by IBM is a simple example to provide an illustration. This example has not been thoroughly tested under all conditions. IBM, therefore, cannot guarantee or imply reliability, serviceability, or function of this program. All code contained herein is provided to you "AS IS". THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY DISCLAIMED. */ #include #include #define QPIDECVTBUFSIZE 128 /* typedef struct { */ /* unsigned long lobits; */ /* unsigned long hibits; */ /* } BITMASK; */ /* typedef union { */ /* BITMASK bm; */ /* double dv; */ /* } OVERLAY; */ /* #define EXPBITS 0x7FF00000 */ /* #define ALLZEROS 0x00000000 */ /* #define CHKEXP 0x000FFFFF */ /****** prototypes ******/ /* int isnan(double fres); */ /* int finite(double fres); */ char* ecvt(double Value, int NumberOfDigits, int* DecimalPointer, int* Sign); /************************/ char* QPIDecvt_buffer=NULL; char* ecvt(double Value, int NumberOfDigits, int* DecimalPointer, int* Sign) { char buf[QPIDECVTBUFSIZE]; char spfbuf[10]; int idx=0; int idx2; int aft=0; if (QPIDecvt_buffer == NULL) QPIDecvt_buffer = (char*)malloc(QPIDECVTBUFSIZE); if (!finite(Value)) { *DecimalPointer=0; if (Value < 0) *Sign = 1; else *Sign = 0; strcpy(QPIDecvt_buffer,"INF"); return QPIDecvt_buffer; } if (isnan(Value)) { *Sign=0; *DecimalPointer=0; strcpy(QPIDecvt_buffer,"NAN"); return QPIDecvt_buffer; } *Sign = 0; sprintf(buf, "%#+1.*E",NumberOfDigits-1,Value); printf(" buf '%s'\n", buf); switch (buf[idx]) { case '-': *Sign = 1; aft++; break; case '+': aft++; break; } QPIDecvt_buffer[0] = buf[1]; for (idx=1; idx < NumberOfDigits; idx++) QPIDecvt_buffer[idx] = buf[idx+2]; QPIDecvt_buffer[NumberOfDigits] = '\0'; sscanf(buf+NumberOfDigits+4, "%d", DecimalPointer); (*DecimalPointer) ++; return QPIDecvt_buffer; } #if 0 /* just call the libc libm versions for isnan and finite */ int isnan( double fres ) { OVERLAY value; value.dv = fres; if ( ( (value.bm.lobits & EXPBITS) == EXPBITS ) && ( ( (value.bm.lobits & CHKEXP) != ALLZEROS ) || ( value.bm.hibits != ALLZEROS ) ) ) return( 1 ); /* Yes, it is not a number NaN */ else return( 0 ); /* it is a number */ } int finite( double fres ) { OVERLAY value; value.dv = fres; if ( ( (value.bm.lobits & EXPBITS) == EXPBITS ) && ( (value.bm.lobits & CHKEXP) == ALLZEROS ) && ( value.bm.hibits == ALLZEROS ) ) return( 0 ); /* No, it is not a finite number */ else return( 1 ); /* it is a finite number */ } #endif #endif aplus-fsf-4.22/src/esf/info.c0000644000265000001440000000626610772770355011510 /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /************************************************************************* * * "Info" functions for reporting on A entities. * * Malcolm Austin * * Entry points: ep_name ep_valence * */ #if defined(__NetBSD__) || defined(__FreeBSD) || defined (__APPLE__) #include #else #include #endif #include #include #include #include #include #undef ENTRYPOINT #define ENTRYPOINT static extern V sv(); extern C*xfs_name[]; extern I xfs_valence[]; extern I xfs_argtypes[]; extern A gsym(); Z V av(a)A a; { I n=a->n-1; if (!sym(a)||n>1) R (V)0; R sv(n?cxi(XS(*a->p)):Cx,XS(a->p[n])); } extern C*pp(); ENTRYPOINT A ep_name(aobj) A aobj; { A a, z; if (!QA(aobj)||Et!=aobj->t||1!=aobj->n) ERROUT(ERR_DOMAIN);a=(A)*aobj->p; if (QA(a)) { if (Et==a->t) ERROUT(ERR_NONCE);if (Xt>=a->t) ERROUT(ERR_DOMAIN); z=gs(Et);z->p[0]=MS(symjoin(((CX)(a->p[a->n+2]))->s,XS(*a->d))); } else if (QX(a)) z=gsym(xfs_name[U(a)]); else if (QP(a)) z=gsym(pp(a)); else ERROUT(ERR_NONCE); R z; } ENTRYPOINT I ep_valence(aobj) A aobj; { A a=0; V v; if (QA(aobj)&&Xt+1==aobj->t) a=aobj; else { if (!QA(aobj)||Et!=aobj->t) ERROUT(ERR_DOMAIN); if (0!=(v=av(aobj))) a=(A)v->a; else if (1 == aobj->n) a=(A)*aobj->p; else ERROUT(ERR_DOMAIN); } if(0==a) ERROUT(ERR_DOMAIN); if (QA(a)) { if (Xt+1 == a->t) R a->r-1; if (Et==a->t || Xtt) ERROUT(ERR_NONCE); ERROUT(ERR_DOMAIN); } else if (QX(a)) { R xfs_valence[U(a)]; } else ERROUT(ERR_NONCE); } ENTRYPOINT A ep_locals(aobj) A aobj; { A a=0,z,za; V v;I *zp, ux, xpa; if (QX(aobj)||QA(aobj)&&Xt+1==aobj->t) a=aobj; else { if (!QA(aobj)||Et!=aobj->t) ERROUT(ERR_DOMAIN); if (0!=(v=av(aobj))) a=(A)v->a; else if (1 == aobj->n) a=(A)*aobj->p; else ERROUT(ERR_DOMAIN); } if(0==a) ERROUT(ERR_DOMAIN); if (QA(a)) { if (Xt+1 == a->t) { z=gvi(Et,3,gs(Et),gv(Et,a->r-1),gv(Et,a->n-1)); za=(A)z->p[0];za->p[0]=MS(symjoin(((CX)a->p[2+a->n])->s,XS(a->d[0]))); za=(A)z->p[1];zp=za->p;DO(za->n,zp[i]=a->d[i+1]); za=(A)z->p[2];zp=za->p;DO(za->n,zp[i]=a->p[i+1]); R z; } if (Et==a->t || Xtt) ERROUT(ERR_NONCE); ERROUT(ERR_DOMAIN); } else if (QX(a)) { ux=U(a); z=gvi(Et,3,gsym(xfs_name[ux]),gv(It,xfs_valence[ux]),gz()); za=(A)z->p[1];zp=za->p; xpa=xfs_argtypes[ux];DO(za->n,{zp[i]=xpa%16;xpa>>=4;}); R z; } else ERROUT(ERR_NONCE); } void infoInstall() { install((PFI)ep_name, "_name", A_, 1, A_,0,0,0,0,0,0,0); install((PFI)ep_valence, "_valence", IV, 1, A_,0,0,0,0,0,0,0); install((PFI)ep_locals, "_locals", A_, 1, A_,0,0,0,0,0,0,0); R; } aplus-fsf-4.22/src/esf/ssr.c0000644000265000001440000003033710772770355011360 /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /************************************************************************* * * String Search and Replace utilities for A * * Malcolm Austin - V1.2 - 10/25/90 * * Entry points: ep_ns ep_nsr ep_ss ep_ssr ep_gsr * */ #include #include #include #include #include #include #include #include #include #include #include #undef ENTRYPOINT #define ENTRYPOINT static SUBROUTINE A gst(C *s,I len) { A z=(A)gc(Ct,1,len,(I *)&len,(I *)s); ((C *)(z->p))[len]='\0'; R z; } /*****************************************************************/ /* * Modified Boyer-Moore string search * */ I *kmp_table(p, tlen) UC *p; { I *next; int i,j,o=tlen-1; /* H("target:[%s]\n",p); */ next=ma(tlen+1); next[0]=-1; for(i=0,j=-1;i=0) && (p[o-i] !=p[o-j])) j = next[j]; R next; } SUBROUTINE I *bm_table(UC *p,I tlen) { I *bm_array=ma(256); DO(256,bm_array[i]=tlen); DO(tlen,bm_array[p[i]]=tlen-(i+1)); R bm_array; } SUBROUTINE UC *bm_strstr( source, slen, target, tlen, t_bm) UC *source, *target; I *t_bm; I slen, tlen; { UC *s=source; I i,j,t; if(slent)?tlen-j:t; if(i>=slen)R 0; j = tlen-1; } if(0==j)R s+i; else i--,j--; } R 0; } SUBROUTINE UC *bm_strmat(UC *source, I slen, UC *target, I tlen, I *t_bm, UC *startp, I oslen, I rowlen) { UC *s=source, *z=0; I toofar=rowlen-tlen; z=bm_strstr(s,slen,target,tlen,t_bm); while (z&&toofar<(z-startp)%rowlen) { s=z+1; slen=oslen-(s-startp); z=bm_strstr(s,slen,target,tlen,t_bm); } return z; } #ifdef FUNCNOTUSED ENTRYPOINT ep_bms(asource, atarget)A asource, atarget; { I *t_bm; t_bm=bm_table((UC *)atarget->p, atarget->n); } #endif /*****************************************************************/ /* strname * finds first occurance of target in source. Target must be a syntatic * element, defined as surrounded by non-alphamerics, including '._' * NULL returned if not found, else first occurance. */ static int UseAlnum; static char *DefaultBeyondZebra="._`"; static char *BeyondZebra; #define ISnamechar(X) ((UseAlnum && ISalnum(X)) || \ ((X) && NULL!=strchr((DEV_STRARG)BeyondZebra,X))) #define ISalnumA(X) ( ISalnum(X) || '.'==(X) || '_'==(X) || ''==(X) ) #define INCODE (!(incomment || inquote || indquote)) SUBROUTINE UC * strname(UC *source, I slen, UC *target, I tlen) { int inquote = FALSE; int indquote = FALSE; int incomment = FALSE; UC *s; UC *stop=source+(slen-tlen); for ( s=source ; s <= stop ; ++s) { switch(*s) { case '\"': if (!(incomment||inquote)) indquote = !indquote; break; case '\\': if (indquote) ++s; break; case '\'': if (!(incomment||indquote)) inquote = !inquote; break; case '': if (!(inquote||indquote)) incomment = TRUE; break; case '\n': if (!(inquote||indquote)) incomment = FALSE; break; default: if ( INCODE && 0 == bcmp(s, target, tlen)) if ((s==source || !ISnamechar(*(s-1))) && !ISnamechar(*(s+tlen))) return(s); break; } } return(NULL); } /* strsearch * finds all occurances of target in source. Returns array of occurances * found. Indexes of occurance placed into ma'ed array. *pcount is set * to number of hits. If no hits are found, NULL is returned. */ SUBROUTINE A strsearch( source, slen, target, tlen, pcount, flags, rowlen) UC *source, *target; char *flags; I *pcount, slen, tlen, rowlen; { UC *s=source; I qarray = 8,oslen=slen; I *indexes=0; int namesonly=FALSE; I *t_bm=0; A z=0,za; if (flags) { if (NULL != strchr((DEV_STRARG)flags, 'n')) namesonly = TRUE; } *pcount = 0; if (0==tlen) return(0); if (!namesonly){ t_bm=bm_table(target,tlen);if(q)goto OUT; } z=gv(It,qarray); indexes=z->p; z->n=0; while (NULL!=s) { if (namesonly) s=strname(s,slen,target,tlen); else if (rowlen) s=bm_strmat(s,slen,target,tlen,t_bm,source,oslen,rowlen); else s=bm_strstr(s,slen,target,tlen,t_bm); if(q)goto OUT; if (s) { if (qarray==*pcount) { qarray*=2; za=gv(It,qarray); tmv(It,za->p,z->p,*pcount); dc(z); z=za; indexes=z->p; } indexes[(*pcount)++]=s-source; s+=tlen; slen=oslen-(s-source); } } OUT: if(t_bm)mf(t_bm); z->d[0]=z->n=*pcount; return(z); } #ifdef FUNCNOTUSED /* insert s2 at s[pos], pasting over len chars, and moving others to right */ SUBROUTINE char * strpaste(s, s2, pos, len) char *s, *s2; int pos, len; { int i, shift; /* if( limit < strlen(s)+strlen(s2)-len ) return(NULL); */ if ( NULL == s2) s2 = ""; shift = strlen((DEV_STRARG)s2) - len; if (0 < shift) for ( i = strlen((DEV_STRARG)s); i>=pos+len ; --i) *(s+(i+shift)) = *(s+i); else if (0 > shift) for ( i = pos+len ; i<=strlen((DEV_STRARG)s) ; ++i ) *(s+(i+shift)) = *(s+i); strncpy( s+pos, s2, strlen((DEV_STRARG)s2)); return(s); } #endif SUBROUTINE UC * ucapaste(s, s2, s2len, pos) UC *s, *s2; I s2len, pos; { if (s2==(UC *)0) s2len=0; if(s2len)bcopy( s2, s+pos, s2len); return(s); } /* stralias This function takes a list of "names"--syntactic elements (targets), and replaces them with the corresponding element of repls. targets and repls are A objects, either char strings or vlists. */ SUBROUTINE A stralias( asource, targetarg, replarg, flags) A asource; A targetarg, replarg; char *flags; { int i=0, ni, slen=asource->n; int clen, sidx=0, nhits=0; I rlen = 0, ridx=0 ; UC *r1=0,*source=(UC *)(asource->p); A result, targets, repls; I *hits, **t_bms=0; int namesonly=FALSE,shapepreserved=(2<=asource->r)?TRUE:FALSE; int rowlen=asource->d[asource->r-1]; if (0==slen) R(A)ic(asource); if (flags) { if (NULL != strchr((DEV_STRARG)flags, 'n')) namesonly = TRUE; } if (Ct==targetarg->t) { if (Ct!=replarg->t) ERROUT(ERR_TYPE); targets=gv(Et, 1); targets->p[0]=ic(targetarg); repls=gv(Et, 1); repls->p[0]=ic(replarg); } else { targets=(A)(ic(targetarg)); repls=(A)(ic(replarg)); } ni=targets->n; if(shapepreserved) DO(ni,if(IAF(targets,i,n)!=IAF(repls,i,n))shapepreserved=FALSE); if (Et==targets->t) { if (!namesonly){ if(ni)t_bms=(I **)ma(ni); DO(ni,t_bms[i]=0); } if ( ni != repls->n ){dc(targets);dc(repls);ERROUT(ERR_LENGTH);} hits = ma(slen+1); for(i=0; i<=slen; ++i) hits[i]=-1; for (i=0; ip[i]; repl=(A)repls->p[i]; if (!QA(target)||!QA(repl)){dc(targets);dc(repls);ERROUT(ERR_TYPE);} tlen=target->n; if (0==tlen) continue; if (Ct!=target->t||Ct!=repl->t){dc(targets);dc(repls);ERROUT(ERR_TYPE);} r1=source;rlen=slen; if (namesonly) r1=strname(r1,rlen,(UC *)target->p,tlen); else { t_bms[i]=bm_table((UC *)target->p,tlen); if (shapepreserved) r1=bm_strmat(r1,rlen,(UC *)target->p,tlen,t_bms[i],source,slen,rowlen); else r1=bm_strstr(r1,rlen,(UC *)target->p,tlen,t_bms[i]); } while( NULL!=r1 && 0>hits[r1-source] ) { ++nhits; hits[r1-source] = i; r1+=target->n;rlen=slen-(r1-source); if (namesonly) r1=strname(r1,rlen,(UC *)target->p,tlen); else if (shapepreserved) r1=bm_strmat(r1,rlen,(UC *)target->p,tlen,t_bms[i],source,slen,rowlen); else r1=bm_strstr(r1,rlen,(UC *)target->p,tlen,t_bms[i]); } } if (nhits&&shapepreserved) { I srlen=asource->d[asource->r-1]; for(i=0;isidx); } else {r1=source;rlen=slen;} mf(hits); } else {q=ERR_TYPE;goto OUT;} OUT: dc(targets); dc(repls); if(t_bms){DO(ni,if(t_bms[i])mf(t_bms[i]));mf((I *)t_bms);} if(q)R 0; result = gst((C *)r1,rlen); if(shapepreserved&&slen==rlen&&2<=asource->r){ result->r=asource->r;DO(result->r,result->d[i]=asource->d[i]); } if (r1 != source && NULL != r1) mf((I *)r1); return(result); } ENTRYPOINT A ep_ssr( asource, targets, repls) A asource; A targets, repls; { NDC2(targets,repls); UseAlnum=TRUE; BeyondZebra=DefaultBeyondZebra; return(stralias( asource, targets, repls, "")); } ENTRYPOINT A ep_nsr( asource, targets, repls) A asource; A targets, repls; { NDC2(targets,repls); UseAlnum=TRUE; BeyondZebra=DefaultBeyondZebra; return(stralias( asource, targets, repls, "n")); } SUBROUTINE A ss_matrix(A source, A hits, I tlen) { A z; I count,i,j,idx,ld=source->r-1,good=source->d[ld]-tlen,e[MAXR]; if(hits==(A)0)R gm(It,source->r,0); e[ld]=1; for(i=ld;0<=--i;)e[i]=source->d[i+1]*e[i+1]; for(i=count=0;in;++i)if(good>=(hits->p[i]%source->d[ld]))++count; z=gm(It,source->r,count); for(i=idx=0;in;++i)if(good>=(hits->p[i]%source->d[ld])){ for(j=ld;0<=j;--j)z->p[j*count+idx]=(hits->p[i]/e[j])%source->d[j]; ++idx; } dc(hits); /* throw away old result */ R z; } /* ssmain * A=>C cover for string search routine. Returns vector of indexes. */ SUBROUTINE A ssmain( source, target, options) A source; A target;C *options; { I count=0; A result; result=strsearch((UC *)source->p,source->n,(UC *)target->p,target->n, &count,options,(2>source->r)?0:source->d[source->r-1]); if(q){dc(result);R 0;} if(2<=source->r)result=ss_matrix(source,result,target->n); return(result?result:gv(It,0)); } ENTRYPOINT A ep_ss( source, target)A source; A target; { UseAlnum=TRUE; BeyondZebra=DefaultBeyondZebra; return(ssmain( source, target, "")); } ENTRYPOINT A ep_ns( source, target)A source, target; { UseAlnum=TRUE; BeyondZebra=DefaultBeyondZebra; return(ssmain( source, target, "n")); } /* * cover function for generalized ssr routine */ SUBROUTINE A gsrmain(asource, targets, repls, namechars) A asource; A targets, repls, namechars; { char *s; UseAlnum=TRUE; BeyondZebra=DefaultBeyondZebra; if (IsNull(namechars)) { if (IsNull(repls)) { if (Ct!=targets->t) ERROUT(ERR_TYPE); return(ssmain(asource, targets, "")); } else { return (stralias(asource, targets, repls, "")); } } else { if (Ct != namechars->t) ERROUT(ERR_TYPE); s=(char *)namechars->p; if (namechars->n &&''==s[0]) UseAlnum=FALSE, BeyondZebra=1+s; else UseAlnum=TRUE, BeyondZebra=s; if (IsNull(repls)) { if (Ct!=targets->t) ERROUT(ERR_TYPE); return (ssmain(asource, targets, "n")); } else { return(stralias(asource, targets, repls, "n")); } } } ENTRYPOINT A ep_gsr( asource, targets, repls, namechars) A asource; A targets, repls, namechars; { NDC2(targets,repls);NDC1(namechars); return(gsrmain(asource, targets, repls, namechars)); } void ssrInstall() { install((PFI)ep_ns, "_ns", A_, 2, CA, CA,0,0,0,0,0,0); install((PFI)ep_nsr, "_nsr", A_, 3, CA, A_, A_,0,0,0,0,0); install((PFI)ep_ss, "_ss", A_, 2, CA, CA,0,0,0,0,0,0); install((PFI)ep_ssr, "_ssr", A_, 3, CA, A_, A_,0,0,0,0,0); install((PFI)ep_gsr, "_gsr", A_, 4, CA, A_, A_, A_,0,0,0,0); /* install((PFI)ep_bms, "_bms", A_, 2, A_, A_,0,0,0,0,0,0); */ R; } aplus-fsf-4.22/src/esf/index.c0000644000265000001440000001023610772770355011654 /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #include #include #include #include #include Z I e; #define G00(T,f) Z void f(r,a,w,na,n)T *r,*w,*na;I *a,n; #define CI(T,f) G00(T,f)DO(n,if((unsigned long)(n=*a++)>=e)*r++=*na;else *r++=w[n];) CI(I,jj0)CI(F,jj1)CI(C,jj2) Z void (*indf[])()={jj0,jj1,jj2}; ENTRYPOINT A ep_from(aidx,asrc,ana)A aidx,asrc,ana; { A z,na=0;I i,ic=1,idx=0,is;C *cp,*zcp;I zn=1,d[MAXR];NDC2(asrc,ana); if(asrc->t!=ana->t||Et==ana->t&&asrc->n&&sym(ana)!=sym(asrc)) ERROUT(ERR_TYPE); if(0==asrc->r||0!=ana->r&&ana->r!=asrc->r-1)ERROUT(ERR_RANK); if(MAXRr+asrc->r-1)ERROUT(ERR_MAXRANK); for(i=0;ir;++i)zn*=d[idx++]=aidx->d[i]; for(i=1;ir;++i){ zn*=d[idx++]=asrc->d[i];ic*=asrc->d[i]; if(ana->r&&ana->d[i-1]!=asrc->d[i])ERROUT(ERR_LENGTH); } if(0==ana->r&&1r){ na=ga(asrc->t,asrc->r-1,ic,asrc->d+1);cp=(C *)na->p; for(i=0;it,(I *)(cp+i*SIZEOFITEM(asrc->t)),ana->p,1); } z=ga(asrc->t,aidx->r+asrc->r-1,zn,d); if(1==asrc->r&&Et>asrc->t) { e=asrc->n;(*indf[asrc->t])(z->p,aidx->p,asrc->p,ana->p,z->n); } else { is=ic*SIZEOFITEM(asrc->t);cp=(C *)asrc->p;zcp=(C *)z->p; for(i=0;in;++i){ idx=aidx->p[i]; tmv(asrc->t,(I *)(zcp+i*is), (I *)((0<=idx&&idxd[0])?cp+idx*is:(C *)((na?na:ana)->p)),ic); } } if(Ct==z->t)((C *)(z->p))[z->n]='\0';if(na)dc(na);R z; } ENTRYPOINT A ep_nanfind(aobj)A aobj; { A z;I count=0;F *fp; if (!QA(aobj)||Ft!=aobj->t) R gv(It,0); fp=(F *)aobj->p; DO(aobj->n,if(isnan(fp[i]))count++); z=gv(It,count); count=0; DO(aobj->n,if(isnan(fp[i]))z->p[count++]=i); R z; } ENTRYPOINT I ep_index_of(a,w)A a, w; { A ta,tw; I items,i; NDC2(a,w); /* a and w are both vectors with at least 2 elements */ Q(a->t!=Et||w->t!=Et||a->r!=1||w->r!=1||a->n<2||w->n<2,ERR_DOMAIN); Q(a->n!=w->n,ERR_LENGTH); /* outer object type checks */ for(i=0; in; i++) { Q(!(a->p[i]),ERR_DOMAIN); Q(!QA(a->p[i]),ERR_DOMAIN); Q(!(w->p[i]),ERR_DOMAIN); Q(!QA(w->p[i]),ERR_DOMAIN); Q(( ((A)a->p[i])->t != ((A)w->p[i])->t ),ERR_DOMAIN); } /* check inner objects */ ta=(A)a->p[0]; Q(!(ta),ERR_DOMAIN); Q(!QA(ta),ERR_DOMAIN); items=ta->r?ta->d[0]:ta->n; for(i=0;in;++i) { ta=(A)a->p[i]; Q(!(ta),ERR_DOMAIN); Q(!QA(ta),ERR_DOMAIN); Q(ta->r>1,ERR_DOMAIN); /* Scalar or Vector */ Q((items!=(ta->r?ta->d[0]:ta->n)),ERR_DOMAIN); if(ta->t==Et && ta->n && ta->p[0] && QA(ta->p[0])) { I i; I aType=((A)ta->p[0])->t; for(i=1; in; i++) { Q(!(ta->p[i]),ERR_DOMAIN); Q(!QA(ta->p[i]),ERR_DOMAIN); Q(aType!=((A)ta->p[i])->t,ERR_DOMAIN); } } } tw=(A)w->p[0]; Q(!(tw),ERR_DOMAIN); Q(!QA(tw),ERR_DOMAIN); items=tw->r?tw->d[0]:tw->n; for(i=0;in;++i) { tw=(A)w->p[i]; Q(!(tw),ERR_DOMAIN); Q(!QA(tw),ERR_DOMAIN); Q(tw->r>1,ERR_DOMAIN); /* Scalar or Vector */ Q((items!=(tw->r?tw->d[0]:tw->n)),ERR_DOMAIN); if(tw->t==Et && tw->n && tw->p[0] && QA(tw->p[0])) { I i; I aType=((A)tw->p[0])->t; for(i=1; in; i++) { Q(!(tw->p[i]),ERR_DOMAIN); Q(!QA(tw->p[i]),ERR_DOMAIN); Q(aType!=((A)tw->p[i])->t,ERR_DOMAIN); } } } /* index_of() is found in i.c since it needs many of the */ /* same utilities used in dyadic iota */ R (I) index_of(a,w); } void tInstall() { install((PFI)ep_from, "_index", A_, 3, IA, A_, A_,0,0,0,0,0); install((PFI)ep_nanfind, "_nanfind", A_, 1, A_,0,0,0,0,0,0,0); install((PFI)ep_index_of, "_index_of", A_, 2, A_, A_,0,0,0,0,0,0); R; } aplus-fsf-4.22/src/esf/pack.c0000644000265000001440000012460610772770355011472 /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #undef ENTRYPOINT #define ENTRYPOINT static extern CX cxlu(); extern V vlu(); extern S symsplit(),symjoin(); extern I dbg_tpack,dbg_tdef; static I iced(); static I icedAtom(); static I thaw(); #define PKARG_ERROR 0 #define PKARG_NULL 1 #define PKARG_SYMVEC 2 #define PKARG_SLOT 3 #define PKARG_SYMDEST 4 #define PK_COOKIE "PKGmcatn" #define PK_VERSION 1 #define PK_ZERO 0 #define PK_NULL 1 #define PK_SYM 2 #define PK_CX 3 #define PK_VREF 4 #define PK_AVAR 5 #define PK_AET 6 #define PK_AFUNC 7 #define PK_ABEAM 8 #define PK_STR 9 #define PK_PRIM 10 #define PK_KWORD 11 #define PK_XFUNC 12 #define PK_EXPR 13 #define PK_LOCAL 14 #define PK_ADF 15 #define PKE_VDAT 16 #define PKE_VDEP 17 #define PK_NTYPES 18 #define DH if(Opts.debug)H #define PK_ICABLE(t) (PK_AVAR==(t)||PK_AET==(t)||PK_AFUNC==(t)|| \ PK_ABEAM==(t)||PK_ADF==(t)) #define PK_CODEDPTR(t) (PK_SYM==(t)||PK_VREF==(t)||PK_EXPR==(t)|| \ PKE_VDAT==(t)|| PKE_VDEP==(t)) #define PK_CODEDIDX(t) (PK_KWORD==(t)||PK_LOCAL==(t)||PK_PRIM==(t)|| \ PK_XFUNC==(t)) #define PK_HDRSIZE 32 #define PK_HTSIZE 1024 #define EHT_HTSIZE (I)128 #define EHT_NONE (I)0 #define EHT_DYNAMIC (I)1 #define EHT_ICE (I)2 #define EHT_RUNTIME (I)3 /* */ /* Static Variables and typedefs */ static C *ZpkTypeName[]= { "Zero ","Null ","Symbol ","Context","V-Ref ", "A:Data ","A:Nestd","A:Func ","A:Beam ","String ", "Primtv ","Keyword","XFunc ","Expr ","Local ", "A:DFunc","Sym->Cx","*V-Data","*V-Dep ", "TOTAL: "}; #ifdef FUNCNOTUSED static C *ZpkAttList[]= { "ls", "_opts" }; #endif #define BUSTED(n) {Busted=(n);R 0;} static int Busted=0; typedef struct str_IdEntry{I p,type;long ftell,len;}IdEntry; typedef IdEntry *IDE; typedef struct str_EgoEntry{I scx,vname,glob,cvname;}EgoEntry; typedef EgoEntry *EGOE; static IdEntry TempId; static EgoEntry TempEgo; typedef struct str_blockInfo{long ftell,len;}BlockInfo; static struct str_EgoHashTable{ I nHash; I nBuckets; I *hashArray; I *bucketArray; struct buff *bucketBuff; I source; } Eht = {0,0,0,0,0,EHT_NONE}; static struct str_ZpkHeader{ C cookie[8]; I version; long hdrsize; /* in words */ BlockInfo File; /* File.len is in bytes. */ BlockInfo Ego; /* len for Ego and Id in # entries */ BlockInfo Id; BlockInfo Ice; BlockInfo EgoHash; I reserved[PK_HDRSIZE-14]; /* adjust to keep header 32 words long */ } ZpkHeader; static struct str_Zpack{ IDE Id; I nId; EGOE Ego; I nEgo; struct buff *IdBuff; struct buff *EgoBuff; struct buff *ResBuff; C *ice; long flen; FILE *fp; HT IdHashTable; } Zpack; static struct str_ZpkStat{ I refs; I objs; I size; } ZpkStats[1+PK_NTYPES]; static struct str_Opts { I pieces; I verbose; I debug; I result; I stats; I hash; } Opts = {0,0,0,0,0}; static A DefaultAOpts = 0; SUBROUTINE void setOpts(opts)C *opts; { Opts.pieces=(NULL==strchr((DEV_STRARG)opts,'p'))?0:1; Opts.verbose=(NULL==strchr((DEV_STRARG)opts,'v'))?0:1; Opts.debug=(NULL==strchr((DEV_STRARG)opts,'d'))?0:1; Opts.result=(NULL==strchr((DEV_STRARG)opts,'r'))?0:1; Opts.stats=(NULL==strchr((DEV_STRARG)opts,'s'))?0:1; Opts.hash=(NULL==strchr((DEV_STRARG)opts,'h'))?0:1; } /* */ /**************************************************************** * * Modified hash functions -- variation of att.c with double key. * */ typedef struct str_zhtn{I idx,obj,type;struct str_zhtn *n;}*ZHTN; SUBROUTINE ZHTN hashget(ht,obj,type)HT ht;I obj,type; { ZHTN *zhtn=(ZHTN*)HTHASH(ht,obj^type),n; for(n=*zhtn;n;n=n->n)if(obj==n->obj&&type==n->type)R n; R 0; } SUBROUTINE I hashset(ht,obj,type,idx)HT ht;I obj,type,idx; { ZHTN *zhtn=(ZHTN*)HTHASH(ht,obj^type),n,hd; for(n=*zhtn;n;n=n->n)if(obj==n->obj&&type==n->type){n->idx=idx;R 0;} n=(ZHTN)ma(4);n->obj=obj;n->type=type;n->idx=idx; if(hd=*zhtn){n->n=hd->n;hd->n=n;}else{*zhtn=n;n->n=0;}++ht->ni;R 1; } SUBROUTINE I hashfree(ht)HT ht; { ZHTN *zhtn,n,t; I i; for(i=0;inb;++i) if(*(zhtn=(ZHTN *)(ht->b+i))) { for(n=*zhtn;t=n->n;){n->n=t->n;mf((I *)t);} mf((I *)n); *zhtn=0; } bfree((char *)ht); R 0; } /* */ /**************************************************************** * * Ego Hash Functions - these are very different from att.c because * the buckets are in a fixed array. */ /* egoha(0 is a copy of ha() from att.c. It is copied here for * isolation from future changes in att.c. */ Z egoha(n) C *n; { unsigned long h = 0, c; while ((c = (unsigned long)*n++) != 0) { h += (h << 5) + c; } R h; } #define EGOHASH(x) ((egoha(x))&(EHT_HTSIZE-1)) SUBROUTINE void EgoHashInitDynamic(nHA)I nHA; { Eht.hashArray=ma(nHA); Eht.nHash=nHA; Eht.bucketBuff=buffalloc(); Eht.nBuckets=0; Eht.bucketArray=0; bzero(Eht.hashArray,nHA*sizeof(I)); Eht.source=EHT_DYNAMIC; } SUBROUTINE void EgoHashInitIce() { I *ehtBlock; struct buff *pb; if(ZpkHeader.EgoHash.ftell) { ehtBlock=(I*)(Zpack.ice+ZpkHeader.EgoHash.ftell); Eht.nHash=ehtBlock[0]; Eht.nBuckets=ehtBlock[1]; Eht.bucketBuff=pb=buffalloc(); Eht.bucketArray=ehtBlock+2; pb->min=pb->get=(C*)(Eht.bucketArray); Eht.hashArray=Eht.bucketArray+(2*Eht.nBuckets); pb->max=pb->put=(C*)Eht.hashArray; Eht.source=EHT_ICE; } else Eht.source=EHT_NONE; } SUBROUTINE void EgoHashCleanup() { if(EHT_DYNAMIC==Eht.source||EHT_RUNTIME==Eht.source) { if (Eht.hashArray) mf(Eht.hashArray); if (Eht.bucketBuff) bufffree(Eht.bucketBuff); } else if (EHT_ICE==Eht.source) { if (Eht.bucketBuff) bfree((char *)Eht.bucketBuff); /* Note: do not call bufffree() here, as the buffer is from the ice. */ } Eht.hashArray=0; Eht.bucketBuff=0; Eht.nHash=Eht.nBuckets=0; } SUBROUTINE void EgoHashAdd(cvname,iego)S cvname;I iego; { I haidx; DH("\343 z:EgoHashAdd(cvname:%ld [%s],iego:%ld)\n",cvname,cvname->n,iego); if(EHT_DYNAMIC==Eht.source||EHT_RUNTIME==Eht.source) { haidx=EGOHASH(cvname->n); buffstuff(Eht.bucketBuff,(char *)(Eht.hashArray+haidx),sizeof(I)); buffstuff(Eht.bucketBuff,(char *)&iego,sizeof(iego)); Eht.hashArray[haidx]=1+2*Eht.nBuckets++; } DH("\343 z:EgoHashAdd finished\n"); } static S Sthaw(); SUBROUTINE void EgoHashBuildIfNeeded(type)I type; { I iego; DH("\343 z:EgoHashBuildIfNeeded(type:%ld)\n",type); if(EHT_NONE==Eht.source) { if(Opts.verbose)H("\343 ZPK: No hash table on file. Building it.\n"); EgoHashInitDynamic(EHT_HTSIZE); for(iego=0;iegomin; } Eht.source=type; DH("\343 z:EgoHashBuildIfNeeded finished\n"); } SUBROUTINE I EgoHashLookup(cvname)S cvname; { I haidx, idx, iego; DH("\343 z:EgoHashLookup(cvname:%ld [%s])\n",cvname,cvname->n); haidx=EGOHASH(cvname->n); if(EHT_DYNAMIC==Eht.source) { Eht.bucketArray=(I*)Eht.bucketBuff->min; Zpack.Ego=(EGOE)Zpack.EgoBuff->min; Zpack.Id=(IDE)Zpack.IdBuff->min; } for(idx=Eht.hashArray[haidx];idx;idx=Eht.bucketArray[idx-1]) { iego=Eht.bucketArray[idx]; if(cvname==Sthaw(Zpack.Ego[iego].cvname))R iego; } R -1; } /* */ /**************************************************************** * * Other utility functions * */ SUBROUTINE I AddIdEntry(tid)IDE tid; { buffstuff(Zpack.IdBuff,(char *)tid,sizeof(IdEntry)); hashset(Zpack.IdHashTable,tid->p,tid->type,Zpack.nId); R Zpack.nId++; } SUBROUTINE I AddEgoEntry(cvname,tego)S cvname;EGOE tego; { I iego; iego=EgoHashLookup(cvname); if(-1==iego){ buffstuff(Zpack.EgoBuff,(char *)tego,sizeof(EgoEntry)); EgoHashAdd(cvname,Zpack.nEgo); R Zpack.nEgo++; } else { ((EGOE)(Zpack.EgoBuff->min))[iego].glob=tego->glob; R iego; } } SUBROUTINE void clearStats() { I i; for(i=0;i<1+PK_NTYPES;++i) ZpkStats[i].refs=ZpkStats[i].objs=ZpkStats[i].size=0; } SUBROUTINE I zargvette(alist)A alist; { A a0,a1; if (qz(alist))R PKARG_NULL; else if(sym(alist))R PKARG_SYMVEC; else if(issfdups(alist))R PKARG_SLOT; else if(alist&&QA(alist)&&Et==alist->t&&1==alist->r&&2==alist->n&& sym(a0=(A)alist->p[0])&&sym(a1=(A)alist->p[1])&&a0->n==a1->n) R PKARG_SYMDEST; R PKARG_ERROR; } extern C *stringFromAobj(); SUBROUTINE C *MakeFileName(afn)A afn; { Z C fnamebuf[MAXPATHLEN]; C *rootname=stringFromAobj(afn); if(rootname==(C*)0)R(C*)0; if(strrchr((DEV_STRARG)rootname,'.')>strrchr((DEV_STRARG)rootname,'/'))R rootname; strcpy((DEV_STRARG)fnamebuf,(DEV_STRARG)rootname); strcat((DEV_STRARG)fnamebuf,(DEV_STRARG)".pkg"); R fnamebuf; } SUBROUTINE C *getfilename(afn)A afn; { C *res=0; A p1=0; I haveOpts=0; if(Ct==afn->t) res=MakeFileName(afn); else if(Et!=afn->t) res=(C*)0; else if (1<=afn->n&&QS(afn->p[0])) res=MakeFileName(afn); else if (2==afn->n&&QA(afn->p[0])&&QA(afn->p[1])) { p1=(A)afn->p[1]; res=MakeFileName((A)afn->p[0]); if(res!=(C*)0) { if(Ct==p1->t) haveOpts=1; else res=(C*)0; } } if(res!=(C*)0) setOpts(haveOpts?(C*)p1->p:DefaultAOpts?(C*)DefaultAOpts->p:""); R res; } SUBROUTINE A getapackstr(astr)A astr; { A p1=0,ares=(A)0; I haveOpts=0; if(Ct==astr->t)ares=astr; else if (Et==astr->t&&2==astr->n&&QA(astr->p[0])&&QA(astr->p[1])) { ares=(A)astr->p[0]; p1=(A)astr->p[1]; if(Ct==p1->t)haveOpts=1; } if(ares&&QA(ares)&&Ct==ares->t&&1==ares->r&&(PK_HDRSIZE*sizeof(I))<=ares->n) { setOpts(haveOpts?(C*)p1->p:DefaultAOpts?(C*)DefaultAOpts->p:""); R(A)ares; } R(A)0; } /* */ /**************************************************************** * * Icer functions * */ static long IcePad[2]={0,0}; SUBROUTINE void iceWrite(C *ptr,I sz,I n) { if (Zpack.fp) fwrite(ptr,sz,n,Zpack.fp); else buffstuff(Zpack.ResBuff,ptr,sz*n); } SUBROUTINE long iceTell() { if (Zpack.fp) R ftell(Zpack.fp); else R Zpack.ResBuff->put-Zpack.ResBuff->get; } SUBROUTINE void writeIce(C *ptr,I sz,I n) { long cpos; iceWrite(ptr,sz,n); cpos=8L-iceTell()%8L; if(8>cpos)iceWrite((C *)IcePad,1,cpos); } SUBROUTINE long packInIceString(plen,str)long *plen;C *str; { int slen=strlen((DEV_STRARG)str); long tell=iceTell(); writeIce(str,1,1+slen); *plen=(iceTell()-tell)/(long)sizeof(I); R tell; } SUBROUTINE long packInIceArray(long *plen,C *ptr,I sz,I n) { long tell=iceTell(); writeIce(ptr,sz,n); *plen=(iceTell()-tell)/sizeof(I); R tell; } SUBROUTINE void icerZero(tid,obj)IDE tid;I obj; { tid->type=PK_ZERO;tid->p=0; tid->ftell=tid->len=0L; } SUBROUTINE void icerNull(tid,obj)IDE tid;I obj; { tid->type=PK_NULL;tid->p=(I)aplus_nl; tid->ftell=tid->len=0L; } SUBROUTINE void icerS(tid,s)IDE tid;S s; { tid->type=PK_SYM; tid->p=(I)s; tid->ftell=packInIceString(&tid->len,s->n); } SUBROUTINE void icerCx(tid,cxt)IDE tid;CX cxt; { I symiid=iced((I)cxt->s,(I)PK_SYM); tid->type=PK_CX; tid->p=(I)cxt; tid->ftell=symiid;tid->len=0L; } SUBROUTINE void icerVref(tid,v)IDE tid;V v; { long len=2; I *iceCube=ma(len); iceCube[0]=iced((I)v->s,(I)PK_SYM); iceCube[1]=iced((I)v->cx,(I)PK_CX); tid->type=PK_VREF;tid->p=(I)v; tid->ftell=packInIceArray(&tid->len,(C *)iceCube,sizeof(I),len); mf(iceCube); } SUBROUTINE void icerAvar(tid,aobj)IDE tid;A aobj; { tid->ftell=iceTell();tid->len=0; iceWrite((C *)&aobj->t,sizeof(I),1); iceWrite((C *)&aobj->r,sizeof(I),1); iceWrite((C *)&aobj->n,sizeof(I),1); iceWrite((C *)aobj->d,sizeof(I),MAXR); tid->type=PK_AVAR;tid->p=(I)aobj; switch(aobj->t) { case It: packInIceArray(&tid->len,(C *)aobj->p,sizeof(I),aobj->n); break; case Ft: packInIceArray(&tid->len,(C *)aobj->p,sizeof(F),aobj->n); break; case Ct: packInIceArray(&tid->len,(C *)aobj->p,sizeof(C),aobj->n+1); break; default: H("\343 PKG: icerAvar: non-simple A object\n"); R; } tid->len+=12; } SUBROUTINE void icerAet(tid,aobj)IDE tid;A aobj; { long len=3+MAXR+aobj->n; I *iceCube=ma(len); I idx=0,i; iceCube[idx++]=aobj->t; iceCube[idx++]=aobj->r; iceCube[idx++]=aobj->n; for(i=0;id[i]; for(i=0;in;++i)iceCube[idx++]=icedAtom(aobj->p[i]); tid->type=PK_AET;tid->p=(I)aobj; tid->ftell=packInIceArray(&tid->len,(C *)iceCube,sizeof(I),len); mf(iceCube); } SUBROUTINE void icerAfunc(tid,aobj)IDE tid;A aobj; { long len=3+(MAXR+1)+(aobj->n)+2; I *iceCube=ma(len); I i,idx=0; for(i=0;it; iceCube[idx++]=aobj->n; iceCube[idx++]=aobj->r; /* the Xt+2 kludge below is for monadic operators, where a->d[2] is junk */ /* more kludge: d[3] is junk for dyadic ops where 5==aobj->r*/ for(i=0;ir;++i) iceCube[idx+i]= (2==i&&(Xt+2)==aobj->t||3==i&&5==aobj->r&&(Xt+3==aobj->t||Xt+4==aobj->t)) ?iced((I)0,(I)PK_ZERO):icedAtom(aobj->d[i]); idx+=MAXR+1; for(i=0;in;++i)iceCube[idx++]=icedAtom(aobj->p[i]); iceCube[idx++]=iced(aobj->p[1+aobj->n],(I)PK_STR); iceCube[idx++]=iced(aobj->p[2+aobj->n],(I)PK_CX); tid->type=PK_AFUNC;tid->p=(I)aobj; tid->ftell=packInIceArray(&tid->len,(C *)iceCube,sizeof(I),len); mf(iceCube); } SUBROUTINE void icerAbeam(tid,aobj)IDE tid;A aobj; { C *fname; I beammode,len=0; if(mf_info(aobj,&beammode,&fname)) { H("\343 PKG: icerBeam: non-beamed object. aobj:%ld\n",aobj);Busted=1;R; } if('.'==fname[0]&&'/'==fname[1])fname+=2; /* Remove initial ./ */ tid->type=PK_ABEAM;tid->p=(I)aobj; tid->ftell=iceTell(); iceWrite((C *)&beammode,sizeof(I),1); iceWrite((C *)&len,sizeof(I),1); /* this is just filler */ packInIceString(&len,fname); tid->len=2+len; } SUBROUTINE void icerStr(tid,str)IDE tid;C *str; { tid->type=PK_STR; tid->p=(I)str; tid->ftell=packInIceString(&tid->len,str); } extern C**get_primlist(); SUBROUTINE void icerPrim(tid,pidx)IDE tid;I pidx; { C **plist=get_primlist(1,0); tid->type=PK_PRIM; tid->p=pidx; tid->ftell=packInIceString(&tid->len,plist[pidx]); } SUBROUTINE void icerKword(tid,nidx)IDE tid;I nidx; { C **nlist=get_primlist(1,1); tid->type=PK_KWORD; tid->p=nidx; tid->ftell=packInIceString(&tid->len,nlist[nidx]); } extern C*xfs_name[]; SUBROUTINE void icerXfunc(tid,xidx)IDE tid;I xidx; { tid->type=PK_XFUNC; tid->p=xidx; tid->ftell=packInIceString(&tid->len,xfs_name[xidx]); } SUBROUTINE void icerExpr(tid,expr)IDE tid;E expr; { long len=2+expr->n; I *iceCube=ma(len); I i,idx=0; iceCube[idx++]=expr->n; iceCube[idx++]=icedAtom(expr->f); for(i=0;in;++i)iceCube[idx++]=icedAtom(expr->a[i]); tid->type=PK_EXPR;tid->p=(I)expr; tid->ftell=packInIceArray(&tid->len,(C *)iceCube,sizeof(I),len); mf(iceCube); } SUBROUTINE void icerLocal(tid,lidx)IDE tid;I lidx; { tid->type=PK_LOCAL; tid->p=lidx; tid->ftell=lidx; tid->len=0; } /* icerAdf is for derived functions */ SUBROUTINE void icerAdf(tid,aobj)IDE tid;A aobj; { long len=3+(MAXR+1); I *iceCube=ma(len); I i,idx=0; for(i=0;it; iceCube[idx++]=aobj->n; iceCube[idx++]=aobj->r; for(i=0;ir;++i)iceCube[idx+i]=icedAtom(aobj->d[i]); tid->type=PK_ADF;tid->p=(I)aobj; tid->ftell=packInIceArray(&tid->len,(C *)iceCube,sizeof(I),len); mf(iceCube); } SUBROUTINE void icerEpVdat(tid,v)IDE tid;V v; { long len=sizeof(struct _v)/sizeof(I); I *iceCube=ma(len); I idx,isdep=v->e?1:0; for(idx=0;idxs,(I)PK_SYM); iceCube[idx++]=iced((I)v->cx,(I)PK_CX); iceCube[idx++]=v->t; iceCube[idx++]=icedAtom(isdep?v->e:v->a); tid->type=(isdep?PKE_VDEP:PKE_VDAT);tid->p=(I)v; tid->ftell=packInIceArray(&tid->len,(C *)iceCube,sizeof(I),len); mf(iceCube); } static void(*Icerfunc[])()={ icerZero, icerNull, icerS, icerCx, icerVref, icerAvar, icerAet, icerAfunc, icerAbeam, icerStr, icerPrim, icerKword, icerXfunc, icerExpr, icerLocal, icerAdf, icerEpVdat, icerEpVdat, }; SUBROUTINE I icer(obj,type)I obj,type; { IDE tid=&TempId; if(0==obj&& !(PK_PRIM==type||PK_KWORD==type||PK_LOCAL==type|| PK_XFUNC==type||PK_ZERO==type)) R iced((I)obj,(I)PK_ZERO); (*Icerfunc[type])(tid,obj); ++ZpkStats[type].refs;++ZpkStats[type].objs;ZpkStats[type].size+=tid->len; R AddIdEntry(tid); } SUBROUTINE I iced(obj,type)I obj,type; { ZHTN zhtn; /* try to find obj in Id */ if(zhtn=hashget(Zpack.IdHashTable,obj,type)){ ++ZpkStats[zhtn->type].refs; R zhtn->idx; } /* here new entry. Call appropriate icer */ if(PK_NTYPES<=type) { H("\343 PKG: iced: unknown type:%ld (ntypes:%d)\n",type,PK_NTYPES);R 0; } R icer(PK_ICABLE(type)?ic((A)obj):obj,type); } SUBROUTINE I icedAtom(arg)I arg; { I type=PK_ZERO,obj=0; A aobj; switch(arg&aplusMask) { case 0: /* A-object */ obj=arg; aobj=(A)arg; type=-1; if(0==aobj)type=PK_ZERO; else if (0==aobj->c)type=(aplus_nl==aobj)?PK_NULL:mf_length(aobj)?PK_ABEAM:-1; if(-1==type) type=(Et>aobj->t)?PK_AVAR:(Et==aobj->t)?PK_AET: (Xt==aobj->t)?PK_ADF:PK_AFUNC; break; case 1: /* global (V) */ obj=(I)XV(arg);type=PK_VREF;break; case 2: /* symbol (S) */ obj=(I)XS(arg);type=PK_SYM;break; case 3: /* expression (E) */ obj=(I)XE(arg);type=PK_EXPR;break; case 4: /* flow-control/operator */ obj=U(arg);type=PK_KWORD;break; case 5: /* local variable */ obj=U(arg);type=PK_LOCAL;break; case 6: /* primitive */ obj=U(arg);type=PK_PRIM;break; case 7: /* external/system function */ obj=U(arg);type=PK_XFUNC;break; } if(0>type) { if(-1==type) H("\343 PKG: icedW: non-beamed non-null 0==a->c arg:%ld\n",arg); else if (-2==type) H("\343 PKG: icedW: not yet implemented. arg:%ld\n",arg); BUSTED(2); } R iced(obj,type); } /* */ /**************************************************************** * * Thaw functions * */ SUBROUTINE S Sthaw(iid)I iid;{R XS(thaw(iid));} SUBROUTINE CX CXthaw(iid)I iid;{R (CX)(thaw(iid));} #ifdef FUNCNOTUSED SUBROUTINE E Ethaw(iid)I iid;{R XE(thaw(iid));} #endif SUBROUTINE void thawZero(tid)IDE tid;{tid->p=0;} SUBROUTINE void thawNull(tid)IDE tid;{tid->p=(I)aplus_nl;} SUBROUTINE void thawS(tid)IDE tid;{tid->p=MS(si(Zpack.ice+tid->ftell));} SUBROUTINE void thawCx(tid)IDE tid;{tid->p=(I)cxi(Sthaw(tid->ftell));} SUBROUTINE void thawVref(tid)IDE tid; { I *ptr=(I*)(Zpack.ice+tid->ftell); tid->p=MV(vi(Sthaw(ptr[0]),CXthaw(ptr[1]))); } SUBROUTINE void thawAvar(tid)IDE tid; { I *ptr=(I*)(Zpack.ice+tid->ftell); tid->p=(I)gc(ptr[0],ptr[1],ptr[2],ptr+3,ptr+12); } SUBROUTINE void thawAEt(tid)IDE tid; { I i,*ptr=(I*)(Zpack.ice+tid->ftell); A z=ga(ptr[0],ptr[1],ptr[2],ptr+3); for(i=0;in;++i) z->p[i]=thaw(ptr[12+i]); tid->p=(I)z; } SUBROUTINE void thawAfunc(tid)IDE tid; { I i,idx=0,*ptr=(I*)(Zpack.ice+tid->ftell); A z=gv(Et,3+ptr[1]); z->t=ptr[idx++]; z->n=ptr[idx++]; z->r=ptr[idx++]; for(i=0;id[i]=thaw(ptr[idx++]); for(i=0;in;++i)z->p[i]=thaw(ptr[idx++]); z->p[z->n]=0; z->p[z->n+1]=thaw(ptr[idx++]); z->p[z->n+2]=(I)CXthaw(ptr[idx++]); tid->p=(I)z; } SUBROUTINE void thawAbeam(tid)IDE tid; { I *ptr=(I*)(Zpack.ice+tid->ftell); tid->p=mapIn(ptr+2,ptr[0]); } SUBROUTINE void thawStr(tid)IDE tid; { I *ptr=(I*)(Zpack.ice+tid->ftell); I *res=ma(tid->len); ttmv(It,res,ptr,tid->len); tid->p=(I)res; } SUBROUTINE void thawPrim(tid)IDE tid;{tid->p=aplus_pi(Zpack.ice+tid->ftell);} /* thawPrim used for types PK_PRIM and PK_KWORD */ SUBROUTINE void thawExpr(tid)IDE tid; { I *ptr=(I*)(Zpack.ice+tid->ftell); E expr=(E)ma(2+ptr[0]); I i; expr->n=ptr[0]; expr->f=thaw(ptr[1]); for(i=0;in;++i)expr->a[i]=thaw(ptr[2+i]); tid->p=ME(expr); } SUBROUTINE void thawXfunc(tid)IDE tid;{tid->p=xslu(Zpack.ice+tid->ftell);} SUBROUTINE void thawLocal(tid)IDE tid;{tid->p=ML(tid->ftell);} SUBROUTINE void thawAdf(tid)IDE tid; { I i,idx=0,*ptr=(I*)(Zpack.ice+tid->ftell); A z=gv(Et,1); z->t=ptr[idx++]; z->n=ptr[idx++]; z->r=ptr[idx++]; for(i=0;id[i]=thaw(ptr[idx++]); tid->p=(I)z; } /* thawNoop is used for to skip PKE_type objects when looping thru Id. */ SUBROUTINE void thawNoop(tid)IDE tid; { } static void(*Thawfunc[])()= { thawZero, thawNull, thawS, thawCx, thawVref, thawAvar, thawAEt, thawAfunc, thawAbeam, thawStr, thawPrim, thawPrim, thawXfunc, thawExpr, thawLocal, thawAdf, thawNoop, thawNoop }; SUBROUTINE I thaw(iid)I iid; { IDE tid=Zpack.Id+iid; DH("\343 thaw(iid:%ld)\n",iid); DH("\343 Zpack.Id:%ld tid:%ld\n",Zpack.Id,tid); DH("\343 thaw: tid->p:%ld tid->type:%ld\n",tid->p,tid->type); if(0==tid->p&&PK_ZERO!=tid->type) (*Thawfunc[tid->type])(tid); R PK_ICABLE(tid->type)?ic((A)tid->p):tid->p; } SUBROUTINE void thawGlobalVdat(tid,cxt,v)IDE tid;CX cxt;V v; { I *ptr=(I*)(Zpack.ice+tid->ftell); A dat=(A)thaw(ptr[3]); v->t=ptr[2]; if(dbg_tdef&&v->t)deftrc(v,0); Cx=cxt; set(MV(v),(I)dat,1); tid->p=MV(v); } SUBROUTINE void thawGlobalVdep(tid,cxt,v)IDE tid;CX cxt;V v; { I *ptr=(I*)(Zpack.ice+tid->ftell); A dat=(A)thaw(ptr[3]); v->t=ptr[2]; if(dbg_tdef)deftrc(v,1); Cx=cxt; sad(v,dat); tid->p=MV(v); } SUBROUTINE void thawGlobalData(iid,cxt,v)I iid;CX cxt;V v; { I dat=thaw(iid); v->t=0; Cx=cxt; set(MV(v),dat,1); } SUBROUTINE I thawGlobal(iid,scx,vname)I iid;S scx;S vname; { IDE tid=Zpack.Id+iid; CX cxt=cxi(scx); V v=vi(vname,cxt); if(Opts.verbose)H("\343 PKG: Installing %s.%s\n",scx->n,vname->n); switch(tid->type) { case PKE_VDAT: thawGlobalVdat(tid,cxt,v); break; case PKE_VDEP: thawGlobalVdep(tid,cxt,v); break; default: thawGlobalData(iid,cxt,v); break; } R tid->p; } SUBROUTINE I thawSlot(iid)I iid; { IDE tid=Zpack.Id+iid; I *ptr,result; switch(tid->type) { case PKE_VDAT: ptr=(I*)(Zpack.ice+tid->ftell); result=thaw(ptr[3]); break; case PKE_VDEP: result=(I)aplus_nl; break; default: result=thaw(iid); break; } return(result); } /* */ /************************************************************************ * * Routines for storage. (zstore and subroutines) * * */ SUBROUTINE void zstoreStats() { I i; H("\343 Type Objs Refs Size\n"); for(i=0;in;++i) { svar=XS(alist->p[i]); vname=symsplit(svar,&scx); cxt=cxlu(scx); if(cxt==(CX)0) { H("\343 PKG: zstore: non-existant context:%s\n",scx->n); R 1; } v=vlu(vname,cxt); if(v==(V)0) { H("\343 PKG: zstore: non-existant global:%s.%s\n",scx->n,vname->n); R 1; } if(Opts.verbose) H("\343 PKG: %ld: Storing %s.%s\n", i,scx->n,vname->n); TempEgo.scx=iced((I)scx,(I)PK_SYM); TempEgo.vname=iced((I)vname,(I)PK_SYM); TempEgo.glob=iced((I)v,(I)PKE_VDAT); cvname=symjoin(scx,vname); TempEgo.cvname=iced((I)cvname,(I)PK_SYM); AddEgoEntry(cvname,&TempEgo); } R 0; } SUBROUTINE I zstoreSlot(asf)A asf; { A alist=(A)(*asf->p),adata=(A)(asf->p[1]); I i; S svar,scx,vname,cvname; for(i=0;in;++i) { svar=XS(alist->p[i]); vname=symsplit(svar,&scx); if(Opts.verbose) H("\343 PKG: %ld: Storing %s.%s\n", i,scx->n,vname->n); TempEgo.scx=iced((I)scx,(I)PK_SYM); TempEgo.vname=iced((I)vname,(I)PK_SYM); TempEgo.glob=icedAtom(adata->p[i]); cvname=symjoin(scx,vname); TempEgo.cvname=iced((I)cvname,(I)PK_SYM); AddEgoEntry(cvname,&TempEgo); } R 0; } SUBROUTINE void zstoreInitAbNihilo() { /* initialize Id and Ego Buffers */ Zpack.IdBuff=buffalloc(); Zpack.EgoBuff=buffalloc(); Zpack.nId=0; Zpack.nEgo=0; Zpack.IdHashTable=hti(PK_HTSIZE); clearStats(); /* initialize Ego Hash Table */ EgoHashInitDynamic(EHT_HTSIZE); /* Put first two (constant) records into Id. */ iced((I)0,(I)PK_ZERO); iced((I)aplus_nl,(I)PK_NULL); /* Fill in header */ bzero(&ZpkHeader,PK_HDRSIZE*sizeof(I)); strncpy(ZpkHeader.cookie,PK_COOKIE,8); ZpkHeader.version=PK_VERSION; ZpkHeader.hdrsize=PK_HDRSIZE; /* Write header to ice */ iceWrite((C *)&ZpkHeader,sizeof(I),ZpkHeader.hdrsize); } SUBROUTINE I zstoreInitFromIce(astr)A astr; { I ilen,iid; IDE tid; /* initialize Id and Ego Buffers */ Zpack.IdBuff=buffalloc(); Zpack.EgoBuff=buffalloc(); Zpack.nId=0; Zpack.nEgo=0; Zpack.IdHashTable=hti(PK_HTSIZE); clearStats(); /* initialize ice */ Zpack.flen=ZpkHeader.File.len; if (Zpack.fp) { #if (_MIPS_SZLONG == 64) printf("mmap64: 0, %ld, PROT_READ, MAP_PRIVATE, %d, 0\n", Zpack.flen, (int)fileno(Zpack.fp)) ; Zpack.ice=mmap64(0,Zpack.flen,PROT_READ,MAP_PRIVATE,(int)fileno(Zpack.fp),0); #else Zpack.ice=mmap(0,Zpack.flen,PROT_READ,MAP_PRIVATE,(int)fileno(Zpack.fp),0); #endif if(Zpack.ice==(C *)-1) { H("\343 PKG: zretrieve: failure mapping file. errno=%d\n",errno); R -1; } } else { Zpack.ice=(C*)astr->p; } /* Fill in Id and Ego From preexisting data. */ Zpack.nEgo=ZpkHeader.Ego.len; ilen=Zpack.nEgo*sizeof(EgoEntry); buffstuff(Zpack.EgoBuff,Zpack.ice+ZpkHeader.Ego.ftell,ilen); Zpack.Ego=(EGOE)Zpack.EgoBuff->min; Zpack.nId=ZpkHeader.Id.len; ilen=Zpack.nId*sizeof(IdEntry); buffstuff(Zpack.IdBuff,Zpack.ice+ZpkHeader.Id.ftell,ilen); Zpack.Id=(IDE)Zpack.IdBuff->min; /* next, we have to set up ice in buffer correctly, or else position * stream if from file */ if(Zpack.fp) { fseek(Zpack.fp,ZpkHeader.Ice.len,0); } else buffstuff(Zpack.ResBuff,Zpack.ice,ZpkHeader.Ice.len); /* now thaw everything */ for(iid=0;iidmin)+iid; if(PK_CODEDPTR(tid->type)&&tid->p)tid->p=tid->p&~aplusMask; else if(PK_CODEDIDX(tid->type)&&tid->p)tid->p=U(tid->p); hashset(Zpack.IdHashTable,tid->p,tid->type,iid); } /* rebuild Ego Hash Table */ Eht.source=EHT_NONE; EgoHashBuildIfNeeded(EHT_DYNAMIC); /* now unmap file (if mapped--we are done with pre-existing data) */ if (Zpack.fp&&-1==munmap(Zpack.ice, Zpack.flen)) { H("\343 PKG: zstore: error unmapping file. errno=%d\n",errno); } /* print out some stuff */ if (Opts.debug) { H("\343 Ice: n:%ld\n",Zpack.flen); H("\343 Ego: n:%ld ftell:%ld\n",Zpack.nEgo,ZpkHeader.Ego.ftell); H("\343 Id: n:%ld ftell:%ld\n",Zpack.nId,ZpkHeader.Id.ftell); H("\343 Ego Hash Table: %spresent.\n",ZpkHeader.EgoHash.ftell?"":"not "); } R 0; } SUBROUTINE A zstoreFinishUp() { IDE tid=&TempId; I i; A z; /* write out end-of-ice marker */ ZpkHeader.Ice.ftell=0L; ZpkHeader.Ice.len=iceTell(); /* zero out p field of Id table, and dc() all entries */ tid=(IDE)Zpack.IdBuff->min; for(i=0;imin,sizeof(IdEntry),Zpack.nId); /* write out Ego. */ ZpkHeader.Ego.ftell=iceTell(); ZpkHeader.Ego.len=Zpack.nEgo; iceWrite(Zpack.EgoBuff->min,sizeof(EgoEntry),Zpack.nEgo); /* write out Ego Hash Table */ if (Opts.hash) { if (Opts.debug) H("\343 Storing Hash Table: nHash:%ld nBuckets:%ld\n", Eht.nHash,Eht.nBuckets); else if (Opts.verbose) H("\343 PKG: Storing hash table.\n"); ZpkHeader.EgoHash.ftell=iceTell(); ZpkHeader.EgoHash.len=2+Eht.nHash+2*Eht.nBuckets; iceWrite((C *)&Eht.nHash,sizeof(I),1); iceWrite((C *)&Eht.nBuckets,sizeof(I),1); iceWrite(Eht.bucketBuff->min,2*sizeof(I),Eht.nBuckets); iceWrite((C *)Eht.hashArray,sizeof(I),Eht.nHash); } /* write out file size information */ ZpkHeader.File.ftell=0L; ZpkHeader.File.len=iceTell(); /* cleanup: write header, now that block information is there, * and then close file and/or free buffers. */ if(Zpack.fp) { rewind(Zpack.fp); iceWrite((C *)&ZpkHeader,sizeof(I),ZpkHeader.hdrsize); fclose(Zpack.fp); z=aplus_nl; } else { I itell=iceTell(); Zpack.ResBuff->put=Zpack.ResBuff->min; iceWrite((C *)&ZpkHeader,sizeof(I),ZpkHeader.hdrsize); z=gc(Ct,1,itell,&itell,(I *)Zpack.ResBuff->min); bufffree(Zpack.ResBuff); } bufffree(Zpack.IdBuff); bufffree(Zpack.EgoBuff); hashfree(Zpack.IdHashTable); EgoHashCleanup(); if(Opts.stats) zstoreStats(); R z; } SUBROUTINE A zstoreCreate(I zarg,A alist) { Busted=0; zstoreInitAbNihilo(); /* put the objects on ice */ if (PKARG_SYMVEC==zarg) zstoreGlobals(alist); else if (PKARG_SLOT==zarg) zstoreSlot(alist); R zstoreFinishUp(); } SUBROUTINE A zstoreAdd(A astr,I zarg,A alist) { Busted=0; if (zstoreInitFromIce(astr)) R aplus_nl; /* put the objects on ice */ if (PKARG_SYMVEC==zarg) zstoreGlobals(alist); else if (PKARG_SLOT==zarg) zstoreSlot(alist); R zstoreFinishUp(); } /* */ /************************************************************************ * * Routines for retrieval. (zretrieve and subroutines) * * */ SUBROUTINE void zretrieveGlobalsAll() { I iego;S vname,scx;CX saveCx=Cx; for(iego=0;iegon,vname->n); thawGlobal(Zpack.Ego[iego].glob,scx,vname); } Cx=saveCx; } SUBROUTINE void zretrieveGlobalsSymvec(asym)A asym; { I i,iego;S vname,cvname,scx;CX saveCx=Cx; A zn=gv(Et,asym->n),zd=gv(Et,asym->n); EgoHashBuildIfNeeded(EHT_RUNTIME); for(i=0;in;++i) { vname=symsplit(XS(asym->p[i]),&scx); cvname=symjoin(scx,vname); iego=EgoHashLookup(cvname); if(-1==iego) H("\343 PKG: Warning: zretrieve: symbol not found:[%s]\n",cvname->n); else { scx=Sthaw(Zpack.Ego[iego].scx); vname=Sthaw(Zpack.Ego[iego].vname); if(Opts.verbose)H("\343 PKG: Installing %s.%s\n",scx->n,vname->n); thawGlobal(Zpack.Ego[iego].glob,scx,vname); } } Cx=saveCx; } SUBROUTINE void zretrieveGlobalsSymDest(alist)A alist; { I i,iego;S vname,cvname,scx,destscx,destname;CX saveCx=Cx; A asym=(A)alist->p[0],adest=(A)alist->p[1]; A zn=gv(Et,asym->n),zd=gv(Et,asym->n); EgoHashBuildIfNeeded(EHT_RUNTIME); for(i=0;in;++i) { vname=symsplit(XS(asym->p[i]),&scx); cvname=symjoin(scx,vname); iego=EgoHashLookup(cvname); if(-1==iego) H("\343 PKG: Warning: zretrieve: symbol not found:[%s]\n",cvname->n); else { destname=symsplit(XS(adest->p[i]),&destscx); if(Opts.verbose)H("\343 PKG: Installing %s.%s (%s on file)\n", destscx->n,destname->n,cvname->n); thawGlobal(Zpack.Ego[iego].glob,destscx,destname); } } Cx=saveCx; } SUBROUTINE void zretrieveGlobals(zarg,alist)I zarg;A alist; { switch(zarg) { case PKARG_NULL:zretrieveGlobalsAll();break; case PKARG_SYMVEC:zretrieveGlobalsSymvec(alist);break; case PKARG_SYMDEST:zretrieveGlobalsSymDest(alist);break; default:break; } } SUBROUTINE A zretrieveSlotAll() { I iego;S cvname; A zn=gv(Et,Zpack.nEgo),zd=gv(Et,Zpack.nEgo); for(iego=0;iegos); */ H("\343 PKG: %ld: Retrieving %ld for slot\n",iego,cvname->s); } zn->p[iego]=MS(cvname); zd->p[iego]=thawSlot(Zpack.Ego[iego].glob); } R (A)gvi(Et,2,zn,zd); } SUBROUTINE A zretrieveSlotSymvec(alist)A alist; { I i,iego;S vname,cvname,scx; A zn=gv(Et,alist->n),zd=gv(Et,alist->n); DH("\343 z:zretrieveSlotSymvec(alist:%ld)\n",alist); EgoHashBuildIfNeeded(EHT_RUNTIME); for(i=0;in;++i) { DH("\343 z:zretrieveSlotSymvec: Loop: i:%ld\n",i); vname=symsplit(XS(alist->p[i]),&scx); cvname=symjoin(scx,vname); zn->p[i]=MS(cvname); iego=EgoHashLookup(cvname); if(-1==iego) { H("\343 PKG: Warning: zretrieve: symbol not found:[%s]\n",cvname->n); zd->p[i]=(I)aplus_nl; } else { if(Opts.verbose)H("\343 PKG: %ld: Retrieving %s for slot\n",i,cvname->n); zd->p[i]=thawSlot(Zpack.Ego[iego].glob); } } DH("\343 z:zretrieveSlotSymvec (almost) finished"); R (A)gvi(Et,2,zn,zd); } SUBROUTINE A zretrieveSlot(zarg,alist)I zarg;A alist; { switch(zarg) { case PKARG_NULL:R zretrieveSlotAll(); case PKARG_SYMVEC:R zretrieveSlotSymvec(alist); default:R aplus_nl; } } SUBROUTINE A zretrieveCatalog() { A z; I iego; z=gv(Et,Zpack.nEgo); for(iego=0;iegop[iego]=thaw(Zpack.Ego[iego].cvname); R z; } SUBROUTINE void zretrieveSetup() { I ilen; Busted=0; Zpack.nEgo=ZpkHeader.Ego.len; ilen=(Zpack.nEgo*sizeof(EgoEntry))/sizeof(I); Zpack.Ego=(EGOE)ma(ilen); tmv(It,(I *)Zpack.Ego,(I *)(Zpack.ice+ZpkHeader.Ego.ftell),ilen); Zpack.nId=ZpkHeader.Id.len; ilen=(Zpack.nId*sizeof(IdEntry))/sizeof(I); Zpack.Id=(IDE)ma(ilen); tmv(It,(I *)Zpack.Id,(I *)(Zpack.ice+ZpkHeader.Id.ftell),ilen); EgoHashInitIce(); /* print out some stuff */ if (Opts.debug) { H("\343 Ice: n:%ld\n",Zpack.flen); H("\343 Ego: n:%ld ftell:%ld\n",Zpack.nEgo,ZpkHeader.Ego.ftell); H("\343 Id: n:%ld ftell:%ld\n",Zpack.nId,ZpkHeader.Id.ftell); H("\343 Ego Hash Table: %spresent.\n",ZpkHeader.EgoHash.ftell?"":"not "); } } SUBROUTINE A zretrievePieces() { A aId,aEgo,aHead,aIce,aEgoHash; I dim[2]; /* manufacture result for pieces */ dim[1]=4; dim[0]=Zpack.nId; aId=gc(It,2,dim[0]*dim[1],dim,(I*)Zpack.Id); dim[0]=Zpack.nEgo; aEgo=gc(It,2,dim[0]*dim[1],dim,(I*)Zpack.Ego); dim[0]=PK_HDRSIZE; aHead=gc(It,1,dim[0],dim,(I *)&ZpkHeader); dim[0]=Zpack.flen; aIce=gc(Ct,1,dim[0],dim,(I *)Zpack.ice); if(EHT_NONE==Eht.source) aEgoHash=aplus_nl; else { dim[1]=2;dim[0]=Eht.nBuckets; aEgoHash= (A) gvi(Et,5,gi(Eht.source),gi(Eht.nHash),gi(Eht.nBuckets), gc(It,1,Eht.nHash,&Eht.nHash,Eht.hashArray), gc(It,2,dim[0]*dim[1],dim,(I*)Eht.bucketBuff->min)); } R (A)gvi(Et,5,aHead,aEgo,aId,aIce,aEgoHash); } SUBROUTINE int zretrieveInitFile(afn,cmdstr,pfname)A afn;C *cmdstr;C **pfname; { C *fname=getfilename(afn); int fd; /* vette arguments */ if(fname==(C *)0){H("\343 PKG: zretrieve: bad filename argument\n");R -1;} Busted=0; /* open file */ if(-1==(fd=open(fname,O_RDONLY))) { H("\343 PKG: zretrieve: cannot open file [%s]. errno=%d\n",fname,errno); R -1; } /* read header */ if(-1==(read(fd,&ZpkHeader,sizeof(ZpkHeader)))) { H("\343 PKG: zretrieve: cannot read header. errno=%d\n",errno); R -1; } /* map file, and load Zpack */ Zpack.flen=ZpkHeader.File.len; #if (_MIPS_SZLONG == 64) printf("mmap64: 0, %ld, PROT_READ, MAP_PRIVATE, %d, 0\n", Zpack.flen, fd) ; Zpack.ice=mmap64(0,Zpack.flen,PROT_READ,MAP_PRIVATE,fd,0); #else Zpack.ice=mmap(0,Zpack.flen,PROT_READ,MAP_PRIVATE,fd,0); #endif if(Zpack.ice==(C *)-1) { H("\343 PKG: zretrieve: failure mapping file. errno=%d\n",errno); R -1; } if(dbg_tpack)packtrc(fname,cmdstr,1); if(pfname)(*pfname)=fname; zretrieveSetup(); R fd; } SUBROUTINE void zretrieveInitPackstr(astr)A astr; { /* astr must be a valid packstring */ /* read header */ bcopy(astr->p,&ZpkHeader,sizeof(ZpkHeader)); /* map file, and load Zpack */ Zpack.flen=astr->n; Zpack.ice=(C*)astr->p; zretrieveSetup(); } SUBROUTINE void zretrieveUnmapFile(fd)int fd; { if(-1==munmap(Zpack.ice, Zpack.flen)) { H("\343 PKG: zretrieve: error unmapping file. errno=%d\n",errno); } close(fd); } SUBROUTINE void zretrieveCleanup() { I iid; /* go through Id, and dc() everything */ for(iid=0;iid #include #include #include #include #include #include #define NUM_TYPES 4 #define NUM_BUCKETS 9 #define NUM_CPU_BUCKETS 2 #define MONADIC_ARRAY_SIZE ((sizeP1*NUM_TYPES*NUM_BUCKETS)*sizeof(PFI)) #define DYADIC_ARRAY_SIZE ((sizeP2*NUM_TYPES*NUM_BUCKETS)*sizeof(PFI)) #define MONADIC_CPU_ARRAY_SIZE ((sizeP1*NUM_TYPES*NUM_CPU_BUCKETS)*sizeof(PFI)) #define DYADIC_CPU_ARRAY_SIZE ((sizeP2*NUM_TYPES*NUM_CPU_BUCKETS)*sizeof(PFI)) extern PFI P1[]; extern PFI P2[]; extern I profileExecute(); extern I sizeOfPrimArray(); extern C **get_primlist(); static PFI *saveP1=NULL; static PFI *saveP2=NULL; static I sizeP1; static I sizeP2; static I (*dyadic)[][NUM_TYPES][NUM_BUCKETS]=NULL; static I (*monadic)[][NUM_TYPES][NUM_BUCKETS]=NULL; static I (*cpuDyadic)[][NUM_TYPES][NUM_CPU_BUCKETS]=NULL; static I (*cpuMonadic)[][NUM_TYPES][NUM_CPU_BUCKETS]=NULL; static I clockTicksPerSec=1; I profileDyadic(A a, A w, I i) { struct tms tStart, tEnd; I typeIdx=-1, sizeIdx; I z; if( it<=Et ) { typeIdx=(a->t!=Et) ? a->t : 3; /* Set type index */ sizeIdx=(a->n< 2 )? 1: /* Set size index */ (a->n< 10 )? 2 : (a->n< 100 )? 3 : (a->n< 1000 )? 4 : (a->n< 10000 )? 5 : (a->n< 100000 )? 6 : (a->n< 1000000 )? 7 : 8; (*dyadic)[i][typeIdx][sizeIdx]++; /* increment count */ (*dyadic)[i][typeIdx][0]=1; /* isSet indicator */ } if( QA(w) && w->t<=Et ) { typeIdx=(w->t!=Et) ? w->t : 3; /* Set type index */ sizeIdx=(w->n< 2 )? 1: /* Set size index */ (w->n< 10 )? 2 : (w->n< 100 )? 3 : (w->n< 1000 )? 4 : (w->n< 10000 )? 5 : (w->n< 100000 )? 6 : (w->n< 1000000 )? 7 : 8; (*dyadic)[i][typeIdx][sizeIdx]++; /* increment count */ (*dyadic)[i][typeIdx][0]=1; /* isSet indicator */ } } times(&tStart); z=profileExecute(2,saveP1,saveP2,i) ; times(&tEnd); if(typeIdx!=-1 && it<=Et ) { typeIdx=(a->t!=Et) ? a->t : 3; /* Set type index */ sizeIdx=(a->n< 2 )? 1 : /* Set size index */ (a->n< 10 )? 2 : (a->n< 100 )? 3 : (a->n< 1000 )? 4 : (a->n< 10000 )? 5 : (a->n< 100000 )? 6 : (a->n< 1000000 )? 7 : 8; (*monadic)[i][typeIdx][sizeIdx]++; /* increment count */ (*monadic)[i][typeIdx][0]=1; /* isSet indicator */ } times(&tStart); z=profileExecute(1,saveP1,saveP2,i) ; times(&tEnd); if(typeIdx!=-1 && i%8d%8d%8d%8d%8d%8d%8d%8d+\n", 1,10,100,1000,10000,100000,1000000,1000000); for(primitive=0; primitive%8d%8d%8d%8d%8d%8d%8d%8d+\n", 1,10,100,1000,10000,100000,1000000,1000000); for(primitive=0; primitiven != 1) return q=ERR_LENGTH,(A)0; if( !QA(aObj) && aObj->t!=Et && !QS(aObj->p[0]) ) return q=ERR_LENGTH,(A)0; if(doInit==TRUE) /* static initialization */ { clockTicksPerSec=sysconf(_SC_CLK_TCK); doInit =FALSE; sMonadic =(S)MS(si("monadic")); sDyadic =(S)MS(si("dyadic")); sCpuMonadic =(S)MS(si("cpuMonadic")); sCpuDyadic =(S)MS(si("cpuDyadic")); on =(S)MS(si("on")); off =(S)MS(si("off")); data =(S)MS(si("data")); report =(S)MS(si("report")); reset =(S)MS(si("reset")); sizeP1 =sizeOfPrimArray(1); sizeP2 =sizeOfPrimArray(2); } sym=(S)aObj->p[0]; if(sym==on && saveP1==NULL ) { if(NULL==(saveP1=( PFI * )malloc(sizeP1*sizeof(PFI)))) return (A)gi(1); if(NULL==(saveP2=( PFI * )malloc(sizeP2*sizeof(PFI)))) return free(saveP1), (A)gi(1); memcpy(saveP1,P1,sizeP1*sizeof(PFI)); memcpy(saveP2,P2,sizeP2*sizeof(PFI)); for(i=0; i #include #include #include #include #if defined(__NetBSD__) || defined(__FreeBSD) || defined (__APPLE__) #include #else #include #endif #include #define DFLTPATH ".:/usr/ucb:/bin:/usr/bin" static int executable(filename) char *filename; { struct stat statb; if (stat(filename, &statb) != 0) return 0; if ((statb.st_mode & S_IFMT) != S_IFREG) return 0; if (access(filename, X_OK) != 0) return 0; return 1; } char *searchPATH(base) char *base; { int baselen, pathlen, dirlen; char *path, *endpath, *dir, *enddir, *filename; char c; if (base == (char *)(0)) return (char *)(0); if (base[0] == '\0') return (char *)(0); if (strchr(base, '/')) { /* path contains '/', so evaluate directly */ if (executable(base)) { baselen = strlen(base) + 1; filename = malloc(baselen); memcpy(filename, base, baselen); return filename; } return (char *)(0); } /* evaluate relative to PATH components */ if ((path = getenv("PATH")) == (char *)(0)) { path = DFLTPATH; } pathlen = strlen(path) + 1; endpath = path + pathlen; baselen = strlen(base) + 1; filename = malloc(pathlen + baselen); /* this is enough */ for (dir = enddir = path; dir != endpath; dir = ++enddir) { while (((c = *enddir) != ':') && (c != '\0')) ++enddir; if (dirlen = enddir - dir) { memcpy(filename, dir, enddir - dir); filename[dirlen] = '/'; dirlen++; } memcpy(filename + dirlen, base, baselen); if (executable(filename)) { return filename; } } free(filename); return (char *)(0); } aplus-fsf-4.22/src/esf/kcheck.c0000644000265000001440000000124710772770356012000 /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #define KFAILURE -1 #define KSUCCESS 0 int kerberosCheck(username,password) char *username; char *password; { return KFAILURE; } aplus-fsf-4.22/src/esf/dyld2.c0000644000265000001440000000520310772770356011562 /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #include #if !defined(__APPLE__) #include #endif #if defined(__NetBSD__) || defined(__FreeBSD) || defined (__APPLE__) #include #else #include #endif #include #include #include #include #include extern void dymeSet(); extern void dyld2Install(); extern I dbg_tdyld; static int dyld2(); void dyldSlowInstall(argv0) char *argv0; { dymeSet(2); install(dyld2,"_dyld", IV, 2, CP, A_,0,0,0,0,0,0); return; } static int dyld2(sharedobj, bindings) char *sharedobj; /* Name of shared object to load in */ A bindings; /* Bindings from c/f77 to A names/types */ { A *ap; /* Points to elements of bindings */ I nentries; /* Number of entries */ I i; /* Loop index */ void *handle; /* handle for shared object */ void **locations; /* locations of symbols in shared object */ int status; char cmd_str[2*MAXPATHLEN + 2048]; char *library_file; #if defined(_AIX) static int dlopenMode=RTLD_MEMBER; #else static int dlopenMode=1; #endif NDC1(bindings); if(dbg_tdyld)dyldtrc(sharedobj); /* Open shared object */ if ((handle = (void *)dlopen(sharedobj, dlopenMode)) == NULL) { (void)fprintf(stderr, "dlopen(%s,1):%s\n", sharedobj, dlerror()); return -1; } /* Resolve symbols */ nentries = bindings->n / 3; if ((locations = (void **)malloc(nentries * sizeof(*locations))) == NULL) { (void)fprintf(stderr, "Not enough memory for dynamic load\n"); (void)dlclose(handle); return -1; } for (ap = (A*)bindings->p, i = 0; i < nentries; i++, ap += 3) { if ((locations[i] = (void *)dlsym(handle, (char *)(*ap)->p)) == NULL) { (void)fprintf(stderr, "dlsym:%s:%s\n", (char *)(*ap)->p, dlerror()); (void)free((char *)locations); (void)dlclose(handle); return -1; } } for (ap = (A*)bindings->p, i = 0; i < nentries; i++, ap += 3) { xinstall(locations[i], (char *)ap[1]->p, *ap[2]->p, ap[2]->n-1, ap[2]->p+1,(C *)0); } (void)free((char *)locations); return 0; } void MAIN_(){} /* This is needed to satisfy libF77.so */ aplus-fsf-4.22/src/a/0000777000265000001440000000000010774512574010125 5aplus-fsf-4.22/src/a/Makefile.am0000644000265000001440000000246407774314572012107 ## Process this file with automake to produce Makefile.in ############################################################################### ## ## ## Copyright (c) 2001 Morgan Stanley Dean Witter & Co. All rights reserved. ## ## See .../src/LICENSE for terms of distribution. ## ## ## ## ## ############################################################################### lib_LTLIBRARIES = liba.la liba_la_SOURCES = \ att.c \ beam.c \ beamconv.c \ bstub.c \ callouts.c \ dbg.c \ dot.c \ f.c \ gpick.c \ i.c \ j.c \ k.c \ m.c \ n.c \ nsf.c \ o.c \ ovli.c \ p.c \ q.c \ r.c \ s.c \ si.c \ u.c \ tmv_nopipe.c \ y.c \ arthur.h\ b.h\ beam.h\ development.h\ f.h\ fir.h\ fncdcls.h\ ik.h\ k.h\ pwr2hpc.h\ s.h\ x.h CFLAGS = @CFLAGS@ -DBSTUB INCLUDES = -I.. fsftestdir = $(libdir) apterdir = $(libdir) tdir = $(libdir) diodir = $(libdir) fsftest_DATA = fsftest.+ apter_DATA = apter.+ t_DATA = t.+ dio_DATA = dio.+ EXTRA_DIST = fsftest.+ apter.+ t.+ dio.+ a_includedir = $(prefix)/include/a a_include_DATA = \ beam.h \ fir.h \ fncdcls.h \ k.h aplus-fsf-4.22/src/a/Makefile.in0000644000265000001440000004131010774512521012075 # Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ ############################################################################### ############################################################################### SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CXX = @CXX@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ STRIP = @STRIP@ VERSION = @VERSION@ X_INCLUDES = @X_INCLUDES@ X_LIBS = @X_LIBS@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ lib_LTLIBRARIES = liba.la liba_la_SOURCES = \ att.c \ beam.c \ beamconv.c \ bstub.c \ callouts.c \ dbg.c \ dot.c \ f.c \ gpick.c \ i.c \ j.c \ k.c \ m.c \ n.c \ nsf.c \ o.c \ ovli.c \ p.c \ q.c \ r.c \ s.c \ si.c \ u.c \ tmv_nopipe.c \ y.c \ arthur.h\ b.h\ beam.h\ development.h\ f.h\ fir.h\ fncdcls.h\ ik.h\ k.h\ pwr2hpc.h\ s.h\ x.h CFLAGS = @CFLAGS@ -DBSTUB INCLUDES = -I.. fsftestdir = $(libdir) apterdir = $(libdir) tdir = $(libdir) diodir = $(libdir) fsftest_DATA = fsftest.+ apter_DATA = apter.+ t_DATA = t.+ dio_DATA = dio.+ EXTRA_DIST = fsftest.+ apter.+ t.+ dio.+ a_includedir = $(prefix)/include/a a_include_DATA = \ beam.h \ fir.h \ fncdcls.h \ k.h subdir = src/a mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_CLEAN_FILES = LTLIBRARIES = $(lib_LTLIBRARIES) liba_la_LDFLAGS = liba_la_LIBADD = am_liba_la_OBJECTS = att.lo beam.lo beamconv.lo bstub.lo callouts.lo \ dbg.lo dot.lo f.lo gpick.lo i.lo j.lo k.lo m.lo n.lo nsf.lo \ o.lo ovli.lo p.lo q.lo r.lo s.lo si.lo u.lo tmv_nopipe.lo y.lo liba_la_OBJECTS = $(am_liba_la_OBJECTS) DEFS = @DEFS@ DEFAULT_INCLUDES = -I. -I$(srcdir) CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/att.Plo ./$(DEPDIR)/beam.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/beamconv.Plo ./$(DEPDIR)/bstub.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/callouts.Plo ./$(DEPDIR)/dbg.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/dot.Plo ./$(DEPDIR)/f.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/gpick.Plo ./$(DEPDIR)/i.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/j.Plo ./$(DEPDIR)/k.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/m.Plo ./$(DEPDIR)/n.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/nsf.Plo ./$(DEPDIR)/o.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/ovli.Plo ./$(DEPDIR)/p.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/q.Plo ./$(DEPDIR)/r.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/s.Plo ./$(DEPDIR)/si.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/tmv_nopipe.Plo ./$(DEPDIR)/u.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/y.Plo COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ DIST_SOURCES = $(liba_la_SOURCES) DATA = $(a_include_DATA) $(apter_DATA) $(dio_DATA) $(fsftest_DATA) \ $(t_DATA) DIST_COMMON = Makefile.am Makefile.in SOURCES = $(liba_la_SOURCES) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/a/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) libLTLIBRARIES_INSTALL = $(INSTALL) install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(libdir) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f"; \ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p"; \ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test -z "$dir" && dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done liba.la: $(liba_la_OBJECTS) $(liba_la_DEPENDENCIES) $(LINK) -rpath $(libdir) $(liba_la_LDFLAGS) $(liba_la_OBJECTS) $(liba_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/att.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/beam.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/beamconv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bstub.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/callouts.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dot.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/f.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpick.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/j.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/k.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/n.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nsf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/o.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ovli.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/p.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/q.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/r.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/si.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tmv_nopipe.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/u.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/y.Plo@am__quote@ distclean-depend: -rm -rf ./$(DEPDIR) .c.o: @AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< .c.obj: @AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(COMPILE) -c `cygpath -w $<` .c.lo: @AMDEP_TRUE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< CCDEPMODE = @CCDEPMODE@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: a_includeDATA_INSTALL = $(INSTALL_DATA) install-a_includeDATA: $(a_include_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(a_includedir) @list='$(a_include_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(a_includeDATA_INSTALL) $$d$$p $(DESTDIR)$(a_includedir)/$$f"; \ $(a_includeDATA_INSTALL) $$d$$p $(DESTDIR)$(a_includedir)/$$f; \ done uninstall-a_includeDATA: @$(NORMAL_UNINSTALL) @list='$(a_include_DATA)'; for p in $$list; do \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " rm -f $(DESTDIR)$(a_includedir)/$$f"; \ rm -f $(DESTDIR)$(a_includedir)/$$f; \ done apterDATA_INSTALL = $(INSTALL_DATA) install-apterDATA: $(apter_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(apterdir) @list='$(apter_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(apterDATA_INSTALL) $$d$$p $(DESTDIR)$(apterdir)/$$f"; \ $(apterDATA_INSTALL) $$d$$p $(DESTDIR)$(apterdir)/$$f; \ done uninstall-apterDATA: @$(NORMAL_UNINSTALL) @list='$(apter_DATA)'; for p in $$list; do \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " rm -f $(DESTDIR)$(apterdir)/$$f"; \ rm -f $(DESTDIR)$(apterdir)/$$f; \ done dioDATA_INSTALL = $(INSTALL_DATA) install-dioDATA: $(dio_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(diodir) @list='$(dio_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(dioDATA_INSTALL) $$d$$p $(DESTDIR)$(diodir)/$$f"; \ $(dioDATA_INSTALL) $$d$$p $(DESTDIR)$(diodir)/$$f; \ done uninstall-dioDATA: @$(NORMAL_UNINSTALL) @list='$(dio_DATA)'; for p in $$list; do \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " rm -f $(DESTDIR)$(diodir)/$$f"; \ rm -f $(DESTDIR)$(diodir)/$$f; \ done fsftestDATA_INSTALL = $(INSTALL_DATA) install-fsftestDATA: $(fsftest_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(fsftestdir) @list='$(fsftest_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(fsftestDATA_INSTALL) $$d$$p $(DESTDIR)$(fsftestdir)/$$f"; \ $(fsftestDATA_INSTALL) $$d$$p $(DESTDIR)$(fsftestdir)/$$f; \ done uninstall-fsftestDATA: @$(NORMAL_UNINSTALL) @list='$(fsftest_DATA)'; for p in $$list; do \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " rm -f $(DESTDIR)$(fsftestdir)/$$f"; \ rm -f $(DESTDIR)$(fsftestdir)/$$f; \ done tDATA_INSTALL = $(INSTALL_DATA) install-tDATA: $(t_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(tdir) @list='$(t_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(tDATA_INSTALL) $$d$$p $(DESTDIR)$(tdir)/$$f"; \ $(tDATA_INSTALL) $$d$$p $(DESTDIR)$(tdir)/$$f; \ done uninstall-tDATA: @$(NORMAL_UNINSTALL) @list='$(t_DATA)'; for p in $$list; do \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " rm -f $(DESTDIR)$(tdir)/$$f"; \ rm -f $(DESTDIR)$(tdir)/$$f; \ done ETAGS = etags ETAGSFLAGS = tags: TAGS 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; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ 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; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = ../.. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(DATA) installdirs: $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(a_includedir) $(DESTDIR)$(apterdir) $(DESTDIR)$(diodir) $(DESTDIR)$(fsftestdir) $(DESTDIR)$(tdir) 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_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_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-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-compile distclean-depend \ distclean-generic distclean-libtool distclean-tags dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-a_includeDATA install-apterDATA install-dioDATA \ install-fsftestDATA install-tDATA install-exec-am: install-libLTLIBRARIES install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool uninstall-am: uninstall-a_includeDATA uninstall-apterDATA \ uninstall-dioDATA uninstall-fsftestDATA uninstall-info-am \ uninstall-libLTLIBRARIES uninstall-tDATA .PHONY: GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool distclean distclean-compile \ distclean-depend distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am info info-am install \ install-a_includeDATA install-am install-apterDATA install-data \ install-data-am install-dioDATA install-exec install-exec-am \ install-fsftestDATA install-info install-info-am \ install-libLTLIBRARIES install-man install-strip install-tDATA \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool tags uninstall \ uninstall-a_includeDATA uninstall-am uninstall-apterDATA \ uninstall-dioDATA uninstall-fsftestDATA uninstall-info-am \ uninstall-libLTLIBRARIES uninstall-tDATA # 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: aplus-fsf-4.22/src/a/att.c0000644000265000001440000000774510772770356011014 /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #include #include #include #include #include #include #include #include #include #include /*------- Hash Table Functions ----------*/ unsigned long hafn(unsigned long key){R key^key>>11;} HT hti(unsigned long nb){HT ht=(HT)balloc((2+nb)*sizeof(I)); ht->nb=nb;ht->ni=0;bzero(ht->b,nb*sizeof(I));R ht;} void mvht(HT oht,HT nht){I i;HTN node,*bp; for(i=0;inb;++i)for(node=(HTN)oht->b[i];node;node=node->n){ bp=(HTN *)HTHASH(nht,node->s);node->n=*bp;*bp=node;}} /* htgi - get val of key from ht. If !found,(*gf)() to create, and *pnew=1.*/ I htgi(HT ht,S key,I (*gf)(void),I *pnew) { HTN *htn=(HTN*)HTHASH(ht,key),n,hd;if(gf&&pnew)*pnew=0; for(n=*htn;n;n=n->n)if(key==n->s)R(I)n; if(!gf)R 0;if(pnew)*pnew=1;n=(HTN)((*gf)());if(!n)R 0;n->s=key; hd = *htn ; if(hd){n->n=hd->n;hd->n=n;}else{*htn=n;n->n=0;}++ht->ni;R(I)n; } /* htsi - set val of key in ht to d. If no entry exists, create w gf. if aq is true, use ic() and dc(). */ I htsi(HT ht,S key,I a,I aq,I (*gf)(void)) { HTN *htn=(HTN*)HTHASH(ht,key),n,hd; for(n=*htn;n;n=n->n)if(key==n->s){if(aq)dc((A)n->a);n->a=(aq)?ic((A)a):a;R 0;} if(!gf)R 0;n=(HTN)((*gf)());if(!n)R 0;n->s=key;n->a=(aq)?ic((A)a):a; hd = *htn ; if(hd){n->n=hd->n;hd->n=n;}else{*htn=n;n->n=0;}++ht->ni;R 1; } /* htxi - remove key in ht. If aq is true dc() n->a before removal. */ I htxi(HT ht,S key,I aq) { HTN *htn=(HTN*)HTHASH(ht,key),n,p; if(!*htn)R 1; if(!(n=*htn))R 1; if(key==n->s){if(aq)dc((A)n->a);*htn=n->n;bfree((char *)n);--ht->ni;R 0;} for(p=n;n=n->n;p=n) if(key==n->s){if(aq)dc((A)n->a);p->n=n->n;bfree((char *)n);--ht->ni;R 0;} R 1; } /*---------- utilities -----------*/ Z V av(A a) { I n=a->n-1; if (!sym(a)||n>1) R (V)0; R sv(n?cxi(XS(*a->p)):Cx,XS(a->p[n])); } #define AttHTSIZE 1<<5 Z HT atbi(void){R hti(AttHTSIZE);} Z ATT atti(void){ATT att=(ATT)balloc(sizeof(*att));bzero(att,sizeof(*att));R att;} /*--------- Entrypoints --------------*/ A ep_gatt(V v,S s){ATT z; R(A)((!v->atb)?0:(z=(ATT)htgi(v->atb,s,0,0))?ic((A)z->a):0);} A ep_get(A var,A att){V v;NDC2(var,att);v=av(var); if(!v||!sym(att)||att->n!=1)ERROUT(ERR_DOMAIN);R(A)ep_gatt(v,XS(*att->p));} I ep_satt(V v,S s,I val){I z=qz((A)val);if(!v->atb){if(z)R 1;else v->atb=atbi();} R (z?htxi(v->atb,s,1):htsi(v->atb,s,val,1,(I(*)())atti));} I ep_set(A a,A w){V v;A att,val;NDC2(a,w);v=av(a); Q(!v||QF(w)||Et!=w->t||2!=w->n,ERR_DOMAIN);att=(A)w->p[0];val=(A)w->p[1]; Q(!sym(att)||att->n!=1,ERR_DOMAIN);R ep_satt(v,XS(*att->p),(I)val);} A ep_atts(A var,A pre) { V v;I i,count=0;ATT att;A result;HT ht;S spre,st;I z; NDC2(var,pre);v=av(var);z=qz(pre); if(!v||(!sym(pre)||pre->n!=1)&&!z)ERROUT(ERR_DOMAIN); if(!v->atb)R(A)aplus_nl;ht=v->atb; spre=XS(*pre->p); for(i=0;inb;++i)for(att=(ATT)ht->b[i];att;att=att->n) if(z||symsplit(att->s,&st)&&spre==st)++count; result=gv(Et,count);count=0; for(i=0;inb;++i)for(att=(ATT)ht->b[i];att;att=att->n) if(z||symsplit(att->s,&st)&&spre==st)result->p[count++]=MS(att->s); R result; } void rmatb(V v){HT ht=v->atb;HTN n;I i;if(!ht)R; for(i=0;inb;++i)for(n=(HTN)ht->b[i];n;n=n->n){dc((A)n->a);bfree((char *)n);} bfree((char *)ht);v->atb=0;R;} void attInstall(void) { install((PFI)ep_get, "_get", A_, 2, A_, A_,0,0,0,0,0,0); install((PFI)ep_set, "_set", IV, 2, A_, A_,0,0,0,0,0,0); install((PFI)ep_atts,"_atts", A_, 2, A_, A_,0,0,0,0,0,0); } aplus-fsf-4.22/src/a/beam.c0000644000265000001440000005313610772770356011123 /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved. */ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include extern I dbg_tb, dbg_tnan; extern C *findMapped32FileName(); extern C *findMapped64FileName(); extern C *findFileName(); Z I items(I n,A z); /* flag to control auto/endain conversion of the .m file */ Z I autoBeamConvert=0; /* Default is off */ I getAutoBeamConvert(void) {R autoBeamConvert;} void setAutoBeamConvert(I m) {autoBeamConvert=m;} Z I mapOut(C *s,A z) ; int isWrongEndian(A aobj) { return (aobj->r)?(!(1<=aobj->r&&MAXR>=aobj->r)):1!=aobj->n; } typedef union {char *c;unsigned char *uc;u_long *u;I *i;F *f;} EndianUnion; static EndianUnion EndianTag={"abcd"}; static C *endianString(I endian) { return (endian==ENDIAN_BIG)?"big":(endian==ENDIAN_LITTLE)?"little": (endian==ENDIAN_UNDEF)?"undef":"unknown"; } static I hostEndian(void) { return (0x61626364==*EndianTag.u)?ENDIAN_BIG: (0x64636261==*EndianTag.u)?ENDIAN_LITTLE: ENDIAN_UNDEF; } /* non-overlapping endian-swapping copy!! - Method 1 - one loop */ static void ndnicopy(I *from,I *to,I nints) { unsigned char *cfrom=(unsigned char *)from, *cto=(unsigned char *)to; for(;nints--;cfrom+=4,cto+=4) { cto[3]=cfrom[0];cto[2]=cfrom[1];cto[1]=cfrom[2];cto[0]=cfrom[3]; } } static void ndnfcopy(F *from,F *to,I nfs) { unsigned char *cfrom=(unsigned char *)from, *cto=(unsigned char *)to; for(;nfs--;cfrom+=8,cto+=8) { cto[7]=cfrom[0];cto[6]=cfrom[1];cto[5]=cfrom[2];cto[4]=cfrom[3]; cto[3]=cfrom[4];cto[2]=cfrom[5];cto[1]=cfrom[6];cto[0]=cfrom[7]; } } /* in-place endian swap */ static void ndniswap(I *start,I nints) { I tempi; EndianUnion tu, eu; tu.i=&tempi; for(eu.i=start;nints--;++eu.i) { tempi=*eu.i; eu.uc[3]=tu.uc[0]; eu.uc[2]=tu.uc[1]; eu.uc[1]=tu.uc[2]; eu.uc[0]=tu.uc[3]; } } static void ndnfswap(F *start,I nfs) { F tempf; EndianUnion tu, eu; tu.f=&tempf; for(eu.f=start;nfs--;++eu.f) { tempf=*eu.f; eu.uc[7]=tu.uc[0]; eu.uc[6]=tu.uc[1]; eu.uc[5]=tu.uc[2]; eu.uc[4]=tu.uc[3]; eu.uc[3]=tu.uc[4]; eu.uc[2]=tu.uc[5]; eu.uc[1]=tu.uc[6]; eu.uc[0]=tu.uc[7]; } } static I aobjEndian(A aobj) { int result=ENDIAN_UNDEF; I tempint; int hostndn=hostEndian(); if(!isWrongEndian(aobj))result=hostndn; else { ndnicopy(&aobj->r,&tempint,1); if(0<=tempint&&9>=tempint) result=(ENDIAN_BIG==hostndn)?ENDIAN_LITTLE:ENDIAN_BIG; } return(result); } static void doSwapEndianInPlace(A aobj, I targetndn) { I n,t; I sourcendn=aobjEndian(aobj); I hostndn=hostEndian(); if(targetndn==sourcendn)return; if(targetndn==hostndn) { ndniswap((I *)aobj,AH/sizeof(I)); n=aobj->n; t=aobj->t; } else { n=aobj->n; t=aobj->t; ndniswap((I *)aobj,AH/sizeof(I)); } switch(t) { case It: ndniswap(aobj->p,n); break; case Ft: ndnfswap((F *)aobj->p,n); break; case Ct: break; default: printf("\343 error!!: doSwapEndianInPlace encountered bad type:%ld\n",t); break; } } static A doCopySwitchEndian(A aobj,I targetndn) { static struct a tempAobj; A z; I n,t; I sourcendn=aobjEndian(aobj); I hostndn=hostEndian(); if(targetndn==sourcendn)return (A)ic(aobj); if(targetndn==hostndn) { ndnicopy((I *)aobj,(I *)&tempAobj,AH/sizeof(I)); z=gd(tempAobj.t,&tempAobj); n=z->n; t=z->t; } else { n=aobj->n; t=aobj->t; z=gd(aobj->t,aobj); ndnicopy((I *)aobj,(I *)z,AH/sizeof(I)); } switch(t) { case It: ndnicopy(aobj->p,z->p,n); break; case Ft: ndnfcopy((F *)aobj->p,(F *)z->p,n); break; case Ct: bcopy(aobj->p,z->p,n+1); break; default: printf("\343 error!!: doCopySwitchEndian encountered bad type:%ld\n",t); break; } return z; } A ep_hostEndian(void) { return gsym(endianString(hostEndian())); } A ep_aobjEndian(A aobj) { return gsym(endianString(aobjEndian(aobj))); } A ep_CopyRightEndian(A aobj) { return doCopySwitchEndian(aobj,hostEndian()); } void ep_SwapRightEndian(A aobj) /* must use argument type 12, not 0!!! */ { if(!isWrongEndian(aobj))return; doSwapEndianInPlace(aobj,hostEndian()); } A ep_CopyToEndian(A aobj,A andn) { I targetndn; if(Et!=andn->t||1!=andn->n||!QS(*andn->p))ERROUT(ERR_TYPE); targetndn=(*andn->p==MS(si("big"))) ? ENDIAN_BIG : (*andn->p==MS(si("little")))? ENDIAN_LITTLE : ENDIAN_UNDEF; if(ENDIAN_UNDEF==targetndn)ERROUT(ERR_DOMAIN); return doCopySwitchEndian(aobj, targetndn); } A ep_SwapToEndian(A aobj,A andn) /* must use argument type 12, not 0!!! */ { I targetndn, sourcendn; if(Et!=andn->t||1!=andn->n||!QS(*andn->p))ERROUT(ERR_TYPE); targetndn=(*andn->p==MS(si("big"))) ? ENDIAN_BIG : (*andn->p==MS(si("little")))? ENDIAN_LITTLE : ENDIAN_UNDEF; if(ENDIAN_UNDEF==targetndn)ERROUT(ERR_DOMAIN); sourcendn=aobjEndian(aobj); if(targetndn!=sourcendn) doSwapEndianInPlace(aobj, targetndn); return aplus_nl; } Z int loopen(C *path,int flags,mode_t mode) { int i=0,st=1,fd=-1; static C fcn[]="open"; if(!path) R -1; while(i<10&&-1==(fd=open(path,flags,mode))&&EWOULDBLOCK==errno) {sleep(st);if(8>st)st*=2;++i;} if (i) errno=log_EWouldBlock(i,fd,errno,path,fcn); R fd; } C *tmv32(int t,I *d,int *s,int n) { int i; switch(t) { case It: for (i = 0; i < n; i++) { *d++ = *s++; } R(C*)d; case Et: fprintf(stderr, "\343 Internal Error:beam.c/tmv32 - can't do enclosed types\n"); R 0; case Ft: { F *a=(F*)d; F *b=(F*)s; DO(n,*a++=*b++) R(C*)a; } case Ct: { C *a=(C*)d; C *b=(C*)s; DO(n,*a++=*b++) R(C*)a; } } R 0; } void ttmv32(int t,I *d,int *s,int n) { C *x=tmv32(t,d,s,n); if (x == 0) { fprintf(stderr, "\343 Internal Error:beam.c/ttmv32 tmv32 failed\n"); R; } if(Ct==t) *x='\0'; } void mv32(I *dest64,int *src32,int n) { int i; for (i = 0; i < n; i++) { *dest64++ = *src32++; } } A gc32(int t, int r, int n, int d[], int *p) { I f ; A z ; /*printf("In gc32 (%d, %d, %d ...)\n", t, r, n) ; */ f = (t==Ct) ; z = (A)mab(f+AH+Tt(t,n)); z->c=1; z->t=t; z->r=r; z->n=n; mv32(z->d,d,r); ttmv32(t,z->p,p,n); if(f) ((C*)z->p)[n]=0; R z; } A cvt64(A32 *aobj) { /* mapped objects only - floats, chars and longs */ A newa; I i = aobj->i ; /*printf("%d %d %d %d %d\n", aobj->c, aobj->t, aobj->r, aobj->n, aobj->i) ; */ newa = gc32(aobj->t,aobj->r,aobj->n,aobj->d,aobj->p); newa->i = i ; R newa; } Z A vetteMappedFile(I fsize, I aarg, int mode, C *name, int *rc, I cvtInPlace) { A aobj=(A)aarg,z; /* return 0, no conversion, z is set to aobj */ /* return 1, conversion successful, z is new object in memory */ /* return -1, conversion failed, z is set to NULL */ *rc=cvtIfNeeded(aobj, &z, fsize, cvtInPlace); return z; } typedef struct{I a,c,n,w;C *s,*t;}MFInfo; /* n field used for "next" in freelist */ Z I maxMFAlimit=2000; Z I maxMFAindex=0; Z I freeMFAindex=0; Z MFInfo *MappedFileArray=0; Z C MFAErrorMsg[128]; Z int MFArealloc(I newlim) { Z MFInfo *newMFA; I i, count=0; if(0==newlim||newlimcount) { bzero(newMFA+count,sizeof(MFInfo)*(newlim-count)); for(i=count;inewlim) { H("%ld\n",maxMFAlimit); R; } if(0==MappedFileArray){maxMFAlimit=newlim;R;} rc=MFArealloc(newlim); if(rc) H("\343 maplim error: %s\n",MFAErrorMsg); } I MFALimitGet(void){R maxMFAlimit;} void MFALimitSet(I newlim) { int rc; rc=MFArealloc(newlim); if(rc) {H("\343 maplim error: %s\n",MFAErrorMsg);qs="maplim";q=-1;R;} R; } Z MFInfo *findMFInfoStruct(A aobj) { if(aplus_nl==aobj||0==MappedFileArray)R 0; DO(maxMFAindex,if(MappedFileArray[i].a==(I)aobj)R MappedFileArray+i); R 0; } Z MFInfo *getFreeMFInfoStruct(void) { MFInfo *p; if (0==MappedFileArray&&0!=maxMFAlimit) MFArealloc(maxMFAlimit); if(freeMFAindex>=maxMFAlimit)R 0; p=MappedFileArray+freeMFAindex; if(freeMFAindex>=maxMFAindex)maxMFAindex=freeMFAindex+1; freeMFAindex=p->n; R p; } Z void unmapDotMFile(A a,MFInfo *p) { /* printf("In unmapDotMFile(%s, %lx, %ld)\n", p->t, a, p->n) ; */ if(dbg_tb) beamtrc(p->t,2,0); if(munmap((void*)a,(size_t)p->n)) { I nern=errno; #ifndef __ia64 syslog(LOG_INFO,"A+ munmap() failed for %s with args (%#lx,%ld) with %m", p->t,a,p->n,nern); #endif H("\343 A+ munmap() failed for %s with args (%#lx,%ld) and errno=%ld\n", p->t,a,p->n,nern); } p->a=0; bfree(p->s); bfree(p->t); p->s=p->t=(C *)0; p->n=freeMFAindex; freeMFAindex=(p-MappedFileArray); if(p==MappedFileArray+(maxMFAindex-1))--maxMFAindex; } Z I mapDotMFile(int fd,int mode,C *fname,C *t) { A aobj; I mfile; int rc; MFInfo *p; off_t n; n=lseek(fd,0,SEEK_END); mfile=map(fd,mode); /* map returns a 0 on failure */ Q(!mfile,9); /* Set domain error if map fails */ /* printf("mfile = %ld, n = %ld\n", mfile, n) ; */ aobj=vetteMappedFile(n, mfile, mode, fname, &rc, mode==BEAM_RW && autoBeamConvert); if(!aobj || rc==-1) { if(dbg_tb) beamtrc(t,2,0); munmap((caddr_t)mfile,n); R q=9,0; } if(rc==1 && mode==BEAM_RW && autoBeamConvert==0) { if(dbg_tb) beamtrc(t,2,0); munmap((caddr_t)mfile,n); dc(aobj); printf("\343 Error: read/write, but conversion to local variable\n"); R q=9,0; } /* The following if clause will convert the .m file to the native format */ /* for 32 bit to 64 bit otherwise it is done in place */ if(rc==1 && mode==BEAM_RW && autoBeamConvert==1) /* Convert .m file */ { struct a a; I itemCount=aobj->i; /* original item count */ if(dbg_tb) beamtrc(t,3,0); /* 3==Converting */ if(dbg_tb) beamtrc(t,2,0); munmap((caddr_t)mfile,n); /* unmap previous */ mapOut(t, aobj); /* write new .m with converted data */ dc(aobj); /* free a object */ /* reset the items to match orignal*/ { A mFile=gsv(0,t); I rc=items(itemCount, mFile); if(dbg_tb) printf("\343 Setting Items to %ld\n",itemCount); dc(mFile); } /* re-map it */ ERR(t, fd=loopen(t,BEAM_RW==mode?O_RDWR:O_RDONLY,0666)); n=lseek(fd,0,SEEK_END); mfile=map(fd,mode); /* map returns a 0 on failure */ Q(!mfile,9); /* Set domain error if map fails */ /* Call vetteMappedFile with autoBeamConvert off */ aobj=vetteMappedFile(n, mfile, mode, fname, &rc, 0); if(!aobj || rc!=0) { if(dbg_tb) beamtrc(t,2,0); munmap((caddr_t)mfile,n); R q=9,0; } } if(rc==1) /* Conversion to regular variable*/ { if(dbg_tb) beamtrc(t,2,0); munmap((caddr_t)mfile,n); /* unmap previous */ } else { p=getFreeMFInfoStruct(); if(!p) { R H("maplim\n"),dc(aobj),q=9,0; } p->c=1,p->n=n,p->w=mode,p->s=bstring(fname),p->t=bstring(t),p->a=mfile; } R (I)aobj; } I isWritableFile(I a){MFInfo *p=findMFInfoStruct((A)a);R p?p->w:0;} I im(I a){MFInfo *p=findMFInfoStruct((A)a);if(p)++p->c;R a;} void dm(A a) { MFInfo *p=findMFInfoStruct(a); if(p){ if(!--p->c){ unmapDotMFile(a,p); } } else if(0c) if (!--a->c)dec(a); } I mf_length(A aobj){MFInfo *p=findMFInfoStruct(aobj);R p?p->n:0;} I mf_info(A aobj,I *pw,C **pt) { MFInfo *p=findMFInfoStruct(aobj); if(p){*pw=p->w;*pt=p->t;R 0;} R 1; } Z void dbg_mfapp(MFInfo *p) {H(" [%s] refcnt:%ld\n",p->t,p->c);} void dbg_mfa(void) { I i; H("\343 maplim:%ld maxIndex:%ld freeIndex:%ld\n",maxMFAlimit,maxMFAindex, freeMFAindex); if(0==MappedFileArray){H("\343 Mapped File Array not initialized.\n");R;} DO(maxMFAindex,H("\343 %ld: ",i); if(MappedFileArray[i].a)dbg_mfapp(MappedFileArray+i); else H(" next:%ld\n",MappedFileArray[i].n)); H("\343 -- -----------------\n"); for(i=maxMFAindex;i=maxMFAlimit)break; H("\343 %ld: ",i); if(MappedFileArray[i].a)dbg_mfapp(MappedFileArray+i); else H(" next:%ld\n",MappedFileArray[i].n); } } Z void dbg_mfrpp(MFInfo *p) {H("\343 %ld\340\"%s\": [%s] addr:%lu refcnt:%ld bytes:%ld\n", p->w,p->s,p->t,p->a,p->c,p->n);} void dbg_mfr(void) { if(0==MappedFileArray)R; DO(maxMFAindex,if(MappedFileArray[i].a)dbg_mfrpp(MappedFileArray+i)); } A dbg_mfrsf(void) { I n=0; A z,modes,args,fnames,addrs,refcnts,bytes; MFInfo *p; z=gv(Et,2); z->p[0]=(I)gvi(Et,6,MS(si("mode")),MS(si("arg")),MS(si("fname")), MS(si("addr")),MS(si("refcnt")),MS(si("bytes"))); if(MappedFileArray){DO(maxMFAindex,if(MappedFileArray[i].a)++n);} modes=gv(It,n); args=gv(Et,n); fnames=gv(Et,n); addrs=gv(It,n); refcnts=gv(It,n); bytes=gv(It,n); n=0; if(MappedFileArray) { DO(maxMFAindex, if(MappedFileArray[i].a){p=MappedFileArray+i; modes->p[n]=p->w; args->p[n]=(I)gsv(0,p->s); fnames->p[n]=(I)gsv(0,p->t); addrs->p[n]=p->a; refcnts->p[n]=p->c; bytes->p[n]=p->n; n++;}); } z->p[1]=(I)gvi(Et,6,modes,args,fnames,addrs,refcnts,bytes); R z; } I mapIn(C *name,I mode){ int fd=-1; I z; int tmode = mode ; /* Valid modes 0, 1, or 2 */ C*t=0; /* printf("In mapIn(%s, %d)\n", name, mode) ;*/ Q(!name||BEAM_RO>mode||BEAM_LOCALi!=(newItems=a->r ? a->d[0] : a->n)) { /* if beaming out a mapped variable, writeover a->i with a->d[0] */ lt=lseek(fd,(AH-sizeof(I)),SEEK_SET); if(lt!=-1) t=write(fd,(C *)&newItems,sizeof(I)); } fsync(fd);R t; } /* IBM write fix */ Z I mapOut(C *s,A z) { int fd; I rc,c=0; C r[MAXPATHLEN]; C *dotPos, *slashPos; /* #if (_MIPS_SZLONG == 64) || defined(__alpha) || defined(__sparcv9) || defined(_ia64) */ /* static C defaultSuffix[]={"m64"} ; */ /* #else */ /* static C defaultSuffix[]={"m"}; */ /* #endif */ static C defaultSuffix[]={"m"}; Q(Ctt,6); /* On solaris this comparison was failing when '.' was zero and the address */ /* returned from strrchr was a negative signed long */ /* This was caused by missing #include string.h */ /* s=strrchr((DEV_STRARG)s,'.')>strrchr((DEV_STRARG)s,'/') ? */ /* s : findFileName(s,"m"); */ dotPos=strrchr((DEV_STRARG)s,'.'); if( dotPos==NULL ) { s=findFileName(s,defaultSuffix); } else { slashPos=strrchr((DEV_STRARG)s,'/'); if(slashPos!=NULL && dotPosc)c=z->c,z->c=0,z->i=z->r?*z->d:1; rc=writeAobjToFile(fd,(C *)z,AH+Tt(z->t,z->n)+(Ct==z->t?1:0),c); if(c)z->c=c; fsync(fd); close(fd); ERR(s,rc); ERR(s,rename(r,s)); R 1; } C *stringFromAobj(A a){R a->t==Ct?(C*)a->p:a->t==Et&&QS(*a->p)?XS(*a->p)->n:0;} H1(monadicBeam){ND1 R mapIn(stringFromAobj(a),0);} H2(dyadicBeam){ C *s; ND2; s=stringFromAobj(a); R !s?mapIn(stringFromAobj(w),*a->p):mapOut(s,w)?(I)aplus_nl:0; } Z I setSizeOfFile(int fd,off_t n) { #ifdef __VISUAL_C_2_0__ I j=CLBYTES,k=lseek(fd,0,SEEK_END); #else size_t j=getpagesize(),k=lseek(fd,0,SEEK_END); #endif C junk[4]; /* printf("In setSizeOfFile; n = %ld, j = %ld, k = %ld\n", n, j, k) ;*/ junk[0]='\0'; if(-1==k) R k; n=((n+j-1)/j)*j; for(;nn,9); NDC1(z);s=stringFromAobj(z);Q(!s,9); #if (_MIPS_SZLONG == 64) || defined(__alpha) || defined(__sparcv9) || defined(__ia64) name = findMapped64FileName(s, w) ; if (!name) name = findMapped32FileName(s, w) ; #else name = findMapped32FileName(s, w) ; #endif ERR(s, fd=loopen(name,w?O_RDWR:O_RDONLY,0666)); if(-1==read(fd,(C *)&a,AH)) return perror(s),close(fd),q=9,0; { int ret; I totsize,rank,itemCount,items; struct stat statbuf; if ( -1==fstat(fd, &statbuf) ) /* To get size for getItems() */ return perror(s), close(fd), q=9, 0; ret=getItems(&a, &itemCount, &rank, &items, statbuf.st_size); if( ret==-1 || rank==0 ) /* error conversion or scalar */ { printf("\343 Error: %s [%s]\n", (ret==-1) ? "Conversion ":"Scalar ",name); return close(fd), q=(ret==-1)?9:7, 0; } if( n==-1 ) /* Query */ return close(fd), itemCount>items?itemCount:items; if( ret==1 && !autoBeamConvert ) /* conversion required */ { printf("\343 Error: requires conversion [%s]\n",name); return close(fd), q=9, 0; } /* try to set the items */ if( ret==1 ) /* convert before setting items */ { A aobj=(A)mapDotMFile(fd, BEAM_RW, s, name); if(aobj==0) return 0; else dc(aobj); #if (_MIPS_SZLONG == 64) || defined(__alpha) || defined(__sparcv9) || defined(__ia64) name = findMapped64FileName(s, w) ; if (!name) name = findMapped32FileName(s, w) ; #endif /* re-open converted file */ if(-1==(fd=loopen(name,w?O_RDWR:O_RDONLY,0666))) return perror(s),q=9,0; if(-1==read(fd,(C *)&a,AH)) return perror(s),close(fd),q=9,0; } m=*a.d; /* Set the items */ j=a.i; if(m>j)j=m; if(w){ t=a.t; if(n==-2) { if(-1==setSizeOfFile(fd,AH+Tt(t,a.n)+(t==Ct))) R perror(s),close(fd),q=9,0; } else { a.i=n; m=n*tr(a.r-1,a.d+1); if(n<*a.d) /* reset d[0] if greater than n */ *a.d=n,a.n=m; if(-1==flen(fd,AH+Tt(t,m)+(t==Ct))) R perror(s),close(fd),q=9,0; if(-1==lseek(fd,0,0)) R perror(s),close(fd),q=9,0; if(-1==write(fd,(C *)&a,AH)) R perror(s),close(fd),q=9,0; } } R close(fd),j; } } static long ep_isaDotM(char *fname) { long rc=0; /* 0 == invalid dot M file */ A aobj; off_t mlen; int fd; if(-1==(fd=open(fname,O_RDONLY))) { perror(fname); return rc; } mlen=lseek(fd,0,2); if(0==(aobj=(A)map(fd,0))) /* map closes fd */ { perror(fname); return rc; } if ( isAObject(*aobj) ) { int dimsOK=1; /* Check dimensions */ checkDims(*aobj); /* Check file length */ #if (HAS_64BIT_TYPE==1) if (dimsOK && checkFileSize64(*aobj) <= mlen) rc=1; #else if (dimsOK && checkFileSize32(*aobj) <= mlen) rc=1; #endif } munmap(aobj,mlen); return rc; } static void ep_msyncAll(A msyncMode_) { int msyncFlag=0; long i; if(msyncMode_->t!=Et || !QS(*msyncMode_->p) ) { q=ERR_DOMAIN; R; } for(i=0; in; i++) { if(msyncMode_->p[i]==MS(si("MS_ASYNC"))) { if(msyncFlag&MS_SYNC) { q=ERR_DOMAIN; return; } else { msyncFlag|=MS_ASYNC; } } else if(msyncMode_->p[i]==MS(si("MS_SYNC"))) { if(msyncFlag&MS_ASYNC) { q=ERR_DOMAIN; return; } else { msyncFlag|=MS_SYNC; } } else if(msyncMode_->p[i]==MS(si("MS_INVALIDATE"))) { msyncFlag|=MS_INVALIDATE; } else { q=ERR_DOMAIN; return; } } for(i=0; ia && p->w==1 ) { A a=(A)p->a; if(-1==msync((C*)a, AH+Tt(a->t,a->n), msyncFlag)) { printf("\343 Error: %s\n",p->t); perror("ep_amsyncAll: msync"); } } } } void beamInstall(void){ install((PFI)items, "_items", 9,2,9,0,0,0,0,0,0,0); install((PFI)ep_hostEndian,"_hostendian",0,0,0,0,0,0,0,0,0,0); install((PFI)ep_aobjEndian,"_endian", 0,1,0,0,0,0,0,0,0,0); install((PFI)ep_isaDotM, "_isaDotM", 9,1,7,0,0,0,0,0,0,0); install((PFI)ep_msyncAll, "_msyncAll", 8,1,0,0,0,0,0,0,0,0); R; } aplus-fsf-4.22/src/a/beamconv.c0000644000265000001440000005643510772770356012016 /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved. */ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* This file contains routines that identify and convertthe different * formats of mmap'd files used by A+ */ #include #include #include #include #include #include extern I dbg_tb; static char *endianString(int endian) { return (endian==ENDIAN_BIG)?"big":(endian==ENDIAN_LITTLE)?"little": (endian==ENDIAN_UNDEF)?"undef":"unknown"; } typedef union { char *c; unsigned char *uc; u_int *u; long *i; double *f; } EndianUnion; static EndianUnion EndianTag={"abcd"}; static INT32 SwapEndianInt32(INT32 in) { INT32 out; int i; unsigned char *to = (unsigned char *)&out; unsigned char *from = (unsigned char *)∈ for (i = 0; i < sizeof(INT32); i++) to[i] = from[3-i]; return out; } static INT64 SwapEndianInt64(INT64 in) { INT64 out; int i; unsigned char *to = (unsigned char *)&out; unsigned char *from = (unsigned char *)∈ for (i = 0; i < sizeof(INT64); i++) { to[i] = from[7-i]; } return out; } static double SwapEndianDouble(double in) { double out; int i; unsigned char *to = (unsigned char *)&out; unsigned char *from = (unsigned char *)∈ for (i = 0; i < sizeof(double); i++) { to[i] = from[(sizeof(double)-1)-i]; } return out; } static double SwapEndianDouble32(double in) { double out; int i; unsigned char *to = (unsigned char *)&out; unsigned char *from = (unsigned char *)∈ for (i = 0; i < sizeof(INT32); i++) { to[i] = from[3-i]; } return out; } static void SwapEndianHeader64(A64 *header) { int i; header->c = SwapEndianInt64(header->c); header->t = SwapEndianInt64(header->t); header->r = SwapEndianInt64(header->r); header->n = SwapEndianInt64(header->n); header->i = SwapEndianInt64(header->i); for (i = 0; i < 9; i++) header->d[i] = SwapEndianInt64(header->d[i]); } static void SwapEndianHeader32(A32 *header) { int i; header->c = SwapEndianInt32(header->c); header->t = SwapEndianInt32(header->t); header->r = SwapEndianInt32(header->r); header->n = SwapEndianInt32(header->n); header->i = SwapEndianInt32(header->i); for (i = 0; i < 9; i++) header->d[i] = SwapEndianInt32(header->d[i]); } /* tr and tr32 -- from k.c */ INT64 tr64(INT64 r, INT64 *d) { INT64 n=1; INT64 *t; if (r) for (t = d + r , n = *d; ++d < t; n *= *d); return n; } static INT32 tr32(INT32 r, INT32 *d) { INT32 n=1; INT32 *t; if (r) for (t = d + r , n = *d; ++d < t; n *= *d); return n; } static void GetHostInformation(int *width, int *endian) { /* 1. Determine what endian we are */ if (0x61626364==*EndianTag.u) *endian = ENDIAN_BIG; else { if (0x64636261==*EndianTag.u) *endian = ENDIAN_LITTLE; else *endian = ENDIAN_UNDEF; } /* 2. Determine what width we are */ *width = sizeof(long) * 8; } static int GetSrcInformation(void *src, I iBytesRead, I noSizeChk, int *width, int *endian, int iHostWidth, int iHostEndian) { long iPredLen; long iLen; int sizeOK=1; char caHeaderBuf[sizeof(A64)]; A32 a32BigHeader; A64 a64BigHeader; A32 a32LittleHeader; A64 a64LittleHeader; struct stat statbuf; if( iBytesRead>0 && (iBytesRead 0 */ if ( isAObject(a64LittleHeader) ) { int dimsOK=1; /* Check dimensions */ checkDims(a64LittleHeader); /* Check file length */ if (dimsOK && noSizeChk || (sizeOK=checkFileSize64(a64LittleHeader)<=iLen)) { *width = 64; *endian = ENDIAN_LITTLE; return 0; } } /* Try 64-bit big endian */ /* Valid values: 0 <= type <= 8, 0 < rank <= 9, n > 0 */ if ( isAObject(a64BigHeader) ) { int dimsOK=1; /* Check dimensions */ checkDims(a64BigHeader); /* Check file length */ if (dimsOK && noSizeChk || (sizeOK=checkFileSize64(a64BigHeader)<=iLen)) { *width = 64; *endian = ENDIAN_BIG; return 0; } } #endif /* Try 32-bit little endian */ /* Valid values: 0 <= type <= 8, 0 < rank <= 9, n > 0 */ if ( isAObject(a32LittleHeader) ) { int dimsOK=1; /* Check dimensions */ checkDims(a32LittleHeader); /* Check file length */ if (dimsOK && noSizeChk || (sizeOK=checkFileSize32(a32LittleHeader)<=iLen)) { *width = 32; *endian = ENDIAN_LITTLE; return 0; } } /* Try 32-bit big endian */ /* Valid values: 0 <= type <= 8, 0 < rank <= 9, n > 0 */ if( isAObject(a32BigHeader) ) { int dimsOK=1; /* Check dimensions */ checkDims(a32BigHeader); /* Check file length */ if (dimsOK && noSizeChk || (sizeOK=checkFileSize32(a32BigHeader)<=iLen)) { *width = 32; *endian = ENDIAN_BIG; return 0; } } #elif (_MIPS_SZLONG == 64) || defined(__alpha) || defined(__sparcv9) /* Try 64-bit big endian */ /* Valid values: 0 <= type <= 8, 0 < rank <= 9, n > 0 */ if ( isAObject(a64BigHeader) ) { int dimsOK=1; /* Check dimensions */ checkDims(a64BigHeader); /* printf("In 64 bit big endian\n"); printf("Count: %lx\n", a64BigHeader.c); printf("Type: %lx\n", a64BigHeader.t); printf("Rank: %lx\n", a64BigHeader.r); printf("Num: %lx\n", a64BigHeader.n); printf("Items: %lx\n", a64BigHeader.i); printf("Size: %ld\n", sizeof(A64) - sizeof(INT64) + Tt64(a64BigHeader.t, a64BigHeader.i) + (a64BigHeader.t == 2)); */ /* Check file length */ if (dimsOK && noSizeChk || (sizeOK=checkFileSize64(a32BigHeader)<=iLen)) { *width = 64; *endian = ENDIAN_BIG; return 0; } } /* Try 64-bit little endian */ /* Valid values: 0 <= type <= 8, 0 < rank <= 9, n > 0 */ if ( isAObject(a64LittleHeader) ) { int dimsOK=1; /* Check dimensions */ checkDims(a64LittleHeader); /* Check file length */ if (dimsOK && noSizeChk || (sizeOK=checkFileSize64(a64LittleHeader)<=iLen)) { *width = 64; *endian = ENDIAN_LITTLE; return 0; } } /* Try 32-bit big endian */ /* Valid values: 0 <= type <= 8, 0 < rank <= 9, n > 0 */ if( isAObject(a32BigHeader) ) { int dimsOK=1; /* Check dimensions */ checkDims(a32BigHeader); /* Check file length */ if (dimsOK && noSizeChk || (sizeOK=checkFileSize32(a32BigHeader)<=iLen)) { *width = 32; *endian = ENDIAN_BIG; return 0; } } /* Try 32-bit little endian */ /* Valid values: 0 <= type <= 8, 0 < rank <= 9, n > 0 */ if ( isAObject(a32LittleHeader) ) { int dimsOK=1; /* Check dimensions */ checkDims(a32LittleHeader); /* Check file length */ if (dimsOK && noSizeChk || (sizeOK=checkFileSize32(a32LittleHeader)<=iLen)) { *width = 32; *endian = ENDIAN_LITTLE; return 0; } } #else /* Try 32-bit big endian */ /* Valid values: 0 <= type <= 8, 0 < rank <= 9, n > 0 */ if( isAObject(a32BigHeader) ) { int dimsOK=1; /* Check dimensions */ checkDims(a32BigHeader); /* Check file length */ if (dimsOK && noSizeChk || (sizeOK=checkFileSize32(a32BigHeader)<=iLen)) { *width = 32; *endian = ENDIAN_BIG; return 0; } } /* Try 32-bit little endian */ /* Valid values: 0 <= type <= 8, 0 < rank <= 9, n > 0 */ if ( isAObject(a32LittleHeader) ) { int dimsOK=1; /* Check dimensions */ checkDims(a32LittleHeader); /* Check file length */ if (dimsOK && noSizeChk || (sizeOK=checkFileSize32(a32LittleHeader)<=iLen)) { *width = 32; *endian = ENDIAN_LITTLE; return 0; } } /* Try 64-bit big endian */ /* Valid values: 0 <= type <= 8, 0 < rank <= 9, n > 0 */ if ( isAObject(a64BigHeader) ) { int dimsOK=1; /* Check dimensions */ checkDims(a64BigHeader); /* printf("In 64 bit big endian\n"); printf("Count: %lx\n", a64BigHeader.c); printf("Type: %lx\n", a64BigHeader.t); printf("Rank: %lx\n", a64BigHeader.r); printf("Num: %lx\n", a64BigHeader.n); printf("Items: %lx\n", a64BigHeader.i); printf("Size: %ld\n", sizeof(A64) - sizeof(INT64) + Tt64(a64BigHeader.t, a64BigHeader.i) + (a64BigHeader.t == 2)); */ /* Check file length */ if (dimsOK && noSizeChk || (sizeOK=checkFileSize64(a64BigHeader)<=iLen)) { *width = 64; *endian = ENDIAN_BIG; return 0; } } /* Try 64-bit little endian */ /* Valid values: 0 <= type <= 8, 0 < rank <= 9, n > 0 */ if ( isAObject(a64LittleHeader) ) { int dimsOK=1; /* Check dimensions */ checkDims(a64LittleHeader); /* Check file length */ if (dimsOK && noSizeChk || (sizeOK=checkFileSize64(a64LittleHeader)<=iLen)) { *width = 64; *endian = ENDIAN_LITTLE; return 0; } } #endif if(!sizeOK) printf("\343 Error:File too small for items. use _items{} to query/fix.\n"); else printf("\343 Error:File does not match any known type.\n"); return -1; } static int Convert32to64(A32 *from, A64 *to) { long items = from->n; int i; if(((void *)from) == ((void *)to) ) { /* This conversion done in mapDotMFile() */ return -1; } to->c = from->c; to->t = from->t; to->r = from->r; to->n = from->n; to->i = from->i; for (i = 0; i < 9; i++) to->d[i] = from->d[i]; switch(from->t) { case 0: /* Int */ for (i = 0; i < items; i++) { to->p[i] = from->p[i]; } break; case 1: /* Float */ { double *a = (double *)from->p; double *b = (double *)to->p; for (i = 0; i < items; i++) b[i] = a[i]; break; } case 2: /* Char */ { char *a = (char *)from->p; char *b = (char *)to->p; for (i = 0; i <= items; i++) /* Include null '<=' vs '<' */ b[i] = a[i]; break; } default: /* Can't handle it */ printf("\343 Error:Type %d not translatable.\n", from->t); return -1; } return 0; } static int ConvertEndian32(A32 *from, A32 *to) { int i; long items; if(to!=from) memcpy(to, from, sizeof(A32) - sizeof(INT32)); SwapEndianHeader32(to); items=to->n; switch(to->t) { case 0: /* Int */ for (i = 0; i < items; i++) to->p[i] = SwapEndianInt32(from->p[i]); break; case 1: /* Float */ { double *out = (double *)to->p; double *in = (double *)from->p; for (i = 0; i < items; i++) out[i] = SwapEndianDouble(in[i]); break; } case 2: /* Char */ { if(to!=from) { memcpy((char *)to->p, (char *)from->p, items+1); /* include null */ } break; } default: /* Bad type */ printf("\343 Error:Type %d not translatable.\n", from->t); return -1; } return 0; } static int ConvertEndian64(A64 *from, A64 *to) { int i; long items; if(to!=from) memcpy(to, from, sizeof(A64) - sizeof(INT64)); SwapEndianHeader64(to); items=to->n; switch(to->t) { case 0: /* Int */ for (i = 0; i < items; i++) to->p[i] = SwapEndianInt64(from->p[i]); break; case 1: /* Float */ { double *out = (double *)to->p; double *in = (double *)from->p; for (i = 0; i < items; i++) out[i] = SwapEndianDouble(in[i]); break; } case 2: /* Char */ { if(to!=from) { memcpy((char *)to->p, (char *)from->p, items+1); /* include null */ } break; } default: /* Bad type */ printf("\343 Error:Type %ld not translatable.\n", from->t); return -1; } return 0; } int cvtIfNeeded(void *src, A *dest, I ilen, I cvtInPlace) { /* Converts the src object to the host format if needed */ /* arguments: */ /* src - pointer to the source data */ /* dest - address of the pointer to the destination */ /* ilen - if src is a mapped file then the file length */ /* Returns: */ /* 0 - no conversion required (dest==NULL) */ /* 1 - Conversion successful (dest==*convertedAobj) */ /* -1 - Conversion failed (dest==NULL */ static int hostWidth = -1; static int hostEndian= -1; static int noSizeChk=0; /* Flag to skip file size check */ int srcWidth; int srcEndian; int rc; /* Determine host characteristics */ if(hostWidth==-1) GetHostInformation(&hostWidth, &hostEndian); if(hostEndian == ENDIAN_UNDEF) { printf("\343 Error:Unable to determine host endian\n"); dest=NULL; return rc=-1; } /* Check and convert source */ rc=GetSrcInformation(src, ilen, DO_FILE_SIZE_CHECK, &srcWidth, &srcEndian, hostWidth, hostEndian); if(rc!=0) return -1; /* START CONVERSIONS */ /* Case 1: No Conversions */ if( srcEndian == hostEndian && srcWidth == hostWidth) { *dest=src; /* *dest=src; */ return 0; } /* Case 2: Big/32 -> Big/64 or Little32 -> little64 */ if ( srcEndian == hostEndian && srcWidth == 32 && hostWidth == 64 ) { A32 *from = (A32 *)src; long items = from->n; long size = (from->t==2) + sizeof(A64) - sizeof(INT64) + Tt64(from->t, items); A64 *to = (A64 *)mab(size); rc = Convert32to64(from, to); if (rc) { printf("\343 Error:Convert32to64 failed\n"); *dest=NULL; mf((I*)to); return -1; } else { /* to->i= (to->r) ? to->d[0] : to->n; fix items */ to->c=1; /* set reference count */ *dest=(A)to; return 1; } } /* Case 3: Big/32 <--> Little/32 */ if ( srcEndian != hostEndian && srcWidth == 32 && hostWidth == 32) { A32 *to, *from = (A32 *)src; A32 wrk32; long items,size32; if( cvtInPlace ) { static char t[]={"in place"}; if(dbg_tb) beamtrc(t,3,0); /* 3==Converting */ to = (A32 *)src; to->c=1; /* set invalid reference count */ } else { A32 wrk32; memcpy(&wrk32, src, sizeof(A32) - sizeof(INT32) ); /* copy header */ SwapEndianHeader32(&wrk32); /* correct endian */ items=wrk32.n; /* number of elements */ size32=(wrk32.t==2)+sizeof(A32)-sizeof(INT32)+Tt32(wrk32.t, items); to = (A32 *)mab(size32); } rc = ConvertEndian32(from, to); if (rc) { printf("\343 Error:ConvertEndian32 failed\n"); if( cvtInPlace ) printf("\343 File is most likely corrupted-in place conversion\n"); else mf((I*)to); *dest=(A)NULL; return -1; } else { if( cvtInPlace ) to->c=0; /* restore valid reference count */ else to->c=1; /* set reference count */ /* to->i= (to->r) ? to->d[0] : to->n; fix items */ *dest=(A)to; return cvtInPlace?0:1; } } /* Case 4: Big/64 <--> Little/64 */ if ( srcEndian != hostEndian && srcWidth == 64 && hostWidth == 64) { A64 *to, *from = (A64 *)src; long items,size64; if( cvtInPlace ) { static char t[]={"in place"}; if(dbg_tb) beamtrc(t,3,0); /* 3==Converting */ to = (A64 *)src; to->c=1; /* set invalid reference count */ } else { A64 wrk64; memcpy(&wrk64, src, sizeof(A64) - sizeof(INT64) ); /* copy header */ SwapEndianHeader64(&wrk64); /* correct endian */ items=wrk64.n; /* number of elements */ size64=(wrk64.t==2)+sizeof(A64)-sizeof(INT64)+Tt64(wrk64.t, items); to = (A64 *)mab(size64); } rc = ConvertEndian64(from, to); if (rc) { printf("\343 Error:ConvertEndian64 failed\n"); if( cvtInPlace ) printf("\343 File is most likely corrupted in place conversion\n"); else mf((I*)to); *dest=(A)NULL; return -1; } else { /* if( !cvtInPlace ) */ /* to->i= (to->r) ? to->d[0] : to->n; fix items */ if( cvtInPlace ) to->c=0; /* restore valid reference count */ else to->c=1; /* set reference count */ *dest=(A)to; return cvtInPlace?0:1; } } /* Case 5: Big/32 -> Little/64 or Little/32 -> Big64 */ if ( srcEndian != hostEndian && srcWidth == 32 && hostWidth == 64) { A32 *from = (A32 *)src; A32 wrk; A32 *toa; A64 *tob; long items; long size32,size64; memcpy(&wrk, src, sizeof(A32) - sizeof(INT32) ); /* copy header */ SwapEndianHeader32(&wrk); /* correct endian */ items=wrk.n; /* Get the number of elements */ size32=(wrk.t==2) + sizeof(A32) - sizeof(INT32) + Tt32(wrk.t, items); size64=(wrk.t==2) + sizeof(A64) - sizeof(INT64) + Tt64(wrk.t, items); toa = (A32 *)mab(size32); tob = (A64 *)mab(size64); rc = ConvertEndian32(from, toa); if (rc) { printf("\343 Error:ConvertEndian32 failed\n"); *dest=NULL; mf((I*)toa); mf((I*)tob); return -1; } else { rc = Convert32to64(toa, tob); if (rc) { printf("\343 Error:Convert32to64 failed\n"); *dest=(A)NULL; mf((I*)toa); mf((I*)tob); return -1; } else { mf((I*)toa); /* tob->i= (tob->r) ? tob->d[0] : tob->n; fix items */ tob->c=1; /* set reference count */ *dest=(A)tob; return 1; } } } /* TODO: downward conversions 64 -> 32*/ return -1; } int getItems(void *src, I *itemCount, I *rank, I *items, I ilen) { /* Converts the src object to the host format if needed */ /* arguments: */ /* src - pointer to the source data */ /* itemCount - src->i */ /* rank - src->r */ /* items - src->d[0] */ /* ilen - if src is a mapped file then the file length */ /* Returns: */ /* 0 - no conversion required (dest==NULL) */ /* 1 - Conversion successful (dest==*convertedAobj) */ /* -1 - Conversion failed (dest==NULL */ static int hostWidth = -1; static int hostEndian= -1; int srcWidth; int srcEndian; int rc; /* Determine host characteristics */ if(hostWidth==-1) GetHostInformation(&hostWidth, &hostEndian); if(hostEndian == ENDIAN_UNDEF) { printf("\343 Error:Unable to determine host endian\n"); return rc=-1; } /* Check and convert source */ rc=GetSrcInformation(src, ilen, SKIP_FILE_SIZE_CHECK, &srcWidth, &srcEndian, hostWidth, hostEndian); if(rc!=0) return -1; /* START CONVERSIONS */ /* Case 1: No Conversions */ if( srcEndian == hostEndian && srcWidth == hostWidth) { *itemCount = ((A)src)->i; *items = ((A)src)->d[0]; *rank = ((A)src)->r; return 0; } /* Case 2: 32 -> 64 same endian*/ if ( srcEndian == hostEndian && srcWidth == 32 && hostWidth == 64 ) { *itemCount = ((A32 *)src)->i; *items = ((A32 *)src)->d[0]; *rank = ((A32 *)src)->r; return 1; } /* Case 3: Big/32 <--> Little/32 */ if ( srcEndian != hostEndian && srcWidth == 32 && hostWidth == 32) { A32 *to, *from = (A32 *)src; A32 wrk32; memcpy(&wrk32, src, sizeof(A32) - sizeof(INT32) ); /* copy header */ SwapEndianHeader32(&wrk32); /* correct endian */ *itemCount = wrk32.i; *items = wrk32.d[0]; *rank = wrk32.r; return 1; } /* Case 4: Big/64 <--> Little/64 */ if ( srcEndian != hostEndian && srcWidth == 64 && hostWidth == 64) { A64 *to, *from = (A64 *)src; A64 wrk64; memcpy(&wrk64, src, sizeof(A64) - sizeof(INT64) ); /* copy header */ SwapEndianHeader64(&wrk64); /* correct endian */ *itemCount = wrk64.i; *items = wrk64.d[0]; *rank = wrk64.r; return 1; } /* Case 5: Big/32 -> Little/64 */ if ( srcEndian != hostEndian && srcWidth == 32 && hostWidth == 64) { A32 *from = (A32 *)src; A32 wrk; A32 *toa; A64 *tob; memcpy(&wrk, src, sizeof(A32) - sizeof(INT32) ); /* copy header */ SwapEndianHeader32(&wrk); /* correct endian */ *itemCount = wrk.n; *items = wrk.d[0]; *rank = wrk.r; return 1; } /* TODO: downward conversions 64->32 */ return -1; } aplus-fsf-4.22/src/a/bstub.c0000644000265000001440000001466410774212444011330 /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved. */ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* * This file replaces b.c to remove all references to the "buddy system" * in m.c. ma(), mab(), and mf() are replaced here with covers to * malloc() and free(). mi(), which initializes the buddy system, is * replaced with a no-op. * * */ #include /* Needed for locking in *_cover() */ #include #include #include #include #include #include #include #if (defined(__sgi) && _MIPS_SZLONG == 64) || defined(__sparcv9) || defined(__ia64) || defined(__x86_64) #define MD 63 #else #define MD 31 #endif static long totalSize[MD]; static long totalObjs[MD]; static long totalSizeMax[MD]; static long totalObjsMax[MD]; static long memTrack=0; static long memTrackThreshold=0; static pthread_mutex_t memStats_lock = PTHREAD_MUTEX_INITIALIZER; #if defined(linux) static int initMutex=1; static int _initMutex(void) { int rc; pthread_mutexattr_t mattr; if(0!=(rc=pthread_mutexattr_settype(&mattr, PTHREAD_MUTEX_ADAPTIVE_NP))) { perror("initMutex():pthread_mutexattr_settype"); } if (rc==0 && pthread_mutex_init(&memStats_lock, &mattr)) { perror("initMutex():thread_mutex_init"); } return 0; } #endif char * _mab(unsigned long w) { char *p; unsigned long *pl; if(0==w) { printf("\343 ma(): Warning: attempt to allocate 0 bytes\n");w=1; } if ((pl = (unsigned long *)malloc(w+2*sizeof(*pl))) == (unsigned long *)(0)) { unsigned long aBytes=w+2*sizeof(*pl); printf("\343 ma(): malloc(%lu) failure: errno=%d\n",aBytes,errno); err(2, (A)aBytes); p=(char *)pl; } else { pl[0]=w; pl[1]=w; p=(char *)&(pl[2]); } return p; } char * _mab_cover(unsigned long w) { unsigned long z,i; char *p=_mab(w); if(p) { int rc; unsigned long ww=w+2*sizeof(long *); #if defined(linux) if(initMutex) initMutex=_initMutex(); #endif /* Test for 8bit alignment */ if(!QA(p) ) printf("!! pointer not 8bit aligned 0x%x\n",p); if(memTrack && ww>=memTrackThreshold) printf("0x%x malloc %lu bytes\n",p,ww); for (z = ww >> 1, i = 1; z != 0; z >>= 1, i++); if( i >= MD ) i=MD-1; if(0!=(rc=pthread_mutex_lock(&memStats_lock))) { perror("si() pthread_mutex_lock"); } totalObjs[i]++; totalSize[i] += ww; if(totalObjs[i]>totalObjsMax[i]) totalObjsMax[i]=totalObjs[i]; if(totalSize[i]>totalSizeMax[i]) totalSizeMax[i]=totalSize[i]; if(rc==0 && pthread_mutex_unlock(&memStats_lock)) { perror("si() pthread_mutex_unlock"); } } return p; } static char *(*pf_mab)(unsigned long)=_mab; char * mab(unsigned long w) { return pf_mab(w); } long *ma(unsigned long w) /* w - number of words required */ { return (long *)(mab(w*sizeof(long))); } static void _mf(long *p) { if(p && (*(p-1))==(*(p-2))) { free (p-2); } else { printf("!! Not an mab pointer !!\n"); free(p); } } static void _mf_cover(long *p) { unsigned long z,i,w; if(p && (w=*(p-1))==(*(p-2))) { int rc; unsigned long ww=(*(p-2))+2*sizeof(long *); #if defined(linux) if(initMutex) initMutex=_initMutex(); #endif if(memTrack && ww>=memTrackThreshold) printf("0x%x freeing %lu bytes\n",p,ww); for (z = ww >> 1, i = 1; z != 0; z >>= 1, i++); if( i >= MD ) i=MD-1; if(0!=(rc=pthread_mutex_lock(&memStats_lock))) { perror("si() pthread_mutex_lock"); } if(totalObjs[i]) totalObjs[i]--; if(totalSize[i]) totalSize[i] -= ww; if(rc==0 && pthread_mutex_unlock(&memStats_lock)) { perror("si() pthread_mutex_unlock"); } } _mf(p); } void (*pf_mf)(long *)=_mf; void mf(long *p) { pf_mf(p); } void setAplusMemStatsMode(int mode_) { if(mode_==1) /* enable stats */ { pf_mab=_mab_cover; pf_mf=_mf_cover; } else /* disable stats */ { pf_mab=_mab; pf_mf=_mf; } } static A ep_memStats(A aObj) { if(aObj->n != 1) return q=ERR_LENGTH,(A)0; if(QA(aObj) && aObj->t==It ) { memTrackThreshold=aObj->p[0]; return aplus_nl; } if( !QA(aObj) && aObj->t!=Et && !QS(aObj->p[0]) ) return q=ERR_LENGTH,(A)0; if(aObj->p[0]==MS(si("on"))) { setAplusMemStatsMode(1); } else if(aObj->p[0]==MS(si("verbose"))) { memTrack=1; } else if(aObj->p[0]==MS(si("quiet"))) { memTrack=0; } else if(aObj->p[0]==MS(si("off"))) { setAplusMemStatsMode(0); } else if(aObj->p[0]==MS(si("info"))) { I d[9]={MD}; return (A)gvi(Et,4, gc(It,1,MD,d,totalSize), gc(It,1,MD,d,totalObjs), gc(It,1,MD,d,totalSizeMax), gc(It,1,MD,d,totalObjsMax)); } else if(aObj->p[0]==MS(si("reset"))) { memset(totalSize, 0, sizeof(totalSize)*sizeof(unsigned long)); memset(totalObjs, 0, sizeof(totalSize)*sizeof(unsigned long)); } return aplus_nl; } void memStatsInstall(void) { install((PFI)ep_memStats,"_memStats",A_,1,A_,0,0,0,0,0,0,0); return; } void mi(void) {} #if 0 /* Old Version of bstub.c */ #include #include #include #include char * mab(unsigned long w) { char *p; unsigned long *pl; if(0==w) { printf("\343 ma(): Warning: attempt to allocate 0 bytes\n");w=1; } if ((pl = (unsigned long *)malloc(w+2*sizeof(*pl))) == (unsigned long *)(0)) { unsigned long aBytes=w+2*sizeof(*pl); printf("\343 ma(): malloc(%lu) failure: errno=%d/n",aBytes,errno); err(2, aBytes); p=(char *)pl; } else { pl[0]=w; pl[1]=w; p=(char *)&(pl[2]); } return p; } long *ma(unsigned long w) /* w - number of words required */ { return (long *)(mab(w*sizeof(long))); } void mf(long *p) { if(p && (*(p-1))==(*(p-2))) free (p-2); else { printf("!! Not an mab pointer !!\n"); free(p); } } void mi(void) {} #endif aplus-fsf-4.22/src/a/callouts.c0000644000265000001440000000451110772770356012036 /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #include #include #include #include #include extern I nExternalFPE, suppressFpeDomain; extern I dbg_xfpe; Z void (*dstFP)(V) = NULL; void setfunc_dst(void (*fp)(V)) { dstFP=fp; } void dst(V v_) { if (NULL==dstFP) { H("WARNING: uninitialized dst called\n"); R; } suppressFpeDomain=1;nExternalFPE=0; if(v_!=0&&v_->attr!=0)(*dstFP)(v_); if(dbg_xfpe)(void)xfpechk("dst callout",nExternalFPE); suppressFpeDomain=0; } Z void (*xfFP)(void) = NULL; void setfunc_xf(void (*fp)(void)) { xfFP=fp; } I xf(void) { if (NULL==xfFP) { H("WARNING: uninitialized xf called\n"); R 0; } suppressFpeDomain=1;nExternalFPE=0; (*xfFP)(); if(dbg_xfpe)xfpechk("xf callout",nExternalFPE); suppressFpeDomain=0; R -1; } Z void (*xupFP)(V,A,A,A,I,I) = NULL; void setfunc_xup(void (*fp)(V,A,A,A,I,I)) { xupFP=fp; } void xup(V v,A d,A i,A p,I r,I uf) { if (NULL==xupFP) { H("WARNING: uninitialized xup called\n"); R; } suppressFpeDomain=1;nExternalFPE=0; (*xupFP)(v,d,i,p,r,uf); if(dbg_xfpe)xfpechk("xup callout",nExternalFPE); suppressFpeDomain=0; } Z I (*vfyFP)(V,A) = NULL; void setfunc_vfy(I (*fp)(V,A)) { vfyFP=fp; } I vfy(V v,A a) { I z; if (NULL==vfyFP) { H("WARNING: uninitialized vfy called\n"); R -1; } suppressFpeDomain=1;nExternalFPE=0; z=(*vfyFP)(v,a); if(dbg_xfpe)xfpechk("vfy callout",nExternalFPE); suppressFpeDomain=0; R z; } Z void (*disableFP)(void) = NULL; void setfunc_disable(void (*fp)()) { disableFP=fp; } void disable(void) { if (NULL==disableFP) { H("WARNING: uninitialized disable called\n"); R; } (*disableFP)(); } Z void (*enableFP)(void) = NULL; void setfunc_enable(void (*fp)()) { enableFP=fp; } void enable(void) { if (NULL==enableFP) { H("WARNING: uninitialized enable called\n"); R; } (*enableFP)(); } aplus-fsf-4.22/src/a/dbg.c0000644000265000001440000005215210772770356010750 /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved. */ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* This file contains debugging aids internal to A+. */ #include #include #include #include #include #include #include #include #define FFL if(dbg_pr)fflush(stdout) #define DH if(dbg_pr)printf I dbg_tl=0; /* load trace flag */ I dbg_tb=0; /* beam trace flag */ I dbg_tf=0; /* function call trace flag */ I dbg_tx=0; /* external function trace flag */ I dbg_ts=0; /* system function trace flag */ I dbg_tbwc=0; /* bitwise non-boolean checking flag */ I dbg_tdef=0; /* func/dep definition tracing flag */ I dbg_tdep=0; /* dependency evaluation tracing flag */ I dbg_tinv=0; /* dependency invalidation tracing flag */ I dbg_tnan=0; /* NaN checking flag */ I dbg_tpcb=0; /* preset-callback trace flag */ I dbg_tscb=0; /* set-callback tracing flag */ I dbg_tpack=0; /* packfile trace flag */ I dbg_tprcb=0; /* prereference-callback trace flag */ I dbg_trcb=0; /* reference-callback trace flag */ I dbg_txeq=0; /* execute trace flag */ I dbg_tmdo=0; /* monadic-do trace flag */ I dbg_tdyld=0; /* dynamic load tracking flag */ I dbg_depth=0; /* function call and loading "depth" */ I dbg_tmstk=0; /* toolkit trace flag */ I dbg_tkerr=0; /* toolkit error trace flag */ I dbg_xfpe=0; /* trace external floating-point errors */ I dbg_tfmt=0; /* display fmt error messages */ I dbg_twa=0; /* wa trace flag */ I dbg_tdoErrorStack=0; /* doErrorStack trace flag */ Z I dbg_hold=0; /* internal flag to turn off tracing during _dbg calls */ Z I dbg_pr=1; /* display messages? */ Z I dbg_levels=0; /* maximum tracing depth */ Z I dbg_ti=2; /* trace indentation */ Z C dbg_ch=' '; /* delimiting char in trace display */ Z A dbg_cbfunc=0; /* dbg-callback function */ Z A dbg_cbdata=0; /* dbg-callback fixed data */ #define CXL_SIZE 128 Z I cxl[CXL_SIZE]={0}; Z C trcb[128]; Z C *blurb[]={"enter","exit","abort"}; static void dbg_stat(void); Z I nix(S s){S*l=(S*)cxl;I x;if(!*cxl)R 0;x=0>*cxl; while(*++l)if(s==*l)R x;R!x;} Z void callafunc(A func,A cbdata,A arg0,I n,A arg1,A arg2,A arg3) { E e; e = (E)(ma(7)); e->n=5; e->f=(I)func; e->a[0]=(I)cbdata; e->a[1]=(I)arg0; e->a[2]=(I)((1<=n)?arg1:aplus_nl); e->a[3]=(I)((2<=n)?arg2:aplus_nl); e->a[4]=(I)((3<=n)?arg3:aplus_nl); dc((A)ez(ME(e))); mf((I *)e); } Z void dbg_callcb(C *s,I n,A arg1,A arg2,A arg3) { if(dbg_hold)R; dbg_hold=1; { A event=ge(MS(si(s))); callafunc(dbg_cbfunc,dbg_cbdata,event,n,arg1,arg2,arg3); dc(event); } /* if(1<=n)dc(arg1);if(2<=n)dc(arg2);if(3<=n)dc(arg3); */ if(n==1) dc(arg1); else if(n==2) dc(arg1),dc(arg2); else if(n==3) dc(arg1),dc(arg2),dc(arg3); dbg_hold=0; } Z C *dbg_pfx(void){I idx=dbg_depth-1,i; idx=MIN(99,4+MAX(0,idx)*dbg_ti);memset(trcb,' ',idx);trcb[idx]='\0'; if(dbg_ch!=' ')for(i=0;ip; I nans=0,infs=0,cl; if(Ft!=af->t)R 0; DO(af->n,cl=fpclass(fp[i]);if(cl==FP_NINF||cl==FP_PINF)++infs;if(cl==FP_SNAN |cl==FP_QNAN)++nans;); if(infs){DH("\343%sWarning: found %ld Inf%s in %s.\n", dbg_pfx(),infs,(1==infs)?"":"s",f);FFL;} if(nans){DH("\343%sWarning: found %ld Nan%s in %s.\n", dbg_pfx(),nans,(1==nans)?"":"s",f);FFL;} if(dbg_cbfunc&&(nans||infs)) { dbg_callcb("nan",2, gsv(0,f), gvi(It,2,infs,nans), (A)0); } } #else #define FPCLASS(x) (NANMASK==((x)&NANMASK)? \ ((x)&0x000fffff?((x)&0x00080000?3:4):2): \ (x)&0x00080000?1:0) #if defined(__sgi) fpclass_t fpclass(F x) #else I fpclass(F x) #endif { BD fp; fp.d=x; R FPCLASS(fp.i[0]); } I nanbeamchk(C *f,A af) { F *fp=(F *)af->p; I nans=0,infs=0,cl; if(dbg_hold||Ft!=af->t)R 0; DO(af->n,cl=fpclass(fp[i]);if(2==cl)++infs;if(3<=cl)++nans;); if(infs){DH("\343%sWarning: found %ld Inf%s in %s.\n", dbg_pfx(),infs,(1==infs)?"":"s",f);FFL;} if(nans){DH("\343%sWarning: found %ld Nan%s in %s.\n", dbg_pfx(),nans,(1==nans)?"":"s",f);FFL;} if(dbg_cbfunc&&(nans||infs)) { dbg_callcb("nan",2, (A)gsv(0,f), gvi(It,2,infs,nans), (A)0); } R -1; } #endif I bitwisechk(A a,A w,I i) { I anonbool=0, wnonbool=0, tot=0; if(dbg_hold)R 0; DO(a->n,if((unsigned long)(a->p[i])&(unsigned long)(~0x01))++anonbool;); if(w)DO(w->n,if((unsigned long)(w->p[i])&(unsigned long)(~0x01))++wnonbool;); if(anonbool||wnonbool) { C **primnames=get_primlist(APL,0); /* APL either 0 or 1 */ tot=anonbool+wnonbool; if(anonbool&&wnonbool) { DH("\343%sWarning: found %ld non-boolean%s in both arguments of %s.\n", dbg_pfx(),tot,(1p[f->n+2]; if(dbg_hold||nix(cx->s)||(dbg_levels&&dbg_levelss->n,(XS(*f->d))->n,blurb[x]); FFL; if(dbg_cbfunc) { dbg_callcb("func",2, ge(MS(symjoin(cx->s,XS(*f->d)))), ge(MS(si(blurb[x]))), (A)0); R -1; } R -1; } I xftrc(C *f,I x){ S cxsym; if(dbg_hold||(!(('_'==*f)?dbg_ts:dbg_tx))|| (dbg_levels&&dbg_levels":str,x?"] . . .":"]"); FFL; if(dbg_cbfunc) { dbg_callcb("xeq",2, (A)gsv(0,str), ge(MS(si(blurb[(x&1)?0:1]))), (A)0); } R -1; } I mdotrc(I x){ if(dbg_hold)R 0; DH("\343%s%s\n", dbg_pfx(),x?"Entering monadic do . . .":"Exiting monadic do"); FFL; if(dbg_cbfunc) { dbg_callcb("mdo",1, ge(MS(si(blurb[x?0:1]))), (A)0,(A)0); } R -1; } static C *beamsym[]={"out","in","unmap"}; I beamtrc(C *f,I x,I i){ /* Note that i is used only if 1==x. */ if(dbg_hold)R 0; f=f?f:""; if (1==x){ DH("\343%sBeaming in (%ld) %s\n",dbg_pfx(),i,f);} else{DH("\343%s%s %s\n",dbg_pfx(), (x==3)?"Converting":((x==2)?"Unmapping":"Beaming out"), f);} FFL; if(dbg_cbfunc) { dbg_callcb("beam",(1==x)?3:2, (A)gsv(0,f), ge(MS(si(beamsym[x]))), (1==x)?gi(i):0); } R -1; } Z C *dbgCbSymList[] = {"scb","pcb","rcb","prcb"}; Z C *dbgCbNameList[] = {"Set","Preset","Reference","Prereference"}; I packtrc(C *fname,C *cmdstr,I x) { if(dbg_hold)R 0; if(!x)--dbg_depth; DH("\343%s%s p.%s on file %s\n",dbg_pfx(), x?"Entering":"Exiting",cmdstr,fname); FFL; if(dbg_cbfunc) { dbg_callcb("pack",2, (A)gsv(0,fname), ge(MS(si(blurb[x?0:1]))), (A)0); } if(x)++dbg_depth; R 0; } I cbtrc(V v,I x){ if(dbg_hold||nix(v->cx->s))R 0; DH("\343%s%s-callback firing on %s.%s\n",dbg_pfx(),dbgCbNameList[x], v->cx->s->n,v->s->n); FFL; if(dbg_cbfunc) { dbg_callcb(dbgCbSymList[x],1, ge(MS(symjoin(v->cx->s,v->s))), (A)0,(A)0); } R -1; } I deptrc(V v,I x){ if(dbg_hold||nix(v->cx->s))R 0; ++dbg_depth; DH("\343%sDependency %s.%s evaluation %sed\n",dbg_pfx(),v->cx->s->n,v->s->n, blurb[x]); FFL; if(dbg_cbfunc) { dbg_callcb("dep",2, ge(MS(symjoin(v->cx->s,v->s))), ge(MS(si(blurb[x?0:1]))),(A)0); } --dbg_depth; R -1; } I invtrc(V v,I x){ A arg2; if(dbg_hold||nix(v->cx->s))R 0; if(x) { DH("\343 ***%sDependency cycle detected: %s.%s\n", dbg_pfx(),v->cx->s->n,v->s->n); FFL; arg2=ge(MS(si("cycle"))); } else { DH("\343%sDependency %s.%s invalidated\n",dbg_pfx(),v->cx->s->n,v->s->n); FFL; arg2=aplus_nl; } if(dbg_cbfunc) { dbg_callcb("inv",2, ge(MS(symjoin(v->cx->s,v->s))), arg2, (A)0); } R -1; } void dyldtrc(C *f){ DH("\343%sDynamic load from %s\n",dbg_pfx(),f);FFL; if(dbg_cbfunc) { dbg_callcb("dyld",1, (A)gsv(0,f), (A)0,(A)0); } } void doErrorStacktrc(I q_, A aStack_){ C *lastLine=(C *)((A)aStack_->p[aStack_->n-1])->p; DH("\343%sdoErrorStack:(%ld) %.40s ...\n",dbg_pfx(),q_,lastLine);FFL; if(dbg_cbfunc) { dbg_callcb("doErrorStack",1, (A)gvi(Et,2,gi(q_), ic(aStack_)), (A)0,(A)0); } } void watrc(I w){ DH("\343%sdoErrorStack %ld\n",dbg_pfx(),w);FFL; if(dbg_cbfunc) { dbg_callcb("wa",1, (A)gi(w), (A)0,(A)0); } } I deftrc(V v,I x){ if(dbg_hold||nix(v->cx->s))R 0; DH("\343%s%s %s.%s defined\n",dbg_pfx(),x?"Dependency":"Function", v->cx->s->n,v->s->n);FFL; if(dbg_cbfunc) { dbg_callcb("def",2, ge(MS(symjoin(v->cx->s,v->s))), ge(MS(si(x?"dep":"func"))), (A)0); } R -1; } Z void dbg_error(C *s,I idx) { H("\343 dbg error: \"%s\" %s\n",s,s[idx]?"not recognized":"is ambiguous"); FFL; } Z C *dbg_helpmsg0[]={ "General Syntax", " $dbg - displays dbg flags turned on", " $dbg +flag - turns a flag on", " $dbg -flag - turns a flag off", " Several $dbg commands can be strung together: $dbg +load +beam", " $dbg +cxt or -cxt must be the last command in a list.", "FLAGS", 0}; Z C *dbg_helpflagsA[]={ "Function Tracing", " +func - function", " +xfs - external function", " +sfs - system function", "Callback/Dependency Tracing", " +dep - dep evaluation", " +inv - dep invalidation", " +scb - set-callback", " +pcb - preset-callback", " +_prcb - prereference-cb", " +_rcb - reference-cb", "Execution Tracing", " +do - monadic-do", " +xeq - execution", "Definition Tracking", " +def - func/dep definition", 0}; Z C *dbg_helpflagsB[]={ "File Tracking", " +load - load", " +dyld - dynamic load", " +beam - beam", " +pack - packfile", "Error Checking", " +nan - NaN checking", " +bitwise - non-boolean ands/ors", " +xfpe - external FPEs", "Message Control", " +fmt - _fmt messages", " +mstk - MStk debug messages", " +tkerr - MStk error messages", "Special", " +print - print dbg messages", " +all - all dbg flags on", " -all - all dbg flags off", 0}; Z C *dbg_helpmsg1[]={ "Other Dbg Options", " display beam - displays list of beamed files.", " display flags - displays setting of system vars.", " help - prints this message.", " char - sets trace char to . (e.g. $dbg char |)", " indent <#> - sets trace indent to <#>.", " levels <#> - sets max. depth of function tracing to <#>. 0=off.", " -cxt [list of cxts] - trace all contexts except those listed.", " +cxt [list of cxts] - trace only listed contexts. (e.g. $dbg +cxt s)", 0}; Z void dbg_help(void) { C **sv,**svb; for(sv=dbg_helpmsg0;*sv;++sv) H("\343 %s\n",*sv); for(sv=dbg_helpflagsA,svb=dbg_helpflagsB; *sv||*svb; sv+=(*sv)?1:0,svb+=(*svb?1:0)) H("\343 %-32s%s\n",*sv?*sv:"",*svb?*svb:""); for(sv=dbg_helpmsg1;*sv;++sv) H("\343 %s\n",*sv); H("\343 Current Settings\n"); dbg_stat(); } Z A dbghelp_vlist() { C **s; I count; A result; for(count=0,s=dbg_helpmsg0;*s;s++) ++count; for(s=dbg_helpflagsA;*s;s++) ++count; for(s=dbg_helpflagsB;*s;s++) ++count; for(s=dbg_helpmsg1;*s;s++) ++count; result=gv(Et, count); for(count=0,s=dbg_helpmsg0;*s;++s) result->p[count++]=(I)gsv(0,*s); for(s=dbg_helpflagsA;*s;++s) result->p[count++]=(I)gsv(0,*s); for(s=dbg_helpflagsB;*s;++s) result->p[count++]=(I)gsv(0,*s); for(s=dbg_helpmsg1;*s;++s) result->p[count++]=(I)gsv(0,*s); R result; } #define FLAGSPERLINE 10 #define SHOWFLAG(flag,name) if(flag) \ { \ if(0==anyon++%FLAGSPERLINE) \ H("%s\343 dbg: flags set:",FLAGSPERLINEs==*sl)H(" .");else H(" %s",(*sl)->n);} else H(" none"); } NL; if(cbf){ CX cx=(CX)cbf->p[cbf->n+2]; H("\343 dbg: _dbg callback: %s.%s\n",cx->s->n,(XS(*cbf->d))->n); } } Z void dbg_all(C c) { I val=('1'==c)?1:0; dbg_tf=dbg_tx=dbg_ts=dbg_tl=dbg_tb=dbg_tdep=dbg_tinv=dbg_tscb= dbg_tpcb=dbg_tdyld=dbg_tdef=dbg_tprcb=dbg_trcb=val; } Z I dbg_setcxt(I cxl0,C *s){ I idx=0;C *w=bl(s),d=*w;*w=0;cxl[0]=cxl0; for(;*s;*w=d,w=bl(s=cl(w)),d=*w,*w=0) if(idxp[i]=MS(cxl[i+1])); R gvi(Et,2,ge(MS(si(0t)ERROUT(ERR_TYPE);if(2!=aarg->n)ERROUT(ERR_DOMAIN); a0=(A)aarg->p[0];a1=(A)aarg->p[1]; if(Et!=a0->t||1!=a0->n||!QS(*a0->p))ERROUT(ERR_DOMAIN); cmd=XS(*a0->p); if(cmd==si("all")){if(!qz(a1))ERROUT(ERR_DOMAIN);cxl[0]=0;R 0;} else if(cmd==si("only"))cxl[0]=1; else if(cmd==si("not"))cxl[0]=-1; else ERROUT(ERR_DOMAIN); if((a1->n&&!sym(a1))||1r){cxl[0]=cxl0;ERROUT(ERR_DOMAIN);} if((CXL_SIZE-2)n){ H("\343 Bonk! Hard limit hit: max [+/-]cxt #:%d\n",CXL_SIZE-2);FFL; cxl[0]=cxl0;R 0; } DO(a1->n,cxl[i+1]=(I)XS(a1->p[i])); R 0; } Z A dbg_cb(A aarg) { I f,c,z; if(qz(aarg))R gvi(Et,2,ic(dbg_cbfunc),ic(dbg_cbdata)); if(aarg->t!=Et||aarg->n!=2) ERROUT(ERR_DOMAIN); f=aarg->p[0];c=aarg->p[1]; z=qz((A)f); if(!(QF(f)&&!QS(f))&&!z) ERROUT(ERR_NONFUNCTION); dc(dbg_cbfunc);dc(dbg_cbdata); if(z){dbg_cbfunc=(A)0;dbg_cbdata=(A)0;} else{dbg_cbfunc=(A)ic((A)f);dbg_cbdata=(A)ic((A)c);} R 0; } #define SWDEF(s,idx) default:dbg_error(s,idx);break; #define CF(i,f) CS(i,f=(!*x)?(!f):*x=='1'?1:0) #define GETF(f) (1==arg)?1:(0==arg)?0:(1==pref)?1:(0==pref)?0:!f #define CNF(i,f) CS(i, \ f=GETF(f); \ if(1==arg||0==arg)usearg=1) Z void dbg_display(C *x) { if(!*x){dbg_stat();R;} switch(*x){CS('b',dbg_mfr());CS('f',dbg_flg());CS('m',(void)dbg_mfa());SWDEF(x,0);} } extern A dbg_mfrsf(); Z A dbg_getdisplay(A aarg) { if(!sym(aarg))ERROUT(ERR_DOMAIN); if(MS(si("beam"))==*aarg->p) R dbg_mfrsf(); else ERROUT(ERR_DOMAIN); } long dbgproc(C *s, C *x) { I pref, arg, usearg, temp=0; if(!*s)R 0; pref=('+'==*s)?1:('-'==*s)?0:-1; arg=(!x)?-1:(!*x)?-1:('1'==*x)?1:('0'==*x)?0:-2; if(-1!=pref)++s; /* advance s past prefix */ usearg=0; switch (*s){ CS('a',temp=GETF(temp);dbg_all(temp?'1':'0')); CS('b',switch(s[1]){ CNF('e',dbg_tb); CNF('i',dbg_tbwc); SWDEF(s,1); }); CS('c',switch(s[1]){ CS('h',dbg_ch=(!*x)?' ':*x;usearg=1); CS('x',dbg_setcxt((0==pref?-1:1),x);usearg=2); SWDEF(s,1); }); CS('d',switch(s[1]){ CS('e',switch(s[2]){ CNF('f',dbg_tdef); CNF('p',dbg_tdep); SWDEF(s,2); }); CS('i',dbg_display(x);usearg=1); CS('o',switch(s[2]){ CNF('\0',dbg_tmdo); CNF('E',dbg_tdoErrorStack); }); CNF('y',dbg_tdyld); SWDEF(s,1); }); CS('f',switch(s[1]){ CNF('u',dbg_tf); CNF('m',dbg_tfmt); SWDEF(s,1); }); CS('h',dbg_help()); CS('i',switch(s[1]){ CS('n',switch(s[2]){ CS('d',dbg_ti=(!*x)?2:('-'==*x)?0:atol(x);usearg=(*x)?1:0); CNF('v',dbg_tinv); SWDEF(s,2); }); SWDEF(s,1); }); CS('l',switch(s[1]){ CS('e',dbg_levels=(!*x)?0:('-'==*x)?0:atol(x);usearg=(*x)?1:0;); CNF('o',dbg_tl); SWDEF(s,1); }); CNF('m',dbg_tmstk); CNF('n',dbg_tnan); CS('p',switch(s[1]){ CNF('a',dbg_tpack); CNF('c',dbg_tpcb); CNF('r',dbg_pr); SWDEF(s,1); }); CS('s',switch(s[1]){ CNF('c',dbg_tscb); CNF('f',dbg_ts); SWDEF(s,1); }); CNF('t',dbg_tkerr); CF('w',dbg_twa); CS('x',switch(s[1]){ CNF('e',dbg_txeq); CS('f',switch(s[2]){ CNF('p',dbg_xfpe); CNF('s',dbg_tx); SWDEF(s,2); }); SWDEF(s,1); }); CS('_',switch(s[1]){ CNF('p',dbg_tprcb); CNF('r',dbg_trcb); SWDEF(s,1); }); case '0':CS('1',dbg_all(*s)); SWDEF(s,0); } R usearg; } #define ADVANCEARG(s,x) if (usearg) ADVANCETWO(s,x) else ADVANCEONE(s,x) #define ADVANCEONE(s,x) { s=x;x=cl(w=bl(s)),*w=0; } #define ADVANCETWO(s,x) { s=cl(u=bl(x)),*u=0,x=cl(w=bl(s)),*w=0; } void dbg(C *s, C *x) { I usearg=0; C *w, *u; if(!*s){dbg_stat();R;} if('1'==*s||'0'==*s){dbg_all(*s);ADVANCEARG(s,x);} while(*s) { usearg=dbgproc(s,x); if(2==usearg)break; ADVANCEARG(s,x); } } Z C *dbgList[] = {"func", "xfs", "sfs", "dep", "inv", "scb", "pcb", "def", "load", "dyld", "beam", "nan", "dbghelp", "char", "indent", "cxt", "print", "cb", "fmt", "_prcb", "_rcb", "xeq", "do", "levels", "bitwise", "pack", "mstk", "display", "xfpe", "tkerr", "wa", "doErrorStack", 0}; C **get_dbglist(void){R dbgList;} #define DCF(x,v,f) CSR(x,if(isn)R gi(f); \ else if(v){f=iarg;R 0;} \ else ERROUT(ERR_DOMAIN)); #define DCFC(x,f) CSR(x,if(isn){A z=gs(Ct);(*(C*)(z->p))=dbg_ch;R z;} \ else if(isc){dbg_ch=carg;R 0;} \ else ERROUT(ERR_DOMAIN)); Z A ep_dbg(A asym,A aarg) { C *cmd,carg=0; I isn,iarg=0,isi,isb,isc; NDC2(asym,aarg);cmd=getaname(asym);if(cmd==(C*)0)ERROUT(ERR_TYPE); isn=qz(aarg); isi=(It==aarg->t&&1==aarg->n);if(isi)iarg=*aarg->p; isb=(isi&&(0==iarg||1==iarg)); isc=(Ct==aarg->t&&1==aarg->n);if(isc)carg=(*(C*)(aarg->p)); switch(lu(cmd,dbgList)){ DCF(1,isb,dbg_tf); /* func */ DCF(2,isb,dbg_tx); /* xfs */ DCF(3,isb,dbg_ts); /* sfs */ DCF(4,isb,dbg_tdep); /* dep */ DCF(5,isb,dbg_tinv); /* inv */ DCF(6,isb,dbg_tscb); /* scb */ DCF(7,isb,dbg_tpcb); /* pcb */ DCF(8,isb,dbg_tdef); /* def */ DCF(9,isb,dbg_tl); /* load */ DCF(10,isb,dbg_tdyld); /* dyld */ DCF(11,isb,dbg_tb); /* beam */ DCF(12,isb,dbg_tnan); /* nan */ CSR(13,R dbghelp_vlist()); /* dbghelp */ DCFC(14,dbg_ch); /* char */ DCF(15,isi,dbg_ti); /* indent */ CSR(16,R dbg_acxt(aarg)); /* cxt */ DCF(17,isb,dbg_pr); /* print */ CSR(18,R dbg_cb(aarg)); /* cb */ DCF(19,isb,dbg_tfmt); /* fmt */ DCF(20,isb,dbg_tprcb); /* _prcb */ DCF(21,isb,dbg_trcb); /* _rcb */ DCF(22,isb,dbg_txeq); /* xeq */ DCF(23,isb,dbg_tmdo); /* do */ CSR(24,if(isn)R gvi(It,2,dbg_levels,dbg_depth);else if(isi) {dbg_levels=iarg;R 0;}else ERROUT(ERR_DOMAIN)); /* levels */ DCF(25,isb,dbg_tbwc); /* bitwise */ DCF(26,isb,dbg_tpack); /* pack */ DCF(27,isb,dbg_tmstk); /* toolkit */ CSR(28,R dbg_getdisplay(aarg)); /* display */ DCF(29,isb,dbg_xfpe); /* xfpe */ DCF(30,isb,dbg_tkerr); /* tkerr */ DCF(31,isb,dbg_twa); /* wa */ DCF(32,isb,dbg_tdoErrorStack); /* doErrorStack */ default:ERROUT(ERR_DOMAIN); } } void dbgInstall(void) { install((PFI)ep_dbg,"_dbg", A_, 2, A_, A_,0,0,0,0,0,0); } aplus-fsf-4.22/src/a/dot.c0000644000265000001440000000617010772770356011001 /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #include #include #include #include #include #include #include #include H2(dot) { A z; I i,ia,iw, buflen=128, incra,incrw, lena=0, lenw; C *buf=(C *)0, *stra, *strw; ND2 incra=(1==a->n)?0:1,incrw=(1==w->n)?0:1; if (Et != a->t || Et != w->t) ERROUT(ERR_TYPE); if (incra&&incrw) { if (w->r != a->r) ERROUT(ERR_RANK); if (w->n != a->n) ERROUT(ERR_LENGTH); } z=(A)gd(Et,incra?a:incrw?w:a->r>w->r?a:w); if (!incra) { if (!QS(*a->p)) ERROUT(ERR_TYPE); #if defined(HAVE_SVR4) stra=XS(*a->p)->n; lena=strlen((DEV_STRARG)stra); #else stra=XS(*a->p)->n; lena=strlen(stra); #endif if (buflenn;++i) { if (incra) { if (!QS(a->p[i])) { for(;in;++i)z->p[i]=0; dc(z); if(buf)bfree(buf); ERROUT(ERR_TYPE); } if ( i==0 || a->p[ia] != a->p[ia-1] ) { #if defined(HAVE_SVR4) stra=XS(a->p[ia])->n; lena=strlen((DEV_STRARG)stra); #else stra=XS(a->p[ia])->n; lena=strlen(stra); #endif if (buflenp[iw])) { for(;in;++i)z->p[i]=0; dc(z); bfree(buf); ERROUT(ERR_TYPE); } #if defined(HAVE_SVR4) strw=XS(w->p[iw])->n; lenw=strlen((DEV_STRARG)strw); if (NULL==strchr((DEV_STRARG)strw,'.')) { #else strw=XS(w->p[iw])->n; lenw=strlen(strw); if (NULL==strchr(strw,'.')) { #endif if (buflen< (2+lena+lenw)) buf=(char *)brealloc(buf,buflen=2+lena+lenw); bcopy(strw,buf+(1+lena),lenw); buf[1+lena+lenw]='\0'; z->p[i]=MS(si(buf)); } else z->p[i]=w->p[iw]; ia+=incra;iw+=incrw; } bfree(buf); R(I)z; } H1(undot) { A z; C *dot, *src, *tbuf; I *sp, i; ND1 if (8 < a->r) ERROUT(ERR_MAXRANK); if (Et != a->t) ERROUT(ERR_TYPE); z = ga(Et, 1+a->r, 2*a->n, a->d); z->d[a->r]=2; sp = z->p; for ( i=0; in; ++i) { if(!QS(a->p[i])){for(;in;++i){*sp++=0;*sp++=0;}dc(z);ERROUT(ERR_TYPE);} src=XS(a->p[i])->n; if (NULL==(dot=(C *)strrchr((DEV_STRARG)src,'.'))) { *sp++=MS(si("")); *sp++=a->p[i]; } else { tbuf=(C*)mab(2+dot-src); *dot='\0'; strcpy(tbuf,(DEV_STRARG)src); *dot='.'; *sp++=MS(si(tbuf)); mf((I *)tbuf); *sp++=MS(si(dot+1)); } } R(I)z; } aplus-fsf-4.22/src/a/f.c0000644000265000001440000002464410772770356010446 /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #include #include #include #include #if defined(__cplusplus) #include #else #include #endif extern I dbg_depth,dbg_txeq,dbg_tbwc; Z I t,u,v; I rsh(A a,I r,I *d){R g=(PFI)rsh,a->c==1?(mv(a->d,d,a->r=r),ic(a)):(I)gc(a->t,r,a->n,d,a->p);} Z H1(rdc){I r,d[9];ND1 r=a->r-1;Q(r<1,7);R mv(d,a->d+1,r),*d*=*a->d,rsh(a,r,d);} Z H1(monadicIota){A z;I1;{I r=a->n,*d=a->p,n=tr1(r,d);Q(n<0,9) Q(a->r>1,7)Q(r>MAXR,13)W(ga(It,r,n,d))d=z->p;DO(n,d[i]=i)R(I)z;}} Z H1(rav){ND1 R rsh(a,1,&a->n);} Z H1(sha){A z;ND1 W(gv(It,a->r))mv(z->p,a->d,a->r);R(I)z;} GV0(C,m0){!u?zer(t,(I *)r,n):(w=tmv(t,(I *)r,(I *)w,n>u?u:n),n>u)?tmv(t,(I *)w,(I *)r,n-u):0;} Z H2(rho){A z;ND2 I1{I wt=w->t,wn=w->n;I *d=a->p,r=a->n,n=tr1(r,d);Q(n<0,9) Q(r>MAXR,13)if(n==wn)R rsh(w,r,d);W(ga(t=wt,r,n,d))u=wn;C2(m0)}} GV2(C,m2){r=u!=1?tmv(t,(I *)r,(I *)a,v):trp(t,(I *)r,(I *)a,v);u!=2?tmv(t,(I *)r,(I *)w,n-v):trp(t,(I *)r,(I *)w,n-v);} #ifdef __lucid Z I f_cl(A a,A w,I i) { A z; ND2 X2 { XA; XW; I r,n,d[9]; i=!ar&&!wr||i==23; if(ar&&wr) if(ar==wr) Q(cm(ad+!i,wd+!i,ar-!i),8) else { Q(i||wr-ar!=1&&ar-wr!=1,7) if (wr < ar) { Q(cm(ad+1,wd,ar-1),8) } else { Q(cm(ad,wd+1,ar),8) } } if(wrr,an=a->n,*ad=a->d;XW;I r,n,d[9];i=!ar&&!wr||i==23; if(ar&&wr)if(ar==wr)Q(cm(ad+!i,wd+!i,ar-!i),8)else{ Q(i||wr-ar!=1&&ar-wr!=1,7)n=wrr;if(!r)R ic(a);W(gd(t=a->t,a)) C1((PFI)(!--r&&!a->t?(PFI)r0:(PFI)(v=tr(r,a->d+1),r1)))} Z I m,d[9]; GV1(C,t1) { I h=m,i,c[9]; DO(h+1,c[i]=0); if(!n)R; for(;;) { for(n=c[i=h];i--;n=n*d[i]+c[i]); r=tst(t,(I *)r,1,(I *)(w+Tt(t,n)),v,u); for(i=h;++c[i]==d[i];)if(i)c[i--]=0;else R; } } Z H1(tra){A z;ND1{XA;if((m=ar-2)<0)R ic(a);DO(ar,d[i]=ad[ar-1-i]) if(u= *ad,v=tr(ar-1,ad+1),v<2)R rsh(a,ar,d);W(ga(t=at,ar,an,d))C1(((PFI)t1))}} GV0(C,k1){ I tzer=(Et==t&&n-u&&QS(((I*)w)[0]))?Et+1:t; !u?tmv(t,(I *)r,(I *)(w+Tt(t,v)),n): u<0?tmv(t,(I *)zer(tzer,(I *)r,-u),(I *)w,n+u): zer(tzer,(I *)tmv(t,(I *)r,(I *)(w+Tt(t,v)),n-u),u); } Z I td(A a,A w,I i) { A z; ND2 I0 { I wt=w->t,wr=w->r,*wd=w->d; I j= *wd,k,m=*a->p; if(!wr) j=1,++wr; if(i==26) m=m>0?(m>j?0:m-j):m<-j?0:m+j; k=tr(wr-1,wd+1); u=v=0; t=wt; if(m<0) if(m= -m,m>j) u=(j-m)*k; else v=(j-m)*k; else if(m>j) u=(m-j)*k; else if(wtc==1&&m) R g=(PFI)k1,w->n=(*w->d=m)*k,ic(w); W(ga(wt,wr,m*k,wd))*z->d=m; C2(k1) } } Z H1(siz){ND1 R(I)gi(a->r?*a->d:1);} Z I b0(I *p,I n){I s=0,f=0;DO(n,if(~1&*p)if(f=1,*p<0)R -1;s+= *p++)R f?-s:s;} extern I aw; GV0(I,c0){I *p=r+n;I j=aw!=2;for(;rc?ic(a):(I)gc(a->t,a->r,a->n,a->d,a->p);} Z H2(cmp){ A z;ND2 I1; {I ar=a->r,an=a->n;XW; I bn=b0(a->p,an),wl=wr?*wd:1; Q(bn==-1,9) aw=0; u=an==1; if((u)&&bn==1&&wr) R ic_or_copy(w); Q(ar>1,7) if(!wr) wl=wr=1; if(u) bn*=wl; else if(wn==1) aw=2; else Q(wl!=an,8) if(wr==1&&wt!=Et&&bn>=0){ W(gv(wt,bn)) C2((!wt?(I(*)())c0:wt==Ft?(I(*)())c1:(I(*)())c2)) } if(bn<0) bn=-bn; v=tr(wr-1,wd+1); W(ga(t=wt,wr,bn*v,wd))*z->d=bn; C2(c3) }} Z H2(xpn){ A z; ND2 I1; {I ar=a->r,an=a->n;XW; I bn=b0(a->p,an),wl=wr?*wd:1; aw=0; Q(bn<0,9) Q(ar>1,7) if(!wr) wl=wr=1; if(wn==1) aw=2; else Q(wl!=bn,8) if(wr==1&&wt!=Et){ W(gv(wt,an)) C2((I(*)())(!wt?(I(*)())x0:wt==Ft?(I(*)())x1:(I(*)())x2)) } v=tr(wr-1,wd+1); u=wn; W(ga(t=wt,wr,an*v,wd))*z->d=an; C2(x3) }} Z H1(ts){A z;Z C *t[]={"int","float","char","null","box","sym","func", "unknown"}; W(gs(Et))*z->p=MS(si(t[QA(a)?(Ett?6:Et>a->t?a->t:!a->n?3: Et==a->t?(QA(a=(A)*a->p)&&a->tp=ic(a);R(I)z;} Z H2(n){R q=5,0;} Z H1(e1){ I z; I isWritableFile(); ND1 Q(a->t!=Ct,6)Q(a->r>1,7); ++dbg_depth;if(dbg_txeq)xeqtrc((C *)a->p,1); if(a->c||isWritableFile((I)a))z=exm((C *)a->p,APL); else { C *buf=(C *)mab(a->n+1); memmove(buf,a->p,a->n+1); z=exm(buf,APL); mf((I *)buf); } --dbg_depth;if(dbg_txeq)xeqtrc((C *)a->p,0); R z; } Z H2(e2){ I z; I isWritableFile(); CX cx=Cx; ND2; z=*a->p; if (It==a->t||qz(a)) { if(dbg_txeq)xeqtrc((C *)w->p,3); if(w->c||isWritableFile((I)w))z=pexm((I)w->p,APL); else { C *buf=(C *)mab(w->n+1); memmove(buf,w->p,w->n+1); z=pexm((I)buf,APL); mf((I *)buf); } if(dbg_txeq)xeqtrc((C *)w->p,2); R z; } else R QS(z)?(Cx=cxi(XS(z)),z=e1(w),Cx=cx,z):(q=6,0); } Z H1(st){switch(sq){CS(1,aplus_err(0,0))CS(2,ff(a))}R ic(a);} Z H1(out){R ff(a),ic(a);} Z S as(A a){if(a->r)q=7;if(!sym(a))q=6;if(q)R(S)0;R XS(*a->p);} Z H1(mrf){S v;ND1 v=as(a);if(!v)R 0;R ic((A)gt(sv(Cx,v)));} Z H2(drf){S c,v;ND2 c=as(a),v=as(w);if(!c||!v)R 0;R ic((A)gt(sv(cxi(c),v)));} Z I rake_1p(A a,I cd,I *pd){I z=0;if(QF(a)||Et!=a->t||fsy(a)&&a->n)R 1; if(!a->n)R 0;if(cd>=*pd)*pd=cd+1;DO(a->n,z+=rake_1p((A)a->p[i],cd+1,pd));R z;} Z void rake_2p(A a,A z){if(QF(a)||Et!=a->t||fsy(a)&&a->n) {z->p[z->n++]=QA(a)?ic(a):(I)a;R;}if(!a->n)R;DO(a->n,rake_2p((A)a->p[i],z));R;} Z H1(rake){A z;I n,d=0;n=rake_1p(a,0,&d);if(!n)R(I)aplus_nl; if(!d)R(I)gvi(Et,1,ic(a));z=gv(Et,n);z->n=0;rake_2p(a,z);R(I)z;} Z I dbgand(A a,A w,I i){ND2;I2;if(dbg_tbwc)bitwisechk(a,w,i);R ds(a,w,i);} Z I dbgscan(A a,I i){ND1;I1;if(dbg_tbwc)bitwisechk(a,0,i);R sc(a,i);} Z I dbgslash(A a,I i){ND1;I1;if(dbg_tbwc)bitwisechk(a,0,i);R rs(a,i);} extern I symToChar(A),aen(A),ran(A),not(A),neg(A),aab(A),sgn(A),cln(A), flr(A),rec(A),aln(A),pit(A),charToSym(A),dis(A),raz(A),pct(A), dep(A),upg(A),dng(A),monadicBeam(A),bwnot(A),sg(A),undot(A); extern I ind(A,A),bin(A,A), dyadicBeam(A,A),cir(A,A),dtr(A,A),sqr(A,A), dea(A,A),mat(A,A),ncd(A,A),dcd(A,A),prt(A,A),pen(A,A),mem(A,A), pic(A,A),dth(A,A), castOr(A,A),rot(A,A),dot(A,A); extern I os(A,A,I),is(A,A,I),bs(A,A,I); extern A mmd(A); extern A dmd(A,A); PFI P1[]= { (PFI)st, (PFI)ts, (PFI)ic_or_copy, (PFI)sgn, (PFI)cln, (PFI)flr, (PFI)neg, (PFI)rec, (PFI)aab, (PFI)enc, (PFI)dis, (PFI)n, (PFI)n, (PFI)n, (PFI)n, (PFI)aen, (PFI)aln, (PFI)ran, (PFI)tra, (PFI)monadicIota, (PFI)siz, (PFI)sha, (PFI)rav, (PFI)not, (PFI)rev, (PFI)sg, (PFI)out, (PFI)upg, (PFI)dng, (PFI)dep, (PFI)charToSym,(PFI)symToChar,(PFI)n, (PFI)n, (PFI)rake, (PFI)pct, (PFI)raz, (PFI)mmd, (PFI)rdc, (PFI)pit, (PFI)dbgscan, (PFI)dbgscan, (PFI)sc, (PFI)sc, (PFI)sc, (PFI)sc, (PFI)dbgslash, (PFI)dbgslash, (PFI)rs, (PFI)rs, (PFI)rs, (PFI)rs, (PFI)n, (PFI)n, (PFI)n, (PFI)n, (PFI)n, (PFI)n, (PFI)n, (PFI)n, (PFI)n, (PFI)n, (PFI)n, (PFI)n, (PFI)n, (PFI)n, (PFI)n, (PFI)monadicBeam,(PFI)n, (PFI)n, (PFI)mth, (PFI)e1, (PFI)gz, (PFI)ic_or_copy,(PFI)mrf, (PFI)undot, (PFI)n, (PFI)n, (PFI)n, (PFI)n, (PFI)n, (PFI)n, (PFI)n, (PFI)n, (PFI)bwnot }; PFI P2[]= { (PFI)dbgand, (PFI)castOr, (PFI)ds, (PFI)ds, (PFI)ds, (PFI)ds, (PFI)ds, (PFI)ds, (PFI)ds, (PFI)ds, (PFI)ds, (PFI)ds, (PFI)ds, (PFI)ds, (PFI)ds, (PFI)sqr, (PFI)ds, (PFI)dea, (PFI)dtr, (PFI)fnd, (PFI)ind, (PFI)rho, (PFI)f_cl, (PFI)f_cl, (PFI)rot, (PFI)td, (PFI)td, (PFI)bin, (PFI)n, (PFI)mat, (PFI)ncd, (PFI)dcd, (PFI)cmp, (PFI)xpn, (PFI)mem, (PFI)pen, (PFI)pic, (PFI)dmd, (PFI)prt, (PFI)cir, (PFI)n, (PFI)n, (PFI)n, (PFI)n, (PFI)n, (PFI)n, (PFI)n, (PFI)n, (PFI)n, (PFI)n, (PFI)n, (PFI)n, (PFI)os, (PFI)os, (PFI)os, (PFI)os, (PFI)os, (PFI)os, (PFI)os, (PFI)os, (PFI)os, (PFI)os, (PFI)os, (PFI)os, (PFI)os, (PFI)os, (PFI)is, (PFI)dyadicBeam,(PFI)is, (PFI)is, (PFI)dth, (PFI)e2, (PFI)ic, (PFI)n, (PFI)drf, (PFI)dot, (PFI)bs, (PFI)bs, (PFI)bs, (PFI)bs, (PFI)bs, (PFI)bs, (PFI)bs, (PFI)bs, (PFI)n }; I sizeOfPrimArray(I type_) { if(type_==1) R sizeof(P1)/sizeof(PFI); /* Monadic */ else R sizeof(P2)/sizeof(PFI); /* Dyadic */ } aplus-fsf-4.22/src/a/gpick.c0000644000265000001440000002027010772770356011305 /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved. */ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #include #include #include #include #include #include #include #undef ENTRYPOINT #define ENTRYPOINT Z I pcki(I,A); Z I gpu_fillivec(I *ivec, A aobj) { I i; F f,*fvec=(F *)aobj->p; for (i=0;in;++i) { if (fvec[i]!=(f=rint(fvec[i]))) R 1; ivec[i]=(I)f; } R 0; } Z I gpi_num(A apick, A aobj) { I idx, i, ivec[9], *ip; if (Et != aobj->t) ERROUT(ERR_DOMAIN); if (2 <= apick->r || apick->n != aobj->r) ERROUT(ERR_RANK); if (Ft==apick->t) { if (gpu_fillivec(ivec,apick)) ERROUT(ERR_TYPE); ip=ivec; } else ip=apick->p; if (aobj->d[0]<=(I)(idx=ip[0])) ERROUT(ERR_INDEX); for(i=1;in;++i) { if (aobj->d[i]<=(I)(ip[i])) ERROUT(ERR_INDEX); idx*=aobj->d[i]; idx+=ip[i]; } R idx; } Z I gpi_sym(I key, A aobj) { I i, tt; A t0, t1; if (Et != aobj->t || 2 != aobj->n) {q=ERR_DOMAIN;R -1;} t0=(A)aobj->p[0]; t1=(A)aobj->p[1]; if ((!QA(t0))||(!QA(t1))||Et!=t1->t||t0->n!=t1->n) {q=ERR_DOMAIN;R -1;} for (i=0;in;++i) { tt=t0->p[i]; if (!QS(tt)) {q=ERR_DOMAIN;R -1;} if (key==tt) R i; } q=ERR_INDEX;R -1; } Z A *gpp_scalar(I idx, A *paobj) { A aobj=un(paobj); /* H(" check: gpp_scalar idx:%d aobj->n:%d\n", idx, aobj->n); */ if (1 != aobj->r) ERROUT(ERR_RANK); if ((I)idx>=aobj->n) ERROUT(ERR_INDEX); if (QS(aobj)) ERROUT(ERR_DOMAIN); switch (aobj->t) { case It: case Ft: case Ct: ERROUT(ERR_TYPE); case Et: if(QF(aobj->p[idx])){ERROUT(ERR_TYPE);} R (A *)(aobj->p+idx); default:ERROUT(ERR_TYPE); } } Z A gp_nested(A apick, A aobj) { I idx, i, issymbol=0; A atarg, ares=aobj; if (2 <= apick->r) ERROUT(ERR_RANK); if (0==apick->n) R (A)ic(ares); /* ic_or_copy(ares) */ for (i=0;(0==q)&&in;++i) { atarg=(A)apick->p[i]; if ( (!QA(ares)) || Et != ares->t) ERROUT(ERR_DOMAIN); if (QS(atarg)) { if (-1==issymbol) ERROUT(ERR_DOMAIN); issymbol=1; idx=gpi_sym((I)atarg, ares); if (!q) ares=(A)ares->p[1]; } else { if (1==issymbol) ERROUT(ERR_DOMAIN); issymbol=-1; if (It==atarg->t || Ft==atarg->t) { idx=gpi_num(atarg, ares); } else if (Et==atarg->t) { if (0 == atarg->n && 1 == ares->n) { ares=(A)*ares->p; continue;} if (QS(atarg) || 1 != atarg->n) ERROUT(ERR_DOMAIN); atarg=(A)*atarg->p; if (!QS(atarg)) ERROUT(ERR_TYPE); idx=gpi_sym((I)atarg, ares); if (!q) ares=(A)ares->p[1]; } else ERROUT(ERR_DOMAIN); } if (q) ERROUT(q); ares=(A)ares->p[idx]; } if (!QA(ares)) ERROUT(ERR_DOMAIN); R QF(ares)?gc(Et,0,1,0,(I *)&ares):(A)ic(ares); /* ic_or_copy(ares) */ } Z A gpix_nested(A apick, A aobj) { I idx=0, i; A atarg, apix; if (0==apick->n) R gv(It,0); apix=gv(It,2*apick->n); apix->n=apix->d[0]=0; for (i=0;in;++i) { atarg=(A)apick->p[i]; if (QS(atarg)) { idx=gpi_sym((I)atarg, aobj); if(q)R 0; aobj=(A)aobj->p[1]; apix->p[apix->n++]=1; } else { if (It==atarg->t || Ft==atarg->t) { idx=gpi_num(atarg, aobj); } else if (Et==atarg->t) { if (0 == atarg->n && 1 == aobj->n) { aobj=(A)*aobj->p; apix->p[apix->n++]=0; continue; } atarg=(A)*atarg->p; idx=gpi_sym((I)atarg, aobj); if(q)R 0; aobj=(A)aobj->p[1]; apix->p[apix->n++]=1; } } aobj=(A)aobj->p[idx]; apix->p[apix->n++]=idx; } apix->d[0]=apix->n; R apix; } Z A *gpp_nested(A apick, A *paobj) { I idx, i, issymbol=0; A atarg, *pares=paobj, ares; if (2 <= apick->r) ERROUT(ERR_RANK); if (0==apick->n) R pares; for (i=0;(0==q)&&in;++i) { ares=un(pares); atarg=(A)apick->p[i]; if ( (!QA(ares)) || Et != ares->t) ERROUT(ERR_DOMAIN); if (QS(atarg)) { if (-1==issymbol) ERROUT(ERR_DOMAIN); issymbol=1; idx=gpi_sym((I)atarg, ares); if (!q) pares=(A*)(ares->p+1); } else { if (1==issymbol) ERROUT(ERR_DOMAIN); issymbol=-1; if (It==atarg->t || Ft==atarg->t) { idx=gpi_num(atarg, ares); } else if (Et==atarg->t) { if (0 == atarg->n && 1 == ares->n) { pares=(A*)(ares->p); continue;} if (QS(atarg) || 1 != atarg->n) ERROUT(ERR_DOMAIN); atarg=(A)*atarg->p; if (!QS(atarg)) ERROUT(ERR_TYPE); idx=gpi_sym((I)atarg, ares); if (!q) pares=(A*)(ares->p+1); } else ERROUT(ERR_DOMAIN); } if (q) ERROUT(q); pares=(A*)((un(pares))->p+idx); } if (!QA(*pares)) ERROUT(ERR_DOMAIN); R pares; } Z A gp_num(A apick, A aobj) { I i, *ivec=(I*)0, *ip; A ares=aobj; if (2 <= apick->r) ERROUT(ERR_RANK); if (0 == apick->n) R (A)ic(ares); /* ic_or_copy(ares) */ if (Ft==apick->t) { ivec=(I *)balloc(apick->n * sizeof(I)); if (gpu_fillivec(ivec,apick)) { bfree((C *)ivec); ERROUT(ERR_TYPE); } ip=ivec; } else ip=apick->p; for (i=0;(0==q)&&in;++i) { if ( (!QA(ares)) || Et != ares->t) {bfree((C *)ivec);ERROUT(ERR_DOMAIN);} if ( 2 <= ares->r) {bfree((C *)ivec);ERROUT(ERR_RANK);} if ((I)(ip[i])>=ares->n) {bfree((C *)ivec);ERROUT(ERR_INDEX);} ares=(A)ares->p[ip[i]]; } bfree((C *)ivec); if (!QA(ares)) ERROUT(ERR_DOMAIN); R QF(ares)?gc(Et,0,1,0,(I *)&ares):(A)ic(ares); /* ic_or_copy(ares) */ } Z A *gpp_num(A apick, A *paobj) { I i, *ivec=(I*)0, *ip; A *pares=paobj, aobj; if (2 <= apick->r) ERROUT(ERR_RANK); if (0 == apick->n) R pares; if (Ft==apick->t) { ivec=(I *)balloc(apick->n * sizeof(I)); if (gpu_fillivec(ivec,apick)) { bfree((C *)ivec); ERROUT(ERR_TYPE);} ip=ivec; } else ip=apick->p; for (i=0;(0==q)&&in;++i) { if(*pares&&QA(*pares))aobj=un(pares); else{bfree((C *)ivec);ERROUT(ERR_DOMAIN);} if ( (!QA(aobj)) || Et != aobj->t) {bfree((C *)ivec); ERROUT(ERR_DOMAIN);} if ( 2 <= aobj->r) {bfree((C *)ivec); ERROUT(ERR_RANK);} if ((I)(ip[i])>=aobj->n) {bfree((C *)ivec);ERROUT(ERR_INDEX);} pares=(A *)(aobj->p+ip[i]); } bfree((C *)ivec); if (!QA(*pares)) ERROUT(ERR_DOMAIN); R pares; } ENTRYPOINT A ep_gp(A apick, A aobj) { I idx; A z; /* H("check: ep_gp\n"); */ switch(apick->t) { case It: case Ft: if (1==apick->n) { if (1!=aobj->r) ERROUT(ERR_RANK); if (It==apick->t) z=(A)pcki(*apick->p, aobj); else if (gpu_fillivec(&idx,apick)) ERROUT(ERR_TYPE) else z=(A)pcki(idx, aobj); } else z=gp_num(apick, aobj); break; case Et: z=gp_nested(apick, aobj); break; default: ERROUT(ERR_TYPE); } R z; } ENTRYPOINT A *ep_gpp(A apick, A *paobj) { I idx; /* H("check: ep_gpp\n"); */ switch(apick->t) { case It: case Ft: if (1==apick->n) { if (It==apick->t) R gpp_scalar(*apick->p, paobj); if (gpu_fillivec(&idx,apick)) ERROUT(ERR_TYPE); R gpp_scalar(idx, paobj); } else R gpp_num(apick, paobj); case Et: R gpp_nested(apick, paobj); default: ERROUT(ERR_TYPE); } } ENTRYPOINT A gpix(A apick, A aobj) { A apix; /* H("check: ep_gp\n"); */ switch(apick->t) { case It: R (A)ic(apick); case Ft: apix=gv(It,apick->n); if (gpu_fillivec(apix->p,apick)) {dc(apix); R (A)0;} R apix; case Et: R gpix_nested(apick, aobj); default: R (A)0; } } /* pcki checks for index error, pck does not */ Z I pcki(I i,A a){I z;I t=a->t;Q(!a->r,7)Q((I)i>=a->d[0],10); R t==Et&&(z=a->p[i],!QF(z))?ic((A)z): (I)gc(t,0,1,0,(I*)((C*)(a->p)+Tt(t,i)));} I pck(I i,A a){I z;I t=a->t; R t==Et&&(z=a->p[i],!QF(z))?ic((A)z): (I)gc(t,0,1,0,(I *)((C*)(a->p)+Tt(t,i)));} H2(pic){ND2 if(w->r) R (I)ep_gp(a,w); else { /* scalar case */ I r; A ww=gc(w->t,w->r,w->n,w->d,w->p); /* Make a copy */ ww->d[0]=ww->r=1; /* Change to a 1 element vector */ r=(I)ep_gp(a,ww); dc(ww); R r; } } I pka(A p,A *v){Q(!QA(p)||!QA(*v)||Et<(p)->t||Et<(*v)->t,18)R (I)ep_gpp(p,v);} aplus-fsf-4.22/src/a/i.c0000644000265000001440000003241610772770357010446 /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved. */ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #include #include #include #include #include #include #include #include Z I *tp,t,u,v;typedef struct h{struct h *__h;I i;}*HH; /*I ne(F *f,F *g){R *f<*g&&*f<*g*(*g>0?CT1:CT2)||*f>*g*(*g>0?CT2:CT1);} */ I ne(F *f,F *g){ int c1; F c2, c3; c1 = *f<*g; if (*g > 0) { c2 = CT1; c3 = CT2; } else { c2 = CT2; c3 = CT1; } R c1&&*f<*g*c2||*f>*g*c3; } I sym(A a){if(a->t!=Et||!a->n)R 0;DO(a->n,if(!QS(a->p[i]))R 0)R 1;} I fsy(A a){DO(a->n,if(!QF(a->p[i]))R 0)R 1;} I cm(I *d,I *s,I n){I *t=d+n;for(;dn,i=a->t,j=w->t,*s;F *t,*d,f; /*if(!n)R 0;*/ if(i==Ft&&j==It)s=w->p,d=(F*)a->p; else if(i==It&&j==Ft)s=a->p,d=(F*)w->p; else R 1; for(t=d+n;dt)>Et||(j=w->t)>Et?a!=w: cm(&a->r,&w->r,2+a->r)?1:i!=j?cfi(a,w):(ct(i))(a->p,w->p,a->n);} GV2(I,m0){*r=!(ct(t))(a,w,u);} H2(mat){A z;if(a==w)R(I)gi(1);if(!QA(a)||!QA(w))R(I)gi(0); if(cm(&a->r,&w->r,2+a->r))R(I)gi(0); if(a->t!=(t=w->t))R(I)gi(!cfi(a,w));W(gs(It))u=a->n;C2(m0)} #define CF(f,t) Z I f(t *p,I i,I j,I n,I u){t*d=p+i*n,*s=p+j*n; \ DO(n,if(d[i]!=s[i])R u^d[i]strcmp(XS(d[i])->n,XS(s[i])->n)))R ip)=j=mrg((PFI)(at==Ct?(PFI)lc:(Ft==at?(PFI)lf:(y?(PFI)ls:(PFI)li))),tr(ar-1,ad+1),(I)a->p,t,0,n,u); DO(n-1,*++p=j=t[j]); } R(I)z; } Z void u1(I *r,I w,I n){*r=mrg((PFI)lf,1,w,tp,0,n,v);DO(n-1,r[i+1]=tp[r[i]])} Z void fsu(I *r,F *w,I n){ F x,u=*w,y=u; I i,c=n*20,*p=tp; HH h=(HH)(p+n),j,k; DO(n,if(!finite(w[i])){u1(r,(I)w,n);R;}) /* Inf and NaN check */ DO(n,if(p[i]=0,x=w[i],xy)y=x); if(!finite(y-=u)){q=0;u1(r,(I)w,n);R;} /* Inf and NaN check */ if(y)y=n/(y*CT2); for(i=n;i--;){ for(x=w[i],k=(HH)(p+(I)((x-u)*y)); (j=k->__h)&&x>w[j->i]; k=j) if(!--c){u1(r,(I)w,n);R;} h->__h=j;h->i=i;k->__h=h++; } DO(n,for(h=(HH)p[i];h;h=h->__h)*r++=h->i); } Z void fsd(I *r,F *w,I n){ F x,u=-*w,y=u; I i,c=n*20,*p=tp; HH h=(HH)(p+n),j,k; DO(n,if(!finite(-w[i])){u1(r,(I)w,n);R;}) /* Inf and NaN check */ DO(n,if(p[i]=0,x=-w[i],xy)y=x); if(!finite(y-=u)){q=0;u1(r,(I)w,n);R;} /* Inf and NaN check */ if(y)y=n/(y*CT2); for(i=n;i--;){ for(x=-w[i],k=(HH)(p+(I)((x-u)*y)); (j=k->__h)&&x>-w[j->i]; k=j) if(!--c){u1(r,(I)w,n);R;} h->__h=j;h->i=i;k->__h=h++; } DO(n,for(h=(HH)p[i];h;h=h->__h)*r++=h->i); } GV1(I,isu){ unsigned long j,k=n*3,m=0; I *p=tp;*p=0; DO(n, if(m<(j=w[i])){ if(j>=k){q=-2;R;} do p[++m]=0;while(m=k){q=-2;R;} do p[++m]=0;while(mn,t=a->t;v=0;if(!n||a->r!=1||t>Ft)R srt(a,0); W(gv(It,n))*--Y=(I)z,tp=k_tm(n*3),++Y;C1((t==Ft?(PFI)fsu:(PFI)isu))} H1(dng){A z;I n,t;ND1 n=a->n,t=a->t;v=1;if(!n||a->r!=1||t>Ft)R srt(a,1); W(gv(It,n))*--Y=(I)z,tp=k_tm(n*3),++Y;C1((t==Ft?(PFI)fsd:(PFI)isd))} /* H1(dng){ND1 R srt(a,1);} */ Z I i_f0(I n,I k){register I m=n;do k^=k>>m;while(32>(m+=m));R k;} /* !!! NOTEIT: shift 4 in ch() and ih() looks suspect !!! */ Z I ch(C *p,I n){I r=0;DO(n,r^=*p++<<4*(i&7))R r;} Z I ih(I *p,I n){register I r=0,x;DO(n,r<<=4;x=*p++;r^=(0<=x)?x:x^0xAAAAAAAA) R r;} #if defined(__i386) || defined(__alpha) || defined(__ia64) || defined(__x86_64) /* Z I ffh(F *xp,I n){F f;int *z=(int*)&f;while(--n&&!*xp)++xp;f=*xp; */ /* R(z[1]&0x7FFFFFFF)^(z[0]&0xFFFFF000);} */ /* Z I fct1h(F *xp,I n){F f;int *z=(int*)&f;while(--n&&!*xp)++xp;f=CT1**xp; */ /* R(z[1]&0x7FFFFFFF)^(z[0]&0xFFFFF000);} */ /* Z I fct2h(F *xp,I n){F f;int *z=(int*)&f;while(--n&&!*xp)++xp;f=CT2**xp; */ /* R(z[1]&0x7FFFFFFF)^(z[0]&0xFFFFF000);} */ Z I ffh(F *xp,I n) { union { int z[2]; F f; } u; while(--n&&!*xp) { ++xp; } u.f=*xp; R(u.z[1]&0x7FFFFFFF)^(u.z[0]&0xFFFFF000); } Z I fct1h(F *xp,I n) { union { int z[2]; F f; } u; while(--n&&!*xp) { ++xp; } u.f=CT1**xp; R(u.z[1]&0x7FFFFFFF)^(u.z[0]&0xFFFFF000); } Z I fct2h(F *xp,I n) { union { int z[2]; F f; } u; while(--n&&!*xp) { ++xp; } u.f=CT2**xp; R(u.z[1]&0x7FFFFFFF)^(u.z[0]&0xFFFFF000); } #else /* Z I ffh(F *xp,I n){F f;int *z=(int*)&f;while(--n&&!*xp)++xp;f=*xp; */ /* R(z[0]&0x7FFFFFFF)^(z[1]&0xFFFFF000);} */ /* Z I fct1h(F *xp,I n){F f;int *z=(int*)&f;while(--n&&!*xp)++xp;f=CT1**xp; */ /* R(z[0]&0x7FFFFFFF)^(z[1]&0xFFFFF000);} */ /* Z I fct2h(F *xp,I n){F f;int *z=(int*)&f;while(--n&&!*xp)++xp;f=CT2**xp; */ /* R(z[0]&0x7FFFFFFF)^(z[1]&0xFFFFF000);} */ Z I ffh(F *xp,I n) { union { int z[2]; F f; } u; while(--n&&!*xp) { ++xp; } u.f=*xp; R(u.z[0]&0x7FFFFFFF)^(u.z[1]&0xFFFFF000);} Z I fct1h(F *xp,I n) { union { int z[2]; F f; } u; while(--n&&!*xp) { ++xp; } u.f=CT1**xp; R(u.z[0]&0x7FFFFFFF)^(u.z[1]&0xFFFFF000);} Z I fct2h(F *xp,I n) { union { int z[2]; F f; } u; while(--n&&!*xp) { ++xp; } u.f=CT2**xp; R(u.z[0]&0x7FFFFFFF)^(u.z[1]&0xFFFFF000);} #endif Z I eh(A *x,I n){ A a=*x; R !QA(a)||a->t>Et?(I)a>>4: !a->n?0: a->t==Et?eh((A *)a->p,1): a->t==It?*a->p: a->t==Ct?ch((C *)a->p,a->n): *(F*)a->p*(1+2e-13); } extern I aw_c[]; /* aw_c set by rk(), else always {1,1}. */ #define G3(f) Z I f(I *r,UC *a,UC *w,I n) #define GV3(f) Z void f(I *r,UC *a,UC *w,I n) GV3(g0){I (*f)(I *,I *,I)=ct(t),j=u,k=v,i=0;for(n=Tt(t,k);i>=1;R z;} G3(g1){ I(*f)(I *,I *,I)=ct(t),(*hfn)(UC *,I),(*hfn1)(UC *,I); #ifdef BSTUB I m=u,j,k=v,l=Tt(t,k),*p=tp,b=(p2(u*4))-2,bm=1<i=m,p[j]=(I)(h++)) a-=l,h->__h=(HH)p[j=bm&i_f0(b,(*hfn)(a,k))]; /* Note that we tried eliminating duplicate entries, but the odds of "useful" collision were so small that the additional cost of comparison far outweighed it. */ #ifdef HASHDUMP { I buck=0,tl=0,ml=0,cl=0,*pe=p+bm,*cp=p;V v=vi(si("fndh",Rx));A aobj; for(;cp__h)++cl;tl+=cl;ml=(mla);aobj=gv(It,buck); for(cl=ml=0;mlp[cl++]=ml; v->a=(I)aobj;v->t=0; } #endif /* use hash table */ DO(n, CHECKXCP;if(q)R 0; j=bm&i_f0(b,((*hfn1))(w,k)); for(h=(HH)p[j];h&&(*f)((I *)(a+l*h->i),(I *)w,k);h=h->__h);*r=h?h->i:u; if(f==(I(*)(I *,I *,I))cmf&&j!=(m=bm&i_f0(b,fct1h((F *)w,k)))){ for(h=(HH)p[m];h&&cmf((F *)(a+l*h->i),(F *)w,k);h=h->__h);if(h&&h->i<*r)*r=h->i;} ++r;w+=l); R -1; } GV3(c0){UC *t=a+u,*p;DO(n,for(p=a;p!=t&&*p!=*w;++p);*r++=p-a;w++)} Z I cT[256]; GV3(c1){I i;DO(256,cT[i]=u)for(i=u;i--;cT[a[i]]=i);DO(n,r[i]=cT[w[i]])} GV2(I,i0){I *t=a+u,*p;DO(n,for(p=a;p!=t&&*p!=*w;++p);*r++=p-a;w++)} GV2(I,i1){I j,k;DO(n,for(k=*w++,j=0;jt,ar=a->r,*ad=a->d;I wt=w->t,wr=w->r,*wd=w->d;I n;u=ar?(--ar,*ad++):1;v=tr(ar,ad);wr-=ar; Q(wr<0,7)Q(cm(ad,wd+wr,ar),8); if(wt==Et&&fsy(w))wt=It; W(ga(It,wr,n=tr(wr,wd),wd)); if(!u||!v)R zr(z); if((!ar)&&(wt==It&&n<20||wt==Ct)) C2(((I (*)())wt?(n<12&&(a->c&&aw_c[0])?(I (*)())c0:(I (*)())c1):(a->c&&aw_c[0])?(I (*)())i0:(I (*)())i1)); t=wt;if(n==1)C2((I (*)())g0)*--Y=(I)z,tp=k_tm(u*4),++Y; C2((ar||at?(I (*)())g1:(I (*)())i2)); } } static I index_of2(I hi,A aa,A ww,I n) { A a,w; I r=0,i=1,_i=ww->n; I *aip,*wip; F *afp,*wfp; for(;i<_i&&!r;++i) { a=(A)(aa->p[i]); w=(A)(ww->p[i]); Q(a->t!=w->t,ERR_TYPE) if (a->t==Ft){ afp=(F *)a->p; afp+=hi; wfp=(F *)w->p; wfp+=n; r=(ct(a->t))((I *)afp,(I *)wfp,1); } else { aip=a->p; aip+=hi; wip=w->p; wip+=n; r=(ct(a->t))(aip,wip,1); } } R r; } static I index_of1(I *r,A aa,A ww,I n) { UC *a=(UC *)((A)(aa->p[0]))->p; UC *w=(UC *)((A)(ww->p[0]))->p; I(*f)(I *,I *,I)=ct(t),(*hfn)(UC *,I),(*hfn1)(UC *,I); #ifdef BSTUB I m=u,j,k=v,l=Tt(t,k),*p=tp,b=(p2(u*4))-2,bm=1<i=m,p[j]=(I)(h++)) a-=l,h->__h=(HH)p[j=bm&i_f0(b,(*hfn)(a,k))]; /* use hash table. After a row is found index_of2 check the other * columns for the row that was found otherwise it is the same as * dyadic iota "fnd()" */ #if 0 DO(n, CHECKXCP; if(q)R 0; j = bm & i_f0(b, (*hfn1)(w,k) ); for(h = (HH) p[j]; h && ((*f)((I *)(a+l*h->i), (I *)w, k) || index_of2(h->i,aa,ww,i)); h = h->__h); *r = h ? h->i:u; if(f == (I (*)(I *,I *,I))cmf && j != (m = bm & i_f0(b, fct1h((F *)w,k)))){ for(h = (HH) p[m]; h && (cmf((F *)(a+l*h->i), (F *)w, k) || index_of2(h->i,aa,ww,i)); h = h->__h); if(h && h->i<*r) *r=h->i; } ++r;w += l); #else { I i=0, _i=(n) ; for(; i < _i ; ++i) { CHECKXCP; if(q) return 0 ; j=bm & i_f0(b, (*hfn1)(w, k)) ; for(h=(HH) p [j] ; h && ((*f)((I *)(a + l *h->i), (I *)w, k) || index_of2(h->i, aa, ww, i)) ; h=h->__h) ; *r=h ? h->i : u ; if(f ==(I(*)(I *, I *, I))cmf && j !=(m=bm & i_f0(b, fct1h((F *)w, k))) ) { for(h=(HH) p [m] ; h && (cmf((F *)(a + l *h->i), (F *) w, k) || index_of2(h->i, aa, ww, i)); h=h->__h) ; if(h && h->i < *r) *r=h->i ; } ++r ; w += l ; } } ; #endif R -1; } /* * index_of() is called from ep_index_of() in index.c */ H2(index_of){ A z,aa=a,ww=w; struct a ta,tw; a=(A)a->p[0],w=(A)w->p[0]; memcpy(&ta,a,AH); memcpy(&tw,w,AH); /*make appear as a nx1 (tw&ta are copies)*/ if(ta.r==0) { ta.d[0]=1; ta.d[1]=1; } else { ta.d[1]=1; } ta.r++; if(tw.r==0) { tw.d[0]=1; tw.d[1]=1; } else { tw.d[1]=1; } tw.r++; { I ar=ta.r,*ad=ta.d;I wt=tw.t,wr=tw.r,*wd=tw.d; u=ar?(--ar,*ad++):1; v=tr(ar,ad); wr-=ar; W(ga(It,wr,tr(wr,wd),wd)); if(!u||!v) R zr(z); t=wt; a=aa,w=ww; *--Y=(I)z,tp=k_tm(u*4),++Y; index_of1(z->p,a,w,z->n); } R (I)z; } H2(mem){A z;ND2 X2 if(!(z=(A)fnd(w,a)))R 0;g=0; DO(z->n,z->p[i]=z->p[i]!=u)R(I)z;} /* sun4/280 =(7,5) >(5) f(27,20) m=0xFFFF0000 *f==*g?f[1]&m!=g[1]&m:f[1]&m&&g[1]&m&&... NaN? remove order: ||t== d #include #include #include typedef struct{I n,*j,s;}HH; typedef I (*G)(I,HH *); Z I r,c[9],d[10],t,u,v,e; #define J(f,t,x) Z void f(I p,HH *h){t *s=(t *)h->s;I *j=h->j;DO(h->n,x)h->s=(I)s;} #define K(t,u,v,x,y) J(u,t,*s++=*(t *)p;p+=(I)j) J(v,t,*s++=*(t *)(p+*j++))\ J(x,t,*(t *)p=*s;s+=r;p+=(I)j) J(y,t,*(t *)(p+*j++)=*s;s+=r) K(I,i0,i1,i2,i3) K(C,c0,c1,c2,c3) K(F,j_f0,j_f1,f2,f3) J(e0,I,*s++=ic((A)(*(I*)p));p+=(I)j) J(e2,I,dc((A)(*(I*)p));*(I*)p=ic((A)(*s));s+=r;p+=(I)j) J(e1,I,*s++=ic((A)(*(I*)(p+*j++)))) J(e3,I,dc((A)(*(I*)(p+*j)));*(I*)(p+*j++)=ic((A)(*s));s+=r) Z PFI f[][2][2]={ (PFI)i0,(PFI)i1,(PFI)i2,(PFI)i3, (PFI)j_f0,(PFI)j_f1,(PFI)f2,(PFI)f3, (PFI)c0,(PFI)c1,(PFI)c2,(PFI)c3, 0,0,0,0, (PFI)e0,(PFI)e1,(PFI)e2,(PFI)e3 }; J(m0,I,(*(G)s)(p,h-1);p+=(I)j) J(m1,I,(*(G)s)(p+*j++,h-1)) #define CK(n) if((unsigned long)(n)>=m)q=10; /* Z I j_t2(A w){I *p=w->p,j=*p;DO(w->n-1,if(*++p!=++j)R 0)R 1;} */ Z I j_t2(A w) { if(w->n>1) { I *p=w->p; I j=*p; I i=0,_i=w->n-1; for(;i<_i;++i) { if(*++p!=++j) R 0; } } R 1; } I xin(A a,I m,A z) { A *w=(A*)Y+1; HH hh[9],*h=hh; C *p=(C*)a->p; I t=a->t,ar=a->r,*ad=a->d,b=!z,l,u=0,i=0,j=0,k=0,n=1,d[9],y[9],*v,s=0; if(!m&&b)R ic(a); Q(m>ar,7); for(;i=m||qz(a)) { j=d[k++]=ad[i],y[i]=0; } else { Q(!QA(a)||a->t&&!(a=ci(i+1)),6); j=a->r,mv(d+k,a->d,j),k+=j,j=a->n,y[i]=j==1?1:j_t2(a)?2:(u+=j,3); } if(b){Q(k>9,13)W(ga(t,k,n,d))} else { if(r=z->n!=1){Q(k!=z->r,7)Q(cm(z->d,d,k),8)} if(!m)R tst(t,(I *)p,1,z->p,r,n),1; } if(!n)R(I)z; #if (_MIPS_SZLONG == 64) || defined (__alpha) || defined(__sparcv9) || defined(__ia64) || defined(__x86_64) l=(((t>>1)&1)+3)&3,j=1<p)p+=j*k;if(i||s)continue;n=1); /* single */ CS(2,n=a->n; CK(k=*a->p)p+=j*k;CK(k+n-1)); /* iota */ CS(3,n=a->n; if(j!=1<p[i])*v++=j*k) /* list */ else DO(n,CK(k=a->p[i])*v++=k<n=n,h->j=u?v-n:(I*)j, h++->s=s?s:(I)z->p,s=(I)(!s?(I)(f[t][!b][u]):(I)u?(I)m1:(I)m0); } while(j*=m,i); if(q){if(b)mf((I *)z);R 0;} R(*(G)s)((I)p,h-1),(I)z; } I xr(A z,A a,A w) { I i,f=a->t==Et,n=f?a->n:1; if(f)for(i=n;i--;*--Y=ic((A)a->p[i])); *--Y=0,z=(A)xin(z,n,w),++Y; if(f)DO(n,dc((A)(*Y++))); R(I)z; } #define CI(T,f) G0(T,f){DO(n,Q((unsigned long)(n=*a++)>=e,10); *r++=w[n])R -1;} CI(I,jj0) CI(F,jj1) CI(C,jj2) G0(C,jj3) { DO(u,Q((unsigned long)(n=*a++)>=e,10); tmv(t,(I *)(r+Tt(t,i*v)),(I *)(w+Tt(t,n*v)),v)); R -1; } H2(ind) { A z;ND2; if(a->t==Et)R xr(w,a,0); { I wt=w->t,wr=w->r,*wd=w->d; I1 Q(!wr,7)e=*wd; if(wr==1&&wtr,an=a->n,*ad=a->d;t=wt,u=an; v=tr(--wr,++wd); Q(MAXRd+ar,wd,wr); C2(jj3); } } } GV0(C,r2){I j=rm(v**a,n);tmv(t,(I *)tmv(t,(I *)r,(I *)(w+Tt(t,j)),n-j),(I *)w,j);} GV0(C,r3) { I j,k=Tt(t,1); n=u; DO(v,j=rm(*a++,n); tst(t,(I *)tst(t,(I *)r,v,(I *)(w+k*j*v),v,n-j),v,(I *)w,v,j);r+=k;w+=k); } H2(rot) { A z; I *d,j,r; ND2; d=w->d,j=a->n!=1,r=j?a->r:w->r-1; I1 u=*d++,v=tr(r,d); if(0==w->r)R ic(w); if(j){Q(r!=w->r-1,7)Q(cm(a->d,d,r),8)} W(gd(t=w->t,w)); if(!u)R(I)z; C2(((I(*)())(j?r3:r2))); } Z C *h(C *r,C *w,I j) { I n=d[j],k=c[j]; if(d[++j]<0)r=tst(t,(I *)r,1,(I *)w,k,n); else DO(n,r=h(r,w,j);w+=Tt(t,k)); R r; } H2(dtr) { A z; I k,r,i,n=1,m=0; unsigned long j; ND2; r=w->r; I1 Q(a->n!=r,7); DO(r+1,d[i]=-1); for(i=r;i--;n*=k) { j=a->p[i],k=w->d[i]; Q(j>9,9); if(d[j]<0){if(c[j]=n,d[j]=k,j>m)m=j;} else if(c[j]+=n,--r,d[j]>k)d[j]=k; } Q(m>=r,9); W(ga(t=w->t,r,tr(r,(I *)d),(I *)d)); R h((C *)z->p,(C *)w->p,0),(I)z; } #define GT(Ttype,f) Z I f(I b,Ttype *d,Ttype *s,I n){d+=n*b; \ DO(n,if(s[i]!=d[i])R s[i]>d[i])R 0;} #define GB(Ttype,f) Z void f(I *r,Ttype *o,Ttype *p,I m,I n) \ {I b,l,h;DO(n,l=0;h=m; \ while(lo[b=(l+h)>>1])l=b+1;else h=b;r[i]=l)} GB(I,b0)GB(F,b1)GT(I,bi)GT(F,bf)GT(UC,bc) H2(bin) { A z; ND2; if(!a->t&&w->t==Ft&&w->n==1&&ci(1))w=(A)Y[1]; else{q=0;X2} { XA; I wr=w->r,wn=w->n,*wd=w->d; if(ar==1&&atp,a->p,w->p,an,wn); } else { PFI f; I n,b,*r,u=ar?(--ar,*ad++):1,v=tr(ar,ad),t=at; C *p; Q(at>Ct,6)wr-=ar; Q(wr<0,7); Q(cm(ad,wd+wr,ar),8); W(ga(It,wr,n=tr(wr,wd),wd)); r=z->p,p=(C*)w->p,f=!at?(PFI)bi:at==Ft?(PFI)bf:(PFI)bc; DO(n, I l=0;I h=u; while(l>1,a->p,p,v))l=b+1; else h=b;r[i]=l;p+=Tt(t,v) ); } R(I)z; } } aplus-fsf-4.22/src/a/k.c0000644000265000001440000004116510772770357010451 /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved. */ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #include #include #include #include #include #include #include #include #include #include #include I MY[2001]; CX Rx,Cx; extern void *Glbrtn ; extern I Xf; extern I atOnExit, wtOnExit; /* set in fa() used by i.c:rk() */ extern I DependencyEvaluationSemaphore; A aplus_nl; I mts; I sq=2,q; PFI g; I *Y,*X,*XY,*K=MY; Z I mr0(E); Z A e0(E,A); extern I dbg_tscb, dbg_tpcb, dbg_tprcb, dbg_trcb; static I aplusPageMask=4096-1; #define PAGE_ALIGN(k) ((void *)(((unsigned long)(k)) & ~aplusPageMask)) static int msyncFlag=MS_ASYNC; /* Default flag for msync */ #if defined(linux) || defined(__sgi) static int msyncMode=1; /* Default msyncMode is on*/ #else static int msyncMode=0; /* Default msyncMode is off*/ #endif void setBeamMSyncMode(A msyncMode_) { int i; int saveFlag=msyncFlag; if(msyncMode_->t==It) /* Allow explicit setting */ { msyncFlag=*msyncMode_->p; msyncMode=1; R; } if(msyncMode_->t!=Et || !QS(*msyncMode_->p) ) { q=ERR_DOMAIN; R; } msyncFlag=0; for(i=0; in; i++) { if(msyncMode_->p[i]==MS(si("MS_ASYNC"))) { if(msyncFlag&MS_SYNC) { q=ERR_DOMAIN; } else { msyncFlag|=MS_ASYNC; msyncMode=1; } } else if(msyncMode_->p[i]==MS(si("MS_SYNC"))) { if(msyncFlag&MS_ASYNC) { q=ERR_DOMAIN; } else { msyncFlag|=MS_SYNC; msyncMode=1; } } else if(msyncMode_->p[i]==MS(si("MS_INVALIDATE"))) { msyncFlag|=MS_INVALIDATE; msyncMode=1; } else if(msyncMode_->p[i]==MS(si("none"))) { msyncMode=0; } else q=ERR_DOMAIN; } if(q) msyncFlag=saveFlag; } A getBeamMSyncMode(void) { if(msyncMode) { if(msyncFlag&MS_ASYNC && msyncFlag&MS_INVALIDATE) return gvi(Et,2,MS(si("MS_ASYNC")),MS(si("MS_INVALIDATE"))); else if(msyncFlag&MS_SYNC && msyncFlag&MS_INVALIDATE) return gvi(Et,2,MS(si("MS_SYNC")),MS(si("MS_INVALIDATE"))); else if(msyncFlag==MS_ASYNC) return gsym("MS_ASYNC"); else if(msyncFlag==MS_SYNC) return gsym("MS_SYNC"); else return gi(msyncFlag); } else return gsym("none"); } void ki(void) { #if defined(HAVE_SVR4) aplusPageMask=sysconf(_SC_PAGESIZE)-1; #elif __VISUAL_C_2_0__ aplusPageMask=CLBYTES; #else aplusPageMask=getpagesize()-1; #endif X=Y=XY=(K=MY)+2000; *X=*K=0; *++K=0; symhti(); Rx=Cx=(CX)cxhti(); aplus_nl=gv(Et,0); aplus_nl->c=0; p0hti(); xshti(); te(); mts=MS(si("")); setPWD(); } I profileExecute(n,P1,P2,i) I n,i; I (*P1[])(),(*P2[])(); { /* _profile called from profileDyadic() profileMonadic() */ R n==2?(*P2[i])(*Y,Y[1],i):(*P1[i])(*Y,i); } I ic(A aobj) { /* R!(aobj&&QA(aobj))?(I)aobj:aobj->c?(++aobj->c,(I)aobj):im((I)aobj); */ if (!(aobj && QA(aobj))) { return (I)aobj ; } else { if (aobj->c) { ++aobj->c ; return (I)aobj ; } else return im((I)aobj) ; } } void dc(A aobj) { if(aobj&&aplus_nl!=aobj&&QA(aobj)) { if((aplusPageMask&(I)aobj)&&aobj->c) { if(-1==aobj->c) { H("memory violation flag dc(%ld) aborted \n",aobj); } else { if(!--aobj->c) dec(aobj); } } else dm(aobj); } } void dec(A aobj) { aobj->c=-1; if(aobj->tt==Et)DO(aobj->n,dc((A)aobj->p[i])) else if(aobj->t==Xt)DO(aobj->r,dc((A)aobj->d[i])) else ef(*aobj->p),mf((I *)(aobj->p[aobj->n+1])); mf((I *)aobj); } void ef(I arg) { E epr; if(!QE(arg)){dc((A)arg);R;} epr=XE(arg); DO(epr->n,ef(epr->a[i])); ef(epr->f); mf((I *)epr); } I *k_tm(I n){Z I *ta=0;if(ta)mf(ta);R ta=n?ma(n):0;} void mv(I *dest,I *src,I n){DO(n,*dest++=*src++)} C *tst(I t,I *d,I j,I *s,I k,I n){switch(t){ CSR(It,DO(n,*d=*s;d+=j;s+=k)R(C*)d;) CSR(Et,DO(n,*d=ic((A)*s);d+=j;s+=k)R(C*)d;) CSR(Ft,{F *a=(F*)d;F *b=(F*)s;DO(n,*a=*b;a+=j;b+=k)R(C*)a;}) CSR(Ct,{C *a=(C*)d;C *b=(C*)s;DO(n,*a=*b;a+=j;b+=k)R(C*)a;})} R 0;} /* --- tmv() moved to tmp_nopipe.c ---- */ /* #ifdef HPC_PWR2_TMV */ /* C *tmv(I t,I *d,I *s,I n){switch(t){ */ /* CSR(It,d=(I*)hpc_mv_i(d,s,n);R(C*)d;) */ /* CSR(Et,DO(n,*d++=ic((A)(*s++)))R(C*)d;) */ /* CSR(Ft,{F *a=(F*)d;F *b=(F*)s;a=(F*)hpc_mv_f(a,b,n);R(C*)a;}) */ /* CSR(Ct,{C *a=(C*)d;C *b=(C*)s;a=(C*)hpc_mv_c(a,b,n);R(C*)a;})} R 0;} */ /* #else */ /* C *tmv(I t,I *d,I *s,I n){switch(t){ */ /* CSR(It,DO(n,*d++=*s++)R(C*)d;) */ /* CSR(Et,DO(n,*d++=ic((A)(*s++)))R(C*)d;) */ /* CSR(Ft,{F *a=(F*)d;F *b=(F*)s;DO(n,*a++=*b++)R(C*)a;}) */ /* CSR(Ct,{C *a=(C*)d;C *b=(C*)s;DO(n,*a++=*b++)R(C*)a;})} R 0;} */ /* #endif */ C *ttmv(I t,I *d,I *s,I n){C *x=tmv(t,d,s,n);if(Ct==t)*x='\0';R 0;} C *trp(I t,I *d,I *s,I n){R tst(t,d,1,s,0,n);} /* * The zer() function has been kludgified. The arguments are (t,d,n), * where t is the type of data, d is a C* to the start of data, and n * is how many data to set to an "empty" value. The kludge involves * t==Et+1, which indicates symbolic data, and fills with mts instead * of aplus_nl, which is used if Et==t. * * zer() is used in several functions, and it is possible that this * change has introduced a bug. However, I am pretty sure that Et+1 * is outside of the range of t, heretofar. */ Z F f=0.0; Z C c=' '; C *zer(I t,I *d,I n){ R trp((t==Et+1)?Et:t,d,t==Ct?(I *)&c:t==Et+1?&mts:t==Et?(I *)&aplus_nl:(I *)&f,n);} I zr(A a){zer(a->t,(I *)a->p,a->n);R(I)a;} I tr(I r,I *d){I n,*t;if(!r)R 1;for(t=d+r,n= *d;++d0x7FFFFFFF?-1:(I)s;} */ I tr1(I r,I *d) { F s=1; I t; if(r<0) DO(-r,s*=*d) else DO(r,if(s*=t=*d++,t<0)R -1) R s>(LONG_MAX-1)?-1:(I)s; } /* #define GA(_t,_r,_n,x) {I _f=_t==Ct;A z=(A)mab(_f+AH+Tt(_t,_n)); \ */ /* z->c=1,z->t=_t,z->r=_r,z->n=_n;x; \ */ /* if(_f)((C*)z->p)[_n]=0;R z;} */ #define GA(_t,_r,_n,x) \ {\ I _f=_t==Ct;A z=(A)mab(_f+AH+Tt(_t,_n)); \ z->c=1,z->t=_t,z->r=_r,z->n=_n;x; \ if(_f)((C*)z->p)[_n]=0; \ R z;} /* GA_OA overallocates by the max of 2*n or 10 meg */ #define GA_OA(_t,_r,_n,x) \ {\ I aSize,_f=_t==Ct;\ A z;\ aSize=AH+Tt(_t,_n);\ aSize=((2*aSize)<(10*1024*1024)) ? (2*aSize) : (aSize+(10*1024*1024));\ z=(A)mab(_f+aSize); \ z->c=1,z->t=_t,z->r=_r,z->n=_n;x; \ if(_f)((C*)z->p)[_n]=0; \ R z;} #define GA3(_t,_r,_n ) {I _f=_t==Ct;A z=(A)mab(_f+AH+Tt(_t,_n)); \ z->c=1,z->t=_t,z->r=_r,z->n=_n; \ if(_f)((C*)z->p)[_n]=0;R z;} A gm(I t,I m,I n)GA(t,2,m*n,*z->d=m;z->d[1]=n) A gv(I t,I n)GA(t,1,n,*z->d=n) A gd(I t,A a)GA(t,a->r,a->n,mv(z->d,a->d,a->r)) A ga(I t,I r,I n,I *d)GA(t,r,n,mv(z->d,d,r)) A ga_oa(I t,I r,I n,I *d)GA_OA(t,r,n,mv(z->d,d,r)) A gc(I t,I r,I n,I *d,I *p)GA(t,r,n,mv(z->d,d,r);ttmv(t,z->p,p,n)) A gi(I i)GA(It,0,1,*z->p=i) A gs(I t)GA3(t,0,1) A gf(F f)GA(Ft,0,1,*(F*)z->p=f) A ge(I x){A z=gs(Et);*z->p=x;R z;} #define EV(z) {I t;switch(aplusMask&z){CS(0,ic((A)z))CS(3,z=ee(XE(z)))\ CS(1,ic((A)(z=(I)gt(XV(z)))))CS(5,for(;!(t=X[U(z)]);)err(4,(A)z);ic((A)(z=t)))}} #if 0 I ev(I z){if(q)err(q,(A)(QE(z)?XE(z)->f:z));EV(z) R z;} #else I ev(I z){ if(q) err(q,(A)(QE(z)?XE(z)->f:z)); { I t; E etmp; I itmp; switch(aplusMask&z){ CS(0,ic((A)z)) case 3: itmp = (I)(z)&~aplusMask; etmp = (E)itmp; z=ee(etmp); break; CS(1,ic((A)(z=(I)gt(XV(z))))) CS(5,for(;!(t=X[U(z)]);)err(4,(A)z);ic((A)(z=t))) } } R z; } #endif extern I PX(I,I),(*PN[])(E),(*P1[])(I,I),(*P2[])(I,I,I); I ee(E expr) { I z = 0,i,n,fnc; fnc = expr->f; if(QN(fnc)) R(*PN[U(fnc)])(expr); for(i=n=expr->n;i;*--Y=z) { z=expr->a[--i]; EV(z); } EV(fnc); if(QA(fnc)) { ++n; *--Y=fnc; if(((A)fnc)->t>Xt+1) R z=(I)ga(Xt,n,0L,Y),Y+=n,z; z=af(n); } else { i=U(fnc); EQ(0,QX(fnc)?(i?PX(i,n):xin((A)*Y,n-1,(A)0)): n==2?(*P2[i])(*Y,Y[1],i):(*P1[i])(*Y,i)); } DO(n,dc((A)(*Y++))); R z; } I fa(I fnc,I a,I w) { I z,i,at,wt=0,n=w?2:1; if(w)*--Y=w,wt=(I)Y; *--Y=a,at=(I)Y; if(QA(fnc))ic((A)(*--Y=fnc)),z=af(++n); else { i=U(fnc); EQ(0,QX(fnc)?PX(i,n):n==2?(*P2[i])(*Y,Y[1],i):(*P1[i])(*Y,i)); } if(w)wtOnExit=((A)*(I*)wt)->t; atOnExit=((A)*(I*)at)->t; DO(n,dc((A)(*Y++))); R z; } Z void es(E e,I n,I a){e->a[n]=a?a:(I)aplus_nl;} Z I ms(I s){A z=gs(Et);R *z->p=MS(s),(I)z;} A af4(A f,I a,I b,I c,I d,V v){ I z=b?0:3,x=0,y=0,n=QA(f)&&f->t==Xt+1&&f->r-1<7-z?f->r-1:0; E e=(E)ma(2+n); e->n=n,e->f=(I)f;if(n>4-z)if(y=ms((I)v->s),x=ms((I)v->cx->s),z)b=x,c=y; switch(n){case 6:es(e,5,y);case 5:es(e,4,x);case 4:es(e,3,d); case 3:es(e,2,c);case 2:es(e,1,b);case 1:es(e,0,a); } R a=(I)ez(ME(e)),xrr(),mf((I *)e),dc((A)x),dc((A)y),(A)a; } A un(A *v){ A a=*v; if(a->c>1||!a->c&&!isWritableFile((I)a)) *v=gc(a->t,a->r,a->n,a->d,a->p),dc(a); R *v;} #ifndef BSTUB extern I MZ[]; #endif Z I app(A *z,A w){ A a=un(z); Q(!a->r||(w->r)>(a->r),ERR_RANK) { XA;I wr=w->r,wn=w->n,*wd=w->d; I r=0,n=0,d[9],u; C *end; if(ar&&wr) if(ar==wr) { Q(cm(ad+1,wd+1,ar-1),ERR_LENGTH) mv(d,wd,r=wr), n=*ad; }else{ Q(ar-wr!=1,ERR_RANK) Q(cm(ad+1,wd,ar-1),ERR_LENGTH) } if(wrc) Q(*d>a->i,ERR_MAXITEMS) #ifdef BSTUB else if(AH+Tt(at,n)+(at==Ct)+sizeof(long)>(((I*)a)[-1])) { /* printf("ga(%ld,%ld,%ld,%ld)\n",at,ar,n,ad); */ /* Use ga_oa to overallocate storage */ *z=ga_oa(at,ar,n,ad), tmv(at,(*z)->p,a->p,an), dc(a), a=*z; /* printf("AH+Tt(at,n)+(at==Ct)+sizeof(long)=%d z[-1]=%d\n", */ /* (AH+Tt(at,n)+(at==Ct)+sizeof(long)),((I*)a)[-1]); */ } #else else if(AH+Tt(at,n)+(at==Ct)+sizeof(long)>sizeof(long)*MZ[255&((I*)a)[-1]]) { /* printf("ga(%ld,%ld,%ld,%ld)\n",at,ar,n,ad); */ *z=ga_oa(at,ar,n,ad), tmv(at,(*z)->p,a->p,an), dc(a), a=*z; } #endif end = (!u) ? tmv(at,(I *)(((C*)a->p)+Tt(at,an)),w->p, wn): trp(at,(I *)(((C*)a->p)+Tt(at,an)),w->p, wn); if(Ct==at) *end='\0'; a->n=n,*a->d=*d; R(I)w; } } Z I in(A *z,I g,I f,A a,A w,I r) { A aobj; I j=(*z)->t; if(j!=w->t&&(!(w=j==Ft?ep_cf(2):j==It?ci(2):(q=6,(A)0))))R 0; if(g) { if(f){a=(A)*a->p;Q(cm(w->d,a->d,a->r),8)} R app(z,w); } aobj=un(z); if(!r)R xr(aobj,a,w); j = w->n!=1 ; if(j) { Q(w->r!=a->r,7); Q(cm(w->d,a->d,w->r),8); } I1{ I *ap=a->p,t=w->t,n=a->n; P p; C *wp=(C*)w->p; p.i=aobj->p; j=Tt(t,j); DO(n, Q((unsigned long)(n=*ap++)>=aobj->n,10); switch(t) { CS(It,p.i[n]=*(I*)wp); CS(Ft,p.f[n]=*(F*)wp); CS(Ct,p.c[n]=*wp); CS(Et,dc(p.a[n]);p.i[n]=ic(*(A*)wp)); } wp+=j; ); R 1; } } I pcb(V v,I d,I i,I p){I a;if(!(Sf&&v->p))R d;if(dbg_tpcb)cbtrc(v,1); R a=(I)af4((A)v->p,v->q,d,i,p,v),dc((A)d),a;} I prcb(V v,I d,I i,I p){I a;if(!(Sf&&v->rpf))R d;if(dbg_tprcb)cbtrc(v,3); R a=(I)af4((A)v->rpf,v->rpc,d,i,p,v),dc((A)d),a;} Z I enc(I a){A z=gs(Et);R *z->p=a,(I)z;} Z I gap(A a,A w){I v=a->r&&a->r==w->r,n=v?*w->d:1;A z=v?gv(It,n):gs(It); DO(z->n,z->p[i]=*a->d+i)R enc((I)z);} Z I gia(A i,I r){R!r&&i&&i->ta,4); if(p){z=(I*)pka(p,(A *)v);if(q)R err(q,(A)MP(36)),0;}else z=(I*)v; if(QE(i))Q(!(i=*Y=(I)e0(XE(i),(A)*z)),9); if(f) { Q(g&&0==((A)(*z))->r,7); i=*Y=g?gap((A)*z,(A)d):gia((A)i,r); Y[2]=d=prcb(v,d,i,(I)p); if(!d)R 0; Y[2]=d=pcb(v,d,i,(I)p); if(!d)R 0; Q(!p&&!i&&v->o&&!vfy(v,(A)d),17); } if(!z)R 0; a=!i?(dc((A)*z),*z=ic((A)d)):in((A *)z,g,f,(A)i,(A)d,r); if( msyncMode && v && v->a && QA(v->a) && ((A)(v->a))->c==0 && ((A)(v->a))->t<4) { A a=(A)v->a; I an=a->n; I at=a->t; if(g) { /* append assigment */ I bytesAdded=Tt( ((A)d)->t, ((A)d)->n); C *addr1=( ((C*)a->p) + Tt(at,an)) - bytesAdded; C *addr2=PAGE_ALIGN(addr1); bytesAdded += addr1-addr2; /* printf("msync: v->a:0x%x actual:=0x%x aligned:=0x%x bytes=%u\n", */ /* v->a, addr1, addr2, bytesAdded); */ if(-1==msync( addr2, bytesAdded, msyncFlag)) /* data */ perror("upd data: msync"); if(-1==msync( (C*)a, AH, msyncFlag)) /* header */ perror("upd header: msync"); } else { /* msync data */ /* if(-1==msync((A)v->a, mf_length((A)v->a), msyncFlag)) */ if(-1==msync((C*)a, AH+Tt(at,an), msyncFlag)) perror("upd: msync"); }; } if(!a||!f)R a; i=*Y;d=Y[2]; if(2>=v->z)inv(v,r?0:i,0); if(2>v->z) { if(Sf&&v->f){ if(dbg_tscb)cbtrc(v,0);v->z=2,dc(af4((A)v->f,v->c,d,i,(I)p,v));} if(Sf&&v->rff){ if(dbg_trcb)cbtrc(v,2);v->z=2,dc(af4((A)v->rff,v->rfc,d,i,(I)p,v));} val(v); } if(o&&v->o)xup(v,(A)d,(A)i,p,r,DependencyEvaluationSemaphore?0:1); /* call xup() unless in the middle of re-evaluation */ R q?0:1; } I set(I x,I a,I o) { I r; R *--Y=a,*--Y=0,*--Y=0,r=upd(x,a,0,0,0,o),dc((A)Y[2]),Y+=3,r; } I aset(I v,I d,I i,I p) { I r; Y-=3,*Y=i?ic((A)i):0,r=upd(MV(v),Y[2]=d,i,(A)p,0,1); dc((A)Y[2]),dc((A)*Y),Y+=3; R xrr(),r; } Z I lst(I n,I *p,A w) { Q(w->r>1,7)Q(w->r&&w->n!=n,8); DO(n,if(!set(p[i],pck(i*w->r,w),0))R 0); DO(n,if((!q)&&QV(p[i])&&(XV(p[i]))->o)xup(XV(p[i]),(A)(XV(p[i]))->a,0,0,0,1)); if(q)R 0; DO(n,if(QV(p[i]))val(XV(p[i]))); R 1; } #define Q1(x,n) if(x){R dc(c),dc(v),q=n,0;} Z I pea(E e,A w) { I f=e->n-1,n,*va,z=1; A c=(A)(f?ev(*e->a):0),v=(A)ev(e->a[f]); Q1(!QA(v)||Et<(v)->t,18); n=v->n; Q1(v->r>1,7); Q1(n&&!sym(v),9); if(f) { Q1(c->r>1,7); Q1(c->n&&!sym(c),9); Q1(v->r&&c->r&&c->n!=n,8); if(c->r)n=c->n; } if(n) { va=ma(n); DO(n,va[i]=MV(sv(f?cxi(XS(c->p[i*c->r])):Cx,XS(v->p[i*v->r])))); z=lst(n,va,w); mf(va); } R dc(c),dc(v),z; } Z I mrg(I e){R *--Y=0,*--Y=0,e=mr0((E)e),dc((A)*Y++),dc((A)(*Y++)),e;} /* #if defined(__SVR4) || defined(_SYSTYPE_SVR4) || defined(__VISUAL_C_2_0__) */ #if 1 I xis(E e) { I n=e->n-1,a=*e->a,w=e->a[n]; /* EV(w) */ /* printf("In xis, n = %ld, a = %ld, w = %ld\n", n, a, w) ; */ /* printf("aplusMask&w = %ld\n", aplusMask&w) ; */ { I t; E etmp; I itmp; switch(aplusMask&w){ CS(0,ic((A)w)) CS(1,ic((A)(w=(I)gt(XV(w))))) case 3: itmp = (I)(w)&~aplusMask; etmp = (E)itmp; /* printf("w = ee(%ld)\n", itmp) ; */ w=ee(etmp); /* printf("after ee(), w = %ld\n", w) ; */ break; case 5: while (!(t=X[U(w)])) err(4, (A)w) ; ic((A)(w=t)) ; break ; /* CS(5,for(;!(t=X[U(w)]);)err(4,(A)w);ic((A)(w=t))) */ } } /* printf("w = %ld\n", w) ; */ if(!n) { Glbrtn = (void *)w ; longjmp(J,(int)w); } for(*--Y=w; !(!QE(a)?set(a,ic((A)w),1): (e=XE(a),e->f==MN(7))?lst(e->n,e->a,(A)w): peak(e->f)?pea(e,(A)w): mrg((I)e));) err(q,(A)MN(0)); R *Y++; } #else I xis(E e) { I n=e->n-1,a=*e->a,w=e->a[n]; EV(w)if(!n)_longjmp(J,w); for(*--Y=w; !(!QE(a)?set(a,ic((A)w),1): (e=XE(a),e->f==MN(7))?lst(e->n,e->a,(A)w): peak(e->f)?pea(e,(A)w): mrg((I)e));) err(q,(A)MN(0)); R *Y++; } #endif Z A e0(E e,A a) { I *r=e->a+e->n-1; A z=gd(It,a); I t=*r; DO(z->n,z->p[i]=i); R *r=(I)z,a=(A)ez(ME(e)),dc(z),*r=t,a; } Z I xli(E e) { A z; I n=e->n-1; W(gv(Et,n)); *--Y=zr(z); for(;n--;)z->p[n]=ev(e->a[n+1]); R ++Y,(I)z; } Z S ss(I x){A a=(A)ev(x);S s=(!a->r&&sym(a))?XS(*a->p):0;dc(a);R s;} Z I mr0(E e) { I y=0,f=e->f,n,r=0; if(f!=MP(36)&&f!=MP(74)) { n=e->n-1; if(QE(y=f==MX(0)?*e->a:e->a[n])&&(r=XE(y)->f==MP(22)))y=*XE(y)->a; *Y=f==MP(20)?ev(*e->a):f!=MX(0)?(r=1,ME(e)):n==1?ev(e->a[1]):xli(e); if(QE(y))e=XE(y),f=e->f; } if(f==MP(36))if(y=e->a[1],Y[1]=ev(*e->a),QE(y=e->a[1]))e=XE(y),f=e->f; if(f==MP(74)) { S s=ss(e->a[n=e->n-1]),c=n?ss(*e->a):0; Q(!s||n&&!c,9); y=MV(sv(n?cxi(c):Cx,s)); } R upd(y,Y[2],*Y,(A)Y[1],r,1); } aplus-fsf-4.22/src/a/m.c0000644000265000001440000002750110772770357010451 /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #include #include #include #include #include #ifndef __s390__ #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef __sgi #include #endif extern I dbg_twa; /* ---------------------------------------------------- */ /* reliable version of signal(), using POSIX sigaction().*/ /* From: "Advanced Programming in the Unix Environment */ /* Author W. Richard Stevens, 1992 page 298 */ typedef void Sigfunc(int); /* 4.3BSD Reno doesn't define SIG_ERR */ #if defined(SIG_IGN) && !defined(SIG_ERR) #define SIG_ERR ((Sigfunc *)-1) #endif Sigfunc * aplus_signal(int signo, Sigfunc *func) { struct sigaction act, oact; act.sa_handler = func; sigemptyset(&act.sa_mask); act.sa_flags = 0; if(signo == SIGALRM) { #ifdef SA_INTERRUPT act.sa_flags |= SA_INTERRUPT; /* SunOS */ #endif } else { #ifdef SA_RESTART act.sa_flags |= SA_RESTART; /* SVR4, 4.3+BSD */ #endif } if(sigaction(signo, &act, &oact) < 0) return(SIG_ERR); else return(oact.sa_handler); } /* ---------------------------------------------------- */ I ep_all(void); Z int mkt(C *); I map(int,int); void aplus_nan(void); #ifndef HAVE_STRERROR extern char *sys_errlist[]; extern int sys_nerr; #endif I log_EWouldBlock(I i,I rc,I nern,C *path,C *fcn) { /* NOTE: use "tries" instead of "EWOULDBLOCKs" for user messages */ if(-1==rc){ if(EWOULDBLOCK==nern){ syslog(LOG_NOTICE, "A+ %s failed for '%s' after %d EWOULDBLOCKs",fcn,path,i); H("\343 A+ %s failed for '%s' after %ld tries\n",fcn,path,i); } else { #ifndef HAVE_STRERROR syslog(LOG_INFO, "A+ %s failed for '%s' after %d EWOULDBLOCKs with: %m",fcn,path,i); H("\343 A+ %s failed for '%s' after %ld tries with: %s\n", fcn,path,i,(nernst)st*=2;++i;} if (i) errno=log_EWouldBlock(i,rc,errno,path,fcn); R rc; } Z int lostat(C *path,struct stat *buf) { int i=0,st=1,rc=0; static C fcn[] = "stat"; if(!path) R -1; while(i<10&&-1==(rc=stat(path,buf))&&EWOULDBLOCK==errno) {sleep(st);if(8>st)st*=2;++i;} if (i) errno=log_EWouldBlock(i,rc,errno,path,fcn); R rc; } Z int lofstat(int fd,struct stat *buf) { int i=0,st=1,rc=0; static C fcn[] = "fstat"; while(i<10&&-1==(rc=fstat(fd,buf))&&EWOULDBLOCK==errno) {sleep(st);if(8>st)st*=2;++i;} if (i) errno=log_EWouldBlock(i,rc,errno,"...",fcn); R rc; } Z int lofchmod(int fd, mode_t mode) { I i=0,st=1,rc=0; static C fcn[] = "fchmod"; while(i<10&&-1==(rc=fchmod(fd,mode))&&EWOULDBLOCK==errno) {sleep(st);if(8>st)st*=2;++i;} if (i) errno=log_EWouldBlock(i,rc,errno,"...",fcn); R rc; } #ifdef __sgi jmp_buf ovli_b; /* stuffed by setjmp in ovli_mips.s */ Z void sigfpe(int i) /* enabled by "add" instruction in ovli_mips.s */ { siglongjmp(ovli_b, 1); } /* jss */ #endif Z I qw; Z void sigi(int i){q=1;} Z void sigv(int i){qs="segv";aplus_err(-1,0);} Z void sigb(int i){qs="bus";aplus_err(-1,0);} I syst(C *s){I r;qw=0,r=system(s),qw=1,r;if(r==-1)H("%ld\n",r);R r;} Z struct stat b; void gwd(C *s) { Z C r[99]; Z dev_t d; Z ino_t i; lostat(".",&b); if(d!=b.st_dev||i!=b.st_ino) d=b.st_dev,i=b.st_ino,qw=0,getcwd(r,99),qw=1; strcpy(s,r); } I setStickyBit(int f,int x) { lofstat(f,&b); R lofchmod(f,(x?S_ISVTX:0x00)|b.st_mode); } void siginit(void) { coreLimSet(0); aplus_signal(SIGPIPE,SIG_IGN); aplus_signal(SIGINT,sigi); aplus_signal(SIGSEGV,sigv); aplus_signal(SIGBUS,sigb); #if defined(__sgi) aplus_signal(SIGFPE,sigfpe); /* jss */ #endif #if defined(__osf__) aplus_signal(SIGFPE, SIG_IGN) ; #endif aplus_nan(); } Z int sigvFlag=0, sigbFlag=0; A getSigv(void){R gi(sigvFlag);} A getSigb(void){R gi(sigbFlag);} #if defined(_AIX) Z sigFullDump(int signo) { struct sigaction s; s.sa_handler = SIG_DFL; s.sa_mask.losigs = 0; s.sa_mask.hisigs = 0; s.sa_flags = SA_FULLDUMP; sigaction(signo,&s,(struct sigaction *) NULL); } void setSigv(I flag){sigvFlag=(0==flag)?0:(2==flag)?2:1; switch(sigvFlag){CS(0,aplus_signal(SIGSEGV,sigv))CS(1,aplus_signal(SIGSEGV,SIG_DFL)) CS(2,sigFullDump(SIGSEGV))}} void setSigb(I flag){sigbFlag=(0==flag)?0:(2==flag)?2:1; switch(sigbFlag){CS(0,aplus_signal(SIGBUS,sigv))CS(1,aplus_signal(SIGBUS,SIG_DFL)) CS(2,sigFullDump(SIGBUS))}} #else void setSigv(I flag){sigvFlag=(0==flag)?0:(2==flag)?2:1; if(sigvFlag)aplus_signal(SIGSEGV,SIG_DFL);else aplus_signal(SIGSEGV,sigv);} void setSigb(I flag){sigbFlag=(0==flag)?0:(2==flag)?2:1; if(sigbFlag)aplus_signal(SIGBUS ,SIG_DFL);else aplus_signal(SIGBUS ,sigv);} #endif Z int f[9]; Z I j=0,k=0; Z C z[]="/var/atmp/0/aXXXXXX",c[]="/var/atmp/0"; I suppressFpeDomain=0; I nExternalFPE=0; #if !defined(_AIX) && !defined(HAVE_SVR4) Z void sigf(void){if(suppressFpeDomain)++nExternalFPE; else q=9;} #endif #include #if defined(_AIX) || defined(HAVE_SVR4) || defined(linux) || defined(_HP) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__) #ifdef __sgi Z unsigned k1=0x20000000,k2=0x100000; #else Z unsigned k1=0x40000000,k2=0x100000; #endif void aplus_nan(void){} I map(int f,int mode) { I junk=0, *p; I iseek ; /*read(f,&junk,sizeof(I)); *printf("%ld\n", junk) ; */ /* cokelley 64 hack */ #if (_MIPS_SZLONG == 64) /* printf("64 bit mips version of mmap\n") ; */ iseek = lseek64(f, 0, SEEK_END) ; #else iseek = lseek(f, 0, SEEK_END) ; #endif /* printf("Calling mmap(0, %ld, ..., %d, 0\n", iseek, f) ; */ #if defined(__osf__) p=(I *)mmap(0,iseek,PROT_READ|(BEAM_RO==mode?0:PROT_WRITE), MAP_FILE||(BEAM_LOCAL==mode)?MAP_PRIVATE:MAP_SHARED,f,0); #else p=(I *)mmap(0,iseek,PROT_READ|(BEAM_RO==mode?0:PROT_WRITE), (BEAM_LOCAL==mode)?MAP_PRIVATE:MAP_SHARED,f,0); #endif /* printf("mmap returned: %ld\n", p) ; */ if ( p == MAP_FAILED) { perror("mmap failed") ; p=0; /* fail return value */ } /* printf("%ld\n", p[0]) ; * if(BEAM_RO!=mode)p[0]=junk; * printf("%ld\n", p[0]) ; */ close(f);R (I)p; } #else Z unsigned k1=0x4000000,k2=0x100000; #ifdef __VISUAL_C_2_0__ void aplus_nan(void) { } #elif defined(__osf__) void aplus_nan(void) { } #else void aplus_nan(void){ieee_handler("set","invalid",sigf);/*ieee_handler("set","division",sigf);*/} #endif /* I map(int f,int i){I p=(I)mmap(0,lseek(f,0,2),PROT_READ|(i?PROT_WRITE:0),i&2?MAP_PRIVATE:MAP_SHARED,f,0);close(f);R p;} */ #endif I setk1(I megs){k1=megs<<20;R k1;} /* Set Default atmp flags */ #if defined(_WS_ATMP_NORESERVE) static int mmapAtmpFlags= MAP_PRIVATE|MAP_NORESERVE|MAP_FIXED; #else static int mmapAtmpFlags= MAP_SHARED|MAP_FIXED; #endif static int atmpFromHeap=0; void setAtmpMmapFlags(atmpMode) int atmpMode; { if( atmpMode == WS_ATMP_HEAP ) atmpFromHeap=1; else if( atmpMode == WS_ATMP_SHARED ) mmapAtmpFlags= MAP_SHARED|MAP_FIXED; else if( atmpMode == WS_ATMP_PRIVATE ) mmapAtmpFlags= MAP_PRIVATE|MAP_FIXED; else if( atmpMode == WS_ATMP_NORESERVE ) #if defined(_AIX) mmapAtmpFlags= MAP_PRIVATE|MAP_FIXED; #elif defined(__osf__) mmapAtmpFlags = MAP_PRIVATE | MAP_FIXED ; #elif defined(__sgi) mmapAtmpFlags= MAP_PRIVATE|MAP_AUTORESRV|MAP_FIXED; #else mmapAtmpFlags= MAP_PRIVATE|MAP_NORESERVE|MAP_FIXED; #endif } int flen(int f,off_t n) { int z; if(-1==(z=ftruncate(f,n))) perror("ftruncate failed"); R z; } int atmpMissing() { c[10]='0'; return loaccess(c,6) ? 1 : 0; } void wi(void) { if( atmpFromHeap ) return; for(;!loaccess(c,6);z[10]=c[10]='0'+ ++j) f[j]=mkt(z); } /* #define mapf(f,o) (I)mmap((caddr_t)k1,(size_t)k2,PROT_READ|PROT_WRITE, \ */ /* MAP_SHARED|MAP_FIXED,f,(off_t)o) */ /* Change from MAP_SHARED to MAP_PRIVATE to improve performance */ #define mapf(f,o) mmap((caddr_t)k1,(size_t)k2,PROT_READ|PROT_WRITE, \ mmapAtmpFlags,f,(off_t)o) Z I wsm(I m) { /* I p=k1,z=(k+m+j-1)/j*k2; */ /* DO(j,flen(f[i],z)); */ /* DO(m,if(-1==mapf(f[k%j],k2*(k/j)))R -1;++k;k1+=k2); */ /* R p; */ I i,p=k1; off_t z=(k+m+j-1)/j*k2; for(i=0; i0)R tmp(k<<20); if(k==-2)mc(); p=(I*)mz(); DO(31,j=p[i];n+=j*MZ[i];if(k!=-1)H("%d ",j)); if(k!=-1)H("\n%u %u: ",tw,ep_all()); H("%u\n",n<<2); R -1; } #endif I twGet(void){R tw;} I ep_all(void){I s=0;if(!j)R tw;DO(j,lofstat(f[i],&b);s+=512*b.st_blocks)R s;} /*!!*/ I unloadable(C *s,I m) { struct stat ss; if(loaccess(s,m))R 1; if(lostat(s,&ss))R 1; if(S_ISDIR(ss.st_mode))R 1; R 0; } #ifdef _WIN32 C *pfind(C *v,C *d,C *f,I m) { Z C s[MAXPATHLEN]; C pathDelim=';'; /* default path delimiter */ C subDirDelim[2]={"\\"}; /* default dir delimiter */ if( f[1]==':' || *f=='/' ) /* Fully qualified /... or d:... */ R unloadable(f,m)?0:f; if( v && (v=getenv(v)) ) /* Retrieve PATH environment var */ d=v; if( v && strchr(v,'/') ){ /* Change to Unix style */ pathDelim=':'; dirDelm='/'; } while(d) { if(v=(C *)strchr(d,pathDelim)) *s=0,strncat(s,d,v-d),d=v+1; else strcpy(s,d),d=0; strcat(s,subDirDelim),strcat(s,f); if(!unloadable(s,m)) R s; } R 0; } #else C *pfind(C *v,C *d,C *f,I m) { Z C s[MAXPATHLEN]; if(*f=='/')R unloadable(f,m)?0:f; for((v&&(v=getenv(v)))?d=v:0;d;) { if(v=(C *)strchr(d,':'))*s=0,strncat(s,d,v-d),d=v+1; else strcpy(s,d),d=0; strcat(s,"/"),strcat(s,f); if(!unloadable(s,m))R s; } R 0; } #endif aplus-fsf-4.22/src/a/n.c0000644000265000001440000002153310772770357010451 /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #include #include #include #include #include #include #include #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__) # include #else # include #endif #include #include #include #include #if !defined(HAVE_SVR4) && !defined(_AIX) #include #define GET_MILLISEC(t) ((t).tv_sec*1000+10*((t).tv_usec/10000)) #endif #ifdef __VISUAL_C_2_0__ int gettimeofday __P((struct timeval *, struct timezone *)); #define xfpechk(a1,a2) #endif extern I dbg_depth,dbg_tmdo,dbg_tx,dbg_ts,dbg_xfpe; extern I nExternalFPE, suppressFpeDomain; typedef struct{I u,s,e;}B;Z B t0;Z A ta;Z I tn,td[2]={0,4},**tp,tj;Z I e0; /* On non SVR4 systems times() returns only a return code (0 or -1) */ /* instead of the elapsed time. In this case gettimeofday() is called */ /* to get the elapsed time, which is derived from a struct timeval */ Z B ti(void) { Z struct tms r; B t; Z int clkTck=0; #if defined(HAVE_SVR4) || defined(_AIX) if(clkTck==0) clkTck=sysconf(_SC_CLK_TCK); /* clock ticks per second */ t.e=((1000*times(&r))/clkTck)-e0; /* elapsed */ #else Z struct timeval tp; Z struct timezone tzp; if(clkTck==0) clkTck=sysconf(_SC_CLK_TCK); /* clock ticks per second */ times(&r); gettimeofday(&tp,&tzp); /* need for elapsed */ t.e=GET_MILLISEC(tp)-e0; /* elapsed */ #endif t.u=(1000*r.tms_utime)/clkTck; /* user */ t.s=(1000*r.tms_stime)/clkTck; /* system */ R t; } void te(void){e0=ti().e;} Z B tz(B x,B y){B t;R t.u=x.u-y.u,t.s=x.s-y.s,t.e=x.e-y.e,t;} I t2(I n,I i){B t;I*p=((A)ta->p[1])->p;if(i)++p[4*n];t0=tz(t=ti(),t0); R p+=4*tn+1,*p+=t0.u,p[1]+=t0.s,p[2]+=t0.e,t0=t,i=tn,tn=n,i;} Z I n_gt(B t){A z=gv(It,3);R(*(B*)z->p)=t,(I)z;} Z H1(t1){ I n=a->n; A z; if(tj){DO(tj,if(tp[i])*tp[i]=0)dc(ta),ta=0;} tj = n ; if(tj) { V v; *td=++n,z=(A)zr(ga(It,2,n*4+tj,td)); tp=(I**)z->p+(z->n=n*4); ta=gv(Et,2),*ta->p=ic(a),ta->p[1]=(I)z; DO(tj,if(v=sv(Cx,XS(a->p[i])),(z=(A)(v->e?v->e:v->a))&&QA(z)&&Ett) *(tp[i]=z->p+z->n)=i+1); } R t0=ti(),ic(a); } #define N(f) Z I f(E e) Z I ni(A a){I i;for(*--Y=(I)a;a->n!=1||a->t&&!(a=ci(0));a=(A)*Y)aplus_err(9,(A)MN(*K));R i=*a->p,dc((A)*Y++),i;} N(xpr){I z=(I)aplus_nl,n=e->n;++K;DO(n,*K=-1-i;dc((A)z);z=ev(e->a[i]))R --K,z;} N(xif){I z;*++K=2;z=ni((A)ev(*e->a))?ev(e->a[1]):e->n>2?(*K=1,ev(e->a[2])):(I)aplus_nl;R --K,z;} N(xwh){I z;*++K=3;for(*--Y=z=(I)aplus_nl;ni((A)ev(*e->a));*Y=ev(e->a[1]),dc((A)z),z=*Y);R --K,++Y,z;} Z void n_set(A *a,I i){if((*a)->c!=1||(*a)->t!=It||(*a)->n)dc(*a),*a=gi(i);else *(*a)->p=i;} N(xdo){ I v=*e->a,i,z=(I)aplus_nl,f=1; A *a; E exp; if(e->n==1) { ++dbg_depth; if(dbg_tmdo) mdotrc(1); z=pev(v); if(dbg_tmdo)mdotrc(0); --dbg_depth; R z; } if( QE(v) ) { exp=XE(v); if( exp->n==1 && exp->f==MP(15) ) v=*exp->a,f=0; } *++K=4; i=ni((A)ev(v)); if(QE(v)&&MN(0)==XE(v)->f) v=*XE(v)->a; a = (A*)(QV(v)?&XV(v)->a:QL(v)?X+U(v):0); if(a) n_set(a,f?0:i-1); for(v=0;va[1]),++v,a) n_set(a,f?v:i-1-v); if( !f && a ) n_set(a,i); R --K,z; } Z H2(in){ I n=a->r?*a->d:1; I r=0; for(*--Y=ic(w),*--Y=(I)a;a=(A)fnd((A)*Y,(A)Y[1]),q;) aplus_err(q,(A)MP(19)); dc((A)(*Y++)); dc((A)(*Y++)); DO(a->n,if(n>a->p[i]){r=1;break;}) dc(a); R r; } N(xca){ I *p,z; *++K=5,z=ev(*e->a),e=XE(e->a[1]),p=e->a; ++K; DO(e->n/2,*K=-1-2*i;if(in((A)ev(*p++),(A)z))break;++p); R --*K,dc((A)z),z=pa+e->n?ev(*p):(I)aplus_nl,K-=2,z; } N(xti){ B t; A a; if(!e->n) R ta?(t2(0,0),(I)gc(ta->t,ta->r,ta->n,ta->d,ta->p)):n_gt(ti());a=(A)*e->a; R QA(a)&&sym(a)||aplus_nl==a?t1(a):(t=ti(),dc((A)ev((I)a)),n_gt(tz(ti(),t))); } N(xli) { A z; I n=e->n; W(gv(Et,n)); *--Y=zr(z); for(;n--;)z->p[n]=ev(e->a[n]); R ++Y,(I)z; } Z I mx(I o,I f,I g){I d[3];*d=MN(o),d[1]=f,d[2]=g;R(I)ga(Xt,g?3:2,0L,d);} N(n_rk){R mx(8,ev(*e->a),ev(e->a[1]));} N(n_ea){A a=(A)ev(*e->a);I z;if(QF(a))R mx(9,(I)a,0L); R a->n==1&&a->t==Et&&QF(*a->p)&&!QS(*a->p)?(z=ic((A)(*a->p)),dc(a),z):(I)a;} I(*PN[])(E)={xis,xpr,xif,xwh,xdo,xca,xti,xli,n_rk,n_ea}; #define XI 10000 #define XSHTSIZE 1024 C *xfs_name[XI]={"[]"},*xfs_desc[XI]={"??"}; I xfs_valence[XI]; Z PFI xfs_fp[XI]; I xfs_type[XI],xfs_argtypes[XI]; Z I xi=0,y[8]; HT xsht; Z C *argtypes[]={"any","int","float","char","any","int","float","string", "anyscalar","scalar int","floatsc","charsc","any","int","float","char"}; Z C *cxtdotname(V v){ C *res, *cxt=v->cx->s->n, *name=v->s->n; res=(C *)malloc(2+strlen(cxt)+strlen(name));sprintf(res,"%s.%s",cxt,name);R res;} Z C *defaultdoc(const C *s,I t,I n,I *y){ C *z=(C *)malloc(128+strlen(s)); strcpy(z,s); if(n) { strcat(z,"{"); while(n--){strcat(z,argtypes[*y++]);strcat(z,";");} z[strlen(z)-1]='}'; } else strcat(z,"{}"); strcat(z," returns ");strcat(z,(8==t)?"null":argtypes[t]);R z; } Z C *installdoc(const C *s,C *d){C *z=(C*)malloc(2+strlen(s)+strlen(d)); strcpy(z,s);strcat(z,"\n");strcat(z,d);R z;} void xfs(void){C **s=xfs_name;for(;*++s;)if(**s=='_'&&(*s)[1]!='_')H("%s ",*s);NL;} void x_fs(void){C **s=xfs_name;for(;*++s;)if(**s=='_'&&(*s)[1]=='_')H("%s ",*s);NL;} I xinstall(PFI f, const C *s,I t,I n,I *y,C *d) { I p=0,i;V v;C *nm=0; if(xi==XI-1)R H("too many installs\n"),0; xfs_fp[++xi]=f,xfs_type[xi]=t,xfs_valence[xi]=n; if(n&&*y==-1)R xfs_argtypes[xi]=-1; if(n<0)n= -n;if(n>8)R --xi,H("too many arguments for %s\n",s),0; for(i=n;i-->0;)p|=y[i]<<4*i;xfs_argtypes[xi]=p; if(*s!='_')v=sv(Cx,si(s)),v->a=MX(xi),v->t=5,nm=cxtdotname(v); if (d==(C *)0) d=defaultdoc(nm?nm:s,t,n,y); else d=installdoc(nm?nm:s,d); xfs_name[xi]=(nm?nm:strdup(s)); xfs_desc[xi]=d?d:""; chtsi(xsht,xfs_name[xi],MX(xi)); R 1; } void install(PFI f,const C *s,I t,I n,I t0,I t1,I t2,I t3,I t4,I t5,I t6,I t7) { switch(abs(n)) /* xinstall() will take a negative n */ { case 8:y[7]=t7; /* intentional fall-thru switch statement */ case 7:y[6]=t6; case 6:y[5]=t5; case 5:y[4]=t4; case 4:y[3]=t3; case 3:y[2]=t2; case 2:y[1]=t1; case 1:y[0]=t0; default:break; } xinstall(f,s,t,n,y,(C *)0); } I xfpeFlag=0; #define XFIN if(xfpeFlag){suppressFpeDomain=1;} \ nExternalFPE=0; \ ++dbg_depth; \ if(dbg_tx||dbg_ts)xftrc(xfs_name[idx],0) #define XFOUT if(dbg_xfpe)xfpechk(xfs_name[idx],nExternalFPE); \ suppressFpeDomain=0; \ if(dbg_tx)xftrc(xfs_name[idx],1); \ --dbg_depth #define RA(x,p) {XFIN;z=((p)(*f))x;XFOUT; \ R !z&&q?0:t==A_?(z?(I)z:(I)aplus_nl):t==CP?(I)gsv(0,(C *)z):t==IV?(I)gi(z):(I)aplus_nl;} I PX(I idx,I n){ I i,t=xfs_type[idx],p=xfs_argtypes[idx]; PFI f=xfs_fp[idx]; I z; A a; Q(n!=xfs_valence[idx]&&xfs_valence[idx]>=0,5); if(p==-1)RA((Y,n),I(*)(I *,I)); for(i=0;i>=4,z&3) { CS(CA,ND1 Q(Ct!=a->t,6)); CS(IA,ND1 if(It!=a->t&&!(a=ci(i)))R 0); CS(FA,ND1 if(Ft!=a->t&&!(a=ep_cf(i)))R 0); } switch(z&12) { case U_:ND1 a=(A)un((A *)(Y+i)); CS(A_,y[i]=(I)a); CS(P_,ND1 y[i]=(I)a->p); CS(V_,ND1 Q(a->n!=1,8)y[i]=*a->p); } } switch(n) { CSR(0,RA((),I(*)(void))); CSR(1,RA((y[0]),I(*)(I))); CSR(2,RA((y[0],y[1]),I(*)(I,I))); CSR(3,RA((y[0],y[1],y[2]),I(*)(I,I,I))); CSR(4,RA((y[0],y[1],y[2],y[3]),I(*)(I,I,I,I))); CSR(5,RA((y[0],y[1],y[2],y[3],y[4]),I(*)(I,I,I,I,I))); CSR(6,RA((y[0],y[1],y[2],y[3],y[4],y[5]),I(*)(I,I,I,I,I,I))); CSR(7,RA((y[0],y[1],y[2],y[3],y[4],y[5],y[6]),I(*)(I,I,I,I,I,I,I))); CSR(8,RA((y[0],y[1],y[2],y[3],y[4],y[5],y[6],y[7]),I(*)(I,I,I,I,I,I,I,I))); } R -1; } void xshti(void){xsht=hti(XSHTSIZE);chtsi(xsht,xfs_name[xi],MX(xi));} A ep_xfsinfo(void) { A z=gv(Et,2); A z1,zt; z->p[0]=(I)gvi(Et,6,MS(si("xfs_name")),MS(si("xfs_desc")), MS(si("xfs_valence")),MS(si("xfs_type")), MS(si("xfs_argtypes")),MS(si("xfs_fp"))); z1=gv(Et,6); zt=gv(Et,xi);DO(xi,zt->p[i]=(I)gsv(0,xfs_name[i]));z1->p[0]=(I)zt; zt=gv(Et,xi);DO(xi,zt->p[i]=(I)gsv(0,xfs_desc[i]));z1->p[1]=(I)zt; z1->p[2]=(I)gc(It,1,xi,&xi,xfs_valence); z1->p[3]=(I)gc(It,1,xi,&xi,xfs_type); z1->p[4]=(I)gc(It,1,xi,&xi,xfs_argtypes); z1->p[5]=(I)gc(It,1,xi,&xi,(I *)xfs_fp); z->p[1]=(I)z1; R z; } aplus-fsf-4.22/src/a/nsf.c0000644000265000001440000006446310772770357011013 /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #include #ifdef __sgi /* need for param.h who include signal.h */ #define _BSD_COMPAT #endif #include #include #include #include #include #ifdef SOLARIS_CSET char *strdup(); #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #undef min #ifndef HAVE_STRERROR extern int sys_nerr; extern char *sys_errlist[]; #endif extern C Fs[]; extern C *xfs_name[], *cmdsList[], *es[]; extern A get_loadfile(); extern I xfpeFlag; #undef ENTRYPOINT #define ENTRYPOINT static #define qv0(v) ((v->a || v->e || v->f || v->c || v->p || v->q || \ v->cd || v->rff || v->rfc || v->rpf || v->rpc || \ v->scd || v->atb)?1:0) A gsym(const C *str){A z;if(!str)R(A)aplus_nl;z=gs(Et);z->p[0]=MS(si(str));R z;} Z V av(A a) { I n=a->n-1; if (!sym(a)||n>1) R (V)0; R sv(n?cxi(XS(*a->p)):Cx,XS(a->p[n])); } Z V avlu(A a,I *perr) { I n=a->n-1; *perr=0; if (!sym(a)||n>1) R *perr=1,(V)0; R svlu(n?cxlu(XS(*a->p)):Cx,XS(a->p[n])); } S symjoin(S s1,S s2){S z;C *st1=s1->n,*st2=s2->n,*buf; I n1=strlen((DEV_STRARG)st1),n2=strlen((DEV_STRARG)st2);if(strchr((DEV_STRARG)st2,'.'))R s2; buf=(C*)balloc(2+n1+n2);bcopy(st1,buf,n1);buf[n1]='.'; bcopy(st2,buf+(n1+1),n2);buf[1+n1+n2]='\0';z=si(buf);bfree(buf);R z;} S symsplit(S s,S *pcx) { C *src=strdup(s->n); C *dot=(C *)strrchr((DEV_STRARG)src,'.'); S z; if(dot) { *dot='\0'; *pcx=si(src); z=si(dot+1); } else { *pcx=si(""); z=s; } free(src); R z; } ENTRYPOINT I ep_scb(A a,A x) { V v;I f,c,i; NDC2(a,x);if(x->t!=Et||x->n!=2) ERROUT(ERR_DOMAIN); v=av(a);f=x->p[0];c=x->p[1];i=qz((A)f); if(!v) ERROUT(ERR_DOMAIN); if(!(QF(f)&&!QS(f))&&!i) ERROUT(ERR_NONFUNCTION); dc((A)v->f),v->f=i?0:ic((A)f),dc((A)v->c),v->c=ic((A)c); R 0; } ENTRYPOINT A ep_gcb(A a) { A z;V v;I err; NDC1(a);v=avlu(a,&err); if(!v) if(err){ERROUT(ERR_DOMAIN);}else R 0; if(!v->f)R 0; R z=gv(Et,2),*z->p=ic((A)v->f),z->p[1]=ic((A)v->c),(A)z; } ENTRYPOINT I ep_spcb(A a,A x) { V v;I f,c,i; NDC2(a,x);if(x->t!=Et||x->n!=2) ERROUT(ERR_DOMAIN); v=av(a);f=x->p[0];c=x->p[1];i=qz((A)f); if(!v) ERROUT(ERR_DOMAIN); if(!(QF(f)&&!QS(f))&&!i) ERROUT(ERR_NONFUNCTION); dc((A)v->p),v->p=i?0:ic((A)f),dc((A)v->q),v->q=ic((A)c); R 0; } ENTRYPOINT A ep_gpcb(A a) { A z;V v;I err; NDC1(a);v=avlu(a,&err); if(!v) if(err){ERROUT(ERR_DOMAIN);}else R 0; if(!v->p)R 0; R z=gv(Et,2),*z->p=ic((A)v->p),z->p[1]=ic((A)v->q),(A)z; } ENTRYPOINT I ep__srcb(A a,A x) { V v;I f,c,i; NDC2(a,x);if(x->t!=Et||x->n!=2) ERROUT(ERR_DOMAIN); v=av(a);f=x->p[0];c=x->p[1];i=qz((A)f); if(!v) ERROUT(ERR_DOMAIN); if(!(QF(f)&&!QS(f))&&!i) ERROUT(ERR_NONFUNCTION); dc((A)v->rff),v->rff=i?0:ic((A)f),dc((A)v->rfc),v->rfc=ic((A)c); R 0; } ENTRYPOINT A ep__grcb(A a) { A z;V v;I err; NDC1(a);v=avlu(a,&err); if(!v) if(err){ERROUT(ERR_DOMAIN);}else R 0; if(!v->rff)R 0; R z=gv(Et,2),*z->p=ic((A)v->rff),z->p[1]=ic((A)v->rfc),(A)z; } ENTRYPOINT I ep__sprcb(A a,A x) { V v;I f,c,i; NDC2(a,x);if(x->t!=Et||x->n!=2) ERROUT(ERR_DOMAIN); v=av(a);f=x->p[0];c=x->p[1];i=qz((A)f); if(!v) ERROUT(ERR_DOMAIN); if(!(QF(f)&&!QS(f))&&!i) ERROUT(ERR_NONFUNCTION); dc((A)v->rpf),v->rpf=i?0:ic((A)f),dc((A)v->rpc),v->rpc=ic((A)c); R 0; } ENTRYPOINT A ep__gprcb(A a) { A z;V v;I err; NDC1(a);v=avlu(a,&err); if(!v) if(err){ERROUT(ERR_DOMAIN);}else R 0; if(!v->rpf)R 0; R z=gv(Et,2),*z->p=ic((A)v->rpf),z->p[1]=ic((A)v->rpc),(A)z; } ENTRYPOINT A ep_scd(A a,A cd) { A z;V v; NDC1(a);v=av(a); if (!QA(cd)) ERROUT(ERR_DOMAIN); if(!v) ERROUT(ERR_DOMAIN); z=v->cd; v->cd=(A)ic(cd); R z; } ENTRYPOINT A ep_gcd(A a) { V v;I err; NDC1(a);v=avlu(a,&err); if(!v) if(err){ERROUT(ERR_DOMAIN);}else R 0; R (A)(v->cd?ic(v->cd):0); } ENTRYPOINT A ep__sscd(A a,A cd) { A z;V v; NDC1(a);v=av(a); if (!QA(cd)) ERROUT(ERR_DOMAIN); if(!v) ERROUT(ERR_DOMAIN); z=v->scd; v->scd=(A)ic(cd); R z; } ENTRYPOINT A ep__gscd(A a) { V v;I err; NDC1(a);v=avlu(a,&err); if(!v) if(err){ERROUT(ERR_DOMAIN);}else R 0; R (A)(v->scd?ic(v->scd):0); } ENTRYPOINT I ep__utd(A a){ V v;I err; NDC1(a);v=avlu(a,&err); if(!v) if(err){ERROUT(ERR_DOMAIN);}else R 0; R v->z; } Z I nt[]={1,2,3,3,3,4}; Z C *vt[]={"cxs","vars","fns","ops","xfs"}; /* Z V ct(a)A a;{S s=a->n?XS(*a->p):0;R!s?Cx:cxi(s);} */ Z CX ct(A a,I *perr) { S s=(QA(a)&&Et==a->t&&1==a->n)?(S)(*a->p):0; *perr=0; R(0==a->n)?Cx:(s&&QS(s))?cxlu(XS(s)):(*perr=1,(CX)0); } /*******************************************************************/ ENTRYPOINT A ep_def(A a) { V v;I err; NDC1(a);v=avlu(a,&err); if(!v) if(err){ERROUT(ERR_DOMAIN);}else R 0; R (a=(A)v->e)?(A)gsv(0,(C *)a->p[a->n+1]):(A)gz(); } ENTRYPOINT A ep_dep(A a) { V v,vl; I *l,n=0,err; A result; NDC1(a);v=avlu(a,&err); if (!v) if(err){ERROUT(ERR_DOMAIN);}else R 0; for(l=v->l;l;l=(I*)*l)++n; result=gv(Et, n); n=0; for(l=v->l;l;l=(I*)*l) {vl=(V)l[1];result->p[n++]=MS(symjoin(vl->cx->s,vl->s));} R result; } ENTRYPOINT A ep_alldep(A a) { V v, xv; I *l, idx=0, count=0, j, err, notin, **lvec; A result; struct buff *pb; NDC1(a);v=avlu(a,&err); if (!v) if(err){ERROUT(ERR_DOMAIN);}else R 0; if (0==(l=v->l)) R (A)gz(); pb=buffalloc(); for (l=v->l;l;l=(I*)*l) { buffputlong(pb,(I)l); count++; } lvec=(I **)(pb->min); /* buffstuff(pb,l+1,sizeof(I)*(count=*l)); */ while(idxl;l;l=(I*)*l) { for(j=0,notin=1;notin && jmin); } } } result=gv(Et, count); DO(count,xv=(V)lvec[i][1];result->p[i]=MS(symjoin(xv->cx->s,xv->s))); R result; } /*******************************************************************/ I coreLimGet(void) { struct rlimit r; getrlimit(RLIMIT_CORE,&r); R r.rlim_cur; } #if (__sgi && ((_MIPS_SZLONG == 64) || (_MIPS_SIM == _ABIN32))) void coreLimSet(long long n) { struct rlimit64 r; getrlimit64(RLIMIT_CORE,&r); r.rlim_cur = (nt) name=(C *)aname->p; else if (Et==aname->t && QS(aname->p[0])) name=XS(aname->p[0])->n; else name=(C *)0; R name; } ENTRYPOINT A ep_nc(A c,A s) { V v;CX cv;A z;C *name;I err=1; NDC2(c,s);cv=ct(c,&err);name=getaname(s); if(!cv||name==(C *)0)if(err){ERROUT(ERR_DOMAIN);}else R gsym("null"); z=gs(Et);v=svlu(cv,si(name)); R *z->p=MS(si(!v?"null":v->e?"deps":v->a?vt[nt[v->t]]:"null")),z; } I MFALimitGet() ; ENTRYPOINT A ep_gsv(A aname) { C *name;A z; NDC1(aname); name=getaname(aname); if (name==(C *)0) ERROUT(ERR_TYPE); switch(lu(name,SysVarList)) { CSR(1, R (A)gi(dymeVal)); CSR(2, R versGet()); CSR(3, R (A)gi(atol(Fs+3))); /* pp */ CSR(4, R gsym(APLpick("apl","ascii","uni"))); /* mode */ CSR(5, R (A)gi(sq)); /* stop */ CSR(6, R (A)gi(Df)); CSR(7, R (A)gi(Gf)); CSR(8, R (A)gi(Sf)); CSR(9, R (A)gi(Tf)); CSR(10, R (A)gi(Xf)); CSR(11, z=gs(Et); *z->p=MS(Cx->s); R z;); CSR(12, ERROUT(ERR_DOMAIN);); /* rl */ CSR(13, R (A)gi(stdinFlag)); CSR(14, R (A)gi(coreLimGet())); CSR(15, R (A)gsym(Phase[phaseOfReleaseVal])); CSR(16, R (A)gi(majorReleaseVal)); CSR(17, R (A)gi(minorReleaseVal)); CSR(18, R releaseCodeGet()); CSR(19, R gsym("aplus")); /* language */ CSR(20, R (A)gi(Ef)); CSR(21, R (A)getSymKstack()); /* si */ CSR(22, R getSigv()); /* segvexit */ CSR(23, R getSigb()); /* busexit */ CSR(24, R get_loadfile()); /* loadfile */ CSR(25, R (A)gi(xfpeFlag)); /* Xfpef */ CSR(26, R (A)gi(MFALimitGet())); /* maplim */ CSR(27, R (A)gi(doErrorStack)); CSR(28, R CCID ? gsym(CCID):aplus_nl); CSR(29, R (A)gi(getAutoBeamConvert())); CSR(30, R getBeamMSyncMode()); /* beamMSyncMode */ default: ERROUT(ERR_DOMAIN); } } #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__) #define InfItCHK(aval) \ if (1!=aval->n) ERROUT(ERR_LENGTH); \ if (Ft==aval->t) \ corelim=(((double)RLIMIT_CORE)<(*(F *)(aval->p)))?RLIMIT_CORE:(int)rint(*(F *)(aval->p)); \ else if (It==aval->t) corelim=(RLIMIT_CORE<*aval->p)?RLIMIT_CORE:*aval->p; \ else ERROUT(ERR_TYPE); \ if (RLIMIT_CORE!=corelim&&0>corelim) ERROUT(ERR_DOMAIN); #else #define InfItCHK(aval) \ if (1!=aval->n) ERROUT(ERR_LENGTH); \ if (Ft==aval->t) \ corelim=(((double)INT_MAX)<(*(F *)(aval->p)))?RLIM_INFINITY:(int)rint(*(F *)(aval->p)); \ else if (It==aval->t) corelim=*aval->p; \ else ERROUT(ERR_TYPE); \ if (RLIM_INFINITY!=corelim&&0>corelim) ERROUT(ERR_DOMAIN); #endif #define ItCHK(aval) if (It!=aval->t) ERROUT(ERR_TYPE); \ if (1!=aval->n) ERROUT(ERR_LENGTH); \ if (0>(ival=*aval->p)) ERROUT(ERR_DOMAIN); #define RtCHK(aval,range) ItCHK(aval); if(rangep,(Rx==Cx)?".":Cx->s->n); dc(a); H("%s %cpp:[%-2ld] %cmode:[%s %cstop:[%ld] %cstdin:[%ld]\n",CC, FLG(pp,10),pp,FLG(APL,1),APLpick("apl] ","ascii]","uni] "), FLG(sq,2),sq,FLG(stdinFlag,1),stdinFlag); H("%s %cDf:[%ld] %cEf:[%ld] %cGf:[%ld] %cSf:[%ld]\n\n",CC, FLG(Df,1),Df,FLG(Ef,1),Ef,FLG(Gf,1),Gf,FLG(Sf,1),Sf); if(1!=APL)H("%s *** Input mode set not apl. mode:[%s]\n\n",CC, ModeList[APL]); if(1==sq)H("%s *** stop flag not set to trace. stop:[%ld]\n\n",CC,sq); if(0==sq)H("%s *** stop flag not set to trace. stop:[%ld]\n\n",CC,sq); if(0==stdinFlag)H("%s *** Standard input disabled. stdin:[%ld]\n\n",CC, stdinFlag); if(0==Df)H("%s *** Dependencies disabled. Df:[%ld]\n\n",CC,Df); if(0==Ef)H("%s *** Suspension on errors disabled. Ef:[%ld]\n\n",CC,Ef); if(0==Gf)H("%s *** Protected execute (monadic do) disabled. Gf:[%ld]\n\n", CC,Gf); if(0==Sf)H("%s *** Callbacks disabled. Sf:[%ld]\n\n",CC,Sf); } /* *******************************************************************/ /* * * Workspace management (_wa) * */ Z C *WaCmdList[] = { "coalesce", "size", "atmp", "avail", "fragcounts", "fragsizes", "info", (char *)0 }; #ifdef BSTUB A ep_wa(A a) { R aplus_nl; } #else A ep_wa(A a) { A z, z0; I k, n=0, len=MD, *p; C *name; NDC1(a); if (It==a->t || Ft==a->t) { if (1 != a->n) ERROUT(ERR_LENGTH); if (Ft==a->t) k=(I)rint(*(F *)(a->p)); else k=*a->p; if (-1 > k) ERROUT(ERR_DOMAIN); if (k>0) R gi(!tmp(k<<20)); if (-1==k)mc(); R gc(It,1,len,&len,(I *)mz()); } else { if (((C *)0)==(name=getaname(a))) ERROUT(ERR_TYPE); switch(lu(name,WaCmdList)) { CSR(1, mc(); R gc(It,1,len,&len,(I *)mz())); /* coalesce */ CSR(2, R gi(twGet())); /* size */ CSR(3, R gi(ep_all())); /* atmp */ CSR(4, p=(I *)mz();DO(MD,n+=p[i]*MZ[i])R gi(n<<2)); /* avail */ CSR(5, R gc(It,1,len,&len,(I *)mz())); /* fragcounts */ CSR(6, R gc(It,1,len,&len,(I *)MZ)); /* fragsizes */ CSR(7, z=gv(Et,3);z0=gv(It,3);p=(I *)mz();DO(MD,n+=p[i]*MZ[i]) z->p[0]=(I)z0; z->p[1]=(I)gc(It,1,len,&len,(I *)mz());z->p[2]=(I)gc(It,1,len,&len,(I *)MZ); z0->p[0]=twGet();z0->p[1]=ep_all();z0->p[2]=n<<2;R z); /* info */ default: ERROUT(ERR_DOMAIN); } } } #endif /* *******************************************************************/ /* * namelists (_nl) * */ Z C *NlList[] = {"vars", "fns", "ops", "xfs", "sfs", "_sfs", "cxs", "cmds", "deps", "globs", "svs", "nl", "wa", "errors", "apl", "ascii", "dbg", "circle", "uni", "mode", 0}; Z A nl_list(CX cxt, I n) { V v; I i,count=0; A result; for(i=0;iht->nb;++i) for(v=(V)cxt->ht->b[i];v;v=v->v)if(nt[v->t]==n&&v->a) ++count; result=gv(Et,count);count=0; for(i=0;iht->nb;++i)for(v=(V)cxt->ht->b[i];v;v=v->v) if(nt[v->t]==n&&v->a) result->p[count++]=MS(v->s); R result; } Z A nl_deps(CX cxt) { V v; I i,count=0; A result; for(i=0;iht->nb;++i)for(v=(V)cxt->ht->b[i];v;v=v->v)if(v->e) ++count; result=gv(Et,count);count=0; for(i=0;iht->nb;++i)for(v=(V)cxt->ht->b[i];v;v=v->v) if(v->e)result->p[count++]=MS(v->s); R result; } Z A nl_globs(CX cxt) { V v; I i,count=0; A result; for(i=0;iht->nb;++i)for(v=(V)cxt->ht->b[i];v;v=v->v)if(qv0(v)) ++count; result=gv(Et,count);count=0; for(i=0;iht->nb;++i)for(v=(V)cxt->ht->b[i];v;v=v->v) if(qv0(v))result->p[count++]=MS(v->s); R result; } Z A nl_sfs(void) { C **s=xfs_name; I count=0; A result; for(;*++s;)if(**s=='_'&&(*s)[1]!='_') ++count; result=gv(Et, count); for(count=0,s=xfs_name;*++s;) if (**s=='_'&&(*s)[1]!='_') result->p[count++]=MS(si(*s)); R result; } Z A nl__sfs(void) { C **s=xfs_name; I count=0; A result; for(;*++s;)if(**s=='_'&&(*s)[1]=='_') ++count; result=gv(Et, count); for(count=0,s=xfs_name;*++s;) if (**s=='_'&&(*s)[1]=='_') result->p[count++]=MS(si(*s)); R result; } Z A nl_cxs(void) { CX cx; I i,count=0; A result; for(i=0;inb;++i)for(cx=(CX)CxTable->b[i];cx;cx=cx->n) if(cx->flag&1) ++count; result=gv(Et,count);count=0; for(i=0;inb;++i)for(cx=(CX)CxTable->b[i];cx;cx=cx->n) if(cx->flag&1) result->p[count++]=MS(cx->s); R result; } Z A nl_names(C **list) { C **s; I count; A result; for(count=0,s=list;*s;s++) ++count; result=gv(Et, count); for(count=0,s=list;*s;++s) result->p[count++]=MS(si(*s)); R result; } Z A nl_primlist(int mode) { A result; I count; C **ps, **ns, **s; ps=get_primlist(mode,0); ns=get_primlist(mode,1); for(count=0,s=ns;*s;s++) ++count; for(s=ps;*s;s++) ++count; result=gv(Et, count); for(count=0,s=ns;*s;++s) result->p[count++]=MS(si(*s)); for(s=ps;*s;++s) result->p[count++]=MS(si(*s)); R result; } ENTRYPOINT A ep_nl(A acontext, A aname) { C *name;CX cxt;I err; if(MP(39)==(I)aname)R getCircleFuncSyms(); /* circle primitive */ NDC2(acontext,aname); name=getaname(aname); cxt=ct(acontext,&err); if (name==(C *)0) ERROUT(ERR_TYPE); if (!cxt) if(err){ERROUT(ERR_DOMAIN);}else R(A)aplus_nl; switch(lu(name,NlList)) { CSR(1, R nl_list(cxt,1)); /* vars */ CSR(2, R nl_list(cxt,2)); /* fns */ CSR(3, R nl_list(cxt,3)); /* ops */ CSR(4, R nl_list(cxt,4)); /* ext */ CSR(5, if(cxt!=Rx)R(A)aplus_nl;R nl_sfs()); /* sfs */ CSR(6, if(cxt!=Rx)R(A)aplus_nl;R nl__sfs()); /* _sfs */ CSR(7, if(cxt!=Rx)R(A)aplus_nl;R nl_cxs()); /* cxs */ CSR(8, if(cxt!=Rx)R(A)aplus_nl;R nl_names(cmdsList)); /* cmds */ CSR(9, R nl_deps(cxt)); /* deps */ CSR(10,R nl_globs(cxt)); /* globs */ CSR(11,if(cxt!=Rx)R(A)aplus_nl;R nl_names(SysVarList)); /* sv */ CSR(12,if(cxt!=Rx)R(A)aplus_nl;R nl_names(NlList)); /* nl */ CSR(13,if(cxt!=Rx)R(A)aplus_nl;R nl_names(WaCmdList)); /* wa */ CSR(14,if(cxt!=Rx)R(A)aplus_nl;R nl_names(es)); /* errors */ CSR(15,if(cxt!=Rx)R(A)aplus_nl;R nl_primlist(1)); /* apl-mode primitives */ CSR(16,if(cxt!=Rx)R(A)aplus_nl;R nl_primlist(0)); /* ascii-mode primitives */ CSR(17,if(cxt!=Rx)R(A)aplus_nl;R nl_names(get_dbglist())); /* dbg */ CSR(18,R(A)getCircleFuncSyms()); /* circle */ CSR(19,if(cxt!=Rx)R(A)aplus_nl;R nl_primlist(2)); /* uni-mode primitives */ CSR(20,if(cxt!=Rx)R(A)aplus_nl;R nl_names(ModeList)); /* mode */ default: ERROUT(ERR_DOMAIN); } } /*******************************************************************/ ENTRYPOINT A ep_load(A aname) { C *name, *rname; A z; NDC1(aname);name=getaname(aname); if (name==(C*)0) ERROUT(ERR_TYPE); rname=doloadafile(name,0); if(rname==(C*)0) { #ifdef HAVE_STRERROR char *errstr=strerror(errno); z=gv(Et,2); z->p[0]=(I)gsym("error"); z->p[1]=(I)gsv(0,(errstr)?errstr:"unknown system error"); #else z=gv(Et,2); z->p[0]=(I)gsym("error"); z->p[1]=(I)gsv(0,(errnop[0]=(I)gsym("ok");z->p[1]=(I)gsv(0,rname);free(rname);} R z; } ENTRYPOINT A ep_loadrm(A aguard, A aname) { C *name, *guard, *rname; A z; NDC2(aguard,aname);name=getaname(aname);guard=getaname(aguard); if (guard==(C *)0) ERROUT(ERR_TYPE); if (name==(C *)0) ERROUT(ERR_TYPE); if (strcmp((DEV_STRARG)guard,(DEV_STRARG)"delete")) { z=gv(Et,2); z->p[0]=(I)gsym("error"); z->p[1]=(I)gsv(0,"loadrm called without specifying deletion"); R z; } rname=doloadafile(name,1); if(rname==(C*)0) { #ifdef HAVE_STRERROR char *errstr=strerror(errno); z=gv(Et,2); z->p[0]=(I)gsym("error"); z->p[1]=(I)gsv(0,(errstr)?errstr:"unknown system error"); #else z=gv(Et,2); z->p[0]=(I)gsym("error"); z->p[1]=(I)gsv(0,(errnop[0]=(I)gsym("ok");z->p[1]=(I)gsv(0,rname);free(rname);} R z; } /*******************************************************************/ ENTRYPOINT I ep_undef(A a) { V v;I err; NDC1(a);v=avlu(a,&err); if(!v)if(err){ERROUT(ERR_DOMAIN);}else R 1; R v->e?(rmd(v),0):1; } ENTRYPOINT I ep_ex(A a) { V v;I err; I emptyV() ; NDC1(a);v=avlu(a,&err); if(!v)if(err){ERROUT(ERR_DOMAIN);}else R 1; R(qv0(v)&&!v->o)?(emptyV(v),0):1; } /* global name - core function for ep_excxt */ I excxt(CX cx) { I i;V v; if (!cx||Rx==cx) R 1; for(i=0;iht->nb;++i)for(v=(V)cx->ht->b[i];v;v=v->v) if(qv0(v))R 1; cx->flag&=~1; R 0; } ENTRYPOINT I ep_excxt(A a){I err;NDC1(a);R excxt(ct(a,&err));} ENTRYPOINT /* exitpoint? :^) */ void ep_exit(I rc){exit((int)rc);} /* I -> int */ ENTRYPOINT void ep_abortload(void){ void setAbortLoad() ; setAbortLoad(1); } Z C pwd[MAXPATHLEN+8]="PWD="; #if defined(HAVE_SVR4) || defined(__NetBSD__) void setPWD(void){getcwd(pwd+4, MAXPATHLEN+8-4);putenv(pwd);} #else void setPWD(void){getwd(pwd+4);putenv(pwd);} #endif ENTRYPOINT A ep_cd(A a) { A z; C *name; NDC1(a); name=getaname(a); if (name==(C *)0) ERROUT(ERR_TYPE); if(chdir(*name?name:getenv("HOME"))) { #ifdef HAVE_STRERROR char *errstr=strerror(errno); z=gv(Et,2); z->p[0]=(I)gsym("error"); z->p[1]=(I)gsv(0,(errstr)?errstr:"unknown system error"); #else z=gv(Et,2); z->p[0]=(I)gsym("error"); z->p[1]=(I)gsv(0,(errnop[0]=(I)gsym("ok");} R z; } /*******************************************************************/ ENTRYPOINT A ep_hashstat(A a) { HT ht; A z; I i;V v;NDC1(a); if (qz(a)) R SymbolTableHashChainLengths(); if (Et!=a->t||1!=a->n||!QS(*a->p)) ERROUT(ERR_DOMAIN); ht=cxi(XS(*a->p))->ht; z=gv(It,ht->nb);bzero(z->p,ht->nb*sizeof(I)); for(i=0;inb;++i)for(v=(V)ht->b[i];v;v=v->v)z->p[i]++; R z; } ENTRYPOINT A ep_symstat(void) { R SymbolTableBlockInfo(); } extern A showLastSavedKstack(); ENTRYPOINT A ep_doErrorStack() { R showLastSavedKstack(); } void nsfInstall(void) { /**/ install((PFI)ep_nc, "_nc", A_, 2, A_, A_,0,0,0,0,0,0); install((PFI)ep_scb, "_scb", V_, 2, A_, A_,0,0,0,0,0,0); install((PFI)ep_gcb, "_gcb", A_, 1, A_, 0,0,0,0,0,0,0); install((PFI)ep_spcb, "_spcb", V_, 2, A_, A_,0,0,0,0,0,0); install((PFI)ep_gpcb, "_gpcb", A_, 1, A_, 0,0,0,0,0,0,0); install((PFI)ep__srcb, "__srcb", V_, 2, A_, A_,0,0,0,0,0,0); install((PFI)ep__grcb, "__grcb", A_, 1, A_, 0,0,0,0,0,0,0); install((PFI)ep__sprcb, "__sprcb", V_, 2, A_, A_,0,0,0,0,0,0); install((PFI)ep__gprcb, "__gprcb", A_, 1, A_, 0,0,0,0,0,0,0); install((PFI)ep_scd, "_scd", A_, 2, A_, A_,0,0,0,0,0,0); install((PFI)ep_gcd, "_gcd", A_, 1, A_, 0,0,0,0,0,0,0); install((PFI)ep__sscd, "__sscd", A_, 2, A_, A_,0,0,0,0,0,0); install((PFI)ep__gscd, "__gscd", A_, 1, A_, 0,0,0,0,0,0,0); install((PFI)ep__utd, "__utd", IV, 1, A_, 0,0,0,0,0,0,0); install((PFI)ep_gsv, "_gsv", A_, 1, A_, 0,0,0,0,0,0,0); install((PFI)ep_ssv, "_ssv", A_, 2, A_, A_,0,0,0,0,0,0); install((PFI)ep_nl, "_nl", A_, 2, A_, A_,0,0,0,0,0,0); install((PFI)ep_def, "_def", A_, 1, A_, 0,0,0,0,0,0,0); install((PFI)ep_dep, "_dep", A_, 1, A_, 0,0,0,0,0,0,0); install((PFI)ep_alldep, "_alldep", A_, 1, A_, 0,0,0,0,0,0,0); install((PFI)ep_load, "_load", A_, 1, A_, 0,0,0,0,0,0,0); install((PFI)ep_loadrm, "_loadrm", A_, 2, A_, A_,0,0,0,0,0,0); install((PFI)ep_undef, "_undef", IV, 1, A_, 0,0,0,0,0,0,0); install((PFI)ep_ex, "_ex", IV, 1, A_, 0,0,0,0,0,0,0); install((PFI)ep_excxt, "_excxt", IV, 1, A_, 0,0,0,0,0,0,0); install((PFI)ep_exit, "_exit", V_, 1, IV, 0,0,0,0,0,0,0); install((PFI)ep_abortload,"_abortload",V_, 0, 0, 0,0,0,0,0,0,0); install((PFI)ep_cd, "_cd", A_, 1, A_, 0,0,0,0,0,0,0); install((PFI)ep_hashstat, "_hashstat", A_, 1, A_, 0,0,0,0,0,0,0); install((PFI)ep_symstat, "_symstat", A_, 0, 0, 0,0,0,0,0,0,0); install((PFI)ep_wa, "_wa", A_, 1, A_, 0,0,0,0,0,0,0); install((PFI)ep_xfsinfo, "__xinfo", A_, 0, 0, 0,0,0,0,0,0,0); install((PFI)ep_doErrorStack,"_doErrorStack", A_, 0, 0, 0,0,0,0,0,0,0); R; } aplus-fsf-4.22/src/a/o.c0000644000265000001440000001536310772770357010456 /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #include #include #include #include I atOnExit, wtOnExit; /* set in fa() used by o.c:rk() */ Z I dp(A a) { I k,d=0; if(QF(a))R -1; if(a->tn,if((k=1+dp((A)a->p[i]))>d)d=k); R d; } Z C *i2f(I t,F *d,I *s,I n){DO(n,*d++=*s++)R(C*)d;} Z I dr(A a,I f) { XA; A z,*ap=(A*)a->p,w; if(!an||at!=Et||fsy(a))R ic(a); /* ic_or_copy(a) */ w=*ap; Q(QF(w),9); if(!ar)R ic(w); /* ic_or_copy(w) */ { XW; I i=an,n=0,t; C *p; if(f){Q(ar>1,7)V0 n=*wd;} else{Q(ar+wr>MAXR,13)mv(ad+ar,wd,wr);} for(;--i;) { Q(!QA(a=ap[i])||(t=a->t)>Et,9); if(wt!=t&&a->n) if(f&&!n)wt=t; else{Q(wt>Ft||t>Ft,6)wt=Ft;} if(wr!=a->r){Q(!f||wr>1||a->r,7)*a->d=1;} Q(cm(wd+f,a->d+f,wr-f),11); if(f)n+=*a->d; } W(ga(wt,f?wr:ar+wr,f?n*tr(wr-1,wd+1):an*wn,f?wd:ad)); if(f)*z->d=n; p=(C*)z->p; DO(an,a=ap[i]; p=(*(a->t==wt?(C *(*)(I,F *,I *,I))tmv:i2f))(wt,(F *)p,a->p,a->n)); R(I)z; } } H1(dis){Q(!QA(a),18)R dr(a,0);} H1(raz){Q(!QA(a),18)R dr(a,1);} H1(dep){R(I)gi(dp(a));}Z I t,v; H2(pen){ A z,*p; ND2 I1 { XW; I t=wt,d[9],*ap=a->p,an=a->n,j=an==1?*ap:0,k=*wd,n; C *wp=(C*)w->p; Q(!wr,7); DO(an,Q(ap[i]<0,9)); n=tr(wr-1,wd+1); mv(d+1,wd+1,wr-1); if(j&&k!=(an=k/j)*j)++an; W(j?gv(Et,an):gd(Et,a)); *--Y=zr(z),p=(A*)z->p; for(;an--;wp+=Tt(t,wn),k-=*d) *p++=gc(wt,wr,wn=n*(*d=j?j:*ap++,*d=*d>k?k:*d),d,(I *)wp); R ++Y,(I)z; } } GV0(C,lag) { C *p=r+Tt(t,n); I j=Tt(t,v),k=v*-*a; for(;rp,k=*w->d,r=w->r; Q(MAXR<=r,13); if(!r)R j==1?rsh(w,1,a->p):(q=7,0); mv(d+2,w->d+1,r-1); if(j>0) { d[1]=j,*d=k/j; Q(k!=*d*j,8); R rsh(w,r+1,d); } d[1]=-j,*d=k+j+1; Q(*d<0,8); W(ga(t=w->t,r+1,*d*d[1]*(v=tr(r-1,d+2)),d)); C2(lag); } } H1(pct){A z;I i=0,j=0,k=0,n,*p;ND1 n=a->n;I1 W(a->c==1?(A)ic(a):gv(It,n)) if(n){Q(a->r>1,7)Q(!*a->p,9)for(p=z->p;++ip[i])p[j++]=i-k,k=i;p[j++]=n-k,z->n=*z->d=j;}R(I)z;} Z I gC(I t,I r,I n,I *d,I *p) { A z=ga(t,r,n,d); p?tmv(t,z->p,p,n):zer(t,z->p,n); R(I)z; } Z I raw(I r,I i){R i<0?(-i>r?r:-i):i>r?0:r-i;} I aw_c[2]={1,1}; I rk(I f,A r,A a,A w) { A z=0,*p=0; if(w)ND2 else ND1; { XA; C *pp=0,*ap,*wp; I wt=0,wr=0,wn=0,*wd=0; I n=0,t=0,i,j,k,d[9],rw,ra,ri,ir,iw=0,ia=0,ii=0, e=!w&&f==MP(9),h=QP(f)&&f!=MP(71)&&!e; Q(!QA(r),9); Q(r->t,6); Q(r->n<1||r->n>3,8); ar-=ra=raw(ar,*r->p); if(!w) mv(d,ad,ra),ir=tr(ra,ad),ad+=ra; else { wt=w->t,wr=w->r,wd=w->d; wr-=rw=raw(wr,r->p[r->n>1]),ri=r->n>2?r->p[2]:9; Q(ri<0,9); if(ri>ra)ri=ra; if(ri>rw)ri=rw; mv(d,ad,ra-=ri); ia=tr(ra,ad),mv(d+ra,wd,rw),iw=tr(rw-=ri,wd); Q(cm(ad+=ra,wd+=rw,ri),11); ii=tr(ri,ad),ra+=rw+ri,ir=ia*iw*ii,wn=tr(wr,wd+=ri),ad+=ri; if(h&&ir>iw&&(f==MP(21)||f==MP(25)||f==MP(26)||f==MP(32)||f==MP(33))) h=0; } an=tr(ar,ad); if(h) { g=0; aw_c[0]=a->c; aw_c[1]=w&&w->c; r=(A)fa(f,gC(at,ar,an,ad,a->n?a->p:0),w?gC(wt,wr,wn,wd,w->n?w->p:0):0); aw_c[0]=aw_c[1]=1; if(!r)R 0; r=un(&r); mv(d+ra,r->d,j=r->r); if((j+=ra)>MAXR)R q=13,(I)r; n=r->n;t=r->t; if(ir<2) R mv(r->d,d,r->r=j),r->n*=ir,(I)r; dc(r); if(g==(I (*)())rsh) R rsh(w?w:a,j,d); if(!g){h=0;} else { if(at=atOnExit,w) wt=wtOnExit; if(at!=a->t&&!(a=at?ep_cf(1):ci(1))) R 0; if(w&&wt!=w->t&&!(w=wt?ep_cf(2):ci(2))) R 0; OF(i,ir,n); W(ga(t,j,i,d)); pp=(C*)z->p; } } if(!h) { W(ga(Et,ra,ir,d)); *--Y=zr(z),p=(A*)z->p; } if(!w) { for(ap=(C*)a->p;ir--;ap+=Tt(at,an)) if(h) (*(I(*)(C*,C*,I))g)(pp,ap,an),pp+=Tt(t,n); else a=gc(at,ar,an,ad,(I*)ap),*p++=e?a:(A)fa(f,(I)a,0); } else { for(i=0;ip+Tt(at,(i*ii+k)*an); wp=(C*)w->p+Tt(wt,(j*ii+k)*wn); if(h) { (*(I(*)(C*,C*,C*,I))g)(pp,ap,wp,n),pp+=Tt(t,n); if(q==1)*--Y=(I)z,aplus_err(q,(A)Y[1]),++Y; } else { *p++=(A)fa(f,(I)gc(at,ar,an,ad,(I*)ap),(I)gc(wt,wr,wn,wd,(I*)wp)); } } } if(h)R(I)z; if(!e)z=(A)dis(r=z),dc(r); R ++Y,(I)z; } } I ea(I f,A a,A w) { A z,*p;I at,k,wt=0,j=0; C *ap,*wp=0; if(w)ND2 else ND1; at=a->t,k=a->r?Tt(at,1):0,ap=(C*)a->p; if(w) if(wt=w->t,wp=(C*)w->p,j=w->r?Tt(wt,1):0,k&&j) { Q(a->r!=w->r,7); Q(cm(a->d,w->d,a->r),8); } W(gd(Et,j?w:a)); *--Y=zr(z),p=(A*)z->p; DO(z->n, if(atp[i]=MS(si(CircleFuncList[i]))); aobj->c=0; circleFuncSyms=aobj; } R circleFuncSyms; } H2(cir) { A tempa, z; if(!QA(a)||It==a->t||Ft==a->t)R ds(a,w,17); Q(Et!=a->t,6); tempa=(A)fnd(getCircleFuncSyms(),a); DO(tempa->n,if(CIRCFUNCCOUNT==tempa->p[i]){q=9;R 0;};tempa->p[i]-=7;); dc((A)Y[0]);Y[0]=(I)tempa; z=(A)ds(tempa,w,17); R(I)z; } F pif(I i,F x){ switch(i){ default:Q(1,9); CSR(0,R sqrt(1-x*x)); CSR(4,R sqrt(1+x*x)); CSR(-4,R sqrt(-1+x*x)); CSR(8,R sqrt(-1-x*x)); CSR(-8,R -sqrt(-1-x*x)); CSR(1,R sin(x)); CSR(2,R cos(x)); CSR(3,R tan(x)); CSR(-1,R asin(x)); CSR(-2,R acos(x)); CSR(-3,R atan(x)); CSR(5,R sinh(x)); CSR(6,R cosh(x)); CSR(7,R tanh(x)); CSR(-5,R asinh(x)); CSR(-6,R acosh(x)); CSR(-7,R atanh(x)); } } aplus-fsf-4.22/src/a/ovli.c0000644000265000001440000000534010772770357011163 /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #include #include #if !defined(USE_ASSEMBLER_OVLI) extern I aw; static F longMinAsDouble=LONG_MIN; static F longMaxAsDouble=LONG_MAX; I cOvliAdd(I *r, I *a, I *w, I n) { I *t = r + n; I i=aw!=1, j=aw!=2; for (; r0 && *w>0 && *r<=0) || (*a<0 && *w<0 && *r>=0) ) return q=-2, 1L; } return 0; } I cOvliTimes(I *r, I *a, I *w, I n) { I *t=r+n; I i=aw!=1, j=aw!=2; F rd; for (; rlongMaxAsDouble || rd0 && *r>0) || (*a>=0 && *w<0 && *r<0) ) return q=-2, 1L; } return 0; } I cOvliPlusReduce(I *r, I *w, I n){ I *t=w+n, a=0; *r=0; for (; w0 && *w>0 && *r<=0) || (a<0 && *w<0 && *r>=0) ) return q=-2, 1L; } return 0; } #if defined(_ULTRA_OvliTimesReduce_BUG) static char junk[128]; #endif I cOvliTimesReduce(I *r, I *w, I n){ I s=1, *t=w+n; F rd=1.0; /* Note times reduce 65536 65536 will result in *s==0 so can */ /* only check *w==0 for an early exit */ for (; wlongMaxAsDouble || rd #include #if defined(HAVE_SVR4) # include #endif #include #include #include #include #include #include #include #undef min #undef max #if defined(__VISUAL_C_2_0__) || defined(_HP) || defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__) #define iszero(x) (x==0) #endif #define PC putchar Z C *ns[]={":=","else","if","while","do","case","time","","@","each",0}; Z C *ps[]={"&","?","+","*","max","min","-","%","|","<", ">","=","~=","<=",">=","^","log","rand","flip","iota", "#","rho",",","~","rot","take","drop","upg","dng","==", "pack","unpack","/","\\","in","bag","pick","mdiv","!","pi", "&\\","?\\","+\\","*\\","max\\","min\\","&/","?/","+/","*/", "max/","min/", "+.","*.","max.","min.","-.","%.","|.","<.", ">.","=.","~=.","<=.",">=.", "^.","+.*","beam","max.+","min.+", "form","eval","where","rtack","ref","dot","bwand","bwor", "bwlt","bwgt", "bweq","bwne","bwle","bwge","bwnot",0}; Z C *n0[]={"\373","else","if","while","do","case","time","","@","\241",0}; Z C *p0[]={"^","\251","+","\253","\323","\304","-","\337","|","<", ">","=","\250","\244","\246","*","\360","?","\364","\311", "#","\322",",","~","\367","\331","\325","\350","\347","\275", "\302","\316","/","\\","\305","\332","\330","\255","!","\317", "^\\","\251\\","+\\","\253\\","\323\\","\304\\","^/","\251/", "+/","\253/", "\323/","\304/","\312.+","\312.\253","\312.\323","\312.\304", "\312.-","\312.\337","\312.|","\312.<", "\312.>","\312.=","\312.\250","\312.\244","\312.\246","\312.*", "+.\253","\340","\323.+","\304.+", "\356","\342","\335","\333","%","\326","^\256","\251\256", "<\256",">\256", "=\256","\250\256","\244\256","\246\256","~\256",0}; Z C *n2[]={":=","else","if","while","do","case","time","","@","~",0}; Z C *p2[]={"&","|","+","*","M.+","M.-","-","%","M.|","<", ">","=","!=","<=",">=","M.*","M.&","M.?","S.\\","I.#", "#","S.?",",","!","S.|","S.+","S.-","I.+","I.-","==", "M.<","M.>","/","\\","I.?","I.<","I.>","M.#","S.!","M.^", "&\\","|\\","+\\","*\\","M.+\\","M.-\\","&/","|/","+/","*/", "M.+/","M.-/", "O.+","O.*","Q.+","Q.-","O.-","O.%","Q.|","O.<", "O.>","O.=","O.!=","O.<=","O.>=", "Q.*","P.*","F.!","P.+","P.-", "E.%","E.*","A.<","A.>","^","Y.&","B.&","B.|","B.<","B.>", "B.=","B.!=","B.<=","B.>=","B.!",0}; C **get_primlist(int mode,int flag) { R (mode?((1==mode)?(flag?n0:p0):(flag?n2:p2)):(flag?ns:ps)); } /*------- Character Hash Table Functions ----------*/ #define CHTHASH(ht,s) ((ht)->b+(((ht)->nb-1)&chafn(s))) #define strneq(a,b) (*(a)!=*(b)||strcmp((a),(b))!=0) #define streq(a,b) (*(a)==*(b)&&0==strcmp((a),(b))) Z unsigned long chafn(C *n) { unsigned long h = 0, c; while ((c = (unsigned long)*n++) != 0) { h += (h << 5) + c; } R h; } /* htgi - get val of key from ht. If !found,R 0; */ Z HTN chtgi(HT ht,C *key) { HTN *htn=(HTN*)CHTHASH(ht,key),n; for(n=*htn;n;n=n->n)if(streq((DEV_STRARG)key,(DEV_STRARG)n->s))R n;R(HTN)0; } Z HTN chtni(void){HTN z=(HTN)balloc(sizeof(*z));bzero(z,sizeof(*z));R z;} /* htsi - set val of key in ht to d. If no entry exists, create. */ I chtsi(HT ht,C *key,I a) { HTN *htn=(HTN*)CHTHASH(ht,key),n,hd; for(n=*htn;n;n=n->n)if(streq((DEV_STRARG)key,(DEV_STRARG)n->s)){n->a=a;R 0;} n=chtni();if(!n)R 0;n->s=(S)key;n->a=a; /* if(hd=*htn){n->n=hd->n;hd->n=n;}else{*htn=n;n->n=0;}++ht->ni;R 1; */ hd=*htn; if(hd){ n->n=hd->n;hd->n=n; }else { *htn=n;n->n=0; }++ht->ni; R 1; } Z HT p0ht, psht, p2ht; extern C *xfs_name[],*xfs_desc[],*nx(),*cl(); extern HT xsht; I xslu(C *str){HTN z=chtgi(xsht,str);R z?z->a:0;} I lu(C *s,C *t[]){I i=0;for(;t[i];)if(!strcmp((DEV_STRARG)s,(DEV_STRARG)t[i++]))R i;R 0;} C*pp(I a) { R QS(a) ? XS(a)->n : (QN(a)?(APLpick(n0,ns,n2)):QP(a)?(APLpick(p0,ps,p2)):xfs_name)[U(a)]; } C*ppd(I a) { R QS(a) ? XS(a)->n : (QN(a)?(APLpick(n0,ns,n2)):QP(a)?(APLpick(p0,ps,p2)):xfs_desc)[U(a)]; } I aplus_pi(C *s){HTN z=chtgi(APLpick(p0ht,psht,p2ht),s);if(z)R z->a; if(*s=='_'&&(ISlower(*(s+1))||'_'==*(s+1)))R xslu(s);R 0;} Z C*fn(C *s,I n){for(;--n;)s=1+nx(s);R s;} Z C*ss(C *q,C *s){I n=strlen((DEV_STRARG)s);for(;strncmp(q,s,n);)++q;R q;} Z C*sb(C *q){I i=0;C c;for(;c=*q++,i||c!='{';)i+=(c=='(')-(c==')');R q;} void sik(void){ I *p=K,s; for(;*p;--p); for(++p;p<=K;) if(QV(s=*p++))H("%s[ %ld]\n",(C*)(s&~aplusMask),-*p++); else { C c,*t,*q,*r; if(QS(s))q=(C*)(s&~aplusMask); else { A f=(A)s; q=1+(C *)strchr((DEV_STRARG)f->p[f->n+1],':'); H("%s.%s: ",((CX)f->p[f->n+2])->s->n,XS(*f->d)->n); } for(;p<=K&&*p>-9999&&*p<6;++p,s=0) q=cl(0>*p?fn(QS(s)&&*q!='{'?q:sb(q),-*p):ss(q,ns[*p])); t=nx(q); r=(C *)strchr((DEV_STRARG)q,'\n'); if(r&&r=(K-p)) return aplus_nl; /* Allocate nested A+ object and initialize to nulls */ z=gv(Et,K-p); for(i=0; in; i++) z->p[i]=(I)aplus_nl; for(++p;p<=K;) if(QV(s=*p++)){ sprintf(b,"%.*s[ %ld]\0",(wrkStrBufSize-extraSpace),(C*)(s&~aplusMask),-*p++); n=1+strlen(b);aWrk=gv(Ct,n);memcpy(aWrk->p,b,n);z->p[lc++]=(I)aWrk; } else { C c,*t,*q,*r; if(QS(s))q=(C*)(s&~aplusMask); else { A f=(A)s; q=1+(C *)strchr((C *)f->p[f->n+1],':'); sprintf(b,"%.*s\0",(wrkStrBufSize-extraSpace), ((CX)f->p[f->n+2])->s->n); cLen=strlen(b); sprintf(b+cLen,".%.*s: \0", (wrkStrBufSize-(cLen+extraSpace)),XS(*f->d)->n); } for(;p<=K&&*p>-9999&&*p<6;++p,s=0) q=cl(0>*p?fn(QS(s)&&*q!='{'?q:sb(q),-*p):ss(q,ns[*p])); t=nx(q); r=(C *)strchr(q,'\n'); if(r&&rp,b,n);z->p[lc++]=(I)aWrk; *t=c; } if(lc==0) { aWrk=aplus_nl; } else { aWrk=gv(Et, lc); for(i=0; ip[i]=ic((A)z->p[i]); } dc(z); if(dbg_tdoErrorStack) doErrorStacktrc(q,aWrk); R aWrk; } I sik_exp(I tt){ /* experimental version of sik for monadic do */ I *p=K,s,i=0; C b[999]; A z=0; *b='\0'; for(;*p;--p); if (tt) z=gv(Et,K-p); for(++p;p<=K;) if(QV(s=*p++)){ sprintf(b,"%s[ %ld]\n",(C*)(s&~aplusMask),-*p++); if(!tt) H("%s",b); else z->p[i++]=(I)gsv(0,b); } else { C c,*t,*q,*r; if(QS(s))q=(C*)(s&~aplusMask); else { A f=(A)s; q=1+(C *)strchr((DEV_STRARG)f->p[f->n+1],':'); sprintf(b,"%s.%s: ",((CX)f->p[f->n+2])->s->n,XS(*f->d)->n); } for(;p<=K&&*p>-9999&&*p<6;++p,s=0) q=cl(0>*p?fn(QS(s)&&*q!='{'?q:sb(q),-*p):ss(q,ns[*p])); t=nx(q); r=(C *)strchr((DEV_STRARG)q,'\n'); if(r&&rp[i++]=(I)gsv(0,b); *t=c; } if(tt) z->n=z->d[0]=i; R tt?(I)z:0; } void sk(void) { I *p=K,s,inbraces=0; for(;*p;--p); for(;p++-999) H("%ld ",-s); else if (s>0&&s<6) H("%s ",APLpick(n0,ns,n2)[s]); else { if(inbraces) H("]\n"); inbraces=!QS(s); H(inbraces?"%s[":"%s\n", QS(s)||QV(s)?(C*)(s&~aplusMask):(((A)s)->d&&QS(*((A)s)->d)?XS(*((A)s)->d)->n:"!A+ sk() print Error!")); } } if(inbraces)H("]\n"); } #define BRK {if(q==1)R 0;} Z void in(I f){NL;DO(2*f,PC(' '))} void pcxv(V v){H(" %s.%s",v->cx->s->n,v->s->n);} Z void pdfn(A a) { switch(a->r) { CS(2,H("(");paf((A)a->d[1],(I)1,(I)1);paf((A)a->d[0],(I)1,(I)1);H(")");); CS(3,H("(");paf((A)a->d[1],(I)1,(I)1);paf((A)a->d[0],(I)1,(I)1); paf((A)a->d[2],(I)1,(I)1);H(")");); default:H("*derived fn*");break; } } Z I padata(A a,I f,I x) { I t,dca=0; C *ix=x?"":" "; if(!a)R 1; t=a->t; if(t>Et) { if(t==Xt) pdfn(a); else if(f) H("%s.%s",((CX)(a->p[a->n+2]))->s->n,XS(*a->d)->n); else H("%s",(C*)a->p[a->n+1]); R 1; } else { I an=a->n,r=a->r,j=t==Et&&!sym(a),n,k,d[9],*p=0; C *s=0; if(!an)R 1; if(!j) { if(t!=Ct)a=(A)mth(a),dca=1; if(q){if(dca)dc(a);R 0;} s=(C*)a->p,an=a->n,r=a->r; if(dca&&x&&1>=r){s++,an--;} } else { p=a->p; if(r<2&&sym(a)){DO(an,H("%s`%s",ix,XS(*p++)->n))R 1;} } if(r>1)for(mv(d,a->d,r),n=d[k=r-1];--k;)d[k]*=d[k+1]; else n=r?an:1; for(;;) { if(j)DO(n,H("< ");paf((A)(*p++),f+1,x);if(in)in(f)) else DO((n<=an)?n:an,if(q==1){if(dca)dc(a);R 0;}PC(*s++)); if(0>=(an-=n)){if(dca)dc(a);R 1;} for(k=r;--k&&!(an%d[k]);)in(f); } } } I paf(A a,I f,I x) { I t; C *ix=x?"":" "; BRK; switch(aplusMask&(I)a) { CS(2,H("%s`%s",ix,pp((I)a))); case 4:if(U(a)>9){H("[paf case 4!]");pcxv(XV(a));break;} /* conditional fall-thru from 4 */ case 6:CS(7,H("%s%s",ix,(f)?pp((I)a):ppd((I)a))); CS(1,pcxv(XV(a))); CS(3,paf((A)(XE(a)->f),f+1,x);H("... ")); CS(5,t=U(a);(a=(A)*X)&&t>-a->n&&tr?paf((A)(t<0?a->p[-t]:a->d[t]),f+1,x):H(" &")); CS(0,padata(a,f,x)); } R -1; } void pa(V v){paf((A)v,1,0);} Z C b[256];C Fs[]=" %.10g"; Z I bd(void){I i=0;for(;b[i]&&b[i]!='.'&&b[i]!='e';++i);R i;} /* low-to-high minus */ Z void h(C *s){if((1==APL)&&b[1]=='-')b[1]='\242';strncpy(s,b,strlen((DEV_STRARG)b));} Z C *iin[]={""," Inf"," -Inf"," Na", " 0"}; Z I inf(F x){R /*x==-999999999?3:*/iszero(x)?4:finite(x)?0:isnan(x)?3:x>0?1:2;} Z I mfmt(C *b,C *s,F x) { I i=inf(x); R i?strlen(strcpy(b,(DEV_STRARG)iin[i])):SH(x); } #define MaxBufLength 128 Z char buf[MaxBufLength]; Z I dfmt(C *b,C *s,I m,I n,F x) { I k,l,j=inf(x); if(!j) { I r; sprintf(buf,s,m,n,x); r=strlen(buf); buf[mt?2:1,l,k;C *s=a->t?Fs:" %d";p.i=a->p; DO(a->n,if(!a->t)k=SH(p.i[i]); else{l=mfmt(b,s,p.f[i]);k=l-bd();if(k>j)j=k<10?k:10;k=l-k;}if(k>m)m=k); R m+=3+--j,gf((F)m+(F)j/10); } H1(mth) { A z;ND1; { XA; P p; C *d,*s=(It==at)?" %ld":(Ft==at)?Fs:" `%s"; I j=0,k,m=0,l; if(at==Ct)R ic(a); if(at==Et&&!sym(a)) { if(qz(a)) { /* Handle null format as ` */ z=(A)gv(Ct,2); d=(C*)z->p; d[0]=' '; d[1]='`'; R(I)z; } Q(ar,7); Q((a=(A)*a->p,!QF(a)),6); R (I)gsv(0,!QA(a)?pp((I)a):a->t==Xt?"*derived*":(C*)a->p[a->n+1]); } p.i=a->p; if(1>=ar) { /* vector/scalar */ /* DO(an,BRK m+=(It==at)?SH(p.i[i]): (Ft==at)?mfmt(b,s,p.f[i]): 2+strlen(XS(p.i[i])->n)); */ { long i=0,_i=an; for(;i<_i;++i){ {if(q==1)R 0;} if (It==at) { m += SH(p.i[i]); } else if (Ft==at) m += mfmt(b,s,p.f[i]); else m += 2+strlen(XS(p.i[i])->n); } } W(gv(Ct,m)); zr(z); d=(C*)z->p; #ifdef OLDCODE DO(an,k=(It==at)?SH(*p.i++):(Ft==at)?mfmt(b,s,*p.f++):SH(XS(*p.i++)->n); h(d);d+=k); #else /* Can't use SH(x), b[30] not large enough to hold long symbol names */ if( It==at || Ft==at) { DO(an,k=(It==at)?SH(*p.i++):mfmt(b,s,*p.f++); h(d);d+=k); } else { C *symName; I symLen; long _i; for(_i=0; _in; strncpy(d, symName, symLen=strlen(symName)); d+=symLen; } } #endif } else { /* matrix (rank >= 2) */ if(It==at) {DO(an,BRK k=SH(p.i[i]);if(k>m)m=k);} else if (Ft==at) { DO(an,BRK l=mfmt(b,s,p.f[i]);k=bd();if(k>j)j=k;k=l-k;if(k>m)m=k;); m+=j; } else {DO(an,BRK k=2+strlen(XS(p.i[i])->n);if(k>m)m=k);} W(ga(Ct,ar,an*m,ad)); z->d[ar-1]*=m; zr(z); d=(C*)z->p; if(It==at) {DO(an,h(d+m-SH(*p.i++));d+=m);} else if(Ft==at){DO(an,mfmt(b,s,*p.f++);h(d+j-bd());d+=m);} #ifdef OLDCODE else {DO(an,SH(XS(*p.i++)->n);h(d);d+=m);} #else /* Can't use SH(x), b[30] not large enough to hold long symbol names */ else { C *symName; long _i; for(_i=0; _in; strncpy(&(d[2]), symName, strlen(symName)); d+=m; } } #endif } R(I)z; } } #ifdef OLDCODE H1(mth) { A z;ND1; { XA; P p;C *s=at?Fs:" %d",*d; I j=0,k,m=0,n,l; if(at==Ct)R ic(a); if(at==Et) { Q(ar,7); Q((a=(A)*a->p,!QF(a)),6); R (I)gsv(0,!QA(a)?pp((I)a):a->t==Xt?"*derived*":(C*)a->p[a->n+1]); } p.i=a->p; n=ar?ad[--ar]:1; if(ar)DO(an,BRK if(at){l=mfmt(b,s,p.f[i]);k=bd();if(k>j)j=k;k=l-k;} else k=SH(p.i[i]);if(k>m)m=k) else DO(an,BRK m+=at?mfmt(b,s,p.f[i]):SH(p.i[i])); m+=j; W(ga(Ct,ar+1,ar?an*m:m,ad)); z->d[ar]=ar?m*n:m; zr(z); d=(C*)z->p; if(ar)DO(an,at?(mfmt(b,s,*p.f++),h(d+j-bd())):h(d+m-SH(*p.i++));d+=m) else DO(an,k=at?mfmt(b,s,*p.f++):SH(*p.i++);h(d);d+=k); R(I)z; } } #endif H2(dth) { A z;ND2 if(sym(w))F1 else F2 { Z I f[99],g[99],h[99]; I wt=w->t,wr=w->r,*wd=w->d; I n=a->n,u,v,j=0,k=n!=1,*r; F x,*p=(F*)a->p;C *s,*cp; if(!wr)u=v=wr=1; else u=tr(wr-1,wd),v=wd[wr-1]; Q(n!=v&&k,8) Q(n>99,12)DO(n,x=p[i];if(f[i]=x<0)x=-x;j+=g[i]=x;h[i]=.5+10*(x-g[i]);) W(ga(Ct,wr,u*(j=k?j:j*v),wd))z->d[wr-1]=j,s=(C*)z->p,cp=s; for(p=(F*)(r=w->p);u--;)DO(v, if(j=k?i:0,wt==Et)sprintf(s,f[j]?" %-*s":"%*s",g[j],XS(*r++)->n); else dfmt(s,f[j]?" %- *.*e":"%*.*f",g[j],h[j],*p++);s+=g[j]) cp[z->n]='\0'; R(I)z; } } /*---------- initialization and loading -----------*/ #define P0HTSIZE 256 #define PsHTSIZE 256 #define P2HTSIZE 256 void p0hti(void) {I i;p0ht=hti(P0HTSIZE);psht=hti(PsHTSIZE);p2ht=hti(P2HTSIZE); for(i=0;n0[i];++i)chtsi(p0ht,n0[i],MN(i)); for(i=0;p0[i];++i)chtsi(p0ht,p0[i],MP(i)); for(i=0;ns[i];++i)chtsi(psht,ns[i],MN(i)); for(i=0;ps[i];++i)chtsi(psht,ps[i],MP(i)); for(i=0;n2[i];++i)chtsi(p2ht,n2[i],MN(i)); for(i=0;p2[i];++i)chtsi(p2ht,p2[i],MP(i)); } aplus-fsf-4.22/src/a/q.c0000644000265000001440000002402310772770357010451 /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* $cd /u/orth/domino cc -c domino.c -o domino.o $load domino_a $load domino_s 'domino.o' _dyld ('_dmd' ;'dmd' ;0 0 0; '_mmd' ;'mmd' ; 0 0) */ #include #include #if defined(__cplusplus) #include #else #include #endif #include #include #include #define Ma(i,j) *((F *)a->p+n*i+j) #define Mb(t,i,j) *((t *)b->p+p*i+j) #define Mh(i,j) *((F *)h->p+2*i+j) #define Mz(i,j) *((F *)z->p+p*i+j) #define vector(t,a,k) *((t *)a->p+k) #define Vc(k) *((F *)c->p+k) #define Vfactor(k) *((F *)factor->p+k) #define Vtvec(k) *((F *)tvec->p+k) #define Ipp(k) *((I *)pp->p+k) #define Ipq(k) *((I *)pq->p+k) /* For text errors indicating where an error message originates from, use: #define DOMAIN_ERROR -1 #define LENGTH_ERROR -1 #define RANK_ERROR -1 */ A dmd(A,A), mmd(A); static A ls_c(A,A,I,I,I,I); /* Domino ------------ The dyadic case. */ A dmd(A b,A a) { I result_rank; I m, n, p; A z; if(!QA(a)||!QA(b)) ERROUT(ERR_NONDATA); if ( (It != a->t && Ft != a->t) || (It != b->t && Ft != b->t) ) ERROUT(ERR_TYPE); if (2 < a->r || 2 < b->r ) ERROUT(ERR_RANK); if ( 0 == a->r ) result_rank = 0; else result_rank = a->r - 1; if ( 0 != b->r ) result_rank += b->r - 1; if ( 2 == a->r ) { m = a->d[0]; n = a->d[1]; } else { n = 1; if ( 1 == a->r ) { m = a->d[0]; } else { m = 1; } } if ( m < n ) ERROUT(ERR_DOMAIN); if ( 2 == b->r ) { if ( m != b->d[0] ) ERROUT(ERR_LENGTH); p = b->d[1]; } else { p = 1; if ( ( 1 == b->r && m != b->d[0] ) || ( 0 == b->r && m != 1 ) ) ERROUT(ERR_LENGTH); } RESETXCP; z = ls_c(a,b,m,n,p,0); CHECKXCP; if ( 0 == z ) return(0); z->r = result_rank; z->d[0]=(2==result_rank||2>b->r)?n:p; if (2==result_rank) z->d[1]=p; return(z); } /* ------------ The monadic case. */ A mmd( A a ) { I result_rank; I m, n, p; A z; if(!QA(a)) ERROUT(ERR_NONDATA); if ( It != a->t && Ft != a->t ) ERROUT(ERR_TYPE); if (2 < a->r ) ERROUT(ERR_RANK); result_rank = a->r; if ( 2 == a->r ) { m = a->d[0]; n = a->d[1]; } else if ( 1 == a->r ) { m = a->d[0]; n = 1; } else { m = 1; n = 1; } if ( m < n ) ERROUT(ERR_DOMAIN); p = m; z = ls_c(a,0,m,n,p,1); if ( 0 == z ) return(0); z->r = result_rank; if (1==result_rank) z->d[0]=p; else if (2==result_rank) { z->d[0] = n; z->d[1] = p; } return(z); } /* ------------ The least squares computation. Here's the beef. This program is an amalgamation of two of Mike Jenkin's models for Domino: one is the primitive that appeared in APLSV and VSAPL, while the other is for the generalized is for the generlized inverse version that appeared in the original APL2. This program reflects the current state of Domino in APL2 (as of 7/12/91), except that the complex arithmetic sections are missing. */ static A ls_c(A a0,A b,I m,I n,I p,I monadic) /* m,n,p : scalars set by the driver a0 : the right argument, a matrix of shape m,n b : the left argument in the dyadic case, a matrix of shape m,p z : the result, a matrix of shape n,p monadic : a flag used to signal generation of the identity matrix */ { I i, j, i0, j0, d[MAXR], l, pi, pj; F eps, mv, mmv, s, sa, st, t, tolerance, t0, t1, t2, t3, t4, t5, v; A a, c, factor, h, pp, pq, tvec, z; /* Make a copy of a0 because it will be modified. Remember that a0 can be either integer or real, and always copy to real. */ a = ga(Ft, a0->r, a0->n, a0->d ); switch( a0->t ) { case It: for ( i = 0 ; i < a0->n ; ++i ) vector(F,a,i) = vector(I,a0,i); break; case Ft: for ( i = 0 ; i < a0->n ; ++i ) vector(F,a,i) = vector(F,a0,i); break; }; /* Initialize the temps and the result. */ d[0] = m; pq = ga(It, 1, d[0], d ); for ( i = 0 ; i < m ; ++i ) Ipq(i) = i; c = ga(Ft, 1, d[0], d ); d[0] = n; pp = ga(It, 1, d[0], d ); for ( i = 0 ; i < n ; ++i ) Ipp(i) = i; factor = ga(Ft, 1, d[0], d ); d[1] = 2; h = ga(Ft, 2, d[0]*d[1], d ); d[1] = p; z = ga(Ft, 2, d[0]*d[1], d ); if ( n <= m ) d[0] = m; tvec = ga(Ft, 1, d[0], d ); /* tolerance : APL2 uses 1e-16, Jenkin's original paper uses 16e13. */ mmv=0.0; for ( i = 0 ; i < m ; ++i ) { t0 = 0.0; for ( j = 0 ; j < n ; ++j ) { sa = Ma(i,j); if ( 0 > sa ) sa = -sa; t0 = t0 + sa; } if ( mmv < t0 ) mmv = t0; } tolerance = 1e-13; eps = tolerance*mmv; /* Here is the scaling from the APLSV/VSAPL model: */ for ( i = 0 ; i < m ; ++i ) { Vtvec(i)=0.0; for ( j = 0 ; j < n ; ++j ) { t1 = Ma(i,j); if ( 0 > t1 ) t1 = -t1; if ( Vtvec(i) sa ) sa = -sa; t2 = sa / Vtvec(i); if ( Vfactor(j) t3 ) t3 = -t3; if ( mv < t3 ) { mv = t3; } } if ( mmv < mv ) { mmv = mv; pj = j0; } } if( eps >= mmv ) { /* There is no rank deficient case. */ dc(a); dc(c); dc(factor); dc(h); dc(pp); dc(pq); dc(tvec); dc(z); ERROUT(ERR_DOMAIN); } if ( j != pj ) { i = Ipp(pj); Ipp(pj) = Ipp(j); Ipp(j) = i; for ( i = 0 ; i < m ; ++i ) { s = Ma(i,pj); Ma(i,pj) = Ma(i,j); Ma(i,j) = s; } } /* The following row interchange is from the APLSV/VSAPL model. */ t = 0.0; pi = 0; for ( i0 = j; i0 < m ; ++i0 ) { t4 = Ma(i0,j); if ( 0 > t4 ) t4 = -t4; if ( t < t4 ) { t = t4; pi = i0; } } if ( j != pi ) { Ipq(j) = Ipq(pi); for ( j0 = j ; j0 < n ; ++j0 ) { s = Ma(j,j0); Ma(j,j0) = Ma(pi,j0); Ma(pi,j0) = s; } } /* Now do the i-th transformation (in place). */ t = 0.0; for ( i0 = j ; i0 < m ; ++i0 ) { t5 = Ma(i0,j); if ( 0 > t5 ) t5 = -t5; if ( t < t5 ) t = t5; } v = 0.0; for ( i0 = j ; i0 < m ; ++i0 ) { s = Ma(i0,j) / t; v = v + s*s; } NAN_CHECK(v, t*sqrt(v)) if ( Ma(j,j) < 0 ) v = -v; /* Save the essential values and adjust the diagonal element. */ Mh(j,0) = v; Mh(j,1) = Ma(j,j); Ma(j,j) = -v; /* Apply the transformation (in place). */ for ( j0 = j + 1 ; j0 < n ; ++j0 ) { Vtvec(j0) = Ma(j,j0); Ma(j,j0) = Mh(j,1) * Ma(j,j0); for ( i0 = j + 1 ; i0 < m ; ++i0 ) { Ma(j,j0) = Ma(j,j0) + Ma(i0,j) * Ma(i0,j0); } Ma(j,j0) = - Ma(j,j0) / Mh(j,0); } s = Mh(j,0) + Mh(j,1); for ( j0 = j + 1 ; j0 < n ; ++j0 ) { t = (Vtvec(j0) - Ma(j,j0)) / s; for ( i0 = j + 1 ; i0 < m ; ++i0 ) { Ma(i0,j0) = Ma(i0,j0) - Ma(i0,j) * t; } } } /* Build the solutions. First apply the same transformations to the righthand side as were applied to a, one column at a time. The formation of the vector c shows why we process each column of the righthand side separately, for otherwise in the monadic case we would have to form very large identity matrices when the argument matrix had many rows. As with the argument a, the argument b might be integer and we always copy to a real vector c. The vector c should be created at the top of the loop in C. */ for ( i = 0 ; i < n ; ++i ) for ( j = 0; j < p ; ++j ) Mz(i,j) = 0.0; /* The next loop is the outer loop for the solution builder. */ for ( l = 0 ; l < p ; ++l ) { if ( monadic ) { for ( i = 0 ; i < m ; ++i ) Vc(i) = 0.0; Vc(l) = 1.0; } else { switch ( b->t ) { case It: for ( i = 0 ; i < m ; ++i ) Vc(i) = Mb(I,i,l); break; case Ft: for ( i = 0 ; i < m ; ++i ) Vc(i) = Mb(F,i,l); break; } } for ( j = 0 ; j < n ; ++j ) { if ( j != Ipq(j) ) { s = Vc(j); Vc(j) = Vc(Ipq(j)); Vc(Ipq(j)) = s; } /* Apply the transformation (in place). */ st = Vc(j); Vc(j) = Mh(j,1) * Vc(j); for ( i0 = j + 1 ; i0 < m ; ++i0 ) { Vc(j) = Vc(j)+ Ma(i0,j) * Vc(i0); }; Vc(j) = -Vc(j) / Mh(j,0); s = Mh(j,0) + Mh(j,1); t = (st-Vc(j)) / s; for ( i0 = j + 1 ; i0 < m ; ++i0 ) { Vc(i0) = Vc(i0) - Ma(i0,j) * t; } } /* Backsolve the n-by-n triangular system. */ for ( j = n - 1 ; 0 <= j ; --j ) { s = 0.0; for ( j0 = j ; j0 < n ; ++j0 ) { s = s + Ma(j,j0) * Mz(Ipp(j0),l); } Mz(Ipp(j),l) = (Vc(j)-s) / Ma(j,j); } } /* Adjust for APLSV/VSAPL scaling. */ for ( i = 0 ; i < n ; ++i ) for ( j = 0 ; j < p ; ++j ) { Mz(i,j) = Mz(i,j) * Vfactor(i); } /* Remove the temps. */ dc(a); dc(c); dc(factor); dc(h); dc(pp); dc(pq); dc(tvec); return(z); } aplus-fsf-4.22/src/a/r.c0000644000265000001440000002673210772770357010463 /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #include #include #include #include #include #include #include static I rl(I),re(void); extern I Df,dbg_tdep,dbg_tinv,dbg_tdef,dbg_depth,dbg_trcb; Z I y,*t,*r,Qs;Z I vl(I a){R QL(a)||QV(a);} #define CxtabHTSIZE (1<<8) HT CxTable; I DependencyEvaluationSemaphore=0; CX cxhti(void){CxTable=hti(CxtabHTSIZE);R cxi(si(""));} Z CX gcx(void) { CX cx=(CX)balloc(sizeof(*cx)); memset(cx, 0, sizeof(*cx)); cx->flag = 1; cx->ht = hti(CxHTSIZE); R cx; } CX cxi(S s) { CX cx=(CX)htgi(CxTable,s,(PFI)gcx,0); cx->flag|=1; R cx; } CX cxlu(S s){R (CX)htgi(CxTable,s,0,0);} /* cxlu() is like cxi() exept if context does not exist, it returns 0 instead of creating a new one */ V vi(S s,CX cx){HT ht=cx->ht;V v,vh;V *bp=(V *)HTHASH(ht,s); for(v=*bp;v;v=v->v)if(s==v->s)R v; v=(V)malloc(sizeof(*v));bzero(v,sizeof(*v));v->s=s;v->cx=cx;v->z=1;++ht->ni; if (vh=*bp) {v->v=vh->v;vh->v=v;} else *bp=v;R v;} V vlu(S s,CX cx){HT ht=cx->ht;V v;V *bp=(V *)HTHASH(ht,s); for(v=*bp;v;v=v->v)if(s==v->s)R v;R 0;} /* vlu() is like vi() except if v-structure doesn't exist, it returns 0 instead of creating a new one. */ CX cx(const C *s){R *s!='.'?cxi(si(s)):Rx;} I gz(void){R(I)aplus_nl;} I qz(A aobj){R ((aobj==aplus_nl)||(QA(aobj)&&aobj->t==Et&&!aobj->n&&aobj->r>0));} Z I cvl(I a0){R vl(a0)||QE(a0)&&XE(a0)->f==MP(74);} Z I pvl(I a0){E e;R cvl(a0)||QE(a0)&&(e=XE(a0),e->n==2&&e->f==MP(36)&&cvl(e->a[1]));} Z I rvl(I a0){E e;R pvl(a0)||QE(a0)&&(e=XE(a0),e->n==1&&e->f==MP(22)&&pvl(e->a[0]));} Z C *ps[]={"ws?","op?","var?","fn?","finished?","assign?","naked [?", "max # args 9","valence?",":header?","list too long?","too many locals?"}; Z void prr(I i,I j) { extern I G; if(!G) { H("%s[parse]",CC); if (i==2) pa((V)j); H(": %s\n",ps[i]); if(Qs) if(QS(Qs)) H("%s\n",XS(Qs)->n); else sk(),dc((A)Qs); } for(;*r;)mf((I*)(*r--)); tc(r); } Z E mm(I n){if(*++r=(I)ma(n))R(E)*r;--r,prr(0,0);R 0;} #define ELSE MN(1) I ty(I a0) { I t; if(!QL(a0)) R QA(a0)?0:QV(a0)?(t=XV(a0)->t,t==5?1:t):a0==MN(8)?3:a0==MN(9)?2:1; if(0>(a0=U(a0)))R 0; t=Qs||*X?((A)(Qs?Qs:*X))->t-Xt:0;R!a0?t:a0==1&&t>1||a0==2&&t==4?1:0; } Z I me(I n,I f,I a,I b,I c) { /* E e=mm(n+2);e->n=n,e->f=f,*e->a=a;if(n>1)e->a[1]=b;if(n>2)e->a[2]=c; R QP(a)&&(f==MN(8)&&QA(b)||f==MN(9)&&a!=MP(74))? (a=ee(e),*r=a,ef(ME(e)),a):ME(e); */ E e=mm(n+2); e->n=n,e->f=f,*e->a=a; if(n>1)e->a[1]=b; if(n>2)e->a[2]=c; if (QP(a)&&(f==MN(8)&&QA(b)||f==MN(9)&&a!=MP(74))) { a=ee(e); *r=a; ef(ME(e)); return a; } else { return ME(e); } } Z I mr(void){R *t&&*t!=';'&&*t!=')'&&*t!=']'&&*t!='}'&&*t!=ELSE;} Z I rt(void) { I f,a=0,b,c=0; if(!mr())prr(4,0); switch(f= *t++) { case MN(5): case MN(3): CSR(MN(2),*++K=U(f);if(a=rt(),y)prr(3,0);b=mr()?re():(I)aplus_nl; if(*t==ELSE){++t;*K=1;c=re();}--K;R me(c?3:2,f,a,b,c)); CS('[',prr(6,0))CS('(',--t;a=rl(MN(7)))CS('{',--t;a=rl(MN(1))); default:y=ty(a=f); } if(!y)for(;*t=='[';)a=rl(a); R a; } #define RLBLEN 999 #define rlbf bfree((char *)(b==rlb?0:b)) Z I rl(I f) { E e;I rlb[RLBLEN], *b=rlb,n=0,blen=RLBLEN; if(*t++=='[')b[n++]=f,f=MX(0);*++K=0; for(;*t!=']'&&*t!='}'&&*t!=')'&&*t;) { if(n==blen) { blen*=2; if (b==rlb) { b=(I*)balloc(blen*sizeof(I)); bcopy(rlb,b,RLBLEN*sizeof(I));} else b=(I*)brealloc((char *)b,blen*sizeof(I)); } if(--*K,b[n++]=*t==';'?(I)aplus_nl:(re()),*t==';')++t; } if(t[-1]==';')b[n++]=(I)aplus_nl; ++t; --K; if(n==1&&(f==MN(7)||!t[-1])){n=*b;rlbf;R n;} y=0; if(!n&&f==MN(7)){R rlbf,(I)aplus_nl;} if(QP(f)&&n!=1&&n!=2)rlbf,prr(8,0); /* R e=mm(n+2),e->f=f,mv(e->a,b,e->n=n),rlbf,ME(e); */ e = mm(n+2); e->f = f; mv(e->a,b,e->n=n); rlbf; return ME(e); } Z I r_rf(void){I a=rt(),f;for(;mr()&&ty(f= *t)>1;y=1) if(++t,a=ty(f)==2?me(1,f,a,0,0):me(2,f,a,rt(),0),y>1)prr(1,0); R *t=='{'&&(!QN(a)||MN(6)==a)?rl(a):a;} Z I vs(E e){DO(e->n,if(!vl(e->a[i]))R 0)R 1;} I peak(I f){E e=XE(f);R QE(f)&&e->f==MN(9)&&*e->a==MP(74);} Z I as(I a){I z;E e;if(!(pvl(a)||QE(a)&&(e=XE(a),peak(e->f)||(e->f==MN(7)?vs(e): e->f!=MP(36)&&e->f!=MP(74)&&rvl(e->a[e->f==MX(0)?0:e->n-1])))))prr(5,0); ++t,z=me(2,MN(0),a,re(),0);if(QV(a))XV(a)->t=y;R z;} /* Z I re(void){I f,a,w;a=r_rf();if(!mr())R a;if(*t==MN(0))R as(a);if(y>1)prr(1,0); if(f=!y){f=r_rf();if(y!=1)prr(2,a);}w=re();if(y)prr(3,0); R f?me(2,f,a,w,0):me(1,a,w,0,0);} */ Z I re(void){ I f,a,w; I bertmp; a=r_rf(); if(!mr()) R a; if(*t==MN(0)) R as(a); if(y>1) prr(1,0); if(f=!y){ f=r_rf(); if(y!=1) prr(2,a); } w=re(); if(y) prr(3,0); if (f) { bertmp = me(2,f,a,w,0); return bertmp; } else { R me(1,a,w,0,0); } } Z I lk(I s,A f){I i;if(!f)R 0;if(f->r>1)DO(f->r,if(f->d[i]==s)R ML(i)) for(i=f->n;--i;)if(f->p[i]==s)R ML(-i);R 0;} Z I rz(I *b0) { I i; for(r=t=b0;*r;++r) if(QS(*r)&&!ispu(*r))*r=(i=lk(*r,(A)(Qs?Qs:*X)))?i: MV(vi(XS(*r),Cx)); R re(); } void f0(C *s){A aobj=(A)sv(Cx,si(s))->e;if(aobj)H("%s\n",(C*)aobj->p[aobj->n+1]);} void f1(C *s){I *l=sv(Cx,si(s))->l;for(;l;l=(I*)*l)H("%s ",((V)l[1])->s->n);NL;} Z void app(A aobj,I k) { DO(aobj->n,if(aobj->p[i]==k)R); aobj->p[aobj->n]=k; aobj->n=++*aobj->d; } Z I mrg(A aobj,A wobj){ A z;I n=aobj->n; if(wobj&&wobj->t==Et&&wobj->n)wobj=(A)*wobj->p; if(!wobj||qz(wobj))R(I)aplus_nl; z=gv(It,n+wobj->n),tmv(It,z->p,aobj->p,n),*z->d=z->n=n; DO(wobj->n,app(z,wobj->t?(I)(.5+((F*)wobj->p)[i]):wobj->p[i])); R(I)z; } Z void inv_pass1_dbg(V v,I i,I d){ if(d&&2<=v->z)invtrc(v,1); if(2>=v->z){ I *l=v->l;A z=v->i; if(d){++dbg_depth;if(1==v->z)invtrc(v,0);} for(v->z|=8;l;l=(I*)*l)inv_pass1_dbg((V)l[1],l[2]?i:0,1); if(z&&!qz(z))i=mrg(z,(A)i),dc(z),v->i=(A)i; if(d)--dbg_depth; } } Z void inv_pass1(V v,I i){ if(2>=v->z){ I *l=v->l;A z=v->i; for(v->z|=8;l;l=(I*)*l)inv_pass1((V)l[1],l[2]?i:0); if(z&&!qz(z))i=mrg(z,(A)i),dc(z),v->i=(A)i; } } Z void inv_pass2(V v){ if(8&v->z){ I *l=v->l; for(v->z&=6;l;l=(I*)*l)inv_pass2((V)l[1]); } } void inv(V v,I i,I d) { if(2>=v->z){ if(dbg_tinv)inv_pass1_dbg(v,i,d); else inv_pass1(v,i); inv_pass2(v); } } void val(V v){if(v->z=1,v->i)dc(v->i),v->i=gv(It,0);} I gt(V v){ if(Df&&!v->z&&v->e){ A iwv=v->i&&!v->a?aplus_nl:v->i;I z,appf=0;E e; if(iwv&&aplus_nl!=iwv&&iwv->n&&v->a&&QA(v->a)) { A aobj=(A)v->a; I lim=aobj->r?*aobj->d:1,i; appf=(lim<=*iwv->p)?1:0; for(i=1;in;++i) if(appf!=((lim<=iwv->p[i])?1:0)){iwv=aplus_nl;appf=0;break;} } e=(E)ma(3); /* if(v->z=4,e->f=v->e,e->n=!!iwv)if(qz((A)(*e->a=(I)iwv)))iwv=0; */ v->z = 4; e->f = v->e; if (e->n=!!iwv) if(qz((A)(*e->a=(I)iwv))) iwv=0; if(dbg_tdep)deptrc(v,0); /* DependencyEvaluationSemaphore indicates the depth of the recursive dependency */ /* re-evaluation. It's incremented every time dependency re-evaluation is started */ /* and decremented when it's finished. */ if(!oldDepModel) ++DependencyEvaluationSemaphore; z=(I)ez(ME(e)); if(!oldDepModel) --DependencyEvaluationSemaphore; if(z) { aset((I)v,ic((A)z),appf?MP(22):(I)iwv,0); if(Sf&&v->rff){ if(dbg_trcb)cbtrc(v,2);dc(af4((A)v->rff,v->rfc,z,(I)iwv,0,v));} dc((A)z); } if(dbg_tdep)deptrc(v,1); val(v),mf((I *)e); } for(;!v->a;)aplus_err(4,(A)MV(v)); R v->a; } Z void s1(V v,I a,I i){I *l=(I*)&v->l,*n;if(a==(I)v)R;for(;n=(I*)*l;l=n)if(n[1]==a)R; *l=(I)(n=ma(3)),*n=0,n[1]=a,n[2]=i;} /* Z void s0(V v,I a){I *l=(I*)&v->l,*n;for(;n=(I*)*l;l=n)if(n[1]==a){*l=*n,mf(n);R;}} */ Z void s0(V v,I a){ I *l=(I*)&v->l,*n; for(;n=(I*)*l;l=n) if(n[1]==a){ *l=*n,mf(n); R; } } Z I s2(V v,I a,I n){if(QV(a))n?s1(XV(a),(I)v,0):s0(XV(a),(I)v); else if(QE(a)){E e=XE(a); (void)s2(v,e->f,n); if(n>1&&e->f==MX(0)&&QV(*e->a)&&e->a[1]==ML(1)){s1(XV(*e->a),(I)v,1);R 0;} if(e->f==MN(0)&&e->n==2)R s2(v,e->a[1],n); DO(e->n,s2(v,e->a[i],n))}R -1;} /* void rmd(V v){A a;if(a=(A)v->e)s2(v,*a->p,0),dc(a),v->e=0,dc(v->i),v->i=0,v->z=1;} */ void rmd(V v){ A a; a=(A)v->e; if(a) (void)s2(v,*a->p,0); dc(a); v->e=0; dc(v->i); v->i=0; v->z=1; } void sad(V v,A a){rmd(v),v->e=(I)a,s2(v,*a->p,a->r),inv(v,0,1); if(a->r==2)v->i=aplus_nl;} Z I in(I s,I *b,I r){for(;r--;)if(b[r]==s)R 1;R 0;} Z I str(I *t,I r,I *b,I n,I *p) { I f; /* if(f=t[-1]==')'&&t[-3]==';')--t; */ f=t[-1]==')'&&t[-3]==';'; if(f)--t; do if(QS(*--t)&&!in(*t,b,r)&&!in(*t,p,n)) { if(n==999)prr(11,0); p[n++]=*t; } while(f&&*--t==';'); R n; } I rd(I *b) { Qs=0; for(t=b;*t&&*t!=':';++t); if(!*t)R rz(b); for(r=t;*++r;); { A f,z; V v=0; I i,p[999],n=1,r=b[1]=='[',*j,*k,y=1,d=r||b[1]==':'; if(d){ /* dependencies */ if(r){ /* itemwise */ if(b[3]!=']'||t!=b+4) prr(9,0); b[3]=b[2],b[2]=*b,b+=2; } goto L; } if(t[-1]=='}') /* fcn def */ { if(t==b+3) /* niladic f{} */ t[-1]=*b,b=t-1; /* f{}=>f */ else{ /* f{a;b;...} */ for(j=k=t;j>b;) { /* f{a;b;...}=>fab... */ *--k=*(j-=2); if(2<(j-b)) {if(j[-1]!=';') prr(9,0);} /* chk for delimiters */ else {if(0!=(j-b) && j[-1]!='{') prr(9,0);} } b=k; } goto L; } /* traditional fcn def */ if(t-b<4){ /* f a:{} or a f b:{} */ if(t-b==3)r=*b,*b=b[1],b[1]=r; /* a f b:{} => fab */ goto L; } /* operators */ if(y=*b!='('){ /* l (lo mop) r:{} OR l (lo dop ro) r:{} */ if(b[1]!='(' || t[-2]!=')') prr(9,0); if(ispu(b[0]) || ispu(b[2]) || ispu(b[3]) || ispu(t[-1])) prr(9,0); if(7==t-b && ispu(b[4])) prr(9,0); b[1]=b[3]; b[3]=b[4]; t[-2]=*b; /* l mop lo) l r:{} OR l dop lo ro l r:{} */ } else { /* (lo mop) r:{} OR (lo dop ro) r:{} */ if(t[-2]!=')') prr(9,0); if(ispu(b[1]) || ispu(b[2]) || ispu(t[-1])) prr(9,0); if(6==t-b && ispu(b[3])) prr(9,0); r=b[1]; b[1]=b[2]; b[2]=r; /* (mop lo) r:{} OR (dop lo ro ) r:{} */ } y=t-b++-y; /* y=5 for mop,y=6 for dop & point b to name */ y=y==5?2:y==6?3:0; if(!y)prr(9,0); L: r=t-b; if(!r)prr(9,0); if(QV(*b)) v=XV(*b),Cx=v->cx,*b=MS(v->s); else if(QS(*b)) v=vi(XS(*b),Cx); DO(r,if(!QS(b[i])&&b[i]!=')')prr(9,0)) Qs=*b; if(y==3&&*XS(b[2])->n=='g')++y; if(r-1>MAXR)prr(7,0); for(*p=0,j=t;*++t;){ if(*t==':')prr(9,0); if(*t==MN(0))n=str(t,j-b,b,n,p); } f=(A)(d?v->e:v->a); i=f&&QA(f)&&f->t>Xt?f->p[f->n]:0; z=ga(Xt,r,n+3,b),z->t+=y,z->n-=3,frep(z),z->p[n]=i,z->p[n+2]=(I)Cx; Qs=(I)z; mv(z->p,p,n),*++K=(I)z,*z->p=rz(j+1),--K; if(dbg_tdef)(void)deftrc(v,d); if (d) sad(v,z); else v->t=y,set(MV(v),(I)z,1); R (I)aplus_nl; } } aplus-fsf-4.22/src/a/s.c0000644000265000001440000006026210772770357010460 /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #include #include #include #include #include #include #include #include #include #include #if !defined(BITSPERBYTE) #define BITSPERBYTE 8 #endif #if !defined(BITS) #define BITS(x) (BITSPERBYTE * sizeof(x)) #endif #if defined(_AIX) fpflag_t fpe_bits=0; int nan_bits=0; int fp_checkerr(C *s) { H("%s:",s); H("FP_INEXACT:%d ",fpe_bits&FP_INEXACT ? 1:0); /* inexact result */ H("FP_DIV_BY_ZERO:%d ",fpe_bits&FP_DIV_BY_ZERO ? 1:0); /* divide by zero */ H("FP_UNDERFLOW:%d ",fpe_bits&FP_UNDERFLOW ? 1:0); /* underflow exception */ H("FP_OVERFLOW:%d ",fpe_bits&FP_OVERFLOW ? 1:0); /* overflow exception */ H("FP_INVALID:%d" ,fpe_bits&FP_INVALID ? 1:0); /* invalid operation */ NL; return 0; } #elif defined(linux) || defined(_HP) || defined(__APPLE__) fexcept_t fpe_bits=0; int nan_bits=0; int fp_checkerr(s)C *s; { H("%s:",s); #if !defined(__arm__) H("FE_INEXACT:%d ",fpe_bits&FE_INEXACT ? 1:0); /* inexact result */ #endif H("FE_DIVBYZERO:%d ",fpe_bits&FE_DIVBYZERO ? 1:0); /* division by zero */ H("FE_UNDERFLOW:%d ",fpe_bits&FE_UNDERFLOW ? 1:0); /* underflow exception */ H("FE_OVERFLOW:%d ",fpe_bits&FE_OVERFLOW ? 1:0); /* overflow exception */ H("FE_INVALID:%d" ,fpe_bits&FE_INVALID ? 1:0); /* invalid operation */ NL; return 0; } #elif defined(__osf__) unsigned long fpe_bits=0; int nan_bits=0; int fp_checkerr(s)C *s; { H("%s:",s); H("IEEE_STATUS_UNF:%d ",fpe_bits&IEEE_STATUS_UNF ? 1:0); /* underflow */ H("IEEE_STATUS_OVF:%d ",fpe_bits&IEEE_STATUS_OVF ? 1:0); /* overflow */ H("IEEE_STATUS_DZE:%d ",fpe_bits&IEEE_STATUS_DZE ? 1:0); /* divide-by-zero */ H("IEEE_STATUS_INV:%d" ,fpe_bits&IEEE_STATUS_INV ? 1:0); /* invalid */ NL; return 0; } #elif defined(HAVE_SVR4) || defined(__FreeBSD__) || defined(__NetBSD__) fp_except fpe_bits=0; int nan_bits=0; int fp_checkerr(s)C *s; { H("%s:",s); H("FP_X_IMP:%d ",fpe_bits&FP_X_IMP ? 1:0); /* imprecise (loss of precision)*/ H("FP_X_UFL:%d ",fpe_bits&FP_X_UFL ? 1:0); /* underflow exception */ H("FP_X_OFL:%d ",fpe_bits&FP_X_OFL ? 1:0); /* overflow exception */ H("FP_X_DZ:%d " ,fpe_bits&FP_X_DZ ? 1:0); /* divide-by-zero exception */ H("FP_X_INV:%d" ,fpe_bits&FP_X_INV ? 1:0); /* invalid operation exception */ NL; return 0; } #else int fp_anyerr(void ){R 0;} void fp_checkerr(void ){H("no fpe on Sun\n");} #endif Z I II[]={1,0,0,1,~0x7FFFFFFF,0x7FFFFFFF}; Z F FI[]={0,0,0,1,-123.0,123.0}; /* FI[4 5] filled in by infi(). */ F aplusInfinity=-1.0; #if defined(__osf__) int infi(void){FI[4]=-(FI[5]=aplusInfinity=DBL_INFINITY); R 0;} #else int infi(void){FI[4]=-(FI[5]=aplusInfinity=HUGE_VAL); R 0;} #endif #define DD(f,u,v,x) Z void f(u *r,v *a,v *w,I n) \ {u *t=r+n;I i=aw!=1,j=aw!=2; RESETXCP; \ for(;r>=1,w>>=1,t<<=1) \ if((a&1) x (w&1)) r|= t; \ R r;} /* extern F pif(),floor(),log(),exp(),pow();I aw;Z(*f)(),t,u,v; */ I aw;Z PFI f;Z I t,u,v; Z F fl(F x) { F y=floor(.5+x); R y-x>CT*(y>1?y:y<-1?-y:1.0)?y-1:y; } Z F frm(F x,F y){F z;R!y?x:(z=fl(x/y))==-fl(-x/y)?0.0:x-z*y;} I rm(I a,I b){I r;R a=0?a:!b?a:(r=a%b,b<0&&r>0||r<0&&b>0?r+b:r);} #if defined(_ULTRA_SPARC_VECTOR_OPS) /* !! BUG !! !! BUG !! !! BUG !! !! BUG !! !! BUG !! */ /* vlog_ incorrectly sets FPE bits for INF */ /* Once this bug is fixed we only need to check the */ /* FPE flags once at the end of the primitive */ /* For now we need to check each item of the array */ /* to see if it really is a NaN or just Inf */ /* !! BUG !! !! BUG !! !! BUG !! !! BUG !! !! BUG !! */ #define TEMPORARY_VLOG_BUG_WORKAROUND(xx) \ { int i=0,resetNeeded=0; \ for(;i0){ F t; t=log ( *a ) ; CHECKXCP; /* NOTEIT: add NAN_CHECK and CHECKXCP */ { I i=0; F *wprime; int incx=1, incy=1; if(!(wprime=(F *) malloc(n * sizeof(F))) ) { q=ERR_INVALID;return;} /* error on malloc */ for (i = 0; i < n; i++) wprime[i] = w[i] * t; vexp_(&n, wprime, &incx, r, &incy); CHECKXCP; /* NOTEIT: add NAN_CHECK and CHECKXCP */ free(wprime); return; } } { I i=0, i2=0; int incx = k, incy = 1; F *wprime; /* Special case for negative numbers in a ie. -1*0 1 2 3 */ if( k==0 && 0>=*a ) { DO(n,NAN_CHECK(*r++, *a>0?exp(*w*log(*a)):pow(*a,*w));a+=k;w+=j); CHECKXCP; return; } else { for(i=0; i=a[i] ) { DO(n,NAN_CHECK(*r++, *a>0?exp(*w*log(*a)):pow(*a,*w));a+=k;w+=j); CHECKXCP; return; } } if(!(wprime=(F *) malloc(n * sizeof(F))) ) { q=ERR_INVALID;return; /* error on malloc */ } vlog_(&n, a, &incx, wprime, &incy); /* !! BUG !! Temporary workaround !! BUG !! */ TEMPORARY_VLOG_BUG_WORKAROUND(wprime); /**/ CHECKXCP; /**/ if(q) {free(wprime);return;} /**/ /* !! BUG !! Temporary workaround !! BUG !! */ for (i=0, i2=0; i0){F t;NAN_CHECK(t,log(*a)) DO(n,NAN_CHECK(*r++,exp(t**w++)))CHECKXCP;R;} DO(n,NAN_CHECK(*r++, *a>0?exp(*w*log(*a)):pow(*a,*w));a+=k;w+=j)CHECKXCP;} #endif /*DD(ex,F,F,*a>0?exp(*w*log(*a)):pow(*a,*w))*/ DxHpc(<(*w>0?CT1:CT2)*,h0) DxHpc(>(*w>0?CT2:CT1)*,h1) DxHpc(<=(*w>0?CT2:CT1)*,h4) DxHpc(>=(*w>0?CT1:CT2)*,h5) Di(>*w?*a:,i2) DfHpc(>*w?*a:,f2) Di(<*w?*a:,i3) DfHpc(<*w?*a:,f3) #ifdef INDEX_PRIMITIVES DDidx(ne0,I,I,0) DDidx(ne1,I,I,1) DDidx(c0,I,C,a[i]==w[j]) DDidx(c1,I,C,a[i]!=w[j]) DDidx(c2,I,C,a[i]w[j]) DDidx(c4,I,C,a[i]<=w[j]) DDidx(c5,I,C,a[i]>=w[j]) DDidx(e0,I,I,!mt((A)a[i],(A)w[j])) DDidx(e1,I,I,!!mt((A)a[i],(A)w[j])) Z I sc2(S a,S w){ R strcmp(a->n, w->n) < 0; } Z I sc3(S a,S w){ R strcmp(a->n, w->n) > 0; } Z I sc4(S a,S w){ R strcmp(a->n, w->n) <= 0; } Z I sc5(S a,S w){ R strcmp(a->n, w->n) >= 0; } DDidx(e2,I,I,sc2(XS(a[i]),XS(w[j]))) DDidx(e3,I,I,sc3(XS(a[i]),XS(w[j]))) DDidx(e4,I,I,sc4(XS(a[i]),XS(w[j]))) DDidx(e5,I,I,sc5(XS(a[i]),XS(w[j]))) #else DD(ne0,I,I,0) DD(ne1,I,I,1) DD(c0,I,C,*a==*w) DD(c1,I,C,*a!=*w) DD(c2,I,C,*a<*w) DD(c3,I,C,*a>*w) DD(c4,I,C,*a<=*w) DD(c5,I,C,*a>=*w) DD(e0,I,I,!mt((A)*a,(A)*w)) DD(e1,I,I,!!mt((A)*a,(A)*w)) Z I sc2(S a,S w){ R strcmp(a->n, w->n) < 0; } Z I sc3(S a,S w){ R strcmp(a->n, w->n) > 0; } Z I sc4(S a,S w){ R strcmp(a->n, w->n) <= 0; } Z I sc5(S a,S w){ R strcmp(a->n, w->n) >= 0; } DD(e2,I,I,sc2(XS(*a),XS(*w))) DD(e3,I,I,sc3(XS(*a),XS(*w))) DD(e4,I,I,sc4(XS(*a),XS(*w))) DD(e5,I,I,sc5(XS(*a),XS(*w))) #endif Di(+,i0) DfHpc(+,s_f0) Di(*,i1) DfHpc(*,s_f1) Di(-,i4) DfHpc(-,f4) Di(/,i5) DfHpcNegZ(/,f5) Di(<,jj0) Di(>,jj1) Di(==,jj2) Di(!=,jj3) Di(<=,jj4) Di(>=,jj5) #ifdef INDEX_PRIMITIVES DDidx(z0,I,I,(a[i]&&w[j])?1:0) /* Di(&,z0) */ DDidx(z1,I,I,(a[i]||w[j])?1:0) /* Di(|,z1) */ #else DD(z0,I,I,(*a&&*w)?1:0) /* Di(&,z0) */ DD(z1,I,I,(*a||*w)?1:0) /* Di(|,z1) */ #endif Di(&, bw0) Di(|, bw1) Bw(<, bx2) DD( bw2,I,I,bx2(*a,*w)) Bw(>, bx3) DD( bw3,I,I,bx3(*a,*w)) Bw(==,bx4) DD( bw4,I,I,bx4(*a,*w)) Di(^, bw5) Bw(<=,bx6) DD( bw6,I,I,bx6(*a,*w)) Bw(>=,bx7) DD( bw7,I,I,bx7(*a,*w)) /* Integer Float i (i is for FF) */ PFI df[][2]={ (PFI)z0, 0, /* 0 ^ */ (PFI)z1, 0, /* 1 */ (PFI)i0, (PFI)s_f0, /* 2 + */ (PFI)i1, (PFI)s_f1, /* 3 */ (PFI)i2, (PFI)f2, /* 4 */ (PFI)i3, (PFI)f3, /* 5 */ (PFI)i4, (PFI)f4, /* 6 - */ (PFI)i5, (PFI)f5, /* 7 */ (PFI)i6, (PFI)f6, /* 8 | */ (PFI)jj0,(PFI)h0, /* 9 < */ (PFI)jj1,(PFI)h1, /* 10 > */ (PFI)jj2,(PFI)h2, /* 11 = */ (PFI)jj3,(PFI)h3, /* 12 */ (PFI)jj4,(PFI)h4, /* 13 */ (PFI)jj5,(PFI)h5, /* 14 */ 0,(PFI)ex, /* 15 * */ 0,(PFI)lg, /* 16 */ 0,(PFI)s_pi}; /* 17 */ PFI dde[]={(PFI)e2,(PFI)e3,(PFI)e0,(PFI)e1,(PFI)e4,(PFI)e5}; PFI ddc[]={(PFI)c2,(PFI)c3,(PFI)c0,(PFI)c1,(PFI)c4,(PFI)c5}; PFI ddne[]={(PFI)ne0,(PFI)ne1}; PFI ddbw[]={(PFI)bw0,(PFI)bw1,(PFI)bw2,(PFI)bw3,(PFI)bw4,(PFI)bw5,(PFI)bw6,(PFI)bw7}; /* #define X0 Q(Xt<=wt||(j=wt>Ft)&&w->n&&i!=11&&i!=12,6) */ #define X0 Q(Xt<=wt||(j=wt>Ft||a->t>Ft)&&w->n&&(i<9||i>14),6) #define X2_1 {if(a->t!=w->t){if(a->t+w->t==1)F2 else if(!a->n)a=(A)cn(0,w->t);\ else if(!w->n)w=(A)cn(1,a->t);\ else { diff_t=1; if (i!=11 && i!=12) R q=6,0;}}\ else if(w->t==Et && etNotOk(a,w,i) ) R q=6, 0;} /* if(z->c==1&&t==wt)ic(z) can't reuse when possible errors */ #define FF !j?df[i][wt]:\ (i<9||i>14)?\ (i&1?(wt==Et?(PFI)e0:\ (PFI)c0):wt==Et?(PFI)e1:(PFI)c1):\ (diff_t)?ddne[i-11]:\ (wt==Et)?dde[i-9]:ddc[i-9] Z I etNotOk(A a,A w,I i){ switch(i){ case 9: case 10: case 13: case 14: DO(a->n,if(!QS(a->p[i])) R 1) DO(w->n,if(!QS(w->p[i])) R 1) break; default: break; } R 0; } I bs(A a,A w,I i){A z;ND2 if(a->t==Et) R bwcv(a,w); Q(a->t!=w->t||a->t!=It,ERR_TYPE) if(aw=a->n==1&&(w->n!=1||w->r>=a->r))z=w;else if(w->n==1)aw=2,z=a; else{Q(a->r!=w->r,ERR_RANK)Q(cm(a->d,w->d,a->r),ERR_LENGTH)z=a->c>1?w:a;} W(gd(It,z)) C2(ddbw[i-76]) } I ds(A a,A w,I i){A z;I t,wt,j=0,diff_t=0;ND2 if(i==7||i>14)F2 else if(i<2)I2 else X2_1 wt=w->t;X0 if(aw=a->n==1&&(w->n!=1||w->r>=a->r))z=w;else if(w->n==1)aw=2,z=a; else{Q(a->r!=w->r,7)Q(cm(a->d,w->d,a->r),8)z=a->c>1?w:a;} t=i<9?wt:i<15?It:Ft; W(gd(t,z)) C2((unsigned long)(FF)) } I os(A a,A w,I i) { A z; I j=0,diff_t=0,n; i-=50; ND2; if(i>14||i==7)F2 else X2_1 { PFI f; XA; XW,t,r=ar+wr; C *p,*ap; X0 Q(r>MAXR,13) OF(n,wn,an)W(ga(t=i<9||i>14?wt:It,wr+ar,n,ad)) mv(z->d+ar,wd,wr); p=(C*)z->p;f=(PFI)(FF); aw=1,ap=(C*)a->p; DO(an,(*(I(*)(C*,C*,I*,I))f)(p,ap,w->p,wn); ap+=Tt(at,1); p+=Tt(t,wn)); R(I)z; } } #define IP(f,x,y) GV2(F,f){I k=v;F *ap=a,*wp=w,s,t;DO(u,DO(k,a=ap;w=wp++;t=x;DO(aw,y;++a;w+=k)*r++=t)ap+=aw;wp-=k)} IP(x4,FI[4],if(t<(s=*a+*w))t=s) IP(x5,FI[5],if(t>(s=*a+*w))t=s) #ifdef HPC_PWR2 GV2(F,dot){F *t=a+aw,s=0.0;hpc_dotproduct(r,a,w,aw);} #else GV2(F,dot){F *t=a+aw,s=0.0;for(;a>1, DO(n>>1,m2(r,a,w,l,n);w+=2;r+=2) if(n&1)m0(r++,a,w++,l,n); w-=n;a+=2*l;r+=n); CHECKXCP;if(q)R 0; if(m&1){ DO(n>>1,m1(r,a,w,l,n);w+=2;r+=2); if(n&1){*r=0;DO(l,*r+=*a++**w;w+=n)} } CHECKXCP; R -1; } I is(A a,A w,I i){A z;i-=64;ND2 F2 {I ar=a->r,*ad=a->d;I wt=w->t,wr=w->r,*wd=w->d,r,n;aw=*wd;Q(!ar||!wr,7)Q(ad[--ar]!=aw,8) if(i==2&&!ar&&wr==1){W(gs(Ft))C2(dot)} u=tr(ar,ad),v=tr(--wr,++wd),r=ar+wr; Q(r>MAXR,13)OF(n,u,v)W(ga(wt,r,n,ad))mv(z->d+ar,wd,wr); C2((i==2?(PFI)mmu:i==4?(PFI)x4:(PFI)x5))}} #define RG(q,f,x,y) Z void f(q *r,q *w,I n){q s= x,*t=w+n;RESETXCP; \ for(;w*w)s= *w) RGHpc(F,q3,FI[5],if(s>*w)s= *w ,hpc_vrsf3) PFI fr[][2]={(PFI)b0,0,(PFI)b1,0,(PFI)r0,(PFI)q0,(PFI)r1,(PFI)q1,(PFI)r2,(PFI)q2,(PFI)r3,(PFI)q3}; GV1(I,s0){*r= *w++;(*(I(*)(I*,I*,I*,I))f)(r+1,r,w,n-1);} GV1(F,s1){*r= *w++;(*(I(*)(F*,F*,F*,I))f)(r+1,r,w,n-1);} #ifdef HPC_PWR2 static void s1Scan(F *r,F *w,I n,I i){ switch(i){ case 2: hpc_vscf0(r,w,n);break; case 3: hpc_vscf1(r,w,n);break; case 4: hpc_vscf2(r,w,n);break; case 5: hpc_vscf3(r,w,n);break; };} #endif GV1(C,s3) { I k=Tt(t,n=v); tmv(t,(I *)r,(I *)w,n); DO(u-1,(*(I(*)(C*,C*,C*,I))f)(r+k,r,w+=k,n); r+=k) } GV1(C,rr) { I k=Tt(t,n=v); tmv(t,(I *)r,(I *)w,n); RESETXCP; DO(u-1,(*(I(*)(C*,C*,C*,I))f)(r,r,w+=k,n)); CHECKXCP; } I rs(A a,I i){A z;i-=46;ND1 if(i<2)I1 else X1{I at=a->t,ar=a->r,*ad=a->d; if(ar){u=*ad++;if(!u&&(i==4||i==5))at=Ft;--ar;} if(!ar){W(gs(at))C1(fr[i][at])}W(ga(at,ar,v=tr(ar,ad),ad)) if(!u)R trp(at,z->p,at?(I*)(FI+i):II+i,v),(I)z;f=df[i][t=at],aw=0;C1(rr)}} #ifdef HPC_PWR2 I sc(A a,I i){A z;i-=40;ND1 if(i<2)I1 else X1{XA;if(!ar||!an)R ic(a); W(ga(at,ar,an,ad))f=df[i][at],aw=0; if((i>=2)&&(at==1)&&(ar==1)) { s1Scan((F *)z->p,(F *)a->p,a->n, i);return(I)z;} else { C1(ar>1?(t=at,u= *ad,v=tr(ar-1,ad+1),(PFI)s3):at?(PFI)s1:(PFI)s0)}} } #else I sc(A a,I i){A z;i-=40;ND1 if(i<2)I1 else X1{XA;if(!ar||!an)R ic(a); W(ga(at,ar,an,ad))f=df[i][at],aw=0; C1(ar>1?(t=at,u= *ad,v=tr(ar-1,ad+1),(PFI)s3):at?(PFI)s1:(PFI)s0)}} #endif #ifdef __lucid G2(I,p0) { I *p=r,s; F fp; DO(n,*p++=*w++) DO(u-1,s=*(a+=v); p=r; DO(n,fp=((F)*p)*((F)s)+((F)*w++); Q(fp>(F)(LONG_MAX)||fp<(-1.0*fabs((F)(LONG_MIN))),-2) *p++=(I)fp ) ) R -1; } #else G2(I,p0) { I *p=r,s; F fp; DO(n,*p++=*w++) DO(u-1,s=*(a+=v); p=r; DO(n,fp=((F)*p)*((F)s)+((F)*w++); Q(fp>(F)(LONG_MAX)||fp<(F)(LONG_MIN),-2) *p++=(I)fp ) ) R -1; } #endif GV2(F,p1) { F *p=r,s; RESETXCP; DO(n,*p++=*w++) DO(u-1,s=*(a+=v); p=r; DO(n,*p=*p*s+*w++; p++ ) ) CHECKXCP; } H2(ncd){A z;I n;ND2 n=a->n;if(a->t||w->t)F2{ I wt=w->t,wr=w->r,*wd=w->d;Q(!wr--||a->r>1,7)u=*wd++; Q(n!=1&&n!=u,8)v=n>1;W(ga(wt,wr,tr(wr,wd),wd))if(!u)R zr(z);C2(wt?(PFI)p1:(PFI)p0)}} GV2(I,o0){I s;DO(v,s=*w++;r+=n;a+=u;DO(u,r-=v;*r=rm(s,*--a);s=*a?(s-*r)/ *a:0)r++)} GV2(F,o1){F s;RESETXCP;DO(v,s=*w++;r+=n;a+=u;DO(u,r-=v;*r=frm(s,*--a);s=*a?(s-*r)/ *a:0.0)r++)CHECKXCP;} H2(dcd){A z;ND2 if(a->t||w->t)F2{I ar=a->r,an=a->n;XW;u=an,v=wn;Q(ar>1,7)W(ga(wt,wr+ar,u*v,wd-ar))if(ar)*z->d=u;if(!u)R(I)z;C2(wt?(PFI)o1:(PFI)o0)}} #ifndef TRUE #define TRUE (1) #endif #ifndef FALSE #define FALSE (0) #endif #define MF(u,v,x,qReset) { \ u *r=(u*)z->p,*t=r+a->n; \ v *w=(v*)a->p; \ RESETXCP; \ for(;rp,*t=r+a->n; \ v *w=(v*)a->p;RESETXCP; \ for(;rp,*t=r+a->n; \ v *w=(v*)a->p; \ /*RESETXCP*/; \ x; \ /*CHECKXCP*/; \ R(I)z;} #define MT(Ttype) if(Ttype&&a->c==1)++(z=a)->c;else W(gd(Ttype?a->t:It,a)) H1(neg){ A z; ND1 if(a->t==It) { I *w=(I *)a->p, *t=w+a->n; for(;wt==It) { MT(1) MF(I,I,-*w,FALSE) } } F1 MT(1) MF(F,F,-*w,FALSE) } H1(aab){A z;ND1 if(a->t==It) { I *w=(I *)a->p, *t=w+a->n; for(;wt==It) { MT(1) MF(I,I,*w<0?-*w:*w,FALSE) } } F1 MT(1) MF(F,F,*w<0?-*w:*w,FALSE) } H1(sgn){A z;ND1 X1 MT(0)if(a->t==It)MF(I,I,*w<0?-1:*w>0,FALSE)else MF(I,F,*w<0?-1:*w>0,FALSE)} H1(not){A z;ND1 I1 MT(1)MF(I,I,!*w,FALSE)} H1(bwnot){A z;ND1 I1 MT(1)MF(I,I,~*w,FALSE)} /* H1(cln){A z;ND1 F1 MT(1)MF(F,F,-fl(-*w),FALSE)} */ H1(rec){A z;ND1 F1 MT(1)MF(F,F,(*w?1.0/ *w:aplusInfinity),FALSE)} #ifdef HPC_PWR2 H1(aln){A z;ND1 F1 MT(1)NANMFhPC(F,F,hpc_InitNatLog(); hpc_mAlnFF(r,w,a->n))} H1(aen){A z;ND1 F1 MT(1)NANMFhPC(F,F,hpc_InitExponential(); hpc_mAenFF(z->p,a->p,a->n))} #else #if defined(_ULTRA_SPARC_VECTOR_OPS) I aln (a) A a; { A z; ND1 F1 MT(1) { F *r=(F *)z->p; F *w=(F *)a->p; int incx=1, incy=1, n=a->n; if( n>0 ) { /* NOTEIT: add RESETXCP */ RESETXCP; vlog_(&n, w, &incx, r, &incy); /* !! BUG !! Temporary workaround !! BUG !! */ TEMPORARY_VLOG_BUG_WORKAROUND(r); /* */ /* !! BUG !! Temporary workaround !! BUG !! */ /* NOTEIT: add NAN_CHECK */ CHECKXCP; } return (I)z; } } #else H1(aln){A z;ND1 F1 MT(1)NANMF(F,F,log(*w))} #endif #if defined(_ULTRA_SPARC_VECTOR_OPS) I aen (a) A a ; { A z; ND1 F1 MT(1) { F *r=(F *)z->p, *t=r+a->n; F *w=(F *)a->p; int n=a->n, incx=1, incy=1; if( n>0 ) { RESETXCP; /* NOTEIT: add RESETXCP */ vexp_(&n, w, &incx, r, &incy); CHECKXCP; /* NOTEIT: add NAN_CHECK */ } return (I)z; } } #else H1(aen){A z;ND1 F1 MT(1)NANMF(F,F,exp(*w))} #endif #endif H1(pit){A z;ND1 F1 MT(1)MF(F,F,3.14159265358979323846**w,FALSE)} H2(sqr){A z;ND2 F1 if(!w->r&&It==w->t&&2==*w->p){MT(1)MF(F,F,*w**w,FALSE)}R ds(a,w,15);} #if defined(_AIX) || defined(HAVE_SVR4) || defined(linux) || defined(__FreeBSD__) || defined (__NetBSD__) || defined(__APPLE__) /* Z F imaxmin[2]={2147483648.0-CT,-2147483648.0}; */ Z H1(fli){A z;MT(0){ I *r=(I*)z->p,*t=r+a->n;F x,*w=(F*)a->p; F imaxmin[2]; imaxmin[0]=(((F)LONG_MAX)+1)-CT; imaxmin[1]=(F)LONG_MIN; RESETXCP; for(;rimaxmin[0]||xp,*t=r+a->n;F x,*w=(F*)a->p; F imaxmin[2]; imaxmin[0]=(((F)LONG_MAX)+1)-CT; imaxmin[1]=(F)LONG_MIN; RESETXCP; for(;rimaxmin[0]||xd?rnd(n):d%n; } #else Z I rnd(I n){I d=random(),r=(unsigned)0x80000000%n;R r>d?rnd(n):d%n;} #endif H1(ran){A z;ND1 I1 MT(1)DO(a->n,if(a->p[i]<1){q=9;break;} z->p[i]=rnd(a->p[i]))R(I)z;} H2(dea){ A z;I h,j,k,*p,*t,m,n; ND2 I2 m= *a->p,n= *w->p; Q(a->n!=1||w->n!=1||m<0||m>n,9); if(m>n/8){ W(gv(It,n))p=z->p; DO(n,p[i]=i); for(t=p+m;pn=*z->d=m,(I)z; } #if defined(BSTUB) /* tm allocates "temporary" work areas under the old buddy system t-1 was */ /* the number of words were stored for the allocation */ { unsigned long zz,ii; W(gv(It,m)) if(!m) R(I)z; p=z->p; for (zz = (2*m) >> 1, ii = 1; zz != 0; zz >>= 1, ii++); zz=((2<<(ii-1))-1)+2; t=k_tm(zz); *t=ii; j=1<<(0xff&(h=*t)); } #else W(gv(It,m))if(!m)R(I)z;p=z->p,t=k_tm(2*m)-1,j=1<<(0xff&(h=*t)); #endif DO(j--,t[i]=-1); { long i, _i; _i = m; for (i = 0; i < _i; i++) { m=rnd(n); k=j&m; for(;t[k]!=-1;) { if (t[k]==m) { m=rnd(n); k = j&m; } else { ++k; k = j&k; } } t[k]=*p++=m; } } /* DO(m,k=j&(m=rnd(n));for(;t[k]!=-1;)k=j&(t[k]==m?(m=rnd(n)):++k);t[k]=*p++=m); */ R *t=h,(I)z;} aplus-fsf-4.22/src/a/si.c0000644000265000001440000000406510772770357010630 /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #include #include #include #include #include extern I MY[]; static C *ks_buf[256]; A getRawKstack(void) { I n=K-MY; A z=gv(It,n); DO(n,z->p[i]=MY[i+1]); R z; } A getSymKstack(void) { I n=K-MY;I *zp,i,s; C **ns=get_primlist(1,1); A z=gv(Et,n);zp=z->p; i=1; while(i<=n) { s=MY[i++]; if(0==s){*zp++=(I)aplus_nl;} else if(s>-9999&&s<6) { if(0>s)*zp++=(I)gi(-s); else *zp++=(I)gvi(Et,1,MS(si(ns[s]))); } else if(QV(s)) { *zp++=(I)gvi(Et,2,gsv(0,"file"),gsv(0,(C *)(s&~aplusMask))); *zp++=(I)gi(-MY[i++]); } else if(QS(s)) { *zp++=(I)gvi(Et,2,gsv(0,"expr"),gsv(0,(C *)(s&~aplusMask))); } else { A f=(A)s; sprintf((C *)ks_buf,"%s.%s",((CX)f->p[f->n+2])->s->n,XS(*f->d)->n); *zp++=(I)gvi(Et,2,gsv(0,"func"),gsv(0,(C *)ks_buf)); } } R z; } static A lastSavedKstack=0; static int recurseKstack=0; void snapshotKstack() { extern A sikAsAObj() ; /* Consider changing signal handlers for segv and bus */ if(recurseKstack==0) { recurseKstack=1; if( lastSavedKstack && QA(lastSavedKstack) ) { dc(lastSavedKstack); lastSavedKstack=0; } lastSavedKstack=(A)sikAsAObj(); recurseKstack=0; } } A showLastSavedKstack() { if(recurseKstack==1) { H("\343 Internal Error _doErrorStack\n"); return aplus_nl; } if( lastSavedKstack && QA(lastSavedKstack) ) return (A)ic(lastSavedKstack); else return aplus_nl; } aplus-fsf-4.22/src/a/u.c0000644000265000001440000004112210772770360010446 /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #include /* Needed for locking in si() */ #include #include #include #include #include #include #include #include #if !defined(__cfront) #include #endif #include /* strings not equal */ #define strneq(a,b) (*(a)!=*(b)||strcmp((a),(b))!=0) void *Glbrtn ; jmptype J; I G=0, aplus_errno=0; Z C *r,*s; Z I *t,tb[190000]; static A zG; static I Reset; #ifdef BSTUB #define SBS_DEFAULTBLKSZ ((1<<12)-24) #define SBS_MAXBLKSZ (1<<26) #else #define SBS_DEFAULTMZIDX 12 #define SBS_MAXMZIDX 26 #endif #define SBS_BLOCKTHRESHOLD 4 #define SBS_TRIGGERRATIO 4 #define HA(n) (ha(n)) #define STARTHASHSHIFT (10) #define STARTHASHSIZE (1<nb); for(i=0;inb;++i) for(s0=(S)SymHashTable->b[i];s0;s0=s1) { s1=s0->s; sp=(S *)(newtable->b+((newtable->nb-1)&HA(s0->n))); s0->s=*sp; *sp=s0; ++newtable->ni; } bfree((char *)SymHashTable); SymHashTable=newtable; } Z SBS allocNewBlock(int mw) { SBS cur; int blocksize; int mzidx=0; /* allocate new block, and add to head of list */ #ifdef BSTUB blocksize=SBS_DEFAULTBLKSZ; while(blocksizesize=blocksize-4; cur->idx=cur->count=0; cur->next=SymBlockListHead.next; SymBlockListHead.next=cur; return cur; } Z S newSymbol(const C *str,S prevsym) { int mw; SBS cur,prev; S res; mw=((12+strlen(str))>>2)&~0x01; for(cur=&SymBlockListHead,prev=cur;cur=cur->next;prev=cur) { if (cur->size-cur->idx>=mw) break; } if(!cur) { allocNewBlock(mw); prev=&SymBlockListHead; cur=prev->next; } res=(S)(cur->buf+cur->idx); res->s=prevsym->s,prevsym->s=res,strcpy(res->n,str); /* See if we need to move block to Full list. */ cur->idx += mw; ++cur->count; if(cur->size-cur->idxnext=cur->next; cur->next=FullSymBlockList; FullSymBlockList=cur; } /* See if we need to grow hash table. */ if(SymHashTable->nb*SBS_TRIGGERRATIO<++SymHashTable->ni)growSymHashTable(); R res; } void symhti(void){SymHashTable=hti(STARTHASHSIZE);} /* The insertion of a new symbol needs to be guarded since si() can be */ /* called from other threads */ static pthread_mutex_t newSymbol_lock = PTHREAD_MUTEX_INITIALIZER; #if defined(linux) static int _initMutex(void) { int rc; pthread_mutexattr_t mattr; if(0!=(rc=pthread_mutexattr_settype(&mattr, PTHREAD_MUTEX_ADAPTIVE_NP))) { perror("initMutex():pthread_mutexattr_settype"); } if (rc==0 && pthread_mutex_init(&newSymbol_lock, &mattr)) { perror("initMutex():thread_mutex_init"); } return 0; } #endif S si(const C *n) { S s,a=(S)(((S *)(SymHashTable->b))+((SymHashTable->nb-1)&HA(n))); for(;(s=a->s)&&strneq(n,s->n);a=s) ; if(s==0) { int rc; #if defined(linux) static int initMutex=1; if(initMutex) initMutex=_initMutex(); #endif if(0!=(rc=pthread_mutex_lock(&newSymbol_lock))) { perror("si() pthread_mutex_lock"); } { /* Need to re-check for Symbol after getting lock */ S a=(S)(((S *)(SymHashTable->b))+((SymHashTable->nb-1)&HA(n))); for(;(s=a->s)&&strneq(n,s->n);a=s) ; if(s==0) { s=newSymbol(n,a); } } if(rc==0 && pthread_mutex_unlock(&newSymbol_lock)) { perror("si() pthread_mutex_unlock"); } } R s; } A SymbolTableHashChainLengths(void) { A z = gv(It, SymHashTable->nb); I *p = z->p; I i, j; S a, s; for (i = 0; i < SymHashTable->nb; i++) { for (j=0,a=(S)(((S *)(SymHashTable->b)) + i); s = a->s; j++,a=s); p[i] = j; } R z; } A SymbolTableBlockInfo(void) { A t,z = gv(Et,3); I count, *ip; SBS cur; z->p[0]=(I)gvi(It,2,SymHashTable->nb,SymHashTable->ni); for(count=0,cur=&SymBlockListHead;cur=cur->next;++count) ; t=gm(It,count,3),ip=t->p; for(cur=&SymBlockListHead;cur=cur->next; *ip++=cur->size,*ip++=cur->idx,*ip++=cur->count) ; z->p[1]=(I)t; for(count=0,cur=FullSymBlockList;cur;++count,cur=cur->next) ; t=gm(It,count,3),ip=t->p; for(cur=FullSymBlockList;cur;cur=cur->next) *ip++=cur->size,*ip++=cur->idx,*ip++=cur->count; z->p[2]=(I)t; R z; } V sv(CX c,S s){C *t=(C *)strchr(s->n,'.'),b[99]; if(t)*t=0,strcpy(b,s->n),*t='.',c=cxi(si(b)),s=si(t+1);R vi(s,c);} V svlu(CX c,S s){C *t=(C *)strchr(s->n,'.'),b[99]; if(t)*t=0,strcpy(b,s->n),*t='.',c=cxlu(si(b)),s=si(t+1);R c?vlu(s,c):(V)0;} I ispu(I c){R c==':'||c==';'||c=='('||c==')'||c=='{'||c=='}'||c=='['||c==']';} Z I issp(I c){R c==' '||c=='\n'||c=='\t'||c==12;} I isal(I c){R c>='a'&&c<='z'||c>='A'&&c<='Z'||c=='_';} I isdi(I c){R c>='0'&&c<='9';} I isan(I c){R isal(c)||isdi(c);} /* * readDoubleFromString - s - pointer to parsing source - d - ptr to double * handles negatives (high or low minus, depending on mode) and "Inf". * Result: 1 on success, 0 on failure - number loaded in d, and s advanced */ Z I readDoubleFromString(C **s,F *d) { C *r=*s; I i='\242'==*r||(1!=APL)&&'-'==*r,j; r+=i; j=strncmp(r,"Inf",3)||isal(r[3]); if(j&&!isdi(r['.'==*r]))R 0; if(!j)*s=r+3,*d=Inf; #ifdef linux /* Linux's strtod differs from other implementations in that it also */ /* converts hexadecimal values. This causes problems for A+ code line */ /* y,@0x or y,@0x22 where it removes both the 0 and the x */ else { if( r[0]=='0'&&(r[1]=='x'||r[1]=='X')) { *d=0.0; *s=r+1; } else for(*d=strtod(r,s);**s=='0';++*s); } #else else for(*d=strtod(r,s);**s=='0';++*s); #endif if(i)*d=-*d; R 1; } extern I dbg_txeq; C *sy(C *s){for(;isan(*++s););R s;} C *dlb(C *s){for(;issp(*s);++s);R s;} C *ssym(C *s){for(;isan(*++s)||*s=='.';);R s;} C *cl(C *s){for(;s=dlb(s),CCtest(s);)for(;*++s&&*s!='\n';);R s;} C *bl(C *s){for(;*s&&!issp(*s);++s);R s;} void tc(I *t){for(;t>tb;)if(!ispu(*--t))dc((A)*t);longjmp(J,-2);} Z C *ts[]={"wsfull","stack","undefined","MAX args: 9","( nesting too deep"}; /* trr modified to replace c at *e, to restore string element which has been temporarily repalced by \0, after error message is displayed */ Z void trr(I q,C *s,C *e,C c) { if(!G)H("%s[token]: %s %s\n",CC,q==2?s:"",ts[q]); if(e)*e=c; tc(t); } /* changing to char cast */ Z void brr(I c){if(!G)H("TOKEN: open %c\n",(char)c);tc(tb);} Z I u_rs(C *v,I i) { I t=0; C c=*s; *s=0; if(i&&(*v=='\312'||(t=aplus_pi(v)))) { if(c=='/'||c=='\\'||c=='\256'||c=='.'&&!isan(s[1])) { *s++=c; if(c=='.'&&*s&&!ispu(*s)&&!issp(*s))++s; c=*s,*s=0,t=aplus_pi(v); } if(!t)trr(2,v,s,c); } else { if(i==1)trr(2,v,s,c); t=MS(si(v)); } R *s=c,t; } Z I rs_uni(C *v) { C c;I z,idx; idx=(v[2]&&'='==v[3])?4:3; c=v[idx],v[idx]='\0'; z=aplus_pi(v); v[idx]=c; if(z) {s+=idx;R z;} else R 0; } Z I rq(I c){while(*++s&&((c=='"'?*s=='\\':*s==c&&s[1]==c)?(I)++s:*s!=c));R *s;} Z I acp(C *d,const C *s){C *t=d;for(;*d=*s;++d,++s)if(*s=='\'')++s;R d-t;} Z I ccp(C *d,const C *s) { C *t=d; for(;*d=*s;++d,++s) if(*s=='\\') if(*++s=='n')*d=10; else if(!isdi(*s))*d=*s; else { I j=3,n=*s-'0'; for(;isdi(*++s)&&--j;n=n*8+*s-'0'); --s,*d=n; } R d-t; } A gsv(I i,const C *s) { I n=s?strlen(s):0; A z=gv(Ct,n); if(n) { if(!i)strcpy((C *)z->p,s); else n=z->n=*z->d=i==2?ccp((C *)z->p,s):acp((C *)z->p,s); if(n==1)z->r=0; } R z; } A gst(I x,C *s){A r=(A)gsv(x,s);r->r=1;return r;} /* gst() is a cover for gsv() which always returns a vector. */ Z I gvs(I t,I n,I *s){R(I)gc(t,n!=1,n,&n,s);} A gvi(I t, I n,...) { I x; A z; va_list ap; P zp; va_start(ap, n); z=gv(t,n);zp.i=z->p; switch(t) { CS(It,DO(n,*zp.i++=va_arg(ap,I))) CS(Ft,DO(n,*zp.f++=va_arg(ap,F))) CS(Ct,DO(n,*zp.c++=(C)va_arg(ap,I))) CS(Et,DO(n,*zp.i++=(x=va_arg(ap,I))?x:(I)aplus_nl)) default:DO(n,*zp.i++=va_arg(ap,I))break; } va_end(ap); R z; } Z I rw() { I n=0,y; F d[9999]; C c=*s,*v=s; extern I *XY; if(ispu(c)&&(c!=':'||s[1]!='='))R *s++; /* look for a si argument */ if(c==SI_CHAR) { if(!isdi(*++s))R ML(0); n=*s++-'0'; if(Y+n>=XY)trr(1,"",0,0); R ML(n-=X-Y); } /* look for a quoted string */ if((n=c=='"')||c=='\'')R ++v,rq(c),*s=0,n=(I)gsv(n+1,v),*s++=c,n; /* look for a symbol constant */ for(n=0;*s=='`';s=cl(s)){s=ssym(v=s);t[n++]=u_rs(v+1,0);} if(n)R gvs(Et,n,t); /* look for a numeric constant */ for(;readDoubleFromString(&s,d+n);s=dlb(s))if(++n==9999)trr(1,"",0,0); /* doubles now loaded in d, n is howmany, s is at next token */ if(n) { C c=*s;*s=0;y=(I)strpbrk(v,".Ee"),*s=c; if(!y)DO(n,if(y=d[i]!=(t[i]=d[i])){q=0;break;}); R gvs(y?Ft:It,n,y?(I*)d:t); } /* look for a uni-mode compound (X.#) primitive */ if(APMODE_UNI==APL&&isal(*v)&&'.'==v[1]&&(n=rs_uni(v)))R n; /* look for a name */ if(s=cl(s),n=isal(*s)){s=sy(v=s);n=u_rs(v,2);} if(*s=='.'&&isal(s[1])&&(QS(n)||!n)) { s=sy(v=s+1); y=u_rs(v,2); if (QS(y)) R MV(vi(XS(y),n?cxi(XS(n)):Rx)); else trr(2,".",0,0); /* trr does longjmp */ } if(n)R n; if(*++s=='='||*s==':')++s; R u_rs(v,1); } Z I ra(I k) { r=s; t=tb; if(k)*t++='{'; for(;*s;++t,s=cl(s))*t=rw(); if(k)*t++='}'; *t=0; R rd(tb); } Z I u,c,v;void tfl(void){/*ioctl?*/fflush(stdout);} void pr(void){q=0;if(!Reset){DO(u+v,H("*"))H(" "),tfl();}} Z I chk(void){if(c)if(--s,!rq(c))R c;else --v,++s; for(;s=cl(s),c=*s;++s){if(c=='"'||c=='\'')if(!rq(c))R ++v; if(c=='{'||c=='(')++v; else if(c=='}'||c==')')--v;} R v<0?(v=0):v>0||s[-2]==':';} void ff(A a){if(Tf&&!qz(a))paf(a,0,0),NL,tfl();} Z I bal(I f) { C c,b[999],*v=s; I i=0,j,k=0; for(;s=cl(s),c=*s;++s) switch(j=0,c) /* lots of intentional fall-thru */ { case'"': CS('\'',if(!rq(c))brr(c)); CS(';',if(!i){if(f)R -1;k=1;}); case '(': case '[': CS('{',if(i==999)trr(4,"",0,0);b[i++]=*s); case ')': ++j; case ']': ++j; CS('}',if(!i){if(f)R -1;brr(*s);}else if(b[--i]!="{[("[j])brr(b[i])); } if(i)brr(b[i-1]); if(f)R -1; R s=v,k; } C *nx(C* t){R s=t,bal(1),s;} Z void de(void) { I a=exm(s,APL); if(q==-1&&J)u--,longjmp(J,-1); q=0; if(a)ff((A)a),dc((A)a); k_tm(0); } Z I EoF=0; Z I AbortLoad=0; Z C sb[99999],*b=sb;void sbi(void){b=sb,*b=c=v=0;} C *sj(C *s,I j){R strncpy(sb,s,j),sb[j]=0,sb;} Z I u_f1(FILE *f) { I n=sb+sizeof(sb)-b; if(Reset) --Reset, --u, longjmp(J, -3); if(EoF=!fgets(b,n,f?f:stdin)){if(f)R 0;exit(1);} if(v&&!b[2]&&(*b=='\375'||*b=='$'))R sbi(),0; if (n==strlen(b)+1) { H("buffer full\n"); sbi(); R -1; } s=b; if (chk()) { b = s; R 1; } R 0; } Z I go(void) { I r,rf=0; for(;issp(*--s);); s[1]=0; s=cl(b=sb); if(!*s)R 0; if((r=*s=='\373'||*s==':')||(!s[1]&&(*s=='\375'||*s=='$'))|| (*s=='$' && (rf=!strncmp(s+1,"reset",5)))) { if(!J)R u; if(r) { if(!s[1])R 1; r=exm(s+1,APL); if(!r)R q=0; } if(rf) { if(s[6]) Reset=MAX(0,MIN(u,atol(&s[6]))); else Reset=u; R 0; } else --u,longjmp(J,r?r:-3); } R de(),0; } Z C *scp(C *s){R (C *)strcpy(mab(1+strlen(s)),s);} void rf(C *s,FILE *f) { if(s)*++K=MV(s=scp(s)),*++K=-1; AbortLoad=0; for(;;) { if(!u_f1(f))if(EoF||go()||AbortLoad)break; if(s)--*K; } AbortLoad=0; /* this was a char printf changed to cast */ if(c||v)H("%s OPEN %c\n",b,(char)(c?c:'{')),c=v=0;if(s)K-=2,mf((I *)s); } I getAbortLoad(){R AbortLoad;} void setAbortLoad(I val){AbortLoad=val;} I tf(void){I r=u_f1(0)?0:go();if(!r)pr();R r;} I ui(void) { CX c=Cx; if(*X) { A f=(A)*X; Cx=(CX)f->p[f->n+2]; } for(*++K=0,++u,pr();!tf();); R Cx=c,--u,--K,0; } C *es[]={"stop","interrupt","wsfull","stack","value","valence","type","rank", "length","domain","index","mismatch","nonce","maxrank", "non-function","parse","maxitems","invalid","non-data",(C *)0}; C *qs; Z void qsrr(void){if(q>0)qs=es[q];} void xrr(void){qsrr(); if(G==0) q=0;} Z void prr(I i,A a) { q=0; H("%s[error] ",CC);if(i==2)H("%lu",a);else pa((V)a);H(": %s\n",i<0?qs:es[i]); } I aplus_err(I i,A a){aplus_errno=q=i;if(!Ef||G&&i)longjmp(J,-3); Tf=1;stdinFlagSet(Tf);prr(i,a);ui();R 0;} void perr(C *s){perror(s),fflush(stdout);} Z I tok(void) { jmp_buf b; CX c=Cx; /* jmptype j=J; I *k=K,z=setjmp(J=b)?0:ra(bal(0)); R K=k,Cx=c,J=j,z; */ jmptype j=J; I *k=K,z; /** z=setjmp(J=b)?0:ra(bal(0)); */ if (setjmp(J=b)) { z = 0; } else { z = ra(bal(0)); } /**/ K=k,Cx=c; J=j; R z; } I ez(I a) { /* jmp_buf b;jmptype j=J;I *k=K,*x=X,*y=Y,i;CX c=Cx; */ jmp_buf b; jmptype j=J; I *k=K,*x=X,*y=Y,i; CX c=Cx; q=0; if(i=setjmp(J=b)) { Cx=c; if(q && doErrorStack) snapshotKstack(); for(J=j,K=k,X=x;Yf==MN(0)?(ef(e),dc((A)z),(I)aplus_nl):(ef(e),z); } extern I Gf,Xf,doErrorStack; I pev(I a) { I g=G;A z; G=Gf,a=ez(a),G=g; if(!a&&!q) longjmp(J,-3); /* Replace with call to gvi() */ /* z=gv(Et,2); */ /* *z->p=(I)gi(q); */ /* z->p[1]=q?(I)gsv(0,q<0?qs:es[q]):a; */ z=gvi(Et, 2, gi(q), q ? (I)gsv(0, q<0 ?qs : es[q]) : a); R q=0,(I)z; } I pexm(I a1,I m) { I g=G; A z; G=Gf; a1=exm((C *)a1,m); G=g; if(a1){z=gs(Et);*z->p=a1;} else z=gi(q); if(Gf==2 && q) dc(zG); if(!a1) q=0; R (I)z; } /* old entrypoints pex() and ex() included for compatibility with a_79 */ /* these two functions are not used by any native A+ code */ I pex(I a) {R pexm(a,APL);} I ex(CX c,C *s){I r;CX saveCx=Cx; Cx=c; r=exm(s,APL); Cx=saveCx; R r;} extern I dbg_tf,dbg_depth; #define FIN ++dbg_depth;if(dbg_tf)functrc(fnc,0);if(i=fnc->p[fnc->n])t=t2(i,1) #define FOUT(x) if(i)t2(t,0);if(dbg_tf)functrc(fnc,x);--dbg_depth I af(I n){ jmp_buf b; A fnc=(A)*Y; I i=0,*k,t=0,*x,z=0,h=fnc->t==Xt; jmptype j; /* ber says I *??? */ I *d; if(h) { d=fnc->d; if(QN(*d)){ EQ(1,n!=2&&n!=3?(q=5,0): (z=n>2?Y[2]:0,fnc->r>2?rk(d[1],(A)d[2],(A)Y[1],(A)z): ea(d[1],(A)Y[1],(A)z)) ); R z; } for(h=i=fnc->r;i--;*--Y=ic((A)d[i]));L0:fnc=(A)*Y; } if(fnc->t<=Xt)q=14; else if(Y-K<30)q=3; else if(n+h!=fnc->r)q=5; else if(!*fnc->p)q=4; else { CX c=Cx; x=X,X=Y,j=J,k=K,*++K=(I)fnc; DO(fnc->n-1,*--Y=0); FIN; if(z=setjmp(J=b)) { if(Cx=c,z==-3||z==-1) { FOUT(2); if(z==-3)longjmp(j,-3); } else { if(Glbrtn) z = (I)Glbrtn ; } } else z=ev(*fnc->p); for(;Yc,9); qs=si(t)->n; longjmp(J,q=-1); R -1; } void frep(A f){strcpy((C *)(f->p[f->n+1]=(I)mab(1+strlen(r))),r);} aplus-fsf-4.22/src/a/tmv_nopipe.c0000644000265000001440000000336210772770360012366 /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #include #include #ifdef HPC_PWR2_TMV C *tmv(I t,I *d,I *s,I n){switch(t){ CSR(It,d=(I*)hpc_mv_i(d,s,n);R(C*)d;) CSR(Et,DO(n,*d++=ic((A)(*s++)))R(C*)d;) CSR(Ft,{F *a=(F*)d;F *b=(F*)s;a=(F*)hpc_mv_f(a,b,n);R(C*)a;}) CSR(Ct,{C *a=(C*)d;C *b=(C*)s;a=(C*)hpc_mv_c(a,b,n);R(C*)a;})} R 0;} #else #if defined(_ULTRA_SPARC_NEW_TMV) C *tmv_nopipe(I t,I *d,I *s,I n) #else C *tmv(I t,I *d,I *s,I n) #endif { switch(t){ case 0L : { I i = 0 , _i = ( n ) ; for ( ; i < _i ; ++ i ) { * d ++ = * s ++ ; } } return ( C * ) d ; ; break ; case 4L : { I i = 0 , _i = ( n ) ; for ( ; i < _i ; ++ i ) { if( QS(*s) ) * d ++ = * s ++ ; else * d ++ = ic ( (A) * s ++ ) ; } } return ( C * ) d ; ; break ; case 1L : { F * a = ( F * ) d ; F * b = ( F * ) s ; { I i = 0 , _i = ( n ) ; for ( ; i < _i ; ++ i ) { * a ++ = * b ++ ; } } return ( C * ) a ; }; break ; case 2L : { C * a = ( C * ) d ; C * b = ( C * ) s ; { I i = 0 , _i = ( n ) ; for ( ; i < _i ; ++ i ) { * a ++ = * b ++ ; } } return ( C * ) a ; }; break ; } } #endif aplus-fsf-4.22/src/a/y.c0000644000265000001440000003702510772770360010461 /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #if defined(__VISUAL_C_2_0__) #include #define isan(n) (isal(n)||isdi(n)) #endif #include #include #if defined(__cplusplus) #include #else #include #endif #include #include #include #include #include #include #include #include #include #include #include extern I dbg_tl,dbg_depth, dbg_tb, dbg_tnan, dbg_tbwc; void libaInstall(void); Z I f_j(A); #define vInUse(v) ((v->a || v->e || v->f || v->c || v->p || v->q || \ v->cd || v->rff || v->rfc || v->rpf || v->rpc || \ v->scd || v->atb)?1:0) I APL=1,Xf=0,Sf=1,Df=1,Gf=1,Tf=1,Ef=1,doErrorStack=0,oldDepModel=0; extern C Fs[]; extern I xfpeFlag; Z A currLoadFile=(A)0; A get_loadfile() { R(currLoadFile)?(A)ic(currLoadFile):aplus_nl; } C *findFileName(C *name,C *suffix) { /* This function means, "if the suffix ain't .suffix, zap it." */ Z C buf[MAXPATHLEN]; I len=strlen((DEV_STRARG)name); I suffixLen = strlen((DEV_STRARG)suffix) ; #if 0 C * dotLoc = strrchr(name, '.') ; C * slashLoc = strrchr(name, '/') ; if (dotLoc > slashLoc) { /* There is already a suffix. Better leave it. */ return name ; } /* No suffix - add one */ sprintf(buf, "%s.%s", name, suffix) ; #else /* Add suffix if it does not match */ { I i, suffixMatch=1; for(i=1; suffixMatch && i<=suffixLen; i++) if( name[len-i] != suffix[suffixLen-i] ) { suffixMatch=0; break; } if( suffixMatch==0 || name[len-i]!='.' ) sprintf(buf, "%s.%s\0", name, suffix) ; else sprintf(buf, "%s\0", name); } #endif R buf; } Z C *findAplusFileName(C *name) { Z C ap[]=".:/usr/local/a+/lib:/usr/local/lib/a:/common/a:/u/a"; C *t ,*r=pfind("APATH",ap,name,R_OK); if(!r)t=findFileName(name,"+"),r=pfind("APATH",ap,t,R_OK); if(!r)t=findFileName(name,"a"),r=pfind("APATH",ap,t,R_OK); R r; } C *findMapped64FileName(C *name,I mode) { C *t=findFileName(name,"m64"); I j=R_OK|(mode?W_OK:0); C *r=pfind("MPATH",".",t,j); if(!r)r=pfind("MPATH",".",name,j); if(!r) { C *em=(C *)malloc(3+strlen((DEV_STRARG)t)); sprintf(em,"%s %s",CC,t); perr(em); free(em); } R r; } C *findMapped32FileName(C *name,I mode) { C *t=findFileName(name,"m"); I j=R_OK|(mode?W_OK:0); C *r=pfind("MPATH",".",t,j); if(!r)r=pfind("MPATH",".",name,j); if(!r) { C *em=(C *)malloc(3+strlen((DEV_STRARG)t)); sprintf(em,"%s %s",CC,t); perr(em); free(em); } R r; } C *doloadafile(C *s,int u) /* silent version of loadafile */ { C r[MAXPATHLEN],*t=findAplusFileName(s),*fn; CX x=Cx; I m=APL; int c; FILE *f; A oldLoadFile=currLoadFile; if(!t){if(dbg_tl&&!u)loadtrc(s,2);R (C *)0;} fn=strdup(t); currLoadFile=gsv(0,fn); if(!(f=fopen(t,"r"))){if(dbg_tl&&!u)loadtrc(t,2);R (C *)0;} if ('#'==fgetc(f)&&'!'==fgetc(f)) while (EOF!=(c=fgetc(f))&&'\n'!=c) ; else rewind(f); if(u)unlink(t); ++dbg_depth;if(dbg_tl&&!u)loadtrc(fn,0); gwd(r),APL=1,rf(u?0:s,f),Cx=x,APL=m,fclose(f),chdir(r);setPWD(); if(dbg_tl&&!u)loadtrc(fn,1);--dbg_depth; dc(currLoadFile); currLoadFile=oldLoadFile; R fn; } I loadafile(C *s,int u) /* now a cover for doloadafile */ { C *fn=doloadafile(s,u); if (0==fn){perr(s);R -1;} free(fn); R 0; } #define PIPEOP_BUFCHUNKSIZE 2048 #define PIPEOP_BLOCKS 10 #define PIPEOP_BLOCKUSLEEP 500000 Z C PipeMsgBuf[128]; #define PIPEPERR(s) {sprintf(PipeMsgBuf,s,CC);perr(PipeMsgBuf);} Z void pipeOps(C *ss) { V v; I appendflag=0,cxflag=0,i; FILE g,*h; C *varname,*cmdstr,*u,opc; opc=*ss++; if('>'==opc&&'>'==*ss)appendflag=1,++ss; cmdstr=cl(u=bl(varname=dlb(ss))),*u=0; for(i=0;varname[i];i++) { if( isal(varname[i]) || ( i && isan(varname[i]) ) ) continue; if( varname[i]=='.' && i!=(strlen((DEV_STRARG)varname)-1) && !cxflag) { cxflag=1; continue; } H("incorrect\n");R; } if(!*cmdstr){H("incorrect\n");R;} v=('<'==opc)?sv(Cx,si(varname)):svlu(Cx,si(varname)); if(!v){H("bad varname\n");R;} /* The #ifdef's fix a memory fault that occurs on Solaris when */ /* we try to exchange the FILE pointer returned from popen with stdout. */ /* The new code uses dup to move the file descriptors around, but doesn't */ /* use pclose to close the file opened with popen. */ /* A better solution would be modify the print routines to write to a */ /* specific stream, and not try to change file descriptor 1. */ /* ie. fprintf(h,"...",...); */ switch(opc) { case '|': if(h=popen(cmdstr,"w")) { int fdStdOut,fd,rc; fflush(stdout); fdStdOut=dup(1); /* copy stdout */ fd=dup2(fileno(h),1); /* 1 closed by dup2 */ paf((A)gt(v),0,0); NL; fflush(stdout); rc=dup2(fdStdOut,1); /* close 1 and Restore stdout 1 */ rc=close(fdStdOut); /* close duplicate of 1 */ pclose(h); } else PIPEPERR("%s error during pipe operation"); break; case '>': if(h=fopen(cmdstr,appendflag?"a":"w")) { int fdStdOut,fd,rc; fflush(stdout); fdStdOut=dup(1); /* copy stdout */ fd=dup2(fileno(h),1); /* 1 closed by dup2 */ paf(gt(v),0,0); NL; fflush(stdout); rc=dup2(fdStdOut,1); /* close 1 and Restore stdout 1 */ rc=close(fdStdOut); /* close duplicate of 1 */ pclose(h); } else PIPEPERR("%s error during pipe operation"); break; case '<': if(h=popen(cmdstr,"r")) { int nblocks=0, n; struct buff *bufp=buffalloc(); g=*stdin,*stdin=*h; while(0<(n=buffread(bufp, fileno(h), PIPEOP_BUFCHUNKSIZE))) if(0==n){ if(PIPEOP_BLOCKS>=++nblocks){ H("%s error: pipe operation blocked",CC);break;} else usleep(PIPEOP_BLOCKUSLEEP); } buffputc(bufp,'\0'); *h=*stdin,pclose(h),*stdin=g; dc((A)v->a); { I n=(bufp->put-bufp->min)-1; v->a=(I)gc(Ct,1,n,&n,(I *)bufp->min); } bufffree(bufp); } break; default: H("%s error in pipe operation: unknown prefix [%c]\n",CC,opc); break; } R; } Z void listGlobals(I n,C *cxtname) { I i; CX cxt=*cxtname?cxlu(si(cxtname)):Cx; V v; if(0==cxt) {NL; return;} for(i=0;iht->nb;++i) for(v=(V)cxt->ht->b[i];v;v=v->v) if(-2==n&&vInUse(v)||-1==n&&v->e||v->t==n&&v->a)H(" %s",v->s->n); NL; } Z void printCxt(CX cx){H(" %s",cx->s->n);} Z void listContexts(void) { I i;CX cx; for(i=0;inb;++i)for(cx=(CX)CxTable->b[i];cx;cx=cx->n) if((cx->flag&1)&&cx!=Rx)printCxt(cx); NL; } #define EX(a) dc((A)v->a),v->a=0 I emptyV(V v) { if (v->o) R 0; (EX(a),EX(f),EX(c),EX(p),EX(q),EX(cd),EX(rff),EX(rfc), EX(rpf),EX(rpc),EX(scd),rmd(v),rmatb(v),dst(v)); R -1; } Z void expunge(V v){if (v->o) H("%s: is bound\n",v->s->n); else emptyV(v);} Z void expungecxt(C *s) { CX c=cxlu(si(s)); if(c&&excxt(c))H("%s: not empty\n",s); } C *cmdsList[]={ "vars","fns","ops","xfs","si","wa","cx","rl","load","cd", "off","mode","cxs","ex","pp","sfs","stop","vers","loadrm","cmds", "def","dep","Tf","Sf","Xf","Df","Gf","deps","Ef","_sfs", "dbg","excxt","globs","undef", "Xfpef", "laod", "maplim", "doErrorStack", "oldDepModel","su","+su", 0}; Z C *ts[]={"0 off","1 on","2 trace"}; #define CF(i,f) CS(i,if(*s){f=*s=='2'?2:*s=='1';break;}H("%s\n",ts[f])) void sys(C *s) { C *v; I f=0; C c,d,*u,*w,*x; A a; v=strdup(s); if(strchr((DEV_STRARG)"|><",*v)){pipeOps(v);free(v);R;} s=cl(u=bl(v)),c=*u,*u=0,x=cl(w=bl(s)),d=*w,*w=0; /* 1 $vars 2 $fns 3 $ops 4 $xfs 5 $si */ /* 6 $wa 7 $cx 8 $rl 9 $load 10 $cd */ /* 11 $off 12 $mode 13 $cxs 14 $ex 15 $pp */ /* 16 $sfs 17 $stop 18 $vers 19 $loadrm 20 $cmds */ /* 21 $def 22 $dep 23 $Tf 24 $Sf 25 $Xf */ /* 26 $Df 27 $Gf 28 $deps 29 $Ef 30 $_sfs */ /* 31 $dbg 32 $excxt 33 $globs 34 $undef 35 $Xfpef */ /* 36 $laod 37 $maplim 38 $doErrorStack 39 $oldDepModel */ /* 40 $su 41 $+su */ switch(lu(v,cmdsList)){ CS(16,xfs()); /* sfs */ CS(30,x_fs()); /* _sfs */ CS(11,exit(0)); /* off */ CS(13,listContexts()); /* cxs */ CS(9,loadafile(s,0)); /* load */ CS(36,H("%s warning: you typed \"$laod\". Loading anyway.\n",CC); fflush(stdout);loadafile(s,0)); /* laod */ CS(1,listGlobals(0,s)); /* vars */ CS(2,listGlobals(1,s)); /* fns */ CS(3,listGlobals(2,s);listGlobals(3,s);listGlobals(4,s)); /* ops */ CS(4,listGlobals(5,s)); /* xfs */ CS(5,--K;sik();NL;++K); /* si */ CS(6,wa(!*s?-1:*s=='-'?-2:atol(s))); /* wa */ CS(7,if(*s)Cx=cx(s);else H("%s\n",Cx==Rx?".":Cx->s->n)); #if defined(__VISUAL_C_2_0__) CS(8,srand(atoi(s))); #else CS(8,srandom(atoi(s))); #endif CS(10,if((chdir(*s?s:getenv("HOME")))==-1){perr(s);break;}setPWD()); CS(12,if(*s){APL=(s[1]=='p')?APMODE_APL:('n'==s[1])?APMODE_UNI: APMODE_ASCII;break;} H(APLpick("apl\n","ascii\n","uni\n"))); CS(14,for(;*s;*w=d,w=bl(s=cl(w)),d=*w,*w=0)expunge(sv(Cx,si(s)))); CS(34,for(;*s;*w=d,w=bl(s=cl(w)),d=*w,*w=0)rmd(sv(Cx,si(s)))); CS(15,if(!*s||!isdi(*s)||s[1]&&!isdi(s[1])){H("%c%c\n",Fs[3],Fs[4]);break;} Fs[3]=s[1]?*s++:'0';Fs[4]=*s); CF(17,sq); CS(18,H("%s\n",(C*)(a=versGet())->p);dc(a)); CS(19,loadafile(s,1)); CS(21,f0(s)); CS(22,f1(s)); CF(24,Sf); CF(25,Xf); CF(26,Df); CF(27,Gf); CF(29,Ef); CF(35,xfpeFlag); CS(31,dbg(s,x)); CS(32,expungecxt(s)); /* excxt */ CS(33,listGlobals(-2,s)); /* globs */ CS(23,Tf=0;disable()); CS(20,for(;cmdsList[f];++f)H(" %s",cmdsList[f]);NL); CS(28,listGlobals(-1,s)); CS(37,MFALimitSysCmd(!*s?-1:atoi(s))); /* maplim */ CF(38,doErrorStack); CF(39,oldDepModel); CS(40,*s?(*u=c,*w=d,syst(v)):H("\343 Warning you entered $su if you really want this then enter: $+su\n")); CS(41,(*u=c,*w=d,syst(v+1))); /* $+su (Add 1 to skip over the "+") */ default:*u=c,*w=d;syst(v); } if(v) free(v); } Z H1(charToInt){ A z; Q(a->t!=Ct&&a->n,ERR_TYPE) W(gd(It,a)) DO(a->n,z->p[i]=((UC*)a->p)[i]) R(I)z; } Z H1(charToFloat){ A z; Q(a->t!=Ct&&a->n,ERR_TYPE) W(gd(Ft,a)) DO(a->n,((F*)z->p)[i]=((UC*)a->p)[i]) R(I)z; } H1(charToSym){ A z; ND1; { I ar=a->r,an=a->n,*ad=a->d; C *s=(C*)a->p; I n,j,d1=1; Q(a->t!=Ct,ERR_TYPE); if(ar)--ar;else ad=&d1; W(ga(Et,ar,n=tr(ar,ad),ad))an=ad[ar]; DO(n,for(j=an;j--&&s[j]==' ';);z->p[i]=MS(si(sj(s,j+1)));s+=an); R(I)z; } } Z H1(intToChar){ A z; Q(a->t!=It&&a->n,ERR_TYPE) W(gd(Ct,a)) DO(a->n,((C*)z->p)[i]=a->p[i]) R(I)z; } H1(intToFloat){ A z; Q(a->t!=It&&a->n,ERR_TYPE) W(gd(Ft,a)) DO(a->n,((F*)z->p)[i]=a->p[i]) R(I)z; } Z H1(intToSym){ A z, t; if(!(t=(A)intToChar(a))) R 0; z=(A)charToSym(t); R dc(t),(I)z; } Z H1(floatToChar){ A z, t; if(!(t=(A)f_j(a))) R 0; z=(A)intToChar(t); R dc(t),(I)z; } Z H1(floatToInt){ A z; F f; I d;Q(a->t!=Ft&&a->n,ERR_TYPE); W(gd(It,a)); DO(a->n, f=((F*)a->p)[i]; if(d=f>0?f+.5:f-.5,(f>d?f-d:d-f)>=CT*(f>1?f:f<-1?-f:1)) R(q=ERR_TYPE,dc(z),0); z->p[i]=d ); R(I)z; } #if defined(_AIX) || defined(HAVE_SVR4) || defined(__sgi) || defined(__osf__) || defined(linux) || defined(_HP) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__) Z H1(f_j){ A z; F f; F imaxmin[2]; imaxmin[0]=((F)LONG_MAX)+1.0; imaxmin[1]=((F)LONG_MIN)-1.0; Q(a->t!=Ft&&a->n,ERR_TYPE) W(gd(It,a)) DO(a->n, f=(f=((F*)a->p)[i])>0?f+.5:f-.5; if(f>imaxmin[0]||fp[i]=(I)f); R(I)z; } #else Z H1(f_j){ A z; F f; Q(a->t!=Ft&&a->n,ERR_TYPE) W(gd(It,a)) DO(a->n,z->p[i]=(f=((F*)a->p)[i])>0?f+.5:f-.5) R(I)z; } #endif Z H1(floatToSym){ A z, t; if(!(t=(A)f_j(a))) R 0; z=(A)intToSym(t); R dc(t),(I)z; } H1(symToChar){ A z; ND1 { I ar=a->r,an=a->n,*ad=a->d; I k,m=0; C *s;Q(an&&!sym(a),ERR_TYPE) Q(ar>=MAXR,ERR_MAXRANK) DO(an,if(m<(k=strlen((DEV_STRARG)XS(a->p[i])->n)))m=k) W(ga(Ct,ar+1,an*m,ad))z->d[ar]=m;s=(C*)z->p; DO(an,sprintf(s,"%-*s",m,XS(a->p[i])->n);s+=m) R(I)z; } } Z H1(symToInt){ A z, t; if(!(t=(A)symToChar(a))) R 0; z=(A)charToInt(t); R dc(t),(I)z; } Z H1(symToFloat){ A z, t; if(!(t=(A)symToInt(a))) R 0; z=(A)intToFloat(t); R dc(t),(I)z; } A ci(I i){I z;A a=(A)Y[i];R(A)((z=floatToInt(a))?(dc(a),Y[i]=z):0);} A ep_cf(I i){I z;A a=(A)Y[i];R(A)((z=intToFloat(a))?(dc((A)a),Y[i]=z):0);} I cn(I i,I t){I a=Y[i],z=(I)gd(t,(A)a);R dc((A)a),Y[i]=z;} Z I dbgor(A a,A w,I i){ND2;I2;if(dbg_tbwc)bitwisechk(a,w,i);R ds(a,w,i);} H2(castOr){ I u,t; C c; I isNull=0; I (*castfn)(); ND2; t=w->t; if(a->t!=Et||(a->r&&!a->n)) R dbgor(a,w,1); Q(!QS(*a->p),ERR_DOMAIN); Q(t>Et&&w->n||a->n!=1||t==Et&&!(w->n&&QS(*w->p))&& !(isNull=qz(w)),ERR_DOMAIN); c=*XS(*a->p)->n; u=c=='i'?It:c=='f'?Ft:c=='c'?Ct:c=='s'?Et:-1; Q(u==-1,ERR_DOMAIN); if (u==t) R ic_or_copy(w); switch(t) { CS(Ct,castfn=(u==It?charToInt:u==Ft?charToFloat:u==Et?charToSym:0)); CS(It,castfn=(u==Ct?intToChar:u==Ft?intToFloat:u==Et?intToSym:0)); CS(Ft,castfn=(u==Ct?floatToChar:u==It?f_j:u==Et?floatToSym:0)); CS(Et,castfn=(u==Ct?symToChar: u==It?(isNull?charToInt:symToInt): u==Ft?(isNull?intToFloat:symToFloat):0)); default:castfn=0;break; } if(0==castfn)R (q=ERR_TYPE,0); R (*castfn)(w); } #define DDbw(x1,nx1,t,ttype,f) I f(A w){A z;I wd[MAXR],wr=w->r, wn=w->n; \ I x=MAX(1,((nx1)/(x1))); \ F nx=(((F)x1)/((F)nx1)); \ Q( (wr ? w->d[wr-1] : wn) % x, ERR_LENGTH) \ wn *= nx; \ DO(wr,wd[i]=w->d[i]) \ if(wr) wd[wr-1]*=nx; \ else if(wn>1) wr=1, *wd=wn; \ z=ga(t,wr,wn,wd); \ memcpy(z->p,w->p,sizeof(ttype)*wn);\ R (I)z;} DDbw(sizeof(I), sizeof(F), Ft, F, bwi_f) DDbw(sizeof(I), sizeof(C), Ct, C, bwi_c) DDbw(sizeof(F), sizeof(I), It, I, bwf_i) DDbw(sizeof(F), sizeof(C), Ct, C, bwf_c) DDbw(sizeof(C), sizeof(I), It, I, bwc_i) DDbw(sizeof(C), sizeof(F), Ft, F, bwc_f) DDbw(sizeof(void *), sizeof(I), It, I, bws_i) DDbw(sizeof(void *), sizeof(F), Ft, F, bws_f) DDbw(sizeof(void *), sizeof(C), Ct, C, bws_c) H2(bwcv){ I u,t; C c; ND2 Q((t=w->t)>Et,ERR_DOMAIN); Q(w->t==Et&&!QS(*w->p),ERR_DOMAIN) Q(a->n!=1||!QS(*a->p),ERR_DOMAIN) c=*XS(*a->p)->n; Q(c=='s',ERR_DOMAIN) u=c=='i'?It:c=='f'?Ft:c=='c'?Ct:Et; if (u==t) R ic_or_copy(w); else if (t==Ct) R u==It?bwc_i(w):(u==Ft?bwc_f(w):(q=ERR_TYPE,0)); else if (t==It) R u==Ct?bwi_c(w):(u==Ft?bwi_f(w):(q=ERR_TYPE,0)); else if (t==Ft) R u==Ct?bwf_c(w):(u==It?bwf_i(w):(q=ERR_TYPE,0)); else if (t==Et) R u==Ct?bws_c(w):(u==It?bws_i(w): (u==Ft?bws_f(w):(q=ERR_TYPE,0))); else R (q=ERR_TYPE,0); } void libaInstall(void){ beamInstall(); nsfInstall(); attInstall(); dbgInstall(); memStatsInstall(); } I ai(I n) { infi(); /* s.c - initializes infinity values */ siginit(); mi(); wi(); if(!tmp(n<<20))R 0; ki(); libaInstall(); R 1; } aplus-fsf-4.22/src/a/arthur.h0000644000265000001440000000155710772770360011524 #ifndef included_a_arthur_h #define included_a_arthur_h /*****************************************************************************/ /* */ /* Copyright (c) 1996-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #include #define R return #define Z static #define H printf #define NL H("\n") #define CS(n,x) case n:x;break; #define CSR(n,x) case n:x; #define DO(n,x) {I i=0,_i=(n);for(;i<_i;++i){x;}} #define PERR(s,x) {if((I)(x)==-1)R perr(s),0;} #define W(x) {z=(A)(x);} #endif aplus-fsf-4.22/src/a/b.h0000644000265000001440000000164010772770360010431 #ifndef included_a_b_h #define included_a_b_h /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* header file inclusions */ #include #include /* external macro declarations */ #if (defined(__sgi) && _MIPS_SZLONG == 64) || defined(__sparcv9) #define MD 63 #else #define MD 31 #endif /* external data declarations */ /* number of words in block of given scale */ extern unsigned long MZ[]; #endif aplus-fsf-4.22/src/a/beam.h0000644000265000001440000000517710772770360011125 #ifndef included_a_beam_h #define included_a_beam_h /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #include /* Rules for determining if pointer */ #if (_MIPS_SZLONG == 64) || defined(__alpha) || defined(__sparcv9) || defined(__ia64) || defined(__x86_64) #define HAS_64BIT_TYPE 1 typedef int INT32; typedef long INT64; #elif (_MIPS_SZLONG == 32) #define HAS_64BIT_TYPE 1 typedef int INT32; typedef long long INT64; #else typedef int INT32; typedef long INT64; /* Need to FIX !!! */ #endif int cvtIfNeeded(void *src, A *dest, I ilen, I cvtInPlace); int getItems(void *src, I *itemCount, I *rank, I *items, I ilen); INT64 tr64(INT64 r, INT64 *d); typedef struct { INT32 c, t, r, n, d[MAXR], i, p[1]; } A32; #define AH32 (sizeof(struct A32) - sizeof(INT32)) typedef struct { INT64 c, t, r, n, d[MAXR], i, p[1]; } A64; #define AH64 (sizeof(struct A64) - sizeof(INT64)) /* from k.h */ #define Tt64(t,x) ((x)<<((((t>>1)&1)+3)&3)) #define Tt32(t,x) ((x)<<(t+2&3)) #define TR32(x) ((x).r ? tr32( ((x).r-1), ((x).d+1)) : 1) #define TR64(x) ((x).r ? tr64( ((x).r-1), ((x).d+1)) : 1) #define ENDIAN_UNDEF 0 #define ENDIAN_LITTLE 1 #define ENDIAN_BIG 2 #define isAObject(AObject) \ ((AObject).t >= 0) && \ ((AObject).t <= Ct) && \ ((AObject).r >= 0) && \ ((AObject).r <= MAXR) && \ (((AObject).n > 0) || ((AObject).n ==0 && ((AObject).r >= 1))) && \ (((AObject).i > 0) || ((AObject).i ==0 && ((AObject).r >= 1))) && \ ((AObject).c == 0) #define checkDims(AObject) \ { \ I dims=1,i; \ if( (AObject).r==0 && (AObject).n!=1 ) \ dimsOK=0; \ else \ { \ for(i=0; i<(AObject).r; i++) \ dims *= (AObject).d[i]; \ if(dims!=(AObject).n) \ dimsOK=0; \ } \ } #define DO_FILE_SIZE_CHECK 0 #define SKIP_FILE_SIZE_CHECK 1 #define checkFileSize32(AObject) \ (sizeof(A32) - sizeof(INT32) + \ Tt32((AObject).t, (AObject).i * TR32(AObject)) + ((AObject).t == 2)) #define checkFileSize64(AObject) \ (sizeof(A64) - sizeof(INT64) + \ Tt64((AObject).t, (AObject).i * TR64(AObject)) + ((AObject).t == 2)) #endif aplus-fsf-4.22/src/a/development.h0000644000265000001440000000336110772770360012534 #ifndef included_a_development_h #define included_a_development_h /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #if defined(HAVE_SVR4) # if defined(__sgi) || defined(SOLARIS_CSET) # define DEV_STRARG char * # else # if defined(__GNUC__) || defined(__SUNPRO_CC) || defined(__SUNPRO_C) || defined(__osf__) # define DEV_STRARG const char * # else # define DEV_STRARG unsigned char * # endif # endif # ifdef __cplusplus # ifndef __sgi extern "C" int microsleep(int); # endif # else # ifndef __sgi extern int microsleep(int); # endif # endif # define bcopy(s1,s2,len) memmove(s2,s1,len) # define bcmp(s1,s2,len) (memcmp(s2,s1,len)==0?0:1) # define bzero(sp, len) memset(sp, 0, len) /* # ifndef __sgi # define usleep(x) microsleep(x) # define getdtablesize() sysconf(_SC_OPEN_MAX) # define getpagesize() sysconf(_SC_PAGESIZE) # endif */ #else # define DEV_STRARG char * #endif #if defined(__VISUAL_C_2_0__) # define DEV_STRARG char * # define bcopy(s1,s2,len) memmove(s2,s1,len) # define bcmp(s1,s2,len) (memcmp(s2,s1,len)==0?0:1) # define bzero(sp, len) memset(sp, 0, len) # define usleep(x) microsleep(x) extern #ifdef __cplusplus "C" #endif int microsleep(int); #endif #endif aplus-fsf-4.22/src/a/f.h0000644000265000001440000001163710772770360010444 #ifndef included_a_f_h #define included_a_f_h /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #ifdef _AIX #define BUGGY_AIX_COMPILER #endif #include #include #include #include #define ERR(s,x) {if((I)(x)==-1)R perror(s),q=9,0;} #define QF(a) (!QA(a)||((A)a)->t>Et) #define CT (1E-13) #define CT1 (1-1E-13) #define CT2 (1+1E-13) #define XA I at=a->t,ar=a->r,an=a->n,*ad=a->d #define XW I wt=w->t,wr=w->r,wn=w->n,*wd=w->d #define H1(f) I f(A a) #define H2(f) I f(A a,A w) #define G1(T,f) Z I f(T *r,T *w,I n) #define G2(T,f) Z I f(T *r,T *a,T *w,I n) #define G0(T,f) Z I f(T *r,I *a,T *w,I n) #define GV1(T,f) Z void f(T *r,T *w,I n) #define GV2(T,f) Z void f(T *r,T *a,T *w,I n) #define GV0(T,f) Z void f(T *r,I *a,T *w,I n) #ifdef BUGGY_AIX_COMPILER #define C1(f) {g=(PFI)(f);R(*((I(*)(I *,I *,I))(g)))(z->p,a->p,a->n),(I)z;} #define C2(f) {g=(PFI)(f);R(*(((I(*)(I *,I *,I *,I))(g))))(z->p,a->p,w->p,z->n),(I)z;} #else #define C1(f) R(*(I(*)(I *,I *,I))(g=(PFI)(f)))(z->p,a->p,a->n),(I)z; #define C2(f) R(*(I(*)(I *,I *,I *,I))(g=(PFI)(f)))(z->p,a->p,w->p,z->n),(I)z; #endif #define F1 {if(a->t!=Ft&&!(a=ep_cf(0)))R 0;} #define F2 {if(a->t!=Ft&&!(a=ep_cf(0))||w->t!=Ft&&!(w=ep_cf(1)))R 0;} #define I1 {if(a->t!=It&&!(a=ci(0)))R 0;} #define I2 {if(a->t!=It&&!(a=ci(0))||w->t!=It&&!(w=ci(1)))R 0;} #define I0 {I1 Q(a->n!=1,12)} #define X1 {if(a->t>Ft&&!(a=ci(0)))R 0;} #define X2 {if(a->t!=w->t)if(a->t+w->t==1)F2 else if(!a->n)a=(A)cn(0,w->t); \ else if(!w->n)w=(A)cn(1,a->t);else R q=6,0;} #define V0 {if(!wr)*wd=wr=1;} #define OF(r,x,y) {F f=(F)(x)*(F)(y);Q(f>2e9,9)r=f;} #define EQ(i,x) for(;Xf?xf():0,z=(x),q;)if(dc((A)z),q>-2)aplus_err(q,(A)fnc); \ else if(q=0,ep_cf(i),n-i==2)ep_cf(i+1); #define ND1 Q(!QA(a)||Et<(a)->t,18) #define ND2 Q(!QA(a)||!QA(w)||Et<(a)->t||Et<(w)->t,18) typedef union brokenDouble { int i[2]; double d; } BD; #define NANMASK 0x7ff00000 #if defined(__osf__) #include #include extern unsigned long fpe_bits; extern int nan_bits; #define FPERRMASK ( IEEE_STATUS_INV ) #define RESETXCP { nan_bits=errno=0; \ ieee_set_fp_control(ieee_get_fp_control()&~FPERRMASK); \ } #define CHECKXCP { if(nan_bits||((fpe_bits=ieee_get_fp_control())&FPERRMASK))\ q=9;\ } #define NAN_CHECK(v,xx) {F vv; vv=xx; if( isnan(vv) ) nan_bits=1; v=vv;} #elif defined(_AIX) #include #include #define FPERRMASK ( FP_INVALID ) extern fpflag_t fpe_bits; extern int nan_bits; #define RESETXCP { nan_bits=errno=0;fp_clr_flag(FP_ALL_XCP);} #define CHECKXCP { if(nan_bits||((fpe_bits=fp_read_flag())&FPERRMASK)) q=9; } #define NAN_CHECK(v,xx) {F vv; vv=xx; if( isnan(vv) ) nan_bits=1; v=vv;} #elif defined(linux) || defined(_HP) || defined(__APPLE__) #if defined(__APPLE__) #include #else #include #endif #if defined(_HP) #define finite isfinite #endif /* Set mask for exeption invalid operation */ #define FPERRMASK ( FE_INVALID ) extern fexcept_t fpe_bits; extern int nan_bits; #define RESETXCP { nan_bits=errno=0;feclearexcept(FE_ALL_EXCEPT);} #define CHECKXCP { if(nan_bits||(fpe_bits=fetestexcept(FPERRMASK))) q=9; } #define NAN_CHECK(v,xx) {F vv; vv=xx; if( isnan(vv) ) nan_bits=1; v=vv;} #elif defined(HAVE_SVR4) #if !defined(fp_except) #define fp_except int #endif #include /* Set mask for exeption invalid operation */ #define FPERRMASK ( FP_X_INV ) extern fp_except fpe_bits; extern int nan_bits; #define RESETXCP { nan_bits=errno=0;fpsetsticky(0);} #define CHECKXCP { if(nan_bits||((fpe_bits=fpgetsticky())&FPERRMASK)) q=9; } #define NAN_CHECK(v,xx) {F vv; vv=xx; if( isnan(vv) ) nan_bits=1; v=vv;} #elif defined(__FreeBSD__) || defined(__NetBSD__) #if defined(__FreeBSD__) typedef int fp_except; #endif # include /* Set mask for exeption invalid operation */ /* #define FPERRMASK ( FP_X_INV | FP_X_DZ ) */ #define FPERRMASK ( FP_X_INV ) extern fp_except fpe_bits; extern int nan_bits; #if defined(__NetBSD__) #define RESETXCP { nan_bits=errno=0;fpsetsticky(0);} #else #define RESETXCP { nan_bits=errno=0;fpresetsticky(FPERRMASK);} #endif #define CHECKXCP { if(nan_bits||((fpe_bits=fpgetsticky())&FPERRMASK)) q=9; } #define NAN_CHECK(v,xx) {F vv; vv=xx; if( isnan(vv) ) nan_bits=1; v=vv;} #else #define RESETXCP #define CHECKXCP #define NAN_CHECK(v,xx) v= xx; #endif #endif aplus-fsf-4.22/src/a/fir.h0000644000265000001440000000724610772770360011000 #ifndef included_a_fir_h #define included_a_fir_h /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* * Include file with defines and macros for use with A=>C interface. * * Malcolm Austin */ /* defines for error codes */ #define ERR_NONE 0 #define ERR_INTERRUPT 1 #define ERR_WSFULL 2 #define ERR_STACK 3 #define ERR_VALUE 4 #define ERR_VALENCE 5 #define ERR_TYPE 6 #define ERR_RANK 7 #define ERR_LENGTH 8 #define ERR_DOMAIN 9 #define ERR_INDEX 10 #define ERR_MISMATCH 11 #define ERR_NONCE 12 #define ERR_MAXRANK 13 #define ERR_NONFUNCTION 14 #define ERR_PARSE 15 #define ERR_MAXITEMS 16 #define ERR_INVALID 17 #define ERR_NONDATA 18 #define ERR_MESSAGE -1 /* two macros for error generation */ #define ERROUT(X) { q=(X); return(0); } #define ERRMSG(MSG) {q=ERR_MESSAGE; qs=(MSG); return(0); } #define SIZEOFITEM(t) ( ((Et == t) ? sizeof(A) : \ (It == t) ? sizeof(I) : \ (Ft == t) ? sizeof(F) : \ (Ct == t) ? sizeof(C) : \ (Xt <= t) ? sizeof(A) : sizeof(I) )) /* macros for performing non-data checks */ #define NDC1(a) if(!QA(a)||Et<(a)->t)ERROUT(ERR_NONDATA); #define NDC2(a,w) if(!QA(a)||!QA(w)||Et<(a)->t||Et<(w)->t)ERROUT(ERR_NONDATA); /* charma() can replace malloc() */ #define charma(X) ((char *) ma(((X)+(sizeof(int)-1))/sizeof(int))) /* IAR() is used to reference an A object indirectly (as in a nested array) */ #define IAF(aobj,i,field) (((A)aobj->p[i])->field) #define IAR(aobj, i) ((A)aobj->p[i]) #ifndef TRUE #define TRUE (I)1 #endif #ifndef FALSE #define FALSE (I)0 #endif /* * MIN and MAX macros */ #ifndef MIN #define MIN(a,b) ( ((a) < (b)) ? (a) : (b) ) #endif #ifndef MAX #define MAX(a,b) ( ((a) > (b)) ? (a) : (b) ) #endif /* * Better string macros (work on 8-bit chars) * * Malcolm Austin 8/90 */ #ifndef isxdigit #include #endif #define ISalpha(c) ( isascii(c) && isalpha(c) ) #define ISupper(c) ( isascii(c) && isupper(c) ) #define ISlower(c) ( isascii(c) && islower(c) ) #define ISdigit(c) ( isascii(c) && isdigit(c) ) #define ISxdigit(c) ( isascii(c) && isxdigit(c) ) #define ISalnum(c) ( isascii(c) && isalnum(c) ) #ifdef ctrlLspace #define ISspace(c) ( isascii(c) && ('\014' == c ||isspace(c)) ) #else #define ISspace(c) ( isascii(c) && isspace(c) ) #endif #define ISpunct(c) ( isascii(c) && ispunct(c) ) #define ISprint(c) ( isascii(c) && isprint(c) ) #define IScntrl(c) ( isascii(c) && iscntrl(c) ) #define ISgraph(c) ( isascii(c) && isgraph(c) ) /* * #defines to make debugging easier, can be overridden in code */ #define SUBROUTINE static #define ENTRYPOINT /* * Macros for working with A objects. */ /* IsSymbol returns TRUE if the idxth element of aobj is a symbol. If match is not-NULL, it also check for a match to a particular char string. */ #define IsSymbol(aobj, idx, match) ( \ ( Et==(aobj)->t && QS((aobj)->p[idx]) && \ ( NULL==match || match==MS(si(match))))) #define IsNull(aobj) ( NULL==aobj || Et==aobj->t && 0==aobj->n && 1==aobj->r) /* Define iszero macro for AIX machines. */ #if defined(__osf__) #define iszero(X) (X==0.0) #elif defined(_AIX) || defined(HAVE_SVR4) #ifndef iszero #define iszero(X) (X==0.0) #endif #endif #endif aplus-fsf-4.22/src/a/fncdcls.h0000644000265000001440000002653510772770360011636 #ifndef included_a_fncdcls_h #define included_a_fncdcls_h /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #include #include #include #ifdef __cplusplus extern "C" { #endif extern unsigned long hafn(unsigned long); /* att */ extern HT hti(unsigned long); /* att */ extern void mvht(HT,HT); /* att */ extern I htgi(HT,S,PFI,I*); /* att */ extern I htsi(HT,S,I,I,I(*)(void)); /* att */ extern I htxi(HT,S,I); /* att */ extern void rmatb(V); /* att */ extern void attInstall(void); /* att */ extern void mi(void); /* b */ /* extern unsigned long mb(long*,unsigned long); b */ extern C* mab(unsigned long); /* b */ extern long* ma(unsigned long); /* b */ extern void mf(I*); /* b */ extern unsigned long mc(void); /* b */ extern unsigned long *mz(void); /* b */ /* Functions for controlling atmp */ extern long *(*pf_ma)(unsigned long); /* b */ extern long *ma_atmp(unsigned long); /* b */ extern long *ma_malloc(unsigned long); /* b */ extern void (*pf_mf)(long *); /* b */ extern void mf_atmp(long *); /* b */ extern void mf_malloc(long *); /* b */ extern void memStatsInstall(void); /* b */ extern I getAutoBeamConvert(void); /* beam */ extern I mf_length(A aobj); /* beam */ extern I isWritableFile(I a); /* beam */ extern void MFALimitSysCmd(I newlim); /* beam */ extern void beamInstall(void); /* beam */ extern void setAutoBeamConvert(I m); /* beam */ extern void dst(V); /* callouts */ extern I xf(void); /* callouts */ extern void xup(V,A,A,A,I,I); /* callouts */ extern I vfy(V,A); /* callouts */ extern void disable(void); /* callouts */ extern void enable(void); /* callouts */ /* MicroSoft visual C++ mangles these variable names*/ #ifdef _MSC_VER extern I dbg_tl; /* dbg */ extern I dbg_tb; /* dbg */ extern I dbg_tf; /* dbg */ extern I dbg_tx; /* dbg */ extern I dbg_ts; /* dbg */ extern I dbg_tbwc; /* dbg */ extern I dbg_tdef; /* dbg */ extern I dbg_tdep; /* dbg */ extern I dbg_tinv; /* dbg */ extern I dbg_tnan; /* dbg */ extern I dbg_tpcb; /* dbg */ extern I dbg_tscb; /* dbg */ extern I dbg_tpack; /* dbg */ extern I dbg_tprcb; /* dbg */ extern I dbg_trcb; /* dbg */ extern I dbg_txeq; /* dbg */ extern I dbg_tmdo; /* dbg */ extern I dbg_tdyld; /* dbg */ extern I dbg_depth; /* dbg */ extern I dbg_tmstk; /* dbg */ extern I dbg_tkerr; /* dbg */ extern I dbg_xfpe; /* dbg */ extern I dbg_tfmt; /* dbg */ extern I dbg_twa; /* dbg */ extern I dbg_tdoErrorStack; /* dbg */ #endif extern I nanbeamchk(C *,A); /* dbg */ extern I bitwisechk(A,A,I); /* dbg */ extern I functrc(A,I); /* dbg */ extern I xftrc(C *,I); /* dbg */ extern I loadtrc(C *,I); /* dbg */ extern I xeqtrc(C *,I); /* dbg */ extern I mdotrc(I); /* dbg */ extern I beamtrc(C *,I,I); /* dbg */ extern I cbtrc(V,I); /* dbg */ extern I deptrc(V,I); /* dbg */ extern I invtrc(V,I); /* dbg */ extern void watrc(I); /* dbg */ extern void doErrorStacktrc(I, A); /* dbg */ extern I deftrc(V,I); /* dbg */ extern void dbg(C *,C *); /* dbg */ extern C **get_dbglist(void); /* dbg */ extern void dbgInstall(void); /* dbg */ extern C *PIDcmd(pid_t); /* dyldSlow */ extern I rsh(A,I,I *); /* f */ extern I ic_or_copy(A); /* f */ extern I pck(I,A); /* gpick */ extern I pka(A,A *); /* gpick */ extern I ne(F *,F *); /* i */ extern I sym(A); /* i */ extern I fsy(A); /* i */ extern I cm(I *,I *,I); /* i */ extern I mt(A,A); /* i */ extern I fnd(A,A); /* i */ extern I index_of(A,A); /* i */ extern I xin(A,I,A); /* j */ extern I xr(A,A,A); /* j */ extern void ki(void); /* k */ extern I ic(A); /* k */ extern void dc(A); /* k */ extern void dec(A); /* k */ extern void ef(I); /* k */ extern I *k_tm(I); /* k */ extern void mv(I *,I *,I); /* k */ extern C *tst(I,I *,I,I *,I,I); /* k */ extern C *tmv(I,I *,I *,I); /* k */ extern C *trp(I,I *,I *,I); /* k */ extern C *zer(I,I *,I); /* k */ extern I zr(A); /* k */ extern I tr(I,I *); /* k */ extern I tr1(I,I *); /* k */ extern A gm(I,I,I); /* k */ extern A gv(I t,I n); /* k */ extern A gd(I,A); /* k */ extern A ga(I,I,I,I *); /* k */ extern A gc(I,I,I,I *,I *); /* k */ extern A gi(I); /* k */ extern A gs(I); /* k */ extern A gf(F); /* k */ extern A ge(I); /* k */ extern I ev(I); /* k */ extern I ee(E); /* k */ extern I fa(I,I,I); /* k */ extern A af4(A,I,I,I,I,V); /* k */ extern A un(A *); /* k */ extern I set(I,I,I); /* k */ extern I aset(I,I,I,I); /* k */ extern I xis(E); /* k */ extern A getBeamMSyncMode(void); /* k */ extern void setBeamMSyncMode(A); /* k */ extern I log_EWouldBlock(I,I,I,C *,C *); /* m */ extern I syst(C *); /* m */ extern void gwd(C *s); /* m */ extern void siginit(void); /* m */ extern A getSigv(void); /* m */ extern A getSigb(void); /* m */ extern void setSigv(I); /* m */ extern void setSigb(I); /* m */ extern I wr(I); /* m */ extern I im(I); /* m */ extern void dm(A); /* m */ extern I map(int,int); /* m */ extern int nmap(int,int,C *,C *); /* m */ extern void dbg_mfr(void); /* m */ extern int flen(int,off_t); /* m */ extern void wi(void); /* m */ extern I tmp(I); /* m */ extern I wa(I); /* m */ extern I twGet(void); /* m */ extern I ep_all(void); /* m */ extern C *pfind(C *,C *,C *,I); /* m */ extern I unloadable(C*,I); /* m */ /* Functions for controlling atmp */ extern void setAtmpMmapFlags(int); /* m */ extern I (*pf_tmp)(I); /* m */ extern I tmp_atmp(I); /* m */ extern I tmp_malloc(I); /* m */ extern int atmpMissing(void); /* m */ extern void te(void); /* n */ extern I t2(I,I); /* n */ extern void xfs(void); /* n */ extern void x_fs(void); /* n */ extern void install(PFI,const C *,I,I,I,I,I,I,I,I,I,I); /* n */ extern void xshti(void); /* n */ extern A ep_xfsinfo(void); /* n */ extern A gsym(const C*); /* nsf */ extern S symjoin(S,S); /* nsf */ extern S symsplit(S,S *); /* nsf */ #if (__sgi && ((_MIPS_SZLONG == 64) || (_MIPS_SIM == _ABIN32))) extern void coreLimSet(long long); #elif defined(__osf__) extern void coreLimSet(long) ; #else extern void coreLimSet(I); /* nsf */ #endif extern void stdinFlagSet(I); /* nsf */ extern A versGet(void); /* nsf */ extern C *getaname(A); /* nsf */ extern void dbg_flg(void); /* nsf */ extern I excxt(CX); /* nsf */ extern void setPWD(void); /* nsf */ extern void nsfInstall(void); /* nsf */ extern void versSet(C*); /* nsf */ extern void phaseOfReleaseSet(I); /* nsf */ extern void majorReleaseSet(I); /* nsf */ extern void minorReleaseSet(I); /* nsf */ extern I rk(I,A,A,A); /* o */ extern I ea(I,A,A); /* o */ extern A getCircleFuncSyms(void); /* o */ extern F pif(I,F); /* o */ extern C **get_primlist(int, int); /* p */ extern I chtsi(HT,C *,I); /* p */ extern I lu(C *,C **); /* p */ extern I aplus_pi(C *); /* p */ extern void sik(void); /* p */ extern A sikAsAObj(void); /* p */ extern I sik_exp(I); /* p */ extern void sk(void); /* p */ extern I paf(A,I,I); /* p */ extern void pa(V); /* p */ extern I mth(A); /* p */ extern void p0hti(void); /* p */ extern CX cxhti(void); /* r */ extern CX cxi(S); /* r */ extern CX cxlu(S); /* r */ extern V vi(S,CX); /* r */ extern V vlu(S,CX); /* r */ extern CX cx(const C *); /* r */ extern I gz(void); /* r */ extern I qz(A); /* r */ extern I peak(I); /* r */ extern void f0(C *); /* r */ extern void f1(C *); /* r */ extern void inv(V,I,I); /* r */ extern void val(V); /* r */ extern I gt(V); /* r */ extern void rmd(V); /* r */ extern I rd(I *); /* r */ extern int infi(void); /* s */ extern I rm(I,I); /* s */ extern I ds(A,A,I); /* s */ extern I rs(A,I); /* s */ extern I sc(A,I); /* s */ extern C *searchPATH(C*); /* searchPATH */ extern A getSymKstack(void); /* si */ extern void snapshotKstack(void); /* si */ extern A showLastSavedKstack(void); /* si */ extern void symhti(void); /* u */ extern S si(const C *); /* u */ extern A SymbolTableHashChainLengths(void); /* u */ extern A SymbolTableBlockInfo(void); /* u */ extern V sv(CX,S); /* u */ extern V svlu(CX,S); /* u */ extern I ispu(I); /* u */ extern I isal(I); /* u */ extern I isdi(I); /* u */ extern C *dlb(C *); /* u */ extern C *cl(C *); /* u */ extern C *bl(C *); /* u */ extern void tc(I *); /* u */ extern A gsv(I,const C *); /* u */ extern A gvi(I,I,...); /* u */ extern void ff(A); /* u */ extern C *nx(C *); /* u */ extern C *sj(C *,I); /* u */ extern void rf(C *,FILE *); /* u */ extern I tf(void); /* u */ extern void xrr(void); /* u */ extern I aplus_err(I,A); /* u */ extern void perr(C *); /* u */ extern I ez(I); /* u */ extern I exm(C *, I); /* u */ extern I pev(I); /* u */ extern I pexm(I,I); /* u */ extern I af(I); /* u */ extern void frep(A); /* u */ extern C *doloadafile(C *,int); /* y */ extern I exx(V); /* y */ extern void sys(C*); /* y */ extern A ci(I); /* y */ extern A ep_cf(I); /* y */ extern I cn(I,I); /* y */ extern I bwcv(A,A); /* y */ extern I loadafile(C*,int); /* y */ /* ???? extern A gn(I); extern A grc(A,int,int); extern A ld1(A); extern int isnan(double); */ #ifdef __cplusplus } #endif #endif aplus-fsf-4.22/src/a/ik.h0000644000265000001440000000301010772770360010604 #ifndef included_a_ik_h #define included_a_ik_h /*****************************************************************************/ /* */ /* Copyright (c) 1996-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* This include file contains #defines and externs of general utility * within the interpreter. The difference between this file and k.h * is that this file is PURELY INTERNAL TO THE INTERPRETER. Specifically, * this means that the contents of this file are subject to change * without notice from one A+ version to the next. */ #include #include /* Internal global variables */ extern jmptype J; extern I *Y,*X,*K,sq; extern PFI g; extern I Df,Gf,Sf,Tf,Xf,Ef,doErrorStack,oldDepModel; extern HT CxTable; /* beam constants */ #define BEAM_RO 0 #define BEAM_RW 1 #define BEAM_LOCAL 2 /* mode-related material */ #define APMODE_ASCII 0 #define APMODE_APL 1 #define APMODE_UNI 2 #define APLpick(mode1,mode0,mode2) (APL?((1==APL)?mode1:mode2):mode0) #define CC APLpick("\343","//","//") #define CCtest(s) ((1==APL)?('\343'==*(s)):('/'==(s)[0] && '/'==(s)[1])) #define SI_CHAR APLpick('&','\376','?') #endif aplus-fsf-4.22/src/a/k.h0000644000265000001440000002072110772770360010443 #ifndef included_a_k_h #define included_a_k_h /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #include /* #include */ typedef long I; typedef double F; typedef char C; typedef unsigned char UC; extern F aplusInfinity; #define Inf aplusInfinity #define MAXR 9 #define AH (sizeof(struct a) - sizeof(I)) typedef struct a *A; typedef union{I *i;F *f;C *c;A *a;}P; struct a{I c,t,r,n,d[MAXR],i,p[1];}; typedef struct _s{struct _s *s;C n[4];}*S; #define CX_USED typedef struct _ht{unsigned long nb,ni;void *b[1];}*HT; typedef struct _htnode{I a;S s;struct _htnode *n;}*HTN; #define HTHASH(ht,s) ((ht)->b+(((ht)->nb-1)&hafn(((unsigned long)(s))>>3))) #define CxHTSIZE (1<<9) typedef struct _cx{HT ht;S s;struct _cx *n;I flag;}*CX; typedef struct _att{I a;S s;struct _att *n;}*ATT; typedef struct _v{I a;S s;struct _v *v;CX cx;I t,*l,e,r,o,f,c; void *attr;I z,p,q;A cd;I rff,rfc,rpf,rpc;A scd,i;HT atb;}*V; typedef struct e{I n,f,a[2];}*E; typedef I (*PFI_I)(I) ; typedef I (*PFI)(); typedef I (*PFI_A)(A); typedef I (*PFI_AA)(A,A); typedef I (*PFI_AAI)(A,A,I); typedef A (*PFA_A)(A); typedef A (*PFA_AA)(A,A); #if (_MIPS_SZLONG == 64) || defined(__alpha) || defined(__ia64) || defined(__x86_64) typedef unsigned long * jmptype; #else typedef int * jmptype; #endif /* atmp Memory mode */ #define WS_ATMP_SHARED (0) #define WS_ATMP_NORESERVE (1) #define WS_ATMP_PRIVATE (2) #define WS_ATMP_HEAP (4) #define WS_MALLOC (8) #define WS_MEM_STATS (16) #define Tt32(t,x) ((x)<<(t+2&3)) #define Tt64(t,x) ((x)<<((((t>>1)&1)+3)&3)) #if (_MIPS_SZLONG == 64) || defined(__alpha) || defined(__ia64) || defined(__x86_64) #define Tt(t,x) ((x)<<((((t>>1)&1)+3)&3)) #else #define Tt(t,x) ((x)<<(t+2&3)) #endif #define Q(x,n) {if(x)R q=n,0;} #define It 0L #define Ft 1L #define Ct 2L #define Et 4L #define Xt 8L #define aplusMask 7 #define U(a) ((I)(a)>>3) #define QA(a) (0==((I)(a)&aplusMask)) #define QV(a) (1==((I)(a)&aplusMask)) #define QS(a) (2==((I)(a)&aplusMask)) #define QE(a) (3==((I)(a)&aplusMask)) #define QN(a) (4==((I)(a)&aplusMask)) #define QL(a) (5==((I)(a)&aplusMask)) #define QP(a) (6==((I)(a)&aplusMask)) #define QX(a) (7==((I)(a)&aplusMask)) #define MV(a) (1|(I)(a)) #define MS(a) (2|(I)(a)) #define ME(a) (3|(I)(a)) #define MN(a) (4|(I)(a)<<3) #define ML(a) (5|(I)(a)<<3) #define MP(a) (6|(I)(a)<<3) #define MX(a) (7|(I)(a)<<3) #define XS(a) ((S)((I)(a)&~aplusMask)) #define XV(a) ((V)((I)(a)&~aplusMask)) #define XE(a) ((E)((I)(a)&~aplusMask)) /* MicroSoft visual C++ mangles these variable names*/ #if defined(_MSC_VER) && defined(__cplusplus) extern "C" { #endif /* These variables are part of the A+ API. */ extern C *qs; extern I APL,q; extern A aplus_nl; extern CX Rx,Cx; #if defined(_MSC_VER) && defined(__cplusplus) } #endif /* * APLUS_THREAD_SAFE_FUNCTIONS: defined if "_r" (re-entrant) versions of system * functions are available on that architecture * (e.g., gmtime_r()) */ #if (defined(__SUNPRO_CC) || defined(__GNUC__)) && defined(HAVE_SVR4) && !defined(__sgi) #define APLUS_THREAD_SAFE_FUNCTIONS 1 #define APLUS_OLD_POSIX_THREAD_SAFE_FUNCTIONS 1 #endif #if defined(_AIX) && defined(__xlC__) && defined(_AIX41) /* xlC on AIX 4.1 */ #define APLUS_THREAD_SAFE_FUNCTIONS 1 #endif /* _AIX && __xlC__ && _AIX41 */ #if defined(__sgi) /* SGI, all compilers */ #define APLUS_THREAD_SAFE_FUNCTIONS 1 #endif /* __sgi */ /* * Wrappers around system function that have mt-safe (_r) versions. * The macros take as many parameters as the _r versions. The regular * versions of these macros ignore extra parameters and thus they don't * have to be declared when APLUS_THREAD_SAFE_FUNCTIONS is not defined. * To declare a direntry struct for READDIR macro APLUS_DECLARE_DIRENT should be * used because it correctly allocates enough memory for dirEntry. */ #ifdef APLUS_THREAD_SAFE_FUNCTIONS #define APLUS_DECLARE_DIRENT(dirEntry) \ char dirEntry##Buffer[1025+sizeof(struct dirent)];\ struct dirent *dirEntry = (struct dirent *)dirEntry##Buffer; #define APLUS_LOCALTIME(numSecs,pTm) localtime_r(numSecs,pTm) #define APLUS_GMTIME(numSecs,pTm) gmtime_r(numSecs,pTm) #define APLUS_STRTOK(s1,s2,lasts) strtok_r(s1,s2,lasts) #if defined(APLUS_OLD_POSIX_THREAD_SAFE_FUNCTIONS) #define APLUS_ASCTIME(tp,charBuf,n) asctime_r(tp,charBuf,n) #define APLUS_GETPWUID(uid,pStruct,charBuf,n,pwd) (pwd=getpwuid_r(uid,pStruct,charBuf,n)) #if defined(__EXTENSIONS__) || \ (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || \ (_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS) #if defined(__STDC__) #if (_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS) #ifdef __PRAGMA_REDEFINE_EXTNAME #define APLUS_GETPWNAM(name,pStruct,charBuf,n,pwd) (pwd=getpwnam_r(name,pStruct,charBuf,n)) #else /* __PRAGMA_REDEFINE_EXTNAME */ #define APLUS_GETPWNAM(name,pStruct,charBuf,n,pwd) (getpwnam_r(name,pStruct,charBuf,n,&pwd),pwd) #endif /* __PRAGMA_REDEFINE_EXTNAME */ #else /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */ #define APLUS_GETPWNAM(name,pStruct,charBuf,n,pwd) (pwd=getpwnam_r(name,pStruct,charBuf,n)) #endif /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */ #else /* __STDC__ */ #if (_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS) #ifdef __PRAGMA_REDEFINE_EXTNAME #define APLUS_GETPWNAM(name,pStruct,charBuf,n,pwd) (pwd=getpwnam_r(name,pStruct,charBuf,n)) #else /* __PRAGMA_REDEFINE_EXTNAME */ #define APLUS_GETPWNAM(name,pStruct,charBuf,n,pwd) (getpwnam_r(name,pStruct,charBuf,n,&pwd),pwd) #endif /* __PRAGMA_REDEFINE_EXTNAME */ #else /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */ #endif /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */ #endif /* __STDC__ */ #endif /* defined(__EXTENSIONS__) || (__STDC__ == 0 ... */ #if !defined(APLUS_GETPWNAM) #define APLUS_GETPWNAM(name,pStruct,charBuf,n,pwd) (pwd=getpwnam_r(name,pStruct,charBuf,n)) #endif #define APLUS_READDIR(dp,entry,res) (res=readdir_r(dp,entry)) #define APLUS_GETPROTOBYNAME(name,pStruct,charBuf,n,proto) (proto=getprotobyname_r(name,pStruct,charBuf,n)) #define APLUS_GETHOSTBYNAME(name,pStruct,charBuf,n,pErr,host) (host=gethostbyname_r(name,pStruct,charBuf,n,pErr)) #else /* !APLUS_OLD_POSIX_THREAD_SAFE_FUNCTIONS */ #define APLUS_ASCTIME(tp,charBuf,n) asctime_r(tp,charBuf) #define APLUS_GETPWUID(uid,pStruct,charBuf,n,pwd) (getpwuid_r(uid,pStruct,charBuf,n,&pwd),pwd) #define APLUS_GETPWNAM(name,pStruct,charBuf,n,pwd) (getpwnam_r(name,pStruct,charBuf,n,&pwd),pwd) #define APLUS_READDIR(dp,entry,res) (readdir_r(dp,entry,&res),res) #ifdef __sgi /* SGI does not have a thread-safe equivalent of getproto... and gethost... functions */ #define APLUS_GETPROTOBYNAME(name,pStruct,charBuf,n,proto) (proto=getprotobyname(name)) #define APLUS_GETHOSTBYNAME(name,pStruct,charBuf,n,pErr,host) (host=gethostbyname(name)) #else /* !__sgi */ #define APLUS_GETPROTOBYNAME(name,pStruct,charBuf,n,proto) (getprotobyname_r(name,pStruct,charBuf,n,&proto),proto) #define APLUS_GETHOSTBYNAME(name,pStruct,charBuf,n,pErr,host) (gethostbyname_r(name,pStruct,charBuf,n,pErr,&host),host) #endif /* __sgi */ #endif /* APLUS_OLD_POSIX_THREAD_SAFE_FUNCTIONS */ #else /* !APLUS_THREAD_SAFE_FUNCTIONS */ #define APLUS_DECLARE_DIRENT(dirEntry) #define APLUS_LOCALTIME(numSecs,pTm) localtime(numSecs) #define APLUS_GMTIME(numSecs,pTm) gmtime(numSecs) #define APLUS_STRTOK(s1,s2,lasts) strtok(s1,s2) #define APLUS_ASCTIME(tp,charBuf,n) asctime(tp) #define APLUS_GETPWUID(uid,pStruct,charBuf,n,pwd) (pwd=getpwuid(uid)) #define APLUS_GETPWNAM(name,pStruct,charBuf,n,pwd) (pwd=getpwnam(name)) #define APLUS_READDIR(dp,entry,res) (res=readdir(dp)) #define APLUS_GETPROTOBYNAME(name,pStruct,charBuf,n,proto) (proto=getprotobyname(name)) #define APLUS_GETHOSTBYNAME(name,pStruct,charBuf,n,pErr,host) (host=gethostbyname(name)) #endif /* APLUS_THREAD_SAFE_FUNCTIONS */ #endif aplus-fsf-4.22/src/a/pwr2hpc.h0000644000265000001440000001323610772770360011601 #ifndef included_pwr2hpc_pwr2hpc_h #define included_pwr2hpc_pwr2hpc_h /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* header file inclusions */ extern long q; #ifndef _AIX typedef struct _quad { long val[2]; } quad; #endif /* external macro declarations */ #ifdef _AIXNO #include #include extern int fpe_bits; #define RESETXCP {fpe_bits=0;fp_clr_flag(FP_ALL_XCP);} #define TESTXCP(x) (((x)&0x20000000)|(0x00011000==((x)&0x0001f000))) #define CHECKXCP {BD f;int g;f.d=__readflm();g=f.i[1];if(fpe_bits||TESTXCP(g))q=9;} #else #define RESETXCP #define CHECKXCP #endif /* external struct, union, typedef and enum declarations */ typedef union {int i[2]; short s[4]; double d;} BD; /* external function declarations */ /* integer logical dyadic scalar cores */ extern void hpc_vvz0(); extern void hpc_svz0(); extern void hpc_vsz0(); extern void hpc_vvz1(); extern void hpc_svz1(); extern void hpc_vsz1(); /* integer arithmetic dyadic scalar cores */ extern void hpc_vvi0(); extern void hpc_svi0(); extern void hpc_vsi0(); extern void hpc_vvi1(); extern void hpc_svi1(); extern void hpc_vsi1(); extern void hpc_vvi2(); extern void hpc_svi2(); extern void hpc_vsi2(); extern void hpc_vvi3(); extern void hpc_svi3(); extern void hpc_vsi3(); extern void hpc_vvi4(); extern void hpc_svi4(); extern void hpc_vsi4(); extern void hpc_vvi5(); extern void hpc_svi5(); extern void hpc_vsi5(); extern void hpc_vvi6(); extern void hpc_svi6(); extern void hpc_vsi6(); /* integer comparison dyadic scalar cores */ extern void hpc_vvj0(); extern void hpc_svj0(); extern void hpc_vsj0(); extern void hpc_vvj1(); extern void hpc_svj1(); extern void hpc_vsj1(); extern void hpc_vvj2(); extern void hpc_svj2(); extern void hpc_vsj2(); extern void hpc_vvj3(); extern void hpc_svj3(); extern void hpc_vsj3(); extern void hpc_vvj4(); extern void hpc_svj4(); extern void hpc_vsj4(); extern void hpc_vvj5(); extern void hpc_svj5(); extern void hpc_vsj5(); /* float logical dyadic scalar cores */ extern void hpc_vvy0(); extern void hpc_svy0(); extern void hpc_vsy0(); extern void hpc_vvy1(); extern void hpc_svy1(); extern void hpc_vsy1(); /* float arithmetic dyadic scalar cores */ extern void hpc_vvs_f0(); extern void hpc_svs_f0(); extern void hpc_vss_f0(); extern void hpc_vvs_f1(); extern void hpc_svs_f1(); extern void hpc_vss_f1(); extern void hpc_vvf2(); extern void hpc_svf2(); extern void hpc_vsf2(); extern void hpc_vvf3(); extern void hpc_svf3(); extern void hpc_vsf3(); extern void hpc_vvf4(); extern void hpc_svf4(); extern void hpc_vsf4(); extern void hpc_vvf5(); extern void hpc_svf5(); extern void hpc_vsf5(); extern void hpc_vvf6(); extern void hpc_svf6(); extern void hpc_vsf6(); /* float comparison dyadic scalar cores */ extern void hpc_vvh0(); extern void hpc_svh0(); extern void hpc_vsh0(); extern void hpc_vvh1(); extern void hpc_svh1(); extern void hpc_vsh1(); extern void hpc_vvh2(); extern void hpc_svh2(); extern void hpc_vsh2(); extern void hpc_vvh3(); extern void hpc_svh3(); extern void hpc_vsh3(); extern void hpc_vvh4(); extern void hpc_svh4(); extern void hpc_vsh4(); extern void hpc_vvh5(); extern void hpc_svh5(); extern void hpc_vsh5(); /* float transcendental dyadic scalar cores */ extern void hpc_vvex(); extern void hpc_svex(); extern void hpc_vsex(); extern void hpc_vvlg(); extern void hpc_svlg(); extern void hpc_vslg(); extern void hpc_vvpi(); extern void hpc_svpi(); extern void hpc_vspi(); /* character comparison dyadic scalar cores */ extern void hpc_vvc0(); extern void hpc_svc0(); extern void hpc_vsc0(); extern void hpc_vvc1(); extern void hpc_svc1(); extern void hpc_vsc1(); /* integer vector reduction cores */ extern void hpc_vrsz0(); extern void hpc_vrsz1(); extern void hpc_vrsi0(); extern void hpc_vrsi1(); extern void hpc_vrsi2(); extern void hpc_vrsi3(); /* float vector reduction cores */ extern void hpc_vrsy0(); extern void hpc_vrsy1(); extern void hpc_vrsf0(); extern void hpc_vrsf1(); extern void hpc_vrsf2(); extern void hpc_vrsf3(); /* integer vector scan cores */ extern void hpc_vscz0(); extern void hpc_vscz1(); extern void hpc_vsci0(); extern void hpc_vsci1(); extern void hpc_vsci2(); extern void hpc_vsci3(); /* float vector scan cores */ extern void hpc_vscy0(); extern void hpc_vscy1(); extern void hpc_vscf0(); extern void hpc_vscf1(); extern void hpc_vscf2(); extern void hpc_vscf3(); /* vector casting pseudo cores */ extern void hpc_cvci(); extern void hpc_cvcf(); extern void hpc_cvic(); extern void hpc_cvif(); extern void hpc_cvfc(); extern void hpc_cvfi(); /* monadic scalar pseudo cores */ extern void hpc_mSgnII(); extern void hpc_mSgnFI(); extern void hpc_mClnFI(); extern void hpc_mClnFF(); extern void hpc_mFlrFI(); extern void hpc_mFlrFF(); extern void hpc_mNegII(); extern void hpc_mNegIF(); extern void hpc_mNegFF(); extern void hpc_mRecFF(); extern void hpc_mAabII(); extern void hpc_mAabIF(); extern void hpc_mAabFF(); extern void hpc_mAenFF(); extern void hpc_mAlnFF(); extern void hpc_mRanII(); extern void hpc_mNotII(); extern void hpc_mNotFI(); extern void hpc_mPitFF(); /* tmv cores */ extern char *hpc_mv_i(); extern char *hpc_mv_f(); extern char *hpc_mv_c(); extern char *hpc_rp_i(); extern char *hpc_rp_f(); extern char *hpc_rp_c(); #endif /* included_hpc_hpc_h */ aplus-fsf-4.22/src/a/s.h0000644000265000001440000000264610772770360010461 #ifndef included_a_s_h #define included_a_s_h /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #include #include #if defined(_AIX) || defined(HAVE_SVR4) || defined(__osf__) || defined(_HP) # ifndef _HP # define Vol volatile # else # define Vol # endif # include # define SH(x) (sprintf(b,s,x),strlen(b)) #else # if defined(_LCC_LIB) || defined(__VISUAL_C_2_0__) # define Vol volatile # include # define SH(x) ((unsigned long) (sprintf(b,s,x),strlen(b))) # else # if defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__) # define Vol # include # define SH(x) (sprintf(b,s,x),strlen(b)) # else # define Vol # include # include # define SH(x) strlen((DEV_STRARG)sprintf(b,s,x)) # endif # endif #endif /* HP like AIX mmap? getrusage - times atanh acosh asinh random srandom - rand srand */ #endif aplus-fsf-4.22/src/a/x.h0000644000265000001440000000227110772770360010460 #ifndef included_a_x_h #define included_a_x_h /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #define A_ 0 #define IA 1 #define FA 2 #define CA 3 #define P_ 4 #define IP 5 #define FP 6 #define CP 7 #define V_ 8 #define IV 9 #define FV 10 #define CV 11 #define U_ 12 #define IU 13 #define FU 14 #define CU 15 /* _ - any I - integer F - double C - character A - array P - pointer V - value U - unique array (A,C*,I,V)foo(A,IA,FA,CA,*,I*,F*,C*,I,F,C,U,IU,FU,CU) return V_ void xinstall(fun,"sym",result_type,num_args,arg_type[s],doc) if num_args is negative then any number more than that if arg_type is -1 then pass stack and number doc should be char string or NULL (0). */ #endif aplus-fsf-4.22/src/a/fsftest.+0000644000265000001440000000733507412036562011574 if(`int=4294967296) wordsize64 else wordsize32; t0 12 100΢100+2396527.0-600.05 if (~(100t)(100`intt)) { '>>ERROR<<: '; } else { "Passed: test"; } if(wordsize=32) { t11147483648; t22294967296; } else { t110000000000000000000; t22e+19; } bpwwordsize8; x`int ((bpw-1)`char0),`char1 if (x1) { x`int (`char1),(bpw-1)`char0; } if (x1) { ">>ERROR<< bitwise cast"; } else { "Passed: bitwise cast test"; } if ((2t1) t2) { ">>ERROR<< ovli"; } else { "Passed: ovli test"; } if ('0'10.5) { ">>ERROR<< doprnt"; } else { "Passed: doprnt test"; } if (~(` `x)`x) { ">>ERROR<< dot"; } else { "Passed: dot test"; } x1.0 1 0.0 0.0 0.0 0.0; if (0=/x) { ">>ERROR<< libhpc/FloatMin (fix:cwm 11/10/95)"; } else { "Passed: libhpc/FloatMin test"; } `corelim _ssv Inf; if (Inf Inf) { ">>ERROR<< Inf (see cli/fli)"; } else { "Passed: Inf test"; } if (1 +/1) { ">>ERROR<< ovli 32bit"; } else { "Passed: ovli 32bit"; } if(wordsize=32) { t14294967296; t265536 65536; } else { t11e+24; t21000000000000 1000000000000; } if (t1 /t2) { ">>ERROR<< / ovli"; } else { "Passed: / ovli"; } ev0; r(,0)`int>#ev; if(r) r(,0)`int>#ev; if(r) r(,0)`int>#ev; if(r) r(,0)`int>#ev; if (~r) { ">>ERROR<< jfs cast bug"; } else { "Passed: jfs cast bug"; } if (Inf Inf) { ">>ERROR<< FPE code"; } else { "Passed: FPE code"; } if (9 0do2.5) { ">>ERROR<< no NaN check"; } else { "Passed: NaN test 2.5"; } if (9 = 0do1*3) { ">>ERROR<< 1*3 ultra/vlog_"; } else { "Passed: 1*3"; } if (9 0do 00) { ">>ERROR<< no FPE check"; } else { "Passed: FPE check 00 "; } if (~0 1Inf Inf) { ">>ERROR<< No NaN/Inf for Inf Inf"; } else { "Passed: Inf Inf"; } if (9 0do `int2*wordsize) { ">>ERROR<< `int2*",(1wordsize)," NOT a domain error"; } else { "Passed: `int2*",(1wordsize)," results in a domain error"; } if (4 8 16 2*3 4) { ">>ERROR<< exp()/NaN"; } else { "Passed: exp()/NaN 2*3 4"; } if (8 *32) { ">>ERROR<< isnan()"; } else { "Passed: NaN check *32"; } if (~Inf Inf Inf Inf0 0 0 0) { ">>ERROR<< 0 0 0 0"; } fn"/tmp/a+_fsftest.",1sys.getpid{} fdsys.open{fn;`O_CREAT`O_RDWR;438} if (fd < 0) { ">>ERROR<< failed sys.open{",fn,"`O_CREAT`O_RDWR; 8 8 8 6 6 6}"; } else { if(0sys.flock{fd;`LOCK_EX`LOCK_NB}) { ">>ERROR<< flock{fd;`LOCK_EX`LOCK_NB}"; } else { "Passed: flock{fd;`LOCK_EX`LOCK_NB}"; if(0sys.flock{fd;`LOCK_UN}) { ">>ERROR<< flock{fd;`LOCK_UN}"; } else { "Passed: flock{fd;`LOCK_UN}"; }; }; sys.unlink{fn}; } "Testing klewis bug: segv is a fail, a comment or number is a pass"; a10 10 $|a cat >/dev/null $wa ts6sys.ts{}; if(~ts6sys.ts1 sys.mkts1 ts,0) { ">>ERROR<< sys.ts1{}"; } else { "Passed: sys.ts1{}"; } t19970408 19970328 19970331 19970401 19970402 19970403 19970404 19970407 if((/`floatt)`float19970328) { ">>ERROR<< acc bug"; } else { "Passed: acc not used"; } a`aLoooooooooooooooooooooooooooooooooooooooooooooooooooooooongNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaame; ba; 1+1; "Passed: long symbol test"; x0.01?1000100 "Passed: ",time 1000 do * x; x2?16 will segv if broken "Passed: askom CDROM deal corruption"; if (~(5) 1.0 2.0 3.0 4.0 5.0 1.0 2.0 3.0 4.0 5.0) { ">>ERROR<< gcc optimization issue in i.c (johns)"; } else { "Passed: gcc optimization challenge (johns)"; } Last Test "Testing timers...(will fire in 1 second and print finished message)"; tf{h;a;d}:{ n2sys.gettod{0}-.n; if ((+/1000000 1n2)) { ""; "Passed: timer SetTimer"; }; "!!FINISHED!!"; sys.exit 0; } nsys.gettod 0; adap.SetTimer{`foo;tf;1}; aplus-fsf-4.22/src/a/apter.+0000644000265000001440000000566207410526202011223 $load s s.QUIET2 EXCLUDE,`menu`report INCLUDEs.realClasses{} printable{}: { (i#cls cls(~clsEXCLUDE)/cls clsINCLUDE) do { '$rm print.ps'; cli#cls; as.reference_object{cl}; ob`cl; if (a`TABLE `GRAPH) { ch(cl),'_child'; (`%ch)`s%`s%a; (%ob)ch; } else { (%ob)`s%a; }; ob is cl; ob has (`print;1); ksys.readmat{'print.ps'}; if (`null=k) 'no print method: ',cl; }; } defaults{}: { () s.hasDefault (`bg;`blue;`fg;`white;`font;'kaplscreen-bold';`titlefg;`red;`titlefont;'courier-bold-24'); (i#cls cls(~clsEXCLUDE)/cls clsINCLUDE) do { '***'; cli#cls; as.reference_object{cl}; ob`cl; if (a`TABLE `GRAPH) { ch(cl),'_child'; (`%ch)`s%`s%a; (%ob)ch; } else { (%ob)`s%a; }; 'binding ',cl; show ob is cl; 'state:'; `state of ob; if (a`TABLE `GRAPH) { '[***]'; 'state:'; `state of ch; }; }; } inherit{}: { .a10; .b`a; `b is `table; show `b; `b has `bg `red `fg `blue; .c10; .bb,`c; .b`a; `c has `bg `green `fg `orange; .bb,`c; .b`c; should be green+orange field within red(+blue) table and gray+black array } nulls{}: { (i#cls cls(~clsEXCLUDE)/cls clsINCLUDE) do { '***'; cli#cls; as.reference_object{cl}; ob`cl; if (a`TABLE `GRAPH) { ch(cl),'_child'; (`%ch)`s%`s%a; (%ob)ch; } else { (%ob)`s%a; }; eatss.attributes{cl}; eats(eats`class)/eats; 'binding ',cl; show ob is cl; 'reset to () all attributes (except `class) of ',cl; ob has (eats;(#eats)()); 'state:'; `state of ob; if (a`TABLE `GRAPH) { '[***]'; ccl0`class of ch; eatss.attributes{ccl}; eats(eats`class)/eats; 'reset to () all attributes (except `class) of ',ccl; ch has (eats;(#eats)()); 'state:'; `state of ch; 'freeing ',ch; free ch; }; 'freeing ',cl; free ob; }; } classes{}: { (i#cls cls(~clsEXCLUDE)/cls clsINCLUDE) do { '***'; cli#cls; as.reference_object{cl}; ob`cl; if (a`TABLE `GRAPH) { ch(cl),'_child'; (`%ch)`s%`s%a; (%ob)ch; } else { (%ob)`s%a; }; eatss.attributes{cl}; 'binding ',cl; show ob is cl; 'get all attributes of ',cl; valseats of ob; 'reset all attributes of ',cl; ob has (eats;vals); 'state:'; `state of ob; if (a`TABLE `GRAPH) { '[***]'; ccl0`class of ch; eatss.attributes{ccl}; eats(eats`class)/eats; 'get all attributes of ',ccl; valseats of ch; 'reset all attributes of ',ccl; ch has (eats;vals); 'state:'; `state of ch; 'freeing ',ch; free ch; }; 'freeing ',cl; free ob; }; } `t is `table; if (1`space of `t) { 'Error: `space of `table - ',`space of `t; } if (0#s.COLOR_NAMES) { ">>ERROR<< s.COLOR_NAMES"; } else { "Passed: s.COLOR_NAMES test"; } classes{} defaults{} nulls{} sys.exit{0} aplus-fsf-4.22/src/a/t.+0000644000265000001440000006315410772770361010367 Copyright (c) 1990-2008 Morgan Stanley All rights reserved. See .../src/LICENSE for terms of distribution. $cx t NEWLINE"\n" TRIGGER() CONNECT^ RESERVED`_A`_D`_F`_J`_K`_L`_M`_N`_R`_S`_T`_V`_D_`_L_`_R_`_S_`_V_`_T_`_U NA(`int `float `char `sym `box `func `null;(999999999;999999999.0;' ';`;<();<{};<())) DOT_T'.T' DOT`. VERSION1 *** Utilities expunge{b;var}:if (b^vRESERVED define_execute{c;v;`t.close;} _ex{c,v} (c;v)var) (c%v)() sent{d}:(b/s;b/z) b0<#s sz _get`t.sent zdd%`_T sent_from{s;d}:1#(s=0#a)/b (a;b)sent{d} bound{c}:bound_var{s_arg{c}} bound_var{v}:0(a;b;c)) a else _gsr{a;b;c;'_.`'} exp{s;e}:if (`char=e) e_e{s;e} else s_e{s;e} e_e{s;e}:if (1<#s) e_ev{s;e} else nsr{e;Ρf;Ρsf} fs%`_T s''s e_ev{s;e}:nsr{e;Ρf;(<'('),c_v{z_get{x;y}) z else if (()rparent{x}) z else z (b/z)&{r;b/y} atts{x;y}:if (()rparent{x} z_atts{x;y}) z else unique{z,&{r;y}} sel{s;d;i;p;c;v}:e_e{c;i} s_e{c;x}:z (i#a (a;b)_alsf{x} z(c%`_N)f<{^} fe_f{CONNECT}) do zz fs_e_0{c;i#a;ib} s_e_0{c;v;i}:f{s;c%v;i;();c;v} (f;s)se{cv} se{x}:if (~()z_get{x;`t.selector}) 2e_f{z} else if (()y_get{x;`t.sent}) (sel;) else &{y} sv_na{s;v}:(sv;na{sv}) index{i;s}:if (i()) %s else _index{i;%s;na{s}} index_na{i;x}:if (i() (s;nav)x) %s else _index{i;%s;nav} p_index{i;v;n;nav}:z (j#uk ukunique{k} z((#i),1%0#v)nav k(1+nn)i nn+\n) do (p/z)q#%b#v qa-b#0,nn ap/i pk=b bj#uk index_each{i;v;n}:if (i()) %v else p_index{i;v;n;na{0#v}} unique{z}:((zz)=#z)/z f_f{fn}:if (`char=fn) fn else '>',if ((#r)=jrfn s('+/';'/';'/';'/';'^/';'/') r(+/;/;/;/;^/;/)) _name{fn} else js i_v{b}:b/#b c_v{c;vs}:e_v{Ρcvs} e_v{z}:if (1=#z) '<',,>z else '(',(1';',z),')' e_f{f}:if (1=f) <{f} else f count{v;k;n}:if (~()v) #v else if (0',c_v{s;`_N},'}'),' t.TRIGGER' depth{d}:if (()pd%`_S) 0 else 1+/>p%`_M linked{d;x}:if (1b(3@1 v)@1 x vnames{d}) 3@1 b/v fields{d}:if (0<#znames{d}) if (0<#z('_'0#z)/z) (z)#z names{d}:unique{_nl{d;`vars},_nl{d;`deps}} strip_f{d;f}:if (0<#f) (b)#((~b)/f),b/g[;1] bd=g[;0] gf,f add_f{d;v}:def_N{d} (d%`_T)[,]((v`_)~('_'=0#1v)vd%`_T)/v vif (()v) fields{d} else strip_f{d;v} drop_f{d;v}:def_N{d} (d%`_T)(~tv)/td%`_T vstrip_f{d;v} sort_f{vb}:if (0_alsf{vb} else (,vb;(#vb)0) tree{x;k}:if (k=0 (d;s)x) (d;,<&{x;1}) else if (0<#cd%s) (c;&{c,s;k}) dag{x;p}:if (dp (d;s)x) 0 2() else if (0=#cd%s) 0 2() else (d~c),if (0<#e&{c,s;((1#a)١1ա(','=b)b',',b match{a;b}:a[;#b]@1 b,b find{a;b}:(#a)0#_ss{a;b} tile{n;x}:(x)n#x top{d}:if (()sd%`_S) d else &{s} safe{s;d;f;g}:((~g)z`_)/z zif (f~dTABLES ts%`_T) t else (~>1š(dš0#k)^~`_Nš1#k k֡_alldep{st})/t comp{d}:if (0=#s,d%`_S) 0 else if (()vd%`_V) 0 else if (~v0 n(0#s)%`_N) (~nv)/n else n intersect{e;v}:if (()v) e else (ev)/e pick{s;sf}:if (0<#sf) if (s0sf) ssf pick_set{s;sf;z}:sf if (0<#sf) if (s0sf) (ssf)z rsf{o}:if (0rc (rc;z)do _alsf{o}) o else (r;v) if (1b0<ؽv (r;v)z) (b/v)&{b/v} map{y;x}: if (()x (d;v)if (2=#y) y else y) (d%v)() else if (~','f (n;f)x) (d%v)i_beam{n;f} else (i#g1ա(','=g)g',',f) do if (i=0) (d%v)i_beam{n;0g} else (d%v)[,]i_beam{n;ig} un_map{x;dir}:(1m),'',f f('/'=1f)f f(#dir)f (m;f)x i_beam{y;x}:if (1y) sys.imp{x} else if (2y) x else if (3y) x else yx mesh{s;l}:d,if (l=ds%`_M) (ҡs%`_J)ҡ1+d else ء(s%`_J)#<&{s%`_S;l} merge_0{s;d;l}:(mesh{s;l})#(k[1]%`_J),m[0](0,1+\m)+ɡm m>k%`_N kd%`_S d_q{x}:(1+x'"''')/x s_arg{c}:if (1<#c) c else if ('.'c) c else c,`_T_ g_dot_T{dir}:if (((1f)DOT_T)f fsys.agetdents{dir}) sys.imp{dot_T{dir}} s_dot_T{dir;x}:dot_T{dir}sys.exp{x} dot_T{dir}:dir,(('/'1dir)/'/'),DOT_T valid{c;t;u}:if (0<#t) if (0<#u) u else (s_valid@0{ct})/t s_valid{v}:if (0_get{v;`t.visible}) 0 else if (0<#_get{v;`t.item}) 0 else (1=r)(r1 2)^`char=p r#d pd d%v path{p}: { (u;a)(n١l)`char lsys.areadlink{u}; if (i<#l) p&{iء(l;a)}; if ('/a/'3p) 2p else p } view_related{s;d}:(^/>dšs%`_D)^^/sd%`_S link_related{s;d}:(sd%`_R)ds%`_R related{sd}: { if (~^/sdTABLES) `domain else if (/sd (s;d)(1sd;0#1sd)) `self else if (view_related{s;d}) (s;d) else if (link_related{0#s;d}) (s;d) else `domain } type{s;d}: { if (1<#s) `cat else if (ds[0]%`_R) `right else if (ds[0]%`_L) `left else if (~()d%`_K) `group else if (1=#k kd%`_S) `view else if (~(1k)(1k)%`_S) `view else if (~^/>`_šk%`_T) `view else `report } *** Time-series utilities $load /ms/dist/apluslib/PROJ/a/1.0/common/dio calendar{x}: { (f;t)dio.parse{x}; (fa;ta)dio.wday{0;f,t}; dio.wday{1;(1+ta-fa)+fa} } series{y;x}: { (f;t)dio.parse{x}; c_get{y;`t.calendar}; if (f<0) fc[0]; if (t<0) tc[1+#c]; (fi;ti)cf,t; fi+1+ti-fi } *** Algorithms sort_func{f;x}:if (1`int `float `chart tx) f{x} else if (`symt) f{x} else `nonce up{x}:if (0=#x) 0 else sort_func{;x} down{x}:if (0=#x) 0 else sort_func{;x} view_sort{d;b}:if (1=#d) (b(up;down))0d else z (*i#d z#0d hb#(up;down)) do z((i#h)z#id)#z index_of{f;g}:(>fɡf)>fɡg link_index{f;g}:if (1=#f) (>''f)>''g else index_of{f;g} link_part{n;i}:((1b)-1bi[j]1+n)ji link_b_pr{f;g;h}:b.pr{g;h;f} link_b_part{i;h}:(i[;0]+ɡi[;1])##j)/l%`_N znn nr%`_N group_part{f;r}:(b1բ1,bj#k)jkkk>if (r() (f;r),(f;r)) fɡf else rf first{n;j}:if (~1b0<#j) (#b)n else k ((~b)/k)n kb\>0#b/j merge{s;d0;d1}:merge_0{d0;d1;1+s%`_M} *** Update -- [], [i], [,], and (bool/v) supported view_scb{s;d;i;p;c;v}: { if (~i()) if (0=i) i(#s%v),s%`_N; if ((0=#d)^i()) (j#s) do (s[j]%v)[]d else if (i()) (j#s r(1+m)w if (w()) wn) do (s[j]%v)[(-j#0,m)+k/w]k/d kr=j else if (n#c%v) (j#s r(1+m)w wif (()w) 0,i else (0,i)#w) do (s[j]%v)[if (/(0p)#s[j]%v) , else p]k/d p(<(-j#0,m)+k/w),1i kr=j else if (~()w (s[1+#s]%v)[,]d) (c%`_V)w,m[1+#m]+if ((#c%v)=#d) #d else 0; trigger{}; } *** S interface insert{s;c;v}:if (1=#kc%`_S) insert_view{s;c;v;k} else insert_cat{s;c;v;k} insert_view{s;c;v;k}: { (m;cp)if (`vars=_nc{`s;`AUTOCOPY}) .of{`row `copy;c,v} else (0.of{`row;c,v};0); if (()ic%`_V) ic%`_N; (p#t tc%v nk%`_N) do append_in_place{k;c;p#t;m;cp}; (c%`_V)(mi),n,mi m0s+m; trigger{}; } insert_cat{s;c;v;k}: { (m;cp)if (`vars=_nc{`s;`AUTOCOPY}) .of{`row `copy;c,v} else (0.of{`row;c,v};0); if (()ic%`_V) ic%`_N; (p#t tc%v nk%`_N kj#k j(1+p)m p+\,>k%`_N) do append_in_place{k;c;p#t;m;cp}; (c%`_V)(mi),n,mi m0s+m; trigger{}; } append_in_place{c;d;v;i;cp}:(d%v)[,]if (~cp) (1d%v)na{cv} else i#c%v delete{s;c;v}:if (1=#kc%`_S) delete_view{s;c;v;k} else delete_cat{s;c;v;k} delete_view{s;c;v;k}: { if (1=m0.of{`row;c,v}) (); if (()ic%`_V) ic%`_N; (k%t)(k%`_N; (c%`_V)(i[m]i)/i-i[m]vals)/(syms;vals); (syms;vals)(#t t_get{c,v;`t.report}) 'total:' else { k1',',ء.of{`title;cw} w(1+d)t; n1',',ء.of{(<<`out),<(_alsf{x} else >,2١z,z; wif ((#z)=jt`sym) v else jz; uif ((#z)=jt`int) '' else if (0i ijz) i else ''; if (0=z) z,z) ((t`func)z;if (`chart) 1(t`char)z) else case (+/b b`char=t) { 1; if (':'=1s s>(b1)#z) (;1s) else (s;); 2; if (':'=1s s>(b1)#z) (>''1z;1s) else (s;1>''1z) } } report_send{sd;y}: { (s;d)sd; kd%`_S; group_send@1 1{2!(ks)k;y}; cat_send{k,d;y} } view_send{sd;x}: { (v0;v1;b;xxx;hh)send_arg{x}; (s;d)sd; if ((sv0)_alldep{dv1}) `cycle; _set{d,v1;(`t.sent;sv0)}; if (`int=b) send_def{s;d;v0;v1} else d(v1),':',send_sub{v1;hh;'t.index{_V;`',v,'} ',v} vsv0; _scb{d,v1;(view_scb;s)}; add_f{d;v1}; v0,v1 } cat_send{sd;x}: { (v0;v1;b;xxx;hh)send_arg{x}; u' ','',' ',v w'`',v vΡsv0 (s;d)(1sd;0#1sd); if (/(sv0)_alldep{dv1}) `cycle; _set{d,v1;(`t.sent;s[0]v0)}; if (`int=b) send_def{0#s;d;v0;v1} else d(v1),':',send_sub{v1;hh;'t.index_each{_V;',w,';>',c_v{s;`_N},'} ',u}; _scb{d,v1;(cat_scb;s)}; add_f{d;v1}; v0,v1 } link_send_right{sd;x}: { (v0;v1;b;xxx;hh)send_arg{x}; (s;d)sd; if ((sv0)_alldep{dv1}) `cycle; _set{d,v1;(`t.sent;sv0)}; if (`int=b) send_def{s;d;v0;v1} else d(v1),':',send_sub{v1;hh;'t.index{_I_',(s),';`',v,'} ',v} vsv0; add_f{d;v1}; v0,v1 } link_send_left{sd;x}: { (v0;v1;b;h;hh)send_arg{x}; (s;d)sd; if ((sv0)_alldep{dv1}) `cycle; _set{d,v1;(`t.sent;sv0)}; if (`int=b) send_def{s;d;v0;v1} else d(v1),':',send_sub{v1;hh;link_send_def{s;d;v0;v1;h}}; add_f{d;v1}; v0,v1 } link_send_def{s;d;v0;v1;h}:if (()he_f{h}) link_send_first{s;d;v0;v1} else link_send_func{s;d;v0;v1;h} link_send_first{s;d;v0;v1}:'t.index{',k,';`',v,'} ',v,' ',k k'_K_',s vsv0 link_send_func{s;d;v0;v1;h}:if (h<{<}) link_send_body{s;d;v0;v1} else link_send_reduce{s;d;v0;v1;h} link_send_body{s;d;v0;v1}:if (`intd%'_J_',s) link_send_nested{s;d;v0;v1} else link_send_simple{s;d;v0;v1} link_send_reduce{s;d;v0;v1;h}:'if (~()z',link_send_body{s;d;v0;v1},') ',f_f{h},'z else 0t.na{`',(sv0),'}' link_send_nested{s;d;v0;v1}:'t.link_J{`',(s),';`',(d),';`',(v0),'} ',(sv0),' _J_',s link_send_simple{s;d;v0;v1}:'t.link_H{`',(s),';`',(d),';`',(v0),'} ',(sv0),' _J_',(s),' _K_',(s),' ',(s),'._H_',d link_J{s;d;v}:index_na{d%'_J_',s;sf_alsf{x}) define@1 1{(d;dir);av}; }; d } right_arg{dir;x}:(0#f;(#f)x) f@1 ('m.'@1 2@1((f=' ')@10)@0 1 f)/f@1 f fsys.agetdents{dir} left_arg{y}:if (`sym=0yif (0i i('1';'2';'3')<3xeq) map{d,f;(-1+i;fs)} fsfile_string{dir;3xeq} else if (''=1#2xeq) map{d,f;(0#1xeq;fs)} fsfile_string{dir;2xeq} else map{d,f;(0;fs)} fsfile_string{dir;xeq}; define_attributes{d;f;sf}; define_execute{d;f;`t.calendar;calendar}; } define_attributes{d;f;sf}:(i#syms (syms;vals)sf) do _set{d,f;(s;v)} si#syms vivals define_execute{d;f;s;func}:if (~()v v_get{d,f;s}) _set{d,f;(s;if (()func) v else func{v})} define_string{y}: { (f;y)2y; (xeq;sf)if (`boxy) (y;(;)) else (xeq;(#d%j _undef{dj} d%j; d } *** Catenate cat{sd;junk}: { (s;d)open_view_if{sd}; _undef{d`_V}; trigger{}; def_N{d} } *** Report report{sd;f}: { (s;d)open_view_if{sd}; m0; define{s;(`_;':_N',1m)}; sldd,s; h,if (0=f) ۡf else f; (i1+#h) do { ssdd; mm+1; ddif (i=#h) (s),'_' ff`_ else (s),'_',Ρff(-i)h; sl[,]dd; group{ss,dd;ff}; send_{ss,dd;h}; define{dd;(`_;':_N',1m)}; }; _undef{dd`_K}; (dd%`_K)[]1; zcat{sl,d;}; send_{sl,d;`_,h}; d'_V:t.merge{`',(s),';`',(dd),';`',(d),'}'; _set{d,`_;(`t.report;h)}; z } *** slotfiller to related contexts disperse{sd;v}:unique{_flat{z}} zproject{v)/#v; (j#m) do { sfj(m[j]#syms)sf; sfjsfj,(s;m[j]#v); ((m[j]#syms)sf)sfj }; }; sf } dot_T_to_table{d;x}: { (syms;sfs)_alsf{x}; t,`t.fields; (d%`f0)syms; (d`f0) _set (`title;`t.fields); (d`f0) _set (`respace;1); (i#syms) do { (ss;vv)_alsf{isfs}; (j#ss) do { sj#ss; vjvv; k'f',1ts; if (~st) { (d%k)(#syms)(); (dk) _set (`title;s); (dk) _set (`respace;1); t[,]s; }; (d%k)[i]up) `domain; formsif (~^/FORMSforms) s.unique{forms}/forms; bttr(`form `century `min `max `forms;(fm;digs;lw;up;forms)); attrdefault{bttr,(<~(0attr)0bttr)/attr}; (`intval;attr) } in_ymd{parts}: { nparts; num0 100 100n; if ((num[0]TO) `domain; md31 28 31 30 31 30 31 31 30 31 30 31; md[1]md[1]+0=4|num[0]; if ((num[1]<1)num[1]>12) `domain; if ((num[2]<1)num[2]>(((1+12)num[1])(md,0))[0]) `domain; (n;1) } in_mdy{parts}: { (m;d;y)_sfi{0 2 4#parts}; if (((y99)(y>TO)y<0) `domain; yy+(flagy<100)10019+y<60; md31 28 31 30 31 30 31 31 30 31 30 31; md[1]md[1]+0=4|y; if ((m<1)m>12) `domain; if ((d<1)d>(((1+12)m)(md,0))[0]) `domain; (0 100 100y,m,d;4=2+2~flag) } in_md{parts}: { (m;d)_sfi{0 2#parts}; md31 29 31 30 31 30 31 31 30 31 30 31; if ((m<1)m>12) `domain; if ((d<1)d>(((1+12)m)(md,0))[0]) `domain; (0 100m,d;0) } out_{x}: { (val;attr)if (0=x) (x;) else 2x; attr2attr; fmif (`form0attr) `formattr else `mdy; zrif (`zero0attr) `zeroattr else 1; blif (`na0attr) `naattr else 999999999; yd2 4[if (`century0attr) `centuryattr else fmCENTURIES]; wdif (`width0attr) `widthattr else yd+fmWIDTHS; zif (1valbl) wd' ' else case (fm) { `ymd; ,_fmt{"i8";val}; `mdy; out_mdy{val;zr;yd}; `md; out_md{val;zr} }; if (wd#z) wdz else wd'*' } out_mdy{x;zr;yd}:(,_fmt{(zr/"z"),"i2";n[1]}),"/",(,_fmt{"zi2";n[2]}),"/",,_fmt{"zi",t;(10*t)|n[0]} tyd n0 100 100x out_md{x;zr}:(,_fmt{(zr/"z"),"i2";n[1]}),"/",,_fmt{"zi2";n[2]} n0 100 100x wday{f;x}: { b+\0 31 28 31 30 31 30 31 31 30 31 30; acx; if (~f) { x1+0 100 100,|x; x[2;]0 1212x[2;]; tx[0;].4 100 400; tt[;0]-t[;1]-t[;2]; rx[2;]+(365x[0;])+t; r366+r+b[x[1;]]; t0=4 100 400 .|x[0;]+1; tt[0;]t[1;]t[2;]; rar+(x[1;]2)^t; rr-(a+1)2>a7|r; (0ca<2)+c(2+7|r)+5r7 } else { x,|x; x2+(5|x)+7x5; r(x-365)365.2425; t r.4 100 400; tt[;0]-t[;1]-t[;2]; xx-365+(365r)+t; d(x=0)/x; tr.+0 1; t0=4 100 400.|t; et[0;;]t[1;;]t[2;;]; be[;1].+b; b[;2]((x),2)0 31; r[d]r[d]-1; x[d]x[d]+364+e[d;0]; r(r+1)~+/@1(x.+120)>b; xx-(,b)[(12x)+r[1;]-1]; ca100r,x } } ARROW'' parse{x}: { ixARROW x(x' ')/x; >0ءdio.in_{(ix;(i+1)x)} } aplus-fsf-4.22/src/dap/0000777000265000001440000000000010774512605010444 5aplus-fsf-4.22/src/dap/Makefile.am0000444000265000001440000000706307400253111012402 ## Process this file with automake to produce Makefile.in ############################################################################### ## ## ## Copyright (c) 2001 Morgan Stanley Dean Witter & Co. All rights reserved. ## ## See .../src/LICENSE for terms of distribution. ## ## ## ## ## ############################################################################### lib_LTLIBRARIES = libdap.la libdap_la_SOURCES = \ BcdPack.c \ BcdUnpack.c \ PrAscDecode.c \ PrAscEncode.c \ args_data.c \ argsfirst.c \ argsgetopt.c \ argsnext.c \ avlalloc.c \ avlfind.c \ avlfree.c \ avlinsert.c \ avlremove.c \ avlwalk.c \ balloc.c \ balloc_r.c \ bdup.c \ bdup_r.c \ bfree.c \ bgprintf.c \ bnstring.c \ bnstring_r.c \ brealloc.c \ brealloc_r.c \ bstrhash.c \ bstring.c \ bstring_r.c \ buffalloc.c \ buffalloc_r.c \ buffclear.c \ bufffrag.c \ bufffree.c \ buffgetc.c \ buffgprintf.c \ buffputc.c \ buffputc_r.c \ buffputdouble.c \ buffputint.c \ buffputlong.c \ buffputs.c \ buffputshort.c \ buffread.c \ buffref.c \ buffroom.c \ buffroom_r.c \ buffstuff.c \ buffstuff_r.c \ bufftrim.c \ buffwrite.c \ buffzero.c \ chanclose.c \ chandsbl.c \ chanenbl.c \ chanisdsbl.c \ chanisenbl.c \ chanopen.c \ chanproc.c \ chans.c \ chansetpri.c \ connackestb.c \ connalloc.c \ connclose.c \ connfree.c \ connopen.c \ dap_data.c \ dapinit.c \ daploop.c \ dapselect.c \ dapterm.c \ dapversion.c \ doclose.c \ doread.c \ doselect.c \ dowrite.c \ error.c \ exboalloc.c \ exbobackoff.c \ exbofree.c \ exboreset.c \ exbovalue.c \ fds_data.c \ fdsalloc.c \ fdsalloc_r.c \ fdsanyset.c \ fdsclr.c \ fdscopy.c \ fdsdup.c \ fdsdup_r.c \ fdsfree.c \ fdsfresh.c \ fdsinit.c \ fdsisset.c \ fdsset.c \ fdsterm.c \ fdszero.c \ fletchalloc.c \ fletchcheck.c \ fletchdone.c \ fletchfree.c \ fletchpatch.c \ fletchsum.c \ getmuser.c \ getrp.c \ hashalloc.c \ hashfind.c \ hashfree.c \ hashinsert.c \ hashnode.c \ hashremove.c \ hashreplace.c \ hashwalk.c \ hostcmp.c \ hostname.c \ hostname_l.c \ hppalloc.c \ hppfree.c \ hppmake_in.c \ hppname_in.c \ kvpalloc.c \ kvpfind.c \ kvpfree.c \ kvpinsert.c \ kvpkey.c \ kvpremove.c \ kvpreplace.c \ kvpvalue.c \ lstnalloc.c \ lstnclose.c \ lstnfree.c \ lstnopen.c \ mod255.c \ mtmalloc.c \ mtmdnins.c \ mtmdnrm.c \ mtmfree.c \ mtmlink.c \ mtmunlink.c \ mtmupins.c \ mtmuprm.c \ mtmvalue.c \ nodealloc.c \ nodealloc_r.c \ nodefree.c \ nodeinsert.c \ noderemove.c \ nodesort.c \ nodetoad.c \ noop.c \ parity.c \ service.c \ servname_in.c \ sgnlcatch.c \ sgnldefault.c \ sgnlignore.c \ sgnloriginal.c \ sgnlproc.c \ sgnls.c \ slpqalloc.c \ slpqents.c \ slpqfree.c \ slpqgiveup.c \ slpqimmed.c \ slpqproc.c \ slpqsched.c \ slpqsleep.c \ slpqwakeup.c \ timer.c \ timerabs.c \ timerclr.c \ timernext.c \ timerproc.c \ timers.c \ tod.c \ tod_l.c \ todsec.c \ todstring.c \ tr_atoe.c \ tr_etoa.c \ tr_quadav.c \ trchar.c \ tvcmp.c \ tvdiff.c \ tvnorm.c \ tvstring.c \ tvsum.c \ ulbetween.c \ ultodec.c \ ultohex.c \ ultooct.c \ Warn.h\ args.h\ ascii.h\ avl.h\ balloc.h\ buff.h\ chan.h\ conn.h\ dap.h\ exbo.h\ fds.h\ fletch.h\ hash.h\ hpp.h\ kvp.h\ lstn.h\ misc.h\ mtm.h\ node.h\ notsunos4.h\ remprog.h\ sgnl.h\ slpq.h\ timer.h\ tod.h\ tr.h\ tv.h\ ulto.h INCLUDES = -I.. aplus-fsf-4.22/src/dap/Makefile.in0000644000265000001440000010601110774512522012422 # Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ ############################################################################### ############################################################################### SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CXX = @CXX@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ STRIP = @STRIP@ VERSION = @VERSION@ X_INCLUDES = @X_INCLUDES@ X_LIBS = @X_LIBS@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ lib_LTLIBRARIES = libdap.la libdap_la_SOURCES = \ BcdPack.c \ BcdUnpack.c \ PrAscDecode.c \ PrAscEncode.c \ args_data.c \ argsfirst.c \ argsgetopt.c \ argsnext.c \ avlalloc.c \ avlfind.c \ avlfree.c \ avlinsert.c \ avlremove.c \ avlwalk.c \ balloc.c \ balloc_r.c \ bdup.c \ bdup_r.c \ bfree.c \ bgprintf.c \ bnstring.c \ bnstring_r.c \ brealloc.c \ brealloc_r.c \ bstrhash.c \ bstring.c \ bstring_r.c \ buffalloc.c \ buffalloc_r.c \ buffclear.c \ bufffrag.c \ bufffree.c \ buffgetc.c \ buffgprintf.c \ buffputc.c \ buffputc_r.c \ buffputdouble.c \ buffputint.c \ buffputlong.c \ buffputs.c \ buffputshort.c \ buffread.c \ buffref.c \ buffroom.c \ buffroom_r.c \ buffstuff.c \ buffstuff_r.c \ bufftrim.c \ buffwrite.c \ buffzero.c \ chanclose.c \ chandsbl.c \ chanenbl.c \ chanisdsbl.c \ chanisenbl.c \ chanopen.c \ chanproc.c \ chans.c \ chansetpri.c \ connackestb.c \ connalloc.c \ connclose.c \ connfree.c \ connopen.c \ dap_data.c \ dapinit.c \ daploop.c \ dapselect.c \ dapterm.c \ dapversion.c \ doclose.c \ doread.c \ doselect.c \ dowrite.c \ error.c \ exboalloc.c \ exbobackoff.c \ exbofree.c \ exboreset.c \ exbovalue.c \ fds_data.c \ fdsalloc.c \ fdsalloc_r.c \ fdsanyset.c \ fdsclr.c \ fdscopy.c \ fdsdup.c \ fdsdup_r.c \ fdsfree.c \ fdsfresh.c \ fdsinit.c \ fdsisset.c \ fdsset.c \ fdsterm.c \ fdszero.c \ fletchalloc.c \ fletchcheck.c \ fletchdone.c \ fletchfree.c \ fletchpatch.c \ fletchsum.c \ getmuser.c \ getrp.c \ hashalloc.c \ hashfind.c \ hashfree.c \ hashinsert.c \ hashnode.c \ hashremove.c \ hashreplace.c \ hashwalk.c \ hostcmp.c \ hostname.c \ hostname_l.c \ hppalloc.c \ hppfree.c \ hppmake_in.c \ hppname_in.c \ kvpalloc.c \ kvpfind.c \ kvpfree.c \ kvpinsert.c \ kvpkey.c \ kvpremove.c \ kvpreplace.c \ kvpvalue.c \ lstnalloc.c \ lstnclose.c \ lstnfree.c \ lstnopen.c \ mod255.c \ mtmalloc.c \ mtmdnins.c \ mtmdnrm.c \ mtmfree.c \ mtmlink.c \ mtmunlink.c \ mtmupins.c \ mtmuprm.c \ mtmvalue.c \ nodealloc.c \ nodealloc_r.c \ nodefree.c \ nodeinsert.c \ noderemove.c \ nodesort.c \ nodetoad.c \ noop.c \ parity.c \ service.c \ servname_in.c \ sgnlcatch.c \ sgnldefault.c \ sgnlignore.c \ sgnloriginal.c \ sgnlproc.c \ sgnls.c \ slpqalloc.c \ slpqents.c \ slpqfree.c \ slpqgiveup.c \ slpqimmed.c \ slpqproc.c \ slpqsched.c \ slpqsleep.c \ slpqwakeup.c \ timer.c \ timerabs.c \ timerclr.c \ timernext.c \ timerproc.c \ timers.c \ tod.c \ tod_l.c \ todsec.c \ todstring.c \ tr_atoe.c \ tr_etoa.c \ tr_quadav.c \ trchar.c \ tvcmp.c \ tvdiff.c \ tvnorm.c \ tvstring.c \ tvsum.c \ ulbetween.c \ ultodec.c \ ultohex.c \ ultooct.c \ Warn.h\ args.h\ ascii.h\ avl.h\ balloc.h\ buff.h\ chan.h\ conn.h\ dap.h\ exbo.h\ fds.h\ fletch.h\ hash.h\ hpp.h\ kvp.h\ lstn.h\ misc.h\ mtm.h\ node.h\ notsunos4.h\ remprog.h\ sgnl.h\ slpq.h\ timer.h\ tod.h\ tr.h\ tv.h\ ulto.h INCLUDES = -I.. subdir = src/dap mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_CLEAN_FILES = LTLIBRARIES = $(lib_LTLIBRARIES) libdap_la_LDFLAGS = libdap_la_LIBADD = am_libdap_la_OBJECTS = BcdPack.lo BcdUnpack.lo PrAscDecode.lo \ PrAscEncode.lo args_data.lo argsfirst.lo argsgetopt.lo \ argsnext.lo avlalloc.lo avlfind.lo avlfree.lo avlinsert.lo \ avlremove.lo avlwalk.lo balloc.lo balloc_r.lo bdup.lo bdup_r.lo \ bfree.lo bgprintf.lo bnstring.lo bnstring_r.lo brealloc.lo \ brealloc_r.lo bstrhash.lo bstring.lo bstring_r.lo buffalloc.lo \ buffalloc_r.lo buffclear.lo bufffrag.lo bufffree.lo buffgetc.lo \ buffgprintf.lo buffputc.lo buffputc_r.lo buffputdouble.lo \ buffputint.lo buffputlong.lo buffputs.lo buffputshort.lo \ buffread.lo buffref.lo buffroom.lo buffroom_r.lo buffstuff.lo \ buffstuff_r.lo bufftrim.lo buffwrite.lo buffzero.lo \ chanclose.lo chandsbl.lo chanenbl.lo chanisdsbl.lo \ chanisenbl.lo chanopen.lo chanproc.lo chans.lo chansetpri.lo \ connackestb.lo connalloc.lo connclose.lo connfree.lo \ connopen.lo dap_data.lo dapinit.lo daploop.lo dapselect.lo \ dapterm.lo dapversion.lo doclose.lo doread.lo doselect.lo \ dowrite.lo error.lo exboalloc.lo exbobackoff.lo exbofree.lo \ exboreset.lo exbovalue.lo fds_data.lo fdsalloc.lo fdsalloc_r.lo \ fdsanyset.lo fdsclr.lo fdscopy.lo fdsdup.lo fdsdup_r.lo \ fdsfree.lo fdsfresh.lo fdsinit.lo fdsisset.lo fdsset.lo \ fdsterm.lo fdszero.lo fletchalloc.lo fletchcheck.lo \ fletchdone.lo fletchfree.lo fletchpatch.lo fletchsum.lo \ getmuser.lo getrp.lo hashalloc.lo hashfind.lo hashfree.lo \ hashinsert.lo hashnode.lo hashremove.lo hashreplace.lo \ hashwalk.lo hostcmp.lo hostname.lo hostname_l.lo hppalloc.lo \ hppfree.lo hppmake_in.lo hppname_in.lo kvpalloc.lo kvpfind.lo \ kvpfree.lo kvpinsert.lo kvpkey.lo kvpremove.lo kvpreplace.lo \ kvpvalue.lo lstnalloc.lo lstnclose.lo lstnfree.lo lstnopen.lo \ mod255.lo mtmalloc.lo mtmdnins.lo mtmdnrm.lo mtmfree.lo \ mtmlink.lo mtmunlink.lo mtmupins.lo mtmuprm.lo mtmvalue.lo \ nodealloc.lo nodealloc_r.lo nodefree.lo nodeinsert.lo \ noderemove.lo nodesort.lo nodetoad.lo noop.lo parity.lo \ service.lo servname_in.lo sgnlcatch.lo sgnldefault.lo \ sgnlignore.lo sgnloriginal.lo sgnlproc.lo sgnls.lo slpqalloc.lo \ slpqents.lo slpqfree.lo slpqgiveup.lo slpqimmed.lo slpqproc.lo \ slpqsched.lo slpqsleep.lo slpqwakeup.lo timer.lo timerabs.lo \ timerclr.lo timernext.lo timerproc.lo timers.lo tod.lo tod_l.lo \ todsec.lo todstring.lo tr_atoe.lo tr_etoa.lo tr_quadav.lo \ trchar.lo tvcmp.lo tvdiff.lo tvnorm.lo tvstring.lo tvsum.lo \ ulbetween.lo ultodec.lo ultohex.lo ultooct.lo libdap_la_OBJECTS = $(am_libdap_la_OBJECTS) DEFS = @DEFS@ DEFAULT_INCLUDES = -I. -I$(srcdir) CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/BcdPack.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/BcdUnpack.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/PrAscDecode.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/PrAscEncode.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/args_data.Plo ./$(DEPDIR)/argsfirst.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/argsgetopt.Plo ./$(DEPDIR)/argsnext.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/avlalloc.Plo ./$(DEPDIR)/avlfind.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/avlfree.Plo ./$(DEPDIR)/avlinsert.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/avlremove.Plo ./$(DEPDIR)/avlwalk.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/balloc.Plo ./$(DEPDIR)/balloc_r.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/bdup.Plo ./$(DEPDIR)/bdup_r.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/bfree.Plo ./$(DEPDIR)/bgprintf.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/bnstring.Plo ./$(DEPDIR)/bnstring_r.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/brealloc.Plo ./$(DEPDIR)/brealloc_r.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/bstrhash.Plo ./$(DEPDIR)/bstring.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/bstring_r.Plo ./$(DEPDIR)/buffalloc.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/buffalloc_r.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/buffclear.Plo ./$(DEPDIR)/bufffrag.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/bufffree.Plo ./$(DEPDIR)/buffgetc.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/buffgprintf.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/buffputc.Plo ./$(DEPDIR)/buffputc_r.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/buffputdouble.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/buffputint.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/buffputlong.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/buffputs.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/buffputshort.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/buffread.Plo ./$(DEPDIR)/buffref.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/buffroom.Plo ./$(DEPDIR)/buffroom_r.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/buffstuff.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/buffstuff_r.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/bufftrim.Plo ./$(DEPDIR)/buffwrite.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/buffzero.Plo ./$(DEPDIR)/chanclose.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/chandsbl.Plo ./$(DEPDIR)/chanenbl.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/chanisdsbl.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/chanisenbl.Plo ./$(DEPDIR)/chanopen.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/chanproc.Plo ./$(DEPDIR)/chans.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/chansetpri.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/connackestb.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/connalloc.Plo ./$(DEPDIR)/connclose.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/connfree.Plo ./$(DEPDIR)/connopen.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/dap_data.Plo ./$(DEPDIR)/dapinit.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/daploop.Plo ./$(DEPDIR)/dapselect.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/dapterm.Plo ./$(DEPDIR)/dapversion.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/doclose.Plo ./$(DEPDIR)/doread.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/doselect.Plo ./$(DEPDIR)/dowrite.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/error.Plo ./$(DEPDIR)/exboalloc.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/exbobackoff.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/exbofree.Plo ./$(DEPDIR)/exboreset.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/exbovalue.Plo ./$(DEPDIR)/fds_data.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/fdsalloc.Plo ./$(DEPDIR)/fdsalloc_r.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/fdsanyset.Plo ./$(DEPDIR)/fdsclr.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/fdscopy.Plo ./$(DEPDIR)/fdsdup.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/fdsdup_r.Plo ./$(DEPDIR)/fdsfree.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/fdsfresh.Plo ./$(DEPDIR)/fdsinit.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/fdsisset.Plo ./$(DEPDIR)/fdsset.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/fdsterm.Plo ./$(DEPDIR)/fdszero.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/fletchalloc.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/fletchcheck.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/fletchdone.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/fletchfree.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/fletchpatch.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/fletchsum.Plo ./$(DEPDIR)/getmuser.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/getrp.Plo ./$(DEPDIR)/hashalloc.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/hashfind.Plo ./$(DEPDIR)/hashfree.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/hashinsert.Plo ./$(DEPDIR)/hashnode.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/hashremove.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/hashreplace.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/hashwalk.Plo ./$(DEPDIR)/hostcmp.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/hostname.Plo ./$(DEPDIR)/hostname_l.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/hppalloc.Plo ./$(DEPDIR)/hppfree.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/hppmake_in.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/hppname_in.Plo ./$(DEPDIR)/kvpalloc.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/kvpfind.Plo ./$(DEPDIR)/kvpfree.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/kvpinsert.Plo ./$(DEPDIR)/kvpkey.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/kvpremove.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/kvpreplace.Plo ./$(DEPDIR)/kvpvalue.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/lstnalloc.Plo ./$(DEPDIR)/lstnclose.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/lstnfree.Plo ./$(DEPDIR)/lstnopen.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/mod255.Plo ./$(DEPDIR)/mtmalloc.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/mtmdnins.Plo ./$(DEPDIR)/mtmdnrm.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/mtmfree.Plo ./$(DEPDIR)/mtmlink.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/mtmunlink.Plo ./$(DEPDIR)/mtmupins.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/mtmuprm.Plo ./$(DEPDIR)/mtmvalue.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/nodealloc.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/nodealloc_r.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/nodefree.Plo ./$(DEPDIR)/nodeinsert.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/noderemove.Plo ./$(DEPDIR)/nodesort.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/nodetoad.Plo ./$(DEPDIR)/noop.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/parity.Plo ./$(DEPDIR)/service.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/servname_in.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/sgnlcatch.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/sgnldefault.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/sgnlignore.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/sgnloriginal.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/sgnlproc.Plo ./$(DEPDIR)/sgnls.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/slpqalloc.Plo ./$(DEPDIR)/slpqents.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/slpqfree.Plo ./$(DEPDIR)/slpqgiveup.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/slpqimmed.Plo ./$(DEPDIR)/slpqproc.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/slpqsched.Plo ./$(DEPDIR)/slpqsleep.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/slpqwakeup.Plo ./$(DEPDIR)/timer.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/timerabs.Plo ./$(DEPDIR)/timerclr.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/timernext.Plo ./$(DEPDIR)/timerproc.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/timers.Plo ./$(DEPDIR)/tod.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/tod_l.Plo ./$(DEPDIR)/todsec.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/todstring.Plo ./$(DEPDIR)/tr_atoe.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/tr_etoa.Plo ./$(DEPDIR)/tr_quadav.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/trchar.Plo ./$(DEPDIR)/tvcmp.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/tvdiff.Plo ./$(DEPDIR)/tvnorm.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/tvstring.Plo ./$(DEPDIR)/tvsum.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/ulbetween.Plo ./$(DEPDIR)/ultodec.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/ultohex.Plo ./$(DEPDIR)/ultooct.Plo COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ CFLAGS = @CFLAGS@ DIST_SOURCES = $(libdap_la_SOURCES) DIST_COMMON = Makefile.am Makefile.in SOURCES = $(libdap_la_SOURCES) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/dap/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) libLTLIBRARIES_INSTALL = $(INSTALL) install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(libdir) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f"; \ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p"; \ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test -z "$dir" && dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libdap.la: $(libdap_la_OBJECTS) $(libdap_la_DEPENDENCIES) $(LINK) -rpath $(libdir) $(libdap_la_LDFLAGS) $(libdap_la_OBJECTS) $(libdap_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BcdPack.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BcdUnpack.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PrAscDecode.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PrAscEncode.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/args_data.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argsfirst.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argsgetopt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argsnext.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/avlalloc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/avlfind.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/avlfree.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/avlinsert.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/avlremove.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/avlwalk.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/balloc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/balloc_r.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bdup.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bdup_r.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bfree.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bgprintf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bnstring.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bnstring_r.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/brealloc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/brealloc_r.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bstrhash.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bstring.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bstring_r.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffalloc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffalloc_r.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffclear.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bufffrag.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bufffree.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffgetc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffgprintf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffputc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffputc_r.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffputdouble.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffputint.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffputlong.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffputs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffputshort.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffread.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffref.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffroom.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffroom_r.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffstuff.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffstuff_r.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bufftrim.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffwrite.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffzero.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chanclose.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chandsbl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chanenbl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chanisdsbl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chanisenbl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chanopen.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chanproc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chans.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chansetpri.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connackestb.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connalloc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connclose.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connfree.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connopen.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dap_data.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dapinit.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/daploop.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dapselect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dapterm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dapversion.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/doclose.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/doread.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/doselect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dowrite.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exboalloc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exbobackoff.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exbofree.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exboreset.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exbovalue.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fds_data.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdsalloc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdsalloc_r.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdsanyset.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdsclr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdscopy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdsdup.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdsdup_r.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdsfree.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdsfresh.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdsinit.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdsisset.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdsset.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdsterm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdszero.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fletchalloc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fletchcheck.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fletchdone.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fletchfree.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fletchpatch.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fletchsum.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getmuser.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getrp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hashalloc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hashfind.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hashfree.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hashinsert.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hashnode.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hashremove.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hashreplace.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hashwalk.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hostcmp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hostname.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hostname_l.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hppalloc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hppfree.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hppmake_in.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hppname_in.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kvpalloc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kvpfind.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kvpfree.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kvpinsert.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kvpkey.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kvpremove.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kvpreplace.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kvpvalue.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstnalloc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstnclose.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstnfree.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstnopen.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod255.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mtmalloc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mtmdnins.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mtmdnrm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mtmfree.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mtmlink.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mtmunlink.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mtmupins.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mtmuprm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mtmvalue.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nodealloc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nodealloc_r.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nodefree.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nodeinsert.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/noderemove.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nodesort.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nodetoad.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/noop.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parity.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/service.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/servname_in.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sgnlcatch.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sgnldefault.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sgnlignore.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sgnloriginal.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sgnlproc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sgnls.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slpqalloc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slpqents.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slpqfree.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slpqgiveup.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slpqimmed.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slpqproc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slpqsched.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slpqsleep.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slpqwakeup.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timerabs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timerclr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timernext.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timerproc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timers.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tod.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tod_l.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/todsec.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/todstring.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tr_atoe.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tr_etoa.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tr_quadav.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trchar.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tvcmp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tvdiff.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tvnorm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tvstring.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tvsum.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ulbetween.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ultodec.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ultohex.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ultooct.Plo@am__quote@ distclean-depend: -rm -rf ./$(DEPDIR) .c.o: @AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< .c.obj: @AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(COMPILE) -c `cygpath -w $<` .c.lo: @AMDEP_TRUE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< CCDEPMODE = @CCDEPMODE@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ETAGS = etags ETAGSFLAGS = tags: TAGS 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; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ 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; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = ../.. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: $(mkinstalldirs) $(DESTDIR)$(libdir) 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_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_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-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-compile distclean-depend \ distclean-generic distclean-libtool distclean-tags dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-exec-am: install-libLTLIBRARIES install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES .PHONY: GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool distclean distclean-compile \ distclean-depend distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am info info-am install \ install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am \ install-libLTLIBRARIES install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool tags uninstall \ uninstall-am uninstall-info-am uninstall-libLTLIBRARIES # 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: aplus-fsf-4.22/src/dap/BcdPack.c0000644000265000001440000000251410772770361012020 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Jordan Hayes */ /* header file inclusions */ #include #include #include /* external function definitions */ int BcdPack(char *str, int len, unsigned char *bcd) { int j; int i; unsigned char c; if ((len <= 0) || (bcd == (unsigned char *) (0))) return 0; i = 0; if (str != (char *) (0)) { while (i < len) { c = (unsigned char) str[i++]; if (!isdigit(c)) { if (c == '\0') break; return -1; } } } j = MODRNDUP(len, 2); while (--i >= 0) { /* TK - make ASCII independent */ c = (str[i] - '0') & 0xf; if (--j % 2 == 0) bcd[j / 2] |= (c << 4); else bcd[j / 2] = c; } /* left pad the bcd array */ while (--j >= 0) if (j % 2 != 0) bcd[j / 2] = 0; return (len); } aplus-fsf-4.22/src/dap/BcdUnpack.c0000644000265000001440000000223410772770361012362 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Jordan Hayes */ /* header file inclusions */ #include #include /* external function definitions */ int BcdUnpack(unsigned char *bcd, int len, char *str) { int i; unsigned char c; if ((len <= 0) || (str == (char *) (0))) return 0; if (bcd != (unsigned char *) (0)) { for (i = len; --i >= 0;) str[i] = '0'; } else { int j = MODRNDUP(len, 2); for (i = len; --i >= 0;) { c = bcd[--j / 2]; if (j % 2) c >>= 4; if ((c &= 0xf) > 9) return -1; /* TK - make ASCII independent */ str[i] = (char) ('0' + c); } } return 0; } aplus-fsf-4.22/src/dap/PrAscDecode.c0000644000265000001440000000240710772770361012646 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include /* internal macro declarations */ #define TILDA 0x01 #define CARAT 0x02 #define BACKSLASH 0x04 /* external function definitions */ int PrAscDecode(int c, struct buff * bp, int state) { c &= 0xff; if (state & BACKSLASH) { /* take this character modified by rest of state */ } else { switch (c) { case '~': return state |= TILDA; case '^': return state |= CARAT; case '\\': return state |= BACKSLASH; default: /* take this character modified by the tilda and carat */ break; } } if (state & TILDA) c |= 0x80; if (state & CARAT) c ^= 0x40; buffputc(bp, c); return 0; } aplus-fsf-4.22/src/dap/PrAscEncode.c0000644000265000001440000000163710772770361012664 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* header file inclusions */ #include /* external function definitions */ void PrAscEncode(int c, struct buff * bp) { c &= 0xff; if (c & 0x80) { buffputc(bp, '~'); c &= 0x7f; } if (c <= 0x20 || c == 0x7f) { buffputc(bp, '^'); c ^= 0x40; } if (c == '~' || c == '^' || c == '\\') { buffputc(bp, '\\'); } buffputc(bp, c); return; } aplus-fsf-4.22/src/dap/args_data.c0000644000265000001440000000123210772770361012452 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* external data definitions */ int args_argpos; int args_index; char *args_value; aplus-fsf-4.22/src/dap/argsfirst.c0000644000265000001440000000241510772770361012535 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* * argsfirst initializes the variables used by other functions in processing * the argument list. It sets args_value to be argv[0] and returns zero. If * the argument list is empty, it returns -1 and sets args_value to be null. */ /* header file inclusions */ #include /* external function definitions */ int argsfirst(int argc, char **argv) { /* initalize argument processing variables */ args_index = 0; args_argpos = 0; args_value = (char *) (0); /* check for empty list */ if ((argv == (char **) (0)) || (args_index >= argc)) { /* empty argument list */ return -1; } /* process argv[0] */ args_value = argv[0]; argsnext(argc, argv); return 0; } aplus-fsf-4.22/src/dap/argsgetopt.c0000644000265000001440000000522010772770361012705 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* * argsgetopt - this similar to getopt(3) except that it 1) never prints an * error message; 2) always returns the actual option letter found, relying * on the user to handle unknown options in the default case of a switch * statement; 3) treats unknown options as though they had an argument (to * avoid cascaded errors); 4) Sets args_value to null when no argument can be * found; 5) Null arguments are skipped. */ /* header file inclusions */ #include #include #include /* external function definitions */ int argsgetopt(int argc, char **argv, char *opts) { int c; char *cp; if (args_index == 0) { /* * args_first never called or it detected empty list, call it and if it * returns -1, return -1, indicating that there are no options. */ if (argsfirst(argc, argv) == -1) { return -1; } } if (args_argpos == 0) { if (args_index >= argc) { return -1; } /* begin processing new argument */ if ((argv[args_index][0] != '-') || (argv[args_index][1] == '\0')) { /* new argument is first after options */ return -1; } if (argv[args_index][1] == '-') { /* new argument is end of options marker, "--" */ argsnext(argc, argv); return -1; } args_argpos = 1; } if (((c = argv[args_index][args_argpos++]) == ':') || ((cp = (char *) strchr((DEV_STRARG) opts, c)) == 0) || (*++cp == ':')) { /* unknown option or option with argument */ if (argv[args_index][args_argpos] != '\0') { /* option argument follows immediately */ args_value = &argv[args_index][args_argpos]; argsnext(argc, argv); } else if (argsnext(argc, argv), args_index >= argc) { /* no option argument */ args_value = (char *) (0); } else { /* option argument is nex* argument */ args_value = argv[args_index]; argsnext(argc, argv); } } else { /* good option without argument */ if (argv[args_index][args_argpos] == '\0') { argsnext(argc, argv); } args_value = (char *) (0); } return c; } aplus-fsf-4.22/src/dap/argsnext.c0000644000265000001440000000162210772770361012363 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include /* external function definitions */ void argsnext(int argc, char **argv) { /* skip past null arguments */ while (args_index < argc) { if (argv[++args_index] != (char *) (0)) { break; } } /* zero position within argument */ args_argpos = 0; return; } aplus-fsf-4.22/src/dap/avlalloc.c0000644000265000001440000000445110772770361012330 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* * avlalloc() will allocate a new instance of an avl tree search structure * and initialize it as an empty tree. */ /* * Reference: _Algorithms_&_Data_Structures_, by Niklaus Wirth, * Prentiss-Hall, Englewood Cliff, NJ, 1986, pp.196-227. */ /* header file inclusions */ #include #include #include #include /* internal function declarations */ static void *_key(struct kvp * p); static void *_value(struct kvp * p); static int _compare(char *k1, char *k2); static void *_replace(struct kvp * p, void *val); /* external function definitions */ struct avl *avlalloc(void *(*key) (), void *(*value) (), int (*compare) (), void *(*insert) (), void *(*replace) (), void (*remove) ()) { struct avl *p; if (key == (void *(*) ()) (0)) key = _key; if (value == (void *(*) ()) (0)) value = _value; if (compare == (int (*) ()) (0)) compare = _compare; if (insert == (void *(*) ()) (0)) insert = (void *(*) ()) kvpalloc; if (replace == (void *(*) ()) (0)) replace = _replace; if (remove == (void (*) ()) (0)) remove = kvpfree; p = (struct avl *) balloc(sizeof(*p)); p->root = (struct avln *) (0); p->key = key; p->value = value; p->compare = compare; p->insert = insert; p->replace = replace; p->remove = remove; return p; } /* internal function definitions */ static void * _key(struct kvp * p) { return p->key; } static void * _value(struct kvp * p) { return p->d; } static int _compare(char *k1, char *k2) { int rc = strcmp((DEV_STRARG) k1, (DEV_STRARG) k2); if (rc < 0) return -1; if (rc > 0) return 1; return 0; } static void * _replace(struct kvp * p, void *val) { void *rc = p->d; p->d = val; return rc; } aplus-fsf-4.22/src/dap/avlfind.c0000644000265000001440000000223610772770361012155 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* * avlfind() will search the avl tree for the element with the given key * value. It will return a handle to it. */ /* header file inclusions */ #include /* external function definitions */ void * avlfind(struct avl * p, void *key) { if ((p != (struct avl *) (0)) && (key != (void *) (0))) { struct avln *ap = p->root; int r; while (ap != (struct avln *) (0)) { r = (*(p->compare)) (key, (*(p->key)) (ap->d)); if (r < 0) ap = ap->l; else if (r > 0) ap = ap->r; else return (*(p->value)) (ap->d); } } return (void *) (0); } aplus-fsf-4.22/src/dap/avlfree.c0000644000265000001440000000232310772770361012153 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* * avlfree() will free all resources in an existing avl tree */ /* header file inclusions */ #include #include /* internal function definitions */ static void _free(void (*remove) (), struct avln * ap); /* external function definitions */ void avlfree(struct avl * p) { if (p != (struct avl *) (0)) { _free(p->remove, p->root); bfree((char *) p); } return; } /* internal function definitions */ static void _free(void (*remove) (), struct avln * ap) { if (ap != (struct avln *) (0)) { _free(remove, ap->l); _free(remove, ap->r); (*remove) (ap->d); bfree((char *) ap); } return; } aplus-fsf-4.22/src/dap/avlinsert.c0000644000265000001440000001003710772770362012540 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* * avlinsert() will place an element into an avl tree. The element will be * placed in such a way that an inorder traversal of the nodes of the tree * visits the nodes in increasing key order. The tree remains balanced in * accordance with the AVL balancing criteria. */ /* * avlreplace() will search the avl tree for the element with the given key * value and replace it with the given new value. */ /* header file inclusions */ #include #include #include /* internal function declarations */ static void *_insert(struct avl * p, void *key, void *value, int replace, struct avln ** app, int *hp); static int _inslbal(struct avln ** app); static int _insrbal(struct avln ** app); /* external function definitions */ void * avlinsert(struct avl * p, void *key, void *value) { if ((p != (struct avl *) (0)) && (key != (void *) (0))) { int h = 0; return _insert(p, key, value, 0, &(p->root), &h); } return (void *) (0); } void * avlreplace(struct avl * p, void *key, void *value) { if ((p != (struct avl *) (0)) && (key != (void *) (0))) { int h = 0; return _insert(p, key, value, 1, &(p->root), &h); } return (void *) (0); } /* internal function definitions */ static void * _insert(struct avl * p, void *key, void *value, int replace, struct avln ** app, int *hp) { struct avln *ap = *app; int r; void *rc; if (ap == (struct avln *) (0)) { ap = (struct avln *) balloc(sizeof(*ap)); ap->l = ap->r = (struct avln *) (0); ap->bal = 0; ap->d = (*(p->insert)) (key, value); *app = ap; return (void *) (0); } r = (*(p->compare)) (key, (*(p->key)) (ap->d)); if (r < 0) { rc = _insert(p, key, value, replace, &(ap->l), hp); if (*hp) *hp = _inslbal(app); } else if (r > 0) { rc = _insert(p, key, value, replace, &(ap->r), hp); if (*hp) *hp = _insrbal(app); } else { if (replace) rc = (*(p->replace)) (ap->d, value); else rc = (*(p->value)) (ap->d); } return rc; } static int _inslbal(struct avln ** app) { struct avln *ap = *app; switch (ap->bal) { case -1: /* rebalance */ { struct avln *ap1 = ap->l; if (ap1->bal == -1) { /* single LL rotation */ ap->l = ap1->r; ap1->r = ap; ap->bal = 0; ap = ap1; } else { /* double LR rotation */ struct avln *ap2 = ap1->r; ap1->r = ap2->l; ap2->l = ap1; ap->l = ap2->r; ap2->r = ap; ap->bal = (ap2->bal == -1) ? 1 : 0; ap1->bal = (ap2->bal == 1) ? -1 : 0; ap = ap2; } ap->bal = 0; *app = ap; } return 0; case 0: ap->bal = -1; return 1; case 1: ap->bal = 0; return 0; default: Abort("%t avlinsert(): abort: bad balance factor = %d\n", ap->bal); } /* NOTREACHED */ } static int _insrbal(struct avln ** app) { struct avln *ap = *app; switch (ap->bal) { case -1: ap->bal = 0; return 0; case 0: ap->bal = 1; return 1; case 1: /* rebalance */ { struct avln *ap1 = ap->r; if (ap1->bal == 1) { /* single RR rotation */ ap->r = ap1->l; ap1->l = ap; ap->bal = 0; ap = ap1; } else { /* double RL rotation */ struct avln *ap2 = ap1->l; ap1->l = ap2->r; ap2->r = ap1; ap->r = ap2->l; ap2->l = ap; ap->bal = (ap2->bal == 1) ? -1 : 0; ap1->bal = (ap2->bal == -1) ? 1 : 0; ap = ap2; } ap->bal = 0; *app = ap; } return 0; default: Abort("%t avlinsert(): abort: bad balance factor = %d\n", ap->bal); } /* NOTREACHED */ } aplus-fsf-4.22/src/dap/avlremove.c0000644000265000001440000001067710772770362012543 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* * avlremove() will search the avl tree for the element with the given key * value and remove it from the tree. The tree remains balanced in * accordance with the AVL balancing criteria. */ /* header file inclusions */ #include #include #include /* internal function declarations */ static void *_remove(struct avl * p, void *key, struct avln ** app, int *hp); static int _rem(struct avln ** aqp, struct avln ** app); static int _remlbal(struct avln ** app); static int _remrbal(struct avln ** app); /* external function definitions */ void * avlremove(struct avl * p, void *key) { if ((p != (struct avl *) (0)) && (key != (void *) (0))) { int h = 0; return _remove(p, key, &(p->root), &h); } return (void *) (0); } /* internal function definitions */ static void * _remove(struct avl * p, void *key, struct avln ** app, int *hp) { struct avln *aq; struct avln *ap = *app; int r; void *rc; if (ap == (struct avln *) (0)) { /* not in the tree */ return (void *) (0); } r = (*(p->compare)) (key, (*(p->key)) (ap->d)); if (r < 0) { rc = _remove(p, key, &(ap->l), hp); if (*hp) *hp = _remlbal(app); } else if (r > 0) { rc = _remove(p, key, &(ap->r), hp); if (*hp) *hp = _remrbal(app); } else { rc = (*(p->value)) (ap->d); (*(p->remove)) (ap->d); ap->d = (void *) (0); /* aq will be the node the is deallocated */ aq = ap; if (ap->r == (struct avln *) (0)) { *app = ap->l; *hp = 1; } else if (ap->l == (struct avln *) (0)) { *app = ap->r; *hp = 1; } else { *hp = _rem(&aq, &(ap->l)); if (*hp) *hp = _remlbal(app); } bfree((char *) aq); } return rc; } static int _rem(struct avln ** aqp, struct avln ** app) { struct avln *ap = *app; int rc = 0; if (ap->r != (struct avln *) (0)) { if (rc = _rem(aqp, &(ap->r))) rc = _remrbal(app); } else { /* * transfer content of ap to aq, then pull up the left side of ap to ap's * position, aq then becomes ap. */ (*aqp)->d = ap->d; *aqp = ap; *app = ap->l; rc = 1; } return rc; } static int _remlbal(struct avln ** app) { struct avln *ap = *app; int rc = 1; switch (ap->bal) { case -1: ap->bal = 0; break; case 0: ap->bal = 1; rc = 0; break; case 1: /* rebalance */ { struct avln *ap1 = ap->r; int bal1 = ap1->bal; if (bal1 >= 0) { /* single RR rotation */ ap->r = ap1->l; ap1->l = ap; if (bal1 == 0) { ap->bal = 1; ap1->bal = -1; rc = 0; } else { ap->bal = 0; ap1->bal = 0; } ap = ap1; } else { /* double RL rotation */ struct avln *ap2 = ap1->l; int bal2 = ap2->bal; ap1->l = ap2->r; ap2->r = ap1; ap->r = ap2->l; ap2->l = ap; ap->bal = (bal2 == 1) ? -1 : 0; ap1->bal = (bal2 == -1) ? 1 : 0; ap = ap2; ap2->bal = 0; } *app = ap; } break; default: Abort("%t avlremove(): abort: bad balance factor = %d\n", ap->bal); } return rc; } static int _remrbal(struct avln ** app) { struct avln *ap = *app; int rc = 1; switch (ap->bal) { case -1: /* rebalance */ { struct avln *ap1 = ap->l; int bal1 = ap1->bal; if (bal1 <= 0) { /* single LL rotation */ ap->l = ap1->r; ap1->r = ap; if (bal1 == 0) { ap->bal = -1; ap1->bal = 1; rc = 0; } else { ap->bal = 0; ap1->bal = 0; } ap = ap1; } else { /* double LR rotation */ struct avln *ap2 = ap1->r; int bal2 = ap2->bal; ap1->r = ap2->l; ap2->l = ap1; ap->l = ap2->r; ap2->r = ap; ap->bal = (bal2 == -1) ? 1 : 0; ap1->bal = (bal2 == 1) ? -1 : 0; ap = ap2; ap2->bal = 0; } *app = ap; } break; case 0: ap->bal = -1; rc = 0; break; case 1: ap->bal = 0; break; default: Abort("%t avlremove(): abort: bad balance factor = %d\n", ap->bal); } return rc; } aplus-fsf-4.22/src/dap/avlwalk.c0000644000265000001440000001373610772770362012203 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include /* internal function definitions */ static void *_preorder(struct avln * ap, void *(*func) (), void *result); static void *_rev_preorder(struct avln * ap, void *(*func) (), void *result); static void *_inorder(struct avln * ap, void *(*func) (), void *result); static void *_rev_inorder(struct avln * ap, void *(*func) (), void *result); static void *_postorder(struct avln * ap, void *(*func) (), void *result); static void *_rev_postorder(struct avln * ap, void *(*func) (), void *result); static void *_leaf(struct avln * ap, void *(*func) (), void *result); static void *_rev_leaf(struct avln * ap, void *(*func) (), void *result); static void *_all(struct avln * ap, void *(*func) (), void *result); static void *_rev_all(struct avln * ap, void *(*func) (), void *result); /* external function definitions */ void *avlwalk(struct avl * p, int type, void *(*func) (), void *result) { if ((p != (struct avl *) (0)) && (func != (void *(*) ()) (0))) { if (type & AVLWALK_REVERSE) { type &= ~AVLWALK_REVERSE; switch (type) { case AVLWALK_PREORDER: result = _rev_preorder(p->root, func, result); break; case AVLWALK_INORDER: result = _rev_inorder(p->root, func, result); break; case AVLWALK_POSTORDER: result = _rev_postorder(p->root, func, result); break; case AVLWALK_LEAF: result = _rev_leaf(p->root, func, result); break; case AVLWALK_ALL: default: result = _rev_all(p->root, func, result); break; } } else { switch (type) { case AVLWALK_PREORDER: result = _preorder(p->root, func, result); break; case AVLWALK_INORDER: result = _inorder(p->root, func, result); break; case AVLWALK_POSTORDER: result = _postorder(p->root, func, result); break; case AVLWALK_LEAF: result = _leaf(p->root, func, result); break; case AVLWALK_ALL: default: result = _all(p->root, func, result); break; } } } return result; } /* internal function definitions */ static void *_preorder(struct avln * ap, void *(*func) (), void *result) { if (ap != (struct avln *) (0)) { result = (*func) (ap->d, result); result = _preorder(ap->l, func, result); result = _preorder(ap->r, func, result); } return result; } static void *_rev_preorder(struct avln * ap, void *(*func) (), void *result) { if (ap != (struct avln *) (0)) { result = (*func) (ap->d, result); result = _rev_preorder(ap->r, func, result); result = _rev_preorder(ap->l, func, result); } return result; } static void *_inorder(struct avln * ap, void *(*func) (), void *result) { if (ap != (struct avln *) (0)) { result = _inorder(ap->l, func, result); result = (*func) (ap->d, result); result = _inorder(ap->r, func, result); } return result; } static void *_rev_inorder(struct avln * ap, void *(*func) (), void *result) { if (ap != (struct avln *) (0)) { result = _rev_inorder(ap->r, func, result); result = (*func) (ap->d, result); result = _rev_inorder(ap->l, func, result); } return result; } static void *_postorder(struct avln * ap, void *(*func) (), void *result) { if (ap != (struct avln *) (0)) { result = _postorder(ap->l, func, result); result = _postorder(ap->r, func, result); result = (*func) (ap->d, result); } return result; } static void *_rev_postorder(struct avln * ap, void *(*func) (), void *result) { if (ap != (struct avln *) (0)) { result = _rev_postorder(ap->r, func, result); result = _rev_postorder(ap->l, func, result); result = (*func) (ap->d, result); } return result; } static void *_leaf(struct avln * ap, void *(*func) (), void *result) { if (ap != (struct avln *) (0)) { if ((ap->l == (struct avln *) (0)) && (ap->r == (struct avln *) (0))) { result = (*func) (ap->d, result); } else { result = _leaf(ap->l, func, result); result = _leaf(ap->r, func, result); } } return result; } static void *_rev_leaf(struct avln * ap, void *(*func) (), void *result) { if (ap != (struct avln *) (0)) { if ((ap->l == (struct avln *) (0)) && (ap->r == (struct avln *) (0))) { result = (*func) (ap->d, result); } else { result = _rev_leaf(ap->r, func, result); result = _rev_leaf(ap->l, func, result); } } return result; } static void *_all(struct avln * ap, void *(*func) (), void *result) { if (ap != (struct avln *) (0)) { if ((ap->l == (struct avln *) (0)) && (ap->r == (struct avln *) (0))) { result = (*func) (ap->d, result, AVLWALK_LEAF); } else { result = (*func) (ap->d, result, AVLWALK_PREORDER); result = _all(ap->l, func, result); result = (*func) (ap->d, result, AVLWALK_INORDER); result = _all(ap->r, func, result); result = (*func) (ap->d, result, AVLWALK_POSTORDER); } } return result; } static void *_rev_all(struct avln * ap, void *(*func) (), void *result) { if (ap != (struct avln *) (0)) { if ((ap->l == (struct avln *) (0)) && (ap->r == (struct avln *) (0))) { result = (*func) (ap->d, result, AVLWALK_REVERSE | AVLWALK_LEAF); } else { result = (*func) (ap->d, result, AVLWALK_REVERSE | AVLWALK_PREORDER); result = _all(ap->r, func, result); result = (*func) (ap->d, result, AVLWALK_REVERSE | AVLWALK_INORDER); result = _all(ap->l, func, result); result = (*func) (ap->d, result, AVLWALK_REVERSE | AVLWALK_POSTORDER); } } return result; } aplus-fsf-4.22/src/dap/balloc.c0000644000265000001440000000351210772770362011765 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #if defined(__NetBSD__) || defined(__FreeBSD) || defined (__APPLE__) #include #else #include #endif #include #include #include #include #include /* internal function declarations */ static void gasp(int size); /* external function definitions */ void * balloc(int size) { static char fnc[] = "balloc"; void *p; if (size <= 0) { return (void *) (0); } if ((p = (void *) malloc((unsigned) size)) == (void *) (0)) { if (errno == ENOMEM) { /* GASP!!!! */ gasp(size); _exit(1); } Abort("%t %s(): abort: malloc(%u): %m\n", fnc, (unsigned) size); } return p; } /* internal function definitions */ static void gasp(int size) { static char m0[] = "\nballoc("; static char m1[ULTODEC_SZ]; int z1; static char m2[] = "): "; #ifdef HAVE_STRERROR char *m3 = strerror(ENOMEM); #else char *m3 = sys_errlist[ENOMEM]; #endif int z3 = strlen(m3); static char m4[] = "\n\n"; z1 = ultodec((unsigned long) size, m1, ULTODEC_SZ) - 1; (void) write(2, m0, sizeof(m0) - 1); (void) write(2, m1, z1); (void) write(2, m2, sizeof(m2) - 1); (void) write(2, m3, z3); (void) write(2, m4, sizeof(m4) - 1); return; } aplus-fsf-4.22/src/dap/balloc_r.c0000644000265000001440000000221010772770362012300 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #if defined(__NetBSD__) || defined(__FreeBSD) || defined (__APPLE__) #include #else #include #endif #include #include #include /* external function definitions */ void * balloc_r(int size) { static char fnc[] = "balloc_r"; void *p; if (size <= 0) { errno = EDOM; return (void *) (0); } p = (void *) malloc((unsigned) size); if ((p == (void *) (0)) && (errno != ENOMEM)) { Abort("%t %s(): abort: malloc(%u): %m\n", fnc, (unsigned) size); } return p; } aplus-fsf-4.22/src/dap/bdup.c0000644000265000001440000000165410772770362011470 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include /* external function definitions */ void * bdup(void *p, int size) { void *r = balloc(size); if ((r != (void *) (0)) && (p != (void *) (0))) { /* * size is not negative because balloc would have returned (void *)(0) */ bcopy((char *) p, (char *) r, size); } return r; } aplus-fsf-4.22/src/dap/bdup_r.c0000644000265000001440000000166210772770362012010 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include /* external function definitions */ void * bdup_r(void *p, int size) { void *r = balloc_r(size); if ((r != (void *) (0)) && (p != (void *) (0))) { /* * size is not negative because balloc_r would have returned (void *)(0) */ bcopy((char *) p, (char *) r, size); } return r; } aplus-fsf-4.22/src/dap/bfree.c0000644000265000001440000000127210772770362011615 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* external function definitions */ void bfree(char *p) { if (p != (char *) (0)) { free(p); } return; } aplus-fsf-4.22/src/dap/bgprintf.c0000644000265000001440000000214610772770362012346 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include #if !defined(__cfront) #include #endif #include #include /* external function definitions */ char * bgprintf(int size, char *fmt,...) { static char fnc[] = "bgprintf"; va_list ap; char *p = (char *) balloc(size + 1); va_start(ap, fmt); (void) vsprintf(p, fmt, ap); va_end(ap); if (strlen((DEV_STRARG) p) > size) { Abort("%t %s(): abort: size error: %d > %d\n", fnc, strlen((DEV_STRARG) p), size); } return p; } aplus-fsf-4.22/src/dap/bnstring.c0000644000265000001440000000443110772770362012360 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* * bnstring() is a varargs functions that allocates space for the * concatenation of the n strings given as its arguments. it then * concatenates the strings into this space and returns a pointer to the * memory. It uses balloc, which exits if the memory is not available. * (char *)(0) is returned if the first argument is (char *)(0). All * arguments before the first argument with value of (char *)(0) are * processed. */ /* header file inclusions */ #if !defined(__cfront) #include #endif #include /* external function definitions */ char * bnstring(char *arg0,...) { int count = 0; int size = 0; int *sp; char **ap; char *cp; char *cp_end; int *sizes; char **args; char *r; va_list parg; /* count the number of arguments */ va_start(parg, arg0); cp = arg0; while (cp != (char *) (0)) { count++; cp = va_arg(parg, char *); } va_end(parg); /* allocate a sizes array and an args array */ sp = sizes = (int *) balloc(count * sizeof(*sizes)); ap = args = (char **) balloc(count * sizeof(*args)); /* fill sizes and args arrays, also compute total size */ va_start(parg, arg0); cp = arg0; while (cp != (char *) (0)) { *ap++ = cp; size += *sp++ = strlen(cp); cp = va_arg(parg, char *); } va_end(parg); /* allocate space for concatentation */ r = (char *) balloc(size + 1); /* copy arguments into the concatentation area */ sp = sizes; ap = args; for (cp_end = (cp = r) + size; cp < cp_end; cp += *sp++) { bcopy(*ap++, cp, *sp); } /* place a terminating NUL */ *cp = '\0'; /* free args and sizes */ bfree((char *) args); bfree((char *) sizes); /* return pointer to concatenated strings */ return r; } aplus-fsf-4.22/src/dap/bnstring_r.c0000644000265000001440000000436010772770362012702 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* * bnstring_r() is like bnstring except that it returns (char *)(0) and sets * errno to ENOMEM if it cannot do its work due to a lack of space. */ /* header file inclusions */ #if !defined(__cfront) #include #endif #include /* external function definitions */ char * bnstring_r(char *arg0,...) { int cnt = 0; int size = 0; int *sp = (int *) (0); char **ap = (char **) (0); char *cp; char *cp_end; int *sizes; char **args; char *r; va_list parg; /* count the number of arguments */ va_start(parg, arg0); cp = arg0; while (cp != (char *) (0)) { cnt++; cp = va_arg(parg, char *); } va_end(parg); /* allocate a sizes array and an args array */ if (((sp = (int *) balloc_r(cnt * sizeof(*sizes))) == (int *) (0)) || ((ap = (char **) balloc_r(cnt * sizeof(*args))) == (char **) (0))) { bfree((char *) sp); return (char *) (0); } /* fill sizes and args arrays, also compute total size */ va_start(parg, arg0); sizes = sp; args = ap; cp = arg0; while (cp != (char *) (0)) { *ap++ = cp; size += *sp++ = strlen(cp); cp = va_arg(parg, char *); } sp = sizes; ap = args; va_end(parg); /* allocate space for concatentation */ if ((r = (char *) balloc(size + 1)) == (char *) (0)) { bfree((char *) ap); bfree((char *) sp); return (char *) (0); } /* copy arguments into the concatentation area */ for (cp_end = (cp = r) + size; cp < cp_end; cp += *sp++) { bcopy(*ap++, cp, *sp); } /* place a terminating NUL */ *cp = '\0'; /* free args and sizes */ bfree((char *) args); bfree((char *) sizes); /* return pointer to concatenated strings */ return r; } aplus-fsf-4.22/src/dap/brealloc.c0000644000265000001440000000417410772770362012321 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #if defined(__NetBSD__) || defined(__FreeBSD) || defined (__APPLE__) #include #else #include #endif #include #include #include #include #include /* internal function definitions */ static void gasp(char *p, int size); /* external function definitions */ void * brealloc(char *p, int size) { static char fnc[] = "brealloc"; char *p0 = p; if (p == (char *) (0)) { return balloc(size); } if (size <= 0) { bfree(p); return (void *) (0); } if ((p = realloc(p, (unsigned) size)) == (char *) (0)) { if (errno == ENOMEM) { /* GASP!!!! */ gasp(p0, size); _exit(1); } Abort("%t %s(): abort: realloc(%u): %m\n", fnc, (unsigned) size); } return (void *) p; } /* internal function definitions */ static void gasp(char *p, int size) { static char m0[] = "\nbrealloc(0x"; static char m1[ULTOHEX_SZ]; int z1; static char m2[] = ", "; static char m3[ULTODEC_SZ]; int z3; static char m4[] = "): "; #ifdef HAVE_STRERROR char *m5 = strerror(ENOMEM); #else char *m5 = sys_errlist[ENOMEM]; #endif int z5 = strlen(m5); static char m6[] = "\n\n"; z1 = ultohex((unsigned long) p, m1, ULTOHEX_SZ) - 1; z3 = ultodec((unsigned long) size, m3, ULTODEC_SZ) - 1; (void) write(2, m0, sizeof(m0) - 1); (void) write(2, m1, z1); (void) write(2, m2, sizeof(m2) - 1); (void) write(2, m3, z3); (void) write(2, m4, sizeof(m4) - 1); (void) write(2, m5, z5); (void) write(2, m6, sizeof(m6) - 1); return; } aplus-fsf-4.22/src/dap/brealloc_r.c0000644000265000001440000000233010772770362012632 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #if defined(__NetBSD__) || defined(__FreeBSD) || defined (__APPLE__) #include #else #include #endif #include #include #include /* external function definitions */ void * brealloc_r(char *p, int size) { static char fnc[] = "brealloc_r"; if (p == (char *) (0)) { return balloc_r(size); } if (size <= 0) { bfree(p); errno = EDOM; return (void *) (0); } p = realloc(p, (unsigned) size); if ((p == (char *) (0)) && (errno != ENOMEM)) { Abort("%t %s(): abort: realloc(%u): %m\n", fnc, (unsigned) size); } return (void *) p; } aplus-fsf-4.22/src/dap/bstrhash.c0000644000265000001440000000203610772770363012350 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ int bstrhash(char *key) { int c; int i; int r = 0; int b[sizeof(int)]; for (i = 0; i < sizeof(int); b[i++] = 0); i = 0; while ((c = *key++) != '\0') { b[i] ^= c; i = (i + 1) % sizeof(int); } for (i = 0; i < sizeof(int); i++) { r = (r << 8) | b[i]; } if (r < 0) r -= INT_MIN; /* force value to be positive */ return r; } aplus-fsf-4.22/src/dap/bstring.c0000644000265000001440000000160310772770363012201 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ char * bstring(const char *s) { if (s != (char *) (0)) { int size = strlen((DEV_STRARG) s) + 1; char *p = (char *) balloc(size); bcopy(s, p, size); return p; } return (char *) (0); } aplus-fsf-4.22/src/dap/bstring_r.c0000644000265000001440000000171210772770363012523 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include #include /* external function definitions */ char * bstring_r(char *s) { if (s != (char *) (0)) { int size = strlen((DEV_STRARG) s) + 1; char *p = (char *) balloc_r(size); if (p != (char *) (0)) { bcopy(s, p, size); } return p; } errno = EDOM; return (char *) (0); } aplus-fsf-4.22/src/dap/buffalloc.c0000644000265000001440000000154410772770363012472 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ struct buff * buffalloc(void) { struct buff *p; p = (struct buff *) balloc(sizeof(*p)); p->ref = 1; p->min = p->get = p->put = p->max = (char *) (0); return p; } aplus-fsf-4.22/src/dap/buffalloc_r.c0000644000265000001440000000161510772770363013012 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ struct buff * buffalloc_r(void) { struct buff *p = (struct buff *) balloc_r(sizeof(*p)); if (p != (struct buff *) (0)) { p->ref = 1; p->min = p->get = p->put = p->max = (char *) (0); } return p; } aplus-fsf-4.22/src/dap/buffclear.c0000644000265000001440000000152510772770363012465 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ void buffclear(struct buff * p) { if (p != (struct buff *) (0)) { bfree(p->min); p->min = p->get = p->put = p->max = (char *) (0); } return; } aplus-fsf-4.22/src/dap/bufffrag.c0000644000265000001440000000306510772770363012317 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* * bufffrag - given a buffer and a fragment length, bufffrag() strips off * fragment length bytes from the data area of the buffer places them in a * new buffer. If there is no data after the fragment, then the original * buffer is cleared, and the space belonging to it is transferred to the new * buffer. Otherwise, the fragment is stuffed into the new buffer and * removed from the old. If fragment length bytes of data are not available, * a null pointer is returned. */ /* header file inclusions */ #include /* external function definitions */ struct buff * bufffrag(struct buff * p, int frag) { struct buff *bp = (struct buff *) (0); int len; if ((p != (struct buff *) (0)) && (p->min != (char *) (0)) && ((len = p->put - p->get) >= frag)) { bp = buffalloc(); if (frag == len) { *bp = *p; p->min = p->get = p->put = p->max = (char *) (0); } else { buffstuff(bp, p->get, frag); p->get += frag; } } return bp; } aplus-fsf-4.22/src/dap/bufffree.c0000644000265000001440000000152210772770363012315 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ void bufffree(struct buff * p) { if ((p != (struct buff *) (0)) && (--(p->ref) <= 0)) { bfree(p->min); bfree((char *) p); } return; } aplus-fsf-4.22/src/dap/buffgetc.c0000644000265000001440000000146210772770363012321 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include /* external function definitions */ int buffgetc(struct buff * p) { if ((p != (struct buff *) (0)) && (p->get != p->put)) { return 0xff & *(p->get++); } return -1; } aplus-fsf-4.22/src/dap/buffgprintf.c0000644000265000001440000000253410772770363013051 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include #if !defined(__cfront) #include #endif #include #include /* external function definitions */ void buffgprintf(struct buff * p, int size, char *fmt,...) { static char fnc[] = "buffgprintf"; if (p != (struct buff *) (0)) { va_list ap; int len; if (p->max - p->put < size + 1) { buffroom(p, size + 1); } va_start(ap, fmt); (void) vsprintf(p->put, fmt, ap); va_end(ap); if ((len = strlen((DEV_STRARG) p->put)) > size) { if (len >= p->max - p->put) { Abort("%t %s(): abort: size error: %d > %d\n", fnc, len, size); } Warn("%t %s(): warning: size error: %d > %d\n", fnc, len, size); } p->put += len; } return; } aplus-fsf-4.22/src/dap/buffputc.c0000644000265000001440000000151310772770363012347 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include /* external function definitions */ void buffputc(struct buff * p, char c) { if (p != (struct buff *) (0)) { if (p->max - p->put < 1) { buffroom(p, 1); } *(p->put++) = c; } return; } aplus-fsf-4.22/src/dap/buffputc_r.c0000644000265000001440000000154510772770363012675 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include /* external function definitions */ buffputc_r(struct buff * p, char c) { if (p != (struct buff *) (0)) { if (p->max - p->put < 1) { if (buffroom_r(p, 1)) { return -1; } } *(p->put++) = c; } return 0; } aplus-fsf-4.22/src/dap/buffputdouble.c0000644000265000001440000000140310772770363013375 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Chuck Ocheret */ /* header file inclusions */ #include /* external function definitions */ void buffputdouble(struct buff * p, double d) { buffstuff(p, (char *) (&d), sizeof(d)); return; } aplus-fsf-4.22/src/dap/buffputint.c0000644000265000001440000000137510772770363012725 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Chuck Ocheret */ /* header file inclusions */ #include /* external function definitions */ void buffputint(struct buff * p, int d) { buffstuff(p, (char *) (&d), sizeof(d)); return; } aplus-fsf-4.22/src/dap/buffputlong.c0000644000265000001440000000140310772770363013062 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Chuck Ocheret */ /* header file inclusions */ #include /* external function definitions */ void buffputlong(struct buff * p, long int d) { buffstuff(p, (char *) (&d), sizeof(d)); return; } aplus-fsf-4.22/src/dap/buffputs.c0000644000265000001440000000153410772770364012373 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ void buffputs(struct buff * p, char *s) { if ((p != (struct buff *) (0)) && (s != (char *) (0))) { buffstuff(p, s, strlen((DEV_STRARG) s)); } return; } aplus-fsf-4.22/src/dap/buffputshort.c0000644000265000001440000000140110772770364013261 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Chuck Ocheret */ /* header file inclusions */ #include /* external function definitions */ void buffputshort(struct buff * p, short d) { buffstuff(p, (char *) (&d), sizeof(d)); return; } aplus-fsf-4.22/src/dap/buffread.c0000644000265000001440000000237210772770364012314 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include #include /* external function definitions */ int buffread(struct buff * p, int fd, int nby) { static char fnc[] = "buffread"; int rby; if ((p == (struct buff *) (0)) || (nby <= 0)) return 0; if (p->max - p->put < nby) buffroom(p, nby); if ((rby = read(fd, p->put, nby)) < 0) { if ((errno == EINTR) || (errno == EWOULDBLOCK)) return 0; return -1; } if (rby == 0) { /* end of file */ errno = EPIPE; return -1; } if (rby > nby) { Abort("%t %s(): abort: read(%d): too many bytes: %d > %d\n", fnc, fd, rby, nby); } p->put += rby; return rby; } aplus-fsf-4.22/src/dap/buffref.c0000644000265000001440000000141410772770364012151 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include /* external function definitions */ struct buff * buffref(struct buff * p) { if (p != (struct buff *) (0)) { (p->ref)++; } return p; } aplus-fsf-4.22/src/dap/buffroom.c0000644000265000001440000000256510772770364012361 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ void buffroom(struct buff * p, int add) { int def; /* space deficiency */ if ((p != (struct buff *) (0)) && ((def = add - (p->max - p->put)) > 0)) { int len = p->put - p->get; int off = p->get - p->min; if (def > off) { /* deficiency is more than the offset */ int siz = p->max - p->min; int req = siz + def; siz += siz / 2; if (siz < req) siz = req; if (siz < sizeof(*p)) siz = sizeof(*p); p->min = (char *) brealloc(p->min, siz); p->get = p->min + off; p->put = p->get + len; p->max = p->min + siz; } else { bcopy(p->get, p->min, len); p->get -= off; p->put -= off; } } return; } aplus-fsf-4.22/src/dap/buffroom_r.c0000644000265000001440000000272010772770364012673 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ int buffroom_r(struct buff * p, int add) { int def; /* space deficiency */ if ((p != (struct buff *) (0)) && ((def = add - (p->max - p->put)) > 0)) { int len = p->put - p->get; int off = p->get - p->min; if (def > off) { /* deficiency is greater than offset */ int siz = p->max - p->min; int req = siz + def; char *newmin; siz += siz / 2; if (siz < req) siz = req; if (siz < sizeof(*p)) siz = sizeof(*p); newmin = (char *) brealloc(p->min, siz); if (newmin == (char *) (0)) return -1; p->min = newmin; p->get = p->min + off; p->put = p->get + len; p->max = p->min + siz; } else { bcopy(p->get, p->min, len); p->get -= off; p->put -= off; } } return 0; } aplus-fsf-4.22/src/dap/buffstuff.c0000644000265000001440000000166110772770364012530 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ void buffstuff(struct buff * p, char *value, int size) { if ((p != (struct buff *) (0)) && (size > 0)) { if (p->max - p->put < size) { buffroom(p, size); } bcopy(value, p->put, size); p->put += size; } return; } aplus-fsf-4.22/src/dap/buffstuff_r.c0000644000265000001440000000172010772770364013045 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ int buffstuff_r(struct buff * p, char *value, int size) { if ((p != (struct buff *) (0)) && (size > 0)) { if (p->max - p->put < size) { if (buffroom_r(p, size)) { return -1; } } bcopy(value, p->put, size); p->put += size; } return 0; } aplus-fsf-4.22/src/dap/bufftrim.c0000644000265000001440000000230310772770364012346 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ void bufftrim(struct buff * p) { if ((p != (struct buff *) (0)) && ((p->get != p->min) || (p->put != p->max))) { int len = p->put - p->get; int off = p->get - p->min; if (off != 0) { bcopy(p->get, p->min, len); } /* * We use brealloc instead of brealloc_r because this should not fail due * to ENOMEM. After all, we are shrinking the buffer. */ p->get = p->min = (char *) brealloc(p->min, len); p->get = p->min; p->put = p->max = p->min + len; } return; } aplus-fsf-4.22/src/dap/buffwrite.c0000644000265000001440000000226110772770364012530 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include #include /* external function definitions */ int buffwrite(struct buff * p, int fd, int nby) { static char fnc[] = "buffwrite"; int wby; if ((p == (struct buff *) (0)) || (nby <= 0)) return 0; if ((wby = p->put - p->get) < nby) nby = wby; if ((wby = write(fd, p->get, nby)) < 0) { if ((errno == EINTR) || (errno == EWOULDBLOCK)) return 0; return -1; } if (wby > nby) { Abort("%t %s(): abort: write(%d): too many bytes: %d > %d\n", fnc, fd, wby, nby); } p->get += wby; return wby; } aplus-fsf-4.22/src/dap/buffzero.c0000644000265000001440000000163410772770364012360 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ void buffzero(struct buff * p, int size) { if ((p != (struct buff *) (0)) && (size > 0)) { if (p->max - p->put < size) { buffroom(p, size); } bzero(p->put, size); p->put += size; } return; } aplus-fsf-4.22/src/dap/chanclose.c0000644000265000001440000000170510772770364012474 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include #include #include /* external function definitions */ void chanclose(struct chan * p) { if (p != (struct chan *) (0)) { fdsclr(p->afds, p->fd); fdsclr(p->fds, p->fd); noderemove(p->np); nodefree(p->np); bfree(p->name); bfree((char *) p); } return; } aplus-fsf-4.22/src/dap/chandsbl.c0000644000265000001440000000144310772770364012312 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ void chandsbl(struct chan * p) { if (p != (struct chan *) (0)) { fdsclr(p->fds, p->fd); } return; } aplus-fsf-4.22/src/dap/chanenbl.c0000644000265000001440000000144310772770364012306 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ void chanenbl(struct chan * p) { if (p != (struct chan *) (0)) { fdsset(p->fds, p->fd); } return; } aplus-fsf-4.22/src/dap/chanisdsbl.c0000644000265000001440000000147610772770364012654 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ int chanisdsbl(struct chan * p) { if ((p != (struct chan *) (0)) && (fdsisset(p->fds, p->fd))) { return 0; } return 1; } aplus-fsf-4.22/src/dap/chanisenbl.c0000644000265000001440000000147610772770365012651 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ int chanisenbl(struct chan * p) { if ((p != (struct chan *) (0)) && (fdsisset(p->fds, p->fd))) { return 1; } return 0; } aplus-fsf-4.22/src/dap/chanopen.c0000644000265000001440000000347310772770365012335 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include #include #include #include /* internal function declarations */ static void _procnoop(struct chan * p); /* external function definitions */ struct chan *chanopen(const char *name, int fd, int pri, int type, void (*func) (), void *ccbp) { static char fnc[] = "chanopen"; struct chan *p; p = (struct chan *) balloc(sizeof(*p)); (p->np = nodealloc())->d = (void *) p; if (name == (char *) (0)) name = ""; p->name = bstring(name); if ((fd < 0) || (fd >= fds_size)) { Warn("%t %s(%s): warning: bad fd == %d\n", fnc, name, fd); } p->fd = fd; switch (type) { case CHAN_R: p->fds = fds_r; p->afds = fds_ra; break; case CHAN_W: p->fds = fds_w; p->afds = fds_wa; break; case CHAN_X: default: p->fds = fds_x; p->afds = fds_xa; break; } fdsclr(p->fds, fd); fdsclr(p->afds, fd); if (func == (void (*) ()) (0)) { func = _procnoop; ccbp = (void *) p; } p->func = func; p->ccbp = ccbp; chansetpri(p, pri); return p; } /* internal function definitions */ static void _procnoop(struct chan * p) { fdsclr(p->fds, p->fd); fdsclr(p->afds, p->fd); return; } aplus-fsf-4.22/src/dap/chanproc.c0000644000265000001440000000417110772770365012333 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include #include /* external function definitions */ int chanproc(void) { struct node work; /* queue marker */ struct node done; /* queue marker */ struct node *hp = &chans; struct node *wp = &work; struct node *dp = &done; struct node *np; struct chan *p; int pri=0; /* initialize local queue markers */ wp->f = wp->b = wp; dp->f = dp->b = dp; /* search for a priority with something to do */ for (np = hp->f; np != hp; np = np->f) { p = CHANAT(np); if (fdsisset(p->afds, p->fd)) { pri = p->pri; break; } } if (np == hp) return 0; /* nothing found to do */ /* place head of work list */ nodeinsert(wp, np); /* search forward for first with different priority */ while (((np = np->f) != hp) && (CHANAT(np)->pri == pri)); /* split the work list out of the chan list */ nodeinsert(wp, np); /* place the done marker into the list */ nodeinsert(dp, wp); /* process work list */ while ((np = wp->f) != dp) { nodetoad(wp); /* leap wp over np */ p = CHANAT(np); if (fdsisset(p->afds, p->fd)) { fdsclr(p->afds, p->fd); (*(p->func)) (p->ccbp); } } /* take out the work list head */ noderemove(wp); /* find insertion point for done things */ for (np = hp->f; np != hp; np = np->f) { if (pri >= CHANAT(np)->pri) break; } /* splice in the done list at the place found in the chan list */ nodeinsert(dp, np); /* take out the done list head */ noderemove(dp); return 1; } aplus-fsf-4.22/src/dap/chans.c0000644000265000001440000000134510772770365011632 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external data definitions */ struct node chans = {&chans, &chans, (void *) (0)}; aplus-fsf-4.22/src/dap/chansetpri.c0000644000265000001440000000210010772770365012664 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* The higher the pri value, the higher the priority */ /* header file inclusions */ #include #include /* external function definitions */ void chansetpri(struct chan * p, int pri) { if (p != (struct chan *) (0)) { struct node *np = p->np; struct node *hp = &chans; struct node *tnp; noderemove(np); p->pri = pri; for (tnp = hp->f; tnp != hp; tnp = tnp->f) { if (pri >= CHANAT(tnp)->pri) break; } nodeinsert(np, tnp); } return; } aplus-fsf-4.22/src/dap/connackestb.c0000644000265000001440000000155110772770365013027 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ void connackestb(struct conn * p) { if ((p != (struct conn *) (0)) && (p->estbd == 0)) { p->estbtod = todsec(); (p->estbcount)++; p->estbd = 1; } return; } aplus-fsf-4.22/src/dap/connalloc.c0000644000265000001440000001110610772770365012502 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* * The conn functions will allow for maintenance of a TCP connection with a * given port, across failures of the connection. The address of the other * end of the connection is specified as an opaque object and an * interpretation function. The interpretation function is used translate * the opaque object into an address for use in a connection request. * Several interpetation functions are provided and others may be supplied * for a specific purpose by a user module. The parameters and control * structures for the are initally established using the connalloc() * function. This allocates and initalizes a control block for the * connection. The inputs to connalloc() include certain parameters used in * establishment and maintenance of a connection. The connopen() function is * used to initiate connection connection establishment. connopen will * intepret the remote address information and the establish a connection. * If connection establishment fails, then connopen will reschedule it for * sometime in the future. If it succeeds, then connopen will call theuser * provided state change notification function, to indicate that the * connection is now active. If connection establishment is initiated but is * not yet complete, connopen sets up a write channel that will notify the * user when the connection is established. Once the connection is * established and the user is notified, it is up to the user to set up the * appropriate channels for reading and writing information on the * connection. The user may elect to use other dap provided functions which * will read and write as necessary. The connection may be closed at any time * by calling connclose(). Connclose will reschedule a connopen() call at * sometime in the future, unless the connection's retry flag is off. Thus, * exceptions while reading or writing on the connection maybne handled by * closing the connection, which automatically schedule reestablishment of * the connection. The user is responsible for ensuring that data transfer * buffers are kept in a consistent state between instances of the * connection. When the connection has outlived its usefulness, it is * removed using connfree(). This will free all resources allocated to the * connection, including closing the file descriptor, clearing the retry * timer, etc. */ /* header file inclusions */ #include #include #include #ifdef PRESUNOS4 #ifndef _SOCKET_ #define _SOCKET_ #include #endif #else #include #endif #include #include #include #include #include #include /* external function definitions */ struct conn *connalloc(char *name, int pri, int retry, int retry_time_first, int retry_time_last, int domain, int type, int protocol, void *r_nameinfo, int (*setupfunc) (), struct sockaddr * (*r_namefunc) (), int (*estbfunc) (), void *acb) { struct conn *p = (struct conn *) balloc(sizeof(*p)); if (name == (char *) (0)) name = ""; p->name = bstring(name); p->pri = pri; if (retry == CONN_RETRY_NO) p->retry = CONN_RETRY_NO; else p->retry = CONN_RETRY_YES; p->domain = domain; p->type = type; p->protocol = protocol; p->r_nameinfo = r_nameinfo; p->setupfunc = setupfunc; p->r_namefunc = r_namefunc; p->estbfunc = estbfunc; p->acb = acb; p->retry_time = exboalloc(retry_time_first, retry_time_last); p->retry_tp = (struct timer *) (0); p->fd = -1; p->r_namelen = 0; p->r_name = (struct sockaddr *) (0); p->estbchan = (struct chan *) (0); p->estbd = 0; p->alloctod = todsec(); p->opentod = (time_t) (0); p->conntod = (time_t) (0); p->estbtod = (time_t) (0); p->disctod = (time_t) (0); p->closetod = (time_t) (0); p->opendtime = (time_t) (0); p->estbdtime = (time_t) (0); p->opencount = (unsigned) (0); p->conncount = (unsigned) (0); p->estbcount = (unsigned) (0); p->disccount = (unsigned) (0); p->closecount = (unsigned) (0); return p; } aplus-fsf-4.22/src/dap/connclose.c0000644000265000001440000000372010772770365012520 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include #include #include #include #include #include #include #include /* external function definitions */ void connclose(struct conn * p) { static char fnc[] = "connclose"; if (p != (struct conn *) (0)) { int fd = p->fd; if (fd < 0) { timerclr(p->retry_tp); p->retry_tp = (struct timer *) (0); } else { if (p->estbd) { exboreset(p->retry_time); p->estbd = 0; p->disctod = todsec(); (p->disccount)++; p->estbdtime += (p->disctod - p->estbtod); } else { chanclose(p->estbchan); p->estbchan = (struct chan *) (0); } fdsfresh(fd); if (close(fd) < 0) { Warn("%t %s(%s): warning: close(%d): %m\n", fnc, p->name, fd); } p->fd = -1; p->closetod = todsec(); (p->closecount)++; p->opendtime += (p->closetod - p->opentod); } bfree((char *) (p->r_name)); p->r_name = (struct sockaddr *) (0); p->r_namelen = 0; if (p->retry == CONN_RETRY_YES) { time_t retry_time = (time_t) exbovalue(p->retry_time); Warn("%t %s(%s): note: retrying in %ld seconds\n", fnc, p->name, retry_time); p->retry_tp = timer(retry_time, (long) (0), (void (*)(void *))connopen, (void *) (p)); exbobackoff(p->retry_time); } } return; } aplus-fsf-4.22/src/dap/connfree.c0000644000265000001440000000163110772770365012333 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include #include /* external function definitions */ void connfree(struct conn * p) { if (p != (struct conn *) (0)) { p->retry = CONN_RETRY_NO; connclose(p); exbofree(p->retry_time); bfree(p->name); bfree((char *) p); } return; } aplus-fsf-4.22/src/dap/connopen.c0000644000265000001440000000547410772770365012364 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #ifdef HAVE_SVR4 #include #endif #include #include #ifdef PRESUNOS4 #ifndef _SOCKET_ #define _SOCKET_ #include #endif #else #include #endif #include #include #include #include #include #include #include #include /* internal function declarations */ static void estbd(struct conn * p); /* external function definitions */ void connopen(struct conn * p) { static char fnc[] = "connopen"; int rc; if ((p != (struct conn *) (0)) && (p->fd < 0)) { int fd; int toggle; p->retry_tp = (struct timer *) (0); if ((fd = socket(p->domain, p->type, p->protocol)) < 0) { Warn("%t %s(%s): error: socket(): %m\n", fnc, p->name); connclose(p); return; } p->opentod = todsec(); (p->opencount)++; fdsfresh(fd); p->fd = fd; toggle = 1; if (ioctl(fd, FIONBIO, &toggle) < 0) { Warn("%t %s(%s): warning: ioctl(%d, FIONBIO): %m\n", fnc, p->name, fd); } if ((p->setupfunc != (int (*) ()) (0)) && ((rc = (*(p->setupfunc)) (p->acb, p->fd)) != 0)) { if (rc != -1) connclose(p); return; } p->r_name = (*(p->r_namefunc)) (p->r_nameinfo, &(p->r_namelen)); if (p->r_name == (struct sockaddr *) (0)) { connclose(p); return; } if (connect(fd, p->r_name, p->r_namelen) < 0) { if (errno == EINPROGRESS) { p->conntod = todsec(); (p->conncount)++; p->estbchan = chanopen((char *) (0), fd, p->pri, CHAN_W, (void (*)(void *))estbd, (void *) p); chanenbl(p->estbchan); return; } if (errno != EISCONN) { Warn("%t %s(%s): error: connect(%d): %m\n", fnc, p->name, fd); connclose(p); return; } /* we treat EISCONN as though the connection succeeded */ } p->conntod = todsec(); (p->conncount)++; if ((*(p->estbfunc)) (p->acb, p->fd)) { connackestb(p); } } return; } /* internal function definitions */ static void estbd(struct conn * p) { chanclose(p->estbchan); p->estbchan = (struct chan *) (0); if ((*(p->estbfunc)) (p->acb, p->fd)) { connackestb(p); } return; } aplus-fsf-4.22/src/dap/dap_data.c0000644000265000001440000000125110772770365012267 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* external data definitions */ int dapbreak = 0; int dapInitialized = 0; int dapZeroTimeout = 0; aplus-fsf-4.22/src/dap/dapinit.c0000644000265000001440000000157310772770365012171 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include #include /* external function definitions */ void dapinit(void) { if (dapInitialized) return; (void) tod(); (void) hostname(); fdsinit(); dapbreak = 0; dapZeroTimeout = 0; dapInitialized = 1; return; } aplus-fsf-4.22/src/dap/daploop.c0000644000265000001440000000164610772770365012200 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include #include #include #include /* external function definitions */ void daploop(void) { while (dapbreak == 0) { dapselect(); (void) sgnlproc(); (void) chanproc(); (void) timerproc(); (void) slpqproc(); } return; } aplus-fsf-4.22/src/dap/dapselect.c0000644000265000001440000000400610772770365012477 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include #include #include #include #include #include /* maximum allowable timeout vales for select() */ static struct timeval tv_select_max = {100000000L, 999999L}; /* external function definitions */ void dapselect(void) { static char fnc[] = "dapselect"; struct timeval timeout; struct timeval *tvpnext; struct timeval *tvp; int rc; /* copy enable flags over able flags */ fdscopy(fds_r, fds_ra); fdscopy(fds_w, fds_wa); fdscopy(fds_x, fds_xa); /* set up timeout */ if (dapZeroTimeout) { tvp = &timeout; tvp->tv_sec = tvp->tv_usec = (long) (0); } else if ((tvpnext = timernext()) == (struct timeval *) (0)) { #ifdef _AIX /* TK - AIX has a problem with this. Wait until next year. */ tvp = &timeout; tvp->tv_sec = (366 * 24 * 60 * 60) + 2; tvp->tv_usec = (long) (0); #else tvp = (struct timeval *) (0); #endif } else { tvp = &timeout; (void) tvdiff(tvpnext, tod(), tvp); if (tvp->tv_sec < 0) { tvp->tv_sec = tvp->tv_usec = (long) (0); } if (tvp->tv_sec > tv_select_max.tv_sec) { tvp = &tv_select_max; } } if (((rc = select(fds_size, fds_ra, fds_wa, fds_xa, tvp)) < 0) && (errno != EINTR)) { Warn("%t %s(): error: select(): %m\n", fnc); } if (rc <= 0) { fdszero(fds_ra); fdszero(fds_wa); fdszero(fds_xa); } return; } aplus-fsf-4.22/src/dap/dapterm.c0000644000265000001440000000260710772770365012174 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include #include #include #include #include #include #include #include /* external function definitions */ void dapterm(void) { struct node *hp; struct node *np; int i; char *s; dapInitialized = 0; dapZeroTimeout = 0; dapbreak = 0; hp = &timers; while ((np = hp->f) != hp) timerclr(TIMERAT(np)); hp = &chans; while ((np = hp->f) != hp) chanclose(CHANAT(np)); hp = &slpqents; while ((np = hp->f) != hp) slpqgiveup(SLPQENTAT(np)); for (i = 1; i < NSIG; i++) sgnloriginal(i); fdsterm(); s = "UNKNOWN"; bcopy(s, hostname_l, strlen(s) + 1); dap_tod_last.tv_sec = (long) (0); dap_tod_last.tv_usec = (long) (0); return; } aplus-fsf-4.22/src/dap/dapversion.c0000644000265000001440000000122110772770366012702 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* external function definitions */ int dapversion(void) { return 5; } aplus-fsf-4.22/src/dap/doclose.c0000644000265000001440000000164510772770366012172 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include #include /* external function definitions */ void doclose(int fd) { static char fnc[] = "doclose"; if (fd >= 0) { while (close(fd) != 0) { if (errno != EINTR) { Warn("%t %s(): error: close(%d): %m\n", fnc, fd); break; } } } return; } aplus-fsf-4.22/src/dap/doread.c0000644000265000001440000000271410772770366011776 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include #include #include #include /* external function definitions */ int doread(int fd, char *buf, int size) { static char fnc[] = "doread"; int done = 0; int rc; while (size > 0) { if ((rc = read(fd, buf, size)) < 0) { if (errno == EINTR) { continue; } else if (errno == EWOULDBLOCK) { fd_set *rfds = fdsalloc(); fdsset(rfds, fd); (void) doselect(fd + 1, rfds, (fd_set *) (0), (fd_set *) (0), (struct timeval *) (0)); fdsclr(rfds, fd); fdsfree(rfds); continue; } Abort("%t %s(): abort: read(%d): %m\n", fnc, fd); } else if (rc > size) { Abort("%t %s: abort: read(%d): too many bytes: %d > %d\n", fnc, fd, rc, size); } else if (rc == 0) { return done; } done += rc; buf += rc; size -= rc; } return done; } aplus-fsf-4.22/src/dap/doselect.c0000644000265000001440000000232310772770366012336 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include #include #include #include /* external function definitions */ int doselect(int d, fd_set * r, fd_set * w, fd_set * x, struct timeval * t) { static char fnc[] = "doselect"; fd_set *rsave = fdsdup(r); fd_set *wsave = fdsdup(w); fd_set *xsave = fdsdup(x); int rc; while ((rc = select(d, r, w, x, t)) < 0) { if (errno != EINTR) { Abort("%t %s(): abort: select(): %m\n", fnc); } fdscopy(rsave, r); fdscopy(wsave, w); fdscopy(xsave, x); } fdsfree(rsave); fdsfree(wsave); fdsfree(xsave); return rc; } aplus-fsf-4.22/src/dap/dowrite.c0000644000265000001440000000272510772770366012217 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include #include #include #include /* external function definitions */ int dowrite(int fd, char *buf, int size) { static char fnc[] = "dowrite"; int done = 0; int rc; while (size > 0) { if ((rc = write(fd, buf, size)) < 0) { if (errno == EINTR) { continue; } else if (errno == EWOULDBLOCK) { fd_set *wfds = fdsalloc(); fdsset(wfds, fd); (void) doselect(fd + 1, (fd_set *) (0), wfds, (fd_set *) (0), (struct timeval *) (0)); fdsclr(wfds, fd); fdsfree(wfds); continue; } else if (errno == EPIPE) { return done; } Abort("%t %s(): abort: write(%d): %m\n", fnc, fd); } else if (rc > size) { Abort("%t %s: abort: write(%d): too many bytes: %d > %d\n", fnc, fd, rc, size); } done += rc; buf += rc; size -= rc; } return done; } aplus-fsf-4.22/src/dap/error.c0000644000265000001440000001072210772770366011667 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #include #if defined(__cplusplus) #include #else #include #endif #if !defined(__cfront) #include #endif #include #include #include typedef void (*VPF) (); static FILE *_Warnfp = (FILE *)2; static void _DefaultWarnFunc(char *s) { fputs(s, _Warnfp); /******************************************/ /* Lexa redefines fflush in stdio.h */ /* which results in an unresolved symbol */ #if defined(__edgfe) && defined(fflush) #undef fflush #endif /******************************************/ fflush(_Warnfp); } static VPF _WarnFunc = _DefaultWarnFunc; #define MAXERRSIZE BUFSIZ /* char _ErrBuf[2 * MAXERRSIZE]; not thread safe moved into functions*/ #if defined(__sun__) extern int sys_nerr; #endif /* preprocess the format string */ static char * fixit(int errnum, char *s, char r[]) { char *z, *p = r, *cp = s, *str, ctimebuf[60]; static struct timeval tp; static struct timezone tzp; while (cp && *cp != (char) NULL) { if (p == &r[MAXERRSIZE - 1]) return ("bark!\n"); if (*cp == '%') switch (*(cp + 1)) { /* quoted `%' */ case '%': *p++ = *cp++; *p++ = *cp++; break; /* error string a la syslog(3) */ case 'm': if (errnum < 1 || errnum > sys_nerr) str = "unknown error"; else #ifdef HAVE_STRERROR str = strerror(errnum); #else str = sys_errlist[errnum]; #endif for (z = str; *z != (char) NULL && p < &r[MAXERRSIZE - 1]; *p++ = *z++); cp += 2; break; /* timestamp */ case 't': if (gettimeofday(&tp, &tzp) < 0) str = "(time?) "; else { #if defined(__SUNPRO_C) str = ctime_r(&tp.tv_sec,ctimebuf,sizeof(ctimebuf)); #else /* For linux ctimebuf must be at least 26 */ str = ctime_r(&tp.tv_sec,ctimebuf); #endif str[19] = '\0'; } for (z = str + 4; *z != (char) NULL && p < &r[MAXERRSIZE - 1]; *p++ = *z++); cp += 2; break; /* normal for _doprnt */ default: *p++ = *cp++; break; } else *p++ = *cp++; } *p = (char) NULL; return (r); } void vWarn(char *fmt, va_list ap) { char r[MAXERRSIZE]; char _ErrBuf[2 * MAXERRSIZE]; if (_WarnFunc != (VPF) NULL) { int errnum = errno; fmt = fixit(errnum, fmt,r); (void) vsprintf(_ErrBuf, fmt, ap); (_WarnFunc) (_ErrBuf); } } void Warn(char *fmt,...) { char r[MAXERRSIZE]; char _ErrBuf[2 * MAXERRSIZE]; if (_WarnFunc != (VPF) NULL) { int errnum = errno; va_list ap; fmt = fixit(errnum, fmt,r); va_start(ap, fmt); (void) vsprintf(_ErrBuf, fmt, ap); va_end(ap); (_WarnFunc) (_ErrBuf); } return; } void Abort(char *fmt,...) { char r[MAXERRSIZE]; char _ErrBuf[2 * MAXERRSIZE]; int errnum = errno; va_list ap; fmt = fixit(errnum, fmt,r); va_start(ap, fmt); (void) vsprintf(_ErrBuf, fmt, ap); va_end(ap); if (_WarnFunc != (VPF) NULL) (_WarnFunc) (_ErrBuf); else _DefaultWarnFunc(_ErrBuf); abort(); _exit(1); } void Panic(char *fmt,...) { char r[MAXERRSIZE]; char _ErrBuf[2 * MAXERRSIZE]; int errnum = errno; va_list ap; fmt = fixit(errnum, fmt, r); va_start(ap, fmt); (void) vsprintf(_ErrBuf, fmt, ap); va_end(ap); if (_WarnFunc != (VPF) NULL) (_WarnFunc) (_ErrBuf); else _DefaultWarnFunc(_ErrBuf); exit(1); } void Exit(int exitcode, char *fmt,...) { char r[MAXERRSIZE]; char _ErrBuf[2 * MAXERRSIZE]; int errnum = errno; va_list ap; fmt = fixit(errnum, fmt, r); va_start(ap, fmt); (void) vsprintf(_ErrBuf, fmt, ap); va_end(ap); if (_WarnFunc != (VPF) NULL) (_WarnFunc) (_ErrBuf); else _DefaultWarnFunc(_ErrBuf); exit(exitcode); } void SetWarn(char *file) { static char fnc[] = "SetWarn"; FILE *fp; if ((fp = fopen(file, "w")) == (FILE *) NULL) Warn("%s fopen(%s): %m\n", fnc, file); else _Warnfp = fp; (void) setbuf(fp, (char *) NULL); return; } void SetWarnFP(FILE * fp) { _Warnfp = fp; return; } void SetWarnFunc(VPF f) { _WarnFunc = f; return; } aplus-fsf-4.22/src/dap/exboalloc.c0000644000265000001440000000364110772770366012510 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* * exponential back off is controlled using the exbo structure It allows a * value such as a timeout to be adjusted for each successive use. A first * and last value is given. The current value of the exponetially backed off * counter is initalized to first value. It is read using the exbovalue() * function. The value is adjusted using the exbobackoff() function. This * will either double or halve the current value toward the last value If the * last value is past, the the current value is set the last value. * exboreset() will reset the current value to be equal to the first value. * In the future, a factor may be provided to allow the rate of backoff to be * controlled. Also, backoff could be generalized by allowing the user to * specify a custom backoff function. An exponential backoff structure is * established using exboalloc(). It is destroyed using exbofree(). */ /* header file inclusions */ #include #include /* external function definitions */ struct exbo * exboalloc(int first, int last) { struct exbo *p = (struct exbo *) balloc(sizeof(*p)); if (first < 0) { p->negative = 1; first *= -1; last *= -1; } else { p->negative = 0; } if (last < 0) last = 0; p->first = (unsigned) first; p->current = (unsigned) first; p->last = (unsigned) last; return p; } aplus-fsf-4.22/src/dap/exbobackoff.c0000644000265000001440000000176110772770366013012 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include /* external function definitions */ int exbobackoff(struct exbo * p) { if (p->current < p->last) { p->current *= 2; if (p->current > p->last) p->current = p->last; } else if (p->current > p->last) { p->current /= 2; if (p->current < p->last) p->current = p->last; } return (p->negative ? -1 * (int) (p->current) : (int) (p->current)); } aplus-fsf-4.22/src/dap/exbofree.c0000644000265000001440000000144210772770366012334 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ void exbofree(struct exbo * p) { if (p != (struct exbo *) (0)) { bfree((char *) p); } return; } aplus-fsf-4.22/src/dap/exboreset.c0000644000265000001440000000144310772770366012536 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include /* external function definitions */ int exboreset(struct exbo * p) { p->current = p->first; return (p->negative ? -1 * (int) (p->current) : (int) (p->current)); } aplus-fsf-4.22/src/dap/exbovalue.c0000644000265000001440000000141210772770366012524 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include /* external function definitions */ int exbovalue(struct exbo * p) { return (p->negative ? -1 * (int) (p->current) : (int) (p->current)); } aplus-fsf-4.22/src/dap/fds_data.c0000644000265000001440000000216610772770366012306 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include #if defined(linux) #include #endif /* external data definitions */ int fds_howmany = howmany(FD_SETSIZE, NFDBITS); int fds_size = FD_SETSIZE; int fds_sizeof = howmany(FD_SETSIZE, NFDBITS) * sizeof(fd_mask); fd_set *fds_all = (fd_set *) (0); fd_set *fds_none = (fd_set *) (0); fd_set *fds_r = (fd_set *) (0); fd_set *fds_ra = (fd_set *) (0); fd_set *fds_w = (fd_set *) (0); fd_set *fds_wa = (fd_set *) (0); fd_set *fds_x = (fd_set *) (0); fd_set *fds_xa = (fd_set *) (0); aplus-fsf-4.22/src/dap/fdsalloc.c0000644000265000001440000000143310772770366012324 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ fd_set * fdsalloc(void) { fd_set *p = (fd_set *) balloc(fds_sizeof); fdszero(p); return p; } aplus-fsf-4.22/src/dap/fdsalloc_r.c0000644000265000001440000000143710772770366012651 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ fd_set * fdsalloc_r(void) { fd_set *p = (fd_set *) balloc_r(fds_sizeof); fdszero(p); return p; } aplus-fsf-4.22/src/dap/fdsanyset.c0000644000265000001440000000154710772770366012543 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include /* external function definitions */ int fdsanyset(fd_set * p) { if (p != (fd_set *) (0)) { int i; for (i = 0; i < fds_howmany; i++) { if (__FDS_BITS(p)[i] != (fd_mask) (0)) { return 1; } } } return 0; } aplus-fsf-4.22/src/dap/fdsclr.c0000644000265000001440000000145110772770367012013 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include /* external function definitions */ void fdsclr(fd_set * p, int fd) { if ((p != (fd_set *) (0)) && (fd >= 0) && (fd < fds_size)) { FD_CLR(fd, p); } return; } aplus-fsf-4.22/src/dap/fdscopy.c0000644000265000001440000000162110772770367012204 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ void fdscopy(fd_set * p1, fd_set * p2) { if (p2 != (fd_set *) (0)) { if (p1 == (fd_set *) (0)) bzero((char *) p2, fds_sizeof); else bcopy((char *) p1, (char *) p2, fds_sizeof); } return; } aplus-fsf-4.22/src/dap/fdsdup.c0000644000265000001440000000144510772770367012026 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ fd_set * fdsdup(fd_set * p) { fd_set *p2 = (fd_set *) balloc(fds_sizeof); fdscopy(p, p2); return p2; } aplus-fsf-4.22/src/dap/fdsdup_r.c0000644000265000001440000000145110772770367012344 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ fd_set * fdsdup_r(fd_set * p) { fd_set *p2 = (fd_set *) balloc_r(fds_sizeof); fdscopy(p, p2); return p2; } aplus-fsf-4.22/src/dap/fdsfree.c0000644000265000001440000000142610772770367012156 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ void fdsfree(fd_set * p) { if (p != (fd_set *) (0)) { bfree((char *) p); } return; } aplus-fsf-4.22/src/dap/fdsfresh.c0000644000265000001440000000150410772770367012341 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include /* external function definitions */ void fdsfresh(int fd) { fdsclr(fds_r, fd); fdsclr(fds_ra, fd); fdsclr(fds_w, fd); fdsclr(fds_wa, fd); fdsclr(fds_x, fd); fdsclr(fds_xa, fd); return; } aplus-fsf-4.22/src/dap/fdsinit.c0000644000265000001440000000254210772770367012200 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ #include /* header file inclusions */ #include #include #include #include #if defined(linux) #include #endif /* external function definitions */ void fdsinit(void) { static char fnc[] = "fdsinit"; int i; if ((i = getdtablesize()) < 0) { Warn("%t %s(): warning: getdtablesize(): %m\n", fnc); } else { fds_size = i; } fds_howmany = howmany(fds_size, NFDBITS); fds_sizeof = fds_howmany * sizeof(fd_mask); fds_all = fdsalloc(); for (i = 0; i < fds_howmany; i++) { __FDS_BITS(fds_all)[i] = (fd_mask) (~0); } fds_none = fdsalloc(); fds_r = fdsalloc(); fds_ra = fdsalloc(); fds_w = fdsalloc(); fds_wa = fdsalloc(); fds_x = fdsalloc(); fds_xa = fdsalloc(); return; } aplus-fsf-4.22/src/dap/fdsisset.c0000644000265000001440000000147310772770367012366 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include /* external function definitions */ int fdsisset(fd_set * p, int fd) { if ((p != (fd_set *) (0)) && (fd >= 0) && (fd < fds_size)) { return !(!(FD_ISSET(fd, p))); } return 0; } aplus-fsf-4.22/src/dap/fdsset.c0000644000265000001440000000145110772770367012026 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include /* external function definitions */ void fdsset(fd_set * p, int fd) { if ((p != (fd_set *) (0)) && (fd >= 0) && (fd < fds_size)) { FD_SET(fd, p); } return; } aplus-fsf-4.22/src/dap/fdsterm.c0000644000265000001440000000326310772770367012205 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ void fdsterm(void) { static char fnc[] = "fdsterm"; if (fdsanyset(fds_xa)) Warn("%t %s(): warning: fds_xa is not empty\n", fnc); fdsfree(fds_xa); fds_xa = (fd_set *) (0); if (fdsanyset(fds_x)) Warn("%t %s(): warning: fds_x is not empty\n", fnc); fdsfree(fds_x); fds_x = (fd_set *) (0); if (fdsanyset(fds_wa)) Warn("%t %s(): warning: fds_wa is not empty\n", fnc); fdsfree(fds_wa); fds_wa = (fd_set *) (0); if (fdsanyset(fds_w)) Warn("%t %s(): warning: fds_w is not empty\n", fnc); fdsfree(fds_w); fds_w = (fd_set *) (0); if (fdsanyset(fds_ra)) Warn("%t %s(): warning: fds_ra is not empty\n", fnc); fdsfree(fds_ra); fds_ra = (fd_set *) (0); if (fdsanyset(fds_r)) Warn("%t %s(): warning: fds_r is not empty\n", fnc); fdsfree(fds_r); fds_r = (fd_set *) (0); if (fdsanyset(fds_none)) Warn("%t %s(): warning: fds_none is not empty\n", fnc); fdsfree(fds_none); fds_none = (fd_set *) (0); fdsfree(fds_all); fds_all = (fd_set *) (0); return; } aplus-fsf-4.22/src/dap/fdszero.c0000644000265000001440000000144510772770367012215 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ void fdszero(fd_set * p) { if (p != (fd_set *) (0)) { bzero((char *) p, fds_sizeof); } return; } aplus-fsf-4.22/src/dap/fletchalloc.c0000644000265000001440000000215110772770367013014 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* * Reference: "Fletcher's Error Detection Algorithm: How to implement it * efficiently and how to avoid the most common pitfalls," by Anastase * Nakassis, COMPUTER COMMUNICATION REVIEW,Vol 18, No 5, October, 1988. */ /* header file inclusions */ #include #include /* external function definitions */ struct fletch * fletchalloc(void) { struct fletch *p; p = (struct fletch *) balloc(sizeof(*p)); p->c0 = p->c1 = 0; p->modfreq = sizeof(int) >= 4 ? 4102 : 14; p->tilmod = p->modfreq; return p; } aplus-fsf-4.22/src/dap/fletchcheck.c0000644000265000001440000000321010772770367012774 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* * used to verify check sum on block * * Reference: "Fletcher's Error Detection Algorithm: How to implement it * efficiently and how to avoid the most common pitfalls," by Anastase * Nakassis, COMPUTER COMMUNICATION REVIEW,Vol 18, No 5, October, 1988. */ /* header file inclusions */ #include #include /* external function definitions */ int fletchcheck(char *buf, int len, int k) { char *xp = buf + k; int r; if (*xp) { if (*(xp + 1)) { /* both x and y are not zero, compute check sum */ struct fletch *p = fletchalloc(); fletchsum(p, buf, len); /* complete modulus */ if ((mod255(p->c0)) || (mod255(p->c1))) { /* check sum incorrect */ r = 1; } else { /* check sum correct */ r = 0; } fletchfree(p); } else { /* x is not 0 but y is, this is impossible */ r = 1; } } else if (*(xp + 1)) { /* y is not 0 but x is, this is impossible */ r = 1; } else { /* x and y are zero, meaning no check sum, assume this is ok */ r = 0; } return r; } aplus-fsf-4.22/src/dap/fletchdone.c0000644000265000001440000000312510772770367012651 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* * used to place the check sum in the message * * Reference: "Fletcher's Error Detection Algorithm: How to implement it * efficiently and how to avoid the most common pitfalls," by Anastase * Nakassis, COMPUTER COMMUNICATION REVIEW,Vol 18, No 5, October, 1988. */ /* header file inclusions */ #include #include /* external function definitions */ void fletchdone(struct fletch * p, char *xp, int len, int k) { int c0 = mod255(p->c0); int c1 = mod255(p->c1); int j, z, x, y; /* compute x and y */ if (len > k + 1) { j = mod255(len - (k + 1)); } else { j = 255 - mod255((k + 1) - len); } z = (j > 128) ? ((255 - j) * (255 - c0)) : (j * c0); z = mod255(z); if ((x = z + (255 - c1)) >= 255) x -= 255; if (x == 0) x = 255; if ((y = (255 - x) + (255 - c0)) >= 255) y -= 255; if (y == 0) y = 255; /* install x and y */ *xp = (char) (x); *(xp + 1) = (char) (y); /* complete modulus */ p->c0 = p->c1 = 0; p->tilmod = p->modfreq; return; } aplus-fsf-4.22/src/dap/fletchfree.c0000644000265000001440000000201410772770370012633 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* * Reference: "Fletcher's Error Detection Algorithm: How to implement it * efficiently and how to avoid the most common pitfalls," by Anastase * Nakassis, COMPUTER COMMUNICATION REVIEW,Vol 18, No 5, October, 1988. */ /* header file inclusions */ #include #include /* external function definitions */ void fletchfree(struct fletch * p) { if (p != (struct fletch *) (0)) { bfree((char *) (p)); } return; } aplus-fsf-4.22/src/dap/fletchpatch.c0000644000265000001440000000425110772770370013016 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* * used to patch the check sum on an already computed block * * Reference: "Fletcher's Error Detection Algorithm: How to implement it * efficiently and how to avoid the most common pitfalls," by Anastase * Nakassis, COMPUTER COMMUNICATION REVIEW,Vol 18, No 5, October, 1988. */ /* header file inclusions */ #include #include #include /* external function definitions */ void fletchpatch(char *buf, int off, char *new, int len, int k) { struct fletch *p = fletchalloc(); char *diffs = (char *) balloc(len); char *dst_cp = diffs; char *end_cp = dst_cp + len; char *old_cp = buf + off; char *new_cp = new; int tmp_c; char *xp = buf + k; /* save previous x and y */ int old_x = *((unsigned char *) (xp)); int old_y = *((unsigned char *) (xp + 1)); /* zero x and y in buffer */ *(xp) = *(xp + 1) = (char) (0); /* compute difference vector */ while (dst_cp < end_cp) { tmp_c = *(unsigned char *) (new_cp++) + (255 - *(unsigned char *) (old_cp++)); if (tmp_c >= 0) tmp_c -= 255; *dst_cp++ = tmp_c; } /* compute c0 and c1 for difference vector */ fletchsum(p, diffs, len); /* get rid of differences */ bfree(diffs); /* copy new over old */ bcopy(new, buf + off, len); /* compute dx and dy */ fletchdone(p, buf + k, off + len, k); /* add back old x and y */ tmp_c = old_x + *((unsigned char *) (xp)); if (tmp_c > 255) tmp_c -= 255; *xp = (char) tmp_c; tmp_c = old_y + *((unsigned char *) (xp + 1)); if (tmp_c > 255) tmp_c -= 255; *(xp + 1) = (char) tmp_c; fletchfree(p); return; } aplus-fsf-4.22/src/dap/fletchsum.c0000644000265000001440000000306110772770370012521 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* * used to compute intermediate values of c0 and c1 * * Reference: "Fletcher's Error Detection Algorithm: How to implement it * efficiently and how to avoid the most common pitfalls," by Anastase * Nakassis, COMPUTER COMMUNICATION REVIEW,Vol 18, No 5, October, 1988. */ /* header file inclusions */ #include #include /* external function definitions */ void fletchsum(struct fletch * p, char *cp, int len) { int c0 = p->c0; int c1 = p->c1; int tilmod = p->tilmod; char *end_cp; while (len) { if (len < tilmod) { end_cp = cp + len; while (cp < end_cp) { c0 += *((unsigned char *) (cp++)); c1 += c0; } tilmod -= len; len = 0; } else { end_cp = cp + tilmod; while (cp < end_cp) { c0 += *((unsigned char *) (cp++)); c1 += c0; } len -= tilmod; c0 = mod255(c0); c1 = mod255(c1); tilmod = p->modfreq; } } p->tilmod = tilmod; p->c1 = c1; p->c0 = c0; return; } aplus-fsf-4.22/src/dap/getmuser.c0000644000265000001440000000171210772770370012363 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #include #include int getmuser(char *name, char *Unix, char *Mainframe) { int ret, len; static char *val, *dom; if (dom == (char *) (0)) (void) yp_get_default_domain(&dom); if (val) free(val); if ((ret = yp_match(dom, "musers", name, strlen(name), &val, &len)) == 0) { (void) sscanf(val, "%s %s", Unix, Mainframe); return (0); } else return (ret); } aplus-fsf-4.22/src/dap/getrp.c0000644000265000001440000000625210772770370011655 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Douglas P. Kingston III */ #include #include #include #include #include #include static char *domain; static char *map = "remprogs"; static char *file = "/etc/remprogs"; static char *val; static struct remprog *rps; static void compress(char *fromptr); getrpbyname(char *name, struct remprog ** rpp, int *nrpp) { FILE *fp; int len, ret; int i; char buf[128]; if (domain == (char *) (0)) (void) yp_get_default_domain(&domain); if (val) bfree(val); val = (char *) (0); if (rps) bfree((char *) rps); rps = (struct remprog *) (0); ret = yp_match(domain, map, name, strlen((DEV_STRARG) name), &val, &len); switch (ret) { case YPERR_BADARGS: case YPERR_MAP: case YPERR_KEY: case YPERR_NOMORE: case YPERR_ACCESS: return (ret); case 0: return (rp_parse_value(val, rpp, nrpp)); } /* Try opening the file directly */ if ((fp = fopen(file, "r")) == (FILE *) (0)) return (ret); /* return YP error */ while (fgets(buf, sizeof(buf), fp) == buf) { for (i = 0; buf[i] != 0; i++) if (isspace(buf[i])) break; buf[i] = 0; if (strcmp((DEV_STRARG) buf, (DEV_STRARG) name) == 0) { (void) fclose(fp); return (rp_parse_value(&buf[i + 1], rpp, nrpp)); } } (void) fclose(fp); return (ret); /* return YP error */ } rp_parse_value(char *value, struct remprog ** rpp, int *nrpp) { char *cp = value; char *p; struct remprog *rp; int i, nrp = 1; compress(value); for (cp = value; *cp; cp++) if (*cp == ' ') nrp++; rps = (struct remprog *) balloc_r((nrp + 1) * sizeof(*rps)); if (rps == (struct remprog *) (0)) return (YPERR_RESRC); rp = &rps[nrp]; rp->rp_host = rp->rp_proto = (char *) 0; rp->rp_prognum = 0; compress(value); cp = value; p = value; for (i = 0; i < nrp; i++) { if (cp = (char *) strchr((DEV_STRARG) cp, ' ')) { *cp = 0; cp++; } rps[i].rp_host = p; p = (char *) strchr((DEV_STRARG) p, ':'); *p = 0; p++; rps[i].rp_prognum = atoi(p); p = (char *) strchr((DEV_STRARG) p, ':'); p++; rps[i].rp_proto = p; p = cp; } *rpp = rps; *nrpp = nrp; return (0); } static void compress(char *fromptr) { char chr, *toptr = fromptr; chr = ' '; /* init to skip leading spaces */ while ((*toptr = *fromptr++) != '\0') { /* convert newlines and tabs * to */ if (isspace(*toptr)) { /* only save first space */ if (chr != ' ') *toptr++ = chr = ' '; } else chr = *toptr++; } if (chr == ' ') /* remove trailing space if any */ *--toptr = '\0'; return; } aplus-fsf-4.22/src/dap/hashalloc.c0000644000265000001440000000360610772770370012472 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include #include #include /* external function definitions */ struct hash *hashalloc(int tblsz, int (*hash) (), void *(*value) (), struct node * (*find) (), struct node * (*insert) (), void (*replace) (), void (*remove) ()) /* hash table size */ /* info hashing function */ /* info value function */ /* info find function */ /* info insert notifier */ /* info replace notifier */ /* info remove notifier */ { struct hash *p; struct node *hnp; struct node *end_hnp; if (tblsz <= 0) tblsz = HASH_TBLSZ; if (hash == (int (*) ()) (0)) hash = bstrhash; if (value == (void *(*) ()) (0)) value = kvpvalue; if (find == (struct node * (*) ()) (0)) find = kvpfind; if (insert == (struct node * (*) ()) (0)) insert = kvpinsert; if (replace == (void (*) ()) (0)) replace = kvpreplace; if (remove == (void (*) ()) (0)) remove = kvpremove; p = (struct hash *) balloc(sizeof(*p)); p->tbl = (struct node *) balloc(tblsz * sizeof(*(p->tbl))); for (end_hnp = (hnp = p->tbl) + tblsz; hnp != end_hnp; hnp++) { hnp->f = hnp->b = hnp; } p->tblsz = tblsz; p->hashfunc = hash; p->value = value; p->find = find; p->insert = insert; p->replace = replace; p->remove = remove; return p; } aplus-fsf-4.22/src/dap/hashfind.c0000644000265000001440000000201710772770370012313 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ void * hashfind(struct hash * p, void *key) { if ((p != (struct hash *) (0)) && (key != (void *) (0))) { struct node *hnp; struct node *np; hnp = p->tbl + ((*(p->hashfunc)) (key) % p->tblsz); if ((np = (*(p->find)) (hnp, key)) != (struct node *) (0)) { return (*(p->value)) (np); } } return (void *) (0); } aplus-fsf-4.22/src/dap/hashfree.c0000644000265000001440000000205410772770370012315 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include #include /* external function definitions */ void hashfree(struct hash * p) { if (p != (struct hash *) (0)) { struct node *hnp; struct node *end_hnp; struct node *np; for (end_hnp = (hnp = p->tbl) + p->tblsz; hnp != end_hnp; hnp++) { while ((np = hnp->f) != hnp) { (*(p->remove)) (np); } } bfree((char *) (p->tbl)); bfree((char *) p); } return; } aplus-fsf-4.22/src/dap/hashinsert.c0000644000265000001440000000210710772770370012677 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ void * hashinsert(struct hash * p, void *key, void *val) { if ((p != (struct hash *) (0)) && (key != (void *) (0))) { struct node *hnp; struct node *np; hnp = p->tbl + ((*(p->hashfunc)) (key) % p->tblsz); if ((np = (*(p->find)) (hnp, key)) != (struct node *) (0)) { return (*(p->value)) (np); } (void) (*(p->insert)) (hnp, key, val); } return (void *) (0); } aplus-fsf-4.22/src/dap/hashnode.c0000644000265000001440000000210110772770370012312 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ struct node * hashnode(struct hash * p, void *key) { if ((p != (struct hash *) (0)) && (key != (void *) (0))) { struct node *hnp; struct node *np; hnp = p->tbl + ((*(p->hashfunc)) (key) % p->tblsz); if ((np = (*(p->find)) (hnp, key)) != (struct node *) (0)) { return np; } return (*(p->insert)) (hnp, key, (void *) (0)); } return (struct node *) (0); } aplus-fsf-4.22/src/dap/hashremove.c0000644000265000001440000000211110772770370012663 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ void * hashremove(struct hash * p, void *key) { if ((p != (struct hash *) (0)) && (key != (void *) (0))) { struct node *hnp; struct node *np; hnp = p->tbl + ((*(p->hashfunc)) (key) % p->tblsz); if ((np = (*(p->find)) (hnp, key)) != (struct node *) (0)) { void *oldval = (*(p->value)) (np); (*(p->remove)) (np); return oldval; } } return (void *) (0); } aplus-fsf-4.22/src/dap/hashreplace.c0000644000265000001440000000220610772770370013006 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ void * hashreplace(struct hash * p, void *key, void *val) { if ((p != (struct hash *) (0)) && (key != (void *) (0))) { struct node *hnp; struct node *np; hnp = p->tbl + ((*(p->hashfunc)) (key) % p->tblsz); if ((np = (*(p->find)) (hnp, key)) != (struct node *) (0)) { void *oldval = (*(p->value)) (np); (*(p->replace)) (np, val); return oldval; } (void) (*(p->insert)) (hnp, key, val); } return (void *) (0); } aplus-fsf-4.22/src/dap/hashwalk.c0000644000265000001440000000216210772770370012332 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ void *hashwalk(struct hash * p, void *(*func) (), void *result) { if ((p != (struct hash *) (0)) && (func != (void *(*) ()) (0))) { struct node *hnp; struct node *end_hnp; struct node *np; struct node *next_np; for (end_hnp = (hnp = p->tbl) + p->tblsz; hnp != end_hnp; hnp++) { for (np = hnp->f; np != hnp; np = next_np) { next_np = np->f; result = (*func) (np, result); } } } return result; } aplus-fsf-4.22/src/dap/hostcmp.c0000644000265000001440000000210710772770370012204 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Jordan Hayes */ /* header file inclusions */ #include #include #include #include #include /* external function definitions */ int hostcmp(char *host) { static char fnc[] = "hostcmp"; struct hostent *hp; if ((hp = gethostbyname(host)) == (struct hostent *) (0)) { Warn("%t %s(): error: gethostbyname(%s): host not found\n", fnc, host); return -1; } if (strcmp((DEV_STRARG) hp->h_name, (DEV_STRARG) hostname())) { return 1; } return 0; } aplus-fsf-4.22/src/dap/hostname.c0000644000265000001440000000210310772770371012342 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include #if defined(HAVE_SVR4) #include #endif #include #include /* external function definitions */ char * hostname(void) { static char fnc[] = "hostname"; static char p[MAXHOSTNAMELEN + 1]; if (gethostname(p, sizeof(p) - 1) != 0) { Warn("%t %s(): error: gethostname(): %m\n", fnc); } else { p[sizeof(p) - 1] = '\0'; bcopy(p, hostname_l, sizeof(p)); } return hostname_l; } aplus-fsf-4.22/src/dap/hostname_l.c0000644000265000001440000000151310772770371012661 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* * hostname_l is the last hostname returned by the operating system. */ /* header file inclusions */ #include #if defined(HAVE_SVR4) #include #endif /* external data definitions */ char hostname_l[MAXHOSTNAMELEN + 1] = "UNKNOWN"; aplus-fsf-4.22/src/dap/hppalloc.c0000644000265000001440000000161610772770371012336 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ struct hpp * hppalloc(char *host, unsigned short port) /* char *host; */ /* unsigned short port; */ { struct hpp *p = (struct hpp *) balloc(sizeof(*p)); p->host = bstring(host); p->port = port; return p; } aplus-fsf-4.22/src/dap/hppfree.c0000644000265000001440000000146210772770371012164 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ void hppfree(struct hpp * p) { if (p != (struct hpp *) (0)) { bfree(p->host); bfree((char *) p); } return; } aplus-fsf-4.22/src/dap/hppmake_in.c0000644000265000001440000000330410772770371012643 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* * translate internet style address (struct sockaddr_in) into hostname and * port style address (struct hpp) */ /* header file inclusions */ #include #include #include #ifdef PRESUNOS4 #ifndef _SOCKET_ #define _SOCKET_ #include #endif #else #include #endif #include #include #include #include #include #include /* external function definitions */ struct hpp * hppmake_in(struct sockaddr_in * name) { struct hpp *p = (struct hpp *) balloc(sizeof(*p)); if (name != (struct sockaddr_in *) (0)) { if (name->sin_addr.s_addr == INADDR_ANY) { p->host = (char *) (0); } else { struct in_addr *a = &(name->sin_addr); struct hostent *hp; hp = gethostbyaddr((char *) a, sizeof(*a), AF_INET); if (hp == (struct hostent *) (0)) { p->host = bstring(inet_ntoa(name->sin_addr)); } else { p->host = bstring(hp->h_name); } } p->port = ntohs(name->sin_port); } else { p->host = (char *) (0); p->port = (ushort) (0); } return p; } aplus-fsf-4.22/src/dap/hppname_in.c0000644000265000001440000000425410772770371012653 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* * translate hostname and port style address into an internet style address: * struct sockaddr_in */ /* header file inclusions */ #include #include #include #ifdef PRESUNOS4 #ifndef _SOCKET_ #define _SOCKET_ #include #endif #else #include #endif #include #include #include #include #include #include /* external function definitions */ struct sockaddr_in * hppname_in(struct hpp * p, int *lenp) { static char fnc[] = "hppname_in"; struct hostent *hostp; struct sockaddr_in *name; name = (struct sockaddr_in *) balloc(sizeof(*name)); name->sin_family = AF_INET; if (p->host != (char *) (0)) { if ((hostp = gethostbyname(p->host)) == (struct hostent *) (0)) { Warn("%t %s(): error: '%s' not found\n", fnc, p->host); bfree((char *) name); return (struct sockaddr_in *) (0); } if (hostp->h_addrtype != AF_INET) { Warn("%t %s(): error: '%s' not in AF_INET domain\n", fnc, p->host); bfree((char *) name); return (struct sockaddr_in *) (0); } if (hostp->h_length != sizeof(name->sin_addr.s_addr)) { Warn("%t %s(): error: '%s' address length mismatch\n", fnc, p->host); bfree((char *) name); return (struct sockaddr_in *) (0); } bcopy(hostp->h_addr, (char *) (&(name->sin_addr.s_addr)), sizeof(name->sin_addr.s_addr)); } else { name->sin_addr.s_addr = INADDR_ANY; } name->sin_port = htons(p->port); bzero(name->sin_zero, 8); *lenp = sizeof(*name); return name; } aplus-fsf-4.22/src/dap/kvpalloc.c0000644000265000001440000000150710772770371012346 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ struct kvp * kvpalloc(void *key, void *val) { struct kvp *p = (struct kvp *) balloc(sizeof(*p)); p->key = key; p->d = val; return p; } aplus-fsf-4.22/src/dap/kvpfind.c0000644000265000001440000000212110772770371012165 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include #include #include /* external function definitions */ struct node * kvpfind(struct node * hnp, char *key) { struct node *np; for (np = hnp->f; np != hnp; np = np->f) { char *tstkey = (char *) (KVPAT(np)->key); if (*key != *tstkey) continue; if (*key == '\0') return np; if (strcmp((DEV_STRARG) key + 1, (DEV_STRARG) tstkey + 1) == 0) return np; } return (struct node *) (0); } aplus-fsf-4.22/src/dap/kvpfree.c0000644000265000001440000000143610772770371012176 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ void kvpfree(struct kvp * p) { if (p != (struct kvp *) (0)) { bfree((char *) p); } return; } aplus-fsf-4.22/src/dap/kvpinsert.c0000644000265000001440000000154710772770371012564 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ struct node * kvpinsert(struct node * hnp, void *key, void *val) { struct node *np = nodealloc(); np->d = (void *) kvpalloc(key, val); nodeinsert(np, hnp); return np; } aplus-fsf-4.22/src/dap/kvpkey.c0000644000265000001440000000136110772770371012042 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ void * kvpkey(struct node * np) { return KVPAT(np)->key; } aplus-fsf-4.22/src/dap/kvpremove.c0000644000265000001440000000137010772770371012547 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include void kvpremove(struct node * np) { noderemove(np); kvpfree(KVPAT(np)); nodefree(np); return; } aplus-fsf-4.22/src/dap/kvpreplace.c0000644000265000001440000000140610772770371012665 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ void kvpreplace(struct node * np, void *val) { KVPAT(np)->d = val; return; } aplus-fsf-4.22/src/dap/kvpvalue.c0000644000265000001440000000136110772770371012366 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ void * kvpvalue(struct node * np) { return KVPAT(np)->d; } aplus-fsf-4.22/src/dap/lstnalloc.c0000644000265000001440000001064610772770372012533 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* * The lstn functions implement a persistent listener. It waits for * connections at the indicated address, accepting connections as they * arrive. When a connection arrives, an application provided accpet * notification function is called, so that it may set up the application * specific handling for the connection. The listner continues to listen for * furhter connections, unless the application either disables it, closes it * or destroys it. Should the listener encounter an error while either * setting itself up or while accepting an incoming connection, it will close * and schedule itself to be reopened in the near future. The computation of * the listening address is performed at each open by an application provided * l_namefunc. The computation uses l_nameinfo as its input. The listner * keeps trakc of the number of times it is opened and closed, the time it * was created, the time it was last opened, the time it was last closed, the * time it last accepted a connection. The total time it has been listening. * No attempt is made to associate accepted connections with the listener * after they are accepted, though an application could certainly arrange for * this. * * l_nameinfo to l_name, l_namelen translation is provided by the l_namefunc, * which returns l_name and l_namelen. The l_name and l_namelen are used to * bind a name to the listening socket. No bind is performed if the l_name * is returned as null. Since l_name can include wild cards which leaves * selection of the exact l_name upto the system, a getsockname is performed * after the listen, in order to extract the exact listening address. This * exact address it then handed to the l_regfunc function provided by the * application. The l_regfunc function gives the application the opportunity * to publish the listening address. The l_namelen returned by the * l_namefunc is used by the lstnopen function when is does its getsockname, * so this should be given a reasonable value even if the l_namefunc returns * a null l_name. The l_regfunc function should return 0 if it succeeds and * -1 if it fails and wishes for the listening port to be closed. */ /* header file inclusions */ #include #include #include #ifdef PRESUNOS4 #ifndef _SOCKET_ #define _SOCKET_ #include #endif #else #include #endif #include #include #include #include #include #include /* external function definitions */ struct lstn *lstnalloc(char *name, int pri, int retry, int retry_time_first, int retry_time_last, int domain, int type, int protocol, int r_namelen, void *l_nameinfo, int (*l_namefunc) (), int (*l_regfunc) (), void (*acptfunc) (), void *acb) { struct lstn *p = (struct lstn *) balloc(sizeof(*p)); if (name == (char *) (0)) name = ""; p->name = bstring(name); p->pri = pri; if (retry == LSTN_RETRY_NO) p->retry = LSTN_RETRY_NO; else p->retry = LSTN_RETRY_YES; p->domain = domain; p->type = type; p->protocol = protocol; p->r_namelen = r_namelen; p->l_nameinfo = l_nameinfo; p->l_namefunc = l_namefunc; p->l_regfunc = l_regfunc; p->acptfunc = acptfunc; p->acb = acb; p->retry_time = exboalloc(retry_time_first, retry_time_last); p->retry_tp = (struct timer *) (0); p->fd = -1; p->l_namelen = 0; p->l_name = (struct sockaddr *) (0); p->acptchan = (struct chan *) (0); p->alloctod = todsec(); p->opentod = (time_t) (0); p->lstntod = (time_t) (0); p->acpttod = (time_t) (0); p->deaftod = (time_t) (0); p->closetod = (time_t) (0); p->opendtime = (time_t) (0); p->lstndtime = (time_t) (0); p->opencount = (unsigned) (0); p->lstncount = (unsigned) (0); p->acptcount = (unsigned) (0); p->deafcount = (unsigned) (0); p->closecount = (unsigned) (0); return p; } aplus-fsf-4.22/src/dap/lstnclose.c0000644000265000001440000000364410772770372012546 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include #include #include #include #include #include #include #include /* external function definitions */ void lstnclose(struct lstn * p) { static char fnc[] = "lstnclose"; if (p != (struct lstn *) (0)) { int fd = p->fd; if (fd < 0) { timerclr(p->retry_tp); p->retry_tp = (struct timer *) (0); } else { if (p->acptchan != (struct chan *) (0)) { chanclose(p->acptchan); p->acptchan = (struct chan *) (0); p->deaftod = todsec(); p->lstndtime += (p->deaftod - p->lstntod); } bfree((char *) (p->l_name)); p->l_name = (struct sockaddr *) (0); p->l_namelen = 0; fdsfresh(fd); if (close(fd) < 0) { Warn("%t %s(%s): warning: close(%d): %m\n", fnc, p->name, fd); } p->fd = -1; p->closetod = todsec(); (p->closecount)++; p->opendtime += (p->closetod - p->opentod); } if (p->retry == LSTN_RETRY_YES) { time_t retry_time = (time_t) exbovalue(p->retry_time); Warn("%t %s(%s): note: retrying in %ld seconds\n", fnc, p->name, retry_time); p->retry_tp = timer(retry_time, (long) (0), (void (*)(void *))lstnopen, (void *) (p)); exbobackoff(p->retry_time); } } return; } aplus-fsf-4.22/src/dap/lstnfree.c0000644000265000001440000000163110772770372012354 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include #include /* external function definitions */ void lstnfree(struct lstn * p) { if (p != (struct lstn *) (0)) { p->retry = LSTN_RETRY_NO; lstnclose(p); exbofree(p->retry_time); bfree(p->name); bfree((char *) p); } return; } aplus-fsf-4.22/src/dap/lstnopen.c0000644000265000001440000001034310772770372012374 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #if defined(HAVE_SVR4) #include #endif #include #include #ifdef PRESUNOS4 #ifndef _SOCKET_ #define _SOCKET_ #include #endif #else #include #endif #include #include #include #include #include #include #include #include #include #include #include /* internal function declarations */ static void acpt(struct lstn * p); /* external function definitions */ void lstnopen(struct lstn * p) { static char fnc[] = "lstnopen"; if ((p != (struct lstn *) (0)) || (p->fd >= 0)) { int fd; int toggle; p->retry_tp = (struct timer *) (0); if ((fd = socket(p->domain, p->type, p->protocol)) < 0) { Warn("%t %s(%s): error: socket(): %m\n", fnc, p->name); lstnclose(p); return; } p->opentod = todsec(); (p->opencount)++; fdsfresh(fd); p->fd = fd; toggle = 1; if (ioctl(fd, FIONBIO, &toggle) < 0) { Warn("%t %s(%s): warning: ioctl(%d, FIONBIO): %m\n", fnc, p->name, fd); } toggle = 1; if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char *) (&toggle), sizeof(toggle)) < 0) { Warn("%t %s(%s): warning: setsockopt(%d, REUSEADDR): %m\n", fnc, p->name, fd); } if ((*(p->l_namefunc)) (p) != 0) { lstnclose(p); return; } if (p->l_name == (struct sockaddr *) (0)) { p->l_name = (struct sockaddr *) balloc(p->l_namelen); bzero((char *) (p->l_name), p->l_namelen); } else { if (bind(fd, p->l_name, p->l_namelen) < 0) { Warn("%t %s(%s): error: bind(%d): %m\n", fnc, p->name, fd); lstnclose(p); return; } } if (listen(fd, 5) < 0) { Warn("%t %s(%s): error: listen(%d): %m\n", fnc, p->name, fd); lstnclose(p); return; } if (getsockname(fd, p->l_name, &(p->l_namelen)) < 0) { Warn("%t %s(%s): error: getsockname(%d): %m\n", fnc, p->name, fd); lstnclose(p); return; } if ((*(p->l_regfunc)) (p) != 0) { lstnclose(p); return; } p->lstntod = todsec(); (p->lstncount)++; p->acptchan = chanopen(p->name, fd, p->pri, CHAN_R, (void (*)(void *))acpt, (void *) p); chanenbl(p->acptchan); exboreset(p->retry_time); } return; } /* internal function definitions */ static void acpt(struct lstn * p) { static char fnc[] = "acpt"; int r_namelen = p->r_namelen; struct sockaddr *r_name; int fd; int l_namelen = p->l_namelen; struct sockaddr *l_name; r_name = (struct sockaddr *) balloc(r_namelen); if ((fd = accept(p->fd, r_name, &r_namelen)) < 0) { if ((errno == EWOULDBLOCK) || (errno == EINTR)) { /* nothing to report */ } else if ((errno == EMFILE) || (errno == ENFILE) || (errno == ENXIO) || (errno == EIO)) { Warn("%t %s(%s): warn: accept(%d): %m\n", fnc, p->name, p->fd); } else { Warn("%t %s(%s): error: accept(%d): %m\n", fnc, p->name, p->fd); lstnclose(p); } bfree((char *) r_name); return; } l_name = (struct sockaddr *) balloc(l_namelen); if (getsockname(fd, l_name, &l_namelen) < 0) { Warn("%t %s(%s): error: getsockname(%d): %m\n", fnc, p->name, fd); doclose(fd); bfree((char *) l_name); bfree((char *) r_name); return; } p->acpttod = todsec(); (p->acptcount)++; r_name = (struct sockaddr *) brealloc((char *) r_name, r_namelen); l_name = (struct sockaddr *) brealloc((char *) l_name, l_namelen); (*(p->acptfunc)) (p, fd, r_name, r_namelen, l_name, l_namelen); return; } aplus-fsf-4.22/src/dap/mod255.c0000644000265000001440000000203310772770372011542 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* * Reference: "Fletcher's Error Detection Algorithm: How to implement it * efficiently and how to avoid the most common pitfalls," by Anastase * Nakassis, COMPUTER COMMUNICATION REVIEW,Vol 18, No 5, October, 1988. */ /* external function definitions */ int mod255(int c) { char *cp = (char *) (&c); char *end_cp = cp + sizeof(c); int r = 0; while (cp < end_cp) { r += *(unsigned char *) (cp++); } while (r >= 255) r -= 255; return r; } aplus-fsf-4.22/src/dap/mtmalloc.c0000644000265000001440000000174710772770372012352 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include #include /* external function definitions */ struct mtm * mtmalloc(void *d) { struct mtm *p = (struct mtm *) balloc(sizeof(*p)); struct node *np; p->unp = np = nodealloc(); np->d = (void *) p; p->up = (void *) (0); p->dnp = np = nodealloc(); np->d = (void *) p; p->dp = (void *) (0); p->d = d; return p; } aplus-fsf-4.22/src/dap/mtmdnins.c0000644000265000001440000000151610772770372012365 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ void mtmdnins(struct mtm * p, struct node * hp, void *dp) { if (p != (struct mtm *) (0)) { p->dp = dp; nodeinsert(p->dnp, hp); } return; } aplus-fsf-4.22/src/dap/mtmdnrm.c0000644000265000001440000000146710772770372012217 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ void mtmdnrm(struct mtm * p) { if (p != (struct mtm *) (0)) { noderemove(p->dnp); p->dp = (void *) (0); } return; } aplus-fsf-4.22/src/dap/mtmfree.c0000644000265000001440000000160010772770372012165 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include #include /* external function definitions */ void mtmfree(struct mtm * p) { if (p != (struct mtm *) (0)) { mtmdnrm(p); mtmuprm(p); nodefree(p->dnp); nodefree(p->unp); bfree((char *) p); } return; } aplus-fsf-4.22/src/dap/mtmlink.c0000644000265000001440000000155510772770372012212 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ struct mtm * mtmlink(struct node * uhp, void *up, struct node * dhp, void *dp, void *d) { struct mtm *p = mtmalloc(d); mtmupins(p, uhp, up); mtmdnins(p, dhp, dp); return p; } aplus-fsf-4.22/src/dap/mtmunlink.c0000644000265000001440000000133210772770372012546 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include /* external function definitions */ void mtmunlink(struct mtm * p) { mtmfree(p); return; } aplus-fsf-4.22/src/dap/mtmupins.c0000644000265000001440000000151610772770372012410 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ void mtmupins(struct mtm * p, struct node * hp, void *up) { if (p != (struct mtm *) (0)) { p->up = up; nodeinsert(p->unp, hp); } return; } aplus-fsf-4.22/src/dap/mtmuprm.c0000644000265000001440000000146710772770372012242 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ void mtmuprm(struct mtm * p) { if (p != (struct mtm *) (0)) { noderemove(p->unp); p->up = (void *) (0); } return; } aplus-fsf-4.22/src/dap/mtmvalue.c0000644000265000001440000000151310772770372012363 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* * for use when mtm's are linked into hash tables and other search * structures. */ /* header file inclusions */ #include #include /* external function definitions */ void * mtmvalue(struct node * np) { return MTMAT(np)->d; } aplus-fsf-4.22/src/dap/nodealloc.c0000644000265000001440000000151410772770372012472 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ struct node * nodealloc(void) { struct node *p; p = (struct node *) balloc(sizeof(*p)); p->f = p->b = p; p->d = (void *) (0); return p; } aplus-fsf-4.22/src/dap/nodealloc_r.c0000644000265000001440000000156510772770373013022 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ struct node * nodealloc_r(void) { struct node *p = (struct node *) balloc_r(sizeof(*p)); if (p != (struct node *) (0)) { p->f = p->b = p; p->d = (void *) (0); } return p; } aplus-fsf-4.22/src/dap/nodefree.c0000644000265000001440000000144410772770373012324 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ void nodefree(struct node * p) { if (p != (struct node *) (0)) { bfree((char *) (p)); } return; } aplus-fsf-4.22/src/dap/nodeinsert.c0000644000265000001440000000212110772770373012700 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* * cuts head circular list before h and inserts new circular list, making * large circular list. This operation is semetrical with respect to * interchange of h and p. */ /* header file inclusions */ #include /* external function definitions */ void nodeinsert(struct node * p, struct node * h) { if ((p != (struct node *) (0)) && (h != (struct node *) (0))) { struct node *t = p->b; /* temporary node */ p->b->f = h; p->b = h->b; h->b->f = p; h->b = t; } return; } aplus-fsf-4.22/src/dap/noderemove.c0000644000265000001440000000156610772770373012705 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* remove node from its doubly linked list -- idempotent */ /* header file inclusions */ #include /* external function definitions */ void noderemove(struct node * p) { if (p != (struct node *) (0)) { p->b->f = p->f; p->f->b = p->b; p->b = p; p->f = p; } return; } aplus-fsf-4.22/src/dap/nodesort.c0000644000265000001440000000441210772770373012370 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Keith W. Iverson */ /* header file inclusions */ #include #include #include /* internal function declarations */ static int kvpcompare(struct node ** a, struct node ** b); /* external function definitions */ void nodesort(struct node * hp, int (*func) ()) { if (hp != (struct node *) (0)) { int c; struct node *np; for (c = 0, np = hp->f; np != hp; c++, np = np->f); if (c != 0) { struct node **a; struct node **ai; struct node **ae; a = (struct node **) balloc(c * sizeof(*a)); for (ae = (ai = a) + c; ai != ae; ai++) { noderemove(np = hp->f); *ai = np; } if (func == (int (*) ()) (0)) func = kvpcompare; qsort((char *) (a), c, sizeof(*a), func); for (ai = a; ai != ae; ai++) { nodeinsert(*ai, hp); } bfree((char *) a); } } return; } /* internal function definitions */ static int kvpcompare(struct node ** a, struct node ** b) { struct kvp *ka; struct kvp *kb; char *kak; char *kbk; if (a == (struct node **) (0)) { if (b == (struct node **) (0)) return 0; return -1; } if (b == (struct node **) (0)) return 1; if (*a == (struct node *) (0)) { if (*b == (struct node *) (0)) return 0; return -1; } if (*b == (struct node *) (0)) return 1; if ((ka = KVPAT(*a)) == (struct kvp *) (0)) { if (KVPAT(*b) == (struct kvp *) (0)) return 0; return -1; } if ((kb = KVPAT(*b)) == (struct kvp *) (0)) return 1; if ((kak = (char *) (ka->key)) == (char *) (0)) { if ((char *) (kb->key) == (char *) (0)) return 0; return -1; } if ((kbk = (char *) (kb->key)) == (char *) (0)) return 1; return strcmp(kak, kbk); } aplus-fsf-4.22/src/dap/nodetoad.c0000644000265000001440000000173310772770373012333 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* Take Out node And Deposit one position forward (leap-frog) */ /* header file inclusions */ #include /* external function definitions */ void nodetoad(struct node * p) { if (p != (struct node *) (0)) { struct node *o = p->b; struct node *q = p->f; struct node *r; o->f = q; q->b = o; p->f = r = q->f; p->b = q; q->f = p; r->b = p; } return; } aplus-fsf-4.22/src/dap/noop.c0000644000265000001440000000121210772770373011501 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* external function definitions */ void noop(void) { return; } aplus-fsf-4.22/src/dap/parity.c0000644000265000001440000000314410772770373012044 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* external data definitions */ int parity[256] = { /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */ /* 0 */ 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, /* 1 */ 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, /* 2 */ 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, /* 3 */ 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, /* 4 */ 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, /* 5 */ 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, /* 6 */ 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, /* 7 */ 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, /* 8 */ 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, /* 9 */ 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, /* a */ 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, /* b */ 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, /* c */ 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, /* d */ 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, /* e */ 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, /* f */ 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0 }; aplus-fsf-4.22/src/dap/service.c0000644000265000001440000000767110772770373012205 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Jordan Hayes */ #include #include #if defined(HAVE_SVR4) #include #endif #include #include #include #include /* Internal function definations */ static int GetRP(char *name, struct remprog ** rp_arg, struct remprog ** rpp_arg); static int count = 0, current = 0; static struct remprog *rp, *rpp; #define MAX_TRIES 3 int GetService(char *name) { if (count > 0) count = current = 0; return (count = GetRP(name, &rp, &rpp)); } static int GetRP(char *name, struct remprog ** rp_arg, struct remprog ** rpp_arg) { static char fnc[] = "GetRP"; int cnt, tries = 0; for (;;) { switch (getrpbyname(name, rp_arg, &cnt)) { /* Success */ case 0: *rpp_arg = *rp_arg; return (cnt); /* Not necessarily fatal errors - worth retrying */ case YPERR_RPC: case YPERR_DOMAIN: case YPERR_MAP: case YPERR_KEY: case YPERR_YPERR: case YPERR_PMAP: case YPERR_YPBIND: case YPERR_YPSERV: case YPERR_RESRC: case YPERR_NOMORE: case YPERR_NODOM: case YPERR_BADDB: case YPERR_VERS: #ifdef YPERR_BUSY case YPERR_BUSY: #endif #ifdef YPERR_ACCESS case YPERR_ACCESS: #endif if (++tries > MAX_TRIES) { Warn("%t %s: Cannot find service '%s'\n", fnc, name); return (-1); } break; /* Fatal errors */ case YPERR_BADARGS: /* Args to function are bad */ default: Warn("%t %s: Cannot find service '%s'\n", fnc, name); return (-1); } } /* NOTREACHED */ } int NextService(char **host, long int *program, char **protocol) { static char fnc[] = "NextService"; /* eh? */ if (count == 0) { Warn("%t %s: Next before get?\n", fnc); return (-1); } /* fill in the blanks */ if (host != (char **) (0)) *host = bstring(rpp->rp_host); if (program != (long *) (0)) *program = rpp->rp_prognum; if (protocol != (char **) (0)) *protocol = bstring(rpp->rp_proto); current++, rpp++; if (current == count) current = 0, rpp = rp; return (current); } ServEnt * GetServ(char *name) { ServEnt *r; /* init */ r = (ServEnt *) balloc(sizeof(*r)); if ((r->count = GetRP(name, &r->rp, &r->rpp)) == -1) { bfree((char *) r); return (ServEnt *) NULL; } r->name = bstring(name); r->host = (char *) balloc(MAXHOSTNAMELEN); bzero(r->host, MAXHOSTNAMELEN); r->protocol = (char *) balloc(MAXHOSTNAMELEN); bzero(r->protocol, MAXHOSTNAMELEN); r->index = 0; return (r); } int NextServ(ServEnt * sp) { static char fnc[] = "NextServ"; if (sp->count < 1) { Warn("%t %s: Next before get???\n", fnc); return (-1); } if (sp->host != (char *) (0)) (void) strcpy((DEV_STRARG) sp->host, (DEV_STRARG) sp->rpp->rp_host); sp->program = sp->rpp->rp_prognum; if (sp->protocol != (char *) (0)) (void) strcpy((DEV_STRARG) sp->protocol, (DEV_STRARG) sp->rpp->rp_proto); if (++(sp->index) == sp->count) { sp->index = 0; sp->rpp = sp->rp; } else sp->rpp++; return (sp->index); } void ServEntDestroy(ServEnt * sp) { bfree(sp->name); bfree(sp->host); bfree(sp->protocol); bfree((char *) sp); } /* For backward compatibility with old (depricated) interface */ get_service_by_name(char *name, char **host, long int *program, char **protocol) { if ((GetService(name) < 0) || (NextService(host, program, protocol) < 0)) return (-1); return (0); } aplus-fsf-4.22/src/dap/servname_in.c0000644000265000001440000000470510772770373013046 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Jordan Hayes */ /* * for use with the connalloc and lstnalloc for looking up a service in the * remprogs data base and converting it to a AF_INET address. */ /* header file inclusions */ #include #include #include #ifdef PRESUNOS4 #ifndef _SOCKET_ #define _SOCKET_ #include #endif #else #include #endif #include #include #include #include #include #include /* external function definitions */ struct sockaddr_in * servname_in(char *service, int *lenp) { static char fnc[] = "servname_in"; ServEnt *sp; int i; struct hostent *hp = NULL; struct sockaddr_in *name; sp = GetServ(service); for (i = 0; i < sp->count; i++) { if (NextServ(sp) == -1) { i = sp->count; break; } if (sp->host == (char *) (0)) { continue; } if ((hp = gethostbyname(sp->host)) == (struct hostent *) (0)) { Warn("%t %s(): error: '%s' not found\n", fnc, sp->host); continue; } if (hp->h_addrtype != AF_INET) { Warn("%t %s(): error: '%s' not in AF_INET domain\n", fnc, sp->host); continue; } if (hp->h_length != sizeof(name->sin_addr.s_addr)) { Warn("%t %s(): error: '%s' address length mismatch\n", fnc, sp->host); continue; } break; } if (i >= sp->count) { if (sp->count >= 1) { Warn("%t %s(): error: can't get a provider for '%s'\n", fnc, service); } name = (struct sockaddr_in *) (0); } else { name = (struct sockaddr_in *) balloc(sizeof(*name)); name->sin_family = AF_INET; bcopy(hp->h_addr, (char *) (&(name->sin_addr.s_addr)), sizeof(name->sin_addr.s_addr)); name->sin_port = htons((unsigned short) (sp->program)); bzero(name->sin_zero, 8); *lenp = sizeof(*name); } /* TK - ServEntDestroy(sp); */ return name; } aplus-fsf-4.22/src/dap/sgnlcatch.c0000644000265000001440000000376510772770373012513 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include #include #include #include /* internal macro declarations */ #ifdef PRESUNOS4 #define HANDLER_RETURN_TYPE int #define HANDLER_RETURN return 0 #else #define HANDLER_RETURN_TYPE void #define HANDLER_RETURN return #endif /* internal function declarations */ static HANDLER_RETURN_TYPE handler(int n); /* external function definitions */ void sgnlcatch(int n, void (*func) ()) { static char fnc[] = "sgnlcatch"; if ((n >= 1) && (n < NSIG)) { struct sgnl *p = sgnls + n; #if defined(HAVE_SVR4) struct sigaction *ovp; struct sigaction vec; ovp = (p->set == 0) ? &(p->orig) : (struct sigaction *) (0); vec.sa_handler = handler; sigemptyset(&vec.sa_mask); vec.sa_flags = 0; if (sigaction(n, &vec, ovp) != 0) { Abort("%t %s(): abort: sigaction(%d): %m\n", fnc, n); } #else struct sigvec *ovp; struct sigvec vec; ovp = (struct sigvec *)((p->set == 0) ? &(p->orig) : 0); vec.sv_handler = handler; vec.sv_mask = 0; vec.sv_flags = SV_INTERRUPT; if (sigvec(n, &vec, ovp) != 0) { Abort("%t %s(): abort: sigvec(%d): %m\n", fnc, n); } #endif p->set = 1; p->func = (func == (void (*) ()) (0)) ? noop : func; } return; } /* internal function definitions */ static HANDLER_RETURN_TYPE handler(int n) { sgnls[n].flag = 1; HANDLER_RETURN; } aplus-fsf-4.22/src/dap/sgnldefault.c0000644000265000001440000000277610772770373013056 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include #include /* external function definitions */ void sgnldefault(int n) { static char fnc[] = "sgnldefault"; if ((n >= 1) && (n < NSIG)) { struct sgnl *p = sgnls + n; #if defined(HAVE_SVR4) struct sigaction *ovp; struct sigaction vec; ovp = (p->set == 0) ? &(p->orig) : (struct sigaction *) (0); vec.sa_handler = SIG_DFL; sigemptyset(&vec.sa_mask); vec.sa_flags = SA_RESTART; if (sigaction(n, &vec, ovp) != 0) { Abort("%t %s(): abort: sigaction(%d): %m\n", fnc, n); } #else struct sigvec *ovp; struct sigvec vec; ovp = (struct sigvec *)((p->set == 0) ? &(p->orig) : (0)); vec.sv_handler = SIG_DFL; vec.sv_mask = 0; vec.sv_flags = 0; if (sigvec(n, &vec, ovp) != 0) { Abort("%t %s(): abort: sigvec(%d): %m\n", fnc, n); } #endif p->set = 1; p->func = noop; } return; } aplus-fsf-4.22/src/dap/sgnlignore.c0000644000265000001440000000277210772770373012711 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include #include /* external function definitions */ void sgnlignore(int n) { static char fnc[] = "sgnlignore"; if ((n >= 1) && (n < NSIG)) { struct sgnl *p = sgnls + n; #if defined(HAVE_SVR4) struct sigaction *ovp; struct sigaction vec; ovp = (p->set == 0) ? &(p->orig) : (struct sigaction *) (0); vec.sa_handler = SIG_IGN; sigemptyset(&vec.sa_mask); vec.sa_flags = SA_RESTART; if (sigaction(n, &vec, ovp) != 0) { Abort("%t %s(): abort: sigaction(%d): %m\n", fnc, n); } #else struct sigvec *ovp; struct sigvec vec; ovp = (struct sigvec *)((p->set == 0) ? &(p->orig) : 0); vec.sv_handler = SIG_IGN; vec.sv_mask = 0; vec.sv_flags = 0; if (sigvec(n, &vec, ovp) != 0) { Abort("%t %s(): abort: sigvec(%d): %m\n", fnc, n); } #endif p->set = 1; p->func = noop; } return; } aplus-fsf-4.22/src/dap/sgnloriginal.c0000644000265000001440000000255310772770373013227 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include #include /* external function definitions */ void sgnloriginal(int n) { static char fnc[] = "sgnloriginal"; if ((n >= 1) && (n < NSIG)) { struct sgnl *p = sgnls + n; if (p->set != 0) { #if defined(HAVE_SVR4) struct sigaction *ovp = &(p->orig); if (sigaction(n, ovp, (struct sigaction *) (0)) != 0) { Abort("%t %s(): abort: sigaction(%d): %m\n", fnc, n); } #else struct sigvec *ovp = (struct sigvec *)&(p->orig); if (sigvec(n, ovp, (struct sigvec *) (0)) != 0) { Abort("%t %s(): abort: sigvec(%d): %m\n", fnc, n); } #endif p->set = 0; bzero((char *) ovp, sizeof(*ovp)); p->flag = 0; p->func = (void (*) ()) (0); } } return; } aplus-fsf-4.22/src/dap/sgnlproc.c0000644000265000001440000000252410772770374012365 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ int sgnlproc(void) { int n; struct sgnl *p; #if defined(HAVE_SVR4) sigset_t savemask; struct sigaction act; #else int savemask; #endif int didwork = 0; for (n = 1; n < NSIG; n++) { if ((p = sgnls + n)->flag) { #if defined(HAVE_SVR4) sigaction(n, NULL, &act); savemask = act.sa_mask; sigemptyset(&act.sa_mask); sigaddset(&act.sa_mask, n); sigaction(n, &act, NULL); p->flag = 0; act.sa_mask = savemask; sigaction(n, &act, NULL); #else savemask = sigblock(sigmask(n)); p->flag = 0; (void) sigsetmask(savemask); #endif (*(p->func)) (n); didwork = 1; } } return didwork; } aplus-fsf-4.22/src/dap/sgnls.c0000644000265000001440000000126410772770374011664 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include /* external data definitions */ struct sgnl sgnls[NSIG]; aplus-fsf-4.22/src/dap/slpqalloc.c0000644000265000001440000000241710772770374012531 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* * used to create a new sleep queue. The initial signal count and maximum * over count may be specified. */ /* header file inclusions */ #include #include #include /* external function definitions */ struct slpq * slpqalloc(int initwakes, int maxwakes) { struct slpq *p = (struct slpq *) balloc(sizeof(*p)); /* ensure wakes is never greater than maxwakes */ if (initwakes > maxwakes) initwakes = maxwakes; p->wq = nodealloc(); /* allocate head of slpqent wait queue */ p->wakes = initwakes; /* set wakes to initwakes value */ p->maxwakes = maxwakes; /* set maxwakes value as given */ return p; /* return a pointer to the sleep queue */ } aplus-fsf-4.22/src/dap/slpqents.c0000644000265000001440000000146010772770374012405 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* head node for global list of scheduled sleep queue entries */ /* header file inclusions */ #include #include /* external data definitions */ struct node slpqents = {&slpqents, &slpqents, (void *) (0)}; aplus-fsf-4.22/src/dap/slpqfree.c0000644000265000001440000000310310772770374012351 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* * get rid of a sleep queue -- this will discard any waiting slpqent's, so * presumably, any thing that has issued a wait or otherwise knows the * address of the sleep queue are already aware of its impending demise. */ /* header file inclusions */ #include #include #include /* external function definitions */ void slpqfree(struct slpq * p) { /* free always tolarates a null argument */ if (p != (struct slpq *) (0)) { struct node *np; struct slpqent *ep; /* cause all scheduled slpqents to forget this slpq */ for (np = slpqents.f; np != &slpqents; np = np->f) { if ((ep = SLPQENTAT(np))->sp == p) { ep->sp = (struct slpq *) (0); } } /* free all waiting slpqent's */ while ((np = p->wq->f) != p->wq) { noderemove(np); bfree((char *) SLPQENTAT(np)); nodefree(np); } nodefree(p->wq); /* free the wait queue head node */ bfree((char *) p); /* free the sleep queue struture */ } return; } aplus-fsf-4.22/src/dap/slpqgiveup.c0000644000265000001440000000203610772770374012733 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* This should only be used if the slpqents list is used */ /* header file inclusions */ #include #include #include /* external function definitions */ void slpqgiveup(struct slpqent * ep) { if (ep != (struct slpqent *) (0)) { struct slpq *p = ep->sp; int sched = ep->sched; noderemove(ep->np); nodefree(ep->np); bfree((char *) ep); if (sched) slpqwakeup(p, (void (*) ()) (0)); } return; } aplus-fsf-4.22/src/dap/slpqimmed.c0000644000265000001440000000131610772770374012527 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* external function definitions */ void slpqimmed(void (*func) (), void *arg) { if (func != (void (*) ()) (0)) (*func) (arg); } aplus-fsf-4.22/src/dap/slpqproc.c0000644000265000001440000000217410772770374012402 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include #include /* external function definitions */ int slpqproc(void) { struct node *np; struct slpqent *ep; void (*func) (); void *arg; int didwork = 0; while ((np = slpqents.f) != &slpqents) { noderemove(np); ep = SLPQENTAT(np); nodefree(np); if (ep != (struct slpqent *) (0)) { func = ep->func; arg = ep->arg; bfree((char *) ep); if (func != (void (*) ()) (0)) (*func) (arg); } didwork = 1; } return didwork; } aplus-fsf-4.22/src/dap/slpqsched.c0000644000265000001440000000207310772770374012523 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include #include /* external function definitions */ void slpqsched(struct slpqent * ep, void (*sched) ()) { if (ep != (struct slpqent *) (0)) { if (sched == (void (*) ()) (0)) { ep->sched = 1; nodeinsert(ep->np, &slpqents); } else { void (*func) () = ep->func; void *arg = ep->arg; nodefree(ep->np); bfree((char *) ep); (*sched) (func, arg); } } return; } aplus-fsf-4.22/src/dap/slpqsleep.c0000644000265000001440000000241110772770374012541 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include #include /* external function definitions */ struct slpqent *slpqsleep(struct slpq * p, void (*func) (), void *arg, void (*sched) ()) { struct slpqent *ep = (struct slpqent *) (0); /* if the slpq is null we fake it cause we will just wait forever */ if (p != (struct slpq *) (0)) { ep = (struct slpqent *) balloc(sizeof(*ep)); ep->np = nodealloc(); ep->np->d = (void *) ep; ep->sp = p; ep->func = func; ep->arg = arg; ep->sched = 0; if (p->wakes > 0) { (p->wakes)--; slpqsched(ep, sched); } else { nodeinsert(ep->np, p->wq); } } return ep; } aplus-fsf-4.22/src/dap/slpqwakeup.c0000644000265000001440000000204310772770374012726 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ void slpqwakeup(struct slpq * p, void (*sched) ()) { /* if the slpq is null we fake it cause it doesn't matter */ if (p != (struct slpq *) (0)) { struct node *np; if ((p->wakes <= 0) && ((np = p->wq->f) != p->wq)) { noderemove(np); slpqsched(SLPQENTAT(np), sched); } else if (p->wakes < p->maxwakes) ++(p->wakes); } return; } aplus-fsf-4.22/src/dap/timer.c0000644000265000001440000000255110772770374011656 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include #include #include #include #include /* external function definitions */ struct timer *timer(time_t sec, long int usec, void (*func) (), void *arg) { struct timer *p = (struct timer *) balloc(sizeof(*p)); struct timeval *tvp = &(p->expire); struct timeval interval; struct node *hp = &timers; struct node *np; (p->np = nodealloc())->d = (void *) (p); interval.tv_sec = (long) sec; interval.tv_usec = usec; (void) tvnorm(&interval); (void) tvsum(tod(), &interval, tvp); p->func = func; p->arg = arg; for (np = hp->b; np != hp; np = np->b) { if (tvcmp(tvp, &(TIMERAT(np)->expire)) >= 0) break; } nodeinsert(p->np, np->f); return p; } aplus-fsf-4.22/src/dap/timerabs.c0000644000265000001440000000240710772770374012344 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include #include #include #include /* external function definitions */ struct timer *timerabs(time_t sec, long int usec, void (*func) (), void *arg) { struct timer *p = (struct timer *) balloc(sizeof(*p)); struct timeval *tvp = &(p->expire); struct node *hp = &timers; struct node *np; (p->np = nodealloc())->d = (void *) (p); tvp->tv_sec = (long) sec; tvp->tv_usec = usec; (void) tvnorm(tvp); p->func = func; p->arg = arg; for (np = hp->b; np != hp; np = np->b) { if (tvcmp(tvp, &(TIMERAT(np)->expire)) >= 0) break; } nodeinsert(p->np, np->f); return p; } aplus-fsf-4.22/src/dap/timerclr.c0000644000265000001440000000154710772770374012363 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include #include /* external function definitions */ void timerclr(struct timer * p) { if (p != (struct timer *) (0)) { noderemove(p->np); nodefree(p->np); bfree((char *) p); } return; } aplus-fsf-4.22/src/dap/timernext.c0000644000265000001440000000154410772770374012556 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ struct timeval * timernext(void) { struct timer *p; if ((p = TIMERAT(timers.f)) == (struct timer *) (0)) { return (struct timeval *) (0); } return &(p->expire); } aplus-fsf-4.22/src/dap/timerproc.c0000644000265000001440000000226710772770375012547 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include #include #include /* external function definitions */ int timerproc(void) { struct node *hp = &timers; struct timeval *now = tod(); struct node *np; int didwork = 0; while ((np = hp->f) != hp) { struct timer *tp = TIMERAT(np); struct timeval *tvp = &(tp->expire); if (tvcmp(now, tvp) >= 0) { void (*func) () = tp->func; void *arg = tp->arg; timerclr(tp); if (func != (void (*) ()) (0)) (*func) (arg); } else { break; } didwork = 1; } return didwork; } aplus-fsf-4.22/src/dap/timers.c0000644000265000001440000000147610772770375012047 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* * For timernext() to work, the d member of timers node must be a 0 pointer. */ /* header file inclusions */ #include #include /* external data definitions */ struct node timers = {&timers, &timers, (void *) (0)}; aplus-fsf-4.22/src/dap/tod.c0000644000265000001440000000171310772770375011324 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include #include /* external function definitions */ struct timeval * tod(void) { static char fnc[] = "tod"; struct timeval now; if (gettimeofday(&now, (struct timezone *) (0)) < 0) { Warn("%t %s(): error: gettimeofday(): %m\n", fnc); } else { dap_tod_last = now; } return &dap_tod_last; } aplus-fsf-4.22/src/dap/tod_l.c0000644000265000001440000000160710772770375011641 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* * dap_tod_last is the last time of day returned by the operating system. * Use dap_tod_last.tv_sec to read the seconds and dap_tod_last.tv_usec to * read the micro seconds. */ /* header file inclusions */ #include #include /* external data definitions */ struct timeval dap_tod_last; aplus-fsf-4.22/src/dap/todsec.c0000644000265000001440000000136310772770375012020 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #include /* external function definitions */ time_t todsec(void) { return (time_t) ((tod())->tv_sec); } aplus-fsf-4.22/src/dap/todstring.c0000644000265000001440000000174210772770375012555 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #if !defined(sun) #include #endif #include #include #include /* external function definitions */ char * todstring(time_t t) { struct tm *tm = gmtime(&t); return bgprintf(16, "%04d%02d%02d.%02d%02d%02d", tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec); } aplus-fsf-4.22/src/dap/tr_atoe.c0000644000265000001440000000514710772770375012200 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* ascii to ebcdic translation table */ /* external data definitions */ unsigned char tr_atoe[] = { /* 0 1 2 3 4 5 6 * 7 */ /* 00 */ 0x00, 0x01, 0x02, 0x03, 0x37, 0x2d, 0x2e, 0x2f, /* 08 */ 0x16, 0x05, 0x25, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 10 */ 0x10, 0x11, 0x12, 0x13, 0x3c, 0x3d, 0x32, 0x26, /* 18 */ 0x18, 0x19, 0x3f, 0x27, 0x1c, 0x1d, 0x1e, 0x1f, /* 20 */ 0x40, 0x5a, 0x7f, 0x7b, 0x5b, 0x6c, 0x50, 0x7d, /* 28 */ 0x4d, 0x5d, 0x5c, 0x4e, 0x6b, 0x60, 0x4b, 0x61, /* 30 */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 38 */ 0xf8, 0xf9, 0x7a, 0x5e, 0x4c, 0x7e, 0x6e, 0x6f, /* 40 */ 0x7c, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 48 */ 0xc8, 0xc9, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, /* 50 */ 0xd7, 0xd8, 0xd9, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, /* 58 */ 0xe7, 0xe8, 0xe9, 0xad, 0xe0, 0xbd, 0x5f, 0x6d, /* 60 */ 0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 68 */ 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, /* 70 */ 0x97, 0x98, 0x99, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, /* 78 */ 0xa7, 0xa8, 0xa9, 0xc0, 0x4f, 0xd0, 0xa1, 0x07, /* 80 */ 0x00, 0x01, 0x02, 0x03, 0x37, 0x2d, 0x2e, 0x2f, /* 88 */ 0x16, 0x05, 0x25, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 90 */ 0x10, 0x11, 0x12, 0x13, 0x3c, 0x3d, 0x32, 0x26, /* 98 */ 0x18, 0x19, 0x3f, 0x27, 0x1c, 0x1d, 0x1e, 0x1f, /* a0 */ 0x40, 0x5a, 0x7f, 0x7b, 0x5b, 0x6c, 0x50, 0x7d, /* a8 */ 0x4d, 0x5d, 0x5c, 0x4e, 0x6b, 0x60, 0x4b, 0x61, /* b0 */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* b8 */ 0xf8, 0xf9, 0x7a, 0x5e, 0x4c, 0x7e, 0x6e, 0x6f, /* c0 */ 0x7c, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* c8 */ 0xc8, 0xc9, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, /* d0 */ 0xd7, 0xd8, 0xd9, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, /* d8 */ 0xe7, 0xe8, 0xe9, 0xad, 0xe0, 0xbd, 0x5f, 0x6d, /* e0 */ 0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* e8 */ 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, /* f0 */ 0x97, 0x98, 0x99, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, /* f8 */ 0xa7, 0xa8, 0xa9, 0xc0, 0x4f, 0xd0, 0xa1, 0x07 }; aplus-fsf-4.22/src/dap/tr_etoa.c0000644000265000001440000000514410772770375012175 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* ebcdic to ascii translation table */ /* external data definitions */ unsigned char tr_etoa[] = { /* 0 1 2 3 4 5 6 7 */ /* 00 */ 0x00, 0x01, 0x02, 0x03, 0x9c, 0x09, 0x86, 0x7f, /* 08 */ 0x97, 0x8d, 0x8e, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 10 */ 0x10, 0x11, 0x12, 0x13, 0x9d, 0x0a, 0x08, 0x87, /* 18 */ 0x18, 0x19, 0x92, 0x8f, 0x1c, 0x1d, 0x1e, 0x1f, /* 20 */ 0x80, 0x81, 0x82, 0x83, 0x84, 0x0a, 0x17, 0x1b, /* 28 */ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x05, 0x06, 0x07, /* 30 */ 0x90, 0x91, 0x16, 0x93, 0x94, 0x95, 0x96, 0x04, /* 38 */ 0x98, 0x99, 0x9a, 0x9b, 0x14, 0x15, 0x9e, 0x1a, /* 40 */ 0x20, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, /* 48 */ 0xa7, 0xa8, 0xd5, 0x2e, 0x3c, 0x28, 0x2b, 0x7c, /* 50 */ 0x26, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 58 */ 0xb0, 0xb1, 0x21, 0x24, 0x2a, 0x29, 0x3b, 0x5e, /* 60 */ 0x2d, 0x2f, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 68 */ 0xb8, 0xb9, 0xcb, 0x2c, 0x25, 0x5f, 0x3e, 0x3f, /* 70 */ 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0, 0xc1, /* 78 */ 0xc2, 0x60, 0x3a, 0x23, 0x40, 0x27, 0x3d, 0x22, /* 80 */ 0xc3, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 88 */ 0x68, 0x69, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, /* 90 */ 0xca, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, /* 98 */ 0x71, 0x72, 0x7e, 0x7e, 0xcd, 0xce, 0xcf, 0xd0, /* a0 */ 0xd1, 0x7e, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, /* a8 */ 0x79, 0x7a, 0xd2, 0xd3, 0xd4, 0x5b, 0xd6, 0xd7, /* b0 */ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* b8 */ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0x5d, 0xe6, 0xe7, /* c0 */ 0x7b, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* c8 */ 0x48, 0x49, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, /* d0 */ 0x7d, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, /* d8 */ 0x51, 0x52, 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3, /* e0 */ 0x5c, 0x9f, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, /* e8 */ 0x59, 0x5a, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, /* f0 */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* f8 */ 0x38, 0x39, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff }; aplus-fsf-4.22/src/dap/tr_quadav.c0000644000265000001440000000455110772770375012527 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* ipsa quad-av to ascii translation table */ /* external data definitions */ unsigned char tr_quadav[] = { /* 0 1 2 3 4 5 6 7 */ /* 00 */ '?', '?', '?', '?', '$', '?', '?', '?', /* 08 */ '?', '?', '?', '?', '?', '?', '[', ']', /* 10 */ '(', ')', ';', '/', '\\', '?', '?', '?', /* 18 */ '?', '?', '+', '-', '?', '?', '*', '?', /* 20 */ '?', '?', '?', '?', '<', '?', '=', '?', /* 28 */ '>', '?', '?', '?', '?', '?', '?', ',', /* 30 */ '!', '?', '?', '?', '?', '?', '~', '?', /* 38 */ '?', '?', '?', '?', '?', '_', '?', '?', /* 40 */ '?', '?', '?', '?', '?', '?', '?', '?', /* 48 */ '?', '?', '?', '?', '?', '?', '?', '?', /* 50 */ '?', '?', '{', '}', '?', '?', 'A', 'B', /* 58 */ 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', /* 60 */ 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', /* 68 */ 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', /* 70 */ '?', 'a', 'b', 'c', 'd', 'e', 'f', 'g', /* 78 */ 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', /* 80 */ 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', /* 88 */ 'x', 'y', 'z', '?', '0', '1', '2', '3', /* 90 */ '4', '5', '6', '7', '8', '9', '.', '?', /* 98 */ ' ', '\'', ':', '?', '^', '?', '^', '^', /* a0 */ '?', '?', '?', '?', '?', '?', 'a', 'b', /* a8 */ 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', /* b0 */ 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', /* b8 */ 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', /* c0 */ '?', '?', '!', '?', '?', '|', '\'', '#', /* c8 */ '@', '"', '~', '{', '}', '\\', '%', '&', /* d0 */ '?', '?', '?', '?', '?', '?', '?', '?', /* d8 */ '?', '?', '?', '?', '?', '?', '?', '?', /* e0 */ '?', '?', '?', '?', '?', '?', '?', '?', /* e8 */ '?', '?', '?', '?', '?', '?', '?', '?', /* f0 */ '?', '?', '?', '?', '?', '?', '?', '?', /* f8 */ '?', '?', '?', '?', '?', '?', '?', '?' }; aplus-fsf-4.22/src/dap/trchar.c0000644000265000001440000000142310772770375012017 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* external function definitions */ int trchar(unsigned char *tr, char c) { if (tr != (unsigned char *) (0)) { return (int) tr[(unsigned) (c & 0xff)]; } return (int) ((unsigned) (c & 0xff)); } aplus-fsf-4.22/src/dap/tvcmp.c0000644000265000001440000000761010772770375011671 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* * p1 is compared to p2. If it is earlier, -1 is returned. If it is latter 1 * is returned. If it is the same, 0 is returned. It is assumed that the * inputs are normalized. */ /* header file inclusions */ #include #include /* external function definitions */ int tvcmp(struct timeval * p1, struct timeval * p2) { if (p1->tv_sec < p2->tv_sec) return -1; else if (p1->tv_sec > p2->tv_sec) return 1; else if (p1->tv_usec < p2->tv_usec) return -1; else if (p1->tv_usec > p2->tv_usec) return 1; return 0; } #ifdef UNITTEST /* unit test header file inclusions */ #include #include /* unit test function declarations */ extern int main(); extern void unittest(); /* unit test function definitions */ int main(argc, argv) int argc; char *argv[]; { int count; int printit; if (argc < 2) { count = 1; printit = 1; } else { count = atoi(argv[1]); printit = 0; } while (count-- > 0) { unittest(printit, (long) (0), (long) (500000), (long) (0), (long) (500000)); unittest(printit, (long) (1), (long) (999999), (long) (12), (long) (0)); unittest(printit, (long) (12), (long) (0), (long) (1), (long) (999999)); unittest(printit, (long) (-12), (long) (0), (long) (-1), (long) (999999)); unittest(printit, (long) (-1), (long) (999999), (long) (-12), (long) (0)); unittest(printit, (long) (12), (long) (100), (long) (-12), (long) (99)); unittest(printit, (long) (12), (long) (1), (long) (12), (long) (999999)); unittest(printit, (long) (0x7fffffff), (long) (0), (long) (0), (long) (999999)); unittest(printit, (long) (0x40000000), (long) (0), (long) (0x40000000), (long) (999999)); unittest(printit, (long) (0x3fffffff), (long) (0), (long) (0x40000000), (long) (999999)); unittest(printit, (long) (0x3fffffff), (long) (999999), (long) (0x40000000), (long) (999999)); unittest(printit, (long) (0x3ffffffe), (long) (999999), (long) (0x40000000), (long) (999999)); unittest(printit, (long) (0x3fffffff), (long) (999999), (long) (0xc0000000), (long) (999999)); unittest(printit, (long) (0xbffffffd), (long) (999999), (long) (0xc0000000), (long) (999999)); unittest(printit, (long) (0xbffffffe), (long) (999999), (long) (0xc0000000), (long) (999999)); unittest(printit, (long) (0xbfffffff), (long) (999999), (long) (0xc0000000), (long) (999999)); unittest(printit, (long) (0xc0000000), (long) (999999), (long) (0xc0000000), (long) (999999)); } exit(0); /* NOTREACHED */ } static void unittest(printit, sec1, usec1, sec2, usec2) int printit; long sec1; long usec1; long sec2; long usec2; { struct timeval tv1, tv2; int rc; tv1.tv_sec = sec1; tv1.tv_usec = usec1; tv2.tv_sec = sec2; tv2.tv_usec = usec2; rc = tvcmp(&tv1, &tv2); if (printit) { (void) fprintf(stdout, "tvcmp((%ld, %ld), (%ld, %ld)) = %d\n", sec1, usec1, sec2, usec2, rc); /* Lexa redefines fflush in stdio.h */ /* which results in an unresolved symbol */ #if defined(__edgfe) && defined(fflush) #undef fflush #endif /******************************************/ fflush(stdout); } return; } #endif aplus-fsf-4.22/src/dap/tvdiff.c0000644000265000001440000001125010772770375012015 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* * p2 is subtracted from p1 and the result is placed in p3. 0 is returned if * the operation succeeds. 1 is returned if a positive overflow was * encountered while preparing the result. 2 is returned if negative * overflow was encountered. The inputs are assumed to be normalized. */ /* header file inclusions */ #include #include #include /* external function definitions */ int tvdiff(struct timeval * p1, struct timeval * p2, struct timeval * p3) { static char fnc[] = "tvdiff"; if ((p1->tv_sec < (long) (0)) && (p2->tv_sec > (long) (0))) { p3->tv_sec = p1->tv_sec - p2->tv_sec; if (p3->tv_sec >= (long) (0)) { Warn("%t %s(): warning: negative overflow\n", fnc); p3->tv_sec = INT_MIN; p3->tv_usec = (long) (0); return 2; } p3->tv_usec = p1->tv_usec - p2->tv_usec; } else if ((p1->tv_sec > (long) (0)) && (p2->tv_sec < (long) (0))) { p3->tv_sec = p1->tv_sec - 1; p3->tv_sec -= p2->tv_sec + 1; if (p3->tv_sec < (long) (0)) { /* overflow positive */ Warn("%t %s(): warning: positive overflow\n", fnc); p3->tv_sec = INT_MAX; p3->tv_usec = MILLION_USECS - 1; return 1; } p3->tv_usec = p1->tv_usec + MILLION_USECS; p3->tv_usec -= p2->tv_usec - MILLION_USECS; } else { p3->tv_sec = p1->tv_sec - p2->tv_sec; p3->tv_usec = p1->tv_usec - p2->tv_usec; } return tvnorm(p3); } #ifdef UNITTEST /* unit test header file inclusions */ #include #include /* unit test function declarations */ extern int main(); extern void unittest(); /* unit test function definitions */ int main(argc, argv) int argc; char *argv[]; { int count; int printit; if (argc < 2) { count = 1; printit = 1; } else { count = atoi(argv[1]); printit = 0; } while (count-- > 0) { unittest(printit, (long) (0), (long) (0), (long) (0), (long) (0)); unittest(printit, (long) (-1), (long) (999999), (long) (0), (long) (999999)); unittest(printit, (long) (0), (long) (999999), (long) (-1), (long) (0)); unittest(printit, (long) (-1), (long) (0), (long) (0), (long) (999999)); unittest(printit, (long) (0), (long) (0), (long) (-1), (long) (999999)); unittest(printit, (long) (2), (long) (0), (long) (1), (long) (999999)); unittest(printit, (long) (0x3fffffff), (long) (0), (long) (0xc0000000), (long) (999999)); unittest(printit, (long) (0x40000000), (long) (0), (long) (0xc0000000), (long) (999999)); unittest(printit, (long) (0x40000001), (long) (0), (long) (0xc0000000), (long) (999999)); unittest(printit, (long) (0x40000000), (long) (999999), (long) (0xc0000000), (long) (999999)); unittest(printit, (long) (0x40000001), (long) (999999), (long) (0xc0000000), (long) (999999)); unittest(printit, (long) (0x40000000), (long) (0), (long) (0x3fffffff), (long) (999999)); unittest(printit, (long) (0xc0000000), (long) (0), (long) (0x40000001), (long) (999999)); unittest(printit, (long) (0xc0000000), (long) (0), (long) (0x40000000), (long) (999999)); unittest(printit, (long) (0xc0000000), (long) (0), (long) (0x3fffffff), (long) (999999)); unittest(printit, (long) (0xc0000000), (long) (100), (long) (0x40000000), (long) (101)); } exit(0); /* NOTREACHED */ } static void unittest(printit, sec1, usec1, sec2, usec2) int printit; long sec1; long usec1; long sec2; long usec2; { struct timeval tv1, tv2, tv3; int rc; tv1.tv_sec = sec1; tv1.tv_usec = usec1; tv2.tv_sec = sec2; tv2.tv_usec = usec2; rc = tvdiff(&tv1, &tv2, &tv3); if (printit) { (void) fprintf(stdout, "tvdiff((%ld, %ld), (%ld, %ld), (%ld, %ld)) = %d\n", sec1, usec1, sec2, usec2, tv3.tv_sec, tv3.tv_usec, rc); /* Lexa redefines fflush in stdio.h */ /* which results in an unresolved symbol */ #if defined(__edgfe) && defined(fflush) #undef fflush #endif /******************************************/ fflush(stdout); } return; } #endif aplus-fsf-4.22/src/dap/tvnorm.c0000644000265000001440000001240110772770375012057 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* * If sec_i and usec_i are the initial time value members, and sec_f and * usec_f are the final time value members, then the normalized time value * satisfies 1000000 * sec_f + usec_f = 1000000 * sec_i + usec_i and 0 <= * usec_f < 1000000 Normalization is optimized for normalizing sums and * differences of normalized time values. * * returns 0 if successful returns 1 if normalization caused overflow of * positive time returns 2 if normalization caused overflow of negative time * * The present implementation assumes a signed 2's complement integer * representation for type time_t. Furthermore, it is assumed that integer * addition overflow is not trapped. * * Upon overflow to either positive or negative values, a warning message is * logged and the maximum or minumum possible normalized timeval is * substituted. */ /* header file inclusions */ #include #include #include /* external function definitions */ int tvnorm(struct timeval * p) { static char fnc[] = "tvnorm"; long usec = p->tv_usec; if (usec >= MILLION_USECS) { long sec; if (usec >= (2 * MILLION_USECS)) { /* * usec is not the result of sum of two normalized time values. We * therefore use slow division and remainder to normalize it. */ sec = p->tv_sec + usec / MILLION_USECS; usec %= MILLION_USECS; } else { /* we use fast reduction */ sec = p->tv_sec + 1; usec -= MILLION_USECS; } if (sec < p->tv_sec) { /* overflow positive */ Warn("%t %s(): warning: positive overflow\n", fnc); p->tv_sec = INT_MAX; p->tv_usec = MILLION_USECS - 1; return 1; } p->tv_sec = sec; p->tv_usec = usec; } else if (usec < (long) (0)) { long sec; if ((usec + MILLION_USECS) < (long) (0)) { /* * usec is not the result of diff of two normalized time values. We * therefore use slow division and remainder to normalize it. */ usec = -1 - usec; /* no overflow in two-complement */ sec = (p->tv_sec - 1) - (usec / MILLION_USECS); usec = (MILLION_USECS - 1) - (usec % MILLION_USECS); } else { /* we use fast reduction */ sec = p->tv_sec - 1; usec += MILLION_USECS; } if (sec > p->tv_sec) { /* overflow negative */ Warn("%t %s(): warning: negative overflow\n", fnc); p->tv_sec = INT_MIN; p->tv_usec = (long) (0); return 2; } p->tv_sec = sec; p->tv_usec = usec; } return 0; } #ifdef UNITTEST /* unit test header file inclusions */ #include #include /* unit test function declarations */ extern int main(); extern void unittest(); /* unit test function definitions */ int main(argc, argv) int argc; char *argv[]; { int count; int printit; if (argc < 2) { count = 1; printit = 1; } else { count = atoi(argv[1]); printit = 0; } while (count-- > 0) { unittest(printit, (long) (0), (long) (1000000)); unittest(printit, (long) (0), (long) (1999999)); unittest(printit, (long) (0), (long) (2000000)); unittest(printit, (long) (0), (long) (2999999)); unittest(printit, (long) (0), (long) (3000000)); unittest(printit, (long) (0), (long) (12000000)); unittest(printit, (long) (0), (long) (100000000)); unittest(printit, (long) (0x7fffffff), (long) (1999999)); unittest(printit, (long) (0x7ffffffe), (long) (1999999)); unittest(printit, (long) (0x7ffffffd), (long) (2999999)); unittest(printit, (long) (0), (long) (-1)); unittest(printit, (long) (0), (long) (-999999)); unittest(printit, (long) (0), (long) (-1000000)); unittest(printit, (long) (0), (long) (-1000001)); unittest(printit, (long) (0), (long) (-1999999)); unittest(printit, (long) (0), (long) (-2000000)); unittest(printit, (long) (0), (long) (-2000001)); unittest(printit, (long) (0x80000000), (long) (999999)); unittest(printit, (long) (0x80000000), (long) (1999999)); unittest(printit, (long) (0x80000000), (long) (-1)); unittest(printit, (long) (0x80000001), (long) (-1)); unittest(printit, (long) (0x80000002), (long) (-1000001)); } exit(0); /* NOTREACHED */ } static void unittest(printit, sec, usec) int printit; long sec; long usec; { struct timeval tv; int rc; tv.tv_sec = sec; tv.tv_usec = usec; rc = tvnorm(&tv); if (printit) { (void) fprintf(stdout, "tvnorm((%ld, %ld)-->(%ld, %ld)) = %d\n", sec, usec, tv.tv_sec, tv.tv_usec, rc); /* Lexa redefines fflush in stdio.h */ /* which results in an unresolved symbol */ #if defined(__edgfe) && defined(fflush) #undef fflush #endif /******************************************/ fflush(stdout); } return; } #endif aplus-fsf-4.22/src/dap/tvstring.c0000644000265000001440000000224110772770375012413 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* header file inclusions */ #include #if !defined(sun) #include #endif #include #include #include /* external function definitions */ char * tvstring(struct timeval * p) { if (p == (struct timeval *) (0)) { return bstring("00000000.000000.000000"); } else { struct tm *tm; (void) tvnorm(p); tm = gmtime((const time_t *)&(p->tv_sec) ); return bgprintf(23, "%04d%02d%02d.%02d%02d%02d.%06ld", tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec, p->tv_usec); } } aplus-fsf-4.22/src/dap/tvsum.c0000644000265000001440000001143210772770376011714 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* * p1 is added to p2 and the result is placed in p3. 0 is returned if the * operation succeeds. 1 is returned if a positive overflow was encountered * while preparing the result. 2 is returned if negative overflow was * encountered. The inputs are assumed to be normalized. */ /* header file inclusions */ #include #include #include /* external function definitions */ int tvsum(struct timeval * p1, struct timeval * p2, struct timeval * p3) { static char fnc[] = "tvsum"; if ((p1->tv_sec < (long) (0)) && (p2->tv_sec < (long) (0))) { p3->tv_sec = (p1->tv_sec + 1); p3->tv_sec += (p2->tv_sec + 1); if (p3->tv_sec >= (long) (0)) { Warn("%t %s(): warning: negative overflow\n", fnc); p3->tv_sec = INT_MIN; p3->tv_usec = (long) (0); return 2; } p3->tv_usec = (p1->tv_usec - MILLION_USECS); p3->tv_usec += (p2->tv_usec - MILLION_USECS); } else if ((p1->tv_sec > (long) (0)) && (p2->tv_sec > (long) (0))) { p3->tv_sec = p1->tv_sec + p2->tv_sec; if (p3->tv_sec < (long) (0)) { /* overflow positive */ Warn("%t %s(): warning: positive overflow\n", fnc); p3->tv_sec = INT_MAX; p3->tv_usec = MILLION_USECS - 1; return 1; } p3->tv_usec = p1->tv_usec + p2->tv_usec; } else { p3->tv_sec = p1->tv_sec + p2->tv_sec; p3->tv_usec = p1->tv_usec + p2->tv_usec; } return tvnorm(p3); } #ifdef UNITTEST /* unit test header file inclusions */ #include #include /* unit test function declarations */ extern int main(); extern void unittest(); /* unit test function definitions */ int main(argc, argv) int argc; char *argv[]; { int count; int printit; if (argc < 2) { count = 1; printit = 1; } else { count = atoi(argv[1]); printit = 0; } while (count-- > 0) { unittest(printit, (long) (0), (long) (500000), (long) (0), (long) (500000)); unittest(printit, (long) (1), (long) (999999), (long) (12), (long) (0)); unittest(printit, (long) (12), (long) (0), (long) (1), (long) (999999)); unittest(printit, (long) (-12), (long) (0), (long) (-1), (long) (999999)); unittest(printit, (long) (-1), (long) (999999), (long) (-12), (long) (0)); unittest(printit, (long) (12), (long) (100), (long) (-12), (long) (99)); unittest(printit, (long) (12), (long) (1), (long) (12), (long) (999999)); unittest(printit, (long) (0x7fffffff), (long) (0), (long) (0), (long) (999999)); unittest(printit, (long) (0x40000000), (long) (0), (long) (0x40000000), (long) (999999)); unittest(printit, (long) (0x3fffffff), (long) (0), (long) (0x40000000), (long) (999999)); unittest(printit, (long) (0x3fffffff), (long) (999999), (long) (0x40000000), (long) (999999)); unittest(printit, (long) (0x3ffffffe), (long) (999999), (long) (0x40000000), (long) (999999)); unittest(printit, (long) (0x3fffffff), (long) (999999), (long) (0xc0000000), (long) (999999)); unittest(printit, (long) (0xbffffffd), (long) (999999), (long) (0xc0000000), (long) (999999)); unittest(printit, (long) (0xbffffffe), (long) (999999), (long) (0xc0000000), (long) (999999)); unittest(printit, (long) (0xbfffffff), (long) (999999), (long) (0xc0000000), (long) (999999)); unittest(printit, (long) (0xc0000000), (long) (999999), (long) (0xc0000000), (long) (999999)); } exit(0); /* NOTREACHED */ } static void unittest(printit, sec1, usec1, sec2, usec2) int printit; long sec1; long usec1; long sec2; long usec2; { struct timeval tv1, tv2, tv3; int rc; tv1.tv_sec = sec1; tv1.tv_usec = usec1; tv2.tv_sec = sec2; tv2.tv_usec = usec2; rc = tvsum(&tv1, &tv2, &tv3); if (printit) { (void) fprintf(stdout, "tvsum((%ld, %ld), (%ld, %ld), (%ld, %ld)) = %d\n", sec1, usec1, sec2, usec2, tv3.tv_sec, tv3.tv_usec, rc); /* Lexa redefines fflush in stdio.h */ /* which results in an unresolved symbol */ #if defined(__edgfe) && defined(fflush) #undef fflush #endif /******************************************/ fflush(stdout); } return; } #endif aplus-fsf-4.22/src/dap/ulbetween.c0000644000265000001440000000260710772770376012534 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* * Returns true if test lies in the range from low to high, inclusively. If * low equals high, test must be the same as this common value. If high is * less than low, then it is assumed that high has wrapped through a top * value (ULONG_MAX) and so test must be greater than or equal to low or less * then or equal to high. This is implemented by assuming that we are * dealing with unsigned values. Then the test range is shift back to zero * by subtracting low from test and high. Then is the shifted test value is * less than or equal to the shifted high value, the betweenness test is * passed. Otherwise, it is failed. */ /* external function definitions */ int ulbetween(long unsigned int test, long unsigned int low, long unsigned int high) { if ((test - low) <= (high - low)) return 1; return 0; } aplus-fsf-4.22/src/dap/ultodec.c0000644000265000001440000001252510772770376012201 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* convert unsigned long integer to decimal character string */ /* head file inclusions */ #include /* internal data definitions */ static unsigned long powers[ULTODEC_SZ] = { 0L, /* zero */ 9L, 99L, 999L, /* units, tens, hundreds */ 9999L, 99999L, 999999L, /* thousands */ 9999999L, 99999999L, 999999999L, /* millions */ 0xffffffffL /* sentinel */ }; static char digits[10] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' }; /* external function definitions */ int ultodec(long unsigned int value, char *result, int length) { int place; /* determine number of places to be used */ if (value == 0) { place = 1; } else { for (place = 1; value > powers[place]; place++); } if (place < length) { int rc = place + 1; /* return code */ while (place-- > 0) { unsigned long p = powers[place] + 1; int v; for (v = 0; value >= p; value -= p, v++); *result++ = digits[v]; } *result = '\0'; return rc; } else { /* insufficent space in caller provided string */ return -1; } /* NOTREACHED */ } /* internal function definitions */ #ifdef UNITTEST /* unit test header file inclusions */ #include /* unit test function declarations */ extern int main(); extern void unittest(); /* unit test function definitions */ int main(argc, argv) int argc; char *argv[]; { int length; int count; int printit; if (argc < 2) { length = ULTODEC_SZ; } else { length = atoi(argv[1]); } if (argc < 3) { count = 1; printit = 1; } else { count = atoi(argv[2]); printit = 0; } while (count-- > 0) { unittest((unsigned long) (0), length, printit); unittest((unsigned long) (1), length, printit); unittest((unsigned long) (2), length, printit); unittest((unsigned long) (3), length, printit); unittest((unsigned long) (4), length, printit); unittest((unsigned long) (5), length, printit); unittest((unsigned long) (6), length, printit); unittest((unsigned long) (7), length, printit); unittest((unsigned long) (8), length, printit); unittest((unsigned long) (9), length, printit); unittest((unsigned long) (10), length, printit); unittest((unsigned long) (19), length, printit); unittest((unsigned long) (28), length, printit); unittest((unsigned long) (37), length, printit); unittest((unsigned long) (46), length, printit); unittest((unsigned long) (55), length, printit); unittest((unsigned long) (64), length, printit); unittest((unsigned long) (73), length, printit); unittest((unsigned long) (82), length, printit); unittest((unsigned long) (91), length, printit); unittest((unsigned long) (99), length, printit); unittest((unsigned long) (100), length, printit); unittest((unsigned long) (109), length, printit); unittest((unsigned long) (280), length, printit); unittest((unsigned long) (372), length, printit); unittest((unsigned long) (406), length, printit); unittest((unsigned long) (525), length, printit); unittest((unsigned long) (640), length, printit); unittest((unsigned long) (731), length, printit); unittest((unsigned long) (802), length, printit); unittest((unsigned long) (911), length, printit); unittest((unsigned long) (999), length, printit); unittest((unsigned long) (1000), length, printit); unittest((unsigned long) (9999), length, printit); unittest((unsigned long) (10000), length, printit); unittest((unsigned long) (99999), length, printit); unittest((unsigned long) (100000), length, printit); unittest((unsigned long) (999999), length, printit); unittest((unsigned long) (1000000), length, printit); unittest((unsigned long) (9999999), length, printit); unittest((unsigned long) (10000000), length, printit); unittest((unsigned long) (99999999), length, printit); unittest((unsigned long) (100000000), length, printit); unittest((unsigned long) (999999999), length, printit); unittest((unsigned long) (1000000000), length, printit); unittest((unsigned long) (2000000000), length, printit); unittest((unsigned long) (3000000000), length, printit); unittest((unsigned long) (4000000000), length, printit); } exit(0); /* NOTREACHED */ } static void unittest(value, length, printit) unsigned long value; int length; int printit; { int rc; static char result[ULTODEC_SZ]; result[0] = '\0'; rc = ultodec(value, result, length); if (printit) { (void) fprintf(stdout, "ultodec(%lu, %s, %d) = %d\n", value, result, length, rc); /* Lexa redefines fflush in stdio.h */ /* which results in an unresolved symbol */ #if defined(__edgfe) && defined(fflush) #undef fflush #endif /******************************************/ fflush(stdout); } return; } #endif aplus-fsf-4.22/src/dap/ultohex.c0000644000265000001440000001211210772770376012222 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* convert unsigned long integer to decimal character string */ /* head file inclusions */ #include /* internal data definitions */ static unsigned long powers[ULTOHEX_SZ] = { 0x0L, 0xfL, 0xffL, 0xfffL, 0xffffL, 0xfffffL, 0xffffffL, 0xfffffffL, 0xffffffffL }; static char digits[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; /* external function definitions */ int ultohex(long unsigned int value, char *result, int length) { int place; /* determine number of places to be used */ if (value == 0) { place = 1; } else { for (place = 1; value > powers[place]; place++); } if (place < length) { int rc = place + 1; /* return code */ result[place] = '\0'; while (place-- > 0) { result[place] = digits[value % 16]; value /= 16; } return rc; } else { /* insufficent space in caller provided string */ return -1; } /* NOTREACHED */ } /* internal function definitions */ #ifdef UNITTEST /* unit test header file inclusions */ #include /* unit test function declarations */ extern int main(); extern void unittest(); /* unit test function definitions */ int main(argc, argv) int argc; char *argv[]; { int length; int count; int printit; if (argc < 2) { length = ULTOHEX_SZ; } else { length = atoi(argv[1]); } if (argc < 3) { count = 1; printit = 1; } else { count = atoi(argv[2]); printit = 0; } while (count-- > 0) { unittest((unsigned long) (0x0), length, printit); unittest((unsigned long) (0x1), length, printit); unittest((unsigned long) (0x2), length, printit); unittest((unsigned long) (0x3), length, printit); unittest((unsigned long) (0x4), length, printit); unittest((unsigned long) (0x5), length, printit); unittest((unsigned long) (0x6), length, printit); unittest((unsigned long) (0x7), length, printit); unittest((unsigned long) (0x8), length, printit); unittest((unsigned long) (0x9), length, printit); unittest((unsigned long) (0xa), length, printit); unittest((unsigned long) (0xb), length, printit); unittest((unsigned long) (0xc), length, printit); unittest((unsigned long) (0xd), length, printit); unittest((unsigned long) (0xe), length, printit); unittest((unsigned long) (0xf), length, printit); unittest((unsigned long) (0x10), length, printit); unittest((unsigned long) (0x1f), length, printit); unittest((unsigned long) (0x2e), length, printit); unittest((unsigned long) (0x3d), length, printit); unittest((unsigned long) (0x4c), length, printit); unittest((unsigned long) (0x5b), length, printit); unittest((unsigned long) (0x6a), length, printit); unittest((unsigned long) (0x79), length, printit); unittest((unsigned long) (0x88), length, printit); unittest((unsigned long) (0x97), length, printit); unittest((unsigned long) (0xa6), length, printit); unittest((unsigned long) (0xb5), length, printit); unittest((unsigned long) (0xc4), length, printit); unittest((unsigned long) (0xd3), length, printit); unittest((unsigned long) (0xe2), length, printit); unittest((unsigned long) (0xf1), length, printit); unittest((unsigned long) (0xff), length, printit); unittest((unsigned long) (0x100), length, printit); unittest((unsigned long) (0xfff), length, printit); unittest((unsigned long) (0x1000), length, printit); unittest((unsigned long) (0xffff), length, printit); unittest((unsigned long) (0x10000), length, printit); unittest((unsigned long) (0xfffff), length, printit); unittest((unsigned long) (0x100000), length, printit); unittest((unsigned long) (0xffffff), length, printit); unittest((unsigned long) (0x1000000), length, printit); unittest((unsigned long) (0xfffffff), length, printit); unittest((unsigned long) (0x10000000), length, printit); unittest((unsigned long) (0xffffffff), length, printit); } exit(0); /* NOTREACHED */ } static void unittest(value, length, printit) unsigned long value; int length; int printit; { int rc; static char result[ULTOHEX_SZ]; result[0] = '\0'; rc = ultohex(value, result, length); if (printit) { (void) fprintf(stdout, "ultohex(%lx, %s, %d) = %d\n", value, result, length, rc); /* Lexa redefines fflush in stdio.h */ /* which results in an unresolved symbol */ #if defined(__edgfe) && defined(fflush) #undef fflush #endif /******************************************/ fflush(stdout); } return; } #endif aplus-fsf-4.22/src/dap/ultooct.c0000644000265000001440000001105110772770376012224 /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* contributed by Daniel F. Fisher */ /* convert unsigned long integer to octal character string */ /* head file inclusions */ #include /* internal data definitions */ static unsigned long powers[ULTOOCT_SZ] = { 0L, 07L, 077L, 0777L, 07777L, 077777L, 0777777L, 07777777L, 077777777L, 0777777777L, 07777777777L, 037777777777L }; static char digits[8] = { '0', '1', '2', '3', '4', '5', '6', '7' }; /* external function definitions */ int ultooct(long unsigned int value, char *result, int length) { int place; /* determine number of places to be used */ if (value == 0) { place = 1; } else { for (place = 1; value > powers[place]; place++); } if (place < length) { int rc = place + 1; /* return code */ result[place] = '\0'; while (place-- > 0) { result[place] = digits[value % 8]; value /= 8; } return rc; } else { /* insufficent space in caller provided string */ return -1; } /* NOTREACHED */ } /* internal function definitions */ #ifdef UNITTEST /* unit test header file inclusions */ #include /* unit test function declarations */ extern int main(); extern void unittest(); /* unit test function definitions */ int main(argc, argv) int argc; char *argv[]; { int length; int count; int printit; if (argc < 2) { length = ULTOOCT_SZ; } else { length = atoi(argv[1]); } if (argc < 3) { count = 1; printit = 1; } else { count = atoi(argv[2]); printit = 0; } while (count-- > 0) { unittest((unsigned long) (0), length, printit); unittest((unsigned long) (01), length, printit); unittest((unsigned long) (02), length, printit); unittest((unsigned long) (03), length, printit); unittest((unsigned long) (04), length, printit); unittest((unsigned long) (05), length, printit); unittest((unsigned long) (06), length, printit); unittest((unsigned long) (07), length, printit); unittest((unsigned long) (010), length, printit); unittest((unsigned long) (017), length, printit); unittest((unsigned long) (026), length, printit); unittest((unsigned long) (035), length, printit); unittest((unsigned long) (044), length, printit); unittest((unsigned long) (053), length, printit); unittest((unsigned long) (062), length, printit); unittest((unsigned long) (071), length, printit); unittest((unsigned long) (077), length, printit); unittest((unsigned long) (0100), length, printit); unittest((unsigned long) (0777), length, printit); unittest((unsigned long) (01000), length, printit); unittest((unsigned long) (07777), length, printit); unittest((unsigned long) (010000), length, printit); unittest((unsigned long) (077777), length, printit); unittest((unsigned long) (0100000), length, printit); unittest((unsigned long) (0777777), length, printit); unittest((unsigned long) (01000000), length, printit); unittest((unsigned long) (07777777), length, printit); unittest((unsigned long) (010000000), length, printit); unittest((unsigned long) (077777777), length, printit); unittest((unsigned long) (0100000000), length, printit); unittest((unsigned long) (0777777777), length, printit); unittest((unsigned long) (01000000000), length, printit); unittest((unsigned long) (07777777777), length, printit); unittest((unsigned long) (010000000000), length, printit); unittest((unsigned long) (037777777777), length, printit); } exit(0); /* NOTREACHED */ } static void unittest(value, length, printit) unsigned long value; int length; int printit; { int rc; static char result[ULTOOCT_SZ]; result[0] = '\0'; rc = ultooct(value, result, length); if (printit) { (void) fprintf(stdout, "ultooct(%lo, %s, %d) = %d\n", value, result, length, rc); /* Lexa redefines fflush in stdio.h */ /* which results in an unresolved symbol */ #if defined(__edgfe) && defined(fflush) #undef fflush #endif /******************************************/ fflush(stdout); } return; } #endif aplus-fsf-4.22/src/dap/Warn.h0000644000265000001440000000264710772770376011462 #ifndef included_dap_Warn_h #define included_dap_Warn_h /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* header file inclusions */ #include #if defined(__STDC__) || defined(__cplusplus) || defined(_AIX) #include #endif /* external data declarations */ extern char _ErrBuf[]; /* external function declarations */ #if defined(__STDC__) || defined(__cplusplus) || defined(_AIX) # ifdef __cplusplus extern "C" { # endif extern void vWarn(char *,va_list); extern void Warn(char*,...); extern void Abort(char*,...); extern void Panic(char*,...); extern void Exit(int, char*,...); extern void SetWarn(char*); extern void SetWarnFP(FILE*); extern void SetWarnFunc(void (*f)(char *)); # ifdef __cplusplus } # endif #else extern void Warn(); extern void Abort(); extern void Panic(); extern void Exit(); extern void SetWarn(); extern void SetWarnFP(); extern void SetWarnFunc(); #endif #endif aplus-fsf-4.22/src/dap/args.h0000644000265000001440000000250210772770376011475 #ifndef included_dap_args_h #define included_dap_args_h /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* args functions assume that argc and argv will not be altered * while processing the arguments, thus the check for empty list * or null arguments only occurs at the start of processing of a * given list or argument. */ /* external data declarations */ extern int args_argpos; extern int args_index; extern char *args_value; /* external function declarations */ #if defined(__STDC__) || defined(__cplusplus) || defined(_AIX) # ifdef __cplusplus extern "C" { # endif extern int argsfirst(int, char**); extern int argsgetopt(int, char**,char *); extern void argsnext(int, char**); # ifdef __cplusplus } # endif #else extern int argsfirst(); extern int argsgetopt(); extern void argsnext(); #endif #endif aplus-fsf-4.22/src/dap/ascii.h0000644000265000001440000000630310772770376011634 #ifndef included_dap_ascii_h #define included_dap_ascii_h /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* external macro declarations */ #define ASCII_NUL 0 #define ASCII_SOH 1 #define ASCII_STX 2 #define ASCII_ETX 3 #define ASCII_EOT 4 #define ASCII_ENQ 5 #define ASCII_ACK 6 #define ASCII_BEL 7 #define ASCII_BS 8 #define ASCII_HT 9 #define ASCII_NL 10 #define ASCII_VT 11 #define ASCII_NP 12 #define ASCII_CR 13 #define ASCII_SO 14 #define ASCII_SI 15 #define ASCII_DLE 16 #define ASCII_DC1 17 #define ASCII_DC2 18 #define ASCII_DC3 19 #define ASCII_DC4 20 #define ASCII_NAK 21 #define ASCII_SYN 22 #define ASCII_ETB 23 #define ASCII_CAN 24 #define ASCII_EM 25 #define ASCII_SUB 26 #define ASCII_ESC 27 #define ASCII_FS 28 #define ASCII_GS 29 #define ASCII_RS 30 #define ASCII_US 31 #define ASCII_SP 32 #define ASCII_DEL 127 #define ASCII_NUL_ODD 0 + 128 #define ASCII_SOH_ODD 1 #define ASCII_STX_ODD 2 #define ASCII_ETX_ODD 3 + 128 #define ASCII_EOT_ODD 4 #define ASCII_ENQ_ODD 5 + 128 #define ASCII_ACK_ODD 6 + 128 #define ASCII_BEL_ODD 7 #define ASCII_BS_ODD 8 #define ASCII_HT_ODD 9 + 128 #define ASCII_NL_ODD 10 + 128 #define ASCII_VT_ODD 11 #define ASCII_NP_ODD 12 + 128 #define ASCII_CR_ODD 13 #define ASCII_SO_ODD 14 #define ASCII_SI_ODD 15 + 128 #define ASCII_DLE_ODD 16 #define ASCII_DC1_ODD 17 + 128 #define ASCII_DC2_ODD 18 + 128 #define ASCII_DC3_ODD 19 #define ASCII_DC4_ODD 20 + 128 #define ASCII_NAK_ODD 21 #define ASCII_SYN_ODD 22 #define ASCII_ETB_ODD 23 + 128 #define ASCII_CAN_ODD 24 + 128 #define ASCII_EM_ODD 25 #define ASCII_SUB_ODD 26 #define ASCII_ESC_ODD 27 + 128 #define ASCII_FS_ODD 28 #define ASCII_GS_ODD 29 + 128 #define ASCII_RS_ODD 30 + 128 #define ASCII_US_ODD 31 #define ASCII_SP_ODD 32 #define ASCII_DEL_ODD 127 #define ASCII_NUL_EVEN 0 #define ASCII_SOH_EVEN 1 + 128 #define ASCII_STX_EVEN 2 + 128 #define ASCII_ETX_EVEN 3 #define ASCII_EOT_EVEN 4 + 128 #define ASCII_ENQ_EVEN 5 #define ASCII_ACK_EVEN 6 #define ASCII_BEL_EVEN 7 + 128 #define ASCII_BS_EVEN 8 + 128 #define ASCII_HT_EVEN 9 #define ASCII_NL_EVEN 10 #define ASCII_VT_EVEN 11 + 128 #define ASCII_NP_EVEN 12 #define ASCII_CR_EVEN 13 + 128 #define ASCII_SO_EVEN 14 + 128 #define ASCII_SI_EVEN 15 #define ASCII_DLE_EVEN 16 + 128 #define ASCII_DC1_EVEN 17 #define ASCII_DC2_EVEN 18 #define ASCII_DC3_EVEN 19 + 128 #define ASCII_DC4_EVEN 20 #define ASCII_NAK_EVEN 21 + 128 #define ASCII_SYN_EVEN 22 + 128 #define ASCII_ETB_EVEN 23 #define ASCII_CAN_EVEN 24 #define ASCII_EM_EVEN 25 + 128 #define ASCII_SUB_EVEN 26 + 128 #define ASCII_ESC_EVEN 27 #define ASCII_FS_EVEN 28 + 128 #define ASCII_GS_EVEN 29 #define ASCII_RS_EVEN 30 #define ASCII_US_EVEN 31 + 128 #define ASCII_SP_EVEN 32 + 128 #define ASCII_DEL_EVEN 127 + 128 #endif aplus-fsf-4.22/src/dap/avl.h0000644000265000001440000000450410772770376011327 #ifndef included_dap_avl_h #define included_dap_avl_h /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* external macro declarations */ /* avlwalk() type codes */ #define AVLWALK_PREORDER (0) #define AVLWALK_INORDER (2) #define AVLWALK_POSTORDER (4) #define AVLWALK_LEAF (6) #define AVLWALK_ALL (8) #define AVLWALK_REVERSE (1) /* external struct, union, typedef and enum declarations */ /* avl tree node */ struct avln { struct avln *l; /* left pointer */ struct avln *r; /* right pointer */ int bal; /* balancing: Height(left) - Height(right) */ void *d; /* user data (including key and value) */ }; /* avl tree search structure */ struct avl { struct avln *root; /* pointer to root node of avl tree */ void *(*key)(); /* extract key portion */ void *(*value)(); /* extract value portion */ int (*compare)(); /* key comparison function */ void *(*insert)(); /* insertion notification */ void *(*replace)(); /* replacement notification */ void (*remove)(); /* removal notification */ }; /* external function declarations */ #if defined(__STDC__) || defined(__cplusplus) || defined(_AIX) # ifdef __cplusplus extern "C" { # endif extern struct avl *avlalloc(void *(*)(), void *(*)(), int (*)(), void *(*)(), void *(*)(), void (*)() ); extern void *avlfind(struct avl *,void *); extern void avlfree(struct avl *); extern void *avlinsert(struct avl *,void *,void *); extern void *avlremove(struct avl *,void *); extern void *avlreplace(struct avl *,void *,void *); extern void *avlwalk(struct avl *,int,void *(*)(),void *); # ifdef __cplusplus } # endif #else extern struct avl *avlalloc(); extern void *avlfind(); extern void avlfree(); extern void *avlinsert(); extern void *avlremove(); extern void *avlreplace(); extern void *avlwalk(); #endif #endif aplus-fsf-4.22/src/dap/balloc.h0000644000265000001440000000331610772770376012001 #ifndef included_dap_balloc_h #define included_dap_balloc_h /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #include /* extern macro declarations */ #define bnew(t) (t *)balloc(sizeof(t)) #define bnew_r(t) (t *)balloc_r(sizeof(t)) /* external function declarations */ #if defined(__STDC__) || defined(__cplusplus) || defined(_AIX) # ifdef __cplusplus extern "C" { # endif extern char *bgprintf(int, char *, ...); extern char *bnstring(char *, ...); extern char *bnstring_r(char *, ...); extern char *bstring(const char *); extern char *bstring_r(char *); extern int bstrhash(char *); extern void *balloc(int); extern void *balloc_r(int); extern void *bdup(void *, int); extern void *bdup_r(void *, int); extern void *brealloc(char *, int); extern void *brealloc_r(char *, int); extern void bfree(char *); # ifdef __cplusplus } # endif #else extern char *bgprintf(); extern char *bnstring(); extern char *bnstring_r(); extern char *bstring(); extern char *bstring_r(); extern int bstrhash(); extern void *balloc(); extern void *balloc_r(); extern void *bdup(); extern void *bdup_r(); extern void *brealloc(); extern void *brealloc_r(); extern void bfree(); #endif #endif aplus-fsf-4.22/src/dap/buff.h0000644000265000001440000000561010772770376011466 #ifndef included_dap_buff_h #define included_dap_buff_h /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #include /* external macro declarations */ #define BUFFAT(np) ((struct buff *)((np)->d)) /* external struct, union, typedef and enum declarations */ struct buff { int inc; /* This member is going away */ int ref; char *min; char *get; char *put; char *max; }; /* external function declarations */ #if defined(__STDC__) || defined(__cplusplus) || defined(_AIX) # ifdef __cplusplus extern "C" { # endif extern struct buff *buffalloc(void); extern struct buff *buffalloc_r(void); extern void buffclear(struct buff *p); extern struct buff * bufffrag(struct buff *p, int frag); extern void bufffree(struct buff *p); extern int buffgetc(struct buff *p); extern void buffgprintf(struct buff *p, int size, char *fmt, ...); extern void buffputc(struct buff *p, char c); extern int buffputc_r(struct buff *p, char c); extern void buffputdouble(struct buff *p, double d); extern void buffputint(struct buff *p, int d); extern void buffputlong(struct buff *p, long d); extern void buffputs(struct buff *p, char *s); extern void buffputshort(struct buff *p, short d); extern int buffread(struct buff *p, int fd, int len); extern struct buff * buffref(struct buff *p); extern void buffroom(struct buff *p, int room); extern int buffroom_r(struct buff *p, int room); extern void buffstuff(struct buff *p, char *value, int size); extern int buffstuff_r(struct buff *p, char *value, int size); extern void bufftrim(struct buff *p); extern int buffwrite(struct buff *p, int fd, int len); extern void buffzero(struct buff *p, int size); # ifdef __cplusplus } # endif #else extern struct buff *buffalloc(); extern struct buff *buffalloc_r(); extern void buffclear(); extern struct buff * bufffrag(); extern void bufffree(); extern int buffgetc(); extern void buffgprintf(); extern void buffputc(); extern int buffputc_r(); extern void buffputdouble(); extern void buffputint(); extern void buffputlong(); extern void buffputs(); extern void buffputshort(); extern int buffread(); extern struct buff * buffref(); extern void buffroom(); extern int buffroom_r(); extern void buffstuff(); extern int buffstuff_r(); extern void bufftrim(); extern int buffwrite(); extern void buffzero(); #endif #endif aplus-fsf-4.22/src/dap/chan.h0000644000265000001440000000432110772770376011453 #ifndef included_dap_chan_h #define included_dap_chan_h /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* header file inclusions */ #include #include #include /* external macro declarations */ #define CHANAT(np) ((struct chan *)((np)->d)) /* chanopen() channel type codes */ #define CHAN_R (0) #define CHAN_W (1) #define CHAN_X (2) /* chan priority values */ #define CHAN_PRI_HIGH INT_MAX #define CHAN_PRI_DFLT (0) #define CHAN_PRI_LOW INT_MIN /* external struct, union, typedef and enum declarations */ struct chan { char *name; /* channel name */ int pri; /* processing priority of channel */ struct node *np; /* scheduling node pointer */ fd_set *fds; /* enabled fd set */ fd_set *afds; /* available fd set */ int fd; /* channel file descriptor */ void (*func)(); /* processing function */ void *ccbp; /* channel control block */ }; /* external data declarations */ extern struct node chans; /* external function declarations */ #if defined(__STDC__) || defined(__cplusplus) || defined(_AIX) # ifdef __cplusplus extern "C" { # endif extern struct chan *chanopen( const char *,int,int,int, void (*)(void *), void * ); extern void chanclose( struct chan * ); extern void chandsbl( struct chan * ); extern void chanenbl( struct chan * ); extern int chanisdsbl( struct chan * ); extern int chanisenbl( struct chan * ); extern int chanproc(); extern void chansetpri( struct chan *, int); # ifdef __cplusplus } # endif #else extern struct chan *chanopen(); extern void chanclose(); extern void chandsbl(); extern void chanenbl(); extern int chanisdsbl(); extern int chanisenbl(); extern int chanproc(); extern void chansetpri(); #endif #endif aplus-fsf-4.22/src/dap/conn.h0000644000265000001440000000654710772770376011513 #ifndef included_dap_conn_h #define included_dap_conn_h /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* header file inclusions */ #include #include #include #ifdef PRESUNOS4 # ifndef _SOCKET_ # define _SOCKET_ # include # endif #else # include #endif #include #include #include /* external macro declarations */ /* conn retry values */ #define CONN_RETRY_NO (0) #define CONN_RETRY_YES (1) /* external struct, union, typedef and enum declarations */ struct conn { /* configuration information */ char *name; /* connection identification name */ int pri; /* connection establishment priority */ int retry; /* retry connection after failure */ int domain; /* socket address domain */ int type; /* socket type */ int protocol; /* socket protocol */ void *r_nameinfo; /* remote name information */ int (*setupfunc)(); /* user setup function */ struct sockaddr *(*r_namefunc)(); /* r_nameinfo to r_name */ int (*estbfunc)(); /* establishment notification func */ void *acb; /* application's control block */ /* state information */ struct exbo *retry_time; /* retry time limit with back-off */ struct timer *retry_tp; /* retry timer */ int fd; /* file descriptor */ int r_namelen; /* remote name length */ struct sockaddr *r_name; /* remote name */ struct chan *estbchan; /* connection establishment channel */ int estbd; /* established */ /* administrative information */ time_t alloctod; /* time connection was allocated */ time_t opentod; /* time connection was opened */ time_t conntod; /* time connection was attempted */ time_t estbtod; /* time connection was established */ time_t disctod; /* time connection was disconnected */ time_t closetod; /* time connection was closed */ time_t opendtime; /* seconds opened in prev instances */ time_t estbdtime; /* seconds estbd in prev instances */ unsigned opencount; /* number of times opened */ unsigned conncount; /* number of times connected */ unsigned estbcount; /* number of times established */ unsigned disccount; /* number of times disconnected */ unsigned closecount; /* number of times closed */ }; /* external function declarations */ #if defined(__STDC__) || defined(__cplusplus) || defined(_AIX) # ifdef __cplusplus extern "C" { # endif extern void connackestb(struct conn *); extern struct conn *connalloc( char *,int,int,int,int,int,int,int, void *, int (*)(),struct sockaddr *(*)(), int (*)(),void *); extern void connclose(struct conn *); extern void connfree(struct conn *); extern void connopen(struct conn *); # ifdef __cplusplus } # endif #else extern void connackestb(); extern struct conn *connalloc(); extern void connclose(); extern void connfree(); extern void connopen(); #endif #endif aplus-fsf-4.22/src/dap/dap.h0000644000265000001440000000211110772770376011301 #ifndef included_dap_dap_h #define included_dap_dap_h /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* header file inclusions */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #endif aplus-fsf-4.22/src/dap/exbo.h0000644000265000001440000000237410772770376011505 #ifndef included_dap_exbo_h #define included_dap_exbo_h /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* external struct, union, typedef and enum declarations */ struct exbo { unsigned negative; unsigned first; unsigned current; unsigned last; }; /* external function declarations */ #if defined(__STDC__) || defined(__cplusplus) || defined(_AIX) # ifdef __cplusplus extern "C" { # endif extern struct exbo *exboalloc(int,int); extern int exbobackoff(struct exbo *); extern void exbofree(struct exbo *); extern int exboreset(struct exbo *); extern int exbovalue(struct exbo *); # ifdef __cplusplus } # endif #else extern struct exbo *exboalloc(); extern int exbobackoff(); extern void exbofree(); extern int exboreset(); extern int exbovalue(); #endif #endif aplus-fsf-4.22/src/dap/fds.h0000644000265000001440000000412010772770377011314 #ifndef included_dap_fds_h #define included_dap_fds_h /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* header file inclusions */ #include #include /* external data declarations */ extern int fds_howmany; extern int fds_size; extern int fds_sizeof; extern fd_set *fds_all; extern fd_set *fds_none; extern fd_set *fds_r; extern fd_set *fds_ra; extern fd_set *fds_w; extern fd_set *fds_wa; extern fd_set *fds_x; extern fd_set *fds_xa; /* external function declarations */ #if defined(__STDC__) || defined(__cplusplus) || defined(_AIX) || defined(linux) # ifdef __cplusplus extern "C" { # endif extern fd_set *fdsalloc( void ); extern fd_set *fdsalloc_r( void ); extern int fdsanyset( fd_set * ); extern void fdsclr( fd_set *, int ); extern void fdscopy( fd_set *, fd_set * ); extern fd_set *fdsdup( fd_set * ); extern fd_set *fdsdup_r( fd_set * ); extern void fdsfree( fd_set * ); extern void fdsfresh( int fd ); extern void fdsinit( void ); extern int fdsisset( fd_set *, int ); extern void fdsset( fd_set *, int ); extern void fdsterm( void ); extern void fdszero( fd_set * ); # ifdef __cplusplus } # endif #else extern fd_set *fdsalloc(); extern fd_set *fdsalloc_r(); extern int fdsanyset(); extern void fdsclr(); extern void fdscopy(); extern fd_set *fdsdup(); extern fd_set *fdsdup_r(); extern void fdsfree(); extern void fdsfresh(); extern void fdsinit(); extern int fdsisset(); extern void fdsset(); extern void fdsterm(); extern void fdszero(); #endif #endif #ifndef __FDS_BITS #define __FDS_BITS(set) ((set)->fds_bits) #endif aplus-fsf-4.22/src/dap/fletch.h0000644000265000001440000000301310772770377012005 #ifndef included_dap_fletch_h #define included_dap_fletch_h /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* external struct, union, typedef and enum declarations */ struct fletch { int c0; /* current c0 counter value */ int c1; /* current c1 counter value */ int modfreq; /* frequency of mod operations */ int tilmod; /* number of bytes til next mod operation */ }; /* external function declarations */ #if defined(__STDC__) || defined(__cplusplus) || defined(_AIX) # ifdef __cplusplus extern "C" { # endif extern struct fletch *fletchalloc(void); extern void fletchfree(struct fletch *); extern void fletchsum(struct fletch *,char *,int); extern int fletchcheck(char *,int,int); extern void fletchdone(struct fletch *,char *,int,int); extern void fletchpatch(char *,int,char *,int,int); # ifdef __cplusplus } # endif #else extern struct fletch *fletchalloc(); extern void fletchfree(); extern void fletchsum(); extern int fletchcheck(); extern void fletchdone(); extern void fletchpatch(); #endif #endif aplus-fsf-4.22/src/dap/hash.h0000644000265000001440000000365410772770377011476 #ifndef included_dap_hash_h #define included_dap_hash_h /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* header file inclusions */ #include /* external macro declarations */ #define HASH_TBLSZ (5021) /* default hash table size */ /* external struct, union, typedef and enum declarations */ struct hash { struct node *tbl; /* hash table */ int tblsz; /* hash table size */ int (*hashfunc)(); void *(*value)(); struct node *(*find)(); struct node *(*insert)(); void (*replace)(); void (*remove)(); }; /* external function declarations */ #if defined(__STDC__) || defined(__cplusplus) || defined(_AIX) # ifdef __cplusplus extern "C" { # endif extern struct hash *hashalloc( int,int (*)(),void *(*)(), struct node *(*)(), struct node *(*)(),void (*)(), void (*)() ); extern void *hashfind(struct hash *,void *); extern void hashfree(struct hash *); extern void *hashinsert(struct hash *,void *,void *); extern struct node *hashnode(struct hash *,void *); extern void *hashremove(struct hash *,void *); extern void *hashreplace(struct hash *,void *,void *); extern void *hashwalk(struct hash *,void*(*)(),void *); # ifdef __cplusplus } # endif #else extern struct hash *hashalloc(); extern void *hashfind(); extern void hashfree(); extern void *hashinsert(); extern struct node *hashnode(); extern void *hashremove(); extern void *hashreplace(); extern void *hashwalk(); #endif #endif aplus-fsf-4.22/src/dap/hpp.h0000644000265000001440000000255210772770377011336 #ifndef included_dap_hpp_h #define included_dap_hpp_h /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* header file inclusions */ #include #include #include /* external struct, union, typedef and enum declarations */ struct hpp { char *host; /* hostname */ unsigned short port; /* port number */ }; /* external function declarations */ #if defined(__STDC__) || defined(__cplusplus) || defined(_AIX) # ifdef __cplusplus extern "C" { # endif extern struct hpp *hppalloc(char *, unsigned short); extern void hppfree(struct hpp *); extern struct hpp *hppmake_in(struct sockaddr_in *); extern struct sockaddr_in *hppname_in(struct hpp *,int *); # ifdef __cplusplus } # endif #else extern struct hpp *hppalloc(); extern void hppfree(); extern struct hpp *hppmake_in(); extern struct sockaddr_in *hppname_in(); #endif #endif aplus-fsf-4.22/src/dap/kvp.h0000644000265000001440000000315410772770377011346 #ifndef included_dap_kvp_h #define included_dap_kvp_h /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* header file inclusions */ #include /* external macro declarations */ #define KVPAT(np) ((struct kvp *)((np)->d)) /* external struct, union, typedef and enum declarations */ /* key value pair */ struct kvp { void *key; void *d; }; /* external function declarations */ #if defined(__STDC__) || defined(__cplusplus) || defined(_AIX) # ifdef __cplusplus extern "C" { # endif extern struct kvp *kvpalloc(void *,void *); extern struct node *kvpfind(struct node *,char *); extern void kvpfree(struct kvp *); extern struct node *kvpinsert(struct node *,void *,void *); extern void *kvpkey(struct node *); extern void kvpremove(struct node *); extern void kvpreplace(struct node *,void *); extern void *kvpvalue(struct node *); # ifdef __cplusplus } # endif #else extern struct kvp *kvpalloc(); extern struct node *kvpfind(); extern void kvpfree(); extern struct node *kvpinsert(); extern void *kvpkey(); extern void kvpremove(); extern void kvpreplace(); extern void *kvpvalue(); #endif #endif aplus-fsf-4.22/src/dap/lstn.h0000644000265000001440000000640710772770377011532 #ifndef included_dap_lstn_h #define included_dap_lstn_h /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* header file inclusions */ #include #include #include #ifdef PRESUNOS4 # ifndef _SOCKET_ # define _SOCKET_ # include # endif #else # include #endif #include #include #include /* external macro declarations */ /* lstn retry values */ #define LSTN_RETRY_NO (0) #define LSTN_RETRY_YES (1) /* external struct, union, typedef and enum declarations */ struct lstn { /* configuration information */ char *name; /* listener's name */ int pri; /* connection accept priority */ int retry; /* retry listening after failure */ int domain; /* socket address domain */ int type; /* socket type */ int protocol; /* socket protocol */ int r_namelen; /* maximum remote name len on accept */ void *l_nameinfo; /* local name information */ int (*l_namefunc)(); /* l_nameinfo to l_name func */ int (*l_regfunc)(); /* local name registration function */ void (*acptfunc)(); /* connection accept function */ void *acb; /* application's control block */ /* state information */ struct exbo *retry_time; /* retry time limit with back-off */ struct timer *retry_tp; /* retry timer */ int fd; /* file descriptor */ int l_namelen; /* local name length */ struct sockaddr *l_name; /* local name */ struct chan *acptchan; /* connection accept channel */ /* administrative information */ time_t alloctod; /* time listener was allocated */ time_t opentod; /* time listener was opened */ time_t lstntod; /* time listener started listening */ time_t acpttod; /* time of last accept */ time_t deaftod; /* time of listener stopped listening */ time_t closetod; /* time of last close */ time_t opendtime; /* seconds opened in prev instances */ time_t lstndtime; /* seconds listened in prev instnaces */ unsigned opencount; /* number of times opened */ unsigned lstncount; /* number of times listening */ unsigned acptcount; /* number of connections accepted */ unsigned deafcount; /* number of times stopped listening */ unsigned closecount; /* number of times closed */ }; /* external function declarations */ #if defined(__STDC__) || defined(__cplusplus) || defined(_AIX) # ifdef __cplusplus extern "C" { # endif extern struct lstn *lstnalloc( char *,int,int,int,int,int,int,int,int, void *,int (*)(),int (*)(),void (*)(),void * ); extern void lstnclose(struct lstn *); extern void lstnfree(struct lstn *); extern void lstnopen(struct lstn *); # ifdef __cplusplus } # endif #else extern struct lstn *lstnalloc(); extern void lstnclose(); extern void lstnfree(); extern void lstnopen(); #endif #endif aplus-fsf-4.22/src/dap/misc.h0000644000265000001440000000507010772770377011500 #ifndef included_dap_misc_h #define included_dap_misc_h /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* header file inclusions */ #include #include #include #ifdef PRESUNOS4 # ifndef _SOCKET_ # define _SOCKET_ # include # endif #else # include #endif #include #include #include /* external macro declarations */ #define CHARAT(np) ((char *)((np)->d)) #define UINTAT(np) ((unsigned)((np)->d)) /* round v to r, the lim inf { i : ((i % m) == 0) && (i >= v)} */ #define MODRNDUP(v, m) (((v) + (m)) - (1 + ((((v) + (m)) - 1) % (m)))) /* external data declarations */ extern int dapbreak; extern int dapInitialized; extern int dapZeroTimeout; extern char hostname_l[]; extern int parity[]; /* external function declarations */ #if defined(__STDC__) || defined(__cplusplus) || defined(_AIX) # ifdef __cplusplus extern "C" { # endif extern int BcdPack( char *,int, unsigned char * ); extern int BcdUnpack( unsigned char *, int, char * ); extern int PrAscDecode( int, struct buff *,int ); extern void PrAscEncode( int, struct buff * ); extern void daploop(void); extern void dapselect(); extern void dapterm(); extern int dapversion(); extern void doclose(int); extern int doread(int, char *, int ); extern int doselect( int, fd_set *, fd_set *, fd_set *, struct timeval * ); extern int dowrite( int, char *, int ); extern char *hostname(); extern int mod255(); extern void noop(); extern struct sockaddr_in *servname_in( char *, int * ); extern int ulbetween(); # ifdef __cplusplus } # endif #else extern int BcdPack(); extern int BcdUnpack(); extern int PrAscDecode(); extern void PrAscEncode(); extern void daploop(); extern void dapselect(); extern void dapterm(); extern int dapversion(); extern void doclose(); extern int doread(); extern int doselect(); extern int dowrite(); extern char *hostname(); extern int mod255(); extern void noop(); extern struct sockaddr_in *servname_in(); extern int ulbetween(); #endif #endif aplus-fsf-4.22/src/dap/mtm.h0000644000265000001440000000337510772770377011350 #ifndef included_dap_mtm_h #define included_dap_mtm_h /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* many to many relationships */ /* header file inclusions */ #include /* external macro declarations */ #define MTMAT(np) ((struct mtm *)((np)->d)) /* external struct, union, typedef and enum declarations */ struct mtm { struct node *unp; void *up; struct node *dnp; void *dp; void *d; }; /* external function declarations */ #if defined(__STDC__) || defined(__cplusplus) || defined(_AIX) # ifdef __cplusplus extern "C" { # endif extern struct mtm *mtmalloc(void *); extern void mtmdnins(struct mtm *,struct node *,void *); extern void mtmdnrm(struct mtm *); extern void mtmfree(struct mtm *); extern struct mtm *mtmlink(struct node *,void *,struct node *, void *,void *); extern void mtmunlink(struct mtm *); extern void mtmupins(struct mtm *,struct node *,void *); extern void mtmuprm(struct mtm *); extern void *mtmvalue(struct node *); # ifdef __cplusplus } # endif #else extern struct mtm *mtmalloc(); extern void mtmdnins(); extern void mtmdnrm(); extern void mtmfree(); extern struct mtm *mtmlink(); extern void mtmunlink(); extern void mtmupins(); extern void mtmuprm(); extern void *mtmvalue(); #endif #endif aplus-fsf-4.22/src/dap/node.h0000644000265000001440000000274510772770377011500 #ifndef included_dap_node_h #define included_dap_node_h /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* external macro declarations */ #define NODEAT(np) ((struct node *)((np)->d)) /* external struct, union, typedef and enum declarations */ struct node { struct node *f; struct node *b; void *d; }; /* external function declarations */ #if defined(__STDC__) || defined(__cplusplus) || defined(_AIX) # ifdef __cplusplus extern "C" { # endif extern struct node *nodealloc(void); extern struct node *nodealloc_r(void); extern void nodefree(struct node *); extern void nodeinsert(struct node *,struct node *); extern void noderemove(struct node *); extern void nodesort(struct node *,int (*)()); extern void nodetoad(struct node *); # ifdef __cplusplus } # endif #else extern struct node *nodealloc(); extern struct node *nodealloc_r(); extern void nodefree(); extern void nodeinsert(); extern void noderemove(); extern void nodesort(); extern void nodetoad(); #endif #endif aplus-fsf-4.22/src/dap/notsunos4.h0000644000265000001440000000406010772770377012517 #ifndef included_dap_notsunos4_h #define included_dap_notsunos4_h /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* header file inclusions */ #ifndef FD_SET # ifdef _AIX # include # else /* external macro declarations */ # define PRESUNOS4 /* Pre-SunOS 4.0 */ /* The following is taken from on SunOS 4.0. * It is necessary because fd_set's are not used. */ # define NBBY 8 /* number of bits in a byte */ /* * Select uses bit masks of file descriptors in longs. * These macros manipulate such bit fields (the filesystem * macros use chars). FD_SETSIZE may be defined by the user, * but the default here should be >= NOFILE (param.h). */ # ifndef FD_SETSIZE /* this coincides with SUNOS 3.5 definition of fd_set */ # define FD_SETSIZE (sizeof(int) * NBBY) # endif # define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask */ # ifndef howmany # ifdef sun386 # define howmany(x, y) \ ((((unsigned int)(x))+(((unsigned int)(y))-1))/((unsigned int)(y))) # else # define howmany(x, y) (((x)+((y)-1))/(y)) # endif # endif # define FD_SET(n, p) \ ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS))) # define FD_CLR(n, p) \ ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS))) # define FD_ISSET(n, p) \ ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS))) # define FD_ZERO(p) bzero((char *)(p), sizeof(*(p))) /* external struct, union, typedef and enum declarations */ /* this coincides with SUNOS 3.5 usage, SUNOS 4.0 uses long */ typedef int fd_mask; # endif #endif #endif aplus-fsf-4.22/src/dap/remprog.h0000644000265000001440000000262510772770377012223 #ifndef included_dap_remprog_h #define included_dap_remprog_h /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* external struct, union, typedef and enum declarations */ typedef struct remprog { char *rp_host; long rp_prognum; char *rp_proto; } remprog_t; typedef struct { int count; int index; char *name; char *host; char *protocol; long program; remprog_t *rp, *rpp; } ServEnt; #if defined(__STDC__) || defined(__cplusplus) || defined(_AIX) # ifdef __cplusplus extern "C" { # endif extern int GetService( char * ); extern int NextService( char **, long *, char ** ); extern int NextServ( ServEnt * ); extern int get_service_by_name( char *,char **,long *, char ** ); extern ServEnt *GetServ( char * ); # ifdef __cplusplus } # endif #else extern int GetService(); extern int NextService(); extern int NextServ(); extern int get_service_by_name(); extern ServEnt *GetServ(); #endif #endif aplus-fsf-4.22/src/dap/sgnl.h0000644000265000001440000000266310772770377011515 #ifndef included_dap_sgnl_h #define included_dap_sgnl_h /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* header file inclusions */ #include #ifndef NSIG #define NSIG _sys_nsig #endif /* external struct, union, typedef and enum declarations */ struct sgnl { int set; #if defined(HAVE_SIGACTION) struct sigaction orig; #else struct sigvec orig; #endif int flag; void (*func)(); }; /* external data declarations */ extern struct sgnl sgnls[]; /* external function declarations */ #if defined(__STDC__) || defined(__cplusplus) || defined(_AIX) # ifdef __cplusplus extern "C" { # endif extern void sgnlcatch(int,void (*)()); extern void sgnldefault(int); extern void sgnlignore(int); extern void sgnloriginal(int); extern int sgnlproc(void); # ifdef __cplusplus } # endif #else extern void sgnlcatch(); extern void sgnldefault(); extern void sgnlignore(); extern void sgnloriginal(); extern int sgnlproc(); #endif #endif aplus-fsf-4.22/src/dap/slpq.h0000644000265000001440000000424310772770377011525 #ifndef included_dap_slpq_h #define included_dap_slpq_h /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* header file inclusions */ #include /* external macro declarations */ #define SLPQENTAT(np) ((struct slpqent *)((np)->d)) /* external struct, union, typedef and enum declarations */ /* structure for saving sleep queue state information */ struct slpq { struct node *wq; /* queue of waiting callbacks */ int wakes; /* number unmatched signals */ int maxwakes; /* maximum unmatched signals allowed */ }; /* structure for saving callback information */ struct slpqent { struct node *np; /* queueing node */ struct slpq *sp; /* pointer to sleep queue */ void (*func)(); /* callback function */ void *arg; /* callback function argument */ int sched; /* whether it is already scheduled */ }; /* external data declarations */ extern struct node slpqents; /* external function declarations */ #if defined(__STDC__) || defined(__cplusplus) || defined(_AIX) # ifdef __cplusplus extern "C" { # endif extern struct slpq *slpqalloc(int,int); extern void slpqfree( struct slpq *); extern void slpqgiveup(struct slpqent *); extern void slpqimmed(void (*)(),void *); extern int slpqproc(void); extern void slpqsched(struct slpqent *,void (*)()); extern struct slpqent *slpqsleep(struct slpq *,void (*)(), void *,void (*)() ); extern void slpqwakeup( struct slpq *,void (*)()); # ifdef __cplusplus } # endif #else extern struct slpq *slpqalloc(); extern void slpqfree(); extern void slpqgiveup(); extern void slpqimmed(); extern int slpqproc(); extern void slpqsched(); extern struct slpqent *slpqsleep(); extern void slpqwakeup(); #endif #endif aplus-fsf-4.22/src/dap/timer.h0000644000265000001440000000311210772770377011660 #ifndef included_dap_timer_h #define included_dap_timer_h /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* header file inclusions */ #include #include #include #include /* external macro declarations */ #define TIMERAT(np) ((struct timer *)((np)->d)) /* external struct, union, typedef and enum declarations */ struct timer { struct node *np; struct timeval expire; void (*func)(); void *arg; }; /* external data declarations */ extern struct node timers; /* external function declarations */ #if defined(__STDC__) || defined(__cplusplus) || defined(_AIX) # ifdef __cplusplus extern "C" { # endif extern struct timer *timer(time_t,long,void (*)(void *),void *); extern struct timer *timerabs(time_t,long,void (*)(),void *); extern void timerclr(struct timer *); extern struct timeval *timernext(void); extern int timerproc(void); # ifdef __cplusplus } # endif #else extern struct timer *timer(); extern struct timer *timerabs(); extern void timerclr(); extern struct timeval *timernext(); extern int timerproc(); #endif #endif aplus-fsf-4.22/src/dap/tod.h0000644000265000001440000000217210772770400011316 #ifndef included_dap_tod_h #define included_dap_tod_h /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* header file inclusions */ #include #include #include /* external data declarations */ extern struct timeval dap_tod_last; /* external function declarations */ #if defined(__STDC__) || defined(__cplusplus) || defined(_AIX) # ifdef __cplusplus extern "C" { # endif extern struct timeval *tod(void); extern time_t todsec(void); extern char *todstring(time_t); # ifdef __cplusplus } # endif #else extern struct timeval *tod(); extern time_t todsec(); extern char *todstring(); #endif #endif aplus-fsf-4.22/src/dap/tr.h0000644000265000001440000000221210772770400011150 #ifndef included_dap_tr_h #define included_dap_tr_h /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* external macro declarations */ #define TRCHAR(tr, c) ((int)((tr)[(unsigned)((c)&0xff))) /* external data declarations */ extern unsigned char tr_atoe[]; extern unsigned char tr_etoa[]; extern unsigned char tr_quadav[]; /* external function declarations */ #if defined(__STDC__) || defined(__cplusplus) || defined(_AIX) # ifdef __cplusplus extern "C" { # endif extern int trchar(unsigned char *, char); /* translate char using table */ # ifdef __cplusplus } # endif #else extern int trchar(); /* translate char using table */ #endif #endif aplus-fsf-4.22/src/dap/tv.h0000644000265000001440000000233010772770400011155 #ifndef included_dap_tv_h #define included_dap_tv_h /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* header file inclusions */ #include /* external macro declarations */ #define MILLION_USECS ((long)(1000000)) /* external function declarations */ #if defined(__STDC__) || defined(__cplusplus) || defined(_AIX) # ifdef __cplusplus extern "C" { # endif extern int tvdiff(struct timeval *,struct timeval *,struct timeval *); extern int tvnorm(struct timeval *); extern char *tvstring(struct timeval *); extern int tvsum(struct timeval *,struct timeval *,struct timeval *); # ifdef __cplusplus } # endif #else extern int tvdiff(); extern int tvnorm(); extern char *tvstring(); extern int tvsum(); #endif #endif aplus-fsf-4.22/src/dap/ulto.h0000644000265000001440000000233710772770400011516 #ifndef included_dap_ulto_h #define included_dap_ulto_h /*****************************************************************************/ /* */ /* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* external macro declarations */ #define ULTOHEX_SZ 9 /* longest hex string for unsigned long */ #define ULTODEC_SZ 11 /* longest decimal string for unsigned long */ #define ULTOOCT_SZ 12 /* longest octal string for unsigned long */ /* external function declarations */ #if defined(__STDC__) || defined(__cplusplus) || defined(_AIX) # ifdef __cplusplus extern "C" { # endif extern int ultodec(unsigned long,char *,int); extern int ultohex(unsigned long,char *,int); extern int ultooct(unsigned long,char *,int); # ifdef __cplusplus } # endif #else extern int ultodec(); extern int ultohex(); extern int ultooct(); #endif #endif aplus-fsf-4.22/src/MSGUI/0000777000265000001440000000000010774512631010563 5aplus-fsf-4.22/src/MSGUI/Makefile.am0000444000265000001440000001742207235624325012541 ## Process this file with automake to produce Makefile.in ############################################################################### ## ## ## Copyright (c) 2001 Morgan Stanley Dean Witter & Co. All rights reserved. ## ## See .../src/LICENSE for terms of distribution. ## ## ## ## ## ############################################################################### lib_LTLIBRARIES = libMSGUI.la libMSGUI_la_SOURCES = \ At.C \ MSActionBox.C \ MSActionButton.C \ MSApplication.C \ MSArrayView.C \ MSArrow.C \ MSArrowButton.C \ MSAttrValue.C \ MSBackingStorePixmap.C \ MSBoolEntryField.C \ MSBoolView.C \ MSBusy.C \ MSButton.C \ MSCascadeMenu.C \ MSCascadeMenuItem.C \ MSCheckBox.C \ MSCheckButton.C \ MSCheckMenuItem.C \ MSCheckPopupMenu.C \ MSCollapsibleLayout.C \ MSColorCycle.C \ MSColorManager.C \ MSComboBox.C \ MSComboField.C \ MSComposite.C \ MSCompositeField.C \ MSCompositeFieldBox.C \ MSCompositeText.C \ MSDateEntryField.C \ MSDelimiterList.C \ MSDisplayCursor.C \ MSDisplayPrint.C \ MSDisplayServer.C \ MSDoubleClick.C \ MSEntryField.C \ MSEntryFieldCombo.C \ MSEntryFieldPlus.C \ MSFloatArrayView.C \ MSFloatEntryField.C \ MSFloatMatrixTraceSet.C \ MSFloatMatrixView.C \ MSFloatTableColumn.C \ MSFloatVectorTraceSet.C \ MSFontManager.C \ MSFontObject.C \ MSGC.C \ MSGraph.C \ MSGraphPlot.C \ MSGraphUI.C \ MSHGauge.C \ MSHLayout.C \ MSHPane.C \ MSHScale.C \ MSHScrollBar.C \ MSHSeparator.C \ MSIcon.C \ MSIconButton.C \ MSIntArrayView.C \ MSIntCheckBox.C \ MSIntEntryField.C \ MSIntMatrixTraceSet.C \ MSIntMatrixView.C \ MSIntRadioBox.C \ MSIntTableColumn.C \ MSIntVectorTraceSet.C \ MSKeyCallback.C \ MSKeyPress.C \ MSKeyTableData.C \ MSKeyTranslationTable.C \ MSLabel.C \ MSLabelFormat.C \ MSLabelOut.C \ MSLayout.C \ MSLayoutManager.C \ MSList.C \ MSManager.C \ MSMenu.C \ MSMenuBar.C \ MSMenuBarItem.C \ MSMenuItem.C \ MSMenuShell.C \ MSModalPopup.C \ MSModelCheckBox.C \ MSMoneyEntryField.C \ MSMonthView.C \ MSNotebook.C \ MSNumericArrayView.C \ MSOptionMenu.C \ MSPage.C \ MSPane.C \ MSParagraph.C \ MSPixmap.C \ MSPopup.C \ MSPopupMenu.C \ MSPostScript.C \ MSPrimitive.C \ MSPrimitiveText.C \ MSPrintColumn.C \ MSPrintDisclaimer.C \ MSPrintFont.C \ MSPrintFontData.C \ MSPrintHeaders.C \ MSPrintItem.C \ MSPrintManager.C \ MSPulldownMenu.C \ MSRadioBox.C \ MSRadioButton.C \ MSRadioMenuItem.C \ MSRateEntryField.C \ MSRect.C \ MSReport.C \ MSReportTable.C \ MSRowColumnView.C \ MSScale.C \ MSScrollBar.C \ MSScrollableWidget.C \ MSScrolledWindow.C \ MSSeparator.C \ MSSeparatorMenuItem.C \ MSShadow.C \ MSShell.C \ MSStringDelimiterList.C \ MSStringEntryField.C \ MSStringList.C \ MSStringPopupMenu.C \ MSStringTableColumn.C \ MSStringVectorTraceSet.C \ MSSymbolCheckBox.C \ MSSymbolList.C \ MSTabStringList.C \ MSTable.C \ MSTableColumn.C \ MSTableColumnGroup.C \ MSTermEntryField.C \ MSText.C \ MSTextEditor.C \ MSTextField.C \ MSTextRect.C \ MSTimeEntryField.C \ MSTitleMenuItem.C \ MSToggleButton.C \ MSToggleButtonBase.C \ MSToggleMenuItem.C \ MSToolTip.C \ MSTopLevel.C \ MSTrace.C \ MSTraceSet.C \ MSUnsignedEntryField.C \ MSVGauge.C \ MSVLayout.C \ MSVPane.C \ MSVScale.C \ MSVScrollBar.C \ MSVSeparator.C \ MSValidationCallback.C \ MSValidationInterface.C \ MSView.C \ MSWidget.C \ MSWidgetCallback.C \ MSWidgetCommon.C \ MSWidgetCursor.C \ MSWidgetFreezer.C \ MSWidgetIterator.C \ MSWidgetOutput.C \ MSWidgetResourceMapper.C \ MSWidgetState.C \ MSWidgetVector.C \ MSWidgetView.C \ MSWindow.C \ MSPointerArray.T.C \ MSTreeListView.T.C \ MSPostScriptView.C \ At.H\ MSActionBox.H\ MSActionButton.H\ MSApplication.H\ MSArrayView.H\ MSArrow.H\ MSArrowButton.H\ MSAttrValue.H\ MSBackingStorePixmap.H\ MSBitmaps.H\ MSBoolEntryField.H\ MSBoolView.H\ MSBusy.H\ MSButton.H\ MSCascadeMenu.H\ MSCascadeMenuItem.H\ MSCheckBox.H\ MSCheckButton.H\ MSCheckMenuItem.H\ MSCheckPopupMenu.H\ MSCollapsibleLayout.H\ MSColorCycle.H\ MSColorManager.H\ MSComboBox.H\ MSComboField.H\ MSComposite.H\ MSCompositeField.H\ MSCompositeFieldBox.H\ MSCompositeText.H\ MSCursorfont.H\ MSCurveTraceSet.H\ MSDateEntryField.H\ MSDefaults.H\ MSDelimiterList.H\ MSDependentTableColumn.H\ MSDisplayCursor.H\ MSDisplayPrint.H\ MSDisplayServer.H\ MSDoubleClick.H\ MSEntryField.H\ MSEntryFieldCombo.H\ MSEntryFieldPlus.H\ MSFloatArrayView.H\ MSFloatEntryField.H\ MSFloatMatrixTraceSet.H\ MSFloatMatrixView.H\ MSFloatTableColumn.H\ MSFloatVectorTraceSet.H\ MSFontManager.H\ MSFontObject.H\ MSG.H\ MSGC.H\ MSGUIEnum.H\ MSGraph.H\ MSHGauge.H\ MSHLayout.H\ MSHPane.H\ MSHScale.H\ MSHScrollBar.H\ MSHSeparator.H\ MSIcon.H\ MSIconButton.H\ MSIntArrayView.H\ MSIntCheckBox.H\ MSIntEntryField.H\ MSIntMatrixTraceSet.H\ MSIntMatrixView.H\ MSIntRadioBox.H\ MSIntTableColumn.H\ MSIntVectorTraceSet.H\ MSKeyCallback.H\ MSKeyClassCallback.H\ MSKeyMethodCallback.H\ MSKeyPress.H\ MSKeyTableData.H\ MSKeyTranslationTable.H\ MSKeyVoidMethodCallback.H\ MSKeysym.H\ MSKeysymdef.H\ MSLabel.H\ MSLabelFormat.H\ MSLabelOut.H\ MSLayout.H\ MSLayoutManager.H\ MSList.H\ MSManager.H\ MSMatrixTraceSet.H\ MSMenu.H\ MSMenuBar.H\ MSMenuBarItem.H\ MSMenuItem.H\ MSMenuShell.H\ MSMethodButton.H\ MSMethodCheckButton.H\ MSMethodMenuItem.H\ MSMethodRadioButton.H\ MSModalPopup.H\ MSModelCheckBox.H\ MSMoneyEntryField.H\ MSMonthView.H\ MSNotebook.H\ MSNumericArrayView.H\ MSOptionMenu.H\ MSP.H\ MSPage.H\ MSPane.H\ MSParagraph.H\ MSPixmap.H\ MSPointerArray.H\ MSPopup.H\ MSPopupMenu.H\ MSPostScript.H\ MSPostScriptView.H\ MSPrimitive.H\ MSPrimitiveText.H\ MSPrintColumn.H\ MSPrintDisclaimer.H\ MSPrintFont.H\ MSPrintFontData.H\ MSPrintHeaders.H\ MSPrintItem.H\ MSPrintManager.H\ MSPrintTool.H\ MSPulldownMenu.H\ MSRadioBox.H\ MSRadioButton.H\ MSRadioMenuItem.H\ MSRateEntryField.H\ MSRect.H\ MSReport.H\ MSReportTable.H\ MSResourceChangeCallback.H\ MSResourceChangeMethodCallback.H\ MSRowColumnView.H\ MSScale.H\ MSScrollBar.H\ MSScrollableWidget.H\ MSScrolledWindow.H\ MSSeparator.H\ MSSeparatorMenuItem.H\ MSShadow.H\ MSShell.H\ MSStandardDisclaimer.H\ MSStringDelimiterList.H\ MSStringEntryField.H\ MSStringList.H\ MSStringPopupMenu.H\ MSStringTableColumn.H\ MSStringVectorTraceSet.H\ MSSymbolCheckBox.H\ MSSymbolList.H\ MSTabStringList.H\ MSTable.H\ MSTableColumn.H\ MSTableColumnGroup.H\ MSTermEntryField.H\ MSText.H\ MSTextEditor.H\ MSTextField.H\ MSTextRect.H\ MSTimeEntryField.H\ MSTitleMenuItem.H\ MSToggleButton.H\ MSToggleButtonBase.H\ MSToggleMenuItem.H\ MSToolTip.H\ MSTopLevel.H\ MSTrace.H\ MSTraceSet.H\ MSTreeFormatFunctions.H\ MSTreeListView.H\ MSTreeView.H\ MSTypeEntryField.H\ MSUnsignedEntryField.H\ MSVGauge.H\ MSVLayout.H\ MSVPane.H\ MSVScale.H\ MSVScrollBar.H\ MSVSeparator.H\ MSValidationCallback.H\ MSValidationInterface.H\ MSValidationMethod.H\ MSVectorTableColumn.H\ MSVectorTraceSet.H\ MSView.H\ MSWidget.H\ MSWidgetCallback.H\ MSWidgetCommon.H\ MSWidgetCursor.H\ MSWidgetFreezer.H\ MSWidgetIterator.H\ MSWidgetOutput.H\ MSWidgetResourceMapper.H\ MSWidgetState.H\ MSWidgetVector.H\ MSWidgetView.H\ MSWindow.H EXTRA_DIST = \ MSArrayViewInlines.C\ MSCompositeTextInlines.C\ MSDisplayServerInlines.C\ MSPrimitiveTextInlines.C\ MSRowColumnViewInlines.C\ MSTableColumnInlines.C\ MSTableInlines.C\ MSTextRectInlines.C\ MSTraceSetInlines.C\ MSWidgetCommonInlines.C\ MSWidgetInlines.C\ MSWidgetOutputInlines.C\ MSPointerArray.C\ MSTreeListView.C\ MSTreeView.C\ MSTypeEntryField.C INCLUDES = -I.. -I/usr/X11R6/include aplus-fsf-4.22/src/MSGUI/Makefile.in0000644000265000001440000012140110774512521012541 # Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ ############################################################################### ############################################################################### SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CXX = @CXX@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ STRIP = @STRIP@ VERSION = @VERSION@ X_INCLUDES = @X_INCLUDES@ X_LIBS = @X_LIBS@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ lib_LTLIBRARIES = libMSGUI.la libMSGUI_la_SOURCES = \ At.C \ MSActionBox.C \ MSActionButton.C \ MSApplication.C \ MSArrayView.C \ MSArrow.C \ MSArrowButton.C \ MSAttrValue.C \ MSBackingStorePixmap.C \ MSBoolEntryField.C \ MSBoolView.C \ MSBusy.C \ MSButton.C \ MSCascadeMenu.C \ MSCascadeMenuItem.C \ MSCheckBox.C \ MSCheckButton.C \ MSCheckMenuItem.C \ MSCheckPopupMenu.C \ MSCollapsibleLayout.C \ MSColorCycle.C \ MSColorManager.C \ MSComboBox.C \ MSComboField.C \ MSComposite.C \ MSCompositeField.C \ MSCompositeFieldBox.C \ MSCompositeText.C \ MSDateEntryField.C \ MSDelimiterList.C \ MSDisplayCursor.C \ MSDisplayPrint.C \ MSDisplayServer.C \ MSDoubleClick.C \ MSEntryField.C \ MSEntryFieldCombo.C \ MSEntryFieldPlus.C \ MSFloatArrayView.C \ MSFloatEntryField.C \ MSFloatMatrixTraceSet.C \ MSFloatMatrixView.C \ MSFloatTableColumn.C \ MSFloatVectorTraceSet.C \ MSFontManager.C \ MSFontObject.C \ MSGC.C \ MSGraph.C \ MSGraphPlot.C \ MSGraphUI.C \ MSHGauge.C \ MSHLayout.C \ MSHPane.C \ MSHScale.C \ MSHScrollBar.C \ MSHSeparator.C \ MSIcon.C \ MSIconButton.C \ MSIntArrayView.C \ MSIntCheckBox.C \ MSIntEntryField.C \ MSIntMatrixTraceSet.C \ MSIntMatrixView.C \ MSIntRadioBox.C \ MSIntTableColumn.C \ MSIntVectorTraceSet.C \ MSKeyCallback.C \ MSKeyPress.C \ MSKeyTableData.C \ MSKeyTranslationTable.C \ MSLabel.C \ MSLabelFormat.C \ MSLabelOut.C \ MSLayout.C \ MSLayoutManager.C \ MSList.C \ MSManager.C \ MSMenu.C \ MSMenuBar.C \ MSMenuBarItem.C \ MSMenuItem.C \ MSMenuShell.C \ MSModalPopup.C \ MSModelCheckBox.C \ MSMoneyEntryField.C \ MSMonthView.C \ MSNotebook.C \ MSNumericArrayView.C \ MSOptionMenu.C \ MSPage.C \ MSPane.C \ MSParagraph.C \ MSPixmap.C \ MSPopup.C \ MSPopupMenu.C \ MSPostScript.C \ MSPrimitive.C \ MSPrimitiveText.C \ MSPrintColumn.C \ MSPrintDisclaimer.C \ MSPrintFont.C \ MSPrintFontData.C \ MSPrintHeaders.C \ MSPrintItem.C \ MSPrintManager.C \ MSPulldownMenu.C \ MSRadioBox.C \ MSRadioButton.C \ MSRadioMenuItem.C \ MSRateEntryField.C \ MSRect.C \ MSReport.C \ MSReportTable.C \ MSRowColumnView.C \ MSScale.C \ MSScrollBar.C \ MSScrollableWidget.C \ MSScrolledWindow.C \ MSSeparator.C \ MSSeparatorMenuItem.C \ MSShadow.C \ MSShell.C \ MSStringDelimiterList.C \ MSStringEntryField.C \ MSStringList.C \ MSStringPopupMenu.C \ MSStringTableColumn.C \ MSStringVectorTraceSet.C \ MSSymbolCheckBox.C \ MSSymbolList.C \ MSTabStringList.C \ MSTable.C \ MSTableColumn.C \ MSTableColumnGroup.C \ MSTermEntryField.C \ MSText.C \ MSTextEditor.C \ MSTextField.C \ MSTextRect.C \ MSTimeEntryField.C \ MSTitleMenuItem.C \ MSToggleButton.C \ MSToggleButtonBase.C \ MSToggleMenuItem.C \ MSToolTip.C \ MSTopLevel.C \ MSTrace.C \ MSTraceSet.C \ MSUnsignedEntryField.C \ MSVGauge.C \ MSVLayout.C \ MSVPane.C \ MSVScale.C \ MSVScrollBar.C \ MSVSeparator.C \ MSValidationCallback.C \ MSValidationInterface.C \ MSView.C \ MSWidget.C \ MSWidgetCallback.C \ MSWidgetCommon.C \ MSWidgetCursor.C \ MSWidgetFreezer.C \ MSWidgetIterator.C \ MSWidgetOutput.C \ MSWidgetResourceMapper.C \ MSWidgetState.C \ MSWidgetVector.C \ MSWidgetView.C \ MSWindow.C \ MSPointerArray.T.C \ MSTreeListView.T.C \ MSPostScriptView.C \ At.H\ MSActionBox.H\ MSActionButton.H\ MSApplication.H\ MSArrayView.H\ MSArrow.H\ MSArrowButton.H\ MSAttrValue.H\ MSBackingStorePixmap.H\ MSBitmaps.H\ MSBoolEntryField.H\ MSBoolView.H\ MSBusy.H\ MSButton.H\ MSCascadeMenu.H\ MSCascadeMenuItem.H\ MSCheckBox.H\ MSCheckButton.H\ MSCheckMenuItem.H\ MSCheckPopupMenu.H\ MSCollapsibleLayout.H\ MSColorCycle.H\ MSColorManager.H\ MSComboBox.H\ MSComboField.H\ MSComposite.H\ MSCompositeField.H\ MSCompositeFieldBox.H\ MSCompositeText.H\ MSCursorfont.H\ MSCurveTraceSet.H\ MSDateEntryField.H\ MSDefaults.H\ MSDelimiterList.H\ MSDependentTableColumn.H\ MSDisplayCursor.H\ MSDisplayPrint.H\ MSDisplayServer.H\ MSDoubleClick.H\ MSEntryField.H\ MSEntryFieldCombo.H\ MSEntryFieldPlus.H\ MSFloatArrayView.H\ MSFloatEntryField.H\ MSFloatMatrixTraceSet.H\ MSFloatMatrixView.H\ MSFloatTableColumn.H\ MSFloatVectorTraceSet.H\ MSFontManager.H\ MSFontObject.H\ MSG.H\ MSGC.H\ MSGUIEnum.H\ MSGraph.H\ MSHGauge.H\ MSHLayout.H\ MSHPane.H\ MSHScale.H\ MSHScrollBar.H\ MSHSeparator.H\ MSIcon.H\ MSIconButton.H\ MSIntArrayView.H\ MSIntCheckBox.H\ MSIntEntryField.H\ MSIntMatrixTraceSet.H\ MSIntMatrixView.H\ MSIntRadioBox.H\ MSIntTableColumn.H\ MSIntVectorTraceSet.H\ MSKeyCallback.H\ MSKeyClassCallback.H\ MSKeyMethodCallback.H\ MSKeyPress.H\ MSKeyTableData.H\ MSKeyTranslationTable.H\ MSKeyVoidMethodCallback.H\ MSKeysym.H\ MSKeysymdef.H\ MSLabel.H\ MSLabelFormat.H\ MSLabelOut.H\ MSLayout.H\ MSLayoutManager.H\ MSList.H\ MSManager.H\ MSMatrixTraceSet.H\ MSMenu.H\ MSMenuBar.H\ MSMenuBarItem.H\ MSMenuItem.H\ MSMenuShell.H\ MSMethodButton.H\ MSMethodCheckButton.H\ MSMethodMenuItem.H\ MSMethodRadioButton.H\ MSModalPopup.H\ MSModelCheckBox.H\ MSMoneyEntryField.H\ MSMonthView.H\ MSNotebook.H\ MSNumericArrayView.H\ MSOptionMenu.H\ MSP.H\ MSPage.H\ MSPane.H\ MSParagraph.H\ MSPixmap.H\ MSPointerArray.H\ MSPopup.H\ MSPopupMenu.H\ MSPostScript.H\ MSPostScriptView.H\ MSPrimitive.H\ MSPrimitiveText.H\ MSPrintColumn.H\ MSPrintDisclaimer.H\ MSPrintFont.H\ MSPrintFontData.H\ MSPrintHeaders.H\ MSPrintItem.H\ MSPrintManager.H\ MSPrintTool.H\ MSPulldownMenu.H\ MSRadioBox.H\ MSRadioButton.H\ MSRadioMenuItem.H\ MSRateEntryField.H\ MSRect.H\ MSReport.H\ MSReportTable.H\ MSResourceChangeCallback.H\ MSResourceChangeMethodCallback.H\ MSRowColumnView.H\ MSScale.H\ MSScrollBar.H\ MSScrollableWidget.H\ MSScrolledWindow.H\ MSSeparator.H\ MSSeparatorMenuItem.H\ MSShadow.H\ MSShell.H\ MSStandardDisclaimer.H\ MSStringDelimiterList.H\ MSStringEntryField.H\ MSStringList.H\ MSStringPopupMenu.H\ MSStringTableColumn.H\ MSStringVectorTraceSet.H\ MSSymbolCheckBox.H\ MSSymbolList.H\ MSTabStringList.H\ MSTable.H\ MSTableColumn.H\ MSTableColumnGroup.H\ MSTermEntryField.H\ MSText.H\ MSTextEditor.H\ MSTextField.H\ MSTextRect.H\ MSTimeEntryField.H\ MSTitleMenuItem.H\ MSToggleButton.H\ MSToggleButtonBase.H\ MSToggleMenuItem.H\ MSToolTip.H\ MSTopLevel.H\ MSTrace.H\ MSTraceSet.H\ MSTreeFormatFunctions.H\ MSTreeListView.H\ MSTreeView.H\ MSTypeEntryField.H\ MSUnsignedEntryField.H\ MSVGauge.H\ MSVLayout.H\ MSVPane.H\ MSVScale.H\ MSVScrollBar.H\ MSVSeparator.H\ MSValidationCallback.H\ MSValidationInterface.H\ MSValidationMethod.H\ MSVectorTableColumn.H\ MSVectorTraceSet.H\ MSView.H\ MSWidget.H\ MSWidgetCallback.H\ MSWidgetCommon.H\ MSWidgetCursor.H\ MSWidgetFreezer.H\ MSWidgetIterator.H\ MSWidgetOutput.H\ MSWidgetResourceMapper.H\ MSWidgetState.H\ MSWidgetVector.H\ MSWidgetView.H\ MSWindow.H EXTRA_DIST = \ MSArrayViewInlines.C\ MSCompositeTextInlines.C\ MSDisplayServerInlines.C\ MSPrimitiveTextInlines.C\ MSRowColumnViewInlines.C\ MSTableColumnInlines.C\ MSTableInlines.C\ MSTextRectInlines.C\ MSTraceSetInlines.C\ MSWidgetCommonInlines.C\ MSWidgetInlines.C\ MSWidgetOutputInlines.C\ MSPointerArray.C\ MSTreeListView.C\ MSTreeView.C\ MSTypeEntryField.C INCLUDES = -I.. -I/usr/X11R6/include subdir = src/MSGUI mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_CLEAN_FILES = LTLIBRARIES = $(lib_LTLIBRARIES) libMSGUI_la_LDFLAGS = libMSGUI_la_LIBADD = am_libMSGUI_la_OBJECTS = At.lo MSActionBox.lo MSActionButton.lo \ MSApplication.lo MSArrayView.lo MSArrow.lo MSArrowButton.lo \ MSAttrValue.lo MSBackingStorePixmap.lo MSBoolEntryField.lo \ MSBoolView.lo MSBusy.lo MSButton.lo MSCascadeMenu.lo \ MSCascadeMenuItem.lo MSCheckBox.lo MSCheckButton.lo \ MSCheckMenuItem.lo MSCheckPopupMenu.lo MSCollapsibleLayout.lo \ MSColorCycle.lo MSColorManager.lo MSComboBox.lo MSComboField.lo \ MSComposite.lo MSCompositeField.lo MSCompositeFieldBox.lo \ MSCompositeText.lo MSDateEntryField.lo MSDelimiterList.lo \ MSDisplayCursor.lo MSDisplayPrint.lo MSDisplayServer.lo \ MSDoubleClick.lo MSEntryField.lo MSEntryFieldCombo.lo \ MSEntryFieldPlus.lo MSFloatArrayView.lo MSFloatEntryField.lo \ MSFloatMatrixTraceSet.lo MSFloatMatrixView.lo \ MSFloatTableColumn.lo MSFloatVectorTraceSet.lo MSFontManager.lo \ MSFontObject.lo MSGC.lo MSGraph.lo MSGraphPlot.lo MSGraphUI.lo \ MSHGauge.lo MSHLayout.lo MSHPane.lo MSHScale.lo MSHScrollBar.lo \ MSHSeparator.lo MSIcon.lo MSIconButton.lo MSIntArrayView.lo \ MSIntCheckBox.lo MSIntEntryField.lo MSIntMatrixTraceSet.lo \ MSIntMatrixView.lo MSIntRadioBox.lo MSIntTableColumn.lo \ MSIntVectorTraceSet.lo MSKeyCallback.lo MSKeyPress.lo \ MSKeyTableData.lo MSKeyTranslationTable.lo MSLabel.lo \ MSLabelFormat.lo MSLabelOut.lo MSLayout.lo MSLayoutManager.lo \ MSList.lo MSManager.lo MSMenu.lo MSMenuBar.lo MSMenuBarItem.lo \ MSMenuItem.lo MSMenuShell.lo MSModalPopup.lo MSModelCheckBox.lo \ MSMoneyEntryField.lo MSMonthView.lo MSNotebook.lo \ MSNumericArrayView.lo MSOptionMenu.lo MSPage.lo MSPane.lo \ MSParagraph.lo MSPixmap.lo MSPopup.lo MSPopupMenu.lo \ MSPostScript.lo MSPrimitive.lo MSPrimitiveText.lo \ MSPrintColumn.lo MSPrintDisclaimer.lo MSPrintFont.lo \ MSPrintFontData.lo MSPrintHeaders.lo MSPrintItem.lo \ MSPrintManager.lo MSPulldownMenu.lo MSRadioBox.lo \ MSRadioButton.lo MSRadioMenuItem.lo MSRateEntryField.lo \ MSRect.lo MSReport.lo MSReportTable.lo MSRowColumnView.lo \ MSScale.lo MSScrollBar.lo MSScrollableWidget.lo \ MSScrolledWindow.lo MSSeparator.lo MSSeparatorMenuItem.lo \ MSShadow.lo MSShell.lo MSStringDelimiterList.lo \ MSStringEntryField.lo MSStringList.lo MSStringPopupMenu.lo \ MSStringTableColumn.lo MSStringVectorTraceSet.lo \ MSSymbolCheckBox.lo MSSymbolList.lo MSTabStringList.lo \ MSTable.lo MSTableColumn.lo MSTableColumnGroup.lo \ MSTermEntryField.lo MSText.lo MSTextEditor.lo MSTextField.lo \ MSTextRect.lo MSTimeEntryField.lo MSTitleMenuItem.lo \ MSToggleButton.lo MSToggleButtonBase.lo MSToggleMenuItem.lo \ MSToolTip.lo MSTopLevel.lo MSTrace.lo MSTraceSet.lo \ MSUnsignedEntryField.lo MSVGauge.lo MSVLayout.lo MSVPane.lo \ MSVScale.lo MSVScrollBar.lo MSVSeparator.lo \ MSValidationCallback.lo MSValidationInterface.lo MSView.lo \ MSWidget.lo MSWidgetCallback.lo MSWidgetCommon.lo \ MSWidgetCursor.lo MSWidgetFreezer.lo MSWidgetIterator.lo \ MSWidgetOutput.lo MSWidgetResourceMapper.lo MSWidgetState.lo \ MSWidgetVector.lo MSWidgetView.lo MSWindow.lo \ MSPointerArray.T.lo MSTreeListView.T.lo MSPostScriptView.lo libMSGUI_la_OBJECTS = $(am_libMSGUI_la_OBJECTS) DEFS = @DEFS@ DEFAULT_INCLUDES = -I. -I$(srcdir) CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/At.Plo ./$(DEPDIR)/MSActionBox.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSActionButton.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSApplication.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSArrayView.Plo ./$(DEPDIR)/MSArrow.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSArrowButton.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSAttrValue.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSBackingStorePixmap.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSBoolEntryField.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSBoolView.Plo ./$(DEPDIR)/MSBusy.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSButton.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSCascadeMenu.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSCascadeMenuItem.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSCheckBox.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSCheckButton.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSCheckMenuItem.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSCheckPopupMenu.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSCollapsibleLayout.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSColorCycle.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSColorManager.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSComboBox.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSComboField.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSComposite.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSCompositeField.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSCompositeFieldBox.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSCompositeText.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSDateEntryField.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSDelimiterList.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSDisplayCursor.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSDisplayPrint.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSDisplayServer.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSDoubleClick.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSEntryField.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSEntryFieldCombo.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSEntryFieldPlus.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSFloatArrayView.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSFloatEntryField.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSFloatMatrixTraceSet.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSFloatMatrixView.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSFloatTableColumn.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSFloatVectorTraceSet.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSFontManager.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSFontObject.Plo ./$(DEPDIR)/MSGC.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSGraph.Plo ./$(DEPDIR)/MSGraphPlot.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSGraphUI.Plo ./$(DEPDIR)/MSHGauge.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSHLayout.Plo ./$(DEPDIR)/MSHPane.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSHScale.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSHScrollBar.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSHSeparator.Plo ./$(DEPDIR)/MSIcon.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSIconButton.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSIntArrayView.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSIntCheckBox.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSIntEntryField.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSIntMatrixTraceSet.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSIntMatrixView.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSIntRadioBox.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSIntTableColumn.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSIntVectorTraceSet.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSKeyCallback.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSKeyPress.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSKeyTableData.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSKeyTranslationTable.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSLabel.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSLabelFormat.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSLabelOut.Plo ./$(DEPDIR)/MSLayout.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSLayoutManager.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSList.Plo ./$(DEPDIR)/MSManager.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSMenu.Plo ./$(DEPDIR)/MSMenuBar.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSMenuBarItem.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSMenuItem.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSMenuShell.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSModalPopup.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSModelCheckBox.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSMoneyEntryField.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSMonthView.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSNotebook.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSNumericArrayView.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSOptionMenu.Plo ./$(DEPDIR)/MSPage.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSPane.Plo ./$(DEPDIR)/MSParagraph.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSPixmap.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSPointerArray.T.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSPopup.Plo ./$(DEPDIR)/MSPopupMenu.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSPostScript.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSPostScriptView.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSPrimitive.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSPrimitiveText.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSPrintColumn.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSPrintDisclaimer.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSPrintFont.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSPrintFontData.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSPrintHeaders.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSPrintItem.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSPrintManager.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSPulldownMenu.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSRadioBox.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSRadioButton.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSRadioMenuItem.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSRateEntryField.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSRect.Plo ./$(DEPDIR)/MSReport.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSReportTable.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSRowColumnView.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSScale.Plo ./$(DEPDIR)/MSScrollBar.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSScrollableWidget.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSScrolledWindow.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSSeparator.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSSeparatorMenuItem.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSShadow.Plo ./$(DEPDIR)/MSShell.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSStringDelimiterList.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSStringEntryField.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSStringList.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSStringPopupMenu.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSStringTableColumn.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSStringVectorTraceSet.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSSymbolCheckBox.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSSymbolList.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSTabStringList.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSTable.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSTableColumn.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSTableColumnGroup.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSTermEntryField.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSText.Plo ./$(DEPDIR)/MSTextEditor.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSTextField.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSTextRect.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSTimeEntryField.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSTitleMenuItem.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSToggleButton.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSToggleButtonBase.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSToggleMenuItem.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSToolTip.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSTopLevel.Plo ./$(DEPDIR)/MSTrace.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSTraceSet.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSTreeListView.T.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSUnsignedEntryField.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSVGauge.Plo ./$(DEPDIR)/MSVLayout.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSVPane.Plo ./$(DEPDIR)/MSVScale.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSVScrollBar.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSVSeparator.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSValidationCallback.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSValidationInterface.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSView.Plo ./$(DEPDIR)/MSWidget.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSWidgetCallback.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSWidgetCommon.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSWidgetCursor.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSWidgetFreezer.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSWidgetIterator.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSWidgetOutput.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSWidgetResourceMapper.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSWidgetState.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSWidgetVector.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSWidgetView.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSWindow.Plo CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ CXXFLAGS = @CXXFLAGS@ CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ DIST_SOURCES = $(libMSGUI_la_SOURCES) DIST_COMMON = Makefile.am Makefile.in SOURCES = $(libMSGUI_la_SOURCES) all: all-am .SUFFIXES: .SUFFIXES: .C .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/MSGUI/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) libLTLIBRARIES_INSTALL = $(INSTALL) install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(libdir) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f"; \ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p"; \ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test -z "$dir" && dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libMSGUI.la: $(libMSGUI_la_OBJECTS) $(libMSGUI_la_DEPENDENCIES) $(CXXLINK) -rpath $(libdir) $(libMSGUI_la_LDFLAGS) $(libMSGUI_la_OBJECTS) $(libMSGUI_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/At.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSActionBox.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSActionButton.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSApplication.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSArrayView.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSArrow.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSArrowButton.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSAttrValue.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSBackingStorePixmap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSBoolEntryField.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSBoolView.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSBusy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSButton.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSCascadeMenu.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSCascadeMenuItem.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSCheckBox.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSCheckButton.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSCheckMenuItem.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSCheckPopupMenu.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSCollapsibleLayout.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSColorCycle.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSColorManager.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSComboBox.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSComboField.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSComposite.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSCompositeField.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSCompositeFieldBox.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSCompositeText.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSDateEntryField.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSDelimiterList.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSDisplayCursor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSDisplayPrint.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSDisplayServer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSDoubleClick.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSEntryField.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSEntryFieldCombo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSEntryFieldPlus.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSFloatArrayView.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSFloatEntryField.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSFloatMatrixTraceSet.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSFloatMatrixView.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSFloatTableColumn.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSFloatVectorTraceSet.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSFontManager.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSFontObject.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSGC.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSGraph.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSGraphPlot.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSGraphUI.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSHGauge.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSHLayout.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSHPane.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSHScale.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSHScrollBar.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSHSeparator.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSIcon.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSIconButton.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSIntArrayView.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSIntCheckBox.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSIntEntryField.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSIntMatrixTraceSet.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSIntMatrixView.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSIntRadioBox.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSIntTableColumn.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSIntVectorTraceSet.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSKeyCallback.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSKeyPress.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSKeyTableData.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSKeyTranslationTable.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSLabel.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSLabelFormat.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSLabelOut.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSLayout.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSLayoutManager.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSList.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSManager.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSMenu.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSMenuBar.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSMenuBarItem.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSMenuItem.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSMenuShell.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSModalPopup.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSModelCheckBox.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSMoneyEntryField.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSMonthView.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSNotebook.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSNumericArrayView.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSOptionMenu.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSPage.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSPane.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSParagraph.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSPixmap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSPointerArray.T.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSPopup.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSPopupMenu.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSPostScript.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSPostScriptView.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSPrimitive.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSPrimitiveText.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSPrintColumn.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSPrintDisclaimer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSPrintFont.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSPrintFontData.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSPrintHeaders.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSPrintItem.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSPrintManager.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSPulldownMenu.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSRadioBox.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSRadioButton.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSRadioMenuItem.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSRateEntryField.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSRect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSReport.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSReportTable.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSRowColumnView.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSScale.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSScrollBar.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSScrollableWidget.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSScrolledWindow.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSSeparator.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSSeparatorMenuItem.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSShadow.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSShell.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSStringDelimiterList.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSStringEntryField.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSStringList.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSStringPopupMenu.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSStringTableColumn.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSStringVectorTraceSet.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSSymbolCheckBox.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSSymbolList.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSTabStringList.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSTable.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSTableColumn.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSTableColumnGroup.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSTermEntryField.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSText.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSTextEditor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSTextField.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSTextRect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSTimeEntryField.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSTitleMenuItem.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSToggleButton.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSToggleButtonBase.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSToggleMenuItem.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSToolTip.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSTopLevel.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSTrace.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSTraceSet.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSTreeListView.T.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSUnsignedEntryField.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSVGauge.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSVLayout.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSVPane.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSVScale.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSVScrollBar.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSVSeparator.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSValidationCallback.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSValidationInterface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSView.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSWidget.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSWidgetCallback.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSWidgetCommon.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSWidgetCursor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSWidgetFreezer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSWidgetIterator.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSWidgetOutput.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSWidgetResourceMapper.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSWidgetState.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSWidgetVector.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSWidgetView.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSWindow.Plo@am__quote@ distclean-depend: -rm -rf ./$(DEPDIR) .C.o: @AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< .C.obj: @AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CXXCOMPILE) -c -o $@ `cygpath -w $<` .C.lo: @AMDEP_TRUE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(LTCXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< CXXDEPMODE = @CXXDEPMODE@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ETAGS = etags ETAGSFLAGS = tags: TAGS 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; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ 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; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = ../.. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: $(mkinstalldirs) $(DESTDIR)$(libdir) 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_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_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-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-compile distclean-depend \ distclean-generic distclean-libtool distclean-tags dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-exec-am: install-libLTLIBRARIES install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES .PHONY: GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool distclean distclean-compile \ distclean-depend distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am info info-am install \ install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am \ install-libLTLIBRARIES install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool tags uninstall \ uninstall-am uninstall-info-am uninstall-libLTLIBRARIES # 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: aplus-fsf-4.22/src/MSGUI/At.C0000644000265000001440000001061310772770400011146 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #if HAVE_SSTREAM #include #else #include #endif At::At(void) { at(0,0,1,1); } At::At(int row_,int col_,int rowSpan_,int columnSpan_,unsigned long constraints_) { at(row_,col_,rowSpan_,columnSpan_,constraints_); } At::At(int row_,int col_,int rowSpan_,int columnSpan_,const char *constraints_) { at(row_,col_,rowSpan_,columnSpan_,parseConstraints(constraints_)); } At::At(const At& at_) { *this=at_; } At::At(const char *pString_) { at(0,0,1,1); parseString(pString_,strlen(pString_)); } At::At(const MSString& aString_) { at(0,0,1,1); parseString(aString_,aString_.length()); } void At::parseString(const char *pString_, int len) { #if defined(MS_NO_ISTRSTREAM_CONSTCHAR_CONSTRUCTOR) istrstream ist((char *)(void*)pString_,len); #else #if HAVE_SSTREAM istringstream ist(pString_); #else istrstream ist(pString_,len); #endif #endif // MS_NO_ISTRSTREAM_CONSTCHAR_CONSTRUCTOR ist>>_row; if (ist) ist>>_column; if (ist) ist>>_rowSpan; if (ist) ist>>_columnSpan; if (ist) { while (ist.peek()==' ') ist.get(); char buf[12]; buf[0]='\0'; if (ist) ist.getline(buf,sizeof(buf),' '); constraints(buf); } } At::~At(void) {} MSBoolean At::operator==(const At& at_) { return MSBoolean(_row==at_.row()&&_column==at_.column()&& _rowSpan==at_.rowSpan()&&_columnSpan==at_.columnSpan()&& _constraints==at_.constraints()); } MSBoolean At::operator!=(const At& at_) { return MSBoolean(_row!=at_.row()||_column!=at_.column()|| _rowSpan!=at_.rowSpan()||_columnSpan!=at_.columnSpan()|| _constraints!=at_.constraints()); } At& At::operator=(const At& at_) { if (this!=&at_) { _row=at_._row,_column=at_._column; _rowSpan=at_._rowSpan,_columnSpan=at_._columnSpan; _constraints=at_._constraints; } return *this; } int At::row(void) const { return _row; } int At::column(void) const { return _column; } int At::rowSpan(void) const { return _rowSpan; } int At::columnSpan(void) const { return _columnSpan; } unsigned long At::constraints(void) const { return _constraints; } void At::row(int row_) { _row=row_; } void At::column(int col_) { _column=col_; } void At::rowSpan(int span_) { _rowSpan=span_; } void At::columnSpan(int span_) { _columnSpan=span_; } void At::constraints(unsigned long constraints_) { _constraints=constraints_; } void At::at(int row_,int col_,int rowSpan_,int columnSpan_,unsigned long constraints_) { _row=row_,_column=col_,_rowSpan=rowSpan_,_columnSpan=columnSpan_,_constraints=constraints_; } void At::at(int row_,int col_,int rowSpan_,int columnSpan_,const char *constraints_) { at(row_,col_,rowSpan_,columnSpan_,parseConstraints(constraints_)); } //############################################################################################# // At parsing methods MSString At::parsedConstraints(void) const { return parseConstraints(_constraints); } void At::constraints(const char *constraints_) { _constraints=parseConstraints(constraints_); } unsigned long At::parseConstraints(const char *constraints_) const { static char options[]= {'+','l','r','t','b','w','h','W','H'}; unsigned long r=0; int len=(constraints_!=0)?strlen(constraints_):0; if (len>0) { char *cp=strchr((char*)(void*)constraints_,options[0]); // cast is needed for bug in Borland if (cp!=0) r|=_constraints; for (int j=1,k=1;j<=MaintainHeight&&len>0;j<<=1,k++) { if ((cp=strchr((char*)(void*)constraints_,options[k]))!=0) r|=j,len--; } } return r; } MSString At::parseConstraints(unsigned long constraints_) const { static char options[]= {'+','l','r','t','b','w','h','W','H'}; static char opts[16]; int len=0; if (constraints_>0) { for (int j=1,k=1;j<=128;j<<=1,k++) { if ((constraints_&j)==j) opts[len++]=options[k]; } } opts[len]='\0'; return MSString(opts); } MSString At::asString(void) const { MSString result; result+=MSString(_row); result+=" "; result+=MSString(_column); result+=" "; result+=MSString(_rowSpan); result+=" "; result+=MSString(_columnSpan); result+=" "; result+=parsedConstraints(); return MSString(result); } aplus-fsf-4.22/src/MSGUI/MSActionBox.C0000644000265000001440000001203010772770400012723 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include MSActionBox::MSActionBox(MSWidget *owner_,const char *title_) : MSLayout(owner_,title_) { init(); } MSActionBox::MSActionBox(MSWidget *owner_,const MSStringVector& title_) : MSLayout(owner_,title_) { init(); } void MSActionBox::init(void) { _orientation=MSLayoutManager::Horizontal; shadowStyle(MSEtchedIn); _activeButton=0; } MSActionBox::~MSActionBox(void) {} const MSSymbol& MSActionBox::symbol(void) { static MSSymbol sym ("MSActionBox"); return sym; } const MSSymbol& MSActionBox::widgetType(void) const { return symbol(); } void MSActionBox::alignment(unsigned alignment_) { if (alignment_!=alignment()) { MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; MSLayoutEntry *entry; MSActionButton *btn; while ((np=np->next())!=hp) { entry=(MSLayoutEntry *)np->data(); btn=(MSActionButton *)entry->widget(); btn->alignment(alignment_); } } } unsigned MSActionBox::alignment(void) const { unsigned r=MSCenter; const MSLayoutEntry *entry=getEntry(0); if (entry!=0) { MSActionButton *btn=(MSActionButton *)entry->widget(); r=btn->alignment(); } return r; } MSActionButton *MSActionBox::button(const MSSymbol& tag_) { MSLayoutEntry *entry; MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; MSActionButton *btn; while ((np=np->next())!=hp) { entry=(MSLayoutEntry *)np->data(); btn=(MSActionButton *)entry->widget(); if (btn->tag()==tag_) return btn; } return 0; } const MSActionButton *MSActionBox::button(const MSSymbol& tag_) const { MSLayoutEntry *entry; MSNodeItem *hp=(MSNodeItem *)childListHead(); MSNodeItem *np=hp; MSActionButton *btn; while ((np=np->next())!=hp) { entry=(MSLayoutEntry *)np->data(); btn=(MSActionButton *)entry->widget(); if (btn->tag()==tag_) return btn; } return 0; } MSActionButton *MSActionBox::button(int tag_) { MSLayoutEntry *entry; MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; MSActionButton *btn; while ((np=np->next())!=hp) { entry=(MSLayoutEntry *)np->data(); btn=(MSActionButton *)entry->widget(); if (btn->integerTag()==tag_) return btn; } return 0; } const MSActionButton *MSActionBox::button(int tag_) const { MSLayoutEntry *entry; MSNodeItem *hp=(MSNodeItem *)childListHead(); MSNodeItem *np=hp; MSActionButton *btn; while ((np=np->next())!=hp) { entry=(MSLayoutEntry *)np->data(); btn=(MSActionButton *)entry->widget(); if (btn->integerTag()==tag_) return btn; } return 0; } void MSActionBox::placement(void) { MSLayout::placement(); redraw(); } void MSActionBox::activate(void) { activateCallback(MSWidgetCallback::activate); } void MSActionBox::activate(MSActionButton *btn_) { _activeButton=btn_; activate(); _activeButton=0; } MSSymbolVector MSActionBox::symbolicState(void) const { MSSymbolVector vector; MSNodeItem *hp=(MSNodeItem *)childListHead(); MSNodeItem *np=hp; while ((np=np->next())!=hp) { MSLayoutEntry *entry=(MSLayoutEntry *)np->data(); MSActionButton *button=(MSActionButton *)entry->widget(); if (button->state()==MSTrue) vector.append(button->tag()); } return vector; } MSIntVector MSActionBox::integerState(void) const { MSIntVector vector; MSNodeItem *hp=(MSNodeItem *)childListHead(); MSNodeItem *np=hp; while ((np=np->next())!=hp) { MSLayoutEntry *entry=(MSLayoutEntry *)np->data(); MSActionButton *button=(MSActionButton *)entry->widget(); if (button->state()==MSTrue) vector.append(button->integerTag()); } return vector; } void MSActionBox::updateBackground(unsigned long oldbg_) { MSLayout::updateBackground(oldbg_); MSLayoutEntry *entry; MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; MSWidget *btn; while ((np=np->next())!=hp) { entry=(MSLayoutEntry *)np->data(); btn=(MSWidget *)entry->widget(); btn->background(background()); } MSLayout::redraw(); } void MSActionBox::updateFont(Font oldfont_) { MSLayout::updateFont(oldfont_); MSLayoutEntry *entry; MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; MSWidget *btn; while ((np=np->next())!=hp) { entry=(MSLayoutEntry *)np->data(); btn=(MSWidget *)entry->widget(); btn->font(font()); } MSLayout::redraw(); } void MSActionBox::childDestroy(MSWidget *child_) { if (activeButton()==child_) _activeButton=0; MSLayout::childDestroy(child_); } void MSActionBox::set(MSAttrValueList& avList_) { MSLayout::set(avList_); } MSAttrValueList& MSActionBox::get(MSAttrValueList& avList_) { avList_< #include #include static const unsigned long MSActionButtonEventMask=(ExposureMask|ButtonPressMask| ButtonReleaseMask|Button1MotionMask); MSActionButton::MSActionButton(MSWidget *owner_,const char *label_,const MSSymbol& tag_) : MSButton(owner_,label_),_tag(tag_), _integerTag(0) { init(); } MSActionButton::MSActionButton(MSWidget *owner_,const MSStringVector& label_,const MSSymbol& tag_) : MSButton(owner_,label_),_tag(tag_), _integerTag(0) { init(); } MSActionButton::MSActionButton(MSWidget *owner_,const MSPixmap &pixmap_, const MSPixmap &insensitivePixmap_, const MSPixmap &armedPixmap_,const MSSymbol& tag_) : MSButton(owner_,pixmap_,insensitivePixmap_,armedPixmap_), _tag(tag_),_integerTag(0) { init(); } MSActionButton::MSActionButton(MSWidget *owner_,const char *label_,int integerTag_) : MSButton(owner_,label_), _integerTag(integerTag_),_tag(MSSymbol::nullSymbol()) { init(); } MSActionButton::MSActionButton(MSWidget *owner_,const MSStringVector& label_,int integerTag_) : MSButton(owner_,label_), _integerTag(integerTag_),_tag(MSSymbol::nullSymbol()) { init(); } MSActionButton::MSActionButton(MSWidget *owner_,const MSPixmap &pixmap_, const MSPixmap &insensitivePixmap_, const MSPixmap &armedPixmap_,int integerTag_) : MSButton(owner_,pixmap_,insensitivePixmap_,armedPixmap_), _integerTag(integerTag_),_tag(MSSymbol::nullSymbol()) { init(); } MSActionButton::~MSActionButton(void) { } void MSActionButton::init(void) { selectInput(MSActionButtonEventMask); } void MSActionButton::state(MSBoolean state_) { if (state_!=armed()) { _armed=state_; change(); } } void MSActionButton::tag(const MSSymbol& tag_) { _tag=tag_; } void MSActionButton::integerTag(int integerTag_) { _integerTag=integerTag_; } void MSActionButton::redraw(void) { if (owner()->mapped()==MSTrue&&owner()->frozen()==MSFalse) { drawBackground(); drawSymbol(); if (pixmap()==0) drawLabel(); else drawPixmap(); (armed()==MSTrue)?drawSunken():drawRaised(); } } void MSActionButton::change(void) { drawSymbol(); boolModel()=state(); if (pixmap()!=0) drawPixmap(); } void MSActionButton::drawSymbol(void) {} // widgetType will go away when dynamic_cast (RTTI) operator becomes available // this method is suppose to emulate the dynamic_cast operator MSActionBox *MSActionButton::actionBox(void) const { if (parentWidgetType()==MSActionBox::symbol()) return (MSActionBox *)owner(); else return 0; } void MSActionButton::actionBoxActivate(void) { MSActionBox *abox=actionBox(); if (abox!=0) abox->activate(this); } void MSActionButton::defaultActivate(void) { if (armed()==MSTrue) { if (activateCallback(MSWidgetCallback::activate)==MSFalse) actionBoxActivate(); } } void MSActionButton::activate(void) { defaultActivate(); } void MSActionButton::setArmState(void) { if (armed()==MSFalse) { _armed=MSTrue; if (boolModel()!=state()) boolModel()=state(); if (pixmap()!=0) redraw(); else drawSymbol(); } } void MSActionButton::setDisarmState(void) { if (armed()==MSTrue) { _armed=MSFalse; if (boolModel()!=state()) boolModel()=state(); if (pixmap()!=0) redraw(); drawSymbol(); } } void MSActionButton::arm(void) { if (armed()==MSFalse) { _armed=MSTrue; if (boolModel()!=state()) boolModel()=state(); redraw(); } } void MSActionButton::disarm(void) { if (armed()==MSTrue) { _armed=MSFalse; if (boolModel()!=state()) boolModel()=state(); redraw(); } } void MSActionButton::up(void) { if (actionBox()) actionBox()->up(); } void MSActionButton::down(void) { if (actionBox()) actionBox()->down(); } void MSActionButton::left(void) { if (actionBox()) actionBox()->left(); } void MSActionButton::right(void) { if (actionBox()) actionBox()->right(); } void MSActionButton::boolModelChanged(MSEvent &) { if (boolModel()!=state()) { if (boolModel()==MSBool(MSTrue)) { arm(); } else { disarm(); } } } void MSActionButton::newBoolModelNotify(void) {state(boolModel());} void MSActionButton::set(MSAttrValueList& avList_) { MSButton::set(avList_); MSIndexVector index; for (unsigned i=0;i #include #include #include #include #define MStkVersion "%W%" class WidgetDestructionQueue { public: MSUnsignedLongVector _widgetList; MSBoolean _allowWidgetDestruction; MSBoolean _processingQueue; WidgetDestructionQueue(void); ~WidgetDestructionQueue(void); MSBoolean allowWidgetDestruction(void) const {return _allowWidgetDestruction;} void allowWidgetDestruction(MSBoolean allow_) {_allowWidgetDestruction=allow_;} void add(MSWidget *); MSBoolean processQueue(void); }; class ServerList { public: MSUnsignedLongVector _serverList; MSBoolean _destroyingList; ServerList(void); ~ServerList(void); unsigned numberOfServers(void) const {return _serverList.length();} MSDisplayServer *serverFromDisplay(Display *); MSBoolean flushServers(void); MSBoolean add(MSDisplayServer *); MSBoolean remove(MSDisplayServer *); }; MSApplication *MSApplication::_application=0; MSMainLoop *MSApplication::_mainLoop=0; WidgetDestructionQueue *MSApplication::_widgetDestructionQueue=0; ServerList *MSApplication::_serverList=0; unsigned long MSApplication::_doubleClickInterval=250; MSBoolean MSApplication::_backingStoreOption=MSFalse; MSStringVector MSApplication::_argumentList; WidgetDestructionQueue::WidgetDestructionQueue(void) : _allowWidgetDestruction(MSFalse), _processingQueue(MSFalse) {} WidgetDestructionQueue::~WidgetDestructionQueue(void) {} // do not allow a widget to be placed on the list twice void WidgetDestructionQueue::add(MSWidget *pWidget_) { if (_widgetList.indexOf((unsigned long)pWidget_)==_widgetList.length()) { _widgetList.append((unsigned long)pWidget_); } } // this method is not reentrant and thus a variable is used // to protect it from being reentered. // _processingQueue==MSTrue when inside the method. // _allowWidgetDestruction is set to MSTrue to allow // children of the widget to be deleted without being // placed on the queue MSBoolean WidgetDestructionQueue::processQueue(void) { MSBoolean didWork=MSFalse; if (_processingQueue==MSFalse&&_widgetList.length()>0) { _processingQueue=MSTrue; _allowWidgetDestruction=MSTrue; // make a copy to prevent add from effecting the list // we must maintain the integrity of the list // during the processing loop. MSUnsignedLongVector widgetList=_widgetList; unsigned n=widgetList.length(); _widgetList.removeAll(); for (unsigned i=0;i0) { _destroyingList=MSTrue; unsigned n=_serverList.length(); for (unsigned i=0;i0) { unsigned n=_serverList.length(); for (unsigned i=0;iflush()==MSTrue) didWork=MSTrue; } } return didWork; } MSDisplayServer *ServerList::serverFromDisplay(Display *pDisplay_) { if (_serverList.length()>0) { unsigned n=_serverList.length(); for (unsigned i=0;idisplay()==pDisplay_) return pServer; } } return 0; } // do not allow a widget to be placed on the list twice MSBoolean ServerList::add(MSDisplayServer *pServer_) { if (_serverList.indexOf((unsigned long)pServer_)==_serverList.length()) { _serverList.append((unsigned long)pServer_); return MSTrue; } return MSFalse; } MSBoolean ServerList::remove(MSDisplayServer *pServer_) { if (_destroyingList==MSFalse&&_serverList.length()>0) { unsigned index=_serverList.indexOf((unsigned long)pServer_); if (index<_serverList.length()) { _serverList.removeAt(index); return MSTrue; } } return MSFalse; } MSApplicationMainLoop::MSApplicationMainLoop(MSApplication *pApplication_) : _application(pApplication_) {} MSApplicationMainLoop::~MSApplicationMainLoop(void) {} MSApplication *MSApplicationMainLoop::application(void) { return _application; } MSBoolean MSApplicationMainLoop::flush(void) { return _application->flush(); } void MSApplicationMainLoop::userProcessing(void) { _application->processWidgetDestructionQueue(); } void MSApplicationMainLoop::terminateLoop(void) { _application->allowWidgetDestruction(MSTrue); _application->terminateLoop(); } MSApplication::MSApplication(void) { init(0,0); } MSApplication::MSApplication(int argc_,char **argv_) { init(argc_,argv_); } void MSApplication::init(int argc_,char **argv_) { if (_application==0) { _application=this; for (unsigned i=0;iadd(pWidget_); } void MSApplication::allowWidgetDestruction(MSBoolean allow_) { _widgetDestructionQueue->allowWidgetDestruction(allow_); } MSBoolean MSApplication::allowWidgetDestruction(void) { return _widgetDestructionQueue->allowWidgetDestruction(); } void MSApplication::processWidgetDestructionQueue(void) { _widgetDestructionQueue->processQueue(); } // defaults to be overriden by subclasses void MSApplication::loop(void) { if (_mainLoop==0) _mainLoop=new MSApplicationMainLoop(this); if (_application!=0&&_mainLoop!=0) _mainLoop->loop(); else { MSMessageLog::criticalMessage("Exiting Application - need to create an MSApplication object\n"); MSMessageLog::criticalMessage("exit(255) from MSApplication::loop() ...\n"); exit(255); } } // allow the delete queue to delete everything - i.e. do not queue anymore widgets void MSApplication::terminateLoop(void) { allowWidgetDestruction(MSTrue); } void MSApplication::quit(void) { _application->continueLoop(MSFalse); } MSString MSApplication::version(void) { MSString aString(MStkVersion); unsigned index=aString.lastIndexOf(','); unsigned index2=aString.lastIndexOf(',',index-1); if (index2add(pServer_); return MSFalse; } MSBoolean MSApplication::removeServer(MSDisplayServer *pServer_) { if (_serverList!=0) { processWidgetDestructionQueue(); return _serverList->remove(pServer_); } return MSFalse; } unsigned MSApplication::numberOfServerConnections(void) { if (_serverList!=0) return _serverList->numberOfServers(); return 0; } MSDisplayServer *MSApplication::server(Display *pDisplay_) { if (_serverList!=0) return _serverList->serverFromDisplay(pDisplay_); return 0; } MSBoolean MSApplication::flush(void) { if (_serverList!=0) return _serverList->flushServers(); return MSFalse; } // #################################################################### // extern methods // #################################################################### void applicationAddToWidgetDestructionQueue(MSWidget *pWidget_) { MSApplication::addToWidgetDestructionQueue(pWidget_); } MSBoolean applicationAllowWidgetDestruction(void) { return MSApplication::allowWidgetDestruction(); } unsigned long applicationDoubleClickInterval(void) { return MSApplication::doubleClickInterval(); } MSBoolean applicationBackingStoreOption(void) { return MSApplication::backingStoreOption(); } MSBoolean applicationAddServer(MSDisplayServer *pServer_) { return MSApplication::addServer(pServer_); } MSBoolean applicationRemoveServer(MSDisplayServer *pServer_) { return MSApplication::removeServer(pServer_); } MSDisplayServer *applicationDisplayServer(Display *display_) { return MSApplication::server(display_); } MSString applicationArgumentString(void) { return MSApplication::argumentString(); } MSString applicationVersionString(void) { return MSApplication::version(); } void applicationQuit(void) { MSApplication::quit(); } void applicationWarningMessage(const char *msg_) { MSMessageLog::warningMessage(msg_); } void applicationExit(void) { // try to exit cleanly - i.e. allow app to terminate normally if (MSApplication::application()!=0) { MSApplication::application()->terminateLoop(); } exit(255); } // #################################################################### // inline methods // #################################################################### unsigned long MSApplication::doubleClickInterval(void) { return _doubleClickInterval; } void MSApplication::doubleClickInterval(unsigned long doubleClickInterval_) { _doubleClickInterval=doubleClickInterval_; } MSBoolean MSApplication::backingStoreOption(void) { return _backingStoreOption; } void MSApplication::backingStoreOption(MSBoolean backingStoreOption_) { _backingStoreOption=backingStoreOption_; } MSApplication *MSApplication::application(void) { return _application; } MSMainLoop *MSApplication::mainLoop(void) { return _mainLoop; } const MSStringVector& MSApplication::argumentList(void) { return _argumentList; } const MSString& MSApplication::argument(unsigned index_) { return _argumentList(index_); } void MSApplication::flushAndProcess(MSBoolean blocking_) { if (_mainLoop!=0) _mainLoop->flushAndProcess(blocking_); } MSBoolean MSApplication::continueLoop(void) { return (_mainLoop!=0)?_mainLoop->continueLoop():MSFalse; } void MSApplication::continueLoop(MSBoolean continueLoop_) { if (_mainLoop!=0) _mainLoop->continueLoop(continueLoop_); } #ifdef MS_WINDOWS MSWidget* MSApplication::findWidget(Window win_) { MSWidget *pWidget=0; MSHashTable *hashTable=0; for(unsigned i=0;i<_serverList->_serverList.length();i++) { hashTable=((MSDisplayServer*)_serverList->_serverList(i))->widgetHashTable(); pWidget=(MSWidget *)hashTable->lookup(win_); if((unsigned long)pWidget!=hashTable->notFound()) break; } return pWidget; } #endif aplus-fsf-4.22/src/MSGUI/MSArrayView.C0000644000265000001440000024020110772770400012751 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include static const unsigned MSArrayViewColumnDefaultEditWidth=256; #ifdef MS_NO_INLINES #include #endif MSArrayView::MSArrayView(MSWidget *owner_,const char *title_) : MSRowColumnView(owner_,title_) { init(); } MSArrayView::MSArrayView(MSWidget *owner_,const MSStringVector& title_) : MSRowColumnView(owner_,title_) { init(); } MSArrayView::~MSArrayView(void) { delete _stipple; } void MSArrayView::init(void) { _stipple=new MSPixmap(server(),MSPixmap::ForegroundFiftyPixmap,1,0,1); //Set default values for attributes _fixedColumns=0; _rowSeparator=1; _columnSeparator=1; _columnWidth=9; _selectedColumn=-1; _selectBg=background(); XSetStipple(display(),textGC(),_stipple->pixmap()); } // default methods that can be overriden by subclass that supports // extra view manipulation functionalities const char *MSArrayView::viewFormatOutput(MSString &buffer_,unsigned row_,unsigned column_) { return formatOutput(buffer_,row_,column_); } MSBoolean MSArrayView::viewValidate(const char *string_,unsigned row_,unsigned column_) { return validate(string_,row_,column_);} MSBoolean MSArrayView::isViewProtected(unsigned row_,unsigned column_) { return isCellProtected(row_,column_);} MSBoolean MSArrayView::isViewValid(unsigned row_,unsigned column_) { return isValid(row_,column_);} unsigned long MSArrayView::viewCellForeground(unsigned row_,unsigned column_) { return cellForeground(row_,column_); } unsigned long MSArrayView::viewCellBackground(unsigned row_,unsigned column_) { return cellBackground(row_,column_); } Font MSArrayView::viewCellFont(unsigned row_,unsigned column_) { return cellFont(row_,column_);} MSAlignment MSArrayView::viewCellAlignment(unsigned row_,unsigned column_) { return cellAlignment(row_,column_);} // default methods that should be overriden by data specific subclasses const char *MSArrayView::formatOutput(MSString &buffer_,unsigned,unsigned) { return buffer_.string();} MSBoolean MSArrayView::validate(const char *,unsigned,unsigned) { return MSFalse; } //"isProtected(row,col)" isonly kept for Backward compatibility //It's use is now deprecated in favor of isCellProtected MSBoolean MSArrayView::isCellProtected(unsigned r_,unsigned c_) { return isProtected(r_,c_); } MSBoolean MSArrayView::isProtected(unsigned,unsigned) { return MSRowColumnView::isProtected(); } MSBoolean MSArrayView::isProtected(void) const { return MSRowColumnView::isProtected(); } MSBoolean MSArrayView::isValid(unsigned,unsigned) { return sensitive();} unsigned long MSArrayView::cellForeground(unsigned row_,unsigned) { if (foregroundColors().length()==0) return foreground(); else return foregroundColors()(row_%foregroundColors().length()); } unsigned long MSArrayView::cellBackground(unsigned row_,unsigned) { if (backgroundColors().length()==0) return background(); else return backgroundColors()(row_%backgroundColors().length()); } Font MSArrayView::cellFont(unsigned,unsigned) { return font(); } MSAlignment MSArrayView::cellAlignment(unsigned,unsigned) { return MSLeft; } MSString MSArrayView::selection(void) { MSString buffer; viewFormatOutput(buffer,selectedRow(),selectedColumn()); return buffer; } int MSArrayView::labelWidth(void) { return 0; } void MSArrayView::defaultNumVisible(void) { if ((sizeState()&RowsValid)!=RowsValid) { _rows=5; _rows=(rows()<=numRows())?rows():numRows(); } if ((sizeState()&ColsValid)!=ColsValid) { _columns=2; _columns=(columns()<=numColumns())?columns():numColumns(); _columns=(columns()<=0)?0:columns(); } } void MSArrayView::adjustView(void) { //This method resets the first column as a result of the widget being //resized or scrolling. if (firstColumn()>fixedColumns()) { int offset=panner()->highlightThickness()+panner()->shadowThickness(); int deltaWidth=panner()->width()-2*offset-drawWidth(); int i=firstColumn(); int count=1; while (deltaWidth>0&&i>0) { deltaWidth-=columnPixelWidth(firstColumn()-count); if (deltaWidth>=0) i--; count++; } if (i!=firstColumn()) { _firstColumn=i; _firstColumn=(firstColumn()>=fixedColumns())?firstColumn():fixedColumns(); _columns=computeNumVisibleColumns(); updateView(); firstColumnChangeNotify(); } } } void MSArrayView::adjustFirstColumn(void) { // This method ensures the first column setting makes sense int oldFirstColumn=firstColumn(); if (firstColumn()fixedColumns()&& firstColumn()+columns()-fixedColumns()>=numColumns()) { _firstColumn=(numColumns()>columns())? (numColumns()-columns()+fixedColumns()):fixedColumns(); _firstColumn=(firstColumn()>=fixedColumns())?firstColumn():fixedColumns(); } if (oldFirstColumn!=firstColumn()) firstColumnChangeNotify(); } void MSArrayView::adjustNumVisible(void) { //This method is called to adjust the following data members: _row, _column, //_firstRow, _firstColumn. updateInternalState(); if ((sizeState()&AdjustSize)==AdjustSize) { _rows=computeNumVisibleRows(); _rows=(rows()<0)?0:rows(); adjustFirstRow(); adjustFirstColumn(); _columns=computeNumVisibleColumns(); _columns=(columns()<=0)?0:columns(); adjustSelection(); updateHsb(); updateVsb(); } } void MSArrayView::adjustSelection(void) { int sr=selectedRow(); if (selectedRow()>=0) { if (selectedRow()>=numRows()&&selectedColumn()>=numColumns()) { _selectedRow=numRows()-1; _selectedColumn=numColumns()-1; } else if (selectedRow()>=numRows()) _selectedRow=numRows()-1; if (sr!=selectedRow()&&editor()->mapped()==MSTrue) unmapEditor(); } } void MSArrayView::shapeUpdate(void) { if (editor()->mapped()==MSTrue) unmapEditor(); removeAllCycles(); if (numRows()==0) adjustNumVisible(); else { updateInternalState(); updateHsb(); updateVsb(); adjustFirstRow(); adjustFirstColumn(); if (selectedRow()>=0) { if (selectedRow()>=numRows()&&selectedColumn()>=numColumns()) { _selectedRow=numRows()-1; _selectedColumn=numColumns()-1; } else if (selectedRow()>=numRows()) _selectedRow=numRows()-1; else if (selectedColumn()>=numColumns()) _selectedColumn=numColumns()-1; if (selectedRow()<0||selectedColumn()<0) { _selectedRow=-1; _selectedColumn=-1; } } // If we are in multiple selection mode, always make sure the current // selected row is in the selection vector. if (selectionMode()==MSMultiple&&selectedRow()!=-1&& selectionVector().indexOf(selectedRow())==selectionVector().length()) { _selectionVector.append(selectedRow()); _selectionVector.sortUp(); } updateScrollBars(); } redrawImmediately(); } void MSArrayView::appendUpdate(void) { int rs=vsb()->max(); updateVsb(); if (rs>=firstRow()&&rs<=lastRow()) { drawHSeparators(panner()->window(),firstRow(),lastRow(),firstColumn(),lastColumn()); drawVSeparators(panner()->window(),firstRow(),lastRow(),firstColumn(),lastColumn()); moveSelection(selectedRow(),selectedColumn()); } } void MSArrayView::updateVsb(void) { vsb()->max(numRows()); vsb()->valueChange(firstRow()); vsb()->viewSize(rows()); vsb()->pageInc(rows()-1); if (isVsbEnabled()==MSTrue) { if (rows()width()>1) { vsb()->moveTo(panner()->x_origin()+panner()->width()+spacing(), panner()->y_origin()+headingsHeight()); vsb()->height(panner()->height()-headingsHeight()); if (vsb()->mapped()==MSFalse) vsb()->map(); } else if (vsb()->mapped()==MSTrue) vsb()->unmap(); } } void MSArrayView::vsbValueUpdate(void) { if (editorActivate()==MSTrue) { if (vsb()->value()value(),selectedRow()); else if (vsb()->value()>firstRow()) scrollUp(vsb()->value()-firstRow(),selectedRow()); } else updateScrollBars(); } void MSArrayView::moveSelection(int row_,int column_) { int oldRow=selectedRow(); int oldCol=selectedColumn(); if (row_==-1||column_==-1) { _selectedRow=row_; undrawSelectedRow(panner()->window(),oldRow); _selectedColumn=column_; } if (row_==selectedRow()&&column_!=selectedColumn()) { _selectedColumn=column_; undrawSelectedCell(panner()->window(),selectedRow(),oldCol); drawSelectedCell(panner()->window(),selectedRow(),selectedColumn()); } else if (column_==selectedColumn()&&row_!=selectedRow()) { _selectedRow=row_; undrawSelectedRow(panner()->window(),oldRow); drawSelectedRow(panner()->window(),selectedRow()); } else if (column_!=selectedColumn()&&row_!=selectedRow()) { _selectedRow=row_; undrawSelectedRow(panner()->window(),oldRow); _selectedColumn=column_; drawSelectedRow(panner()->window(),selectedRow()); } else drawSelectedRow(panner()->window(),selectedRow()); } void MSArrayView::drawSelectedCell(Window window_,int row_,int column_) { drawSelectedCell(window_,row_,column_,MSTrue); } void MSArrayView::undrawSelectedCell(Window window_,int row_,int column_) { drawSelectedCell(window_,row_,column_,MSFalse); } void MSArrayView::drawSelectedRow(Window window_,int row_) { drawSelectedRow(window_,row_,MSTrue); } void MSArrayView::undrawSelectedRow(Window window_,int row_) { drawSelectedRow(window_,row_,MSFalse); } void MSArrayView::drawSelectedRow(int row_) { drawSelectedRow(panner()->window(),row_,MSTrue); } void MSArrayView::undrawSelectedRow(int row_) { drawSelectedRow(panner()->window(),row_,MSFalse); } void MSArrayView::drawSelectedRow(int row_,MSBoolean select_) { drawSelectedRow(panner()->window(),row_,select_); } void MSArrayView::cleanUpDrawArea(Window window_) { cleanUpBottom(window_);cleanUpRight(window_); } // used for cell updates only void MSArrayView::drawRowColumn(int row_,int column_) { if (row_window(),computeXCoord(column_),computeYCoord(row_),row_,column_); } } void MSArrayView::drawColumn(int column_) { if (column_window(),column_,column_); drawRows(panner()->window(),firstRow(),lastRow(),column_,column_); } } void MSArrayView::drawSelectedRow(Window window_,int row_,MSBoolean select_) { if (row_highlightThickness()+panner()->shadowThickness()+labelWidth(); int y=computeYCoord(row_); int j=0; int x=offset; int n=numColumns(); for (j=0;jhighlightThickness()+panner()->shadowThickness(); if (r_.x()+r_.width()>panner()->width()-offset) { r_.width(panner()->width()-offset-r_.x()); } (select_==MSTrue)?drawRaised(panner()->window(),r_,columnSpacing()): undrawBevel(panner()->window(),r_,columnSpacing()); } void MSArrayView::drawSelectedCell(Window window_,int row_,int column_,MSBoolean select_) { if (inRowRange(row_)==MSTrue&&inColRange(column_)==MSTrue) { int x=computeXCoord(column_); int y=computeYCoord(row_); if (select_==MSFalse) { MSRect aRect(x,y,columnPixelWidth(column_),rowHeight()); drawSelectBevel(aRect,MSFalse); } drawCell(panner()->window(),x,y,row_,column_); if (select_==MSFalse) { drawHSeparators(window_,row_,row_,column_,column_); drawVSeparators(window_,row_,row_,column_,column_); } } } void MSArrayView::updateSelectedRow(int row_) { int row=selectedRow(); if (row_>=0&&row_lastRow()) scrollUp(row_-(firstRow()+rows())+1,row_); else if (row_=numRows()) row_=numRows()-1; if (row_>=0&&row_diff)?diff:row_; _firstRow=(firstRow()>=0)?firstRow():0; redrawImmediately(); if (selectedRow()>=0&&selectedRow()>=numRows()) selectedRow(numRows()-1); } if (oldFirstRow!=firstRow()) firstRowChangeNotify(); } void MSArrayView::setSelection(int row_,int column_) { if (row_!=selectedRow()||column_!=selectedColumn()) { int oldFirstColumn=firstColumn(); int oldFirstRow=firstRow(); if (column_==-1||row_==-1) moveSelection(-1,-1); else { //If we're in multiple selection mode, add the new selection to the //selection vector if (row_!=selectedRow()&&selectionMode()==MSMultiple) { if (selectionVector().indexOf(row_)==selectionVector().length()) { _selectionVector.append(row_); _selectionVector.sortUp(); } } if (column_>=fixedColumns()&&column_=0&&row_numColumns()-columns()+fixedColumns())? numColumns()-columns()+fixedColumns():column_; _selectedColumn=column_; } if (inRowRange(row_)==MSTrue) _selectedRow=row_; else { _firstRow=(row_>numRows()-rows())? numRows()-rows():row_; _selectedRow=row_; } redrawImmediately(); } } else if (column_>=0&&column_window(),selectedRow(),selectedColumn()); _selectedColumn=column_; if (row_>lastRow()) scrollUp(row_-(firstRow()+rows())+1,row_); else if (row_0) { unsigned oldFirstColumn=firstColumn(); if (firstColumn()+columns()+count_-fixedColumns()>numColumns()) { count_=numColumns()-(lastColumn()+1); } if (count_>=columns()-fixedColumns()) { _firstColumn+=count_; _columns=computeNumVisibleColumns(); _firstColumn=(firstColumn()>numColumns()-columns()+fixedColumns())? numColumns()-columns()+fixedColumns():firstColumn(); updateView(); adjustView(); if (selectedColumn()>=firstColumn()+columns()-fixedColumns()) { _selectedColumn=firstColumn()+columns()-fixedColumns()-1; } redrawImmediately(); } else { int delta=0; int i; for (i=0;ihighlightThickness()+panner()->shadowThickness(); int offset2=offset<<1; int src_x=offset+fw+delta+labelWidth(); int src_y=columnHeadingsOffset(); int dest_x=offset+fw+labelWidth(); int dest_y=src_y; int h=panner()->height()-offset2; int cs=lastColumn()+1; int w=0; int oldFirst=firstColumn(); for (i=firstColumn()+count_;i<=lastColumn();i++) w+=columnPixelWidth(i); cs=(csnumColumns()-columns()+fixedColumns())? numColumns()-columns()+fixedColumns():firstColumn(); updateView(); if (selectedColumn()>lastColumn()) _selectedColumn=lastColumn(); XCopyArea(display(),panner()->window(),panner()->window(), panner()->backgroundShadowGC(),src_x,src_y,w,h,dest_x,dest_y); if (columnSeparator()>0) { XRectangle *rects=new XRectangle[columns()]; int n=0; int sum=delta; for (int k=firstColumn();k<=lastColumn();k++) { sum+=columnPixelWidth(k); if (sum>w) { rects[n].x=offset+fw+labelWidth()+sum-columnSpacing(); rects[n].y=offset+headingsHeight(); rects[n].width=columnSpacing(); rects[n].height=panner()->height()-offset2-headingsHeight(); n++; } } if (n>0) XFillRectangles(display(),panner()->window(), panner()->backgroundShadowGC(),rects,n); delete []rects; } int cw=0; for (i=cs;i<=lastColumn()&&iwidth()-offset) { int nRows=(rows()>0)?rows():1; XRectangle *back=new XRectangle[nRows+1]; XRectangle *sback=new XRectangle[nRows]; int b=0,sb=0; int hh=rowHeight(); int xx=dest_x+w+cw; int yy=offset+headingsHeight(); int ww=panner()->width()-offset-xx; int nr=numRows(); int inc=rowSeparator(); back[b].x=xx; back[b].y=offset; back[b].width=ww; back[b].height=headingsHeight()-rowSpacing(); b++; for (int r=firstRow();r<=lastRow()&&r0) hh=(r%inc==inc-1||r==nr-1)?rowHeight()-rowSpacing():rowHeight(); if (selected(r)==MSTrue) { sback[sb].x=xx; sback[sb].y=yy; sback[sb].width=ww; sback[sb].height=hh; sb++; } else { back[b].x=xx; back[b].y=yy; back[b].width=ww; back[b].height=hh; b++; } yy+=rowHeight(); } if (b>0) XFillRectangles(display(),panner()->window(),backgroundShadowGC(),back,b); if (sb>0) XFillRectangles(display(),panner()->window(),selectionVectorGC(),sback,sb); delete [] back; delete [] sback; } drawRows(panner()->window(),firstRow(),lastRow(),cs,lastColumn()); redrawHeadings(panner()->window(),cs,lastColumn()); cleanUpRight(panner()->window()); cleanUpBottom(panner()->window()); updateScrollBars(); } if (oldFirstColumn!=firstColumn()) firstColumnChangeNotify(); } } // left arrow void MSArrayView::scrollLeft(int count_) { if (firstColumn()>fixedColumns()&&count_>0) { unsigned oldFirstColumn=firstColumn(); if (firstColumn()-count_=columns()-fixedColumns()) { _firstColumn-=count_; _firstColumn=(firstColumn()>fixedColumns())?firstColumn():fixedColumns(); _columns=computeNumVisibleColumns(); updateView(); redrawImmediately(); } else { int fw=fixedColumnPixelWidth(); int delta=0; int i; for (i=1;i<=count_;i++) delta+=columnPixelWidth(firstColumn()-i); int offset=panner()->highlightThickness()+panner()->shadowThickness(); int offset2=offset<<1; int src_x=offset+fw+labelWidth(); int src_y=columnHeadingsOffset(); int dest_x=src_x+delta; int dest_y=src_y; int h=panner()->height()-offset2; int w=0; _firstColumn-=count_; _firstColumn=(firstColumn()>fixedColumns())?firstColumn():fixedColumns(); _columns=computeNumVisibleColumns(); for (i=firstColumn()+count_;i<=lastColumn();i++) w+=columnPixelWidth(i); updateView(); XCopyArea(display(),panner()->window(),panner()->window(), backgroundShadowGC(),src_x,src_y,w,h,dest_x,dest_y); if (columnSeparator()>0) { XRectangle *rects=new XRectangle[columns()]; int n=0; int sum=0; for (int k=firstColumn()+count_;k<=lastColumn()+count_&&sumheight()-offset2-headingsHeight(); n++; } } if (n>0) XFillRectangles(display(),panner()->window(),backgroundShadowGC(),rects,n); delete []rects; } if (dest_x+wwidth()-offset) { int nRows=(rows()>0)?rows():1; XRectangle *back=new XRectangle[nRows+1]; XRectangle *sback=new XRectangle[nRows]; int b=0,sb=0; int hh=rowHeight(); int xx=dest_x+w; int yy=offset+headingsHeight(); int ww=panner()->width()-offset-xx; int nr=numRows(); int inc=rowSeparator(); back[b].x=xx; back[b].y=offset; back[b].width=ww; back[b].height=headingsHeight()-rowSpacing(); b++; for (int r=firstRow();r<=lastRow()&&r0) hh=(r%inc==inc-1||r==nr-1)?rowHeight()-rowSpacing():rowHeight(); if (selected(r)==MSTrue) { sback[sb].x=xx; sback[sb].y=yy; sback[sb].width=ww; sback[sb].height=hh; sb++; } else { back[b].x=xx; back[b].y=yy; back[b].width=ww; back[b].height=hh; b++; } yy+=rowHeight(); } if (b>0) XFillRectangles(display(),panner()->window(),backgroundShadowGC(),back,b); if (sb>0) XFillRectangles(display(),panner()->window(),selectionVectorGC(),sback,sb); delete [] back; delete [] sback; } drawRows(panner()->window(),firstRow(),lastRow(),firstColumn(),firstColumn()+count_); redrawHeadings(panner()->window(),firstColumn(),firstColumn()+count_); cleanUpRight(panner()->window()); cleanUpBottom(panner()->window()); updateScrollBars(); } if (oldFirstColumn!=firstColumn()) firstColumnChangeNotify(); } } void MSArrayView::postVerticalScrollDraw(int rs_,int re_,MSBoolean drawNewRow_) { drawLabels(panner()->window(),rs_,re_); if (drawNewRow_==MSTrue) { drawRows(panner()->window(),rs_,re_); } cleanUpBottom(panner()->window()); } void MSArrayView::left(void) { if (editorActivate()==MSTrue) { if (selectedColumn()>0) { clearSelection(); if (selectionMode()==MSMultiple) { lastBlock(selectedRow()); _selectionVector.append(selectedRow()); } selectedColumn(selectedColumn()-1); } } } void MSArrayView::right(void) { if (editorActivate()==MSTrue) { if (selectedColumn()mapped()==MSFalse) { if (selectedColumn()=0&&selectedRow()xbutton.subwindow==panner()->window()) { // See if we can get the focus if (traverseFocus(this)==MSTrue) { // We want to process button event if the widget has data in it if (numRows()>0&&numColumns()>0) { // if the editor is active, validate the input and unmap it if (editorActivate()==MSTrue) { // recompute the the (x,y) of the event relative to the // position of the panner XEvent *pEvent=(XEvent *)pEvent_; pEvent->xbutton.y-=panner()->y_origin(); pEvent->xbutton.x-=panner()->x_origin(); if (pEvent->xbutton.yxbutton.xxbutton.xxbutton.subwindow); if (pWidget!=0) { if (pWidget->sensitive()==MSTrue) { XEvent *pEvent=(XEvent *)pEvent_; pEvent->xbutton.x-=pWidget->x_origin(); pEvent->xbutton.y-=pWidget->y_origin(); buttonPressNotify(pWidget,pEvent); } } } } void MSArrayView::headingLabelAreaSelection(const XEvent *) { labelSelection(); } void MSArrayView::headingAreaSelection(const XEvent *pEvent_) { // Figure out the column selected by the button int col=columnFromEvent(pEvent_); if (inColRange(col)==MSTrue) { if (selectedColumn()!=col) { int row; if (selectedRow()<0&&numRows()>0) row=0; else row=selectedRow(); if (row>=0) { if (hasCallback(MSWidgetCallback::columnselection)==MSTrue|| hasCallback(MSWidgetCallback::columnmenubutton)==MSTrue) { setSelection(row,col); } else selectedRowColumn(row,col); } } if (selectedColumn()>=0&&selectedRow()>=0) { if (pEvent_->xbutton.button==Button3) { columnMenuButtonSelection(); } else { columnSelection(); } } } } void MSArrayView::labelAreaSelection(const XEvent *pEvent_) { // Figure out the row selected by the button int row=yToRow(pEvent_->xbutton.y-headingsHeight())+firstRow(); if (inRowRange(row)==MSTrue) { lastBlock(row); if (selectionMode()==MSMultiple) { clearSelection(); _selectionVector.append(row); } if (selectedRow()!=row) { int col; if (selectedColumn()<0&&numColumns()>0) col=0; else col=selectedColumn(); if (row>=0) { if (callback(MSWidgetCallback::rowselection)==0) selectedRowColumn(row,col); else setSelection(row,col); } } rowSelection(); } } void MSArrayView::dataAreaSelection(const XEvent *pEvent_) { int col=columnFromEvent(pEvent_); int row=yToRow(pEvent_->xbutton.y-headingsHeight())+firstRow(); if (rowxbutton.time); if (pEvent_->xbutton.button==Button1) { if (selectionMode()==MSMultiple) { // if control key is held down if (pEvent_->xbutton.state&ControlMask) { // Control is held down, so check if the selected item is in // the selection vector, if so, track erase selection, else // track selection if (selectionVector().indexOf(row)!=selectionVector().length()) trackUnselection(row,col); else trackSelection(row,col,MSFalse,MSFalse); } else { if (pEvent_->xbutton.state&ShiftMask) trackSelection(row,col,MSFalse,MSTrue); else trackSelection(row,col,MSTrue,MSFalse); } } else { if ((pEvent_->xbutton.state&ControlMask)&&selectedRow()==row) { selectedRowColumn(-1,-1); } else selectedRowColumn(row,col); } } else { clearSelection(); if (selectionMode()==MSMultiple) { lastBlock(row); _selectionVector.append(row); } selectedRowColumn(row,col); } } else if (selectedColumn()==col&&selectedRow()==row) { if (pEvent_->xbutton.button==Button1) { if (isDoubleClick(pEvent_)==MSTrue) defaultDoubleClickBehavior(pEvent_); else if (selectionMode()==MSMultiple) { // if control key is held down, track erase selection if (pEvent_->xbutton.state&ControlMask) trackUnselection(row,col); else { if (pEvent_->xbutton.state&ShiftMask) trackSelection(row,col,MSFalse,MSTrue); else trackSelection(row,col,MSTrue,MSFalse); } } else { if (pEvent_->xbutton.state&ControlMask) { selectedRowColumn(-1,-1); } } return; } else if (pEvent_->xbutton.button!=Button1) { // Let's clear the selection Vector first if (selectionMode()==MSMultiple) { if (selectionVector().length()>1) { clearSelection(); lastBlock(row); _selectionVector.append(row); drawSelectedRow(panner()->window(),row); rowColumnSelection(); } } } } if (pEvent_->xbutton.button==Button1) defaultButton1Behavior(pEvent_); else if (pEvent_->xbutton.button==Button2) defaultButton2Behavior(pEvent_); else if (pEvent_->xbutton.button==Button3) defaultButton3Behavior(pEvent_); } } void MSArrayView::update(const MSIndexVector& aIndexVector_) { if (aIndexVector_.length()==0) { if (vsb()->max()!=numRows() || hsb()->max()!=numColumns()) shapeUpdate(); else redrawImmediately(); } else { if (vsb()->max()!=numRows()) appendUpdate(); if (numColumns()>1) { unsigned nRows=numRows(); unsigned nColumns=numColumns(); unsigned row,column,index; for (unsigned i=0;imapped()==MSTrue) { if (viewValidate(editor()->string(),selectedRow(),selectedColumn())==MSTrue) { unmapEditor(); } } return (editor()->mapped()==MSTrue)?MSFalse:MSTrue; } int MSArrayView::drawHeight(void) { return rows()*rowHeight(); } int MSArrayView::drawWidth(void) { int sum=0; int nc=numColumns(); if (nc==0) sum=columns()*columnPixelWidth(0); else { int lc=lastColumn(); sum=labelWidth()+fixedColumnPixelWidth(); for (int i=firstColumn();i<=lc&&ihighlightThickness()+panner()->shadowThickness(); int h=panner()->height()-2*offset-headingsHeight(); int r=0; while (h>=rowHeight()) { r++; h-=rowHeight(); } return r; } int MSArrayView::computeNumVisibleColumns(void) { //This method calculates and returns the number of columns that can be fitted //into the current window size int offset=panner()->highlightThickness()+panner()->shadowThickness(); int c=fixedColumns(),fc=firstColumn(),i=fc,nCols=numColumns(); int deltaWidth=panner()->width()-2*offset-fixedColumnPixelWidth()-labelWidth(); int sum=columnPixelWidth(i); while (sum<=deltaWidth&&ihighlightThickness()+panner()->shadowThickness()+labelWidth(); int i; if (column_lock(); XFillRectangle(display(),redrawPixmap()->pixmap(),backgroundShadowGC(), 0,0,panner()->width(),panner()->height()); drawRows(redrawPixmap()->pixmap(),firstRow(),lastRow()); drawHeadings(redrawPixmap()->pixmap()); drawLabels(redrawPixmap()->pixmap(),firstRow(),lastRow()); cleanUpBottom(redrawPixmap()->pixmap()); int ht=panner()->highlightThickness(); MSRect aRect(ht,ht,panner()->width()-2*ht,panner()->height()-2*ht); drawBevel(redrawPixmap()->pixmap(), aRect,panner()->shadowStyle(),panner()->shadowThickness()); XCopyArea(display(),redrawPixmap()->pixmap(),panner()->window(), backgroundShadowGC(), 0,0,panner()->width(),panner()->height(),0,0); moveSelection(selectedRow(),selectedColumn()); updateScrollBars(); XFlush(display()); redrawPixmap()->unlock(); } } void MSArrayView::drawCell(Window window_,int x_,int y_,int row_,int column_, unsigned long foreground_,unsigned long background_,Font fid_, MSBoolean rowSelected_,MSBoolean cellSelected_,MSBoolean cellValid_) { int po=panner()->highlightThickness()+panner()->shadowThickness(); const XFontStruct *fontStruct=columnFontStruct(column_); MSFontObject fontObj(fontStruct); if (fontObj.font()!=fid_) fontObj.fontStruct(server()->fontStruct(fid_)); int cpw=columnPixelWidth(column_); int acpw=cpw-2*columnSpacing(); // available column width int fh=(needRowSep(row_)==MSTrue)?rowHeight()-rowSpacing():rowHeight(); int ww=(needColSep(column_)==MSTrue)?cpw-columnSpacing():cpw; int twidth=fontObj.textWidth("*",1); int len=(twidth>0)?acpw/twidth:0; if (columns()==1&&x_+ww>panner()->width()-po) ww=panner()->width()-po-x_; XSetForeground(display(),backgroundGC(),background_); XFillRectangle(display(),window_,backgroundGC(),x_,y_,ww,fh); GC gc; if (column_==lastColumn()||(columns()<=fixedColumns()&&column_==columns()-1)) { if (column_==numColumns()-1) gc=backgroundShadowGC(); else { gc=(rowSelected_==MSTrue)?selectionVectorGC():backgroundShadowGC(); } XFillRectangle(display(),window_,gc,x_+cpw,y_,panner()->width()-po-(x_+cpw),fh); } MSString buffer; if (viewFormatOutput(buffer,row_,column_)!=0&&buffer.length()>0) { int cplen=buffer.length(); int w=fontObj.textWidth(buffer.string(),cplen); // the following is a temporary implementation of cell overflow which // displays *'s for a numeric column and truncates string columns. // This will not work if fonts are set on a cell basis. int xoff=0; XSetForeground(display(),textGC(),foreground_); XSetFont(display(),textGC(),fid_); int delta=(rowHeight()-2*rowSpacing()-fontObj.textHeight())>>1; if (cplen<=columnLength(column_)||w<=acpw) { MSAlignment alignment=viewCellAlignment(row_,column_); xoff=alignment==MSCenter?(cpw-w)/2:alignment==MSRight?acpw-w:0; } else if (columnClipMode(column_)==MSClipStars) { buffer=MSString::copy("*",len); cplen=len; } else { int utw=fontObj.textWidth(buffer.string(),cplen); if (cplen>0&&utw>acpw) cplen=computeMaxTextLength(fontObj.fontStruct(),buffer.string(),acpw,cplen); } if (cellValid_==MSFalse) { XSetFillStyle(display(),textGC(),FillStippled); XSetTSOrigin(display(),textGC(),x_,y_); } else XSetFillStyle(display(),textGC(),FillSolid); int startx=x_+columnSpacing()+xoff; int starty=y_+fontObj.textAscent()+delta+rowSpacing(); XDrawString(display(),window_,textGC(),fontObj.fontStruct(),startx,starty, buffer.string(),cplen); if (cellValid_==MSFalse) XSetFillStyle(display(),textGC(),FillSolid); } if (cellSelected_==MSTrue) { MSRect aRect(x_,y_,cpw,rowHeight()); drawSelectBevel(aRect,MSTrue); } } void MSArrayView::drawCell(Window window_,int x_,int y_,int row_,int column_) { unsigned cl=columnLength(column_); unsigned nRows=columnNumRows(column_); if (frozen()==MSFalse&&cl!=0&&row_0) { int offset=panner()->highlightThickness()+panner()->shadowThickness(); int x=computeXCoord(lastColumn()+1); int w=panner()->width()-offset-x; int rh=rowHeight(); int rs=rowSpacing(); int dh=rowHeight()-rowSpacing(); int thickness=rowSpacing()>>1; int inc=rowSeparator(); if (w>0&&thickness>0) { int i=firstRow(); int y=computeYCoord(i); int n=0; int k=0; int nRows=numRows(); if (inc>0&&lastColumn()>=numColumns()-1) { XRectangle *back=new XRectangle[rows()]; for (;i<=lastRow()&&i0) XFillRectangles(display(),window_,backgroundShadowGC(),back,n); delete [] back; } else { XRectangle *top=new XRectangle[rows()]; XRectangle *bottom=new XRectangle[rows()]; XRectangle *back=new XRectangle[rows()]; for (;i<=lastRow()&&i0&&((i%inc)==(inc-1)||i==nRows-1)) { dh=rh-rs; top[k].x=bottom[k].x=x; top[k].y=y+dh; bottom[k].y=top[k].y+thickness; top[k].width=bottom[k].width=w; top[k].height=bottom[k].height=thickness; k++; } else dh=rh; if (selected(i)==MSTrue) { back[n].x=x; back[n].y=y; back[n].width=w; back[n].height=dh; n++; } else if (i==selectedRow()) XFillRectangle(display(),window_,selectionVectorGC(),x,y,w,dh); y+=rh; } if (k>0) { XFillRectangles(display(),window_,bottomShadowGC(),top,k); XFillRectangles(display(),window_,topShadowGC(),bottom,k); } if (n>0) XFillRectangles(display(),window_,selectionVectorGC(),back,n); delete [] top; delete [] bottom; delete [] back; } } if (lastColumn()==numColumns()-1&&inRowRange(selectedRow())==MSTrue) { int x=computeXCoord(lastColumn())+columnPixelWidth(lastColumn()); int y=computeYCoord(selectedRow()); int offset=panner()->highlightThickness()+panner()->shadowThickness(); XFillRectangle(display(),window_,backgroundShadowGC(), x,y,panner()->width()-offset-x,rowHeight()); } } } void MSArrayView::drawVSeparators(Window window_,int rs_,int re_,int cs_,int ce_) { int inc=columnSeparator(); if (inc>0&&mapped()!=MSFalse&&frozen()!=MSTrue) { int thickness=columnSpacing()>>1; if (thickness>0) { int nRows=numRows(); int nCols=numColumns(); re_=(re_=1) { XRectangle *top=new XRectangle[count]; XRectangle *bottom=new XRectangle[count]; int offset=panner()->highlightThickness()+panner()->shadowThickness(); int cw=columnPixelWidth(cs_); int x=computeXCoord(cs_)+cw; int y=computeYCoord(rs_); int h=0; int n=0; if (re_==lastRow()&&re_!=nRows-1) h=panner()->height()-y-offset; else { for (int r=rs_;r<=re_;r++) h+=rowHeight(); if (re_==nRows-1) h-=rowSpacing(); } if (columns()==1&&x>panner()->width()-offset)x=panner()->width()-offset; for (int i=0;i0) { XBFillRectangles(display(),window_,bottomShadowGC(),bottom,n); XFillRectangles(display(),window_,topShadowGC(),top,n); } delete [] bottom; delete [] top; } } } } void MSArrayView::drawHSeparators(Window window_,int rs_,int re_,int cs_,int ce_) { if (ce_>=cs_) { int inc=rowSeparator(); if (mapped()!=MSFalse&&frozen()!=MSTrue&&inc>0) { int thickness=rowSpacing()>>1; if (thickness>0) { int nRows=numRows(); int nCols=numColumns(); re_=(re_highlightThickness()+panner()->shadowThickness(); int y=computeYCoord(rs_); int x=computeXCoord(cs_); int count=re_-rs_+1; XRectangle *top=new XRectangle[count]; XRectangle *bottom=new XRectangle[count]; int w=0,n=0; if (ce_==lastColumn()&&ce_!=numColumns()-1) w=panner()->width()-x-offset; else for (int c=cs_;c<=ce_;c++) w+=columnPixelWidth(c); w=(w<=panner()->width()-2*offset)?w:panner()->width()-2*offset; for (int i=rs_;i<=re_;i++) { if ((i%inc)==(inc-1)||i==nRows-1) { top[n].x=bottom[n].x=x; top[n].y=y+rowHeight()-rowSpacing(); bottom[n].y=top[n].y+thickness; if (i==nRows-1&&ce_==nCols-1) { top[n].width=w-thickness; bottom[n].width=w; } else top[n].width=bottom[n].width=w; top[n].height=bottom[n].height=thickness; n++; } y+=rowHeight(); } if (n>0) { XBFillRectangles(display(),window_,panner()->bottomShadowGC(),top,n); XFillRectangles(display(),window_,panner()->topShadowGC(),bottom,n); } delete [] top; delete [] bottom; } } } } void MSArrayView::drawRow(int row_) { drawRow(panner()->window(),row_); } void MSArrayView::drawRow(Window window_,int row_) { if (row_window(),rs_,re_); } void MSArrayView::drawRows(Window window_,int rs_,int re_) { drawFixedColumns(window_,rs_,re_); drawRows(window_,rs_,re_,firstColumn(),lastColumn()); } void MSArrayView::drawRows(int rs_,int re_,int cs_,int ce_) { if (mapped()==MSTrue&&frozen()==MSFalse) { rs_=(rs_>=firstRow())?rs_:firstRow(); re_=(re_<=lastRow())?re_:lastRow(); cs_=(cs_>=firstColumn())?cs_:firstColumn(); ce_=(ce_<=lastColumn())?ce_:lastColumn(); drawRows(panner()->window(),rs_,re_,cs_,ce_); } } void MSArrayView::drawRows(Window window_,int rs_,int re_,int cs_,int ce_) { unsigned totalRows=numRows(); if (totalRows>0&&mapped()==MSTrue&&frozen()==MSFalse) { MSRect aRect; for(int j=cs_;j<=ce_;j++) { unsigned cl=columnLength(j); if (cl!=0&&j0) drawSelectBevel(aRect,MSTrue); } } void MSArrayView::selectedCellBackground(const char *color_) { selectedCellBackground(server()->pixel(color_)); } void MSArrayView::selectedCellBackground(unsigned long pixel_) { if (selectedCellBackground()!=pixel_) { _selectBg=pixel_; drawSelectedCell(panner()->window(),selectedRow(),selectedColumn()); } } void MSArrayView::drawCycle(MSColorCycle *cycle_) { int row=cycle_->row(); int col=cycle_->column(); MSCycleColorMode mode=cycle_->mode(); unsigned long color=cycle_->color(cycle_->count()); int x,y; if ((row==-1||rowwindow(),x_,y_,row_,column_,fg,bg,fid,rowSelected,cellSelected,cellValid); } } void MSArrayView::cycleRowColumn(int row_,int column_) { createCycle(row_,column_); } void MSArrayView::cycleRow(int row_) { createCycle(row_,-1); } void MSArrayView::cycleColumn(int column_) { createCycle(-1,column_); } void MSArrayView::cycleCell(MSColorCycle *cycle_) { if (cycle_->count()==cycle_->numCycles()) { if (cycle_->column()==-1) drawRow(cycle_->row()); else if (cycle_->row()==-1) drawColumn(cycle_->column()); else drawRowColumn(cycle_->row(),cycle_->column()); } else drawCycle(cycle_); } int MSArrayView::computeMaxTextLength(const XFontStruct *fs_,const char *pString_,int cw_,int len_) { if (cw_>0&&len_>0) { int len=len_; int tw=XTextWidth(fs_,pString_,len); MSFontObject fontObject(fs_); int decrement=(fontObject.doubleByte()==MSTrue?2:1); if (tw>cw_) { while (len>0&&tw>cw_) { len-=decrement; tw-=XTextWidth(fs_,pString_+len,decrement); } } return len; } return 0; } void MSArrayView::focusIn(void) { highlight(); if (editor()->mapped()==MSTrue) focusInNotify(editor()); } void MSArrayView::focusOut(void) { unHighlight(); if (editor()->mapped()==MSTrue) focusOutNotify(editor()); } MSBoolean MSArrayView::loseFocus(void) { if (editor()->mapped()==MSTrue) editorActivate(); if (editor()->mapped()==MSTrue) return MSFalse; else { unHighlight(); return MSTrue; } } void MSArrayView::set(MSAttrValueList& avList_) { MSRowColumnView::set(avList_); MSIndexVector index; for (unsigned i=0;icolorName(selectedCellBackground()), MSAttrValue::Color); avList_<lastBlock()) inside=(startRow_>=lastBlock()&&startRow_<=previousSelectedRow)?MSTrue:MSFalse; else inside=(startRow_<=lastBlock()&&startRow_>=previousSelectedRow)?MSTrue:MSFalse; if (inside==MSTrue) { if (startRow_lastBlock()) unfillSelection(lastBlock()+1,previousSelectedRow); } else { fillSelection(lastBlock()+1,startRow_-1); if (previousSelectedRowlastBlock()) { if ((index=selectionVector().indexOf(lastBlock()+1))!=selectionVector().length()) _selectionVector.removeAt(index,previousSelectedRow-lastBlock()); } else { if ((index=selectionVector().indexOf(previousSelectedRow))!=selectionVector().length()) _selectionVector.removeAt(index,lastBlock()-previousSelectedRow); } startRow_=lastBlock(); drawSelected(lastSelectedRow); } else { lastBlock(startRow_); drawSelected(lastSelectedRow); } int startSelect,endSelect; MSIndexVector drawnVector; //Vector to keep track of which line is already drawn selected if (lastSelectedRow>lastBlock()) { startSelect=lastBlock(); endSelect=lastSelectedRow; } else { startSelect=lastSelectedRow; endSelect=lastBlock(); } fr=firstRow(); lr=lastRow(); lr=(lr>numRows()?numRows():lr); for(i=fr;i<=lr;i++) { if (selected(i)==MSTrue||(i>=startSelect&&i<=endSelect)) drawnVector<x_origin(); iy-=panner()->y_origin(); lastSelectedCol=(ix<(fixedColumnPixelWidth()+labelWidth()))? xToColumn(ix-labelWidth()): xToColumn(ix-labelWidth())+firstColumn(); if (inColRange(lastSelectedCol)==MSFalse) lastSelectedCol=lastColumn(); if (iy0) { // To prevent flashing if (row>startRow_) { if (selected(row)==MSFalse) { if ((index=drawnVector.indexOf(row))!=drawnVector.length()) { undrawSelected(row); drawnVector.removeAt(index); } } } scrollDown(1); row=firstRow(); } } else if (iy>=panner()->height()) { if ((row=lastRow())=numRows()) row=numRows()-1; else if (inRowRange(row)==MSFalse) row--; } if (row!=lastSelectedRow) { lastSelectedRow=row; if (row>startRow_) { startSelect=startRow_; endSelect=row; } else { startSelect=row; endSelect=startRow_; } MSIndexVector dv; fr=firstRow(); lr=lastRow(); lr=(lr>numRows()?numRows():lr); for (i=fr;i<=lr;i++) { // Not in the selection if (iendSelect) { // If it is selected but not in our Drawn Vector // draw it. if (selected(i)==MSTrue) { dv<numRows()?numRows():lr); undrawnVector<y_origin(); if (iy0) { if (row>startRow_) { if (selected(row)==MSTrue) { if ((index=undrawnVector.indexOf(row))!=undrawnVector.length()) { drawSelected(row); undrawnVector.removeAt(index); } } } scrollDown(1); row=firstRow(); undrawSelected(row); if (selected(row)==MSTrue) undrawnVector<=panner()->height()) { if ((row=lastRow())=numRows()) row=numRows()-1; else if (inRowRange(row)==MSFalse) row--; } if (row!=lastSelectedRow) { lastSelectedRow=row; if (row>startRow_) { startSelect=startRow_; endSelect=row; } else { startSelect=row; endSelect=startRow_; } MSIndexVector dv; fr=firstRow(); lr=lastRow(); lr=(lr>numRows()?numRows():lr); for (i=fr;i<=lr;i++) { // Not in the selection if (iendSelect) { // If it is selected but in our UnDrawn Vector // draw it. if (selected(i)==MSTrue) { if (undrawnVector.indexOf(i)!=undrawnVector.length()) drawSelected(i); } } else { if (selected(i)==MSTrue) { dv<window(),rs_,re_); } void MSArrayView::drawLabels(Window,int,int) {} void MSArrayView::updateInternalState(void) {} void MSArrayView::calculateRowHeight(void) { MSFontObject fontObj; int th=0; unsigned n=numColumns(); for (unsigned i=0;i0)?th+(rowSpacing()<<1):0; if (th!=rowHeight()) rowHeight(th); } void MSArrayView::drawFixedColumns(Window window_,int rs_,int re_) { if (fixedColumns()>0) drawRows(window_,rs_,re_,0,fixedColumns()-1); } const XFontStruct *MSArrayView::columnFontStruct(unsigned) { return (XFontStruct *) textFontStruct(); } unsigned MSArrayView::columnNumRows(unsigned) const { return numRows(); } unsigned long MSArrayView::columnBackground(unsigned) { return background(); } unsigned long MSArrayView::columnForeground(unsigned) { return foreground(); } MSClipMode MSArrayView::columnClipMode(unsigned) const { return MSNoClipping; } int MSArrayView::fixedColumnPixelWidth(void) { int sum=0; for (unsigned i=0;ipanner()->width()) col=columns(); else { int w=fixedColumnPixelWidth()+columnPixelWidth(firstColumn()); int i=firstColumn(); while(w<=x_&&i<=lastColumn()) { i++; w+=columnPixelWidth(i); } col=i-firstColumn(); } return (col>=0)?col:0; } int MSArrayView::inColRange(int c_) { return((c_>=firstColumn()&&c_<=lastColumn())||(c_>=0&&c_<=fixedColumns()-1))?MSTrue:MSFalse; } int MSArrayView::columnFromEvent(const XEvent *pEvent_) { int col=(pEvent_->xbutton.x<(fixedColumnPixelWidth()+labelWidth()))? xToColumn(pEvent_->xbutton.x-labelWidth()): xToColumn(pEvent_->xbutton.x-labelWidth())+firstColumn(); return col; } int MSArrayView::lastColumn(void) { return firstColumn()+columns()-fixedColumns()-1;} void MSArrayView::updateHsb(void) { hsb()->min(fixedColumns()); hsb()->max(numColumns()); hsb()->valueChange(firstColumn()); hsb()->viewSize(columns()-fixedColumns()); hsb()->pageInc(columns()-fixedColumns()-1); if (isHsbEnabled()==MSTrue) { if (columns()height()>1) { int fw=fixedColumnPixelWidth(); hsb()->moveTo(panner()->x_origin()+fw+labelWidth(), panner()->y_origin()+panner()->height()+spacing()); hsb()->width(panner()->width()-fw-labelWidth()); if (hsb()->mapped()==MSFalse) hsb()->map(); } else if (hsb()->mapped()==MSTrue) hsb()->unmap(); } } void MSArrayView::hsbValueUpdate(void) { if (editorActivate()==MSTrue) { if (hsb()->value()value()); else if (hsb()->value()>firstColumn()) { int delta=hsb()->value()-firstColumn(); int offset=panner()->highlightThickness()+panner()->shadowThickness(); int deltaWidth,i; if (hsb()->value()+hsb()->viewSize()==hsb()->max()) { deltaWidth=panner()->width()-2*offset-fixedColumnPixelWidth()-labelWidth(); i=numColumns(); while (deltaWidth>0&&i>fixedColumns()) { deltaWidth-=columnPixelWidth(i-1); if (deltaWidth>=0) i--; } if (i=fixedColumns())?firstColumn():fixedColumns(); _columns=computeNumVisibleColumns(); updateView(); firstColumnChangeNotify(); redrawImmediately(); } } else if (delta>=hsb()->pageInc()) // page the screen { _firstColumn+=delta; _columns=computeNumVisibleColumns(); deltaWidth=panner()->width()-2*offset-drawWidth(); // any left over space i=firstColumn(); while (deltaWidth>0&&i>0) { deltaWidth-=columnPixelWidth(i-1); if (deltaWidth>=0) i--; } _firstColumn=i; _firstColumn=(firstColumn()>=fixedColumns())?firstColumn():fixedColumns(); _columns=computeNumVisibleColumns(); updateView(); firstColumnChangeNotify(); redrawImmediately(); } else scrollRight(delta); } } else updateScrollBars(); } void MSArrayView::updateView(void) { //This method update the Horizontal scrollbar states hsb()->view(firstColumn(),columns()-fixedColumns()); hsb()->pageInc(columns()-fixedColumns()-1); } void MSArrayView::cleanUpBottom(Window window_) { if (columns()>0) { int offset=panner()->highlightThickness()+panner()->shadowThickness(); int y=computeYCoord(firstRow()+rows()-1)+rowHeight(); int h=panner()->height()-offset-y; int thickness=columnSpacing()>>1; int inc=columnSeparator(); if (h>0&&thickness>0) { if (firstRow()+rows()>=numRows()) { XFillRectangle(display(),window_,backgroundShadowGC(), offset,y,panner()->width()-(offset<<1),h); } else { XRectangle *top=new XRectangle[columns()]; XRectangle *bottom=new XRectangle[columns()]; int cw,x; int i,n=0; int nCols=numColumns(); if (fixedColumns()>0) { x=offset+labelWidth(); for (i=0;i=columnNumRows(i)-1) gc=backgroundShadowGC(); else { gc=backgroundGC(); XSetForeground(display(),gc,columnBackground(i)); } XFillRectangle(display(),window_,gc,x,y,cw,h); x+=cw; if (inc>0&&((i%inc)==(inc-1)||i==nCols-1)) { top[n].x=x-columnSpacing(); bottom[n].x=top[n].x+thickness; top[n].y=bottom[n].y=y; top[n].width=bottom[n].width=thickness; top[n].height=bottom[n].height=h; n++; } } } x=computeXCoord(firstColumn()); for (i=firstColumn();i<=lastColumn()&&i=columnNumRows(i)-1) gc=backgroundShadowGC(); else { gc=backgroundGC(); XSetForeground(display(),gc,columnBackground(i)); } XFillRectangle(display(),window_,gc,x,y,cw,h); x+=cw; if (inc>0&&((i%inc)==(inc-1)||i==nCols-1)) { top[n].x=x-columnSpacing(); bottom[n].x=top[n].x+thickness; top[n].y=bottom[n].y=y; top[n].width=bottom[n].width=thickness; top[n].height=bottom[n].height=h; n++; } } if (n>0) { XFillRectangles(display(),window_,bottomShadowGC(),top,n); XFillRectangles(display(),window_,topShadowGC(),bottom,n); } if (xwidth()-offset) XFillRectangle(display(),window_,backgroundShadowGC(), x,y,panner()->width()-x-offset,h); delete [] top; delete [] bottom; } } } } void MSArrayView::drawSelected(int row_) { int cs=firstColumn(); int ce=lastColumn(); int fixedCols=fixedColumns(); int nCols=numColumns(); int yy=computeYCoord(row_); unsigned long bg=selectedRowBackground(); MSBoolean rowSelected=MSTrue; MSBoolean cellSelected=MSFalse; if (fixedCols>0) { int nToDraw; if (fixedColswindow(),xx,yy,row_,i,fg,bg,fid,rowSelected,cellSelected,cellValid); } drawHSeparators(panner()->window(),row_,row_,0,fixedCols-1); drawVSeparators(panner()->window(),row_,row_,0,fixedCols-1); } if (cswindow(),xx,yy,row_,i,fg,bg,fid,rowSelected,cellSelected,cellValid); } drawHSeparators(panner()->window(),row_,row_,cs,endIndex); drawVSeparators(panner()->window(),row_,row_,cs,endIndex); } } void MSArrayView::undrawSelected(int row_) { int cs=firstColumn(); int ce=lastColumn(); int fixedCols=fixedColumns(); int nCols=numColumns(); int yy=computeYCoord(row_); MSBoolean rowSelected=MSFalse; MSBoolean cellSelected=MSFalse; if (fixedCols>0) { int nToDraw; if (fixedColswindow(),xx,yy,row_,i,fg,bg,fid,rowSelected,cellSelected,cellValid); } drawHSeparators(panner()->window(),row_,row_,0,fixedCols-1); drawVSeparators(panner()->window(),row_,row_,0,fixedCols-1); } if (cswindow(),xx,yy,row_,i,fg,bg,fid,rowSelected,cellSelected,cellValid); } drawHSeparators(panner()->window(),row_,row_,cs,endIndex); drawVSeparators(panner()->window(),row_,row_,cs,endIndex); } } void MSArrayView::selectedRowColumn(int row_,int column_) { if (row_!=selectedRow()||column_!=selectedColumn()) { setSelection(row_,column_); rowColumnSelection(); } } void MSArrayView::selectedColumn(int column_) { updateSelectedColumn(column_); } void MSArrayView::updateSelectedColumn(int column_) { int col=selectedColumn(); if (column_>=fixedColumns()&&column_lastColumn()) { _selectedColumn=column_; undrawSelectedCell(panner()->window(),selectedRow(),col); scrollRight(column_-(firstColumn()+columns()-fixedColumns())+1); drawSelectedCell(panner()->window(),selectedRow(),selectedColumn()); } else if (column_window(),selectedRow(),col); scrollLeft(firstColumn()-column_); drawSelectedCell(panner()->window(),selectedRow(),selectedColumn()); } } else if (column_<0) moveSelection(-1,-1); else if (column_=numColumns()) column_=numColumns()-1; if (column_>=fixedColumns()&&column_=0&&selectedColumn()>=numColumns()) selectedColumn(numColumns()-1); if (oldFirstColumn==firstColumn()) firstColumnChangeNotify(); // otherwise called in adjustFirstColumn } } unsigned MSArrayView::columnEditWidth(unsigned) { return MSArrayViewColumnDefaultEditWidth; } void MSArrayView::moveEditorToSelection(const MSString &aString_) { if (selectedRow()x_origin(); int y=computeYCoord(selectedRow())+panner()->y_origin(); int w=columnPixelWidth(selectedColumn()); int offset=panner()->shadowThickness()+panner()->highlightThickness(); if (w>panner()->width()-2*offset) w=panner()->width()-2*offset; Font fid=viewCellFont(selectedRow(),selectedColumn()); editor()->maxLength(columnEditWidth(selectedColumn())); editor()->font(fid); editor()->moveTo(x,y); editor()->resize(w,rowHeight()); if (aString_.length()>0) { MSString aString2(aString_); aString2.stripTrailing(); editor()->string(aString2); } else { editor()->string(aString_); editor()->editMode(MSTextField::InsertMode); } mapEditor(); } else server()->bell(); } } else server()->bell(); } } void MSArrayView::startEditing(const XEvent *pEvent_) { MSString string=selection(); moveEditorToSelection(string); if (editor()->mapped()==MSTrue) { unsigned cl=columnLength(selectedColumn()); if (cl!=0) { int xoff=0; MSAlignment alignment=viewCellAlignment(selectedRow(),selectedColumn()); if (alignment!=MSLeft) { Font fid=viewCellFont(selectedRow(),selectedColumn()); const XFontStruct *fontStruct=columnFontStruct(selectedColumn()); MSFontObject fontObj(fontStruct); if (fontObj.font()!=fid) fontObj.fontStruct(server()->fontStruct(fid)); int cpw=columnPixelWidth(selectedColumn()); int slen=string.length(); int w=fontObj.textWidth(string,slen); xoff=alignment==MSCenter?(cpw-w)/2: alignment==MSRight?cpw-2*columnSpacing()-w:0; if (xoff<0) xoff=0; } // We used to call buttonPressNotify and pass the event data structure // to the text field. After adding the support for range selection in // text field, there's some additional logic in MSTextField::button1Press // (MSTextField::trackSelection() in specific) that we don't want to trigger, // so we are going to call MSTextField::startEditing() directly here. _editor->cursorPosition(_editor->firstCursorPosition()); MSTextField::EditingMode mode; if (pEvent_->xbutton.button==Button2) mode=MSTextField::OverstrikeMode; else mode=MSTextField::InsertMode; editor()->startEditing(mode,pEvent_->xbutton.x-editor()->x_origin()-xoff); } } } void MSArrayView::clearRows(int rs_,int re_) { clearRows(rs_,re_,firstColumn(),lastColumn()); } void MSArrayView::clearRowColumn(int row_,int column_) { if (frozen()==MSFalse) { if (inRowRange(row_)==MSTrue&&inColRange(column_)==MSTrue) { int y=computeYCoord(row_); int x=computeXCoord(column_); XFillRectangle(display(),panner()->window(),panner()->backgroundShadowGC(), x,y,columnPixelWidth(column_),rowHeight()); } } } void MSArrayView::clearRows(int rs_,int re_,int cs_,int ce_) { if (frozen()==MSFalse) { if (inRowRange(rs_)==MSTrue&&inColRange(cs_)==MSTrue) { re_=(re_<=lastRow())?re_:lastRow(); ce_=(ce_<=lastColumn())?ce_:lastColumn(); int i=0,j=0; int x=0,y=0; y=computeYCoord(rs_); for (i=rs_;i<=re_;i++) { x=computeXCoord(cs_); for (j=cs_;j<=ce_;j++) { XFillRectangle(display(),panner()->window(),backgroundShadowGC(), x,y,columnPixelWidth(j),rowHeight()); x+=columnPixelWidth(j); } y+=rowHeight(); } panner()->redraw(); } } } void MSArrayView::clearRow(int row_) { int offset=panner()->highlightThickness()+panner()->shadowThickness(); int w=panner()->width()-(offset<<1); XFillRectangle(display(),panner()->window(),backgroundShadowGC(), offset,computeYCoord(row_),w,rowHeight()); } void MSArrayView::createCycle(int row_,int column_) { if (numRows()>0) { if (cycleList().length()!=0) processCycleTimer(); if (inRowRange(row_)==MSTrue&&inColRange(column_)==MSTrue) { if (cycleColors().length()>0||cycleColorMode()==MSReverseVideo) startCycle(row_,column_,cycleColors(),cycleColorMode()); else drawRowColumn(row_,column_); } else if (row_==-1&&inColRange(column_)==MSTrue) { if (cycleColors().length()>0||cycleColorMode()==MSReverseVideo) startCycle(row_,column_,cycleColors(),cycleColorMode()); else drawColumn(column_); } else if (column_==-1&&inRowRange(row_)==MSTrue) { if (cycleColors().length()>0||cycleColorMode()==MSReverseVideo) startCycle(row_,column_,cycleColors(),cycleColorMode()); else drawRow(row_); } if (cycleList().length()!=0) { if (cycleTimer()==0) _cycleTimer=new CycleTimer(this,cycleInterval()); else cycleTimer()->reset(); } } } void MSArrayView::updateSelectionVector(const MSIndexVector& sv_) { if (selectionMode()==MSMultiple) { // Make sure none of the values in the new vector is out of bound MSIndexVector newVector=sv_; newVector.sortUp(); unsigned i,numrows=numRows(); for (i=0;i=numrows) { newVector.drop(i-newVector.length()); break; } } const MSIndexVector osv=selectionVector(); // make a local copy of old select vector _selectionVector=newVector; for (i=0;ihighlightThickness()+panner()->shadowThickness(); } aplus-fsf-4.22/src/MSGUI/MSArrow.C0000644000265000001440000002430710772770400012141 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include MSArrow::MSArrow(MSWidgetCommon *owner_) : _pShadow(0) { _owner=owner_; _arrowType=Up; init(); } MSArrow::MSArrow(MSWidgetCommon *owner_,ArrowType type_) : _pShadow(0) { _owner=owner_; _arrowType=type_; init(); } MSArrow::~MSArrow(void) { if (_top!=0) { delete [] _top; delete [] _center; delete [] _bottom; } if(_pShadow !=0) delete _pShadow; } void MSArrow::init(void) { _top=0; _center=0; _bottom=0; _topCount=_centerCount=_bottomCount=0; _selected=MSFalse; MSRect::configuration(0,0,0,0); } void MSArrow::type(ArrowType type_) { _arrowType=type_; computeSize(); } void MSArrow::owner(MSWidgetCommon *owner_) { if (_owner!=owner_) { _owner=owner_; computeSize(); } } void MSArrow::computeSize(void) { if (MSRect::width()!=0&&MSRect::height()!=0) { int offset=_owner->highlightThickness()+_owner->shadowThickness(); computeArrowRects(); offsetArrow(MSRect::x()-offset,MSRect::y()-offset); } } void MSArrow::draw(void) { if (_top==0) return; GC topGC=shadow().topShadowGC(); GC bottomGC=shadow().bottomShadowGC(); if (_selected) { topGC= shadow().bottomShadowGC(); bottomGC= shadow().topShadowGC(); } Display *dpy=_owner->display(); Window wid=_owner->window(); _owner->XBFillRectangles(dpy,wid,topGC,_top,_topCount); _owner->XBFillRectangles(dpy,wid,bottomGC,_bottom,_bottomCount); _owner->XBFillRectangles(dpy,wid,shadow().backgroundShadowGC(),_center,_centerCount); } void MSArrow::computeArrowRects(void) { int ht=_owner->highlightThickness(); int st=_owner->shadowThickness(); int w=MSRect::width()+2*(ht+st); int h=MSRect::height()+2*(ht+st); int size,Width,start; int Y; int temp; short t=0; short b=0; short c=0; int xOffset=0; int yOffset=0; XRectangle *tmp; st-=1; if (_top!=0) { delete [] _top; _top =0; delete [] _center; _center=0; delete [] _bottom; _bottom =0; _topCount=0; _centerCount=0; _bottomCount=0; } // Get the size and allocate the rectangle lists if (w>h) { size=h-2-((ht+st)<<1); xOffset=(w-h)>>1; } else { size=w-2-((ht+st)<<1); yOffset=(h-w)>>1; } if (size<1) return; if (_arrowType==Right||_arrowType==Left) { temp=xOffset; xOffset=yOffset; yOffset=temp; } int nr=(size>>1)+6; _top =(XRectangle *) new XRectangle[nr]; _center=(XRectangle *) new XRectangle[nr]; _bottom =(XRectangle *) new XRectangle[nr]; // Set up a loop to generate the segments. Width=size; Y=size+ht+st-1+yOffset; start=ht+st+1+xOffset; while (Width>0) { if (Width==1) { _top[t].x=start; _top[t].y=Y+1; _top[t].width=1; _top[t].height=1; t++; } else if (Width==2) { if (size==2||(_arrowType==Up||_arrowType==Left)) { _top[t].x=start; _top[t].y=Y; _top[t].width=2; _top[t].height=1; t++; _top[t].x=start; _top[t].y=Y+1; _top[t].width=1; _top[t].height=1; t++; _bottom[b].x=start+1; _bottom[b].y=Y+1; _bottom[b].width=1; _bottom[b].height=1; b++; } else if (_arrowType==Up||_arrowType==Left) { _top[t].x=start; _top[t].y=Y; _top[t].width=2; _top[t].height=1; t++; _bottom[b].x=start; _bottom[b].y=Y+1; _bottom[b].width=2; _bottom[b].height=1; b++; } } else { if (start==ht+st+1+xOffset) { if (_arrowType==Up||_arrowType==Left) { _top[t].x=start; _top[t].y=Y; _top[t].width=2; _top[t].height=1; t++; _top[t].x=start; _top[t].y=Y+1; _top[t].width=1; _top[t].height=1; t++; _bottom[b].x=start+1; _bottom[b].y=Y+1; _bottom[b].width=1; _bottom[b].height=1; b++; _bottom[b].x=start+2; _bottom[b].y=Y; _bottom[b].width=Width-2; _bottom[b].height=2; b++; } else { _top[t].x=start; _top[t].y=Y; _top[t].width=2; _top[t].height=1; t++; _bottom[b].x=start; _bottom[b].y=Y+1; _bottom[b].width=2; _bottom[b].height=1; b++; _bottom[b].x=start+2; _bottom[b].y=Y; _bottom[b].width=Width-2; _bottom[b].height=2; b++; } } else { _top[t].x=start; _top[t].y=Y; _top[t].width=2; _top[t].height=2; t++; _bottom[b].x=start+Width-2; _bottom[b].y=Y; _bottom[b].width=2; _bottom[b].height=2; if (Width==3) { _bottom[b].width=1; _bottom[b].x+=1; } b++; if (Width>4) { _center[c].x=start+2; _center[c].y=Y; _center[c].width=Width-4; _center[c].height=2; c++; } } } start++; Width-=2; Y-=2; } if (_arrowType==Up||_arrowType==Left) { _topCount=t; _centerCount=c; _bottomCount=b; } else { tmp=_top; _top=_bottom; _bottom=tmp; _topCount=b; _centerCount=c; _bottomCount=t; } // Transform the "up" pointing arrow to the correct _arrowType switch (_arrowType) { case Left: { int i=-1; do { i++; if (i<_topCount) { temp=_top[i].y; _top[i].y=_top[i].x; _top[i].x=temp; temp=_top[i].width; _top[i].width=_top[i].height; _top[i].height=temp; } if (i<_bottomCount) { temp=_bottom[i].y; _bottom[i].y=_bottom[i].x; _bottom[i].x=temp; temp=_bottom[i].width; _bottom[i].width=_bottom[i].height; _bottom[i].height=temp; } if (i<_centerCount) { temp=_center[i].y; _center[i].y=_center[i].x; _center[i].x=temp; temp=_center[i].width; _center[i].width=_center[i].height; _center[i].height=temp; } } while (i<_topCount||i<_bottomCount||i<_centerCount); } break; case Right: { int h_right=h-2; int w_right=w-2; int i=-1; do { i++; if (i<_topCount) { temp=_top[i].y; _top[i].y=_top[i].x; _top[i].x=temp; temp=_top[i].width; _top[i].width=_top[i].height; _top[i].height=temp; _top[i].x=w_right-_top[i].x-_top[i].width+2; _top[i].y=h_right-_top[i].y-_top[i].height+2; } if (i<_bottomCount) { temp=_bottom[i].y; _bottom[i].y=_bottom[i].x; _bottom[i].x=temp; temp=_bottom[i].width; _bottom[i].width=_bottom[i].height; _bottom[i].height=temp; _bottom[i].x=w_right-_bottom[i].x-_bottom[i].width+2; _bottom[i].y=h_right-_bottom[i].y-_bottom[i].height+2; } if (i<_centerCount) { temp=_center[i].y; _center[i].y=_center[i].x; _center[i].x=temp; temp=_center[i].width; _center[i].width=_center[i].height; _center[i].height=temp; _center[i].x=w_right-_center[i].x-_center[i].width+2; _center[i].y=h_right-_center[i].y-_center[i].height+2; } } while (i<_topCount||i<_bottomCount||i<_centerCount); } break; case Up: break; case Down: { int w_down=w-2; int h_down=h-2; int i=-1; do { i++; if (i<_topCount) { _top[i].x=w_down-_top[i].x-_top[i].width+2; _top[i].y=h_down-_top[i].y-_top[i].height+2; } if (i<_bottomCount) { _bottom[i].x=w_down-_bottom[i].x-_bottom[i].width+2; _bottom[i].y=h_down-_bottom[i].y-_bottom[i].height+2; } if (i<_centerCount) { _center[i].x=w_down-_center[i].x-_center[i].width+2; _center[i].y=h_down-_center[i].y-_center[i].height+2; } } while (i<_topCount||i<_bottomCount||i<_centerCount); } break; } } void MSArrow::offsetArrow(int diff_x,int diff_y) { int i; if (diff_x!=0||diff_y!=0) { for (i=0;i<_topCount;i++) { _top[i].x+=diff_x; _top[i].y+=diff_y; } for (i=0;i<_centerCount;i++) { _center[i].x+=diff_x; _center[i].y+=diff_y; } for (i=0;i<_bottomCount;i++) { _bottom[i].x+=diff_x; _bottom[i].y+=diff_y; } } } void MSArrow::moveTo(int x_,int y_) { int i; int diff_y=y_-MSRect::y(); int diff_x=x_-MSRect::x(); if (diff_x!=0||diff_y!=0) { MSRect::y(y_); MSRect::x(x_); for (i=0;i<_topCount;i++) { _top[i].x+=diff_x; _top[i].y+=diff_y; } for (i=0; i<_centerCount;i++) { _center[i].x+=diff_x; _center[i].y+=diff_y; } for (i=0;i<_bottomCount;i++) { _bottom[i].x+=diff_x; _bottom[i].y+=diff_y; } } } void MSArrow::y_origin(int y_) { int i; int diff_y=y_-MSRect::y(); if (diff_y!=0) { MSRect::y(y_); for (i=0;i<_topCount;i++) _top[i].y+=diff_y; for (i=0;i<_centerCount;i++) _center[i].y+=diff_y; for (i=0;i<_bottomCount;i++) _bottom[i].y+=diff_y; } } void MSArrow::x_origin(int x_) { int i; int diff_x=x_-MSRect::x(); if (diff_x!=0) { MSRect::x(x_); for (i=0;i<_topCount;i++) _top[i].x+=diff_x; for (i=0;i<_centerCount;i++) _center[i].x+=diff_x; for (i=0;i<_bottomCount;i++) _bottom[i].x+=diff_x; } } void MSArrow::resize(int w_,int h_) { if (w_!=width()||h_!=height()) { MSRect::width(w_); MSRect::height(h_); computeSize(); } } void MSArrow::configure(int x_,int y_,int w_,int h_) { if (x_!=x()||y_!=y()||w_!=width()||h_!=height()) { configuration(x_,y_,w_,h_); computeSize(); } } MSShadow& MSArrow::shadow(void) { if(_pShadow == 0) return _owner->shadow(); else return *_pShadow; } const MSShadow& MSArrow::shadow(void) const { if(_pShadow == 0) return _owner->shadow(); else return *_pShadow; } unsigned long MSArrow::color(void) const { return shadow().background(); } void MSArrow::color(const char * color_) { color(owner()->server()->pixel(color_)); } void MSArrow::color(unsigned long pixel_) { if( _pShadow == 0) _pShadow = new MSShadow(_owner); _pShadow->color(pixel_); } aplus-fsf-4.22/src/MSGUI/MSArrowButton.C0000644000265000001440000001176510772770400013341 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1998-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include const int MSArrowButtonDefaultWidth=10; const int MSArrowButtonDefaultHeight=10; const int MSArrowButtonDefaultShadowThickness=2; const int MSArrowButtonDefaultHighlightThickness=0; const int MSArrowButtonEventMask=(ExposureMask|ButtonPressMask|ButtonReleaseMask); MSArrowButton::MSArrowButton(MSWidget *owner_,MSArrow::ArrowType type_) : MSWidgetCommon(owner_) { _arrow=new MSArrow(this,type_); init(); } MSArrowButton::MSArrowButton(MSWidget *owner_) : MSWidgetCommon(owner_) { _arrow=new MSArrow(this); init(); } void MSArrowButton::init(void) { _highlightThickness=MSArrowButtonDefaultHighlightThickness; _shadowThickness=MSArrowButtonDefaultShadowThickness; _shadowStyle=MSSunken; _acceptFocus=MSFalse; _arrowTimer=0; _repeatInterval=0; _repeatThreshold=0; selectInput(MSArrowButtonEventMask); } MSArrowButton::~MSArrowButton(void) { delete _arrow; if (arrowTimer()!=0) delete _arrowTimer; } void MSArrowButton::configure(void) { int offset=(highlightThickness()+shadowThickness())*2; arrow()->resize(width()-offset,height()-offset); } void MSArrowButton::computeSize(void) { int offset=highlightThickness()+shadowThickness(); arrow()->moveTo(offset,offset); resize(arrow()->width()+offset*2,arrow()->height()+offset*2); } void MSArrowButton::naturalSize(void) { arrow()->resize(MSArrowButtonDefaultWidth,MSArrowButtonDefaultHeight); computeSize(); } void MSArrowButton::firstMapNotify(void) { if (arrow()->width()==0||arrow()->height()==0) naturalSize(); else computeSize(); } void MSArrowButton::repeatThreshold(unsigned long repeatThreshold_) { _repeatThreshold=repeatThreshold_; } void MSArrowButton::repeatInterval(unsigned long repeatInterval_) {_repeatInterval=repeatInterval_;} void MSArrowButton::activate(void) { if (isProtected()==MSFalse) activateCallback(MSWidgetCallback::activate); } void MSArrowButton::buttonPress(const XEvent *event_) { if (isProtected()==MSFalse) buttonPressNotify(this,event_); } void MSArrowButton::button1Press(const XEvent *) { arrow()->select(MSTrue); activate(); if (repeatInterval()>0) { if (arrowTimer()==0) _arrowTimer=new MSArrowTimer(repeatThreshold(),this); if (repeatThreshold()==0) arrowTimer()->expirationInterval(repeatInterval()); else arrowTimer()->expirationInterval(repeatThreshold()); arrowTimer()->reset(); } } void MSArrowButton::buttonRelease(const XEvent *event_) { buttonReleaseNotify(this,event_); } void MSArrowButton::button1Release(const XEvent *) { arrow()->select(MSFalse); if (arrowTimer()!=0) arrowTimer()->stop(); } void MSArrowButton::updateBackground(unsigned long oldBG_) { MSWidgetCommon::updateBackground(oldBG_); redraw(); } void MSArrowButton::type(MSArrow::ArrowType type_) { arrow()->type(type_); drawBackground(); redraw(); } void MSArrowButton::redraw(void) { if (mapped()==MSTrue) { drawShadow(); arrow()->draw(); } } void MSArrowButton::arrowColor(const char *color_) { arrowColor(server()->pixel(color_)); } void MSArrowButton::arrowColor(unsigned long pixel_) { arrow()->color(pixel_); arrow()->draw(); } MSArrowButton::MSArrowTimer::MSArrowTimer(unsigned long msec_,MSArrowButton *owner_) : MSIntervalTimer(msec_), _owner(owner_) {} void MSArrowButton::MSArrowTimer::process(void) { owner()->activate(); if (owner()->repeatInterval()!=0) expirationInterval(owner()->repeatInterval()); } void MSArrowButton::set(MSAttrValueList& avList_) { MSWidgetCommon::set(avList_); MSIndexVector index; for (unsigned i=0;icolorName(arrowColor()),MSAttrValue::Color); return MSWidgetCommon::get(avList_); } aplus-fsf-4.22/src/MSGUI/MSAttrValue.C0000644000265000001440000002015010772770400012746 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #if HAVE_IOSTREAM #include #else #include #endif MSAttrValue::MSAttrValue(void) : _valueType(MSAttrValue::Any) {} MSAttrValue::~MSAttrValue(void) {} MSAttrValue::MSAttrValue(const MSAttrValue& aAttrValue_) : _attribute(aAttrValue_._attribute), _value(aAttrValue_._value), _options(aAttrValue_._options), _valueType(aAttrValue_._valueType) {} MSAttrValue::MSAttrValue(const char *attribute_,const char *value_, unsigned long valueType_) : _attribute(attribute_), _value(value_), _valueType(valueType_) {} MSAttrValue::MSAttrValue(const char *attribute_,const MSString& value_, unsigned long valueType_) : _attribute(attribute_), _value(value_), _valueType(valueType_) {} MSAttrValue::MSAttrValue(const MSString& attribute_,const char *value_, unsigned long valueType_) : _attribute(attribute_), _value(value_), _valueType(valueType_) {} MSAttrValue::MSAttrValue(const MSString& attribute_,const MSString& value_, unsigned long valueType_) : _attribute(attribute_), _value(value_), _valueType(valueType_) {} MSAttrValue::MSAttrValue(const MSString& attribute_,const MSString& value_, const MSStringVector& options_,unsigned long valueType_) : _attribute(attribute_), _value(value_), _options(options_), _valueType(valueType_) {} MSAttrValue& MSAttrValue::operator=(const MSAttrValue& aAttrValue_) { if (&aAttrValue_!=this) { _attribute=aAttrValue_._attribute; _value=aAttrValue_._value; _options=aAttrValue_._options; _valueType=aAttrValue_._valueType; } return *this; } MSString MSAttrValue::enumToString(unsigned long enumValue_, const MSStringVector& values_, const MSUnsignedLongVector& enumValues_, const MSString& empty_, MSBoolean exact_) { MSString aString; int i,n=enumValues_.length(); for(i=0;i0) { for (;i0) return MSStringVector(aString); else return MSStringVector(); } MSString MSAttrValue::colorVectorToString(const MSUnsignedLongVector& colorVector_, MSDisplayServer *server_) { MSString colorString; int i; for (i=0;icolorName(colorVector_(i)); } return colorString; } MSString MSAttrValue::shadowStyleToString(MSShadowStyle shadowStyle_) { char *value; switch (shadowStyle_) { case MSRaised: value="MSRaised"; break; case MSSunken: value="MSSunken"; break; case MSEtchedIn: value="MSEtchedIn"; break; case MSEtchedOut: value="MSEtchedOut"; break; case MSFlat: value="MSFlat"; break; } return MSString(value); } MSShadowStyle MSAttrValue::stringToShadowStyle(const MSString &string_) { if (string_=="MSRaised") return MSRaised; else if (string_=="MSSunken") return MSSunken; else if (string_=="MSEtchedIn") return MSEtchedIn; else if (string_=="MSEtchedOut") return MSEtchedOut; else return MSFlat; } MSString MSAttrValue::lineStyleToString(MSLineStyle lineStyle_) { if (lineStyle_==MSDot) return MSString("MSDot"); else if (lineStyle_==MSDash) return MSString("MSDash"); else return MSString("MSSolid"); } MSLineStyle MSAttrValue::stringToLineStyle(const MSString &string_) { if (string_=="MSDot") return MSDot; else if (string_=="MSDash") return MSDash; else return MSSolid; } MSAttrValueList::MSAttrValueList(void) { _size=0,_length=0,_array=0; } MSAttrValueList::~MSAttrValueList(void) { delete [] _array; } // make sure there are at least size_+1 elements in the array void MSAttrValueList::reserve(unsigned size_) { unsigned n=size_+1; if (size()0) { const MSIndexVector index=aIndexVector_.gradeUp(); unsigned n=length(); unsigned i,j,k; for (i=0,j=0,k=0;i #include #include #include #if HAVE_IOSTREAM #include #else #include #endif int MSBackingStorePixmap::_instanceCount=0; MSHashTable * MSBackingStorePixmap::_pPixmapHashTable=0; #if defined(MS_MULTI_THREAD) MSMutex MSBackingStorePixmap::_hashTableMutex; #endif static const int PixmapMinimumSize = 200; static const int PixmapReduceThreshold = 50; class MSBackingStorePixmapData { friend class MSBackingStorePixmap; protected: #ifdef MS_MULTI_THREAD MSMutex _mutex; #endif Pixmap _pixmap; int _width; int _height; MSDisplayServer *_pServer; char *_pName; MSIntVector _widths; MSIntVector _wIds; MSIntVector _heights; MSIntVector _hIds; void updatePixmap(); public: MSBackingStorePixmapData(void); MSBackingStorePixmapData(MSDisplayServer *,const char *); ~MSBackingStorePixmapData(void); void addReference(int id,int w, int h); void removeReference(int id); int referenceCount(void) const; void resize(int id, int w, int h); void lock(void); void unlock(void); MSDisplayServer *server(void) const {return _pServer;} const char *name(void) const {return _pName;} int width(void) const {return _width;} int height(void) const {return _height;} Pixmap pixmap(void) const {return _pixmap;} }; MSBackingStorePixmapData::MSBackingStorePixmapData(void) :_pixmap(0),_pName(0) {} MSBackingStorePixmapData::MSBackingStorePixmapData(MSDisplayServer *pServer_,const char *pName_) :_pixmap(0),_width(0),_height(0),_pServer(pServer_),_pName(0) { if (pName_!=0) { unsigned len=strlen(pName_); _pName=new char[len+1]; strncpy(_pName,pName_,len); _pName[len]='\0'; } } MSBackingStorePixmapData::~MSBackingStorePixmapData() { if(_pixmap!=0) XFreePixmap(server()->display(),_pixmap); if (_pName!=0) delete [] _pName; } void MSBackingStorePixmapData::lock(void) { #ifdef MS_MULTI_THREAD _mutex.acquire(); #endif } void MSBackingStorePixmapData::unlock(void) { #ifdef MS_MULTI_THREAD _mutex.release(); #endif } void MSBackingStorePixmapData::addReference(int id_, int w_, int h_) { int i,len; len=_widths.length(); for(i=0;i PixmapReduceThreshold) { newW = newW>PixmapMinimumSize?newW:PixmapMinimumSize; if(newW!=_width) needReduce=MSTrue; } if(_height-newH > PixmapReduceThreshold) { newH = newH>PixmapMinimumSize?newH:PixmapMinimumSize; if(newH!=_height) needReduce=MSTrue; } if(needReduce==MSTrue || newW>_width || newH>_height) { if(_pixmap!=0) XFreePixmap(server()->display(),_pixmap); _pixmap=XCreatePixmap(server()->display(),server()->root(),newW,newH,DefaultDepthOfScreen(server()->screen())); _width=newW; _height=newH; } } MSBackingStorePixmap::MSBackingStorePixmap(MSDisplayServer *pServer_,const char *pName_) :_pData(0) { char buf[255]; Display *display=pServer_->display(); _name=pName_; _id=_instanceCount++; sprintf(buf,"Backing_%s_%d_",pName_,display); if(_pPixmapHashTable==0) { _pPixmapHashTable= new MSHashTable(64); } void *pData=_pPixmapHashTable->lookup(buf); if((unsigned long)pData==_pPixmapHashTable->notFound()) { Window window=pServer_->root(); _pData=new MSBackingStorePixmapData(pServer_,buf); _pPixmapHashTable->add(buf,_pData); } else _pData= (MSBackingStorePixmapData*)pData; _pData->addReference(id(),0,0); } MSBackingStorePixmap::~MSBackingStorePixmap() { if(_pData->referenceCount()==1) _pPixmapHashTable->remove(_pData->name()); _pData->removeReference(id()); _pData=0; } void MSBackingStorePixmap::resize(int w_, int h_) { _pData->resize(id(),w_,h_); } void MSBackingStorePixmap::lock(void) { _pData->lock(); } void MSBackingStorePixmap::unlock(void) { _pData->unlock(); } int MSBackingStorePixmap::width(void) const { return _pData->width(); } int MSBackingStorePixmap::height(void) const { return _pData->height(); } Pixmap MSBackingStorePixmap::pixmap(void) const { return _pData->pixmap(); } aplus-fsf-4.22/src/MSGUI/MSBoolEntryField.C0000644000265000001440000000337710772770401013735 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include MSBoolEntryField::MSBoolEntryField(MSWidget *owner_,const char *label_,const MSSymbol& tag_) : MSEntryFieldPlus(owner_,label_,tag_) { internalCouple(new MSBool); init(); } MSBoolEntryField::MSBoolEntryField(MSWidget *owner_,MSBool& model_, const char *label_,const MSSymbol& tag_) : MSEntryFieldPlus(owner_,label_,tag_) { model(model_); init(); } MSBoolEntryField::~MSBoolEntryField(void) {} void MSBoolEntryField::init(void) { _format=MSFormat(MSBool::TrueAndFalse); } void MSBoolEntryField::model(MSBool& model_) { couple(&model_); } void MSBoolEntryField::model(const MSBool& model_) { constCouple(&model_); } void MSBoolEntryField::updateData(void) { if (MSView::model()==0) internalCouple(new MSBool()); MSEntryFieldPlus::updateData(); } MSBoolean MSBoolEntryField::validate(const char *pString_) { if (MSView::model()!=0) { MSBool aBool; if (aBool.set(pString_)==MSError::MSSuccess) { getBool()=aBool; return MSTrue; } } return MSFalse; } const char *MSBoolEntryField::formatOutput(MSString &buffer_) { if (MSView::model()!=0) getBool().format(buffer_,format()); return buffer_.string(); } void MSBoolEntryField::increment(void) { //cast is need for Visual C++, and doesn't hurt other compilers if((MSBoolean)getBool()==MSTrue) setBool(MSFalse); else setBool(MSTrue); } void MSBoolEntryField::decrement(void) { if((MSBoolean)getBool()==MSFalse) setBool(MSTrue); else setBool(MSFalse); } aplus-fsf-4.22/src/MSGUI/MSBoolView.C0000644000265000001440000000221110772770401012564 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1999-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include MSBoolView::MSBoolView(void) { _internalBoolModel=MSFalse; _boolModel=&_internalBoolModel; _internalBoolModel.addReceiver(this); } MSBoolView::~MSBoolView(void) {} void MSBoolView::boolModel(MSBool &model_) { if (_boolModel!=&model_) { _boolModel->removeReceiver(this); _boolModel=&model_; _boolModel->addReceiver(this); } newBoolModelNotify(); } void MSBoolView::newBoolModelNotify(void) {} MSBool &MSBoolView::boolModel(void) { return (MSBool &) *_boolModel; } void MSBoolView::receiveEvent(MSEvent& aEvent_) { boolModelChanged(aEvent_); } void MSBoolView::removeSenderNotify(MSEventSender * aEventSender_) { // if the model gets removed, then we just reset to the internal one. if ( aEventSender_ != &_internalBoolModel) _boolModel=&_internalBoolModel; } void MSBoolView::boolModelChanged(MSEvent&) {} aplus-fsf-4.22/src/MSGUI/MSBusy.C0000644000265000001440000000157510772770401011774 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include extern void changeBusyState(MSShell *,MSBoolean); extern void changeBusyState(MSBoolean); int MSApplicationBusy::_count=0; MSShellBusy::MSShellBusy(MSShell *shell_) : _shell(shell_) { changeBusyState(_shell,MSTrue); } MSShellBusy::~MSShellBusy(void) { changeBusyState(_shell,MSFalse); } MSApplicationBusy::MSApplicationBusy(void) { if (_count==0) changeBusyState(MSTrue); _count++; } MSApplicationBusy::~MSApplicationBusy(void) { if (_count==1) changeBusyState(MSFalse); _count--; } int MSApplicationBusy::count(void) { return _count; } aplus-fsf-4.22/src/MSGUI/MSButton.C0000644000265000001440000002073710772770401012326 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include static const unsigned long MSButtonEventMask=(ExposureMask|ButtonPressMask| ButtonReleaseMask|Button1MotionMask); static const int MSButtonDefaultShadowThickness=2; static const int MSButtonDefaultHighlightThickness=1; static const char *MSButtonDefaultPixmap="LabelDefaultPixmap"; //Yes, LabelDefaultPixmap is correct MSButton::MSButton(MSWidget *owner_) : MSLabel(owner_) {init();} MSButton::MSButton(MSWidget *owner_,const char *label_) : MSLabel(owner_,label_) {init();} MSButton::MSButton(MSWidget *owner_,const MSStringVector& label_) : MSLabel(owner_,label_) { init(); } MSButton::MSButton(MSWidget *owner_,const MSPixmap &pixmap_, const MSPixmap &insensitivePixmap_,const MSPixmap &armedPixmap_) : MSLabel(owner_,pixmap_,insensitivePixmap_) { init(); if (armedPixmap_.server()==server()) _armedPixmap=new MSPixmap(armedPixmap_); else { MSMessageLog::warningMessage("Warning : Armed Pixmap supplied for MSButton is invalid, using default"); createDefaultArmedPixmap(armedPixmap_.width(),armedPixmap_.height(), armedPixmap_.foreground(),armedPixmap_.background()); } } MSButton::~MSButton(void) { if (armedPixmap()!=0) delete _armedPixmap; } void MSButton::init(void) { _highlightThickness=MSButtonDefaultHighlightThickness; _shadowThickness=MSButtonDefaultShadowThickness; _armed=MSFalse; _armedPixmap=0; shadowStyle(MSRaised); sensitive(MSTrue); acceptFocus(MSTrue); selectInput(MSButtonEventMask); addToFocusList(); } void MSButton::createDefaultArmedPixmap(int w_,int h_,unsigned long fg_,unsigned long bg_) { _armedPixmap=new MSPixmap(server(),MSButtonDefaultPixmap,w_,h_,fg_,bg_); GC gc=XCreateGC(display(),window(),0,0); XSetForeground(display(),gc,bg_); XFillRectangle(display(),armedPixmap()->pixmap(),gc,0,0,w_,h_); XFreeGC(display(),gc); } void MSButton::armedPixmap(const MSPixmap &armedPixmap_) { MSPixmap *tmp=_armedPixmap; if (armedPixmap_.server()==server()) _armedPixmap=new MSPixmap(armedPixmap_); else { MSMessageLog::warningMessage("Warning : Armed Pixmap supplied for MSButton is invalid, using default"); createDefaultArmedPixmap(armedPixmap_.width(),armedPixmap_.height(), armedPixmap_.foreground(),armedPixmap_.background()); } if (tmp!=0) delete tmp; updatePixmap(); } void MSButton::updatePixmap(void) { if (pixmap()==0) { if (insensitivePixmap()!=0) _pixmap=new MSPixmap(*insensitivePixmap()); else if (armedPixmap()!=0) _pixmap=new MSPixmap(*armedPixmap()); } if (insensitivePixmap()==0) { if (pixmap()!=0) _insensitivePixmap=new MSPixmap(*pixmap()); else if (armedPixmap()!=0) _insensitivePixmap=new MSPixmap(*armedPixmap()); } if (armedPixmap()==0) { if (pixmap()!=0) _armedPixmap=new MSPixmap(*pixmap()); else if (insensitivePixmap()!=0) _armedPixmap=new MSPixmap(*insensitivePixmap()); } if (firstMap()==MSTrue) { if (dynamic()==MSTrue) computeSize(); else redraw(); } } void MSButton::redraw(void) { if (mapped()==MSTrue&&frozen()==MSFalse) { drawBackground(); if (pixmap()==0) drawLabel(); else drawPixmap(); (armed()==MSTrue)?drawSunken():drawRaised(); } } void MSButton::updateSensitivity(void) { MSLabel::updateSensitivity(); if (sensitive()==MSTrue) acceptFocus(MSTrue); else acceptFocus(MSFalse); } void MSButton::drawLabel(void) { if (mapped()==MSTrue) { if (armed()==MSTrue) { if (depth()==1) { XSetForeground(display(),textGC(),background()); XSetBackground(display(),textGC(),foreground()); MSLabel::drawLabel(); } else { XSetBackground(display(),textGC(),selectShadowColor()); MSLabel::drawLabel(); } } else { XSetBackground(display(),textGC(),background()); MSLabel::drawLabel(); } } } void MSButton::drawPixmap(void) { if (mapped()==MSTrue) { const MSPixmap *pmap; if (armed()==MSTrue) pmap=armedPixmap(); else if (sensitive()==MSTrue) pmap=pixmap(); else pmap=insensitivePixmap(); if (pmap!=0) { int startx=computePixmapXCoord(pmap); int starty=computePixmapYCoord(pmap); GC gc=pixmapGC(); XSetForeground(display(),gc,foreground()); if (armed()==MSTrue) XSetBackground(display(),gc,selectShadowColor()); else XSetBackground(display(),gc,background()); copyPixmap(display(),*pmap,window(),gc,startx,starty); } } } void MSButton::drawBackground(void) { if (mapped()==MSTrue) { int ht=highlightThickness(); XFillRectangle(display(),window(), (armed()==MSTrue)?selectShadowGC():backgroundShadowGC(), ht,ht,width()-(ht<<1),height()-(ht<<1)); if (highlighted()==MSTrue) drawHighlight(); else undrawHighlight(); } } void MSButton::key(KeySym keysym_,unsigned int,const char *) { if (keysym_==XK_Return) { arm(); activate(); disarm(); } else if (keysym_==XK_Up) up(); else if (keysym_==XK_Down) down(); else if (keysym_==XK_Left) left(); else if (keysym_==XK_Right) right(); } void MSButton::keyPress(const XEvent *pEvent_,KeySym k_,unsigned int s_,const char *b_) { MSKeyPress keyPress(k_,s_); if (isProtected()==MSFalse&& keyTranslate(keyPress)==MSFalse) key(k_,s_,b_); } void MSButton::buttonPress(const XEvent *event_) { if (visible()==MSTrue) { if (event_->xbutton.button==Button1) { if (isProtected()==MSFalse) { MSBoolean cont=MSTrue; if (acceptFocus()==MSTrue) cont=traverseFocus(this); if (cont==MSTrue) buttonPressNotify(this,event_); } } } } void MSButton::buttonRelease(const XEvent *event_) { if (event_->xbutton.button==Button1) buttonReleaseNotify(this,event_); } void MSButton::button1Press(const XEvent *) { arm();} void MSButton::button1Release(const XEvent *) { if (armed()==MSTrue) { activate(); disarm(); //Discard all button events before returning XEvent event; while (XCheckWindowEvent(display(),window(), ButtonPressMask|ButtonReleaseMask|Button1MotionMask, &event)); } } void MSButton::motionNotify(const XEvent *event_) { if (isProtected()==MSFalse && (acceptFocus()==MSFalse||inputFocus()==this)) { if (event_->xmotion.is_hint==NotifyNormal&&(event_->xmotion.state&Button1Mask)==Button1Mask) { if (event_->xmotion.x<0||event_->xmotion.x>width()|| event_->xmotion.y<0||event_->xmotion.y>height()) { disarm(); } else if (armed()==MSFalse) { if ((event_->xmotion.x>=0&&event_->xmotion.x<=width())&& (event_->xmotion.y>=0&&event_->xmotion.y<=height())) { arm(); } } } } } // default activate method void MSButton::activate(void) { activateCallback(MSWidgetCallback::activate); } void MSButton::arm(void) { if (armed()==MSFalse) { _armed=MSTrue; if (mapped()==MSTrue) { int offset=highlightThickness()+shadowThickness(); XFillRectangle(display(),window(),selectShadowGC(), offset,offset,width()-2*offset,height()-2*offset); if (pixmap()==0) drawLabel(); else drawPixmap(); drawSunken(); XFlush(display()); } } } void MSButton::disarm(void) { if (armed()==MSTrue) { _armed=MSFalse; if (mapped()==MSTrue) { int offset=highlightThickness()+shadowThickness(); XFillRectangle(display(),window(),backgroundShadowGC(), offset,offset,width()-2*offset,height()-2*offset); if (pixmap()==0) drawLabel(); else drawPixmap(); drawRaised(); XFlush(display()); } } } MSAttrValueList& MSButton::get(MSAttrValueList& avList_) { avList_< #include #include MSCascadeMenu::MSCascadeMenu(MSCascadeMenuItem *item_) : MSMenu(item_) { item()->cascadeMenu(this); background(item()->background()); foreground(item()->foreground()); font(item()->font()); } MSCascadeMenu::~MSCascadeMenu(void) { item()->menuDestroy(this); } void MSCascadeMenu::left(void) { MSMenuItem *ni,*mi=menuItem(selectedItem()); if ((ni=nextLeftItem())!=0&&(mi==0||(ni!=mi&&ni->item()item()))) { undrawSelectedItem(); selectedItem(ni->item()); drawSelectedItem(); } else if (item()!=0) { item()->disarm(); item()->menu()->grabAndSelect(); } } void MSCascadeMenu::right(void) { MSMenuItem *ni,*mi=menuItem(selectedItem()); if (mi!=0&&mi->cascade()==MSTrue) { mi->arm(); mi->grab(); } else if ((ni=nextRightItem())!=0&&(mi==0||(ni!=mi&&ni->item()>mi->item()))) { undrawSelectedItem(); selectedItem(ni->item()); drawSelectedItem(); if (ni->cascade()==MSTrue) { ni->arm(); ni->grab(); } } else if (menuBar()!=0) menuBar()->right(); } void MSCascadeMenu::done(void) { ungrab(); unmap(); if (item()!=0) item()->menu()->done(); reset(); } void MSCascadeMenu::activate(void) { if (activateCallback(MSWidgetCallback::activate)==MSFalse) { if (item()!=0) item()->activate(); } done(); } aplus-fsf-4.22/src/MSGUI/MSCascadeMenuItem.C0000644000265000001440000001333010772770401014031 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include MSCascadeMenuItem::MSCascadeMenuItem(MSMenu *owner_) : MSMenuItem(owner_) { init(); } MSCascadeMenuItem::MSCascadeMenuItem(MSMenu *owner_,const char *label_,char mnemonic_,int tag_) : MSMenuItem(owner_,label_,mnemonic_,tag_) { init(); } MSCascadeMenuItem::MSCascadeMenuItem(MSMenu *owner_,const MSString& label_,char mnemonic_,int tag_) : MSMenuItem(owner_,label_,mnemonic_,tag_) { init(); } MSCascadeMenuItem::MSCascadeMenuItem(MSMenu *owner_,const MSPixmap &pixmap_, const MSPixmap &insensitivePixmap_,int tag_) : MSMenuItem(owner_,pixmap_,insensitivePixmap_,tag_) { init(); } MSCascadeMenuItem::~MSCascadeMenuItem(void) { delete _arrow; if (cascadeMenu()!=0) safeDestroy(cascadeMenu()); } void MSCascadeMenuItem::init(void) { _cascade=MSTrue; _cascadeMenu=0; _arrow=new MSArrow(menu(),MSArrow::Right); arrow()->resize(fontObject()->textHeight()>>1,fontObject()->textHeight()>>1); } MSMenu* MSCascadeMenuItem::cascadedMenu(void) { return (MSMenu*)_cascadeMenu; } const MSMenu* MSCascadeMenuItem::cascadedMenu(void) const { return (MSMenu*)_cascadeMenu; } void MSCascadeMenuItem::grab(void) { if (cascadeMenu()!=0) cascadeMenu()->grabAndSelect(); } void MSCascadeMenuItem::arm(void) { if (cascadeMenu()!=0) { if(cascadeMenu()->mapped()==MSFalse) menushow(); arrow()->select(MSTrue); int x=menu()->x_origin()+x_origin()+width()-4; int y=menu()->y_origin()+y_origin(); // If the cascade Menu has never been mapped, call map here so // it can calculate its size if (cascadeMenu()->firstMap()==MSFalse) { cascadeMenu()->moveTo(server()->width(),server()->height()); cascadeMenu()->map(); } // Only adjust x if the left side of menu is within the screen if (x+cascadeMenu()->width()>server()->width()) { int newx=server()->width()-cascadeMenu()->width(); if (newx>0) x=newx; else x=0; } // Only adjust y if the top of menu is within the screen if (y+cascadeMenu()->height()>server()->height()) { int newy=server()->height()-cascadeMenu()->height(); if (newy>0) y=newy; else y=0; } cascadeMenu()->moveTo(x,y); cascadeMenu()->map(); cascadeMenu()->raise(); } } void MSCascadeMenuItem::disarm(void) { if (cascadeMenu()!=0) { arrow()->select(MSFalse); cascadeMenu()->ungrab(); cascadeMenu()->unmap(); } } void MSCascadeMenuItem::cascadeMenu(MSCascadeMenu *menu_) { if (cascadeMenu()!=menu_) { if (cascadeMenu()!=0) safeDestroy(cascadeMenu()); _cascadeMenu=menu_; } } void MSCascadeMenuItem::menuDestroy(MSCascadeMenu *menu_) { if (cascadeMenu()==menu_) _cascadeMenu=0; } void MSCascadeMenuItem::computePixmapDrawingCoord(const MSPixmap *pixmap_,int &srcX_,int &srcY_, int &width_,int &height_,int &destX_,int &destY_) { int heightOffset=highlightThickness()+shadowThickness()+marginHeight(); int widthOffset=highlightThickness()+shadowThickness()+marginWidth(); int myHeight=height()-heightOffset*2; int myWidth=width()-arrow()->width()*2-widthOffset*2; if (pixmap_->height()>myHeight) { height_=myHeight; srcY_=(pixmap_->height()-myHeight)/2; destY_=heightOffset+y_origin(); } else { height_=pixmap_->height(); srcY_=0; destY_=heightOffset+y_origin()+(myHeight-pixmap_->height())/2; } if (pixmap_->width()>myWidth) { width_=myWidth; srcX_=(pixmap_->width()-myWidth)/2; destX_=widthOffset+x_origin(); } else { width_=pixmap_->width(); srcX_=0; destX_=widthOffset+x_origin()+(myWidth-pixmap_->width())/2; } } void MSCascadeMenuItem::drawSymbol(void) { int offset=highlightThickness()+shadowThickness()+marginWidth(); int x=x_origin()+width()+marginWidth()-offset-arrow()->width(); arrow()->moveTo(x,y_origin()+(height()+marginHeight()-(arrow()->height())>>1)); arrow()->draw(); } void MSCascadeMenuItem::updateFont(Font oldfid_) { MSMenuItem::updateFont(oldfid_); arrow()->resize(fontObject()->textHeight()>>1,fontObject()->textHeight()>>1); if (cascadeMenu()!=0&&cascadeMenu()->font()==oldfid_) { cascadeMenu()->font(font()); } } void MSCascadeMenuItem::updateForeground(unsigned long oldfg_) { MSMenuItem::updateForeground(oldfg_); if (cascadeMenu()!=0&&cascadeMenu()->foreground()==oldfg_) { cascadeMenu()->foreground(foreground()); } } void MSCascadeMenuItem::updateBackground(unsigned long oldbg_) { MSMenuItem::updateBackground(oldbg_); if (cascadeMenu()!=0&&cascadeMenu()->background()==oldbg_) { cascadeMenu()->background(background()); } } void MSCascadeMenuItem::computeSize(void) { int widthOffset=(highlightThickness()+shadowThickness()+marginWidth())<<1; int heightOffset=(highlightThickness()+shadowThickness()+marginHeight())<<1; if (pixmap()==0) { resize (fontObject()->textWidth(label(),label().length())+(arrow()->width()<<1)+widthOffset+indent(), fontObject()->textHeight()+heightOffset); } else { resize (pixmap()->width()+(arrow()->width()<<1)+widthOffset,pixmap()->height()+heightOffset); } } void MSCascadeMenuItem::menushow() { activateCallback(MSWidgetCallback::menushow); } MSAttrValueList& MSCascadeMenuItem::get(MSAttrValueList& avList_) { avList_< MSCheckBox::MSCheckBox(MSWidget *owner_,const char *title_) : MSActionBox(owner_,title_) {} MSCheckBox::MSCheckBox(MSWidget *owner_,const MSStringVector& title_) : MSActionBox(owner_,title_) {} MSCheckBox::~MSCheckBox(void) {} void MSCheckBox::arm(MSCheckButton *checkButton_) { activate(checkButton_); } void MSCheckBox::disarm(MSCheckButton *checkButton_) { activate(checkButton_); } void MSCheckBox::integerState(const MSIntVector &aIntVector_) { MSNodeItem *hp=(MSNodeItem *)childListHead(); MSNodeItem *np=hp; while ((np=np->next())!=hp) { MSLayoutEntry *entry=(MSLayoutEntry *)np->data(); MSCheckButton *button=(MSCheckButton *)entry->widget(); if (aIntVector_.indexOf(button->integerTag())==aIntVector_.length()) button->state(MSFalse); else button->state(MSTrue); } } void MSCheckBox::symbolicState(const MSSymbolVector &aSymbolVector_) { MSNodeItem *hp=(MSNodeItem *)childListHead(); MSNodeItem *np=hp; while ((np=np->next())!=hp) { MSLayoutEntry *entry=(MSLayoutEntry *)np->data(); MSCheckButton *button=(MSCheckButton *)entry->widget(); if (aSymbolVector_.indexOf(button->tag())==aSymbolVector_.length()) button->state(MSFalse); else button->state(MSTrue); } } const MSSymbol& MSCheckBox::symbol(void) { static MSSymbol sym ("MSCheckBox"); return sym; } const MSSymbol& MSCheckBox::widgetType(void) const { return symbol(); } aplus-fsf-4.22/src/MSGUI/MSCheckButton.C0000644000265000001440000000746010772770401013262 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include MSCheckButton::MSCheckButton(MSWidget *owner_,const char *label_,const MSSymbol& tag_) : MSToggleButtonBase(owner_,label_,tag_) {} MSCheckButton::MSCheckButton(MSWidget *owner_,const MSStringVector& label_,const MSSymbol& tag_) : MSToggleButtonBase(owner_,label_,tag_) {} MSCheckButton::MSCheckButton(MSWidget *owner_,const MSPixmap &pixmap_, const MSPixmap &insensitivePixmap_, const MSPixmap &armedPixmap_,const MSSymbol& tag_) : MSToggleButtonBase(owner_,pixmap_,insensitivePixmap_,armedPixmap_,tag_) {} MSCheckButton::MSCheckButton(MSWidget *owner_,const char *label_,int integerTag_) : MSToggleButtonBase(owner_,label_,integerTag_) {} MSCheckButton::MSCheckButton(MSWidget *owner_,const MSStringVector& label_,int integerTag_) : MSToggleButtonBase(owner_,label_,integerTag_) {} MSCheckButton::MSCheckButton(MSWidget *owner_,const MSPixmap &pixmap_, const MSPixmap &insensitivePixmap_, const MSPixmap &armedPixmap_,int integerTag_) : MSToggleButtonBase(owner_,pixmap_,insensitivePixmap_,armedPixmap_,integerTag_) {} MSCheckButton::~MSCheckButton(void) {} void MSCheckButton::drawSymbol(void) { drawCheckButton(); } void MSCheckButton::drawCheckButton(void) { if (mapped()==MSTrue&&owner()->mapped()==MSTrue) { if (armed()==MSTrue) selectMSGC().foreground(selectColor()); int offset=highlightThickness()+shadowThickness()+margin(); int tw=textHeight(); int xx=(int)(offset+tw*.1); int size=(int)(tw*.8); if (size%2==0) size--; int delta=(height()-2*offset-size); delta=(delta>0)?delta>>1:0; int yy=offset+delta; drawBevel(MSRect(xx,yy,size,size), (armed()==MSTrue)?MSSunken:MSRaised,toggleShadowThickness()); if (size>2*shadowThickness()+1) { if(outputMode()==Draw || armed()==MSTrue) { XBFillRectangle(display(),window(), (armed()==MSTrue)?selectGC():backgroundShadowGC(), xx+toggleShadowThickness(),yy+toggleShadowThickness(), size-2*toggleShadowThickness(),size-2*toggleShadowThickness()); } } } } // widgetType will go away when dynamic_cast (RTTI) operator becomes available // this method is suppose to emulate the dynamic_cast operator MSCheckBox *MSCheckButton::checkBox(void) const { if (parentWidgetType()==MSCheckBox::symbol()) return (MSCheckBox *)owner(); else return 0; } void MSCheckButton::checkBoxArm(void) { MSCheckBox *cbox=checkBox(); if (cbox!=0) cbox->arm(this); } void MSCheckButton::checkBoxDisarm(void) { MSCheckBox *cbox=checkBox(); if (cbox!=0) cbox->disarm(this); } void MSCheckButton::arm(void) { if (armed()==MSFalse) { setArmState(); if (activateCallback(MSWidgetCallback::arm)==MSFalse) checkBoxArm(); } } void MSCheckButton::disarm(void) { if (armed()==MSTrue) { setDisarmState(); if (activateCallback(MSWidgetCallback::disarm)==MSFalse) checkBoxDisarm(); } } void MSCheckButton::up(void) { if (checkBox()) checkBox()->up(); } void MSCheckButton::down(void) { if (checkBox()) checkBox()->down(); } void MSCheckButton::left(void) { if (checkBox()) checkBox()->left(); } void MSCheckButton::right(void) { if (checkBox()) checkBox()->right(); } void MSCheckButton::set(MSAttrValueList& avList_) { MSToggleButtonBase::set(avList_); } MSAttrValueList& MSCheckButton::get(MSAttrValueList& avList_) { avList_< #include #include MSCheckMenuItem::MSCheckMenuItem(MSMenu *owner_) : MSToggleMenuItem(owner_) {} MSCheckMenuItem::MSCheckMenuItem(MSMenu *owner_,const char *label_,char mnemonic_,int tag_) : MSToggleMenuItem(owner_,label_,mnemonic_,tag_) {} MSCheckMenuItem::MSCheckMenuItem(MSMenu *owner_,const MSString& label_,char mnemonic_,int tag_) : MSToggleMenuItem(owner_,label_,mnemonic_,tag_) {} MSCheckMenuItem::MSCheckMenuItem(MSMenu *owner_,const MSPixmap &pixmap_,const MSPixmap &insensitivePixmap_,int tag_) : MSToggleMenuItem(owner_,pixmap_,insensitivePixmap_,tag_) {} MSCheckMenuItem::MSCheckMenuItem(MSMenu *menu_,const MSString &label_,const MSPixmap &pixmap_,const MSPixmap &armedPixmap_, const MSPixmap &insensitivePixmap_,char mnemonic_,int tag_): MSToggleMenuItem(menu_,label_,pixmap_,armedPixmap_,insensitivePixmap_,mnemonic_,tag_){} MSCheckMenuItem::MSCheckMenuItem(MSMenu *menu_,const MSString &label_,const MSPixmap &pixmap_,const MSPixmap &armedPixmap_, char mnemonic_,int tag_): MSToggleMenuItem(menu_,label_,pixmap_,armedPixmap_,pixmap_,mnemonic_,tag_){} MSCheckMenuItem::MSCheckMenuItem(MSMenu *menu_,const char *label_,const MSPixmap &pixmap_,const MSPixmap &armedPixmap_, const MSPixmap &insensitivePixmap_,char mnemonic_,int tag_): MSToggleMenuItem(menu_,label_,pixmap_,armedPixmap_,insensitivePixmap_,mnemonic_,tag_){} MSCheckMenuItem::MSCheckMenuItem(MSMenu *menu_,const char *label_,const MSPixmap &pixmap_,const MSPixmap &armedPixmap_, char mnemonic_,int tag_): MSToggleMenuItem(menu_,label_,pixmap_,armedPixmap_,pixmap_,mnemonic_,tag_){} MSCheckMenuItem::~MSCheckMenuItem(void) {} void MSCheckMenuItem::drawSymbol(void) { if (owner()->mapped()==MSTrue && (showDisarmState()==MSTrue || armed()==MSTrue) ) { int offset=highlightThickness()+shadowThickness(); int tw=fontObject()->textHeight(); int x=(int)(x_origin()+marginWidth()+offset+tw*.1); int size=(int)(tw*.8); int sht=2; if (size%2==0) size--; int delta=(height()-2*(offset+marginHeight())-size); delta=(delta>0)?delta>>1:0; int y=y_origin()+marginHeight()+offset+delta; MSRect rect(x,y,size,size); drawBevel(rect,(armed()==MSTrue)?MSSunken:MSRaised,sht); if (size>2*shadowThickness()+1) { XFillRectangle(display(),owner()->window(), (armed()==MSTrue)?_selectMSGC.gc():backgroundShadowGC(), x+sht,y+sht,size-2*sht,size-2*sht); } } } int MSCheckMenuItem::symbolHeight(void) const { return fontObject()->textHeight(); } int MSCheckMenuItem::symbolWidth(void) const { return fontObject()->textHeight(); } aplus-fsf-4.22/src/MSGUI/MSCheckPopupMenu.C0000644000265000001440000000566210772770401013741 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1999-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include MSCheckPopupMenu::MSCheckPopupMenu(MSDisplayServer *server_) : MSStringPopupMenu(server_) { init(); } MSCheckPopupMenu::MSCheckPopupMenu(MSDisplayServer *server_,MSStringVector& aModel_) : MSStringPopupMenu(server_) { model(aModel_); init(); } MSCheckPopupMenu::~MSCheckPopupMenu(void) {} void MSCheckPopupMenu::init(void) { _selectColor=server()->pixel("violet red"); } void MSCheckPopupMenu::selectColor(const char *color_) { selectColor(server()->pixel(color_)); } void MSCheckPopupMenu::selectColor(unsigned long pixel_) { if (_selectColor!=pixel_) { _selectColor=pixel_; MSWidgetVector itemVector(children()); MSCheckMenuItem *pMenuItem; for (unsigned i=0, len=itemVector.length();iselectColor(_selectColor); } } } void MSCheckPopupMenu::selection(const MSStringVector &selection_) { _selection=selection_; resetSelection(); } void MSCheckPopupMenu::resetSelection(void) { MSWidgetVector itemVector(children()); MSCheckMenuItem *pMenuItem; for (unsigned i=0, len=itemVector.length();ilabel())<_selection.length()) { pMenuItem->state(MSTrue); } else { pMenuItem->state(MSFalse); } } } void MSCheckPopupMenu::updateData(void) { if (MSView::model()!=0) { freeze(); const MSStringVector& aStringVector=stringVector(); unsigned currentCount(itemCount()); unsigned i; MSWidgetVector itemVector(children()); MSCheckMenuItem *pMenuItem; for (i=0;ilabel(aStringVector(i)); pMenuItem->state(MSFalse); } else { pMenuItem=new MSCheckMenuItem(this,aStringVector(i),0,i); pMenuItem->selectColor(_selectColor); } setItem(pMenuItem,i); } for (i=aStringVector.length();istate()==MSTrue) { _selection.removeAt(_selection.indexOf(item->label())); } else { _selection<label(); } MSStringPopupMenu::activate(); } aplus-fsf-4.22/src/MSGUI/MSCollapsibleLayout.C0000644000265000001440000005500610772770401014477 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1998-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include static const int MSCollapsibleLayoutDefaultShadowThickness=2; static const int MSCollapsibleLayoutDefaultHighlightThickness=0; static const unsigned long MSCollapsibleLayoutEventMask=(ExposureMask); static const char * MSCollapsibleLayoutDefaultHandleBackground="black"; static const char * MSCollapsibleLayoutDefaultHandleForeground="white"; static const int MSCollapsibleLayoutDefaultHandleSize=8; class MSCollapsibleEntry { public: enum STATE { OPEN, CLOSED, NOTREADY }; public: MSCollapsibleEntry(MSWidget*, MSCollapsibleLayout*); MSCollapsibleEntry(const MSCollapsibleEntry&); void resize(int,int); void changeState(); void state(STATE); void height(int) ; void moveTo( int, int); void show() ; int width() const; unsigned long resizeConstraints() const; void setEntry(); void unsetEntry(); void destroy(); void toolTip(const MSStringVector &); const MSStringVector &toolTip() const {return _handle->toolTip();} MSBoolean displayToolTip() const { return _handle->displayToolTip(); } void close(); void open(); MSWidget* widget() const { return _widget; } STATE state() const { return _state; } MSWidget* button() const { return _handle; } int height() const { return _widget->height(); } void updateTile( MSPixmap* pixmap_) { _handle->updateTile(pixmap_);} private: class Handle : public MSLabel { public: Handle(MSWidget *,MSCollapsibleEntry*); void updateTile( MSPixmap*); ~Handle(void); private: MSCollapsibleEntry* _entry; void init(void); virtual void buttonPress(const XEvent *); virtual void redraw(); }; private: MSWidget* _widget; Handle* _handle; MSCollapsibleLayout* _owner; STATE _state; }; MSCollapsibleLayout::MSCollapsibleLayout(MSWidget *owner_) : MSWidgetCommon(owner_),_tile(0) { init(); } MSCollapsibleLayout::~MSCollapsibleLayout(void) { MSNodeItem *hp=childListHead(); MSNodeItem *np; MSWidget *wid; // delete the widget after the node has been removed from the list // this will prevent childDestroy from causing damage while ((np=hp->next())!=hp) { wid=((MSCollapsibleEntry*)np->data())->widget(); delete np; if (wid!=0) safeDestroy(wid); _childCount--; } } void MSCollapsibleLayout::init(void) { _childCount=0; _shadowThickness=MSCollapsibleLayoutDefaultShadowThickness; _highlightThickness=MSCollapsibleLayoutDefaultHighlightThickness; shadowStyle(MSRaised); selectInput(MSCollapsibleLayoutEventMask); internalEvent(MSFalse); naturalSizing = MSFalse; handleBackground(MSCollapsibleLayoutDefaultHandleBackground); handleForeground(MSCollapsibleLayoutDefaultHandleForeground); handleSize(MSCollapsibleLayoutDefaultHandleSize); } void MSCollapsibleLayout::hideConfigure(MSCollapsibleEntry* entry_) { if (entry_->state()==MSCollapsibleEntry::OPEN) // a widget just opened entryOpened(); else // a widget just closed entryClosed(); computeSize(); } void MSCollapsibleLayout::configure(void) { placement(); } void MSCollapsibleLayout::childInsert(MSWidget *widget_) { childCreate(widget_); if (widget_->mapped() == MSTrue ) { getEntry(widget_)->setEntry(); // ? to help with reparenting computeSize(); } } void MSCollapsibleLayout::childRemove(MSWidget *widget_) { childDestroy(widget_); } void MSCollapsibleLayout::childCreate(MSWidget *widget_) { if(internalEvent()==MSFalse){ internalEvent(MSTrue); MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; MSBoolean found=MSFalse; while (found==MSFalse&&(np=np->next())!=hp) { if (((MSCollapsibleEntry*)np->data())->widget()==widget_) { found=MSTrue; np=hp->prev(); } } if (widget_!=0&&found!=MSTrue) { MSNodeItem *np=new MSNodeItem((void *)new MSCollapsibleEntry(widget_,this)); np->insert(hp); _childCount++; } internalEvent(MSFalse); } } // a child has been destroyed-remove it from the child list void MSCollapsibleLayout::childDestroy(MSWidget *widget_) { MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; while ((np=np->next())!=hp) { if (((MSCollapsibleEntry *)np->data())->widget()==widget_) { ((MSCollapsibleEntry *)np->data())->destroy(); delete (MSCollapsibleEntry *)np->data(); delete np; _childCount--; np=hp->prev(); computeSize(); } } } void MSCollapsibleLayout::print(const char *file_) { MSBoolean fileOpen=MSFalse; MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; MSCollapsibleEntry *entry; if (outputMode()==Draw) { if (file_!=0) displayPrintFileName(file_); if (displayPrintOpen(this)==MSTrue) { fileOpen=MSTrue; outputMode(Print); displayPrintXorigin(0); displayPrintYorigin(0); } else return; } if (mapped()==MSTrue) redraw(); while ((np=np->next())!=hp) { entry=(MSCollapsibleEntry*) np->data(); if(entry->state()!=MSCollapsibleEntry::NOTREADY) { displayPrintOriginInc(entry->widget()); entry->widget()->print(); displayPrintOriginDec(entry->widget()); displayPrintOriginInc(entry->button()); entry->button()->print(); displayPrintOriginDec(entry->button()); } } if (fileOpen==MSTrue) { displayPrintClose(); outputMode(Draw); } } void MSCollapsibleLayout::firstMapNotify(){ computeSize(); } void MSCollapsibleLayout::show(void) { if (mapped()==MSFalse) { internalEvent(MSTrue); MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; MSCollapsibleEntry *eid; while((np=np->next())!=hp) { eid=(MSCollapsibleEntry *)np->data(); eid->show(); } map(); internalEvent(MSFalse); } } void MSCollapsibleLayout::visibilityObscured(void) { visible(MSFalse); MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; while((np=np->next())!=hp) { visibilityObscuredNotify(((MSCollapsibleEntry *)np->data())->widget()); visibilityObscuredNotify(((MSCollapsibleEntry *)np->data())->button()); } } void MSCollapsibleLayout::visibilityUnobscured(void) { visible(MSTrue); MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; while((np=np->next())!=hp) { visibilityUnobscuredNotify(((MSCollapsibleEntry *)np->data())->widget()); visibilityUnobscuredNotify(((MSCollapsibleEntry *)np->data())->button()); } } MSWidgetVector MSCollapsibleLayout::children(void) { MSWidgetVector vector; MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; while ((np=np->next())!=hp) vector.append(((MSCollapsibleEntry *)np->data())->widget()); return vector; } void MSCollapsibleLayout::internalEvent(MSBoolean internalEvent_) {_internalEvent=internalEvent_;} MSBoolean MSCollapsibleLayout::internalEvent(void) {return _internalEvent;} void MSCollapsibleLayout::placement(void) { int width; int height; int hiddenWidgets,unconstrainedWidgets; if(frozen() != MSTrue){ internalEvent(MSTrue); natural(width,height,hiddenWidgets,unconstrainedWidgets); doShownPlacement(height,hiddenWidgets,unconstrainedWidgets); doHiddenPlacement(); internalEvent(MSFalse); } } void MSCollapsibleLayout::natural( int &naturalWidth_, int &naturalHeight_, int &hiddenWidgets_,int &unconstrainedWidgets_) { MSNodeItem *hp=childListHead(); MSNodeItem *np; np = hp; MSCollapsibleEntry* entry; int width =0 ,maxwidth =0; int yNeeded = 0; hiddenWidgets_ = 0; // unconstrained_widgets is the number of widgets whose hights are adjustable unconstrainedWidgets_ = 0; // this loop calculates how much space the layout should take in its present state while ((np=np->next())!=hp) { entry = (MSCollapsibleEntry*)np->data(); if(entry->state()==MSCollapsibleEntry::OPEN){ yNeeded+= entry->height(); if(!(entry->resizeConstraints() & At::MinimizeHeight ) && !( entry->resizeConstraints() & At::MaintainHeight) ) unconstrainedWidgets_++; width = entry->width(); if (maxwidth < width) maxwidth =width; } if(entry->state()==MSCollapsibleEntry::CLOSED) hiddenWidgets_++; // If buttons will be on the bottom, take this into account } if(hiddenWidgets_ != 0) yNeeded += _handleSize; naturalHeight_ = yNeeded; if(MSRect::width() > maxwidth && naturalSizing == MSFalse) naturalWidth_ = MSRect::width(); else naturalWidth_ = maxwidth; } void MSCollapsibleLayout::doShownPlacement(int& height_, int &hiddenWidgets_, int &unconstrainedWidgets_) { MSNodeItem *hp=childListHead(); MSNodeItem *np; np = hp; MSCollapsibleEntry* entry; int yDisplacement = 0; int yDifference= height_ - MSRect::height() ; int width = MSRect::width() ; float Ydiff =0; int newWidth; int newHeight; if ( ( _childCount - hiddenWidgets_ )!=0){ Ydiff = ( unconstrainedWidgets_ != 0) ? (yDifference /unconstrainedWidgets_) :(yDifference/( _childCount - hiddenWidgets_ )) ; } while ((np=np->next())!=hp) { entry = (MSCollapsibleEntry*)np->data(); if(entry->state()==MSCollapsibleEntry::OPEN) { entry->moveTo(0,yDisplacement); newWidth = entry->width(); newHeight = entry->height(); // if the widget doesnt have a w or W constraint, make it the maximium width if(! (entry->resizeConstraints() & At::MinimizeWidth ) && ! ( entry->resizeConstraints() & At::MaintainWidth)) newWidth = width; // no vertical constraints on this entry, so it can take the slack if(!(entry->resizeConstraints() & At::MinimizeHeight ) && !( entry->resizeConstraints() & At::MaintainHeight) ) { newHeight = (int)((entry->height() > Ydiff )? (entry->height() - Ydiff ): 0) ; yDisplacement+= newHeight; } else // if their are vertical constraints { if(unconstrainedWidgets_ != 0) { // if their are no widgets willing to be strethced they all contribute newHeight = entry->height(); yDisplacement += newHeight; } else { newHeight = (int)((entry->height() > Ydiff )? (entry->height() - Ydiff ): 0) ; yDisplacement += newHeight; } } entry->resize(newWidth,newHeight); } } } void MSCollapsibleLayout::doHiddenPlacement() { MSNodeItem *hp=childListHead(); MSNodeItem *np; np = hp; MSCollapsibleEntry* entry; int xDisplacement =0; int yDisplacement_ =height() - _handleSize; while ((np=np->next())!=hp) { entry = (MSCollapsibleEntry*)np->data(); if(entry->state()==MSCollapsibleEntry::CLOSED) xDisplacement += entry->height(); } float xDifference = xDisplacement -width(); // if the buttons representing the hidden widgets are widder than this widgets current width // shrink the buttons proportionatly to fit float xDiff = (xDifference >=0) ? ((float)xDifference) / xDisplacement : 0; xDisplacement = 0; while ((np=np->next())!=hp) { entry = (MSCollapsibleEntry*)np->data(); if(entry->state()==MSCollapsibleEntry::CLOSED){ entry->moveTo(xDisplacement,yDisplacement_); entry->resize((int)(entry->height()*(1-xDiff)),entry->height()); xDisplacement += (int)(entry->height()*(1-xDiff)); } } } void MSCollapsibleLayout::set(MSAttrValueList& avList_) { MSWidgetCommon::set(avList_); MSIndexVector index; for (unsigned i=0;icolorName(handleBackground()),MSAttrValue::Color); avList_<colorName(handleForeground()),MSAttrValue::Color); MSStringVector handleColor; MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; MSCollapsibleEntry * entry; MSStringVector toolTips; hp=childListHead(); np=hp; while ((np=np->next())!=hp) { entry=(MSCollapsibleEntry *)np->data(); if(entry->displayToolTip() == MSTrue) toolTips.append(MSAttrValue::stringVectorToString(entry->toolTip()) ); else toolTips.append("" ); } avList_<mapped()==MSTrue && entry->state() == MSCollapsibleEntry::NOTREADY){ entry->setEntry(); computeSize(); } } } void MSCollapsibleLayout::childUnmap(MSWidget *widget_) { MSCollapsibleEntry* entry; entry = getEntry(widget_); if(entry != 0 && internalEvent() == MSFalse){ entry->unsetEntry(); computeSize(); } } void MSCollapsibleLayout::childConfigure(MSWidget *widget_) { MSCollapsibleEntry* entry; if(internalEvent()==MSFalse){ entry = getEntry(widget_); if(entry !=0 && widget_->mapped()==MSTrue && entry->state() == MSCollapsibleEntry::NOTREADY){ entry->setEntry(); computeSize(); } else if(entry !=0 && widget_->mapped()==MSTrue ){ entry->setEntry(); computeSize(); } } } void MSCollapsibleLayout::naturalSize(){ MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; internalEvent(MSTrue); while ((np=np->next())!=hp) { ((MSCollapsibleEntry*)np->data())->widget()->naturalSize(); } internalEvent(MSFalse); naturalSizing = MSTrue; computeSize(); naturalSizing = MSFalse; } void MSCollapsibleLayout::childResizeConstraints(MSWidget * widget_) { MSCollapsibleEntry* entry; entry = getEntry(widget_); if(entry != 0) placement(); } MSCollapsibleEntry *MSCollapsibleLayout::getEntry(MSWidget *widget_) const { MSNodeItem *hp=(MSNodeItem *)childListHead(); MSNodeItem *np=hp; MSCollapsibleEntry *entry; while ((np=np->next())!=hp) { entry=(MSCollapsibleEntry *) np->data(); if (entry->widget()==widget_) return entry; } return 0; } void MSCollapsibleLayout::permuteWidgets(const MSWidgetVector &aWidgetVector_) { MSNodeItem newList; MSNodeItem *hp=childListHead(); MSNodeItem *np; for (unsigned i=0;inext())!=hp) { MSCollapsibleEntry *entry=(MSCollapsibleEntry *)np->data(); if (entry->widget()==aWidgetVector_(i)) { np->remove(); np->insert(&newList); break; } } } MSNodeItem *next=hp->next(); np=next; while(np!=hp) { MSCollapsibleEntry *entry=(MSCollapsibleEntry *)np->data(); if(entry->state() == MSCollapsibleEntry::OPEN) entry->close(); next=np->next(); np->remove(); np->insert(&newList); np=next; } next=newList.next(); np=next; while(np!=&newList) { next=np->next(); np->remove(); np->insert(hp); np=next; } computeSize(); placement(); } void MSCollapsibleLayout::handleToolTip(MSWidget* widget_, const MSStringVector &toolTip_) { MSCollapsibleEntry* entry = getEntry(widget_); if ( entry != 0 && toolTip_.length()!=0) { entry->toolTip(toolTip_); } } const MSStringVector & MSCollapsibleLayout::handleToolTip( MSWidget *widget_) const { MSCollapsibleEntry *entry; entry = getEntry(widget_); if (entry != 0) return entry->toolTip(); return (*(MSStringVector *)server()->toolTipHashTable()->notFound()); } void MSCollapsibleLayout::close(MSWidget* widget_) { MSCollapsibleEntry* entry = getEntry(widget_); if ( entry != 0 ) { entry->close(); hideConfigure(entry); } } void MSCollapsibleLayout::open(MSWidget* widget_) { MSCollapsibleEntry* entry = getEntry(widget_); if ( entry != 0) { entry->open(); hideConfigure(entry); } } MSBoolean MSCollapsibleLayout::isClosed(MSWidget* widget_) const { MSCollapsibleEntry* entry = getEntry(widget_); if ( entry != 0 && entry->state() == MSCollapsibleEntry::CLOSED ) return MSTrue; return MSFalse; } MSBoolean MSCollapsibleLayout::isOpened(MSWidget* widget_) const { return (isClosed(widget_) == MSTrue ) ? MSFalse: MSTrue ; } void MSCollapsibleLayout::handleBackground(const char *pString_) { handleBackground(_server->pixel(pString_)); } void MSCollapsibleLayout::handleBackground(unsigned long pixel_) { if (pixel_!=handleBackground()) { unsigned long old=handleBackground(); _handleBg=pixel_; updateHandleTile(); } } unsigned long MSCollapsibleLayout:: handleBackground() const {return _handleBg;} void MSCollapsibleLayout::handleForeground(const char *pString_) { handleForeground(_server->pixel(pString_)); } void MSCollapsibleLayout::handleForeground(unsigned long pixel_) { if (pixel_!=handleForeground()) { unsigned long old=handleForeground(); _handleFg=pixel_; updateHandleTile(); } } unsigned long MSCollapsibleLayout:: handleForeground() const {return _handleFg;} void MSCollapsibleLayout::updateHandleTile() { if(_tile != 0) delete _tile; _tile=new MSPixmap(server(),MSPixmap::ForegroundFiftyPixmap,_handleFg,_handleBg); MSNodeItem *hp=childListHead(); MSNodeItem *np; np = hp; MSCollapsibleEntry *entry; while ((np=np->next())!=hp) { entry = (MSCollapsibleEntry*)np->data(); entry->updateTile(_tile); } } void MSCollapsibleLayout::computeSize() { int width,height; int hiddenWidgets,unconstrainedWidgets; natural(width,height,hiddenWidgets,unconstrainedWidgets); if(height == MSRect::height() && width == MSRect::width()) placement(); else resize(width,height); } void MSCollapsibleLayout::handleSize(int handleSize_) { if( _handleSize != handleSize_ ) { _handleSize = handleSize_; placement(); } } void MSCollapsibleLayout::entryClosed() { //activateCallback() } void MSCollapsibleLayout::entryOpened() { //activateCallback() } void MSCollapsibleLayout::unfreeze() { if (firstMap()==MSTrue) { freezeStatus(MSFalse); placement(); } } ///////////////////////////////////////////////////////////////// // class MSCollapsibleEntry ///////////////////////////////////////////////////////////////// MSCollapsibleEntry::MSCollapsibleEntry( MSWidget* widget_, MSCollapsibleLayout* owner_) : _widget(widget_), _owner(owner_) { state(NOTREADY); _handle= new Handle(_widget->owner(),this); _handle->updateTile(_owner->_tile); } MSCollapsibleEntry::MSCollapsibleEntry(const MSCollapsibleEntry& entry_): _widget(entry_._widget), _state(entry_._state), _owner(entry_._owner) {} void MSCollapsibleEntry::state( STATE state_) { _state=state_; } void MSCollapsibleEntry::show() { _widget->show(); // show child setEntry(); } void MSCollapsibleEntry::setEntry() { if( state() == NOTREADY ) { _handle->resize(_owner->_handleSize,_widget->height()); _handle->show(); state(OPEN) ; } } void MSCollapsibleEntry::unsetEntry() { _handle->hide(); state(NOTREADY) ; } void MSCollapsibleEntry::destroy() { _handle->destroy(); } int MSCollapsibleEntry::width() const { if(state()==OPEN) return _widget->width()+_owner->_handleSize; if(state()==CLOSED) return _handle->width(); return 0; } void MSCollapsibleEntry::resize( int width_, int height_){ if(state()==OPEN){ _widget->resize(width_ - (_owner->_handleSize) ,height_); _handle->resize(_owner->_handleSize,height_); } if(state()==CLOSED){ _handle->resize(width_,_owner->_handleSize); } } unsigned long MSCollapsibleEntry::resizeConstraints() const{ return _widget->resizeConstraints(); } void MSCollapsibleEntry::changeState() { if(_state == CLOSED){ open(); _owner->hideConfigure(this); } else{ close(); _owner->hideConfigure(this); } } void MSCollapsibleEntry::close(){ if(state()!=NOTREADY){ state(CLOSED); _owner->internalEvent(MSTrue); _widget->hide(); _owner->internalEvent(MSFalse); } } void MSCollapsibleEntry::open(){ if(state()!=NOTREADY){ state(OPEN); _owner->internalEvent(MSTrue); _widget->show(); _owner->internalEvent(MSFalse); } } void MSCollapsibleEntry::height(int height_) { resize(width(),height_); } void MSCollapsibleEntry::moveTo( int x_, int y_){ _handle->moveTo(x_,y_); if (state()==OPEN) _widget->moveTo(_owner->_handleSize,y_); } void MSCollapsibleEntry::toolTip(const MSStringVector &toolTip_) { _handle->displayToolTip(MSTrue); _handle->toolTip(toolTip_); } /////////////////////////////////////////////////////////////////// // class MSCollapsibleEntry::Handle //////////////////////////////////////////////////////////////////// MSCollapsibleEntry::Handle::Handle(MSWidget *parent_, MSCollapsibleEntry* entry_) : MSLabel(parent_),_entry(entry_) { init(); } MSCollapsibleEntry::Handle::~Handle(void){} void MSCollapsibleEntry::Handle::init(void) { //Set some attributes to their default values shadowStyle(MSRaised); _shadowThickness=1; _highlightThickness=0; selectInput(ExposureMask|ButtonPressMask|Button1MotionMask); } void MSCollapsibleEntry::Handle::updateTile( MSPixmap* tile_) { XSetWindowBackgroundPixmap(display(),window(),tile_->pixmap()); MSWidget::clear(); redraw(); } void MSCollapsibleEntry::Handle::redraw(void) { if (mapped()==MSTrue) { drawBevel(); } } void MSCollapsibleEntry::Handle::buttonPress(const XEvent *event_) { if (sensitive()==MSTrue) { if (event_->xbutton.button==Button1) { _entry->changeState(); } } } aplus-fsf-4.22/src/MSGUI/MSColorCycle.C0000644000265000001440000000112110772770401013073 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include MSColorCycle::MSColorCycle(MSWidget *widget_,int row_,int column_,const MSUnsignedLongVector& colors_,MSCycleColorMode mode_) :_widget(widget_),_row(row_),_column(column_),_colors(colors_),_mode(mode_),_count(0) { _lastUpdate=*tod(); } MSColorCycle::~MSColorCycle(void) {} aplus-fsf-4.22/src/MSGUI/MSColorManager.C0000644000265000001440000002344610772770401013424 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include static const int MSColorManagerSize=256; MSColorManager::MSColorManager(void) { _server=MSDisplayServer::defaultDisplayServer(); init(); } MSColorManager::MSColorManager(MSDisplayServer& server_) : _colorPixelHashTable(MSColorManagerSize), _colorStringHashTable(MSColorManagerSize), _rgbHashTable(MSColorManagerSize) { _server=&server_; init(); } MSColorManager::~MSColorManager(void) {} void MSColorManager::init(void) { const unsigned short defaultRGBCloseness=USHRT_MAX/2; _warned=MSFalse; _bestMatch=MSTrue; _redCloseness=defaultRGBCloseness; _greenCloseness=defaultRGBCloseness; _blueCloseness=defaultRGBCloseness; _defaultFg=0; _defaultBg=0; _cmap=DefaultColormap(display(),DefaultScreen(display())); colorPixelHashTable().notFound(0x55FF); colorStringHashTable().notFound(0x0); rgbHashTable().notFound(ULONG_MAX); addColor(MSDefaultBackgroundColorSpec); addColor(MSDefaultForegroundColorSpec); _defaultBg=pixel(MSDefaultBackgroundColorSpec); _defaultFg=pixel(MSDefaultForegroundColorSpec); if (MSDefaultBackground==0) MSDefaultBackground=defaultBg(); if (MSDefaultForeground==0) MSDefaultForeground=defaultFg(); } unsigned long MSColorManager::addColor(const char *color_) { if (color_!=0) { XColor hardware_def; Status s=XParseColor(display(),colormap(),color_,&hardware_def); if (s!=0) s=XAllocColor(display(),colormap(),&hardware_def); else { MSMessageLog::warningMessage("Error: Bad Color Specification '%s'.\n",color_); return defaultFg(); } if (s!=0) { cacheColor(color_,hardware_def.pixel); return hardware_def.pixel; } else { Visual *visual=server()->visual(); // We are only going to implement best match for psuedo color visual if (bestMatch()==MSTrue&&(visual->c_class==PseudoColor||visual->c_class==GrayScale)) { bestMatchWarning(color_); if (matchColor(hardware_def)==MSTrue) { cacheColor(color_,hardware_def.pixel); return hardware_def.pixel; } else { MSMessageLog::warningMessage("Warning - Failed to find a best match for requested color. Using default.\n"); return defaultFg(); } } else { MSMessageLog::warningMessage("Warning - Cannot allocate color '%s'.\n" "Possible blown colormap resources - i.e. more than 255 colors in use\n",color_); return defaultFg(); } } } else { MSMessageLog::warningMessage("Empty Color Specification.\n"); return defaultFg(); } } unsigned long MSColorManager::pixel(const char *color_) { unsigned long pixel=(unsigned long) colorPixelHashTable().lookup(color_); if (pixel==colorPixelHashTable().notFound()) return addColor(color_); return pixel; } const char *MSColorManager::colorName(unsigned long pixel_) const { return (char *)colorStringHashTable().lookup(pixel_);} void MSColorManager::query(XColor *colorcell_) const { XQueryColor(display(),colormap(),colorcell_); } MSBoolean MSColorManager::allocate(XColor *colorcell_) { char key[256]; sprintf(key,"%u.%u.%u",colorcell_->red,colorcell_->green,colorcell_->blue); unsigned long pixel=(unsigned long) rgbHashTable().lookup(key); if (pixel!=rgbHashTable().notFound()) { colorcell_->pixel=pixel; return MSTrue; } else if (XAllocColor(display(),colormap(),colorcell_)!=0) { rgbHashTable().add(key,(void *)colorcell_->pixel); return MSTrue; } else { Visual *visual=server()->visual(); if (bestMatch()==MSTrue&&(visual->c_class==PseudoColor||visual->c_class==GrayScale)) { MSString colorString; colorString<<"("<red)<<"."<green)<<"."<blue)<<")"; bestMatchWarning(colorString); if (matchColor(*colorcell_)==MSFalse) { MSMessageLog::warningMessage("Failed to find a best match for requested color. Using default.\n"); colorcell_->pixel=defaultFg(); return MSFalse; } else { rgbHashTable().add(key,(void *)colorcell_->pixel); return MSTrue; } } else { MSMessageLog::warningMessage("Warning - Cannot allocate RGB of %d.%d.%d\n" "Possible blown colormap resources - i.e. more than 255 colors in use\n", colorcell_->red,colorcell_->green,colorcell_->blue); colorcell_->pixel=defaultFg(); return MSFalse; } } } static unsigned indexCompareUp(long *p_,unsigned i_,unsigned j_) { return (p_[i_]!=p_[j_])?((p_[i_])<(p_[j_])):(i_>1; if (high_==m) {p_[low_]=UINT_MAX;return low_;} high_=mergeSortUp(n_,sp_,p_,m,high_); low_=mergeSortUp(n_,sp_,p_,low_,m); if (indexCompareUp(sp_,high_,low_)) {m=low_;low_=high_;high_=m;} for (t=low_;;low_=p_[low_]=high_,high_=m) { L:m=p_[low_]; if (UINT_MAX==m) {p_[low_]=high_;return t;} if (indexCompareUp(sp_,m,high_)) {low_=m;goto L;} } } // this is done here, so that we do need to pull in MSLongVector static MSIndexVector gradeUp(long *sp_,unsigned length_) { unsigned n=length_; if (n>0) { unsigned *p=new unsigned[n]; MSIndexVector::Data *d=MSIndexVector::Data::allocateWithLength(length_); unsigned *dp=d->data(); dp[0]=mergeSortUp(n,sp_,p,0,n); for (unsigned i=0;ivisual()->map_entries; XColor *colors=new XColor[ncols]; for (int n=0;n=(long)color_.red-(long)redCloseness()&& (long)colors[cIndex].red<=(long)color_.red+(long)redCloseness()&& (long)colors[cIndex].green>=(long)color_.green-(long)greenCloseness()&& (long)colors[cIndex].green<=(long)color_.green+(long)greenCloseness()&& (long)colors[cIndex].blue>=(long)color_.blue-(long)blueCloseness()&& (long)colors[cIndex].blue<=(long)color_.blue+(long)blueCloseness()) { if (XAllocColor(display(),colormap(),&colors[cIndex])) { if (i==bestMatchIteration) XUngrabServer(display()); color_=colors[cIndex]; delete [] closeness; delete [] colors; return MSTrue; } if (++index!=ncols) cIndex=colorIndex(index); else break; } if (i==bestMatchIteration) XUngrabServer(display()); if (index==0||index==ncols) { // If we get here, that means nothing in the colormap is close enough // for use, or everything in the colormap is r/w. delete [] closeness; delete [] colors; return MSFalse; } // Try the original color again cause the colormap might have changed. if (XAllocColor(display(),colormap(),&color_)) { delete [] closeness; delete [] colors; return MSTrue; } else { // For the last iteration, we want to grab the server to make sure // nobody else can touch the color map. if (i==bestMatchIteration-1) XGrabServer(display()); } } delete [] closeness; delete [] colors; return MSFalse; } void MSColorManager::cacheColor(const char *colorName_,unsigned long pixel_) { if ((unsigned long)colorPixelHashTable().lookup(colorName_)==colorPixelHashTable().notFound()) { colorPixelHashTable().add(colorName_,(void *)pixel_); } if ((char *)colorStringHashTable().lookup(pixel_)==(char *)colorStringHashTable().notFound()) { int len=strlen((char *)colorName_); char *cp=new char[len+1]; strcpy(cp,colorName_); cp[len]='\0'; colorStringHashTable().add(pixel_,(void *)cp); } } void MSColorManager::bestMatchWarning(const char *) { // We don't look at the color string passed in, but if we // ever need it, it is available. if (warned()==MSFalse) { _warned=MSTrue; MSMessageLog::warningMessage("Warning - Color allocation failed. Will be searching for a best match.\n" " Some colors may appear slightly different from their specifications.\n"); } } aplus-fsf-4.22/src/MSGUI/MSComboBox.C0000644000265000001440000002702710772770402012563 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include static const int MSComboBoxDefaultScollbarWidth=12; const unsigned int grabMask=(unsigned int)(ButtonPressMask|ButtonReleaseMask|Button1MotionMask); MSComboList::MSComboList(MSComboListShell *owner_) : MSStringList(owner_) { _scrollBarState=VsbEnabled; _acceptFocus=MSFalse; _highlighted=MSTrue; _displayAllColumns=MSTrue; _selectionMode=MSSingle; vsbSize(MSComboBoxDefaultScollbarWidth); } void MSComboList::defaultDoubleClickBehavior(const XEvent *) { doubleClick(); } void MSComboList::buttonPress(const XEvent *pEvent_) { if (pEvent_->xbutton.subwindow==0) { unsigned keys; int ix=0,iy=0,rx=0,ry=0; Window root,child; XQueryPointer(display(),comboBox()->window(),&root,&child,&rx,&ry,&ix,&iy,&keys); if (child==comboBox()->fieldEditor()->window()) activate(); else escape(); } else { defaultButtonBehavior(pEvent_); if (pEvent_->xbutton.subwindow==panner()->window()&& comboBox()->selectionMode()==MSSingle) doubleClick(); } } void MSComboList::keyPressEvent(const XEvent *pEvent_) { char buf[16]; KeySym keysym; int len=XLookupString((XKeyEvent *)pEvent_,buf,8,&keysym,NULL); buf[len]='\0'; unsigned searchStart; switch (keysym) { case XK_Escape: escape(); break; case XK_KP_Enter: case XK_Return: activate(); break; case XK_Up: up(); selectEditableText(); break; case XK_Down: down(); selectEditableText(); break; case XK_F29: pageUp(); selectEditableText(); break; case XK_Prior: pageUp(); selectEditableText(); break; case XK_F35: pageDown(); selectEditableText(); break; case XK_Next: pageDown(); selectEditableText(); break; case XK_F27: home(); selectEditableText(); break; case XK_Home: home(); selectEditableText(); break; case XK_R13: end(); selectEditableText(); break; case XK_End: end(); selectEditableText(); break; default: keyPressNotify(comboBox(),pEvent_,keysym,pEvent_->xkey.state,buf); if (MSView::model()!=0&&selectionMode()!=MSMultiple) { if (selectedText()==MSTrue) searchStart=0; else searchStart=selectedRow(); if (keysym==XK_BackSpace) selectString(searchStart>0?searchStart-1:0,comboBox()->editString()); else selectString(searchStart,comboBox()->editString()); _selectedText=MSFalse; } break; } } void MSComboList::keyPress(const XEvent *pEvent_,KeySym keysym_,unsigned int state_,const char *pString_) { MSStringList::keyPress(pEvent_,keysym_,state_,pString_); } unsigned MSComboList::selectString(int startRow_,const char *pString_) { if (MSView::model()!=0) { if (pString_!=0&&strlen(pString_)>0) { if (startRow_<0||startRow_>=list().length()) startRow_=0; if (startRow_>=0) { const MSStringVector &aStringVector=list(); unsigned i,n=aStringVector.length(),startRow=startRow_; // search forward starting from startRow for (i=startRow;iselectEditableText(); _selectedText=MSTrue; } } void MSComboList::setSelectedRowFrom(const char *pString_) { if (MSView::model()!=0&&pString_!=0) { unsigned index=list().indexOf(pString_); if (indexreplaceEditableText(selection()); selectEditableText(); } } void MSComboList::resetVisibleColumns(void) { if (displayAllColumns()==MSTrue) { if (MSView::model()!=0) columns(list().maxLength()); } } void MSComboList::show(void) { resetVisibleColumns(); switch (comboBox()->selectionMode()) { case MSMultiple: selectionMode(MSMultiple); break; case MSBrowse: case MSSingle: default: selectionMode(MSSingle); break; } MSStringList::show(); } void MSComboList::reset(void) { selectionVector(MSIndexVector::nullVector()); home(); } void MSComboList::escape(void) { shell()->escape(); reset(); } void MSComboList::activate(void) { if (comboBox()->selectionMode()==MSSingle) { if(selectedRow()!=-1) comboBox()->replaceEditableText(selection()); } else { MSIndexVector aSelectionVector(selectionVector()); aSelectionVector.sortUp(); MSString buffer; for (unsigned i=0;iappendEditableText(formatOutput(buffer.removeAll(),aSelectionVector(i))); } } shell()->activate(); reset(); } void MSComboList::doubleClick(void) { if (comboBox()->selectionMode()==MSSingle) { comboBox()->replaceEditableText(selection()); activate(); } else if (comboBox()->selectionMode()==MSBrowse) { comboBox()->appendEditableText(selection()); } } MSComboListShell::MSComboListShell(MSComboBox *box_) : MSWidget(box_->server()) { _comboBox=box_; _bg=comboBox()->background(); _fg=comboBox()->foreground(); _fontID=comboBox()->font(); _comboList=0; _cursor=new MSDisplayCursor(server(),XC_left_ptr,server()->pixel("black"),server()->pixel("white")); XSetWindowAttributes attributes; attributes.background_pixel=comboBox()->background(); attributes.border_pixel=comboBox()->foreground(); attributes.override_redirect=(int)MSTrue; attributes.cursor=cursor()->cursor(); _window=(Window)XCreateWindow(display(), server()->root(), MSRect::x(),MSRect::y(),MSRect::width(),MSRect::height(), 1,(int)CopyFromParent,InputOutput,CopyFromParent, (unsigned long)(CWBackPixel|CWBorderPixel|CWOverrideRedirect|CWCursor), (XSetWindowAttributes *)&attributes); _eventMask=0; server()->widgetHashTable()->add(window(),this); _comboList=new MSComboList(this); } MSComboListShell::~MSComboListShell(void) { safeDestroy(comboList()); delete _cursor; } void MSComboListShell::childConfigure(MSWidget *pWidget_) { resize(pWidget_->width(),pWidget_->height()); } void MSComboListShell::configure(void) { if (comboList()!=0) comboList()->resize(width(),height()); } void MSComboListShell::grab(void) { server()->grabKeyboard(comboList()->window(),False,GrabModeAsync,GrabModeAsync,CurrentTime,MSTrue); server()->grabPointer(comboList()->window(),False, grabMask,GrabModeAsync,GrabModeAsync,None,None,CurrentTime,MSTrue); XFlush(display()); } void MSComboListShell::ungrab(void) { server()->ungrabPointer(comboList()->window(),CurrentTime); server()->ungrabKeyboard(comboList()->window(),CurrentTime); XFlush(display()); } void MSComboListShell::escape(void) { hide(); comboBox()->listDone(); } void MSComboListShell::activate(void) { hide(); comboBox()->listActivate(); } void MSComboListShell::showAt(int x_,int y_) { moveTo(x_,y_); show(); } void MSComboListShell::show(void) { if (mapped()==MSFalse) { if (comboBox()->selectionMode()==MSSingle) { MSString buffer; comboList()->setSelectedRowFrom(comboBox()->formatOutput(buffer)); } comboList()->show(); map(); XFlush(display()); raise(); grab(); } } void MSComboListShell::hide(void) { if (mapped()==MSTrue) { ungrab(); unmap(); comboList()->hide(); } } MSComboBox::MSComboBox(MSWidget *owner_,const char *label_,const MSSymbol& tag_) : MSComboField(owner_,label_,tag_) { internalCouple(new MSString); init(); } MSComboBox::MSComboBox(MSWidget *owner_,MSString& model_, const char *label_,const MSSymbol& tag_) : MSComboField(owner_,label_,tag_) { model(model_); init(); } MSComboBox::~MSComboBox(void) { safeDestroy(listShell()); } MSBoolean MSComboBox::validate(const char *pString_) { if (MSView::model()!=0) { return (value().set(pString_)==MSError::MSSuccess)?MSTrue:MSFalse; } return MSFalse; } void MSComboBox::updateData(void) { if (MSView::model()==0) internalCouple(new MSString); MSComboField::updateData(); } const char *MSComboBox::formatOutput(MSString &buffer_) { if (MSView::model()!=0) buffer_=value(); return buffer_.string(); } void MSComboBox::listModel(MSStringVector& listModel_) { listShell()->comboList()->model(listModel_); listShell()->comboList()->columns(listModel().maxLength()); } MSStringVector& MSComboBox::listModel(void) { return listShell()->comboList()->list(); } void MSComboBox::init(void) { _listShell=0; _selectionMode=MSSingle; _separator=","; createListShell(); } void MSComboBox::createListShell(void) { if (listShell()==0) _listShell=new MSComboListShell(this); } void MSComboBox::selectEditableText(void) { fieldEditor()->selectAll(); } void MSComboBox::replaceEditableText(const char *pString_) { fieldEditor()->string(pString_); } void MSComboBox::appendEditableText(const char *pString_) { if (fieldEditor()->length()>0) { MSString aString(fieldEditor()->string(),fieldEditor()->length(), separator().string(),separator().length(), pString_,(pString_!=0)?strlen(pString_):0); fieldEditor()->string(aString); } else fieldEditor()->string(pString_); } void MSComboBox::showList(void) { drawComboButton(MSTrue); clearEditor(); mapEditor(); int x,y; rootXY(x,y); y+=height(); // force size computation. listShell()->showAt(server()->width(),server()->height()); x+=buttonRect().x()-listShell()->width(); listShell()->showAt(x,y); } void MSComboBox::listDone(void) { drawComboButton(MSFalse); escape(); } void MSComboBox::listActivate(void) { drawComboButton(MSFalse); activate(); } void MSComboBox::buttonActivate(void) { showList(); } void MSComboBox::updateFont(Font oldfid_) { MSComboField::updateFont(oldfid_); if (oldfid_==listBox()->font()) listBox()->font(font()); } void MSComboBox::updateBackground(unsigned long oldbg_) { MSComboField::updateBackground(oldbg_); if (oldbg_==listBox()->background()) listBox()->background(background()); } void MSComboBox::updateForeground(unsigned long oldfg_) { MSComboField::updateForeground(oldfg_); if (oldfg_==listBox()->foreground()) listBox()->foreground(foreground()); } void MSComboBox::set(MSAttrValueList& avList_) { MSComboField::set(avList_); MSIndexVector index; for (unsigned i=0;i MSComboField::MSComboField(MSWidget *owner_,const char *label_,const MSSymbol& tag_) : MSEntryFieldCombo(owner_,label_,tag_) { internalCouple(new MSString); init(); } MSComboField::MSComboField(MSWidget *owner_,MSString& model_,const char *label_,const MSSymbol& tag_) : MSEntryFieldCombo(owner_,label_,tag_) { model(model_); init(); } MSComboField::~MSComboField(void) {} void MSComboField::model(MSString& model_) { couple(&model_); } void MSComboField::value(const char *pString_) { if (MSView::model()!=0) value()=pString_; } MSBoolean MSComboField::validate(const char *pString_) { return (MSView::model()!=0)?((value().set(pString_)==MSError::MSSuccess)?MSTrue:MSFalse):MSTrue; } const char *MSComboField::formatOutput(MSString &buffer_) { if (MSView::model()!=0) buffer_=value(); return buffer_.string(); } void MSComboField::init(void) { buttonState(ComboButton, MSTrue); } const char *MSComboField::editString(void) { return fieldEditor()->string(); } void MSComboField::comboArrowColor(const char * color_) { buttonColor(ComboButton, color_); } void MSComboField::comboArrowColor(unsigned long color_) { buttonColor(ComboButton, color_); } unsigned long MSComboField::comboArrowColor(void) { return buttonColor(ComboButton); } void MSComboField::set(MSAttrValueList& avList_) { MSEntryFieldCombo::set(avList_); MSIndexVector index; for (unsigned i=0;icolorName(comboArrowColor()), MSAttrValue::Color); return MSEntryFieldCombo::get(avList_); } aplus-fsf-4.22/src/MSGUI/MSComposite.C0000644000265000001440000000250510772770402013007 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include static const unsigned long MSCompositeEventMask=ExposureMask; static const int MSCompositeDefaultShadowThickness=2; static const int MSCompositeDefaultHighlightThickness=0; MSComposite::MSComposite(MSWidget *owner_) : MSWidgetCommon(owner_) { init();} MSComposite::~MSComposite(void) {} void MSComposite::init(void) { _shadowThickness=MSCompositeDefaultShadowThickness; _highlightThickness=MSCompositeDefaultHighlightThickness; shadowStyle(MSRaised); selectInput(MSCompositeEventMask); } void MSComposite::redraw(void) { if (highlighted()==MSTrue) drawHighlight(); drawShadow(); } void MSComposite::focusIn(void) { highlight(); } void MSComposite::focusOut(void) { unHighlight(); } void MSComposite::configure(void) { placement(); } // ######################################################### // default virtual methods - prevents gratuitous inlining // ######################################################### void MSComposite::computeSize(void) {} void MSComposite::placement(void) {} aplus-fsf-4.22/src/MSGUI/MSCompositeField.C0000644000265000001440000006444410772770402013765 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include static const unsigned MSCompositeFieldDefaultValueWidth=9; static const unsigned MSCompositeFieldDefaultShadowThickness=0; static const unsigned MSCompositeFieldDefaultHighlightThickness=1; static const unsigned MSCompositeFieldDefaultSpacing=2; static const unsigned MSCompositeFieldDefaultEditWidth=UINT_MAX-1; static const unsigned MSCompositeFieldValueShadowThickness=2; static const unsigned MSCompositeFieldValueHighlightThickness=0; static const unsigned MSCompositeFieldLabelShadowThickness=0; static const unsigned MSCompositeFieldLabelHighlightThickness=0; static const unsigned MSCompositeFieldValueDefaultMargin=2; MSCompositeField::FieldValue::FieldValue(MSWidget *owner_) : MSTextRect(owner_), _shadow(owner_), _shadowThickness(MSCompositeFieldValueShadowThickness), _shadowStyle(MSSunken) {} MSCompositeField::FieldValue::~FieldValue(void) { } const MSShadow& MSCompositeField::FieldValue::shadow(void) const { return _shadow; } int MSCompositeField::FieldValue::marginWidth(void) const { return MSCompositeFieldValueDefaultMargin; } int MSCompositeField::FieldValue::highlightThickness(void) const { return MSCompositeFieldValueHighlightThickness; } int MSCompositeField::FieldValue::shadowThickness(void) const { return _shadowThickness; } MSShadowStyle MSCompositeField::FieldValue::shadowStyle(void) const { return _shadowStyle; } int MSCompositeField::FieldValue::offset(void) const { return highlightThickness()+shadowThickness()+marginWidth(); } void MSCompositeField::FieldValue::shadowThickness(int sht_) { _shadowThickness=sht_; } void MSCompositeField::FieldValue::shadowStyle(MSShadowStyle style_) { _shadowStyle=style_; } void MSCompositeField::FieldValue::naturalSize(void) { unsigned offset=2*(highlightThickness()+shadowThickness()); unsigned w=2*marginWidth()+textWidth(); unsigned h=textHeight(); resize(offset+w,offset+h); } void MSCompositeField::FieldValue::updateBackground(unsigned long) { _shadow.color(background()); } MSCompositeField::FieldLabel::FieldLabel(MSWidget *owner_) : MSTextRect(owner_) {} MSCompositeField::FieldLabel::FieldLabel(MSWidget *owner_,const char *label_) : MSTextRect(owner_,label_) {} MSCompositeField::FieldLabel::FieldLabel(MSWidget *owner_,const MSString& label_) : MSTextRect(owner_,label_) {} MSCompositeField::FieldLabel::~FieldLabel(void) {} int MSCompositeField::FieldLabel::marginWidth(void) const { return (length()>0)?MSCompositeFieldValueDefaultMargin:0; } int MSCompositeField::FieldLabel::highlightThickness(void) const { return MSCompositeFieldLabelHighlightThickness; } int MSCompositeField::FieldLabel::shadowThickness(void) const { return MSCompositeFieldLabelShadowThickness; } int MSCompositeField::FieldLabel::offset(void) const { return highlightThickness()+shadowThickness()+marginWidth(); } int MSCompositeField::FieldLabel::naturalWidth(void) const { return 2*(highlightThickness()+shadowThickness()+marginWidth())+textWidth(); } void MSCompositeField::FieldLabel::naturalSize(void) { unsigned offset=2*(highlightThickness()+shadowThickness()); unsigned w=2*marginWidth()+textWidth(); unsigned h=textHeight(); resize(offset+w,offset+h); } // ################################################################## // MSCompositeField // ################################################################## MSCompositeField::MSCompositeField(MSWidget *owner_,const MSSymbol& tag_) : _tag(tag_),MSComposite(owner_) { _fieldLabel=new FieldLabel(this); init(); } MSCompositeField::MSCompositeField(MSWidget *owner_,const char *label_,const MSSymbol& tag_) : _tag(tag_),MSComposite(owner_) { _fieldLabel=new FieldLabel(this,label_); init(); } MSCompositeField::~MSCompositeField(void) { if (_fieldLabel!=0) delete _fieldLabel; if (_fieldValue!=0) delete _fieldValue; XFreeGC(display(),_drawGC); } void MSCompositeField::init(void) { if(server()->defaultValueBackground()==0) { server()->defaultValueBackground(server()->colorName(server()->defaultBackground())); } freeze(); _clipMode=MSNoClipping; _fieldValue=new FieldValue(this); _labelAlignment=MSLeft; _labelJustification=MSRight; _valueAlignment=MSLeft; _labelSpacing=MSCompositeFieldDefaultSpacing; _shadowThickness=MSCompositeFieldDefaultShadowThickness; _highlightThickness=MSCompositeFieldDefaultHighlightThickness; _valueWidth=MSCompositeFieldDefaultValueWidth; _editWidth=MSCompositeFieldDefaultEditWidth; _marginHeight=0; _clipIndicatorForeground=foreground(); shadowStyle(MSSunken); resizeConstraints(At::Top|At::MaintainHeight); addToFocusList(); if (server()->defaultValueBackground()!=server()->defaultBackground()) { _fieldValue->background(server()->defaultValueBackground()); } _drawGC=XCreateGC(display(),window(),0,0); XSetFont(display(),drawGC(),font()); XSetStipple(display(),drawGC(),_fieldValue->textMSGC().stipple()); } MSBoolean MSCompositeField::validate(const char *) { return MSFalse; } const char *MSCompositeField::formatOutput(MSString &buffer_) { return buffer_.string(); } void MSCompositeField::firstMapNotify(void) { unfreeze(); adjustSize(); } void MSCompositeField::labelPixelWidth(unsigned labelPixelWidth_) { if (_fieldLabel!=0) { if (_fieldLabel->length()==0) labelPixelWidth_=0; if (_fieldLabel->width()!=labelPixelWidth_) { int offset=highlightThickness()+shadowThickness(); if (labelAlignment()==MSTop) { unsigned lh=_fieldLabel->textHeight()+ 2*(_fieldLabel->shadowThickness()+_fieldLabel->highlightThickness()); _fieldLabel->moveTo(offset,offset); _fieldValue->moveTo(offset,offset+lh); _fieldLabel->width(labelPixelWidth_); _fieldValue->width(width()-2*offset); } else { int trueWidth=width()-2*offset; int vw=trueWidth-int(labelPixelWidth_); _fieldLabel->width(labelPixelWidth_); _fieldValue->width(vw); _fieldLabel->moveTo(offset,offset); _fieldValue->moveTo(offset+labelPixelWidth_,offset); } redraw(); } } } void MSCompositeField::placement(void) { if (_fieldValue!=0&&_fieldLabel!=0) { int offset=highlightThickness()+shadowThickness(); int offset2=offset<<1; int vh=_fieldValue->textHeight()+ 2*(marginHeight()+_fieldValue->shadowThickness()+_fieldValue->highlightThickness()); int lh=_fieldLabel->textHeight()+ 2*(_fieldLabel->shadowThickness()+_fieldLabel->highlightThickness()); int lw=_fieldLabel->width(); int vw=_fieldValue->width(); int trueWidth=width()-offset2; if (labelAlignment()==MSTop) { _fieldLabel->moveTo(offset,offset); _fieldValue->moveTo(offset,offset+lh+labelSpacing()); _fieldLabel->width(lw); _fieldValue->width(trueWidth); } else { vw=trueWidth-_fieldLabel->width(); int h=(vh>lh)?vh:lh; if (vh==lh) height(h+offset2); else if (h+offset2>height()) height(h+offset2); _fieldLabel->height(h); _fieldValue->resize(vw,h); _fieldLabel->moveTo(offset,offset); _fieldValue->moveTo(offset+_fieldLabel->width(),offset); } redraw(); } } void MSCompositeField::adjustSize(void) { if (frozen()==MSFalse) { int offset=2*(highlightThickness()+shadowThickness()); int vw=computeValuePixelWidth(); int lw=2*_fieldLabel->offset()+_fieldLabel->textWidth(); int vh=_fieldValue->textHeight()+ 2*(marginHeight()+_fieldValue->shadowThickness()+_fieldValue->highlightThickness()); int lh=_fieldLabel->textHeight()+ 2*(_fieldLabel->shadowThickness()+_fieldLabel->highlightThickness()); int w,h; if (labelAlignment()==MSTop) { w=(vw>lw)?vw:lw; h=lh+vh+labelSpacing(); _fieldLabel->resize(lw,lh); _fieldValue->resize(w,vh); } else { w=lw+vw; h=(vh>lh)?vh:lh; _fieldLabel->resize(lw,h); _fieldValue->resize(vw,h); } w+=offset; h+=offset; if (w!=width()||h!=height()) resize(w,h); else placement(); } } unsigned MSCompositeField::computeLabelPixelWidth(void) { return _fieldLabel->width(); } unsigned MSCompositeField::computeValuePixelWidth(void) { return valueWidth()*_fieldValue->charWidth()+2*_fieldValue->offset(); } void MSCompositeField::computeSize(void) { adjustSize(); } void MSCompositeField::naturalSize(void) { adjustSize(); } void MSCompositeField::configure(void) { placement(); } void MSCompositeField::redraw(void) { if (frozen()==MSFalse&&mapped()==MSTrue) { drawFieldLabel(); drawFieldValue(); drawShadow(); if (highlighted()==MSTrue) drawHighlight(); } } void MSCompositeField::drawFieldLabel(void) { if (frozen()==MSFalse&&owner()->mapped()==MSTrue&&mapped()==MSTrue) { XFillRectangle(display(),window(),backgroundShadowGC(), _fieldLabel->x(),_fieldLabel->y(), _fieldLabel->width(),_fieldLabel->height()); const char *pString=_fieldLabel->string(); if (pString!=0) { unsigned len=_fieldLabel->length(); if (len>0) { int margin=(_fieldLabel->height()-_fieldLabel->textHeight())>>1; margin=(margin>0)?margin:0; int yy=_fieldLabel->y()+margin+_fieldLabel->textAscent(); int xx; int tw=_fieldLabel->textWidth(); int lw; if (labelAlignment()==MSLeft) lw=_fieldLabel->width(); else lw=_fieldValue->width(); int loffset=_fieldLabel->offset(); if (labelJustification()==MSCenter) { if (lw>=tw+loffset*2) { xx=_fieldLabel->x()+(lw-tw)/2; } else { xx=_fieldLabel->x()+loffset; } } else if (labelJustification()==MSRight) { xx=_fieldLabel->x()+(lw-loffset-tw); } else { xx=_fieldLabel->x()+loffset; } XDrawString(display(),window(),_fieldLabel->textGC(),_fieldLabel->textFontStruct(), xx,yy,pString,len); } } } } void MSCompositeField::drawFieldValue(void) { drawFieldValue(_fieldValue->foreground(),_fieldValue->background()); } void MSCompositeField::drawFieldValue(unsigned long fg_,unsigned long bg_) { if (frozen()==MSFalse&&owner()->mapped()==MSTrue&&mapped()==MSTrue) { int sht=_fieldValue->shadowThickness(); XFillRectangle(display(),window(), _fieldValue->shadow().backgroundShadowGC(), _fieldValue->x()+sht, _fieldValue->y()+sht, _fieldValue->width()-(2*sht), _fieldValue->height()-(2*sht)); MSString buffer; const char *pString=formatOutput(buffer); if (pString!=0&&buffer.length()>0) { int len=buffer.length(); int fulllen=len; int clipIndicatorWidth=0; int clipIndicatorMargin=2; int dw=_fieldValue->width()-2*_fieldValue->offset(); if (clipMode()==MSClipIndicator) { if (_fieldValue->textWidth(pString,len)>dw) { clipIndicatorWidth=_fieldValue->charWidth()+clipIndicatorMargin; dw-=clipIndicatorWidth; if (dw<0) { dw=0; clipIndicatorWidth=0; } } } if (dw>0) { while (_fieldValue->textWidth(pString,len)>dw) len--; if (len>0) { int offset=_fieldValue->highlightThickness()+_fieldValue->shadowThickness(); int margin=(_fieldValue->height()-(2*offset+_fieldValue->textHeight()))/2; int xx=_fieldValue->x()+_fieldValue->offset(); int yy=_fieldValue->y()+offset+((margin>0)?margin:0)+_fieldValue->textAscent(); if (valueAlignment()==MSCenter&&fulllen==len) { int tw=_fieldValue->textWidth(pString,len); xx+=(dw-tw)/2; } else if (valueAlignment()==MSRight||(clipIndicatorWidth>0&&fulllen>len)) { int tw=_fieldValue->textWidth(pString,len); xx=_fieldValue->x()+_fieldValue->width()-_fieldValue->offset()-tw-clipIndicatorWidth; } XSetForeground(display(),drawGC(),fg_); XSetBackground(display(),drawGC(),bg_); XDrawString(display(),window(), drawGC(),_fieldValue->textFontStruct(), xx,yy,pString,len); } } if (fulllen>len&&clipIndicatorWidth>0) { int offset=_fieldValue->highlightThickness()+_fieldValue->shadowThickness()+3; int xx=_fieldValue->x()+_fieldValue->width()-offset-clipIndicatorWidth+clipIndicatorMargin; XPoint points[3]; points[0].x=xx; points[0].y=offset; points[1].x=clipIndicatorWidth; points[1].y=(height()-2*offset)/2; points[2].x=-clipIndicatorWidth; points[2].y=points[1].y; XSetForeground(display(),drawGC(),clipIndicatorForeground()); XFillPolygon(display(),window(),drawGC(),points,3, Convex,CoordModePrevious); } } drawFieldValueShadow(); } } void MSCompositeField::drawFieldValueShadow(void) { int st=_fieldValue->shadowThickness(); if (st>0) { MSRect aRect(_fieldValue->x(),_fieldValue->y(), _fieldValue->width(),_fieldValue->height()); //Have to draw Bevel ourselves, since shadow may be different //from ours. GC topGC=_fieldValue->shadow().topShadowGC(); GC bottomGC=_fieldValue->shadow().bottomShadowGC(); Window id=window(); switch (valueShadowStyle()) { case MSRaised: drawBevelShadow(id,aRect,st,topGC,bottomGC); break; case MSSunken: drawBevelShadow(id,aRect,st,bottomGC,topGC); break; case MSEtchedIn: drawEtchedShadow(id,aRect,MSEtchedIn,st,bottomGC,topGC); break; case MSEtchedOut: drawEtchedShadow(id,aRect,MSEtchedOut,st,topGC,bottomGC); break; case MSFlat: drawFlatShadow(id,aRect,st,bottomGC); break; } } } void MSCompositeField::labelAlignment(MSAlignment alignment_) { if (alignment_!=labelAlignment()) { if (alignment_==MSLeft||alignment_==MSTop) { _labelAlignment=alignment_; computeSize(); } } } void MSCompositeField::labelJustification(MSAlignment justification_) { if (justification_!=labelJustification()) { if (justification_==MSLeft||justification_==MSRight||justification_==MSCenter) { _labelJustification=justification_; computeSize(); } } } void MSCompositeField::valueAlignment(MSAlignment alignment_) { if (alignment_!=valueAlignment()) { if (alignment_==MSLeft||alignment_==MSRight||alignment_==MSCenter) { _valueAlignment=alignment_; drawFieldValue(); } } } void MSCompositeField::labelForeground(const char *fg_) { labelForeground(server()->pixel(fg_)); } void MSCompositeField::labelForeground(unsigned long fg_) { if (fg_!=_fieldLabel->foreground()) { _fieldLabel->foreground(fg_); drawFieldLabel(); } } void MSCompositeField::labelFont(const char *font_) { labelFont(server()->fontID(font_)); } void MSCompositeField::labelFont(Font font_) { if (font_!=_fieldLabel->font()) { _fieldLabel->font(font_); if (dynamic()==MSTrue) computeSize(); else drawFieldLabel(); } } void MSCompositeField::label(const MSString& aString_) { if (_fieldLabel->label(aString_)==MSTrue) { _fieldLabel->naturalSize(); placement(); } else drawFieldLabel(); } void MSCompositeField::label(const char *pString_) { if (_fieldLabel->label(pString_)==MSTrue) { _fieldLabel->naturalSize(); placement(); } else drawFieldLabel(); } MSShadowStyle MSCompositeField::valueShadowStyle(void) const { return _fieldValue->shadowStyle(); } int MSCompositeField::valueShadowThickness(void) const { return _fieldValue->shadowThickness(); } void MSCompositeField::valueShadowStyle(MSShadowStyle style_) { if (style_!=valueShadowStyle()) { _fieldValue->shadowStyle(style_); drawFieldValue(); } } void MSCompositeField::valueShadowThickness(int sht_) { if (sht_!=valueShadowThickness()) { _fieldValue->shadowThickness(sht_); computeSize(); } } void MSCompositeField::valueBackground(const char *bg_) { valueBackground(server()->pixel(bg_)); } void MSCompositeField::valueBackground(unsigned long bg_) { if (bg_!=_fieldValue->background()) { _fieldValue->background(bg_); drawFieldValue(); } } void MSCompositeField::valueForeground(const char *fg_) { valueForeground(server()->pixel(fg_)); } void MSCompositeField::valueForeground(unsigned long fg_) { if (fg_!=_fieldValue->foreground()) { _fieldValue->foreground(fg_); drawFieldValue(); } } void MSCompositeField::valueFont(const char *font_) { valueFont(server()->fontID(font_)); } void MSCompositeField::valueFont(Font font_) { if (font_!=_fieldValue->font()) { _fieldValue->font(font_); XSetFont(display(),drawGC(),font_); if (dynamic()==MSTrue) computeSize(); else drawFieldValue(); } } void MSCompositeField::clipIndicatorForeground(const char *fg_) { clipIndicatorForeground(server()->pixel(fg_)); } void MSCompositeField::clipIndicatorForeground(unsigned long fg_) { if (_clipIndicatorForeground!=fg_) { _clipIndicatorForeground=fg_; drawFieldValue(); } } void MSCompositeField::editWidth(unsigned editWidth_) { if (editWidth()!=editWidth_) _editWidth=editWidth_; } void MSCompositeField::marginHeight(unsigned marginHeight_) { if (marginHeight()!=marginHeight_) { _marginHeight=marginHeight_; if (firstMap()==MSTrue||dynamic()==MSTrue) computeSize(); } } void MSCompositeField::valueWidth(unsigned valueWidth_) { if (valueWidth_!=valueWidth()) { _valueWidth=valueWidth_; if (firstMap()==MSTrue) adjustSize(); } } void MSCompositeField::labelSpacing(unsigned labelSpacing_) { if (labelSpacing_!=labelSpacing()) { _labelSpacing=labelSpacing_; if (firstMap()==MSTrue&&labelAlignment()==MSTop) adjustSize(); } } void MSCompositeField::updateFont(Font oldfid_) { MSComposite::updateFont(oldfid_); if(_fieldValue->font() == oldfid_) { _fieldValue->font(font()); XSetFont(display(),drawGC(),font()); } if(oldfid_ == _fieldLabel->font()) _fieldLabel->font(font()); if (dynamic()==MSTrue) computeSize(); else redraw(); } void MSCompositeField::updateBackground(unsigned long oldbg_) { MSComposite::updateBackground(oldbg_); if (_fieldValue->background()==oldbg_) _fieldValue->background(background()); _fieldLabel->background(background()); redraw(); } void MSCompositeField::updateForeground(unsigned long oldfg_) { MSComposite::updateForeground(oldfg_); if(_fieldValue->foreground()==oldfg_) _fieldValue->foreground(foreground()); if(_fieldLabel->foreground()==oldfg_) _fieldLabel->foreground(foreground()); if (clipIndicatorForeground()==oldfg_) _clipIndicatorForeground=foreground(); redraw(); } void MSCompositeField::updateSensitivity(void) { _fieldValue->sensitive(sensitive()); _fieldLabel->sensitive(sensitive()); if (sensitive()==MSTrue) XSetFillStyle(display(),drawGC(),FillSolid); else XSetFillStyle(display(),drawGC(),FillStippled); redraw(); } void MSCompositeField::focusIn(void) { highlight(); } void MSCompositeField::focusOut(void) { unHighlight(); } MSBoolean MSCompositeField::loseFocus(void) { unHighlight(); return MSTrue; } void MSCompositeField::set(MSAttrValueList& avList_) { MSComposite::set(avList_); MSIndexVector index; for (unsigned i=0;ifontName(labelFont()),MSAttrValue::Font); avList_<colorName(labelForeground()),MSAttrValue::Color); avList_<colorName(valueBackground()),MSAttrValue::Color); avList_<colorName(valueForeground()),MSAttrValue::Color); avList_<fontName(valueFont()),MSAttrValue::Font); avList_<colorName(clipIndicatorForeground()),MSAttrValue::Color); avList_<foreground(); } unsigned long MSCompositeField::valueBackground(void) const { return _fieldValue->background(); } unsigned long MSCompositeField::valueForeground(void) const { return _fieldValue->foreground(); } Font MSCompositeField::labelFont(void) const { return _fieldLabel->font(); } Font MSCompositeField::valueFont(void) const { return _fieldValue->font(); } const MSString& MSCompositeField::label(void) const { return _fieldLabel->label(); } unsigned MSCompositeField::valueWidth(void) const { return _valueWidth; } unsigned MSCompositeField::editWidth(void) const { return _editWidth; } unsigned MSCompositeField::marginHeight(void) const { return _marginHeight; } unsigned long MSCompositeField::clipIndicatorForeground(void) const { return _clipIndicatorForeground; } MSClipMode MSCompositeField::clipMode(void) const { return _clipMode;} void MSCompositeField::clipMode(MSClipMode clipMode_) { if(_clipMode!=clipMode_) { _clipMode=clipMode_; redraw(); } } aplus-fsf-4.22/src/MSGUI/MSCompositeFieldBox.C0000644000265000001440000001207010772770402014422 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include static const unsigned long MSCompositeFieldBoxEventMask=(ExposureMask); static const unsigned MSCompositeFieldBoxDefaultValueWidth=9; static const unsigned MSCompositeFieldBoxDefaultEditWidth=256; MSCompositeFieldBox::MSCompositeFieldBox(MSWidget *owner_,const char *title_) : MSLayout(owner_,title_) { init();} MSCompositeFieldBox::MSCompositeFieldBox(MSWidget *owner_,const MSStringVector& title_) : MSLayout(owner_,title_) { init();} void MSCompositeFieldBox::init(void) { _valueWidth=MSCompositeFieldBoxDefaultValueWidth; _editWidth=MSCompositeFieldBoxDefaultEditWidth; _orientation=MSLayoutManager::Vertical; shadowStyle(MSEtchedIn); selectInput(MSCompositeFieldBoxEventMask); } MSCompositeFieldBox::~MSCompositeFieldBox(void) {} MSCompositeField *MSCompositeFieldBox::field(const MSSymbol& tag_) { MSLayoutEntry *lentry; MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; MSCompositeField *cfield; while ((np=np->next())!=hp) { lentry=(MSLayoutEntry *)np->data(); cfield=(MSCompositeField *)lentry->widget(); if (cfield->tag()==tag_) return cfield; } return 0; } const MSCompositeField *MSCompositeFieldBox::field(const MSSymbol& tag_) const { MSLayoutEntry *lentry; MSNodeItem *hp=(MSNodeItem *)childListHead(); MSNodeItem *np=hp; MSCompositeField *cfield; while ((np=np->next())!=hp) { lentry=(MSLayoutEntry *)np->data(); cfield=(MSCompositeField *)lentry->widget(); if (cfield->tag()==tag_) return cfield; } return 0; } void MSCompositeFieldBox::placement(void) { MSLayout::placement(); if (mapped()==MSTrue) alignLabels(); } void MSCompositeFieldBox::firstMapNotify(void) { setPositions(); MSLayoutEntry *entry; MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; MSCompositeField *cfield; while ((np=np->next())!=hp) { entry=(MSLayoutEntry *)np->data(); cfield=(MSCompositeField *)entry->widget(); if (valueWidth()!=MSCompositeFieldBoxDefaultValueWidth) cfield->valueWidth(valueWidth()); cfield->naturalSize(); } alignLabels(); } void MSCompositeFieldBox::alignLabels(void) { MSLayoutEntry *entry; MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; MSCompositeField *cfield; unsigned lw,max; for (unsigned col=0;colnext())!=hp) { entry=(MSLayoutEntry *)np->data(); if (entry->mapped()==MSTrue&&entry->at().column()==col) { cfield=(MSCompositeField *)entry->widget(); lw=cfield->computeLabelPixelWidth(); max=(lw>max)?lw:max; } } np=hp; while ((np=np->next())!=hp) { entry=(MSLayoutEntry *)np->data(); if (entry->mapped()==MSTrue&&entry->at().column()==col) { cfield=(MSCompositeField *)entry->widget(); cfield->labelPixelWidth(max); } } } } // remove or add extra space to last row // override of MSLayoutManager function void MSCompositeFieldBox::extraRowSpace(int num_,MSLayoutVector *vec_,int size_) { if (num_>0) { int sum=0; for (unsigned i=0;i0) vec_[num_-1]._value+=diff; else if (diff<0) { diff=sum-size_; vec_[num_-1]._value-=diff; } } } void MSCompositeFieldBox::valueWidth(unsigned valueWidth_) { if (valueWidth()!=valueWidth_) { MSBoolean f=frozen(); freeze(); _valueWidth=valueWidth_; MSLayoutEntry *entry; MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; MSCompositeField *cfield; while ((np=np->next())!=hp) { entry=(MSLayoutEntry *)np->data(); cfield=(MSCompositeField *)entry->widget(); cfield->valueWidth(valueWidth()); } if (f==MSFalse) unfreeze(); } } void MSCompositeFieldBox::editWidth(unsigned editWidth_) { if (editWidth()!=editWidth_) { _editWidth=editWidth_; MSLayoutEntry *entry; MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; MSCompositeField *cfield; while ((np=np->next())!=hp) { entry=(MSLayoutEntry *)np->data(); cfield=(MSCompositeField *)entry->widget(); cfield->editWidth(editWidth()); } } } void MSCompositeFieldBox::set(MSAttrValueList& avList_) { MSLayout::set(avList_); MSIndexVector index; for (unsigned i=0;i #ifdef MS_NO_INLINES #include #endif MSCompositeText::MSCompositeText(MSWidget *owner_) : MSComposite(owner_) { _textGC=0; _backgroundGC=0; _textFontStruct=0; XGCValues values; values.foreground=foreground(); values.background=background(); values.font=font(); _textGC=XCreateGC(display(),window(),(GCForeground|GCBackground|GCFont),&values); _textFontStruct=(XFontStruct *)server()->fontStruct(font()); values.foreground=background(); _backgroundGC=XCreateGC(display(),window(),(GCForeground|GCBackground),&values); } MSCompositeText::~MSCompositeText(void) { if (textGC()!=0) XFreeGC(display(),_textGC); if (backgroundGC()!=0) XFreeGC(display(),_backgroundGC); _textFontStruct=0; } void MSCompositeText::updateFont(Font oldfid_) { MSComposite::updateFont(oldfid_); XSetFont(display(),textGC(),font()); _textFontStruct=(XFontStruct *)server()->fontStruct(font()); } void MSCompositeText::updateBackground(unsigned long oldbg_) { MSComposite::updateBackground(oldbg_); XSetBackground(display(),textGC(),background()); } void MSCompositeText::updateForeground(unsigned long oldfg_) { MSComposite::updateForeground(oldfg_); XSetForeground(display(),textGC(),foreground()); } aplus-fsf-4.22/src/MSGUI/MSDateEntryField.C0000644000265000001440000003047510772770402013717 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include static const unsigned MSDateEntryFieldDefaultValueWidth=10; static const unsigned int grabMask=(unsigned int)(ButtonPressMask|ButtonReleaseMask); MSDateEntryField::DateMonthView::DateMonthView(MSWidget *owner_) : MSMonthView(owner_) { arrowButtons(MSTrue); acceptFocus(MSFalse); } void MSDateEntryField::DateMonthView::activate(void) { MSString buffer; // We have to use Slash4 to guarantee that the date gets parsed correctly // Ideally we may want to set the date directly, but this is problematic as // it is possible for users to rely on the fact that validate is always called. dateField()->fieldEditor()->string(viewDate().format(buffer,MSDate::Slash4)); // dateField()->fieldEditor()->string(viewDate().format(buffer,dateField()->format())); dateShell()->activate(); } void MSDateEntryField::DateMonthView::escape(void) { dateShell()->escape(); } void MSDateEntryField::DateMonthView::nextMonth(void) { const MSDate & max = dateField()->maximumValue(); if(max.isSet() == MSTrue) { MSDate aDate = viewDate() + MSTerm(0, 1); if (aDate <= max) viewDate() = aDate; else { aDate.setFirstDayOfMonth(); if(aDate <= max) viewDate() = max; } } else MSMonthView::nextMonth(); } void MSDateEntryField::DateMonthView::prevMonth(void) { const MSDate & min = dateField()->minimumValue(); if(min.isSet() == MSTrue) { MSDate aDate = viewDate() - MSTerm(0, 1); if (aDate >= min) viewDate() = aDate; else { aDate.setLastDayOfMonth(); if(aDate >= min) viewDate() = min; } } else MSMonthView::prevMonth(); } void MSDateEntryField::DateMonthView::home(void) { if(dateField()->minimumValue().isSet() == MSTrue) viewDate(dateField()->minimumValue()); } void MSDateEntryField::DateMonthView::end(void) { if(dateField()->maximumValue().isSet() == MSTrue) viewDate(dateField()->maximumValue()); } void MSDateEntryField::DateMonthView::keyPress(const XEvent * ev, KeySym keysym_, unsigned int state_, const char* string_) { MSKeyPress keyPress(keysym_, state_); if(keyTranslate(keyPress)==MSFalse) MSMonthView::keyPress(ev, keysym_, state_, string_); } void MSDateEntryField::DateMonthView::buttonPress(const XEvent *pEvent_) { Window win = pEvent_->xbutton.subwindow; if(win == 0) { //test if we our on our own window or not. Window root, child; int ix =0, iy=0, rx=0, ry=0; unsigned keys; XQueryPointer(display(),dateShell()->window(),&root,&child,&rx,&ry,&ix,&iy,&keys); if(child == window()) MSMonthView::buttonPress(pEvent_); else escape(); } else if(win == _leftArrow->window()) buttonPressNotify(_leftArrow, pEvent_); else if(win == _rightArrow->window()) buttonPressNotify(_rightArrow, pEvent_); else MSMonthView::buttonPress(pEvent_); } void MSDateEntryField::DateMonthView::buttonRelease(const XEvent* pEvent_) { // just in case they are waiting for button Release but wont get since // we're grabbing pointer // this doesn't have any effect if arrows are inactive at the moment. if(_leftArrow != 0) buttonReleaseNotify(_leftArrow, pEvent_); if(_rightArrow != 0) buttonReleaseNotify(_rightArrow, pEvent_); } MSDateEntryField::DateShell::DateShell(MSDateEntryField *owner_) : MSWidget(owner_->server()) { _dateField = owner_; _monthView = 0; _bg=dateField()->background(); _fg=dateField()->foreground(); _fontID=dateField()->font(); XSetWindowAttributes attributes; attributes.background_pixel=background(); attributes.border_pixel=foreground(); attributes.override_redirect=(int)MSTrue; _window=(Window)XCreateWindow(display(), server()->root(), MSRect::x(),MSRect::y(),MSRect::width(),MSRect::height(), 1,(int)CopyFromParent,InputOutput,CopyFromParent, (unsigned long)(CWBackPixel|CWBorderPixel|CWOverrideRedirect), (XSetWindowAttributes *)&attributes); _eventMask=0; server()->widgetHashTable()->add(window(),this); _monthView=new DateMonthView(this); } MSDateEntryField::DateShell::~DateShell() { safeDestroy(_monthView);} void MSDateEntryField::DateShell::showAt(int x, int y) { moveTo(x, y); show(); } void MSDateEntryField::DateShell::show(void) { if (mapped()==MSFalse) { monthView()->show(); map(); XFlush(display()); raise(); grab(); } } void MSDateEntryField::DateShell::hide(void) { if (mapped()==MSTrue) { ungrab(); unmap(); monthView()->hide(); } } void MSDateEntryField::DateShell::grab(void) { server()->grabKeyboard(monthView()->window(),False,GrabModeAsync,GrabModeAsync,CurrentTime,MSTrue); server()->grabPointer(monthView()->window(),False, grabMask,GrabModeAsync,GrabModeAsync,None,None,CurrentTime,MSTrue); XFlush(display()); } void MSDateEntryField::DateShell::ungrab(void) { server()->ungrabPointer(monthView()->window(),CurrentTime); server()->ungrabKeyboard(monthView()->window(),CurrentTime); XFlush(display()); } void MSDateEntryField::DateShell::activate(void) { hide(); dateField()->monthViewActivate(); } void MSDateEntryField::DateShell::escape(void) { hide(); dateField()->monthViewEscape(); } void MSDateEntryField::DateShell::childConfigure(MSWidget *pWidget_) { resize(pWidget_->width(),pWidget_->height()); } void MSDateEntryField::DateShell::configure(void) { if (monthView()!=0) monthView()->resize(width(),height()); } MSDateEntryField::MSDateEntryField(MSWidget *owner_, const char *label_,const MSSymbol& tag_) : MSEntryFieldPlus(owner_,label_,tag_) { internalCouple(new MSDate(MSDate::today())); init(); } MSDateEntryField::MSDateEntryField(MSWidget *owner_,MSDate& model_, const char *label_,const MSSymbol& tag_) : MSEntryFieldPlus(owner_,label_,tag_) { model(model_); init(); } MSDateEntryField::~MSDateEntryField(void) { if(_dateShell != 0) safeDestroy(_dateShell); } void MSDateEntryField::init(void) { _minimumValue.unset(); _maximumValue.unset(); _format=MSFormat(MSDate::Slash4); _incrementValue=MSTerm(0,0,1); _dateShell = 0; _valueWidth=MSDateEntryFieldDefaultValueWidth; } void MSDateEntryField::monthDropDown(MSBoolean dropDown_) { buttonState(ComboButton, dropDown_); if(dropDown_ == MSTrue && dateShell() == 0) _dateShell = new DateShell(this); } void MSDateEntryField::model(MSDate& model_) { couple(&model_); } void MSDateEntryField::model(const MSDate& model_) { constCouple(&model_); } void MSDateEntryField::updateData(void) { if (MSView::model()==0) internalCouple(new MSDate(MSDate::today())); MSEntryFieldPlus::updateData(); } void MSDateEntryField::buttonActivate(void) { showMonthView(); } void MSDateEntryField::showMonthView(void) { drawComboButton(MSTrue); if(value().isSet()==MSFalse) monthView()->viewDate(MSDate::today()); else monthView()->viewDate(value()); clearEditor(); mapEditor(); MSString buffer; fieldEditor()->string(monthView()->viewDate().format(buffer,format())); fieldEditor()->selectAll(); //show outside screen to make it compute size. dateShell()->showAt(server()->width(), server()->height()); int x,y; rootXY(x,y); x+=buttonRect().x()-dateShell()->width(); if(x<0) x=0; y+=height(); if(y+dateShell()->height() >server()->height()) y -= height()+dateShell()->height(); dateShell()->showAt(x, y); } void MSDateEntryField::monthViewEscape(void) { drawComboButton(MSFalse); escape(); } void MSDateEntryField::monthViewActivate(void) { drawComboButton(MSFalse); activate(); } MSMonthView *MSDateEntryField::monthView(void) { return (dateShell()==0)?0:dateShell()->monthView(); } const MSMonthView *MSDateEntryField::monthView(void) const { return (dateShell()==0)?0:dateShell()->monthView(); } void MSDateEntryField::updateFont(Font oldfid_) { MSEntryFieldPlus::updateFont(oldfid_); if (monthView() != 0) monthView()->font(font()); } void MSDateEntryField::updateForeground(unsigned long oldFg_) { MSEntryFieldPlus::updateForeground(oldFg_); if (monthView() != 0) monthView()->foreground(foreground()); } void MSDateEntryField::updateBackground(unsigned long oldBg_) { MSEntryFieldPlus::updateBackground(oldBg_); if (monthView() != 0) monthView()->background(background()); } const char *MSDateEntryField::formatOutput(MSString &buffer_) { if (MSView::model()!=0) value().format(buffer_,format()); return buffer_.string(); } MSBoolean MSDateEntryField::validate(const char *pString_) { if (MSView::model()!=0) { MSDate aDate; if (aDate.set(pString_)==MSError::MSSuccess) { if (minimumValue().isSet()==MSTrue&&maximumValue().isSet()==MSTrue) { if (aDate>=minimumValue()&&aDate<=maximumValue()) { value()=aDate; return MSTrue; } } else if (minimumValue().isSet()==MSTrue) { if (aDate>=minimumValue()) { value()=aDate; return MSTrue; } } else if (maximumValue().isSet()==MSTrue) { if (aDate<=maximumValue()) { value()=aDate; return MSTrue; } } else { value()=aDate; return MSTrue; } } } return MSFalse; } void MSDateEntryField::increment(void) { if (MSView::model()!=0) { if (maximumValue().isSet()==MSTrue) { MSDate aDate=value(); aDate+=incrementValue(); if (aDate<=maximumValue()) { value()=aDate; valueChange(); } } else { value()+=incrementValue(); valueChange(); } } } void MSDateEntryField::decrement(void) { if (MSView::model()!=0) { if (minimumValue().isSet()==MSTrue) { MSDate aDate=value(); aDate-=incrementValue(); if (aDate>=minimumValue()) { value()=aDate; valueChange(); } } else { value()-=incrementValue(); valueChange(); } } } void MSDateEntryField::generateInputMask(void) { MSString mask; switch(format().dateFormat()) { case MSDate::Slash : mask = "--/--/--"; break; case MSDate::Slash4 : mask = "--/--/----"; break; case MSDate::EuropeanDot : mask = "--.--.--"; break; case MSDate::EuropeanDot4 : mask = "--.--.----"; break; default: mask = ""; break; } if(inputMaskCharacter()!='-' && mask != "") mask.change('-', inputMaskCharacter()); fieldEditor()->inputMask(mask); } void MSDateEntryField::set(MSAttrValueList& avList_) { MSEntryFieldPlus::set(avList_); MSIndexVector index; for (unsigned i=0;icolorName(comboArrowColor()), MSAttrValue::Color); avList_< #include const char * const MSDelimiterDefaultForeground="black"; const char * const MSDelimiterDefaultHighlightForeground="yellow"; const char * const MSDelimiterDefaultSelectionBackground="deepskyblue4"; const int MSDelimiterPadding=4; MSDelimiterList::MSDelimiterList(MSWidget *owner_,const char *title_) : MSList(owner_,title_) { init(); } MSDelimiterList::MSDelimiterList(MSWidget *owner_,const MSStringVector &title_) : MSList(owner_,title_) { init(); } MSDelimiterList::~MSDelimiterList(void) { if (stipple()!=0) delete stipple(); } void MSDelimiterList::init(void) { _stipple=0; _delimiterColor=server()->pixel(MSDelimiterDefaultForeground); _delimiterHighlightColor=server()->pixel(MSDelimiterDefaultHighlightForeground); _delimiterSelectionBackground=server()->pixel(MSDelimiterDefaultSelectionBackground); _delimiterTitleForeground=foreground(); _listEdit=MSTrue; _delimiterEdit=MSTrue; _delimiterSelection=MSTrue; _selectedDelimiter=-1; XGCValues values; values.foreground=delimiterSelectionBackground(); _segmentGC.setGCValues(server(),MSTrue,&values,GCForeground); values.foreground=delimiterColor(); _delimiterGC.setGCValues(server(),MSFalse,&values,GCForeground); values.foreground=delimiterHighlightColor()^background(); values.line_width=2; values.function=GXxor; values.subwindow_mode=IncludeInferiors; _trackGC.setGCValues(server(),MSTrue,&values, GCForeground|GCLineWidth|GCFunction|GCSubwindowMode); } void MSDelimiterList::calculateHeadingsHeight(void) { if (delimiterTitle().length()==0) _headingsHeight=rowHeight()/2+MSDelimiterPadding; else _headingsHeight=(int)(rowHeight()*1.5); } void MSDelimiterList::updateFont(Font oldfid_) { MSCompositeText::updateFont(oldfid_); _rowHeight=textHeight()+(2*rowSpacing()); calculateHeadingsHeight(); adjustNumVisible(); redrawImmediately(); } void MSDelimiterList::updateBackground(unsigned long oldbg_) { trackGC().foreground(delimiterHighlightColor()^background()); MSList::updateBackground(oldbg_); } void MSDelimiterList::redrawImmediately(void) { if (mapped()==MSTrue&&frozen()==MSFalse) { redrawPixmap()->lock(); XFillRectangle(display(),redrawPixmap()->pixmap(),backgroundShadowGC(), 0,0,panner()->width(),panner()->height()); drawRows(redrawPixmap()->pixmap(),firstRow(),firstRow()+rows()-1); int ht=panner()->highlightThickness(); MSRect aRect(ht,ht+headingsHeight(),panner()->width()-2*ht,panner()->height()-headingsHeight()-2*ht); drawBevel(redrawPixmap()->pixmap(),aRect,panner()->shadowStyle(),panner()->shadowThickness()); drawDelimiterHeaders(redrawPixmap()->pixmap()); XCopyArea(display(),redrawPixmap()->pixmap(),panner()->window(), backgroundShadowGC(), 0,0,panner()->width(),panner()->height(),0,0); moveSelection(selectedRow()); updateScrollBars(); XFlush(display()); redrawPixmap()->unlock(); } } void MSDelimiterList::drawDelimiters(Window window_) { int y0=headingsHeight()+panner()->shadowThickness(); int y1=panner()->height()-panner()->shadowThickness()-1; int start=firstColumn(); int end=lastColumn(); int widthOffset=panner()->shadowThickness()+panner()->highlightThickness()+columnSpacing(); for (unsigned i=0;i=start&&index<=end) { int x=widthOffset+charWidth()*(index-start+1); XDrawLine(display(),window_,delimiterGC().gc(),x,y0,x,y1); } } } void MSDelimiterList::drawDelimiters(Window window_,int row_) { int y0=computeYCoord(row_); int y1=(row_==lastRow()?y0+rowHeight():panner()->height()-panner()->shadowThickness()-1); int start=firstColumn(); int end=lastColumn(); int widthOffset=panner()->shadowThickness()+panner()->highlightThickness()+columnSpacing(); for (unsigned i=0;i=start&&index<=end) { int x=widthOffset+charWidth()*(index-start+1); XDrawLine(display(),window_,delimiterGC().gc(),x,y0,x,y1); } } } void MSDelimiterList::drawDelimiterHeaders(Window window_) { int start=firstColumn(); int end=lastColumn(); int widthOffset=panner()->shadowThickness()+panner()->highlightThickness()+columnSpacing(); int xx=widthOffset-(firstColumn()*charWidth()); int arrowHeight; if (delimiterTitle().length()!=0) { XSetForeground(display(),textGC(),delimiterTitleForeground()); XDrawString(display(),window_,textGC(),textFontStruct(),xx,headingsHeight()-rowSpacing()-textDescent(), delimiterTitle().string(),delimiterTitle().length()); arrowHeight=headingsHeight()-rowHeight(); } else arrowHeight=headingsHeight()-MSDelimiterPadding; XPoint points[3]; points[0].y=0; points[1].y=points[0].y; points[2].y=arrowHeight; int y0=arrowHeight; int y1=headingsHeight()-1; for (unsigned i=0;i=start&&index<=end) { int x=widthOffset+charWidth()*(index-start+1); points[0].x=x-charWidth()/2; points[1].x=points[0].x+charWidth(); points[2].x=x; if (delimiterEdit()==MSFalse) XSetFillStyle(display(),delimiterGC().gc(),FillStippled); XBFillPolygon(display(),window_,delimiterGC().gc(),points,3,Convex,CoordModeOrigin); if (delimiterEdit()==MSFalse) XSetFillStyle(display(),delimiterGC().gc(),FillSolid); XDrawLine(display(),window_,delimiterGC().gc(),x,y0,x,y1); } } } void MSDelimiterList::highlightDelimiter(int col_) { if (col_>=firstColumn()&&col_<=lastColumn()) { int arrowHeight; if (delimiterTitle().length()!=0) arrowHeight=headingsHeight()-rowHeight(); else arrowHeight=headingsHeight()-MSDelimiterPadding; XSegment segments[2]; int x=computeDelimiterXCoord(col_); segments[0].x1=x; segments[0].y1=arrowHeight; segments[0].x2=x; segments[0].y2=headingsHeight()-1; segments[1].x1=x; segments[1].y1=headingsHeight()+panner()->shadowThickness(); segments[1].x2=x; segments[1].y2=panner()->height()-panner()->shadowThickness(); delimiterGC().foreground(background()); XDrawSegments(display(),panner()->window(),delimiterGC().gc(),segments,2); XPoint points[3]; points[0].x=x-charWidth()/2; points[0].y=0; points[1].x=points[0].x+charWidth(); points[1].y=points[0].y; points[2].y=arrowHeight; points[2].x=x; delimiterGC().foreground(delimiterHighlightColor()); XFillPolygon(display(),panner()->window(),delimiterGC().gc(),points,3,Convex,CoordModeOrigin); delimiterGC().foreground(delimiterColor()); } } void MSDelimiterList::delimiterVector(const MSIndexVector &delimiterVector_,int selectedDelimiter_) { _delimiterVector=delimiterVector_; _delimiterVector.sortUp(); // Make sure none of the values of the new vector is out of bound int max=actualNumColumns(); for (unsigned i=0;i=max) { _delimiterVector.drop(i-delimiterVector().length()); break; } } if (selectedDelimiter_=firstRow()&&row_highlightThickness()+panner()->shadowThickness(); int xoff=offset+columnSpacing(); int yy=computeYCoord(row_)+rowSpacing(); int xx=xoff-(firstColumn()*charWidth()); int ww=panner()->width()-(offset*2); //First fill the background, the size of the rectangle is dependent on //whether the row is selected or not if (selected_==MSTrue) { int selectedRowHeight=rowHeight()-2*rowSpacing(); XSetForeground(display(),textGC(),bg_); XFillRectangle(display(),window_,textGC(),xoff,yy, ww-(columnSpacing()<<1),selectedRowHeight); } else { int y=yy-rowSpacing(); int h=rowHeight(); XSetForeground(display(),textGC(),bg_); XFillRectangle(display(),window_,textGC(),offset,y,ww,h); if (selectedDelimiter()!=-1) { int selected=delimiterVector()(selectedDelimiter()); if (selected>=firstColumn()) { int x,w; if (selectedDelimiter()==0) x=offset; else x=computeDelimiterXCoord(delimiterVector()(selectedDelimiter()-1)); x=(xww?ww:w); XFillRectangle(display(),window_,segmentGC().gc(),x,y,w,h); } } } //Draw the pixmap if it is there if (pmap_!=0) { int tHeight=textHeight(); int pHeight=pmap_->height(); int startx=xx; int starty=yy; if (tHeight>pHeight) starty+=((tHeight-pHeight)/2); else yy+=((pHeight-tHeight)/2); int pw=maxPixmapWidth(); //Optimization: if pixmap is completely offscreen, why draw it if (startx+pw>=xoff) { GC gc=pixmapGC(); XSetForeground(display(),gc,fg_); XSetBackground(display(),gc,bg_); int psx=xoff-startx; int psw=pw-psx; copyPixmap(display(),*pmap_,window_,gc,psx,0,psw,pmap_->height(), xoff,starty,startx,starty); } } xx+=(numPixmapColumns()*charWidth()); //Draw the string if (pString_!=0&&slen_>0) { XSetForeground(display(),textGC(),fg_); XSetFont(display(),textGC(),font_); const XFontStruct *fontStruct=(font_==font()? textFontStruct(): server()->fontStruct(font_)); drawString(display(),window_,textGC(),fontStruct, xx,yy+textAscent(),pString_,slen_); } if (selectOutline_==MSTrue) drawSelectOutline(window_,row_,highlighted()); else if (selected_==MSTrue) drawSelectOutline(window_,row_,MSFalse); } drawDelimiters(window_,row_); } void MSDelimiterList::headingAreaSelection(const XEvent *pEvent_) { if (pEvent_->xbutton.button==Button1) { delimiterButton1Event(pEvent_); } else if (pEvent_->xbutton.button==Button2) { delimiterButton2Event(pEvent_); } } void MSDelimiterList::dataAreaSelection(const XEvent *pEvent_) { if (listEdit()==MSTrue) MSList::dataAreaSelection(pEvent_); else server()->bell(); } void MSDelimiterList::dragDelimiter(const XEvent *pEvent_) { int startCol=columnFromEvent(pEvent_); if (delimiterVector().indexOf(startCol)!=delimiterVector().length()) { highlightDelimiter(startCol); int rootX,rootY; panner()->rootXY(rootX,rootY); int x=rootX+computeDelimiterXCoord(startCol); int y0,y1; if (delimiterTitle().length()!=0) y0=rootY+headingsHeight()-rowHeight(); else y0=rootY+headingsHeight()-MSDelimiterPadding; y1=rootY+panner()->height(); XDrawLine(display(),server()->root(),trackGC().gc(),x,y0,x,y1); MSBoolean lineDrawn=MSTrue; Window root,child; int rx,ry,ix,iy; unsigned keys; int col=startCol; int last=computeDelimiterXCoord(actualNumColumns()-1); int sameScreen=XQueryPointer(display(),panner()->window(),&root,&child,&rx,&ry,&ix,&iy,&keys); while (keys&Button1Mask||keys&Button2Mask) { int newCol=xToColumn(ix); if (!sameScreen||ix<0||ix>=panner()->width()||ix>last|| iy<-20||iy>=panner()->height()+20||newCol>lastColumn()) { if (lineDrawn==MSTrue) { XDrawLine(display(),server()->root(),trackGC().gc(),x,y0,x,y1); lineDrawn=MSFalse; col=-1; } } else { if (newCol!=col) { if (lineDrawn==MSTrue) XDrawLine(display(),server()->root(),trackGC().gc(),x,y0,x,y1); col=newCol; x=rootX+computeDelimiterXCoord(col); XDrawLine(display(),server()->root(),trackGC().gc(),x,y0,x,y1); lineDrawn=MSTrue; } } sameScreen=XQueryPointer(display(),panner()->window(),&root,&child,&rx,&ry,&ix,&iy,&keys); } if (lineDrawn==MSTrue) XDrawLine(display(),server()->root(),trackGC().gc(),x,y0,x,y1); if (col==-1) { unsigned index=delimiterVector().indexOf(startCol); if (index!=delimiterVector().length()) _delimiterVector.removeAt(index); if (selectedDelimiter()>=delimiterVector().length()) _selectedDelimiter=-1; delimiterChangeNotify(); } else if (col!=startCol) { unsigned index=delimiterVector().indexOf(startCol); if (index!=delimiterVector().length()) _delimiterVector.removeAt(index); if (delimiterVector().indexOf(col)==delimiterVector().length()) { _delimiterVector.append(col); _delimiterVector.sortUp(); } if (selectedDelimiter()>=delimiterVector().length()) _selectedDelimiter=-1; delimiterChangeNotify(); } redraw(); } } void MSDelimiterList::selectDelimiter(const XEvent *pEvent_) { int col=xToColumn(pEvent_->xbutton.x-panner()->x_origin()+charWidth()/2); for (int i=0;ishadowThickness()+panner()->highlightThickness()+columnSpacing(); return widthOffset+(col_-firstColumn()+1)*charWidth(); } void MSDelimiterList::addDelimiter(int col_) { if (delimiterVector().indexOf(col_)==delimiterVector().length()) { _delimiterVector.append(col_); _delimiterVector.sortUp(); delimiterChangeNotify(); } } void MSDelimiterList::removeDelimiter(int col_) { unsigned index=delimiterVector().indexOf(col_); if (index!=delimiterVector().length()) { _delimiterVector.removeAt(index); if (selectedDelimiter()>=delimiterVector().length()) _selectedDelimiter=-1; delimiterChangeNotify(); } } int MSDelimiterList::xToColumn(int x_) { int col; x_-=(charWidth()/2); if (x_<0) col=0; else col=(x_-panner()->shadowThickness()-panner()->highlightThickness()- columnSpacing())/charWidth()+firstColumn(); int max=actualNumColumns(); return((col>=max)?max-1:col); } void MSDelimiterList::delimiterTitle(const MSString &delimiterTitle_) { _delimiterTitle=delimiterTitle_; calculateHeadingsHeight(); redraw(); } void MSDelimiterList::delimiterColor(const char *color_) { delimiterColor(server()->pixel(color_)); } void MSDelimiterList::delimiterColor(unsigned long delimiterColor_) { if (_delimiterColor!=delimiterColor_) { _delimiterColor=delimiterColor_; delimiterGC().foreground(delimiterColor()); redraw(); } } void MSDelimiterList::delimiterHighlightColor(const char *color_) { delimiterHighlightColor(server()->pixel(color_)); } void MSDelimiterList::delimiterHighlightColor(unsigned long delimiterHighlightColor_) { if (_delimiterHighlightColor!=delimiterHighlightColor_) { _delimiterHighlightColor=delimiterHighlightColor_; delimiterGC().foreground(delimiterHighlightColor()^background()); } } void MSDelimiterList::delimiterSelectionBackground(const char *color_) { delimiterSelectionBackground(server()->pixel(color_)); } void MSDelimiterList::delimiterSelectionBackground(unsigned long delimiterSelectionBackground_) { if (_delimiterSelectionBackground!=delimiterSelectionBackground_) { _delimiterSelectionBackground=delimiterSelectionBackground_; segmentGC().foreground(delimiterSelectionBackground()); redraw(); } } void MSDelimiterList::delimiterTitleForeground(const char *color_) { delimiterTitleForeground(server()->pixel(color_)); } void MSDelimiterList::delimiterTitleForeground(unsigned long delimiterTitleForeground_) { if (_delimiterTitleForeground!=delimiterTitleForeground_) { _delimiterTitleForeground=delimiterTitleForeground_; if (delimiterTitle().length()>0) redraw(); } } void MSDelimiterList::delimiterEdit(MSBoolean delimiterEdit_) { if (_delimiterEdit!=delimiterEdit_) { _delimiterEdit=delimiterEdit_; if (delimiterEdit()==MSFalse) { if (stipple()==0) { _stipple=new MSPixmap(server(),MSPixmap::ForegroundFiftyPixmap,1,0,1); delimiterGC().stipple(stipple()->pixmap()); } } redraw(); } } void MSDelimiterList::delimiterChangeNotify(void) { activateCallback(MSWidgetCallback::delimiterchange); } void MSDelimiterList::delimiterSelectionNotify(void) { activateCallback(MSWidgetCallback::delimiterselection); } void MSDelimiterList::updateData(void) { _delimiterVector.removeAll(); _selectedDelimiter=-1; MSList::updateData(); } void MSDelimiterList::delimiterButton1Event(const XEvent *pEvent_) { if (delimiterEdit()==MSTrue) { int col=columnFromEvent(pEvent_); unsigned index=delimiterVector().indexOf(col); if (index==delimiterVector().length()) { addDelimiter(col); redraw(); } else if (isDoubleClick(pEvent_)==MSTrue) { removeDelimiter(col); redraw(); } else dragDelimiter(pEvent_); } else server()->bell(); } void MSDelimiterList::delimiterButton2Event(const XEvent *pEvent_) { if (delimiterSelection()==MSTrue) { if (delimiterEdit()==MSFalse&&delimiterVector().length()==0) server()->bell(); else selectDelimiter(pEvent_); } else server()->bell(); } void MSDelimiterList::set(MSAttrValueList& avList_) { MSList::set(avList_); MSIndexVector index; for(int i=0;icolorName(delimiterColor()),MSAttrValue::Color); avList_<colorName(delimiterHighlightColor()),MSAttrValue::Color); avList_<colorName(delimiterSelectionBackground()),MSAttrValue::Color); avList_<colorName(delimiterTitleForeground()),MSAttrValue::Color); avList_< #include #include #include MSHashTable *MSDisplayCursor::_pCursorHashTable=0; #ifdef MS_MULTI_THREAD MSMutex MSDisplayCursor::_cursorHashTableMutex; #endif class MSDisplayCursorData { friend class MSDisplayCursor; private: unsigned _referenceCount; Cursor _cursor; int _width; int _height; int _depth; unsigned long _fg; unsigned long _bg; unsigned int _shape; MSDisplayServer *_pServer; char *_pName; public: MSDisplayCursorData(void); MSDisplayCursorData(MSDisplayServer *,const char *,Cursor,int,int,int, unsigned long,unsigned long,unsigned int); ~MSDisplayCursorData(void); void addReference(void); void removeReference(void); unsigned referenceCount(void) const {return _referenceCount;} MSDisplayServer *server(void) const {return _pServer;} const char *name(void) const {return _pName;} Cursor cursor(void) const {return _cursor;} int width(void) const {return _width;} int height(void) const {return _height;} int depth(void) const {return _depth;} unsigned long fg(void) const {return _fg;} unsigned long bg(void) const {return _bg;} unsigned int shape(void) const {return _shape;} }; MSDisplayCursorData::MSDisplayCursorData(void) : _referenceCount(0), _pServer(0), _pName(0), _height(0), _width(0), _shape(0), _depth(0), _cursor(0), _fg(0), _bg(0) { } MSDisplayCursorData::MSDisplayCursorData(MSDisplayServer *pServer_,const char *pName_, Cursor cursor_,int width_,int height_, int depth_,unsigned long fg_,unsigned long bg_, unsigned int shape_) : _referenceCount(0), _pServer(pServer_), _pName(0), _height(height_), _width(width_), _shape(shape_), _depth(depth_), _cursor(cursor_), _fg(fg_), _bg(bg_) { if (pName_!=0) { unsigned len=strlen(pName_); _pName=new char[len+1]; memcpy(_pName,pName_,len); _pName[len]='\0'; } } MSDisplayCursorData::~MSDisplayCursorData(void) { if (_pName!=0) delete [] _pName; } void MSDisplayCursorData::addReference(void) { _referenceCount++; } void MSDisplayCursorData::removeReference(void) { if (--_referenceCount==0) delete this; } MSDisplayCursor:: MSDisplayCursor(MSDisplayServer *pServer_,unsigned int shape_,unsigned long fg_,unsigned long bg_) { create(pServer_,shape_,fg_,bg_); } MSDisplayCursor:: MSDisplayCursor(MSDisplayServer *pServer_,unsigned int shape_,const char *fg_,const char *bg_) { create(pServer_,shape_,pServer_->pixel(fg_),pServer_->pixel(bg_)); } MSDisplayCursor::~MSDisplayCursor(void) { MSGUARD(_cursorHashTableMutex); if (_pData->referenceCount()==1) { XFreeCursor(display(),cursor()); _pCursorHashTable->remove((char *)name()); } _pData->removeReference(); _pData=0; } MSDisplayCursor::MSDisplayCursor(const MSDisplayCursor& aDisplayCursor_) { MSGUARD(_cursorHashTableMutex); _pData=aDisplayCursor_._pData; _pData->addReference(); } MSDisplayCursor& MSDisplayCursor::operator=(const MSDisplayCursor& aDisplayCursor_) { if (&aDisplayCursor_!=this) { MSGUARD(_cursorHashTableMutex); MSDisplayCursorData *pData=_pData; _pData=aDisplayCursor_._pData; _pData->addReference(); pData->removeReference(); } return *this; } void MSDisplayCursor:: create(MSDisplayServer *pServer_,unsigned int shape_,unsigned long fg_,unsigned long bg_) { MSGUARD(_cursorHashTableMutex); if (_pCursorHashTable==0) _pCursorHashTable=new MSHashTable(64); static char buf[128]; sprintf(buf,"%d_%d_%d_%d",shape_,fg_,bg_,pServer_->display()); if ((unsigned long)(_pData=(MSDisplayCursorData *)_pCursorHashTable->lookup(buf))==_pCursorHashTable->notFound()) { create(pServer_,buf,shape_,fg_,bg_); } _pData->addReference(); } void MSDisplayCursor:: create(MSDisplayServer *pServer_,const char *pName_,unsigned int shape_,unsigned long fg_,unsigned long bg_) { Cursor c=XCreateFontCursor(pServer_->display(),shape_); _pData=new MSDisplayCursorData(pServer_,pName_,c,16,16,1,fg_,bg_,shape_); _pCursorHashTable->add(pName_,(void *)_pData); XColor fgColor,bgColor,screenColor; XLookupColor(pServer_->display(),pServer_->colormap(),pServer_->colorName(fg_),&fgColor,&screenColor); XLookupColor(pServer_->display(),pServer_->colormap(),pServer_->colorName(bg_),&bgColor,&screenColor); XRecolorCursor(pServer_->display(),cursor(),&fgColor,&bgColor); } MSDisplayServer *MSDisplayCursor::server(void) const {return _pData->_pServer;} Display *MSDisplayCursor::display(void) const {return _pData->_pServer->display();} int MSDisplayCursor::width(void) const {return _pData->_width;} int MSDisplayCursor::height(void) const {return _pData->_height;} int MSDisplayCursor::depth(void) const {return _pData->_depth;} unsigned int MSDisplayCursor::shape(void) const {return _pData->_shape;} unsigned long MSDisplayCursor::foreground(void) const {return _pData->_fg;} unsigned long MSDisplayCursor::background(void) const {return _pData->_bg;} Cursor MSDisplayCursor::cursor(void) const {return _pData->_cursor;} const char *MSDisplayCursor::name(void) const {return _pData->_pName;} aplus-fsf-4.22/src/MSGUI/MSDisplayPrint.C0000644000265000001440000006574010772770402013501 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #if HAVE_IOMANIP #include #else #include #endif extern const double PSFactor; extern const int MSPageSizeXTable[]; extern const int MSPageSizeYTable[]; extern MSString applicationVersionString(void); static const char *DefaultFilename="print.ps"; MSDisplayPrint::MSDisplayPrint(void) { _special=MSFalse; _defaultFontID=0; fileName(DefaultFilename); init(); } void MSDisplayPrint::init(void) { _owner =0; _clipCount =0; _activeClip =0; _activeDash =0; _updateDash =MSFalse; MSPostScript::init(); } MSDisplayPrint::~MSDisplayPrint(void) { deleteAllClipGC(); deleteAllDashGC(); } void MSDisplayPrint::originInc(MSWidget *widget_) { x_org(x_org()+widget_->x_origin()); y_org(y_org()+widget_->y_origin()); if (outputMode()!=PPM) setClipWindow(widget_->width(),widget_->height()); } void MSDisplayPrint::originDec(MSWidget *widget_) { x_org(x_org()-widget_->x_origin()); y_org(y_org()-widget_->y_origin()); if (outputMode()!=PPM) unsetClipWindow(); } void MSDisplayPrint::printInit(MSWidget *owner_) { _owner=owner_; whitePixel(owner()->server()->pixel("white")); blackPixel(owner()->server()->pixel("black")); if (defaultFontID()==0) defaultFont(owner()->server()->fontID(defaultFontString().string())); x_org(0); y_org(0); } void MSDisplayPrint::printClear(void) { if (activeClip()!=0) unsetClip(); deleteAllClipGC(); deleteAllDashGC(); init(); } MSBoolean MSDisplayPrint::printOpen(MSWidget *owner_) { MSBoolean status; printInit(owner_); if ((status=MSPostScript::printOpen())==MSTrue) { if (outputMode()==PPM) { _ppmPixmap=new MSPixmap(owner()->server(),"MSGeneral",owner()->width(), owner()->height(),BlackPixelOfScreen(owner()->screen()), WhitePixelOfScreen(owner()->screen())); } else { if (disclaimer().style()>NoDisclaimer) disclaimer().computeSize(); computePrintScale(); printProlog(); printSetup(); printScale(); } } return status; } MSBoolean MSDisplayPrint::printOpen(void) {return MSPostScript::printOpen();} MSBoolean MSDisplayPrint::printClose(void) { MSBoolean status=MSTrue; if (outputMode()==PPM) { printPixmap(); pout.close(); } else { printClear(); status=MSPostScript::printClose(); } return status; } void MSDisplayPrint::printPixmap(void) { if (outputMode()==PPM&&_ppmPixmap!=0) { struct tm *tp; struct timeval tv; struct passwd *pwd; gettimeofday(&tv,NULL); const time_t *tmp=(const time_t*)&tv.tv_sec; #if defined(MS_THREAD_SAFE_FUNCTIONS) //see comment in MSDefines.H on mt-safe system function usage. struct tm tmStruct; struct passwd pwdStruct; char charBuf[1024]; #endif tp=MS_LOCALTIME(tmp,&tmStruct); int k=0,count=0; int MaxBufSize=(int)XMaxRequestSize(owner()->display()); int bytes=4; int headerSize=8; int sizePerColor=16; MaxBufSize=(MaxBufSize*bytes-headerSize)/sizePerColor; XImage *image=XGetImage(owner()->display(),ppmPixmap(),0,0,owner()->width(), owner()->height(),AllPlanes,ZPixmap); int n=image->width*image->height; int bufSize=n>MaxBufSize?MaxBufSize:n; XColor *rgb=new XColor[bufSize]; pout<<"P3"<pw_name:""); #endif pout<<" - "<<"MStk Release "<width<<" "<height<height;y++) for (int x=0;xwidth;x++) { rgb[k++].pixel=XGetPixel(image,x,y); if (k>=bufSize) { XFlush(owner()->display()); XQueryColors(owner()->display(),owner()->server()->colormap(),rgb,k); for (unsigned i=0;i>8); pout<< " "; pout<>8); pout<<" "; pout<>8); } k=0; } } if (k>0) { XQueryColors(owner()->display(),owner()->server()->colormap(),rgb,k); for (unsigned i=0;i>8); pout<< " "; pout<>8); pout<<" "; pout<>8); } } pout<width(),owner()->height()); } void MSDisplayPrint::computePrintScale(void) { double x_range; double y_range; int x_trans; int y_trans; int psHeight,psWidth; int pagesize=pageSize()-Letter; int margin; int disOffset=disclaimer().height()+disclaimer().topPixel()+disclaimer().bottomPixel(); PageOrientation orient=disclaimer().orientation()==1?pageOrientation():disclaimer().orientation(); x_range=MSPageSizeXTable[pagesize]-leftPixel()-rightPixel(); y_range=MSPageSizeYTable[pagesize]-topPixel()-bottomPixel(); x_printScale(PSFactor); y_printScale(PSFactor); psWidth=(int)(PSFactor*owner()->width()); psHeight=(int)(PSFactor*owner()->height()); if (pageOrientation()==Landscape) { x_trans=(int)((MSPageSizeXTable[pagesize]+psHeight)/2); y_trans=(int)((MSPageSizeYTable[pagesize]-psWidth)/2); } else { x_trans=(MSPageSizeXTable[pagesize]-psWidth)/2; y_trans=(MSPageSizeYTable[pagesize]-psHeight)/2; } if (outputMode()==EPS) { if (pageOrientation()==Landscape) { bwidth(owner()->height()); bheight(owner()->width()); x_translate(bwidth()); } else { bheight(owner()->height()); bwidth(owner()->width()); x_translate(0); } y_translate(0); disclaimer().height(0); } else { if (pageLayout()&MSLeft) { if (pageOrientation()==Landscape) { if (disOffset>0&&orient==Portrait) y_trans=disOffset; else y_trans=leftPixel(); x_trans=(int)((MSPageSizeXTable[pagesize]+psHeight)/2); } else x_trans=leftPixel(); } if (MSRight&pageLayout()) { if (pageOrientation()==Landscape) { y_trans=MSPageSizeYTable[pagesize]-rightPixel()-psWidth; x_trans=(int)((MSPageSizeXTable[pagesize]+psHeight)/2); } else x_trans=MSPageSizeXTable[pagesize]-rightPixel()-psWidth; } if (MSTop&pageLayout()) { if (pageOrientation()==Landscape) { x_trans=topPixel()+psHeight; } else y_trans=MSPageSizeYTable[pagesize]-topPixel()-psHeight; } if (MSBottom&pageLayout()) { if (pageOrientation()==Landscape) { if (disOffset>0&&orient==Landscape) margin=disOffset; else margin=bottomPixel(); x_trans=MSPageSizeXTable[pagesize]-margin; } else y_trans=bottomPixel(); } if (pageLayout()==0) { y_trans=bottomPixel(); if (pageOrientation()==Landscape) { x_printScale(x_range/owner()->height()); y_printScale(y_range/owner()->width()); x_trans=MSPageSizeXTable[pagesize]-bottomPixel(); } else { x_printScale(x_range/owner()->width()); y_printScale(y_range/owner()->height()); x_trans=bottomPixel(); } } } if (pageOrientation()==Landscape) { if (disOffset>0&&orient==Landscape) { margin=disOffset; x_range=MSPageSizeXTable[pagesize]-leftPixel()-margin; } else margin=bottomPixel(); if (x_transMSPageSizeXTable[pagesize]-margin) { x_trans=psHeightheight()); } if (disOffset>0&&orient==Portrait) { margin=disOffset; y_range=MSPageSizeYTable[pagesize]-topPixel()-margin; } else margin=leftPixel(); if (y_transMSPageSizeYTable[pagesize]-rightPixel()) { y_printScale(y_range/owner()->width()); y_trans=margin; } } else { if (x_transMSPageSizeXTable[pagesize]-rightPixel()) { x_trans=leftPixel(); x_printScale(x_range/owner()->width()); } if (disOffset>0&&orient==Portrait) { margin=disOffset; y_range=MSPageSizeYTable[pagesize]-topPixel()-margin; } else margin=bottomPixel(); if (y_transMSPageSizeYTable[pagesize]-topPixel()) { { y_printScale(y_range/owner()->height()); y_trans=margin; } } } if (outputMode()!=EPS) { x_translate(x_trans); y_translate(y_trans); } } void MSDisplayPrint::updateForeground(int) { if (fgColor()!=gcValues().foreground) { fgRGB().pixel=gcValues().foreground; XQueryColor(owner()->display(),owner()->server()->colormap(),&fgRGB()); fgColor(gcValues().foreground); bgColor(0); } } void MSDisplayPrint::updateBackground(void) { if (bgColor()==0||bgColor()!=gcValues().background) { bgRGB().pixel=gcValues().background; XQueryColor(owner()->display(),owner()->server()->colormap(),&bgRGB()); bgColor(gcValues().background); fgColor(0); } } Font MSDisplayPrint::defaultFont(void) const { return defaultFontID()==0?(owner()==0?MSDisplayServer::defaultDisplayServer()->fontID(fontString()): owner()->server()->fontID(fontString())):defaultFontID(); } void MSDisplayPrint::defaultFont(Font font_) { const char *tempStr,*fontStr; MSDisplayServer *printServer=owner()==0?MSDisplayServer::defaultDisplayServer():owner()->server(); if (font_!=_defaultFontID) { tempStr=formatFontString(printServer->fontName(font_)); if (tempStr!=0) { fontStr=(char *)fontHashTable()->lookup(tempStr); if (fontStr!=0) { defaultFontName(fontStr); defaultFontID(font_); } else { MSMessageLog::errorMessage("Error: invalid default font selected-using %s\n",defaultFontString().string()); } } } } void MSDisplayPrint::updateFont(void) { const char *tempStr,*fontStr; if (gcValues().font!=0) { tempStr=formatFontString(owner()->server()->fontName(gcValues().font)); if (tempStr!=0) { fontStr=(char *)fontHashTable()->lookup(tempStr); if (fontStr!=0) { fontString(fontStr); fontID(gcValues().font); } else { fontString((char*)defaultFontString().string()); fontID(owner()->server()->fontID(defaultFontString().string())); } _fontInfo=(XFontStruct *)_owner->server()->fontStruct(fontID()); } else _fontInfo=(XFontStruct *)_owner->server()->fontStruct(defaultFontID()); } } void MSDisplayPrint::setAttributes(void) { MSBoolean update=MSFalse; if (setForeground()==MSTrue) update=MSTrue; if (setLineAttributes()==MSTrue) update=MSTrue; if (update==MSTrue) pout<2)?lineWidth()-1:lineWidth()); pout<< " "; pout<< "w"; pout<< " "; status=MSTrue; } if (lineStyle()!=gcValues().line_style||updateDash()==MSTrue) { dashOffset(gcValues().dash_offset); switch (gcValues().line_style) { case LineOnOffDash: case LineDoubleDash: if (updateDash()==MSTrue&&activeDash()!=0) { pout<<"[ "; for (int i=0; idashCt(); i++) pout<dash(i)<<" "; pout<<"]"; pout<<" "; pout<height()-y_org()-y_,w_,h_,angle1_,angle2_,gcValues().arc_mode,Stroke); } void MSDisplayPrint::printArcs(GC gc_,XArc *arcs_,int n_) { updateGC(gc_); setAttributes(); for (int i=0; iheight()-y_org()-(int)arcs_[i].y,(int)arcs_[i].width, (int)arcs_[i].height,(int)arcs_[i].angle1,(int)arcs_[i].angle2,gcValues().arc_mode,Stroke); } } void MSDisplayPrint::printLine(GC gc_,int x1_,int y1_,int x2_,int y2_) { updateGC(gc_); setAttributes(); printLine(x_org()+x1_,owner()->height()-y_org()-y1_,x_org()+x2_,owner()->height()-y_org()-y2_); } void MSDisplayPrint::printLines(GC gc_,XPoint *point_,int n_,int mode_) { int offset=6; if (n_<=0) return; updateGC(gc_); setAttributes(); if (mode_==CoordModeOrigin) { int count,j=n_-1; if (n_>offset+2) j=offset; pout<< x_org()+point_[j].x; pout<< " "; pout<< owner()->height()-y_org()-point_[j].y; pout<< " "; pout<< "M"; pout<< " "; for (int i=count=0;iheight()-y_org()-point_[i].y; pout<< " "; count++; if (i==j-1&&j!=n_-1) { pout<< count; pout<< " "; pout<< "DL "; pout<< " "; pout<< "st"; pout<< endl; j=(n_>j+offset+2)?j+offset:n_-1; pout<< x_org()+point_[j].x; pout<< " "; pout<< owner()->height()-y_org()-point_[j].y; pout<< " "; pout<< "M"; pout<< " "; if (gcValues().line_style==LineSolid) i--; count=0; } } pout<< count; pout<< " "; pout<< "DL"; pout<< " "; pout<< "st"; pout<< endl; } else { pout<< x_org()+point_[0].x; pout<< " "; pout<< owner()->height()-y_org()-point_[0].y; pout<< " "; pout<< "M"; pout<< " "; for (int i=n_-1;i>0;i--) { pout<< point_[i].x; pout<< " "; pout<< -point_[i].y; pout<< " "; } pout<< n_-1; pout<< " "; pout<< "D"; pout<< " "; pout<< "st"; pout<< endl; } } void MSDisplayPrint::printSegments(GC gc_,XSegment *segment_,int n_) { updateGC(gc_); setAttributes(); for (int i=0; iheight()-y_org()-segment_[i].y1, x_org()+segment_[i].x2,owner()->height()-y_org()-segment_[i].y2); } } void MSDisplayPrint::printPoint(GC gc_,int,int) { updateGC(gc_); } void MSDisplayPrint::printPoints(GC gc_,XPoint*,int,int) { updateGC(gc_); } void MSDisplayPrint::printRectangle(GC gc_,int x_,int y_,int w_,int h_) { updateGC(gc_); setAttributes(); printRectangle(x_org()+x_,owner()->height()-y_org()-y_,w_,h_); pout<< "st"; pout<< endl; } void MSDisplayPrint::printRectangles(GC gc_,XRectangle *rects_,int n_) { updateGC(gc_); setAttributes(); for (int i=0; iheight()-y_org()-(int)rects_[i].y, (int)rects_[i].width,(int)rects_[i].height); pout<< "st"; pout<< endl; } } void MSDisplayPrint::printString(GC gc_,int x_,int y_,const char *string_,int n_) { if (n_!=0) { updateGC(gc_); setForeground(); setFontAttributes(); printString(x_org()+x_,owner()->height()-y_org()-y_,string_,n_); } } void MSDisplayPrint::printImageString(GC gc_,int x_,int y_,const char *string_,int n_) { if (n_!=0) { updateGC(gc_); setFontAttributes(); if (printMode()==Colorfg) gcValues().background=whitePixel(); if (printMode()==Color||printMode()==Colorfg) setBackground(-1); else setBackground(); printRectangle(x_org()+x_,owner()->height()-y_org()-y_+fontInfo()->ascent,XTextWidth(fontInfo(),string_,n_), fontHeight() ); pout<< "f"; pout<< endl; setForeground(); pout<< endl; printString(x_org()+x_,owner()->height()-y_org()-y_,string_,n_); } } void MSDisplayPrint::printString(int x_,int y_,const char *string_,int n_) { MSString aString(string_,n_); aString.change("\\","\\\\").change("(","\\(").change(")","\\)").change("\n",""); if (aString.length()>0) { pout<< x_; pout<< " "; pout<< y_; pout<< " "; pout<< "M"; pout<< " "; pout<< XTextWidth(fontInfo(),string_,n_); pout<< " "; pout<< "("; pout<< aString; pout<< ")"; pout<< " "; pout<< "ST"; pout<< endl; } } void MSDisplayPrint::printFillArc(GC gc_,int x_,int y_,int w_,int h_,int angle1_,int angle2_) { updateGC(gc_); setBackground(printMode()!=Color?1:0); printArc(x_org()+x_,owner()->height()-y_org()-y_,w_,h_,angle1_,angle2_,gcValues().arc_mode,Fill); } void MSDisplayPrint::printFillArcs(GC gc_,XArc *arcs_,int n_) { updateGC(gc_); setBackground(printMode()!=Color?1:0); for (int i=0; iheight()-y_org()-(int)arcs_[i].y,(int)arcs_[i].width, (int)arcs_[i].height,(int)arcs_[i].angle1,(int)arcs_[i].angle2,gcValues().arc_mode,Fill); } } void MSDisplayPrint::printFillPolygon(GC gc_,XPoint *points_,int n_,int,int mode_,MSBoolean fill_) { /* * 1 *-------------------------------* 2 * | n-2 | * | *---------------------------* 3 * | | * | | * origin *---* n-1 * * xy deltas are pushed on stack from last point backwards to origin: * * origin(x,y) M delta(n-1,n-2)...delta(1,2),delta(origin-1) n-1 D P f * * where n=point count * */ if (n_>1) { int i,j,last_x,last_y; updateGC(gc_); if (printMode()==Colorfg&&fill_!=MSTrue) gcValues().foreground=whitePixel(); setBackground(printMode()!=Color&&fill_==MSTrue?1:0); j=(points_[n_-1].x==points_[0].x && points_[n_-1].y==points_[0].y)?2:1; last_x=(int)points_[n_-j].x; last_y=(int)points_[n_-j].y; pout<< "n"; pout<< " "; pout<< x_org()+(int)points_[0].x; pout<< " "; pout<< owner()->height()-y_org()-(int)points_[0].y; pout<< " "; pout<< "M"; pout<< " "; for (i=n_-j-1;i>-1;i--) { if (mode_==CoordModeOrigin) { pout<< last_x-(int)points_[i].x; pout<< " "; pout<< (int)points_[i].y-last_y; pout<< " "; last_x=(int)points_[i].x; last_y=(int)points_[i].y; } else { pout<< (int)points_[i+1].x; pout<< " "; pout<< -(int)points_[i+1].y; pout<< " "; } } pout<< n_-j; pout<< " "; pout<< "D"; pout<< " "; pout<< "P"; pout<< " "; pout<< "f"; pout<< endl; } } void MSDisplayPrint::printFillRectangle(GC gc_,int x_,int y_,int w_,int h_,MSBoolean fill_) { updateGC(gc_); if (printMode()==Colorfg&&fill_!=MSTrue) gcValues().foreground=whitePixel(); setBackground(printMode()!=Color&&fill_==MSTrue?1:0); printRectangle(x_org()+x_,owner()->height()-y_org()-y_,w_,h_); pout<< "f"; pout<< endl; } void MSDisplayPrint::printFillRectangles(GC gc_,XRectangle *rects_,int n_,MSBoolean fill_) { updateGC(gc_); if (printMode()==Colorfg&&fill_!=MSTrue) gcValues().foreground=whitePixel(); setBackground(printMode()!=Color&&fill_==MSTrue?1:0); for (int i=0; iheight()-y_org()-(int)rects_[i].y, (int)rects_[i].width,(int)rects_[i].height); pout<< "f"; pout<< endl; } } void MSDisplayPrint::printSetClipRectangles(GC gc_,int x_,int y_,XRectangle *rect_,int n_,int) { MSClipArea *clip=updateClipGC(gc_); clip->clipNumber(clipCount()); if (clip!=0) { for (int i=0; iheight()-y_org()-(y_+rect_[i].y),rect_[i].width,rect_[i].height); if (i==n_-1) { pout<< "}"; pout<< "def"; pout<< endl; } else pout<< endl; } } } void MSDisplayPrint::setClipWindow(int width_,int height_) { lineWidth(-1); lineStyle(-1); if (activeClip()!=0) unsetClip(); pout<< "gs"; pout<< " "; setClipRectangle(x_org(),owner()->height()-y_org(),width_,height_); pout<< endl; } void MSDisplayPrint::unsetClipWindow(void) { if (printMode()==Reverse) gscale(1); else gscale(0); pout<< "gr"; pout<< " "; pout<< "%unset clip window"; pout<< endl; pout<< gscale(); pout<< " "; pout<< "sg"; pout<< endl; fgColor(LONG_MAX); bgColor(LONG_MAX); fontID(0); } void MSDisplayPrint::printSetDashes(GC gc_,const char *dashList_,int n_) { MSNodeItem *hp=_dashGCListHead.address(); MSNodeItem *np=hp; MSDashLine *dash; while ((np=np->next())!=hp) { dash=(MSDashLine *)np->data(); if (dash->dashID()==gc_) { if (dash==activeDash()) activeDash(0); delete dash; delete np; np=hp; } } dash=new MSDashLine(gc_,dashList_,n_); np=new MSNodeItem((void *)dash); np->insert(hp->next()); } MSDashLine *MSDisplayPrint::findDashGC(GC gc_) { MSNodeItem *hp=_dashGCListHead.address(); MSNodeItem *np=hp; MSDashLine *temp,*dash=0; while ((np=np->next())!=hp) { temp=(MSDashLine *)np->data(); if (temp->dashID()==gc_) { dash=temp; break; } } return dash; } void MSDisplayPrint::deleteAllDashGC(void) { MSNodeItem *hp=_dashGCListHead.address(); MSNodeItem *np=hp; while ((np=np->next())!=hp) { MSDashLine *dash=(MSDashLine *)np->data(); if (dash!=0) delete dash; delete np; np=hp; } } void MSDisplayPrint::updateGC(GC gc_) { unsigned long mask; MSClipArea *clip; MSDashLine *dash; mask=GCLineWidth|GCLineStyle|GCForeground|GCBackground|GCFont| GCCapStyle|GCJoinStyle|GCFillStyle|GCFillRule|GCDashOffset|GCArcMode; XGetGCValues(owner()->display(),gc_,mask,&gcValues()); if ((dash=findDashGC(gc_))!=0) { if (dash!=activeDash()) activeDash(dash); else updateDash(MSFalse); } if ((clip=findClipGC(gc_))!=0) { if (clip!=activeClip()) { if (activeClip()!=0) unsetClip(); setClip(clip); lineWidth(-1); } } else if (activeClip()!=0) unsetClip(); } void MSDisplayPrint::unsetClip(void) { if (printMode()==Reverse) gscale(0); else gscale(1); pout<< "gr"; pout<< " "; pout<< "%clip"; pout<< activeClip()->clipNumber(); pout<< endl; pout<< gscale(); pout<< " "; pout<< "sg"; pout<< endl; fontID(0); activeClip(0); fgColor(LONG_MAX); bgColor(LONG_MAX); } void MSDisplayPrint::setClip(MSClipArea *clip_) { activeClip(clip_); pout<< "gs"; pout<< " "; pout<< "clip"; pout<< clip_->clipNumber(); pout<< endl; } MSClipArea *MSDisplayPrint::updateClipGC(GC gc_) { MSNodeItem *hp=_clipGCListHead.address(); MSNodeItem *np=hp; MSClipArea *clip; while ((np=np->next())!=hp) { clip=(MSClipArea *)np->data(); if (clip!=0&&clip->clipID()==gc_) { if (clip==activeClip()) unsetClip(); delete clip; delete np; np=hp; } } clip=new MSClipArea(gc_); np=new MSNodeItem((void *)clip); np->insert(hp->next()); _clipCount++; return clip; } MSClipArea *MSDisplayPrint::findClipGC(GC gc_) { MSNodeItem *hp=_clipGCListHead.address(); MSNodeItem *np=hp; MSClipArea *tempClip,*clip=0; while ((np=np->next())!=hp) { tempClip=(MSClipArea *)np->data(); if (tempClip->clipID()==gc_) { clip=tempClip; break; } } return clip; } void MSDisplayPrint::deleteAllClipGC(void) { MSNodeItem *hp=_clipGCListHead.address(); MSNodeItem *np=hp; while ((np=np->next())!=hp) { MSClipArea *clip=(MSClipArea *)np->data(); if (clip!=0) delete clip; delete np; np=hp; } } void MSDisplayPrint::printFreeGC(GC gc_) { MSNodeItem *hp=_clipGCListHead.address(); MSNodeItem *np=hp; while ((np=np->next())!=hp) { MSClipArea *clip=(MSClipArea *)np->data(); if (clip!=0&&clip->clipID()==gc_) { if (clip==activeClip()) unsetClip(); delete clip; delete np; np=hp; } } np=hp=_dashGCListHead.address(); while ((np=np->next())!=hp) { MSDashLine *dash=(MSDashLine *)np->data(); if (dash!=0&&dash->dashID()==gc_) { if (dash==activeDash()) activeDash(0); delete dash; delete np; np=hp; } } } void MSDisplayPrint::comment(const char *x_) { pout<<"% "< #include #include #include #include #include #include #include #include #include static const char *_XA_DT_WM_REQUEST ="_DT_WM_REQUEST"; static const char *_XA_MWM_INFO ="_MOTIF_WM_INFO"; static const char *_XA_DT_WORKSPACE_LIST ="_DT_WORKSPACE_LIST"; static const char *_XA_DT_WORKSPACE_CURRENT ="_DT_WORKSPACE_CURRENT"; static const char *_XA_DT_WORKSPACE_INFO ="_DT_WORKSPACE_INFO_"; static const int MSWidgetHashTableSize=2048; static const int MSShadowHashTableSize=64; static const int MSToolTipHashTableSize=128; static const int MSPropertyFullLength=8192; static const int numErrors=18; static const int numOpCodes=120; static const int XErrorBufSize=256; static const char *MSWidgetOutputDefaultHighlightColor="yellow"; MSDisplayServer *MSDisplayServer::_defaultDisplayServer=0; MSWorkspaceChangedFunction MSDisplayServer::_workspaceChangedFunction=0; static char *errorCodes[numErrors]= { "Success","BadRequest","BadValue","BadWindow","BadPixmap", "BadAtom","BadCursor","BadFont","BadMatch","BadDrawable", "BadAccess","BadAlloc","BadGC","BadIDChoice","BadName", "BadLength","BadImplementation" }; static char *opCodeNames[numOpCodes]= { "","CreateWindow","ChangeWindowAttributes","GetWindowAttributes", "DestroyWindow","DestroySubwindows","ChangeSaveSet","ReparentWindow", "MapWindow","MapSubwindows","UnmapWindow","UnmapSubwindows", "ConfigureWindow","CirculateWindow","GetGeometry","QueryTree", "InternAtom","GetAtomName","ChangeProperty","DeleteProperty", "GetProperty","ListProperties","SetSelectionOwner","GetSelectionOwner", "ConvertSelection","SendEvent","GrabPointer","UngrabPointer","GrabButton", "UngrabButton","ChangeActivePointerGrab","GrabKeyboard","UngrabKeyboard", "GrabKey","UngrabKey","AllowEvents","GrabServer","UngrabServer","QueryPointer", "GetMotionEvents","TranslateCoords","WarpPointer","SetInputFocus","GetInputFocus", "QueryKeymap","OpenFont","CloseFont","QueryFont","QueryTextExtents","ListFonts", "ListFontsWithInfo","SetFontPath","GetFontPath","CreatePixmap","FreePixmap", "CreateGC","ChangeGC","CopyGC","SetDashes","SetClipRectangles","FreeGC", "ClearArea","CopyArea","CopyPlane","PolyPoint","PolyLine","PolySegment","PolyRectangle", "PolyArc","FillPoly","PolyFillRectangle","PolyFillArc","PutImage","GetImage","PolyText8", "PolyText16","ImageText8","ImageText16","CreateColormap","FreeColormap", "CopyColormapAndFree","InstallColormap","UninstallColormap","ListInstalledColormaps", "AllocColor","AllocNamedColor","AllocColorCells","AllocColorPlanes","FreeColors", "StoreColors","StoreNamedColor","QueryColors","LookupColor","CreateCursor", "CreateGlyphCursor","FreeCursor","RecolorCursor","QueryBestSize","QueryExtension", "ListExtensions","ChangeKeyboardMapping","GetKeyboardMapping","ChangeKeyboardControl", "GetKeyboardControl","Bell","ChangePointerControl","GetPointerControl","SetScreenSaver", "GetScreenSaver","ChangeHosts","ListHosts","SetAccessControl","SetCloseDownMode", "KillClient","RotateProperties","ForceScreenSaver","SetPointerMapping", "GetPointerMapping","SetModifierMapping","GetModifierMapping" }; #ifdef MS_KEYPAD_BUG struct KeypadInfo { KeySym keysym; char* string; }; static KeypadInfo keypad_table[] = { { XK_KP_0, "0" }, { XK_KP_1, "1"}, { XK_KP_2, "2"}, { XK_KP_3, "3"}, { XK_KP_4, "4"}, { XK_KP_5, "5"}, { XK_KP_6, "6"}, { XK_KP_7, "7"}, { XK_KP_8, "8"}, { XK_KP_9, "9"}, { XK_KP_Decimal, "." }, { XK_KP_Equal ,"="}, { XK_KP_Multiply,"*"}, { XK_KP_Add, "+"}, { XK_KP_Separator, ""}, { XK_KP_Subtract, "-"}, { XK_KP_Divide, "/"}, { XK_KP_Enter, "" } }; static const int numKeypadKeys = 18; static const int keypadDualModeElements = 11; #endif #ifdef MS_NO_INLINES #include #endif extern MSGUIExport MSBoolean applicationAddServer(MSDisplayServer *); extern MSGUIExport MSBoolean applicationRemoveServer(MSDisplayServer *); extern MSGUIExport MSDisplayServer *applicationDisplayServer(Display *); extern MSGUIExport void applicationExit(void); class MSDisplayServerChannel : public MSChannel { protected: MSDisplayServer *_pServer; public: MSDisplayServerChannel(MSDisplayServer *); ~MSDisplayServerChannel(void); virtual void process(void); }; class KeyboardGrabber { public: Window _grabWindow; int _ownerEvents; int _pointerMode; int _keyboardMode; Time _time; KeyboardGrabber(Window grabWindow_,int ownerEvents_,int pointerMode_, int keyboardMode_,Time time_); }; KeyboardGrabber::KeyboardGrabber(Window grabWindow_,int ownerEvents_, int pointerMode_,int keyboardMode_,Time time_) : _grabWindow(grabWindow_), _ownerEvents(ownerEvents_), _pointerMode(pointerMode_), _keyboardMode(keyboardMode_), _time(time_) {} class PointerGrabber { public: Window _grabWindow; int _ownerEvents; unsigned int _eventMask; int _pointerMode; int _keyboardMode; Window _confineTo; Cursor _cursor; Time _time; PointerGrabber(Window grabWindow_,int ownerEvents_,unsigned int eventMask_,int pointerMode_, int keyboardMode_,Window confineTo_,Cursor cursor_,Time time_); }; PointerGrabber::PointerGrabber(Window grabWindow_,int ownerEvents_, unsigned int eventMask_,int pointerMode_, int keyboardMode_,Window confineTo_,Cursor cursor_,Time time_) : _grabWindow(grabWindow_), _ownerEvents(ownerEvents_), _eventMask(eventMask_), _pointerMode(pointerMode_), _keyboardMode(keyboardMode_), _confineTo(confineTo_), _cursor(cursor_), _time(time_) {} MSAtomTable::MSAtomTable(void) { _array=new Atom[MSAtomTable::LastAtom]; } MSAtomTable::~MSAtomTable(void) { delete [] _array; } void MSAtomTable::add(int index_,Atom atom_) { if (index_connection(),MSChannel::High,MSChannel::Read) { _pServer=pServer_; } MSDisplayServerChannel::~MSDisplayServerChannel(void) {} void MSDisplayServerChannel::process(void) { _pServer->service(); } int MSDisplayServer::ioErrorHandler(void) { fprintf(stderr, "XIO: fatal IO error on X server %s\n",DisplayString(_dpy)); fprintf(stderr, " after %d", NextRequest(_dpy)-1); fprintf(stderr, " requests %d", LastKnownRequestProcessed(_dpy)); fprintf(stderr, " known processed with %d", QLength(_dpy)); fprintf(stderr, " events remaining.\n"); fprintf(stderr, " The connection was probably broken by "); fprintf(stderr, "a server shutdown or KillClient.\n"); return (MSTrue)?exitOnError(),0:0; } int MSDisplayServer::errorHandler(const XErrorEvent *event_) { char *errorText=new char[XErrorBufSize+1]; XGetErrorText(_dpy,event_->error_code,errorText,XErrorBufSize); fprintf(stderr, "X Error on display: \t%s\n",_name.string()); fprintf(stderr, "Resource ID of failed request:\t%p\n",(void *)event_->resourceid); fprintf(stderr, errorText); delete [] errorText; fprintf(stderr, "Op Code: \t%d",(int)event_->request_code); fprintf(stderr, ".%d\n",(int)event_->minor_code); if (event_->request_code>0&&event_->request_coderequest_code]); } fprintf(stderr, "Error Code: \t%d\n",(int)event_->error_code); if (event_->error_code>0&&event_->error_codeerror_code]); } if ((int)event_->error_code==BadAlloc) { fprintf(stderr, "\nThe XServer does not have enough memory to accommodate this request."); exitOnError(); } return 0; } void MSDisplayServer::exitOnError(void) { fprintf(stderr, "Exiting Application ... "); fprintf(stderr, "from MSDisplayServer::exitOnError\n"); applicationExit(); } static int XIOErrHndlr(Display *dpy_) { MSDisplayServer *s=MSDisplayServer::serverOfDisplay(dpy_); if (s!=0) s->ioErrorHandler(); else { fprintf(stderr, "Fatal IO error on X connection: exiting in XIOErrHandlr\n"); MSDisplayServer::exitOnError(); } return 1; } static int XErrHndlr(Display *dpy_,XErrorEvent *event_) { MSDisplayServer *s=MSDisplayServer::serverOfDisplay(dpy_); return (s!=0)?s->errorHandler(event_):1; } // ############################################################################## // CDE WindowManager functionality // ############################################################################## class MWMWidget : public MSWidget { public: MWMWidget(MSDisplayServer*,Window); ~MWMWidget(void); Window _mwmWindow; Atom _workspaceCurrentAtom; Atom _workspaceListAtom; Atom _wmStateAtom; unsigned long _workspaceCount; MSStringVector _workspaceNames; Atom *_workspaceInfoAtoms; Atom *_workspaceAtoms; Atom _currentWorkspaceAtom; MSString _currentWorkspaceName; virtual void propertyNotify(const XEvent *); void updateWorkspaceList(void); void updateWorkspaceInfo(Atom workspaceInfoAtom_); void updateCurrentWorkspaceName(void); MSString getWorkspaceName(Atom workspaceAtom_) const; MSStringVector getWorkspaceNames(void); Atom getWorkspaceAtom(const MSString& workspaceName_) const; unsigned long numberOfWorkspaces(void) const {return _workspaceCount;} Atom currentWorkspaceAtom(void) const {return _currentWorkspaceAtom;} const MSString& currentWorkspaceName(void) const {return _currentWorkspaceName;} const MSStringVector& workspaceNames(void) const {return _workspaceNames;} MSString workspaceName(Atom) const; Atom workspaceAtom(const MSString&) const; }; // ############################################################################## // MSDisplayServer // ############################################################################## MSDisplayServer::MSDisplayServer(void) { _dpy=(Display *)XOpenDisplay((char *)0); if(_dpy==0) _name=getenv("DISPLAY"); else _name=DisplayString(_dpy); init(); } MSDisplayServer::MSDisplayServer(const char *dpyName_) : _name(dpyName_) { _dpy=(Display *)XOpenDisplay((char *)dpyName_); init(); } void MSDisplayServer::init(void) { if (_dpy==0) { fprintf(stderr, "Unable to connect to Server: "); fprintf(stderr, "%s\n",_name.string()); fprintf(stderr, "Check that your 'DISPLAY' environment variable is set correctly.\n"); fprintf(stderr, "Use the following UNIX command to set:\n"); fprintf(stderr, "\t1. Korn Shell (ksh): $export DISPLAY=hostname:0.x\n"); fprintf(stderr, "\t2. Command Shell (csh): $setenv DISPLAY \"hostname:0.x\"\n\n"); fprintf(stderr, "where x is the screen number (usually 0 or 1).\n\n"); fprintf(stderr, "If exporting DISPLAY, check that access to client machine X server is allowed\n"); fprintf(stderr, "Use xhost + to allow access from remote machine\n"); MSDisplayServer::exitOnError(); } else { (void)XSetIOErrorHandler(XIOErrHndlr); (void)XSetErrorHandler(XErrHndlr); _colorManager=0; _channel=0; _watchCursor=0; _shadowHashTable=new MSHashTable(MSShadowHashTableSize); _widgetHashTable=new MSHashTable(MSWidgetHashTableSize); _toolTipHashTable=new MSHashTable(MSToolTipHashTableSize); _toolTipHashTable->notFound((unsigned long) new MSStringVector("No Tip !")); _fontManager=new MSFontManager(*this); _colorManager=new MSColorManager(*this); _copyBuffer="Selection Cleared"; _pasteBuffer=""; _toolTip=0; _pMWMWidget=0; initAtoms(); if (_defaultDisplayServer==0) _defaultDisplayServer=this; // add to server to global application object applicationAddServer(this); _status=QueueOk; _channel=new MSDisplayServerChannel(this); _channel->enable(); _watchCursor=new MSDisplayCursor(this,XC_watch,pixel("black"),pixel("white")); _defaultFg=_colorManager->defaultFg(); _defaultBg=_colorManager->defaultBg(); _defaultFont=_fontManager->defaultFontID(); _keyboardGrabList=new MSUnsignedLongVector; _pointerGrabList=new MSUnsignedLongVector; _passiveGrabList=new MSWidgetVector; _keyboardGrabber=0; _pointerGrabber=0; _defaultValueBg =0; _defaultHighlightColor=pixel(MSWidgetOutputDefaultHighlightColor); _primarySelectionOwner=0; _menuGrabber=0; _menuBar=0; _menuGrabCursor=0; _scrollBarMenu=0; setWindowManager(); #ifdef MS_KEYPAD_BUG setKeypadCodes(); #endif } } #ifdef MS_KEYPAD_BUG void MSDisplayServer::setKeypadCodes(void) { _keypadKeycodes = new KeyCode[numKeypadKeys]; for (int i=0;imax_keypermod && found==MSFalse; k++) { if (modMap->modifiermap[j*modMap->max_keypermod+k] ==numLockKeycode) { numLockModifier = j; found = MSTrue; break; } } } _numLockModifier = (1<destroy(); if (_pMWMWidget!=0) delete _pMWMWidget; if (_toolTip!=0) delete _toolTip; if (_colorManager!=0) delete _colorManager; if (_fontManager!=0) delete _fontManager; if (_shadowHashTable!=0) delete _shadowHashTable; if (_widgetHashTable!=0) delete _widgetHashTable; if (_toolTipHashTable!=0) { MSStringVector *vector=(MSStringVector *)_toolTipHashTable->notFound(); delete vector; delete _toolTipHashTable; } if (_watchCursor!=0) delete _watchCursor; if (_menuGrabCursor!=0) delete _menuGrabCursor; if (_defaultDisplayServer==this) _defaultDisplayServer=0; if (_channel!=0) delete _channel; _channel=0; #ifdef MS_KEYPAD_BUG if (_keypadKeycodes!=0) delete[] _keypadKeycodes; #endif int i; MSUnsignedLongVector *pGrabList; pGrabList=(MSUnsignedLongVector *)_keyboardGrabList; for (i=0;ilength();i++) { KeyboardGrabber *pGrabber=(KeyboardGrabber *)((*pGrabList)(i)); delete pGrabber; } delete pGrabList; pGrabList=(MSUnsignedLongVector *)_pointerGrabList; for (i=0;ilength();i++) { PointerGrabber *pGrabber=(PointerGrabber *)((*pGrabList)(i)); delete pGrabber; } delete pGrabList; delete _passiveGrabList; XCloseDisplay(_dpy); // remove the server from the global application object applicationRemoveServer(this); _dpy=0; _colorManager=0; _fontManager=0; _watchCursor=0; _shadowHashTable=0; _widgetHashTable=0; _keyboardGrabList=0; _pointerGrabList=0; _passiveGrabList=0; } void MSDisplayServer::bell(void) { XBell(_dpy,0); } void MSDisplayServer::dispatch(void) { XSync(_dpy,False); (void)process(); } MSBoolean MSDisplayServer::flush(void) { return process(); } #ifdef MS_WINDOWS #include #endif void MSDisplayServer::dispatchEvent(XEvent& aEvent_) { if (aEvent_.xany.type==MappingNotify) { if (aEvent_.xmapping.request==MappingModifier|| aEvent_.xmapping.request==MappingKeyboard) { XRefreshKeyboardMapping(&(aEvent_.xmapping)); } } else { #ifdef MS_WINDOWS MSWidget *pWidget=MSApplication::findWidget(aEvent_.xany.window); #else MSWidget *pWidget=(MSWidget *)_widgetHashTable->lookup(aEvent_.xany.window); #endif if ((unsigned long)pWidget!=_widgetHashTable->notFound()) pWidget->event(&aEvent_); } } void MSDisplayServer::service(void) { if (XEventsQueued(_dpy,QueuedAfterReading)||(_status==NoQueueAfterSelect)) { _status=QueueOk; processXEvents(); } else // if connect is broken then XNextEvent will exit { XEvent aEvent; _status=NoQueueAfterSelect; XNextEvent(_dpy,&aEvent); dispatchEvent(aEvent); } } void MSDisplayServer::processOneEvent(void) { XEvent aEvent; XNextEvent(_dpy,&aEvent); dispatchEvent(aEvent); } void MSDisplayServer::processXEvents(void) { if (XEventsQueued(_dpy,QueuedAfterReading)>0) { XEvent aEvent; while (XQLength(_dpy)>0) { XNextEvent(_dpy,&aEvent); dispatchEvent(aEvent); } } } MSBoolean MSDisplayServer::flush(Display *dpy_) { return serverOfDisplay(dpy_)->process(); } // This flush and event processing loop end when the displays has been // examined without processing incoming events. d counts the // consecutive zero event calls. MSBoolean MSDisplayServer::process(void) { XEvent aEvent; MSBoolean didWork=MSFalse; int d=0; while (d!=1) { if (XEventsQueued(_dpy,QueuedAfterFlush)==0) { d=1; continue; } d=0; // bummer,we have to go around again while (XQLength(_dpy)>0) { didWork=MSTrue; XNextEvent(_dpy,&aEvent); dispatchEvent(aEvent); } } return didWork; } void MSDisplayServer::initAtoms(void) { Display *d=_dpy; _atomTable.add(MSAtomTable::WMState,XInternAtom(d,"WM_STATE",False)); _atomTable.add(MSAtomTable::WMDeleteWindow,XInternAtom(d,"WM_DELETE_WINDOW",False)); _atomTable.add(MSAtomTable::WMSaveYourself,XInternAtom(d,"WM_SAVE_YOURSELF",False)); _atomTable.add(MSAtomTable::WMProtocols,XInternAtom(d,"WM_PROTOCOLS",False)); _atomTable.add(MSAtomTable::MStk,XInternAtom(d,"MStk",False)); _atomTable.add(MSAtomTable::WinAttr,XInternAtom(d,"_OL_WIN_ATTR",False)); _atomTable.add(MSAtomTable::WTBase,XInternAtom(d,"_OL_WT_BASE",False)); _atomTable.add(MSAtomTable::WTNotice,XInternAtom(d,"_OL_WT_NOTICE",False)); _atomTable.add(MSAtomTable::WTCmd,XInternAtom(d,"_OL_WT_CMD",False)); _atomTable.add(MSAtomTable::WTOther,XInternAtom(d,"_OL_WT_OTHER",False)); _atomTable.add(MSAtomTable::PushpinState,XInternAtom(d,"_OL_PIN_STATE",False)); _atomTable.add(MSAtomTable::PinOut,XInternAtom(d,"_OL_PIN_OUT",False)); _atomTable.add(MSAtomTable::PinIn,XInternAtom(d,"_OL_PIN_IN",False)); _atomTable.add(MSAtomTable::WindowBusy,XInternAtom(d,"_OL_WIN_BUSY",False)); _atomTable.add(MSAtomTable::LeftFooter,XInternAtom(d,"_OL_WINMSG_ERROR",False)); _atomTable.add(MSAtomTable::RightFooter,XInternAtom(d,"_OL_WINMSG_STATE",False)); _atomTable.add(MSAtomTable::DecorResize,XInternAtom(d,"_OL_DECOR_RESIZE",False)); _atomTable.add(MSAtomTable::DecorPin,XInternAtom(d,"_OL_DECOR_PIN",False)); _atomTable.add(MSAtomTable::DecorFooter,XInternAtom(d,"_OL_DECOR_FOOTER",False)); _atomTable.add(MSAtomTable::DecorHeader,XInternAtom(d,"_OL_DECOR_HEADER",False)); _atomTable.add(MSAtomTable::DecorAdd,XInternAtom(d,"_OL_DECOR_ADD",False)); _atomTable.add(MSAtomTable::DecorDel,XInternAtom(d,"_OL_DECOR_DEL",False)); _atomTable.add(MSAtomTable::MenuFull,XInternAtom(d,"_OL_MENU_FULL",False)); _atomTable.add(MSAtomTable::MenuLimited,XInternAtom(d,"_OL_MENU_LIMITED",False)); _atomTable.add(MSAtomTable::Targets,XInternAtom(d,"TARGETS",False)); _atomTable.add(MSAtomTable::ClientWindow,XInternAtom(d,"CLIENT_WINDOW",False)); _atomTable.add(MSAtomTable::TimeStamp,XInternAtom(d,"TIMESTAMP",False)); _atomTable.add(MSAtomTable::Length,XInternAtom(d,"LENGTH",False)); _atomTable.add(MSAtomTable::CharacterPosition,XInternAtom(d,"CHARACTER_POSITION",False)); _atomTable.add(MSAtomTable::Span,XInternAtom(d,"SPAN",False)); } void MSDisplayServer::copyBuffer(const MSString& aString_) { _copyBuffer=aString_; } void MSDisplayServer::pasteBuffer(const MSString& aString_) { _pasteBuffer=aString_; } void MSDisplayServer::defaultFont(const char *font_) {_defaultFont=fontID(font_);} void MSDisplayServer::defaultForeground(const char *fg_) {_defaultFg=pixel(fg_);} void MSDisplayServer::defaultBackground(const char *bg_) {_defaultBg=pixel(bg_);} void MSDisplayServer::defaultValueBackground(const char *bg_) {_defaultValueBg=pixel(bg_);} void MSDisplayServer::defaultHighlightColor(const char *c_) {_defaultHighlightColor=pixel(c_);} unsigned long MSDisplayServer::pixel(const char *color_) {return _colorManager->pixel(color_);} const char *MSDisplayServer::colorName(unsigned long pixel_) const {return _colorManager->colorName(pixel_);} Colormap MSDisplayServer::colormap(void) const {return _colorManager->colormap();} Font MSDisplayServer::fontID(const char *font_) {return _fontManager->fontID(font_);} const char *MSDisplayServer::fontName(Font fid_) const {return _fontManager->fontName(fid_);} const XFontStruct *MSDisplayServer::fontStruct(Font fid_) const {return _fontManager->fontStruct(fid_);} Cursor MSDisplayServer::watchCursor(void) const {return _watchCursor->cursor();} MSToolTip *MSDisplayServer::toolTip(void) { if (_toolTip==0) _toolTip=new MSToolTip(this); return _toolTip; } int MSDisplayServer::propertyFullLength(void) { return MSPropertyFullLength; } Display *MSDisplayServer::defaultDisplay(void) { if (_defaultDisplayServer==0) { fprintf(stderr, "No Default Server Established: exit in DefaultDisplay()\n"); exitOnError(); } return _defaultDisplayServer->_dpy; } MSDisplayServer *MSDisplayServer::defaultDisplayServer(void) { if (_defaultDisplayServer==0) { fprintf(stderr, "No Default Server Established: exit in defaultDisplayServer()\n"); exitOnError(); } return _defaultDisplayServer; } MSDisplayServer *MSDisplayServer::serverOfDisplay(Display *dpy_) { return ((MSDisplayServer *)applicationDisplayServer(dpy_)); } int serverConnection(MSDisplayServer *pServer_) { if (pServer_==0) pServer_=MSDisplayServer::defaultDisplayServer(); return pServer_->connection(); } MSWidget *MSDisplayServer::grabWidget(void) const { if (_passiveGrabList->length()>0) { return (MSWidget *)((const MSWidgetVector *)_passiveGrabList)->lastElement(); } else return (MSWidget *)0; } void MSDisplayServer::addPassiveGrab(MSWidget *pWidget_) { if (pWidget_!= 0) { unsigned index=_passiveGrabList->indexOf((unsigned long)pWidget_); if (index==_passiveGrabList->length()) _passiveGrabList->append(pWidget_); } } void MSDisplayServer::removePassiveGrab(MSWidget *pWidget_) { unsigned index=_passiveGrabList->indexOf((unsigned long)pWidget_); if (index!=_passiveGrabList->length()) _passiveGrabList->removeAt(index); } MSBoolean MSDisplayServer::eventGrabbed(const XEvent *event_,MSWidget *pWidget_) const { if (event_->xany.window==_pointerGrabber) return MSTrue; if (event_->xany.window==_keyboardGrabber) return MSTrue; if (_passiveGrabList->length()>0) { MSWidget *topWidget=pWidget_->top(); MSWidget *pWidget=(MSWidget *)((const MSWidgetVector *)_passiveGrabList)->lastElement(); if (pWidget==topWidget) return MSTrue; else return MSFalse; } else return MSTrue; } int MSDisplayServer::grabPointer(Window grabWindow_,int ownerEvent_, unsigned eventMask_,int pointerMode_,int keyboardMode_, Window confineTo_,Cursor cursor_,Time time_,MSBoolean revertBack_) { int ret=XGrabPointer(_dpy,grabWindow_,ownerEvent_,eventMask_,pointerMode_,keyboardMode_, confineTo_,cursor_,time_); if (ret==GrabSuccess) { _pointerGrabber=grabWindow_; if (revertBack_==MSTrue) { PointerGrabber *pGrabber= new PointerGrabber(grabWindow_,ownerEvent_,eventMask_,pointerMode_, keyboardMode_,confineTo_,cursor_,time_); MSBoolean found=MSFalse; MSUnsignedLongVector *pGrabList=(MSUnsignedLongVector *)_pointerGrabList; for (int i=0;ilength();i++) { PointerGrabber *pGrabWidget=(PointerGrabber *) ((*pGrabList)(i)); if (pGrabWidget->_grabWindow==grabWindow_) { found=MSTrue; delete pGrabWidget; pGrabList->replaceAt(i,(unsigned long)pGrabber); break; } } if (found==MSFalse) { pGrabList->append((unsigned long)pGrabber); } } } return ret; } int MSDisplayServer::grabKeyboard(Window grabWindow_,int ownerEvent_,int pointerMode_, int keyboardMode_,Time time_,MSBoolean revertBack_) { int ret=XGrabKeyboard(_dpy,grabWindow_,ownerEvent_,pointerMode_,keyboardMode_,time_); if (ret==GrabSuccess) { _keyboardGrabber=grabWindow_; if (revertBack_==MSTrue) { KeyboardGrabber *pGrabber= new KeyboardGrabber(grabWindow_,ownerEvent_,pointerMode_, keyboardMode_,time_); MSBoolean found=MSFalse; MSUnsignedLongVector *pGrabList=(MSUnsignedLongVector *)_keyboardGrabList; for(int i=0;ilength();i++) { KeyboardGrabber *pGrabWidget=(KeyboardGrabber *) ((*pGrabList)(i)); if (pGrabWidget->_grabWindow==grabWindow_) { found=MSTrue; delete pGrabWidget; pGrabList->replaceAt(i,(unsigned long)pGrabber); break; } } if (found==MSFalse) { pGrabList->append((unsigned long)pGrabber); } } } return ret; } void MSDisplayServer::ungrabPointer(Window window_,Time time) { MSUnsignedLongVector *pGrabList=(MSUnsignedLongVector *)_pointerGrabList; if (pGrabList->length()>0) { MSBoolean found=MSFalse; int index=pGrabList->length()-1; while (found==MSFalse&&index>=0) { PointerGrabber *pGrabWidget=(PointerGrabber *)((*pGrabList)(index)); // If the widget asking for ungrab is in the grab list, we will // revert the grab to the next one in the list, and remove all // the entries that come before the asking widget. if (pGrabWidget->_grabWindow==window_) { found=MSTrue; if (index-1>=0) { PointerGrabber *pGrabber=(PointerGrabber *)((*pGrabList)(index-1)); int ret=XGrabPointer(_dpy,pGrabber->_grabWindow,pGrabber->_ownerEvents, pGrabber->_eventMask,pGrabber->_pointerMode, pGrabber->_keyboardMode, pGrabber->_confineTo,pGrabber->_cursor,pGrabber->_time); if (ret!=GrabSuccess) { fprintf(stderr, "Warning : Unable to revert pointer grab to Window %ld\n",pGrabber->_grabWindow); _pointerGrabber=0; } else _pointerGrabber=pGrabber->_grabWindow; } else { XUngrabPointer(_dpy,time); _pointerGrabber=0; } for(int j=index;jlength();j++) { PointerGrabber *pGrabber=(PointerGrabber *)((*pGrabList)(j)); delete pGrabber; } pGrabList->removeAt(index,pGrabList->length()-index); } index--; } // If we can't find matching window in the grab list, we'll just // revert back to the first one on the list if (found==MSFalse) { PointerGrabber *pGrabber=(PointerGrabber *) ((const MSWidgetVector *)pGrabList)->lastElement(); int ret=XGrabPointer(_dpy,pGrabber->_grabWindow,pGrabber->_ownerEvents, pGrabber->_eventMask,pGrabber->_pointerMode,pGrabber->_keyboardMode, pGrabber->_confineTo,pGrabber->_cursor,pGrabber->_time); if (ret!=GrabSuccess) { fprintf(stderr, "Warning : Unable to revert pointer grab to Window %ld\n",pGrabber->_grabWindow); _pointerGrabber=0; } else _pointerGrabber=pGrabber->_grabWindow; } } else { XUngrabPointer(_dpy,time); _pointerGrabber=0; } } void MSDisplayServer::ungrabKeyboard(Window window_,Time time) { MSUnsignedLongVector *pGrabList=(MSUnsignedLongVector *)_keyboardGrabList; if (pGrabList->length()>0) { int index=pGrabList->length()-1; MSBoolean found=MSFalse; while (found==MSFalse&&index>=0) { KeyboardGrabber *pGrabWidget=(KeyboardGrabber *)((*pGrabList)(index)); // If the widget asking for ungrab is in the grab list, we will // revert the grab to the next one in the list, and remove all // the entries that come before the asking widget. if (pGrabWidget->_grabWindow==window_) { found=MSTrue; if (index-1>=0) { KeyboardGrabber *pGrabber=(KeyboardGrabber *)((*pGrabList)(index-1)); int ret=XGrabKeyboard(_dpy,pGrabber->_grabWindow,pGrabber->_ownerEvents, pGrabber->_pointerMode,pGrabber->_keyboardMode,pGrabber->_time); if (ret!=GrabSuccess) { fprintf(stderr, "Warning : Unable to revert keyboard grab to Window %ld\n",pGrabber->_grabWindow); _keyboardGrabber=0; } else _keyboardGrabber=pGrabber->_grabWindow; } else { XUngrabKeyboard(_dpy,time); _keyboardGrabber=0; } for(int j=index;jlength();j++) { KeyboardGrabber *pGrabber=(KeyboardGrabber *)((*pGrabList)(j)); delete pGrabber; } pGrabList->removeAt(index, pGrabList->length()-index); } index--; } // If we can't find matching window in the grab list, we'll just // revert back to the first one on the list if (found==MSFalse) { KeyboardGrabber *pGrabber=(KeyboardGrabber *) ((const MSWidgetVector *)pGrabList)->lastElement(); int ret=XGrabKeyboard(_dpy,pGrabber->_grabWindow,pGrabber->_ownerEvents, pGrabber->_pointerMode,pGrabber->_keyboardMode,pGrabber->_time); if (ret!=GrabSuccess) { fprintf(stderr, "Warning : Unable to revert keyboard grab to Window %ld\n",pGrabber->_grabWindow); _keyboardGrabber=0; } else _keyboardGrabber=pGrabber->_grabWindow; } } else { XUngrabKeyboard(_dpy,time); _keyboardGrabber=0; } } // MSDisplayServer access methods int MSDisplayServer::screenNum(void) const { return DefaultScreen(_dpy); } Screen *MSDisplayServer::screen(void) const { return DefaultScreenOfDisplay(_dpy); } int MSDisplayServer::depth(void) const { return DefaultDepthOfScreen(screen()); } Visual *MSDisplayServer::visual(void) const { return DefaultVisual(_dpy,DefaultScreen(_dpy)); } Window MSDisplayServer::root(void) const { return RootWindow(_dpy,DefaultScreen(_dpy)); } int MSDisplayServer::connection(void) const { return ConnectionNumber(_dpy); } int MSDisplayServer::width(void) const { return DisplayWidth(_dpy,DefaultScreen(_dpy)); } int MSDisplayServer::widthMM(void) const { return DisplayWidthMM(_dpy,DefaultScreen(_dpy)); } int MSDisplayServer::height(void) const { return DisplayHeight(_dpy,DefaultScreen(_dpy)); } int MSDisplayServer::heightMM(void) const { return DisplayHeightMM(_dpy,DefaultScreen(_dpy)); } Atom MSDisplayServer::atom(int index_) const { return _atomTable.atom(index_); } // ############################################################################## // CDE WindowManager functionality // ############################################################################## void MSDisplayServer::workspaceChangedFunction(MSWorkspaceChangedFunction pFunction_) { _workspaceChangedFunction=pFunction_; } void MSDisplayServer::currentWorkspaceChangedNotify(Atom currentWorkspaceAtom_) { if (_workspaceChangedFunction!=0) _workspaceChangedFunction(currentWorkspaceAtom_); } MSBoolean MSDisplayServer::isCDERunning(void) const { if (_windowManager==MWM&&_mwmWindow!=0) return MSTrue; return MSFalse; } MSStringVector MSDisplayServer::workspaceNames(void) const { if (isCDERunning()==MSTrue) return _pMWMWidget->workspaceNames(); return MSStringVector(); } MSString MSDisplayServer::currentWorkspaceName(void) const { if (isCDERunning()==MSTrue) return _pMWMWidget->currentWorkspaceName(); return MSString(); } Atom MSDisplayServer::currentWorkspaceAtom(void) const { if (isCDERunning()==MSTrue) return _pMWMWidget->currentWorkspaceAtom(); return 0; } unsigned long MSDisplayServer::numberOfWorkspaces(void) const { if (isCDERunning()==MSTrue) return _pMWMWidget->numberOfWorkspaces(); return 0; } MSString MSDisplayServer::workspaceName(Atom wsAtom_) const { if (isCDERunning()==MSTrue) return _pMWMWidget->workspaceName(wsAtom_); return MSString(); } Atom MSDisplayServer::workspaceAtom(const MSString& wsName_) const { if (isCDERunning()==MSTrue) return _pMWMWidget->workspaceAtom(wsName_); return 0; } MSBoolean MSDisplayServer::changeWorkspaceTo(const MSString& workspaceName_) { if (isCDERunning()==MSTrue) { MSString theRequest("f.goto_workspace \""); theRequest+=workspaceName_; theRequest+='\"'; Atom property=XInternAtom(display(),_XA_DT_WM_REQUEST,False); // Make the request by appending the request // name to the _VUE_WM_REQUEST property XChangeProperty(display(),_mwmWindow, property,XA_STRING,8, PropModeAppend, (unsigned char *)theRequest.string(), theRequest.length()+1); XFlush(display()); return MSTrue; } return MSFalse; } void MSDisplayServer::setWindowManager(void) { Atom actualType; int actualFormat; unsigned long numItems,bytesAfter; MWMInfo *pMWMInfo=0; Atom mwmInfoAtom=XInternAtom(_dpy,_XA_MWM_INFO,False); XGetWindowProperty(_dpy,root(),mwmInfoAtom,0,2,False,mwmInfoAtom, &actualType,&actualFormat,&numItems,&bytesAfter, (unsigned char **)&pMWMInfo); if ((actualType!=mwmInfoAtom)||(actualFormat!=32)||(numItems<2)) _windowManager=Other; else { Window top,parent,*pChildren=0; unsigned int numChildren; // set the motif window manager special window _mwmWindow=(Window)pMWMInfo->_wmWindow; if (XQueryTree(_dpy,root(),&top,&parent,&pChildren,&numChildren)) { unsigned i; for (i=0;iwidgetHashTable()->add(window_,this); XSelectInput(display(),window_,PropertyChangeMask); updateWorkspaceList(); updateCurrentWorkspaceName(); } } MWMWidget::~MWMWidget(void) { delete [] _workspaceInfoAtoms; delete [] _workspaceAtoms; } void MWMWidget::updateWorkspaceInfo(Atom workspaceInfoAtom_) { unsigned n=numberOfWorkspaces(); for (unsigned i=0;i0) { _workspaceAtoms = new Atom[_workspaceCount]; _workspaceInfoAtoms = new Atom[_workspaceCount]; } else { _workspaceAtoms = 0; _workspaceInfoAtoms = 0; } } memcpy(_workspaceAtoms,pWsAtoms,(int)_workspaceCount*sizeof(Atom)); // copy the new atoms // // copy the new workspace info atoms // MSString wsPropName; char *name; for (unsigned i=0;i<_workspaceCount;i++) { wsPropName=_XA_DT_WORKSPACE_INFO; name=XGetAtomName(display(),_workspaceAtoms[i]); wsPropName+=name; if(name!=0) XFree(name); _workspaceInfoAtoms[i]=XInternAtom(display(),(char *)wsPropName.string(),False); } } if (pWsAtoms!=0) { XFree((char*)pWsAtoms); } _workspaceNames=getWorkspaceNames(); } void MWMWidget::updateCurrentWorkspaceName(void) { if (_mwmWindow!=0) { Atom actualType; int actualFormat; unsigned long numItems,bytesAfter; Atom *pWorkspaceAtom=0; int status=XGetWindowProperty(display(),_mwmWindow,_workspaceCurrentAtom, 0,1,False,XA_ATOM, &actualType,&actualFormat,&numItems,&bytesAfter, (unsigned char **)&pWorkspaceAtom); if (status==Success) { if (actualType==XA_ATOM&&numItems==1&&actualFormat==32) { Atom workspaceAtom=pWorkspaceAtom[0]; if (pWorkspaceAtom!=0) XFree((char *)pWorkspaceAtom); _currentWorkspaceAtom=workspaceAtom; _currentWorkspaceName=getWorkspaceName(_currentWorkspaceAtom); server()->currentWorkspaceChangedNotify(_currentWorkspaceAtom); } } } } MSStringVector MWMWidget::getWorkspaceNames(void) { if (_mwmWindow!=0 && _workspaceCount>0) { MSStringVector names(_workspaceCount); for (unsigned i=0; i<_workspaceCount; ++i) { names.replaceAt(i,getWorkspaceName(_workspaceAtoms[i])); } return names; } else { return MSStringVector(); } } MSString MWMWidget::getWorkspaceName(Atom workspaceAtom_) const { MSString theName; if (_mwmWindow!=0) { Atom actualType; int actualFormat; unsigned long numItems,bytesAfter; char *pString=XGetAtomName(display(),workspaceAtom_); MSString wsPropName=_XA_DT_WORKSPACE_INFO; wsPropName+=pString; Atom wsAtom=XInternAtom(display(),(char *)wsPropName.string(),False); unsigned char *data=0; int status=XGetWindowProperty(display(),_mwmWindow,wsAtom, 0,MSDisplayServer::propertyFullLength(), False,XA_STRING, &actualType,&actualFormat, &numItems,&bytesAfter,&data); if (status==Success&&actualType==XA_STRING) theName=(char *)data; if (data!=0) XFree((char *)data); if (pString!=0) XFree(pString); } return theName; } void MWMWidget::propertyNotify(const XEvent *pEvent_) { Atom property=pEvent_->xproperty.atom; if (property!=_wmStateAtom) { if (property==_workspaceCurrentAtom) updateCurrentWorkspaceName(); else if (property==_workspaceListAtom) updateWorkspaceList(); else updateWorkspaceInfo(property); } } MSString MWMWidget::workspaceName(Atom wsAtom_) const { for (unsigned long i=0; i<_workspaceCount; ++i) { if (_workspaceAtoms[i]==wsAtom_) { return _workspaceNames(i); } } return MSString(); } Atom MWMWidget::workspaceAtom(const MSString& wsName_) const { unsigned index=_workspaceNames.indexOf(wsName_); if (index<_workspaceCount) { return _workspaceAtoms[index]; } else // wsName_ is not one of alias names; possibly, an internal name (e.g.,"ws0") { return XInternAtom(display(),wsName_.string(),False); } } #ifdef MS_KEYPAD_BUG void MSDisplayServer::correctKeypadKeys(const XEvent *pEvent_,KeySym &keysym_,unsigned int state_,char * pString_) { KeyCode keycode = ((XKeyEvent*)pEvent_)->keycode; if (state_ == _numLockModifier) { for (int i=0;i extern unsigned long applicationDoubleClickInterval(void); MSBoolean MSDoubleClick::isDoubleClick(const XEvent *ev_) { if (ev_->type==ButtonPress||ev_->type==ButtonRelease) { if (ev_->xbutton.time-lastEventTime()<=applicationDoubleClickInterval()) { eventTime(0); return MSTrue; } else { eventTime(ev_->xbutton.time); return MSFalse; } } else return MSFalse; } aplus-fsf-4.22/src/MSGUI/MSEntryField.C0000644000265000001440000011350610772770403013117 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include static const unsigned long MSEntryFieldDefaultCycleInterval=1000; static const unsigned long MSEntryFieldEventMask=(ExposureMask|ButtonPressMask|ButtonReleaseMask); static const unsigned MSEntryFieldEditorShadowThickness=2; static const unsigned MSEntryFieldEditorHighlightThickness=0; MSEntryField::CycleTimer::CycleTimer(MSEntryField *entryField_,unsigned long interval_) : MSIntervalTimer(interval_) { _entryField=entryField_; } MSEntryField::CycleTimer::~CycleTimer(void) {} void MSEntryField::CycleTimer::process(void) { _entryField->processCycleTimer(); } MSEntryField::FieldEditor::FieldEditor(MSWidget *owner_) : MSTextField(owner_) { _highlightThickness=MSEntryFieldEditorHighlightThickness; _shadowThickness=MSEntryFieldEditorShadowThickness; margin(0); color(owner()->background(),owner()->foreground()); } MSEntryField::FieldEditor::~FieldEditor(void) {} void MSEntryField::FieldEditor::returnKey(void) { if (owner()!=0) ((MSEntryField *)owner())->returnKey(); } void MSEntryField::FieldEditor::activate(void) { if (owner()!=0) ((MSEntryField *)owner())->activate(); } void MSEntryField::FieldEditor::escape(void) { if (owner()!=0) ((MSEntryField *)owner())->escape(); } void MSEntryField::FieldEditor::up(void) { if (owner()!=0) ((MSEntryField *)owner())->up(); } void MSEntryField::FieldEditor::down(void) { if (owner()!=0) ((MSEntryField *)owner())->down(); } MSEntryField::MSEntryField(MSWidget *owner_,const MSSymbol& tag_) : MSCompositeField(owner_,tag_) { init(); } MSEntryField::MSEntryField(MSWidget *owner_,const char *label_,const MSSymbol& tag_) : MSCompositeField(owner_,label_,tag_) { init(); } MSEntryField::~MSEntryField(void) { removeCycle(); if (_cycleTimer!=0) delete _cycleTimer; if (_editor!=0) safeDestroy(_editor); } void MSEntryField::init(void) { freeze(); _hadFocus=MSFalse; _cycle=0; _cycleTimer=0; _cycleInterval=MSEntryFieldDefaultCycleInterval; _cycleColorMode=MSForeground; _editor=0; _editor=new FieldEditor(this); _autoMaskInput=MSFalse; selectInput(MSEntryFieldEventMask); _selectionStart=-1; _selectionEnd=-1; _firstCharacter=0; _insertCursor=-1; _supportPasting=MSTrue; _pasting=MSFalse; } void MSEntryField::updateBackground(unsigned long oldbg_) { MSCompositeField::updateBackground(oldbg_); if (oldbg_==editorForeground()) editorForeground(background()); } void MSEntryField::updateForeground(unsigned long oldfg_) { MSCompositeField::updateForeground(oldfg_); if (oldfg_==editorBackground()) editorBackground(foreground()); } void MSEntryField::updateFont(Font oldfid_) { MSCompositeField::updateFont(oldfid_); } void MSEntryField::updateSensitivity(void) { if (sensitive()==MSFalse) { _firstCharacter=0; _selectionStart=-1; _selectionEnd=-1; disownSelection(XA_PRIMARY); removeCycle(); } MSCompositeField::updateSensitivity(); } void MSEntryField::placement(void) { if (_editor->mapped()==MSTrue) unmapEditor(); MSCompositeField::placement(); } void MSEntryField::editorBackground(const char *color_) { _editor->background(color_); } void MSEntryField::editorForeground(const char *color_) { _editor->foreground(color_); } void MSEntryField::editorBackground(unsigned long pixel_) { _editor->background(pixel_); } void MSEntryField::editorForeground(unsigned long pixel_) { _editor->foreground(pixel_); } void MSEntryField::updateData(void) { clearSelection(MSTrue); disownSelection(XA_PRIMARY); } void MSEntryField::update(const MSIndexVector&) { if (pasting()==MSFalse) { clearSelection(MSFalse); disownSelection(XA_PRIMARY); } if (frozen()==MSFalse&&mapped()==MSTrue) { createCycle(); XFlush(display()); // get update out to the screen asap } } void MSEntryField::editSelection(void) { if (_editor->mapped()==MSFalse) { MSString buffer; const char *pString=formatOutput(buffer); if (pString!=0) _editor->string(pString); else _editor->string(""); _editor->cursorPosition(_editor->firstCursorPosition()); mapEditor(); } } void MSEntryField::edit(void) { editSelection(); } void MSEntryField::configureEditor(void) { int sht = valueShadowThickness(); _editor->shadowThickness((sht < MSEntryFieldEditorShadowThickness)? sht : MSEntryFieldEditorShadowThickness); if (_editor->inputMaskMode() == MSFalse) _editor->maxLength(editWidth()); _editor->font(_fieldValue->font()); _editor->color(editorForeground(),editorBackground()); _editor->moveTo(_fieldValue->x(),_fieldValue->y()); _editor->resize(_fieldValue->width(),_fieldValue->height()); } void MSEntryField::clearEditor(void) { _editor->string(""); } void MSEntryField::mapEditor(void) { configureEditor(); _editor->map(); focusInNotify(_editor); activateCallback(MSWidgetCallback::editbegin); } void MSEntryField::unmapEditor(void) { focusOutNotify(_editor); _editor->unmap(); clearEditor(); activateCallback(MSWidgetCallback::editend); } MSBoolean MSEntryField::validateInput(MSString &input_) { if (_validationCallback!=0) { // If user validation returns MSFalse, just return if (_validationCallback->validate(input_)==MSFalse) { return MSFalse; } } return (validate(input_.string())); } void MSEntryField::activate(void) { if (_editor->mapped()==MSTrue) { if (hasModel()==MSTrue) { MSString aString=_editor->string(); if (validateInput(aString)==MSTrue) { unmapEditor(); valueChange(); } } else escape(); } } MSBoolean MSEntryField::activateEditor(void) { activate(); return (_editor->mapped()==MSTrue)?MSFalse:MSTrue; } void MSEntryField::escape(void) { unmapEditor(); drawFieldValue(); } void MSEntryField::returnKey(void) { if (_editor->mapped()==MSTrue) { if (activateEditor()==MSTrue) activateCallback(MSWidgetCallback::activate); } else reference(); } void MSEntryField::valueChange(void) { activateCallback(MSWidgetCallback::valuechange); } void MSEntryField::reference(void) { activateCallback(MSWidgetCallback::reference); } void MSEntryField::buttonPress(const XEvent *pEvent_) { if (sensitive()==MSTrue) { if (_editor->mapped()==MSTrue) { XEvent *ep=(XEvent *)pEvent_; ep->xbutton.x-=_editor->x_origin(); ep->xbutton.y-=_editor->y_origin(); buttonPressNotify(_editor,ep); } else { MSBoolean focusOK; if (acceptFocus()==MSTrue) { _hadFocus=(inputFocus()==this)?MSTrue:MSFalse; focusOK=traverseFocus(this); } else { _hadFocus=MSFalse; focusOK=MSTrue; } if (focusOK==MSTrue) { if (pEvent_->xbutton.x>=_fieldValue->x()&&pEvent_->xbutton.y>=_fieldValue->y()) { buttonPressNotify(this,pEvent_); } } } } } void MSEntryField::button1Press(const XEvent *pEvent_) { clearSelection(MSFalse); trackSelection(pEvent_); } void MSEntryField::button2Press(const XEvent *pEvent_) { if (isProtected()==MSFalse) { if (supportPasting()==MSTrue) { MSString buffer; formatOutput(buffer); int pos=locateCursorPosition(pEvent_->xbutton.x,buffer); if (pos==-1) pos=0; if (server()->primarySelectionOwner()==this) { if (selectionStart()==-1||selectionEnd()==-1||(pos>selectionStart()&&pos<=selectionEnd())) { server()->bell(); } else { MSString buffer; formatOutput(buffer); MSString subString=buffer.subString(selectionStart(),selectionEnd()-selectionStart()+1); insertString(pos,subString); } } else { insertCursor(pos); convertSelection(); } } else startEditing(pEvent_); } else server()->bell(); } void MSEntryField::button3Press(const XEvent *pEvent_) { if (isProtected()==MSFalse) startEditing(pEvent_); } void MSEntryField::startEditing(const XEvent *pEvent_) { XEvent *ep=(XEvent *)pEvent_; ep->xbutton.x-=_fieldValue->x(); ep->xbutton.y-=_fieldValue->y(); editSelection(); buttonPressNotify(_editor,ep); } void MSEntryField::keyPress(const XEvent *pEvent_,KeySym keysym_, unsigned int state_,const char *buffer_) { MSKeyPress keyPress( keysym_,state_); if (sensitive()==MSTrue && keyTranslate(keyPress)==MSFalse) { if (_editor->mapped()==MSTrue) keyPressNotify(_editor,pEvent_,keysym_,state_,buffer_); else { if (keysym_==XK_Return) returnKey(); else if (isProtected()==MSFalse) { if (keysym_==XK_KP_Add) increment(); else if (keysym_==XK_KP_Subtract||keysym_==XK_F24) decrement(); else if (keysym_==XK_Up) up(); else if (keysym_==XK_Down) down(); else if (keysym_==XK_Left) left(); else if (keysym_==XK_Right) right(); else if (keysym_==XK_Insert) editSelection(); else if (keysym_==XK_BackSpace) { if (isSelected()==MSTrue) { updateEditor(); } else clearEditor(); mapEditor(); } else if (strlen(buffer_)>0) { if (isSelected()==MSTrue) { updateEditor(); } else clearEditor(); if(_editor->inputMaskMode()==MSFalse) { _editor->editMode(MSTextField::InsertMode); keyPressNotify(_editor,pEvent_,keysym_,state_,buffer_); if (_editor->length()>0) mapEditor(); } else { _editor->editMode(MSTextField::OverstrikeMode); keyPressNotify(_editor,pEvent_,keysym_,state_,buffer_); int pos = _editor->firstCursorPosition(); if(_editor->text()(pos) != inputMask()(pos)) mapEditor(); } } } } } } void MSEntryField::drawFieldValue(void) { if (frozen()==MSFalse&&mapped()==MSTrue&&hasModel()==MSTrue) { unsigned long fg,bg; currentColors(fg,bg); drawFieldValue(fg,bg); } } void MSEntryField::removeCycle(void) { if (cycle()!=0) { delete _cycle; _cycle=0; } if (cycleTimer()!=0) cycleTimer()->stop(); } void MSEntryField::processCycleTimer(void) { cycle()->increment(); if (cycle()->count()==cycle()->numCycles()) { cycleTimer()->stop(); drawFieldValue(); } else { cycleValue(); } } void MSEntryField::createCycle(void) { if (cycleColorMode()==MSReverseVideo||cycleColors().length()>0) startCycle(cycleColors()); else drawFieldValue(); } void MSEntryField::cycleInterval(unsigned long interval_) { if (cycleInterval()!=interval_) { _cycleInterval=interval_; MSBoolean stop=(cycle()==0)?MSTrue:MSFalse; if (cycleTimer()!=0) delete _cycleTimer; _cycleTimer=new CycleTimer(this,cycleInterval()); if (stop==MSTrue) cycleTimer()->stop(); } } void MSEntryField::startCycle(const MSUnsignedLongVector& colors_) { if (cycleTimer()==0) _cycleTimer=new CycleTimer(this,cycleInterval()); else cycleTimer()->reset(); if (_cycle==0) { _cycle=new MSColorCycle(this,0,0,colors_,cycleColorMode()); } else { cycle()->reset(); } cycleValue(); } void MSEntryField::cycleValue(void) { unsigned long fg,bg; currentColors(fg,bg); drawFieldValue(fg,bg); } void MSEntryField::cycleColors(const MSStringVector& colors_) { MSUnsignedLongVector colors(colors_.length()); for (int i=0;ipixel(colors_(i))); cycleColors(colors); } void MSEntryField::cycleColors(const MSUnsignedLongVector& colors_) { MSBoolean redrawNecessary=MSFalse; if (cycle()!=0&&cycle()->count()numCycles()) { redrawNecessary=MSTrue; } removeCycle(); _cycleColors=colors_; if (redrawNecessary==MSTrue) drawFieldValue(); } void MSEntryField::focusIn(void) { highlight(); if (_editor->mapped()==MSTrue) focusInNotify(_editor); } void MSEntryField::focusOut(void) { unHighlight(); if (_editor->mapped()==MSTrue) focusOutNotify(_editor); } MSBoolean MSEntryField::loseFocus(void) { if (_editor->mapped()==MSTrue) activate(); if (_editor->mapped()==MSTrue) return MSFalse; else { unHighlight(); return MSTrue; } } void MSEntryField::format(const MSFormat& aFormat_) { if (format().formatType()==MSFormat::NoFormat|| aFormat_.formatType()==format().formatType()) { _format=aFormat_; drawFieldValue(); if(autoMaskInput() == MSTrue) generateInputMask(); } } void MSEntryField::set(MSAttrValueList& avList_) { MSCompositeField::set(avList_); MSIndexVector index; for (unsigned i=0;i0)?avList_[i].value()(0):'-'),index<colorName(editorForeground()),MSAttrValue::Color); avList_<colorName(editorBackground()),MSAttrValue::Color); avList_<mapped(); } unsigned long MSEntryField::editorBackground(void) const { return _editor->background(); } unsigned long MSEntryField::editorForeground(void) const { return _editor->foreground(); } void MSEntryField::inputMask(const MSString& mask_) { if(autoMaskInput() == MSFalse) _editor->inputMask(mask_); } const MSString& MSEntryField::inputMask(void) const { return _editor->inputMask(); } char MSEntryField::inputMaskCharacter(void) const { return _editor->inputMaskCharacter(); } void MSEntryField::inputMaskCharacter(char inputMaskCharacter_) { _editor->inputMaskCharacter(inputMaskCharacter_); //this could either take a new inputMaskCharacter into account, or reset it back. if(autoMaskInput() == MSTrue) generateInputMask(); } void MSEntryField::autoMaskInput(MSBoolean mask_) { if(_autoMaskInput != mask_) { _autoMaskInput = mask_; if(_autoMaskInput == MSTrue) generateInputMask(); else inputMask(""); } } MSBoolean MSEntryField::autoMaskInput(void) const { return _autoMaskInput; } // ######################################################### // default virtual methods - prevents gratuitous inlining // ######################################################### void MSEntryField::up(void) {} void MSEntryField::down(void) {} void MSEntryField::left(void) {} MSBoolean MSEntryField::scrollLeft(void) { if (firstCharacter()!=0) { firstCharacter(firstCharacter()-1); return MSTrue; } else return MSFalse; } void MSEntryField::right(void) {} MSBoolean MSEntryField::scrollRight(const MSString &string_,int &lastCharacter_) { int oldFirstCharacter=firstCharacter(); lastCharacter_=-1; if (string_.length()>0) { const char *pString=string_.string(); pString+=firstCharacter(); int nCharToDisplay=(int)string_.length()-firstCharacter(); if (nCharToDisplay>0) { int dfw=displayableFieldWidth(pString,nCharToDisplay); if (dfw>0) { int nCharDisplayable=nCharToDisplay; while (_fieldValue->textWidth(pString,nCharDisplayable)>dfw) nCharDisplayable--; if (nCharDisplayable>0) { if (nCharDisplayablemapped()==MSTrue&&mapped()==MSTrue) { MSString buffer; const char *pString=formatOutput(buffer); pString+=firstCharacter(); int len=(int)buffer.length()-firstCharacter(); int sht=_fieldValue->shadowThickness(); if (len>0) { int fulllen=len; int clipIndicatorWidth=0; int clipIndicatorMargin=2; int starLength=0; int dw=_fieldValue->width()-2*_fieldValue->offset(); if (clipMode()!=MSNoClipping) { if (_fieldValue->textWidth(pString,len)>dw) { if(clipMode()==MSClipIndicator) { clipIndicatorWidth=_fieldValue->charWidth()+clipIndicatorMargin; dw-=clipIndicatorWidth; if (dw<0) { dw=0; clipIndicatorWidth=0; } } else //MSClipStars { starLength=(int)(dw/fieldValue()->charWidth('*')); } } } int xx=_fieldValue->x()+_fieldValue->offset(); if (starLength>0) { char *cp = new char[starLength+1]; for(int ii=0;iihighlightThickness()+_fieldValue->shadowThickness(); int diff = (_fieldValue->height()-(2*offset+_fieldValue->textHeight())); int margin=diff/2; int yy=_fieldValue->y()+offset+((margin>0)?margin:0)+_fieldValue->textAscent(); XSetForeground(display(),drawGC(),bg_); XFillRectangle(display(),window(), drawGC(), _fieldValue->x()+sht, _fieldValue->y()+sht, _fieldValue->width()-(2*sht), _fieldValue->height()-(2*sht)); XDrawString(display(),window(),fieldValue()->textGC(), fieldValue()->textFontStruct(),xx,yy,cp,starLength); } else if(dw>0) { while (_fieldValue->textWidth(pString,len)>dw) len--; if (len>0) { int offset=_fieldValue->highlightThickness()+_fieldValue->shadowThickness(); int diff = (_fieldValue->height()-(2*offset+_fieldValue->textHeight())); int margin=diff/2; int yy=_fieldValue->y()+offset+((margin>0)?margin:0)+_fieldValue->textAscent(); int textX; if (valueAlignment()==MSCenter&&fulllen==len) { int tw=_fieldValue->textWidth(pString,len); xx+=(dw-tw)/2; } else if (valueAlignment()==MSRight||(clipIndicatorWidth>0&&fulllen>len)) { int tw=_fieldValue->textWidth(pString,len); xx=_fieldValue->x()+_fieldValue->width()-_fieldValue->offset()-tw-clipIndicatorWidth; } textX=xx; //if textAsent() is not the same textFontStruct()->ascent then we //have either a variable-width or some other weird (e.g. courier) font. //This also means that XImageDrawString will not paint the bacground //as high as necessary, so we do this here: if(_fieldValue->textFontStruct()->ascent < _fieldValue->textAscent()) { XSetForeground(display(),drawGC(),bg_); XFillRectangle(display(),window(),drawGC(), textX,_fieldValue->y()+sht, _fieldValue->textWidth(pString,len), _fieldValue->textAscent()-_fieldValue->textFontStruct()->ascent); } XSetForeground(display(),drawGC(),bg_); XFillRectangle(display(),window(), drawGC(), _fieldValue->x()+sht, _fieldValue->y()+sht, xx-_fieldValue->x()-sht, _fieldValue->height()-(2*sht)); int fc=firstCharacter(); int lc=firstCharacter()+len-1; int ss=selectionStart(); int se=selectionEnd(); //Nothing is selected if ((sslc&&se>lc)) { XSetForeground(display(),drawGC(),fg_); XSetBackground(display(),drawGC(),bg_); XDrawImageString(display(),window(), drawGC(),_fieldValue->textFontStruct(), xx,yy,pString,len); xx+=_fieldValue->textWidth(pString,len); } //Everything visible is selected else if (ss<=fc&&se>=lc) { XSetForeground(display(),drawGC(),bg_); XSetBackground(display(),drawGC(),fg_); XDrawImageString(display(),window(), drawGC(),_fieldValue->textFontStruct(), xx,yy,pString,len); xx+=_fieldValue->textWidth(pString,len); } //Selection begins before the first character and ends before the end of the //entry field else if (ss<=fc) { int slen=se-fc+1; slen=(slen>len)?len:slen; XSetForeground(display(),drawGC(),bg_); XSetBackground(display(),drawGC(),fg_); XDrawImageString(display(),window(), drawGC(),_fieldValue->textFontStruct(), xx,yy,pString,slen); xx+=_fieldValue->textWidth(pString,slen); pString+=slen; slen=len-slen; XSetForeground(display(),drawGC(),fg_); XSetBackground(display(),drawGC(),bg_); XDrawImageString(display(),window(), drawGC(),_fieldValue->textFontStruct(), xx,yy,pString,slen); xx+=_fieldValue->textWidth(pString,slen); } //Selection begins inside the entry field and ends either before the end of //the entry field or within the entry field else { int slen=ss-fc; slen=(slen>len)?len:slen; XSetForeground(display(),drawGC(),fg_); XSetBackground(display(),drawGC(),bg_); XDrawImageString(display(),window(), drawGC(),_fieldValue->textFontStruct(), xx,yy,pString,slen); xx+=_fieldValue->textWidth(pString,slen); int lenLeft=len-slen; if (lenLeft>0) { pString+=slen; slen=se-ss+1; slen=(slen>lenLeft)?lenLeft:slen; XSetForeground(display(),drawGC(),bg_); XSetBackground(display(),drawGC(),fg_); XDrawImageString(display(),window(), drawGC(),_fieldValue->textFontStruct(), xx,yy,pString,slen); xx+=_fieldValue->textWidth(pString,slen); lenLeft-=slen; if (lenLeft>0) { pString+=slen; slen=lenLeft; XSetForeground(display(),drawGC(),fg_); XSetBackground(display(),drawGC(),bg_); XDrawImageString(display(),window(), drawGC(),_fieldValue->textFontStruct(), xx,yy,pString,slen); xx+=_fieldValue->textWidth(pString,slen); } } } //See if font is small and we need to redraw //sections above and below text. if(diff>0) { XSetForeground(display(),drawGC(),bg_); XFillRectangle(display(),window(),drawGC(), textX,_fieldValue->y()+sht, xx-textX,margin); //The bottom margin could be 1 pixel bigger then margin, //because of integer division rounding (if diff is odd). //Therefore compute it by subsctracting. margin=diff-margin; XFillRectangle(display(),window(),drawGC(), textX,_fieldValue->y()+_fieldValue->height()-sht-margin, xx-textX,margin); } } } if(starLength==0) { XSetForeground(display(),drawGC(),bg_); XFillRectangle(display(),window(), drawGC(), xx, _fieldValue->y()+sht, _fieldValue->width()-(2*sht)-(xx-_fieldValue->x()-_fieldValue->offset()), _fieldValue->height()-(2*sht)); } if (clipMode()==MSClipIndicator) { if (fulllen>len&&clipIndicatorWidth>0) { int offset=_fieldValue->highlightThickness()+_fieldValue->shadowThickness()+3; int xx=_fieldValue->x()+_fieldValue->width()-offset-clipIndicatorWidth+clipIndicatorMargin; XPoint points[3]; points[0].x=xx; points[0].y=offset; points[1].x=clipIndicatorWidth; points[1].y=(height()-2*offset)/2; points[2].x=-clipIndicatorWidth; points[2].y=points[1].y; XSetForeground(display(),drawGC(),clipIndicatorForeground()); XFillPolygon(display(),window(),drawGC(),points,3, Convex,CoordModePrevious); } } } else { XSetForeground(display(),drawGC(),bg_); XFillRectangle(display(),window(), drawGC(), _fieldValue->x()+sht, _fieldValue->y()+sht, _fieldValue->width()-(2*sht), _fieldValue->height()-(2*sht)); } drawFieldValueShadow(); } } int MSEntryField::locateCursorPosition(int x_,const MSString &string_) { const char *pString=string_.string(); pString+=firstCharacter(); int len=(int)string_.length()-firstCharacter(); int fulllen=len; int clipIndicatorWidth=0; int clipIndicatorMargin=2; int dw=_fieldValue->width()-2*_fieldValue->offset(); if (clipMode()!=MSNoClipping) { if (_fieldValue->textWidth(pString,len)>dw) { if(clipMode()==MSClipIndicator) { clipIndicatorWidth=_fieldValue->charWidth()+clipIndicatorMargin; dw-=clipIndicatorWidth; if (dw<0) { dw=0; clipIndicatorWidth=0; } } else // MSClipStars , selection is disabled. { return -1; } } } if (dw>0) { while (_fieldValue->textWidth(pString,len)>dw) len--; if (len>0) { int xx=_fieldValue->x()+_fieldValue->offset(); if (valueAlignment()==MSCenter&&fulllen==len) { int tw=_fieldValue->textWidth(pString,len); xx+=(dw-tw)/2; } else if (valueAlignment()==MSRight||(clipIndicatorWidth>0&&fulllen>len)) { int tw=_fieldValue->textWidth(pString,len); xx=_fieldValue->x()+_fieldValue->width()-_fieldValue->offset()-tw-clipIndicatorWidth; } if (x_>xx) { int diff=x_-xx; while (_fieldValue->textWidth(pString,len)>diff) len--; return firstCharacter()+len; } else return firstCharacter(); } else return -1; } else return -1; } void MSEntryField::button1Release(const XEvent *pEvent_) { if (inputFocus()==this&&hadFocus()==MSTrue) { if (hasCallback(MSWidgetCallback::reference)==MSTrue) reference(); else if (isProtected()==MSFalse) startEditing(pEvent_); } } const char *MSEntryField::getPrimarySelection(MSString& buffer_, int& len_) { const char *cp=0; if (selectionStart()!=-1&&selectionEnd()!=-1) { cp=formatOutput(buffer_); cp=cp+selectionStart(); len_=selectionEnd()-selectionStart()+1; } return cp; } void MSEntryField::selectionClear(const XEvent *) { clearSelection(); } void MSEntryField::insertPrimarySelection(void) { insertString(insertCursor(),server()->pasteBuffer()); } MSBoolean MSEntryField::insertString(int pos_,const MSString &string_) { pasting(MSTrue); MSString buffer; formatOutput(buffer); if (pos_==-1) buffer<bell(); } pasting(MSFalse); return validated; } MSBoolean MSEntryField::isSelected(void) { return (selectionStart()>=0&&selectionEnd()>=0&&selectionEnd()>=selectionStart())?MSTrue:MSFalse; } void MSEntryField::updateEditor(void) { MSString buffer; formatOutput(buffer); buffer.remove(selectionStart(),selectionEnd()-selectionStart()+1); _editor->string(buffer.string()); _editor->cursorPosition(selectionStart()); if (selectionStart()0)?index:0; _editor->scrollIndex(index); } else { _editor->scrollIndex(firstCharacter()); } _selectionStart=-1; _selectionEnd=-1; _firstCharacter=0; disownSelection(XA_PRIMARY); } void MSEntryField::trackSelection(const XEvent *pEvent_) { MSString buffer; formatOutput(buffer); if (buffer.length()>0) { int startX=pEvent_->xbutton.x; int startPos=locateCursorPosition(startX,buffer); if (startPos!=-1) { int pos=startPos; Window root,child; int rx,ry,winx,winy; unsigned keys; int sameScreen=XQueryPointer(display(),window(),&root,&child,&rx,&ry,&winx,&winy,&keys); while (keys&Button1Mask) { if (sameScreen==True) { int cursor=-1; if (winx<_fieldValue->x()) { scrollLeft(); cursor=firstCharacter(); } else if (winx>_fieldValue->x()+_fieldValue->width()) { if (scrollRight(buffer,cursor)==MSFalse) cursor=buffer.length(); } else { cursor=locateCursorPosition(winx,buffer); } if (cursor!=-1) { if (cursor!=pos) { pos=cursor; //Set hadFocus to MSFalse here so button1Release will not bring up the editor _hadFocus=MSFalse; if (startPos==pos) { setSelection(-1,-1); } if (startPos>pos) { setSelection(pos,startPos-1); } else { setSelection(startPos,pos-1); } } } } sameScreen=XQueryPointer(display(),window(),&root,&child,&rx,&ry,&winx,&winy,&keys); } } } } int MSEntryField::displayableFieldWidth(const char *pString_,int len_) { int dfw=_fieldValue->width()-2*_fieldValue->offset(); if (clipMode()==MSClipIndicator) { if (_fieldValue->textWidth(pString_,len_)>dfw) { int clipIndicatorMargin=2; int clipIndicatorWidth=_fieldValue->charWidth()+clipIndicatorMargin; dfw-=clipIndicatorWidth; } } return (dfw>0)?dfw:0; } void MSEntryField::currentColors(unsigned long &fg_,unsigned long &bg_) { if (cycle()!=0&&cycle()->count()numCycles()) { if (cycleColorMode()==MSReverseVideo) { fg_=valueBackground(); bg_=valueForeground(); } else if (cycleColorMode()==MSBackground) { fg_=valueForeground(); bg_=cycle()->color(cycle()->count()); } else { fg_=cycle()->color(cycle()->count()); bg_=valueBackground(); } } else { fg_=valueForeground(); bg_=valueBackground(); } } void MSEntryField::cycleColorMode(MSCycleColorMode cycleColorMode_) { if (_cycleColorMode!=cycleColorMode_) { MSBoolean redrawNecessary=MSFalse; if (cycle()!=0&&cycle()->count()numCycles()) { redrawNecessary=MSTrue; } removeCycle(); _cycleColorMode=cycleColorMode_; if (redrawNecessary==MSTrue) drawFieldValue(); } } unsigned long MSEntryField::addEditorKeyCallback( const char* pString_,MSKeyCallback* keyCallback_) { return _editor->addKeyCallback(pString_,keyCallback_);} void MSEntryField::removeEditorKeyCallback(unsigned long id_) { _editor->removeKeyCallback(id_); } void MSEntryField::removeEditorKeyCallback(const char* pString_) { _editor->removeKeyCallback(pString_); } aplus-fsf-4.22/src/MSGUI/MSEntryFieldCombo.C0000644000265000001440000003657210772770403014106 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include static const int MSEntryFieldComboDefaultSpacing=3; static const int MSEntryFieldComboRepeatInterval=100; static const int MSEntryFieldComboInitialDelay=200; // ######################################################### // DelayTimer // ######################################################### MSEntryFieldCombo::DelayTimer::DelayTimer(MSEntryFieldCombo *ef_,unsigned long ms_,TimerDirection direction_): MSRegularTimer(ms_,0),_entryField(ef_),_direction(direction_) {} void MSEntryFieldCombo::DelayTimer::process(void) { _entryField->processDelayTimer(); } void MSEntryFieldCombo::DelayTimer::direction(TimerDirection direction_) { _direction=direction_; } MSEntryFieldCombo::TimerDirection MSEntryFieldCombo::DelayTimer::direction(void) const { return _direction; } MSEntryFieldCombo::RepeatTimer::RepeatTimer(MSEntryFieldCombo *ef_, unsigned long interval_, TimerDirection direction_) : MSIntervalTimer(interval_),_entryField(ef_),_direction(direction_) {} void MSEntryFieldCombo::RepeatTimer::direction(TimerDirection direction_) { _direction=direction_; } MSEntryFieldCombo::TimerDirection MSEntryFieldCombo::RepeatTimer::direction(void) const { return _direction; } MSEntryFieldCombo *MSEntryFieldCombo::RepeatTimer::entryField(void) { return _entryField; } void MSEntryFieldCombo::RepeatTimer::process(void) { if (_direction==Up) _entryField->increment(); else _entryField->decrement(); } // ################################################################## // MSEntryFieldCombo // ################################################################## MSEntryFieldCombo::MSEntryFieldCombo(MSWidget *owner_,const MSSymbol& tag_): MSEntryField(owner_,tag_) { init(); } MSEntryFieldCombo::MSEntryFieldCombo(MSWidget *owner_,const char *label_,const MSSymbol& tag_): MSEntryField(owner_,label_,tag_) { init(); } void MSEntryFieldCombo::init(void) { _buttonSpacing=MSEntryFieldComboDefaultSpacing; _buttonFlags = 0; _upArrow=0; _downArrow=0; _comboArrow=0; _repeatTimer=0; _delayTimer=0; _buttonLabel = ""; _buttonSelected = MSFalse; } MSEntryFieldCombo::~MSEntryFieldCombo(void) { if (_upArrow!=0) delete _upArrow; if (_downArrow!=0) delete _downArrow; if (_comboArrow!=0) delete _comboArrow; if (_delayTimer!=0) delete _delayTimer; if (_repeatTimer!=0) delete _repeatTimer; } void MSEntryFieldCombo::buttonColor(ButtonFlag flag_, const char * color_) { buttonColor(flag_, server()->pixel(color_)); } void MSEntryFieldCombo::buttonColor(ButtonFlag flag_, unsigned long color_) { if (color_ != buttonColor(flag_)) { switch(flag_) { case ComboButton: if(_comboArrow != 0) _comboArrow->color(color_); break; case UpDownArrows: if(_upArrow != 0) _upArrow->color(color_); if(_downArrow != 0) _downArrow->color(color_); break; case TextButton: default: break; } redraw(); } } unsigned long MSEntryFieldCombo::buttonColor(ButtonFlag flag_) const { switch(flag_) { case ComboButton: if (_comboArrow != 0) return _comboArrow->color(); break; case UpDownArrows: if (_upArrow != 0) return _upArrow->color(); break; case TextButton: default: break; } return background(); } void MSEntryFieldCombo::buttonState(ButtonFlag button_, MSBoolean flag_) { if(button_ == TextButton) return; // use comboButtonLabel instead if(bitState(button_) != flag_) { if(flag_ == MSTrue) setBit(button_); else unsetBit(button_); switch(button_) { case UpDownArrows: if(_upArrow == 0) _upArrow=new MSArrow(this,MSArrow::Up); if(_downArrow == 0) _downArrow=new MSArrow(this,MSArrow::Down); break; case ComboButton: if (_comboArrow == 0) _comboArrow = new MSArrow(this, MSArrow::Down); default: break; } } placement(); } void MSEntryFieldCombo::comboButtonLabel(const MSString& label_) { _buttonLabel = label_; if(_buttonLabel == "") unsetBit(TextButton); else setBit(TextButton); placement(); } void MSEntryFieldCombo::buttonPress(const XEvent *pEvent_) { if (sensitive()==MSTrue) { if(pEvent_->xbutton.x<_fieldValue->x()+_fieldValue->width()) { MSEntryField::buttonPress(pEvent_); } else { activate(); if (_editor->mapped()==MSFalse) { MSBoolean focusOK=MSTrue; if (acceptFocus()==MSTrue) focusOK=traverseFocus(this); if (focusOK==MSTrue) { if (pEvent_->xbutton.button==Button1&&_buttonFlags!=0) { if (comboOrTextButton()==MSTrue&& pEvent_->xbutton.x>=buttonRect().x()&& pEvent_->xbutton.y>=buttonRect().y()) { if(buttonState(ComboButton) == MSTrue) { buttonActivate(); } else { drawTextButton(MSTrue); _buttonSelected = MSTrue; } } else if(buttonState(UpDownArrows) == MSTrue) { if (isProtected()==MSFalse) { if(pEvent_->xbutton.y <_fieldValue->y() +_fieldValue->height()/2) armUpArrow(); else armDownArrow(); } } } } } } } } void MSEntryFieldCombo::buttonRelease(const XEvent *pEvent_) { if (buttonState(UpDownArrows)==MSTrue&& (_upArrow->selected()==MSTrue||_downArrow->selected()==MSTrue)) { if (_upArrow->selected()) _upArrow->select(MSFalse); else if (_downArrow->selected()) _downArrow->select(MSFalse); stopTimers(); } else if(comboOrTextButton()==MSTrue&&_buttonSelected==MSTrue) { _buttonSelected=MSFalse; drawTextButton(MSFalse); if(pEvent_->xbutton.x >= buttonRect().x()&& pEvent_->xbutton.x <= buttonRect().x() + buttonRect().width()&& pEvent_->xbutton.y >= buttonRect().y() && pEvent_->xbutton.y <= buttonRect().y() + buttonRect().height()) { textButtonActivate(); } } else MSEntryField::buttonRelease(pEvent_); } void MSEntryFieldCombo::armUpArrow(void) { _upArrow->select(MSTrue); increment(); startDelayTimer(Up); } void MSEntryFieldCombo::armDownArrow(void) { _downArrow->select(MSTrue); decrement(); startDelayTimer(Down); } void MSEntryFieldCombo::drawArrows(void) { _upArrow->draw(); _downArrow->draw(); } void MSEntryFieldCombo::drawTextButton(MSBoolean armed_) { if(frozen()==MSFalse&&mapped()==MSTrue) { drawBevel(buttonRect(),(armed_==MSTrue)?MSSunken:MSRaised,2); XFillRectangle(display(),window(), (armed_==MSTrue)?selectShadowGC():backgroundShadowGC(), buttonRect().x()+2,buttonRect().y()+2, buttonRect().width()-4,buttonRect().height()-4); int offset = 2 + 1; int x = buttonRect().x() + offset; int y = buttonRect().y() + 2; XDrawString(display(), window(), fieldValue()->textGC(), fieldValue()->textFontStruct(), x, y + fieldValue()->textAscent(), comboButtonLabel().string(), comboButtonLabel().length()); } } void MSEntryFieldCombo::drawComboButton(MSBoolean armed_) { if (frozen()==MSFalse&&mapped()==MSTrue) { drawBevel(buttonRect(),(armed_==MSTrue)?MSSunken:MSRaised,2); XFillRectangle(display(),window(), (armed_==MSTrue)?selectShadowGC():backgroundShadowGC(), buttonRect().x()+2,buttonRect().y()+2, buttonRect().width()-4,buttonRect().height()-4); int mw=buttonRect().width()>>1; // x midpoint of button int mh=buttonRect().height()>>1; // y midpoint of button int xoff=buttonRect().x(); int yoff=buttonRect().y(); int ah = _fieldValue->height()/2; int aw = _fieldValue->textHeight(); _comboArrow->configure(xoff+mw-aw/2, yoff+mh-ah/2, aw, ah); _comboArrow->select(armed_); _comboArrow->draw(); } } void MSEntryFieldCombo::redraw(void) { if (frozen()==MSFalse&&mapped()==MSTrue) { drawBackground(); drawFieldLabel(); drawFieldValue(); if (buttonState(UpDownArrows)==MSTrue) drawArrows(); if (buttonState(ComboButton) ==MSTrue) drawComboButton(MSFalse); else if(buttonState(TextButton)==MSTrue) drawTextButton(_buttonSelected); drawShadow(); if (highlighted()==MSTrue) drawHighlight(); } } unsigned MSEntryFieldCombo::computeDecorPixelWidth(void) { unsigned width = 0; if (buttonState(UpDownArrows) == MSTrue) { width = computeArrowPixelWidth(); if (comboOrTextButton() == MSTrue) width += computeButtonPixelWidth() + buttonSpacing(); } else if(comboOrTextButton() == MSTrue) width = computeButtonPixelWidth(); return width; } unsigned MSEntryFieldCombo::computeValuePixelWidth(void) { if (_buttonFlags == 0) return (MSEntryField::computeValuePixelWidth()); else return valueWidth()*_fieldValue->charWidth()+2*_fieldValue->offset()+ computeDecorPixelWidth()+buttonSpacing(); } unsigned MSEntryFieldCombo::computeArrowPixelWidth(void) { return _fieldValue->textHeight(); } unsigned MSEntryFieldCombo::computeButtonPixelWidth(void) { if (buttonState(ComboButton) == MSTrue) { return _fieldValue->textHeight(); } else // textButton { int offset = 6; return fieldValue()->textWidth(comboButtonLabel().string(), comboButtonLabel().length()) + offset; } } void MSEntryFieldCombo::placement(void) { if (_buttonFlags == 0) MSEntryField::placement(); else if (_fieldValue!=0&&_fieldLabel!=0) { if (_editor->mapped()==MSTrue) unmapEditor(); if(buttonState(UpDownArrows) == MSTrue) { _upArrow->width(computeArrowPixelWidth()); _downArrow->width(computeArrowPixelWidth()); } if (comboOrTextButton() == MSTrue) { buttonRect().width(computeButtonPixelWidth()); } int extraWidth = computeDecorPixelWidth(); int offset=highlightThickness()+shadowThickness(); int offset2=offset<<1; int vh=_fieldValue->textHeight()+ 2*(marginHeight()+_fieldValue->shadowThickness()+_fieldValue->highlightThickness()); int lh=_fieldLabel->textHeight()+ 2*(_fieldLabel->shadowThickness()+_fieldLabel->highlightThickness()); int lw=_fieldLabel->width(); int vw=_fieldValue->width(); int trueWidth=width()-offset2-extraWidth-int(buttonSpacing()); int h; if (labelAlignment()==MSTop) { vw+=buttonSpacing()+extraWidth; _fieldLabel->moveTo(offset,offset); _fieldValue->moveTo(offset,offset+lh+labelSpacing()); _fieldLabel->width(lw); _fieldValue->width(trueWidth); } else { vw=trueWidth-_fieldLabel->width(); h=(vh>lh)?vh:lh; if (vh==lh) height(h+offset2); else if (h+offset2>height()) height(h+offset2); _fieldLabel->height(h); _fieldValue->resize(vw,h); _fieldLabel->moveTo(offset,offset); _fieldValue->moveTo(offset+_fieldLabel->width(),offset); } int xPos = fieldValue()->x() + fieldValue()->width(); if(buttonState(UpDownArrows) == MSTrue) { _upArrow->configure(xPos+buttonSpacing(), _fieldValue->y(),computeArrowPixelWidth(), _fieldValue->height()/2); _downArrow->configure(xPos+buttonSpacing(), _fieldValue->y()+_fieldValue->height()/2, computeArrowPixelWidth(), _fieldValue->height()/2); xPos +=computeArrowPixelWidth() +buttonSpacing(); } if(comboOrTextButton() == MSTrue) { buttonRect().configuration(xPos+buttonSpacing(), fieldValue()->y(), computeButtonPixelWidth(), fieldValue()->height()); } redraw(); } } void MSEntryFieldCombo::labelPixelWidth(unsigned labelPixelWidth_) { if (_fieldLabel!=0) { if (_fieldLabel->length()==0) labelPixelWidth_=0; if (_fieldLabel->width()!=labelPixelWidth_) { int offset=highlightThickness()+shadowThickness(); if (labelAlignment()==MSTop) { unsigned lh=_fieldLabel->textHeight()+ 2*(_fieldLabel->shadowThickness()+_fieldLabel->highlightThickness()); _fieldLabel->moveTo(offset,offset); _fieldValue->moveTo(offset,offset+lh); _fieldLabel->width(labelPixelWidth_); int vw=width()-2*offset; if (_buttonFlags != 0) { vw-=(computeDecorPixelWidth()+buttonSpacing()); } _fieldValue->width(vw); } else { int trueWidth=width()-2*offset; int vw=trueWidth-int(labelPixelWidth_); if (_buttonFlags != 0) { vw-=(computeDecorPixelWidth()+buttonSpacing()); } _fieldLabel->width(labelPixelWidth_); _fieldValue->width(vw); _fieldLabel->moveTo(offset,offset); _fieldValue->moveTo(offset+labelPixelWidth_,offset); } redraw(); } } } void MSEntryFieldCombo::reference(void) { if(buttonState(ComboButton) == MSTrue) buttonActivate(); else MSEntryField::reference(); } void MSEntryFieldCombo::startDelayTimer(TimerDirection dir_) { if (_delayTimer!=0) { _delayTimer->stop(); _delayTimer=0; } _delayTimer=new DelayTimer(this,MSEntryFieldComboInitialDelay,dir_); } void MSEntryFieldCombo::processDelayTimer(void) { startRepeatTimer(_delayTimer->direction()); _delayTimer=0; } void MSEntryFieldCombo::startRepeatTimer(TimerDirection dir_) { if (_repeatTimer==0) _repeatTimer=new RepeatTimer(this,MSEntryFieldComboRepeatInterval,dir_); else { _repeatTimer->direction(dir_); _repeatTimer->reset(); } } void MSEntryFieldCombo::stopTimers(void) { if(_delayTimer!=0) { _delayTimer->stop(); _delayTimer=0; } if (_repeatTimer!=0) _repeatTimer->stop(); } // ################################################################## // inline methods // ################################################################## unsigned MSEntryFieldCombo::buttonSpacing(void) const { return _buttonSpacing; } MSArrow *MSEntryFieldCombo::upArrow(void) { return _upArrow; } MSArrow *MSEntryFieldCombo::downArrow(void) { return _downArrow; } MSRect& MSEntryFieldCombo::buttonRect(void) { return _buttonRect; } MSEntryFieldCombo::RepeatTimer *MSEntryFieldCombo::repeatTimer(void) { return _repeatTimer; } MSBoolean MSEntryFieldCombo::bitState(unsigned flag_) const { return (_buttonFlags&flag_)?MSTrue:MSFalse; } void MSEntryFieldCombo::setBit(ButtonFlag flag_) { _buttonFlags|=flag_; } void MSEntryFieldCombo::unsetBit(ButtonFlag flag_) { _buttonFlags&=~flag_; } MSBoolean MSEntryFieldCombo::buttonState(ButtonFlag flag_) const { return (_buttonFlags&flag_)?MSTrue:MSFalse; } MSBoolean MSEntryFieldCombo::comboOrTextButton(void) const { return bitState(ComboButton|TextButton); } void MSEntryFieldCombo::buttonActivate(void) {} void MSEntryFieldCombo::textButtonActivate(void) {} void MSEntryFieldCombo::down(void) { if (buttonState(ComboButton) == MSTrue) buttonActivate(); } void MSEntryFieldCombo::up(void) { if (buttonState(ComboButton) == MSTrue) buttonActivate(); } void MSEntryFieldCombo::buttonSpacing(unsigned buttonSpacing_) { _buttonSpacing = buttonSpacing_; } const MSString& MSEntryFieldCombo::comboButtonLabel(void) const { return _buttonLabel; } aplus-fsf-4.22/src/MSGUI/MSEntryFieldPlus.C0000644000265000001440000000523310772770403013760 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include const MSSymbol MSEntryFieldPlus::buttonactivate = MSSymbol("buttonactivate"); // ################################################################## // MSEntryFieldPlus // ################################################################## MSEntryFieldPlus::MSEntryFieldPlus(MSWidget *owner_,const MSSymbol& tag_): MSEntryFieldCombo(owner_,tag_) { init(); } MSEntryFieldPlus::MSEntryFieldPlus(MSWidget *owner_,const char *label_,const MSSymbol& tag_): MSEntryFieldCombo(owner_,label_,tag_) { init(); } void MSEntryFieldPlus::init(void) {} MSEntryFieldPlus::~MSEntryFieldPlus(void) {} void MSEntryFieldPlus::arrowButtons(MSBoolean arrowButtons_) { buttonState(UpDownArrows, arrowButtons_); } MSBoolean MSEntryFieldPlus::arrowButtons(void) const { return buttonState(UpDownArrows); } void MSEntryFieldPlus::textButtonActivate(void) { activateCallback(MSEntryFieldPlus::buttonactivate); } void MSEntryFieldPlus::buttonLabel(const MSString& label_) { comboButtonLabel(label_); } const MSString& MSEntryFieldPlus::buttonLabel(void) const { return comboButtonLabel(); } void MSEntryFieldPlus::arrowColor(const char * color_) { buttonColor(UpDownArrows, color_); } void MSEntryFieldPlus::arrowColor(unsigned long color_) { buttonColor(UpDownArrows, color_); } unsigned long MSEntryFieldPlus::arrowColor(void) { return buttonColor(UpDownArrows); } void MSEntryFieldPlus::set(MSAttrValueList& avList_) { MSEntryFieldCombo::set(avList_); MSIndexVector index; for (unsigned i=0;icolorName(arrowColor()), MSAttrValue::Color); avList_< MSFloatArrayView::MSFloatArrayView(MSWidget *owner_,const char *title_) : MSNumericArrayView(owner_,title_) {} MSFloatArrayView::MSFloatArrayView(MSWidget *owner_,const MSStringVector& title_) : MSNumericArrayView(owner_,title_) {} MSFloatArrayView::MSFloatArrayView(MSWidget *owner_,MSFloatVector& model_,const char *title_) : MSNumericArrayView(owner_,title_) { model(model_); } MSFloatArrayView::MSFloatArrayView(MSWidget *owner_,MSFloatVector& model_,const MSStringVector& title_) : MSNumericArrayView(owner_,title_) { model(model_); } MSFloatArrayView::~MSFloatArrayView(void) {} void MSFloatArrayView::model(MSFloatVector& model_) { couple(&model_); } void MSFloatArrayView::model(const MSFloatVector& model_) { constCouple(&model_); } void MSFloatArrayView::array(const MSFloatVector& aVector_) { if (MSView::model()!=0) array()=aVector_; } MSBoolean MSFloatArrayView::validate(const char *pString_,unsigned row_,unsigned) { return (MSView::model()!=0)?((array().set(row_,pString_)==MSError::MSSuccess)?MSTrue:MSFalse):MSTrue; } const char *MSFloatArrayView::formatOutput(MSString &buffer_,unsigned row_,unsigned) { if (MSView::model()!=0) formatValue(buffer_,array()(row_)); return buffer_.string(); } unsigned MSFloatArrayView::numColumns(void) const { return 1; } unsigned MSFloatArrayView::numRows(void) const { return (MSView::model()!=0)?array().length():0; } void MSFloatArrayView::moveRow(int from_, int to_) { if(MSView::model()!=0) { MSFloatVector& vectorModel = array(); double item = vectorModel(from_); vectorModel.removeAt(from_); if (to_>=vectorModel.length()) vectorModel.append(item); else vectorModel.insertAt(to_,item); } } aplus-fsf-4.22/src/MSGUI/MSFloatEntryField.C0000644000265000001440000000454310772770403014105 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #if defined(MSTK_MANUAL_INSTANTIATION) #include #if defined(MS_XLC_TEMPLATE_INSTANTIATION) #pragma define (MSTypeEntryField) #endif #if defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma instantiate MSTypeEntryField #endif #if defined(MS_STD_TEMPLATE_INSTANTIATION) template class MSTypeEntryField; #endif #if defined(MS_VC_TEMPLATE_INSTANTIATION) template MSTypeEntryField; #endif #endif //MSTK_MANUAL_INSTANTIATION MSFloatEntryField::MSFloatEntryField(MSWidget *owner_, const char *label_,const MSSymbol& tag_) : MSTypeEntryField(owner_,label_,tag_) { init(); } MSFloatEntryField::MSFloatEntryField(MSWidget *owner_,MSFloat& model_, const char *label_,const MSSymbol& tag_) : MSTypeEntryField(owner_,model_,label_,tag_) { init(); } MSFloatEntryField::~MSFloatEntryField(void) {} void MSFloatEntryField::init(void) { _format=MSFormat(MSFloat::Decimal2), _incrementValue=1.0; _clipMode=MSClipIndicator; } void MSFloatEntryField::increment(void) { if (MSView::model()!=0) { if (value() <= DBL_MAX - incrementValue()) // prevent overflow { if (maximumValue().isSet()==MSTrue) { double anFloat=value(); anFloat+=incrementValue(); if (anFloat<=maximumValue()) { value()=anFloat; valueChange(); } } else { value()+=incrementValue(); valueChange(); } } } } void MSFloatEntryField::decrement(void) { if (MSView::model()!=0) { if (value() >= -DBL_MAX + incrementValue()) // prevent underflow { if (minimumValue().isSet()==MSTrue) { double anFloat=value(); anFloat-=incrementValue(); if (anFloat>=minimumValue()) { value()=anFloat; valueChange(); } } else { value()-=incrementValue(); valueChange(); } } } } aplus-fsf-4.22/src/MSGUI/MSFloatMatrixTraceSet.C0000644000265000001440000000556510772770403014744 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include MSFloatMatrixTraceSet::MSFloatMatrixTraceSet(MSGraph *owner_,const char *legends_,const MSSymbol& tag_): MSTraceSet(owner_,legends_,tag_) { format(MSFormat(MSFloat::Decimal2)); } MSFloatMatrixTraceSet::MSFloatMatrixTraceSet(MSGraph *owner_,const MSStringVector& legends_,const MSSymbol& tag_): MSTraceSet(owner_,legends_,tag_) { format(MSFormat(MSFloat::Decimal2)); } MSFloatMatrixTraceSet::MSFloatMatrixTraceSet(MSGraph *owner_,MSFloatMatrix& m_,const char *legends_,const MSSymbol& tag_): MSTraceSet(owner_,legends_,tag_) { format(MSFormat(MSFloat::Decimal2)); model(m_); } MSFloatMatrixTraceSet::MSFloatMatrixTraceSet(MSGraph *owner_,MSFloatMatrix& m_,const MSStringVector& legends_,const MSSymbol& tag_): MSTraceSet(owner_,legends_,tag_) { format(MSFormat(MSFloat::Decimal2)); model(m_); } MSFloatMatrixTraceSet::~MSFloatMatrixTraceSet(void) {} int MSFloatMatrixTraceSet::dataCount(void) const { return MSView::model()!=0?matrix().rows():0; } double MSFloatMatrixTraceSet::x(int i_) const { return MSView::model()!=0?matrix()(i_,0):0.0; } double MSFloatMatrixTraceSet::y(int r_,int c_) const { return MSView::model()!=0?matrix()(r_,c_+1):0.0; } void MSFloatMatrixTraceSet::model(MSFloatMatrix& model_) { couple(&model_); } void MSFloatMatrixTraceSet::model(const MSFloatMatrix& model_) { constCouple(&model_); } int MSFloatMatrixTraceSet::numColumns(void) const { return MSView::model()!=0?matrix().columns()>1?matrix().columns():0:0; } void MSFloatMatrixTraceSet::validate(int r_,int c_,double x_,double y_) { if (MSView::model()!=0) { if (constraint()!=HoldX) matrix()(r_,0)=x_; matrix()(r_,c_+1)=y_; } } const char *MSFloatMatrixTraceSet::formatOutput(MSString &buffer_,unsigned row_,unsigned col_) { if (MSView::model()!=0) { MSFloat aFloat(matrix()(row_,col_)); aFloat.format(buffer_,format()); } return buffer_.string(); } MSBoolean MSFloatMatrixTraceSet::moveTraceValidate(double xOffset_,double yOffset_) { if (MSView::model()!=0) { MSFloatMatrix& fm=matrix(); MSFloatVector fv(fm.columnAt(0)); fm-=yOffset_; fv+=xOffset_; fm.assignColumn(0,fv); return MSTrue; } return MSFalse; } MSTraceSet* MSFloatMatrixTraceSet::copyTraceValidate(MSGraph * owner_,const char *legends_,const MSSymbol& tag_) { MSFloatMatrix* model=(MSFloatMatrix*)matrix().clone(); MSFloatMatrixTraceSet* ts=new MSFloatMatrixTraceSet(owner_,*model,legends_,tag_); ts->internalModel(MSTrue); return ts; } MSFloatMatrix MSFloatMatrixTraceSet::asFloatMatrix(void) const { return matrix(); } aplus-fsf-4.22/src/MSGUI/MSFloatMatrixView.C0000644000265000001440000000427010772770403014134 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include MSFloatMatrixView::MSFloatMatrixView(MSWidget *owner_,const char *title_) : MSNumericArrayView(owner_,title_) {} MSFloatMatrixView::MSFloatMatrixView(MSWidget *owner_,const MSStringVector& title_) : MSNumericArrayView(owner_,title_) {} MSFloatMatrixView::MSFloatMatrixView(MSWidget *owner_,MSFloatMatrix& model_,const char *title_) : MSNumericArrayView(owner_,title_) { model(model_); } MSFloatMatrixView::MSFloatMatrixView(MSWidget *owner_,MSFloatMatrix& model_,const MSStringVector& title_) : MSNumericArrayView(owner_,title_) { model(model_); } MSFloatMatrixView::~MSFloatMatrixView(void) {} void MSFloatMatrixView::model(MSFloatMatrix& model_) { couple(&model_); } void MSFloatMatrixView::model(const MSFloatMatrix& model_) { constCouple(&model_); } void MSFloatMatrixView::matrix(const MSFloatMatrix& aMatrix_) { if (MSView::model()!=0) matrix()=aMatrix_; } MSBoolean MSFloatMatrixView::validate(const char *pString_,unsigned row_,unsigned column_) { if (MSView::model()!=0) { unsigned ravelIndex=matrix().index(row_,column_); return (matrix().set(ravelIndex,pString_)==MSError::MSSuccess)?MSTrue:MSFalse; } return MSTrue; } const char *MSFloatMatrixView::formatOutput(MSString &buffer_,unsigned row_,unsigned column_) { if (MSView::model()!=0) formatValue(buffer_,matrix()(row_,column_)); return buffer_.string(); } unsigned MSFloatMatrixView::numColumns(void) const { return (MSView::model()!=0)?matrix().columns():0; } unsigned MSFloatMatrixView::numRows(void) const { return (MSView::model()!=0)?matrix().rows():0; } void MSFloatMatrixView::moveRow(int from_, int to_) { if(MSView::model()!=0) { MSFloatMatrix& matrixModel = matrix(); MSFloatVector vector = matrixModel.rowAt(from_); matrixModel.removeRow(from_); if (to_>=matrixModel.rows()) matrixModel.appendRow(vector); else matrixModel.insertRowBefore(to_,vector); } } aplus-fsf-4.22/src/MSGUI/MSFloatTableColumn.C0000644000265000001440000001477210772770403014252 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include MSFloatTableColumn::MSFloatTableColumn(MSReportTable *owner_,const char *heading_,const MSSymbol& tag_) : MSTableColumn(owner_,heading_,tag_) { _format=MSFormat(MSFloat::Decimal2); _clipMode=MSClipStars; _valueQuoted=MSFalse; } MSFloatTableColumn::MSFloatTableColumn(MSReportTable *owner_,const MSStringVector& heading_,const MSSymbol& tag_) : MSTableColumn(owner_,heading_,tag_) { _format=MSFormat(MSFloat::Decimal2); _clipMode=MSClipStars; _valueQuoted=MSFalse; } MSFloatTableColumn::MSFloatTableColumn(MSReportTable *owner_,MSFloatVector& model_, const char *heading_,const MSSymbol& tag_) : MSTableColumn(owner_,heading_,tag_) { _format=MSFormat(MSFloat::Decimal2); _clipMode=MSClipStars; _valueQuoted=MSFalse; model(model_); } MSFloatTableColumn::MSFloatTableColumn(MSReportTable *owner_,MSFloatVector& model_, const MSStringVector& heading_,const MSSymbol& tag_) : MSTableColumn(owner_,heading_,tag_) { _format=MSFormat(MSFloat::Decimal2); _clipMode=MSClipStars; _valueQuoted=MSFalse; model(model_); } MSFloatTableColumn::~MSFloatTableColumn(void) {} void MSFloatTableColumn::model(MSFloatVector& model_) { couple(&model_); } void MSFloatTableColumn::model(const MSFloatVector& model_) { constCouple(&model_); } void MSFloatTableColumn::vector(const MSFloatVector& aVector_) { if (MSView::model()!=0) vector()=aVector_; } unsigned MSFloatTableColumn::numRows(void) const { return (MSView::model()!=0)?vector().length():0; } MSBoolean MSFloatTableColumn::isDuplicate(unsigned row_) { return (MSView::model()!=0&&row_!=0)?vector()(row_)==vector()(row_-1)?MSTrue:MSFalse:MSFalse;} MSBoolean MSFloatTableColumn::breakCriteria(unsigned row_) { return (MSView::model()!=0&&row_!=0)?row_==vector().length()|| vector()(row_)!=vector()(row_-1)?MSTrue:MSFalse:MSFalse; } MSBoolean MSFloatTableColumn::validate(const char *pString_,unsigned row_) { if (MSView::model()!=0) { MSFloat aFloat; if (aFloat.set(pString_)==MSError::MSSuccess) { vector().set(row_,aFloat); return MSTrue; } } return MSFalse; } const char *MSFloatTableColumn::formatOutput(MSString &buffer_,unsigned row_) { if (MSView::model()!=0) { MSFloat aFloat(vector()(row_)); aFloat.format(buffer_,format()); } return buffer_.string(); } // report methods void MSFloatTableColumn::breakProcess(MSIndexVector& i_) { MSString buffer; MSFloat aFloat(MSIndexedFunctions::computeIndexedFunction(vector(),weights(),i_,breakProcessMode())); breakString()<gradeUp(); else return MSIndexVector::nullVector(); } MSIndexVector MSFloatTableColumn::gradeDown(void) const { if (MSView::model()!=0) return ((MSFloatVector *)_model)->gradeDown(); else return MSIndexVector::nullVector(); } void MSFloatTableColumn::permute(const MSIndexVector &indexVector_) { if (MSView::model()!=0) ((MSFloatVector *)_model)->permute(indexVector_); } void MSFloatTableColumn::range(MSIndexVector &start_,MSIndexVector &end_) { if (MSView::model()!=0&&start_.length()>0&&start_.length()==end_.length()) { MSIndexVector Start=start_,End=end_; MSFloatVector &vector=*(MSFloatVector *)_model; start_.removeAll(); end_.removeAll(); for (unsigned i=0;i0&&start_.length()==end_.length()) { MSFloatVector &vector=*(MSFloatVector *)_model; MSIndexVector index(vector.length()); for (unsigned i=0;i0&&start_.length()==end_.length()) { MSFloatVector &vector=*(MSFloatVector *)_model; MSIndexVector index(vector.length()); for (unsigned i=0;i=vectorModel.length()) vectorModel.append(item); else vectorModel.insertAt(to_,item); } else { vectorModel.insertAt(to_,item); } } } aplus-fsf-4.22/src/MSGUI/MSFloatVectorTraceSet.C0000644000265000001440000000556110772770403014736 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include MSFloatVectorTraceSet::MSFloatVectorTraceSet(MSGraph *owner_,const char *legends_,const MSSymbol& tag_): MSTraceSet(owner_,legends_,tag_) { format(MSFormat(MSFloat::Decimal2)); } MSFloatVectorTraceSet::MSFloatVectorTraceSet(MSGraph *owner_,const MSStringVector& legends_,const MSSymbol& tag_): MSTraceSet(owner_,legends_,tag_) { format(MSFormat(MSFloat::Decimal2)); } MSFloatVectorTraceSet::MSFloatVectorTraceSet(MSGraph *owner_,MSFloatVector& m_,const char *legends_,const MSSymbol& tag_): MSTraceSet(owner_,legends_,tag_) { format(MSFormat(MSFloat::Decimal2)); model(m_); } MSFloatVectorTraceSet::MSFloatVectorTraceSet(MSGraph *owner_,MSFloatVector& m_,const MSStringVector& legends_,const MSSymbol& tag_): MSTraceSet(owner_,legends_,tag_) { format(MSFormat(MSFloat::Decimal2)); model(m_); } MSFloatVectorTraceSet::~MSFloatVectorTraceSet(void) {} int MSFloatVectorTraceSet::dataCount(void) const { return MSView::model()!=0?vector().length():0; } double MSFloatVectorTraceSet::y(int i_,int) const { return MSView::model()!=0?vector()(i_):0; } void MSFloatVectorTraceSet::validate(int r_,int,double,double y_) { if (MSView::model()!=0) vector().set(r_,y_); } void MSFloatVectorTraceSet::model(MSFloatVector& model_) { couple(&model_); } void MSFloatVectorTraceSet::model(const MSFloatVector& model_) { constCouple(&model_); } void MSFloatVectorTraceSet::selectable(MSBoolean x_) { MSTraceSet::selectable(x_); } MSBoolean MSFloatVectorTraceSet::selectable(void) const { return MSTraceSet::selectable(); } void MSFloatVectorTraceSet::constraint(unsigned long x_) { MSTraceSet::constraint(x_&HoldX); } unsigned long MSFloatVectorTraceSet::constraint(void) const { return MSTraceSet::constraint(); } const char *MSFloatVectorTraceSet::formatOutput(MSString &buffer_,unsigned row_,unsigned) { if (MSView::model()!=0) { MSFloat aFloat(vector()(row_)); aFloat.format(buffer_,format()); } return buffer_.string(); } MSBoolean MSFloatVectorTraceSet::moveTraceValidate(double,double yOffset_) { if (MSView::model()!=0) { vector()-=yOffset_; return MSTrue; } return MSFalse; } MSTraceSet* MSFloatVectorTraceSet::copyTraceValidate(MSGraph * owner_,const char *legends_,const MSSymbol& tag_) { MSFloatVector* model=(MSFloatVector*)vector().clone(); MSFloatVectorTraceSet* ts=new MSFloatVectorTraceSet(owner_,*model,legends_,tag_); ts->internalModel(MSTrue); return ts; } MSFloatMatrix MSFloatVectorTraceSet::asFloatMatrix(void) const { MSFloatMatrix fm(vector().length(),0); fm.appendColumn(vector()); return fm; } aplus-fsf-4.22/src/MSGUI/MSFontManager.C0000644000265000001440000001377010772770403013255 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include static const double MMPerInch=25.4; static const int DefaulFontSize=12; static const int MSFontManagerTableSize=256; extern const char *MSAltDefaultFont; extern Font MSDefaultFontID; class MSFontConverter { public: static MSString isoName(MSDisplayServer *server_,const char *name_); }; class MSFontData { public: MSFontData(MSDisplayServer *server_,const char *fontString_,XFontStruct *fontStruct_); ~MSFontData(void); MSDisplayServer *_server; MSString _fontString; XFontStruct *_fontStruct; MSDisplayServer *server(void) const {return _server;} const char *fontString(void) const {return _fontString.string();} XFontStruct *fontStruct(void) const {return _fontStruct;} }; MSFontHashTable::MSFontHashTable(void) : MSHashTable() {} MSFontHashTable::MSFontHashTable(int size_) : MSHashTable(size_) {} // need to delete the font data structures that are stored as // data in the hash table MSFontHashTable::~MSFontHashTable(void) { for (int i=0;inext(); data=(MSFontData *) entry->value(); if (data!=0) delete data; delete entry; entry=bucket(i); } } } MSFontData::MSFontData(MSDisplayServer *server_,const char *fontString_,XFontStruct *fontStruct_) { _server=server_; _fontString=fontString_; _fontStruct=fontStruct_; } MSFontData::~MSFontData(void) { if (fontStruct()!=0) XFreeFontInfo(0,_fontStruct,1); } MSFontManager::MSFontManager(MSDisplayServer& server_) : _fontIDHashTable(MSFontManagerTableSize),_fontDataHashTable(MSFontManagerTableSize) { _server=&server_; init(); } MSFontManager::~MSFontManager(void) {} void MSFontManager::init(void) { fontIDHashTable().notFound(0x55FF); fontDataHashTable().notFound(0x0); addFont(MSDefaultFont); addFont(MSAltDefaultFont); _defaultFontID=fontID(MSDefaultFont); MSDefaultFontID=defaultFontID(); } void MSFontManager::addFont(const char *fontString_) { Font fontID=0; if (fontString_!=0&&server()!=0) { XFontStruct *nfs=XLoadQueryFont(display(),fontString_); if (nfs==0) { MSString isoName(MSFontConverter::isoName(server(),fontString_)); if (isoName.length()>0&&isoName!=fontString_) nfs=XLoadQueryFont(display(),isoName.string()); if (nfs==0) { MSMessageLog::warningMessage("Warning - loading font '%s' failed - not available on this system.\n", fontString_); return; } else fontID=XLoadFont(display(),isoName.string()); } else fontID=XLoadFont(display(),fontString_); if (nfs!=0&&fontID!=0) { MSFontData *data=0; if (fontID!=0) { if ((Font)fontIDHashTable().lookup(fontString_)==(Font)fontIDHashTable().notFound()) { fontIDHashTable().add(fontString_,(void *)fontID); } if ((MSFontData *)fontDataHashTable().lookup(fontID)==(MSFontData *)fontDataHashTable().notFound()) { data=new MSFontData(server(),fontString_,nfs); fontDataHashTable().add(fontID,(void *)data); } } if (data==0) XFreeFontInfo(NULL,nfs,1); } } } // get a font id from the hash table // 1. if not already in the hash table,then // a. get the defaultfont // b. if the defaultfont was not loaded-because it doesn't exist on // this system,then use the alternate default,which should be // on every system Font MSFontManager::fontID(const char *fontString_) { Font fontID=(Font)fontIDHashTable().lookup(fontString_); if (fontID==fontIDHashTable().notFound()) { addFont(fontString_); fontID=(Font) fontIDHashTable().lookup(fontString_); if (fontID==fontIDHashTable().notFound()) { fontID=(Font)fontIDHashTable().lookup(MSDefaultFont); // default if notFound if (fontID==fontIDHashTable().notFound()) { fontID=(Font)fontIDHashTable().lookup(MSAltDefaultFont); // alternate default } } } return fontID; } const char *MSFontManager::fontName(Font fontID_) const { MSFontData *data=(MSFontData *)fontDataHashTable().lookup(fontID_); return (char *)(data!=0)?data->fontString():0; } const XFontStruct *MSFontManager::fontStruct(Font fontID_) const { MSFontData *data=(MSFontData *)fontDataHashTable().lookup(fontID_); return (XFontStruct *)(data!=0)?data->fontStruct():0; } MSString MSFontConverter::isoName(MSDisplayServer *server_,const char *name_) { if (name_[0]=='-') return MSString(name_); else { char *pString=strchr((char*)(void*)name_,'-'); // cast: bug in Borland int i,count=0; int len,size=DefaulFontSize; MSString family; MSString weight("*"); if (pString==0) family=name_; else { len=(pString-(char *)name_); family=MSString(name_,len); for (i=0;name_[i]!='\0';i++) if (name_[i]=='-') count++; if (count==1) { if (pString[1]>='1'&&pString[1]<='9') sscanf(pString+1,"%d",&size); else weight=(pString+1); } else if (count==2) { char *cpnext=strchr(pString+1,'-'); len=cpnext-(pString+1); weight=MSString(pString+1,len); if (cpnext[1]>='1'&&cpnext[1]<='9') sscanf(cpnext+1,"%d",&size); } } int res_x=(int)(server_->width()/(server_->widthMM()/MMPerInch)); int res_y=(int)(server_->height()/(server_->heightMM()/MMPerInch)); char *buf=new char[50+family.length()+weight.length()]; sprintf(buf,"-*-%s-%s-r-*-*-*-%d-%d-%d-*-*-iso8859-1", family.string(),weight.string(),size*10,res_x,res_y); MSString name(buf); delete [] buf; return name; } } aplus-fsf-4.22/src/MSGUI/MSFontObject.C0000644000265000001440000000072510772770403013105 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include MSFontObject::MSFontObject(const XFontStruct *pFontStruct_) : _fontStruct(pFontStruct_) {} MSFontObject::~MSFontObject(void) { _fontStruct=0; } aplus-fsf-4.22/src/MSGUI/MSGC.C0000644000265000001440000003523110772770403011341 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include MSGC::List MSGC::_xgcList(64); #ifdef MS_MULTI_THREAD MSMutex MSGC::_msgcHashTableMutex; #endif MSGC::Data::Data(MSDisplayServer *server_,MSBoolean shared_,GC gc_,unsigned long mask_) { _server=server_; _shared=shared_; _gc=gc_; _mask=mask_; _dashes=0; _nDashes=0; // We want to get all the values here unsigned long allGCValues=GCFunction|GCPlaneMask|GCForeground|GCBackground|GCLineWidth|GCLineStyle|GCCapStyle|GCJoinStyle|GCFillStyle|GCFillRule|GCTile|GCStipple|GCTileStipXOrigin|GCTileStipYOrigin|GCFont|GCSubwindowMode|GCGraphicsExposures|GCClipXOrigin|GCClipYOrigin|GCDashOffset|GCArcMode; XGetGCValues(_server->display(),_gc,allGCValues,&_values); _count = 0; } MSGC::Data::~Data(void) { if (_dashes!=0) delete [] _dashes; if (_gc!=0) XFreeGC(display(),_gc); } void MSGC::Data::mask(unsigned long mask_) { _mask=mask_; XGetGCValues(_server->display(),_gc,_mask,&_values); } void MSGC::Data::dashes(const char *dashes_,int n_) { if (dashes_!=0) { if (dashes()!=0) delete [] _dashes; _dashes=new char[n_+1]; strncpy(_dashes,(char *)dashes_,n_); _dashes[n_]='\0'; _nDashes=n_; } } MSGC::List::List(int size_) { _size=size_; _count=0; _array=new Data*[size()]; for (int i=0;ishared() == MSTrue) { _data = msgc_._data; _data->increment(); } else create(MSFalse, (XGCValues *)&msgc_.values(), msgc_.mask()); } MSGC::~MSGC(void) { MSGUARD(_msgcHashTableMutex); clearData(); } void MSGC::setGCValues(MSDisplayServer * server_, MSBoolean shared_, XGCValues *values_,unsigned long mask_) { _server = server_; if (shared_ == MSTrue) setData(values_, mask_); else { MSGUARD(_msgcHashTableMutex); create(MSFalse, values_, mask_); } } MSBoolean MSGC::isValid(void) { return MSBoolean(_server != 0); } MSGC& MSGC::operator=(const MSGC& msgc_) { if(this != &msgc_) { MSGUARD(_msgcHashTableMutex); clearData(); _server = msgc_._server; if(msgc_._data->shared() == MSTrue) { _data = msgc_._data; _data->increment(); } else create(MSFalse, (XGCValues *)&msgc_.values(), msgc_.mask()); } return *this; } // for shared gcs only void MSGC::setData(XGCValues *values_,unsigned long mask_) { MSGUARD(_msgcHashTableMutex); Data *d=findMatch(values_,mask_); if (d==0) create(MSTrue,values_,mask_); else if (data()!=d) { clearData(); _data=d; data()->increment(); } } void MSGC::clearData(void) { if(data() != 0) { if (data()->count()==1) remove(); data()->decrement(); _data=0; } } void MSGC::create(MSBoolean shared_,XGCValues *vals_,unsigned long mask_) { clearData(); GC gc=XCreateGC(display(),server()->root(),mask_,vals_); _data=new Data(server(),shared_,gc,mask_); data()->increment(); xgcList().add(data()); } MSGC::Data *MSGC::findMatch(XGCValues *v_,unsigned long mask_) const { for (int i=MSGC::xgcList().count()-1;i>=0;i--) { if (isMatch(xgcList().data(i),v_,mask_)==MSTrue) return xgcList().data(i); } return 0; } void MSGC::remove(void) { xgcList().remove(data()); } // function is broken up into three sections for efficiency // 1. most likely to be different // 2. second most likely to be different // 3. least likely to be different MSBoolean MSGC::isMatch(Data *data_,XGCValues *v_,unsigned long m_) const { if (m_==data_->mask()&&server()==data_->server()&&data_->shared()==MSTrue) { XGCValues v; XGetGCValues(data_->display(),data_->gc(),m_,&v); if (m_&GCForeground) if (v.foreground!=v_->foreground) return MSFalse; if (m_&GCBackground) if (v.background!=v_->background) return MSFalse; if (m_&GCFont) if (v.font!=v_->font) return MSFalse; if (m_&GCFunction) if (v.function!=v_->function) return MSFalse; if (m_&GCGraphicsExposures) if (v.graphics_exposures!=v_->graphics_exposures) return MSFalse; if (m_&GCLineWidth) if (v.line_width!=v_->line_width) return MSFalse; if (m_&GCLineStyle) if (v.line_style!=v_->line_style) return MSFalse; if (m_&GCCapStyle) if (v.cap_style!=v_->cap_style) return MSFalse; if (m_&GCJoinStyle) if (v.join_style!=v_->join_style) return MSFalse; if (m_&GCFillStyle) if (v.fill_style!=v_->fill_style) return MSFalse; if (m_&GCFillRule) if (v.fill_rule!=v_->fill_rule) return MSFalse; if (m_&GCArcMode) if (v.arc_mode!=v_->arc_mode) return MSFalse; if (m_&GCTile) if (v.tile!=v_->tile) return MSFalse; if (m_&GCStipple) if (v.stipple!=v_->stipple) return MSFalse; if (m_&GCTileStipXOrigin) if (v.ts_x_origin!=v_->ts_x_origin) return MSFalse; if (m_&GCTileStipYOrigin) if (v.ts_y_origin!=v_->ts_y_origin) return MSFalse; if (m_&GCSubwindowMode) if (v.subwindow_mode!=v_->subwindow_mode) return MSFalse; if (m_&GCClipXOrigin) if (v.clip_x_origin!=v_->clip_x_origin) return MSFalse; if (m_&GCClipYOrigin) if (v.clip_y_origin!=v_->clip_y_origin) return MSFalse; if (m_&GCClipMask) if (v.clip_mask!=v_->clip_mask) return MSFalse; if (m_&GCPlaneMask) if (v.plane_mask!=v_->plane_mask) return MSFalse; if (m_&GCDashOffset) if (v.dash_offset!=v_->dash_offset) return MSFalse; if (m_&GCDashList) if (v.dashes!=v_->dashes) return MSFalse; return MSTrue; } return MSFalse; } void MSGC::function(int func_) { if (data()->shared()==MSTrue&&function()!=func_) { XGCValues val; XGetGCValues(display(),gc(),mask(),&val); val.function=func_; setData(&val,mask()|GCFunction); } else { mask(mask()|GCFunction); XSetFunction(display(),gc(),func_); } } void MSGC::planeMask(unsigned long mask_) { if (data()->shared()==MSTrue&&planeMask()!=mask_) { XGCValues val; XGetGCValues(display(),gc(),mask(),&val); val.plane_mask=mask_; setData(&val,mask()|GCPlaneMask); } else { mask(mask()|GCPlaneMask); XSetPlaneMask(display(),gc(),mask_); } } void MSGC::foreground(unsigned long fg_) { if (data()->shared()==MSTrue&&foreground()!=fg_) { XGCValues val; XGetGCValues(display(),gc(),mask(),&val); val.foreground=fg_; setData(&val,mask()|GCForeground); } else { mask(mask()|GCForeground); XSetForeground(display(),gc(),fg_); } } void MSGC::background(unsigned long bg_) { if (data()->shared()==MSTrue&&background()!=bg_) { XGCValues val; XGetGCValues(display(),gc(),mask(),&val); val.background=bg_; setData(&val,mask()|GCBackground); } else { mask(mask()|GCBackground); XSetBackground(display(),gc(),bg_); } } void MSGC::color(unsigned long fg_,unsigned long bg_) { if (data()->shared()==MSTrue&&(foreground()!=fg_||background()!=bg_)) { XGCValues val; XGetGCValues(display(),gc(),mask(),&val); val.foreground=fg_; val.background=bg_; setData(&val,mask()|GCForeground|GCBackground); } else { mask(mask()|GCForeground|GCBackground); XSetForeground(display(),gc(),fg_); XSetBackground(display(),gc(),bg_); } } void MSGC::lineWidth(int lw_) { if (data()->shared()==MSTrue&&lineWidth()!=lw_) { XGCValues val; XGetGCValues(display(),gc(),mask(),&val); val.line_width=lw_; setData(&val,mask()|GCLineWidth); } else { mask(mask()|GCLineWidth); XSetLineAttributes(display(),gc(),lw_,lineStyle(),capStyle(),joinStyle()); } } void MSGC::lineStyle(int ls_) { if (data()->shared()==MSTrue&&lineStyle()!=ls_) { XGCValues val; XGetGCValues(display(),gc(),mask(),&val); val.line_style=ls_; setData(&val,mask()|GCLineStyle); } else { mask(mask()|GCLineStyle); XSetLineAttributes(display(),gc(),lineWidth(),ls_,capStyle(),joinStyle()); } } void MSGC::capStyle(int cs_) { if (data()->shared()==MSTrue&&capStyle()!=cs_) { XGCValues val; XGetGCValues(display(),gc(),mask(),&val); val.cap_style=cs_; setData(&val,mask()|GCCapStyle); } else { mask(mask()|GCCapStyle); XSetLineAttributes(display(),gc(),lineWidth(),lineStyle(),cs_,joinStyle()); } } void MSGC::joinStyle(int js_) { if (data()->shared()==MSTrue&&joinStyle()!=js_) { XGCValues val; XGetGCValues(display(),gc(),mask(),&val); val.join_style=js_; setData(&val,mask()|GCJoinStyle); } else { mask(mask()|GCJoinStyle); XSetLineAttributes(display(),gc(),lineWidth(),lineStyle(),capStyle(),js_); } } void MSGC::fillStyle(int fs_) { if (data()->shared()==MSTrue&&fillStyle()!=fs_) { XGCValues val; XGetGCValues(display(),gc(),mask(),&val); val.fill_style=fs_; setData(&val,mask()|GCFillStyle); } else { mask(mask()|GCFillStyle); XSetFillStyle(display(),gc(),fs_); } } void MSGC::fillRule(int fr_) { if (data()->shared()==MSTrue&&fillRule()!=fr_) { XGCValues val; XGetGCValues(display(),gc(),mask(),&val); val.fill_rule=fr_; setData(&val,mask()|GCFillRule); } else { mask(mask()|GCFillRule); XSetFillRule(display(),gc(),fr_); } } void MSGC::arcMode(int am_) { if (data()->shared()==MSTrue&&arcMode()!=am_) { XGCValues val; XGetGCValues(display(),gc(),mask(),&val); val.arc_mode=am_; setData(&val,mask()|GCArcMode); } else { mask(mask()|GCArcMode); XSetArcMode(display(),gc(),am_); } } void MSGC::tile(Pixmap t_) { if (data()->shared()==MSTrue&&tile()!=t_) { XGCValues val; XGetGCValues(display(),gc(),mask(),&val); val.tile=t_; setData(&val,mask()|GCTile); } else { mask(mask()|GCTile); XSetTile(display(),gc(),t_); } } void MSGC::stipple(Pixmap s_) { if (data()->shared()==MSTrue&&stipple()!=s_) { XGCValues val; XGetGCValues(display(),gc(),mask(),&val); val.stipple=s_; setData(&val,mask()|GCStipple); } else { mask(mask()|GCStipple); XSetStipple(display(),gc(),s_); } } void MSGC::tsXOrigin(int x_) { if (data()->shared()==MSTrue&&tsXOrigin()!=x_) { XGCValues val; XGetGCValues(display(),gc(),mask(),&val); val.ts_x_origin=x_; setData(&val,mask()|GCTileStipXOrigin); } else { mask(mask()|GCTileStipXOrigin); XSetTSOrigin(display(),gc(),x_,tsYOrigin()); } } void MSGC::tsYOrigin(int y_) { if (data()->shared()==MSTrue&&tsYOrigin()!=y_) { XGCValues val; XGetGCValues(display(),gc(),mask(),&val); val.ts_y_origin=y_; setData(&val,mask()|GCTileStipYOrigin); } else { mask(mask()|GCTileStipYOrigin); XSetTSOrigin(display(),gc(),tsXOrigin(),y_); } } void MSGC::font(Font fid_) { if (data()->shared()==MSTrue&&font()!=fid_) { XGCValues val; XGetGCValues(display(),gc(),mask(),&val); val.font=fid_; setData(&val,mask()|GCFont); } else { mask(mask()|GCFont); XSetFont(display(),gc(),fid_); } } void MSGC::subwindowMode(int mode_) { if (data()->shared()==MSTrue&&subwindowMode()!=mode_) { XGCValues val; XGetGCValues(display(),gc(),mask(),&val); val.subwindow_mode=mode_; setData(&val,mask()|GCSubwindowMode); } else { mask(mask()|GCSubwindowMode); XSetSubwindowMode(display(),gc(),mode_); } } void MSGC::graphicsExposures(int ge_) { if (data()->shared()==MSTrue&&graphicsExposures()!=ge_) { XGCValues val; XGetGCValues(display(),gc(),mask(),&val); val.graphics_exposures=ge_; setData(&val,mask()|GCGraphicsExposures); } else { mask(mask()|GCGraphicsExposures); XSetGraphicsExposures(display(),gc(),ge_); } } void MSGC::clipXOrigin(int x_) { if (data()->shared()==MSTrue&&clipXOrigin()!=x_) { XGCValues val; XGetGCValues(display(),gc(),mask(),&val); val.clip_x_origin=x_; setData(&val,mask()|GCClipXOrigin); } else { mask(mask()|GCClipXOrigin); XSetClipOrigin(display(),gc(),x_,clipYOrigin()); } } void MSGC::clipYOrigin(int y_) { if (data()->shared()==MSTrue&&clipYOrigin()!=y_) { XGCValues val; XGetGCValues(display(),gc(),mask(),&val); val.clip_y_origin=y_; setData(&val,mask()|GCClipYOrigin); } else { mask(mask()|GCClipYOrigin); XSetClipOrigin(display(),gc(),clipXOrigin(),y_); } } void MSGC::clipMask(Pixmap mask_) { if (data()->shared()==MSTrue&&clipMask()!=mask_) { XGCValues val; XGetGCValues(display(),gc(),mask(),&val); val.clip_mask=mask_; setData(&val,mask()|GCClipMask); } else { mask(mask()|GCClipMask); XSetClipMask(display(),gc(),mask_); } } void MSGC::dashes(int dashOffset_,const char *dashes_,int n_) { if (data()->shared()==MSTrue) { MSMessageLog::warningMessage("MSGC error: setting dash list on a shared GC"); } mask(mask()|GCDashList|GCDashOffset); XSetDashes(display(),gc(),dashOffset_,dashes_,n_); data()->dashes(dashes_,n_); } void MSGC::clipRectangles(XRectangle *rects_,int n_,int ordering_) { if (data()->shared()==MSTrue) { MSMessageLog::warningMessage("MSGC error: setting clip rectangle on a shared GC"); } XSetClipRectangles(display(),gc(),clipXOrigin(),clipYOrigin(),rects_,n_,ordering_); } aplus-fsf-4.22/src/MSGUI/MSGraph.C0000644000265000001440000046442010772770404012120 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #include static const char *DefaultWindowFont="fixed"; static const char *DefaultGraphForeground="white"; static const char *DefaultAxisForeground="white"; static const char *DefaultGridForeground="skyblue"; static const char *DefaultZeroForeground="skyblue"; static const char *DefaultLegendFont="lucidasanstypewriter-10"; static const char *DefaultTitlesFont="lucidasanstypewriter-12"; static const char *DefaultLabelFont="lucidasanstypewriter-bold-12"; static const int DefaultGraphHeight=200; static const int DefaultGraphWidth=300; static const int DefaultGraphMargin=0; static const int DefaultGraphDepth=0; static const int DefaultRuleWidth=0; static const int DefaultXlabelInc=0; static const int DefaultYlabelInc=0; static const float DefaultPieOffsetMargin=0.30; static const int DefaultBarWidth=10; static const int DefaultXnumMinorTicks=1; static const int DefaultYnumMinorTicks=1; static const int DefaultMinorTickSize=6; static const int DefaultMajorTickSize=10; static const float DefaultShowSizeRatio=0.75; static const int DefaultSelectDistance=10; static const int MSGraphMaxBarWidth=35; static const int MSGraphBackingStore=WhenMapped; static const unsigned long DefaultRepeatInterval=300; static const unsigned long DefaultMSGraphDoubleClickTime=500; // miliseconds static const unsigned long DefaultLongPressTime=500; // milliseconds static const MSStringVector DefaultTraceColors("deepskyblue\nyellow\nspringgreen\nturquoise\nplum\nskyblue\nred\npowderblue\ngreen\norange\npurple\nblack"); unsigned long MSGraph::_doubleClickEventTime=0; unsigned long MSGraph::_doubleClickTime=DefaultMSGraphDoubleClickTime; unsigned long MSGraph::_longPressTime=DefaultLongPressTime; MSBoolean MSGraph::_debugStatus=MSFalse; MSBoolean MSGraph::debug(void) {return _debugStatus;} void MSGraph::debug(MSBoolean status_) {_debugStatus=status_;} MSLabelFormat MSGraph::_outFormat; MSLabelOut MSGraph::_labelOut; MSLabelOut MSGraph::_timeLabelOut; const unsigned int MSGraph::_UnsetValue=0x5F5F5F5F; const double MSGraph::_PrecisionRange=1e13; const int MSGraph::_MinBufSize=10; const int MSGraph::_SHRT_MAX=(int)(SHRT_MAX/2); const int MSGraph::_SHRT_MIN=(int)(SHRT_MIN/2); MSString MSGraph::_defaultTraceTag="trend"; unsigned long MSGraphEventMask=ExposureMask|ButtonPressMask|ButtonReleaseMask; MSGraphStatusWin::MSGraphStatusWin(MSWidget *owner_):MSPrimitive(owner_) { _gc=XCreateGC(display(),window(),0,0); _font=server()->fontID(DefaultWindowFont); _fontInfo=(XFontStruct *)server()->fontStruct(_font); _spacing=_fontInfo->ascent; _valueWidth=0; _x1=0; _x2=0; _minWidth=0; _leading=4; _insideMargin=5; _highlightThickness=1; _shadowThickness=0; background(owner_->background()); foreground(owner_->foreground()); backingStore(MSGraphBackingStore); highlightColor(foreground()); XSetForeground(display(),gc(),foreground()); XSetBackground(display(),gc(),background()); } MSGraphStatusWin::~MSGraphStatusWin(void) { XFreeGC(display(),_gc); } void MSGraphStatusWin::font(Font font_) { if (font_!=0) { _font=font_; _fontInfo=(XFontStruct *)graph()->server()->fontStruct(font_); XSetFont(display(),_gc,font_); spacing(fontInfo()->ascent); } } void MSGraphStatusWin::updateBackground(unsigned long) { shadow().color(background()); if (mapped()==MSTrue) { if (highlighted()==MSTrue) drawHighlight(); drawShadow(); } } MSGraphLegend::MSGraphLegend(MSWidget *owner_):MSGraphStatusWin(owner_) { _firstDraw=MSTrue; _symbolWidth=2*spacing(); font(server()->fontID(DefaultLegendFont)); background(owner_->background()); foreground(owner_->foreground()); highlightColor(foreground()); _textFieldWidth=0; highlightThickness(1); shadowThickness(1); insideMargin(5); selectInput(ExposureMask); } void MSGraphLegend::buttonPress(const XEvent *event_) { if (event_->xbutton.button==Button1) { if (graph()->editor()->mapped()==MSTrue) graph()->editorEscape(); else if (graph()->doubleClick(event_)==MSTrue&&graph()->selectTrace()==0) { graph()->highlightLegendStatus(MSTrue); graph()->moveLegend(event_); } else if (graph()->highlightLegendStatus()==MSTrue) graph()->moveLegend(event_); } } void MSGraphLegend::font(Font font_) { MSGraphStatusWin::font(font_); symbolWidth(2*spacing()); } void MSGraphLegend::symbolFont(Font font_) { if (font_!=symbolFont()) { _symbolFont=font_; XSetFont(display(),gc(),font_); } } void MSGraphLegend::redraw(void) { graph()->computeLegendSize(); graph()->drawLegends(); graph()->positionLegend(graph()->legendAlignment()); } /* * MSGraphEditor member functions * */ MSGraphEditor::MSGraphEditor(MSWidget *owner_):MSText(owner_) { highlightThickness(1); shadowThickness(1); background(owner_->background()); foreground(owner_->foreground()); highlightColor(foreground()); } MSGraphEditor::~MSGraphEditor(void) {} MSBoolean MSGraphEditor::traverseFocus(MSWidget *) {return MSTrue;} MSWidget *MSGraphEditor::inputFocus(void) {return this;} const MSWidget *MSGraphEditor::inputFocus(void) const {return this;} void MSGraphEditor::save(void) { graph()->editorActivate(); } void MSGraphEditor::escape(void) { graph()->editorEscape(); } void MSGraphEditor::stringVector(const MSStringVector& aStringVector_) { MSString aString; for (unsigned i=0;i0) aString.drop(-1); string(aString); } MSGraphRepeatTimer::MSGraphRepeatTimer(MSGraph *g_,unsigned long i_):MSIntervalTimer(i_) {_graph=g_;} MSGraphRepeatTimer::~MSGraphRepeatTimer(void) {} void MSGraphRepeatTimer::process(void) {graph()->processRepeatTimer();} MSGraphDoubleClickTimer::MSGraphDoubleClickTimer(MSGraph *g_,unsigned long i_):MSRegularTimer(i_,0) {_graph=g_;} MSGraphDoubleClickTimer::~MSGraphDoubleClickTimer(void) {} void MSGraphDoubleClickTimer::process(void) {graph()->buttonTimerExpire(MSTrue);} MSGraph::MSGraph(MSWidget *owner_,const char *title_,const MSSymbol& tag_) : MSComposite(owner_), _tag(tag_) { title(title_); init(); } MSGraph::MSGraph(MSWidget *owner_,const MSStringVector& title_, const MSSymbol& tag_) : MSComposite(owner_), _tag(tag_) { title(title_); init(); } MSGraph::~MSGraph(void) { int i; freeze(); traceSetList().freeze(); traceList().freeze(); for (i=0;iremovePrintItem(this); clearPieData(); } void MSGraph::init(void) { selectInput(MSGraphEventMask); acceptTab(MSTrue); _timeLabelOut.format(MSTime::HoursMinutesSeconds); _xLegendPosition =0; _yLegendPosition =0; _xGrid =0; _yGrid =0; _yGridWidth =0; _xGridWidth =0; _nt =0; _newtraceCt =0; _newtraceIndex =0; _newtraceAllocCt =0; _selectPoint =0; _selectLine =0; _focusLine =0; _repeatTimer=new MSGraphRepeatTimer(this,DefaultRepeatInterval); _repeatTimer->stop(); _repeatOn =MSFalse; _keyPressStatus =MSFalse; _updateLegendStatus =MSTrue; _buttonTimerExpire =MSTrue; _subtitleForeground =MSWidget::foreground(); _footnoteForeground =_subtitleForeground; _gridForeground =server()->pixel(DefaultGridForeground); _zeroAxisForeground =server()->pixel(DefaultZeroForeground); _subtitleFont =server()->fontID(DefaultTitlesFont); _footnoteFont =_subtitleFont; _titleAlign =MSCenter; _subtitleAlign =MSCenter; _footnoteAlign =MSLeft; _orientation =Vertical; _graphMode =Standard; _graphUIMode =Normal; _axisRuleWidth =DefaultRuleWidth; _grid =0; _gridStyle =MSDash; _gridWidth =DefaultRuleWidth; _gridWeight =2; _zeroAxis =MSBottom|MSLeft; _zeroAxisStyle =MSDot; _zeroAxisWidth =DefaultRuleWidth; _zeroAxisWeight =1; _cursorType =(int)XYcursor; _legendAlign =MSTop|MSLeft; _legendStyle =Vertical; _axis =Std; _axisRule =Axis; _drawEndTicks =MSTrue; _titleHeight =0; _subtitleHeight =0; _footnoteHeight =0; _selectTrace =0; _yStringWidth =0; _xStringWidth =0; _xMinZoom =0; _xMaxZoom =0; _yMinZoom =0; _yMaxZoom =0; for (int i=0; i<2; i++) { _yMode[i] =Ascending; _xMode[i] =Ascending; _xMinorTickSize[i] =DefaultMinorTickSize; _xMajorTickSize[i] =DefaultMajorTickSize; _yMinorTickSize[i] =DefaultMinorTickSize; _yMajorTickSize[i] =DefaultMajorTickSize; _xAxisFg[i] =server()->pixel(DefaultAxisForeground); _yAxisFg[i] =_xAxisFg[i]; _xLabelFont[i] =server()->fontID(DefaultLabelFont); _yLabelFont[i] =_xLabelFont[i]; _xTitleFont[i] =_subtitleFont; _yTitleFont[i] =_subtitleFont; _xTitleAlign[i] =MSCenter; _yTitleAlign[i] =Horizontal; _margin[i] =DefaultGraphMargin; _margin[i+2] =DefaultGraphMargin; _xMargin[i][0] =0; _xMargin[i][1] =0; _yMargin[i][0] =0; _yMargin[i][1] =0; _xTickStyle[i] =Outside; _yTickStyle[i] =Outside; _showYaxis[i] =_showYrule[i]=i==0?MSTrue:MSFalse; _showXaxis[i] =_showXrule[i]=i==0?MSTrue:MSFalse; _xTitleFg[i] =_subtitleForeground; _yTitleFg[i] =_subtitleForeground; _xSubLabelAlign[i] =MSCenter; _xLabelAlign[i] =MSCenter; _yLabelAlign[i] =MSCenter; _xMinReal[i] =0; _xMaxReal[i] =0; _xMin[i] =(double)unsetValue(); _xMax[i] =(double)unsetValue(); _yMin[i] =(double)unsetValue(); _yMax[i] =(double)unsetValue(); _xMinData[i] =(double)unsetValue(); // jmiz _yMinData[i] =(double)unsetValue(); // jmiz _xMaxData[i] =(double)unsetValue(); // jmiz _yMaxData[i] =(double)unsetValue(); // jmiz _xScale[i] =(double)unsetValue(); // jmiz _yScale[i] =(double)unsetValue(); // jmiz _xMinSet[i] =(double)unsetValue(); _xMaxSet[i] =(double)unsetValue(); _yMinSet[i] =(double)unsetValue(); _yMaxSet[i] =(double)unsetValue(); _yLabelInc[i] =DefaultYlabelInc; _yLabelInc[i] =DefaultYlabelInc; _xLabelInc[i][0] =DefaultXlabelInc; _xLabelInc[i][1] =DefaultXlabelInc; _xNumMinorTicks[i] =DefaultXnumMinorTicks; _yNumMinorTicks[i] =DefaultYnumMinorTicks; _xTitle[i] =""; _yTitle[i] =""; _yIncData[i] =DefaultYlabelInc; _xIncData[i][0] =DefaultXlabelInc; _xIncData[i][1] =DefaultXlabelInc; } _x_org=_x_end=_y_org=_y_end=0; // initialize default trace colors _defaultLineColors=DefaultTraceColors; _defaultFillColors=DefaultTraceColors; // initialize graph parameters _plotAreaRect.width(DefaultGraphWidth); _plotAreaRect.height(DefaultGraphHeight); _graphDepth =DefaultGraphDepth; _showSizeRatio =DefaultShowSizeRatio; _selectDistance =DefaultSelectDistance; // initialize pie graph parameters _pieOffsetMargin =DefaultPieOffsetMargin; _pieCount =0; // initialize bar graph parameters _maxBarWidth =DefaultBarWidth; _barWidth =DefaultBarWidth; _xBar =0; _barCount =0; // initialize MarketProfile parameters _marketProfileStatus =MSFalse; _sessionPeriod =86400; _sessionOffset =0; _tpoPriceInc =0; _tpoPeriod =1800; _tpoOpen =28800; _tpoClose =57600; _tpoBreakChar =0; // initialize status parameters _highlightLegendStatus =MSFalse; _highlightTraceStatus =MSFalse; _graphZoomStatus =MSFalse; _xShowPos =MSFalse; _yShowPos =MSFalse; _onLineSegment =MSFalse; _onLinePoint =MSFalse; // create GCs and pixmap XGCValues gcValues; unsigned long gcMask; gcMask=GCForeground|GCBackground; gcValues.foreground=MSWidget::background(); gcValues.background=MSWidget::background(); _clearGC=XCreateGC(display(),window(),gcMask,&gcValues); gcMask=GCForeground|GCBackground|GCFunction; gcValues.foreground=server()->pixel(DefaultGraphForeground)^background(); gcValues.background=0; gcValues.function=GXxor; _windowGC=XCreateGC(display(),window(),gcMask,&gcValues); gcMask=GCForeground|GCBackground|GCLineWidth|GCFont; gcValues.foreground=foreground(); gcValues.line_width=_axisRuleWidth; gcValues.font=_subtitleFont; _axisGC=XCreateGC(display(),window(),gcMask,&gcValues); gcMask=GCForeground|GCBackground|GCLineWidth|GCLineStyle; gcValues.foreground=gridForeground(); gcValues.line_width=gridWidth(); gcValues.line_style=LineOnOffDash; _gridGC=XCreateGC(display(),window(),gcMask,&gcValues); gcMask=GCForeground|GCBackground|GCLineWidth|GCLineStyle; gcValues.foreground=zeroAxisForeground(); gcValues.line_width=zeroAxisWidth(); gcValues.line_style=LineOnOffDash; _zeroGC=XCreateGC(display(),window(),gcMask,&gcValues); gcMask=GCLineStyle; gcValues.line_style=LineSolid; gcValues.fill_rule=EvenOddRule; _traceGC=XCreateGC(display(),window(),gcMask,&gcValues); gcMask=GCForeground|GCBackground|GCFont; gcValues.foreground=_xTitleFg[0]; gcValues.font=_subtitleFont; _axisTitleGC=XCreateGC(display(),window(),gcMask,&gcValues); gcMask=GCForeground|GCBackground|GCFont; gcValues.foreground=_subtitleForeground; gcValues.font=_subtitleFont; _subtitleGC=XCreateGC(display(),window(),gcMask,&gcValues); gcMask=GCForeground|GCBackground|GCFont; gcValues.foreground=_footnoteForeground; gcValues.font=_subtitleFont; _footnoteGC=XCreateGC(display(),window(),gcMask,&gcValues); _graphPixmap=new MSBackingStorePixmap(server(),"MSGeneral"); _zoomCursor=new MSDisplayCursor(server(),XC_left_ptr, server()->pixel("white"),server()->pixel("black")); _drawCursor=new MSDisplayCursor(server(),XC_crosshair, server()->pixel("white"),server()->pixel("black")); _lineCursor=new MSDisplayCursor(server(),XC_left_ptr, server()->pixel("red"),server()->pixel("blue")); // initialize subwindows // it is necesary to initialize these, because otherwise // they are treated as traceSets in insertChild _legend=0; _dataWin=0; _editor=0; _legend=new MSGraphLegend(this); _dataWin=new MSGraphStatusWin(this); _editor=new MSGraphEditor(this); //temporary kludge _editor->map(); _editor->unmap(); _dataWin->map(); _dataWin->moveTo(10,10); _dataWin->unmap(); _legend->map(); _legend->moveTo(10,10); _legend->unmap(); // initialize printItem stuff _frameLineWidth=0; _style=MSNone; topPixel(4); bottomPixel(4); _printWidth=0; // initialize misc window stuff MSWidget::backingStore(MSGraphBackingStore); _highlightThickness=2; _shadowThickness=2; shadowStyle(MSEtchedIn); resize(DefaultGraphWidth,DefaultGraphHeight); _MaxBufSize=(int)XMaxRequestSize(display()); addToFocusList(); destroyable(MSFalse); // initialize pie parameters _startAngle=0; _indexOfMaxAngle=0; _orderDependent=MSFalse; _pieData=0; _pieLabelData=0; } void MSGraph::printDebugInfo(const char *str_) { MSString symbol; MSMessageLog::debugMessage(symbol<<"::"<tag()==tag_) return graphTraceSet(i); MSMessageLog::errorMessage("MSGraph::graphTraceSet tag not found\n"); return 0; } MSTraceSet *MSGraph::graphTraceSet(const MSSymbol& tag_) { int ct=traceSetList().count(); for (unsigned i=0;itag()==tag_) return graphTraceSet(i); MSMessageLog::errorMessage("MSGraph::graphTraceSet tag not found\n"); return 0; } const MSTrace *MSGraph::graphTrace(const MSSymbol& tag_) const { int ct=traceList().count(); for (unsigned i=0;itag()==tag_) return graphTrace(i); MSMessageLog::errorMessage("MSGraph::graphTrace tag not found\n"); return 0; } MSTrace *MSGraph::graphTrace(const MSSymbol& tag_) { int ct=traceList().count(); for (unsigned i=0;itag()==tag_) return graphTrace(i); MSMessageLog::errorMessage("MSGraph::graphTrace tag not found\n"); return 0; } MSBoolean MSGraph::loseFocus(void) { if (editor()->mapped()==MSTrue) editorActivate(); focusOut(); return MSTrue; } void MSGraph::focusIn(void) { highlight(); if (editor()->mapped()==MSTrue) takeFocusNotify(editor()); } void MSGraph::focusOut(void) { unHighlight(); if (editor()->mapped()==MSTrue) loseFocusNotify(editor()); } void MSGraph::firstMapNotify(void) { _naturalWidth=width(); _naturalHeight=height(); } void MSGraph::redraw(void) { computeLegendSize(); redrawImmediately(); positionLegend(legendAlignment()); if (highlighted()==MSTrue) drawHighlight(); } void MSGraph::naturalSize(void) {resize(_naturalWidth,_naturalHeight);} void MSGraph::computeSize(void) {redrawImmediately();} void MSGraph::childInsert(MSWidget *widget_) {insertChild(widget_);} void MSGraph::childRemove(MSWidget *widget_) {removeChild(widget_);} void MSGraph::childCreate(MSWidget *widget_) {insertChild(widget_);} void MSGraph::childDestroy(MSWidget *widget_) {removeChild(widget_);} void MSGraph::insertChild(MSWidget *widget_) { if (editor()!=0&&dataWin()!=0&&legend()!=0) { MSTraceSet *ts=(MSTraceSet *)widget_; traceSetList().add(ts); updateData(); updateLegendStatus(MSTrue); if (visible() != ts->visible()) { if(visible()==MSTrue) visibilityUnobscuredNotify(ts); else visibilityObscuredNotify(ts); } } } void MSGraph::removeChild(MSWidget *widget_) { MSTraceSet *ts=(MSTraceSet *)widget_; traceSetList().remove(ts); if (mapped()==MSTrue&&frozen()==MSFalse) updateData(); updateLegendStatus(MSTrue); } MSBoolean MSGraph::showXaxis(int i_) {return graphMode()&PieChart?MSFalse:_showXaxis[i_];} MSBoolean MSGraph::showYaxis(int i_) {return graphMode()&PieChart?MSFalse:_showYaxis[i_];} MSBoolean MSGraph::showXrule(int i_) {return graphMode()&PieChart?MSFalse:_showXrule[i_];} MSBoolean MSGraph::showYrule(int i_) {return graphMode()&PieChart?MSFalse:_showYrule[i_];} void MSGraph::barWidth(int x_) {_barWidth=x_<=MSGraphMaxBarWidth?x_:MSGraphMaxBarWidth;} void MSGraph::subtitle(const MSStringVector& x_) { if (_subtitle!=x_) { _subtitle=x_; updateSubtitle(); } } void MSGraph::subtitleAlignment(MSAlignment x_) { if (x_!=_subtitleAlign) { _subtitleAlign=x_; updateSubtitle(); } } void MSGraph::subtitleForeground(const char *x_) {subtitleForeground(server()->pixel(x_));} void MSGraph::subtitleForeground(unsigned long x_) { if (x_!=_subtitleForeground) { _subtitleForeground=x_; XSetForeground(display(),_subtitleGC,_subtitleForeground); drawSubtitle(window()); } } void MSGraph::subtitleFont(const char *font_) {subtitleFont(server()->fontID(font_));} void MSGraph::subtitleFont(Font font_) { if (font_!=_subtitleFont) { _subtitleFont=font_; XSetFont(display(),_subtitleGC,font_); updateSubtitle(); } } void MSGraph::footnote(const MSStringVector& x_) { if (_footnote!=x_) { _footnote=x_; updateFootnote(); } } void MSGraph::footnoteAlignment(MSAlignment x_) { if (x_!=_footnoteAlign) { _footnoteAlign=x_; updateFootnote(); } } void MSGraph::footnoteForeground(const char *x_) {footnoteForeground(server()->pixel(x_));} void MSGraph::footnoteForeground(unsigned long x_) { if (x_!=_footnoteForeground) { _footnoteForeground=x_; XSetForeground(display(),_footnoteGC,_footnoteForeground); drawFootnote(window()); } } void MSGraph::footnoteFont(const char *font_) {footnoteFont(server()->fontID(font_));} void MSGraph::footnoteFont(Font font_) { if (font_!=_footnoteFont) { _footnoteFont=font_; XSetFont(display(),_footnoteGC,font_); updateFootnote(); } } void MSGraph::axisMinimum(double x_,unsigned long i_) { MSBoolean changed=MSFalse; double x=fabs(x_); if (xDBL_MIN||x==0) { if (i_&MSLeft&&fabs(_yMin[0]-x_)>DBL_MIN) { _yMin[0]=_yMinSet[0]=x_; changed=MSTrue; } if (i_&MSRight&&fabs(_yMin[1]-x_)>DBL_MIN) { _yMin[1]=_yMinSet[1]=x_; changed=MSTrue; } if (i_&MSBottom&&fabs(_xMin[0]-x_)>DBL_MIN) { _xMin[0]=_xMinSet[0]=x_; changed=MSTrue; } if (i_&MSTop&&fabs(_xMin[1]-x_)>DBL_MIN) { _xMin[1]=_xMinSet[1]=x_; changed=MSTrue; } if (changed==MSTrue) redrawImmediately(); } } void MSGraph::axisMaximum(double x_,unsigned long i_) { MSBoolean changed=MSFalse; double x=fabs(x_); if (xDBL_MIN||x==0) { if (i_&MSLeft&&fabs(_yMax[0]-x_)>DBL_MIN) { _yMax[0]=_yMaxSet[0]=x_; changed=MSTrue; } if (i_&MSRight&&fabs(_yMax[1]-x_)>DBL_MIN) { _yMax[1]=_yMaxSet[1]=x_; changed=MSTrue; } if (i_&MSBottom&&fabs(_xMax[0]-x_)>DBL_MIN) { _xMax[0]=_xMaxSet[0]=x_; changed=MSTrue; } if (i_&MSTop&&fabs(_xMax[1]-x_)>DBL_MIN) { _xMax[1]=_xMaxSet[1]=x_; changed=MSTrue; } if (changed==MSTrue) redrawImmediately(); } } void MSGraph::axisLabelIncrement(double x_,unsigned long i_) { MSBoolean changed=MSFalse; double x=fabs(x_); if (xDBL_MIN) { if (i_&MSLeft&&fabs(_yLabelInc[0]-x_)>DBL_MIN) { _yLabelInc[0]=x_; changed=MSTrue; } if (i_&MSRight&&fabs(_yLabelInc[1]-x_)>DBL_MIN) { _yLabelInc[1]=x_; changed=MSTrue; } if (i_&MSBottom&&fabs(_xLabelInc[0][0]-x_)>DBL_MIN) { _xLabelInc[0][0]=x_; changed=MSTrue; } if (i_&MSTop&&fabs(_xLabelInc[1][0]-x_)>DBL_MIN) { _xLabelInc[1][0]=x_; changed=MSTrue; } if (changed==MSTrue) redrawImmediately(); } } void MSGraph::axisSubLabelIncrement(double x_,unsigned long i_) { MSBoolean changed=MSFalse; if (i_&MSBottom&&fabs(x_-_xLabelInc[0][1])>DBL_MIN) { _xLabelInc[0][1]=x_; changed=MSTrue; } if (i_&MSTop&&fabs(x_-_xLabelInc[1][1])>DBL_MIN) { _xLabelInc[1][1]=x_; changed=MSTrue; } if (changed==MSTrue) redrawImmediately(); } void MSGraph::axisTitle(const MSStringVector& str_,unsigned long i_) { MSBoolean changed=MSFalse; if (i_&MSLeft&&str_!=_yTitle[0]) { _yTitle[0]=str_; changed=MSTrue; } if (i_&MSRight&&str_!=_yTitle[1]) { _yTitle[1]=str_; changed=MSTrue; } if (i_&MSBottom&&str_!=_xTitle[0]) { _xTitle[0]=str_; changed=MSTrue; } if (i_&MSTop&&str_!=_xTitle[1]) { _xTitle[1]=str_; changed=MSTrue; } if (changed==MSTrue) redrawImmediately(); } void MSGraph::axisTitleForeground(const char *fg_,unsigned long i_) { axisTitleForeground(server()->pixel(fg_),i_); } void MSGraph::axisTitleForeground(unsigned long fg_,unsigned long i_) { MSBoolean changed=MSFalse; if (i_&MSLeft&&_yTitleFg[0]!=fg_) { _yTitleFg[0]=fg_; changed=MSTrue; } if (i_&MSRight&&_yTitleFg[1]!=fg_) { _yTitleFg[1]=fg_; changed=MSTrue; } if (i_&MSBottom&&_xTitleFg[0]!=fg_) { _xTitleFg[0]=fg_; changed=MSTrue; } if (i_&MSTop&&_xTitleFg[1]!=fg_) { _xTitleFg[1]=fg_; changed=MSTrue; } if (changed==MSTrue) redrawImmediately(); } void MSGraph::axisTitleFont(const char *font_,unsigned long i_) { axisTitleFont(server()->fontID(font_),i_); } void MSGraph::axisTitleFont(unsigned long font_,unsigned long i_) { MSBoolean changed=MSFalse; if (i_&MSLeft&&_yTitleFont[0]!=font_) { _yTitleFont[0]=font_; changed=MSTrue; } if (i_&MSRight&&_yTitleFont[1]!=font_) { _yTitleFont[1]=font_; changed=MSTrue; } if (i_&MSBottom&&_xTitleFont[0]!=font_) { _xTitleFont[0]=font_; changed=MSTrue; } if (i_&MSTop&&_xTitleFont[1]!=font_) { _xTitleFont[1]=font_; changed=MSTrue; } if (changed==MSTrue) { XSetFont(display(),_axisTitleGC,font_); redrawImmediately(); } } void MSGraph::axisTitleAlignment(MSAlignment align_,unsigned long i_) { MSBoolean changed=MSFalse; if (i_&MSLeft&&_yTitleAlign[0]!=align_) { _yTitleAlign[0]=align_; changed=MSTrue; } if (i_&MSRight&&_yTitleAlign[1]!=align_) { _yTitleAlign[1]=align_; changed=MSTrue; } if (i_&MSBottom&&_xTitleAlign[0]!=align_) { _xTitleAlign[0]=align_; changed=MSTrue; } if (i_&MSTop&&_xTitleAlign[1]!=align_) { _xTitleAlign[1]=align_; changed=MSTrue; } if (changed==MSTrue) redrawImmediately(); } void MSGraph::axisTitleAlignment(unsigned long align_,unsigned long i_) { MSBoolean changed=MSFalse; if (i_&MSLeft&&_yTitleAlign[0]!=align_) { _yTitleAlign[0]=formatAlignment(align_); changed=MSTrue; } if (i_&MSRight&&_yTitleAlign[1]!=align_) { _yTitleAlign[1]=formatAlignment(align_); changed=MSTrue; } if (changed==MSTrue) redrawImmediately(); } void MSGraph::axisLabelAlignment(MSAlignment align_,unsigned long i_) { MSBoolean changed=MSFalse; if (i_&MSLeft&&_yLabelAlign[0]!=align_) { _yLabelAlign[0]=align_; changed=MSTrue; } if (i_&MSRight&&_yLabelAlign[1]!=align_) { _yLabelAlign[1]=align_; changed=MSTrue; } if (i_&MSBottom&&_xLabelAlign[0]!=align_) { _xLabelAlign[0]=align_; changed=MSTrue; } if (i_&MSTop&&_xLabelAlign[1]!=align_) { _xLabelAlign[1]=align_; changed=MSTrue; } if (changed==MSTrue) redrawImmediately(); } void MSGraph::axisSubLabelAlignment(MSAlignment align_,unsigned long i_) { MSBoolean changed=MSFalse; if (i_&MSBottom&&_xSubLabelAlign[0]!=align_) { _xSubLabelAlign[0]=align_; changed=MSTrue; } if (i_&MSTop&&_xSubLabelAlign[1]!=align_) { _xSubLabelAlign[1]=align_; changed=MSTrue; } if (changed==MSTrue) redrawImmediately(); } void MSGraph::axisLabelOut(MSLabelOutPtr out_,unsigned long i_) { MSBoolean changed=MSFalse; if (i_&MSLeft&&_yLabelOut[0]!=out_) { _yLabelOut[0]=out_; changed=MSTrue; } if (i_&MSRight&&_yLabelOut[1]!=out_) { _yLabelOut[1]=out_; changed=MSTrue; } if (i_&MSBottom&&_xLabelOut[0]!=out_) { _xLabelOut[0]=out_; changed=MSTrue; } if (i_&MSTop&&_xLabelOut[1]!=out_) { _xLabelOut[1]=out_; changed=MSTrue; } if (changed==MSTrue) { out_->owner(this); redrawImmediately(); } } void MSGraph::axisSubLabelOut(MSLabelOutPtr x_,unsigned long i_) { MSBoolean changed=MSFalse; if (i_&MSBottom&&_xSubLabelOut[0]!=x_) { _xSubLabelOut[0]=x_;changed=MSTrue; } if (i_&MSTop&&_xSubLabelOut[1]!=x_) { _xSubLabelOut[1]=x_;changed=MSTrue; } if (changed==MSTrue) { x_->owner(this); redrawImmediately(); } } void MSGraph::axisForeground(const char *fg_,unsigned long i_) { axisForeground(server()->pixel(fg_),i_); } void MSGraph::axisForeground(unsigned long fg_,unsigned long i_) { MSBoolean changed=MSFalse; if (i_&MSLeft&&_yAxisFg[0]!=fg_) { _yAxisFg[0]=fg_; changed=MSTrue; } if (i_&MSRight&&_yAxisFg[1]!=fg_) { _yAxisFg[1]=fg_; changed=MSTrue; } if (i_&MSBottom&&_xAxisFg[0]!=fg_) { _xAxisFg[0]=fg_; changed=MSTrue; } if (i_&MSTop&&_xAxisFg[1]!=fg_) { _xAxisFg[1]=fg_; changed=MSTrue; } if (changed==MSTrue) redrawImmediately(); } void MSGraph::axisLabelFont(const char *font_,unsigned long i_) { axisLabelFont(server()->fontID(font_),i_); } void MSGraph::axisLabelFont(unsigned long font_,unsigned long i_) { MSBoolean changed=MSFalse; if (i_&MSLeft&&_yLabelFont[0]!=font_) { _yLabelFont[0]=font_; changed=MSTrue; } if (i_&MSRight&&_yLabelFont[1]!=font_) { _yLabelFont[1]=font_; changed=MSTrue; } if (i_&MSBottom&&_xLabelFont[0]!=font_) { _xLabelFont[0]=font_; changed=MSTrue; } if (i_&MSTop&&_xLabelFont[1]!=font_) { _xLabelFont[1]=font_; changed=MSTrue; } if (changed==MSTrue) { XSetFont(display(),_axisGC,font_); redrawImmediately(); } } void MSGraph::axisRuleWidth(int x_) { if (_axisRuleWidth!=x_) { _axisRuleWidth=x_>10?10:x_; XSetLineAttributes(display(),axisGC(),_axisRuleWidth,LineSolid,CapButt,JoinMiter); redrawImmediately(); } } void MSGraph::tickStyle(unsigned long x_,unsigned long i_) { MSBoolean changed=MSFalse; if (i_&MSLeft&&_yTickStyle[0]!=x_) {_yTickStyle[0]=x_; changed=MSTrue; } if (i_&MSRight&&_yTickStyle[1]!=x_) {_yTickStyle[1]=x_; changed=MSTrue; } if (i_&MSBottom&&_xTickStyle[0]!=x_) {_xTickStyle[0]=x_; changed=MSTrue; } if (i_&MSTop&&_xTickStyle[1]!=x_) {_xTickStyle[1]=x_; changed=MSTrue; } if (changed==MSTrue) redrawImmediately(); } void MSGraph::minorTicks(unsigned x_,unsigned long i_) { MSBoolean changed=MSFalse; if (i_&MSLeft&&_yNumMinorTicks[0]!=x_) {_yNumMinorTicks[0]=x_; changed=MSTrue; } if (i_&MSRight&&_yNumMinorTicks[1]!=x_) {_yNumMinorTicks[1]=x_; changed=MSTrue; } if (i_&MSBottom&&_xNumMinorTicks[0]!=x_) {_xNumMinorTicks[0]=x_; changed=MSTrue; } if (i_&MSTop&&_xNumMinorTicks[1]!=x_) {_xNumMinorTicks[1]=x_; changed=MSTrue; } if (changed==MSTrue) redrawImmediately(); } void MSGraph::majorTickSize(unsigned x_,unsigned long i_) { MSBoolean changed=MSFalse; if (i_&MSLeft&&_yMajorTickSize[0]!=x_) {_yMajorTickSize[0]=x_; changed=MSTrue; } if (i_&MSRight&&_yMajorTickSize[1]!=x_) {_yMajorTickSize[1]=x_; changed=MSTrue; } if (i_&MSBottom&&_xMajorTickSize[0]!=x_) {_xMajorTickSize[0]=x_; changed=MSTrue; } if (i_&MSTop&&_xMajorTickSize[1]!=x_) {_xMajorTickSize[1]=x_; changed=MSTrue; } if (changed==MSTrue) redrawImmediately(); } void MSGraph::minorTickSize(unsigned x_,unsigned long i_) { MSBoolean changed=MSFalse; if (i_&MSLeft&&_yMinorTickSize[0]!=x_) {_yMinorTickSize[0]=x_; changed=MSTrue; } if (i_&MSRight&&_yMinorTickSize[1]!=x_) {_yMinorTickSize[1]=x_; changed=MSTrue; } if (i_&MSBottom&&_xMinorTickSize[0]!=x_) {_xMinorTickSize[0]=x_; changed=MSTrue; } if (i_&MSTop&&_xMinorTickSize[1]!=x_) {_xMinorTickSize[1]=x_; changed=MSTrue; } if (changed==MSTrue) redrawImmediately(); } void MSGraph::maxBarWidth(unsigned x_) { if (x_!=_maxBarWidth) { _maxBarWidth=x_>35?35:x_; redrawImmediately(); } } void MSGraph::grid(unsigned long x_) { if (grid()!=x_) { _grid=x_; if ((_grid&MSLeft)&&(_grid&MSRight)) _grid-=MSRight; if ((_grid&MSTop)&&(_grid&MSBottom)) _grid-=MSTop; redrawImmediately(); } } void MSGraph::gridStyle(unsigned long x_) { if (gridStyle()!=x_) { _gridStyle=x_; setLineAttributes(gridStyle(),gridWeight(),gridGC(),gridWidth(),CapButt,JoinMiter); redrawImmediately(); } } void MSGraph::gridWidth(unsigned x_) { if (gridWidth()!=x_) { _gridWidth=x_>10?10:x_; setLineAttributes(gridStyle(),gridWeight(),gridGC(),gridWidth(),CapButt,JoinMiter); redrawImmediately(); } } void MSGraph::gridWeight(unsigned x_) { if (gridWeight()!=x_) { _gridWeight=x_>4?4:x_; setLineAttributes(gridStyle(),gridWeight(),gridGC(),gridWidth(),CapButt,JoinMiter); redrawImmediately(); } } void MSGraph::gridForeground(const char *x_) { gridForeground(server()->pixel(x_)); } void MSGraph::gridForeground(unsigned long x_) { if (gridForeground()!=x_) { _gridForeground=x_; XSetForeground(display(),_gridGC,_gridForeground); redrawImmediately(); } } void MSGraph::zeroAxis(unsigned long x_) { if (zeroAxis()!=x_) { _zeroAxis=x_; if ((_zeroAxis&MSLeft)&&(_zeroAxis&MSRight)) _zeroAxis-=MSRight; if ((_zeroAxis&MSTop)&&(_zeroAxis&MSBottom)) _zeroAxis-=MSTop; redrawImmediately(); } } void MSGraph::zeroAxisStyle(unsigned long x_) { if (zeroAxisStyle()!=x_) { _zeroAxisStyle=x_; setLineAttributes(zeroAxisStyle(),zeroAxisWeight(),zeroGC(),zeroAxisWidth(),CapButt,JoinMiter); redrawImmediately(); } } void MSGraph::zeroAxisWidth(unsigned x_) { if (zeroAxisWidth()!=x_) { _zeroAxisWidth=x_>10?10:x_; setLineAttributes(zeroAxisStyle(),zeroAxisWeight(),zeroGC(),zeroAxisWidth(),CapButt,JoinMiter); redrawImmediately(); } } void MSGraph::zeroAxisWeight(unsigned x_) { if (zeroAxisWeight()!=x_) { _zeroAxisWeight=x_>4?4:x_; setLineAttributes(zeroAxisStyle(),zeroAxisWeight(),zeroGC(),zeroAxisWidth(),CapButt,JoinMiter); redrawImmediately(); } } void MSGraph::zeroAxisForeground(const char *x_) { zeroAxisForeground(server()->pixel(x_)); } void MSGraph::zeroAxisForeground(unsigned long x_) { if (zeroAxisForeground()!=x_) { _zeroAxisForeground=x_; XSetForeground(display(),_zeroGC,_zeroAxisForeground); redrawImmediately(); } } void MSGraph::topAxisDataMargin(double x_,unsigned long i_) { MSBoolean changed=MSFalse; if (x_>=0.&&x_<100.) { if (i_&MSLeft&&fabs(x_-_xMargin[1][0])>DBL_MIN) { _xMargin[1][0]=x_<1.?x_:x_/100.; changed=MSTrue; } if (i_&MSRight&&fabs(x_-_xMargin[1][1])>DBL_MIN) { _xMargin[1][1]=x_<1.?x_:x_/100.; changed=MSTrue; } if (changed==MSTrue) redrawImmediately(); } else { MSMessageLog::warningMessage("MSGraph::topAxisDataMargin value out of range\n"); } } void MSGraph::bottomAxisDataMargin(double x_,unsigned long i_) { MSBoolean changed=MSFalse; if (x_>=0.&&x_<100.) { if (i_&MSLeft&&fabs(x_-_xMargin[0][0])>DBL_MIN) { _xMargin[0][0]=x_<1.?x_:x_/100.; changed=MSTrue; } if (i_&MSRight&&fabs(x_-_xMargin[0][1])>DBL_MIN) { _xMargin[0][1]=x_<1.?x_:x_/100.; changed=MSTrue; } if (changed==MSTrue) redrawImmediately(); } else { MSMessageLog::warningMessage("MSGraph::bottomAxisDataMargin value out of range\n"); } } void MSGraph::leftAxisDataMargin(double x_,unsigned long i_) { MSBoolean changed=MSFalse; if (x_>=0.&&x_<100.) { x_=x_>1?x_/100.:x_; if (i_&MSBottom&&fabs(x_-_yMargin[0][0])>DBL_MIN) { _yMargin[0][0]=x_; changed=MSTrue; } if (i_&MSTop&&fabs(x_-_yMargin[0][1])>DBL_MIN) { _yMargin[0][1]=x_; changed=MSTrue; } if (changed==MSTrue) redrawImmediately(); } else { MSMessageLog::warningMessage("MSGraph::leftAxisDataMargin value out of range\n"); } } void MSGraph::rightAxisDataMargin(double x_,unsigned long i_) { MSBoolean changed=MSFalse; x_=x_>1?x_/100.:x_; if (x_>=0.&&x_<1.) { if (i_&MSBottom&&fabs(x_-_yMargin[1][0])>DBL_MIN) { _yMargin[1][0]=x_; changed=MSTrue; } if (i_&MSTop&&fabs(x_-_yMargin[1][1])>DBL_MIN) { _yMargin[1][1]=x_; changed=MSTrue; } if (changed==MSTrue) redrawImmediately(); } else { MSMessageLog::warningMessage("MSGraph::rightAxisDataMargin value out of range\n"); } } void MSGraph::xLegendPosition(double x_) { x_=x_<1.?x_:x_/100.; if (x_>=0.&&x_<1.) { if (fabs(x_-_xLegendPosition)>DBL_MIN) { _xLegendPosition=x_; positionLegend(_legendAlign); } } else { MSMessageLog::warningMessage("MSGraph::xLegendPosition value out of range\n"); } } void MSGraph::yLegendPosition(double x_) { x_=x_<1.?x_:x_/100.; if (x_>=0.&&x_<1.) { if (fabs(x_-_yLegendPosition)>DBL_MIN) { _yLegendPosition=x_<1.?x_:x_/100.; positionLegend(_legendAlign); } } else { MSMessageLog::warningMessage("MSGraph::yLegendPosition value out of range\n"); } } void MSGraph::axisMode(AxisMode x_,unsigned long i_) { MSBoolean changed=MSFalse; if (i_&MSLeft&&_yMode[0]!=x_) { _yMode[0]=x_; changed=MSTrue; } if (i_&MSRight&&_yMode[1]!=x_) { _yMode[1]=x_; changed=MSTrue; } if (i_&MSBottom&&_xMode[0]!=x_) { _xMode[0]=x_; changed=MSTrue; } if (i_&MSTop&&_xMode[1]!=x_) { _xMode[1]=x_; changed=MSTrue; } if (changed==MSTrue) redrawImmediately(); } void MSGraph::margin(double x_,unsigned long i_) { if ((x_=x_>1?x_/100.:x_)>=0&&x_<1.) { MSBoolean changed=MSFalse; if (i_&MSLeft&&fabs(x_-_margin[0])>DBL_MIN) { _margin[0]=x_; changed=MSTrue; } if (i_&MSRight&&fabs(x_-_margin[1])>DBL_MIN) { _margin[1]=x_; changed=MSTrue; } if (i_&MSTop&&fabs(x_-_margin[2])>DBL_MIN) { _margin[2]=x_; changed=MSTrue; } if (i_&MSBottom&&fabs(x_-_margin[3])>DBL_MIN) { _margin[3]=x_; changed=MSTrue; } if (changed==MSTrue) redrawImmediately(); } else { MSMessageLog::warningMessage("MSGraph::margin value out of range\n"); } } void MSGraph::orientation(MSG::Orientation x_) { if (x_!=_orientation) { _orientation=x_; redrawImmediately(); } } void MSGraph::pieOffsetMargin(double x_) { if ((x_=x_>1?x_/100.:x_)>=0&&x_<1.) { if (fabs(x_-_pieOffsetMargin)>DBL_MIN) { _pieOffsetMargin=x_; redrawImmediately(); } } else MSMessageLog::warningMessage("MSGraph pie margin value out of range\n"); } void MSGraph::sessionPeriod(double x_) { if (x_!=_sessionPeriod&&fabs(x_)font();} void MSGraph::legendFont(const char *str_) { legendFont(server()->fontID(str_));} void MSGraph::legendFont(unsigned long fid_) { if (fid_>0&&fid_!=legend()->font()) { legend()->font(fid_); legend()->redraw(); } } unsigned long MSGraph::legendForeground(void) const {return legend()->foreground();} void MSGraph::legendForeground(const char *str_) { legendForeground(server()->pixel(str_));} void MSGraph::legendForeground(unsigned long color_) { if (color_!=legend()->foreground()) { legend()->foreground(color_); drawLegends(); } } unsigned long MSGraph::legendBackground(void) const {return legend()->background();} void MSGraph::legendBackground(const char *str_) { legendBackground(server()->pixel(str_));} void MSGraph::legendBackground(unsigned long color_) { if (color_!=legend()->background()) { legend()->background(color_); drawLegends(); } } int MSGraph::legendHighlightThickness(void) const {return legend()->highlightThickness();} void MSGraph::legendHighlightThickness(int width_) { if (width_!=legend()->highlightThickness()) { legend()->highlightThickness(width_); legend()->redraw(); } } int MSGraph::legendShadowThickness(void) const {return legend()->shadowThickness();} void MSGraph::legendShadowThickness(int width_) { if (width_!=legend()->shadowThickness()) { legend()->shadowThickness(width_); legend()->redraw(); } } void MSGraph::legendAlignment(MSAlignment align_) {legendAlignment((unsigned long)align_);} void MSGraph::legendAlignment(unsigned long align_) { if ((align_=formatAlignment(align_))!=_legendAlign) { if (_legendAlign==MSNone) legend()->map(); else if (align_==MSNone) legend()->unmap(); unsigned long oldAlign=_legendAlign; _legendAlign=align_; if (oldAlign&Outside || align_&Outside) { // redraw every time when legend was outside or become outside redrawImmediately(); legend()->redraw(); } else positionLegend(legendAlignment()); } } void MSGraph::legendStyle(unsigned long style_) { if (style_!=_legendStyle) { _legendStyle=style_; legend()->valueWidth(0); computeLegendSize(); if (legendAlignment()&Outside) { updateLegendStatus(MSTrue); redrawImmediately(); } else drawLegends(); positionLegend(legendAlignment()); } } void MSGraph::updateFont(Font oldfont_) { Font fid=MSWidget::font(); if (fid!=oldfont_) { dataWin()->font(fid); for (int i=0; i<2; i++) { if (oldfont_==yTitleFont(i)) _yTitleFont[i]=fid; if (oldfont_==xTitleFont(i)) _xTitleFont[i]=fid; if (oldfont_==yLabelFont(i)) _yLabelFont[i]=fid; if (oldfont_==xLabelFont(i)) _xLabelFont[i]=fid; } if (oldfont_==subtitleFont()) { _subtitleFont=fid; XSetFont(display(),subtitleGC(),fid); } if (oldfont_==footnoteFont()) { _footnoteFont=fid; XSetFont(display(),footnoteGC(),fid); } XSetFont(display(),dataWin()->gc(),fid); XSetFont(display(),windowGC(),fid); editor()->font(fid); if (oldfont_==legend()->font()) legend()->font(fid); updateLegendStatus(MSTrue); redrawImmediately(); } } void MSGraph::updateForeground(unsigned long oldfg_) { MSComposite::updateForeground(oldfg_); unsigned long pixel=MSWidget::foreground(); if (pixel!=oldfg_) { dataWin()->highlightColor(pixel); for (int i=0; i<2; i++) { if (oldfg_==yTitleForeground(i)) _yTitleFg[i]=pixel; if (oldfg_==xTitleForeground(i)) _xTitleFg[i]=pixel; if (oldfg_==yAxisForeground(i)) _yAxisFg[i]=pixel; if (oldfg_==xAxisForeground(i)) _xAxisFg[i]=pixel; } if (oldfg_==subtitleForeground()) { _subtitleForeground=pixel; XSetForeground(display(),subtitleGC(),pixel); } if (oldfg_==footnoteForeground()) { _footnoteForeground=pixel; XSetForeground(display(),footnoteGC(),pixel); } XSetForeground(display(),dataWin()->gc(),pixel); XSetForeground(display(),windowGC(),pixel^background()); editor()->foreground(pixel); editor()->highlightColor(pixel); if (oldfg_==legend()->foreground()) legend()->foreground(pixel); updateLegendStatus(MSTrue); redrawImmediately(); } } void MSGraph::updateBackground(unsigned long oldbg_) { MSComposite::updateBackground(oldbg_); unsigned long pixel=background(); if (pixel!=oldbg_) { if (legendBackground()==oldbg_) legendBackground(pixel); if (editor()->background()==oldbg_) editor()->background(pixel); XSetForeground(display(),clearGC(),pixel); XSetBackground(display(),clearGC(),pixel); XSetForeground(display(),windowGC(),foreground()^pixel); redrawImmediately(); } } void MSGraph::updateTitle() { if (mapped()==MSTrue) { XFontStruct *fi=(XFontStruct *)server()->fontStruct(titleFont()); int h=(fi->ascent+fi->descent)*title().length(); if (h==titleHeight()) { XFillRectangle(display(),window(),clearGC(),offset(),offset(),width()-2*offset(),titleHeight()); drawTitle(window()); } else redrawImmediately(); } } void MSGraph::updateSubtitle() { if (mapped()==MSTrue) { XFontStruct *fi=(XFontStruct *)server()->fontStruct(subtitleFont()); int h=(fi->ascent+fi->descent)*subtitle().length(); if (h==subtitleHeight()) { XFillRectangle(display(),window(),clearGC(),offset(),offset()+titleHeight(), width()-2*offset(),subtitleHeight()); drawSubtitle(window()); } else redrawImmediately(); } } void MSGraph::updateFootnote() { if (mapped()==MSTrue) { XFontStruct *fi=(XFontStruct *)server()->fontStruct(footnoteFont()); int h=(fi->ascent+fi->descent)*footnote().length(); if (h==footnoteHeight()) { XFillRectangle(display(),window(),clearGC(),offset(),height()-footnoteHeight()-offset(), width()-2*offset(),footnoteHeight()); drawFootnote(window()); } else redrawImmediately(); } } void MSGraph::print(const char *file_) { MSBoolean fileOpen=MSFalse; if (outputMode()==Draw) { if (file_!=0) displayPrintFileName(file_); if (displayPrintOpen(this)==MSTrue) { fileOpen=MSTrue; outputMode(Print); } else return; } redrawForPrint(); if (fileOpen==MSTrue) { displayPrintClose(); outputMode(Draw); } } void MSGraph::redrawForPrint(void) { redrawImmediately(); if (legend()->mapped()==MSTrue) { displayPrintOriginInc(legend()); drawLegends(); displayPrintOriginDec(legend()); } } void MSGraph::redrawImmediately(MSBoolean update_,MSBoolean append_) { if ((mapped()==MSTrue&&frozen()!=MSTrue&&update_!=MSTrue)||outputMode()==Print) { _graphPixmap->lock(); XUndefineCursor(display(),window()); busyOn(); if (debug()==MSTrue) printDebugInfo(outputMode()==Draw?"redraw":"print"); XFillRectangle(display(),graphPixmap(),clearGC(), offset(),offset(),width()-2*offset(),height()-2*offset()); drawTitle(graphPixmap()); drawSubtitle(graphPixmap()); drawFootnote(graphPixmap()); computeExtents(); computeScales(); computeXincrement(); drawAxes(); drawGrid(); drawRule(); drawZeroAxis(); drawGraph(); drawXtitle(); drawYtitle(); XCopyArea(display(),graphPixmap(),window(),clearGC(),offset(),offset(), width()-2*offset(),height()-2*offset(),offset(),offset()); drawShadow(); drawLineSegments(); drawLineHandles(); if (selectTrace()!=0&&(selectTrace()->xOffset()!=0||selectTrace()->yOffset()!=0)) { drawMoveTrace(selectTrace()); drawLineHandles(selectTrace()); } busyOff(); if (graphUIMode()==AddTrace||graphUIMode()==MoveTrace) { XDefineCursor(display(),window(),drawCursor()); } else if (graphZoomStatus()==MSTrue) { XDefineCursor(display(),window(),zoomCursor()); } else XUndefineCursor(display(),window()); if (updateLegendStatus()==MSTrue) drawLegends(); _graphPixmap->unlock(); } else if (update_==MSTrue) { _graphPixmap->lock(); if (debug()==MSTrue) printDebugInfo(append_==MSTrue?"append":"update"); XFillRectangle(display(),graphPixmap(),clearGC(), offset(),offset(),width()-2*offset(),height()-2*offset()); drawGrid(); drawRule(); drawZeroAxis(); drawGraph(update_); XCopyArea(display(),graphPixmap(),window(),clearGC(),updateRect()->x(),updateRect()->y(), updateRect()->width(),updateRect()->height(),updateRect()->x(),updateRect()->y()); if (legendStyle()==LastValue) drawScanXvalues(); if (selectTrace()!=0&&(selectTrace()->xOffset()!=0||selectTrace()->yOffset()!=0)) { drawMoveTrace(selectTrace()); drawLineHandles(selectTrace()); } if (updateLegendStatus()==MSTrue) drawLegends(); _graphPixmap->unlock(); } } void MSGraph::redrawSansRescale(void) { XFillRectangle(display(),graphPixmap(),clearGC(), offset(),offset(),width()-2*offset(),height()-2*offset()); drawGrid(); drawRule(); drawZeroAxis(); drawGraph(); XCopyArea(display(),graphPixmap(),window(),clearGC(),x_org(),plotAreaRect()->y(), plotAreaRect()->width(),plotAreaRect()->height(),x_org(),plotAreaRect()->y()); } void MSGraph::configure(void) { _graphPixmap->resize(width(),height()); if (width()>0&&height()>0) { _plotAreaRect.width(width()); _plotAreaRect.height(height()); } positionLegend(legendAlignment()); /* if (highlightLegendStatus()!=MSTrue&& (legend()->height()>(_showSizeRatio*height())|| legend()->width()>(_showSizeRatio*width()))) { legend()->unmap(); } drawLegends(); if (legend()->mapped()!=MSTrue&&legendAlignment()!=0) { legend()->map(); } */ if (editor()->mapped()==MSTrue) editTextTrace(); } void MSGraph::unfreeze(void) { freezeStatus(MSFalse); legend()->redraw(); redrawImmediately(); } MSBoolean MSGraph::doubleClick(void) { if (buttonTimerExpire()==MSTrue) { buttonTimerExpire(MSFalse); MSGraphDoubleClickTimer *t=new MSGraphDoubleClickTimer(this,doubleClickTime()); return MSFalse; } return MSTrue; } MSBoolean MSGraph::doubleClick(const XEvent *event_) { if ((event_->xbutton.time-doubleClickEventTime())>doubleClickTime()) { doubleClickEventTime(event_->xbutton.time); return MSFalse; } return MSTrue; } MSBoolean MSGraph::longPress(const XEvent *event_) { static unsigned long time; static int x,y; const int MotionThreshold=5; if (event_->xbutton.type==ButtonPress) { time=event_->xbutton.time; x =event_->xbutton.x; y =event_->xbutton.y; return MSFalse; } if (event_->xbutton.type==ButtonRelease) { if ((event_->xbutton.time-time)>=longPressTime()&& (event_->xbutton.time-time)<2000&& abs(event_->xbutton.x-x)<=MotionThreshold&& abs(event_->xbutton.y-y)<=MotionThreshold) return MSTrue; } return MSFalse; } void MSGraph::motionNotify(const XEvent *event_) { if (graphUIMode()==AddTrace) { if ((_onLinePoint=findLineHandle(event_->xbutton.x,event_->xbutton.y))==MSTrue) { XDefineCursor(display(),window(),zoomCursor()); _onLineSegment=MSFalse; } else if ((_onLineSegment=findLineSegment(event_->xbutton.x,event_->xbutton.y))==MSTrue) { XDefineCursor(display(),window(),lineCursor()); _onLinePoint=MSFalse; } else XDefineCursor(display(),window(),drawCursor()); } else if (selectTrace()!=0&&graphUIMode()==MoveTrace) { if ((_onLinePoint=findSelectTraceLineHandle(event_->xbutton.x,event_->xbutton.y))==MSTrue) { XDefineCursor(display(),window(),zoomCursor()); } else if (findSelectableTrace(event_)==selectTrace()) { XDefineCursor(display(),window(),lineCursor()); _onLinePoint=MSFalse; } else XDefineCursor(display(),window(),drawCursor()); } } void MSGraph::buttonPress(const XEvent *event_) { if (isProtected()==MSFalse) { Window sw=event_->xbutton.subwindow; XEvent *ev=(XEvent *) event_; if (sw==editor()->window()) { if (traverseFocus(this)==MSTrue) { XEvent *ep=(XEvent *)event_; ep->xbutton.x-=editor()->x_origin(); ep->xbutton.y-=editor()->y_origin(); buttonPressNotify(editor(),ep); } } else if (sw==legend()->window()) { ev->xbutton.x -=legend()->x_origin(); ev->xbutton.y -=legend()->y_origin(); legend()->buttonPress(ev); } else if (traverseFocus(this)==MSTrue) { if (event_->xbutton.button==Button1) button1Press(event_); else if (event_->xbutton.button==Button2) button2Press(event_); else if (event_->xbutton.button==Button3) button3Press(event_); } } } void MSGraph::graphMode(GraphMode mode_) { graphMode((unsigned long)mode_);} void MSGraph::graphMode(unsigned long mode_) { if (graphMode()!=mode_&&mode_>=Standard) { _graphMode=mode_; if (mode_&Normalize) computeNormalizedOffsets(); redrawImmediately(); } } void MSGraph::graphUIMode(GraphUIMode mode_) { switch(mode_) { case Normal: if (graphUIMode()==AddTrace) { selectInput(MSGraphEventMask); freeze(); for (int i=0; ipointCount(),2); for (int j=0; jpointCount(); j++) { interactivePixel()(j,0)=nt(selectLine())->points(j)->x; interactivePixel()(j,1)=nt(selectLine())->points(j)->y; } if (nt(i)->pointCount()>1) if (activateCallback(MSWidgetCallback::addtrace)!=MSTrue) { MSFloatMatrix *pFloatMatrix=new MSFloatMatrix(createInteractiveTraceData((unsigned long)MSLeft)); MSString tag=interactiveTag(); MSTraceSet *ts=createTraceSet(*pFloatMatrix,tag,MSSymbol(tag)); ts->selectable(MSTrue); } } drawLineSegments(); drawLineHandles(); graphUIModeSet(mode_); newtraceDealloc(); unfreeze(); } else if (graphUIMode()==AddTextTrace) editorActivate(); break; case AddTrace: if (graphUIMode()!=AddTrace) { graphUIModeSet(AddTrace); selectLine(0); XDefineCursor(display(),window(),drawCursor()); } break; case AddTextTrace: if (graphUIMode()!=AddTextTrace) { graphUIModeSet(AddTextTrace); enterTextTrace(); if (traverseFocus(this)==MSTrue) takeFocusNotify(editor()); } break; case MoveTrace: break; } } void MSGraph::button1Press(const XEvent *event_) { if (graphUIMode()==Normal&&(event_->xbutton.state&ControlMask)) { graphUIModeSet(AddTrace); enterTrace(event_); } else if (graphUIMode()==AddTrace&&(event_->xbutton.state&ShiftMask)) { if (_onLineSegment==MSTrue) { selectInput(MSGraphEventMask); moveLineSegment(event_,MSTrue); selectInput(MSGraphEventMask|PointerMotionMask); } else if (selectPoint()==0||selectPoint()==nt(selectLine())->pointCount()-1) { selectInput(MSGraphEventMask); addLineSegment(event_); drawLineHandles(selectPoint()==0?0:selectPoint()+1); selectInput(MSGraphEventMask|PointerMotionMask); } } else if (graphUIMode()==AddTrace) { if (newtraceCt()==0) { graphUIModeSet(AddTrace); enterTrace(event_); } if (doubleClick(event_)==MSTrue) { graphUIMode(Normal); } else { selectInput(MSGraphEventMask); if (focusLine()!=selectLine()) { focusLine(selectLine()); drawLineHandles(); } else { moveLineSegment(event_); moveLineHandle(event_); } selectInput(MSGraphEventMask|PointerMotionMask); } } else if (editor()->mapped()==MSTrue) editorEscape(); else if (doubleClick(event_)==MSTrue) { if (highlightLegendStatus()==MSTrue) highlightLegendStatus(MSFalse); else if (graphMode()&PieChart&&(_selectTrace=findDataPoint(event_))!=0) { activateCallback(_selectTrace->traceSet(),MSWidgetCallback::traceptreference); } else if (selectTrace()!=0&&selectTrace()!=findTextTrace(event_)) { selectInput(MSGraphEventMask); unHighlightTrace(); } else if (selectTrace()==0&&(_selectTrace=findSelectableTrace(event_))!=0) { highlightTrace(); if (_onLinePoint==MSTrue) { // add move line handle method } activateCallback(selectTrace()->traceSet(),MSWidgetCallback::tracereference); moveTrace(event_); selectInput(MSGraphEventMask|PointerMotionMask); } else if (selectTrace()==0&&(_selectTrace=findTextTrace(event_))!=0) { highlightTrace(); moveTextTrace(event_); } else unzoom(); } else if (selectTrace()!=0&&highlightLegendStatus()!=MSTrue) { if (selectTrace()==findSelectableTrace(event_)) moveTrace(event_); else if (selectTrace()==findTextTrace(event_)) moveTextTrace(event_); } else if (highlightLegendStatus()!=MSTrue) { if (drawZoomRegion(event_)!=MSTrue) { interactivePixel().reshape(1,2); interactivePixel()(0,0)=event_->xbutton.x; interactivePixel()(0,1)=event_->xbutton.y; longPress(event_); } } } void MSGraph::buttonRelease(const XEvent *event_) { MSTrace *tp; if (longPress(event_)==MSTrue&&(tp=findDataPoint(event_))!=0) { activateCallback(tp->traceSet(),MSWidgetCallback::traceptreference); } else activateCallback(MSWidgetCallback::graphreference); } void MSGraph::button2Press(const XEvent *event_) { if (highlightLegendStatus()==MSTrue) return; interactivePixel().reshape(1,2); interactivePixel()(0,0)=event_->xbutton.x; interactivePixel()(0,1)=event_->xbutton.y; if (editor()->mapped()==MSTrue) editorEscape(); else if (selectTrace()!=0) { if (event_->xbutton.state&Mod1Mask) { if (selectTrace()==findTextTrace(event_)) { editTextTrace(); } } } else if (event_->xbutton.state&ControlMask) { cursorType(XYcursor); scanXY(event_); } else if (event_->xbutton.state&Mod1Mask) { if ((selectTrace()!=0&&selectTrace()==findTextTrace(event_))|| (selectTrace()==0&&(_selectTrace=findTextTrace(event_))!=0)) { editTextTrace(); } else { enterTextTrace(); } } else { cursorType(Xcursor); scanXY(event_); } } void MSGraph::button3Press(const XEvent *event_) { if (editor()->mapped()==MSTrue) editorEscape(); else if (selectTrace()==0) moveDataPoint(event_); } void MSGraph::keyPress(const XEvent *event_,KeySym keysym_,unsigned int state_,const char *str_) { MSKeyPress keyPress(keysym_,state_); if (isProtected()==MSFalse&&keyTranslate(keyPress)==MSFalse) { if (keysym_==XK_Tab) { if (state_&(ControlMask|Mod1Mask)) { // a kludge for now to call traverseToNext/PreviousShell acceptTab(MSFalse); keyPressNotify(top(),event_,keysym_,state_,str_); acceptTab(MSTrue); } else if (state_&ShiftMask) traverseToPrevious(); else if (state_&Mod1Mask||editor()->mapped()!=MSTrue) traverseToNext(); } else if (editor()->mapped()==MSTrue) keyTranslateNotify(editor(),event_,keysym_,state_,str_); else if (keysym_==XK_Escape) { if (graphUIMode()==AddTrace) { selectInput(MSGraphEventMask); graphUIModeSet(Normal); newtraceDealloc(); if (graphZoomStatus()==MSTrue) XDefineCursor(display(),window(),zoomCursor()); else XUndefineCursor(display(),window()); redrawImmediately(); } else if (selectTrace()!=0) { graphUIModeSet(Normal); unHighlightTrace(); } else if (marketProfileStatus()==MSTrue) tpoBreakChar(65); } else if ((keysym_==XK_Delete||keysym_==XK_KP_Decimal)&& (event_->xkey.state&Mod1Mask)==Mod1Mask) { if (selectTrace()!=0) deleteTrace(); } else if (keysym_==XK_Left||keysym_==XK_Right|| keysym_==XK_Up||keysym_==XK_Down ) { if (graphZoomStatus()==MSTrue&&keyPressStatus()==MSFalse) { keyPressStatus(MSTrue); server()->grabKeyboard(window(),False,GrabModeAsync,GrabModeAsync,event_->xkey.time); _arrowKeysym=keysym_; shiftZoomWindow(keysym_); } } else if (marketProfileStatus()==MSTrue&&keysym_>65&&keysym_<125) tpoBreakChar((int)keysym_); } } void MSGraph::keyRelease(const XEvent *e_,KeySym k_,unsigned int i_,const char* c_) { MSComposite::keyRelease(e_,k_,i_,c_); } void MSGraph::keyRelease(const XEvent *event_) { keyPressStatus(MSFalse); server()->ungrabKeyboard(window(),event_->xkey.time); stopRepeatTimer(); MSComposite::keyRelease(event_); } // The sun's X server isn't always reliable with keyReleases. So we must manually check // the keymap. void MSGraph::processRepeatTimer(void) { if (keyPressStatus()==MSTrue) { unsigned cksum=0; char keys_return[32]; XQueryKeymap(display(), keys_return); for (unsigned i = 0; i < 32; i++) cksum+= keys_return[i]; if (cksum==0) // No key is currently pressed { keyPressStatus(MSFalse); server()->ungrabKeyboard(window(), (CurrentTime)); stopRepeatTimer(); } else shiftZoomWindow(_arrowKeysym); } } void MSGraph::startRepeatTimer(void) { if (_repeatOn!=MSTrue) { _repeatOn=MSTrue; _repeatTimer->reset(); } } void MSGraph::stopRepeatTimer(void) { if (_repeatOn==MSTrue) { _repeatTimer->stop(); _repeatOn=MSFalse; } } void MSGraph::shiftZoomWindow(KeySym keysym_) { int i,sign; double offset[2]; MSBoolean update=MSFalse; sign=keysym_==XK_Left||keysym_==XK_Down?-1:1; if (keysym_==XK_Left||keysym_==XK_Right) { for (i=0; i<2; i++) { if (xMax(i)!=0) { offset[i]=xIncData(i)*sign; _xMin[i]+=offset[i]; _xMax[i]+=offset[i]; update=MSTrue; } } } else if (keysym_==XK_Up||keysym_==XK_Down) { for (i=0; i<2; i++) { if (yMax(i)!=0) { offset[i]=yIncData(i)*sign; _yMin[i]+=offset[i]; _yMax[i]+=offset[i]; update=MSTrue; } } } if (update==MSTrue) redrawImmediately(); startRepeatTimer(); } void MSGraph::updateData(void) { if (graphUIMode()==Normal) { redrawImmediately(); legend()->redraw(); } } void MSGraph::update(MSTraceSet *ts_,const MSIndexVector& i_) { int x,y,xs,ys; int high=1,low=2; double xvalue,yvalue; MSBoolean update=MSFalse,append=MSFalse; MSTrace *trace; int row=i_.length()>0?i_.lastElement()/ts_->numColumns():0; if (mapped()==MSTrue&&graphUIMode()!=AddTrace&&(ts_->lastDataCount()>0&&row>=ts_->lastDataCount()-1)) { for (int i=0;itraceList().count();i++) { if ((trace=ts_->trace(i))!=0&&trace->dataCount()>2&&trace->traceSet ()->overlap()==MSFalse) { ys=trace->yAxis(); xs=trace->xAxis(); if (trace->style()>=Close) { if (trace->y(high+trace->offset(),row)<=yMaxData(ys)&& trace->y(high+trace->offset(),row)>=yMinData(ys)&& trace->y(low+trace->offset(),row)<=yMaxData(ys)&& trace->y(low+trace->offset(),row)>=yMinData(ys)) { update=MSTrue; append=row>=ts_->lastDataCount()?MSTrue:MSFalse; } else { update=append=MSFalse; break; } } else if (trace->style()!=Fill) { if ((yvalue=trace->y(row))<=yMaxData(ys)&&yvalue>=yMinData(ys)) { xvalue=xValue(trace,row); if(xvalue<=xMaxData(xs)&&xvalue>=xMinData(xs)) { if (trace->style()==Scatter) { x=xValueToPixel(xvalue,trace->xAxis()); y=yValueToPixel(yvalue,trace->yAxis()); if (x>x_end()-trace->symbolSize()||y>y_end()-trace->symbolSize()) { update=append=MSFalse; break; } } update=MSTrue; append=row>=ts_->lastDataCount()?MSTrue:MSFalse; } else { update=append=MSFalse; break; } } else { update=append=MSFalse; break; } } } } } if (update==MSTrue) { computeUpdateRegion(trace); if (updateRect()->x()>x_end()||updateRect()->width()==0||updateRect()->height()==0) update=MSFalse; } if (i_.length()==0||ts_->lastDataCount()==0||legendStyle()==LastValue) legend()->redraw(); if (legendStyle()==LastValue) updateLegendStatus(MSTrue); if (ts_->lastDataCount()<2) update=MSFalse; computeNormalizedOffsets(); redrawImmediately(update,append); ts_->lastDataCount(ts_->dataCount()); } /* * * Beginning of MSGraph body functions * */ void MSGraph::computeScales(void) { int i,x,y,xx,yy; int min=0,max=0; int xMinLabelWidth=0; int xMaxLabelWidth=0; int spacing[2] ={0,0}; int xTitleHt[2] ={0,0}; int xLabelHt[2] ={0,0}; int xRuleHt[2] ={0,0}; int yTitleHt[2] ={0,0}; int yLabelHt[2] ={0,0}; int yTitleWidth[2]={0,0}; int rule_width=axisRuleWidth()==0?1:axisRuleWidth(); XFontStruct *fi; for (i=0; i<2; i++) { _yRuleWidth[i]=0; _yLabelWidth[i]=0; xLabelHt[i]=computeXscales(min,max,i); xMinLabelWidth=min>xMinLabelWidth?min:xMinLabelWidth; xMaxLabelWidth=max>xMaxLabelWidth?max:xMaxLabelWidth; if (showXaxis(i)) { fi=(XFontStruct *)server()->fontStruct(xTitleFont(i)); spacing[i]=i==0?(fi->ascent/2):((fi->descent+fi->ascent)/2+2); xTitleHt[i]=xTitle(i).maxLength()>0?xTitle(i).length()*(fi->ascent+fi->descent):0; xRuleHt[i]=rule_width+(xTickStyle(i)==Inside?xLabelHt[i]: (xMinorTickSize(i)>xMajorTickSize(i)+xLabelHt[i]? xMinorTickSize(i):xMajorTickSize(i)+xLabelHt[i])); } else if (showXrule(i)==MSTrue||axisRule()==MSG::Box) xRuleHt[i]=rule_width; if (showYaxis(i)) { fi=(XFontStruct *)server()->fontStruct(yLabelFont(i)); int h=fi->ascent+fi->descent; yLabelHt[i]=MSBottom&yLabelAlign(i)?h:MSTop&yLabelAlign(i)?fi->descent:h/2; fi=(XFontStruct *)server()->fontStruct(yTitleFont(i)); yTitleHt[i]=yTitleAlign(i)&Vertical||yTitle(i).maxLength()==0?0:yTitle(i).length()*(fi->ascent+2*fi->descent); } else spacing[i]=0; } y=xTitleHt[1]+xRuleHt[1]; int temp=yLabelHt[0]>yLabelHt[1]?yLabelHt[0]:yLabelHt[1]; y=y0?titleHeight()+subtitleHeight():axisRuleWidth(); y+=offset()+(yTitleHt[0]>yTitleHt[1]?yTitleHt[0]:yTitleHt[1]); y+=y==offset()?rule_width:0; y=y>topMargin()?y:topMargin(); int space=10; if (legendAlignment()&Outside&&legendAlignment()&Vertical) { y+=legendAlignment()&MSTop?legendHeight()+space:!(legendAlignment()&MSBottom)?legendHeight()+space:0; } _plotAreaRect.y(y); yy=_footnoteHeight+xTitleHt[0]+xRuleHt[0]; yy=offset()+(yyy()+(yy>bottomMargin()?yy:bottomMargin()); yy=yyfontStruct(yTitleFont(i)); _yLabelWidth[i]=computeYscale(i); yTitleWidth[i]=yTitleAlign(i)&Vertical?(yTitle(i).length()+2)*fi->max_bounds.width:0; yTitleWidth[i]+=_yLabelWidth[i]; if (showYaxis(i)==MSTrue) { spacing[i]=fi->max_bounds.width/2+1; _yRuleWidth[i]=rule_width+spacing[i]+(yTickStyle(i)==Inside|| MSLeft&yLabelAlign(i)||MSRight&yLabelAlign(i)?yTitleWidth[i]: (yMinorTickSize(i)>yMajorTickSize(i)+yTitleWidth[i]? yMinorTickSize(i):yMajorTickSize(i)+yTitleWidth[i])); } else if (showYrule(i)==MSTrue||axisRule()==MSG::Box) _yRuleWidth[i]=rule_width; } x=offset()+(showYaxis(0)!=MSTrue?xMinLabelWidth: (_yRuleWidth[0]>xMinLabelWidth?_yRuleWidth[0]:xMinLabelWidth)); x=x>leftMargin()?x:leftMargin(); x+=x==offset()?rule_width:0; if (legendAlignment()&Outside&&!(legendAlignment()&Vertical)&&!(legendAlignment()&MSRight)) { x+=legendWidth()+space; } _plotAreaRect.x(x); spacing[1]=(showXaxis(0)==MSTrue||showXaxis(1)==MSTrue)?1:0; xx=offset()+(showYaxis(1)!=MSTrue?xMaxLabelWidth+spacing[1]: (_yRuleWidth[1]rightMargin()?xx:rightMargin()); xx=xxxMaxLabelWidth?legendWidth()+space:xMaxLabelWidth; } _plotAreaRect.width(xx); } void MSGraph::computeUpdateRegion(MSTrace *trace_) { int i,k; MSTrace *trace; double x=xValue(trace_,trace_->traceSet()->lastDataCount()-2); int xx=xValueToPixel(x,trace_->xAxis()); _updateRect.x(xx); _updateRect.y(y_end()); _updateRect.width(x_end()-updateRect()->x()+(axisRuleWidth()==0?1:axisRuleWidth())); _updateRect.height(plotAreaRect()->height()); for (i=0;idataCount()>2&&trace->style()!=MSG::Text&& trace->style()!=Fill&&trace->traceSet()->overlap()==MSFalse) { x=xPixelToValue(xx,trace->xAxis()); for (k=trace->dataCount()-1; k>0; k--) { double xval=xValue(trace,k); if ((xval>0&&xval<=x)||(xval<0&&xval>=x)) break; } trace->traceSet()->updateIndex(k<2?0:k-2); } } } void MSGraph::computeNormalizedOffsets(void) { if (graphMode()&Normalize) { MSTraceSet *traceSet,*minTraceSet=graphTraceSet(0); unsigned i,k; for (i=0;ixMin()xMin()?minTraceSet:traceSet; } for (k=0;kdataCount()&&minTraceSet->x(i)<=traceSet->xMin();i++); traceSet->normalizedOffset(i-1); } } } double MSGraph::estimateNormalizedLabelValue(int inc_, double value_) { if (graphMode()&Normalize) { int i,index=(int)value_; if (index<0) { for (i=0;inormalizedOffset()==0) { return traceSet->x(0)+index*normalizedLabelInc()/inc_; } } } else { MSTraceSet *maxTraceSet=graphTraceSet(0); for (i=0;idataCount()&&traceSet->dataCount()>1) return traceSet->x(index); maxTraceSet=traceSet->dataCount()>maxTraceSet->dataCount()?traceSet:maxTraceSet; } return maxTraceSet->x(maxTraceSet->dataCount()-1)+index*normalizedLabelInc()/inc_; } } return value_; } void MSGraph::computeExtents(void) { int i,xs,ys; double xminR=0,xmaxR=0; double xmin=0,xmax=0; double ymin=0,ymax=0; double minArea=0,maxArea=0; double minStack=0,maxStack=0; double minTotal=0,maxTotal=0; MSBoolean showX=MSFalse,showY=MSFalse; MSBoolean stackSet=MSFalse; MSBoolean firstX[2],firstY[2],first; int stackCount=0; MSTrace *trace; for (i=0; i<2; i++) { _yMinData[i]=_yMaxData[i]=0.0; _xMinData[i]=_xMaxData[i]=0.0; firstX[i]=firstY[i]=first=MSFalse; } barCount(0); pieCount(0); for (i=0; idataCount()>0) { if (orientation()==Horizontal&&trace->style()!=Bar&&trace->style()!=Stack &&trace->style()!=MSG::Text) continue; if (trace->style()==Pie) trace->barCount(_pieCount++); if (trace->style()==Bar) trace->barCount(_barCount++); if (trace->style()==Stack) { if (stackSet!=MSTrue) { stackCount=_barCount++; stackSet=MSTrue; } trace->barCount(stackCount); } if ((xs=trace->xAxis())==1) showX=MSTrue; if ((ys=trace->yAxis())==1) showY=MSTrue; if (orientation()==Horizontal) { trace->traceSet()->xDelta(trace->dataCount()>1?fabs(yValue(trace,1)-yValue(trace,0)):1); } else { trace->traceSet()->xDelta(trace->dataCount()>1?fabs(xValue(trace,1)-xValue(trace,0)):1); } if (graphMode()&Normalize||graphZoomStatus()!=MSTrue) { if (first==MSFalse) { _yStringWidth=_xStringWidth=0; first=MSTrue; ymin=yValueMin(trace); ymax=yValueMax(trace); xminR=xValueMin(trace); xmaxR=xValueMax(trace); } if (firstY[ys]==MSFalse) { firstY[ys]=MSTrue; _yMinData[ys]=yValueMin(trace); _yMaxData[ys]=yValueMax(trace); } if (firstX[xs]==MSFalse) { firstX[xs]=MSTrue; if (graphMode()&Normalize) { _xMaxData[xs]=_xMinData[xs]=0; _xMinReal[xs]=xValueMin(trace); _xMaxReal[xs]=xValueMax(trace); } else { _xMaxReal[xs]=_xMinReal[xs]=0; _xMinData[xs]=xValueMin(trace); _xMaxData[xs]=xValueMax(trace); } } if (graphMode()&Normalize) { xmin=xValueMin(trace); xmax=xValueMax(trace); xmaxR=xmax>xmaxR?xmax:xmaxR; xminR=xmin>xminR?xmin:xminR; xmax=trace->dataCount(); xmin=trace->traceSet()->normalizedOffset(); } else { xmax=xValueMax(trace); xmin=xValueMin(trace); xmaxR=xmax>xmaxR?xmax:xmaxR; xminR=xmin>xminR?xmin:xminR; } _xMaxData[xs]=xmax>xMaxData(xs)?xmax:xMaxData(xs); _xMinData[xs]=xminxMaxReal(xs)?xmaxR:xMaxReal(xs); _xMinReal[xs]=xminRymax?yValueMax(trace):ymax; ymin=yValueMin(trace)style()==Area&&orientation()!=Horizontal) { maxArea=yValueMax(trace)>maxArea?yValueMax(trace):maxArea; minArea=yValueMin(trace)style()==Stack&&orientation()!=Horizontal) { maxStack=yValueMax(trace)>maxStack?yValueMax(trace):maxStack; minStack=yValueMin(trace)style()==Area&&orientation()==Horizontal) { maxArea=xValueMax(trace)>maxArea?xValueMax(trace):maxArea; minArea=xValueMin(trace)style()==Stack&&orientation()==Horizontal) { maxStack=xValueMax(trace)>maxStack?xValueMax(trace):maxStack; minStack=xValueMin(trace)style()==MSG::Text&&orientation()==Horizontal) { // _xMaxData[ys]=xValueMax(trace)>xMaxData(ys)?xValueMax(trace):xMaxData(ys); // _xMinData[ys]=xValueMin(trace)yMaxData(ys)?yValueMax(trace):yMaxData(ys); _yMinData[ys]=yValueMin(trace)style()==Bar||trace->style()==Stack) { if (trace->barCount()==0&&(xValue(trace,0)!=-DBL_MAX||xValue(trace,trace->dataCount()-1)!=DBL_MAX)) { if (orientation() == Horizontal) { _yMinData[ys]-=yValue(trace,0)==_yMinData[ys]?trace->traceSet()->xDelta()/2:0; _yMaxData[ys]+=yValue(trace,trace->dataCount()-1)==_yMaxData[ys]? trace->traceSet()->xDelta()/2:0; _xMinData[xs]-=xMinData(xs)>=0?(xMaxData(xs)-xMinData(xs))*0.2:0; } else { _xMinData[xs]-=xValue(trace,0)==_xMinData[xs]?trace->traceSet()->xDelta()/2:0; _xMaxData[xs]+=xValue(trace,trace->dataCount()-1)==_xMaxData[xs]? trace->traceSet()->xDelta()/2:0; _yMinData[ys]-=yMinData(ys)>=0?(yMaxData(ys)-yMinData(ys))*0.2:0; } } if (yMaxData(ys)<0) _yMaxData[ys]=0; } minTotal=minArea<0?minTotal+minArea:minAreastyle()==Area||trace->style()==Stack) { maxTotal+=maxArea>maxStack?maxArea:maxStack; } if (minArea!=maxArea||maxStack!=minStack) { if(orientation()==Horizontal) { _xMinData[xs]=xMinData(xs)maxTotal?xMaxData(xs):maxTotal; } else { _yMinData[ys]=yMinData(ys)maxTotal?yMaxData(ys):maxTotal; } } yShowPos(yMinData(ys)<0?MSTrue:MSFalse); MSString formatBuffer; formatAxisLabel(formatBuffer.removeAll(),yLabelOut(ys),ymin,MSTrue); _yStringWidth=(formatBuffer.length()>_yStringWidth)?formatBuffer.length():_yStringWidth; formatAxisLabel(formatBuffer.removeAll(),yLabelOut(ys),ymax,MSTrue); _yStringWidth=(formatBuffer.length()>_yStringWidth)?formatBuffer.length():_yStringWidth; formatAxisLabel(formatBuffer.removeAll(),xLabelOut(xs),xminR,MSTrue); _xStringWidth=(formatBuffer.length()>_xStringWidth)?formatBuffer.length():_xStringWidth; formatAxisLabel(formatBuffer.removeAll(),xLabelOut(xs),xmaxR,MSTrue); _xStringWidth=(formatBuffer.length()>_xStringWidth)?formatBuffer.length():_xStringWidth; if (_xSubLabelOut[xs]!=0) { formatAxisLabel(formatBuffer.removeAll(),xSubLabelOut(xs),xminR,MSTrue); _xStringWidth=(formatBuffer.length()>_xStringWidth)?formatBuffer.length():_xStringWidth; formatAxisLabel(formatBuffer.removeAll(),xSubLabelOut(xs),xmaxR,MSTrue); _xStringWidth=(formatBuffer.length()>_xStringWidth)?formatBuffer.length():_xStringWidth; } } } } if (_xMinData[1]==_xMaxData[1]&&_xMinData[0]!=_xMaxData[0]) { _xMinData[1]=_xMinData[0]; _xMaxData[1]=_xMaxData[0]; } else if (_xMinData[0]==_xMaxData[0]&&_xMinData[1]!=_xMaxData[1]) { _xMinData[0]=_xMinData[1]; _xMaxData[0]=_xMaxData[1]; } if (_yMinData[1]==_yMaxData[1]&&(_yMinData[0]!=_yMaxData[0]||_yMinData[0]!=0.)) { _yMinData[1]=_yMinData[0]; _yMaxData[1]=_yMaxData[0]; } else if (_yMinData[0]==_yMaxData[0]&&_yMinData[1]!=_yMaxData[1]) { _yMinData[0]=_yMinData[1]; _yMaxData[0]=_yMaxData[1]; } for (i=0;i<2;i++) { if (yMinData(i)==yMaxData(i)) { _yMinData[i]=yMinData(i==0?1:0); _yMaxData[i]=yMaxData(i==0?1:0); _yIncData[i]=yIncData(i==0?1:0); } if ((unsigned int)yMin(i)==unsetValue()) { _yMinData[i]=yMinData(i)-fabs(yMaxData(i)-yMinData(i))*yMargin(i,0); } else _yMinData[i]=yMin(i); if ((unsigned int)yMax(i)==unsetValue()) { _yMaxData[i]=yMaxData(i)+fabs(yMaxData(i)-yMinData(i))*yMargin(i,1); } else _yMaxData[i]=yMax(i); if (yMinData(i)>yMaxData(i)) { if ((unsigned long)yMax(i)!=unsetValue()) { _yMinData[i]=yMaxData(i)-100; MSMessageLog::warningMessage("MSGraph::yMaximum set to less than MSGraph::yMinimum\n"); } else { _yMaxData[i]=yMinData(i)+100; MSMessageLog::warningMessage("MSGraph::yMinimum set to greater than MSGraph::yMaximum\n"); } } if (yMinData(i)==yMaxData(i)||fabs(yMaxData(i)/(yMaxData(i)-yMinData(i)))>MSGraph::_PrecisionRange) { _yMinData[i]=0.; _yMaxData[i]*=2.; if (yMaxData(i)==0.) _yMaxData[i]=100.; } if (xMinData(i)==xMaxData(i)) { _xMinData[i]=xMinData(i==0?1:0); _xMaxData[i]=xMaxData(i==0?1:0); _xIncData[i][0]=xIncData(i==0?1:0); } if ((unsigned int)xMin(i)==unsetValue()) { _xMinData[i]=xMinData(i)-fabs(xMaxData(i)-xMinData(i))*xMargin(i,0); _xMinReal[i]=xMinReal(i)-fabs(xMaxReal(i)-xMinReal(i))*xMargin(i,0); } else _xMinData[i]=xMin(i); if ((unsigned int)xMax(i)==unsetValue()) { _xMaxData[i]=xMaxData(i)+fabs(xMaxData(i)-xMinData(i))*xMargin(i,1); _xMaxReal[i]=xMaxReal(i)+fabs(xMaxReal(i)-xMinReal(i))*xMargin(i,1); } else _xMaxData[i]=xMax(i); if (xMinData(i)>xMaxData(i)) { if ((unsigned long)xMax(i)!=unsetValue()) { _xMinData[i]=xMaxData(i)-100; MSMessageLog::warningMessage("MSGraph::xMaximum set to less than MSGraph::xMinimum\n"); } else { _xMaxData[i]=xMinData(i)+100; MSMessageLog::warningMessage("MSGraph::xMinimum set to greater than MSGraph::xMaximum\n"); } } if (xMinData(i)==xMaxData(i)||fabs(xMaxData(i)/(xMaxData(i)-xMinData(i)))>MSGraph::_PrecisionRange) { _xMinData[i]=0.; _xMaxData[i]*=2.; if (xMaxData(i)==0.)_xMaxData[i]=100.; } if (xMinReal(i)==xMaxReal(i)||fabs(xMaxReal(i)/(xMaxReal(i)-xMinReal(i)))>MSGraph::_PrecisionRange) { _xMinReal[i]=0.; _xMaxReal[i]*=2.; if (xMaxReal(i)==0.)_xMaxReal[i]=100.; } xShowPos(xShowPos()!=MSTrue&&xMinData(i)<0?MSTrue:MSFalse); if (axis()==Std) { _showXaxis[1]=showX; _showYaxis[1]=showY; if (axisRule()==Axis) { _showXrule[1]=showX; _showYrule[1]=showY; } } } } int MSGraph::computeXscales(int& min,int& max,int xs_) { int submin,submax; int labelHeight=0; if (showXaxis(xs_)==MSTrue) { // XFontStruct *fi=(XFontStruct *)server()->fontStruct(xTitleFont(xs_)); MSString formatBuffer; XFontStruct *axisInfo=(XFontStruct *)server()->fontStruct(xLabelFont(xs_)); if (xLabelOut(xs_).formatType()!=MSFormat::NoFormat) { formatAxisLabel(formatBuffer.removeAll(),xLabelOut(xs_),xMinData(xs_)>1?rint(xMaxData(xs_)):xMinData(xs_)); min=XTextWidth(axisInfo,formatBuffer,formatBuffer.length()); formatAxisLabel(formatBuffer.removeAll(),xLabelOut(xs_),xMaxData(xs_)>1?rint(xMaxData(xs_)):xMaxData(xs_)); max=XTextWidth(axisInfo,formatBuffer,formatBuffer.length()); labelHeight=axisInfo->ascent+axisInfo->descent; min=MSLeft&xLabelAlign(xs_)?0:MSRight&xLabelAlign(xs_)?min:min/2; max=MSRight&xLabelAlign(xs_)?0:MSLeft&xLabelAlign(xs_)?max:max/2; } if (_xSubLabelOut[xs_]!=0&&xSubLabelOut(xs_).formatType()!=MSFormat::NoFormat) { formatAxisLabel(formatBuffer.removeAll(),xSubLabelOut(xs_),xMinData(xs_)>1?(double)((int)xMinData(xs_)):xMinData(xs_)); submin=XTextWidth(axisInfo,formatBuffer,formatBuffer.length()); formatAxisLabel(formatBuffer.removeAll(),xSubLabelOut(xs_),xMaxData(xs_)>1?(double)((int)xMaxData(xs_)):xMaxData(xs_)); submax=XTextWidth(axisInfo,formatBuffer,formatBuffer.length()); submin=MSLeft&xSubLabelAlign(xs_)?0:MSRight&xSubLabelAlign(xs_)?min:min/2; submax=MSRight&xSubLabelAlign(xs_)?0:MSLeft&xSubLabelAlign(xs_)?max:max/2; min=min>submin?min:submin; max=max>submax?max:submax; labelHeight+=axisInfo->ascent+axisInfo->descent; } } return labelHeight; } int MSGraph::computeYscale(int axis_) { int w; int tickPositionLength,labelWidth=0; double tempInc; double r,s; XFontStruct *axisInfo; MSString formatBuffer; _yBase[axis_]=yMode(axis_)==Ascending?yMinData(axis_):yMaxData(axis_); _yScale[axis_]=plotAreaRect()->height()/(yMaxData(axis_)-yMinData(axis_)); _yScale[axis_]*=yMode(axis_)==Ascending?1:-1; _y_org=plotAreaRect()->y()+plotAreaRect()->height(); if (yMode(0)==Ascending) { _y_end=(int)((double)y_org()-(yMaxData(0)-yBase(0))*yScale(0)); } else _y_end=plotAreaRect()->y(); if (showYaxis(axis_)==MSTrue) { axisInfo=(XFontStruct *)server()->fontStruct(yLabelFont(axis_)); if ((tickPositionLength=yLabelOut(axis_).tickPositionLength())!=0) { int labelLength=yLabelOut(axis_).labelLength(); for (int i=0;iyMaxData(axis_)) continue; if (labelLength>0) { if (ilabelWidth?w:labelWidth; } } else if (yMinData(axis_)!=yMaxData(axis_)) { if (yLabelIncrement(axis_)<=0.0) { r=((double)plotAreaRect()->height())/(axisInfo->ascent*3); r=(yMaxData(axis_)-yMinData(axis_))/r; tempInc=outFmt().snapNumber(r,yLabelOut(axis_)); if (fabs(yMinData(axis_)/tempInc)>MSGraph::_PrecisionRange) { _yIncData[axis_]=100/MSGraph::_PrecisionRange; } else _yIncData[axis_]=tempInc; } else { _yIncData[axis_]=yLabelIncrement(axis_); } r=yMinData(axis_)-fmod(yMinData(axis_),yIncData(axis_)); if (drawEndTicks()==MSTrue) { while (rlabelWidth)labelWidth=w; if (r+yIncData(axis_)==r) break; r+=yIncData(axis_); } } } return yLabelOut(axis_).formatType()==MSFormat::NoFormat?0:labelWidth; } void MSGraph::computeXincrement(int level_) { int w,w1,w2,x; int size; double r,scale,range; XFontStruct *fi; double min_inc,inc,tempInc; MSString formatBuffer; for (int i=0;i<2;i++) { fi=(XFontStruct *)server()->fontStruct(xLabelFont(i)); MSBoolean evaluate=MSTrue; if (xLabelIncrement(0)<=0.0) { range=xMaxData(i)-xMinData(i); range=rangeDBL_MAX?DBL_MAX:range; min_inc=outFmt().minimumNumber(xLabelOut(i)); if (min_inc==0.) min_inc=range/plotAreaRect()->width(); scale=1/min_inc; formatAxisLabel(formatBuffer.removeAll(),level_==0?xLabelOut(i):xSubLabelOut(i),graphMode()&Normalize?xMinReal(i):xMinData(i)); w1=XTextWidth(fi,formatBuffer,formatBuffer.length()); formatAxisLabel(formatBuffer.removeAll(),level_==0?xLabelOut(i):xSubLabelOut(i),graphMode()&Normalize?xMaxReal(i):xMaxData(i)); w2=XTextWidth(fi,formatBuffer,formatBuffer.length()); w=(w1=w2>w1?w2:(int)(w1*1.5))!=0?w1:100; inc=range*w/plotAreaRect()->width(); tempInc=outFmt().snapNumber(inc,level_==0?xLabelOut(i):xSubLabelOut(i)); if (fabs(xMinData(i)/tempInc)>MSGraph::_PrecisionRange) inc=100/MSGraph::_PrecisionRange; else inc=tempInc; while(evaluate==MSTrue) { size=0; r=xMinData(i)-fmod (xMinData(i),inc); if (drawEndTicks()==MSTrue) while (rsize?w:size; normalizedLabelInc(xv-xp); xp=xv; if (fabs(xMaxData(i)/inc)>MSGraph::_PrecisionRange) break; r+=inc; } if (scale*inc<1.5*size) // too big? { min_inc=inc; inc=outFmt().snapNumber((inc*1.001),level_==0?xLabelOut(i):xSubLabelOut(i)); } else if (scale*inc>3.*size) // too small? { r=outFmt().snipNumber((inc*.999),xLabelOut(i)); if (r>min_inc&&r<(1/MSGraph::_PrecisionRange)) inc=r; else evaluate=MSFalse; } else evaluate=MSFalse; } _xIncData[i][level_]=inc; } else _xIncData[i][level_]=xLabelIncrement(i); if (level_==0) { _xBase[i]=xMinData(i); _xScale[i]=plotAreaRect()->width()/(xMaxData(i)-xMinData(i)); _xScale[i]=(xScale(i)>INT_MAX/2)?INT_MAX/2:xScale(i); x=(int)((xMaxData(0)-xBase(0))*xScale(0)+plotAreaRect()->x()); _x_end=x<(plotAreaRect()->x()+plotAreaRect()->width()-1)?plotAreaRect()->x()+plotAreaRect()->width():x; // for normalized graphMode _xBaseReal[i]=xMinReal(i); _xScaleReal[i]=plotAreaRect()->width()/(xMaxReal(i)-xMinReal(i)); _xScaleReal[i]=(xScaleReal(i)>INT_MAX/2)?INT_MAX/2:xScaleReal(i); } } } void MSGraph::drawRule(void) { if (!(graphMode()&PieChart)) { for (int i=0; i<2; i++) { if (showXrule(i)==MSTrue||axisRule()==MSG::Box) { XSetForeground(display(),axisGC(),xAxisForeground(i)); int y=i==0?y_org():y_end(); XDrawLine(display(),graphPixmap(),axisGC(),x_org(),y,x_end(),y); } if (showYrule(i)==MSTrue||axisRule()==MSG::Box) { XSetForeground(display(),axisGC(),yAxisForeground(i)); int offset=axisRuleWidth()/2; int x=i==0?x_org():x_end(); XDrawLine(display(),graphPixmap(),axisGC(),x,y_org()+offset,x,y_end()-offset); } } } } void MSGraph::drawGrid(void) { int i,lw=gridWidth(); setLineAttributes(gridStyle(),gridWeight(),gridGC(),gridWidth(),CapButt,JoinMiter); for (i=0;iMSGraph::_MaxBufSize?MSGraph::_MaxBufSize:bufSize; XFontStruct *axisInfo=(XFontStruct *)server()->fontStruct(yLabelFont(axis_)); if (yGridCount()==0) { if (yGrid()!=0) delete [] yGrid(); _yGrid=new int[bufSize]; } XSetForeground(display(),axisGC(),yAxisForeground(axis_)); XSetFont(display(),axisGC(),yLabelFont(axis_)); XSegment *segments=new XSegment[bufSize]; double factor=yTickStyle(axis_)==MSNone?0:yTickStyle(axis_)==Inside?-1:1; sign=axis_==0?1:-1; int y_zero=yValueToPixel(0.0,axis_); x=axis_==0?x_org():x_end(); if (tickPositionLength!=0) { int gridWidthLength=yLabelOut(axis_).gridWidthLength(); int labelLength=yLabelOut(axis_).labelLength(); int tickSizeLength=yLabelOut(axis_).tickSizeLength(); if (gridWidthLength>0) { if (yGridWidth()!=0) delete [] yGridWidth(); _yGridWidth=new int[bufSize]; } for (unsigned i=0;iyMaxData(axis_)) continue; y=yValueToPixel(yLabelOut(axis_).tickPosition(i),axis_); tickSize=tickSizeLength==0?yMajorTickSize(axis_):int(yMajorTickSize(axis_)*yLabelOut(axis_).tickSize(i)); if (tickSize>0&&ct0&&yGridCount()0) { if (i0) { xx=x-(axisRuleWidth()+yTickStyle(axis_)==Inside?2:yMajorTickSize(axis_)+3)*sign; xx=MSLeft&yLabelAlign(axis_)||MSRight&yLabelAlign(axis_)? x+(axis_==1?1:-1)*(axisInfo->descent/4+axisRuleWidth()):xx; xx-=axis_==1?0:XTextWidth(axisInfo,formatBuffer,formatBuffer.length()); y+=MSBottom&yLabelAlign(axis_)?-axisRuleWidth()-axisInfo->descent/2: MSTop&yLabelAlign(axis_)?axisInfo->ascent:axisInfo->ascent/2; XDrawString(display(),graphPixmap(),axisGC(),axisInfo,xx,y,formatBuffer,formatBuffer.length()); } } } else { double r=yMinData(axis_)-fmod(yMinData(axis_),yIncData(axis_)); int majorTick=0; int minorTick=_yNumMinorTicks[axis_]+1; _yIncData[axis_] /=minorTick; while (r0) { segments[ct].x1=x+int(yTickStyle(axis_)&Inside&&yTickStyle(axis_)&Outside?yMajorTickSize(axis_):0)*sign; segments[ct].y1=segments[ct].y2=y; tickSize=(MSBottom&yLabelAlign(axis_)||MSTop&yLabelAlign(axis_))? _yLabelWidth[axis_]:yMajorTickSize(axis_); segments[ct++].x2=x-int(axisRuleWidth()+tickSize*factor)*sign; } if (yLabelOut(axis_).formatType()!=MSFormat::NoFormat) { double s=(fabs(r)/yIncData(axis_)<1.0)?0:r; formatAxisLabel(formatBuffer.removeAll(),yLabelOut(axis_),s); xx=x-(axisRuleWidth()+((yTickStyle(axis_)==Inside?0:yMajorTickSize(axis_))+3))*sign; xx=MSLeft&yLabelAlign(axis_)||MSRight&yLabelAlign(axis_)? x+(axis_==1?1:-1)*(axisInfo->descent/4+axisRuleWidth()):xx; xx-=axis_==1?0:XTextWidth(axisInfo,formatBuffer,formatBuffer.length()); y+=MSBottom&yLabelAlign(axis_)?-axisRuleWidth()-axisInfo->descent/2: MSTop&yLabelAlign(axis_)?axisInfo->ascent:axisInfo->ascent/2; XDrawString(display(),graphPixmap(),axisGC(),axisInfo,xx,y,formatBuffer,formatBuffer.length()); } } else { if (yMinorTickSize(axis_)>0) { segments[ct].x1=x+int(yTickStyle(axis_)&Inside&&yTickStyle(axis_)&Outside?yMinorTickSize(axis_):0)*sign; segments[ct].y1=segments[ct].y2=y; segments[ct++].x2=x-int(axisRuleWidth()+yMinorTickSize(axis_)*factor)*sign; } } r+=_yIncData[axis_]; majorTick++; } } XDrawSegments(display(),graphPixmap(),axisGC(),segments,ct); delete [] segments; } void MSGraph::drawXaxes(int axis_) { int w,x,y,yy; int bufSize,ct=0; double r,s,origin_y=(double)y_org(); MSString formatBuffer; int tickPositionLength; if ((tickPositionLength=xLabelOut(axis_).tickPositionLength())!=0) bufSize=10+tickPositionLength; else bufSize=(int)(10+(xMaxData(axis_)-xMinData(axis_))/xIncData(axis_)*(1+xNumMinorTicks(axis_))); bufSize=bufSize>MSGraph::_MaxBufSize?MSGraph::_MaxBufSize:bufSize; XFontStruct *axisInfo=(XFontStruct *)server()->fontStruct(xLabelFont(axis_)); if (xGridCount()==0) { if (xGrid()!=0) delete [] xGrid(); _xGrid=new int[bufSize]; } XSetForeground(display(),axisGC(),xAxisForeground(axis_)); XSetFont(display(),axisGC(),xLabelFont(axis_)); XSegment *segments=new XSegment[bufSize]; int sign=axis_==0?1:-1; int x_zero=xValueToPixel(0.0,axis_); double factor=xTickStyle(axis_)==MSNone?0:xTickStyle(axis_)&Inside?-1:1; y=axis_==0?y_org():y_end(); if (tickPositionLength!=0) { int gridWidthLength=xLabelOut(axis_).gridWidthLength(); int labelLength=xLabelOut(axis_).labelLength(); int tickSizeLength=xLabelOut(axis_).tickSizeLength(); if (gridWidthLength>0) { if (xGridWidth()!=0) delete [] xGridWidth(); _xGridWidth=new int[bufSize]; } for (unsigned i=0;ixMaxData(axis_)) continue; x=xValueToPixel(xLabelOut(axis_).tickPosition(i),axis_); int tickSize=tickSizeLength==0?xMajorTickSize(axis_):int(xMajorTickSize(axis_)*xLabelOut(axis_).tickSize(i)); if (tickSize>0&&ct0&&xGridCount()0) { if (i0) { w=XTextWidth(axisInfo,formatBuffer,formatBuffer.length()); x=MSRight&xLabelAlign(axis_)?x-w:MSLeft&xLabelAlign(axis_)?x:x-w/2; yy=y+(axisRuleWidth()+(sign==1?axisInfo->ascent:axisInfo->descent)+ (xTickStyle(axis_)&Inside?0:xMajorTickSize(axis_)))*sign; XDrawString(display(),graphPixmap(),axisGC(),axisInfo,x,yy,formatBuffer,formatBuffer.length()); } } } else { if (xLabelOut(axis_).formatType()==MSFormat::Time&&xMaxData(axis_)>0&&!(graphMode()&Normalize)) { r=outFmt().snapTime(xMinData(axis_),xIncData(axis_)); } else r=xMinData(axis_)-fmod(xMinData(axis_),xIncData(axis_)); int majorTick=0; int minorTick=_xNumMinorTicks[axis_]+1; _xIncData[axis_][0]/=minorTick; while (r0) { segments[ct].x1=segments[ct].x2=x; segments[ct].y1=y-(int)(xTickStyle(axis_)&Inside&&xTickStyle(axis_)&Outside? xMajorTickSize(axis_):0)*sign; segments[ct++].y2=y+(int)(axisRuleWidth()+xMajorTickSize(axis_)*factor)*sign; } s=(fabs(r)/xIncData(axis_)<1.0)?0:r; formatAxisLabel(formatBuffer.removeAll(),xLabelOut(axis_),graphMode()&Normalize?normalizedPixelToValue(x,axis_):s); if (xLabelOut(axis_).formatType()!=MSFormat::NoFormat&&formatBuffer.length()!=0) { w=XTextWidth(axisInfo,formatBuffer,formatBuffer.length()); x=MSRight&xLabelAlign(axis_)?x-w:MSLeft&xLabelAlign(axis_)?x:x-w/2; yy=y+(axisRuleWidth()+(sign==1?axisInfo->ascent:axisInfo->descent)+ (xTickStyle(axis_)&Inside?0:xMajorTickSize(axis_)))*sign; XDrawString(display(),graphPixmap(),axisGC(),axisInfo,x,yy,formatBuffer,formatBuffer.length()); } } else { if (xMinorTickSize(axis_)>0) { segments[ct].x1=segments[ct].x2=x; segments[ct].y1=y-(int)(xTickStyle(axis_)&Inside&&xTickStyle(axis_)&Outside? xMinorTickSize(axis_):0)*sign; segments[ct++].y2=y+(int)(axisRuleWidth()+xMinorTickSize(axis_)*factor)*sign; } } r+=_xIncData[axis_][0]; majorTick++; } } XDrawSegments(display(),graphPixmap(),axisGC(),segments,ct); delete [] segments; } void MSGraph::drawXsubLabels(int axis_) { int majorTick,minorTick; int x,y; int w; int tickPositionLength,axisLabelHeight; double r,s; MSString formatBuffer; XFontStruct *axisInfo; if (_xSubLabelOut[axis_]&&xSubLabelOut(axis_).formatType()!=MSFormat::NoFormat) { computeXincrement(1); axisInfo=(XFontStruct *)server()->fontStruct(xLabelFont(axis_)); axisLabelHeight=axisRuleWidth()+(xTickStyle(axis_)==Inside?0:xMajorTickSize(axis_))+ axisInfo->ascent+axisInfo->descent; y=axis_==0?(y_org()+axisLabelHeight+axisInfo->ascent): (y_end()-axisLabelHeight-axisInfo->descent); if ((tickPositionLength=xSubLabelOut(axis_).tickPositionLength())!=0) { int labelLength=xSubLabelOut(axis_).labelLength(); for (int i=0;ixMaxData(axis_)) continue; x=xValueToPixel(xSubLabelOut(axis_).tickPosition(i),axis_); if (labelLength>0) { if (i0) { w=XTextWidth(axisInfo,formatBuffer,formatBuffer.length()); x=MSRight&xSubLabelAlign(axis_)?x-w:MSLeft&xSubLabelAlign(axis_)?x:x-w/2; XDrawString(display(),graphPixmap(),axisGC(),axisInfo,x,y,formatBuffer,formatBuffer.length()); } } } else { if ((xSubLabelOut(axis_).formatType()==MSFormat::Time)&&xMaxData(axis_)>0) { r=outFmt().snapTime(xMinData(axis_),xIncData(axis_,1)); } else r=xMinData(axis_)-fmod(xMinData(axis_),xIncData(axis_,1)); majorTick=0; minorTick=_xNumMinorTicks[axis_]+1; _xIncData[axis_][1]/=minorTick; while (r0) { XFontStruct *fi=(XFontStruct *)server()->fontStruct(titleFont()); int y=offset()+fi->ascent; GC gc=XCreateGC(display(),window(),0,0); XSetFont(display(),gc,titleFont()); XSetForeground(display(),gc,titleForeground()); for (unsigned i=0;iascent+fi->descent; _titleHeight+=fi->ascent+fi->descent; } XFreeGC(display(),gc); } } void MSGraph::drawSubtitle(Window xwin_) { subtitleHeight(0); if (mapped()==MSTrue&&subtitle().maxLength()!=0) { XFontStruct *fi=(XFontStruct *)server()->fontStruct(subtitleFont()); int y=offset()+titleHeight()+fi->ascent+fi->descent; XSetFont(display(),subtitleGC(),subtitleFont()); XSetForeground(display(),subtitleGC(),subtitleForeground()); for (unsigned i=0;iascent+fi->descent; _subtitleHeight+=fi->ascent+fi->descent; } } } void MSGraph::drawFootnote(Window xwin_) { footnoteHeight(0); if (mapped()==MSTrue&&footnote().maxLength()>0) { XFontStruct *fi=(XFontStruct *)server()->fontStruct(footnoteFont()); int y=height()-offset()-fi->descent; XSetFont(display(),footnoteGC(),footnoteFont()); XSetForeground(display(),footnoteGC(),footnoteForeground()); for (int i=footnote().length()-1;i>=0;i--) { const char *cp=footnote()[i].string(); int len=footnote()[i].length(); int w=XTextWidth(fi,cp,len); int x=MSLeft&footnoteAlignment()?leftMargin():(MSRight&footnoteAlignment()? width()-rightMargin()-w:(width()-w)/2); XDrawString(display(),xwin_,footnoteGC(),fi,x,y,cp,len); y-=fi->ascent+fi->descent; _footnoteHeight+=fi->ascent+fi->descent; } } } void MSGraph::drawXtitle(void) { for (int i=0;i<2;i++) { if (showXaxis(i)==MSTrue&&xTitle(i).maxLength()!=0) { XFontStruct *fi=(XFontStruct *)server()->fontStruct(xLabelFont(i)); int labelHeight=(showXrule(i)==MSTrue?axisRuleWidth():0)+ (xTickStyle(i)==Inside?0:xMajorTickSize(i))+ (xLabelOut(i).formatType()==MSFormat::NoFormat?0:fi->ascent+fi->descent)+ (_xSubLabelOut[i]==0||xSubLabelOut(i).formatType()==MSFormat::NoFormat? 0:fi->ascent+fi->descent); fi=(XFontStruct *)server()->fontStruct(xTitleFont(i)); int y=i==0?y_org()+labelHeight+fi->ascent:y_end()-labelHeight-fi->descent- ((xTitle(i).length()-1)*(fi->ascent+fi->descent)); for (unsigned j=0;jwidth()-w)/2; XSetFont(display(),axisTitleGC(),xTitleFont(i)); XSetForeground(display(),axisTitleGC(),xTitleForeground(i)); XDrawString(display(),graphPixmap(),axisTitleGC(),fi, x,y,xTitle(i)(j).string(),xTitle(i)(j).length()); y+=fi->ascent+fi->descent; } } } } void MSGraph::drawYtitle(void) { int x,y; for (int i=0;i<2;i++) { XFontStruct *fit=(XFontStruct *)server()->fontStruct(yTitleFont(i)); if (showYaxis(i)==MSTrue&&yTitle(i).maxLength()!=0) { XSetFont(display(),axisTitleGC(),yTitleFont(i)); XSetForeground(display(),axisTitleGC(),yTitleForeground(i)); if (i==0) x=x_org()-_yRuleWidth[i]; else x=x_end()+_yRuleWidth[i]; if (yTitleAlign(i)&Vertical) { if (i==0) x+=fit->max_bounds.width; else x-=(yTitle(i).length()+2)*fit->max_bounds.width; for (unsigned j=0;jascent+fit->descent); y=yTitleAlign(i)&MSTop?y_end():MSBottom&yTitleAlign(i)?y_org()-ht: y_end()+(plotAreaRect()->height()-ht)/2; drawVerticalString(axisTitleGC(),x,y,yTitle(i)(j).string(),yTitle(i)(j).length(),fit); x+=2*fit->max_bounds.width; } } else { int xend=x_end()+_yStringWidth; int xorg=plotAreaRect()->x()-_yStringWidth; XFontStruct *fil=(XFontStruct *)server()->fontStruct(xLabelFont(1)); int h=showXaxis(1)!=MSTrue?0:((showXrule(1)==MSTrue?axisRuleWidth():0)+ (xTickStyle(1)==Inside?0:xMajorTickSize(1))+ (xLabelOut(1).formatType()==MSFormat::NoFormat?0:fil->ascent+fil->descent)+ (_xSubLabelOut[1]!=0&&xSubLabelOut(1).formatType()==MSFormat::NoFormat?0: fil->ascent+fil->descent)); for (unsigned j=0;jw?x_end():width()-w: MSRight&yTitleAlign(i)?i==0?x_org()>w?x_org()-w:offset():x_end()-w:i==0?x_org():x_end()-w; fil=(XFontStruct *)server()->fontStruct(yLabelFont(i)); y=y_end()-fit->descent-h-((yTitle(i).length()-j-1)*(fit->ascent+fit->descent)); int lh=fil->ascent+fil->descent; y-=MSBottom&yLabelAlign(i)?lh:MSTop&yLabelAlign(i)?fil->descent:lh/2; XDrawString(display(),graphPixmap(),axisTitleGC(),fit,x,y, yTitle(i)(j).string(),yTitle(i)(j).length()); } } } } } void MSGraph::drawVerticalString(GC gc_,int x_,int y_,const char* string_,int length_,XFontStruct *fi_) { int fontHeight=fi_->ascent+fi_->descent; y_+=fi_->ascent; for (int i=0; imax_bounds.width-XTextWidth(fi_,string_+i,1))/2; XDrawString (display(),graphPixmap(),gc_,fi_,x_+p,y_,string_+i,1); y_+=fontHeight; } } void MSGraph::drawZeroAxis(void) { int x=xValueToPixel(0.0,MSTop&zeroAxis()?1:0); int y=yValueToPixel(0.0,MSRight&zeroAxis()?1:0); setLineAttributes(zeroAxisStyle(),zeroAxisWeight(),zeroGC(),zeroAxisWidth(),CapButt,JoinMiter); if ((MSBottom&zeroAxis()||MSTop&zeroAxis())&&y>y_end()&&y<(y_org()-10)&&y>(y_end()+10)) { XDrawLine(display(),graphPixmap(),zeroGC(),x_org(),y,x_end(),y); } if ((MSLeft&zeroAxis()||MSRight&zeroAxis())&&x(x_org()+10)&&x<(x_end()-10)) { XDrawLine(display(),graphPixmap(),zeroGC(),x,y_end(),x,y_org()); } } void MSGraph::computeLegendSize(void) { int size=0,columnCount=1; int rowCount,itemCount=0; int lw,h=0,w=0; MSTrace *trace; if (mapped()==MSTrue&&legendAlignment()!=MSNone&&frozen()!=MSTrue) { if (graphMode()&PieChart||(traceList().count()==1&&graphTrace(0)!=0&&graphTrace(0)->style()==Pie)) { if ((trace=graphTrace(0))!=0&&trace->traceSet()->pieLegendAlignment()!=MSNone) { legendWidth(w); legendHeight(h); return; } } legend()->textFieldWidth(0); if (legendStyle()==LastValue) { legend()->valueWidth(XTextWidth(legend()->fontInfo(),"0",1)*_yStringWidth+legend()->spacing()); } for (unsigned i=0;idataCount()>0&&trace->style()!=0&& trace->style()!=MSG::Text&&trace->legend()!=0&&strlen(trace->legend())>0) { if (Pie&trace->style()) { for (unsigned k=0;kdataCount();k++,itemCount++) { int w=XTextWidth(legend()->fontInfo(),trace->legend(k),strlen(trace->legend(k))); size=size>w?size:w; } } else if (legend()->valueWidth()>0) { itemCount++; if (HLOC&trace->style()||Candle&trace->style()) { size=XTextWidth(legend()->fontInfo(),"CLOSE:00",8); itemCount+=4; } else if (HLC&trace->style()) { size=XTextWidth(legend()->fontInfo(),"CLOSE:00",8); itemCount+=3; } else if (HL&trace->style()) { size=XTextWidth(legend()->fontInfo(),"HIGH:00",8); itemCount+=2; } else size=XTextWidth(legend()->fontInfo(),trace->legend(),strlen(trace->legend())); } else { itemCount++; size=XTextWidth(legend()->fontInfo(),trace->legend(),strlen(trace->legend())); } if (size>legend()->textFieldWidth())legend()->textFieldWidth(size); } } if (itemCount>0) { rowCount=itemCount; lw=legend()->textFieldWidth()+legend()->symbolWidth()+legend()->spacing(); w=lw+2*legend()->insideMargin()+(legend()->valueWidth()>0?legend()->spacing()+legend()->valueWidth():0); h=itemCount*(legend()->textHeight()+legend()->leading())+2*legend()->insideMargin(); if (legendStyle()==Horizontal) { if (itemCount<4) { columnCount=itemCount; rowCount=1; } else if (itemCount==4) { columnCount=2; rowCount=2; } else if (itemCount>4) { columnCount=3; if ((itemCount%3)==0)rowCount=itemCount/3; else rowCount=itemCount/3+1; } h=rowCount*(legend()->textHeight()+legend()->leading())+2*legend()->insideMargin(); w=columnCount*lw+(columnCount-1)*legend()->spacing()+2*legend()->insideMargin(); } } legend()->columnCount(columnCount); } legendWidth(w); legendHeight(h); } void MSGraph::drawLegends(void) { int itemCount=0; int lastRow; MSTrace *trace; const static char *hlText[]={"OPEN:","HIGH:","LOW:","CLOSE:"}; unsigned long bg=legend()->background(); if ((mapped()==MSTrue&&frozen()!=MSTrue)||outputMode()==Print) { if (legendAlignment()==MSNone||legendHeight()==0) { legend()->unmap(); } else { legend()->resize(legendWidth(),legendHeight()); legend()->map(); positionLegend(legendAlignment()); legend()->highlightColor(foreground()); legend()->selectInput(); if (highlightLegendStatus()==MSTrue) legend()->background(legend()->foreground()); legend()->clear(); int x=legend()->insideMargin(); int y=legend()->insideMargin()+2; for (unsigned i=0;istyle()==Pie) { for (unsigned k=0;kdataCount();k++) { XClearArea(display(),legend()->window(),x,y+legend()->textHeight()/2, legend()->symbolWidth(),legend()->textHeight(),False); drawLegendSymbols(trace,x,y+legend()->textHeight()/2,k); XSetForeground(display(),legend()->gc(),highlightLegendStatus()==MSTrue?bg:legend()->foreground()); XDrawString(display(),legend()->window(),legend()->gc(),legend()->fontInfo(), x+legend()->symbolWidth()+legend()->spacing(), y+legend()->fontInfo()->ascent, trace->legend(k),strlen(trace->legend(k))); int lw=legend()->textFieldWidth()+legend()->symbolWidth()+legend()->spacing(); if (legendStyle()==Horizontal) { if ((itemCount%legend()->columnCount())==0) { y+=legend()->textHeight()+legend()->leading(); x=legend()->insideMargin(); } else x+=lw+legend()->spacing(); } else y+=legend()->textHeight()+legend()->leading(); } } else if ((trace=graphTrace(i))!=0&&trace->style()!=0&& trace->dataCount()>0&&trace->style()!=MSG::Text&&trace->legend()!=0&&strlen(trace->legend())>0) { ++itemCount; XClearArea(display(),legend()->window(),x,y+legend()->textHeight()/2, legend()->symbolWidth(),legend()->textHeight(),False); drawLegendSymbols(trace,x,y+legend()->textHeight()/2); XSetForeground(display(),legend()->gc(),highlightLegendStatus()==MSTrue?bg:legend()->foreground()); XDrawString(display(),legend()->window(),legend()->gc(),legend()->fontInfo(), x+legend()->symbolWidth()+legend()->spacing(), y+legend()->fontInfo()->ascent, trace->legend(),strlen(trace->legend())); if (legend()->valueWidth()>0) { int dataOffset=trace->offset(); if (HLOC&trace->style()||Candle&trace->style()) { lastRow=4; dataOffset=0; } else if (HLC&trace->style()) lastRow=4; else if (HL&trace->style()) lastRow=3; else lastRow=0; for (unsigned j=dataOffset;jtextHeight()+legend()->leading(); XDrawString(display(),legend()->window(),legend()->gc(),legend()->fontInfo(), x+legend()->symbolWidth()+2*legend()->spacing(), y+legend()->fontInfo()->ascent, hlText[j],strlen(hlText[j]) ); } } int lw=legend()->textFieldWidth()+legend()->symbolWidth()+legend()->spacing(); if (legendStyle()==Horizontal) { if ((itemCount%legend()->columnCount())==0) { y+=legend()->textHeight()+legend()->leading(); x=legend()->insideMargin(); } else x+=lw+legend()->spacing(); } else y+=legend()->textHeight()+legend()->leading(); } } if (legendStyle()==LastValue) drawScanXvalues(); legend()->drawHighlight(); legend()->drawShadow(); legend()->selectInput(ExposureMask); legend()->background(bg); updateLegendStatus(MSFalse); } } } void MSGraph::drawLegendSymbols(MSTrace *trace_,int x_,int y_,int index_) { int offset; XGCValues values; unsigned long mask=GCLineWidth|GCForeground; switch (trace_->style()) { case MSG::Text: case MarketProfile: case ColorProfile: break; case Close: case Segment: case Line: case MSG::Outline: case Step: case HL: case Osc: case Line|Scatter: case Step|Scatter: setLineAttributes(trace_->lineStyle(),trace_->lineWeight(),legend()->gc(), trace_->lineWidth(),CapButt,JoinRound); values.line_width=(trace_->lineWidth()>=4)?4:trace_->lineWidth(); values.foreground=trace_->lineColor(); XChangeGC(display(),legend()->gc(),mask,&values); XDrawLine(display(),legend()->window(),legend()->gc(),x_,y_+1,x_+legend()->symbolWidth(),y_+1); if ((Scatter&trace_->style())==0) break; case Scatter: XSetForeground(display(),legend()->gc(),trace_->lineColor()); XSetLineAttributes(display(),legend()->gc(),1,LineSolid,CapButt,JoinMiter); offset=(trace_->lineWidth()<=1)?1:0; XSetForeground(display(),legend()->gc(),trace_->fillColor()); if (MSG::Text&trace_->symbol()) { legend()->symbolFont(adjustFontSize(trace_->font(),legend()->textHeight())); XSetFont(display(),legend()->gc(),legend()->symbolFont()); } drawLegendScatterSymbols(legend()->window(),legend()->gc(),trace_,x_+legend()->symbolWidth()/2,y_+offset); XSetFont(display(),legend()->gc(),legend()->font()); break; case Candle: setLineAttributes(trace_->lineStyle(),trace_->lineWeight(),legend()->gc(), trace_->lineWidth(),CapButt,JoinRound); values.line_width=2; values.foreground=trace_->lineColor(2); XChangeGC (display(),legend()->gc(),mask,&values); XDrawLine(display(),legend()->window(),legend()->gc(),x_,y_+1,x_+legend()->symbolWidth(),y_+1); setLineAttributes(trace_->lineStyle(),trace_->lineWeight(),legend()->gc(),1,CapButt,JoinRound); offset=legend()->symbolWidth()/4; PFillRectangle(display(),legend()->window(),legend()->gc(),x_+offset,y_-3,2*offset,7); XSetForeground(display(), legend()->gc(),trace_->lineColor(3)); XDrawRectangle(display(),legend()->window(),legend()->gc(),x_+offset,y_-3,2*offset,7); break; case HLOC: case HLC: setLineAttributes(trace_->lineStyle(),trace_->lineWeight(),legend()->gc(), trace_->lineWidth(),CapButt,JoinRound); values.line_width=(trace_->lineWidth()>=2)?2:trace_->lineWidth(); values.foreground=trace_->lineColor(3+trace_->offset()); XChangeGC (display(),legend()->gc(),mask,&values); offset=legend()->symbolWidth()/4; XDrawLine(display(),legend()->window(),legend()->gc(),x_+offset,y_,x_+offset,y_+legend()->spacing()/2); if (trace_->style()!=HLC) { offset=legend()->symbolWidth()-legend()->symbolWidth()/4; XSetForeground(display(),legend()->gc(),trace_->lineColor(1)); XDrawLine(display(),legend()->window(),legend()->gc(), x_+offset,y_,x_+offset,y_-legend()->spacing()/2); } XSetForeground(display(),legend()->gc(),trace_->lineColor(2)); XDrawLine(display(),legend()->window(),legend()->gc(),x_,y_,x_+legend()->symbolWidth(),y_); break; case Fill: case Area: case Bar: case Pie: case Stack: XSetLineAttributes(display(),legend()->gc(),1,LineSolid,CapProjecting,JoinMiter); unsigned long fillColor=trace_->fillColor(); unsigned long lineColor=trace_->lineColor(); if (trace_->style()==Pie) { fillColor=trace_->fillColor(index_); lineColor=trace_->lineColor(index_); } XSetForeground(display(),legend()->gc(),fillColor); if (trace_->stipple()!=0) { XSetStipple(display(),legend()->gc(),trace_->stipple()); XSetFillStyle(display(),legend()->gc(),FillOpaqueStippled); } PFillRectangle(display(),legend()->window(),legend()->gc(), x_,y_-legend()->textHeight()/2+2, legend()->symbolWidth(),legend()->textHeight()-4); if (trace_->stipple()!=0) XSetFillStyle(display(),legend()->gc(),FillSolid); XSetForeground(display(),legend()->gc(),lineColor); XDrawRectangle(display(),legend()->window(),legend()->gc(), x_,y_-legend()->textHeight()/2+2, legend()->symbolWidth(),legend()->textHeight()-4); break; } } void MSGraph::drawLegendScatterSymbols(Window xwin_,GC gc_,MSTrace *trace_,int x_,int y_) { int size,count=0; char* array=0; int bufSize=MSGraph::_MinBufSize; XFontStruct *fontInfo=0; size=trace_->symbolSize(); switch (trace_->symbol()) { case Square: case Square|Fill: case Square|Circle: array=new char[sizeof(XRectangle)*bufSize]; buildSquareSymbol(array,count,x_,y_,size); break; case Circle: case Circle|Fill: array=new char[sizeof(XArc)*bufSize]; buildCircleSymbol(array,count,x_,y_,size); break; case X: array=new char[sizeof(XSegment)*2*bufSize]; buildXSymbol(array,count,x_,y_,size); break; case Cross: array=new char[sizeof(XSegment)*2*bufSize]; buildCrossSymbol(array,count,x_,y_,size); break; case X|Cross: array=new char[sizeof(XSegment)*4*bufSize]; buildStarSymbol(array,count,x_,y_,size); break; case Triangle: if (outputMode()==Print) { array=new char[sizeof(XSegment)*3*bufSize]; buildTrianglePrintSymbol(array,count,x_,y_,size); break; } array=new char[sizeof(XPoint)*size*3*bufSize]; buildTriangleSymbol(array,count,x_,y_,size); break; case Triangle|Fill: array=new char[sizeof(XPoint)*size*3*bufSize]; buildTriangleSymbol(array,count,x_,y_,size); PFillPolygon(display(),xwin_,gc_,(XPoint*)array,count,Convex,CoordModeOrigin); break; case Diamond: if (outputMode()==Print) { array=new char[sizeof(XSegment)*4*bufSize]; buildDiamondPrintSymbol(array,count,x_,y_,size); break; } array=new char[sizeof(XPoint)*size*2*bufSize]; buildDiamondSymbol(array,count,x_,y_,size); break; case Diamond|Fill: array=new char[sizeof(XPoint)*size*2*bufSize]; buildDiamondSymbol(array,count,x_,y_,size); PFillPolygon(display(),xwin_,gc_,(XPoint*)array,count,Convex,CoordModeOrigin); break; case MSG::Text: array=new char[sizeof(XPoint)*bufSize]; buildCharSymbol(array,count,x_,y_,size); fontInfo=(XFontStruct *)server()->fontStruct(legend()->symbolFont()); break; default: return; } drawScatterSymbols(xwin_,gc_,trace_,array,count,trace_->lineColor(),trace_->fillColor(),fontInfo); delete [] array; } void MSGraph::positionLegend(unsigned long align_) { int x,y,space=10; int offsets=legend()->offset()+offset(); if (legend()->mapped()==MSTrue) { if (align_&Outside) { int top=align_&Vertical?titleHeight()+subtitleHeight()+offset()+space:y_end(); int bot=align_&Vertical?height()-footnoteHeight()-legend()->height()-space:y_org()-legend()->height(); x=align_&MSLeft?space:align_&MSRight?width()-legend()->width()-space:align_&MSCenter? align_&Vertical?((width()-legend()->width())/2):space:space; y=align_&MSTop?top:align_&MSBottom?bot:align_&MSCenter?align_&Vertical? top:((height()-legend()->height())/2):top; if (xLegendPosition()>0&&align_&Vertical) { x=(int)(xLegendPosition()*width()); x=x(width()-legend()->width()-offsets)? width()-legend()->width()-offsets:x; } if (yLegendPosition()>0&&!(align_&Vertical)) { y=(int)(yLegendPosition()*height()); y=y>height()?height()-legend()->height()-offsets:ymoveTo(x,y); } else if (xLegendPosition()>0&&yLegendPosition()>0) { x=(int)(xLegendPosition()*width()); y=(int)(yLegendPosition()*height()); x=x(width()-legend()->width()-offsets)?width()-legend()->width()-offsets:x; y=y>(height()-legend()->height()-offsets)?height()-legend()->height()-offsets:ymoveTo(x,y); } else { x=align_&MSLeft?x_org()+space:align_&MSRight?x_end()-legend()->width()-space: (x_org()+(plotAreaRect()->width()-legend()->width())/2); y=align_&MSTop?y_end()+space:align_&MSBottom?y_org()-legend()->height()-space: (y_end()+(plotAreaRect()->height()-legend()->height())/2); legend()->moveTo(x,y); } } } int MSGraph::fontSize(Font font_) { const char *numbers="0123456789"; const char *n,*fontStr; int ret=0; if ((fontStr=server()->fontName(font_))!=0) { if ((n=strpbrk((char*)(void*)fontStr,numbers))!=0) // cast: bug in Borland { ret=atoi(n); } } return ret; } Font MSGraph::adjustFontSize(Font font_,int size_) { const char *numbers="0123456789"; char *n,tmp[3]; const char *fontStr=server()->fontName(font_); if (fontStr!=0) { if ((n=strpbrk((char*)(void*)fontStr,numbers))!=0) // cast: bug in Borland { sprintf(tmp,"%u",size_>100?99:size_); strcpy(n,tmp); } } return server()->fontID(fontStr); } void MSGraph::visibilityObscured(void) { visible(MSFalse); int n=traceSetList().count(); for (int i=0;icolorName(axisForeground((MSAlignment)axisValues(i))))+","+axisNames(i); avList_<fontName(axisLabelFont((MSAlignment)axisValues(i))))+","+axisNames(i); avList_<colorName(axisTitleForeground((MSAlignment)axisValues(i))))+","+axisNames(i); avList_<fontName(axisTitleFont((MSAlignment)axisValues(i))))+","+axisNames(i); avList_<fontName(footnoteFont()),MSAttrValue::Font); avList_<colorName(footnoteForeground()),MSAttrValue::Color); avList_<colorName(gridForeground()),MSAttrValue::Color); optionNames="MSSolid\nMSDash\nMSDot\nMSDash|MSDot"; optionValues.removeAll(); optionValues.append(MSSolid); optionValues.append(MSDash); optionValues.append(MSDot); optionValues.append(MSDash|MSDot); value=MSAttrValue::enumToString(gridStyle(),optionNames,optionValues,"MSSolid",MSTrue); avList_<fontName(legendFont()),MSAttrValue::Font); avList_<colorName(legendForeground()),MSAttrValue::Color); avList_<colorName(legendBackground()),MSAttrValue::Color); avList_<fontName(subtitleFont()),MSAttrValue::Font); avList_<colorName(subtitleForeground()),MSAttrValue::Color); avList_<colorName(zeroAxisForeground()),MSAttrValue::Color); optionNames="MSSolid\nMSDash\nMSDot\nMSDash|MSDot"; optionValues.removeAll(); optionValues.append(MSSolid); optionValues.append(MSDash); optionValues.append(MSDot); optionValues.append(MSDash|MSDot); value=MSAttrValue::enumToString(zeroAxisStyle(),optionNames,optionValues,"MSSolid",MSTrue); avList_<0) justification(temp); _style=style_^temp; return *this; } MSGraph& MSGraph::pageAlignment(unsigned long x_) {MSPrintItem::pageAlignment(x_); return *this;} MSGraph& MSGraph::pageAlignment(MSAlignment x_) {return pageAlignment((unsigned long)x_);} const MSSymbol& MSGraph::printTag(void) const {return tag();} double MSGraph::leftMargin(void) const {return MSPrintItem::leftMargin();} double MSGraph::rightMargin(void) const {return MSPrintItem::rightMargin();} double MSGraph::topOffset(void) const {return MSPrintItem::topOffset();} double MSGraph::bottomOffset(void) const {return MSPrintItem::bottomOffset();} unsigned MSGraph::topPixel(void) const {return MSPrintItem::topPixel();} unsigned MSGraph::bottomPixel(void) const {return MSPrintItem::bottomPixel();} unsigned long MSGraph::justification(void) const {return MSPrintItem::justification();} int MSGraph::printRow(void) const {return MSPrintItem::printRow();} int MSGraph::printColumn(void) const {return MSPrintItem::printColumn();} unsigned long MSGraph::style(void) const {return _style;} unsigned long MSGraph::pageAlignment(void) const {return MSPrintItem::pageAlignment();} int MSGraph::computePrintSize(MSReport *report_,int,int y_,int w_,int,int topMargins_,int margins_) { reset(); if (leftPixel()<0) leftPixel(report_->leftPixel()); if (rightPixel()<0) rightPixel(report_->rightPixel()); margins_=(margins_==0?leftPixel()+rightPixel():margins_); pageWidth(w_-margins_); printWidth(printWidth()>0&&printWidth()pageEnd()-topMargins_-topPixel(); h=printHeight()>0&&printHeight()bodyTop(report_->pageCount()); if (h>remainingHeight||(pageAlignment()&MSTop&&y_!=top)) { _pageCount++; y_=report_->bodyTop(report_->pageCount()+1); remainingHeight=y_-report_->bodyBottom(report_->pageCount()+1)-topMargins_-topPixel(); } int resid=0; if (hpageEnd()+bottomIndent_; int remainingHeight=y_-pageEnd; if (printHeight()>=remainingHeight|| (pageBreakRow()==-1&&pageAlignment()&MSTop&&y_!=report_->bodyTop(report_->pageCount()))) { pageBreakRow(0); _currentPage++; return remainingHeight; } if (pageAlignment()&MSCenter) { y_-=(remainingHeight-printHeight())/2; } else if (pageAlignment()&MSBottom) { y_=pageEnd+printHeight(); } int x=x_+(margin_==0?leftPixel():margin_); x=justification()&MSRight?x+pageWidth()-printWidth(): justification()&MSCenter?x+(pageWidth()-printWidth())/2:x; int wScreen=width(); int hScreen=height(); int frameLeft=style()&MSP::Box||style()&MSP::BoxL?frameLineWidth():0; int frameRight=style()&MSP::Box||style()&MSP::BoxR?frameLineWidth():0; int frameTop=style()&MSP::Box||style()&MSP::BoxT?frameLineWidth():0; int frameBottom=style()&MSP::Box||style()&MSP::BoxB?frameLineWidth():0; MSRect::width(printWidth()-frameLeft-frameRight); MSRect::height(printHeight()-frameTop-frameBottom); outputMode(Print); int h=printGraph(report_,x,y_-printHeight()-topPixel()); outputMode(Draw); MSRect::width(wScreen); MSRect::height(hScreen); _currentPage++; return residual(); } int MSGraph::printGraph(MSReport *report_,int x_,int y_) { int h=0; displayPrintStream().open(report_->adjustedFileName()); if (displayPrintStream().fail()!=ios::failbit) { int frameThickness=frameLineWidth(); int x=x_+(style()&MSP::Box||style()&MSP::BoxL?frameThickness:0); int y=y_-(style()&MSP::Box||style()&MSP::BoxT?frameThickness:0); displayPrintInit(this); printGraphFrame(report_,x_,y_+printHeight(),printWidth(),printHeight()); report_->postScriptStackInit(); report_->pout<<"gs 1 sg 1 w n"<< endl; report_->pout<<"12/"<defaultFontString()<<" font"<< endl; report_->translate(x,y); redrawForPrint(); displayPrintClear(); report_->pout<<"gr"; report_->pout<gcValues().line_width=frameLineWidth(); report_->fgGrayScale(0.0); report_->printBox(style(),x_,y_,w_,h_); } aplus-fsf-4.22/src/MSGUI/MSGraphPlot.C0000644000265000001440000025764110772770404012764 ///////////////////////////////////////////////////////////////////////////////// // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include extern const int MSDegPerRadian; void MSGraph::drawGraph(MSBoolean update_) { switch(orientation()) { case Horizontal: drawHtraces(update_); break; default: drawVtraces(update_); break; } } void MSGraph::drawHtraces(MSBoolean update_) { int start,end,bufSize; int count=0,textCount=0; MSTrace *trace; MSTrace **stackTrace=new MSTrace*[traceList().count()]; MSTrace **textTrace=new MSTrace*[traceList().count()]; int stackCount=0; unsigned i=0; for (i=0;istyle()==Stack) { stackTrace[stackCount++]=trace; } else if(trace->style()==MSG::Text) { if(trace->traceSet()->textLength()!=0&&trace->dataCount()==1) { textTrace[textCount++]=trace; } } } } for (i=0;itraceSet()->overlap()!=MSTrue?trace->traceSet()->updateIndex():0; end=trace->dataCount(); start=start>end?0:start; bufSize=end-start; bufSize=bufSize>MSGraph::_MaxBufSize?MSGraph::_MaxBufSize: bufSizestipple()!=0) { XSetStipple(display(),traceGC(),trace->stipple()); XSetFillStyle(display(),traceGC(),FillOpaqueStippled); } switch (trace->style()) { case Bar: plotBarTrace(trace,start,end,bufSize,count); count++; break; case Stack: if (stackCount>0) plotStackTrace(stackTrace,stackCount,count,update_); count++; break; } } } if (textCount>0) plotTextTrace(textTrace,textCount); delete [] textTrace; delete [] stackTrace; } void MSGraph::drawVtraces(MSBoolean update_) { int areaCount=0,stackCount=0,textCount=0,fillCount=0,pieCount=0,count=0; unsigned i; XRectangle clipRect; int start,end,bufSize; MSTrace *trace; MSTrace **areaTrace=new MSTrace*[traceList().count()]; MSTrace **stackTrace=new MSTrace*[traceList().count()]; MSTrace **pieTrace=new MSTrace*[traceList().count()]; MSTrace **textTrace=new MSTrace*[traceList().count()]; MSTrace **fillTrace=new MSTrace*[traceList().count()]; int rule_width=axisRuleWidth()==0?1:axisRuleWidth(); _marketProfileStatus=MSFalse; if (update_!=MSTrue) { clipRect.x=x_org(); //-rule_width; clipRect.y=y_end(); //-rule_width; clipRect.width=plotAreaRect()->width()+rule_width; clipRect.height=plotAreaRect()->height()+rule_width; XSetClipRectangles(display(),traceGC(),0,0,&clipRect,1,Unsorted); } for (i=0;istyle()==Pie) { pieTrace[pieCount++]=trace; } else if (trace->style()==Area) { areaTrace[areaCount++]=trace; } else if (trace->style()==Stack) { stackTrace[stackCount++]=trace; } else if (trace->style()==MSG::Text&&trace->traceSet()->textLength()!=0&&trace->dataCount()==1) { textTrace[textCount++]=trace; } else if (trace->style()==Fill) { fillTrace[fillCount++]=trace; } } } if (areaCount>0) plotAreaTrace(areaTrace,areaCount,update_); for (i=0;itraceSet()->overlap()!=MSTrue?trace->traceSet()->updateIndex():0; end=trace->dataCount(); start=start>end?0:start; bufSize=end-start; bufSize=bufSize>MSGraph::_MaxBufSize?MSGraph::_MaxBufSize: bufSizestipple()!=0) { XSetStipple(display(),traceGC(),trace->stipple()); XSetFillStyle(display(),traceGC(),FillOpaqueStippled); } switch (trace->style()) { case MSG::Text: case Area: case Fill: break; case Line: case Line|Scatter: plotLineTrace(trace,start,end,bufSize); if (trace->style()==Line) break; case Scatter: plotScatterTrace(trace,start,end,bufSize); if (update_!=MSTrue) XSetClipRectangles(display(),traceGC(),0,0,&clipRect,1,Unsorted); break; case Step: case Step|Scatter: plotStepTrace(trace,start,end,bufSize); if (trace->style()==Step) break; plotScatterTrace(trace,start,end,bufSize); if (update_!=MSTrue) XSetClipRectangles(display(),traceGC(),0,0,&clipRect,1,Unsorted); break; case MSG::Outline: plotOutlineTrace(trace,start,end,bufSize); break; case Bar: plotBarTrace(trace,start,end,bufSize,count); count++; break; case Stack: if (stackCount>0) plotStackTrace(stackTrace,stackCount,count,update_); count++; break; case Close: plotLineTrace(trace,start,end,bufSize); break; case HL: plotHighLowTrace(trace,start,end,bufSize); break; case HLOC: plotOpenTicks(trace,start,end,bufSize); plotCloseTicks(trace,start,end,bufSize); plotHighLowTrace(trace,start,end,bufSize); break; case HLC: plotCloseTicks(trace,start,end,bufSize); plotHighLowTrace(trace,start,end,bufSize); break; case Candle: plotCandleTrace(trace,start,end,bufSize); break; case Osc: plotLineTrace(trace,start,end,bufSize); // plotBetweenTrace(trace,update_); break; case MarketProfile: case ColorProfile: if (update_!=MSTrue) plotMarketProfile(trace,bufSize); _marketProfileStatus=MSTrue; break; case Segment: plotSegmentTrace(trace,graphPixmap(),traceGC()); break; } } } if (textCount>0) plotTextTrace(textTrace,textCount); delete [] areaTrace; delete [] pieTrace; delete [] stackTrace; delete [] textTrace; delete [] fillTrace; } void MSGraph::plotLineTrace(MSTrace *trace_,int start_,int end_,int bufSize_) { int k,xs,ys; int x,y; int pointCount=0; int xLast=0,yLast=0; XPoint *points; if (trace_->dataCount()<2) return; start_=start_!=0?start_-1:start_; xs=trace_->xAxis(); ys=trace_->yAxis(); XSetForeground(display(),traceGC(),trace_->lineColor()); setLineAttributes(trace_->lineStyle(),trace_->lineWeight(),traceGC(),trace_->lineWidth(),CapButt,JoinRound); points=new XPoint[bufSize_+2]; for (k=start_;ky(k),ys); if (x==xLast&&y==yLast) continue; xLast=x; yLast=y; points[pointCount].x=x; points[pointCount++].y=y; if (pointCount>=bufSize_) { XDrawLines(display(),graphPixmap(),traceGC(),points,pointCount,CoordModeOrigin); pointCount=0; } } if (pointCount>0) { XDrawLines(display(),graphPixmap(),traceGC(),points,pointCount,CoordModeOrigin); } delete [] points; } void MSGraph::plotSegmentTrace(MSTrace *trace_,Window xwin_,GC gc_) { int k,xs,ys; int x,y,xx,yy; int pointCount=0; int x1_last=0,y1_last=0; int x2_last=0,y2_last=0; XSegment *segments; if (trace_->dataCount()<2) return; xs=trace_->xAxis(); ys=trace_->yAxis(); int bufSize=trace_->dataCount()/2;; bufSize=bufSize>MSGraph::_MaxBufSize?MSGraph::_MaxBufSize: bufSizelineColor()); setLineAttributes(trace_->lineStyle(),trace_->lineWeight(),traceGC(),trace_->lineWidth(),CapButt,JoinRound); } for (k=0;kdataCount()-1;k+=2) { x=xValueToPixel(xValue(trace_,k),xs); y=yValueToPixel(trace_->y(k),ys); xx=xValueToPixel(xValue(trace_,k+1),xs); yy=yValueToPixel(trace_->y(k+1),ys); if (x==x1_last&&y==y1_last&&xx==x2_last&&y==y2_last) continue; x1_last=x; y1_last=y; x2_last=xx; y2_last=yy; segments[pointCount].x1=x+trace_->xOffset(); segments[pointCount].y1=y+trace_->yOffset(); segments[pointCount].x2=xx+trace_->xOffset(); segments[pointCount++].y2=yy+trace_->yOffset(); if (pointCount>=bufSize) { XDrawSegments(display(),xwin_,gc_,segments,pointCount); pointCount=0; } } XDrawSegments(display(),xwin_,gc_,segments,pointCount); delete [] segments; } void MSGraph::plotFillTrace(MSTrace *trace_,MSBoolean update_) { int k,xs,ys; int x,y; int pointCount=0; int xLast=0,yLast=0; XPoint *points; if (trace_->dataCount()<2) return; int start=update_==MSTrue?trace_->traceSet()->updateIndex():0; int end=trace_->dataCount(); int bufSize=end-start+2; bufSize=bufSize>MSGraph::_MaxBufSize?MSGraph::_MaxBufSize: bufSizexAxis(); ys=trace_->yAxis(); XSetForeground(display(),traceGC(),trace_->lineColor()); setLineAttributes(trace_->lineStyle(),trace_->lineWeight(),traceGC(),trace_->lineWidth(),CapButt,JoinRound); points=new XPoint[bufSize]; if (update_==MSTrue) { x=xValueToPixel(xValue(trace_,0),xs); y=yValueToPixel(trace_->y(0),ys); points[pointCount].x=x; points[pointCount++].y=y; } for (k=start;ky(k),ys); if (x==xLast&&y==yLast) continue; xLast=x; yLast=y; points[pointCount].x=x; points[pointCount++].y=y; if (pointCount>=bufSize) { points[pointCount].x=points[0].x; points[pointCount++].y=points[0].y; XSetForeground(display(),traceGC(),trace_->fillColor()); PFillPolygon(display(),graphPixmap(),traceGC(),points,pointCount,Convex,CoordModeOrigin); XSetForeground(display(),traceGC(),trace_->lineColor()); XDrawLines(display(),graphPixmap(),traceGC(),points,pointCount,CoordModeOrigin); pointCount=0; } } if (pointCount>0) { points[pointCount].x=points[0].x; points[pointCount++].y=points[0].y; XSetForeground(display(),traceGC(),trace_->fillColor()); PFillPolygon(display(),graphPixmap(),traceGC(),points,pointCount,Convex,CoordModeOrigin); XSetForeground(display(),traceGC(),trace_->lineColor()); XDrawLines(display(),graphPixmap(),traceGC(),points,pointCount,CoordModeOrigin); } delete [] points; } void MSGraph::plotStepTrace(MSTrace *trace_,int start_,int end_,int bufSize_) { int k,xs,ys; int x,y; int pointCount=0; int xLast=0,yLast=0; XPoint *points; int bufsize=bufSize_*2; if (trace_->dataCount()<2) return; xs=trace_->xAxis(); ys=trace_->yAxis(); if (trace_->dataCount()<2) return; end_=start_==0&&end_==1?2:end_; start_=start_!=0?start_-2:start_; XSetForeground(display(),traceGC(),trace_->lineColor()); setLineAttributes(trace_->lineStyle(),trace_->lineWeight(),traceGC(),trace_->lineWidth(),CapButt,JoinRound); points=new XPoint[bufsize]; for (k=start_;kxOffset(),xs); y=yValueToPixel(trace_->y(k)+trace_->yOffset(),ys); if (x==xLast&&y==yLast) continue; xLast=x; yLast=y; points[pointCount].x=x; points[pointCount++].y=y; if (pointCount>=bufsize) { XDrawLines(display(),graphPixmap(),traceGC(),points,pointCount,CoordModeOrigin); pointCount=0; } if (kdataCount()-1) { x=xValueToPixel(xValue(trace_,k+1)+trace_->xOffset(),xs); points[pointCount].x=x; points[pointCount++].y=y; } } if (pointCount>0) { XDrawLines(display(),graphPixmap(),traceGC(),points,pointCount,CoordModeOrigin); } delete [] points; } void MSGraph::plotOutlineTrace(MSTrace *,int ,int ,int ) { } void MSGraph::plotAreaTrace(MSTrace **trace_,int count_,MSBoolean update_) { int i,j,k,xs,ys; int pointCount=0; int x,y,xLast=0,yLast=0; double y_value; XPoint *points; int bufSize; int startIncrement; int endIncrement; int startSign=0; MSBoolean negative=MSFalse; for (i=0;itraceSet()->yMin()<0) { startSign=-1; break; } for (i=0;itraceSet()->updateIndex():0; endIncrement=trace_[i]->dataCount(); bufSize=endIncrement-startIncrement; bufSize=bufSize>MSGraph::_MaxBufSize?MSGraph::_MaxBufSize: bufSizexAxis(); ys=trace_[i]->yAxis(); setLineAttributes(trace_[i]->lineStyle(),trace_[i]->lineWeight(),traceGC(), trace_[i]->lineWidth(),CapButt,JoinRound); for (int sign=startSign;sign<1;sign++) { for (k=startIncrement;k2&&xValue(trace_[i],k-2)dataCount()-2&&xValue(trace_[i],k+2)y(k); if(yy<0) negative=MSTrue; y_value+=sign<0?yy<0?yy:0:yy<0?0:yy; } x=xValueToPixel(xValue(trace_[i],k),xs); y=yValueToPixel(y_value,ys); if (x==xLast&&y==yLast) continue; xLast=x; yLast=y; points[pointCount].x=x; points[pointCount++].y=y; if (pointCount>=bufSize) { if (sign==0||negative==MSTrue) { x=xValueToPixel(xValue(trace_[i],endIncrement-1),xs); y=yValueToPixel(negative==MSTrue?0:yMinData(ys),ys); points[pointCount].x=x; points[pointCount++].y=y; x=xValueToPixel(xValue(trace_[i],startIncrement),xs); points[pointCount].x=x; points[pointCount++].y=y; XSetForeground(display(),traceGC(),trace_[i]->fillColor()); PFillPolygon(display(),graphPixmap(),traceGC(),points,pointCount,Complex,CoordModeOrigin); XSetForeground(display(),traceGC(),trace_[i]->lineColor()); XDrawLines(display(),graphPixmap(),traceGC(),points,pointCount-2,CoordModeOrigin); } pointCount=0; } } if (sign==0||negative==MSTrue) { x=xValueToPixel(xValue(trace_[i],endIncrement-1),xs); y=yValueToPixel(negative==MSTrue?0:yMinData(ys),ys); points[pointCount].x=x; points[pointCount++].y=y; x=xValueToPixel(xValue(trace_[i],startIncrement),xs); points[pointCount].x=x; points[pointCount++].y=y; XSetForeground(display(),traceGC(),trace_[i]->fillColor()); PFillPolygon(display(),graphPixmap(),traceGC(),points,pointCount,Complex,CoordModeOrigin); XSetForeground(display(),traceGC(),trace_[i]->lineColor()); XDrawLines(display(),graphPixmap(),traceGC(),points,pointCount-2,CoordModeOrigin); } pointCount=0; } delete [] points; } } void MSGraph::plotScatterTrace(MSTrace *trace_,int start_,int end_,int bufSize_) { int k,bs,col=trace_->virtualCol(); int x,y,xs,ys; double x_value,y_value; XRectangle clipRect; char* array=0; int pointCount=0; MSBoolean updateColor=MSFalse; unsigned long lc,fc; static unsigned long lineColor=0,fillColor=0; int xLast=0,yLast=0; PSF func; XFontStruct *fi=(XFontStruct *)server()->fontStruct(trace_->font()); lineColor=trace_->lineColor(); fillColor=trace_->fillColor(); XSetForeground(display(),traceGC(),fillColor); XSetLineAttributes(display(),traceGC(),1,LineSolid,CapButt,JoinMiter); if (start_==0) { clipRect.x=x_org()-trace_->symbolSize(); clipRect.y=y_end()-trace_->symbolSize(); clipRect.width=plotAreaRect()->width()+trace_->symbolSize()<<1; clipRect.height=plotAreaRect()->height()+trace_->symbolSize()<<1; XSetClipRectangles(display(),traceGC(),0,0,&clipRect,1,Unsorted); } else start_--; switch (trace_->symbol()) { case Square: case Square|Fill: case Square|Circle: func=&MSGraph::buildSquareSymbol; array=new char[sizeof(XRectangle)*bufSize_]; break; case Circle: case Circle|Fill: func=&MSGraph::buildCircleSymbol; array=new char[sizeof(XArc)*bufSize_]; break; case X: func=&MSGraph::buildXSymbol; array=new char[sizeof(XSegment)*2*bufSize_]; break; case Cross: func=&MSGraph::buildCrossSymbol; array=new char[sizeof(XSegment)*2*bufSize_]; break; case X|Cross: func=&MSGraph::buildStarSymbol; array=new char[sizeof(XSegment)*4*bufSize_]; break; case Triangle: if (outputMode()==Print||trace_->symbolSize()<3) { func=&MSGraph::buildTrianglePrintSymbol; array=new char[sizeof(XSegment)*3*bufSize_]; break; } case Triangle|Fill: func=&MSGraph::buildTriangleSymbol; bs=trace_->symbolSize()*3*bufSize_; bs=(int)(bssymbolSize()<3) { func=&MSGraph::buildDiamondPrintSymbol; array=new char[sizeof(XSegment)*4*bufSize_]; break; } case Diamond|Fill: func=&MSGraph::buildDiamondSymbol; bs=trace_->symbolSize()*2*bufSize_; bs=(int)(bsfont()); break; default: return; } xs=trace_->xAxis(); ys=trace_->yAxis(); int end=end_-1; for (k=start_;kxMaxData(xs)) continue; if ((y_value=trace_->y(k))yMaxData(ys)) continue; x=xValueToPixel(x_value,xs); y=yValueToPixel(y_value,ys); if (x==xLast&&y==yLast) continue; xLast=x; yLast=y; (this->*func)((void*)array,pointCount,x,y,trace_->symbolSize()); if (kfillColor(k+1,col))!=fillColor) { updateColor=MSTrue; fillColor=fc; } if ((lc=trace_->lineColor(k+1,col))!=lineColor) { updateColor=MSTrue; lineColor=lc; } } if (updateColor==MSTrue||pointCount>=bufSize_) { drawScatterSymbols(graphPixmap(),traceGC(),trace_,array,pointCount,lineColor,fillColor,fi); pointCount=0; updateColor=MSFalse; fillColor=trace_->fillColor(k+1); lineColor=trace_->lineColor(k+1); } } if (pointCount>0) { drawScatterSymbols(graphPixmap(),traceGC(),trace_,array,pointCount,lineColor,fillColor,fi); } delete [] array; } void MSGraph::drawScatterSymbols(Window xwin_,GC gc_,MSTrace *trace_,void *array_,int count_, unsigned long lineColor_,unsigned long fillColor_, XFontStruct *fi_) { int size; XSetForeground(display(),traceGC(),fillColor_); switch (trace_->symbol()) { case Square|Fill: XFillRectangles(display(),xwin_,gc_,(XRectangle*)array_,count_); if (fillColor_==lineColor_) break; XSetForeground(display(),gc_,lineColor_); case Square: XDrawRectangles(display(),xwin_,gc_,(XRectangle*)array_,count_); break; case Circle|Fill: XFillArcs(display(),xwin_,gc_,(XArc*)array_,count_); if (fillColor_==lineColor_) break; XSetForeground(display(),gc_,lineColor_); case Circle: XDrawArcs(display(),xwin_,gc_,(XArc*)array_,count_); break; case Cross: case X: case X|Cross: XDrawSegments(display(),xwin_,gc_,(XSegment *)array_,count_); break; case Triangle: case Diamond: if (outputMode()==Print||trace_->symbolSize()<3) { XDrawSegments(display(),xwin_,gc_,(XSegment *)array_,count_); } else { XDrawPoints(display(),xwin_,gc_,(XPoint*)array_,count_,CoordModeOrigin); } break; case Triangle|Fill: size=3*(trace_->symbolSize()-1); XDrawPoints(display(),xwin_,gc_,(XPoint*)array_,count_,CoordModeOrigin); fillPolygons(display(),xwin_,gc_,(XPoint*)array_,count_, Convex,CoordModeOrigin,size); break; case Diamond|Fill: size=4*(trace_->symbolSize()-1)/2; XDrawPoints(display(),xwin_,gc_,(XPoint*)array_,count_,CoordModeOrigin); fillPolygons(display(),xwin_,gc_,(XPoint*)array_,count_, Convex,CoordModeOrigin,size); break; case MSG::Text: { if (trace_->textSymbol().length()>0&&fi_!=0) { XPoint *pt=(XPoint*)array_; int h=(fi_->ascent+fi_->descent)/2; int len=trace_->textSymbol().length(); for (int i=0;itextSymbol()(i%len); int strl=strlen(cp); int w=XTextWidth(fi_,cp,strl)/2; int x=pt[i].x-w; int y=pt[i].y+h; XDrawString(display(),xwin_,gc_,fi_,x,y,cp,strl); } } break; } } } void MSGraph::plotBarTrace(MSTrace *trace_,int start_,int end_,int bufSize_,int ct_) { int xs,ys; int x,y,y0,x0,xLast=0,yLast=0; int pointCount=0; int bar_offset; double x_value, y_value; XRectangle *rects; MSBoolean updateColor=MSFalse; unsigned long lineColor,fillColor,fc; int col=trace_->virtualCol(); lineColor=trace_->lineColor(start_,col); fillColor=trace_->fillColor(start_,col); xs=trace_->xAxis(); ys=trace_->yAxis(); rects =new XRectangle[bufSize_]; XSetLineAttributes(display(),traceGC(),1,LineSolid,CapProjecting,JoinMiter); if (orientation() == Horizontal) { x=(x_value=trace_->traceSet()->xDelta()*yScale(ys))traceSet()->xDelta()*xScale(xs))x-2)?(x-2)/(barCount()+1): maxBarWidth()); xBar(barCount()*barWidth()/2); bar_offset=ct_*barWidth()-xBar(); trace_->xShift(-bar_offset/xScale(xs)); y0=yValueToPixel(0.0,ys); y0=(y0>y_org())?y_org():y0; y0=(y0x_end())?x_end():x0; for (int k=start_;kfillColor(k+1,col))!=fillColor|| trace_->lineColor(k+1,col)!=lineColor)) updateColor=MSTrue; if (x_valuelineColor(k+1); updateColor=MSFalse; } continue; } if (orientation()==Horizontal&&(y_value>yMaxData(ys)||y_valuexMaxData(xs)) continue; x=xValueToPixel(x_value,xs); y=yValueToPixel(y_value,ys); if (x==xLast&&y==yLast) continue; xLast=x; yLast=y; if (orientation() == Horizontal) { rects[pointCount].y=y+bar_offset; rects[pointCount].x=x>x0?x0:x; rects[pointCount].width=abs(x-x0); rects[pointCount].height=(barWidth()>2)?barWidth()-1:1; } else { rects[pointCount].x=x+bar_offset; rects[pointCount].y=y>y0?y0:y; rects[pointCount].width=(barWidth()>2)?barWidth()-1:1; rects[pointCount].height=abs(y0-y); } pointCount++; if (pointCount>=bufSize_||updateColor==MSTrue) { XSetForeground(display(),traceGC(),fillColor); PFillRectangles(display(),graphPixmap(),traceGC(),rects,pointCount); if (barWidth()>=5) { XSetForeground(display(),traceGC(),lineColor); XDrawRectangles(display(),graphPixmap(),traceGC(),rects,pointCount); } pointCount=0; if (updateColor==MSTrue) { fillColor=fc; lineColor=trace_->lineColor(k+1); updateColor=MSFalse; } } } XSetForeground(display(),traceGC(),fillColor); PFillRectangles(display(),graphPixmap(),traceGC(),rects,pointCount); if (barWidth()>=5) { XSetForeground(display(),traceGC(),lineColor); XDrawRectangles(display(),graphPixmap(),traceGC(),rects,pointCount); } delete [] rects; } void MSGraph::plotHBarTrace(MSTrace *trace_) { if (trace_==0)return; } int MSGraph::setLineWidth(MSTrace *trace_) { int x,k,offset,line_width; x=(int)(trace_->traceSet()->xDelta()*xScale(0)); if (trace_->style()==HL) { line_width=((k=(trace_->lineWidth()>=x)?x-1:trace_->lineWidth())<1)?1:k; } else { if (trace_->style()==HLC)offset=2; else if (trace_->style()==HLOC)offset=3; else if (trace_->style()==Candle)offset=5; line_width=((k=(offset*trace_->lineWidth()>=x)? ((x%offset)==0)?(x/offset)-1:x/offset:trace_->lineWidth())<1)?1:k; } return line_width; } void MSGraph::plotHighLowTrace(MSTrace *trace_,int start_,int end_,int bufSize_) { int k,line_width; double x_value=0; int x,y1,y2; int high=0,low=1; int pointCount=0; XSegment *hlPoints; MSBoolean updateColor=MSFalse; unsigned long line_color=trace_->lineColor(high+trace_->offset()); int xs=trace_->xAxis(); int ys=trace_->yAxis(); line_width=setLineWidth(trace_); setLineAttributes(trace_->lineStyle(),trace_->lineWeight(),traceGC(),line_width,CapProjecting,JoinRound); hlPoints=new XSegment[bufSize_]; for (k=start_;kxMaxData(xs))continue; x=xValueToPixel(x_value,xs); y1=yValueToPixel(trace_->y(k,high+trace_->offset()),ys); y2=yValueToPixel(trace_->y(k,low+trace_->offset()),ys); hlPoints[pointCount].x1=(short)x; hlPoints[pointCount].x2=(short)x; hlPoints[pointCount].y1=(short)y1; hlPoints[pointCount++].y2=(short)y2; if (line_color!=trace_->lineColor(k+1,high+trace_->offset())) { updateColor=MSTrue; } if (pointCount>=bufSize_||updateColor==MSTrue) { XSetForeground(display(),traceGC(),line_color); XDrawSegments(display(),graphPixmap(),traceGC(),hlPoints,pointCount); pointCount=0; if (updateColor==MSTrue) { line_color=trace_->lineColor(k+1,high+trace_->offset()); updateColor=MSFalse; } } } XSetForeground(display(),traceGC(),line_color); XDrawSegments(display(),graphPixmap(),traceGC(),hlPoints,pointCount); delete [] hlPoints; } void MSGraph::plotOpenTicks(MSTrace *trace_,int start_,int end_,int bufSize_) { int k,xs,ys; double x_value=0; int x,y; int open=0; int pointCount=0; XSegment *openPoints; int line_width; int tick_width; MSBoolean updateColor=MSFalse; unsigned long line_color=trace_->lineColor(open); xs=trace_->xAxis(); ys=trace_->yAxis(); line_width=setLineWidth(trace_); tick_width=(line_width>5)?5:line_width; x=(int)(trace_->traceSet()->xDelta()*xScale(xs)); tick_width=x>3&&line_width==1?tick_width*2:tick_width; setLineAttributes(trace_->lineStyle(),trace_->lineWeight(),traceGC(),line_width,CapProjecting,JoinMiter); openPoints =new XSegment[bufSize_]; for (k=start_;kxMaxData(xs))continue; x=xValueToPixel(x_value,xs); y=yValueToPixel(trace_->y(k,open),ys); openPoints[pointCount].x1=(short)x-tick_width; openPoints[pointCount].x2=(short)x; openPoints[pointCount].y1=(short)y; openPoints[pointCount++].y2=(short)y; if (line_color!=trace_->lineColor(k+1,open)) updateColor=MSTrue; if (pointCount>=bufSize_||updateColor==MSTrue) { XSetForeground(display(),traceGC(),line_color); XDrawSegments(display(),graphPixmap(),traceGC(),openPoints,pointCount); pointCount=0; if (updateColor==MSTrue) { line_color=trace_->lineColor(k+1,open); updateColor=MSFalse; } } } XSetForeground(display(),traceGC(),line_color); XDrawSegments(display(),graphPixmap(),traceGC(),openPoints,pointCount); delete [] openPoints; } void MSGraph::plotCloseTicks(MSTrace *trace_,int start_,int end_,int bufSize_) { int k,xs,ys; double x_value=0; int x,y; int close=2+trace_->offset(); int pointCount=0; XSegment *closePoints; int line_width; int tick_width; MSBoolean updateColor=MSFalse; unsigned long line_color=trace_->lineColor(close); xs=trace_->xAxis(); ys=trace_->yAxis(); line_width=setLineWidth(trace_); tick_width=(line_width>5)?5:line_width; x=(int)(trace_->traceSet()->xDelta()*xScale(xs)); tick_width=x>3&&line_width==1?tick_width*2:tick_width; setLineAttributes(trace_->lineStyle(),trace_->lineWeight(),traceGC(),line_width,CapProjecting,JoinMiter); closePoints=new XSegment[bufSize_]; for (k=start_;kxMaxData(xs))continue; x=xValueToPixel(x_value,xs); y=yValueToPixel(trace_->y(k,close),ys); closePoints[pointCount].x1=(short)x+tick_width; closePoints[pointCount].x2=(short)x; closePoints[pointCount].y1=(short)y; closePoints[pointCount++].y2=(short)y; if (line_color!=trace_->lineColor(k+1,close)) updateColor=MSTrue; if (pointCount>=bufSize_||updateColor==MSTrue) { XSetForeground(display(),traceGC(),line_color); XDrawSegments(display(),graphPixmap(),traceGC(),closePoints,pointCount); pointCount=0; if (updateColor==MSTrue) { line_color=trace_->lineColor(k+1,close); updateColor=MSFalse; } } } XSetForeground(display(),traceGC(),line_color); XDrawSegments(display(),graphPixmap(),traceGC(),closePoints,pointCount); delete [] closePoints; } void MSGraph::plotCandleTrace(MSTrace *trace_,int start_,int end_,int bufSize_) { int h,k,xs,ys; double x_value; int open=0,high=1,low=2,close=3; int pointCount=0,ofCount=0,cfCount=0; int x,y_open,y_close,y_high,y_low; XRectangle *ocRects; XRectangle *cfRects; XRectangle *ofRects; XSegment *hPoints; XSegment *lPoints; MSBoolean updateColor=MSFalse; int line_width; unsigned long closecolor=trace_->lineColor(close); unsigned long opencolor=trace_->lineColor(open); unsigned long highcolor=trace_->lineColor(high); unsigned long lowcolor=trace_->lineColor(low); xs=trace_->xAxis(); ys=trace_->yAxis(); start_=start_!=0?start_-1:start_; line_width=setLineWidth(trace_); trace_->xShift(3*line_width/xScale(xs)); setLineAttributes(trace_->lineStyle(),trace_->lineWeight(),traceGC(),line_width,CapProjecting,JoinMiter); ocRects =new XRectangle[bufSize_]; cfRects =new XRectangle[bufSize_]; ofRects =new XRectangle[bufSize_]; hPoints =new XSegment[bufSize_]; lPoints =new XSegment[bufSize_]; for (k=start_;kxMaxData(xs))continue; x=xValueToPixel(x_value,xs); y_high=yValueToPixel(trace_->y(k,high),ys); y_low=yValueToPixel(trace_->y(k,low),ys); y_open=yValueToPixel(trace_->y(k,open),ys); y_close=yValueToPixel(trace_->y(k,close),ys); if (y_open<=y_close)// fill rectangle { ocRects[pointCount].height=(unsigned short)(((h=(y_close-y_open))==0)?line_width:h); ocRects[pointCount].width=(unsigned short)(4*line_width); ocRects[pointCount].x=(short)(x-2*line_width); ocRects[pointCount].y=(short)y_open; if (h!=0) { cfRects[cfCount].height=(unsigned short)h; cfRects[cfCount].width=(unsigned short)(4*line_width); cfRects[cfCount].x=(short)(x-2*line_width); cfRects[cfCount++].y=(short)y_open; } hPoints[pointCount].x1=(short)x; hPoints[pointCount].x2=(short)x; hPoints[pointCount].y1=(short)y_open; hPoints[pointCount].y2=(short)y_high; lPoints[pointCount].x1=(short)x; lPoints[pointCount].x2=(short)x; lPoints[pointCount].y1=(short)y_close; lPoints[pointCount++].y2=(short)y_low; } else if (y_open>y_close) // draw Rectangle { ocRects[pointCount].x=(short)(x-2*line_width); ocRects[pointCount].y=(short)y_close; ocRects[pointCount].width=(unsigned short)(4*line_width); ocRects[pointCount].height=(unsigned short)(y_open-y_close); ofRects[ofCount].x=(short)(x-2*line_width); ofRects[ofCount].y=(short)y_close; ofRects[ofCount].width=(unsigned short)(4*line_width); ofRects[ofCount++].height=(unsigned short)(y_open-y_close); hPoints[pointCount].x1=(short)x; hPoints[pointCount].x2=(short)x; hPoints[pointCount].y1=(short)y_close; hPoints[pointCount].y2=(short)y_high; lPoints[pointCount].x1=(short)x; lPoints[pointCount].x2=(short)x; lPoints[pointCount].y1=(short)y_open; lPoints[pointCount++].y2=(short)y_low; } if (opencolor!=trace_->lineColor(k+1,open)&& highcolor!=trace_->lineColor(k+1,high)&& lowcolor!=trace_->lineColor(k+1,low)&& closecolor!=trace_->lineColor(k+1,close)) { updateColor=MSTrue; } if (pointCount>=bufSize_||updateColor==MSTrue) { XSetForeground(display(),traceGC(),highcolor); XDrawSegments(display(),graphPixmap(),traceGC(),hPoints,pointCount); XDrawSegments(display(),graphPixmap(),traceGC(),lPoints,pointCount); XSetForeground(display(),traceGC(),opencolor); PFillRectangles(display(),graphPixmap(),traceGC(),cfRects,cfCount); XSetForeground(display(),traceGC(),closecolor==opencolor?background():closecolor); XFillRectangles(display(),graphPixmap(),traceGC(),ofRects,ofCount); XSetForeground(display(),traceGC(),lowcolor); XDrawRectangles(display(),graphPixmap(),traceGC(),ocRects,pointCount); pointCount=cfCount=ofCount=0; if (updateColor==MSTrue) { closecolor=trace_->lineColor(k+1,close); opencolor=trace_->lineColor(k+1,open); highcolor=trace_->lineColor(k+1,high); lowcolor=trace_->lineColor(k+1,low); updateColor=MSFalse; } } } if (pointCount>0) { XSetForeground(display(),traceGC(),highcolor); XDrawSegments(display(),graphPixmap(),traceGC(),hPoints,pointCount); XDrawSegments(display(),graphPixmap(),traceGC(),lPoints,pointCount); XSetForeground(display(),traceGC(),opencolor); PFillRectangles(display(),graphPixmap(),traceGC(),cfRects,cfCount); XSetForeground(display(),traceGC(),closecolor==opencolor?background():closecolor); XFillRectangles(display(),graphPixmap(),traceGC(),ofRects,ofCount); XSetForeground(display(),traceGC(),lowcolor); XDrawRectangles(display(),graphPixmap(),traceGC(),ocRects,pointCount); } delete [] ocRects; delete [] cfRects; delete [] ofRects; delete [] hPoints; delete [] lPoints; } void MSGraph::plotStackTrace(MSTrace **trace_,int& ct_,int count_,MSBoolean update_) { int i,j,k,xs,ys; int pointCount=0; int x,y,y0,x0,yi,xLast=0,yLast=0; // xi double yy,xx,x_value,y_value; XRectangle *rects; int bufSize; int bar_offset; int startIncrement; int endIncrement; unsigned long lineColor; unsigned long fillColor; int sign=0; int ct=ct_; for (i=0;itraceSet()->updateIndex():0; endIncrement=trace_[i]->dataCount(); bufSize=endIncrement-startIncrement; bufSize=bufSize>MSGraph::_MaxBufSize?MSGraph::_MaxBufSize: bufSizexAxis(); ys=trace_[i]->yAxis(); if (i==0) { if (orientation()==Horizontal) { x=(x_value=trace_[i]->traceSet()->xDelta()*yScale(ys))traceSet()->xDelta()*xScale(xs))x-2)?(x-2)/(barCount()+1):maxBarWidth()); xBar(barCount()*barWidth()/2); bar_offset=count_*barWidth()-xBar(); trace_[i]->xShift(-bar_offset/xScale(xs)); XSetLineAttributes(display(),traceGC(),1,LineSolid,CapProjecting,JoinMiter); } y0=yValueToPixel(0.0,ys); y0=(y0>y_org())?y_org():y0; y0=(y0x_end())?x_end():x0; lineColor=trace_[i]->lineColor(); fillColor=trace_[i]->fillColor(); for (k=startIncrement;kyMaxData(ys)) continue; for (j=i,x_value=0.,sign=0;ji;j--) // { // xx=trace_[j]->y(k); // x_value+=sign<0?xx<0?xx:0:xx<0?0:xx; // } // cout << "x_value again" << x_value << endl; // xi=yValueToPixel(x_value,ys); rects[pointCount].y=y+bar_offset; rects[pointCount].x=x>x0?x0:x; //sign<0?xi:x; rects[pointCount].width=abs(x0-x);//(i2)?barWidth()-1:1; } else { if (xValue(trace_[i],k)y(k); if(j==i&&yy<0) sign=-1; y_value+=sign<0?yy<0?yy:0:yy<0?0:yy; } x=xValueToPixel(xValue(trace_[i],k),xs); y=yValueToPixel(y_value,ys); if (x==xLast&&y==yLast) continue; xLast=x; yLast=y; for (j=ct-1,y_value=0.;j>i;j--) { yy=trace_[j]->y(k); y_value+=sign<0?yy<0?yy:0:yy<0?0:yy; } yi=yValueToPixel(y_value,ys); rects[pointCount].x=x+bar_offset; rects[pointCount].y=sign<0?yi:y; rects[pointCount].width=(barWidth()>2)?barWidth()-1:1; rects[pointCount++].height=(i=bufSize) { { XSetForeground(display(),traceGC(),fillColor); PFillRectangles(display(),graphPixmap(),traceGC(),rects,pointCount); if (barWidth()>=5) { XSetForeground(display(),traceGC(),lineColor); XDrawRectangles(display(),graphPixmap(),traceGC(),rects,pointCount); } } pointCount=0; } } XSetForeground(display(),traceGC(),fillColor); PFillRectangles(display(),graphPixmap(),traceGC(),rects,pointCount); if (barWidth()>=5) { XSetForeground(display(),traceGC(),lineColor); XDrawRectangles(display(),graphPixmap(),traceGC(),rects,pointCount); } pointCount=0; delete [] rects; } ct_=0; } void MSGraph::plotTextTrace(MSTrace **trace_,int count_) { for (int i=0;ifontStruct(trace_[i]->traceSet()->textFont()); XSetFont(display(),traceGC(),trace_[i]->traceSet()->textFont()); int x=xValueToPixel(xValue(trace_[i],0),trace_[i]->xAxis()); int y=yValueToPixel(yValue(trace_[i],0),trace_[i]->yAxis()); MSStringVector aStringVector; MSString formatBuffer; int lines=trace_[i]->traceSet()->textLength(); for (unsigned k=0;ktraceSet()->formatText(formatBuffer.removeAll(),k); if (trace_[i]==selectTrace()) { int h=aStringVector.length()*(fontInfo->ascent+fontInfo->descent); int w=maxStringWidth(fontInfo,aStringVector); XSetForeground(display(),traceGC(),trace_[i]->traceSet()->textForeground()); XFillRectangle(display(),graphPixmap(),traceGC(),x,y,w,h); XSetForeground(display(),traceGC(),MSWidget::background()); } else { XSetForeground(display(),traceGC(),trace_[i]->traceSet()->textForeground()); } y+=fontInfo->ascent; for (unsigned j=0;jascent+fontInfo->descent; } } } void MSGraph::plotHStackTrace(MSTrace *trace_) { if (trace_==0) return; } void MSGraph::plotBetweenTrace(MSTrace *trace_) { if (trace_==0) return; } void MSGraph::buildSquareSymbol(void* array_,int& count_,int x_,int y_,int size_) { XRectangle *rects=(XRectangle *)array_; int count=count_; rects[count].x=x_-(size_>>1); rects[count].y=y_-(size_>>1); rects[count].width=size_-1; rects[count++].height=size_-1; count_=count; } void MSGraph::buildCircleSymbol(void* array_,int& count_,int x_,int y_,int size_) { short angle1=0,angle2=23040; // 360*64; XArc *arcs=(XArc *)array_; int count=count_; arcs[count].x=x_-(size_>>1); arcs[count].y=y_-(size_>>1); arcs[count].width=size_; arcs[count].height=size_; arcs[count].angle1=angle1; arcs[count++].angle2=angle2; count_=count; } void MSGraph::buildStarSymbol(void* array_,int& count_,int x_,int y_,int size_) { buildCrossSymbol(array_,count_,x_,y_,size_); buildXSymbol(array_,count_,x_,y_,size_); } void MSGraph::buildCrossSymbol(void* array_,int& count_,int x_,int y_,int size_) { XSegment *segments=(XSegment *)array_; int r=size_>>1; int count=count_; for (int j=0;j<2;j++) { segments[count].x1=x_-(j==1?0:r); segments[count].y1=y_-(j==0?0:r); segments[count].x2=x_+(j==1?0:r); segments[count++].y2=y_+(j==0?0:r); } count_=count; } void MSGraph::buildXSymbol(void* array_,int& count_,int x_,int y_,int size_) { XSegment *segments=(XSegment *)array_; int rc=(int)((size_>>1)*0.707)+1; int count=count_; for (int j=0;j<2;j++) { segments[count].x1=x_-(j==0?rc:-rc); segments[count].y1=y_-rc; segments[count].x2=x_+(j==0?rc:-rc); segments[count++].y2=y_+rc; } count_=count; } void MSGraph::buildTriangleSymbol(void* array_,int& count_,int x_,int y_,int size_) { XPoint *points=(XPoint *)array_; int size=size_-1; int r=size>>1; int s1=count_; int s2=s1+size*2-1; int s3=s1+size*3-1; for (int i=0;i>1); points[s1++].y=y_+r-i-1; points[s2].x=x_+r-(int)(i>>1); points[s2--].y=y_+r-i; points[s3].x=x_-r+i; points[s3--].y=y_+r; } count_+=size*3; } void MSGraph::buildTrianglePrintSymbol(void* array_,int& count_,int x_,int y_,int size_) { XSegment *segments=(XSegment *)array_; int r=(int)(size_>>1); int count=count_; for (int j=0;j<3;j++) { segments[count].x1=x_-(j==2?-r:r); segments[count].y1=y_+r; segments[count].x2=x_+(j==1?r:0); segments[count++].y2=y_-(j==1?-r:r); } count_=count; } void MSGraph::buildDiamondSymbol(void* array_,int& count_,int x_,int y_,int size_) { XPoint *points=(XPoint *)array_; int size=(size_-1)>>1; int r=size>>1; int ct=count_; int s2=ct+(size<<1)-1; int s3=ct+(size<<1); int s4=ct+(size<<2)-1; for (int i=0;i>1); points[ct++].y=y_-i-1; points[s2].x=x_+r-(int)(i>>1); points[s2--].y=y_-i; points[s3].x=x_+r-(int)((i+1)>>1); points[s3++].y=y_+i+1; points[s4].x=x_-r+(int)(i>>1); points[s4--].y=y_+i; } count_+=size<<2; } void MSGraph::buildDiamondPrintSymbol(void* array_,int& count_,int x_,int y_,int size_) { XSegment *segments=(XSegment *)array_; int size=(size_-1)>>1; int r=size>>1; int count=count_; for (int j=0;j<4;j++) { segments[count].x1=x_; segments[count].y1=y_-(j<2?size:-size);; segments[count].x2=x_-r; segments[count++].y2=y_; r=-r; } count_=count; } void MSGraph::buildCharSymbol(void* array_,int& count_,int x_,int y_,int size_) { XPoint *points=(XPoint *)array_; int ct=count_; if (size_>0) { points[ct].x=x_; points[ct++].y=y_; } count_=ct; } void MSGraph::setLineAttributes(unsigned long style_,int weight_,GC gc_,int lineWidth_, int capStyle_,int joinStyle_) { const static char dotDash0[]={5,3,2,3}; const static char dotDash1[]={6,3,2,3}; const static char dotDash2[]={7,3,2,3}; const static char dotDash3[]={8,3,2,3}; const static char dotDash4[]={9,3,2,3}; const static char dash0[] ={3,2}; const static char dash1[] ={4,2}; const static char dash2[] ={5,2}; const static char dash3[] ={6,2}; const static char dash4[] ={7,2}; const static char dot0[] ={1,1}; const static char dot1[] ={1,2}; const static char dot2[] ={1,3}; const static char dot3[] ={1,4}; const static char dot4[] ={1,5}; const static int ct[] ={2,2,2,2,2,2,2,2,2,2,4,4,4,4,4}; static const char *styles[] ={dash0,dash1,dash2,dash3,dash4, dot0,dot1,dot2,dot3,dot4, dotDash0,dotDash1,dotDash2,dotDash3,dotDash4}; if (style_!=MSSolid) { int index=(style_&MSDot?style_&MSDash?10:5:0)+weight_; XSetLineAttributes(display(),gc_,lineWidth_,LineOnOffDash,capStyle_,joinStyle_); XSetDashes(display(),gc_,0,styles[index],ct[index]); } else XSetLineAttributes(display(),gc_,lineWidth_,LineSolid,capStyle_,joinStyle_); } void MSGraph::plotMarketProfile(MSTrace *trace_,int bufSize_) { int i,k,xs,ys; int x,y,xOffset=0; int sessionCt=0,priceCt=0; double yInc,time,price,lastPrice=0; int r,row,col,color,offset; int period=0; int length=0,maxWidth=0,height=0; XColor fgRGB; MSBoolean split=MSFalse; unsigned long red,green,blue,priceColor; XPoint *points=new XPoint[bufSize_]; MSString *priceString=new MSString[bufSize_]; double *priceIndex=new double[bufSize_]; int *priceCount=new int[bufSize_]; int *width=new int[bufSize_]; const char *tempStr; static char buf[14]; static const char *symbols[]={"A","B","C","D","E","F","G","H","I","J","K","L","M","N", "P","Q","R","S","T","V","W","X","Y","Z","a","b","c","d", "e","f","g","h","i","j","k","l","m","n","p","q","r","s", "t","v","w","x","y","z"}; XFontStruct *fontInfo=(XFontStruct *)server()->fontStruct(trace_->traceSet()->textFont()); height=fontInfo->ascent+fontInfo->descent; xs=trace_->xAxis(); ys=trace_->yAxis(); int start=trace_->dataCount()-bufSize_-1; double startTime=xValue(trace_,start>0?start:0); if (yLabelOut(ys).formatType()==MSFormat::Money) { switch(yLabelOut(ys).format().moneyFormat()) { case MSMoney::ThirtySeconds: yInc=3.125e-2; break; case MSMoney::SixtyForths: yInc=1.5625e-2; break; case MSMoney::OneTwentyEights: yInc=7.8125e-3; break; // case MSFormat::Price320: // yInc=3.125e-3; // break; // case MSFormat::Price328: // yInc=3.90625e-3; // break; } } else yInc=1.e-1; fgRGB.pixel=trace_->lineColor(); XQueryColor(display(),server()->colormap(),&fgRGB); int redOffset=65535-fgRGB.red; int greenOffset=65535-fgRGB.green; int blueOffset=65535-fgRGB.blue; redOffset=redOffset>5000?redOffset:-(int)fgRGB.red; greenOffset=greenOffset>5000?greenOffset:-(int)fgRGB.green; blueOffset=blueOffset>5000?blueOffset:-(int)fgRGB.blue; setLineAttributes(trace_->lineStyle(),trace_->lineWeight(),traceGC(),trace_->lineWidth(),CapButt,JoinRound); height=(int)(yInc*yScale(ys)); // if ((t=t0+xValue(trace_,0))>sessionCt*sessionPeriod()) // for (k=0;kdataCount();k++) // { // if ((time=trace_->x(k)-startTime-tpoOpen()-(sessionCt*sessionPeriod()))>=0) // { // cout<<"period\t"<x(k)<<"\ttime\t"<dataCount();k++) { if ((time=trace_->x(k)-startTime-tpoOpen()-(sessionCt*sessionPeriod()))>=0) { period=(int)(time/tpoPeriod()); if (time>(tpoClose()-tpoOpen())|| (period>0&&period==tpoBreakChar()&&split==MSFalse)||period>=48) { for (row=0;rowstyle()==ColorProfile) { for (col=0;colpixel(buf); XSetForeground(display(),traceGC(),priceColor); offset=col*maxWidth/length-maxWidth/length/2; PFillRectangle(display(),graphPixmap(),traceGC(),points[row].x+offset, points[row].y-height/2,maxWidth/length,height); } } else { XSetForeground(display(),traceGC(),trace_->lineColor()); sprintf(buf,"%3d ",priceCount[row]); priceString[row].insert(0,buf); XDrawString(display(),graphPixmap(),traceGC(),fontInfo,points[row].x,points[row].y, priceString[row].string(),priceString[row].length()); } priceString[row]=""; } xOffset=(int)(1.1*maxWidth); priceCt=maxWidth=0; if (time>(tpoClose()-tpoOpen())) { width[++sessionCt]=0; split=MSFalse; xOffset=0; continue; } else split=MSTrue; } price=trace_->y(k); lastPrice=priceCt==0?price-yInc:lastPrice; int priceOffset=(int)((price-lastPrice)/yInc); int sign=priceOffset>0?1:-1; for (int j=0;j(price-yInc)&&priceIndex[r]<(price+yInc)) break; } if (r==priceCt) { x=xValueToPixel(startTime+tpoOpen()+sessionCt*sessionPeriod(),xs); y=yValueToPixel(price,ys); priceCount[priceCt]=0; priceIndex[priceCt]=price; points[priceCt].x=x+xOffset; points[priceCt++].y=y; } if (j==0) priceCount[r]++; tempStr=priceString[r].string(); if (priceString[r].length()==0|| strcmp(&tempStr[priceString[r].length()-1],symbols[period])!=0) { priceString[r]<length?priceString[r].length():length; int w=XTextWidth(fontInfo,priceString[r].string(),priceString[r].length()); width[sessionCt]=width[sessionCt]>w?width[sessionCt]:w; maxWidth=maxWidth>w?maxWidth:w; } price -= yInc*sign; } lastPrice=trace_->y(k); } } for (i=0;i=65&&key_!=79&&key_!=85&&key_!=111&&key_!=117&&key_<122) { int keyOffset=key_>117?4:key_>111?3:key_>85?2:key_>79?1:0; key_ -= 65+keyOffset; if (_tpoBreakChar!=key_) { _tpoBreakChar=key_; redrawImmediately(); } } } ////////////////////////////////////////////////////////////////////////////////////////// // Pie drawing functions ////////////////////////////////////////////////////////////////////////////////////////// #if !defined (MS_HAS_M_2PI) static const double M_2PI=2*M_PI; #endif static const double M_3PI = 3*M_PI,M_4PI = 4*M_PI; static const double DegPerRadian = M_2PI/(64.0*360.0); static const double circle = 23040; // 360*64; static const int semi = int(circle/2); // 180 static const int semi_1 = int(semi*0.9); // 162 static const int semi_2 = int(semi/2); // 90 static const int semi_4 = int(semi/4); // 45 static const int semi_5 = int(semi/5); // 36 static const int lineThreshold = 100; /**********************************************************************************************/ // MSGraphPieData is a fully public structure that contain data needed to draw pie chart // angle1 - pie slices starting angles // angle2 - angle of the pie slice // radian1, radian2 - radian equivalent of angle1 and angle2 // xo, yo - // cos1, sin1 - precomputed cos and sin for angle1 // cos2, sin2 // cosB, sinB - precomputed cos and sin for bisectors // sequence - sequence in which pie slices will be drawn. /**********************************************************************************************/ class MSGraphPieData { public: MSGraphPieData(unsigned); ~MSGraphPieData(); void clear(unsigned); // public data MSIntVector angle1,angle2; MSStringVector percents; MSFloatVector xo,yo; MSFloatVector radian1,radian2; MSFloatVector offsets,profiles; MSUnsignedLongVector lineColors,fillColors; MSFloatVector bisectors; MSUnsignedVector sequence; double *cosB, *sinB; double *cos1,*cos2,*sin1,*sin2; int bufSize; private: void allocate(void); void deallocate(void); }; /**********************************************************************************************/ // MSGraphPieLabelData is a fully public structure that contain data needed to draw pie labels // // iRects - // oRects - // iText - // oText - /**********************************************************************************************/ class MSGraphPieLabelData { public: MSGraphPieLabelData(unsigned); ~MSGraphPieLabelData(); void clear(unsigned); XRectangle *iRects; XRectangle *oRects; MSStringVector *iText; MSStringVector *oText; int bufSize; private: void allocate(); void deallocate(); }; /**********************************************************************************************/ // Pie plot main routine /**********************************************************************************************/ void MSGraph::plotPieTrace(MSTrace *trace_) { static int labelThreshold=100; MSTraceSet* ts=trace_->traceSet(); int bufSize=trace_->dataCount(); bufSize=bufSize>MSGraph::_MaxBufSize?MSGraph::_MaxBufSize:bufSize; int d=plotAreaRect()->width()height()? plotAreaRect()->width():plotAreaRect()->height(); int w=(int)(d*(1.0-pieOffsetMargin())); int h=(int)ts->pieAspectRatio()*w; w=w%2>0?w+1:w; h=h%2>0?h+1:h; ts->resize(w,h); if (w>0) { XSetFont(display(),traceGC(),ts->textFont()); int lineWidth=trace_->lineWidth()>0&&w>lineThreshold*2?trace_->lineWidth():0; setLineAttributes(trace_->lineStyle(),trace_->lineWeight(),traceGC(),lineWidth,CapRound,JoinRound); XSetArcMode(display(),traceGC(),ArcPieSlice); _pieDepth=(int)((w-h)/(5.0/ts->pieDepthFactor())); _pieRx=w/2; _pieRy=h/2; _pieX=x_org()+(plotAreaRect()->width()-w)/2; _pieY=y_end()+(plotAreaRect()->height()-h-_pieDepth)/2; // create pie data if (_pieData==0) _pieData=new MSGraphPieData(bufSize); else _pieData->clear(bufSize); computePieData(trace_,_pieData); // create pie label data if (_pieLabelData==0) _pieLabelData=new MSGraphPieLabelData(bufSize); else _pieLabelData->clear(bufSize); if (w>labelThreshold) computePieLabels(trace_,_pieData,_pieLabelData); // calculate pie drawing sequence computeDrawingSequence(_pieData); // draw pie and slices drawPieSlices(trace_,_pieData,w,h); if (w>labelThreshold) drawLabels(trace_,_pieLabelData); } } /**********************************************************************************************/ // computePieData - precomputes data needed to draw pie slices /**********************************************************************************************/ void MSGraph::computePieData(MSTrace* trace_,MSGraphPieData* pieData_) { MSFloatVector& radian1=pieData_->radian1; MSFloatVector& radian2=pieData_->radian2; MSFloatVector& xo=pieData_->xo; MSFloatVector& yo=pieData_->yo; MSIntVector& angle2=pieData_->angle2; MSStringVector& percents=pieData_->percents; MSFloatVector& offsets=pieData_->offsets; MSFloatVector& profiles=pieData_->profiles; MSFloatVector& bisectors=pieData_->bisectors; MSUnsignedLongVector& lineColors=pieData_->lineColors; MSUnsignedLongVector& fillColors=pieData_->fillColors; double* cosB=pieData_->cosB; double* sinB=pieData_->sinB; double totalSlice=0,total=0; int angle=0,i; int bufSize=pieData_->bufSize; MSTraceSet *ts=trace_->traceSet(); for (i=0;iy(i); for (i=0;iy(i)/total; totalSlice+=slice; radian1 << (totalSlice*M_2PI); angle2 << int(slice*circle); radian2 << angle2(i)*DegPerRadian; angle = angle>angle2(i)?angle:angle2(i); lineColors<lineColor(i,trace_->virtualCol()); fillColors<fillColor(i,trace_->virtualCol()); profiles<pieProfile(i); offsets<pieOffset(i); } if (ts->piePercentAlignment()>MSNone) { MSFormat format(ts->piePercentFormat()); MSString formatBuffer; double sum=0; for (i=0;iy(i)/total; MSFloat aFloat(slice); percents<0.01) { unsigned index=angle2.indexOf(angle); double slice; if (total) slice=100.0*trace_->y(index)/total; MSFloat aFloat(slice+diff); aFloat.format(formatBuffer.removeAll(),format); percents[index]=formatBuffer; } } // determine if drawing order is relevent if (ts->pieAspectRatio()<1.0) { for (i=0;i0.0) _orderDependent=MSTrue; } // find index of largest angle if (_orderDependent==MSTrue) { for (i=0;i=semi) _indexOfMaxAngle=i; } // orient primary slice if specified, otherwise orient largest angle // to primarySliceAlignment if (ts->primarySliceAlignment()!=MSNone) { unsigned index=ts->primarySlice()>=0&&ts->primarySlice()primarySlice():angle2.indexOf(angle); unsigned long align=ts->primarySliceAlignment(); for (i=0,angle=0;ipieAngle()*64; _startAngle=(int)(_startAngle<0?circle+_startAngle:_startAngle); double startRadian=(double)_startAngle*DegPerRadian; radian1+=startRadian; // compute pie offsets for (i=0;isin1[i]=sin(radian1(i)); pieData_->sin2[i]=sin(radian1(i)-radian2(i)); pieData_->cos1[i]=cos(radian1(i)); pieData_->cos2[i]=cos(radian1(i)-radian2(i)); } } /**********************************************************************************************/ // computePiLabels - precomputes data needed to draw pie labels /**********************************************************************************************/ void MSGraph::computePieLabels(MSTrace* trace_,const MSGraphPieData* pieData_, MSGraphPieLabelData* pieLabelData_) { XFontStruct *fontInfo=(XFontStruct*)server()->fontStruct(trace_->traceSet()->textFont()); double* cosB=pieData_->cosB; double* sinB=pieData_->sinB; double *cos1=pieData_->cos1; double *cos2=pieData_->cos2; double *sin1=pieData_->sin1; double *sin2=pieData_->sin2; const MSFloatVector& xo=pieData_->xo; const MSFloatVector& yo=pieData_->yo; const MSIntVector& angle2=pieData_->angle2; const MSFloatVector& bisectors=pieData_->bisectors; const MSStringVector& percents=pieData_->percents; const MSFloatVector& profiles=pieData_->profiles; int bufSize=trace_->dataCount(); int x=_pieX; int y=_pieY; int w=(int)_pieRx*2; // pointers to needed data from MSGraphPieLabelData XRectangle * iRects= pieLabelData_->iRects; XRectangle* oRects= pieLabelData_->oRects; MSStringVector* iText= pieLabelData_->iText; MSStringVector* oText= pieLabelData_->oText; XPoint *opoints=new XPoint[bufSize]; int yOffset; unsigned i=0; // compute label positions unsigned labelOffset=5; static const double sin_30=0.5; static const double sin_60=0.8660254; MSIntVector sectors; // sectors for distributing labels if default postions overlap // // 3 2 1 // \ | / // \ | / // \ | / // \ | / // 4 _______\|/________ 0 // /|\ // / | \ // / | \ // / | \ // / | \ // 5 6 7 // // compute label positions for (i=0;i-sin_30&&sinB[i]0) sectors<<0; else if (sinB[i]>sin_30&&sinB[i]0) sectors<<1; else if (sinB[i]>sin_60) sectors<<2; else if (sinB[i]>sin_30&&sinB[i]-sin_30&&sinB[i]-sin_60&cosB[i]<0) sectors<<5; else if (sinB[i]<-sin_60) sectors<<6; else if (sinB[i]>-sin_60&&sinB[i]<-sin_30&cosB[i]>0) sectors<<7; yOffset=(int)(_pieDepth-_pieDepth*profiles(i)); double dia=0; double x1=x+xo(i)+_pieRx; double y1=y-yo(i)+_pieRy+yOffset; double xin,yin,x2,y2,x3,y3,a,b,c,perimeter,xcg,ycg,sp,radius; iRects[i].x=oRects[i].x=(int)(x1+xo(i)+cosB[i]*_pieRx); iRects[i].y=oRects[i].y=(int)(y1-yo(i)-sinB[i]*_pieRy); double *xcc=new double[2]; double *ycc=new double[2]; for (int p=0;p<2;p++) { double factor=p==0?angle2(i)>semi_4?2.0:1.5:1; x2=x1+cos1[i]*_pieRx*factor; y2=y1-sin1[i]*_pieRy*factor; x3=x1+cos2[i]*_pieRx*factor; y3=y1-sin2[i]*_pieRy*factor; if (p==1&&angle2(i)>semi_1) // >162 { x1=x1+cosB[i]*_pieRx; y1=y1-sinB[i]*_pieRy; } a=sqrt((x3-x2)*(x3-x2)+(y3-y2)*(y3-y2)); b=sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1)); c=sqrt((x3-x1)*(x3-x1)+(y3-y1)*(y3-y1)); perimeter=a+b+c; sp=perimeter/2.0; radius=sqrt(((sp-a)*(sp-b)*(sp-c))/sp)*0.95; xcg=(x1+x2+x3)/3.0; ycg=(y1+y2+y3)/3.0; xcc[p]=(a*x1+c*x2+b*x3)/perimeter; ycc[p]=(a*y1+c*y2+b*y3)/perimeter; } xin=xcc[1]; yin=ycc[1]; opoints[i].x=(int)xcc[0]; opoints[i].y=(int)(ycc[0]+(sinB[i]<0?_pieDepth+radius:0)); delete [] xcc; delete [] ycc; if (angle2(i)>=semi_2&&angle2(i)<=semi_1) // >90 and <150 { x1=x1+cos(bisectors(i))*_pieRx; y1=y1-sin(bisectors(i))*_pieRy; b=sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1)); c=sqrt((x3-x1)*(x3-x1)+(y3-y1)*(y3-y1)); perimeter=a+b+c; sp=perimeter/2.0; double radius1=sqrt(((sp-a)*(sp-b)*(sp-c))/sp)*0.95; double xin1=(a*x1+c*x2+b*x3)/perimeter; double yin1=(a*y1+c*y2+b*y3)/perimeter; double radius2=radius+radius1*0.85; // XSetForeground(display(),traceGC(),server()->pixel("black")); // XDrawArc(display(),graphPixmap(),traceGC(),xin1-radius1,yin1-radius1,2*radius1,2*radius1,0,circle); double xin2=(xin+xin1)/2; double yin2=(yin+yin1)/2; // XSetForeground(display(),traceGC(),server()->pixel("blue")); // XDrawArc(display(),graphPixmap(),traceGC(),xin2-radius2,yin2-radius2,2*radius2,2*radius2,0,circle); xin=xin2; yin=yin2; radius=radius2; // XSetForeground(display(),traceGC(),server()->pixel("red")); // XDrawLine(display(),graphPixmap(),traceGC(),x1,y1,x2,y2); // XDrawLine(display(),graphPixmap(),traceGC(),x1,y1,x3,y3); // XDrawLine(display(),graphPixmap(),traceGC(),x2,y2,x3,y3); } else if (angle2(i)>semi_1&&angle2(i)162 and <180 { // XSetForeground(display(),traceGC(),server()->pixel("black")); // XDrawArc(display(),graphPixmap(),traceGC(),xin-radius,yin-radius,2*radius,2*radius,0,circle); } else if (angle2(i)>semi) // >180 { x1=x+xo(i)+_pieRx; y1=y-yo(i)+_pieRy+yOffset; xin=x1+cos(bisectors(i))*_pieRx*0.5; yin=y1-sin(bisectors(i))*_pieRy*0.5; /* double xx1=abs(x1-x2); double yy1=abs(y1-y2); double xx2=abs(x1-x3); double yy2=abs(y1-y3); */ } else if (angle2(i)>semi_5) // >36 { xin=(xin+xcg)/2.0; yin=(yin+ycg)/2.0; } // XSetForeground(display(),traceGC(),server()->pixel("black")); // XDrawLine(display(),graphPixmap(),traceGC(),x1,y1,x2,y2); // XDrawLine(display(),graphPixmap(),traceGC(),x1,y1,x3,y3); // XDrawLine(display(),graphPixmap(),traceGC(),x2,y2,x3,y3); // XSetForeground(display(),traceGC(),server()->pixel("red")); // XDrawArc(display(),graphPixmap(),traceGC(),xin-radius,yin-radius,2*radius,2*radius,0,circle); dia=2*radius; alignPieLabels(trace_,iText[i],oText[i],percents,i); int len=iText[i].length(); if (len>0) { iRects[i].height=len*(fontInfo->ascent+fontInfo->descent); iRects[i].width=maxStringWidth(fontInfo,iText[i]); if (iRects[i].height0) { oRects[i].height=len*(fontInfo->ascent+fontInfo->descent); oRects[i].width=maxStringWidth(fontInfo,oText[i]); // adjust y position if (sectors(i)>0&§ors(i)<4) oRects[i].y-=oRects[i].height+labelOffset; else if (sectors(i)==0||sectors(i)==4) oRects[i].y-=oRects[i].height/2; else if (sectors(i)>4) oRects[i].y+=_pieDepth+labelOffset; // adjust x position if (sectors(i)==0) oRects[i].x=(int)(x+w+xo(i)+labelOffset); else if (sectors(i)==4) oRects[i].x=(int)(x+xo(i)-oRects[i].width-labelOffset); else if (sectors(i)==2||sectors(i)==6) oRects[i].x-=oRects[i].width/2; else if (cosB[i]<0) oRects[i].x-=oRects[i].width+labelOffset; } } // cout<=xi&&xjyi&&yjyj&&yi=xj&&xiyj&&yiyi&&yj0) { widths+=oRects[i].width+labelOffset; heights+=oRects[i].height+labelOffset; iv<oRects[iv(min)].y) min=n; iv.exchange(min,m); } } if (passes==0) for (m=0;m0||sectors(i)==1||sectors(i)==3) { oRects[i].y=opoints[i].y-oRects[i].height; } else if (sinB[i]<0||sectors(i)==5||sectors(i)==7) oRects[i].y=opoints[i].y; else if (sectors(i)==0) oRects[i].x=opoints[i].x; else if (sectors(i)==4) oRects[i].x=opoints[i].x-oRects[i].width; } passes++; i=0; } else { } } } delete [] opoints; } /**********************************************************************************************/ // computeDrawingSequence - calculate drawging sequence /**********************************************************************************************/ void MSGraph::computeDrawingSequence(MSGraphPieData* pieData_) { int& bufSize=pieData_->bufSize; MSFloatVector& radian1=pieData_->radian1; MSFloatVector& radian2=pieData_->radian2; MSFloatVector& xo=pieData_->xo; MSFloatVector& yo=pieData_->yo; MSIntVector& angle2=pieData_->angle2; MSIntVector& angle1=pieData_->angle1; MSFloatVector& offsets=pieData_->offsets; MSFloatVector& profiles=pieData_->profiles; MSUnsignedLongVector& lineColors=pieData_->lineColors; MSUnsignedLongVector& fillColors=pieData_->fillColors; MSUnsignedVector& sequence=pieData_->sequence; int i=0,j=0,angle=0; // split pieces with an angle greater than pi into 2 if (_orderDependent==MSTrue&&_indexOfMaxAnglecos1; delete [] pieData_->cos2; delete [] pieData_->sin1; delete [] pieData_->sin2; pieData_->cos1=new double[bufSize]; pieData_->cos2=new double[bufSize]; pieData_->sin1=new double[bufSize]; pieData_->sin2=new double[bufSize]; for (i=0;isin1[i]=sin(radian1(i)); pieData_->sin2[i]=sin(radian1(i)-radian2(i)); pieData_->cos1[i]=cos(radian1(i)); pieData_->cos2[i]=cos(radian1(i)-radian2(i)); } } for (i=0,angle=_startAngle;i0.0|| profiles((i+1)%bufSize)!=profiles(i)|| profiles((i!=0?i:bufSize)-1)!=profiles(i)|| offsets((i+1)%bufSize)!=offsets(i)|| offsets((i!=0?i:bufSize)-1)!=offsets(i)|| (i==_indexOfMaxAngle&&(profiles((i+2)%bufSize)!=profiles(i)|| offsets((i+2)%bufSize)!=offsets(i)))) { if ((pieData_->cos1[i]<0&&pieData_->cos2[i]>0)||(pieData_->cos1[i]>0&&pieData_->cos2[i]<0)) { exposed1<<(((pieData_->sin1[i]+pieData_->sin2[i])/2)<0?-1.0:1.0); exposed2<<(((pieData_->sin1[i]+pieData_->sin2[i])/2)<0?-1.0:1.0); } else { exposed1<sin1[i]; exposed2<sin2[i]; } } else { exposed1<<-10.0; exposed2<<-10.0; } } for (i=0;iexposed2(sequence(m))&& exposed1(sequence(j))>exposed1(sequence(m))) m=j; } sequence.exchange(m,i); } } } /**********************************************************************************************/ // drawPieSlices /**********************************************************************************************/ void MSGraph::drawPieSlices(MSTrace * trace_,const MSGraphPieData* pieData_,int w_, int h_) { // take references to PieData, no copying is performed const MSFloatVector& radian1=pieData_->radian1; const MSFloatVector& radian2=pieData_->radian2; const MSFloatVector& xo=pieData_->xo; const MSFloatVector& yo=pieData_->yo; const MSIntVector& angle2=pieData_->angle2; const MSIntVector& angle1=pieData_->angle1; const MSFloatVector& offsets=pieData_->offsets; const MSFloatVector& profiles=pieData_->profiles; const MSUnsignedLongVector& lineColors=pieData_->lineColors; const MSUnsignedLongVector& fillColors=pieData_->fillColors; const MSUnsignedVector& sequence=pieData_->sequence; double *cos1=pieData_->cos1; double *cos2=pieData_->cos2; double *sin1=pieData_->sin1; double *sin2=pieData_->sin2; MSTraceSet *ts=trace_->traceSet(); unsigned bufSize=sequence.length(); unsigned i,j,k; // draw slices one at a time for (unsigned s=0;s PI and < 2PI if (ts->pieAspectRatio()<1.0&&profiles(i)>0.0) { int maxPixels=2; double radian=radian1(i)-radian2(i); double angleInc=_pieRy>0?(2*asin(maxPixels/_pieRy)):1; if ((angle1(i)<=semi&&angle1(i)+angle2(i)>semi)||(angle1(i)>=semi&&angle1(i)<=circle)) { unsigned passes=1; double rad=radian1(i)>M_4PI?M_4PI:radian1(i)M_2PI?M_2PI:radian1(i); if (angle2(i)>semi&&angle1(i)+angle2(i)-circle>semi) { rad=radianM_2PI&&radian0) { radian=radian1(i)>M_3PI?M_3PI:M_PI; rad=radian1(i); } int pointCount=(int)rint(fabs(rad-radian)/angleInc)+2; XPoint *points=new XPoint[pointCount*2]; int yOffset=(int)(_pieDepth-_pieDepth*profiles(i)); for (j=0;jrad) radian=rad; points[j].x=(int)(_pieX+xo(i)+_pieRx+rint(cos(radian)*_pieRx)); points[j].y=(int)(_pieY-yo(i)+_pieRy-rint(sin(radian)*_pieRy)-1+yOffset); } for (k=j,j--;j0.0&&(angle1(i)<=semi&&angle1(i)+angle2(i)>semi)|| (angle1(i)>=semi&&angle1(i)circle)?circle-angle1(i):angle2(i)); int offset=angle_1-angle1(i); XSetForeground(display(),traceGC(),lineColors(i)); XDrawArc(display(),graphPixmap(),traceGC(),(int)(_pieX+xo(i)), (int)(_pieY-yo(i)+_pieDepth),w_,h_,angle_1,angle_2-offset); if (angle2(i)>semi&&angle1(i)+angle2(i)-circle>semi) { angle_1=semi; angle_2=(int)(angle1(i)+angle2(i)-circle-semi); XDrawArc(display(),graphPixmap(),traceGC(),(int)(_pieX+xo(i)), (int)(_pieY-yo(i)+_pieDepth),w_,h_,angle_1,angle_2); } } } // draw pie slices double yOffset=_pieDepth-_pieDepth*profiles(i); XSetForeground(display(),traceGC(),fillColors(i)); XFillArc(display(),graphPixmap(),traceGC(),(int)(_pieX+xo(i)), (int)(_pieY-yo(i)+yOffset),w_,h_,angle1(i),angle2(i)); XSetForeground(display(),traceGC(),lineColors(i)); XDrawArc(display(),graphPixmap(),traceGC(),(int)(_pieX+xo(i)), (int)(_pieY-yo(i)+yOffset),w_,h_,angle1(i),angle2(i)); for (unsigned p=0;p<2;p++) { double cose=p==0?cos1[i]:cos2[i]; double sine=p==0?sin1[i]:sin2[i]; double yy=sine*_pieRy; double xx=cose*_pieRx; int x1=(int)(_pieX+xo(i)+_pieRx),y1=(int)(_pieY-yo(i)+_pieRy+yOffset); int x2=(int)(x1+xx),y2=(int)(y1-yy); XSetForeground(display(),traceGC(),lineColors(i)); if (ts->pieAspectRatio()<1.0) { // fill in sides of pie if exposed if ((i==_indexOfMaxAngle&&p==0)||(i==_indexOfMaxAngle+1&&p==1)); else if (profiles(i)>0.0&& (p==0&&cose<0&&(profiles((i+1)%bufSize)0)|| p==1&&cose>0&&(profiles(i>0?i-1:bufSize-1)0?i-1:bufSize-1)>0))|| (offsets(i)>0.0&&(p==0&&cose<0||p==1&&cose>0))) { XPoint *points=new XPoint[4]; points[0].x=x1; points[0].y=y1; points[1].x=x2; points[1].y=y2; points[2].x=x2; points[2].y=(int)(y2+_pieDepth-yOffset); points[3].x=x1; points[3].y=(int)(y1+_pieDepth-yOffset); XSetForeground(display(),traceGC(),fillColors(i)); PFillPolygon(display(),graphPixmap(),traceGC(),points,4,Complex,CoordModeOrigin); XSetForeground(display(),traceGC(),lineColors(i)); XDrawLine(display(),graphPixmap(),traceGC(),x1,points[3].y,x2,points[2].y); XDrawLine(display(),graphPixmap(),traceGC(),x2,y2,x2,points[2].y); XDrawLine(display(),graphPixmap(),traceGC(),x1,y1,x1,points[3].y); delete [] points; } else if (profiles(i)>0.0&&sine<0) { XDrawLine(display(),graphPixmap(),traceGC(),x2,y2,x2, (int)(y2+_pieDepth-yOffset)); } // draw outer vertical lines if (p==0&&profiles(i)>0.0) { // draw left side of pie if ((angle1(i)<=semi&&angle1(i)+angle2(i)>=semi)|| (angle1(i)>semi&&angle1(i)+angle2(i)>=circle+semi)|| (angle1(i)>semi&&angle1(i)=circle) { XDrawLine(display(),graphPixmap(),traceGC(),(int)(_pieX+w_+xo(i)), (int)(_pieY-yo(i)+_pieRy+yOffset), (int)(_pieX+w_+xo(i)),(int)(_pieY-yo(i)+_pieRy+_pieDepth)); } } } //draw radial lines if (w_>lineThreshold) { if ((i==_indexOfMaxAngle&&p==0)||(i==_indexOfMaxAngle+1&&p==1)); else XDrawLine(display(),graphPixmap(),traceGC(),x1,y1,x2,y2); } } } } /**********************************************************************************************/ // drawLabels /**********************************************************************************************/ void MSGraph::drawLabels(MSTrace * trace_,const MSGraphPieLabelData* pieLabelData_) { // draw labels MSTraceSet *ts=trace_->traceSet(); XFontStruct *fontInfo=(XFontStruct*)server()->fontStruct(ts->textFont()); int bufSize=trace_->dataCount(); unsigned i=0; // pointers to needed data from MSGraphPieLabelData const XRectangle *iRects= pieLabelData_->iRects; const XRectangle *oRects= pieLabelData_->oRects; const MSStringVector* iText= pieLabelData_->iText; const MSStringVector* oText= pieLabelData_->oText; // XDrawRectangles(display(),graphPixmap(),traceGC(),iRects,bufSize); // XDrawRectangles(display(),graphPixmap(),traceGC(),oRects,bufSize); XSetForeground(display(),traceGC(),ts->textForeground()); for (i=0;iascent; int len=iText[i].length(); for (t=0;tascent+fontInfo->descent; } yt=oRects[i].y+fontInfo->ascent; len=oText[i].length(); for (t=0;tascent+fontInfo->descent; } } } void MSGraph::alignPieLabels(MSTrace *trace_,MSStringVector& iLabel_,MSStringVector& oLabel_, const MSStringVector& percents_,unsigned i_) { MSTraceSet *ts=trace_->traceSet(); unsigned long legend=ts->pieLegendAlignment(); unsigned long value=ts->pieValueAlignment(); unsigned long percent=ts->piePercentAlignment(); iLabel_.reshape(3); oLabel_.reshape(3); if (legend>MSNone) { unsigned index=legend&MSTop?0:legend&MSBottom?2:1; if (legend&Outside) oLabel_[index]=trace_->legend(i_); else iLabel_[index]=trace_->legend(i_); } if (value>MSNone) { MSString formatBuffer; ts->formatOutput(formatBuffer,i_,trace_->virtualCol()); if (formatBuffer.length()>0) { unsigned index=value&MSTop?0:value&MSBottom?2:1; MSString aString=value&Outside?oLabel_[index]:iLabel_[index]; if (aString.length()>0) { if (!(value&MSLeft)||legend&MSLeft) aString<<" "<MSNone) { int bufSize=trace_->dataCount(); double total=0; for (unsigned i=0;iy(i_); unsigned index=percent&MSTop?0:percent&MSBottom?2:1; MSString aString=percent&Outside?oLabel_[index]:iLabel_[index]; MSString pc=percents_(i_); pc<<"%"; if (aString.length()>0) { if (percent&MSLeft&&!(legend&MSLeft)&&!(value&MSLeft)) { aString.insert((pc<<" ")); } else if (aString.numWords()>1) { if (percent&MSRight&&!(value&MSRight)&&!(legend&MSRight)) aString<<" "<=0;i--) { if (iLabel_(i).length()==0) iLabel_.removeAt(i); if (itraceSet(); double x0, y0; // x, y coordinates of slice center double dX,dY; // distance from point to slice center by x and y double distance; // distance from point to slice center double angle; int selectedSlice=-1; MSBoolean found=MSFalse; if (_pieData!=0) { int bufSize=_pieData->bufSize; // for every slice find if point is within it's arc // if it is, compare angles. for(unsigned i=0;ixo(i)+_pieRx; y0=_pieY-_pieData->yo(i)+(_pieDepth-_pieDepth*_pieData->profiles(i))+_pieRy; dX=x_-x0; dY=y_-y0; if ( (dX*dX)/(_pieRx*_pieRx) + (dY*dY)/(_pieRy*_pieRy) < 1) { // calculate angle from 3 o'clock position, counterclockwise dY=dY/ts->pieAspectRatio(); // adjust dY for pieAspectRatio distance=sqrt(dX*dX+dY*dY); if (dX>=0&&dY<=0) angle=asin(fabs(dY)/distance); else if(dX<0&&dY<=0) angle=asin(fabs(dX)/distance) + M_PI/2; else if(dX<0&&dY>=0) angle=asin(fabs(dY)/distance) + M_PI; else angle=asin(dX/distance) + M_PI*1.5; angle=angle/DegPerRadian; // convert from radian unsigned next=i==bufSize-1?0:i+1; double angle1=_pieData->angle1(i); double angle2=_pieData->angle1(next); if (angle2>angle1&&angle>angle1&&angle<=angle2) found=MSTrue; else if(angle2angle1||angle<=angle2)) found=MSTrue; if (found==MSTrue) { // slice found, make adjustments for indexOfMaxAngle shift if (_orderDependent) { if(i<_indexOfMaxAngle) selectedSlice=i; else if(i==_indexOfMaxAngle || i==_indexOfMaxAngle+1) selectedSlice=_indexOfMaxAngle; else selectedSlice=i-1; } else selectedSlice=i; break; } } } } return selectedSlice; } void MSGraph::clearPieData(void) { if(_pieData!=0) delete _pieData; if(_pieLabelData!=0) delete _pieLabelData; } /**********************************************************************************************/ // MSGraphPieData /**********************************************************************************************/ MSGraphPieData::MSGraphPieData(unsigned bufSize_) { bufSize=bufSize_; allocate(); } MSGraphPieData::~MSGraphPieData() { deallocate(); } void MSGraphPieData::clear(unsigned bufSize_) { bufSize=bufSize_; angle1.removeAll(); angle2.removeAll(); percents.removeAll(); xo.removeAll(); yo.removeAll(); radian1.removeAll(); radian2.removeAll(); offsets.removeAll(); profiles.removeAll(); lineColors.removeAll(); fillColors.removeAll(); bisectors.removeAll(); sequence.removeAll(); deallocate(); allocate(); } void MSGraphPieData::allocate(void) { cosB=new double[bufSize]; sinB=new double[bufSize]; cos1=new double[bufSize]; cos2=new double[bufSize]; sin1=new double[bufSize]; sin2=new double[bufSize]; } void MSGraphPieData::deallocate(void) { delete [] cosB; delete [] sinB; delete [] cos1; delete [] cos2; delete [] sin1; delete [] sin2; } /**********************************************************************************************/ // MSGraphPieLabelData /**********************************************************************************************/ MSGraphPieLabelData::MSGraphPieLabelData(unsigned bufSize_) { bufSize=bufSize_; allocate(); } MSGraphPieLabelData::~MSGraphPieLabelData() { deallocate(); } void MSGraphPieLabelData::clear(unsigned bufSize_) { bufSize=bufSize_; deallocate(); allocate(); } void MSGraphPieLabelData::allocate(void) { iRects=new XRectangle[bufSize]; oRects=new XRectangle[bufSize]; iText=new MSStringVector[bufSize]; oText=new MSStringVector[bufSize]; } void MSGraphPieLabelData::deallocate(void) { delete [] iText; delete [] oText; delete [] iRects; delete [] oRects; } aplus-fsf-4.22/src/MSGUI/MSGraphUI.C0000644000265000001440000017001510772770404012350 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #ifndef MSStringVectorTraceSet #include #endif #ifndef MSFloatMatrixTraceSet #include #endif #ifndef MSIntMatrixTraceSet #include #endif static const int DefaultChunkSize=3; extern unsigned long MSGraphEventMask; /* * MSGraphNewtrace member functions * */ MSGraphNewtrace::MSGraphNewtrace(MSGraph *owner_) { _points=0; _pointCount=0; _pointAllocCount=0; _graph=owner_; } MSGraphNewtrace::~MSGraphNewtrace(void) { if (_points!=0) delete [] _points; _pointCount=0; _pointAllocCount=0; } XPoint *MSGraphNewtrace::points(int index_) { if (index_>=pointAllocCount()) pointsAlloc(); return &_points[index_]; } void MSGraphNewtrace::pointsAlloc(void) { XPoint *newp=new XPoint[_pointAllocCount+DefaultChunkSize]; for (int i=0;i<_pointAllocCount;i++) { newp[i].x=_points[i].x; newp[i].y=_points[i].y; } if (_points!=0) delete [] _points; _points=newp; _pointAllocCount+=DefaultChunkSize; } MSGraphNewtrace *MSGraph::nt(int index_) { if (index_>=_newtraceAllocCt) newtraceAlloc(); return _nt[index_]; } void MSGraph::newtraceAlloc(void) { MSGraphNewtrace **newt=new MSGraphNewtrace*[_newtraceAllocCt+DefaultChunkSize]; int i; for (i=0; i<_newtraceAllocCt; i++) { newt[i]=_nt[i]; _nt[i]=0; } for (i=_newtraceAllocCt; i<_newtraceAllocCt+DefaultChunkSize; i++) { newt[i]=new MSGraphNewtrace(this); } if (_nt!=0) delete [] _nt; _nt=newt; _newtraceAllocCt+=DefaultChunkSize; } void MSGraph::newtraceDealloc(void) { if (_nt!=0) { for (int i=0; i<_newtraceAllocCt; i++) delete _nt[i]; delete [] _nt; _nt=0; } _newtraceCt=0; _newtraceAllocCt=0; _newtraceIndex=0; _selectLine=0; _selectPoint=0; _focusLine=0; } MSBoolean MSGraph::findLineHandle(int x_,int y_) { static int size=8; for (int i=0; ipointCount(); j++) { if (((abs(x_-nt(i)->points(j)->x)points(j)->y)traceSet(); for (int j=0; jtraceList().count(); j++) { MSTrace *trace=ts->trace(j); for (int i=0; idataCount(); i++) { int x=xValueToPixel(xValue(trace,i),trace->xAxis()); int y=yValueToPixel(trace->y(i),trace->yAxis()); if (((abs(x_-x)internalModel(MSTrue); return ts; } MSTraceSet *MSGraph::createTextTraceSet(MSFloatMatrix& aFloatMatrix_,MSStringVector& aStringVector_) { freeze(); MSStringVectorTraceSet *ts=new MSStringVectorTraceSet(this,aStringVector_); ts->textFont(selectTrace()!=0?selectTrace()->traceSet()->textFont():editor()->font()); if(orientation()==Horizontal) { ts->moveTo(aFloatMatrix_(0,1),aFloatMatrix_(0,0)); } else ts->moveTo(aFloatMatrix_(0,0),aFloatMatrix_(0,1)); ts->internalModel(MSTrue); unfreeze(); return ts; } MSFloatMatrix MSGraph::createInteractiveTraceData(unsigned long i_) { MSFloatMatrix aFloatMatrix(interactivePixel().rows(),2); for (int i=0;ixbutton.x; int y=event_->xbutton.y; static double range=0.2; for (int i=0; itraceSet()->selectable()==MSTrue) { for (int k=0; kdataCount()-1; k++) { x1=xValueToPixel(xValue(trace,k),trace->xAxis()); y1=yValueToPixel(trace->y(k),trace->yAxis()); x2=xValueToPixel(xValue(trace,k+1),trace->xAxis()); y2=yValueToPixel(trace->y(k+1),trace->yAxis()); x1+=trace->xOffset(); x2+=trace->xOffset(); y1+=trace->yOffset(); y2+=trace->yOffset(); sa=x2-x1; sb=y2-y1; left=sa>0?x1:x2; right=sa>0?x2:x1; top=sb>0?y1:y2; bot=sb>0?y2:y1; if ((sa==0&&abs(x-x1)<3&&y<=top&&y>=bot|| (sb==0&&abs(y-y1)<3&&x<=right&&x>=left))) { return trace; } else if (sa!=0&&sb!=0&&x<=right&&x>=left&&y>=top&&y<=bot) { double csq=sqrt(double(sa*sa+sb*sb)); int asq=x-x1; int bsq=y-y1; double Csq=sqrt(double(asq*asq+bsq*bsq)); asq=x-x2; bsq=y-y2; Csq+=sqrt(double(asq*asq+bsq*bsq)); // cout<<"csq "<pointCount()-1; j++) { if ((nt(i)->sa(j)==0&&abs(x_-nt(i)->points(j)->x)<3&& y_<=nt(i)->top(j)&&y_>=nt(i)->bot(j))|| (nt(i)->sb(j)==0&&abs(y_-nt(i)->points(j)->y)<3&& x_<=nt(i)->right(j)&&x_>=nt(i)->left(j))) { selectPoint(j); selectLine(i); return MSTrue; } else if (nt(i)->sa(j)!=0&&nt(i)->sb(j)!=0&&x_<=nt(i)->right(j)&& x_>=nt(i)->left(j)&&y_>=nt(i)->top(j)&&y_<=nt(i)->bot(j)) { double csq=sqrt(double(nt(i)->sa(j)*nt(i)->sa(j)+nt(i)->sb(j)*nt(i)->sb(j))); int asq=x_-nt(i)->points(j)->x; int bsq=y_-nt(i)->points(j)->y; double Csq=sqrt(double(asq*asq+bsq*bsq)); asq=x_-nt(i)->points(j+1)->x; bsq=y_-nt(i)->points(j+1)->y; Csq+=sqrt(double(asq*asq+bsq*bsq)); if ((Csq-csq)xbutton.button==1)mask=Button1Mask; else if (event_->xbutton.button==2)mask=Button2Mask; else mask=Button3Mask; keys=mask; int offset=highlightThickness()+shadowThickness(); int borderOffset=legend()->offset(); int xoffset=event_->xbutton.x,yoffset=event_->xbutton.y; x=legend()->x_origin()+xoffset; y=legend()->y_origin()+yoffset; // following casts for VISUAL C++ unsigned long limit=legendAlignment()&Outside?(unsigned long)(legendAlignment()&Vertical?HoldY:HoldX):(unsigned long)MSNone; if ((bs=backingStore())==MSFalse) { redrawImmediately(); selectInput(MSGraphEventMask^ExposureMask); lx=legend()->x_origin(); ly=legend()->y_origin(); } while (keys&mask) { XQueryPointer(display(),window(),&root,&child,&rx,&ry,&ix,&iy,&keys); if (ix!=x||iy!=y) { if ((ix-xoffset)(width()-offset-legend()->width()-spacing-borderOffset)) { ix=width()-offset-legend()->width()+xoffset-spacing-borderOffset; } if ((iy-yoffset)>(height()-offset-legend()->height()-spacing-borderOffset)) { iy=height()-offset-legend()->height()+yoffset-spacing-borderOffset; } if ((iy-yoffset)<(offset+spacing+borderOffset)) { iy=offset+yoffset+spacing+borderOffset; } if (ix!=x||iy!=y) { legend()->moveTo(limit&HoldX?legend()->x_origin():ix-xoffset, limit&HoldY?legend()->y_origin():iy-yoffset); if (bs==MSFalse) { XCopyArea(display(),graphPixmap(),window(),clearGC(),lx,ly, legend()->width(),legend()->height(),lx,ly); lx=legend()->x_origin(); ly=legend()->y_origin(); XSync(display(),False); } } } x=ix; y=iy; } if (abs(ix-event_->xbutton.x)>4||abs(iy-event_->xbutton.y)>4) { _xLegendPosition=(ix-xoffset)/(double)width(); _yLegendPosition=(iy-yoffset)/(double)height(); } selectInput(MSGraphEventMask); } void MSGraph::drawMoveTrace(MSTrace *trace_) { if (trace_->style()==Segment) plotSegmentTrace(trace_,window(),windowGC()); else drawMoveLineTrace(trace_); } void MSGraph::drawMoveLineTrace(MSTrace *trace_) { int i,k,xs,ys; int x,y; int pointCount=0; int xLast=0,yLast=0; int datacount=trace_->dataCount(); int inc=datacount<50?1:datacount/50; int bufSize=datacount+2; MSTrace *trace; bufSize=bufSize>MSGraph::_MaxBufSize?MSGraph::_MaxBufSize:bufSize; XPoint *points=new XPoint[bufSize]; for(i=0;itraceSet()->traceList().count();i++) { if((trace=trace_->traceSet()->trace(i))!=0) { xs=trace->xAxis(); ys=trace->yAxis(); for (k=0; kdataCount()&&pointCount+1xOffset(); y=yValueToPixel(trace->y(k),ys)+trace_->yOffset(); if (x==xLast&&y==yLast) continue; xLast=x; yLast=y; points[pointCount].x=x; points[pointCount++].y=y; } if (inc!=1&&(datacount-1)%inc!=0) { // make sure to draw last point k=datacount-1; x=xValueToPixel(xValue(trace,k),xs)+trace_->xOffset(); y=yValueToPixel(trace->y(k),ys)+trace_->yOffset(); points[pointCount].x=x; points[pointCount++].y=y; } XDrawLines(display(),window(),windowGC(),points,pointCount,CoordModeOrigin); drawLineHandles(trace,trace_); pointCount=0; xLast=yLast=0; } } delete [] points; } void MSGraph::drawLineHandles(MSTrace *trace_, MSTrace *refTrace) { XRectangle *rects=new XRectangle[trace_->dataCount()]; double xoffset=refTrace?refTrace->xOffset():trace_->xOffset(); double yoffset=refTrace?refTrace->yOffset():trace_->yOffset(); int xs=trace_->xAxis(); int ys=trace_->yAxis(); int bufSize=trace_->dataCount(); int inc=bufSize<50?1:bufSize/50; int x,y,size=6; unsigned i,recs; for (i=0,recs=0;iy(i),ys)+yoffset); rects[recs].x=x-size/2; rects[recs].y=y-size/2; rects[recs].width=size; rects[recs].height=size; } if (inc!=1&&(bufSize-1)%inc!=0) { // make sure that handle is drawn for the last point i=bufSize-1; x=(int)(xValueToPixel(xValue(trace_,i),xs)+xoffset); y=(int)(yValueToPixel(trace_->y(i),ys)+yoffset); rects[recs].x=x-size/2; rects[recs].y=y-size/2; rects[recs].width=size; rects[recs++].height=size; } XFillRectangles(display(),window(),windowGC(),rects,recs); delete [] rects; } MSTrace *MSGraph::findDataPoint(const XEvent *event_) { int i,j,k; int xs,ys; double d=0; double r,rr,s; double x,y; MSTrace *trace; MSTrace *traceNum=0; int offset;//lineWidth; int stackCt=0; MSTrace **stackTrace=new MSTrace*[traceList().count()xbutton.x; int iy=event_->xbutton.y; // special case for pie chart if (graphMode()&PieChart) { for (i=0; idataCount()>1) { int point=findSelectedSlice(trace,ix,iy); if (point!=-1) { traceNum=trace; trace->point(point); trace->traceSet()->selectRow(point); trace->traceSet()->selectCol(trace->virtualCol()); } } } return traceNum; } for (i=0; idataCount()>1&& (trace->style()==Stack||trace->style()==Area)) { stackTrace[stackCt++]=trace; } } for (i=0; idataCount()>1 && trace->style()!=0 && trace->traceSet()->isProtected()==MSFalse) { if (trace->style()==Bar||trace->style()==Stack) { // for bar or stack traces calculate bar offset offset=(trace->barCount())*barWidth()-xBar(); } // else if (trace->style()>=Close) // { // lineWidth=trace->lineWidth(); // } xs=trace->xAxis(); ys=trace->yAxis(); double xx=xPixelToValue(ix,xs); double yy=yPixelToValue(iy,ys); for (k=0; kdataCount(); k++) { x=xValue(trace,k); y=yValue(trace,k); if (event_->xbutton.button==1&&trace->style()>=Close) { int xxx=xValueToPixel(x,xs); if (abs(ix-xxx)<=(selectDistance()/2)&&yy<=trace->y(k,1+trace->offset())&& yy>=trace->y(k,1+trace->offset())) { trace->traceSet()->selectRow(k); trace->traceSet()->selectCol(trace->virtualCol()); return trace; } } // calculate distance by x if (orientation()!=Horizontal&&(trace->style()==Bar||trace->style()==Stack)) { s=(int)(xScale(xs)*(xx-x))-offset; } else if (orientation()==Horizontal&&(trace->style()==Area||trace->style()==Stack)) { for (j=i,x=0.;jstyle()==Bar||trace->style()==Stack)) { r=(yy-y)*yScale(ys)+offset; } else if (orientation()!=Horizontal&&s*sstyle()==Area||trace->style()==Stack)) { for (j=i,y=0.;jy(k); y+=yy<0?yval<0?yval:0:yval<0?0:yval; } r=fabs(yy-y)*yScale(ys); } else if (s*sstyle()>=Close)) { j=trace->offset(); r=fabs(yy-y); r=((rr=fabs(yy-trace->y(k,j))))y(k,j+1))))style()>=HLC) r=((rr=fabs(yy-trace->y(k,j+2))))point(k); trace->traceSet()->selectRow(k); trace->traceSet()->selectCol(trace->virtualCol()); } } } } delete [] stackTrace; return(traceNum); } void MSGraph::moveDataPoint(const XEvent *event_) { MSBoolean update,bs; int xs,ys; unsigned int keys,mask=0; int offset=0; int ix,iy; int rx,ry; int ox,oy; int oxSym,oySym,ixSym,iySym; // correspond to the position of symbol point int min_ix,max_ix; double min_x,max_x; MSBoolean hold_y=MSFalse; MSBoolean hold_x=MSFalse; MSBoolean constrain_x=MSFalse; MSRect r; int min_iy; double min_y; double x,y,xx,yy; Window root,child; MSTrace *trace; const double factor=0.25; int ht=highlightThickness()+shadowThickness(); if ((trace=findDataPoint(event_))!=0) { xs=trace->xAxis(); ys=trace->yAxis(); if (event_->xbutton.button==1) mask=Button1Mask; else if (event_->xbutton.button==2) mask=Button2Mask; else mask=Button3Mask; keys=mask; int bx=ox=event_->xbutton.x; int by=oy=event_->xbutton.y; start_again: if ((bs=backingStore())==MSFalse) { redrawImmediately(); } if (trace->style()==Bar||trace->style()==Stack) { offset=(trace->barCount())*barWidth()-xBar(); offset+=xBar()/barCount(); if (orientation()==Horizontal) { min_y=yValue(trace,trace->point()); min_iy=yValueToPixel(min_y,trace->yAxis()); hold_y=MSTrue; } else { min_x=xValue(trace,trace->point()); min_ix=xValueToPixel(min_x,trace->xAxis()); hold_x=MSTrue; } } else { if (trace->traceSet()->overlap()==MSFalse) { min_x=xValue(trace,trace->point()-trace->point()>0?1:0); min_ix=xValueToPixel(min_x,trace->xAxis()); max_x=xValue(trace,trace->point()+trace->point()<(trace->dataCount()+1)?1:0); max_ix=xValueToPixel(max_x,trace->xAxis()); } if (trace->traceSet()->constraint()==HoldX) { min_x=xValue(trace,trace->point()); min_ix=xValueToPixel(min_x,trace->xAxis()); hold_x=MSTrue; } if (trace->traceSet()->constraint()==HoldY) { min_y=yValue(trace,trace->point()); min_iy=yValueToPixel(min_y,trace->yAxis()); hold_y=MSTrue; } } if (constrain_x==MSTrue) { ox=oxmax_ix?max_ix:ox; } ox=hold_x==MSTrue?min_ix:ox; oy=hold_y==MSTrue?min_iy:oy; if (orientation()==Horizontal) { // offset is used in bar and stack. adjust symbol position depending on orientation oxSym=ox;oySym=oy+offset; } else { oxSym=ox+offset;oySym=oy; } dataWin()->setDataWin(xStringWidth(),yStringWidth()); drawScanXYvalues(xValue(trace,trace->point()),yValue(trace,trace->point()),xs,ys); drawMoveDataPointValueBox(ox,oy); drawMoveDataPointSymbols(trace,oxSym,oySym); while (keys&mask) { update=MSFalse; XQueryPointer(display(),window(),&root,&child,&rx,&ry,&ix,&iy,&keys); if (constrain_x==MSTrue) { ix=ixmax_ix?max_ix:ix; } ix=hold_x==MSTrue?min_ix:ix; iy=hold_y==MSTrue?min_iy:iy; if (trace->autoScale()==MSTrue) { if (ixx_end()) { _xMax[xs]=xMaxData(xs)+(x_org()/xScale(xs))*factor; _xMin[xs]=xMinData(xs); update=MSTrue; } if (iyy_org()) { _yMin[ys]=yMinData(ys)-(y_end()/yScale(ys))*factor; _yMax[ys]=yMaxData(ys); update=MSTrue; } if (update==MSTrue) { redrawImmediately(); goto start_again; } } if (orientation()==Horizontal) { // offset is used in bar and stack. adjust symbol position depending on orientation oxSym=ox;oySym=oy+offset;ixSym=ix;iySym=iy+offset; } else { oxSym=ox+offset;oySym=oy;ixSym=ix+offset;iySym=iy; } if (ix!=ox||iy!=oy) { // The following no backingStore mode needs to fix the // case where the dataWin overlaps the x or y cursor if (bs==MSFalse) { XCopyArea(display(),graphPixmap(),window(),clearGC(),ht,ht,width()-2*ht,height()-2*ht,ht,ht); server()->flush(); } xx=hold_x==MSTrue?xValue(trace,trace->point()):normalizedPixelToValue(ox,xs); yy=hold_y==MSTrue?yValue(trace,trace->point()):yPixelToValue(oy,ys); drawScanXYvalues(xx,yy,xs,ys); drawMoveDataPointValueBox(ox,oy); if (bs==MSTrue) drawMoveDataPointSymbols(trace,oxSym,oySym); ox=ix; oy=iy; xx=hold_x==MSTrue?xValue(trace,trace->point()):normalizedPixelToValue(ox,xs); yy=hold_y==MSTrue?yValue(trace,trace->point()):yPixelToValue(oy,ys); drawScanXYvalues(xx,yy,xs,ys); drawMoveDataPointValueBox(ix,iy); drawMoveDataPointSymbols(trace,ixSym,iySym); } } xx=hold_x==MSTrue?xValue(trace,trace->point()):normalizedPixelToValue(ix,xs); yy=hold_y==MSTrue?yValue(trace,trace->point()):yPixelToValue(iy,ys); drawScanXYvalues(xx,yy,xs,ys); drawMoveDataPointValueBox(ix,iy); drawMoveDataPointSymbols(trace,ixSym,iySym); // calculate current positions depending on mode if (orientation()==Horizontal) { y=yPixelToValue(oy,ys); if (trace->style()==Stack||trace->style()==Area) { //double xOffset=(bx-ox)/xScale(xs); double xOffset= x=xPixelToValue(bx,xs)-xPixelToValue(ox,xs); x=xValue(trace,trace->point()); if (x>0&&(x+xOffset)<0) x=xPixelToValue(ox,xs); else if(x<0&&(x+xOffset)>0) x=xPixelToValue(ox,xs); else x-=xOffset; } else x=xPixelToValue(ox,xs); // in horizontal mode we reverse x and y when updating model trace->traceSet()->validate(trace->point(),trace->virtualCol(),y,x); } else { x=normalizedPixelToValue(ox,xs); if (trace->style()==Stack||trace->style()==Area) { double yOffset=(by-oy)/yScale(ys); y=yValue(trace,trace->point()); if (y>0&&(y+yOffset)<0) { int y0=yValueToPixel(0.0,ys); yOffset=(by-y0)/yScale(ys); } y+=yOffset; } else y=yPixelToValue(oy,ys); trace->traceSet()->validate(trace->point(),trace->virtualCol(),x,y); } dataWin()->lower(); dataWin()->unmap(); dataWin()->MSWidget::clear(); } } void MSGraph::drawMoveDataPointSymbols(MSTrace *trace_,int x_,int y_) { int x,y; XDrawLine(display(),window(),windowGC(),x_-trace_->symbolSize()/2,y_, x_+trace_->symbolSize()/2,y_); XDrawLine(display(),window(),windowGC(),x_,y_-trace_->symbolSize()/2,x_, y_+trace_->symbolSize()/2); if (Line&trace_->style()) //||(Line&trace_->style()&&Scatter&trace_->style())) { if (trace_->point()!=0) { x=xValueToPixel(xValue(trace_,trace_->point()-1),trace_->xAxis()); y=yValueToPixel(trace_->y(trace_->point()-1),trace_->yAxis()); XDrawLine(display(),window(),windowGC(),x_,y_,x,y); } if (trace_->point()!=trace_->dataCount()-1) { x=xValueToPixel(xValue(trace_,trace_->point()+1),trace_->xAxis()); y=yValueToPixel(trace_->y(trace_->point()+1),trace_->yAxis()); XDrawLine(display(),window(),windowGC(),x_,y_,x,y); } } } void MSGraph::drawMoveDataPointValueBox(int x_,int y_) { drawScanXYvalueBox(x_,y_); } void MSGraph::drawScanXYvalueBox(int x_,int y_) { int xOffset=10; int yOffset=10; double xx=normalizedPixelToValue(x_,0); double yy=yPixelToValue(y_,0); int x=(x_+xOffset+dataWin()->width())>width()-offset()? width()-offset()-dataWin()->width():x_+xOffsetheight())>height()-offset()? height()-dataWin()->height()-offset():y_+yOffsetmoveTo(x,y); #ifdef MS_WINDOWS dataWin()->drawHighlight(); #endif } MSTrace *MSGraph::findTextTrace(const XEvent *event_) { XFontStruct *fi; MSTrace *trace; int button_x=event_->xbutton.x; int button_y=event_->xbutton.y; for (int i=0; itraceSet()->textLength()!=0&&trace->dataCount()==1) { MSStringVector aStringVector; unsigned lines=trace->traceSet()->textLength(); MSString formatBuffer; for (int j=0;jtraceSet()->formatText(formatBuffer.removeAll(),j); fi=(XFontStruct *)server()->fontStruct(trace->traceSet()->textFont()); int h=(fi->ascent+fi->descent)*aStringVector.length(); int w=maxStringWidth(fi,aStringVector); int x=xValueToPixel(xValue(trace,0),trace->xAxis()); int y=yValueToPixel(yValue(trace,0),trace->yAxis()); if ((button_x>=x&&button_x<=(x+w))&&(button_y>=y&&button_y<=(y+h))) return trace; } } return 0; } int MSGraph::indexOfLongestString(MSStringVector& sv_) { int index=0,maxlen=0; for (unsigned i=0;imaxlen) { maxlen=len; index=i; } } return index; } int MSGraph::maxStringWidth(XFontStruct*fi_,MSStringVector& aStringVector_) { int maxWidth=0; for (unsigned i=0;imaxWidth?w:maxWidth; } return maxWidth; } void MSGraph::enterTrace(const XEvent *event_) { if (event_!=0) { if (addLineSegment(event_)==MSTrue) { _newtraceCt++; drawLineHandles(); _onLinePoint=MSFalse; selectInput(MSGraphEventMask|PointerMotionMask); } else { if (graphZoomStatus()==MSTrue) XDefineCursor(display(),window(),zoomCursor()); else XUndefineCursor(display(),window()); graphUIModeSet(Normal); } } } void MSGraph::enterTextTrace(void) { int length; graphUIModeSet(AddTextTrace); int x=interactivePixel()(0,0); int y=interactivePixel()(0,1); if (x+editor()->width()>x_end()) { if ((length=x_end()-x)<50) { length=50; x=x_end()-length; } editor()->width(length); } editor()->font(font()); editor()->foreground(foreground()); int w=x_end()-x-5; int h=y_org()-y; editor()->resize(w,h>height()?height()-5:h); editor()->moveTo(x,y); editor()->map(); editor()->raise(); focusInNotify(editor()); } void MSGraph::editTextTrace(void) { if (selectTrace()!=0 && selectTrace()->traceSet()->isProtected()==MSFalse) { XFontStruct *fi=(XFontStruct *)server()->fontStruct(selectTrace()->traceSet()->textFont()); int x=xValueToPixel(xValue(selectTrace(),0),selectTrace()->xAxis()); int y=yValueToPixel(yValue(selectTrace(),0),selectTrace()->yAxis()); MSStringVector aStringVector; unsigned lines=selectTrace()->traceSet()->textLength(); MSString formatBuffer; for (int j=0;jtraceSet()->formatText(formatBuffer.removeAll(),j); int h=aStringVector.length()*(fi->ascent+fi->descent); int w=maxStringWidth(fi,aStringVector); int maxw=x_end()-x-5; int maxh=y_org()-y; w=w>maxw?maxw:w; h=w>maxh?maxh:h; editor()->moveTo(x,y); editor()->stringVector(aStringVector); editor()->foreground(selectTrace()->traceSet()->textForeground()); editor()->font(selectTrace()->traceSet()->textFont()); editor()->resize(maxw,maxh); if (editor()->mapped()!=MSTrue) { int xset=interactivePixel()(0,0); editor()->moveCursor(0,(xset-x)/fi->max_bounds.width); } if (inputFocus()==this) { editor()->map(); editor()->raise(); focusInNotify(editor()); } } } void MSGraph::editorEscape(void) { unHighlightTrace(); editor()->unmap(); editor()->lower(); editor()->string(""); focusOutNotify(editor()); } void MSGraph::editorActivate(void) { if (graphUIMode()==AddTextTrace&&editor()->length()>0) { if (activateCallback(MSWidgetCallback::addtexttrace)!=MSTrue) { MSFloatMatrix pFloatMatrix(createInteractiveTraceData((unsigned long)MSLeft)); createTextTraceSet(pFloatMatrix,*(new MSStringVector(editorString()))); } } else { if (selectTrace()!=0) { selectTrace()->traceSet()->validateText(editorString()); unHighlightTrace(); selectTrace(0); } } editor()->string(""); editor()->lower(); editor()->unmap(); graphUIModeSet(Normal); } void MSGraph::moveTextTrace(const XEvent *event_) { int ix,iy; int rx,ry; int offset=1; unsigned int keys,mask=0; Window root,child; MSTrace *trace=selectTrace(); MSBoolean copyMode=MSFalse; if (event_->xbutton.button==1) mask=Button1Mask; else if (event_->xbutton.button==2) mask=Button2Mask; else mask=Button3Mask; keys=mask; XFontStruct *fi=(XFontStruct *)server()->fontStruct(trace->traceSet()->textFont()); int x=event_->xbutton.x; int y=event_->xbutton.y; MSStringVector aStringVector; unsigned lines=trace->traceSet()->textLength(); MSString formatBuffer; for (int j=0;jtraceSet()->formatText(formatBuffer.removeAll(),j); int h=(fi->ascent+fi->descent)*aStringVector.length()+1; int w=maxStringWidth(fi,aStringVector)+1; int xStart=xValueToPixel(xValue(trace,0),trace->xAxis()); int yStart=yValueToPixel(yValue(trace,0),trace->yAxis()); int xoffset=event_->xbutton.x-xStart; int yoffset=event_->xbutton.y-yStart; XDrawRectangle(display(),window(),windowGC(),x-xoffset-1,y-yoffset-1,w,h); while (keys&mask) { if (keys&ShiftMask) copyMode=MSTrue; else copyMode=MSFalse; XQueryPointer(display(),window(),&root,&child,&rx,&ry,&ix,&iy,&keys); if (ix!=x||iy!=y) { if ((ix-xoffset)<(x_org()+offset+2)) { ix=x_org()+offset+xoffset+2; } if ((iy-yoffset)<(y_end()+offset+2)) { iy=y_end()+offset+yoffset+2; } if ((ix-xoffset)>(x_end()-offset)) ix=x_end()-offset+xoffset; if ((iy-yoffset)>(y_org()-h-offset)) iy=y_org()-h-offset+yoffset; if (keys&ControlMask) { if (abs(ix-event_->xbutton.x)>abs(iy-event_->xbutton.y)) { iy=event_->xbutton.y; } else ix=event_->xbutton.x; } if (ix!=x||iy!=y) { XDrawRectangle(display(),window(),windowGC(),x-xoffset-1,y-yoffset-1,w,h); XDrawRectangle(display(),window(),windowGC(),ix-xoffset-1,iy-yoffset-1,w,h); } } y=iy; x=ix; } XDrawRectangle(display(),window(),windowGC(),x-xoffset-1,y-yoffset-1,w,h); if ((ix-xoffset)!=xStart||(iy-yoffset)!=yStart) { if (copyMode==MSTrue) { MSStringVector aStringVector; unsigned lines=trace->traceSet()->textLength(); MSString formatBuffer; for (int j=0;jtraceSet()->formatText(formatBuffer.removeAll(),j); editor()->stringVector(aStringVector); MSTraceSet *ts=trace->traceSet(); interactivePixel()(0,0)=ix-xoffset; interactivePixel()(0,1)=iy-yoffset; if (activateCallback(MSWidgetCallback::copytexttrace)!=MSTrue) { interactiveData().reshape(1,2); interactiveData()(0,0)=normalizedPixelToValue(ix-xoffset,trace->xAxis()); interactiveData()(0,1)=yPixelToValue(iy-yoffset,trace->yAxis()); createTextTraceSet(interactiveData(),aStringVector); } editor()->string(""); } else { double x_val=normalizedPixelToValue(ix-xoffset,trace->xAxis()); double y_val=yPixelToValue(iy-yoffset,trace->yAxis()); if(orientation()==Horizontal) { trace->traceSet()->validate(0,trace->virtualCol(),y_val,x_val); } else { trace->traceSet()->validate(0,trace->virtualCol(),x_val,y_val); } redrawImmediately(); } } } void MSGraph::deleteTrace(void) { if (selectTrace()!=0) { int count=traceList().count(); if (activateCallback(MSWidgetCallback::deletetrace)!=MSTrue) { MSTraceSet *ts=selectTrace()->traceSet(); if (ts!=0) safeDestroy(ts); } if (traceList().count()xbutton.x; int by=event_->xbutton.y; int x_init=trace->xOffset(); int y_init=trace->yOffset(); if (event_->xbutton.button==1) mask=Button1Mask; else if (event_->xbutton.button==2) mask=Button2Mask; else mask=Button3Mask; keys=mask; selectInput(MSGraphEventMask); int x=bx+x_init; int y=by+y_init; trace->xOffset(0); trace->yOffset(0); drawMoveTrace(trace); while (keys&mask) { if (keys&ShiftMask) copyMode=MSTrue; else copyMode=MSFalse; XQueryPointer(display(),window(),&root,&child,&rx,&ry,&ix,&iy,&keys); ix=ix<(x_org()+offset)?x_org()+offset:ix; ix=ix>(x_end()-offset)?x_end()-offset:ix; ix+=x_init; iy+=y_init; if (ix!=x||iy!=y) { trace->xOffset(x-bx); trace->yOffset(y-by); drawMoveTrace(trace); trace->xOffset(ix-bx); trace->yOffset(iy-by); drawMoveTrace(trace); } x=ix; y=iy; } trace->xOffset(0); trace->yOffset(0); trace->traceSet()->xOffset((x-bx)/xScale(trace->xAxis())); trace->traceSet()->yOffset((y-by)/yScale(trace->yAxis())); if (copyMode==MSTrue) { freeze(); copyTrace(trace); unHighlightTrace(); unfreeze(); } else if ((abs(x-bx)>0||abs(y-by)>0)) { freeze(); if (moveTraceValidate(trace)!=MSTrue) { MSTraceSet *ts=trace->traceSet(); ts->yOffset(0); ts->xOffset(0); } unfreeze(); drawLineHandles(trace); } else { drawMoveTrace(trace); // drawLineHandles(trace); } selectInput(MSGraphEventMask|PointerMotionMask); } const MSString& MSGraph::interactiveTag(void) const { static unsigned long count=0; unsigned long len=_interactiveTraceTags.length(); if (len>0) { if (len<=count) count=0; return _interactiveTraceTags.elementAt(count++); } else { return _defaultTraceTag; } } void MSGraph::copyTrace(MSTrace* trace_) { MSTraceSet *ts=trace_->traceSet(); if (hasCallback(MSWidgetCallback::copytrace)==MSTrue) { interactiveData()=ts->asFloatMatrix(); if(interactiveData().columns()==1) // vector { interactiveData()-=ts->yOffset(); } else // real matrix { MSFloatVector fv(interactiveData().columnAt(0)); interactiveData()-=ts->yOffset(); fv+=ts->xOffset(); interactiveData().assignColumn(0,fv); } activateCallback(MSWidgetCallback::copytrace); } else { MSString tag=interactiveTag(); MSTraceSet *newTs = ts->copyTraceValidate(this,tag,MSSymbol(tag)); if (newTs!=0) { newTs->moveTraceValidate(ts->xOffset(),ts->yOffset()); newTs->selectable(MSTrue); newTs->constraint(MSNone); } } } MSBoolean MSGraph::moveTraceValidate(MSTrace* trace_) { MSTraceSet *ts=trace_->traceSet(); return ts->moveTraceValidate(ts->xOffset(),ts->yOffset()); } void MSGraph::highlightPoint(MSTraceSet *tp_) { int index=tp_->selectRow(); MSTrace *trace=tp_->trace(tp_->selectCol()); int x=xValueToPixel(xValue(trace,index),trace->xAxis()); int y=yValueToPixel(trace->y(index),trace->yAxis()); if (trace->symbol()==MSG::Text) { XSetFont(display(),legend()->gc(),trace->font()); } drawLegendScatterSymbols(window(),windowGC(),trace,x,y); } void MSGraph::highlightTrace(void) { MSTrace *trace=selectTrace(); if (trace!=0&&trace->traceSet()->textLength()>0&&trace->dataCount()==1) { XSetFont(display(),traceGC(),trace->traceSet()->textFont()); XFontStruct *fontInfo=(XFontStruct*)server()->fontStruct(trace->traceSet()->textFont()); int x=xValueToPixel(xValue(trace,0),trace->xAxis()); int y=yValueToPixel(yValue(trace,0),trace->yAxis()); MSStringVector aStringVector; unsigned lines=trace->traceSet()->textLength(); MSString formatBuffer; int j; for (j=0;jtraceSet()->formatText(formatBuffer.removeAll(),j); int h=aStringVector.length()*(fontInfo->ascent+fontInfo->descent); int w=maxStringWidth(fontInfo,aStringVector); XSetForeground(display(),traceGC(),trace->traceSet()->textForeground()); XFillRectangle(display(),window(),traceGC(),x,y,w,h); XSetForeground(display(),traceGC(),MSWidget::background()); y+=fontInfo->ascent; for (j=0;jascent+fontInfo->descent; } } else if (trace!=0&&trace->dataCount()>0) { graphUIModeSet(MoveTrace); XDefineCursor(display(),window(),drawCursor()); } } void MSGraph::unHighlightTrace(void) { selectTrace(0); graphUIModeSet(Normal); XSetForeground(display(),windowGC(),MSWidgetCommon::foreground()^background()); redrawImmediately(); } void MSGraph::scanXY(const XEvent *event_) { int i; int offset=1; unsigned int keys,mask; int lastAxis,axis=0; int ix,iy; int rx,ry; Window root,child; MSRect r; MSBoolean update,bs,legendMapped=MSFalse; unsigned long style=legendStyle(); if ((bs=backingStore())==MSFalse) { redrawImmediately(); r.x(dataWin()->x_origin()); r.y(dataWin()->y_origin()); } int *lastIndex=new int[traceList().count()]; for (i=0; ixbutton.x,y=event_->xbutton.y; if (event_->xbutton.button==1) mask=Button1Mask; else if (event_->xbutton.button==2) mask=Button2Mask; else mask=Button3Mask; keys=mask; if (cursorType()==Xcursor&&traceList().count()>0&&!(graphMode()&PieChart)&&pieCount()==0) { if (legendAlignment()==MSNone) { legendMapped=MSTrue; legendAlignment(MSTop); } legend()->valueWidth(XTextWidth(legend()->fontInfo(),"0",1)*yStringWidth()+legend()->spacing()/2); legend()->redraw(); dataWin()->setDataWin(xStringWidth(),0); drawScanXYvalueBox(x,y); drawScanXvalues(x,y,axis,lastIndex); } else if (cursorType()==XYcursor) { dataWin()->setDataWin(xStringWidth(),yStringWidth()); drawScanXYvalueBox(x,y); drawScanXYvalues(xPixelToValue(x,axis),yPixelToValue(y,axis),axis,axis); } else { delete [] lastIndex; return; } if (bs==MSFalse) { r.width(dataWin()->width()); r.height(dataWin()->height()); XCopyArea(display(),graphPixmap(),window(),clearGC(),r.x(),r.y(),r.width(),r.height(),r.x(),r.y()); r.x(dataWin()->x_origin()); r.y(dataWin()->y_origin()); } if (cursorType()!=Xcursor) { y=y>(y_org()-offset)?y_org()-offset:y; y=y<(y_end()+offset)?y_end()+offset:y; XDrawLine(display(),window(),windowGC(),x_org(),y,x_end(),y); } if (cursorType()!=Ycursor) { x=x<(x_org()+offset)?x_org()+offset:x; x=x>(x_end()+offset)?x_end()+offset:x; XDrawLine(display(),window(),windowGC(),x,y_org(),x,y_end()); } while (keys&mask) { XQueryPointer(display(),window(),&root,&child,&rx,&ry,&ix,&iy,&keys); lastAxis=axis; axis=keys&Button3Mask?1:0; update=axis!=lastAxis?MSTrue:MSFalse; if(bs==MSFalse) server()->flush(); drawScanXYvalueBox(ix,iy); #if defined(MS_WINDOWS) if (iy!=y||ix!=x) { int ht=highlightThickness()+shadowThickness(); XCopyArea(display(),graphPixmap(),window(),clearGC(),ht,ht,width()-2*ht,height()-2*ht,ht,ht); if (cursorType()!=Xcursor) { y=y>(y_org()-offset)?y_org()-offset:y; y=y<(y_end()+offset)?y_end()+offset:y; XDrawLine(display(),window(),windowGC(),x_org(),y,x_end(),y); } if (cursorType()!=Ycursor) { x=x<(x_org()+offset)?x_org()+offset:x; x=x>(x_end()+offset)?x_end()+offset:x; XDrawLine(display(),window(),windowGC(),x,y_org(),x,y_end()); } update=MSTrue; } #else // The following no backingStore mode needs to fix the // case where the dataWin overlaps the x or y cursor if (bs==MSFalse&&(iy!=y||ix!=x)) { XCopyArea(display(),graphPixmap(),window(),clearGC(),r.x(),r.y(),r.width(),r.height(),r.x(),r.y()); r.x(dataWin()->x_origin()); r.y(dataWin()->y_origin()); } if (iy!=y&&cursorType()!=Xcursor) { iy=iy>(y_org()-offset)?y_org()-offset:iy; iy=iy<(y_end()+offset)?y_end()+offset:iy; if (iy!=y) { XDrawLine(display(),window(),windowGC(),x_org(),y,x_end(),y); XDrawLine(display(),window(),windowGC(),x_org(),iy,x_end(),iy); update=MSTrue; } } if (ix!=x&&cursorType()!=Ycursor) { ix=ix<(x_org()+offset)?x_org()+offset:ix; ix=ix>(x_end()+offset)?x_end()+offset:ix; if (ix!=x) { XDrawLine(display(),window(),windowGC(),x,y_org(),x,y_end()); XDrawLine(display(),window(),windowGC(),ix,y_org(),ix,y_end()); update=MSTrue; } } #endif y=iy; x=ix; if (update==MSTrue) { if (cursorType()==Xcursor) drawScanXvalues(ix,iy,axis,lastIndex); else if (cursorType()==XYcursor) drawScanXYvalues(xPixelToValue(ix,axis),yPixelToValue(iy,axis),axis,axis); } } if (cursorType()!=Xcursor) XDrawLine(display(),window(),windowGC(),x_org(),y,x_end(),y); if (cursorType()!=Ycursor) XDrawLine(display(),window(),windowGC(),x,y_org(),x,y_end()); dataWin()->lower(); dataWin()->unmap(); dataWin()->MSWidget::clear(); _legendStyle=style; if (cursorType()==Xcursor) { if (legendStyle()!=LastValue) legend()->valueWidth(0); legend()->redraw(); } if (legendMapped==MSTrue) legendAlignment(MSNone); XEvent ev; while(XCheckWindowEvent(display(),window(),ButtonPressMask,&ev)); delete [] lastIndex; } void MSGraphStatusWin::setDataWin(int x_width_,int y_width_) { int charWidth=XTextWidth(fontInfo(),"0",1); highlightColor(graph()->foreground()); background(graph()->background()); leading(0); if (graph()->xLabelOut(0).format()==MSTime::MonthDayYear) { valueWidth((x_width_+y_width_)*charWidth+spacing()); width(valueWidth()+2*(insideMargin()+offset())); x1((valueWidth()-charWidth*(8+y_width_))/2); x2(x1()+charWidth*8+spacing()); height(2*(textHeight()+insideMargin())); } else { valueWidth((x_width_+y_width_)*charWidth+spacing()); width(valueWidth()+2*(insideMargin()+offset())); x1((valueWidth()-charWidth*(x_width_+y_width_)+spacing())/2); x2(x1()+charWidth*x_width_+spacing()); height(textHeight()+2*insideMargin()); } raise(); map(); drawHighlight(); } void MSGraph::drawScanXvalues(int x_,int,int axis_,int *lastIndex) { int i,j,xs,ys,index,minIndex,lastRow; double xx,delta; MSString formatBuffer; MSTrace *trace,*minTrace=0; MSBoolean setX=MSFalse,updateX=MSFalse; if (legend()->mapped()!=MSTrue) return; int x=legend()->xOffset(); int y=legend()->insideMargin()+2; for (i=0; ixAxis(); ys=trace->yAxis(); if(trace->style()!=MSG::Text&&trace->dataCount()>1&&trace->legend()>0) { if (setX==MSFalse) { setX=MSTrue; delta=trace->traceSet()->xDelta(); } xx=xPixelToValue(x_,xs); if (lastIndex==0||(index=findYvalue(trace,xx))>=0) { if (lastIndex!=0) { if (trace->traceSet()->xDelta()<=delta) { delta=trace->traceSet()->xDelta(); minTrace=trace; minIndex=index; } updateX=MSTrue; } else index=trace->dataCount()-1; if (trace->style()>=Candle) { lastRow=trace->style()==HL?2:trace->style()==HLC?3:4; int offset=(trace->style()==HL||trace->style()==HLC)?trace->offset():0; for (j=offset; jtextHeight()+legend()->leading(); if (lastIndex==0||index!=lastIndex[i]) { formatAxisLabel(formatBuffer.removeAll(),yLabelOut(ys),trace->y(index,j),yShowPos()); XFillRectangle(display(),legend()->window(), legend()->backgroundShadowGC(), x,y, legend()->valueWidth()-legend()->offset(), legend()->textHeight() ); XDrawString(display(),legend()->window(), legend()->gc(),legend()->fontInfo(), x,y+legend()->fontInfo()->ascent, formatBuffer,formatBuffer.length()); } } } else if (trace->style()!=0&&(lastIndex==0||index!=lastIndex[i])) { formatAxisLabel(formatBuffer.removeAll(),yLabelOut(ys),trace->y(index),yShowPos()); XFillRectangle(display(),legend()->window(), legend()->backgroundShadowGC(), x,y, legend()->valueWidth()-legend()->offset(), legend()->textHeight() ); XDrawString(display(),legend()->window(), legend()->gc(),legend()->fontInfo(), x,y+legend()->fontInfo()->ascent, formatBuffer,formatBuffer.length()); } } else { if (index==-1) { if (trace->style()>=Candle) { for (int j=0; j<4; j++) { if (trace->style()==HLC&&j==2) continue; y+=legend()->textHeight()+legend()->leading(); XFillRectangle(display(),legend()->window(), legend()->backgroundShadowGC(), x,y, legend()->valueWidth()-legend()->offset(), legend()->textHeight() ); } } else { XFillRectangle(display(),legend()->window(), legend()->backgroundShadowGC(), x,y, legend()->valueWidth()-legend()->offset(), legend()->textHeight() ); } } } if (trace->style()!=0) y+=legend()->textHeight()+legend()->leading(); if (lastIndex!=0) lastIndex[i]=index; } } } xx=normalizedPixelToValue(x_,axis_); xx=minTrace!=0&&axis_==xs?minTrace->x(minIndex):xx; if (lastIndex!=0&&xLabelOut(xs).format()==MSTime::MonthDayYear&&updateX==MSTrue) { formatAxisLabel(formatBuffer.removeAll(),xLabelOut(xs),xx); y=dataWin()->insideMargin()+dataWin()->fontInfo()->ascent; x=(dataWin()->width()-XTextWidth(dataWin()->fontInfo(),formatBuffer,formatBuffer.length()))/2; XFillRectangle(display(),dataWin()->window(), dataWin()->backgroundShadowGC(), dataWin()->offset(),dataWin()->offset(), dataWin()->width()-2*dataWin()->offset(), dataWin()->height()-2*dataWin()->offset() ); XDrawString(display(),dataWin()->window(),dataWin()->gc(),dataWin()->fontInfo(), x,y,formatBuffer,formatBuffer.length()); formatTimeLabel(formatBuffer.removeAll(),xx); x=(dataWin()->width()-XTextWidth(dataWin()->fontInfo(),formatBuffer,formatBuffer.length()))/2; y+=dataWin()->textHeight()+dataWin()->leading(); XDrawString(display(),dataWin()->window(),dataWin()->gc(),dataWin()->fontInfo(),x,y, formatBuffer,(formatBuffer.length()<_xStringWidth)?formatBuffer.length():_xStringWidth); } else if (updateX==MSTrue||index==-1) { formatAxisLabel(formatBuffer.removeAll(),xLabelOut(axis_),xx,xShowPos()); y=dataWin()->insideMargin()+dataWin()->fontInfo()->ascent; XFillRectangle(display(),dataWin()->window(), dataWin()->backgroundShadowGC(), dataWin()->offset(),dataWin()->offset(), dataWin()->width()-2*dataWin()->offset(), dataWin()->height()-2*dataWin()->offset() ); XDrawString(display(),dataWin()->window(), dataWin()->gc(),dataWin()->fontInfo(),dataWin()->x1(),y, formatBuffer,(formatBuffer.length()<_xStringWidth)?formatBuffer.length():_xStringWidth); } } void MSGraph::drawScanXYvalues(double x_,double y_,int xs_,int ys_) { int x,y; MSString formatBuffer; if (xLabelOut(xs_).format()==MSTime::MonthDayYear) { XFillRectangle(display(),dataWin()->window(), dataWin()->backgroundShadowGC(), dataWin()->offset(), dataWin()->offset(), dataWin()->width()-2*dataWin()->offset(), dataWin()->height()-2*dataWin()->offset() ); formatAxisLabel(formatBuffer.removeAll(),xLabelOut(xs_),x_); y=dataWin()->insideMargin()+dataWin()->fontInfo()->ascent; x=(dataWin()->width()-XTextWidth(dataWin()->fontInfo(),formatBuffer,formatBuffer.length()))/2; XDrawString(display(),dataWin()->window(), dataWin()->gc(),dataWin()->fontInfo(),x,y,formatBuffer,formatBuffer.length()); formatTimeLabel(formatBuffer.removeAll(),x_); y+=dataWin()->textHeight()+dataWin()->leading(); XDrawString(display(),dataWin()->window(), dataWin()->gc(),dataWin()->fontInfo(),dataWin()->x1(),y, formatBuffer,(formatBuffer.length()<_xStringWidth)?formatBuffer.length():_xStringWidth); formatAxisLabel(formatBuffer.removeAll(),yLabelOut(ys_),y_,yShowPos()); XDrawString(display(),dataWin()->window(), dataWin()->gc(),dataWin()->fontInfo(),dataWin()->x2(),y, formatBuffer,(formatBuffer.length()<_yStringWidth)?formatBuffer.length():_yStringWidth); } else { XFillRectangle(display(),dataWin()->window(), dataWin()->backgroundShadowGC(), dataWin()->offset(), dataWin()->offset(), dataWin()->width()-2*dataWin()->offset(), dataWin()->height()-2*dataWin()->offset() ); formatAxisLabel(formatBuffer.removeAll(),xLabelOut(xs_),x_,yShowPos()); y=dataWin()->insideMargin()+dataWin()->fontInfo()->ascent; XDrawString(display(),dataWin()->window(), dataWin()->gc(),dataWin()->fontInfo(),dataWin()->x1(),y, formatBuffer,(formatBuffer.length()<_xStringWidth)?formatBuffer.length():_xStringWidth); formatAxisLabel(formatBuffer.removeAll(),yLabelOut(ys_),y_,yShowPos()); XDrawString(display(),dataWin()->window(), dataWin()->gc(),dataWin()->fontInfo(),dataWin()->x2(),y, formatBuffer,(formatBuffer.length()<_yStringWidth)?formatBuffer.length():_yStringWidth); } } int MSGraph::findYvalue(MSTrace *trace_,double x_) { int i; if (trace_->traceSet()->overlap()==MSTrue) return -1; if (xValue(trace_,0)dataCount()-1)) { // ascending X values if (x_xShift()) return(-1); if (x_>xValue(trace_,trace_->dataCount()-1)) { if (x_<=xValue(trace_,trace_->dataCount()-1)+trace_->traceSet()->xDelta()) { return(trace_->dataCount()-1); } else return(-1); } if ((x_-xValue(trace_,0))<(xValue(trace_,trace_->dataCount()-1)-x_)) { for (i=0; x_>xValue(trace_,i)-trace_->xShift(); i++); return i==0?0:i-1; } else { for (i=trace_->dataCount()-1; x_xShift(); i--); return i; } } else { // descending X values if (x_>xValue(trace_,0)-trace_->xShift()||x_dataCount()-1)) { if (x_>xValue(trace_,0)+trace_->traceSet()->xDelta()) return (0); else return(-1); } if ((x_-xValue(trace_,trace_->dataCount()-1)<(trace_->x(0)-x_))) { for (i=trace_->dataCount()-1; x_>xValue(trace_,i)-trace_->xShift(); i--); return i+1; } else { for (i=0; x_xShift(); i++); return i; } } } MSBoolean MSGraph::drawZoomRegion(const XEvent *event_) { unsigned int keys,mask; MSBoolean moved=MSFalse; int x,y; int ix,iy; int rx,ry; Window root,child; if (graphMode()&PieChart||traceList().count()==pieCount()) return MSFalse; if (event_->xbutton.button==1) mask=Button1Mask; else if (event_->xbutton.button==2) mask=Button2Mask; else mask=Button3Mask; keys=mask; int bx=x=event_->xbutton.x; int by=y=event_->xbutton.y; XDrawRectangle(display(),window(),windowGC(),bx,by,0,0); while (keys&mask) { XQueryPointer(display(),window(),&root,&child,&rx,&ry,&ix,&iy,&keys); if (ix!=x||iy!=y) { if (x>bx) { if (y>by) XDrawRectangle(display(),window(),windowGC(),bx,by,x-bx,y-by); else XDrawRectangle(display(),window(),windowGC(),bx,y,x-bx,by-y); } else { if (y>by) XDrawRectangle(display(),window(),windowGC(),x,by,bx-x,y-by); else XDrawRectangle(display(),window(),windowGC(),x,y,bx-x,by-y); } x=ix; y=iy; if (x>bx) { if (y>by) XDrawRectangle(display(),window(),windowGC(),bx,by,x-bx,y-by); else XDrawRectangle(display(),window(),windowGC(),bx,y,x-bx,by-y); } else { if (y>by) XDrawRectangle(display(),window(),windowGC(),x,by,bx-x,y-by); else XDrawRectangle(display(),window(),windowGC(),x,y,bx-x,by-y); } } } if (x>bx) { if (y>by) XDrawRectangle(display(),window(),windowGC(),bx,by,x-bx,y-by); else XDrawRectangle(display(),window(),windowGC(),bx,y,x-bx,by-y); } else { if (y>by) XDrawRectangle(display(),window(),windowGC(),x,by,bx-x,y-by); else XDrawRectangle(display(),window(),windowGC(),x,y,bx-x,by-y); } if (abs(bx-x)>5&&abs(by-y)>5&&ixx?x:bx); xMaxZoom(bx>x?bx:x); yMinZoom(byxMinZoom()&&yMaxZoom()pointCount()==0||_onLinePoint==MSTrue) { if (event_->xbutton.button==1) mask=Button1Mask; else if (event_->xbutton.button==2) mask=Button2Mask; else mask=Button3Mask; keys=mask; if (nt(selectLine())->pointCount()==0) { bx=event_->xbutton.x; by=event_->xbutton.y; } else { bx=nt(selectLine())->points(selectPoint())->x; by=nt(selectLine())->points(selectPoint())->y; } XDrawLine(display(),window(),windowGC(),bx,by,bx,by); y=by; x=bx; while (keys&mask) { XQueryPointer(display(),window(),&root,&child,&rx,&ry,&ix,&iy,&keys); ix=ix<(x_org()+offset)?x_org()+offset:ix; ix=ix>(x_end()-offset)?x_end()-offset:ix; if (ix!=x||iy!=y) { XDrawLine(display(),window(),windowGC(),bx,by,x,y); XDrawLine(display(),window(),windowGC(),bx,by,ix,iy); } y=iy; x=ix; } if (abs(y-by)<5&&abs(x-bx)<5) { XDrawLine(display(),window(),windowGC(),bx,by,ix,iy); ret=MSFalse; } else if (nt(selectLine())->pointCount()==0) { nt(selectLine())->enterPoint(bx,by); nt(selectLine())->enterPoint(x,y); } else nt(selectLine())->enterPoint(x,y); } return ret; } void MSGraphNewtrace::enterPoint(int x_,int y_) { if (pointCount()>1&&graph()->selectPoint()==0) { for (int i=pointCount(); i>0; i--) { points(i)->x=points(i-1)->x; points(i)->y=points(i-1)->y; } points(0)->x=x_; points(0)->y=y_; _pointCount++; } else { points(pointCount())->x=x_; points(_pointCount++)->y=y_; } } void MSGraph::drawLineSegments(void) { if (graphUIMode()==AddTrace) { for (int j=0; jpointCount()-1; i++) { XDrawLine(display(),window(),windowGC(),nt(j)->points(i)->x, nt(j)->points(i)->y,nt(j)->points(i+1)->x, nt(j)->points(i+1)->y); } } } } void MSGraphNewtrace::drawLineSegments(int xOffset,int yOffset) { for (int i=0; idisplay(),graph()->window(),graph()->windowGC(), points(i)->x+xOffset,points(i)->y+yOffset, points(i+1)->x+xOffset,points(i+1)->y+yOffset); } } void MSGraph::drawLineHandles(int point_) { int count=0; int size=6; if (graphUIMode()==AddTrace) { int start=point_==-1?0:point_; int end=point_==-1?nt(focusLine())->pointCount():point_+1; XRectangle *rects=new XRectangle[nt(focusLine())->pointCount()]; for (int i=start; ipoints(i)->x-size/2; rects[count].y=nt(focusLine())->points(i)->y-size/2; rects[count].width=size; rects[count++].height=size; } XFillRectangles(display(),window(),windowGC(),rects,count); delete [] rects; } } void MSGraph::drawMoveLineHandleSymbols(int x_,int y_) { int ox,oy; if (selectPoint()!=0) { ox=nt(selectLine())->points(selectPoint()-1)->x; oy=nt(selectLine())->points(selectPoint()-1)->y; XDrawLine(display(),window(),windowGC(),ox,oy,x_,y_); } if (selectPoint()!=nt(selectLine())->pointCount()-1) { ox=nt(selectLine())->points(selectPoint()+1)->x; oy=nt(selectLine())->points(selectPoint()+1)->y; XDrawLine(display(),window(),windowGC(),ox,oy,x_,y_); } } void MSGraph::moveLineHandle(const XEvent *event_) { unsigned int keys,mask; int ix,iy; int rx,ry; int x,y; int offset=1; Window root,child; if (_onLinePoint==MSTrue) { if (event_->xbutton.button==1) mask=Button1Mask; else if (event_->xbutton.button==2) mask=Button2Mask; else mask=Button3Mask; keys=mask; int bx=event_->xbutton.x; int by=event_->xbutton.y; if (selectPoint()<0) return; bx=nt(selectLine())->points(selectPoint())->x; by=nt(selectLine())->points(selectPoint())->y; drawMoveLineHandleSymbols(bx,by); y=by; x=bx; while (keys&mask) { XQueryPointer(display(),window(),&root,&child,&rx,&ry,&ix,&iy,&keys); ix=ix<(x_org()+offset)?x_org()+offset:ix; ix=ix>(x_end()-offset)?x_end()-offset:ix; if (keys&ControlMask) { if (abs(ix-bx)>abs(iy-by)) iy=by; else ix=bx; } if (ix!=x||iy!=y) { drawMoveLineHandleSymbols(x,y); drawMoveLineHandleSymbols(ix,iy); } y=iy; x=ix; } drawLineHandles(); nt(selectLine())->points(selectPoint())->x=x; nt(selectLine())->points(selectPoint())->y=y; drawLineHandles(); drawMoveLineHandleSymbols(bx,by); } } MSBoolean MSGraph::moveLineSegment(const XEvent *event_,MSBoolean copy_) { unsigned int keys,mask; int ix,iy; int rx,ry; int x,y; int i,offset=1; Window root,child; if (_onLineSegment==MSTrue) { if (event_->xbutton.button==1) mask=Button1Mask; else if (event_->xbutton.button==2) mask=Button2Mask; else mask=Button3Mask; keys=mask; int bx=event_->xbutton.x; int by=event_->xbutton.y; nt(selectLine())->drawLineSegments(); y=by; x=bx; while (keys&mask) { XQueryPointer(display(),window(),&root,&child,&rx,&ry,&ix,&iy,&keys); ix=ix<(x_org()+offset)?x_org()+offset:ix; ix=ix>(x_end()-offset)?x_end()-offset:ix; if (ix!=x||iy!=y) { nt(selectLine())->drawLineSegments(x-bx,y-by); nt(selectLine())->drawLineSegments(ix-bx,iy-by); } y=iy; x=ix; } if (abs(y-by)<5&&abs(x-bx)<5) return MSFalse; drawLineHandles(); if (copy_==MSTrue) { _focusLine++; _selectLine++; _newtraceCt++; for (i=0; ipointCount(); i++) { nt(selectLine())->points(i)->x=nt(selectLine()-1)->points(i)->x+x-bx; nt(selectLine())->points(i)->y=nt(selectLine()-1)->points(i)->y+y-by; nt(selectLine())->pointCount(i+1); } } else { nt(selectLine())->drawLineSegments(); for (i=0; ipointCount(); i++) { nt(selectLine())->points(i)->x+=x-bx; nt(selectLine())->points(i)->y+=y-by; } drawLineHandles(); } } return MSTrue; } aplus-fsf-4.22/src/MSGUI/MSHGauge.C0000644000265000001440000001710610772770404012212 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include extern const int SliderAreaShadowThickness; MSHGauge::MSHGauge(MSWidget *owner_,const char *title_) : MSHScale(owner_,title_) { init(); } MSHGauge::MSHGauge(MSWidget *owner_,const MSStringVector& title_) : MSHScale(owner_,title_) { init(); } MSHGauge::MSHGauge(MSWidget *owner_,MSFloat& model_,const char *title_) : MSHScale(owner_,model_,title_) { init(); } MSHGauge::MSHGauge(MSWidget *owner_,MSFloat& model_,const MSStringVector& title_) : MSHScale(owner_,model_,title_) { init(); } MSHGauge::MSHGauge(MSWidget *owner_,MSInt& model_,const char *title_) : MSHScale(owner_,model_,title_) { init(); } MSHGauge::MSHGauge(MSWidget *owner_,MSInt& model_,const MSStringVector& title_) : MSHScale(owner_,model_,title_) { init(); } void MSHGauge::init(void) { acceptFocus(MSFalse); sensitive(MSFalse); _gaugeWidth=0; _startValue.unset(); } MSHGauge::~MSHGauge(void) {} void MSHGauge::redraw(void) { MSHScale::redraw(); drawGauge(); } void MSHGauge::drawSubWindows(void) { if (outputMode()map(); valueWin()->raise(); } else valueWin()->unmap(); valueWin()->moveTo(x_org(),y_org()-valueWin()->height()); } } void MSHGauge::update(const MSIndexVector&) { updateSliderSize(currentValue()); } void MSHGauge::sliderRedrawNotify(void) { drawGauge(); } void MSHGauge::updateSliderSize(double value_) { if (gaugeWidth()<=slider()->shadowThickness()||value_<=valueMin()||value_>=valueMax()) { drawSliderArea(); drawGauge(); } else updateGauge(value_); MSString buffer; valueWin()->updateValue(formatValue(buffer,value_)); } void MSHGauge::drawGauge(void) { if (mapped()==MSTrue) { int x=sliderAreaRect().x(); int y=sliderAreaRect().y()+SliderAreaShadowThickness; int curValue=valueToPixel(currentValue()); int startValue; if(_startValue.isSet()==MSTrue) { double sv=_startValue; if(svvalueMax()) sv=valueMax(); startValue=valueToPixel(sv); } else startValue=x+SliderAreaShadowThickness; Direction direction=curValue>startValue?Right:Left; int w=abs(startValue-curValue); //-slider()->offset(); int thickness=slider()->shadowThickness(); int startx=(direction==Right)?startValue:curValue; if (w>=thickness&&slider()->height()>thickness*2) { int width=w-(w>thickness*2?thickness*2:thickness); XBFillRectangle(display(),window(),slider()->backgroundShadowGC(), startx+thickness,y+thickness,width,slider()->height()-thickness*2); } if (w>thickness&&thickness>0) { drawGaugeShadow(startx,y,w,thickness,direction); } gaugeWidth(w); _direction=direction; } } void MSHGauge::drawGaugeShadow(int x,int y, int w, int thickness, Direction direction) { // top XBFillRectangle(display(),window(),slider()->topShadowGC(),x,y,w,thickness); int startx=direction==Right?x:x+w-thickness; // left or right XBFillRectangle(display(),window(),slider()->topShadowGC(),startx,y, w>thickness?thickness:w,slider()->height()); // bottom shadow if (w>thickness) { XPoint points[6]; points[0].x=points[5].x=direction==Right?x:x+w; points[4].x=points[3].x=direction==Right?x+w-thickness:x+thickness; points[1].x=points[2].x=direction==Right?x+w:x; points[0].y=points[1].y=y+slider()->height(); points[5].y=points[4].y=y+slider()->height()-thickness; points[3].y=y+thickness; points[2].y=y; XBFillPolygon(display(),window(),slider()->bottomShadowGC(),points,6,Nonconvex,CoordModeOrigin); } } void MSHGauge::updateGauge(double value_) { int x=sliderAreaRect().x(); int y=sliderAreaRect().y()+SliderAreaShadowThickness; int curValue=valueToPixel(value_); int startValue; if(_startValue.isSet()==MSTrue) { double sv=_startValue; if(svvalueMax()) sv=valueMax(); startValue=valueToPixel(sv); } else startValue=x+SliderAreaShadowThickness; Direction direction=curValue>startValue?Right:Left; int w=abs(startValue-curValue); //-slider()->offset(); int thickness=slider()->shadowThickness(); int width=abs(gaugeWidth()-w); int startx=startValue; XPoint points[7]; if (w==gaugeWidth() && direction==_direction) return; else if (direction==_direction) { if (wheight()); } else { // value is bigger, add area startx=direction==Right?startx+gaugeWidth()-thickness:startx-w+thickness; XFillRectangle(display(),window(),slider()->backgroundShadowGC(),startx,y,width,slider()->height()); } if (w>thickness&&thickness>0) updateGaugeShadow(startx,y,w,thickness,direction); } else { drawSliderArea(); drawGauge(); } gaugeWidth(w); _direction=direction; } void MSHGauge::updateGaugeShadow(int x,int y, int w, int thickness, Direction direction) { int width=abs(gaugeWidth()-w)+thickness; XPoint points[6]; if (wheight()-thickness; points[1].y=y+thickness; points[2].y=y; XBFillPolygon(display(),window(),slider()->bottomShadowGC(),points,4,Nonconvex,CoordModeOrigin); } else { // value is bigger XFillRectangle(display(),window(),slider()->topShadowGC(),x,y,width,thickness); points[0].x=points[5].x=direction==Right?x:x+width-thickness; points[4].x=points[3].x=direction==Right?x+width-thickness:x; points[1].x=points[2].x=direction==Right?x+width:x-thickness; points[0].y=points[1].y=y+slider()->height(); points[5].y=points[4].y=y+slider()->height()-thickness; points[3].y=y+thickness; points[2].y=y; XBFillPolygon(display(),window(),slider()->bottomShadowGC(),points,6,Nonconvex,CoordModeOrigin); } } // ######################################################### // default virtual methods - prevents gratuitous inlining // ######################################################### void MSHGauge::buttonPress(const XEvent *) {} void MSHGauge::keyPress(const XEvent *,KeySym,unsigned int,const char *) {} void MSHGauge::drawSliderEtch(void) {} void MSHGauge::computeLabelOffset(void) { labelOffset(0); } void MSHGauge::startValue(const MSFloat& value_ ) { _startValue=value_; drawSliderArea(); drawGauge(); } void MSHGauge::set(MSAttrValueList& avList_) { MSScale::set(avList_); for (unsigned i=0;i MSHLayout::MSHLayout(MSWidget *owner_,const char *title_) : MSLayout(owner_,title_) { init(); } MSHLayout::MSHLayout(MSWidget *owner_,const MSStringVector& title_) : MSLayout(owner_,title_) { init(); } MSHLayout::~MSHLayout(void) {} void MSHLayout::init(void) { _orientation=MSLayoutManager::Horizontal; } aplus-fsf-4.22/src/MSGUI/MSHPane.C0000644000265000001440000000132610772770404012042 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include static const int MSHPaneDefaultColumnSpacing=8; MSHPane::MSHPane(MSWidget *owner_,const char *title_) : MSPane(owner_,title_) { init(); } MSHPane::MSHPane(MSWidget *owner_,const MSStringVector& title_) : MSPane(owner_,title_) { init(); } void MSHPane::init(void) { _orientation=MSLayoutManager::Horizontal; _rowSpacing=0; _columnSpacing=MSHPaneDefaultColumnSpacing; } MSHPane::~MSHPane(void) {} aplus-fsf-4.22/src/MSGUI/MSHScale.C0000644000265000001440000003635210772770404012215 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include const int DefaultHSliderWidth =30; const int DefaultHSliderHeight =14; const int DefaultHScaleWidth =200; extern const int SliderAreaShadowThickness; MSHScale::HSlider::HSlider(MSWidget* owner_):MSScale::Slider(owner_) {} MSHScale::HSlider::~HSlider(void) {} void MSHScale::HSlider::drawSliderEtch(void) { if (mapped()==MSTrue) { XDrawLine(display(),window(),bottomShadowGC(),width()/2-1,1,width()/2-1,height()-2); XDrawLine(display(),window(),topShadowGC(),width()/2,1,width()/2,height()-2); } } void MSHScale::HSlider::moveTo(int x_,int y_) { MSWidget::moveTo(x_,y_); setValueWinXCoord(x_); } MSHScale::MSHScale(MSWidget *owner_,const char *title_) : MSScale(owner_,title_) { init(); } MSHScale::MSHScale(MSWidget *owner_,const MSStringVector& title_) : MSScale(owner_,title_) { init(); } MSHScale::MSHScale(MSWidget *owner_,MSFloat& model_,const char *title_) : MSScale(owner_,model_,title_) { init(); } MSHScale::MSHScale(MSWidget *owner_,MSFloat& model_,const MSStringVector& title_) : MSScale(owner_,model_,title_) { init(); } MSHScale::MSHScale(MSWidget *owner_,MSInt& model_,const char *title_) : MSScale(owner_,model_,title_) { init(); } MSHScale::MSHScale(MSWidget *owner_,MSInt& model_,const MSStringVector& title_) : MSScale(owner_,model_,title_) { init(); } void MSHScale::init(void) { _slider=new HSlider(this); _valueAlignment=(unsigned long)MSTop; _labelAlignment=(unsigned long)MSBottom; sliderWidth(DefaultHSliderWidth); sliderHeight(DefaultHSliderHeight); } MSHScale::~MSHScale(void) {} void MSHScale::computeSize(void) { int minh=0,maxh=0,y,w=0,hh=0,h=0; int labelHeight=0; XFontStruct *fontInfo; int offset=highlightThickness()+shadowThickness(); _titleWidth=_bottomOffset=_leftOffset=_rightOffset=_topOffset=offset; _mintitleWidth=_maxtitleWidth=0; if (mintitle().maxLength()>0) { fontInfo=(XFontStruct *)server()->fontStruct(mintitleFont()); _mintitleHeight=fontInfo->ascent+fontInfo->descent; _mintitleHeight*=mintitle().length(); minh=MSTop&mintitleAlignment()?mintitleHeight():MSBottom&mintitleAlignment()? mintitleHeight()>slider()->height()?(slider()->height()-mintitleHeight()/2):0:0; for (int i=0;imintitleWidth()?w:mintitleWidth()); } } if (maxtitle().maxLength()>0) { fontInfo=(XFontStruct *)server()->fontStruct(maxtitleFont()); _maxtitleHeight=fontInfo->ascent+fontInfo->descent; _maxtitleHeight*=maxtitle().length(); maxh=MSTop&maxtitleAlignment()?maxtitleHeight():MSBottom&maxtitleAlignment()? maxtitleHeight()>slider()->height()?(slider()->height()-maxtitleHeight()/2):0:0; for (int i=0;imaxtitleWidth()?w:maxtitleWidth()); } } y=minh>maxh?minh:maxh; if (title().maxLength()>0) { fontInfo=(XFontStruct *)server()->fontStruct(titleFont()); h=fontInfo->ascent+fontInfo->descent; h*=title().length(); for (int i=0;ititleWidth()?w:titleWidth()); } } if (subtitle().maxLength()>0) { fontInfo=(XFontStruct *)server()->fontStruct(subtitleFont()); hh=fontInfo->ascent+fontInfo->descent; hh*=subtitle().length(); for (int i=0;ititleWidth()?w:titleWidth()); } } h+=hh; titleHeight(h>y?h:y); h+=valueAlignment()==MSNone?0:valueWin()->textHeight()>y?valueWin()->textHeight():0; h+=slider()->height(); h+=slider()->offset(); if (labelAlignment()>MSNone) { fontInfo=(XFontStruct *)server()->fontStruct(labelFont()); labelHeight=fontInfo->ascent+fontInfo->descent; labelHeight+=majorTickSize()>minorTickSize()?majorTickSize():minorTickSize(); } h+=labelHeight; h+=2*offset; h+=2*SliderAreaShadowThickness; h+=MSBottom&mintitleAlignment()?mintitleHeight():MSCenter&mintitleAlignment()?0:(minh>0?minh:0); h+=MSBottom&maxtitleAlignment()?maxtitleHeight():MSCenter&maxtitleAlignment()?0:(maxh>0?maxh:0); naturalScaleSize(h); w=titleWidth()+2*(labelSpacing()+offset)+2*SliderAreaShadowThickness; resize(DefaultHScaleWidth>w?DefaultHScaleWidth:w,h); } void MSHScale::setSliderPosition(int x_) { int x=x_offset()?x_org()+slider()->offset(): x_>x_end()-slider()->width()-slider()->offset()? x_end()-slider()->width()-slider()->offset():x_; int y=y_org()+SliderAreaShadowThickness; if (x!=slider()->x_origin()||y!=slider()->y_origin()) slider()->moveTo(x,y); } void MSHScale::computeSliderAreaSize(void) { int offset=valueWin()->offset()>0?0:-valueWin()->offset(); if (labelAlignment()>MSNone) { XFontStruct *fontInfo=(XFontStruct *)server()->fontStruct(labelFont()); MSString buffer; formatLabel(buffer,valueMin()); int wmin=XTextWidth(fontInfo,buffer,buffer.length())/2; wmin=wmin>labelOffset()?wmin-labelOffset():0; formatLabel(buffer.removeAll(),valueMax()); int wmax=XTextWidth(fontInfo,buffer,buffer.length())/2; wmax=wmax>labelOffset()?wmax-labelOffset():0; int labelWidth=wmin>wmax?wmin:wmax; offset=labelWidth>offset?labelWidth:offset; } offset-=slider()->offset(); int h=slider()->height()+2*(slider()->offset()); int xoffset=offset>mintitleWidth()?offset:mintitleWidth(); int woffset=offset>maxtitleWidth()?offset:maxtitleWidth(); offset=highlightThickness()+shadowThickness(); sliderAreaRect().x(xoffset+offset+labelSpacing()+SliderAreaShadowThickness); sliderAreaRect().width(width()-xoffset-woffset-2*offset-2*labelSpacing()-2*SliderAreaShadowThickness); int ypos=offset; ypos+=MSBottom&valueAlignment()||valueAlignment()==MSNone?0:valueWin()->height(); ypos+=MSBottom&titleAlignment()?0:titleHeight(); if (height()>naturalScaleSize()) { int yy=(height()-h)/2; ypos=ypos>yy?ypos:yy; } sliderAreaRect().y(ypos+slider()->offset()); sliderAreaRect().height(h); valueWin()->y_org(MSBottom&valueAlignment()?y_end():y_org()-valueWin()->height()); } void MSHScale::computeTickInc(void) { int i,j; int size; double min_inc,r,tmpScale; XFontStruct *fi=(XFontStruct *)server()->fontStruct(labelFont()); int offset=labelOffset()==0?1:slider()->width(); int w=sliderAreaRect().width()-offset-slider()->offset(); double range=fabs(valueMax()-valueMin()); double inc,tempInc; MSBoolean evaluate=MSTrue; if (labelInc()<=0.0) { min_inc=outFmt().minimumNumber(*labelOut()); if (min_inc==0) min_inc=range/w; tmpScale=1/min_inc; MSString buffer; formatLabel(buffer,valueMin()); i=XTextWidth(fi,buffer,buffer.length()); formatLabel(buffer.removeAll(),valueMax()); j=XTextWidth(fi,buffer,buffer.length()); i=(i=j>i?j:(int)(i*1.5))!=0?i:100; inc=range*i/w; tempInc=outFmt().snapNumber(inc,*labelOut()); inc=tempInc; while(evaluate==MSTrue&&inc>0) { size=0; r=valueMin()-fmod(valueMin(),inc); while (r<=valueMin()) r+=inc; while (r<=valueMax()) { formatLabel(buffer.removeAll(),r); size=(i=XTextWidth(fi,buffer,buffer.length()))>size?i:size; r+=inc; } if (tmpScale*inc<1.5*size) { min_inc=inc; inc=outFmt().snapNumber((inc*1.001),*labelOut()); } else if (tmpScale*inc>3.*size) { r=outFmt().snipNumber((inc*.999),*labelOut()); if (r>min_inc) inc=r; else evaluate=MSFalse; } else evaluate=MSFalse; } incData(inc); } else incData(labelInc()); } void MSHScale::computeSliderScale(void) { int offset=labelOffset()==0?1:slider()->width(); int w=sliderAreaRect().width()-offset-2*slider()->offset(); base(valueMin()); scale(w/(valueMax()-valueMin())); scale((scale()>INT_MAX/2)?INT_MAX/2:scale()); } void MSHScale::drawSliderTitles(void) { int offset=highlightThickness()+shadowThickness(); int x,len,w,y,center=y_org()+slider()->height()/2; int labelHeight=0; GC gc=XCreateGC(display(),window(),0,0); if (mintitle().maxLength()>0) { if (labelAlignment()>MSNone) { XFontStruct *fontInfo=(XFontStruct *)server()->fontStruct(labelFont()); labelHeight=fontInfo->ascent+fontInfo->descent; labelHeight+=majorTickSize()>minorTickSize()?majorTickSize():minorTickSize(); } XFontStruct *fontInfo=(XFontStruct *)server()->fontStruct(mintitleFont()); XSetFont(display(),gc,mintitleFont()); XSetForeground(display(),gc,mintitleForeground()); y=MSTop&mintitleAlignment()?y_org()-mintitleHeight()-(MSTop&labelAlignment()?labelHeight:0): MSBottom&mintitleAlignment()?y_end()+(MSBottom&labelAlignment()?labelHeight:0): center-mintitleHeight()/2; y+=fontInfo->ascent; for (int i=0; iascent+fontInfo->descent; } } if (maxtitle().maxLength()!=0) { XFontStruct *fontInfo=(XFontStruct *)server()->fontStruct(maxtitleFont()); XSetFont(display(),gc,maxtitleFont()); XSetForeground(display(),gc,maxtitleForeground()); y=MSTop&maxtitleAlignment()?y_org()-maxtitleHeight():MSBottom&maxtitleAlignment()?y_end(): center-maxtitleHeight()/2; y+=fontInfo->ascent; for (int i=0; iascent+fontInfo->descent; } } XFreeGC(display(),gc); } void MSHScale::drawTickLabels(void) { if (labelAlignment()!=MSNone) { int majorTick=0,minorTick; int w; int x,yy,y=MSTop&labelAlignment()?y_org():y_end(); int ct=0,sign=MSTop&labelAlignment()?-1:1; int tickPositionLength; double r,s,inc; XSegment *segments; XFontStruct *fontInfo=(XFontStruct *)server()->fontStruct(labelFont()); MSString buffer; int bufSize; tickPositionLength=labelOut()->tickPositionLength(); if(tickPositionLength!=0) bufSize=tickPositionLength+10; else bufSize=(int)(10+(valueMax()-valueMin())/incData()*(1+minorTickCount())); XSetForeground(display(),gc(),labelForeground()); XSetFont(display(),gc(),labelFont()); segments=new XSegment[bufSize]; if(tickPositionLength!=0) { int gridWidthLength=labelOut()->gridWidthLength(); int labelLength=labelOut()->labelLength(); int tickSizeLength=labelOut()->tickSizeLength(); int tickSize; for (unsigned i=0;itickPosition(i)tickPosition(i)>valueMax()) continue; x=valueToPixel(labelOut()->tickPosition(i))+labelOffset(); tickSize=tickSizeLength==0?majorTickSize():int(majorTickSize()*labelOut()->tickSize(i)); if (tickSize>0&&ct0) { if (ilabel(buffer.removeAll(),i); } else { s=labelOut()->tickPosition(i); formatLabel(buffer.removeAll(),s); } if (buffer.length()>0) { w=XTextWidth(fontInfo,buffer,buffer.length()); x=MSRight&labelAlignment()?x-w:MSLeft&labelAlignment()?x:x-w/2; yy=y+((sign==1?fontInfo->ascent:fontInfo->descent)+majorTickSize())*sign; XDrawString(display(),window(),gc(),fontInfo,x,yy,buffer,buffer.length()); } } } else { if ((labelOut()->formatType()==MSFormat::Date|| labelOut()->formatType()==MSFormat::Time)&&valueMax()>0) { r=outFmt().snapTime(valueMin(),incData()); } else r=valueMin()-fmod(valueMin(),incData()); minorTick=minorTickCount()+1; inc=incData()/minorTick; while (r0) { segments[ct].x1=segments[ct].x2=x; segments[ct].y1=y-majorTickSize()*sign; segments[ct++].y2=y+majorTickSize()*sign; } s=(fabs(r)/inc<1.0)?0:r; formatLabel(buffer.removeAll(),s); if (buffer.length()!=0) { w=XTextWidth(fontInfo,buffer,buffer.length()); x=MSRight&labelAlignment()?x-w:MSLeft&labelAlignment()?x:x-w/2; yy=y+((sign==1?fontInfo->ascent:fontInfo->descent)+majorTickSize())*sign; XDrawString(display(),window(),gc(),fontInfo,x,yy,buffer,buffer.length()); } } else { if (minorTickSize()>0) { segments[ct].x1=segments[ct].x2=x; segments[ct].y1=y-minorTickSize()*sign; segments[ct++].y2=y+minorTickSize()*sign; } } r+=inc; majorTick++; } } XDrawSegments(display(),window(),gc(),segments,ct); delete [] segments; } } void MSHScale::moveSlider(const XEvent *event_) { int x=0; int ix,iy,rx,ry; int xoffset; unsigned int keys,mask=0; Window root,child; if (event_->xbutton.button==1) { mask=Button1Mask; xoffset=event_->xbutton.x; x=slider()->x_origin()+xoffset; } else if (event_->xbutton.button==2) { setSliderPosition(event_->xbutton.x); mask=Button2Mask; xoffset=slider()->width()/2; } keys=mask; while (keys&mask) { XQueryPointer(display(),window(),&root,&child,&rx,&ry,&ix,&iy,&keys); if (ix!=x) { setSliderPosition(ix-xoffset); setValue(pixelToValue(ix-xoffset)); } x=ix; } } // ######################################################### // default virtual methods - prevents gratuitous inlining // ######################################################### void MSHScale::computeLabelOffset(void) { labelOffset(slider()->width()/2-1); } double MSHScale::pixelToValue(int x_) { return (x_-x_org()-slider()->offset())/scale()+base(); } int MSHScale::valueToPixel(double x_) { return (int)((x_-base())*scale())+x_org()+slider()->offset(); } int MSHScale::incFactor(int x_,int) { return x_>slider()->x_origin()?1:-1; } int MSHScale::sliderSize(void) const { return slider()->height(); } void MSHScale::sliderSize(int x_) {slider()->height(x_);} void MSHScale::drawSliderEtch(void) {slider()->drawSliderEtch();} aplus-fsf-4.22/src/MSGUI/MSHScrollBar.C0000644000265000001440000005101210772770404013037 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include static const int DefaultScrollBarWidth=100; //static const int MinHSBWidth=39; static const int MinimumMotifSliderWidth=4; static const int DefaultElevatorBoxWidth=15; static const int DefaultElevatorWidth=49; static const int MinElevatorWidth=33; static const int MSHScrollBarMinPropLength=3; static const int MSHScrollBarDefaultArrowWidth=9; static const int MSHScrollBarDefaultArrowOffset=3; static const int MSHScrollBarDefaultMarkerWidth=6; static const int MSHScrollBarDefaultMarkerGap=2; static const int MSHScrollBarDefaultCableWidth=3; static const int MSHScrollBarSmallThickness=17; MSHScrollBar::HElevator::HElevator(MSHScrollBar *owner_) : MSScrollBar::Elevator(owner_) { _arrow1=new MSArrow(this,MSArrow::Left); _arrow2=new MSArrow(this,MSArrow::Right); } MSHScrollBar::HElevator::~HElevator(void) {} void MSHScrollBar::HElevator::configure(void) { if (scrollBar()->style()==MSScrollBar::Openlook) { if (_arrow1!=0&&_arrow2!=0) { int offset=highlightThickness()+shadowThickness(); int aw=MSHScrollBarDefaultArrowWidth; int ah=height()-2*offset; _arrow1->resize(aw,ah); _arrow2->resize(aw,ah); _arrow1->moveTo(offset+MSHScrollBarDefaultArrowOffset,offset); _arrow2->moveTo(width()-offset-_arrow2->width()-MSHScrollBarDefaultArrowOffset,offset); draw(); } } } void MSHScrollBar::HElevator::unselect(void) { if (mapped()==MSTrue&&owner()->mapped()==MSTrue&&owner()->owner()->mapped()==MSTrue) { if (scrollBar()->style()==MSScrollBar::Openlook) { if (width()==DefaultElevatorWidth) { int offset=highlightThickness()+shadowThickness(); int eh=height()-2*offset; int ew=DefaultElevatorBoxWidth-2; int x=offset+DefaultElevatorBoxWidth+1; int y=offset; XFillRectangle(display(),window(),backgroundShadowGC(),x,y,ew,eh); } } } } void MSHScrollBar::HElevator::select(void) { if (mapped()==MSTrue&&owner()->mapped()==MSTrue&&owner()->owner()->mapped()==MSTrue) { if (scrollBar()->style()==MSScrollBar::Openlook) { if (width()==DefaultElevatorWidth) { int offset=highlightThickness()+shadowThickness(); int eh=height()-2*offset; int ew=DefaultElevatorBoxWidth; int x=offset+DefaultElevatorBoxWidth; int y=offset; int w=ew>>1; int h=eh>>1; int xd=(ew-w)>>1; int yd=(eh-h)>>1; XFillArc(display(),window(),bottomShadowGC(),x+xd,y+yd,w,h,0,360*64); } } } } void MSHScrollBar::HElevator::draw(void) { if (mapped()==MSTrue&&owner()->mapped()==MSTrue&&owner()->owner()->mapped()==MSTrue) { int ht=highlightThickness(); int sht=shadowThickness(); int offset=ht+sht; int x=offset+DefaultElevatorBoxWidth; if (scrollBar()->style()==MSScrollBar::Openlook) { drawBackground(); drawShadow(MSRaised); if (width()==DefaultElevatorWidth) { XDrawLine(display(),window(),topShadowGC(),x,offset,x,height()-2*offset); x+=DefaultElevatorBoxWidth; XDrawLine(display(),window(),bottomShadowGC(),x,offset,x,height()-2*offset); drawArrows(); } else if (width()==MinElevatorWidth) { XDrawLine(display(),window(),bottomShadowGC(),x,offset,x,height()-2*offset); drawArrows(); } } else { drawRaised(); XFillRectangle(display(),window(),backgroundShadowGC(), offset,offset,width()-2*offset,height()-2*offset); drawArrows(); } } } MSHScrollBar::MSHScrollBar(MSWidget *owner_,int min_,int max_,int inc_) : MSScrollBar(owner_,min_,max_,inc_) { init(); } MSHScrollBar::~MSHScrollBar(void) {} void MSHScrollBar::init(void) { _elevator=new HElevator(this); resize(DefaultScrollBarWidth,MSHScrollBarSmallThickness+2*highlightThickness()); _elevator->map(); } void MSHScrollBar::adjustPointer(void) { if (style()==MSScrollBar::Openlook) { if (changeType()==Dec) { XWarpPointer(display(),None,_elevator->window(),0,0,0,0, DefaultElevatorBoxWidth>>1,_elevator->height()>>1); } else if (changeType()==Inc) { XWarpPointer(display(),None,_elevator->window(),0,0,0,0, _elevator->width()-(DefaultElevatorBoxWidth>>1), _elevator->height()>>1); } } } void MSHScrollBar::configureElevator(void) { if (style()!=MSScrollBar::Openlook&&_elevator!=0) { int offset=highlightThickness()+shadowThickness(); int arrowWidth=_elevator->_arrow1->width(); if (arrowWidth==0) arrowWidth=-1; arrowWidth+=(offset+1); double userSize=(max()-min()); double trueSize=sliderAreaRect().width(); double factor; factor=(userSize!=0)?trueSize/userSize:0; double slideSize=(double)(viewSize())*factor; int w=(int)(slideSize+0.5); _elevator->resize(w>MinimumMotifSliderWidth?w:MinimumMotifSliderWidth,height()-2*offset); } } void MSHScrollBar::configureForOpenlook(void) { _shadowThickness=1; if (_elevator!=0) { _elevator->shadowThickness(shadowThickness()); _elevator->_arrow1->owner(_elevator); _elevator->_arrow2->owner(_elevator); } int ht=highlightThickness(); int sht=shadowThickness(); int mw=MSHScrollBarDefaultMarkerWidth; int mg=MSHScrollBarDefaultMarkerGap; int ew=DefaultElevatorWidth; int w=width()-2*ht; if (w>=ew+2*(mw+mg)) { _markersOn=MSTrue; _elevatorOn=MSTrue; } else { ew=MinElevatorWidth; if (w>=ew+2*(mw+mg)) { _markersOn=MSTrue; _elevatorOn=MSTrue; } else if (w>=ew) { mw=0; mg=0; _markersOn=MSFalse; _elevatorOn=MSTrue; } else { mw=0; mg=0; _markersOn=MSFalse; _elevatorOn=MSFalse; } } sliderAreaRect().x(ht+mw+mg); sliderAreaRect().width(w-2*(mw+mg)); sliderAreaRect().y(ht); sliderAreaRect().height(height()-2*ht); double factor=0.0; if (max()-min()>0) { double userSize=(max()-min()); double trueSize=sliderAreaRect().width()-_elevator->width(); factor=trueSize/userSize; } double slideStart=(double)(value()-min())*factor; int xx=(int)(slideStart+0.5)+sliderAreaRect().x(); if (_elevator!=0) { _elevator->moveTo(boundsCheckX(xx),ht); _elevator->resize(ew,height()-2*ht); } } void MSHScrollBar::configureForMotif(void) { if (_elevator!=0) { _shadowThickness=2; _elevator->shadowThickness(shadowThickness()); _elevator->_arrow1->owner(this); _elevator->_arrow2->owner(this); const int MinScrollBarLength=6; int offset=shadowThickness()+highlightThickness(); int w,h; w=h=height()-2*offset; if (width()<2*(w+offset)+MinScrollBarLength+2) w=(width()-(MinScrollBarLength+2+2*offset))/2; sliderAreaRect().y(offset); sliderAreaRect().x(offset+w+1); sliderAreaRect().width(width()-2*(offset+w+1)); sliderAreaRect().height(height()-2*offset); _elevator->_arrow1->configure(offset,offset,w,h); _elevator->_arrow2->configure(offset+w+1+sliderAreaRect().width()+1,offset,w,h); int arrowWidth=_elevator->_arrow1->width(); if (arrowWidth==0) arrowWidth=-1; arrowWidth+=(offset+1); double userSize=(max()-min()); double trueSize=sliderAreaRect().width(); double factor=(userSize!=0)?trueSize/userSize:0; double slideStart=(double)(value()-min())*factor+arrowWidth; double slideSize=(double)(viewSize())*factor; int xx=(int)(slideStart+0.5); w=(int)(slideSize+0.5); _elevator->moveTo(boundsCheckX(xx),offset); _elevator->resize(w>MinimumMotifSliderWidth?w:MinimumMotifSliderWidth,height()-2*offset); redrawElevator(); } } void MSHScrollBar::motionLoop(void) { unsigned int mask=Button1Mask|Button2Mask; unsigned int keys=mask; int ix=0,iy=0; int rx=0,ry=0; int button_x; int button_y; int newX; int realX; int slideVal; Window root,child; freeze(); // prevent redraw from expose when elevator is moved. _elevator->select(); while (keys&mask) { XQueryPointer(display(),window(),&root,&child,&rx,&ry,&ix,&iy,&keys); button_y=iy; button_x=ix; // Force button_x and button_y to be within the slider_area. if (button_xsliderAreaRect().x()+sliderAreaRect().width()) button_x=sliderAreaRect().x()+sliderAreaRect().width(); if (button_ysliderAreaRect().y()+sliderAreaRect().height()) button_y=sliderAreaRect().y()+sliderAreaRect().height(); // Calculate the new origin of the slider. // Bound the values with the slider area. newX=realX=button_x-_separation_x; if (newXwidth()>sliderAreaRect().x()+sliderAreaRect().width()) newX=sliderAreaRect().x()+sliderAreaRect().width()-_elevator->width(); if (realX!=_initial_x) { slideVal=calcSliderValue(button_x,button_y); if (slideVal==value()) _changeType=NoChange; if (slideVal>=max()-viewSize()) { slideVal=max()-viewSize(); newX=calcXValue(slideVal); } int oldValue=value(); _value=slideVal; moveElevator(newX,_elevator->y()); _initial_x=_elevator->x(); if (oldValue!=_value) drag(); } } _elevator->unselect(); unfreeze(); } void MSHScrollBar::motifButton1Press(const XEvent *pXEvent_) { int xx=pXEvent_->xbutton.x; int yy=pXEvent_->xbutton.y; _savedValue=value(); _separation_x=0; _separation_y=0; _changeType=NoChange; // Calculate whether the selection point is in the slider if ((xx>=_elevator->x())&& (xx<=_elevator->x()+_elevator->width())&& (yy>=_elevator->y())&& (yy<=_elevator->y()+_elevator->height())) { _separation_x=xx-_elevator->x(); _separation_y=yy-_elevator->y(); _initial_x=_elevator->x(); _initial_y=_elevator->y(); _slidingOn=MSTrue; _changeType=Drag; motionLoop(); } // ... in arrow 1 else if ((xx>=_elevator->_arrow1->x())&& (yy>=_elevator->_arrow1->y())&& (xx<=_elevator->_arrow1->x()+_elevator->_arrow1->width())&& (yy<=_elevator->_arrow1->y()+_elevator->_arrow1->height())) { _changeType=Dec; _elevator->_arrow1->select(MSTrue); } // ... in arrow 2 else if ((xx>=_elevator->_arrow2->x())&& (yy>=_elevator->_arrow2->y())&& (xx<=_elevator->_arrow2->x()+_elevator->_arrow2->width())&& (yy<=_elevator->_arrow2->y()+_elevator->_arrow2->height())) { _changeType=Inc; _elevator->_arrow2->select(MSTrue); } // ... in the trough (i.e. slider area)... else if ((xx>=sliderAreaRect().x())&& (yy>=sliderAreaRect().y())&& (xx<=sliderAreaRect().x()+sliderAreaRect().width())&& (yy<=sliderAreaRect().y()+sliderAreaRect().height())) { // Page the slider up or down if (xx<_elevator->x()) _changeType=PageUp; else _changeType=PageDown; } else return; //... in the highlight area. startDelayTimer(); updateSliderValue(); } void MSHScrollBar::motifButton2Press(const XEvent *pXEvent_) { int xx=pXEvent_->xbutton.x; int yy=pXEvent_->xbutton.y; _savedValue=value(); _separation_x=0; _separation_y=0; _changeType=NoChange; // Calculate whether the selection point is in the slider if ((xx>=_elevator->x())&& (xx<=_elevator->x()+_elevator->width())&& (yy>=_elevator->y())&& (yy<=_elevator->y()+_elevator->height())) { _separation_x=xx-_elevator->x(); _separation_y=yy-_elevator->y(); _initial_x=_elevator->x(); _initial_y=_elevator->y(); _slidingOn=MSTrue; _changeType=Drag; } else if ((xx>=sliderAreaRect().x())&& (yy>=sliderAreaRect().y())&& (xx<=sliderAreaRect().x()+sliderAreaRect().width())&& (yy<=sliderAreaRect().y()+sliderAreaRect().height())) { // Warp the slider to the cursor, and then drag _separation_x=_elevator->width()/2; _initial_x=_elevator->x(); _initial_y=_elevator->y(); _slidingOn=MSTrue; _changeType=Drag; } motionLoop(); } void MSHScrollBar::openlookButton1Press(const XEvent *pXEvent_) { int ht=highlightThickness(); int xx=pXEvent_->xbutton.x; int yy=pXEvent_->xbutton.y; _savedValue=value(); _separation_x=0; _changeType=NoChange; // Calculate whether the selection point is in the slider if ((_elevator->width()==DefaultElevatorWidth)&& (xx>=_elevator->x()+DefaultElevatorBoxWidth)&& (xx<=_elevator->x()+_elevator->width()-DefaultElevatorBoxWidth)&& (yy>=_elevator->y())&& (yy<=_elevator->y()+_elevator->height())) { _separation_x=xx-_elevator->x(); _initial_x=_elevator->x(); _slidingOn=MSTrue; _changeType=Drag; _elevator->select(); motionLoop(); return; } // ... in arrow 1 else if ((yy>=_elevator->_arrow1->y())&& (xx>=_elevator->x())&& (yy<=_elevator->_arrow1->y()+_elevator->_arrow1->height())&& (xx<=_elevator->x()+DefaultElevatorBoxWidth)) { _changeType=Dec; _elevator->_arrow1->select(MSTrue); } // ... in arrow 2 else if ((yy>=_elevator->_arrow2->y())&& (xx>=_elevator->x()+_elevator->width()-DefaultElevatorBoxWidth)&& (yy<=_elevator->_arrow2->y()+_elevator->_arrow2->height())&& (xx<=_elevator->x()+_elevator->width())) { _changeType=Inc; _elevator->_arrow2->select(MSTrue); } // ... in top marker else if ((yy>=sliderAreaRect().y())&& (xx>=ht)&& (yy<=sliderAreaRect().y()+sliderAreaRect().height())&& (xx<=ht+MSHScrollBarDefaultMarkerWidth)) { _changeType=Home; } // ... in bottom marker else if ((yy>=sliderAreaRect().y())&& (xx>=width()-ht-MSHScrollBarDefaultMarkerWidth)&& (yy<=sliderAreaRect().y()+sliderAreaRect().height())&& (xx<=width()-ht)) { _changeType=End; } // ... in the trough (i.e. slider area)... else if ((xx>=sliderAreaRect().x())&& (yy>=sliderAreaRect().y())&& (xx<=sliderAreaRect().x()+sliderAreaRect().width())&& (yy<=sliderAreaRect().y()+sliderAreaRect().height ())) { /* Page the slider up or down */ if (xx<_elevator->x()+DefaultElevatorBoxWidth) _changeType=PageUp; else _changeType=PageDown; } else return; //... in the highlight area. startDelayTimer(); updateSliderValue(); } void MSHScrollBar::openlookButton2Press(const XEvent *pXEvent_) { int xx=pXEvent_->xbutton.x; int yy=pXEvent_->xbutton.y; _savedValue=value(); _separation_x=0; _changeType=NoChange; // Calculate whether the selection point is in the slider if ((_elevator->width()==DefaultElevatorWidth)&& (xx>=_elevator->x()+DefaultElevatorBoxWidth)&& (xx<=_elevator->x()+_elevator->width()-DefaultElevatorBoxWidth)&& (yy>=_elevator->y())&& (yy<=_elevator->y()+_elevator->height())) { _separation_x=xx-_elevator->x(); _initial_x=_elevator->x(); _slidingOn=MSTrue; _changeType=Drag; } // ... in the trough (i.e. slider area)... else if ((xx>=sliderAreaRect().x())&& (yy>=sliderAreaRect().y())&& (xx<=sliderAreaRect().x()+sliderAreaRect().width())&& (yy<=sliderAreaRect().y()+sliderAreaRect().height())) { // Warp the slider to the cursor,and then drag _separation_x=_elevator->width()/ 2; _initial_x=_elevator->x(); _slidingOn=MSTrue; _changeType=Drag; } motionLoop(); } int MSHScrollBar::boundsCheckX(int x_) { if (x_width()>sliderAreaRect().x()+sliderAreaRect().width()) { x_=sliderAreaRect().x()+sliderAreaRect().width()-_elevator->width(); } return x_; } int MSHScrollBar::calcSliderValue(int x_,int) { if (x_<=sliderAreaRect().x()) { return min(); } else if (x_>=sliderAreaRect().x()+sliderAreaRect().width()) { return max()-viewSize(); } else { double referencePoint=(double)x_-_separation_x; double userSize=max()-min(); double temp; if (style()==MSScrollBar::Openlook) { double trueSize=sliderAreaRect().width()-_elevator->width(); temp=referencePoint/trueSize; } else { int offset=highlightThickness()+shadowThickness(); double trueSize=sliderAreaRect().width(); int arrowSize=(_elevator->_arrow1!=0)?_elevator->_arrow1->width():0; temp=(referencePoint-arrowSize-offset)/trueSize; } temp=temp*userSize+min()+0.5; int intTemp=(int)temp; if (intTempmax()-viewSize()) intTemp=max()-viewSize(); return (intTemp); } } int MSHScrollBar::calcXValue(int value_) { double factor=0.0; double userSize=(max()-min()); int xx=0; if (style()==MSScrollBar::Openlook) { if (userSize>0) { double trueSize=sliderAreaRect().width()-_elevator->width(); factor=trueSize/userSize; } double slideStart=(double)(value_-min())*factor; xx=(int)(slideStart+0.5)+sliderAreaRect().x(); } else { int offset=shadowThickness()+highlightThickness(); int arrowWidth=_elevator->_arrow1->width(); if (arrowWidth==0) arrowWidth=-1; arrowWidth+=(offset+1); if (userSize>0) { double trueSize=sliderAreaRect().width(); factor=trueSize/userSize; } double slideStart=(double)(value_-min())*factor+arrowWidth; xx=(int)(slideStart+0.5); } return boundsCheckX(xx); } void MSHScrollBar::redrawElevator(void) { if (mapped()==MSTrue&&owner()->mapped()==MSTrue) { _elevator->moveTo(calcXValue(value()),_elevator->y()); if (style()==MSScrollBar::Openlook) { drawElevatorCable(); drawPropIndicator(); } else { drawElevator(); } } } void MSHScrollBar::moveElevator(int x_,int y_) { if (x_!=_elevator->x()) { _elevator->moveTo(x_,y_); drawElevatorCable(); drawPropIndicator(); } } void MSHScrollBar::drawElevatorCable(void) { if (mapped()==MSTrue&&owner()->mapped()==MSTrue) { if (style()==MSScrollBar::Openlook) { int y=((height()-MSHScrollBarDefaultCableWidth)>>1); int x=sliderAreaRect().x(); int w=sliderAreaRect().width(); XSetFillStyle(display(),bottomShadowGC(),FillTiled); XFillRectangle(display(),window(),bottomShadowGC(),x,y, w,MSHScrollBarDefaultCableWidth); XSetFillStyle(display(),bottomShadowGC(),FillSolid); } } } void MSHScrollBar::drawPropIndicator(void) { if (mapped()==MSTrue&&owner()->mapped()==MSTrue) { if (style()==MSScrollBar::Openlook) { XRectangle rect[2]; double factor=0.0; if (max()-min()>0) { double userSize=(max()-min()); double trueSize=sliderAreaRect().width()-_elevator->width(); factor=trueSize/userSize; } double propSize=(double)(viewSize())*factor; int propLength=(int)(propSize+0.5); int n=1; propLength= (propLength=(max()-min())) sensitive(MSFalse); else sensitive(MSTrue); int y=((height()-MSHScrollBarDefaultCableWidth) >> 1); int x=_elevator->x()+_elevator->width(); rect[0].y=rect[1].y=y; rect[0].height=rect[1].height=MSHScrollBarDefaultCableWidth; if (value()==max()-viewSize()) { rect[0].x=x; rect[0].width=sliderAreaRect().width()+sliderAreaRect().x()-x; } else { if (x+propLength>sliderAreaRect().x()+sliderAreaRect().width()) { if (_elevator->x()-propLength>sliderAreaRect().x()) { int w=sliderAreaRect().width()+sliderAreaRect().x()-x; if (w>0) { n=2; rect[1].x=_elevator->x()+_elevator->width(); rect[1].width=w; } rect[0].width=propLength-w; rect[0].x=_elevator->x()-rect[0].width; } else { rect[0].x=sliderAreaRect().x(); rect[0].width=sliderAreaRect().width(); } } else { rect[0].width=propLength; rect[0].x=x; } } XFillRectangles(display(),window(),bottomShadowGC(),&rect[0],n); } } } void MSHScrollBar::drawMarkers(void) { if (mapped()==MSTrue&&owner()->mapped()==MSTrue&&markersOn()==MSTrue) { if (style()==MSScrollBar::Openlook) { int ht=highlightThickness(); MSRect rect(ht,ht,MSHScrollBarDefaultMarkerWidth,_elevator->height()); drawBevel(rect,MSRaised,shadowThickness()); rect.x(width()-ht-MSHScrollBarDefaultMarkerWidth); drawBevel(rect,MSRaised,shadowThickness()); } } } aplus-fsf-4.22/src/MSGUI/MSHSeparator.C0000644000265000001440000000226510772770404013122 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include const int MSHSeparatorDefaultMarginWidth=0; const int MSHSeparatorDefaultMarginHeight=2; MSHSeparator::MSHSeparator(MSWidget *owner_) :MSSeparator(owner_) { _marginWidth=MSHSeparatorDefaultMarginWidth; _marginHeight=MSHSeparatorDefaultMarginHeight; resizeConstraints(At::MinimizeHeight|At::MaintainHeight); } void MSHSeparator::computeSize(void) { height((marginHeight()+shadowThickness()+highlightThickness()+thickness())*2); } void MSHSeparator::redraw(void) { if (frozen()==MSFalse&&mapped()==MSTrue) { int offset=highlightThickness()+shadowThickness(); int x=marginWidth()+offset; int y=marginHeight()+offset; int Width=width()-((marginWidth()+offset)<<1); XFillRectangle(display(),window(),bottomShadowGC(), x,y,Width,thickness()); XBFillRectangle(display(),window(),topShadowGC(), x,y+thickness(),Width,thickness()); } } aplus-fsf-4.22/src/MSGUI/MSIcon.C0000644000265000001440000002423310772770404011741 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include const int MSIconDefaultHighlightThickness=1; const int MSIconDefaultLabelSpacing=4; const int MSIconMinimumWidth=4; const int MSIconMinimumHeight=4; const unsigned long MSIconEventMask=(ExposureMask|ButtonPressMask); MSIcon::MSIcon(MSWidget *owner_,const char *label_,const MSPixmap &pixmap_, const MSPixmap &insensitivePixmap_) : MSLabel(owner_,label_) { init(pixmap_,insensitivePixmap_); } MSIcon::MSIcon(MSWidget *owner_,const MSStringVector& label_,const MSPixmap &pixmap_, const MSPixmap &insensitivePixmap_) : MSLabel(owner_,label_) { init(pixmap_,insensitivePixmap_); } MSIcon::MSIcon(MSWidget *owner_,MSStringVector& label_,const MSPixmap &pixmap_, const MSPixmap &insensitivePixmap_) : MSLabel(owner_,label_) { init(pixmap_,insensitivePixmap_); } MSIcon::MSIcon(MSWidget *owner_,const char *label_) : MSLabel(owner_,label_) { init(); } MSIcon::MSIcon(MSWidget *owner_,const MSStringVector& label_) : MSLabel(owner_,label_) { init(); } MSIcon::MSIcon(MSWidget *owner_,MSStringVector& label_) : MSLabel(owner_,label_) { init(); } MSIcon::MSIcon(MSWidget *owner_,const MSPixmap &pixmap_,const MSPixmap &insensitivePixmap_) : MSLabel(owner_) { init(pixmap_,insensitivePixmap_); } MSIcon::~MSIcon(void) {} void MSIcon::init(void) { _showPixmap=MSTrue; _showLabel=MSTrue; _labelAlignment=MSBottom; _labelSpacing=MSIconDefaultLabelSpacing; _highlightThickness=MSIconDefaultHighlightThickness; selectInput(MSIconEventMask); } void MSIcon::init(const MSPixmap &pixmap_,const MSPixmap &insensitivePixmap_) { init(); if (pixmap_.server()==server()) _pixmap=new MSPixmap(pixmap_); else { MSMessageLog::warningMessage("Warning : Pixmap supplied for MSIcon is invalid, using default"); createDefaultPixmap(pixmap_.width(),pixmap_.height(), pixmap_.foreground(),pixmap_.background()); } if (insensitivePixmap_.server()==server()) _insensitivePixmap=new MSPixmap(insensitivePixmap_); else { MSMessageLog::warningMessage("Warning : Insensitive Pixmap supplied for MSIcon is invalid, using default"); createDefaultInsensitivePixmap(insensitivePixmap_.width(), insensitivePixmap_.height(), insensitivePixmap_.foreground(), insensitivePixmap_.background()); } } void MSIcon::computeSize(void) { int oldW=width(); int oldH=height(); int offset=(highlightThickness()+shadowThickness()+margin())<<1; int pixmapW=pixmapWidth(); int pixmapH=pixmapHeight(); int labelW=labelWidth(); int labelH=labelHeight(); int labelSp=computeLabelSpacing(); int w,h; if (labelAlignment()==MSTop||labelAlignment()==MSBottom) { w=(pixmapW>labelW?pixmapW:labelW)+offset; h=pixmapH+labelH+offset+labelSp; } else { w=pixmapW+labelW+offset+labelSp; h=(pixmapH>labelH?pixmapH:labelH)+offset; } w=w>0?w:MSIconMinimumWidth; h=h>0?h:MSIconMinimumHeight; if(w==oldW&&h==oldH) redraw(); else resize(w,h); } void MSIcon::redraw(void) { if (mapped()==MSTrue&&frozen()==MSFalse) { drawBackground(); drawShadow(); if (showPixmap()==MSTrue) drawPixmap(); if (showLabel()==MSTrue) drawLabel(); if (highlighted()==MSTrue) drawHighlight(); else undrawHighlight(); } } int MSIcon::computePixmapYCoord(const MSPixmap *pixmap_) { int offset=highlightThickness()+shadowThickness()+margin(); int labelH=labelHeight(); int pixmapH=pixmap_->height(); int labelSp=computeLabelSpacing(); int r=0; if (alignment()&MSTop) { if (labelAlignment()==MSTop) r=offset+labelH+labelSp; else if (labelAlignment()==MSBottom) r=offset; else { if (labelHheight(); else pixmapH=insensitivePixmap()->height(); } return computeYCoordinate(row_,pixmapH); } int MSIcon::computeXCoord(int row_,int column_,const char *string_,int len_) { int pixmapW=0; // Checking if _pixmap is equal to zero is good enough because the existence of // _pixmap implies the existence of _insensitivePixmap if (showPixmap()==MSTrue&&pixmap()!=0) { if (sensitive()==MSTrue) pixmapW=pixmap()->width(); else pixmapW=insensitivePixmap()->width(); } return computeXCoordinate(row_,column_,pixmapW,string_,len_); } int MSIcon::computePixmapXCoord(const MSPixmap *pixmap_) { int offset=highlightThickness()+shadowThickness()+margin(); int labelW=labelWidth(); int pixmapW=pixmap_->width(); int labelSp=computeLabelSpacing(); int r=0; if (alignment()&MSLeft) { if (labelAlignment()==MSLeft) r=offset+labelW+labelSp; else if (labelAlignment()==MSRight) r=offset; else { if (labelW #include static const unsigned long MSIconButtonEventMask=(ExposureMask|ButtonPressMask| ButtonReleaseMask|Button1MotionMask); static const int MSIconButtonDefaultShadowThickness=2; static const int MSIconButtonDefaultHighlightThickness=1; static const char *MSIconButtonDefaultPixmap="LabelDefaultPixmap"; //Yes, LabelDefaultPixmap is correct MSIconButton::MSIconButton(MSWidget *owner_,const char *label_,const MSPixmap &pixmap_, const MSPixmap &insensitivePixmap_,const MSPixmap &armedPixmap_) : MSIcon(owner_,label_,pixmap_,insensitivePixmap_) { init(armedPixmap_); } MSIconButton::MSIconButton(MSWidget *owner_,const MSStringVector &label_,const MSPixmap &pixmap_, const MSPixmap &insensitivePixmap_,const MSPixmap &armedPixmap_) : MSIcon(owner_,label_,pixmap_,insensitivePixmap_) { init(armedPixmap_); } MSIconButton::MSIconButton(MSWidget *owner_,MSStringVector &label_,const MSPixmap &pixmap_, const MSPixmap &insensitivePixmap_,const MSPixmap &armedPixmap_) : MSIcon(owner_,label_,pixmap_,insensitivePixmap_) { init(armedPixmap_); } MSIconButton::MSIconButton(MSWidget *owner_,const char *label_) : MSIcon(owner_,label_) {init();} MSIconButton::MSIconButton(MSWidget *owner_,const MSStringVector& label_) : MSIcon(owner_,label_) { init(); } MSIconButton::MSIconButton(MSWidget *owner_,const MSPixmap &pixmap_, const MSPixmap &insensitivePixmap_,const MSPixmap &armedPixmap_) : MSIcon(owner_,pixmap_,insensitivePixmap_) { init(armedPixmap_); } MSIconButton::~MSIconButton(void) { if (armedPixmap()!=0) delete _armedPixmap; } void MSIconButton::init(void) { _armedPixmap=0; _highlightThickness=MSIconButtonDefaultHighlightThickness; _shadowThickness=MSIconButtonDefaultShadowThickness; _armed=MSFalse; shadowStyle(MSRaised); acceptFocus(MSTrue); selectInput(MSIconButtonEventMask); addToFocusList(); } void MSIconButton::init(const MSPixmap &armedPixmap_) { init(); if (armedPixmap_.server()==server()) _armedPixmap=new MSPixmap(armedPixmap_); else { MSMessageLog::warningMessage("Warning - Armed Pixmap supplied for MSIconButton is invalid, using default"); createDefaultArmedPixmap(armedPixmap_.width(),armedPixmap_.height(), armedPixmap_.foreground(),armedPixmap_.background()); } } void MSIconButton::createDefaultArmedPixmap(int w_,int h_,unsigned long fg_,unsigned long bg_) { _armedPixmap=new MSPixmap(server(),MSIconButtonDefaultPixmap,w_,h_,fg_,bg_); GC gc=XCreateGC(display(),window(),0,0); XSetForeground(display(),gc,bg_); XFillRectangle(display(),armedPixmap()->pixmap(),gc,0,0,w_,h_); XFreeGC(display(),gc); } void MSIconButton::armedPixmap(const MSPixmap &armedPixmap_) { MSPixmap *tmp=_armedPixmap; if (armedPixmap_.server()==server()) _armedPixmap=new MSPixmap(armedPixmap_); else { MSMessageLog::warningMessage("Warning - Armed Pixmap supplied for MSIconButton is invalid, using default"); createDefaultArmedPixmap(armedPixmap_.width(),armedPixmap_.height(), armedPixmap_.foreground(),armedPixmap_.background()); } if (tmp!=0) delete tmp; updatePixmap(); } void MSIconButton::redraw(void) { if (mapped()==MSTrue&&frozen()==MSFalse) { drawBackground(); if (showPixmap()==MSTrue) drawPixmap(); if (showLabel()==MSTrue) drawLabel(); (armed()==MSTrue)?drawSunken():drawRaised(); } } void MSIconButton::drawLabel(void) { if (mapped()==MSTrue) { if (armed()==MSTrue) { if (depth()==1) { XSetForeground(display(),textGC(),background()); XSetBackground(display(),textGC(),foreground()); MSIcon::drawLabel(); } else { XSetBackground(display(),textGC(),selectShadowColor()); MSIcon::drawLabel(); } } else { XSetBackground(display(),textGC(),background()); MSIcon::drawLabel(); } } } void MSIconButton::drawPixmap(void) { if (mapped()==MSTrue) { const MSPixmap *pmap; if (armed()==MSTrue) pmap=armedPixmap(); else if (sensitive()==MSTrue) pmap=pixmap(); else pmap=insensitivePixmap(); if (pmap!=0) { int startx=computePixmapXCoord(pmap); int starty=computePixmapYCoord(pmap); GC gc=pixmapGC(); XSetForeground(display(),gc,foreground()); if (armed()==MSTrue) XSetBackground(display(),gc,selectShadowColor()); else XSetBackground(display(),gc,background()); copyPixmap(display(),*pmap,window(),gc,startx,starty); } } } void MSIconButton::drawBackground(void) { if (mapped()==MSTrue) { int ht=highlightThickness(); XFillRectangle(display(),window(), (armed()==MSTrue)?selectShadowGC():backgroundShadowGC(), ht,ht,width()-(ht<<1),height()-(ht<<1)); if (highlighted()==MSTrue) drawHighlight(); else undrawHighlight(); } } void MSIconButton::key(KeySym keysym_,unsigned int,const char *) { if (keysym_==XK_Return) { arm(); activate(); disarm(); } } void MSIconButton::keyPress(const XEvent *pEvent_,KeySym k_,unsigned int s_,const char *b_) { MSKeyPress keyPress(k_,s_); if (isProtected()==MSFalse&&keyTranslate(keyPress)==MSFalse) key(k_,s_,b_); } void MSIconButton::buttonPress(const XEvent *event_) { if (event_->xbutton.button==Button1) { if (isProtected()==MSFalse) { MSBoolean cont=MSTrue; if (acceptFocus()==MSTrue) cont=traverseFocus(this); if (cont==MSTrue) buttonPressNotify(this,event_); } } } void MSIconButton::buttonRelease(const XEvent *event_) { if (event_->xbutton.button==Button1) buttonReleaseNotify(this,event_); } void MSIconButton::button1Press(const XEvent *) { arm(); } void MSIconButton::button1Release(const XEvent *) { if (armed()==MSTrue) { activate(); disarm(); //Discard all button events before returning XEvent event; while (XCheckWindowEvent(display(),window(), ButtonPressMask|ButtonReleaseMask|Button1MotionMask, &event)); } } void MSIconButton::motionNotify(const XEvent *event_) { if (isProtected()==MSFalse && (acceptFocus()==MSFalse||inputFocus()==this)) { if (event_->xmotion.is_hint==NotifyNormal&&(event_->xmotion.state&Button1Mask)==Button1Mask) { if (event_->xmotion.x<0||event_->xmotion.x>width()|| event_->xmotion.y<0||event_->xmotion.y>height()) { disarm(); } else if (armed()==MSFalse) { if ((event_->xmotion.x>=0&&event_->xmotion.x<=width())&& (event_->xmotion.y>=0&&event_->xmotion.y<=height())) { arm(); } } } } } // default activate method void MSIconButton::activate(void) { activateCallback(MSWidgetCallback::activate); } void MSIconButton::arm(void) { if (armed()==MSFalse) { _armed=MSTrue; if (mapped()==MSTrue) { int offset=highlightThickness()+shadowThickness(); XFillRectangle(display(),window(),selectShadowGC(), offset,offset,width()-2*offset,height()-2*offset); if (showPixmap()==MSTrue) drawPixmap(); if (showLabel()==MSTrue) drawLabel(); drawSunken(); XFlush(display()); } } } void MSIconButton::disarm(void) { if (armed()==MSTrue) { _armed=MSFalse; if (mapped()==MSTrue) { int offset=highlightThickness()+shadowThickness(); XFillRectangle(display(),window(),backgroundShadowGC(), offset,offset,width()-2*offset,height()-2*offset); if (showPixmap()==MSTrue) drawPixmap(); if (showLabel()==MSTrue) drawLabel(); drawRaised(); XFlush(display()); } } } int MSIconButton::computeXCoord(int row_,int column_,const char *string_,int len_) { int pixmapW=0; // Checking if _pixmap is equal to zero is good enough because the existence of // _pixmap implies the existence of _insensitivePixmap and _armedPixmap if (showPixmap()==MSTrue&&pixmap()!=0) { if (armed()==MSTrue) pixmapW=armedPixmap()->width(); else if (sensitive()==MSTrue) pixmapW=pixmap()->width(); else pixmapW=insensitivePixmap()->width(); } return computeXCoordinate(row_,column_,pixmapW,string_,len_); } int MSIconButton::computeYCoord(int row_) { int pixmapH=0; // Checking if _pixmap is equal to zero is good enough because the existence of // _pixmap implies the existence of _insensitivePixmap and _armedPixmap if (showPixmap()==MSTrue&&pixmap()!=0) { if (armed()==MSTrue) pixmapH=armedPixmap()->width(); else if (sensitive()==MSTrue) pixmapH=pixmap()->height(); else pixmapH=insensitivePixmap()->height(); } return computeYCoordinate(row_,pixmapH); } void MSIconButton::updatePixmap(void) { if (pixmap()==0) { if (insensitivePixmap()!=0) _pixmap=new MSPixmap(*insensitivePixmap()); else if (armedPixmap()!=0) _pixmap=new MSPixmap(*armedPixmap()); } if (insensitivePixmap()==0) { if (pixmap()!=0) _insensitivePixmap=new MSPixmap(*pixmap()); else if (armedPixmap()!=0) _insensitivePixmap=new MSPixmap(*armedPixmap()); } if (armedPixmap()==0) { if (pixmap()!=0) _armedPixmap=new MSPixmap(*pixmap()); else if (insensitivePixmap()!=0) _armedPixmap=new MSPixmap(*insensitivePixmap()); } if (firstMap()==MSTrue) { if (dynamic()==MSTrue) computeSize(); else redraw(); } } aplus-fsf-4.22/src/MSGUI/MSIntArrayView.C0000644000265000001440000000366710772770405013446 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include MSIntArrayView::MSIntArrayView(MSWidget *owner_,const char *title_) : MSNumericArrayView(owner_,title_) {} MSIntArrayView::MSIntArrayView(MSWidget *owner_,const MSStringVector& title_) : MSNumericArrayView(owner_,title_) {} MSIntArrayView::MSIntArrayView(MSWidget *owner_,MSIntVector& model_,const char *title_) : MSNumericArrayView(owner_,title_) { model(model_); } MSIntArrayView::MSIntArrayView(MSWidget *owner_,MSIntVector& model_,const MSStringVector& title_) : MSNumericArrayView(owner_,title_) { model(model_); } MSIntArrayView::~MSIntArrayView(void) {} void MSIntArrayView::model(MSIntVector& model_) { couple(&model_); } void MSIntArrayView::model(const MSIntVector& model_) { constCouple(&model_); } void MSIntArrayView::array(const MSIntVector& aVector_) { if (MSView::model()!=0) array()=aVector_; } MSBoolean MSIntArrayView::validate(const char *pString_,unsigned row_,unsigned) { return (MSView::model()!=0)?((array().set(row_,pString_)==MSError::MSSuccess)?MSTrue:MSFalse):MSTrue; } const char *MSIntArrayView::formatOutput(MSString &buffer_,unsigned row_,unsigned) { if (MSView::model()!=0) formatValue(buffer_,array()(row_)); return buffer_.string(); } unsigned MSIntArrayView::numColumns(void) const { return 1; } unsigned MSIntArrayView::numRows(void) const { return (MSView::model()!=0)?array().length():0; } void MSIntArrayView::moveRow(int from_, int to_) { if(MSView::model()!=0) { MSIntVector& vectorModel = array(); int item = vectorModel(from_); vectorModel.removeAt(from_); if (to_>=vectorModel.length()) vectorModel.append(item); else vectorModel.insertAt(to_,item); } } aplus-fsf-4.22/src/MSGUI/MSIntCheckBox.C0000644000265000001440000000252610772770405013214 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include MSIntCheckBox::MSIntCheckBox(MSWidget *owner_,const char *title_) : MSModelCheckBox(owner_,title_) { internalCouple(new MSIntVector); } MSIntCheckBox::MSIntCheckBox(MSWidget *owner_,const MSStringVector& title_) : MSModelCheckBox(owner_,title_) { internalCouple(new MSIntVector); } MSIntCheckBox::MSIntCheckBox(MSWidget *owner_,MSIntVector &aIntVector_,const char *title_) : MSModelCheckBox(owner_,title_) { model(aIntVector_); } MSIntCheckBox::MSIntCheckBox(MSWidget *owner_,MSIntVector &aIntVector_,const MSStringVector& title_) : MSModelCheckBox(owner_,title_) { model(aIntVector_); } MSIntCheckBox::~MSIntCheckBox(void) {} void MSIntCheckBox::model(MSIntVector &aIntVector_) { couple(&aIntVector_); } void MSIntCheckBox::setModel(void) { if (MSView::model()!=0) { MSIntVector *myModel=(MSIntVector *)_model; *myModel=integerState(); } } void MSIntCheckBox::drawCurrentState(void) { if (MSView::model()!=0) { MSIntVector *pIntVector=(MSIntVector *)_model; integerState(*pIntVector); } } aplus-fsf-4.22/src/MSGUI/MSIntEntryField.C0000644000265000001440000000442710772770405013575 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #if defined(MSTK_MANUAL_INSTANTIATION) #include #if defined(MS_XLC_TEMPLATE_INSTANTIATION) #pragma define (MSTypeEntryField) #endif #if defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma instantiate MSTypeEntryField #endif #if defined(MS_STD_TEMPLATE_INSTANTIATION) template class MSTypeEntryField; #endif #if defined(MS_VC_TEMPLATE_INSTANTIATION) template MSTypeEntryField; #endif #endif // MSTK_MANUAL_INSTANTIATION MSIntEntryField::MSIntEntryField(MSWidget *owner_, const char *label_,const MSSymbol& tag_) : MSTypeEntryField(owner_,label_,tag_) { init(); } MSIntEntryField::MSIntEntryField(MSWidget *owner_,MSInt& model_, const char *label_,const MSSymbol& tag_) : MSTypeEntryField(owner_,model_,label_,tag_) { init(); } MSIntEntryField::~MSIntEntryField(void) {} void MSIntEntryField::init(void) { _format=MSFormat(MSInt::WithoutCommas); _incrementValue=1; _clipMode=MSClipIndicator; } void MSIntEntryField::increment(void) { if (MSView::model()!=0) { if (value() <= INT_MAX - incrementValue()) // prevent overflow { if (maximumValue().isSet()==MSTrue) { int anInt=value(); anInt+=(int)incrementValue(); if (anInt<=maximumValue()) { value()=anInt; valueChange(); } } else { value()+=incrementValue(); valueChange(); } } } } void MSIntEntryField::decrement(void) { if (MSView::model()!=0) { if (value() >= INT_MIN + incrementValue()) // prevent underflow { if (minimumValue().isSet()==MSTrue) { int anInt=value(); anInt-=(int)incrementValue(); if (anInt>=minimumValue()) { value()=anInt; valueChange(); } } else { value()-=incrementValue(); valueChange(); } } } } aplus-fsf-4.22/src/MSGUI/MSIntMatrixTraceSet.C0000644000265000001440000000577310772770405014434 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include MSIntMatrixTraceSet::MSIntMatrixTraceSet(MSGraph *owner_,const char *legends_,const MSSymbol& tag_): MSTraceSet(owner_,legends_,tag_) { format(MSFormat(MSInt::WithoutCommas)); } MSIntMatrixTraceSet::MSIntMatrixTraceSet(MSGraph *owner_,const MSStringVector& legends_,const MSSymbol& tag_): MSTraceSet(owner_,legends_,tag_) { format(MSFormat(MSInt::WithoutCommas)); } MSIntMatrixTraceSet::MSIntMatrixTraceSet(MSGraph *owner_,MSIntMatrix& m_,const char *legends_,const MSSymbol& tag_): MSTraceSet(owner_,legends_,tag_) { format(MSFormat(MSInt::WithoutCommas)); model(m_); } MSIntMatrixTraceSet::MSIntMatrixTraceSet(MSGraph *owner_,MSIntMatrix& m_,const MSStringVector& legends_,const MSSymbol& tag_): MSTraceSet(owner_,legends_,tag_) { format(MSFormat(MSInt::WithoutCommas)); model(m_); } MSIntMatrixTraceSet::~MSIntMatrixTraceSet(void) {} int MSIntMatrixTraceSet::dataCount(void) const { return MSView::model()!=0?matrix().rows():0; } double MSIntMatrixTraceSet::x(int i_) const { return MSView::model()!=0?matrix()(i_,0):0; } double MSIntMatrixTraceSet::y(int r_,int c_) const { return MSView::model()!=0?matrix()(r_,c_+1):0; } void MSIntMatrixTraceSet::model(MSIntMatrix& model_) { couple(&model_); } void MSIntMatrixTraceSet::model(const MSIntMatrix& model_) { constCouple(&model_); } int MSIntMatrixTraceSet::numColumns(void) const { return MSView::model()!=0?matrix().columns()>1?matrix().columns():0:0; } void MSIntMatrixTraceSet::validate(int r_,int c_,double x_,double y_) { if (MSView::model()!=0) { if (constraint()!=HoldX) matrix()(r_,0)=(int)x_; matrix()(r_,c_+1)=(int)y_; } } const char *MSIntMatrixTraceSet::formatOutput(MSString &buffer_,unsigned row_,unsigned col_) { if (MSView::model()!=0) { MSInt aInt(matrix()(row_,col_)); aInt.format(buffer_,format()); } return buffer_.string(); } MSBoolean MSIntMatrixTraceSet::moveTraceValidate(double xOffset_,double yOffset_) { if (MSView::model()!=0) { MSIntMatrix& fm=matrix(); MSIntVector fv(fm.columnAt(0)); fm-=(int)yOffset_; fv+=(int)xOffset_; fm.assignColumn(0,fv); return MSTrue; } return MSFalse; } MSTraceSet* MSIntMatrixTraceSet::copyTraceValidate(MSGraph * owner_,const char *legends_,const MSSymbol& tag_) { MSIntMatrix* model=(MSIntMatrix*)matrix().clone(); MSIntMatrixTraceSet* ts=new MSIntMatrixTraceSet(owner_,*model,legends_,tag_); ts->internalModel(MSTrue); return ts; } MSFloatMatrix MSIntMatrixTraceSet::asFloatMatrix(void) const { MSFloatMatrix fm(matrix().rows(),matrix().columns()); int n=matrix().count(); for(int i=0;i MSIntMatrixView::MSIntMatrixView(MSWidget *owner_,const char *title_) : MSNumericArrayView(owner_,title_) {} MSIntMatrixView::MSIntMatrixView(MSWidget *owner_,const MSStringVector& title_) : MSNumericArrayView(owner_,title_) {} MSIntMatrixView::MSIntMatrixView(MSWidget *owner_,MSIntMatrix& model_,const char *title_) : MSNumericArrayView(owner_,title_) { model(model_); } MSIntMatrixView::MSIntMatrixView(MSWidget *owner_,MSIntMatrix& model_,const MSStringVector& title_) : MSNumericArrayView(owner_,title_) { model(model_); } MSIntMatrixView::~MSIntMatrixView(void) {} void MSIntMatrixView::model(MSIntMatrix& model_) { couple(&model_); } void MSIntMatrixView::matrix(const MSIntMatrix& aMatrix_) { if (MSView::model()!=0) matrix()=aMatrix_; } MSBoolean MSIntMatrixView::validate(const char *pString_,unsigned row_,unsigned column_) { if (MSView::model()!=0) { unsigned ravelIndex=matrix().index(row_,column_); return (matrix().set(ravelIndex,pString_)==MSError::MSSuccess)?MSTrue:MSFalse; } return MSTrue; } const char *MSIntMatrixView::formatOutput(MSString &buffer_,unsigned row_,unsigned column_) { if (MSView::model()!=0) formatValue(buffer_,matrix()(row_,column_)); return buffer_.string(); } unsigned MSIntMatrixView::numColumns(void) const { return (MSView::model()!=0)?matrix().columns():0; } unsigned MSIntMatrixView::numRows(void) const { return (MSView::model()!=0)?matrix().rows():0; } void MSIntMatrixView::moveRow(int from_, int to_) { if(MSView::model()!=0) { MSIntMatrix& matrixModel = matrix(); MSIntVector vector = matrixModel.rowAt(from_); matrixModel.removeRow(from_); if (to_>=matrixModel.rows()) matrixModel.appendRow(vector); else matrixModel.insertRowBefore(to_,vector); } } aplus-fsf-4.22/src/MSGUI/MSIntRadioBox.C0000644000265000001440000000360110772770405013230 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include MSIntRadioBox::MSIntRadioBox(MSWidget *owner_,const char *title_): MSRadioBox(owner_,title_) { internalCouple(new MSInt); } MSIntRadioBox::MSIntRadioBox(MSWidget *owner_,const MSStringVector& title_): MSRadioBox(owner_,title_) { internalCouple(new MSInt); } MSIntRadioBox::MSIntRadioBox(MSWidget *owner_,MSInt &model_,const char *title_): MSRadioBox(owner_,title_) { model(model_); } MSIntRadioBox::MSIntRadioBox(MSWidget *owner_,MSInt& model_,const MSStringVector& title_): MSRadioBox(owner_,title_) { model(model_); } MSIntRadioBox::~MSIntRadioBox(void) {} void MSIntRadioBox::model(MSInt& model_) { couple(&model_); } void MSIntRadioBox::updateData(void) { drawCurrentState(); } void MSIntRadioBox::firstMapNotify(void) { MSRadioBox::firstMapNotify(); drawCurrentState(); } void MSIntRadioBox::arm(MSRadioButton *radioButton_) { MSRadioBox::arm(radioButton_); setModel(); } void MSIntRadioBox::setModel(void) { if (MSView::model()!=0) { MSInt *myModel=(MSInt *)_model; *myModel=activeButton()->integerTag(); } } void MSIntRadioBox::drawCurrentState(void) { if (MSView::model()!=0) { MSInt *value=(MSInt *)_model; MSRadioButton *radioButton=(MSRadioButton *)button((int)*value); if (radioButton==0) { if (activeButton()!=0) *value=activeButton()->integerTag(); } else if (radioButton!=activeButton()) { if (activeButton()!=0) activeButton()->state(MSFalse); _activeButton=radioButton; activeButton()->state(MSTrue); } } } void MSIntRadioBox::receiveEvent(MSEvent &) { drawCurrentState(); } aplus-fsf-4.22/src/MSGUI/MSIntTableColumn.C0000644000265000001440000001471210772770405013733 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include MSIntTableColumn::MSIntTableColumn(MSReportTable *owner_,const char *heading_,const MSSymbol& tag_) : MSTableColumn(owner_,heading_,tag_) { _format=MSFormat(MSInt::WithoutCommas); _clipMode=MSClipStars; _valueQuoted=MSFalse; } MSIntTableColumn::MSIntTableColumn(MSReportTable *owner_,const MSStringVector& heading_,const MSSymbol& tag_) : MSTableColumn(owner_,heading_,tag_) { _format=MSFormat(MSInt::WithoutCommas); _clipMode=MSClipStars; _valueQuoted=MSFalse; } MSIntTableColumn::MSIntTableColumn(MSReportTable *owner_,MSIntVector& model_,const char *heading_,const MSSymbol& tag_) : MSTableColumn(owner_,heading_,tag_) { _format=MSFormat(MSInt::WithoutCommas); _clipMode=MSClipStars; _valueQuoted=MSFalse; model(model_); } MSIntTableColumn::MSIntTableColumn(MSReportTable *owner_,MSIntVector& model_,const MSStringVector& heading_,const MSSymbol& tag_) : MSTableColumn(owner_,heading_,tag_) { _format=MSFormat(MSInt::WithoutCommas); _clipMode=MSClipStars; _valueQuoted=MSFalse; model(model_); } MSIntTableColumn::~MSIntTableColumn(void) {} void MSIntTableColumn::model(MSIntVector& model_) { couple(&model_); } void MSIntTableColumn::model(const MSIntVector& model_) { constCouple(&model_); } void MSIntTableColumn::vector(const MSIntVector& aVector_) { if (MSView::model()!=0) vector()=aVector_; } unsigned MSIntTableColumn::numRows(void) const { return (MSView::model()!=0)?vector().length():0; } MSBoolean MSIntTableColumn::isDuplicate(unsigned row_) { return (MSView::model()!=0&&row_!=0)?vector()(row_)==vector()(row_-1)?MSTrue:MSFalse:MSFalse;} MSBoolean MSIntTableColumn::breakCriteria(unsigned row_) { return (MSView::model()!=0&&row_!=0)?row_==vector().length()|| vector()(row_)!=vector()(row_-1)?MSTrue:MSFalse:MSFalse; } MSBoolean MSIntTableColumn::validate(const char *pString_,unsigned row_) { if (MSView::model()!=0) { MSInt aInt; if (aInt.set(pString_)==MSError::MSSuccess) { #if defined(MS_OPERATOR_CONVERSION_BUG) vector().set(row_,(int)aInt); #else vector().set(row_,aInt); #endif return MSTrue; } } return MSFalse; } const char *MSIntTableColumn::formatOutput(MSString &buffer_,unsigned row_) { if (MSView::model()!=0) { MSInt aInt(vector()(row_)); aInt.format(buffer_,format()); } return buffer_.string(); } // report methods void MSIntTableColumn::breakProcess(MSIndexVector& i_) { MSString buffer; MSInt aInt((int)(MSIndexedFunctions::computeIndexedFunction(vector(),weights(),i_,breakProcessMode()))); breakString()<gradeUp(); else return MSIndexVector::nullVector(); } MSIndexVector MSIntTableColumn::gradeDown(void) const { if (MSView::model()!=0) return ((MSIntVector *)_model)->gradeDown(); else return MSIndexVector::nullVector(); } void MSIntTableColumn::permute(const MSIndexVector &indexVector_) { if (MSView::model()!=0) ((MSIntVector *)_model)->permute(indexVector_); } void MSIntTableColumn::range(MSIndexVector &start_,MSIndexVector &end_) { if (MSView::model()!=0&&start_.length()>0&&start_.length()==end_.length()) { MSIndexVector Start=start_,End=end_; MSIntVector &vector=*(MSIntVector *)_model; start_.removeAll(); end_.removeAll(); for (unsigned i=0;i0&&start_.length()==end_.length()) { MSIntVector &vector=*(MSIntVector *)_model; MSIndexVector index(vector.length()); for (unsigned i=0;i0&&start_.length()==end_.length()) { MSIntVector &vector=*(MSIntVector *)_model; MSIndexVector index(vector.length()); for (unsigned i=0;i=vectorModel.length()) vectorModel.append(item); else vectorModel.insertAt(to_,item); } else { vectorModel.insertAt(to_,item); } } } aplus-fsf-4.22/src/MSGUI/MSIntVectorTraceSet.C0000644000265000001440000000562610772770405014427 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include MSIntVectorTraceSet::MSIntVectorTraceSet(MSGraph *owner_,const char *legends_,const MSSymbol& tag_): MSTraceSet(owner_,legends_,tag_) { format(MSFormat(MSInt::WithoutCommas)); } MSIntVectorTraceSet::MSIntVectorTraceSet(MSGraph *owner_,const MSStringVector& legends_,const MSSymbol& tag_): MSTraceSet(owner_,legends_,tag_) { format(MSFormat(MSInt::WithoutCommas)); } MSIntVectorTraceSet::MSIntVectorTraceSet(MSGraph *owner_,MSIntVector& m_,const char *legends_,const MSSymbol& tag_): MSTraceSet(owner_,legends_,tag_) { format(MSFormat(MSInt::WithoutCommas)); model(m_); } MSIntVectorTraceSet::MSIntVectorTraceSet(MSGraph *owner_,MSIntVector& m_,const MSStringVector& legends_,const MSSymbol& tag_): MSTraceSet(owner_,legends_,tag_) { format(MSFormat(MSInt::WithoutCommas)); model(m_); } MSIntVectorTraceSet::~MSIntVectorTraceSet(void) {} int MSIntVectorTraceSet::dataCount(void) const { return MSView::model()!=0?vector().length():0; } double MSIntVectorTraceSet::y(int i_,int) const { return (double)(MSView::model()!=0?vector()(i_):0); } void MSIntVectorTraceSet::validate(int r_,int,double,double y_) { if (MSView::model()!=0) vector().set(r_,(int)y_);} void MSIntVectorTraceSet::model(MSIntVector& model_) { couple(&model_); } void MSIntVectorTraceSet::model(const MSIntVector& model_) { constCouple(&model_); } void MSIntVectorTraceSet::selectable(MSBoolean x_) { MSTraceSet::selectable(x_); } MSBoolean MSIntVectorTraceSet::selectable(void) const { return MSTraceSet::selectable(); } void MSIntVectorTraceSet::constraint(unsigned long x_) { MSTraceSet::constraint(x_&HoldX); } unsigned long MSIntVectorTraceSet::constraint(void) const { return MSTraceSet::constraint(); } const char *MSIntVectorTraceSet::formatOutput(MSString &buffer_,unsigned row_,unsigned) { if (MSView::model()!=0) { MSInt aInt(vector()(row_)); aInt.format(buffer_,format()); } return buffer_.string(); } MSBoolean MSIntVectorTraceSet::moveTraceValidate(double,double yOffset_) { if (MSView::model()!=0) { vector()-=(int)yOffset_; return MSTrue; } return MSFalse; } MSTraceSet* MSIntVectorTraceSet::copyTraceValidate(MSGraph * owner_,const char *legends_,const MSSymbol& tag_) { MSIntVector* model=(MSIntVector*)vector().clone(); MSIntVectorTraceSet* ts=new MSIntVectorTraceSet(owner_,*model,legends_,tag_); ts->internalModel(MSTrue); return ts; } MSFloatMatrix MSIntVectorTraceSet::asFloatMatrix(void) const { int n=vector().length(); MSFloatMatrix fm(n,1); for(int i=0;i MSKeyCallback::MSKeyCallback(){} MSKeyCallback::~MSKeyCallback(void) {} aplus-fsf-4.22/src/MSGUI/MSKeyPress.C0000644000265000001440000000503310772770405012614 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1998-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include static char *keyTokens[]={"None","Shift","Lock","Ctrl","Meta","NumLck"}; static int keyMasks[]={MSKeyPress::NoneKeyMask, MSKeyPress::ShiftKeyMask, MSKeyPress::LockKeyMask, MSKeyPress::ControlKeyMask, MSKeyPress::MetaKeyMask, MSKeyPress::NumLockMask}; static const int NumTokens=6; static char *tokenString=""; MSKeyPress::MSKeyPress(const char* pString_) { unsigned int mask; translate(pString_,_keysym,mask,_state); } MSKeyPress::MSKeyPress(KeySym keysym_,unsigned int state_): _state(state_), _keysym(keysym_){} MSKeyPress::~MSKeyPress(){} MSBoolean MSKeyPress::isMatch(KeySym keysym_, unsigned int state_) const { return ( keysym_ == _keysym && state_ == _state)? MSTrue:MSFalse;} MSBoolean MSKeyPress::isMatch(const char* pString_) const { KeySym keySym; unsigned int mask, flag; translate(pString_,keySym,mask,flag); return isMatch(keysym(),state(),keySym,mask,flag); } void MSKeyPress::translate(const char *pString_,KeySym &keysym_, unsigned int &mask_, unsigned int &flag_) { mask_=0; flag_=0; keysym_=0; if (pString_!=0) { char *pString; for (int i=0;i=0x61&&keysym_<=0x7a&&(mask_&ShiftKeyMask)==ShiftKeyMask) { keysym_-=0x20; // uppercase-X will send 'Q' not 'q' with Shift down } } else mask_+=ALL; } } MSBoolean MSKeyPress::isMatch(KeySym keysym1_,unsigned int state_, KeySym keysym2_,unsigned int mask_, unsigned int flag_) { if (mask_&ExactMask) return (state_==( flag_ & ~(ALL)) && ((ALL&mask_)||keysym1_==keysym2_))?MSTrue:MSFalse; else return ((state_&mask_)==flag_&& ((ALL&mask_)||keysym1_==keysym2_))?MSTrue:MSFalse; } aplus-fsf-4.22/src/MSGUI/MSKeyTableData.C0000644000265000001440000001300510772770405013337 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1998-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include static const int MSKeyTranslationListSize=128; //############################################################################# // MSKeyCallbackNode //############################################################################# class MSKeyCallbackNode { protected: MSKeyCallback *_keyCallback; KeySym _keysym; unsigned int _mask; unsigned int _flag; public: MSKeyCallbackNode(const char*, MSKeyCallback *); ~MSKeyCallbackNode(void); KeySym keysym() const {return _keysym;} unsigned int mask() const {return _mask;} unsigned int flag() const {return _flag;} MSKeyCallback *callback() const {return _keyCallback;} MSBoolean isMatch(const MSKeyPress&) const; MSBoolean isExactMatch(KeySym, unsigned int, unsigned int ) const; }; //############################################################################# // MSKeyCallbackNode //############################################################################# MSKeyCallbackNode::MSKeyCallbackNode(const char* pTranslationString_, MSKeyCallback *keyCallback_): _keyCallback(keyCallback_) { MSKeyPress::translate(pTranslationString_,_keysym,_mask,_flag); } MSKeyCallbackNode::~MSKeyCallbackNode(void) { if (callback()!=0) delete _keyCallback; } MSBoolean MSKeyCallbackNode::isMatch(const MSKeyPress& keyTranslation_) const { return MSKeyPress::isMatch(keyTranslation_.keysym(),keyTranslation_.state() ,keysym(),mask(),flag()); } MSBoolean MSKeyCallbackNode::isExactMatch(KeySym keysym_,unsigned int mask_, unsigned int flag_) const { return ( keysym_ == keysym() && mask_ == mask() && flag_ == flag() ) ? MSTrue : MSFalse ; } //############################################################################# // MSKeyTableData //############################################################################# MSKeyTableData::MSKeyTableData(const char *pName_) : _referenceCount(0) { if (pName_!=0) { int n=strlen(pName_); _pName=new char[n+1]; memcpy(_pName,pName_,n); _pName[n]='\0'; } else _pName=0; } MSKeyTableData::~MSKeyTableData(void) { if (_pName!=0) delete [] _pName; } void MSKeyTableData::addReference(void) { _referenceCount++; } void MSKeyTableData::removeReference(void) { if (--_referenceCount==0) delete this; } void MSKeyTableData::add(const char* pTranslationString_,MSKeyCallback *keyCallback_) { _ktList.add(new MSKeyCallbackNode(pTranslationString_,keyCallback_)); } void MSKeyTableData::remove( unsigned long identifier_) { MSKeyCallbackNode *tp; for (int i=0;i<_ktList._count;i++) { tp=_ktList._array[i]; if (tp != 0 && (unsigned long)tp->callback()==identifier_) { _ktList.remove(tp); delete tp; break; } } } void MSKeyTableData::remove( KeySym keysym_,unsigned int mask_, unsigned int flag_) { MSKeyCallbackNode *tp; for (int i=0;i<_ktList._count;i++) { tp=_ktList._array[i]; if (tp != 0 && tp->isExactMatch(keysym_,mask_,flag_) == MSTrue) { _ktList.remove(tp); delete tp; } } } void MSKeyTableData::remove( const char * pString_) { KeySym keysym; unsigned int mask,flag; MSKeyPress::translate(pString_,keysym,mask,flag); remove(keysym,mask,flag); } MSBoolean MSKeyTableData::process(const MSKeyPress& keyTranslation_,MSWidget* widget_) const { MSKeyCallbackNode *tp; for (int i=0;i<_ktList._count;i++) { tp=_ktList._array[i]; if (tp->isMatch(keyTranslation_)==MSTrue && tp->callback()->process(widget_,keyTranslation_) == MSTrue) return MSTrue; } return MSFalse; } MSBoolean MSKeyTableData::hasMatch(const MSKeyPress& keyTranslation_) const { MSKeyCallbackNode *tp; for (int i=0;i<_ktList._count;i++) { tp=_ktList._array[i]; if (tp->isMatch(keyTranslation_)==MSTrue ) return MSTrue; } return MSFalse; } //############################################################################# // MSKeyTableData::List //############################################################################# MSKeyTableData::List::List(int size_) { _size=(size_==0)?MSKeyTranslationListSize:size_; _count=0; _array=new MSKeyCallbackNode*[_size]; for (int i=0;i<_size;i++) _array[i]=0; } MSKeyTableData::List::~List(void) { for (int i=0;i<_count;i++) { delete _array[i]; _array[i]=0; } delete [] _array; _array=0; _size=0; _count=0; } void MSKeyTableData::List::reserve(int size_) { if (_size #include #include #include #include static const int KTableSize=64; MSHashTable *MSKeyTranslationTable::_pHashTable=0; MSKeyTranslationTable::MSKeyTranslationTable(void) : _pListHead(0) { if (_pHashTable==0) _pHashTable=new MSHashTable(KTableSize); } MSKeyTranslationTable::~MSKeyTranslationTable(void) { if (_pListHead!=0) { MSNodeItem *hp=_pListHead; MSNodeItem *np; MSKeyTableData *tp; while ((np=hp->next())!=hp) { tp=(MSKeyTableData *)np->data(); if (tp!=0) { if (tp->referenceCount()==1) _pHashTable->remove((char *)tp->name()); tp->removeReference(); } delete np; } delete _pListHead; } } MSKeyTableData *MSKeyTranslationTable::data(const char *pName_) { return (MSKeyTableData *)_pHashTable->lookup(pName_); } MSBoolean MSKeyTranslationTable::keyTableData(const char *pName_) { return (_pHashTable->lookup(pName_)==0)?MSFalse:MSTrue; } void MSKeyTranslationTable::addKeyTableData(const char* newKeyTableDataName_) { MSKeyTableData* newKeyTableData = data(newKeyTableDataName_); if ( newKeyTableData == 0) newKeyTableData = new MSKeyTableData(newKeyTableDataName_); add(newKeyTableData); } void MSKeyTranslationTable::removeKeyTableData(const char* keyTableDataName_) { MSKeyTableData* keyTableData = data(keyTableDataName_); if ( keyTableData!=0)remove(keyTableData); } void MSKeyTranslationTable::add(MSKeyTableData *pData_) { if (_pListHead==0) _pListHead=new MSNodeItem; MSNodeItem *hp=_pListHead; MSNodeItem *np=hp; MSNodeItem *nnp=0; while((np=np->next())!=hp) { if (pData_==(MSKeyTableData *)np->data()) { nnp=np; np->remove(); } } if (nnp==0) { nnp=new MSNodeItem((void *)pData_); pData_->addReference(); } nnp->insert(hp->next()); if ((unsigned long)_pHashTable->lookup((char *)pData_->name())==_pHashTable->notFound()) { _pHashTable->add((char *)pData_->name(),(void *)pData_); } } void MSKeyTranslationTable::remove(MSKeyTableData *pData_) { if (_pListHead!=0) { MSNodeItem *hp=_pListHead; MSNodeItem *np=hp; while((np=np->next())!=hp) { if (pData_==(MSKeyTableData *)np->data()) { np->remove(); pData_->removeReference(); delete np; break; } } } } MSBoolean MSKeyTranslationTable::translate( const MSKeyPress &keyTranslation_,MSWidget * widget_) const { if (_pListHead!=0) { MSNodeItem *hp=_pListHead; MSNodeItem *np=hp; if (hp!=hp->next()) { MSKeyTableData *data; while ((np=np->next())!=hp) { data=(MSKeyTableData *) np->data(); if (data->process(keyTranslation_,widget_)==MSTrue) return MSTrue; } } } return MSFalse; } MSBoolean MSKeyTranslationTable::hasMatch(const MSKeyPress &keyTranslation_) const { if (_pListHead!=0) { MSNodeItem *hp=_pListHead; MSNodeItem *np=hp; if (hp!=hp->next()) { MSKeyTableData *data; while ((np=np->next())!=hp) { data=(MSKeyTableData *) np->data(); if (data->hasMatch(keyTranslation_) == MSTrue) return MSTrue; } } } return MSFalse; } void MSKeyTranslationTable::removeAll() { if (_pListHead!=0) { MSNodeItem *hp=_pListHead; MSNodeItem *np=hp; while((np=np->next())!=hp) { np->remove(); ((MSKeyTableData *)np->data())->removeReference(); delete np; } } } unsigned long MSKeyTranslationTable::addCallback( const char* specificationString_, MSKeyCallback* keyCallback_, const char* pKeyTableDataName_) { MSKeyTableData *pKeyTableData; if(pKeyTableDataName_==0) { char defaultTable[32]; sprintf(defaultTable,"%lu",(unsigned long)this); if ((pKeyTableData=data(defaultTable))==0) { pKeyTableData = new MSKeyTableData(defaultTable); add(pKeyTableData); } } else if ((pKeyTableData=data(pKeyTableDataName_))==0) { pKeyTableData=new MSKeyTableData(pKeyTableDataName_); add(pKeyTableData); } pKeyTableData->add(specificationString_,keyCallback_); return (unsigned long)keyCallback_; } void MSKeyTranslationTable::removeAllCallbacksThat(const char*specificationString_) { MSKeyTableData *pKeyTableData; if (_pListHead!=0) { MSNodeItem *hp=_pListHead; MSNodeItem *np=hp; while ((np=np->next())!=hp) { pKeyTableData=(MSKeyTableData *) np->data(); // only MSKeyCallback's that are referenced by one MSKeyTranslationTable can be removed if (pKeyTableData->referenceCount()==1) pKeyTableData->remove(specificationString_); } } } void MSKeyTranslationTable::removeCallback(unsigned long identifier_, const char* keyTableDataName_) { MSKeyTableData *pKeyTableData; if(keyTableDataName_!=0) { pKeyTableData = data(keyTableDataName_); if (pKeyTableData!=0 && pKeyTableData->referenceCount()==1) pKeyTableData->remove(identifier_); } else { pKeyTableData = defaultKeyTableData(); if (pKeyTableData!=0 ) pKeyTableData->remove(identifier_); } } void MSKeyTranslationTable::removeCallback(const char* specificationString_, const char* keyTableDataName_) { MSKeyTableData *pKeyTableData; if(keyTableDataName_!=0) { pKeyTableData = data(keyTableDataName_); if (pKeyTableData!=0 && pKeyTableData->referenceCount()==1) pKeyTableData->remove(specificationString_); } else { pKeyTableData = defaultKeyTableData(); if (pKeyTableData!=0 ) pKeyTableData->remove(specificationString_); } } MSKeyTableData* MSKeyTranslationTable::defaultKeyTableData(void) const { char defaultTable[32]; sprintf(defaultTable,"%lu",(unsigned long)this); return data(defaultTable); } aplus-fsf-4.22/src/MSGUI/MSLabel.C0000644000265000001440000003716110772770405012075 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include static const unsigned long MSLabelEventMask=(ExposureMask); static const int MSLabelDefaultHighlightThickness=0; static const int MSLabelDefaultShadowThickness=0; static const int MSLabelDefaultMargin=2; static const char *MSLabelDefaultPixmap="LabelDefaultPixmap"; MSLabel::MSLabel(MSWidget *owner_,const char *label_) : MSPrimitiveText(owner_) { init(); internalCouple(new MSStringVector(label_)); _numberOfRows=numRows(); } MSLabel::MSLabel(MSWidget *owner_,const MSStringVector& label_) : MSPrimitiveText(owner_) { init(); internalCouple(new MSStringVector(label_)); _numberOfRows=numRows(); } MSLabel::MSLabel(MSWidget *owner_,MSStringVector& label_) : MSPrimitiveText(owner_) { init(); model(label_); _numberOfRows=numRows(); } MSLabel::MSLabel(MSWidget *owner_,const MSPixmap &pixmap_,const MSPixmap &insensitivePixmap_) : MSPrimitiveText(owner_) { init(); _numberOfRows=numRows(); if (pixmap_.server()==server()) _pixmap=new MSPixmap(pixmap_); else { MSMessageLog::warningMessage("Warning - Pixmap supplied for MSLabel is invalid, using default"); createDefaultPixmap(pixmap_.width(),pixmap_.height(), pixmap_.foreground(),pixmap_.background()); } if (insensitivePixmap_.server()==server()) { _insensitivePixmap=new MSPixmap(insensitivePixmap_); } else { MSMessageLog::warningMessage("Warning - Insensitive Pixmap supplied for MSLabel is invalid, using default"); createDefaultInsensitivePixmap(insensitivePixmap_.width(), insensitivePixmap_.height(), insensitivePixmap_.foreground(), insensitivePixmap_.background()); } } MSLabel::~MSLabel(void) { freeze(); if (pixmap()!=0) delete _pixmap; if (_pixmapGC!=0) XFreeGC(display(),_pixmapGC); if (insensitivePixmap()!=0) delete _insensitivePixmap; MSHashTable *hashTbl=server()->toolTipHashTable(); MSStringVector *tip=(MSStringVector *)hashTbl->lookup((unsigned long)this); if ((unsigned long)tip!=hashTbl->notFound()) delete tip; hashTbl->remove((unsigned long)this); MSToolTip *toolTip=server()->toolTip(); if (toolTip->displayFor()==this) toolTip->unmap(); } void MSLabel::init(void) { freeze(); _resetClipRegion=MSFalse; _displayToolTip=MSFalse; _pixmapGC=0; _pixmap=0; _insensitivePixmap=0; _highlightThickness=MSLabelDefaultHighlightThickness; _shadowThickness=MSLabelDefaultShadowThickness; _alignment=MSCenter; _margin=MSLabelDefaultMargin; dynamic(MSFalse); shadowStyle(MSEtchedOut); acceptFocus(MSFalse); } void MSLabel::createDefaultPixmap(int w_,int h_,unsigned long fg_,unsigned long bg_) { _pixmap=new MSPixmap(server(),MSLabelDefaultPixmap,w_,h_,fg_,bg_); GC gc=XCreateGC(display(),window(),0,0); XSetForeground(display(),gc,bg_); XFillRectangle(display(),pixmap()->pixmap(),gc,0,0,w_,h_); XFreeGC(display(),gc); } void MSLabel::createDefaultInsensitivePixmap(int w_,int h_,unsigned long fg_,unsigned long bg_) { _insensitivePixmap=new MSPixmap(server(),MSLabelDefaultPixmap,w_,h_,fg_,bg_); GC gc=XCreateGC(display(),window(),0,0); XSetForeground(display(),gc,bg_); XFillRectangle(display(),insensitivePixmap()->pixmap(),gc,0,0,w_,h_); XFreeGC(display(),gc); } // virtual methods that subclassers can override for different model types int MSLabel::numRows(void) const { return (_model!=0)?label().length():0; } int MSLabel::numColumns(void) const { return (_model!=0)?label().maxLength():0; } int MSLabel::numColumns(int row_) const { return (row_width()+offset; newH=pixmap()->height()+offset; } else { newW=maxPixelWidth()+offset; newH=numRows()*textHeight()+offset; } if (oldW==newW&&oldH==newH) redraw(); else resize(newW,newH); } void MSLabel::setClipRegion(void) { int offset=highlightThickness()+shadowThickness()+margin(); XRectangle clipRect[1]; clipRect[0].x=0; clipRect[0].y=0; clipRect[0].width=drawWidth(); clipRect[0].height=drawHeight(); XSetClipRectangles(display(),textGC(),offset,offset,&clipRect[0],1,Unsorted); } GC MSLabel::pixmapGC(void) { if (_pixmapGC==0) { XGCValues values; _pixmapGC=XCreateGC(display(),window(),0,&values); } return _pixmapGC; } void MSLabel::configure(void) { setClipRegion(); } void MSLabel::redraw(void) { if (frozen()==MSFalse&&mapped()==MSTrue) { drawBackground(); if (pixmap()==0) drawLabel(); else drawPixmap(); drawShadow(); } } void MSLabel::drawPixmap(void) { if (mapped()==MSTrue) { const MSPixmap *pmap; if (sensitive()==MSTrue) pmap=pixmap(); else pmap=insensitivePixmap(); if (pmap!=0) { int startx=computePixmapXCoord(pmap); int starty=computePixmapYCoord(pmap); GC gc=pixmapGC(); XSetForeground(display(),gc,foreground()); XSetBackground(display(),gc,background()); copyPixmap(display(),*pmap,window(),gc,startx,starty); } } } int MSLabel::computePixmapXCoord(const MSPixmap *pmap_) { int offset=highlightThickness()+shadowThickness()+margin(); int r=0; int pwidth=pmap_->width(); if (alignment()&MSLeft) r=offset; else if (alignment()&MSRight) r=width()-offset-pwidth; else r=(width()-pwidth)/2; return r; } int MSLabel::computePixmapYCoord(const MSPixmap *pmap_) { int offset=highlightThickness()+shadowThickness()+margin(); int r=0; int pheight=pmap_->height(); if (alignment()&MSTop) r=offset; else if (alignment()&MSBottom) r=height()-offset-pheight; else r=(height()-pheight)/2; return r; } void MSLabel::drawLabel(void) { if (outputMode()==DrawPPM) resetClipRegion(MSTrue); if (resetClipRegion()==MSTrue) { setClipRegion(); if (outputMode()==Draw) resetClipRegion(MSFalse); } drawRows(0,numRows()-1); } void MSLabel::drawRow(int row_) { drawRows(row_,row_); } void MSLabel::drawRows(int rs_,int re_) { if (frozen()==MSFalse&&mapped()==MSTrue) { int nr=numRows(); if (nr>0) { MSString buffer; for (int i=rs_;i<=re_&&i0) { int y=computeYCoord(row_); int x=computeXCoord(row_,column_>=0?column_:0,pString_,len_); XDrawString(display(),window(),textGC(),textFontStruct(),x,y+textAscent(),pString_,len_); } } void MSLabel::clearRow(int row_) { if (row_0)?delta>>1:0; r=offset+row_*textHeight()+delta; } return r; } int MSLabel::computeXCoord(int,int column_,const char *pString_,int len_) { int offset=highlightThickness()+shadowThickness()+margin(); int r=0; if (pString_!=0) { if (alignment()&MSLeft) r=offset+textWidth(pString_,column_); else if (alignment()&MSRight) { int xs=width()-offset-textWidth(pString_,len_); r=xs+textWidth(pString_,column_); } else { int delta=drawWidth()-textWidth(pString_,len_); delta=(delta>0)?delta>>1:0; r=offset+delta+textWidth(pString_,column_); } } return r; } void MSLabel::updateBackground(unsigned long oldbg_) { MSPrimitiveText::updateBackground(oldbg_); redraw(); } void MSLabel::updateForeground(unsigned long oldfg_) { MSPrimitiveText::updateForeground(oldfg_); redraw(); } void MSLabel::updateFont(Font oldfid_) { MSPrimitiveText::updateFont(oldfid_); if (dynamic()==MSTrue) computeSize(); else redraw(); } void MSLabel::updateSensitivity(void) { MSPrimitiveText::updateSensitivity(); redraw(); } void MSLabel::updatePixmap(void) { // Make sure both sensitive and insensitive pixmap is defined // we're not wasting X Resource since MSPixmap is reference counted if (insensitivePixmap()==0&&pixmap()!=0) _insensitivePixmap=new MSPixmap(*pixmap()); if (pixmap()==0&&insensitivePixmap()!=0) _pixmap=new MSPixmap(*insensitivePixmap()); if (firstMap()==MSTrue) { if (dynamic()==MSTrue) computeSize(); else redraw(); } } int MSLabel::maxPixelWidth(void) { unsigned n=numRows(); unsigned longest=0,len=0; MSString buffer; for (unsigned i=0;ilongest) longest=len; } return longest; } void MSLabel::displayToolTip(MSBoolean displayToolTip_) { if (_displayToolTip!=displayToolTip_) { _displayToolTip=displayToolTip_; unsigned long mask; if (displayToolTip()==MSTrue) mask=eventMask()|EnterWindowMask|LeaveWindowMask; else mask=(eventMask()&~EnterWindowMask)&~LeaveWindowMask; selectInput(mask); } } void MSLabel::enterNotify(const XEvent *) { MSToolTip *toolTipWidget=server()->toolTip(); toolTipWidget->toolTip(tip(),this); int x,y; toolTipXY(x,y); toolTipWidget->moveTo(x,y); toolTipWidget->show(); } void MSLabel::leaveNotify(const XEvent *) { server()->toolTip()->unmap(); } void MSLabel::toolTipXY(int &x,int &y) { MSToolTip *toolTipWidget=server()->toolTip(); int w=toolTipWidget->width(); int h=toolTipWidget->height(); int tailPosition=0; int rootx,rooty; rootXY(rootx,rooty); x=rootx+(width()/2); y=rooty+height(); if (x+w>server()->width()) { x=rootx+width()/2-w; tailPosition=MSToolTip::Right; } else tailPosition=MSToolTip::Left; if (y+h>server()->height()) { y=rooty-h; tailPosition|=MSToolTip::Bottom; } else tailPosition|=MSToolTip::Top; toolTipWidget->tailPosition(tailPosition); } const MSStringVector &MSLabel::tip(void) const { MSHashTable *hashTbl=server()->toolTipHashTable(); MSStringVector *tip=(MSStringVector *)hashTbl->lookup((unsigned long)this); if ((unsigned long)tip==hashTbl->notFound()) return (*(MSStringVector *)hashTbl->notFound()); else return *tip; } void MSLabel::toolTip(const MSStringVector &toolTip_) { MSHashTable *hashTbl=server()->toolTipHashTable(); MSStringVector *tip=(MSStringVector *)hashTbl->lookup((unsigned long)this); if ((unsigned long)tip==hashTbl->notFound()) { hashTbl->add((unsigned long)this,new MSStringVector(toolTip_)); } else { (*tip)=toolTip_; } if (displayToolTip()==MSTrue) { MSToolTip *toolTipWidget=server()->toolTip(); if (toolTipWidget->mapped()==MSTrue&&toolTipWidget->displayFor()==this) { toolTipWidget->toolTip(toolTip_,this); } } } void MSLabel::set(MSAttrValueList& avList_) { MSPrimitiveText::set(avList_); MSIndexVector index; for (unsigned i=0;i #include static const double protStdUp[] ={ 10.,1.,2.,2.5,5.,0. }; static const double protStdDn[] ={ .1,.5,.25,.2,.1,0. }; static const double protFracDn[] ={ .5,1.,0. }; static const double protPrice32[] ={ 0.,.03125,.0625,.125,.25,.5,0. }; static const double protPrice64[] ={ 0.,.015625,.03125,.0625,.125,.25,.5,0. }; static const double protPrice128[] ={ 0.,.0078125,.015625,.03125,.0625,.125,.25,.5,0. }; static const double protPrice320[] ={ 0.,.001953125,.00390625,.015625,.03125,.0625, .125,.25,.5,0. }; static const double protTime[] ={ 0.0,1.,2.,5.,10.,15.,30.,60. ,120., 300.,600.,900.,1800.,3600.,7200., 10800.,14400.,21600.,43200.,0.0 }; static const double protDate[] ={ 0.0,86400.,172800.,259200.,345600.,604800., 1209600.,2678400.,5356800.,8035200., 10713600.,16070400.,31622400.,0.0 }; static const double *protocolFloat[] ={ protStdUp,protStdDn,0 }; static const double *protocolFrac[] ={ protStdUp,protStdDn,protFracDn,0 }; static const double *protocolPrice32[] ={ protStdUp,protPrice32,0 }; static const double *protocolPrice64[] ={ protStdUp,protPrice64,0 }; static const double *protocolPrice128[] ={ protStdUp,protPrice128,0 }; static const double *protocolPrice320[] ={ protStdUp,protPrice320,0 }; static const double *protocolTime[] ={ protTime,protDate,0 }; static const double *protocolDate[] ={ protTime,protDate,0 }; MSLabelFormat::MSLabelFormat(void) {} MSLabelFormat::~MSLabelFormat(void) {} unsigned long MSLabelFormat::nextWeekday(unsigned long now_) { const int secondsPerDay=86400; struct tm *tm; #ifdef MS_THREAD_SAFE_FUNCTIONS struct tm tmStruct; #endif time_t now=(time_t)now_; tm=MS_GMTIME(&now,&tmStruct); if(tm->tm_wday==0)now+=secondsPerDay; // Sunday so move up one day else if(tm->tm_wday==6)now+=2*secondsPerDay; // Saturday so move up two days now_=(unsigned long)now; return(now_); } double MSLabelFormat::snapTime(double start_,double increment_) { unsigned long newTime=(unsigned long)increment_; if (fabs(start_)tm_sec=0; // Midnight tm->tm_min=0; tm->tm_hour=0; if (increment_>=zeroYear)// Snap to January 1st { tm->tm_mday=1; tm->tm_mon=0; newTime=nextWeekday(timegm(tm)); } else if (increment_>=halfYear) // Snap to half year { tm->tm_mday=1; tm->tm_mon -=tm->tm_mon % 6; newTime=nextWeekday(timegm(tm)); } else if (increment_>=thirdYear) // Snap to third year { tm->tm_mday=1; tm->tm_mon -=tm->tm_mon % 4; newTime=nextWeekday(timegm(tm)); } else if (increment_>=quarterYear) // Snap to quarter year { tm->tm_mday=1; tm->tm_mon -=tm->tm_mon % 3; newTime=nextWeekday(timegm(tm)); } else if (increment_>=sixthYear) // Snap to sixth year { tm->tm_mday=1; tm->tm_mon -=tm->tm_mon % 2; newTime=nextWeekday(timegm(tm)); } else if (increment_>=month)// Snap to Month { tm->tm_mday=1; newTime=nextWeekday(timegm (tm)); } else if (increment_>=monday)// Snap to Monday { newTime=start-(secondsPerDay*tm->tm_wday)- start % secondsPerDay+secondsPerDay; } else { newTime=start-start%(long)increment_; // Use the fallback } } return (double)newTime; } const double **MSLabelFormat::findProtocol(const MSLabelOut& out_) { const double **protocol=protocolFloat; if (out_.format().formatType()==MSFormat::Time) protocol=protocolTime; else if (out_.format().formatType()==MSFormat::Money) { switch(out_.format().moneyFormat()) { case MSMoney::ThirtySeconds: protocol=protocolPrice32; break; case MSMoney::SixtyForths: protocol=protocolPrice64; break; case MSMoney::OneTwentyEights: protocol=protocolPrice128; break; // case Price320: // protocol=protocolPrice320; // break; // case Price328: // protocol=protocolPrice320; // break; } } return protocol; } double MSLabelFormat::snapNumber(double in_,const MSLabelOut& out_) { int i,j,p; double out =-1.; double best =-1.; double factor=1.; double sign =1.; const double **protocol=findProtocol(out_); if (protocol!=0) { if (in_<0.0) { sign=-1.; in_=-in_; } // Loop through the various protocols and find the smallest number each finds for (p=0; protocol[p]!=0; p++) { out=-1.; factor=1.; // Handle a finite series protocol if (protocol[p][0]<=0.0) { for (i=1; protocol[p][i]>0.; i++) { if (protocol[p][i]*factor>=in_) { out=protocol[p][i]*factor; break; } } } // Handle a decreasing series protocol else if (protocol[p][0]<=1.0) { j=1; do { for (i=1; protocol[p][i]>0.; i++) { if (protocol[p][i]*factor>=in_) out=protocol[p][i]*factor; else { j=0; break; } } factor*=protocol[p][0]; } while (j!=0); } // Handle an increasing series protocol else do { for (i=1; protocol[p][i]>0.; i++) { if (protocol[p][i]*factor>=in_) { out=protocol[p][i]*factor; break; } } factor*=protocol[p][0]; } while (out<=0.); if (best<=0.||(out>=0.&&out0.0) return (best*sign); else return (in_*sign); // Couldn't find a nice values so return the old one } return in_; } double MSLabelFormat::snipNumber(double in_,const MSLabelOut& out_) { int i,j,p; double out=-1.; double best=-1.; double factor=1.; double last; double sign=1.; const double **protocol=findProtocol(out_); if (protocol!=0) { if (in_<0.0) { sign=-1.; in_=-in_; } // Loop through the various protocols and find the largest number each finds for (p=0; protocol[p]!=0; p++) { out=-1.0; factor=1.0; // Handle a finite series protocol if (protocol[p][0]<=0.0) { for (i=1; protocol[p][i]>0.0; i++) { if (protocol[p][i]==in_) { out=protocol[p][i]; break; } else if (protocol[p][i]>in_) { if (i>1)out=protocol[p][i-1]; break; } } } // Handle a decreasing series protocol else if (protocol[p][0]<=1.0) { j=1; do { for (i=1; protocol[p][i]>0.; i++) { if (protocol[p][i]*factor<=in_) { out=protocol[p][i]*factor; j=0; break; } } factor*=protocol[p][0]; } while (j); } // Handle an increasing series protocol else { last=0.; do { for (i=1; protocol[p][i]>0.; i++) { if (protocol[p][i]*factor==in_) { out=protocol[p][i]*factor; break; } else if (protocol[p][i]*factor>in_) { out=last; break; } last=(double)protocol[p][i]*factor; } factor*=protocol[p][0]; } while (out<0.); } if (best<=0.0||(out>0.0&&out>best)) best=out; } if (best>0.0) return(best*sign); } return in_; } double MSLabelFormat::minimumNumber(const MSLabelOut& out_) { int i; int found=0; double value=0.; const double **protocol=findProtocol(out_); if (protocol==0)return 0.0; for (i=0; protocol[i]!=0; i++) { if (protocol[i][0]<=0.0||protocol[i][0]>1.0) { if (!found||protocol[i][1] MSLabelOut::MSLabelOut(void) : _format(MSFloat::Default) {init();} MSLabelOut::MSLabelOut(MSAlignment) {init();} MSLabelOut::MSLabelOut(const MSStringVector& aStringVector_) : _labels(aStringVector_),_format(MSFloat::Default) {init();} MSLabelOut::MSLabelOut(const MSFormat& aFormat_) : _format(aFormat_) {init();} void MSLabelOut::init(void) {_owner=0;} void MSLabelOut::format(const MSFormat& aFormat_) { _format=aFormat_; if (owner()!=0) owner()->redraw(); } MSLabelOut::~MSLabelOut(void) {} const char *MSLabelOut::formatOutput(MSString &buffer_,double data_) { if (data_ #include MSLayout::MSLayout(MSWidget *owner_,const char *title_) : MSLayoutManager(owner_) { _label=0; // prevent childCreate from adding this as a managed child _label=new MSLabel(this,title_); init(); } MSLayout::MSLayout(MSWidget *owner_,const MSStringVector& title_) : MSLayoutManager(owner_) { _label=0; // prevent childCreate from adding this as a managed child _label=new MSLabel(this,title_); init(); } void MSLayout::init(void) { _title=label()->label(); _highlightThickness=0; _shadowThickness=2; _titleAlignment=MSLeft|MSCenter; shadowStyle(MSEtchedIn); int offset=shadowThickness()+highlightThickness()+margin(); label()->highlightThickness(0); label()->shadowThickness(0); label()->margin(4); label()->dynamic(MSTrue); label()->moveTo(offset,offset); if (label()->columns()>0) label()->map(); } MSLayout::~MSLayout(void) { if (label()!=0) safeDestroy(_label); } void MSLayout::updateBackground(unsigned long oldbg_) { MSLayoutManager::updateBackground(oldbg_); label()->background(background()); } void MSLayout::updateForeground(unsigned long oldfg_) { MSLayoutManager::updateForeground(oldfg_); if (label()->foreground()==oldfg_) label()->foreground(foreground()); } void MSLayout::naturalSize(void) { freeze(); MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; MSLayoutEntry *entry; while ((np=np->next())!=hp) { entry=(MSLayoutEntry *) np->data(); entry->widget()->naturalSize(); } int w=label()->width(); label()->freeze(); label()->naturalSize(); unfreeze(); label()->unfreeze(); if (w!=label()->width()) label()->redraw(); } void MSLayout::childCreate(MSWidget *widget_) { if (label()!=0&&widget_!=label()) MSLayoutManager::childCreate(widget_); } void MSLayout::childDestroy(MSWidget *widget_) { if (widget_!=label()) MSLayoutManager::childDestroy(widget_); } void MSLayout::childMap(MSWidget *widget_) { if (widget_!=label()) MSLayoutManager::childMap(widget_); } void MSLayout::childUnmap(MSWidget *widget_) { if (widget_!=label()) MSLayoutManager::childUnmap(widget_); } void MSLayout::childConfigure(MSWidget *widget_) { if (widget_!=label()) MSLayoutManager::childConfigure(widget_); else if (label()->mapped()==MSTrue&&label()->frozen()==MSFalse) adjustSize(); } void MSLayout::configure(void) { if (label()!=0) positionLabel(); } void MSLayout::computeSize(void) { drawBackground(); placement(); positionLabel(); drawShadow(); } void MSLayout::positionLabel(void) { if (label()->columns()>0) { int xpos,ypos; int indent; if (titleAlignment()&MSLeft) { indent=XTextWidth(fontManager()->fontStruct(label()->font()),"M",1); xpos=highlightThickness()+shadowThickness()+margin()+indent; } else if (titleAlignment()&MSRight) { indent=XTextWidth(fontManager()->fontStruct(label()->font()),"M",1); xpos=width()-(highlightThickness()+shadowThickness()+margin())-indent-label()->width(); } else xpos=width()/2-label()->width()/2; if (titleAlignment()&MSTop) { topShadowOffset(label()->height()); ypos=0; } else if (titleAlignment()&MSBottom) { topShadowOffset(0); ypos=highlightThickness()+shadowThickness()+margin(); } else { topShadowOffset(label()->height()/2); ypos=0; } label()->moveTo(xpos,ypos); if (mapped()==MSFalse) label()->map(); } else { label()->unmap(); topShadowOffset(0); } } void MSLayout::updateTitle(void) { undrawShadow(); label()->freeze(); label()->foreground(titleForeground()); int h=label()->height(); int w=label()->width(); label()->font(titleFont()); MSBoolean doPlacement=MSFalse; label()->label(title()); int ml=label()->columns(); if (ml==0&&label()->mapped()==MSTrue) { label()->unmap(); doPlacement=MSTrue; } else if (ml>0&&label()->mapped()==MSFalse) { label()->map(); doPlacement=MSTrue; } positionLabel(); label()->unfreeze(); if (label()->height()!=h||label()->width()!=w||doPlacement==MSTrue) adjustSize(); else if (label()->mapped()==MSTrue) label()->redraw(); drawShadow(); } int MSLayout::innerHeight(void) const { return (label()->mapped()==MSTrue)?label()->height():0; } int MSLayout::realHeight(void) const { int offset=highlightThickness()+shadowThickness()+margin(); return (height()-innerHeight()-(rows()-1)*rowSpacing()-2*offset); } int MSLayout::realWidth(void) const { int offset=highlightThickness()+shadowThickness()+margin(); return (width()-2*innerWidth()-(columns()-1)*columnSpacing()-2*offset); } int MSLayout::idealHeight(void) const { int offset=highlightThickness()+shadowThickness()+margin(); return (vectorHeight()+innerHeight()+(rows()-1)*rowSpacing()+2*offset); } int MSLayout::idealWidth(void) const { int offset=highlightThickness()+shadowThickness()+margin(); int w=(vectorWidth()+2*innerWidth()+(columns()-1)*columnSpacing()+2*offset); if (label()->mapped()==MSTrue) { int lw=label()->width()+2*offset; if ((titleAlignment()&MSLeft)||(titleAlignment()&MSRight)) lw+=(2*XTextWidth(fontManager()->fontStruct(label()->font()),"M",1)); return (w>lw)?w:lw; } else return w; } aplus-fsf-4.22/src/MSGUI/MSLayoutManager.C0000644000265000001440000012420310772770406013621 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #if HAVE_IOSTREAM #include #else #include #endif #include static const int VectorMinimize=0x01; // Must be set before spanCompare works static ValueFunc currentValueFunc; // Compares items based on span. static int spanCompare(const void *ap,const void *bp) { MSNodeItem **npa=(MSNodeItem **)ap; MSNodeItem **npb=(MSNodeItem **)bp; int loc_a,loc_b; int span_a,span_b; MSBoolean smallFlag; (*currentValueFunc)((MSLayoutEntry *)npa[0]->data(),&loc_a,&span_a,&smallFlag); (*currentValueFunc)((MSLayoutEntry *)npb[0]->data(),&loc_b,&span_b,&smallFlag); return span_a-span_b; } // Returns the sum of the space in `vec' from `loc' for length `span'. // Adds in the appropriate padding given by `start',`inter' and `end'. static int sumVec(int loc_,int span_,MSLayoutVector *vec_,int start_,int inter_,int end_) { int i,sum=0; for (i=loc_;i=0)?span_*inter_:0); } static void colValues(MSLayoutEntry *entry_,int *loc_,int *span_,MSBoolean *smallFlag_) { *loc_=entry_->at().column(); *span_=entry_->at().columnSpan(); *smallFlag_=(entry_->at().constraints()&At::MinimizeWidth)?MSTrue:MSFalse; } static void rowValues(MSLayoutEntry *entry_,int *loc_,int *span_,MSBoolean *smallFlag_) { *loc_=entry_->at().row(); *span_=entry_->at().rowSpan(); *smallFlag_=(entry_->at().constraints()&At::MinimizeHeight)?MSTrue:MSFalse; } static int colSize(MSWidget *widget_) { return widget_->width(); } static int rowSize(MSWidget *widget_) { return widget_->height(); } MSLayoutManager::MSLayoutManager(MSWidget *owner_) : MSManager(owner_) { init(); } MSLayoutManager::~MSLayoutManager(void) { if (_rowHeights!=0) delete [] _rowHeights; if (_columnWidths!=0) delete [] _columnWidths; if (_geometry!=0) delete _geometry; _geometry=0; freeze(); // remove all children MSLayoutEntry *entry; MSNodeItem *hp=childListHead(); MSNodeItem *np; // first remove the node from the list // then destroy the widget // this will prevent childDestroy/removeChild from causing any damage // delete the child list while ((np=hp->next())!=hp) { entry=(MSLayoutEntry *) np->data(); delete np; if (entry!=0) { // destroy will cause childDestroy to be invoked if (entry->widget()!=0) safeDestroy(entry->widget()); delete entry; } _childCount--; } // delete the mapped list hp=(MSNodeItem *) mappedListHead(); while ((np=hp->next())!=hp) delete np; } void MSLayoutManager::init(void) { _geometry=0; _stateFlag=PlacementFlag; _vectorState=Invalid; currentValueFunc=0; _layoutStyle=ColumnMajor; _orientation=Unspecified; _shadowThickness=2; _rows=_columns=0; _rowHeights=0; _columnWidths=0; _rowSpacing=0; _columnSpacing=0; _margin=0; _vectorHeight=0; _vectorWidth=0; _innerWidth=0; _innerHeight=0; shadowStyle(MSEtchedIn); freeze(); } void MSLayoutManager::orientation(MSLayoutManager::Orientation orientation_) { if (orientation()!=orientation_) { _orientation=orientation_; updateOrientation(); } } void MSLayoutManager::updateOrientation(void) { if (setPositions()==MSTrue) adjustSize(); } // layout style is not yet implemented void MSLayoutManager::layoutStyle(MSLayoutManager::LayoutStyle style_) { if (layoutStyle()!=style_) { _layoutStyle=style_; if (setPositions()==MSTrue) adjustSize(); } } void MSLayoutManager::geometry(const MSIndexVector& geometry_) { if (_geometry==0) _geometry=new MSIndexVector(geometry_); else *_geometry=geometry_; if (setPositions()==MSTrue) adjustSize(); } void MSLayoutManager::childInsert(MSWidget *widget_) { insertChild(widget_); } void MSLayoutManager::childRemove(MSWidget *widget_) { removeChild(widget_); } void MSLayoutManager::childCreate(MSWidget *widget_) { insertChild(widget_); } void MSLayoutManager::childDestroy(MSWidget *widget_) { removeChild(widget_); } int MSLayoutManager::innerHeight(void) const { return _innerHeight; } int MSLayoutManager::innerWidth(void) const { return _innerWidth; } int MSLayoutManager::rowHeight(unsigned row_) const { return (row_at().row():0; } int MSLayoutManager::column(MSWidget *widget_) const { const MSLayoutEntry *entry=getEntry(widget_); return (entry!=0)?entry->at().column():0; } int MSLayoutManager::columnSpan(MSWidget *widget_) const { const MSLayoutEntry *entry=getEntry(widget_); return (entry!=0)?entry->at().columnSpan():1; } int MSLayoutManager::rowSpan(MSWidget *widget_) const { const MSLayoutEntry *entry=getEntry(widget_); return (entry!=0)?entry->at().rowSpan():1; } unsigned long MSLayoutManager::options(MSWidget *widget_) const { const MSLayoutEntry *entry=getEntry(widget_); return (entry!=0)?entry->at().constraints():0; } // handle child resize void MSLayoutManager::childConfigure(MSWidget *widget_) { if (widget_!=this&&placementFlag()==MSFalse) { MSLayoutEntry *entry=findMappedEntry(widget_); if (entry!=0) adjustSize(); } } // handle child resizeConstraints change void MSLayoutManager::childResizeConstraints(MSWidget *widget_) { MSLayoutEntry *entry=getEntry(widget_); // get entry from childList if (entry!=0&&widget_!=this) { unsigned long opts=widget_->resizeConstraints(); if (entry->at().constraints()!=opts) { entry->at().constraints(opts); if (entry->mapped()==MSTrue) adjustSize(); } } } // If `size' is larger than the sum of all widths in `vec', // the extra space is distributed evenly among appropriate // candidates of `vec'. void MSLayoutManager::extraColumnSpace(int num_,MSLayoutVector *vec_,int size_) { extraSpace(num_,vec_,size_,uniformColumns()); } void MSLayoutManager::extraRowSpace(int num_,MSLayoutVector *vec_,int size_) { extraSpace(num_,vec_,size_,uniformRows()); } void MSLayoutManager::extraSpace(int num_,MSLayoutVector *vec_,int size_,MSBoolean uniform_) { int i,sum=0; for (i=0;i0) { if (ndist>0) { amt=diff/ndist; for (i=0;i0) { amt=diff/ndist; for (i=0;i1) sum+=(span_-1)*spacing_; diff=size_-sum; if (diff>0&&n_>0) { // Distribution required amt=diff/n_; for (i=0;inext())!=hp) { entry=(MSLayoutEntry *) np->data(); (*valueFunc)(entry,&loc,&span,&smallFlag); if (smallFlag) for (j=loc;jnext())!=hp) { entry=(MSLayoutEntry *) np->data(); (*valueFunc)(entry,&loc,&span,&smallFlag); if (resultsort(hp,spanCompare); hp=mappedListHead(); np=hp; distrib=new int[resultNum]; while ((np=np->next())!=hp) { entry=(MSLayoutEntry *) np->data(); (*valueFunc)(entry,&loc,&span,&smallFlag); n_dist=findDistribution(loc,span,result_,distrib,MSFalse); doDistribution(n_dist,distrib,loc,span,result_,(*sizeFunc)(entry->widget()),spacing_); } delete [] distrib; } return resultNum; } // Recomputes the size vectors in the layout widget by // examining the preferred sizes of subwidgets. The // following fields are modified: num_rows,num_cols, // rows,cols,vec_height,and vec_width. void MSLayoutManager::recomputeVectors(void) { unsigned i; if (_columnWidths!=0) delete [] _columnWidths; _columns=0; if (_rowHeights!=0) delete [] _rowHeights; _rows=0; _vectorWidth=_vectorHeight=0; _columns=vectorSize(colValues); if (columns()>0) { _columnWidths=(MSLayoutVector *)new MSLayoutVector[columns()]; _columns=computeVector(colValues,colSize,columnSpacing(),_columnWidths); if (uniformColumns()==MSTrue) { int max=0; for (i=0;i0) { _rowHeights= (MSLayoutVector *)new MSLayoutVector[rows()]; _rows=computeVector(rowValues,rowSize,rowSpacing(),_rowHeights); if (uniformRows()==MSTrue) { int max=0; for (i=0;i>1); if (opts_&At::Top) ry=y_; else if (opts_&At::Bottom) ry=y_+h_-rh_; else ry=y_+((h_-rh_)>>1); widget_->moveTo(rx,ry); } // This routine places each widget in `managed' according to the // spacing vectors `cvec' and `rvec' and the widget placement // options (justification and resizing). First, // the routine will resize the widget to fit its allocated // space. Then it will place the widget paying attention // to the resize constraints. void MSLayoutManager::doPlacement(MSLayoutVector *cvec_,MSLayoutVector *rvec_,int vp_,int hp_,int rs_,int cs_) { int r,c,aw,ah,nw,nh; int offset=highlightThickness()+shadowThickness()+margin(); MSLayoutEntry *entry; MSNodeItem *hp=mappedListHead(); MSNodeItem *np=hp; while((np=np->next())!=hp) { entry=(MSLayoutEntry *)np->data(); r=sumVec(0,entry->at().column(),cvec_,hp_,cs_,0)+offset; c=sumVec(0,entry->at().row(),rvec_,vp_,rs_,0)+offset; aw=sumVec(entry->at().column(),entry->at().columnSpan(),cvec_,0,cs_,-cs_); ah=sumVec(entry->at().row(),entry->at().rowSpan(),rvec_,0,rs_,-rs_); nw=aw; nh=ah; if (entry->at().constraints()&At::MaintainWidth) nw=entry->widget()->width(); if (entry->at().constraints()&At::MaintainHeight) nh=entry->widget()->height(); if (((nw!=entry->widget()->width())||(nh!=entry->widget()->height()))&&(nw>0)&&(nh>0)) { entry->widget()->resize(nw,nh); } nw=entry->widget()->width(); nh=entry->widget()->height(); placeWidget(entry->widget(),r,c,aw,ah,nw,nh,entry->at().constraints()); } } // Places the children of the layout widget. There are several steps: // 1. Distribute any extra space into local copies of spacing vectors. // 2. If the option is set, any extra space is offered to each widget. // 3. The final placement is done according to the actual size of // each widget and the space allocated for it. void MSLayoutManager::placement(void) { if (mapped()==MSTrue&&rows()>0&&columns()>0) { unsigned i; // Make local copies of vectors MSLayoutVector *lrows=(MSLayoutVector *)new MSLayoutVector[rows()]; MSLayoutVector *lcols=(MSLayoutVector *)new MSLayoutVector[columns()]; for (i=0;i=0)&&(at_.row()>=0)&&(at_.columnSpan()!=0)&&(at_.rowSpan()!=0)) { MSLayoutEntry *entry=getEntry(widget_); if (entry!=0) // set the child position,span info { if (entry->at()!=at_) { entry->at()=at_; widget_->resizeConstraints(at_.constraints()); if (entry->mapped()==MSTrue) adjustSize(); } } } } At MSLayoutManager::childPosition(MSWidget *widget_) { MSLayoutEntry *entry=getEntry(widget_); if (entry!=0) return At(entry->at()); else return At(0,0,1,1,widget_->resizeConstraints()); } // insert the child into the child list void MSLayoutManager::insertChild(MSWidget *widget_) { MSLayoutEntry *entry=getEntry(widget_); if (entry==0&&widget_!=0) { entry=new MSLayoutEntry(widget_); entry->at().constraints(widget_->resizeConstraints()); MSNodeItem *np=new MSNodeItem((void *)entry); np->insert(childListHead()); // fifo _childCount++; setDefaultChildPosition(entry); // allow subclasses to set the default position if (widget_->mapped()==MSTrue) childMap(widget_); } } // remove child from the child list void MSLayoutManager::removeChild(MSWidget *widget_) { MSLayoutEntry *entry=0; MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; // check the child list while ((np=np->next())!=hp) { entry=(MSLayoutEntry *)np->data(); if (entry->widget()==widget_) { delete np; if (entry->mapped()==MSTrue) removeMappedEntry(entry); delete entry; _childCount--; break; } else entry=0; } if (entry!=0) adjustSize(); } // Move the widget from the unmapped nodelist to the mapped nodelist void MSLayoutManager::childMap(MSWidget *widget_) { if (widget_!=this) { MSLayoutEntry *entry=findMappedEntry(widget_); if (entry==0) { entry=getEntry(widget_); // get entry from childList entry->mapped(MSTrue); insertMappedEntry(entry); adjustSize(); } } } // a child has been unmapped - move it to the unmapped nodelist void MSLayoutManager::childUnmap(MSWidget *widget_) { if (widget_!=this) { MSLayoutEntry *entry=findMappedEntry(widget_); if (entry!=0) { entry->mapped(MSFalse); removeMappedEntry(entry); adjustSize(); } } } void MSLayoutManager::insertMappedEntry(MSLayoutEntry *entry_) { MSNodeItem *hp=mappedListHead(); MSNodeItem *np=hp; MSBoolean found=MSFalse; while ((np=np->next())!=hp) { if (entry_==(MSLayoutEntry *)np->data()) { found=MSTrue; break; } } if (found==MSFalse) { np=new MSNodeItem((void *)entry_); np->insert(hp); // fifo entry_->mapped(MSTrue); } } void MSLayoutManager::removeMappedEntry(MSLayoutEntry *entry_) { MSNodeItem *hp=mappedListHead(); MSNodeItem *np=hp; while ((np=np->next())!=hp) { if (entry_==(MSLayoutEntry *)np->data()) { entry_->mapped(MSFalse); delete np; break; } } } MSLayoutEntry *MSLayoutManager::findMappedEntry(MSWidget *widget_) { MSNodeItem *hp=mappedListHead(); MSNodeItem *np=hp; MSLayoutEntry *entry; while ((np=np->next())!=hp) { entry=(MSLayoutEntry *) np->data(); if (entry->widget()==widget_) return entry; } return 0; } // this sucks, but we need a const version const MSLayoutEntry *MSLayoutManager::getEntry(MSWidget *widget_) const { MSNodeItem *hp=(MSNodeItem *)childListHead(); MSNodeItem *np=hp; MSLayoutEntry *entry; while ((np=np->next())!=hp) { entry=(MSLayoutEntry *) np->data(); if (entry->widget()==widget_) return entry; } return 0; } MSLayoutEntry *MSLayoutManager::getEntry(MSWidget *widget_) { MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; MSLayoutEntry *entry; while ((np=np->next())!=hp) { entry=(MSLayoutEntry *) np->data(); if (entry->widget()==widget_) return entry; } return 0; } MSLayoutEntry *MSLayoutManager::getEntry(int row_,int col_) { MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; MSLayoutEntry *entry; while ((np=np->next())!=hp) { entry=(MSLayoutEntry *) np->data(); if (entry->at().column()==col_&&entry->at().row()==row_) return entry; } return 0; } void MSLayoutManager::show(void) { if (mapped()==MSFalse) { freeze(); MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; MSLayoutEntry *entry; while((np=np->next())!=hp) { entry=(MSLayoutEntry *)np->data(); if (entry!=0 && (entry->widget()->firstMap()==MSFalse || entry->mapped()==MSTrue)) { entry->widget()->show(); } } map(); } } void MSLayoutManager::firstMapNotify(void) { if (geometry().length()>0||orientation()!=Unspecified) setPositions(); } void MSLayoutManager::map(void) { if (mapped()==MSFalse) { _mapped=MSTrue; if (firstMap()==MSFalse) firstMap(MSTrue); unfreeze(); _mapped=MSFalse; MSWidget::map(); } } void MSLayoutManager::resize(int w_,int h_) { if (mapped()==MSTrue) { if (MSRect::width()!=w_||MSRect::height()!=h_) { int offset=highlightThickness()+shadowThickness(); if (w_>offset) MSRect::width(w_); if (h_>offset) MSRect::height(h_); XResizeWindow(display(),window(),width(),height()); placement(); configure(); childConfigureNotify(); } else { placement(); configure(); } } } void MSLayoutManager::unfreeze(void) { if (firstMap()==MSTrue) { freezeStatus(MSFalse); adjustSize(); } } int MSLayoutManager::realHeight(void) const { int offset=highlightThickness()+shadowThickness()+margin(); return (height()-2*innerHeight()-(rows()-1)*rowSpacing()-2*offset); } int MSLayoutManager::realWidth(void) const { int offset=highlightThickness()+shadowThickness()+margin(); return (width()-2*innerWidth()-(columns()-1)*columnSpacing()-2*offset); } int MSLayoutManager::idealHeight(void) const { int offset=highlightThickness()+shadowThickness()+margin(); return (vectorHeight()+2*innerHeight()+(rows()-1)*rowSpacing()+2*offset); } int MSLayoutManager::idealWidth(void) const { int offset=highlightThickness()+shadowThickness()+margin(); return (vectorWidth()+2*innerWidth()+(columns()-1)*columnSpacing()+2*offset); } void MSLayoutManager::uniformRows(MSBoolean b_) { if (b_!=uniformRows()) { if (b_==MSTrue) _stateFlag|=UniformRows; else _stateFlag&=~UniformRows; adjustSize(); } } void MSLayoutManager::uniformColumns(MSBoolean b_) { if (b_!=uniformColumns()) { if (b_==MSTrue) _stateFlag|=UniformColumns; else _stateFlag&=~UniformColumns; adjustSize(); } } void MSLayoutManager::margin(int margin_) { if (margin_!=margin()) { _margin=margin_; adjustSize(); } } void MSLayoutManager::rowSpacing(int rs_) { if (rs_!=rowSpacing()) { _rowSpacing=rs_; adjustSize(); } } void MSLayoutManager::columnSpacing(int cs_) { if (cs_!=columnSpacing()) { _columnSpacing=cs_; adjustSize(); } } void MSLayoutManager::adjustSize(void) { if (firstMap()==MSTrue&&frozen()==MSFalse) { if (lockPositions()==MSFalse) recomputeVectors(); _vectorState=Minimum; if (lockSize()==MSFalse) resize(idealWidth(),idealHeight()); else { placement(); configure(); } } } void MSLayoutManager::print(const char *file_) { MSBoolean fileOpen=MSFalse; MSBoolean open=MSTrue; if (outputMode()==Draw) { if (file_!=0) displayPrintFileName(file_); if ((open=displayPrintOpen(this))==MSTrue) { fileOpen=MSTrue; outputMode(Print); displayPrintXorigin(0); displayPrintYorigin(0); } } if (open==MSTrue) { clear(); redraw(); MSWidget *pWidget; Window root,parent,*children=(Window *)0; unsigned int nchildren=0; (void)XQueryTree(display(),window(),&root,&parent,&children,&nchildren); for (int i=0;imapped()==MSTrue) { displayPrintOriginInc(pWidget); pWidget->print(); displayPrintOriginDec(pWidget); } } XFree((char *)children); if (fileOpen==MSTrue) { displayPrintClose(); outputMode(Draw); } } } void MSLayoutManager::visibilityObscured(void) { visible(MSFalse); MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; MSLayoutEntry *entry; while((np=np->next())!=hp) { entry=(MSLayoutEntry *)np->data(); if (entry!=0) visibilityObscuredNotify(entry->widget()); } } void MSLayoutManager::visibilityUnobscured(void) { visible(MSTrue); MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; MSLayoutEntry *entry; while((np=np->next())!=hp) { entry=(MSLayoutEntry *)np->data(); if (entry!=0 && entry->mapped()==MSTrue) visibilityUnobscuredNotify(entry->widget()); } } void MSLayoutManager::printChildInfo(void) { MSLayoutEntry *entry; MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; int i=0; MSString opts; cerr<<"entry\trow\tcol\trow span\tcolumn span\toptions\twidth\theight\tmapped"<next())!=hp) { entry=(MSLayoutEntry *)np->data(); opts=entry->at().parsedConstraints(); cerr<at().row()<<"\t"; cerr<at().column()<<"\t"; cerr<at().rowSpan()<<"\t"; cerr<at().columnSpan()<<"\t"; cerr<widget()->width()<<"\t"; cerr<widget()->height()<<"\t"; cerr<widget()->mapped())<y_) { x_-=y_; u+=v; } else { y_-=x_; v+=u; } } return (int)(u+v)>>1; } // compute lcm on a vector of numbers static int lcm(const MSIndexVector& span_) { int n=span_.length(); if (n>0) { int i=0; int x=((int)span_(0)>0)?(int)span_(0):1; for (i=0;i0)?(int)span_(i+1):1); return x; } return 0; } static void computeColumnSpan(int index_,int rows_,int cols_,MSIndexVector& m_,int& col_,int& span_) { int r=0,c=0,span=0,col=0,w=cols_; for (r=0;rat().row(childCount()-1); entry_->at().column(0); } else { entry_->at().row(0); entry_->at().column(childCount()-1); } } else setPositions(); } } MSBoolean MSLayoutManager::setPositions(void) { MSBoolean change=MSFalse; if (firstMap()==MSTrue&&childCount()>0) { if (geometry().length()>0) { const MSIndexVector& aIndexVector=geometry(); int span=0,index=0; int r=0,c=0,i=0; int rows,columns; if (aIndexVector.length()==1) { rows=1; columns=aIndexVector(0); } else { rows=aIndexVector.length(); columns=lcm(aIndexVector); } int w=columns; int nr=childCount(); MSIndexVector matrix(rows*columns); // matrix in ravel order if (rows==1) { rows=nr/columns; rows+=((nr%columns)>0)?1:0; matrix.series(rows*columns); } else if (columns>1) // layout in column major order, row major not yet implemented { for (r=0;r0)?aIndexVector(r):1); for (c=0;cnext())!=hp&&rdata(); if (entry!=0) { ax=entry->at().column(); ay=entry->at().row(); h_span=entry->at().columnSpan(); v_span=entry->at().rowSpan(); mstat=entry->widget()->mapped(); entry->at().column(col); entry->at().row(row); entry->at().columnSpan(hspan); entry->at().rowSpan(vspan); if (hspan==0||vspan==0) { entry->at().columnSpan(1); entry->at().rowSpan(1); entry->widget()->unmap(); } if (ax!=entry->at().column()||ay!=entry->at().row()|| h_span!=entry->at().columnSpan()||v_span!=entry->at().rowSpan()|| mstat!=entry->widget()->mapped()) change=MSTrue; } } } else change=setDefaultPositions(); } return change; } MSBoolean MSLayoutManager::setDefaultPositions(void) { MSBoolean change=MSFalse; if (orientation()!=Unspecified) { int i=0; int r,c,hs,vs; int ax,ay,h_span,v_span; MSBoolean mstat; MSLayoutEntry *entry; MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; while ((np=np->next())!=hp) { hs=1,vs=1; if (orientation()==MSLayoutManager::Vertical) r=i,c=0; else r=0,c=i; entry=(MSLayoutEntry *)np->data(); if (entry!=0) { ax=entry->at().column(),ay=entry->at().row(); h_span=entry->at().columnSpan(),v_span=entry->at().rowSpan(); mstat=entry->widget()->mapped(); entry->at().column(c),entry->at().row(r); entry->at().columnSpan(hs),entry->at().rowSpan(vs); if (ax!=entry->at().column()||ay!=entry->at().row()|| h_span!=entry->at().columnSpan()||v_span!=entry->at().rowSpan()|| mstat!=entry->widget()->mapped()) change=MSTrue; } i++; } } return change; } MSWidgetVector MSLayoutManager::children(void) { MSWidgetVector vector; MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; while ((np=np->next())!=hp) { MSLayoutEntry *entry=(MSLayoutEntry *)np->data(); vector.append(entry->widget()); } return vector; } void MSLayoutManager::set(MSAttrValueList& avList_) { MSManager::set(avList_); MSIndexVector index; for (unsigned i=0;iwidget()); } } void MSLayoutManager::down(void) { MSWidget *focusWidget = inputFocus(); MSLayoutEntry *entry = getEntry(focusWidget); if (entry) { MSLayoutEntry *next = getNextVerticalEntry(entry); if (entry!=next && next!= 0) (void) setFocus(next->widget()); } } void MSLayoutManager::left(void) { MSWidget *focusWidget = inputFocus(); MSLayoutEntry *entry = getEntry(focusWidget); if (entry) { MSLayoutEntry *next = getPrevHorizontalEntry(entry); if (entry!=next && next!= 0) (void) setFocus(next->widget()); } } void MSLayoutManager::right(void) { MSWidget *focusWidget = inputFocus(); MSLayoutEntry *entry = getEntry(focusWidget); if (entry) { MSLayoutEntry *next = getNextHorizontalEntry(entry); if (entry!=next && next!= 0) (void) setFocus(next->widget()); } } // Sorting routines inline void swap(MSLayoutEntry **a_,int i_,int j_) { MSLayoutEntry *t=a_[i_];a_[i_]=a_[j_],a_[j_]=t; } void rowSort(MSLayoutEntry **a_,int n_) { int i,j,min,n=n_; for (i=0;iat().row()at().row()) min=j; } swap(a_,min,i); } } void columnSort(MSLayoutEntry **a_,int n_) { int i,j,min,n=n_; for (i=0;iat().column()at().column()) min=j; } swap(a_,min,i); } } MSLayoutEntry * MSLayoutManager::getNextVerticalEntry(MSLayoutEntry *entry_) { MSLayoutEntry *entry; MSLayoutEntry *next = 0; MSNodeItem *hp=mappedListHead(); MSNodeItem *np=hp; int r = entry_->at().row() + entry_->at().rowSpan(); int c = entry_->at().column(); int i=0, numrows=0; if (r==rows()) r = 0; if (rows()>1) { MSLayoutEntry **entries = new MSLayoutEntry*[rows()]; while ((np=np->next())!=hp) { entry=(MSLayoutEntry *)np->data(); if (entry!=entry_&&entry->at().column()==c) entries[i++]=entry; } numrows=i; rowSort(entries, numrows); for (i=0; i= entry->at().row() && r <= entry->at().row() + entry->at().rowSpan()) { if (entry->widget()->isProtected()==MSFalse) { next = entry; break; } else { r+=entry->at().rowSpan(); if (r==rows()) r=0; } } } for (i=0; i < numrows; i++) entries[i]=0; delete [] entries; } return next; } MSLayoutEntry * MSLayoutManager::getPrevVerticalEntry(MSLayoutEntry *entry_) { MSLayoutEntry *entry; MSLayoutEntry *next = 0; MSNodeItem *hp=mappedListHead(); MSNodeItem *np=hp; int r = entry_->at().row() - 1; int c = entry_->at().column(); int i=0, numrows=0; r = (r<0)? rows()-1:r; if (rows()>1) { MSLayoutEntry **entries = new MSLayoutEntry*[rows()]; while ((np=np->next())!=hp) { entry=(MSLayoutEntry *)np->data(); if (entry!=entry_&&entry->at().column()==c) entries[i++]=entry; } numrows=i; rowSort(entries, numrows); for (i=numrows-1; i>=0;i--) { entry=entries[i]; if (r >= entry->at().row() && r <= entry->at().row() + entry->at().rowSpan()) { if (entry->widget()->isProtected()==MSFalse) { next = entry; break; } else { r--; r=(r<0)?rows()-1:r; } } } for (i=0; i < numrows; i++) entries[i]=0; delete [] entries; } return next; } MSLayoutEntry * MSLayoutManager::getNextHorizontalEntry(MSLayoutEntry *entry_) { MSLayoutEntry *entry; MSLayoutEntry *next = 0; MSNodeItem *hp=mappedListHead(); MSNodeItem *np=hp; int r = entry_->at().row(); int c = entry_->at().column() + entry_->at().columnSpan(); int i=0, numcols=0; if (c==columns()) c=0; if (columns()>1) { MSLayoutEntry **entries = new MSLayoutEntry*[columns()]; while ((np=np->next())!=hp) { entry=(MSLayoutEntry *)np->data(); if (entry!=entry_&&entry->at().row()==r) entries[i++]=entry; } numcols=i; columnSort(entries, numcols); for (i=0; i= entry->at().column() && c <= entry->at().column() + entry->at().columnSpan()) { if (entry->widget()->isProtected()==MSFalse) { next = entry; break; } else { c+=entry->at().columnSpan(); if (c==columns()) c=0; } } } for (i=0; i < numcols; i++) entries[i]=0; delete [] entries; } return next; } MSLayoutEntry * MSLayoutManager::getPrevHorizontalEntry(MSLayoutEntry *entry_) { MSLayoutEntry *entry; MSLayoutEntry *next = 0; MSNodeItem *hp=mappedListHead(); MSNodeItem *np=hp; int r = entry_->at().row(); int c = entry_->at().column()-1; int i=0, numcols=0; c=(c<0)?columns()-1:c; if (columns()>1) { MSLayoutEntry **entries = new MSLayoutEntry*[columns()]; while ((np=np->next())!=hp) { entry=(MSLayoutEntry *)np->data(); if (entry!=entry_&&entry->at().row()==r) entries[i++]=entry; } numcols=i; columnSort(entries, numcols); for(i=numcols - 1; i >= 0; i--) { entry=entries[i]; if (c >= entry->at().column() && c <= entry->at().column() + entry->at().columnSpan()) { if (entry->widget()->isProtected()==MSFalse) { next = entry; break; } else { c--; c=(c<0)?columns()-1:c; } } } for (i=0; i < numcols; i++) entries[i]=0; delete [] entries; } return next; } // ######################################################### // default virtual methods - prevents gratuitous inlining // ######################################################### void MSLayoutManager::configure(void) {} void MSLayoutManager::computeSize(void) { drawBackground(); placement(); drawShadow(); } // ######################################################### // MSLayoutEntry // ######################################################### MSLayoutEntry::MSLayoutEntry(MSWidget *widget_) : _widget(widget_),_mapped(MSFalse) {} MSLayoutEntry::~MSLayoutEntry(void) {} MSWidget *MSLayoutEntry::widget(void) const { return _widget; } MSBoolean MSLayoutEntry::mapped(void) const { return _mapped; } At& MSLayoutEntry::at(void) { return _at; } const At& MSLayoutEntry::at(void) const { return _at; } void MSLayoutEntry::mapped(MSBoolean b_) { _mapped=b_; } MSLayoutVector::MSLayoutVector(void) : _mask(0),_value(0) {} MSLayoutVector::~MSLayoutVector(void) {} unsigned long MSLayoutVector::mask(void) const { return _mask; } int MSLayoutVector::value(void) const { return _value; } void MSLayoutVector::mask(unsigned long mask_) { _mask=mask_; } void MSLayoutVector::value(int value_) { _value=value_; } aplus-fsf-4.22/src/MSGUI/MSList.C0000644000265000001440000013537010772770406011773 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #if defined(MSTK_MANUAL_INSTANTIATION) #include #if defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma instantiate MSGenericVector #endif #if defined(MS_XLC_TEMPLATE_INSTANTIATION) #pragma define(MSGenericVector) #endif #if defined(MS_STD_TEMPLATE_INSTANTIATION) template class MSGenericVector; #endif #if defined(MS_VC_TEMPLATE_INSTANTIATION) template MSGenericVector; #endif #endif //MSTK_MANUAL_INSTANTIATION MSList::MSList(MSWidget *owner_,const char *title_) : MSRowColumnView(owner_,title_) { init(); } MSList::MSList(MSWidget *owner_,const MSStringVector& title_) : MSRowColumnView(owner_,title_) { init(); } MSList::~MSList(void) { if (_pixmapGC!=0) XFreeGC(display(),_pixmapGC); } void MSList::init(void) { _dynamic=MSTrue; _highlightThickness=0; _shadowThickness=2; _shadowStyle=MSSunken; _acceptTab=MSFalse; _rowSpacing=2; _spacing=2; _rowBg=foreground(); _selectedRowForeground=background(); _pixmapGC=0; _maxLength=0; panner()->shadowThickness(shadowThickness()); panner()->shadowStyle(shadowStyle()); } void MSList::update(const MSIndexVector& index_) { if (frozen()==MSFalse) { if (index_.length()==0) { shapeUpdate(); redrawImmediately(); } else { if (numRows()>vsb()->max()) appendUpdate(index_); for (unsigned i=0;ilen)?_maxLength:len; } adjustNumVisible(); } void MSList::shapeUpdate(void) { updateInternalState(); adjustNumVisible(); } void MSList::updateInternalState(void) { adjustSelection(); calculateMaxLength(); } void MSList::adjustSelection(void) { if (selectedRow()>=0&&selectedRow()>=numRows()) _selectedRow=numRows()-1; if (numRows()max()&&selectionMode()==MSMultiple) { unsigned i,index; for (i=numRows();imax();i++) { if ((index=selectionVector().indexOf(i))!=selectionVector().length()) { _selectionVector.removeAt(index); lastBlock(-1); } } } // If we are in multiple selection mode, always make sure the current // selected row is in the selection vector. if (selectionMode()==MSMultiple&& selectedRow()!=-1&& selectionVector().indexOf(selectedRow())==selectionVector().length()) { _selectionVector.append(selectedRow()); _selectionVector.sortUp(); } } void MSList::calculateMaxLength(void) { unsigned nRows=numRows(); _maxLength=0; for (unsigned i=0;ilen)?_maxLength:len; } } void MSList::defaultNumVisible(void) { if ((sizeState()&RowsValid)!=RowsValid) { _rows=5; _rows=(rows()<=numRows())?rows():numRows(); _rows=(rows()<=0)?1:rows(); } if ((sizeState()&ColsValid)!=ColsValid) { int ml=actualNumColumns(); _columns=ml; _columns=(columns()<=ml)?columns():ml; _columns=(columns()<=0)?1:columns(); } } void MSList::computeSize(void) { panner()->shadowThickness(shadowThickness()); if (editor()!=0&&vsb()!=0&&hsb()!=0&&label()!=0) { int offset=highlightThickness()<<1; int poffset=((panner()->highlightThickness()+panner()->shadowThickness())<<1); int dWidth=drawWidth(); int dHeight=drawHeight(); int w=dWidth+poffset+offset; int h=dHeight+headingsHeight()+poffset+offset; if (label()->mapped()==MSTrue) h+=label()->height(); if (dynamic()==MSTrue) { if (isHsbEnabled()==MSTrue&&columns()height()+spacing()); if (isVsbEnabled()==MSTrue&&rows()width()+spacing()); } else { if (isHsbEnabled()==MSTrue) h+=(hsb()->height()+spacing()); if (isVsbEnabled()==MSTrue) w+=(vsb()->width()+spacing()); } resize(w,h); } } void MSList::placement(void) { if (editor()!=0&&vsb()!=0&&hsb()!=0&&label()!=0) { if (editor()->mapped()==MSTrue) unmapEditor(); int offset=highlightThickness(); int offset2=offset<<1; label()->moveTo(offset,offset); label()->width(width()-offset2); editor()->height(rowHeight()); int y=offset; if (label()->mapped()==MSTrue) y+=label()->height(); panner()->moveTo(offset,y); adjustNumVisible(); } } void MSList::adjustNumVisible(void) { if ((sizeState()&AdjustSize)==AdjustSize) { int nCols=actualNumColumns(); if (doubleByte()==MSTrue) nCols=nCols/2; int nRows=numRows(); int margin=(highlightThickness()+panner()->shadowThickness()+panner()->highlightThickness())*2; int availableWidth=width()-margin; int availableHeight=height()-margin-headingsHeight()-(label()->mapped()==MSTrue?label()->height():0); int requiredWidth=nCols*charWidth()+columnSpacing()*2; int requiredHeight=nRows*rowHeight(); if (dynamic()==MSTrue) { if (isHsbEnabled()==MSTrue) { if (availableWidth>=requiredWidth) hsb()->hide(); else { hsb()->show(); availableHeight-=(hsb()->height()+spacing()); } } else hsb()->hide(); if (isVsbEnabled()==MSTrue) { if (availableHeight>=requiredHeight) vsb()->hide(); else { vsb()->show(); if (isHsbEnabled()==MSTrue&&hsb()->mapped()==MSFalse) { availableWidth-=(vsb()->width()+spacing()); if (availableWidthshow(); } } } else vsb()->hide(); } else { if (isHsbEnabled()==MSTrue) availableHeight-=(hsb()->height()+spacing()); if (isVsbEnabled()==MSTrue) availableWidth-=(vsb()->width()+spacing()); if (isVsbEnabled()==MSTrue) { if (availableHeight>=requiredHeight) vsb()->hide(); else vsb()->show(); } else vsb()->hide(); if (isHsbEnabled()==MSTrue) { if (availableWidth>=requiredWidth) hsb()->hide(); else hsb()->show(); } else hsb()->hide(); } int offset=highlightThickness(); int offset2=offset<<1; int pH=height()-offset2-(label()->mapped()==MSTrue?label()->height():0); int pW=width()-offset2; if (isVsbEnabled()==MSTrue) { if (dynamic()==MSFalse||vsb()->mapped()==MSTrue) pW-=(vsb()->width()+spacing()); } if (isHsbEnabled()==MSTrue) { if (dynamic()==MSFalse||hsb()->mapped()==MSTrue) pH-=(hsb()->height()+spacing()); } panner()->resize(pW,pH); offset=panner()->highlightThickness()+panner()->shadowThickness(); offset2=offset<<1; XRectangle clipRect[1]; clipRect[0].x=offset; clipRect[0].y=offset; clipRect[0].width=panner()->width()-offset2; clipRect[0].height=panner()->height()-offset2; XSetClipRectangles(display(),textGC(),0,0,&clipRect[0],1,Unsorted); _rows=computeNumVisibleRows(); _rows=(rows()<0)?0:rows(); _columns=computeNumVisibleColumns(); _columns=(columns()<0)?0:columns(); adjustFirstRow(); adjustFirstColumn(); updateHsb(); updateVsb(); } } void MSList::drawRow(int row_) { if (row_window(),row_,row_); } void MSList::drawRows(int rs_,int re_) { drawRows(panner()->window(),rs_,re_); } void MSList::drawRows(Window window_,int rs_,int re_) { if (numRows()>0&&mapped()!=MSFalse&&frozen()!=MSTrue) { rs_=(rs_>=firstRow())?rs_:firstRow(); re_=(re_window(),row_,selected_); } void MSList::drawSelectOutline(Window window_,int row_,MSBoolean select_) { if (row_>=firstRow()&&row_shadowThickness()+panner()->highlightThickness(); int yy=computeYCoord(row_); int ww=panner()->width()-(offset*2); int hrs=rowSpacing()/2; int hcs=columnSpacing()/2; XSetForeground(display(),textGC(),rowBackground(row_)); XDrawRectangle(display(),window_,textGC(),offset+hrs,yy+hcs, ww-rowSpacing()-hrs,rowHeight()-columnSpacing()-hcs); if (select_==True) XSetForeground(display(),textGC(),selectedRowBackgroundColor(row_)); XDrawRectangle(display(),window_,textGC(),offset,yy,ww-hrs,rowHeight()-hcs); } } void MSList::adjustFirstColumn(void) { int ml=actualNumColumns(); if (firstColumn()!=0&&firstColumn()+columns()>=ml) { int oldFirstColumn=firstColumn(); _firstColumn=(ml>columns())?(ml-columns()):0; if(oldFirstColumn!=firstColumn()) firstColumnChangeNotify(); } } unsigned MSList::rowLength(unsigned) const { return 0; } int MSList::drawWidth(void) { return maxPixmapWidth()+(columns()*charWidth())+2*columnSpacing(); } int MSList::computeNumVisibleColumns(void) { int offset=panner()->highlightThickness()+panner()->shadowThickness(); int deltaWidth=panner()->width()-2*offset-2*columnSpacing(); return (int)(floor((double)deltaWidth/(double)charWidth())); } // subclasses should override this method for incremental search capability void MSList::incrementalSearch(unsigned) {} void MSList::keyPress(const XEvent *pEvent_,KeySym keysym_,unsigned int state_,const char *pString_) { MSKeyPress keyTranslation(keysym_,state_); if (sensitive()==MSTrue&&hasModel()==MSTrue) { if (isProtected()==MSFalse) MSRowColumnView::keyPress(pEvent_,keysym_,state_,pString_); else { int slen=(pString_!=0)?strlen(pString_):0; if (slen==0&& (keysym_==XK_Control_L||keysym_==XK_Control_R|| keysym_==XK_Meta_L||keysym_==XK_Meta_R|| keysym_==XK_Shift_L||keysym_==XK_Shift_R)) return; if (pEvent_->xkey.state&ControlMask&&keysym_==XK_s&&isearchString().length()>0) { incrementalSearch(1); } else if (keysym_==XK_Delete||keysym_==XK_BackSpace) { isearchString().drop(-1); isearchVector().drop(-1); if (isearchVector().length()>0) selectedRow(isearchVector().lastElement()); } else if (keysym_!=XK_Return&&slen>0) { isearchString()<bell(); } } } } } void MSList::defaultButtonBehavior(const XEvent *pEvent_) { isearchString()=""; isearchVector().removeAll(); if (pEvent_->xbutton.subwindow==panner()->window()) { if (traverseFocus(this)==MSTrue||acceptFocus()==MSFalse) { if (numRows()>0) { if (editorActivate()==MSTrue) { // recompute the the (x,y) of the event relative to the // position of the panner XEvent *pEvent=(XEvent *)pEvent_; pEvent->xbutton.y-=panner()->y_origin(); pEvent->xbutton.x-=panner()->x_origin(); if (pEvent->xbutton.yxbutton.subwindow); if (pWidget!=0) { if (pWidget->sensitive()==MSTrue) { XEvent *pEvent=(XEvent *)pEvent_; pEvent->xbutton.x-=pWidget->x_origin(); pEvent->xbutton.y-=pWidget->y_origin(); buttonPressNotify(pWidget,pEvent); } } } } void MSList::headingAreaSelection(const XEvent *) {} void MSList::dataAreaSelection(const XEvent *pEvent_) { int row=rowFromEvent(pEvent_); if (row>=0) { if (rowxbutton.button==Button1) { toggleRow(row); drawRow(row); } } else if (selectedRow()!=row) { if (pEvent_->xbutton.button==Button1) { eventTime(pEvent_->xbutton.time); if (selectionMode()==MSMultiple) { // if control key is held down if (pEvent_->xbutton.state&ControlMask) { // Control is held down, so check if the selected item is in // the selection vector, if so, track erase selection, else // track selection if (selectionVector().indexOf(row)!=selectionVector().length()) trackUnselection(row,0); else trackSelection(row,0,MSFalse,MSFalse); } else { // if Shift key is held down if (pEvent_->xbutton.state&ShiftMask) trackSelection(row,0,MSFalse,MSTrue); else trackSelection(row,0,MSTrue,MSFalse); } } else { clearSelection(); selectedRow(row); } } else { clearSelection(); if (selectionMode()==MSMultiple) { lastBlock(row); _selectionVector.append(row); } selectedRow(row); } } else if (selectedRow()==row) { if (pEvent_->xbutton.button==Button1) { if (isDoubleClick(pEvent_)==MSTrue) defaultDoubleClickBehavior(pEvent_); else if (selectionMode()==MSMultiple) { // if control key is held down, track erase selection if (pEvent_->xbutton.state&ControlMask) trackUnselection(row,0); else { if (pEvent_->xbutton.state&ShiftMask) trackSelection(row,0,MSFalse,MSTrue); else trackSelection(row,0,MSTrue,MSFalse); } } else { if (pEvent_->xbutton.state&ControlMask) { selectedRow(-1); rowColumnSelection(); } } return; } else if (pEvent_->xbutton.button!=Button1) { // Let's clear the selection Vector first if (selectionMode()==MSMultiple) { if (selectionVector().length()>1) { clearSelection(); lastBlock(row); _selectionVector.append(row); drawSelectedRow(panner()->window(),row); rowColumnSelection(); } } } } if (pEvent_->xbutton.button==Button1) defaultButton1Behavior(pEvent_); else if (pEvent_->xbutton.button==Button2) defaultButton2Behavior(pEvent_); else if (pEvent_->xbutton.button==Button3) defaultButton3Behavior(pEvent_); } } } void MSList::defaultButton2Behavior(const XEvent *pEvent_) { if (rowDragDrop()==MSTrue) dragRow(pEvent_); else if(selectionMode()!=MSToggle) startEditing(pEvent_); } int MSList::dragRowFromEvent(const XEvent* pEvent_) { int row; if(selectionMode()==MSToggle) { row=rowFromEvent(pEvent_); if (row<0 || row>=numRows() || row>=firstRow()+rows()) return -1; } else row=selectedRow(); return row; } void MSList::moveRow(int from_,int to_) { if(selectionMode()==MSToggle) { toggleModeMoveRow(from_,to_); return; } unsigned len=pixmapVector().length(); if (from_=pixmapVector().length()) pixmapVector().append(element); else pixmapVector().insertAt(to_,element); } else { pixmapVector().insertAt(to_,element); } } _selectedRow=to_; if (selectionMode()==MSMultiple) (_selectionVector.removeAll())<lock(); XFillRectangle(display(),redrawPixmap()->pixmap(),backgroundShadowGC(), 0,0,panner()->width(),panner()->height()); drawRows(redrawPixmap()->pixmap(),firstRow(),firstRow()+rows()-1); int ht=panner()->highlightThickness(); int offset=highlightThickness(); MSRect aRect(ht,ht,panner()->width()-2*ht,panner()->height()-2*ht); drawBevel(redrawPixmap()->pixmap(),aRect,shadowStyle(),panner()->shadowThickness()); XCopyArea(display(),redrawPixmap()->pixmap(),panner()->window(), backgroundShadowGC(), 0,0,panner()->width(),panner()->height(),0,0); updateScrollBars(); XFlush(display()); redrawPixmap()->unlock(); } } void MSList::drawSelectedRow(Window window_,int row_,MSBoolean select_) { if (row_>=firstRow()&&(selectedRow()==-1||selectedRow()window(),selectedRow(),highlighted()); if (editor()->mapped()==MSTrue) focusInNotify(editor()); } void MSList::focusOut(void) { unHighlight(); drawSelectOutline(panner()->window(),selectedRow(),highlighted()); if (editor()->mapped()==MSTrue) focusOutNotify(editor()); } MSBoolean MSList::loseFocus(void) { if (editor()->mapped()==MSTrue) editorActivate(); if (editor()->mapped()==MSTrue) return MSFalse; else { unHighlight(); drawSelectOutline(panner()->window(),selectedRow(),highlighted()); } return MSTrue; } void MSList::doubleClick(void) { if (editor()->mapped()==MSFalse) { if (selectedRow()>=0&&selectedRow()row(); unsigned long fg=cycle_->color(cycle_->count()); if (row==-1) { int first=firstRow(); int last=lastRow(); last=(last>numRows()?numRows():last); for (int i=first;i<=last;i++) drawCycle(i,fg); } else if (rowwindow(),row_,pString,len,pmap,fg_,bg,fid, rowselected,selectOutline); } void MSList::drawSelected(int row_) { MSString buffer; const char *pString=formatOutput(buffer,row_); int len=buffer.length(); const MSPixmap *pmap; unsigned long fg=selectedRowForegroundColor(row_); unsigned long bg=selectedRowBackgroundColor(row_); Font fid=rowFont(row_); pmap=rowPixmap(row_); drawActualRow(panner()->window(),row_,pString,len,pmap,fg,bg,fid,MSTrue,MSFalse); } void MSList::undrawSelected(int row_) { MSString buffer; const char *pString=formatOutput(buffer,row_); int len=buffer.length(); unsigned long fg=rowForeground(row_); unsigned long bg=rowBackground(row_); Font fid=rowFont(row_); const MSPixmap *pmap=rowPixmap(row_); drawActualRow(panner()->window(),row_,pString,len,pmap,fg,bg,fid,MSFalse,MSFalse); } void MSList::trackSelection(int startRow_,int,MSBoolean clear_,MSBoolean shifted_) { Window root,child; int rx=0,ry=0,ix=0,iy=0; unsigned keys=0; int i,row,fr,lr; unsigned int index; int lastSelectedRow=startRow_; MSIndexVector oldsel=selectionVector(); int previousSelectedRow=selectedRow(); if (clear_==MSTrue) clearSelection(); moveSelection(-1); if (shifted_==MSTrue&&lastBlock()!=-1&&previousSelectedRow!=-1) { MSBoolean inside; if (previousSelectedRow>lastBlock()) inside=(startRow_>=lastBlock()&&startRow_<=previousSelectedRow)?MSTrue:MSFalse; else inside=(startRow_<=lastBlock()&&startRow_>=previousSelectedRow)?MSTrue:MSFalse; if (inside==MSTrue) { if (startRow_lastBlock()) unfillSelection(lastBlock()+1,previousSelectedRow); } else { fillSelection(lastBlock()+1,startRow_-1); if (previousSelectedRowlastBlock()) { if ((index=selectionVector().indexOf(lastBlock()+1))!=selectionVector().length()) _selectionVector.removeAt(index,previousSelectedRow-lastBlock()); } else { if ((index=selectionVector().indexOf(previousSelectedRow))!=selectionVector().length()) _selectionVector.removeAt(index,lastBlock()-previousSelectedRow); } startRow_=lastBlock(); drawSelected(lastSelectedRow); } else { lastBlock(startRow_); drawSelected(lastSelectedRow); } int startSelect,endSelect; MSIndexVector drawnVector; //Vector to keep track of which line is already drawn selected if (lastSelectedRow>lastBlock()) { startSelect=lastBlock(); endSelect=lastSelectedRow; } else { startSelect=lastSelectedRow; endSelect=lastBlock(); } fr=firstRow(); lr=lastRow(); lr=(lr>numRows()?numRows():lr); for (i=fr;i<=lr;i++) { if (selected(i)==MSTrue||(i>=startSelect&&i<=endSelect)) drawnVector<y_origin(); if (iy0) { // To prevent flashing if (row>startRow_) { if (selected(row)==MSFalse) { if ((index=drawnVector.indexOf(row))!=drawnVector.length()) { undrawSelected(row); drawnVector.removeAt(index); } } } scrollDown(1); row=firstRow(); } } else if (iy>=panner()->height()) { if ((row=lastRow())=numRows()) row=numRows()-1; else if (inRowRange(row)==MSFalse) row--; } if (row!=lastSelectedRow) { lastSelectedRow=row; if (row>startRow_) { startSelect=startRow_; endSelect=row; } else { startSelect=row; endSelect=startRow_; } MSIndexVector dv; fr=firstRow(); lr=lastRow(); lr=(lr>numRows()?numRows():lr); for (i=fr;i<=lr;i++) { // Not in the selection if (iendSelect) { // If it is selected but not in our Drawn Vector draw it. if (selected(i)==MSTrue) { dv<numRows()?numRows():lr); undrawnVector<y_origin(); if (iy0) { if (row>startRow_) { if (selected(row)==MSTrue) { if ((index=undrawnVector.indexOf(row))!=undrawnVector.length()) { drawSelected(row); undrawnVector.removeAt(index); } } } scrollDown(1); row=firstRow(); undrawSelected(row); if (selected(row)==MSTrue) undrawnVector<=panner()->height()) { if ((row=lastRow())=numRows()) row=numRows()-1; else if (inRowRange(row)==MSFalse) row--; } if (row!=lastSelectedRow) { lastSelectedRow=row; if (row>startRow_) { startSelect=startRow_; endSelect=row; } else { startSelect=row; endSelect=startRow_; } MSIndexVector dv; fr=firstRow(); lr=lastRow(); lr=(lr>numRows()?numRows():lr); for (i=fr;i<=lr;i++) { // Not in the selection if (iendSelect) { // If it is selected but in our UnDrawn Vector draw it if (selected(i)==MSTrue) { if (undrawnVector.indexOf(i)!=undrawnVector.length()) drawSelected(i); } } else { if (selected(i)==MSTrue) { dv<scrollIndex(firstColumn()); if (editor()->mapped()==MSTrue) { ep->xbutton.x-=editor()->x_origin(); ep->xbutton.y-=editor()->y_origin(); buttonPressNotify(editor(),ep); } } void MSList::moveEditorToSelection(const MSString &aString_) { if (selectedRow()shadowThickness()+panner()->highlightThickness(); int x=panner()->x_origin()+offset; int y=computeYCoord(selectedRow())+panner()->y_origin(); int w=panner()->width()-offset*2; if (w>panner()->width()-2*offset) w=panner()->width()-2*offset; Font fid=font(); editor()->font(fid); if (aString_.length()>0) { MSString aString2(aString_); aString2.stripTrailing(); editor()->string(aString2); } else editor()->editMode(MSTextField::InsertMode); editor()->resize(w,rowHeight()); editor()->moveTo(x,y); mapEditor(); } } } void MSList::edit(void) { if (editor()->mapped()==MSFalse) { if (selectedRow()editMode(MSTextField::InsertMode); MSString string=selection(); int len=string.length(); moveEditorToSelection(string); if (len>columns()) editor()->scrollIndex(len-columns()); else editor()->scrollIndex(0); } } } } MSAttrValueList& MSList::get(MSAttrValueList& avList_) { avList_<colorName(selectedRowForeground()), MSAttrValue::Color); return MSRowColumnView::get(avList_); } void MSList::set(MSAttrValueList& avList_) { MSRowColumnView::set(avList_); MSIndexVector index; for (unsigned i=0;ihighlightThickness()+panner()->shadowThickness(); int h=panner()->height()-2*offset-headingsHeight(); int r=0; while (h>=rowHeight()) { r++; h-=rowHeight(); } return r; } void MSList::moveSelection(int row_) { int oldRow=selectedRow(); if (row_==-1) { _selectedRow=row_; undrawSelectedRow(panner()->window(),oldRow); } else if (row_!=selectedRow()) { _selectedRow=row_; undrawSelectedRow(panner()->window(),oldRow); drawSelectedRow(panner()->window(),selectedRow()); } else drawSelectedRow(panner()->window(),selectedRow()); } void MSList::rowColumnSelection(void) { activateCallback(MSWidgetCallback::selection); } void MSList::undrawSelectedRow(Window window_,int row_) { drawSelectedRow(window_,row_,MSFalse); } void MSList::updateScrollBars(void) { if (firstRow()!=vsb()->value()) vsb()->valueChange(firstRow()); if (firstColumn()!=hsb()->value()) hsb()->valueChange(firstColumn()); } void MSList::createCycle(int row_) { if (numRows()>0) { if (cycleList().length()!=0) processCycleTimer(); if (inRowRange(row_)==MSTrue) { if (cycleColors().length()>0||cycleColorMode()==MSReverseVideo) startCycle(row_,0,cycleColors(),cycleColorMode()); else drawRow(row_); } if (cycleList().length()!=0) { if (cycleTimer()==0) _cycleTimer=new CycleTimer(this,cycleInterval()); else cycleTimer()->reset(); } } } MSBoolean MSList::editorActivate(void) { if (editor()->mapped()==MSTrue) { if (validate(editor()->string(),selectedRow())==MSTrue) { unmapEditor(); } } return (editor()->mapped()==MSTrue)?MSFalse:MSTrue; } int MSList::drawHeight(void) { return rows()*rowHeight(); } void MSList::updateVsb(void) { vsb()->max(numRows()); vsb()->valueChange(firstRow()); vsb()->viewSize(rows()); vsb()->pageInc(rows()-1); vsb()->moveTo(panner()->x_origin()+panner()->width()+spacing(), panner()->y_origin()+headingsHeight()); vsb()->height(panner()->height()-headingsHeight()); } void MSList::updateHsb(void) { int ml=actualNumColumns(); if (doubleByte()==MSTrue) ml=ml/2; hsb()->max(ml); hsb()->valueChange(firstColumn()); hsb()->viewSize(columns()); hsb()->pageInc(columns()-1); hsb()->moveTo(panner()->x_origin(),panner()->y_origin()+panner()->height()+spacing()); hsb()->width(panner()->width()); } void MSList::hsbValueUpdate(void) { if (editorActivate()==MSTrue) { if (hsb()->value()value()); else if (hsb()->value()>firstColumn()) scrollRight(hsb()->value()-firstColumn()); } else updateScrollBars(); } void MSList::vsbValueUpdate(void) { if (editorActivate()==MSTrue) { if (vsb()->value()value(),selectedRow()); else if (vsb()->value()>firstRow()) scrollUp(vsb()->value()-firstRow(),selectedRow()); } else updateScrollBars(); } void MSList::updateSelectedRow(int row_) { if(selectionMode()==MSToggle) return; int row=selectedRow(); if (row_>=0&&row_lastRow()) scrollUp(row_-(firstRow()+rows())+1,row_); else if (row_=numrows) { newVector.drop(i-newVector.length()); break; } } const MSIndexVector osv=selectionVector(); // make a local copy of old select vector _selectionVector=newVector; for (i=0;icount()==cycle_->numCycles()) drawRow(cycle_->row()); else drawCycle(cycle_); } void MSList::updateFirstRow(int row_) { int oldFirstRow=firstRow(); if (row_<0) row_=0; else if (row_>=numRows()) row_=numRows()-1; if (row_>=0&&row_diff)?diff:row_; _firstRow=(firstRow()>=0)?firstRow():0; redrawImmediately(); if (selectedRow()>=0&&selectedRow()>=numRows()) selectedRow(numRows()-1); } if (oldFirstRow!=firstRow()) firstRowChangeNotify(); } void MSList::updateFirstColumn(int column_) { int oldFirstColumn=firstColumn(); if (column_<0) column_=0; else if (column_>=actualNumColumns()) column_=actualNumColumns()-1; if (column_actualNumColumns()-columns())?actualNumColumns()-columns():column_; _firstColumn=(firstColumn()>=0)?firstColumn():0; redrawImmediately(); if (oldFirstColumn!=firstColumn()) firstColumnChangeNotify(); // otherwise called in adjustFirstColumn } } const char *MSList::formatOutput(MSString &buffer_,unsigned) { return buffer_.string();} unsigned long MSList::rowForeground(unsigned row_) { if (foregroundColors().length()==0) return foreground(); else return foregroundColors()(row_%foregroundColors().length()); } unsigned long MSList::rowBackground(unsigned row_) { if (backgroundColors().length()==0) return background(); else return backgroundColors()(row_%backgroundColors().length()); } Font MSList::rowFont(unsigned) { return font(); } MSBoolean MSList::isRowProtected(unsigned r_) { return isProtected(r_); } //For backward compatibility only MSBoolean MSList::isProtected(unsigned) { return MSRowColumnView::isProtected(); } MSBoolean MSList::isProtected(void) const { return MSRowColumnView::isProtected(); } MSBoolean MSList::validate(const char *,unsigned) { return MSFalse; } void MSList::calculateRowHeight(void) { int tHeight=textHeight(); int pHeight=maxPixmapHeight(); int h=(tHeight>pHeight)?tHeight:pHeight; rowHeight(h+2*rowSpacing()); } const MSPixmap *MSList::rowPixmap(unsigned row_) { if(selectionMode()==MSToggle) { if (selected(row_)==MSTrue) { if(pixmapVector().length()>0) return pixmapVector()(0); } else if(pixmapVector().length()>1) return pixmapVector()(1); return 0; } else { if (row_0) { return (int)(ceil((double)w/(double)charWidth())); } else return 0; } int MSList::actualNumColumns(void) { return numPixmapColumns()+numColumns(); } GC MSList::pixmapGC(void) { if (_pixmapGC==0) { XGCValues values; _pixmapGC=XCreateGC(display(),window(),0,&values); } return _pixmapGC; } void MSList::scrollRight(int count_) { int numCols=actualNumColumns(); if (firstColumn()+columns()0) { if (firstColumn()+columns()+count_>numCols) { count_=numCols-(firstColumn()+columns()); } _firstColumn+=count_; redrawImmediately(); firstColumnChangeNotify(); } } void MSList::right(void) { if (editorActivate()==MSTrue) { if (firstColumn()+columns()-1=firstRow()&&row_highlightThickness()+panner()->shadowThickness(); int xoff=offset+columnSpacing(); int yy=computeYCoord(row_)+rowSpacing(); int xx=xoff-(firstColumn()*charWidth()); int ww=panner()->width()-(offset*2); //First fill the background, the size of the rectangle is dependent on //whether the row is selected or not if (selected_==MSTrue) { int selectedRowHeight=rowHeight()-2*rowSpacing(); XSetForeground(display(),textGC(),bg_); XFillRectangle(display(),window_,textGC(),xoff,yy, ww-(columnSpacing()<<1),selectedRowHeight); } else { XSetForeground(display(),textGC(),bg_); XFillRectangle(display(),window_,textGC(),offset,yy-rowSpacing(), ww,rowHeight()); } //Draw the pixmap if it is there if (pmap_!=0) { int tHeight=textHeight(); int pHeight=pmap_->height(); int startx=xx; int starty=yy; if (tHeight>pHeight) starty+=((tHeight-pHeight)/2); else yy+=((pHeight-tHeight)/2); int pw=maxPixmapWidth(); //Optimization: if pixmap is completely offscreen, why draw it if (startx+pw>=xoff) { GC gc=pixmapGC(); XSetForeground(display(),gc,fg_); XSetBackground(display(),gc,bg_); int psx=xoff-startx; int psw=pw-psx; copyPixmap(display(),*pmap_,window_,gc,psx,0,psw,pmap_->height(), xoff,starty,startx,starty); } } xx+=(numPixmapColumns()*charWidth()); //Draw the string if (pString_!=0&&slen_>0) { XSetForeground(display(),textGC(),fg_); XSetFont(display(),textGC(),font_); const XFontStruct *fontStruct=(font_==font()? textFontStruct(): server()->fontStruct(font_)); drawString(display(),window_,textGC(),fontStruct, xx,yy+textAscent(),pString_,slen_); } if (selectOutline_==MSTrue) drawSelectOutline(window_,row_,highlighted()); else if (selected_==MSTrue) drawSelectOutline(window_,row_,MSFalse); } } void MSList::drawString(Display *display_,Window window_,GC gc_,const XFontStruct *fs_, int x_,int y_,const char *pString_,int len_) { XDrawString(display_,window_,gc_,fs_,x_,y_,pString_,len_); } void MSList::registerPixmap(const MSPixmap &pixmap_) { pixmapRegistry().add(pixmap_); } void MSList::unregisterPixmap(const MSString &pixmapName_) { pixmapRegistry().remove(pixmapName_); } const MSPixmap* MSList::pixmap(const MSString& pixmapName_) { return (MSPixmap*)pixmapRegistry().lookup(pixmapName_); } void MSList::pixmapList(const MSStringVector &pixmapList_) { unsigned len=pixmapList_.length(); _pixmapVector.reshape(len); for (unsigned i=0;iname(); } return list; } MSList::PixmapRegistry::PixmapRegistry(unsigned size_) :MSHashTable(size_),_maxPixmapWidth(0),_maxPixmapHeight(0) {} MSList::PixmapRegistry::~PixmapRegistry(void) { for (unsigned i=0;inext(); data=(MSPixmap *)entry->value(); if (data!=0) delete data; delete entry; entry=bucket(i); } _bucket[i]=0; } if (_bucket!=0) delete [] _bucket; _size=0; _bucket=0; } void MSList::PixmapRegistry::remove(const MSString &name_) { MSPixmap *oldPix= (MSPixmap*)lookup(name_); if(oldPix!=0) { MSHashTable::remove(name_); if(oldPix->width()==_maxPixmapWidth||oldPix->height()==_maxPixmapHeight) { // recalculate maximum sizes. _maxPixmapHeight=0; _maxPixmapWidth=0; MSPixmap *pix; for (unsigned i=0;ivalue(); _maxPixmapWidth=(pix->width()>_maxPixmapWidth)?pix->width():_maxPixmapWidth; _maxPixmapHeight=(pix->height()>_maxPixmapHeight)?pix->height():_maxPixmapHeight; entry=entry->next(); } } } delete oldPix; } } void MSList::PixmapRegistry::add(const MSPixmap &pixmap_) { if (lookup(pixmap_.name())==0) { MSHashTable::add(pixmap_.name(),new MSPixmap(pixmap_)); _maxPixmapWidth=(pixmap_.width()>_maxPixmapWidth)?pixmap_.width():_maxPixmapWidth; _maxPixmapHeight=(pixmap_.height()>_maxPixmapHeight)?pixmap_.height():_maxPixmapHeight; } } void MSList::toggleRow(unsigned row_) { unsigned index=_selectionVector.indexOf(row_); if (index<_selectionVector.length()) { _selectionVector.removeAt(index); } else { _selectionVector<0) { MSBoolean selected; unsigned index=_selectionVector.indexOf(from_); if (indexfrom_) { if (index<=to_) _selectionVector[i]=index-1; else break; } } } else { for (unsigned i=0;i=to_) { if (index= 0) { if(_selectionVector.length()==0) _selectionVector.append(selectedRow()); else _selectionVector.sortUp(); _selectedRow=-1; } } redraw(); } else { MSRowColumnView::updateSelectionMode(selectionMode_); } } void MSList::updateBackground(unsigned long oldBg_) { if(oldBg_==selectedRowForeground()) selectedRowForeground(background()); MSRowColumnView::updateBackground(oldBg_); } unsigned long MSList::selectedRowBackgroundColor(int row_) { return selectedRowBackground(); } unsigned long MSList::selectedRowForegroundColor(int row_) { if(selectedRowForeground()!=background()) return selectedRowForeground(); else return rowBackground(row_); } void MSList::selectedRowForeground(const char *fg_) { selectedRowForeground(server()->pixel(fg_)); } void MSList::selectedRowForeground(unsigned long fg_) { if (_selectedRowForeground!=fg_) { _selectedRowForeground=fg_; redraw(); } } int MSList::clearSelection(void) { if(selectionMode()==MSToggle) return 0; else return MSRowColumnView::clearSelection(); } void MSList::up(void) { if(selectionMode()==MSToggle) { if(firstRow()>0) firstRow(firstRow()-1); } else MSRowColumnView::up(); } void MSList::down(void) { if(selectionMode()==MSToggle) { if(rows() static const int MSManagerDefaultShadowThickness=2; static const int MSManagerDefaultHighlightThickness=0; static const unsigned long MSManagerEventMask=(ExposureMask); MSManager::MSManager(MSWidget *owner_) : MSWidgetCommon(owner_) { init(); } MSManager::~MSManager(void) { MSNodeItem *hp=childListHead(); MSNodeItem *np; MSWidget *wid; // delete the widget after the node has been removed from the list // this will prevent childDestroy from causing damage while ((np=hp->next())!=hp) { wid=(MSWidget *)np->data(); delete np; if (wid!=0) safeDestroy(wid); _childCount--; } } void MSManager::init(void) { _childCount=0; _shadowThickness=MSManagerDefaultShadowThickness; _highlightThickness=MSManagerDefaultHighlightThickness; shadowStyle(MSRaised); selectInput(MSManagerEventMask); } void MSManager::redraw(void) { drawShadow(); } void MSManager::placement(void) {} void MSManager::configure(void) { placement(); } void MSManager::childInsert(MSWidget *widget_) { childCreate(widget_); } void MSManager::childRemove(MSWidget *widget_) { childDestroy(widget_); } void MSManager::childCreate(MSWidget *widget_) { MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; MSBoolean found=MSFalse; while (found==MSFalse&&(np=np->next())!=hp) { if ((MSWidget *)np->data()==widget_) { found=MSTrue; np=hp->prev(); } } if (widget_!=0&&found!=MSTrue) { MSNodeItem *np=new MSNodeItem((void *)widget_); np->insert(hp->next()); _childCount++; } } // a child has been destroyed-remove it from the child list void MSManager::childDestroy(MSWidget *widget_) { MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; while ((np=np->next())!=hp) { if ((MSWidget *)np->data()==widget_) { delete np; _childCount--; np=hp->prev(); } } } void MSManager::print(const char *file_) { MSBoolean fileOpen=MSFalse; MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; MSWidget *wid; if (outputMode()==Draw) { if (file_!=0) displayPrintFileName(file_); if (displayPrintOpen(this)==MSTrue) { fileOpen=MSTrue; outputMode(Print); displayPrintXorigin(0); displayPrintYorigin(0); } else return; } if (mapped()==MSTrue) redraw(); while ((np=np->next())!=hp) { wid=(MSWidget *) np->data(); if (wid!=0&&wid->mapped()==MSTrue) { displayPrintOriginInc(wid); wid->print(); displayPrintOriginDec(wid); } } if (fileOpen==MSTrue) { displayPrintClose(); outputMode(Draw); } } void MSManager::show(void) { if (mapped()==MSFalse) { MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; MSWidget *wid; while((np=np->next())!=hp) { wid=(MSWidget *)np->data(); wid->show(); } map(); } } void MSManager::visibilityObscured(void) { visible(MSFalse); MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; MSWidget *wid; while((np=np->next())!=hp) { wid=(MSWidget *)np->data(); visibilityObscuredNotify(wid); } } void MSManager::visibilityUnobscured(void) { visible(MSTrue); MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; MSWidget *wid; while((np=np->next())!=hp) { wid=(MSWidget *)np->data(); visibilityUnobscuredNotify(wid); } } void MSManager::updateBackground(unsigned long oldbg_) { MSWidgetCommon::updateBackground(oldbg_); if (mapped()==MSTrue) redraw(); } MSWidgetVector MSManager::children(void) { MSWidgetVector vector; MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; while ((np=np->next())!=hp) vector.append((MSWidget *)np->data()); return vector; } aplus-fsf-4.22/src/MSGUI/MSMenu.C0000644000265000001440000006273410772770406011767 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include static const int MSMenuDefaultShadowThickness=2; static const unsigned long MSMenuEventMask=(ExposureMask|ButtonPressMask|ButtonReleaseMask|ButtonMotionMask); static const unsigned int grabMask=(unsigned int)(ButtonPressMask|ButtonReleaseMask|ButtonMotionMask); MSMenu::MSMenuList MSMenu::_menuList; MSMenu::MSMenu(MSWidget *owner_) : MSWidgetCommon(owner_), _parentMenuItem(0) { init(); } MSMenu::MSMenu(MSDisplayServer *server_) : MSWidgetCommon(server_) , _parentMenuItem(0) { initFromServer(server_); init(); } MSMenu::MSMenu(MSMenuItem * parentMenuItem_) : MSWidgetCommon(parentMenuItem_->server()), _parentMenuItem(parentMenuItem_) { initFromServer(parentMenuItem_->server()); init(); } void MSMenu::initFromServer(MSDisplayServer*) { XSetWindowAttributes attrs; attrs.backing_store=NotUseful; attrs.save_under=(int)MSTrue; attrs.override_redirect=(int)MSTrue; XChangeWindowAttributes(display(),window(),CWSaveUnder|CWBackingStore|CWOverrideRedirect,&attrs); } MSMenu::~MSMenu(void) { freeze(); removeAllItems(); } void MSMenu::removeAllItems(void) { freeze(); _selectedItem=-1; int i,n; MSMenuItem *mi; _itemVector<<_hiddenItemVector; _hiddenItemVector.removeAll(); n=itemVector().length(); for(i=0;imenuGrabCursor()==0) { server()->menuGrabCursor(new MSDisplayCursor(server(),XC_arrow, server()->pixel("black"),server()->pixel("white"))); } } void MSMenu::unmap(void) { if (mapped()==MSTrue) { menuList().removeFromList(this); pulldownMenus(); MSWidgetCommon::unmap(); reset(); } } void MSMenu::map(void) { if (mapped()==MSFalse) { menuList().addToList(this); MSWidgetCommon::map(); XFlush(display()); } } void MSMenu::pulldownMenus(void) { int i,n; n=itemVector().length(); MSMenuItem *mi; for(i=0;icascade()==MSTrue) mi->disarm(); } } void MSMenu::columns(unsigned columns_) { if (columns_>0&&_columns!=columns_) { _columns=columns_; computeSize(); } } void MSMenu::radioBehavior(MSBoolean radioBehavior_) { if (radioBehavior()!=radioBehavior_) _radioBehavior=radioBehavior_; } void MSMenu::enforceRadioBehavior(void) { if (radioBehavior()==MSTrue) { MSMenuItem *mi; MSMenuItem *ami=activeMenuItem(); int i,n = itemVector().length(); for (i=0;iradioDisarm(); } } } void MSMenu::updateBackground(unsigned long oldbg_) { MSWidgetCommon::updateBackground(oldbg_); int i,n; n=itemVector().length(); MSMenuItem *mi; for(i=0;ibackground()==oldbg_) mi->background(background()); else mi->redraw(); } n=hiddenItemVector().length(); for(i=0;ibackground()==oldbg_) mi->background(background()); } } void MSMenu::updateForeground(unsigned long oldfg_) { MSWidgetCommon::updateForeground(oldfg_); int i,n; n=itemVector().length(); MSMenuItem *mi; for(i=0;iforeground()==oldfg_) mi->foreground(foreground()); } n=hiddenItemVector().length(); for(i=0;iforeground()==oldfg_) mi->foreground(foreground()); } } void MSMenu::updateFont(Font oldfid_) { MSWidgetCommon::updateFont(oldfid_); int i,n; n=itemVector().length(); MSMenuItem *mi; for(i=0;ifont()==oldfid_) mi->font(font()); } n=hiddenItemVector().length(); for(i=0;ifont()==oldfid_) mi->font(font()); } unfreeze(); computeSize(); redraw(); } void MSMenu::firstMapNotify(void) { unfreeze(); computeSize(); } void MSMenu::redraw(void) { if (mapped()==MSTrue&&frozen()==MSFalse) { drawBackground(); drawItems(); drawShadow(); drawSelectedItem(); } } void MSMenu::configure(void) { placement(); } void MSMenu::calculateNaturalSize(int &naturalWidth_,int &naturalHeight_) { freeze(); naturalWidth_=naturalHeight_=0; int index,startIndex=0; for (int i=0;icomputeIndentation())>maxIndent) maxIndent=indent; index++; } index=startIndex; for (j=0;jindent(maxIndent); index++; } index=startIndex; int maxWidth=0, h=0, w=0; for (j=0;jnaturalSize(); w=mi->width(); if (w>maxWidth) maxWidth=w; h+=mi->height(); index++; } naturalWidth_+=maxWidth; if (h>naturalHeight_) naturalHeight_=h; startIndex=index; } int offset=(entryBorder()+highlightThickness()+shadowThickness())<<1; naturalWidth_+=offset; naturalHeight_+=offset; unfreeze(); } void MSMenu::computeSize(void) { if (firstMap()==MSTrue&&frozen()==MSFalse) { int naturalWidth, naturalHeight; calculateNaturalSize(naturalWidth,naturalHeight); if (naturalWidth==width()&&naturalHeight==height()) configure(); else resize(naturalWidth,naturalHeight); } } void MSMenu::placement(void) { if (firstMap()==MSTrue&&frozen()==MSFalse) { freeze(); placeMenuItems(); unfreeze(); } } void MSMenu::placeMenuItems(void) { int index,startIndex=0; int offset=entryBorder()+highlightThickness()+shadowThickness(); int item=0; int columnWidth=0; MSWidgetVector newItemVector; for (int i=0;imoveTo(x,y); setItem(mi,item++); newItemVector<height(); maxW=(mi->width()>maxW?mi->width():maxW); index++; } index=startIndex; for (j=0;jwidth(maxW); index++; } columnWidth+=maxW; startIndex=index; } _itemVector=newItemVector; //TODO: use indexVector?? } void MSMenu::drawItems(void) { int i,n; n=itemVector().length(); for(i=0;iredraw(); } } void MSMenu::drawItem(int item_,MSBoolean select_) { if (mapped()==MSTrue&&item_>=0) { MSMenuItem *mi=menuItem(item_); if (mi!=0){ (select_==MSTrue)?mi->select():mi->unselect(); } } } void MSMenu::drawSelectedItem(void) { drawItem(selectedItem(),MSTrue); } void MSMenu::undrawSelectedItem(void) { drawItem(selectedItem(),MSFalse); } void MSMenu::accelerator(char aChar_) { MSMenuItem *mi=0; char ch; char chl=tolower(aChar_); char chu=toupper(chl); int i,n; n=itemVector().length(); for(i=0;imnemonic(); if (ch!=0&&(ch==chl||ch==chu)) break; else mi=0; } if (mi!=0 && mi->sensitive()==MSTrue) { if (mi->item()!=selectedItem()) { undrawSelectedItem(); selectedItem(mi->item()); drawSelectedItem(); } if (mi->cascade()==MSTrue) { mi->arm(); mi->grab(); } else mi->activate(); } } MSBoolean MSMenu::loseFocus(void) { done(); return MSTrue; } void MSMenu::motionNotify(const XEvent *event_) { if (event_->xmotion.state) { MSMenu *menu; if ((menu=menuList().findMenu(server(),event_->xbutton.x_root,event_->xbutton.y_root))!=0) { if (grabber()!=menu) menu->grab(event_->xbutton.time); MSMenuItem *mi=menu->findItem(event_->xbutton.x_root,event_->xbutton.y_root); if (mi!=0) { if (mi->item()!=menu->selectedItem()) { MSMenuItem *smi=menu->menuItem(menu->selectedItem()); if (smi!=0) { smi->disarm(); menu->undrawSelectedItem(); } menu->selectedItem(mi->item()); menu->drawSelectedItem(); mi->arm(); } else menu->reselect(); } else menu->selectNone(); } else { if (grabber()) grabber()->pointerLeave(); } } } void MSMenu::reset(void) { MSMenuItem *mi=menuItem(selectedItem()); if (mi!=0&&mi->cascade()==MSTrue) mi->disarm(); undrawSelectedItem(); selectedItem(-1); } void MSMenu::grabAndSelect(unsigned long time_) { if (selectedItem()==-1) { MSMenuItem *ni=nextDownItem(); if (ni!=0) selectedItem(ni->item()); } drawSelectedItem(); grab(time_); } void MSMenu::grab(unsigned long time_) { grabber(this); server()->grabKeyboard(window(),False,GrabModeAsync,GrabModeAsync,time_); server()->grabPointer(window(),False,grabMask,GrabModeAsync,GrabModeAsync,None, grabCursor()->cursor(),time_); XFlush(display()); } void MSMenu::ungrab(unsigned long time_) { if (grabber()==this) { grabber(0); reset(); server()->ungrabPointer(window(),time_); server()->ungrabKeyboard(window(),time_); XFlush(display()); } } void MSMenu::releaseGrab(void) { if (grabber()==this) { grabber(0); server()->ungrabPointer(window(),CurrentTime); server()->ungrabKeyboard(window(),CurrentTime); XFlush(display()); } } void MSMenu::buttonPress(const XEvent *event_) { if (event_->xbutton.same_screen&&sensitive()==MSTrue) { MSMenu *menu; if ((menu=menuList().findMenu(server(),event_->xbutton.x_root,event_->xbutton.y_root))!=0) { if (grabber()==0) menu->grab(event_->xbutton.time); else { if (grabber()!=menu) { grabber()->reset(); menu->grab(event_->xbutton.time); } } MSMenuItem *mi=menu->findItem(event_->xbutton.x_root,event_->xbutton.y_root); if (mi!=0) { if (mi->item()!=menu->selectedItem()) { MSMenuItem *smi=menu->menuItem(menu->selectedItem()); if (smi!=0) { smi->disarm(); menu->undrawSelectedItem(); } menu->selectedItem(mi->item()); menu->drawSelectedItem(); mi->arm(); } else menu->reselect(); } else { MSMenuItem *smi=menu->menuItem(menu->selectedItem()); if (smi!=0) { smi->disarm(); menu->undrawSelectedItem(); } menu->selectedItem(-1); } } } } void MSMenu::buttonRelease(const XEvent *event_) { MSMenu *menu; if (event_->xbutton.same_screen&& (menu=menuList().findMenu(server(),event_->xbutton.x_root,event_->xbutton.y_root))!=0) { MSMenuItem *mi=menu->findItem(event_->xbutton.x_root,event_->xbutton.y_root); if (mi!=0&&mi->item()==menu->selectedItem()) { if (mi->cascade()==MSTrue) { mi->arm(); mi->grab(); } else mi->activate(); } else done(); } else done(); } MSMenuItem *MSMenu::activeMenuItem(void) { return menuItem(selectedItem()); } const MSMenuItem *MSMenu::activeMenuItem(void) const { return menuItem(selectedItem()); } MSMenuItem *MSMenu::taggedMenuItem(int tag_) { MSMenuItem *mi; int i,n; n=itemVector().length(); for(i=0;itag()==tag_) return mi; } return 0; } const MSMenuItem *MSMenu::taggedMenuItem(int tag_) const { MSMenuItem *mi; int i,n; n=itemVector().length(); for(i=0;itag()==tag_) return mi; } return 0; } MSMenuItem *MSMenu::menuItem(int item_) { if (item_>=0&&item_=0&&item_=mi->x()&&ycoord>=mi->y()&& xcoord<=mi->x()+mi->width()&&ycoord<=mi->y()+mi->height()) { return (mi->sensitive()==MSTrue)?mi:0; } } return 0; } void MSMenu::activate(void) { activateCallback(MSWidgetCallback::activate); done(); } void MSMenu::done(void) { releaseGrab(); unmap(); reset(); } void MSMenu::left(void) { MSMenuItem *ni,*mi=menuItem(selectedItem()); if ((ni=nextLeftItem())!=0&&ni!=mi) { undrawSelectedItem(); selectedItem(ni->item()); drawSelectedItem(); } } void MSMenu::right(void) { MSMenuItem *ni, *mi=menuItem(selectedItem()); if (mi!=0&&mi->cascade()==MSTrue) { mi->arm(); mi->grab(); } else if ((ni=nextRightItem())!=0&&ni!=mi) { undrawSelectedItem(); selectedItem(ni->item()); drawSelectedItem(); if (ni->cascade()==MSTrue) { ni->arm(); ni->grab(); } } } void MSMenu::up(void) { if (itemCount()>0) { MSMenuItem *mi=menuItem(selectedItem()); MSMenuItem *ni=nextUpItem(); if (ni!=0&&mi!=ni) { if (mi!=0&&mi->cascade()==MSTrue) mi->disarm(); undrawSelectedItem(); selectedItem(ni->item()); drawSelectedItem(); } } } void MSMenu::down(void) { if (itemCount()>0) { MSMenuItem *mi=menuItem(selectedItem()); MSMenuItem *ni=nextDownItem(); if (ni!=0&&mi!=ni) { if (mi!=0&&mi->cascade()==MSTrue) mi->disarm(); undrawSelectedItem(); selectedItem(ni->item()); drawSelectedItem(); } } } void MSMenu::escape(void) { done(); } void MSMenu::returnKey(void) { MSMenuItem *mi=menuItem(selectedItem()); if (mi!=0) { if (mi->cascade()==MSTrue) { mi->arm(); mi->grab(); } else mi->activate(); } } void MSMenu::keyPress(const XEvent * pEvent_,KeySym keysym_,unsigned int state_,const char *pString_) { MSKeyPress keyPress(keysym_,state_); if (itemCount()>0&&keyTranslate(keyPress)==MSFalse) { switch(keysym_) { case XK_Up: up(); break; case XK_Down: down(); break; case XK_Left: left(); break; case XK_Right: right(); break; case XK_Return: returnKey(); break; case XK_Escape: escape(); break; default: if (isprint(pString_[0])) accelerator(pString_[0]); break; } } } void MSMenu::childConfigure(MSWidget *) { if (firstMap()==MSTrue&&frozen()==MSFalse) computeSize(); } void MSMenu::childCreate(MSWidget *widget_) { if(widget_!=0) { MSBoolean found=MSFalse; if(_itemVector.indexOf((unsigned long)widget_)!=_itemVector.length()) found=MSTrue; else if(_hiddenItemVector.indexOf((unsigned long)widget_)!=_hiddenItemVector.length()) found=MSTrue; if (found!=MSTrue) { itemVector()<0) { int item=selectedItem(); int i, start=0, end=0; if (item==-1) end=rowCount(0); else { for (i=0;i=start&&itemsensitive()==MSTrue) return ni; } } return 0; } MSMenuItem *MSMenu::nextDownItem(void) { // This nextDownItem logic wraps, i.e. if it reaches the bottom most item // then try from the top item again until it either finds one or it returns // to the starting item. if (itemCount()>0) { int item=selectedItem(); int i, start=0, end=0; if (item==-1) end=rowCount(0); else { for (i=0;i=start&&item=end) next=start; ni=menuItem(next); if (ni==mi||ni->sensitive()==MSTrue) return ni; } } return 0; } MSMenuItem *MSMenu::nextRightItem(void) { // This nextRightItem logic wraps, i.e. if it reaches the right most item // then try from the first item again until it either finds one or it returns // to the starting item. if (itemCount()>0) { int item=selectedItem(); MSMenuItem *mi=menuItem(item); MSIntVector row; int index; if (item==-1) { row=rowItems(0); index=-1; } else { row=rowItems(item); index=row.indexOf(item); } unsigned length=row.length(); for (unsigned j=0;jsensitive()==MSTrue)) return ni; } } return 0; } MSMenuItem *MSMenu::nextLeftItem(void) { // This nextLeftItem logic wraps, i.e. if it reaches the left most item // then try from the right most item again until it either finds one or it returns // to the starting item. if (itemCount()>0) { int item=selectedItem(); MSMenuItem *mi=menuItem(item); MSIntVector row; int index; if (item==-1) { row=rowItems(0); index=1; } else { row=rowItems(item); index=row.indexOf(item); } unsigned length=row.length(); for (unsigned j=0;jsensitive()==MSTrue)) return ni; } } return 0; } void MSMenu::entryBorder(int entryBorder_) { if (_entryBorder!=entryBorder_) { _entryBorder=entryBorder_; computeSize(); redraw(); } } MSMenu::MSMenuList::~MSMenuList(void) { MSNodeItem *hp=itemListHead(); MSNodeItem *np; while ((np=hp->next())!=hp) delete np; } MSMenu::MSMenuList::MSMenuList(void) { } void MSMenu::MSMenuList::addToList(MSMenu *menu_) { MSNodeItem *hp=itemListHead(); MSNodeItem *np=hp; MSBoolean found=MSFalse; while (found==MSFalse&&(np=np->next())!=hp) { if ((MSMenu *)np->data()==menu_) { found=MSTrue; np=hp->prev(); } } if (menu_!=0&&found!=MSTrue) { MSNodeItem *np=new MSNodeItem((void *)menu_); np->insert(hp->next()); } } void MSMenu::MSMenuList::removeFromList (MSMenu *menu_) { MSNodeItem *hp=itemListHead(); MSNodeItem *np=hp; while ((np=np->next())!=hp) { if ((MSMenu *)np->data()==menu_) { delete np; break; } } } MSMenu *MSMenu::MSMenuList::findMenu (MSDisplayServer* server_, int rootX_, int rootY_) { int X,Y; MSNodeItem *hp=itemListHead(); MSNodeItem *np=hp; while ((np=np->next())!=hp) { MSMenu *menu=(MSMenu *)np->data(); // must be on the same server. This check is good enough // all child menus of menu will definately have the same pointer. if(menu->server()==server_) { menu->rootXY(X,Y); if (rootX_>=X&&rootX_<=X+menu->width()&&rootY_>=Y&&rootY_<=Y+menu->height()) { return menu; } } } return 0; } void MSMenu::pointerLeave(void) { MSMenuItem *smi=menuItem(selectedItem()); if (smi!=0) { smi->disarm(); undrawSelectedItem(); } selectedItem(-1); } void MSMenu::reselect(void) { MSMenuItem *smi=menuItem(selectedItem()); if (smi!=0&&smi->cascade()==MSTrue) { MSMenu *cas=smi->cascadedMenu(); if (cas!=0) { MSMenuItem *scmi=cas->menuItem(cas->selectedItem()); if (scmi!=0) { scmi->disarm(); cas->undrawSelectedItem(); cas->selectedItem(-1); } } smi->arm(); } } void MSMenu::selectNone(void) { MSMenuItem *smi=menuItem(selectedItem()); if (smi!=0) { smi->disarm(); undrawSelectedItem(); } selectedItem(-1); } MSWidgetVector MSMenu::children(void) { MSWidgetVector childVector=_itemVector; childVector<<_hiddenItemVector; return childVector; } MSBoolean MSMenu::insideColumn(unsigned column_,int item_) { int count=0; for (unsigned i=0;i=count&&item_=count&&item_0) { for (unsigned j=i;j>0;j--) firstItem-=rowCount(j-1); } // Now using the first item on the row, work forward MSIntVector vector; vector<item(i_); } void MSMenu::permuteMenuItems(const MSIntVector& vector_) { unsigned index,len; int i,n=vector_.length(); freeze(); _selectedItem=-1; _itemVector<<_hiddenItemVector; _hiddenItemVector=_itemVector; _itemVector.removeAll(); for(i=0;itag()==vector_(i)) { _itemVector<<_hiddenItemVector(index); _hiddenItemVector.removeAt(index); break; } } } unfreeze(); computeSize(); redraw(); } void MSMenu::permuteMenuItems(const MSWidgetVector& vector_) { unsigned index; int i,n=vector_.length(); freeze(); _selectedItem=-1; _itemVector<<_hiddenItemVector; _hiddenItemVector=_itemVector; _itemVector.removeAll(); for(i=0;i static const int MSMenuBarDefaultEntryBorder=2; MSMenuBar::MSMenuBar(MSWidget *owner_) : MSMenu(owner_) { _entryBorder=MSMenuBarDefaultEntryBorder; _orientation=Horizontal; } MSMenuBar::~MSMenuBar(void) {} void MSMenuBar::unmap(void) { if (mapped()==MSTrue) { pulldownMenus(); MSWidgetCommon::unmap(); reset(); } } void MSMenuBar::map(void) { if (mapped()==MSFalse) { MSWidgetCommon::map(); XFlush(display()); } } MSMenuItem *MSMenuBar::nextRightItem(void) { // This nextRightItem logic wraps, i.e. if it reaches the right most item // then try from the first item again until it either finds one or it returns // to the starting item. if (itemCount()>0) { int item=selectedItem(); MSMenuItem *mi=menuItem(item); MSMenuItem *ni=0; if (mi==0||item<0) item=-1; // Loop no more than the number of items for (int i=0; isensitive()==MSTrue) return ni; } } return 0; } MSMenuItem *MSMenuBar::nextLeftItem(void) { // This nextLeftItem logic wraps, i.e. if it reaches the left most item // then try from the right most item again until it either finds one or it returns // to the starting item. if (itemCount()>0) { int item=selectedItem(); MSMenuItem *mi=menuItem(item); MSMenuItem *ni=0; if (mi==0||item<0) item=1;; // Loop no more than the number of items for (int i=0; isensitive()==MSTrue) return ni; } } return 0; } MSMenu *MSMenuBar::selectedMenu(void) { MSMenu *menu=(MSMenu *)this; MSMenuItem *mi=activeMenuItem(); while (mi!=0&&mi->cascade()==MSTrue&&mi->cascadedMenu()!=0) { menu=mi->cascadedMenu(); mi=menu->activeMenuItem(); } return menu; } const MSMenu *MSMenuBar::selectedMenu(void) const { const MSMenu *menu=(MSMenu *)this; const MSMenuItem *mi=activeMenuItem(); while (mi!=0&&mi->cascade()==MSTrue&&mi->cascadedMenu()!=0) { menu=mi->cascadedMenu(); mi=menu->activeMenuItem(); } return menu; } void MSMenuBar::done(void) { menuBar(0); menuList().removeFromList(this); releaseGrab(); pulldownMenus(); reset(); } void MSMenuBar::dropMenu(MSMenuItem *mi_) { if (mi_!=0&&mi_->cascade()==MSTrue) { mi_->arm(); mi_->grab(); } } void MSMenuBar::moveToMenu(MSMenuItem *nextItem_) { MSMenuItem *mi=menuItem(selectedItem()); if (nextItem_!=0&&mi!=nextItem_) { if (mi!=0&&mi->cascade()==MSTrue) mi->disarm(); undrawSelectedItem(); selectedItem(nextItem_->item()); drawSelectedItem(); dropMenu(nextItem_); } } void MSMenuBar::up(void) { if(orientation()==Horizontal) { dropMenu(menuItem(selectedItem())); } else { moveToMenu(nextLeftItem()); } } void MSMenuBar::down(void) { if(orientation()==Horizontal) { dropMenu(menuItem(selectedItem())); } else { moveToMenu(nextRightItem()); } } void MSMenuBar::left(void) { moveToMenu(nextLeftItem()); } void MSMenuBar::right(void) { moveToMenu(nextRightItem()); } void MSMenuBar::computeSize(void) { if (firstMap()==MSTrue&&frozen()==MSFalse) { freeze(); MSMenuItem *mi; int th=0,tw=0; int h=0,w=0; int offset=(entryBorder()+highlightThickness()+shadowThickness())<<1; int i,n=itemCount(); if(orientation()==Horizontal) { for(i=0;inaturalSize(); th=mi->height(); if (hwidth(); } } else { for(i=0;inaturalSize(); tw=mi->width(); if (wheight(); } } unfreeze(); if (w+offset==width()&&h+offset==height()) configure(); else resize(w+offset,h+offset); } } void MSMenuBar::placement(void) { if (firstMap()==MSTrue&&frozen()==MSFalse) { freeze(); MSMenuItem *mi; int offset=entryBorder()+highlightThickness()+shadowThickness(); int y=offset; int x=offset; int item=0; int i,n=itemCount(); if(orientation()==Horizontal) { int h=height()-(offset<<1); for(i=0;iheight(h); setItem(mi,item++); if (mi->label()=="Help") { mi->moveTo(width()-offset-mi->width(),y); } else { mi->moveTo(x,y); x+=mi->width(); } } } else { int w=width()-(offset<<1); for (i=0;iwidth(w); setItem(mi,item++); mi->moveTo(x,y); y+=mi->height(); } } unfreeze(); } } void MSMenuBar::keyPress(const XEvent *pEvent_,KeySym keysym_,unsigned int state_,const char *pString_) { MSKeyPress keyPress(keysym_, state_); if(keyTranslate(keyPress) == MSFalse) { menuBar(this); MSMenu::keyPress(pEvent_,keysym_,state_,pString_); } } void MSMenuBar::buttonPress(const XEvent *event_) { if (event_->xbutton.button==Button1&&sensitive()==MSTrue) { MSBoolean proceed=(acceptFocus()==MSTrue)?traverseFocus(this):MSTrue; if (proceed==MSTrue) { if (findItem(event_->xbutton.x_root,event_->xbutton.y_root)!=0) { menuBar(this); menuList().addToList(this); MSMenu::buttonPress(event_); } } } } void MSMenuBar::orientation(Orientation orientation_) { if(orientation()!=orientation_) { _orientation=orientation_; computeSize(); } } MSAttrValueList& MSMenuBar::get(MSAttrValueList& avList_) { avList_< #include #include #include MSMenuBarItem::MSMenuBarItem(MSMenuBar *owner_) : MSMenuItem(owner_) { init(); } MSMenuBarItem::MSMenuBarItem(MSMenuBar *owner_,const char *label_,char mnemonic_,int tag_) : MSMenuItem(owner_,label_,mnemonic_,tag_) { init(); } MSMenuBarItem::MSMenuBarItem(MSMenuBar *owner_,const MSString& label_,char mnemonic_,int tag_) : MSMenuItem(owner_,label_,mnemonic_,tag_) { init(); } MSMenuBarItem::MSMenuBarItem(MSMenuBar *owner_,const MSPixmap &pixmap_, const MSPixmap &insensitivePixmap_,int tag_) : MSMenuItem(owner_,pixmap_,insensitivePixmap_,tag_) { init(); } MSMenuBarItem::~MSMenuBarItem(void) { if (pulldownMenu()!=0) safeDestroy(pulldownMenu()); } void MSMenuBarItem::init(void) { _cascade=MSFalse; _pulldownMenu=0; } MSMenu* MSMenuBarItem::cascadedMenu(void) { return (MSMenu*)_pulldownMenu; } const MSMenu* MSMenuBarItem::cascadedMenu(void) const { return (MSMenu*)_pulldownMenu; } void MSMenuBarItem::grab(void) { if (pulldownMenu()!=0) pulldownMenu()->grabAndSelect(); } void MSMenuBarItem::arm(void) { if (pulldownMenu()!=0) { if (pulldownMenu()->mapped()==MSFalse) menushow(); int rootx=0,rooty=0; owner()->rootXY(rootx,rooty); int x=rootx+x_origin(); int y=rooty+y_origin(); if(((MSMenuBar*)owner())->orientation()==MSMenuBar::Horizontal) { y+=height(); } else { x+=width(); } // If the pulldown Menu has never been mapped, call map here so // it can calculate its size if (pulldownMenu()->firstMap()==MSFalse) { pulldownMenu()->moveTo(server()->width(),server()->height()); pulldownMenu()->map(); } // Only adjust x if the left side of menu is within the screen if (x+pulldownMenu()->width()>server()->width()) { int newx=server()->width()-pulldownMenu()->width(); if (newx>0) x=newx; else x=0; } // Only pull up if the top of menu is within the screen if (y+pulldownMenu()->height()>server()->height()) { int newy=rooty+y_origin()-pulldownMenu()->height(); if (newy>0) y=newy; } pulldownMenu()->moveTo(x,y); pulldownMenu()->map(); pulldownMenu()->raise(); } } void MSMenuBarItem::disarm(void) { if (pulldownMenu()!=0) { pulldownMenu()->ungrab(); pulldownMenu()->unmap(); } } void MSMenuBarItem::pulldownMenu(MSPulldownMenu *menu_) { if (pulldownMenu()!=menu_) { if (pulldownMenu()!=0) safeDestroy(pulldownMenu()); _pulldownMenu=menu_; if (pulldownMenu()!=0) _cascade=MSTrue; else _cascade=MSFalse; } } void MSMenuBarItem::menuDestroy(MSPulldownMenu *menu_) { if (pulldownMenu()==menu_) { _pulldownMenu=0; _cascade=MSFalse; } } int MSMenuBarItem::computeYCoord(void) { int offset=highlightThickness()+shadowThickness()+marginHeight(); int diff=(height()-offset*2-fontObject()->textHeight())/2; if (diff<=0) return offset+y_origin(); else return offset+diff+y_origin(); } void MSMenuBarItem::updateFont(Font oldfid_) { MSMenuItem::updateFont(oldfid_); if (pulldownMenu()!=0&&pulldownMenu()->font()==oldfid_) { pulldownMenu()->font(font()); } } void MSMenuBarItem::updateForeground(unsigned long oldfg_) { MSMenuItem::updateForeground(oldfg_); if (pulldownMenu()!=0&&pulldownMenu()->foreground()==oldfg_) { pulldownMenu()->foreground(foreground()); } } void MSMenuBarItem::updateBackground(unsigned long oldbg_) { MSMenuItem::updateBackground(oldbg_); if (pulldownMenu()!=0&&pulldownMenu()->background()==oldbg_) { pulldownMenu()->background(background()); } //undraw shadow because MSWidgetOutput::updateBackground will draw it. if (selected()==MSFalse) undrawShadow(); } void MSMenuBarItem::menushow() { activateCallback(MSWidgetCallback::menushow); } MSAttrValueList& MSMenuBarItem::get(MSAttrValueList& avList_) { avList_< #include #include #include #include #include static const int MSMenuItemDefaultShadowThickness=2; static const int MSMenuItemDefaultHighlightThickness=0; static const int MSMenuItemDefaultMarginWidth=4; static const int MSMenuItemDefaultMarginHeight=2; static const int MSMenuItemDefaultIndentation=0; static const int MSMenuItemDefaultSpacing=5; static const char *MSMenuItemDefaultPixmap="MenuItemDefaultPixmap"; MSBoolean MSMenuItem::_defaultMnemonic=MSTrue; MSBoolean MSMenuItem::defaultMnemonic(void) { return _defaultMnemonic; } void MSMenuItem::defaultMnemonic(MSBoolean mnemonic_) { _defaultMnemonic = mnemonic_; } MSMenuItem::MSMenuItem(MSMenu *owner_) : MSWidgetOutput(owner_) { _mnemonic=0; _tag=-1; _pixmap=0; _insensitivePixmap=0; init(); _showState = ShowLabel; } MSMenuItem::MSMenuItem(MSMenu *owner_,const char *label_,char mnemonic_,int tag_) : MSWidgetOutput(owner_) { _pixmap=0; _insensitivePixmap=0; _label=label_; _mnemonic=mnemonic_; _tag=tag_; if (mnemonic()==0&&label().length()>1&&defaultMnemonic()==MSTrue) _mnemonic=label().first(); init(); _showState = ShowLabel; } MSMenuItem::MSMenuItem(MSMenu *owner_,const MSString& label_,char mnemonic_,int tag_) : MSWidgetOutput(owner_) { _pixmap=0; _insensitivePixmap=0; _label=label_; _mnemonic=mnemonic_; _tag=tag_; if (mnemonic()==0&&label().length()>1&&defaultMnemonic()==MSTrue) _mnemonic=label().first(); init(); _showState = ShowLabel; } MSMenuItem::MSMenuItem(MSMenu *owner_,const MSPixmap &pixmap_, const MSPixmap &insensitivePixmap_,int tag_) : MSWidgetOutput(owner_) { _mnemonic=0; _tag=tag_; initPixmaps(pixmap_,insensitivePixmap_); init(); _showState = ShowPixmap; } MSMenuItem::MSMenuItem(MSMenu *owner_,const MSString& label_, const MSPixmap &pixmap_, const MSPixmap &insensitivePixmap_,char mnemonic_,int tag_) : MSWidgetOutput(owner_) { _mnemonic=mnemonic_; _label = label_; if (mnemonic()==0&&label().length()>1&&defaultMnemonic()==MSTrue) _mnemonic=label().first(); _tag=tag_; initPixmaps(pixmap_,insensitivePixmap_); init(); _showState = ShowBoth; } MSMenuItem::MSMenuItem(MSMenu *owner_,const char* label_, const MSPixmap &pixmap_, const MSPixmap &insensitivePixmap_,char mnemonic_,int tag_) : MSWidgetOutput(owner_) { _mnemonic=mnemonic_; _label = label_; if (mnemonic()==0&&label().length()>1&&defaultMnemonic()==MSTrue) _mnemonic=label().first(); _tag=tag_; initPixmaps(pixmap_,insensitivePixmap_); init(); _showState = ShowBoth; } MSMenuItem::~MSMenuItem(void) { if (_fontObject!=0) delete _fontObject; if (_stipple!=0) delete _stipple; if (_pixmap!=0) delete _pixmap; if (_insensitivePixmap!=0) delete _insensitivePixmap; if (_pixmapGC!=0) XFreeGC(display(),_pixmapGC); } void MSMenuItem::init(void) { childCreateNotify(); _acceptFocus=MSTrue; _highlightThickness=MSMenuItemDefaultHighlightThickness; _shadowThickness=MSMenuItemDefaultShadowThickness; _marginWidth=MSMenuItemDefaultMarginWidth; _marginHeight=MSMenuItemDefaultMarginHeight; _indent=MSMenuItemDefaultIndentation; _item=0; _armed=MSFalse; _selected=MSFalse; _cascade=MSFalse; _fontObject=new MSFontObject(server()->fontStruct(MSWidget::font())); _stipple=new MSPixmap(server(),MSPixmap::ForegroundFiftyPixmap,1,0,1); _pixmapGC=0; _dynamic=MSTrue; _mapped=MSTrue; shadowStyle(MSRaised); createGCs(); childMapNotify(); changeState(MSFalse); spacing(MSMenuItemDefaultSpacing); } void MSMenuItem::initPixmaps(const MSPixmap &pixmap_,const MSPixmap &insensitivePixmap_) { if (pixmap_.server()==server()) _pixmap=new MSPixmap(pixmap_); else { MSMessageLog::warningMessage("Warning : Pixmap supplied for MSMenuItem is invalid, using default"); _pixmap=createDefaultPixmap(pixmap_.width(),pixmap_.height(), pixmap_.foreground(),pixmap_.background()); } if (insensitivePixmap_.server()==server()) { _insensitivePixmap=new MSPixmap(insensitivePixmap_); } else { MSMessageLog::warningMessage("Warning : Insensitive Pixmap supplied for MSMenuItem is invalid, using default"); _insensitivePixmap=createDefaultPixmap(insensitivePixmap_.width(), insensitivePixmap_.height(), insensitivePixmap_.foreground(), insensitivePixmap_.background()); } } MSGC& MSMenuItem::textMSGC(void) { return _textMSGC; } GC MSMenuItem::textGC(void) const { return _textMSGC.gc(); } void MSMenuItem::pixmap(const MSPixmap &pixmap_) { if(showState()==ShowLabel) showState(ShowBoth); else showState(ShowPixmap); MSPixmap *tmp=_pixmap; if (pixmap_.server()==server()) _pixmap=new MSPixmap(pixmap_); else { MSMessageLog::warningMessage("Warning : Pixmap supplied for MSMenuItem is invalid, using default"); _pixmap=createDefaultPixmap(pixmap_.width(),pixmap_.height(), pixmap_.foreground(),pixmap_.background()); } if (tmp!=0) delete tmp; // if we don't have insensitive pixmap, duplicate it if (insensitivePixmap()==0) _insensitivePixmap=new MSPixmap(*pixmap()); if (dynamic()==MSTrue) computeSize(); else if (owner()->mapped()==MSTrue) { drawBackground(); drawSymbol(); if(showState()!=ShowPixmap)drawLabel(); drawPixmap(); (armed()==MSTrue)?drawSunken():drawRaised(); } } void MSMenuItem::insensitivePixmap(const MSPixmap &insensitivePixmap_) { MSPixmap *tmp=_insensitivePixmap; if (insensitivePixmap_.server()==server()) _insensitivePixmap=new MSPixmap(insensitivePixmap_); else { MSMessageLog::warningMessage("Warning : Insensitive Pixmap supplied for MSMenuItem is invalid, using default"); _insensitivePixmap=createDefaultPixmap(insensitivePixmap_.width(), insensitivePixmap_.height(), insensitivePixmap_.foreground(), insensitivePixmap_.background()); } if (tmp!=0) delete tmp; // if we don't have sensitive pixmap, duplicate it if (pixmap()==0) _pixmap=new MSPixmap(*insensitivePixmap()); if (dynamic()==MSTrue) computeSize(); else if (owner()->mapped()==MSTrue) { drawBackground(); drawSymbol(); if(showState()!=ShowPixmap) drawLabel(); drawPixmap(); (armed()==MSTrue)?drawSunken():drawRaised(); } } void MSMenuItem::createGCs(void) { XGCValues values; unsigned long valueMask=(GCForeground|GCFont|GCStipple); values.foreground=MSWidget::foreground(); values.font=MSWidget::font(); values.stipple=stipple()->pixmap(); _textMSGC.setGCValues(server(),MSTrue,&values,valueMask); } MSPixmap *MSMenuItem::createDefaultPixmap(int w_,int h_,unsigned long fg_,unsigned long bg_) { MSPixmap *pixmap=new MSPixmap(server(),MSMenuItemDefaultPixmap,w_,h_,fg_,bg_); GC gc=XCreateGC(display(),owner()->window(),0,0); XSetForeground(display(),gc,bg_); XFillRectangle(display(),pixmap->pixmap(),gc,0,0,w_,h_); XFreeGC(display(),gc); return pixmap; } void MSMenuItem::marginWidth(int margin_) { if (marginWidth()!=margin_) { _marginWidth=margin_; if (dynamic()==MSTrue) computeSize(); } } void MSMenuItem::marginHeight(int margin_) { if (marginHeight()!=margin_) { _marginHeight=margin_; if (dynamic()==MSTrue) computeSize(); } } void MSMenuItem::indent(int indent_) { if (indent()!=indent_) { _indent=indent_; if (dynamic()==MSTrue&&firstMap()==MSTrue) computeSize(); } } void MSMenuItem::updateFont(Font oldfid_) { MSWidgetOutput::updateFont(oldfid_); fontObject()->fontStruct(server()->fontStruct(font())); textMSGC().font(font()); if (dynamic()==MSTrue) computeSize(); else redraw(); } void MSMenuItem::updateForeground(unsigned long oldfg_) { MSWidgetOutput::updateForeground(oldfg_); textMSGC().foreground(foreground()); if (showState() != ShowPixmap) drawLabel(); if (showState() != ShowLabel) drawPixmap(); } void MSMenuItem::updateBackground(unsigned long oldbg_) { MSWidgetOutput::updateBackground(oldbg_); if (dynamic()==MSTrue) computeSize(); else redraw(); } void MSMenuItem::updateSensitivity(void) { if (sensitive()==MSTrue) textMSGC().fillStyle(FillSolid); else textMSGC().fillStyle (FillStippled); if (mapped()==MSTrue) redraw(); } void MSMenuItem::spacing(int spacing_) { if ( spacing()!=spacing_ ) { _spacing = spacing_; if (dynamic()==MSTrue) computeSize(); else redraw(); } } void MSMenuItem::redraw(void) { if (owner()->mapped()==MSTrue&&owner()->frozen()==MSFalse) { drawBackground(); if (showState()!=ShowBoth) drawSymbol(); if (showState()!=ShowLabel) drawPixmap(); if (showState()!=ShowPixmap) drawLabel(); if (selected()==MSTrue) drawShadow(); } } void MSMenuItem::drawPixmap(void) { if (owner()->mapped()==MSTrue&&owner()->frozen()==MSFalse) { const MSPixmap *pmap; pmap = currentPixmap(); if(pmap!=0) { int srcX,srcY,width,height,destX,destY; computePixmapDrawingCoord(pmap,srcX,srcY,width,height,destX,destY); GC gc=pixmapGC(); XSetForeground(display(),gc,foreground()); XSetBackground(display(),gc,background()); copyPixmap(display(),*pmap,owner()->window(),gc,destX,destY); } } } void MSMenuItem::computePixmapDrawingCoord(const MSPixmap *pixmap_,int &srcX_,int &srcY_, int &width_,int &height_,int &destX_,int &destY_) { int heightOffset=highlightThickness()+shadowThickness()+marginHeight(); int widthOffset=highlightThickness()+shadowThickness()+marginWidth(); int myHeight=height()-heightOffset*2; int myWidth; /* if ( showState()!=ShowLabel) myWidth = width()-widthOffset*2-labelWidth()-indent(); else myWidth = width()-widthOffset*2-labelWidth(); */ if ( showState()==ShowPixmap) myWidth = width()-widthOffset*2-indent(); else if ( showState()==ShowBoth) myWidth = indent()-spacing(); if (pixmap_->height()>myHeight) { height_=myHeight; srcY_=(pixmap_->height()-myHeight)/2; destY_=heightOffset+y_origin(); } else { height_=pixmap_->height(); srcY_=0; destY_=heightOffset+y_origin()+(myHeight-pixmap_->height())/2; } if (pixmap_->width()>myWidth) { width_=myWidth; srcX_=(pixmap_->width()-myWidth)/2; destX_=widthOffset+x_origin(); } else { width_=pixmap_->width(); srcX_=0; destX_ =widthOffset+x_origin(); } if(showState() == ShowPixmap) destX_ += indent(); } void MSMenuItem::drawLabel(void) { if (owner()->mapped()==MSTrue&&owner()->frozen()==MSFalse) { if (label().length()>0) { int y=computeYCoord(); int x=computeXCoord(); int len=label().length(); const char *pString=label(); int dw=drawWidth(); if (dw>0) while (fontObject()->textWidth(pString,len)>dw) len--; if (len>0) { XDrawString(display(),owner()->window(),textGC(),fontObject()->fontStruct(), x,y+fontObject()->textAscent(),pString,len); if (mnemonic()!=0) { unsigned u=label().indexOf(toupper(mnemonic())); unsigned l=label().indexOf(tolower(mnemonic())); unsigned i=(ucharWidth(mnemonic()); y+=fontObject()->textHeight(); x+=fontObject()->textWidth(pString,i); XDrawLine(display(),owner()->window(),textGC(),x,y,x+cw,y); } } } } } } int MSMenuItem::computeYCoord(void) { return highlightThickness()+shadowThickness()+y_origin()+marginHeight(); } int MSMenuItem::computeXCoord(void) { return highlightThickness()+shadowThickness()+x_origin()+marginWidth()+indent();} int MSMenuItem::drawWidth(void) const { return width()-2*(highlightThickness()+shadowThickness()+marginWidth());} int MSMenuItem::drawHeight(void) const { return height()-2*(highlightThickness()+shadowThickness()+marginHeight()); } void MSMenuItem::select(void) { drawShadow(); } void MSMenuItem::unselect(void) { undrawShadow(); } void MSMenuItem::activate(void) { if (menu()!=0) { menu()->releaseGrab(); if ( changeState() == MSTrue ) state( ( state() == MSTrue )? MSFalse:MSTrue ); if (activateCallback(MSWidgetCallback::activate)==MSFalse) menu()->activate(); else menu()->done(); } } void MSMenuItem::label(const MSString& aString_) { if(showState() == ShowPixmap) showState(ShowBoth); else showState(ShowLabel); if (label()!=aString_) { _label=aString_; if (dynamic()==MSTrue) computeSize(); else if (owner()->mapped()==MSTrue) { drawBackground(); drawSymbol(); drawLabel(); if (showState()!=ShowLabel)drawPixmap(); (armed()==MSTrue)?drawSunken():drawRaised(); } } } void MSMenuItem::naturalSize(void) { computeSize(); } void MSMenuItem::computeSize(void) { int oldW=width(); int oldH=height(); int widthOffset=(highlightThickness()+shadowThickness()+marginWidth())<<1; int heightOffset=(highlightThickness()+shadowThickness()+marginHeight())<<1; int pixmapW=pixmapWidth(); int pixmapH=pixmapHeight(); int labelW=labelWidth(); int labelH=labelHeight(); int w,h; h=(pixmapH>labelH?pixmapH:labelH)+heightOffset; w=indent()+widthOffset; /* if( showState() == ShowBoth) if both are shown the indentation has to include the pixmapWidth w += labelW; else w += ((showState() == ShowPixmap)? pixmapW:labelW); */ if( showState() == ShowPixmap) w += pixmapW; else w += labelW; if(w==oldW&&h==oldH) redraw(); else resize(w,h); } int MSMenuItem::computeIndentation(void) { return ( showState() == ShowBoth )? pixmapWidth()+spacing():0; } MSWidgetVector MSMenuItem::children(void) { MSWidgetVector vector; if (cascadedMenu()!=0) vector.append(cascadedMenu()); return vector; } GC MSMenuItem::pixmapGC(void) { if (_pixmapGC==0) { XGCValues values; _pixmapGC=XCreateGC(display(),owner()->window(),0,&values); } return _pixmapGC; } void MSMenuItem::showState(MSMenuItem::ShowState showState_) { if (_showState!=showState_) { _showState=showState_; if (dynamic()==MSTrue) computeSize(); else redraw(); } } int MSMenuItem::labelWidth(void) //{ return showState() != ShowPixmap?fontObject()->textWidth(label(),label().length()):0; } { return fontObject()->textWidth(label(),label().length()); } int MSMenuItem::labelHeight(void) //{ return showState() != ShowPixmap?fontObject()->textHeight():0; } { return fontObject()->textHeight(); } int MSMenuItem::pixmapWidth(void) //{ return showState()!=ShowLabel&¤tPixmap()!=0?currentPixmap()->width():0; } { return currentPixmap()!=0? currentPixmap()->width():0; } int MSMenuItem::pixmapHeight(void) //{ return showState()!=ShowLabel&¤tPixmap()!=0?currentPixmap()->height():0; } { return currentPixmap()!=0? currentPixmap()->height():0; } const MSPixmap* MSMenuItem::currentPixmap(void) const { if (sensitive()==MSTrue) return pixmap(); else return insensitivePixmap(); } void MSMenuItem::set(MSAttrValueList& avList_) { MSWidgetOutput::set(avList_); MSIndexVector index; for (unsigned i=0;i MSMenuShell::MSMenuShell(const char *windowTitle_) : MSShell(windowTitle_) { init(); } MSMenuShell::MSMenuShell(MSDisplayServer *server_,const char *windowTitle_) : MSShell(server_,windowTitle_) { init(); } MSMenuShell::~MSMenuShell(void) { if (menuBar()!=0) safeDestroy(menuBar()); _menuBar=0; } void MSMenuShell::init(void) { _menuBar=0; _child=(MSWidget *)0x1; _menuBar=new MSMenuBar(this); menuBar()->moveTo(0,0); _child=0; _placementFlag=MSFalse; } void MSMenuShell::childConfigure(MSWidget *widget_) { if (frozen()==MSFalse&&placementFlag()==MSFalse) { if (widget_==menuBar()&&menuBar()!=0) { adjustChildPosition(); adjustSize(); } else if (widget_==child()&&child()!=0) adjustSize(); adjustChildSize(); } } // a child has been destroyed-check child void MSMenuShell::childDestroy(MSWidget *widget_) { if (widget_==menuBar()) _menuBar=0; else MSShell::childDestroy(widget_); } int MSMenuShell::menuBarHeight(void) const { return (menuBar()!=0)?menuBar()->height():0; } int MSMenuShell::menuBarWidth(void) const { return (menuBar()!=0)?menuBar()->width():0; } int MSMenuShell::idealShellHeight(void) const { return childHeight()+menuBarHeight(); } int MSMenuShell::idealShellWidth(void) const { return (childWidth()moveTo(0,menuBarHeight()); } void MSMenuShell::adjustChildSize(void) { _placementFlag=MSTrue; if (menuBar()!=0) menuBar()->width(width()); if (child()!=0) child()->resize(width(),height()-menuBarHeight()); _placementFlag=MSFalse; } void MSMenuShell::showChildren(void) { if (menuBar()!=0) menuBar()->map(); MSShell::showChildren(); } MSBoolean MSMenuShell::processAltKey(const XEvent *pEvent_,KeySym keysym_, unsigned int state_,const char *pString_) { if (menuBar()!=0) { keyPressNotify(menuBar(),pEvent_,keysym_,state_,pString_); return MSTrue; } else return MSShell::processAltKey(pEvent_,keysym_,state_,pString_); } MSBoolean MSMenuShell::processFunctionKey(const XEvent *pEvent_,KeySym keysym_, unsigned int state_,const char *pString_) { if (menuBar()!=0&&keysym_==XK_F10) { if (menuBar()->obtainFocus()==MSTrue) { menuBar()->grabAndSelect(); return MSTrue; } return MSFalse; } else return MSShell::processFunctionKey(pEvent_,keysym_,state_,pString_); } MSWidgetVector MSMenuShell::children(void) { MSWidgetVector vector; if (child()!=0) vector.append(child()); if (menuBar()!=0) vector.append(menuBar()); return vector; } aplus-fsf-4.22/src/MSGUI/MSModalPopup.C0000644000265000001440000000131010772770407013123 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include MSModalPopup::MSModalPopup(const char *windowTitle_) : MSPopup(windowTitle_) { modal(MSTrue); } MSModalPopup::MSModalPopup(MSDisplayServer *server_,const char *windowTitle_) : MSPopup(server_,windowTitle_) { modal(MSTrue); } MSModalPopup::MSModalPopup(MSShell *leader_,const char *windowTitle_) : MSPopup(leader_,windowTitle_) { modal(MSTrue); } MSModalPopup::~MSModalPopup(void) {} aplus-fsf-4.22/src/MSGUI/MSModelCheckBox.C0000644000265000001440000000203410772770407013516 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include MSModelCheckBox::MSModelCheckBox(MSWidget *owner_,const char *title_) : MSCheckBox(owner_,title_) {} MSModelCheckBox::MSModelCheckBox(MSWidget *owner_,const MSStringVector& title_) : MSCheckBox(owner_,title_) {} MSModelCheckBox::~MSModelCheckBox(void) {} void MSModelCheckBox::updateData(void) { drawCurrentState(); } void MSModelCheckBox::firstMapNotify(void) { MSCheckBox::firstMapNotify(); drawCurrentState(); } void MSModelCheckBox::arm(MSCheckButton *checkButton_) { setModel(); MSCheckBox::arm(checkButton_); } void MSModelCheckBox::disarm(MSCheckButton *checkButton_) { setModel(); MSCheckBox::disarm(checkButton_); } void MSModelCheckBox::update(const MSIndexVector &) { drawCurrentState(); } aplus-fsf-4.22/src/MSGUI/MSMoneyEntryField.C0000644000265000001440000000756710772770407014144 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #if defined(MSTK_MANUAL_INSTANTIATION) #include #if defined(MS_XLC_TEMPLATE_INSTANTIATION) #pragma define (MSTypeEntryField) #endif #if defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma instantiate MSTypeEntryField #endif #if defined(MS_STD_TEMPLATE_INSTANTIATION) template class MSTypeEntryField; #endif #if defined(MS_VC_TEMPLATE_INSTANTIATION) template MSTypeEntryField; #endif #endif // MSTK_MANUAL_INSTANTIATION MSMoneyEntryField::MSMoneyEntryField(MSWidget *owner_, const char *label_,const MSSymbol& tag_) : MSTypeEntryField(owner_,label_,tag_) { init(); } MSMoneyEntryField::MSMoneyEntryField(MSWidget *owner_,MSMoney& model_, const char *label_,const MSSymbol& tag_) : MSTypeEntryField(owner_,model_,label_,tag_) { init(); } MSMoneyEntryField::~MSMoneyEntryField(void) {} void MSMoneyEntryField::init(void) { _format=MSFormat(MSMoney::CurrencyPrecision); _symbolType=MSMoney::LocalSymbol; _symbolLocation=MSMoney::DefaultLocation; _incrementValue=1.0; _clipMode=MSClipIndicator; } const char *MSMoneyEntryField::formatOutput(MSString &buffer_) { if (MSView::model()!=0) value().format(buffer_,format().moneyFormat(),symbolType(),symbolLocation()); return buffer_.string(); } void MSMoneyEntryField::symbolType(MSMoney::SymbolType symbolType_) { if(_symbolType!=symbolType_) { _symbolType=symbolType_; drawFieldValue(); } } void MSMoneyEntryField::symbolLocation(MSMoney::SymbolLocation symbolLocation_) { if(_symbolLocation!=symbolLocation_) { _symbolLocation=symbolLocation_; drawFieldValue(); } } void MSMoneyEntryField::set(MSAttrValueList& avList_) { MSTypeEntryField::set(avList_); MSIndexVector index; for (unsigned i=0;i #include static const unsigned long MSMonthViewEventMask=(ExposureMask|ButtonPressMask); static const int MSMonthViewArrowRepeatInterval = 100; static const int MSMonthViewArrowRepeatThreshold = 200; void MSMonthView::MonthViewArrow::activate(void) { if (type() == MSArrow::Left) monthView()->prevMonth(); else monthView()->nextMonth(); } void MSMonthView::MonthViewArrow::buttonPress(const XEvent *pEvent_) { if (monthView()->isProtected() == MSFalse) { traverseFocus(monthView()); buttonPressNotify(this, pEvent_); } } MSMonthView::MonthViewArrow::MonthViewArrow(MSWidget *owner_, MSArrow::ArrowType type_) : MSArrowButton(owner_, type_) { shadowThickness(0); repeatInterval(MSMonthViewArrowRepeatInterval); repeatThreshold(MSMonthViewArrowRepeatThreshold); } MSMonthView::MSMonthView(MSWidget *pOwner_, const char *title_) : MSPrimitiveText(pOwner_) { _title=title_; init(); internalCouple(new MSDate(MSDate::today())); } MSMonthView::MSMonthView(MSWidget *pOwner_, const MSDate& date_) : MSPrimitiveText(pOwner_) { init(); internalCouple(new MSDate(date_)); } MSMonthView::MSMonthView(MSWidget *pOwner_, MSDate& date_) : MSPrimitiveText(pOwner_) { init(); model(date_); } MSMonthView::~MSMonthView(void) { if(_leftArrow != 0) delete _leftArrow; if(_rightArrow != 0) delete _rightArrow; } void MSMonthView::init(void) { _shadowThickness=0; _highlightThickness=1; _shadowStyle=MSRaised; _margin=2; _leftArrow = 0; _rightArrow = 0; _arrowButtons = MSFalse; _showSelection = MSTrue; _showGrid = MSFalse; _titleFormat = MonthYear; freeze(); acceptFocus(MSTrue); selectInput(MSMonthViewEventMask); addToFocusList(); } void MSMonthView::viewDate(const MSDate& aDate_) { if (MSView::model()!= 0) (MSDate&)*_model = aDate_; } void MSMonthView::model(MSDate& aDate_) { couple(&aDate_); } void MSMonthView::model(const MSDate& aDate_) { constCouple(&aDate_); } void MSMonthView::arrowButtons(MSBoolean arrowButtons_) { if(_arrowButtons != arrowButtons_) { _arrowButtons = arrowButtons_; if(arrowButtons() == MSTrue) { if( _leftArrow == 0) _leftArrow = new MonthViewArrow(this, MSArrow::Left); if( _rightArrow == 0) _rightArrow = new MonthViewArrow(this, MSArrow::Right); _leftArrow->show(); _rightArrow->show(); configure(); } else { if(_leftArrow != 0) _leftArrow->hide(); if(_rightArrow != 0) _rightArrow->hide(); } redraw(); } } void MSMonthView::titleFormat(TitleFormat format_) { if(_titleFormat != format_) { _titleFormat = format_; redraw(); } } void MSMonthView::showSelection(MSBoolean showSelection_) { if(_showSelection != showSelection_) { _showSelection = showSelection_; redraw(); } } void MSMonthView::update(const MSIndexVector& /*index_*/) { if (MSView::model() != 0) { MSDate aDate=viewDate(); aDate.setFirstDayOfMonth(); _firstDayOffset=aDate.weekDay()%7; redraw(); } } void MSMonthView::updateData(void) { if(MSView::model()==0) internalCouple(new MSDate(MSDate::today())); else { MSDate aDate=viewDate(); aDate.setFirstDayOfMonth(); _firstDayOffset=aDate.weekDay()%7; redraw(); } } void MSMonthView::computeSize(void) { resize(idealWidth(),idealHeight()); } void MSMonthView::firstMapNotify(void) { computeSize(); unfreeze(); } void MSMonthView::redraw(void) { if (frozen()==MSFalse&&mapped()==MSTrue) { drawBackground(); drawShadow(); if (highlighted() == MSTrue) drawHighlight(); drawSeparators(); drawCalendar(); } } void MSMonthView::drawCalendar(void) { if (frozen()==MSFalse&&mapped()==MSTrue) { drawTitle(); drawDayHeadings(); drawDayGrid(); } } void MSMonthView::drawDayGrid(void) { int yy = highlightThickness()+shadowThickness(); int xoffset= yy + outerMargin(); int xx=xoffset; MSDay k=1; MSDay day=1; unsigned daysInMonth=viewDate().daysInMonth(); yy+=2*_dayRect.height(); int textOffset = (_dayRect.height()+ textAscent())/2; for (unsigned i=0;i<6;i++) { for (unsigned j=0;j<7;j++) { if (k>_firstDayOffset&&day<=daysInMonth) { MSString aString(day); int tw=textWidth(aString.string(),aString.length()); int lx=xx+((_dayRect.width()-tw)/2); XDrawString(display(),window(),textGC(),textFontStruct(), lx,yy+textOffset,aString.string(),aString.length()); if (day==selectedDay()) { MSRect aRect(xx,yy,_dayRect.width()+2,_dayRect.height()+2); drawBevel(aRect,MSRaised,2); } day++; } xx+=_dayRect.width(); k++; } xx=xoffset; yy+=_dayRect.height(); } } void MSMonthView::drawSelection(MSBoolean draw_) { GridLocation aGridLocation(gridLocationFor(selectedDay())); int offset=highlightThickness()+shadowThickness(); int xx=offset + outerMargin() + _dayRect.width()*aGridLocation.column(); int yy=offset +_dayRect.height()*(2+aGridLocation.row()); MSRect aRect(xx,yy,_dayRect.width()+2,_dayRect.height()+2); if (draw_==MSTrue) drawBevel(aRect,MSRaised,2); else undrawBevel(aRect,2); } void MSMonthView::drawDay(MSDay day_) { unsigned daysInMonth=viewDate().daysInMonth(); if (day_>0&&day_resize(aw, ah); _rightArrow->resize(aw, ah); _leftArrow->moveTo(xoffset, yoffset); _rightArrow->moveTo(width() - xoffset - aw, yoffset); } redraw(); } void MSMonthView::showGrid(MSBoolean showGrid_) { if(showGrid() != showGrid_) { _showGrid=showGrid_; redraw(); } } void MSMonthView::margin(int margin_) { if (margin_!=margin()) { _margin=margin_; computeSize(); } } unsigned long MSMonthView::arrowColor(void) const { if(_leftArrow!=0) return _leftArrow->arrowColor(); else return background(); } void MSMonthView::arrowColor(const char * color_) { arrowColor(server()->pixel(color_)); } void MSMonthView::arrowColor(unsigned long pixel_) { if(_leftArrow!=0) _leftArrow->arrowColor(pixel_); if(_rightArrow!=0) _rightArrow->arrowColor(pixel_); } void MSMonthView::updateSensitivity(void) {} void MSMonthView::updateTitle(void) { redraw(); } void MSMonthView::updateBackground(unsigned long oldbg_) { MSPrimitiveText::updateBackground(oldbg_); if(_leftArrow!=0) _leftArrow->background(background()); if(_rightArrow!=0) _rightArrow->background(background()); redraw(); } void MSMonthView::updateForeground(unsigned long oldfg_) { MSPrimitiveText::updateForeground(oldfg_); if(oldfg_==titleForeground()) _titleFg=foreground(); redraw(); } void MSMonthView::updateFont(Font oldfid_) { MSPrimitiveText::updateFont(oldfid_); computeSize(); redraw(); } void MSMonthView::up(void) { if (selectedDay()>7) selectedDay(selectedDay()-7); } void MSMonthView::down(void) { selectedDay(selectedDay()+7); } void MSMonthView::right(void) { selectedDay(selectedDay()+1); } void MSMonthView::left(void) { selectedDay(selectedDay()-1); } void MSMonthView::pageUp(void) { if(arrowButtons() == MSTrue) nextMonth();} void MSMonthView::pageDown(void) { if(arrowButtons() == MSTrue) prevMonth();} void MSMonthView::home(void) {} void MSMonthView::end(void) {} void MSMonthView::escape(void) {} void MSMonthView::returnKey(void) { activate();} void MSMonthView::nextMonth(void) { viewDate() += MSTerm(0, 1); dateChanged(); } void MSMonthView::prevMonth(void) { viewDate() -= MSTerm(0, 1); dateChanged(); } void MSMonthView::keyPress(const XEvent *pEvent_,KeySym keysym_, unsigned int state_,const char *) { MSKeyPress keyPress(keysym_, state_); if (isProtected()==MSFalse &&keyTranslate(keyPress) == MSFalse) { switch (keysym_) { case XK_Up: up(); break; case XK_Down: down(); break; case XK_Left: left(); break; case XK_Right: right(); break; case XK_Return: returnKey(); break; case XK_F29: case XK_Prior: pageUp(); break; case XK_F35: case XK_Next: pageDown(); break; case XK_F27: case XK_Home: home(); break; case XK_R13: case XK_End: end(); break; case XK_Escape: escape(); break; } } } void MSMonthView::selectedDay(MSDay selectedDay_) { if (showSelection() == MSTrue && selectedDay_!=selectedDay()) { if (selectedDay_>0&&selectedDay_<=viewDate().daysInMonth()) { drawSelection(MSFalse); freeze(); viewDate() = MSDate(viewDate().month(), selectedDay_, viewDate().year()); unfreeze(); drawSeparators(); drawSelection(MSTrue); dateChanged(); } } } void MSMonthView::buttonPress(const XEvent *pEvent_) { if (isProtected() == MSTrue) return; traverseFocus(this); if( showSelection() == MSFalse) { if (isDoubleClick(pEvent_) == MSTrue) activate(); } else { int px=pEvent_->xbutton.x; int py=pEvent_->xbutton.y; int offset=highlightThickness()+shadowThickness(); int xx=offset +outerMargin(); int yy=offset + 2*_dayRect.height(); MSRect aRect(xx,yy,width()-xx-offset,height()-yy-offset); if (px>aRect.x()&&py>aRect.y()&& px6) column=6; int day=(row*7)+column; day+=1; day-=_firstDayOffset; if(isDoubleClick(pEvent_)==MSTrue && day == selectedDay()) activate(); else selectedDay(day); } } } int MSMonthView::outerMargin(void) const { return charWidth('e')/2; } void MSMonthView::drawSeparators(void) { if(showGrid() == MSFalse) return; int thickness=1 ; //separatorThickness(); if (thickness>0&&mapped()!=MSFalse&&frozen()!=MSTrue) { int offset=shadowThickness() +highlightThickness(); int y=offset +_dayRect.height(); int x=offset +outerMargin(); XRectangle *top=new XRectangle[8]; XRectangle *bottom=new XRectangle[8]; int i,n=0; int w = _dayRect.width()*7; for (i=0;i<8;i++) { top[n].x=bottom[n].x=x; top[n].y=y; bottom[n].y=top[n].y+thickness; if (i==8) { top[n].width=w-thickness; bottom[n].width=w; } else top[n].width=bottom[n].width=w; top[n].height=bottom[n].height=thickness; n++; y+=_dayRect.height(); } if (n>0) { XBFillRectangles(display(),window(),bottomShadowGC(),top,n); XFillRectangles(display(),window(),topShadowGC(),bottom,n); } ///Vertical n=0; y= offset + textHeight() +2*_dayRect.y()+1; x= offset+outerMargin(); int h=_dayRect.height()*7; for (i=0;i<8;i++) { bottom[n].x=x; top[n].x=bottom[n].x+thickness; bottom[n].y=top[n].y=y; if (i==7) { bottom[n].height=h+thickness; top[n].height=h; } else bottom[n].height=top[n].height=h; bottom[n].width=top[n].width=thickness; n++; x+=_dayRect.width(); } if (n>0) { XBFillRectangles(display(),window(),bottomShadowGC(),bottom,n); XFillRectangles(display(),window(),topShadowGC(),top,n); } delete [] bottom; delete [] top; } } void MSMonthView::print(const char *file_) { MSBoolean fileOpen=MSFalse; if (outputMode()==Draw) { if (file_!=0) displayPrintFileName(file_); if (displayPrintOpen(this)==MSTrue) { fileOpen=MSTrue; outputMode(Print); displayPrintXorigin(0); displayPrintYorigin(0); } else return; } if (mapped()==MSTrue) redraw(); if (fileOpen==MSTrue) { displayPrintClose(); outputMode(Draw); } } void MSMonthView::activate(void) { activateCallback(MSWidgetCallback::activate); } void MSMonthView::dateChanged(void) { activateCallback(MSWidgetCallback::valuechange); } void MSMonthView::set(MSAttrValueList& avList_) { MSPrimitiveText::set(avList_); MSIndexVector index; for(unsigned i=0; icolorName(arrowColor()),MSAttrValue::Color); avList_ << MSAttrValue("margin", MSString(margin())); avList_ << MSAttrValue("titleFormat", (titleFormat() == MonthYear)?"MonthYear":"Month", MSStringVector("MonthYear\nMonth")); avList_ << MSAttrValue("showSelection", (showSelection()==MSTrue)?"MSTrue":"MSFalse",aBoolVector); avList_ << MSAttrValue("showGrid", (showGrid() == MSTrue)?"MSTrue":"MSFalse",aBoolVector); avList_ < #include #include #include #include #include #if HAVE_IOSTREAM #include #else #include #endif const char * const MSNotebookDefaultBackpageBackground="deepskyblue4"; const char * const MSNotebookDefaultBackpageForeground="black"; const char * const MSNotebookDefaultFrameBackground="deepskyblue4"; const int MSNotebookDefaultHighlightThickness=0; const int MSNotebookDefaultShadowThickness=2; const int MSNotebookDefaultBindingWidth=36; const int MSNotebookDefaultFrameThickness=2; const int MSNotebookDefaultBorderWidth=7; const int MSNotebookDefaultBorderHeight=7; const int MSNotebookDefaultMarginWidth=4; const int MSNotebookDefaultMarginHeight=4; const int MSNotebookDefaultBackpages=3; const int MSNotebookDefaultBackpageThickness=4; const int MSNotebookMinimumBindingWidth=3; const int MSNotebookMinimumArrowSize=15; const int MSNotebookDefaultTabSpacing=4; const int MSNotebookDefaultArrowOffset=4; const int MSNotebookEventMask=(ExposureMask|ButtonPressMask|ButtonReleaseMask); const unsigned long MSNotebookArrowBrowseRepeatInterval=500; const unsigned long MSNotebookArrowBrowseRepeatThreshold=500; const unsigned long MSNotebookArrowSearchRepeatInterval=150; const unsigned long MSNotebookArrowSearchRepeatThreshold=500; inline int MSNotebook::backpageMargin(void) { return (backpages()*backpageThickness()); } inline int MSNotebook::labelHeight(void) { return ((label()->columns()>0)?label()->height():0); } inline int MSNotebook::labelWidth(void) { int indent=XTextWidth(fontManager()->fontStruct(label()->font()),"M",1); int w=highlightThickness()*2+shadowThickness()*2+indent*2; return ((label()->columns()>0)?w+label()->width():w); } MSNotebook::MSNotebook(MSWidget *owner_,const char *title_) : MSManager(owner_) { internalEvent(MSTrue); _label=new MSLabel(this,title_); init(); internalEvent(MSFalse); } MSNotebook::MSNotebook(MSWidget *owner_,const MSStringVector &title_) : MSManager(owner_) { internalEvent(MSTrue); _label=new MSLabel(this,title_); init(); internalEvent(MSFalse); } MSNotebook::~MSNotebook(void) { internalEvent(MSTrue); if (redrawPixmap()!=0) delete _redrawPixmap; if (bindingPixmap()!=0) XFreePixmap(display(),_bindingPixmap); if (upLeftArrow()!=0) upLeftArrow()->destroy(); if (downRightArrow()!=0) downRightArrow()->destroy(); if (label()!=0) label()->destroy(); if (_popupMenu!=0) _popupMenu->destroy(); if (_applicationPopup!=0) _applicationPopup->destroy(); XFreeGC(display(),_notebookGC); XFreeGC(display(),_bindingGC); XFreeGC(display(),_backpageGC); NotebookEntry *entry; MSNodeItem *hp=childListHead(); MSNodeItem *np; while ((np=hp->next())!=hp) { entry=(NotebookEntry *) np->data(); delete np; if (entry!=0) { if (entry->widget()!=0) entry->widget()->destroy(); delete entry; } _childCount--; } } void MSNotebook::init(void) { _redrawPixmap=new MSBackingStorePixmap(server(),"MSGeneral"); _title=label()->label(); _titleAlignment=MSLeft|MSCenter; _highlightThickness=MSNotebookDefaultHighlightThickness; _shadowThickness=MSNotebookDefaultShadowThickness; _firstEntry=0; _currentEntry=0; _orientation=Horizontal; _tabAlignment=MSRight; _backpageForeground=server()->pixel(MSNotebookDefaultBackpageForeground); _backpageBackground=server()->pixel(MSNotebookDefaultBackpageBackground); _frameBackground=server()->pixel(MSNotebookDefaultFrameBackground); _selectedPageForeground=foreground(); _selectedPageBackground=background(); _showBinding=MSTrue; _showTabs=MSTrue; _showPopup=MSTrue; _bindingWidth=MSNotebookDefaultBindingWidth; _frameThickness=MSNotebookDefaultFrameThickness; _borderWidth=MSNotebookDefaultBorderWidth; _borderHeight=MSNotebookDefaultBorderHeight; _marginWidth=MSNotebookDefaultMarginWidth; _marginHeight=MSNotebookDefaultMarginHeight; _backpages=MSNotebookDefaultBackpages; _backpageThickness=MSNotebookDefaultBackpageThickness; _tabSpacing=MSNotebookDefaultTabSpacing; _arrowOffset=MSNotebookDefaultArrowOffset; _bindingPixmap=0; _upLeftArrow=new NotebookArrow(this,MSArrow::Up); upLeftArrow()->repeatInterval(MSNotebookArrowSearchRepeatInterval); _downRightArrow=new NotebookArrow(this,MSArrow::Down); downRightArrow()->repeatInterval(MSNotebookArrowSearchRepeatInterval); _notebookGC=XCreateGC(display(),window(),0,0); _bindingGC=XCreateGC(display(),window(),0,0); _backpageGC=XCreateGC(display(),window(),0,0); _lockSize=MSFalse; _popupMenu=0; _applicationPopup=0; selectInput(MSNotebookEventMask); shadowStyle(MSEtchedIn); label()->margin(4); label()->dynamic(MSTrue); } void MSNotebook::orientation(Orientation orientation_) { if (_orientation!=orientation_) { _orientation=orientation_; if (orientation()==Horizontal) { if (tabAlignment()==MSTop||tabAlignment()==MSBottom) _tabAlignment=MSRight; upLeftArrow()->type(MSArrow::Up); downRightArrow()->type(MSArrow::Down); } else { if (tabAlignment()==MSLeft||tabAlignment()==MSRight) _tabAlignment=MSBottom; upLeftArrow()->type(MSArrow::Left); downRightArrow()->type(MSArrow::Right); } adjustSize(); if (mapped()==MSTrue) { // Force a redraw on all tabs, they don't always get // an expose event after the reordering MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; NotebookEntry *entry; while ((np=np->next())!=hp) { entry=(NotebookEntry *)np->data(); if (entry->tab()->mapped()==MSTrue) entry->tab()->redraw(); } } } } void MSNotebook::tabAlignment(MSAlignment tabAlignment_) { if (tabAlignment_!=MSNone&&tabAlignment_!=MSCenter) { if (_tabAlignment!=tabAlignment_) { _tabAlignment=tabAlignment_; Orientation newOrientation; if (tabAlignment()==MSLeft||tabAlignment()==MSRight) newOrientation=Horizontal; else newOrientation=Vertical; if (orientation()!=newOrientation) orientation(newOrientation); else { placement(); if (mapped()==MSTrue) { // Force a redraw on all tabs, they don't always get // an expose event after the reordering MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; NotebookEntry *entry; while ((np=np->next())!=hp) { entry=(NotebookEntry *)np->data(); if (entry->tab()->mapped()==MSTrue) entry->tab()->redraw(); } } } } } } void MSNotebook::pageTitle(MSWidget *widget_,const char *title_) { NotebookEntry *entry=getEntry(widget_); if (entry!=0) { entry->title(title_); if (entry->managed()==MSTrue) { updateTitleVector(); if (firstMap()==MSTrue) adjustSize(); } } } const char *MSNotebook::pageTitle(MSWidget *widget_) const { return titleFromWidget(widget_); } const char *MSNotebook::titleFromWidget(MSWidget *widget_) const { static MSString title; NotebookEntry *entry=getEntry(widget_); if (entry!=0) title=entry->title().asString('\n'); else title.removeAll(); return title.string(); } MSWidget *MSNotebook::widgetFromTitle(const char *title_) const { NotebookEntry *entry=getEntry(title_); if (entry!=0) return entry->widget(); else return 0; } void MSNotebook::currentTitle(const char *title_) { MSNodeItem *hp=(MSNodeItem *)childListHead(); MSNodeItem *np=hp; NotebookEntry *entry=0; MSString title(title_); while ((np=np->next())!=hp) { NotebookEntry *ne=(NotebookEntry *) np->data(); if (ne->managed()==MSTrue&&ne->title()==title) { entry=ne; break; } } currentEntry(entry); if (firstMap()==MSTrue) { resetFirstEntry(); positionTabs(); } } const char *MSNotebook::currentTitle(void) const { static MSString title; if (currentEntry()!=0) title=currentEntry()->title().asString('\n'); else title.removeAll(); return title.string(); } void MSNotebook::currentWidget(MSWidget *widget_) { MSNodeItem *hp=(MSNodeItem *)childListHead(); MSNodeItem *np=hp; NotebookEntry *entry=0; while ((np=np->next())!=hp) { NotebookEntry *ne=(NotebookEntry *) np->data(); if (ne->managed()==MSTrue&&ne->widget()==widget_) { entry=ne; break; } } currentEntry(entry); if (firstMap()==MSTrue) { resetFirstEntry(); positionTabs(); } } MSWidget *MSNotebook::currentWidget(void) const { if (currentEntry()!=0) return currentEntry()->widget(); else return 0; } void MSNotebook::tabAttribute(MSWidget *child_,const MSNotebookTabAttribute &tabAttr_) { // Only allow setting of tab info if the MSNotebookTabAttribute object // was created using this MSNotebook widget if (tabAttr_.notebook()==this) { NotebookEntry *entry=getEntry(child_); if (entry!=0) { unsigned long oldTabBackground=entry->tab()->tabBackground(); entry->tab()->freeze(); if (tabAttr_.isSet(MSNotebookTabAttribute::TabBackground)==MSTrue) { entry->tab()->tabBackground(tabAttr_.background()); entry->tab()->background(tabAttr_.background()); } if (tabAttr_.isSet(MSNotebookTabAttribute::TabForeground)==MSTrue) { entry->tab()->tabForeground(tabAttr_.foreground()); entry->tab()->foreground(tabAttr_.foreground()); } if (tabAttr_.isSet(MSNotebookTabAttribute::TabFont)==MSTrue) { entry->tab()->tabFont(tabAttr_.font()); } if (tabAttr_.isSet(MSNotebookTabAttribute::TabLabel)==MSTrue) { entry->tab()->label(tabAttr_.label()); } if (tabAttr_.isSet(MSNotebookTabAttribute::TabPixmap)==MSTrue) { entry->tab()->pixmap(*tabAttr_.pixmap()); } if (tabAttr_.isSet(MSNotebookTabAttribute::TabLabelAlignment)==MSTrue) { entry->tab()->labelAlignment(tabAttr_.labelAlignment()); } if (tabAttr_.isSet(MSNotebookTabAttribute::TabSensitivity)==MSTrue) { entry->tab()->sensitive(tabAttr_.sensitive()); } if (tabAttr_.isSet(MSNotebookTabAttribute::TabDisplayToolTip)==MSTrue) { entry->tab()->displayToolTip(tabAttr_.displayToolTip()); } if (tabAttr_.isSet(MSNotebookTabAttribute::TabToolTip)==MSTrue) { entry->tab()->toolTip(tabAttr_.toolTip()); } entry->tab()->unfreeze(); entry->tab()->naturalSize(); if (entry->managed()==MSTrue) { updateTitleVector(); //We only need to adjust the size if either the font or the label has changed if (firstMap()==MSTrue&& (tabAttr_.isSet(MSNotebookTabAttribute::TabFont)|| tabAttr_.isSet(MSNotebookTabAttribute::TabLabel))) { adjustSize(); } //We need to be doubly sure that the frame gets redrawn if the tabBackground is //changed and the the current entry is the one we're modifying. On rare occasions, //this may be reduntant, but this operation is relatively cheap. if (currentEntry()==entry&&oldTabBackground!=entry->tab()->tabBackground()) { drawFrameShadow(window()); } } } } } MSNotebookTabAttribute MSNotebook::tabAttribute(MSWidget *child_) const { MSNotebookTabAttribute tabAttr((MSNotebook *)this); NotebookEntry *entry=getEntry(child_); if (entry!=0) { if (entry->tab()->isModified(MSNotebookTabAttribute::TabForeground)) { tabAttr.foreground(entry->tab()->tabForeground()); } if (entry->tab()->isModified(MSNotebookTabAttribute::TabBackground)) { tabAttr.background(entry->tab()->tabBackground()); } if (entry->tab()->isModified(MSNotebookTabAttribute::TabFont)) { tabAttr.font(entry->tab()->font()); } if (entry->tab()->isModified(MSNotebookTabAttribute::TabToolTip)) { tabAttr.toolTip(entry->tab()->toolTip()); } tabAttr.displayToolTip(entry->tab()->displayToolTip()); tabAttr.sensitive(entry->tab()->sensitive()); tabAttr.label(entry->tab()->label()); tabAttr.labelAlignment(entry->tab()->labelAlignment()); if (tabAttr.pixmap()!=0) tabAttr.pixmap(*tabAttr.pixmap()); } return tabAttr; } void MSNotebook::showBinding(MSBoolean showBinding_) { if (_showBinding!=showBinding_) { _showBinding=showBinding_; adjustSize(); } } void MSNotebook::showTabs(MSBoolean showTabs_) { if (_showTabs!=showTabs_) { _showTabs=showTabs_; if (showTabs()==MSFalse) { MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; NotebookEntry *entry; while ((np=np->next())!=hp) { entry=(NotebookEntry *)np->data(); entry->tab()->unmap(); } upLeftArrow()->unmap(); downRightArrow()->unmap(); } adjustSize(); } } void MSNotebook::bindingWidth(unsigned bindingWidth_) { if (_bindingWidth!=bindingWidth_) { _bindingWidth=bindingWidth_; adjustSize(); } } void MSNotebook::tabSpacing(unsigned tabSpacing_) { if (_tabSpacing!=tabSpacing_) { _tabSpacing=tabSpacing_; adjustSize(); } } void MSNotebook::frameThickness(unsigned frameThickness_) { if (_frameThickness!=frameThickness_) { _frameThickness=frameThickness_; adjustSize(); } } void MSNotebook::borderWidth(unsigned borderWidth_) { if (_borderWidth!=borderWidth_) { _borderWidth=borderWidth_; adjustSize(); } } void MSNotebook::borderHeight(unsigned borderHeight_) { if (_borderHeight!=borderHeight_) { _borderHeight=borderHeight_; adjustSize(); } } void MSNotebook::marginWidth(unsigned marginWidth_) { if (_marginWidth!=marginWidth_) { _marginWidth=marginWidth_; adjustSize(); } } void MSNotebook::marginHeight(unsigned marginHeight_) { if (_marginHeight!=marginHeight_) { _marginHeight=marginHeight_; adjustSize(); } } void MSNotebook::backpages(unsigned backpages_) { if (_backpages!=backpages_) { _backpages=backpages_; adjustSize(); } } void MSNotebook::backpageThickness(unsigned backpageThickness_) { if (_backpageThickness!=backpageThickness_) { _backpageThickness=backpageThickness_; adjustSize(); } } void MSNotebook::backpageForeground(unsigned long backpageForeground_) { if (_backpageForeground!=backpageForeground_) { _backpageForeground=backpageForeground_; redraw(); } } void MSNotebook::backpageForeground(const char *backpageForeground_) { backpageForeground(server()->pixel(backpageForeground_)); } void MSNotebook::backpageBackground(unsigned long backpageBackground_) { if (_backpageBackground!=backpageBackground_) { unsigned long oldBG=backpageBackground(); _backpageBackground=backpageBackground_; MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; NotebookEntry *entry; while ((np=np->next())!=hp) { entry=(NotebookEntry *)np->data(); if (entry->tab()->isModified(MSNotebookTabAttribute::TabBackground)==MSFalse) { entry->tab()->tabBackground(backpageBackground(),MSFalse); if (entry!=currentEntry()) entry->tab()->background(backpageBackground()); } } redraw(); } } void MSNotebook::backpageBackground(const char *backpageBackground_) { backpageBackground(server()->pixel(backpageBackground_)); } void MSNotebook::frameBackground(unsigned long frameBackground_) { if (_frameBackground!=frameBackground_) { _frameBackground=frameBackground_; createBindingPixmap(); redraw(); } } void MSNotebook::frameBackground(const char *frameBackground_) { frameBackground(server()->pixel(frameBackground_)); } void MSNotebook::selectedPageForeground(unsigned long selectedPageForeground_) { if (_selectedPageForeground!=selectedPageForeground_) { _selectedPageForeground=selectedPageForeground_; if (currentEntry()!=0) currentEntry()->tab()->foreground(selectedPageForeground()); } } void MSNotebook::selectedPageForeground(const char *selectedPageForeground_) { selectedPageForeground(server()->pixel(selectedPageForeground_)); } void MSNotebook::selectedPageBackground(unsigned long selectedPageBackground_) { if (_selectedPageBackground!=selectedPageBackground_) { _selectedPageBackground=selectedPageBackground_; if (currentEntry()!=0) currentEntry()->tab()->background(selectedPageBackground()); drawFrameShadow(window()); } } void MSNotebook::selectedPageBackground(const char *selectedPageBackground_) { selectedPageBackground(server()->pixel(selectedPageBackground_)); } void MSNotebook::nextPage(MSBoolean cycle_) { currentEntry(nextBrowseEntry(cycle_)); resetFirstEntry(); positionTabs(); pageChanged(); } void MSNotebook::previousPage(MSBoolean cycle_) { currentEntry(previousBrowseEntry(cycle_)); resetFirstEntry(); positionTabs(); pageChanged(); } void MSNotebook::configure(void) { _redrawPixmap->resize(width(),height()); placement(); } void MSNotebook::firstMapNotify(void) { if (currentEntry()==0) currentEntry(firstItem()); int size=server()->fontManager()->fontStruct(font())->max_bounds.width; size=(sizeresize(size,size); downRightArrow()->resize(size,size); if (label()->columns()>0) label()->show(); computeSize(); resetFirstEntry(); positionTabs(); } void MSNotebook::naturalSize(void) { internalEvent(MSTrue); MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; NotebookEntry *entry; while ((np=np->next())!=hp) { entry=(NotebookEntry *) np->data(); entry->widget()->naturalSize(); } int w=label()->width(); label()->freeze(); label()->naturalSize(); label()->unfreeze(); if (w!=label()->width()) label()->redraw(); internalEvent(MSFalse); adjustSize(); } void MSNotebook::unfreeze(void) { freezeStatus(MSFalse); adjustSize(); } void MSNotebook::adjustSize(void) { if (firstMap()==MSTrue&&frozen()==MSFalse) { if (lockSize()==MSFalse) computeSize(); else { placement(); redraw(); } } } void MSNotebook::computeSize(void) { MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; int maxW=0,maxH=0; NotebookEntry *entry; while ((np=np->next())!=hp) { entry=(NotebookEntry *)np->data(); if (entry->widget()!=0) { maxW=(entry->widget()->width()>maxW)?entry->widget()->width():maxW; maxH=(entry->widget()->height()>maxH)?entry->widget()->height():maxH; } } int offset=highlightThickness()*2+shadowThickness()*2+frameThickness()*2; int w=offset+borderWidth()*2+marginWidth()*2+maxW+backpageMargin(); int h=offset+borderHeight()*2+marginHeight()*2+maxH+backpageMargin()+labelHeight(); if (orientation()==Horizontal) { w+=maxTabWidth(); if (showBinding()==MSTrue) w+=bindingWidth(); int minimumHeight=highlightThickness()*2+shadowThickness()*2+borderHeight()*2 +arrowHeight()*3+arrowOffset()*3+maxTabHeight()+labelHeight(); h=(hnext())!=hp) { entry=(NotebookEntry *)np->data(); if (entry->widget()!=0) { entry->widget()->resize(w,h); if (entry==currentEntry()) { entry->widget()->moveTo(x,y); entry->widget()->show(); } else if (entry->widget()->mapped()==MSTrue) entry->widget()->unmap(); } } if (showTabs()==MSTrue) { MSWidgetVector managedVector=managedChildren(); int managed=managedVector.length(); // Place the tabs if (orientation()==Horizontal) { int HeightOffset=highlightThickness()+shadowThickness()+borderHeight(); int totalSpace=availableHeightForTabs(); if (totalSpace>=totalTabHeight()) firstEntry(firstItem()); int top=HeightOffset+labelHeight(); int startY=top+arrowHeight()+arrowOffset(); int bpMargin=backpageMargin(); int startX,currentStartX; if (tabAlignment()==MSLeft) { currentStartX=x-marginWidth(); startX=currentStartX-frameThickness(); if (bpMargin!=0) startX-=(bpMargin-1); } else { startX=x+w+marginWidth()+frameThickness(); currentStartX=x+w+marginWidth(); if (bpMargin!=0) startX+=(bpMargin-1); } MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; NotebookEntry *entry; int numDrawn=0; MSBoolean foundFirstEntry=MSFalse; MSBoolean done=MSFalse; // We are using different strategy in moving the buttons, based on whether if the tabs // are being shifted forward or backward. This is an optimization to minimize expose // events sent to the tabs // Normal case: if (increment_==MSTrue) { while ((np=np->next())!=hp) { entry=(NotebookEntry *)np->data(); if (done==MSFalse&&(foundFirstEntry==MSTrue||entry==firstEntry())) { foundFirstEntry=MSTrue; if (entry->managed()==MSTrue) { if (entry->tab()->height()<=totalSpace) { int moveX; if (entry==currentEntry()) moveX=currentStartX; else moveX=startX; if (tabAlignment()==MSLeft) moveX-=entry->tab()->width(); entry->tab()->moveTo(moveX,startY); entry->tab()->map(); int used=entry->tab()->height()+tabSpacing(); totalSpace-=used; startY+=used; numDrawn++; } else { entry->tab()->unmap(); done=MSTrue; } } else entry->tab()->unmap(); } else entry->tab()->unmap(); } } else { //Optimized case: NotebookEntry *last=0; int space=totalSpace; while ((np=np->next())!=hp) { entry=(NotebookEntry *)np->data(); if (foundFirstEntry==MSTrue||entry==firstEntry()) { foundFirstEntry=MSTrue; if (entry->managed()==MSTrue) { if (entry->tab()->height()<=space) { space-=(entry->tab()->height()+tabSpacing()); last=entry; } else break; } } } np=hp; int start=startY+totalSpace-space; foundFirstEntry=MSFalse; while ((np=np->prev())!=hp) { entry=(NotebookEntry *)np->data(); if (foundFirstEntry==MSTrue||entry==last) { foundFirstEntry=MSTrue; int starty=start-entry->tab()->height()-tabSpacing(); if (entry->managed()==MSTrue&&starty>=startY) { int moveX; if (entry==currentEntry()) moveX=currentStartX; else moveX=startX; if (tabAlignment()==MSLeft) moveX-=entry->tab()->width(); entry->tab()->moveTo(moveX,starty); entry->tab()->map(); int used=entry->tab()->height()+tabSpacing(); start-=used; numDrawn++; } else entry->tab()->unmap(); } else entry->tab()->unmap(); } } if (firstEntry()!=0&&managed!=0&&numDrawn!=managed) { int arrowX; if (tabAlignment()==MSLeft) arrowX=startX-arrowWidth(); else arrowX=startX+arrowOffset(); upLeftArrow()->moveTo(arrowX,height()-HeightOffset-arrowHeight()*2-arrowOffset()); upLeftArrow()->map(); if (firstEntry()==firstItem()) upLeftArrow()->sensitive(MSFalse); else upLeftArrow()->sensitive(MSTrue); downRightArrow()->moveTo(arrowX,height()-HeightOffset-arrowHeight()); downRightArrow()->map(); if (managedVector.indexOf((unsigned long)firstEntry()->widget())+numDrawn==managed) downRightArrow()->sensitive(MSFalse); else downRightArrow()->sensitive(MSTrue); } else { upLeftArrow()->unmap(); downRightArrow()->unmap(); } } else { int WidthOffset=highlightThickness()+shadowThickness()+borderWidth(); int totalSpace=availableWidthForTabs(); if (totalSpace>=totalTabWidth()) firstEntry(firstItem()); int startX=WidthOffset+arrowWidth()+arrowOffset(); int bpMargin=backpageMargin(); int startY,currentStartY; if (tabAlignment()==MSTop) { currentStartY=y-marginHeight(); startY=currentStartY-frameThickness(); if (bpMargin!=0) startY-=(bpMargin-1); } else { startY=y+h+marginHeight()+frameThickness(); currentStartY=y+h+marginHeight()-1; if (bpMargin!=0) startY+=(bpMargin-2); } MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; NotebookEntry *entry; int numDrawn=0; MSBoolean foundFirstEntry=MSFalse; MSBoolean done=MSFalse; // We are using different strategy in moving the buttons, based on whether if the tabs // are being shifted forward or backward. This is an optimization to minimize expose // events sent to the tabs if (increment_==MSTrue) { while ((np=np->next())!=hp) { entry=(NotebookEntry *)np->data(); if (done==MSFalse&&(foundFirstEntry==MSTrue||entry==firstEntry())) { foundFirstEntry=MSTrue; if (entry->managed()==MSTrue) { if (entry->tab()->width()<=totalSpace) { int moveY; if (entry==currentEntry()) moveY=currentStartY; else moveY=startY; if (tabAlignment()==MSTop) moveY-=entry->tab()->height(); entry->tab()->moveTo(startX,moveY); entry->tab()->map(); int used=entry->tab()->width()+tabSpacing(); totalSpace-=used; startX+=used; numDrawn++; } else { entry->tab()->unmap(); done=MSTrue; } } else entry->tab()->unmap(); } else entry->tab()->unmap(); } } else { NotebookEntry *last=0; int space=totalSpace; while ((np=np->next())!=hp) { entry=(NotebookEntry *)np->data(); if (foundFirstEntry==MSTrue||entry==firstEntry()) { foundFirstEntry=MSTrue; if (entry->managed()==MSTrue) { if (entry->tab()->width()<=space) { space-=(entry->tab()->width()+tabSpacing()); last=entry; } else break; } } } np=hp; int start=startX+totalSpace-space; foundFirstEntry=MSFalse; while ((np=np->prev())!=hp) { entry=(NotebookEntry *)np->data(); if (foundFirstEntry==MSTrue||entry==last) { foundFirstEntry=MSTrue; int startx=start-entry->tab()->width()-tabSpacing(); if (entry->managed()==MSTrue&&startx>=startX) { int moveY; if (entry==currentEntry()) moveY=currentStartY; else moveY=startY; if (tabAlignment()==MSTop) moveY-=entry->tab()->height(); entry->tab()->moveTo(startx,moveY); entry->tab()->map(); int used=entry->tab()->width()+tabSpacing(); start-=used; numDrawn++; } else entry->tab()->unmap(); } else entry->tab()->unmap(); } } if (firstEntry()!=0&&managed!=0&&numDrawn!=managed) { int arrowY; if (tabAlignment()==MSTop) arrowY=startY-arrowHeight(); else arrowY=startY+arrowOffset(); upLeftArrow()->moveTo(width()-WidthOffset-arrowWidth()*2-arrowOffset(),arrowY); upLeftArrow()->map(); if (firstEntry()==firstItem()) upLeftArrow()->sensitive(MSFalse); else upLeftArrow()->sensitive(MSTrue); downRightArrow()->moveTo(width()-WidthOffset-arrowWidth(),arrowY); downRightArrow()->map(); if (managedVector.indexOf((unsigned long)firstEntry()->widget())+numDrawn==managed) downRightArrow()->sensitive(MSFalse); else downRightArrow()->sensitive(MSTrue); } else { upLeftArrow()->unmap(); downRightArrow()->unmap(); } } } internalEvent(MSFalse); } int MSNotebook::visibleTabs(void) { int numVisible=0; if (orientation()==Horizontal) { int totalSpace=availableHeightForTabs(); if (totalSpace>=totalTabHeight()) numVisible=numManaged(); else { MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; NotebookEntry *entry; MSBoolean foundFirstEntry=MSFalse; while ((np=np->next())!=hp) { entry=(NotebookEntry *)np->data(); if (foundFirstEntry==MSTrue||entry==firstEntry()) { foundFirstEntry=MSTrue; if (entry->managed()==MSTrue) { if (entry->tab()->height()<=totalSpace) { int used=entry->tab()->height()+tabSpacing(); totalSpace-=used; numVisible++; } else break; } } } } } else { int totalSpace=availableWidthForTabs(); if (totalSpace>=totalTabWidth()) numVisible=numManaged(); else { MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; NotebookEntry *entry; MSBoolean foundFirstEntry=MSFalse; while ((np=np->next())!=hp) { entry=(NotebookEntry *)np->data(); if (foundFirstEntry==MSTrue||entry==firstEntry()) { foundFirstEntry=MSTrue; if (entry->managed()==MSTrue) { if (entry->tab()->width()<=totalSpace) { int used=entry->tab()->width()+tabSpacing(); totalSpace-=used; numVisible++; } else break; } } } } } return numVisible; } void MSNotebook::childCreate(MSWidget *widget_) { if (internalEvent()==MSFalse) { insertChild(widget_); adjustSize(); } } void MSNotebook::childInsert(MSWidget *widget_) { insertChild(widget_); if (widget_->mapped()==MSTrue) widget_->unmap(); adjustSize(); } void MSNotebook::insertChild(MSWidget *widget_) { NotebookEntry *entry=getEntry(widget_); if (entry==0&&widget_!=0) { entry=new NotebookEntry(this,widget_); MSNodeItem *np=new MSNodeItem((void *)entry); np->insert(childListHead()); // fifo updateTitleVector(); _childCount++; } } void MSNotebook::childDestroy(MSWidget *widget_) { if (internalEvent()==MSFalse) { NotebookEntry *entry=getEntry(widget_); if (entry!=0) { removeChild(widget_); adjustSize(); } } } void MSNotebook::childRemove(MSWidget *widget_) { NotebookEntry *entry=getEntry(widget_); if (entry!=0) { removeChild(widget_); adjustSize(); } } void MSNotebook::childMap(MSWidget *widget_) { if (internalEvent()==MSFalse) { NotebookEntry *entry=getEntry(widget_); // If the child is mapping itself when it's not supposed to // we'll move it beyond screen limit if (entry!=0&¤tEntry()!=entry) widget_->moveTo(server()->width(),server()->height()); } } void MSNotebook::removeChild(MSWidget *widget_) { NotebookEntry *entry=0; MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; // check the child list while ((np=np->next())!=hp) { entry=(NotebookEntry *)np->data(); if (entry->widget()==widget_) { if (firstEntry()==entry) { NotebookEntry *prev=previousEntry(); if (prev!=entry) firstEntry(prev); else { entry->managed(MSFalse); firstEntry(firstItem()); } } if (currentEntry()==entry) _currentEntry=0; delete np; delete entry; _childCount--; break; } } updateTitleVector(); } void MSNotebook::childConfigure(MSWidget *widget_) { if (internalEvent()==MSFalse) { NotebookEntry *entry=getEntry(widget_); if (entry!=0) adjustSize(); } } int MSNotebook::computeMinimumWidth(void) { int w=highlightThickness()*2+shadowThickness()*2+frameThickness()*2+marginWidth()*2 +borderWidth()*2+backpageMargin(); if (orientation()==Horizontal) { w+=maxTabWidth(); if (showBinding()==MSTrue) w+=bindingWidth(); } int labelW=labelWidth(); return ((labelW>w)?labelW:w); } int MSNotebook::computeMinimumHeight(void) { int h=highlightThickness()*2+shadowThickness()*2+frameThickness()*2+marginHeight()*2 +borderHeight()*2+backpageMargin()+labelHeight(); if (orientation()==Vertical) { h+=maxTabHeight(); if (showBinding()==MSTrue) h+=bindingWidth(); } return h; } void MSNotebook::computeChildSize(int &w_,int &h_) { int offset=(highlightThickness()+shadowThickness()+frameThickness())*2; w_=width()-offset-marginWidth()*2-borderWidth()*2-backpageMargin(); h_=height()-offset-marginHeight()*2-borderHeight()*2-backpageMargin()-labelHeight(); if (showBinding()==MSTrue) { if (orientation()==Horizontal) w_-=bindingWidth(); else h_-=bindingWidth(); } if (orientation()==Horizontal) w_-=maxTabWidth(); else h_-=maxTabHeight(); w_=(w_>0)?w_:1; h_=(h_>0)?h_:1; } void MSNotebook::visibilityObscured(void) { visible(MSFalse); MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; NotebookEntry *entry; while((np=np->next())!=hp) { entry=(NotebookEntry *)np->data(); if (entry!=0) visibilityObscuredNotify(entry->widget()); } } // visibilityUnobscured() method needs to be selective: only set visible to // MSTrue on the current page, since it is the only one that will be shown. // Otherwise, it leads to undesirable side effects, such as unvisible // widgets having visible(MSTrue) void MSNotebook::visibilityUnobscured(void) { visible(MSTrue); if(_currentEntry!=0) { visibilityUnobscuredNotify(_currentEntry->widget()); } } MSNotebook::NotebookEntry *MSNotebook::getEntry(MSWidget *widget_) const { MSNodeItem *hp=(MSNodeItem *)childListHead(); MSNodeItem *np=hp; NotebookEntry *entry; while ((np=np->next())!=hp) { entry=(NotebookEntry *) np->data(); if (entry->widget()==widget_) return entry; } return 0; } MSNotebook::NotebookEntry *MSNotebook::getEntry(const char *title_) const { MSNodeItem *hp=(MSNodeItem *)childListHead(); MSNodeItem *np=hp; NotebookEntry *entry; MSString title(title_); while ((np=np->next())!=hp) { entry=(NotebookEntry *) np->data(); if (entry->title()==MSStringVector(title)) return entry; } return 0; } MSNotebook::NotebookEntry *MSNotebook::getEntry(unsigned i_) const { MSNodeItem *hp=(MSNodeItem *)childListHead(); MSNodeItem *np=hp; NotebookEntry *entry; unsigned j=0; while ((np=np->next())!=hp) { entry=(NotebookEntry *) np->data(); if (entry->managed()==MSTrue) { if (j++==i_) return entry; } } return 0; } void MSNotebook::firstEntry(NotebookEntry *firstEntry_) { _firstEntry=firstEntry_; } void MSNotebook::lastEntry(NotebookEntry *lastEntry_) { int count=0; if (orientation()==Horizontal) { int totalSpace=availableHeightForTabs(); if (totalSpace>=totalTabHeight()) firstEntry(firstItem()); else { MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; NotebookEntry *entry; MSBoolean foundlastEntry=MSFalse; while ((np=np->prev())!=hp) { entry=(NotebookEntry *)np->data(); if (foundlastEntry==MSTrue||entry==lastEntry_) { foundlastEntry=MSTrue; if (entry->managed()==MSTrue) { if (entry->tab()->height()<=totalSpace) { int used=entry->tab()->height()+tabSpacing(); totalSpace-=used; count++; } else break; } } } if (count>1) { MSWidgetVector managedVector=managedChildren(); int index=managedVector.indexOf((unsigned long)lastEntry_->widget())-count+1; if (index<0) firstEntry(firstItem()); else firstEntry(getEntry(managedVector(index))); } else firstEntry(lastEntry_); } } else { int totalSpace=availableWidthForTabs(); if (totalSpace>=totalTabWidth()) firstEntry(firstItem()); else { MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; NotebookEntry *entry; MSBoolean foundlastEntry=MSFalse; while ((np=np->prev())!=hp) { entry=(NotebookEntry *)np->data(); if (foundlastEntry==MSTrue||entry==lastEntry_) { foundlastEntry=MSTrue; if (entry->managed()==MSTrue) { if (entry->tab()->width()<=totalSpace) { int used=entry->tab()->width()+tabSpacing(); totalSpace-=used; count++; } else break; } } } if (count>1) { MSWidgetVector managedVector=managedChildren(); int index=managedVector.indexOf((unsigned long)lastEntry_->widget())-count+1; if (index<0) firstEntry(firstItem()); else firstEntry(getEntry(managedVector(index))); } else firstEntry(lastEntry_); } } } void MSNotebook::resetFirstEntry(void) { if (currentEntry()!=0) { if (firstEntry()==0) firstEntry(firstItem()); MSWidgetVector managedVector=managedChildren(); int first=managedVector.indexOf((unsigned long)firstEntry()->widget()); int current=managedVector.indexOf((unsigned long)currentEntry()->widget()); if (current=first+numShown) { lastEntry(currentEntry()); } } } else if (numManaged()==0) { firstEntry(0); } } MSNotebook::NotebookEntry *MSNotebook::nextEntry(void) { MSNodeItem *hp=(MSNodeItem *)childListHead(); MSNodeItem *np=hp; if (firstEntry()!=0) { while ((np=np->next())!=hp) { if (firstEntry()==(NotebookEntry *)np->data()) break; } if (np==hp) return firstEntry(); } NotebookEntry *next; while ((np=np->next())!=hp) { next=(NotebookEntry *)np->data(); if (next->managed()==MSTrue) return next; } return firstEntry(); } MSNotebook::NotebookEntry *MSNotebook::nextBrowseEntry(MSBoolean cycle_) { MSNodeItem *hp=(MSNodeItem *)childListHead(); MSNodeItem *np=hp; if (currentEntry()!=0) { while ((np=np->next())!=hp) { if (currentEntry()==(NotebookEntry *)np->data()) break; } if (np==hp) return currentEntry(); } NotebookEntry *next; while ((np=np->next())!=hp) { next=(NotebookEntry *)np->data(); if (next->managed()==MSTrue) return next; } if ( cycle_ == MSFalse )return currentEntry(); return firstItem(); } MSNotebook::NotebookEntry *MSNotebook::previousEntry(void) { MSNodeItem *hp=(MSNodeItem *)childListHead(); MSNodeItem *np=hp; if (firstEntry()!=0) { while ((np=np->prev())!=hp) { if (firstEntry()==(NotebookEntry *)np->data()) break; } if (np==hp) return firstEntry(); } NotebookEntry *prev; while ((np=np->prev())!=hp) { prev=(NotebookEntry *)np->data(); if (prev->managed()==MSTrue) return prev; } return firstEntry(); } MSNotebook::NotebookEntry *MSNotebook::previousBrowseEntry(MSBoolean cycle_) { MSNodeItem *hp=(MSNodeItem *)childListHead(); MSNodeItem *np=hp; if (currentEntry()!=0) { while ((np=np->prev())!=hp) { if (currentEntry()==(NotebookEntry *)np->data()) break; } if (np==hp) return currentEntry(); } NotebookEntry *prev; while ((np=np->prev())!=hp) { prev=(NotebookEntry *)np->data(); if (prev->managed()==MSTrue) return prev; } if ( cycle_ == MSFalse )return currentEntry(); return lastItem(); } void MSNotebook::currentEntry(NotebookEntry *currentEntry_) { if (_currentEntry!=currentEntry_) { NotebookEntry *previousEntry=currentEntry(); _currentEntry=currentEntry_; if (currentEntry()!=0) { // Only Change the tab's colors if they haven't been changed if (currentEntry()->tab()->isModified(MSNotebookTabAttribute::TabForeground)==MSFalse) { currentEntry()->tab()->foreground(selectedPageForeground()); } if (currentEntry()->tab()->isModified(MSNotebookTabAttribute::TabBackground)==MSFalse) { currentEntry()->tab()->background(selectedPageBackground()); } currentEntry()->widget()->raise(); currentEntry()->widget()->show(); } if (previousEntry!=0) { previousEntry->tab()->foreground(previousEntry->tab()->tabForeground()); previousEntry->tab()->background(previousEntry->tab()->tabBackground()); previousEntry->widget()->unmap(); } } } void MSNotebook::updateTitle(void) { internalEvent(MSTrue); label()->freeze(); label()->foreground(titleForeground()); int h=label()->height(); int w=label()->width(); label()->font(titleFont()); MSBoolean doPlacement=MSFalse; label()->label(title()); int ml=label()->columns(); if (ml==0&&label()->mapped()==MSTrue) { label()->unmap(); doPlacement=MSTrue; } else if (ml>0&&label()->mapped()==MSFalse) { label()->map(); doPlacement=MSTrue; } positionLabel(); label()->unfreeze(); if (label()->height()!=h||label()->width()!=w||doPlacement==MSTrue) adjustSize(); else if (label()->mapped()==MSTrue) label()->redraw(); internalEvent(MSFalse); } void MSNotebook::positionLabel(void) { if (label()->columns()>0) { int offset=highlightThickness()+shadowThickness(); int xpos,ypos; int indent; if (titleAlignment()&MSLeft) { indent=XTextWidth(fontManager()->fontStruct(label()->font()),"M",1); xpos=offset+indent; } else if (titleAlignment()&MSRight) { indent=XTextWidth(fontManager()->fontStruct(label()->font()),"M",1); xpos=width()-offset-indent-label()->width(); } else xpos=width()/2-label()->width()/2; int shadowOffset; if (titleAlignment()&MSTop) { shadowOffset=label()->height(); ypos=0; } else if (titleAlignment()&MSBottom) { shadowOffset=0; ypos=offset; } else { shadowOffset=label()->height()/2+offset; ypos=offset; } if (shadowOffset!=topShadowOffset()) { undrawShadow(); topShadowOffset(shadowOffset); } label()->moveTo(xpos,ypos); label()->map(); } else { label()->unmap(); topShadowOffset(0); } } void MSNotebook::updateBackground(unsigned long oldBG_) { MSWidgetCommon::updateBackground(oldBG_); if (selectedPageBackground()==oldBG_) selectedPageBackground(background()); upLeftArrow()->background(background()); downRightArrow()->background(background()); label()->background(background()); if (_popupMenu!=0) _popupMenu->background(background()); createBindingPixmap(); redraw(); } void MSNotebook::updateForeground(unsigned long oldFG_) { MSManager::updateForeground(oldFG_); if (selectedPageForeground()==oldFG_) selectedPageForeground(foreground()); MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; while ((np=np->next())!=hp) { NotebookEntry *entry=(NotebookEntry *)np->data(); if (entry->tab()->isModified(MSNotebookTabAttribute::TabForeground)==MSFalse) { entry->tab()->tabForeground(foreground(),MSFalse); if (entry!=currentEntry()) entry->tab()->foreground(foreground()); } } if (label()->foreground()==oldFG_) label()->foreground(foreground()); if (_popupMenu!=0) _popupMenu->foreground(foreground()); createBindingPixmap(); redraw(); } void MSNotebook::updateFont(Font oldFont_) { internalEvent(MSTrue); MSManager::updateFont(oldFont_); int size=server()->fontManager()->fontStruct(font())->max_bounds.width; size=(sizeresize(size,size); downRightArrow()->resize(size,size); MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; while ((np=np->next())!=hp) { NotebookEntry *entry=(NotebookEntry *)np->data(); if (entry->tab()->isModified(MSNotebookTabAttribute::TabFont)==MSFalse) { entry->tab()->tabFont(font(),MSFalse); } } if (_popupMenu!=0) _popupMenu->font(font()); internalEvent(MSFalse); adjustSize(); } void MSNotebook::redraw(void) { if (mapped()==MSTrue) { redrawPixmap()->lock(); XFillRectangle(display(),redrawPixmap()->pixmap(),backgroundShadowGC(), 0,0,width(),height()); int ht=highlightThickness(); MSRect aRect(ht,ht+topShadowOffset(),width()-2*ht,height()-topShadowOffset()-2*ht); drawBevel(redrawPixmap()->pixmap(),aRect,shadowStyle(),shadowThickness()); drawBinding(redrawPixmap()->pixmap()); drawBackpage(redrawPixmap()->pixmap()); drawFrameShadow(redrawPixmap()->pixmap()); XCopyArea(display(),redrawPixmap()->pixmap(),window(),backgroundShadowGC(),0,0,width(),height(),0,0); redrawPixmap()->unlock(); } } void MSNotebook::show(void) { if (mapped()==MSFalse) { MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; while ((np=np->next())!=hp) { NotebookEntry *entry=(NotebookEntry *)np->data(); if (entry->widget()!=0) { entry->widget()->show(); } if (entry!=currentEntry()) entry->widget()->unmap(); } map(); } } void MSNotebook::print(const char *file_) { MSBoolean fileOpen=MSFalse; MSBoolean open=MSTrue; if (outputMode()==Draw) { if (file_!=0) displayPrintFileName(file_); if ((open=displayPrintOpen(this))==MSTrue) { fileOpen=MSTrue; outputMode(Print); displayPrintXorigin(0); displayPrintYorigin(0); } } if (open==MSTrue) { clear(); redraw(); MSWidget *pWidget; Window root,parent,*children=(Window *)0; unsigned int nchildren=0; (void)XQueryTree(display(),window(),&root,&parent,&children,&nchildren); for (int i=0;imapped()==MSTrue) { displayPrintOriginInc(pWidget); pWidget->print(); displayPrintOriginDec(pWidget); } } XFree((char *)children); if (fileOpen==MSTrue) { displayPrintClose(); outputMode(Draw); } } } void MSNotebook::drawBackpage(Window window_) { if (backpages()>0&&backpageThickness()>0) { XPoint ppoints[6]; XPoint lpoints[5]; int increment=backpageThickness(); int widthOffset=highlightThickness()+shadowThickness()+borderWidth(); int heightOffset=highlightThickness()+shadowThickness()+borderHeight(); int bindingW; if (showBinding()==MSTrue) bindingW=bindingWidth(); else bindingW=0; int oneThirdBinding=bindingW/3; int twoThirdBinding=bindingW-oneThirdBinding; int viewPortWidth=width()-widthOffset*2-backpageMargin(); int viewPortHeight=height()-heightOffset*2-backpageMargin()-labelHeight(); int xincrement,yincrement; if (orientation()==Horizontal) { int maxTab=maxTabWidth(); viewPortWidth-=(bindingW+maxTab); if (tabAlignment()==MSLeft) { ppoints[0].x=widthOffset+maxTab+backpageMargin(); ppoints[0].y=heightOffset+labelHeight()+increment; ppoints[1].x=0; ppoints[1].y=viewPortHeight-increment; ppoints[2].x=viewPortWidth+twoThirdBinding-increment; ppoints[2].y=0; ppoints[3].x=0; ppoints[3].y=increment-1; ppoints[4].x=-(viewPortWidth+twoThirdBinding); ppoints[4].y=0; ppoints[5].x=0; ppoints[5].y=-viewPortHeight; lpoints[0].x=ppoints[0].x; lpoints[0].y=ppoints[0].y; lpoints[1].x=-increment; lpoints[1].y=0; lpoints[2].x=0; lpoints[2].y=viewPortHeight-1; lpoints[3].x=viewPortWidth+twoThirdBinding; lpoints[3].y=0; lpoints[4].x=0; lpoints[4].y=-increment; xincrement=-increment; yincrement=increment; } else { ppoints[0].x=widthOffset+oneThirdBinding+increment; ppoints[0].y=height()-heightOffset-backpageMargin(); ppoints[1].x=width()-widthOffset*2-oneThirdBinding-backpageMargin()-increment-maxTab; ppoints[1].y=0; ppoints[2].x=0; ppoints[2].y=-(height()-heightOffset*2-backpageMargin()-labelHeight()-increment); ppoints[3].x=increment; ppoints[3].y=0; ppoints[4].x=0; ppoints[4].y=-ppoints[2].y+increment; ppoints[5].x=-ppoints[1].x-increment; ppoints[5].y=0; lpoints[0].x=ppoints[0].x; lpoints[0].y=ppoints[0].y; lpoints[1].x=0; lpoints[1].y=increment-1; lpoints[2].x=width()-widthOffset*2-oneThirdBinding-backpageMargin()-1-maxTab; lpoints[2].y=0; lpoints[3].x=0; lpoints[3].y=-(height()-heightOffset*2-backpageMargin()-labelHeight()); lpoints[4].x=-increment; lpoints[4].y=0; xincrement=increment; yincrement=increment; } } else { int maxTab=maxTabHeight(); viewPortHeight-=(bindingW+maxTab); if (tabAlignment()==MSTop) { ppoints[0].x=widthOffset+increment; ppoints[0].y=heightOffset+labelHeight()+maxTab+backpageMargin(); ppoints[1].x=viewPortWidth-increment; ppoints[1].y=0; ppoints[2].x=0; ppoints[2].y=viewPortHeight+twoThirdBinding-increment; ppoints[3].x=increment; ppoints[3].y=0; ppoints[4].x=0; ppoints[4].y=-viewPortHeight-twoThirdBinding; ppoints[5].x=-viewPortWidth; ppoints[5].y=0; lpoints[0].x=ppoints[0].x; lpoints[0].y=ppoints[0].y; lpoints[1].x=0; lpoints[1].y=-increment; lpoints[2].x=viewPortWidth-1; lpoints[2].y=0; lpoints[3].x=0; lpoints[3].y=viewPortHeight+twoThirdBinding; lpoints[4].x=-increment; lpoints[4].y=0; xincrement=increment; yincrement=-increment; } else { ppoints[0].x=widthOffset+increment; ppoints[0].y=height()-heightOffset-backpageMargin()-maxTab; ppoints[1].x=width()-widthOffset*2-backpageMargin()-increment; ppoints[1].y=0; ppoints[2].x=0; ppoints[2].y=-(height()-oneThirdBinding-heightOffset*2-backpageMargin()-labelHeight()-increment-maxTab); ppoints[3].x=increment; ppoints[3].y=0; ppoints[4].x=0; ppoints[4].y=-ppoints[2].y+increment; ppoints[5].x=-ppoints[1].x-increment; ppoints[5].y=0; lpoints[0].x=ppoints[0].x; lpoints[0].y=ppoints[0].y; lpoints[1].x=0; lpoints[1].y=increment-1; lpoints[2].x=width()-widthOffset*2-backpageMargin()-1; lpoints[2].y=0; lpoints[3].x=0; lpoints[3].y=-(height()-oneThirdBinding-heightOffset*2-backpageMargin()-labelHeight()-maxTab); lpoints[4].x=-increment; lpoints[4].y=0; xincrement=increment; yincrement=increment; } } XSetForeground(display(),backpageGC(),backpageBackground()); int i; for (i=0;i=MSNotebookMinimumBindingWidth) { if (width()>=MSNotebookMinimumBindingWidth&&height()>=MSNotebookMinimumBindingWidth) { if (outputMode()==Print) drawSpiral(); else { int w,h,xoff,yoff; if (orientation()==Horizontal) { w=bindingWidth(); h=height()-highlightThickness()*2-shadowThickness()*2-borderHeight()*2-backpageMargin()-labelHeight(); if (tabAlignment()==MSLeft) { xoff=width()-highlightThickness()-shadowThickness()-borderWidth()-bindingWidth(); yoff=highlightThickness()+shadowThickness()+borderHeight()+labelHeight(); } else { xoff=highlightThickness()+shadowThickness()+borderWidth(); yoff=highlightThickness()+shadowThickness()+borderHeight()+labelHeight(); } } else { w=width()-highlightThickness()*2-shadowThickness()*2-borderWidth()*2-backpageMargin(); h=bindingWidth(); if (tabAlignment()==MSTop) { xoff=highlightThickness()+shadowThickness()+borderWidth(); yoff=height()-highlightThickness()-shadowThickness()-borderHeight()-bindingWidth(); } else { xoff=highlightThickness()+shadowThickness()+borderWidth(); yoff=highlightThickness()+shadowThickness()+borderHeight()+labelHeight(); } } XCopyArea(display(),bindingPixmap(),window_,notebookGC(),0,0,w,h,xoff,yoff); } } } } void MSNotebook::drawFrameShadow(Window window_) { int offset=highlightThickness()+shadowThickness(); int offset2=offset*2; int x,y; int w=width()-offset2-borderWidth()*2-backpageMargin(); int h=height()-offset2-borderHeight()*2-backpageMargin()-labelHeight(); if (orientation()==Horizontal) { int maxTabW=maxTabWidth(); if (tabAlignment()==MSLeft) { x=offset+borderWidth()+maxTabW+backpageMargin(); y=offset+borderHeight()+labelHeight(); if (showBinding()==MSTrue) w-=bindingWidth(); w-=maxTabW; } else { x=offset+borderWidth(); y=offset+borderHeight()+labelHeight(); if (showBinding()==MSTrue) { x+=bindingWidth(); w-=bindingWidth(); } w-=maxTabW; } } else { int maxTabH=maxTabHeight(); if (tabAlignment()==MSTop) { x=offset+borderWidth(); y=offset+borderHeight()+labelHeight()+maxTabH+backpageMargin(); if (showBinding()==MSTrue) h-=bindingWidth(); h-=maxTabH; } else { x=offset+borderWidth(); y=offset+borderHeight()+labelHeight(); if (showBinding()==MSTrue) { y+=bindingWidth(); h-=bindingWidth(); } h-=maxTabH; } } GC topGC,bottomGC; if (currentEntry()!=0) { topGC=currentEntry()->tab()->topShadowGC(); bottomGC=currentEntry()->tab()->bottomShadowGC(); } else { topGC=topShadowGC(); bottomGC=bottomShadowGC(); } if (frameThickness()>0) { drawBevelShadow(window_,MSRect(x,y,w,h),frameThickness(),topGC,bottomGC); } if (currentEntry()!=0&&marginWidth()>0&&marginHeight()>0) { x+=frameThickness(); y+=frameThickness(); w-=(frameThickness()*2); h-=(frameThickness()*2); XFillRectangle(display(),window_,currentEntry()->tab()->backgroundShadowGC(),x,y,w,h); } } void MSNotebook::drawSpiral(void) { createBindingPixmap(); } void MSNotebook::createBindingPixmap(void) { // First checking if binding width is big enough if (showBinding()==MSTrue) { int w,h; if (orientation()==Horizontal) { w=bindingWidth(); h=height()-highlightThickness()*2-shadowThickness()*2-borderHeight()*2-backpageMargin()-labelHeight(); } else { w=width()-highlightThickness()*2-shadowThickness()*2-borderWidth()*2-backpageMargin(); h=bindingWidth(); } if (w>=MSNotebookMinimumBindingWidth&&h>=MSNotebookMinimumBindingWidth) { int rx,ry,rw,rh; // rectangle values for binding surface int sx,sy,sw,sh,sd; // spiral values int a1,a2,a3,a4; // spiral angle values int hx,hy,hd; // hole values int lx1,ly1,lx2,ly2; // line values for binding edge int pw,ph; // pixmap size int gap; // gap between spirals int div; // division of binding width // Determine spiral component values if (orientation()==Horizontal) { if (tabAlignment()==MSLeft) { div=w/3; gap=div/2; pw=w; ph=div+gap; sx=div-1; sy=gap/2; sw=div*2; sh=div; sd=sh/4; a1=275; a2=270; a3=90-10; a4=100; hx=sx-(sd/2); hy=sy+(sh/2)-sd+1; hd=MSUtil::min(div,sd*2); rx=0; ry=0; rw=pw-div; rh=ph; lx1=pw-div; ly1=0; lx2=lx1; ly2=rh; } else { div=w/3; gap=div/2; pw=w; ph=div+gap; sx=0; sy=gap/2; sw=div*2; sh=div; sd=sh/4; a1=270-20; a2=-270; a3=90-20; a4=110; hx=sx+sw-sd; hy=sy+(sh/2)-sd+1; hd=MSUtil::min(div,sd*2); rx=div; ry=0; rw=w-div; rh=ph; lx1=div; ly1=0; lx2=lx1; ly2=ph; } } else { if (tabAlignment()==MSTop) { div=h/3; gap=div/2; pw=div+gap; ph=h; sx=gap/2; sy=div-1; sw=div; sh=(div*2); sd=sw/4; a1=360-5; a2=-295; a3=90+8; a4=110; hx=sx+(sw/2); hy=sy; hd=MSUtil::min(div,sd*2); rx=0; ry=0; rw=pw; rh=ph-div; lx1=0; ly1=ph-div; lx2=pw; ly2=ly1; } else { div=h/3; gap=div/2; pw=div+gap; ph=h; sx=gap/2; sy=0; sw=div; sh=div*2; sd=sw/4; a1=15; a2=270; a3=90; a4=110; hx=sx+(sw/2)-sd+1; hy=sh-sd; hd=MSUtil::min(div,sd*2); rx=0; ry=div; rw=pw; rh=h-div; lx1=0; ly1=div; lx2=pw; ly2=ly1; } } Window dest=0; int xoff,yoff; int oldXoff, oldYoff; int count,dx,dy; // If we're int Draw mode, then we want to draw one spiral into a scratch pad pixmap // and use XCopyArea to repeatedly copy it to the binding pixmap that we want // otherwise (Print mode), we want to draw directly into the window. if (outputMode()0) { if (orientation()==Horizontal) XCopyArea(display(),dest,bindingPixmap(),notebookGC(),0,0,pw,remainder,xoff,yoff); else XCopyArea(display(),dest,bindingPixmap(),notebookGC(),0,0,remainder,ph,xoff,yoff); } xoff=0; yoff=0; XFreePixmap(display(),dest); } else { if (remainder>0) { if (orientation()==Horizontal) XDrawLine(display(),dest,notebookGC(),lx1+xoff,ly1+yoff,lx2+xoff,ly1+remainder+yoff-1); else XDrawLine(display(),dest,notebookGC(),lx1+xoff,ly1+yoff,lx1+remainder+xoff-1,ly2+yoff); } xoff=oldXoff; yoff=oldYoff; } if (frameThickness()>0) { int x1,y1,x2,y2; if (orientation()==Horizontal) { if (tabAlignment()==MSLeft) { x1=xoff; y1=yoff; x2=xoff+bindingWidth()-bindingWidth()/3; y2=y1; XDrawLine(display(),bindingPixmap(),topShadowGC(),x1,y1,x2,y2); y1=yoff+h-1; y2=y1; XDrawLine(display(),bindingPixmap(),bottomShadowGC(),x1,y1,x2,y2); } else { x1=xoff+bindingWidth()/3; y1=yoff; x2=xoff+bindingWidth(); y2=y1; XDrawLine(display(),bindingPixmap(),topShadowGC(),x1,y1,x2,y2); y1=yoff+h-1; y2=y1; XDrawLine(display(),bindingPixmap(),bottomShadowGC(),x1,y1,x2,y2); } } else { if (tabAlignment()==MSTop) { x1=xoff; y1=yoff; x2=x1; y2=yoff+bindingWidth()-bindingWidth()/3; XDrawLine(display(),bindingPixmap(),topShadowGC(),x1,y1,x2,y2); x1=xoff+w-1; x2=x1; XDrawLine(display(),bindingPixmap(),bottomShadowGC(),x1,y1,x2,y2); } else { x1=xoff; y1=yoff+bindingWidth()/3; x2=x1; y2=yoff+bindingWidth(); XDrawLine(display(),bindingPixmap(),topShadowGC(),x1,y1,x2,y2); x1=xoff+w-1; x2=x1; XDrawLine(display(),bindingPixmap(),bottomShadowGC(),x1,y1,x2,y2); } } } } } } MSWidgetVector MSNotebook::children(void) { MSWidgetVector vector; MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; while ((np=np->next())!=hp) { NotebookEntry *entry=(NotebookEntry *)np->data(); vector.append(entry->widget()); } return vector; } MSWidgetVector MSNotebook::managedChildren(void) { MSWidgetVector vector; MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; while ((np=np->next())!=hp) { NotebookEntry *entry=(NotebookEntry *)np->data(); if (entry->managed()==MSTrue) vector.append(entry->widget()); } return vector; } void MSNotebook::updateTitleVector(void) { MSStringVector vector; MSNodeItem *hp=(MSNodeItem *)childListHead(); MSNodeItem *np=hp; while ((np=np->next())!=hp) { NotebookEntry *entry=(NotebookEntry *)np->data(); if (entry->managed()==MSTrue) { vector.append(entry->title()(0)); } } _titleVector=vector; if (_popupMenu!=0) { updatePopupMenu(); _popupMenu->columns(titleVector().length()/10+1); } } void MSNotebook::updatePopupMenu(void) { if (_popupMenu!=0) { unsigned i=0; MSNodeItem *hp=(MSNodeItem *)childListHead(); MSNodeItem *np=hp; while ((np=np->next())!=hp) { NotebookEntry *entry=(NotebookEntry *)np->data(); if (entry->managed()==MSTrue) { if (entry->tab()->sensitive()==MSTrue) _popupMenu->taggedMenuItem(i++)->sensitive(MSTrue); else _popupMenu->taggedMenuItem(i++)->sensitive(MSFalse); } } } } MSStringVector MSNotebook::hiddenTitles(void) const { MSStringVector vector; MSNodeItem *hp=(MSNodeItem *)childListHead(); MSNodeItem *np=hp; while ((np=np->next())!=hp) { NotebookEntry *entry=(NotebookEntry *)np->data(); if (entry->managed()==MSFalse) vector.append(entry->title()(0)); } return vector; } void MSNotebook::permuteTitles(const MSStringVector &aStringVector_) { MSNodeItem newList; MSNodeItem *hp=childListHead(); MSNodeItem *np; for (unsigned i=0;inext())!=hp) { NotebookEntry *entry=(NotebookEntry *)np->data(); if (entry->title()==aStringVector_(i)) { entry->managed(MSTrue); np->remove(); np->insert(&newList); break; } } } MSNodeItem *next=hp->next(); np=next; while(np!=hp) { NotebookEntry *entry=(NotebookEntry *)np->data(); entry->managed(MSFalse); entry->widget()->unmap(); // To make sure it is unmapped next=np->next(); np->remove(); np->insert(&newList); np=next; } next=newList.next(); np=next; while(np!=&newList) { next=np->next(); np->remove(); np->insert(hp); np=next; } updateTitleVector(); firstEntry(firstItem()); if (currentEntry()!=0) { if (currentEntry()->managed()==MSTrue) resetFirstEntry(); else currentEntry(0); } if (firstMap()==MSTrue) { positionTabs(); redraw(); } } void MSNotebook::permuteWidgets(const MSWidgetVector &aWidgetVector_) { MSNodeItem newList; MSNodeItem *hp=childListHead(); MSNodeItem *np; for (unsigned i=0;inext())!=hp) { NotebookEntry *entry=(NotebookEntry *)np->data(); if (entry->widget()==aWidgetVector_(i)) { entry->managed(MSTrue); np->remove(); np->insert(&newList); break; } } } MSNodeItem *next=hp->next(); np=next; while(np!=hp) { NotebookEntry *entry=(NotebookEntry *)np->data(); entry->managed(MSFalse); entry->widget()->unmap(); // To make sure it is unmapped next=np->next(); np->remove(); np->insert(&newList); np=next; } next=newList.next(); np=next; while(np!=&newList) { next=np->next(); np->remove(); np->insert(hp); np=next; } updateTitleVector(); firstEntry(firstItem()); if (currentEntry()!=0) { if (currentEntry()->managed()==MSTrue) resetFirstEntry(); else currentEntry(0); } if (firstMap()==MSTrue) { positionTabs(); redraw(); } } MSNotebook::NotebookEntry *MSNotebook::firstItem(void) { MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; while ((np=np->next())!=hp) { NotebookEntry *entry=(NotebookEntry *)np->data(); if (entry->managed()==MSTrue) return entry; } return (NotebookEntry *)0; } MSNotebook::NotebookEntry *MSNotebook::lastItem(void) { MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; while ((np=np->prev())!=hp) { NotebookEntry *entry=(NotebookEntry *)np->data(); if (entry->managed()==MSTrue) return entry; } return (NotebookEntry *)0; } int MSNotebook::arrowWidth(void) { int w=upLeftArrow()->width(); if (orientation()==Horizontal) return w+arrowOffset(); else return w; } int MSNotebook::arrowHeight(void) { int h=upLeftArrow()->height(); if (orientation()==Vertical) return h+arrowOffset(); else return h; } int MSNotebook::totalTabWidth(void) { int totalW=0; if (showTabs()==MSTrue) { MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; NotebookEntry *entry; int numTabs=0; while ((np=np->next())!=hp) { entry=(NotebookEntry *)np->data(); if (entry!=0&&entry->managed()==MSTrue) { totalW+=entry->tab()->width(); numTabs++; } } if (numTabs>1) totalW+=((numTabs-1)*tabSpacing()); } return totalW; } int MSNotebook::maxTabWidth(void) { int maxW=0; if (showTabs()==MSTrue) { MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; NotebookEntry *entry; while ((np=np->next())!=hp) { entry=(NotebookEntry *)np->data(); if (entry!=0&&entry->managed()==MSTrue) { int w=entry->tab()->width(); maxW=(maxWnext())!=hp) { entry=(NotebookEntry *)np->data(); if (entry!=0&&entry->managed()==MSTrue) { totalH+=entry->tab()->height(); numTabs++; } } if (numTabs>1) totalH+=((numTabs-1)*tabSpacing()); } return totalH; } int MSNotebook::maxTabHeight(void) { int maxH=0; if (showTabs()==MSTrue) { MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; NotebookEntry *entry; while ((np=np->next())!=hp) { entry=(NotebookEntry *)np->data(); if (entry!=0&&entry->managed()==MSTrue) { int h=entry->tab()->height(); maxH=(maxHactiveMenuItem()->tag()); if (entry!=0&&entry!=currentEntry()) { currentEntry(entry); resetFirstEntry(); positionTabs(); pageChanged(); } } void MSNotebook::pageSelected(NotebookEntry *entry_) { if (currentEntry()!=entry_) { currentEntry(entry_); positionTabs(); pageChanged(); } } void MSNotebook::pageChanged(void) { activateCallback(MSWidgetCallback::pagechange); } int MSNotebook::numManaged(void) { int num=0; MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; while ((np=np->next())!=hp) { NotebookEntry *entry=(NotebookEntry *)np->data(); if (entry->managed()==MSTrue) num++; } return num; } void MSNotebook::installPopup(MSPopupMenu *applicationPopup_) { if (_applicationPopup!=applicationPopup_) { if (_applicationPopup!=0) _applicationPopup->destroy(); _applicationPopup=applicationPopup_; } } MSPopupMenu *MSNotebook::popupMenu(void) { if (_applicationPopup!=0) return _applicationPopup; else { if (_popupMenu==0) { _popupMenu=new MSStringPopupMenu(server(),titleVector()); _popupMenu->font(font()); _popupMenu->foreground(foreground()); _popupMenu->background(background()); _popupMenu->callback(MSWidgetCallback::activate, new MSMethodCallback(this,&MSNotebook::menuSelection)); _popupMenu->columns(titleVector().length()/10+1); updatePopupMenu(); } if (titleVector().length()>0) return _popupMenu; else return 0; } } MSBoolean MSNotebook::okToSwitch(void) { MSWidget *focus=inputFocus(); if (focus!=0) { MSWidgetCursor cursor(this); for (cursor.setToFirst();cursor.isValid()==MSTrue;cursor.setToNext()) { if (focus==cursor.widget()) return top()->traverseFocus(0); } return MSTrue; } else return MSTrue; } void MSNotebook::buttonPress(const XEvent *event_) { buttonPressNotify(this,event_); } void MSNotebook::button3Press(const XEvent *) { if (showPopup()==MSTrue&&isProtected()==MSFalse&&okToSwitch()==MSTrue) { MSPopupMenu *popup=popupMenu(); if (popup!=0) popup->showAtPointer(); } else server()->bell(); } void MSNotebook::set(MSAttrValueList& avList_) { MSManager::set(avList_); MSIndexVector index; for (unsigned i=0;inext())!=hp) { NotebookEntry *entry=(NotebookEntry *)np->data(); if (entry->managed()==MSTrue) { pageTitles.append(MSAttrValue::stringVectorToString(entry->tab()->label())); } } avList_<colorName(backpageForeground()),MSAttrValue::Color); avList_<colorName(backpageBackground()),MSAttrValue::Color); avList_<colorName(selectedPageForeground()),MSAttrValue::Color); avList_<colorName(selectedPageBackground()),MSAttrValue::Color); avList_<colorName(frameBackground()),MSAttrValue::Color); avList_<internalEvent(MSTrue); _tab=new NotebookTab(owner_,this,title_); // Map the tab so it can calculate its size tab()->foreground(owner_->foreground()); tab()->tabForeground(owner_->foreground(),MSFalse); tab()->background(owner_->backpageBackground()); tab()->tabBackground(owner_->backpageBackground(),MSFalse); tab()->moveTo(tab()->server()->width(),tab()->server()->height()); tab()->show(); tab()->unmap(); owner_->internalEvent(MSFalse); } MSNotebook::NotebookEntry::~NotebookEntry(void) { MSNotebook *notebook=(MSNotebook*)tab()->owner(); MSBoolean currentEvent=notebook->internalEvent(); notebook->internalEvent(MSTrue); tab()->destroy(); notebook->internalEvent(currentEvent); } MSNotebook::NotebookTab::NotebookTab(MSWidget *owner_,NotebookEntry *entry_,const char *title_) : MSIconButton(owner_,title_), _entry(entry_) { _labelAlignment=MSRight; _acceptFocus=MSFalse; _highlightThickness=0; _margin=4; _dynamic=MSTrue; _modifiedFlag=0; removeFromFocusList(); } MSNotebook::NotebookTab::~NotebookTab(void) {} void MSNotebook::NotebookTab::redraw(void) { MSIconButton::redraw(); blendIn(); } void MSNotebook::NotebookTab::blendIn(void) { if (mapped()==MSTrue&&frozen()==MSFalse&&shadowThickness()>0) { MSNotebook *notebook=(MSNotebook *)owner(); GC gc=notebook->backpageGC(); if (notebook->currentEntry()!=0&¬ebook->currentEntry()->tab()==this) { XSetForeground(display(),gc,notebook->selectedPageBackground()); } else { XSetForeground(display(),gc,notebook->backpageBackground()); } if (armed()==MSTrue) gc=selectShadowGC(); else gc=backgroundShadowGC(); XPoint points[4]; if (notebook->orientation()==Horizontal) { if (height()>=shadowThickness()*2) { if (notebook->tabAlignment()==MSLeft) { points[0].x=width(); points[0].y=0; points[1].x=0; points[1].y=height(); points[2].x=-shadowThickness(); points[2].y=-shadowThickness(); points[3].x=0; points[3].y=-(height()-shadowThickness()*2); } else { points[0].x=0; points[0].y=0; points[1].x=shadowThickness(); points[1].y=shadowThickness(); points[2].x=0; points[2].y=height()-shadowThickness()*2; points[3].x=-shadowThickness(); points[3].y=shadowThickness(); } XBFillPolygon(display(),window(),gc,points,4,Convex,CoordModePrevious); } } else { if (width()>=shadowThickness()*2) { if (notebook->tabAlignment()==MSTop) { points[0].x=0; points[0].y=height(); points[1].x=width(); points[1].y=0; points[2].x=-shadowThickness(); points[2].y=-shadowThickness(); points[3].x=-(width()-shadowThickness()*2); points[3].y=0; } else { points[0].x=0; points[0].y=0; points[1].x=shadowThickness(); points[1].y=shadowThickness(); points[2].x=width()-shadowThickness()*2; points[2].y=0; points[3].x=shadowThickness(); points[3].y=-shadowThickness(); } XBFillPolygon(display(),window(),gc,points,4,Convex,CoordModePrevious); } } } } void MSNotebook::NotebookTab::buttonPress(const XEvent *event_) { if (sensitive()==MSTrue&&event_->xbutton.button==Button1) { MSNotebook *notebook=(MSNotebook *)owner(); if (notebook->isProtected()==MSFalse&¬ebook->okToSwitch()==MSTrue) arm(); else server()->bell(); } else if (event_->xbutton.button==Button3) { buttonPressNotify(owner(),event_); } } void MSNotebook::NotebookTab::motionNotify(const XEvent *event_) { MSNotebook *notebook=(MSNotebook *)owner(); if (sensitive()==MSTrue&¬ebook->isProtected()==MSFalse&¬ebook->okToSwitch()==MSTrue) { if (event_->xmotion.is_hint==NotifyNormal&&(event_->xmotion.state&Button1Mask)==Button1Mask) { if (event_->xmotion.x<0||event_->xmotion.x>width()|| event_->xmotion.y<0||event_->xmotion.y>height()) { disarm(); } else if (armed()==MSFalse) { if ((event_->xmotion.x>=0&&event_->xmotion.x<=width())&& (event_->xmotion.y>=0&&event_->xmotion.y<=height())) { arm(); } } } } } void MSNotebook::NotebookTab::activate(void) { MSNotebook *notebook=(MSNotebook *)owner(); notebook->pageSelected(entry()); } void MSNotebook::NotebookTab::arm(void) { if (armed()==MSFalse) { _armed=MSTrue; if (mapped()==MSTrue) { int offset=highlightThickness()+shadowThickness(); XBFillRectangle(display(),window(),selectShadowGC(), offset,offset,width()-2*offset,height()-2*offset); if (showPixmap()==MSTrue) drawPixmap(); if (showLabel()==MSTrue) drawLabel(); drawSunken(); blendIn(); XFlush(display()); } } } void MSNotebook::NotebookTab::disarm(void) { if (armed()==MSTrue) { _armed=MSFalse; if (mapped()==MSTrue) { int offset=highlightThickness()+shadowThickness(); XBFillRectangle(display(),window(),backgroundShadowGC(), offset,offset,width()-2*offset,height()-2*offset); if (showPixmap()==MSTrue) drawPixmap(); if (showLabel()==MSTrue) drawLabel(); drawRaised(); blendIn(); XFlush(display()); } } } MSBoolean MSNotebook::NotebookTab::isModified(MSNotebookTabAttribute::SetFlag flag_) { return (modifiedFlag()&flag_)?MSTrue:MSFalse;} void MSNotebook::NotebookTab::tabBackground(unsigned long bg_,MSBoolean modified_) { _tabBackground=bg_; if (modified_==MSTrue) _modifiedFlag|=MSNotebookTabAttribute::TabBackground; } void MSNotebook::NotebookTab::tabForeground(unsigned long fg_,MSBoolean modified_) { _tabForeground=fg_; if (modified_==MSTrue) _modifiedFlag|=MSNotebookTabAttribute::TabForeground; } void MSNotebook::NotebookTab::tabFont(Font fid_,MSBoolean modified_) { font(fid_); if (modified_==MSTrue) _modifiedFlag|=MSNotebookTabAttribute::TabFont; } MSNotebook::NotebookArrow::NotebookArrow(MSWidget *owner_,MSArrow::ArrowType type_) : MSArrowButton(owner_,type_),_mode(Search) {} MSNotebook::NotebookArrow::~NotebookArrow(void) {} void MSNotebook::NotebookArrow::activate(void) { if (mode()==Search) search(); else browse(); } void MSNotebook::NotebookArrow::search(void) { if (sensitive()==MSTrue) { if (arrow()->selected()==MSFalse) arrow()->select(MSTrue); MSNotebook *notebook=(MSNotebook *)owner(); NotebookEntry *first; if (arrow()->arrowType()==MSArrow::Up||arrow()->arrowType()==MSArrow::Left) first=notebook->previousEntry(); else first=notebook->nextEntry(); if (first!=notebook->firstEntry()) { notebook->firstEntry(first); notebook->positionTabs(MSBoolean(arrow()->arrowType()==MSArrow::Down||arrow()->arrowType()==MSArrow::Right)); } } else server()->bell(); } void MSNotebook::NotebookArrow::browse(void) { MSNotebook *notebook=(MSNotebook *)owner(); NotebookEntry *entry; if (arrow()->arrowType()==MSArrow::Up||arrow()->arrowType()==MSArrow::Left) entry=notebook->previousBrowseEntry(); else entry=notebook->nextBrowseEntry(); if (entry!=notebook->currentEntry()) { if (arrow()->selected()==MSFalse) arrow()->select(MSTrue); notebook->currentEntry(entry); notebook->resetFirstEntry(); notebook->positionTabs(); notebook->pageChanged(); } else server()->bell(); } void MSNotebook::NotebookArrow::buttonPress(const XEvent *event_) {buttonPressNotify(this,event_);} void MSNotebook::NotebookArrow::button1Press(const XEvent *event_) { if (event_->xbutton.state&ControlMask) { mode(Browse); browse(); } else if (sensitive()==MSTrue) { mode(Search); search(); } else server()->bell(); if (mode()==Browse) repeatThreshold(MSNotebookArrowBrowseRepeatThreshold); else repeatThreshold(MSNotebookArrowSearchRepeatThreshold); if (arrowTimer()==0) _arrowTimer=new MSArrowTimer(repeatThreshold(),this); else arrowTimer()->expirationInterval(repeatThreshold()); if (mode()==Browse) repeatInterval(MSNotebookArrowBrowseRepeatInterval); else repeatInterval(MSNotebookArrowSearchRepeatInterval); arrowTimer()->reset(); } MSNotebookTabAttribute::MSNotebookTabAttribute(MSNotebook *notebook_) { _notebook=notebook_; _fg=notebook()->backpageForeground(); _bg=notebook()->backpageBackground(); _font=notebook()->font(); _sensitive=MSTrue; _label="Untitled"; _pixmap=0; _labelAlignment=MSRight; _setFlag=0; } MSNotebookTabAttribute::~MSNotebookTabAttribute(void) { if (_pixmap!=0) delete _pixmap; } void MSNotebookTabAttribute::pixmap(const MSPixmap &pixmap_) { if (_pixmap!=0) delete _pixmap; _pixmap=new MSPixmap(pixmap_); _setFlag|=TabPixmap; } void MSNotebookTabAttribute::reset(void) { if (_pixmap!=0) { delete _pixmap; _pixmap=0; } _setFlag=0; } aplus-fsf-4.22/src/MSGUI/MSNumericArrayView.C0000644000265000001440000000223610772770407014307 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include MSNumericArrayView::MSNumericArrayView(MSWidget *owner_,const char *title_) : MSArrayView(owner_,title_),_format(MSFloat::Decimal2) {} MSNumericArrayView::MSNumericArrayView(MSWidget *owner_,const MSStringVector& title_) : MSArrayView(owner_,title_),_format(MSFloat::Decimal2) {} MSNumericArrayView::~MSNumericArrayView(void) {} void MSNumericArrayView::format(const MSFormat& format_) { _format=format_; updateFormat(); } const char *MSNumericArrayView::formatValue(MSString &buffer_,double data_) { MSFloat aFloat(data_); return aFloat.format(buffer_,format()); } const char *MSNumericArrayView::formatValue(MSString &buffer_,int data_) { buffer_=MSString(data_); return buffer_.string(); } MSClipMode MSNumericArrayView::columnClipMode(unsigned) const { return MSClipStars; } void MSNumericArrayView::updateFormat(void) {redraw();} aplus-fsf-4.22/src/MSGUI/MSOptionMenu.C0000644000265000001440000003627610772770407013163 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include static const int MSOptionMenuSymbolHeight=8; static const int MSOptionMenuSymbolWidth=12; static const int MSOptionMenuSymbolThickness=2; static const int MSOptionMenuDefaultMargin=5; static const int MSOptionMenuDefaultMarginHeight=2; static const unsigned long MSOptionMenuEventMask=(ExposureMask|ButtonPressMask| ButtonReleaseMask|Button1MotionMask); MSOptionPopupMenu::MSOptionPopupMenu(MSOptionMenu *owner_) : MSPopupMenu(owner_->server()) { _optionMenu=owner_; init(); internalCouple(new MSStringVector); } MSOptionPopupMenu::MSOptionPopupMenu(MSOptionMenu *owner_, MSStringVector& options_) : MSPopupMenu(owner_->server()) { _optionMenu=owner_; init(); model(options_); } void MSOptionPopupMenu::init(void) { _lastShowTime=0; _threshold=500; foreground(optionMenu()->foreground()); background(optionMenu()->background()); font(optionMenu()->font()); } void MSOptionPopupMenu::model(MSStringVector& options_) { couple(&options_); } void MSOptionPopupMenu::options(const MSStringVector& options_) { internalCouple(new MSStringVector(options_)); } void MSOptionPopupMenu::rebuildMenu(void) { removeAllItems(); if (MSView::model()!=0) { unsigned n=optionsModel().length(); if (n>0) { for (unsigned i=0;isetSelectedItem(0); optionMenu()->computeSize(); } // your model has changed void MSOptionPopupMenu::updateData(void) { rebuildMenu(); } void MSOptionPopupMenu::update(const MSIndexVector& index_) { if (MSView::model()!=0) { if (index_.length()==0) { if (optionsModel().length()==itemCount()) { MSMenuItem *mi; int i,n=itemCount(); for(i=0;ilabel(optionsModel()(i)); } computeSize(); optionMenu()->setSelectedItem(0); optionMenu()->computeSize(); } else rebuildMenu(); } else { MSIndexVector iv(index_); iv.sortUp(); if (iv(0)==itemCount()) { for (unsigned i=0,j=itemCount();ilabel(optionsModel()(index)); } } } computeSize(); optionMenu()->computeSize(); } } void MSOptionPopupMenu::activate(void) { optionMenu()->activate(activeMenuItem()->tag()); done(); } void MSOptionPopupMenu::popup(MSBoolean warp_,unsigned long eventTime_) { if (warp_==MSTrue) { selectedItem(optionMenu()->selectedItem()); MSMenuItem *item=menuItem(selectedItem()); if (item!=0) XWarpPointer(display(),None,window(),0,0,0,0, item->x()+item->width()/2,item->y()+item->height()/2); } show(); lastShowTime(eventTime_); } int MSOptionPopupMenu::menuItemYOffset(int item_) { MSMenuItem *mi=menuItem(item_); return (mi!=0)?mi->y():0; } int MSOptionPopupMenu::menuItemXOffset(int item_) { MSMenuItem *mi=menuItem(item_); return (mi!=0)?mi->x():0; } void MSOptionPopupMenu::motionNotify(const XEvent *event_) { int lastSelectedItem=selectedItem(); MSMenu::motionNotify(event_); if (selectedItem()!=lastSelectedItem) lastShowTime(0); } void MSOptionPopupMenu::buttonRelease(const XEvent *event_) { if (event_->xbutton.time-lastShowTime()>threshold()) { MSMenu::buttonRelease(event_); } } void MSOptionPopupMenu::buttonPress(const XEvent *event_) { if (grabber()==this) { lastShowTime(0); } else { lastShowTime(event_->xbutton.time); } MSMenu::buttonPress(event_); } MSOptionMenu::MSOptionMenu(MSWidget *owner_,const char *label_) : MSCompositeField(owner_,label_) { init(); } MSOptionMenu::MSOptionMenu(MSWidget *owner_,const char *label_,MSStringVector& options_) : MSCompositeField(owner_,label_) { init(); optionsModel(options_); } MSOptionMenu::MSOptionMenu(MSWidget *owner_,MSStringVector& options_,const char *label_) : MSCompositeField(owner_,label_) { init(); optionsModel(options_); } MSOptionMenu::MSOptionMenu(MSWidget *owner_,MSString& model_, MSStringVector& options_,const char *label_) : MSCompositeField(owner_,label_) { init(); optionsModel(options_); model(model_); } MSOptionMenu::~MSOptionMenu(void) { if (optionMenu()!=0) safeDestroy(optionMenu()); } void MSOptionMenu::init(void) { freeze(); _marginHeight=MSOptionMenuDefaultMarginHeight; _selectedItem=0; _optionMenu=0; _columns=1; _internalEvent=MSFalse; selectInput(MSOptionMenuEventMask); } void MSOptionMenu::model(MSString &model_) { couple(&model_); } void MSOptionMenu::options(const MSStringVector& options_) { if (optionMenu()==0) _optionMenu=new MSOptionPopupMenu(this); optionMenu()->columns(columns()); optionMenu()->options(options_); } void MSOptionMenu::optionsModel(MSStringVector& options_) { if (optionMenu()!=0) optionMenu()->model(options_); else { _optionMenu=new MSOptionPopupMenu(this,options_); optionMenu()->columns(columns()); } } void MSOptionMenu::setSelectedItem(int item_) { _selectedItem=item_; if(hasModel()==MSTrue) { if(optionMenu()!=0) { _internalEvent=MSTrue; if(_selectedItemfirstMap()==MSFalse) { optionMenu()->calculateNaturalSize(w,h); optionMenu()->placeMenuItems(); } else { w=optionMenu()->width(); h=optionMenu()->height(); } int rootx,rooty,xx,yy; rootXY(rootx,rooty); yy=rooty+fieldValue()->y()-optionMenu()->menuItemYOffset(selectedItem()); if (yy<0) yy=0; else if (yy+h>server()->height()) { yy=server()->height()-h; } xx=rootx+fieldValue()->x()-optionMenu()->menuItemXOffset(selectedItem()); if (xx<0) xx=0; else if (xx+w>server()->width()) { xx=server()->width()-w; } optionMenu()->moveTo(xx,yy); optionMenu()->popup(MSTrue,eventTime_); // Always warp the pointer } } void MSOptionMenu::motionNotify(const XEvent *) { if (optionMenu()!=0&&optionMenu()->mapped()==MSTrue) optionMenu()->grab(); } void MSOptionMenu::buttonRelease(const XEvent *) { if (optionMenu()!=0&&optionMenu()->mapped()==MSTrue) optionMenu()->grab(); } void MSOptionMenu::buttonPress(const XEvent *pEvent_) { if (isProtected()==MSFalse) { if (pEvent_->xbutton.x>=fieldValue()->x()&& pEvent_->xbutton.x<=fieldValue()->x()+fieldValue()->width()&& pEvent_->xbutton.y>=fieldValue()->y()&& pEvent_->xbutton.y<=fieldValue()->y()+fieldValue()->height()) { if (acceptFocus()==MSFalse||traverseFocus(this)==MSTrue) { showMenu(pEvent_->xbutton.time); } } } } void MSOptionMenu::keyPress(const XEvent *pEvent_,KeySym keysym_,unsigned int state_,const char *) { MSKeyPress keyPress(keysym_, state_); if (isProtected()==MSFalse&&optionMenu()!=0&& keyTranslate(keyPress)==MSFalse) { switch (keysym_) { case XK_Return: case XK_Up: case XK_Down: showMenu(pEvent_->xkey.time); break; default: break; } } } unsigned MSOptionMenu::computeValuePixelWidth(void) { unsigned vw = valueWidth()*_fieldValue->charWidth()+2*_fieldValue->offset(); unsigned ovw= maxValueWidth()+fieldValue()->offset()+2*MSOptionMenuDefaultMargin+MSOptionMenuSymbolWidth; return (vw>ovw?vw:ovw); } void MSOptionMenu::placement(void) { if (fieldValue()!=0&&fieldLabel()!=0) { int offset=highlightThickness()+shadowThickness(); int offset2=offset<<1; int vh=fieldValue()->textHeight()+ 2*(marginHeight()+fieldValue()->shadowThickness()+fieldValue()->highlightThickness()); int lh=fieldLabel()->textHeight()+ 2*(fieldLabel()->shadowThickness()+fieldLabel()->highlightThickness()); int lw=fieldLabel()->width(); int vw=fieldValue()->width(); int trueWidth=width()-offset2; if (labelAlignment()==MSTop) { fieldLabel()->moveTo(offset,offset); fieldValue()->moveTo(offset,offset+lh+labelSpacing()); fieldLabel()->width(lw); fieldValue()->width(vw); } else { vw=trueWidth-fieldLabel()->width(); int h=(vh>lh)?vh:lh; if (vh==lh) height(h+offset2); else if (h+offset2>height()) height(h+offset2); fieldLabel()->height(h); fieldValue()->resize(vw,h); fieldLabel()->moveTo(offset,offset); fieldValue()->moveTo(offset+fieldLabel()->width(),offset); } redraw(); } } void MSOptionMenu::drawFieldValue(unsigned long,unsigned long) {} void MSOptionMenu::drawFieldValue(void) { if (frozen()==MSFalse&&owner()->mapped()==MSTrue&&mapped()==MSTrue) { int sht=fieldValue()->shadowThickness(); XFillRectangle(display(),window(),backgroundShadowGC(), fieldValue()->x()+sht,fieldValue()->y()+sht, fieldValue()->width()-(sht<<1),fieldValue()->height()-(sht<<1)); MSString buffer; const char *pString=formatOutput(buffer); if (pString!=0&&buffer.length()>0) { int len=buffer.length(); if (len>0) { int xx=fieldValue()->x()+fieldValue()->offset(); int offset=fieldValue()->highlightThickness()+fieldValue()->shadowThickness(); int margin=(fieldValue()->height()-(2*offset+fieldValue()->textHeight()))>>1; int yy=offset+((margin>0)?margin:0)+fieldValue()->textAscent(); int vw=fieldValue()->width()-2*fieldValue()->offset()- 2*MSOptionMenuDefaultMargin-MSOptionMenuSymbolWidth; int tw=fieldValue()->textWidth(pString,len); int delta=(vw>tw)?((vw-tw)>>1):0; fieldValue()->foreground(itemForeground(selectedItem())); XDrawString(display(),window(),fieldValue()->textGC(),fieldValue()->textFontStruct(), xx+delta,fieldValue()->y()+yy,pString,len); } } int offset=highlightThickness()+shadowThickness(); MSRect aRect(fieldValue()->x()+fieldValue()->width()-MSOptionMenuDefaultMargin-MSOptionMenuSymbolWidth, fieldValue()->y()+(fieldValue()->height()-MSOptionMenuSymbolHeight)/2, MSOptionMenuSymbolWidth,MSOptionMenuSymbolHeight); drawBevel(aRect,MSRaised,MSOptionMenuSymbolThickness); aRect.configuration(fieldValue()->x(),fieldValue()->y(), fieldValue()->width(),fieldValue()->height()); drawBevel(aRect,MSRaised,fieldValue()->shadowThickness()); } } void MSOptionMenu::updateFont(Font oldfid_) { MSCompositeField::updateFont(oldfid_); if (optionMenu()!=0) optionMenu()->font(font()); } void MSOptionMenu::updateBackground(unsigned long oldbg_) { MSCompositeField::updateBackground(oldbg_); if (optionMenu()!=0) optionMenu()->background(background()); } void MSOptionMenu::updateForeground(unsigned long oldfg_) { MSCompositeField::updateForeground(oldfg_); if (optionMenu()!=0) optionMenu()->foreground(foreground()); } void MSOptionMenu::updateSensitivity(void) { MSCompositeField::updateSensitivity(); if (optionMenu()!=0) optionMenu()->sensitive(sensitive()); } MSBoolean MSOptionMenu::loseFocus(void) { if (optionMenu()!=0&&optionMenu()->mapped()==MSTrue) escape(); unHighlight(); return MSTrue; } // The following virtual methods can be overriden by subclassers to // obtain model specific behavior: // numberOfItems - number of options in the model // itemLabel - return the label for the nth item // formatOuput - format the selectedItem for the entry part of the display // maxValueWidth - return the max pixel width over all item labels in the option Menu unsigned MSOptionMenu::numberOfItems(void) const { if (optionMenu()!=0&&optionMenu()->hasModel()==MSTrue) { return optionsModel().length(); } return 0; } unsigned MSOptionMenu::maxValueWidth(void) { if (optionMenu()!=0&&optionMenu()->MSView::model()!=0) { int max=0,w=0; unsigned numItems=numberOfItems(); for (unsigned i=0;itextWidth(pString); max=(w>max?w:max); } } return max+optionMenu()->shadowThickness()*2; } else return 0; } const char *MSOptionMenu::formatOutput(MSString &buffer_) { if (optionMenu()!=0&&optionMenu()->MSView::model()!=0&&selectedItem()MSView::model()!=0&&itemIndex_0&&_columns!=columns_) { _columns=columns_; if (optionMenu()!=0) optionMenu()->columns(columns()); } } unsigned long MSOptionMenu::itemForeground(unsigned) { return foreground(); } MSAttrValueList& MSOptionMenu::get(MSAttrValueList& avList_) { avList_< #include #include #if HAVE_NEW #include #else #include #endif #include #include #include #include #include static const unsigned long MSPageEventMask=(ExposureMask|ButtonPressMask| ButtonReleaseMask|Button1MotionMask); static const char *MSPageDefaultForeground="green"; static const char *MSPageDefaultBackground="black"; static const int MSPageDefaultHighlightThickness=2; static const int MSPageDefaultShadowThickness=0; static const int MSPageDefaultMargin=2; //static const char *MSPageDefaultFont="courier-14"; static const unsigned long MSPageDefaultBlinkRate=250; // 250 milliseconds MSPageBlinkTimer::MSPageBlinkTimer(MSPage *page_,unsigned long interval_) : MSIntervalTimer(interval_) { _page=page_; } void MSPageBlinkTimer::process(void) { page()->processBlinkTimer(); } MSPage::MSPage(MSWidget *owner_) : MSCompositeText(owner_) { init(); } MSPage::MSPage(MSWidget *owner_,MSCharMatrix& model_) : MSCompositeText(owner_) { init(); couple(&model_); } void MSPage::model(MSCharMatrix& model_) { couple(&model_); } void MSPage::init(void) { foreground(MSPageDefaultForeground); background(MSPageDefaultBackground); _highlightThickness=MSPageDefaultHighlightThickness; _shadowThickness=MSPageDefaultShadowThickness; _margin=MSPageDefaultMargin; _blinkTimer=0; _blinkRate=MSPageDefaultBlinkRate; _blinkPhase=Normal; _lineWidth=10; // 10 percent _boldFontID=0; _x_cursor=-1; _y_cursor=-1; backingStore(WhenMapped); shadowStyle(MSEtchedOut); acceptFocus(MSTrue); sensitive(MSTrue); addColor(0,foreground(),background()); selectInput(MSPageEventMask); freeze(); } MSPage::~MSPage(void) { stopBlinkTimer(); MSNodeItem *hp=colorListHead(); MSNodeItem *np; ColorCell *cc; while((np=hp->next())!=hp) { cc=(ColorCell *)np->data(); delete np; delete cc; } } ColorCell *MSPage::colorCell(int index_) { MSNodeItem *hp=colorListHead(); MSNodeItem *np=hp; ColorCell *cc=0; while((np=np->next())!=hp) { cc=(ColorCell *)np->data(); if (cc->id()==index_) np=hp->prev(); else cc=0; } return cc; } void MSPage::addColor(int index_,unsigned long fg_,unsigned long bg_) { ColorCell *cc=colorCell(index_); if (cc!=0) { cc->fg(fg_); cc->bg(bg_); } else { cc=new ColorCell(index_,fg_,bg_); MSNodeItem *np=new MSNodeItem((void *)cc); np->insert(colorListHead()); // fifo list } } void MSPage::addColor(int index_,const char *fg_,const char *bg_) { addColor(index_,server()->pixel(fg_),server()->pixel(bg_)); } void MSPage::computeSize(void) { int offset=(highlightThickness()+shadowThickness()+margin()+1)<<1; resize(matrix().columns()*charWidth()+offset,matrix().rows()*textHeight()+offset); } void MSPage::naturalSize(void) { computeSize(); } void MSPage::configure(void) { int offset=highlightThickness()+shadowThickness()+margin(); XRectangle clipRect[1]; clipRect[0].x=0; clipRect[0].y=0; clipRect[0].width=drawWidth(); clipRect[0].height=drawHeight(); XSetClipRectangles(display(),textGC(),offset,offset,&clipRect[0],1,Unsorted); refresh(); } void MSPage::redraw(void) { if (mapped()==MSTrue&&frozen()==MSFalse) { screenRedraw(); drawShadow(); } } void MSPage::refresh(void) { if (mapped()==MSTrue) { clear(); blinkPhase(Normal); redraw(); } } void MSPage::updateForeground(unsigned long oldfg_) { MSCompositeText::updateForeground(oldfg_); refresh(); } void MSPage::updateBackground(unsigned long oldbg_) { MSCompositeText::updateBackground(oldbg_); refresh(); } void MSPage::updateFont(Font oldfid_) { MSCompositeText::updateFont(oldfid_); Font fid=font(); const char *fontString=server()->fontName(fid); if (fontString!=0) { MSString fs(fontString); unsigned pos=0; if ((pos=fs.indexOf("-bold",0))==fs.length()) { unsigned ipos=fs.length(); if ((pos=fs.indexOf('-',0))fontID(fs); if (fsid!=server()->defaultFont()) boldFontID(fsid); else boldFontID(0); } else boldFontID(fid); } if (firstMap()==MSTrue) { if (dynamic()==MSTrue) computeSize(); else refresh(); } } void MSPage::firstMapNotify(void) { freeze(); updateFont(font()); computeSize(); unfreeze(); } void MSPage::unfreeze() { freezeStatus(MSFalse); screenUpdate (); } void MSPage::updateData(void) { refresh(); } int MSPage::computeYCoord(int row_) { int offset=highlightThickness()+shadowThickness()+margin()+textAscent(); return offset+(row_*textHeight()); } int MSPage::computeXCoord(int,int col_) { int offset=highlightThickness()+shadowThickness()+margin(); return offset+(col_*charWidth()); } int MSPage::drawWidth(void) { int offset=(highlightThickness()+shadowThickness()+margin())<<1; return width()-offset; } int MSPage::drawHeight(void) { int offset=(highlightThickness()+shadowThickness()+margin())<<1; return height()-offset; } void MSPage::blinkRate(unsigned long rate_) { if (rate_!=blinkRate()) { MSBoolean stop=(blinkTimer()==0)?MSTrue:MSFalse; if (blinkTimer()!=0) delete _blinkTimer; _blinkRate=rate_; _blinkTimer=new MSPageBlinkTimer(this,(unsigned long)blinkRate()); if (stop==MSTrue) blinkTimer()->stop(); } } void MSPage::startBlinkTimer(void) { if (blinkTimer()!=0) blinkTimer()->reset(); else _blinkTimer=new MSPageBlinkTimer(this,(unsigned long)blinkRate()); } void MSPage::stopBlinkTimer(void) { if (blinkTimer()!=0) delete blinkTimer(); _blinkTimer=0; } void MSPage::processBlinkTimer(void) { blinkTimeOut(); } void MSPage::update(const MSIndexVector& index_) { if (frozen()) return; if (index_.length()>0) { int n=index_.length(); int nc=matrix().columns(); int nr=matrix().rows(); int i=0,k=0,r=0; int co=0; int cc=0; MSIntVector row(1); for (r=0;r0) { MSIntVector cols(cc); for (i=0,k=0;i0) // update all rows { const MSIntMatrix& colorM=colorMatrix(); const MSBinaryMatrix& boldM=boldMatrix(); const MSBinaryMatrix& ulineM=underlineMatrix(); MSBoolean useColor=verify(colorM); MSBoolean useBold=verify(boldM); MSBoolean useUline=verify(ulineM); const char *cp=matrix().data(); int col,len,color,nextCol,nextColor; MSBoolean bold,nextBold; MSBoolean uline,nextUline; int nr=matrix().rows(); int nc=matrix().columns(); int offset=0; for(int i=0;i0) // update all cols { const MSIntMatrix& colorM=colorMatrix(); const MSBinaryMatrix& boldM=boldMatrix(); const MSBinaryMatrix& ulineM=underlineMatrix(); MSBoolean useColor=verify(colorM); MSBoolean useBold=verify(boldM); MSBoolean useUline=verify(ulineM); const char *cp=matrix().data(); int len,color,nextColor; MSBoolean bold,nextBold; MSBoolean uline,nextUline; int nr=matrix().rows(); int nc=matrix().columns(); int offset=0; int row; for(int i=0;iec)?cv:ec; } ec=(ec=0)?sc:0; int len=0; for (j=sc;j<=ec;j+=len) { color=(useColor==MSTrue)?(int)colorM(offset+j):0; bold=(useBold==MSTrue&&boldM(offset+j))?MSTrue:MSFalse; uline=(useUline==MSTrue&&ulineM(offset+j)==1)?MSTrue:MSFalse; len=1; while(j+len<=ec) { nextColor=(useColor==MSTrue)?(int)colorM(offset+(j+len)):0; nextBold=(useBold==MSTrue&&boldM(offset+(j+len))==1)?MSTrue:MSFalse; nextUline=(useUline==MSTrue&&ulineM(offset+(j+len))==1)?MSTrue:MSFalse; if (nextColor==color&&nextBold==bold&&nextUline==uline) len++; else break; } drawRow(row,j,cp+(offset+j),len,color,bold,Normal,uline); } } } } } // called after each data update void MSPage::blinkUpdate(void) { const MSBinaryMatrix& newBlink=blinkMatrix(); if (verify(newBlink)==MSTrue) { MSBoolean stopTimer=MSTrue; if (blinkTimer()!=0) { if (blinkPhase()==Normal) { for (int i=0;i0) { int k=0; int delta; int color; MSBoolean bold; MSBoolean uline; const MSIntMatrix& colorM=colorMatrix(); const MSBinaryMatrix& boldM=boldMatrix(); const MSBinaryMatrix& ulineM=underlineMatrix(); MSBoolean useColor=verify(colorM); MSBoolean useBold=verify(boldM); MSBoolean useUline=verify(ulineM); const char *cp=matrix().data(); for (int i=0;i=0?col_:0); int tw=len_*charWidth(); int lastRowAdjustment=(matrix().rows()-1==row_)?1:0; int lastColAdjustment=(matrix().columns()==col_+len_)?1:0; ColorCell *cc=colorCell(index_); unsigned long fg; unsigned long bg; if (cc!=0) { fg=cc->fg(); bg=cc->bg(); } else { fg=foreground(); bg=background(); } if (phase_==Reverse) { XSetForeground(display(),textGC(),fg); XSetBackground(display(),textGC(),bg); } else { XSetForeground(display(),textGC(),bg); XSetBackground(display(),textGC(),fg); } XFillRectangle(display(),window(),textGC(),x,y-textAscent(), tw+lastColAdjustment,textHeight()+lastRowAdjustment); if (phase_==Reverse) { XSetForeground(display(),textGC(),bg); XSetBackground(display(),textGC(),fg); } else { XSetForeground(display(),textGC(),fg); XSetBackground(display(),textGC(),bg); } Font fid=(bold_==MSTrue&&boldFontID()!=0)?boldFontID():font(); XSetFont(display(),textGC(),fid); const XFontStruct *fs=server()->fontStruct(fid); XDrawString(display(),window(),textGC(),fs,x,y,str_,len_); if (bold_==MSTrue&&boldFontID()==0) XDrawString(display(),window(),textGC(),fs,x+1,y,str_,len_); if (underline_==MSTrue) { XDrawLine(display(),window(),textGC(),x,y+textDescent()-1,x+tw-1,y+textDescent()-1); } } } void MSPage::screenRedraw(void) { if (mapped()==MSTrue) { screenUpdate(); drawLines(MSFalse); drawBoxes(MSFalse); } } int MSPage::yToRow(int y_) { y_-=highlightThickness()+shadowThickness()+margin(); if (y_<0) return 0; else if (y_>drawHeight()) return matrix().rows(); return (y_/textHeight()); } int MSPage::xToCol(int x_) { x_-=highlightThickness()+shadowThickness()+margin(); if (x_<0) return 0; else if (x_>drawWidth()) return matrix().columns(); return (x_/charWidth()); } // this should be probably be the default in MSWidget void MSPage::buttonPress(const XEvent *event_) { buttonPressNotify(this,event_); } void MSPage::buttonRelease(const XEvent *event_) { buttonReleaseNotify(this,event_); } void MSPage::button1Press(const XEvent *event_) { x_cursor(xToCol(event_->xbutton.x)); y_cursor(yToRow(event_->xbutton.y)); if (isProtected()==MSFalse&&acceptFocus()==MSTrue&&traverseFocus(this)==MSTrue) { unsigned int keys; unsigned int mask=Button1Mask; MSBoolean moved=MSTrue; // change in spec--always produce callback Window root,child; int ix,iy; int rx,ry; GC gc=XCreateGC(display(),window(),0,0); XSetFunction(display(),gc,GXxor); XSetForeground(display(),gc,WhitePixelOfScreen(screen())^background()); XSetBackground(display(),gc,0); int offset=highlightThickness()+shadowThickness()+margin(); int ex=offset+xToCol(event_->xbutton.x)*charWidth(); int ey=offset+yToRow(event_->xbutton.y)*textHeight(); int ox=ex; int oy=ey; XEvent ne,*ce; drawRect(gc,ex,ey,0,0); XQueryPointer(display(),window(),&root,&child,&rx,&ry,&ix,&iy,&keys); while (keys&mask) { if (abs(ex-ix)>5&&abs(ey-iy)>5) moved=MSTrue; if (ix!=ox||iy!=oy) { if (ox>ex) { (oy>ey)?drawRect(gc,ex,ey,(ox-ex),(oy-ey)): drawRect(gc,ex,oy,(ox-ex),(ey-oy)); } else { (oy>ey)?drawRect(gc,ox,ey,(ex-ox),(oy-ey)): drawRect(gc,ox,oy,(ex-ox),(ey-oy)); } ox=ix; oy=iy; if (ox>ex) { (oy>ey)?drawRect(gc,ex,ey,(ox-ex),(oy-ey)): drawRect(gc,ex,oy,(ox-ex),(ey-oy)); } else { (oy>ey)?drawRect(gc,ox,ey,(ex-ox),(oy-ey)): drawRect(gc,ox,oy,(ex-ox),(ey-oy)); } } XNextEvent(display(),&ne); if (ne.type==MotionNotify) { ce=compressMotion(&ne); ix=ce->xmotion.x; iy=ce->xmotion.y; } else if (ne.type==ButtonRelease) { keys=0; ix=ne.xbutton.x; iy=ne.xbutton.y; } } if (ox>ex) { (oy>ey)?drawRect(gc,ex,ey,(ox-ex),(oy-ey)): drawRect(gc,ex,oy,(ox-ex),(ey-oy)); } else { (oy>ey)?drawRect(gc,ox,ey,(ex-ox),(oy-ey)): drawRect(gc,ox,oy,(ex-ox),(ey-oy)); } XFreeGC(display(),gc); if (moved==MSTrue) { int x=xToCol((ix>ex)?ex:ix); int xs=xToCol((ix>ex)?ix:ex)-x; int y=yToRow((iy>ey)?ey:iy); int ys=yToRow((iy>ey)?iy:ey)-y; ys=(y+ys<=matrix().rows())?ys:matrix().rows()-y; xs=(x+xs<=matrix().columns())?xs:matrix().columns()-x; rubberBandRect().configure(x,y,xs,ys); rubberBand(); } else rubberBandRect().configure(0,0,0,0); } else if (isProtected()==MSFalse) buttonPressNotify(this,event_); } void MSPage::rubberBand(void) { activateCallback("rubberband"); } void MSPage::button1Release(const XEvent *event_) { if (isProtected()==MSFalse) { if (event_->xbutton.button==Button2) activateCallback("button2up"); else if (event_->xbutton.button==Button3) activateCallback("button3up"); } } void MSPage::boxes(const MSIntMatrix& boxMatrix_) { drawBoxes(MSTrue); _boxMatrix=boxMatrix_; drawBoxes(MSFalse); } void MSPage::lines(const MSIntMatrix& lineMatrix_) { drawLines(MSTrue); _lineMatrix=lineMatrix_; drawLines(MSFalse); } void MSPage::drawBoxes(MSBoolean clear_) { if (boxMatrix().columns()==4) { int x,y,ys,xs,w,h; int k=0; int offset=highlightThickness()+shadowThickness()+margin(); for (int i=0;i0)?lw:1; delta=charWidth()-lw; delta=(delta>0)?delta>>1:0; x+=delta; w=lw; h=(ys*textHeight()); } else { lw=(int)((lineWidth()*textHeight())/100); lw=(lw>0)?lw:1; delta=textHeight()-lw; delta=(delta>0)?delta>>1:0; y+=delta; h=lw; w=(xs*charWidth()); } k+=(int)lineMatrix().columns(); (clear_==MSTrue)?XSetForeground(display(),textGC(),background()): XSetForeground(display(),textGC(),foreground()); XFillRectangle(display(),window(),textGC(),x,y,w,h); } } } void MSPage::lineWidth(int lw_) { if (lw_!=lineWidth()) { _lineWidth=lw_; redraw(); } } void MSPage::margin(int margin_) { if (margin()!=margin_) { _margin=margin_; refresh(); } } void MSPage::print(const char *file_) { MSBoolean fileOpen=MSFalse; MSBoolean open=MSTrue; MSApplicationBusy busy; if (outputMode()==Draw) { if (file_!=0) displayPrintFileName(file_); if ((open=displayPrintOpen(this))==MSTrue) { fileOpen=MSTrue; outputMode(Print); displayPrintXorigin(0); displayPrintYorigin(0); } } if (open==MSTrue) { redraw(); if (fileOpen==MSTrue) { displayPrintClose(); outputMode(Draw); } } } aplus-fsf-4.22/src/MSGUI/MSPane.C0000644000265000001440000003555210772770410011737 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include static const int MSSashMSDefaultWidth=8; static const int MSSashMSDefaultHeight=8; static const int MSSashDefaultShadowThickness=2; static const int MSSashDefaultIndent=10; static const int MSPaneDefaultRowSpacing=8; //static const int MSPaneDefaultColumnSpacing=8; static const unsigned long MSSashEventMask=(ExposureMask|ButtonPressMask|ButtonReleaseMask); MSSash::MSSash(MSPane *owner_) : MSWidgetCommon(owner_) { _highlightThickness=0; _shadowThickness=0; _row=0,_column=0,_min=0,_max=0; acceptFocus(MSFalse); unsigned long whitePixel=server()->pixel("white"); unsigned long blackPixel=server()->pixel("black"); _crossCursor=new MSDisplayCursor(server(),XC_tcross,blackPixel,whitePixel); XSetWindowAttributes attrib; attrib.cursor=_crossCursor->cursor(); XChangeWindowAttributes(display(),window(),CWCursor,&attrib); XGCValues values; values.foreground=whitePixel^background(); values.background=blackPixel; values.line_width=2; values.function=GXxor; values.subwindow_mode=IncludeInferiors; _drawGC.setGCValues(server(),MSTrue,&values, GCForeground|GCBackground|GCLineWidth|GCFunction|GCSubwindowMode); selectInput(MSSashEventMask); } MSSash::~MSSash(void) { delete _crossCursor; } GC MSSash::gc(void) const { return _drawGC.gc(); } void MSSash::drawSash(void) {} void MSSash::drawSeparator(void) {} void MSSash::size(int) {} void MSSash::moveSash(int) {} void MSSash::redraw(void) { if (mapped()==MSTrue) { drawBackground(); drawSeparator(); drawSash(); } } void MSSash::updateBackground(unsigned long oldbg_) { MSWidgetCommon::updateBackground(oldbg_); redraw(); } MSHSash::MSHSash(MSPane *owner_) : MSSash(owner_) { height(MSSashMSDefaultHeight); } MSHSash::~MSHSash(void) {} void MSHSash::size(int size_) { width(size_); } void MSHSash::moveSash(int delta_) { moveTo(x_origin(),y_origin()+delta_); } void MSHSash::drawSeparator(void) { if (mapped()==MSTrue) { int offset=highlightThickness()+shadowThickness(); int x=offset; int thickness=MSSashDefaultShadowThickness; if (thickness>1) { int y=height()>>1; XFillRectangle(display(),window(),bottomShadowGC(), x,y,width()-2*offset,1); XFillRectangle(display(),window(),topShadowGC(), x,y+1,width()-2*offset,1); } else { XFillRectangle(display(),window(),backgroundShadowGC(), x,height()>>1,width()-2*offset,1); } } } void MSHSash::drawSash(void) { if (mapped()==MSTrue) { int offset=highlightThickness()+shadowThickness(); int sht=MSSashDefaultShadowThickness; MSRect aRect(width()-offset-MSSashDefaultIndent,offset, MSSashMSDefaultWidth,MSSashMSDefaultHeight); drawBevel(aRect,MSRaised,sht); XFillRectangle(display(),window(),backgroundShadowGC(), aRect.x()+sht,aRect.y()+sht, aRect.width()-2*sht,aRect.height()-2*sht); } } void MSHSash::button1Press(const XEvent *ev_) { int yoffset=height()>>1; int starty=y()+yoffset; int delta=yoffset-ev_->xbutton.y; int ymin=min(); int ymax=max()-yoffset; unsigned int mask=Button1Mask; unsigned int keys=mask; int ix=0,iy=0; int rx=0,ry=0; int oldY=y_origin(); int lastY=starty; Window root,child; server()->grabPointer(window(),False,ButtonPressMask|ButtonReleaseMask, GrabModeAsync,GrabModeAsync,None, _crossCursor->cursor(),ev_->xbutton.time); XDrawLine(display(),owner()->window(),gc(),0,lastY,owner()->width(),lastY); int sameScreen=XQueryPointer(display(),owner()->window(),&root,&child,&rx,&ry,&ix,&iy,&keys); while (keys&mask) { if (sameScreen==True) { iy+=delta; if (iyymax) iy=ymax; if (lastY!=iy) { XDrawLine(display(),owner()->window(),gc(),0,lastY,owner()->width(),lastY); lastY=iy; XDrawLine(display(),owner()->window(),gc(),0,lastY,owner()->width(),lastY); } } sameScreen=XQueryPointer(display(),owner()->window(),&root,&child,&rx,&ry,&ix,&iy,&keys); } XDrawLine(display(),owner()->window(),gc(),0,lastY,owner()->width(),lastY); moveTo(x_origin(),lastY-yoffset); int deltaY=oldY-y_origin(); MSPane *p=(MSPane *)owner(); p->adjustRowHeight(row(),deltaY); server()->ungrabPointer(window(),CurrentTime); } MSVSash::MSVSash(MSPane *owner_) : MSSash(owner_) { width(MSSashMSDefaultWidth); } MSVSash::~MSVSash(void) {} void MSVSash::size(int size_) { height(size_); } void MSVSash::moveSash(int delta_) { moveTo(x_origin()+delta_,y_origin()); } void MSVSash::drawSeparator(void) { if (mapped()==MSTrue) { int offset=highlightThickness()+shadowThickness(); int y=offset; int thickness=MSSashDefaultShadowThickness; if (thickness>1) { int x=width()>>1; XFillRectangle(display(),window(),bottomShadowGC(), x,y,1,height()-2*offset); XFillRectangle(display(),window(),topShadowGC(), x+1,y,1,height()-2*offset); } else { XFillRectangle(display(),window(),backgroundShadowGC(), height()>>1,y,height()-2*offset,1); } } } void MSVSash::drawSash(void) { if (mapped()==MSTrue) { int offset=highlightThickness()+shadowThickness(); int sht=MSSashDefaultShadowThickness; MSRect aRect(offset,height()-offset-MSSashDefaultIndent, MSSashMSDefaultWidth,MSSashMSDefaultHeight); drawBevel(aRect,MSRaised,sht); XFillRectangle(display(),window(),backgroundShadowGC(), aRect.x()+sht,aRect.y()+sht, aRect.width()-2*sht,aRect.height()-2*sht); } } void MSVSash::button1Press(const XEvent *ev_) { int xoffset=width()>>1; int startx=x()+xoffset; int delta=xoffset-ev_->xbutton.x; int xmin=min(); int xmax=max()-xoffset; unsigned int mask=Button1Mask; unsigned int keys=mask; int ix=0,iy=0; int rx=0,ry=0; int oldX=x_origin(); int lastX=startx; Window root,child; server()->grabPointer(window(),False,ButtonPressMask|ButtonReleaseMask, GrabModeAsync,GrabModeAsync,None, _crossCursor->cursor(),ev_->xbutton.time); XDrawLine(display(),owner()->window(),gc(),lastX,0,lastX,owner()->height()); int sameScreen=XQueryPointer(display(),owner()->window(),&root,&child,&rx,&ry,&ix,&iy,&keys); while (keys&mask) { if (sameScreen==True) { ix+=delta; if (ixxmax) ix=xmax; if (lastX!=ix) { XDrawLine(display(),owner()->window(),gc(),lastX,0,lastX,owner()->height()); lastX=ix; XDrawLine(display(),owner()->window(),gc(),lastX,0,lastX,owner()->height()); } } sameScreen=XQueryPointer(display(),owner()->window(),&root,&child,&rx,&ry,&ix,&iy,&keys); } XDrawLine(display(),owner()->window(),gc(),lastX,0,lastX,owner()->height()); moveTo(lastX-xoffset,y_origin()); int deltaX=oldX-x_origin(); MSPane *p=(MSPane *) owner(); p->adjustColumnWidth(column(),deltaX); server()->ungrabPointer(window(),CurrentTime); } At MSPane::childPosition(MSWidget *widget_) { return MSLayout::childPosition(widget_); } void MSPane::childPosition(MSWidget *widget_,const At& at_) { if(ignoreResizeConstraints()==MSTrue) { unsigned long opts=at_.constraints(); At a(at_); if (orientation()==MSLayoutManager::Vertical) { a.constraints(opts&(At::Left|At::Right|At::MinimizeWidth|At::MaintainWidth)); } else if (orientation()==MSLayoutManager::Horizontal) { a.constraints(opts&(At::Top|At::Bottom|At::MinimizeHeight|At::MaintainHeight)); } MSLayout::childPosition(widget_,a); } else { MSLayout::childPosition(widget_,at_); } } void MSPane::childResizeConstraints(MSWidget *widget_) { if(ignoreResizeConstraints()==MSTrue) { MSLayoutEntry *entry=getEntry(widget_); // get entry from childList if (entry!=0&&widget_!=this) { unsigned long opts=widget_->resizeConstraints(); if (entry->at().constraints()!=opts) { if (orientation()==MSLayoutManager::Vertical) { entry->at().constraints(opts&(At::Left|At::Right|At::MinimizeWidth|At::MaintainWidth)); } else if (orientation()==MSLayoutManager::Horizontal) { entry->at().constraints(opts&(At::Top|At::Bottom|At::MinimizeHeight|At::MaintainHeight)); } if (entry->mapped()==MSTrue) adjustSize(); } } } else { MSLayout::childResizeConstraints(widget_); } } void MSPane::updateOrientation(void) { if (firstMap()==MSTrue) { removeAllSashes(); if (setPositions()==MSTrue) adjustSize(); } } MSPane::MSPane(MSWidget *owner_,const char *title_) : MSLayout(owner_,title_) { init(); } MSPane::MSPane(MSWidget *owner_,const MSStringVector& title_) : MSLayout(owner_,title_) { init(); } void MSPane::init(void) { _rowSpacing=MSPaneDefaultRowSpacing; _ignoreResizeConstraints=MSTrue; sashAction(MSFalse); } MSPane::~MSPane(void) { removeAllSashes(); } void MSPane::updateBackground(unsigned long oldbg_) { MSLayout::updateBackground(oldbg_); for (unsigned i=0;ibackground(background()); } void MSPane::adjustRowHeight(int row_,int height_) { freeze(); MSLayoutEntry *entry; int span=0; int c; int r=row_; for (c=0;cwidget()->height(entry->widget()->height()-height_); span=entry->at().columnSpan(); } else span=1; } r++; for (c=0;cwidget()->height(entry->widget()->height()+height_); span=entry->at().columnSpan(); } else span=1; } freezeStatus(MSFalse); recomputeVectors(); placement(); activateCallback(MSWidgetCallback::childresize); } void MSPane::adjustColumnWidth(int col_,int width_) { freeze(); MSLayoutEntry *entry; int span=0; int c=col_; int r; for (r=0;rwidget()->width(entry->widget()->width()-width_); span=entry->at().rowSpan(); } else span=1; } c++; for (r=0;rwidget()->width(entry->widget()->width()+width_); span=entry->at().rowSpan(); } else span=1; } freezeStatus(MSFalse); recomputeVectors(); placement(); activateCallback(MSWidgetCallback::childresize); } int MSPane::numSashes(void) { return sashList().length(); } void MSPane::childCreate(MSWidget *widget_) { if (sashAction()==MSFalse) MSLayout::childInsert(widget_); } void MSPane::childDestroy(MSWidget *widget_) { if (sashAction()==MSFalse) MSLayout::childRemove(widget_); } void MSPane::childMap(MSWidget *widget_) { if (sashAction()==MSFalse) MSLayout::childMap(widget_); } void MSPane::childUnmap(MSWidget *widget_) { if (sashAction()==MSFalse) MSLayout::childUnmap(widget_); } void MSPane::childConfigure(MSWidget *widget_) { if (sashAction()==MSFalse) MSLayout::childConfigure(widget_); } void MSSash::buttonPress(const XEvent *event_) { buttonPressNotify(this,event_); } void MSPane::placement(void) { MSLayout::placement(); recomputeVectors(); if ((rows()>0||columns()>0)&&mapped()==MSTrue) placeSashes(); } // delete the sash associated with row,col void MSPane::removeSash(int row_,int col_) { sashAction(MSTrue); MSSash *pSash; for (unsigned i=0;irow()==row_&&pSash->column()==col_) { sashList().removeAt(i); delete pSash; break; } } sashAction(MSFalse); } void MSPane::removeAllSashes(void) { sashAction(MSTrue); for (unsigned i=0;irow()>=rows()-1)|| (orientation()==MSLayoutManager::Horizontal&&pSash->column()>=columns()-1)) { delete pSash; } else newSashList.append(pSash); } _sashList=newSashList; sashAction(MSFalse); } void MSPane::placeSashes(void) { int offset=highlightThickness()+shadowThickness(); MSSash *pSash; sashAction(MSTrue); if (orientation()==MSLayoutManager::Vertical) { int y=offset+innerHeight(); for (int i=0;irow(i); pSash->column(0); } pSash->width(width()-2*offset); pSash->moveTo(offset,y+rowHeight(i)); pSash->min(y+rowSpacing()); pSash->max(pSash->y_origin()+rowSpacing()+rowHeight(i+1)); if (pSash->mapped()==MSFalse) pSash->map(); pSash->raise(); y+=rowHeight(i)+rowSpacing(); } } else if (orientation()==MSLayoutManager::Horizontal) { int x=offset+innerWidth(); for (int i=0;irow(0); pSash->column(i); } pSash->height(height()-2*offset-innerHeight()); pSash->moveTo(x+columnWidth(i),offset+innerHeight()); pSash->min(x+columnSpacing()); pSash->max(pSash->x_origin()+columnSpacing()+columnWidth(i+1)); if (pSash->mapped()==MSFalse) pSash->map(); pSash->raise(); x+=columnWidth(i)+columnSpacing(); } } removeExtraSashes(); sashAction(MSFalse); } MSSash *MSPane::sash(int row_,int col_) { MSSash *pSash; for (unsigned i=0;irow()==row_&&pSash->column()==col_) return pSash; } return 0; } void MSPane::ignoreResizeConstraints(MSBoolean ignoreResizeConstraints_) { if(_ignoreResizeConstraints != ignoreResizeConstraints_) { _ignoreResizeConstraints = ignoreResizeConstraints_; } } void MSPane::set(MSAttrValueList& avList_) { MSLayout::set(avList_); MSIndexVector index; for (unsigned i=0;i #include #include #include extern const int MSPointsPerInch; MSParagraph::MSParagraph(const MSStringVector& text_,const MSSymbol& tag_): _text(text_),_tag(tag_) {init();} MSParagraph::MSParagraph(const MSStringVector& text_,int row_,int col_,const MSSymbol& tag_): _text(text_),_tag(tag_) { init(); row(row_); column(col_); } MSParagraph::MSParagraph(const MSStringVector& text_,const char *font_,const MSSymbol& tag_): _text(text_),_tag(tag_) { font(font_); init(); } MSParagraph::MSParagraph(const MSStringVector& text_,int row_,int col_,const char *font_,const MSSymbol& tag_): _text(text_),_tag(tag_) { font(font_); init(); row(row_); column(col_); } MSParagraph::MSParagraph(void) { init(); } MSParagraph::MSParagraph(const MSParagraph& paragraph_) : MSPrintItem(paragraph_), _foreground(paragraph_._foreground), _background(paragraph_._background), _orphanRows(paragraph_._orphanRows), _widowRows(paragraph_._widowRows), _style(paragraph_._style), _fontID(paragraph_._fontID), _fontSize(paragraph_._fontSize), _leading(paragraph_._leading), _xPixel(paragraph_._xPixel), _yPixel(paragraph_._yPixel), _lineWidth(paragraph_._lineWidth), _text(paragraph_._text), _tag(paragraph_._tag), _fontScale(paragraph_._fontScale), _fgGrayScale(paragraph_._fgGrayScale), _bgGrayScale(paragraph_._bgGrayScale), _firstLineIndentPixel(paragraph_._firstLineIndentPixel), _lastLineWidth(paragraph_._lastLineWidth), _textLineWidth(paragraph_._textLineWidth), _wordSpacing(paragraph_._wordSpacing) {} MSParagraph& MSParagraph::operator=(const MSParagraph& paragraph_) { if (¶graph_!=this) { _foreground=paragraph_._foreground; _background=paragraph_._background; _orphanRows=paragraph_._orphanRows; _widowRows=paragraph_._widowRows; _style=paragraph_._style; _fontID=paragraph_._fontID; _fontSize=paragraph_._fontSize; _leading=paragraph_._leading; _xPixel=paragraph_._xPixel; _yPixel=paragraph_._yPixel; _lineWidth=paragraph_._lineWidth; _text=paragraph_._text; _tag=paragraph_._tag; _fontScale=paragraph_._fontScale; _fgGrayScale=paragraph_._fgGrayScale; _bgGrayScale=paragraph_._bgGrayScale; _firstLineIndentPixel=paragraph_._firstLineIndentPixel; _lastLineWidth=paragraph_._lastLineWidth; _textLineWidth=paragraph_._textLineWidth; _wordSpacing=paragraph_._wordSpacing; MSPrintItem::operator=(paragraph_); } return *this; } MSParagraph::~MSParagraph(void) {} void MSParagraph::operator=(const MSStringVector& text_) {_text=text_;} void MSParagraph::operator=(const MSString& text_) {_text=text_;} void MSParagraph::operator=(const char *text_) {_text=text_;} MSParagraph::operator const MSStringVector&() const {return _text;} void MSParagraph::init(void) { _foreground=0; _background=0; _style=0; _orphanRows=1; _widowRows=1; _fontID=0; _fontSize=10; _leading=1; _yPixel=MSPointsPerInch; _xPixel=MSPointsPerInch; _lineWidth=0; _fontScale=1; _fgGrayScale=0; _bgGrayScale=1; _firstLineIndentPixel=0; topPixel(1); } double MSParagraph::firstLineIndent(void) const {return (double)_firstLineIndentPixel/MSPointsPerInch;} double MSParagraph::leftMargin(void) const {return MSPrintItem::leftMargin();} double MSParagraph::rightMargin(void) const {return MSPrintItem::rightMargin();} MSParagraph& MSParagraph::firstLineIndent(double x_) {_firstLineIndentPixel=int(MSPointsPerInch*x_); return *this;} MSParagraph& MSParagraph::leftMargin(double x_) {MSPrintItem::leftMargin(x_); return *this;} MSParagraph& MSParagraph::rightMargin(double x_) {MSPrintItem::rightMargin(x_); return *this;} int MSParagraph::height(void) const {return printHeight();} MSParagraph& MSParagraph::text(const MSStringVector& x_) {_text=x_; return *this;} MSParagraph& MSParagraph::tag(const MSSymbol& x_) {_tag=x_; return *this;} MSParagraph& MSParagraph::justification(MSAlignment x_) {MSPrintItem::justification(x_); return *this;} MSParagraph& MSParagraph::justification(unsigned long x_) {MSPrintItem::justification(x_); return *this;} MSParagraph& MSParagraph::leading(unsigned x_) {_leading=x_; return *this;} MSParagraph& MSParagraph::topPixel(unsigned x_) {MSPrintItem::topPixel(x_); return *this;} MSParagraph& MSParagraph::bottomPixel(unsigned x_) {MSPrintItem::bottomPixel(x_); return *this;} MSParagraph& MSParagraph::lineWidth(unsigned x_) {_lineWidth=x_; return *this;} MSParagraph& MSParagraph::row(int x_) {MSPrintItem::printRow(x_); return *this;} MSParagraph& MSParagraph::column(int x_) {MSPrintItem::printColumn(x_); return *this;} MSParagraph& MSParagraph::printRow(int x_) {MSPrintItem::printRow(x_); return *this;} MSParagraph& MSParagraph::printColumn(int x_) {MSPrintItem::printColumn(x_); return *this;} MSParagraph& MSParagraph::firstColumn(unsigned x_) {MSPrintItem::printColumn(x_); return *this;} MSParagraph& MSParagraph::columnSpan(unsigned x_) {_columnSpan=x_; return *this;} MSParagraph& MSParagraph::fgGrayScale(double x_) {if (x_>=0.0&&x_<=1.0) _fgGrayScale=x_; return *this;} MSParagraph& MSParagraph::bgGrayScale(double x_) {if (x_>=0.0&&x_<=1.0) _bgGrayScale=x_; return *this;} MSParagraph& MSParagraph::xOrigin(double x_) {_xPixel=int(x_*MSPointsPerInch); return *this;} MSParagraph& MSParagraph::yOrigin(double x_) {_yPixel=int(x_*MSPointsPerInch); return *this;} MSParagraph& MSParagraph::topOffset(double x_) {MSPrintItem::topOffset(x_); return *this;} MSParagraph& MSParagraph::bottomOffset(double x_) {MSPrintItem::bottomOffset(x_); return *this;} MSParagraph& MSParagraph::foreground(const char *x_) {_foreground=x_; return *this;} MSParagraph& MSParagraph::background(const char *x_) {_background=x_; return *this;} MSParagraph& MSParagraph::fontSize(unsigned x_) {_fontSize=x_; return *this;} MSParagraph& MSParagraph::fontScale(double x_) {_fontScale=x_; return *this;} MSParagraph& MSParagraph::fontID(Font x_) {_fontID=x_; return *this;} MSParagraph& MSParagraph::occurrence(unsigned long x_) {MSPrintItem::occurrence(x_); return *this;} MSParagraph& MSParagraph::occurrence(Occurrence x_) {MSPrintItem::occurrence(x_); return *this;} MSParagraph& MSParagraph::pageAlignment(unsigned long x_) {MSPrintItem::pageAlignment(x_); return *this;} MSParagraph& MSParagraph::pageAlignment(MSAlignment x_) {return pageAlignment((unsigned long)x_);} MSParagraph& MSParagraph::font(const char *string_) {MSPrintItem::printFont(string_); return *this;} MSParagraph& MSParagraph::orphanRows(unsigned x_) {_orphanRows=x_; return *this;} MSParagraph& MSParagraph::widowRows(unsigned x_) {_widowRows=x_; return *this;} MSParagraph& MSParagraph::style(unsigned long style_) { unsigned long temp=style_&(MSLeft|MSRight|MSTop|MSBottom|MSCenter); if (temp>0) justification(temp); _style=style_^temp; return *this; } double MSParagraph::xOrigin(void) const {return double(_xPixel/MSPointsPerInch);} double MSParagraph::yOrigin(void) const {return double(_yPixel/MSPointsPerInch);} double MSParagraph::topOffset(void) const {return MSPrintItem::topOffset();} double MSParagraph::bottomOffset(void) const {return MSPrintItem::bottomOffset();} const MSSymbol& MSParagraph::printTag(void) const {return tag();} int MSParagraph::computePrintSize(MSReport *report_,int,int y_,int w_,int,int topMargins_,int margins_) { reset(); if (leftPixel()<0) leftPixel(report_->leftPixel()); if (rightPixel()<0) rightPixel(report_->rightPixel()); fontID(report_->font(fontName())); fontSize(report_->fontSize()); margins_=(margins_==0?leftPixel()+rightPixel():margins_); textLineWidth(w_-margins_); computeParagraphSize(report_); int rowHeight=fontSize()+leading(); if (rowHeight<=0) return 0; int h=rowHeight*outputText().length()+topPixel(); int border=0; if(style()&MSP::Box) border=2*(lineWidth()); else border= (style()&MSP::BoxT?lineWidth():0)+(style()&MSP::BoxB?lineWidth():0); int remainingHeight=y_-report_->pageEnd()-topMargins_; int orphanRowHeight=rowHeight*orphanRows()-leading()+topPixel() +border; int totalHeight=h+border; //Skip to next page if there is no more space left on this page, //OR if we are not at the beginning of the page AND either we need to be aligned //with top of the page or there is not enough space for our orphanRows. if (remainingHeight<=0 || (((pageAlignment()&MSTop) || orphanRowHeight>remainingHeight) && (y_!=report_->bodyTop(report_->pageCount())))) { _pageCount++; int pc=report_->pageCount()+1; remainingHeight=report_->bodyTop(pc)-report_->bodyBottom(pc)-topMargins_; } if (h+border-leading()remainingHeight) { _pageCount++; int pc=report_->pageCount()+pageCount(); remainingHeight=report_->bodyTop(pc)-report_->bodyBottom(pc)-topMargins_; hh=border+(i==0?topPixel():0); i--; } _residual=hh; } // if(_residual-=leading(); if (remainingHeight-residual()+leading()-bottomPixel()<0) { _pageCount++; _residual=0; } else { _residual+=bottomPixel(); totalHeight+=bottomPixel(); } if(_residual<0) _residual=0; printHeight(totalHeight); return residual(); } void MSParagraph::computeParagraphSize(MSReport* report_) { double w,width=firstLineIndentPixel(); int lw=(lineWidth()+1)*((style()&BoxL&&style()&BoxR)||style()&Box?2:style()&BoxL||style()&BoxR?1:0); double tlw=textLineWidth()-lw; wordSpacing().removeAll(); outputText().removeAll(); pageBreakRow(-1); MSPrintFontData *fdata=report_->fontStruct(fontID()); if (fdata!=0) { double spaceCharWidth; double fontSpaceCharWidth=fdata->textWidth(fontSize()," ",1); double minSpaceCharWidth=fontSpaceCharWidth/2; for (unsigned i=0;itextWidth(fontSize(),aString,aString.length()); if ((width+=w)>tlw-spaceWidth) { if (w>tlw) { double currentWidth=width-w+minSpaceCharWidth*wordCount; int row=outputText().length()-1; width=dissectWord(report_,aString,(int)(tlw),currentWidth); if (wordCount>0) { double rowWidth=fdata->textWidth(fontSize(),outputText()(row),outputText()(row).length()); rowWidth-=fontSpaceCharWidth*wordCount; wordSpacing()<<(tlw-rowWidth)/wordCount; } else wordSpacing()<wordSpacing().length()) { wordSpacing()<1?1:0)); wordSpacing()<textWidth(fontSize(),aString,aString.length()); if ((width+=w)>tlw) { MSString bString(MSString::stripTrailingBlanks(aString)); int ww=(int)(fdata->textWidth(fontSize(),bString,bString.length())); if (width-w+wwtlw) { w=dissectWord(report_,aString,(int)(tlw),width-w); } else { outputText().lastElement().stripTrailing(); outputText()<outputMode()==ASCII) { report_->pout<pageEnd()+bottomIndent_; int remainingHeight=y_-pageEnd; int bottom=style()&Box||style()&BoxB?lineWidth():0; if(style()&MSP::Box) border=2*(lineWidth()); else border= (style()&MSP::BoxT?lineWidth():0)+(style()&MSP::BoxB?lineWidth():0); int orphanRowHeight=rowHeight*orphanRows()-leading()+topPixel()+border; if (pageBreakRow()<0&&(remainingHeight<0 || ((orphanRowHeight>remainingHeight||pageAlignment()&MSTop) &&y_!=report_->bodyTop(report_->pageCount())))) { pageBreakRow(0); _currentPage++; return remainingHeight; } int h; if (pageBreakRow()>0) { int len=outputText().length()-pageBreakRow(); h=len*rowHeight+border-leading(); if(h0&&h=(int)outputText().length()) // are we done? { //hack. sometimes we could fit on previous page even if we didn't think so. //TODO: track down that 1 pixel difference. if(_currentPage-_pageCount==0) _currentPage++; return 0; } printParagraphDecorations(report_,x_+(leftMargin_==0?leftPixel():0),y,w_,(h_>0)?h_:h,pageEnd); printParagraph(report_,x_+(leftMargin_==0?leftPixel():leftMargin_),y,pageEnd+bottom); _currentPage++; return residual(); } void MSParagraph::printParagraph(MSReport *report_,int x_,int y_, int pageEnd_) { MSBoolean pageNumStatus=MSFalse; MSStringVector originalText; if (report_->printHeaderStatus()==MSTrue) { originalText=outputText(); pageNumStatus=report_->insertPageNumString(outputText()); } unsigned numWords; MSPrintFontData *fdata=report_->fontStruct(fontID()); report_->fontSize(fontSize()); report_->gcValues().font=fontID(); int left=style()&Box||style()&BoxL?lineWidth()+1:0; int right=style()&Box||style()&BoxR?lineWidth()+1:0; int top=style()&Box||style()&BoxT?lineWidth()+1:0; report_->setFgGrayScale(); report_->setFont(); double uoffset=(double)(fdata->underlinePosition()*fontSize())/1000.0; double uthickness=(double)(fdata->underlineThichness()*fontSize())/1000.0; double y=y_-(pageBreakRow()<=0?topPixel():0); y-=fdata->fontOffset(fontSize())+top-leading(); int rowOffset=(int)(fontSize()+leading()-fdata->fontOffset(fontSize())); if (y+leading()<=pageEnd_) { pageBreakRow(0); return; } int rows=outputText().length(); for (unsigned i=pageBreakRow()<0?0:pageBreakRow();itextWidth(fontSize(),aString,aString.length()); aString.change("\\","\\\\").change("(","\\(").change(")","\\)"); if (aString.length()>0) { if (Outline&style()) { report_->gcValues().line_width=0; report_->setAttributes(); } if (justification()&MSLeft) { double x=x_+left+(i==0?firstLineIndentPixel():0); report_->pout<pout<<" "; report_->pout<pout<<" "; report_->pout<<"M"; report_->pout<<" "; if (justification()&MSRight) { double ws=wordSpacing()(i); w=-ws; numWords=outputText()(i).numWords(); for (int j=0;jpout<<"("; report_->pout<pout<<")"; report_->pout<<(Outline&style()?"sh st":"S"); report_->pout<<" "; report_->pout<pout<<" "; report_->pout<<"s"; if (j!=0&&j%4==0) report_->pout<textWidth(fontSize(),aString.word(j),aString.lengthOfWord(j))+ws; } } } else { report_->pout<<"("; report_->pout<pout<<")"; report_->pout<<"S"; } report_->pout<gcValues().line_width=(int)uthickness; report_->setAttributes(); report_->printLine(x,y+uoffset,x+w,y+uoffset); } } else { double x=x_+(justification()&MSRight?textLineWidth()-w-right:((textLineWidth()-w)/2)); report_->pout<pout<<" "; report_->pout<pout<<" "; report_->pout<<"M"; report_->pout<<" "; report_->pout<<"("; report_->pout<pout<<")"; report_->pout<<(Outline&style()?"sh st":"S"); report_->pout<<" "; report_->pout<gcValues().line_width=(int)uthickness; report_->setAttributes(); report_->printLine(x,y+uoffset,x+w,y+uoffset); } } } y-=fontSize()+leading(); if (y+leading()fontStruct(fontID()); report_->fgGrayScale(fgGrayScale()); report_->bgGrayScale(bgGrayScale()); report_->gcValues().line_width=lineWidth(); static int MinSize=4; if (y_-pageEnd_>MinSize) { int h=(y_-h_)fillRectangle(x_,y_,w_-1,h-1); if(Box&style()) report_->strokeRectangle(x_,y_,w_-1,h-1); else report_->printBox(style(),x_,y_,w_,h); } } MSString MSParagraph::wordToNext(const MSString& aString_,unsigned i_) const { static const char whiteSpace[]="\t\n\v\f\r "; unsigned end=0,start=aString_.indexOfWord(i_); unsigned len=aString_.length(); if (startstart) { start=i_==0?0:start; return aString_.subString(start,next-start); } else return aString_.word(i_); } double MSParagraph::dissectWord(MSReport *report_,MSString& word_,int lineWidth_,double width_) { MSPrintFontData *fdata=report_->fontStruct(fontID()); MSBoolean errorMessage=MSFalse; double w,maxWidth=lineWidth_; int count=0; maxWidth-=width_; while(count0) { const char *cp=word_.subString(count,word_.length()); int j,len=word_.length()-count; for (j=0,w=0.0;jtextWidth(fontSize(),cp++,1); } if (w>maxWidth) j--; if (count==0&&j==1&&maxWidth==lineWidth_) { if (errorMessage==MSFalse) { MSMessageLog::warningMessage("Warning: unable to print %s at the specified font... " "Reducing the font size\n",word_.string()); errorMessage=MSTrue; } _fontSize--; } else { if (maxWidth #include #include #include #include #include #include #include #ifdef MS_WINDOWS #include #endif extern void applicationExit(void); #ifdef MS_MULTI_THREAD MSMutex MSPixmap::_hashTableMutex; #endif static const int PixmapTableSize=64; static const int PredefinedPixmapWidth=16; static const int PredefinedPixmapHeight=16; MSHashTable *MSPixmap::_pPixmapHashTable=0; //Predefined Pixmaps - found in MSBitmaps.H const char *MSPixmap::SolidBackgroundPixmap ="background"; const char *MSPixmap::ForegroundTwentyFivePixmap ="25_foreground"; const char *MSPixmap::ForegroundFiftyPixmap ="50_foreground"; const char *MSPixmap::ForegroundSeventyFivePixmap="75_foreground"; const char *MSPixmap::VerticalPixmap ="vertical"; const char *MSPixmap::HorizontalPixmap ="horizontal"; const char *MSPixmap::SlantRightPixmap ="slant_right"; const char *MSPixmap::SlantLeftPixmap ="slant_left"; const char *MSPixmap::MenuCascadePixmap ="menu_cascade"; const char *MSPixmap::MenuCheckmarkPixmap ="menu_checkmark"; const char *MSPixmap::MenuDashPixmap ="menu_dash"; const char *MSPixmap::MagnifyingGlassPixmap ="mglass_ptr"; const char *MSPixmap::MagnifyingGlassMaskPixmap ="mglass_ptrMask"; const char *MSPixmap::HourGlassPixmap ="hglass_ptr"; const char *MSPixmap::HourGlassMaskPixmap ="hglass_ptrMask"; //############################################################################# // MSPixmapData //############################################################################# class MSPixmapData { friend class MSPixmap; private: unsigned _referenceCount; Pixmap _pixmap; Pixmap _clipMask; int _width; int _height; int _depth; unsigned long _fg; unsigned long _bg; MSDisplayServer *_pServer; char *_pName; void init(const char *); public: MSPixmapData(void); MSPixmapData(MSDisplayServer *,const char *,Pixmap,int,int,int,unsigned long,unsigned long); MSPixmapData(MSDisplayServer *,const char *,Pixmap,Pixmap,int,int,int,unsigned long,unsigned long); ~MSPixmapData(void); void addReference(void); void removeReference(void); unsigned referenceCount(void) const {return _referenceCount;} MSDisplayServer *server(void) const {return _pServer;} const char *name(void) const {return _pName;} int width(void) const {return _width;} int height(void) const {return _height;} int depth(void) const {return _depth;} unsigned long fg(void) const {return _fg;} unsigned long bg(void) const {return _bg;} Pixmap pixmap(void) const {return _pixmap;} Pixmap clipMask(void) const {return _clipMask;} }; MSPixmapData::MSPixmapData(void) : _referenceCount(0), _pServer(0), _pName(0), _height(0), _width(0), _depth(0), _pixmap(0), _clipMask(0), _fg(0), _bg(0) {} MSPixmapData::MSPixmapData(MSDisplayServer *pServer_,const char *pName_, Pixmap pixmap_,int width_,int height_,int depth_, unsigned long fg_,unsigned long bg_) : _referenceCount(0), _pServer(pServer_), _pName(0), _height(height_), _width(width_), _depth(depth_), _pixmap(pixmap_), _clipMask(0), _fg(fg_), _bg(bg_) { init(pName_); } MSPixmapData::MSPixmapData(MSDisplayServer *pServer_,const char *pName_, Pixmap pixmap_,Pixmap clipMask_,int width_,int height_,int depth_, unsigned long fg_,unsigned long bg_) : _referenceCount(0), _pServer(pServer_), _pName(0), _height(height_), _width(width_), _depth(depth_), _pixmap(pixmap_), _clipMask(clipMask_), _fg(fg_), _bg(bg_) { init(pName_); } void MSPixmapData::init(const char *pName_) { if (pName_!=0) { unsigned len=strlen(pName_); _pName=new char[len+1]; memcpy(_pName,pName_,len); _pName[len]='\0'; } } MSPixmapData::~MSPixmapData(void) { if (_pName!=0) delete [] _pName; } void MSPixmapData::addReference(void) { _referenceCount++; } void MSPixmapData::removeReference(void) { if (--_referenceCount==0) delete this; } //############################################################################# // MSPixmap //############################################################################# //############################################################################# // Create a pixmap from array of characters //############################################################################# MSPixmap::MSPixmap(MSDisplayServer *pServer_,const char *pName_, const char *bitmap_,int w_,int h_) : _name(pName_) { char buf[255]; MSGUARD(_hashTableMutex); init(); sprintf(buf,"Array_%s_%d_%d_%d_%d",pName_,w_,h_, DefaultDepthOfScreen(pServer_->screen()),pServer_->display()); if(copyPixmapDataWithKey(buf)==MSFalse) create(pServer_,buf,bitmap_,w_,h_); } //############################################################################# // Create a pixmap from array of characters //############################################################################# MSPixmap::MSPixmap(MSDisplayServer *pServer_,const char *pName_, const char *bitmap_,int w_,int h_,unsigned long fg_,unsigned long bg_) : _name(pName_) { char buf[255]; MSGUARD(_hashTableMutex); init(); sprintf(buf,"Array_%s_%d_%d_%d_%d_%d_%d",pName_,w_,h_, fg_,bg_,DefaultDepthOfScreen(pServer_->screen()),pServer_->display()); if(copyPixmapDataWithKey(buf)==MSFalse) create(pServer_,buf,bitmap_,w_,h_,fg_,bg_); } //############################################################################# // Create a pixmap from array of characters //############################################################################# MSPixmap::MSPixmap(MSDisplayServer *pServer_,const char *pName_,const char *bitmap_,int w_,int h_, const char *foreground_,const char *background_) : _name(pName_) { char buf[255]; MSGUARD(_hashTableMutex); init(); unsigned long fg=pServer_->pixel(foreground_); unsigned long bg=pServer_->pixel(background_); sprintf(buf,"Array_%s_%d_%d_%d_%d_%d_%d",pName_,w_,h_, fg,bg,DefaultDepthOfScreen(pServer_->screen()),pServer_->display()); if(copyPixmapDataWithKey(buf)==MSFalse) create(pServer_,buf,bitmap_,w_,h_,fg,bg); } //############################################################################# // Create a pixmap from an X11 Pixmap File //############################################################################# MSPixmap::MSPixmap(MSDisplayServer *pServer_,const char *pName_,const char *bitmapFile_) : _name(pName_) { char buf[255]; MSGUARD(_hashTableMutex); init(); sprintf(buf,"File_%s_%s_%d_%d",pName_,bitmapFile_, DefaultDepthOfScreen(pServer_->screen()),pServer_->display()); if(copyPixmapDataWithKey(buf)==MSFalse) create(pServer_,buf,bitmapFile_); } //############################################################################# // Create a pixmap from an X11 Pixmap File //############################################################################# MSPixmap::MSPixmap(MSDisplayServer *pServer_,const char *pName_,const char *bitmapFile_,unsigned long fg_,unsigned long bg_) : _name(pName_) { char buf[255]; MSGUARD(_hashTableMutex); init(); sprintf(buf,"File_%s_%s_%d_%d_%d_%d",pName_,bitmapFile_, fg_,bg_,DefaultDepthOfScreen(pServer_->screen()),pServer_->display()); if(copyPixmapDataWithKey(buf)==MSFalse) create(pServer_,buf,bitmapFile_,fg_,bg_); } //############################################################################# // Create a pixmap from an X11 Pixmap File //############################################################################# MSPixmap::MSPixmap(MSDisplayServer *pServer_,const char *pName_,const char *bitmapFile_, const char *foreground_,const char *background_) : _name(pName_) { char buf[255]; MSGUARD(_hashTableMutex); init(); unsigned long fg=pServer_->pixel(foreground_); unsigned long bg=pServer_->pixel(background_); sprintf(buf,"File_%s_%s_%d_%d_%d_%d",pName_,bitmapFile_, fg,bg,DefaultDepthOfScreen(pServer_->screen()),pServer_->display()); if(copyPixmapDataWithKey(buf)==MSFalse) create(pServer_,buf,bitmapFile_,fg,bg); } //############################################################################# // Create a predined pixmap (from bitmap.H) //############################################################################# MSPixmap::MSPixmap(MSDisplayServer *pServer_,const char *pName_) : _name(pName_) { char buf[255]; MSGUARD(_hashTableMutex); init(); sprintf(buf,"Predefined_%s_%d_%d",pName_,1,pServer_->display()); if(copyPixmapDataWithKey(buf)==MSFalse) create(pServer_,pName_); } //############################################################################# // Create a predined pixmap (from bitmap.H) in the specified fg and bg //############################################################################# MSPixmap::MSPixmap(MSDisplayServer *pServer_,const char *pName_,unsigned long fg_,unsigned long bg_) : _name(pName_) { char buf[255]; MSGUARD(_hashTableMutex); init(); sprintf(buf,"Predefined_%s_%d_%d_%d_%d",pName_, fg_,bg_,DefaultDepthOfScreen(pServer_->screen()),pServer_->display()); if(copyPixmapDataWithKey(buf)==MSFalse) create(pServer_,pName_,fg_,bg_); } //############################################################################# // Create a predined pixmap (from bitmap.H) in the specified fg and bg //############################################################################# MSPixmap::MSPixmap(MSDisplayServer *pServer_,const char *pName_, const char *foreground_,const char *background_) : _name(pName_) { char buf[255]; MSGUARD(_hashTableMutex); init(); unsigned long fg=pServer_->pixel(foreground_); unsigned long bg=pServer_->pixel(background_); sprintf(buf,"Predefined_%s_%d_%d_%d_%d",pName_, fg,bg,DefaultDepthOfScreen(pServer_->screen()),pServer_->display()); if(copyPixmapDataWithKey(buf)==MSFalse) create(pServer_,pName_,fg,bg); } //############################################################################# // Create a predined pixmap (from bitmap.H) in the specified depth //############################################################################# MSPixmap::MSPixmap(MSDisplayServer *pServer_,const char *pName_, unsigned long fg_,unsigned long bg_,int depth_) : _name(pName_) { char buf[255]; MSGUARD(_hashTableMutex); init(); sprintf(buf,"Predefined_%s_%d_%d_%d_%d",pName_,fg_,bg_,depth_,pServer_->display()); if(copyPixmapDataWithKey(buf)==MSFalse) create(pServer_,pName_,fg_,bg_,depth_); } //############################################################################# // Create a pixmap in the specified width, height, fg, and bg //############################################################################# MSPixmap::MSPixmap(MSDisplayServer *pServer_,const char *pName_, int w_,int h_,unsigned long fg_,unsigned long bg_) : _name(pName_) { char buf[255]; MSGUARD(_hashTableMutex); init(); sprintf(buf,"General_%s_%d_%d_%d_%d_%d_%d",pName_,w_,h_, fg_,bg_,DefaultDepthOfScreen(pServer_->screen()),pServer_->display()); if(copyPixmapDataWithKey(buf)==MSFalse) create(pServer_,buf,w_,h_,fg_,bg_); } //############################################################################# // Create a pixmap in the specified width, height, fg, and bg //############################################################################# MSPixmap::MSPixmap(MSDisplayServer *pServer_,const char *pName_,int w_,int h_, const char *foreground_,const char *background_) : _name(pName_) { char buf[255]; MSGUARD(_hashTableMutex); init(); unsigned long fg=pServer_->pixel(foreground_); unsigned long bg=pServer_->pixel(background_); sprintf(buf,"General_%s_%d_%d_%d_%d_%d_%d",pName_,w_,h_, fg,bg,DefaultDepthOfScreen(pServer_->screen()),pServer_->display()); if(copyPixmapDataWithKey(buf)==MSFalse) create(pServer_,buf,w_,h_,fg,bg); } // Default constructor is for subclass only MSPixmap::MSPixmap(void) : _pData(0) { MSGUARD(_hashTableMutex); init(); } MSPixmap::MSPixmap(const MSPixmap& aPixmap_) { MSGUARD(_hashTableMutex); _name=aPixmap_._name; _pData=aPixmap_._pData; if(_pData!=0) _pData->addReference(); } MSPixmap& MSPixmap::operator=(const MSPixmap& aPixmap_) { if (&aPixmap_!=this) { MSGUARD(_hashTableMutex); _name=aPixmap_._name; MSPixmapData *pData=_pData; _pData=aPixmap_._pData; _pData->addReference(); pData->removeReference(); } return *this; } MSPixmap::~MSPixmap(void) { if(_pData!=0) { MSGUARD(_hashTableMutex); if (_pData->referenceCount()==1) { if (pixmap()!=0) XFreePixmap(server()->display(),pixmap()); if (clipMask()!=0&&clipMask()!=pixmap()) XFreePixmap(server()->display(),clipMask()); _pPixmapHashTable->remove(dataName()); } _pData->removeReference(); _pData=0; } } void MSPixmap::addReference(void) { _pData->addReference(); } void MSPixmap::removeReference(void) { _pData->removeReference(); } MSBoolean MSPixmap::copyPixmapDataWithKey(const char *pName_) { void *pData=_pPixmapHashTable->lookup(pName_); if ((unsigned long)pData==_pPixmapHashTable->notFound()) return MSFalse; _pData=(MSPixmapData*)pData; _pData->addReference(); return MSTrue; } void *MSPixmap::pixmapDataWithKey(const char *pName_) { void *pData=_pPixmapHashTable->lookup(pName_); if ((unsigned long)pData==_pPixmapHashTable->notFound()) return 0; return pData; } void MSPixmap::copyPixmapData(void *pVoid_) { _pData=(MSPixmapData *)pVoid_; _pData->addReference(); } void MSPixmap::addToHashTable(const char *pName_,void *pData_) { _pPixmapHashTable->add(pName_,pData_);} void MSPixmap::init(void) { if (_pPixmapHashTable==0) { _pPixmapHashTable=new MSHashTable(PixmapTableSize); unsigned i=0; while (MSBitmapNameSet[i]!=0) { _pPixmapHashTable->add(MSBitmapNameSet[i],(void *)MSBitmaps[i]); i++; } } } void MSPixmap::create(MSDisplayServer *pServer_,const char *pName_,Pixmap pixmap_,Pixmap clipMask_, int w_,int h_,int depth_,unsigned long fg_,unsigned long bg_) { _pData=new MSPixmapData(pServer_,pName_,pixmap_,clipMask_,w_,h_,depth_,fg_,bg_); addToHashTable(pName_,(void *)_pData); addReference(); } void MSPixmap::create(MSDisplayServer *pServer_,const char *pName_,Pixmap pixmap_, int w_,int h_,int depth_,unsigned long fg_,unsigned long bg_) { _pData=new MSPixmapData(pServer_,pName_,pixmap_,w_,h_,depth_,fg_,bg_); addToHashTable(pName_,(void *)_pData); addReference(); } //############################################################################# // Create a pixmap from array of characters //############################################################################# void MSPixmap::create(MSDisplayServer *pServer_,const char *pName_,const char *bitmap_, int w_,int h_) { Pixmap pixmap=XCreateBitmapFromData(pServer_->display(),pServer_->root(),(char*)bitmap_, w_,h_); _pData=new MSPixmapData(pServer_,pName_,pixmap,pixmap,w_,h_,1,0,0); addToHashTable(pName_,(void *)_pData); addReference(); } void MSPixmap::create(MSDisplayServer *pServer_,const char *pName_,const char *bitmap_, int w_,int h_,unsigned long fg_,unsigned long bg_) { int dep=DefaultDepthOfScreen(pServer_->screen()); Pixmap p=XCreatePixmapFromBitmapData(pServer_->display(),pServer_->root(),(char*)bitmap_, w_,h_,fg_,bg_,dep); _pData=new MSPixmapData(pServer_,pName_,p,w_,h_,dep,fg_,bg_); addToHashTable(pName_,(void *)_pData); addReference(); } //############################################################################# // Create a pixmap from a Pixmap File //############################################################################# void MSPixmap::create(MSDisplayServer *pServer_,const char *pName_,const char *bitmapFile_) { Display *display=pServer_->display(); Window window=pServer_->root(); unsigned w,h; Pixmap bitmap; if (XReadBitmapFile(display,window,bitmapFile_,&w,&h,&bitmap,0,0)==BitmapSuccess) { _pData=new MSPixmapData(pServer_,pName_,bitmap,bitmap,w,h,1,0,0); addToHashTable(pName_,(void *)_pData); addReference(); } else { // Can't read bitmap file, create one with background color MSMessageLog::warningMessage("MSPixmap warning: Unable to create Pixmap from file `%s'\n", bitmapFile_); char buf[255]; unsigned long fg=pServer_->defaultForeground(); unsigned long bg=pServer_->defaultBackground(); int depth=DefaultDepthOfScreen(pServer_->screen()); sprintf(buf,"Predefined_%s_%d_%d_%d_%d",MSPixmap::SolidBackgroundPixmap,fg,bg,depth,display); if(copyPixmapDataWithKey(buf)==MSFalse) create(pServer_,MSPixmap::SolidBackgroundPixmap,fg,bg); } } //############################################################################# // Create a pixmap from a Pixmap File //############################################################################# void MSPixmap::create(MSDisplayServer *pServer_,const char *pName_, const char *bitmapFile_,unsigned long fg_,unsigned long bg_) { Display *display=pServer_->display(); Window window=pServer_->root(); int depth=DefaultDepthOfScreen(pServer_->screen()); unsigned w,h; Pixmap bitmap; #ifdef MS_WINDOWS int res; if (bitmapFile_==0) res=MSXReadBitmapFromResource(display,window,_name,&w,&h,&bitmap); else res=MSXReadBitmapFromXbmFile(display,window,bitmapFile_,&w,&h,&bitmap,fg_,bg_,depth); if( res==BitmapSuccess) { _pData=new MSPixmapData(pServer_,pName_,bitmap,w,h,depth,fg_,bg_); #else if (XReadBitmapFile(display,window,bitmapFile_,&w,&h,&bitmap,0,0)==BitmapSuccess) { Pixmap pixmap=XCreatePixmap(display,window,w,h,depth); GC gc=XCreateGC(display,window,0,0); XSetForeground(display,gc,fg_); XSetBackground(display,gc,bg_); XCopyPlane(display,bitmap,pixmap,gc,0,0,w,h,0,0,1); XFreeGC(display,gc); XFreePixmap(display,bitmap); _pData=new MSPixmapData(pServer_,pName_,pixmap,w,h,depth,fg_,bg_); #endif addToHashTable(pName_,(void *)_pData); addReference(); } else { // Can't read bitmap file, create one with background color MSMessageLog::warningMessage("MSPixmap warning: Unable to create Pixmap from file %s\n",bitmapFile_); char buf[255]; sprintf(buf,"Predefined_%s_%d_%d_%d_%d",MSPixmap::SolidBackgroundPixmap,fg_,bg_,depth,display); if(copyPixmapDataWithKey(buf)==MSFalse) create(pServer_,MSPixmap::SolidBackgroundPixmap,fg_,bg_); } } void MSPixmap::create(MSDisplayServer *pServer_,const char *pName_, int w_,int h_,unsigned long fg_,unsigned long bg_) { int dep=DefaultDepthOfScreen(pServer_->screen()); Pixmap p=XCreatePixmap(pServer_->display(),pServer_->root(),w_,h_,dep); create(pServer_,pName_,p,w_,h_,dep,fg_,bg_); } void MSPixmap::create(MSDisplayServer *pServer_,const char *pName_) { char buf[255]; char *bitmap; if ((unsigned long)(bitmap=(char *)_pPixmapHashTable->lookup(pName_))==_pPixmapHashTable->notFound()) { MSMessageLog::criticalMessage("MSPixmap error: Unable to create prdefined Pixmap `%s' - unknown name\n",pName_); applicationExit(); } else { int w=PredefinedPixmapWidth; int h=PredefinedPixmapHeight; sprintf(buf,"Predefined_%s_%d_%d",pName_,1,pServer_->display()); Pixmap p=XCreateBitmapFromData(pServer_->display(),pServer_->root(),(char *)bitmap,w,h); _pData=new MSPixmapData(pServer_,buf,p,p,w,h,1,0,0); addToHashTable(buf,(void *)_pData); addReference(); } } //############################################################################# // Create a predined pixmap (from bitmap.H) in the specified fg and bg //############################################################################# void MSPixmap::create(MSDisplayServer *pServer_,const char *pName_,unsigned long fg_,unsigned long bg_) { char buf[255]; char *bitmap; if ((unsigned long)(bitmap=(char *)_pPixmapHashTable->lookup(pName_))==_pPixmapHashTable->notFound()) { MSMessageLog::criticalMessage("MSPixmap error: Unable to create prdefined Pixmap `%s' - unknown name\n",pName_); applicationExit(); } else { int w=PredefinedPixmapWidth; int h=PredefinedPixmapHeight; int dep=DefaultDepthOfScreen(pServer_->screen()); sprintf(buf,"Predefined_%s_%d_%d_%d_%d",pName_,fg_,bg_,dep,pServer_->display()); Pixmap p=XCreatePixmapFromBitmapData(pServer_->display(),pServer_->root(), (char *)bitmap,w,h,fg_,bg_,dep); _pData=new MSPixmapData(pServer_,buf,p,w,h,dep,fg_,bg_); addToHashTable(buf,(void *)_pData); addReference(); } } //############################################################################# // Create a predined pixmap (from bitmap.H) in the specified fg, bg, and depth //############################################################################# void MSPixmap::create(MSDisplayServer *pServer_,const char *pName_,unsigned long fg_,unsigned long bg_,int depth_) { char buf[255]; char *bitmap; if ((unsigned long)(bitmap=(char *)_pPixmapHashTable->lookup(pName_))==_pPixmapHashTable->notFound()) { MSMessageLog::criticalMessage("MSPixmap error: Unable to create prdefined Pixmap `%s' - unknown name\n",pName_); applicationExit(); } else { int w=PredefinedPixmapWidth; int h=PredefinedPixmapHeight; sprintf(buf,"Predefined_%s_%d_%d_%d_%d",pName_,fg_,bg_,depth_,pServer_->display()); Pixmap p=XCreatePixmapFromBitmapData(pServer_->display(),pServer_->root(),(char *)bitmap, w,h,fg_,bg_,depth_); _pData=new MSPixmapData(pServer_,buf,p,w,h,depth_,fg_,bg_); addToHashTable(buf,(void *)_pData); addReference(); } } MSDisplayServer *MSPixmap::server(void) { return _pData->_pServer; } const MSDisplayServer *MSPixmap::server(void) const { return _pData->_pServer; } int MSPixmap::width(void) const { return _pData->_width; } int MSPixmap::height(void) const { return _pData->_height; } int MSPixmap::depth(void) const { return _pData->_depth; } unsigned long MSPixmap::foreground(void) const { return _pData->_fg; } unsigned long MSPixmap::background(void) const { return _pData->_bg; } Pixmap MSPixmap::pixmap(void) const { return _pData->_pixmap; } Pixmap MSPixmap::clipMask(void) const { return _pData->_clipMask; } const char *MSPixmap::dataName(void) const { return _pData->_pName; } aplus-fsf-4.22/src/MSGUI/MSPopup.C0000644000265000001440000001213510772770410012147 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include MSPopup::MSPopup(const char *windowTitle_) : MSShell(windowTitle_) { init(); } MSPopup::MSPopup(MSDisplayServer *server_,const char *windowTitle_) : MSShell(server_,windowTitle_) { init(); } MSPopup::MSPopup(MSShell *leader_,const char *windowTitle_) : MSShell(leader_->server(),windowTitle_) { init(); windowGroup(leader_); foreground(leader_->foreground()); background(leader_->background()); font(leader_->font()); } MSPopup::~MSPopup(void) { if (mapped()==MSTrue&&modal()==MSTrue) { server()->removePassiveGrab(this); changeBusyState(MSFalse); } } void MSPopup::init(void) { pushPinState(MSFalse); setWinAttr(); footer(MSFalse); _modal=MSFalse; } void MSPopup::pinIn(void) { pushPinState(MSTrue); setWinAttr(); } void MSPopup::pinOut(void) { pushPinState(MSFalse); setWinAttr(); } void MSPopup::map(void) { if (mapped()==MSFalse) { if (modal()==MSTrue) { server()->addPassiveGrab(this); changeBusyState(MSTrue); changeBusyState(this,MSFalse); MSShell::map(); #ifndef MS_MAPNOTIFY_ON_MAP_BUG // Waiting for MapNotify Event while (1) { XEvent ev; XPeekEvent(display(),&ev); server()->processOneEvent(); if (ev.type==MapNotify&&ev.xmap.window==window()) { server()->flush(); return; } } #endif } else MSShell::map(); } } void MSPopup::unmap(void) { if (mapped()==MSTrue) { unmapFollowers(); if (pushPinState()==MSFalse) { if (modal()==MSTrue) { server()->removePassiveGrab(this); changeBusyState(MSFalse); } MSWidget::unmap(); XWithdrawWindow(display(),window(),server()->screenNum()); } } } void MSPopup::setWinAttr(void) { if (server()->isCDERunning()==MSFalse) { //This code is specific to OLWM struct {Atom win;Atom menu;Atom pin;} props; Atom winType=server()->atom(MSAtomTable::WinAttr); props.win=server()->atom(MSAtomTable::WTCmd); props.menu=server()->atom(MSAtomTable::MenuLimited); props.pin=server()->atom((pushPinState()==MSTrue)?MSAtomTable::PinIn:MSAtomTable::PinOut); XChangeProperty(display(),window(),winType,winType,32, PropModeReplace,(unsigned char *)&props,3); } else { if(firstMap()==MSFalse) { removeWMDecorations(IconifyButton|MaximizeButton); removeWMFunctions(Minimize|Maximize); } } } void MSPopup::dismiss(void) { if (activateCallback(MSWidgetCallback::dismiss)==MSFalse) hide(); } void MSPopup::clientMessage(const XEvent *event_) { if (event_->xclient.message_type==server()->atom(MSAtomTable::WMProtocols)) { if (event_->xclient.data.l[0]==server()->atom(MSAtomTable::WMDeleteWindow)) { pushPinState(MSFalse); dismiss(); } } } void MSPopup::propertyNotify(const XEvent *event_) { Atom prop=server()->atom(MSAtomTable::PushpinState); if (event_->xproperty.atom==prop) { Atom actualTarget; int actualFormat; int status; unsigned long itemCount; unsigned long bytesRemaining; unsigned char *actData; int *data=0; long len=(sizeof(int)+3)>>2; status=XGetWindowProperty(display(),window(),prop, 0L,len,False,XA_INTEGER, &actualTarget,&actualFormat, &itemCount,&bytesRemaining,&actData); if (status==Success&&actualTarget==XA_INTEGER&& actualFormat==propertyFormat(prop)&&itemCount>0) { data=(int *)actData; pushPinState((MSBoolean)data[0]); } if (data!=0) XFree((char *)actData); } else { MSShell::propertyNotify(event_); } } void MSPopup::modal(MSBoolean modal_) { if (_modal!=modal_) { _modal=modal_; if (modal()==MSTrue) { if(leader()!=0) transientFor(leader()); } else transientFor(0); if (mapped()==MSTrue) { if (modal()==MSTrue) { server()->addPassiveGrab(this); changeBusyState(MSTrue); changeBusyState(this,MSFalse); } else { server()->removePassiveGrab(this); changeBusyState(MSFalse); } } } } void MSPopup::transientFor(MSShell *shell_) { XSetTransientForHint(display(),window(),shell_==0?server()->root():shell_->window()); } void MSPopup::set(MSAttrValueList& avList_) { MSShell::set(avList_); } MSAttrValueList& MSPopup::get(MSAttrValueList& avList_) { avList_< MSPopupMenu::MSPopupMenu(MSDisplayServer *server_) : MSMenu(server_) { XDefineCursor(display(),window(),grabCursor()->cursor()); } MSPopupMenu::~MSPopupMenu(void) {} void MSPopupMenu::show(void) { if (mapped()==MSFalse) { map(); raise(); grab(); } } void MSPopupMenu::showAtPointer(void) { int w,h; if (firstMap()==MSFalse) calculateNaturalSize(w,h); else { w=width(); h=height(); } int x,y; pointerXY(x,y); if (x+w>server()->width()) x=server()->width()-w; if (y+h>server()->height()) y=server()->height()-h; moveTo(x,y); map(); raise(); grab(); } aplus-fsf-4.22/src/MSGUI/MSPostScript.C0000644000265000001440000005467510772770410013175 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #include #include #include static const char *DefaultPrintFont ="LucidaSans-TypewriterBold"; static const char *AltDefaultPrintFont ="Courier"; static const char *DefaultScreenFont ="Courier"; static const int MSPrintFontTableSize = 256; /*static const int DefaultLineWidth = 1;*/ static const int DefaultLeftPixel = 72; static const int DefaultRightPixel = 72; static const int DefaultTopPixel = 72; static const int DefaultBottomPixel = 72; static const int BadFontName = 0xFF55; static MSBoolean _afmInitialized = MSFalse; unsigned long MSPostScript::_blackPixel = LONG_MAX; unsigned long MSPostScript::_whitePixel = LONG_MAX; extern const double PSFactor = 0.85; extern const int MSPointsPerInch = 72; extern const int MSPageSizeXTable[] = {612,612,595,516,612,792 }; extern const int MSPageSizeYTable[] = {792,1008,842,728,792,1224}; extern MSString applicationVersionString(void); MSPrintFontHashTable::~MSPrintFontHashTable(void) { for (int i=0;inext(); data=(MSPrintFontData *) entry->value(); if (data!=0) delete data; delete entry; entry=bucket(i); } } } MSPostScript::MSPostScript(void) { _pageOrientation =Landscape; _pageSize =Letter; _printMode =Mono; _pageLayout =MSCenter; _outputMode =PS; _leftPixel =DefaultLeftPixel; _rightPixel =DefaultRightPixel; _topPixel =DefaultTopPixel; _bottomPixel =DefaultBottomPixel; _lineWidth =-1; _lineStyle =-1; _capStyle =-1; _joinStyle =-1; _fontCount =0; _defaultFontSize =10; // init gcValues structure _gcValues.arc_mode=ArcPieSlice; _gcValues.foreground=0; _gcValues.background=0; _gcValues.line_width=0; _gcValues.line_style=0; _gcValues.dash_offset=0; _gcValues.cap_style=0; _gcValues.join_style=0; _gcValues.font=0; pout.precision(4); fontString(DefaultScreenFont); _defaultFontString=DefaultScreenFont; printFontIDHashTable().init(MSPrintFontTableSize); fontDataHashTable().init(MSPrintFontTableSize); printFontIDHashTable().notFound(0x55FF); fontDataHashTable().notFound(0x0); _fontPath=defaultFontPath(); _disclaimer=new MSPrintDisclaimer(this); init(); } MSPostScript::~MSPostScript(void) { _afmInitialized=MSFalse; pout.close(); delete _disclaimer; } void MSPostScript::init(void) { _pages =1; _fontID =0; _foreground =LONG_MAX; _background =LONG_MAX; _gscale =1; _lineStyle =-1; _lineWidth =-1; _capStyle =-1; _joinStyle =-1; _bwidth =0; _bheight =0; _x_org =0; _y_org =0; _x_printScale=1; _y_printScale=1; documentFonts().removeAll(); } void MSPostScript::leftMargin(double x_) {_leftPixel=x_<=0.07?5:(int)(MSPointsPerInch*x_);} void MSPostScript::rightMargin(double x_) {_rightPixel=x_<=0.07?5:(int)(MSPointsPerInch*x_);} void MSPostScript::topMargin(double x_) {_topPixel=x_<=0.07?5:(int)(MSPointsPerInch*x_);} void MSPostScript::bottomMargin(double x_) {_bottomPixel=x_<=0.07?5:(int)(MSPointsPerInch*x_);} double MSPostScript::leftMargin(void) const {return _leftPixel==5?0.0:(double)_leftPixel/MSPointsPerInch;} double MSPostScript::rightMargin(void) const {return _rightPixel==5?0.0:(double)_rightPixel/MSPointsPerInch;} double MSPostScript::topMargin(void) const {return _topPixel==5?0.0:(double)_topPixel/MSPointsPerInch;} double MSPostScript::bottomMargin(void) const {return _bottomPixel ==5?0.0:(double)_bottomPixel/MSPointsPerInch;} void MSPostScript::initFont(void) { if (fontCount()==0) { if (_afmInitialized==MSFalse&&afmfilesHashTable()==0) { _afmInitialized=MSTrue; initAfmfilesHashTable(fontPath()); } if (printFontID((char *)DefaultPrintFont)==BadFontName) { if (printFontID((char*)AltDefaultPrintFont)==BadFontName) { MSMessageLog::warningMessage("Warning: unable to initialize fonts.\n"); } } } } void MSPostScript::fontPath(const char *path_) { DIR *dp; if (path_!=0&&(dp=opendir(path_))!=0) { _fontPath=path_; closedir(dp); } else { MSMessageLog::errorMessage("Error: directory %s: not found\n",path_); } } void MSPostScript::defaultFontName(const char *str_) { const char *tempStr,*fontStr; if ((tempStr=formatFontString(str_))!=0&& (fontStr=(char *)fontHashTable()->lookup(tempStr))!=0) { _defaultFontString=fontStr; } else { MSMessageLog::warningMessage("Warning: Invalid font specification - using %s\n",defaultFontString().string()); } } Font MSPostScript::printFontID(const char *fontString_) { Font fid=0; const char *fontStr,*tempStr; if ((tempStr=extractFontString(fontString_))!=0) { // see if its already allocated if ((fid=(Font)printFontIDHashTable().lookup(tempStr))==printFontIDHashTable().notFound()) { // see if it exists as specified if (findFont(tempStr)!=MSTrue) { // look it up in the font table MSString str(tempStr); str.lower(); if ((fontStr=(char *)fontHashTable()->lookup(str))!=0) { // see if the converted font is allocated if ((fid=(Font)printFontIDHashTable().lookup(fontStr))==printFontIDHashTable().notFound()) { // try to find the converted font if (findFont(fontStr)!=MSTrue) { MSMessageLog::warningMessage("Warning: invalid font specification %s\n",tempStr); printFontIDHashTable().add(fontStr,(void *)BadFontName); if (strcmp(fontStr,tempStr)!=0) printFontIDHashTable().add(tempStr,(void *)BadFontName); } else { addFont(fontStr); printFontIDHashTable().add(tempStr,(void *)fontCount()); } } else { printFontIDHashTable().add(tempStr,(void *)fid); fontSize(extractFontSize(fontString_)); return fid; } } else { MSMessageLog::warningMessage("Warning: invalid font specification %s\n",tempStr); printFontIDHashTable().add(tempStr,(void *)BadFontName); } } else addFont(tempStr); fid=(Font)printFontIDHashTable().lookup(tempStr); } fontSize(extractFontSize(fontString_)); } else fontSize(defaultFontSize()); return fid; } MSBoolean MSPostScript::findFont(const char *fontString_) { DIR *dp; struct dirent *fp; MS_DECLARE_DIRENT(dirEntry); //see comment in MSDefines.H on usage of this macro MSString str(fontString_); MSBoolean status=MSFalse; _path=fontPath(); fontFileName(fontString_); if (str.length()!=0) { str<<".afm"; if ((dp=opendir(fontPath()))!=0) { while (MS_READDIR(dp,dirEntry,fp)!=0) if (str==fp->d_name) { status=MSTrue; break; } closedir(dp); } if (status!=MSTrue&&(dp=opendir(defaultFontPath()))!=0) { if (fontPath()!=defaultFontPath()) { while (MS_READDIR(dp,dirEntry,fp)!=0) if (str==fp->d_name) { _path=defaultFontPath(); status=MSTrue; break; } } closedir(dp); if (status!=MSTrue&&afmfilesHashTable()!=0&&(dp=opendir(defaultFontPath()))!=0) { MSString afmfile((char *)afmfilesHashTable()->lookup(fontString_)); MSString tmp=afmfile; tmp<<".afm"; while (MS_READDIR(dp,dirEntry,fp)!=0) if (tmp==fp->d_name) { _path=defaultFontPath(); fontFileName(afmfile); status=MSTrue; break; } closedir(dp); } } if (status!=MSTrue&&(dp=opendir(altDefaultFontPath()))!=0) { while (MS_READDIR(dp,dirEntry,fp)!=0) if (str==fp->d_name) { _path=altDefaultFontPath(); status=MSTrue; break; } closedir(dp); if (status!=MSTrue&&afmfilesHashTable()!=0&& (dp=opendir(altDefaultFontPath()))!=0) { MSString afmfile((char *)afmfilesHashTable()->lookup(fontString_)); MSString tmp=afmfile; tmp<<".afm"; while (MS_READDIR(dp,dirEntry,fp)!=0) if (tmp==fp->d_name) { _path=altDefaultFontPath(); fontFileName(afmfile); status=MSTrue; break; } closedir(dp); } } } return status; } void MSPostScript::addFont(const char *fontString_) { MSPrintFontData *data=0; if (fontString_!=0) { if ((MSPrintFontData *)printFontIDHashTable().lookup(fontString_)== (MSPrintFontData *)printFontIDHashTable().notFound()) { data=new MSPrintFontData(path(),fontFileName()); if (data->bufsize()!=0) { data->fontID(++_fontCount); fontDataHashTable().add(data->fontID(),(void *)data); printFontIDHashTable().add(fontString_,(void *)data->fontID()); } else { printFontIDHashTable().add(fontString_,(void *)BadFontName); delete data; } } documentFonts()<fontName(); } } MSPrintFontData *MSPostScript::fontStruct(Font fid_) { MSPrintFontData *data=0; if ((data=(MSPrintFontData *)fontDataHashTable().lookup(fid_))== (MSPrintFontData *)fontDataHashTable().notFound()) { if ((data=(MSPrintFontData *)fontDataHashTable().lookup(1))== (MSPrintFontData *)fontDataHashTable().notFound()) { MSMessageLog::warningMessage("Warning: no font information available.\n"); } } return data; } Font MSPostScript::font(const char *font_) { initFont(); Font fid=printFontID(font_); if (fid!=0&&fid!=printFontIDHashTable().notFound()) { fontID(fid); fontString(font_); } return fid; } const char *MSPostScript::fontName(Font fid_) { MSPrintFontData *data=(MSPrintFontData *)fontStruct(fid_); return data!=0?data->fontName().string():DefaultPrintFont; } MSBoolean MSPostScript::printOpen() { MSBoolean status=MSTrue; MSString file(fileName()); if (outputMode()==EPS) file.change(".ps",".eps",0,1); if (outputMode()==PPM) file.change(".ps",".ppm",0,1); pout.open(file); if (pout.fail()==ios::failbit) { MSMessageLog::warningMessage("Error: opening file %s\n",file.string()); status=MSFalse; } return status; } MSBoolean MSPostScript::printClose(void) { printEpilog(); pout.close(); disclaimer().closeFile(); return MSTrue; } void MSPostScript::printProlog(void) { unsigned n; struct tm *tp; struct timeval tv; struct passwd *pwd; gettimeofday(&tv,NULL); const time_t *tmp=(const time_t*)&tv.tv_sec; #if defined(MS_THREAD_SAFE_FUNCTIONS) //see comment in MSDefines.H on mt-safe system function usage. struct tm tmStruct; struct passwd pwdStruct; char charBuf[1024]; #endif tp=MS_LOCALTIME(tmp,&tmStruct); pout<<"%!PS-Adobe-3.0 "<<(outputMode()==EPS?"EPSF-3.0":"MSPostScript_1.0") << endl; pout<<"%%Creator: "; #if defined(MS_WINDOWS) pout<<"winnt"; #else MS_GETPWUID(geteuid(),&pwdStruct,charBuf,1024,pwd); pout<<((pwd!=0)?pwd->pw_name:""); #endif pout<<" - "<<"MStk Release "<0) { pout<<"font "<>8); pout<< " "; pout<< (double)(fgRGB().green>>8); pout<< " "; pout<< (double)(fgRGB().blue>>8); pout<< " "; pout<< "tc"; } pout<< " "; status=MSTrue; } return status; } MSBoolean MSPostScript::setBGColor(void) { MSBoolean status=MSFalse; if (bgColor()!=gcValues().foreground) { updateBackground(); if (bgRGB().red==bgRGB().green&&bgRGB().green==bgRGB().blue) { pout<< (double)(bgRGB().red)/65536.0; pout<< " "; pout<< "sg"; } else { pout<< (double)(bgRGB().red>>8); pout<< " "; pout<< (double)(bgRGB().green>>8); pout<< " "; pout<< (double)(bgRGB().blue>>8); pout<< " "; pout<< "tc"; } pout<< " "; status=MSTrue; } return status; } MSBoolean MSPostScript::setLineAttributes(void) { MSBoolean status=MSFalse; if (lineWidth()!=gcValues().line_width) { lineWidth(gcValues().line_width); pout<< ((lineWidth()>2)?lineWidth()-1:lineWidth()); pout<< " "; pout<< "w"; pout<< " "; status=MSTrue; } if (lineStyle()!=gcValues().line_style) { dashOffset(gcValues().dash_offset); switch (gcValues().line_style) { case LineOnOffDash: case LineDoubleDash: pout<<"[ "; pout<<"]"; pout<<" "; pout<h_?(double)h_/w_:1.0; double xscale=h_>w_?(double)w_/h_:1.0; double r=(w_>h_?w_:h_)/2; double x=x_+r; double y=y_-r; double xt=x/xscale; double yt=y/yscale; if (xscale<1||yscale<1) { pout<< "gs"; pout<< " "; pout<< (xscale<1?r*xscale-r:0); pout<< " "; pout<< (yscale<1?r-r*yscale:0); pout<< " "; pout<< "translate"; pout<< " "; pout<< xscale; pout<< " "; pout<< yscale; pout<< " "; pout<< "scale"; pout<< " "; } if (arcMode_==ArcPieSlice&&mode_==Fill) { pout<< xt; pout<< " "; pout<< yt; pout<< " "; pout<< "M"; pout<< " "; } pout<< xt; pout<< " "; pout<< yt; pout<< " "; pout<< r; pout<< " "; if (angle2_==circle) { pout<< "C"; } else { double angle1=(angle1_<0?angle1_+circle:angle1_)/64.0; double angle2=angle1+angle2_/64.0; if (angle2_<0) { pout<< angle2; pout<< " "; pout<< angle1; } else { pout<< angle1; pout<< " "; pout<< angle2; } pout<< " "; pout<< "arc"; } pout<< " "; pout<< (mode_==Fill?"f":"st"); pout<< " "; if (xscale<1||yscale<1) pout<< "gr"; pout<< endl; } void MSPostScript::printLine(double x1_,double y1_,double x2_,double y2_) { pout<< x1_; pout<< " "; pout<< y1_; pout<< " "; pout<< x2_; pout<< " "; pout<< y2_; pout<< " "; pout<< "v"; pout<< endl; } void MSPostScript::printRectangle(double x_,double y_,double w_,double h_) { pout<< "n"; pout<< " "; pout<< x_; pout<< " "; pout<< y_; pout<< " "; pout<< "M"; pout<< " "; pout<< -w_; pout<< " "; pout<< "0"; pout<< " "; pout<< "0"; pout<< " "; pout<< -h_; pout<< " "; pout<< w_; pout<< " "; pout<< "0"; pout<< " "; pout<< "3"; pout<< " "; pout<< "D"; pout<< " "; pout<< "P"; pout<< " "; } void MSPostScript::printString(int x_,int y_,const char *string_,int n_) { MSString aString(string_,n_); aString.change("\\","\\\\").change("(","\\(").change(")","\\)"); if (aString.length()>0) { pout<< x_; pout<< " "; pout<< y_; pout<< " "; pout<< "M"; pout<< " "; pout<< "("; pout<< aString; pout<< ")"; pout<< " "; pout<< "show"; pout<< endl; } } void MSPostScript::setClipRectangle(int x_,int y_,int width_,int height_) { pout<< x_; pout<< " "; pout<< y_; pout<< " "; pout<< "M"; pout<< " "; pout<< -width_; pout<< " "; pout<< "0"; pout<< " "; pout<< "0"; pout<< " "; pout<< -height_; pout<< " "; pout<< width_; pout<< " "; pout<< "0"; pout<< " "; pout<< "3"; pout<< " "; pout<< "D"; pout<< " "; pout<< "clip"; pout<< " "; pout<< "n"; } MSString MSPostScript::adjustedFileName(void) const { MSString file(fileName()); if (outputMode()==EPS) file.change(".ps",".eps",0,1); if (outputMode()==PPM) file.change(".ps",".ppm",0,1); return file; } aplus-fsf-4.22/src/MSGUI/MSPrimitive.C0000644000265000001440000000326110772770410013014 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include //static const unsigned long MSPrimitiveEventMask=(ExposureMask); static const int MSPrimitiveDefaultHighlightThickness=1; static const int MSPrimitiveDefaultShadowThickness=2; MSPrimitive::MSPrimitive(MSWidget *owner_,const char *title_) : MSWidgetCommon(owner_,title_) { init(); } MSPrimitive::MSPrimitive(MSWidget *owner_,const MSStringVector& title_) : MSWidgetCommon(owner_,title_) { init(); } MSPrimitive::~MSPrimitive(void) {} void MSPrimitive::init(void) { _highlightThickness=MSPrimitiveDefaultHighlightThickness; _shadowThickness=MSPrimitiveDefaultShadowThickness; _highlighted=MSFalse; shadowStyle(MSRaised); } void MSPrimitive::verifyBell(void) { XBell(display(),0); } void MSPrimitive::focusIn(void) { highlight(); } void MSPrimitive::focusOut(void) { unHighlight(); } void MSPrimitive::redraw(void) { if (mapped()==MSTrue) { drawBackground(); drawShadow(); } } void MSPrimitive::print(const char *file_) { MSBoolean fileOpen=MSFalse; MSBoolean open=MSTrue; if (outputMode()==Draw) { if (file_!=0) displayPrintFileName(file_); if ((open=displayPrintOpen(this))==MSTrue) { fileOpen=MSTrue; outputMode(Print); displayPrintXorigin(0); displayPrintYorigin(0); } } if (open==MSTrue) { redraw(); if (fileOpen==MSTrue) { displayPrintClose(); outputMode(Draw); } } } aplus-fsf-4.22/src/MSGUI/MSPrimitiveText.C0000644000265000001440000000377010772770410013666 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #ifdef MS_NO_INLINES #include #endif MSPrimitiveText::MSPrimitiveText(MSWidget *owner_) : MSPrimitive(owner_) { init(); } MSPrimitiveText::~MSPrimitiveText(void) { if (textGC()!=0) XFreeGC(display(),_textGC); _textFontStruct=0; if (stipple()!=0) delete _stipple; } void MSPrimitiveText::init(void) { _textGC=0; _textFontStruct=0; _alignment=MSCenter; _stipple=new MSPixmap(server(),MSPixmap::ForegroundFiftyPixmap,1,0,1); XGCValues values; values.foreground=foreground(); values.background=background(); values.font=font(); values.stipple=stipple()->pixmap(); values.fill_style = FillSolid; _textGC=XCreateGC(display(),window(), (GCForeground|GCBackground|GCFont|GCStipple|GCFillStyle), &values); _textFontStruct=(XFontStruct *)server()->fontStruct(font()); } void MSPrimitiveText::alignment(unsigned alignment_) { if (alignment()!=alignment_) { _alignment=alignment_; redraw(); } } void MSPrimitiveText::updateFont(Font oldfid_) { MSPrimitive::updateFont(oldfid_); XSetFont(display(),textGC(),font()); _textFontStruct=(XFontStruct *)server()->fontStruct(font()); } void MSPrimitiveText::updateForeground(unsigned long oldfg_) { MSPrimitive::updateForeground(oldfg_); XSetForeground(display(),textGC(),foreground()); } void MSPrimitiveText::updateBackground(unsigned long oldbg_) { MSPrimitive::updateBackground(oldbg_); XSetBackground(display(),textGC(),background()); } void MSPrimitiveText::updateSensitivity (void) { if (sensitive()) XSetFillStyle(display(),textGC(),FillSolid); else XSetFillStyle(display(),textGC(),FillStippled); } aplus-fsf-4.22/src/MSGUI/MSPrintColumn.C0000644000265000001440000004252310772770410013322 ///////////////////////////////////////////////////////////////////////////////// // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include extern const int MSPointsPerInch; MSPrintColumn::MSPrintColumn(MSPrintManager *parent_,unsigned numColumns_,const MSSymbol& tag_) : _tag(tag_), MSPrintManager(parent_) { init(); _numColumns=numColumns_; parent_->addPrintItem(this); } MSPrintColumn::MSPrintColumn(MSPrintManager *parent_,MSFloatVector& columnWidths_,unsigned numColumns_,const MSSymbol& tag_) : _tag(tag_), MSPrintManager(parent_) { init(); _numColumns=numColumns_; _columnWidths=columnWidths_; parent()->addPrintItem(this); } MSPrintColumn::MSPrintColumn(unsigned numColumns_,const MSSymbol& tag_) : _tag(tag_) { init(); _numColumns=numColumns_; } MSPrintColumn::MSPrintColumn(MSFloatVector& columnWidths_,unsigned numColumns_,const MSSymbol& tag_) : _tag(tag_) { init(); _numColumns=numColumns_; _columnWidths=columnWidths_; } MSPrintColumn::~MSPrintColumn(void) { removeAll(); if (parent()!=0) { destroyable(MSFalse); parent()->removePrintItem(this); } if (owner()!=0) { destroyable(MSFalse); owner()->removeHeader(this); owner()->removeFooter(this); } } void MSPrintColumn::init(void) { _owner=0; _residualHeight=0; _pixelWidth=0; _pixelHeight=0; _leftIndent=1; _rightIndent=1; _style=0; _headingsOn=MSFalse; topPixel(2); bottomPixel(2); } MSPrintColumn& MSPrintColumn::tag(const MSSymbol& x_) {_tag=x_; return *this;} MSPrintColumn& MSPrintColumn::columnWidths(const MSFloatVector& x_) {_columnWidths=x_; return *this;} MSPrintColumn& MSPrintColumn::justification(MSAlignment x_) {MSPrintItem::justification(x_); return *this;} MSPrintColumn& MSPrintColumn::justification(unsigned long x_) {MSPrintItem::justification(x_); return *this;} MSPrintColumn& MSPrintColumn::leftIndent(unsigned x_) {_leftIndent=x_>0?x_:1; return *this;} MSPrintColumn& MSPrintColumn::rightIndent(unsigned x_) {_rightIndent=x_>0?x_:1; return *this;} MSPrintColumn& MSPrintColumn::topPixel(unsigned x_) {MSPrintItem::topPixel(x_); return *this;} MSPrintColumn& MSPrintColumn::bottomPixel(unsigned x_) {MSPrintItem::bottomPixel(x_); return *this;} MSPrintColumn& MSPrintColumn::numColumns(unsigned x_) {_numColumns=x_; return *this;} MSPrintColumn& MSPrintColumn::printRow(int x_) {MSPrintItem::printRow(x_); return *this;} MSPrintColumn& MSPrintColumn::printColumn(int x_) {MSPrintItem::printColumn(x_); return *this;} MSPrintColumn& MSPrintColumn::row(int x_) {MSPrintItem::printRow(x_); return *this;} MSPrintColumn& MSPrintColumn::column(int x_) {MSPrintItem::printColumn(x_); return *this;} MSPrintColumn& MSPrintColumn::occurrence(unsigned long x_) {MSPrintItem::occurrence(x_); return *this;} MSPrintColumn& MSPrintColumn::occurrence(Occurrence x_) {MSPrintItem::occurrence(x_); return *this;} MSPrintColumn& MSPrintColumn::pageAlignment(unsigned long x_) {MSPrintItem::pageAlignment(x_); return *this;} MSPrintColumn& MSPrintColumn::pageAlignment(MSAlignment x_) {return pageAlignment((unsigned long)x_);} MSPrintColumn& MSPrintColumn::font(const char *string_) {MSPrintItem::printFont(string_); return *this;} MSPrintColumn& MSPrintColumn::topOffset(double x_) {MSPrintItem::topOffset(x_); return *this;} MSPrintColumn& MSPrintColumn::bottomOffset(double x_) {MSPrintItem::bottomOffset(x_); return *this;} MSPrintColumn& MSPrintColumn::leftMargin(double x_) {MSPrintItem::leftMargin(x_); return *this;} MSPrintColumn& MSPrintColumn::rightMargin(double x_) {MSPrintItem::rightMargin(x_); return *this;} MSPrintColumn& MSPrintColumn::headingsOn(MSBoolean x_) {_headingsOn=x_; return *this;} MSPrintColumn& MSPrintColumn::style(unsigned long style_) { // for backward compatibility before the justification attribute unsigned long just=style_&(MSRight|MSLeft|MSTop|MSBottom|MSCenter); if (just>0) justification(just); _style=style_; return *this; } double MSPrintColumn::topOffset(void) const {return MSPrintItem::topOffset();} double MSPrintColumn::bottomOffset(void) const {return MSPrintItem::bottomOffset();} double MSPrintColumn::leftMargin(void) const {return MSPrintItem::leftMargin();} double MSPrintColumn::rightMargin(void) const {return MSPrintItem::rightMargin();} const MSSymbol& MSPrintColumn::printTag(void) const {return tag();} // // printing methods // unsigned MSPrintColumn::columnPixel(unsigned i_) { unsigned x=leftPixel(); for (unsigned i=0;i0&&cw>w) scale=w/cw; for (unsigned i=0;iprintColumn(); for (min=i,j=i+1;jprintColumn())>=0&&cminCol)) { min=j; minCol=c; } } printItemList().exchange(min,i); minCol=item(i)->printColumn(); if (minCol>=0&&columns.indexOf(minCol)==columns.length()) columns<printColumn()==col) { rows++; int minRow=item(j)->printRow(); for (min=j,k=j+1;kprintColumn()==col) { if ((row=item(k)->printRow())0) { int allocated=(int)columnRowCounts().sum(); //Check if we have distributed less items than we actually have if (allocated0) { residualRows--; newCount++;} columnRowCounts()<numColumns()) { columnCount(numColumns()); if ((count%numColumns())==0) fixedRowCount(count/numColumns()); else fixedRowCount(count/numColumns()+1); } } void MSPrintColumn::computeChildrenSize(MSReport *report_,int x_,int y_,int,int h_,int topMargins_,int) { unsigned startRow=0,row,col,i; int y_start=y_-topPixel(); int h,y=y_start; int headingHeight=0; sortPrintItemsByRowColumn(); computeConfiguration(); computeColumnWidths(); pageBreakRow(-1); int maxRows=columnRowCounts().max(); maxRows=maxRows>fixedRowCount()?maxRows:fixedRowCount(); MSUnsignedVector heights(maxRows,0); MSUnsignedVector pageCounts(maxRows,0); // if headingsOn is true determine the heading height on the subsequent pages. if (headingsOn()==MSTrue) { for (col=0,i=0;ipageAlignment(MSNone); if (pItem->printFont().length()==0) pItem->printFont(printFont()); if(pItem->printRow()>0) continue; h=pItem->computePrintSize(report_,x_,report_->bodyTop()-topMargins_,columnPixelWidth(col),h_,topMargins_,indents()); // It must be less then one page or it can't be used as a heading if (pItem->pageCount()==0) heights[0]=heights(0)>h?heights(0):h; } headingHeight=heights(0); startRow=1; } // check if there is enough room to print anything on the current page // if it gets bumped to the next page, increment the report page count // so that the children get the right page sizes. int border=0; // if(style()&MSP::Box) border=2*(lineWidth()); // else border= (style()&MSP::BoxT?lineWidth():0)+(style()&MSP::BoxB?lineWidth():0); int minHeight=topPixel()+headingHeight+border+10; //TODO: where is this 10 came from?????? int remainingHeight=y_start-report_->pageEnd()-topMargins_; int startingPageCount=report_->pageCount(); if (minHeight>remainingHeight||(owner()==0&&pageAlignment()&MSTop&&y_!=report_->bodyTop())) { _pageCount++; report_->pageCountIncrement(); y_start=report_->bodyTop()-topPixel(); y=y_start; remainingHeight=y_start-report_->pageEnd()-topMargins_; } int columnStartPage=report_->pageCount(); int runningPageCount=pageCount(); // compute sizes of each of the children on a row basis // this not very efficient loop because the list sorted in // column major order, and now we have to traverse in row major // order. in future modify list to keep items in row major order. int colStart,myRow; for(row=(headingsOn()==MSTrue?1:0);rowprintRow()<(int)row) i++; } if(myRow<=rowCount(col)&&ipageAlignment(MSNone); if (report_->printOnPage(*pItem,report_->pageCount(),report_->pageCountTotal())==MSTrue) { if (pItem->printFont().length()==0) pItem->printFont(printFont()); h=pItem->computePrintSize(report_,x_,y,columnPixelWidth(col),h_, topMargins_+headingHeight+border,indents()); pageCounts[row]=pageCounts(row)>pItem->pageCount()?pageCounts(row):pItem->pageCount(); if(pItem->pageCount()==pageCounts(row)) { heights[row]=heights(row)>h?heights(row):h; } } } } report_->pageCount(columnStartPage); colStart+=rowCount(col); i=colStart; } if (pageCounts(row)>0) { runningPageCount =pageCounts(row); columnStartPage+=runningPageCount; y=report_->bodyTop(columnStartPage); report_->pageCount(columnStartPage); remainingHeight=y-report_->pageEnd()-topMargins_; } y-=heights(row); } // compute residual sizes for the print column based on the // items appearing on the last page of the print column _pageCount+=(int)pageCounts.sum(); int resid=0; for(int j=maxRows-1;j>=(int)startRow;j--) { resid+=heights(j); if(pageCounts(j)!=0) break; } if(resid!=0) { if(pageCount()==0) resid+=topPixel(); if(headingsOn()==MSTrue) resid+=heights(0); if(resid+bottomPixel()pageCount(startingPageCount); } unsigned MSPrintColumn::rowCount(unsigned index_) { return index_0) { if (margins_==0) { if (leftPixel()<0) leftPixel(report_->leftPixel()); if (rightPixel()<0) rightPixel(report_->rightPixel()); margins_=leftPixel()+rightPixel(); } // margins_+=(style()&MSP::Box)?lineWidth()*2:style()&MSP::BoxL pixelWidth(w_-margins_); computeChildrenSize(report_,x_,y_,w_,h_,topMargins_,margins_); int remainingHeight=y_-report_->pageEnd()-topMargins_; if (pageCount()==0&&(pageAlignment()&MSCenter||pageAlignment()&MSBottom)) { _pageCount++; _residual=0; residualHeight(remainingHeight); } else if (residual()!=0&&residual()+bottomPixel()outputMode()==ASCII) { for(int index=0;indexprint(report_,0,0,0,0,0,0); } return 0; } if (printItemList().count()>0) { unsigned row,col,i,j; int currentPageBreakRow=-1; int rowHeight,y_start=y_-(pageBreakRow()<0?topPixel():0); int row_start=pageBreakRow()>0?pageBreakRow():0; int y=y_start; int headingHeight=0; int left=leftIndent_; int top=0; /* int bottom=0; if(style()&MSP::Box) top=bottom=lineWidth(); else { if(style()&MSP::BoxT) top=lineWidth(); if(style()&MSP::BoxB) bottom=lineWidth(); } y-=top; y_start-=top; bottomIndent_+=bottom; */ if (columnPixelWidth().length()==1) { int residual=pixelWidth()-columnPixelWidth(0)*columnCount(); left+=residual/2; } if (headingsOn()==MSTrue&&owner()==0) headingHeight=rowHeights()(0); int minHeight=topPixel()+headingHeight+top+10; int remainingHeight=y_-report_->pageEnd()-bottomIndent_; if (minHeight>remainingHeight|| (currentPage()==0&&(owner()==0&&pageAlignment()&MSTop&&y_!=report_->bodyTop()))) { _currentPage++; // pageBreakRow(0); return remainingHeight; } if (pageCount()==0&&residualHeight()pageEnd()+residualHeight()+bottomIndent_; } } if (headingsOn()==MSTrue) { headingHeight=rowHeights()(0); for (col=0,i=0;iprintOnPage(*item(i),report_->pageCount(),report_->pageCountTotal())==MSTrue) { //Reset pageBreakRow, so that item thinks that it has never been printed yet. item(i)->pageBreakRow(-1); item(i)->print(report_,x,y,w,headingHeight,0,leftIndent()); } } y_start-=headingHeight; } else headingHeight=0; y=y_start; for (i=j=row=row_start,col=0;i=rowCount(col)) { i+=rowCount(col)+row_start-j; col++; row=j=row_start; y=y_start; if (i>=printItemList().count()) continue; } if(headingsOn()==MSTrue&&row==0) continue; if (y-bottomIndent_>=report_->pageEnd()) { int x=x_+columnPixel(col)+left; int w=columnPixelWidth(col); if(rowPageCounts()(row)==0) rowHeight=rowHeights()(row); else if(rowPageCounts()(row)==item(i)->currentPage()) rowHeight=rowHeights()(row); else rowHeight=y-report_->bodyBottom(report_->pageCount())-bottomIndent_; if (report_->printOnPage(*item(i),report_->pageCount(),report_->pageCountTotal())==MSTrue&& (pageBreakRow()<0||item(i)->pageBreakRow()>=0)||row>pageBreakRow()) { item(i)->print(report_,x,y,w,rowHeight,bottomIndent_,leftIndent()); } //WARNING: The next was changed from "<=" to < which should solve //some 1-pixel edge conditions. if (y-rowHeight-bottomIndent_pageEnd()) { currentPageBreakRow=row; row=rowCount(col); } y-=rowHeight; } } pageBreakRow(currentPageBreakRow); } _currentPage++; //This is not entirely correct. However the return value is currently used only in //MSReport and it is ignored unless this is the last page of the printed item, in which //case that it is exactly the "residual()". Ideally the actuall printed height should be returned. return residual(); } aplus-fsf-4.22/src/MSGUI/MSPrintDisclaimer.C0000644000265000001440000002213310772770410014134 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #if HAVE_IOSTREAM #include #else #include #endif #if HAVE_IOMANIP #include #else #include #endif #include #include #include #include #include #include static const char *DefaultDisclaimer ="/tmp/mstk.disclaimer"; static const char *AltDefaultDisclaimer ="/usr/local/lib/disclaimer"; static const char *DefaultDisclaimerFont="Times-Roman-6"; extern const int MSPointsPerInch; extern const int MSPageSizeXTable[]; extern const int MSPageSizeYTable[]; MSPrintDisclaimer::MSPrintDisclaimer(MSPostScript *owner_) { _owner =owner_; _style =NoDisclaimer; _fontID =0; _fontSize =6; _orientation =Default; _lineWidth =0; _leftPixel =20; _rightPixel =20; _topPixel =20; _bottomPixel =20; _rowCount =0; _height =0; _width =0; } MSPrintDisclaimer::~MSPrintDisclaimer(void) { pin.close(); } MSPostScript *MSPrintDisclaimer::owner(void) const {return _owner;} ofstream& MSPrintDisclaimer::pout(void) {return owner()->pout;} void MSPrintDisclaimer::leftMargin(double x_) {_leftPixel=(x_<=0.07)?5:(int)(MSPointsPerInch*x_);} void MSPrintDisclaimer::rightMargin(double x_) {_rightPixel=(x_<=0.07)?5:(int)(MSPointsPerInch*x_);} void MSPrintDisclaimer::topMargin(double x_) {_topPixel=(x_<=0.07)?5:(int)(MSPointsPerInch*x_);} void MSPrintDisclaimer::bottomMargin(double x_) {_bottomPixel=(x_<=0.07)?5:(int)(MSPointsPerInch*x_);} double MSPrintDisclaimer::leftMargin(void)const {return (_leftPixel==5)?0.0:(double)_leftPixel/MSPointsPerInch;} double MSPrintDisclaimer::rightMargin(void)const {return (_rightPixel==5)?0.0:(double)_rightPixel/MSPointsPerInch;} double MSPrintDisclaimer::topMargin(void)const {return (_topPixel==5)?0.0:(double)_topPixel/MSPointsPerInch;} double MSPrintDisclaimer::bottomMargin(void)const {return (_bottomPixel ==5)?0.0:(double)_bottomPixel/MSPointsPerInch;} void MSPrintDisclaimer::font(const MSString& string_) { if (string_.length()>0) { _fontName=string_; if (owner()!=0) { fontID(owner()->font(string_)); _fontSize=owner()->fontSize(); } } } void MSPrintDisclaimer::closeFile(void) { pin.close(); #ifndef MS_WINDOWS if (system(MSString("rm -f ")+DefaultDisclaimer)!=0) { MSMessageLog::warningMessage("Warning: unable to delete temporary file %s\n",DefaultDisclaimer); } #endif } void MSPrintDisclaimer::computeSize(void) { ofstream dout; dout.open(DefaultDisclaimer); if (dout.fail()!=ios::failbit) { dout<pageOrientation():orientation(); if (style()!=NoDisclaimer) { int ct=0; double w=0; streampos mark0,mark1,mark2; _rowCount=0; if (orient==Portrait) width(MSPageSizeXTable[owner()->pageSize()-Letter]-leftPixel()-rightPixel()); else width(MSPageSizeYTable[owner()->pageSize()-Letter]-leftPixel()-rightPixel()); MSPrintFontData *fdata=owner()->fontStruct(fontID()); if (fdata!=0) { MSString file(fileName().length()!=0?fileName().string():DefaultDisclaimer); pin.open(file); if (pin.fail()==ios::failbit) { pin.clear(); if (fileName().length()!=0) { pin.open(DefaultDisclaimer); if (pin.fail()==ios::failbit) { pin.clear(); pin.open(AltDefaultDisclaimer); if (pin.fail()==ios::failbit) { MSMessageLog::errorMessage("Error: opening file %s\n" "Error: opening one of the standard disclaimers:\n" "\t%s\t%s\n*** disclaimer not printed ***\n", fileName().string(),DefaultDisclaimer,AltDefaultDisclaimer); return; } else { MSMessageLog::errorMessage("Error: opening file %s, using standard disclaimer\n",fileName().string()); } } else { MSMessageLog::errorMessage("Error: opening file %s, using standard disclaimer\n",fileName().string()); } } else { pin.open(AltDefaultDisclaimer); if (pin.fail()==ios::failbit) { MSMessageLog::errorMessage("Error: opening one of the standard disclaimers:\n" "\t%s\t%s\n*** disclaimer not printed ***\n", DefaultDisclaimer,AltDefaultDisclaimer); return; } file=AltDefaultDisclaimer; } } fileName(file); mark0=pin.tellg(); double spaceChar=fdata->textWidth(fontSize()," ",1); double pageWidth=width(); if (style()==Box||style()==AppendBox) { int maxBounds=(int)(fdata->textWidth(fontSize(),"M",1)); pageWidth-=2*(maxBounds+lineWidth()); } while(pin.eof()!=ios::eofbit&&ct>setw(buflen)>>buf; mark2=pin.tellg(); long len=strlen(buf); double temp=fdata->textWidth(fontSize(),buf,len); if ((mark2-mark1-len)>1) { if (w==0) _residualSpace[_rowCount-1]+=_spaceWidth[_rowCount-1]; else w+=(int)(spaceChar*(mark2-mark1-len-1L)); } if ((w+temp+spaceChar*ct)>pageWidth) { int space=(int)(pageWidth-w-temp)/ct; if (space<=1) { temp=0; pin.seekg(mark1); } else ct++; _spaceWidth[rowCount()]=(int)(pageWidth-w-temp)/(ct-1); _residualSpace[rowCount()]=(int)(pageWidth-w-temp-spaceWidth(rowCount())*(ct-1)); _wordCount[_rowCount++]=ct; w=ct=0; } else { w+=temp; ct++; } } _spaceWidth[rowCount()]=(int)(pageWidth-w)/(ct-1); _residualSpace[rowCount()]=(int)(pageWidth-w-spaceWidth(rowCount())*ct); if (_spaceWidth[rowCount()]>spaceChar) { _spaceWidth[rowCount()]=(int)spaceChar; _residualSpace[rowCount()]=0; } _wordCount[_rowCount++]=ct-1; pin.clear(); pin.seekg(mark0); ct=rowCount()>2?rowCount()-2:rowCount(); if (style()==Box||style()==Rule) if (rowCount()>2) ct+=2; else if (style()==Toprule) ct++; } else { MSMessageLog::errorMessage("***disclaimer not printed***\n"); } height(ct*fontSize()); if (orient==Portrait) { xTrans(leftPixel()); yTrans(bottomPixel()+height()); } else { xTrans(MSPageSizeXTable[owner()->pageSize()-Letter]-bottomPixel()-height()); yTrans(leftPixel()); } } else height(0); } void MSPrintDisclaimer::print(void) { if (height()>0) { static char buf[buflen],buf1[buflen]; streampos mark1,mark2; double w=0.; MSPrintFontData *fdata=owner()->fontStruct(fontID()); int maxBounds=(int)(fdata->textWidth(fontSize(),"M",1)); PageOrientation orient=orientation()==Default?owner()->pageOrientation():orientation(); pout()<<"gr gr gs"; pout()<< " "; pout()<< xTrans(); pout()<< " "; pout()<< yTrans(); pout()<< " "; pout()<<"translate"; pout()<< " "; if (orient==Landscape) pout()<<"90 rotate"; pout()<< " "; pout()<< fontSize(); pout()<< "/"; pout()<< fdata->fontName(); pout()<< " "; pout()<< "font"; pout()<< endl; int x_start=style()==Box||style()==AppendBox?maxBounds+lineWidth():0; for (int i=0; i>setw(buflen)>>buf1; } else if (j!=0) { pout()<0?1:0); rSpace--; pout()<<" s "; } mark1=pin.tellg(); pin>>setw(buflen)>>buf; mark2=pin.tellg(); long len=strlen(buf); if ((mark2-mark1-len)>1) if (j!=wordCount(i)-1) strcat(buf1," "); pout()<<"("<Text) { int ruleOffset=(int)(fontSize()*1.5); pout()<< (style()==AppendBox?0:lineWidth()); pout()<< " "; pout()<< "w"; pout()<< " "; pout()<< "2"; pout()<< " "; pout()<< "lc"; pout()<< " "; owner()->printLine(0,ruleOffset,width(),ruleOffset); if (style()==Rule) { owner()->printLine(0,-height(),width(),-height()); } if (style()==Box) { owner()->printLine(0,-height(),width(),-height()); owner()->printLine(0,ruleOffset,0,-height()); owner()->printLine(width(),-height(),width(),ruleOffset); } } } aplus-fsf-4.22/src/MSGUI/MSPrintFont.C0000644000265000001440000003605610772770410012777 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #if HAVE_FSTREAM #include #else #include #endif #include #include #include #ifdef MS_WINDOWS extern "C" int MSXGetFontDir(char*,int); const char *MSPrintFont::_defaultFontPath=0; const char *MSPrintFont::_altDefaultFontPath="/usr/local/lib/transcript"; #else const char *MSPrintFont::_defaultFontPath="/usr/local/lib/transcript"; const char *MSPrintFont::_altDefaultFontPath="/usr/local/lib/transcript_4.0"; #endif MSHashTable *MSPrintFont::_fontHashTable=0; MSStringHashTable *MSPrintFont::_afmfilesHashTable=0; MSHashTable *MSPrintFont::fontHashTable(void) {return _fontHashTable;} MSStringHashTable *MSPrintFont::afmfilesHashTable(void) {return _afmfilesHashTable;} static const int HashTableSize=128; static MSBoolean _initialized=MSFalse; static int _count=0; MSPrintFont::MSPrintFont(void) { if (_initialized==MSFalse) { _initialized=MSTrue; _fontHashTable=new MSHashTable(HashTableSize); initFontHashTable(); } _count++; } MSPrintFont::~MSPrintFont(void) { _count--; if (_count<=0) { delete _fontHashTable; delete _afmfilesHashTable; _fontHashTable=0; _afmfilesHashTable=0; _initialized=MSFalse; } } const char *MSPrintFont::defaultFontPath(void) { return _defaultFontPath; } const char *MSPrintFont::altDefaultFontPath(void) { return _altDefaultFontPath; } void MSPrintFont::initFontHashTable(void) { fontHashTable()->notFound((unsigned long)0); fontHashTable()->add("avantgarde-book",(void*)"AvantGarde-Book"); fontHashTable()->add("avantgarde-bookoblique",(void*)"AvantGarde-BookOblique"); fontHashTable()->add("avantgarde-demi",(void*)"AvantGarde-Demi"); fontHashTable()->add("avantgarde-demioblique",(void*)"AvantGarde-DemiOblique"); fontHashTable()->add("bookman-demi",(void*)"Bookman-Demi"); fontHashTable()->add("bookman-demiitalic",(void*)"Bookman-DemiItalic"); fontHashTable()->add("bookman-light",(void*)"Bookman-Light"); fontHashTable()->add("bookman-lightitalic",(void*)"Bookman-LightItalic"); fontHashTable()->add("courier",(void*)"Courier"); fontHashTable()->add("courier-normal",(void*)"Courier"); fontHashTable()->add("courier-bold",(void*)"Courier-Bold"); fontHashTable()->add("courier-boldoblique",(void*)"Courier-BoldOblique"); fontHashTable()->add("courier-oblique",(void*)"Courier-Oblique"); fontHashTable()->add("dithacks",(void*)"DIThacks"); fontHashTable()->add("garamond-light",(void*)"Garamond-Light"); fontHashTable()->add("garamond-lightitalic",(void*)"Garamond-LightItalic"); fontHashTable()->add("garamond-bold",(void*)"Garamond-Bold"); fontHashTable()->add("garamond-bolditalic",(void*)"Garamond-BoldItalic"); fontHashTable()->add("helvetica",(void*)"Helvetica"); fontHashTable()->add("helvetica-bold",(void*)"Helvetica-Bold"); fontHashTable()->add("helvetica-boldoblique",(void*)"Helvetica-BoldOblique"); fontHashTable()->add("helvetica-narrow",(void*)"Helvetica-Narrow"); fontHashTable()->add("helvetica-narrow-bold",(void*)"Helvetica-Narrow-Bold"); fontHashTable()->add("helvetica-narrow-boldoblique",(void*)"Helvetica-Narrow-BoldOblique"); fontHashTable()->add("helvetica-narrow-oblique",(void*)"Helvetica-Narrow-Oblique"); fontHashTable()->add("helvetica-oblique",(void*)"Helvetica-Oblique"); fontHashTable()->add("lubalingraph-book",(void*)"LubalinGraph-Book"); fontHashTable()->add("lubalingraph-bookoblique",(void*)"LubalinGraph-BookOblique"); fontHashTable()->add("lubalingraph-demi",(void*)"LubalinGraph-Demi"); fontHashTable()->add("lubalingraph-demioblique.",(void*)"LubalinGraph-DemiOblique."); fontHashTable()->add("newcenturyschlbk-bold",(void*)"NewCenturySchlbk-Bold"); fontHashTable()->add("newcenturyschlbk-bolditalic",(void*)"NewCenturySchlbk-BoldItalic"); fontHashTable()->add("newcenturyschlbk-italic",(void*)"NewCenturySchlbk-Italic"); fontHashTable()->add("newcenturyschlbk-roman",(void*)"NewCenturySchlbk-Roman"); fontHashTable()->add("optima-bold",(void*)"Optima-Bold"); fontHashTable()->add("optima-boldoblique",(void*)"Optima-BoldOblique"); fontHashTable()->add("optima-oblique",(void*)"Optima-Oblique"); fontHashTable()->add("optima",(void*)"Optima"); fontHashTable()->add("palatino-bold",(void*)"Palatino-Bold"); fontHashTable()->add("palatino-bolditalic",(void*)"Palatino-BoldItalic"); fontHashTable()->add("palatino-italic",(void*)"Palatino-Italic"); fontHashTable()->add("palatino-roman",(void*)"Palatino-Roman"); fontHashTable()->add("souvenir-demi",(void*)"Souvenir-Demi"); fontHashTable()->add("souvenir-demiitalic",(void*)"Souvenir-DemiItalic"); fontHashTable()->add("souvenir-light",(void*)"Souvenir-Light"); fontHashTable()->add("souvenir-lightitalic",(void*)"Souvenir-LightItalic"); fontHashTable()->add("symbol",(void*)"Symbol"); fontHashTable()->add("times-bold",(void*)"Times-Bold"); fontHashTable()->add("times-bolditalic",(void*)"Times-BoldItalic"); fontHashTable()->add("times-italic",(void*)"Times-Italic"); fontHashTable()->add("times-roman",(void*)"Times-Roman"); fontHashTable()->add("time",(void*)"Times-Roman"); fontHashTable()->add("times-normal",(void*)"Times-Roman"); fontHashTable()->add("zapfchancery-mediumitalic",(void*)"ZapfChancery-MediumItalic"); fontHashTable()->add("zapfdingbats",(void*)"ZapfDingbats"); fontHashTable()->add("lucida-bright",(void*)"LucidaBright"); fontHashTable()->add("lucida-brightdemibold",(void*)"LucidaBright-Demi"); fontHashTable()->add("lucida-brightdemibolditalic",(void*)"LucidaBright-DemiItalic"); fontHashTable()->add("lucida-brightitalic",(void*)"LucidaBright-Italic"); fontHashTable()->add("lucidabright",(void*)"LucidaBright"); fontHashTable()->add("lucidabright-demi",(void*)"LucidaBright-Demi"); fontHashTable()->add("lucidabright-demiitalic",(void*)"LucidaBright-DemiItalic"); fontHashTable()->add("lucidabright-italic",(void*)"LucidaBright-Italic"); fontHashTable()->add("lucidasans-typewriter",(void*)"LucidaSans-Typewriter"); fontHashTable()->add("lucidasans-typewriterbold",(void*)"LucidaSans-TypewriterBold"); fontHashTable()->add("lucidasanstypewriter",(void*)"LucidaSans-Typewriter"); fontHashTable()->add("lucidasanstypewriter-bold",(void*)"LucidaSans-TypewriterBold"); fontHashTable()->add("lucidasans-bold",(void*)"LucidaSans-Bold"); fontHashTable()->add("lucidasans",(void*)"LucidaSans"); fontHashTable()->add("lucidasans-italic",(void*)"LucidaSans-Italic"); fontHashTable()->add("lucidasans-bolditalic",(void*)"LucidaSans-Bold-Italic"); fontHashTable()->add("lucidasans-roman",(void*)"LucidaSans-Roman"); fontHashTable()->add("kaplscreen",(void*)"APL"); fontHashTable()->add("kaplscreen-bold",(void*)"APL"); fontHashTable()->add("kaplgallant",(void*)"APL"); fontHashTable()->add("kaplgallant-bold",(void*)"APL"); fontHashTable()->add("apl",(void*)"APL"); fontHashTable()->add("Avantgarde-Book",(void*)"AvantGarde-Book"); fontHashTable()->add("Avantgarde-BookOblique",(void*)"AvantGarde-BookOblique"); fontHashTable()->add("Avantgarde-Demi",(void*)"AvantGarde-Demi"); fontHashTable()->add("Avantgarde-DemiOblique",(void*)"AvantGarde-DemiOblique"); fontHashTable()->add("Bookman-Demi",(void*)"Bookman-Demi"); fontHashTable()->add("Bookman-DemiItalic",(void*)"Bookman-DemiItalic"); fontHashTable()->add("Bookman-Light",(void*)"Bookman-Light"); fontHashTable()->add("Bookman-LightItalic",(void*)"Bookman-LightItalic"); fontHashTable()->add("Courier",(void*)"Courier"); fontHashTable()->add("courier-Normal",(void*)"Courier"); fontHashTable()->add("courier-Bold",(void*)"Courier-Bold"); fontHashTable()->add("courier-BoldOblique",(void*)"Courier-BoldOblique"); fontHashTable()->add("courier-Oblique",(void*)"Courier-Oblique"); fontHashTable()->add("DIThacks",(void*)"DIThacks"); fontHashTable()->add("Garamond-Light",(void*)"Garamond-Light"); fontHashTable()->add("Garamond-LightItalic",(void*)"Garamond-LightItalic"); fontHashTable()->add("Garamond-Bold",(void*)"Garamond-Bold"); fontHashTable()->add("Garamond-BoldItalic",(void*)"Garamond-BoldItalic"); fontHashTable()->add("Helvetica",(void*)"Helvetica"); fontHashTable()->add("Helvetica-Bold",(void*)"Helvetica-Bold"); fontHashTable()->add("Helvetica-Boldoblique",(void*)"Helvetica-BoldOblique"); fontHashTable()->add("Helvetica-Narrow",(void*)"Helvetica-Narrow"); fontHashTable()->add("Helvetica-Narrow-Bold",(void*)"Helvetica-Narrow-Bold"); fontHashTable()->add("Helvetica-Narrow-BoldOblique",(void*)"Helvetica-Narrow-BoldOblique"); fontHashTable()->add("Helvetica-Narrow-Oblique",(void*)"Helvetica-Narrow-Oblique"); fontHashTable()->add("Helvetica-Oblique",(void*)"Helvetica-Oblique"); fontHashTable()->add("LubalinGraph-Book",(void*)"LubalinGraph-Book"); fontHashTable()->add("LubalinGraph-BookOblique",(void*)"LubalinGraph-BookOblique"); fontHashTable()->add("LubalinGraph-Demi",(void*)"LubalinGraph-Demi"); fontHashTable()->add("LubalinGraph-DemiOblique.",(void*)"LubalinGraph-DemiOblique."); fontHashTable()->add("NewCenturySchlbk-Bold",(void*)"NewCenturySchlbk-Bold"); fontHashTable()->add("NewCenturySchlbk-BoldItalic",(void*)"NewCenturySchlbk-BoldItalic"); fontHashTable()->add("NewCenturySchlbk-Italic",(void*)"NewCenturySchlbk-Italic"); fontHashTable()->add("NewCenturySchlbk-roman",(void*)"NewCenturySchlbk-Roman"); fontHashTable()->add("Optima-Bold",(void*)"Optima-Bold"); fontHashTable()->add("Optima-BoldOblique",(void*)"Optima-BoldOblique"); fontHashTable()->add("Optima-Oblique",(void*)"Optima-Oblique"); fontHashTable()->add("Optima",(void*)"Optima"); fontHashTable()->add("Palatino-Bold",(void*)"Palatino-Bold"); fontHashTable()->add("Palatino-BoldItalic",(void*)"Palatino-BoldItalic"); fontHashTable()->add("Palatino-Italic",(void*)"Palatino-Italic"); fontHashTable()->add("Palatino-roman",(void*)"Palatino-Roman"); fontHashTable()->add("Souvenir-Demi",(void*)"Souvenir-Demi"); fontHashTable()->add("Souvenir-DemiItalic",(void*)"Souvenir-DemiItalic"); fontHashTable()->add("Souvenir-Light",(void*)"Souvenir-Light"); fontHashTable()->add("Souvenir-LightItalic",(void*)"Souvenir-LightItalic"); fontHashTable()->add("Symbol",(void*)"Symbol"); fontHashTable()->add("Times-Bold",(void*)"Times-Bold"); fontHashTable()->add("Times-BoldItalic",(void*)"Times-BoldItalic"); fontHashTable()->add("Times-Italic",(void*)"Times-Italic"); fontHashTable()->add("Times-Roman",(void*)"Times-Roman"); fontHashTable()->add("Times-Normal",(void*)"Times-Roman"); fontHashTable()->add("ZapfChancery-mediumItalic",(void*)"ZapfChancery-MediumItalic"); fontHashTable()->add("ZapfDingbats",(void*)"ZapfDingbats"); fontHashTable()->add("Lucida-Bright",(void*)"LucidaBright"); fontHashTable()->add("Lucida-BrightdemiBold",(void*)"LucidaBright-Demi"); fontHashTable()->add("Lucida-BrightdemiBoldItalic",(void*)"LucidaBright-DemiItalic"); fontHashTable()->add("Lucida-BrightItalic",(void*)"LucidaBright-Italic"); fontHashTable()->add("LucidaBright",(void*)"LucidaBright"); fontHashTable()->add("LucidaBright-Demi",(void*)"LucidaBright-Demi"); fontHashTable()->add("LucidaBright-DemiItalic",(void*)"LucidaBright-DemiItalic"); fontHashTable()->add("LucidaBright-Italic",(void*)"LucidaBright-Italic"); fontHashTable()->add("LucidaSans-TypeWriter",(void*)"LucidaSans-Typewriter"); fontHashTable()->add("LucidaSans-TypeWriterBold",(void*)"LucidaSans-TypewriterBold"); fontHashTable()->add("LucidaSansTypeWriter",(void*)"LucidaSans-Typewriter"); fontHashTable()->add("LucidaSansTypeWriter-Bold",(void*)"LucidaSans-TypewriterBold"); fontHashTable()->add("LucidaSans-Bold",(void*)"LucidaSans-Bold"); fontHashTable()->add("LucidaSans",(void*)"LucidaSans"); fontHashTable()->add("LucidaSans-Italic",(void*)"LucidaSans-Italic"); fontHashTable()->add("LucidaSans-BoldItalic",(void*)"LucidaSans-Bold-Italic"); fontHashTable()->add("LucidaSans-Roman",(void*)"LucidaSans-Roman"); fontHashTable()->add("KaplScreen",(void*)"APL"); fontHashTable()->add("KaplScreen-Bold",(void*)"APL"); fontHashTable()->add("KaplGallant",(void*)"APL"); fontHashTable()->add("KaplGallant-Bold",(void*)"APL"); } MSBoolean MSPrintFont::initAfmfilesHashTable(const char *path_) { if (_afmfilesHashTable==0) { ifstream pin; MSString line; #ifdef MS_WINDOWS if (defaultFontPath()==0) { static char buf[256]; if(MSXGetFontDir(buf,256)) _defaultFontPath=buf; else _defaultFontPath="C:\\MSTK\\Fonts"; //check for empty string, and make sure we go to default //path in that case. if(path_!=0&&path_[0]=='\0') path_=0; } #endif MSString path(path_!=0?path_:defaultFontPath()); if (path.last()!=MS_DIR_SEPARATOR) path<notFound((unsigned long)0); int count=0; line=MSString::lineFrom(pin); while(line!="."&&pin.eof()!=ios::eofbit) { int index=line.indexOf("=")+1; MSString font(line.subString(0,index-1)); MSString file(line.subString(index,line.indexOf(".")-index)); char *cp=new char[file.length()+1]; strcpy(cp,file.string()); cp[file.length()]='\0'; afmfilesHashTable()->add(font.string(),(void*)cp); line=MSString::lineFrom(pin); count++; } if (count==0) { delete _afmfilesHashTable; _afmfilesHashTable=0; MSMessageLog::errorMessage("MSPrintFont: unable to parse file %s\n",path.string()); return MSFalse; } return MSTrue; } return MSTrue; } aplus-fsf-4.22/src/MSGUI/MSPrintFontData.C0000644000265000001440000001327410772770411013567 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #if HAVE_SSTREAM #include #else #include #endif #if HAVE_FSTREAM #include #else #include #endif #if HAVE_IOMANIP #include #else #include #endif MSPrintFontData::MSPrintFontData(void) { _ascent=0; _descent=0; _width=0; _lbearing=0; _rbearing=0; _fontID=0; _fontPath=MSPrintFont::defaultFontPath(); _fileName=MSPrintFont::defaultFontPath(); } MSPrintFontData::MSPrintFontData(const MSString& file_) : _fileName(MSPrintFont::defaultFontPath()) { _ascent=0; _descent=0; _width=0; _lbearing=0; _rbearing=0; _fontID=0; _fontPath=MSPrintFont::defaultFontPath(); _fileName<<"/"; _fileName<>setw(_buflen)>>_pbuf; if (strcmp(_pbuf,"StartFontMetrics")!=0) { showFontError(); return; } while(strcmp(_pbuf,"FontName")!=0&&pin.eof()!=ios::eofbit) pin>>_pbuf; if (pin.eof()==ios::eofbit) { showFontError(); return; } pin>>_pbuf; fontName(_pbuf); // while(pin.eof()!=ios::eofbit&&strcmp(_pbuf,"EncodingScheme")!=0) pin>>_pbuf; // if (pin.eof()==ios::eofbit) { showFontError(); return; } // if (strcmp(_pbuf,"AdobeStandardEncoding")!=0) // if (strcmp(_pbuf,"ISOLatin1Encoding")!=0) pin.seekg(mark); while(strcmp(_pbuf,"IsFixedPitch")!=0&&pin.eof()!=ios::eofbit) pin>>_pbuf; if (pin.eof()==ios::eofbit) { showFontError(); return; } isFixedPitch(strcmp(_pbuf,"true")==0?MSTrue:MSFalse); pin.seekg(mark); while(strcmp(_pbuf,"UnderlinePosition")!=0&&pin.eof()!=ios::eofbit) pin>>_pbuf; if (pin.eof()==ios::eofbit) { showFontError(); return; } pin>>_underlinePosition; pin.seekg(mark); while(strcmp(_pbuf,"UnderlineThickness")!=0&&pin.eof()!=ios::eofbit) pin>>_pbuf; if (pin.eof()==ios::eofbit) { showFontError(); return; } pin>>_underlineThickness; pin.seekg(mark); while(strcmp(_pbuf,"FontBBox")!=0&&pin.eof()!=ios::eofbit) pin>>_pbuf; if (pin.eof()==ios::eofbit) { showFontError(); return; } else { int x; pin>>x; fontBox().x(x); pin>>x; fontBox().y(x); pin>>x; fontBox().width(x); pin>>x; fontBox().height(x); } pin.seekg(mark); while(strcmp(_pbuf,"CapHeight")!=0&&pin.eof()!=ios::eofbit) pin>>_pbuf; if (pin.eof()==ios::eofbit) { showFontError(); return; } pin>>_capHeight; pin.seekg(mark); while(strcmp(_pbuf,"XHeight")!=0&&pin.eof()!=ios::eofbit) pin>>_pbuf; if (pin.eof()==ios::eofbit) { showFontError(); return; } pin>>_xHeight; pin.seekg(mark); while(strcmp(_pbuf,"Descender")!=0&&pin.eof()!=ios::eofbit) pin>>_pbuf; if (pin.eof()==ios::eofbit) { showFontError(); return; } pin>>_descender; pin.seekg(mark); while(strcmp(_pbuf,"Ascender")!=0&&pin.eof()!=ios::eofbit) pin>>_pbuf; if (pin.eof()==ios::eofbit) { showFontError(); return; } pin>>_ascender; pin.seekg(mark); while(strcmp(_pbuf,"StartCharMetrics")!=0&&pin.eof()!=ios::eofbit) pin>>_pbuf; if (pin.eof()==ios::eofbit) { showFontError(); return; } pin>>_bufsize; _width=new int[bufsize()]; for (int j=0; j>_pbuf; if (*_pbuf!='C') { showFontError(); return; } pin>>_offset>>_pbuf>>_pbuf; if (*_pbuf!='W') { showFontError(); return; } pin>>_width[0]; while(pin.getline(_pbuf,_buflen)&&strcmp(_pbuf,"EndCharMetrics")!=0&&pin.eof()!=ios::eofbit&&i>=0) { #if HAVE_SSTREAM istringstream isl(_pbuf); #else istrstream isl(_pbuf,strlen(_pbuf)); #endif isl>>junk>>i>>junk>>junk; if (i>0) isl>>_width[i-_offset]; } } double MSPrintFontData::fontOffset(int size_) { return size_+(descender()*size_)/1000; } double MSPrintFontData::textWidth(int size_,const char *str_,int n_) { double w=0; for (int i=0; i #include #include #include MSPrintHeaders::MSPrintHeaders(void) {} MSPrintHeaders::~MSPrintHeaders(void) { removeAllHeaders(); removeAllFooters(); } //////////////////////////////////////////////////////////////////////////// // // header/footer lists // //////////////////////////////////////////////////////////////////////////// void MSPrintHeaders::removeAllHeaders(void) { unsigned n=headerList().count(); for (unsigned i=n-1;iisDestroyable()==MSTrue) delete header(i); } headerList().removeAll(); } void MSPrintHeaders::removeAllFooters(void) { unsigned n=footerList().count(); for (unsigned i=n-1;iisDestroyable()==MSTrue) delete footer(i); } footerList().removeAll(); } MSBoolean MSPrintHeaders::removeHeader(const MSSymbol& tag_) { MSBoolean status=MSFalse; MSPrintItem *printItem=0; for (unsigned i=0;iprintTag()) printItem=header(i); if (printItem!=0) { textList().remove((MSParagraph*)printItem); headerList().remove(printItem); if (printItem->isDestroyable()==MSTrue) delete printItem; status=MSTrue; } return status; } MSBoolean MSPrintHeaders::removeHeader(MSPrintItem *item_) { MSBoolean ret=MSFalse; if ((ret=headerList().remove(item_))==MSTrue&&item_->isDestroyable()==MSTrue) delete item_; return ret; } MSBoolean MSPrintHeaders::removeFooter(const MSSymbol& tag_) { MSBoolean status=MSFalse; MSPrintItem *printItem=0; for (unsigned i=0;iprintTag()) printItem=footer(i); if (printItem!=0) { textList().remove((MSParagraph*)printItem); footerList().remove(printItem); if (printItem->isDestroyable()==MSTrue) delete printItem; status=MSTrue; } return status; } MSBoolean MSPrintHeaders::removeFooter(MSPrintItem *item_) { MSBoolean ret=MSFalse; if ((ret=footerList().remove(item_))==MSTrue&&item_->isDestroyable()==MSTrue) delete item_; return ret; } // // add headers // MSPrintColumn& MSPrintHeaders::addHeader(MSPrintColumn* aPrintColumn_) { aPrintColumn_->owner(this); aPrintColumn_->pageAlignment(MSNone); _headerList.add(aPrintColumn_); return *aPrintColumn_; } MSParagraph& MSPrintHeaders::addHeader(const MSParagraph& aParagraph_) { MSParagraph *aParagraph=new MSParagraph(aParagraph_); aParagraph->pageAlignment(MSNone); _textList.add(aParagraph); _headerList.add(aParagraph); return *aParagraph; } MSParagraph& MSPrintHeaders::addHeader(const MSStringVector& aStringVector_) {return addHeader(MSParagraph(aStringVector_));} MSParagraph& MSPrintHeaders::addHeader(const MSString& aString_) {return addHeader(MSStringVector(aString_));} MSParagraph& MSPrintHeaders::addHeader(const char *string_) {return addHeader(MSStringVector(string_));} // // add footers // MSPrintColumn& MSPrintHeaders::addFooter(MSPrintColumn* aPrintColumn_) { aPrintColumn_->owner(this); aPrintColumn_->pageAlignment(MSNone); _footerList.add(aPrintColumn_); return *aPrintColumn_; } MSParagraph& MSPrintHeaders::addFooter(const MSParagraph& aParagraph_) { MSParagraph *aParagraph=new MSParagraph(aParagraph_); aParagraph->pageAlignment(MSNone); _textList.add(aParagraph); _footerList.add(aParagraph); return *aParagraph; } MSParagraph& MSPrintHeaders::addFooter(const MSStringVector& aStringVector_) {return addFooter(MSParagraph(aStringVector_));} MSParagraph& MSPrintHeaders::addFooter(const MSString& aString_) {return addFooter(MSStringVector(aString_));} MSParagraph& MSPrintHeaders::addFooter(const char *string_) {return addFooter(MSStringVector(string_));} const MSParagraph& MSPrintHeaders::header(const MSSymbol& tag_) const { MSBoolean found=MSFalse; for (unsigned i=0;iprintTag()) found=MSTrue; if (found==MSTrue) return headerParagraph(tag_); MSMessageLog::warningMessage("Warning: header \"%s\" not found\n",tag_.symbolName()); return defaultParagraph(); } const MSParagraph& MSPrintHeaders::footer(const MSSymbol& tag_) const { MSBoolean found=MSFalse; for (unsigned i=0;iprintTag()) found=MSTrue; if (found==MSTrue) return headerParagraph(tag_); MSMessageLog::warningMessage("Warning: footer \"%s\" not found\n",tag_.symbolName()); return defaultParagraph(); } MSParagraph& MSPrintHeaders::header(const MSSymbol& tag_) { MSBoolean found=MSFalse; for (unsigned i=0;iprintTag()) found=MSTrue; if (found==MSTrue) return headerParagraph(tag_); MSMessageLog::warningMessage("Warning: header \"%s\" not found\n",tag_.symbolName()); return defaultParagraph(); } MSParagraph& MSPrintHeaders::footer(const MSSymbol& tag_) { MSBoolean found=MSFalse; for (unsigned i=0;iprintTag()) found=MSTrue; MSMessageLog::warningMessage("Warning: footer \"%s\" not found\n",tag_.symbolName()); if (found==MSTrue) return headerParagraph(tag_); return defaultParagraph(); } const MSParagraph& MSPrintHeaders::headerParagraph(const MSSymbol& tag_) const { for (unsigned i=0;itag()) return *text(i); MSMessageLog::warningMessage("Warning: paragraph \"%s\" not found\n",tag_.symbolName()); return defaultParagraph(); } MSParagraph& MSPrintHeaders::headerParagraph(const MSSymbol& tag_) { for (unsigned i=0;itag()) return *text(i); MSMessageLog::warningMessage("Warning: paragraph \"%s\" not found\n",tag_.symbolName()); return defaultParagraph(); } aplus-fsf-4.22/src/MSGUI/MSPrintItem.C0000644000265000001440000001140310772770411012755 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include extern const int MSPointsPerInch; MSPrintItem::MSPrintItem(void) { _printManager=0; _printRow=-1; _printColumn=-1; _leftPixel=-1; _rightPixel=-1; _topPixel=0; _bottomPixel=0; _destroyable=MSTrue; _occurrence=EveryPage; _justification=MSLeft; _pageAlignment=MSNone; reset(); } MSPrintItem::MSPrintItem(const MSPrintItem& printItem_) : _printRow(printItem_._printRow), _printColumn(printItem_._printColumn), _printFont(printItem_._printFont), _leftPixel(printItem_._leftPixel), _rightPixel(printItem_._rightPixel), _topPixel(printItem_._topPixel), _bottomPixel(printItem_._bottomPixel), _occurrence(printItem_._occurrence), _justification(printItem_._justification), _pageAlignment(printItem_._pageAlignment), _destroyable(printItem_._destroyable) {reset();} MSPrintItem& MSPrintItem::operator=(const MSPrintItem& printItem_) { _printRow=printItem_._printRow; _printColumn=printItem_._printColumn; _printFont=printItem_._printFont; _leftPixel=printItem_._leftPixel; _rightPixel=printItem_._rightPixel; _topPixel=printItem_._topPixel; _bottomPixel=printItem_._bottomPixel; _occurrence=printItem_._occurrence; _justification=printItem_._justification; _pageAlignment=printItem_._pageAlignment; _destroyable=printItem_._destroyable; reset(); return *this; } MSPrintItem::~MSPrintItem(void) {} void MSPrintItem::reset(void) { _changed=MSTrue; _pageBreakRow=-1; _printHeight=0; _pageCount=0; _residual=0; _currentPage=0; } double MSPrintItem::leftMargin(void) const {return _leftPixel<0?-1.0:_leftPixel==5?0.0:(double)_leftPixel/MSPointsPerInch;} double MSPrintItem::rightMargin(void) const {return _rightPixel<0?-1.0:_rightPixel==5?0.0:(double)_rightPixel/MSPointsPerInch;} double MSPrintItem::topOffset(void) const {return _topPixel/(double)MSPointsPerInch;} double MSPrintItem::bottomOffset(void) const {return _bottomPixel/(double)MSPointsPerInch;} void MSPrintItem::leftMargin(double x_) {_leftPixel=x_<=0.07?5:(int)(MSPointsPerInch*x_);} void MSPrintItem::rightMargin(double x_) {_rightPixel=x_<=0.07?5:(int)(MSPointsPerInch*x_);} void MSPrintItem::topOffset(double x_) {_topPixel=int(x_*MSPointsPerInch);} void MSPrintItem::bottomOffset(double x_) {_bottomPixel=int(x_*MSPointsPerInch);} int MSPrintItem::computePrintSize(MSReport*,int,int,int,int,int,int) {return 0;} int MSPrintItem::print(MSReport*,int,int,int,int,int,int) {return 0;} const MSSymbol& MSPrintItem::printTag(void) const {return MSSymbol::nullSymbol();} // // MSPageBreakPrintItem // MSPageBreakPrintItem::MSPageBreakPrintItem() {} MSPageBreakPrintItem::~MSPageBreakPrintItem(void) {} int MSPageBreakPrintItem::computePrintSize(MSReport *,int,int /*y_*/,int,int,int,int) { _residual=0; _pageCount++; return 0; // return y_-report_->pageEnd(); } int MSPageBreakPrintItem::print(MSReport *report_,int,int y_,int,int,int,int) { _currentPage++; return y_-report_->pageEnd(); } // // MSRulePrintItem // MSRulePrintItem::MSRulePrintItem(unsigned ruleWidth_) { _ruleWidth=ruleWidth_; _fgGrayScale=0; } MSRulePrintItem::~MSRulePrintItem(void) {} int MSRulePrintItem::computePrintSize(MSReport *report_,int,int y_,int,int,int,int) { reset(); if (leftPixel()<0) leftPixel(report_->leftPixel()); if (rightPixel()<0) rightPixel(report_->rightPixel()); int remainingHeight=y_-report_->pageEnd(); int h=ruleWidth()+topPixel(); int y=y_; if (h>=remainingHeight) { _pageCount++; y=report_->bodyTop(report_->pageCount()+1); } if (y-h-bottomPixel()pageEnd()) h+=bottomPixel(); _residual=h; return h; } int MSRulePrintItem::print(MSReport *report_,int x_,int y_,int w_,int,int,int leftMargin_) { int remainingHeight=y_-report_->pageEnd(); int h=ruleWidth()+topPixel(); if (h>=remainingHeight) { pageBreakRow(0); _currentPage++; return remainingHeight; } w_-=(leftMargin_==0?leftPixel()+rightPixel():0); int x=x_+(leftMargin_==0?leftPixel():leftMargin_); int y=(int)(y_-ruleWidth()/2.0); printRulePrintItem(report_,x,y,w_); if (y_-h-bottomPixel()pageEnd()) h+=bottomPixel(); _currentPage++; return h; } void MSRulePrintItem::printRulePrintItem(MSReport *report_,int x_,int y_,int w_) { report_->gcValues().line_width=ruleWidth(); // report_->gcValues().foreground=report_->lineColor(); // check grl // report_->gcValues().line_style=report_->lineStyle(); // check grl report_->fgGrayScale(fgGrayScale()); report_->setAttributes(); report_->setFgGrayScale(); report_->printLine(x_,y_,x_+w_,y_); } aplus-fsf-4.22/src/MSGUI/MSPrintManager.C0000644000265000001440000001620210772770411013433 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include MSParagraph MSPrintManager::_defaultParagraph; MSPrintManager::MSPrintManager(void) { _parent=0; } MSPrintManager::MSPrintManager(MSPrintManager *parent_) { _parent=parent_; _parent->childList().add(this); } MSPrintManager::~MSPrintManager(void) { removeAll(); } MSPrintManager *MSPrintManager::topLevel(void) { MSPrintManager *pPrintBase=(MSPrintManager *)this; while (pPrintBase->parent()!=0) pPrintBase=pPrintBase->parent(); return pPrintBase; } const MSPrintManager *MSPrintManager::topLevel(void) const { MSPrintManager *pPrintBase=(MSPrintManager *)this; while (pPrintBase->parent()!=0) pPrintBase=pPrintBase->parent(); return pPrintBase; } void MSPrintManager::removeAllParagraphs(void) { unsigned i,n=paragraphList().count(); for (i=n-1;iisDestroyable()==MSTrue) delete item(i); else item(i)->printManager(0); } printItemList().removeAll(); } MSBoolean MSPrintManager::removePrintItem(const MSSymbol& tag_) { MSBoolean status=MSFalse; unsigned i,n=printItemList().count(); for (i=0;iprintTag()) { if (printItem->isDestroyable()==MSTrue) delete printItem; status=printItemList().remove(printItem); paragraphList().remove(printItem); } } if (status==MSFalse) { n=childList().count(); for (i=0;iremovePrintItem(tag_); } } return status; } MSBoolean MSPrintManager::removePrintItem(MSPrintItem *item_) { MSBoolean status=MSFalse; paragraphList().remove(item_); if ((status=printItemList().remove(item_))!=MSTrue) { for (unsigned i=0,n=childList().count();iremovePrintItem(item_); } } if (status==MSTrue&&item_->isDestroyable()==MSTrue) delete item_; return status; } MSPrintItem& MSPrintManager::addPageBreak(void) { MSPrintItem *item=new MSPageBreakPrintItem(); addPrintItem(item); return *item; } MSRulePrintItem& MSPrintManager::addRule(int width_) { MSRulePrintItem *item=new MSRulePrintItem(width_); addPrintItem(item); return *item; } MSParagraph& MSPrintManager::addParagraph(const MSParagraph& paragraph_) { MSParagraph *paragraph=new MSParagraph(paragraph_); addPrintItem(paragraph); _paragraphList.add(paragraph); return *paragraph; } MSParagraph& MSPrintManager::addParagraph(const MSStringVector& paragraph_) {return addParagraph(MSParagraph(paragraph_));} MSPrintColumn& MSPrintManager::addPrintItem(MSPrintColumn* aPrintColumn_) { aPrintColumn_->parent(this); _printItemList.add(aPrintColumn_); return *aPrintColumn_; } MSReportTable& MSPrintManager::addPrintItem(MSReportTable *table_) { table_->printManager(this); _printItemList.add(table_); return *table_; } MSGraph& MSPrintManager::addPrintItem(MSGraph *graph_) { graph_->printManager(this); _printItemList.add(graph_); return *graph_; } MSPrintItem& MSPrintManager::addPrintItem(MSPrintItem *printItem_) { _printItemList.add(printItem_); return *printItem_; } const MSParagraph& MSPrintManager::paragraph(unsigned i_) const { if (i_paragraph(tag_); if (&par!=&defaultParagraph()) return par; } if (parent()==0) MSMessageLog::warningMessage("Warning: paragraph \"%s\" not found\n",tag_.symbolName()); return defaultParagraph(); } MSParagraph& MSPrintManager::paragraph(const MSSymbol& tag_) { unsigned i,n=paragraphList().count(); for (i=0;iparagraph(tag_); if (&par!=&defaultParagraph()) return par; } if (parent()==0) MSMessageLog::warningMessage("Warning: paragraph \"%s\" not found\n",tag_.symbolName()); return defaultParagraph(); } const MSPrintItem& MSPrintManager::printItem(const MSSymbol& tag_) const { unsigned i,n=printItemList().count(); for (i=0;iprintTag()) return *item(i); n=childList().count(); for (i=0;iprintItem(tag_); if (&aPrintItem!=(MSPrintItem*)(&defaultParagraph())) return aPrintItem; } if (parent()==0) MSMessageLog::warningMessage("Warning: paragraph \"%s\" not found\n",tag_.symbolName()); return *((MSPrintItem*)&defaultParagraph()); } MSPrintItem &MSPrintManager::printItem(const MSSymbol& tag_) { unsigned i,n=printItemList().count(); for (i=0;iprintTag()) return *item(i); n=childList().count(); for (i=0;iprintItem(tag_); if (&aPrintItem!=(MSPrintItem*)(&defaultParagraph())) return aPrintItem; } if (parent()==0) MSMessageLog::warningMessage("Warning: paragraph \"%s\" not found\n",tag_.symbolName()); return *((MSPrintItem*)&defaultParagraph()); } MSParagraph& operator<<(MSPrintManager& printManager_,const MSParagraph& paragraph_) {return printManager_.addParagraph(paragraph_);} MSParagraph& operator<<(MSPrintManager& printManager_,const MSStringVector& aStringVector_) {return printManager_.addParagraph(aStringVector_);} MSPrintColumn& operator<<(MSPrintManager& printManager_,MSPrintColumn* column_) {return printManager_.addPrintItem(column_);} MSReportTable& operator<<(MSPrintManager& printManager_,MSReportTable *table_) {return printManager_.addPrintItem(table_);} MSGraph& operator<<(MSPrintManager& printManager_,MSGraph *graph_) {return printManager_.addPrintItem(graph_);} MSPrintItem& operator<<(MSPrintManager& printManager_,MSPrintItem *item_) {return printManager_.addPrintItem(item_);} aplus-fsf-4.22/src/MSGUI/MSPulldownMenu.C0000644000265000001440000000333710772770411013502 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include MSPulldownMenu::MSPulldownMenu(MSMenuBarItem *item_) : MSMenu(item_) { item()->pulldownMenu(this); background(item()->background()); foreground(item()->foreground()); font(item()->font()); } MSPulldownMenu::~MSPulldownMenu(void) { item()->menuDestroy(this); } void MSPulldownMenu::left(void) { MSMenuItem *ni,*mi=menuItem(selectedItem()); if ((ni=nextLeftItem())!=0&&(mi==0||(ni!=mi&&ni->item()item()))) { undrawSelectedItem(); selectedItem(ni->item()); drawSelectedItem(); } else if (item()!=0) { item()->menu()->grabAndSelect(); item()->menu()->left(); } } void MSPulldownMenu::right(void) { MSMenuItem *ni, *mi=menuItem(selectedItem()); if (mi!=0&&mi->cascade()==MSTrue) { mi->arm(); mi->grab(); } else if ((ni=nextRightItem())!=0&&(mi==0||(ni!=mi&&ni->item()>mi->item()))) { undrawSelectedItem(); selectedItem(ni->item()); drawSelectedItem(); if (ni->cascade()==MSTrue) { ni->arm(); ni->grab(); } } else if (item()!=0) { item()->menu()->grabAndSelect(); item()->menu()->right(); } } void MSPulldownMenu::done(void) { ungrab(); unmap(); if (item()!=0) item()->menu()->done(); reset(); } void MSPulldownMenu::activate(void) { if (activateCallback(MSWidgetCallback::activate)==MSFalse) { if (item()!=0) item()->activate(); } done(); } aplus-fsf-4.22/src/MSGUI/MSRadioBox.C0000644000265000001440000000352310772770411012555 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include MSRadioBox::MSRadioBox(MSWidget *owner_,const char *title_) : MSActionBox(owner_,title_) { _activeButton=0; } MSRadioBox::MSRadioBox(MSWidget *owner_,const MSStringVector& title_) : MSActionBox(owner_,title_) { _activeButton=0; } MSRadioBox::~MSRadioBox(void) {} const MSSymbol& MSRadioBox::symbol(void) { static MSSymbol sym ("MSRadioBox"); return sym; } const MSSymbol& MSRadioBox::widgetType(void) const { return symbol(); } void MSRadioBox::arm(MSRadioButton *radioButton_) { disarm(); _activeButton=radioButton_; if (activeButton()!=0) activeButton()->state(MSTrue); } void MSRadioBox::disarm(void) { if (activeButton()!=0) activeButton()->state(MSFalse); _activeButton=0; } void MSRadioBox::firstMapNotify(void) { MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; MSLayoutEntry *entry; MSRadioButton *radioButton; unsigned count=0; while ((np=np->next())!=hp) { entry=(MSLayoutEntry *)np->data(); radioButton=(MSRadioButton *)entry->widget(); if (radioButton->state()==MSTrue) { if (count==0) _activeButton=radioButton; count++; } if (count>1) radioButton->state(MSFalse); } if (count==0&&(np=np->next())!=hp) { entry=(MSLayoutEntry *)np->data(); radioButton=(MSRadioButton *)entry->widget(); radioButton->state(MSTrue); _activeButton=radioButton; } MSActionBox::firstMapNotify(); } void MSRadioBox::activeButton(MSRadioButton *radioButton_, MSBoolean callback_) { radioButton_->arm(callback_); } aplus-fsf-4.22/src/MSGUI/MSRadioButton.C0000644000265000001440000000706010772770411013300 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include MSRadioButton::MSRadioButton(MSRadioBox *owner_,const char *label_,const MSSymbol& tag_) : MSToggleButtonBase(owner_,label_,tag_) {} MSRadioButton::MSRadioButton(MSRadioBox *owner_,const MSStringVector& label_, const MSSymbol& tag_) : MSToggleButtonBase(owner_,label_,tag_) {} MSRadioButton::MSRadioButton(MSRadioBox *owner_,const MSPixmap &pixmap_, const MSPixmap &insensitivePixmap_, const MSPixmap &armedPixmap_,const MSSymbol& tag_) : MSToggleButtonBase(owner_,pixmap_,insensitivePixmap_,armedPixmap_,tag_) {} MSRadioButton::MSRadioButton(MSRadioBox *owner_,const char *label_,int integerTag_) : MSToggleButtonBase(owner_,label_,integerTag_) {} MSRadioButton::MSRadioButton(MSRadioBox *owner_,const MSStringVector& label_,int integerTag_) : MSToggleButtonBase(owner_,label_,integerTag_) {} MSRadioButton::MSRadioButton(MSRadioBox *owner_,const MSPixmap &pixmap_, const MSPixmap &insensitivePixmap_, const MSPixmap &armedPixmap_,int integerTag_) : MSToggleButtonBase(owner_,pixmap_,insensitivePixmap_,armedPixmap_,integerTag_) {} MSRadioButton::~MSRadioButton(void) {} // widgetType will go away when dynamic_cast (RTTI) operator becomes available // this method is suppose to emulate the dynamic_cast operator MSRadioBox *MSRadioButton::radioBox(void) const { if (parentWidgetType()==MSRadioBox::symbol()) return (MSRadioBox *)owner(); else return 0; } void MSRadioButton::radioBoxArm(void) { MSRadioBox *rbox=radioBox(); if (rbox!=0) rbox->arm(this); } void MSRadioButton::radioBoxDisarm(void) { MSRadioBox *rbox=radioBox(); if (rbox!=0) rbox->disarm(); } void MSRadioButton::radioBoxActivate(void) { MSRadioBox *rbox=radioBox(); if (rbox!=0) rbox->activate(); } void MSRadioButton::disarm(void) {} void MSRadioButton::arm(MSBoolean callback_) { if (armed()==MSFalse) { radioBoxDisarm(); setArmState(); radioBoxArm(); if (callback_==MSTrue) { if (activateCallback(MSWidgetCallback::arm)==MSFalse) radioBoxActivate(); } } } void MSRadioButton::arm(void) { arm(MSTrue); } void MSRadioButton::drawSymbol(void) { drawDiamond(); } void MSRadioButton::drawDiamond(void) { if (mapped()==MSTrue&&owner()->mapped()==MSTrue) { int offset=highlightThickness()+shadowThickness(); int x=offset+margin(); int size=textHeight(); if (size%2==0) size--; int delta=(height()-2*(offset+margin())-size); delta=(delta>0)?delta>>1:0; int y=offset+margin()+delta; if (armed()==MSTrue) selectMSGC().foreground(selectColor()); drawDiamondShadow(window(),MSRect(x,y,size,size),armed(), topShadowGC(),bottomShadowGC(), backgroundShadowGC(),selectGC()); } } void MSRadioButton::up(void) { if (radioBox()) radioBox()->up(); } void MSRadioButton::down(void) { if (radioBox()) radioBox()->down(); } void MSRadioButton::left(void) { if (radioBox()) radioBox()->left(); } void MSRadioButton::right(void) { if (radioBox()) radioBox()->right(); } void MSRadioButton::set(MSAttrValueList& avList_) { MSToggleButtonBase::set(avList_); } MSAttrValueList& MSRadioButton::get(MSAttrValueList& avList_) { avList_< #include #include #include MSRadioMenuItem::MSRadioMenuItem(MSMenu *owner_) : MSToggleMenuItem(owner_) {} MSRadioMenuItem::MSRadioMenuItem(MSMenu *owner_,const char *label_,char mnemonic_,int tag_) : MSToggleMenuItem(owner_,label_,mnemonic_,tag_) {} MSRadioMenuItem::MSRadioMenuItem(MSMenu *owner_,const MSString& label_, char mnemonic_,int tag_) : MSToggleMenuItem(owner_,label_,mnemonic_,tag_) {} MSRadioMenuItem::MSRadioMenuItem(MSMenu *owner_,const MSPixmap &pixmap_, const MSPixmap& insensitivePixmap_,int tag_) : MSToggleMenuItem(owner_,pixmap_,insensitivePixmap_,tag_) {} MSRadioMenuItem::MSRadioMenuItem(MSMenu *menu_,const MSString &label_,const MSPixmap &pixmap_,const MSPixmap &armedPixmap_,const MSPixmap &insensitivePixmap_,char mnemonic_,int tag_): MSToggleMenuItem(menu_,label_,pixmap_,armedPixmap_,insensitivePixmap_,mnemonic_,tag_){} MSRadioMenuItem::MSRadioMenuItem(MSMenu *menu_,const MSString &label_,const MSPixmap &pixmap_,const MSPixmap &armedPixmap_,char mnemonic_,int tag_): MSToggleMenuItem(menu_,label_,pixmap_,armedPixmap_,pixmap_,mnemonic_,tag_){} MSRadioMenuItem::MSRadioMenuItem(MSMenu *menu_,const char *label_,const MSPixmap &pixmap_,const MSPixmap &armedPixmap_,const MSPixmap &insensitivePixmap_,char mnemonic_,int tag_): MSToggleMenuItem(menu_,label_,pixmap_,armedPixmap_,insensitivePixmap_,mnemonic_,tag_){} MSRadioMenuItem::MSRadioMenuItem(MSMenu *menu_,const char *label_,const MSPixmap &pixmap_,const MSPixmap &armedPixmap_,char mnemonic_,int tag_): MSToggleMenuItem(menu_,label_,pixmap_,armedPixmap_,pixmap_,mnemonic_,tag_){} MSRadioMenuItem::~MSRadioMenuItem(void) {} void MSRadioMenuItem::activate(void) { if (menu()!=0) { menu()->releaseGrab(); state(MSTrue); if (showState()==ShowBoth) drawPixmap(); else drawSymbol(); menu()->enforceRadioBehavior(); if (activateCallback(MSWidgetCallback::activate)==MSFalse) menu()->activate(); else menu()->done(); } } void MSRadioMenuItem::radioDisarm(void) { if (state()==MSTrue) { state(MSFalse); if (showState()==ShowBoth) drawPixmap(); else drawSymbol(); } } void MSRadioMenuItem::drawSymbol(void) { if (owner()->mapped()==MSTrue && (showDisarmState()==MSTrue || armed()==MSTrue) ) { int offset=highlightThickness()+shadowThickness(); int x=x_origin()+marginWidth()+offset; int size=fontObject()->textHeight(); if (size%2==0) size--; int delta=(height()-2*(offset+marginHeight())-size); delta=(delta>0)?delta>>1:0; int y=y_origin()+marginHeight()+offset+delta; drawDiamondShadow(owner()->window(), MSRect(x,y,size,size),armed(), topShadowGC(),bottomShadowGC(), backgroundShadowGC(),_selectMSGC.gc()); // selectShadowGC()); } } int MSRadioMenuItem::symbolHeight(void) const { return fontObject()->textHeight(); } int MSRadioMenuItem::symbolWidth(void) const { return fontObject()->textHeight(); } aplus-fsf-4.22/src/MSGUI/MSRateEntryField.C0000644000265000001440000000427310772770411013732 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #if defined(MSTK_MANUAL_INSTANTIATION) #include #if defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma instantiate MSTypeEntryField #endif #if defined(MS_XLC_TEMPLATE_INSTANTIATION) #pragma define (MSTypeEntryField) #endif #if defined(MS_STD_TEMPLATE_INSTANTIATION) template class MSTypeEntryField; #endif #if defined(MS_VC_TEMPLATE_INSTANTIATION) template MSTypeEntryField; #endif #endif // MSTK_MANUAL_INSTANTIATION MSRateEntryField::MSRateEntryField(MSWidget *owner_, const char *label_,const MSSymbol& tag_) : MSTypeEntryField(owner_,label_,tag_) { init(); } MSRateEntryField::MSRateEntryField(MSWidget *owner_,MSRate& model_, const char *label_,const MSSymbol& tag_) : MSTypeEntryField(owner_,model_,label_,tag_) { init(); } MSRateEntryField::~MSRateEntryField(void) {} void MSRateEntryField::init(void) { _format=MSFormat(MSRate::Percent2); _incrementValue=0.01; } void MSRateEntryField::set(MSAttrValueList& avList_) { MSTypeEntryField::set(avList_); } MSAttrValueList& MSRateEntryField::get(MSAttrValueList& avList_) { //This is replacement to the get method in MSTypeEntryField as //code there is too generic and resulting code is incorrect MSString buf; MSFloat value; value=(double)_incrementValue; value.format(buf,MSFloat::Decimal4); avList_< MSRect::MSRect(void) { _x=_y=0;_width=_height=1; } MSRect::MSRect(const MSRect& r_) { _x=r_.x();_y=r_.y();_width=r_.width();_height=r_.height(); } MSRect::MSRect(int x_,int y_,int w_,int h_) { _x=x_;_y=y_;_width=w_; _height=h_; } MSRect::~MSRect(void) {_x=0;_y=0;_width=0;_height=0;} MSRect& MSRect::operator=(const MSRect& r_) { if (this!=&r_) { _x=r_.x();_y=r_.y();_width=r_.width();_height=r_.height(); } return *this; } int MSRect::x(void) const { return _x; } int MSRect::y(void) const { return _y; } int MSRect::width(void) const { return _width; } int MSRect::height(void) const { return _height; } void MSRect::x(int x_) { _x=x_; } void MSRect::y(int y_) { _y=y_; } void MSRect::width(int w_) { _width=w_; } void MSRect::height(int h_) { _height=h_; } void MSRect::configuration(int x_,int y_,int w_,int h_) { _x=x_;_y=y_;_width =w_;_height=h_; } aplus-fsf-4.22/src/MSGUI/MSReport.C0000644000265000001440000006620210772770411012324 ///////////////////////////////////////////////////////////////////////////////// // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #include const char *MSDefaultReportFileName ="report.ps"; extern const int MSDegPerRadian =(int)(360/(M_PI*2)); static const int MSClipMargin =10; static MSBoolean FileOpenStatus =MSFalse; extern const int MSPointsPerInch; extern const int MSPageSizeXTable[]; extern const int MSPageSizeYTable[]; MSSymbol MSReport::pagebreak("pagebreak"); MSSymbol MSReport::computesize("computesize"); class MSReportCallback : public MSCallback { private: MSReport *_report; MSReportCallbackFunc _function; void *_clientData; public: MSReportCallback(MSReport *report_,MSReportCallbackFunc func_,void *clientData_=0): _report(report_),_function(func_),_clientData(clientData_) {} virtual void process(void); }; void MSReportCallback::process(void) {_function(_report,_clientData);} MSReport::MSReport(void) { reset(); } MSReport::~MSReport(void) { deleteCallbackList(); } void MSReport::reset(void) { removeAllHeaders(); removeAllFooters(); fileName(MSDefaultReportFileName); _uniformScaling=MSTrue; _pageFrameStyle=MSNone; _headerOffset=2; _footerOffset=2; _pageNumberOffset=2; _pageFrameOffset=2; _pageFrameLineWidth=0; _psFontSize=0; _callbackListHead=0; _pageNumbering=MSTrue; _pageNumIncludeStatus=MSFalse; _cancelReport=MSFalse; _banner.font("Times-Roman-72"); _banner.justification(MSCenter); _banner.xOrigin(1); _banner.yOrigin(1); _banner.fgGrayScale(0.95); _banner.occurrence(Diagonal|EveryPage); _printHeaderStatus=MSFalse; // check grl _asciiFloatFormat=0; _asciiIntFormat=0; pageOrientation(Portrait); init(); } void MSReport::init(void) { _defaultFontID=0; _defaultFontSize=10; _pageCount=1; _pageCountTotal=0; _yPixel=topPixel(); _conditionalPageSize=MSFalse; headerHeights().removeAll(); footerHeights().removeAll(); } void MSReport::postScriptStackInit(void) { fontID(INT_MAX); fgColor(LONG_MAX); bgColor(LONG_MAX); gscale(1); lineStyle(INT_MAX); lineWidth(-1); } void MSReport::defaultFont(const MSString& aString_) { if (aString_.length()>0) { _defaultFont=aString_; defaultFontID(font(aString_)); defaultFontSize(fontSize()); } } //////////////////////////////////////////////////////////////////////////// // // general print methods // //////////////////////////////////////////////////////////////////////////// MSBoolean MSReport::reportOpen(void) { MSBoolean status=MSFalse; _cancelReport=MSFalse; init(); if(outputMode()==ASCII) { MSString file(fileName()); file.change(".ps",".txt",0,1); pout.open(file); if (pout.fail()==ios::failbit) { MSMessageLog::errorMessage("Error: opening file %s check file permissions\n",file.string()); } else status = MSTrue; } else { initFont(); if (fontCount()==0) { MSMessageLog::errorMessage("Error: no fonts allocated - unable to generate report\n"); } else if ((status=printOpen())==MSTrue) { if (disclaimer().style()>NoDisclaimer) disclaimer().computeSize(); computePrintScale(); } } return status; } MSBoolean MSReport::reportClose(void) { MSBoolean status=MSTrue; if (outputMode()==ASCII) pout.close(); else status=MSPostScript::printClose(); return status; } void MSReport::printProlog(void) { MSPostScript::printProlog(); } void MSReport::printEpilog(void) { pout<< "%%Trailer" <1&&pageCount_1&&pageCount_==pageCountTotal_) ) ret=MSTrue; return ret; } // general print methods void MSReport::strokeRectangle(double x_,double y_,double w_,double h_) { setAttributes(); setFgGrayScale(); printRectangle(x_,y_,w_,h_); pout<< "st"; pout<< endl; } void MSReport::fillRectangle(double x_,double y_,double w_,double h_) { setAttributes(); setBgGrayScale(); printRectangle(x_,y_,w_,h_); pout<< "f"; pout<< endl; } void MSReport::setClipRectangle(int x_,int y_,int w_,int h_) { pout<< x_-MSClipMargin; pout<< " "; pout<< y_+MSClipMargin; pout<< " "; pout<< "M"; pout<< " "; pout<< -w_+2*MSClipMargin; pout<< " "; pout<< "0"; pout<< " "; pout<< "0"; pout<< " "; pout<< h_+2*MSClipMargin; pout<< " "; pout<< w_+2*MSClipMargin; pout<< " "; pout<< "0"; pout<< " "; pout<< "3"; pout<< " "; pout<< "D"; pout<< " "; pout<< "clip"; pout<< " "; pout<< "n"; pout<< endl; } void MSReport::printPageStart(void) { pout<<"%%Page: "<0) { pout<< x_; pout<< " "; pout<< y_; pout<< " "; pout<< "M"; pout<< " "; pout<< "("; pout<< aString; pout<< ")"; pout<< " "; pout<< (Outline&m_?"sh st":"S"); pout<< endl; } } } //////////////////////////////////////////////////////////////////////////// // // header/footer methods // //////////////////////////////////////////////////////////////////////////// void MSReport::computePageHeaderSize(int pageCount_) { double height=0; for (unsigned i=0,n=headerList().count();iprintFont().length()==0) header(i)->printFont(defaultFont()); double h=header(i)->computePrintSize(this,0,y_org(),x_end(),0,0,0); if (y_org()-height-hprintFont().length()==0) footer(i)->printFont(defaultFont()); double h=footer(i)->computePrintSize(this,0,y_org(),x_end(),0,0,0); if (y_org()-hh-height-hprint(this,0,y,x_end(),0,0,0); header(i)->computePrintSize(this,0,y,x_end(),0,0,0); } } printHeaderStatus(MSFalse); } void MSReport::printPageFooters(void) { int y=bodyBottom(pageCount())-footerOffset()-pageFrameLineWidth(); int bottom=pageEnd(); pageEnd(bodyBottomBase()); for (unsigned i=0;iprint(this,0,y,x_end(),0,0,0); footer(i)->computePrintSize(this,0,y,x_end(),0,0,0); } } printHeaderStatus(MSFalse); pageEnd(bottom); } //////////////////////////////////////////////////////////////////////////// // // banner methods // //////////////////////////////////////////////////////////////////////////// MSParagraph& MSReport::banner(const MSParagraph& banner_) { _banner=banner_; return _banner; } MSParagraph& MSReport::banner(const MSStringVector& banner_) {_banner=banner_; return banner(_banner);} MSParagraph& MSReport::banner(const char *banner_) {_banner=banner_; return banner(_banner);} void MSReport::computeBannerExtents(void) { bannerAngle(0); bannerWidth(0); banner().fontID(font(banner().fontName())); banner().fontSize(fontSize()); if (printArea().width()>0&&banner().text().length()>0) { unsigned offset=pageSize()-Letter; double w=pageOrientation()==Portrait?MSPageSizeXTable[offset]:MSPageSizeYTable[offset]; double h=pageOrientation()==Portrait?MSPageSizeYTable[offset]:MSPageSizeXTable[offset]; double maxWidth=0,len=w; int x1=banner().xPixel(); int y1=banner().yPixel(); MSPrintFontData *fdata=fontStruct(banner().fontID()); unsigned length=banner().text().length(); for (unsigned i=0;itextWidth(banner().fontSize(),cp,strlen(cp)); maxWidth=tw>maxWidth?tw:maxWidth; } if (banner().occurrence()&Diagonal) { int x2=(int)w-x1; int y2=(int)h-y1; double a=x2-x1; double b=y2-y1; len=sqrt(a*a+b*b); bannerAngle(MSDegPerRadian*atan(b/a)); } bannerWidth(len); if (maxWidth>len) banner().fontScale(len/maxWidth); } } void MSReport::printBanner(void) { if (banner().text().length()>0&&printOnPage(banner(),pageCount(),pageCountTotal())==MSTrue) { computeBannerExtents(); MSPrintFontData *fdata=fontStruct(banner().fontID()); gcValues().font=banner().fontID()!=0?banner().fontID():1; fgGrayScale(banner().fgGrayScale()); bgGrayScale(banner().bgGrayScale()); fontSize(banner().fontSize()); pout<<"gs"; pout<<" "; if (Outline&banner().style()) { gcValues().line_width=0; setAttributes(); } setFgGrayScale(); setFont(); pout<fontOffset(fontSize())); for (unsigned i=0;itextWidth(fontSize(),cp,strlen(cp)); int x=(int)(MSLeft&banner().justification()?0:MSRight&banner().justification()?bannerWidth():((bannerWidth()-tw)/2)); MSString aString(cp); aString.change("\\","\\\\").change("(","\\(").change(")","\\)"); if (aString.length()>0) { pout<< x; pout<< " "; pout<< y; pout<< " "; pout<< "M"; pout<< " "; pout<< "("; pout<< aString; pout<< ")"; pout<< " "; pout<< (Outline&banner().style()?"sh st":"S"); pout<< endl; } y-=fontSize()-banner().leading(); } pout<<"gr"<0) { if (pg0) { MSStringVector text(pageNumberText()(actual-1)); int adjustedCount=pg>actual?pg-actual:pg; _pageNumberString=MSString(adjustedCount); insertPageNumString(text); _pageNumberString=text.asString(); // _pageNumberString=pageNumberText()(pg); return; } else _pageNumberString=MSString(pg); } void MSReport::printPageNumber(void) { if (pageNumbering()==MSTrue&&pageNumIncludeStatus()!=MSTrue) { int h=pageNumber().residual()+pageNumberOffset(); int bottom=pageEnd(); pageEnd(y_end()); if (pageNumber().text().length()==0) { pageNumber().outputText()<0) { if (column_callback(callback_); else { node=new MSReportCallbackNode(name_,callback_); MSNodeItem *np=new MSNodeItem((void *)node); if (callbackListHead()==0) _callbackListHead=new MSNodeItem; np->insert(callbackListHead()->next()); } } MSBoolean MSReport::activateCallback(const MSSymbol& name_) { MSReportCallbackNode *node=callbackNode(name_); if (node!=0) { MSCallback *pCallback=node->callback(); if (pCallback!=0) pCallback->process(); return MSTrue; } return MSFalse; } MSCallback *MSReport::callback(const MSSymbol& name_) { MSReportCallbackNode *node=callbackNode(name_); return (node!=0)?node->callback():0; } MSReportCallbackNode *MSReport::callbackNode(const MSSymbol& name_) { if (callbackListHead()!=0) { MSNodeItem *hp=callbackListHead(); MSNodeItem *np=hp; MSReportCallbackNode *node; if (name_!=MSSymbol::nullSymbol()) { while ((np=np->next())!=hp) { node=(MSReportCallbackNode *)np->data(); if (node->name()==name_) return node; } } } return 0; } void MSReport::deleteCallbackList(void) { if (callbackListHead()!=0) { MSNodeItem *hp=callbackListHead(); MSNodeItem *np=hp; MSReportCallbackNode *node; while ((np=hp->next())!=hp) { node=(MSReportCallbackNode *)np->data(); delete np; delete node; } delete callbackListHead(); } } void MSReport::translateScale(double xScale_,double yScale_,int x_,int y_) { if (xScale_!=1||yScale_!=1) { pout<printFont().length()==0) pItem->printFont(defaultFont()); y-=pItem->computePrintSize(this,0,y,x_end(),0,0,0); _pageCount+=pItem->pageCount(); lastPageCnt=pItem->pageCount(); lastResidual=pItem->residual(); if (pItem->pageCount()>0) { y=bodyTop(pageCount())-pItem->residual(); pageEnd(bodyBottom(pageCount())); } } if (p==0&&conditionalPageSize()==MSTrue) { headerHeights().removeAll(); footerHeights().removeAll(); if(lastPageCnt!=0&&lastResidual==0) _pageCount--; pageCountTotal(pageCount()); pageCount(1); } else passes=1; } if(lastPageCnt!=0&&lastResidual==0) _pageCount--; pageCountTotal(pageCount()); pageCount(1); activateCallback(computesize); pages(pageCountTotal()); } void MSReport::print(const char *file_) { if (file_!=0) fileName(file_); if (reportOpen()==MSTrue&&FileOpenStatus==MSFalse) { FileOpenStatus=MSTrue; if (outputMode()==ASCII) { for (unsigned i=0;iprint(this,0,0,0,0,0,0); } } else { MSBoolean endPageStatus=MSFalse; postScriptStackInit(); computePageSize(); computeOutputSize(); printProlog(); printSetup(); startPage(); int y=bodyTop(pageCount()); headerHeights().removeAll(); footerHeights().removeAll(); pageEnd(bodyBottom(pageCount())); for (unsigned i=0;iprint(this,0,y,x_end(),0,0,0); if (pItem->currentPage()-1pageCount()) { endPage(); endPageStatus=MSTrue; if (pageCount()residual()!=0||pItem->pageCount()-pItem->currentPage()>0) i--; _pageCount++; pageEnd(bodyBottom(pageCount())); activateCallback(pagebreak); startPage(); endPageStatus=MSFalse; } y=bodyTop(pageCount()); } } if (endPageStatus==MSFalse) endPage(); } } FileOpenStatus=MSFalse; reportClose(); } aplus-fsf-4.22/src/MSGUI/MSReportTable.C0000644000265000001440000024400310772770411013271 ///////////////////////////////////////////////////////////////////////////////// // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include extern const int MSPointsPerInch; MSReportTable::MSReportTable(const char *title_,const MSSymbol& tag_) : _reportTitle(title_), _tag(tag_) { init(); } MSReportTable::MSReportTable(const MSStringVector& title_,const MSSymbol& tag_) : _reportTitle(title_), _tag(tag_) { init(); } void MSReportTable::init(void) { _columnList=new MSPointerArray; _hiddenColumnList=new MSPointerArray; _fixedReportColumns=-1; _numRows=0; _style=MSNone; _breakStyle=MSLeft; _reportTotalStyle=MSLeft; _headingStyle=0; _headingForeground=0; _groupHeadingList=0; _breakTextList=0; _reportTotalLeading=2; _grandTotalBaseText=0; _reportTotalOn=MSFalse; _reportGrandTotalOn=MSFalse; _pageTotalOn=MSFalse; _outputStyle=MSP::RowMajor; _report=0; _groupHeadingHeight=0; _frameStyle=MSNone; _frameOffset=2; _frameLineWidth=0; _tag=MSSymbol::nullSymbol(); _orphanRowHeight=0; _headingHeight=0; _reportHeadingOffset=2; _breakOffset=5; _breakLeading=2; _fgGrayScale=0.; _bgGrayScale=1; _headingFgGrayScale=0; _headingBgGrayScale=1; _widowRows=1; _orphanRows=1; _rowPageSpan=0; _columnPageSpan=0; _newspaperColumns=1; _x_printScale=1; _y_printScale=1; _tableLeft=0; _tableRight=0; _tableTop=0; _tableBottom=0; _pageWidth=0; _pageHeight=0; _segment=0; _pageCount=0; _lastPageCount=0; _delimiter=" "; _fixedFieldWidth=0; _pageCountTotal=0; _scaleHeaders=MSFalse; destroyable(MSFalse); topPixel(0); bottomPixel(4); } MSReportTable::~MSReportTable(void) { destroyable(MSFalse); unsigned i,n=columnList()->count(); for (i=n-1;iarray(i); delete _columnList; n=hiddenColumnList()->count(); for (i=n-1;iarray(i); delete _hiddenColumnList; if (groupHeadingList()!=0) { for (unsigned i=0;icount();i++) delete groupHeading(i); delete _groupHeadingList; } if (breakTextList()!=0) delete _breakTextList; if (_grandTotalBaseText!=0) delete _grandTotalBaseText; if (printManager()!=0) printManager()->removePrintItem(this); if (_report!=0) delete _report; } //////////////////////////////////////////////////////////////////////////// // // screen related methods // //////////////////////////////////////////////////////////////////////////// void MSReportTable::updateScreen(void) {} unsigned MSReportTable::dataRows(void) const {return _numRows;} unsigned MSReportTable::numColumns(void) const {return columnList()->count();} void MSReportTable::headingForeground(const char *fg_) { headingForeground(convertForeground(fg_)); } const char *MSReportTable::formatOutput(MSString &buffer_,unsigned row_,unsigned col_) { MSTableColumn *field=reportColumn(col_); if (field!=0) field->formatOutput(buffer_,row_); return buffer_.string(); } void MSReportTable::headingForeground(unsigned long fg_) { if (headingForeground()!=fg_) { unsigned i; for (i=0;icount();i++) { if (reportColumn(i)->headingForeground()==headingForeground()) reportColumn(i)->headingForeground(fg_); } for (i=0;icount();i++) { MSTableColumn *tc=hiddenColumnList()->array(i); if (tc->headingForeground()==headingForeground()) tc->headingForeground(fg_); } _headingForeground=fg_; } } MSSymbolVector MSReportTable::tags(void) { MSSymbolVector symbols; for (unsigned i=0;icount();i++) { if (columnList()->array(i)->tag()!=MSSymbol::nullSymbol()) { symbols<array(i)->tag(); } } return symbols; } MSSymbolVector MSReportTable::tags(void) const { MSSymbolVector symbols; for (unsigned i=0;icount();i++) { if (columnList()->array(i)->tag()!=MSSymbol::nullSymbol()) { symbols<array(i)->tag(); } } return symbols; } MSSymbolVector MSReportTable::hiddenTags(void) const { MSSymbolVector symbols; for (unsigned i=0;icount();i++) { if (hiddenColumnList()->array(i)->tag()!=MSSymbol::nullSymbol()) { symbols<array(i)->tag(); } } return symbols; } MSSymbolVector MSReportTable::hiddenTags(void) { MSSymbolVector symbols; for (unsigned i=0;icount();i++) { if (hiddenColumnList()->array(i)->tag()!=MSSymbol::nullSymbol()) { symbols<array(i)->tag(); } } return symbols; } void MSReportTable::addColumn(MSTableColumn *col_) { columnList()->add(col_); } void MSReportTable::removeColumn(MSTableColumn *col_) { if (columnList()->remove(col_)==MSTrue) { for (unsigned i=0;icount();i++) columnList()->array(i)->column(i); } } void MSReportTable::exchangeColumns(unsigned int x_,unsigned int y_) { columnList()->exchange(x_,y_); } MSTableColumn *MSReportTable::reportColumn(unsigned column_) { return (MSTableColumn *)columnList()->array(column_); } MSTableColumn *MSReportTable::reportColumn(const MSSymbol& tag_) { unsigned i,n=columnList()->count(); for (i=0;itag()) return reportColumn(i); n=hiddenColumnList()->count(); for (i=0;iarray(i)->tag()) { return (MSTableColumn *)hiddenColumnList()->array(i); } return 0; } const MSTableColumn *MSReportTable::reportColumn(unsigned column_) const { return (MSTableColumn *)columnList()->array(column_); } const MSTableColumn *MSReportTable::reportColumn(const MSSymbol& tag_) const { unsigned i,n=columnList()->count(); for (i=0;itag()) return reportColumn(i); n=hiddenColumnList()->count(); for (i=0;iarray(i)->tag()) { return (MSTableColumn *)hiddenColumnList()->array(i); } return 0; } unsigned MSReportTable::numRows(unsigned col_) const { const MSTableColumn *var=reportColumn(col_); return (var!=0)?var->numRows():0; } void MSReportTable::maxRowsSet(unsigned rows_) { _numRows=rows_>_numRows?rows_:_numRows; } void MSReportTable::placeColumnAt(MSTableColumn *pColumn_,unsigned index_) { columnList()->insert(pColumn_,index_); resetColumnLocations(); } void MSReportTable::permuteColumns(const MSIndexVector& aIndexVector_) { MSPointerArray *newColumnList=new MSPointerArray; MSTableColumn *pBaseColumn; MSIndexVector iv; unsigned i,index,n=columnList()->count(); for (i=0;iarray(index); if (pBaseColumn!=0) { newColumnList->add(pBaseColumn); iv<assign(0,iv(i)); for (i=0;iadd(pBaseColumn); delete _columnList; _columnList=newColumnList; resetColumnLocations(); } void MSReportTable::permuteColumns(const MSSymbolVector& aSymbolVector_) { MSPointerArray *newColumnList=new MSPointerArray; MSPointerArray *newHiddenColumnList=new MSPointerArray; MSTableColumn *pBaseColumn; unsigned i,j,index,n=columnList()->count(),k=hiddenColumnList()->count(); for (i=0;iarray(j)!=0&&columnList()->array(j)->tag()==columnTag) { index=j; pBaseColumn=columnList()->array(index); newColumnList->add(pBaseColumn); columnList()->assign(0,index); break; } } if (pBaseColumn==0) // did not find it, so search the hiddenColumnList { for (j=0;jarray(j)!=0&&hiddenColumnList()->array(j)->tag()==columnTag) { index=j; pBaseColumn=hiddenColumnList()->array(index); newColumnList->add(pBaseColumn); hiddenColumnList()->assign(0,index); break; } } } } for (i=0;iarray(i))!=0) newHiddenColumnList->add(pBaseColumn); } for (i=0;iarray(i))!=0) newHiddenColumnList->add(pBaseColumn); } delete _columnList; delete _hiddenColumnList; _columnList=newColumnList; _hiddenColumnList=newHiddenColumnList; resetColumnLocations(); } void MSReportTable::permuteColumns(const MSWidgetVector &vector_) { MSPointerArray *newColumnList=new MSPointerArray; MSPointerArray *newHiddenColumnList=new MSPointerArray; MSTableColumn *pBaseColumn; unsigned i,j,index,n=columnList()->count(),k=hiddenColumnList()->count(); unsigned len=vector_.length(); for (i=0;iarray(j)!=0&&columnList()->array(j)==column) { index=j; pBaseColumn=columnList()->array(index); newColumnList->add(pBaseColumn); columnList()->assign(0,index); break; } } if (pBaseColumn==0) // did not find it, so search the hiddenColumnList { for (j=0;jarray(j)!=0&&hiddenColumnList()->array(j)==column) { index=j; pBaseColumn=hiddenColumnList()->array(index); newColumnList->add(pBaseColumn); hiddenColumnList()->assign(0,index); break; } } } } for (i=0;iarray(i))!=0) newHiddenColumnList->add(pBaseColumn); } for (i=0;iarray(i))!=0) newHiddenColumnList->add(pBaseColumn); } delete _columnList; delete _hiddenColumnList; _columnList=newColumnList; _hiddenColumnList=newHiddenColumnList; resetColumnLocations(); } void MSReportTable::resetColumnLocations(void) { for (unsigned i=0;icount();i++) reportColumn(i)->column(i); } void MSReportTable::updateBreaks(unsigned column_) { MSTableColumn *tc=reportColumn(column_); if (tc->breakOn()!=MSTrue) tc->breakString().removeAll(); unsigned columns=numColumns()-1; unsigned rows=numRows()+1; for (unsigned i=1;ibreakOn()==MSTrue) { if ((index=field->breakIndex().indexOf(i))breakIndex().length()) { MSIndexVector iv; tc->breakProcess(iv<breakIndex()(index-1)<breakIndex()(index)); } } } } if (reportTotalOn()==MSTrue) { MSIndexVector index; tc->breakProcess(index<<0<count();i++) { MSTableColumn *tc=reportColumn(i); if (tc->breakOn()!=MSTrue) tc->breakString().removeAll(); } unsigned columns=numColumns()-1; unsigned rows=numRows()+1; for (i=1;ibreakOn()==MSTrue) { if ((index=field->breakIndex().indexOf(i))breakIndex().length()) { MSIndexVector iv; breakProcess(iv<breakIndex()(index-1)<breakIndex()(index)); } } } } } void MSReportTable::computeBreaks(void) { clearBreaks(); grandTotal()=0; breakIndex().removeAll(); pageBreakIndex().removeAll(); breakColumn().removeAll(); breakTextColumn().removeAll(); int n=numColumns()-1; if(n<0) return; for (unsigned i=0;ibreakOn()==MSTrue&& ((inumRows()&&field->breakCriteria(i)==MSTrue)||i==field->numRows())) { breakIndex()<breakTextList().count()>=field->breakIndex().length()) breakTextColumn()<pageBreakOn()==MSTrue) pageBreakIndex()<breakIndex()<breakIndex()); } } } if (reportTotalOn()==MSTrue||reportGrandTotalOn()==MSTrue) { computeColumnTotals(); if (reportTotalOn()==MSTrue) { breakIndex()<asciiFloatFormat()!=0?report()->asciiFloatFormat(): MSFloat::Decimal0; aFloat.format(buffer,MSFormat(format)); if (sv.length()>0) sv[sv.length()-1]<numColumns()) grandTotalBaseText().column(numColumns()-1); } } breakIndex().sortUp(); pageBreakIndex().sortUp(); } MSIndexVector MSReportTable::sortUp(const MSIndexVector &sortVector_) { MSIndexVector iv; if (sortVector_.length()>0) { unsigned i,j; MSTableColumn *column; for (i=0;iarray(sortVector_(i)))!=0) { if (column->model()!=0) break; else column=0; } } if (column!=0) { unsigned startIndex=i+1; MSIndexVector indexVector=column->gradeUp(); iv=indexVector; unsigned count=columnList()->count(),hcount=hiddenColumnList()->count(); for (i=0;iarray(i); if (col!=0&&col->model()!=0) { col->permute(indexVector); if (col->weights().length()>0) col->weights().permute(indexVector); } } for (i=0;iarray(i); if (col!=0&&col->model()!=0) { col->permute(indexVector); if (col->weights().length()>0) col->weights().permute(indexVector); } } MSIndexVector start,end; start.append(0); end.append(indexVector.length()-1); for (i=startIndex;irange(start,end); MSTableColumn *nextcol=columnList()->array(sortVector_(i)); if (nextcol!=0&&nextcol->model()!=0) { indexVector=nextcol->rangeGradeUp(start,end); for (j=0;jarray(j); if (col!=0&&col->model()!=0) { col->permute(indexVector); if (col->weights().length()>0) col->weights().permute(indexVector); } } for (j=0;jarray(j); if (col!=0&&col->model()!=0) { col->permute(indexVector); if (col->weights().length()>0) col->weights().permute(indexVector); } } iv.permute(indexVector); column=nextcol; } } } } return iv; } MSIndexVector MSReportTable::sortDown(const MSIndexVector &sortVector_) { MSIndexVector iv; if (sortVector_.length()>0) { unsigned i,j; MSTableColumn *column; for (i=0;iarray(sortVector_(i)))!=0) { if (column->model()!=0) break; else column=0; } } if (column!=0) { unsigned startIndex=i+1; MSIndexVector indexVector=column->gradeDown(); iv=indexVector; unsigned count=columnList()->count(),hcount=hiddenColumnList()->count(); for (i=0;iarray(i); if (col!=0&&col->model()!=0) { col->permute(indexVector); if (col->weights().length()>0) col->weights().permute(indexVector); } } for (i=0;iarray(i); if (col!=0&&col->model()!=0) { col->permute(indexVector); if (col->weights().length()>0) col->weights().permute(indexVector); } } MSIndexVector start,end; start.append(0); end.append(indexVector.length()-1); for (i=startIndex;irange(start,end); MSTableColumn *nextcol=columnList()->array(sortVector_(i)); if (nextcol!=0&&nextcol->model()!=0) { indexVector=nextcol->rangeGradeDown(start,end); for (j=0;jarray(j); if (col!=0&&col->model()!=0) { col->permute(indexVector); if (col->weights().length()>0) col->weights().permute(indexVector); } } for (j=0;jarray(j); if (col!=0&&col->model()!=0) { col->permute(indexVector); if (col->weights().length()>0) col->weights().permute(indexVector); } } iv.permute(indexVector); column=nextcol; } } } } return iv; } MSIndexVector MSReportTable::sortUp(const MSSymbolVector &sortVector_) { MSIndexVector iv; if (sortVector_.length()>0) { unsigned i,j,count=columnList()->count(),hcount=hiddenColumnList()->count(); MSTableColumn *column=0; for (i=0;column==0&&iarray(j)->tag()) { column=columnList()->array(j); if (column->model()!=0) break; else column=0; } } if (column==0) { for (j=0;jarray(j)->tag()) { column=hiddenColumnList()->array(j); if (column->model()!=0) break; else column=0; } } } } if (column!=0) { unsigned startIndex=i; MSIndexVector indexVector=column->gradeUp(); iv=indexVector; for (i=0;iarray(i); if (col!=0&&col->model()!=0) { col->permute(indexVector); if (col->weights().length()>0) col->weights().permute(indexVector); } } for (i=0;iarray(i); if (col!=0&&col->model()!=0) { col->permute(indexVector); if (col->weights().length()>0) col->weights().permute(indexVector); } } MSIndexVector start,end; start.append(0); end.append(indexVector.length()-1); for (i=startIndex;irange(start,end); MSTableColumn *nextcol=0; for (j=0;jarray(j)->tag()) { nextcol=columnList()->array(j); if (nextcol->model()!=0) break; else nextcol=0; } } if (nextcol==0) { for (j=0;jarray(j)->tag()) { nextcol=hiddenColumnList()->array(j); if (nextcol->model()!=0) break; else nextcol=0; } } } if (nextcol!=0) { indexVector=nextcol->rangeGradeUp(start,end); for (j=0;jarray(j); if (col!=0&&col->model()!=0) { col->permute(indexVector); if (col->weights().length()>0) col->weights().permute(indexVector); } } for (j=0;jarray(j); if (col!=0&&col->model()!=0) { col->permute(indexVector); if (col->weights().length()>0) col->weights().permute(indexVector); } } iv.permute(indexVector); column=nextcol; } } } } return iv; } MSIndexVector MSReportTable::sortDown(const MSSymbolVector &sortVector_) { MSIndexVector iv; if (sortVector_.length()>0) { unsigned i,j,count=columnList()->count(),hcount=hiddenColumnList()->count(); MSTableColumn *column=0; for (i=0;column==0&&iarray(j)->tag()) { column=columnList()->array(j); if (column->model()!=0) break; else column=0; } } if (column==0) { for (j=0;jarray(j)->tag()) { column=hiddenColumnList()->array(j); if (column->model()!=0) break; else column=0; } } } } if (column!=0) { unsigned startIndex=i; MSIndexVector indexVector=column->gradeDown(); iv=indexVector; for (i=0;iarray(i); if (col!=0&&col->model()!=0) { col->permute(indexVector); if (col->weights().length()>0) col->weights().permute(indexVector); } } for (i=0;iarray(i); if (col!=0&&col->model()) { col->permute(indexVector); if (col->weights().length()>0) col->weights().permute(indexVector); } } MSIndexVector start,end; start.append(0); end.append(indexVector.length()-1); for (i=startIndex;irange(start,end); MSTableColumn *nextcol=0; for (j=0;jarray(j)->tag()) { nextcol=columnList()->array(j); if (nextcol->model()!=0) break; else nextcol=0; } } if (nextcol==0) { for (j=0;jarray(j)->tag()) { nextcol=hiddenColumnList()->array(j); if (nextcol->model()!=0) break; else nextcol=0; } } } if (nextcol!=0) { indexVector=nextcol->rangeGradeDown(start,end); for (j=0;jarray(j); if (col!=0&&col->model()!=0) { col->permute(indexVector); if (col->weights().length()>0) col->weights().permute(indexVector); } } for (j=0;jarray(j); if (col!=0&&col->model()!=0) { col->permute(indexVector); if (col->weights().length()>0) col->weights().permute(indexVector); } } iv.permute(indexVector); column=nextcol; } } } } return iv; } //////////////////////////////////////////////////////////////////////////// // // printing related methods // //////////////////////////////////////////////////////////////////////////// MSReport* MSReportTable::report(void) { if (_report==0) { _report=new MSReport; _report->pageOrientation(MSP::Landscape); } return _report; } void MSReportTable::breakText(MSParagraph *x_) { if (_breakTextList==0) _breakTextList=new MSPointerArray; breakTextList()->add(x_); } int MSReportTable::fixedReportColumns(void) const {return _fixedReportColumns;} MSDisplayServer *MSReportTable::displayServer(void) {return 0; } unsigned long MSReportTable::style(unsigned row_,unsigned col_) { MSTableColumn *field=reportColumn(col_); return field!=0?field->style(row_):style(); } unsigned long MSReportTable::breakStyle(unsigned row_,unsigned col_) { MSTableColumn *field=reportColumn(col_); return field!=0?field->breakStyle(row_):breakStyle(); } int MSReportTable::breakOffset(unsigned row_,unsigned col_) { MSTableColumn *field=reportColumn(col_); return field!=0?field->breakOffset(row_):breakOffset(); } int MSReportTable::breakLeading(unsigned row_,unsigned col_) { MSTableColumn *field=reportColumn(col_); return field!=0?field->breakLeading(row_):breakLeading(); } double MSReportTable::fgGrayScale(unsigned row_,unsigned col_) { MSTableColumn *field=reportColumn(col_); return field!=0?field->fgGrayScale(row_):fgGrayScale(); } double MSReportTable::bgGrayScale(unsigned row_,unsigned col_) { MSTableColumn *field=reportColumn(col_); return field!=0?field->bgGrayScale(row_):bgGrayScale(); } const char *MSReportTable::reportFont(unsigned row_,unsigned col_) { MSTableColumn *field=reportColumn(col_); return field!=0?field->reportFont(row_):reportFont().string(); } const char *MSReportTable::breakFont(unsigned row_,unsigned col_) { MSTableColumn *field=reportColumn(col_); return field!=0?field->breakFont(row_):breakFont().string(); } MSParagraph& MSReportTable::addGroupHeading(const MSParagraph& printText_) { if (groupHeadingList()==0) _groupHeadingList=new MSPointerArray; MSParagraph *printText=new MSParagraph(printText_); if (printText->fontName().length()==0) printText->font(reportFont()); groupHeadingList()->add(printText); return *printText; } MSParagraph& MSReportTable::addGroupHeading(const MSStringVector& printText_) {return addGroupHeading(MSParagraph(printText_));} void MSReportTable::removeGroupHeading(const MSSymbol& tag_) { MSParagraph *printText=0; for (unsigned i=0;icount();i++) { if (tag_==groupHeading(i)->tag()) printText=groupHeading(i); } if (printText!=0) { delete printText; groupHeadingList()->remove(printText); } } void MSReportTable::removeAllGroupHeadings(void) { for (unsigned i=0;icount();i++) delete groupHeading(i); groupHeadingList()->removeAll(); } MSParagraph& MSReportTable::reportGroupHeading(const MSSymbol& tag_) { for (unsigned i=0;icount();i++) if (tag_==groupHeading(i)->tag()) return *groupHeading(i); MSMessageLog::warningMessage("Warning: group heading \"%s\" not found\n",tag_.symbolName()); return defaultText(); } const MSParagraph& MSReportTable::reportGroupHeading(const MSSymbol& tag_) const { for (unsigned i=0;icount();i++) if (tag_==groupHeading(i)->tag()) return *groupHeading(i); MSMessageLog::warningMessage("Warning: group heading \"%s\" not found\n",tag_.symbolName()); return defaultText(); } unsigned long MSReportTable::convertForeground(const char *) {return 0;} void MSReportTable::generateReport(const char *file_) { report()->addPrintItem(this); report()->print(file_); } void MSReportTable::breakProcess(MSIndexVector& i_) { for (unsigned int i=0;icount();i++) { MSTableColumn *tc=reportColumn(i); if (tc->breakProcessOn()==MSTrue) tc->breakProcess(i_); } } void MSReportTable::computeColumnTotals(void) { MSIndexVector iv("0 0"); MSString buffer; for (unsigned int i=0;icount();i++) { MSTableColumn *tc=reportColumn(i); iv[1]=tc->numRows(); if (tc->breakProcessOn()==MSTrue) tc->breakProcess(iv); if (tc->breakString().length()>0) { buffer=tc->breakString().lastElement(); grandTotal()+=buffer.asDouble(); } } } void MSReportTable::clearBreaks(void) { unsigned int n=columnList()->count(); for (unsigned int i=0;icount();i++) { if (reportColumn(i)->breakOn()!=MSTrue) reportColumn(i)->breakString().removeAll(); reportColumn(i)->breakIndex().removeAll(); reportColumn(i)->breakInvalid().removeAll(); reportColumn(i)->breakIndex()<<0; } } MSReportTable& MSReportTable::leftMargin(double x_) {MSPrintItem::leftMargin(x_); return *this;} MSReportTable& MSReportTable::rightMargin(double x_) {MSPrintItem::rightMargin(x_); return *this;} MSReportTable& MSReportTable::topOffset(double x_) {MSPrintItem::topOffset(x_); return *this;} MSReportTable& MSReportTable::bottomOffset(double x_) {MSPrintItem::bottomOffset(x_); return *this;} MSReportTable& MSReportTable::topPixel(unsigned x_) {MSPrintItem::topPixel(x_); return *this;} MSReportTable& MSReportTable::bottomPixel(unsigned x_) {MSPrintItem::bottomPixel(x_); return *this;} MSReportTable& MSReportTable::justification(MSAlignment x_) {MSPrintItem::justification(x_); return *this;} MSReportTable& MSReportTable::justification(unsigned long x_) {MSPrintItem::justification(x_); return *this;} MSReportTable& MSReportTable::printRow(int x_) {MSPrintItem::printRow(x_); return *this;} MSReportTable& MSReportTable::printColumn(int x_) {MSPrintItem::printColumn(x_); return *this;} MSReportTable& MSReportTable::reportFont(const char *string_) {MSPrintItem::printFont(string_); return *this;} MSReportTable& MSReportTable::style(unsigned long style_) { unsigned long temp=style_&(MSLeft|MSRight|MSTop|MSBottom|MSCenter); if (temp>0) justification(temp); _style=style_; return *this; } MSReportTable& MSReportTable::orphanRows(unsigned x_) {_orphanRows=x_; return *this;} MSReportTable& MSReportTable::widowRows(unsigned x_) {_widowRows=x_; return *this;} MSReportTable& MSReportTable::pageAlignment(unsigned long x_) {MSPrintItem::pageAlignment(x_); return *this;} MSReportTable& MSReportTable::pageAlignment(MSAlignment x_) {return pageAlignment((unsigned long)x_);} const MSSymbol& MSReportTable::printTag(void) const {return tag();} double MSReportTable::leftMargin(void) const {return MSPrintItem::leftMargin();} double MSReportTable::rightMargin(void) const {return MSPrintItem::rightMargin();} double MSReportTable::topOffset(void) const {return MSPrintItem::topOffset();} double MSReportTable::bottomOffset(void) const {return MSPrintItem::bottomOffset();} unsigned MSReportTable::topPixel(void) const {return MSPrintItem::topPixel();} unsigned MSReportTable::bottomPixel(void) const {return MSPrintItem::bottomPixel();} unsigned long MSReportTable::justification(void) const {return MSPrintItem::justification();} int MSReportTable::printRow(void) const {return MSPrintItem::printRow();} int MSReportTable::printColumn(void) const {return MSPrintItem::printColumn();} const MSString& MSReportTable::reportFont(void) const {return MSPrintItem::printFont();} int MSReportTable::print(MSReport *report_,int x_,int y_,int,int,int,int) { if (numColumns()==0) { _currentPage++; return 0;} MSReport *oldReport= _report; report(report_); if(report_->outputMode()==ASCII) { printASCIITable(); _report=oldReport; return 0; } int actualHeight=0; int y=y_-(segment()==0?topPixel():0); int remainingHeight=y_-report_->pageEnd(); int minHeight=orphanRowHeight()+tableHeaderHeight()+tableFooterHeight(); if (remainingHeight<=0 || (minHeight>=remainingHeight&&pageBreakRow()<0)|| (pageBreakRow()<0&&pageAlignment()&MSTop&&y_!=report_->bodyTop(report_->pageCount()))) { _currentPage++; pageBreakRow(0); //Height(minHeight); _report=oldReport; return remainingHeight; } else report_->yPixel(y); if (pageHeight()>0&&pageHeight()pageEnd()+pageHeight(); actualHeight=remainingHeight; } } int h=y_-y; h+=printTableSegment(x_,y); if (stackCount()+1pageEnd(); minHeight=orphanRowHeight()+tableHeaderHeight()+tableFooterHeight(); if (minHeight>=newRemainingHeight) { _segment++; // _pageCount++; _currentPage++; _printPage++; _report=oldReport; return pageHeight()-remainingHeight; } else report_->yPixel(y); h+=printTableSegment(x_,y); h+=topPixel()+bottomPixel(); } int totalSegments=rowPageBreak().length()-stackPageBreak().length()-1; h+=segment()0?actualHeight:h; } int MSReportTable::computePrintSize(MSReport *report_,int,int y_,int w_,int,int topMargins_,int margins_) { int h=0; _printPage=1; MSReport *oldReport=_report; report(report_); if (numColumns()>0) { reset(); segment(0); stackCount(-1); if (leftPixel()<0) leftPixel(report_->leftPixel()); if (rightPixel()<0) rightPixel(report_->rightPixel()); margins_=(margins_==0?leftPixel()+rightPixel():margins_); pageWidth(w_-margins_); report_->yPixel(y_-topPixel()-topMargins_); printHeight(topMargins_); //hack for now. computeTableRowColumnSize(); int startingPageCount=report()->pageCount(); int remainingHeight=report()->yPixel()-report()->pageEnd(); int minHeight=orphanRowHeight()+tableHeaderHeight()+tableFooterHeight(); headerHeights().removeAll(); footerHeights().removeAll(); if (remainingHeight<=0||minHeight>=remainingHeight|| (pageAlignment()&MSTop&&y_!=report_->bodyTop(report_->pageCount()))) { _residual=1; //hack _pageCount++; report()->pageCountIncrement(); report()->yPixel(report()->bodyTop()-topMargins_); remainingHeight=report()->yPixel()-report()->pageEnd(); } computeRowColumnPartitions(); if (pageCountTotal()>1) { unsigned index=rowPageBreak().length()-2; h=report()->yPixel()-report()->pageEnd(); pageCount(pageCountTotal()-1+_residual); _printPage=pageCountTotal(); int lastSegment=computeTableSegmentHeight(rowPageBreak()(index),rowPageBreak()(index+1)); int page=startingPageCount+pageCountTotal(); int pageSize=report()->bodyTop(page)-report()->bodyBottom(page)-topMargins_; // if (lastSegment0?1:0); double headerHeight=tableHeaderHeight()+tableFooterHeight(); double height=headingHeight()+tableTop()+tableBottom(); int maxHeight=0; int lastRowLeading=0; for (int rh,i=0,j,k=0;i0?rowLeadings()(k-1):0; maxHeight=rh>maxHeight?rh:maxHeight; } height+=maxHeight; height+=height*stackPageBreak().length(); height*=y_printScale(); height+=topPixel()+(topPixel()+bottomPixel())*(stackPageBreak().length()); height+=headerHeight*((scaleHeaders()==MSTrue)?y_printScale():1.0); if (height>remainingHeight) height-=lastRowLeading; if (height+bottomPixel()pageCount(startingPageCount); } printHeight(0); _residual=h; _report=oldReport; _printPage=1; return h; } void MSReportTable::computeTableRowColumnSize(void) { MSTableColumn *field; MSPrintFontData *fdata; const char *cp; int offset=1; setTableParameters(); computeBreaks(); // initialize report variables int grandTotalOffset=reportGrandTotalOn()==MSTrue?1:0; rowCount(dataRows()+breakIndex().length()+breakTextColumn().length()+grandTotalOffset); columnCount(numColumns()); breakCount(0); breakTextCount(0); columnPageBreak().removeAll(); rowPageBreak().removeAll(); // breakLeading().removeAll(); pageBreakIndex().removeAll(); breakTextIndex().removeAll(); // initialize table variables x_printScale(1); y_printScale(1); rowHeights().removeAll(); rowHeights().reshape(rowCount()); rowLeadings().removeAll(); rowLeadings().reshape(rowCount()); columnWidths().removeAll(); columnWidths().reshape(columnCount()); int fixedFields=fixedReportColumns()>0?fixedReportColumns():0; numFixedFields(fixedFields pageBreak index // b --> column break text index // t --> break text index // d --> data index // k --> break index // i --> rowHeights index for (unsigned b,p=0,d=0,k=0,i=0;inumRows()) { cp=formatOutput(buffer.removeAll(),d,j); fdata=report()->fontStruct(report()->printFontID(reportFont(d,j))); rowLeadings()[i]=leading(i); int h=rowHeights()(i); rowHeights()[i]=report()->fontSize()>h?report()->fontSize():h; if (cp!=0) { int cw=columnWidths()(j); int w=(int)fdata->textWidth(report()->fontSize(),cp,strlen(cp))+offset; columnWidths()[j]=w>cw?w:cw; } } while (k0&&tbreakTextList().count()&& breakTextField->breakText(b)->style()&PosAbove) { breakTextIndex()<breakText(b)); rowHeights()[i]=rowLeadings()[++i]=0; } else if (breakTextIndex().indexOf(i+1)formatBreak(buffer.removeAll(),k,breakColumn()(k)))!=0) { if (reportTotalOn()==MSTrue&&k==breakColumn().length()-1) { fdata=report()->fontStruct(report()->printFontID(reportTotalFont())); leading=reportTotalLeading(); } else { fdata=report()->fontStruct(report()->printFontID(breakFont(k,breakColumn()(k)))); leading=breakLeading(k,breakColumn()(k)); } int cw=columnWidths()(j); int w=(int)fdata->textWidth(report()->fontSize(),cp,strlen(cp))+offset; columnWidths()[j]=w>cw?w:cw; h=report()->fontSize()+breakOffset(k,breakColumn()(k)); } rowLeadings()[++i]=leading; rowHeights()[i]=(h>rowHeights()(i)?h:rowHeights()(i)); if (breakTextField!=0&&bbreakTextList().count()&& !(breakTextField->breakText(b)->style()&PosAbove)) { breakTextIndex()<breakText(b)); rowHeights()[i]=rowLeadings()[++i]=0; } else if (breakTextIndex().indexOf(i+1)0?newspaperColumns():1; int frameThickness=frameLineWidth()+frameOffset(); unsigned long style=frameStyle(); int frameLeft=style&Box||style&BoxL?frameThickness:0; int frameRight=style&Box||style&BoxR?frameThickness:0; int frameTop=style&Box||style&BoxT?frameThickness:0; int frameBottom=style&Box||style&BoxB?frameThickness:0; tableLeft(report()->bodyLeft()+frameLeft); int w=pageWidth()-(frameLeft+frameRight)*cols; tableRight(tableLeft()+w/cols); tableTop(frameTop); tableBottom(frameBottom*2); } void MSReportTable::computeTableHeadingSize(void) { computeGroupHeadingSize(); int height=0; for (unsigned j=0;jfontStruct(report()->printFontID(field->reportHeadingFont())); for (unsigned i=0;iheading().length();i++) { w=(int)fdata->textWidth(report()->fontSize(),field->heading()(i),field->heading()(i).length()); tw=tw>w?tw:w; h+=report()->fontSize()+leading(0); } columnWidths()[j]=tw; height=h>height?h:height; } } height+=groupHeadingHeight(); headingHeight(height+(height>0?reportHeadingOffset():0)); } void MSReportTable::computeRowColumnPartitions() { computeColumnPartitions(); int columnPageCount=columnPageBreak().length()-1; if (columnPageCount>0) { int estimatedPageCount=rowPageSpan(); int startingPageCount=report()->pageCount(); int startingYpixel=report()->yPixel(); double columnHeight; double heights=rowHeights().sum()+rowLeadings().sum(); // use base pagesize to compute estimated table page count so as not // to trigger computation of headers and footers until an estimated // page count is established. int estimatedPageSize=(int)((report()->bodyTopBase()-report()->bodyBottomBase())/ (report()->uniformScaling()==MSTrue?x_printScale():1)); int tableHeader=tableHeaderHeight(); int tableFooter=tableFooterHeight(); estimatedPageSize-=headingHeight()+tableTop()+tableBottom(); estimatedPageSize-=(int)((tableHeader+tableFooter)/((scaleHeaders()==MSFalse&& report()->uniformScaling()==MSTrue)?x_printScale():1)); columnHeight=heights/newspaperColumns(); // estimate total number of pages for this table to compute the // conditional header/footer sizes for LastPage and IfNextPage if (rowPageSpan()==0) { int actualHeight=(int)columnHeight; if (outputStyle()&Stacked) { actualHeight*=columnPageCount; actualHeight+=(topPixel()+bottomPixel())*columnPageCount; } int remainingHeight=report()->yPixel()-report()->pageEnd(); remainingHeight-=tableHeader+headingHeight()+tableFooter; if (actualHeight>remainingHeight) { double remainingTableHeight=actualHeight-remainingHeight; estimatedPageCount=(int)ceil(remainingTableHeight/estimatedPageSize)+1; } else estimatedPageCount=1; } int newPageTotal=startingPageCount+estimatedPageCount-1; if (newPageTotal>report()->pageCountTotal()) report()->pageCountTotal(newPageTotal); pageCountTotal(estimatedPageCount); computeRowPartitions(startingYpixel,columnHeight); if (report()->uniformScaling()==MSTrue&&y_printScale()report()->pageCountTotal()) report()->pageCountTotal(newPageTotal); if (report()->conditionalPageSize()==MSTrue&&tablePageTotal>0&&tablePageTotal!=estimatedPageCount) { // recompute row partitions using actual page count headerHeights().removeAll(); footerHeights().removeAll(); report()->pageCount(startingPageCount); pageCount(0); _printPage=1; computeRowPartitions(startingYpixel,columnHeight); total=rowPageBreak().length()-2*stackPageBreak().length()-1; tablePageTotal=(int)ceil(total/newspaperColumns()); pageCountTotal(tablePageTotal); } newPageTotal=startingPageCount+tablePageTotal-1; if (newPageTotal>report()->pageCountTotal()) report()->pageCountTotal(newPageTotal); if (report()->uniformScaling()==MSTrue) { if (x_printScale()yPixel(startingYpixel); } else pageCountTotal(0); } void MSReportTable::computeColumnPartitions(void) { int xx,xstart=tableLeft(); unsigned j,actual; columnIndex().removeAll(); columnPageBreak().removeAll(); tableWidths().removeAll(); if (numFixedFields()>0) { xx=xstart; for (int k=0;kuniformScaling()==MSTrue?tableRight()/y_printScale():tableRight()); if (fixedFieldWidth()cancelReportStatus()==MSTrue) return; if (xx+columnWidths()(j)>=partitionWidth||(set>1&&actual==set)||set==1) { if (set>0) { if (set>actual) { set=setyPixel(startPixel_); computeRowPartitions(columnHeight_); int columnPageCount=columnPageBreak().length()-1; if (outputStyle()&Stacked) { for (unsigned i=0;iyPixel()-report()->pageEnd(); int minHeight=orphanRowHeight()+tableHeaderHeight()+tableFooterHeight(); if (minHeight>=remainingHeight) { rowPageBreak()<<0; _pageCount++; _printPage++; report()->yPixel(report()->bodyTop(report()->pageCount())-printHeight()); } computeRowPartitions(columnHeight_); } } } void MSReportTable::computeRowPartitions(double columnHeight_) { unsigned i,k; MSIntVector columnHeights(newspaperColumns(),0); int pageBreakIndexLength=pageBreakIndex().length(); int set=rowsPerPage(0); rowPageBreak()<<0; int actual,height=0,column=0; int tableHeaders=tableHeaderHeight()+tableFooterHeight(); int headers=headingHeight()+tableTop()+tableBottom(); double scale=(report()->uniformScaling()==MSTrue?x_printScale():1); int pageSize=(int)(tablePageSize(0)/scale-headers); pageSize-=(int)(tableHeaders/((scaleHeaders()==MSFalse)?scale:1)); // compute the breakText sizes with using the new x-scale computed with the // above column partitions. If the row partitions produce a smaller scale and uniform // scaling is enabled the text will not completely fill the cell. computeBreakTextSizes(); MSBoolean evenColumns=numRows()%newspaperColumns()==0?MSTrue:MSFalse; for (actual=0,k=0,i=0;icancelReportStatus()==MSTrue) return; int rowHeight=rowHeights()(i)+rowLeadings()(i); columnHeights[column]+=rowHeight; height+=rowHeight; if (set==0&&kpageCountIncrement(); pageSize=(int)(tablePageSize(rowPageBreak().length()-1)/scale-headingHeight()); // (report()->uniformScaling()==MSTrue?x_printScale():1); pageSize-=(int)((tableHeaderHeight()+tableFooterHeight())/((scaleHeaders()==MSFalse)?scale:1)); } } int heightOffset=evenColumns==MSTrue?0:rowHeights()(i); if (height-rowLeadings()(i)>pageSize||(set>0&&actual==set)|| (columncolumnHeight_+heightOffset)) { if (set>0) { if (set>actual) { set=setpageCountIncrement(); pageSize=(int)(tablePageSize(rowPageBreak().length()-1)/scale-headingHeight()); pageSize-=(int)((tableHeaderHeight()+tableFooterHeight())/((scaleHeaders()==MSFalse)?scale:1)); } } } report()->yPixel(report()->yPixel()-height+headers); rowPageBreak()<pageCount(); int ystart=column_>=newspaperColumns()||report()->yPixel()<=tableBottomPosition(pc)? tableTopPosition(pc):report()->yPixel(); return ystart-tableBottomPosition(pc); } int MSReportTable::setTableX(int x_,int i_) { int cw=columnWidths()(i_); int tabStop=report()->tabStop(i_+1); int x=x_+cw+reportColumnSpacing(i_); if (tabStop!=0&&tabStop>x_&&(tabStop+cw)tabStop(i_+2)!=0&&(tabStop+cw)>report()->tabStop(i_+2)) tabStop=x; } else tabStop=x; return tabStop; } int MSReportTable::setTableY(int y_,int i_) { return y_-=rowHeights()(i_)+rowLeadings()(i_); } int MSReportTable::columnsPerPage(int page_) { int span,cols=0; if ((span=columnPageSpan())>0) { cols=(numColumns()-numFixedFields())/span+numFixedFields(); if (page_==span-1) cols+=(numColumns()-numFixedFields())%span; } else if (columnControl().length()>0) { if (page_0) { rows=rowCount()/span; if (page_==span-1) rows+=rowCount()%span; } else if (rowControl().length()>0) { if (page_0) { } return rows; } int MSReportTable::leading(int row_) { int spacing=2; if (leading().length()>0) { spacing=leading()(row_%leading().length()); } return spacing; } int MSReportTable::reportColumnSpacing(int column_) { double spacing=0.25;//defaultColumnSpacing(); if (reportColumnSpacing().length()>0) { spacing=reportColumnSpacing()(column_%reportColumnSpacing().length()); } return (int)(spacing*MSPointsPerInch); } int MSReportTable::computeTableSegmentHeight(int rs_,int re_) { int header=tableHeaderHeight()+tableFooterHeight(); double scale=scaleHeaders()==MSTrue?y_printScale():1.0; int h=headingHeight()+tableTop()+tableBottom(); for (unsigned i=rs_;ibodyTop(report()->pageCount())-printHeight(); int bottom=report()->bodyBottom(report()->pageCount()); double scale=(scaleHeaders()==MSTrue)?x_printScale():1.0; for (unsigned i=0,n=headerList().count();iprintOnPage(*header(i),pageCount_,pageCountTotal())==MSTrue) { if (header(i)->printFont().length()==0) header(i)->printFont(report()->defaultFont()); double h=header(i)->computePrintSize(report(),0,top,(int)(pageWidth()/scale),0,0,4); if (top-height-hbodyTop(report()->pageCount())-printHeight(); int bottom=report()->bodyBottom(report()->pageCount()); double scale=(scaleHeaders()==MSTrue)?y_printScale():1.0; for (unsigned i=0,n=footerList().count();iprintOnPage(*footer(i),pageCount_,pageCountTotal())==MSTrue) { // just in case this method is called before the headers method int hh=pageCount_printFont().length()==0) footer(i)->printFont(report()->defaultFont()); double h=footer(i)->computePrintSize(report(),0,top,(int)(pageWidth()/scale),0,0,4); if (top-hh-height-htabStop(0)>tableLeft()?report()->tabStop(0):tableLeft()); for (unsigned i=0;ipageFrameLineWidth()+report()->pageFrameOffset(); int offset=frameThickness+pageFrameThickness; int w=(int)(pageWidth()/x_printScale()/newspaperColumns()); w-=2*offset; breakText_.computePrintSize(report(),0,0,w-x+tableLeft(),0,0,offset); } void MSReportTable::computeBreakTextSizes(void) { if (breakTextList()!=0) { for (unsigned i=0;icount();i++) { computeBreakTextSize(*breakText(i)); rowHeights()[breakTextIndex()(i)]=breakText(i)->height(); } } } void MSReportTable::computePageIndices(int i_,int& ri_,int& ci_) { if (stackPageBreak().length()>0) { ci_=0; if (stackCount()=stackPageBreak()(stackCount())) { rowoffset=stackCount()+1; coloffset=stackCount()+1; } ri_=i_+rowoffset; ci_=coloffset; } else ri_=i_; } else { if (outputStyle()==RowMajor) { int pageCountRow=rowPageBreak().length()-1; ri_=i_>=pageCountRow?i_%pageCountRow:i_; ci_=(int)i_/pageCountRow; } else { int pageCountCol=columnPageBreak().length()-1; ci_=i_>=pageCountCol?i_%pageCountCol:i_; ri_=(int)i_/pageCountCol; } } } int MSReportTable::tableTopPosition(int pageCount_) { return report()->bodyTop(pageCount_)-tableTop()-printHeight(); } int MSReportTable::tableBottomPosition(int pageCount_) { return report()->bodyBottom(pageCount_)+tableBottom(); } void MSReportTable::printTableHeaders(int x_,int y_) { report()->bodyBottom(report()->pageCount()+currentPage()); //pageCount()); int top=report()->bodyTop(report()->pageCount())-printHeight(); double scale=(scaleHeaders()==MSTrue)?x_printScale():1.0; for (unsigned i=0;iprintOnPage(*header(i),_printPage,pageCountTotal())==MSTrue) { int bottom=report()->pageEnd(); report()->pageEnd((int)(bottom-report()->bodyTopBase()/y_printScale())); header(i)->computePrintSize(report(),0,top,(int)(pageWidth()/scale),0,0,4); y_-=header(i)->print(report(),x_,y_,0,0,0,0); report()->pageEnd(bottom); } } } void MSReportTable::printTableFooters(int x_,int y_) { report()->bodyBottom(report()->pageCount()+currentPage()); int top=report()->bodyTop(report()->pageCount())-printHeight(); double scale=(scaleHeaders()==MSTrue)?x_printScale():1.0; for (unsigned i=0;iprintOnPage(*footer(i),_printPage,pageCountTotal())==MSTrue) { int bottom=report()->pageEnd(); report()->pageEnd((int)(bottom-report()->bodyTopBase()/y_printScale())); footer(i)->computePrintSize(report(),0,top,(int)(pageWidth()/scale),0,0,4); y_-=footer(i)->print(report(),x_,y_,0,0,0,0); report()->pageEnd(bottom); } } } int MSReportTable::printTableSegment(int x_,int y_) { int height=0,cols,segmentTotal=rowPageBreak().length()-1; cols=columnPageBreak().length()-1; if(cols >1) segmentTotal*=cols; segmentTotal*=newspaperColumns(); if (segmentTotal>0) { int ri,ci; report()->pout<<"gs "<postScriptStackInit(); int frameThickness=frameLineWidth()+frameOffset(); unsigned long style=frameStyle(); int frameLeft=style&Box||style&BoxL?frameThickness:0; int frameRight=style&Box||style&BoxR?frameThickness:0; int w=tableWidths()(0)+frameLeft+frameRight; int x=x_>=report()->leftPixel()?x_-report()->leftPixel():x_; int pageWidth=report()->bodyRight()-report()->bodyLeft(); int pageSize=(int)((report()->bodyTop(report()->pageCount())-report()->bodyBottom(report()->pageCount())-printHeight())/y_printScale()); int tableWidth=(int)columnWidths().sum(); double scale=scaleHeaders()==MSTrue?y_printScale():1.0; if(scaleHeaders()==MSTrue) { int off=x_!=0?x_:report()->leftPixel(); report()->translateScale(x_printScale(),y_printScale(),off,y_); printTableHeaders(x,y_); report()->pout<<"gr "<=1&&tableWidth2?frameLeft*(newspaperColumns()-1):0; int margin=_pageWidth-w1-offset; if(margin<0)margin=0; x=justification()&MSRight?x+margin-frameRight: justification()&MSCenter?x+margin/2:x; } report()->translate(x,(y_-report()->bodyTop(report()->pageCount())+printHeight())*y_printScale()); report()->translateScale(x_printScale(),y_printScale(),report()->leftPixel(),y_-(scaleHeaders()==MSFalse?tableHeaderHeight():0)); int rowsOffset=reportGrandTotalOn()==MSTrue?1:0; for (unsigned j=0;jh?height:h; } height=height>pageSize?pageSize:height; for (unsigned i=0;i0) translate(w/table_->x_printScale()+frameLeft,0); if (segment()%newspaperColumns()>0) report()->translate(w+frameLeft,0); if (numFixedFields()>0) { printTableHeadings(0,numFixedFields()); printTableRows(rowPageBreak()(ri),0,rowPageBreak()(ri+1),numFixedFields()); } printTableHeadings(columnPageBreak()(ci),columnPageBreak()(ci+1)); printTableRows(rowPageBreak()(ri),columnPageBreak()(ci), rowPageBreak()(ri+1),columnPageBreak()(ci+1)); printTableFrame(tableLeft(), tableTopPosition(report()->pageCount())-tableHeaderHeight(), _pageWidth, (int)(height-(tableHeaderHeight()+tableFooterHeight())*scale)); _segment++; } report()->pout<<"gr "<leftPixel(); report()->translateScale(x_printScale(),y_printScale(),off,y_); printTableFooters(x,y_); report()->pout<<"gr "<postScriptStackInit(); report()->fontID(INT_MAX); } return height; } void MSReportTable::printTableHeadings(int cs_,int ce_) { int xx=report()->tabStop(0)>tableLeft()?report()->tabStop(0):tableLeft(); if (cs_>=numFixedFields()) { xx+=fixedFieldWidth(); printGroupHeadings(cs_,ce_); } int h=headingHeight()-reportHeadingOffset()-groupHeadingHeight(); int ystart=tableTopPosition(report()->pageCount())-tableHeaderHeight()-groupHeadingHeight(); for (unsigned j=cs_;jformatStyle(field->headingStyle()); report()->bgGrayScale(field->headingBgGrayScale()); report()->fgGrayScale(field->headingFgGrayScale()); Font fid=report()->printFontID(field->reportHeadingFont()); MSPrintFontData *fdata=report()->fontStruct(fid); report()->gcValues().font=fid; report()->gcValues().line_width=0; // report()->gcValues().foreground=field->headingForeground(); if (report()->gcValues().font==0) report()->fontSize(report()->defaultFontSize()); int yy=ystart-report()->fontSize(); int textHeight=(report()->fontSize()+leading(0))*field->heading().length(); int y=MSTop&style?0:MSBottom&style?h-textHeight:(h-textHeight)/2; printCellBox(style,xx,ystart,h,j); for (unsigned i=0;iheading().length();i++) { int w=(int)fdata->textWidth(report()->fontSize(),field->heading()(i),field->heading()(i).length()); int cs=reportColumnSpacing(j)/2; int cw=columnWidths()(j)+reportColumnSpacing(j); int x=style&Cell?0:MSLeft&style?cs:MSRight&style?cw-w-cs:((cw-w)/2); report()->printReportString(style,xx+x,yy-y,field->heading()(i),field->heading()(i).length()); yy-=report()->fontSize()+leading(0); } xx=columnIndex()(j); } } } void MSReportTable::printTableRows(int rs_,int cs_,int re_,int ce_) { MSPrintFontData *fdata; int w,x,yy; unsigned d,i,k,t; unsigned long styles; const char *cp; Font fid; MSRect tb; int xx=report()->tabStop(0)>tableLeft()?report()->tabStop(0):tableLeft(); if (cs_>=numFixedFields()) xx+=fixedFieldWidth(); unsigned breakIndexLength=breakIndex().length(); unsigned breakTextIndexLength=breakTextIndex().length(); MSString buffer; int count=breakTextCount(); for (unsigned j=cs_;jpageCount())-tableHeaderHeight()-headingHeight(); int cs=reportColumnSpacing(j)/2; int cw=columnWidths()(j)+reportColumnSpacing(j); tb.height(0); tb.width(cw); if (field!=0&&jnumRows(); for (t=breakTextCount(),i=rs_,k=breakCount(),d=rs_-k-t;icount&&lastPageCount()!=_printPage) { count++; printBreakText(*text,yy); } yy-=rowHeights()(i)+rowLeadings()(i),i++; } else { t++; yy-=rowHeights()(i)+rowLeadings()(i),i++; } } if (reportTotalOn()==MSTrue&&k==breakColumn().length()-1) { fid=report()->printFontID(reportTotalFont()); styles=report()->formatStyle(reportTotalStyle()); } else if (kprintFontID(breakFont(k,breakColumn()(k))); styles=report()->formatStyle(breakStyle(k,breakColumn()(k))); } if (kfontStruct(fid); if (field->suppressDuplicate()!=MSTrue) { report()->fgGrayScale(reportColumn(breakColumn()(k))->breakFgGrayScale((unsigned)k)); report()->bgGrayScale(reportColumn(breakColumn()(k))->breakBgGrayScale((unsigned)k)); } int h=rowHeights()(i)+rowLeadings()(i); printCellBox(field->suppressDuplicate()!=MSTrue?styles:(styles&~Box),xx,yy,h,j); if ((cp=field->formatBreak(buffer.removeAll(),k,breakColumn()(k)))!=0) { report()->gcValues().font=fid; // report()->gcValues().foreground=field->foreground(); w=(int)fdata->textWidth(report()->fontSize(),cp,strlen(cp)); x=styles&Cell?0:MSLeft&styles?cs:MSRight&styles?cw-cs-w:((cw-w)/2); report()->printReportString(styles,xx+x,yy-report()->fontSize(),cp,strlen(cp)); } k++; yy-=rowHeights()(i)+rowLeadings()(i),i++; } tb.height(tb.y()-yy); } if (reportGrandTotalOn()==MSTrue&&i==(rowCount()-1)) { i++; if (lastPageCount()!=_printPage&&grandTotalBaseText().text().length()>0) { printBreakText(grandTotalBaseText(),yy); } } if (iprintFontID(reportFont(d,j)); fdata=report()->fontStruct(fid); styles=report()->formatStyle(style(d,j)); report()->bgGrayScale(bgGrayScale(d,j)); report()->fgGrayScale(fgGrayScale(d,j)); int h=rowHeights()(i)+rowLeadings()(i); printCellBox(field->suppressDuplicate()!=MSTrue?styles:(styles&~Box),xx,yy,h,j); if (i==rs_||field->suppressDuplicate()!=MSTrue||field->isDuplicate(d)!=MSTrue) { if (tb.height()>0&&field->suppressDuplicate()==MSTrue&&styles&Box) { printCellBox(styles,tb.x(),tb.y(),tb.height(),j); } tb.x(xx); tb.y(yy); if (dgcValues().font=fid; // report()->gcValues().foreground=field->foreground(); w=(int)fdata->textWidth(report()->fontSize(),cp,strlen(cp)); x=styles&Cell?0:MSLeft&styles?cs:MSRight&styles?cw-cs-w:((cw-w)/2); report()->printReportString(styles,xx+x,yy-report()->fontSize(),cp,strlen(cp)); } } yy-=rowHeights()(i)+rowLeadings()(i); tb.height(tb.y()-yy); } } if (tb.height()>0&&field->suppressDuplicate()==MSTrue&&field->style()&Box) { printCellBox(field->style(),tb.x(),tb.y(),tb.height(),j); } xx=columnIndex()(j); } lastPageCount(_printPage); //?? report()->pageCount()); } report()->pageFrameExtent(xx); if (cs_>=numFixedFields()) breakCount(re_!=rowCount()?k:0); if (cs_>=numFixedFields()) breakTextCount(re_!=rowCount()?t:0); } void MSReportTable::printTableFrame(int x_,int y_,int w_,int h_) { if (frameStyle()&(Box|BoxL|BoxR|BoxT|BoxB)) { report()->gcValues().line_width=frameLineWidth(); int frameThickness=frameLineWidth()+frameOffset(); unsigned long style=frameStyle(); int frameLeft=style&Box||style&BoxL?frameThickness:0; int frameTop=style&Box||style&BoxT?frameThickness:0; int frameBottom=style&Box||style&BoxB?frameThickness:0; // double x=table()->tableLeft()-frameLeft; // double y=tableTop(pageCount())+frameTop-table()->headerHeights; double x=x_-frameLeft; double y=y_+frameTop; double h=(h_+frameTop+frameBottom)/y_printScale(); double w=(w_-frameLeft)/x_printScale(); w/=newspaperColumns(); int w1=report()->pageFrameExtent()-tableLeft()+frameOffset()+2; if (frameStyle()&MSCenter&&w10) w=w1; report()->printBox(frameStyle(),x,y,w,h); } } void MSReportTable::printBreakText(MSParagraph& breakText_,int y_) { int x=(report()->tabStop(0)>tableLeft()?report()->tabStop(0):tableLeft()); for (unsigned i=0;ipageFrameLineWidth()+report()->pageFrameOffset(); int offset=frameThickness+pageFrameThickness; w-=2*offset; if (report()->printOnPage(breakText_,_printPage,pageCountTotal())==MSTrue) { int bottom=report()->pageEnd(); report()->pageEnd((int)(bottom-report()->bodyTopBase()/y_printScale())); breakText_.print(report(),x,y_,w-x+tableLeft(),0,0,offset); breakText_.computePrintSize(report(),0,0,w-x+tableLeft(),0,0,offset); report()->pageEnd(bottom); } } void MSReportTable::printASCIITable(void) { const char *cp; unsigned i,j; unsigned long styles; MSIntVector cw; MSString pad; int lastColumn=numColumns()-1; int w,len,headingRows=0; const char *quotes=outputStyle()&Quoted?"\"":""; // compute the number of heading rows for (j=0;jheading().length(); headingRows=headingRows>rows?headingRows:rows; } } // compute the column widths for the aligned mode if (outputStyle()&Aligned) { MSString buffer; for (j=0;jheading().maxLength(); cw[j]=w>cw(j)?w:cw(j); } for (i=0;inumRows();i++) { formatOutput(buffer.removeAll(),i,j); if (buffer.length()>0) { w=buffer.length(); cw[j]=w>cw(j)?w:cw(j); } } } } } // print the column headings if ((outputStyle()&NoHeadings)==0) { MSStringVector headings(headingRows); for (j=0;jformatStyle(field->headingStyle()); for (unsigned k=0;kheading().length()) { cp=field->heading()(k).string(); len=field->heading()(k).length(); } else { cp=0; len=0; } if (outputStyle()&Aligned) { pad=MSString::copy(" ",cw(j)-len); if (styles&MSRight) headings[k]<pout<numRows()) { styles=report()->formatStyle(field->style()); if (field->format().formatType()==MSFormat::Float&&report()->asciiFloatFormat()!=0) { MSFloat::MSFloatFormat format=field->format().floatFormat(); unsigned long modifier=field->format().formatModifier(); field->format().formatModifier(MSFormat::NoModifier); field->format().format(report()->asciiFloatFormat()); formatOutput(buffer.removeAll(),i,j); field->format().format(format); field->format().formatModifier(modifier); } else if (field->format().formatType()==MSFormat::Int&&report()->asciiIntFormat()!=0) { MSInt::MSIntFormat format=field->format().intFormat(); unsigned long modifier=field->format().formatModifier(); field->format().formatModifier(MSFormat::NoModifier); field->format().format(report()->asciiIntFormat()); formatOutput(buffer.removeAll(),i,j); field->format().format(format); field->format().formatModifier(modifier); } else formatOutput(buffer.removeAll(),i,j); if (outputStyle()&Quoted&&field->valueQuoted()==MSTrue) { buffer.insert("\"",0)<<"\""; } len=buffer.length(); if (outputStyle()&Aligned) pad=MSString::copy(" ",cw(j)-len); if (styles&MSRight) report()->pout<pout<pout<pout<gcValues().foreground=report()->lineColor(); int cw=Cell&mask_?columnWidths()(j_):columnWidths()(j_)+reportColumnSpacing(j_); int w=Cell&mask_?cw:report()->tabStop(j_+1)>x_?report()->tabStop(j_+1)-x_:cw; w=wtableRight()) w=tableRight()-x_; if (report()->bgGrayScale()<1.) report()->fillRectangle(x_,y_,w,h_); report()->printBox(mask_,x_,y_,w,h_); } void MSReportTable::computeGroupHeadingSize(void) { MSParagraph *heading; MSIntVector rows; if (groupHeadingList()!=0) { sortGroupHeadingsByColumn(); for (unsigned k=0;kcount();k++) { if ((heading=groupHeading(k))!=0&&heading->text().length()>0) { int h =heading->computePrintSize(report(),0,report()->y_org(),report()->x_end(),0,0,2); unsigned j; for (j=0;jrow()) break; if (j==rows.length()) { rows<row(); groupHeadingHeights()<<(h-(heading->row()==0?heading->topPixel():0)); } else if (h>groupHeadingHeights()(j)) { groupHeadingHeights()[j]=h; } } } groupHeadingHeight((int)(groupHeadingHeights().sum())); } } void MSReportTable::sortGroupHeadingsByColumn(void) { unsigned i,j,k,min,row=0; int c,minCol,count=groupHeadingList()->count(); MSIntVector columns; // sort by column for (i=0;icolumn(); groupHeading(i)->row(0); // initialize the rows for (min=i,j=i+1;jcolumn())>=0&&cminCol)) { min=j; minCol=c; } } groupHeadingList()->exchange(min,i); minCol=groupHeading(i)->column(); if ((columns.length()==0||columns.indexOf(minCol)==columns.length())&&minCol>=0) columns<column()==col) { int minSpan=groupHeading(j)->columnSpan(); for (min=j,k=j+1;kcolumn()==col) { if ((span=groupHeading(k)->columnSpan())exchange(min,j); } } } } } } // first pass at setting the rows using only the starting column int maxRows=0; for (i=0;icolumn()==column) groupHeading(j)->row(row++); maxRows=row>maxRows?row:maxRows; } for (i=0;irow())==i) { if (groupHeading(j)->column()<=span) { groupHeading(j)->row(++row); maxRows=row>maxRows?row:maxRows; } else span=groupHeading(j)->column()+groupHeading(j)->columnSpan()-1; } } } sortTextListByRow(*groupHeadingList()); } void MSReportTable::sortTextListByRow(MSPointerArray& list_) { for (int i=0;irow()row()) min=j; list_.exchange(min,i); } } void MSReportTable::printGroupHeadings(int cs_,int ce_) { // this is a hack for now // needs to use MSParagraph computeSize and print methods MSParagraph *heading; if (groupHeadingList()!=0) { MSIntVector *columnsPerRow=new MSIntVector[groupHeadingHeights().length()]; for (unsigned k=0;kcount();k++) { int xx=report()->tabStop(0)>tableLeft()?report()->tabStop(0):tableLeft(); if ((heading=groupHeading(k))!=0/*&&heading->outputText().length()>0*/) { int column=heading->column(); int span=column+heading->columnSpan(); for (int c=cs_;c=column&&crow()]<=cs_&&column<=ce_)||span>cs_)) { int index=(spanpageCount())-tableHeaderHeight()-groupHeadingHeight(); for (unsigned r=0;rrow()+1;r++) ystart+=groupHeadingHeights()(r); if (column>cs_) { xx=columnIndex()(column-1); } else { xx+=fixedFieldWidth(); span-=cs_; } int cs=reportColumnSpacing(column)/2; int cw=columnIndex()(index)-xx; int tableRight=columnIndex()(ce_-1); if (xx+cw>tableRight||index>=ce_) cw=tableRight-xx; report()->bgGrayScale(heading->bgGrayScale()); report()->fgGrayScale(heading->fgGrayScale()); unsigned long style=report()->formatStyle(heading->style()); MSPrintFontData *fdata=report()->fontStruct(heading->fontID()); report()->fontSize(heading->fontSize()); report()->gcValues().font=heading->fontID(); report()->gcValues().line_width=0; int yy=(int)(ystart-fdata->fontOffset(report()->fontSize())); // int yy=ystart-fontSize(); int textHeight=heading->height(); int h=groupHeadingHeights()(heading->row()); int y=MSTop&style?0:MSBottom&style?h-textHeight:(h-textHeight)/2; if (style&Box||style>BoxL) { int i,leftHeight=h,rightHeight=h; for (i=heading->row()-1;i>=0;i--) { if (columnsPerRow[i].indexOf(column)==columnsPerRow[i].length()) { leftHeight+=groupHeadingHeights()(i); } if (columnsPerRow[i].indexOf(span-1)==columnsPerRow[i].length()) { rightHeight+=groupHeadingHeights()(i); } } printGroupHeadingBox(style,xx,ystart,cw,leftHeight,rightHeight); } for (int w=0,n=0,i=0;ioutputText().length();i++) { const char *cp=heading->outputText()(i); for (;woutputText()(i).length();n++) w+=(int)fdata->textWidth(report()->fontSize(),cp+n,1); if (w>cw) w-=(int)fdata->textWidth(report()->fontSize(),cp+(--n),1); int x=MSLeft&style?cs:MSRight&style?cw-w-cs:((cw-w)/2); report()->printReportString(style,xx+x,yy-y,cp,n); yy-=heading->fontSize()+heading->leading(); } } } } delete [] columnsPerRow; } } void MSReportTable::printGroupHeadingBox(unsigned long mask_,int x_,int y_,int w_,int lh_,int rh_) { // report()->gcValues().foreground=report()->lineColor(); int h=lh_bgGrayScale()<1.) report()->fillRectangle(x_,y_,w_,h); if (Box&mask_&&lh_==rh_) report()->strokeRectangle(x_,y_,w_,h); else { report()->setAttributes(); if (BoxL&mask_||Box&mask_) report()->printLine(x_,y_,x_,y_-lh_); if (BoxR&mask_||Box&mask_) report()->printLine(x_+w_,y_,x_+w_,y_-rh_); if (BoxT&mask_||Box&mask_) report()->printLine(x_,y_,x_+w_,y_); if (BoxB&mask_) report()->printLine(x_,y_-h,x_+w_,y_-h); } } aplus-fsf-4.22/src/MSGUI/MSRowColumnView.C0000644000265000001440000012567610772770412013645 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include static const unsigned DefaultScrollBarSize=15; static const char *DefaultSelectedRowBackground="lightsteelblue3"; static const unsigned long MSRowColumnViewDefaultCycleInterval=1000; static const unsigned long MSRowColumnViewEventMask=(ButtonPressMask|ButtonReleaseMask|ExposureMask); static const int MSRowColumnViewDefaultRowSpacing=2; static const int MSRowColumnViewDefaultColumnSpacing=2; #ifdef MS_NO_INLINES #include #endif typedef void (MSRowColumnView::*PMFV)(void); typedef struct { char *_pString; PMFV _func; } Translations; typedef MSKeyClassCallback KT; static Translations KeyTable[]= { { "!F29", &MSRowColumnView::pageUp }, { "Ctrlu", &MSRowColumnView::pageUp }, { "Prior", &MSRowColumnView::pageUp }, { "!F35", &MSRowColumnView::pageDown }, { "Ctrld", &MSRowColumnView::pageDown }, { "Next", &MSRowColumnView::pageDown }, { "!F27", &MSRowColumnView::home }, { "Home", &MSRowColumnView::home }, { "!R13", &MSRowColumnView::end }, { "End", &MSRowColumnView::end }, { "Up", &MSRowColumnView::up }, { "Ctrlp", &MSRowColumnView::up }, { "!Down", &MSRowColumnView::down }, { "Ctrln", &MSRowColumnView::down }, { "Right", &MSRowColumnView::right }, { "Ctrlf", &MSRowColumnView::right }, { "Left", &MSRowColumnView::left }, { "Ctrlb", &MSRowColumnView::left }, { "KP_Add", &MSRowColumnView::increment }, { "KP_Subtract", &MSRowColumnView::decrement }, { "F24", &MSRowColumnView::decrement }, { "~Ctrl~Shift MetaInsert", &MSRowColumnView::insertBelow }, { "~Ctrl~Shift MetaKP_0", &MSRowColumnView::insertBelow }, { "~Ctrl Shift MetaInsert", &MSRowColumnView::insertAbove }, { "~Ctrl Shift MetaKP_0", &MSRowColumnView::insertAbove }, { "Insert", &MSRowColumnView::edit }, { "~Ctrl~Shift MetaDelete", &MSRowColumnView::deleteKey }, { "~Ctrl~Shift MetaKP_Decimal",&MSRowColumnView::deleteKey }, { "BackSpace", &MSRowColumnView::backspace }, { "~Meta~Ctrl~ShiftTab", &MSRowColumnView::tab }, { "~Meta~Ctrl ShiftTab", &MSRowColumnView::shiftTab }, { "Return", &MSRowColumnView::returnKey }, { "KP_Enter", &MSRowColumnView::returnKey }, { 0,0 } }; MSRowColumnView::Editor::Editor(MSWidget *owner_) : MSTextField(owner_) { _highlightThickness=0; _shadowThickness=2; margin(0); color(owner()->background(),owner()->foreground()); } MSRowColumnView::Editor::~Editor(void) {} void MSRowColumnView::Editor::up(void) { ((MSRowColumnView *)owner())->up(); } void MSRowColumnView::Editor::down(void) { ((MSRowColumnView *)owner())->down(); } void MSRowColumnView::Editor::tab(void) { ((MSRowColumnView *)owner())->tab(); } void MSRowColumnView::Editor::shiftTab(void) { ((MSRowColumnView *)owner())->shiftTab(); } void MSRowColumnView::Editor::activate(void) { ((MSRowColumnView *)owner())->editorActivate(); } void MSRowColumnView::Editor::escape(void) { ((MSRowColumnView *)owner())->unmapEditor(); } MSRowColumnView::Hsb::Hsb(MSWidget *owner_) : MSHScrollBar(owner_) { inc(1); pageInc(1); _highlightThickness=0; acceptFocus(MSFalse); height(DefaultScrollBarSize); } MSRowColumnView::Vsb::Vsb(MSWidget *owner_) : MSVScrollBar(owner_) { inc(1); _highlightThickness=0; acceptFocus(MSFalse); width(DefaultScrollBarSize); } void MSRowColumnView::Hsb::change(void) { ((MSRowColumnView *)owner())->hsbValueUpdate(); } void MSRowColumnView::Vsb::change(void) { ((MSRowColumnView *)owner())->vsbValueUpdate(); } MSRowColumnView::Panner::Panner(MSWidget *owner_) : MSPrimitive(owner_) { _shadowThickness=2; _highlightThickness=0; backingStore(WhenMapped); shadowStyle(MSEtchedIn); } MSRowColumnView::Panner::~Panner(void) {} void MSRowColumnView::Panner::redraw(void) { drawShadow(); } void MSRowColumnView::Panner::expose(const XEvent *pEvent_) { if (pEvent_->xexpose.count==0) { XEvent aEvent; while (XCheckWindowEvent(display(),window(),ExposureMask,&aEvent)==True); ((MSRowColumnView *)owner())->redrawImmediately(); } } MSRowColumnView::CycleTimer::CycleTimer(MSRowColumnView *array_,unsigned long ival_): MSIntervalTimer(ival_) { _array=array_; } MSRowColumnView::CycleTimer::~CycleTimer(void) {} void MSRowColumnView::CycleTimer::process(void) { _array->processCycleTimer(); } MSRowColumnView::MSRowColumnView(MSWidget *owner_,const char *title_) : MSCompositeText(owner_) { _label=0; _label=new MSLabel(this,title_); init(); } MSRowColumnView::MSRowColumnView(MSWidget *owner_,const MSStringVector& title_) : MSCompositeText(owner_) { _label=0; _label=new MSLabel(this,title_); init(); } MSRowColumnView::~MSRowColumnView(void) { // delete all created and stored objects selectInput(); // do not want expose events when destroying subwindows removeAllCycles(); if (dragRowWindow()!=0) XDestroyWindow(display(),dragRowWindow()); if (dragRowCursor()!=0) delete _dragRowCursor; if (vsb()!=0) safeDestroy(_vsb); if (hsb()!=0) safeDestroy(_hsb); if (panner()!=0) safeDestroy(_panner); if (label()!=0) safeDestroy(_label); if (editor()!=0) safeDestroy(_editor); if (redrawPixmap()!=0) delete _redrawPixmap; if (cycleTimer()!=0) delete _cycleTimer; } void MSRowColumnView::init(void) { //Widget attributes _shadowThickness=0; _highlightThickness=2; _acceptTab=MSTrue; //Set default values for attributes _rows=5; _columns=2; _firstRow=0; _firstColumn=0; _spacing=0; _selectedRow=-1; _selectionMode=MSSingle; _rowBg=server()->pixel(DefaultSelectedRowBackground); _cycleMode=MSForeground; _cycleInterval=MSRowColumnViewDefaultCycleInterval; //Set implementation data member _hsb=0; _vsb=0; _panner=0; _editor=0; _redrawPixmap=0; _naturalRows=5; _naturalCols=2; _rowSpacing=MSRowColumnViewDefaultRowSpacing; _columnSpacing=MSRowColumnViewDefaultColumnSpacing; _sizeState=Invalid; _scrollBarState=VsbEnabled|HsbEnabled; _cycleTimer=0; _rowHeight=textHeight()+(2*rowSpacing()); _headingsHeight=0; _lastBlock=-1; _rowDragDrop=MSFalse; _dragRowWindow=0; _dragRowCursor=0; initHsb(); initVsb(); _panner=new Panner(this); _editor=new Editor(this); _redrawPixmap=new MSBackingStorePixmap(server(),"MSGeneral"); XGCValues values; values.foreground=selectedRowBackground(); _selectionVectorMSGC.setGCValues(server(),MSTrue,&values,GCForeground); _title=label()->label(); label()->dynamic(MSTrue); if (label()->columns()>0) label()->map(); panner()->map(); initKeyTranslations(); selectInput(MSRowColumnViewEventMask); freeze(); addToFocusList(); } void MSRowColumnView::initKeyTranslations(void) { if (MSKeyTranslationTable::keyTableData("MSRowColumnView")==MSFalse) { keyTranslationTable()->addKeyTableData("MSRowColumnView"); int i=0; KT *entry=0; while (KeyTable[i]._pString!=0) { entry = new KT(KeyTable[i]._func ); keyTranslationTable()->addCallback(KeyTable[i]._pString,entry,"MSRowColumnView"); i++; } } else keyTranslationTable()->addKeyTableData("MSRowColumnView"); } void MSRowColumnView::initHsb(void) { if (hsb()==0) _hsb=new Hsb(this); } void MSRowColumnView::initVsb(void) { if (vsb()==0) _vsb=new Vsb(this); } // All the Translated Key Methods void MSRowColumnView::pageUp(void) { if (firstRow()!=0) { clearSelection(); firstRow(firstRow()-(rows()-1)); if (selectionMode()==MSMultiple) { lastBlock(firstRow()+rows()-1); _selectionVector.append(firstRow()+rows()-1); } selectedRow(firstRow()+rows()-1); } } void MSRowColumnView::pageDown(void) { if (rows()0) { int newRow=selectedRow()-1; clearSelection(); if (selectionMode()==MSMultiple) { lastBlock(newRow); _selectionVector.append(newRow); } selectedRow(newRow); } } } void MSRowColumnView::down(void) { if (editorActivate()==MSTrue) { if (selectedRow()0) { clearSelection(); if (selectionMode()==MSMultiple) { lastBlock(selectedRow()); _selectionVector.append(selectedRow()); } firstColumn(firstColumn()-1); } } } void MSRowColumnView::right(void) { if (editorActivate()==MSTrue) { if (firstColumn()+columns()-1mapped()==MSFalse) { editor()->string(""); moveEditorToSelection(MSString()); } } void MSRowColumnView::doubleClick(void) {} void MSRowColumnView::insertBelow(void) { activateCallback(MSWidgetCallback::insertbelow); } void MSRowColumnView::insertAbove(void) { activateCallback(MSWidgetCallback::insertabove); } void MSRowColumnView::deleteKey(void) { activateCallback(MSWidgetCallback::deleterow); } void MSRowColumnView::edit(void) { if (editor()->mapped()==MSFalse) { editor()->editMode(MSTextField::InsertMode); moveEditorToSelection(selection()); } } // End of Translated Key Methods MSBoolean MSRowColumnView::editorActivate(void) {return MSFalse;} MSString MSRowColumnView::selection(void) {return MSString();} void MSRowColumnView::print(const char *file_) { MSBoolean fileOpen=MSFalse; MSBoolean open=MSTrue; MSApplicationBusy busy; if (outputMode()==Draw) { if (file_!=0) displayPrintFileName(file_); if ((open=displayPrintOpen(this))==MSTrue) { fileOpen=MSTrue; outputMode(Print); displayPrintXorigin(0); displayPrintYorigin(0); } } if (open==MSTrue) { clear(); if (label()->mapped()==MSTrue) { displayPrintOriginInc(label()); label()->print(); displayPrintOriginDec(label()); } displayPrintOriginInc(panner()); redrawImmediately(); displayPrintOriginDec(panner()); if (fileOpen==MSTrue) { displayPrintClose(); outputMode(Draw); } } } void MSRowColumnView::expose(const XEvent *pEvent_) { if (pEvent_->xexpose.count==0) { XEvent aEvent; while (XCheckWindowEvent(display(),window(),ExposureMask,&aEvent)==True); if (highlighted()==MSTrue) drawHighlight(); } } void MSRowColumnView::redraw(void) { redrawImmediately(); } void MSRowColumnView::naturalSize(void) { freeze(); _rows=naturalRows(); _columns=naturalCols(); _firstRow=0; _firstColumn=0; adjustFirstRow(); adjustFirstColumn(); computeSize(); updateHsb(); updateVsb(); unfreeze(); } void MSRowColumnView::unfreeze(void) { updateInternalState(); if (frozen()==MSTrue) { freezeStatus(MSFalse); calculateRowHeight(); calculateHeadingsHeight(); adjustNumVisible(); redrawImmediately(); } } void MSRowColumnView::redrawImmediately(void) {} void MSRowColumnView::configure(void) { _redrawPixmap->resize(width(),height()); placement(); if ((sizeState()&AdjustSize)==AdjustSize) adjustView(); } void MSRowColumnView::computeSize(void) { if (editor()!=0&&vsb()!=0&&hsb()!=0&&label()!=0) { int offset=((highlightThickness()+shadowThickness())<<1); int poffset=((panner()->highlightThickness()+panner()->shadowThickness())<<1); int w=drawWidth()+poffset; int h=drawHeight()+headingsHeight()+poffset; if (label()->mapped()==MSTrue) h+=label()->height(); if (isHsbEnabled()==MSTrue) h+=(hsb()->height()+spacing()); if (isVsbEnabled()==MSTrue) w+=(vsb()->width()+spacing()); resize(w+offset,h+offset); } } void MSRowColumnView::placement(void) { if (editor()!=0&&vsb()!=0&&hsb()!=0&&label()!=0) { if (editor()->mapped()==MSTrue) unmapEditor(); int offset=highlightThickness()+shadowThickness(); int offset2=offset<<1; int pH=height()-offset2; int pW=width()-offset2; if (label()->mapped()==MSTrue) pH-=label()->height(); if (isVsbEnabled()==MSTrue) pW-=(vsb()->width()+spacing()); if (isHsbEnabled()==MSTrue) pH-=(hsb()->height()+spacing()); label()->moveTo(offset,offset); label()->width(width()-offset2); editor()->height(rowHeight()); int y=offset; if (label()->mapped()==MSTrue) y+=label()->height(); panner()->moveTo(offset,y); panner()->resize(pW,pH); offset=panner()->highlightThickness()+panner()->shadowThickness(); offset2=offset<<1; XRectangle clipRect[1]; clipRect[0].x=0; clipRect[0].y=0; clipRect[0].width=panner()->width()-offset2; clipRect[0].height=panner()->height()-offset2; XSetClipRectangles(display(),textGC(),offset,offset,&clipRect[0],1,Unsorted); adjustNumVisible(); } } void MSRowColumnView::updateData(void) { if (firstMap()==MSTrue) { if (editor()->mapped()==MSTrue) unmapEditor(); updateInternalState(); calculateRowHeight(); calculateHeadingsHeight(); adjustNumVisible(); redrawImmediately(); } } void MSRowColumnView::adjustSize(void) { //This method is called when resize is necessary computeSize(); } void MSRowColumnView::firstMapNotify(void) { freezeStatus(MSTrue); _sizeState|=AdjustSize; updateInternalState(); defaultNumVisible(); calculateRowHeight(); calculateHeadingsHeight(); computeSize(); adjustNumVisible(); freezeStatus(MSFalse); _naturalRows=rows(); _naturalCols=columns(); } void MSRowColumnView::calculateRowHeight(void) { rowHeight(textHeight()+(2*rowSpacing())); } void MSRowColumnView::calculateHeadingsHeight(void) { headingsHeight(0); } void MSRowColumnView::updateBackground(unsigned long oldbg_) { MSCompositeText::updateBackground(oldbg_); label()->background(background()); vsbBackground(background()); hsbBackground(background()); if (panner()->background()!=background()) { panner()->background(background()); redrawImmediately(); } } void MSRowColumnView::updateForeground(unsigned long oldfg_) { MSCompositeText::updateForeground(oldfg_); if (label()->foreground()==oldfg_) label()->foreground(foreground()); redrawImmediately(); } void MSRowColumnView::updateFont(Font oldfid_) { MSCompositeText::updateFont(oldfid_); _rowHeight=textHeight()+(2*rowSpacing()); adjustNumVisible(); redrawImmediately(); } void MSRowColumnView::updateTitle(void) { label()->freeze(); label()->foreground(titleForeground()); label()->alignment(titleAlignment()); int h=label()->height(); int w=label()->width(); MSBoolean doPlace=MSFalse; label()->label(title()); if (label()->columns()==0&&label()->mapped()==MSTrue) { label()->unmap(); doPlace=MSTrue; } else if (label()->columns()>0&&label()->mapped()==MSFalse) { label()->map(); doPlace=MSTrue; } else if (label()->font()!=titleFont()&&label()->mapped()==MSTrue) { label()->font(titleFont()); doPlace=MSTrue; } int offset=highlightThickness()+shadowThickness(); label()->moveTo(offset,offset); if (label()->height()!=h||doPlace==MSTrue) { label()->unfreeze(); placement(); } else { label()->width(width()-2*offset); label()->unfreeze(); if (label()->mapped()==MSTrue) label()->redraw(); } } void MSRowColumnView::removeAllCycles(void) { MSColorCycle *cycle; for (unsigned i=0;istop(); } void MSRowColumnView::removeCycle(MSColorCycle *cycle_) { unsigned index; if ((index=cycleList().indexOf((unsigned long)cycle_))!=cycleList().length()) { delete cycle_; cycleList().removeAt(index); } if (cycleList().length()==0&&cycleTimer()!=0) cycleTimer()->stop(); } void MSRowColumnView::startCycle(int row_,int column_,const MSUnsignedLongVector& colors_,MSCycleColorMode mode_) { MSColorCycle *cycle=new MSColorCycle(this,row_,column_,colors_,mode_); cycleCell(cycle); cycle->increment(); cycleList().append((unsigned long)cycle); } void MSRowColumnView::processCycleTimer(void) { MSColorCycle *cycle; MSIndexVector deleteList; struct timeval diff; struct timeval *now=tod(); for (unsigned i=0;ilastUpdate(),&diff); unsigned long actual=diff.tv_sec*1000+diff.tv_usec/1000; if (actual>=cycleInterval()) { cycleCell(cycle); if (cycle->count()==cycle->numCycles()) { deleteList.append(i); delete cycle; } else { cycle->lastUpdate(*now); cycle->increment(); } } } cycleList().remove(deleteList); if (cycleList().length()==0&&cycleTimer()!=0) cycleTimer()->stop(); } void MSRowColumnView::updateFirstRow(int firstRow_) { _firstRow=firstRow_; redraw(); } void MSRowColumnView::updateFirstColumn(int firstColumn_) { _firstColumn=firstColumn_; redraw(); } void MSRowColumnView::updateSelectionVector(const MSIndexVector& selectionVector_) { _selectionVector=selectionVector_; redraw(); } void MSRowColumnView::updateSelectedRow(int) {} void MSRowColumnView::updateSelectionMode(MSSelectionMode selectionMode_) { //we only support MSSingle && MSMultiple //subclasses will have to overide that to support other modes. if (selectionMode()!=selectionMode_ && (selectionMode_==MSMultiple || selectionMode_==MSSingle)) { _selectionMode=selectionMode_; if (_selectionMode==MSMultiple) { lastBlock(selectedRow()); if (selectedRow()>=0) _selectionVector.append(selectedRow()); } else clearSelection(); } } void MSRowColumnView::keyPress(const XEvent *e_,KeySym k_,unsigned int s_,const char *b_) { if (isProtected()==MSFalse) { if (editor()->mapped()==MSTrue) keyPressNotify(editor(),e_,k_,s_,b_); else { MSKeyPress key(k_,s_); if( keyTranslate(key) == MSFalse) { editor()->string(""); keyPressNotify(editor(),e_,k_,s_,b_); if (editor()->length()>0) moveEditorToSelection(editor()->text()); } } } } void MSRowColumnView::buttonPress(const XEvent *pEvent_) { if (sensitive()==MSTrue) defaultButtonBehavior(pEvent_);} void MSRowColumnView::buttonRelease(const XEvent *pEvent_) { if (sensitive()==MSTrue) MSCompositeText::buttonRelease(pEvent_); } void MSRowColumnView::defaultDoubleClickBehavior(const XEvent *pEvent_) { if (hasCallback(MSWidgetCallback::doubleclick)==MSTrue) doubleClick(); else startEditing(pEvent_); } void MSRowColumnView::defaultButtonBehavior(const XEvent *pEvent_) { if (pEvent_->xbutton.button==Button1) defaultButton1Behavior(pEvent_); else if (pEvent_->xbutton.button==Button2) defaultButton2Behavior(pEvent_); else if (pEvent_->xbutton.button==Button3) defaultButton3Behavior(pEvent_); } void MSRowColumnView::defaultButton1Behavior(const XEvent *) {} void MSRowColumnView::defaultButton2Behavior(const XEvent *pEvent_) { if (rowDragDrop()==MSTrue) dragRow(pEvent_); else startEditing(pEvent_); } void MSRowColumnView::defaultButton3Behavior(const XEvent *) {} MSBoolean MSRowColumnView::selected(unsigned row_) { MSBoolean sel=MSFalse; if (selectionMode()!=MSSingle) { if (selectionVector().length()>0) { unsigned i=selectionVector().indexOf(row_); sel=(ipixel(colors_(i))); foregroundColors(cols); } void MSRowColumnView::foregroundColors(const MSUnsignedLongVector& colors_) { _foregroundColors=colors_; redraw(); } void MSRowColumnView::backgroundColors(const MSStringVector& colors_) { MSUnsignedLongVector cols(colors_.length()); for (int i=0;ipixel(colors_(i))); backgroundColors(cols); } void MSRowColumnView::backgroundColors(const MSUnsignedLongVector& colors_) { _backgroundColors=colors_; redraw(); } void MSRowColumnView::cycleColors(const MSStringVector& colors_) { MSUnsignedLongVector cols(colors_.length()); for (int i=0;ipixel(colors_(i))); cycleColors(cols); } void MSRowColumnView::cycleColors(const MSUnsignedLongVector& colors_) { _cycleColors=colors_; } void MSRowColumnView::cycleColorMode(MSCycleColorMode cycleMode_) { if (_cycleMode!=cycleMode_) _cycleMode=cycleMode_; } void MSRowColumnView::cycleInterval(unsigned long interval_) { if (cycleInterval()!=interval_) { _cycleInterval=interval_; MSBoolean stop=(cycleList().length()==0)?MSTrue:MSFalse; if (cycleTimer()!=0) delete _cycleTimer; _cycleTimer=new CycleTimer(this,cycleInterval()); if (stop==MSTrue) cycleTimer()->stop(); } } void MSRowColumnView::scrollBarSize(int size_) { if (size_!=vsb()->width()) { vsb()->width(size_);hsb()->height(size_); placement(); }} int MSRowColumnView::vsbSize(void) const { return (vsb()->mapped()==MSFalse&&vsb()->width()==1)?0:vsb()->width(); } void MSRowColumnView::vsbSize(int size_) { if (size_!=vsb()->width()) { vsb()->width(size_); placement(); }} int MSRowColumnView::hsbSize(void) const { return (hsb()->mapped()==MSFalse&&hsb()->height()==1)?0:hsb()->height(); } void MSRowColumnView::hsbSize(int size_) { if (size_!=hsb()->height()) { hsb()->height(size_); placement();}} void MSRowColumnView::showVsb(void) { if (isVsbEnabled()==MSFalse) { _scrollBarState|=VsbEnabled; vsb()->map(); placement(); } } void MSRowColumnView::hideVsb(void) { if (isVsbEnabled()==MSTrue) { _scrollBarState&=~VsbEnabled; vsb()->unmap(); placement(); } } void MSRowColumnView::showHsb(void) { if (isHsbEnabled()==MSFalse) { _scrollBarState|=HsbEnabled; hsb()->map(); placement(); } } void MSRowColumnView::hideHsb(void) { if (isHsbEnabled()==MSTrue) { _scrollBarState&=~HsbEnabled; hsb()->unmap(); placement(); } } void MSRowColumnView::vsbBackground(const char *color_) { vsbBackground(server()->pixel(color_)); } void MSRowColumnView::vsbBackground(unsigned long pixel_) { vsb()->background(pixel_); } void MSRowColumnView::hsbBackground(const char *color_) { hsbBackground(server()->pixel(color_)); } void MSRowColumnView::hsbBackground(unsigned long pixel_) { hsb()->background(pixel_); } void MSRowColumnView::editorBackground(const char *color_) { editorBackground(server()->pixel(color_)); } void MSRowColumnView::editorBackground(unsigned long pixel_) { editor()->background(pixel_); } void MSRowColumnView::editorForeground(const char *color_) { editorForeground(server()->pixel(color_)); } void MSRowColumnView::editorForeground(unsigned long pixel_) { editor()->foreground(pixel_); } void MSRowColumnView::selectionVector(const MSIndexVector& sv_) { updateSelectionVector(sv_); } void MSRowColumnView::selectedRowBackground(const char *color_) { selectedRowBackground(server()->pixel(color_)); } void MSRowColumnView::selectedRowBackground(unsigned long pixel_) { if (selectedRowBackground()!=pixel_) { _rowBg=pixel_; selectionVectorMSGC().foreground(pixel_); redraw(); } } int MSRowColumnView::clearSelection(void) { // This method clears all the rows in the selection vector except for // the current selected row if (selectionVector().length()>0) { const MSIndexVector osv=selectionVector(); // make a local copy of old select vector unsigned i; _selectionVector.removeAll(); for (i=0;i0)?_firstColumn+_columns-1:_firstColumn;} int MSRowColumnView::lastRow(void) { return (_rows>0)?_firstRow+_rows-1:_firstRow; } void MSRowColumnView::updateScrollBars(void) { if (firstRow()!=vsb()->value()) vsb()->valueChange(firstRow()); if (firstColumn()!=hsb()->value()) hsb()->valueChange(firstColumn()); } void MSRowColumnView::firstColumnChangeNotify(void) { activateCallback(MSWidgetCallback::firstcolumnchange); } void MSRowColumnView::firstRowChangeNotify(void) { activateCallback(MSWidgetCallback::firstrowchange); } void MSRowColumnView::rowSelection(void) { activateCallback(MSWidgetCallback::rowselection); } void MSRowColumnView::rowMovedNotify(void) { activateCallback(MSWidgetCallback::rowmoved); } void MSRowColumnView::fillSelection(int from_,int to_) { if (to_>=from_) { int fr=firstRow(); int lr=lastRow(); for (int i=fr;i<=lr;i++) { if (i>=from_&&i<=to_&&selected(i)==MSFalse) drawSelected(i); } } } void MSRowColumnView::unfillSelection(int from_,int to_) { if (to_>=from_) { int fr=firstRow(); int lr=lastRow(); for (int i=fr;i<=lr;i++) { if (i>=from_&&i<=to_&&selected(i)==MSTrue) undrawSelected(i); } } } void MSRowColumnView::scrollLeft(int count_) { if (firstColumn()>0&&count_>0) { if (firstColumn()-count_<0) count_=firstColumn(); _firstColumn-=count_; redrawImmediately(); firstColumnChangeNotify(); } } void MSRowColumnView::scrollRight(int count_) { int numCols=numColumns(); if (firstColumn()+columns()0) { if (firstColumn()+columns()+count_>numCols) { count_=numCols-(firstColumn()+columns()); } _firstColumn+=count_; redrawImmediately(); firstColumnChangeNotify(); } } void MSRowColumnView::scrollUp(int count_) { scrollUp(count_,selectedRow(),MSFalse);} void MSRowColumnView::scrollUp(int count_,int selectedRow_,MSBoolean drawNewRow_) { if (firstRow()+rows()0) { int oldFirstRow=firstRow(); if (firstRow()+rows()+count_>numRows()) { count_=numRows()-(firstRow()+rows()); } if (count_>=rows()-1) { _firstRow+=count_; _selectedRow=selectedRow_; redrawImmediately(); } else { int delta=count_*rowHeight(); int offset=panner()->highlightThickness()+panner()->shadowThickness(); int src_x=offset; int dest_x=src_x; int dest_y=offset+headingsHeight(); int src_y=dest_y+delta; int w=panner()->width()-2*offset; int h=(rows()-count_)*rowHeight(); int oldRow=selectedRow(); _selectedRow=selectedRow_; if (oldRow!=selectedRow()) undrawSelectedRow(oldRow); _firstRow+=count_; XCopyArea(display(),panner()->window(),panner()->window(), backgroundShadowGC(), src_x,src_y,w,h,dest_x,dest_y); int rs=firstRow()+rows()-count_; int re=firstRow()+rows()-1; postVerticalScrollDraw(rs,re,drawNewRow_); updateScrollBars(); } if (oldFirstRow!=firstRow()) firstRowChangeNotify(); } } void MSRowColumnView::scrollDown(int count_) { scrollDown(count_,selectedRow(),MSFalse); } void MSRowColumnView::scrollDown(int count_,int selectedRow_,MSBoolean drawNewRow_) { if (firstRow()>0&&count_>0) { int oldFirstRow=firstRow(); if (firstRow()-count_<0) count_=firstRow(); if (count_>=rows()-1) { _firstRow-=count_; _selectedRow=selectedRow_; redrawImmediately(); } else { int delta=count_*rowHeight(); int offset=panner()->highlightThickness()+panner()->shadowThickness(); int src_x=offset; int dest_x=src_x; int src_y=offset+headingsHeight(); int dest_y=src_y+delta; int w=panner()->width()-2*offset; int h=(rows()-count_)*rowHeight(); int oldRow=selectedRow(); _selectedRow=selectedRow_; if (oldRow!=selectedRow()) undrawSelectedRow(oldRow); _firstRow-=count_; XCopyArea(display(),panner()->window(),panner()->window(), panner()->backgroundShadowGC(), src_x,src_y,w,h,dest_x,dest_y); int rs=firstRow(); int re=firstRow()+count_; postVerticalScrollDraw(rs,re,drawNewRow_); updateScrollBars(); } if (oldFirstRow!=firstRow()) firstRowChangeNotify(); } } void MSRowColumnView::postVerticalScrollDraw(int rs_,int re_,MSBoolean drawNewRow_) { if (drawNewRow_==MSTrue) drawRows(rs_,re_); } void MSRowColumnView::set(MSAttrValueList& avList_) { MSCompositeText::set(avList_); MSIndexVector index; for (unsigned i=0;icolorName(selectedRowBackground()), MSAttrValue::Color); avList_<colorName(editorBackground()), MSAttrValue::Color); avList_<colorName(editorForeground()), MSAttrValue::Color); avList_<panner()->height()) row=rows(); else { int h=rowHeight(); int i=firstRow(); while(h<=y_&&i<=lastRow()) { i++; h+=rowHeight(); } row=i-firstRow(); } return (row>=0)?row:0; } int MSRowColumnView::inRowRange(int r_) { return(r_>=firstRow()&&r_<=lastRow())?MSTrue:MSFalse; } int MSRowColumnView::rowFromEvent(const XEvent *pEvent_) { int ey=pEvent_->xbutton.y; if (ey>headingsHeight()) return yToRow(ey-headingsHeight())+firstRow(); return -1; } int MSRowColumnView::xToColumn(int) {return 0;} int MSRowColumnView::inColRange(int c_) { return((c_>=firstColumn()&&c_<=lastColumn())?MSTrue:MSFalse); } int MSRowColumnView::columnFromEvent(const XEvent *pEvent_) { int x=pEvent_->xbutton.x-panner()->x_origin(); int col=xToColumn(x); return col; } void MSRowColumnView::adjustFirstRow(void) { //This method ensures the first row setting makes sense int oldFirstRow=firstRow(); if (firstRow()!=0&&firstRow()+rows()>=numRows()) { _firstRow=(numRows()>rows())?(numRows()-rows()):0; } _firstRow=(firstRow()>=0)?firstRow():0; if (oldFirstRow!=firstRow()) firstRowChangeNotify(); } void MSRowColumnView::unmapEditor(void) { loseFocusNotify(editor()); if (editor()->mapped()==MSTrue) { editor()->unmap(); activateCallback(MSWidgetCallback::editend); } } void MSRowColumnView::mapEditor(void) { MSBoolean wasMapped=MSFalse; if (editor()->mapped()==MSFalse) { wasMapped=MSTrue; editor()->map(); } editor()->raise(); takeFocusNotify(editor()); if(wasMapped==MSTrue) activateCallback(MSWidgetCallback::editbegin); } int MSRowColumnView::dragRowFromEvent(const XEvent*) { return selectedRow(); } void MSRowColumnView::dragRow(const XEvent *pEvent_) { int row = dragRowFromEvent(pEvent_); if (row!=-1) { int dragWindowBorderWidth=2; if (dragRowWindow()==0) { _dragRowCursor=new MSDisplayCursor(server(),XC_sb_v_double_arrow, server()->pixel("black"),server()->pixel("white")); XSetWindowAttributes attributes; attributes.save_under=True; attributes.override_redirect=True; attributes.backing_store=WhenMapped; attributes.cursor=dragRowCursor()->cursor(); attributes.border_pixel=server()->pixel("yellow"); _dragRowWindow=XCreateWindow(display(),server()->root(), 0,0,1,1,dragWindowBorderWidth, CopyFromParent,InputOutput,CopyFromParent, CWOverrideRedirect|CWSaveUnder|CWBackingStore|CWCursor|CWBorderPixel, &attributes); } server()->grabPointer(window(),False,ButtonPressMask|ButtonReleaseMask, GrabModeAsync,GrabModeAsync,None, dragRowCursor()->cursor(),CurrentTime); int x=panner()->highlightThickness()+panner()->shadowThickness(); int y=computeYCoord(row); int rootx,rooty; panner()->rootXY(rootx,rooty); int pannerY=rooty; rootx+=(x-dragWindowBorderWidth); rooty+=(y-dragWindowBorderWidth); int offset=pEvent_->xbutton.y_root-rooty; int width=panner()->width()-panner()->shadowThickness()*2 -panner()->highlightThickness()*2; int height=rowHeight(); XWindowChanges values; values.x=rootx; values.y=rooty; values.width=width; values.height=height; XConfigureWindow(display(),dragRowWindow(),CWX|CWY|CWWidth|CWHeight,&values); XMapRaised(display(),dragRowWindow()); XCopyArea(display(),panner()->window(),dragRowWindow(),textGC(),x,y,width,height,0,0); Window root,child; int rx,ry,ix,iy; unsigned keys; int oldY=rooty; int sameScreen=XQueryPointer(display(),panner()->window(),&root,&child,&rx,&ry,&ix,&iy,&keys); while (keys&Button2Mask) { if (sameScreen==True) { int newY=ry-offset; if (newY!=oldY) { XMoveWindow(display(),dragRowWindow(),rootx,newY); server()->flush(); oldY=newY; } if (newY0?newY:0; int start=pannerY+headingsHeight(); int numScroll=(int)(((double)(start-newY)/((double)start+1))*rows()+1); int newFirstRow=(int)(firstRow()-numScroll); newFirstRow=(newFirstRow<0)?0:newFirstRow; firstRow(newFirstRow); } else if (newY>pannerY+panner()->height()) { if (numRows()>(unsigned)rows()) { newY=newY>server()->height()?server()->height():newY; int start=pannerY+panner()->height(); int numScroll=(int)(((double)(newY-start)/((double)server()->height()-start-1))*rows()+1); int newFirstRow=firstRow()+numScroll; int max=numRows()-rows(); newFirstRow=(newFirstRow>max)?max:newFirstRow; firstRow(newFirstRow); } } } sameScreen=XQueryPointer(display(),panner()->window(),&root,&child,&rx,&ry,&ix,&iy,&keys); } XUnmapWindow(display(),dragRowWindow()); server()->ungrabPointer(window(),CurrentTime); int newRow; if (oldYpannerY+panner()->height()) { if (numRows()>(unsigned)rows()) newRow=lastRow(); else newRow=numRows()-1; } else { newRow=yToRow(oldY-pannerY-headingsHeight())+firstRow(); if (newRownumRows()-1) newRow=numRows()-1; // if the calcualted new row passes the last row, // make it the last row else if (newRow>lastRow()) newRow=lastRow(); } if (newRow!=row) shuffleRow(row,newRow); } } int MSRowColumnView::computeYCoord(int row_) { //This method compute the Y coordinate of the upper left corner of the specified row int offset=panner()->highlightThickness()+panner()->shadowThickness()+headingsHeight(); return (int) (offset+(row_-firstRow())*rowHeight()); } void MSRowColumnView::shuffleRow(int from_, int to_) { moveRow(from_,to_); rowMovedNotify(); } void MSRowColumnView::rowDragDrop(MSBoolean rowDragDrop_) { _rowDragDrop=rowDragDrop_; } MSBoolean MSRowColumnView::rowDragDrop(void) const { return _rowDragDrop; } void MSRowColumnView::moveRow(int, int) {} void MSRowColumnView::startEditing(const XEvent *) {} void MSRowColumnView::updateHsb(void) {} void MSRowColumnView::updateVsb(void) {} void MSRowColumnView::adjustView(void) {} void MSRowColumnView::adjustNumVisible(void) {} void MSRowColumnView::adjustFirstColumn(void) {} void MSRowColumnView::defaultNumVisible(void) {} void MSRowColumnView::cycleCell(MSColorCycle *) {} void MSRowColumnView::drawRow(int) {} void MSRowColumnView::drawRows(int,int) {} void MSRowColumnView::drawSelectedRow(int,MSBoolean) {} void MSRowColumnView::undrawSelectedRow(int row_) { drawSelectedRow(row_,MSFalse); } void MSRowColumnView::moveEditorToSelection(const MSString &) {} int MSRowColumnView::drawWidth(void) {return 0;} int MSRowColumnView::drawHeight(void) {return 0;} void MSRowColumnView::drawSelected(int) {} void MSRowColumnView::undrawSelected(int) {} void MSRowColumnView::hsbValueUpdate(void) {} void MSRowColumnView::vsbValueUpdate(void) {} void MSRowColumnView::updateInternalState(void) {} unsigned MSRowColumnView::numColumns(void) const { return 0; } unsigned MSRowColumnView::numRows(void) const { return 0; } aplus-fsf-4.22/src/MSGUI/MSScale.C0000644000265000001440000010614010772770412012075 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include static const unsigned long DefaultEventMask=ExposureMask|ButtonPressMask|ButtonReleaseMask|KeyReleaseMask; static const unsigned long DefaultRepeatInterval =50; static const unsigned long DefaultInitialDelay =250; static const int DefaultMinorTickCount =1; static const int DefaultMinorTickSize =6; static const int DefaultMajorTickSize =10; extern const int SliderAreaShadowThickness=2; MSLabelFormat MSScale::_outFormat; MSLabelOutPtr MSScale::_defaultLabelOut(new MSLabelOut(),MSInit); // ######################################################### // DelayTimer // ######################################################### MSScale::DelayTimer::DelayTimer(MSScale *s_,unsigned long ms_):MSRegularTimer(ms_,0) { _scale=s_;} MSScale::DelayTimer::~DelayTimer(void) {} void MSScale::DelayTimer::process(void) { _scale->processDelayTimer(); } // ######################################################### // RepeatTimer // ######################################################### MSScale::RepeatTimer::RepeatTimer(MSScale *s_,unsigned long interval_):MSIntervalTimer(interval_) { _scale=s_;} MSScale::RepeatTimer::~RepeatTimer(void) {} void MSScale::RepeatTimer::process(void) { _scale->processRepeatTimer(); } // ######################################################### // Editor // ######################################################### MSScale::Editor::Editor(MSWidget *owner_):MSTextField(owner_) { _highlightThickness=0; _shadowThickness=0; margin(0); } MSScale::Editor::~Editor(void) {} void MSScale::Editor::activate(void) { ((MSScale *)owner())->editorActivate(); } void MSScale::Editor::escape(void) { ((MSScale *)owner())->editorEscape(); } // ######################################################### // ValueWin // ######################################################### MSScale::ValueWin::ValueWin(MSWidget *owner_):MSWidgetCommon(owner_) { _highlightThickness=0; _shadowThickness=0; _offset=0; _x_org=0; _y_org=0; sensitive(MSFalse); XGCValues values; values.foreground=foreground(); values.background=background(); values.font=font(); _gc=XCreateGC(display(),window(),(GCForeground|GCBackground|GCFont),&values); _fontInfo=(XFontStruct *)server()->fontStruct(font()); // backingStore(WhenMapped); selectInput(ExposureMask); } MSScale::ValueWin::~ValueWin(void) { XFreeGC(display(),_gc); } void MSScale::ValueWin::updateValue(const char *pString_) { drawBackground(); if (pString_!=0) { MSScale *scale=(MSScale *)owner(); unsigned long align=scale->valueAlignment(); int ww=XTextWidth(fontInfo(),pString_,strlen(pString_)); int xx=align&MSLeft?0:align&MSRight?width()-ww:(width()-ww)/2; XDrawString(display(),window(),gc(),fontInfo(),xx,fontInfo()->ascent,pString_,strlen(pString_)); } } void MSScale::ValueWin::updateFont(Font oldfid_) { MSWidgetCommon::updateFont(oldfid_); _fontInfo=(XFontStruct *)server()->fontStruct(font()); XSetFont(display(),_gc,font()); } void MSScale::ValueWin::updateForeground(unsigned long oldfg_) { MSWidgetCommon::updateForeground(oldfg_); XSetForeground(display(),gc(),foreground()); } void MSScale::ValueWin::redraw(void) { MSScale *scale=(MSScale *)owner(); MSString buffer; updateValue(scale->formatValue(buffer,scale->currentValue())); } // ######################################################### // Slider // ######################################################### MSScale::Slider::Slider(MSWidget *owner_):MSWidgetCommon(owner_) { _gc=XCreateGC(display(),window(),0,0); _highlightThickness=0; _shadowThickness=2; shadowStyle(MSRaised); saveUnder(MSTrue); // backingStore(Always); selectInput(ExposureMask); } MSScale::Slider::~Slider(void) { XFreeGC(display(),_gc); } void MSScale::Slider::setValueWinYCoord(int y_) { MSScale::ValueWin *win=scale()->valueWin(); win->moveTo(win->x_org(),y_+(height()-win->height())/2); } void MSScale::Slider::setValueWinXCoord(int x_) { MSScale::ValueWin *win=scale()->valueWin(); win->moveTo(x_+win->offset(),win->y_org()); } void MSScale::Slider::button1Press(const XEvent *event_) { if (event_->xbutton.button==Button1) scale()->moveSlider(event_); } void MSScale::Slider::adjustSize(int w_,int h_) { if (width()!=w_||height()!=h_) { MSRect::width(w_<=0?1:w_>=USHRT_MAX?width():w_); MSRect::height(h_<=0?1:h_>=USHRT_MAX?height():h_); if (window()!=0) { selectInput(); XResizeWindow(display(),window(),width(),height()); redraw(); selectInput(ExposureMask); } } } void MSScale::Slider::configure(void) { if (mapped()==MSTrue) redraw(); } void MSScale::Slider::redraw(void) { if (mapped()==MSTrue) { drawShadow(); ((MSScale*)owner())->drawSliderEtch(); XFlush(display()); } ((MSScale*)owner())->sliderRedrawNotify(); } void MSScale::Slider::drawSliderEtch(void) {} void MSScale::Slider::moveTo(int,int) {} // ######################################################### // MSScale // ######################################################### MSScale::MSScale(MSWidget *owner_,const char *title_):MSPrimitive(owner_,title_) { init(); _modelType=MSFloat::symbol(); internalCouple(new MSFloat); } MSScale::MSScale(MSWidget *owner_,const MSStringVector& title_):MSPrimitive(owner_,title_) { init(); _modelType=MSFloat::symbol(); internalCouple(new MSFloat); } MSScale::MSScale(MSWidget *owner_,MSFloat& model_,const char *title_):MSPrimitive(owner_,title_) { init(); _modelType=MSFloat::symbol(); couple(&model_); } MSScale::MSScale(MSWidget *owner_,MSFloat& model_,const MSStringVector& title_):MSPrimitive(owner_,title_) { init(); _modelType=MSFloat::symbol(); couple(&model_); } MSScale::MSScale(MSWidget *owner_,MSInt& model_,const char *title_):MSPrimitive(owner_,title_) { init(); _modelType=MSInt::symbol(); couple(&model_); format(MSFormat(MSInt::WithoutCommas)); } MSScale::MSScale(MSWidget *owner_,MSInt& model_,const MSStringVector& title_):MSPrimitive(owner_,title_) { init(); _modelType=MSInt::symbol(); couple(&model_); format(MSFormat(MSInt::WithoutCommas)); } void MSScale::init(void) { freeze(); _base=0; _scale=0; _valueMin=0.; _valueMax=100.; _valueInc=1.; _valuePageInc=10.; _valueAlignment=(unsigned long)(MSCenter|MSTop); _titleAlignment=(unsigned long)(MSCenter|MSTop); _subtitleFont=MSPrimitive::font(); _subtitleForeground=MSPrimitive::foreground(); _subtitleAlignment=_titleAlignment; _mintitleForeground=MSPrimitive::foreground(); _mintitleAlignment=(unsigned long)MSCenter; _mintitleHeight=0; _mintitleWidth=0; _mintitleFont=MSPrimitive::font(); _maxtitleForeground=MSPrimitive::foreground(); _maxtitleAlignment=_mintitleAlignment; _maxtitleHeight=0; _maxtitleWidth=0; _maxtitleFont=MSPrimitive::font(); _labelForeground=MSPrimitive::foreground(); _labelFont=MSPrimitive::font(); _labelInc=0.; _labelSpacing=2; _labelOffset=0; _labelOut=_defaultLabelOut; _majorTickSize=DefaultMajorTickSize; _minorTickSize=DefaultMinorTickSize; _minorTickCount=DefaultMinorTickCount; _internalUpdateStatus=MSFalse; _gc=XCreateGC(display(),window(),0,0); _valueWin=new ValueWin(this); _editor=new Editor(this); _repeatTimer=new RepeatTimer(this,DefaultRepeatInterval); _repeatOn=MSTrue; _delayTimer=0; stopRepeatTimer(); _shadowThickness=0; _highlightThickness=2; shadowStyle(MSRaised); acceptFocus(MSTrue); selectInput(DefaultEventMask); backingStore(WhenMapped); addToFocusList(); format(MSFormat(MSFloat::Decimal2)); } MSScale::~MSScale(void) { freeze(); if (_delayTimer!=0) delete _delayTimer; if (_repeatTimer!=0) delete _repeatTimer; if (_slider!=0) delete _slider; if (_valueWin!=0) delete _valueWin; if (_editor!=0) delete _editor; if (_gc!=0) XFreeGC(display(),_gc); } int MSScale::sliderSize(void) const {return 0;} void MSScale::editorActivate(void) { if (editor()->mapped()==MSTrue) { if (validate((char *)editor()->string())==MSTrue) editorEscape(); } } void MSScale::editorEscape(void) { if (editor()->mapped()==MSTrue) { focusOutNotify(editor()); editor()->unmap(); } } MSBoolean MSScale::validate(const char *pString_) { MSBoolean status=MSFalse; if (MSView::model()!=0) { if (modelType()==MSFloat::symbol()) { MSFloat temp; if (temp.set(pString_)==MSError::MSSuccess) { *((MSFloat *)MSView::model())=temp; status=MSTrue; } } else if (modelType()==MSInt::symbol()) { MSInt temp; if (temp.set(pString_)==MSError::MSSuccess) { *((MSInt *)MSView::model())=temp; status=MSTrue; } } } return status; } void MSScale::model(const MSFloat& model_) { _modelType=MSFloat::symbol(); constCouple(&model_); if (format().formatType()!=MSFormat::Float) { format(MSFormat(MSFloat::Decimal2)); computeSize(); redraw(); } } void MSScale::model(const MSInt& model_) { _modelType=MSInt::symbol(); constCouple(&model_); if (format().formatType()!=MSFormat::Int) { format(MSFormat(MSInt::WithoutCommas)); computeSize(); redraw(); } } void MSScale::model(MSFloat& model_) { _modelType=MSFloat::symbol(); couple(&model_); if (format().formatType()!=MSFormat::Float) { format(MSFormat(MSFloat::Decimal2)); computeSize(); redraw(); } } void MSScale::model(MSInt& model_) { _modelType=MSInt::symbol(); couple(&model_); if (format().formatType()!=MSFormat::Int) { format(MSFormat(MSInt::WithoutCommas)); computeSize(); redraw(); } } void MSScale::firstMapNotify(void) { freeze(); computeSize(); unfreeze(); } void MSScale::configure(void) { redraw(); if (editor()->mapped()==MSTrue) { editor()->moveTo(valueWin()->x_origin(),valueWin()->y_origin()); } } void MSScale::processRepeatTimer(void) { unsigned int mask=Button1Mask|(unsigned int)KeyPressMask; unsigned int keys=mask; int ix=0,iy=0; int rx=0,ry=0; Window root,child; XQueryPointer(display(),window(),&root,&child,&rx,&ry,&ix,&iy,&keys); if (keys&mask) updateSliderValue(); } void MSScale::processDelayTimer(void) { _delayTimer=0; startRepeatTimer(); } void MSScale::editValue(const char *pString_) { if (MSView::model()!=0) { editor()->color(background(),foreground()); editor()->font(valueWin()->font()); editor()->resize(valueWin()->width(),valueWin()->height()); editor()->moveTo(valueWin()->x_origin(),valueWin()->y_origin()); if (pString_!=0) editor()->string(pString_); editor()->map(); editor()->raise(); focusInNotify(editor()); } } MSBoolean MSScale::assignValue(double x_) { if (MSView::model()!=0) { double value=x_>valueMax()?valueMax():x_valueMax()?valueMax():valuevalueMax()?valueMax():valueupdateValue(formatValue(buffer,currentValue())); } void MSScale::buttonPress(const XEvent *event_) { if (isProtected()==MSFalse) { #ifndef MS_WINDOWS selectInput(DefaultEventMask^ExposureMask); #endif MSBoolean focus=traverseFocus(this); Window sw=event_->xbutton.subwindow; XEvent *ev=(XEvent *)event_; if (sw==slider()->window()&&editor()->mapped()==MSFalse) { ev->xbutton.x-=slider()->x_origin(); ev->xbutton.y-=slider()->y_origin(); buttonPressNotify(slider(),ev); } else if (focus==MSTrue&&sw==valueWin()->window()&&valueWin()->sensitive()==MSTrue) { ev->xbutton.x-=valueWin()->x_origin(); ev->xbutton.y-=valueWin()->y_origin(); MSString buffer; if (editor()->mapped()==MSFalse) editValue(formatValue(buffer,currentValue())); buttonPressNotify(editor(),ev); } else if (focus==MSTrue&&sw==editor()->window()) { ev->xbutton.x-=editor()->x_origin(); ev->xbutton.y-=editor()->y_origin(); buttonPressNotify(editor(),ev); } else if (editor()!=0&&editor()->mapped()!=MSTrue) buttonPressNotify(this,event_); } } void MSScale::button1Press(const XEvent *event_) { int bx=event_->xbutton.x; int by=event_->xbutton.y; int x=slider()->x_origin(); int y=slider()->y_origin(); if (bx>x_org()&&bxy_org()&&byxbutton.x; int by=event_->xbutton.y; if (bx>x_org()&&bxy_org()&&byxbutton.button!=Button1&&event_->xbutton.button!=Button2) return; if (_delayTimer!=0) { _delayTimer->stop(); _delayTimer=0; } stopRepeatTimer(); selectInput(DefaultEventMask); } void MSScale::keyRelease(const XEvent *e_,KeySym keysym_,unsigned int state_,const char *pString_) { MSPrimitive::keyRelease(e_,keysym_,state_,pString_); } void MSScale::keyPress(const XEvent *e_,KeySym keysym_,unsigned int state_,const char *pString_) { if (isProtected()==MSFalse&& hasModel()==MSTrue) { MSKeyPress keyPress(keysym_, state_); if(keyTranslate(keyPress)==MSTrue) { if (editor()->mapped()==MSTrue) keyPressNotify(editor(),e_,keysym_,state_,pString_); else { switch(keysym_) { case XK_Home: case XK_F27: home(); break; case XK_End: case XK_R13: end(); break; case XK_Prior: case XK_F29: pageUp(); break; case XK_Next: case XK_F35: pageDown(); break; case XK_Left: left(); break; case XK_Right: right(); break; case XK_Up: up(); break; case XK_Down: down(); break; default: editor()->string(""); keyPressNotify(editor(),e_,keysym_,state_,pString_); if (editor()->length()>0) editValue(0); break; } } } } } void MSScale::home(void) { assignValue(valueMin()); } void MSScale::end(void) { assignValue(valueMax()); } void MSScale::up(void) { valueChange(valueInc()); startTimedUpdate(); } void MSScale::down(void) { valueChange(-valueInc()); startTimedUpdate(); } void MSScale::left(void) { valueChange(-valueInc()); startTimedUpdate(); } void MSScale::right(void) { valueChange(valueInc()); startTimedUpdate(); } void MSScale::pageUp(void) { valueChange(valuePageInc()); startTimedUpdate(); } void MSScale::pageDown(void) { valueChange(-valuePageInc()); startTimedUpdate(); } void MSScale::keyRelease(const XEvent *) { if (_delayTimer!=0) { _delayTimer->stop(); _delayTimer=0; } stopRepeatTimer(); } void MSScale::startTimedUpdate(void) { startDelayTimer(); updateSliderValue(); } void MSScale::startDelayTimer(void) { if (delayTimer()!=0) { delayTimer()->stop(); _delayTimer=0; } _delayTimer=new DelayTimer(this,DefaultInitialDelay); } void MSScale::startRepeatTimer(void) { if (_repeatOn!=MSTrue) { _repeatOn=MSTrue; _repeatTimer->reset(); } } void MSScale::stopRepeatTimer(void) { if (_repeatOn==MSTrue) { _repeatTimer->stop(); _repeatOn=MSFalse; } } void MSScale::updateSliderValue(void) { if (MSView::model()!=0) { double x=currentValue()+valueChange(); x=x>valueMax()?valueMax():xmap(); slider()->raise(); slider()->redraw(); if (valueAlignment()!=MSNone) { valueWin()->map(); valueWin()->raise(); } else valueWin()->unmap(); MSString buffer; valueWin()->updateValue(formatValue(buffer,currentValue())); if (editor()->mapped()==MSTrue) editor()->raise(); } } void MSScale::computeValueWinSize(void) { int wmin,wmax; MSString buffer; formatValue(buffer,valueMin()); wmin=XTextWidth(valueWin()->fontInfo(),buffer,buffer.length()); formatValue(buffer.removeAll(),valueMax()); wmax=XTextWidth(valueWin()->fontInfo(),buffer,buffer.length()); formatValue(buffer.removeAll(),currentValue()); int w=XTextWidth(valueWin()->fontInfo(),buffer,buffer.length()); w=(w=w>wmin?w:wmin)>wmax?w:wmax; valueWin()->offset((slider()->width()-w)/2); valueWin()->resize(w,valueWin()->textHeight()); } void MSScale::drawSliderArea(void) { XFillRectangle(display(),window(),selectShadowGC(), x_org(),y_org(),sliderAreaRect().width(),sliderAreaRect().height()); drawBevel(_sliderAreaRect,MSSunken,SliderAreaShadowThickness); } void MSScale::drawTitles(void) { int offset=highlightThickness()+shadowThickness(); int x,len,y=MSBottom&titleAlignment()?height()-titleHeight():offset; XFontStruct *fontInfo; GC gc=XCreateGC(display(),window(),0,0); char *pString; if (title().maxLength()>0) { fontInfo=(XFontStruct *)server()->fontStruct(titleFont()); XSetFont(display(),gc,titleFont()); XSetForeground(display(),gc,titleForeground()); y+=fontInfo->ascent; for (int i=0;iascent+fontInfo->descent; } y-=fontInfo->ascent; } if (subtitle().maxLength()>0) { fontInfo=(XFontStruct *)server()->fontStruct(subtitleFont()); XSetFont(display(),gc,subtitleFont()); XSetForeground(display(),gc,subtitleForeground()); y+=fontInfo->ascent; for (int i=0;iascent+fontInfo->descent; } } XFreeGC(display(),gc); } void MSScale::print(const char *file_) { MSBoolean fileOpen=MSFalse; busyOn(); if (outputMode()==Draw) { if (file_!=0) displayPrintFileName(file_); if (displayPrintOpen(this)==MSTrue) { fileOpen=MSTrue; outputMode(Print); displayPrintXorigin(0); displayPrintYorigin(0); } else return; } redraw(); if (slider()->mapped()==MSTrue) { displayPrintOriginInc(slider()); slider()->redraw(); displayPrintOriginDec(slider()); if (valueWin()->mapped()==MSTrue) { displayPrintOriginInc(valueWin()); MSString buffer; valueWin()->updateValue(formatValue(buffer,currentValue())); displayPrintOriginDec(valueWin()); } } if (fileOpen==MSTrue) { displayPrintClose(); outputMode(Draw); } busyOff(); } void MSScale::updateTitle(void) { computeSize(); redraw(); } void MSScale::updateBackground(unsigned long oldbg_) { if (slider()->background()==oldbg_) slider()->background(background()); if (valueWin()->background()==oldbg_) valueWin()->background(background()); MSPrimitive::updateBackground(oldbg_); redraw(); } void MSScale::updateForeground(unsigned long oldfg_) { if (valueWin()->foreground()==oldfg_) valueWin()->foreground(foreground()); if (labelForeground()==oldfg_) _labelForeground=foreground(); if (subtitleForeground()==oldfg_) _subtitleForeground=foreground(); if (mintitleForeground()==oldfg_) _mintitleForeground=foreground(); if (maxtitleForeground()==oldfg_) _maxtitleForeground=foreground(); MSPrimitive::updateForeground(oldfg_); XSetForeground(display(),gc(),foreground()); redraw(); } void MSScale::updateFont(Font oldfid_) { Font fid=MSWidget::font(); if (fid!=oldfid_) { if (oldfid_==subtitleFont()) _subtitleFont=fid; if (oldfid_==mintitleFont()) _mintitleFont=fid; if (oldfid_==maxtitleFont()) _maxtitleFont=fid; if (oldfid_==labelFont()) _labelFont=fid; if (oldfid_==valueFont()) valueWin()->font(fid); computeSize(); redraw(); } } void MSScale::focusIn(void) { highlight(); if (editor()->mapped()==MSTrue) focusInNotify(editor()); } void MSScale::focusOut(void) { unHighlight(); if (editor()->mapped()==MSTrue) focusOutNotify(editor()); } MSBoolean MSScale::loseFocus(void) { if (editor()->mapped()==MSTrue) editorActivate(); if (editor()->mapped()==MSTrue) return MSFalse; else { unHighlight(); return MSTrue; } } void MSScale::set(MSAttrValueList& avList_) { MSPrimitive::set(avList_); MSIndexVector index; for (unsigned i=0;ifontName(labelFont()),MSAttrValue::Font); avList_<colorName(labelForeground()),MSAttrValue::Color); avList_<fontName(maxtitleFont()),MSAttrValue::Font); avList_<colorName(maxtitleForeground()),MSAttrValue::Color); avList_<fontName(mintitleFont()),MSAttrValue::Font); avList_<colorName(mintitleForeground()),MSAttrValue::Color); avList_<colorName(sliderBackground()),MSAttrValue::Color); avList_<fontName(subtitleFont()),MSAttrValue::Font); avList_<colorName(subtitleForeground()),MSAttrValue::Color); avList_<fontName(valueFont()),MSAttrValue::Font); avList_<colorName(valueForeground()),MSAttrValue::Color); avList_<pixel(x_)); } void MSScale::subtitleFont(const char *x_) { subtitleFont(server()->fontID(x_)); } void MSScale::subtitleFont(Font x_) { if (x_!=subtitleFont()) { _subtitleFont=x_; computeSize(); redraw(); } } void MSScale::mintitle(const MSStringVector& x_) { if (x_!=mintitle()) { _mintitle=x_; computeSize(); redraw(); } } void MSScale::mintitleAlignment(unsigned long x_) { if (x_!=mintitleAlignment()) { _mintitleAlignment=x_; computeSize(); redraw(); } } void MSScale::mintitleForeground(const char *x_) { mintitleForeground(server()->pixel(x_)); } void MSScale::mintitleForeground(unsigned long x_) { _mintitleForeground=x_; redraw(); } void MSScale::mintitleFont(const char *x_) { mintitleFont(server()->fontID(x_)); } void MSScale::mintitleFont(Font x_) { if (x_!=mintitleFont()) { _mintitleFont=x_; computeSize(); redraw(); } } void MSScale::maxtitle(const MSStringVector& x_) { if (x_!=maxtitle()) { _maxtitle=x_; computeSize(); redraw(); } } void MSScale::maxtitleAlignment(unsigned long x_) { if (x_!=maxtitleAlignment()) { _maxtitleAlignment=x_; computeSize(); redraw(); } } void MSScale::maxtitleForeground(unsigned long x_) { _maxtitleForeground=x_; redraw(); } void MSScale::maxtitleForeground(const char *x_) { maxtitleForeground(server()->pixel(x_)); } void MSScale::maxtitleFont(const char *x_) { maxtitleFont(server()->fontID(x_)); } void MSScale::maxtitleFont(Font x_) { if (x_!=maxtitleFont()) { _maxtitleFont=x_; computeSize(); redraw(); } } void MSScale::labelAlignment(unsigned long x_) { if (x_!=labelAlignment()) { _labelAlignment=x_; computeSize(); redraw(); } } void MSScale::labelForeground(unsigned long x_) { _labelForeground=x_; redraw(); } void MSScale::labelForeground(const char *x_) { labelForeground(server()->pixel(x_)); } void MSScale::labelFont(const char *x_) { labelFont(server()->fontID(x_)); } void MSScale::labelFont(Font x_) { if (x_!=labelFont()) { _labelFont=x_; computeSize(); redraw(); } } void MSScale::labelInc(double x_) { _labelInc=x_; redraw(); } void MSScale::labelOut(MSLabelOut *x_) { labelOut(MSLabelOutPtr(x_,MSInit)); } void MSScale::labelOut(MSLabelOutPtr x_) { x_->owner(this); _labelOut=x_; computeSize(); redraw(); } void MSScale::sliderForeground(unsigned long x_) { _slider->foreground(x_); _slider->redraw(); } void MSScale::sliderBackground(unsigned long x_) { _slider->background(x_); _slider->redraw(); } void MSScale::sliderForeground(const char *x_) { sliderForeground(server()->pixel(x_)); } void MSScale::sliderBackground(const char *x_) { sliderBackground(server()->pixel(x_)); } void MSScale::valueMin(double x_) { if (x_<_valueMax&&x_!=_valueMin) { _valueMin=x_; computeSize(); redraw(); } } void MSScale::valueMax(double x_) { if (x_>_valueMin&&x_!=_valueMax) { _valueMax=x_; computeSize(); redraw(); } } void MSScale::valueInc(double x_) { if (x_>0.&&x_<=(_valueMax-_valueMin)) _valueInc=x_; } void MSScale::valuePageInc(double x_) { if (x_>0.&&x_<=(_valueMax-_valueMin)) _valuePageInc=x_; } void MSScale::valueChange(double x_) { _valueChange=x_; } void MSScale::valueAlignment(unsigned long x_) { _valueAlignment=x_; computeSize(); redraw(); } void MSScale::valueForeground(unsigned long x_) { _valueWin->foreground(x_); } void MSScale::valueForeground(const char *x_) { valueForeground(server()->pixel(x_)); } void MSScale::valueFont(Font x_) { _valueWin->font(x_); computeSize(); redraw(); } void MSScale::valueFont(const char *x_) { valueFont(server()->fontID(x_)); } void MSScale::valueSensitive(MSBoolean x_) {_valueWin->sensitive(x_);} void MSScale::majorTickSize(int x_) { _majorTickSize=x_<30?x_:30; computeSize(); redraw(); } void MSScale::minorTickSize(int x_) { _minorTickSize=x_<30?x_:30; computeSize(); redraw(); } void MSScale::minorTickCount(int x_) { _minorTickCount=x_; redraw(); } // ######################################################### // default virtual methods - prevents gratuitous inlining // ######################################################### void MSScale::drawTickLabels(void) {} void MSScale::drawSliderTitles(void) {} void MSScale::moveSlider(const XEvent *) {} void MSScale::computeLabelOffset(void) {} void MSScale::computeSliderAreaSize(void) {} void MSScale::computeSliderScale(void) {} void MSScale::computeTickInc(void) {} void MSScale::button3Press(const XEvent *) {} void MSScale::computeSize(void) {} void MSScale::setSliderPosition(int) {} void MSScale::sliderSize(int) {} void MSScale::drawSliderEtch(void) {} void MSScale::sliderRedrawNotify(void) {} double MSScale::pixelToValue(int) { return 0.; } int MSScale::valueToPixel(double) { return 0; } int MSScale::incFactor(int,int) { return 1; } void MSScale::updateFormat(void) { redraw(); } void MSScale::updateData(void) { redraw(); } void MSScale::naturalSize(void) { computeSize(); } const char *MSScale::formatValue(MSString &buffer_,double data_) { if (format().formatType()==MSFormat::Float) { MSFloat aFloat(data_); return aFloat.format(buffer_,format()); } else { MSInt aInt((int)(data_)); return aInt.format(buffer_,format()); } } MSFloat MSScale::asFloat(void) const { return MSFloat(currentValue()); } MSInt MSScale::asInt(void) const { if (currentValue()>INT_MAX||currentValue()<-INT_MAX) { MSString message("Warning: value exceeds INT_MAX, unable to assign value "); message += MSString(currentValue()); MSMessageLog::warningMessage(message.string()); } return MSInt((int)(currentValue())); } unsigned long MSScale::addEditorKeyCallback( const char* pString_,MSKeyCallback* keyCallback_) { return editor()->addKeyCallback(pString_,keyCallback_);} void MSScale::removeEditorKeyCallback(unsigned long id_) { editor()->removeKeyCallback(id_); } void MSScale::removeEditorKeyCallback(const char* pString_) { editor()->removeKeyCallback(pString_); } aplus-fsf-4.22/src/MSGUI/MSScrollBar.C0000644000265000001440000004044510772770412012736 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include static const unsigned long MSScrollBarDefaultRepeatInterval=50; static const unsigned long MSScrollBarDefaultInitialDelay=250; static const unsigned long MSScrollBarEventMask=(ExposureMask|ButtonPressMask|ButtonReleaseMask); MSScrollBar::Style MSScrollBar::_defaultStyle=MSScrollBar::Motif; MSScrollBar::Elevator::Elevator(MSScrollBar *owner_) : MSWidgetCommon(owner_) { _acceptFocus=MSFalse; _highlightThickness=0; _shadowThickness=1; _arrow1=0; _arrow2=0; } MSScrollBar::Elevator::~Elevator(void) { if (_arrow1!=0) delete _arrow1; if (_arrow2!=0) delete _arrow2; } MSArrow *MSScrollBar::Elevator::arrow1(void) const { return _arrow1; } MSArrow *MSScrollBar::Elevator::arrow2(void) const { return _arrow2; } MSScrollBar *MSScrollBar::Elevator::scrollBar(void) const { return (MSScrollBar *)_owner; } void MSScrollBar::Elevator::updateBackground(unsigned long oldbg_) { MSWidgetCommon::updateBackground(oldbg_); redraw(); } void MSScrollBar::Elevator::configure(void) { draw(); } void MSScrollBar::Elevator::redraw(void) { draw(); } void MSScrollBar::Elevator::drawArrows(void) { if (mapped()==MSTrue&&_arrow1!=0&&_arrow2!=0) { _arrow1->draw(); _arrow2->draw(); } } MSScrollBar::DelayTimer::DelayTimer(MSScrollBar *scrollBar_,unsigned long msec_) : MSRegularTimer(msec_,0) { _scrollbar=scrollBar_; } MSScrollBar::DelayTimer::~DelayTimer(void) {} void MSScrollBar::DelayTimer::process(void) { _scrollbar->processDelayTimer(); } MSScrollBar::RepeatTimer::RepeatTimer(MSScrollBar *scrollBar_,unsigned long interval_) : MSIntervalTimer(interval_) { _scrollbar=scrollBar_; } MSScrollBar::RepeatTimer::~RepeatTimer(void) {} void MSScrollBar::RepeatTimer::process(void) { _scrollbar->processRepeatTimer(); } void MSScrollBar::processRepeatTimer(void) { repeat(); } void MSScrollBar::processDelayTimer(void) { delay(); } MSScrollBar::PopupMenu::PopupMenu(MSScrollBar *scrollbar_) : MSPopupMenu(scrollbar_->server()) { new MSMenuItem(this,"Openlook",'O',Openlook); new MSMenuItem(this,"Motif",'M',Motif); // new MSMenuItem(this,"Windows",'W',Windows); -- for the future new MSMenuItem(this,"Home",'H',GotoTop); new MSMenuItem(this,"End",'E',GotoBottom); } void MSScrollBar::PopupMenu::activate(void) { int choice=activeMenuItem()->tag(); done(); if (_scrollbar!=0) { switch (choice) { case Openlook: _scrollbar->style(MSScrollBar::Openlook); break; case Motif: _scrollbar->style(MSScrollBar::Motif); break; case Windows: _scrollbar->style(MSScrollBar::Windows); break; case GotoTop: _scrollbar->value(_scrollbar->min()); break; case GotoBottom: _scrollbar->value(_scrollbar->max()); break; default: break; } } } void MSScrollBar::PopupMenu::scrollbar(MSScrollBar *scrollbar_) { _scrollbar=scrollbar_; background(_scrollbar->background()); foreground(_scrollbar->foreground()); } MSScrollBar::MSScrollBar(MSWidget *owner_,int min_,int max_,int inc_) : MSPrimitive(owner_) { _style=defaultStyle(); _elevator=0; _cablePixmap=0; _min=min_; _max=max_; _inc=inc_; int delta=_max-_min; _viewSize=(int)delta/10; if (delta<100) _viewSize=delta<10?delta:10; if (viewSize()<1) _viewSize=1; if (viewSize()>(max()-min())) _viewSize=(max()-min()); init(); } MSScrollBar::~MSScrollBar(void) { if (_elevator!=0) delete _elevator; if (_cablePixmap!=0) delete _cablePixmap; if (_delayTimer!=0) delete _delayTimer; if (_repeatTimer!=0) delete _repeatTimer; } MSScrollBar::PopupMenu *MSScrollBar::popupMenu(void) { PopupMenu *menu; if ((menu=(PopupMenu*)server()->scrollBarMenu())==0) { menu=new PopupMenu(this); server()->scrollBarMenu(menu); } return menu; } void MSScrollBar::init(void) { _acceptFocus=MSFalse; _changeType=NoChange; _pageInc=(_max>10)?10:_max; _value=0; _savedValue=0; _initial_x=0; _initial_y=0; _separation_x=0; _separation_y=0; _highlightThickness=0; _shadowThickness=1; _slidingOn=MSFalse; _markersOn=MSTrue; _elevatorOn=MSTrue; _repeatTimer=0; _repeatTimer=new RepeatTimer(this,MSScrollBarDefaultRepeatInterval); _repeatOn=MSTrue; stopRepeatTimer(); _delayTimer=0; if (style()==MSScrollBar::Motif) { XSetWindowBackground(display(),window(),selectShadowColor()); } selectInput(MSScrollBarEventMask); } void MSScrollBar::firstMapNotify(void) { setCablePixmap(); } void MSScrollBar::updateBackground(unsigned long oldbg_) { MSWidgetCommon::updateBackground(oldbg_); _elevator->background(background()); if (style()==MSScrollBar::Motif) { XSetWindowBackground(display(),window(),selectShadowColor()); } else { XSetWindowBackground(display(),window(),background()); } setCablePixmap(); redraw(); } void MSScrollBar::setCablePixmap(void) { if (firstMap()==MSTrue) { if (cablePixmap()!=0) delete _cablePixmap; if (style()==MSScrollBar::Openlook) { _cablePixmap=new MSPixmap(server(),MSPixmap::ForegroundFiftyPixmap, bottomShadowColor(),background()); XSetTile(display(),bottomShadowGC(),cablePixmap()->pixmap()); } else _cablePixmap=0; } } void MSScrollBar::style(MSScrollBar::Style style_) { if (style()!=style_) { _style=style_; if (style()==MSScrollBar::Motif) { XSetWindowBackground(display(),window(),selectShadowColor()); } else { XSetWindowBackground(display(),window(),background()); } setCablePixmap(); configure(); XClearWindow(display(),window()); redraw(); } } void MSScrollBar::defaultStyle(MSScrollBar::Style style_) { _defaultStyle=style_; } int MSScrollBar::calcSliderValue(int,int) { return 0; } void MSScrollBar::inc(int inc_) { if (inc_>0&&inc_<=(max()-min())) _inc=inc_; } void MSScrollBar::pageInc(int pInc_) { if (pInc_>0&&pInc_<=(max()-min())) _pageInc=pInc_; } void MSScrollBar::viewSize(int size_) { if (size_==viewSize()) return; int delta=(max()-min()); if (size_<1) { if (deltadelta) { if (deltamax()-viewSize()) { _value=max()-viewSize(); _changeType=ValueChange; notify(value()); } configureElevator(); redrawElevator(); } void MSScrollBar::view(int start_,int size_) { if (value()!=start_||viewSize()!=size_) { if (start_>=min()&&start_+size_<=max()) { _value=start_; _viewSize=size_; configureElevator(); redrawElevator(); } } } void MSScrollBar::valueChange(int value_) { if (value_==value()&&value()<=max()-viewSize()) return; if (value_max()-viewSize()) _value=max()-viewSize(); else _value=value_; redrawElevator(); } void MSScrollBar::min(int min_) { if (min_!=min()&&min_<=max()) { _min=min_; if (value()=min()) { _max=max_; if (value()>max()-viewSize()) _value=max()-viewSize(); configureElevator(); redrawElevator(); } } void MSScrollBar::value(int value_) { if (value_!=value()) { valueChange(value_); _changeType=ValueChange; notify(value()); // invoke callback } } void MSScrollBar::expose(const XEvent *pEvent_) { if (mapped()==MSTrue&&owner()->mapped()==MSTrue&&frozen()==MSFalse) { int offset=highlightThickness()+shadowThickness(); if (pEvent_->xexpose.width==width()||pEvent_->xexpose.height==height()) { redraw(); } else if ((pEvent_->xexpose.x>=sliderAreaRect().x())&& (pEvent_->xexpose.y>=sliderAreaRect().y())&& (pEvent_->xexpose.width<=sliderAreaRect().width())&& (pEvent_->xexpose.height<=sliderAreaRect().height())) { // nothing to do at this time } else { if (style()==MSScrollBar::Openlook) { drawMarkers(); drawElevatorCable(); drawPropIndicator(); } else { drawArrows(); drawSunken(); } } } } void MSScrollBar::redraw(void) { if (mapped()==MSTrue&&owner()->mapped()==MSTrue&&frozen()==MSFalse) { drawMarkers(); redrawElevator(); drawSunken(); } } void MSScrollBar::drawElevator(void) { if (mapped()==MSTrue&&owner()->mapped()==MSTrue) _elevator->draw(); } void MSScrollBar::drawArrows(void) { if (style()==MSScrollBar::Motif&&mapped()==MSTrue&&owner()->mapped()==MSTrue) { _elevator->drawArrows(); } } void MSScrollBar::configure(void) { switch (style()) { case Openlook: configureForOpenlook(); break; case Motif: configureForMotif(); break; case Windows: configureForWindows(); break; } } void MSScrollBar::configureForWindows(void) { configureForMotif(); } void MSScrollBar::updateSliderValue(void) { int changeAmount=0; int tempValue; int savedValue=value(); switch (changeType()) { case Inc: changeAmount=inc(); break; case Dec: changeAmount=-inc(); break; case PageDown: changeAmount=pageInc(); break; case PageUp: changeAmount=-pageInc(); break; case Home: changeAmount=min()-value(); break; case End: changeAmount=(max()-viewSize())-value(); break; case NoChange: case Drag: case ValueChange: changeAmount=0; break; } // tempValue contains the possible new scroll bar value // Depending on the change type,adjust this new value // if it extends beyound the bounds of the value range. tempValue=value()+changeAmount; if (changeType()==Inc||changeType()==PageDown) { if (tempValue>max()-viewSize()) tempValue=max()-viewSize(); if (tempValue<=value()) return; } else if (changeType()==Dec||changeType()==PageUp) { if (tempValue=value()) return; } else { if (tempValue>max()-viewSize()) tempValue=max()-viewSize(); if (tempValue_arrow1->selected()==MSTrue) _elevator->_arrow1->select(MSFalse); if (_elevator->_arrow2->selected()==MSTrue) _elevator->_arrow2->select(MSFalse); if (_delayTimer!=0) { _delayTimer->stop(); _delayTimer=0; } stopRepeatTimer(); if (slidingOn()==MSTrue&&changeType()==Drag) { _changeType=ValueChange; _slidingOn=MSFalse; notify(_value); } _slidingOn=MSFalse; _changeType=NoChange; } void MSScrollBar::startDelayTimer(void) { if (_delayTimer!=0) { _delayTimer->stop(); _delayTimer=0; } _delayTimer=new DelayTimer(this,MSScrollBarDefaultInitialDelay); } void MSScrollBar::startRepeatTimer(void) { if (repeatOn()!=MSTrue) { _repeatOn=MSTrue; _repeatTimer->reset(); } } void MSScrollBar::stopRepeatTimer(void) { if (repeatOn()==MSTrue) { _repeatTimer->stop(); _repeatOn=MSFalse; } } void MSScrollBar::increment(void) { activateCallback(MSWidgetCallback::increment); change(); } void MSScrollBar::decrement(void) { activateCallback(MSWidgetCallback::decrement); change(); } void MSScrollBar::pageDown(void) { activateCallback(MSWidgetCallback::pagedecrement); change(); } void MSScrollBar::pageUp(void) { activateCallback(MSWidgetCallback::pageincrement); change(); } void MSScrollBar::drag(void) { activateCallback(MSWidgetCallback::drag); change(); } void MSScrollBar::home(void) { activateCallback(MSWidgetCallback::home); change(); } void MSScrollBar::end(void) { activateCallback(MSWidgetCallback::end); change(); } void MSScrollBar::change(void) { activateCallback(MSWidgetCallback::valuechange); } void MSScrollBar::notify(int) { switch(changeType()) { case Inc: increment(); break; case Dec: decrement(); break; case PageDown: pageDown(); break; case PageUp: pageUp(); break; case Drag: drag(); break; case ValueChange: change(); break; case Home: home(); break; case End: end(); break; case NoChange: break; } } void MSScrollBar::repeat(void) { unsigned int mask=Button1Mask; unsigned int keys=mask; int ix=0,iy=0; int rx=0,ry=0; Window root,child; XQueryPointer(display(),window(),&root,&child,&rx,&ry,&ix,&iy,&keys); if ((keys&mask)==mask) updateSliderValue(); else release(); } void MSScrollBar::delay(void) { _delayTimer=0; startRepeatTimer(); } void MSScrollBar::buttonPress(const XEvent *pXEvent_) { if (isProtected()==MSFalse) buttonPressNotify(this,pXEvent_); } void MSScrollBar::buttonRelease(const XEvent *pXEvent_) { if (isProtected()==MSFalse) { if (pXEvent_->xbutton.button==Button1||pXEvent_->xbutton.button==Button2) release(); } } void MSScrollBar::button1Press(const XEvent *pXEvent_) { switch (style()) { case Openlook: openlookButton1Press(pXEvent_); break; case Windows: case Motif: motifButton1Press(pXEvent_); break; } } void MSScrollBar::button2Press(const XEvent *pXEvent_) { switch (style()) { case Openlook: openlookButton2Press(pXEvent_); break; case Windows: case Motif: motifButton2Press(pXEvent_); break; } } void MSScrollBar::button3Press(const XEvent *) { int xx,yy; pointerXY(xx,yy); PopupMenu *menu=popupMenu(); // force creation of popupMenu - this is ugly menu->scrollbar(this); menu->moveTo(xx,yy); menu->show(); } // ######################################################### // default virtual methods - prevents gratuitous inlining // ######################################################### void MSScrollBar::Elevator::draw(void) {} void MSScrollBar::Elevator::select(void) {} void MSScrollBar::Elevator::unselect(void) {} void MSScrollBar::redrawElevator(void) {} void MSScrollBar::configureElevator(void) {} void MSScrollBar::drawElevatorCable(void) {} void MSScrollBar::drawPropIndicator(void) {} void MSScrollBar::drawMarkers(void) {} void MSScrollBar::adjustPointer(void) {} void MSScrollBar::calcPropIndicator(void) {} void MSScrollBar::openlookButton1Press(const XEvent*) {} void MSScrollBar::openlookButton2Press(const XEvent*) {} void MSScrollBar::motifButton1Press(const XEvent*) {} void MSScrollBar::motifButton2Press(const XEvent*) {} void MSScrollBar::configureForOpenlook(void) {} void MSScrollBar::configureForMotif(void) {} // ######################################################### // inline methods // ######################################################### int MSScrollBar::min(void) const { return _min; } int MSScrollBar::max(void) const { return _max; } int MSScrollBar::inc(void) const { return _inc; } int MSScrollBar::pageInc(void) const { return _pageInc; } int MSScrollBar::value(void) const { return _value; } int MSScrollBar::viewSize(void) const { return _viewSize; } MSScrollBar::Style MSScrollBar::style(void) const { return _style; } MSScrollBar::Style MSScrollBar::defaultStyle(void) { return _defaultStyle; } MSRect& MSScrollBar::sliderAreaRect(void) { return _sliderAreaRect; } MSPixmap *MSScrollBar::cablePixmap(void) const { return _cablePixmap; } MSScrollBar::Elevator *MSScrollBar::elevator(void) const { return _elevator; } MSScrollBar::Change MSScrollBar::changeType(void) const { return _changeType; } MSTimer *MSScrollBar::delayTimer(void) const { return _delayTimer; } MSTimer *MSScrollBar::repeatTimer(void) const { return _repeatTimer; } MSBoolean MSScrollBar::repeatOn(void) const { return _repeatOn; } MSBoolean MSScrollBar::slidingOn(void) const { return _slidingOn; } MSBoolean MSScrollBar::markersOn(void) const { return _markersOn; } MSBoolean MSScrollBar::elevatorOn(void) const { return _elevatorOn; } aplus-fsf-4.22/src/MSGUI/MSScrollableWidget.C0000644000265000001440000002603310772770412014276 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include // MSScrollableWidget is a composite widget which manages four different widgets: // a vertical scrollbar, a horizontal scrollbar, a viewport widget, and // a draw area widget. The draw area widget is a child of the viewport widget. // MSScrollableWiget is a subclass of MSWidgetCommon but adds no new public interface. // It is meant to be subclassed, and the subclass is responsible to control the size of // the draw area widget as well as its content. // // Subclass should overrides the redrawDrawArea() method to redraw its content. // const int MSScrollableWidgetDefaultShadowThickness=2; const int MSScrollableWidgetDefaultHighlightThickness=2; const int MSScrollableWidgetDefaultNaturalWidth=300; const int MSScrollableWidgetDefaultNaturalHeight=300; const int MSScrollableWidgetDefaultScrollBarSize=15; MSScrollableWidget::Vsb::Vsb(MSWidget *owner_) : MSVScrollBar(owner_) { inc(2); highlightThickness(0); acceptFocus(MSFalse); width(MSScrollableWidgetDefaultScrollBarSize); } MSScrollableWidget::Vsb::~Vsb(void) {} void MSScrollableWidget::Vsb::change(void) { scrollableWidget()->vsbChange(); XFlush(display()); } void MSScrollableWidget::Vsb::drag(void) { scrollableWidget()->vsbChange(); server()->dispatch(); } MSScrollableWidget::Hsb::Hsb(MSWidget *owner_) : MSHScrollBar(owner_) { inc(2); highlightThickness(0); acceptFocus(MSFalse); height(MSScrollableWidgetDefaultScrollBarSize); } MSScrollableWidget::Hsb::~Hsb(void) {} void MSScrollableWidget::Hsb::change(void) { scrollableWidget()->hsbChange(); XFlush(display()); } void MSScrollableWidget::Hsb::drag(void) { scrollableWidget()->hsbChange(); server()->dispatch(); } MSScrollableWidget::ViewPort::ViewPort(MSWidget *owner_) : MSWidgetCommon(owner_) { _shadowThickness=0; _highlightThickness=0; selectInput(ExposureMask); } void MSScrollableWidget::ViewPort::redraw(void) {scrollableWidget()->redrawViewPort();} MSScrollableWidget::DrawAreaWidget::DrawAreaWidget(MSWidget *owner_) : MSWidgetCommon(owner_) { _shadowThickness=0; _highlightThickness=0; selectInput(ExposureMask); } void MSScrollableWidget::DrawAreaWidget::redraw(void) {scrollableWidget()->redrawDrawArea();} MSScrollableWidget::MSScrollableWidget(MSWidget *owner_) : MSWidgetCommon(owner_) {init();} MSScrollableWidget::~MSScrollableWidget(void) { vsb()->destroy(); hsb()->destroy(); drawAreaWidget()->destroy(); viewPort()->destroy(); } void MSScrollableWidget::init(void) { _shadowStyle=MSSunken; _shadowThickness=MSScrollableWidgetDefaultShadowThickness; _highlightThickness=MSScrollableWidgetDefaultHighlightThickness; _vsb=new Vsb(this); _hsb=new Hsb(this); _viewPort=new ViewPort(this); int offset=highlightThickness()+shadowThickness(); _viewPort->moveTo(offset,offset); _drawAreaWidget=new DrawAreaWidget(_viewPort); _naturalWidth=MSScrollableWidgetDefaultNaturalWidth; _naturalHeight=MSScrollableWidgetDefaultNaturalHeight; addToFocusList(); selectInput(ExposureMask); } void MSScrollableWidget::show(void) { if (mapped()==MSFalse) { drawAreaWidget()->show(); viewPort()->show(); map(); } } void MSScrollableWidget::redraw(void) { if (mapped()==MSTrue) { redrawDrawAreaImmediately(); redrawViewPortImmediately(); redrawScrollableWidgetImmediately(); } } void MSScrollableWidget::print(const char *file_) { MSBoolean fileOpen=MSFalse; MSBoolean open=MSTrue; if (outputMode()==Draw) { if (file_!=0) displayPrintFileName(file_); if ((open=displayPrintOpen(this))==MSTrue) { fileOpen=MSTrue; outputMode(Print); displayPrintXorigin(0); displayPrintYorigin(0); } } if (open==MSTrue) { displayPrintOriginInc(drawAreaWidget()); redrawDrawAreaImmediately(); displayPrintOriginDec(drawAreaWidget()); displayPrintOriginInc(viewPort()); redrawViewPortImmediately(); displayPrintOriginDec(viewPort()); redrawScrollableWidgetImmediately(); if (vsb()->mapped()) { displayPrintOriginInc(vsb()); vsb()->redraw(); displayPrintOriginDec(vsb()); } if (hsb()->mapped()) { displayPrintOriginInc(hsb()); hsb()->redraw(); displayPrintOriginDec(hsb()); } if (fileOpen==MSTrue) { displayPrintClose(); outputMode(Draw); } } } void MSScrollableWidget::expose(const XEvent *pEvent_) { if (pEvent_->xexpose.count==0) { XEvent aEvent; while (XCheckWindowEvent(display(),_window,ExposureMask,&aEvent)==True); redrawScrollableWidget(); } } void MSScrollableWidget::focusIn(void) { highlight(); } void MSScrollableWidget::focusOut(void) { unHighlight(); } void MSScrollableWidget::updateBackground(unsigned long oldBg_) { MSWidgetCommon::updateBackground(oldBg_); vsb()->background(background()); hsb()->background(background()); viewPort()->background(background()); drawAreaWidget()->background(background()); redraw(); } void MSScrollableWidget::redrawScrollableWidgetImmediately(void) { if (mapped()==MSTrue) redrawScrollableWidget(); } void MSScrollableWidget::redrawScrollableWidget(void) { if (highlightThickness()>0) { GC gc=(highlighted()==MSTrue)?highlightGC():backgroundShadowGC(); drawFlatShadow(window(),MSRect(0,topShadowOffset(),width(),height()-topShadowOffset()), highlightThickness(),gc); } if (shadowThickness()>0) { int viewWidth=width()-highlightThickness()*2; viewWidth-=(vsb()->mapped()==MSTrue)?vsb()->width():0; int viewHeight=height()-highlightThickness()*2; viewHeight-=(hsb()->mapped()==MSTrue)?hsb()->height():0; drawBevel(window(),MSRect(highlightThickness(),highlightThickness(),viewWidth,viewHeight),shadowStyle(),shadowThickness()); } } void MSScrollableWidget::redrawDrawAreaImmediately(void) { if (mapped()==MSTrue) redrawDrawArea(); } void MSScrollableWidget::redrawDrawArea(void) {} void MSScrollableWidget::redrawViewPortImmediately(void) { if (mapped()==MSTrue) redrawViewPort(); } void MSScrollableWidget::redrawViewPort(void) {} void MSScrollableWidget::firstMapNotify(void) { naturalSize(); } void MSScrollableWidget::naturalSize(void) { if (firstMap()==MSTrue) { int w,h; int dx,dy,dw,dh; drawAreaGeometry(dx,dy,dw,dh); int margin=shadowThickness()*2+highlightThickness()*2; if (dw<=0||dw>naturalWidth()) w=naturalWidth()+margin; else w=dw+margin; if (dh<=0||dh>naturalHeight()) h=naturalHeight()+margin; else h=dh+margin; resize(w,h); } } void MSScrollableWidget::computeSize(void) { viewPort()->shadowThickness(shadowThickness()); int offset=highlightThickness()+shadowThickness(); viewPort()->moveTo(offset,offset); configure(); } void MSScrollableWidget::configure(void) { if (firstMap()==MSTrue) { //First figure out if we will be needing either //the horizontal or vertical scroll bars. int dx,dy,dw,dh; drawAreaGeometry(dx,dy,dw,dh); int offset=shadowThickness()+highlightThickness(); int margin=offset*2; int requiredWidth=dw+margin; int requiredHeight=dh+margin; if (width()>=requiredWidth) { hsb()->hide(); } else { hsb()->show(); requiredHeight+=hsb()->height(); } if (height()>=requiredHeight) { vsb()->hide(); } else { vsb()->show(); if (hsb()->mapped()==MSFalse) { requiredWidth+=vsb()->width(); if (width()show(); } } //Reposition the draw area if necessary. We're using //a NorthWest gravity policy here in positioning the draw area, //meaning that we're going to preverse the (x,y) location as //much as possible int xpos=dx; int ypos=dy; int viewableWidth=width()-margin; if (vsb()->mapped()) viewableWidth-=vsb()->width(); int viewableHeight=height()-margin; if (hsb()->mapped()) viewableHeight-=hsb()->height(); if (hsb()->mapped()==MSTrue) { if ((dw+dx)mapped()==MSTrue) { if ((dh+dy)mapped()==MSTrue) { int w=(vsb()->mapped()==MSTrue)? width()-vsb()->width()-highlightThickness()*2: width()-highlightThickness()*2; w=(w>0)?w:1; hsb()->width(w); hsb()->moveTo(highlightThickness(),height()-highlightThickness()-hsb()->height()); hsb()->min(0); hsb()->max(dw); hsb()->viewSize(viewableWidth); hsb()->pageInc(viewableWidth); // int value; // if (dx>=0) value=offset-dx; // else value=-dx+offset; // hsb()->valueChange(value); hsb()->valueChange(-xpos); } else hsb()->valueChange(0); if (vsb()->mapped()==MSTrue) { int h=(hsb()->mapped()==MSTrue)?height()-hsb()->height()-highlightThickness()*2:height()-highlightThickness()*2; h=(h>0)?h:1; vsb()->height(h); vsb()->moveTo(width()-highlightThickness()-vsb()->width(),highlightThickness()); vsb()->min(0); vsb()->max(dh); vsb()->viewSize(viewableHeight); vsb()->pageInc(viewableHeight); // int value; // if (dy>=0) value=offset-dy; // else value=-dy+offset; // vsb()->valueChange(value); vsb()->valueChange(-ypos); } else vsb()->valueChange(0); // Resize the viewport int w=viewableWidth; int h=viewableHeight; w=(w>0)?w:1; h=(h>0)?h:1; resizeViewPort(w,h); } } void MSScrollableWidget::drawAreaXY(int &x_,int &y_) { int offset=highlightThickness()+shadowThickness(); x_=x_-offset-drawAreaWidget()->x(); y_=y_-offset-drawAreaWidget()->y(); } void MSScrollableWidget::viewPortXY(int &x_,int &y_) { int offset=highlightThickness()+shadowThickness(); x_=x_-offset; y_=y_-offset; } void MSScrollableWidget::moveDrawArea(int x_,int y_) {drawAreaWidget()->moveTo(x_,y_);} void MSScrollableWidget::resizeDrawArea(int w_,int h_) { drawAreaWidget()->resize(w_,h_); configure(); } void MSScrollableWidget::resizeViewPort(int w_,int h_) {viewPort()->resize(w_,h_);} void MSScrollableWidget::vsbChange(void) {moveDrawArea(drawAreaWidget()->x_origin(),vsb()->min()-vsb()->value());} void MSScrollableWidget::hsbChange(void) {moveDrawArea(hsb()->min()-hsb()->value(),drawAreaWidget()->y_origin());} void MSScrollableWidget::drawAreaGeometry(int &x_,int &y_,int &w_,int &h_) { x_=drawAreaWidget()->x(); y_=drawAreaWidget()->y(); w_=drawAreaWidget()->width(); h_=drawAreaWidget()->height(); } aplus-fsf-4.22/src/MSGUI/MSScrolledWindow.C0000644000265000001440000002310110772770412014000 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include static const int DefaultScrollBarSize=15; static const int DefaultViewHeight=300; static const int DefaultViewWidth=300; MSScrolledWindow::MSScrolledWindow(MSWidget *owner_) : MSManager(owner_) { init(); } MSScrolledWindow::~MSScrolledWindow(void) { if (hsb()!=0) safeDestroy(hsb()); if (vsb()!=0) safeDestroy(vsb()); if (clipWindow()!=0) safeDestroy(clipWindow()); _hsb=0,_vsb=0,_clipWindow=0; if (scrollWindow()!=0) safeDestroy(scrollWindow()); _scrollWindow=0; } void MSScrolledWindow::init(void) { _hsb=0,_vsb=0,_clipWindow=0,_scrollWindow=0; _shadowThickness=0; _highlightThickness=0; _clipWindow=new MSPrimitive(this); clipWindow()->highlightThickness(0); clipWindow()->shadowThickness(0); clipWindow()->sensitive(MSFalse); clipWindow()->acceptFocus(MSFalse); // clipWindow()->map(); _vsb=new Vsb(this); _hsb=new Hsb(this); _viewHeight=DefaultViewHeight; _viewWidth=DefaultViewWidth; _scrollBarDisplayPolicy=Static; computeSize(); } MSScrolledWindow::Hsb::Hsb(MSWidget *owner_) : MSHScrollBar(owner_) { inc(2); highlightThickness(0); acceptFocus(MSFalse); height(DefaultScrollBarSize); // map(); } MSScrolledWindow::Hsb::~Hsb(void) {} MSScrolledWindow::Vsb::Vsb(MSWidget *owner_) : MSVScrollBar(owner_) { inc(2); highlightThickness(0); acceptFocus(MSFalse); width(DefaultScrollBarSize); // map(); } MSScrolledWindow::Vsb::~Vsb(void) {} void MSScrolledWindow::show(void) { if (mapped()==MSFalse) { if (scrollWindow()!=0) scrollWindow()->show(); map(); } } // _clipWindow will be zero when this gets called for it void MSScrolledWindow::childInsert(MSWidget *pWidget_) { if (clipWindow()!=0&&vsb()!=0&&hsb()!=0) { if (clipWindow()!=pWidget_&&vsb()!=pWidget_&&hsb()!=pWidget_&&scrollWindow()==0) { _scrollWindow=pWidget_; placement(); } } } void MSScrolledWindow::childRemove(MSWidget *pWidget_) { if (scrollWindow()==pWidget_) { _scrollWindow=0; placement(); } } void MSScrolledWindow::childCreate(MSWidget *pWidget_) { childInsert(pWidget_); } void MSScrolledWindow::childDestroy(MSWidget *pWidget_) { childRemove(pWidget_); } void MSScrolledWindow::visibilityObscured(void) { visible(MSFalse); if (scrollWindow()!=0) visibilityObscuredNotify(scrollWindow()); } void MSScrolledWindow::visibilityUnobscured(void) { visible(MSTrue); if (scrollWindow()!=0) visibilityUnobscuredNotify(scrollWindow()); } void MSScrolledWindow::focusIn(void) { highlight(); } void MSScrolledWindow::focusOut(void) { unHighlight(); } void MSScrolledWindow::placement(void) { if (clipWindow()==0||vsb()==0||hsb()==0) return; int offset=highlightThickness()+shadowThickness(); int sH=1; int sW=1; if (scrollWindow()!=0) { sW=scrollWindow()->width(); sH=scrollWindow()->height(); scrollWindow()->moveTo(offset,offset); } int availableWidth=width()-2*offset; int availableHeight=height()-2*offset; if (scrollBarDisplayPolicy()==Static) { clipWindow()->map(); vsb()->map(); hsb()->map(); _viewHeight=availableHeight-hsb()->height(); _viewWidth=availableWidth-vsb()->width(); } else { if (sW>availableWidth||sH>availableHeight) { clipWindow()->map(); vsb()->map(); hsb()->map(); _viewHeight=availableHeight-hsb()->height(); _viewWidth=availableWidth-vsb()->width(); } else { clipWindow()->unmap(); vsb()->unmap(); hsb()->unmap(); _viewHeight=availableHeight; _viewWidth=availableWidth; } } if (vsb()->mapped()) { int vH=height()-hsb()->height(); int vW=width()-vsb()->width(); hsb()->moveTo(offset,vH); hsb()->min(0); hsb()->valueChange(0); if (sW-vW>0) hsb()->max(sW); else hsb()->max(vW); hsb()->pageInc(vW); hsb()->viewSize(vW); hsb()->width(vW); hsb()->raise(); vsb()->moveTo(vW,offset); vsb()->min(0); vsb()->valueChange(0); if (sH-vH>0) vsb()->max(sH); else vsb()->max(vH); vsb()->pageInc(vH); vsb()->viewSize(vH); vsb()->height(vH); vsb()->raise(); vsb()->value(0); hsb()->value(0); clipWindow()->resize(vsb()->width(),hsb()->height()); clipWindow()->moveTo(hsb()->x_origin()+vW,vsb()->y_origin()+vH); clipWindow()->raise(); } } void MSScrolledWindow::childConfigure(MSWidget *pWidget_) { if (pWidget_==scrollWindow()) placement(); } void MSScrolledWindow::computeSize(void) { MSBoolean needScrollBar=MSFalse; if (clipWindow()!=0&&vsb()!=0&&hsb()!=0) { int offset=highlightThickness()+shadowThickness(); int cumWidth=viewWidth(); int cumHeight=viewHeight(); if (scrollBarDisplayPolicy()==Static) needScrollBar=MSTrue; else { if (scrollWindow()!=0) { if (viewWidth()width()||viewHeight()height()) needScrollBar=MSTrue; } } // If we need scroll bar and the current policy is AsNeeded, we have to // temporarily set the scroll bar policy to Static so the placement() // method triggered by the resize() will do the right thing. ScrollBarDisplayPolicy policy=scrollBarDisplayPolicy(); if (needScrollBar==MSTrue) { if(policy==AsNeeded) _scrollBarDisplayPolicy=Static; cumWidth+=vsb()->width(); cumHeight+=hsb()->height(); } resize(cumWidth+2*offset,cumHeight+2*offset); _scrollBarDisplayPolicy=policy; } } void MSScrolledWindow::updateBackground(unsigned long oldbg_) { MSWidgetCommon::updateBackground(oldbg_); clipWindow()->background(background()); if (vsb()->background()==oldbg_) vsbBackground(background()); if (hsb()->background()==oldbg_) hsbBackground(background()); } void MSScrolledWindow::viewHeight(int height_) { if (viewHeight()!=height_) { _viewHeight=height_; computeSize(); } } void MSScrolledWindow::viewWidth(int width_) { if (viewWidth()!=width_) { _viewWidth=width_; computeSize(); } } void MSScrolledWindow::scrollBarSize(int size_) { vsb()->width(size_); hsb()->height(size_); computeSize(); } void MSScrolledWindow::Vsb::change(void) { if (scrolledWindow()->scrollWindow()!=0) { scrolledWindow()->scrollWindow()->moveTo(scrolledWindow()->scrollWindow()->x_origin(), min()-value()); XFlush(display()); } } void MSScrolledWindow::Vsb::drag(void) { if (scrolledWindow()->scrollWindow()!=0) { scrolledWindow()->scrollWindow()->moveTo(scrolledWindow()->scrollWindow()->x_origin(), min()-value()); server()->dispatch(); } } void MSScrolledWindow::Hsb::change(void) { if (scrolledWindow()->scrollWindow()!=0) { scrolledWindow()->scrollWindow()->moveTo(min()-value(), scrolledWindow()->scrollWindow()->y_origin()); XFlush(display()); } } void MSScrolledWindow::Hsb::drag(void) { if (scrolledWindow()->scrollWindow()!=0) { scrolledWindow()->scrollWindow()->moveTo(min()-value(), scrolledWindow()->scrollWindow()->y_origin()); server()->dispatch(); } } void MSScrolledWindow::naturalSize(void) { _viewHeight=DefaultViewHeight; _viewWidth=DefaultViewWidth; computeSize(); if (scrollWindow()!=0) scrollWindow()->naturalSize(); } MSWidgetVector MSScrolledWindow::children(void) { MSWidgetVector vector; if (scrollWindow()!=0) vector.append(scrollWindow()); return vector; } void MSScrolledWindow::scrollBarDisplayPolicy(ScrollBarDisplayPolicy scrollBarDisplayPolicy_) { if (_scrollBarDisplayPolicy!=scrollBarDisplayPolicy_) { _scrollBarDisplayPolicy=scrollBarDisplayPolicy_; computeSize(); } } void MSScrolledWindow::print(const char *file_) { MSBoolean fileOpen=MSFalse; if (outputMode()==Draw) { if (file_!=0) displayPrintFileName(file_); if (displayPrintOpen(this)==MSTrue) { fileOpen=MSTrue; outputMode(Print); displayPrintXorigin(0); displayPrintYorigin(0); } else return; } if (mapped()==MSTrue) redraw(); if(scrollWindow()!=0&&scrollWindow()->mapped()==MSTrue) { displayPrintOriginInc(scrollWindow()); scrollWindow()->print(); displayPrintOriginDec(scrollWindow()); } if (fileOpen==MSTrue) { displayPrintClose(); outputMode(Draw); } } void MSScrolledWindow::set(MSAttrValueList& avList_) { MSManager::set(avList_); MSIndexVector index; for (unsigned i=0;i static const int MSSeparatorDefaultHighlightThickness=0; static const int MSSeparatorDefaultShadowThickness=0; static const int MSSeparatorEventMask=ExposureMask; static const int MSSeparatorDefaultThickness=1; MSSeparator::MSSeparator(MSWidget *owner_): MSWidgetCommon(owner_) { init(); } void MSSeparator::init(void) { _highlightThickness=MSSeparatorDefaultHighlightThickness; _shadowThickness=MSSeparatorDefaultShadowThickness; _thickness=MSSeparatorDefaultThickness; acceptFocus(MSFalse); dynamic(MSTrue); selectInput(MSSeparatorEventMask); } void MSSeparator::marginWidth(int marginWidth_) { if (_marginWidth!=marginWidth_) { _marginWidth=marginWidth_; computeSize(); } } void MSSeparator::marginHeight(int marginHeight_) { if (_marginHeight!=marginHeight_) { _marginHeight=marginHeight_; computeSize(); } } void MSSeparator::thickness(int thickness_) { if (_thickness!=thickness_) { _thickness=thickness_; computeSize(); } } void MSSeparator::updateBackground(unsigned long oldbg_) { MSWidgetCommon::updateBackground(oldbg_); redraw(); } void MSSeparator::naturalSize(void) { resize((marginWidth()+shadowThickness()+highlightThickness()+thickness())*2, (marginHeight()+shadowThickness()+highlightThickness()+thickness())*2); } MSAttrValueList& MSSeparator::get(MSAttrValueList& avList_) { avList_< MSSeparatorMenuItem::MSSeparatorMenuItem(MSMenu *owner_) : MSMenuItem(owner_) { init(); } MSSeparatorMenuItem::~MSSeparatorMenuItem(void) {} void MSSeparatorMenuItem::init(void) { _highlightThickness=0; _shadowThickness=1; _marginHeight=0; _marginWidth=0; sensitive(MSFalse); } void MSSeparatorMenuItem::computeSize(void) { height((marginHeight()+shadowThickness())<<1); } void MSSeparatorMenuItem::drawSymbol(void) { int offset=shadowThickness(); int x=x_origin()+marginWidth(),y=y_origin()+marginHeight(); int Width=width()-(marginWidth()<<1); XFillRectangle(display(),owner()->window(),bottomShadowGC(), x,y,Width,offset); XBFillRectangle(display(),owner()->window(),topShadowGC(), x,y+offset,Width,offset); } aplus-fsf-4.22/src/MSGUI/MSShadow.C0000644000265000001440000003665510772770412012310 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #ifndef MSWidgetHEADER #include #endif #include static const unsigned long MaxIntensity=65535; // Contributions of each primary to overall luminosity,sum to 1.0 static const double RedLuminosity =0.3; static const double GreenLuminosity=0.59; static const double BlueLuminosity =0.11; // Percent effect of intensity,light,and luminosity & on brightness, static const unsigned long IntensityFactor =25; static const unsigned long LightFactor =0; static const unsigned long LuminosityFactor=75; // Thresholds for brightness // above Lite threshold,Lite color model is used // below Dark threshold,Dark color model is be used // use Std color model in between static const unsigned long ColorLiteThreshold =(unsigned long)(0.77*MaxIntensity); static const unsigned long ForegroundThreshold=(unsigned long)(0.35*MaxIntensity); static const unsigned long ColorDarkThreshold =(unsigned long)(0.15*MaxIntensity); static const unsigned long ColorLiteSelFactor=15; static const unsigned long ColorLiteBsFactor =45; static const unsigned long ColorLiteTsFactor =20; static const unsigned long ColorDarkSelFactor=15; static const unsigned long ColorDarkBsFactor =30; static const unsigned long ColorDarkTsFactor =50; static const unsigned long ColorHiSelFactor=15; static const unsigned long ColorHiBsFactor =35; static const unsigned long ColorHiTsFactor =70; static const unsigned long ColorLoSelFactor =15; static const unsigned long ColorLoBsFactor =60; static const unsigned long ColorLoTsFactor =40; #ifdef MS_MULTI_THREAD MSMutex MSShadow::_shadowHashTableMutex; #endif MSShadow::ShadowColors::ShadowColors(void) { _count = 0; } MSShadow::ShadowColors::~ShadowColors(void) {} MSShadow::MSShadow(void) : _server(0),_shadowColors(0) {} MSShadow::MSShadow(MSWidget *pWidget_) : _server(pWidget_->server()),_shadowColors(0) { if (pWidget_!=0) color(pWidget_->background()); } MSShadow::MSShadow(MSDisplayServer *server_) : _server(server_),_shadowColors(0) { if (_server!=0) color(server_->defaultBackground()); } MSShadow::MSShadow(const MSShadow& aShadow_) : _server(aShadow_._server),_shadowColors(aShadow_._shadowColors) { MSGUARD(_shadowHashTableMutex); if (_shadowColors!=0) _shadowColors->increment(); } MSShadow::~MSShadow(void) { MSGUARD(_shadowHashTableMutex); deleteColors(); } void MSShadow::displayServer(MSDisplayServer *server_) { _server=server_; if (_server!=0) color(server_->defaultBackground()); } MSShadow& MSShadow::operator=(const MSShadow& aShadow_) { if (this!=&aShadow_) { MSGUARD(_shadowHashTableMutex); deleteColors(); _server=aShadow_._server; _shadowColors=aShadow_._shadowColors; if (_shadowColors!=0) _shadowColors->increment(); } return *this; } void MSShadow::deleteColors(void) { if (_shadowColors!=0) { if (_shadowColors->count()==1) { MSHashTable *sht=_server->shadowHashTable(); sht->remove(_shadowColors->_bgColor.pixel); XFreeGC(_server->display(),_shadowColors->_bgGC); XFreeGC(_server->display(),_shadowColors->_tsGC); XFreeGC(_server->display(),_shadowColors->_bsGC); XFreeGC(_server->display(),_shadowColors->_selectGC); } _shadowColors->decrement(); _shadowColors=0; } } void MSShadow::color(unsigned long pixel_) { if (_server!=0) { MSGUARD(_shadowHashTableMutex); ShadowColors *c; MSHashTable *sht=_server->shadowHashTable(); int depth=DefaultDepthOfScreen(_server->screen()); if (depth==1) { unsigned long pixel=WhitePixelOfScreen(_server->screen()); if ((unsigned long)(c=(ShadowColors *)sht->lookup(pixel))==0) { if (_shadowColors!=0) deleteColors(); _shadowColors=new ShadowColors; sht->add(pixel,(void *)_shadowColors); _shadowColors->_bgColor.pixel=pixel; _server->colorManager()->query(&_shadowColors->_bgColor); setMonochromeColors(); _server->colorManager()->allocate(&_shadowColors->_bgColor); _server->colorManager()->allocate(&_shadowColors->_fgColor); _server->colorManager()->allocate(&_shadowColors->_selectColor); _server->colorManager()->allocate(&_shadowColors->_bsColor); _server->colorManager()->allocate(&_shadowColors->_tsColor); createGCs(); } else if (_shadowColors!=c) { if (_shadowColors!=0) deleteColors(); _shadowColors=c; } } else { if ((unsigned long)(c=(ShadowColors *)sht->lookup(pixel_))==0) { if (_shadowColors!=0) deleteColors(); _shadowColors=new ShadowColors; sht->add(pixel_,(void *)_shadowColors); _shadowColors->_bgColor.pixel=pixel_; _server->colorManager()->query(&_shadowColors->_bgColor); calculateRGBColors(); _server->colorManager()->allocate(&_shadowColors->_bgColor); _server->colorManager()->allocate(&_shadowColors->_fgColor); _server->colorManager()->allocate(&_shadowColors->_selectColor); _server->colorManager()->allocate(&_shadowColors->_bsColor); _server->colorManager()->allocate(&_shadowColors->_tsColor); createGCs(); } else if (_shadowColors!=c) { if (_shadowColors!=0) deleteColors(); _shadowColors=c; } } _shadowColors->increment(); } } void MSShadow::createGCs(void) { XGCValues gcvalues; unsigned long valueMask=GCForeground|GCBackground|GCGraphicsExposures; Window root=_server->root(); gcvalues.background=_shadowColors->_bgColor.pixel; gcvalues.foreground=_shadowColors->_bgColor.pixel; gcvalues.graphics_exposures=False; _shadowColors->_bgGC=XCreateGC(_server->display(),root,valueMask,&gcvalues); gcvalues.foreground=_shadowColors->_selectColor.pixel; _shadowColors->_selectGC=XCreateGC(_server->display(),root,valueMask,&gcvalues); gcvalues.foreground=_shadowColors->_bsColor.pixel; _shadowColors->_bsGC=XCreateGC(_server->display(),root,valueMask,&gcvalues); gcvalues.foreground=_shadowColors->_tsColor.pixel; MSPixmap *tsPixmap=0; if (_shadowColors->_tsColor.pixel==_shadowColors->_bgColor.pixel) { tsPixmap=new MSPixmap(_server,MSPixmap::ForegroundFiftyPixmap, _shadowColors->_tsColor.pixel,_shadowColors->_fgColor.pixel); } else if (DefaultDepthOfScreen(_server->screen())==1) { tsPixmap=new MSPixmap(_server,MSPixmap::ForegroundFiftyPixmap, _shadowColors->_tsColor.pixel,_shadowColors->_bgColor.pixel); } if (tsPixmap!=0) { valueMask|=GCFillStyle|GCTile; gcvalues.fill_style=FillTiled; gcvalues.tile=tsPixmap->pixmap(); } _shadowColors->_tsGC=XCreateGC(_server->display(),root,valueMask,&gcvalues); } void MSShadow::setMonochromeColors(void) { if (_shadowColors->_bgColor.pixel==BlackPixelOfScreen(_server->screen())) { _shadowColors->_fgColor.pixel=WhitePixelOfScreen (_server->screen()); _shadowColors->_fgColor.red=_shadowColors->_fgColor.green= _shadowColors->_fgColor.blue=(unsigned short)MaxIntensity; _shadowColors->_bsColor.pixel=WhitePixelOfScreen(_server->screen()); _shadowColors->_bsColor.red=_shadowColors->_bsColor.green= _shadowColors->_bsColor.blue=(unsigned short)MaxIntensity; _shadowColors->_selectColor.pixel=WhitePixelOfScreen(_server->screen()); _shadowColors->_selectColor.red=_shadowColors->_selectColor.green= _shadowColors->_selectColor.blue=(unsigned short)MaxIntensity; _shadowColors->_tsColor.pixel=BlackPixelOfScreen(_server->screen()); _shadowColors->_tsColor.red=_shadowColors->_tsColor.green= _shadowColors->_tsColor.blue=0; } else if (_shadowColors->_bgColor.pixel==WhitePixelOfScreen(_server->screen())) { _shadowColors->_fgColor.pixel=BlackPixelOfScreen (_server->screen()); _shadowColors->_fgColor.red=_shadowColors->_fgColor.green= _shadowColors->_fgColor.blue=0; _shadowColors->_bsColor.pixel=BlackPixelOfScreen(_server->screen()); _shadowColors->_bsColor.red=_shadowColors->_bsColor.green= _shadowColors->_bsColor.blue=0; _shadowColors->_selectColor.pixel=BlackPixelOfScreen(_server->screen()); _shadowColors->_selectColor.red=_shadowColors->_selectColor.green= _shadowColors->_selectColor.blue=0; _shadowColors->_tsColor.pixel=WhitePixelOfScreen(_server->screen()); _shadowColors->_tsColor.red=_shadowColors->_tsColor.green= _shadowColors->_tsColor.blue=(unsigned short)MaxIntensity; } } unsigned long MSShadow::brightness(void) { unsigned long red=(unsigned long)_shadowColors->_bgColor.red; unsigned long green=(unsigned long)_shadowColors->_bgColor.green; unsigned long blue=(unsigned long)_shadowColors->_bgColor.blue; unsigned long rgbsum=(red+green+blue); unsigned long intensity=(rgbsum)/3; unsigned long luminosity=(unsigned long) ((RedLuminosity*(double)red)+ (GreenLuminosity*(double)green)+ (BlueLuminosity*(double)blue)); unsigned long maxprimary=((red>green)?((red>blue)?red:blue):((green>blue)?green:blue)); unsigned long minprimary=((red>1; return (unsigned long) (((intensity*IntensityFactor)+ (light*LightFactor)+ (luminosity*LuminosityFactor))/100); } void MSShadow::calculateColorsForLightBackground(void) { _shadowColors->_fgColor.red=0; _shadowColors->_fgColor.green=0; _shadowColors->_fgColor.blue=0; unsigned long color_value=(unsigned long)_shadowColors->_bgColor.red; color_value-=(color_value*ColorLiteSelFactor)/100; _shadowColors->_selectColor.red=(unsigned short)color_value; color_value=_shadowColors->_bgColor.green; color_value-=(color_value*ColorLiteSelFactor)/100; _shadowColors->_selectColor.green=(unsigned short)color_value; color_value=_shadowColors->_bgColor.blue; color_value-=(color_value*ColorLiteSelFactor)/100; _shadowColors->_selectColor.blue=(unsigned short)color_value; color_value=_shadowColors->_bgColor.red; color_value-=(color_value*ColorLiteBsFactor)/100; _shadowColors->_bsColor.red=(unsigned short)color_value; color_value=_shadowColors->_bgColor.green; color_value-=(color_value*ColorLiteBsFactor)/100; _shadowColors->_bsColor.green=(unsigned short)color_value; color_value=_shadowColors->_bgColor.blue; color_value-=(color_value*ColorLiteBsFactor)/100; _shadowColors->_bsColor.blue=(unsigned short)color_value; color_value=_shadowColors->_bgColor.red; color_value-=(color_value*ColorLiteTsFactor)/100; _shadowColors->_tsColor.red=(unsigned short)color_value; color_value=_shadowColors->_bgColor.green; color_value-=(color_value*ColorLiteTsFactor)/100; _shadowColors->_tsColor.green=(unsigned short)color_value; color_value=_shadowColors->_bgColor.blue; color_value-=(color_value*ColorLiteTsFactor)/100; _shadowColors->_tsColor.blue=(unsigned short)color_value; } void MSShadow::calculateColorsForDarkBackground(void) { _shadowColors->_fgColor.red=(unsigned short)MaxIntensity; _shadowColors->_fgColor.green=(unsigned short)MaxIntensity; _shadowColors->_fgColor.blue=(unsigned short)MaxIntensity; unsigned long color_value=(unsigned long)_shadowColors->_bgColor.red; color_value+=ColorDarkSelFactor*(MaxIntensity-color_value)/100; _shadowColors->_selectColor.red=(unsigned short)color_value; color_value=_shadowColors->_bgColor.green; color_value+=ColorDarkSelFactor*(MaxIntensity-color_value)/100; _shadowColors->_selectColor.green=(unsigned short)color_value; color_value=_shadowColors->_bgColor.blue; color_value+=ColorDarkSelFactor*(MaxIntensity-color_value)/100; _shadowColors->_selectColor.blue=(unsigned short)color_value; color_value=_shadowColors->_bgColor.red; color_value+=ColorDarkBsFactor*(MaxIntensity-color_value)/100; _shadowColors->_bsColor.red=(unsigned short)color_value; color_value=_shadowColors->_bgColor.green; color_value+=ColorDarkBsFactor*(MaxIntensity-color_value)/100; _shadowColors->_bsColor.green=(unsigned short)color_value; color_value=_shadowColors->_bgColor.blue; color_value+=ColorDarkBsFactor*(MaxIntensity-color_value)/100; _shadowColors->_bsColor.blue=(unsigned short)color_value; color_value=_shadowColors->_bgColor.red; color_value+=ColorDarkTsFactor*(MaxIntensity-color_value)/100; _shadowColors->_tsColor.red=(unsigned short)color_value; color_value=_shadowColors->_bgColor.green; color_value+=ColorDarkTsFactor*(MaxIntensity-color_value)/100; _shadowColors->_tsColor.green=(unsigned short)color_value; color_value=_shadowColors->_bgColor.blue; color_value+=ColorDarkTsFactor*(MaxIntensity-color_value)/100; _shadowColors->_tsColor.blue=(unsigned short)color_value; } void MSShadow::calculateColorsForMediumBackground(void) { unsigned long b=brightness(); if (b>ForegroundThreshold) { _shadowColors->_fgColor.red=0; _shadowColors->_fgColor.green=0; _shadowColors->_fgColor.blue=0; } else { _shadowColors->_fgColor.red=(unsigned short)MaxIntensity; _shadowColors->_fgColor.green=(unsigned short)MaxIntensity; _shadowColors->_fgColor.blue=(unsigned short)MaxIntensity; } unsigned long f=ColorLoSelFactor+(b*(ColorHiSelFactor-ColorLoSelFactor)/MaxIntensity); unsigned long color_value=_shadowColors->_bgColor.red; color_value-=(color_value*f)/100; _shadowColors->_selectColor.red=(unsigned short)color_value; color_value=_shadowColors->_bgColor.green; color_value-=(color_value*f)/100; _shadowColors->_selectColor.green=(unsigned short)color_value; color_value=_shadowColors->_bgColor.blue; color_value-=(color_value*f)/100; _shadowColors->_selectColor.blue=(unsigned short)color_value; f=ColorLoBsFactor-(b*(ColorLoBsFactor-ColorHiBsFactor)/MaxIntensity); color_value=_shadowColors->_bgColor.red; color_value-=(color_value*f)/100; _shadowColors->_bsColor.red=(unsigned short)color_value; color_value=_shadowColors->_bgColor.green; color_value-=(color_value*f)/100; _shadowColors->_bsColor.green=(unsigned short)color_value; color_value=_shadowColors->_bgColor.blue; color_value-=(color_value*f)/100; _shadowColors->_bsColor.blue=(unsigned short)color_value; f=ColorLoTsFactor+(b*(ColorHiTsFactor-ColorLoTsFactor)/MaxIntensity); color_value=_shadowColors->_bgColor.red; color_value+=f*(MaxIntensity-color_value)/100; _shadowColors->_tsColor.red=(unsigned short)color_value; color_value=_shadowColors->_bgColor.green; color_value+=f*(MaxIntensity-color_value)/100; _shadowColors->_tsColor.green=(unsigned short)color_value; color_value=_shadowColors->_bgColor.blue; color_value+=f*(MaxIntensity-color_value)/100; _shadowColors->_tsColor.blue=(unsigned short)color_value; } void MSShadow::calculateRGBColors(void) { unsigned long b=brightness(); if (bColorLiteThreshold) calculateColorsForLightBackground(); else calculateColorsForMediumBackground(); } aplus-fsf-4.22/src/MSGUI/MSShell.C0000644000265000001440000007475210772770412012132 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #if HAVE_FSTREAM #include #else #include #endif #include #include #ifdef MS_WINDOWS #include static const unsigned long MSShellEventMask=(FocusChangeMask| StructureNotifyMask|KeyPressMask| PropertyChangeMask); #else static const unsigned long MSShellEventMask=(LeaveWindowMask|EnterWindowMask| StructureNotifyMask|KeyPressMask| PropertyChangeMask); #endif MSShell *MSShell::_defaultLeader=0; MSWidgetVector MSShell::_shellList; extern MSString applicationArgumentString(void); MSShell::Follower::Follower(MSShell *pShell_) : _pShell(pShell_), _remap(pShell_->mapped()) {} MSShell::Follower::~Follower(void) {} MSShell::GroupList::GroupList(void) {} MSShell::GroupList::~GroupList(void) {} void MSShell::GroupList::removeAll(void) {_groupList.removeAll();} void MSShell::GroupList::removeAt(unsigned index_) {_groupList.removeAt(index_);} void MSShell::GroupList::append(Follower *pFollower_) {_groupList.append((unsigned long)pFollower_);} unsigned MSShell::GroupList::numberOfFollowers(void) const {return _groupList.length();} MSShell::Follower *MSShell::GroupList::operator()(unsigned index_) const {return (MSShell::Follower *)_groupList(index_);} MSShell::Follower *MSShell::GroupList::operator()(unsigned index_) {return (MSShell::Follower *)_groupList(index_);} MSShell::MSShell(const char *windowTitle_) : MSTopLevel(windowTitle_) { init(); } MSShell::MSShell(MSDisplayServer *server_,const char *windowTitle_) : MSTopLevel(server_,windowTitle_) { init(); } MSShell::~MSShell(void) { // do not want excess traffic-will get many PropertyNotify events // when the window is destroyed selectInput(); // remove all the widgets in the focus list before destroying children // which will eliminate unneeded removeFromFocusList activity _traversalList.removeAll(); // set the _focusWidget to null before destroying the children // which will eliminate unneeded traversal processing traverseFocus(0); if (_child!=0) safeDestroy(_child); _child=0; if (_shellList.length()>0) { unsigned index=_shellList.indexOf((unsigned long)this,0); if (index<_shellList.length()) _shellList.removeAt(index); } if (_leader!=0) _leader->removeFollower(this); if (_defaultLeader==this) _defaultLeader=0; for (unsigned i=0;i<_groupList.numberOfFollowers();i++) { _groupList(i)->_pShell->leader(_defaultLeader); if (_defaultLeader!=0) _defaultLeader->addFollower(_groupList(i)->_pShell); delete _groupList(i); } _groupList.removeAll(); } void MSShell::init(void) { if (_shellList.length()==0) { if (windowManagerCommand().length()==0) { windowManagerCommand(applicationArgumentString()); } setWMClientMachine(); setWMSaveYourself(); setWMCommand(); if (_server->isCDERunning()==MSTrue) { _server->workspaceChangedFunction(&MSShell::updateCurrentWorkspace); } } _inCurrentWorkspace=MSFalse; _busyCount=0; _focusWidget=0; _leader=0; _child=0; _created=MSFalse; _header=MSTrue; _footer=MSFalse; _resizeable=MSTrue; _offsetX=0; _offsetY=0; _nestedTraversal=MSFalse; _shellList.append(this); if (_defaultLeader==0) defaultLeader(this); // We don't want to propagate the following events XSetWindowAttributes attributes; attributes.do_not_propagate_mask=(ButtonPressMask|ButtonReleaseMask|KeyPressMask |KeyReleaseMask|PointerMotionMask); XChangeWindowAttributes(display(),_window,CWDontPropagate,&attributes); selectInput(MSShellEventMask); } int MSShell::offsetX(void) const { return _offsetX; } int MSShell::offsetY(void) const { return _offsetY; } MSWidgetVector MSShell::children(void) { MSWidgetVector vector; if (_child!=0) vector.append(_child); return vector; } MSWidget *MSShell::inputFocus(void) { return _focusWidget; } const MSWidget *MSShell::inputFocus(void) const { return _focusWidget; } void MSShell::print(const char *file_) { if (_child!=0) _child->print(file_); } int MSShell::childWidth(void) const { return (_child!=0)?_child->width():0; } int MSShell::childHeight(void) const { return (_child!=0)?_child->height():0; } int MSShell::idealShellWidth(void) const { return childWidth(); } int MSShell::idealShellHeight(void) const { return childHeight(); } void MSShell::childCreate(MSWidget *pWidget_) { if (_child==0) { _child=pWidget_; adjustChildPosition(); } } // a child has been destroyed-check child void MSShell::childDestroy(MSWidget *pWidget_) { if (pWidget_==_child) _child=0; } // remove child-it has been reparented void MSShell::childRemove(MSWidget *pWidget_) { childDestroy(pWidget_); } // insert child-it has been reparented to this shell void MSShell::childInsert(MSWidget *pWidget_) { if (_child==0) { _child=pWidget_; adjustChildPosition(); adjustSize(); } } void MSShell::childConfigure(MSWidget *pWidget_) { if (pWidget_==_child&&_child!=0) adjustSize(); } void MSShell::configure(void) { adjustChildSize(); } void MSShell::adjustChildPosition(void) { if (_child!=0) _child->moveTo(0,0); } void MSShell::adjustChildSize(void) { if (_child!=0) _child->resize(width(),height()); } void MSShell::adjustSize(void) { resize(idealShellWidth(),idealShellHeight()); } void MSShell::naturalSize(void) { if (_child!=0) _child->naturalSize(); } void MSShell::resize(int w_,int h_) { if (MSRect::width()!=w_||MSRect::height()!=h_) { if (w_>0) MSRect::width(w_); if (h_>0) MSRect::height(h_); setWMSize(); configure(); } } void MSShell::moveToCenter(void) { int x=(_server->width()-width())/2; int y=(_server->height()-height())/2; moveTo(x,y); } void MSShell::moveTo(int x_,int y_) { if (MSRect::x()!=x_||MSRect::y()!=y_) { MSRect::x(x_); MSRect::y(y_); setWMPosition(); } } void MSShell::showChildren(void) { if (_child!=0) { adjustChildPosition(); _child->show(); } } void MSShell::showCentered(void) { showChildren(); moveToCenter(); map(); } void MSShell::show(void) { showChildren(); map(); } void MSShell::loadAndShow(const char *fileName_) { showChildren(); loadStateFrom(fileName_); map(); } void MSShell::loadAndShow(const MSWidgetState &widgetState_) { showChildren(); loadStateFrom(widgetState_); map(); } void MSShell::loadAndShow(istream &is_) { showChildren(); loadStateFrom(is_); map(); } void MSShell::map(void) { if (mapped()==MSFalse) { if (_child!=0) adjustSize(); else setWMSize(); if (firstMap()==MSFalse) setWMPosition(); MSWidget::map(); mapFollowers(); XFlush(display()); } } void MSShell::unmap(void) { if (mapped()==MSTrue) { unmapFollowers(); iconify(); } } void MSShell::iconized(void) { activateCallback(MSWidgetCallback::iconized); } void MSShell::deiconized(void) { activateCallback(MSWidgetCallback::deiconized); } void MSShell::visibilityObscured(void) { visible(MSFalse); visibilityObscuredNotify(_child); } void MSShell::visibilityUnobscured(void) { visible(MSTrue); visibilityUnobscuredNotify(_child); } void MSShell::firstMapNotify(void) { setDefaultTraversal(); } void MSShell::mapNotify(const XEvent *pEvent_) { if (_created==MSFalse&&pEvent_->xmap.window==_window) setOffsets(); } void MSShell::enterNotify(const XEvent *pEvent_) { if (pEvent_->xcrossing.mode==NotifyNormal) processFocusIn(); } void MSShell::leaveNotify(const XEvent *pEvent_) { if (pEvent_->xcrossing.mode==NotifyNormal) processFocusOut(); } void MSShell::focusInEventNotify(const XEvent *) { processFocusIn();} void MSShell::focusOutEventNotify(const XEvent *) { processFocusOut();} void MSShell::processFocusIn(void) { if (_focusWidget!=0&&this!=MSWidget::_focusWindow) { if (_focusWidget->sensitive()==MSTrue&&_focusWidget->acceptFocus()==MSTrue) { MSWidget *old=MSWidget::_focusWindow; focusOutNotify(old); MSWidget::_focusWindow=this; focusIn(); } else focusWidget(0); } else if (_focusWidget!=0&&this==MSWidget::_focusWindow) focusIn(); else if (_focusWidget==0&&MSWidget::_focusWindow==0) { MSWidget::_focusWindow=this; setDefaultFocus(); } } void MSShell::processFocusOut(void) { MSWidget::_focusWindow=0; focusOut(); } void MSShell::configureNotify(const XEvent *pEvent_) { if (pEvent_->xconfigure.window==_window&&pEvent_->xconfigure.event==_window) { if (pEvent_->xconfigure.send_event==True) { if (_created==MSTrue) { if (pEvent_->xconfigure.x+pEvent_->xconfigure.width>=0&& pEvent_->xconfigure.y+pEvent_->xconfigure.height>=0&& pEvent_->xconfigure.x<=_server->width()&& pEvent_->xconfigure.y<=_server->height()) { MSRect::x(pEvent_->xconfigure.x-offsetX()); MSRect::y(pEvent_->xconfigure.y-offsetY()); if (pEvent_->xconfigure.width!=width()||pEvent_->xconfigure.height!=height()) { MSRect::width(pEvent_->xconfigure.width); MSRect::height(pEvent_->xconfigure.height); configure(); } } } } else if (_created==MSTrue) { if (pEvent_->xconfigure.x+pEvent_->xconfigure.width>=0&& pEvent_->xconfigure.y+pEvent_->xconfigure.height>=0&& pEvent_->xconfigure.x<=_server->width()&& pEvent_->xconfigure.y<=_server->height()) { // We can't rely on the (x,y) received in the Event Structure // So let's actively pursue it int x,y; Window child; XTranslateCoordinates(display(),_window,XRootWindowOfScreen(screen()), 0,0,&x,&y,&child); MSRect::x(x-offsetX()); MSRect::y(y-offsetY()); if (pEvent_->xconfigure.width!=width()||pEvent_->xconfigure.height!=height()) { MSRect::width(pEvent_->xconfigure.width); MSRect::height(pEvent_->xconfigure.height); configure(); } } } } } void MSShell::keyPress(const XEvent *pEvent_,KeySym keysym_, unsigned int state_,const char *pString_) { MSKeyPress keyPress(keysym_, state_); if (keyTranslate(keyPress) == MSFalse) { if (keysym_!=XK_Tab&&state_==Mod1Mask&&isprint(pString_[0])) { if (processAltKey(pEvent_,keysym_,state_,pString_)==MSTrue) return; } if (_focusWidget!=0) { if (keysym_==XK_Tab) { unsigned int state=(state_&(ShiftMask|ControlMask|Mod1Mask)); if (state==ControlMask) traverseToNextShell(); else if (state==(ShiftMask+ControlMask)) traverseToPreviousShell(); else if (_focusWidget->acceptTab()==MSFalse) { if (state==ShiftMask) shiftTab(); else tab(); } else { if(state==Mod1Mask) tab(); else if (state==(ShiftMask+Mod1Mask)) shiftTab(); else keyPressNotify(_focusWidget,pEvent_,keysym_,state_,pString_); } } else if ((keysym_>=XK_F1&&keysym_<=XK_F10)||keysym_==XK_F11||keysym_==XK_F12) { // check for function key callback if (processFunctionKey(pEvent_,keysym_,state_,pString_)==MSFalse) { keyPressNotify(_focusWidget,pEvent_,keysym_,state_,pString_); } } else keyPressNotify(_focusWidget,pEvent_,keysym_,state_,pString_); } } } void MSShell::keyRelease(const XEvent *pEvent_,KeySym keysym_, unsigned int state_,const char *pString_) { keyReleaseNotify(_focusWidget,pEvent_,keysym_,state_,pString_); } void MSShell::keyRelease(const XEvent *pEvent_) { char buf[16]; KeySym keysym; int len=XLookupString((XKeyEvent *)pEvent_,buf,8,&keysym,NULL); #ifdef MS_KEYPAD_BUG server()->correctKeypadKeys(pEvent_,keysym,pEvent_->xkey.state,buf); #endif buf[len]='\0'; keyRelease(pEvent_,keysym,pEvent_->xkey.state,buf); } MSBoolean MSShell::processAltKey(const XEvent *,KeySym,unsigned int,const char *) { return MSFalse; } MSBoolean MSShell::processFunctionKey(const XEvent *,KeySym keysym_,unsigned int,const char *) { static MSSymbol syms[12]={MSWidgetCallback::f1,MSWidgetCallback::f2, MSWidgetCallback::f3,MSWidgetCallback::f4, MSWidgetCallback::f5,MSWidgetCallback::f6, MSWidgetCallback::f7,MSWidgetCallback::f8, MSWidgetCallback::f9,MSWidgetCallback::f10, MSWidgetCallback::f11,MSWidgetCallback::f12}; int num=(int)(keysym_-XK_F1); if (num>=0&&num<12) { MSWidget *pWidget=_focusWidget; while (pWidget!=0) { if (activateCallback(pWidget,syms[num])==MSTrue) return MSTrue; else pWidget=pWidget->owner(); } } return MSFalse; } void MSShell::propertyNotify(const XEvent *pEvent_) { Atom wmStateAtom=_server->atom(MSAtomTable::WMState); if (pEvent_->xproperty.atom==wmStateAtom) updateWMState(); else { Atom workspacePresenceAtom=XInternAtom(display(),"_DT_WORKSPACE_PRESENCE",False); if (pEvent_->xproperty.atom==workspacePresenceAtom) { updateWorkspacePresence(); updateCurrentWorkspaceState(_server->currentWorkspaceAtom()); } } } void MSShell::updateWMState(void) { Atom wmStateAtom=_server->atom(MSAtomTable::WMState); Atom actualTarget; int actualFormat; unsigned long itemCount; unsigned long bytesRemaining; unsigned char *actData; int *data=0; int state=WithdrawnState; long len=((sizeof(int)+3)/4+(sizeof(Window)+3)/4); int status=XGetWindowProperty(display(),_window,wmStateAtom, 0L,len,False,wmStateAtom, &actualTarget,&actualFormat,&itemCount, &bytesRemaining,&actData); if (status==Success&&wmStateAtom==actualTarget&&actualFormat==32&&itemCount>0) { data=(int *)actData; state=data[0]; } if (data!=0) XFree((char *)actData); if (state==IconicState) { visibilityObscured(); if (MSWidget::mapped()==MSTrue) { unmapFollowers(); // We must set the state after calling unmapFollowers, not before _mapped=MSFalse; } iconized(); } else if (state==NormalState) { visibilityUnobscured(); if (MSWidget::mapped()==MSFalse) { _mapped=MSTrue; mapFollowers(); } deiconized(); } } // first send event from olvwm is incorrect - it is the x,y offsets void MSShell::setOffsets(void) { Window win; int x,y; unsigned int w,h,bw,d; XGetGeometry(display(),_window,&win,&x,&y,&w,&h,&bw,&d); // if the offsets turned out to be zeros, we are probably using mwm // or ted. The following is used to find offsets in that situation. if(x==0&&y==0) { _adjustWMPosition=MSTrue; XTranslateCoordinates(display(),_window,XRootWindowOfScreen(screen()), 0,0,&x,&y,&win); offsetX(x-MSRect::x()); offsetY(y-MSRect::y()); } else { offsetX(x); offsetY(y); } _created=MSTrue; } //################################################################################### // leader/follower/window group methods MSWidgetVector MSShell::followerList(void) { MSWidgetVector aWidgetVector; for (unsigned i=0;i<_groupList.numberOfFollowers();i++) { aWidgetVector.append(_groupList(i)->_pShell); } return aWidgetVector; } void MSShell::addFollower(MSShell *pShell_) { if (pShell_!=0&&pShell_!=this) { for (unsigned i=0;i<_groupList.numberOfFollowers();i++) { if (_groupList(i)->_pShell==pShell_) return; } _groupList.append(new Follower(pShell_)); } } void MSShell::removeFollower(MSShell *pShell_) { if (pShell_!=0&&pShell_!=this) { for (unsigned i=0;i<_groupList.numberOfFollowers();i++) { if (_groupList(i)->_pShell==pShell_) { delete _groupList(i); _groupList.removeAt(i); } } } } void MSShell::mapFollowers(void) { for (unsigned i=0;i<_groupList.numberOfFollowers();i++) { if (_groupList(i)->_remap==MSTrue) _groupList(i)->_pShell->map(); } } void MSShell::unmapFollowers(void) { for (unsigned i=0;i<_groupList.numberOfFollowers();i++) { _groupList(i)->_remap=_groupList(i)->_pShell->mapped(); _groupList(i)->_pShell->unmap(); } } // leader_ is the proposed new leader of this,we first need to check // leader_ is not already a follower of this. MSBoolean MSShell::windowGroup(MSShell *leader_) { if (leader_!=this) { if (_leader!=leader_) { if (doesLeaderFollowThis(leader_)==MSFalse) { if (_leader!=0) _leader->removeFollower(this); if (leader_!=0) leader_->addFollower(this); leader(leader_); return MSTrue; } } else return MSTrue; } return MSFalse; } // need to check that leader_ is not already a follower of this, // otherwise we can get a cycle MSBoolean MSShell::doesLeaderFollowThis(MSShell *leader_) { MSBoolean r=MSFalse; if (leader_!=0) { for (unsigned i=0;i<_groupList.numberOfFollowers()&&r==MSFalse;i++) { if (_groupList(i)->_pShell==leader_) r=MSTrue; else r=_groupList(i)->_pShell->doesLeaderFollowThis(leader_); } } return r; } void MSShell::defaultLeader(MSShell *defaultLeader_) { MSShell *oldDefault=_defaultLeader; _defaultLeader=defaultLeader_; // remove all followers from the old default and add them // to the new default if (oldDefault!=0&&oldDefault!=defaultLeader_) { GroupList& oldList=oldDefault->_groupList; for (unsigned i=0;iaddFollower(oldList(i)->_pShell); oldList(i)->_pShell->leader(_defaultLeader); delete oldList(i); } oldList.removeAll(); } } //################################################################################### // focus and traversal methods MSBoolean MSShell::loseFocus(void) { return (_focusWidget!=0)?loseFocusNotify(_focusWidget):MSTrue; } void MSShell::takeFocus(void) { takeFocusNotify(_focusWidget); } void MSShell::focusOut(void) { focusOutNotify(_focusWidget); } void MSShell::focusIn(void) { focusInNotify(_focusWidget); } void MSShell::traverse(void) { tab(); } void MSShell::tab(void) { traverseFocusToNext(); } void MSShell::shiftTab(void) { traverseFocusToPrevious(); } MSBoolean MSShell::traverseFocus(MSWidget *newFocusWidget_) { MSBoolean lf=MSTrue; if (newFocusWidget_!=this) { if (_nestedTraversal==MSFalse) { nestedTraversal(MSTrue); if (_focusWidget!=0&&_focusWidget!=newFocusWidget_) lf=loseFocusNotify(_focusWidget); if (lf==MSTrue) { focusWidget(newFocusWidget_); takeFocusNotify(_focusWidget); #ifdef MS_WINDOWS MSXSetInputFocus(_focusWidget==0?0:_focusWidget->window()); #endif activateCallback(_focusWidget,MSWidgetCallback::takefocus); nestedTraversal(MSFalse); return MSTrue; } nestedTraversal(MSFalse); } } return MSFalse; } void MSShell::addToFocusList(MSWidget *pWidget_) { if (_traversalList.indexOf((unsigned long)pWidget_,0)==_traversalList.length()) { _traversalList.append(pWidget_); } } void MSShell::removeFromFocusList(MSWidget *pWidget_) { unsigned index=_traversalList.indexOf((unsigned long)pWidget_,0); if (index<_traversalList.length()) _traversalList.removeAt(index); } // get the entry after focus MSWidget *MSShell::getNextFocus(void) { if (_traversalList.length()>0) { MSWidget *pWidget=0; unsigned i,index=_traversalList.indexOf((unsigned long)_focusWidget,0); if (index==_traversalList.length()) index=0; for (i=index+1;i<_traversalList.length();i++) { pWidget=_traversalList(i); if (isTraversable(pWidget)==MSTrue) return pWidget; } for (i=0;i0) { MSWidget *pWidget=0; unsigned i,index=_traversalList.indexOf((unsigned long)_focusWidget,0); if (index==_traversalList.length()) index=0; for (i=index-1;i<_traversalList.length();i--) { pWidget=_traversalList(i); if (isTraversable(pWidget)==MSTrue) return pWidget; } for (i=_traversalList.length()-1;i>index;i--) { pWidget=_traversalList(i); if (isTraversable(pWidget)==MSTrue) return pWidget; } } return 0; } MSBoolean MSShell::traverseFocusToNext(void) { MSWidget *pWidget=getNextFocus(); return (pWidget!=0)?traverseFocus(pWidget):MSFalse; } MSBoolean MSShell::traverseFocusToPrevious(void) { MSWidget *pWidget=getPreviousFocus(); return (pWidget!=0)?traverseFocus(pWidget):MSFalse; } MSBoolean MSShell::traverseToNext(void) { return traverseFocusToNext(); } MSBoolean MSShell::traverseToPrevious(void) { return traverseFocusToPrevious(); } static int widgetCoordCompare(MSWidget *aWidget_,MSWidget *bWidget_) { int aX,aY; int bX,bY; aWidget_->rootXY(aX,aY); bWidget_->rootXY(bX,bY); if (aY==bY) { if (aX==bX) return 0; else if (aXsensitive()==MSTrue&&pWidget->acceptFocus()==MSTrue) break; else pWidget=0; } if (pWidget!=0&&pWidget!=this) { MSBoolean lf=MSTrue; if (_focusWidget!=0) lf=loseFocusNotify(_focusWidget); if (lf==MSTrue) { focusWidget(pWidget); takeFocusNotify(_focusWidget); } } } void MSShell::traverseToNextShell(void) { if (_shellList.length()>0) { MSWidget *pWidget=0; unsigned i,index=_shellList.indexOf((unsigned long)this,0); if (index==_shellList.length()) index=0; for (i=index+1;i<_shellList.length();i++) { pWidget=_shellList(i); if (pWidget!=0&&pWidget!=this&&pWidget->mapped()==MSTrue&& server()->name()==pWidget->server()->name()) { XWarpPointer(display(),_window,pWidget->window(),0,0,0,0,10,10); return; } } for (i=0;imapped()==MSTrue&& server()->name()==pWidget->server()->name()) { XWarpPointer(display(),_window,pWidget->window(),0,0,0,0,10,10); return; } } } } void MSShell::traverseToPreviousShell(void) { if (_shellList.length()>0) { MSWidget *pWidget=0; unsigned i,index=_shellList.indexOf((unsigned long)this,0); if (index==_shellList.length()) index=0; for (i=index-1;i<_shellList.length();i--) { pWidget=_shellList(i); if (pWidget!=0&&pWidget!=this&&pWidget->mapped()==MSTrue&& server()->name()==pWidget->server()->name()) { XWarpPointer(display(),_window,pWidget->window(),0,0,0,0,10,10); return; } } for (i=_shellList.length()-1;i>index;i--) { pWidget=_shellList(i); if (pWidget!=0&&pWidget!=this&&pWidget->mapped()==MSTrue&& server()->name()==pWidget->server()->name()) { XWarpPointer(display(),_window,pWidget->window(),0,0,0,0,10,10); return; } } } } void changeBusyState(MSShell *pShell_,MSBoolean state_) { MSShell::changeBusyState(pShell_,state_); } void MSShell::changeBusyState(MSShell *pShell_,MSBoolean state_) { if (_shellList.length()>0) { unsigned index=_shellList.indexOf((unsigned long)pShell_); if (index<_shellList.length()) { pShell_->setBusyState(state_); XFlush(pShell_->display()); } } } void changeBusyState(MSBoolean state_) { MSShell::changeBusyState(state_); } void MSShell::changeBusyState(MSBoolean state_) { if (_shellList.length()>0) { MSShell *pShell; Display *dpy=0; for (unsigned i=0;i<_shellList.length();i++) { pShell=(MSShell *)_shellList(i); pShell->setBusyState(state_); dpy=pShell->display(); } if (dpy!=0) XFlush(dpy); } } void MSShell::setBusyState(MSBoolean state_) { if (state_==MSTrue) { if (busyCount()==0) XDefineCursor(display(),_window,_server->watchCursor()); _busyCount++; } else { if (busyCount()==1) XUndefineCursor(display(),_window); if (busyCount()>0) _busyCount--; } } // #################################################################### // inline methods // #################################################################### void MSShell::offsetX(int x_) { _offsetX=x_; } void MSShell::offsetY(int y_) { _offsetY=y_; } int MSShell::busyCount(void) { return _busyCount; } void MSShell::busyCount(int count_) { _busyCount=count_; } void MSShell::nestedTraversal(MSBoolean nestedTraversal_) {_nestedTraversal=nestedTraversal_;} const MSWidgetVector& MSShell::traversalList(void) { return _traversalList; } const MSWidgetVector& MSShell::traversalList(void) const { return _traversalList; } void MSShell::traversalList(const MSWidgetVector& aWidgetVector_) { _traversalList=aWidgetVector_; } const MSWidgetVector& MSShell::topLevelList(void) { return _shellList; } MSWidgetVector& MSShell::shellList(void) { return _shellList; } void MSShell::leader(MSShell *leader_) { _leader=leader_; } void MSShell::focusWidget(MSWidget *widget_) { _focusWidget=widget_; } MSWidget *MSShell::child(void) { return _child; } const MSWidget *MSShell::child(void) const { return _child; } MSShell *MSShell::defaultLeader(void) { return _defaultLeader; } MSShell *MSShell::leader(void) { return _leader; } const MSShell *MSShell::leader(void) const { return _leader; } MSShell *MSShell::windowGroup(void) { return _leader; } const MSShell *MSShell::windowGroup(void) const { return _leader; } MSWidget *MSShell::focusWidget(void) { return _focusWidget; } const MSWidget *MSShell::focusWidget(void) const { return _focusWidget; } void MSShell::set(MSAttrValueList& avList_) { MSTopLevel::set(avList_); MSIndexVector index; for (unsigned i=0;iinstanceName().length()>0) { MSAttrValueList *list; if ((list=(MSAttrValueList *)widgetState_.lookup(child->instanceFullname()))!= (MSAttrValueList *)widgetState_.notFound()) { child->set(*list); } } } } void MSShell::loadStateFrom(istream &is_) { if (!is_) return; MSWidgetState widgetState(is_); loadStateFrom(widgetState); } void MSShell::loadStateFrom(const char *fileName_) { ifstream ifs(fileName_); loadStateFrom(ifs); } void MSShell::saveStateTo(const char *fileName_) { ofstream ofs(fileName_); saveStateTo(ofs); } void MSShell::saveStateTo(ostream& aStream_) { if (!aStream_) return; MSWidgetCursor cursor(this,MSDepthFirst); for (cursor.setToFirst();cursor.isValid()==MSTrue;cursor.setToNext()) { MSWidget *child=cursor.widget(); if (child->instanceName().length()>0) { MSAttrValueList avList; child->get(avList); if (avList.length()>0) { MSString childFullName=child->instanceFullname(); unsigned n=avList.length(); for (unsigned j=0;j0) { aStream_<>(istream& aStream_,MSShell& aShell_) { aShell_.loadStateFrom(aStream_); return aStream_; } void MSShell::inCurrentWorkspaceNotify(void) { activateCallback(MSWidgetCallback::incurrentworkspace); } void MSShell::outOfCurrentWorkspaceNotify(void) { activateCallback(MSWidgetCallback::outofcurrentworkspace); } void MSShell::updateCurrentWorkspaceState(Atom currentWorkspaceAtom_) { if (inWorkspace(currentWorkspaceAtom_)==MSTrue) { if (_inCurrentWorkspace==MSFalse) { _inCurrentWorkspace=MSTrue; inCurrentWorkspaceNotify(); } } else { if (_inCurrentWorkspace==MSTrue) { _inCurrentWorkspace=MSFalse; outOfCurrentWorkspaceNotify(); } } } // this static funtion will be called whenever the Current Workspace // is changed on a CDE desktop void MSShell::updateCurrentWorkspace(Atom currentWorkspaceAtom_) { unsigned n=_shellList.length(); MSShell *pShell; for (unsigned i=0;iupdateCurrentWorkspaceState(currentWorkspaceAtom_); } } aplus-fsf-4.22/src/MSGUI/MSStringDelimiterList.C0000644000265000001440000000557510772770412015021 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include MSStringDelimiterList::MSStringDelimiterList(MSWidget *owner_,const char *title_) : MSDelimiterList(owner_,title_) {} MSStringDelimiterList::MSStringDelimiterList(MSWidget *owner_,const MSStringVector& title_) : MSDelimiterList(owner_,title_) {} MSStringDelimiterList::MSStringDelimiterList(MSWidget *owner_,MSStringVector& model_,const char *title_) : MSDelimiterList(owner_,title_) { model(model_); } MSStringDelimiterList::MSStringDelimiterList(MSWidget *owner_,MSStringVector& model_,const MSStringVector& title_) : MSDelimiterList(owner_,title_) { model(model_); } MSStringDelimiterList::~MSStringDelimiterList(void) {} void MSStringDelimiterList::model(MSStringVector& model_) { couple(&model_); } void MSStringDelimiterList::list(const MSStringVector& list_) { if (MSView::model()!=0) list()=list_; } void MSStringDelimiterList::calculateMaxLength(void) { _maxLength=(MSView::model()!=0)?list().maxLength():0; } unsigned MSStringDelimiterList::rowLength(unsigned row_) const { return (MSView::model()!=0&&row_(numRows()-1)?j-numRows():j; if (strstr(sv[j],isearchString())==sv[j]) { if (j!=selectedRow()) { isearchVector()<bell(); } } void MSStringDelimiterList::moveRow(int from_,int to_) { MSBoolean wasFrozen=frozen(); if (wasFrozen==MSFalse) freeze(); MSString element=list().elementAt(from_); list().removeAt(from_); if (from_=list().length()) list().append(element); else list().insertAt(to_,element); } else { list().insertAt(to_,element); } MSList::moveRow(from_,to_); if (wasFrozen==MSFalse) unfreeze(); } aplus-fsf-4.22/src/MSGUI/MSStringEntryField.C0000644000265000001440000000316010772770412014300 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include MSStringEntryField::MSStringEntryField(MSWidget *owner_,const char *label_,const MSSymbol& tag_) : MSEntryFieldPlus(owner_,label_,tag_) { internalCouple(new MSString); } MSStringEntryField::MSStringEntryField(MSWidget *owner_,MSString& model_,const char *label_,const MSSymbol& tag_): MSEntryFieldPlus(owner_,label_,tag_) { model(model_); } MSStringEntryField::~MSStringEntryField(void) {} void MSStringEntryField::model(MSString& model_) { couple(&model_); } void MSStringEntryField::model(const MSString& model_) { constCouple(&model_); } void MSStringEntryField::value(const char *value_) { if (MSView::model()!=0) value()=value_; } MSBoolean MSStringEntryField::validate(const char *pString_) { return (MSView::model()!=0)?((value().set(pString_)==MSError::MSSuccess)?MSTrue:MSFalse):MSTrue; } const char *MSStringEntryField::formatOutput(MSString &buffer_) { if (MSView::model()!=0) buffer_=value(); return buffer_.string(); } void MSStringEntryField::updateData(void) { if(MSView::model()==0) internalCouple(new MSString()); MSEntryFieldPlus::updateData(); } MSAttrValueList& MSStringEntryField::get(MSAttrValueList& avList_) { avList_< MSStringList::MSStringList(MSWidget *owner_,const char *title_) : MSList(owner_,title_) {} MSStringList::MSStringList(MSWidget *owner_,const MSStringVector& title_) : MSList(owner_,title_) {} MSStringList::MSStringList(MSWidget *owner_,MSStringVector& model_,const char *title_) : MSList(owner_,title_) { model(model_); } MSStringList::MSStringList(MSWidget *owner_,MSStringVector& model_,const MSStringVector& title_) : MSList(owner_,title_) { model(model_); } MSStringList::~MSStringList(void) {} void MSStringList::model(MSStringVector& model_) { couple(&model_); } void MSStringList::model(const MSStringVector& model_) { constCouple(&model_); } void MSStringList::list(const MSStringVector& list_) { if (MSView::model()!=0) list()=list_; } void MSStringList::calculateMaxLength(void) { _maxLength=(MSView::model()!=0)?list().maxLength():0; } unsigned MSStringList::rowLength(unsigned row_) const { return (MSView::model()!=0&&row_(numRows()-1)?j-numRows():j; if (strstr(sv[j],isearchString())==sv[j]) { if (j!=selectedRow()) { isearchVector()<bell(); } } void MSStringList::moveRow(int from_,int to_) { MSBoolean wasFrozen=frozen(); if (wasFrozen==MSFalse) freeze(); MSString element=list().elementAt(from_); list().removeAt(from_); if (from_=list().length()) list().append(element); else list().insertAt(to_,element); } else { list().insertAt(to_,element); } MSList::moveRow(from_,to_); if (wasFrozen==MSFalse) unfreeze(); } aplus-fsf-4.22/src/MSGUI/MSStringPopupMenu.C0000644000265000001440000000412110772770413014162 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include MSStringPopupMenu::MSStringPopupMenu(MSDisplayServer *server_) : MSPopupMenu(server_) {} MSStringPopupMenu::MSStringPopupMenu(MSDisplayServer *server_,MSStringVector& aModel_) : MSPopupMenu(server_) { model(aModel_); } void MSStringPopupMenu::model(const MSStringVector& aModel_) { constCouple(&aModel_); } void MSStringPopupMenu::updateData(void) { if (MSView::model()!=0) { freeze(); const MSStringVector& aStringVector=stringVector(); unsigned currentCount(itemCount()); unsigned i; MSWidgetVector itemVector(children()); MSMenuItem *pMenuItem; for (i=0;ilabel(aStringVector(i)); } else pMenuItem=new MSMenuItem(this,aStringVector(i),0,i); setItem(pMenuItem,i); } for (i=aStringVector.length();ilabel(aStringVector(aIndexVector(i))); } } } } else updateData(); } aplus-fsf-4.22/src/MSGUI/MSStringTableColumn.C0000644000265000001440000001513210772770413014443 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include MSStringTableColumn::MSStringTableColumn(MSReportTable *owner_,const char *heading_,const MSSymbol& tag_) : MSTableColumn(owner_,heading_,tag_) { init(); } MSStringTableColumn::MSStringTableColumn(MSReportTable *owner_,const MSStringVector& heading_,const MSSymbol& tag_) : MSTableColumn(owner_,heading_,tag_) { init(); } MSStringTableColumn::MSStringTableColumn(MSReportTable *owner_,MSStringVector& model_, const char *heading_,const MSSymbol& tag_) : MSTableColumn(owner_,heading_,tag_) { init(); model(model_); } MSStringTableColumn::MSStringTableColumn(MSReportTable *owner_,MSStringVector& model_, const MSStringVector& heading_,const MSSymbol& tag_): MSTableColumn(owner_,heading_,tag_) { init(); model(model_); } MSStringTableColumn::~MSStringTableColumn(void) {} void MSStringTableColumn::init(void) { _columnAlignment=MSLeft; } void MSStringTableColumn::model(MSStringVector& model_) { couple(&model_); } void MSStringTableColumn::model(const MSStringVector& model_) { constCouple(&model_); } void MSStringTableColumn::vector(const MSStringVector& aVector_) { if (MSView::model()!=0) vector()=aVector_; } unsigned MSStringTableColumn::numRows(void) const { return (MSView::model()!=0)?vector().length():0; } // report methods MSBoolean MSStringTableColumn::isDuplicate(unsigned row_) { return (MSView::model()!=0&&row_!=0)?vector()(row_)==vector()(row_-1)?MSTrue:MSFalse:MSFalse;} MSBoolean MSStringTableColumn::breakCriteria(unsigned row_) { return (MSView::model()!=0&&row_!=0)?row_==vector().length()|| vector()(row_)!=vector()(row_-1)?MSTrue:MSFalse:MSFalse; } MSBoolean MSStringTableColumn::validate(const char *pString_,unsigned row_) { return (MSView::model()!=0)?((vector().set(row_,pString_)==MSError::MSSuccess)?MSTrue:MSFalse):MSTrue; } const char *MSStringTableColumn::formatOutput(MSString &buffer_,unsigned row_) { if (MSView::model()!=0) buffer_=vector()(row_); return buffer_.string(); } const char *MSStringTableColumn::formatBreak(MSString &buffer_,unsigned row_,unsigned col_) { unsigned index=reportTable()->breakIndex()(row_); if (col_==column()&&breakString().length()>0&&breakIndex().indexOf(index)gradeUp(); else return MSIndexVector::nullVector(); } MSIndexVector MSStringTableColumn::gradeDown(void) const { if (MSView::model()!=0) return ((MSStringVector *)_model)->gradeDown(); else return MSIndexVector::nullVector(); } void MSStringTableColumn::permute(const MSIndexVector &indexVector_) { if (MSView::model()!=0) ((MSStringVector *)_model)->permute(indexVector_); } void MSStringTableColumn::range(MSIndexVector &start_,MSIndexVector &end_) { if (MSView::model()!=0&&start_.length()>0&&start_.length()==end_.length()) { MSIndexVector Start=start_,End=end_; MSStringVector &vector=*(MSStringVector *)_model; start_.removeAll(); end_.removeAll(); for (unsigned i=0;i0&&start_.length()==end_.length()) { MSStringVector &vector=*(MSStringVector *)_model; MSIndexVector index(vector.length()); for (unsigned i=0;i0&&start_.length()==end_.length()) { MSStringVector &vector=*(MSStringVector *)_model; MSIndexVector index(vector.length()); for (unsigned i=0;i=vectorModel.length()) vectorModel.append(item); else vectorModel.insertAt(to_,item); } else { vectorModel.insertAt(to_,item); } } } void MSStringTableColumn::set(MSAttrValueList& avList_) { MSTableColumn::set(avList_); MSIndexVector index; for (unsigned i=0;i MSStringVectorTraceSet::MSStringVectorTraceSet(MSGraph *owner_,const char *legends_,const MSSymbol& tag_): MSTraceSet(owner_,legends_,tag_) { init(); } MSStringVectorTraceSet::MSStringVectorTraceSet(MSGraph *owner_,const MSStringVector& legends_,const MSSymbol& tag_):MSTraceSet(owner_,legends_,tag_) { init(); } MSStringVectorTraceSet::MSStringVectorTraceSet(MSGraph *owner_,MSStringVector& m_,const char *legends_,const MSSymbol& tag_):MSTraceSet(owner_,legends_,tag_) { init(); model(m_); } MSStringVectorTraceSet::MSStringVectorTraceSet(MSGraph *owner_,MSStringVector& m_,const MSStringVector& legends_,const MSSymbol& tag_):MSTraceSet(owner_,legends_,tag_) { init(); model(m_); } MSStringVectorTraceSet::~MSStringVectorTraceSet(void) {} void MSStringVectorTraceSet::model(MSStringVector& model_) { couple(&model_); MSTraceSet::style((unsigned long)Text); } void MSStringVectorTraceSet::model(const MSStringVector& model_) { constCouple(&model_); MSTraceSet::style((unsigned long)Text); } void MSStringVectorTraceSet::init(void) { _x=0,_y=0; } int MSStringVectorTraceSet::dataCount(void) const { return 1; } void MSStringVectorTraceSet::moveTo(int x_,int y_) { moveTo((double)x_,(double)y_); } void MSStringVectorTraceSet::moveTo(double x_,double y_) { _x=x_,_y=y_; computeExtents(); owner()->redraw(); } void MSStringVectorTraceSet::xOrigin(double x_) { _x=x_; computeExtents(); owner()->redraw(); } void MSStringVectorTraceSet::yOrigin(double y_) { _y=y_; computeExtents(); owner()->redraw(); } double MSStringVectorTraceSet::x(int) const { return _x; } double MSStringVectorTraceSet::y(int,int) const { return _y; } MSStringVector& MSStringVectorTraceSet::text(void) { return MSView::model()!=0?vector():MSTraceSet::text(); } const MSStringVector& MSStringVectorTraceSet::text(void) const { return MSView::model()!=0?vector():MSTraceSet::text(); } unsigned MSStringVectorTraceSet::textLength(void) const { return text().length(); } void MSStringVectorTraceSet::validate(int,int,double x_,double y_) { _x=x_,_y=y_; computeExtents(); } unsigned long MSStringVectorTraceSet::style(unsigned) const {return MSTraceSet::style(0);} void MSStringVectorTraceSet::style(Style x_) { style((unsigned long)x_); } void MSStringVectorTraceSet::style(unsigned long x_) { MSTraceSet::style(x_&Text); } void MSStringVectorTraceSet::style(unsigned long,unsigned) {} void MSStringVectorTraceSet::style(const MSUnsignedLongVector&) {} void MSStringVectorTraceSet::set(MSAttrValueList& avList_) { MSTraceSet::set(avList_); MSIndexVector index; for(unsigned i=0; i MSSymbolCheckBox::MSSymbolCheckBox(MSWidget *owner_,const char *title_) : MSModelCheckBox(owner_,title_) { internalCouple(new MSSymbolVector); } MSSymbolCheckBox::MSSymbolCheckBox(MSWidget *owner_,const MSStringVector& title_) : MSModelCheckBox(owner_,title_) { internalCouple(new MSSymbolVector); } MSSymbolCheckBox::MSSymbolCheckBox(MSWidget *owner_,MSSymbolVector &aSymbolVector_,const char *title_) : MSModelCheckBox(owner_,title_) { model(aSymbolVector_); } MSSymbolCheckBox::MSSymbolCheckBox(MSWidget *owner_,MSSymbolVector &aSymbolVector_,const MSStringVector& title_) : MSModelCheckBox(owner_,title_) { model(aSymbolVector_); } MSSymbolCheckBox::~MSSymbolCheckBox(void) {} void MSSymbolCheckBox::model(MSSymbolVector &aSymbolVector_) { couple(&aSymbolVector_); } void MSSymbolCheckBox::setModel(void) { if (MSView::model()!=0) { MSSymbolVector *myModel=(MSSymbolVector *)_model; *myModel=symbolicState(); } } void MSSymbolCheckBox::drawCurrentState(void) { if (MSView::model()!=0) { MSSymbolVector *pSymbolVector=(MSSymbolVector *)_model; symbolicState(*pSymbolVector); } } aplus-fsf-4.22/src/MSGUI/MSSymbolList.C0000644000265000001440000000557510772770414013163 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include MSSymbolList::MSSymbolList(MSWidget *owner_,const char *title_) : MSList(owner_,title_) {} MSSymbolList::MSSymbolList(MSWidget *owner_,const MSStringVector& title_) : MSList(owner_,title_) {} MSSymbolList::MSSymbolList(MSWidget *owner_,MSSymbolVector& model_,const char *title_) : MSList(owner_,title_) { model(model_); } MSSymbolList::MSSymbolList(MSWidget *owner_,MSSymbolVector& model_,const MSStringVector& title_) : MSList(owner_,title_) { model(model_); } MSSymbolList::~MSSymbolList(void) {} void MSSymbolList::model(MSSymbolVector& model_) { couple(&model_); } void MSSymbolList::model(const MSSymbolVector& model_) { constCouple(&model_); } void MSSymbolList::list(const MSSymbolVector& list_) { if (MSView::model()!=0) list()=list_; } void MSSymbolList::calculateMaxLength(void) { _maxLength=(MSView::model()!=0)?list().maxLength():0; } unsigned MSSymbolList::rowLength(unsigned row_) const { if (MSView::model()!=0&&row_(numRows()-1)?j-numRows():j; const char *pString=sv(j).symbolName(); if (strstr(pString,isearchString())==pString) { if (j!=selectedRow()) { isearchVector()<bell(); } } void MSSymbolList::moveRow(int from_,int to_) { MSBoolean wasFrozen=frozen(); if (wasFrozen==MSFalse) freeze(); MSSymbol element=list()(from_); list().removeAt(from_); if (from_=list().length()) list().append(element); else list().insertAt(to_,element); } else { list().insertAt(to_,element); } MSList::moveRow(from_,to_); if (wasFrozen==MSFalse) unfreeze(); } aplus-fsf-4.22/src/MSGUI/MSTabStringList.C0000644000265000001440000001324610772770414013605 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include const unsigned long MSTabStringDefaultTabSize = 6; MSTabStringList::MSTabStringList(MSWidget *owner_,const char *title_) : MSStringList(owner_,title_),_tabSize(MSTabStringDefaultTabSize) {} MSTabStringList::MSTabStringList(MSWidget *owner_,const MSStringVector& title_) : MSStringList(owner_,title_),_tabSize(MSTabStringDefaultTabSize) {} MSTabStringList::MSTabStringList(MSWidget *owner_,MSStringVector& model_,const char *title_) : MSStringList(owner_,model_,title_),_tabSize(MSTabStringDefaultTabSize) {} MSTabStringList::MSTabStringList(MSWidget *owner_,MSStringVector& model_,const MSStringVector& title_) : MSStringList(owner_,model_,title_),_tabSize(MSTabStringDefaultTabSize) {} MSTabStringList::~MSTabStringList() {} const unsigned long& MSTabStringList::tabSize(void) const { return _tabSize; } const MSUnsignedLongVector& MSTabStringList::tabStops(void) const { return _tabStops; } void MSTabStringList::tabStops(const MSUnsignedLongVector& tabStops_) { _tabStops=tabStops_; adjustNumVisible(); redrawImmediately(); } void MSTabStringList::tabSize(unsigned long tabSize_) { _tabSize = tabSize_; adjustNumVisible(); redrawImmediately(); } void MSTabStringList::calculateMaxLength(void) { if (MSView::model()) { unsigned maxlength=0; for (int i=0;ilen)? maxlength : len; } _maxLength=maxlength; } else _maxLength=0; } unsigned MSTabStringList::rowLength(unsigned int row_) const { if (row_0)) { int position=0; const XFontStruct *font = textFontStruct(); MSString string = list()[row_]; int charWidth = XTextWidth(font,"M",1); if (tabStops().length()==0) { int tabWidth = charWidth * _tabSize; while (string.length()>0) { unsigned nextTab=string.indexOf('\t'); if (nextTab) { position += XTextWidth(font, string, nextTab); string.remove(0,nextTab); } else { if(tabWidth !=0 ) position += tabWidth-(position%tabWidth); string.remove(0,1); } } } else { int tabIndex=0; // which tabIndex is current int pixLength=0; while (string.length()>0) { unsigned nextTab=string.indexOf('\t'); if (nextTab) { pixLength = XTextWidth(font, string, nextTab); position += pixLength; string.remove(0,nextTab); } else { // tabIndex is modified in nextTabPosition position += nextTabPosition(pixLength,charWidth,tabIndex); pixLength=0; string.remove(0,1); } } } return (position%charWidth)? (position/charWidth+1):(position/charWidth); } return 0; } void MSTabStringList::drawString(Display *display_,Window window_,GC gc_,const XFontStruct *fs_, int x_,int y_,const char *pString_,int) { int pixLength=0; MSString string=pString_; int charWidth = XTextWidth(fs_,"M",1); if (tabStops().length()==0) { int tabWidth = charWidth * _tabSize; while (string.length()>0) { unsigned nextTab=string.indexOf('\t'); if (nextTab) { XDrawString(display_,window_,gc_,fs_,x_,y_,string,nextTab); pixLength = XTextWidth(fs_,string,nextTab); x_ += pixLength; string.remove(0,nextTab); } else { if(tabWidth!=0) x_ += tabWidth-(pixLength%tabWidth); pixLength=0; string.remove(0,1); } } } else { int tabIndex=0; while (string.length()>0) { unsigned nextTab=string.indexOf('\t'); if (nextTab) { XDrawString(display_,window_,gc_,fs_,x_,y_,string,nextTab); pixLength = XTextWidth(fs_, string, nextTab); x_ += pixLength; string.remove(0,nextTab); } else { // tabIndex is modified in nextTabPosition. x_ += nextTabPosition(pixLength,charWidth,tabIndex); pixLength=0; string.remove(0,1); } } } } int MSTabStringList::nextTabPosition(int pixLength_, int charWidth_, int& tabIndex_) const { int spaceLeft=0; if (pixLength_) { while (pixLength_) { int tabWidth=_tabStops[tabIndex_]*charWidth_; if (pixLength_ > tabWidth) { pixLength_ -= tabWidth; } else if (pixLength_ == tabWidth) { tabIndex_ = (tabIndex_+1)%_tabStops.length(); spaceLeft = _tabStops[tabIndex_]*charWidth_; pixLength_=0; } else { spaceLeft = tabWidth-pixLength_; pixLength_=0; } tabIndex_ = (tabIndex_+1)%_tabStops.length(); } } else { spaceLeft = _tabStops[tabIndex_]*charWidth_; tabIndex_ = (tabIndex_+1)%_tabStops.length(); } return spaceLeft; } void MSTabStringList::set(MSAttrValueList& avList_) { MSStringList::set(avList_); MSIndexVector index; for(unsigned i=0;i #include #include #include #include #include #include #include #ifdef MS_NO_INLINES #include #endif static const unsigned MSTableDefaultColumnWidth=9; static const int MSTableDefaultDragBorder=2; static const unsigned long MSTableEventMask=(ButtonPressMask|ButtonReleaseMask|ExposureMask); static const int MSTableOptionMenuSymbolHeight=8; static const int MSTableOptionMenuSymbolWidth=12; static const int MSTableOptionMenuSymbolThickness=2; static const int MSTableOptionMenuMargin=5; class MSTableGroupIterator : public MSTableColumnGroup::ConstIterator { protected: MSTable::ColumnGroupList &_tableGroupList; public: MSTableGroupIterator(MSTable::ColumnGroupList &groupList_) : _tableGroupList(groupList_) {} virtual MSBoolean applyTo(const MSTableColumn *,const MSTableColumnGroup::ColumnGroupList &){return MSTrue;} virtual MSBoolean applyTo(const MSTableColumnGroup &,const MSTableColumnGroup::ColumnGroupList &); }; MSBoolean MSTableGroupIterator::applyTo(const MSTableColumnGroup &group_,const MSTableColumnGroup::ColumnGroupList &) { MSManagedPointer newGroup(new MSTableColumnGroup(group_.table()),MSInit); newGroup->shallowCopy(group_); _tableGroupList< &group=_tableGroupList(j); if (group->shallowCompare(*colgroup)==MSTrue) { column_->groupList()<columnChoiceActivate(_choices(si)); } MSTable::MSTable(MSWidget *owner_,const char *title_) : MSReportTable(title_),MSArrayView(owner_,title_) { init(); } MSTable::MSTable(MSWidget *owner_,const MSStringVector& title_) : MSReportTable(title_),MSArrayView(owner_,title_) { init(); } GC MSTable::moveGC(void) { return _movegc.gc(); } void MSTable::init(void) { unsigned long whitePixel=server()->pixel("white"); unsigned long blackPixel=server()->pixel("black"); _columnHeadingsHeight=0; _groupHeadingsHeight=0; _choicesMenu=0; _headingFont=font(); _headingAlignment=MSCenter; _headingForeground=server()->defaultForeground(); _headingsHeight=rowHeight(); _columnDragDrop=MSTrue; _columnResize=MSTrue; _showBreaks=MSFalse; _dynamicRecompute=MSFalse; _dragCursor=new MSDisplayCursor(server(),XC_sb_h_double_arrow,blackPixel,whitePixel); _resizeCursor=new MSDisplayCursor(server(),XC_right_side,blackPixel,whitePixel); _choiceStyle=ChoicePopupMenu; XSetWindowAttributes attributes; attributes.save_under=True; attributes.override_redirect=True; attributes.backing_store=WhenMapped; attributes.cursor=dragCursor()->cursor(); attributes.border_pixel=server()->pixel("yellow"); _dragWindow=XCreateWindow(display(),server()->root(), 0,0,1,1,MSTableDefaultDragBorder, CopyFromParent,InputOutput,CopyFromParent, CWOverrideRedirect|CWSaveUnder|CWBackingStore|CWCursor|CWBorderPixel, &attributes); XGCValues values; values.foreground=whitePixel^background(); values.background=blackPixel; values.line_width=2; values.function=GXxor; values.subwindow_mode=IncludeInferiors; _movegc.setGCValues(server(),MSTrue,&values, GCForeground|GCBackground|GCLineWidth|GCFunction|GCSubwindowMode); selectInput(MSTableEventMask|PointerMotionMask); } MSTable::~MSTable(void) { freeze(); delete _dragCursor; delete _resizeCursor; if (_choicesMenu!=0) safeDestroy(_choicesMenu); XDestroyWindow(display(),dragWindow()); unsigned i,n=columnList()->count(); for (i=n-1;icount(); for (i=n-1;iarray(i)); } int MSTable::selectedDataRow(void) const { int dataRow=selectedRow(); if (dataRow!=-1) { MSBoolean isBreakRow; dataRow=getDataRow(dataRow,isBreakRow); if (isBreakRow==MSTrue) dataRow=-1; else { const MSTableColumn *pTableColumn=tableColumn(selectedColumn()); if (pTableColumn!=0) { if (dataRow>=pTableColumn->numRows()) dataRow=-1; } else dataRow=-1; } } return dataRow; } void MSTable::selectedDataRow(int selectedDataRow_) { if (selectedDataRow_==-1) selectedRow(-1); else { if (selectedColumn()==-1&&numColumns()>0) _selectedColumn=0; if (selectedColumn()!=-1) { MSTableColumn *pTableColumn=tableColumn(selectedColumn()); if (pTableColumn!=0) { if (pTableColumn->numRows()>selectedDataRow_) { if (showBreaks()==MSTrue) selectedRow(adjustPositionForBreaks(selectedDataRow_)); else if (viewVector().length()>0) { int viewRow; if ((viewRow=viewVector().indexOf(selectedDataRow_))!=viewVector().length()) { selectedRow(viewRow); } } else selectedRow(selectedDataRow_); } } } } } MSIndexVector MSTable::selectionDataVector(void) const { MSIndexVector indexVector; for (unsigned i=0;i0) { int viewRow; if ((viewRow=viewVector().indexOf(selectionDataVector_(i)))!=viewVector().length()) { viewSelectionVector<=0&&y_>=0) { y_-=panner()->y_origin(); x_-=panner()->x_origin(); col=(x_numRows()) { return pTableColumn->helpString(); } return _helpString; } unsigned long MSTable::convertForeground(const char *fg_) { return server()->pixel(fg_); } void MSTable::placeColumnAt(MSTableColumn *pColumn_,unsigned index_) { MSBoolean wasFrozen=frozen(); if (editor()->mapped()==MSTrue) unmapEditor(); if (wasFrozen==MSFalse) freeze(); columnList()->insert(pColumn_,index_); resetColumnLocations(); if (wasFrozen==MSFalse) unfreeze(); } void MSTable::permuteColumns(const MSIndexVector& aIndexVector_) { MSBoolean wasFrozen=frozen(); if (editor()->mapped()==MSTrue) unmapEditor(); if (wasFrozen==MSFalse) freeze(); MSReportTable::permuteColumns(aIndexVector_); if (wasFrozen==MSFalse) adjustView(); updateInternalState(); if (wasFrozen==MSFalse) unfreeze(); } void MSTable::permuteColumns(const MSSymbolVector& aSymbolVector_) { MSBoolean wasFrozen=frozen(); if (editor()->mapped()==MSTrue) unmapEditor(); if (wasFrozen==MSFalse) freeze(); MSReportTable::permuteColumns(aSymbolVector_); if (wasFrozen==MSFalse) adjustView(); updateInternalState(); if (wasFrozen==MSFalse) unfreeze(); } // insert the column into the column list void MSTable::insertChild(MSWidget *widget_) { MSTableColumn *pTableColumn=(MSTableColumn *)widget_; addColumn(pTableColumn); updateInternalState(); if (mapped()==MSTrue&&frozen()==MSFalse) updateData(); if (visible() != pTableColumn->visible()) { if(visible()==MSTrue) visibilityUnobscuredNotify(pTableColumn); else visibilityObscuredNotify(pTableColumn); } } // remove child from the column list void MSTable::removeChild(MSWidget* widget_) { MSTableColumn *pTableColumn=(MSTableColumn *)widget_; if (columnList()->remove(pTableColumn)==MSTrue) { resetColumnLocations(); updateInternalState(); if (mapped()==MSTrue&&frozen()==MSFalse) updateData(); } else hiddenColumnList()->remove(pTableColumn); } void MSTable::headingFont(const char *fid_) { headingFont(server()->fontID(fid_)); } void MSTable::headingFont(Font fid_) { if (headingFont()!=fid_) { freeze(); unsigned i,n=numColumns(); for (i=0;iheadingFont()==headingFont()) tableColumn(i)->headingFont(fid_); n=hiddenColumnList()->count(); for (i=0;iarray(i); if (tc->headingFont()==headingFont()) tc->headingFont(fid_); } _headingFont=fid_; unfreeze(); } } void MSTable::headingAlignment(unsigned long alignment_) { if (headingAlignment()!=alignment_) { freeze(); unsigned i,n=numColumns(); for (i=0;iheadingAlignment()==headingAlignment()) tableColumn(i)->headingAlignment(alignment_); n=hiddenColumnList()->count(); for (i=0;iarray(i); if (tc->headingAlignment()==headingAlignment()) tc->headingAlignment(alignment_); } _headingAlignment=alignment_; unfreeze(); } } void MSTable::exchangeColumns(unsigned column1_,unsigned column2_) { if (columnList()->exchange(column1_,column2_)==MSTrue) { if (firstMap()==MSTrue) { if (editor()->mapped()==MSTrue) unmapEditor(); if (column1_==0||column2_==0) updateInternalState(); adjustNumVisible(); redrawImmediately(); } } } void MSTable::updateInternalState(void) { unsigned before=numRows(); maxRowsClear(); unsigned n=numColumns(); if (n>0) for (unsigned i=0;inumRows()); unsigned after=numRows(); if (selectionMode()==MSMultiple) { if(after>=before&&aftermax()) before=vsb()->max(); if(afterforeground()==oldfg_) tc->foreground(foreground()); } n=hiddenColumnList()->count(); for (i=n-1;iarray(i); if (tc->foreground()==oldfg_) tc->foreground(foreground()); } } void MSTable::updateBackground(unsigned long oldbg_) { MSArrayView::updateBackground(oldbg_); unsigned i,n=numColumns(); for (i=0;ibackground()==oldbg_) tc->background(background()); } n=hiddenColumnList()->count(); for (i=n-1;iarray(i); tc->background(background()); } } void MSTable::columnChoiceActivate(const MSString& aString_) { if(viewValidate(aString_.string(),selectedRow(),selectedColumn())==MSTrue) { valueChange(); //TODO: is this necessary?? if (showBreaks()==MSTrue) drawRowColumn(selectedRow(),selectedColumn()); } } MSBoolean MSTable::editorActivate(void) { if (editor()->mapped()==MSTrue) { if (viewValidate(editor()->string(),selectedRow(),selectedColumn())==MSTrue) { unmapEditor(); valueChange(); if (showBreaks()==MSTrue) drawRowColumn(selectedRow(),selectedColumn()); } } return (editor()->mapped()==MSTrue)?MSFalse:MSTrue; } void MSTable::valueChange(void) { activateCallback(MSWidgetCallback::valuechange); } void MSTable::increment(void) { if (selectedRow()!=-1) { MSBoolean isBreakRow; unsigned modelRow=getDataRow(selectedRow(),isBreakRow); if (isBreakRow==MSFalse) { MSTableColumn *pTableColumn=tableColumn(selectedColumn()); if (pTableColumn!=0&&modelRownumRows()) { pTableColumn->increment(modelRow); } } } } void MSTable::decrement(void) { if (selectedRow()!=-1) { MSBoolean isBreakRow; unsigned modelRow=getDataRow(selectedRow(),isBreakRow); if (isBreakRow==MSFalse) { MSTableColumn *pTableColumn=tableColumn(selectedColumn()); if (pTableColumn!=0&&modelRownumRows()) { pTableColumn->decrement(modelRow); } } } } int MSTable::columnPixelWidth(int column_) { if (column_columnPixelWidth(); else return MSTableDefaultColumnWidth*charWidth('M')+(columnSpacing()<<1); } else return MSTableDefaultColumnWidth*charWidth('M')+(columnSpacing()<<1); } unsigned MSTable::columnNumRows(unsigned) const { return numRows(); } unsigned MSTable::numRows(unsigned column_) const { const MSTableColumn *pTableColumn=tableColumn(column_); return (pTableColumn!=0)?pTableColumn->numRows():0; } unsigned MSTable::columnLength(unsigned column_) { int cw=0; if (column_columnWidth(); } return cw; } void MSTable::clearColumn(int column_) { if (inColRange(column_)==MSTrue) clearRows(firstRow(),lastRow(),column_,column_); } void MSTable::drawFixedColumnHeadings(Window window_) { if (fixedColumns()>0) drawHeadings(window_,0,fixedColumns()-1); } void MSTable::drawHeadings(Window window_) { if (mapped()==MSTrue&&frozen()==MSFalse) { drawFixedColumnHeadings(window_); drawHeadings(window_,firstColumn(),lastColumn()); } } void MSTable::drawHeadings(Window window_,int cs_,int ce_) { if (mapped()==MSTrue&&frozen()==MSFalse&&headingsHeight()>0) { drawColumnHeadings(window_,cs_,ce_); drawGroupHeadings(window_,cs_,ce_); } } void MSTable::updateColumnHeadings(void) { if (mapped()==MSTrue&&frozen()==MSFalse) { if (fixedColumns()>0) drawColumnHeadings(panner()->window(),0,fixedColumns()-1); drawColumnHeadings(panner()->window(),firstColumn(),lastColumn()); } } void MSTable::drawColumnHeadings(Window window_,int cs_,int ce_) { if (mapped()==MSTrue&&frozen()==MSFalse&&headingsHeight()>0) { int offset=panner()->highlightThickness()+panner()->shadowThickness(); int y=offset; int x=computeXCoord(cs_); int len=0; int cw=0; int j,w; MSRect aRect; for (j=cs_;j<=ce_&&jcolumnPixelWidth(); if (pTableColumn->heading().length()>0) { len=pTableColumn->columnWidth(); w=panner()->width()-2*(panner()->shadowThickness()+panner()->highlightThickness()); XFillRectangle(display(),window_,panner()->backgroundShadowGC(), x,y,(cw>w)?w:cw,headingsHeight()-rowSpacing()); aRect.configuration(x+columnSpacing(),y+rowSpacing(), (cw>w)?w:cw,headingsHeight()-2*rowSpacing()); drawColumnHeading(window_,pTableColumn,aRect,len); } x+=cw; } XBFillRectangle(display(),window_,panner()->bottomShadowGC(), offset,offset+headingsHeight()-rowSpacing(), panner()->width()-2*offset,rowSpacing()); } } void MSTable::drawCell(Window window_,int x_,int y_,int row_,int column_) { MSArrayView::drawCell(window_,x_,y_,row_,column_); } void MSTable::drawCell(Window window_,int x_,int y_,int row_,int column_, unsigned long foreground_,unsigned long background_,Font fid_, MSBoolean rowSelected_,MSBoolean cellSelected_,MSBoolean cellValid_) { MSBoolean hasOptions=columnHasOptions(column_); if (hasOptions==MSTrue) { MSArrayView::drawCell(window_,x_,y_,row_,column_,foreground_,background_,fid_, rowSelected_,MSFalse,cellValid_); } else { MSArrayView::drawCell(window_,x_,y_,row_,column_,foreground_,background_,fid_, rowSelected_,cellSelected_,cellValid_); } ChoiceStyle style=columnChoiceStyle(column_); MSBoolean drawOptionMenu=MSBoolean(hasOptions && (style==ChoiceOptionMenuAlwaysDrawn || cellSelected_==MSTrue)); if (drawOptionMenu==MSTrue) { int w=columnPixelWidth(column_)-columnSpacing(); int h=rowHeight()-rowSpacing(); MSRect aRect(x_,y_,w,h); drawRaised(window_,aRect,1); aRect.configuration(x_+w-MSTableOptionMenuMargin-MSTableOptionMenuSymbolWidth, y_+(h-MSTableOptionMenuSymbolHeight)/2, MSTableOptionMenuSymbolWidth, MSTableOptionMenuSymbolHeight); drawRaised(window_,aRect,MSTableOptionMenuSymbolThickness); } } void MSTable::appendUpdate(void) { MSBoolean showBreakStatus=showBreaks(); unsigned oldFirstRow=firstRow(); if (showBreakStatus==MSTrue) freeze(); showBreaks(MSFalse); int rs=vsb()->max(); adjustNumVisible(); updateInternalState(); updateVsb(); if (inRowRange(rs)==MSTrue) { drawHSeparators(panner()->window(),firstRow(),lastRow(),0,fixedColumns()-1); drawHSeparators(panner()->window(),firstRow(),lastRow(),firstColumn(),lastColumn()); drawVSeparators(panner()->window(),firstRow(),lastRow(),0,fixedColumns()-1); drawVSeparators(panner()->window(),firstRow(),lastRow(),firstColumn(),lastColumn()); moveSelection(selectedRow(),selectedColumn()); } showBreaks(showBreakStatus); if (showBreakStatus==MSTrue) { MSReportTable::computeBreaks(); _firstRow=oldFirstRow; unfreeze(); } } void MSTable::columnUpdate(int column_) { MSTableColumn *pTableColumn=tableColumn(column_); if (pTableColumn!=0) { MSBoolean showBreakStatus=showBreaks(); if (showBreakStatus==MSTrue) freeze(); showBreaks(MSFalse); int nr=numDataRows(); int fr=firstRow(); if (editor()->mapped()==MSTrue&& selectedColumn()==column_&&selectedRow()>=pTableColumn->numRows()) unmapEditor(); updateInternalState(); updateVsb(); adjustFirstRow(); adjustSelection(); // If we are in multiple selection mode, always make sure the current // selected row is in the selection vector. if (selectionMode()==MSMultiple&&selectedRow()!=-1&& selectionVector().indexOf(selectedRow())==selectionVector().length()) { _selectionVector.append(selectedRow()); _selectionVector.sortUp(); } updateScrollBars(); if (fr!=firstRow()||numDataRows()!=nr) redrawImmediately(); else { if (pTableColumn->numRows()numRows(),firstRow()+rows()-1,column_,column_); } drawColumn(column_); moveSelection(selectedRow(),selectedColumn()); } showBreaks(showBreakStatus); if (showBreakStatus==MSTrue) { MSReportTable::computeBreaks(); _firstRow=fr; unfreeze(); } } } void MSTable::createCycle(int row_,int column_) { if (column_>=0) { MSTableColumn *pTableColumn=tableColumn(column_); if (pTableColumn!=0) { unsigned viewRow=row_; if (cycleList().length()!=0) processCycleTimer(); if (row_!=-1) { if (showBreaks()==MSTrue) { viewRow=adjustPositionForBreaks(viewRow); } else if (viewVector().length()>0) { if ((viewRow=viewVector().indexOf(row_))==viewVector().length()) return; } } if (inRowRange(viewRow)==MSTrue) { if (pTableColumn->cycleColors().length()>0||pTableColumn->cycleColorMode()==MSReverseVideo) startCycle(viewRow,column_,pTableColumn->cycleColors(),pTableColumn->cycleColorMode()); else if (cycleColors().length()>0||cycleColorMode()==MSReverseVideo) startCycle(viewRow,column_,cycleColors(),cycleColorMode()); else drawRowColumn(viewRow,column_); } else if (row_==-1) { if (pTableColumn->cycleColors().length()>0||pTableColumn->cycleColorMode()==MSReverseVideo) startCycle(viewRow,column_,pTableColumn->cycleColors(),pTableColumn->cycleColorMode()); else if (cycleColors().length()>0||cycleColorMode()==MSReverseVideo) startCycle(viewRow,column_,cycleColors(),cycleColorMode()); else drawColumn(column_); } if (cycleList().length()!=0) { if (cycleTimer()==0) _cycleTimer=new MSArrayView::CycleTimer(this,cycleInterval()); else cycleTimer()->reset(); } updateBreakStatus(row_,column_); } } else if(row_!=-1) // cycleRow was called. { unsigned viewRow=row_; if (showBreaks()==MSTrue) { viewRow=adjustPositionForBreaks(viewRow); } else if (viewVector().length()>0) { if ((viewRow=viewVector().indexOf(row_))==viewVector().length()) return; } if (inRowRange(viewRow)==MSTrue) { int n = numColumns(); //We have to do a loop here, because cycleColor vector could be different //for each column. for(int col=0;colcycleColors().length()>0||pTableColumn->cycleColorMode()==MSReverseVideo) startCycle(viewRow,col,pTableColumn->cycleColors(),pTableColumn->cycleColorMode()); else if (cycleColors().length()>0||cycleColorMode()==MSReverseVideo) startCycle(viewRow,col,cycleColors(),cycleColorMode()); else drawRowColumn(viewRow,col); } } } } } void MSTable::calculateHeadingsHeight(void) { calculateGroupHeadingsHeight(); calculateColumnHeadingsHeight(); headingsHeight(columnHeadingsHeight()+groupHeadingsHeight()); } void MSTable::calculateColumnHeadingsHeight(void) { MSTableColumn *pTableColumn; Font fid; int th,max=0; unsigned n=numColumns(); for (unsigned i=0;iheadingFont(); pTableColumn->headingFontStruct((XFontStruct *)server()->fontStruct(fid)); th=pTableColumn->headingHeight(); max=(th>max)?th:max; } max=(max>0)?max+(rowSpacing()<<1):0; columnHeadingsHeight(max); } void MSTable::updateFont(Font oldfid_) { MSCompositeText::updateFont(oldfid_); freeze(); unsigned i,n=numColumns(); for (i=0;ifont()==oldfid_) tc->font(font()); } n=hiddenColumnList()->count(); for (i=n-1;iarray(i); if (tc->font()==oldfid_) tc->font(font()); } rowHeight(textHeight()+2*rowSpacing()); headingsHeight(rowHeight()); unfreeze(); } void MSTable::updateTitle(void) { unsigned long fg=label()->foreground(); Font fid=label()->font(); MSArrayView::updateTitle(); if (fid!=label()->font()) { int hh=headingsHeight(); calculateHeadingsHeight(); if (hh!=headingsHeight()) { adjustNumVisible(); redrawImmediately(); } else drawHeadings(panner()->window()); } else if (fg!=label()->foreground()) drawHeadings(panner()->window()); } void MSTable::visibilityObscured(void) { visible(MSFalse); unsigned n=numColumns(); for (unsigned i=0;iheadingFontStruct(); int nc=0; int xdelta; int ydelta; int cw=aRect_.width(); int tw; XSetForeground(display(),textGC(),pTableColumn_->headingForeground()); XSetBackground(display(),textGC(),panner()->background()); XSetFont(display(),textGC(),pTableColumn_->headingFont()); if (pTableColumn_->heading().length()>0) { int n=pTableColumn_->heading().length(); const char *pString; if (pTableColumn_->headingAlignment()&MSTop) { ydelta=groupHeadingsHeight(); } else if (pTableColumn_->headingAlignment()&MSBottom) { ydelta=aRect_.height()-pTableColumn_->headingHeight()-rowSpacing(); } else { ydelta=aRect_.height()-groupHeadingsHeight()-pTableColumn_->headingHeight(); ydelta=(ydelta>0)?ydelta>>1:0; ydelta+=groupHeadingsHeight(); } int y=aRect_.y()+ydelta; for (unsigned i=0;iheading()(i); tw=0; nc=0; pString=aString.string(); nc=aString.length(); tw=XTextWidth(fs,pString,nc); if (nc>0) { if (tw>cw) { nc=computeMaxTextLength(fs,pString,cw,nc); xdelta=0; } else { if (pTableColumn_->headingAlignment()&MSLeft) { xdelta=0; } else if (pTableColumn_->headingAlignment()&MSRight) { xdelta=cw-tw-columnSpacing(); } else { xdelta=(cw>tw)?(cw-tw)>>1:0; } } XDrawImageString(display(),window_,textGC(),fs, aRect_.x()+xdelta,y+pTableColumn_->headingAscent(),pString,nc); } y+=(pTableColumn_->headingAscent()+pTableColumn_->headingDescent()); } } } void MSTable::headingAreaSelection(const XEvent *pEvent_) { int col=(pEvent_->xbutton.x<(fixedColumnPixelWidth()+labelWidth()))? xToColumn(pEvent_->xbutton.x-labelWidth()): xToColumn(pEvent_->xbutton.x-labelWidth())+firstColumn(); if (inColRange(col)==MSTrue) { if (pEvent_->xbutton.state&Mod1Mask) { if(columnDragDrop()==MSTrue) dragColumn(pEvent_,col); } else { if (selectedColumn()!=col) { int row; if (selectedRow()<0&&numRows()>0) row=0; else row=selectedRow(); if (row>=0) { if (hasCallback(MSWidgetCallback::columnselection)==MSTrue|| hasCallback(MSWidgetCallback::columnmenubutton)==MSTrue) { setSelection(row,col); } else selectedRowColumn(row,col); } } if (selectedColumn()>=0&&selectedRow()>=0) { if (pEvent_->xbutton.button==Button3) { columnMenuButtonSelection(); } else { columnSelection(); } } } } } void MSTable::dataAreaSelection(const XEvent *pEvent_) { // Figure out the row and column selected by the button int col=columnFromEvent(pEvent_); MSTableColumn *tcol=0; // If the meta key is held down, drag the column if (pEvent_->xbutton.state&Mod1Mask) { if (columnDragDrop()==MSTrue&&inColRange(col)==MSTrue) { dragColumn(pEvent_,col); } } // else if the pointer is inside a separator, resize the column only if neither the Shift // nor Control key is held down else if ((!(pEvent_->xbutton.state&ShiftMask)&&!(pEvent_->xbutton.state&ControlMask))&& columnResize()==MSTrue&& insideSeparator(pEvent_->xbutton.x,pEvent_->xbutton.y,col)==MSTrue&& (tcol=tableColumn(col))!=0&& tcol->resizable()==MSTrue) { resizeColumn(col,pEvent_->xbutton.x); } else { XUndefineCursor(display(),panner()->window()); if (pEvent_->xbutton.button==Button1) { int row=rowFromEvent(pEvent_); MSBoolean isBreakRow; int dataRow=getDataRow(row,isBreakRow); if (isBreakRow==MSFalse) { int oldSelectedRow=selectedRow(); int oldSelectedColumn=selectedColumn(); MSBoolean inRange=MSBoolean(inColRange(col)&&inRowRange(row)); MSBoolean hasOptions=columnHasOptions(col); if (inRange==MSTrue && hasOptions==MSTrue && col==oldSelectedColumn && row==oldSelectedRow && isViewValid(row,col)==MSTrue) { showOptions(row,col); return; } } } MSArrayView::dataAreaSelection(pEvent_); } } void MSTable::calculateRowHeight(void) { MSArrayView::calculateRowHeight(); unsigned ncol=numColumns(); for (unsigned i=0;icellChoices(row_); else return nullStringVector; } void MSTable::returnKey(void) { if (columnHasOptions(selectedColumn())==MSTrue) { showOptions(selectedRow(),selectedColumn()); } else MSArrayView::returnKey(); } MSBoolean MSTable::columnHasOptions(int column_) { if (columnChoiceStyle(column_) != ChoicePopupMenu) { MSTableColumn *col=tableColumn(column_); if(col!=0) return col->hasOptions(); } return MSFalse; } MSTable::ChoiceStyle MSTable::columnChoiceStyle(int) { return _choiceStyle; } void MSTable::defaultButton3Behavior(const XEvent *pEvent_) { const MSTableColumn *pTableColumn=tableColumn(selectedColumn()); if (pTableColumn!=0) { if (pTableColumn->choices().length()>0 && columnChoiceStyle(selectedColumn())==ChoicePopupMenu) { if (_choicesMenu==0) _choicesMenu=new ColumnPopupMenu(this); _choicesMenu->choices(pTableColumn->choices()); _choicesMenu->background(pTableColumn->background()); _choicesMenu->foreground(pTableColumn->foreground()); _choicesMenu->font(pTableColumn->font()); int x,y; pointerXY(x,y); _choicesMenu->moveTo(x,y); _choicesMenu->show(); } else if (activateCallback(MSWidgetCallback::menubutton)==MSFalse) { startEditing(pEvent_); } } } void MSTable::childInsert(MSWidget *widget_) { insertChild(widget_); } void MSTable::childRemove(MSWidget *widget_) { removeChild(widget_); } void MSTable::childCreate(MSWidget *widget_) { insertChild(widget_); } void MSTable::childDestroy(MSWidget *widget_) { removeChild(widget_); } unsigned MSTable::numColumns(void) const { return columnList()->count(); } unsigned MSTable::numRows(void) const { // viewVector and showBreaks are not supported together, // the numRows calculation takes that into consideration. if (showBreaks()==MSTrue) return MSReportTable::numRows()+breakIndex().length(); else if (viewVector().length()>0) return viewVector().length(); else return MSReportTable::numRows(); } unsigned MSTable::numDataRows(void) const { // We're not honoring viewVector when showBreaks is On if (showBreaks()==MSTrue) return MSReportTable::numRows(); else if (viewVector().length()>0) return viewVector().length(); else return MSReportTable::numRows(); } MSWidgetVector MSTable::children(void) { MSWidgetVector vector; unsigned n=columnList()->count(); unsigned i; for (i=0;iarray(i)); n=hiddenColumnList()->count(); for (i=0;iarray(i)); return vector; } void MSTable::columnResize(MSBoolean columnResize_) { if (_columnResize!=columnResize_) { _columnResize=columnResize_; if (_columnResize==MSTrue) selectInput(MSTableEventMask|PointerMotionMask); else { XUndefineCursor(display(),panner()->window()); selectInput(MSTableEventMask); } } } void MSTable::shuffleColumns(MSIndexVector &aIndexVector_) { permuteColumns(aIndexVector_); activateCallback(MSWidgetCallback::permutecolumns); } void MSTable::dragColumn(const XEvent *pEvent_,int column_) { int x=computeXCoord(column_); int width=columnPixelWidth(column_); // if the whole column does not fit within the panner,just beep and return. // We want to disallow drag & drop on partially shown columns. if (x+width>panner()->width()-panner()->highlightThickness()-panner()->shadowThickness()) { server()->bell(); return; } server()->grabPointer(window(),False,ButtonPressMask|ButtonReleaseMask, GrabModeAsync,GrabModeAsync,None, dragCursor()->cursor(),CurrentTime); int rootx,rooty; panner()->rootXY(rootx,rooty); int height=panner()->height(); int y=rooty+headingsHeight(); XWindowChanges values; values.x=x+rootx-MSTableDefaultDragBorder; values.y=y; values.width=width; values.height=height; XConfigureWindow(display(),dragWindow(),CWX|CWY|CWWidth|CWHeight,&values); XCopyArea(display(),panner()->window(),redrawPixmap()->pixmap(),backgroundGC(),x,0,width,height,x,0); drawGroupHeadings(redrawPixmap()->pixmap(),column_,column_); XMapRaised(display(),dragWindow()); XCopyArea(display(),redrawPixmap()->pixmap(),dragWindow(),backgroundGC(),x,0,width,height,0,0); int left=computeXCoord(firstColumn())+rootx; int right=panner()->width()+rootx; int offset=pEvent_->xbutton.x-x; int startx=pEvent_->xbutton.x+rootx; int lastx=startx; Window root,child; int rx,ry,ix,iy; unsigned keys; // We're going to allow either Button1,Button2,or Button3 int sameScreen=XQueryPointer(display(),panner()->window(),&root,&child,&rx,&ry,&ix,&iy,&keys); while ((keys&Button1Mask)||(keys&Button2Mask)||(keys&Button3Mask)) { if (sameScreen==True) { int newx=rx-offset; if (rx!=lastx) { XMoveWindow(display(),dragWindow(),newx,y); server()->flush(); lastx=rx; } if (newxleft||fixedColumns()==0) scrollLeft(1); } else if (newx+width>right&&lastColumn()!=numColumns()-1) scrollRight(1); } sameScreen=XQueryPointer(display(),panner()->window(),&root,&child,&rx,&ry,&ix,&iy,&keys); } XUnmapWindow(display(),dragWindow()); server()->ungrabPointer(window(),CurrentTime); int finalX=lastx-offset-rootx; int col=(finalX<(fixedColumnPixelWidth()+labelWidth()))? xToColumn(finalX-labelWidth()): xToColumn(finalX-labelWidth())+firstColumn(); col=(col>=numColumns())?numColumns()-1:col; if (col!=column_&&(col!=column_-1||finalXstartx) //Insert right { if (col==numColumns()-1||lastx-offset>right) aIndexVector.append(column_); else aIndexVector.insertAt(col,column_); } else // Insert left { if (col==0&&lastx-offsetstartx) //Insert right { if (col==numColumns()-1||lastx-offset>right) { int off=panner()->highlightThickness()+panner()->shadowThickness(); int deltaWidth=panner()->width()-2*off-fixedColumnPixelWidth()-labelWidth(); int i; for (i=numColumns()-1;i>=0;i--) { deltaWidth-=columnPixelWidth(i); if (deltaWidth<0) { i++; break; } } firstColumn(i); } } else // Insert left { if (fixedColumns()>0) { if (col==fixedColumns()-1) firstColumn(fixedColumns()); } else if (col==0&&lastx-offsetxbutton.subwindow==panner()->window()) { XEvent *ep=(XEvent *)pEvent_; ep->xbutton.y-=panner()->y_origin(); ep->xbutton.x-=panner()->x_origin(); int col; if (insideSeparator(ep->xbutton.x,ep->xbutton.y,col)==MSTrue) { MSTableColumn *tcol=tableColumn(col); if (tcol!=0&&tcol->resizable()==MSTrue) XDefineCursor(display(),panner()->window(),dragCursor()->cursor()); else XUndefineCursor(display(),panner()->window()); } else XUndefineCursor(display(),panner()->window()); } } MSBoolean MSTable::insideSeparator(int x_,int y_,int &column_) { if (y_>=headingsHeight()) { int offset=labelWidth()+panner()->shadowThickness()+panner()->highlightThickness(); int limit=panner()->width()-panner()->shadowThickness()-panner()->highlightThickness(); int rightOffset=columnSpacing()<<1; int leftOffset=columnSpacing(); int i; int w=offset; int fc=0; int lc=fixedColumns(); for (i=fc;i=limit) return MSFalse; else if (x_<=w+leftOffset&&x_>=w-rightOffset) { column_=i; return MSTrue; } } fc=firstColumn(); lc=lastColumn()+1; for (i=fc;i=limit) return MSFalse; else if (x_<=w+leftOffset&&x_>=w-rightOffset) { column_=i; return MSTrue; } } } return MSFalse; } void MSTable::resizeColumn(int column_,int startPos_) { server()->grabPointer(window(),False,ButtonPressMask|ButtonReleaseMask, GrabModeAsync,GrabModeAsync,None, resizeCursor()->cursor(),CurrentTime); MSTableColumn *column=tableColumn(column_); int increment=(column->clipMode()==MSNoClipping)?column->charWidth('W'):column->charWidth('0'); int width=column->columnWidth(); int drawX=computeXCoord(column_); int drawY=headingsHeight(); int drawHeight=panner()->height()-headingsHeight()-2; int startX=drawX+column->columnPixelWidth(); int drawWidth=startX-drawX; int lastX=startX; int offset=startX-startPos_; int leftLimit=drawX+columnSpacing(); int rightLimit=panner()->width()-panner()->highlightThickness()-panner()->shadowThickness(); XDrawRectangle(display(),panner()->window(),moveGC(),drawX,drawY,drawWidth,drawHeight); Window root,child; int rx,ry,ix,iy; unsigned keys; int newWidth; int sameScreen=XQueryPointer(display(),panner()->window(),&root,&child,&rx,&ry,&ix,&iy,&keys); while ((keys&Button1Mask)||(keys&Button2Mask)||(keys&Button3Mask)) { if (sameScreen==True) { ix+=offset; ix=ix>leftLimit?ix:leftLimit; ix=ixwindow(),moveGC(),drawX,drawY,drawWidth,drawHeight); lastX=ix; drawWidth=lastX-drawX; XDrawRectangle(display(),panner()->window(),moveGC(),drawX,drawY,drawWidth,drawHeight); } } sameScreen=XQueryPointer(display(),panner()->window(),&root,&child,&rx,&ry,&ix,&iy,&keys); } XDrawRectangle(display(),panner()->window(),moveGC(),drawX,drawY,drawWidth,drawHeight); newWidth=(lastX-drawX-columnSpacing()*2)/increment; newWidth=newWidth>0?newWidth:0; column->columnWidth(newWidth); server()->ungrabPointer(window(),CurrentTime); int dummy; if (insideSeparator(lastX,iy,dummy)==MSTrue) XDefineCursor(display(),panner()->window(),dragCursor()->cursor()); else XUndefineCursor(display(),panner()->window()); } MSTableColumn *MSTable::tableColumn(unsigned column_) { return (MSTableColumn *)columnList()->array(column_); } MSTableColumn *MSTable::tableColumn(const MSSymbol& tag_) { return (MSTableColumn *)MSReportTable::reportColumn(tag_); } const MSTableColumn *MSTable::tableColumn(unsigned column_) const { return (MSTableColumn *)columnList()->array(column_); } const MSTableColumn *MSTable::tableColumn(const MSSymbol& tag_) const { return (MSTableColumn *)MSReportTable::reportColumn(tag_); } // ######################################################### // default virtual methods - prevents gratuitous inlining // ######################################################### MSDisplayServer *MSTable::displayServer(void) {return server();} MSIndexVector MSTable::sortUp(const MSIndexVector &sortVector_) { MSApplicationBusy busy; MSBoolean wasFrozen=frozen(); freeze(); MSIndexVector iv=MSReportTable::sortUp(sortVector_); if (showBreaks()==MSTrue) MSReportTable::computeBreaks(); if (wasFrozen==MSFalse) unfreeze(); return iv; } MSIndexVector MSTable::sortDown(const MSIndexVector &sortVector_) { MSApplicationBusy busy; MSBoolean wasFrozen=frozen(); freeze(); MSIndexVector iv=MSReportTable::sortDown(sortVector_); if (showBreaks()==MSTrue) MSReportTable::computeBreaks(); if (wasFrozen==MSFalse) unfreeze(); return iv; } MSIndexVector MSTable::sortUp(const MSSymbolVector &sortVector_) { MSApplicationBusy busy; MSBoolean wasFrozen=frozen(); freeze(); MSIndexVector iv=MSReportTable::sortUp(sortVector_); if (showBreaks()==MSTrue) MSReportTable::computeBreaks(); if (wasFrozen==MSFalse) unfreeze(); return iv; } MSIndexVector MSTable::sortDown(const MSSymbolVector &sortVector_) { MSApplicationBusy busy; MSBoolean wasFrozen=frozen(); freeze(); MSIndexVector iv=MSReportTable::sortDown(sortVector_); if (showBreaks()==MSTrue) MSReportTable::computeBreaks(); if (wasFrozen==MSFalse) unfreeze(); return iv; } void MSTable::set(MSAttrValueList& avList_) { MSArrayView::set(avList_); MSIndexVector index; for (unsigned i=0;ifontName(headingFont()),MSAttrValue::Font); MSStringVector alignmentVector("MSNone\nMSCenter\nMSTop\nMSBottom\nMSLeft\nMSRight"); avList_<fontStruct():textFontStruct(); } unsigned long MSTable::columnBackground(unsigned column_) { MSTableColumn *pTableColumn=tableColumn(column_); return (pTableColumn!=0)?pTableColumn->background():background(); } unsigned long MSTable::columnForeground(unsigned column_) { MSTableColumn *pTableColumn=tableColumn(column_); return (pTableColumn!=0)?pTableColumn->foreground():foreground(); } MSClipMode MSTable::columnClipMode(unsigned column_) const { const MSTableColumn *pTableColumn=tableColumn(column_); return (pTableColumn!=0)?pTableColumn->clipMode():MSNoClipping; } unsigned MSTable::columnEditWidth(unsigned column_) { MSTableColumn *pTableColumn=tableColumn(column_); return (pTableColumn!=0)?pTableColumn->editWidth():0; } void MSTable::computeBreaks(void) { MSReportTable::computeBreaks(); if (showBreaks()==MSTrue) { updateVsb(); redrawImmediately(); } } void MSTable::dynamicRecompute(MSBoolean recompute_) { if (recompute_!=_dynamicRecompute) { if ((_dynamicRecompute=recompute_)==MSTrue) { unsigned n=columnList()->count(); for (unsigned i=0;ibreakInvalid().length()>0) { updateBreaks(i); unsigned len=tc->breakInvalid().length(); for (unsigned j=0;jbreakInvalid()(j))+tc->breakInvalid()(j); if (inRowRange(row)==MSTrue) drawRowColumn(row,i); } tc->breakInvalid().removeAll(); } } } } } void MSTable::showBreaks(MSBoolean showBreaks_) { if (_showBreaks!=showBreaks_) { setSelection(-1,-1); _selectionVector.removeAll(); lastBlock(-1); if ((_showBreaks=showBreaks_)==MSFalse) { clearBreaks(); } else { MSReportTable::computeBreaks(); } adjustNumVisible(); redraw(); } } // This method returns the corresponding data row of a view row. // The return value has no meaning if the view row is a break row. // If view vector is in effect, the return value is the model row // if it is less than the length of the view vector. unsigned MSTable::getDataRow(unsigned viewRow_,MSBoolean &isBreakRow_) const { if (showBreaks()==MSTrue) { unsigned modelRow=adjustRowForBreaks(viewRow_); unsigned index=viewRow_-modelRow; if (indexbreakInvalid().removeAll(); unsigned n=breakIndex().length(); for (unsigned i=0;ibreakInvalid().removeAll(); for(i=0;ibreakInvalid()<row_)) tc->breakInvalid()<lastMatch) { if (tc->breakInvalid().indexOf(j)==tc->breakInvalid().length()) tc->breakInvalid()<breakInvalid().length(); for (i=0;ibreakInvalid()(i))+tc->breakInvalid()(i); if (inRowRange(row)==MSTrue) drawRowColumn(row,column_); } } } } MSString MSTable::selection(void) { MSString buffer; if (selectedRow()!=-1) { int row=selectedRow(); int column=selectedColumn(); MSTableColumn *tc=tableColumn(column); if (tc!=0) { MSBoolean isBreakRow; unsigned modelRow=getDataRow(row,isBreakRow); if (isBreakRow==MSTrue) { unsigned index=row-modelRow; tc->formatBreak(buffer,index,breakColumn()(index)); } else if (modelRownumRows()) { formatOutput(buffer,modelRow,column); } } } return buffer; } const char *MSTable::viewFormatOutput(MSString &buffer_,unsigned row_,unsigned column_) { MSTableColumn *tc=tableColumn(column_); if (tc!=0) { MSBoolean isBreakRow; unsigned modelRow=getDataRow(row_,isBreakRow); if (isBreakRow==MSTrue) { unsigned index=row_-modelRow; tc->formatBreak(buffer_,index,breakColumn()(index)); } else if (modelRownumRows()) { // If viewVector is in effect, always call formatOutput (i.e. suppressDuplicate is not honor) if ((viewVector().length()!=0&&showBreaks()==MSFalse)|| (tc->suppressDuplicate()==MSFalse||tc->isDuplicate(modelRow)==MSFalse)) formatOutput(buffer_,modelRow,column_); } } return buffer_.string(); } MSBoolean MSTable::viewValidate(const char *string_,unsigned viewRow_,unsigned column_) { // If the view row is a break row return MSFalse, // otherwise call validate() with the model row MSTableColumn *pTableColumn=tableColumn(column_); if (pTableColumn!=0) { MSBoolean isBreakRow; unsigned modelRow=getDataRow(viewRow_,isBreakRow); if (isBreakRow==MSTrue||modelRow>=pTableColumn->numRows()) return MSFalse; else return validate(string_,modelRow,column_); } else return MSFalse; } MSBoolean MSTable::isViewProtected(unsigned viewRow_,unsigned column_) { // If the view row is a break row return MSTrue // otherwise call isCellProtected() with the model row MSTableColumn *pTableColumn=tableColumn(column_); if (pTableColumn!=0) { MSBoolean isBreakRow; unsigned modelRow=getDataRow(viewRow_,isBreakRow); if (isBreakRow==MSTrue||modelRow>=pTableColumn->numRows()) return MSTrue; else return isCellProtected(modelRow,column_); } else return MSTrue; } MSBoolean MSTable::isViewValid(unsigned viewRow_,unsigned column_) { // If the view row is a break row then determine if the view is valid // otherwise call isValid() with the model row MSTableColumn *pTableColumn=tableColumn(column_); if (pTableColumn!=0) { MSBoolean isBreakRow; unsigned modelRow=getDataRow(viewRow_,isBreakRow); if (isBreakRow==MSTrue) { // if dynamicRecompute() is set to MSTrue, the screen is always valid if (dynamicRecompute()==MSTrue) return MSTrue; else { unsigned index=viewRow_-modelRow; unsigned len=pTableColumn->breakInvalid().length(); if (len>0&&pTableColumn->breakInvalid().indexOf(index)numRows()) return isValid(modelRow,column_); else return MSTrue; } else return MSTrue; } unsigned long MSTable::viewCellForeground(unsigned viewRow_,unsigned column_) { // If the view row is a break row return the break column's foreground // otherwise call cellForeground() with the model row MSTableColumn *pTableColumn=tableColumn(column_); if (pTableColumn!=0) { MSBoolean isBreakRow; unsigned modelRow=getDataRow(viewRow_,isBreakRow); if (isBreakRow==MSTrue) { //Get the break column's handle via the breakColumn vector and return its breakFgPixel //If breakFgPixel is never assigned, return the table's foreground unsigned index=viewRow_-modelRow; unsigned long pixel=tableColumn(breakColumn()(index))->breakFgPixel(index); return (pixelnumRows()) return cellForeground(modelRow,column_); else return foreground(); } return foreground(); } unsigned long MSTable::viewCellBackground(unsigned viewRow_,unsigned column_) { // If the view row is a break row return the break column's foreground // otherwise call cellBackground() with the model row MSTableColumn *pTableColumn=tableColumn(column_); if (pTableColumn!=0) { MSBoolean isBreakRow; unsigned modelRow=getDataRow(viewRow_,isBreakRow); if (isBreakRow==MSTrue) { //Get the break column's handle via the breakColumn vector and return its breakBgPixel //If breakFgPixel is never assigned, return the table's background unsigned index=viewRow_-modelRow; unsigned long pixel=tableColumn(breakColumn()(index))->breakBgPixel(index); return (pixelnumRows()) return cellBackground(modelRow,column_); else return background(); } else return background(); } Font MSTable::viewCellFont(unsigned viewRow_,unsigned column_) { // If the view row is a break row return our own font // otherwise call cellFont() with the model row MSTableColumn *pTableColumn=tableColumn(column_); if (pTableColumn!=0) { MSBoolean isBreakRow; unsigned modelRow=getDataRow(viewRow_,isBreakRow); if (isBreakRow==MSTrue||modelRow>=pTableColumn->numRows()) return font(); else return cellFont(modelRow,column_); } else return font(); } MSAlignment MSTable::viewCellAlignment(unsigned viewRow_,unsigned column_) { // If the view row is a break row return the current breakStyle of column // otherwise call cellAlignment() with the model row MSTableColumn *pTableColumn=tableColumn(column_); if (pTableColumn!=0) { MSBoolean isBreakRow; unsigned modelRow=getDataRow(viewRow_,isBreakRow); if (isBreakRow==MSTrue||modelRow>=pTableColumn->numRows()) { unsigned long bs=pTableColumn->breakStyle(); if (MSCenter&bs) return MSCenter; else if (MSRight&bs) return MSRight; else return MSLeft; } else return cellAlignment(modelRow,column_); } else return MSLeft; } const char *MSTable::formatOutput(MSString &buffer_,unsigned row_,unsigned column_) { MSTableColumn *pTableColumn=tableColumn(column_); if (pTableColumn!=0) pTableColumn->formatOutput(buffer_,row_); return buffer_.string(); } MSBoolean MSTable::validate(const char *pString_,unsigned row_,unsigned column_) { MSTableColumn *pTableColumn=tableColumn(column_); if (pTableColumn!=0) { MSString aString=pString_; if (pTableColumn->validationCallback()!=0) { if (pTableColumn->validationCallback()->validate(aString)==MSFalse) return MSFalse; } return pTableColumn->validate(aString.string(),row_); } else return MSFalse; } MSBoolean MSTable::isCellProtected(unsigned row_,unsigned column_) { if (isProtected()==MSFalse) { MSTableColumn *pTableColumn=tableColumn(column_); return (pTableColumn!=0)?pTableColumn->isCellProtected(row_):MSTrue; } else return MSTrue; } MSBoolean MSTable::isValid(unsigned row_,unsigned column_) { MSTableColumn *pTableColumn=tableColumn(column_); return (pTableColumn!=0)?pTableColumn->isValid(row_):sensitive(); } unsigned long MSTable::cellForeground(unsigned row_,unsigned column_) { MSTableColumn *pTableColumn=tableColumn(column_); if (pTableColumn==0) { if (foregroundColors().length()==0) return foreground(); else return foregroundColors()(row_%foregroundColors().length()); } else return pTableColumn->cellForeground(row_); } unsigned long MSTable::cellBackground(unsigned row_,unsigned column_) { MSTableColumn *pTableColumn=tableColumn(column_); if (pTableColumn==0) { if (backgroundColors().length()==0) return background(); else return backgroundColors()(row_%backgroundColors().length()); } else return pTableColumn->cellBackground(row_); } Font MSTable::cellFont(unsigned row_,unsigned column_) { MSTableColumn *pTableColumn=tableColumn(column_); return (pTableColumn!=0)?pTableColumn->cellFont(row_):font(); } MSAlignment MSTable::cellAlignment(unsigned row_,unsigned column_) { MSTableColumn *pTableColumn=tableColumn(column_); return (pTableColumn!=0)?pTableColumn->cellAlignment(row_):MSRight; } void MSTable::drawGroupHeadings(Window window_) { if (groupHeadingsHeight()>0) { if (fixedColumns()>0) { if (numColumns()<=columns()) { drawGroupHeadings(window_,0,lastColumn()); } else { drawGroupHeadings(window_,0,fixedColumns()-1); drawGroupHeadings(window_,firstColumn(),lastColumn()); } } else { drawGroupHeadings(window_,firstColumn(),lastColumn()); } } } void MSTable::calculateGroupHeadingsHeight(void) { groupHeadingsHeightVector().removeAll(); unsigned len=columnList()->count(); for (unsigned i=0;iarray(i); calculateGroupHeadingsHeight(col,groupHeadingsHeightVector()); } int groupHeight=(int) groupHeadingsHeightVector().sum(); groupHeadingsHeight(groupHeight); } void MSTable::calculateGroupHeadingsHeight(MSTableColumn *column_, MSIntVector &heightVector_) { unsigned len=column_->groupList().length(); for (unsigned i=0;igroupList()(i); int groupHeight=0; MSFontObject fontObj; if (group->heading().length()!=0) { fontObj.fontStruct(server()->fontStruct(group->font())); groupHeight=fontObj.textHeight()*group->heading().length()+rowSpacing(); } if (heightVector_.length()==i) heightVector_<count(); for (i=0;iarray(i); if (column!=0) column->groupList().removeAll(); } num=hiddenColumnList()->count(); for (i=0;iarray(i); if (column!=0) column->groupList().removeAll(); } columnGroupList().removeAll(); MSTableGroupIterator groupIterator(columnGroupList()); group.allNodesDo(groupIterator); MSWidgetVector vector; MSTableColumnIterator columnIterator(vector,columnGroupList()); group.allNodesDo(columnIterator); permuteColumns(vector); } else { MSMessageLog::warningMessage("Warning: MSTable - MSTableColumnGroup contains stale pointer to column"); } } MSBoolean MSTable::sanityCheck(const MSTableColumnGroup &group_) const { MSBoolean sanity=MSTrue; MSTable *t=(MSTable *)this; MSWidgetVector vector=t->children(); MSTableSanityCheck check(vector,sanity); group_.allNodesDo(check); return sanity; } void MSTable::permuteColumns(const MSWidgetVector& aWidgetVector_) { MSBoolean wasFrozen=frozen(); if (editor()->mapped()==MSTrue) unmapEditor(); if (wasFrozen==MSFalse) freeze(); MSReportTable::permuteColumns(aWidgetVector_); if (wasFrozen==MSFalse) adjustView(); updateInternalState(); if (wasFrozen==MSFalse) unfreeze(); } void MSTable::drawGroupHeading(Window window_,MSTableColumnGroup *group_,int cs_,int ce_,int level_) { int x=computeXCoord(cs_); int y=panner()->highlightThickness()+panner()->shadowThickness(); for (int i=1;i<=level_;i++) y+=groupHeadingsHeightVector()(i-1); int w=computeXCoord(ce_)-x+columnPixelWidth(ce_); int h=groupHeadingsHeightVector()(level_); MSRect rect(x,y,w,h); drawGroupHeading(window_,group_,rect); drawHSeparator(window_,x,y+h-rowSpacing(),w,rowSpacing()); if (level_==groupHeadingsHeightVector().length()-1) h+=(columnHeadingsHeight()-rowSpacing()); drawVSeparator(window_,x+w-rowSpacing(),y,rowSpacing(),h); } void MSTable::drawGroupHeadings(Window window_,int cs_,int ce_) { if (groupHeadingsHeight()>0) { int x,y,w,h; x=computeXCoord(cs_); y=panner()->highlightThickness()+panner()->shadowThickness(); w=computeXCoord(ce_)-x+columnPixelWidth(ce_); h=groupHeadingsHeight(); XFillRectangle(display(),window_,backgroundShadowGC(),x,y,w,h); unsigned len=groupHeadingsHeightVector().length(); unsigned lastRow=groupHeadingsHeightVector().length()-1; for (unsigned i=0;i0) { int groupStart=cs_; if (i>0) y+=groupHeadingsHeightVector()(i-1); h=groupHeadingsHeightVector()(i); for (int col=cs_;col<=ce_;col++) { ColumnGroupList &columnGroupList=tableColumn(col)->groupList(); if (columnGroupList.length()>i) { MSTableColumnGroup *group=columnGroupList[i]; //if it's the last column, draw it if (col==ce_) { //Draw it drawGroupHeading(window_,group,groupStart,col,i); groupStart=col+1; } else { ColumnGroupList &nextColumnGroupList=tableColumn(col+1)->groupList(); if (nextColumnGroupList.length()>i) { MSTableColumnGroup *nextGroup=nextColumnGroupList[i]; if (group!=nextGroup) { //Draw it drawGroupHeading(window_,group,groupStart,col,i); groupStart=col+1; } } else { //Draw it drawGroupHeading(window_,group,groupStart,col,i); groupStart=col+1; } } } else { //draw separator x=computeXCoord(col); w=columnPixelWidth(col); int sepH=h; if (i==lastRow) sepH+=(columnHeadingsHeight()-rowSpacing()); drawVSeparator(window_,x+w-rowSpacing(),y,rowSpacing(),sepH); groupStart=col+1; } } } } } } void MSTable::drawGroupHeading(Window window_,MSTableColumnGroup *group_,MSRect &aRect_) { int len=group_->heading().length(); if (len>0) { MSFontObject fs(server()->fontStruct(group_->font())); XSetForeground(display(),textGC(),group_->foreground()); XSetBackground(display(),textGC(),panner()->background()); XSetFont(display(),textGC(),group_->font()); int totalHeight=fs.textHeight()*len; int ydelta=(aRect_.height()-totalHeight)/2; int y=aRect_.y()+ydelta; int cw=aRect_.width(); for (unsigned i=0;iheading()(i); int nc=aString.length(); int tw=0; const char *pString=aString.string(); tw=fs.textWidth(pString,nc); int xdelta; if (nc>0) { if (tw>cw) { nc=computeMaxTextLength(fs.fontStruct(),pString,cw,nc); xdelta=0; } else { xdelta=(cw>tw)?(cw-tw)>>1:0; } XDrawImageString(display(),window_,textGC(),fs.fontStruct(), aRect_.x()+xdelta,y+fs.textAscent(),pString,nc); } y+=fs.textHeight(); } } } int MSTable::computeXCoord(int column_) { return MSArrayView::computeXCoord(column_); } int MSTable::computeXCoord(MSTableColumn *column_) { //This method compute the X coordinate of the upper left corner of the specified column int xr=panner()->highlightThickness()+panner()->shadowThickness()+labelWidth(); unsigned fc=fixedColumns(); unsigned i; for (i=0;icolumnPixelWidth(); else return xr; } unsigned nCols=numColumns(); for (i=firstColumn();icolumnPixelWidth(); else return xr; } return xr; } int MSTable::columnHeadingsOffset(void) { return panner()->highlightThickness()+panner()->shadowThickness()+groupHeadingsHeight(); } void MSTable::redrawHeadings(Window window_,int cs_,int ce_) { if (mapped()==MSTrue&&frozen()==MSFalse&&headingsHeight()>0) { if (groupHeadingsHeight()>0) drawHeadings(window_); else { drawColumnHeadings(window_,cs_,ce_); drawGroupHeadings(window_); } } } void MSTable::drawHSeparator(Window window_,int x_,int y_,int width_,int height_) { if (height_>1) { int halfHeight=height_/2; XBFillRectangle(display(),window_,bottomShadowGC(),x_,y_,width_,halfHeight); XFillRectangle(display(),window_,topShadowGC(),x_,y_+halfHeight,width_,halfHeight); } } void MSTable::drawVSeparator(Window window_,int x_,int y_,int width_,int height_) { if (width_>1) { int halfWidth=width_/2; XBFillRectangle(display(),window_,bottomShadowGC(),x_,y_,halfWidth,height_); XFillRectangle(display(),window_,topShadowGC(),x_+halfWidth,y_,halfWidth,height_); } } MSTableColumnGroup MSTable::columnGroups(void) const { unsigned nCols=numColumns(); MSTableColumnGroup group((MSTable *)this); for (unsigned i=0;i_groupList; MSTableColumnGroup *g=&group; unsigned len=groupList.length(); unsigned j=0; for (j=0;jisEmpty()==MSFalse&& g->nodeList().lastElement().type()==MSTableColumnGroup::Node::Group) { if (g->nodeList().lastElement().group()->shallowCompare(*groupList(j))==MSTrue) { g=g->nodeList().lastElement().group(); } else break; } else break; } for (;jnodeList().lastElement().group(); } *g< &group=columnGroupList()[i]; if (group->tag()==groupTag_) return group->foreground(); } return server()->defaultForeground(); } void MSTable::groupForeground(const MSSymbol &groupTag_,const char *foreground_) { groupForeground(groupTag_,server()->pixel(foreground_)); } void MSTable::groupForeground(const MSSymbol &groupTag_,unsigned long foreground_) { unsigned len=columnGroupList().length(); for (unsigned i=0;i &group=columnGroupList()[i]; if (group->tag()==groupTag_) { if (group->foreground()!=foreground_) { group->foreground(foreground_); drawGroupHeadings(redrawPixmap()->pixmap()); int x=panner()->shadowThickness()+panner()->highlightThickness(); int y=x; int w=computeXCoord(lastColumn())+columnPixelWidth(lastColumn())-x; int h=groupHeadingsHeight(); XCopyArea(display(),redrawPixmap()->pixmap(),panner()->window(),backgroundShadowGC(), x,y,w,h,x,y); } return; } } } Font MSTable::groupFont(const MSSymbol &groupTag_) const { unsigned len=columnGroupList().length(); for (unsigned i=0;i &group=columnGroupList()[i]; if (group->tag()==groupTag_) return group->font(); } return server()->defaultFont(); } void MSTable::groupFont(const MSSymbol &groupTag_,const char *font_) { groupFont(groupTag_,server()->fontID(font_)); } void MSTable::groupFont(const MSSymbol &groupTag_,Font font_) { unsigned len=columnGroupList().length(); for (unsigned i=0;i &group=columnGroupList()[i]; if (group->tag()==groupTag_) { if (group->font()!=font_) { group->font(font_); calculateHeadingsHeight(); adjustNumVisible(); redrawImmediately(); } return; } } } const MSStringVector &MSTable::groupHeading(const MSSymbol &groupTag_) const { static MSStringVector emptyVector; unsigned len=columnGroupList().length(); for (unsigned i=0;i &group=columnGroupList()[i]; if (group->tag()==groupTag_) return group->heading(); } return emptyVector; } void MSTable::groupHeading(const MSSymbol &groupTag_,const MSStringVector &heading_) { unsigned len=columnGroupList().length(); for (unsigned i=0;i &group=columnGroupList()[i]; if (group->tag()==groupTag_) { if (group->heading()!=heading_) { group->heading(heading_); calculateHeadingsHeight(); adjustNumVisible(); redrawImmediately(); } return; } } } MSWidgetVector MSTable::columnsOfGroup(const MSSymbol &groupTag_) { MSWidgetVector columns; unsigned i,num=columnList()->count(); for (i=0;iarray(i); if (column!=0) { ColumnGroupList &list=column->groupList(); unsigned len=list.length(); for (unsigned j=0;j &group=list[j]; if (group->tag()==groupTag_) { columns<<(MSWidget *)column; break; } } } } num=hiddenColumnList()->count(); for (i=0;iarray(i); if (column!=0) { ColumnGroupList &list=column->groupList(); unsigned len=list.length(); for (unsigned j=0;j &group=list[j]; if (group->tag()==groupTag_) { columns<<(MSWidget *)column; break; } } } } return columns; } void MSTable::dragRow(const XEvent *pEvent_) { if (showBreaks()==MSFalse) { MSArrayView::dragRow(pEvent_); } else server()->bell(); } void MSTable::moveRow(int from_,int to_) { unsigned i,n=numColumns(); for (i=0;imoveRow(from_,to_); } n=hiddenColumnList()->count(); for (i=0;iarray(i))->moveRow(from_,to_); } } void MSTable::choiceStyle(ChoiceStyle choiceStyle_) { if (_choiceStyle!=choiceStyle_) { _choiceStyle=choiceStyle_; updateChoices(); redrawImmediately(); } } MSTable::ChoiceStyle MSTable::choiceStyle(void) const { return _choiceStyle; } void MSTable::showOptions(int row_,int column_) { const MSTableColumn *pTableColumn=tableColumn(column_); if (pTableColumn!=0) { if (row_0) { if (_choicesMenu==0) { _choicesMenu=new ColumnPopupMenu(this); // Should call calculateNaturalSize() here, but it is protected } _choicesMenu->choices(options); _choicesMenu->background(pTableColumn->background()); _choicesMenu->foreground(pTableColumn->foreground()); _choicesMenu->font(pTableColumn->font()); int selectedItem; MSString buffer; formatOutput(buffer,row_,column_); if ((selectedItem=options.indexOf(buffer))==options.length()) selectedItem=0; int rootx,rooty; cellRootXY(row_,column_,rootx,rooty); rooty-=2; MSMenuItem *item=_choicesMenu->taggedMenuItem(selectedItem); if (item!=0) { rooty-=item->y(); } _choicesMenu->moveTo(rootx,rooty); _choicesMenu->show(); if (item!=0) { int movex=item->x()+item->width()/2; int movey=item->y()+item->height()/2; XWarpPointer(display(),None,_choicesMenu->window(),0,0,0,0,movex,movey); // Send a synthetic event to the choice menu XMotionEvent motionEvent; motionEvent.display=display(); motionEvent.window=_choicesMenu->window(); motionEvent.root=server()->root(); motionEvent.state=Button1Mask; motionEvent.x=movex; motionEvent.y=movey; motionEvent.x_root=rootx+movex; motionEvent.y_root=rooty+movey; buttonMotionNotify(_choicesMenu,(const XEvent *)&motionEvent); } } } } } void MSTable::cellRootXY(int row_,int column_,int &rootx_,int &rooty_) { panner()->rootXY(rootx_,rooty_); rootx_+=computeXCoord(column_); rooty_+=computeYCoord(row_); } void MSTable::updateChoices(void) { if(firstMap()==MSTrue&&frozen()==MSFalse) { int rh=rowHeight(); calculateRowHeight(); if(rowHeight()!=rh) { adjustNumVisible(); redrawImmediately(); } } } aplus-fsf-4.22/src/MSGUI/MSTableColumn.C0000644000265000001440000006141210772770414013257 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include static const unsigned MSTableColumnDefaultColumnWidth=9; static const unsigned MSTableColumnDefaultEditWidth=256; #ifdef MS_NO_INLINES #include #endif MSTableColumn::MSTableColumn(MSReportTable *owner_,const char *heading_,const MSSymbol& tag_) : _reportTable(owner_),_heading(heading_),_tag(tag_),MSWidgetView(owner_->displayServer()) { init(); } MSTableColumn::MSTableColumn(MSReportTable *owner_,const MSStringVector& heading_,const MSSymbol& tag_) : _reportTable(owner_),_heading(heading_),_tag(tag_),MSWidgetView(owner_->displayServer()) { init(); } void MSTableColumn::init(void) { _style=0; _breakStyle=reportTable()->breakStyle(); _headingStyle=reportTable()->headingStyle(); _breakOffset=reportTable()->breakOffset(); _breakLeading=reportTable()->breakLeading(); _fgGrayScale=reportTable()->fgGrayScale(); _bgGrayScale=reportTable()->bgGrayScale(); _breakFgGrayScale=reportTable()->fgGrayScale(); _breakBgGrayScale=reportTable()->bgGrayScale(); _headingFgGrayScale=reportTable()->headingFgGrayScale(); _headingBgGrayScale=reportTable()->headingBgGrayScale(); _headingForeground=0; _suppressDuplicate=MSFalse; _breakOn=MSFalse; _pageBreakOn=MSFalse; _breakProcessOn=MSTrue; _breakProcessMode=MSP::Total; _column=reportTable()->columnList()->count(); _breakFgPixel=ULONG_MAX; _breakBgPixel=ULONG_MAX; _valueQuoted=MSTrue; _owner=table(); if (owner()!=0) { _bg=owner()->background(); _fg=owner()->foreground(); _fontID=owner()->font(); } sensitive(MSTrue); _resizable=MSTrue; _columnWidth=MSTableColumnDefaultColumnWidth; _columnAlignment=MSRight; _clipMode=MSNoClipping; _editWidth=MSTableColumnDefaultEditWidth; _cycleMode=MSForeground; headingForeground(reportTable()->headingForeground()); if (table()!=0) { _headingFont=table()->headingFont(); _headingAlignment=table()->headingAlignment(); fontStruct((XFontStruct *)server()->fontStruct(font())); if (font()!=headingFont()) headingFontStruct((XFontStruct *)server()->fontStruct(headingFont())); else headingFontStruct((XFontStruct *)fontStruct()); createGCs(); childCreateNotify(); } else reportTable()->addColumn(this); } MSTableColumn::~MSTableColumn(void) { for (unsigned i=0;ifontID(fid_)); } void MSTableColumn::headingFont(Font fid_) { if (headingFont()!=fid_) { _headingFont=fid_; updateHeading(); } } void MSTableColumn::headingAlignment(unsigned long alignment_) { if (headingAlignment()!=alignment_) { _headingAlignment=alignment_; if (table()!=0) table()->updateColumnHeadings(); } } // this does not seem to work properly when it is inlined // looks like this is a compiler bug - ???? MSTable *MSTableColumn::table(void) const { return reportTable()->displayServer()==0?0:(MSTable *)reportTable(); } // default methods that should be overriden by subclasses MSBoolean MSTableColumn::validate(const char *,unsigned) { return MSFalse; } MSBoolean MSTableColumn::isValid(unsigned) { return sensitive()==MSFalse ? MSFalse : table()->sensitive(); } //"isProtected(row)" is only kept for Backward compatibility //It's use is now deprecated in favor of isCellProtected MSBoolean MSTableColumn::isCellProtected(unsigned r_) { return isProtected(r_); } MSBoolean MSTableColumn::isProtected(unsigned) { return MSWidgetView::isProtected(); } MSBoolean MSTableColumn::isProtected(void) const { return MSWidgetView::isProtected(); } unsigned long MSTableColumn::cellForeground(unsigned row_) { if (table()!=0) { if (table()->foregroundColors().length()==0) return foreground(); else return table()->foregroundColors()(row_%table()->foregroundColors().length()); } else return foreground(); } unsigned long MSTableColumn::cellBackground(unsigned row_) { if (table()!=0) { if (table()->backgroundColors().length()==0) return background(); else return table()->backgroundColors()(row_%table()->backgroundColors().length()); } else return background(); } Font MSTableColumn::cellFont(unsigned) { return font(); } MSAlignment MSTableColumn::cellAlignment(unsigned) { return columnAlignment(); } // end of default methods void MSTableColumn::createGCs(void) { if (table()!=0) { XGCValues values; values.foreground=background(); _textMSGC.setGCValues(server(),MSTrue,&values,GCForeground); } } void MSTableColumn::updateSensitivity(void) { MSWidgetView::updateSensitivity(); redraw(); } void MSTableColumn::updateForeground(unsigned long oldfg_) { MSWidget::updateForeground(oldfg_); if (headingForeground()==oldfg_) headingForeground(foreground()); redraw(); } void MSTableColumn::updateBackground(unsigned long oldbg_) { MSWidget::updateBackground(oldbg_); textMSGC().foreground(background()); redraw(); } void MSTableColumn::updateFont(Font oldfid_) { MSWidget::updateFont(oldfid_); if (table()!=0) { MSBoolean wasFrozen=table()->frozen(); table()->freeze(); if (headingFont()==oldfid_) headingFont(font()); fontStruct((XFontStruct *)server()->fontStruct(font())); table()->calculateRowHeight(); table()->adjustNumVisible(); if (wasFrozen==MSFalse) table()->unfreeze(); } } void MSTableColumn::updateData(void) { if (table()!=0) { // Process it if this column is not hidden, otherwise don't do anything if (table()->hiddenColumnList()->find(this)==MSFalse) { if (numRows()>=table()->dataRows()) table()->appendUpdate(); if (hasModel()==MSTrue) table()->columnUpdate(column()); else { table()->updateInternalState(); if (frozen()==MSFalse) table()->clearColumn(column()); } } } else reportTable()->maxRowsSet(numRows()); } void MSTableColumn::redraw(void) { if (table()!=0&&frozen()==MSFalse) table()->drawColumn(column()); } int MSTableColumn::columnPixelWidth(void) { if (table()!=0) { unsigned len=columnWidth(); int cw=(clipMode()==MSNoClipping)?charWidth('W'):charWidth('0'); return (len*cw+2*table()->columnSpacing()); } else return 0; } int MSTableColumn::headingHeight(void) const { return heading().length()*(headingAscent()+headingDescent()); } int MSTableColumn::headingWidth(void) const { unsigned n=heading().length(); int tw=0; for (unsigned i=0;idataRows(); // Process it if this column is not hidden, otherwise don't do anything if (table()->hiddenColumnList()->find(this)==MSFalse) { if (table()->frozen()==MSFalse) { if (aIndexVector_.length()==0) { if (numRows()!=tableRows) { if (numRows()>tableRows) table()->appendUpdate(); table()->columnUpdate(column()); } else table()->cycleColumn(column()); } else { if (numRows()>tableRows) table()->appendUpdate(); for (unsigned i=0;icycleRowColumn(aIndexVector_(i),column()); } } } } } else reportTable()->maxRowsSet(numRows()); } void MSTableColumn::updateHeading(void) { if (table()!=0) { if (table()->firstMap()==MSTrue&&table()->frozen()==MSFalse) { int hh=table()->headingsHeight(); table()->calculateHeadingsHeight(); if (hh!=table()->headingsHeight()) { table()->adjustNumVisible(); table()->redraw(); } else table()->updateColumnHeadings(); } } } void MSTableColumn::updateHeadingForeground(void) { if (table()!=0) table()->updateColumnHeadings(); } void MSTableColumn::columnWidth(unsigned cw_) { if (columnWidth()!=cw_) { _columnWidth=cw_; if (table()!=0) { table()->adjustNumVisible(); table()->redraw(); } activateCallback(MSWidgetCallback::columnresize); } } void MSTableColumn::clipMode(MSClipMode clipMode_) { if (clipMode()!=clipMode_ && clipMode_!=MSClipIndicator) { _clipMode=clipMode_; redraw(); } } void MSTableColumn::columnAlignment(MSAlignment alignment_) { if (columnAlignment()!=alignment_) { _columnAlignment=alignment_; redraw(); } } void MSTableColumn::editWidth(unsigned ew_) { _editWidth=ew_; } void MSTableColumn::resizable(MSBoolean resizable_) { _resizable=resizable_; } void MSTableColumn::cycleColorMode(MSCycleColorMode cycleMode_) { _cycleMode=cycleMode_; } void MSTableColumn::fontStruct(XFontStruct *fs_) { _fontStruct=fs_; } void MSTableColumn::headingFontStruct(XFontStruct *fs_) { _headingFontStruct=fs_; } int MSTableColumn::textWidth(const char *pString_) const { if (_fontStruct->max_char_or_byte2>255) { return (pString_!=0)? XTextWidth16((XFontStruct *)_fontStruct,(XChar2b *)pString_,strlen(pString_)/2):0; } else { return (pString_!=0)? XTextWidth((XFontStruct *)_fontStruct,(char *)pString_,strlen(pString_)):0; } } int MSTableColumn::textWidth(const char *pString_,unsigned len_) const { if (_fontStruct->max_char_or_byte2>255) { return (pString_!=0)? XTextWidth16((XFontStruct *)_fontStruct,(XChar2b *)pString_,len_/2):0; } else { return (pString_!=0)?XTextWidth((XFontStruct *)_fontStruct,(char *)pString_,len_):0; } } const XCharStruct *MSTableColumn::charStruct(char aChar_) const { return &(_fontStruct->per_char[aChar_-_fontStruct->min_char_or_byte2]); } inline const XCharStruct *MSTableColumn::headingCharStruct(char aChar_) const { return &(_headingFontStruct->per_char[aChar_-_headingFontStruct->min_char_or_byte2]); } int MSTableColumn::charWidth(char aChar_) const { int r=charWidth(); if (_fontStruct->per_char!=0&& aChar_>=_fontStruct->min_char_or_byte2&&aChar_<=_fontStruct->max_char_or_byte2) { r=charStruct(aChar_)->width; } return r; } int MSTableColumn::headingCharWidth(char aChar_) const { int r=headingCharWidth(); if (headingFontStruct()->per_char!=0&& aChar_>=headingFontStruct()->min_char_or_byte2&& aChar_<=headingFontStruct()->max_char_or_byte2) { r=headingCharStruct(aChar_)->width; } return r; } void MSTableColumn::choices(const MSStringVector& choices_) { _choices=choices_; if(table()!=0) table()->updateChoices(); } void MSTableColumn::cycleColors(const MSUnsignedLongVector& colors_) { _cycleColors=colors_; } void MSTableColumn::cycleColors(const MSStringVector& colors_) { MSUnsignedLongVector cols(colors_.length()); for (int i=0;ipixel(colors_(i))); cycleColors(cols); } void MSTableColumn::decoupleWidget(void) { decouple(); } // ######################################################### // default virtual methods - prevents gratuitous inlining // ######################################################### void MSTableColumn::map(void) {} void MSTableColumn::unmap(void) {} void MSTableColumn::increment(int) {} void MSTableColumn::decrement(int) {} void MSTableColumn::set(MSAttrValueList& avList_) { MSWidget::set(avList_); MSIndexVector index; for (unsigned i=0;icolorName(headingForeground()),MSAttrValue::Color); avList_<fontName(headingFont()),MSAttrValue::Font); MSStringVector alignmentVector("MSNone\nMSCenter\nMSTop\nMSBottom\nMSLeft\nMSRight"); avList_<colorName(breakBgPixel()),MSAttrValue::Color); avList_<colorName(breakFgPixel()),MSAttrValue::Color); // avList_<fontName(breakFont()),MSAttrValue::Font); avList_<tag()) printText=breakText(i); if (printText!=0) { delete printText; _breakTextList.remove(printText); } } MSParagraph& MSTableColumn::addBreakText(const MSParagraph& printText_) { MSParagraph *printText=new MSParagraph(printText_); _breakTextList.add(printText); return *printText; } MSParagraph& MSTableColumn::addBreakText(const MSStringVector& printText_) { return addBreakText(MSParagraph(printText_));} MSParagraph& MSTableColumn::addBreakText(const char *printText_) { return addBreakText(MSParagraph(printText_));} const MSParagraph& MSTableColumn::breakText(const MSSymbol& tag_) const { for (unsigned i=0;itag()) return *breakText(i); MSMessageLog::warningMessage("Warning: breakText \"%s\" not fount\n",tag_.symbolName()); return defaultText(); } MSParagraph& MSTableColumn::breakText(const MSSymbol& tag_) { for (unsigned i=0;itag()) return *breakText(i); MSMessageLog::warningMessage("Warning: breakText \"%s\" not fount\n",tag_.symbolName()); return defaultText(); } void MSTableColumn::heading(const MSStringVector& heading_) { if (heading()!=heading_) { _heading=heading_; updateHeading(); } } void MSTableColumn::headingForeground(const char *fg_) { headingForeground(reportTable()->convertForeground(fg_)); } void MSTableColumn::headingForeground(unsigned long fg_) { if (headingForeground()!=fg_) { _headingForeground=fg_; updateHeadingForeground(); } } const MSString& MSTableColumn::reportFont(void) const { return _reportFont.length()!=0?(const MSString&)_reportFont:reportTable()->reportFont();} const MSString& MSTableColumn::breakFont(void) const { return _breakFont.length()!=0?(const MSString&)_breakFont:reportTable()->breakFont();} const MSString& MSTableColumn::reportHeadingFont(void) const { return _reportHeadingFont.length()!=0?(const MSString&)_reportHeadingFont:reportTable()->reportHeadingFont(); } void MSTableColumn::breakFg(const char *color_) { _breakFgString=color_; if (reportTable()->displayServer()!=0) { _breakFgPixel=reportTable()->displayServer()->pixel(color_); reportTable()->updateScreen(); } } void MSTableColumn::breakBg(const char *color_) { _breakBgString=color_; if (reportTable()->displayServer()!=0) { _breakBgPixel=reportTable()->displayServer()->pixel(color_); reportTable()->updateScreen(); } } const char *MSTableColumn::formatOutput(MSString &buffer_,unsigned) {return buffer_.string();} const char *MSTableColumn::formatBreak(MSString &buffer_,unsigned,unsigned) {return buffer_.string();} unsigned MSTableColumn::numRows(void) const {return 0;} MSBoolean MSTableColumn::breakCriteria(unsigned) {return MSFalse;} MSBoolean MSTableColumn::isDuplicate(unsigned) {return MSFalse;} unsigned long MSTableColumn::style(unsigned) {return style();} unsigned long MSTableColumn::breakStyle(unsigned) {return breakStyle();} int MSTableColumn::breakOffset(unsigned) {return _breakOffset;} int MSTableColumn::breakLeading(unsigned) {return _breakLeading;} const char *MSTableColumn::reportFont(unsigned) {return reportFont();} const char *MSTableColumn::breakFont(unsigned) {return breakFont();} double MSTableColumn::fgGrayScale(unsigned) {return fgGrayScale();} double MSTableColumn::bgGrayScale(unsigned) {return bgGrayScale();} double MSTableColumn::breakFgGrayScale(unsigned) {return breakFgGrayScale();} double MSTableColumn::breakBgGrayScale(unsigned) {return breakBgGrayScale();} const char *MSTableColumn::breakFgString(unsigned) {return breakFgString();} const char *MSTableColumn::breakBgString(unsigned) {return breakBgString();} unsigned long MSTableColumn::breakFgPixel(unsigned) {return breakFgPixel();} unsigned long MSTableColumn::breakBgPixel(unsigned) {return breakBgPixel();} unsigned long MSTableColumn::headingStyle(void) const {return _headingStyle!=0?_headingStyle:reportTable()->headingStyle();} unsigned long MSTableColumn::style(void) const { unsigned long aStyle=_style!=0?_style:reportTable()->style(); if ((aStyle&(MSLeft|MSRight|MSCenter))==0) { aStyle|=columnAlignment(); } return aStyle; } unsigned long MSTableColumn::breakStyle(void) const { return _breakStyle!=0?_breakStyle:reportTable()->breakStyle(); } double MSTableColumn::computeColumnFunction(void) {return 0;} void MSTableColumn::breakProcess(MSIndexVector&) {} MSIndexVector MSTableColumn::gradeUp(void) const { return MSIndexVector::nullVector(); } MSIndexVector MSTableColumn::gradeDown(void) const { return MSIndexVector::nullVector(); } void MSTableColumn::permute(const MSIndexVector &) {} void MSTableColumn::range(MSIndexVector &start_,MSIndexVector &end_) { start_.removeAll(); end_.removeAll(); } MSIndexVector MSTableColumn::rangeGradeUp(const MSIndexVector &,const MSIndexVector &) { return MSIndexVector::nullVector(); } MSIndexVector MSTableColumn::rangeGradeDown(const MSIndexVector &,const MSIndexVector &) { return MSIndexVector::nullVector(); } MSSymbolVector MSTableColumn::groups(void) const { MSSymbolVector symbols; unsigned len=groupList().length(); for (unsigned i=0;i &group=groupList()[i]; symbols<tag(); } return symbols; } MSBoolean MSTableColumn::hasOptions(void) { return choices().length()>0 ? MSTrue : MSFalse; } const MSStringVector& MSTableColumn::cellChoices(unsigned) { return choices(); } void MSTableColumn::moveRow(int, int) {} aplus-fsf-4.22/src/MSGUI/MSTableColumnGroup.C0000644000265000001440000002460310772770414014275 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #if HAVE_IOSTREAM #include #else #include #endif #if defined(MSTK_MANUAL_INSTANTIATION) #include #include #if defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma instantiate MSGenericVector #pragma instantiate MSGenericVector #pragma instantiate MSGenericVector > #endif #if defined(MS_XLC_TEMPLATE_INSTANTIATION) #pragma define(MSGenericVector) #pragma define(MSGenericVector) #pragma define(MSGenericVector >) #endif #if defined(MS_STD_TEMPLATE_INSTANTIATION) template class MSGenericVector; template class MSGenericVector; template class MSGenericVector >; #endif #if defined(MS_VC_TEMPLATE_INSTANTIATION) template MSGenericVector; template MSGenericVector; template MSGenericVector >; #endif #endif //MSTK_MANUAL_INSTANTIATION ostream &operator<<(ostream &os_,MSManagedPointer const &group_) { os_<<*group_; return os_; } ostream &operator<<(ostream &os_,MSTableColumnGroup::Node &node_) { if (node_.type()==MSTableColumnGroup::Node::Column) os_<<"Column Name: "<heading()<font(); _foreground=table()->foreground(); } } MSTableColumnGroup::MSTableColumnGroup(const MSTableColumnGroup &tableColumnGroup_) :_table(tableColumnGroup_._table), _tag(tableColumnGroup_._tag), _heading(tableColumnGroup_._heading), _font(tableColumnGroup_._font), _foreground(tableColumnGroup_._foreground), _nodeList(tableColumnGroup_._nodeList) {} MSTableColumnGroup::~MSTableColumnGroup(void) {} MSTableColumnGroup &MSTableColumnGroup::operator=(const MSTableColumnGroup &tableColumnGroup_) { if (&tableColumnGroup_!=this) { return deepCopy(tableColumnGroup_); } return *this; } MSTableColumnGroup &MSTableColumnGroup::operator<<(MSTableColumn *tableColumn_) { if (isOkToAdd(tableColumn_)==MSTrue) _nodeList<table()==table()) { unsigned len=nodeList().length(); for (unsigned i=0;iisOkToAdd(column_)==MSFalse) return MSFalse; } } return MSTrue; } else { MSMessageLog::warningMessage("Warning: MSTableColumnGroup - Try to append column from a different table, append fails"); return MSFalse; } } else { MSMessageLog::warningMessage("Warning: MSTableColumnGroup - Null column pointer, append fails"); return MSFalse; } } void MSTableColumnGroup::tag(const MSSymbol &tag_) { _tag=tag_; } void MSTableColumnGroup::heading(const MSStringVector &heading_) { _heading=heading_;} void MSTableColumnGroup::font(Font font_) { _font=font_; } void MSTableColumnGroup::font(const char *font_) { if (table()!=0) { font(table()->server()->fontID(font_)); } } void MSTableColumnGroup::foreground(unsigned long foreground_) { _foreground=foreground_; } void MSTableColumnGroup::foreground(const char *foreground_) { if (table()!=0) { foreground(table()->server()->pixel(foreground_)); } } MSTableColumnGroup &MSTableColumnGroup::deepCopy(const MSTableColumnGroup &tableColumnGroup_) { if (&tableColumnGroup_!=this) { _table=tableColumnGroup_._table; _tag=tableColumnGroup_._tag; _heading=tableColumnGroup_._heading; _font=tableColumnGroup_._font; _foreground=tableColumnGroup_._foreground; _nodeList=tableColumnGroup_._nodeList; } return *this; } MSTableColumnGroup &MSTableColumnGroup::shallowCopy(const MSTableColumnGroup &tableColumnGroup_) { if (&tableColumnGroup_!=this&&table()==tableColumnGroup_._table) { _tag=tableColumnGroup_.tag(); _heading=tableColumnGroup_.heading(); _font=tableColumnGroup_.font(); _foreground=tableColumnGroup_.foreground(); } return *this; } void MSTableColumnGroup::allNodesDo(Iterator &iterator_) { ColumnGroupList groupList; depthFirstNodeIteration(iterator_,groupList); } MSBoolean MSTableColumnGroup::depthFirstNodeIteration(Iterator &iterator_, ColumnGroupList &groupList_) { groupList_.append(this); unsigned len=nodeList().length(); for (unsigned i=0;idepthFirstNodeIteration(iterator_,groupList_)==MSFalse) return MSFalse; } } MSBoolean ret=iterator_.applyTo(*this,groupList_); groupList_.removeAt(groupList_.length()-1); return ret; } void MSTableColumnGroup::allNodesDo(ConstIterator &iterator_) const { ColumnGroupList groupList; depthFirstNodeIteration(iterator_,groupList); } MSBoolean MSTableColumnGroup::depthFirstNodeIteration(ConstIterator &iterator_, ColumnGroupList &groupList_) const { groupList_<depthFirstNodeIteration(iterator_,groupList_)==MSFalse) return MSFalse; } } MSBoolean ret=iterator_.applyTo(*this,groupList_); groupList_.removeAt(groupList_.length()-1); return ret; } MSBoolean MSTableColumnGroup::shallowCompare(const MSTableColumnGroup &group_) const { if (&group_!=this) { if ((_table==group_._table)&& (_tag==group_._tag)&& (_heading==group_._heading)&& (_font==group_._font)&& (_foreground==group_._foreground)) { return MSTrue; } else return MSFalse; } return MSTrue; } MSBoolean MSTableColumnGroup::deepCompare(const MSTableColumnGroup &group_) const { if (&group_!=this) { if ((_table==group_._table)&& (_tag==group_._tag)&& (_heading==group_._heading)&& (_font==group_._font)&& (_foreground==group_._foreground)&& (_nodeList==group_._nodeList)) { return MSTrue; } else return MSFalse; } return MSTrue; } MSBoolean operator==(const MSTableColumnGroup &group1_,const MSTableColumnGroup &group2_) { return group1_.deepCompare(group2_); } void MSTableColumnGroup::print(ostream &os_,unsigned level_) const { unsigned i; for (i=0;iprint(os_,level_+1); else if (node.type()==Node::Column) { for (i=0;i<=level_;i++) os_<<'\t'; os_<heading(); } } } aplus-fsf-4.22/src/MSGUI/MSTermEntryField.C0000644000265000001440000001004110772770414013737 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include MSTermEntryField::MSTermEntryField(MSWidget *owner_, const char *label_,const MSSymbol& tag_) : MSEntryFieldPlus(owner_,label_,tag_) { internalCouple(new MSTerm()); init(); } MSTermEntryField::MSTermEntryField(MSWidget *owner_,MSTerm& model_, const char *label_,const MSSymbol& tag_) : MSEntryFieldPlus(owner_,label_,tag_) { model(model_); init(); } MSTermEntryField::~MSTermEntryField(void) {} void MSTermEntryField::init(void) { _format=MSFormat(MSTerm::YearMonthDayPad); _incrementValue=MSTerm(0,0,1); } void MSTermEntryField::model(MSTerm& model_) { couple(&model_); } void MSTermEntryField::model(const MSTerm& model_) { constCouple(&model_); } void MSTermEntryField::updateData(void) { if (MSView::model()==0) internalCouple(new MSTerm()); MSEntryFieldPlus::updateData(); } MSBoolean MSTermEntryField::validate(const char *pString_) { if (MSView::model()!=0) { MSTerm aTerm; if (aTerm.set(pString_)==MSError::MSSuccess) { if (minimumValue().isSet()==MSTrue&&maximumValue().isSet()==MSTrue) { if (aTerm>=minimumValue()&&aTerm<=maximumValue()) { value()=aTerm; return MSTrue; } } else if (minimumValue().isSet()==MSTrue) { if (aTerm>=minimumValue()) { value()=aTerm; return MSTrue; } } else if (maximumValue().isSet()==MSTrue) { if (aTerm<=maximumValue()) { value()=aTerm; return MSTrue; } } else { value()=aTerm; return MSTrue; } } } return MSFalse; } const char *MSTermEntryField::formatOutput(MSString &buffer_) { if (MSView::model()!=0) value().format(buffer_,format()); return buffer_.string(); } void MSTermEntryField::increment(void) { if (MSView::model()!=0) { if (maximumValue().isSet()==MSTrue) { MSTerm aTerm=value(); aTerm+=incrementValue(); if (aTerm<=maximumValue()) { value()=aTerm; valueChange(); } } else { value()+=incrementValue(); valueChange(); } } } void MSTermEntryField::generateInputMask(void) { MSString mask; switch(format().termFormat()) { case MSTerm::YearsMonthsDaysPad: mask = "--y---m---d"; break; default: mask =""; break; } if(inputMaskCharacter()!='-' && mask != "") mask.change('-', inputMaskCharacter()); fieldEditor()->inputMask(mask); } void MSTermEntryField::set(MSAttrValueList& avList_) { MSEntryFieldPlus::set(avList_); MSIndexVector index; for (unsigned i=0;i #if HAVE_NEW #include #else #include #endif #include #include #include #include #include #include #include static MSBoolean debug=MSFalse; typedef void (MSText::*PMFV)(void); typedef struct { char *_str; PMFV _func; } TextKeys; typedef MSKeyClassCallback KT; static TextKeys KeyTable[]= { {"Escape", &MSText::escape}, {"Return", &MSText::returnKey}, {"BackSpace", &MSText::backspace}, {"Delete", &MSText::backspace}, {"Up", &MSText::up}, {"Down", &MSText::down}, {"Right", &MSText::forwardChar}, {"Left", &MSText::backwardChar}, {"Ctrla", &MSText::startOfLine}, {"Ctrle", &MSText::endOfLine}, {"Ctrlk", &MSText::kill}, {"Ctrld", &MSText::deleteChar}, {"Ctrlf", &MSText::forwardChar}, {"Ctrlb", &MSText::backwardChar}, {"Ctrly", &MSText::yank}, {"Ctrli", &MSText::insertMode}, {"Ctrlp", &MSText::up}, {"Ctrln", &MSText::down }, {"Ctrll", &MSText::refresh}, {"Ctrls", &MSText::save}, {"Tab", &MSText::tab}, {"ShiftTab", &MSText::shiftTab}, {"!F27", &MSText::home}, {"Home", &MSText::home}, {"!R13", &MSText::end}, {"End", &MSText::end}, {"!F29", &MSText::pageUp}, {"Ctrlu", &MSText::pageUp}, {"Prior", &MSText::pageUp}, {"!F35", &MSText::pageDown}, {"Ctrld", &MSText::pageDown}, {"Next", &MSText::pageDown}, {0,0} }; static const char *MSTextTabString=" "; static const char NewLineChar=0x0A; static const int MSTextDefaultHighlightThickness=2; static const int MSTextDefaultShadowThickness=2; static const unsigned long MSTextDefaultBlinkRate=500; static const int DefaultScrollBarSize=15; static const unsigned long MSTextEventMask=(ExposureMask|ButtonPressMask| ButtonReleaseMask|Button1MotionMask); MSText::CursorTimer::CursorTimer(MSText *t_,unsigned long interval_) : MSIntervalTimer(interval_) { _text=t_; } MSText::CursorTimer::~CursorTimer(void) {} void MSText::CursorTimer::process(void) { _text->processCursorTimer(); } MSText::Vsb::Vsb(MSWidget *owner_) : MSVScrollBar(owner_) { inc(1); _highlightThickness=0; acceptFocus(MSFalse); width(DefaultScrollBarSize); } MSText::Vsb::~Vsb(void) {} void MSText::Vsb::change(void) { MSText *p=(MSText *)owner(); p->vsbValueUpdate(); } void MSText::Vsb::drag(void) { change(); } MSText::Panner::Panner(MSWidget *owner_) : MSPrimitive(owner_) { _shadowThickness=2; _highlightThickness=0; shadowStyle(MSSunken); selectInput(ExposureMask); } MSText::Panner::~Panner(void) {} void MSText::Panner::expose(const XEvent *pEvent_) { if (pEvent_->xexpose.count==0) { MSText *p=(MSText *)owner(); XEvent er; while (XCheckWindowEvent(display(),window(),ExposureMask,&er)==True); p->redraw(); } } MSText::MSText(MSWidget *owner_,const char *title_) : MSCompositeText(owner_) { _label=0; _label=new MSLabel(this,title_); init(); } MSText::MSText(MSWidget *owner_,const MSStringVector& title_) : MSCompositeText(owner_) { _label=0; _label=new MSLabel(this,title_); init(); } void MSText::init(void) { _title=label()->label(); _cursorPixmap=0; _imageMSGC=0; _lines=0; _highlightThickness=MSTextDefaultHighlightThickness; _shadowThickness=MSTextDefaultShadowThickness; acceptFocus(MSTrue); acceptTab(MSTrue); shadowStyle(MSEtchedIn); _cursorX=0; _cursorY=0; _firstLine=0; _cursorPosition=0; _cursorOn=MSFalse; _blinkOn=MSFalse; _haveFocus=MSFalse; _vsb=new Vsb(this); _panner=new Panner(this); label()->dynamic(MSTrue); if (label()->columns()>0) label()->map(); if (MSKeyTranslationTable::keyTableData("MSText")==MSFalse) { keyTranslationTable()->addKeyTableData("MSText"); unsigned i=0; KT *entry=0; while (KeyTable[i]._str!=0) { entry = new KT(KeyTable[i]._func ); keyTranslationTable()->addCallback(KeyTable[i]._str,entry,"MSText"); i++; } } else keyTranslationTable()->addKeyTableData("MSText"); _blinkTimer=new CursorTimer(this,MSTextDefaultBlinkRate); _blinkOn=MSTrue; stopBlinking(); _rows=5; _columns=40; _naturalRows=5; _naturalCols=40; _numLines=0; _maxNumLines=0; _maxEditLength=UINT_MAX; _selectionStart=0; _selectionLength=0; _startDrag=-1; _scrollTimer=0; selectInput(MSTextEventMask); freeze(); } MSText::~MSText(void) { if (imageMSGC()!=0) delete _imageMSGC; if (cursorPixmap()!=0) delete _cursorPixmap; if (blinkTimer()!=0) delete _blinkTimer; if (label()!=0) delete _label; if (panner()!=0) delete _panner; if (vsb()!=0) delete _vsb; if (scrollTimer()!=0) delete _scrollTimer; if (lines()!=0) { for (unsigned i=0;iprimarySelectionOwner()==this) server()->primarySelectionOwner(0); } GC MSText::imageGC(void) const { return _imageMSGC->gc(); } void MSText::naturalSize(void) { _rows=naturalRows(); _columns=naturalCols(); computeSize(); } void MSText::computeSize(void) { if (vsb()!=0&&panner()!=0&&label()!=0&&frozen()==MSFalse) { unsigned offset=highlightThickness() + shadowThickness(); unsigned poffset=panner()->highlightThickness()+panner()->shadowThickness(); unsigned w=columns()*charWidth()+2*poffset+vsb()->width(); unsigned h=rows()*textHeight()+2*poffset; if (label()->mapped()==MSTrue) h+=label()->height(); resize(w+2*offset,h+2*offset); } } void MSText::placement(void) { if (vsb()!=0&&panner()!=0&&label()!=0&&frozen()==MSFalse) { unsigned offset=highlightThickness()+shadowThickness(); unsigned pH=height()-2*offset; unsigned pW=width()-2*offset; if (label()->mapped()==MSTrue) pH-=label()->height(); pW-=vsb()->width(); positionLabel(); unsigned y=offset; if (label()->mapped()==MSTrue) y+=label()->height(); panner()->moveTo(offset,y); panner()->resize(pW,pH); vsb()->moveTo(offset+pW,y); vsb()->height(pH); if (vsb()->mapped()==MSFalse) vsb()->map(); if (panner()->mapped()==MSFalse) panner()->map(); } } void MSText::startBlinking(void) { if (isProtected()==MSFalse) { if (blinkOn()==MSFalse&&haveFocus()==MSTrue) { blinkTimer()->reset(); _blinkOn=MSTrue; } } } void MSText::stopBlinking(void) { if (blinkOn()==MSTrue) { blinkTimer()->stop(); _blinkOn=MSFalse; } } void MSText::updateSensitivity(void) { clearCursor(); } void MSText::updateReadOnly(void) { clearCursor(); } void MSText::rows(unsigned rows_) { if (rows()!=rows_) { _rows=rows_; computeSize(); } } void MSText::columns(unsigned cols_) { if (columns()!=cols_) { _columns=cols_; computeSize(); } } unsigned MSText::drawWidth(void) { return panner()->width()-2*(panner()->highlightThickness()+panner()->shadowThickness()); } unsigned MSText::positionToCol(unsigned pos_) { return (pos_start():0; } unsigned MSText::positionToRow(unsigned pos_) { if (pos_<=length()) { for (unsigned i=0;i=line(i)->start()&&pos_<=line(i)->end()) return i; } return 0; } void MSText::positionToRowCol(unsigned pos_,unsigned& row_,unsigned& col_) { unsigned row=0; unsigned col=0; for (unsigned i=0;i=line(i)->start()&&pos_<=line(i)->end()) { row=i; col=pos_-line(i)->start(); break; } } row_=row; col_=col; } unsigned MSText::lastLine(void) { if (numLines()>0) { unsigned result=numLines()-1; Line *pline=line(result); while (result>0&&pline->start()>=length()) pline=line(--result); return result; } return 0; } void MSText::numLines(unsigned n_) { if (numLines()!=n_&&n_>0) { Line **newLines=new Line*[n_]; unsigned i; for (i=0;istart(); unsigned offset=panner()->highlightThickness()+panner()->shadowThickness(); char *str=(char *)string(); int w=panner()->width()-2*offset; int tw; unsigned i,j; unsigned len=length(); unsigned sp,ep; unsigned lineDelta; MSBoolean lineChange=MSFalse; MSBoolean done=MSFalse; for (i=line_;istart(); ep=line(i)->end(); line(i)->start(pos); tw=0; if (posw) { pos--; break; } } line(i)->end(pos++); } else line(i)->end(pos); if (i==line_) { if (insert_==MSFalse) // delete { lineDelta=(line(i)->end()-line(i)->start())-((ep-sp)); if (lineDelta>0) lineChange=MSTrue; else if (lineDelta==0&&tw>w) lineChange=MSTrue; else if (twend()) {if (twdirty(MSTrue); } else if (lineChange==MSTrue) line(i)->dirty(MSTrue); else if (done==MSFalse&&lineChange==MSFalse) { if (ep==line(i)->start()||sp==line(i)->end()) lineChange=MSTrue; else { lineDelta=(line(i)->end()-line(i)->start())-((ep-sp)); if (lineDelta!=0&&twdirty(MSTrue); } } if (lineChange==MSTrue) resetVsb(); lineStatus(); } else MSMessageLog::warningMessage("MSText::resetFromInsert: line out of bounds"); } void MSText::resetLinesFrom(unsigned start_) { if (start_start(); unsigned offset=panner()->highlightThickness()+panner()->shadowThickness(); char *cp=(char *)string(); int w=panner()->width()-2*offset; int tw; unsigned i,j; unsigned len=length(); for (i=start_;istart(pos); line(i)->dirty(MSTrue); tw=0; if (posw) { pos--; break; } } line(i)->end(pos++); } else line(i)->end(pos); } lineStatus(); } else MSMessageLog::warningMessage("MSText::resetLinesFrom: line out of bounds"); } unsigned MSText::computeCursorX(unsigned start_,unsigned x_) { unsigned xoffset=panner()->highlightThickness()+panner()->shadowThickness(); unsigned pos=0; unsigned col=0; if (x_<=xoffset||length()==0) col=0; else { int xpress=x_-xoffset; char *cp=(char *)string(); unsigned sum=0; for (pos=start_;pos>1))start()+cursorX(); } unsigned MSText::lineLength(unsigned row_) { return (row_end()-line(row_)->start())):0; } unsigned MSText::computeX(unsigned row_,unsigned col_) { unsigned xoffset=panner()->highlightThickness()+panner()->shadowThickness(); if (row_start(); char *cp=(char *)string(); int len=lineLength(row_); if (col_shadowThickness()+panner()->highlightThickness()+cursorY()*textHeight(); unsigned xx=computeX(cursorY(),cursorX()); xx-=(cursorPixmap()->width()>>1)-1; XCopyArea(display(),cursorPixmap()->pixmap(),panner()->window(), imageGC(),0,0,cursorPixmap()->width(),cursorPixmap()->height(), xx,yy+textHeight()-cursorPixmap()->height()); } } void MSText::moveCursor(int row_,int col_) { clearCursor(); _cursorY=(row_=maxNumLines()) _cursorY=maxNumLines()-firstLine()-1; _cursorX=col_; _cursorY=(cursorY()start()>length()) _cursorY=lastLine(); if (cursorX()>=lineLength(cursorY())) _cursorX=lineLength(cursorY())-1; _cursorPosition=line(cursorY())->start()+cursorX(); drawCursor(); } unsigned MSText::yToRow(unsigned y_) { int row=0; if (y_==0) row=0; else row=y_/textHeight(); row=(row>=numLines()?numLines()-1:row); return row; } void MSText::clearCursor(void) { if (cursorOn()==MSTrue) drawCursor(); } void MSText::configure(void) { placement(); unsigned offset=panner()->highlightThickness()+panner()->shadowThickness(); int th=panner()->height()-2*offset; int tw=panner()->width()-2*offset; XRectangle clipRect[1]; clipRect[0].x=0; clipRect[0].y=0; clipRect[0].width=tw; clipRect[0].height=th; XSetClipRectangles(display(),textGC(),offset,offset,&clipRect[0],1,Unsorted); _rows=(unsigned)(floor((double)th)/(double)textHeight()); _columns=(unsigned)(floor((double)tw)/(double)charWidth()); _rows=(rows()<=0)?1:rows(); _cursorX=0; _cursorY=0; _cursorPosition=0; numLines(rows()); updateVsb(); redraw(); } void MSText::firstMapNotify(void) { unfreeze(); createGCs(); computeSize(); makeIBeamCursor(); _naturalRows=rows(); _naturalCols=columns(); } void MSText::motionNotify(const XEvent *pEvent_) { if (pEvent_->xmotion.same_screen) { if (pEvent_->xmotion.subwindow==panner()->window()) { if (scrollTimer()!=0) scrollTimer()->stop(); unsigned col,row=yToRow(pEvent_->xmotion.y-panner()->y_origin()); if (rowstart()start(),pEvent_->xmotion.x-panner()->x_origin()); moveCursor(row,col); int lineLen=lineLength(row); int offset=(col>lineLen)?lineLen:col; int end=line(row)->start()+offset; end=(end<0)?0:end; if (endxmotion.y<=panner()->y()) { scrollTimer()->direction(ScrollTimer::Up); scrollTimer()->reset(); } else if (pEvent_->xmotion.y>panner()->y()+panner()->height()) { scrollTimer()->direction(ScrollTimer::Down); scrollTimer()->reset(); } else scrollTimer()->stop(); } } } void MSText::buttonPress(const XEvent *pEvent_) { if (sensitive()==MSTrue) { if (pEvent_->xbutton.subwindow==panner()->window()) { unsigned col=0,row=yToRow(pEvent_->xbutton.y-panner()->y_origin()); if (rowstart()start(),pEvent_->xbutton.x-panner()->x_origin()); } } int lineLen=lineLength(row); int lineCol=(col>lineLen)?lineLen:col; int pos=line(row)->start()+lineCol; if (pEvent_->xbutton.button==Button2) { if (isProtected()==MSFalse&&traverseFocus(this)==MSTrue) { // If I own the selection, then disallow pasting into the highlighted // region if (primaryIsOurs()==MSTrue) { if (pos>selectionStart()&&pos<=selectionEnd()) { server()->bell(); } else { moveCursor(row,col); MSString selected=selectedString(); insertString(selected); if (pos<=selectionStart()) selectRange(selectionStart()+selected.length(),selectionLength()); } } else { moveCursor(row,col); convertSelection(); } } else server()->bell(); } else if (pEvent_->xbutton.button==Button1&&traverseFocus(this)==MSTrue) { moveCursor(row,col); clearSelection(); _selectionStart=pos; _startDrag=selectionStart(); } } } } void MSText::buttonRelease(const XEvent *pEvent_) { if (pEvent_->xbutton.button==Button1) { if (selectionLength()>0) ownSelection(XA_PRIMARY); if (scrollTimer()!=0) scrollTimer()->stop(); _startDrag=-1; } } void MSText::updateCursor(void) { if (firstMap()==MSTrue) { clearCursor(); createGCs(); makeIBeamCursor(); redraw(); } } void MSText::updateBackground(unsigned long oldbg_) { MSCompositeText::updateBackground(oldbg_); panner()->background(background()); vsb()->background(background()); label()->background(background()); updateCursor(); } void MSText::updateForeground(unsigned long oldfg_) { MSCompositeText::updateForeground(oldfg_); if (label()->foreground()==oldfg_) label()->foreground(foreground()); updateCursor(); } void MSText::updateFont(Font oldfid_) { MSCompositeText::updateFont(oldfid_); if (cursorPixmap()!=0&&cursorPixmap()->height()!=textHeight()) makeIBeamCursor(); if (frozen()==MSFalse) { panner()->clear(); unsigned offset=(panner()->highlightThickness()+panner()->shadowThickness())<<1; int th=panner()->height()-offset; int tw=panner()->width()-offset; _rows=(unsigned)(floor((double)th)/(double)textHeight()); _columns=(unsigned)(floor((double)tw)/(double)charWidth()); _rows=(rows()<=0)?1:rows(); numLines(rows()); refresh(); } } void MSText::redraw(void) { if (mapped()==MSTrue) { clearCursor(); drawShadow(); for (unsigned i=0;idirty(MSTrue); drawLines(0,numLines()); panner()->drawShadow(); if (highlighted()==MSTrue) drawHighlight(); } } void MSText::refresh(void) { if (mapped()==MSTrue) { clearCursor(); panner()->clear(); for (unsigned i=0;idirty(MSTrue); drawLines(0,numLines()); } } void MSText::print(const char *file_) { MSBoolean fileOpen=MSFalse; MSBoolean open=MSTrue; if (outputMode()==Draw) { if (file_!=0) displayPrintFileName(file_); if ((open=displayPrintOpen(this))==MSTrue) { fileOpen=MSTrue; outputMode(Print); displayPrintXorigin(0); displayPrintYorigin(0); } } if (open==MSTrue) { clear(); if (label()->mapped()==MSTrue) { displayPrintOriginInc(label()); label()->print(); displayPrintOriginDec(label()); } displayPrintOriginInc(panner()); panner()->drawShadow(); for (unsigned i=0;idirty(MSTrue); drawLines(0,numLines()); displayPrintOriginDec(panner()); if (fileOpen==MSTrue) { displayPrintClose(); outputMode(Draw); } } } void MSText::insertString(const char *pString_) { if (pString_!=0) { if (text().length()start(); unsigned ep=line(l)->end(); resetLinesAfterInsert(l,cp,slen,MSTrue); if (inRange(cp+slen)==MSTrue) { unsigned lineDelta=(line(l)->end()-line(l)->start())-((ep-sp)); (l==numLines()-1&&lineDelta==0)?scrollUp(1):drawTextFrom(cp); } else { unsigned nl=computeNumLines(cp,cp+slen); scrollUp(nl); } positionToRowCol(cp+slen,r,c); moveCursor(r,c); } else server()->bell(); } else server()->bell(); } void MSText::deleteString(int startPos_,unsigned num_) { if (startPos_>=0&&startPos_bell(); } void MSText::cursorPosition(unsigned position_) { _cursorPosition=position_; } void MSText::focusIn(void) { _haveFocus=MSTrue; highlight(); if (isProtected()==MSFalse) startBlinking(); } void MSText::focusOut(void) { unHighlight(); clearCursor(); stopBlinking(); _haveFocus=MSFalse; } void MSText::keyPress(const XEvent *e_,KeySym k_,unsigned int state_,const char *b_) { MSKeyPress keyPress(k_,state_); if (isProtected()==MSFalse) { MSBoolean hasMatch = keyTranslationTable()->hasMatch(keyPress); if ((hasMatch == MSTrue)||strlen(b_)>0) { MSBoolean cleared=MSFalse; if (selectionLength()>0) { unsigned row,col; positionToRowCol(selectionStart(),row,col); moveCursor(row,col); text().remove(selectionStart(),selectionLength()); resetLinesFrom(row); clearSelection(); cleared=MSTrue; } MSBoolean done = MSFalse; if(cleared == MSTrue && (k_==XK_BackSpace || k_==XK_Delete)) { done = MSTrue; } else if(hasMatch == MSTrue) { done = keyTranslate(keyPress); } if ( strlen(b_)>0 && done == MSFalse) insertString(b_); } } else if(sensitive() == MSTrue) { //We are "ReadOnly" but still sensitive, so process Up/Down,etc.... keyTranslate(keyPress); } } void MSText::makeIBeamCursor(void) { if (frozen()==MSFalse) { XSegment segments[3]; int cursorWidth=5; int cursorHeight=textHeight(); unsigned line_width=1; unsigned offset2=2*(highlightThickness()+shadowThickness()); if (cursorHeight>19) { cursorWidth++; line_width=2; } if (cursorHeight>height()-offset2) cursorHeight=height()-offset2; if (cursorWidth>width()-offset2) cursorWidth=width()-offset2; cursorHeight=(cursorHeight>0)?cursorHeight:1; cursorWidth=(cursorWidth>0)?cursorWidth:1; if (cursorPixmap()!=0) delete cursorPixmap(); _cursorPixmap=new MSPixmap(server(),"_textCursor",cursorWidth,cursorHeight, foreground()^background(),background()); GC fillGC=DefaultGC(display(),DefaultScreen(display())); XSetForeground(display(),fillGC,0); XSetBackground(display(),fillGC,1); // Fill the cursor with 0's XFillRectangle(display(),cursorPixmap()->pixmap(),fillGC, 0,0,cursorPixmap()->width(),cursorPixmap()->height()); // Draw the segments of the I-MSBeam // 1st segment is the top horizontal line of the 'I' segments[0].x1=0; segments[0].y1=line_width-1; segments[0].x2=cursorWidth; segments[0].y2=segments[0].y1; // 2nd segment is the bottom horizontal line of the 'I' segments[1].x1=0; segments[1].y1=cursorHeight-1; segments[1].x2=cursorWidth; segments[1].y2=segments[1].y1; // 3rd segment is the vertical line of the 'I' segments[2].x1=cursorWidth>>1; segments[2].y1=line_width-1; segments[2].x2=segments[2].x1; segments[2].y2=cursorHeight-1; XDrawSegments(display(),cursorPixmap()->pixmap(),imageGC(),segments,3); } } void MSText::createGCs(void) { if (imageMSGC()==0) { XGCValues values; unsigned long valueMask=(GCFunction|GCForeground|GCBackground); values.function=GXxor; values.foreground=foreground()^background(); values.background=background(); _imageMSGC=new MSGC(server(),MSTrue,&values,valueMask); } else imageMSGC()->color(foreground()^background(),background()); } void MSText::kill(void) { if (isProtected()==MSFalse&&text().length()>0) { int len=lineLength(cursorY())-cursorX(); if (len>=0) { char *src=(char *)string(); unsigned offset=line(cursorY())->start()+cursorX(); if (len==0&&src[offset]==NewLineChar) len=1; else if (len>1) { unsigned index=len+offset-1; if (index0) insertString(yankBuffer().string()); } void MSText::model(MSString& model_) { couple(&model_); } void MSText::model(const MSString& model_) { constCouple(&model_); } void MSText::update(const MSIndexVector&) { updateData(); } void MSText::updateData(void) { if (MSView::model()!=0) { MSString *cv=(MSString *)_model; string(cv->string()); } else string(""); } void MSText::string(const char *pString_) { if (pString_!=0) { clearCursor(); text()=pString_; if (firstMap()==MSTrue) { _firstLine=0; _cursorPosition=0; _cursorX=0; _cursorY=0; initLines(rows()); } if (mapped()==MSTrue) refresh(); } } void MSText::pageUp(void) { if (firstLine()!=0) { firstLine(firstLine()-(numLines()-1)); moveCursor(numLines()-1,0); } } void MSText::pageDown(void) { if (firstLine()<(maxNumLines()-numLines())) { firstLine(firstLine()+(numLines()-1)); moveCursor(0,0); } } void MSText::end(void) { firstLine(maxNumLines()-numLines()); moveCursor(lastLine(),lineLength(lastLine())); } void MSText::home(void) { firstLine(0); moveCursor(0,0); } void MSText::startOfLine(void) { if (isProtected()==MSFalse) moveCursorX(0);} void MSText::endOfLine(void) { if (isProtected()==MSFalse) moveCursorX(lineLength(cursorY())-1); } void MSText::up(void) { if (isProtected()==MSFalse) moveCursorY(cursorY()-1); } void MSText::down(void) { if (isProtected()==MSFalse) moveCursorY(cursorY()+1); } void MSText::deleteChar(void) { if (isProtected()==MSFalse) deleteString(cursorPosition(),1); } void MSText::backspace(void) { if (isProtected()==MSFalse) deleteString(cursorPosition()-1,1); } void MSText::forwardChar(void) { if (isProtected()==MSFalse) moveCursorX(cursorX()+1); } void MSText::backwardChar(void) { if (isProtected()==MSFalse) moveCursorX(cursorX()-1); } void MSText::save(void) { if (isProtected()==MSFalse) activateCallback(MSWidgetCallback::save); } void MSText::shiftTab(void) { if (sensitive()==MSFalse) top()->traverseToPrevious(); } void MSText::tab(void) { if (sensitive()==MSTrue&&isProtected()==MSFalse) insertString(MSTextTabString); else top()->traverseToNext(); } void MSText::returnKey(void) { char buf[2]; buf[0]=NewLineChar; buf[1]='\0'; insertString(buf); } void MSText::positionToXY(unsigned pos_,unsigned& x_,unsigned &y_) { unsigned offset=panner()->highlightThickness()+panner()->shadowThickness(); if (pos_<=length()) { unsigned row=positionToRow(pos_); y_=offset+row*textHeight(); unsigned start=line(row)->start(); unsigned len=pos_-start; char *cp=(char *)string(); x_=offset+textWidth(cp+start,len); } else { x_=offset; y_=offset; } } MSBoolean MSText::inRange(unsigned pos_) { return (pos_>=line(0)->start()&&pos_<=line(numLines()-1)->end())?MSTrue:MSFalse; } unsigned MSText::computeNumLines(unsigned start_,unsigned end_) { unsigned r=0; unsigned pos; unsigned nl=0; if (inRange(start_)==MSTrue) { r=positionToRow(start_); if (end_>line(r)->end()) { pos=line(r)->end()+1; nl=1; } else pos=line(r)->start(); } else { pos=line(numLines()-1)->end()+1; nl=1; } unsigned offset=panner()->highlightThickness()+panner()->shadowThickness(); char *cp=(char *)string(); int w=panner()->width()-2*offset; int tw=0; unsigned len=(end_0&&posw) { pos--,nl++,tw=0; } } } return nl; } unsigned MSText::lineToPosition(unsigned line_) { unsigned offset=panner()->highlightThickness()+panner()->shadowThickness(); int w=panner()->width()-2*offset; char *cp=(char *)string(); unsigned l=0; int tw=0; unsigned len=length(); unsigned sp=0; if (line_>0) { for(unsigned pos=0;posw) { pos--; l++; sp=pos+1; if (l==line_) break; tw=0; } } } } return sp; } void MSText::scrollUp(unsigned n_) { if (n_>0&&n_highlightThickness()+panner()->shadowThickness(); unsigned i=0; for (i=0;istart(line(i+n_)->start()); line(i)->end(line(i+n_)->end()); line(i)->clean(); } _firstLine+=n_; unsigned pos=line(numLines()-n_-1)->end()+1; unsigned endPos; for (i=numLines()-n_;idirty(MSTrue); if (posstart(pos); line(i)->end(endPos); pos=endPos+1; } else { line(i)->start(length()); line(i)->end(length()); } } unsigned sh=n_*textHeight(); unsigned h=(numLines()-n_)*textHeight(); XCopyArea(display(),panner()->window(),panner()->window(), panner()->backgroundShadowGC(), offset,offset+sh, panner()->width()-2*offset,h, offset,offset); XFillRectangle(display(),panner()->window(),backgroundShadowGC(), offset,offset+h, panner()->width()-2*offset,sh); drawLines(numLines()-n_,numLines()); } else if (n_>0) firstLine(firstLine()+n_); else MSMessageLog::warningMessage("MSText::ScrollUp error: zero increment specified"); } void MSText::scrollDown(unsigned n_) { if (n_>0&&n_highlightThickness()+panner()->shadowThickness(); unsigned i; for (i=numLines()-1;i>=n_;i--) { line(i)->start(line(i-n_)->start()); line(i)->end(line(i-n_)->end()); line(i)->clean(); } _firstLine-=n_; unsigned pos=lineToPosition(firstLine()); unsigned endPos; for (i=0;istart(pos); line(i)->end(endPos); line(i)->dirty(MSTrue); pos=endPos+1; } lineStatus(); unsigned sh=n_*textHeight(); unsigned h=(numLines()-n_)*textHeight(); XCopyArea(display(),panner()->window(),panner()->window(), panner()->backgroundShadowGC(), offset,offset, panner()->width()-2*offset,h, offset,offset+sh); XFillRectangle(display(),panner()->window(),backgroundShadowGC(), offset,offset, panner()->width()-2*offset,sh); drawLines(0,n_); } else if (n_>0) firstLine(firstLine()-n_); else MSMessageLog::warningMessage("MSText::ScrollDown error: zero increment specified"); } void MSText::resetLinePosition(unsigned line_,unsigned pos_) { if (line_highlightThickness()+panner()->shadowThickness(); int w=panner()->width()-2*offset; char *cp=(char *)string(); unsigned pos=pos_; unsigned len=length(); int tw; unsigned i,j; for (i=line_;istart(pos); line(i)->dirty(MSTrue); tw=0; if (posw) { pos--; break; } } } line(i)->end(pos++); } else line(i)->end(pos); } lineStatus(); } else MSMessageLog::warningMessage("MSText::resetLinesPosition: line out of bounds"); } void MSText::moveCursorX(int x_) { clearCursor(); unsigned x=cursorX(); if (x_<0) { if (cursorY()==0) { if (firstLine()>0) { unsigned n=1; n=((firstLine()-n)>0)?n:firstLine(); scrollDown(n); moveCursor(0,line(0)->end()); } else server()->bell(); } else if (cursorY()>0&&cursorY()=0) { if (x_<=lineLength(cursorY())) { moveCursor(cursorY(),x_); } else if (x_>lineLength(cursorY())) { if (cursorY()start()bell(); } else if (cursorY()==numLines()-1) { if (line(cursorY())->end()bell(); } else server()->bell(); } else server()->bell(); } else server()->bell(); } void MSText::moveCursorY(int y_) { clearCursor(); unsigned y=cursorY(); if (y_<0&&firstLine()>0) { unsigned n=-y_; n=((firstLine()-n)>0)?n:firstLine(); scrollDown(n); moveCursor(0,cursorX()); } else if (y_>=0) { if (y_>=numLines()) { if (line(numLines()-1)->end()bell(); } else if (y_>=0&&y_start()bell(); } else server()->bell(); } else server()->bell(); } unsigned MSText::computeEndPosition(unsigned start_) { unsigned r=start_; if (start_highlightThickness()+panner()->shadowThickness(); int w=panner()->width()-2*offset; char *cp=(char *)string(); int tw=0; unsigned pos=start_; unsigned len=length(); if (posw) { pos--; break; } } r=pos; } else r=len; } return r; } void MSText::drawTextFrom(unsigned pos_) { if (string()!=0&&mapped()==MSTrue&&numLines()>0) { unsigned dl=0; unsigned len=length(); unsigned row=positionToRow(pos_); unsigned r=row; unsigned pos=pos_; unsigned x,y; unsigned offset=panner()->highlightThickness()+panner()->shadowThickness(); char *cp=(char *)string(); y=offset+r*textHeight(); for (;rdirty()==MSTrue) { line(r)->clean(); if (r==row) { x=offset+textWidth(cp+line(r)->start(),pos-line(r)->start()); dl=(line(r)->end()-pos)+1; } else { x=offset; pos=line(r)->start(); dl=lineLength(r); } dl=(pos+dlwindow(),backgroundShadowGC(), x,y,panner()->width()-offset-x,textHeight()); if (dl>0) { XDrawImageString(display(),panner()->window(),textGC(),textFontStruct(), x,y+textAscent(),(char *)cp+pos,dl); } } r++; y+=textHeight(); } } } void MSText::drawLines(unsigned sl_,unsigned el_) { if (string()!=0&&mapped()==MSTrue&&numLines()>0) { sl_=(sl_>0)?sl_:0; el_=(el_>0)?el_:0; sl_=(sl_highlightThickness()+panner()->shadowThickness(); unsigned x=offset; unsigned y=offset+r*textHeight(); for (;rdirty()==MSTrue) { line(r)->clean(); pos=line(r)->start(); dl=lineLength(r); dl=(pos+dlwindow(),backgroundShadowGC(), x,y,panner()->width()-offset-x,textHeight()); if (dl>0) { // First filter out all possiblities that require highlighting if (selectionLength()==0|| (pos>selectionEnd())|| (pos+dlwindow(),textGC(),textFontStruct(), x,y+textAscent(),(char *)cp+pos,dl); } else { if (pos>=selectionStart()) { int len1,len2; if (pos+dl>selectionEnd()) { len1=selectionEnd()-pos+1; len2=dl-len1; } else { len1=dl; len2=0; } XSetForeground(display(),textGC(),background()); XSetBackground(display(),textGC(),foreground()); XDrawImageString(display(),panner()->window(),textGC(),textFontStruct(), x,y+textAscent(),(char *)cp+pos,len1); XSetForeground(display(),textGC(),foreground()); XSetBackground(display(),textGC(),background()); if (len2>0) { XDrawImageString(display(),panner()->window(),textGC(),textFontStruct(), x+textWidth((char *)cp+pos,len1), y+textAscent(),(char *)cp+pos+len1,len2); } } else { int len1,len2,len3; len1=selectionStart()-pos; if (pos+dl>selectionEnd()) { len2=selectionLength(); len3=dl-len2-len1; } else { len2=dl-len1; len3=0; } XDrawImageString(display(),panner()->window(),textGC(),textFontStruct(), x,y+textAscent(),(char *)cp+pos,len1); XSetForeground(display(),textGC(),background()); XSetBackground(display(),textGC(),foreground()); XDrawImageString(display(),panner()->window(),textGC(),textFontStruct(), x+textWidth((char *)cp+pos,len1), y+textAscent(),(char *)cp+pos+len1,len2); XSetForeground(display(),textGC(),foreground()); XSetBackground(display(),textGC(),background()); if (len3>0) { XDrawImageString(display(),panner()->window(),textGC(),textFontStruct(), x+textWidth((char *)cp+pos,len1+len2), y+textAscent(),(char *)cp+pos+len1+len2,len3); } } } } } r++; y+=textHeight(); } if (vsb()->value()!=firstLine()) vsb()->valueChange(firstLine()); } } void MSText::firstLine(int fl_) { if (fl_!=firstLine()) { clearCursor(); _firstLine=(fl_>=0)?fl_:0; unsigned pos=lineToPosition(firstLine()); unsigned endPos; for (unsigned i=0;idirty(MSTrue); if (posstart(pos); line(i)->end(endPos); pos=endPos+1; } else { line(i)->start(length()); line(i)->end(length()); } } drawLines(0,numLines()); } } unsigned MSText::computeMaxNumLines(void) { unsigned nl=firstLine()+numLines(); unsigned pos=line(numLines()-1)->start(); unsigned offset=panner()->highlightThickness()+panner()->shadowThickness(); int w=panner()->width()-2*offset; char *cp=(char *)string(); int tw=0; unsigned len=length(); for(;pos>0&&posw) { pos--,nl++,tw=0; } } } _maxNumLines=nl; return nl; } void MSText::resetVsb(void) { vsb()->max(computeMaxNumLines()); } void MSText::updateVsb(void) { if (vsb()->width()>1) { vsb()->viewSize(numLines()); vsb()->max(computeMaxNumLines()); vsb()->pageInc(numLines()-1); vsb()->valueChange(firstLine()); if (vsb()->mapped()==MSFalse) vsb()->map(); } else if (vsb()->mapped()==MSTrue) vsb()->unmap(); } void MSText::vsbValueUpdate(void) { if (vsb()->value()value()); else if (vsb()->value()>firstLine()) scrollUp(vsb()->value()-firstLine()); } void MSText::selectionClear(const XEvent *) { if (server()->primarySelectionOwner()==this) server()->primarySelectionOwner(0); clearSelection(); } void MSText::insertPrimarySelection(void) { insertString(_server->pasteBuffer().string()); } const char * MSText::getPrimarySelection(MSString& buffer_, int& len_) { if (primaryIsOurs()==MSFalse) return 0; char *data=(char *)string() +selectionStart(); len_=selectionLength(); return data; } void MSText::debugMode(MSBoolean mode_) { debug=mode_; } void MSText::lineStatus(void) { // if (debug==MSTrue) // { // for (unsigned i=0;istart()<<"\t"<end(); // cerr<<"\t"<dirty())<freeze(); label()->foreground(titleForeground()); label()->font(titleFont()); label()->alignment(titleAlignment()); unsigned h=label()->height(); unsigned w=label()->width(); MSBoolean doPlacement=MSFalse; label()->label(title()); unsigned ml=label()->columns(); if (ml==0&&label()->mapped()==MSTrue) { label()->unmap(); doPlacement=MSTrue; } else if (ml>0&&label()->mapped()==MSFalse) { label()->map(); doPlacement=MSTrue; } positionLabel(); label()->unfreeze(); if (label()->height()!=h||label()->width()!=w||doPlacement==MSTrue) placement(); else if (label()->mapped()==MSTrue) label()->redraw(); } // this code was taken from MSNotebook and // is duplicated here -- it would be nice if // the label behavior could be encapsulated // and thus we would not have to multiple copies // of the same code running around. void MSText::positionLabel(void) { if (label()->columns()>0) { int offset=highlightThickness()+shadowThickness(); int xpos,ypos; int indent; if (titleAlignment()&MSLeft) { indent=XTextWidth(fontManager()->fontStruct(label()->font()),"M",1); xpos=offset+indent; } else if (titleAlignment()&MSRight) { indent=XTextWidth(fontManager()->fontStruct(label()->font()),"M",1); xpos=width()-offset-indent-label()->width(); } else xpos=width()/2-label()->width()/2; int shadowOffset; if (titleAlignment()&MSTop) { shadowOffset=label()->height(); ypos=0; } else if (titleAlignment()&MSBottom) { shadowOffset=0; ypos=offset; } else { shadowOffset=label()->height()/2+offset; ypos=offset; } if (shadowOffset!=topShadowOffset()) { undrawShadow(); topShadowOffset(shadowOffset); } label()->moveTo(xpos,ypos); label()->map(); } else { label()->unmap(); topShadowOffset(0); } } void MSText::set(MSAttrValueList& avList_) { MSCompositeText::set(avList_); MSIndexVector index; for (unsigned i=0;i0) { beforeStart=positionToRow(selectionStart()); beforeEnd=positionToRow(selectionEnd()); } else { beforeStart=-1; beforeEnd=-1; } int previousStart=selectionStart(); _selectionStart=selectionStart_; _selectionLength=selectionLength_; if (selectionLength()>0) { afterStart=positionToRow(selectionStart()); afterEnd=positionToRow(selectionEnd()); } else { afterStart=-1; afterEnd=-1; } if (beforeStart==-1||afterStart==-1) { start=0; end=numLines()-1; } else if (beforeEnd==afterEnd) { if (afterStartselectionStart()) { start=beforeStart; end=beforeStart; } else { start=beforeEnd; end=afterEnd; } } } else if (beforeStart==afterStart) { if (beforeEnddirty(MSTrue); drawLines(start,end+1); } if (selectionLength()>0) ownSelection(XA_PRIMARY); else if (primaryIsOurs()==MSTrue) disownSelection(XA_PRIMARY); } } MSString MSText::selectedString(void) const { if (selectionLength()==0) return MSString(); else return text().subString(selectionStart(),selectionLength()); } MSText::ScrollTimer::ScrollTimer(MSText *text_,Direction direction_) : MSIntervalTimer(50),_text(text_),_direction(direction_) {} void MSText::ScrollTimer::process(void) { if (direction()==Up) { if (text()->firstLine()!=0) { text()->firstLine(text()->firstLine()-1); int newPos=text()->lineToPosition(text()->firstLine()); if (text()->startDrag()>newPos) { text()->selectRange(newPos,text()->startDrag()-newPos); } else { text()->selectRange(text()->startDrag(),newPos-text()->startDrag()); } unsigned row,col; text()->positionToRowCol(text()->selectionStart(),row,col); text()->moveCursor(row,col); } else stop(); } else { if (text()->firstLine()<(text()->maxNumLines()-text()->numLines())) { text()->firstLine(text()->firstLine()+1); int last=text()->firstLine()+text()->numLines(); int newPos=text()->lineToPosition(last); if (text()->startDrag()selectRange(text()->startDrag(),newPos-text()->startDrag()); } else { text()->selectRange(newPos,text()->startDrag()-newPos); } unsigned row,col; text()->positionToRowCol(text()->selectionEnd(),row,col); text()->moveCursor(row,col); } else stop(); } } MSBoolean MSText::primaryIsOurs(void) const { return MSBoolean(server()->primarySelectionOwner()==this); } aplus-fsf-4.22/src/MSGUI/MSTextEditor.C0000644000265000001440000053652510772770414013161 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #if HAVE_FSTREAM #include #else #include #endif #include #include /////////////////////////////////////////////////////////////////////////////// const unsigned long MSTextEditorDefaultBlinkRate=300; /////////////////////////////////////////////////////////////////////////////// // ccfilter functions declarations /////////////////////////////////////////////////////////////////////////////// #ifndef ccfilter_h #define ccfilter_h /* ** ccfilter.h ** ** This header defines the functions related to the Character ** Content Filter. Some these are defined in ccfilter.c and ** some must be defined by the application using the ccfilter. ** ** Character Content Filter interprets the character stream ** according to various standards (ISO 2022, CCITT T.51) ** ** Copyright 1992, 1993 by Markku Savela and ** Technical Research Centre of Finland */ enum ccf_Gs { ccf_G0 = 0, ccf_G1 = 1, ccf_G2 = 2, ccf_G3 = 3, ccf_CC = 4 }; enum ccf_Cs { ccf_C0 = 0, ccf_C1 = 1 }; /* ** ccf_Gn ** ccf_Gn funtion is called to produce the graphic characters ** extracted from the stream. The function is supplied with the ** number of *characters* and a pointer to string of bytes. ** Each character is represented by one or more bytes in the ** string, depending on what kind of character set is designated ** into the Gn set. (Application must remember this from ** ccf_Designate_G function call). ccf_CC functions like ccf_Gn ** functions, but is called when filter is working in passthrough ** mode (Complete Code, coding system different from ISO 2022). ** ** n is always > 0, when these are called. */ typedef void (*ccf_Gn)( void *, /* client data */ ccf_Gs, /* Identify G0, G1, G2, G3 or CC */ char *, /* String of data bytes */ int /* Number of *characters* in the string */ ); /* ** ccf_Cn ** ccf_Cn is called for codes belonging to the control sets C0 and C1. ** (control codes that are used in code extensions are handled ** internally within the ccfilter). ** ** The argument c is always within range 0..31. */ typedef void (*ccf_Cn)( void *, /* client data */ ccf_Cs, /* Identify C0 or C1 */ int /* Control code: always in range 0..31 */ ); /* ** ccf_ESC ** ccf_ESC is called for unrecognized escape sequences. ** m is number of intermediate bytes, and I points to ** the first intermediate (if m > 0). */ typedef void (*ccf_ESC)( void *, /* client data */ char *, /* Intermediate bytes pointer */ int, /* Number of intermediate bytes */ int /* Final Character (F) */ ); /* ** ccf_CSI ** ccf_CSI is called for all CSI sequences. ** ** n = number of parameters ( >= 0) ** p = pointer to integers representing the parameter values, ** (value 0 indicates a request for default value). ** (parameter characters are '0'..'?') ** I = Intermediate character(s) (' '..'/') ** F = Final character ('@'..'~'). ** P = Private indicator ('<', '=', '>' or '?') */ typedef void (*ccf_CSI)( void *, /* client data */ int, /* Private Indicator, if non-zero */ int *, /* Parameter values array (p) */ int, /* Number of parameters >= 0 (n) */ char *, /* Intermediate bytes pointer */ int, /* Number of intermediate bytes */ int /* Final Character (F) */ ); /* ** ccf_DG ** Designate and invoke a character set into Gn. The function ** must return the number of bytes per character in this set. ** Return value 0 is an error and the designation of the Gn ** doesn't change. ** ** Gx = ccf_CC, for complete set. After this ccf_Filter will ** be in a "pass through" state until ccf_Reset is called. ** All characters are produced through ccf_CC function. ** ** S = zero for 94 character set, and non-zero for 96 character set. ** M = MSFalse(=0), if single byte set, MSTrue(=1), if multibyte set ** F = Final character, identifying the registered set. */ typedef int (*ccf_DG)( void *, /* client data */ ccf_Gs, /* Gx */ int, /* Zero = 94-set, and non-Zero = 96-set */ int, /* M Single/Multibyte indicator */ int /* F Final Character */ ); /* ** ccf_DC ** Designate and invoke control characters. Return Non-Zero, ** if error. ** ** Cx = 0, for C0 ** = 1, for C1 ** F = Final character, identifying the registered set. */ typedef int (*ccf_DC)( void *, /* client data */ ccf_Cs, /* Cx */ int /* F Final Byte */ ); /* ** ccf_Feed ** Feed in a portion of a byte stream. Note, that escape ** sequences and multibyte characters can extend over portions ** (e.g. there is no requirement that an escape sequence must ** be contained within single portion as a whole). Returns on ** success. (No error returns defined at the moment.) */ int ccf_Feed( ccf_Context, /* Context to feed (from ccf_Reset) */ const char *, /* Pointer to bytes */ int /* Number of bytes to feed */ ); /* ** ccf_Open ** Open the filter stream. Returns a pointer to a filter context block ** that must be given as parameter to ccf_Filter. */ ccf_Context ccf_Open( void *, /* client data (for callbacks) */ ccf_Gn, /* Craphic characters callback */ ccf_Cn, /* Control characters callback */ ccf_ESC, /* ESC Sequence callback */ ccf_CSI, /* CSI Sequence callback */ ccf_DG, /* Designate Graphic callback */ ccf_DC /* Designate Control callback */ ); /* ** ccf_Close ** Close ccf_Context (release data associated with the context) */ void ccf_Close( ccf_Context ); #endif /////////////////////////////////////////////////////////////////////////////// // ccfilter functions definition /////////////////////////////////////////////////////////////////////////////// /* Character Content Filter interprets the character stream ** according to various standards (ISO 2022, ISO 649, ISO6429, ** ISO 6937). ** ** *NOTE* ** In various places this module uses hex values for byte ** codes. This is *intentional* and *required* so that the ** generated code will be independent of the characterset ** the C compiler is using. ** // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution ** Technical Research Centre of Finland */ #define MAX_MULTIPLE_BYTES (4) #define NumberOf(array) (sizeof(array) / sizeof(array[0])) #include typedef enum { NUL, SOH, STX, ETX, EOT, ENQ, ACK, BEL, BS , HT , LF , VT , FF , CR , SO , SI , DLE, DC1, DC2, DC3, DC4, NAK, SYN, ETB, CAN, EM , SUB, ESC, FS , GS , RS , US } C0_Code; typedef enum { X80, X81, BPH, NBH, IND, NEL, SSA, ESA, HTS, HTJ, VTS, PLD, PLU, RI , SS2, SS3, DCS, PU1, PU2, STS, CCH, MW , SPA, EPA, SOS, X99, X9A, CSI, ST , OSC, PM , APC } C1_Code; typedef void (*CodeHandler)(ccf_Context, int Code); static void Handler_CC(ccf_Context, int);/* General Complete Code Handler */ static void Handler_C0(ccf_Context, int);/* General C0 Handler */ static void Handler_C1(ccf_Context, int);/* General C1 Handler */ static void Handler_GC(ccf_Context, int);/* General GL/GR Handler */ static void Handler_GC_Switch(ccf_Context, int); /* General GL/GR switch handler */ static void Handler_GLSS2(ccf_Context, int);/* Single Shift G2 Handler */ static void Handler_GLSS3(ccf_Context, int);/* Single Shift G3 Handler */ static void Handler_ESC(ccf_Context, int);/* General ESC handler */ static void Handler_CSI(ccf_Context, int);/* General CSI handler */ typedef struct GC_type { CodeHandler handler; ccf_Gs Gn; } GC_type; /* ** CSI Interpreter State */ typedef struct CSI_State { # define CSI_STATE_INITIAL (0) # define CSI_STATE_PARAMETER (1) # define CSI_STATE_INTERMEDIATE (2) int state; int isprivate; /* Private sequence indicator */ int parameter[30]; /* Parameters of a CSI sequence */ int current; /* Current Parameter being interpreted */ char intermediate[4]; /* Intermediate Codes */ int count; /* Number of Intermediate characters */ } CSI_State; /* ** ESC Interpreter State */ typedef struct ESC_State { char intermediate[9]; /* Intermediate Codes */ int count; /* Number of Intermediate characters */ } ESC_State; typedef struct ccf_ContextRec { void *client_data; ccf_Gn call_Gn; ccf_Cn call_Cn; ccf_ESC call_ESC; ccf_CSI call_CSI; ccf_DG call_DG; ccf_DC call_DC; int multiple_byte; /* Bytes remaining from next character */ int GC_multiple_byte; /* Bytes in one character in current GC */ int run_length; /* Length of contiguous bytes in same set */ int run_characters; /* Number of completed contiguous characters */ char *run_start; /* First byte of the run */ CodeHandler C0; /* C0 Control Handler */ CodeHandler C1; /* C1 Control Handler */ GC_type GL; /* Current GL state */ GC_type GR; /* Current GR state */ GC_type *current; /* Current GC (GL or GR) */ GC_type *other; /* Other GC (GL or GR) */ int saveS; /* Temporary for interpreting Gn designation */ ccf_Gs saveGn; /* Temporary for interpreting Gn designation */ ccf_Cs saveCn; /* Temporary for interpreting Cn designation */ int bytes[5]; /* Bytes in sets in G0, G1, G2, G3 and CC */ char hold_over[MAX_MULTIPLE_BYTES]; char *holding; union { CSI_State csi; ESC_State esc; } i; } ccf_ContextRec; /* ** ExitControl ** Must be called when the last byte of a control sequence ** has been processed. This prepares the system for the next ** run of normal graphic characters. */ static void ExitControl(ccf_Context cc) { cc->run_start += cc->run_length; /* Skips over the control sequence */ cc->run_length = 0; cc->current = &cc->GL; cc->other = &cc->GR; cc->GL.handler = Handler_GC; cc->GR.handler = Handler_GC_Switch; cc->multiple_byte = cc->GC_multiple_byte = cc->bytes[cc->GL.Gn]; } /* ** EnterControl ** Must be called when a control sequence starts (does not cause ** any harm if called repeatedly within the control sequence). ** Flush out a sequence of graphic characters preceding the ** control sequence (if any). Any incomplete multi-byte character ** will be scratched by this. */ static void EnterControl(ccf_Context cc) { if (cc->run_characters > 0) { (*cc->call_Gn)(cc->client_data, cc->current->Gn, cc->run_start, cc->run_characters); cc->run_characters = 0; } } /* ** Handler_CSI ** Stay in this handler until a Final Character is reached or ** an error is detected (in which case the whole sequence up ** to this point is discarded). */ static void Handler_CSI(ccf_Context cc, int Code) { switch (Code) { case 0x30: /* 0 */ case 0x31: /* 1 */ case 0x32: /* 2 */ case 0x33: /* 3 */ case 0x34: /* 4 */ case 0x35: /* 5 */ case 0x36: /* 6 */ case 0x37: /* 7 */ case 0x38: /* 8 */ case 0x39: /* 9 */ if (cc->i.csi.state > CSI_STATE_PARAMETER) break; cc->i.csi.state = CSI_STATE_PARAMETER; cc->i.csi.parameter[cc->i.csi.current] = cc->i.csi.parameter[cc->i.csi.current]*10 + Code-0x30; return; /* Continue CSI */ case 0x3A: /* : */ case 0x3B: /* ; */ if (cc->i.csi.state > CSI_STATE_PARAMETER) break; cc->i.csi.state = CSI_STATE_PARAMETER; if (cc->i.csi.current < NumberOf(cc->i.csi.parameter)-1) ++cc->i.csi.current; cc->i.csi.parameter[cc->i.csi.current] = 0; return; /* Continue CSI */ case 0x3C: /* < */ case 0x3D: /* = */ case 0x3E: /* > */ case 0x3F: /* ? */ if (cc->i.csi.state != CSI_STATE_INITIAL) break; /* -- Error! */ cc->i.csi.isprivate = Code; cc->i.csi.state = CSI_STATE_PARAMETER; return; /* Continue CSI */ case 0x20: /* */ case 0x21: /* ! */ case 0x22: /* " */ case 0x23: /* # */ case 0x24: /* $ */ case 0x25: /* % */ case 0x26: /* & */ case 0x27: /* ' */ case 0x28: /* ( */ case 0x29: /* ) */ case 0x2A: /* * */ case 0x2B: /* + */ case 0x2C: /* , */ case 0x2D: /* - */ case 0x2E: /* . */ case 0x2F: /* / */ /* ** Intermediate Codes */ cc->i.csi.state = CSI_STATE_INTERMEDIATE; if (cc->i.csi.count == NumberOf(cc->i.csi.intermediate)) break; /* -- ERROR, abort sequence */ cc->i.csi.intermediate[cc->i.csi.count++] = Code; return; default: /* ** Call different functions depending on what kind of ** sequence we had... */ cc->i.csi.current += 1; (*cc->call_CSI)(cc->client_data, cc->i.csi.isprivate, cc->i.csi.parameter, cc->i.csi.current, cc->i.csi.intermediate, cc->i.csi.count, Code); break; } ExitControl(cc); } /* ** Handler_C1 ** Handle C1 control codes. */ static void Handler_C1(ccf_Context cc, int Code) { EnterControl(cc); switch (Code) { case SS2: /* (N) Single Shift Two (Introducer) */ cc->multiple_byte = cc->bytes[ccf_G2]; cc->run_start += cc->run_length; cc->run_length = 0; cc->GL.handler = Handler_GLSS2; cc->GR.handler = Handler_GLSS2; break; case SS3: /* (O) Single Shift Three (Introducer) */ cc->multiple_byte = cc->bytes[ccf_G3]; cc->run_start += cc->run_length; cc->run_length = 0; cc->GL.handler = Handler_GLSS3; cc->GR.handler = Handler_GLSS3; break; case CSI: /* ([) Control Sequence Introducer */ cc->i.csi.state = CSI_STATE_INITIAL; cc->i.csi.current = 0; cc->i.csi.count = 0; cc->i.csi.isprivate = 0; cc->i.csi.parameter[0] = 0; cc->GL.handler = Handler_CSI; cc->GR.handler = Handler_CSI; break; default: (*cc->call_Cn)(cc->client_data, ccf_C1, Code); ExitControl(cc); break; } } /* ** Handler_LoadCx ** Changing of Control Repertoire is not really implemented. */ static void Handler_LoadCx(ccf_Context cc, int) { ExitControl(cc); } /* ** Handler_LoadGx ** Handle designations of single-byte character sets ** ** 94 G0 ESC 2/8 F ** G1 ESC 2/9 F ** G2 ESC 2/10 F ** G3 ESC 2/11 F ** ** 96 G1 ESC 2/13 F ** G2 ESC 2/14 F ** G3 ESC 2/15 F ** ^ ** (this & 7) = SaveGx ** ** Complete Code ESC 2/5 F (SaveGx = -1) */ static void Handler_LoadGx(ccf_Context cc, int Code) { ccf_Gs save_Gn = cc->saveGn; /* Just in case */ int save_S = cc->saveS; Code = (*cc->call_DG)(cc->client_data, save_Gn, save_S, MSFalse, Code); if (Code == 0) ; else if (save_Gn == ccf_CC) { /* ** Escape from ISO 2022 */ cc->GL.handler = cc->C0 = cc->C1 = Handler_CC; cc->GL.Gn = ccf_CC; cc->GR = cc->GL; } else cc->bytes[save_Gn] = Code > MAX_MULTIPLE_BYTES ? MAX_MULTIPLE_BYTES : Code; ExitControl(cc); } /* ** Handler_LoadMGx ** Handle designations of multiple-byte character sets ** ** n x 94 G0 ESC 2/4 F ** G1 ESC 2/4 2/9 F ** G2 ESC 2/4 2/10 F ** G3 ESC 2/4 2/11 F ** ** n x 96 G1 ESC 2/4 2/13 F ** G2 ESC 2/4 2/14 F ** G3 ESC 2/4 2/15 F ** ^ ** (this & 7) = SaveGx ** *NOTE* ** this function *leaks*, it passes any number of ** intermediate codes and remembers only the last. */ static void Handler_LoadMGx(ccf_Context cc, int Code) { ccf_Gs save_Gn = cc->saveGn; /* (Paranoid programming ;) */ int save_S = cc->saveS; if (Code == 0x29 || Code == 0x2A || Code == 0x2B || Code == 0x2D || Code == 0x2E || Code == 0x2F) { cc->saveGn = (ccf_Gs)(Code & 3); cc->saveS = (Code & 4) != 0; } else if (Code > 0x3F) { Code=(*cc->call_DG)(cc->client_data,save_Gn,save_S,MSTrue,Code); if (Code) cc->bytes[cc->saveGn] = Code > MAX_MULTIPLE_BYTES ? MAX_MULTIPLE_BYTES : Code; ExitControl(cc); } } static void Handler_ESC_Intermediate(ccf_Context cc, int Code) { if (Code < 0x30) { if (cc->i.esc.count < NumberOf(cc->i.esc.intermediate)) cc->i.esc.intermediate[cc->i.esc.count++] = Code; } else { (cc->call_ESC)(cc->client_data, cc->i.esc.intermediate, cc->i.esc.count, Code); ExitControl(cc); } } static void Handler_ESC(ccf_Context cc, int Code) { if (Code < 0x30) /* ** Intermediate character */ switch (Code) { case 0x21: case 0x22: cc->saveCn = (ccf_Cs)(Code & 1); cc->GL.handler = (CodeHandler)Handler_LoadCx; cc->GR.handler = (CodeHandler)Handler_LoadCx; break; case 0x24: cc->saveGn = ccf_G0; /* Default to n x 94, G0 */ cc->saveS = 0; cc->GL.handler = (CodeHandler)Handler_LoadMGx; cc->GR.handler = (CodeHandler)Handler_LoadMGx; break; case 0x25: /* CC, 256 (Complete Code) */ cc->saveGn = ccf_CC; cc->GL.handler = (CodeHandler)Handler_LoadGx; cc->GR.handler = (CodeHandler)Handler_LoadGx; break; case 0x28: /* G0, 94 */ case 0x29: /* G1, 94 */ case 0x2A: /* G2, 94 */ case 0x2B: /* G3, 94 */ case 0x2D: /* G1, 96 */ case 0x2E: /* G2, 96 */ case 0x2F: /* G3, 96 */ cc->saveGn = (ccf_Gs)(Code & 3); cc->saveS = (Code & 4) != 0; cc->GL.handler = (CodeHandler)Handler_LoadGx; cc->GR.handler = (CodeHandler)Handler_LoadGx; break; default: cc->GL.handler = (CodeHandler)Handler_ESC_Intermediate; cc->GR.handler = (CodeHandler)Handler_ESC_Intermediate; cc->i.esc.count = 1; cc->i.esc.intermediate[0] = Code; break; } else if (Code < 0x60) /* ** 7 bit representation of C1 control */ Handler_C1(cc, Code & 0x1F); else { if (Code == 0x7E) /* LS1R */ cc->GR.Gn = ccf_G1; else if (Code == 0x6E) /* LS2 */ cc->GL.Gn = ccf_G2; else if (Code == 0x7D) /* LS2R */ cc->GR.Gn = ccf_G2; else if (Code == 0x6F) /* LS3 */ cc->GL.Gn = ccf_G3; else if (Code == 0x7C) /* LS3R */ cc->GR.Gn = ccf_G3; else (*cc->call_ESC)(cc->client_data, (char *)0, 0, Code); ExitControl(cc); } } /* ** Handler_C0 */ static void Handler_C0(ccf_Context cc, int Code) { EnterControl(cc); switch (Code) { case ESC: cc->GL.handler = Handler_ESC; cc->GR.handler = Handler_ESC; return; case SI: /* LS0, lock shift G0 */ cc->GL.Gn = ccf_G0; break; case SO: /* LS1, lock shift G1 */ cc->GL.Gn = ccf_G1; break; case CAN: /* Will abort CSI/ESC sequence if in progress */ default: (*cc->call_Cn)(cc->client_data, ccf_C0, Code); break; } ExitControl(cc); } /* ** Handler_CC */ static void Handler_CC(ccf_Context, int) { } /* ** Handler_GC ** Passes consecutive bytes belonging to the same set. */ static void Handler_GC(ccf_Context cc, int) { if (--cc->multiple_byte == 0) { /* ** One complete multiple-byte or single-byte character ** completed. */ cc->multiple_byte = cc->GC_multiple_byte; cc->run_characters += 1; } } /* ** Handler_GC_Switch ** GC_Switch is called when after a sequence of characters ** in GL or GR set, a byte belonging to another set arrives. */ static void Handler_GC_Switch(ccf_Context cc, int Code) { GC_type *temp; /* ** If a multiple-byte sequence within GL or GR is interrupted by ** a byte belonging to the other set, just include this byte into ** the multiple byte character and continue using the same GL/GR set. ** (This is an error condition not specified in the standard and ** this way of handling it is the usual practise in the existing ** implementations --msa) */ if (cc->multiple_byte == cc->GC_multiple_byte) { /* ** Starting a Run on the other set. Flush out any accumulated ** characters and initialize for new alternate run. */ if (cc->run_characters > 0) (*cc->call_Gn)(cc->client_data, cc->current->Gn, cc->run_start, cc->run_characters); cc->run_start += cc->run_length - 1; cc->run_length = 1; cc->run_characters = 0; temp = cc->current; cc->current = cc->other; cc->other = temp; cc->other->handler = Handler_GC_Switch; cc->current->handler = Handler_GC; cc->multiple_byte = cc->GC_multiple_byte = cc->bytes[cc->current->Gn]; } Handler_GC(cc, Code); } static void Handler_GLSS2(ccf_Context cc, int) { if (--cc->multiple_byte == 0) { (*cc->call_Gn)(cc->client_data, ccf_G2, cc->run_start, 1); ExitControl(cc); } } static void Handler_GLSS3(ccf_Context cc, int) { if (--cc->multiple_byte == 0) { (*cc->call_Gn)(cc->client_data, ccf_G3, cc->run_start, 1); ExitControl(cc); } } /* ** ccf_Feed ** Decode a portion of the stream. */ int ccf_Feed(ccf_Context cc, const char *s, int n) { register int Code; register char *h; if (cc->multiple_byte < cc->GC_multiple_byte) { /* ** A multiple-byte character was divided across portions. ** Assuming that this will not really be a common occurrence, ** we do it by rather brute force method. */ h = cc->holding; cc->run_start = cc->hold_over; cc->run_length = h - cc->hold_over; cc->run_characters = 0; do { if (n == 0) { /* ** This portion didn't complete the character. */ cc->holding = h; return 0; } Code = *(unsigned char *)s; /* ** Occurrence of any control code will abort ** the multibyte sequence. */ if ((0x60 & Code) == 0) break; --n; cc->run_length += 1; *h++ = Code; s++; if (Code & ~(0x7F)) (*cc->GR.handler)(cc, Code & 0x7F); else (*cc->GL.handler)(cc, Code); } while (cc->multiple_byte < cc->GC_multiple_byte); if (cc->run_characters > 0) (*cc->call_Gn)(cc->client_data, cc->current->Gn, cc->hold_over, 1); } cc->run_start = (char *)s; cc->run_length = 0; cc->run_characters = 0; while (--n >= 0) { cc->run_length += 1; Code = *(unsigned char *)s++; if (Code & ~(0x7F)) (*(Code&0x60 ? cc->GR.handler:cc->C1))(cc,Code & 0x7F); else (*(Code&0x60 ? cc->GL.handler:cc->C0))(cc,Code); } /* ** Flush out all remaining full characters from this portion */ if (cc->run_characters > 0) (*cc->call_Gn)(cc->client_data, cc->current->Gn, cc->run_start, cc->run_characters); /* ** If multiple-byte character is being devided across portions, ** copy the first part into HoldOver. */ if (cc->multiple_byte < cc->GC_multiple_byte) { s = cc->run_start + cc->run_characters * cc->GC_multiple_byte; n = cc->GC_multiple_byte - cc->multiple_byte; for (h = cc->hold_over; --n >= 0;) *h++ = *s++; cc->holding = h; } return 0; } ccf_Context ccf_Open(void *client_data, ccf_Gn Gn, ccf_Cn Cn, ccf_ESC ESC, ccf_CSI CSI, ccf_DG DG, ccf_DC DC) { ccf_Context cc = (ccf_Context)calloc(1, sizeof(ccf_ContextRec)); int i; if (cc) { cc->client_data = client_data; cc->call_Gn = Gn; cc->call_Cn = Cn; cc->call_ESC = ESC; cc->call_CSI = CSI; cc->call_DG = DG; cc->call_DC = DC; cc->C0 = Handler_C0; cc->C1 = Handler_C1; cc->GL.handler = Handler_GC; cc->GL.Gn = ccf_G0; cc->GR.handler = Handler_GC_Switch; cc->GR.Gn = ccf_G2; for (i = 0; i < NumberOf(cc->bytes); ++i) cc->bytes[i] = 1; cc->multiple_byte=cc->GC_multiple_byte=cc->bytes[cc->GL.Gn]; cc->current = &cc->GL; cc->other = &cc->GR; } return cc; } void ccf_Close(ccf_Context cc) { if (cc) free((char *)cc); } typedef void (MSTextEditor::*PMFV)(void); typedef struct { char *_str; PMFV _func; } TextKeys; /* class KT : public MSKeyCallback { PMFV _func; public: KT(PMFV func_): _func(func_){} ~KT(){} MSBoolean process(MSWidget* widget_,const MSKeyPress&) { (((MSTextEditor*)widget_)->*_func)(); return MSTrue; } }; */ typedef MSKeyClassCallback KT; static TextKeys EmacsKeyTable[]= { {"Escape", &MSTextEditor::escape}, {"Return", &MSTextEditor::insertNewLine}, {"BackSpace", &MSTextEditor::deleteBackwardChar}, {"Delete", &MSTextEditor::deleteBackwardChar}, {"Up", &MSTextEditor::movePreviousLine}, {"Down", &MSTextEditor::moveNextLine}, {"Right", &MSTextEditor::moveForwardChar}, {"Left", &MSTextEditor::moveBackwardChar}, {"CtrlRight", &MSTextEditor::moveForwardWord}, {"CtrlLeft", &MSTextEditor::moveBackwardWord}, {"Ctrla", &MSTextEditor::moveToLineStart}, {"Ctrle", &MSTextEditor::moveToLineEnd}, {"Ctrlk", &MSTextEditor::killToEndOfLine}, {"Ctrld", &MSTextEditor::deleteForwardChar}, {"Ctrlf", &MSTextEditor::moveForwardChar}, {"Ctrlb", &MSTextEditor::moveBackwardChar}, {"Ctrly", &MSTextEditor::selectLine}, {"Ctrlp", &MSTextEditor::movePreviousLine}, {"Ctrln", &MSTextEditor::moveNextLine }, {"Ctrll", &MSTextEditor::redrawDisplay}, {"Ctrlr", &MSTextEditor::switchColor}, {"Tab", &MSTextEditor::tab}, {"ShiftTab", &MSTextEditor::shiftTab}, {"!F27", &MSTextEditor::moveBeginningOfFile}, {"Home", &MSTextEditor::moveBeginningOfFile}, {"!R13", &MSTextEditor::moveEndOfFile}, {"End", &MSTextEditor::moveEndOfFile}, {"!F29", &MSTextEditor::moveBackwardPage}, {"Prior", &MSTextEditor::moveBackwardPage}, {"!F35", &MSTextEditor::moveForwardPage}, {"Next", &MSTextEditor::moveForwardPage}, {0,0} }; /////////////////////////////////////////////////////////////////////////////// // Defines /////////////////////////////////////////////////////////////////////////////// #define OffsetOf(ptype,field) ((unsigned long)&(((ptype *)0)->field)) // // Snip is a run of graphic characters having same attributes (font, // size,etc), or it is a control element representing a word // space, subscript/superscript, movements, inserted hyphen etc. // Snip is also used to represent various control functions. // // All measures and computations are done using the coordinate system // of the current output device (that is Pixels on screen). // #define FIELD_MASK(a,w) (~0<<(a)^~0<<((a)+(w))) #define FIELD_VALUE(a,v) ((v)< ... sequence. // original content // is yet unstandardized method of marking processable // content that should be *ignored* by the imaging // process. This marking also generated by the layout // process. Layout and editing processes should treat // this the same way as processable content. This feature // is required, for example to enable hyphenation in // languages where the form of the word changes when it's // hyphenated. The suggested indication in ODIF stream // is by ... sequence. // protected content // once inserted, cannot be edited or changed (for future // study--not yet sure what this would be). // // *NOTE* The values are tailored so that the processes can // use bit test operation in deducing whether they want // to deal with particular snip. // // ..for editing process ignore, if (SkipContent & 1) // ..for layout process ignore, if (SkipContent & 1) // ..for imaging process ignore, if (SkipContent & 2) // #define Content_MASK FIELD_MASK(0,2) #define Content_PROCESSABLE FIELD_VALUE(0,0) #define Content_FORMATTED FIELD_VALUE(0,1) #define Content_ORIGINAL FIELD_VALUE(0,2) #define Content_PROTECTED FIELD_VALUE(0,3) #define IsEditableContent(x) (!((x) & Content_FORMATTED)) #define IsImagedContent(x) (!((x) & Content_ORIGINAL)) #define IsLayoutContent(x) (((x) & Content_MASK) == Content_FORMATTED) #define IsProtectedContent(x) (((x) & Content_MASK) == Content_PROTECTED) #define Underline_MASK FIELD_MASK(2,2) #define Underline_NONE FIELD_VALUE(2,0) #define Underline_SINGLE FIELD_VALUE(2,1) #define Underline_DOUBLE FIELD_VALUE(2,2) #define Framing_MASK FIELD_MASK(4,2) #define Framing_NONE FIELD_VALUE(4,0) #define Framing_FRAMED FIELD_VALUE(4,1) #define Framing_ENCIRCLED FIELD_VALUE(4,2) #define Blinking_MASK FIELD_MASK(6,2) #define Blinking_STEADY FIELD_VALUE(6,0) #define Blinking_SLOWLY FIELD_VALUE(6,1) #define Blinking_RAPIDLY FIELD_VALUE(6,2) // // Subscript and superscript (6.3) (PLD/PLU only from there) // (Oda allows only three states here: either PLD, // PLU or none is active at any time). // // *NOTE* In code the values for UP and DOWN are assumed to be single // bit masks. // #define PartialLine_MASK FIELD_MASK(8,2) #define PartialLine_NONE FIELD_VALUE(8,0) #define PartialLine_UP FIELD_VALUE(8,1) #define PartialLine_DOWN FIELD_VALUE(8,2) // // Reversed Direction, the content of Snip has logical order // opposite to the presentation order. // #define Reversed_MASK FIELD_MASK(10,1) #define ImageInversion_MASK FIELD_MASK(11,1) #define Overlined_MASK FIELD_MASK(12,1) #define CrossedOut_MASK FIELD_MASK(13,1) #define Weight_MASK FIELD_MASK(14,2) #define Weight_NORMAL FIELD_VALUE(14,0) #define Weight_FAINT FIELD_VALUE(14,1) #define Weight_BOLD FIELD_VALUE(14,2) // // Justify field contains the current alignment mode for this // portion of the text. The value is defined by Alignment, but // only NONE, START, END and CENTER have meaning here. NONE // (default) will use the aligment of the "alignment" resource. // #define Justify_MASK FIELD_MASK(16,3) #define Justify_MODE(x) (MSTextEditor::Alignment)(((x) >> 16) & 0x7) #define Justify_VALUE(v) (((int)(v) & 0x7) << 16) // // Text can be rendered with specific foreground or background color. // When not specified, the default background and foreground colors of // the widget will be used. The color index defines the color as follows: // 0=black, 1=red, 2=green, 3=yellow, 4=blue, 5=magenta, 6=cyan and // 7=white. (ISO 6429: 1988). The color information is coded into 4 bit // field such that 0 indicates the default and non-zero value is (color // index)+1. // #define Foreground_MASK FIELD_MASK(19,4) #define Background_MASK FIELD_MASK(23,4) #define Foreground_COLOR(x) (((x) >> 19) & 0xf) #define Background_COLOR(x) (((x) >> 23) & 0xf) #define Foreground_VALUE(v) (((v) & 0xf) << 19) #define Background_VALUE(v) (((v) & 0xf) << 23) // // Font number selects one of the 10 possible entries defined by // the fonts resource. // #define Font_MASK FIELD_MASK(27,4) #define Font_NUMBER(x) (((x) >> 27) & 0xf) #define Font_VALUE(v) (((v) & 0xf) << 27) // // To silence warnings about shift count, don't use FIELD_MASK here... // #define Italicized_MASK (1<<31) /* FIELD_MASK(31,1) */ // // FontSelectInfo // Must return key information for a font that corresponds the // specified mode. // // *NOTE* // The current definition below takes advantage of the positions // of the Weight/Italicized/Font in the bits, and assumes that // size_modification can safely be ORed without overlap! // #define fontSelectInfo(m) \ ((m.bits & Weight_MASK) | (m.bits & Italicized_MASK) | \ (m.bits & Font_MASK) | m.size_modification) #define IsSameMode(m1,m2) \ (m1.bits == m2.bits && m1.tag == m2.tag && \ m1.size_modification == m2.size_modification) #define NEXTTABSTOP (0xffff) #define TextExportFormatted(f) ((f)&1) #define TextExportOdif(f) ((f)&2) #define LAYOUT_CONTENT_TAG (MSTextEditorTextTag)(-1) #define FRAME_NO_PIXEL ~((unsigned long)0) /////////////////////////////////////////////////////////////////////////////// // MSTextEditorTypes::Snip /////////////////////////////////////////////////////////////////////////////// MSTextEditorTypes::Snip::~Snip() { if (mode._callback) delete mode._callback; // delete my copy } MSTextEditorTypes::Snip::Snip() { next = (Snip *)0; back = (Snip **)0; tabref = 0; tab = 0; quad = 0; brk = 0; endseq = 0; space = 0; layout = 0; valid = 0; widget = 0; floating = 0; content.widget = (MSWidget *)0; data = (char *)0; length = 0; x = y = xWidth = ascent = descent = offset = 0; mode._callback = (TextFlowCallback*)0; } MSTextEditorTypes::Snip* MSTextEditorTypes::Snip::previous() { return (Snip *)((char *)(back) - OffsetOf(Snip,next)); } MSBoolean MSTextEditorTypes::Snip::hasLayoutContents() { return (MSBoolean)IsLayoutContent(mode.bits); } MSBoolean MSTextEditorTypes::Snip::hasEditableContents() { return (MSBoolean)IsEditableContent(mode.bits); } MSBoolean MSTextEditorTypes::Snip::hasProtectedContents(){ return (MSBoolean)IsProtectedContent(mode.bits);} void MSTextEditorTypes::Snip::callback(TextFlowCallback *cb_) { if (mode._callback) delete mode._callback; mode._callback = new TextFlowCallback(cb_); // create my own copy } MSBoolean MSTextEditorTypes::Snip::activateCallback() { if (callback()) { (*callback()->func())(callback()->owner(), callback()->name()); return MSTrue; } return MSFalse; } // // Insert a new empty Snip before the Snip pointed by 'h'. // Return a pointer to the newly created Snip. // MSTextEditorTypes::Snip *MSTextEditorTypes::Snip::Insert(MSTextEditorTypes::Snip **h) { Snip *t = new Snip; if ((t->next = *h) != NULL) (*h)->back = &t->next; *h = t; t->back = h; t->content.head = NULL; t->data = NULL; t->length = 0; return t; } // // Subtract references to the data header. Returns NULL, if the // header has been released and the header pointer otherwise. // static MSTextEditorTypes::SnipData *derefDataHeader(MSTextEditorTypes::SnipData *head) { if (head == NULL) return (MSTextEditorTypes::SnipData*)0; else if (head->refs == 0); else if (--head->refs == 0) free((void *)head); else return head; return (MSTextEditorTypes::SnipData*)0; } // // Delete Snip pointed by 'h' // void MSTextEditorTypes::Snip::Delete(MSTextEditorTypes::Snip **h) { MSTextEditorTypes::Snip *s = *h; if (s) { if (s->widget) // snip is a child widget ? { if (s->content.widget) // the child widget { s->content.widget->destroy(); s->content.widget = None; } } else s->content.head = derefDataHeader(s->content.head); if ((*h = s->next) != NULL) s->next->back = h; delete s; } } // // Split Snip t into two at delete_offset, and return the pointer to the // *NEW* snip, which represents the fisrt part of the split. // // *** No checks are made. Function assumes the delete_offset <= length. // MSTextEditorTypes::Snip *MSTextEditorTypes::Snip::Split(InsertContext *cx, Snip *t, int delete_offset) { register Snip *r; // // If the Snip has layout information, update expose area // if (t->layout) { cx->updateExposeArea(t->x, t->y - t->ascent, t->xWidth, t->ascent + t->descent); t->layout = t->valid = MSFalse; } // // The new snip is inserted before t, and the leading // data characters are moved to this snip. // r = Snip::Insert(t->back); r->mode = t->mode; r->length = delete_offset; if ((r->data = t->data) != NULL) { if (cx->_first == t) cx->_first = r; t->data += (t->content.head->bytes * delete_offset); r->content.head = t->content.head; r->content.head->refs += 1; } t->length -= delete_offset; return r; } /////////////////////////////////////////////////////////////////////////////// // MSTextEditorTypes::SnipMode /////////////////////////////////////////////////////////////////////////////// MSTextEditorTypes::SnipMode& MSTextEditorTypes::SnipMode::operator=(const MSTextEditorTypes::SnipMode& original_) { if (this != &original_) { bits = original_.bits; tag = original_.tag; size_modification = original_.size_modification; if (_callback) delete _callback; if (original_._callback) _callback = new TextFlowCallback(original_._callback); // create copy else _callback = (TextFlowCallback *)0; // no callback } return *this; } MSTextEditorTypes::SnipMode::~SnipMode() { //if (_callback) delete _callback; } /////////////////////////////////////////////////////////////////////////////// // MSTextEditorTypes::InsertContext /////////////////////////////////////////////////////////////////////////////// // // insertLocation // // Return the TextLocation corresponding the current insert // point. Additionally, if requested, return the current // accumulated expose region (will be reset in this case). // void MSTextEditorTypes::InsertContext::insertLocation( TextLocation *dot, Region expose_) { Snip *s = _last; dot->snip = s; if (s) dot->offset = s->virtualLength(); else dot->offset = 0; if (expose_ && _expose) { XUnionRegion(_expose, expose_, expose_); XDestroyRegion(_expose); _expose = 0; } } MSTextEditorTypes::InsertContext::InsertContext() : _mode(0,0,100), _lock(0,0,100) { _locked = 0; _list = 0; _last = 0; _pendingAccent = 0; _editor = 0; _first = 0; _size = 0; _used = 0; _fontinfo = 0; _head = 0; _ccf = 0; _expose = 0; } MSTextEditorTypes::InsertContext::~InsertContext() { if (_ccf) free(_ccf); } int MSTextEditorTypes::InsertContext::feedContent(const char *s, long n) { ccf_Feed(_ccf, s, n); return 1; } /////////////////////////////////////////////////////////////////////////////// // MSTextEditorTypes::ExposeContext /////////////////////////////////////////////////////////////////////////////// void MSTextEditorTypes::ExposeContext::flushPendingGraphics(MSTextEditorTypes::Snip *, int, int) { } void MSTextEditorTypes::ExposeContext::markArea(MSTextEditorTypes::Snip *s, Drawable, MarkerId id, int x, int y, int h) { register CornerMark *p = &markers[(int)id]; if (p->h != 0) { // Found closing Marker, Draw Area int ascent, descent; int width = x - p->x; switch (id) { case MARK_Framed: MSTextEditor::findExtents(p->s, s, &ascent, &descent); p->y -= ascent; p->h = ascent + descent; if (my_r && XRectInRegion(my_r, p->x, p->y, width, p->h) == RectangleOut) break; /* ::XDrawRectangle(editor->display(), d, editor->gc_Normal(), p->x - _origin->x, p->y - _origin->y, width, p->h); */ /* MSTextEditor *w = editor; XeFrameBorderP *f = w->text.framed_rendition; DrawBorderRectangle ((Widget)w, w->text.mygcBorder, &w->text.line, p->x, p->y, width, p->h, &f[FRAME_LEFT], &f[FRAME_RIGHT], &f[FRAME_TOP], &f[FRAME_BOTTOM], w->text.invert_shadow != 0); */ break; case MARK_Crossed: MSTextEditor::findExtents(p->s, s, &ascent, &descent); p->y -= ascent / 2; // FALL TRHOUGH default: if (my_r && XRectInRegion(my_r, p->x, p->y, width, p->h) == RectangleOut) break; /* ::XFillRectangle(editor->display(), d, editor->gc_Normal(), p->x - _origin.x, p->y - _origin.y, width, p->h); */ break; } } p->s = s; p->x = x; p->y = y; p->h = h; #if 0 #endif } void MSTextEditorTypes::ExposeContext::changeUnderline(MSTextEditorTypes::Snip *s, Drawable d, int x, int y) { switch (p.bits & Underline_MASK) { case Underline_DOUBLE: markArea(s, d, MARK_Double, x, y, 0); case Underline_SINGLE: markArea(s, d, MARK_Single, x, y, 0); break; default: break; } if (s == NULL) return; x = s->x; y = s->y; switch (s->mode.bits & Underline_MASK) { case Underline_DOUBLE: markArea(s, d, MARK_Double, x, y + 3, 1); case Underline_SINGLE: markArea(s, d, MARK_Single, x, y + 1, 1); break; default: break; } } void MSTextEditorTypes::ExposeContext::changeCrossedOut(MSTextEditorTypes::Snip *s, Drawable d, int x, int y) { if (p.bits & CrossedOut_MASK) markArea(s, d, MARK_Crossed, x, y, 0); if (s == NULL) return; x = s->x; y = s->y; if (s->mode.bits & CrossedOut_MASK) markArea(s, d, MARK_Crossed, x, y, 1); } void MSTextEditorTypes::ExposeContext::changeFraming(MSTextEditorTypes::Snip *s, Drawable d, int x, int y) { // Only FRAMED implemented, no ENCIRCLED yet if (p.bits & Framing_MASK) markArea(s, d, MARK_Framed, x, y, 0); if (s == NULL) return; x = s->x; y = s->y; if (s->mode.bits & Framing_MASK) markArea(s, d, MARK_Framed, x, y, 1); } void MSTextEditorTypes::ExposeContext::changeForeground(MSTextEditorTypes::Snip *s, Drawable) { unsigned long pixel; MSTextEditor *e = editor; if (s && (s->mode.bits & Foreground_MASK) && e->color(Foreground_COLOR(s->mode.bits)-1)!=FRAME_NO_PIXEL) pixel = e->color(Foreground_COLOR(s->mode.bits)-1); else pixel = e->foreground(); if (s && (s->mode.bits & ImageInversion_MASK)) e->setBackground(pixel); else e->setForeground(pixel); } void MSTextEditorTypes::ExposeContext::changeBackground(MSTextEditorTypes::Snip *s, Drawable) { unsigned long pixel; MSTextEditor *e = editor; if (s && (s->mode.bits & Background_MASK) && e->color(Background_COLOR(s->mode.bits)-1)!=FRAME_NO_PIXEL) pixel = e->color(Background_COLOR(s->mode.bits)-1); else pixel = e->background(); if (s && (s->mode.bits & ImageInversion_MASK)) e->setForeground(pixel); else e->setBackground(pixel); } /////////////////////////////////////////////////////////////////////////////// // MSTextEditor /////////////////////////////////////////////////////////////////////////////// unsigned long MSTextEditor::color(int n) { return _colors ? _colors[n] : FRAME_NO_PIXEL; } void MSTextEditor::initKeyTable() { if (MSKeyTranslationTable::keyTableData("MSTextEditor")==MSFalse) { keyTranslationTable()->addKeyTableData("MSTextEditor"); unsigned i=0; KT *entry=0; while (EmacsKeyTable[i]._str!=0) { entry = new KT(EmacsKeyTable[i]._func ); keyTranslationTable()->addCallback(EmacsKeyTable[i]._str,entry,"MSTextEditor"); i++; } } else keyTranslationTable()->addKeyTableData("MSTextEditor"); } void MSTextEditor::keyPress(const XEvent *e_, KeySym keysym_, unsigned int state_, const char *b_) { MSKeyPress keyPress(keysym_, state_); if (!keysym_) return; if(keyTranslate(keyPress) == MSFalse && !(state_&(ControlMask|Mod1Mask)) && strlen(b_)==1 && b_[0]) { insert((char*)(void*)b_, 1); setOrigin(); } } // #pragma hdrstop // // FontCacheInfo // Pack Weight, Italic and size information into single keyword. // #define fontCacheInfo(m,size) \ (((m.bits & Weight_MASK) != 0) | \ (((m.bits & Italicized_MASK) != 0) << 1) | \ (size << 2)) class FontCacheEntry { public: unsigned long fontkey; // Posture, weight, size (FontCacheInfo) MSTextEditor::EditorFontList fontlist; // Font List char *charset; // Character Set Id XFontStruct *font; // Associated font }; static FontCacheEntry font_cache[211]; // Size should be a *PRIME* static int cache_hit = 0; // just for temp testing static int cache_miss = 0; static int cache_full = 0; // This should stay ZERO!! static int cache_reset = 0; // Non-zero, if cache should be cleared static Display *cache_display; // Display for which cache is computed. // (If application alternates between two // displays, cache will be almost nullified) void MSTextEditor::insetSnipExtents(LayoutContext *, Snip *t) { if (t->content.widget) { t->xWidth = t->content.widget->width(); t->ascent = t->content.widget->height(); t->descent = 0; } } // // Compute the width of the current Snip // void MSTextEditor::computeWidth(LayoutContext *cx, Snip *t) { static int lastFontHeight; // Last Baseline font height // int tmp; if (lastFontHeight <= 0) lastFontHeight = cx->lineSpacing; switch (t->mode.bits & PartialLine_MASK) { case PartialLine_NONE: cx->yShift = 0; break; case PartialLine_UP: cx->yShift = -(lastFontHeight / 3); break; case PartialLine_DOWN: cx->yShift = lastFontHeight / 3; break; } t->y += cx->yShift; if (t->widget) insetSnipExtents(cx, t); else cx->editor->snipExtents(t); if (t->mode.bits & Framing_MASK && !t->floating) { t->ascent += cx->top_framing; t->descent += cx->bottom_framing; // // NOTE: while framed is MSTrue, the reservation for // frame ending (right_framing) is kept in wNow, and // subtracted when framing explicitly ends. This attempts // to get lines right with wrapping, which requires implicit // ending/start of framing at end of lines. // if (!cx->current.framed) { // Starting framed section, must leave space for the frame graphics // t->xWidth += cx->left_framing; t->offset += cx->left_framing; cx->current.wNow += cx->right_framing; } if (t->hasEndLine() || t->next == NULL || !(Framing_MASK&t->next->mode.bits)) // Ending framed section, must leave space for the frame graphics // (newline breaks framing temporarily { t->xWidth += cx->right_framing; cx->current.wNow -= cx->right_framing; cx->current.framed = MSFalse; } else cx->current.framed = MSTrue; } cx->current.wNow += t->xWidth; tmp = t->ascent - cx->yShift; if (tmp > cx->current.maxAscent) cx->current.maxAscent = tmp; tmp = t->descent + cx->yShift; if (tmp > cx->current.maxDescent) cx->current.maxDescent = tmp; } // // position_XXXX functions will do the appropriate changes into the // Snip chain to achieve the positioning of the content. // // Each will return a pointer to the last Snip that actually is included // into this sequence. Usually it will be the supplied parameter 'last', // except for the TEXT. // // // Do final touches to the line box placement. Compute the amount of // vertical adjustment for the baseline (relative to the baseline of // the previous line) and update all snips within line. // // Returns the vertical movement that was required to move from the // previous baseline to the baseline of this (closed) linebox. // int MSTextEditor::closeLineBox(LayoutContext *cx, Snip *end) { int y_adj = cx->previousExtent; Snip *t; // // Proportional spacing is used only if the line has some content // in it. Otherwise fixed lineSpacing is assumed. // if (cx->editor->_proportional&&(cx->forwardExtent||cx->backwardExtent)) { cx->previousExtent = cx->forwardExtent; y_adj += cx->backwardExtent; } else { cx->previousExtent = cx->lineSpacing / 3; // // If fixed line spacing is selected, then use the backward // extent of current line, if this is the first line. // (otherwise the widget might clip the content) // if (cx->firstLine && cx->backwardExtent > 0) y_adj += cx->backwardExtent; else y_adj += cx->lineSpacing - cx->previousExtent; } for (t = cx->beginLine;;) { t->y += y_adj; if (t == end) break; t = t->next; } cx->firstLine = MSFalse; return y_adj; } // // Do the finishing touches for the positioning functions: // search for endseq etc. // MSTextEditorTypes::Snip *MSTextEditor::wrapUpSequence(LayoutContext *cx, SequenceState *s, Snip *end, int x_adj) { Snip *t; if (end->widget && end->content.widget) { // // Widget Snip has *always* endseq set. This means that // in a sequence, there can be only one Widget, and that // is the terminating Snip (end). Thus, it is sufficient // to check the end only... // end->offset = cx->editor->_set_width - cx->rightWidgetIndent - end->xWidth - end->x - x_adj; if (s->maxAscent > cx->backwardExtent) cx->backwardExtent = s->maxAscent; if (s->maxDescent > cx->forwardExtent) cx->forwardExtent = s->maxDescent; for (t = cx->firstSnip; ;t = t->next) { t->x += x_adj; if (t == end) break; } } return end; } // // Position a TEXT sequence. // // last the last Snip actually taking part in positioning. // // end the actual Snip ending the sequence (this differs // from last, if line end contains spaces). // MSTextEditorTypes::Snip *MSTextEditor::position_TEXT(LayoutContext *cx, SequenceState *text, Snip *last, Snip *end) { int offset = cx->lineOffset; int wExtra = cx->lineLength - text->wNow; Alignment alignment; // // Force START aligment, if no real lineLength or if the sequence // is actually ended with Horizontal TAB. Use the alignment given // by the resource, unless the Snip specifies it explicitly by // Justify_MODE. // if (cx->lineLength <= 0 || (end->tab && end->tabref == NEXTTABSTOP)) alignment = START; else if (end->quad) alignment = (Alignment)end->quad; else if (end->mode.bits & Justify_MASK) alignment = Justify_MODE(end->mode.bits); else alignment = cx->editor->_alignment; alignment = JUSTIFIED; switch (alignment) { default: case START: break; case END: offset += wExtra; break; case CENTER: offset += wExtra / 2; break; case JUSTIFIED: // // For the justifying to be applicable, the line // must include adjustable spaces, there must be // positive amount of loose space. Additionally, // unless this is "forced quad", this must not be the // "hard line end" or last line of the block. // if (text->spaces && wExtra > 0 && (end->quad || (IsLayoutContent(end->mode.bits) && end->next != NULL))) { Snip *t; int wSpace = wExtra / text->spaces; int adjust = 0; text->wNow += wExtra; wExtra -= text->spaces * wSpace; for (t = cx->firstSnip; t != last; t = t->next) { if (t->space) { adjust += wSpace; if (wExtra) { adjust += 1; wExtra -= 1; } } t->x += adjust; } for (;; t = t->next) { t->x += adjust; if (t == end) break; } } break; } return wrapUpSequence(cx, text, end, offset); } // // Position ITEM identifier // MSTextEditorTypes::Snip *MSTextEditor::position_ITEM( LayoutContext *cx, SequenceState *item, Snip *last) { int offset; // // Compute the offset of the item from the line home position, // taking alignment into account. // if (cx->editor->_itemization->identifier_alignment == START) offset = cx->editor->_itemization->identifier_start_offset; else { offset = cx->editor->_itemization->identifier_end_offset - item->wNow; // // Non-ODA implementation addition: if the item would be // positioned outside the available area, then start it // from the start edge of the available area. // if (offset + cx->editor->_indentation < 0) offset = -cx->editor->_indentation; } // // If a floating widget is on the left, compute as if line home // position was to the right of it.. (does not really work! --msa) // offset += cx->leftWidgetIndent; return wrapUpSequence(cx, item, last, offset); } // // LookFor // Search for characters from a bounded string. Return // a pointer to the first character found or NULL, if none. // (comparable with strpbrk). // char *MSTextEditor::lookFor(char *d, char *s, int n) { unsigned char c; register unsigned char *p; unsigned char *q = (unsigned char *)s + n; if (d == NULL || s == NULL || n <= 0) return NULL; // This really means erroneus call.. // for ( ; (c = *d) != 0; d++) for (p = (unsigned char *)s; p < q; ++p) if (*p == c) return (char *)p; return NULL; } // // Split the line from the specified Snip (s) and return a pointer // to a Snip that will belong to the next line. // MSTextEditorTypes::Snip *MSTextEditor::splitLine(LayoutContext *cx, SequenceState *text, Snip *last) { Snip *t = last; Snip *s; int x, y; x = t->x; y = t->y; // // Eat up all extra spaces to the end of the line // for ( ; ; ) { if (t->space) { t->xWidth = 0; t->x = x; t->y = y; } if (t->endseq) break; s = t->next; if (s == NULL || !s->space) break; t = s; } // // If the last element doesn't end the sequence, then generate // the line ending sequence here. // if (!t->endseq) { if (text->framed) // Reserve space for the framing end // t->xWidth += cx->right_framing; s = Snip::Insert(&t->next); s->endseq = EndLine; s->mode = t->mode; s->mode.bits &= ~Content_MASK; s->mode.bits |= Content_FORMATTED; s->mode.tag = LAYOUT_CONTENT_TAG; s->layout = MSTrue; s->valid = MSTrue; s->x = x; s->y = y; t = s; } return position_TEXT(cx, text, last, t); } // // Extend expose area from the Snip // void MSTextEditor::updateExposeArea(XRectangle *r, int x, int y, int width, int height) { if (width == 0 || height == 0) return; if (r->width == 0) { r->x = x; r->y = y; r->width = width; r->height = height; } else { if (x < r->x) { r->width += r->x - x; r->x = x; } if (x + width > r->x + r->width) r->width = x + width - r->x; if (y < r->y) { r->height += r->y - y; r->y = y; } if (y + height > r->y + r->height) r->height = y + height - r->y; } } // // Compare Snips in the line box to the saved coordinates of the // previous Snips. Update expose region to cover all changes. // // Return 'mode', which has the following interpretation // // mode=-1 searching for valid=MSFalse position, // mode=1 have found valid=MSFalse, now searching for valid=MSTrue, // mode=0 have found valid=MSTrue, layout process can break now. // mode=2 do not search for anything. Layout will not terminate // until end of content. // #define LOOKFOR_MODE (-1) #define LOOKFOR_NONE 2 int MSTextEditor::updateExpose(XRectangle *expose, ExpectEntry *start, ExpectEntry *end, Snip *last, int mode) { int changes = 0; Snip *s; if (!expose) { for ( ;start < end && (s = start->s) != last; start++) { if (IsEditableContent(s->mode.bits)) { if (!s->valid || start->x != s->x || start->y != s->y) changes++; if (s->valid) { if (mode == 1) mode = 0; } else if (mode == -1) mode = 1; } s->layout = s->valid = MSTrue; } } else for ( ;start < end && (s = start->s) != last; start++) { updateExposeArea(expose, s->x, s->y - s->ascent, s->xWidth, s->ascent + s->descent); if (IsEditableContent(s->mode.bits)) { if (!s->valid || start->x != s->x || start->y != s->y) { changes++; if (s->layout) updateExposeArea (expose, start->x, start->y - start->ascent, start->xWidth, start->ascent+start->descent); } if (s->valid) { if (mode == 1) mode = 0; } else if (mode == -1) mode = 1; } s->layout = s->valid = MSTrue; } // // Restore the original (x,y) for the snips that were processed, // but didn't get included into the linebox. // while (start < end) { start->s->x = start->x; start->s->y = start->y; start->s->xWidth = start->xWidth; start->s->ascent = start->ascent; start->s->descent = start->descent; start->s->offset = start->offset; start++; } return mode ? mode : changes != 0; } // // checks if the terminating inset Snip has a widget that is // floated to the start/end of sequence and activates a // wraparound. In that case one has to use only the 'x' from // the widget and ignore the xWidth. (The real positioning of // the widget is made by offset field). // int MSTextEditor::adjustForWidgets(LayoutContext *, Snip *s) { if (s->widget && s->content.widget) { if (s->floating) { // should handle alignment of floating widgets return s->x; } } return s->x + s->xWidth; } void MSTextEditor::snipExtents(MSTextEditorTypes::Snip *snip_) { XCharStruct XE; int dir, fontAscent, fontDescent; SnipData *h = snip_->content.head; if (h == NULL) { snip_->xWidth = snip_->ascent = snip_->descent = snip_->offset = 0; return; } // if (h->font == NULL) // { // h->font = findFont(0, 0, Font_NUMBER(snip_->mode.bits), 0, 0, 0); // } if (h->font == NULL) // chris, was 0 && { // // Font struct still undefined, load it // int fn = Font_NUMBER(snip_->mode.bits); EditorFontList fId; int hit, i; int pSize; unsigned long fontkey; if (fn >= _num_fonts) fn = 0; // Try for default font if (_fonts == NULL || _num_fonts == 0) { pSize = _line_spacing; // or lineSpacing? fId = 0; } else { pSize = _fonts[fn].font_size; fId = _fonts[fn].font_list; } if (snip_->mode.size_modification) pSize = (snip_->mode.size_modification * pSize + 50) / 100; fontkey = (unsigned long)fontCacheInfo(snip_->mode, pSize); hit = ((fontkey ^ (unsigned long)h->character_set) ^ (unsigned long)fId) % NumberOf(font_cache); for (i = hit ;; ) { if (font_cache[i].font == 0) { cache_miss++; break; } else if (font_cache[i].fontkey == fontkey && font_cache[i].fontlist == fId && font_cache[i].charset == h->character_set) { cache_hit++; break; } i += 1; if (i == NumberOf(font_cache)) i = 0; if (i == hit) { // // Nasty thing.. should really not happen. // Just take over the first hash entry. Not // really right solution, but we assume for // now that we really don't get here... // font_cache[i].font = 0; cache_full++; cache_reset = MSTrue; } } if (font_cache[i].font == 0) { font_cache[i].fontkey = fontkey; font_cache[i].fontlist = fId; font_cache[i].charset = h->character_set; font_cache[i].font = findFont(h->character_set, fId, Font_NUMBER(snip_->mode.bits), snip_->mode.bits & Weight_MASK, snip_->mode.bits & Italicized_MASK, pSize); } h->font = font_cache[i].font; } if (h->bytes == 2) XTextExtents16((XFontStruct *)h->font, (XChar2b *)snip_->data, snip_->length, &dir, &fontAscent, &fontDescent, &XE); else XTextExtents((XFontStruct *)h->font, snip_->data, snip_->length, &dir, &fontAscent, &fontDescent, &XE); snip_->xWidth = XE.width; // // Using Font ascent/descent gives better result for now.. // snip_->ascent = fontAscent; snip_->descent = fontDescent; snip_->offset = 0; } XFontStruct *MSTextEditor::findFont(char *, EditorFontList, int font_nr, int, int, int) { const XFontStruct *f; if (font_nr > 0 && font_nr < _n_font_names) { f=server()->fontStruct(server()->fontID(_font_names(font_nr))); } else { f= server()->fontStruct(font()); } if(f!=0) { if(vsb()!=0) vsb()->inc(f->max_bounds.ascent+f->max_bounds.descent); if(hsb()!=0) hsb()->inc(f->max_bounds.width); } return (XFontStruct*)f; } const int LEFTWIDGETINDENT = 0; const int RIGHTWIDGETINDENT = 3; #define LOOKFOR_MODE (-1) #define LOOKFOR_NONE 2 // // Layout widget character content into widget *internal* // "Processable Formatted Form". This function can be called // any number of times. // // from = NULL, redo the layout fully, ignore all existing // old layout information. // // from != NULL, start layout process from the first possible // linebox before this point (Snip). // // If expose is non-NULL, the pointed XRectangle will be expanded // to contain the area of the layout (usefull only if from != NULL). // The rectangle must be properly initialize before call // (expose->width = 0 is sufficient to make area initially empty). // // set_width is the new target width of the layout process // void MSTextEditor::layout(int set_width, Snip *from, Region expose_region) { typedef enum { Sequence_TEXT, Sequence_ITEM, Sequence_STAB } LayoutSequence; // // lay, addLayout // if addLayout == non-zero, then we are processing application // inserted layout content before the Snip pointed by 'lay'. // (note! lay may also be NULL, if inserting occurs after // the last editable Snip). When addLayout == 0, 'lay' is // NULL. A special value -1 is used when the layout process // should start in addLayout mode, but not call BEGIN_LINE // callbacks. // expect_default, expect, expect_point, expect_end // are used in line building to detect when layout hits a point // that doesn't change. Fixed array expect_default is used and // it should be sufficient for most cases. However, the code // is prepared to allocate a larger array dynamically on demand. // Snip *s, *p, **h, *lay; MSTextEditorTextTag tag; int i, x, y, yHighMark, xHighMark; ExpectEntry expect_default[200]; ExpectEntry *expect, *expect_point = &expect_default[0]; ExpectEntry *expect_end = &expect_default[NumberOf(expect_default)]; int layout = _format; int lookfor, tabref, firstSeq, addLayout, itemization; LayoutSequence sequence; XRectangle expose_rect, *expose; LayoutContext cx; static LayoutContext init_cx = {0, 0,0,0,0, 0,0,0,0,0,0,0, 0,0,0, 0,0, 0,0}; cx = init_cx; // // Keep track of the bounding box of exposed area only if // expose_region is requested by the caller. (Init box to empty) // expose_rect.width = 0; expose = expose_region ? &expose_rect : NULL; // // Initialize the global state // if (cache_display != display() || cache_reset) { for (i = 0; i < NumberOf(font_cache); i++) { // if(font_cache[i].font!=0) XFreeFont(display(),font_cache[i].font); font_cache[i].font = 0; } cache_hit = 0; cache_miss = 0; cache_reset = 0; cache_display = display(); } if (set_width != _set_width) from = NULL; if (set_width <= 0) layout = MSFalse; _set_width = set_width; cx.editor = this; cx.lineSpacing = _line_spacing; cx.firstLine = MSTrue; firstSeq = MSTrue; if (1 || cx.lineSpacing == 0) { // // If lineSpacing == 0, then the default lineSpacing // will be the font height of the primary (default) font // using the default character set. Unfortunately, one // needs to do some complex stuff to get it... // #if 1 // // This code is buggy. It causes a memory leak while freeing heads. // Snip *list = NULL; s = Snip::Insert(&list); s->content.head = (SnipData *)calloc(1, OffsetOf(SnipData, s[0])); s->data = &s->content.head->s[0]; s->content.head->bytes = 1; s->content.head->refs = 1; s->content.head->font = NULL; s->content.head->character_set = charsetDefault(); snipExtents(s); // ..assuming fontAscent and fontDescent are put into Snip // cx.lineSpacing = s->descent + s->ascent; Snip::Delete(&list); #else cx.lineSpacing = _defaultFontSize; #endif } _line_spacing = cx.lineSpacing; yHighMark = cx.previousExtent = 0; cx.leftWidgetIndent = LEFTWIDGETINDENT; cx.rightWidgetIndent = RIGHTWIDGETINDENT; // // Initialize layout breaking parameters // y = 0; x = _indentation; h = &_first; tag = 0; lay = NULL; addLayout = MSFalse; if (from == NULL) { _x = x; _y = y; xHighMark = 0; lookfor = LOOKFOR_NONE; } else { int gotcha, editable, base_y, max_y, min_y; // // Skip over already laid out material, start layout from the // beginning of the previous line from the line has been // modified. // for (s = from; ;s = s->next) if (s == NULL) return; // Nothing to layout else if (!s->valid) break; // // Search backwards for the line end marker from // which a new layout process can be started. It will // be the first line end having one of the following // conditions: // - line end is an editable hard line end, or // - line end is followed by valid layout which includes // an editable space, or // - line end is followed by a full valid line which // includes at least one valid editable component. // for (gotcha = MSFalse, editable = 0;;) { if (s->back == &_first) break; s = s->previous(); if (!s->valid) { gotcha = MSFalse; editable = 0; continue; } if (s->hasEditableContents()) { editable += 1; if (s->space) gotcha = MSTrue; else if (s->hasEndLine()) break; } else if (s->hasEndLine()) { if (gotcha && editable) break; else { gotcha = MSTrue; editable = 0; } } } // // Now 's' points to the Snip (HasEndLine) *AFTER* which // the new layout will start. If the proportional spacing has // has been requested, we have to "guess" the forwardExtent // of the preceding line is, and set previousExtent from it. // If the line is has only white space or no proportional // spacing, use formula "lineSpacing / 3". // Additionally, have to find out the initial value for the // previous 'tag'. // p = s; gotcha = MSFalse; base_y = max_y = min_y = p->y; do { if (!gotcha && p->hasEditableContents()) { tag = p->mode.tag; gotcha = MSTrue; } if (!p->floating) { if (p->y + p->descent > max_y) max_y = p->y + p->descent; if (p->y - p->ascent < min_y) min_y = p->y - p->ascent; } if (p->back == &_first) break; p = p->previous(); } while (!p->hasEndLine()); if (_proportional && (max_y - min_y) > 0) { cx.previousExtent = max_y - base_y; } else cx.previousExtent = cx.lineSpacing / 3; // // Do we have the 'tag'? If not, search more backwards... // if (!gotcha) { while (!p->hasEditableContents() && p->back != &_first) p = p->previous(); tag = p->mode.tag; } if (s->back == &_first) { tag = 0; cx.previousExtent = 0; } else { cx.firstLine = MSFalse; yHighMark = y = s->y; firstSeq = s->hasEndParagraph(); h = &s->next; } // // If the starting point is application generated layout // information, the actual layout process must start in // "add layout" mode until next editable content. Also, // assume the tag change has already been processed at // this point. // if (!s->hasEditableContents() && s->mode.tag != LAYOUT_CONTENT_TAG) for (p = s; (p = p->next) != NULL; ) if (p->hasEditableContents()) { lay = p; addLayout = -1; tag = p->mode.tag; break; } xHighMark = pWidth(); lookfor = LOOKFOR_MODE; } // from != NULL cx.lineOffset = 0; p = cx.beginLine = NULL; while (*h) { static SequenceState initial = {0,0,0,0}; Snip *space = NULL; // Set Non-NULL, if last space found // cx.current = initial; // Initialize 'current' state // cx.current.tag = tag; cx.firstSnip = *h; if (cx.beginLine == NULL) { cx.beginLine = cx.firstSnip; cx.forwardExtent = 0; cx.backwardExtent = 0; itemization = MSFalse; expect = expect_point; if (firstSeq && _itemization && _itemization->identifier_alignment != NOALIGNMENT) sequence = Sequence_ITEM; else { sequence = Sequence_TEXT; if (firstSeq) cx.lineOffset += _first_line_offset; } firstSeq = MSFalse; } x = _x; cx.yShift = 0; cx.lineLength = set_width - _indentation - cx.lineOffset - cx.rightWidgetIndent; do { // // Locate the next Snip to process. Delete all // Snips generated by the previous layout process. // If the content ends without a proper endseq // Snip, then add one on behalf of the layout process. // while (1) { if ((s = *h) == NULL) { s = Snip::Insert(h); s->endseq = End; s->mode.bits &= ~Content_MASK; s->mode.bits |= Content_FORMATTED; s->mode.tag = LAYOUT_CONTENT_TAG; if (cx.firstSnip == NULL) cx.firstSnip = s; if (cx.beginLine == NULL) cx.beginLine = s; break; } else if (addLayout) break; else if (s->hasLayoutContents()) { if (s == cx.firstSnip) p = cx.firstSnip = s->next; if (s == cx.beginLine) cx.beginLine = s->next; if (expose && s->layout && s->xWidth) updateExposeArea(expose, s->x, s->y - s->ascent, s->xWidth, s->ascent+s->descent); Snip::Delete(h); } else if (tag != s->mode.tag) { } else { cx.current.tag = tag = s->mode.tag; break; } } if (lay == s) { // Layout Insertion terminated // addLayout = MSFalse; lay = NULL; tag = cx.current.tag = s->mode.tag; } if (expect == expect_end) { ExpectEntry *e = expect_point; int old_expect = expect_end - expect_point; int new_expect = old_expect + NumberOf(expect_default); if (expect_point == expect_default) { expect_point = (ExpectEntry *)calloc(new_expect, sizeof(ExpectEntry)); memcpy((void *)expect_point, (void *)e, sizeof(ExpectEntry) * old_expect); } else expect_point = (ExpectEntry *) realloc((char *)expect_point, sizeof(ExpectEntry) * new_expect); expect = &expect_point[old_expect]; expect_end = &expect_point[new_expect]; } expect->s = s; expect->x = s->x; expect->y = s->y; expect->xWidth = s->xWidth; expect->ascent = s->ascent; expect->descent = s->descent; expect->offset = s->offset; expect++; s->x = x; s->y = y; if (0 && s->widget) s->content.widget->moveTo(s->x - _origin.x, s->y - _origin.y - (s->ascent + s->descent)); // // All snips before the current one (s) will // fit into the line. If the current one // represents a valid breaking point, remember // this point by saving the line state into // 'lastSpace' *before* adding any effects // from this snip. (used by TEXT sequence only) // if (s->space) { cx.lastSpace = cx.current; space = s; cx.current.spaces += 1; } computeWidth(&cx, s); // // Do the line splitting only if new layout is // requested. // switch (sequence) { case Sequence_ITEM: if (s->endseq) { s = position_ITEM(&cx, &cx.current, s); itemization = MSTrue; sequence = Sequence_TEXT; } break; case Sequence_STAB: if (s->endseq) s = (Snip*)0; //position_STAB(&cx, &cx.current, s, tabref); break; default: if (layout && cx.current.wNow > cx.lineLength && space) { s = splitLine(&cx,&cx.lastSpace,space); tag = cx.lastSpace.tag; } else if (s->endseq) s = position_TEXT(&cx,&cx.current,s,s); break; } y = s->y - cx.yShift; x = s->x + s->xWidth; h = &s->next; p = s; } while (!s->endseq); if (s->widget) { x = adjustForWidgets(&cx, s); _x = x; } else _x = 0; if (x > xHighMark) xHighMark = x; if (s->hasEndLine()) { y += closeLineBox(&cx, s); lookfor = updateExpose(expose, expect_point, expect, s->next, lookfor); if (!lookfor) { if (xHighMark > pWidth()) xHighMark=xHighMark; // should set pWidth() to xHighMark goto clean_up; } cx.beginLine = NULL; } if (y > yHighMark) yHighMark = y; sequence = Sequence_TEXT; if (s->tab) { if ((tabref = s->tabref) == NEXTTABSTOP) { x = x+60; // HorizontalTab(&cx, x, &tabref); if (tabref != NEXTTABSTOP) sequence = Sequence_STAB; } else sequence = Sequence_STAB; } if (s->hasEndLine()) { // // The next line will start a new line box // cx.lineOffset = 0; firstSeq = s->hasEndParagraph(); } else { // // This was just end of some sequence within the // same line box. Continue filling the box from // the current point. (Because lineOffset is relative // to the "home position", indentation must be // subtracted from the absolute 'x'). // cx.lineOffset = x - _indentation; // // If the sequence just ended was an 'item' then // the next sequence should start from the home // position adjusted with the first_line_offset. // // Additional Non-ODA(?) implementation: if the // item would overlap the normal text, then do not // use the fixed start (instead, just continue // filling the line from where the item ended). // if (itemization && cx.lineOffset < _first_line_offset) cx.lineOffset = _first_line_offset; } itemization = MSFalse; } if (p && p->hasEndLine()) { // // The content terminated by End of Line. This means that // the content includes one *EMPTY* line at end. (This is // ODA character content interpretation). // y += cx.previousExtent + cx.lineSpacing; } else if (cx.beginLine) { y += closeLineBox(&cx, s); (void)updateExpose(expose, expect_point, expect, p->next, 0); y += cx.previousExtent; } else { y += cx.lineSpacing; // Empty Content! // } if (y > yHighMark) yHighMark = y; yHighMark=yHighMark; // should set pHeight() to xHighMark xHighMark=xHighMark; // should set pWidth() to xHighMark clean_up: if (expose && expose->width > 0) XUnionRectWithRegion(expose, expose_region, expose_region); if (expect_point != expect_default) free((char *)expect_point); return; } static char iso8859_1[] = "iso8859-1"; char *MSTextEditor::charsetDefault() { return iso8859_1; } int MSTextEditor::copy1_GL(InsertContext *cx, int n, unsigned char *s, unsigned char *, char *cset) { Snip *t; SnipData *head; register unsigned char c, *p; if (n == 0) return 0; if (cx == NULL || (t = cx->beginAppend(n, cset, 1)) == NULL) return 1; head = t->content.head; p = (unsigned char *)t->data + (head->bytes * t->length); // // This special kludge/hook is required to map ISO 6937 floating // accents into plain ISO 8859-1 characters. Not a pretty sight, // there must be a neater way... --msa // If accent combination is not found, the accent is ignored. // #if 0 if (cset == iso8859_1 && // Should probably test for all iso8859's //..and in real word should expect floating //accents from one character set combined //with character from another.. ugh... --msa // cx->_pendingAccent != 0) { int *q, i; c = *s & 0x7f; i = COMBINE(cx->_pendingAccent, c); for (q = T51diatrical_ISO8859_1; *q; ++q) if (*q++ == i) { *p++ = *q; t->length += 1; n -= 1; s += 1; break; } } cx->_pendingAccent = 0; #endif for ( ; n > 0; ++s, --n ) { c = *s & 0x7f; if (c == 0x20) { if (!t->space && (t->endseq || t->length > 0)) { t = cx->appendSnip(); t->data = (char *)p; t->content.head = head; head->refs += 1; } t->valid = MSFalse; t->space = MSTrue; } else if (t->space) { t = cx->appendSnip(); t->data = (char *)p; t->content.head = head; head->refs += 1; } *p++ = c; t->length += 1; } return 0; } // #pragma hdrstop const int DefaultScrollBarSize = 15; const char *MSTextEditor::GRSetFontDefault = "\033[10m"; const char *MSTextEditor::GRSetFont1 = "\033[11m"; const char *MSTextEditor::GRSetFont2 = "\033[12m"; const char *MSTextEditor::GRSetFont3 = "\033[13m"; const char *MSTextEditor::GRSetFont4 = "\033[14m"; const char *MSTextEditor::GRSetFont5 = "\033[15m"; const char *MSTextEditor::GRSetFont6 = "\033[16m"; const char *MSTextEditor::GRSetFont7 = "\033[17m"; const char *MSTextEditor::GRSetFont8 = "\033[18m"; const char *MSTextEditor::GRSetFont9 = "\033[19m"; const char *MSTextEditor::GRSetForegroundDefault = "\033[39m"; const char *MSTextEditor::GRSetForegroundBlack = "\033[30m"; const char *MSTextEditor::GRSetForegroundRed = "\033[31m"; const char *MSTextEditor::GRSetForegroundGreen = "\033[32m"; const char *MSTextEditor::GRSetForegroundYellow = "\033[33m"; const char *MSTextEditor::GRSetForegroundBlue = "\033[34m"; const char *MSTextEditor::GRSetForegroundMagenta = "\033[35m"; const char *MSTextEditor::GRSetForegroundCyan = "\033[36m"; const char *MSTextEditor::GRSetForegroundWhite = "\033[37m"; const char *MSTextEditor::GRSetBackgroundDefault = "\033[49m"; const char *MSTextEditor::GRSetBackgroundBlack = "\033[40m"; const char *MSTextEditor::GRSetBackgroundRed = "\033[41m"; const char *MSTextEditor::GRSetBackgroundGreen = "\033[42m"; const char *MSTextEditor::GRSetBackgroundYellow = "\033[43m"; const char *MSTextEditor::GRSetBackgroundBlue = "\033[44m"; const char *MSTextEditor::GRSetBackgroundMagenta = "\033[45m"; const char *MSTextEditor::GRSetBackgroundCyan = "\033[46m"; const char *MSTextEditor::GRSetBackgroundWhite = "\033[47m"; Bool double_buffering = MSTrue; MSTextEditor::MSTextEditor(MSWidget *parent_,const char *title_) : MSWidgetCommon(parent_, title_) { init(); } MSTextEditor::MSTextEditor(MSWidget *parent_,const MSStringVector&) : MSWidgetCommon(parent_, "No Title") { init(); } MSTextEditor::~MSTextEditor(void) { deleteWholeContents(); if (_inserting) delete _inserting; delete _pixmap; if (_regions) delete [] _regions; freeColors(); // for (int i = 0; i < NumberOf(font_cache); i++) // if (font_cache[i].font) XFreeFont(display(), font_cache[i].font); delete _cursor; XFreeGC( display(), gc_Normal() ); XFreeGC( display(), gc_XOR() ); if (blinkTimer()) delete _blinkTimer; if (vsb()) delete _vsb; if (hsb()) delete _hsb; if (panner()) delete _panner; } void MSTextEditor::readonly(MSBoolean mode_) { _readonly = mode_; } MSBoolean MSTextEditor::readonly() { return _readonly; } void MSTextEditor::init() { _pixmap = new MSBackingStorePixmap(server(),"MSGeneral"); _pixmap->resize(100,100); _readonly = MSFalse; _alignment = START; _column_width = 0; _content_file = NULL; _content_length = 0; _content_offset = 0; _content_stream = NULL; _content_string = NULL; _export_format = ODIF; _first_line_offset = 0; _fonts = NULL; _num_fonts = 0; _format = MSTrue; _indentation = 0; _initial_state = NULL; _graphic_rendition = NULL; _itemization = NULL; _kerning_offset = NULL; _line_layout_table = NULL; //_line_spacing = font; _line_spacing = 0; _defaultFontSize = 12; _proportional = MSFalse; //_proportional = MSTrue; _mult = 1; _num_regions = 1; _max_regions = 1; _regions = (TextRegion *)new TextRegion[1]; _regions[0].mode = REVERSE; _cursor = new InsertCursor(display(), pixmap()); _refresh = 0; _insert_prefix = NULL; _insert_prefix_length = 0; _colors = NULL; _color_names = 0; _font_names = 0; _origin.x = 0; _origin.y = 0; _panner=new Panner(this); XGCValues values; values.foreground=foreground(); values.background=background(); _mygc = XCreateGC(display(), panner()->window(), GCForeground|GCBackground, &values); values.foreground=foreground()^background(); values.background=background(); values.function=GXxor; _mygcXOR = XCreateGC(display(), panner()->window(), GCForeground|GCBackground|GCFunction, &values); XSetLineAttributes(display(), gc_Normal(), 1, LineSolid, CapButt, JoinMiter); _first = (Snip*)0; _inserting = (InsertContext*)0; _set_width = -1; // Initialize to impossible value // _highlight = MSFalse; _enable_display = 0; _vsb = new Vsb(this); _hsb = new Hsb(this); _vsb->shadowThickness( 10 ); setupContent(MSTrue, MSTrue); acceptFocus(MSTrue); selectInput(ExposureMask|ButtonPressMask|ButtonMotionMask|ButtonReleaseMask); addToFocusList(); initKeyTable(); _cmap = 0; setColors("black\nred\ngreen\nyellow\nblue\nmagenta\ncyan\nwhite"); setFonts("\ -*-courier--r-normal--12-*\n\ -*-courier-bold-r-normal--12-*\n\ -*-courier--r-normal--24-*\n\ -*-courier-bold-r-normal--24-*\n\ fixed\n\ -*-helvetica--r-normal--12-*\n\ -*-helvetica-bold-r-normal--12-*\n\ -*-helvetica--r-normal--24-*\n\ -*-helvetica-bold-r-normal--24-*"); _blinkTimer=new CursorTimer(this,MSTextEditorDefaultBlinkRate); } MSTextEditor::InsertCursor* MSTextEditor::cursor() { return _cursor; } void MSTextEditor::setColors(const MSStringVector color_names_) { _color_names = color_names_; _n_color_names = _color_names.length(); initColors(); } void MSTextEditor::setFonts(const MSStringVector font_names_) { _font_names = font_names_; _n_font_names = _font_names.length(); } void MSTextEditor::updateFont(Font /*oldFid_*/) { cache_reset=1; Snip *s=_first; while(s) { if(s->content.head!=0 && s->content.head->font!=0) //&& oldFid_==s->content.head->font->fid) s->content.head->font=0; s=s->next; } layout(_column_width > 0 ? _column_width : pWidth(), 0, 0); redrawImmediately(); } void MSTextEditor::updateForeground(unsigned long oldbg_) { MSWidgetCommon::updateForeground(oldbg_); panner()->foreground(foreground()); vsb()->foreground(foreground()); hsb()->foreground(foreground()); redraw(); } void MSTextEditor::updateBackground(unsigned long oldbg_) { MSWidgetCommon::updateBackground(oldbg_); panner()->background(background()); vsb()->background(background()); hsb()->background(background()); redraw(); } void MSTextEditor::configure() { _pixmap->resize(width(),height()); XRectangle clipRect[1]; clipRect[0].x=0; clipRect[0].y=0; clipRect[0].width=pWidth(); clipRect[0].height=pHeight(); XSetClipRectangles(display(),gc_Normal(),0,0,&clipRect[0],1,Unsorted); panner()->resize(pWidth(), pHeight()); if (panner()->mapped()==MSFalse) panner()->map(); vsb()->moveTo(pWidth() + offset(), offset()); vsb()->height(pHeight()); hsb()->moveTo(offset(), pHeight() + offset()); hsb()->width(pWidth()); updateScrollbars(); } void MSTextEditor::unfreeze() { _enable_display += 1; if (_enable_display == 0) { layout(_column_width > 0 ? _column_width : pWidth(), 0, 0); redrawImmediately(); } } void MSTextEditor::freeze() { _enable_display -= 1; } void MSTextEditor::redraw() { if (_enable_display >= 0) redrawImmediately(); } typedef int (*F_DRAW16)(Display *,Drawable,GC,int,int,const XChar2b *,int); typedef int (*F_DRAW)(Display *,Drawable,GC,int,int,const char *,int); void MSTextEditor::redisplay(XExposeEvent *e, Region r, Drawable d) { if (_enable_display < 0) return; _pixmap->lock(); Snip *s; int x, y; XRectangle clip; ExposeContext cx; F_DRAW16 f_draw16; F_DRAW f_draw; cx.my_r = r; cx.editor = this; if (cx.my_r == NULL && e != NULL) { // // No Region, make one from exposed area. This should be // exceptional, widgets should have the compress exposures // mode set and always have a region! // clip.x = e->x; clip.y = e->y; clip.width = e->width; clip.height = e->height; cx.my_r = XCreateRegion(); XUnionRectWithRegion(&clip, cx.my_r, cx.my_r); } if (cx.my_r) { XClipBox(cx.my_r, &clip); clip.x -= _origin.x; clip.y -= _origin.y; Region clip_region = XCreateRegion(); XUnionRectWithRegion(&clip, clip_region, clip_region); //XSetRegion(display(), gc_Normal(), clip_region); //XSetRegion(display(), gc_XOR(), clip_region); XDestroyRegion(clip_region); } else { XSetClipMask(display(), gc_Normal(), None); XSetClipMask(display(), gc_XOR(), None); } XSetBackground(display(), gc_Normal(), background()); if (e == NULL) { // // If the XEvent parameter is NULL, then assume this is // internally generated expose event and the covered // area is not necessarily initially cleared. Clear the // area covered by the expose region (my_r). [The following // code is the simplest I could invent for the task, if // anyone has better, let me know --msa]. // When also the Region is not given, make this a special // case that refreshes the whole window. // if (cx.my_r) { XClipBox(cx.my_r, &clip); XFillRectangle(display(), d, backgroundShadowGC(), clip.x - _origin.x,clip.y - _origin.y, clip.width, clip.height); } else XFillRectangle(display(), d, backgroundShadowGC(), 0, 0, pWidth(), pHeight()); } if (cx.my_r) // repair the right area.. { XClipBox(cx.my_r, &clip); XUnionRectWithRegion(&clip, cx.my_r, cx.my_r); } markSelection(d); f_draw16 = (F_DRAW16) ::XDrawString16; f_draw = (F_DRAW) ::XDrawString; y = _y; x = _x; for (s = _first; s; s = s->next) { if ((unsigned int)s->widget == MSTrue) s->content.widget->moveTo(s->x - _origin.x, s->y - _origin.y - (s->ascent + s->descent)); SnipData *h = s->content.head; unsigned int m = cx.p.bits ^ s->mode.bits; if (m) { //if (m & CrossedOut_MASK) cx.changeCrossedOut(s, d, x, y); //if (m & Underline_MASK) cx.changeUnderline(s, d, x, y); //if (m & Framing_MASK) cx.changeFraming(s, d, x, y); if (m & (Background_MASK|ImageInversion_MASK)) cx.changeBackground(s, d); if (m & (Foreground_MASK|ImageInversion_MASK)) cx.changeForeground(s, d); if (s->mode.bits&(ImageInversion_MASK|Background_MASK)) { f_draw16 = (F_DRAW16) ::XDrawImageString16; f_draw = (F_DRAW) ::XDrawImageString; } else { f_draw16 = (F_DRAW16) ::XDrawString16; f_draw = (F_DRAW) ::XDrawString; } } cx.p = s->mode; x = s->x; y = s->y; if (!s->space && s->xWidth > 0 && s->data != NULL && (cx.my_r == NULL || XRectInRegion(cx.my_r, x, y - s->ascent, s->xWidth, s->ascent + s->descent) != RectangleOut) ) { XSetFont(display(), gc_Normal(), h->font->fid); if (h->bytes == 2) (*f_draw16)(display(), d, gc_Normal(), (int)x + s->offset - _origin.x, (int)y - _origin.y, (XChar2b *)s->data, s->length); else (*f_draw)(display(), d, gc_Normal(), (int)x + s->offset - _origin.x, (int)y - _origin.y, s->data, s->length); } if (!s->floating) x += s->xWidth; if (s->hasEndLine() && (cx.p.bits&(Underline_MASK|CrossedOut_MASK|Framing_MASK))) cx.flushPendingGraphics(s->next, x, y); } cx.flushPendingGraphics(s, x, y); // In case endseq was omitted! // if (d == pixmap()) { // we are doing double buffering if (cx.my_r) { XClipBox(cx.my_r, &clip); XCopyArea(display(),pixmap(),panner()->window(), gc_Normal(), clip.x - _origin.x, clip.y - _origin.y, clip.width,clip.height, clip.x - _origin.x, clip.y - _origin.y); } else { XCopyArea(display(),pixmap(),panner()->window(), gc_Normal(), 0,0,pWidth(),pHeight(),0,0); } } if (cx.my_r != r && cx.my_r) { XDestroyRegion(cx.my_r); cx.my_r = 0; } XDrawRectangle(display(), d, gc_Normal(), 0, 0, pWidth()-1, pHeight()-1); drawCursor(); _pixmap->unlock(); } void MSTextEditor::drawCursor() { _cursor->draw(gc_XOR(), panner()->window(), &_origin, _line_spacing, ((_cursor->location.snip && _cursor->location.snip->data) ? snipWidth(_cursor->location.snip, _cursor->location.snip->data, 1) : 9)); } Region updateXRegion(Region region_, int x, int y, int w, int h) { XRectangle rect; if (!region_) region_ = XCreateRegion(); if (w == 0 || h == 0) return region_; rect.x = x; rect.y = y; rect.width = w; rect.height = h; XUnionRectWithRegion(&rect, region_, region_); return region_; } void MSTextEditor::redrawImmediately() { initRefreshRegion(); updateCursorPosition(MSFalse, MSTrue, MSFalse); updateTextRegions(MSFalse); _refresh = updateXRegion(_refresh, _origin.x, _origin.y, pWidth(), pHeight()); doRefreshRegions(); updateScrollbars(); } char * MSTextEditor::getString(long *) { return 0; } char * MSTextEditor::getSubstring(long *, long, long) { return 0; } void MSTextEditor::extract(long, long, ExtractFeedFunction, void *) { } MSString MSTextEditor::extractSelectedContent() { TextLocation dot[2]; XPoint xy[2]; long range[2]; MSString selection(""); unsigned int len = 0; range[0] = _regions[0].range[0];// To prevent reordering // range[1] = _regions[0].range[1];// in the widgets data. // locations(range, 2, dot, xy); if (range[0] < range[1]) for (Snip *s = dot[0].snip; s; s = s->next) { if (s->content.head && s->length > 0 && s->content.head->bytes * s->length > 0) { char *buf = (char*)malloc(s->length + 1); strncpy(buf, (char *)(&s->data[s->content.head->bytes * s->offset]), s->length); buf[s->length - 1] = '\0'; selection << buf; len += s->length; selection = selection(0, len); if (s->endseq) { selection << "\n"; len ++; } free(buf); } if (s == dot[1].snip) break; } return selection; } void MSTextEditor::replace(long , long , char *, long ) { } void MSTextEditor::replaceTagged(long , long , char *, long , MSTextEditorTextTag ) { } void MSTextEditor::insertPrefix(char *, long ) { } long MSTextEditor::getInsertionPoint() { return _cursor->position; } long MSTextEditor::search(int , char *, long , int ) { return 0; } MSTextEditorTextTag MSTextEditor::getInsertionTag() { return 0; } void MSTextEditor::setInsertionTag(MSTextEditorTextTag) { } void MSTextEditor::getRegionPosition(TextRegion, long *, long *) { } int MSTextEditor::setRegion(long, long,MSTextEditor::TextHighlight) { return 0; } int MSTextEditor::unsetRegion (MSTextEditor::TextRegion) { return 0; } ///// private methods void MSTextEditor::initRefreshRegion() { if (!_refresh) { _refresh = XCreateRegion(); } } // // Change the cursor into a new location and/or refresh cursor. // if goal, then reset horizontal goal position. // if expose, then request expose events // if bounds, then request that cursor is in visible window // void MSTextEditor::updateCursorPosition(MSBoolean goal, MSBoolean expose, MSBoolean) { XPoint xy; XRectangle rect; TextLocation *location = &_cursor->location; if (_enable_display < 0) return; if (expose) { _cursor->getBounds(&rect); // to clear out old cursor mark initRefreshRegion(); _refresh = updateXRegion(_refresh, rect.x, rect.y, rect.width, rect.height); } if (!_cursor->valid) { _cursor->position = offset(location); _cursor->valid = MSTrue; } coordinates(location->snip, location->offset, &xy); _cursor->x = xy.x; _cursor->y = xy.y + _cursor->h + 1; if (goal) _cursor->goal = _cursor->x; _cursor->getBounds(&rect); if (expose) _refresh = updateXRegion(_refresh, rect.x, rect.y, rect.width, rect.height); if (location->snip) { rect.y -= location->snip->ascent; rect.height += location->snip->ascent+location->snip->descent; } if (rect.x < 0) { // // Because the caret extends to the left of the current // point, it would generate this notify on every beginning // line. Clip area to positive side of x. if ((int)rect.width + rect.x < 0) rect.width = 0; else rect.width += rect.x; rect.x = 0; } checkBounds(&rect); } void MSTextEditor::initColors() { int i; XColor exact, color; if (!_cmap) _cmap = DefaultColormap(display(), DefaultScreen(display())); if (_colors) free(_colors); _colors = (unsigned long *)malloc(_n_color_names * sizeof(unsigned long)); for (i = 0; i < _n_color_names; i++) { if (!XAllocNamedColor(display(), _cmap, _color_names(i), &exact, &color)) { color.pixel = FRAME_NO_PIXEL; // failed... } _colors[i] = color.pixel; } } void MSTextEditor::freeColors() { if (_colors == NULL) return; /* for (int i = 0; i < 8; i++) if (_colors[i] != FRAME_NO_PIXEL) XFreeColors(display(), _cmap, &_colors[i], 1, (unsigned long)0); */ free((void *)_colors); _colors = NULL; } void MSTextEditor::switchColor() { double_buffering = 1 - double_buffering; } void MSTextEditor::setForeground(unsigned long pixel_) { XSetForeground(display(), gc_Normal(), pixel_); } void MSTextEditor::setBackground(unsigned long pixel_) { XSetBackground(display(), gc_Normal(), pixel_); } // // Find extents for Snip sequence (s, e). The terminating 'e' is not included. // // NOTE: THIS FUNCTION ASSUMES CORRECT CALLING: 'e' must follow 's' // void MSTextEditor::findExtents(MSTextEditorTypes::Snip *s, Snip *e, int *ascent, int *descent) { int base = s->y; // Compute ascent/descent relative to this! *ascent = 0; *descent = 0; for ( ; s && s != e; s = s->next) if (!s->floating) { int adj = base - s->y; if (s->ascent + adj > *ascent) *ascent = s->ascent + adj; if (s->descent - adj > *descent) *descent = s->descent - adj; } } // // Start (h != 0) or End (h == 0) rendition effect. // void MSTextEditor::updateTextRegions(MSBoolean bounds) { for (int n = _num_regions-1; n>=0; n--) updateTextRegion(&_regions[n], bounds); } void MSTextEditor::doRefreshRegions() { if (_refresh && !XEmptyRegion(_refresh)) { Region r = _refresh; _refresh = 0; redisplay((XExposeEvent *)NULL, r, double_buffering?pixmap():panner()->window()); XDestroyRegion(r); } } static Time NoteTime(XEvent *event) { if (event != NULL) { switch (event->type) { case ButtonPress: case ButtonRelease: return event->xbutton.time; case KeyPress: case KeyRelease: return event->xkey.time; case MotionNotify: return event->xmotion.time; case EnterNotify: case LeaveNotify: return event->xcrossing.time; } } return CurrentTime; // A kludge, should probably give warning --msa } void MSTextEditor::notePosition(XEvent *event, XPoint *p) { switch (event->type) { case ButtonPress: case ButtonRelease: p->x = event->xbutton.x + _origin.x; p->y = event->xbutton.y + _origin.y; break; case KeyPress: case KeyRelease: { XRectangle cursor; _cursor->getBounds(&cursor); p->x = cursor.x + _origin.x + cursor.width / 2;; p->y = cursor.y + _origin.y + cursor.height / 2;; } break; case MotionNotify: p->x = event->xmotion.x + _origin.x; p->y = event->xmotion.y + _origin.y; break; case EnterNotify: case LeaveNotify: p->x = event->xcrossing.x + _origin.x; p->y = event->xcrossing.y + _origin.y; break; default: p->x = 0; p->y = 0; break; } } int MSTextEditor::startEditing(InsertMode mode_, XEvent *event_) { // do callback.... unsetSelection(); initRefreshRegion(); if (event_) if (_allow_edit) { XBell(display(), 0); return 0; } else _time = NoteTime(event_); if (!_inserting) { adjustSnipFirst(&_cursor->location); _inserting = insertContent(_cursor->location.snip, _cursor->location.offset, mode_); _cursor->valid = MSFalse; if (_insert_prefix) { _inserting->lock(MSFalse); _inserting->feedContent(_insert_prefix, _insert_prefix_length); _inserting->lock(MSTrue); } } return 1; } void MSTextEditor::endEditing(int deleted_) { int i, n; _mult = 1; long ref = _cursor->position; if (_inserting) { _inserting->insertLocation(&_cursor->location, _refresh); if (_enable_display >= 0) { layout(_column_width > 0 ? _column_width : pWidth(), // // The beginning of text often gets // marked by NULL location pointer. Use // 'first' in that case to prevent // unnecessary total relayout... _cursor->location.snip ? _cursor->location.snip : _first, _refresh); //if (_num_children > 0) configureChildren(); } _cursor->position = offset(&_cursor->location); _cursor->valid = MSTrue; } long position = _cursor->position; // // Do a feeble attempt to update text regions if (deleted_ < 0) { deleted_ = -deleted_; ref = position; } for (n = _num_regions-1; n >= 0; n--) { TextRegion *r = &_regions[n]; if (r->mode == UNUSED) continue; for (i = 0; i < NumberOf(r->range); ++i) if (ref <= r->range[i]) if (deleted_ == 0) r->range[i] += _cursor->position-ref; else if (ref + deleted_ > r->range[i]) r->range[i] = ref; else r->range[i] -= deleted_; updateTextRegion(r, MSFalse); // Should fine tune? --msa } // changeWidgetSize(MSTrue); updateCursorPosition(MSTrue, MSTrue, MSTrue); doRefreshRegions(); updateScrollbars(); } // // AdjustSnipFirst // adjust the location to point the first editable Snip in the // content, if location is pointing to the beginning of the content. // void MSTextEditor::adjustSnipFirst(MSTextEditor::TextLocation *location_) { if (location_->snip) return; location_->offset = 0; for (Snip *s = _first; s; s = s->next) if (s->hasEditableContents()) { location_->snip = s; break; } } long MSTextEditor::offset(MSTextEditor::TextLocation *dot) { if (!dot->snip) return 0; long voffset = 0; for (Snip *s = _first; s; s = s->next) if (dot->snip == s) { voffset += dot->offset; break; } else if (s->hasEditableContents()) voffset += s->virtualLength(); return voffset; } // // initSnipMode // initial SnipMode (size_modification has to have the default 100!) // static MSTextEditorTypes::SnipMode initSnipMode(0,0,100); static void Gn_Feed(void *client_data, ccf_Gs, char *s, int n) { MSTextEditor::copy1_GL((MSTextEditorTypes::InsertContext*)client_data, n, (unsigned char *)s, NULL, MSTextEditor::charsetDefault()); } #if 0 const int BS = 8; /* Backspace */ const int HT = 9; /* Horizontal tabulation */ const int LF = 10; /* Line Feed */ const int FF = 12; /* Form Feed */ const int CR = 13; /* Carriage Return */ const int SUB = 26; /* Substitute */ const int RS = 0x1E; /* Record Separator, used as Paragraph end (not ODA) */ #endif // // IgnoreFormattedContent // is MSTrue, when inserting Formatted content and not specially // allowed by locking into it (only done in _XeMakeLayoutContext) // #define IgnoreFormattedContent(cx) \ (((cx)->_mode.bits & Content_MASK) == Content_FORMATTED && \ !((cx)->_lock.bits & Content_MASK)) static void Do_C0(MSTextEditorTypes::InsertContext *cx, int c) { register MSTextEditorTypes::Snip *t; if (IgnoreFormattedContent(cx)) return; // Completely Ignore Formatted content for now! // switch (c) { case HT: // HT is not allowed in ODA, but to support traditional // text files, convert this into a special STAB // sequence. Each HT will end up into differenct // sequence. // //t = cx->appendSnip(); //t->tab = MSTrue; //t->tabref = NEXTTABSTOP; //t->endseq = MSTextEditor::End; break; case CR: // // In processable format a CR can only appear as an // ITEM terminator or immediately preceding an LF. // t = cx->_last; if (t == NULL || t->endseq || t->mode.tag != cx->_mode.tag || ((t->mode.bits ^ cx->_mode.bits) & Content_MASK)) t = cx->appendSnip(); else t->valid = MSFalse; t->endseq = MSTextEditor::End; break; case FF: // Treat FF as LF for now // case LF: // // Each LF will terminate the current line. If line is // empty or the previous character already terminated // the line, an empty sequence will be created. An LF // will reset current sequence to TEXT. // t = cx->_last; if (t == NULL || t->hasEndLine() || t->space || t->widget || t->mode.tag != cx->_mode.tag || ((t->mode.bits ^ cx->_mode.bits) & Content_MASK)) t = cx->appendSnip(); else t->valid = MSFalse; t->endseq = MSTextEditor::EndLine; break; case RS: // // RS is used experimentally to mark end of paragraph. // (Some other coding may get used in future.) // t = cx->_last; if (t == NULL || t->hasEndLine() || t->space || t->widget || t->mode.tag != cx->_mode.tag || ((t->mode.bits ^ cx->_mode.bits) & Content_MASK)) t = cx->appendSnip(); else t->valid = MSFalse; t->endseq = MSTextEditor::EndParagraph; break; default: break; } } #if 0 const int BPH = 2; const int NBH = 3; const int PLD = 11; const int PLU = 12; const int SOS = 24; const int ST = 28; #endif static void Do_C1(MSTextEditorTypes::InsertContext *cx, int c) { if (IgnoreFormattedContent(cx)) { if (c == ST && !(cx->_lock.bits & Content_MASK)) { cx->_mode.bits &= ~Content_MASK; cx->_mode.bits |= Content_PROCESSABLE; } return; // Completely Ignore Formatted content for now! // } switch (c) { case PLU: // // A PLU can only follow PLD, or it can start Partial // line up from neutral state (NOALIGNMENT). If preceded by // PLU, this one is ignored (PLU state does not change). // if (!cx->_locked) cx->_lock.bits |= PartialLine_MASK; else if (cx->_lock.bits & PartialLine_MASK) break; // Locked Mode, do not change // if (cx->_mode.bits & PartialLine_DOWN) cx->_mode.bits &= ~PartialLine_DOWN; else cx->_mode.bits |= PartialLine_UP; break; case PLD: // // a PLD can only follow PLU, or it can start Partial // line down from neutral state (NOALIGNMENT). If preceded by // PLD, this one is ignored (PLD state does not change). // if (!cx->_locked) cx->_lock.bits |= PartialLine_MASK; else if (cx->_lock.bits & PartialLine_MASK) break; // Locked Mode, do not change // if (cx->_mode.bits & PartialLine_UP) cx->_mode.bits &= ~PartialLine_UP; else cx->_mode.bits |= PartialLine_DOWN; break; case BPH: // // BPH is sensible only if there is a MSTextEditorTypes::Snip to attach // (ignored otherwise) // if (cx->_last != NULL) { cx->_last->brk = MSTextEditor::Break_BPH; cx->_last->valid = MSFalse; } break; case NBH: // // NBH is sensible only if there is a MSTextEditorTypes::Snip to attach // (ignored otherwise) // if (cx->_last != NULL) { cx->_last->brk = MSTextEditor::Break_NBH; cx->_last->valid = MSFalse; } break; case SOS: if (!(cx->_lock.bits & Content_MASK)) { cx->_mode.bits &= ~Content_MASK; cx->_mode.bits |= Content_FORMATTED; } break; default: break; } } static void Cn_Feed(void *client_data, ccf_Cs Cn, int c) { if (client_data == NULL) return; // FATAL ERROR // else if (Cn == ccf_C0) Do_C0((MSTextEditorTypes::InsertContext *)client_data, c); else if (Cn == ccf_C1) Do_C1((MSTextEditorTypes::InsertContext *)client_data, c); } // uncomment if need to use // const int HPB = 0x6A; // Character Position Backward // // const int HPR = 0x61; // Character Position Relative // // const int PTX = 0x5C; // Parallel Texts // const int SGR = 0x6D; // Select Graphic Rendition // // const int SRS = 0x5B; // Start Reverse String // const int VPB = 0x6B; // Line Position Backward // const int VPR = 0x65; // Line Position Relative // const int DAQ = 0x6F; // Define Area Qualification // // const int GCC = 0x5F; // Graphic Character Composition const int GSM = 0x42; // Graphic Size Modification // const int IGS = 0x4D; // Identify Graphic Subrepertoire const int JFY = 0x46; // Justify const int QUAD= 0x48; // Quad // const int SCS = 0x67; // Set Character Spacing // const int SHS = 0x4B; // Select Character Spacing // const int SACS= 0x5C; // Set Additional Character Spacing const int SLS = 0x68; // Set Line Spacing // const int SRCS= 0x66; // Set Reduced Character Spacing // const int SSW = 0x5B; // Set SPACE Width const int STAB= 0x5E; // Selective Tabulation const int SVS = 0x4C; // Select Line Spacing static void ESC_Feed(void *, char *, int, int) { } // // Process single parameter value of SGR or "graphic rendition". // // (ISO 8613-6 11.1.8 Table 4) // static void selectGraphicRendition(MSTextEditorTypes::InsertContext *cx, int r) { unsigned int mask, value; switch (r) { case 0: // // reset to default rendition // Unfortunately, mode contains flags that make it not // possible to just do mode = init. This is indication of // incorrect grouping.. should be fixed --msa // mask = Weight_MASK | Italicized_MASK | Underline_MASK | Blinking_MASK | ImageInversion_MASK | CrossedOut_MASK | Font_MASK | Foreground_MASK | Background_MASK | Framing_MASK | Overlined_MASK; if (cx->_locked) mask &= ~cx->_lock.bits; value = 0; break; case 1: // bold or increased density // mask = Weight_MASK; value = Weight_BOLD; break; case 2: // faint or decreased density // mask = Weight_MASK; value = Weight_FAINT; break; case 3: // italicized // mask = value = Italicized_MASK; break; case 4: // underlined // mask = Underline_MASK; value = Underline_SINGLE; break; case 5: // slowly blinking // mask = Blinking_MASK; value = Blinking_SLOWLY; break; case 6: // rapidly blinking // mask = Blinking_MASK; value = Blinking_RAPIDLY; break; case 7: // negative image // mask = value = ImageInversion_MASK; break; case 9: // crossed-out // mask = value = CrossedOut_MASK; break; case 10: // primary (default) font // case 11: // first alternative font // case 12: // second alternative font // case 13: // third alternative font // case 14: // fourth alternative font // case 15: // fifth alternative font // case 16: // sixth alternative font // case 17: // seventh alternative font // case 18: // eigth alternative font // case 19: // ninth alternative font // mask = Font_MASK; value = Font_VALUE(r - 10); break; case 21: // doubly underlined // mask = Underline_MASK; value = Underline_DOUBLE; break; case 22: // normal intensity (neither bold nor faint) // mask = Weight_MASK; value = 0; break; case 23: // not italicized // mask = Italicized_MASK; value = 0; break; case 24: // not underlined (neither singly nor doubly) // mask = Underline_MASK; value = 0; break; case 25: // steady (not blinking) // mask = Blinking_MASK; value = 0; break; case 26: // variable spacing // mask = value = 0; break; case 27: // positive image // mask = ImageInversion_MASK; value = 0; break; case 29: // not crossed-out // mask = CrossedOut_MASK; value = 0; break; case 30: // ISO 6429, black display // case 31: // ISO 6429, red display // case 32: // ISO 6429, green display // case 33: // ISO 6429, yellow display // case 34: // ISO 6429, blue display // case 35: // ISO 6429, magenta display // case 36: // ISO 6429, cyan display // case 37: // ISO 6429, white display // mask = Foreground_MASK; value = Foreground_VALUE(r - 29); break; case 39: // ISO 6429, default display color // mask = Foreground_MASK; value = 0; break; case 40: // ISO 6429, black background // case 41: // ISO 6429, red background // case 42: // ISO 6429, green background // case 43: // ISO 6429, yellow background // case 44: // ISO 6429, blue background // case 45: // ISO 6429, magenta background // case 46: // ISO 6429, cyan background // case 47: // ISO 6429, white background // mask = Background_MASK; value = Background_VALUE(r - 39); break; case 49: // ISO 6429, default background color // mask = Background_MASK; value = 0; break; case 50: // not variable spacing // mask = value = 0; break; case 51: // ISO 6429, framed // mask = Framing_MASK; value = Framing_FRAMED; break; case 52: // ISO 6429, encircled // mask = Framing_MASK; value = Framing_ENCIRCLED; break; case 53: // ISO 6429, overlined // mask = value = Overlined_MASK; break; case 54: // ISO 6429, not framed, not encircled // mask = Framing_MASK; value = 0; break; case 55: // ISO 6429, not overlined // mask = Overlined_MASK; value = 0; break; default: mask = value = 0; break; } if (!cx->_locked) cx->_lock.bits |= mask; else if (cx->_lock.bits & mask) return; // Locked mode, do not change. Ignore control // cx->_mode.bits &= ~mask; cx->_mode.bits |= value; } static void Do_CSI(MSTextEditorTypes::InsertContext *cx, int n, int *p, int F) { switch (F) { case VPB: // Not implemented // break; case VPR: // Not implemented // break; case SGR: if (n == 0) selectGraphicRendition(cx, 0); else while (--n >= 0) selectGraphicRendition(cx, *p++); break; case DAQ: // Define Area Qualification // if (!cx->_locked) cx->_lock.bits |= Content_MASK; else if (cx->_lock.bits & Content_MASK) break; // Locked Mode, do not change // while (--n >= 0) // Only parameters 0 and 1 implemented now!! // switch (*p++) { default: break; case 0: // Accept All Input (default) // cx->_mode.bits &= ~Content_MASK; cx->_mode.bits |= Content_PROCESSABLE; break; case 1: // Accept No Input and do not transmit // cx->_mode.bits &= ~Content_MASK; cx->_mode.bits |= Content_PROTECTED; break; } break; default: break; } } static void Do_CSI1(MSTextEditorTypes::InsertContext *cx, int n, int *p,int F,int I) { register MSTextEditorTypes::Snip *t; MSTextEditor::Alignment align; // // In ODA, only intermediate used is SPACE--ignore all others. // if (I != 0x20) return; switch (F) { case GSM: // ISO 6429 : 1988 // // // Graphic Size Modification defines the percentage of // the vertical and horizontal size change for subsequent // characters. ONLY VERTICAL CHANGE IMPLEMENTED HERE! // if (!cx->_locked) cx->_lock.size_modification = ~0; else if (cx->_lock.size_modification) break; cx->_mode.size_modification = *p ? *p : 100; break; case JFY: // ISO 6429 : 1988 // if (!cx->_locked) cx->_lock.bits |= Justify_MASK; else if (cx->_lock.bits & Justify_MASK) break; // Locked Mode, do not change // cx->_mode.bits &= ~Justify_MASK; align = MSTextEditor::NOALIGNMENT; while (--n >= 0) switch (*p++) { default: case 0: // no justification (use NOALIGNMENT default) // case 1: // word fill (ignored) // case 4: // hyphenation (ignored) // case 8: // italian hyphenation (ignored) // break; case 2: // word space // case 3: // letter space (assume word space) // align = MSTextEditor::JUSTIFIED; break; case 5: // flush to line home position // align = MSTextEditor::START; break; case 6: // centre between home and limit // align = MSTextEditor::CENTER; break; case 7: // flush to line limit position // align = MSTextEditor::END; break; } cx->_mode.bits |= Justify_VALUE(align); break; case QUAD: // ISO 6429 : 1988 // // // Multiple QUAD on same spot just overwrite the previous // value. // t = cx->_last; if (t == NULL || !t->endseq) { t = cx->appendSnip(); t->endseq = MSTextEditor::End; } switch (n > 0 ? *p : 0) { default: case 0: // Start // case 1: // Start with leader fill // align = MSTextEditor::START; break; case 2: // Center // case 3: // Center with leader fill // align = MSTextEditor::CENTER; break; case 4: // End // case 5: // End with leader fill // align = MSTextEditor::END; break; case 6: // Justify // align = MSTextEditor::JUSTIFIED; break; } t->quad = align; break; case SLS: // Fix later --msa // break; case SVS: // Fix later --msa // break; case STAB: t = cx->_last; if (t && !t->endseq) t->valid = MSFalse; else t = cx->appendSnip(); t->endseq = MSTextEditor::End; t->tab = MSTrue; t->tabref = *p; break; default: break; } } static void CSI_Feed(void *client_data,int P, int *p,int n,char *I,int nI,int F) { MSTextEditorTypes::InsertContext *cx = (MSTextEditor::InsertContext *)client_data; if (P) return; // No use for Private sequences now // if (cx == NULL) return; if (IgnoreFormattedContent(cx)) return; // Completely Ignore Formatted content for now! // if (nI == 0) Do_CSI(cx, n, p, F); else if (nI == 1) Do_CSI1(cx, n, p, F, *I & 0xFF); } static int Designate_G(void *, ccf_Gs, int, int, int) { return 0; } static int Designate_C( void *, ccf_Cs, int) { return 0; } // // MSTextEditorTypes::InsertContext *MSTextEditor::insertContent(...) // // Start inserting character content after the specified snip. Returns // pointer to a new "context" block, and this context is implicitly // set after this call. // // *NOTE* after should point to a Snip representing original text, // not anything generated by layout. // // New insertion point is opened in Snip specified by the position // parameter and length of the Snip: // // position > length, insert totally after the snip (e.g, if // the snip is ending a line, the new data // will be inserted after the line end). // position == length, insert at end of snip, but before the // possible end of line mark. // position < length, insert *before* the character specified // by the position (0==first character and // ==last character). // // 'mode' parameter controls the initial mode, before applying the // value from the initialState resource: // // mode == 0, initial mode for the snip is EMPTY (all zeroes). // mode > 0, if the insert point at end of the Snip, the mode // will be taken from the next editable Snip after // this Snip. (If insert point is inside the snip, // the mode is taken from the snip). // mode < 0, Use the mode from insert point Snip (after). // MSTextEditorTypes::InsertContext *MSTextEditor::insertContent( Snip *after, int position, int mode) { InsertContext *cx; Snip *t; int n; char *s; if (after == NULL) return beginContent(); /* Bad call, easy way out.. */ cx = new InsertContext; if (!cx) return NULL; if (position < 0) position = 0; if (!after->hasEditableContents()) return NULL; cx->_editor = this; cx->_list = &_first; cx->_last = after; cx->_mode = after->mode; // // Split content of snip After into two parts // n = after->length - position; s = after->data; // Needs to be saved, can be changed below if (n > 0 || (n == 0 && after->hasEndPosition())) { // // Inserting within current Snip. The snip needs to be split. // This is achieved by changing the 'after' to reflect only // the tail part and creating a new empty snip in front of it. // After which the the new data will be inserted. // cx->adjustLastPointer(after); if (after->layout) { cx->updateExposeArea(after->x, after->y - after->ascent, after->xWidth, after->ascent + after->descent); after->layout = after->valid = MSFalse; } if (after->data && n > 0) { after->data += after->content.head->bytes * position; after->length = n; } else { after->data = NULL; after->length = 0; } // // If there was data in 'after' *before* the insert point, // it now must be saved away. // if (position > 0 && s && (t = cx->beginAppend(position, after->content.head->character_set, after->content.head->bytes)) != NULL) { memcpy((void *)t->data,(void *)s, position * after->content.head->bytes); t->length += position; } } else if (mode > 0) { // // Inserting totally after the current Snip and request is // to use mode from following Snip. Do that. // t = after; while ((t = t->next) != NULL) if (t->hasEditableContents()) { cx->_mode = t->mode; break; } } if (mode == 0) cx->_mode = initSnipMode; cx->initGxMap(); cx->_ccf = ccf_Open(cx, Gn_Feed, Cn_Feed, ESC_Feed, CSI_Feed, Designate_G, Designate_C); if (_initial_state != NULL) cx->feedContent(_initial_state, strlen(_initial_state)); cx->lock(MSTrue); return cx; } // // First check if a sequence of characters can be appended to the // current run of data being collected into context block. // This can be done, if // - context data has sufficient available space and // - character set is same and // - font selection is the same. // If not, then flush out the current collected data and start // a new empty collection (which must be sufficiently large for // the offered sequence). // // Second, check if a new Snip block needs to be allocated or if // the current one can be used (If flush was required, a new Snip // is always needed). // #define HEAD_MIN_SIZE 512 // Minimum initial data allocation #define HEAD_MIN_FUZZ 32 // Don't bother to shrink if less than this free MSTextEditorTypes::Snip *MSTextEditorTypes::InsertContext::beginAppend( int n_chars_, char *cset_, int bytes_per_char_) { MSTextEditorTypes::Snip *t; unsigned long fontinfo = (unsigned long)fontSelectInfo(_mode); int n = n_chars_ * bytes_per_char_; if (_used+n > _size || (_head && _head->character_set != cset_) || fontinfo != _fontinfo) { flushAppend(); if (_size < n) { /* Need to reallocate larger head block */ _head = derefDataHeader(_head); _size = n > HEAD_MIN_SIZE ? n : HEAD_MIN_SIZE; _head = (MSTextEditorTypes::SnipData *) calloc(1, OffsetOf(MSTextEditorTypes::SnipData, s[0]) + _size); _head->refs = 1; /* cx ref is counted ! */ } _fontinfo = fontinfo; _head->bytes = bytes_per_char_; _head->font = NULL; _head->character_set = cset_; t = _first = appendSnip(); t->content.head = _head; t->data = &_head->s[_used]; _head->refs += 1; } else if ((t = _last) == NULL || t->content.head != _head || t->space || t->endseq || t->brk || !IsSameMode(t->mode, _mode)) { t = appendSnip(); t->content.head = _head; t->data = &_head->s[_used]; _head->refs += 1; } _used += n; t->valid = MSFalse; return t; } // // Release extra buffer space // void MSTextEditorTypes::InsertContext::flushAppend() { SnipData *head, *h; int size = OffsetOf(SnipData, s[0]) + _used; Snip *s = _first; h = derefDataHeader(_head); if (s && h && _used + HEAD_MIN_FUZZ < _size && (head = (SnipData *)realloc((char *)h, size)) != h) { // // This branch should not be taken usually. It means // that realloc moved the block, even if we just // truncated the allocation! (This happens if you run purify, // also seems to occur with Apollo sr10.2 --msa) // for (size = head->refs; s; s = s->next) if (s->content.head == NULL || s->widget) continue; else if (s->content.head == h) { int i; i = (int)(s->data - &h->s[0]); s->data = &head->s[i]; s->content.head = head; if (--size == 0) break; } } _first = NULL; _used = 0; _size = 0; _head = NULL; } // // Add a new Snip to the Block of the current context. // MSTextEditorTypes::Snip *MSTextEditorTypes::InsertContext::appendSnip() { Snip **where = _last ? &(_last->next) : _list; Snip *s = insertSnip(where); if (s != NULL) _last = s; s->mode = _mode; return s; } // // insert a new empty Snip before the Snip pointed by 'h'. // Return a pointer to the newly created Snip. // MSTextEditorTypes::Snip *MSTextEditorTypes::InsertContext::insertSnip(MSTextEditorTypes::Snip **list_) { Snip *s = (Snip *)calloc(1, sizeof(Snip)); if (!s) return NULL; s->next = *list_; if (s->next) s->next->back = &s->next; *list_ = s; s->back = list_; s->content.head = NULL; s->data = NULL; return s; } // // Start processing a new unit of character content. Returns a // pointer to a new "context" block, and this context is implicitly // set after this call. // MSTextEditorTypes::InsertContext *MSTextEditor::beginContent() { InsertContext *cx = new InsertContext(); if (cx == NULL) return NULL; cx->_editor = this; cx->_last = NULL; cx->_list = &_first; // // Delete previous internal structures, if any present // while (_first) Snip::Delete(&_first); cx->initGxMap(); cx->_ccf = ccf_Open(cx, Gn_Feed, Cn_Feed, ESC_Feed, CSI_Feed, Designate_G, Designate_C); if (_initial_state) cx->feedContent(_initial_state, strlen(_initial_state)); if (_graphic_rendition) { cx->feedContent("\233", 1); cx->feedContent(_graphic_rendition, strlen(_graphic_rendition)); cx->feedContent("\155", 1); // ASCII "m" } cx->lock(MSTrue); // // Using the resource graphicRendition as initial state may not // be quite correct, and might be needed to be made an option --msa // return cx; } // // AdjustLastPointer // // Adjust last pointer backward to the first editable Snip // starting backwards from the given Snip (t). // void MSTextEditorTypes::InsertContext::adjustLastPointer(MSTextEditorTypes::Snip *r) { if (r) { r->valid = MSFalse; do { if (r->back == _list) { r = NULL; break; } r = r->previous(); r->valid = MSFalse; } while (!r->hasEditableContents()); } _last = r; } // // updateExposeArea // Extend expose area from the Snip // void MSTextEditorTypes::InsertContext::updateExposeArea(int x, int y, int width, int height) { _expose = updateXRegion(_expose, x, y, width, height); } // // Recompute the rectangles covering the specified Text Region, and // update the area requiring refresh/expose. // void MSTextEditor::updateTextRegion(TextRegion *region, MSBoolean bounds) { XRectangle rect[3]; int nrect, i, ascent1, descent1, ascent2, descent2, ascent3, base, adj; int in_one_line; TextLocation dot[2]; XPoint xy[2]; long range[2]; Snip *s; //if (_enable_display < 0 || region->mode <= NOHIGHLIGHT) return; nrect = 0; if (region->range[0] != region->range[1]) { range[0] = region->range[0]; range[1] = region->range[1]; locations(range, 2, dot, xy); if (dot[0].snip == NULL || dot[1].snip == NULL) goto no_editable_content; in_one_line = MSFalse; for (s = dot[0].snip, ascent1=descent1=0, base = s->y; s; s = s->next) { if (!s->floating) { adj = base - s->y; if (s->ascent + adj > ascent1) ascent1 = s->ascent + adj; if (s->descent - adj > descent1) descent1 = s->descent - adj; } if (s == dot[1].snip) { in_one_line = MSTrue; break; } if (s->hasEndLine()) break; } for (s=dot[1].snip, ascent2=descent2=0, base = s->y; s; s=s->previous()) { if (!s->floating) { adj = base - s->y; if (s->ascent + adj > ascent2) ascent2 = s->ascent + adj; if (s->descent - adj > descent2) descent2 = s->descent - adj; } if (s == dot[0].snip || s->back == &_first || s->hasEndLine()) break; } for (s = dot[1].snip, ascent3 = 0, base = s->y; s; s = s->next) { if (!s->floating && s->ascent + base - s->y > ascent3) ascent3 = s->ascent + base - s->y; if (s->hasEndLine()) break; } rect[0].x = xy[0].x; rect[0].y = xy[0].y - ascent1; rect[0].height = ascent1 + descent1; if (in_one_line) { nrect = 1; if (xy[0].x < xy[1].x) rect[0].width = xy[1].x - xy[0].x; else if (xy[0].x > xy[1].x) rect[0].width = xy[0].x - xy[1].x; else nrect = 0; } else { if (pWidth() <= (int)rect[0].x) rect[0].width = 1; else rect[0].width = pWidth() - rect[0].x; rect[1].x = 0; rect[1].y = xy[1].y - ascent3; if (xy[1].x > 0) rect[1].width = xy[1].x; else rect[1].width = 1; rect[1].height = ascent3 + descent2; if (rect[1].height == 0) rect[1].height = 1; rect[2].x = 0; rect[2].y = rect[0].y + rect[0].height; rect[2].width = pWidth() > 0 ? pWidth() : 1; i = rect[1].y - rect[0].y - rect[0].height; if (i > 0) { rect[2].height = i; nrect = 3; } else { i = rect[1].y - rect[0].y; rect[0].height = i > 0 ? i : 1; nrect = 2; } } } no_editable_content: if (1 || mapped()) // widget needs to be redrawn { Region r_old = XCreateRegion(); Region r_new = XCreateRegion(); Region r_xor = XCreateRegion(); for (i = 0; i < region->nrect; ++i) XUnionRectWithRegion(®ion->rect[i], r_old, r_old); for (i = 0; i < nrect; ++i) { XUnionRectWithRegion(&rect[i], r_new, r_new); region->rect[i] = rect[i]; } region->nrect = nrect; XXorRegion(r_new, r_old, r_xor); if (_refresh) XUnionRegion(r_xor, _refresh, _refresh); XDestroyRegion(r_old); XDestroyRegion(r_new); XDestroyRegion(r_xor); if (bounds && nrect > 0) { XRectangle area; i = range[1] == region->range[1] ? 1 : 0; area.x = xy[i].x; area.y = xy[i].y; area.width = area.height = 1; if ((s = dot[i].snip) != NULL) { area.y -= s->ascent; area.height += s->ascent + s->descent; } checkBounds(&area); } } region->nrect = nrect; } // // Convert virtual offsets into TextLocations and matching // (x,y) coordinates. // // NOTE: The offsets will be rearranged to ascending order, // if they are not. // // NOTE: In the returned (snip, offset), it is always true // that "offset < snip->virtualLength()", except when the // converted offset was beyond the end of the file, this // is the only case when "offset == snip->virtualLength()". // void MSTextEditor::locations( long *v, // Virtual offsets (points to convert) int n, // Number of points to convert TextLocation *p, // Return matching (Snip, offset) here XPoint *xy) // Return matching (x,y) here { int done = 0; // # of converted virtual offsets long voffset = 0; // Cumulative Virtual offset Snip *last_editable = NULL; // Last Editable Snip in content long vlength = 0; // Virtual Length of the last snip Snip *s; int x, y, i, j; // // First, ensure that the offsets are given in ascending // order. Rearrange them if this is not the case. Use brute // bubble sort. Never call this with more than 1-4 offsets! for (i = 0; i < n-1; ++i) for (j = i + 1; j < n; ++j) if (v[i] > v[j]) { register long temp = v[j]; v[j] = v[i]; v[i] = temp; } // // Find the matching (Snip,Offset) and (x,y) information for // the each virtual offset. y = _y; x = _x; for (s = _first; done < n && s; s = s->next) { if (s->hasEditableContents()) { last_editable = s; x = s->x + s->xWidth; y = s->y; voffset += (vlength = s->virtualLength()); while (done < n && v[done] < voffset) { int l = v[done] - voffset + vlength; p[done].snip = s; p[done].offset = l; coordinates(s, l, &xy[done]); done += 1; } } } // // The remaining un-done virtual offsets point past end of // content. Adjust them to point after the last editable // Snip. while (done < n) { v[done] = voffset; xy[done].x = x; xy[done].y = y; p[done].snip = last_editable; p[done].offset = vlength; done += 1; } } // // Return (x,y) coordinates matching the given (Snip, Offset) // This function uses some ad hoc rules in deciding the actual // position. The reasons for them are somewhat obscure, but they // have been arrived by trial and error and do give out least // surprises to the user... // // If Snip == NULL, default to the first Snip in content, or // origin, if empty content. // // * THIS WORKS ONLY IF THE CONTENT HAS BEEN LAID OUT * // void MSTextEditor::coordinates(MSTextEditorTypes::Snip *s, int offset, XPoint *xy) { if (!s) { // // No Snip specified, default to position of the first // editable Snip, if any exists offset = 0; for (s = _first; ; s = s->next) if (s == NULL) { // // No Snip and empty content, default to // (text.x, text.y) xy->x = _x; xy->y = _y; return; // <<<<<<<<<<<< //* RETURN!! *** } else if (s->hasEditableContents()) break; } xy->x = s->x; xy->y = s->y; // // If this snip is a space and point would be in front of it, // then use the end of previous editable Snip instead, if that // snip exists and is not endseq. [This trickery is because // of the way adjustable spaces are treated in the layout // process: within line the extra space is added in *front* of // the space by adjusting the (x) of the space Snip, and soft // line breaks are added *after* the space and the spaces are // zero width elements before soft break.] if (offset == 0 && (s->space || (s->endseq && s->length == 0))) { if (&_first != s->back) { s = s->previous(); if (!s->endseq && s->hasEditableContents()) { xy->x = s->x + s->xWidth; xy->y = s->y; } } } else if (offset < s->length) xy->x += snipWidth(s, s->data, offset); else if (s->xWidth == 0 || offset > s->length) { // // If the point would be *after* visually empty // (zero width) element or point is after endseq // (offset > length), then use the position from the next // editable element. If there is no editable next // element, then use the end of widget for position or // last position from layout snips. Snip *r; if (s->hasEndLine()) { xy->x = _x; xy->y += s->descent + s->ascent; } else xy->x += s->xWidth; for (r = s; (r = r->next) != NULL; ) { xy->x = r->x; xy->y = r->y; if (r->hasEditableContents()) break; } } else xy->x += s->xWidth; } const int TABWIDTH = 96; // // return the width of the text string. // int MSTextEditor::snipWidth(MSTextEditorTypes::Snip *snip_, char *str_, int len_) { if (snip_->tab) { return (snip_->x + TABWIDTH) / TABWIDTH * TABWIDTH; } SnipData *h = snip_->content.head; if (h == NULL) return 0; if (h->font == NULL) snipExtents(snip_); // Force loading of Font return h->bytes == 2 ? XTextWidth16(h->font, (XChar2b *)str_, len_) : XTextWidth(h->font, str_, len_); } void MSTextEditor::checkBounds(XRectangle *) { } int MSTextEditor::setupContent(int, int) { return 1; } const unsigned int Cursor1W = 6; const unsigned int Cursor1H = 4; static char Cursor1Bits[] = {0x0c, 0x1e, 0x33}; MSTextEditorTypes::InsertCursor::InsertCursor(Display *dpy, Window window) { display = dpy; bits = Cursor1Bits; x = 0; y = 0; w = Cursor1W; h = Cursor1H; pixmap = XCreateBitmapFromData(display, window, bits, w, h); valid = MSTrue; location.snip = NULL; location.offset = 0; goal = 0; position = 0L; draw_mode = Solid; } MSTextEditorTypes::InsertCursor::~InsertCursor() { XFreePixmap(display, pixmap); } void MSTextEditorTypes::InsertCursor::getBounds(XRectangle * rect) { rect->width = (unsigned short) w+1; rect->height = (unsigned short) h+1; rect->x = x; rect->y = (draw_mode == Solid) ? y-2*h-0*Cursor1H : y; } void MSTextEditorTypes::InsertCursor::draw(GC gc, Drawable d, XPoint *origin, int lineSpacing, int width) { int x1 = x-origin->x, y1 = y-origin->y + h; int x2 = x-origin->x + w/2, y2 = y-origin->y; int x3 = x-origin->x + w, y3 = y-origin->y + h; switch (draw_mode) { case UnderLine: ::XDrawLine(display, d, gc, x1, y1, x2, y2); ::XDrawLine(display, d, gc, x2, y2, x3, y3); break; case NoCursor: // yes, no drawing break; case IBar: // not yet implemented break; case Solid: w = width; h = lineSpacing; ::XFillRectangle(display, d, gc, x - origin->x, y - origin->y - 0*Cursor1H - 2*h , w, h); break; } } #include #define ExportFormatted(f) ((f)&1) #define ExportOdif(f) ((f)&2) #define ExportOdifFP(f) ((f)&4) #define ESC 0x1b #define PLD_Fe 0x4b /* Fe for PLD in 7bit ESC Fe */ #define PLU_Fe 0x4c /* Fe for PLU in 7bit ESC Fe */ #define PLD 0x8b /* 8bit PLD (C1) */ #define PLU 0x8c /* 8bit PLU (C1) */ typedef struct Rendition { unsigned int mask, value; int set; } Rendition; #define NO_VALUE (~0) static Rendition renditions[] = { {Weight_MASK, Weight_BOLD, 1}, {Weight_MASK, Weight_FAINT, 2}, {Weight_MASK, Weight_NORMAL, 22}, {Italicized_MASK, Italicized_MASK, 3}, {Italicized_MASK, 0, 23}, {Underline_MASK, Underline_SINGLE, 4}, {Underline_MASK, Underline_DOUBLE, 21}, {Underline_MASK, Underline_NONE, 24}, {Blinking_MASK, Blinking_SLOWLY, 5}, {Blinking_MASK, Blinking_RAPIDLY, 6}, {Blinking_MASK, Blinking_STEADY, 25}, {ImageInversion_MASK, ImageInversion_MASK, 7}, {ImageInversion_MASK, 0, 27}, {CrossedOut_MASK, CrossedOut_MASK, 9}, {CrossedOut_MASK, 0, 29}, {Framing_MASK, Framing_FRAMED, 51}, {Framing_MASK, Framing_ENCIRCLED, 52}, {Framing_MASK, Framing_NONE, 54}, {Overlined_MASK, Overlined_MASK, 53}, {Overlined_MASK, 0, 55}, {Foreground_MASK, 0, 39}, /* Use default foreground */ {Background_MASK, 0, 49}, /* Use default background */ {Foreground_MASK, NO_VALUE, -1}, {Background_MASK, NO_VALUE, -1}, {Font_MASK, NO_VALUE, -1}, }; /* ** Change_ISO6429 ** Generate an ESC sequence to match the change in the state ** defined by ISO 6429 ** ** NOTE: The use of HEX character values is intentional. ** These codes must not depend on C compiler characterset. */ static const char * change_ISO6429(MSTextEditorTypes::SnipMode *old, MSTextEditorTypes::SnipMode *new_mode) { unsigned int change = old->bits ^ new_mode->bits; static char buf[3+NumberOf(renditions)*4+ /* Max use by SGR */ 4+ /* Max use by PLD/PLU */ 5+2*6+ /* Max use by GSM */ 1]; /* NUL */ Rendition *r = &renditions[0]; char *s = buf, *mark; int delim; if (change == 0 && old->size_modification == new_mode->size_modification) return ""; mark = s; *s++ = ESC; delim = 0x5b; /* [ */ for ( ;r < &renditions[NumberOf(renditions)]; r += 1) if (change & r->mask) { int par; if (r->value == (r->mask & new_mode->bits)) par = r->set; else if (r->value != NO_VALUE) continue; else if (r->mask == Background_MASK) par = 39 + Background_COLOR(new_mode->bits); else if (r->mask == Foreground_MASK) par = 29 + Foreground_COLOR(new_mode->bits); else if (r->mask == Font_MASK) par = 10 + Font_NUMBER(new_mode->bits); else continue; sprintf(s, "%c%d", delim, par); s += strlen(s); delim = 0x3b; /* ; */ change &= ~r->mask; /* This change processed */ } if (s > mark+1) /* Anything really generated? */ *s++ = 0x6d; /* m */ else s = mark; /* Reset to empty buffer */ if (change & Justify_MASK) { /* Generate JFY sequence (ISO 6429) */ MSTextEditor::Alignment align = Justify_MODE(new_mode->bits); *s++ = ESC; *s++ = 0x5b; /* [ */ if (align == MSTextEditor::START) *s++ = 0x35; else if (align == MSTextEditor::CENTER) *s++ = 0x36; else if (align == MSTextEditor::END) *s++ = 0x37; else if (align == MSTextEditor::JUSTIFIED) *s++ = 0x32; /* Word Space */ *s++ = 0x20; *s++ = 0x46; } if (change & PartialLine_MASK) { /* ** Generate PLD/PLU with ESC Fe, not C1 control */ int i = 0, Fe; if (old->bits & PartialLine_UP) i -= 1; else if (old->bits & PartialLine_DOWN) i += 1; if (new_mode->bits & PartialLine_UP) i += 1; else if (new_mode->bits & PartialLine_DOWN) i -= 1; if (i < 0) { Fe = PLD_Fe; i = -i; } else Fe = PLU_Fe; while (--i >= 0) { *s++ = ESC; *s++ = Fe; } } if (old->size_modification != new_mode->size_modification) { /* ** Graphic Size Modification (ISO 6429) ** (Only vertical size change supported) */ sprintf(s,"\033[%d B", (int)new_mode->size_modification); s += strlen(s); } *s = '\0'; return (s > buf) ? buf : ""; } // // Save the current content of MSTextEditor into a file. The format // of the exported file is determined from by the 'exportFormat' // resource (_export_format). Returns MSTrue, if save succeeds // and MSFalse otherwise. // MSBoolean MSTextEditor::saveAsFile(const char *name) { SnipMode init_mode; SnipMode *prev_mode = &init_mode; if (name == NULL) return MSFalse; FILE *fp=0; if ((fp = fopen(name, "wb")) == NULL) return MSFalse; for (Snip *s = _first; s; s = s->next) { const char *iso = change_ISO6429(prev_mode, &s->mode); fwrite(iso, 1, strlen(iso), fp); if (s->content.head && s->content.head->bytes * s->length > 0) fwrite((char *)(&s->data[s->content.head->bytes * s->offset]), 1, s->content.head->bytes * s->length, fp); if (s->endseq) { fwrite("\n", 1, 1, fp); } prev_mode = &s->mode; } fclose(fp); return MSTrue; } MSBoolean MSTextEditor::saveInString(MSString &string_, MSBoolean textonly_) { SnipMode init_mode; SnipMode *prev_mode = &init_mode; for (Snip *s = _first; s; s = s->next) { if (textonly_ == MSFalse) string_ << change_ISO6429(prev_mode, &s->mode); if (s->content.head && s->content.head->bytes * s->length > 0) { int len = s->content.head->bytes * s->length; char *buf = new char[len + 1]; strncpy(buf, (char *)(&s->data[s->content.head->bytes * s->offset]), len); buf[len] = '\0'; string_ << buf; delete [] buf; } if (s->endseq) string_ << "\n"; prev_mode = &s->mode; } return MSTrue; } MSBoolean MSTextEditor::loadFromFile(const char *name) { ifstream fin(name); if (!fin) return MSFalse; fin.unsetf(ios::skipws); freeze(); if (!startEditing(CURRENT, 0)) return MSFalse; char s[BUFSIZ]; fin.getline(s, BUFSIZ); while (fin && !fin.eof()) { _inserting->feedContent(s, strlen(s)); _inserting->feedContent("\n", 1); fin.getline(s, BUFSIZ); } unfreeze(); endEditing(0); fin.close(); setOrigin(); return MSTrue; } //////////////////////////////////////////////////////////////////// // // handling selections (cut and paste) // //////////////////////////////////////////////////////////////////// typedef enum // used in modifySelection() { SelectStart, SelectEnd, SelectExtendStart, SelectMove, SelectNone } SelectType; void MSTextEditor::unsetSelection() { modifySelection(0, SelectNone); } void MSTextEditor::selectionStart(const XEvent *e) { modifySelection(e, SelectStart); } void MSTextEditor::selectionAdjust(const XEvent *e) { modifySelection(e, SelectMove); } void MSTextEditor::selectionExtendAdjust(const XEvent *e) { modifySelection(e, SelectMove); } void MSTextEditor::selectionEnd(const XEvent *e) { modifySelection(e, SelectEnd); if (_regions[0].range[0] != -1) { MSString selection = extractSelectedContent(); if (selection.length() > 0) { XStoreBytes(display(), selection, selection.length()); } if (_refresh) { XDestroyRegion(_refresh); _refresh = 0; } } } void MSTextEditor::selectionExtendStart(const XEvent *e) { modifySelection(e, SelectExtendStart); } void MSTextEditor::insertSelection() { int n; char *buffer = XFetchBytes(display(), &n); if (n) { insert(buffer, n); XFree(buffer); } } void MSTextEditor::selectWord(const XEvent *) { //_time = noteTime(e); startMoving(); endMoving(); } void MSTextEditor::selectAll(const XEvent *) { //_time = noteTime(e); startMoving(); _regions[0].range[0] = 0; _regions[0].range[1] = LONG_MAX; updateTextRegion(&_regions[0], MSFalse); endMoving(); } void MSTextEditor::modifySelection(const XEvent *event, int mode) { XPoint p; long position; long a, b; TextLocation dot; if (event) { //_time = noteTime(event); initRefreshRegion(); notePosition((XEvent *)event, &p); dot.snip = NULL; dot.offset = 0; adjustSnipFirst(&dot); position = findPosition(&p, &dot); if (dot.snip && dot.snip->callback()) { if (mode == SelectStart) { dot.snip->activateCallback(); } _regions[0].range[0] = _regions[0].range[1] = -1; return; } } switch (mode) { case SelectNone: _regions[0].range[0] = _regions[0].range[1] = 0; return; case SelectStart: _regions[0].range[0] = _regions[0].range[1] = position; break; case SelectExtendStart: a = position - _regions[0].range[0]; b = position - _regions[0].range[1]; if (labs(b) > labs(a)) _regions[0].range[0] = _regions[0].range[1]; _regions[0].range[1] = position; break; case SelectMove: _regions[0].range[1] = position; break; case SelectEnd: _regions[0].range[1] = position; if (_regions[0].range[0] == position) { if (position != _cursor->position || _cursor->location.snip != dot.snip) { // ..because startMoving actually closes // the insertion point, this is done only // if position has really changed. This is // a kludge that doesn't really work, because // insert point gets closed in so many other // ways too, even if cursor is not moved!!! // Need to re-think the concept --msa startMoving(); _cursor->position = position; _cursor->location = dot; updateCursorPosition(MSTrue, MSTrue, MSTrue); endMoving(); } } break; default: break; } if (_regions[0].range[0] >= 0) updateTextRegion(&_regions[0], MSTrue); if (p.y > _origin.y + pHeight()) { _origin.y = p.y - pHeight(); redraw(); } if (p.y < _origin.y) { _origin.y = p.y; if (_origin.y < 0) _origin.y = 0; redraw(); } doRefreshRegions(); } /* MSBoolean MSTextEditor::insideSelection(int x, int y) { for (int n = 0; n < _num_regions; n++) { TextRegion *r = &_regions[n]; for (int i = 0; i < r->nrect; i++) if (x >= r->rect[i].x && x <= r->rect[i].x + r->rect[i].width - 1 && y >= r->rect[i].y && y <= r->rect[i].y + r->rect[i].height - 1) return MSTrue; } return MSFalse; } */ void MSTextEditor::markSelection(Drawable d) { int n, i; XSetForeground(display(), gc_Normal(), 1-background()); for (n = _num_regions; --n >= 0;) { TextRegion *r = &_regions[n]; int n; if (r->nrect > 0) { switch (r->mode) { case REVERSE: if (r->range[0] == -1) break; initRefreshRegion(); for (n=0; nnrect; n++) { r->rect[n].x -= _origin.x; r->rect[n].y -= _origin.y; _refresh = updateXRegion(_refresh, r->rect[n].x, r->rect[n].y, r->rect[n].width, r->rect[n].height); } XFillRectangles(display(), d, gc_Normal(), r->rect, r->nrect); for (n=0; nnrect; n++) { r->rect[n].x += _origin.x; r->rect[n].y += _origin.y; } break; case FRAME: if (r->range[0] == -1) break; // // Have to draw the rectangles individually // becuase the lines must be totally inside // the specified area (thus, assuming the // line width of 1, the following is result). // [change the code to cope with different // line widths later -- msa] // for (i = 0; i < r->nrect; ++i) XDrawRectangle(display(), d, gc_XOR(), r->rect[i].x, r->rect[i].y, r->rect[i].width - 1, r->rect[i].height - 1); break; default: break; } } } XSetForeground(display(), gc_Normal(), foreground()); } //////////////////////////////////////////////////////////////////// // // handling vertical and horizontal scrollbars // //////////////////////////////////////////////////////////////////// int MSTextEditor::pWidth() { return width() - 2*offset() - vsb()->width(); } int MSTextEditor::pHeight() { return height() - 2*offset() - hsb()->height(); } int MSTextEditor::offset() { return 1; } MSTextEditorTypes::Vsb::Vsb(MSWidget *owner_) : MSVScrollBar(owner_) { inc(20); _highlightThickness=0; acceptFocus(MSFalse); width(DefaultScrollBarSize); } MSTextEditorTypes::Vsb::~Vsb(void) {} void MSTextEditorTypes::Vsb::change(void) { MSTextEditor *p=(MSTextEditor *)owner(); p->scrollbarsUpdated(); } void MSTextEditorTypes::Vsb::drag(void) { change(); } MSTextEditorTypes::Hsb::Hsb(MSWidget *owner_) : MSHScrollBar(owner_) { inc(5); _highlightThickness=0; acceptFocus(MSFalse); height(DefaultScrollBarSize); } MSTextEditorTypes::Hsb::~Hsb(void) {} void MSTextEditorTypes::Hsb::change(void) { MSTextEditor *p=(MSTextEditor *)owner(); p->scrollbarsUpdated(); } void MSTextEditorTypes::Hsb::drag(void) { change(); } MSTextEditor::Panner::Panner(MSWidget *owner_) : MSPrimitive(owner_) { _shadowThickness=2; _highlightThickness=2; shadowStyle(MSSunken); //selectInput(ExposureMask|ButtonPressMask|ButtonMotionMask|ButtonReleaseMask); } MSTextEditor::Panner::~Panner(void) {} void MSTextEditor::Panner::expose(const XEvent *pEvent_) { if (pEvent_->xexpose.count==0) { MSTextEditor *p=(MSTextEditor *)owner(); XEvent er; while (XCheckWindowEvent(display(),window(),ExposureMask,&er)==MSTrue); p->redraw(); } } void MSTextEditor::resetScrollbars(void) { if (vsb()->value() != firstLine()) vsb()->valueChange(firstLine()); if (hsb()->value() != firstColumn()) hsb()->valueChange(firstColumn()); } void MSTextEditor::updateScrollbars(void) { if (vsb()->width()>1) { int last_line_y = 0; Snip *s; for (s = _first; s && s->next; s = s->next) { } if (s) { last_line_y = s->y; } if (last_line_y < pHeight()) last_line_y = pHeight() - 1; if (_origin.y > last_line_y) { // we're scrolled down too far _origin.y = last_line_y - pHeight() + 14; if (_origin.y < 0) _origin.y = 0; } vsb()->viewSize(pHeight()); vsb()->max(last_line_y-1); vsb()->pageInc(pHeight()-vsb()->inc()); vsb()->valueChange(_origin.y); if (vsb()->mapped()==MSFalse) vsb()->map(); } else if (vsb()->mapped()==MSTrue) vsb()->unmap(); if (hsb()->height()>1) { int maxx = pWidth()+1; for (Snip *s = _first; s; s = s->next) if (s->x > maxx) maxx = s->x; hsb()->viewSize(pWidth()); hsb()->max(maxx-1); hsb()->pageInc(pWidth()); hsb()->valueChange(_origin.x); if (hsb()->mapped()==MSFalse) hsb()->map(); } else if (hsb()->mapped()==MSTrue) hsb()->unmap(); } void MSTextEditor::scrollbarsUpdated(void) { _origin.y = vsb()->value(); _origin.x = hsb()->value(); int rh=vsb()->inc(); if(_cursor->y-rh<_origin.y || _cursor->y-_origin.y>vsb()->pageInc()) { startMoving(); XPoint p; p.x = _cursor->x; if(_cursor->y-rh<_origin.y) p.y = _origin.y+rh+5; else p.y = _origin.y+vsb()->pageInc()-rh; _cursor->location.snip=0; _cursor->location.offset=0; adjustSnipFirst(&_cursor->location); _cursor->position = findPosition(&p,&_cursor->location); _cursor->valid = MSTrue; updateCursorPosition(MSTrue, MSTrue, MSTrue); endMoving(); drawCursor(); } redrawImmediately(); } int MSTextEditor::numLines(void) { int n_lines = 0; for (Snip *s = _first; s && s->y < _origin.y; s = s->next) if (s->hasEndLine()) n_lines ++; return n_lines; } int MSTextEditor::computeMaxNumLines(void) { return 0; } int MSTextEditor::numColumns(void) { return pWidth(); } int MSTextEditor::computeMaxNumColumns(void) { return pWidth() * 4; // wrong } int MSTextEditor::firstLine(void) { return _origin.y; } int MSTextEditor::firstColumn(void) { return _origin.x; } //////////////////////////////////////////////////////////////////// // // background and foreground color setting API // //////////////////////////////////////////////////////////////////// void MSTextEditor::setColorBlack() { insert(GRSetForegroundBlack, 6); } void MSTextEditor::setColorRed() { insert(GRSetForegroundRed, 6); } void MSTextEditor::setColorGreen() { insert(GRSetForegroundGreen, 5); } void MSTextEditor::setColorYellow() { insert(GRSetForegroundYellow, 5); } void MSTextEditor::setColorBlue() { insert(GRSetForegroundBlue, 5); } void MSTextEditor::setColorMagenta() { insert(GRSetForegroundMagenta, 5); } void MSTextEditor::setColorCyan() { insert(GRSetForegroundCyan, 5); } void MSTextEditor::setColorWhite() { insert(GRSetForegroundWhite, 5); } void MSTextEditor::setColorDefault() { insert(GRSetForegroundDefault, 5); } void MSTextEditor::setBackColorBlack() { insert(GRSetBackgroundBlack, 5); } void MSTextEditor::setBackColorRed() { insert(GRSetBackgroundRed, 5); } void MSTextEditor::setBackColorGreen() { insert(GRSetBackgroundGreen, 5); } void MSTextEditor::setBackColorYellow() { insert(GRSetBackgroundYellow, 5); } void MSTextEditor::setBackColorBlue() { insert(GRSetBackgroundBlue, 5); } void MSTextEditor::setBackColorMagenta(){ insert(GRSetBackgroundMagenta, 5); } void MSTextEditor::setBackColorCyan() { insert(GRSetBackgroundCyan, 5); } void MSTextEditor::setBackColorWhite() { insert(GRSetBackgroundWhite, 5); } void MSTextEditor::setBackColorDefault(){ insert(GRSetBackgroundDefault, 5); } void MSTextEditor::setFontDefault() { insert(GRSetFontDefault, 5); } void MSTextEditor::setFont1() { insert(GRSetFont1, 5); } void MSTextEditor::setFont2() { insert(GRSetFont2, 5); } void MSTextEditor::setFont3() { insert(GRSetFont3, 5); } void MSTextEditor::setFont4() { insert(GRSetFont4, 5); } void MSTextEditor::setFont5() { insert(GRSetFont5, 5); } void MSTextEditor::setFont6() { insert(GRSetFont6, 5); } void MSTextEditor::setFont7() { insert(GRSetFont7, 5); } void MSTextEditor::setFont8() { insert(GRSetFont8, 5); } void MSTextEditor::setFont9() { insert(GRSetFont9, 5); } //////////////////////////////////////////////////////////////////// // // widget insertion // //////////////////////////////////////////////////////////////////// void MSTextEditor::insertWidget(MSWidget *widget_) { if (readonly()) { XBell(display(), 0); return; } if (!startEditing(CURRENT, 0)) return; widget_->reparent(panner()); widget_->show(); Snip *s = _inserting->appendSnip(); if (s) { s->widget = MSTrue; s->length = 0; s->data = 0; s->endseq = MSTextEditor::End; s->content.widget = widget_; s->content.widget->moveTo(s->x - _origin.x, s->y - _origin.y - (s->ascent + s->descent)); s->xWidth = s->content.widget->width(); s->ascent = s->content.widget->height(); s->descent = 0; } endEditing(0); } extern Bool double_buffering; void MSTextEditor::deleteForwardChar() { deleteOrKill(POSITION, 1, TEXT_DELETE); } void MSTextEditor::deleteBackwardChar() { deleteOrKill(POSITION, -1, TEXT_DELETE); } void MSTextEditor::deleteBackwardWord() { deleteOrKill(WORD, -1, TEXT_DELETE); } void MSTextEditor::deleteForwardWord() { deleteOrKill(WORD, 1, TEXT_DELETE); } void MSTextEditor::killBackwardWord() { deleteOrKill(WORD, -1, TEXT_KILL); } void MSTextEditor::killForwardWord() { deleteOrKill(WORD, 1, TEXT_KILL); } void MSTextEditor::killToEndOfLine() { deleteOrKill(LINE_END, 1, TEXT_KILL); } void MSTextEditor::deleteWholeContents() { freeze(); if (_inserting) _inserting->endContent(0); while (_first) Snip::Delete(&_first); if (_inserting) _inserting->_last = 0; // moveBeginningOfFile(); _cursor->location.snip = NULL; unfreeze(); } void MSTextEditor::deleteCurrentSelection() { } void MSTextEditor::killCurrentSelection() {} void MSTextEditor::insertNewLineAndBackup() { } void MSTextEditor::killToEndOfParagraph() { } void MSTextEditor::moveBackwardParagraph(){moveCursor(PARAGRAPH,-1);} void MSTextEditor::moveBackwardChar() { moveCursor(POSITION,-1); } void MSTextEditor::moveBackwardWord() { moveCursor(WORD,-1); } void MSTextEditor::moveBackwardPage() { moveCursor(PAGE,-1); } void MSTextEditor::moveBeginningOfFile() { moveCursor(ALL,-1); } void MSTextEditor::moveEndOfFile() { moveCursor(ALL,1); } void MSTextEditor::moveForwardChar() { moveCursor(POSITION,1); } void MSTextEditor::moveForwardParagraph(){ moveCursor(PARAGRAPH,1); } void MSTextEditor::moveForwardWord() { moveCursor(WORD,1); } void MSTextEditor::moveForwardPage() { moveCursor(PAGE,1); } void MSTextEditor::moveNextLine() { moveCursor(LINE,1); } void MSTextEditor::movePreviousLine() { moveCursor(LINE,-1); } void MSTextEditor::moveToLineEnd() { moveCursor(LINE_END,1); } void MSTextEditor::moveToLineStart() { moveCursor(LINE_BEGIN,1); } void MSTextEditor::moveToXY(int x,int y) { moveCursor(x,y); } void MSTextEditor::redrawDisplay() { redraw(); } void MSTextEditor::insert(const char *str_, long len_) { if (readonly()) { XBell(display(), 0); return; } if (len_ <= 0) return; if (!startEditing(CURRENT, 0)) return; if (len_ > 0 && str_) _inserting->feedContent(str_, len_); endEditing(0); } void MSTextEditor::insert(const char *str_) { insert(str_, strlen(str_)); } void MSTextEditor::insert(const char *str_, MSTextEditorTypes::TextFlowCallback *callback_) { if (readonly()) { XBell(display(), 0); return; } insert(str_, strlen(str_)); _cursor->location.snip->callback(callback_); //FIXME: //The above function copies the callback. So to maintain //MStk standard we just delete this callback here to avoid memory //leak. delete callback_; } MSTextEditor& operator<<(MSTextEditor& editor_, const char *str_) { editor_.insert(str_, strlen(str_)); return editor_; } void MSTextEditor::insertNewLine() { if (readonly()) { XBell(display(), 0); return; } if (!startEditing(CURRENT, 0)) return; _inserting->feedContent("\n", 1); endEditing(0); setOrigin(); } long MSTextEditor::findPosition(int x, int y) { XPoint p; p.x = x; p.y = y; TextLocation location; location.snip = NULL; location.offset = 0; adjustSnipFirst(&location); long position = findPosition(&p, &location); return position; } void MSTextEditor::moveCursor(int x, int y) { startMoving(); XRectangle rect; _cursor->getBounds(&rect); // to clear out old cursor mark XUnionRectWithRegion(&rect, _refresh, _refresh); endMoving(); startMoving(); XPoint p; p.x = x; p.y = y - 4; _cursor->location.snip = NULL; _cursor->location.offset = 0; adjustSnipFirst(&_cursor->location); _cursor->position = findPosition(&p, &_cursor->location); _cursor->valid = MSTrue; updateCursorPosition(MSTrue, MSTrue, MSTrue); endMoving(); drawCursor(); } void MSTextEditor::moveCursor(MSTextEditor::TextUnit moving_type, int amount) { if(moving_type==PAGE) { int v =_origin.y; int max=vsb()->max()-vsb()->viewSize(); if((amount<0&&v>vsb()->inc())||(amount>0&&vinc())) { v+=amount*vsb()->pageInc(); if(v<0) v=0; else if(v>max) v= max; vsb()->value(v); } else moveCursor(ALL,amount); return; } startMoving(); XRectangle rect; _cursor->getBounds(&rect); // to clear out old cursor mark XUnionRectWithRegion(&rect, _refresh, _refresh); endMoving(); startMoving(); long position = scanLocation(moving_type, amount, &_cursor->location); if (position < 0) { position = 0; _cursor->location.snip = NULL; _cursor->location.offset = 0; XBell(display(), 0); } _cursor->position = position; _cursor->valid = MSTrue; updateCursorPosition(MSBoolean(moving_type != LINE), MSTrue, MSTrue); endMoving(); drawCursor(); } void MSTextEditor::moveInsertionPoint(unsigned long location_) { freeze(); moveCursor(ALL,-1); moveCursor(POSITION, location_); unfreeze(); moveForwardChar(); moveBackwardChar(); // hack for getting attributes right setOrigin(); } MSTextEditorTypes::TextFlowCallback *MSTextEditor::NoCallback = 0; MSTextEditorTypes::TextFlowCallback::TextFlowCallback( MSTextEditorTypes::TextFlowCallback *cb_) { if (cb_) { _function = cb_->_function; _name = cb_->_name; _owner = cb_->_owner; } else { _function = 0; _name = ""; _owner = 0; } } MSTextEditorTypes::TextFlowCallback * MSTextEditor::getInsertionPointCurrentCallback() const { Snip *s = _cursor->location.snip; if (s) return s->callback(); return NoCallback; } static char *GRSetForegroundTable[] = { "\033[39m", "\033[30m", "\033[31m", "\033[32m", "\033[33m", "\033[34m", "\033[35m", "\033[36m", "\033[37m", }; const char * MSTextEditor::getInsertionPointCurrentForeground() const { Snip *s = _cursor->location.snip; int fn = 0; if (s) fn = Foreground_COLOR(s->mode.bits); if (fn <0 || fn>9) fn = 0; return GRSetForegroundTable[ fn ]; } static const char *GRSetBackgroundTable[] = { "\033[49m", "\033[40m", "\033[41m", "\033[42m", "\033[43m", "\033[44m", "\033[45m", "\033[46m", "\033[47m", }; const char * MSTextEditor::getInsertionPointCurrentBackground() const { Snip *s = _cursor->location.snip; int fn = 0; if (s) fn = Background_COLOR(s->mode.bits); if (fn <0 || fn>9) fn = 0; return GRSetBackgroundTable[ fn ]; } static const char *GRSetFontTable[] = { MSTextEditor::GRSetFontDefault, MSTextEditor::GRSetFont1, MSTextEditor::GRSetFont2, MSTextEditor::GRSetFont3, MSTextEditor::GRSetFont4, MSTextEditor::GRSetFont5, MSTextEditor::GRSetFont6, MSTextEditor::GRSetFont7, MSTextEditor::GRSetFont8, MSTextEditor::GRSetFont9, }; const char * MSTextEditor::getInsertionPointCurrentFont() const { Snip *s = _cursor->location.snip; int fn = 0; if (s) fn = Font_NUMBER(s->mode.bits); if (fn <0 || fn>9) fn = 0; return GRSetFontTable[ fn ]; } void MSTextEditor::moveCursor(unsigned long location_) { moveInsertionPoint(location_); } void MSTextEditor::startMoving() { initRefreshRegion(); if (_inserting) { Snip *s = _inserting->endContent(_refresh); _cursor->location.snip = s; _cursor->location.offset = s ? s->virtualLength() : 0; _cursor->valid = MSFalse; delete _inserting; //striv ??? _inserting = NULL; } } extern Region updateXRegion(Region region_, int x, int y, int w, int h); void MSTextEditor::setOrigin() { XPoint save_origin = _origin; if (_cursor->x - _origin.x < 0) { // cursor too far to the left? _origin.x = _cursor->x; } if (_cursor->x > _origin.x + pWidth()) { // cursor too far to the right? _origin.x += _cursor->x - _origin.x - pWidth() + 10; } int dy = _line_spacing; if (dy < 28) dy =28; if (_cursor->y - _origin.y < dy) { // up? _origin.y = _cursor->y - dy; if (_origin.y < dy) _origin.y = 0; } if (_cursor->y > _origin.y + pHeight() - dy/2) { // down? _origin.y += _cursor->y - (_origin.y + pHeight() - 4); } if (_origin.x != save_origin.x || _origin.y != save_origin.y) { initRefreshRegion(); updateCursorPosition(MSFalse, MSTrue, MSFalse); updateTextRegions(MSFalse); _refresh = updateXRegion(_refresh, _origin.x,_origin.y, pWidth(),pHeight()); doRefreshRegions(); resetScrollbars(); } } void MSTextEditor::endMoving() { _mult = 1; setOrigin(); doRefreshRegions(); resetScrollbars(); } // // FreeSnipsAndReturnLength // Release a snip chain and return virtual length of the // released section. // // *BUGS* // This function is now used to count the actual length of the // deleted section. But, because SnipMode changes are counted // as one position, this will give the wrong result when the // deleted section is different from the surrounding modes, but // which are equal. In this case the count will be off by 2. This // only affects range selection which shifts place if active. --msa // static int freeSnipsAndReturnLength(MSTextEditorTypes::Snip *s) { int length = 0; while (s) { if (s->hasEditableContents()) length += s->virtualLength(); MSTextEditorTypes::Snip::Delete(&s); } return length; } // // deleteOrKillRange // Remove a number of virtual chacters from the content. // Returns the *actual* number deleted (negative or positive // depending on the original direction of delete). // int MSTextEditor::deleteOrKillRange(int amount, DeleteOrKill mode) { if (readonly()) { XBell(display(), 0); return 0; } Snip *s; // TextLocation dot[2]; if (mode == TEXT_KILL) { // SelectionStruct sel; // put in selection buffer.... } s = deleteContent(_inserting, amount); int len = freeSnipsAndReturnLength(s); return amount > 0 ? len : -len; } void MSTextEditor::deleteOrKill(MSTextEditor::TextUnit move, int amount, DeleteOrKill mode) { if (readonly()) { XBell(display(), 0); return; } if (!startEditing(CURRENT, 0)) return; amount *= _mult; TextLocation dot; long end = scanLocation(move, amount, &dot); // Special handling for KILL to END LINE if (move == LINE_END && end == _cursor->position) end++; amount = deleteOrKillRange(end - _cursor->position, mode); endEditing(amount); setOrigin(); } // // "Close" a block of character content from further input. Return // the pointer to the last Snip of the context. // MSTextEditorTypes::Snip *MSTextEditorTypes::InsertContext::endContent(Region expose) { Snip *last = _last; if (expose && _expose) XUnionRegion(_expose, expose, expose); flushAppend(); if (last && !last->endseq && last->length == 0) { // // Avoid leaving empty snips, delete this. Empty Snip should be // restricted to transient existance while insert context is open. // Snip **h = last->back; adjustLastPointer(last); last = _last; Snip::Delete(h); } //freeContext(); return last; } // // Find a new location within content starting from current cursor location. // long MSTextEditor::scanLocation( TextUnit moving_type, int direction, TextLocation *dot) // New Location after the scan { Snip *s; MSTextEditorTextTag tag; XPoint xy; int n, prev_space; long position; int amount = direction; if (_inserting) _inserting->insertLocation(dot, (Region)0); else *dot = _cursor->location; adjustSnipFirst(dot); coordinates(dot->snip, dot->offset, &xy); if (!_cursor->valid) position = offset(dot); else position = _cursor->position; if ((s = dot->snip) == NULL) return position; // No real content // adjustSnipBeginning(dot); s = dot->snip; switch (moving_type) { case POSITION: position -= dot->offset; amount += dot->offset; dot->offset = 0; // // Move backwards one whole Snip at time until the position // requested is passed. // while (amount < 0 && s->back != &_first) { s = s->previous(); if (s->hasEditableContents()) { n = s->virtualLength(); amount += n; position -= n; dot->snip = s; } } // // Move forwards whole Snip at time until the position // requested is within current snip. // while (amount > 0 && s) { if (s->hasEditableContents() || s->hasEndLine()) // chris. { dot->snip = s; dot->offset = n = s->virtualLength(); if ((amount -= n) <= 0) { dot->offset += amount; position += dot->offset; break; } position += n; } s = s->next; } break; case LINE_END: // // Scan location to the end of line. End of line can either // be real or just result of the line breaking algorithm. // position -= dot->offset; dot->offset = 0; for (prev_space = 0; s ; s = s->next) { if (s->hasEditableContents()) { n = s->virtualLength(); position += n; dot->snip = s; dot->offset = n; prev_space = s->space; } if (s->hasEndLine()) { if (s->hasEditableContents() || prev_space) { // Back over the NL or SPACE // position -= 1; dot->offset -= 1; } break; } } break; case LINE_BEGIN: position -= dot->offset; dot->offset = 0; while (s->back != &_first) { s = s->previous(); if (s->hasEndLine()) break; if (s->hasEditableContents()) { position -= s->virtualLength(); dot->snip = s; } } break; case ALL: position -= dot->offset; dot->offset = 0; if (amount < 0) { position = 0; dot->snip = NULL; } else while (s) { if (s->hasEditableContents()) { n = s->virtualLength(); position += n; dot->offset = n; dot->snip = s; } s = s->next; } break; case WORD: #define IsWhiteSpace(s,o) ((s)->space || ((s)->endseq && (o) == (s)->length)) if (amount >= 0) { do { // // Skip white space // while (s) { if (!s->hasEditableContents()) { s = s->next; continue; } dot->snip = s; if (!IsWhiteSpace(s, dot->offset)) break; if (dot->offset == s->length) { position += s->hasEndPosition(); dot->offset = 0; s = s->next; } else { position += s->length - dot->offset; dot->offset = s->length; } } while (s) { if (!s->hasEditableContents()) { s = s->next; continue; } dot->snip = s; if (IsWhiteSpace(s, dot->offset)) break; if (dot->offset == s->length) { position += s->hasEndPosition(); dot->offset = 0; s = s->next; } else { position += s->length - dot->offset; dot->offset = s->length; } } } while (--amount > 0); } else if (amount < 0) { do { // // Skip white space backwards // while (s) { if (dot->offset == 0 || s->space) { position -= dot->offset; dot->offset = 0; adjustSnipEnding(dot); s = dot->snip; continue; } if (s->endseq && s->lengthoffset) { position -= 1; dot->offset = s->length; } else break; } // // Skip non-white space backwards // while (s) { if (dot->offset == 0) { adjustSnipEnding(dot); s = dot->snip; continue; } if (s->space||(s->endseq && s->lengthoffset)) break; position -= dot->offset; dot->offset = 0; } } while (++amount < 0); } // // Finetune the location (does not affect the virtual // offset). // if (direction > 0) adjustSnipEnding(dot); else adjustSnipBeginning(dot); break; case LINE: // // Pass over as many Snip_EndLine's as indicated by // amount. // position -= dot->offset; dot->offset = 0; if (amount > 0) do { if (s->hasEditableContents()) { n = s->virtualLength(); position += n; dot->snip = s; dot->offset = n; } if (s->hasEndLine()) amount -= 1; s = s->next; } while (s && amount > 0); else if (amount < 0) while (s->back != &_first) { s = s->previous(); if (s->hasEndLine()) { amount += 1; if (amount > 0) { s = s->next; break; } } if (s->hasEditableContents()) { n = s->virtualLength(); position -= n; dot->snip = s; dot->offset = 0; } } xy.x = _cursor->goal; xy.y = 0; // ..following is brute force, check sometime! --msa // adjustSnipBeginning(dot); position += findPosition(&xy, dot); break; case TAG: position -= dot->offset; tag = s->mode.tag; if (amount > 0) do if (s->hasEditableContents()) { if (s->mode.tag != tag) { tag = s->mode.tag; if (--amount == 0) break; } n = s->virtualLength(); position += n; dot->snip = s; dot->offset = n; } while ((s = s->next) != NULL); else if (amount < 0) { while (s->back != &_first) { s = s->previous(); if (s->hasEditableContents()) { if (s->mode.tag != tag) { tag = s->mode.tag; if (++amount == 0) break; } n = s->virtualLength(); position -= n; dot->snip = s; dot->offset = 0; } } } break; case PAGE: if (_first && _first->ascent + _first->descent != 0) { int h=_first->ascent + _first->descent; int lines=pHeight()/h; if(pHeight()-lines*hsnip; if (s == NULL) { return 0; } position -= dot->offset; dot->offset = 0; // // At head of loop, the following are true: // // r current Snip. // // position virtual offset difference from the beginning of // the search to the beginning the current Snip // being examined (r). // // ..it should not be this cryptic! Something is real messy here!! // Look into below someday.. --msa // while (r && !end_line) { x = r->x; y = r->y; if (y >= goal->y) { if (x >= goal->x) break; // Before current snip (r) // else if (!r->floating && x + r->xWidth >= goal->x) { int n = 0; if (!r->hasEditableContents()) break; // Non-Editable // while (++n <= r->length) if (x + snipWidth(r, r->data, n) > goal->x) break; // // Point within editable Snip, easy out... // dot->snip = r; dot->offset = n - 1; position += dot->offset; return position; } else if (r->hasEndLine()) end_line = 1; // Break after this Snip // } if (r->hasEditableContents()) { position += r->virtualLength(); s = r; } r = r->next; } // // If the loop exits, it means that requested position lies // between Snips, before the one indicated by 'r' (if non-NULL). // Locate the two possible points (next and previous editable Snips) // and select the one that is closer to the goal point horizontally! // if (r == s) { return position; // messy!! // } x = s->x - goal->x; if (!s->floating) x += (int)s->xWidth; if (x < 0) x = -x; for ( ;r; r = r->next) if (r->hasEditableContents()) { y = r->x - goal->x; if (y < 0) y = -y; if (y < x) { dot->snip = r; dot->offset = 0; return position; } break; } // The snip pointed by 's' is chosen, do some final "adjustements" // dot->snip = s; dot->offset = s->length; if (s->hasEndPosition()) position -= 1; else if ((s->xWidth == 0 || s->floating) && dot->offset > 0) { position -= 1; dot->offset -= 1; } return position; } // // adjusts the location to point the beginning of the equivalent // editable snip, if the current location is beyond the current Snip. // (Skip over empty snips, if any). // void MSTextEditor::adjustSnipBeginning(TextLocation *dot) { Snip *s = dot->snip; if (s && dot->offset >= s->virtualLength()) { while ((s = s->next) != NULL) if (s->hasEditableContents()) { dot->snip = s; dot->offset = 0; if (s->virtualLength() > 0) break; } } } // // adjusts the location to point the end of the previous editable // snip, if the current location is at beginning of a Snip. // (Skip over empty snips, if any). // void MSTextEditor::adjustSnipEnding(TextLocation *dot) { Snip *s = dot->snip; while (s && dot->offset == 0) { if (s->back == &_first) { dot->snip = NULL; break; } s = s->previous(); if (s->hasEditableContents()) { dot->snip = s; dot->offset = s->virtualLength(); } } } // // Cut abs(amount) number of *characters* from the current insertion // point. If amount > 0, then the characters are cut forward from the // insertion point. If amount < 0, then the characters are cut backward // from the instert position. // // The function returns a pointer to the cut content that has // been deleted from the main chain. This function does not release // the space! // MSTextEditorTypes::Snip * MSTextEditor::deleteContent(InsertContext *cx, long amount) { Snip *r, *t; int vlength; long delete_offset; if (cx == NULL) return NULL; Snip **h = cx->_last ? &cx->_last->next : cx->_list; if (amount > 0) { // // Delete/Cut forward. This operation never affects the // cx->_last pointer or the snip pointed by it (other // than possibly changing the following Snip after it). // for (t = *h; ; t = t->next) { if (t == NULL) { // return all from *h to end, cut chain at h // if ((t = *h) != NULL) { t->back = NULL; *h = NULL; } goto update_expose; } if (t->hasEditableContents()) { amount -= (vlength = t->virtualLength()); if (amount < 0) break; } } delete_offset = amount + vlength; if (delete_offset > 0 && delete_offset < vlength) { (void) Snip::Split(cx, t, delete_offset); } // // Return all from *h up to t, excluding t. t is always // non-NULL at this point. // r = *h; if (r == t) return NULL; *t->back = NULL; // Terminate chain (r) // r->back = NULL; *h = t; // Link chain (t) to h // t->back = h; // // Need to clear the valid flag of the next snip to MSFalse // so that the layout process knows from where to start // processing in partial layout. (Just deleting snips // does not necessarily leave any mark on the chain). // t->valid = MSFalse; // Hint for layout process // t = r; } else if (amount < 0) { // // Delete/Cut backward. This operation will always affect // cx->_last. // if ((t = cx->_last) == NULL) return NULL; // No delete backwards from begin if (t->next) t->next->valid = MSFalse; // Hint for layout process for (;; t = t->previous()) { if (t->hasEditableContents()) { amount += (vlength = t->virtualLength()); if (amount >= 0) break; } else if (t->back == cx->_list) { // // Reached beginning of the chain. Return // all from beginning up to *h. // cx->flushAppend(); if ((*t->back = *h) != NULL) (*h)->back = t->back; t->back = NULL; *h = NULL; cx->_last = NULL; goto update_expose; } } delete_offset = amount; // // The following is a special kludge to deal the deletion // of the last character of super/subscripts --msa // if (delete_offset > 0 && delete_offset == t->length && t->hasEndPosition() && !t->endseq) delete_offset -= 1; if (delete_offset > 0 && delete_offset < vlength) (void)Snip::Split(cx, t, delete_offset); // return all from t to *h // cx->flushAppend(); cx->adjustLastPointer(t); if ((*t->back = *h) != NULL) (*h)->back = t->back; *h = NULL; t->back = NULL; } else t = NULL; update_expose: h = cx->_last ? &cx->_last->next : cx->_list; for (r = t; r; ) { Snip *q; if (r->layout) { cx->updateExposeArea(r->x, r->y - r->ascent, r->xWidth, r->ascent + r->descent); r->layout = r->valid = MSFalse; } // // First fledgling attempt to deal with Content_PROTECTED. // Cut of the protected Snips from 't' chain and re-attach // them back to the main chain. // q = r; r = r->next; if (q->hasProtectedContents()) { if (q != t) { if ((*q->back = r) != NULL) r->back = q->back; } else { if ((t = r) != NULL) r->back = NULL; } // // Add q back to chain // if ((q->next = *h) != NULL) (*h)->back = &q->next; *h = q; q->back = h; h = &q->next; } } return t; } void MSTextEditor::tab() { } void MSTextEditor::shiftTab() { } void MSTextEditor::escape() { } void MSTextEditor::selectLine() { } void MSTextEditor::selectAll() { } void MSTextEditor::selectWord() { } //////////////////////////////////////////////////////////////////// // // handling mouse selections (cut and paste) // //////////////////////////////////////////////////////////////////// void MSTextEditor::buttonPress(const XEvent *pEvent_) { if (pEvent_->xbutton.subwindow != panner()->window()) return; if (traverseFocus(this) == MSTrue) { switch (pEvent_->xbutton.button) { case Button1: selectionStart(pEvent_); // start a new selection break; case Button2: insertSelection(); // paste current selection break; case Button3: selectionExtendStart(pEvent_); // extend current selection break; } } else { } } void MSTextEditor::motionNotify(const XEvent *pEvent_) { XEvent aEvent; if (XCheckWindowEvent(display(),window(),ButtonMotionMask,&aEvent)==MSTrue) return; if (pEvent_->xmotion.state & Button1Mask) selectionAdjust(pEvent_); // adjust current selection if (pEvent_->xmotion.state & Button3Mask) selectionExtendAdjust(pEvent_); // extend current selection } void MSTextEditor::buttonRelease(const XEvent *pEvent_) { switch (pEvent_->xbutton.button) { case Button1: case Button3: selectionEnd(pEvent_); // finish current selection break; } } MSTextEditorTypes::CursorTimer::CursorTimer(MSTextEditor *editor_,unsigned long interval_) : MSIntervalTimer(interval_) { _editor=editor_; } MSTextEditorTypes::CursorTimer::~CursorTimer(void) { } void MSTextEditorTypes::CursorTimer::process(void) { _editor->processCursorTimer(); } void MSTextEditor::processCursorTimer(void) { drawCursor(); } aplus-fsf-4.22/src/MSGUI/MSTextField.C0000644000265000001440000007300510772770415012744 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include static const int MSTextFieldDefaultHighlightThickness=2; static const int MSTextFieldDefaultShadowThickness=2; static const unsigned MSTextFieldDefaultMargin=0; static const unsigned long MSTextFieldDefaultBlinkRate=500; static const unsigned MSTextFieldDefaultMaxLength=128; static const char MSTextFieldDefaultInputMaskCharacter = '-'; typedef void (MSTextField::*PMFV)(void); typedef struct { char *_pString; PMFV _func; } TextKeys; typedef MSKeyClassCallback KT; static TextKeys KeyTable[]= { { "Return", &MSTextField::returnKey }, { "KP_Enter", &MSTextField::returnKey }, { "Escape", &MSTextField::escape }, { "BackSpace", &MSTextField::backspace }, { "Delete", &MSTextField::backspace }, { "Right", &MSTextField::forwardChar }, { "Left", &MSTextField::backwardChar }, { "Up", &MSTextField::up }, { "Down", &MSTextField::down }, { "!F27", &MSTextField::home }, { "Home", &MSTextField::home }, { "!R13", &MSTextField::end }, { "End", &MSTextField::end }, { "Ctrla", &MSTextField::home }, { "Ctrle", &MSTextField::end }, { "Ctrlk", &MSTextField::kill }, { "Ctrld", &MSTextField::deleteChar }, { "Ctrlf", &MSTextField::forwardChar }, { "Ctrlb", &MSTextField::backwardChar }, { "Ctrly", &MSTextField::yank }, { "~Meta~Ctrl~ShiftTab", &MSTextField::tab }, { "~Meta~Ctrl ShiftTab", &MSTextField::shiftTab }, { "!Insert", &MSTextField::insertKey }, { 0,0 } }; MSTextField::KeyTranslationFunction MSTextField::_keyTranslationFunction=0; MSTextField::CursorTimer::CursorTimer(MSTextField *textField_,unsigned long interval_) : MSIntervalTimer(interval_) { _textField=textField_; } MSTextField::CursorTimer::~CursorTimer(void) {} void MSTextField::CursorTimer::process(void) { _textField->processCursorTimer(); } MSTextField::MSTextField(MSWidget *owner_) : MSPrimitiveText(owner_) { init();} MSTextField::~MSTextField(void) { if (_imageMSGC!=0) delete _imageMSGC; if (cursorPixmap()!=0) delete _cursorPixmap; if (_blinkTimer!=0) delete _blinkTimer; } void MSTextField::init(void) { _cursorPixmap=0; _imageMSGC=0; _editMode=InsertMode; _highlightThickness=MSTextFieldDefaultHighlightThickness; _shadowThickness=MSTextFieldDefaultShadowThickness; _xMargin=MSTextFieldDefaultMargin; _yMargin=MSTextFieldDefaultMargin; shadowStyle(MSSunken); acceptFocus(MSTrue); maxLength(MSTextFieldDefaultMaxLength); _cursorPosition=length(); _scrollIndex=0; _cursorOn=MSFalse; _blinkOn=MSFalse; _haveFocus=MSFalse; _selectionStart=0; _selectionEnd=0; initKeyTranslations(); _blinkTimer=new CursorTimer(this,MSTextFieldDefaultBlinkRate); _blinkOn=MSTrue; stopBlinking(); _alignment=(MSAlignment)MSLeft; _inputMaskCharacter = MSTextFieldDefaultInputMaskCharacter; _masking = MSFalse; //Added stuff selectInput(ExposureMask|ButtonPressMask|ButtonReleaseMask); } GC MSTextField::imageGC(void) const { return _imageMSGC->gc(); } const char *MSTextField::string(void) { return (const char *)text(); } void MSTextField::initKeyTranslations(void) { if (MSKeyTranslationTable::keyTableData("MSTextField")==MSFalse) { keyTranslationTable()->addKeyTableData("MSTextField"); unsigned i=0; KT *entry; while (KeyTable[i]._pString!=0) { entry = new KT(KeyTable[i]._func ); keyTranslationTable()->addCallback(KeyTable[i]._pString,entry,"MSTextField"); i++; } } else keyTranslationTable()->addKeyTableData("MSTextField"); } void MSTextField::selectRange(unsigned startPos_,unsigned endPos_) { if (startPos_0) { _selectionStart=0; _selectionEnd=length(); clearCursor(); drawText(MSFalse); drawCursor(); } } void MSTextField::margin(unsigned margin_) { if (xMargin()!=margin_||yMargin()!=margin_) { _xMargin=margin_; _yMargin=margin_; redraw(); } } void MSTextField::xMargin(unsigned xMargin_) { if (xMargin()!=xMargin_) { _xMargin=xMargin_; redraw(); } } void MSTextField::yMargin(unsigned yMargin_) { if (yMargin()!=yMargin_) { _yMargin=yMargin_; redraw(); } } void MSTextField::editMode(EditingMode mode_) { _editMode=mode_; } void MSTextField::maxLength(unsigned len_) { _maxLength=len_; } void MSTextField::processCursorTimer(void) { drawCursor(); } void MSTextField::startBlinking(void) { if (blinkOn()==MSFalse&&haveFocus()==MSTrue) { blinkTimer()->reset(); _blinkOn=MSTrue; if (cursorOn()==MSFalse) drawCursor(); } } void MSTextField::stopBlinking(void) { blinkTimer()->stop(); clearCursor(); _blinkOn=MSFalse; } unsigned MSTextField::textX(void) { return (highlightThickness()+shadowThickness()+xMargin()); } unsigned MSTextField::textY(void) { int offset=highlightThickness()+shadowThickness()+yMargin(); int delta=height()-2*offset-textHeight(); delta=(delta>0)?delta>>1:0; return offset+delta+textAscent(); } void MSTextField::computeSize(void) { unsigned offset=highlightThickness()+shadowThickness()+yMargin(); height(textHeight()+2*offset); } unsigned MSTextField::computeVisibleLength(void) { unsigned offset=highlightThickness()+shadowThickness(); int w=width()-(2*offset+xMargin()); unsigned len=0; int tw=0; const char *pString=string(); for (unsigned pos=scrollIndex();pos>1)length()) position_=length(); const char *pString=string(); return (textX()+textWidth(pString+scrollIndex(),position_-scrollIndex())-1); } void MSTextField::clearCursor(void) { if (cursorOn()==MSTrue) drawCursor(); } void MSTextField::drawCursor(void) { if (blinkOn()==MSTrue&&haveFocus()==MSTrue) { _cursorOn=(cursorOn()==MSTrue)?MSFalse:MSTrue; (editMode()==InsertMode)?drawInsertCursor():drawOverstrikeCursor(); } } void MSTextField::drawInsertCursor(void) { if (cursorPixmap()!=0&&imageMSGC()!=0) { int offset=shadowThickness()+highlightThickness()+xMargin(); unsigned pos=cursorPosition(); int xx=positionToX(pos); xx-=(cursorPixmap()->width()>>1)-1; int src_x=0; int src_w=cursorPixmap()->width(); if (xxwidth()-(offset-xx); src_x=cursorPixmap()->width()-src_w; xx=offset; } else if (xx>width()-offset) src_w=cursorPixmap()->width()-xx+width()-offset; int yy=(textY()-textAscent())+(textHeight()-cursorPixmap()->height()); XCopyArea(display(),cursorPixmap()->pixmap(),window(),imageGC(), src_x,0,src_w,cursorPixmap()->height(),xx,yy); } } void MSTextField::drawOverstrikeCursor(void) { if (imageMSGC()!=0) { unsigned pos=cursorPosition(); unsigned x=positionToX(pos)+1; if (pos=length()) { newPosition_=length(); si=length()-len; } else if (scrollIndex()>0||cursorPosition()>=len) { if (newPosition_>cursorPosition()) { if (scrollIndex()+len==cursorPosition()) { si+=(newPosition_-cursorPosition()); si=si<=(maxLength()-len)?si:(maxLength()-len); } } else if (newPosition_0&&cursorPosition()==scrollIndex()) { si-=(cursorPosition()-newPosition_); si=(si>0)?si:0; } else if (scrollIndex()>0&&newPosition_0) { unsigned startPos=scrollIndex(); unsigned x=textX(); if (selectionStart()!=selectionEnd()) { if (selectionStart()==0&&selectionEnd()==length()) { XSetForeground(display(),textGC(),background()); XSetBackground(display(),textGC(),foreground()); XDrawImageString(display(),window(),textGC(),textFontStruct(),x,textY(),pString+startPos,len); } else { // draw in three sections unsigned endPos=startPos+len; unsigned i,dl1=0,dl2=0,dl3=0; // section 1 - unselected for (i=startPos;i0) { XSetForeground(display(),textGC(),foreground()); XSetBackground(display(),textGC(),background()); XDrawImageString(display(),window(),textGC(),textFontStruct(),x,textY(),pString+startPos,dl1); x+=textWidth(pString+startPos,dl1); } // section 2 - selected startPos+=dl1; for (i=startPos;i0) { XSetForeground(display(),textGC(),background()); XSetBackground(display(),textGC(),foreground()); XDrawImageString(display(),window(),textGC(),textFontStruct(),x,textY(),pString+startPos,dl2); x+=textWidth(pString+startPos,dl2); } // section 3 - unselected startPos+=dl2; if (startPos0) drawText(); else if (string()!=0) { const char *pString=string(); int offset=shadowThickness()+highlightThickness(); unsigned x=textX()+textWidth(string(),startPos_); int w=width()-(offset+xMargin()); int tw=x; unsigned len=0; unsigned long fg=foreground(),bg=background(); for (int pos=startPos_;pos0) { if (selectionStart()!=selectionEnd()) { if (selectionStart()==0&&selectionEnd()==length()) { XSetForeground(display(),textGC(),background()); XSetBackground(display(),textGC(),foreground()); XDrawImageString(display(),window(),textGC(),textFontStruct(),x,textY(),pString+startPos_,len); } else { // draw in three sections unsigned startPos=startPos_; unsigned endPos=startPos_+len; unsigned i,dl1=0,dl2=0,dl3=0; // section 1 - unselected for (i=startPos;i0) { XSetForeground(display(),textGC(),foreground()); XSetBackground(display(),textGC(),background()); XDrawImageString(display(),window(),textGC(),textFontStruct(),x,textY(),pString+startPos,dl1); x+=textWidth(pString+startPos,dl1); } // section 2 - selected startPos+=dl1; for (i=startPos;i0) { XSetForeground(display(),textGC(),background()); XSetBackground(display(),textGC(),foreground()); XDrawImageString(display(),window(),textGC(),textFontStruct(),x,textY(),pString+startPos,dl2); x+=textWidth(pString+startPos,dl2); } // section 3 - unselected startPos+=dl2; if (startPosxbutton.x); if (isDoubleClick(pEvent_)==MSTrue) defaultDoubleClickBehavior(pEvent_); else trackSelection(pEvent_); } void MSTextField::button2Press(const XEvent *pEvent_) { if (isSelected()==MSTrue) { clearSelection(); clearCursor(); drawText(MSFalse); } startEditing(OverstrikeMode,pEvent_->xbutton.x); } void MSTextField::button3Press(const XEvent *pEvent_) { if (isSelected()==MSTrue) { clearSelection(); clearCursor(); drawText(MSFalse); } startEditing(InsertMode,pEvent_->xbutton.x); } void MSTextField::startEditing(MSTextField::EditingMode mode_,unsigned x_) { // forse OverstrikeMode if we are masking. if(masking() == MSTrue) mode_ = OverstrikeMode; if (editMode()!=mode_) { clearCursor(); _editMode=mode_; } cursorPositionForw(computeCursorPosition(x_)); } void MSTextField::firstMapNotify(void) { createGCs(); if (width()==MSDefaultWidth&&height()==MSDefaultHeight) computeSize(); makeIBeamCursor(); } void MSTextField::redraw(void) { if (mapped()==MSTrue) { drawBackground(); drawShadow(); drawText(); if (haveFocus()==MSTrue&&cursorOn()==MSTrue) { (editMode()==InsertMode)?drawInsertCursor():drawOverstrikeCursor(); } } } void MSTextField::clearTextArea(void) { unsigned offset=shadowThickness()+highlightThickness(); XFillRectangle(display(),window(),backgroundShadowGC(), offset,offset,width()-2*offset,height()-2*offset); } void MSTextField::string(const char *pString_) { if (pString_!=0) { clearSelection(); stopBlinking(); unsigned newPos; if(_inputMask.length() > 0) { MSString aString = pString_; if(aString == "") { _masking = MSTrue; maxLength(_inputMask.length()); editMode(OverstrikeMode); _string = _inputMask; newPos = firstCursorPosition(); } else { // go to mask mode only if string matches with the mask. _masking=matchStringToMask(aString); if(_masking == MSFalse) maxLength(MSTextFieldDefaultMaxLength); else { maxLength(_inputMask.length()); editMode(OverstrikeMode); } _string = aString; newPos = length(); } } else { unsigned len=strlen(pString_); if (len<=maxLength()) _string=pString_; else _string=""; newPos = length(); } clearCursor(); clearTextArea(); _scrollIndex=0; _cursorPosition=0; moveCursor(newPos); drawText(); drawCursor(); startBlinking(); } } void MSTextField::insertString(const char *pString_) { if (pString_!=0) { unsigned slen=strlen(pString_); MSBoolean fullRedraw=MSFalse; stopBlinking(); if (selectionStart()!=selectionEnd()) { _string.remove(selectionStart(),selectionEnd()-selectionStart()); cursorPositionForw(selectionStart()); _string.insert(pString_,selectionStart()); clearSelection(); fullRedraw=MSTrue; } else if (editMode()==InsertMode||cursorPosition()==length()) { if (length()+slen<=maxLength()) (void)_string.insert(pString_,cursorPosition()); else { verifyBell(); startBlinking(); return; } } else (void)_string.overlayWith(pString_,cursorPosition()); unsigned oldPos=cursorPosition(); int offset=highlightThickness()+shadowThickness(); int tw=width()-(2*offset+xMargin()); const char *pString=string(); cursorPositionForw(cursorPosition()+slen); if (textWidth(pString+scrollIndex(),cursorPosition()-scrollIndex())>tw) { unsigned len=0; for (int pos=cursorPosition()-1;tw>0&&pos>=0;pos--) { tw-=charWidth(pString[pos]); if (tw>=0) len++; } _scrollIndex=cursorPosition()-len; drawText(); } else if (fullRedraw==MSFalse) drawText(oldPos); else drawText(); drawCursor(); startBlinking(); clearSelection(); } else verifyBell(); } void MSTextField::deleteString(unsigned startIndex_,unsigned numChars_) { if (startIndex_=cursorPosition()) { if (scrollIndex()>0) { _scrollIndex-=numChars_; _scrollIndex=(scrollIndex()>0)?scrollIndex():0; } } else _scrollIndex=startIndex_; cursorPosition(startIndex_); clearSelection(); drawText(); drawCursor(); startBlinking(); } else verifyBell(); } void MSTextField::focusIn(void) { _haveFocus=MSTrue; highlight(); startBlinking(); } void MSTextField::focusOut(void) { unHighlight(); stopBlinking(); _haveFocus=MSFalse; } void MSTextField::keyPress(const XEvent *pEvent_,KeySym keysym_,unsigned int state_,const char *pString_) { MSKeyPress keyPress(keysym_,state_); if (sensitive()==MSTrue) { if (keyTranslationTable()->hasMatch(keyPress)==MSTrue) { if( keyTranslate(keyPress) ==MSTrue) return; } else if (keyTranslationFunction()!=0) { const char *pString=(*_keyTranslationFunction)(pEvent_); if (pString!=0) { insertString(pString); return; } } if (isprint(pString_[0])) insertString(pString_); else key(keysym_,state_,pString_); } } void MSTextField::makeIBeamCursor(void) { if (firstMap()==MSTrue) { XSegment segments[3]; int cursorWidth=5; int cursorHeight=textHeight(); unsigned line_width=1; unsigned offset2=2*(highlightThickness()+shadowThickness()); if (cursorHeight>19) { cursorWidth++; line_width=2; } if (cursorHeight>height()-offset2) cursorHeight=height()-offset2; if (cursorWidth>width()-offset2) cursorWidth=width()-offset2; cursorHeight=(cursorHeight>0)?cursorHeight:1; cursorWidth=(cursorWidth>0)?cursorWidth:1; if (cursorPixmap()!=0) delete cursorPixmap(); _cursorPixmap=new MSPixmap(server(),"_textCursor",cursorWidth,cursorHeight, foreground()^background(),background()); GC fillGC=DefaultGC(display(),DefaultScreen(display())); XSetForeground(display(),fillGC,0); XSetBackground(display(),fillGC,1); // Fill the cursor with 0's XFillRectangle(display(),cursorPixmap()->pixmap(),fillGC, 0,0,cursorPixmap()->width(),cursorPixmap()->height()); // Draw the segments of the I-MSBeam // 1st segment is the top horizontal line of the 'I' segments[0].x1=0; segments[0].y1=line_width-1; segments[0].x2=cursorWidth; segments[0].y2=segments[0].y1; // 2nd segment is the bottom horizontal line of the 'I' segments[1].x1=0; segments[1].y1=cursorHeight-1; segments[1].x2=cursorWidth; segments[1].y2=segments[1].y1; // 3rd segment is the vertical line of the 'I' segments[2].x1=cursorWidth>>1; segments[2].y1=line_width-1; segments[2].x2=segments[2].x1; segments[2].y2=cursorHeight-1; XDrawSegments(display(),cursorPixmap()->pixmap(),imageGC(),segments,3); } } void MSTextField::createGCs(void) { if (imageMSGC()==0) { XGCValues values; unsigned long valueMask=(GCFunction|GCForeground|GCBackground); values.function=GXxor; values.foreground=foreground()^background(); values.background=background(); _imageMSGC=new MSGC(server(),MSTrue,&values,valueMask); } else imageMSGC()->color(foreground()^background(),background()); } void MSTextField::selfInsert(void) { insertString(selfInsertData()); selfInsertData(0); } void MSTextField::kill(void) { if(masking() == MSFalse) { const char *pString=string(); yankBuffer()=(pString+cursorPosition()); deleteString(cursorPosition(),length()-cursorPosition()); } } void MSTextField::yank(void) { if (masking() == MSFalse && yankBuffer().length()>0) insertString(yankBuffer()); } void MSTextField::tab(void) { activate(); } void MSTextField::home(void) { if (selectionStart()!=selectionEnd()) { clearSelection(); clearCursor(); drawText(); } cursorPosition(firstCursorPosition()); } void MSTextField::end(void) { if (selectionStart()!=selectionEnd()) { clearSelection(); clearCursor(); drawText(); } moveCursor(length()); } void MSTextField::deleteChar(void) { deleteString(cursorPosition(),1); } void MSTextField::backspace(void) { if (selectionStart()!=selectionEnd()) { unsigned startPos=selectionStart(),numChars=selectionEnd()-selectionStart(); clearSelection(); deleteString(startPos,numChars); } else if (cursorPosition() > firstCursorPosition()) deleteString(cursorPosition()-1,1); else verifyBell(); } void MSTextField::forwardChar(void) { if (selectionStart()!=selectionEnd()) { clearSelection(); clearCursor(); drawText(); } cursorPositionForw(cursorPosition()+1); } void MSTextField::backwardChar(void) { if (selectionStart()!=selectionEnd()) { clearSelection(); clearCursor(); drawText(); } if (cursorPosition() > firstCursorPosition()) cursorPositionBack(cursorPosition()-1); } void MSTextField::returnKey(void) { activate(); } void MSTextField::insertKey(void) { if(masking() == MSFalse) { clearCursor(); _editMode=(editMode()==InsertMode)?OverstrikeMode:InsertMode; } } void MSTextField::color(unsigned long fg_,unsigned long bg_) { if (fg_!=foreground()||bg_!=background()) { // try to optimize GC change by doing this here if (firstMap()==MSTrue&&imageMSGC()!=0) imageMSGC()->color(fg_^bg_,bg_); foreground(fg_); background(bg_); } } void MSTextField::updateBackground(unsigned long oldbg_) { MSPrimitiveText::updateBackground(oldbg_);updateCursor(); } void MSTextField::updateForeground(unsigned long oldfg_) { MSPrimitiveText::updateForeground(oldfg_);updateCursor(); } void MSTextField::updateFont(Font oldfid_) { MSPrimitiveText::updateFont(oldfid_);updateCursor(); } void MSTextField::updateCursor(void) { if (firstMap()==MSTrue) { clearCursor(); createGCs(); makeIBeamCursor(); redraw(); } } void MSTextField::scrollIndex(unsigned scrollIndex_) { if (_scrollIndex!=scrollIndex_) { _scrollIndex=scrollIndex_; redraw(); } } unsigned MSTextField::firstCursorPosition(void) const { return (masking() == MSFalse) ? 0 :inputMask().indexOf(inputMaskCharacter()); } void MSTextField::inputMask(const MSString& mask_) { _inputMask = mask_; if(_inputMask == "") { maxLength(MSTextFieldDefaultMaxLength); _masking = MSFalse; } else { string(_inputMask); _masking = MSTrue; maxLength(_inputMask.length()); editMode(OverstrikeMode); } } MSBoolean MSTextField::matchStringToMask(const MSString& aString_) const { MSBoolean match = MSFalse; if(_inputMask.length() == aString_.length()) { int i; for(i=0; i <_inputMask.length(); i++) { if(_inputMask(i)!=inputMaskCharacter() && _inputMask(i) != aString_(i)) break; } if (i == _inputMask.length()) match = MSTrue; } return match; } // ######################################################### // default virtual methods - prevents gratuitous inlining // ######################################################### void MSTextField::activate(void) {} void MSTextField::escape(void) {} void MSTextField::shiftTab(void) {} void MSTextField::up(void) {} void MSTextField::down(void) {} MSBoolean MSTextField::isSelected(void) const { if (selectionStart()!=0||selectionEnd()!=0) return MSTrue; else return MSFalse; } void MSTextField::trackSelection(const XEvent *pEvent_) { unsigned len=length(); if (len>0) { int startX=pEvent_->xbutton.x; int startPos=computeCursorPosition(startX); int pos=startPos; int lastPos=startPos; Window root,child; int rx,ry,winx,winy; unsigned keys; int sameScreen=XQueryPointer(display(),window(),&root,&child,&rx,&ry,&winx,&winy,&keys); while (keys&Button1Mask) { if (sameScreen==True) { if (winx<=(int)textX()) { if (scrollIndex()>0) { _scrollIndex--; } if (--pos<0) pos=0; } else if (winx>width()) { unsigned len=computeVisibleLength(); if (scrollIndex()+len #include #ifdef MS_NO_INLINES #include #endif MSTextRect::MSTextRect(MSWidget *owner_) : _owner(owner_) { _owner=owner_; init(); } MSTextRect::MSTextRect(MSWidget *owner_,const char *pString_) : _owner(owner_),_string(pString_) { init(); } MSTextRect::MSTextRect(MSWidget *owner_,const MSString& aString_) : _owner(owner_),_string(aString_) { init(); } MSTextRect::~MSTextRect(void) { if (stipple()!=0) delete _stipple; } void MSTextRect::init() { configuration(0,0,10,10); _textFontStruct=0; _fg=owner()->foreground(); _bg=owner()->background(); _sensitive=MSTrue; _stipple=new MSPixmap(owner()->server(),MSPixmap::ForegroundFiftyPixmap,1,0,1); _fid=owner()->font(); XGCValues values; values.foreground=foreground(); values.background=background(); values.font=font(); values.stipple=stipple()->pixmap(); values.fill_style=FillSolid; _textMSGC.setGCValues(server(),MSTrue,&values, (GCForeground|GCBackground|GCFont|GCStipple|GCFillStyle)); _textFontStruct=(XFontStruct *)server()->fontStruct(font()); computeSize(); } GC MSTextRect::textGC(void) const { return _textMSGC.gc(); } // this will use ref counting - const char * will have to make a copy MSBoolean MSTextRect::label(const MSString& aString_) { if (label()!=aString_) { _string=aString_; return MSTrue; } else return MSFalse; } MSBoolean MSTextRect::label(const char *pString_) { if (label()!=pString_) { _string=pString_; return MSTrue; } else return MSFalse; } void MSTextRect::computeSize(void) {} void MSTextRect::font(Font fid_) { if (fid_!=0&&fid_!=font()) { Font oldfid=_fid; _fid=fid_; textMSGC().font(fid_); _textFontStruct=(XFontStruct *)server()->fontStruct(font()); computeSize(); updateFont(oldfid); } } void MSTextRect::foreground(unsigned long pixel_) { if (foreground()!=pixel_) { unsigned long oldfg=_fg; _fg=pixel_; textMSGC().foreground(foreground()); updateForeground(oldfg); } } void MSTextRect::background(unsigned long pixel_) { if (background()!=pixel_) { unsigned long oldbg=_bg; _bg=pixel_; textMSGC().background(background()); updateBackground(oldbg); } } void MSTextRect::sensitive(MSBoolean sensitive_) { if (sensitive()!=sensitive_) { _sensitive=sensitive_; if (sensitive()) textMSGC().fillStyle(FillSolid); else textMSGC().fillStyle(FillStippled); updateSensitivity(); } } // subclass should override for notification of changes void MSTextRect::updateForeground(unsigned long) {} void MSTextRect::updateBackground(unsigned long) {} void MSTextRect::updateFont(Font) {} void MSTextRect::updateSensitivity(void) {} aplus-fsf-4.22/src/MSGUI/MSTimeEntryField.C0000644000265000001440000001143110772770415013733 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include MSTimeEntryField::MSTimeEntryField(MSWidget *owner_, const char *label_,const MSSymbol& tag_) : MSEntryFieldPlus(owner_,label_,tag_) { internalCouple(new MSTime(MSTime::now())); init(); } MSTimeEntryField::MSTimeEntryField(MSWidget *owner_,MSTime& model_, const char *label_,const MSSymbol& tag_) : MSEntryFieldPlus(owner_,label_,tag_) { model(model_); init(); } MSTimeEntryField::~MSTimeEntryField(void) {} void MSTimeEntryField::init(void) { _minimumValue.unset(); _maximumValue.unset(); _format=MSFormat(MSTime::HoursMinutesSecondsSlash4Zone); _incrementValue=1; _timeZone=MSTime::Local; } void MSTimeEntryField::model(MSTime& model_) { couple(&model_); } void MSTimeEntryField::model(const MSTime& model_) { constCouple(&model_); } void MSTimeEntryField::updateData(void) { if (MSView::model()==0) internalCouple(new MSTime(MSTime::now())); MSEntryFieldPlus::updateData(); } const char *MSTimeEntryField::formatOutput(MSString &buffer_) { if (MSView::model()!=0) value().format(buffer_,format(),timeZone()); return buffer_.string(); } MSBoolean MSTimeEntryField::validate(const char *pString_) { if (MSView::model()!=0) { MSTime aTime; if (aTime.set(pString_,timeZone())==MSError::MSSuccess) { if (minimumValue().isSet()==MSTrue&&maximumValue().isSet()==MSTrue) { if (aTime>=minimumValue()&&aTime<=maximumValue()) { value()=aTime; return MSTrue; } } else if (minimumValue().isSet()==MSTrue) { if (aTime>=minimumValue()) { value()=aTime; return MSTrue; } } else if (maximumValue().isSet()==MSTrue) { if (aTime<=maximumValue()) { value()=aTime; return MSTrue; } } else { value()=aTime; return MSTrue; } } } return MSFalse; } void MSTimeEntryField::increment(void) { if (MSView::model()!=0) { if (maximumValue().isSet()==MSTrue) { MSTime aTime=value(); aTime+=incrementValue(); if (aTime<=maximumValue()) { value()=aTime; valueChange(); } } else { value()+=incrementValue(); valueChange(); } } } void MSTimeEntryField::decrement(void) { if (MSView::model()!=0) { if (minimumValue().isSet()==MSTrue) { MSTime aTime=value(); aTime-=incrementValue(); if (aTime>=minimumValue()) { value()=aTime; valueChange(); } } else { value()-=incrementValue(); valueChange(); } } } void MSTimeEntryField::generateInputMask(void) { MSString mask; switch(format().timeFormat()) { case MSTime::HoursMinutesSeconds: mask="--:--:--"; break; case MSTime::MonthDayYear: mask="--/--/----"; break; case MSTime::HoursMinutesSecondsSlash: mask="--:--:-- --/--/--"; break; case MSTime::HoursMinutesSecondsSlash4: mask="--:--:-- --/--/----"; break; default: mask=""; break; } if(inputMaskCharacter()!='-' && mask!="") mask.change('-',inputMaskCharacter()); fieldEditor()->inputMask(mask); } void MSTimeEntryField::timeZone(MSTime::MSTimeZone timeZone_) { if (_timeZone!=timeZone_) { _timeZone=timeZone_; drawFieldValue(); } } void MSTimeEntryField::set(MSAttrValueList& avList_) { MSEntryFieldPlus::set(avList_); MSIndexVector index; for (unsigned i=0;i #include MSTitleMenuItem::MSTitleMenuItem(MSMenu *owner_) : MSMenuItem(owner_) { init(); } MSTitleMenuItem::MSTitleMenuItem(MSMenu *owner_, const char *title_) : MSMenuItem(owner_, title_) { init(); } MSTitleMenuItem::MSTitleMenuItem(MSMenu *owner_, const MSString& title_) : MSMenuItem(owner_,title_) { init(); } MSTitleMenuItem::~MSTitleMenuItem(void) {} void MSTitleMenuItem::init(void) { _alignment=MSCenter; _mnemonic=0; _sensitive=MSFalse; } void MSTitleMenuItem::updateSensitivity(void) { _sensitive=MSFalse; } void MSTitleMenuItem::alignment(MSAlignment alignment_) { if(alignment_!= alignment()) { if(alignment_==MSLeft || alignment_==MSCenter) { _alignment=alignment_; redraw(); } } } int MSTitleMenuItem::computeXCoord(void) { if(alignment()==MSLeft) return MSMenuItem::computeXCoord(); else { int offset = highlightThickness()+shadowThickness()+marginWidth(); int dw= width()-2*offset; const char *pString=label(); int tw=fontObject()->textWidth(pString, label().length()); int space =0; if(dw MSToggleButton::MSToggleButton(MSWidget *owner_,const char *label_,const MSSymbol& tag_) : MSToggleButtonBase(owner_,label_,tag_) {init();} MSToggleButton::MSToggleButton(MSWidget *owner_,const MSStringVector& label_, const MSSymbol& tag_) : MSToggleButtonBase(owner_,label_,tag_) {init();} MSToggleButton::MSToggleButton(MSWidget *owner_,const MSPixmap &pixmap_, const MSPixmap &insensitivePixmap_, const MSPixmap &armedPixmap_,const MSSymbol& tag_) : MSToggleButtonBase(owner_,pixmap_,insensitivePixmap_,armedPixmap_,tag_) {init();} MSToggleButton::MSToggleButton(MSWidget *owner_,const char *label_,int integerTag_) : MSToggleButtonBase(owner_,label_,integerTag_) {init();} MSToggleButton::MSToggleButton(MSWidget *owner_,const MSStringVector& label_,int integerTag_) : MSToggleButtonBase(owner_,label_,integerTag_) {init();} MSToggleButton::MSToggleButton(MSWidget *owner_,const MSPixmap &pixmap_, const MSPixmap &insensitivePixmap_, const MSPixmap &armedPixmap_,int integerTag_) : MSToggleButtonBase(owner_,pixmap_,insensitivePixmap_,armedPixmap_,integerTag_) {init();} MSToggleButton::~MSToggleButton() { } void MSToggleButton::init(void) { _spacing=0; _toggleShadowThickness =0; } void MSToggleButton::redraw(void) { if (owner()->mapped()==MSTrue) { int ht=highlightThickness(); XFillRectangle(display(),window(), (armed()==MSTrue)?selectGC():backgroundShadowGC(), ht,ht,width()-(ht<<1),height()-(ht<<1)); if(highlighted()==MSTrue) drawHighlight(); else undrawHighlight(); if (pixmap()==0) drawLabel(); else drawPixmap(); (armed()==MSTrue)?drawSunken():drawRaised(); } } void MSToggleButton::disarm(void) { if (armed()==MSTrue) { setDisarmState(); redraw(); } } void MSToggleButton::arm(void) { if (armed()==MSFalse) { setArmState(); redraw(); } } aplus-fsf-4.22/src/MSGUI/MSToggleButtonBase.C0000644000265000001440000001605210772770415014263 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include static const int MSToggleButtonBaseDefaultSpacing=4; static const int MSToggleButtonBaseDefaultShadowThickness=2; MSToggleButtonBase::MSToggleButtonBase(MSWidget *owner_,const char *label_,const MSSymbol& tag_) : MSActionButton(owner_,label_,tag_) { init(); } MSToggleButtonBase::MSToggleButtonBase(MSWidget *owner_,const MSStringVector& label_, const MSSymbol& tag_) : MSActionButton(owner_,label_,tag_) { init(); } MSToggleButtonBase::MSToggleButtonBase(MSWidget *owner_,const MSPixmap &pixmap_, const MSPixmap &insensitivePixmap_, const MSPixmap &armedPixmap_,const MSSymbol& tag_) : MSActionButton(owner_,pixmap_,insensitivePixmap_,armedPixmap_,tag_) { init(); } MSToggleButtonBase::MSToggleButtonBase(MSWidget *owner_,const char *label_,int integerTag_) : MSActionButton(owner_,label_,integerTag_) { init(); } MSToggleButtonBase::MSToggleButtonBase(MSWidget *owner_,const MSStringVector& label_,int integerTag_) : MSActionButton(owner_,label_,integerTag_) { init(); } MSToggleButtonBase::MSToggleButtonBase(MSWidget *owner_,const MSPixmap &pixmap_, const MSPixmap &insensitivePixmap_, const MSPixmap &armedPixmap_,int integerTag_) : MSActionButton(owner_,pixmap_,insensitivePixmap_,armedPixmap_,integerTag_) { init(); } MSToggleButtonBase::~MSToggleButtonBase() {} void MSToggleButtonBase::init(void) { _spacing=MSToggleButtonBaseDefaultSpacing; _toggleShadowThickness=MSToggleButtonBaseDefaultShadowThickness; _selectColor=selectShadowColor(); _alignment=(MSAlignment)MSLeft; createGCs(); } void MSToggleButtonBase::createGCs(void) { XGCValues gcvalues; unsigned long valueMask=GCForeground|GCBackground; gcvalues.foreground=selectColor(); gcvalues.background=background(); _selectMSGC.setGCValues(server(), MSTrue,&gcvalues,valueMask); } void MSToggleButtonBase::toggleShadowThickness(int thickness_) { if (toggleShadowThickness()!=thickness_) { _toggleShadowThickness=thickness_; computeSize(); } } void MSToggleButtonBase::selectColor(const char *color_) { selectColor(server()->pixel(color_)); } void MSToggleButtonBase::selectColor(unsigned long pixel_) { if (selectColor()!=pixel_) { _selectColor=pixel_; selectMSGC().foreground(pixel_); redraw(); } } void MSToggleButtonBase::redraw(void) { if (owner()->mapped()==MSTrue) { MSWidgetCommon::drawBackground(); if(highlighted()==MSTrue) drawHighlight(); else undrawHighlight(); drawSymbol(); if (pixmap()==0) drawLabel(); else drawPixmap(); } } int MSToggleButtonBase::computePixmapXCoord(const MSPixmap *pmap_) { int offset=highlightThickness()+shadowThickness()+margin(); int r; if (alignment()&MSLeft) r=offset+textHeight()+spacing(); else if (alignment()&MSRight) r=width()-offset-pmap_->width(); else { int leftOffset=highlightThickness()+shadowThickness()+margin()+textHeight()+spacing(); r=(width()-leftOffset-pmap_->width())/2+leftOffset; } return r; } int MSToggleButtonBase::computePixmapYCoord(const MSPixmap *pmap_) { int offset=highlightThickness()+shadowThickness()+margin(); int r; if (alignment()&MSTop) r=offset; else if (alignment()&MSBottom) r=height()-offset-pmap_->height(); else r=(height()-pmap_->height())/2; return r; } void MSToggleButtonBase::configure(void) { int Xoffset=highlightThickness()+shadowThickness()+margin()+textHeight()+spacing(); int Yoffset=highlightThickness()+shadowThickness()+margin(); XRectangle clipRect[1]; clipRect[0].x=0; clipRect[0].y=0; clipRect[0].width=drawWidth(); clipRect[0].height=drawHeight(); XSetClipRectangles(display(),textGC(),Xoffset,Yoffset,&clipRect[0],1,Unsorted); redraw(); } void MSToggleButtonBase::computeSize(void) { int oldW=width(); int oldH=height(); int newW,newH; int offset =(highlightThickness()+shadowThickness()+margin())<<1; if (pixmap()!=0) { newW=pixmap()->width()+textHeight()+spacing()+offset; newH=pixmap()->height()+offset; } else { newW=maxPixelWidth()+textHeight()+spacing()+offset; newH=rows()*textHeight()+offset; } if (oldW==newW&&oldH==newH) redraw(); else resize(newW,newH); } int MSToggleButtonBase::computeXCoord(int /*row_*/,int col_,const char *pString_,int len_) { int offset=highlightThickness()+shadowThickness()+margin(); int leftOffset=offset+textHeight()+spacing(); int r=0; if (pString_!=0) { if (alignment()&MSLeft) r=leftOffset+textWidth(pString_,col_); else if (alignment()&MSRight) { int xs=width()-offset-textWidth(pString_,len_); r=xs+textWidth(pString_,col_); } else { int delta=drawWidth()-textWidth(pString_,len_)-leftOffset; delta=(delta>0)?delta>>1:0; r=leftOffset+delta+textWidth(pString_,col_); } } return r; } void MSToggleButtonBase::button1Press(const XEvent *) { (armed()==MSFalse)?arm():disarm(); } void MSToggleButtonBase::key(KeySym keysym_,unsigned int,const char *) { if (keysym_==XK_Return) { (armed()==MSFalse)?arm():disarm(); } else if (keysym_==XK_Up) up(); else if (keysym_==XK_Down) down(); else if (keysym_==XK_Left) left(); else if (keysym_==XK_Right) right(); } void MSToggleButtonBase::arm(void) { setArmState(); } void MSToggleButtonBase::disarm(void) { setDisarmState(); } void MSToggleButtonBase::set(MSAttrValueList& avList_) { MSActionButton::set(avList_); MSIndexVector index; for (unsigned i=0;icolorName(selectColor()),MSAttrValue::Color); avList_< #include #include #include MSToggleMenuItem::MSToggleMenuItem(MSMenu *owner_) : MSMenuItem(owner_) { init(); } MSToggleMenuItem::MSToggleMenuItem(MSMenu *owner_,const char *label_,char mnemonic_,int tag_) : MSMenuItem(owner_,label_,mnemonic_,tag_) { init(); } MSToggleMenuItem::MSToggleMenuItem(MSMenu *owner_,const MSString& label_,char mnemonic_,int tag_) : MSMenuItem(owner_,label_,mnemonic_,tag_) { init(); } MSToggleMenuItem::MSToggleMenuItem(MSMenu *owner_,const MSPixmap &pixmap_,const MSPixmap &insensitivePixmap_,int tag_) : MSMenuItem(owner_,pixmap_,insensitivePixmap_,tag_) { init(); } MSToggleMenuItem::MSToggleMenuItem(MSMenu *menu_,const MSString &label_,const MSPixmap &pixmap_,const MSPixmap &armedPixmap_, const MSPixmap &insensitivePixmap_,char mnemonic_,int tag_): MSMenuItem(menu_,label_,pixmap_,insensitivePixmap_,mnemonic_,tag_) { init(); initArmedPixmap(armedPixmap_); } MSToggleMenuItem::MSToggleMenuItem(MSMenu *menu_,const char* label_,const MSPixmap &pixmap_,const MSPixmap &armedPixmap_, const MSPixmap &insensitivePixmap_,char mnemonic_,int tag_): MSMenuItem(menu_,label_,pixmap_,insensitivePixmap_,mnemonic_,tag_) { init(); initArmedPixmap(armedPixmap_); } MSToggleMenuItem::~MSToggleMenuItem(void) { if (_armedPixmap!=0) delete _armedPixmap; } void MSToggleMenuItem::init(void) { _selectColor=selectShadowColor(); XGCValues gcvalues; unsigned long valueMask=GCForeground; gcvalues.foreground=selectColor(); _selectMSGC.setGCValues(server(), MSTrue,&gcvalues,valueMask); _armedPixmap=0; showDisarmState(MSTrue); } void MSToggleMenuItem::initArmedPixmap(const MSPixmap &armedPixmap_) { if (armedPixmap_.server()==server()) _armedPixmap=new MSPixmap(armedPixmap_); else { MSMessageLog::warningMessage("Warning : armedPixmap supplied is invalid, using default"); _armedPixmap=createDefaultPixmap(armedPixmap_.width(),armedPixmap_.height(), armedPixmap_.foreground(),armedPixmap_.background()); } } void MSToggleMenuItem::armedPixmap(const MSPixmap &pixmap_) { MSPixmap *tmp=_pixmap; if (pixmap_.server()==server()) _armedPixmap=new MSPixmap(pixmap_); else { MSMessageLog::warningMessage("Warning :armedPixmap supplied for MSToggleMenuItem is invalid, using default"); _armedPixmap=createDefaultPixmap(pixmap_.width(),pixmap_.height(), pixmap_.foreground(),pixmap_.background()); } if (tmp!=0) delete tmp; if (dynamic()==MSTrue) computeSize(); else if (owner()->mapped()==MSTrue) { redraw(); (armed()==MSTrue)?drawSunken():drawRaised(); } } void MSToggleMenuItem::selectColor(const char *color_) { selectColor(server()->pixel(color_)); } void MSToggleMenuItem::selectColor(unsigned long pixel_) { if (_selectColor!=pixel_) { _selectColor=pixel_; _selectMSGC.foreground(pixel_); } } void MSToggleMenuItem::computeSize(void) { int oldW=width(); int oldH=height(); int pixmapW=pixmapWidth(); int pixmapH=pixmapHeight(); int labelW=labelWidth(); int labelH=labelHeight(); int symbolW=symbolWidth(); int symbolH=symbolHeight(); int widthOffset=(highlightThickness()+shadowThickness()+marginWidth())<<1; int heightOffset=(highlightThickness()+shadowThickness()+marginHeight())<<1; int width = widthOffset+indent(); int height = heightOffset; if (showState()==ShowLabel) // the label is drawn to the right of the symbol { width += labelW; height += labelH>symbolH?labelH:symbolH; } else if ( showState() == ShowPixmap) // the pixmap is drawn to the right of the symbol { width += pixmapW; height +=pixmapH>symbolH?pixmapH:symbolH; } else { width += labelW ; height += pixmapH>labelH?pixmapH:labelH; } if(width==oldW&&height==oldH) redraw(); else resize(width,height); } int MSToggleMenuItem::computeIndentation(void) { // pixmap is displayed on the left hand side its with therefore is used to compute // indentation if ( showState() == ShowBoth) return pixmap()->width() + spacing(); // return pixmapWidth() + spacing(); else return symbolWidth() + spacing(); } const MSPixmap *MSToggleMenuItem::currentPixmap(void) const { if (sensitive()==MSFalse) { return insensitivePixmap()!=0 ? insensitivePixmap():0;} if ( showState() ==ShowPixmap ) return pixmap()!=0 ? pixmap():0; // pixmap is displayed on the left hand side, its value reflects menuItems state else { if (armed()==MSTrue)return (armedPixmap()!=0)? armedPixmap():0; else if (showDisarmState()==MSTrue) return pixmap()!=0 ? pixmap():0; return 0; } } int MSToggleMenuItem::symbolHeight(void) const { return 0; } int MSToggleMenuItem::symbolWidth(void) const { return 0; } void MSToggleMenuItem::set(MSAttrValueList& avList_) { MSMenuItem::set(avList_); MSIndexVector index; for (unsigned i=0;icolorName(selectColor()),MSAttrValue::Color); MSStringVector aStringVector("MSTrue\nMSFalse"); avList_< #include #include #if HAVE_IOSTREAM #include #else #include #endif const char * const MSToolTipDefaultForeground="black"; const char * const MSToolTipDefaultBackground="yellow"; unsigned MSToolTipDefaultMarginHeightForBubble=8; unsigned MSToolTipDefaultMarginWidthForBubble=0; unsigned MSToolTipDefaultMarginHeightForBox=3; unsigned MSToolTipDefaultMarginWidthForBox=3; unsigned long MSToolTipDefaultDelay=500; MSBoolean MSToolTip::_displayToolTip(MSTrue); class ToolTipTimer : public MSIntervalTimer { private: MSToolTip *_toolTip; public: ToolTipTimer(unsigned long,MSToolTip*); ~ToolTipTimer(void); virtual void process(void); }; MSToolTip::MSToolTip(MSDisplayServer *server_) : MSWidget(server_) { _displayFor=0; _tailPosition=Top|Left; _style=Bubble; _fg=server()->pixel(MSToolTipDefaultForeground); _bg=server()->pixel(MSToolTipDefaultBackground); _marginHeight=MSToolTipDefaultMarginHeightForBubble; _marginWidth=MSToolTipDefaultMarginWidthForBubble; _bubbleMarginWidth=0; _bubbleMarginHeight=0; _delay=MSToolTipDefaultDelay; _timer=new ToolTipTimer(delay(),this); timer()->stop(); _fontObject.fontStruct(server()->fontStruct(font())); _eventMask=ExposureMask; XSetWindowAttributes attributes; unsigned long valueMask=CWOverrideRedirect|CWSaveUnder|CWBackPixmap|CWEventMask; attributes.save_under=True; attributes.override_redirect=True; attributes.background_pixmap=None; attributes.event_mask=ExposureMask; _window=XCreateWindow(display(),server()->root(),0,0,1,1,0, CopyFromParent,InputOutput,CopyFromParent,valueMask, &attributes); XGCValues values; valueMask=GCFont; values.font=font(); _gc=XCreateGC(display(),window(),valueMask,&values); server()->widgetHashTable()->add(window(),this); } MSToolTip::~MSToolTip(void) { XFreeGC(display(),gc()); if (timer()!=0) delete _timer; } void MSToolTip::toolTip(const MSStringVector &toolTip_,MSWidget *displayFor_) { _displayFor=displayFor_; _toolTip=toolTip_; computeSize(); } void MSToolTip::style(Style style_) { if (_style!=style_) { _style=style_; if (_style==Bubble) { _marginHeight=MSToolTipDefaultMarginHeightForBubble; _marginWidth=MSToolTipDefaultMarginWidthForBubble; } else { _marginHeight=MSToolTipDefaultMarginHeightForBox; _marginWidth=MSToolTipDefaultMarginWidthForBox; } computeSize(); } } void MSToolTip::redraw(void) { int startX,startY; if (style()==Bubble) { XPoint points[3]; if (tailPosition()&Right) points[0].x=width(); else points[0].x=0; if (tailPosition()&Bottom) points[0].y=height(); else points[0].y=0; points[1].x=width()-bubbleMarginWidth(); points[2].x=bubbleMarginWidth(); points[1].y=height()/2; points[2].y=points[1].y; XSetForeground(display(),gc(),background()); XFillPolygon(display(),window(),gc(),points,3,Nonconvex,CoordModeOrigin); XFillArc(display(),window(),gc(),0,0,width(),height(),0,360*64); startX=bubbleMarginWidth()+marginWidth(); startY=bubbleMarginHeight()+marginHeight()+fontObject().textAscent(); } else { XSetForeground(display(),gc(),background()); XFillRectangle(display(),window(),gc(),0,0,width(),height()); XSetForeground(display(),gc(),foreground()); XDrawRectangle(display(),window(),gc(),0,0,width()-1,height()-1); startX=marginWidth(); startY=marginHeight()+fontObject().textAscent(); } XSetForeground(display(),gc(),foreground()); for (unsigned i=0;ireset(); } } void MSToolTip::unmap(void) { timer()->stop(); if (mapped()==MSTrue) { _mapped=MSFalse; XUnmapWindow(display(),window()); } } void MSToolTip::computeSize(void) { int oldW=width(); int oldH=height(); int newW=0; int newH=0; for (unsigned i=0;inewW)?w:newW; newH+=fontObject().textHeight(); } newW+=(marginWidth()*2); newH+=(marginHeight()*2); if (style()==Bubble) { int bubbleW=(int)(newW*1.4142); int bubbleH=(int)(newH*1.4142); _bubbleMarginWidth=(bubbleW-newW)/2; _bubbleMarginHeight=(bubbleH-newH)/2; newW=bubbleW; newH=bubbleH; } if (oldW!=newW||oldH!=newH) { //It is necessary to force an unmap and then remap to get rid of the //background because of the transparent background that we're using if (mapped()==MSTrue) XUnmapWindow(display(),window()); resize(newW,newH); if (mapped()==MSTrue) XMapWindow(display(),window()); } else if (mapped()==MSTrue) redraw(); } void MSToolTip::updateFont(Font) { fontObject().fontStruct(server()->fontStruct(font())); XSetFont(display(),gc(),font()); computeSize(); } void MSToolTip::updateForeground(unsigned long) { if (mapped()==MSTrue) redraw(); } void MSToolTip::updateBackground(unsigned long) { XSetWindowBackgroundPixmap(display(),window(),None); if (mapped()==MSTrue) redraw(); } void MSToolTip::delay(unsigned long delay_) { if (_delay!=delay_) { _delay=delay_; if (timer()!=0) delete _timer; _timer=new ToolTipTimer(delay(),this); timer()->stop(); } } ToolTipTimer::ToolTipTimer(unsigned long interval_,MSToolTip *toolTip_) : MSIntervalTimer(interval_), _toolTip(toolTip_) {} ToolTipTimer::~ToolTipTimer(void) {} void ToolTipTimer::process(void) { _toolTip->_mapped=MSTrue; XMapRaised(_toolTip->display(),_toolTip->window()); stop(); } MSBoolean MSToolTip::displayToolTip(void) { return _displayToolTip; } void MSToolTip::displayToolTip(MSBoolean displayToolTip_) { _displayToolTip=displayToolTip_; } aplus-fsf-4.22/src/MSGUI/MSTopLevel.C0000644000265000001440000003352610772770415012612 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #ifndef MSDefinesHEADER #include #endif #if defined(MS_HAS_SYSTEMINFO) #include #elif defined(MS_UNISTD_HAS_GETHOSTNAME) #include #elif defined(HAVE_UNISTD_H) #include #else extern "C" int gethostname(char *,int); #endif static const char *_XA_VUE_WORKSPACE_HINTS ="_DT_WORKSPACE_HINTS"; static const char *_XA_VUE_WORKSPACE_PRESENCE ="_DT_WORKSPACE_PRESENCE"; static const char *_XA_MWM_HINTS ="_MOTIF_WM_HINTS"; extern MSString applicationArgumentString(void); extern void applicationQuit(void); MSString MSTopLevel::_windowManagerCommand; MSTopLevel::MSTopLevel(const char *windowTitle_) { init(windowTitle_); } MSTopLevel::MSTopLevel(MSDisplayServer *server_,const char *windowTitle_) : MSWidgetCommon(server_) { init(windowTitle_); } MSTopLevel::~MSTopLevel(void) { if (_iconPixmap!=0) delete _iconPixmap; delete [] _workspacePresenceAtoms; } void MSTopLevel::init(const char *windowTitle_) { _iconPixmap=0; _adjustWMPosition=MSFalse; _mwmHints._flags=0; _mwmHints._functions=0; _mwmHints._decorations=0; _mwmHints._inputMode=0; _workspacePresenceAtoms=0; _workspacePresenceCount=0; windowTitle((windowTitle_!=0)?windowTitle_:""); setWMHints(); setWMProtocols(); setWMNormalHints(); } MSStringVector MSTopLevel::workspacePresence(void) const { if (server()->isCDERunning()==MSTrue) { const MSDisplayServer *srv=server(); MSStringVector presence(_workspacePresenceCount); for (unsigned long i=0;i<_workspacePresenceCount;i++) { presence.replaceAt(i,srv->workspaceName(_workspacePresenceAtoms[i])); } return presence; } else { return MSStringVector(); } } void MSTopLevel::workspacePresence(const MSString& workspace_) { workspacePresence(MSStringVector(1,workspace_)); } void MSTopLevel::workspacePresence(const MSStringVector& newPresence_) { unsigned n=newPresence_.length(); if (n>0) { Atom *atoms=new Atom[n]; for (unsigned i=0;iworkspaceAtom(newPresence_(i)); } Atom property=XInternAtom(display(),_XA_VUE_WORKSPACE_HINTS,False); XChangeProperty(display(),window(), property,property,32, PropModeReplace, (unsigned char *)atoms, n); XFlush (display()); delete [] atoms; } } void MSTopLevel::workspacePresenceChangeNotify(void) { activateCallback(MSWidgetCallback::workspacepresencechange); } void MSTopLevel::updateWorkspacePresence(void) { if (server()->isCDERunning()==MSTrue) { Atom actualType; int actualFormat; unsigned long numItems; unsigned long leftover; Atom *pWsAtoms=0; Atom property=XInternAtom(display(),_XA_VUE_WORKSPACE_PRESENCE,False); int status=XGetWindowProperty(display(),window(), property,0L,(long)BUFSIZ, False,property, &actualType,&actualFormat, &numItems,&leftover, (unsigned char**)&pWsAtoms); if (status==Success&&actualType==property) { if (numItems!=_workspacePresenceCount) // if the presence count was changed { // reallocate the presence atoms list // _workspacePresenceCount = numItems; delete [] _workspacePresenceAtoms; if (_workspacePresenceCount>0) { _workspacePresenceAtoms = new Atom[_workspacePresenceCount]; } else { _workspacePresenceAtoms = 0; } } // copy the new atoms // memcpy(_workspacePresenceAtoms,pWsAtoms,(int)_workspacePresenceCount*sizeof(Atom)); // Notify about the change workspacePresenceChangeNotify(); } if (pWsAtoms!=0) XFree((char*)pWsAtoms); } } MSBoolean MSTopLevel::inWorkspace(Atom workspaceAtom_) const { if (_workspacePresenceAtoms!=0) { unsigned n=_workspacePresenceCount; for (unsigned i=0;iatom(MSAtomTable::WMDeleteWindow); XSetWMProtocols(display(),window(),&proto,1); } void MSTopLevel::setWMSaveYourself(void) { Atom proto[2]; proto[0]=server()->atom(MSAtomTable::WMDeleteWindow); proto[1]=server()->atom(MSAtomTable::WMSaveYourself); XSetWMProtocols(display(),window(),proto,2); if (windowManagerCommand().length()==0) { windowManagerCommand(applicationArgumentString()); } } void MSTopLevel::setWMClientMachine(void) { char buf[80]; buf[0]='\0'; #if defined(MS_HAS_SYSTEMINFO) if (sysinfo(SI_HOSTNAME,buf,80)<80) #else if (0==gethostname(buf,80)) #endif { XTextProperty prop; prop.value=(unsigned char *)buf; prop.encoding=XA_STRING; prop.format=8; prop.nitems=strlen(buf); XSetWMClientMachine(display(),window(),&prop); } } void MSTopLevel::setWMHints(void) { XWMHints *wmHints=XAllocWMHints(); wmHints->flags=InputHint|StateHint; wmHints->initial_state=NormalState; wmHints->input=True; XSetWMHints(display(),window(),wmHints); XFree((char *)wmHints); } void MSTopLevel::setWMNormalHints(void) { XSizeHints *sh=XAllocSizeHints(); sh->x=MSRect::x(); sh->y=MSRect::y(); sh->width=width(); sh->height=height(); sh->base_width=width(); sh->base_height=height(); sh->min_width=10; sh->min_height=10; sh->flags=USPosition|USSize|PBaseSize|PMinSize; XSetWMNormalHints(display(),window(),sh); XFree((char *)sh); } // adding of decorations/functions is not supported // mwm seems to ignore dynamic changes, it takes // a snapshot when the window is mapped, therefore // one should only remove decorations void MSTopLevel::addWMDecorations(unsigned long) {} void MSTopLevel::addWMFunctions(unsigned long) {} void MSTopLevel::removeWMDecorations(unsigned long decor_) { setWMDecorations(decor_,MSFalse); } void MSTopLevel::removeWMFunctions(unsigned long functions_) { setWMFunctions(functions_,MSFalse); } void MSTopLevel::setWMDecorations(unsigned long decor_,MSBoolean add_) { if (firstMap()==MSFalse) { if (server()->isCDERunning()==MSTrue) { _mwmHints._flags|=MWMHints::DecorationsFlag; _mwmHints._decorations=decor_; if (add_==MSFalse) _mwmHints._decorations|=MWMHints::DAll; Atom mwmHintsAtom=XInternAtom(display(),_XA_MWM_HINTS,False); XChangeProperty(display(),window(),mwmHintsAtom,mwmHintsAtom, 32,PropModeReplace,(unsigned char *)&_mwmHints,4); } } else { MSMessageLog::warningMessage("Application Error: Unable to set Window Manager Decorations after TopLevel Window is mapped"); } } void MSTopLevel::setWMFunctions(unsigned long functions_,MSBoolean add_) { if (firstMap()==MSFalse) { if (server()->isCDERunning()==MSTrue) { _mwmHints._flags|=MWMHints::FunctionsFlag; _mwmHints._functions=functions_; if (add_==MSFalse) _mwmHints._functions|=MWMHints::FAll; Atom mwmHintsAtom=XInternAtom(display(),_XA_MWM_HINTS,False); XChangeProperty(display(),window(),mwmHintsAtom,mwmHintsAtom, 32,PropModeReplace,(unsigned char *)&_mwmHints,4); } } else { MSMessageLog::warningMessage("Application Error: Unable to set Window Manager Functions after TopLevel Window is mapped"); } } void MSTopLevel::minimumSize(int width_,int height_) { XSizeHints *sh=XAllocSizeHints(); sh->min_width=width_; sh->min_height=height_; sh->flags=PMinSize; XSetWMNormalHints(display(),window(),sh); XFree((char *)sh); } void MSTopLevel::windowTitle(const char *name_) { if (name_!=0&&window()!=0) { XTextProperty prop; prop.value=(unsigned char *)name_; prop.format=8; prop.encoding=XA_STRING; prop.nitems=strlen(name_); XSetWMName(display(),window(),&prop); } } MSString MSTopLevel::windowTitle(void) const { XTextProperty prop; prop.value=0; if (window()!=0) XGetWMName(display(),window(),&prop); MSString aString((const char *)prop.value); if (prop.value!=0) XFree((char *)prop.value); return aString; } void MSTopLevel::iconTitle(const char *name_) { if (name_!=0&&window()!=0) { XTextProperty prop; prop.value=(unsigned char *)name_; prop.format=8; prop.encoding=XA_STRING; prop.nitems=strlen(name_); XSetWMIconName(display(),window(),&prop); } } MSString MSTopLevel::iconTitle(void) const { XTextProperty prop; prop.value=0; if (window()!=0) XGetWMIconName(display(),window(),&prop); MSString n((const char *)prop.value); if (prop.value!=0) XFree((char *)prop.value); return n; } void MSTopLevel::iconPixmap(const MSPixmap &pixmap_) { XWMHints *wmhints=XGetWMHints(display(),window()); if (wmhints==0) wmhints=XAllocWMHints(); wmhints->flags|=IconPixmapHint; wmhints->icon_pixmap=pixmap_.pixmap(); if (pixmap_.clipMask()!=0) { wmhints->icon_mask=pixmap_.clipMask(); wmhints->flags|=IconMaskHint; } XSetWMHints(display(),window(),wmhints); XFree((char *)wmhints); if (iconPixmap()!=0) delete iconPixmap(); _iconPixmap=new MSPixmap(pixmap_); } void MSTopLevel::windowManagerCommand(const char *cmd_) { _windowManagerCommand=cmd_; } void MSTopLevel::setWMCommand(void) { if (windowManagerCommand().length()>0) { XChangeProperty(display(),window(),XA_WM_COMMAND,XA_STRING,8, PropModeReplace,(unsigned char *)windowManagerCommand().string(), windowManagerCommand().length()); } else // zero length append { XChangeProperty(display(),window(),XA_WM_COMMAND, XA_STRING,8,PropModeAppend,(unsigned char *)0,0); } } void MSTopLevel::resizeable(MSBoolean resizeable_) { if (resizeable()!=resizeable_&&firstMap()==MSFalse) { _resizeable=resizeable_; if (server()->isCDERunning()==MSTrue) { if (resizeable()==MSFalse) { removeWMDecorations(MWMHints::DResizeHandles); removeWMFunctions(MWMHints::FResize); } } else { Atom decor=server()->atom(MSAtomTable::DecorResize); Atom atom=server()->atom((resizeable()==MSTrue)? MSAtomTable::DecorAdd:MSAtomTable::DecorDel); XChangeProperty(display(),window(),atom, XA_ATOM,32,PropModeReplace,(unsigned char *)&decor,1); } } } void MSTopLevel::footer(MSBoolean footer_) { if (footer()!=footer_) { _footer=footer_; if (server()->isCDERunning()==MSFalse) { Atom decor=server()->atom(MSAtomTable::DecorFooter); Atom atom=server()->atom((footer()==MSTrue)? MSAtomTable::DecorAdd:MSAtomTable::DecorDel); XChangeProperty(display(),window(),atom, XA_ATOM,32,PropModeReplace,(unsigned char *)&decor,1); } } } void MSTopLevel::header(MSBoolean header_) { if (header()!=header_) { _header=header_; if (server()->isCDERunning()==MSTrue) { if (header()==MSFalse) removeWMDecorations(MWMHints::DTitle); } else { Atom decor=server()->atom(MSAtomTable::DecorHeader); Atom atom=server()->atom((header()==MSTrue)? MSAtomTable::DecorAdd:MSAtomTable::DecorDel); XChangeProperty(display(),window(),atom, XA_ATOM,32,PropModeReplace,(unsigned char *)&decor,1); } } } void MSTopLevel::iconify(void) { if (mapped()==MSTrue) { _mapped=MSFalse; XIconifyWindow(display(),window(),DefaultScreen(display())); } } void MSTopLevel::clientMessage(const XEvent *event_) { if (event_->xclient.message_type==server()->atom(MSAtomTable::WMProtocols)) { if (event_->xclient.data.l[0]==server()->atom(MSAtomTable::WMDeleteWindow)) quit(); else if (event_->xclient.data.l[0]==server()->atom(MSAtomTable::WMSaveYourself)) { save(); setWMCommand(); } } } void MSTopLevel::quit(void) { if (activateCallback(MSWidgetCallback::quit)==MSFalse) { applicationQuit(); } } void MSTopLevel::save(void) { activateCallback(MSWidgetCallback::saveyourself); } void MSTopLevel::set(MSAttrValueList& avList_) { MSWidgetCommon::set(avList_); MSIndexVector index; for (unsigned i=0;i #include #include static const int DefaultTraceSymbolSize =11; MSTrace::MSTrace(MSTraceSet *traceSet_,int col_,const MSSymbol& tag_): _tag(tag_) { _traceSet=traceSet_; virtualCol(col_); init(); } MSTrace::~MSTrace(void) {} void MSTrace::init() { _yMax=0.0; _yMin=0.0; _font=0; _offset=0; _xShift=0; _xOffset=0; _yOffset=0; _stipple=0; _xAxis=0; _yAxis=0; _symbolSize=DefaultTraceSymbolSize; _symbol=Cross; _style=Line; _lineWeight=2; _lineWidth=1; _lineStyle=MSSolid; _autoScale=MSFalse; _lastDataPoint=0.; _barCount=0; _hidden=MSFalse; } void MSTrace::font(const char *x_) { font(traceSet()->graph()->owner()->server()->fontID(x_)); } const char *MSTrace::legend(unsigned x_) const {return traceSet()->legend(x_);} void MSTrace::legend(const char *x_) { traceSet()->legend(x_,virtualCol());} int MSTrace::dataCount(void) const { return traceSet()->dataCount(); } const char *MSTrace::legend(void) const { return traceSet()->legend(virtualCol());} unsigned long MSTrace::lineColor(int r_,int c_) const { return traceSet()->traceLineColor(r_,c_); } unsigned long MSTrace::lineColor(void) const { return traceSet()->traceLineColor(0,virtualCol()); } unsigned long MSTrace::lineColor(int i_) const { return traceSet()->traceLineColor(i_,virtualCol()); } unsigned long MSTrace::fillColor(int r_,int c_) const { return traceSet()->traceFillColor(r_,c_); } unsigned long MSTrace::fillColor(void) const { return traceSet()->traceFillColor(0,virtualCol()); } unsigned long MSTrace::fillColor(int i_) const { return traceSet()->traceFillColor(i_,virtualCol()); } double MSTrace::x(int i_) const { return traceSet()->x(i_); } double MSTrace::y(int r_,int c_) const { return traceSet()->y(r_,c_); } double MSTrace::y(int i_) const { return traceSet()->y(i_,virtualCol()); } aplus-fsf-4.22/src/MSGUI/MSTraceSet.C0000644000265000001440000011241310772770415012563 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #ifndef MSGraphHEADER #include #endif static const int MaxTraceLineWidth =35; static const int MaxTraceSymbolSize =100; static const char *DefaultTraceFont="lucidasanstypewriter-12"; MSStringVector MSTraceSet::_text; MSTraceSet::MSTraceSet(MSGraph *gr_,const char *legend_,const MSSymbol& tag_): _tag(tag_),_legend(legend_),MSWidgetView(gr_) { init(); } MSTraceSet::MSTraceSet(MSGraph *gr_,const MSStringVector& legend_,const MSSymbol& tag_): _tag(tag_),_legend(legend_),MSWidgetView(gr_) { init(); } void MSTraceSet::textFont(const char *font_) { textFont(owner()->server()->fontID(font_)); int ct=traceList().count(); for (int i=0;ifont(textFont()); graph()->redrawImmediately(); } void MSTraceSet::textFont(Font font_) { if (font_!=textFont()) { _textFont=font_; graph()->redrawImmediately(); } } void MSTraceSet::textForeground(const char *fg_) { textForeground(owner()->server()->pixel(fg_)); } void MSTraceSet::textForeground(unsigned long fg_) { if (fg_!=textForeground()) { _textForeground=fg_; graph()->redrawImmediately(); } } void MSTraceSet::init(void) { _textForeground =0; _updateIndex =0; _selectRow =0; _selectCol =0; _xMax =0.0; _xMin =0.0; _yMax =0.0; _yMin =0.0; _xDelta =0.0; _xOffset =0.0; _yOffset =0.0; _pieDepthFactor =1.0; _pieAspectRatio =0.6; _primarySlice =-1; _primarySliceAlignment =MSTop; _pieAngle =0; _constraint =HoldX; _pieLegendAlignment =MSCenter; _pieValueAlignment =MSNone; _piePercentAlignment =MSNone; _piePercentFormat =MSFloat::Decimal0; _pieProfiles =0; _pieOffsets =0; _pieOffset =0; _lastDataCount =0; _normalizedOffset =0; _selectable =MSFalse; _overlap =MSFalse; _textFont =server()->fontID(DefaultTraceFont); childCreateNotify(); } MSTraceSet::~MSTraceSet(void) { deleteTraces(); if (pieOffsets()!=0) delete pieOffsets(); if (pieProfiles()!=0) delete pieProfiles(); } // virtual methods const char *MSTraceSet::formatOutput(MSString &buffer_,unsigned,unsigned) {return buffer_.string();} void MSTraceSet::selectable(MSBoolean selectable_) {_selectable=selectable_;} void MSTraceSet::constraint(unsigned long constraint_) {_constraint=constraint_;} MSBoolean MSTraceSet::selectable(void) const {return _selectable;} unsigned long MSTraceSet::constraint(void) const {return _constraint;} void MSTraceSet::unmap(void) {} unsigned MSTraceSet::textLength(void) const {return _text.length();} MSStringVector& MSTraceSet::text(void) {return _text;} const MSStringVector& MSTraceSet::text(void) const {return _text;} MSUnsignedVector MSTraceSet::lineWidth(void) const { MSUnsignedVector vector; for (int i=0; ilineWidth(); return vector; } MSUnsignedVector MSTraceSet::symbolSize(void) const { MSUnsignedVector vector; for (int i=0; isymbolSize(); return vector; } MSUnsignedVector MSTraceSet::lineWeight(void) const { MSUnsignedVector vector; for (int i=0; ilineWeight(); return vector; } void MSTraceSet::xOrigin(double) {} void MSTraceSet::yOrigin(double) {} void MSTraceSet::create(void) {} void MSTraceSet::map(void) {} void MSTraceSet::setData(void) {} void MSTraceSet::validate(int,int,double,double){} MSBoolean MSTraceSet::moveTraceValidate(double,double) { return MSFalse; } MSTraceSet* MSTraceSet::copyTraceValidate(MSGraph*,const char*, const MSSymbol&) { return (MSTraceSet*)0; } int MSTraceSet::numColumns(void) const {return 1;} int MSTraceSet::dataCount(void) const {return 0;} double MSTraceSet::x(int index_) const {return (double)index_;} double MSTraceSet::y(int,int) const {return 0.0;} MSBoolean MSTraceSet::mapped(void) const { return owner()!=0?owner()->mapped():MSFalse; } void MSTraceSet::hide(void) { int ct=traceList().count(); for (int i=0;ihidden(MSTrue); graph()->redrawImmediately(); } void MSTraceSet::show(void) { int ct=traceList().count(); for (int i=0;ihidden(MSFalse); graph()->redrawImmediately(); } void MSTraceSet::deleteTraces(void) { MSTrace *pTrace=0; for (int i=traceList().count();i>0;i--) { if ((pTrace=trace(i-1))!=0) { traceList().remove(pTrace); if (graph()->selectTrace()!=0&&pTrace==graph()->selectTrace()) graph()->selectTrace(0); graph()->traceList().remove(pTrace); delete pTrace; } } lineColors().removeAll(); fillColors().removeAll(); graph()->legend()->redraw(); graph()->redrawImmediately(); } void MSTraceSet::computeExtents(const MSIndexVector& iv_) { MSTrace* pTrace; unsigned int length=iv_.length(); MSBoolean append=MSTrue; MSBoolean needNormalize=MSFalse; unsigned cols=numColumns(); // optimize for append, otherwise result in computeExtents() if (lastDataCount()==0||dataCount()<=lastDataCount()) append=MSFalse; if (append==MSTrue) { for (unsigned i=0;i0?col-1:(unsigned int)-1; if (tcount>=0&&tcounty(row); if (yy>=DBL_MAX||yy<=-DBL_MAX) yy=0; if (yyyMin()) pTrace->yMin(yy); if (yy>pTrace->yMax()) pTrace->yMax(yy); if (yyyMin()); if (yy>yMax()) yMax(pTrace->yMax()); } double xx=x(row); if (row>0&&overlap()!=MSTrue&&xx=DBL_MAX||xx<=-DBL_MAX) xx=0; if (xxxMax()) xMax(xx); if (col==0) needNormalize=MSTrue; } } if (needNormalize==MSTrue) graph()->computeNormalizedOffsets(); } if (append==MSFalse) computeExtents(); } void MSTraceSet::computeExtents(void) { MSTrace *pTrace=trace(0); overlap(MSFalse); int count=dataCount(); for (unsigned i=0;i0&&(pTrace=trace(i))!=0) { double yy=pTrace->y(0); _yMin=_yMax=yy>=DBL_MAX||yy<=-DBL_MAX?0:yy; double xx=pTrace->x(0); _xMin=_xMax=xx>=DBL_MAX||xx<=-DBL_MAX?0:xx; } if ((pTrace=trace(i))!=0) { for (unsigned k=0;ky(0); if (yy>=DBL_MAX||yy<=-DBL_MAX) yy=0; if (k==0) pTrace->_yMin=pTrace->_yMax=yy; if (pTrace->style()>Close) { int cols=numColumns()>1?numColumns()-1:1; for (int j=0;jy(k,j); if (yy>=DBL_MAX||yy<=-DBL_MAX) yy=0; if (yyyMin()) pTrace->yMin(yy); if (yy>pTrace->yMax()) pTrace->yMax(yy); } } else { double yy=pTrace->y(k); if (yy>=DBL_MAX||yy<=-DBL_MAX) yy=0; if (yyyMin()) pTrace->yMin(yy); if (yy>pTrace->yMax()) pTrace->yMax(yy); } } if (pTrace->yMin()yMin()); if (pTrace->yMax()>yMax()) yMax(pTrace->yMax()); } } if (count>0) { double xv,xx=x(0); for (unsigned k=0;k=DBL_MAX||xv<=-DBL_MAX) xv=0; if (xvxMax()) xMax(xv); xx=xv; } } graph()->computeNormalizedOffsets(); } const char *MSTraceSet::legend(unsigned i_) { int ct=legend().length(); return ct>0?legend()(i_textSymbol(); } Font MSTraceSet::font(unsigned i_) const { int ct=traceList().count(); return trace(i_font(); } Pixmap MSTraceSet::stipple(unsigned i_) const { int ct=traceList().count(); return trace(i_stipple(); } unsigned long MSTraceSet::lineStyle(unsigned i_) const { int ct=traceList().count(); return trace(i_lineStyle(); } MSAlignment MSTraceSet::xAxis(unsigned i_) const { int ct=traceList().count(); return trace(i_xAxis()==1?MSTop:MSBottom; } MSAlignment MSTraceSet::yAxis(unsigned i_) const { int ct=traceList().count(); return trace(i_yAxis()==1?MSRight:MSLeft; } unsigned long MSTraceSet::style(unsigned i_) const { int ct=traceList().count(); return trace(i_style(); } unsigned long MSTraceSet::symbol(unsigned i_) const { int ct=traceList().count(); return trace(i_symbol(); } unsigned MSTraceSet::lineWidth(unsigned i_) const { int ct=traceList().count(); return trace(i_lineWidth(); } unsigned MSTraceSet::symbolSize(unsigned i_) const { int ct=traceList().count(); return trace(i_symbolSize(); } unsigned MSTraceSet::lineWeight(unsigned i_) const { int ct=traceList().count(); return trace(i_lineWeight(); } unsigned long MSTraceSet::lineColor(unsigned,unsigned) const {return 0;} unsigned long MSTraceSet::lineColor(unsigned i_) const { unsigned len=lineColors().length(); if (len>0) return lineColors()(i_0) return fillColors()(i_0) return lineColors()(c_0) return fillColors()(indexredrawImmediately(); } } void MSTraceSet::pieValueAlignment(unsigned long align_) { if (align_!=_pieValueAlignment) { _pieValueAlignment=align_; graph()->redrawImmediately(); } } void MSTraceSet::piePercentAlignment(unsigned long align_) { if (align_!=_piePercentAlignment) { _piePercentAlignment=align_; graph()->redrawImmediately(); } } void MSTraceSet::pieOffsets(double x_) { if (x_>=0.0&&x_<=100.0) { if (x_!=_pieOffset) { _pieOffset=x_; graph()->redrawImmediately(); } } else { MSMessageLog::warningMessage("Warning: MSTraceSet::pieOffsets value out of range"); } } void MSTraceSet::pieOffsets(const MSFloatVector& x_) { for (unsigned i=0;i100.0) { MSMessageLog::warningMessage("Warning: MSTraceSet::pieOffsets value out of range"); } if (pieOffsets()==0) _pieOffsets=new MSFloatVector(x_); else *pieOffsets()=x_; graph()->redrawImmediately(); } double MSTraceSet::pieOffset(unsigned i_) const { double offset=_pieOffset; if (pieOffsets()!=0&&pieOffsets()->length()>0) offset=(*pieOffsets())(i_%pieOffsets()->length()); return offset>1.0?offset<=100.0?offset/100.0:0.0:offset; } void MSTraceSet::pieProfiles(const MSFloatVector& x_) { for (unsigned i=0;i100.0) { MSMessageLog::warningMessage("Warning: MSTraceSet::pieProfiles value out of range"); } if (pieProfiles()==0) _pieProfiles=new MSFloatVector(x_); else *pieProfiles()=x_; graph()->redrawImmediately(); } double MSTraceSet::pieProfile(unsigned i_) const { double profile=1.0; if (pieProfiles()!=0&&pieProfiles()->length()>0) profile=(*pieProfiles())(i_%pieProfiles()->length()); return profile>1.0?profile<100.0?profile/100.0:1.0:profile; } void MSTraceSet::pieDepthFactor(double x_) { if (x_>0.0&&x_<=6.0) { _pieDepthFactor=x_; graph()->redrawImmediately(); } } void MSTraceSet::pieAspectRatio(double x_) { if (x_>0.0&&x_<=1.0) { _pieAspectRatio=x_; graph()->redrawImmediately(); } } void MSTraceSet::primarySlice(int x_) { if (x_!=primarySlice()) { _primarySlice=x_; graph()->redrawImmediately(); } } void MSTraceSet::primarySliceAlignment(MSAlignment x_) { if (x_!=primarySliceAlignment()) { _primarySliceAlignment=x_; graph()->redrawImmediately(); } } void MSTraceSet::pieAngle(int x_) { if (x_!=pieAngle()) { _pieAngle=x_%360; if (primarySliceAlignment()==MSNone) graph()->redrawImmediately(); } } void MSTraceSet::legend(const char *x_,unsigned i_) { if (i_drawLegends(); } } void MSTraceSet::textSymbol(const MSStringVector& x_,unsigned i_) { if (i_textSymbol(x_); graph()->updateLegendStatus(MSTrue); graph()->redrawImmediately(); } } void MSTraceSet::font(Font x_,unsigned i_) { if (i_font(x_); graph()->legend()->redraw(); graph()->redrawImmediately(); } } void MSTraceSet::font(const char *x_,unsigned i_) { if (i_font(x_); graph()->legend()->redraw(); graph()->redrawImmediately(); } } void MSTraceSet::stipple(Pixmap x_,unsigned i_) { if (i_stipple(x_); graph()->updateLegendStatus(MSTrue); graph()->redrawImmediately(); } } void MSTraceSet::lineWidth(unsigned x_,unsigned i_) { if (i_lineWidth()!=x_) { x_=x_lineWidth(x_); graph()->updateLegendStatus(MSTrue); graph()->redrawImmediately(); } } void MSTraceSet::lineWeight(unsigned x_,unsigned i_) { if (i_lineWeight()!=x_) { trace(i_)->lineWeight(x_); graph()->updateLegendStatus(MSTrue); graph()->redrawImmediately(); } } void MSTraceSet::lineStyle(unsigned long x_,unsigned i_) { if (i_lineStyle()!=x_) { trace(i_)->lineStyle(x_); graph()->updateLegendStatus(MSTrue); graph()->redrawImmediately(); } } void MSTraceSet::xAxis(MSAlignment x_,unsigned i_) { int x=MSTop&x_?1:0; if (i_xAxis()!=x) { trace(i_)->xAxis(x); graph()->redrawImmediately(); } } void MSTraceSet::yAxis(MSAlignment x_,unsigned i_) { int x=MSRight&x_?1:0; if (i_yAxis()!=x) { trace(i_)->yAxis(x); graph()->redrawImmediately(); } } void MSTraceSet::style(unsigned long x_,unsigned i_) { if (i_style()style(x_); graph()->legend()->redraw(); graph()->redrawImmediately(); } } void MSTraceSet::symbol(unsigned long x_,unsigned i_) { if (i_symbol()!=x_) { trace(i_)->symbol(x_); graph()->updateLegendStatus(MSTrue); graph()->redrawImmediately(); } } void MSTraceSet::symbolSize(unsigned x_,unsigned i_) { if (i_symbolSize()!=x_) { x_=x_symbolSize(x_); graph()->updateLegendStatus(MSTrue); graph()->redrawImmediately(); } } void MSTraceSet::lineColor(unsigned long x_,unsigned i_) { unsigned len=lineColors().length(); if (i_updateLegendStatus(MSTrue); graph()->redrawImmediately(); } } void MSTraceSet::fillColor(unsigned long x_,unsigned i_) { unsigned len=fillColors().length(); if (i_updateLegendStatus(MSTrue); graph()->redrawImmediately(); } } void MSTraceSet::legend(const char *x_) { if (x_!=0) { legend().removeAll(); for (int i=0;ilegend()->redraw(); } } void MSTraceSet::font(Font x_) { for (int i=0; ifont(x_); graph()->redrawImmediately(); } void MSTraceSet::font(const char *x_) { for (int i=0; ifont(x_); graph()->redrawImmediately(); } void MSTraceSet::stipple(Pixmap x_) { for (int i=0; istipple(x_); graph()->redrawImmediately(); } void MSTraceSet::lineWidth(unsigned x_) { for (int i=0; ilineWidth(x_); graph()->updateLegendStatus(MSTrue); graph()->redrawImmediately(); } void MSTraceSet::lineWeight(unsigned x_) { for (int i=0; ilineWeight(x_); graph()->updateLegendStatus(MSTrue); graph()->redrawImmediately(); } void MSTraceSet::lineStyle(MSLineStyle x_) { lineStyle((unsigned long)x_); } void MSTraceSet::lineStyle(unsigned long x_) { for (int i=0; ilineStyle(x_); graph()->updateLegendStatus(MSTrue); graph()->redrawImmediately(); } void MSTraceSet::xAxis(MSAlignment x_) { for (int i=0; ixAxis(MSTop&x_?1:0); graph()->redrawImmediately(); } void MSTraceSet::yAxis(MSAlignment x_) { for (int i=0; iyAxis(MSRight&x_?1:0); graph()->redrawImmediately(); } void MSTraceSet::style(Style x_) { style((unsigned long)x_); } void MSTraceSet::style(unsigned long x_) { updateTraceStyle(x_); graph()->legend()->redraw(); graph()->redrawImmediately(); } void MSTraceSet::symbol(Symbol x_) { symbol((unsigned long)x_); } void MSTraceSet::symbol(unsigned long x_) { for (int i=0; isymbol(x_); graph()->updateLegendStatus(MSTrue); graph()->redrawImmediately(); } void MSTraceSet::symbolSize(unsigned x_) { for (int i=0; isymbolSize(x_); graph()->updateLegendStatus(MSTrue); graph()->redrawImmediately(); } void MSTraceSet::lineColor(unsigned long x_) { lineColors()=x_; graph()->updateLegendStatus(MSTrue); graph()->redrawImmediately(); } void MSTraceSet::fillColor(unsigned long x_) { fillColors()=x_; graph()->updateLegendStatus(MSTrue); graph()->redrawImmediately(); } void MSTraceSet::legend(const MSStringVector& x_) { if (x_!=legend()) { _legend=x_; if (traceList().count()>0&&trace(0)->style()==MSG::Pie) { graph()->updateLegendStatus(MSTrue); graph()->redrawImmediately(); } else graph()->legend()->redraw(); } } void MSTraceSet::textSymbol(const MSStringVector& x_) { for (int i=0; itextSymbol(MSStringVector(x_[i%x_.length()])); graph()->updateLegendStatus(MSTrue); graph()->redrawImmediately(); } void MSTraceSet::font(const MSUnsignedLongVector& x_) { for (int i=0; ifont(x_[i%x_.length()]); graph()->updateLegendStatus(MSTrue); graph()->redrawImmediately(); } void MSTraceSet::font(const MSStringVector& x_) { for (int i=0; ifont(x_[i%x_.length()]); graph()->updateLegendStatus(MSTrue); graph()->redrawImmediately(); } void MSTraceSet::stipple(const MSUnsignedLongVector& x_) { for (int i=0; istipple((Pixmap)x_[i%x_.length()]); graph()->updateLegendStatus(MSTrue); graph()->redrawImmediately(); } void MSTraceSet::lineWidth(const MSUnsignedVector& x_) { for (int i=0; ilineWidth(x_[i%x_.length()]); graph()->updateLegendStatus(MSTrue); graph()->redrawImmediately(); } void MSTraceSet::lineWeight(const MSUnsignedVector& x_) { for (int i=0; ilineWeight(x_[i%x_.length()]); graph()->updateLegendStatus(MSTrue); graph()->redrawImmediately(); } void MSTraceSet::lineStyle(const MSUnsignedLongVector& x_) { for (int i=0; ilineStyle(x_[i%x_.length()]); graph()->updateLegendStatus(MSTrue); graph()->redrawImmediately(); } void MSTraceSet::xAxis(const MSUnsignedLongVector& x_, MSExplicitInit) { for (int i=0; ixAxis(MSTop&x_[i%x_.length()]?1:0); graph()->redrawImmediately(); } void MSTraceSet::yAxis(const MSUnsignedLongVector& x_, MSExplicitInit) { for (int i=0; iyAxis(MSRight&x_[i%x_.length()]?1:0); graph()->redrawImmediately(); } void MSTraceSet::style(const MSUnsignedLongVector& x_) { int ct=traceList().count(); if (ct>0) { if (trace(0)->style()>=Close) style(x_(0)); if (x_(0)>=Close) style(x_(0)); else for (int i=0;istyle(x_[i%x_.length()]); } graph()->legend()->redraw(); graph()->redrawImmediately(); } void MSTraceSet::symbol(const MSUnsignedLongVector& x_) { for (int i=0; isymbol(x_[i%x_.length()]); graph()->updateLegendStatus(MSTrue); graph()->redrawImmediately(); } void MSTraceSet::symbolSize(const MSUnsignedVector& x_) { for (int i=0; isymbolSize(x_[i%x_.length()]); graph()->updateLegendStatus(MSTrue); graph()->redrawImmediately(); } void MSTraceSet::lineColor(const MSUnsignedLongVector& x_) { lineColors()=x_; graph()->updateLegendStatus(MSTrue); graph()->redrawImmediately(); } void MSTraceSet::fillColor(const MSUnsignedLongVector& x_) { fillColors()=x_; graph()->updateLegendStatus(MSTrue); graph()->redrawImmediately(); } void MSTraceSet::lineColor(const MSStringVector& x_) { MSUnsignedLongVector colors; for (unsigned i=0;iserver()->pixel(x_(i)); lineColors()=colors; graph()->updateLegendStatus(MSTrue); graph()->redrawImmediately(); } void MSTraceSet::fillColor(const MSStringVector& x_) { MSUnsignedLongVector colors; for (unsigned i=0;iserver()->pixel(x_(i)); fillColors()=colors; graph()->updateLegendStatus(MSTrue); graph()->redrawImmediately(); } void MSTraceSet::lineColor(const char *x_) { lineColors()=owner()->server()->pixel(x_); graph()->updateLegendStatus(MSTrue); graph()->redrawImmediately(); } void MSTraceSet::fillColor(const char *x_) { fillColors()=owner()->server()->pixel(x_); graph()->updateLegendStatus(MSTrue); graph()->redrawImmediately(); } void MSTraceSet::updateTraceStyle(unsigned long style_) { MSTrace *pTrace=trace(0); int cols=numColumns(); int designateCol=0; int offset=0; MSBoolean updateTrace=MSFalse,styleError=MSFalse; if (pTrace!=0) { pTrace->virtualCol(0); if (style_>=Close) { if (style_==HLOC||style_==Candle) { style_=cols>=5?style_:cols>3?HLC:cols>2?HL:cols>1?Close:Line; } else if (style_==HLC) { style_=cols>=4?style_:cols>2?HL:cols>1?Close:Line; } else if (style_==HL) { style_=cols>=3?style_:cols>1?Close:Line; } else if (style_>=Close&&cols>2) { updateTrace=MSTrue; if (cols==3) style_=HL; } updateTrace=style_!=Line?MSTrue:MSFalse; styleError=style_==Line?MSTrue:MSFalse; offset=cols>4?1:0; } if (updateTrace==MSTrue) { for (int i=traceList().count()-1;i>-1;i--) { if ((pTrace=trace(i))!=0) { if (pTrace->virtualCol()!=designateCol) { traceList().remove(pTrace); graph()->traceList().remove(pTrace); lineColors()=lineColors().drop(-1); fillColors()=fillColors().drop(-1); delete pTrace; } else { pTrace->style(style_); pTrace->offset(offset); if (style_==Close) pTrace->virtualCol(cols>=5?3:cols==4?2:1); } } } computeExtents(); } else { configureTraces(); if (styleError!=MSTrue) { for (int i=0;ixShift(0.0); pTrace->style(style_); } } } } } else configureTraces(); } void MSTraceSet::update(const MSIndexVector& iv_) { unsigned long style=trace(0)!=0?trace(0)->style():MSG::Line; if (iv_.length()==0) { if (trace(0)==0||style>=Close) updateTraceStyle(style); else configureTraces(); } else { computeExtents(iv_); } graph()->update(this,iv_); } // called when a model is bound to this widget or is unbound from this widget void MSTraceSet::updateData(void) { configureTraces(); graph()->redrawImmediately(); graph()->legend()->redraw(); } void MSTraceSet::configureTraces(void) { if (hasModel()==MSFalse) { deleteTraces(); } else { MSTrace *pTrace=0; int cols=numColumns()>1?numColumns()-1:numColumns(); int numTraces=traceList().count(); for (int i=traceList().count()-1;i>-1;i--) { if ((pTrace=trace(i))!=0) { if (pTrace->virtualCol()>=cols) { traceList().remove(pTrace); graph()->traceList().remove(pTrace); lineColors()=lineColors().drop(-1); fillColors()=fillColors().drop(-1); delete pTrace; } else pTrace->virtualCol(i); } } if (cols>traceList().count()) { int ll=graph()->defaultTraceLineColors().length(); int lf=graph()->defaultTraceFillColors().length(); int ct=graph()->traceList().count(); for (int i=traceList().count();itraceList().add(pTrace); traceList().add(pTrace); lineColors()<server()->pixel(graph()->defaultTraceLineColors()(ct%ll)); fillColors()<server()->pixel(graph()->defaultTraceFillColors()(ct%lf)); } } } computeExtents(); lastDataCount(dataCount()); } void MSTraceSet::selected(unsigned row_,unsigned col_) { if (row_>0&&col_highlightPoint(this); } } void MSTraceSet::format(const MSFormat& aFormat_) { if(format()!=aFormat_) { if(format().formatType()==MSFormat::NoFormat|| aFormat_.formatType()==format().formatType()) { _format=aFormat_; graph()->redrawImmediately(); } } } static const char * traceStyleNames = "MSNone\nMSG::Area\nMSG::Bar\nMSG::Candle\nMSG::Close\nMSG::ColorProfile\nMSG::Fill\nMSG::HL\n\ MSG::HLC\nMSG::HLOC\nMSG::Line\nMSG::Line|MSG::Scatter\nMSG::MarketProfile\nMSG::Outline\n\ MSG::Pie\nMSG::Scatter\nMSG::Segment\nMSG::Stack\nMSG::Step\nMSG::Step|MSG::Scatter\nMSG::Text"; static int traceStyleValues[]= { MSNone,MSG::Area,MSG::Bar,MSG::Candle,MSG::Close,MSG::ColorProfile,MSG::Fill,MSG::HL, MSG::HLC,MSG::HLOC,MSG::Line,MSG::Line|MSG::Scatter,MSG::MarketProfile,MSG::Outline, MSG::Pie,MSG::Scatter,MSG::Segment,MSG::Stack,MSG::Step,MSG::Step|MSG::Scatter,MSG::Text}; static const char *symbolNames = "MSNone\nMSG::Circle\nMSG::Circle|MSG::Fill\nMSG::Cross\nMSG::Diamond\nMSG::Diamond|MSG::Fill\nMSG::Square\n\ MSG::Square|MSG::Fill\nMSG::Triangle\nMSG::Triangle|MSG::Fill\nMSG::X\nMSG::Cross|MSG::X"; static int symbolValues[] = {MSNone,MSG::Circle,MSG::Circle|MSG::Fill,MSG::Cross,MSG::Diamond,MSG::Diamond|MSG::Fill,MSG::Square, MSG::Square|MSG::Fill,MSG::Triangle,MSG::Triangle|MSG::Fill,MSG::X,MSG::Cross|MSG::X}; void MSTraceSet::set(MSAttrValueList& avList_) { MSWidgetView::set(avList_); MSIndexVector index; for (unsigned i=0;i0) { MSStringVector aStyleVector(traceStyleNames); unsigned index =aStyleVector.indexOf(avList_[i].value()); if(index!=aStyleVector.length()) style(traceStyleValues[index]); } index<0) { MSStringVector aSymbolVector(symbolNames); unsigned index =aSymbolVector.indexOf(avList_[i].value()); if(index!=aSymbolVector.length()) symbol(symbolValues[index]); } index<0) aSize=((const MSTraceSet *)this)->lineWeight(0); avList_<0) aSize=((const MSTraceSet *)this)->lineWidth(0); avList_<0) aSize=((const MSTraceSet *)this)->lineStyle(0); MSStringVector aLineStyleVector("MSSolid\nMSDash\nMSDot\nMSDash|MSDot"); int index; switch(aSize) { case MSSolid: index=0; break; case MSDash: index=1; break; case MSDot: index=2; break; case MSDash|MSDot: index=3; break; default: index=0; break; } avList_<0) traceStyle = ((const MSTraceSet *)this)->style(0); MSStringVector aStyleVector(traceStyleNames); for(i=0;i0) aSymbol=((const MSTraceSet *)this)->symbol(0); MSStringVector aSymbolVector(symbolNames); aString=""; for(i=0;i0) aSize=((const MSTraceSet *)this)->symbolSize(0); avList_<0) alignment = xAxis(0); avList_<0) alignment = yAxis(0); avList_< #include #if defined(MSTK_MANUAL_INSTANTIATION) #include #if defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma instantiate MSTypeEntryField #endif #if defined(MS_XLC_TEMPLATE_INSTANTIATION) #pragma define (MSTypeEntryField) #endif #if defined(MS_STD_TEMPLATE_INSTANTIATION) template class MSTypeEntryField; #endif #if defined(MS_VC_TEMPLATE_INSTANTIATION) template MSTypeEntryField; #endif #endif // MSTK_MANUAL_INSTANTIATION MSUnsignedEntryField::MSUnsignedEntryField(MSWidget *owner_, const char *label_,const MSSymbol& tag_) : MSTypeEntryField(owner_,label_,tag_) { init(); } MSUnsignedEntryField::MSUnsignedEntryField(MSWidget *owner_,MSUnsigned& model_, const char *label_,const MSSymbol& tag_) : MSTypeEntryField(owner_,model_,label_,tag_) { init(); } MSUnsignedEntryField::~MSUnsignedEntryField(void) {} void MSUnsignedEntryField::init(void) { _format=MSFormat(MSInt::WithoutCommas); _incrementValue=1; _clipMode=MSClipIndicator; minimumValue( MSUnsigned(0) ); } void MSUnsignedEntryField::increment(void) { if (MSView::model()!=0) { if ((unsigned)value() <= UINT_MAX - (unsigned)incrementValue()) // prevent overflow { if (maximumValue().isSet()==MSTrue) { unsigned anUnsigned=value(); anUnsigned+=(unsigned)incrementValue(); if (anUnsigned<=maximumValue()) { value()=anUnsigned; valueChange(); } } else { value()+=incrementValue(); valueChange(); } } } } void MSUnsignedEntryField::decrement(void) { if (MSView::model()!=0) { if (value() >= incrementValue()) // prevent underflow { if (minimumValue().isSet()==MSTrue) { unsigned anUnsigned=value(); anUnsigned-=(unsigned)incrementValue(); if (anUnsigned>=minimumValue()) { value()=anUnsigned; valueChange(); } } else { value()-=incrementValue(); valueChange(); } } } } aplus-fsf-4.22/src/MSGUI/MSVGauge.C0000644000265000001440000002106110772770415012225 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include extern const int SliderAreaShadowThickness; MSVGauge::MSVGauge(MSWidget *owner_,const char *title_) : MSVScale(owner_,title_) { init(); } MSVGauge::MSVGauge(MSWidget *owner_,const MSStringVector& title_) : MSVScale(owner_,title_) { init(); } MSVGauge::MSVGauge(MSWidget *owner_,MSFloat& model_,const char *title_) : MSVScale(owner_,model_,title_) { init(); } MSVGauge::MSVGauge(MSWidget *owner_,MSFloat& model_,const MSStringVector& title_) : MSVScale(owner_,model_,title_) { init(); } MSVGauge::MSVGauge(MSWidget *owner_,MSInt& model_,const char *title_) : MSVScale(owner_,model_,title_) { init(); } MSVGauge::MSVGauge(MSWidget *owner_,MSInt& model_,const MSStringVector& title_) : MSVScale(owner_,model_,title_) { init(); } void MSVGauge::init(void) { acceptFocus(MSFalse); sensitive(MSFalse); _gaugeHeight=0; _startValue.unset(); } MSVGauge::~MSVGauge(void) {} void MSVGauge::redraw(void) { MSVScale::redraw(); drawGauge(); } void MSVGauge::drawSubWindows(void) { if (outputMode()map(); valueWin()->raise(); } else valueWin()->unmap(); valueWin()->moveTo(x_end(),y_org()); } } void MSVGauge::update(const MSIndexVector&) { updateSliderSize(currentValue()); } void MSVGauge::sliderRedrawNotify(void) { drawGauge(); } void MSVGauge::updateSliderSize(double value_) { if (gaugeHeight()<=slider()->shadowThickness()||value_<=valueMin()||value_>=valueMax()) { drawSliderArea(); drawGauge(); } else updateGauge((int)(value_)); MSString buffer; valueWin()->updateValue(formatValue(buffer,value_)); } void MSVGauge::drawGauge(void) { if (mapped()==MSTrue) { int x=sliderAreaRect().x()+SliderAreaShadowThickness; int y=y_end(); int curValue=valueToPixel(currentValue())+slider()->height(); int startValue; if(_startValue.isSet()==MSTrue) { double sv=_startValue; if(svvalueMax()) sv=valueMax(); startValue=valueToPixel(sv)+slider()->height(); } else startValue=y-SliderAreaShadowThickness; Direction direction=curValueshadowThickness(); int h=abs(startValue-curValue); int starty=(direction==Up)?startValue:curValue; if (h>=thickness&&slider()->width()>thickness*2) { int height=h-(h>thickness*2?thickness*2:thickness); XBFillRectangle(display(),window(),slider()->backgroundShadowGC(), x+thickness,starty-h+thickness,slider()->width()-2*thickness,height); } if (h>thickness&&thickness>0) { drawGaugeShadow(x,starty,h,thickness,direction); } gaugeHeight(h); _direction=direction; } } void MSVGauge::drawGaugeShadow(int x,int y, int h, int thickness, Direction direction) { // left XBFillRectangle(display(),window(),slider()->topShadowGC(),x,y-h,thickness,h); // top or bottom int starty=direction==Up?y:y+h-thickness; XBFillRectangle(display(),window(),slider()->topShadowGC(),x,starty-h,slider()->width(), h>thickness?thickness:h); if (h>thickness) { XPoint points[6]; points[0].y=points[1].y=direction==Up?y:y-h; points[4].y=points[5].y=direction==Up?y-thickness:y-h+thickness; points[2].y=direction==Up?y-h:y; points[3].y=direction==Up?y-h+thickness:y-thickness; points[0].x=x; points[1].x=points[2].x=x+slider()->width(); points[3].x=points[4].x=x+slider()->width()-thickness; points[5].x=x+thickness; XBFillPolygon(display(),window(),slider()->bottomShadowGC(),points,6,Nonconvex,CoordModeOrigin); } } void MSVGauge::updateGauge(int h_) { if (mapped()==MSTrue) { int x=sliderAreaRect().x()+SliderAreaShadowThickness; int y=y_end(); int curValue=valueToPixel(h_)+slider()->height(); int startValue; if(_startValue.isSet()==MSTrue) { double sv=_startValue; if(svvalueMax()) sv=valueMax(); startValue=valueToPixel(sv)+slider()->height(); } else startValue=y-SliderAreaShadowThickness; Direction direction=curValueshadowThickness(); int h=abs(startValue-curValue); int starty=startValue; int height=abs(h-gaugeHeight()); if (h==gaugeHeight() && direction==_direction) return; else if (direction==_direction) { if (hwidth(),height+thickness); } else { // value is bigger, add area starty=direction==Up?starty-h+thickness:starty+gaugeHeight()-thickness; XFillRectangle(display(),window(),slider()->backgroundShadowGC(),x+thickness, starty,slider()->width()-2*thickness,height); } if (h>thickness&&thickness>0) updateGaugeShadow(x,starty,h,thickness,direction); } else { // direction changed, redraw drawSliderArea(); drawGauge(); } gaugeHeight(h); _direction=direction; } } void MSVGauge::updateGaugeShadow(int x,int y,int h, int thickness, Direction direction) { int height=abs(h-gaugeHeight()); XPoint points[6]; if (hwidth()-thickness; points[2].x=x+slider()->width(); } else { points[0].y=points[1].y=y+thickness; points[2].y=points[3].y=y; points[0].x=points[3].x=x; points[2].x=x+slider()->width()-thickness; points[1].x=x+slider()->width(); } XBFillPolygon(display(),window(),slider()->topShadowGC(),points,4,Nonconvex,CoordModeOrigin); } else { if (direction==Up) { XFillRectangle(display(),window(),slider()->bottomShadowGC(), x+slider()->width()-thickness,y-thickness,thickness,height+thickness); points[0].y=points[1].y=y-thickness; points[2].y=points[3].y=y; points[4].y=points[5].y=y+height; points[0].x=points[5].x=x; points[3].x=points[4].x=x+thickness; points[1].x=x+slider()->width(); points[2].x=x+slider()->width()-thickness; } else { XFillRectangle(display(),window(),slider()->bottomShadowGC(),x+slider()->width()-thickness, y,thickness,height+thickness); points[0].y=points[1].y=y+height+thickness; points[2].y=points[3].y=y+height; points[4].y=points[5].y=y; points[0].x=points[5].x=x; points[3].x=points[4].x=x+thickness; points[2].x=x+slider()->width()-thickness; points[1].x=x+slider()->width(); } XBFillPolygon(display(),window(),slider()->topShadowGC(),points,6,Nonconvex,CoordModeOrigin); } } void MSVGauge::startValue(const MSFloat& value_ ) { _startValue=value_; drawSliderArea(); drawGauge(); } void MSVGauge::set(MSAttrValueList& avList_) { MSScale::set(avList_); for (unsigned i=0;i MSVLayout::MSVLayout(MSWidget *owner_,const char *title_) : MSLayout(owner_,title_) { init(); } MSVLayout::MSVLayout(MSWidget *owner_,const MSStringVector& title_) : MSLayout(owner_,title_) { init(); } MSVLayout::~MSVLayout(void) {} void MSVLayout::init(void) { _orientation=MSLayoutManager::Vertical; } aplus-fsf-4.22/src/MSGUI/MSVPane.C0000644000265000001440000000131510772770416012061 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include static const int MSVPaneDefaultRowSpacing=8; MSVPane::MSVPane(MSWidget *owner_,const char *title_) : MSPane(owner_,title_) { init(); } MSVPane::MSVPane(MSWidget *owner_,const MSStringVector& title_) : MSPane(owner_,title_) { init(); } void MSVPane::init(void) { _orientation=MSLayoutManager::Vertical; _rowSpacing=MSVPaneDefaultRowSpacing; _columnSpacing=0; } MSVPane::~MSVPane(void) {} aplus-fsf-4.22/src/MSGUI/MSVScale.C0000644000265000001440000003476310772770416012242 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include const int DefaultVSliderWidth =14; const int DefaultVSliderHeight =30; const int DefaultVScaleHeight =200; extern const int SliderAreaShadowThickness; MSVScale::VSlider::VSlider(MSWidget* owner_): MSScale::Slider(owner_) {} MSVScale::VSlider::~VSlider() {} void MSVScale::VSlider::drawSliderEtch(void) { if (mapped()==MSTrue) { XDrawLine(display(),window(),bottomShadowGC(),1,height()/2-1,width()-2,height()/2-1); XDrawLine(display(),window(),topShadowGC(),1,height()/2,width()-2,height()/2); } } void MSVScale::VSlider::moveTo(int x_,int y_) { MSWidget::moveTo(x_,y_); setValueWinYCoord(y_); } MSVScale::MSVScale(MSWidget *owner_,const char *title_) : MSScale(owner_,title_) { init(); } MSVScale::MSVScale(MSWidget *owner_,const MSStringVector& title_) : MSScale(owner_,title_) { init(); } MSVScale::MSVScale(MSWidget *owner_,MSFloat& model_,const char *title_) : MSScale(owner_,model_,title_) { init(); } MSVScale::MSVScale(MSWidget *owner_,MSFloat& model_,const MSStringVector& title_) : MSScale(owner_,model_,title_) { init(); } MSVScale::MSVScale(MSWidget *owner_,MSInt& model_,const char *title_) : MSScale(owner_,model_,title_) { init(); } MSVScale::MSVScale(MSWidget *owner_,MSInt& model_,const MSStringVector& title_) : MSScale(owner_,model_,title_) { init(); } void MSVScale::init(void) { _slider=new VSlider(this); _labelAlignment=(unsigned long)(MSLeft); _valueAlignment=(unsigned long)(MSRight); sliderWidth(DefaultVSliderWidth); sliderHeight(DefaultVSliderHeight); } MSVScale::~MSVScale(void) {} void MSVScale::home(void) { assignValue(valueMax()); } void MSVScale::end(void) { assignValue(valueMin()); } void MSVScale::computeSize(void) { int w,h; XFontStruct *fontInfo=(XFontStruct *)server()->fontStruct(titleFont()); _topOffset=highlightThickness()+shadowThickness(); _titleWidth=_bottomOffset=_leftOffset=_rightOffset=_topOffset; _mintitleWidth=_maxtitleWidth=0; if (title().maxLength()>0) { h=(fontInfo->ascent+fontInfo->descent)*title().length(); _topOffset+=MSBottom&titleAlignment()?0:h; _bottomOffset+=MSTop&titleAlignment()?0:h; for (int i=0;ititleWidth()?w:titleWidth()); } } if (subtitle().maxLength()>0) { fontInfo=(XFontStruct *)server()->fontStruct(subtitleFont()); h=(fontInfo->ascent+fontInfo->descent)*subtitle().length(); _topOffset+=MSBottom&subtitleAlignment()?0:h; _bottomOffset+=MSTop&subtitleAlignment()?0:h; for (int i=0;ititleWidth()?w:titleWidth()); } } _titleWidth+=2*leftOffset(); if (maxtitle().maxLength()>0) { fontInfo=(XFontStruct *)server()->fontStruct(maxtitleFont()); _maxtitleHeight=fontInfo->ascent+fontInfo->descent; _maxtitleHeight*=maxtitle().length(); _maxtitleHeight+=labelSpacing(); _topOffset+=MSCenter&maxtitleAlignment()?maxtitleHeight():0; for (int i=0;imaxtitleWidth()?w:maxtitleWidth()); } _leftOffset+=MSLeft&maxtitleAlignment()?MSCenter&maxtitleAlignment()?0:maxtitleWidth():0; _rightOffset+=MSRight&maxtitleAlignment()?MSCenter&maxtitleAlignment()?0:maxtitleWidth():0; } if (mintitle().maxLength()>0) { fontInfo=(XFontStruct *)server()->fontStruct(mintitleFont()); _mintitleHeight=fontInfo->ascent+fontInfo->descent; _mintitleHeight*=mintitle().length(); _mintitleHeight+=labelSpacing(); _bottomOffset+=MSCenter&mintitleAlignment()?mintitleHeight():0; for (int i=0;imintitleWidth()?w:mintitleWidth()); } _leftOffset+=MSLeft&mintitleAlignment()?MSCenter&mintitleAlignment()?0:mintitleWidth():0; _rightOffset+=MSRight&mintitleAlignment()?MSCenter&mintitleAlignment()?0:mintitleWidth():0; } w=MSCenter&mintitleAlignment()?0:mintitleWidth(); titleWidth(w>titleWidth()?w:titleWidth()); w=MSCenter&maxtitleAlignment()?0:maxtitleWidth(); titleWidth(w>titleWidth()?w:titleWidth()); if (valueAlignment()!=0) { computeValueWinSize(); _leftOffset+=MSRight&valueAlignment()?0:valueWin()->width(); _rightOffset+=MSLeft&valueAlignment()?0:valueWin()->width(); } if (labelAlignment()!=0) { fontInfo=(XFontStruct *)server()->fontStruct(labelFont()); MSString buffer; formatLabel(buffer,valueMin()); int wmin=XTextWidth(fontInfo,buffer,buffer.length()); wmin=wmin>labelOffset()?wmin-labelOffset():0; formatLabel(buffer.removeAll(),valueMax()); int wmax=XTextWidth(fontInfo,buffer,buffer.length()); wmax=wmax>labelOffset()?wmax-labelOffset():0; int labelWidth=wmin>wmax?wmin:wmax; labelWidth+=3+(majorTickSize()>minorTickSize()?majorTickSize():minorTickSize()); _leftOffset+=MSRight&labelAlignment()?0:labelWidth; _rightOffset+=MSLeft&labelAlignment()?0:labelWidth; } _leftOffset=leftOffset()>rightOffset()?leftOffset():rightOffset(); _rightOffset=rightOffset()>leftOffset()?rightOffset():leftOffset(); int left=leftOffset()==0?SliderAreaShadowThickness:leftOffset(); int right=rightOffset()==0?SliderAreaShadowThickness:rightOffset(); w=slider()->width()+2*slider()->offset()+left+right; w=w>titleWidth()?w:titleWidth(); w+=2*SliderAreaShadowThickness; naturalScaleSize(w); resize(w,DefaultVScaleHeight); } void MSVScale::setSliderPosition(int y_) { int y=y_offset()?y_org()+slider()->offset(): y_>y_end()-slider()->offset()-slider()->height()? y_end()-slider()->offset()-slider()->height():y_; int x=x_org()+SliderAreaShadowThickness; if (x!=slider()->x_origin()||y!=slider()->y_origin()) slider()->moveTo(x,y); } void MSVScale::computeSliderAreaSize(void) { int top=topOffset(); int bottom=bottomOffset(); int h,labelHeight=0,valueHeight=0; if (labelAlignment()!=0) { XFontStruct *fontInfo=(XFontStruct *)server()->fontStruct(labelFont()); labelHeight=(fontInfo->ascent+fontInfo->descent)/2; labelHeight=labelHeight>labelOffset()?labelHeight-labelOffset():labelHeight; labelHeight=labelHeight>mintitleHeight()?labelHeight-mintitleHeight():0; } if (valueAlignment()!=0) { valueHeight=valueWin()->textHeight()/2-labelOffset(); valueHeight=valueHeight>mintitleHeight()?valueHeight-mintitleHeight():0; } h=(labelHeight>valueHeight?labelHeight:valueHeight)+SliderAreaShadowThickness; sliderAreaRect().y(top+h); sliderAreaRect().height(height()-y_org()-bottom-h); sliderAreaRect().x((width()-slider()->width())/2-slider()->offset()); sliderAreaRect().width(slider()->width()+2*slider()->offset()); valueWin()->x_org(MSLeft&valueAlignment()?x_org()-valueWin()->width():x_end()); } void MSVScale::computeTickInc(void) { XFontStruct *fontInfo=(XFontStruct *)server()->fontStruct(labelFont()); int offset=labelOffset()==0?1:slider()->height(); int h=sliderAreaRect().height()-offset-slider()->offset(); double range=fabs(valueMax()-valueMin()); if (labelInc()<=0.0) { double r=range*fontInfo->ascent*3/h; incData(outFmt().snapNumber(r,*labelOut())); } else incData(labelInc()); } void MSVScale::computeSliderScale(void) { int offset=labelOffset()==0?0:slider()->height(); int h=sliderAreaRect().height()-offset-2*SliderAreaShadowThickness; base(valueMin()); scale(h/(valueMax()-valueMin())); scale((scale()>INT_MAX/2)?INT_MAX/2:scale()); } void MSVScale::drawSliderTitles(void) { int offset=highlightThickness()+shadowThickness(); int x,len,w,y,center=x_org()+slider()->width()/2; XFontStruct *fontInfo; GC gc=XCreateGC(display(),window(),0,0); if (mintitle().maxLength()>0) { fontInfo=(XFontStruct *)server()->fontStruct(mintitleFont()); XSetFont(display(),gc,mintitleFont()); XSetForeground(display(),gc,mintitleForeground()); y=MSCenter&mintitleAlignment()?y_end()+labelSpacing():y_end()-mintitleHeight(); y+=fontInfo->ascent; for (int i=0;iascent+fontInfo->descent; } } if (maxtitle().maxLength()!=0) { fontInfo=(XFontStruct *)server()->fontStruct(maxtitleFont()); XSetFont(display(),gc,maxtitleFont()); y=MSCenter&maxtitleAlignment()?y_org()-maxtitleHeight():y_org(); XSetForeground(display(),gc,maxtitleForeground()); y+=fontInfo->ascent; for (int i=0;iascent+fontInfo->descent; } } XFreeGC(display(),gc); } void MSVScale::drawTickLabels(void) { if (labelAlignment()!=MSNone) { int majorTick=0,minorTick=minorTickCount()+1; int y,xx,x=MSRight&labelAlignment()?x_end():x_org(); int ct=0,sign=MSRight&labelAlignment()?-1:1; int tickPositionLength; int offset=labelOffset()==0?1:labelOffset(); double r,s,inc; XSegment *segments; XFontStruct *fontInfo=(XFontStruct *)server()->fontStruct(labelFont()); int bufSize; MSString buffer; tickPositionLength=labelOut()->tickPositionLength(); if(tickPositionLength!=0) bufSize=tickPositionLength+10; else bufSize=(int)(10+(valueMax()-valueMin())/incData()*(1+minorTickCount())); XSetForeground(display(),gc(),labelForeground()); XSetFont(display(),gc(),labelFont()); segments=new XSegment[bufSize]; if(tickPositionLength!=0) { int gridWidthLength=labelOut()->gridWidthLength(); int labelLength=labelOut()->labelLength(); int tickSizeLength=labelOut()->tickSizeLength(); int tickSize; for (unsigned i=0;itickPosition(i)tickPosition(i)>valueMax()) continue; y=valueToPixel(labelOut()->tickPosition(i))-offset +slider()->height(); tickSize=tickSizeLength==0?majorTickSize():int(majorTickSize()*labelOut()->tickSize(i)); if (tickSize>0&&ct0) { if (ilabel(buffer.removeAll(),i); } else { s=labelOut()->tickPosition(i); formatLabel(buffer.removeAll(),s); } if (buffer.length()>0) { xx=x-(majorTickSize()+3)*sign; xx+=MSRight&labelAlignment()|MSBottom&labelAlignment()?0:sign*fontInfo->descent/4; xx-=MSRight&labelAlignment()?0:XTextWidth(fontInfo,buffer,buffer.length()); y+=MSBottom&labelAlignment()?-fontInfo->descent/2:MSTop&labelAlignment()? fontInfo->ascent:fontInfo->ascent/2; XDrawString(display(),window(),gc(),fontInfo,xx,y,buffer,buffer.length()); } } } else { if ((labelOut()->formatType()==MSFormat::Date|| labelOut()->formatType()==MSFormat::Time)&&valueMax()>0) { r=outFmt().snapTime(valueMin(),incData()); } else r=valueMin()-fmod(valueMin(),incData()); inc=incData()/minorTick; while (rheight(); if (majorTick%minorTick==0) { if (majorTickSize()>0) { segments[ct].x1=x; segments[ct].y1=segments[ct].y2=y; segments[ct++].x2=x-majorTickSize()*sign; } s=(fabs(r)/inc<1.0)?0:r; formatLabel(buffer.removeAll(),s); xx=x-(majorTickSize()+3)*sign; xx+=MSRight&labelAlignment()|MSBottom&labelAlignment()?0:sign*fontInfo->descent/4; xx-=MSRight&labelAlignment()?0:XTextWidth(fontInfo,buffer,buffer.length()); y+=MSBottom&labelAlignment()?-fontInfo->descent/2:MSTop&labelAlignment()? fontInfo->ascent:fontInfo->ascent/2; XDrawString(display(),window(),gc(),fontInfo,xx,y,buffer,buffer.length()); } else { if (minorTickSize()>0) { segments[ct].x1=x; segments[ct].y1=segments[ct].y2=y; segments[ct++].x2=x-minorTickSize()*sign; } } r+=inc; majorTick++; } } XDrawSegments(display(),window(),gc(),segments,ct); delete [] segments; } } void MSVScale::moveSlider(const XEvent *event_) { int y=0; int ix,iy,rx,ry; int yoffset; unsigned int keys,mask=0; Window root,child; if (event_->xbutton.button==1) { mask=Button1Mask; yoffset=event_->xbutton.y; y=slider()->y_origin()+yoffset; } else if (event_->xbutton.button==2) { setSliderPosition(event_->xbutton.y); mask=Button2Mask; yoffset=slider()->height()/2; } keys=mask; while (keys&mask) { XQueryPointer(display(),window(),&root,&child,&rx,&ry,&ix,&iy,&keys); if (iy!=y) { setSliderPosition(iy-yoffset); setValue(pixelToValue(iy-yoffset)); } y=iy; } } // ######################################################### // default virtual methods - prevents gratuitous inlining // ######################################################### int MSVScale::sliderSize(void) const { return slider()->width(); } void MSVScale::sliderSize(int x_) { slider()->width(x_); } void MSVScale::computeLabelOffset(void) { labelOffset(slider()->height()/2+1); } double MSVScale::pixelToValue(int y_) { return (y_end()-slider()->offset()-slider()->height()-y_)/scale()+base(); } int MSVScale::valueToPixel(double y_) { return (int)(y_end()-slider()->offset()-slider()->height()-(y_-base())*scale()); } int MSVScale::incFactor(int,int y_) { return y_>slider()->y_origin()?-1:1; } void MSVScale::drawSliderEtch(void) {slider()->drawSliderEtch();} aplus-fsf-4.22/src/MSGUI/MSVScrollBar.C0000644000265000001440000005077510772770416013077 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include static const int DefaultScrollBarHeight=100; //static const int MinVSBHeight=39; static const int MinimumMotifSliderHeight=4; static const int DefaultElevatorBoxHeight=15; static const int DefaultElevatorHeight=49; static const int MinElevatorHeight=33; static const int MSVScrollBarMinPropLength=3; static const int MSVScrollBarDefaultArrowHeight=9; static const int MSVScrollBarDefaultArrowOffset=3; static const int MSVScrollBarDefaultMarkerHeight=6; static const int MSVScrollBarDefaultMarkerGap=2; static const int MSVScrollBarDefaultCableWidth=3; static const int MSVScrollBarSmallThickness=17; MSVScrollBar::VElevator::VElevator(MSVScrollBar *owner_) : MSScrollBar::Elevator(owner_) { _arrow1=new MSArrow(this,MSArrow::Up); _arrow2=new MSArrow(this,MSArrow::Down); } MSVScrollBar::VElevator::~VElevator(void) {} void MSVScrollBar::VElevator::configure(void) { if (scrollBar()->style()==MSScrollBar::Openlook) { if (_arrow1!=0||_arrow2!=0) { int offset=highlightThickness()+shadowThickness(); int ah=MSVScrollBarDefaultArrowHeight; int aw=width()-2*offset; _arrow1->resize(aw,ah); _arrow2->resize(aw,ah); _arrow1->moveTo(offset,offset+MSVScrollBarDefaultArrowOffset); _arrow2->moveTo(offset,height()-offset-_arrow2->height()-MSVScrollBarDefaultArrowOffset); draw(); } } } void MSVScrollBar::VElevator::unselect(void) { if (mapped()==MSTrue&&owner()->mapped()==MSTrue&&owner()->owner()->mapped()==MSTrue) { if (scrollBar()->style()==MSScrollBar::Openlook) { if (height()==DefaultElevatorHeight) { int offset=highlightThickness()+shadowThickness(); int ew=width()-2*offset; int eh=DefaultElevatorBoxHeight-2; int y=offset+DefaultElevatorBoxHeight+1; int x=offset; XFillRectangle(display(),window(),backgroundShadowGC(),x,y,ew,eh); } } } } void MSVScrollBar::VElevator::select(void) { if (mapped()==MSTrue&&owner()->mapped()==MSTrue&&owner()->owner()->mapped()==MSTrue) { if (scrollBar()->style()==MSScrollBar::Openlook) { if (height()==DefaultElevatorHeight) { int offset=highlightThickness()+shadowThickness(); int ew=width()-2*offset; int eh=DefaultElevatorBoxHeight; int y=offset+DefaultElevatorBoxHeight; int x=offset; int w=ew>>1; int h=eh>>1; int xd=(ew-w)>>1; int yd=(eh-h)>>1; XFillArc(display(),window(),bottomShadowGC(),x+xd,y+yd,w,h,0,360*64); } } } } void MSVScrollBar::VElevator::draw(void) { if (mapped()==MSTrue&&owner()->mapped()==MSTrue&&owner()->owner()->mapped()==MSTrue) { int ht=highlightThickness(); int sht=shadowThickness(); int offset=ht+sht; int y=offset+DefaultElevatorBoxHeight; if (scrollBar()->style()==MSScrollBar::Openlook) { drawBackground(); drawShadow(MSRaised); if (height()==DefaultElevatorHeight) { XDrawLine(display(),window(),topShadowGC(),offset,y,width()-2*offset,y); y+=DefaultElevatorBoxHeight; XDrawLine(display(),window(),bottomShadowGC(),offset,y,width()-2*offset,y); drawArrows(); } else if (height()==MinElevatorHeight) { XDrawLine(display(),window(),bottomShadowGC(),offset,y,width()-2*offset,y); drawArrows(); } } else { drawRaised(); XFillRectangle(display(),window(),backgroundShadowGC(), offset,offset,width()-2*offset,height()-2*offset); drawArrows(); } } } MSVScrollBar::MSVScrollBar(MSWidget *owner_,int min_,int max_,int inc_) : MSScrollBar(owner_,min_,max_,inc_) { init(); } MSVScrollBar::~MSVScrollBar(void) {} void MSVScrollBar::init(void) { _elevator=new VElevator(this); resize(MSVScrollBarSmallThickness+2*highlightThickness(),DefaultScrollBarHeight); _elevator->map(); } void MSVScrollBar::adjustPointer(void) { if (style()==MSScrollBar::Openlook) { if (changeType()==Dec) { XWarpPointer(display(),None,_elevator->window(), 0,0,0,0,_elevator->width()>>1,DefaultElevatorBoxHeight>>1); } else if (changeType()==Inc) { XWarpPointer(display(),None,_elevator->window(), 0,0,0,0,_elevator->width()>>1, _elevator->height()-(DefaultElevatorBoxHeight>>1)); } XFlush(display()); } } void MSVScrollBar::configureElevator(void) { if (style()!=MSScrollBar::Openlook&&_elevator!=0) { int offset=highlightThickness()+shadowThickness(); int arrowHeight=_elevator->_arrow1->height(); if (arrowHeight==0) arrowHeight=-1; arrowHeight+=(offset+1); double userSize=(max()-min()); double trueSize=sliderAreaRect().height(); double factor; factor=(userSize!=0)?trueSize/userSize:0; double slideSize=(double)(viewSize())*factor; int h=(int)(slideSize+0.5); _elevator->resize(width()-2*offset,h>MinimumMotifSliderHeight?h:MinimumMotifSliderHeight); } } void MSVScrollBar::configureForOpenlook(void) { _shadowThickness=1; if (_elevator!=0) { _elevator->shadowThickness(shadowThickness()); _elevator->_arrow1->owner(_elevator); _elevator->_arrow2->owner(_elevator); } int ht=highlightThickness(); int sht=shadowThickness(); int mh=MSVScrollBarDefaultMarkerHeight; int mg=MSVScrollBarDefaultMarkerGap; int eh=DefaultElevatorHeight; int h=height()-2*ht; if (h>=eh+2*(mh+mg)) { _markersOn=MSTrue; _elevatorOn=MSTrue; } else { eh=MinElevatorHeight; if (h>=eh+2*(mh+mg)) { _markersOn=MSTrue; _elevatorOn=MSTrue; } else if (h>=eh) { mh=0; mg=0; _markersOn=MSFalse; _elevatorOn=MSTrue; } else { mh=0; mg=0; _markersOn=MSFalse; _elevatorOn=MSFalse; } } sliderAreaRect().y(ht+mh+mg); sliderAreaRect().height(h-2*(mh+mg)); sliderAreaRect().x(ht); sliderAreaRect().width(width()-2*ht); double factor=0.0; if (max()-min()>0) { double userSize=(max()-min()); double trueSize=sliderAreaRect().height()-_elevator->height(); factor=trueSize/userSize; } double slideStart=(double)(value()-min())*factor; int yy=(int)(slideStart+0.5)+sliderAreaRect().y(); if (_elevator!=0) { _elevator->moveTo(ht,boundsCheckY(yy)); _elevator->resize(width()-2*ht,eh); } } void MSVScrollBar::configureForMotif(void) { if (_elevator!=0) { _shadowThickness=2; _elevator->shadowThickness(shadowThickness()); _elevator->_arrow1->owner(this); _elevator->_arrow2->owner(this); const int MinScrollBarLength=6; int offset=shadowThickness()+highlightThickness(); int w,h; w=h=width()-2*offset; if (height()<2*(h+offset)+MinScrollBarLength+2) h=(height()-(MinScrollBarLength+2+2*offset))/2; sliderAreaRect().y(offset+h+1); sliderAreaRect().x(offset); sliderAreaRect().width(width()-2*offset); sliderAreaRect().height(height()-2*(offset+h+1)); _elevator->_arrow1->configure(offset,offset,w,h); _elevator->_arrow2->configure(offset,offset+h+1+sliderAreaRect().height()+1,w,h); int arrowHeight=_elevator->_arrow1->height(); if (arrowHeight==0) arrowHeight=-1; arrowHeight+=(offset+1); double userSize=(max()-min()); double trueSize=sliderAreaRect().height(); double factor=(userSize!=0)?trueSize/userSize:0; double slideStart=(double)(value()-min())*factor+arrowHeight; double slideSize=(double)(viewSize())*factor; int yy=(int)(slideStart+0.5); h=(int)(slideSize+0.5); _elevator->moveTo(offset,boundsCheckY(yy)); _elevator->resize(width()-2*offset,h>MinimumMotifSliderHeight?h:MinimumMotifSliderHeight); redrawElevator(); } } void MSVScrollBar::motifButton1Press(const XEvent *pXEvent_) { int xx=pXEvent_->xbutton.x; int yy=pXEvent_->xbutton.y; _savedValue=value(); _separation_x=0; _separation_y=0; _changeType=NoChange; // Calculate whether the selection point is in the slider if ((xx>=_elevator->x())&& (xx<=_elevator->x()+_elevator->width())&& (yy>=_elevator->y())&& (yy<=_elevator->y()+_elevator->height())) { _separation_x=xx-_elevator->x(); _separation_y=yy-_elevator->y(); _initial_x=_elevator->x(); _initial_y=_elevator->y(); _slidingOn=MSTrue; _changeType=Drag; motionLoop(); } // ... in arrow 1 else if ((xx>=_elevator->_arrow1->x())&& (yy>=_elevator->_arrow1->y())&& (xx<=_elevator->_arrow1->x()+_elevator->_arrow1->width())&& (yy<=_elevator->_arrow1->y()+_elevator->_arrow1->height())) { _changeType=Dec; _elevator->_arrow1->select(MSTrue); } // ... in arrow 2 else if ((xx>=_elevator->_arrow2->x())&& (yy>=_elevator->_arrow2->y())&& (xx<=_elevator->_arrow2->x()+_elevator->_arrow2->width())&& (yy<=_elevator->_arrow2->y()+_elevator->_arrow2->height())) { _changeType=Inc; _elevator->_arrow2->select(MSTrue); } // ... in the trough (i.e. slider area)... else if ((xx>=sliderAreaRect().x())&& (yy>=sliderAreaRect().y())&& (xx<=sliderAreaRect().x()+sliderAreaRect().width())&& (yy<=sliderAreaRect().y()+sliderAreaRect().height())) { // Page the slider up or down if (yy<_elevator->y()) _changeType=PageUp; else _changeType=PageDown; } else return; //... in the highlight area. startDelayTimer(); updateSliderValue(); } void MSVScrollBar::motifButton2Press(const XEvent *pXEvent_) { int xx=pXEvent_->xbutton.x; int yy=pXEvent_->xbutton.y; _savedValue=value(); _separation_x=0; _separation_y=0; _changeType=NoChange; // Calculate whether the selection point is in the slider if ((xx>=_elevator->x())&& (xx<=_elevator->x()+_elevator->width())&& (yy>=_elevator->y())&& (yy<=_elevator->y()+_elevator->height())) { _separation_x=xx-_elevator->x(); _separation_y=yy-_elevator->y(); _initial_x=_elevator->x(); _initial_y=_elevator->y(); _slidingOn=MSTrue; _changeType=Drag; } else if ((xx>=sliderAreaRect().x())&& (yy>=sliderAreaRect().y())&& (xx<=sliderAreaRect().x()+sliderAreaRect().width())&& (yy<=sliderAreaRect().y()+sliderAreaRect().height())) { // Warp the slider to the cursor, and then drag _separation_y=_elevator->height()/2; _initial_x=_elevator->x(); _initial_y=_elevator->y(); _slidingOn=MSTrue; _changeType=Drag; } motionLoop(); } void MSVScrollBar::openlookButton1Press(const XEvent *pXEvent_) { int ht=highlightThickness(); int xx=pXEvent_->xbutton.x; int yy=pXEvent_->xbutton.y; _savedValue=value(); _separation_y=0; _changeType=NoChange; // Calculate whether the selection point is in the slider if ((_elevator->height()==DefaultElevatorHeight)&& (xx>=_elevator->x())&& (xx<=_elevator->x()+_elevator->width())&& (yy>=_elevator->y()+DefaultElevatorBoxHeight)&& (yy<=_elevator->y()+_elevator->height()-DefaultElevatorBoxHeight)) { _separation_y=yy-_elevator->y(); _initial_y=_elevator->y(); _slidingOn=MSTrue; _changeType=Drag; motionLoop(); return; } // ... in arrow 1 else if ((xx>=_elevator->_arrow1->x())&& (yy>=_elevator->y())&& (xx<=_elevator->_arrow1->x()+_elevator->_arrow1->width())&& (yy<=_elevator->y()+DefaultElevatorBoxHeight)) { _changeType=Dec; _elevator->_arrow1->select(MSTrue); } // ... in arrow 2 else if ((xx>=_elevator->_arrow2->x())&& (yy>=_elevator->y()+_elevator->height()-DefaultElevatorBoxHeight)&& (xx<=_elevator->_arrow2->x()+_elevator->_arrow2->width())&& (yy<=_elevator->y()+_elevator->height())) { _changeType=Inc; _elevator->_arrow2->select(MSTrue); } // ... in top marker else if ((xx>=sliderAreaRect().x())&& (yy>=ht)&& (xx<=sliderAreaRect().x()+sliderAreaRect().width())&& (yy<=ht+MSVScrollBarDefaultMarkerHeight)) { _changeType=Home; } // ... in bottom marker else if ((xx>=sliderAreaRect().x())&& (yy>=height()-ht-MSVScrollBarDefaultMarkerHeight)&& (xx<=sliderAreaRect().x()+sliderAreaRect().width())&& (yy<=height()-ht)) { _changeType=End; } // ... in the trough (i.e. slider area)... else if ((xx>=sliderAreaRect().x())&& (yy>=sliderAreaRect().y())&& (xx<=sliderAreaRect().x()+sliderAreaRect().width())&& (yy<=sliderAreaRect().y()+sliderAreaRect().height())) { // Page the slider up or down if (yy<_elevator->y()+DefaultElevatorBoxHeight) _changeType=PageUp; else _changeType=PageDown; } else return; //... in the highlight area. startDelayTimer(); updateSliderValue(); } void MSVScrollBar::openlookButton2Press(const XEvent *pXEvent_) { int xx=pXEvent_->xbutton.x; int yy=pXEvent_->xbutton.y; _savedValue=value(); _separation_y=0; _changeType=NoChange; // Calculate whether the selection point is in the slider if ((_elevator->height()==DefaultElevatorHeight)&& (xx>=_elevator->x())&& (xx<=_elevator->x()+_elevator->width())&& (yy>=_elevator->y()+DefaultElevatorBoxHeight)&& (yy<=_elevator->y()+_elevator->height()-DefaultElevatorBoxHeight)) { _separation_y=yy-_elevator->y(); _initial_y=_elevator->y(); _slidingOn=MSTrue; _changeType=Drag; } // ... in the trough (i.e. slider area)... else if ((xx>=sliderAreaRect().x())&& (yy>=sliderAreaRect().y())&& (xx<=sliderAreaRect().x()+sliderAreaRect().width())&& (yy<=sliderAreaRect().y()+sliderAreaRect().height())) { // Warp the slider to the cursor,and then drag _separation_y=_elevator->height()/2; _initial_y=_elevator->y(); _slidingOn=MSTrue; _changeType=Drag; } motionLoop(); } void MSVScrollBar::motionLoop(void) { unsigned int mask=Button1Mask|Button2Mask; unsigned int keys=mask; int ix=0,iy=0; int rx=0,ry=0; int button_x,button_y; int newY,realY; int slideVal; Window root,child; freeze(); // prevent redraw from expose when elevator is moved. _elevator->select(); while (keys&mask) { XQueryPointer(display(),window(),&root,&child,&rx,&ry,&ix,&iy,&keys); button_y=iy; button_x=ix; // Force button_x and button_y to be within the slider_area. if (button_xsliderAreaRect().x()+sliderAreaRect().width()) button_x=sliderAreaRect().x()+sliderAreaRect().width(); if (button_ysliderAreaRect().y()+sliderAreaRect().height()) button_y=sliderAreaRect().y()+sliderAreaRect().height(); // Calculate the new origin of the slider. // Bound the values with the slider area. newY=realY=button_y-_separation_y; if (newYheight()>sliderAreaRect().y()+sliderAreaRect().height()) newY=sliderAreaRect().y()+sliderAreaRect().height()-_elevator->height(); if (realY!=_initial_y) { slideVal=calcSliderValue(button_x,button_y); if (slideVal==value()) _changeType=NoChange; if (slideVal>=max()-viewSize()) { slideVal=max()-viewSize(); newY=calcYValue(slideVal); } int oldValue=value(); _value=slideVal; moveElevator(_elevator->x(),newY); _initial_y=_elevator->y(); if (oldValue!=_value) drag(); } } _elevator->unselect(); unfreeze(); } int MSVScrollBar::boundsCheckY(int y_) { if (y_height()>sliderAreaRect().y()+sliderAreaRect().height()) { y_=sliderAreaRect().y()+sliderAreaRect().height()-_elevator->height(); } return y_; } int MSVScrollBar::calcSliderValue(int,int y_) { if (y_<=sliderAreaRect().y()) { return min(); } else if (y_>=sliderAreaRect().y()+sliderAreaRect().height()) { return max()-viewSize(); } else { double referencePoint=(double)y_-_separation_y; double userSize=max()-min(); double temp; if (style()==MSScrollBar::Openlook) { double trueSize=sliderAreaRect().height()-_elevator->height(); temp=referencePoint/trueSize; } else { int offset=highlightThickness()+shadowThickness(); double trueSize=sliderAreaRect().height(); int arrowSize=(_elevator->_arrow1!=0)?_elevator->_arrow1->height():0; temp=(referencePoint-arrowSize-offset)/trueSize; } temp=temp*userSize+min()+0.5; int intTemp=(int)temp; if (intTempmax()-viewSize()) intTemp=max()-viewSize(); return (intTemp); } } int MSVScrollBar::calcYValue(int value_) { double factor=0.0; double userSize=(max()-min()); int yy=0; if (style()==MSScrollBar::Openlook) { if (userSize>0) { double trueSize=sliderAreaRect().height()-_elevator->height(); factor=trueSize/userSize; } double slideStart=(double)(value_-min())*factor; yy=(int)(slideStart+0.5)+sliderAreaRect().y(); } else { int offset=shadowThickness()+highlightThickness(); int arrowHeight=_elevator->_arrow1->height(); if (arrowHeight==0) arrowHeight=-1; arrowHeight+=(offset+1); if (userSize>0) { double trueSize=sliderAreaRect().height(); factor=trueSize/userSize; } double slideStart=(double)(value_-min())*factor+arrowHeight; yy=(int)(slideStart+0.5); } return boundsCheckY(yy); } void MSVScrollBar::redrawElevator(void) { if (mapped()==MSTrue&&owner()->mapped()==MSTrue) { _elevator->moveTo(_elevator->x_origin(),calcYValue(value())); if (style()==MSScrollBar::Openlook) { drawElevatorCable(); drawPropIndicator(); } else { drawElevator(); } } } void MSVScrollBar::moveElevator(int x_,int y_) { if (y_!=_elevator->y()) { _elevator->moveTo(x_,y_); drawElevatorCable(); drawPropIndicator(); } } void MSVScrollBar::drawElevatorCable(void) { if (mapped()==MSTrue&&owner()->mapped()==MSTrue) { if (style()==MSScrollBar::Openlook) { int x=((width()-MSVScrollBarDefaultCableWidth)>>1); int y=sliderAreaRect().y(); int h=sliderAreaRect().height(); XSetFillStyle(display(),bottomShadowGC(),FillTiled); XFillRectangle(display(),window(),bottomShadowGC(),x,y,MSVScrollBarDefaultCableWidth,h); XSetFillStyle(display(),bottomShadowGC(),FillSolid); } } } void MSVScrollBar::drawPropIndicator(void) { if (mapped()==MSTrue&&owner()->mapped()==MSTrue) { if (style()==MSScrollBar::Openlook) { XRectangle rect[2]; double factor=0.0; if (max()-min()>0) { double userSize=(max()-min()); double trueSize=sliderAreaRect().height()-_elevator->height(); factor=trueSize/userSize; } double propSize=(double)(viewSize())*factor; int propLength=(int)(propSize+0.5); int n=1; propLength=(propLength=(max()-min())) sensitive(MSFalse); else sensitive(MSTrue); int x=((width()-MSVScrollBarDefaultCableWidth) >> 1); int y=_elevator->y()+_elevator->height(); rect[0].x=rect[1].x=x; rect[0].width=rect[1].width=MSVScrollBarDefaultCableWidth; if (value()==max()-viewSize()) { rect[0].y=y; rect[0].height=sliderAreaRect().height()+sliderAreaRect().y()-y; } else { if (y+propLength>sliderAreaRect().y()+sliderAreaRect().height()) { if (_elevator->y()-propLength>sliderAreaRect().y()) { int h=sliderAreaRect().height()+sliderAreaRect().y()-y; if (h>0) { n=2; rect[1].y=_elevator->y()+_elevator->height(); rect[1].height=h; } rect[0].height=propLength-h; rect[0].y=_elevator->y()-rect[0].height; } else { rect[0].y=sliderAreaRect().y(); rect[0].height=sliderAreaRect().height(); } } else { rect[0].height=propLength; rect[0].y=y; } } XFillRectangles(display(),window(),bottomShadowGC(),&rect[0],n); } } } void MSVScrollBar::drawMarkers(void) { if (mapped()==MSTrue&&owner()->mapped()==MSTrue&&markersOn()==MSTrue) { if (style()==MSScrollBar::Openlook) { int ht=highlightThickness(); MSRect rect(ht,ht,_elevator->width(),MSVScrollBarDefaultMarkerHeight); drawBevel(rect,MSRaised,shadowThickness()); rect.y(height()-ht-MSVScrollBarDefaultMarkerHeight); drawBevel(rect,MSRaised,shadowThickness()); } } } aplus-fsf-4.22/src/MSGUI/MSVSeparator.C0000644000265000001440000000227510772770416013144 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include const int MSVSeparatorDefaultMarginWidth=2; const int MSVSeparatorDefaultMarginHeight=0; MSVSeparator::MSVSeparator(MSWidget *owner_) :MSSeparator(owner_) { _marginWidth=MSVSeparatorDefaultMarginWidth; _marginHeight=MSVSeparatorDefaultMarginHeight; resizeConstraints(At::MinimizeWidth|At::MaintainWidth); } void MSVSeparator::computeSize(void) { width((marginWidth()+shadowThickness()+highlightThickness()+thickness())*2); } void MSVSeparator::redraw(void) { if (frozen()==MSFalse&&mapped()==MSTrue) { int offset=highlightThickness()+shadowThickness(); int x=marginWidth()+offset; int y=marginHeight()+offset; int Height=height()-((marginHeight()+offset)<<1); XFillRectangle(display(),window(),bottomShadowGC(), x,y,thickness(),Height); XBFillRectangle(display(),window(),topShadowGC(), x+thickness(),y,thickness(),Height); } } aplus-fsf-4.22/src/MSGUI/MSValidationCallback.C0000644000265000001440000000066010772770416014561 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include MSValidationCallback::MSValidationCallback(void) {} MSValidationCallback::~MSValidationCallback(void) {} aplus-fsf-4.22/src/MSGUI/MSValidationInterface.C0000644000265000001440000000247610772770416014774 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include MSValidationInterface::DefaultValidationCallback:: DefaultValidationCallback(ValidationFunction func_,void *clientData_) : _function(func_), _clientData(clientData_) {} MSValidationInterface::DefaultValidationCallback:: ~DefaultValidationCallback(void) {} MSBoolean MSValidationInterface::DefaultValidationCallback:: validate(MSString& aString_) { if (_function!=0) return _function(aString_,_clientData); else return MSFalse; } MSValidationInterface::MSValidationInterface(void) : _validationCallback(0) {} MSValidationInterface::~MSValidationInterface(void) { if (_validationCallback!=0) delete _validationCallback; } void MSValidationInterface:: validationCallback(MSValidationInterface::ValidationFunction f_,void *clientData_) { validationCallback(new DefaultValidationCallback(f_,clientData_)); } void MSValidationInterface::validationCallback(MSValidationCallback *validationCallback_) { if (_validationCallback!=0) delete _validationCallback; _validationCallback=validationCallback_; } aplus-fsf-4.22/src/MSGUI/MSView.C0000644000265000001440000000552410772770416011770 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include MSView::MSView(void) { _model=0,_internalModel=MSFalse; _readOnlyModel=MSFalse; } MSView::~MSView(void) { decouple(); } void MSView::couple(MSModel *model_) { if (model_!=model()) { decouple(); _model=model_; if (model()!=0) addSender(model_); updateData(); // notify the view that it has been coupled to the model } } void MSView::decouple(void) { if (model()!=0) { MSModel *m=model(); _model=0; // prevent removeSenderNotify from doing additional work - i.e. infinite loop removeSender(m); if (internalModel()==MSTrue) delete m; internalModel(MSFalse); readOnlyModel(MSFalse); } } // this function is used when it is desired that the model be deleted // when this view is decoupled void MSView::internalCouple(MSModel *model_) { if (model_!=model()) { couple(model_); internalModel(MSTrue); } } // this function is used when it is desired that the model be const // and thus readOnly void MSView::constCouple(const MSModel *model_) { if (model_!=model()) { //we are casting away const for internal purposes. //Derive class MUST honor the readOnlyModel flag. couple((MSModel*)model_); readOnlyModel(MSTrue); } } // called from MSEventSender::addReceiver and not as a result of MSView::couple // thus we will blow it off, downcast is unsafe void MSView::addSenderNotify(MSEventSender *) {} // called from MSModel::removeReceiver // only concerned when MSModel::removeReceiver is not as a result of MSView::decouple // MSEventReceiver::removeSender will be called when ~MSModel is called void MSView::removeSenderNotify(MSEventSender *model_) { if (model()!=0&&model()==model_) { _model=0; updateData(); } } void MSView::receiveEvent(MSEvent& aEvent_) { if (aEvent_.type()==MSIndexedEvent::symbol()) { MSIndexedEvent &ev=(MSIndexedEvent&)aEvent_; update(ev.index()); } else if (aEvent_.type()==MSNullEvent::symbol()) update(MSIndexVector::nullVector()); } void MSView::decoupleModel(void) { if(internalModel()==MSFalse) couple(0); } MSBoolean MSView::hasModel(void) const { return (_model!=0)?MSTrue:MSFalse; } MSBoolean MSView::isReadOnlyModel(void) const { return _readOnlyModel; } // ######################################################### // default virtual methods - prevents gratuitous inlining // ######################################################### void MSView::updateData(void) {} void MSView::update(const MSIndexVector&) {} aplus-fsf-4.22/src/MSGUI/MSWidget.C0000644000265000001440000011553610772770416012306 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include unsigned long MSDefaultBackground=0x0; // runtime default: pixel value for default bg color unsigned long MSDefaultForeground=0x0; // runtime default: pixel value for default fg color Font MSDefaultFontID=0x0; // runtime default: fontID for default font const char *MSDefaultBackgroundColorSpec="light slate grey"; const char *MSDefaultForegroundColorSpec="white"; const char *MSDefaultFont ="lucidasanstypewriter-bold-14"; const char *MSAltDefaultFont ="fixed"; const int MSDefaultBorderWidth =0; const int MSDefaultWindowBorderWidth =0; const int MSDefaultWidth =10; const int MSDefaultHeight =10; const int MSDefaultX =0; const int MSDefaultY =0; MSWidget *MSWidget::_focusWindow=0; class MSDefaultCallback : public MSCallback { private: MSWidget *_widget; MSWidgetCallbackFunction _function; void *_clientData; public: MSDefaultCallback(MSWidget *widget_,MSWidgetCallbackFunction func_,void *clientData_=0) :_widget(widget_),_function(func_),_clientData(clientData_) {} virtual void process(void); }; void MSDefaultCallback::process(void) {_function(_widget,_clientData);} class MSDefaultWidgetIterator : public MSWidgetIterator { private: MSWidgetIteratorFunction _function; void *_clientData; public: MSDefaultWidgetIterator(MSWidgetIteratorFunction func_,void *clientData_=0) :_function(func_),_clientData(clientData_){} virtual MSBoolean applyTo(MSWidget *widget_); }; MSBoolean MSDefaultWidgetIterator::applyTo(MSWidget *widget_) {return (_function(widget_,_clientData));} #ifdef MS_NO_INLINES #include #endif MSWidget::MSWidget(void) : MSRect(0,0,MSDefaultWidth,MSDefaultHeight) { _owner=0,_server=MSDisplayServer::defaultDisplayServer(); init(); } MSWidget::MSWidget(MSDisplayServer *server_,int x_,int y_,int w_,int h_) : MSRect(x_,y_,w_,h_) { _owner=0,_server=server_; init(); } MSWidget::MSWidget(MSWidget *owner_,int x_,int y_,int w_,int h_) : MSRect(x_,y_,w_,h_) { _owner=owner_,_server=owner_->_server; init(); } MSWidget::~MSWidget(void) { prepareForDestruction(); if (_window!=0) XDestroyWindow(display(),_window); // setting these to zero helps debugging - i.e. one can easily tell if ~ was run _owner=0,_window=0,_server=0,_bg=0,_fg=0,_fontID=0; } void MSWidget::safeDestroy(MSWidget *pWidget_) { if (pWidget_!=0) pWidget_->destroy(); } // allowDelete is MSTrue when the queue is processing - // thus if we are deleting a parent widget (one that has // children) from the process method of the deleteQueue, // then the children will be deleted and not put on the // queue, which would be deadly void MSWidget::destroy(void) { extern void applicationAddToWidgetDestructionQueue(MSWidget *); extern MSBoolean applicationAllowWidgetDestruction(void); if (applicationAllowWidgetDestruction()==MSTrue) delete this; else { applicationAddToWidgetDestructionQueue(this); decoupleAllWidgets(); prepareForDestruction(); } } // this method makes the widget appear to the toolkit as if it has been // destructed - all that remains to do is destroy the window and // recover the memory for the widget (delete widget). // this method is primarily used from MSWidget::destroy to allow // callback safe destruction of widgets void MSWidget::prepareForDestruction(void) { freeze(); MSWidget *pTopWidget=top(); if (_window!=0) _server->widgetHashTable()->remove(_window); // no more events if (pTopWidget!=0) pTopWidget->removeFromFocusList(this); if (pTopWidget!=0&&pTopWidget->inputFocus()==this) (void)pTopWidget->traverseFocus(0); if (focusWindow()==this) _focusWindow=0; childDestroyNotify(); activateCallback(MSWidgetCallback::destroy); removeAllCallbacks(); } // guarantee that no more events will be delivered to either // this widget or any of the widgets in its hierarchy // this includes both screen (XEvent) and Model events. void MSWidget::decoupleAllWidgets(void) { MSWidgetCursor aCursor(this,MSBreadthFirst); for (aCursor.setToFirst();aCursor.isValid();aCursor.setToNext()) { MSWidget *pWidget=aCursor.widget(); Window aWindow=pWidget->_window; // decouple from possible model pWidget->decoupleWidget(); // disable X event dispatching to the widget if (aWindow!=0) _server->widgetHashTable()->remove(aWindow); } } void MSWidget::init(void) { if (_owner==0) { if (_server!=0) { _bg=_server->defaultBackground(); _fg=_server->defaultForeground(); _fontID=_server->defaultFont(); } else { _bg=0; _fg=0; _fontID=0; } } else { _bg=_owner->background(); _fg=_owner->foreground(); _fontID=_owner->font(); } _window=0; _visible=MSFalse; _resizeConstraints=0; _sensitive=MSTrue; _readOnly=MSFalse; _acceptFocus=MSTrue; _acceptTab=MSFalse; _mapped=MSFalse; _dynamic=MSFalse; _firstMap=MSFalse; _freezeStatus=MSFalse; _eventMask=0; _eventHandler=0; _eventHandlerData=0; _eventOverride=0; } const MSString &MSWidget::instanceName(void) const { return _instanceName; } void MSWidget::instanceName(const MSString &instanceName_) { _instanceName=instanceName_; } MSString MSWidget::instanceFullname(void) const { MSString fullname(_instanceName); if (fullname.length()>0) { const MSWidget *pWidget=_owner; while (pWidget!=0) { if (pWidget->instanceName().length()>0) { fullname.insert("."); fullname.insert(pWidget->instanceName()); } pWidget=pWidget->_owner; } } return fullname; } // this method allows a help string to be obtained virtually // which can help greatly when dealing with windowless widgets // like table columns or graph traces const MSString& MSWidget::virtualHelpString(int,int) { return _helpString; } // the following 2 methods are used to support an application builder void MSWidget::eventHandler(long mask_,EventHandler eventHandler_,void *clientData_) { selectInput(mask_); _eventHandler=eventHandler_; _eventHandlerData=clientData_; } void MSWidget::eventOverride(EventOverride eventOverride_) { _eventOverride=eventOverride_; } // this will go away once RTTI is available, only a few widgets // will actually override this method const MSSymbol& MSWidget::widgetType(void) const { static const MSSymbol widgetSymbol("MSWidget"); return widgetSymbol; } const MSSymbol& MSWidget::parentWidgetType(void) const { return (_owner!=0)?_owner->widgetType():MSSymbol::nullSymbol(); } void MSWidget::selectInput(long eventMask_) { if (_window!=0&&eventMask_!=eventMask()) { eventMask(eventMask_); XSelectInput(display(),_window,eventMask()); } } void MSWidget::selectInput(void) { selectInput((long)NoEventMask); } void MSWidget::event(const XEvent *pEvent_) { if (!_eventOverride||!(*_eventOverride)(pEvent_->type)) switch (pEvent_->type) { case Expose: expose(pEvent_); break; case NoExpose: noExpose(pEvent_); break; case GraphicsExpose: graphicsExpose(pEvent_); break; case VisibilityNotify: visibilityNotify(pEvent_); break; case EnterNotify: if (_server->eventGrabbed(pEvent_,this)==MSTrue) enterNotify(pEvent_); break; case LeaveNotify: leaveNotify(pEvent_); break; case ConfigureNotify: configureNotify(pEvent_); break; case CreateNotify: createNotify(pEvent_); break; case DestroyNotify: destroyNotify(pEvent_); break; case ReparentNotify: reparentNotify(pEvent_); break; case MapNotify: mapNotify(pEvent_); break; case UnmapNotify: unmapNotify(pEvent_); break; case PropertyNotify: propertyNotify(pEvent_); break; case SelectionNotify: selectionNotify(pEvent_); break; case SelectionClear: selectionClear(pEvent_); break; case SelectionRequest: selectionRequest(pEvent_); break; case ClientMessage: clientMessage(pEvent_); break; case MotionNotify: if (_server->eventGrabbed(pEvent_,this)==MSTrue) motionNotify(pEvent_); break; case ButtonRelease: if (_server->eventGrabbed(pEvent_,this)==MSTrue) buttonRelease(pEvent_); break; case ButtonPress: if (_server->eventGrabbed(pEvent_,this)==MSTrue) buttonPress(pEvent_); else _server->bell(); break; case KeyRelease: if (_server->eventGrabbed(pEvent_,this)==MSTrue) keyRelease(pEvent_); break; case KeyPress: if (_server->eventGrabbed(pEvent_,this)==MSTrue) keyPressEvent(pEvent_); else _server->bell(); break; case FocusIn: focusInEventNotify(pEvent_); break; case FocusOut: focusOutEventNotify(pEvent_); break; default: break; } // this event handler is intended to support the mstk builder // i.e. it is easier to get events this way rather than // subclass every widget and override the event methods if (_eventHandler!=0) (*_eventHandler)(this,pEvent_,_eventHandlerData); } MSWidget *MSWidget::widget(Window window_) { MSWidget *pWidget=(MSWidget *)_server->widgetHashTable()->lookup(window_); return ((unsigned long)pWidget==_server->widgetHashTable()->notFound())?0:pWidget; } const MSWidget *MSWidget::widget(Window window_) const { MSWidget *pWidget=(MSWidget *)_server->widgetHashTable()->lookup(window_); return ((unsigned long)pWidget==_server->widgetHashTable()->notFound())?0:pWidget; } int MSWidget::offsetX(void) const { return 0; } int MSWidget::offsetY(void) const { return 0; } int MSWidget::rootX(void) const { int xx,yy; rootXY(xx,yy); return xx; } int MSWidget::rootY(void) const { int xx,yy; rootXY(xx,yy); return yy; } void MSWidget::rootXY(int& x_,int& y_) const { MSWidget *pWidget=(MSWidget *)this; int xx=0,yy=0; for (;pWidget!=0;pWidget=pWidget->_owner) { if (pWidget->_owner==0) { xx+=pWidget->offsetX(); yy+=pWidget->offsetY(); } xx+=pWidget->x_origin(); yy+=pWidget->y_origin(); } x_=xx; y_=yy; } void MSWidget::pointerXY(int& x_,int& y_) const { unsigned int keys; int ix=0,iy=0; int rx=0,ry=0; Window root,child; if (_window!=0) XQueryPointer(display(),_window,&root,&child,&rx,&ry,&ix,&iy,&keys); else XQueryPointer(display(),top()->_window,&root,&child,&rx,&ry,&ix,&iy,&keys); x_=rx; y_=ry; } MSWidget *MSWidget::top(void) { MSWidget *pTopWidget=(MSWidget *)this; while (pTopWidget->_owner!=0) pTopWidget=pTopWidget->_owner; return pTopWidget; } const MSWidget *MSWidget::top(void) const { MSWidget *pTopWidget=(MSWidget *)this; while (pTopWidget->_owner!=0) pTopWidget=pTopWidget->_owner; return pTopWidget; } void MSWidget::warpTo(int x_,int y_) { if (_window!=0) XWarpPointer(display(),_window,_window,0,0,0,0,x_,y_); } void MSWidget::moveTo(int x_,int y_) { if (x_origin()!=x_||y_origin()!=y_) { MSRect::x(x_); MSRect::y(y_); if (_window!=0) XMoveWindow(display(),_window,x_,y_); childMoveNotify(); } } void MSWidget::move(int dx_,int dy_) { moveTo(x_origin()+dx_,y_origin()+dy_); } void MSWidget::width(int w_) { if (width()!=w_) resize(w_,height()); } void MSWidget::height(int h_) { if (height()!=h_) resize(width(),h_); } void MSWidget::resize(int w_,int h_) { if (width()!=w_||height()!=h_) { if (w_<=0) w_=1; if (h_<=0) h_=1; if (w_>=USHRT_MAX) w_=width(); if (h_>=USHRT_MAX) h_=height(); if (w_>0) MSRect::width(w_); if (h_>0) MSRect::height(h_); if (_window!=0) XResizeWindow(display(),_window,width(),height()); configure(); childConfigureNotify(); } } void MSWidget::naturalSize(void) { computeSize(); } void MSWidget::sensitive(MSBoolean sensitive_) { if (sensitive()!=sensitive_) { _sensitive=sensitive_; updateSensitivity(); } } MSBoolean MSWidget::isProtected(void) const { return (readOnly()==MSTrue || sensitive()==MSFalse)?MSTrue:MSFalse;} void MSWidget::readOnly(MSBoolean readOnly_) { if(_readOnly != readOnly_) { _readOnly = readOnly_; updateReadOnly(); } } void MSWidget::freeze(void) { freezeStatus(MSTrue); } void MSWidget::unfreeze(void) { freezeStatus(MSFalse); } void MSWidget::backingStore(int backingStore_) { if (_window!=0) { XSetWindowAttributes attrs; attrs.backing_store=backingStore_; XChangeWindowAttributes(display(),_window,CWBackingStore,&attrs); } } void MSWidget::saveUnder(MSBoolean saveUnder_) { if (_window!=0) { XSetWindowAttributes attrs; attrs.save_under=saveUnder_; XChangeWindowAttributes(display(),_window,CWSaveUnder,&attrs); } } void MSWidget::overrideRedirect(MSBoolean redirect_) { if (_window!=0) { XSetWindowAttributes attrs; attrs.override_redirect=(int)redirect_; XChangeWindowAttributes(display(),_window,CWOverrideRedirect,&attrs); } } void MSWidget::resizeConstraints(const char *constraints_) { At a(0,0,1,1,resizeConstraints()); a.constraints(constraints_); resizeConstraints(a.constraints()); } void MSWidget::resizeConstraints(unsigned long constraints_) { if (constraints_!=resizeConstraints()) { _resizeConstraints=constraints_; childResizeConstraintsNotify(); } } At MSWidget::childPosition(MSWidget *pWidget_) { return At(0,0,1,1,pWidget_->resizeConstraints()); } void MSWidget::at(const At& at_) { if (_owner!=0) _owner->childPosition(this,at_); } At MSWidget::at(void) { if (_owner!=0) return _owner->childPosition(this); else return At(0,0,1,1,resizeConstraints()); } void MSWidget::firstMap(MSBoolean firstMap_) { if (firstMap()!=firstMap_) { _firstMap=firstMap_; if (firstMap()==MSTrue) firstMapNotify(); } } void MSWidget::map(void) { if (mapped()==MSFalse) { _mapped=MSTrue; if (firstMap()==MSFalse) firstMap(MSTrue); childMapNotify(); if (_window!=0) XMapWindow(display(),_window); MSWidget *p=_owner; MSBoolean unobscured=MSTrue; for (;p!=0;p=p->_owner) { if (p->mapped()==MSFalse) { unobscured=MSFalse; break; } } if (unobscured==MSTrue) visibilityUnobscured(); } } void MSWidget::unmap(void) { _mapped=MSFalse; if (_window!=0) XUnmapWindow(display(),_window); childUnmapNotify(); visibilityObscured(); } void MSWidget::show(void) { map(); } void MSWidget::hide(void) { unmap(); } void MSWidget::raise(void) { if (_window!=0) XRaiseWindow(display(),_window); } void MSWidget::lower(void) { if (_window!=0) XLowerWindow(display(),_window); } void MSWidget::clear(void) { if (_window!=0) XClearWindow(display(),_window); } void MSWidget::background(const char *pString_) { background(_server->pixel(pString_)); } void MSWidget::foreground(const char *pString_) { foreground(_server->pixel(pString_)); } void MSWidget::font(const char *pString_) { font(_server->fontID(pString_)); } void MSWidget::background(unsigned long pixel_) { if (pixel_!=background()) { unsigned long old=background(); _bg=pixel_; if (_window!=0) XSetWindowBackground(display(),_window,pixel_); updateBackground(old); } } void MSWidget::foreground(unsigned long pixel_) { if (pixel_!=foreground()) { unsigned long old=foreground(); _fg=pixel_; updateForeground(old); } } void MSWidget::font(Font font_) { if (font_!=font()) { Font old=font(); _fontID=font_; updateFont(old); } } void MSWidget::updateFont(Font) {} void MSWidget::updateForeground(unsigned long) {} void MSWidget::updateBackground(unsigned long) {} void MSWidget::updateSensitivity(void) {} void MSWidget::updateReadOnly(void) {} // if a window is reparented to another screen - i.e. different server, we will // have problems, widgets are storing fg,bg,fonts,and gcs which will not work // we need a generic reparent notification void MSWidget::reparent(MSWidget *owner_) { if (_owner!=owner_) { MSWidget *oldOwner=_owner; if (_window!=0) XReparentWindow(display(),_window, owner_->_window,x_origin(),y_origin()); _owner=owner_; _server=oldOwner->_server; if (oldOwner!=0) oldOwner->childRemove(this); if (_owner!=0) { _owner->childInsert(this); // If new owner's visibility is different than mine, // then I need to change my visibility accordingly. if (_owner->visible()!=visible()) { if (_owner->visible()==MSTrue) visibilityUnobscured(); else visibilityObscured(); } } if (oldOwner->_owner==0&&_owner->_owner==0) { MSWidget *pFocusWidget=oldOwner->inputFocus(); if (pFocusWidget!=0) _owner->traverseFocus(pFocusWidget); } } } Window MSWidget::parent(void) const { return (_owner==0)?_server->root():_owner->_window; } // Input focus routines // Only TopLevel Windows actually get Focus // focusWindow returns the top level window // which currently has focus as managed by // the window manager // this is the window where keyboard events get delivered to - // can either be a primitive or manager MSWidget *MSWidget::inputFocus(void) { return (MSWidget::focusWindow()!=0&&MSWidget::focusWindow()!=this)? MSWidget::focusWindow()->inputFocus():0; } const MSWidget *MSWidget::inputFocus(void) const { return (MSWidget::focusWindow()!=0&&MSWidget::focusWindow()!=this)? MSWidget::focusWindow()->inputFocus():0; } MSBoolean MSWidget::setFocus(MSWidget *pWidget_) { if (pWidget_->_owner!=0&&pWidget_->sensitive()==MSTrue&&pWidget_->acceptFocus()==MSTrue) { MSWidget *pTopWidget=pWidget_->top(); MSWidget::_focusWindow=pTopWidget; return pTopWidget->traverseFocus(pWidget_); } return MSFalse; } MSBoolean MSWidget::releaseFocus(void) { MSWidget *temp=MSWidget::focusWindow(); if (temp!=0) { if (temp->loseFocus()==MSTrue) { MSWidget::_focusWindow=0; return MSTrue; } else return MSFalse; } else return MSTrue; } MSBoolean MSWidget::traverseFocus(MSWidget *pWidget_) { if (pWidget_==inputFocus()) return MSTrue; else if (pWidget_!=0) { if (pWidget_->_owner==0) { pWidget_->warpTo(); return MSTrue; } else if (pWidget_->sensitive()==MSTrue&&pWidget_->acceptFocus()==MSTrue) { return setFocus(pWidget_); } } else if (pWidget_==0) return releaseFocus(); return MSFalse; } // if this widget is a topLevel widget (i.e. _owner==0 // then we will warp the cursor to the toplevel, which // let the window manager give it focus. otherwise, we // do a normal traversal - the topLevel widget that contains // this widget will actually do the traversal. MSBoolean MSWidget::obtainFocus(void) { if (_owner==0) { warpTo(); return MSTrue; } return traverseFocus(this); } MSBoolean MSWidget::traverseToNext(void) { MSWidget *pTopWidget=top(); return (pTopWidget!=0)?pTopWidget->traverseToNext():MSFalse; } MSBoolean MSWidget::traverseToPrevious(void) { MSWidget *pTopWidget=top(); return (pTopWidget!=0)?pTopWidget->traverseToPrevious():MSFalse; } void MSWidget::addToFocusList(void) { MSWidget *pTopWidget=top(); if (pTopWidget!=0) pTopWidget->addToFocusList(this); } void MSWidget::removeFromFocusList(void) { MSWidget *pTopWidget=top(); if (pTopWidget!=0) pTopWidget->removeFromFocusList(this); } MSBoolean MSWidget::isTraversable(void) const { if (mapped()==MSTrue&&sensitive()==MSTrue&&acceptFocus()==MSTrue) { // do not trust visible, because of server sync problems MSWidget *pWidget=(MSWidget *)_owner; for (;pWidget!=0;pWidget=pWidget->_owner) { if (pWidget->mapped()==MSFalse) return MSFalse; } return MSTrue; } return MSFalse; } MSBoolean MSWidget::isTraversable(MSWidget *pWidget_) const { if (pWidget_!=0) return pWidget_->isTraversable(); return MSFalse; } void MSWidget::expose(const XEvent *pEvent_) { if (pEvent_->xexpose.count==0) { XEvent aEvent; while (XCheckWindowEvent(display(),_window,ExposureMask,&aEvent)==True); redraw(); } } // compress motion Notify events XEvent *MSWidget::compressMotion(const XEvent *pEvent_) { XEvent nextEvent; XEvent *pEvent=(XEvent *)pEvent_; while (XPending(pEvent_->xmotion.display)) { XPeekEvent(pEvent_->xmotion.display,&nextEvent); if (nextEvent.type==MotionNotify&&pEvent_->xmotion.window==nextEvent.xmotion.window) { // replace the current event with the next one XNextEvent(pEvent_->xmotion.display,pEvent); } else break; } return pEvent; } void MSWidget::busyOn(void) { // use MSApplicationBusy } void MSWidget::busyOff(void) { // use MSApplicationBusy } void MSWidget::disownSelection(Atom selection_) { if (selection_==XA_PRIMARY) { if (server()->primarySelectionOwner()==this) { XSetSelectionOwner(display(),selection_,None,CurrentTime); server()->primarySelectionOwner(0); } } else XSetSelectionOwner(display(),selection_,None,CurrentTime); } MSStatus MSWidget::ownSelection(Atom selection_) { if (selection_==XA_PRIMARY) { if (server()->primarySelectionOwner()!=this) { //We need to actively notify the current primary owner if it happens to be a widget //within the same application. This is because the X Server does not send a //selectionClear if the current primary owner and the window that is trying //to acquire primary ownership are created by the same app. if (server()->primarySelectionOwner()!=0) { if ((unsigned long)(server()->widgetHashTable()->lookup(server()->primarySelectionOwner()->window()))!= server()->widgetHashTable()->notFound()) { selectionClearNotify(server()->primarySelectionOwner(),0); } } server()->primarySelectionOwner(0); XSetSelectionOwner(display(),selection_,_window,CurrentTime); Window win=XGetSelectionOwner(display(),selection_); if (window()==win) { server()->primarySelectionOwner(this); #ifdef MS_WINDOWS selectionRequest(0); #endif return MSSuccess; } else { #ifdef MS_WINDOWS selectionRequest(0); return MSSuccess; #else return MSFailure; #endif } } else { #ifdef MS_WINDOWS selectionRequest(0); #endif return MSSuccess; } } else { XSetSelectionOwner(display(),selection_,_window,CurrentTime); Window win=XGetSelectionOwner(display(),selection_); if (window()==win) return MSSuccess; else return MSFailure; } } MSStatus MSWidget::copyPrimary(const char *data_,int itemCount_) { if (ownSelection(XA_PRIMARY)==MSSuccess) { MSString aString(data_,itemCount_); _server->copyBuffer(aString); return MSSuccess; } return MSFailure; } void MSWidget::selectionRequest(const XEvent *pEvent_) { #ifndef MS_WINDOWS if (pEvent_->xselectionrequest.selection==XA_PRIMARY&& pEvent_->xselectionrequest.owner==_window) { Atom target=convertTarget(pEvent_->xselectionrequest.target); if (target==XA_STRING) { MSString buffer; int len=0; const char *cp = getPrimarySelection(buffer, len); if(cp !=0) { Atom property; if (pEvent_->xselectionrequest.property==None) property=XA_PRIMARY; else property=pEvent_->xselectionrequest.property; XChangeProperty(display(),pEvent_->xselectionrequest.requestor, property,target,propertyFormat(target), PropModeAppend,(unsigned const char *)cp,len); XSelectionEvent selectEvent; selectEvent.type=SelectionNotify; selectEvent.property=pEvent_->xselectionrequest.property; selectEvent.display=display(); selectEvent.requestor=pEvent_->xselectionrequest.requestor; selectEvent.selection=pEvent_->xselectionrequest.selection; selectEvent.target=pEvent_->xselectionrequest.target; selectEvent.time=pEvent_->xselectionrequest.time; XSendEvent(display(),pEvent_->xselectionrequest.requestor, False,0L,(XEvent *)&selectEvent); } } } #else MSString buffer; int len=0; const char *cp = getPrimarySelection(buffer, len); XStoreBytes(display(),cp,len); #endif } void MSWidget::selectionNotify(const XEvent *pEvent_) { #ifndef MS_WINDOWS if (pEvent_->xselection.selection==XA_PRIMARY&&pEvent_->xselection.requestor==_window&& pEvent_->xselection.property!=(Atom)None&&pEvent_->xselection.target!=(Atom)None) { if(propertyData(pEvent_->xselection.property,pEvent_->xselection.target) ==MSSuccess && server()->pasteBuffer().length()>0) { insertPrimarySelection(); } } #else insertPrimarySelection(); #endif } const char* MSWidget::getPrimarySelection(MSString& buffer_, int& len_) { buffer_= _server->copyBuffer(); len_=buffer_.length(); return buffer_.string(); } void MSWidget::insertPrimarySelection(void) { activateCallback(MSWidgetCallback::selectionnotify); } void MSWidget::selectionClear(const XEvent *) { _server->copyBuffer("Selection Cleared"); activateCallback(MSWidgetCallback::selectionclear); } void MSWidget::convertSelection(void) { #ifndef MS_WINDOWS XConvertSelection(display(),XA_PRIMARY,XA_STRING, _server->atom(MSAtomTable::MStk),_window,CurrentTime); #else int n; char *buffer=XFetchBytes(display(),&n); if(n!=0) { _server->pasteBuffer(buffer); XFree(buffer); } selectionNotify(0); #endif } MSStatus MSWidget::propertyData(Atom prop_,Atom target_) { MSStatus r=MSFailure; Atom actualTarget=target_; int actualFormat; int status; unsigned long itemCount; unsigned long bytesRemaining; unsigned char *data=0; status=XGetWindowProperty(display(),_window,prop_, 0L,MSDisplayServer::propertyFullLength(),True, convertTarget(actualTarget), &actualTarget,&actualFormat,&itemCount, &bytesRemaining,&data); if (status==Success) { propertyToString(actualTarget,(char *)data,(int)itemCount); r=MSSuccess; } if (data!=0) XFree((char *)data); return r; } Atom MSWidget::convertTarget(Atom target_) { Atom r=XA_STRING; if (target_==XA_INTEGER||target_==XA_WINDOW||target_==XA_ATOM) r=target_; else if (target_==_server->atom(MSAtomTable::Targets)) r=XA_ATOM; else if (target_==_server->atom(MSAtomTable::ClientWindow)) r=XA_WINDOW; else if (target_==_server->atom(MSAtomTable::TimeStamp)) r=XA_INTEGER; else if (target_==_server->atom(MSAtomTable::Length)) r=XA_INTEGER; else if (target_==_server->atom(MSAtomTable::CharacterPosition)) r=_server->atom(MSAtomTable::Span); return r; } int MSWidget::propertyFormat(Atom target_) { return (target_==XA_STRING)?8:32; } void MSWidget::propertyToString(Atom target_,char *data_,int itemCount_) { if (target_==XA_ATOM) atomsFromData(data_,itemCount_); else if (target_==XA_STRING) { MSString aString(data_,itemCount_); _server->pasteBuffer(aString); } } void MSWidget::atomsFromData(char *,int) {} void MSWidget::print(const char *) { redraw(); } void MSWidget::visibilityObscured(void) { visible(MSFalse); } void MSWidget::visibilityUnobscured(void) { visible(MSTrue); } void MSWidget::takeFocus(void) { focusIn(); } MSBoolean MSWidget::loseFocus(void) { return focusOut(),MSTrue; } void MSWidget::keyPress(const XEvent *pEvent_,KeySym keysym_,unsigned int state_,const char *) { MSKeyPress keyPress( keysym_,state_); keyTranslate(keyPress); } void MSWidget::keyRelease(const XEvent *pEvent_,KeySym,unsigned int,const char *) { keyRelease(pEvent_); } void MSWidget::childMapNotify(void) { if (_owner!=0) _owner->childMap(this); } void MSWidget::childUnmapNotify(void) { if (_owner!=0) _owner->childUnmap(this); } void MSWidget::childConfigureNotify(void) { if (_owner!=0) _owner->childConfigure(this); } void MSWidget::childMoveNotify(void) { if (_owner!=0) _owner->childMove(this); } void MSWidget::childResizeConstraintsNotify(void) { if (_owner!=0) _owner->childResizeConstraints(this); } void MSWidget::childDestroyNotify(void) { if (_owner!=0) _owner->childDestroy(this); } void MSWidget::childCreateNotify(void) { if (_owner!=0) _owner->childCreate(this); } void MSWidget::childInsertNotify(void) { if (_owner!=0) _owner->childInsert(this); } void MSWidget::childRemoveNotify(void) { if (_owner!=0) _owner->childRemove(this); } void MSWidget::focusInNotify(MSWidget *pWidget_) { if (pWidget_!=0) pWidget_->focusIn(); } void MSWidget::focusOutNotify(MSWidget *pWidget_) { if (pWidget_!=0) pWidget_->focusOut(); } void MSWidget::takeFocusNotify(MSWidget *pWidget_) { if (pWidget_!=0) pWidget_->takeFocus(); } MSBoolean MSWidget::loseFocusNotify(MSWidget *pWidget_) { return (pWidget_!=0)?pWidget_->loseFocus():MSFalse; } void MSWidget::selectionClearNotify(MSWidget *pWidget_,const XEvent *event_) { if (pWidget_!=0) pWidget_->selectionClear(event_);} void MSWidget::visibilityObscuredNotify(MSWidget *pWidget_) { if (pWidget_!=0) pWidget_->visibilityObscured(); } void MSWidget::visibilityUnobscuredNotify(MSWidget *pWidget_) { if (pWidget_!=0) pWidget_->visibilityUnobscured(); } void MSWidget::buttonMotionNotify(MSWidget *pWidget_,const XEvent *pEvent_) { if (pWidget_!=0) pWidget_->motionNotify(pEvent_); } void MSWidget::buttonPressNotify(MSWidget *pWidget_,const XEvent *pEvent_) { if (pEvent_->xbutton.button==Button1) pWidget_->button1Press(pEvent_); else if (pEvent_->xbutton.button==Button2) pWidget_->button2Press(pEvent_); else if (pEvent_->xbutton.button==Button3) pWidget_->button3Press(pEvent_); } void MSWidget::buttonReleaseNotify(MSWidget *pWidget_,const XEvent *pEvent_) { if (pEvent_->xbutton.button==Button1) pWidget_->button1Release(pEvent_); else if (pEvent_->xbutton.button==Button2) pWidget_->button2Release(pEvent_); else if (pEvent_->xbutton.button==Button3) pWidget_->button3Release(pEvent_); } void MSWidget::keyPressNotify(MSWidget *pWidget_,const XEvent *pEvent_, KeySym keysym_,unsigned int state_,const char *pString_) { if (pWidget_!=0) pWidget_->keyPress(pEvent_,keysym_,state_,pString_); } void MSWidget::keyReleaseNotify(MSWidget *pWidget_,const XEvent *pEvent_, KeySym keysym_,unsigned int state_,const char *pString_) { if (pWidget_!=0) pWidget_->keyRelease(pEvent_,keysym_,state_,pString_); } void MSWidget::keyTranslateNotify(MSWidget *pWidget_,const XEvent *pEvent_, KeySym keysym_,unsigned int state_,const char *pString_) { MSKeyPress keyPress(keysym_,state_); if (pWidget_!=0) { if ( pWidget_->keyTranslate(keyPress) == MSTrue); else keyPressNotify(pWidget_,pEvent_,keysym_,state_,pString_); } } void MSWidget::keyPressEvent(const XEvent *pEvent_) { char buf[16]; KeySym keysym; int len=XLookupString((XKeyEvent *)pEvent_,buf,8,&keysym,NULL); buf[len]='\0'; #ifdef MS_KEYPAD_BUG server()->correctKeypadKeys(pEvent_,keysym,pEvent_->xkey.state,buf); #endif keyPress(pEvent_,keysym,pEvent_->xkey.state,buf); } MSBoolean MSWidget::keyTranslate(const MSKeyPress& keyPress_) { return keyTranslationTable()->translate(keyPress_,this); } MSCallback *MSWidget::callback(const MSSymbol& name_) { return MSCallbackBehavior::callback(name_); } void MSWidget::callback(const MSSymbol& name_,MSCallback *callback_) { MSCallbackBehavior::callback(name_,callback_); } void MSWidget::callback(const MSSymbol& name_,MSWidgetCallbackFunction function_,void *clientData_) { MSCallbackBehavior::callback(name_,new MSDefaultCallback(this,function_,clientData_)); } MSBoolean MSWidget::activateCallback(const MSSymbol& name_) { return MSCallbackBehavior::activateCallback(name_);} MSBoolean MSWidget::activateCallback(MSWidget *pWidget_,const MSSymbol& name_) { return (pWidget_!=0)?pWidget_->activateCallback(name_):MSFalse; } //############################################################################################# // set and get methods to support the application builder void MSWidget::set(MSAttrValueList& avList_) { MSIndexVector index; for (unsigned i=0;icolorName(foreground()),MSAttrValue::Color); avList_<colorName(background()),MSAttrValue::Color); avList_<fontName(font()),MSAttrValue::Font); avList_<depthFirstIteration(iterator_)==MSFalse) return MSFalse; } return (iterator_.applyTo(this)); } MSBoolean MSWidget::breadthFirstIteration(MSWidgetVector &aWidgetVector_, MSWidgetIterator &iterator_) { unsigned i,len=aWidgetVector_.length(); for (i=0;ichildren(); breadthVector.append(vector); } if (breadthVector.length()) return (breadthFirstIteration(breadthVector,iterator_)); else return MSTrue; } void MSWidget::acceptFocus(MSBoolean b_) { _acceptFocus=b_; } void MSWidget::dynamic(MSBoolean b_) { _dynamic=b_; } void MSWidget::acceptTab(MSBoolean b_) { _acceptTab=b_; } void MSWidget::freezeStatus(MSBoolean b_) { _freezeStatus=b_; } void MSWidget::visible(MSBoolean b_) { _visible=b_; } void MSWidget::eventMask(long eventMask_) { _eventMask=eventMask_; } void MSWidget::focusWindow(MSWidget *widget_) { _focusWindow=widget_; } const MSString& MSWidget::helpString(void) const { return _helpString; } void MSWidget::helpString(const MSString& aString_) { _helpString=aString_; } void MSWidget::childPosition(MSWidget *pWidget_,const At& at_) { pWidget_->resizeConstraints(at_.constraints()); } // ######################################################### // default virtual methods - prevents gratuitous inlining // ######################################################### void MSWidget::redraw(void) {} void MSWidget::computeSize(void) {} void MSWidget::decoupleWidget(void) {} void MSWidget::addToFocusList(MSWidget *) {} void MSWidget::removeFromFocusList(MSWidget *) {} void MSWidget::noExpose(const XEvent *) {} void MSWidget::graphicsExpose(const XEvent *) {} void MSWidget::visibilityNotify(const XEvent *) {} void MSWidget::keyRelease(const XEvent *) {} void MSWidget::buttonPress(const XEvent *pEvent_) { buttonPressNotify(this,pEvent_); } void MSWidget::buttonRelease(const XEvent *pEvent_) { buttonReleaseNotify(this,pEvent_); } void MSWidget::motionNotify(const XEvent *) {} void MSWidget::mapNotify(const XEvent *) {} void MSWidget::unmapNotify(const XEvent *) {} void MSWidget::configureNotify(const XEvent *) {} void MSWidget::createNotify(const XEvent *) {} void MSWidget::destroyNotify(const XEvent *) {} void MSWidget::enterNotify(const XEvent *) {} void MSWidget::leaveNotify(const XEvent *) {} void MSWidget::focusInEventNotify(const XEvent *) {} void MSWidget::focusOutEventNotify(const XEvent *) {} void MSWidget::reparentNotify(const XEvent *) {} void MSWidget::propertyNotify(const XEvent *) {} void MSWidget::clientMessage(const XEvent *) {} void MSWidget::errorEvent(const XEvent *) {} void MSWidget::configure(void) {} void MSWidget::firstMapNotify(void) {} void MSWidget::enter(void) {} void MSWidget::leave(void) {} void MSWidget::focusIn(void) {} void MSWidget::focusOut(void) {} void MSWidget::button1Press(const XEvent *) {} void MSWidget::button2Press(const XEvent *) {} void MSWidget::button3Press(const XEvent *) {} void MSWidget::button1Release(const XEvent *) {} void MSWidget::button2Release(const XEvent *) {} void MSWidget::button3Release(const XEvent *) {} void MSWidget::key(KeySym,unsigned int,const char *) {} void MSWidget::childMap(MSWidget *) {} void MSWidget::childUnmap(MSWidget *) {} void MSWidget::childConfigure(MSWidget *) {} void MSWidget::childMove(MSWidget *) {} void MSWidget::childResizeConstraints(MSWidget *) {} void MSWidget::childDestroy(MSWidget *) {} void MSWidget::childCreate(MSWidget *) {} void MSWidget::childInsert(MSWidget *) {} void MSWidget::childRemove(MSWidget *) {} aplus-fsf-4.22/src/MSGUI/MSWidgetCallback.C0000644000265000001440000001073210772770416013713 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include MSSymbol MSWidgetCallback::activate("activate"); MSSymbol MSWidgetCallback::arm("arm"); MSSymbol MSWidgetCallback::disarm("disarm"); MSSymbol MSWidgetCallback::reference("reference"); MSSymbol MSWidgetCallback::valuechange("valuechange"); MSSymbol MSWidgetCallback::save("save"); MSSymbol MSWidgetCallback::quit("quit"); MSSymbol MSWidgetCallback::destroy("destroy"); MSSymbol MSWidgetCallback::dismiss("dismiss"); MSSymbol MSWidgetCallback::deleterow("deleterow"); MSSymbol MSWidgetCallback::saveyourself("saveyourself"); MSSymbol MSWidgetCallback::selectionnotify("selectionnotify"); MSSymbol MSWidgetCallback::selectionclear("selectionclear"); MSSymbol MSWidgetCallback::selection("selection"); MSSymbol MSWidgetCallback::rowselection("rowselection"); MSSymbol MSWidgetCallback::columnselection("columnselection"); MSSymbol MSWidgetCallback::columnresize("columnresize"); MSSymbol MSWidgetCallback::delimiterchange("delimiterchange"); MSSymbol MSWidgetCallback::delimiterselection("delimiterselection"); MSSymbol MSWidgetCallback::permutecolumns("permutecolumns"); MSSymbol MSWidgetCallback::labelselection("labelselection"); MSSymbol MSWidgetCallback::insertbelow("insertbelow"); MSSymbol MSWidgetCallback::insertabove("insertabove"); MSSymbol MSWidgetCallback::tracereference("tracereference"); MSSymbol MSWidgetCallback::traceptreference("traceptreference"); MSSymbol MSWidgetCallback::graphzoom("graphzoom"); MSSymbol MSWidgetCallback::graphreference("graphreference"); MSSymbol MSWidgetCallback::addtrace("addtrace"); MSSymbol MSWidgetCallback::copytrace("copytrace"); MSSymbol MSWidgetCallback::addtexttrace("addtexttrace"); MSSymbol MSWidgetCallback::copytexttrace("copytexttrace"); MSSymbol MSWidgetCallback::deletetrace("deletetrace"); MSSymbol MSWidgetCallback::firstcolumnchange("firstcolumnchange"); MSSymbol MSWidgetCallback::firstrowchange("firstrowchange"); MSSymbol MSWidgetCallback::pagechange("pagechange"); MSSymbol MSWidgetCallback::doubleclick("doubleclick"); MSSymbol MSWidgetCallback::increment("increment"); MSSymbol MSWidgetCallback::decrement("decrement"); MSSymbol MSWidgetCallback::pagedecrement("pagedecrement"); MSSymbol MSWidgetCallback::pageincrement("pageincrement"); MSSymbol MSWidgetCallback::takefocus("takefocus"); MSSymbol MSWidgetCallback::rowmoved("rowmoved"); MSSymbol MSWidgetCallback::drag("drag"); MSSymbol MSWidgetCallback::subtreecollapsed("subtreecollapsed"); MSSymbol MSWidgetCallback::subtreeexpanded("subtreeexpanded"); MSSymbol MSWidgetCallback::button2selection("button2selection"); MSSymbol MSWidgetCallback::button3selection("button3selection"); MSSymbol MSWidgetCallback::directorychange("directorychange"); MSSymbol MSWidgetCallback::fileselection("fileselection"); MSSymbol MSWidgetCallback::childresize("childresize"); MSSymbol MSWidgetCallback::home("home"); MSSymbol MSWidgetCallback::end("end"); MSSymbol MSWidgetCallback::yes("yes"); MSSymbol MSWidgetCallback::no("no"); MSSymbol MSWidgetCallback::ok("ok"); MSSymbol MSWidgetCallback::cancel("cancel"); MSSymbol MSWidgetCallback::help("help"); MSSymbol MSWidgetCallback::close("close"); MSSymbol MSWidgetCallback::apply("apply"); MSSymbol MSWidgetCallback::iconized("iconized"); MSSymbol MSWidgetCallback::deiconized("deiconized"); MSSymbol MSWidgetCallback::incurrentworkspace("incurrentworkspace"); MSSymbol MSWidgetCallback::outofcurrentworkspace("outofcurrentworkspace"); MSSymbol MSWidgetCallback::workspacepresencechange("workspacepresencechange"); MSSymbol MSWidgetCallback::buttonactivate("buttonactivate"); MSSymbol MSWidgetCallback::menubutton("menubutton"); MSSymbol MSWidgetCallback::columnmenubutton("columnmenubutton"); MSSymbol MSWidgetCallback::editbegin("editbegin"); MSSymbol MSWidgetCallback::editend("editend"); MSSymbol MSWidgetCallback::menushow("menushow"); MSSymbol MSWidgetCallback::f1("f1"); MSSymbol MSWidgetCallback::f2("f2"); MSSymbol MSWidgetCallback::f3("f3"); MSSymbol MSWidgetCallback::f4("f4"); MSSymbol MSWidgetCallback::f5("f5"); MSSymbol MSWidgetCallback::f6("f6"); MSSymbol MSWidgetCallback::f7("f7"); MSSymbol MSWidgetCallback::f8("f8"); MSSymbol MSWidgetCallback::f9("f9"); MSSymbol MSWidgetCallback::f10("f10"); MSSymbol MSWidgetCallback::f11("f11"); MSSymbol MSWidgetCallback::f12("f12"); aplus-fsf-4.22/src/MSGUI/MSWidgetCommon.C0000644000265000001440000001102110772770416013437 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #ifdef MS_NO_INLINES #include #endif extern MSBoolean applicationBackingStoreOption(void); MSWidgetCommon::MSWidgetCommon(void) { init(); } MSWidgetCommon::MSWidgetCommon(MSDisplayServer *server_) : MSWidgetView(server_) { init(); } MSWidgetCommon::MSWidgetCommon(MSWidget *owner_,const char *title_) : _title(title_), MSWidgetView(owner_) { init(); } MSWidgetCommon::MSWidgetCommon(MSWidget *owner_,const MSStringVector& title_) : _title(title_), MSWidgetView(owner_) { init(); } MSWidgetCommon::~MSWidgetCommon() {} void MSWidgetCommon::init(void) { _titleAlignment=MSCenter|MSBottom; create(); if (owner()==0) { _titleFg=server()->defaultForeground(); _titleFont=server()->defaultFont(); } else { _titleFg=owner()->foreground(); _titleFont=owner()->font(); } } void MSWidgetCommon::create(void) { XSetWindowAttributes attributes; attributes.background_pixel=background(); attributes.border_pixel=foreground(); attributes.event_mask=ExposureMask; attributes.backing_store= (owner()==0)?NotUseful:((applicationBackingStoreOption()==MSTrue)?WhenMapped:NotUseful); _eventMask=ExposureMask; _window=(Window)XCreateWindow(display(), (owner()==0)?server()->root():owner()->window(), MSRect::x(),MSRect::y(),MSRect::width(),MSRect::height(), MSDefaultBorderWidth, (int)CopyFromParent,InputOutput,CopyFromParent, (unsigned long)(CWBackPixel|CWBorderPixel|CWBackingStore|CWEventMask), (XSetWindowAttributes *)&attributes); server()->widgetHashTable()->add(window(),this); childCreateNotify(); } void MSWidgetCommon::title(const char *title_) { _title=title_; updateTitle(); } void MSWidgetCommon::title(const MSStringVector& title_) { if (title()!=title_) { _title=title_; updateTitle(); } } void MSWidgetCommon::titleForeground(const char *fg_) { titleForeground(server()->pixel(fg_)); } void MSWidgetCommon::titleForeground(unsigned long fg_) { if (titleForeground()!=fg_) { _titleFg=fg_; updateTitle(); } } void MSWidgetCommon::titleFont(const char *fid_) { titleFont(server()->fontID(fid_)); } void MSWidgetCommon::titleFont(Font fid_) { if (titleFont()!=fid_) { _titleFont=fid_; updateTitle(); } } void MSWidgetCommon::titleAlignment(unsigned long alignment_) { if (titleAlignment()!=alignment_) { _titleAlignment=alignment_; updateTitle(); } } //############################################################################################# // set and get methods to support the application builder void MSWidgetCommon::set(MSAttrValueList& avList_) { MSWidgetView::set(avList_); MSIndexVector index; for (unsigned i=0;icolorName(titleForeground()),MSAttrValue::Color); avList_<fontName(titleFont()),MSAttrValue::Font); avList_< #ifndef MSWidgetHEADER #include #endif MSWidgetCursor::MSWidgetCursor(MSWidget *pWidget_,MSWidgetIterationType type_) { _index=0; if (pWidget_!=0) { if (type_==MSBreadthFirst) { MSWidgetVector vector(pWidget_); buildBreadthFirst(vector); } else buildDepthFirst(pWidget_); } } void MSWidgetCursor::buildBreadthFirst(MSWidgetVector &aWidgetVector_) { unsigned i,len=aWidgetVector_.length(); vector().append(aWidgetVector_); MSWidgetVector breadthVector; for (i=0;ichildren()); if (breadthVector.length()>0) buildBreadthFirst(breadthVector); } void MSWidgetCursor::buildDepthFirst(MSWidget *pWidget_) { MSWidgetVector childVector(pWidget_->children()); unsigned len=childVector.length(); for (unsigned i=0;i0) return MSTrue; else return MSFalse; } MSBoolean MSWidgetCursor::setToLast(void) { if (vector().length()>0) { _index=vector().length()-1; return MSTrue; } else { invalidate(); return MSFalse; } } MSBoolean MSWidgetCursor::setToNext(void) { if (++_index #include MSWidgetFreezer::MSWidgetFreezer(MSWidget *widget_): _widget(widget_) { if(widget_ != 0){ _wasFrozen = _widget->frozen(); _widget->freeze(); } } MSWidgetFreezer::~MSWidgetFreezer(void) { if (_widget != 0 && _wasFrozen == MSFalse) _widget->unfreeze(); } aplus-fsf-4.22/src/MSGUI/MSWidgetIterator.C0000644000265000001440000000064510772770416014012 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include MSWidgetIterator::MSWidgetIterator(void) {} MSWidgetIterator::~MSWidgetIterator(void) {} aplus-fsf-4.22/src/MSGUI/MSWidgetOutput.C0000644000265000001440000011022210772770417013513 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #ifdef MS_NO_INLINES #include #endif MSWidgetOutput::DisplayPrint MSWidgetOutput::_displayPrint; MSWidgetOutput::OutputMode MSWidgetOutput::_outputMode=Draw; MSWidgetOutput::MSWidgetOutput(void) : _shadow(this) { init(); initColors(); } MSWidgetOutput::MSWidgetOutput(MSDisplayServer *server_) : MSWidget(server_), _shadow(this) { init(); // do not call initColors() if server_==0 because we may not // be connected to a Display Server - i.e. a ReportTable // running in batch mode. if (server_!=0) initColors(); } MSWidgetOutput::MSWidgetOutput(MSWidget *owner_) : MSWidget(owner_), _shadow(this) { init(); initColors(); } MSWidgetOutput::~MSWidgetOutput(void) {} void MSWidgetOutput::outputMode(MSWidgetOutput::OutputMode mode_) { if (mode_==Print&&displayPrintMode()==MSP::PPM) _outputMode=DrawPPM; else _outputMode=mode_; } MSWidgetOutput::DisplayPrint::DisplayPrint(void) { _displayPrint=0; } MSWidgetOutput::DisplayPrint::~DisplayPrint(void) { if (_displayPrint!=0) delete _displayPrint; } MSDisplayPrint *MSWidgetOutput::displayPrint(void) { if (_displayPrint._displayPrint==0) _displayPrint._displayPrint=new MSDisplayPrint; return _displayPrint._displayPrint; } void MSWidgetOutput::XDrawArc(Display *dpy_,Window id_,GC gc_, int x_,int y_,int w_,int h_,int angle1_,int angle2_) { if (_outputMode==Draw) ::XDrawArc(dpy_,id_,gc_,x_,y_,w_,h_,angle1_,angle2_); else if (displayPrintMode()==MSP::PPM) { int x=x_+_displayPrint._displayPrint->x_org(); int y=y_+_displayPrint._displayPrint->y_org(); ::XDrawArc(dpy_,displayPrintPixmap(),gc_,x,y,w_,h_,angle1_,angle2_); } else _displayPrint._displayPrint->printArc(gc_,x_,y_,w_,h_,angle1_,angle2_); } void MSWidgetOutput::XDrawArcs(Display *dpy_,Window id_,GC gc_,XArc *arcs_,int n_) { if (_outputMode==Draw) ::XDrawArcs(dpy_,id_,gc_,arcs_,n_); else if (displayPrintMode()==MSP::PPM) { XArc *arcs=new XArc[n_]; for (unsigned i=0;ix_org(); arcs[i].y+=_displayPrint._displayPrint->y_org(); } ::XDrawArcs(dpy_,displayPrintPixmap(),gc_,arcs,n_); delete [] arcs; } else _displayPrint._displayPrint->printArcs(gc_,arcs_,n_); } void MSWidgetOutput::XDrawLine(Display *dpy_,Window id_,GC gc_, int x1_,int y1_,int x2_,int y2_) { if (_outputMode==Draw) ::XDrawLine(dpy_,id_,gc_,x1_,y1_,x2_,y2_); else if (displayPrintMode()==MSP::PPM) { int x1=x1_+_displayPrint._displayPrint->x_org(); int y1=y1_+_displayPrint._displayPrint->y_org(); int x2=x2_+_displayPrint._displayPrint->x_org(); int y2=y2_+_displayPrint._displayPrint->y_org(); ::XDrawLine(dpy_,displayPrintPixmap(),gc_,x1,y1,x2,y2); } else _displayPrint._displayPrint->printLine(gc_,x1_,y1_,x2_,y2_); } void MSWidgetOutput::XDrawLines(Display *dpy_,Window id_,GC gc_, XPoint *points_,int n_,int mode_) { if (_outputMode==Draw) ::XDrawLines(dpy_,id_,gc_,points_,n_,mode_); else if (displayPrintMode()==MSP::PPM) { XPoint *points=new XPoint[n_]; for (unsigned i=0;ix_org(); points[i].y=points_[i].y+_displayPrint._displayPrint->y_org(); } ::XDrawLines(dpy_,displayPrintPixmap(),gc_,points,n_,mode_); delete [] points; } else _displayPrint._displayPrint->printLines(gc_,points_,n_,mode_); } void MSWidgetOutput::XDrawSegments(Display *dpy_,Window id_,GC gc_, XSegment *segments_,int n_) { if (_outputMode==Draw) ::XDrawSegments(dpy_,id_,gc_,segments_,n_); else if (displayPrintMode()==MSP::PPM) { XSegment *segments=new XSegment[n_]; for (unsigned i=0;ix_org(); segments[i].y1=segments_[i].y1+_displayPrint._displayPrint->y_org(); segments[i].x2=segments_[i].x2+_displayPrint._displayPrint->x_org(); segments[i].y2=segments_[i].y2+_displayPrint._displayPrint->y_org(); } ::XDrawSegments(dpy_,displayPrintPixmap(),gc_,segments,n_); delete [] segments; } else _displayPrint._displayPrint->printSegments(gc_,segments_,n_); } void MSWidgetOutput::XDrawPoint(Display *dpy_,Window id_,GC gc_,int x_,int y_) { if (_outputMode==Draw) ::XDrawPoint(dpy_,id_,gc_,x_,y_); else if (displayPrintMode()==MSP::PPM) { int x=x_+_displayPrint._displayPrint->x_org(); int y=y_+_displayPrint._displayPrint->y_org(); ::XDrawPoint(dpy_,displayPrintPixmap(),gc_,x,y); } else _displayPrint._displayPrint->printPoint(gc_,x_,y_); } void MSWidgetOutput::XDrawPoints(Display *dpy_,Window id_,GC gc_, XPoint *points_,int n_,int mode_) { if (_outputMode==Draw) ::XDrawPoints(dpy_,id_,gc_,points_,n_,mode_); else if (displayPrintMode()==MSP::PPM) { XPoint *points=new XPoint[n_]; for (unsigned i=0;ix_org(); points[i].y=points_[i].y+_displayPrint._displayPrint->y_org(); } ::XDrawPoints(dpy_,displayPrintPixmap(),gc_,points,n_,mode_); delete [] points; } else _displayPrint._displayPrint->printPoints(gc_,points_,n_,mode_); } void MSWidgetOutput::XDrawRectangle(Display *dpy_,Window id_,GC gc_, int x_,int y_,int w_,int h_) { if (_outputMode==Draw) ::XDrawRectangle(dpy_,id_,gc_,x_,y_,w_,h_); else if (displayPrintMode()==MSP::PPM) { int x=x_+_displayPrint._displayPrint->x_org(); int y=y_+_displayPrint._displayPrint->y_org(); ::XDrawRectangle(dpy_,displayPrintPixmap(),gc_,x,y,w_,h_); } else _displayPrint._displayPrint->printRectangle(gc_,x_,y_,w_,h_); } void MSWidgetOutput::XDrawRectangles(Display *dpy_,Window id_,GC gc_,XRectangle *rects_,int n_) { if (_outputMode==Draw) ::XDrawRectangles(dpy_,id_,gc_,rects_,n_); else if (displayPrintMode()==MSP::PPM) { XRectangle *rects=new XRectangle[n_]; for (unsigned i=0;ix_org(); rects[i].y+=_displayPrint._displayPrint->y_org(); } ::XDrawRectangles(dpy_,displayPrintPixmap(),gc_,rects,n_); delete [] rects; } else _displayPrint._displayPrint->printRectangles(gc_,rects_,n_); } void MSWidgetOutput::XDrawString(Display *dpy_,Window id_,GC gc_, const XFontStruct *fs_, int x_,int y_,const char *string_,int n_) { if (_outputMode==Draw) { if (doubleByte (fs_)) ::XDrawString16(dpy_,id_,gc_,x_,y_,(XChar2b*)string_,n_/2); else ::XDrawString(dpy_,id_,gc_,x_,y_,string_,n_); } else if (displayPrintMode()==MSP::PPM) { int x=x_+_displayPrint._displayPrint->x_org(); int y=y_+_displayPrint._displayPrint->y_org(); if (doubleByte (fs_)) ::XDrawString16(dpy_,displayPrintPixmap(),gc_,x,y,(XChar2b*)string_,n_/2); else ::XDrawString(dpy_,displayPrintPixmap(),gc_,x,y,string_,n_); } else _displayPrint._displayPrint->printString(gc_,x_,y_,string_,n_); } void MSWidgetOutput::XDrawImageString(Display *dpy_,Window id_,GC gc_, const XFontStruct *fs_, int x_,int y_, const char *string_,int n_) { if (_outputMode==Draw) { if (doubleByte (fs_)) ::XDrawImageString16(dpy_,id_,gc_,x_,y_,(XChar2b*)string_,n_/2); else ::XDrawImageString(dpy_,id_,gc_,x_,y_,string_,n_); } else if (displayPrintMode()==MSP::PPM) { int x=x_+_displayPrint._displayPrint->x_org(); int y=y_+_displayPrint._displayPrint->y_org(); if (doubleByte (fs_)) ::XDrawImageString16(dpy_,displayPrintPixmap(),gc_,x,y,(XChar2b*)string_,n_/2); else ::XDrawImageString(dpy_,displayPrintPixmap(),gc_,x,y,string_,n_); } else _displayPrint._displayPrint->printImageString(gc_,x_,y_,string_,n_); } void MSWidgetOutput::XFillArc(Display *dpy_,Window id_,GC gc_, int x_,int y_,int w_,int h_,int angle1_,int angle2_) { if (_outputMode==Draw) ::XFillArc(dpy_,id_,gc_,x_,y_,w_,h_,angle1_,angle2_); else if (displayPrintMode()==MSP::PPM) { int x=x_+_displayPrint._displayPrint->x_org(); int y=y_+_displayPrint._displayPrint->y_org(); ::XFillArc(dpy_,displayPrintPixmap(),gc_,x,y,w_,h_,angle1_,angle2_); } else _displayPrint._displayPrint->printFillArc(gc_,x_,y_,w_,h_,angle1_,angle2_); } void MSWidgetOutput::XFillArcs(Display *dpy_,Window id_,GC gc_,XArc *arcs_,int n_) { if (_outputMode==Draw) ::XFillArcs(dpy_,id_,gc_,arcs_,n_); else if (displayPrintMode()==MSP::PPM) { XArc *arcs=new XArc[n_]; for (unsigned i=0;ix_org(); arcs[i].y+=_displayPrint._displayPrint->y_org(); } ::XFillArcs(dpy_,displayPrintPixmap(),gc_,arcs,n_); delete [] arcs; } else _displayPrint._displayPrint->printFillArcs(gc_,arcs_,n_); } void MSWidgetOutput::XFillPolygon(Display *dpy_,Window id_,GC gc_, XPoint *points_,int n_,int shape_,int mode_) { if (_outputMode==Draw) ::XFillPolygon(dpy_,id_,gc_,points_,n_,shape_,mode_); else if (displayPrintMode()==MSP::PPM) { XPoint *points=new XPoint[n_]; for (unsigned i=0;ix_org(); points[i].y=points_[i].y+_displayPrint._displayPrint->y_org(); } ::XFillPolygon(dpy_,displayPrintPixmap(),gc_,points,n_,shape_,mode_); delete [] points; } else _displayPrint._displayPrint->printFillPolygon(gc_,points_,n_,shape_,mode_); } void MSWidgetOutput::XFillRectangle(Display *dpy_,Window id_,GC gc_, int x_,int y_,int w_,int h_) { if (_outputMode==Draw) ::XFillRectangle(dpy_,id_,gc_,x_,y_,w_,h_); else if (displayPrintMode()==MSP::PPM) { int x=x_+_displayPrint._displayPrint->x_org(); int y=y_+_displayPrint._displayPrint->y_org(); ::XFillRectangle(dpy_,displayPrintPixmap(),gc_,x,y,w_,h_); } else _displayPrint._displayPrint->printFillRectangle(gc_,x_,y_,w_,h_); } void MSWidgetOutput::XFillRectangles(Display *dpy_,Window id_,GC gc_, XRectangle *rects_,int n_) { if (_outputMode==Draw) ::XFillRectangles(dpy_,id_,gc_,rects_,n_); else if (displayPrintMode()==MSP::PPM) { XRectangle *rects=new XRectangle[n_]; for (unsigned i=0;ix_org(); rects[i].y+=_displayPrint._displayPrint->y_org(); } ::XFillRectangles(dpy_,displayPrintPixmap(),gc_,rects,n_); delete [] rects; } else _displayPrint._displayPrint->printFillRectangles(gc_,rects_,n_); } void MSWidgetOutput::XBFillPolygon(Display *dpy_,Window id_,GC gc_, XPoint *points_,int n_,int shape_,int mode_) { if (_outputMode==Draw) ::XFillPolygon(dpy_,id_,gc_,points_,n_,shape_,mode_); else if (displayPrintMode()==MSP::PPM) { XPoint *points=new XPoint[n_]; for (unsigned i=0;ix_org(); points[i].y=points_[i].y+_displayPrint._displayPrint->y_org(); } ::XFillPolygon(dpy_,displayPrintPixmap(),gc_,points,n_,shape_,mode_); delete [] points; } else _displayPrint._displayPrint->printFillPolygon(gc_,points_,n_,shape_,mode_,MSTrue); } void MSWidgetOutput::XBFillRectangle(Display *dpy_,Window id_,GC gc_, int x_,int y_,int w_,int h_) { if (_outputMode==Draw) ::XFillRectangle(dpy_,id_,gc_,x_,y_,w_,h_); else if (displayPrintMode()==MSP::PPM) { int x=x_+_displayPrint._displayPrint->x_org(); int y=y_+_displayPrint._displayPrint->y_org(); ::XFillRectangle(dpy_,displayPrintPixmap(),gc_,x,y,w_,h_); } else _displayPrint._displayPrint->printFillRectangle(gc_,x_,y_,w_,h_,MSTrue); } void MSWidgetOutput::XBFillRectangles(Display *dpy_,Window id_,GC gc_, XRectangle *rects_,int n_) { if (_outputMode==Draw) ::XFillRectangles(dpy_,id_,gc_,rects_,n_); else if (displayPrintMode()==MSP::PPM) { XRectangle *rects=new XRectangle[n_]; for (unsigned i=0;ix_org(); rects[i].y+=_displayPrint._displayPrint->y_org(); } ::XFillRectangles(dpy_,displayPrintPixmap(),gc_,rects,n_); delete [] rects; } else _displayPrint._displayPrint->printFillRectangles(gc_,rects_,n_,MSTrue); } void MSWidgetOutput::PFillPolygon(Display *dpy_,Window id_,GC gc_, XPoint *points_,int n_,int shape_,int mode_) { if (_outputMode==Draw) ::XFillPolygon(dpy_,id_,gc_,points_,n_,shape_,mode_); else if (displayPrintMode()==MSP::PPM) { XPoint *points=new XPoint[n_]; for (unsigned i=0;ix_org(); points[i].y=points_[i].y+_displayPrint._displayPrint->y_org(); } ::XFillPolygon(dpy_,displayPrintPixmap(),gc_,points,n_,shape_,mode_); delete [] points; } else _displayPrint._displayPrint->printFillPolygon(gc_,points_,n_,shape_,mode_,MSTrue); } void MSWidgetOutput::PFillRectangle(Display *dpy_,Window id_,GC gc_, int x_,int y_,int w_,int h_) { if (_outputMode==Draw) ::XFillRectangle(dpy_,id_,gc_,x_,y_,w_,h_); else if (displayPrintMode()==MSP::PPM) { int x=x_+_displayPrint._displayPrint->x_org(); int y=y_+_displayPrint._displayPrint->y_org(); ::XFillRectangle(dpy_,displayPrintPixmap(),gc_,x,y,w_,h_); } else _displayPrint._displayPrint->printFillRectangle(gc_,x_,y_,w_,h_,MSTrue); } void MSWidgetOutput::PFillRectangles(Display *dpy_,Window id_,GC gc_, XRectangle *rects_,int n_) { if (_outputMode==Draw) ::XFillRectangles(dpy_,id_,gc_,rects_,n_); else if (displayPrintMode()==MSP::PPM) { XRectangle *rects=new XRectangle[n_]; for (unsigned i=0;ix_org(); rects[i].y+=_displayPrint._displayPrint->y_org(); } ::XFillRectangles(dpy_,displayPrintPixmap(),gc_,rects,n_); delete [] rects; } else _displayPrint._displayPrint->printFillRectangles(gc_,rects_,n_,MSTrue); } void MSWidgetOutput::XCopyArea(Display *dpy_,Window src_,Window dest_,GC gc_, int x_src_,int y_src_,int w_,int h_,int x_dest_,int y_dest_) { if (_outputMode==Draw) ::XCopyArea(dpy_,src_,dest_,gc_,x_src_,y_src_,w_,h_,x_dest_,y_dest_); else if (displayPrintMode()==MSP::PPM) { int x=x_dest_+_displayPrint._displayPrint->x_org(); int y=y_dest_+_displayPrint._displayPrint->y_org(); ::XCopyArea(dpy_,src_,displayPrintPixmap(),gc_,x_src_,y_src_,w_,h_,x,y); } } void MSWidgetOutput::XSetClipRectangles(Display *dpy_,GC gc_, int x_,int y_,XRectangle *rects_,int n_,int order_) { if (_outputMode==Draw) ::XSetClipRectangles(dpy_,gc_,x_,y_,rects_,n_,order_); else if (displayPrintMode()==MSP::PPM) { XRectangle *rects=new XRectangle[n_]; for (unsigned i=0;ix_org(); rects[i].y+=_displayPrint._displayPrint->y_org(); } ::XSetClipRectangles(dpy_,gc_,x_,y_,rects,n_,order_); delete [] rects; } else _displayPrint._displayPrint->printSetClipRectangles(gc_,x_,y_,rects_,n_,order_); } void MSWidgetOutput::XSetDashes(Display *dpy_,GC gc_,int dash_offset_,const char *dash_list_,int n_) { if (_outputMode==Print) _displayPrint._displayPrint->printSetDashes(gc_,dash_list_,n_); else ::XSetDashes(dpy_,gc_,dash_offset_,dash_list_,n_); } void MSWidgetOutput::XFreeGC(Display *dpy_,GC gc_) { if (_outputMode==Print) _displayPrint._displayPrint->printFreeGC(gc_); ::XFreeGC(dpy_,gc_); } // ######################################################### // the following hide the interface of MSDisplayPrint: // ######################################################### MSBoolean MSWidgetOutput::displayPrintOpen(void) { return displayPrint()->printOpen(); } MSBoolean MSWidgetOutput::displayPrintOpen(MSWidget *pWidget_) { return displayPrint()->printOpen(pWidget_); } MSBoolean MSWidgetOutput::displayPrintClose(void) { return displayPrint()->printClose(); } int MSWidgetOutput::displayPrintMode(void) { return displayPrint()->outputMode(); } Window MSWidgetOutput::displayPrintPixmap(void) { return displayPrint()->ppmPixmap(); } void MSWidgetOutput::displayPrintOriginInc(MSWidget *pWidget_) { displayPrint()->originInc(pWidget_); } void MSWidgetOutput::displayPrintOriginDec(MSWidget *pWidget_) { displayPrint()->originDec(pWidget_); } void MSWidgetOutput::displayPrintFileName(const char *pString_) { displayPrint()->fileName(pString_); } void MSWidgetOutput::displayPrintXorigin(int x_) { displayPrint()->x_org(x_); } void MSWidgetOutput::displayPrintYorigin(int y_) { displayPrint()->y_org(y_); } void MSWidgetOutput::displayPrintInit(MSWidget *pWidget_) { displayPrint()->printInit(pWidget_); } void MSWidgetOutput::displayPrintClear(void) { displayPrint()->printClear(); } ofstream& MSWidgetOutput::displayPrintStream(void) { return displayPrint()->pout; } // ######################################################### // basic widget drawing methods: // // drawFlat // drawBevel // drawEtched // drawDiamond // ######################################################### static void getRects(XRectangle *rects,int count_,int offset, int x,int y,int width,int height,int pos_top,int pos_left, int pos_bottom,int pos_right) { int offsetX2; for (int i=0;i0) { XRectangle rect[4]; rect[0].x=aRect_.x(); rect[0].y=aRect_.y(); rect[0].width=aRect_.width(); rect[0].height=thickness_; rect[1].x=aRect_.x(); rect[1].y=aRect_.y(); rect[1].width=thickness_; rect[1].height=aRect_.height(); rect[2].x=aRect_.x()+aRect_.width()-thickness_; rect[2].y=aRect_.y(); rect[2].width=thickness_; rect[2].height=aRect_.height(); rect[3].x=aRect_.x(); rect[3].y=aRect_.y()+aRect_.height()-thickness_; rect[3].width=aRect_.width(); rect[3].height=thickness_; XBFillRectangles(display(),window_,gc_,rect,4); } } void MSWidgetOutput::drawEtchedShadow(Window window_,const MSRect& aRect_,MSShadowStyle style_, int thickness_,GC topGC_,GC bottomGC_) { if (mapped()==MSTrue&&thickness_>0) { int x=aRect_.x(); int y=aRect_.y(); int width=aRect_.width(); int height=aRect_.height(); int half_size; int size2; int size3; int pos_top,pos_left,pos_bottom,pos_right; if (thickness_<=0) return; if (thickness_==1) { GC gc=bottomGC_; if (style_==MSEtchedIn) gc=topGC_; drawFlatShadow(window_,aRect_,thickness_,gc); return; } if (thickness_>(width>>1)) thickness_=(width>>1); if (thickness_>(height>>1)) thickness_=(height>>1); if (thickness_<=0) return; thickness_=(thickness_%2)?(thickness_-1):(thickness_); half_size=(thickness_>>1); size2=thickness_+thickness_; size3=size2+thickness_; XRectangle *rects=new XRectangle[thickness_*4]; pos_top =0; pos_left =half_size; pos_bottom=size2; pos_right =size2+half_size; getRects(rects,half_size,0,x,y,width,height, pos_top,pos_left,pos_bottom,pos_right); pos_top =size3; pos_left =size3+half_size; pos_bottom=thickness_; pos_right =thickness_+half_size; getRects(rects,half_size,half_size,x,y,width,height, pos_top,pos_left,pos_bottom,pos_right); XBFillRectangles(display(),window_,bottomGC_,&rects[size2],size2); XBFillRectangles(display(),window_,topGC_,&rects[0],size2); delete [] rects; } } void MSWidgetOutput::drawBevelShadow(Window window_,const MSRect& aRect_, int thickness_,GC topGC_,GC bottomGC_) { XPoint points[7]; if (mapped()==MSTrue&&thickness_>0) { points[0].x=points[1].x=points[6].x=aRect_.x(); points[0].y=points[6].y=aRect_.y()+aRect_.height(); points[1].y=points[2].y=aRect_.y(); points[2].x=aRect_.x()+aRect_.width(); points[3].x=aRect_.x()+aRect_.width()-thickness_; points[3].y=points[4].y=aRect_.y()+thickness_; points[4].x=points[5].x=aRect_.x()+thickness_; points[5].y=aRect_.y()+aRect_.height()-thickness_; XBFillRectangle(display(),window_,bottomGC_, aRect_.x(),aRect_.y()+aRect_.height()-thickness_, aRect_.width(),thickness_); XBFillRectangle(display(),window_,bottomGC_, aRect_.x()+aRect_.width()-thickness_,aRect_.y(), thickness_,aRect_.height()); XBFillPolygon(display(),window_,topGC_,points,7,Nonconvex,CoordModeOrigin); } } void MSWidgetOutput::drawDiamondShadow(Window window_,const MSRect& aRect_,MSBoolean armed_, GC topGC_,GC bottomGC_,GC backgroundGC_,GC armedGC_) { if (mapped()==MSTrue) { XSegment seg[12]; XPoint pt[5]; int x=aRect_.x(); int y=aRect_.y(); int size=aRect_.height(); int midX=x+((size+1)>>1); int midY=y+((size+1)>>1); XFillRectangle(display(),window_,backgroundGC_,x,y,size,size); // Counter Reverse Drawing Effect On Tiny RadioButtons if (size<=3) { // The top shadow segments seg[0].x1=x+size-1; seg[0].y1=midY-1; seg[0].x2=midX-1; seg[0].y2=y+size-1; seg[1].x1=x+size-2; seg[1].y1=midY-1; seg[1].x2=midX-1; seg[1].y2=y+size-2; seg[2].x1=x+size-3; seg[2].y1=midY-1; seg[2].x2=midX-1; seg[2].y2=y+size-3; /*--*/ seg[3].x1=midX-1; seg[3].y1=y+size-1; seg[3].x2=x; seg[3].y2=midY-1; seg[4].x1=midX-1; seg[4].y1=y+size-2; seg[4].x2=x+1; seg[4].y2=midY-1; seg[5].x1=midX-1; seg[5].y1=y+size-3; seg[5].x2=x+2; seg[5].y2=midY-1; // The bottom shadow segments seg[6].x1=x+size-1; seg[6].y1=midY-1; seg[6].x2=midX-1; seg[6].y2=y; seg[7].x1=x+size-2; seg[7].y1=midY-1; seg[7].x2=midX-1; seg[7].y2=y+1; seg[8].x1=x+size-3; seg[8].y1=midY-1; seg[8].x2=midX-1; seg[8].y2=y+2; /*--*/ seg[9].x1=midX-1; seg[9].y1=y; seg[9].x2=x; seg[9].y2=midY-1; seg[10].x1=midX-1; seg[10].y1=y+1; seg[10].x2=x+1; seg[10].y2=midY-1; seg[11].x1=midX-1; seg[11].y1=y+2; seg[11].x2=x+2; seg[11].y2=midY-1; } else // Normal Sized RadioButtons { // The top shadow segments seg[0].x1=x; seg[0].y1=midY-1; seg[0].x2=midX-1; seg[0].y2=y; seg[1].x1=x+1; seg[1].y1=midY-1; seg[1].x2=midX-1; seg[1].y2=y+1; seg[2].x1=x+2; seg[2].y1=midY-1; seg[2].x2=midX-1; seg[2].y2=y+2; /*--*/ seg[3].x1=midX-1; seg[3].y1=y; seg[3].x2=x+size-1; seg[3].y2=midY-1; seg[4].x1=midX-1; seg[4].y1=y+1; seg[4].x2=x+size-2; seg[4].y2=midY-1; seg[5].x1=midX-1; seg[5].y1=y+2; seg[5].x2=x+size-3; seg[5].y2=midY-1; // The bottom shadow segments seg[6].x1=x; seg[6].y1=midY-1; seg[6].x2=midX-1; seg[6].y2=y+size-1; seg[7].x1=x+1; seg[7].y1=midY-1; seg[7].x2=midX-1; seg[7].y2=y+size-2; seg[8].x1=x+2; seg[8].y1=midY-1; seg[8].x2=midX-1; seg[8].y2=y+size-3; /*--*/ seg[9].x1=midX-1; seg[9].y1=y+size-1; seg[9].x2=x+size-1; seg[9].y2=midY-1; seg[10].x1=midX-1; seg[10].y1=y+size-2; seg[10].x2=x+size-2; seg[10].y2=midY-1; seg[11].x1=midX-1; seg[11].y1=y+size-3; seg[11].x2=x+size-3; seg[11].y2=midY-1; } XDrawSegments(display(),window_,(armed_==MSTrue)?bottomGC_:topGC_,&seg[3],3); XDrawSegments(display(),window_,(armed_==MSTrue)?topGC_:bottomGC_,&seg[6],6); XDrawSegments(display(),window_,(armed_==MSTrue)?bottomGC_:topGC_,&seg[0],3); // For Fill if (armed_==MSTrue) { pt[0].x=x+3; pt[0].y=midY-1; pt[1].x=midX-1 ; pt[1].y=y+2; pt[2].x=x+size-3; pt[2].y=midY-1; pt[3].x=midX-1 ; pt[3].y=y+size-3; } else { pt[0].x=x+4; pt[0].y=midY-1; pt[1].x=midX-1; pt[1].y=y+3; pt[2].x=x+size-4; pt[2].y=midY-1; pt[3].x=midX-1; pt[3].y=y+size-4; } // Counter Reverse Drawing Effect On Tiny RadioButtons if (pt[0].x>pt[1].x) { pt[1].x=pt[0].x; pt[2].x=pt[0].x; pt[3].x=pt[0].x; } if (pt[0].ydefaultHighlightColor(); createGCs(); } } void MSWidgetOutput::init(void) { _highlightThickness=0; _shadowThickness=0; _highlighted=MSFalse; _shadowStyle=MSSunken; _topShadowOffset=0; _highlightColor=0; } void MSWidgetOutput::createGCs(void) { unsigned long valueMask=(GCForeground); XGCValues values; values.foreground=highlightColor(); _highlightMSGC.setGCValues(_server,MSTrue,&values,valueMask); } Window MSWidgetOutput::windowForDrawing(void) { return (_window==0)?_owner->window():_window; } MSBoolean MSWidgetOutput::canDraw(void) { return (_window==0)?_owner->mapped():mapped(); } int MSWidgetOutput::xDrawingOffset(void) { return (_window==0)?x_origin():0; } int MSWidgetOutput::yDrawingOffset(void) { return (_window==0)?y_origin():0;} MSGC& MSWidgetOutput::highlightMSGC(void) { return _highlightMSGC; } MSShadow& MSWidgetOutput::shadow(void) { return _shadow; } const MSShadow& MSWidgetOutput::shadow(void) const { return _shadow; } GC MSWidgetOutput::highlightGC(void) const { return _highlightMSGC.gc(); } GC MSWidgetOutput::bottomShadowGC(void) const { return _shadow.bottomShadowGC(); } GC MSWidgetOutput::topShadowGC(void) const { return _shadow.topShadowGC(); } GC MSWidgetOutput::backgroundShadowGC(void) const { return _shadow.backgroundShadowGC(); } GC MSWidgetOutput::selectShadowGC(void) const { return _shadow.selectShadowGC(); } unsigned long MSWidgetOutput::selectShadowColor(void) const { return _shadow.select(); } unsigned long MSWidgetOutput::topShadowColor(void) const { return _shadow.topShadow(); } unsigned long MSWidgetOutput::bottomShadowColor(void) const { return _shadow.bottomShadow(); } void MSWidgetOutput::highlightColor(const char *color_) { highlightColor(_server->pixel(color_)); } void MSWidgetOutput::highlightColor(unsigned long pixel_) { if (pixel_!=highlightColor()) { _highlightColor=pixel_; highlightMSGC().foreground(highlightColor()); if (highlighted()==MSTrue) drawHighlight(); } } void MSWidgetOutput::highlightThickness(int ht_) { if (ht_!=highlightThickness()) { _highlightThickness=ht_; computeSize(); } } void MSWidgetOutput::shadowThickness(int st_) { if (st_!=shadowThickness()) { _shadowThickness=st_; computeSize(); } } void MSWidgetOutput::topShadowOffset(int offset_) { if (topShadowOffset()!=offset_) { _topShadowOffset=offset_; if (canDraw()==MSTrue) redraw(); } } void MSWidgetOutput::highlight(void) { _highlighted=MSTrue; drawHighlight(); } void MSWidgetOutput::unHighlight(void) { _highlighted=MSFalse; undrawHighlight(); } void MSWidgetOutput::drawHighlight(void) { if (canDraw()==MSTrue) drawHighlightBorder(highlightThickness()); } void MSWidgetOutput::undrawHighlight(void) { if (canDraw()==MSTrue) undrawHighlightBorder(highlightThickness()); } void MSWidgetOutput::drawShadow(void) { drawShadow(shadowStyle()); } void MSWidgetOutput::undrawShadow(void) { undrawBevel(); } void MSWidgetOutput::drawRaised(void) { drawShadow(MSRaised); } void MSWidgetOutput::drawSunken(void) { drawShadow(MSSunken); } void MSWidgetOutput::drawEtchedIn(void) { drawShadow(MSEtchedIn); } void MSWidgetOutput::drawEtchedOut(void) { drawShadow(MSEtchedOut); } void MSWidgetOutput::drawShadow(MSShadowStyle style_) { if (canDraw()==MSTrue&&shadowThickness()>0) { int offset=highlightThickness(); MSRect aRect(xDrawingOffset()+offset, yDrawingOffset()+topShadowOffset()+offset, width()-2*offset, height()-topShadowOffset()-2*offset); drawBevel(windowForDrawing(),aRect,style_,shadowThickness()); } } void MSWidgetOutput::shadowStyle(MSShadowStyle style_) { if (shadowStyle()!=style_) { _shadowStyle=style_; if (canDraw()==MSTrue) drawShadow(); } } void MSWidgetOutput::updateBackground(unsigned long) { shadow().color(background()); if (canDraw()==MSTrue) { XFillRectangle(display(),windowForDrawing(),backgroundShadowGC(), xDrawingOffset(),yDrawingOffset(),width(),height()); drawShadow(); if (highlighted()==MSTrue) drawHighlight(); } } void MSWidgetOutput::clear(void) { if (canDraw()==MSTrue) { int offset=highlightThickness()+shadowThickness(); XFillRectangle(display(),windowForDrawing(),backgroundShadowGC(), xDrawingOffset()+offset,yDrawingOffset()+offset, width()-2*offset,height()-2*offset); } } void MSWidgetOutput::drawBackground(void) { if (canDraw()==MSTrue) { int offset=highlightThickness()+shadowThickness(); XFillRectangle(display(),windowForDrawing(),backgroundShadowGC(), xDrawingOffset()+offset,yDrawingOffset()+offset, width()-2*offset,height()-2*offset); } } void MSWidgetOutput::undrawBevel(void) { if (canDraw()==MSTrue) { int offset=highlightThickness(); MSRect aRect(xDrawingOffset()+offset,yDrawingOffset()+offset+topShadowOffset(), width()-2*offset,height()-topShadowOffset()-2*offset); drawBevelShadow(windowForDrawing(),aRect, shadowThickness(),backgroundShadowGC(),backgroundShadowGC()); } } void MSWidgetOutput::undrawBevel(const MSRect& aRect_,int thickness_) { if (canDraw()==MSTrue) { drawBevelShadow(windowForDrawing(),aRect_,thickness_, backgroundShadowGC(),backgroundShadowGC()); } } void MSWidgetOutput::undrawBevel(Window window_,const MSRect& aRect_,int thickness_) { drawBevelShadow(window_,aRect_,thickness_,backgroundShadowGC(),backgroundShadowGC()); } void MSWidgetOutput::drawBevel(void) { drawBevel(shadowThickness()); } void MSWidgetOutput::drawBevel(int thickness_) { if (canDraw()==MSTrue) { int offset=highlightThickness(); MSRect aRect(xDrawingOffset()+offset,yDrawingOffset()+offset+topShadowOffset(), width()-2*offset,height()-topShadowOffset()-2*offset); drawBevel(windowForDrawing(),aRect,shadowStyle(),thickness_); } } void MSWidgetOutput::drawBevel(const MSRect& aRect_,MSShadowStyle style_) { drawBevel(windowForDrawing(),aRect_,style_,shadowThickness());} void MSWidgetOutput::drawBevel(const MSRect& aRect_,MSShadowStyle style_,int thickness_) { drawBevel(windowForDrawing(),aRect_,style_,thickness_); } void MSWidgetOutput::drawRaised(Window window_,const MSRect& aRect_,int thickness_) { drawBevelShadow(window_,aRect_,thickness_,topShadowGC(),bottomShadowGC()); } void MSWidgetOutput::drawSunken(Window window_,const MSRect& aRect_,int thickness_) { drawBevelShadow(window_,aRect_,thickness_,bottomShadowGC(),topShadowGC()); } void MSWidgetOutput::drawBevel(Window window_,const MSRect& aRect_, MSShadowStyle style_,int st_) { if (st_>0) { GC topGC=topShadowGC(); GC bottomGC=bottomShadowGC(); switch (style_) { case MSRaised: drawBevelShadow(window_,aRect_,st_,topGC,bottomGC); break; case MSSunken: drawBevelShadow(window_,aRect_,st_,bottomGC,topGC); break; case MSEtchedIn: drawEtchedShadow(window_,aRect_,MSEtchedIn,st_,bottomGC,topGC); break; case MSEtchedOut: drawEtchedShadow(window_,aRect_,MSEtchedOut,st_,topGC,bottomGC); break; case MSFlat: drawFlatShadow(window_,aRect_,st_,bottomGC); break; } } } // obsolete - use drawBevelShadow void MSWidgetOutput::drawBevel(Window window_,const MSRect& aRect_,int thickness_, GC topGC_,GC bottomGC_) { drawBevelShadow(window_,aRect_,thickness_,topGC_,bottomGC_); } void MSWidgetOutput::drawHighlightBorder(int thickness_) { drawFlatShadow(windowForDrawing(), MSRect(xDrawingOffset(),yDrawingOffset()+topShadowOffset(), width(),height()-topShadowOffset()), thickness_,highlightGC()); } void MSWidgetOutput::undrawHighlightBorder(int thickness_) { drawFlatShadow(windowForDrawing(), MSRect(xDrawingOffset(),yDrawingOffset()+topShadowOffset(), width(),height()-topShadowOffset()), thickness_,backgroundShadowGC()); } void MSWidgetOutput::drawHighlightBorder(GC gc_,int x_,int y_,int w_,int h_,int thickness_) { if (canDraw()==MSTrue) { drawFlatShadow(windowForDrawing(),MSRect(x_,y_,w_,h_),thickness_,gc_); } } void MSWidgetOutput::drawEtchedIn(Window window_,const MSRect& aRect_,int thickness_) { drawEtchedShadow(window_,aRect_,MSEtchedIn,thickness_,bottomShadowGC(),topShadowGC()); } void MSWidgetOutput::drawEtchedOut(Window window_,const MSRect& aRect_,int thickness_) { drawEtchedShadow(window_,aRect_,MSEtchedOut,thickness_,topShadowGC(),bottomShadowGC()); } void MSWidgetOutput::copyPixmap(Display* dpy_,const MSPixmap& pix_,Window dest_,GC gc_, int x_,int y_) { copyPixmap(dpy_,pix_,dest_,gc_,0,0,pix_.width(),pix_.height(),x_,y_,x_,y_); } void MSWidgetOutput::copyPixmap(Display* dpy_,const MSPixmap& pix_,Window dest_,GC gc_, int x_src_,int y_src_,int w_,int h_, int x_dest_,int y_dest_, int x_clip_,int y_clip_) { Pixmap clipMask=pix_.clipMask(); if (clipMask==0) XSetClipMask(dpy_,gc_,None); else { XSetClipOrigin(dpy_,gc_,x_clip_,y_clip_); XSetClipMask(dpy_,gc_,clipMask); } if(pix_.depth()==1) { XCopyPlane(dpy_,pix_.pixmap(),dest_,gc_,x_src_,y_src_,w_,h_,x_dest_,y_dest_,1); } else { XCopyArea(dpy_,pix_.pixmap(),dest_,gc_,x_src_,y_src_,w_,h_,x_dest_,y_dest_); } } //############################################################################################# // set and get methods to support the application builder void MSWidgetOutput::set(MSAttrValueList& avList_) { MSWidget::set(avList_); MSIndexVector index; for (unsigned i=0;icolorName(highlightColor()),MSAttrValue::Color); return MSWidget::get(avList_); } aplus-fsf-4.22/src/MSGUI/MSWidgetState.C0000644000265000001440000000344110772770417013277 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #if HAVE_IOSTREAM #include #else #include #endif #include #include #include MSWidgetState::MSWidgetState (istream &is_) : MSHashTable(1024) { if (!is_) return; while (!is_.eof()) { MSString line=MSString::lineFrom(is_); if (line.length()==0) continue; if (line(0)=='#') continue; unsigned index; MSString attributeToken(".has."); if ((index=line.indexOf(attributeToken))!=line.length()&&index!=0) { MSString pathname=line.subString(0,index); line=line.subString(index+attributeToken.length()); if ((index=line.indexOf('('))==line.length()||index==0) continue; MSString attributeName=line.subString(0,index); line=line.subString(index+1); if ((index=line.indexOf(')'))==line.length()) continue; MSString attributeValue=line.subString(0,index); MSAttrValueList *list; if ((list=(MSAttrValueList *)lookup(pathname))==0) { list=new MSAttrValueList; *list<next(); MSAttrValueList *list=(MSAttrValueList *)entry->value(); if (list!=0) delete list; delete entry; entry=bucket(i); } _bucket[i]=0; } if (_bucket!=0) delete [] _bucket; _bucket=0; _size=0; } aplus-fsf-4.22/src/MSGUI/MSWidgetResourceMapper.C0000644000265000001440000001174710772770417015163 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #if defined(MSTK_MANUAL_INSTANTIATION) #include #if defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma instantiate MSIHashKeySet #endif #if defined(MS_STD_TEMPLATE_INSTANTIATION) template class MSIHashKeySet; #endif #if defined(MS_XLC_TEMPLATE_INSTANTIATION) #pragma define(MSIHashKeySet) #endif #if defined(MS_VC_TEMPLATE_INSTANTIATION) template MSIHashKeySet; #endif #endif void MSWidgetResourceMapper::WidgetDestroyCallback::process(void) { mapper().widgetDestroyed(this); } MSWidgetResourceMapper::MapperItem::MapperItem(const MSString &logicalValue_, const MSString &realValue_) :_logicalValue(logicalValue_),_realValue(realValue_) {} void MSWidgetResourceMapper::MapperItem::doCallback(MSCallback *pCallback_) { MSResourceChangeCallback *cb=(MSResourceChangeCallback *)pCallback_; cb->resourceChanged(realValue()); } MSWidgetResourceMapper::MSWidgetResourceMapper(void) {} MSWidgetResourceMapper::~MSWidgetResourceMapper(void) { ResourceSet::Cursor cursor(resourceSet()); for (cursor.setToFirst();cursor.isValid();cursor.setToNext()) { MapperItem &item=resourceSet().elementAt(cursor); MSUnsignedLongVector &cbList=item.destroyCBList(); unsigned len=cbList.length(); for (unsigned i=0;iwidget()->removeCallback(MSWidgetCallback::destroy,cb); } } } void MSWidgetResourceMapper::associate(const char *logicalValue_,const char *realValue_) { ResourceSet::Cursor cursor(resourceSet()); if (resourceSet().locateElementWithKey(logicalValue_,cursor)) { MapperItem &item=resourceSet().elementAt(cursor); item.realValue(realValue_); item.activateCallback(MSSymbol(logicalValue_)); } else { resourceSet().add(MapperItem(logicalValue_,realValue_)); } } const char *MSWidgetResourceMapper::value(const char *logicalValue_) const { ResourceSet::Cursor cursor(resourceSet()); if (resourceSet().locateElementWithKey(logicalValue_,cursor)) { const MapperItem &item=resourceSet().elementAt(cursor); return item.realValue(); } else return logicalValue_; } void MSWidgetResourceMapper::addCallback(const char *logicalValue_, MSResourceChangeCallback *callback_) { MapperItem *item=0; ResourceSet::Cursor cursor(resourceSet()); if (resourceSet().locateElementWithKey(logicalValue_,cursor)) { item=&resourceSet().elementAt(cursor); } else { resourceSet().add(MapperItem(logicalValue_,"")); item=&resourceSet().elementWithKey(logicalValue_); } // First add the resource change callback on this item, using the pointer to // the callback object as the void * ID. item->addCallback(MSSymbol(logicalValue_),callback_,callback_); // Create a WidgetDestroyCallback object and add it as a destroy callback // onto the widget. Use the WidgetDestroyCallback object pointer as the // void * ID. if (callback_->widget()!=0) { WidgetDestroyCallback *cb=new WidgetDestroyCallback(*this,*item, callback_->widget(),callback_); callback_->widget()->addCallback(MSWidgetCallback::destroy,cb,cb); // Add the pointer of the WidgetDestroyCallback into or destroy callback list item->destroyCBList()<<(unsigned long)cb; } } void MSWidgetResourceMapper::removeCallback(const char *logicalValue_, MSResourceChangeCallback *callback_) { ResourceSet::Cursor cursor(resourceSet()); if (resourceSet().locateElementWithKey(logicalValue_,cursor)) { MapperItem &item=resourceSet().elementAt(cursor); item.removeCallback(MSSymbol(logicalValue_),callback_); } } void MSWidgetResourceMapper::widgetDestroyed(WidgetDestroyCallback *callback_) { MapperItem &item=callback_->mapperItem(); item.removeCallback(MSSymbol(item.logicalValue()),callback_->id()); unsigned i; if ((i=item.destroyCBList().indexOf((unsigned long)callback_))!=item.destroyCBList().length()) { item.destroyCBList().removeAt(i); } } MSStringVector MSWidgetResourceMapper::logicalValues(void) const { MSStringVector values; ResourceSet::Cursor cursor(resourceSet()); for (cursor.setToFirst();cursor.isValid();cursor.setToNext()) { const MapperItem &item=resourceSet().elementAt(cursor); values< MSWidgetVector::MSWidgetVector(void) : MSUnsignedLongVector() {} MSWidgetVector::MSWidgetVector(const MSWidgetVector& aWidgetVector_) : MSUnsignedLongVector(aWidgetVector_ ) {} MSWidgetVector::MSWidgetVector(MSWidget *pWidget_) : MSUnsignedLongVector(1,(unsigned long)pWidget_) {} MSWidgetVector::~MSWidgetVector(void) {} MSWidgetVector& MSWidgetVector::operator<<(MSWidget *pWidget_) { return append(pWidget_); } MSWidgetVector& MSWidgetVector::operator<<(const MSWidgetVector& bWidgetVector_) { return append(bWidgetVector_); } /*** MSWidgetVector& operator<<(MSWidgetVector& aWidgetVector_,MSWidget *pWidget_) { return aWidgetVector_.append(pWidget_); } MSWidgetVector& operator<<(MSWidgetVector& aWidgetVector_,const MSWidgetVector& bWidgetVector_) { return aWidgetVector_.append(bWidgetVector_); } ***/ MSWidgetVector &MSWidgetVector::operator=(const MSWidgetVector& aWidgetVector_) { MSUnsignedLongVector::operator=(aWidgetVector_); return *this; } MSWidgetVector& MSWidgetVector::append(MSWidget *pWidget_) { MSUnsignedLongVector::append((unsigned long)pWidget_); return *this; } MSWidgetVector& MSWidgetVector::append(const MSWidgetVector& aWidgetVector_) { MSUnsignedLongVector::append((MSUnsignedLongVector &)aWidgetVector_); return *this; } aplus-fsf-4.22/src/MSGUI/MSWidgetView.C0000644000265000001440000000137010772770417013130 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include MSWidgetView::MSWidgetView(void) {} MSWidgetView::MSWidgetView(MSDisplayServer *server_) : MSWidgetOutput(server_) {} MSWidgetView::MSWidgetView(MSWidget *owner_) : MSWidgetOutput(owner_) {} MSWidgetView::~MSWidgetView(void) {} void MSWidgetView::decoupleWidget(void) { decouple(); } MSBoolean MSWidgetView::isProtected(void) const { return (isReadOnlyModel()==MSTrue || MSWidgetOutput::isProtected()==MSTrue)?MSTrue:MSFalse; } aplus-fsf-4.22/src/MSGUI/MSWindow.C0000644000265000001440000000122110772770417012314 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include MSWindow::MSWindow(const char * windowTitle_) : MSMenuShell(windowTitle_) { init(); } MSWindow::MSWindow(MSDisplayServer *server_, const char * windowTitle_) : MSMenuShell( server_, windowTitle_) { init(); } MSWindow::~MSWindow(void) { } void MSWindow::init(void) { MSLayout *layout=new MSLayout(this); layout->shadowThickness(0); } aplus-fsf-4.22/src/MSGUI/MSPointerArray.T.C0000644000265000001440000000352510772770417013677 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include // Specializations for the MSGUI objects #if defined(MSTK_MANUAL_INSTANTIATION) #include #if defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma instantiate MSPointerArray #pragma instantiate MSPointerArray #pragma instantiate MSPointerArray #pragma instantiate MSPointerArray #pragma instantiate MSPointerArray #pragma instantiate MSPointerArray #endif #if defined(MS_XLC_TEMPLATE_INSTANTIATION) #pragma define (MSPointerArray) #pragma define (MSPointerArray) #pragma define (MSPointerArray) #pragma define (MSPointerArray) #pragma define (MSPointerArray) #pragma define (MSPointerArray) #endif #if defined(MS_STD_TEMPLATE_INSTANTIATION) template class MSPointerArray; template class MSPointerArray; template class MSPointerArray; template class MSPointerArray; template class MSPointerArray; template class MSPointerArray; #endif #if defined(MS_VC_TEMPLATE_INSTANTIATION) template MSPointerArray; template MSPointerArray; template MSPointerArray; template MSPointerArray; template MSPointerArray; template MSPointerArray; #endif #endif //MSTK_MANUAL_INSTANTIATION aplus-fsf-4.22/src/MSGUI/MSTreeListView.T.C0000644000265000001440000000263610772770417013650 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// // This file provides common instantiations for MSTreeListView template. #include #include // force local classes defined MSTreeListView.C to be compiled. #if defined(MS_FORCE_INTERNAL_TEMPLATE_INSTANTIATION) #include #include #endif #ifndef MSTreeListViewHEADER inline MSString const &key(const MSPixmap &pixmap_) { return pixmap_.name(); } #endif #if defined(MSTK_MANUAL_INSTANTIATION) #include #include #if defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma instantiate MSIHashKeySet #pragma instantiate MSGenericVector #endif #if defined(MS_STD_TEMPLATE_INSTANTIATION) template class MSIHashKeySet; template class MSGenericVector; #endif #if defined(MS_VC_TEMPLATE_INSTANTIATION) template MSIHashKeySet; template MSGenericVector; #endif #if defined(MS_XLC_TEMPLATE_INSTANTIATION) #pragma define(MSGenericVector) #pragma define(MSIHashKeySet) #endif #endif //MSTK_MANUAL_INSTANTIATION aplus-fsf-4.22/src/MSGUI/MSPostScriptView.C0000644000265000001440000024152610772770417014030 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #include #include #include #include typedef void Sigfunc(int); extern "C" Sigfunc *aplus_signal(int, Sigfunc); #if defined(MS_NEED_STRCASECMP_DECLARATION) extern "C" int strcasecmp(const char *,const char *); #endif #if defined(MS_SIGNAL_HAS_DOT_PARAM) #define SIGPARAM ... #else #define SIGPARAM int #endif MSSymbol MSPostScriptView::ghostscriptexecerror("ghostscriptexecerror"); MSSymbol MSPostScriptView::ghostscriptwriteerror("ghostscriptwriteerror"); MSSymbol MSPostScriptView::ghostscriptfileerror("ghostscriptfileerror"); MSSymbol MSPostScriptView::ghostscriptmessage("ghostscriptmessage"); class MSPostScriptViewInChannel : public MSChannel { public: MSPostScriptViewInChannel(MSPostScriptView *owner_, const char* name_,int fd_); ~MSPostScriptViewInChannel(); void sendPostScript(FILE*, int, int); virtual void process(void); protected: void writeFailed(void); static void writeError(SIGPARAM); static MSBoolean broken_pipe; struct record_list { FILE *fp; long begin; unsigned int len; MSBoolean seek_needed; MSBoolean close; struct record_list *next; }; MSPostScriptView *_owner; struct record_list *_inputQueue; char *_inputBuffer; char *_inputBufferPtr; int _bufferBytesLeft; int _bytesLeft; }; class MSPostScriptViewOutChannel : public MSChannel { public: MSPostScriptViewOutChannel(MSPostScriptView* owner_, const char *name_,int fd_); ~MSPostScriptViewOutChannel(); virtual void process(void); protected: MSPostScriptView *_owner; }; /* * This class scans the postScript file and saves the information about its structure. * The code is almost a verbatim copy from Ghostview implementation (after c++fication). */ static const int PSLINELENGTH = 257; /* 255 characters + 1 newline + 1 NULL */ class MSPostScriptViewDocument { public: enum { LLX=0, LLY=1, URX=2, URY=3 }; enum PageOrder {ATEND = -1, NONE = 0, PORTRAIT, LANDSCAPE, ASCEND, DESCEND, SPECIAL}; MSPostScriptViewDocument(); ~MSPostScriptViewDocument(); MSBoolean scanFile(FILE *); void pscopy(FILE*,FILE*,long,long); char * pscopyuntil(FILE *, FILE*, long, long, const char *); int numPages(void) { return _doc==0?-1:(_doc->numpages==0?-1:(int)_doc->numpages); } int beginProlog(void) { return _doc->beginprolog; } int lenProlog(void) { return _doc->lenprolog; } int beginSetup(void) { return _doc->beginsetup; } int lenSetup(void) { return _doc->lensetup; } PageOrder pageOrder(void) { return (PageOrder)_doc->pageorder; } PageOrder defaultPageOrientation(void) { return (PageOrder)((_doc==0)?NONE:_doc->default_page_orientation); } PageOrder pageOrientation(void) { return (PageOrder)((_doc==0)?NONE:_doc->orientation); } int pageStart(int i) { return _doc->pages[i].begin; } int pageLen(int i) { return _doc->pages[i].len; } public: //protected: struct documentmedia { char *name; int width, height; }; //This to make xlC happy. struct page; friend struct page; struct document; friend struct document; struct page { char *label; int boundingbox[4]; struct documentmedia *media; int orientation; /* PORTRAIT, LANDSCAPE */ long begin, end; /* offsets into file */ unsigned int len; }; struct document { int epsf; /* Encapsulated PostScript flag. */ char *title; /* Title of document. */ char *date; /* Creation date. */ int pageorder; /* ASCEND, DESCEND, SPECIAL */ long beginheader, endheader; /* offsets into file */ unsigned int lenheader; long beginpreview, endpreview; unsigned int lenpreview; long begindefaults, enddefaults; unsigned int lendefaults; long beginprolog, endprolog; unsigned int lenprolog; long beginsetup, endsetup; unsigned int lensetup; long begintrailer, endtrailer; unsigned int lentrailer; int boundingbox[4]; int default_page_boundingbox[4]; int orientation; /* PORTRAIT, LANDSCAPE */ int default_page_orientation; /* PORTRAIT, LANDSCAPE */ unsigned int nummedia; struct documentmedia *media; struct documentmedia *default_page_media; unsigned int numpages; struct page *pages; }; document * _doc; static documentmedia papersizes[]; int blank(char *); char *readline(char*,int,FILE*,long*,unsigned int*); #ifdef gettext #undef gettext #endif char *gettext(char*,char**); char *gettextline(char*); void freeDoc(document *); }; extern int MSPageSizeXTable[]; extern int MSPageSizeYTable[]; static const double MSPostScriptViewMaxZoom = 4.0; static const int MSPostScriptViewDefaultScrollBarSize = 15; static const int MSPostScriptViewDefaultScrollBarInc = 5; static const int MSPostScriptViewDefaultWidth=500; static const int MSPostScriptViewDefaultHeight=300; static const unsigned long MSPostScriptViewEventMask = (ExposureMask|PropertyChangeMask|ButtonPressMask/*|ButtonReleaseMask*/); int MSPostScriptView::_pixmapCount=0; MSString MSPostScriptView::_gsInterpreter="gs"; MSPostScriptViewOutChannel::MSPostScriptViewOutChannel(MSPostScriptView* owner_,const char* name_,int fd_) : _owner(owner_),MSChannel(name_,fd_,Default,Read,0) { enable(); } MSPostScriptViewOutChannel::~MSPostScriptViewOutChannel() { close(fd()); } void MSPostScriptViewOutChannel::process(void) { //got output from gs. //just read and ignore for now. // int bytes; char buf[BUFSIZ]; bytes=read(fd(),buf,BUFSIZ); if(bytes==0) { disable(); if(_owner->_replyWin!=0) _owner->stopInterpreter(); } else if(bytes==-1) { MSMessageLog::errorMessage("MSPostscriptViewer: gs failed on fd:%d\n", fd()); } else if(bytes >0) { buf[bytes]='\0'; MSString str(buf); if(str.indexOf("MSFailure")!=str.length()) { _owner->ghostScriptExecError(); } if(str.indexOf("Error")!=str.length()) { _owner->stopInterpreter(); _owner->ghostScriptFileError(str); } else if(str.indexOf("GS>")!=str.length()) { _owner->interpreterFinished(); } else { _owner->ghostScriptMessage(str); } } } MSPostScriptViewInChannel::MSPostScriptViewInChannel(MSPostScriptView* owner_,const char* name_,int fd_) : _owner(owner_),MSChannel(name_,fd_,Default,Write,0) { _inputBuffer=0; _inputBufferPtr=0; _inputQueue=0; _bytesLeft=0; _bufferBytesLeft=0; } MSPostScriptViewInChannel::~MSPostScriptViewInChannel() { while(_inputQueue) { record_list *ps_old=_inputQueue; _inputQueue = _inputQueue->next; if(ps_old->close) fclose(ps_old->fp); free(ps_old); } if(_inputBuffer!=0) free(_inputBuffer); close(fd()); } MSBoolean MSPostScriptViewInChannel::broken_pipe=MSFalse; void MSPostScriptViewInChannel::writeError(SIGPARAM) { broken_pipe=MSTrue; } void MSPostScriptViewInChannel::process(void) { int bytes_written; void (*oldsig)(SIGPARAM); oldsig = aplus_signal(SIGPIPE, writeError); #ifdef NON_BLOCKING_IO do { #endif if (_bufferBytesLeft == 0) { /* Get a new section if required */ if (_inputQueue && _bytesLeft == 0) { record_list *ps_old = _inputQueue; _inputQueue = ps_old->next; if (ps_old->close) fclose(ps_old->fp); free((char *)ps_old); } /* Have to seek at the beginning of each section */ if (_inputQueue && _inputQueue->seek_needed) { if (_inputQueue->len > 0) fseek(_inputQueue->fp, _inputQueue->begin, SEEK_SET); _inputQueue->seek_needed = MSFalse; _bytesLeft = _inputQueue->len; } if (_bytesLeft > BUFSIZ) { _bufferBytesLeft = fread(_inputBuffer, sizeof (char), BUFSIZ, _inputQueue->fp); } else if (_bytesLeft > 0) { _bufferBytesLeft = fread(_inputBuffer, sizeof (char), _bytesLeft, _inputQueue->fp); } else { _bufferBytesLeft = 0; } if (_bytesLeft > 0 && _bufferBytesLeft == 0) { writeFailed(); /* Error occurred */ aplus_signal(SIGPIPE, oldsig); return; } _inputBufferPtr = _inputBuffer; _bytesLeft -= _bufferBytesLeft; } if (_bufferBytesLeft > 0) { bytes_written = write(fd(), _inputBufferPtr, _bufferBytesLeft); if (broken_pipe) { broken_pipe = MSFalse; writeFailed(); /* Something bad happened */ aplus_signal(SIGPIPE, oldsig); return; } else if (bytes_written == -1) { if ((errno != EWOULDBLOCK) && (errno != EAGAIN)) { writeFailed(); /* Something bad happened */ aplus_signal(SIGPIPE, oldsig); return; } } else { _bufferBytesLeft -= bytes_written; _inputBufferPtr += bytes_written; } } #ifdef NON_BLOCKING_IO } while(_inputQueue && _bufferBytesLeft == 0); #endif aplus_signal(SIGPIPE, oldsig); if (_inputQueue == NULL && _bufferBytesLeft == 0) { disable(); } } void MSPostScriptViewInChannel::sendPostScript(FILE *fp,int begin, int len) { struct record_list *ps_new; ps_new = (struct record_list *)malloc(sizeof (struct record_list)); ps_new->fp = fp; ps_new->begin = begin; ps_new->len = len; ps_new->seek_needed = MSTrue; ps_new->close = MSFalse; ps_new->next = NULL; if (_inputBuffer == NULL) { _inputBuffer = (char *)malloc(BUFSIZ); } if (_inputQueue == NULL) { _bytesLeft = len; _bufferBytesLeft=0; _inputQueue = ps_new; enable(); } else { record_list *p = _inputQueue; while (p->next != NULL) { p = p->next; } p->next = ps_new; } } void MSPostScriptViewInChannel::writeFailed(void) { disable(); _owner->writeFailed(); } MSPostScriptView::HScrollBar::HScrollBar(MSWidget *pOwner_) :MSHScrollBar(pOwner_) { min(0); inc(MSPostScriptViewDefaultScrollBarInc); pageInc(1); _highlightThickness=0; _acceptFocus=MSFalse; height(MSPostScriptViewDefaultScrollBarSize); } void MSPostScriptView::HScrollBar::change(void) { MSPostScriptView *pView = (MSPostScriptView*)owner(); if(pView->acceptFocus()==MSTrue) traverseFocus(pView); pView->hsbChanged(); } MSPostScriptView::VScrollBar::VScrollBar(MSWidget *pOwner_) :MSVScrollBar(pOwner_) { min(0); inc(MSPostScriptViewDefaultScrollBarInc); pageInc(1); _highlightThickness=0; _acceptFocus=MSFalse; width(MSPostScriptViewDefaultScrollBarSize); } void MSPostScriptView::VScrollBar::change(void) { MSPostScriptView *pView = (MSPostScriptView*)owner(); if(pView->acceptFocus()==MSTrue) traverseFocus(pView); pView->vsbChanged(); } MSPostScriptView::ClipWindow::ClipWindow(MSWidget *owner_) : MSWidgetCommon(owner_) { _highlightThickness=0; _shadowThickness=0; _acceptFocus=MSFalse; } MSPostScriptView::MSPostScriptView(MSWidget *pOwner_) :MSWidgetCommon(pOwner_) { _pixmapName="MSPostScriptView" +MSString(_pixmapCount); _pixmapCount++; init(); } MSPostScriptView::~MSPostScriptView() { stopInterpreter(); if(redrawPixmap()!=0) delete _redrawPixmap; if(_doc!=0) delete _doc; if(_hsb!=0) _hsb->destroy(); if(_vsb!=0) _vsb->destroy(); if(_clipWindow!=0) _clipWindow->destroy(); if(_docFile!=0) fclose(_docFile); } void MSPostScriptView::scrollInc(int inc_) { _hsb->inc(inc_); _vsb->inc(inc_); } double MSPostScriptView::PointToPixel(double pt_, double dpi_) const { return pt_ *dpi_/72.0; } double MSPostScriptView::PixelToPoint(double pixel_, double dpi_) const { return pixel_ *72.0/dpi_; } void MSPostScriptView::init(void) { GHOSTVIEW=XInternAtom(display(),"GHOSTVIEW",False); GHOSTVIEW_COLORS=XInternAtom(display(),"GHOSTVIEW_COLORS",False); PAGE=XInternAtom(display(),"PAGE",False); DONE=XInternAtom(display(),"DONE",False); NEXT=XInternAtom(display(),"NEXT",False); _defaultXdpi=25.4*WidthOfScreen(server()->screen())/WidthMMOfScreen(server()->screen()); _defaultYdpi=25.4*HeightOfScreen(server()->screen())/HeightMMOfScreen(server()->screen()); _vsb=new VScrollBar(this); _hsb=new HScrollBar(this); _clipWindow=new ClipWindow(this); _pid=-1; _replyWin=0; _xPos = _yPos=0; _orientation=Portrait; _pageSize = Letter; _zoomFactor = 1.0; _redrawPixmap=0; updateDpi(); updateRectangle(); updatePixmap(); _busy = MSFalse; _showBusyCursor = MSFalse; _busyObject = 0; selectInput(MSPostScriptViewEventMask); _acceptFocus=MSTrue; addToFocusList(); _highlightThickness=0; _shadowThickness=2; _docFile=0; _doc=0; _in=0; _out=0; _err=0; resize(MSPostScriptViewDefaultWidth,MSPostScriptViewDefaultHeight); } void MSPostScriptView::firstMapNotify(void) { _naturalWidth=width(); _naturalHeight=height(); } void MSPostScriptView::naturalSize(void) { resize(_naturalWidth,_naturalHeight); } void MSPostScriptView::focusIn(void) { highlight(); } void MSPostScriptView::focusOut(void) { unHighlight(); } void MSPostScriptView::button1Press(const XEvent*) { if(acceptFocus()==MSTrue) traverseFocus(this); } void MSPostScriptView::showBusyCursor(MSBoolean sbc_) { _showBusyCursor = sbc_; if(isBusy()==MSTrue) { if(showBusyCursor()==MSTrue) { if(_busyObject == 0)_busyObject=new MSShellBusy((MSShell *)top()); } else if(_busyObject != 0) { delete _busyObject; _busyObject=0; } } } void MSPostScriptView::updateBusyState(void) { if(_busy == MSFalse) { if(_busyObject!=0) { delete _busyObject; _busyObject=0; } } else if(showBusyCursor()==MSTrue) { _busyObject = new MSShellBusy((MSShell *)top()); } } void MSPostScriptView::setBusyState(MSBoolean busy_) { if(_busy!=busy_) { _busy = busy_; updateBusyState(); } } void MSPostScriptView::keyPress(const XEvent *pEvent_,KeySym k_,unsigned int state_,const char *) { MSKeyPress keyPress(k_, state_); if (sensitive()==MSTrue&& keyTranslate(keyPress)==MSFalse) { switch (k_) { case XK_Up: up(); break; case XK_Down: down(); break; case XK_Left: left(); break; case XK_Right: right(); break; case XK_F29: case XK_Prior: pageUp(); break; case XK_F35: case XK_Next: pageDown(); break; case XK_F27: case XK_Home: home(); break; case XK_R13: case XK_End: end(); break; case XK_period: reloadPage(); break; } } } void MSPostScriptView::pageUp(void) { prevPage(); pageChange(); } void MSPostScriptView::pageDown(void) { nextPage(); pageChange(); } void MSPostScriptView::home(void) { firstPage(); pageChange(); } void MSPostScriptView::end(void) { lastPage(); pageChange(); } void MSPostScriptView::up(void) { if(vsb()->value() > vsb()->min()) { vsb()->value(vsb()->value()-scrollInc()); } } void MSPostScriptView::down(void) { if(vsb()->value() < vsb()->max()) { vsb()->value(vsb()->value()+scrollInc()); } } void MSPostScriptView::left(void) { if(hsb()->value() > hsb()->min()) { hsb()->value(hsb()->value()-1); } } void MSPostScriptView::right(void) { if(hsb()->value() < hsb()->max()) { hsb()->value(hsb()->value()+1); } } void MSPostScriptView::firstPage(void) { if(isBusy()==MSTrue) return; if (_doc!=0 && pageCount()>0 && currentPage()!=0) currentPage(0); } void MSPostScriptView::lastPage(void) { if(isBusy()==MSTrue) return; if (_doc!=0 && pageCount()>0 && currentPage()!=(pageCount()-1)) currentPage(pageCount()-1); } void MSPostScriptView::prevPage(void) { if(isBusy()==MSTrue) return; if(_doc!=0 && _doc->numPages()>0 && currentPage()>0) { currentPage(currentPage()-1); } } void MSPostScriptView::nextPage(void) { if(isBusy()==MSTrue) return; if(_doc!=0 && _doc->numPages()>0) { if(currentPage()mapped()==MSTrue) { int w = width() - 2 *highlightThickness() - 2*shadowThickness(); if(vsb()->mapped()==MSTrue) w-=vsb()->width(); w=(w>0)?w:1; if (xPos()+w>pageWidth()) { if (w>pageWidth()) _xPos=0; else _xPos = pageWidth()-w; } } else _xPos =0; hsb()->valueChange(xPos()); } void MSPostScriptView::adjustYPos(void) { if(vsb()->mapped()==MSTrue) { int h=height()-highlightThickness()*2 -shadowThickness()*2; if(hsb()->mapped()==MSTrue) h-=hsb()->height(); if (yPos()+h>pageHeight()) { if (h>pageHeight()) _yPos=0; else _yPos = pageHeight()-h; } } else _yPos =0; vsb()->valueChange(yPos()); } void MSPostScriptView::drawPage(void) { int w,h; int offset = highlightThickness() + shadowThickness(); w=width()-2*offset; if(vsb()->mapped()==MSTrue) w-= vsb()->width(); h=height()-2*offset; if(hsb()->mapped()==MSTrue) h-= hsb()->height(); w= MSUtil::min(pageWidth(), w); h= MSUtil::min(pageHeight(), h); XCopyArea(display(),redrawPixmap()->pixmap(),window(), backgroundShadowGC(), _xPos,_yPos,w,h,offset,offset); } void MSPostScriptView::redraw(void) { if(isBusy() == MSFalse && redrawPixmap()!=0) { drawPage(); } else drawBackground(); drawAreaShadow(); if(highlighted() == MSTrue) drawHighlight(); } void MSPostScriptView::drawAreaShadow(void) { if (shadowThickness()>0) { int viewWidth=width()-highlightThickness()*2; viewWidth-=(vsb()->mapped()==MSTrue)?vsb()->width():0; int viewHeight=height()-highlightThickness()*2; viewHeight-=(hsb()->mapped()==MSTrue)?hsb()->height():0; drawBevel(window(),MSRect(highlightThickness(),highlightThickness(),viewWidth,viewHeight),shadowStyle(),shadowThickness()); } } void MSPostScriptView::updateDpi(void) { _xdpi = _defaultXdpi *_zoomFactor; _ydpi = _defaultYdpi *_zoomFactor; } void MSPostScriptView::ghostScriptFileError(const MSString& str_) { _errorString=str_; if(activateCallback(MSPostScriptView::ghostscriptfileerror)==MSFalse) { MSMessageLog::errorMessage("MSPostScriptView: Error in postscript file:\n%s\n",str_.string()); } } void MSPostScriptView::ghostScriptMessage(const MSString& str_) { _errorString=str_; if(activateCallback(MSPostScriptView::ghostscriptmessage)==MSFalse) { MSMessageLog::warningMessage(str_.string()); } } void MSPostScriptView::ghostScriptExecError(void) { _errorString="Unable to exec gs"; if(activateCallback(MSPostScriptView::ghostscriptexecerror)!=MSTrue) { MSMessageLog::errorMessage("MSPostScriptView: %s\n",_errorString.string()); } } void MSPostScriptView::ghostScriptWriteError(void) { _errorString="Failed writing to gs"; if(activateCallback(MSPostScriptView::ghostscriptwriteerror)!=MSTrue) { MSMessageLog::errorMessage("MSPostScriptView: %s\n",_errorString.string()); } } void MSPostScriptView::sendNextEvent(void) { if(_replyWin != 0) { XEvent ev; ev.type = ClientMessage; ev.xclient.message_type=NEXT; ev.xclient.window=_replyWin; ev.xclient.display=display(); ev.xclient.format=32; XSendEvent(display(),_replyWin,False,0,&ev); XFlush(display()); setBusyState(MSTrue); } } void MSPostScriptView::interpreterFinished(void) { stopInterpreter(); } void MSPostScriptView::clientMessage(const XEvent *pEvent_) { if(pEvent_->xclient.message_type==PAGE) { _replyWin=pEvent_->xclient.data.l[0]; setBusyState(MSFalse); drawPage(); } else if(pEvent_->xclient.message_type==DONE) { stopInterpreter(); } else { // This should never happen. // However this happens on irix.6.2, n32 with buggy libX11.so.1 // XInternAtom would sometimes return bogus values. // Patch for libX11.so.1 is available from SGI. char *s=0; s=XGetAtomName(server()->display(),pEvent_->xclient.message_type); if(strcmp(s,"PAGE")==0) { PAGE=pEvent_->xclient.message_type; _replyWin=pEvent_->xclient.data.l[0]; setBusyState(MSFalse); drawPage(); } else if(strcmp(s,"DONE")==0) { DONE=pEvent_->xclient.message_type; stopInterpreter(); } XFree(s); } } int MSPostScriptView::pageCount() const { if(_doc == 0) return -1; else return _doc->numPages(); } void MSPostScriptView::pageChange(void) { activateCallback(MSWidgetCallback::pagechange); } void MSPostScriptView::currentPage(int pageNumber) { if(isFileLoaded()==MSFalse) return; int i; if(pageCount() >0) { if(pageNumber >= _doc->numPages()) pageNumber=_doc->numPages() -1; else if(pageNumber <0) pageNumber =0; if(isReady()==MSTrue) sendNextEvent(); else { stopInterpreter(); startInterpreter(); _in->sendPostScript(_docFile,_doc->beginProlog(), _doc->lenProlog()); _in->sendPostScript(_docFile, _doc->beginSetup(), _doc->lenSetup()); } if(_doc->pageOrder()== MSPostScriptViewDocument::DESCEND) i=(_doc->numPages() -1) - pageNumber; else i=pageNumber; _in->sendPostScript(_docFile, _doc->pageStart(i),_doc->pageLen(i)); _currentPage = pageNumber; } else { if(isRunning()==MSFalse) { startInterpreter(MSTrue); _currentPage=0; } else { if(isReady()==MSTrue) sendNextEvent(); _currentPage++; } } setBusyState(MSTrue); } void MSPostScriptView::updateForeground(unsigned long fg_) { MSWidgetCommon::updateForeground(fg_); updatePixmap(MSTrue); if(isFileLoaded()==MSTrue) { stopInterpreter(); currentPage(currentPage()); pageChange(); } } void MSPostScriptView::updateBackground(unsigned long oldBg_) { MSWidgetCommon::updateBackground(oldBg_); updatePixmap(MSTrue); if(isFileLoaded()==MSTrue) { stopInterpreter(); currentPage(currentPage()); pageChange(); } } unsigned long MSPostScriptView::scrollbarBackground(void) const { return _hsb->background(); } void MSPostScriptView::scrollbarBackground(const char * bg_) { scrollbarBackground(server()->pixel(bg_)); } void MSPostScriptView::scrollbarBackground(unsigned long bg_) { if(bg_!= scrollbarBackground()) { hsb()->background(bg_); vsb()->background(bg_); clipWindow()->background(bg_); } } int MSPostScriptView::pointPageWidth(void) const { if(pageOrientation()==Portrait||pageOrientation()==UpsideDown) return MSPageSizeXTable[pageSize()-MSP::Letter]; else return MSPageSizeYTable[pageSize()-MSP::Letter]; } int MSPostScriptView::pageWidth(void) const { return ((int)PointToPixel(pointPageWidth(),_xdpi)); } int MSPostScriptView::pointPageHeight(void) const { if(pageOrientation()==Portrait||pageOrientation()==UpsideDown) return MSPageSizeYTable[pageSize()-MSP::Letter]; else return MSPageSizeXTable[pageSize()-MSP::Letter]; } int MSPostScriptView::pageHeight(void) const { return ((int)PointToPixel(pointPageHeight(),_ydpi)); } void MSPostScriptView::updateRectangle(void) { int ph=pointPageHeight(); int pw=pointPageWidth(); _llx=_lly=0; switch(pageOrientation()) { case Landscape: case Seascape: _urx=ph; _ury=pw; break; case Portrait: case UpsideDown: _urx=pw; _ury=ph; break; } } void MSPostScriptView::zoomFactor(double zoomFactor_) { if(_zoomFactor != zoomFactor_) { if(zoomFactor_ <=0.0 || zoomFactor_ > MSPostScriptViewMaxZoom || zoomFactor_ *_defaultXdpi < 1.0 ||zoomFactor_*_defaultYdpi <1.0) return; _zoomFactor= zoomFactor_; updateDpi(); updateRectangle(); updatePixmap(); if(isFileLoaded()==MSTrue) { stopInterpreter(); currentPage(currentPage()); } } } void MSPostScriptView::pageSize(MSP::PageSize pageSize_) { if(pageSize() != pageSize_) { _pageSize = pageSize_; updateRectangle(); updatePixmap(); if(isFileLoaded()==MSTrue) { stopInterpreter(); currentPage(currentPage()); } } } void MSPostScriptView::updatePixmap(MSBoolean ) { if(redrawPixmap()!=0) delete _redrawPixmap; int pw=pageWidth(); int ph=pageHeight(); _redrawPixmap=new MSPixmap(server(),_pixmapName.string(),pw,ph, foreground(),background()); clearPixmap(); configure(); } void MSPostScriptView::clearPixmap(void) { XFillRectangle(display(),_redrawPixmap->pixmap(), backgroundShadowGC(), 0,0,pageWidth()+1,pageHeight()+1); XClearWindow(display(),window()); } void MSPostScriptView::pageOrientation(PageOrientation orientation_) { if(pageOrientation()!=orientation_) { _orientation=orientation_; updateRectangle(); updatePixmap(); if(isFileLoaded()==MSTrue) { stopInterpreter(); currentPage(currentPage()); } } } void MSPostScriptView::setProperties(void) { int angle=0; switch(pageOrientation()) { case Portrait: angle=0; break; case Landscape: angle=90; break; case UpsideDown: angle=180; break; case Seascape: angle=270; break; } char buf[256]; sprintf(buf, "%d %d %d %d %d %d %f %f", // %d %d %d %d", 0,angle,0,0,(int)_urx, (int)_ury, _xdpi,_ydpi); XChangeProperty(display(), window(), GHOSTVIEW, XA_STRING,8,PropModeReplace, (unsigned char *)buf, strlen(buf)); sprintf(buf,"Color %d %d", foreground(), background()); XChangeProperty(display(), window(), GHOSTVIEW_COLORS, XA_STRING,8,PropModeReplace, (unsigned char *)buf, strlen(buf)); XSync(display(),False); /* update the properties */ } void MSPostScriptView::setEnviroment(void) { static char buf[256]; sprintf(buf,"GHOSTVIEW=%ld %ld",window(),redrawPixmap()->pixmap()); putenv(buf); } void MSPostScriptView::configure(void) { // updateRectangle(); int border=(shadowThickness()+highlightThickness())*2; int requiredWidth = pageWidth()+border; int requiredHeight = pageHeight()+border; if (width()>=requiredWidth) hsb()->hide(); else { hsb()->show(); requiredHeight+=hsb()->height(); } if(height()>=requiredHeight) vsb()->hide(); else { vsb()->show(); if (hsb()->mapped()==MSFalse) { requiredWidth+=vsb()->width(); if (width()show(); } } adjustXPos(); adjustYPos(); updateHsb(); updateVsb(); if(vsb()->mapped()==MSTrue&&hsb()->mapped()==MSTrue) { clipWindow()->resize(vsb()->width(),hsb()->height()); clipWindow()->moveTo(hsb()->x()+hsb()->width(),vsb()->y()+vsb()->height()); clipWindow()->show(); } else clipWindow()->hide(); } void MSPostScriptView::updateHsb(void) { if (hsb()->mapped()==MSTrue) { int w=width()-highlightThickness()*2; if(vsb()->mapped()==MSTrue) w-=vsb()->width(); w=(w>0)?w:1; hsb()->width(w); hsb()->moveTo(highlightThickness(),height()-highlightThickness()-hsb()->height()); hsb()->max(pageWidth()); int viewSize=width()-highlightThickness()*2-shadowThickness()*2; if (vsb()->mapped()==MSTrue) viewSize-=vsb()->width(); hsb()->viewSize(viewSize); hsb()->pageInc(viewSize); } } void MSPostScriptView::updateVsb(void) { if (vsb()->mapped()==MSTrue) { int h =height()-highlightThickness()*2; if(hsb()->mapped()==MSTrue) h-=hsb()->height(); h=(h>0)?h:1; vsb()->height(h); vsb()->moveTo(width()-highlightThickness()-vsb()->width(),highlightThickness()); vsb()->max(pageHeight()); int viewSize=height()-highlightThickness()*2-shadowThickness()*2; if (hsb()->mapped()==MSTrue) viewSize-=hsb()->height(); vsb()->viewSize(viewSize); vsb()->pageInc(viewSize); } } void MSPostScriptView::hsbChanged(void) { xPos(hsb()->value()); } void MSPostScriptView::vsbChanged(void) { yPos(vsb()->value()); } void MSPostScriptView::writeFailed() { if(_replyWin==0) { if(stopInterpreter()==5) ghostScriptExecError(); else ghostScriptFileError(""); } else { stopInterpreter(); ghostScriptWriteError(); } } int MSPostScriptView::stopInterpreter(void) { int res =-1; pid_t ret_pid; if(_pid!= -1) { int stat_loc; kill(_pid, SIGTERM); ret_pid=waitpid(_pid,&stat_loc,0); #ifdef MS_WAIT_RETURNS_STATUS stat_loc=(int)ret_pid; #endif #ifdef MS_WAIT_MACROS_NEED_UNION_CAST union wait *status=(union wait*)&stat_loc; #else int *status=&stat_loc; #endif if(WIFEXITED((*status))) res=WEXITSTATUS((*status)); _pid=-1; _replyWin=0; } if(_in!=0) { delete _in; _in=0;} if(_out!=0) { delete _out; _out=0;} if(_err!=0) { delete _err; _err=0; } setBusyState(MSFalse); return res; } void MSPostScriptView::unloadFile(void) { stopInterpreter(); clearPixmap(); if(_docFile!=0) fclose(_docFile); _docFile=0; if(_doc!=0) delete _doc; _doc=0; } MSPostScriptView::ErrorCode MSPostScriptView::loadFile(const MSString& file_, int startPage_) { if(_docFile!=0) fclose(_docFile); _fileName = file_; _docFile = fopen(_fileName.string(), "r"); if(_docFile==0) { clearPixmap(); return BadFile; } if(_doc!=0) delete _doc; _doc= new MSPostScriptViewDocument(); if(_doc->scanFile(_docFile) == MSFalse) { _doc->_doc=0; } stopInterpreter(); if(_doc!=0) { MSPostScriptViewDocument::PageOrder orient; orient=_doc->defaultPageOrientation(); if(orient==MSPostScriptViewDocument::NONE) orient=_doc->pageOrientation(); switch(orient) { case MSPostScriptViewDocument::PORTRAIT: pageOrientation(MSP::Portrait); break; case MSPostScriptViewDocument::LANDSCAPE: pageOrientation(MSP::Landscape); break; default: break; } } currentPage(startPage_); return NoError; } MSBoolean MSPostScriptView::startInterpreter(MSBoolean passFile_) { static char buf1[256]; static char buf2[256]; setProperties(); int std_in[2]; int std_out[2]; int std_err[2]; int argc=0; const char *argv[10]; int res=0; strcpy(buf1,_gsInterpreter.string()); strcpy(buf2,_fileName.string()); argv[argc++] = buf1; argv[argc++] = "-sDEVICE=x11"; argv[argc++] = "-dNOPAUSE"; argv[argc++] = "-dQUIET"; argv[argc++] = "-dSAFER"; argv[argc++] = (passFile_==MSFalse)?"-":buf2; argv[argc++] = NULL; // setEnviroment(); if (pipe(std_in)==-1) res=-1; else if (pipe(std_out)==-1) res=-1; else if (pipe(std_err)==-1) res=-1; if(res==-1) { MSMessageLog::errorMessage("MSPostScriptView::could not create pipe\n"); return MSFalse; } _pid=fork(); if (_pid==-1) { MSMessageLog::errorMessage("MSPostScriptView: unable to fork process\n"); return MSFalse; } else if (_pid==0) { close(std_out[0]); close(std_err[0]); dup2(std_out[1], 1); close(std_out[1]); dup2(std_err[1], 2); close(std_err[1]); setEnviroment(); close(std_in[1]); dup2(std_in[0],0); close(std_in[0]); execvp(argv[0], (char* const*)argv); // we failed close(0); close(1); close(2); exit(5); } else { close(std_in[0]); _in= new MSPostScriptViewInChannel(this,"gsIn",std_in[1]); close(std_out[1]); _out=new MSPostScriptViewOutChannel(this,"gsOut",std_out[0]); close(std_err[1]); _err=new MSPostScriptViewOutChannel(this,"gsErr",std_err[0]); } return MSTrue; } void MSPostScriptView::reload(void) { if(isFileLoaded()==MSTrue) loadFile(fileName()); } void MSPostScriptView::reloadPage(void) { if(isFileLoaded()==MSTrue) loadFile(fileName(), currentPage()); } MSPostScriptView::ErrorCode MSPostScriptView::printToFile(const MSString& fileName_, const MSIndexVector& pageIndex_) { FILE *fp; fp=fopen(fileName_,"w"); if(fp==0) return BadFile; printPages(fp,pageIndex_); fclose(fp); return NoError; } static MSBoolean printPipeBroken = MSFalse; static void printError(SIGPARAM) { printPipeBroken=MSTrue; } MSPostScriptView::ErrorCode MSPostScriptView::printToPrinter(const MSString& printerCmd_, const MSIndexVector& pageIndex_) { FILE *fp; fp=popen((char *)printerCmd_.string(),"w"); if(fp==0) return BadFile; printPages(fp,pageIndex_); if(printPipeBroken==MSTrue) { printPipeBroken=MSFalse; return BadFile; } else { pclose(fp); } return NoError; } /* * Code below is taken almost verbatim from ghostview source distribution. */ /* length calculates string length at compile time */ /* can only be used with character constants */ #define lengthOfString(a) (sizeof(a)-1) #define iscomment(a, b) (strncmp(a, b, lengthOfString(b)) == 0) #define DSCcomment(a) (a[0] == '%' && a[1] == '%') void MSPostScriptView::printPages(FILE *fp, const MSIndexVector& pageIndex_) { FILE *psfile; char text[PSLINELENGTH]; char *comment; MSBoolean pages_written = MSFalse; MSBoolean pages_atend = MSFalse; int pages = 0; int page = 1; int i, j; long here; printPipeBroken=MSFalse; void (*oldsig)(SIGPARAM); oldsig = aplus_signal(SIGPIPE, printError); psfile = fopen(fileName(), "r"); pages=pageIndex_.length(); if(pages==0) { char buf[BUFSIZ]; int bytes=0; while (bytes=read(fileno(psfile),buf,BUFSIZ)) { bytes=write(fileno(fp),buf,bytes); } fclose(psfile); aplus_signal(SIGPIPE,oldsig); return; } here = _doc->_doc->beginheader; while (comment = _doc->pscopyuntil(psfile, fp, here, _doc->_doc->endheader, "%%Pages:")) { if(printPipeBroken==MSTrue) { fclose(psfile); aplus_signal(SIGPIPE,oldsig); return; } here = ftell(psfile); if (pages_written || pages_atend) { free(comment); continue; } sscanf(comment+lengthOfString("%%Pages:"), "%s", text); if (strcmp(text, "(atend)") == 0) { fputs(comment, fp); pages_atend = MSTrue; } else { switch (sscanf(comment+lengthOfString("%%Pages:"), "%*d %d", &i)) { case 1: fprintf(fp, "%%%%Pages: %d %d\n", pages, i); break; default: fprintf(fp, "%%%%Pages: %d\n", pages); break; } pages_written = MSTrue; } free(comment); } _doc->pscopy(psfile, fp, _doc->_doc->beginpreview, _doc->_doc->endpreview); _doc->pscopy(psfile, fp, _doc->_doc->begindefaults, _doc->_doc->enddefaults); _doc->pscopy(psfile, fp, _doc->_doc->beginprolog, _doc->_doc->endprolog); _doc->pscopy(psfile, fp, _doc->_doc->beginsetup, _doc->_doc->endsetup); if(printPipeBroken==MSTrue) { fclose(psfile); aplus_signal(SIGPIPE,oldsig); return; } for (i = 0; i < _doc->_doc->numpages; i++) { if (_doc->_doc->pageorder == MSPostScriptViewDocument::DESCEND) j = (_doc->_doc->numpages - 1) - i; else j = i; if(pages==0 || pageIndex_.indexOf(j)!=pageIndex_.length()) { comment = _doc->pscopyuntil(psfile, fp, _doc->_doc->pages[i].begin, _doc->_doc->pages[i].end, "%%Page:"); fprintf(fp, "%%%%Page: %s %d\n", _doc->_doc->pages[i].label, page++); free(comment); _doc->pscopy(psfile, fp, -1, _doc->_doc->pages[i].end); if(printPipeBroken==MSTrue) { fclose(psfile); aplus_signal(SIGPIPE,oldsig); return; } } } here = _doc->_doc->begintrailer; while (comment = _doc->pscopyuntil(psfile, fp, here, _doc->_doc->endtrailer, "%%Pages:")) { here = ftell(psfile); if (pages_written) { free(comment); continue; } switch (sscanf(comment+lengthOfString("%%Pages:"), "%*d %d", &i)) { case 1: fprintf(fp, "%%%%Pages: %d %d\n", pages, i); break; default: fprintf(fp, "%%%%Pages: %d\n", pages); break; } pages_written = MSTrue; free(comment); } aplus_signal(SIGPIPE,oldsig); fclose(psfile); } MSPostScriptViewDocument::documentmedia MSPostScriptViewDocument::papersizes[] = { "Letter", 612, 792, "LetterSmall", 612, 792, "Tabloid", 792, 1224, "Ledger", 1224, 792, "Legal", 612, 1008, "Statement", 396, 612, "Executive", 540, 720, "A3", 842, 1190, "A4", 595, 842, "A4Small", 595, 842, "A5", 420, 595, "B4", 729, 1032, "B5", 516, 729, "Folio", 612, 936, "Quarto", 610, 780, "10x14", 720, 1008, NULL, 0, 0 }; MSPostScriptViewDocument::MSPostScriptViewDocument() { _doc = 0; } MSPostScriptViewDocument::~MSPostScriptViewDocument() { if(_doc != 0) freeDoc(_doc); } /* * psscan -- scan the PostScript file for document structuring comments. * * This scanner is designed to retrieve the information necessary for * the ghostview previewer. It will scan files that conform to any * version (1.0, 2.0, 2.1, or 3.0) of the document structuring conventions. * It does not really care which version of comments the file contains. * (The comments are largely upward compatible.) It will scan a number * of non-conforming documents. (You could have part of the document * conform to V2.0 and the rest conform to V3.0. It would be similar * to the DC-2 1/2+, it would look funny but it can still fly.) * * This routine returns a pointer to the document structure. * The structure contains the information relevant to previewing. * These include EPSF flag (to tell if the file is a encapsulated figure), * Page Media (for the Page Size), Bounding Box (to minimize backing * pixmap size or determine window size for encapsulated PostScript), * Orientation of Paper (for default transformation matrix), and * Page Order. The title and CreationDate are also retrieved to * help identify the document. * * The following comments are examined: * * Header section: * Must start with %!PS-Adobe-. Version numbers ignored. * * %!PS-Adobe-* [EPSF-*] * %%BoundingBox: |(atend) * %%CreationDate: * %%Orientation: Portrait|Landscape|(atend) * %%Pages: []|(atend) * %%PageOrder: Ascend|Descend|Special|(atend) * %%Title: * %%DocumentMedia: * %%DocumentPaperSizes: * %%EndComments * * Note: Either the 3.0 or 2.0 syntax for %%Pages is accepted. * Also either the 2.0 %%DocumentPaperSizes or the 3.0 * %%DocumentMedia comments are accepted as well. * * The header section ends either explicitly with %%EndComments or * implicitly with any line that does not begin with %X where X is * a not whitespace character. * * If the file is encapsulated PostScript the optional Preview section * is next: * * %%BeginPreview * %%EndPreview * * This section explicitly begins and ends with the above comments. * * Next the Defaults section for version 3 page defaults: * * %%BeginDefaults * %%PageBoundingBox: * %%PageOrientation: Portrait|Landscape * %%PageMedia: * %%EndDefaults * * This section explicitly begins and ends with the above comments. * * The prolog section either explicitly starts with %%BeginProlog or * implicitly with any nonblank line. * * %%BeginProlog * %%EndProlog * * The Prolog should end with %%EndProlog, however the proglog implicitly * ends when %%BeginSetup, %%Page, %%Trailer or %%EOF are encountered. * * The Setup section is where the version 2 page defaults are found. * This section either explicitly begins with %%BeginSetup or implicitly * with any nonblank line after the Prolog. * * %%BeginSetup * %%PageBoundingBox: * %%PageOrientation: Portrait|Landscape * %%PaperSize: * %%EndSetup * * The Setup should end with %%EndSetup, however the setup implicitly * ends when %%Page, %%Trailer or %%EOF are encountered. * * Next each page starts explicitly with %%Page and ends implicitly with * %%Page or %%Trailer or %%EOF. The following comments are recognized: * * %%Page: * %%PageBoundingBox: |(atend) * %%PageOrientation: Portrait|Landscape * %%PageMedia: * %%PaperSize: * * The tralier section start explicitly with %%Trailer and end with %%EOF. * The following comment are examined with the proper (atend) notation * was used in the header: * * %%Trailer * %%BoundingBox: |(atend) * %%Orientation: Portrait|Landscape|(atend) * %%Pages: []|(atend) * %%PageOrder: Ascend|Descend|Special|(atend) * %%EOF * * * + A DC-3 received severe damage to one of its wings. The wing was a total * loss. There was no replacement readily available, so the mechanic * installed a wing from a DC-2. */ MSBoolean MSPostScriptViewDocument::scanFile(FILE *file) { struct document *doc; int bb_set = NONE; int pages_set = NONE; int page_order_set = NONE; int orientation_set = NONE; int page_bb_set = NONE; int page_media_set = NONE; int preread; /* flag which tells the readline isn't needed */ int i; unsigned int maxpages = 0; unsigned int nextpage = 1; /* Next expected page */ unsigned int thispage; int ignore = 0; /* whether to ignore page ordinals */ char *label; char line[PSLINELENGTH]; /* 255 characters + 1 newline + 1 NULL */ char text[PSLINELENGTH]; /* Temporary storage for text */ long position; /* Position of the current line */ long beginsection; /* Position of the beginning of the section */ unsigned int line_len; /* Length of the current line */ unsigned int section_len; /* Place to accumulate the section length */ char *next_char; /* 1st char after text returned by gettext() */ char *cp; struct documentmedia *dmp; int force_page=0; int seen_trailer=0; rewind(file); if (readline(line, sizeof line, file, &position, &line_len) == NULL) { MSMessageLog::warningMessage("MSPostScriptView Warning: empty file.\n"); return MSFalse; } /* Header comments */ if (iscomment(line,"%!PS-Adobe-")) { doc = (struct document *) malloc(sizeof(struct document)); if (doc == NULL) { MSTKTHROWEXCEPTION(MSOutOfMemory("MSPostScriptView Out Of Memory.\n")); } memset(doc, 0, sizeof(struct document)); text[0]='\0'; sscanf(line, "%*s %s", text); doc->epsf = iscomment(text, "EPSF-"); doc->beginheader = position; section_len = line_len; } else { return MSFalse; } preread = 0; while (preread || readline(line, sizeof line, file, &position, &line_len)) { if (!preread) section_len += line_len; preread = 0; if (line[0] != '%' || iscomment(line+1, "%EndComments") || line[1] == ' ' || line[1] == '\t' || line[1] == '\n' || !isprint(line[1])) { break; } else if (line[1] != '%') { /* Do nothing */ } else if (doc->title == NULL && iscomment(line+2, "Title:")) { doc->title = gettextline(line+lengthOfString("%%Title:")); } else if (doc->date == NULL && iscomment(line+2, "CreationDate:")) { doc->date = gettextline(line+lengthOfString("%%CreationDate:")); } else if (bb_set == NONE && iscomment(line+2, "BoundingBox:")) { sscanf(line+lengthOfString("%%BoundingBox:"), "%s", text); if (strcmp(text, "(atend)") == 0) { bb_set = ATEND; } else { if (sscanf(line+lengthOfString("%%BoundingBox:"), "%d %d %d %d", &(doc->boundingbox[LLX]), &(doc->boundingbox[LLY]), &(doc->boundingbox[URX]), &(doc->boundingbox[URY])) == 4) bb_set = 1; else { float fllx, flly, furx, fury; if (sscanf(line+lengthOfString("%%BoundingBox:"), "%f %f %f %f", &fllx, &flly, &furx, &fury) == 4) { bb_set = 1; doc->boundingbox[LLX] = (int)fllx; doc->boundingbox[LLY] = (int)flly; doc->boundingbox[URX] = (int)furx; doc->boundingbox[URY] = (int)fury; if (fllx < doc->boundingbox[LLX]) doc->boundingbox[LLX]--; if (flly < doc->boundingbox[LLY]) doc->boundingbox[LLY]--; if (furx > doc->boundingbox[URX]) doc->boundingbox[URX]++; if (fury > doc->boundingbox[URY]) doc->boundingbox[URY]++; } } } } else if (orientation_set == NONE && iscomment(line+2, "Orientation:")) { sscanf(line+lengthOfString("%%Orientation:"), "%s", text); if (strcmp(text, "(atend)") == 0) { orientation_set = ATEND; } else if (strcmp(text, "Portrait") == 0) { doc->orientation = PORTRAIT; orientation_set = 1; } else if (strcmp(text, "Landscape") == 0) { doc->orientation = LANDSCAPE; orientation_set = 1; } } else if (page_order_set == NONE && iscomment(line+2, "PageOrder:")) { sscanf(line+lengthOfString("%%PageOrder:"), "%s", text); if (strcmp(text, "(atend)") == 0) { page_order_set = ATEND; } else if (strcmp(text, "Ascend") == 0) { doc->pageorder = ASCEND; page_order_set = 1; } else if (strcmp(text, "Descend") == 0) { doc->pageorder = DESCEND; page_order_set = 1; } else if (strcmp(text, "Special") == 0) { doc->pageorder = SPECIAL; page_order_set = 1; } } else if (pages_set == NONE && iscomment(line+2, "Pages:")) { sscanf(line+lengthOfString("%%Pages:"), "%s", text); if (strcmp(text, "(atend)") == 0) { pages_set = ATEND; } else { switch (sscanf(line+lengthOfString("%%Pages:"), "%d %d", &maxpages, &i)) { case 2: if (page_order_set == NONE) { if (i == -1) { doc->pageorder = DESCEND; page_order_set = 1; } else if (i == 0) { doc->pageorder = SPECIAL; page_order_set = 1; } else if (i == 1) { doc->pageorder = ASCEND; page_order_set = 1; } } case 1: if (maxpages > 0) { doc->pages = (struct page *) calloc(maxpages, sizeof(struct page)); if (doc->pages == NULL) { MSTKTHROWEXCEPTION(MSOutOfMemory("MSPostScriptView Out Of Memory.\n")); } } } } } else if (doc->nummedia == NONE && iscomment(line+2, "DocumentMedia:")) { float w, h; doc->media = (struct documentmedia *) malloc(sizeof (struct documentmedia)); if (doc->media == NULL) { MSTKTHROWEXCEPTION(MSOutOfMemory("MSPostScriptView Out Of Memory.\n")); } doc->media[0].name = gettext(line+lengthOfString("%%DocumentMedia:"), &next_char); if (doc->media[0].name != NULL) { if (sscanf(next_char, "%f %f", &w, &h) == 2) { doc->media[0].width = (int)(w + 0.5); doc->media[0].height = (int)(h + 0.5); } if (doc->media[0].width != 0 && doc->media[0].height != 0) doc->nummedia = 1; else free(doc->media[0].name); } preread=1; while (readline(line, sizeof line, file, &position, &line_len) && DSCcomment(line) && iscomment(line+2, "+")) { section_len += line_len; doc->media = (struct documentmedia *) realloc(doc->media, (doc->nummedia+1)* sizeof (struct documentmedia)); if (doc->media == NULL) { MSTKTHROWEXCEPTION(MSOutOfMemory("MSPostScriptView Out Of Memory.\n")); } doc->media[doc->nummedia].name = gettext(line+lengthOfString("%%+"), &next_char); if (doc->media[doc->nummedia].name != NULL) { if (sscanf(next_char, "%f %f", &w, &h) == 2) { doc->media[doc->nummedia].width = (int)(w + 0.5); doc->media[doc->nummedia].height = (int)(h + 0.5); } if (doc->media[doc->nummedia].width != 0 && doc->media[doc->nummedia].height != 0) doc->nummedia++; else free(doc->media[doc->nummedia].name); } } section_len += line_len; if (doc->nummedia != 0) doc->default_page_media = doc->media; } else if (doc->nummedia == NONE && iscomment(line+2, "DocumentPaperSizes:")) { doc->media = (struct documentmedia *) malloc(sizeof (struct documentmedia)); if (doc->media == NULL) { MSTKTHROWEXCEPTION(MSOutOfMemory("MSPostScriptView Out Of Memory.\n")); } doc->media[0].name = gettext(line+lengthOfString("%%DocumentPaperSizes:"), &next_char); if (doc->media[0].name != NULL) { doc->media[0].width = 0; doc->media[0].height = 0; for (dmp=papersizes; dmp->name != NULL; dmp++) { /* Note: Paper size comment uses down cased paper size * name. Case insensitive compares are only used for * PaperSize comments. */ if (strcasecmp(doc->media[0].name, dmp->name) == 0) { free(doc->media[0].name); doc->media[0].name = (char *)malloc(strlen(dmp->name)+1); if (doc->media[0].name == NULL) { MSTKTHROWEXCEPTION(MSOutOfMemory("MSPostScriptView Out Of Memory.\n")); } strcpy(doc->media[0].name, dmp->name); doc->media[0].width = dmp->width; doc->media[0].height = dmp->height; break; } } if (doc->media[0].width != 0 && doc->media[0].height != 0) doc->nummedia = 1; else free(doc->media[0].name); } while (cp = gettext(next_char, &next_char)) { doc->media = (struct documentmedia *) realloc(doc->media, (doc->nummedia+1)* sizeof (struct documentmedia)); if (doc->media == NULL) { MSTKTHROWEXCEPTION(MSOutOfMemory("MSPostScriptView Out Of Memory.\n")); } doc->media[doc->nummedia].name = cp; doc->media[doc->nummedia].width = 0; doc->media[doc->nummedia].height = 0; for (dmp=papersizes; dmp->name != NULL; dmp++) { /* Note: Paper size comment uses down cased paper size * name. Case insensitive compares are only used for * PaperSize comments. */ if (strcasecmp(doc->media[doc->nummedia].name, dmp->name) == 0) { free(doc->media[doc->nummedia].name); doc->media[doc->nummedia].name = (char *)malloc(strlen(dmp->name)+1); if (doc->media[doc->nummedia].name == NULL) { MSTKTHROWEXCEPTION(MSOutOfMemory("MSPostScriptView Out Of Memory.\n")); } strcpy(doc->media[doc->nummedia].name, dmp->name); doc->media[doc->nummedia].name = dmp->name; doc->media[doc->nummedia].width = dmp->width; doc->media[doc->nummedia].height = dmp->height; break; } } if (doc->media[doc->nummedia].width != 0 && doc->media[doc->nummedia].height != 0) doc->nummedia++; else free(doc->media[doc->nummedia].name); } preread=1; while (readline(line, sizeof line, file, &position, &line_len) && DSCcomment(line) && iscomment(line+2, "+")) { section_len += line_len; next_char = line + lengthOfString("%%+"); while (cp = gettext(next_char, &next_char)) { doc->media = (struct documentmedia *) realloc(doc->media, (doc->nummedia+1)* sizeof (struct documentmedia)); if (doc->media == NULL) { MSTKTHROWEXCEPTION(MSOutOfMemory("MSPostScriptView Out Of Memory.\n")); } doc->media[doc->nummedia].name = cp; doc->media[doc->nummedia].width = 0; doc->media[doc->nummedia].height = 0; for (dmp=papersizes; dmp->name != NULL; dmp++) { /* Note: Paper size comment uses down cased paper size * name. Case insensitive compares are only used for * PaperSize comments. */ if (strcasecmp(doc->media[doc->nummedia].name, dmp->name) == 0) { doc->media[doc->nummedia].width = dmp->width; doc->media[doc->nummedia].height = dmp->height; break; } } if (doc->media[doc->nummedia].width != 0 && doc->media[doc->nummedia].height != 0) doc->nummedia++; else free(doc->media[doc->nummedia].name); } } section_len += line_len; if (doc->nummedia != 0) doc->default_page_media = doc->media; } } if (DSCcomment(line) && iscomment(line+2, "EndComments")) { readline(line, sizeof line, file, &position, &line_len); section_len += line_len; } doc->endheader = position; doc->lenheader = section_len - line_len; /* Optional Preview comments for encapsulated PostScript files */ beginsection = position; section_len = line_len; while (blank(line) && readline(line, sizeof line, file, &position, &line_len)) { section_len += line_len; } if (doc->epsf && DSCcomment(line) && iscomment(line+2, "BeginPreview")) { doc->beginpreview = beginsection; beginsection = 0; while (readline(line, sizeof line, file, &position, &line_len) && !(DSCcomment(line) && iscomment(line+2, "EndPreview"))) { section_len += line_len; } section_len += line_len; readline(line, sizeof line, file, &position, &line_len); section_len += line_len; doc->endpreview = position; doc->lenpreview = section_len - line_len; } /* Page Defaults for Version 3.0 files */ if (beginsection == 0) { beginsection = position; section_len = line_len; } while (blank(line) && readline(line, sizeof line, file, &position, &line_len)) { section_len += line_len; } if (DSCcomment(line) && iscomment(line+2, "BeginDefaults")) { doc->begindefaults = beginsection; beginsection = 0; while (readline(line, sizeof line, file, &position, &line_len) && !(DSCcomment(line) && iscomment(line+2, "EndDefaults"))) { section_len += line_len; if (!DSCcomment(line)) { /* Do nothing */ } else if (doc->default_page_orientation == NONE && iscomment(line+2, "PageOrientation:")) { sscanf(line+lengthOfString("%%PageOrientation:"), "%s", text); if (strcmp(text, "Portrait") == 0) { doc->default_page_orientation = PORTRAIT; } else if (strcmp(text, "Landscape") == 0) { doc->default_page_orientation = LANDSCAPE; } } else if (page_media_set == NONE && iscomment(line+2, "PageMedia:")) { cp = gettext(line+lengthOfString("%%PageMedia:"), NULL); for (dmp = doc->media, i=0; inummedia; i++, dmp++) { if (strcmp(cp, dmp->name) == 0) { doc->default_page_media = dmp; page_media_set = 1; break; } } free(cp); } else if (page_bb_set == NONE && iscomment(line+2, "PageBoundingBox:")) { if (sscanf(line+lengthOfString("%%PageBoundingBox:"), "%d %d %d %d", &(doc->default_page_boundingbox[LLX]), &(doc->default_page_boundingbox[LLY]), &(doc->default_page_boundingbox[URX]), &(doc->default_page_boundingbox[URY])) == 4) page_bb_set = 1; else { float fllx, flly, furx, fury; if (sscanf(line+lengthOfString("%%PageBoundingBox:"), "%f %f %f %f", &fllx, &flly, &furx, &fury) == 4) { page_bb_set = 1; doc->default_page_boundingbox[LLX] = (int)fllx; doc->default_page_boundingbox[LLY] = (int)flly; doc->default_page_boundingbox[URX] = (int)furx; doc->default_page_boundingbox[URY] = (int)fury; if (fllx < doc->default_page_boundingbox[LLX]) doc->default_page_boundingbox[LLX]--; if (flly < doc->default_page_boundingbox[LLY]) doc->default_page_boundingbox[LLY]--; if (furx > doc->default_page_boundingbox[URX]) doc->default_page_boundingbox[URX]++; if (fury > doc->default_page_boundingbox[URY]) doc->default_page_boundingbox[URY]++; } } } } section_len += line_len; readline(line, sizeof line, file, &position, &line_len); section_len += line_len; doc->enddefaults = position; doc->lendefaults = section_len - line_len; } /* Document Prolog */ if (beginsection == 0) { beginsection = position; section_len = line_len; } while (blank(line) && readline(line, sizeof line, file, &position, &line_len)) { section_len += line_len; } if (!(DSCcomment(line) && (iscomment(line+2, "BeginSetup") || iscomment(line+2, "Page:") || iscomment(line+2, "Trailer") || iscomment(line+2, "EOF")))) { doc->beginprolog = beginsection; beginsection = 0; preread = 1; while ((preread || readline(line, sizeof line, file, &position, &line_len)) && !(DSCcomment(line) && (iscomment(line+2, "EndProlog") || iscomment(line+2, "BeginSetup") || iscomment(line+2, "Page:") || iscomment(line+2, "Trailer") || iscomment(line+2, "EOF")))) { if (!preread) section_len += line_len; preread = 0; } section_len += line_len; if (DSCcomment(line) && iscomment(line+2, "EndProlog")) { readline(line, sizeof line, file, &position, &line_len); section_len += line_len; } doc->endprolog = position; doc->lenprolog = section_len - line_len; } /* Document Setup, Page Defaults found here for Version 2 files */ if (beginsection == 0) { beginsection = position; section_len = line_len; } while (blank(line) && readline(line, sizeof line, file, &position, &line_len)) { section_len += line_len; } if (!(DSCcomment(line) && (iscomment(line+2, "Page:") || iscomment(line+2, "Trailer") || iscomment(line+2, "EOF")))) { doc->beginsetup = beginsection; beginsection = 0; preread = 1; while ((preread || readline(line, sizeof line, file, &position, &line_len)) && !(DSCcomment(line) && (iscomment(line+2, "EndSetup") || iscomment(line+2, "Page:") || iscomment(line+2, "Trailer") || iscomment(line+2, "EOF")))) { if (!preread) section_len += line_len; preread = 0; if (!DSCcomment(line)) { /* Do nothing */ } else if (doc->default_page_orientation == NONE && iscomment(line+2, "PageOrientation:")) { sscanf(line+lengthOfString("%%PageOrientation:"), "%s", text); if (strcmp(text, "Portrait") == 0) { doc->default_page_orientation = PORTRAIT; } else if (strcmp(text, "Landscape") == 0) { doc->default_page_orientation = LANDSCAPE; } } else if (page_media_set == NONE && iscomment(line+2, "PaperSize:")) { cp = gettext(line+lengthOfString("%%PaperSize:"), NULL); for (dmp = doc->media, i=0; inummedia; i++, dmp++) { /* Note: Paper size comment uses down cased paper size * name. Case insensitive compares are only used for * PaperSize comments. */ if (strcasecmp(cp, dmp->name) == 0) { doc->default_page_media = dmp; page_media_set = 1; break; } } free(cp); } else if (page_bb_set == NONE && iscomment(line+2, "PageBoundingBox:")) { if (sscanf(line+lengthOfString("%%PageBoundingBox:"), "%d %d %d %d", &(doc->default_page_boundingbox[LLX]), &(doc->default_page_boundingbox[LLY]), &(doc->default_page_boundingbox[URX]), &(doc->default_page_boundingbox[URY])) == 4) page_bb_set = 1; else { float fllx, flly, furx, fury; if (sscanf(line+lengthOfString("%%PageBoundingBox:"), "%f %f %f %f", &fllx, &flly, &furx, &fury) == 4) { page_bb_set = 1; doc->default_page_boundingbox[LLX] = (int)fllx; doc->default_page_boundingbox[LLY] = (int)flly; doc->default_page_boundingbox[URX] = (int)furx; doc->default_page_boundingbox[URY] = (int)fury; if (fllx < doc->default_page_boundingbox[LLX]) doc->default_page_boundingbox[LLX]--; if (flly < doc->default_page_boundingbox[LLY]) doc->default_page_boundingbox[LLY]--; if (furx > doc->default_page_boundingbox[URX]) doc->default_page_boundingbox[URX]++; if (fury > doc->default_page_boundingbox[URY]) doc->default_page_boundingbox[URY]++; } } } } section_len += line_len; if (DSCcomment(line) && iscomment(line+2, "EndSetup")) { readline(line, sizeof line, file, &position, &line_len); section_len += line_len; } doc->endsetup = position; doc->lensetup = section_len - line_len; } /* Individual Pages */ if (beginsection == 0) { beginsection = position; section_len = line_len; } while (blank(line) && readline(line, sizeof line, file, &position, &line_len)) { section_len += line_len; } newpage: while ((DSCcomment(line) && iscomment(line+2, "Page:")) || force_page==1) { if(force_page &&iscomment(line+2, "Trailer")) { seen_trailer=1; break; } if (maxpages == 0) { maxpages = 1; doc->pages = (struct page *) calloc(maxpages, sizeof(struct page)); if (doc->pages == NULL) { MSTKTHROWEXCEPTION(MSOutOfMemory("MSPostScriptView Out Of Memory.\n")); } } label = gettext(line+lengthOfString("%%Page:"), &next_char); if (sscanf(next_char, "%d", &thispage) != 1) thispage = 0; if (nextpage == 1) { ignore = thispage != 1; } if (!ignore && thispage != nextpage) { free(label); doc->numpages--; goto continuepage; } nextpage++; if (doc->numpages == maxpages) { maxpages++; doc->pages = (struct page *) realloc(doc->pages, maxpages*sizeof (struct page)); if (doc->pages == NULL) { MSTKTHROWEXCEPTION(MSOutOfMemory("MSPostScriptView Out Of Memory.\n")); } } memset(&(doc->pages[doc->numpages]), 0, sizeof(struct page)); page_bb_set = NONE; doc->pages[doc->numpages].label = label; if (beginsection) { doc->pages[doc->numpages].begin = beginsection; beginsection = 0; } else { doc->pages[doc->numpages].begin = position; section_len = line_len; } continuepage: while (readline(line, sizeof line, file, &position, &line_len) && !(DSCcomment(line) && (iscomment(line+2, "Page:") || iscomment(line+2, "Trailer") || iscomment(line+2, "PageTrailer") || iscomment(line+2, "EOF")))) { section_len += line_len; if (!DSCcomment(line)) { /* Do nothing */ } else if (doc->pages[doc->numpages].orientation == NONE && iscomment(line+2, "PageOrientation:")) { sscanf(line+lengthOfString("%%PageOrientation:"), "%s", text); if (strcmp(text, "Portrait") == 0) { doc->pages[doc->numpages].orientation = PORTRAIT; } else if (strcmp(text, "Landscape") == 0) { doc->pages[doc->numpages].orientation = LANDSCAPE; } } else if (doc->pages[doc->numpages].media == NULL && iscomment(line+2, "PageMedia:")) { cp = gettext(line+lengthOfString("%%PageMedia:"), NULL); for (dmp = doc->media, i=0; inummedia; i++, dmp++) { if (strcmp(cp, dmp->name) == 0) { doc->pages[doc->numpages].media = dmp; break; } } free(cp); } else if (doc->pages[doc->numpages].media == NULL && iscomment(line+2, "PaperSize:")) { cp = gettext(line+lengthOfString("%%PaperSize:"), NULL); for (dmp = doc->media, i=0; inummedia; i++, dmp++) { /* Note: Paper size comment uses down cased paper size * name. Case insensitive compares are only used for * PaperSize comments. */ if (strcasecmp(cp, dmp->name) == 0) { doc->pages[doc->numpages].media = dmp; break; } } free(cp); } else if ((page_bb_set == NONE || page_bb_set == ATEND) && iscomment(line+2, "PageBoundingBox:")) { sscanf(line+lengthOfString("%%PageBoundingBox:"), "%s", text); if (strcmp(text, "(atend)") == 0) { page_bb_set = ATEND; } else { if (sscanf(line+lengthOfString("%%PageBoundingBox:"), "%d %d %d %d", &(doc->pages[doc->numpages].boundingbox[LLX]), &(doc->pages[doc->numpages].boundingbox[LLY]), &(doc->pages[doc->numpages].boundingbox[URX]), &(doc->pages[doc->numpages].boundingbox[URY])) == 4) if (page_bb_set == NONE) page_bb_set = 1; else { float fllx, flly, furx, fury; if (sscanf(line+lengthOfString("%%PageBoundingBox:"), "%f %f %f %f", &fllx, &flly, &furx, &fury) == 4) { if (page_bb_set == NONE) page_bb_set = 1; doc->pages[doc->numpages].boundingbox[LLX] = (int)fllx; doc->pages[doc->numpages].boundingbox[LLY] = (int)flly; doc->pages[doc->numpages].boundingbox[URX] = (int)furx; doc->pages[doc->numpages].boundingbox[URY] = (int)fury; if (fllx < doc->pages[doc->numpages].boundingbox[LLX]) doc->pages[doc->numpages].boundingbox[LLX]--; if (flly < doc->pages[doc->numpages].boundingbox[LLY]) doc->pages[doc->numpages].boundingbox[LLY]--; if (furx > doc->pages[doc->numpages].boundingbox[URX]) doc->pages[doc->numpages].boundingbox[URX]++; if (fury > doc->pages[doc->numpages].boundingbox[URY]) doc->pages[doc->numpages].boundingbox[URY]++; } } } } } if(force_page && iscomment(line+2, "Trailer")) { seen_trailer=1; break; } force_page=0; section_len += line_len; doc->pages[doc->numpages].end = position; doc->pages[doc->numpages].len = section_len - line_len; doc->numpages++; } /**************************************************** * striv * This is added to try to understand certain types of EPSF * files which don't have %%Page comments. */ if(doc->epsf && seen_trailer==0) { force_page=1; goto newpage; } /**************************************************************/ /* Document Trailer */ if (beginsection) { doc->begintrailer = beginsection; beginsection = 0; } else { doc->begintrailer = position; section_len = line_len; } preread = 1; while ((preread || readline(line, sizeof line, file, &position, &line_len)) && !(DSCcomment(line) && iscomment(line+2, "EOF"))) { if (!preread) section_len += line_len; preread = 0; if (!DSCcomment(line)) { /* Do nothing */ } else if (iscomment(line+2, "Page:")) { free(gettext(line+lengthOfString("%%Page:"), &next_char)); if (sscanf(next_char, "%d", &thispage) != 1) thispage = 0; if (!ignore && thispage == nextpage) { if (doc->numpages > 0) { doc->pages[doc->numpages-1].end = position; doc->pages[doc->numpages-1].len += section_len - line_len; } else { if (doc->endsetup) { doc->endsetup = position; doc->endsetup += section_len - line_len; } else if (doc->endprolog) { doc->endprolog = position; doc->endprolog += section_len - line_len; } } goto newpage; } } else if (bb_set == ATEND && iscomment(line+2, "BoundingBox:")) { if (sscanf(line+lengthOfString("%%BoundingBox:"), "%d %d %d %d", &(doc->boundingbox[LLX]), &(doc->boundingbox[LLY]), &(doc->boundingbox[URX]), &(doc->boundingbox[URY])) != 4) { float fllx, flly, furx, fury; if (sscanf(line+lengthOfString("%%BoundingBox:"), "%f %f %f %f", &fllx, &flly, &furx, &fury) == 4) { doc->boundingbox[LLX] = (int)fllx; doc->boundingbox[LLY] = (int)flly; doc->boundingbox[URX] = (int)furx; doc->boundingbox[URY] = (int)fury; if (fllx < doc->boundingbox[LLX]) doc->boundingbox[LLX]--; if (flly < doc->boundingbox[LLY]) doc->boundingbox[LLY]--; if (furx > doc->boundingbox[URX]) doc->boundingbox[URX]++; if (fury > doc->boundingbox[URY]) doc->boundingbox[URY]++; } } } else if (orientation_set == ATEND && iscomment(line+2, "Orientation:")) { sscanf(line+lengthOfString("%%Orientation:"), "%s", text); if (strcmp(text, "Portrait") == 0) { doc->orientation = PORTRAIT; } else if (strcmp(text, "Landscape") == 0) { doc->orientation = LANDSCAPE; } } else if (page_order_set == ATEND && iscomment(line+2, "PageOrder:")) { sscanf(line+lengthOfString("%%PageOrder:"), "%s", text); if (strcmp(text, "Ascend") == 0) { doc->pageorder = ASCEND; } else if (strcmp(text, "Descend") == 0) { doc->pageorder = DESCEND; } else if (strcmp(text, "Special") == 0) { doc->pageorder = SPECIAL; } } else if (pages_set == ATEND && iscomment(line+2, "Pages:")) { if (sscanf(line+lengthOfString("%%Pages:"), "%*u %d", &i) == 1) { if (page_order_set == NONE) { if (i == -1) doc->pageorder = DESCEND; else if (i == 0) doc->pageorder = SPECIAL; else if (i == 1) doc->pageorder = ASCEND; } } } } section_len += line_len; if (DSCcomment(line) && iscomment(line+2, "EOF")) { readline(line, sizeof line, file, &position, &line_len); section_len += line_len; } doc->endtrailer = position; doc->lentrailer = section_len - line_len; #if 0 section_len = line_len; preread = 1; while (preread || readline(line, sizeof line, file, &position, &line_len)) { if (!preread) section_len += line_len; preread = 0; if (DSCcomment(line) && iscomment(line+2, "Page:")) { free(gettext(line+lengthOfString("%%Page:"), &next_char)); if (sscanf(next_char, "%d", &thispage) != 1) thispage = 0; if (!ignore && thispage == nextpage) { if (doc->numpages > 0) { doc->pages[doc->numpages-1].end = position; doc->pages[doc->numpages-1].len += doc->lentrailer + section_len - line_len; } else { if (doc->endsetup) { doc->endsetup = position; doc->endsetup += doc->lentrailer + section_len - line_len; } else if (doc->endprolog) { doc->endprolog = position; doc->endprolog += doc->lentrailer + section_len - line_len; } } goto newpage; } } } #endif _doc = doc; return MSTrue; } /* * psfree -- free dynamic storage associated with document structure. */ void MSPostScriptViewDocument::freeDoc(struct document *doc) { int i; if (doc) { for (i=0; inumpages; i++) { if (doc->pages[i].label) free(doc->pages[i].label); } for (i=0; inummedia; i++) { if (doc->media[i].name) free(doc->media[i].name); } if (doc->title) free(doc->title); if (doc->date) free(doc->date); if (doc->pages) free(doc->pages); if (doc->media) free(doc->media); free(doc); } } /* * gettextine -- skip over white space and return the rest of the line. * If the text begins with '(' return the text string * using gettext(). */ char *MSPostScriptViewDocument::gettextline(char *line) { char *cp; while (*line && (*line == ' ' || *line == '\t')) line++; if (*line == '(') { return gettext(line, NULL); } else { if (strlen(line) == 0) return NULL; cp = (char *) malloc(strlen(line)); if (cp == NULL) { MSTKTHROWEXCEPTION(MSOutOfMemory("MSPostScriptView Out Of Memory.\n")); } strncpy(cp, line, strlen(line)-1); cp[strlen(line)-1] = '\0'; return cp; } } /* * gettext -- return the next text string on the line. * return NULL if nothing is present. */ char * MSPostScriptViewDocument::gettext(char *line, char **next_char) { char text[PSLINELENGTH]; /* Temporary storage for text */ char *cp; int quoted=0; while (*line && (*line == ' ' || *line == '\t')) line++; cp = text; if (*line == '(') { int level = 0; quoted=1; line++; while (*line && !(*line == ')' && level == 0 )) { if (*line == '\\') { if (*(line+1) == 'n') { *cp++ = '\n'; line += 2; } else if (*(line+1) == 'r') { *cp++ = '\r'; line += 2; } else if (*(line+1) == 't') { *cp++ = '\t'; line += 2; } else if (*(line+1) == 'b') { *cp++ = '\b'; line += 2; } else if (*(line+1) == 'f') { *cp++ = '\f'; line += 2; } else if (*(line+1) == '\\') { *cp++ = '\\'; line += 2; } else if (*(line+1) == '(') { *cp++ = '('; line += 2; } else if (*(line+1) == ')') { *cp++ = ')'; line += 2; } else if (*(line+1) >= '0' && *(line+1) <= '9') { if (*(line+2) >= '0' && *(line+2) <= '9') { if (*(line+3) >= '0' && *(line+3) <= '9') { *cp++ = ((*(line+1) - '0')*8 + *(line+2) - '0')*8 + *(line+3) - '0'; line += 4; } else { *cp++ = (*(line+1) - '0')*8 + *(line+2) - '0'; line += 3; } } else { *cp++ = *(line+1) - '0'; line += 2; } } else { line++; *cp++ = *line++; } } else if (*line == '(') { level++; *cp++ = *line++; } else if (*line == ')') { level--; *cp++ = *line++; } else { *cp++ = *line++; } } } else { while (*line && !(*line == ' ' || *line == '\t' || *line == '\n')) *cp++ = *line++; } *cp = '\0'; if (next_char) *next_char = line; if (!quoted && strlen(text) == 0) return NULL; cp = (char *) malloc(strlen(text)+1); if (cp == NULL) { MSTKTHROWEXCEPTION(MSOutOfMemory("MSPostScriptView Out Of Memory.\n")); } strcpy(cp, text); return cp; } /* * readline -- Read the next line in the postScript file. * Automatically skip over data (as indicated by * %%BeginBinary/%%EndBinary or %%BeginData/%%EndData * comments.) * Also, skip over included documents (as indicated by * %%BeginDocument/%%EndDocument comments.) */ char * MSPostScriptViewDocument::readline(char *line, int size, FILE *fp, long *position, unsigned int *line_len) { char text[PSLINELENGTH]; /* Temporary storage for text */ char save[PSLINELENGTH]; /* Temporary storage for text */ char *cp; unsigned int num; unsigned int nbytes; int i; char buf[BUFSIZ]; if (position) *position = ftell(fp); cp = fgets(line, size, fp); if (cp == NULL) line[0] = '\0'; *line_len = strlen(line); if (!(DSCcomment(line) && iscomment(line+2, "Begin"))) { /* Do nothing */ } else if (iscomment(line+7, "Document:")) { strcpy(save, line+7); while (readline(line, size, fp, NULL, &nbytes) && !(DSCcomment(line) && iscomment(line+2, "EndDocument"))) { *line_len += nbytes; } *line_len += nbytes; strcpy(line, save); } else if (iscomment(line+7, "Feature:")) { strcpy(save, line+7); while (readline(line, size, fp, NULL, &nbytes) && !(DSCcomment(line) && iscomment(line+2, "EndFeature"))) { *line_len += nbytes; } *line_len += nbytes; strcpy(line, save); } else if (iscomment(line+7, "File:")) { strcpy(save, line+7); while (readline(line, size, fp, NULL, &nbytes) && !(DSCcomment(line) && iscomment(line+2, "EndFile"))) { *line_len += nbytes; } *line_len += nbytes; strcpy(line, save); } else if (iscomment(line+7, "Font:")) { strcpy(save, line+7); while (readline(line, size, fp, NULL, &nbytes) && !(DSCcomment(line) && iscomment(line+2, "EndFont"))) { *line_len += nbytes; } *line_len += nbytes; strcpy(line, save); } else if (iscomment(line+7, "ProcSet:")) { strcpy(save, line+7); while (readline(line, size, fp, NULL, &nbytes) && !(DSCcomment(line) && iscomment(line+2, "EndProcSet"))) { *line_len += nbytes; } *line_len += nbytes; strcpy(line, save); } else if (iscomment(line+7, "Resource:")) { strcpy(save, line+7); while (readline(line, size, fp, NULL, &nbytes) && !(DSCcomment(line) && iscomment(line+2, "EndResource"))) { *line_len += nbytes; } *line_len += nbytes; strcpy(line, save); } else if (iscomment(line+7, "Data:")) { text[0] = '\0'; strcpy(save, line+7); if (sscanf(line+lengthOfString("%%BeginData:"), "%d %*s %s", &num, text) >= 1) { if (strcmp(text, "Lines") == 0) { for (i=0; i < num; i++) { cp = fgets(line, size, fp); *line_len += cp ? strlen(line) : 0; } } else { while (num > BUFSIZ) { fread(buf, sizeof (char), BUFSIZ, fp); *line_len += BUFSIZ; num -= BUFSIZ; } fread(buf, sizeof (char), num, fp); *line_len += num; } } while (readline(line, size, fp, NULL, &nbytes) && !(DSCcomment(line) && iscomment(line+2, "EndData"))) { *line_len += nbytes; } *line_len += nbytes; strcpy(line, save); } else if (iscomment(line+7, "Binary:")) { strcpy(save, line+7); if(sscanf(line+lengthOfString("%%BeginBinary:"), "%d", &num) == 1) { while (num > BUFSIZ) { fread(buf, sizeof (char), BUFSIZ, fp); *line_len += BUFSIZ; num -= BUFSIZ; } fread(buf, sizeof (char), num, fp); *line_len += num; } while (readline(line, size, fp, NULL, &nbytes) && !(DSCcomment(line) && iscomment(line+2, "EndBinary"))) { *line_len += nbytes; } *line_len += nbytes; strcpy(line, save); } return cp; } /* * pscopy -- copy lines of Postscript from a section of one file * to another file. * Automatically switch to binary copying whenever * %%BeginBinary/%%EndBinary or %%BeginData/%%EndData * comments are encountered. */ void MSPostScriptViewDocument::pscopy(FILE *from, FILE *to, long begin, /* set negative to avoid initial seek */ long end) { char line[PSLINELENGTH]; /* 255 characters + 1 newline + 1 NULL */ char text[PSLINELENGTH]; /* Temporary storage for text */ unsigned int num; int i; char buf[BUFSIZ]; if (begin >= 0) fseek(from, begin, SEEK_SET); while (ftell(from) < end) { fgets(line, sizeof line, from); fputs(line, to); if(printPipeBroken==MSTrue) return; if (!(DSCcomment(line) && iscomment(line+2, "Begin"))) { /* Do nothing */ } else if (iscomment(line+7, "Data:")) { text[0] = '\0'; if (sscanf(line+lengthOfString("%%BeginData:"), "%d %*s %s", &num, text) >= 1) { if (strcmp(text, "Lines") == 0) { for (i=0; i < num; i++) { fgets(line, sizeof line, from); fputs(line, to); if(printPipeBroken==MSTrue) return; } } else { while (num > BUFSIZ) { fread(buf, sizeof (char), BUFSIZ, from); fwrite(buf, sizeof (char), BUFSIZ, to); if(printPipeBroken==MSTrue) return; num -= BUFSIZ; } fread(buf, sizeof (char), num, from); fwrite(buf, sizeof (char), num, to); if(printPipeBroken==MSTrue) return; } } } else if (iscomment(line+7, "Binary:")) { if(sscanf(line+lengthOfString("%%BeginBinary:"), "%d", &num) == 1) { while (num > BUFSIZ) { fread(buf, sizeof (char), BUFSIZ, from); fwrite(buf, sizeof (char), BUFSIZ, to); if(printPipeBroken==MSTrue) return; num -= BUFSIZ; } fread(buf, sizeof (char), num, from); fwrite(buf, sizeof (char), num, to); if(printPipeBroken==MSTrue) return; } } } } /* * pscopyuntil -- copy lines of Postscript from a section of one file * to another file until a particular comment is reached. * Automatically switch to binary copying whenever * %%BeginBinary/%%EndBinary or %%BeginData/%%EndData * comments are encountered. */ char *MSPostScriptViewDocument::pscopyuntil(FILE *from,FILE *to, long begin, /* set negative to avoid initial seek */ long end, const char *comment) { char line[PSLINELENGTH]; /* 255 characters + 1 newline + 1 NULL */ char text[PSLINELENGTH]; /* Temporary storage for text */ unsigned int num; int comment_length; int i; char buf[BUFSIZ]; char *cp; comment_length = strlen(comment); if (begin >= 0) fseek(from, begin, SEEK_SET); while (ftell(from) < end) { fgets(line, sizeof line, from); /* iscomment cannot be used here, * because comment_length is not known at compile time. */ if (strncmp(line, comment, comment_length) == 0) { cp = (char *) malloc(strlen(line)+1); if (cp == NULL) { MSTKTHROWEXCEPTION(MSOutOfMemory("MSPostScriptView Out Of Memory.\n")); } strcpy(cp, line); return cp; } fputs(line, to); if (!(DSCcomment(line) && iscomment(line+2, "Begin"))) { /* Do nothing */ } else if (iscomment(line+7, "Data:")) { text[0] = '\0'; if (sscanf(line+lengthOfString("%%BeginData:"), "%d %*s %s", &num, text) >= 1) { if (strcmp(text, "Lines") == 0) { for (i=0; i < num; i++) { fgets(line, sizeof line, from); fputs(line, to); if(printPipeBroken==MSTrue) return NULL; } } else { while (num > BUFSIZ) { fread(buf, sizeof (char), BUFSIZ, from); fwrite(buf, sizeof (char), BUFSIZ, to); if(printPipeBroken==MSTrue) return NULL; num -= BUFSIZ; } fread(buf, sizeof (char), num, from); fwrite(buf, sizeof (char), num, to); if(printPipeBroken==MSTrue) return NULL; } } } else if (iscomment(line+7, "Binary:")) { if(sscanf(line+lengthOfString("%%BeginBinary:"), "%d", &num) == 1) { while (num > BUFSIZ) { fread(buf, sizeof (char), BUFSIZ, from); fwrite(buf, sizeof (char), BUFSIZ, to); if(printPipeBroken==MSTrue) return NULL; num -= BUFSIZ; } fread(buf, sizeof (char), num, from); fwrite(buf, sizeof (char), num, to); if(printPipeBroken==MSTrue) return NULL; } } } return NULL; } int MSPostScriptViewDocument::blank(char *line) { char *cp = line; while (*cp == ' ' || *cp == '\t') cp++; return *cp == '\n' || (*cp == '%' && (line[0] != '%' || line[1] != '%')); } aplus-fsf-4.22/src/MSGUI/At.H0000644000265000001440000000404610772770417011166 #ifndef AtHEADER #define AtHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MSDefinesHEADER #include #endif #include #include class MSGUIExport At { public: enum {Default=0, Left=1, // "l" Right=2, // "r" Top=4, // "t" Bottom=8, // "b" MinimizeWidth=16, // "w" MinimizeHeight=32, // "h" MaintainWidth=64, // "W" MaintainHeight=128 // "H" }; private: int _row; int _column; int _rowSpan; int _columnSpan; unsigned long _constraints; MSString parseConstraints(unsigned long) const; unsigned long parseConstraints(const char *) const; void parseString(const char *, int); public: At(void); At(int row_,int col_,int rowSpan_,int columnSpan_,unsigned long constraints_=0); At(int row_,int col_,int rowSpan_,int columnSpan_,const char *constraints_); At(const At&); At(const MSString&); // "row col rowSpan colSpan whHW" At(const char *); ~At(void); int row(void) const; int column(void) const; int rowSpan(void) const; int columnSpan(void) const; unsigned long constraints(void) const; MSString parsedConstraints(void) const; MSString asString(void) const; void row(int row_); void column(int col_); void rowSpan(int span_); void columnSpan(int span_); void constraints(unsigned long constraints_); void constraints(const char *constraints_); void at(int row_,int col_,int rowSpan_,int columnSpan_,unsigned long constraints_=0); void at(int row_,int col_,int rowSpan_,int columnSpan_,const char *constraints_); MSBoolean operator==(const At&); MSBoolean operator!=(const At&); At& operator=(const At&); }; #endif aplus-fsf-4.22/src/MSGUI/MSActionBox.H0000644000265000001440000000342410772770417012747 #ifndef MSActionBoxHEADER #define MSActionBoxHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include class MSActionButton; class MSGUIExport MSActionBox : public MSLayout { friend class MSActionButton; public: MSActionBox(MSWidget *,const char *title_=0); MSActionBox(MSWidget *,const MSStringVector&); ~MSActionBox(void); const MSActionButton *activeButton(void) const; MSActionButton *activeButton(void); const MSActionButton *button(const MSSymbol&) const; MSActionButton *button(const MSSymbol&); const MSActionButton *button(int) const; MSActionButton *button(int); MSSymbolVector symbolicState(void) const; MSIntVector integerState(void) const; unsigned alignment(void) const; void alignment(unsigned); virtual void activate(void); virtual const MSSymbol& widgetType(void) const; virtual MSAttrValueList& get(MSAttrValueList&); virtual void set(MSAttrValueList&); protected: MSActionButton *_activeButton; void init(void); virtual void placement(void); virtual void activate(MSActionButton *); virtual void updateBackground(unsigned long); virtual void updateFont(Font); virtual void childDestroy(MSWidget *); static const MSSymbol& symbol(void); }; inline MSActionButton *MSActionBox::activeButton(void) { return _activeButton; } inline const MSActionButton *MSActionBox::activeButton(void) const { return _activeButton; } #endif aplus-fsf-4.22/src/MSGUI/MSActionButton.H0000644000265000001440000000462010772770417013471 #ifndef MSActionButtonHEADER #define MSActionButtonHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSActionBox; class MSGUIExport MSActionButton : public MSButton, public MSBoolView { friend class MSActionBox; public: MSActionButton(MSWidget *,const char *label_, const MSSymbol& tag_=MSSymbol::nullSymbol()); MSActionButton(MSWidget *,const MSStringVector& label_, const MSSymbol& tag_=MSSymbol::nullSymbol()); MSActionButton(MSWidget *,const MSPixmap &pixmap_,const MSPixmap &insensitivePixmap_, const MSPixmap &armedPixmap_,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSActionButton(MSWidget *,const char *label_,int integerTag_); MSActionButton(MSWidget *,const MSStringVector& label_,int integerTag_); MSActionButton(MSWidget *,const MSPixmap &pixmap_,const MSPixmap &insensitivePixmap_, const MSPixmap &armedPixmap_,int integerTag_); ~MSActionButton(void); const MSSymbol& tag(void) const; void tag(const MSSymbol&); int integerTag(void) const; void integerTag(int); MSBoolean state(void) const; void state(MSBoolean); virtual void redraw(void); virtual MSAttrValueList& get(MSAttrValueList&); virtual void set(MSAttrValueList&); protected: MSSymbol _tag; int _integerTag; MSActionBox *actionBox(void) const; void init(void); void setArmState(void); void setDisarmState(void); void defaultActivate(void); void actionBoxActivate(void); virtual void arm(void); virtual void disarm(void); virtual void activate(void); virtual void change(void); virtual void drawSymbol(void); // Arrow Key Traversal virtual void up(void); virtual void down(void); virtual void left(void); virtual void right(void); virtual void newBoolModelNotify(void); virtual void boolModelChanged(MSEvent &); }; inline MSBoolean MSActionButton::state(void) const { return _armed; } inline const MSSymbol& MSActionButton::tag(void) const { return _tag; } inline int MSActionButton::integerTag(void) const { return _integerTag; } #endif aplus-fsf-4.22/src/MSGUI/MSApplication.H0000644000265000001440000000560410772770417013326 #ifndef MSApplicationHEADER #define MSApplicationHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include class MSApplication; class ServerList; class WidgetDestructionQueue; // a custom mainloop for mstk applications // basically we add in deletequeue processing // which provides safe widget destruction in the // face of client callbacks class MSGUIExport MSApplicationMainLoop : public MSMainLoop { public: MSApplicationMainLoop(MSApplication *pApplication_); ~MSApplicationMainLoop(void); protected: MSApplication *_application; MSApplication *application(void); virtual MSBoolean flush(void); virtual void userProcessing(void); virtual void terminateLoop(void); }; class MSGUIExport MSApplication { friend class MSDisplayServer; friend MSGUIExport MSBoolean applicationAddServer(MSDisplayServer *); friend MSGUIExport MSBoolean applicationRemoveServer(MSDisplayServer *); public: MSApplication(void); MSApplication(int argc_,char **argv_); virtual ~MSApplication(void); static void quit(void); static void flushAndProcess(MSBoolean blocking_=MSFalse); static MSBoolean flush(void); static void backingStoreOption(MSBoolean); static void continueLoop(MSBoolean); static void doubleClickInterval(unsigned long); static MSApplication *application(void); static MSBoolean backingStoreOption(void); static MSBoolean continueLoop(void); static unsigned long doubleClickInterval(void); static MSMainLoop *mainLoop(void); static unsigned numberOfServerConnections(void); static MSDisplayServer *server(Display *); static MSString version(void); static void processWidgetDestructionQueue(void); static void allowWidgetDestruction(MSBoolean); static MSBoolean allowWidgetDestruction(void); static void addToWidgetDestructionQueue(MSWidget *); static const MSString& argument(unsigned); static const MSStringVector& argumentList(void); static MSString argumentString(void); virtual void loop(void); virtual void terminateLoop(void); protected: static MSApplication *_application; static MSMainLoop *_mainLoop; static unsigned long _doubleClickInterval; static MSBoolean _backingStoreOption; static WidgetDestructionQueue *_widgetDestructionQueue; static ServerList *_serverList; static MSStringVector _argumentList; void init(int argc_,char **argv_); static MSBoolean addServer(MSDisplayServer *); static MSBoolean removeServer(MSDisplayServer *); #ifdef MS_WINDOWS static MSWidget *findWidget(Window); #endif }; #endif aplus-fsf-4.22/src/MSGUI/MSArrayView.H0000644000265000001440000002044610772770417012775 #ifndef MSArrayViewHEADER #define MSArrayViewHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSGUIExport MSArrayView : public MSRowColumnView { public: MSArrayView(MSWidget *,const char *title_=0); MSArrayView(MSWidget *,const MSStringVector&); ~MSArrayView(void); int fixedColumns(void) const; void fixedColumns(int); int rowSeparator(void) const; void rowSeparator(int); int columnSeparator(void) const; void columnSeparator(int); int columnWidth(void) const; void columnWidth(int); void selectedRowColumn(int,int); int selectedColumn(void) const; void selectedColumn(int); unsigned long selectedCellBackground(void) const; void selectedCellBackground(unsigned long pixel_); void selectedCellBackground(const char *color_); virtual void set(MSAttrValueList& avList_); virtual MSAttrValueList& get(MSAttrValueList& avList_); virtual void left(void); virtual void right(void); virtual void tab(void); virtual void shiftTab(void); virtual void doubleClick(void); virtual MSBoolean editorActivate(void); virtual MSString selection(void); protected: MSPixmap *_stipple; //Attributes int _fixedColumns; int _rowSeparator; int _columnSeparator; int _columnWidth; int _selectedColumn; unsigned long _selectBg; // selected cell background void init(void); int computeMaxTextLength(const XFontStruct *,const char *,int,int); virtual void updateView(void); virtual void adjustView(void); virtual void updateHsb(void); virtual void updateVsb(void); virtual void redrawImmediately(void); virtual void adjustNumVisible(void); virtual void adjustFirstColumn(void); virtual void adjustSelection(void); virtual void defaultNumVisible(void); virtual int computeNumVisibleColumns(void); virtual int computeNumVisibleRows(void); virtual int computeXCoord(int column_); virtual void shapeUpdate(void); virtual void appendUpdate(void); virtual void createCycle(int,int); virtual void cycleRowColumn(int,int); virtual void cycleRow(int); virtual void cycleColumn(int); virtual void cycleCell(MSColorCycle *); virtual void drawCycle(MSColorCycle *); virtual void drawCycle(int,int,int,int,unsigned long,MSCycleColorMode); virtual void drawRowColumn(int,int); virtual void drawColumn(int); virtual void drawRow(int); virtual void drawRow(Window,int); virtual void drawRows(int,int); virtual void drawRows(Window,int,int); virtual void drawRows(int,int,int,int); virtual void drawRows(Window,int,int,int,int); virtual void drawCell(Window,int,int,int,int); virtual void drawCell(Window,int,int,int,int,unsigned long,unsigned long,Font, MSBoolean,MSBoolean,MSBoolean); virtual void clearRowColumn(int,int); virtual void clearRows(int,int); virtual void clearRows(int,int,int,int); virtual void clearRow(int); virtual void drawHeadings(Window); virtual void drawHeadings(Window,int,int); virtual void drawLabels(int,int); virtual void drawLabels(Window,int,int); virtual void drawHSeparators(Window,int,int,int,int); virtual void drawVSeparators(Window,int,int,int,int); virtual void cleanUpBottom(Window); virtual void cleanUpRight(Window); virtual void cleanUpDrawArea(Window); virtual void drawSelectBevel(MSRect&,MSBoolean); virtual void drawSelectedCell(Window,int,int,MSBoolean); virtual void drawSelectedCell(Window,int,int); virtual void undrawSelectedCell(Window,int,int); virtual void drawSelectedRow(Window,int,MSBoolean); virtual void drawSelectedRow(Window,int); virtual void drawSelectedRow(int); virtual void drawSelectedRow(int,MSBoolean); virtual void undrawSelectedRow(int); virtual void undrawSelectedRow(Window,int); virtual void setSelection(int,int); virtual void moveSelection(int,int); virtual void moveEditorToSelection(const MSString &); virtual int xToColumn(int); virtual int inColRange(int column_); virtual int columnFromEvent(const XEvent *); MSBoolean needRowSep(int row_); MSBoolean needColSep(int column_); virtual void defaultButtonBehavior(const XEvent *); virtual void headingLabelAreaSelection(const XEvent *); virtual void headingAreaSelection(const XEvent *); virtual void labelAreaSelection(const XEvent *); virtual void dataAreaSelection(const XEvent *); virtual void startEditing(const XEvent *); virtual void focusIn(void); virtual void focusOut(void); virtual MSBoolean loseFocus(void); virtual void rowColumnSelection(void); virtual void labelSelection(void); virtual void columnSelection(void); virtual void columnMenuButtonSelection(void); virtual int labelWidth(void); virtual int drawWidth(void); virtual int drawHeight(void); virtual int fixedColumnPixelWidth(void); virtual int columnPixelWidth(int); virtual unsigned columnLength(unsigned); virtual int lastColumn(void); virtual void scrollRight(int); virtual void scrollLeft(int); virtual void postVerticalScrollDraw(int,int,MSBoolean); virtual void drawSelected(int); virtual void undrawSelected(int); virtual void trackSelection(int,int,MSBoolean clear_,MSBoolean shifted_); virtual void trackUnselection(int,int); virtual void hsbValueUpdate(void); virtual void vsbValueUpdate(void); virtual void update(const MSIndexVector&); virtual void updateInternalState(void); virtual void calculateRowHeight(void); virtual void drawFixedColumns(Window,int,int); // Added to support column grouping virtual int columnHeadingsOffset(void); virtual void redrawHeadings(Window,int,int); // The following methods are called in response to public attribute changes virtual void updateFirstRow(int); virtual void updateFirstColumn(int); virtual void updateSelectionVector(const MSIndexVector&); virtual void updateSelectedRow(int); virtual void updateSelectedColumn(int); virtual void updateSensitivity(void); // The following methods are meant to be overriden by subclasses with // non-homogeneous columns virtual const XFontStruct *columnFontStruct(unsigned); virtual unsigned long columnBackground(unsigned); virtual unsigned long columnForeground(unsigned); virtual MSClipMode columnClipMode(unsigned) const; virtual unsigned columnEditWidth(unsigned); virtual unsigned columnNumRows(unsigned) const; // The following methods return the appropriate values for drawing. // The row and column parameters passed are based on the view. // These methods take care of the mapping from row/column indices // of the view to the indices of the model. // Subclasses should not have to overide these methods. virtual const char *viewFormatOutput(MSString &,unsigned,unsigned); virtual MSBoolean viewValidate(const char *,unsigned,unsigned); virtual MSBoolean isViewProtected(unsigned,unsigned); virtual MSBoolean isViewValid(unsigned,unsigned); virtual unsigned long viewCellForeground(unsigned,unsigned); virtual unsigned long viewCellBackground(unsigned,unsigned); virtual Font viewCellFont(unsigned,unsigned); virtual MSAlignment viewCellAlignment(unsigned,unsigned); // The following methods return the appropriate values for drawing. // The row and column parameters passed are based on the model. // Subclasses may override these methods to fine tune their displays. virtual const char *formatOutput(MSString &,unsigned,unsigned); virtual MSBoolean validate(const char *,unsigned,unsigned); virtual MSBoolean isValid(unsigned,unsigned); virtual unsigned long cellForeground(unsigned,unsigned); virtual unsigned long cellBackground(unsigned,unsigned); virtual Font cellFont(unsigned,unsigned); virtual MSAlignment cellAlignment(unsigned,unsigned); virtual MSBoolean isCellProtected(unsigned,unsigned); //For backward compatibility only. virtual MSBoolean isProtected(unsigned,unsigned); virtual MSBoolean isProtected(void) const; }; #ifndef MS_NO_INLINES #ifndef MSArrayViewINLINES #include #endif #endif #endif aplus-fsf-4.22/src/MSGUI/MSArrow.H0000644000265000001440000000445010772770420012145 #ifndef MSArrowHEADER #define MSArrowHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSGUIExport MSArrow : public MSRect { public: enum ArrowType {Left,Right,Up,Down}; MSArrow(MSWidgetCommon *); MSArrow(MSWidgetCommon *,ArrowType); ~MSArrow(void); void owner(MSWidgetCommon *); void type(ArrowType); void draw(void); void resize(void); void resize(int w_,int h_); void configure(int x_,int y_,int w_,int h_); void moveTo(int x_,int y_); void y_origin(int); void x_origin(int); void select(MSBoolean); MSBoolean selected(void) const; ArrowType arrowType(void) const; MSWidgetCommon *owner(void) const; int topCount(void) const; int centerCount(void) const; int bottomCount(void) const; void color(unsigned long); void color(const char *); unsigned long color(void) const; protected: MSWidgetCommon *_owner; ArrowType _arrowType; MSBoolean _selected; int _topCount; int _centerCount; int _bottomCount; XRectangle *_top; XRectangle *_center; XRectangle *_bottom; MSShadow *_pShadow; MSShadow& shadow(void); const MSShadow& shadow(void) const; void init(void); void computeSize(void); void computeArrowRects(void); void offsetArrow(int,int); Display *display(void) const; Window window(void) const; }; inline void MSArrow::select(MSBoolean s) { _selected=s; draw(); } inline MSBoolean MSArrow::selected(void) const { return _selected; } inline MSArrow::ArrowType MSArrow::arrowType(void) const { return _arrowType; } inline int MSArrow::topCount(void) const { return _topCount; } inline int MSArrow::centerCount(void) const { return _centerCount; } inline int MSArrow::bottomCount(void) const { return _bottomCount; } inline void MSArrow::resize(void) { computeSize(); } inline MSWidgetCommon *MSArrow::owner(void) const { return _owner; } inline Display *MSArrow::display(void) const { return owner()->display(); } inline Window MSArrow::window(void) const { return owner()->window(); } #endif aplus-fsf-4.22/src/MSGUI/MSArrowButton.H0000644000265000001440000000421710772770420013342 #ifndef MSArrowButtonHEADER #define MSArrowButtonHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include class MSGUIExport MSArrowButton : public MSWidgetCommon { protected: class MSGUIExport MSArrowTimer : public MSIntervalTimer { protected: MSArrowButton *_owner; MSArrowButton *owner(void) {return _owner;} public: MSArrowTimer(unsigned long,MSArrowButton*); virtual void process(void); }; friend class MSArrowTimer; MSArrow *_arrow; MSArrowTimer *_arrowTimer; unsigned long _repeatInterval; unsigned long _repeatThreshold; MSArrow *arrow(void) {return _arrow;} const MSArrow *arrow(void) const {return _arrow;} MSArrowTimer *arrowTimer(void) {return _arrowTimer;} virtual void configure(void); virtual void computeSize(void); virtual void firstMapNotify(void); virtual void buttonPress(const XEvent *); virtual void button1Press(const XEvent *); virtual void buttonRelease(const XEvent *); virtual void button1Release(const XEvent *); virtual void updateBackground(unsigned long); virtual void activate(void); void init(void); public: MSArrowButton(MSWidget *owner_); MSArrowButton(MSWidget *owner_,MSArrow::ArrowType); ~MSArrowButton(void); void type(MSArrow::ArrowType); MSArrow::ArrowType type(void) const {return arrow()->arrowType();} unsigned long repeatThreshold(void) const {return _repeatThreshold;} void repeatThreshold(unsigned long); unsigned long repeatInterval(void) const {return _repeatInterval;} void repeatInterval(unsigned long); unsigned long arrowColor(void) const { return arrow()->color();} void arrowColor(unsigned long); void arrowColor(const char * ); virtual void naturalSize(void); virtual void redraw(void); virtual void set(MSAttrValueList&); virtual MSAttrValueList& get(MSAttrValueList&); }; #endif aplus-fsf-4.22/src/MSGUI/MSAttrValue.H0000644000265000001440000001222710772770420012763 #ifndef MSAttrValueHEADER #define MSAttrValueHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include class MSDisplayServer; #if HAVE_IOSTREAM #include #else class ostream; using namespace std; #endif class MSGUIExport MSAttrValue { public: enum ValueType {Any =0, String =0x0001, /* Generated code must use quotes. */ Char =0x0002, /* Generated code must use single quotes. */ StringVector =0x0004, /* Generated code must cast to StringVector. */ List =0x0008, /* Multiple selection option */ Callback =0x0010, /* Callback attribute */ ReadOnly =0x0020, /* Ignored by prototyper, used by save/loadState */ Font =0x0041, /* Font attribute. implies String */ Color =0x0081, /* Color attribute. implies String */ ChildAttribute=0x0100, /* Parent's attribute applies to children */ Chooser1 =0x0200, /* Attribute which is a chooser in first arg */ Chooser2 =0x0400, /* Attribute which is a chooser in second arg */ Chooser =0x0600, /* Chooser1|Chooser2 for masking. */ Control =0x0800, /* This is control attribute don't save/load or display */ Reserved1 =0x1000, /* Reserved for future use */ Reserved2 =0x2000, /* Reserved for future use */ Reserved3 =0x4000, /* Reserved for future use */ Reserved4 =0x8000 /* Reserved for future use */ }; MSAttrValue(void); MSAttrValue(const MSAttrValue&); MSAttrValue(const char *attribute_,const char *value_,unsigned long valueType_=Any); MSAttrValue(const char *attribute_,const MSString& value_,unsigned long valueType_=Any); MSAttrValue(const MSString& attribute_,const char *value_,unsigned long valueType_=Any); MSAttrValue(const MSString& attribute_,const MSString& value_,unsigned long valueType_=Any); MSAttrValue(const MSString& attribute_,const MSString& value_, const MSStringVector& options_,unsigned long valueType_=Any); MSAttrValue(const MSString& attribute_, const MSStringVector& values_, const MSStringVector& options_, const MSStringVector& chooserOptions_); ~MSAttrValue(void); const MSString& attribute(void) const; const MSString& value(void) const; const MSStringVector& options(void) const; unsigned long valueType(void) const; MSAttrValue& operator=(const MSAttrValue&); friend MSGUIExport ostream& operator<<(ostream& aStream_,const MSAttrValue& aAttrValue_); static MSString alignmentToString(unsigned long); static unsigned long stringToAlignment(const MSString&); static MSString stringVectorToString(const MSStringVector&); static MSStringVector stringToStringVector(const MSString&); static MSString colorVectorToString(const MSUnsignedLongVector&, MSDisplayServer *); static MSString shadowStyleToString(MSShadowStyle); static MSShadowStyle stringToShadowStyle(const MSString &); static MSString lineStyleToString(MSLineStyle); static MSLineStyle stringToLineStyle(const MSString &); static MSString enumToString(unsigned long,const MSStringVector&,const MSUnsignedLongVector&, const MSString& empty_="",MSBoolean exact_=MSFalse); static unsigned long stringToEnum(const MSString&,const MSStringVector&,const MSUnsignedLongVector&, unsigned long empty_=0,MSBoolean exact_=MSFalse); private: MSString _attribute; MSString _value; MSStringVector _options; unsigned long _valueType; }; inline const MSString& MSAttrValue::attribute(void) const { return _attribute; } inline const MSString& MSAttrValue::value(void) const { return _value; } inline const MSStringVector& MSAttrValue::options(void) const { return _options; } inline unsigned long MSAttrValue::valueType(void) const { return _valueType; } class MSGUIExport MSAttrValueList { public: MSAttrValueList(void); ~MSAttrValueList(void); unsigned size(void) const; unsigned length(void) const; const MSAttrValue& operator[](unsigned i_) const; friend MSGUIExport MSAttrValueList& operator<<(MSAttrValueList&,const MSAttrValue&); MSAttrValueList& remove(unsigned); MSAttrValueList& remove(const MSIndexVector&); MSAttrValueList& removeAll(void); friend MSGUIExport ostream& operator<<(ostream& aStream_,const MSAttrValueList& avList_); private: MSAttrValue *_array; unsigned _size; unsigned _length; void add(const MSAttrValue&); void reserve(unsigned); }; inline unsigned MSAttrValueList::size(void) const { return _size; } inline unsigned MSAttrValueList::length(void) const { return _length; } inline const MSAttrValue& MSAttrValueList::operator[](unsigned index_) const { return _array[index_]; } #endif aplus-fsf-4.22/src/MSGUI/MSBackingStorePixmap.H0000644000265000001440000000223110772770420014600 #ifndef MSBackingStorePixmapHEADER #define MSBackingStorePixmapHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include class MSBackingStorePixmapData; class MSGUIExport MSBackingStorePixmap { public: MSBackingStorePixmap(MSDisplayServer *,const char *pName_); ~MSBackingStorePixmap(); void resize(int w_,int h_); void lock(void); void unlock(void); int width() const; int height() const; Pixmap pixmap(void) const; const MSString &name(void) const {return _name;} protected: #ifdef MS_MULTI_THREAD static MSMutex _hashTableMutex; #endif static int _instanceCount; static MSHashTable *_pPixmapHashTable; MSBackingStorePixmapData *_pData; int _id; MSString _name; void init(void); int id(void) const { return _id; } }; #endif aplus-fsf-4.22/src/MSGUI/MSBitmaps.H0000644000265000001440000000751110772770420012453 #ifndef MSBitmapsHEADER #define MSBitmapsHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// static unsigned char MSBitmaps[20][32] = { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/* Solid Background */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, { 0x88,0x88,0x22,0x22,0x88,0x88,0x22,0x22, /* 25 percent */ 0x88,0x88,0x22,0x22,0x88,0x88,0x22,0x22, 0x88,0x88,0x22,0x22,0x88,0x88,0x22,0x22, 0x88,0x88,0x22,0x22,0x88,0x88,0x22,0x22 }, { 0x55,0x55,0xAA,0xAA,0x55,0x55,0xAA,0xAA, /* 50 percent */ 0x55,0x55,0xAA,0xAA,0x55,0x55,0xAA,0xAA, 0x55,0x55,0xAA,0xAA,0x55,0x55,0xAA,0xAA, 0x55,0x55,0xAA,0xAA,0x55,0x55,0xAA,0xAA }, { 0x55,0x55,0xFF,0xFF,0xAA,0xAA,0xFF,0xFF, /* 75 percent */ 0x55,0x55,0xFF,0xFF,0xAA,0xAA,0xFF,0xFF, 0x55,0x55,0xFF,0xFF,0xAA,0xAA,0xFF,0xFF, 0x55,0x55,0xFF,0xFF,0xAA,0xAA,0xFF,0xFF }, { 0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55, /* Vertical */ 0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55, 0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55, 0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55 }, { 0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00, /* Horizontal */ 0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00, 0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00, 0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00 }, { 0x77,0x77,0xbb,0xbb,0xdd,0xdd,0xee,0xee, /* Slant Left */ 0x77,0x77,0xbb,0xbb,0xdd,0xdd,0xee,0xee, 0x77,0x77,0xbb,0xbb,0xdd,0xdd,0xee,0xee, 0x77,0x77,0xbb,0xbb,0xdd,0xdd,0xee,0xee }, { 0xee,0xee,0xdd,0xdd,0xbb,0xbb,0x77,0x77, /* Slant Right */ 0xee,0xee,0xdd,0xdd,0xbb,0xbb,0x77,0x77, 0xee,0xee,0xdd,0xdd,0xbb,0xbb,0x77,0x77, 0xee,0xee,0xdd,0xdd,0xbb,0xbb,0x77,0x77 }, { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/* Default Cascade */ 0x00,0x03,0x00,0x06,0x00,0x0c,0x00,0x18, 0xff,0x3f,0x00,0x18,0x00,0x0c,0x00,0x06, 0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00 }, { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/* Default CheckMark */ 0x00,0x00,0x00,0x60,0x00,0x30,0x00,0x18, 0x00,0x0c,0x08,0x06,0x18,0x03,0xb0,0x01, 0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/* Default menu dash */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, { 0x00,0x00,0xf0,0x01,0xf8,0x03,0x1c,0x07, 0x0c,0x06,0x0c,0x06,0x0c,0x06,0x1c,0x07, 0xf8,0x03,0xf0,0x07,0x00,0x0e,0x00,0x1c, 0x00,0x38,0x00,0x70,0x00,0x60,0x00,0x00 },//mglass_ptr { 0x0f,0xfe,0x07,0xfc,0x03,0xf8,0x41,0xf0, 0xe1,0xf0,0xf1,0xf1,0xe1,0xf0,0x41,0xf0, 0x03,0xf8,0x07,0xf0,0x0f,0xe0,0xff,0xc1, 0xff,0x83,0xff,0x07,0xff,0x0f,0xff,0x1f },//mglass_ptr mask { 0x00,0x00,0xfc,0x3f,0xfc,0x3f,0x0c,0x30, 0x18,0x18,0x30,0x0c,0x60,0x06,0xc0,0x03, 0xc0,0x03,0x60,0x06,0x30,0x0c,0x18,0x18, 0x0c,0x30,0xfc,0x3f,0xfc,0x3f,0x00,0x00 },//hglass_ptr { 0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80, 0xc3,0xc3,0x87,0xe1,0x0f,0xf0,0x1f,0xf8, 0x1f,0xf8,0x0f,0xf0,0x87,0xe1,0xc3,0xc3, 0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80 } //hglass_ptr mask }; static char *MSBitmapNameSet[] = { "background", "25_foreground", "50_foreground", "75_foreground", "vertical", "horizontal", "slant_right", "slant_left", "menu_cascade", "menu_checkmark", "menu_dash", "mglass_ptr", "mglass_ptrMask", "hglass_ptr", "hglass_ptrMask", NULL }; #endif aplus-fsf-4.22/src/MSGUI/MSBoolEntryField.H0000644000265000001440000000265310772770420013737 #ifndef MSBoolEntryFieldHEADER #define MSBoolEntryFieldHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSGUIExport MSBoolEntryField : public MSEntryFieldPlus { protected: virtual MSBoolean validate(const char *); virtual const char *formatOutput(MSString &); virtual void increment(void); virtual void decrement(void); MSBool& getBool(void) const {return *((MSBool *)_model);} void setBool(const MSBool& bool_) const {if (MSView::model()!=0) getBool()=bool_;} void init(void); virtual void updateData(void); public: MSBoolEntryField(MSWidget *,const char *label_=0,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSBoolEntryField(MSWidget *,MSBool&,const char *label_=0,const MSSymbol& tag_=MSSymbol::nullSymbol()); ~MSBoolEntryField(void); void model(MSBool&); void model(const MSBool&); MSBool& viewModel(void) { return *((MSBool*)_model); } const MSBool& viewModel(void) const { return *((MSBool*)_model); } MSBoolEntryField& operator=(const MSBool& bool_) {setBool(bool_); return *this;} operator MSBool&() {return getBool();} }; #endif aplus-fsf-4.22/src/MSGUI/MSBoolView.H0000644000265000001440000000145510772770420012603 #ifndef MSBoolViewHEADER #define MSBoolViewHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 199-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSBoolView : public MSEventReceiver { public: MSBoolView(void); virtual ~MSBoolView(void); void boolModel(MSBool &); MSBool &boolModel(void); protected: MSBool _internalBoolModel; MSBool *_boolModel; virtual void receiveEvent(MSEvent&); virtual void removeSenderNotify(MSEventSender *); virtual void newBoolModelNotify(void)=0; virtual void boolModelChanged(MSEvent &)=0; }; #endif aplus-fsf-4.22/src/MSGUI/MSBusy.H0000644000265000001440000000123710772770420011775 #ifndef MSBusyHEADER #define MSBusyHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSShell; class MSGUIExport MSShellBusy { public: MSShellBusy(MSShell *shell_); ~MSShellBusy(void); private: MSShell *_shell; }; class MSGUIExport MSApplicationBusy { public: MSApplicationBusy(void); ~MSApplicationBusy(void); static int count(void); private: static int _count; }; #endif aplus-fsf-4.22/src/MSGUI/MSButton.H0000644000265000001440000000345510772770420012332 #ifndef MSButtonHEADER #define MSButtonHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSGUIExport MSButton : public MSLabel { public: MSButton(MSWidget *); MSButton(MSWidget *,const char *); MSButton(MSWidget *,const MSStringVector&); MSButton(MSWidget *,const MSPixmap &pixmap_,const MSPixmap &insensitivePixmap_, const MSPixmap &armedPixmap_); ~MSButton(void); const MSPixmap *armedPixmap(void) const { return _armedPixmap; } void armedPixmap(const MSPixmap &); virtual void redraw(void); virtual MSAttrValueList& get(MSAttrValueList&); protected: MSBoolean _armed; MSPixmap *_armedPixmap; MSBoolean armed(void) const; void init(void); void createDefaultArmedPixmap(int,int,unsigned long,unsigned long); virtual void drawBackground(void); virtual void drawLabel(void); virtual void drawPixmap(void); virtual void arm(void); virtual void disarm(void); virtual void activate(void); virtual void key(KeySym,unsigned int,const char*); virtual void keyPress(const XEvent *,KeySym,unsigned int,const char*); virtual void buttonPress(const XEvent*); virtual void buttonRelease(const XEvent*); virtual void motionNotify(const XEvent*); virtual void button1Press(const XEvent*); virtual void button1Release(const XEvent*); virtual void updateSensitivity(void); virtual void updatePixmap(void); virtual void up(void); virtual void down(void); virtual void left(void); virtual void right(void); }; inline MSBoolean MSButton::armed(void) const { return _armed; } #endif aplus-fsf-4.22/src/MSGUI/MSCascadeMenu.H0000644000265000001440000000150410772770420013220 #ifndef MSCascadeMenuHEADER #define MSCascadeMenuHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSCascadeMenuItem; class MSGUIExport MSCascadeMenu : public MSMenu { protected: MSCascadeMenuItem *item(void) { return (MSCascadeMenuItem*)parentMenuItem(); } const MSCascadeMenuItem *item(void) const { return (MSCascadeMenuItem*)parentMenuItem(); } public: MSCascadeMenu(MSCascadeMenuItem *); ~MSCascadeMenu(void); virtual void activate(void); virtual void done(void); virtual void left(void); virtual void right(void); }; #endif aplus-fsf-4.22/src/MSGUI/MSCascadeMenuItem.H0000644000265000001440000000322610772770420014042 #ifndef MSCascadeMenuItemHEADER #define MSCascadeMenuItemHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSGUIExport MSCascadeMenuItem : public MSMenuItem { friend class MSCascadeMenu; protected: MSArrow *_arrow; MSCascadeMenu *_cascadeMenu; MSArrow *arrow(void) const { return _arrow; } void init(void); virtual MSMenu* cascadedMenu(void); virtual const MSMenu* cascadedMenu(void) const; void computeSize(void); void cascadeMenu(MSCascadeMenu *); virtual void computePixmapDrawingCoord(const MSPixmap *,int&,int&,int&,int&,int&,int&); virtual void drawSymbol(void); virtual void updateFont(Font); virtual void updateForeground(unsigned long); virtual void updateBackground(unsigned long); void menuDestroy(MSCascadeMenu *); virtual void menushow(void); virtual MSAttrValueList& get(MSAttrValueList&); public: MSCascadeMenuItem(MSMenu *); MSCascadeMenuItem(MSMenu *,const char *,char mnemonic_=0,int tag_=0); MSCascadeMenuItem(MSMenu *,const MSString&,char mnemonic_=0,int tag_=0); MSCascadeMenuItem(MSMenu *,const MSPixmap &pixmap_,const MSPixmap &insensitivePixmap_,int tag_=0); ~MSCascadeMenuItem(void); MSCascadeMenu *cascadeMenu(void) { return _cascadeMenu; } const MSCascadeMenu *cascadeMenu(void) const { return _cascadeMenu; } virtual void grab(void); virtual void arm(void); virtual void disarm(void); }; #endif aplus-fsf-4.22/src/MSGUI/MSCheckBox.H0000644000265000001440000000224110772770421012536 #ifndef MSCheckBoxHEADER #define MSCheckBoxHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSGUIExport MSCheckBox : public MSActionBox { friend class MSCheckButton; public: MSCheckBox(MSWidget *,const char *title_=0); MSCheckBox(MSWidget *,const MSStringVector&); ~MSCheckBox(void); MSIntVector integerState(void) const; void integerState(const MSIntVector &); MSSymbolVector symbolicState(void) const; void symbolicState(const MSSymbolVector &); virtual const MSSymbol& widgetType(void) const; protected: virtual void arm(MSCheckButton *); virtual void disarm(MSCheckButton *); static const MSSymbol& symbol(void); }; inline MSIntVector MSCheckBox::integerState(void) const { return MSActionBox::integerState(); } inline MSSymbolVector MSCheckBox::symbolicState(void) const { return MSActionBox::symbolicState(); } #endif aplus-fsf-4.22/src/MSGUI/MSCheckButton.H0000644000265000001440000000313410772770421013263 #ifndef MSCheckButtonHEADER #define MSCheckButtonHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSCheckBox; class MSGUIExport MSCheckButton : public MSToggleButtonBase { friend class MSCheckBox; public: MSCheckButton(MSWidget *,const char *label_,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSCheckButton(MSWidget *,const MSStringVector& label_,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSCheckButton(MSWidget *,const MSPixmap &pixmap_,const MSPixmap &insensitivePixmap_, const MSPixmap &armedPixmap_,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSCheckButton(MSWidget *,const char *label_,int integerTag_); MSCheckButton(MSWidget *,const MSStringVector& label_,int integerTag_); MSCheckButton(MSWidget *,const MSPixmap &pixmap_,const MSPixmap &insensitivePixmap_, const MSPixmap &armedPixmap_,int integerTag_); ~MSCheckButton(void); virtual MSAttrValueList& get(MSAttrValueList&); virtual void set(MSAttrValueList&); protected: void drawCheckButton(void); virtual void arm(void); virtual void disarm(void); virtual void drawSymbol(void); MSCheckBox *checkBox(void) const; virtual void checkBoxArm(void); virtual void checkBoxDisarm(void); // Arrow Key Traversal virtual void up(void); virtual void down(void); virtual void left(void); virtual void right(void); }; #endif aplus-fsf-4.22/src/MSGUI/MSCheckMenuItem.H0000644000265000001440000000277310772770421013543 #ifndef MSCheckMenuItemHEADER #define MSCheckMenuItemHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1998-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSGUIExport MSCheckMenuItem : public MSToggleMenuItem { protected: virtual void drawSymbol(void); virtual int symbolHeight(void) const; virtual int symbolWidth(void) const; public: MSCheckMenuItem(MSMenu *); MSCheckMenuItem(MSMenu *,const char *,char mnemonic_=0,int tag_=0); MSCheckMenuItem(MSMenu *,const MSString&,char mnemonic_=0,int tag_=0); MSCheckMenuItem(MSMenu *,const MSPixmap &pixmap_,const MSPixmap &insensitivePixmap_,int tag_=0); MSCheckMenuItem(MSMenu *,const MSString &,const MSPixmap &pixmap_,const MSPixmap &armedPixmap_, const MSPixmap &insensitivePixmap_,char mnemonic_=0,int tag_=0); MSCheckMenuItem(MSMenu *,const MSString &,const MSPixmap &pixmap_,const MSPixmap &armedPixmap_, char mnemonic_=0,int tag_=0); MSCheckMenuItem(MSMenu *,const char*,const MSPixmap &pixmap_,const MSPixmap &armedPixmap_, const MSPixmap &insensitivePixmap_,char mnemonic_=0,int tag_=0); MSCheckMenuItem(MSMenu *,const char*,const MSPixmap &pixmap_,const MSPixmap &armedPixmap_, char mnemonic_=0,int tag_=0); ~MSCheckMenuItem(void); }; #endif aplus-fsf-4.22/src/MSGUI/MSCheckPopupMenu.H0000644000265000001440000000205210772770421013736 #ifndef MSCheckPopupMenuHEADER #define MSCheckPopupMenuHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1999-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSCheckPopupMenu : public MSStringPopupMenu { protected: MSStringVector _selection; unsigned long _selectColor; virtual void updateData(void); virtual void receiveEvent(MSEvent&); virtual void activate(void); void resetSelection(void); void init(void); public: MSCheckPopupMenu(MSDisplayServer *); MSCheckPopupMenu(MSDisplayServer *,MSStringVector& aModel_); ~MSCheckPopupMenu(void); void selection(const MSStringVector &); const MSStringVector &selection(void) const { return _selection; } void selectColor(unsigned long); void selectColor(const char *); unsigned long selectColor(void) const { return _selectColor; } }; #endif aplus-fsf-4.22/src/MSGUI/MSCollapsibleLayout.H0000644000265000001440000000556110772770421014507 #ifndef MSCollapsibleLayoutHEADER #define MSCollapsibleLayoutHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1998-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSPixmap; class MSCollapsibleEntry; class MSGUIExport MSCollapsibleLayout : public MSWidgetCommon { public: MSCollapsibleLayout(MSWidget *); ~MSCollapsibleLayout(void); int childCount(void) const { return _childCount; } virtual MSWidgetVector children(void); void permuteWidgets(const MSWidgetVector &); void close(MSWidget*); void open(MSWidget*); MSBoolean isOpened(MSWidget*) const; MSBoolean isClosed(MSWidget*) const; void handleBackground(unsigned long); void handleBackground(const char *); unsigned long handleBackground() const; void handleForeground(unsigned long); void handleForeground(const char *); unsigned long handleForeground() const; void handleSize(int) ; int handleSize() const { return _handleSize; } void handleToolTip(MSWidget* , const MSStringVector &); const MSStringVector &handleToolTip(MSWidget*) const; virtual void show(void); virtual void print(const char *file_=0); virtual void unfreeze(); void set(MSAttrValueList&); MSAttrValueList& get(MSAttrValueList&); protected: virtual void visibilityUnobscured(void); virtual void visibilityObscured(void); virtual void placement(void); virtual void configure(void); virtual void childDestroy(MSWidget *); virtual void childInsert(MSWidget *); virtual void childCreate(MSWidget *); virtual void childRemove(MSWidget *); virtual void childMap(MSWidget *); virtual void childUnmap(MSWidget *); virtual void childConfigure(MSWidget *); virtual void firstMapNotify(void); virtual void naturalSize(void); virtual void childResizeConstraints(MSWidget *); virtual void computeSize(); virtual void entryOpened(); virtual void entryClosed(); private: MSNodeItem _childListHead; int _childCount; MSBoolean _internalEvent; MSBoolean naturalSizing; MSPixmap * _tile; unsigned long _handleBg; unsigned long _handleFg; int _handleSize; friend class MSCollapsibleEntry; void init(void); MSNodeItem *childListHead(void) { return &_childListHead; } const MSNodeItem *childListHead(void) const { return &_childListHead; } MSCollapsibleEntry *getEntry(MSWidget *) const; void natural(int&,int&,int&,int&); void doShownPlacement(int&,int&,int&); void doHiddenPlacement(); void internalEvent(MSBoolean); MSBoolean internalEvent(void); void updateHandleTile(); void hideConfigure(MSCollapsibleEntry*); }; #endif aplus-fsf-4.22/src/MSGUI/MSColorCycle.H0000644000265000001440000000335310772770421013113 #ifndef MSColorCycleHEADER #define MSColorCycleHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include class MSGUIExport MSColorCycle { private: MSWidget *_widget; int _row; int _column; unsigned _count; MSUnsignedLongVector _colors; MSCycleColorMode _mode; struct timeval _lastUpdate; public: MSColorCycle(MSWidget *widget_,int row_,int column_,const MSUnsignedLongVector& colors_, MSCycleColorMode mode_=MSForeground); ~MSColorCycle(void); int row(void) const { return _row; } int column(void) const { return _column; } unsigned count(void) const { return _count; } unsigned numCycles(void) const { return (mode()==MSReverseVideo)?1:_colors.length(); } const MSUnsignedLongVector& colors(void) const { return _colors; } MSCycleColorMode mode(void) const { return _mode; } MSWidget *widget(void) const { return _widget; } void increment(void) { _count++; } int long color(unsigned count_) const { return (count_<_colors.length())?_colors(count_):0; } void reset(void) {_count=0;} void mode(MSCycleColorMode mode_) {_mode=mode_;} const struct timeval &lastUpdate(void) const { return _lastUpdate; } void lastUpdate(struct timeval &lastUpdate_) { _lastUpdate=lastUpdate_; } }; #endif aplus-fsf-4.22/src/MSGUI/MSColorManager.H0000644000265000001440000000554410772770421013432 #ifndef MSColorManagerHEADER #define MSColorManagerHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSGUIExport MSColorManager { private: MSDisplayServer *_server; Colormap _cmap; MSHashTable _colorPixelHashTable; MSStringHashTable _colorStringHashTable; MSHashTable _rgbHashTable; unsigned long _defaultFg; unsigned long _defaultBg; MSBoolean _warned; MSBoolean _bestMatch; unsigned short _redCloseness; unsigned short _greenCloseness; unsigned short _blueCloseness; MSBoolean warned(void) const {return _warned;} MSHashTable& colorPixelHashTable(void) { return _colorPixelHashTable; } MSStringHashTable& colorStringHashTable(void) { return _colorStringHashTable; } MSHashTable& rgbHashTable(void) { return _rgbHashTable; } const MSHashTable& colorPixelHashTable(void) const { return _colorPixelHashTable; } const MSStringHashTable& colorStringHashTable(void) const { return _colorStringHashTable; } const MSHashTable& rgbHashTable(void) const { return _rgbHashTable; } MSBoolean matchColor(XColor &color_); void bestMatchWarning(const char *); void cacheColor(const char *,unsigned long); void init(void); public: MSColorManager(void); MSColorManager(MSDisplayServer&); ~MSColorManager(void); MSDisplayServer *server(void) const { return _server; } Colormap colormap(void) const { return _cmap; } Display *display(void) const { return server()->display(); } unsigned long notFound(void) const { return colorPixelHashTable().notFound(); } unsigned long defaultFg(void) const { return _defaultFg; } unsigned long defaultBg(void) const { return _defaultBg; } unsigned long addColor(const char *color_); unsigned long pixel(const char *color_); const char *colorName(unsigned long pixel_) const; void query(XColor *) const; MSBoolean allocate(XColor *); void bestMatch(MSBoolean bestMatch_) { _bestMatch=bestMatch_; } MSBoolean bestMatch(void) const { return _bestMatch; } void redCloseness(unsigned short closeness_) { _redCloseness=closeness_; } unsigned short redCloseness(void) const { return _redCloseness; } void greenCloseness(unsigned short closeness_) { _greenCloseness=closeness_; } unsigned short greenCloseness(void) const { return _greenCloseness; } void blueCloseness(unsigned short closeness_) { _blueCloseness=closeness_; } unsigned short blueCloseness(void) const { return _blueCloseness; } }; #endif aplus-fsf-4.22/src/MSGUI/MSComboBox.H0000644000265000001440000001247610772770421012573 #ifndef MSComboBoxHEADER #define MSComboBoxHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSComboBox; class MSComboListShell; class MSDisplayCursor; class MSGUIExport MSComboList : public MSStringList { friend class MSComboBox; public: MSComboList(MSComboListShell *); void displayAllColumns(MSBoolean); MSBoolean displayAllColumns(void) const; void setSelectedRowFrom(const char *); unsigned selectString(int,const char *); virtual void show(void); protected: MSComboListShell *shell(void); const MSComboListShell *shell(void) const; MSComboBox *comboBox(void); const MSComboBox *comboBox(void) const; virtual void keyPressEvent(const XEvent *); virtual void keyPress(const XEvent *,KeySym,unsigned int,const char *); virtual void buttonPress(const XEvent *); virtual void defaultDoubleClickBehavior(const XEvent *); virtual void activate(void); virtual void escape(void); virtual void doubleClick(void); virtual void reset(void); void selectEditableText(void); void resetVisibleColumns(void); private: MSBoolean _selectedText; MSBoolean _displayAllColumns; MSBoolean selectedText(void) const; }; class MSGUIExport MSComboListShell : public MSWidget { friend class MSComboList; public: MSComboListShell(MSComboBox *); ~MSComboListShell(void); virtual void show(void); virtual void hide(void); virtual void showAt(int,int); MSComboList *comboList(void); const MSComboList *comboList(void) const; protected: MSDisplayCursor *cursor(void) { return _cursor; } virtual void childConfigure(MSWidget *); virtual void configure(void); virtual void grab(void); virtual void ungrab(void); virtual void escape(void); virtual void activate(void); private: MSComboBox *_comboBox; MSComboList *_comboList; MSDisplayCursor *_cursor; MSComboBox *comboBox(void) const; }; inline MSComboBox *MSComboListShell::comboBox(void) const { return _comboBox; } inline MSComboList *MSComboListShell::comboList(void) { return _comboList; } inline const MSComboList *MSComboListShell::comboList(void) const { return _comboList; } inline MSComboListShell *MSComboList::shell(void) { return (MSComboListShell *)owner(); } inline const MSComboListShell *MSComboList::shell(void) const { return (const MSComboListShell *)owner(); } inline MSComboBox *MSComboList::comboBox(void) { return shell()->comboBox(); } inline const MSComboBox *MSComboList::comboBox(void) const { return shell()->comboBox(); } inline MSBoolean MSComboList::selectedText(void) const { return _selectedText; } inline void MSComboList::displayAllColumns(MSBoolean bool_) { _displayAllColumns=bool_; } inline MSBoolean MSComboList::displayAllColumns(void) const { return _displayAllColumns; } class MSGUIExport MSComboBox : public MSComboField { friend class MSComboList; friend class MSComboListShell; public: MSComboBox(MSWidget *,const char *label_=0,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSComboBox(MSWidget *,MSString&,const char *label_=0,const MSSymbol& tag_=MSSymbol::nullSymbol()); ~MSComboBox(void); MSComboList *listBox(void); const MSComboList *listBox(void) const; MSSelectionMode selectionMode(void) const; void selectionMode(MSSelectionMode); const MSString& separator(void) const; void separator(const MSString&); void listModel(MSStringVector&); MSStringVector& listModel(void); MSComboBox& operator=(const char *); operator MSString&(); virtual void set(MSAttrValueList& avList_); virtual MSAttrValueList& get(MSAttrValueList& avList_); protected: MSComboListShell *_listShell; MSSelectionMode _selectionMode; MSString _separator; MSComboListShell *listShell(void) const; void init(void); virtual void createListShell(void); virtual void showList(void); virtual void listDone(void); virtual void listActivate(void); virtual void buttonActivate(void); virtual void updateData(void); virtual void updateFont(Font); virtual void updateBackground(unsigned long); virtual void updateForeground(unsigned long); virtual MSBoolean validate(const char *); virtual const char *formatOutput(MSString &); void appendEditableText(const char *); void replaceEditableText(const char *); void selectEditableText(void); }; inline MSComboListShell *MSComboBox::listShell(void) const { return _listShell; } inline MSComboList *MSComboBox::listBox(void) { return listShell()->comboList(); } inline const MSComboList *MSComboBox::listBox(void) const { return listShell()->comboList(); } inline MSComboBox& MSComboBox::operator=(const char *value_) { value(value_); return *this; } inline MSComboBox::operator MSString&() { return *((MSString *)_model); } inline MSSelectionMode MSComboBox::selectionMode(void) const { return _selectionMode; } inline void MSComboBox::selectionMode(MSSelectionMode mode_) { _selectionMode=mode_; } inline const MSString& MSComboBox::separator(void) const { return _separator; } inline void MSComboBox::separator(const MSString& separator_) { _separator=separator_; } #endif aplus-fsf-4.22/src/MSGUI/MSComboField.H0000644000265000001440000000353210772770421013057 #ifndef MSComboFieldHEADER #define MSComboFieldHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSGUIExport MSComboField : public MSEntryFieldCombo { public: MSComboField(MSWidget *,const char *label_=0,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSComboField(MSWidget *,MSString&,const char *label_=0,const MSSymbol& tag_=MSSymbol::nullSymbol()); ~MSComboField(void); void model(MSString&); MSString& viewModel(void) { return *((MSString*)_model); } const MSString& viewModel(void) const { return *((MSString*)_model); } MSComboField& operator=(const char *); operator MSString&(); operator const char *(); void comboArrowColor(unsigned long); void comboArrowColor(const char *); unsigned long comboArrowColor(void); virtual void set(MSAttrValueList&); virtual MSAttrValueList& get(MSAttrValueList&); protected: void init(void); virtual MSBoolean validate(const char *); virtual const char *formatOutput(MSString &); const char *editString(void); MSString& value(void); const MSString& value(void) const; void value(const char *); }; inline MSString& MSComboField::value(void) { return (MSString&)*_model; } inline const MSString& MSComboField::value(void) const { return (MSString&)*_model; } inline MSComboField& MSComboField::operator=(const char *value_) { value(value_); return *this; } inline MSComboField::operator MSString&() { return *((MSString *)_model); } inline MSComboField::operator const char *() { return (MSView::model()!=0)?(const char *)value():0; } #endif aplus-fsf-4.22/src/MSGUI/MSComposite.H0000644000265000001440000000133010772770421013010 #ifndef MSCompositeHEADER #define MSCompositeHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSGUIExport MSComposite : public MSWidgetCommon { public: MSComposite(MSWidget *); ~MSComposite(void); virtual void redraw(void); protected: void init(void); virtual void focusIn(void); virtual void focusOut(void); virtual void computeSize(void); virtual void placement(void); virtual void configure(void); }; #endif aplus-fsf-4.22/src/MSGUI/MSCompositeField.H0000644000265000001440000001217310772770421013763 #ifndef MSCompositeFieldHEADER #define MSCompositeFieldHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include class MSCompositeFieldBox; class MSGUIExport MSCompositeField : public MSComposite { friend class MSCompositeFieldBox; public: class MSGUIExport FieldValue : public MSTextRect { friend class MSCompositeField; protected: MSShadow _shadow; MSShadowStyle _shadowStyle; int _shadowThickness; public: FieldValue(MSWidget *); ~FieldValue(void); virtual void naturalSize(void); virtual void updateBackground(unsigned long); const MSShadow& shadow(void) const; MSShadowStyle shadowStyle(void) const; int marginWidth(void) const; int highlightThickness(void) const; int shadowThickness(void) const; int offset(void) const; void shadowThickness(int); void shadowStyle(MSShadowStyle); }; class MSGUIExport FieldLabel : public MSTextRect { friend class MSCompositeField; public: FieldLabel(MSWidget *); FieldLabel(MSWidget *,const char *); FieldLabel(MSWidget *,const MSString&); ~FieldLabel(void); virtual void naturalSize(void); int naturalWidth(void) const; int marginWidth(void) const; int highlightThickness(void) const; int shadowThickness(void) const; int offset(void) const; }; friend class FieldLabel; friend class FieldValue; public: MSCompositeField(MSWidget *,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSCompositeField(MSWidget *,const char *,const MSSymbol& tag_=MSSymbol::nullSymbol()); ~MSCompositeField(void); virtual void redraw(void); virtual void naturalSize(void); const MSSymbol& tag(void) const; void tag(const MSSymbol&); void clipIndicatorForeground(const char *); void clipIndicatorForeground(unsigned long); unsigned long clipIndicatorForeground(void) const; void editWidth(unsigned); unsigned editWidth(void) const; void label(const char *); void label(const MSString&); const MSString& label(void) const; void labelForeground(const char *); void labelForeground(unsigned long); unsigned long labelForeground(void) const; void labelFont(const char *); void labelFont(Font); Font labelFont(void) const; void labelAlignment(MSAlignment); MSAlignment labelAlignment(void) const; void labelJustification(MSAlignment); MSAlignment labelJustification(void) const; void labelSpacing(unsigned); unsigned labelSpacing(void) const; void marginHeight(unsigned); unsigned marginHeight(void) const; void valueAlignment(MSAlignment); MSAlignment valueAlignment(void) const; void valueBackground(unsigned long); void valueBackground(const char *); unsigned long valueBackground(void) const; void valueFont(const char *); void valueFont(Font); Font valueFont(void) const; void valueForeground(unsigned long); void valueForeground(const char *); unsigned long valueForeground(void) const; void valueShadowStyle(MSShadowStyle); MSShadowStyle valueShadowStyle(void) const; void valueShadowThickness(int); int valueShadowThickness(void) const; void valueWidth(unsigned); unsigned valueWidth(void) const; void clipMode(MSClipMode); MSClipMode clipMode(void) const; virtual void set(MSAttrValueList& avList_); virtual MSAttrValueList& get(MSAttrValueList& avList_); protected: MSSymbol _tag; FieldValue *_fieldValue; FieldLabel *_fieldLabel; MSAlignment _labelAlignment; MSAlignment _labelJustification; unsigned _labelSpacing; MSAlignment _valueAlignment; unsigned _valueWidth; unsigned _editWidth; unsigned _marginHeight; unsigned long _clipIndicatorForeground; MSClipMode _clipMode; GC _drawGC; GC drawGC(void) {return _drawGC;} FieldValue *fieldValue(void) const; FieldLabel *fieldLabel(void) const; void init(void); virtual unsigned computeValuePixelWidth(void); virtual unsigned computeLabelPixelWidth(void); virtual void labelPixelWidth(unsigned); virtual void drawFieldValueShadow(void); virtual void drawFieldValue(void); virtual void drawFieldValue(unsigned long,unsigned long); virtual void drawFieldLabel(void); virtual void computeSize(void); virtual void adjustSize(void); virtual void placement(void); virtual void configure(void); virtual MSBoolean validate(const char *); virtual const char *formatOutput(MSString &); virtual void updateFont(Font); virtual void updateBackground(unsigned long); virtual void updateForeground(unsigned long); virtual void updateSensitivity(void); virtual void focusIn(void); virtual void focusOut(void); virtual MSBoolean loseFocus(void); virtual void firstMapNotify(void); }; #endif aplus-fsf-4.22/src/MSGUI/MSCompositeFieldBox.H0000644000265000001440000000261110772770421014430 #ifndef MSCompositeFieldBoxHEADER #define MSCompositeFieldBoxHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSGUIExport MSCompositeFieldBox : public MSLayout { public: MSCompositeFieldBox(MSWidget *,const char *title_=0); MSCompositeFieldBox(MSWidget *,const MSStringVector&); ~MSCompositeFieldBox(void); unsigned editWidth(void) const; unsigned valueWidth(void) const; void valueWidth(unsigned); void editWidth(unsigned); MSCompositeField *field(const MSSymbol& tag_); const MSCompositeField *field(const MSSymbol& tag_) const; virtual void set(MSAttrValueList& avList_); virtual MSAttrValueList& get(MSAttrValueList& avList_); protected: unsigned _editWidth; unsigned _valueWidth; void init(void); virtual void extraRowSpace(int num_,MSLayoutVector *vec_,int size_); virtual void placement(void); virtual void alignLabels(void); virtual void firstMapNotify(void); }; inline unsigned MSCompositeFieldBox::editWidth(void) const { return _editWidth; } inline unsigned MSCompositeFieldBox::valueWidth(void) const { return _valueWidth; } #endif aplus-fsf-4.22/src/MSGUI/MSCompositeText.H0000644000265000001440000000272510772770421013666 #ifndef MSCompositeTextHEADER #define MSCompositeTextHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSGUIExport MSCompositeText : public MSComposite { public: MSCompositeText(MSWidget *); ~MSCompositeText(void); MSBoolean fixedWidth(void) const; MSBoolean doubleByte(void) const; int textAscent(void) const; int textDescent(void) const; int charWidth(void) const; int charLbearing(void) const; int charRbearing(void) const; int textHeight(void) const; int textWidth(const char *pString_) const; int textWidth(const char *pString_,int len_) const; int charWidth(char aChar_) const; int charLbearing(char aChar_) const; int charRbearing(char aChar_) const; protected: GC _textGC; GC _backgroundGC; XFontStruct *_textFontStruct; GC textGC(void) const; GC backgroundGC(void) const; const XFontStruct *textFontStruct(void) const; virtual void updateFont(Font); virtual void updateBackground(unsigned long); virtual void updateForeground(unsigned long); private: const XCharStruct *charStruct(char aChar_) const; }; #ifndef MS_NO_INLINES #ifndef MSCompositeTextINLINES #include #endif #endif #endif aplus-fsf-4.22/src/MSGUI/MSCursorfont.H0000644000265000001440000000056510772770421013223 #ifndef MSCursorfontHEADER #define MSCursorfontHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #endif aplus-fsf-4.22/src/MSGUI/MSCurveTraceSet.H0000644000265000001440000000334510772770421013575 #ifndef MSCurveTraceSetHEADER #define MSCurveTraceSetHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #ifndef MSDefinesHEADER #include #endif #if defined(MS_NEED_IMPLEMENTATION_PRAGMA) #pragma implementation("MSCurveTraceSet.C") #endif template class MSCurveTraceSet : public MSTraceSet { public: MSCurveTraceSet(MSGraph *,const char *legends_,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSCurveTraceSet(MSGraph *,const MSStringVector&,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSCurveTraceSet(MSGraph *,MSCurve&,const char *,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSCurveTraceSet(MSGraph *,MSCurve&,const MSStringVector&,const MSSymbol& tag_=MSSymbol::nullSymbol()); ~MSCurveTraceSet(void); void model(MSCurve&); MSCurve& viewModel(void) { return curve(); } const MSCurve& viewModel(void) const { return curve(); } protected: const MSCurve& curve(void) const; MSCurve& curve(void); virtual int dataCount(void) const; virtual double x(int row_) const; virtual double y(int row_,int) const; virtual int numColumns(void) const; void curve(const MSCurve& aCurve_); virtual void validate(int r_,int c_,double x_,double y_); // MSCurveTraceSet& operator=(const MSCurve& aCurve_) {curve(aCurve_); return *this;} // operator MSCurve&() {return *((MSCurve *)_model);} }; #endif aplus-fsf-4.22/src/MSGUI/MSDateEntryField.H0000644000265000001440000001065110772770422013720 #ifndef MSDateEntryFieldHEADER #define MSDateEntryFieldHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include class MSGUIExport MSDateEntryField : public MSEntryFieldPlus { protected: class DateShell; class DateMonthView; friend class DateShell; friend class DateMonthView; class MSGUIExport DateMonthView : public MSMonthView { protected: DateShell * dateShell(void) { return (DateShell *)owner(); } MSDateEntryField *dateField(void) { return dateShell()->dateField();} virtual void keyPress(const XEvent *, KeySym, unsigned int, const char*); virtual void buttonPress(const XEvent *); virtual void buttonRelease(const XEvent *); virtual void home(void); virtual void end(void); virtual void escape(void); virtual void nextMonth(void); virtual void prevMonth(void); virtual void activate(void); public: DateMonthView(MSWidget *owner_); }; class MSGUIExport DateShell : public MSWidget { protected: DateMonthView *_monthView; MSDateEntryField *_dateField; public: DateShell(MSDateEntryField* owner_); ~DateShell(); DateMonthView * monthView(void) { return _monthView; } const DateMonthView * monthView(void) const { return _monthView; } MSDateEntryField * dateField(void) { return _dateField; } virtual void showAt(int, int); virtual void show(void); virtual void hide(void); virtual void escape(void); virtual void activate(void); void grab(void); void ungrab(void); protected: virtual void configure(void); virtual void childConfigure(MSWidget*); }; private: MSTerm _incrementValue; MSDate _minimumValue; MSDate _maximumValue; DateShell *_dateShell; protected: DateShell * dateShell(void) { return _dateShell; } const DateShell * dateShell(void) const { return _dateShell; } void showMonthView(void); void monthViewActivate(void); void monthViewEscape(void); virtual MSBoolean validate(const char *); virtual const char *formatOutput(MSString &); virtual void increment(void); virtual void decrement(void); virtual void buttonActivate(void); virtual void updateFont(Font); virtual void updateForeground(unsigned long); virtual void updateBackground(unsigned long); virtual void generateInputMask(void); MSDate& value(void) const { return *((MSDate *)_model); } void value(const MSDate& value_) const { if (MSView::model()!=0) value()=value_; } void init(void); virtual void updateData(void); public: MSDateEntryField(MSWidget *,const char *label_=0, const MSSymbol& tag_=MSSymbol::nullSymbol()); MSDateEntryField(MSWidget *,MSDate&,const char *label_=0, const MSSymbol& tag_=MSSymbol::nullSymbol()); ~MSDateEntryField(void); void model(MSDate&); void model(const MSDate&); MSDate& viewModel(void) { return *((MSDate*)_model); } const MSDate& viewModel(void) const { return *((MSDate*)_model); } const MSTerm& incrementValue(void) const {return _incrementValue;} const MSDate& maximumValue(void) const {return _maximumValue;} const MSDate& minimumValue(void) const {return _minimumValue;} void incrementValue(const MSTerm& incrementValue_) {_incrementValue=incrementValue_;} void maximumValue(const MSDate& maximumValue_) {_maximumValue=maximumValue_;} void minimumValue(const MSDate& minimumValue_) {_minimumValue=minimumValue_;} MSDateEntryField& operator=(const MSDate& value_) {value(value_); return *this;} operator MSDate&() {return value();} MSBoolean monthDropDown(void) const { return buttonState(ComboButton); } void monthDropDown(MSBoolean dropDown_); void comboArrowColor(unsigned long color_) { buttonColor(ComboButton, color_); } void comboArrowColor(const char * color_) { buttonColor(ComboButton, color_); } unsigned long comboArrowColor(void) { return buttonColor(ComboButton); } MSMonthView *monthView(void); const MSMonthView *monthView(void) const; virtual void set(MSAttrValueList&); virtual MSAttrValueList& get(MSAttrValueList&); }; #endif aplus-fsf-4.22/src/MSGUI/MSDefaults.H0000644000265000001440000000145210772770422012623 #ifndef MSDefaultsHEADER #define MSDefaultsHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// extern unsigned long MSDefaultBackground; extern unsigned long MSDefaultForeground; extern const char *MSDefaultBackgroundColorSpec; extern const char *MSDefaultForegroundColorSpec; extern const char *MSDefaultFont; extern const char *DefaultAPLFont; extern const int MSDefaultBorderWidth; extern const int MSDefaultWindowBorderWidth; extern const int MSDefaultWidth; extern const int MSDefaultHeight; extern const int MSDefaultX; extern const int MSDefaultY; #endif aplus-fsf-4.22/src/MSGUI/MSDelimiterList.H0000644000265000001440000001012110772770422013617 #ifndef MSDelimiterListHEADER #define MSDelimiterListHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSGUIExport MSDelimiterList : public MSList { protected: MSGC _segmentGC; MSGC _delimiterGC; MSGC _trackGC; MSPixmap *_stipple; unsigned long _delimiterColor; unsigned long _delimiterHighlightColor; unsigned long _delimiterSelectionBackground; unsigned long _delimiterTitleForeground; MSString _delimiterTitle; MSIndexVector _delimiterVector; int _selectedDelimiter; MSBoolean _listEdit; MSBoolean _delimiterEdit; MSBoolean _delimiterSelection; MSGC& segmentGC(void) {return _segmentGC;} MSGC& delimiterGC(void) {return _delimiterGC;} MSGC& trackGC(void) {return _trackGC;} MSPixmap *stipple(void) {return _stipple;} void init(void); void drawDelimiters(Window); void drawDelimiters(Window,int); void drawDelimiterHeaders(Window); void highlightDelimiter(int); virtual void addDelimiter(int); virtual void removeDelimiter(int); virtual void dragDelimiter(const XEvent *); virtual void selectDelimiter(const XEvent *); virtual void delimiterChangeNotify(void); virtual void delimiterSelectionNotify(void); virtual int computeDelimiterXCoord(int); virtual int xToColumn(int); virtual void updateFont(Font); virtual void updateBackground(unsigned long); virtual void redrawImmediately(void); virtual void drawActualRow(Window,int row_,const char *string_,int len_, const MSPixmap *,unsigned long fg_,unsigned long bg_, Font font_,MSBoolean selected_,MSBoolean selectOutline_); virtual void updateData(void); virtual void headingAreaSelection(const XEvent *); virtual void dataAreaSelection(const XEvent *); virtual void delimiterButton1Event(const XEvent *); virtual void delimiterButton2Event(const XEvent *); virtual void calculateHeadingsHeight(void); public: MSDelimiterList(MSWidget *,const char *title_=0); MSDelimiterList(MSWidget *,const MSStringVector &title_); ~MSDelimiterList(void); void delimiterVector(const MSIndexVector &delimiterVector_,int selectedDelimiter_); void delimiterVector(const MSIndexVector &delimiterVector_); const MSIndexVector &delimiterVector(void) const {return _delimiterVector;} void selectedDelimiter(int); int selectedDelimiter(void) const {return _selectedDelimiter;} void delimiterTitle(const MSString &); const MSString &delimiterTitle(void) const {return _delimiterTitle;} void delimiterEdit(MSBoolean delimiterEdit_); MSBoolean delimiterEdit(void) const {return _delimiterEdit;} void listEdit(MSBoolean listEdit_) {_listEdit=listEdit_;} MSBoolean listEdit(void) const {return _listEdit;} void delimiterSelection(MSBoolean delimiterSelection_) {_delimiterSelection=delimiterSelection_;} MSBoolean delimiterSelection(void) const {return _delimiterSelection;} void delimiterColor(const char *); void delimiterColor(unsigned long); unsigned long delimiterColor(void) const {return _delimiterColor;} void delimiterHighlightColor(const char *); void delimiterHighlightColor(unsigned long); unsigned long delimiterHighlightColor(void) const {return _delimiterHighlightColor;} void delimiterSelectionBackground(const char *); void delimiterSelectionBackground(unsigned long); unsigned long delimiterSelectionBackground(void) const {return _delimiterSelectionBackground;} void delimiterTitleForeground(const char *); void delimiterTitleForeground(unsigned long); unsigned long delimiterTitleForeground(void) const {return _delimiterTitleForeground;} virtual void set(MSAttrValueList&); virtual MSAttrValueList& get(MSAttrValueList&); }; #endif aplus-fsf-4.22/src/MSGUI/MSDependentTableColumn.H0000644000265000001440000000601210772770422015105 #ifndef MSDependentTableColumnHEADER #define MSDependentTableColumnHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #ifndef MSDefinesHEADER #include #endif #if defined(MS_NEED_IMPLEMENTATION_PRAGMA) #pragma implementation("MSDependentTableColumn.C") #endif template class MSDependentTableColumn : public MSTableColumn { public: MSDependentTableColumn(MSReportTable *,const char *title_=0,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSDependentTableColumn(MSReportTable *,const MSStringVector&,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSDependentTableColumn(MSReportTable *,MSDependentVector&,const char *title_=0,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSDependentTableColumn(MSReportTable *,MSDependentVector&,const MSStringVector&,const MSSymbol& tag_=MSSymbol::nullSymbol()); ~MSDependentTableColumn(void); void model(MSDependentVector&); MSDependentVector& viewModel(void) { return *((MSDependentVector*)_model); } const MSDependentVector& viewModel(void) const { return *((MSDependentVector*)_model); } // this member function inlined for Visual C++ 2.0 operator MSDependentVector&() const { return *((MSDependentVector *)_model); } void format(const MSFormat&); inline const MSFormat& format(void) const; virtual MSIndexVector gradeUp(void) const; virtual MSIndexVector gradeDown(void) const; virtual void permute(const MSIndexVector &); virtual void range(MSIndexVector &start_,MSIndexVector &end_); virtual MSIndexVector rangeGradeUp(const MSIndexVector &start_,const MSIndexVector &end_); virtual MSIndexVector rangeGradeDown(const MSIndexVector &start_,const MSIndexVector &end_); virtual unsigned numRows(void) const; virtual MSBoolean isDuplicate(unsigned); virtual MSBoolean breakCriteria(unsigned); virtual const char *formatOutput(MSString &,unsigned); virtual const char *formatBreak(MSString &,unsigned,unsigned); protected: void init(void); virtual void breakProcess(MSIndexVector&); virtual MSBoolean validate(const char *,unsigned); inline MSDependentVector& vector(void); inline const MSDependentVector& vector(void) const; static const Type& getType(void); }; template inline MSDependentVector& MSDependentTableColumn::vector(void) { return (MSDependentVector&)*_model; } template inline const MSDependentVector& MSDependentTableColumn::vector(void) const { return (MSDependentVector&)*_model; } template inline const MSFormat& MSDependentTableColumn::format(void) const { return _format; } #endif aplus-fsf-4.22/src/MSGUI/MSDoubleClick.H0000644000265000001440000000133510772770422013234 #ifndef MSDoubleClickHEADER #define MSDoubleClickHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSGUIExport MSDoubleClick { protected: unsigned long _lastEventTime; unsigned long lastEventTime(void) const { return _lastEventTime; } public: MSDoubleClick(void) : _lastEventTime(0) {} void eventTime(unsigned long eventTime_) { _lastEventTime=eventTime_; } MSBoolean isDoubleClick(const XEvent *ev_); }; #endif aplus-fsf-4.22/src/MSGUI/MSDisplayCursor.H0000644000265000001440000000304710772770422013661 #ifndef MSDisplayCursorHEADER #define MSDisplayCursorHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include class MSDisplayCursorData; class MSHashTable; class MSGUIExport MSDisplayCursor { public: MSDisplayCursor(MSDisplayServer *server_,unsigned int shape_,unsigned long fg_,unsigned long bg_); MSDisplayCursor(MSDisplayServer *server_,unsigned int shape_,const char *fg_,const char *bg_); MSDisplayCursor(const MSDisplayCursor&); ~MSDisplayCursor(void); MSDisplayCursor& operator=(const MSDisplayCursor&); MSDisplayServer *server(void) const; Display *display(void) const; int width(void) const; int height(void) const; int depth(void) const; unsigned int shape(void) const; unsigned long foreground(void) const; unsigned long background(void) const; Cursor cursor(void) const; const char *name(void) const; private: static MSHashTable *_pCursorHashTable; MSDisplayCursorData *_pData; #ifdef MS_MULTI_THREAD static MSMutex _cursorHashTableMutex; #endif void create(MSDisplayServer *,unsigned int shape_,unsigned long fg_,unsigned long bg_); void create(MSDisplayServer *,const char *pName_,unsigned int shape_,unsigned long fg_,unsigned long bg_); }; #endif aplus-fsf-4.22/src/MSGUI/MSDisplayPrint.H0000644000265000001440000001246010772770422013477 #ifndef MSDisplayPrintHEADER #define MSDisplayPrintHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #ifndef MSWidgetHEADER #include #endif #ifndef MSPixmapHEADER #include #endif #include class MSClipArea; class MSDashLine; class MSPrintDisclaimer; class MSGUIExport MSDisplayPrint:public MSPostScript { friend class MSClipArea; friend class MSDashLine; friend class MSWidgetOutput; friend class MSPrintDisclaimer; public: MSDisplayPrint(void); ~MSDisplayPrint(void); virtual MSBoolean printOpen(MSWidget*); virtual MSBoolean printOpen(void); virtual MSBoolean printClose(void); void printInit(MSWidget*); void printClear(void); void defaultFont(Font); Font defaultFont(void) const; void originInc(MSWidget *widget_); void originDec(MSWidget *widget_); protected: MSWidget *owner(void) const {return _owner;} XFontStruct *fontInfo(void) const {return _fontInfo;} int fontHeight(void) const {return _fontInfo->ascent+_fontInfo->descent;} Pixmap ppmPixmap(void) const {return _ppmPixmap->pixmap();} MSClipArea *activeClip(void) const {return _activeClip;} MSDashLine *activeDash(void) const {return _activeDash;} MSBoolean updateDash(void) const {return _updateDash;} int clipCount(void) const {return _clipCount;} MSBoolean special(void) const {return _special;} Font defaultFontID(void) const {return _defaultFontID;} void activeClip(MSClipArea *x_) {_activeClip=x_;} void clipCount(int x_) {_clipCount=x_;} void updateDash(MSBoolean x_) {_updateDash=x_;} void defaultFontID(Font x_) {_defaultFontID=x_;} void activeDash(MSDashLine *); void comment(const char *); void special(MSBoolean); void printPixmap(void); MSClipArea *updateClipGC(GC); MSClipArea *findClipGC(GC); MSDashLine *findDashGC(GC); void deleteAllClipGC(void); void deleteAllDashGC(void); void init(void); void setAttributes(void); MSBoolean setLineAttributes(void); void setFontAttributes(void); void setClipMask(void); void setFillStyle(void); void setFillRule(void); void setArcMode(void); void unsetClip(void); void setClip(MSClipArea*); void setClipWindow(int,int); void unsetClipWindow(void); void printScale(void); void computePrintScale(void); virtual void updateGC(GC gc_); virtual void updateForeground(int i_=0); virtual void updateBackground(void); virtual void updateFont(void); void printArc(GC,int,int,int,int,int,int); void printArcs(GC,XArc *,int); void printLine(GC,int,int,int,int); void printLines(GC,XPoint *,int,int); void printSegments(GC,XSegment *,int); void printPoint(GC,int,int); void printPoints(GC,XPoint *,int,int); void printRectangle(GC,int,int,int,int); void printRectangles(GC,XRectangle *,int); void printString(GC,int,int,const char *,int); void printImageString(GC,int,int,const char *,int); void printFillArc(GC,int,int,int,int,int,int); void printFillArcs(GC,XArc *,int); void printFillPolygon(GC,XPoint *,int,int,int,MSBoolean fill_=MSFalse); void printFillRectangle(GC,int,int,int,int,MSBoolean fill_=MSFalse); void printFillRectangles(GC,XRectangle *,int,MSBoolean fill_=MSFalse); void printSetClipRectangles(GC,int,int,XRectangle *,int,int); void printSetDashes(GC,const char *,int); void printFreeGC(GC); virtual void printArc(int,int,int,int,int,int,int,DrawMode); virtual void printLine(double,double,double,double); virtual void printRectangle(double,double,double,double); virtual void setClipRectangle(int,int,int,int); virtual void printString(int,int,const char *,int); private: MSPixmap *_ppmPixmap; MSClipArea *_clip; MSClipArea *_activeClip; int _clipCount; MSDashLine *_activeDash; MSBoolean _updateDash; MSWidget *_owner; XFontStruct *_fontInfo; Font _defaultFontID; MSRect _clipRect; MSNodeItem _clipGCListHead; MSNodeItem _dashGCListHead; MSBoolean _special; }; class MSGUIExport MSClipArea { friend class MSDisplayPrint; int _clipNumber; GC _clipID; protected: MSClipArea(GC x_) {_clipID=x_;} ~MSClipArea(void) {} GC clipID(void) {return _clipID;} int clipNumber(void) {return _clipNumber;} void clipNumber(int x_) {_clipNumber=x_;} }; class MSGUIExport MSDashLine { int _dashCt; GC _dashID; const char *_dash; public: MSDashLine(GC gc_,const char* d_,int n_) {_dashID=gc_; _dash=d_; _dashCt=n_;} ~MSDashLine(void) {} GC dashID(void) const {return _dashID;} int dash(int i_) const {return i_<_dashCt?(int)_dash[i_]:0;} int dashCt(void) const {return _dashCt;} void dash(const char *x_) {_dash=x_;} void dashCt(int x_) {_dashCt=x_;} }; #endif aplus-fsf-4.22/src/MSGUI/MSDisplayServer.H0000644000265000001440000001752710772770422013662 #ifndef MSDisplayServerHEADER #define MSDisplayServerHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include class MSDisplayCursor; class MSFontManager; class MSColorManager; class MSWidget; class MSToolTip; class MSChannel; class MSVector; class MSWidgetVector; class MWMWidget; template class MSTypeVector; typedef MSTypeVector MSStringVector; class MSGUIExport MSAtomTable { protected: Atom *_array; public: enum AtomName {WMState=0,WMDeleteWindow=1,WMProtocols=2,MStk=3, DecorAdd=5,DecorDel=6,DecorFooter=7,DecorHeader=8,DecorPin=9, DecorResize=10,LeftFooter=11,RightFooter=12,MenuFull=13,MenuLimited=14, PushpinState=15,PinIn=16,PinOut=17,WindowBusy=18,WinAttr=19, WTBase=20,WTCmd=21,WTNotice=22,WTOther=23, Targets=25,ClientWindow=26,TimeStamp=27,Length=28, CharacterPosition=29,Span=30,WMSaveYourself=31,LastAtom=32}; MSAtomTable(void); ~MSAtomTable(void); void add(int index_,Atom atom_); Atom atom(int index_) const; }; typedef void (*MSWorkspaceChangedFunction)(Atom); class MSGUIExport MSDisplayServer { private: friend class MSDisplayServerChannel; friend class MWMWidget; public: enum QueueStatus {NoQueueAfterSelect=0,QueueOk=1}; MSDisplayServer(void); MSDisplayServer(const char *name_); ~MSDisplayServer(void); Display *display(void) const; int screenNum(void) const; int depth(void) const; Screen *screen(void) const; Visual *visual(void) const; Window root(void) const; int connection(void) const; int width(void) const; int widthMM(void) const; int height(void) const; int heightMM(void) const; const char *name(void) const; MSColorManager *colorManager(void) const; MSFontManager *fontManager(void) const; MSAtomTable& atomTable(void); const MSAtomTable& atomTable(void) const; MSHashTable *shadowHashTable(void) const; MSHashTable *widgetHashTable(void) const; const MSString& copyBuffer(void) const; const MSString& pasteBuffer(void) const; Atom atom(int index_) const; MSDisplayCursor *watch(void) const; Font defaultFont(void) const; unsigned long defaultForeground(void) const; unsigned long defaultBackground(void) const; Colormap colormap(void) const; Cursor watchCursor(void) const; MSHashTable *toolTipHashTable(void) const; MSToolTip *toolTip(void); void processOneEvent(void); void dispatch(void); MSBoolean flush(void); void bell(void); static MSBoolean flush(Display *); void defaultFont(const char *); void defaultForeground(const char *); void defaultBackground(const char *); void copyBuffer(const MSString&); void pasteBuffer(const MSString&); unsigned long defaultHighlightColor(void) const; void defaultHighlightColor(const char *); unsigned long defaultValueBackground(void) const; void defaultValueBackground(const char *); void addPassiveGrab(MSWidget *); void removePassiveGrab(MSWidget *); MSWidget *grabWidget(void) const; MSBoolean eventGrabbed(const XEvent *,MSWidget *) const; int grabPointer(Window,int,unsigned,int,int,Window,Cursor,Time,MSBoolean revertBack_=MSFalse); int grabKeyboard(Window,int,int,int,Time,MSBoolean revertBack_=MSFalse); void ungrabPointer(Window,Time); void ungrabKeyboard(Window,Time); Window keyboardGrabber(void) const; Window pointerGrabber(void) const; MSBoolean isCDERunning(void) const; MSStringVector workspaceNames(void) const; MSString currentWorkspaceName(void) const; Atom currentWorkspaceAtom(void) const; MSBoolean changeWorkspaceTo(const MSString& workspaceName_); unsigned long numberOfWorkspaces(void) const; MSString workspaceName(Atom) const; Atom workspaceAtom(const MSString&) const; static void workspaceChangedFunction(MSWorkspaceChangedFunction); unsigned long pixel(const char *colorString_); const char *colorName(unsigned long pixel_) const; Font fontID(const char *fontString_); const char *fontName(Font fontID_) const; const XFontStruct *fontStruct(Font fontID_) const; int ioErrorHandler(void); int errorHandler(const XErrorEvent *); const MSWidget *primarySelectionOwner(void) const; MSWidget *primarySelectionOwner(void); void primarySelectionOwner(MSWidget *); static void exitOnError(void); static Display *defaultDisplay(void); static MSDisplayServer *defaultDisplayServer(void); static MSDisplayServer* serverOfDisplay(Display *); static int propertyFullLength(void); MSWidget* menuGrabber(void); void menuGrabber(MSWidget*); MSWidget *menuBar(void); void menuBar(MSWidget*); MSDisplayCursor *menuGrabCursor(void); void menuGrabCursor(MSDisplayCursor*); MSWidget *scrollBarMenu(void); void scrollBarMenu(MSWidget*); #ifdef MS_KEYPAD_BUG void correctKeypadKeys(const XEvent *,KeySym&,unsigned int,char *); #endif public: // this should be protected, but lcc has a problem enum WindowManager {Unset=0,MWM=1,Other=2}; protected: struct MWMInfo { enum Flags {StartupStandard=1,StartupCustom=2}; long _flags; Window _wmWindow; }; static MSDisplayServer *_defaultDisplayServer; static MSWorkspaceChangedFunction _workspaceChangedFunction; Display *_dpy; MSColorManager *_colorManager; // holds hashTable of colors in use MSFontManager *_fontManager; // holds hashTable of fonts in use MSDisplayCursor *_watchCursor; // default watch cursor for this connection MSHashTable *_shadowHashTable; // hashTable of shadow objects - keys are bg color MSHashTable *_widgetHashTable; // hashTable of widgets - keys are window ids MSHashTable *_toolTipHashTable; // hashTable of toolTips - keys are widget pointer MSChannel *_channel; MSAtomTable _atomTable; MSString _copyBuffer; // buffer to hold primary selection for copying to MSString _pasteBuffer; // buffer to hold primary selection for pasting MSString _name; unsigned long _defaultFg; unsigned long _defaultBg; Font _defaultFont; MSDisplayServer::QueueStatus _status; MSVector *_keyboardGrabList; MSVector *_pointerGrabList; MSWidgetVector *_passiveGrabList; Window _keyboardGrabber; Window _pointerGrabber; MSToolTip *_toolTip; WindowManager _windowManager; Window _mwmWindow; MWMWidget *_pMWMWidget; unsigned long _defaultHighlightColor; unsigned long _defaultValueBg; MSWidget *_primarySelectionOwner; MSDisplayCursor *_menuGrabCursor; MSWidget *_menuBar; MSWidget *_menuGrabber; MSWidget *_scrollBarMenu; #ifdef MS_KEYPAD_BUG KeyCode *_keypadKeycodes; unsigned int _numLockModifier; void setKeypadCodes(void); #endif void init(void); void initAtoms(void); void processXEvents(void); MSBoolean process(void); void service(void); void dispatchEvent(XEvent&); void setWindowManager(void); void currentWorkspaceChangedNotify(Atom); }; #ifndef MS_NO_INLINES #ifndef MSDisplayServerINLINES #include #endif #endif #endif aplus-fsf-4.22/src/MSGUI/MSEntryField.H0000644000265000001440000001446210772770422013126 #ifndef MSEntryFieldHEADER #define MSEntryFieldHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include class MSEntryField; class MSGUIExport MSEntryField : public MSCompositeField, public MSValidationInterface { public: class MSGUIExport CycleTimer : public MSIntervalTimer { protected: MSEntryField *_entryField; public: CycleTimer(MSEntryField *,unsigned long interval_); ~CycleTimer(void); virtual void process(void); }; class MSGUIExport FieldEditor : public MSTextField { public: FieldEditor(MSWidget *); ~FieldEditor(void); virtual void returnKey(void); virtual void activate(void); virtual void escape(void); virtual void up(void); virtual void down(void); }; friend class FieldEditor; friend class CycleTimer; public: MSEntryField(MSWidget *,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSEntryField(MSWidget *,const char *,const MSSymbol& tag_=MSSymbol::nullSymbol()); ~MSEntryField(void); const MSFormat& format(void) const; const MSUnsignedLongVector& cycleColors(void) const; unsigned long cycleInterval(void) const; MSCycleColorMode cycleColorMode(void) const; MSBoolean editing(void) const; unsigned long editorBackground(void) const; unsigned long editorForeground(void) const; void format(const MSFormat& aFormat_); void cycleColors(const MSUnsignedLongVector&); void cycleColors(const MSStringVector&); void cycleInterval(unsigned long); void cycleColorMode(MSCycleColorMode); void editorBackground(unsigned long); void editorForeground(unsigned long); void editorBackground(const char *); void editorForeground(const char *); void inputMask(const MSString&); const MSString& inputMask(void) const; void inputMaskCharacter(char); char inputMaskCharacter(void) const; void autoMaskInput(MSBoolean); MSBoolean autoMaskInput(void) const; void supportPasting(MSBoolean supportPasting_) {_supportPasting=supportPasting_;} int supportPasting(void) const {return _supportPasting;} unsigned long addEditorKeyCallback( const char*,MSKeyCallback*); void removeEditorKeyCallback(unsigned long); void removeEditorKeyCallback(const char*); virtual void set(MSAttrValueList& avList_); virtual MSAttrValueList& get(MSAttrValueList& avList_); protected: FieldEditor *_editor; CycleTimer *_cycleTimer; MSColorCycle *_cycle; MSUnsignedLongVector _cycleColors; unsigned long _cycleInterval; MSCycleColorMode _cycleColorMode; MSFormat _format; MSBoolean _autoMaskInput; MSColorCycle *cycle(void) const; CycleTimer *cycleTimer(void) const; FieldEditor *fieldEditor(void) const; void init(void); virtual void drawFieldValue(unsigned long,unsigned long); virtual void drawFieldValue(void); void removeCycle(void); void startCycle(const MSUnsignedLongVector& colors_); virtual void createCycle(void); void cycleValue(void); void processCycleTimer(void); virtual void update(const MSIndexVector&); virtual void updateData(void); virtual void updateBackground(unsigned long); virtual void updateForeground(unsigned long); virtual void placement(void); virtual void clearEditor(void); virtual void configureEditor(void); virtual void mapEditor(void); virtual void unmapEditor(void); virtual MSBoolean activateEditor(void); virtual void edit(void); virtual void editSelection(void); virtual void increment(void); virtual void decrement(void); virtual void up(void); virtual void down(void); virtual void left(void); virtual void right(void); virtual void returnKey(void); virtual void activate(void); virtual void escape(void); virtual void reference(void); virtual void valueChange(void); virtual void focusIn(void); virtual void focusOut(void); virtual MSBoolean loseFocus(void); virtual void keyPress(const XEvent *,KeySym,unsigned int,const char *); virtual void buttonPress(const XEvent *); virtual void button1Press(const XEvent *); virtual void button2Press(const XEvent *); virtual void button3Press(const XEvent *); virtual void startEditing(const XEvent *); virtual void generateInputMask(void); //The following are all newly added to support cut and paste int _selectionStart; int _selectionEnd; int _firstCharacter; int _insertCursor; MSBoolean _hadFocus; MSBoolean _supportPasting; MSBoolean _pasting; int selectionStart(void) const {return _selectionStart;} void selectionStart(int selectionStart_) {_selectionStart=selectionStart_;} int selectionEnd(void) const {return _selectionEnd;} void selectionEnd(int selectionEnd_) {_selectionEnd=selectionEnd_;} int firstCharacter(void) const {return _firstCharacter;} void firstCharacter(int firstCharacter_) {_firstCharacter=firstCharacter_;} MSBoolean hadFocus(void) const {return _hadFocus;} int insertCursor(void) const {return _insertCursor;} void insertCursor(int insertCursor_) {_insertCursor=insertCursor_;} int pasting(void) const {return _pasting;} void pasting(MSBoolean pasting_) {_pasting=pasting_;} void clearSelection(MSBoolean redrawAlways_=MSTrue); void setSelection(int,int); int locateCursorPosition(int,const MSString &); MSBoolean insertString(int,const MSString &); MSBoolean isSelected(void); void updateEditor(void); void trackSelection(const XEvent *); int displayableFieldWidth(const char *,int); MSBoolean scrollLeft(void); MSBoolean scrollRight(const MSString &,int &); virtual MSBoolean validateInput(MSString &); virtual void updateFont(Font); virtual void updateSensitivity(void); virtual void button1Release(const XEvent *); virtual void selectionClear(const XEvent *); virtual const char *getPrimarySelection(MSString&, int&); virtual void insertPrimarySelection(void); virtual void currentColors(unsigned long &,unsigned long &); }; #endif aplus-fsf-4.22/src/MSGUI/MSEntryFieldCombo.H0000644000265000001440000000710010772770422014075 #ifndef MSEntryFieldComboHEADER #define MSEntryFieldComboHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include class MSArrow; class MSGUIExport MSEntryFieldCombo : public MSEntryField { public: enum TimerDirection {Up,Down}; class MSGUIExport RepeatTimer : public MSIntervalTimer { public: RepeatTimer(MSEntryFieldCombo *ef_,unsigned long interval_,TimerDirection direction_=Up); void direction(TimerDirection direction_); TimerDirection direction(void) const; MSEntryFieldCombo *entryField(void); virtual void process(void); protected: MSEntryFieldCombo *_entryField; TimerDirection _direction; }; class MSGUIExport DelayTimer : public MSRegularTimer { public: DelayTimer(MSEntryFieldCombo *ef_,unsigned long interval_,TimerDirection direction_=Up); void direction(TimerDirection direction_); TimerDirection direction(void) const; MSEntryFieldCombo *entryField(void); virtual void process(void); protected: MSEntryFieldCombo *_entryField; TimerDirection _direction; }; friend class DelayTimer; friend class RepeatTimer; public: MSEntryFieldCombo(MSWidget *,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSEntryFieldCombo(MSWidget *,const char *,const MSSymbol& tag_=MSSymbol::nullSymbol()); ~MSEntryFieldCombo(void); virtual void redraw(void); protected: enum ButtonFlag { UpDownArrows = 0x01, ComboButton = 0x02, TextButton = 0x04 }; MSBoolean buttonState(ButtonFlag) const; void buttonState(ButtonFlag, MSBoolean); unsigned long buttonColor(ButtonFlag) const; void buttonColor(ButtonFlag, unsigned long); void buttonColor(ButtonFlag, const char *); const MSString& comboButtonLabel(void) const; void comboButtonLabel(const MSString&); unsigned buttonSpacing(void) const; void buttonSpacing(unsigned); protected: unsigned _buttonSpacing; unsigned _buttonFlags; MSArrow *_upArrow; MSArrow *_downArrow; MSArrow *_comboArrow; RepeatTimer *_repeatTimer; DelayTimer *_delayTimer; MSString _buttonLabel; MSRect _buttonRect; MSBoolean _buttonSelected; void init(void); void setBit(ButtonFlag); void unsetBit(ButtonFlag); MSBoolean bitState(unsigned) const; MSArrow *upArrow(void); MSArrow *downArrow(void); RepeatTimer *repeatTimer(void); MSRect& buttonRect(void); MSBoolean comboOrTextButton(void) const; virtual void buttonPress(const XEvent *); virtual void buttonRelease(const XEvent *); virtual void placement(void); virtual void drawArrows(void); virtual void armUpArrow(void); virtual void armDownArrow(void); virtual unsigned computeValuePixelWidth(void); virtual unsigned computeButtonPixelWidth(void); virtual unsigned computeArrowPixelWidth(void); virtual unsigned computeDecorPixelWidth(void); virtual void labelPixelWidth(unsigned); virtual void drawComboButton(MSBoolean); virtual void drawTextButton(MSBoolean); virtual void up(void); virtual void down(void); virtual void textButtonActivate(void); virtual void buttonActivate(void); virtual void reference(void); void processDelayTimer(void); void startRepeatTimer(TimerDirection); void startDelayTimer(TimerDirection); void stopTimers(void); }; #endif aplus-fsf-4.22/src/MSGUI/MSEntryFieldPlus.H0000644000265000001440000000221010772770422013756 #ifndef MSEntryFieldPlusHEADER #define MSEntryFieldPlusHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSGUIExport MSEntryFieldPlus : public MSEntryFieldCombo { public: static const MSSymbol buttonactivate; MSEntryFieldPlus(MSWidget *,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSEntryFieldPlus(MSWidget *,const char *,const MSSymbol& tag_=MSSymbol::nullSymbol()); ~MSEntryFieldPlus(void); void arrowButtons(MSBoolean); MSBoolean arrowButtons(void) const; void arrowColor(unsigned long); void arrowColor(const char *); unsigned long arrowColor(void); const MSString& buttonLabel(void) const; void buttonLabel(const MSString&); virtual void set(MSAttrValueList&); virtual MSAttrValueList& get(MSAttrValueList&); protected: void init(void); virtual void textButtonActivate(void); }; #endif aplus-fsf-4.22/src/MSGUI/MSFloatArrayView.H0000644000265000001440000000327110772770422013754 #ifndef MSFloatArrayViewHEADER #define MSFloatArrayViewHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSGUIExport MSFloatArrayView : public MSNumericArrayView { protected: virtual unsigned numColumns(void) const; virtual unsigned numRows(void) const; virtual const char *formatOutput(MSString &,unsigned,unsigned); virtual MSBoolean validate(const char *,unsigned,unsigned); virtual void moveRow(int, int); MSFloatVector& array(void) { return (MSFloatVector&)*_model;} const MSFloatVector& array(void) const {return (MSFloatVector&)*_model;} void array(const MSFloatVector&); public: MSFloatArrayView(MSWidget *,const char *title_=0); MSFloatArrayView(MSWidget *,const MSStringVector&); MSFloatArrayView(MSWidget *,MSFloatVector&,const char *title_=0); MSFloatArrayView(MSWidget *,MSFloatVector&,const MSStringVector&); ~MSFloatArrayView(void); void model(MSFloatVector&); void model(const MSFloatVector&); MSFloatVector& viewModel(void) { return *((MSFloatVector*)_model); } const MSFloatVector& viewModel(void) const { return *((MSFloatVector*)_model); } MSFloatArrayView& operator=(const MSFloatVector& array_) {array(array_); return *this;} operator MSFloatVector&() const {return *((MSFloatVector *)_model);} }; typedef MSFloatArrayView MSFloatArray; // backward compatibility #endif aplus-fsf-4.22/src/MSGUI/MSFloatEntryField.H0000644000265000001440000000307210772770422014107 #ifndef MSFloatEntryFieldHEADER #define MSFloatEntryFieldHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include // We provide explicit "do_not_instantiate" pragmas here to avoid instantiation complications in // MStk applications. // #if !defined(__MSGUILIBRARY_BUILD__) && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma do_not_instantiate MSTypeEntryField #endif // !__MSGUILIBRARY_BUILD__ && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #if defined(MS_VC_NEED_TEMPLATE_EXPORT) class MSGUIExport MSTypeEntryField; #endif class MSGUIExport MSFloatEntryField : public MSTypeEntryField { protected: void init(void); public: MSFloatEntryField(MSWidget *,const char *label_=0, const MSSymbol& tag_=MSSymbol::nullSymbol()); MSFloatEntryField(MSWidget *,MSFloat&,const char *label_=0, const MSSymbol& tag_=MSSymbol::nullSymbol()); ~MSFloatEntryField(void); void increment(void); void decrement(void); MSFloatEntryField& operator=(double value_) {value(value_); return *this;} operator MSFloat&() {return *((MSFloat *)_model);} operator double() {return (double)value();} }; #endif aplus-fsf-4.22/src/MSGUI/MSFloatMatrixTraceSet.H0000644000265000001440000000404510772770422014742 #ifndef MSFloatMatrixTraceSetHEADER #define MSFloatMatrixTraceSetHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSGUIExport MSFloatMatrixTraceSet:public MSTraceSet { public: MSFloatMatrixTraceSet(MSGraph *,const char *legends_=0,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSFloatMatrixTraceSet(MSGraph *,const MSStringVector&,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSFloatMatrixTraceSet(MSGraph *,MSFloatMatrix&,const char *legends_=0,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSFloatMatrixTraceSet(MSGraph *,MSFloatMatrix&,const MSStringVector&,const MSSymbol& tag_=MSSymbol::nullSymbol()); ~MSFloatMatrixTraceSet(void); void model(MSFloatMatrix&); void model(const MSFloatMatrix&); MSFloatMatrix& viewModel(void) { return *((MSFloatMatrix*)_model); } const MSFloatMatrix& viewModel(void) const { return *((MSFloatMatrix*)_model); } MSFloatMatrixTraceSet& operator=(const MSFloatMatrix& matrix_) {matrix(matrix_); return *this;} operator MSFloatMatrix&() const {return *((MSFloatMatrix *)_model);} protected: MSFloatMatrix& matrix(void) {return *((MSFloatMatrix *)_model); } const MSFloatMatrix& matrix(void) const {return *((MSFloatMatrix *)_model); } void matrix(const MSFloatMatrix& v_) {if (MSView::model()!=0) matrix()=v_;} virtual int dataCount(void) const; virtual double x(int) const; virtual double y(int,int) const; virtual int numColumns(void) const; virtual void validate(int,int,double,double); virtual MSBoolean moveTraceValidate(double,double); virtual MSFloatMatrix asFloatMatrix(void) const; virtual MSTraceSet* copyTraceValidate(MSGraph*,const char*, const MSSymbol&); virtual const char *formatOutput(MSString &,unsigned,unsigned); }; #endif aplus-fsf-4.22/src/MSGUI/MSFloatMatrixView.H0000644000265000001440000000314310772770423014141 #ifndef MSFloatMatrixViewHEADER #define MSFloatMatrixViewHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSGUIExport MSFloatMatrixView : public MSNumericArrayView { protected: virtual unsigned numColumns(void) const; virtual unsigned numRows(void) const; virtual const char *formatOutput(MSString &,unsigned,unsigned); virtual MSBoolean validate(const char *,unsigned,unsigned); virtual void moveRow(int, int); MSFloatMatrix& matrix(void) { return (MSFloatMatrix&)*_model; } const MSFloatMatrix& matrix(void) const { return (MSFloatMatrix&)*_model; } void matrix(const MSFloatMatrix&); public: MSFloatMatrixView(MSWidget *,const char *title_=0); MSFloatMatrixView(MSWidget *,const MSStringVector&); MSFloatMatrixView(MSWidget *,MSFloatMatrix&,const char *title_=0); MSFloatMatrixView(MSWidget *,MSFloatMatrix&,const MSStringVector&); ~MSFloatMatrixView(void); void model(MSFloatMatrix&); void model(const MSFloatMatrix&); MSFloatMatrix& viewModel(void) { return *((MSFloatMatrix*)_model); } const MSFloatMatrix& viewModel(void) const { return *((MSFloatMatrix*)_model); } MSFloatMatrixView& operator=(const MSFloatMatrix& matrix_) { matrix(matrix_); return *this; } operator MSFloatMatrix&() const { return *((MSFloatMatrix *)_model); } }; #endif aplus-fsf-4.22/src/MSGUI/MSFloatTableColumn.H0000644000265000001440000000473310772770423014255 #ifndef MSFloatTableColumnHEADER #define MSFloatTableColumnHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSGUIExport MSFloatTableColumn : public MSTableColumn { public: MSFloatTableColumn(MSReportTable *,const char *heading_=0,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSFloatTableColumn(MSReportTable *,const MSStringVector&,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSFloatTableColumn(MSReportTable *,MSFloatVector&,const char *heading_=0,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSFloatTableColumn(MSReportTable *,MSFloatVector&,const MSStringVector&,const MSSymbol& tag_=MSSymbol::nullSymbol()); ~MSFloatTableColumn(void); void model(MSFloatVector&); void model(const MSFloatVector&); MSFloatVector& viewModel(void) { return (MSFloatVector&)*_model; } const MSFloatVector& viewModel(void) const { return (MSFloatVector&)*_model; } MSFloatTableColumn& operator=(const MSFloatVector& vector_); operator MSFloatVector&() const; virtual MSIndexVector gradeUp(void) const; virtual MSIndexVector gradeDown(void) const; virtual void permute(const MSIndexVector &); virtual void range(MSIndexVector &start_,MSIndexVector &end_); virtual MSIndexVector rangeGradeUp(const MSIndexVector &start_,const MSIndexVector &end_); virtual MSIndexVector rangeGradeDown(const MSIndexVector &start_,const MSIndexVector &end_); virtual unsigned numRows(void) const; virtual MSBoolean isDuplicate(unsigned); virtual MSBoolean breakCriteria(unsigned); virtual const char *formatOutput(MSString &,unsigned); virtual const char *formatBreak(MSString &,unsigned,unsigned); protected: virtual void breakProcess(MSIndexVector&); virtual MSBoolean validate(const char *,unsigned); virtual void moveRow(int from_,int to_); MSFloatVector& vector(void) { return (MSFloatVector&)*_model; } const MSFloatVector& vector(void) const { return (MSFloatVector&)*_model; } void vector(const MSFloatVector&); }; inline MSFloatTableColumn& MSFloatTableColumn::operator=(const MSFloatVector& vector_) { vector(vector_); return *this; } inline MSFloatTableColumn::operator MSFloatVector&() const { return *((MSFloatVector *)_model); } #endif aplus-fsf-4.22/src/MSGUI/MSFloatVectorTraceSet.H0000644000265000001440000000421410772770423014737 #ifndef MSFloatVectorTraceSetHEADER #define MSFloatVectorTraceSetHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSGUIExport MSFloatVectorTraceSet:public MSTraceSet { public: MSFloatVectorTraceSet(MSGraph *,const char *legends_=0,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSFloatVectorTraceSet(MSGraph *,const MSStringVector&,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSFloatVectorTraceSet(MSGraph *,MSFloatVector&,const char *legends_=0,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSFloatVectorTraceSet(MSGraph *,MSFloatVector&,const MSStringVector&,const MSSymbol& tag_=MSSymbol::nullSymbol()); ~MSFloatVectorTraceSet(void); void model(MSFloatVector&); void model(const MSFloatVector&); MSFloatVector& viewModel(void) { return *((MSFloatVector*)_model); } const MSFloatVector& viewModel(void) const { return *((MSFloatVector*)_model); } virtual void selectable(MSBoolean); virtual MSBoolean selectable(void) const; virtual void constraint(unsigned long); virtual unsigned long constraint(void) const; MSFloatVectorTraceSet& operator=(const MSFloatVector& vector_) {vector(vector_); return *this;} operator MSFloatVector&() const {return *((MSFloatVector *)_model);} protected: MSFloatVector& vector(void) {return (MSFloatVector&)*_model;} const MSFloatVector& vector(void) const {return (MSFloatVector&)*_model;} void vector(const MSFloatVector& v_) {if (MSView::model()!=0) vector()=v_;} virtual int dataCount(void) const; virtual double y(int,int) const; virtual void validate(int,int,double,double); virtual MSBoolean moveTraceValidate(double,double); virtual MSTraceSet* copyTraceValidate(MSGraph*,const char*, const MSSymbol&); virtual MSFloatMatrix asFloatMatrix(void) const; virtual const char *formatOutput(MSString &,unsigned,unsigned); }; #endif aplus-fsf-4.22/src/MSGUI/MSFontManager.H0000644000265000001440000000305610772770423013260 #ifndef MSFontManagerHEADER #define MSFontManagerHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSGUIExport MSFontHashTable : public MSHashTable { public: MSFontHashTable(void); MSFontHashTable(int size_); ~MSFontHashTable(void); }; class MSDisplayServer; class MSGUIExport MSFontManager { private: MSDisplayServer *_server; MSHashTable _fontIDHashTable; MSFontHashTable _fontDataHashTable; Font _defaultFontID; void init(void); MSFontHashTable& fontDataHashTable(void) {return _fontDataHashTable;} MSHashTable& fontIDHashTable(void) {return _fontIDHashTable;} const MSFontHashTable& fontDataHashTable(void) const {return _fontDataHashTable;} const MSHashTable& fontIDHashTable(void) const {return _fontIDHashTable;} public: MSFontManager(MSDisplayServer& server_); ~MSFontManager(void); void addFont(const char *fontString_); MSDisplayServer *server(void) const {return _server;} Font defaultFontID(void) const {return _defaultFontID;} Display *display(void) const {return _server->display();} Font fontID(const char *fontString_); const char *fontName(Font fid_) const; const XFontStruct *fontStruct(Font fid_) const; }; #endif aplus-fsf-4.22/src/MSGUI/MSFontObject.H0000644000265000001440000000742010772770423013113 #ifndef MSFontObjectHEADER #define MSFontObjectHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include class MSGUIExport MSFontObject { private: const XFontStruct *_fontStruct; const XCharStruct *charStruct(char) const; public: MSFontObject(const XFontStruct *pFontStruct_=0); ~MSFontObject(void); void fontStruct(const XFontStruct *); const XFontStruct *fontStruct(void) const; MSBoolean fixedWidth(void) const; MSBoolean doubleByte(void) const; Font font(void) const; int textAscent(void) const; int textDescent(void) const; int charWidth(void) const; int charLbearing(void) const; int charRbearing(void) const; int textHeight(void) const; int textWidth(const char *pString_) const; int textWidth(const char *pString_,int len_) const; int charWidth(char) const; int charLbearing(char) const; int charRbearing(char) const; }; inline const XFontStruct *MSFontObject::fontStruct(void) const { return _fontStruct; } inline void MSFontObject::fontStruct(const XFontStruct *fontStruct_) { _fontStruct=fontStruct_; } inline MSBoolean MSFontObject::fixedWidth(void) const { return MSBoolean(fontStruct()->per_char==0); } inline MSBoolean MSFontObject::doubleByte(void) const { if (fontStruct()->min_byte1 != 0 || fontStruct()->max_byte1 != 0) return MSTrue; else if (fontStruct()->max_char_or_byte2 > 255) return MSTrue; else return MSFalse; } inline int MSFontObject::textAscent(void) const { return fontStruct()->max_bounds.ascent; } inline int MSFontObject::textDescent(void) const { return fontStruct()->max_bounds.descent; } inline int MSFontObject::charWidth(void) const { return fontStruct()->max_bounds.width; } inline int MSFontObject::charLbearing(void) const { return fontStruct()->max_bounds.lbearing; } inline int MSFontObject::charRbearing(void) const { return fontStruct()->max_bounds.rbearing; } inline int MSFontObject::textHeight(void) const { return (textAscent()+textDescent()); } inline int MSFontObject::textWidth(const char *pString_) const { if (doubleByte()) return (pString_!=0)?(int)XTextWidth16((XFontStruct *)fontStruct(),(XChar2b*)pString_,strlen(pString_)/2):0; else return (pString_!=0)?(int)XTextWidth((XFontStruct *)fontStruct(),pString_,strlen(pString_)):0; } inline int MSFontObject::textWidth(const char *pString_,int len_) const { if (doubleByte()) return (pString_!=0)?(int)XTextWidth16((XFontStruct *)fontStruct(),(XChar2b*)pString_,len_/2):0; else return (pString_!=0)?(int)XTextWidth((XFontStruct *)fontStruct(),pString_,len_):0; } inline const XCharStruct *MSFontObject::charStruct(char c_) const { return &(fontStruct()->per_char[c_-fontStruct()->min_char_or_byte2]); } inline int MSFontObject::charWidth(char aChar_) const { return (fontStruct()->per_char!=0&&aChar_>=fontStruct()->min_char_or_byte2&& aChar_<=fontStruct()->max_char_or_byte2)?charStruct(aChar_)->width:charWidth(); } inline int MSFontObject::charLbearing(char aChar_) const { return (fontStruct()->per_char!=0&&aChar_>=fontStruct()->min_char_or_byte2 && aChar_<=fontStruct()->max_char_or_byte2)?charStruct(aChar_)->lbearing:charLbearing(); } inline int MSFontObject::charRbearing(char aChar_) const { return (fontStruct()->per_char!=0&&aChar_>=fontStruct()->min_char_or_byte2 && aChar_<=fontStruct()->max_char_or_byte2)?charStruct(aChar_)->rbearing:charRbearing(); } inline Font MSFontObject::font(void) const { return fontStruct()->fid; } #endif aplus-fsf-4.22/src/MSGUI/MSG.H0000644000265000001440000000211210772770423011235 #ifndef MSGHEADER #define MSGHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MSDefinesHEADER #include #endif #if defined(MS_HAS_MSG) // MSG is already used in #define MSG __MSGraphMSG #endif class MSG { public: MSG(void) {} ~MSG(void) {} enum GraphStyles {LastValue=256,Outside=512,Inside=1024}; enum AxisStyle {Axis=1,Std=2,Box=64}; enum AxisMode {Ascending=0,Descending=1}; enum Symbol {Cross=1,X=2,Square=4,Circle=8,Diamond=16,Triangle=32}; enum Style {Line=1,Outline=2,Area=4,Bar=8,Stack=16,Step=32,Scatter=64, Fill=128,Segment=256,Text=512,Pie=1024,Osc=2048,Close=4096,Candle=8192, HL=16384,HLOC=32768,HLC=65536,MarketProfile=131072,ColorProfile=262144}; enum Constraint {HoldX=1,HoldY=2}; enum Orientation {Vertical=64,Horizontal=128}; }; #endif aplus-fsf-4.22/src/MSGUI/MSGC.H0000644000265000001440000001343110772770423011346 #ifndef MSGCHEADER #define MSGCHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MSDisplayServerHEADER #include #endif #ifndef _XLIB_H_ #include #endif #include class MSGC { public: class List; class Data { friend class List; public: MSDisplayServer *_server; GC _gc; unsigned long _mask; MSBoolean _shared; char *_dashes; int _nDashes; XGCValues _values; int _count; Data(MSDisplayServer *server_,MSBoolean shared_,GC gc_,unsigned long mask_); ~Data(void); void dashes(const char *dashes_,int n_); void mask(unsigned long mask_); GC gc(void) const {return _gc;} unsigned long mask(void) const {return _mask;} MSDisplayServer *server(void) const {return _server;} Display *display(void) const {return _server->display();} MSBoolean shared(void) const {return _shared;} const XGCValues& values(void) const {return _values;} const char *dashes(void) const {return _dashes;} int nDashes(void) const {return _nDashes;} void increment(void) { _count++; } void decrement(void) { if (--_count==0) delete this; } int count(void) const { return _count; } }; class List { protected: int _size; int _count; Data **_array; int size(void) const { return _size; } void reserve(int size_); public: List(int size_); ~List(void); Data *data(int i_) const {return (i_>=0&&i_mask(mask_); } public: MSGC(void); MSGC(MSDisplayServer*, MSBoolean shared_, XGCValues *values, unsigned long mask_); MSGC(const MSGC&); ~MSGC(void); MSGC& operator=(const MSGC&); void setGCValues(MSDisplayServer *, MSBoolean, XGCValues *, unsigned long); MSBoolean isValid(void); static List& xgcList(void) {return _xgcList;} Data *data(void) const {return _data;} MSDisplayServer *server(void) const {return _server;} Display *display(void) const {return _server->display();} MSBoolean shared(void) const {return _data->_shared;} const XGCValues& values(void) const {return _data->_values;} unsigned long mask(void) const {return _data->_mask;} GC gc(void) const {return _data->_gc;} const char *dashes(void) const {return _data->_dashes;} int nDashes(void) const {return _data->_nDashes;} int function(void) const {return _data->_values.function;} unsigned long planeMask(void) const {return _data->_values.plane_mask;} unsigned long foreground(void) const {return _data->_values.foreground;} unsigned long background(void) const {return _data->_values.background;} int lineWidth(void) const {return _data->_values.line_width;} int lineStyle(void) const {return _data->_values.line_style;} int capStyle(void) const {return _data->_values.cap_style;} int joinStyle(void) const {return _data->_values.join_style;} int fillStyle(void) const {return _data->_values.fill_style;} int fillRule(void) const {return _data->_values.fill_rule;} int arcMode(void) const {return _data->_values.arc_mode;} Pixmap tile(void) const {return _data->_values.tile;} Pixmap stipple(void) const {return _data->_values.stipple;} int tsXOrigin(void) const {return _data->_values.ts_x_origin;} int tsYOrigin(void) const {return _data->_values.ts_y_origin;} Font font(void) const {return _data->_values.font;} int subwindowMode(void) const {return _data->_values.subwindow_mode;} int graphicsExposures(void) const {return _data->_values.graphics_exposures;} int clipXOrigin(void) const {return _data->_values.clip_x_origin;} int clipYOrigin(void) const {return _data->_values.clip_y_origin;} Pixmap clipMask(void) const {return _data->_values.clip_mask;} int dashOffset(void) const {return _data->_values.dash_offset;} void function(int func_); void planeMask(unsigned long mask_); void color(unsigned long fg_,unsigned long bg_); void foreground(unsigned long fg_); void background(unsigned long bg_); void lineWidth(int lw_); void lineStyle(int ls_); void capStyle(int cs_); void joinStyle(int js_); void fillStyle(int fs_); void fillRule(int fr_); void arcMode(int am_); void tile(Pixmap t_); void stipple(Pixmap s_); void tsXOrigin(int x_); void tsYOrigin(int y_); void font(Font fid_); void subwindowMode(int mode_); void graphicsExposures(int ge_); void clipXOrigin(int x_); void clipYOrigin(int y_); void clipMask(Pixmap mask_); void dashes(int dashOffset_,const char *dashList_,int n_); void clipRectangles(XRectangle *rects_,int n_,int ordering_); }; #endif aplus-fsf-4.22/src/MSGUI/MSGUIEnum.H0000644000265000001440000000163710772770423012333 #ifndef MSGUIEnumHEADER #define MSGUIEnumHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include enum MSAlignment {MSNone=0,MSCenter=2,MSLeft=4,MSRight=8,MSTop=16,MSBottom=32}; enum MSStatus {MSFailure=0,MSSuccess=1}; enum MSShadowStyle {MSRaised,MSSunken,MSEtchedIn,MSEtchedOut,MSFlat}; enum MSLineStyle {MSSolid=0,MSDot=1,MSDash=2}; enum MSWidgetIterationType {MSBreadthFirst,MSDepthFirst}; enum MSSelectionMode {MSSingle,MSBrowse,MSMultiple,MSToggle}; enum MSCycleColorMode {MSForeground,MSBackground,MSReverseVideo}; enum MSClipMode {MSNoClipping,MSClipStars,MSClipIndicator}; #endif aplus-fsf-4.22/src/MSGUI/MSGraph.H0000644000265000001440000016446310772770423012132 #ifndef MSGraphHEADER #define MSGraphHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifndef MSPointerArrayHEADER #include #endif class MSTrace; class MSReport; class MSTraceSet; class MSGraphStatusWin; class MSGraphLegend; class MSGraphEditor; class MSGraphNewtrace; class MSGraphPieData; class MSGraphPieLabelData; class MSGUIExport MSGraphEditor:public MSText { friend class MSGraph; public: MSGraphEditor(MSWidget *); ~MSGraphEditor(); MSGraph *graph(void) const {return (MSGraph *)owner();} void positionCursor(int pos_) {moveCursor(0,pos_);} virtual void save(void); virtual void escape(void); void stringVector(const MSStringVector&); // need these to make editor believe that it has the focus, but the // graph will forward all events virtual MSBoolean traverseFocus(MSWidget *); virtual MSWidget *inputFocus(void); virtual const MSWidget *inputFocus(void) const; }; class MSGUIExport MSGraphDoubleClickTimer:public MSRegularTimer { protected: MSGraph *_graph; public: MSGraphDoubleClickTimer(MSGraph *,unsigned long); ~MSGraphDoubleClickTimer(void); MSGraph *graph(void) const {return _graph;} virtual void process(void); }; class MSGUIExport MSGraphRepeatTimer : public MSIntervalTimer { protected: MSGraph *_graph; public: MSGraphRepeatTimer(MSGraph *,unsigned long); ~MSGraphRepeatTimer(void); MSGraph *graph(void) const {return _graph;} virtual void process(void); }; class MSGUIExport MSGraphNewtrace { protected: MSGraph *_graph; XPoint *_points; int _pointCount; int _pointAllocCount; public: MSGraphNewtrace(MSGraph *); ~MSGraphNewtrace(void); MSGraph *graph(void) const {return _graph;} int pointCount(void) const {return _pointCount;} int pointAllocCount(void) const {return _pointAllocCount;} void pointCount(int x_) {_pointCount=x_;} void pointAllocCount(int x_) {_pointAllocCount=x_;} XPoint *points(int index_); void pointsAlloc(void); void enterPoint(int,int); void drawLineSegments(int xOffset_=0,int yOffset=0); int sa(int i_) {return points(i_+1)->x-points(i_)->x;} int sb(int i_) {return points(i_+1)->y-points(i_)->y;} int left(int i_) {return sa(i_)>0?points(i_)->x:points(i_+1)->x;} int right(int i_) {return sa(i_)>0?points(i_+1)->x:points(i_)->x;} int top(int i_) {return sb(i_)>0?points(i_)->y:points(i_+1)->y;} int bot(int i_) {return sb(i_)>0?points(i_+1)->y:points(i_)->y;} double slope(int i_) {return sa(i_)!=0?(double)sb(i_)/(double)sa(i_):0.0;} }; class MSGUIExport MSGraph : public MSComposite, public MSPrintItem, public MSG { friend class MSGraphRepeatTimer; friend class MSGraphDoubleClickTimer; friend class MSGraphStatusWin; friend class MSGraphLegend; friend class MSTrace; friend class MSTraceSet; friend class MSGraphEditor; friend class MSGraphNewtrace; public: MSGraph(MSWidget *,const char *title_=0,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSGraph(MSWidget *,const MSStringVector&,const MSSymbol& tag_=MSSymbol::nullSymbol()); ~MSGraph(void); enum UnsetType {Unset}; enum GraphMode {Standard=1,Normalize=2,Optimize=4,PieChart=8}; enum GraphUIMode {Normal=16,AddTrace=32,AddTextTrace=2048,MoveTrace=4096}; virtual void unfreeze(void); virtual void redraw(void); virtual void print(const char *file_=0); virtual MSWidgetVector children(void); void redrawForPrint(void); MSBoolean backingStore(void); MSBoolean debug(void); static void debug(MSBoolean); const MSSymbol& tag(void) const {return _tag;} void tag(const MSSymbol& x_) {_tag=x_;} // // MSPrintTool print methods // virtual int computePrintSize(MSReport*,int,int,int,int,int,int); virtual int print(MSReport*,int,int,int,int,int,int); virtual const MSSymbol& printTag(void) const; int printGraph(MSReport*,int,int); void printGraphFrame(MSReport*,int,int,int,int); int printWidth(void) const {return _printWidth;} int pageWidth(void) const {return _pageWidth;} int frameLineWidth(void) const {return _frameLineWidth;} void printWidth(int x_) {_printWidth=x_;} void pageWidth(int x_) {_pageWidth=x_;} void frameLineWidth(int x_) {_frameLineWidth=x_;} // // MSPrintItem methods // MSGraph& leftMargin(double); MSGraph& rightMargin(double); MSGraph& topOffset(double); MSGraph& bottomOffset(double); MSGraph& topPixel(unsigned); MSGraph& bottomPixel(unsigned); MSGraph& justification(MSAlignment); MSGraph& justification(unsigned long); MSGraph& printRow(int); MSGraph& printColumn(int); MSGraph& style(unsigned long); MSGraph& pageAlignment(MSAlignment); MSGraph& pageAlignment(unsigned long); double leftMargin(void) const; double rightMargin(void) const; double topOffset(void) const; double bottomOffset(void) const; unsigned topPixel(void) const; unsigned bottomPixel(void) const; unsigned long justification(void) const; int printRow(void) const; int printColumn(void) const; unsigned long style(void) const; unsigned long pageAlignment(void) const; // // Trace interface methods // const MSTraceSet *graphTraceSet(const MSSymbol& tag_) const; const MSTrace *graphTrace(const MSSymbol& tag_) const; MSTraceSet *graphTraceSet(const MSSymbol& tag_); MSTrace *graphTrace(const MSSymbol& tag_); int traceCount(void) {return traceList().count();} int traceSetCount(void) {return traceSetList().count();} // // Graph size/range attributes // inline double zoomMinimum(MSAlignment); inline double zoomMaximum(MSAlignment); inline double axisMinimum(MSAlignment) const; inline double axisMaximum(MSAlignment) const; inline double axisLabelIncrement(MSAlignment) const; inline double axisSubLabelIncrement(MSAlignment) const; void axisMinimum(UnsetType,MSAlignment i_) {axisMinimum((double)unsetValue(),i_);} void axisMaximum(UnsetType,MSAlignment i_) {axisMaximum((double)unsetValue(),i_);} void axisMinimum(double x_,MSAlignment i_) {axisMinimum(x_,(unsigned long)i_);} void axisMaximum(double x_,MSAlignment i_) {axisMaximum(x_,(unsigned long)i_);} void axisLabelIncrement(double x_,MSAlignment i_) {axisLabelIncrement(x_,(unsigned long)i_);} void axisSubLabelIncrement(double x_,MSAlignment i_) {axisSubLabelIncrement(x_,(unsigned long)i_);} void axisMinimum(double,unsigned long); void axisMaximum(double,unsigned long); void axisLabelIncrement(double,unsigned long); void axisSubLabelIncrement(double,unsigned long); // // Graph interactive method attributes // MSFloatMatrix createInteractiveTraceData(unsigned long); MSTraceSet *createTraceSet(MSFloatMatrix&,const char* legend_=0,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSTraceSet *createTextTraceSet(MSFloatMatrix&,MSStringVector&); MSFloatMatrix& interactiveData() {return _interactiveData;} const MSFloatMatrix& interactiveData() const {return _interactiveData;} const MSTrace *selectTrace(void) const {return _selectTrace;} MSTrace *selectTrace(void) {return _selectTrace;} int selectDistance(void) const {return _selectDistance;} unsigned long graphMode(void) const {return _graphMode;} GraphUIMode graphUIMode(void) const {return _graphUIMode;} void selectDistance(int x_) {_selectDistance=x_;} void selectTrace(MSTrace *x_) {_selectTrace=x_;} void graphMode(unsigned long); void graphMode(GraphMode); void graphUIMode(GraphUIMode); void zoom(void); void unzoom(void); const MSStringVector& interactiveTraceTags() const {return _interactiveTraceTags;} void interactiveTraceTags(const MSStringVector& tags_) {_interactiveTraceTags=tags_; } const MSString& defaultTraceTag() const {return _defaultTraceTag; } void defaultTraceTag(const MSString& tag_) {_defaultTraceTag=tag_; } void xCursorValue(MSAlignment i_,double x_) {if (interactivePixel().length()>0) interactivePixel()(0,0)=xValueToPixel(x_,i_&MSTop?1:0);} void yCursorValue(MSAlignment i_,double x_) {if (interactivePixel().length()>0) interactivePixel()(0,1)=yValueToPixel(x_,i_&MSRight?1:0);} double xCursorValue(MSAlignment i_=MSLeft) {return interactivePixel().length()>0?xPixelToValue(interactivePixel()(0,0),i_&MSTop?1:0):0;} double yCursorValue(MSAlignment i_=MSBottom) {return interactivePixel().length()>0?yPixelToValue(interactivePixel()(0,1),i_&MSRight?1:0):0;} // // Graph axis/rule attributes // unsigned long axis(void) const {return _axis;} unsigned long axisRule(void) const {return _axisRule;} unsigned long grid(void) const {return _grid;} unsigned long zeroAxis(void) const {return _zeroAxis;} unsigned long gridStyle(void) const {return _gridStyle;} unsigned long zeroAxisStyle(void) const {return _zeroAxisStyle;} int gridWeight(void) const {return _gridWeight;} int zeroAxisWeight(void) const {return _zeroAxisWeight;} int gridWidth(void) const {return _gridWidth;} int zeroAxisWidth(void) const {return _zeroAxisWidth;} unsigned long gridForeground(void) const {return _gridForeground;} unsigned long zeroAxisForeground(void) const {return _zeroAxisForeground;} double leftAxisDataMargin(MSAlignment x_) const {return _yMargin[0][MSTop&x_?0:1];} double rightAxisDataMargin(MSAlignment x_) const {return _yMargin[1][MSTop&x_?0:1];} double topAxisDataMargin(MSAlignment x_) const {return _xMargin[1][MSLeft&x_?0:1];} double bottomAxisDataMargin(MSAlignment x_) const {return _xMargin[0][MSLeft&x_?0:1];} inline AxisMode axisMode(MSAlignment) const; void axisMode(AxisMode x_,MSAlignment i_) {axisMode(x_,(unsigned long)i_);} void axisMode(AxisMode,unsigned long); double margin(MSAlignment x_) const {return _margin[MSLeft&x_?0:MSTop&x_?1:MSRight&x_?2:3];} void margin(double,unsigned long); void axis(unsigned long); void axisRule(unsigned long); void grid(unsigned long); void gridStyle(unsigned long); void gridWidth(unsigned); void gridWeight(unsigned); void gridForeground(const char *); void gridForeground(unsigned long); void zeroAxis(unsigned long); void zeroAxisStyle(unsigned long); void zeroAxisWidth(unsigned); void zeroAxisWeight(unsigned); void zeroAxisForeground(const char *); void zeroAxisForeground(unsigned long); void topAxisDataMargin(double,unsigned long); void bottomAxisDataMargin(double,unsigned long); void leftAxisDataMargin(double,unsigned long); void rightAxisDataMargin(double,unsigned long); void topAxisDataMargin(double x_,MSAlignment i_) {topAxisDataMargin(x_,(unsigned long)i_);} void bottomAxisDataMargin(double x_,MSAlignment i_) {bottomAxisDataMargin(x_,(unsigned long)i_);} void leftAxisDataMargin(double x_,MSAlignment i_) {leftAxisDataMargin(x_,(unsigned long)i_);} void rightAxisDataMargin(double x_,MSAlignment i_) {rightAxisDataMargin(x_,(unsigned long)i_);} // // Graph legend attributes // unsigned long legendAlignment(void) const {return _legendAlign;} unsigned long legendStyle(void) const {return _legendStyle;} double xLegendPosition(void) const {return _xLegendPosition;} double yLegendPosition(void) const {return _yLegendPosition;} void legendAlignment(MSAlignment); void legendAlignment(unsigned long); void legendStyle(unsigned long); void xLegendPosition(double); void yLegendPosition(double); void legendFont(const char *); void legendFont(Font); void legendForeground(const char *); void legendForeground(unsigned long); void legendBackground(const char *); void legendBackground(unsigned long); void legendHighlightThickness(int); void legendShadowThickness(int); Font legendFont(void) const; unsigned long legendForeground(void) const; unsigned long legendBackground(void) const; int legendShadowThickness(void) const; int legendHighlightThickness(void) const; // // subtitle methods // const MSStringVector& subtitle(void) const {return _subtitle;} unsigned long subtitleForeground(void)const {return _subtitleForeground;} Font subtitleFont(void) const {return _subtitleFont;} MSAlignment subtitleAlignment(void) const {return _subtitleAlign;} void subtitle(const MSStringVector&); void subtitleAlignment(MSAlignment); void subtitleForeground(const char *); void subtitleForeground(unsigned long); void subtitleFont(const char *); void subtitleFont(Font); // // footnote methods // const MSStringVector& footnote(void) const {return _footnote;} unsigned long footnoteForeground(void) const {return _footnoteForeground;} Font footnoteFont(void) const {return _footnoteFont;} MSAlignment footnoteAlignment(void) const {return _footnoteAlign;} void footnote(const MSStringVector&); void footnoteAlignment(MSAlignment); void footnoteForeground(const char *); void footnoteForeground(unsigned long); void footnoteFont(const char *); void footnoteFont(Font); // // axis title methods // inline const MSStringVector& axisTitle(MSAlignment) const; inline unsigned long axisTitleForeground(MSAlignment) const; inline Font axisTitleFont(MSAlignment) const; inline MSAlignment axisTitleAlignment(MSAlignment) const; inline MSAlignment axisLabelAlignment(MSAlignment) const; inline MSAlignment axisSubLabelAlignment(MSAlignment) const; inline MSLabelOutPtr axisLabelOut(MSAlignment) const; inline MSLabelOutPtr axisSubLabelOut(MSAlignment) const; void axisTitle(const MSStringVector& x_,MSAlignment i_) {axisTitle(x_,(unsigned long)i_);} void axisTitleForeground(const char *x_,MSAlignment i_) {axisTitleForeground(x_,(unsigned long)i_);} void axisTitleForeground(unsigned long x_,MSAlignment i_) {axisTitleForeground(x_,(unsigned long)i_);} void axisTitleFont(const char *x_,MSAlignment i_) {axisTitleFont(x_,(unsigned long)i_);} void axisTitleFont(Font x_,MSAlignment i_) {axisTitleFont(x_,(unsigned long)i_);} void axisTitleAlignment(MSAlignment x_,MSAlignment i_) {axisTitleAlignment(x_,(unsigned long)i_);} void axisTitleAlignment(unsigned long x_,MSAlignment i_) {axisTitleAlignment(x_,(unsigned long)i_);} void axisLabelAlignment(MSAlignment x_,MSAlignment i_) {axisLabelAlignment(x_,(unsigned long)i_);} void axisSubLabelAlignment(MSAlignment x_,MSAlignment i_) {axisSubLabelAlignment(x_,(unsigned long)i_);} void axisTitle(const MSStringVector&,unsigned long); void axisTitleForeground(const char *,unsigned long); void axisTitleForeground(unsigned long,unsigned long); void axisTitleFont(const char *,unsigned long); void axisTitleFont(Font,unsigned long); void axisTitleAlignment(MSAlignment,unsigned long); void axisTitleAlignment(unsigned long,unsigned long); void axisLabelAlignment(MSAlignment,unsigned long); void axisSubLabelAlignment(MSAlignment,unsigned long); inline void axisLabelOut(MSLabelOut *x_,MSAlignment i_); inline void axisSubLabelOut(MSLabelOut *x_,MSAlignment i_); inline void axisLabelOut(MSLabelOut *,unsigned long); inline void axisSubLabelOut(MSLabelOut *,unsigned long); void axisLabelOut(MSLabelOutPtr,unsigned long); void axisSubLabelOut(MSLabelOutPtr,unsigned long); // // axis attributes // inline unsigned long axisForeground(MSAlignment) const; inline Font axisLabelFont(MSAlignment) const; void axisRuleWidth(int); int axisRuleWidth(void) const {return _axisRuleWidth;} void axisForeground(const char *x_,MSAlignment i_) {axisForeground(x_,(unsigned long)i_);} void axisForeground(unsigned long x_,MSAlignment i_) {axisForeground(x_,(unsigned long)i_);} void axisLabelFont(const char *x_,MSAlignment i_) {axisLabelFont(x_,(unsigned long)i_);} void axisLabelFont(Font x_,MSAlignment i_) {axisLabelFont(x_,(unsigned long)i_);} void axisForeground(const char *,unsigned long); void axisForeground(unsigned long,unsigned long); void axisLabelFont(const char *,unsigned long); void axisLabelFont(Font,unsigned long); // // tick parameters // inline unsigned long tickStyle(MSAlignment) const; inline int minorTicks(MSAlignment) const; inline int majorTickSize(MSAlignment) const; inline int minorTickSize(MSAlignment) const; void tickStyle(unsigned long x_,MSAlignment i_) {tickStyle(x_,(unsigned long)i_);} void minorTicks(unsigned x_,MSAlignment i_) {minorTicks(x_,(unsigned long)i_);} void majorTickSize(unsigned x_,MSAlignment i_) {majorTickSize(x_,(unsigned long)i_);} void minorTickSize(unsigned x_,MSAlignment i_) {minorTickSize(x_,(unsigned long)i_);} void tickStyle(unsigned long,unsigned long); void minorTicks(unsigned,unsigned long); void majorTickSize(unsigned,unsigned long); void minorTickSize(unsigned,unsigned long); // // bar graph parameters // int maxBarWidth(void) const {return _maxBarWidth;} void maxBarWidth(unsigned); // // pie graph parameters // double pieOffsetMargin(void) const {return _pieOffsetMargin;} void pieOffsetMargin(double); // // void orientation(Orientation x_); unsigned long orientation(void) const {return _orientation; } // // editor interface methods // const char *editorString(void) const {return _editor->string();} unsigned long editorFont(void) const {return _editor->MSWidget::font();} unsigned long editorForeground(void) const {return _editor->MSWidget::foreground();} unsigned long editorBackground(void) const {return _editor->MSWidget::background();} void editorFont(const char *x_) {_editor->font(server()->fontID(x_));} void editorFont(Font x_) {_editor->font(x_);} void editorForeground(const char *x_) {_editor->foreground(server()->pixel(x_));} void editorForeground(unsigned long x_) {_editor->foreground(x_);} void editorBackground(const char *x_) {_editor->background(server()->pixel(x_));} void editorBackground(unsigned long x_) {_editor->background(x_);} // // trace defaults // const MSStringVector& defaultTraceLineColors(void) const {return _defaultLineColors;} const MSStringVector& defaultTraceFillColors(void) const {return _defaultFillColors;} void defaultTraceLineColors(MSStringVector& x_) {_defaultLineColors=x_;} void defaultTraceFillColors(MSStringVector& x_) {_defaultFillColors=x_;} protected: enum CursorType {XYcursor,Xcursor,Ycursor}; // // Trace interface methods // const MSTraceSet *graphTraceSet(unsigned i_) const {return traceSetList().array(i_);} const MSTrace *graphTrace(unsigned i_) const {return traceList().array(i_);} MSTraceSet *graphTraceSet(unsigned i_) {return traceSetList().array(i_);} MSTrace *graphTrace(unsigned i_) {return traceList().array(i_);} // // redraw/event methods // void init(void); MSLabelFormat& outFmt(void) const {return _outFormat;} MSLabelOut& labelOut(void) const {return _labelOut;} virtual void firstMapNotify(void); virtual void naturalSize(void); virtual void computeSize(void); virtual void placement(void); virtual void redrawImmediately(MSBoolean update_=MSFalse,MSBoolean append_=MSFalse); void redrawSansRescale(void); virtual MSBoolean loseFocus(void); virtual void keyPress(const XEvent *,KeySym,unsigned int,const char *); virtual void keyRelease(const XEvent *); virtual void keyRelease(const XEvent *,KeySym,unsigned,const char*); virtual void motionNotify(const XEvent *); virtual void buttonPress(const XEvent *); virtual void buttonRelease(const XEvent *); virtual void button1Press(const XEvent *); virtual void button2Press(const XEvent *); virtual void button3Press(const XEvent *); virtual void configure(void); virtual void focusIn(void); virtual void focusOut(void); virtual void visibilityObscured(void); virtual void visibilityUnobscured(void); virtual void insertChild(MSWidget *); virtual void removeChild(MSWidget *); virtual void childInsert(MSWidget *); virtual void childRemove(MSWidget *); virtual void childCreate(MSWidget *); virtual void childDestroy(MSWidget *); // // GC methods // GC clearGC(void) {return _clearGC;} GC textGC(void) {return _textGC;} GC subtitleGC(void) {return _subtitleGC;} GC footnoteGC(void) {return _footnoteGC;} GC windowGC(void) {return _windowGC;} GC axisTitleGC(void) {return _axisTitleGC;} GC axisGC(void) {return _axisGC;} GC gridGC(void) {return _gridGC;} GC zeroGC(void) {return _zeroGC;} GC traceGC(void) {return _traceGC;} // // Axis methods // int *yGridWidth(void) {return _yGridWidth;} int yGridWidth(int i) {return _yGridWidth[i];} int *yGrid(void) {return _yGrid;} int yGrid(int i) {return _yGrid[i];} int yGridCount(void) {return _yGridCount;} int *xGridWidth(void) {return _xGridWidth;} int xGridWidth(int i) {return _xGridWidth[i];} int *xGrid(void) {return _xGrid;} int xGrid(int i) {return _xGrid[i];} int xGridCount(void) {return _xGridCount;} void yGridWidth(int i,int x_) {_yGridWidth[i]=x_;} void yGrid(int i,int x_) {_yGrid[i]=x_;} void yGridCount(int x_) {_yGridCount=x_;} void xGridWidth(int i,int x_) {_xGridWidth[i]=x_;} void xGrid(int i,int x_) {_xGrid[i]=x_;} void xGridCount(int x_) {_xGridCount=x_;} // // Object pointers // Pixmap graphPixmap(void) const {return _graphPixmap->pixmap();} Cursor zoomCursor(void) const {return _zoomCursor->cursor();} Cursor drawCursor(void) const {return _drawCursor->cursor();} Cursor lineCursor(void) const {return _lineCursor->cursor();} MSGraphStatusWin *dataWin(void) const {return _dataWin;} MSGraphLegend *legend(void) const {return _legend;} MSGraphEditor *editor(void) const {return _editor;} // // Status methods // MSBoolean showXaxis(int i_); MSBoolean showYaxis(int i_); MSBoolean showXrule(int i_); MSBoolean showYrule(int i_); MSBoolean xShowPos(void) {return _xShowPos;} MSBoolean yShowPos(void) {return _yShowPos;} MSBoolean keyPressStatus(void) {return _keyPressStatus;} MSBoolean updateLegendStatus(void) {return _updateLegendStatus;} MSBoolean graphZoomStatus(void) {return _graphZoomStatus;} unsigned long cursorType(void) {return _cursorType;} void showXaxis(MSBoolean x_,int i_) {_showXaxis[i_]=x_;} void showYaxis(MSBoolean x_,int i_) {_showYaxis[i_]=x_;} void showXrule(MSBoolean x_,int i_) {_showXrule[i_]=x_;} void showYrule(MSBoolean x_,int i_) {_showYrule[i_]=x_;} void xShowPos(MSBoolean x_) {_xShowPos=x_;} void yShowPos(MSBoolean x_) {_yShowPos=x_;} void keyPressStatus(MSBoolean x_) {_keyPressStatus=x_;} void updateLegendStatus(MSBoolean x_){_updateLegendStatus=x_;} void graphZoomStatus(MSBoolean x_) {_graphZoomStatus=x_;} void cursorType(CursorType x_) {_cursorType=x_;} // // PlotArea methods // MSRect *plotAreaRect(void) {return &_plotAreaRect;} MSRect *updateRect(void) {return &_updateRect;} int y_org(void) {return _y_org;} int x_org(void) {return plotAreaRect()->x();} int y_end(void) {return _y_end;} int x_end(void) {return _x_end;} // // Scale/sizing methods // int xMinZoom(void) {return _xMinZoom;} int xMaxZoom(void) {return _xMaxZoom;} int yMinZoom(void) {return _yMinZoom;} int yMaxZoom(void) {return _yMaxZoom;} double xScaleReal(int i_) {return _xScaleReal[i_];} double xBaseReal(int i_) {return _xBaseReal[i_];} double xMinReal(int i_) {return _xMinReal[i_];} double xMaxReal(int i_) {return _xMaxReal[i_];} double xMin(int i_) {return _xMin[i_];} double yMin(int i_) {return _yMin[i_];} double xMax(int i_) {return _xMax[i_];} double yMax(int i_) {return _yMax[i_];} double xScale(int i_) {return _xScale[i_];} double yScale(int i_) {return _yScale[i_];} double xBase(int i_) {return _xBase[i_];} double yBase(int i_) {return _yBase[i_];} double xMinData(int i_) {return _xMinData[i_];} double xMaxData(int i_) {return _xMaxData[i_];} double yMinData(int i_) {return _yMinData[i_];} double yMaxData(int i_) {return _yMaxData[i_];} double xIncData(int i_,int l_=0) {return _xIncData[i_][l_];} double yIncData(int i_) {return _yIncData[i_];} double normalizedLabelInc(void) {return _normalizedLabelInc;} void xMinZoom(int x_) {_xMinZoom=x_;} void xMaxZoom(int x_) {_xMaxZoom=x_;} void yMinZoom(int x_) {_yMinZoom=x_;} void yMaxZoom(int x_) {_yMaxZoom=x_;} void xScaleReal(double x_,int i_) {_xScaleReal[i_]=x_;} void xBaseReal(double x_,int i_) {_xBaseReal[i_]=x_;} void xMinReal(double x_,int i_) {_xMinReal[i_]=x_;} void xMaxReal(double x_,int i_) {_xMaxReal[i_]=x_;} void xMin(double x_,int i_) {_xMin[i_]=x_;} void yMin(double x_,int i_) {_yMin[i_]=x_;} void xMax(double x_,int i_) {_xMax[i_]=x_;} void yMax(double x_,int i_) {_yMax[i_]=x_;} void xScale(double x_,int i_) {_xScale[i_]=x_;} void yScale(double x_,int i_) {_yScale[i_]=x_;} void xBase(double x_,int i_) {_xBase[i_]=x_;} void yBase(double x_,int i_) {_yBase[i_]=x_;} void xMinData(double x_,int i_) {_xMinData[i_]=x_;} void xMaxData(double x_,int i_) {_xMaxData[i_]=x_;} void yMinData(double x_,int i_) {_yMinData[i_]=x_;} void yMaxData(double x_,int i_) {_yMaxData[i_]=x_;} void xIncData(double x_,int i_,int l_=0) {_xIncData[i_][l_]=x_;} void yIncData(double x_,int i_) {_yIncData[i_]=x_;} void xMinSet(double x_,int i_) {_xMinSet[i_]=x_;} void yMinSet(double x_,int i_) {_yMinSet[i_]=x_;} void xMaxSet(double x_,int i_) {_xMaxSet[i_]=x_;} void yMaxSet(double x_,int i_) {_yMaxSet[i_]=x_;} void normalizedLabelInc(double x_) {_normalizedLabelInc=x_;} inline int xValueToPixel(double,int); inline int yValueToPixel(double,int); inline double normalizedPixelToValue(int,int); inline double xPixelToValue(int,int); inline double yPixelToValue(int,int); // // Internal dimensions // int pieCount(void) {return _pieCount;} int barCount(void) {return _barCount;} int barWidth(void) {return _barWidth;} int xBar(void) {return _xBar;} int offset(void) {return highlightThickness()+shadowThickness();} int leftMargin(void) {return offset()+(int)(_margin[0]*width());} int rightMargin(void) {return offset()+(int)(_margin[1]*width());} int topMargin(void) {return offset()+(int)(_margin[2]*height());} int bottomMargin(void) {return offset()+(int)(_margin[3]*height());} int titleHeight(void) {return _titleHeight;} int subtitleHeight(void) {return _subtitleHeight;} int footnoteHeight(void) {return _footnoteHeight;} void titleHeight(int x_) {_titleHeight=x_;} void subtitleHeight(int x_) {_subtitleHeight=x_;} void footnoteHeight(int x_) {_footnoteHeight=x_;} double estimateNormalizedLabelValue(int,double); int fontSize(Font); Font adjustFontSize(Font,int); int indexOfLongestString(MSStringVector&); int maxStringWidth(XFontStruct*,MSStringVector&); // // Pie graph methods // void pieCount(int x_) {_pieCount=x_;} // // Bar graph methods // void barWidth(int); void barCount(int x_) {_barCount=x_;} void xBar(int x_) {_xBar=x_;} // // Draw methods // void computeNormalizedOffsets(void); void computeExtents(void); void computeXincrement(int level_=0); void computeUpdateRegion(MSTrace *); void computeScales(void); int computeXscales(int&,int&,int); int computeYscale(int); void appendDataPoint(MSTrace *); void drawGraph(MSBoolean update_=MSFalse); void drawYaxes(int); void drawAxes(void); void drawXaxes(int); void drawXsubLabels(int); void drawRule(void); void drawGrid(void); void drawZeroAxis(void); void drawRules(void); void drawHtraces(MSBoolean update_=MSFalse); void drawVtraces(MSBoolean update_=MSFalse); void drawTitle(Window); void drawSubtitle(Window); void drawFootnote(Window); void positionLegend(unsigned long); void computeLegendSize(void); void drawLegends(void); void moveLegend(const XEvent *); void drawLegendSymbols(MSTrace *,int,int,int index=0); void drawLegendScatterSymbols(Window,GC,MSTrace*,int,int); void drawXtitle(void); void drawYtitle(void); void drawYaltAxisTitle(void); void plotTextTrace(MSTrace **,int); void drawVerticalString(GC,int,int,const char *,int,XFontStruct*); inline void fillPolygons(Display *,Window,GC,XPoint *,int,int,int,int); // // Plot methods // void setLineAttributes(unsigned long,int,GC,int,int,int); int setLineWidth(MSTrace *); void plotLineTrace(MSTrace *,int,int,int); void plotFillTrace(MSTrace *,MSBoolean); void drawMoveLineTrace(MSTrace *); void drawMoveTrace(MSTrace *); void plotOutlineTrace(MSTrace *,int,int,int); void plotScatterTrace(MSTrace *,int,int,int); void drawScatterSymbols(Window,GC,MSTrace*,void*,int,unsigned long,unsigned long,XFontStruct*); void plotAreaTrace(MSTrace **,int,MSBoolean mode_=MSFalse); void plotStackTrace(MSTrace **,int&,int,MSBoolean mode_=MSFalse); void plotBarTrace(MSTrace *,int,int,int,int); void plotHBarTrace(MSTrace *); void plotHighLowTrace(MSTrace *,int,int,int); void plotOpenTicks(MSTrace *,int,int,int); void plotCloseTicks(MSTrace *,int,int,int); void plotCandleTrace(MSTrace *,int,int,int); void plotHStackTrace(MSTrace *); void plotStepTrace(MSTrace *,int,int,int); void plotBetweenTrace(MSTrace *); void plotPieTrace(MSTrace *); void plotSegmentTrace(MSTrace *,Window,GC); void plotMarketProfile(MSTrace *,int); // // Pie drawing methods // void computePieData(MSTrace*,MSGraphPieData*); void computeDrawingSequence(MSGraphPieData*); void computePieLabels(MSTrace *,const MSGraphPieData*,MSGraphPieLabelData*); void drawPieSlices(MSTrace *,const MSGraphPieData*,int,int); void drawLabels(MSTrace *,const MSGraphPieLabelData*); void clearPieData(void); void alignPieLabels(MSTrace *,MSStringVector&,MSStringVector&,const MSStringVector&,unsigned); // // Format methods // inline unsigned long formatAlignment(unsigned long); inline const char *formatAxisLabel(MSString &,MSLabelOut&,double,MSBoolean plus_=MSFalse); inline const char *formatTimeLabel(MSString &,double); // X, Y values accesss methods // inline double xValue(MSTrace*,int); inline double yValue(MSTrace*,int); inline double xValueMin(MSTrace*); inline double xValueMax(MSTrace*); inline double yValueMin(MSTrace*); inline double yValueMax(MSTrace*); // // Interactive methods // void drawLineSegments(void); void drawLineHandles(int pt_=-1); void drawLineHandles(MSTrace *,MSTrace *refTrace=0); void moveLineHandle(const XEvent *); void drawMoveLineHandleSymbols(int,int); MSBoolean addLineSegment(const XEvent *); MSBoolean moveLineSegment(const XEvent *,MSBoolean copy_=MSFalse); MSBoolean findLineHandle(int,int); MSBoolean findLineSegment(int,int); MSBoolean findSelectTraceLineHandle(int,int); int findSelectedSlice(MSTrace *,int,int); MSTrace *findSelectableTrace(const XEvent *); MSTrace *findTextTrace(const XEvent *); MSTrace *findDataPoint(const XEvent *); int findYvalue(MSTrace *,double); double findMaxYvalue(void); void moveDataPoint(const XEvent *); void drawScanXYvalueBox(int,int); void drawMoveDataPointValueBox(int,int); void drawMoveDataPointSymbols(MSTrace *,int,int); void enterTextTrace(void); void editTextTrace(void); void enterTrace(const XEvent *); void moveTextTrace(const XEvent *); void moveTrace(const XEvent *); void deleteTrace(void); void drawCursor(const XEvent *); void drawPixelPosition(const XEvent *event_); void scanXY(const XEvent *); void drawScanXvalues(int x_=0,int y_=0,int i_=0,int *lastIndex_=0); void drawScanXYvalues(double,double,int,int); void drawYdata(MSTrace *,int,int,int); MSBoolean drawZoomRegion(const XEvent *); void shiftZoomWindow(KeySym); virtual void copyTrace(MSTrace *); virtual MSBoolean moveTraceValidate(MSTrace *); const MSString& interactiveTag(void) const; // // Highlight methods // MSBoolean highlightLegendStatus(void) {return _highlightLegendStatus;} MSBoolean highlightTraceStatus(void) {return _highlightTraceStatus;} void highlightLegendStatus(MSBoolean x_) {_highlightLegendStatus=x_; drawLegends();} void highlightTraceStatus(MSBoolean x_) {_highlightTraceStatus=x_;} void highlightPoint(MSTraceSet *); void highlightTrace(void); void unHighlightTrace(void); void highlightTextTrace(void); void unHighlightTextTrace(void); // // Trace symbol methods // void buildSquareSymbol(void*,int&,int,int,int); void buildCircleSymbol(void*,int&,int,int,int); void buildStarSymbol(void*,int&,int,int,int); void buildCrossSymbol(void*,int&,int,int,int); void buildXSymbol(void*,int&,int,int,int); void buildTriangleSymbol(void*,int&,int,int,int); void buildTrianglePrintSymbol(void*,int&,int,int,int); void buildDiamondSymbol(void*,int&,int,int,int); void buildDiamondPrintSymbol(void*,int&,int,int,int); void buildCharSymbol(void*,int&,int,int,int); // // Timer methods // MSBoolean doubleClick(void); MSBoolean doubleClick(const XEvent *); MSBoolean longPress(const XEvent *); static unsigned long longPressTime(void) {return _longPressTime;} static unsigned long doubleClickTime(void) {return _doubleClickTime;} static unsigned long doubleClickEventTime(void) {return _doubleClickEventTime;} MSBoolean buttonTimerExpire(void) {return _buttonTimerExpire;} static void longPressTime(unsigned long x_) {_longPressTime=x_;} static void doubleClickTime(unsigned long x_) {_doubleClickTime=x_;} void buttonTimerExpire(MSBoolean x_) {_buttonTimerExpire=x_;} void doubleClickEventTime(unsigned long x_) {_doubleClickEventTime=x_;} void startRepeatTimer(void); void stopRepeatTimer(void); void processRepeatTimer(void); // // Market profile attributes // MSBoolean marketProfileStatus(void) {return _marketProfileStatus;} double sessionPeriod(void) {return _sessionPeriod;} double sessionOffset(void) {return _sessionOffset;} double tpoPriceInc(void) {return _tpoPriceInc;} double tpoPeriod(void) {return _tpoPeriod;} double tpoOpen(void) {return _tpoOpen;} double tpoClose(void) {return _tpoClose;} int tpoBreakChar(void) {return _tpoBreakChar;} void marketProfileStatus(MSBoolean x_) {_marketProfileStatus=x_;} void sessionPeriod(double x_); void sessionOffset(double x_); void tpoPriceInc(double x_); void tpoPeriod(double x_); void tpoOpen(double x_); void tpoClose(double x_); void tpoBreakChar(int key_); // // Trace interface methods // const MSPointerArray& traceSetList(void) const {return _traceSetList;} const MSPointerArray& traceList(void) const {return _traceList;} MSPointerArray& traceSetList(void) {return _traceSetList;} MSPointerArray& traceList(void) {return _traceList;} // // Interactive trace entry methods // void newtraceAlloc(void); void newtraceDealloc(void); MSGraphNewtrace *nt(int index_); int newtraceCt(void) {return _newtraceCt;} int selectPoint(void) {return _selectPoint;} int selectLine(void) {return _selectLine;} int focusLine(void) {return _focusLine;} void selectPoint(int x_) {_selectPoint=x_;} void selectLine(int x_) {_selectLine=x_;} void focusLine(int x_) {_focusLine=x_;} // // Internal Access methods // AxisMode yMode(int i_) {return _yMode[i_];} AxisMode xMode(int i_) {return _xMode[i_];} double margin(int s_) {return _margin[s_];} double xMargin(int i_=0,int s_=0) {return _xMargin[i_][s_];} double yMargin(int i_=0,int s_=0) {return _yMargin[i_][s_];} MSBoolean drawEndTicks(void) {return _drawEndTicks;} int graphDepth(void) {return _graphDepth;} double xMinSet(int i_) {return _xMinSet[i_];} double xMaxSet(int i_) {return _xMaxSet[i_];} double yMinSet(int i_) {return _yMinSet[i_];} double yMaxSet(int i_) {return _yMaxSet[i_];} double xLabelIncrement(int i_,int j_=0) {return _xLabelInc[i_][j_];} double yLabelIncrement(int i_) {return _yLabelInc[i_];} const MSStringVector& xTitle(int i_=0) {return _xTitle[i_];} const MSStringVector& yTitle(int i_) {return _yTitle[i_];} unsigned long xTitleForeground(int i_) {return _xTitleFg[i_];} unsigned long yTitleForeground(int i_) {return _yTitleFg[i_];} Font xTitleFont(int i_) {return _xTitleFont[i_];} MSAlignment xTitleAlign(int i_) {return _xTitleAlign[i_];} Font yTitleFont(int i_) {return _yTitleFont[i_];} unsigned long yTitleAlign(int i_) {return _yTitleAlign[i_];} MSAlignment xLabelAlign(int i_) {return _xLabelAlign[i_];} MSAlignment xSubLabelAlign(int i_) {return _xSubLabelAlign[i_];} MSAlignment yLabelAlign(int i_) {return _yLabelAlign[i_];} Font xLabelFont(int i_) {return _xLabelFont[i_];} Font yLabelFont(int i_) {return _yLabelFont[i_];} unsigned long xTickStyle(int i_) {return _xTickStyle[i_];} unsigned long yTickStyle(int i_) {return _yTickStyle[i_];} int xNumMinorTicks(int i_) {return _xNumMinorTicks[i_];} int yNumMinorTicks(int i_) {return _yNumMinorTicks[i_];} int xMajorTickSize(int i_) {return _xMajorTickSize[i_];} int yMajorTickSize(int i_) {return _yMajorTickSize[i_];} int xMinorTickSize(int i_) {return _xMinorTickSize[i_];} int yMinorTickSize(int i_) {return _yMinorTickSize[i_];} MSIntMatrix& interactivePixel() {return _interactivePixel;} unsigned long xAxisForeground(int x_) {return _xAxisFg[x_];} unsigned long yAxisForeground(int x_) {return _yAxisFg[x_];} MSLabelOut& xLabelOut(int i_) {return _xLabelOut[i_]!=0?*_xLabelOut[i_]:labelOut();} MSLabelOut& xSubLabelOut(int i_) {return _xSubLabelOut[i_]!=0?*_xSubLabelOut[i_]:labelOut();} MSLabelOut& yLabelOut(int i_) {return _yLabelOut[i_]!=0?*_yLabelOut[i_]:labelOut();} unsigned int unsetValue(void) {return _UnsetValue;} int xStringWidth(void) {return _xStringWidth;} int yStringWidth(void) {return _yStringWidth;} int legendWidth(void) {return _legendWidth;} int legendHeight(void) {return _legendHeight;} void drawEndTicks(MSBoolean x_) {_drawEndTicks=x_;} void graphDepth(int x_) {_graphDepth=x_;} void xStringWidth(int x_) {_xStringWidth=x_;} void yStringWidth(int x_) {_yStringWidth=x_;} void legendWidth(int x_) {_legendWidth=x_;} void legendHeight(int x_) {_legendHeight=x_;} void graphUIModeSet(GraphUIMode x_) {_graphUIMode=x_;} virtual void updateData(void); virtual void update(const MSIndexVector& x_); virtual void update(MSTraceSet *,const MSIndexVector&); virtual void updateFont(Font); virtual void updateForeground(unsigned long); virtual void updateBackground(unsigned long); virtual void updateTitle(void); virtual void updateSubtitle(void); virtual void updateFootnote(void); void editorActivate(void); void editorEscape(void); virtual void printDebugInfo(const char*); virtual void set(MSAttrValueList&); virtual MSAttrValueList& get(MSAttrValueList&); private: typedef void (MSGraph::*PSF)(void*,int&,int,int,int); GC _clearGC; GC _textGC; GC _axisGC; GC _gridGC; GC _zeroGC; GC _traceGC; GC _subtitleGC; GC _footnoteGC; GC _windowGC; GC _axisTitleGC; MSAlignment _titleAlign; MSStringVector _subtitle; unsigned long _subtitleForeground; Font _subtitleFont; MSAlignment _subtitleAlign; MSStringVector _footnote; unsigned long _footnoteForeground; Font _footnoteFont; MSAlignment _footnoteAlign; MSStringVector _xTitle[2]; unsigned long _xTitleFg[2]; unsigned long _xAxisFg[2]; MSAlignment _xTitleAlign[2]; unsigned long _xTickStyle[2]; double _xMargin[2][2]; Font _xTitleFont[2]; Font _xLabelFont[2]; MSStringVector _yTitle[2]; unsigned long _yTitleFg[2]; unsigned long _yAxisFg[2]; unsigned long _yTitleAlign[2]; unsigned long _yTickStyle[2]; double _yMargin[2][2]; Font _yTitleFont[2]; Font _yLabelFont[2]; unsigned long _axis; unsigned long _axisRule; AxisMode _yMode[2]; AxisMode _xMode[2]; unsigned long _grid; unsigned long _gridForeground; unsigned long _gridStyle; unsigned long _zeroAxis; unsigned long _zeroAxisForeground; unsigned long _zeroAxisStyle; int _zeroAxisWidth; int _zeroAxisWeight; double _margin[4]; MSGraphEditor *_editor; MSGraphLegend *_legend; MSGraphStatusWin *_dataWin; MSBackingStorePixmap *_graphPixmap; MSDisplayCursor *_zoomCursor; MSDisplayCursor *_drawCursor; MSDisplayCursor *_lineCursor; MSTrace *_selectTrace; MSRect _plotAreaRect; MSRect _updateRect; int _y_org; int _y_end; int _x_org; int _x_end; int _graphDepth; double _showSizeRatio; unsigned long _orientation; unsigned long _graphMode; GraphUIMode _graphUIMode; static MSLabelFormat _outFormat; static MSLabelOut _labelOut; static MSLabelOut _timeLabelOut; MSLabelOutPtr _xLabelOut[2]; MSLabelOutPtr _xSubLabelOut[2]; MSLabelOutPtr _yLabelOut[2]; MSAlignment _xSubLabelAlign[2]; MSAlignment _xLabelAlign[2]; MSAlignment _yLabelAlign[2]; KeySym _arrowKeysym; MSGraphRepeatTimer *_repeatTimer; MSBoolean _repeatOn; MSSymbol _tag; MSBoolean _marketProfileStatus; double _sessionPeriod; double _sessionOffset; double _tpoPriceInc; double _tpoPeriod; double _tpoOpen; double _tpoClose; int _tpoBreakChar; int _xMinZoom; int _xMaxZoom; int _yMinZoom; int _yMaxZoom; double _xScaleReal[2]; double _xBaseReal[2]; double _xMinReal[2]; double _xMaxReal[2]; double _xScale[2]; double _yScale[2]; double _xBase[2]; double _yBase[2]; double _xMin[2]; double _xMax[2]; double _yMin[2]; double _yMax[2]; double _xMinData[2]; double _xMaxData[2]; double _yMinData[2]; double _yMaxData[2]; double _xMinSet[2]; double _xMaxSet[2]; double _yMinSet[2]; double _yMaxSet[2]; double _xLabelInc[2][2]; double _yLabelInc[2]; double _yInc[2]; double _xIncData[2][2]; double _yIncData[2]; double _normalizedLabelInc; MSIntMatrix _interactivePixel; MSFloatMatrix _interactiveData; MSStringVector _interactiveTraceTags; static MSString _defaultTraceTag; int _naturalWidth; int _naturalHeight; int _newTraceCount; MSBoolean _highlightLegendStatus; MSBoolean _highlightTraceStatus; MSBoolean _graphZoomStatus; MSBoolean _xShowPos; MSBoolean _yShowPos; MSBoolean _keyPressStatus; MSBoolean _updateLegendStatus; MSBoolean _showYaxis[2]; MSBoolean _showXaxis[2]; MSBoolean _showYrule[2]; MSBoolean _showXrule[2]; MSBoolean _drawEndTicks; unsigned long _style; unsigned long _legendAlign; unsigned long _legendStyle; double _xLegendPosition; double _yLegendPosition; int _legendWidth; int _legendHeight; int _printWidth; int _pageWidth; int _frameLineWidth; int _cursorType; int _axisRuleWidth; int _gridWidth; int _gridWeight; int *_xGrid; int *_xGridWidth; int _xGridCount; int *_yGrid; int *_yGridWidth; int _yGridCount; int _xNumMinorTicks[2]; int _yNumMinorTicks[2]; int _xMajorTickSize[2]; int _xMinorTickSize[2]; int _yMajorTickSize[2]; int _yMinorTickSize[2]; int _pieCount; double _pieOffsetMargin; int _barCount; int _maxBarWidth; int _barWidth; int _xBar; MSGraphNewtrace **_nt; int _newtraceCt; int _newtraceAllocCt; int _newtraceIndex; int _focusLine; int _selectLine; int _selectPoint; MSBoolean _onLineSegment; MSBoolean _onLinePoint; MSBoolean _buttonTimerExpire; static unsigned long _doubleClickEventTime; static unsigned long _doubleClickTime; static unsigned long _longPressTime; int _titleHeight; int _subtitleHeight; int _footnoteHeight; int _yLabelWidth[2]; int _yRuleWidth[2]; int _xStringWidth; int _yStringWidth; MSStringVector _defaultLineColors; MSStringVector _defaultFillColors; int _selectDistance; int _MaxBufSize; static const int _MinBufSize; static const int _SHRT_MAX; static const int _SHRT_MIN; static const unsigned int _UnsetValue; static const double _PrecisionRange; static MSBoolean _debugStatus; MSPointerArray _traceSetList; MSPointerArray _traceList; // pie drawing data int _pieDepth; double _pieRx, _pieRy; int _pieX, _pieY; int _startAngle; int _indexOfMaxAngle; MSBoolean _orderDependent; MSGraphPieData* _pieData; MSGraphPieLabelData* _pieLabelData; }; class MSGUIExport MSGraphStatusWin:public MSPrimitive { friend class MSGraph; private: Font _font; int _valueWidth; int _spacing; int _leading; int _insideMargin; int _minWidth; int _x1,_x2; GC _gc; XFontStruct *_fontInfo; protected: MSGraphStatusWin(MSWidget *); ~MSGraphStatusWin(void); MSGraph *graph(void) {return (MSGraph *)owner();} Font font(void) {return _font;} int spacing(void) {return _spacing;} int minWidth(void) {return _minWidth;} int valueWidth(void) {return _valueWidth;} int offset(void) {return highlightThickness()+shadowThickness();} int textHeight(void) {return _fontInfo->ascent+_fontInfo->descent;} int leading(void) {return _leading;} int x1(void) {return _x1;} int x2(void) {return _x2;} int insideMargin(void) {return _insideMargin+offset();} GC gc(void) {return _gc;} XFontStruct *fontInfo(void) {return _fontInfo;} virtual void font(Font); void valueWidth(int x_) {_valueWidth=x_==0?0:(x_>_minWidth)?x_:_minWidth;} void spacing(int x_) {_spacing=x_;} void minWidth(int x_) {_minWidth=x_;} void leading(int x_) {_leading=x_;} void x1(int x_) {_x1=x_;} void x2(int x_) {_x2=x_;} void insideMargin(int x_) {_insideMargin=x_;} void setDataWin(int,int); virtual void updateBackground(unsigned long); virtual void buttonPress(const XEvent *); }; class MSGUIExport MSGraphLegend:public MSGraphStatusWin { friend class MSGraph; private: MSBoolean _firstDraw; int _columnCount; int _textFieldWidth; int _symbolWidth; int _symbolSize; Font _symbolFont; protected: MSGraphLegend(MSWidget *); ~MSGraphLegend(void) {} MSGraph *graph(void) {return (MSGraph *)owner();} int columnCount(void) {return _columnCount;} int symbolWidth(void) {return _symbolWidth;} int symbolSize(void) {return _symbolSize;} Font symbolFont(void) {return _symbolFont;} int textFieldWidth(void) {return _textFieldWidth;} void columnCount(int x_) {_columnCount=x_;} void symbolWidth(int x_) {_symbolWidth=x_;} void symbolSize(int x_) {_symbolSize=x_;} void textFieldWidth(int x_) {_textFieldWidth=x_;} void legendFont(Font x_); void symbolFont(Font x_); inline int xOffset(void); virtual Font font(void); virtual void font(Font); virtual void buttonPress(const XEvent *); virtual void buttonRelease(const XEvent *); public: virtual void redraw(void); }; inline int MSGraphLegend::xOffset(void) {return offset()+insideMargin()+symbolWidth()+2*spacing()+textFieldWidth();} inline int MSGraph::xValueToPixel(double x_,int xs_) { double x=(x_-xBase(xs_))*xScale(xs_)+x_org(); return (int)(x>MSGraph::_SHRT_MAX?MSGraph::_SHRT_MAX:xMSGraph::_SHRT_MAX?MSGraph::_SHRT_MAX:yx_end()?x_end():x_)-x_org())/xScale(xs_)+xBase(xs_):0; } inline double MSGraph::normalizedPixelToValue(int x_,int xs_) { if (graphMode()&Normalize) { return xScaleReal(xs_)!=0?((x_x_end()?x_end():x_)-x_org())/xScaleReal(xs_)+xBaseReal(xs_):0; } else return xPixelToValue(x_,xs_); } inline double MSGraph::yPixelToValue(int y_,int ys_) { return yScale(ys_)!=0?(y_org()-(y_y_org()?y_org():y_))/yScale(ys_)+yBase(ys_):0; } inline unsigned long MSGraph::formatAlignment(unsigned long x_) { if ((x_&MSLeft)&&(x_&MSRight)) x_-=MSRight; if ((x_&MSTop)&&(x_&MSBottom)) x_-=MSBottom; return x_; } inline const char *MSGraph::formatAxisLabel(MSString &buffer_,MSLabelOut& out_,double val_,MSBoolean plus_) { out_.formatOutput(buffer_,val_); if (plus_==MSTrue&&val_>0) buffer_.insert("+"); return buffer_; } inline const char *MSGraph::formatTimeLabel(MSString &buffer_,double val_) { return _timeLabelOut.formatOutput(buffer_,val_); } // xValue, yValue - get value from trace. // xValue normalize data if in Normalize mode inline double MSGraph::xValue(MSTrace *trace_,int i_) { return orientation()!=Horizontal?graphMode()&Normalize?(double)i_+trace_->traceSet()->normalizedOffset():trace_->traceSet()->x(i_):trace_->y(i_); } inline double MSGraph::yValue(MSTrace* trace_,int i_) { return orientation()!=Horizontal?trace_->y(i_):trace_->traceSet()->x(i_);} inline double MSGraph::xValueMin(MSTrace* trace_) { return orientation() == Horizontal ? trace_->yMin() : trace_->traceSet()->xMin(); } inline double MSGraph::xValueMax(MSTrace* trace_) { return orientation() == Horizontal ? trace_->yMax() : trace_->traceSet()->xMax(); } inline double MSGraph::yValueMin(MSTrace* trace_) { return orientation() == Horizontal ? trace_->traceSet()->xMin() : trace_->yMin() ; } inline double MSGraph::yValueMax(MSTrace* trace_) { return orientation() == Horizontal ? trace_->traceSet()->xMax() : trace_->yMax() ; } // inline void MSGraph::fillPolygons(Display *dpy_,Window xwin_,GC gc_,XPoint *points_, int n_,int shape_,int mode_,int size_) {int n=(n_%size_)==0?n_:n_-size_; for (unsigned i=0; i #pragma do_not_instantiate MSPointerArray #endif // !__MSGUILIBRARY_BUILD__ && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #endif aplus-fsf-4.22/src/MSGUI/MSHGauge.H0000644000265000001440000000402410772770423012213 #ifndef MSHGaugeHEADER #define MSHGaugeHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSGUIExport MSHGauge : public MSHScale { public: MSHGauge(MSWidget *,const char *title_=0); MSHGauge(MSWidget *,const MSStringVector&); MSHGauge(MSWidget *,MSFloat&,const char *title_=0); MSHGauge(MSWidget *,MSFloat&,const MSStringVector&); MSHGauge(MSWidget *,MSInt&,const char *title_=0); MSHGauge(MSWidget *,MSInt&,const MSStringVector&); ~MSHGauge(void); MSScale& operator=(const MSFloat& x_) {value(x_); return *this;} MSScale& operator=(double x_) {value(x_); return *this;} MSScale& operator=(const MSInt& x_) {value(x_); return *this;} MSScale& operator=(int x_) {value(x_); return *this;} const MSFloat& startValue(void) const { return _startValue; } void startValue(const MSFloat& value_); virtual void set(MSAttrValueList&); virtual MSAttrValueList& get(MSAttrValueList&); protected: enum Direction { Left, Right }; int gaugeWidth(void) { return _gaugeWidth; } void gaugeWidth(int x_) { _gaugeWidth=x_; } void init(void); void drawGauge(void); void updateGauge(double); void drawGaugeShadow(int,int,int,int,Direction); void updateGaugeShadow(int,int,int,int,Direction); virtual void redraw(void); virtual void updateSliderSize(double); virtual void computeLabelOffset(void); virtual void drawSubWindows(void); virtual void update(const MSIndexVector&); virtual void buttonPress(const XEvent *); virtual void keyPress(const XEvent *,KeySym,unsigned int,const char *); virtual void drawSliderEtch(void); virtual void sliderRedrawNotify(void); private: int _gaugeWidth; MSFloat _startValue; Direction _direction; }; #endif aplus-fsf-4.22/src/MSGUI/MSHLayout.H0000644000265000001440000000107610772770423012444 #ifndef MSHLayoutHEADER #define MSHLayoutHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSGUIExport MSHLayout : public MSLayout { public: MSHLayout(MSWidget *,const char *title_=0); MSHLayout(MSWidget *,const MSStringVector&); ~MSHLayout(void); private: void init(void); }; #endif aplus-fsf-4.22/src/MSGUI/MSHPane.H0000644000265000001440000000106210772770423012045 #ifndef MSHPaneHEADER #define MSHPaneHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSGUIExport MSHPane : public MSPane { public: MSHPane(MSWidget *,const char *title_=0); MSHPane(MSWidget *,const MSStringVector&); ~MSHPane(void); protected: void init(void); }; #endif aplus-fsf-4.22/src/MSGUI/MSHScale.H0000644000265000001440000000362210772770423012215 #ifndef MSHScaleHEADER #define MSHScaleHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSHScale; class MSHGauge; class MSGUIExport MSHScale : public MSScale { public: MSHScale(MSWidget *,const char *title_=0); MSHScale(MSWidget *,const MSStringVector&); MSHScale(MSWidget *,MSFloat&,const char *title_=0); MSHScale(MSWidget *,MSFloat&,const MSStringVector&); MSHScale(MSWidget *,MSInt&,const char *title_=0); MSHScale(MSWidget *,MSInt&,const MSStringVector&); ~MSHScale(void); virtual int sliderSize(void) const; virtual void sliderSize(int); MSScale& operator=(const MSFloat& x_) {value(x_); return *this;} MSScale& operator=(double x_) {value(x_); return *this;} MSScale& operator=(const MSInt& x_) {value(x_); return *this;} MSScale& operator=(int x_) {value(x_); return *this;} class MSGUIExport HSlider : public MSScale::Slider { friend class MSHScale; friend class MSHGauge; public: HSlider(MSWidget *); ~HSlider(void); virtual void moveTo(int,int); protected: virtual void drawSliderEtch(void); }; protected: void init(void); virtual void computeSize(void); virtual void computeSliderAreaSize(void); virtual void computeSliderScale(void); virtual void computeTickInc(void); virtual void setSliderPosition(int); virtual void computeLabelOffset(void); virtual void drawSliderTitles(void); virtual void drawTickLabels(void); virtual void moveSlider(const XEvent *); virtual double pixelToValue(int); virtual int valueToPixel(double); virtual int incFactor(int,int); virtual void drawSliderEtch(void); }; #endif aplus-fsf-4.22/src/MSGUI/MSHScrollBar.H0000644000265000001440000000306510772770423013052 #ifndef MSHScrollBarHEADER #define MSHScrollBarHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSHScrollBar; class MSGUIExport MSHScrollBar : public MSScrollBar { public: class MSGUIExport HElevator : public MSScrollBar::Elevator { friend class MSHScrollBar; public: HElevator(MSHScrollBar *); ~HElevator(void); virtual void select(void); virtual void unselect(void); protected: virtual void draw(void); virtual void configure(void); }; public: MSHScrollBar(MSWidget *,int min_=0,int max_=100,int inc_=1); ~MSHScrollBar(void); protected: void init(void); void moveElevator(int x_,int y_); virtual void configureForOpenlook(void); virtual void configureForMotif(void); int calcXValue(int value_); int boundsCheckX(int x_); virtual int calcSliderValue(int x_,int y_); virtual void redrawElevator(void); virtual void configureElevator(void); virtual void drawElevatorCable(void); virtual void drawPropIndicator(void); virtual void drawMarkers(void); virtual void adjustPointer(void); virtual void motionLoop(void); virtual void openlookButton1Press(const XEvent*); virtual void openlookButton2Press(const XEvent*); virtual void motifButton1Press(const XEvent*); virtual void motifButton2Press(const XEvent*); }; #endif aplus-fsf-4.22/src/MSGUI/MSHSeparator.H0000644000265000001440000000105310772770423013122 #ifndef MSHSeparatorHEADER #define MSHSeparatorHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSGUIExport MSHSeparator : public MSSeparator { public: MSHSeparator(MSWidget *owner_); virtual void redraw(void); protected: virtual void computeSize(void); }; #endif aplus-fsf-4.22/src/MSGUI/MSIcon.H0000644000265000001440000000545510772770424011755 #ifndef MSIconHEADER #define MSIconHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSGUIExport MSIcon : public MSLabel { protected: int _labelSpacing; MSAlignment _labelAlignment; MSDoubleClick _doubleClick; MSBoolean _showLabel; MSBoolean _showPixmap; MSDoubleClick &doubleClick(void) {return _doubleClick;} int labelWidth(void); int labelHeight(void); int pixmapWidth(void); int pixmapHeight(void); int computeXCoordinate(int,int,int,const char *,int); int computeYCoordinate(int,int); virtual void computeSize(void); virtual int computeXCoord(int,int,const char *,int); virtual int computeYCoord(int); virtual int computePixmapXCoord(const MSPixmap *); virtual int computePixmapYCoord(const MSPixmap *); virtual int computeLabelSpacing(void); virtual void button1Press(const XEvent *); virtual void buttonSelectionNotify(void); virtual void doubleClickNotify(void); void init(void); void init(const MSPixmap &pixmap_,const MSPixmap &nsensitivePixmap_); public: MSIcon(MSWidget *,const char *label_,const MSPixmap &pixmap_,const MSPixmap &nsensitivePixmap_); MSIcon(MSWidget *,const MSStringVector&,const MSPixmap &pixmap_,const MSPixmap &nsensitivePixmap_); MSIcon(MSWidget *,MSStringVector&,const MSPixmap &pixmap_,const MSPixmap &nsensitivePixmap_); MSIcon(MSWidget *,const char *label_=0); MSIcon(MSWidget *,const MSStringVector&); MSIcon(MSWidget *,MSStringVector&); MSIcon(MSWidget *,const MSPixmap &pixmap_,const MSPixmap &insensitivePixmap_); ~MSIcon(void); int labelSpacing(void) const; void labelSpacing(int); MSAlignment labelAlignment(void) const; void labelAlignment(MSAlignment); void showLabel(MSBoolean); MSBoolean showLabel(void) const; void showPixmap(MSBoolean); MSBoolean showPixmap(void) const; virtual void redraw(void); }; inline int MSIcon::labelSpacing(void) const { return _labelSpacing;} inline MSAlignment MSIcon::labelAlignment(void) const { return _labelAlignment; } inline MSBoolean MSIcon::showLabel(void) const { return _showLabel; } inline MSBoolean MSIcon::showPixmap(void) const { return _showPixmap; } inline int MSIcon::labelWidth(void) { return showLabel()==MSTrue?maxPixelWidth():0; } inline int MSIcon::labelHeight(void) { return showLabel()==MSTrue?rows()*textHeight():0; } inline int MSIcon::pixmapWidth(void) { return showPixmap()==MSTrue&&pixmap()!=0?pixmap()->width():0; } inline int MSIcon::pixmapHeight(void) { return showPixmap()==MSTrue&&pixmap()!=0?pixmap()->height():0; } #endif aplus-fsf-4.22/src/MSGUI/MSIconButton.H0000644000265000001440000000460110772770424013141 #ifndef MSIconButtonHEADER #define MSIconButtonHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSGUIExport MSIconButton : public MSIcon { protected: MSBoolean _armed; MSPixmap *_armedPixmap; MSBoolean armed(void) const; void createDefaultArmedPixmap(int,int,unsigned long,unsigned long); virtual int computeXCoord(int,int,const char *,int); virtual int computeYCoord(int); virtual void drawBackground(void); virtual void drawLabel(void); virtual void drawPixmap(void); virtual void arm(void); virtual void disarm(void); virtual void activate(void); virtual void key(KeySym,unsigned int,const char*); virtual void keyPress(const XEvent *,KeySym,unsigned int,const char*); virtual void buttonPress(const XEvent*); virtual void buttonRelease(const XEvent*); virtual void motionNotify(const XEvent*); virtual void button1Press(const XEvent*); virtual void button1Release(const XEvent*); virtual void updateSensitivity(void); virtual void updatePixmap(void); void init(void); void init(const MSPixmap &); public: MSIconButton(MSWidget *,const char *label_,const MSPixmap &pixmap_, const MSPixmap &insensitivePixmap_,const MSPixmap &armedPixmap_); MSIconButton(MSWidget *,const MSStringVector &label_,const MSPixmap &pixmap_, const MSPixmap &insensitivePixmap_,const MSPixmap &armedPixmap_); MSIconButton(MSWidget *,MSStringVector &label_,const MSPixmap &pixmap_, const MSPixmap &insensitivePixmap_,const MSPixmap &armedPixmap_); MSIconButton(MSWidget *,const char *label_=0); MSIconButton(MSWidget *,const MSStringVector&); MSIconButton(MSWidget *,const MSPixmap &pixmap_,const MSPixmap &insensitivePixmap_, const MSPixmap &armedPixmap_); ~MSIconButton(void); const MSPixmap *armedPixmap(void) const { return _armedPixmap; } void armedPixmap(const MSPixmap &); virtual void redraw(void); }; inline MSBoolean MSIconButton::armed(void) const { return _armed; } inline void MSIconButton::updateSensitivity(void) { MSIcon::updateSensitivity(); if (sensitive()==MSTrue) acceptFocus(MSTrue); else acceptFocus(MSFalse); } #endif aplus-fsf-4.22/src/MSGUI/MSIntArrayView.H0000644000265000001440000000321010772770424013434 #ifndef MSIntArrayViewHEADER #define MSIntArrayViewHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSGUIExport MSIntArrayView : public MSNumericArrayView { protected: virtual unsigned numColumns(void) const; virtual unsigned numRows(void) const; virtual const char *formatOutput(MSString &,unsigned,unsigned); virtual MSBoolean validate(const char *,unsigned,unsigned); virtual void moveRow(int, int); MSIntVector& array(void) {return (MSIntVector&)*_model;} const MSIntVector& array(void) const {return (MSIntVector&)*_model;} void array(const MSIntVector&); public: MSIntArrayView(MSWidget *,const char *title_=0); MSIntArrayView(MSWidget *,const MSStringVector&); MSIntArrayView(MSWidget *,MSIntVector&,const char *title_=0); MSIntArrayView(MSWidget *,MSIntVector&,const MSStringVector&); ~MSIntArrayView(void); void model(MSIntVector&); void model(const MSIntVector&); MSIntVector& viewModel(void) { return *((MSIntVector*)_model); } const MSIntVector& viewModel(void) const { return *((MSIntVector*)_model); } MSIntArrayView& operator=(const MSIntVector& array_) {array(array_); return *this;} operator MSIntVector&() const {return *((MSIntVector *)_model);} }; typedef MSIntArrayView MSIntArray; // backward compatibility #endif aplus-fsf-4.22/src/MSGUI/MSIntCheckBox.H0000644000265000001440000000217510772770424013222 #ifndef MSIntCheckBoxHEADER #define MSIntCheckBoxHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSGUIExport MSIntCheckBox : public MSModelCheckBox { friend class MSCheckButton; public: MSIntCheckBox(MSWidget *,const char *title_=0); MSIntCheckBox(MSWidget *,const MSStringVector &title_); MSIntCheckBox(MSWidget *,MSIntVector& model_,const char *title_=0); MSIntCheckBox(MSWidget *,MSIntVector& model_,const MSStringVector& title_); ~MSIntCheckBox(void); void model(MSIntVector&); MSIntVector& viewModel(void) { return *((MSIntVector*)_model); } const MSIntVector& viewModel(void) const { return *((MSIntVector*)_model); } operator MSIntVector &() { return *((MSIntVector *)_model); } protected: virtual void drawCurrentState(void); virtual void setModel(void); }; #endif aplus-fsf-4.22/src/MSGUI/MSIntEntryField.H0000644000265000001440000000313610772770424013577 #ifndef MSIntEntryFieldHEADER #define MSIntEntryFieldHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include // We provide explicit "do_not_instantiate" pragmas here to avoid instantiation complications in // MStk applications. // #if !defined(__MSGUILIBRARY_BUILD__) && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma do_not_instantiate MSTypeEntryField #endif // !__MSGUILIBRARY_BUILD__ && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #if defined(MS_VC_NEED_TEMPLATE_EXPORT) class MSGUIExport MSTypeEntryField; #endif class MSGUIExport MSIntEntryField : public MSTypeEntryField { protected: void init(void); public: MSIntEntryField(MSWidget *,const char *label_=0, const MSSymbol& tag_=MSSymbol::nullSymbol()); MSIntEntryField(MSWidget *,MSInt&,const char *label_=0, const MSSymbol& tag_=MSSymbol::nullSymbol()); ~MSIntEntryField(void); void increment(void); void decrement(void); MSIntEntryField& operator=(int value_) {value(value_); return *this;} MSIntEntryField& operator=(const MSInt& value_) {value(value_); return *this;} operator MSInt&() {return *((MSInt *)_model);} operator int() {return (int)value();} }; #endif aplus-fsf-4.22/src/MSGUI/MSIntMatrixTraceSet.H0000644000265000001440000000377310772770424014440 #ifndef MSIntMatrixTraceSetHEADER #define MSIntMatrixTraceSetHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSGUIExport MSIntMatrixTraceSet:public MSTraceSet { public: MSIntMatrixTraceSet(MSGraph *,const char *legends_=0,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSIntMatrixTraceSet(MSGraph *,const MSStringVector&,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSIntMatrixTraceSet(MSGraph *,MSIntMatrix&,const char *legends_=0,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSIntMatrixTraceSet(MSGraph *,MSIntMatrix&,const MSStringVector&,const MSSymbol& tag_=MSSymbol::nullSymbol()); ~MSIntMatrixTraceSet(void); void model(MSIntMatrix&); void model(const MSIntMatrix&); MSIntMatrix& viewModel(void) { return *((MSIntMatrix*)_model); } const MSIntMatrix& viewModel(void) const { return *((MSIntMatrix*)_model); } MSIntMatrixTraceSet& operator=(const MSIntMatrix& matrix_) {matrix(matrix_); return *this;} operator MSIntMatrix&() const {return *((MSIntMatrix *)_model);} protected: MSIntMatrix& matrix(void) {return *((MSIntMatrix *)_model); } const MSIntMatrix& matrix(void) const {return *((MSIntMatrix *)_model); } void matrix(const MSIntMatrix& v_) {if (MSView::model()!=0) matrix()=v_;} virtual int dataCount(void) const; virtual double x(int) const; virtual double y(int,int) const; virtual int numColumns(void) const; virtual void validate(int,int,double,double); virtual MSBoolean moveTraceValidate(double,double); virtual MSTraceSet* copyTraceValidate(MSGraph*,const char*, const MSSymbol&); virtual MSFloatMatrix asFloatMatrix(void) const; virtual const char *formatOutput(MSString &,unsigned,unsigned); }; #endif aplus-fsf-4.22/src/MSGUI/MSIntMatrixView.H0000644000265000001440000000301410772770424013624 #ifndef MSIntMatrixViewHEADER #define MSIntMatrixViewHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSGUIExport MSIntMatrixView : public MSNumericArrayView { protected: virtual unsigned numColumns(void) const; virtual unsigned numRows(void) const; virtual const char *formatOutput(MSString &,unsigned,unsigned); virtual MSBoolean validate(const char *,unsigned,unsigned); virtual void moveRow(int,int); MSIntMatrix& matrix(void) { return (MSIntMatrix&)*_model; } const MSIntMatrix& matrix(void) const { return (MSIntMatrix&)*_model; } void matrix(const MSIntMatrix&); public: MSIntMatrixView(MSWidget *,const char *title_=0); MSIntMatrixView(MSWidget *,const MSStringVector&); MSIntMatrixView(MSWidget *,MSIntMatrix&,const char *title_=0); MSIntMatrixView(MSWidget *,MSIntMatrix&,const MSStringVector&); ~MSIntMatrixView(void); void model(MSIntMatrix&); MSIntMatrix& viewModel(void) { return *((MSIntMatrix*)_model); } const MSIntMatrix& viewModel(void) const { return *((MSIntMatrix*)_model); } MSIntMatrixView& operator=(const MSIntMatrix& matrix_) { matrix(matrix_); return *this; } operator MSIntMatrix&() const { return *((MSIntMatrix *)_model); } }; #endif aplus-fsf-4.22/src/MSGUI/MSIntRadioBox.H0000644000265000001440000000237310772770424013243 #ifndef MSIntRadioBoxHEADER #define MSIntRadioBoxHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSGUIExport MSIntRadioBox : public MSRadioBox { friend class MSRadioButton; public: MSIntRadioBox(MSWidget *,const char *title_=0); MSIntRadioBox(MSWidget *,const MSStringVector &); MSIntRadioBox(MSWidget *,MSInt& model_,const char *title_=0); MSIntRadioBox(MSWidget *,MSInt& model_,const MSStringVector&); ~MSIntRadioBox(void); void model(MSInt&); MSInt& viewModel(void) { return *((MSInt*)_model); } const MSInt& viewModel(void) const { return *((MSInt*)_model); } operator MSInt&() { return *((MSInt *)_model); } operator int() { return (MSView::model()!=0)?(int)*((MSInt *)_model):0; } protected: void drawCurrentState(void); void setModel(void); virtual void arm(MSRadioButton *); virtual void receiveEvent(MSEvent &); virtual void updateData(void); virtual void firstMapNotify(void); }; #endif aplus-fsf-4.22/src/MSGUI/MSIntTableColumn.H0000644000265000001440000000461210772770424013737 #ifndef MSIntTableColumnHEADER #define MSIntTableColumnHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSGUIExport MSIntTableColumn : public MSTableColumn { public: MSIntTableColumn(MSReportTable *,const char *heading_=0,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSIntTableColumn(MSReportTable *,const MSStringVector&,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSIntTableColumn(MSReportTable *,MSIntVector&,const char *heading_=0,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSIntTableColumn(MSReportTable *,MSIntVector&,const MSStringVector&,const MSSymbol& tag_=MSSymbol::nullSymbol()); ~MSIntTableColumn(void); void model(MSIntVector&); void model(const MSIntVector&); MSIntVector& viewModel(void) { return (MSIntVector&)*_model; } const MSIntVector& viewModel(void) const { return (MSIntVector&)*_model; } MSIntTableColumn& operator=(const MSIntVector& vector_); operator MSIntVector&() const; virtual MSIndexVector gradeUp(void) const; virtual MSIndexVector gradeDown(void) const; virtual void permute(const MSIndexVector &); virtual void range(MSIndexVector &start_,MSIndexVector &end_); virtual MSIndexVector rangeGradeUp(const MSIndexVector &start_,const MSIndexVector &end_); virtual MSIndexVector rangeGradeDown(const MSIndexVector &start_,const MSIndexVector &end_); virtual unsigned numRows(void) const; virtual MSBoolean isDuplicate(unsigned); virtual MSBoolean breakCriteria(unsigned); virtual const char *formatOutput(MSString &,unsigned); virtual const char *formatBreak(MSString &,unsigned,unsigned); protected: virtual void breakProcess(MSIndexVector&); virtual MSBoolean validate(const char *,unsigned); virtual void moveRow(int, int); MSIntVector& vector(void) { return (MSIntVector&)*_model; } const MSIntVector& vector(void) const { return (MSIntVector&)*_model; } void vector(const MSIntVector&); }; inline MSIntTableColumn& MSIntTableColumn::operator=(const MSIntVector& vector_) { vector(vector_); return *this; } inline MSIntTableColumn::operator MSIntVector&() const { return *((MSIntVector *)_model); } #endif aplus-fsf-4.22/src/MSGUI/MSIntVectorTraceSet.H0000644000265000001440000000412610772770424014427 #ifndef MSIntVectorTraceSetHEADER #define MSIntVectorTraceSetHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSGUIExport MSIntVectorTraceSet:public MSTraceSet { public: MSIntVectorTraceSet(MSGraph *,const char *legends_=0,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSIntVectorTraceSet(MSGraph *,const MSStringVector&,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSIntVectorTraceSet(MSGraph *,MSIntVector&,const char *legends_=0,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSIntVectorTraceSet(MSGraph *,MSIntVector&,const MSStringVector&,const MSSymbol& tag_=MSSymbol::nullSymbol()); ~MSIntVectorTraceSet(void); void model(MSIntVector&); void model(const MSIntVector&); MSIntVector& viewModel(void) { return *((MSIntVector*)_model); } const MSIntVector& viewModel(void) const { return *((MSIntVector*)_model); } virtual void selectable(MSBoolean); virtual MSBoolean selectable(void) const; virtual void constraint(unsigned long); virtual unsigned long constraint(void) const; MSIntVectorTraceSet& operator=(const MSIntVector& vector_) {vector(vector_); return *this;} operator MSIntVector&() const {return *((MSIntVector *)_model);} protected: MSIntVector& vector(void) {return (MSIntVector&)*_model;} const MSIntVector& vector(void) const {return (MSIntVector&)*_model;} void vector(const MSIntVector& v_) {if (MSView::model()!=0) vector()=v_;} virtual int dataCount(void) const; virtual double y(int,int) const; virtual void validate(int,int,double,double); virtual MSBoolean moveTraceValidate(double,double); virtual MSTraceSet* copyTraceValidate(MSGraph*,const char*, const MSSymbol&); virtual MSFloatMatrix asFloatMatrix(void) const; virtual const char *formatOutput(MSString &,unsigned,unsigned); }; #endif aplus-fsf-4.22/src/MSGUI/MSKeyCallback.H0000644000265000001440000000104410772770424013220 #ifndef MSKeyCallbackHEADER #define MSKeyCallbackHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1998-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSWidget; class MSGUIExport MSKeyCallback { public: MSKeyCallback(); virtual ~MSKeyCallback(); virtual MSBoolean process(MSWidget*,const MSKeyPress&)=0 ; }; #endif aplus-fsf-4.22/src/MSGUI/MSKeyClassCallback.H0000644000265000001440000000144210772770424014210 #ifndef MSKeyClassCallbackHEADER #define MSKeyClassCallbackHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1998-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include template class MSKeyClassCallback : public MSKeyCallback { typedef void (MethodClass::*Method)(void); private: Method _method; public: MSKeyClassCallback(Method method_) : _method(method_) {} ~MSKeyClassCallback(void) {} MSBoolean process(MSWidget* widget_,const MSKeyPress&) { (((MethodClass*)widget_)->*_method)(); return MSTrue; } }; #endif aplus-fsf-4.22/src/MSGUI/MSKeyMethodCallback.H0000644000265000001440000000164110772770424014364 #ifndef MSKeyMethodCallbackHEADER #define MSKeyMethodCallbackHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1998-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include template class MSKeyMethodCallback : public MSKeyCallback { typedef MSBoolean (MethodClass::*Method)(MSKeyPress); private: Method _method; MethodClass *_object; public: MSKeyMethodCallback(MethodClass *object_,Method method_) : _object(object_), _method(method_) {} ~MSKeyMethodCallback(void) {} virtual MSBoolean process(MSWidget*,const MSKeyPress& translation_) { if (_object!=0&&_method!=0) return (_object->*_method)(translation_); return MSFalse; } }; #endif aplus-fsf-4.22/src/MSGUI/MSKeyPress.H0000644000265000001440000000226510772770424012626 #ifndef MSKeyPressHEADER #define MSKeyPressHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1998-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include class MSGUIExport MSKeyPress { protected: unsigned int _state; KeySym _keysym; public: enum {NoneKeyMask=0,ShiftKeyMask=1,LockKeyMask=2,ControlKeyMask=4,MetaKeyMask=8, AltGraphMask=0x10,NumLockMask=0x20,ExactMask=0x40,ALL=0x80}; MSKeyPress(const char* =0); MSKeyPress(KeySym,unsigned int); ~MSKeyPress(void); MSBoolean isMatch(KeySym,unsigned int) const; MSBoolean isMatch(const char* ) const; KeySym keysym(void) const {return _keysym;} unsigned int state(void) const {return _state;} static void translate(const char *,KeySym &, unsigned int &, unsigned int &) ; static MSBoolean isMatch(KeySym,unsigned int, KeySym,unsigned int, unsigned int); }; #endif aplus-fsf-4.22/src/MSGUI/MSKeyTableData.H0000644000265000001440000000255710772770424013357 #ifndef MSKeyTableDataHEADER #define MSKeyTableDataHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1998-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSWidget; class MSKeyCallbackNode; class MSKeyCallback; class MSGUIExport MSKeyTableData { private: class List { public: int _size; int _count; MSKeyCallbackNode **_array; List(int size_=0); ~List(void); void reserve(int size_); void add(MSKeyCallbackNode *); void remove(MSKeyCallbackNode *); }; unsigned _referenceCount; List _ktList; char *_pName; friend class MSKeyTranslationTable; void addReference(void); void removeReference(void); unsigned referenceCount(void) const {return _referenceCount;} void remove( KeySym, unsigned int, unsigned int); public: MSKeyTableData(const char *pName_); ~MSKeyTableData(void); const char *name(void) const {return _pName;} void add(const char*,MSKeyCallback*); void remove(unsigned long); void remove(const char*); MSBoolean process(const MSKeyPress&,MSWidget*) const; MSBoolean hasMatch(const MSKeyPress&) const; }; #endif aplus-fsf-4.22/src/MSGUI/MSKeyTranslationTable.H0000644000265000001440000000630610772770425015001 #ifndef MSKeyTranslationTableHEADER #define MSKeyTranslationTableHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1998-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include class MSHashTable; class MSNodeItem; class MSKeyTableData; class MSWidget; class MSKeyCallback; //*********************************************************************************************************************** // This class manages a list of MSKeyCallback/specification String pairs grouped together into keyTableData elements. //The specification strings( in accordance with the rules defined in MSKeyPress ) define the condition under which their //MSKeyCallback get invoked. Their are two types of keyTableData elements the default, one for each MSKeyTranslationTable, //and the global variety which can be used across multiple MSKeyTranslationTables. Sharing across //MSKeyTranslationTables is accomplished by sharing keyTableData elements. If an keyTableData element is added to and //defined ( assigned a group of MSKeyCallback/specification String pairs to it) in a MSKeyTranslationTable it can be added //to another one( with out having to redefine it). This feature is used to allow an MSWidget class to share the same //translations. Internally this is done using MSKeyClassCallback callbacks. When they are invoked the //MSWidget_class::Method method they were initalized with is called on the MSWidget_class instance they were invoked on. // //The order followed in the keyTranslation process is LIFO(derived class MSKeyCallback's specification's will be looked at //before their base classes). This processing continues untill all the "matching" MSKeyCallback's are called or until one //of them upon invokation returns an MSTrue. //*********************************************************************************************************************** class MSGUIExport MSKeyTranslationTable { public: MSKeyTranslationTable(); ~MSKeyTranslationTable(); void addKeyTableData(const char*); void removeKeyTableData(const char*); unsigned long addCallback(const char*, MSKeyCallback*, const char* keyTableData=0); void removeAllCallbacksThat(const char*); void removeCallback(const char*, const char* keyTableData=0); void removeCallback(unsigned long, const char* keyTableData=0); void removeCallback(MSKeyCallback*, const char* keyTableData=0); void removeAll(); MSBoolean translate(const MSKeyPress&,MSWidget*) const; MSBoolean hasMatch(const MSKeyPress&) const; static MSBoolean keyTableData(const char *pName_); private: static MSHashTable *_pHashTable; MSNodeItem *_pListHead; static MSKeyTableData *data(const char *pName_); void add(MSKeyTableData*); void remove(MSKeyTableData*); MSKeyTableData* defaultKeyTableData(void) const; }; inline void MSKeyTranslationTable::removeCallback(MSKeyCallback* keyCallback_, const char* keyTableData_) { removeCallback((unsigned long)keyCallback_, keyTableData_); } #endif aplus-fsf-4.22/src/MSGUI/MSKeyVoidMethodCallback.H0000644000265000001440000000162110772770425015205 #ifndef MSKeyVoidMethodCallbackHEADER #define MSKeyVoidMethodCallbackHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1998-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include template class MSKeyVoidMethodCallback : public MSKeyCallback { typedef void (MethodClass::*Method)(); private: Method _method; MethodClass *_object; public: MSKeyVoidMethodCallback(MethodClass *object_,Method method_) : _object(object_), _method(method_) {} ~MSKeyVoidMethodCallback(void) {} virtual MSBoolean process(MSWidget*,const MSKeyPress& translation_) { if (_object!=0&&_method!=0) (_object->*_method)(); return MSFalse; } }; #endif aplus-fsf-4.22/src/MSGUI/MSKeysym.H0000644000265000001440000000055110772770425012337 #ifndef MSKeysymHEADER #define MSKeysymHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #endif aplus-fsf-4.22/src/MSGUI/MSKeysymdef.H0000644000265000001440000000056210772770425013020 #ifndef MSKeysymdefHEADER #define MSKeysymdefHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #endif aplus-fsf-4.22/src/MSGUI/MSLabel.H0000644000265000001440000001006510772770425012076 #ifndef MSLabelHEADER #define MSLabelHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSGUIExport MSLabel : public MSPrimitiveText { public: MSLabel(MSWidget *,const char *label_=0); MSLabel(MSWidget *,const MSStringVector&); MSLabel(MSWidget *,MSStringVector&); MSLabel(MSWidget *,const MSPixmap &pixmap_,const MSPixmap &insensitivePixmap_); ~MSLabel(void); MSStringVector& label(void) const {return (MSStringVector&)*_model;} int margin(void) const {return _margin;} int rows(void) const {return numRows();} int columns(void) const {return numColumns();} const MSPixmap *pixmap(void) const {return _pixmap;} const MSPixmap *insensitivePixmap(void) const {return _insensitivePixmap;} void margin(int); void model(MSStringVector&); MSStringVector& viewModel(void) { return *((MSStringVector*)_model); } const MSStringVector& viewModel(void) const { return *((MSStringVector*)_model); } void label(const MSStringVector&); void pixmap(const MSPixmap &); void insensitivePixmap(const MSPixmap&); void displayToolTip(MSBoolean); MSBoolean displayToolTip(void) const {return _displayToolTip;} void toolTip(const MSStringVector&); const MSStringVector &toolTip(void) const {return tip();} virtual void redraw(void); virtual void naturalSize(void); MSLabel& operator=(const MSStringVector& label_) {label(label_); return *this;} operator MSStringVector&() {return *((MSStringVector *)_model);} virtual void set(MSAttrValueList& avList_); virtual MSAttrValueList& get(MSAttrValueList& avList_); protected: GC _pixmapGC; int _margin; MSPixmap *_pixmap; MSPixmap *_insensitivePixmap; MSBoolean _displayToolTip; void init(void); void createDefaultPixmap(int,int,unsigned long,unsigned long); void createDefaultInsensitivePixmap(int,int,unsigned long,unsigned long); void setClipRegion(void); GC pixmapGC(void); virtual void computeSize(void); virtual void firstMapNotify(void); virtual void configure(void); virtual void drawPixmap(void); virtual void drawLabel(void); virtual void clearRow(int); virtual void drawRow(int); virtual void drawRow(int,int,const char *,int); virtual void drawRows(int,int); virtual int computeYCoord(int); virtual int computeXCoord(int,int,const char *,int); virtual int computePixmapXCoord(const MSPixmap *); virtual int computePixmapYCoord(const MSPixmap *); // virtual methods for subclassers to override virtual int numRows(void) const; virtual int numColumns(void) const; virtual int numColumns(int row_) const; virtual const char *string(int row_) const; virtual const char *formatOutput(MSString &,int row_); int maxPixelWidth(void); int drawWidth(void) const; int drawHeight(void) const; virtual void update(const MSIndexVector&); virtual void updateData(void); virtual void updateBackground(unsigned long); virtual void updateForeground(unsigned long); virtual void updateFont(Font); virtual void updateSensitivity(void); virtual void updatePixmap(void); virtual void enterNotify(const XEvent *); virtual void leaveNotify(const XEvent *); virtual void toolTipXY(int &x,int &y); virtual const MSStringVector &tip(void) const; private: MSBoolean _resetClipRegion; int _numberOfRows; // this is used to determine if the number of rows has changed // for any given update - i.e. it is a cache of numRows int numberOfRows(void) const {return _numberOfRows;} void numberOfRows(int x_) {_numberOfRows=x_;} MSBoolean resetClipRegion(void) const {return _resetClipRegion;} void resetClipRegion(MSBoolean x_) {_resetClipRegion=x_;} }; #endif aplus-fsf-4.22/src/MSGUI/MSLabelFormat.H0000644000265000001440000000171310772770425013247 #ifndef MSLabelFormatHEADER #define MSLabelFormatHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #ifndef MSDefinesHEADER #include #endif class MSLabelOut; class MSGUIExport MSLabelFormat { public: MSLabelFormat(void); ~MSLabelFormat(void); unsigned long nextWeekday(unsigned long); const double **findProtocol(const MSLabelOut&); double snapTime(double,double); double snapNumber(double,const MSLabelOut&); double snipNumber(double,const MSLabelOut&); double minimumNumber(const MSLabelOut&); time_t timegm(struct tm *tm_) { #if defined(MS_HAS_MKTIME) || defined(HAVE_MKTIME) return mktime(tm_); #else return ::timegm(tm_); #endif } }; #endif aplus-fsf-4.22/src/MSGUI/MSLabelOut.H0000644000265000001440000000525510772770425012573 #ifndef MSLabelOutHEADER #define MSLabelOutHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include class MSGUIExport MSLabelOut { private: MSWidget *_owner; MSFloatVector _tickPositions; MSFloatVector _tickSizes; MSUnsignedVector _gridWidths; MSStringVector _labels; MSFormat _format; protected: MSWidget *owner(void) {return _owner;} public: MSLabelOut(void); MSLabelOut(MSAlignment); MSLabelOut(const MSStringVector&); MSLabelOut(const MSFormat&); ~MSLabelOut(void); void init(void); const MSWidget *owner(void) const {return _owner;} const MSFormat& format(void) const {return _format;} const MSFloatVector& tickPositions(void) const {return _tickPositions;} const MSFloatVector& tickSizes(void) const {return _tickSizes;} const MSUnsignedVector& gridWidths(void) const {return _gridWidths;} const MSStringVector& labels(void) const {return _labels;} void owner(MSWidget *x_) {_owner=x_;} void tickPositions(const MSFloatVector& x_) {_tickPositions=x_;} void tickSizes(const MSFloatVector& x_) {_tickSizes=x_;} void gridWidths(const MSUnsignedVector& x_) {_gridWidths=x_;} void labels(const MSStringVector& x_) {_labels=x_;} void format(const MSFormat&); virtual unsigned tickPositionLength(void) const; virtual unsigned gridWidthLength(void) const; virtual unsigned tickSizeLength(void) const; virtual unsigned labelLength(void) const; virtual double tickPosition(unsigned) const; virtual double tickSize(unsigned) const; virtual unsigned gridWidth(unsigned) const; virtual const char *formatOutput(MSString &,double); virtual const char *label(MSString &,unsigned) const; MSFormat::MSFormatType formatType(void) const {return _format.formatType();} }; inline unsigned MSLabelOut::tickPositionLength(void) const {return tickPositions().length();} inline unsigned MSLabelOut::tickSizeLength(void) const {return tickSizes().length();} inline unsigned MSLabelOut::gridWidthLength(void) const {return gridWidths().length();} inline unsigned MSLabelOut::labelLength(void) const {return labels().length();} typedef MSManagedPointer MSLabelOutPtr; #endif aplus-fsf-4.22/src/MSGUI/MSLayout.H0000644000265000001440000000257310772770425012341 #ifndef MSLayoutHEADER #define MSLayoutHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSGUIExport MSLayout : public MSLayoutManager { protected: MSLabel *_label; MSLabel *label(void) {return _label;} const MSLabel *label(void) const {return _label;} void init(void); virtual int innerHeight(void) const; virtual int realHeight(void) const; virtual int idealHeight(void) const; virtual int realWidth(void) const; virtual int idealWidth(void) const; virtual void configure(void); virtual void childConfigure(MSWidget *); virtual void childMap(MSWidget *); virtual void childUnmap(MSWidget *); virtual void childCreate(MSWidget *); virtual void childDestroy(MSWidget *); virtual void updateTitle(void); virtual void updateBackground(unsigned long); virtual void updateForeground(unsigned long); virtual void positionLabel(void); virtual void computeSize(void); public: MSLayout(MSWidget *,const char *title_=0); MSLayout(MSWidget *,const MSStringVector&); ~MSLayout(void); virtual void naturalSize(void); }; #endif aplus-fsf-4.22/src/MSGUI/MSLayoutManager.H0000644000265000001440000001644210772770425013634 #ifndef MSLayoutManagerHEADER #define MSLayoutManagerHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSGUIExport MSLayoutEntry { private: MSWidget *_widget; MSBoolean _mapped; At _at; public: MSLayoutEntry(MSWidget *widget_); ~MSLayoutEntry(void); MSWidget *widget(void) const; MSBoolean mapped(void) const; At& at(void); const At& at(void) const; void mapped(MSBoolean b_); }; class MSGUIExport MSLayoutVector { public: unsigned long _mask; // Option mask int _value; // Size of item MSLayoutVector(void); ~MSLayoutVector(void); unsigned long mask(void) const; int value(void) const; void mask(unsigned long mask_); void value(int value_); }; typedef void (*ValueFunc) (MSLayoutEntry *,int *,int *,MSBoolean *); typedef int (*SizeFunc) (MSWidget *); class MSGUIExport MSLayoutManager : public MSManager { public: enum Orientation {Vertical=0,Horizontal=1,Unspecified=2}; enum LayoutStyle {RowMajor=0,ColumnMajor=1}; MSLayoutManager(MSWidget *); ~MSLayoutManager(void); MSLayoutManager::Orientation orientation(void) const; void orientation(MSLayoutManager::Orientation); MSLayoutManager::LayoutStyle layoutStyle(void) const; void layoutStyle(MSLayoutManager::LayoutStyle); const MSIndexVector& geometry(void) const; void geometry(const MSIndexVector&); int rows(void) const; int columns(void) const; int rowSpacing(void) const; int columnSpacing(void) const; int margin(void) const; MSBoolean uniformColumns(void) const; MSBoolean uniformRows(void) const; MSBoolean lockSize(void) const; MSBoolean lockPositions(void) const; int row(MSWidget *) const; int column(MSWidget *) const; int columnSpan(MSWidget *) const; int rowSpan(MSWidget *) const; unsigned long options(MSWidget *) const; void rowSpacing(int); void columnSpacing(int); void margin(int); void uniformColumns(MSBoolean); // should the cols be uniform ? void uniformRows(MSBoolean); // should the rows be unifowm ? void lockSize(MSBoolean); void lockPositions(MSBoolean); virtual void print(const char *file_=0); virtual void unfreeze(void); virtual void resize(int,int); virtual void map(void); virtual void show(void); virtual MSWidgetVector children(void); virtual void set(MSAttrValueList& avList_); virtual MSAttrValueList& get(MSAttrValueList& avList_); protected: enum VectorState {Invalid,Minimum,Internal}; MSIndexVector *_geometry; MSLayoutManager::Orientation _orientation; MSLayoutManager::LayoutStyle _layoutStyle; MSNodeItem _mappedListHead; // list of mapped children int _innerWidth; // inner horizontal padding int _innerHeight; // inner vertical padding int _rowSpacing; // space between rows int _columnSpacing; // space between columns int _margin; // margin around layout MSNodeItem *mappedListHead(void); virtual void computeSize(void); virtual void adjustSize(void); virtual int findDistribution(int loc_,int span_,MSLayoutVector *vec_,int *result_, MSBoolean ignoreZeros_); virtual void doDistribution(int n_,int *distrib_,int loc_,int span_, MSLayoutVector *vec_,int size_,int spacing_); int computeVector(ValueFunc valueFunc,SizeFunc sizeFunc,int spacing_,MSLayoutVector *result_); void recomputeVectors(void); void setVectorOptions(ValueFunc valueFunc,MSLayoutVector *vec_); int vectorSize(ValueFunc valueFunc); virtual void extraSpace(int num_,MSLayoutVector *vec_,int size_,MSBoolean uniform_); virtual void extraRowSpace(int num_,MSLayoutVector *vec_,int size_); virtual void extraColumnSpace(int num_,MSLayoutVector *vec_,int size_); void placeWidget(MSWidget *,int x_,int y_,int w_,int h_,int rw_,int rh_,unsigned long opts_); void doPlacement(MSLayoutVector *cvec_,MSLayoutVector *rvec_,int vp_,int hp_,int rs,int cs); virtual void placement(void); virtual void insertChild(MSWidget *); virtual void removeChild(MSWidget *); MSBoolean placementFlag(void) const; void placementFlag(MSBoolean); MSLayoutEntry *getEntry(MSWidget *); const MSLayoutEntry *getEntry(MSWidget *) const; MSLayoutEntry *getEntry(int row_,int col_); virtual void updateOrientation(void); virtual MSBoolean setPositions(void); virtual MSBoolean setDefaultPositions(void); virtual void setDefaultChildPosition(MSLayoutEntry *); virtual void insertMappedEntry(MSLayoutEntry *); virtual void removeMappedEntry(MSLayoutEntry *); virtual MSLayoutEntry *findMappedEntry(MSWidget *); virtual At childPosition(MSWidget *); virtual void childPosition(MSWidget *widget_,const At& at_); virtual int realWidth(void) const; virtual int realHeight(void) const; virtual int idealWidth(void) const; virtual int idealHeight(void) const; virtual int innerHeight(void) const; virtual int innerWidth(void) const; int vectorHeight(void) const; int vectorWidth(void) const; virtual int rowHeight(unsigned row_) const; virtual int columnWidth(unsigned col_) const; virtual void printChildInfo(void); // for debugging virtual void configure(void); virtual void firstMapNotify(void); virtual void childConfigure(MSWidget *); virtual void childResizeConstraints(MSWidget *); virtual void childMap(MSWidget *); virtual void childUnmap(MSWidget *); virtual void childInsert(MSWidget *); virtual void childRemove(MSWidget *); virtual void childCreate(MSWidget *); virtual void childDestroy(MSWidget *); virtual void visibilityObscured(void); virtual void visibilityUnobscured(void); // For ArrowKey Traversal virtual void up(void); virtual void down(void); virtual void left(void); virtual void right(void); private: enum StateFlags { UniformColumns=1, // are the cols to be made uniform? UniformRows=2, // are the rows to be made uniform? LockSize=4, // do not recalc size on unfreeze LockPositions=8, // do not reset row and col sizes PlacementFlag=16 // set when layout is configuring children }; VectorState _vectorState; // current state of vectors int _rows; // number of rows int _columns; // number of columns int _vectorHeight; // sum of current rows int _vectorWidth; // sum of current columns MSLayoutVector *_rowHeights; // heights of each row MSLayoutVector *_columnWidths; // widths of each column unsigned long _stateFlag; // holds the current state of the layout void init(void); unsigned long stateFlag(void) const; // Private methods used by ArrowKey Traversal code MSLayoutEntry *getNextVerticalEntry(MSLayoutEntry *); MSLayoutEntry *getPrevVerticalEntry(MSLayoutEntry *); MSLayoutEntry *getNextHorizontalEntry(MSLayoutEntry *); MSLayoutEntry *getPrevHorizontalEntry(MSLayoutEntry *); }; #endif aplus-fsf-4.22/src/MSGUI/MSList.H0000644000265000001440000001641610772770425012000 #ifndef MSListHEADER #define MSListHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #ifdef MS_VC_NEED_TEMPLATE_EXPORT class MSGUIExport MSGenericVector; #endif class MSGUIExport MSList : public MSRowColumnView { public: MSList(MSWidget *,const char *title_=0); MSList(MSWidget *,const MSStringVector&); ~MSList(void); void registerPixmap(const MSPixmap &); void unregisterPixmap(const MSString&); const MSPixmap* pixmap(const MSString&); void pixmapList(const MSStringVector &); MSStringVector pixmapList(void) const; virtual void doubleClick(void); virtual void right(void); virtual MSBoolean editorActivate(void); virtual MSString selection(void); void selectedRowForeground(const char *); void selectedRowForeground(unsigned long); unsigned long selectedRowForeground(void) const; virtual void up(void); virtual void down(void); virtual void moveRow(int,int); virtual void set(MSAttrValueList& avList_); virtual MSAttrValueList& get(MSAttrValueList& avList_); protected: class PixmapRegistry : public MSHashTable { protected: int _maxPixmapWidth; int _maxPixmapHeight; public: PixmapRegistry(unsigned size_=16); ~PixmapRegistry(void); void add(const MSPixmap &); void remove(const MSString&); int maxPixmapWidth(void) const {return _maxPixmapWidth;} int maxPixmapHeight(void) const {return _maxPixmapHeight;} }; typedef MSGenericVector PixmapVector; PixmapRegistry _pixmapRegistry; PixmapVector _pixmapVector; unsigned _maxLength; GC _pixmapGC; unsigned long _selectedRowForeground; MSString& isearchString(void); MSIndexVector& isearchVector(void); unsigned maxLength(void) const {return _maxLength;} PixmapRegistry &pixmapRegistry(void) {return _pixmapRegistry;} const PixmapRegistry &pixmapRegistry(void) const {return _pixmapRegistry;} PixmapVector &pixmapVector(void) {return _pixmapVector;} const PixmapVector &pixmapVector(void) const {return _pixmapVector;} void init(void); virtual int clearSelection(void); virtual void updateInternalState(void); virtual void startEditing(const XEvent *); virtual void moveEditorToSelection(const MSString &); virtual void updateHsb(void); virtual int computeNumVisibleColumns(void); virtual unsigned rowLength(unsigned) const; virtual int drawWidth(void); virtual void redrawImmediately(void); virtual void computeSize(void); virtual void placement(void); virtual void defaultNumVisible(void); virtual void adjustNumVisible(void); virtual void adjustFirstColumn(void); virtual void shapeUpdate(void); virtual void appendUpdate(const MSIndexVector &); virtual void drawRow(int); virtual void drawRows(int,int); virtual void drawRow(Window,int,const char *,int len_); virtual void drawRows(Window,int,int); virtual void drawActualRow(Window,int row_,const char *string_,int len_, const MSPixmap *,unsigned long fg_,unsigned long bg_, Font font_,MSBoolean selected_,MSBoolean selectOutline_); virtual void drawString(Display *,Window,GC,const XFontStruct *,int,int,const char *,int); virtual void drawSelectOutline(Window,int,MSBoolean); virtual void drawSelectedRow(Window,int,MSBoolean); virtual void drawSelectedRow(Window,int); virtual void drawSelectedRow(int,MSBoolean); virtual void drawCycle(MSColorCycle *cycle_); virtual void drawCycle(int row_,unsigned long); virtual void defaultButtonBehavior(const XEvent *); virtual void defaultButton2Behavior(const XEvent *); virtual void headingAreaSelection(const XEvent *); virtual void dataAreaSelection(const XEvent *); virtual int dragRowFromEvent(const XEvent *); virtual void keyPress(const XEvent *,KeySym,unsigned int,const char *); virtual void incrementalSearch(unsigned row_=0); virtual void focusIn(void); virtual void focusOut(void); virtual MSBoolean loseFocus(void); virtual void update(const MSIndexVector&); virtual void trackSelection(int,int,MSBoolean clear_,MSBoolean shifted_); virtual void trackUnselection(int,int); virtual void drawSelected(int); //added for Multiple Select virtual void undrawSelected(int); //added for Multiple Select virtual void edit(void); virtual int computeNumVisibleRows(void); virtual void calculateRowHeight(void); virtual void rowColumnSelection(void); virtual void undrawSelectedRow(int row_) { MSRowColumnView::undrawSelectedRow(row_); } virtual void undrawSelectedRow(Window,int); virtual int drawHeight(void); virtual void scrollRight(int); virtual void updateScrollBars(void); virtual void updateVsb(void); virtual void hsbValueUpdate(void); virtual void vsbValueUpdate(void); virtual void updateSelectedRow(int); virtual void updateSelectionVector(const MSIndexVector &); virtual void updateFirstRow(int); virtual void updateFirstColumn(int); virtual void cycleCell(MSColorCycle *); virtual void moveSelection(int); virtual void cycleRow(int); virtual void createCycle(int); virtual void adjustSelection(void); virtual void calculateMaxLength(void); virtual const MSPixmap *rowPixmap(unsigned); virtual int maxPixmapHeight(void); virtual int maxPixmapWidth(void); int actualNumColumns(void); virtual int numPixmapColumns(void); GC pixmapGC(void); virtual const char *formatOutput(MSString &,unsigned); virtual unsigned long rowForeground(unsigned); virtual unsigned long rowBackground(unsigned); virtual Font rowFont(unsigned); virtual MSBoolean isRowProtected(unsigned); virtual MSBoolean validate(const char *,unsigned); virtual unsigned long selectedRowForegroundColor(int); virtual unsigned long selectedRowBackgroundColor(int); virtual void toggleRowNotify(unsigned); virtual void toggleRow(unsigned); virtual void toggleModeMoveRow(int, int); virtual void updateSelectionMode(MSSelectionMode); virtual void updateBackground(unsigned long); //for backward compatibility only. virtual MSBoolean isProtected(void) const; virtual MSBoolean isProtected(unsigned); private: MSString _isearchString; MSIndexVector _isearchVector; }; inline MSString& MSList::isearchString(void) { return _isearchString; } inline MSIndexVector& MSList::isearchVector(void) { return _isearchVector; } inline unsigned long MSList::selectedRowForeground(void) const { return _selectedRowForeground; } // We provide explicit "do_not_instantiate" pragmas here to avoid instantiation complications in // MStk applications. // #if !defined(__MSGUILIBRARY_BUILD__) && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma do_not_instantiate MSGenericVector #pragma do_not_instantiate MSGenericVectorOps #pragma do_not_instantiate MSGenericData #endif // !__MSGUILIBRARY_BUILD__ && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) DECLARE_ELEMENT_FOR_OPS_TYPE(MSPixmap *) #endif aplus-fsf-4.22/src/MSGUI/MSManager.H0000644000265000001440000000247210772770425012434 #ifndef MSManagerHEADER #define MSManagerHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSGUIExport MSManager : public MSWidgetCommon { public: MSManager(MSWidget *); ~MSManager(void); int childCount(void) const { return _childCount; } virtual void show(void); virtual void print(const char *file_=0); virtual void redraw(void); virtual MSWidgetVector children(void); protected: MSNodeItem _childListHead; int _childCount; MSNodeItem *childListHead(void) { return &_childListHead; } const MSNodeItem *childListHead(void) const { return &_childListHead; } void init(void); virtual void updateBackground(unsigned long); virtual void visibilityUnobscured(void); virtual void visibilityObscured(void); virtual void placement(void); virtual void configure(void); virtual void childDestroy(MSWidget *); virtual void childCreate(MSWidget *); virtual void childInsert(MSWidget *); virtual void childRemove(MSWidget *); }; #endif aplus-fsf-4.22/src/MSGUI/MSMatrixTraceSet.H0000644000265000001440000000355210772770425013761 #ifndef MSMatrixTraceSetHEADER #define MSMatrixTraceSetHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MSDefinesHEADER #include #endif #include #include #if defined(MS_NEED_IMPLEMENTATION_PRAGMA) #pragma implementation("MSMatrixTraceSet.C") #endif template class MSMatrixTraceSet : public MSTraceSet { public: MSMatrixTraceSet(MSGraph *,const char *title_,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSMatrixTraceSet(MSGraph *,const MSStringVector&,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSMatrixTraceSet(MSGraph *,MSTypeMatrix&,const char *,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSMatrixTraceSet(MSGraph *,MSTypeMatrix&,const MSStringVector&,const MSSymbol& tag_=MSSymbol::nullSymbol()); ~MSMatrixTraceSet(void); void model(MSTypeMatrix&); void model(const MSTypeMatrix&); MSTypeMatrix& viewModel(void) { return *((MSTypeMatrix*)_model); } const MSTypeMatrix& viewModel(void) const { return *((MSTypeMatrix*)_model); } protected: MSTypeMatrix& matrix(void); const MSTypeMatrix& matrix(void) const; void matrix(const MSTypeMatrix&); virtual int dataCount(void) const; virtual double x(int) const; virtual double y(int,int) const; virtual int numColumns(void) const; virtual void validate(int,int,double,double); virtual const char *formatOutput(MSString &,unsigned,unsigned); MSMatrixTraceSet& operator=(const MSTypeMatrix& aMatrix_); operator MSTypeMatrix&() const { return matrix(); } }; #endif aplus-fsf-4.22/src/MSGUI/MSMenu.H0000644000265000001440000001504610772770426011770 #ifndef MSMenuHEADER #define MSMenuHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include class MSMenuBar; class MSGUIExport MSMenu : public MSWidgetCommon { friend class MSMenuItem; friend class MSMenuList; public: MSMenu(MSDisplayServer *); MSMenu(MSWidget *); ~MSMenu(void); MSMenuItem *activeMenuItem(void); const MSMenuItem *activeMenuItem(void) const; MSMenuItem *taggedMenuItem(int); const MSMenuItem *taggedMenuItem(int) const; MSMenuItem *parentMenuItem(void); const MSMenuItem *parentMenuItem(void) const; int entryBorder(void) const; void entryBorder(int); MSBoolean radioBehavior(void) const; void radioBehavior(MSBoolean); unsigned columns(void) const; void columns(unsigned); virtual MSAttrValueList& get(MSAttrValueList&); virtual void set(MSAttrValueList&); virtual void left(void); virtual void right(void); virtual void up(void); virtual void down(void); virtual void returnKey(void); virtual void escape(void); virtual void done(void); virtual void activate(void); virtual void reset(void); virtual void enforceRadioBehavior(void); virtual void grabAndSelect(unsigned long time_=CurrentTime); virtual void grab(unsigned long time_=CurrentTime); virtual void ungrab(unsigned long time_=CurrentTime); virtual void releaseGrab(void); virtual void redraw(void); virtual void unmap(void); virtual void map(void); virtual MSWidgetVector children(void); void permuteMenuItems(const MSWidgetVector&); void permuteMenuItems(const MSIntVector&); public: class MSGUIExport MSMenuList { private: MSNodeItem _itemListHead; MSNodeItem *itemListHead(void) {return _itemListHead.address();} public: MSMenuList(void); ~MSMenuList(void); void addToList(MSMenu *); void removeFromList(MSMenu *); MSMenu *findMenu (MSDisplayServer *server_,int x_,int y_); }; protected: static MSMenuList _menuList; MSWidgetVector _itemVector; MSWidgetVector _hiddenItemVector; int _selectedItem; MSBoolean _radioBehavior; int _entryBorder; unsigned _columns; MSMenuItem *_parentMenuItem; void init(void); void initFromServer(MSDisplayServer*); MSMenu(MSMenuItem*); //this constructor is to be used only by subclasses. MSWidgetVector& itemVector(void); const MSWidgetVector& itemVector(void) const; MSWidgetVector& hiddenItemVector(void); const MSWidgetVector& hiddenItemVector(void) const; MSMenuItem *menuItem(int); const MSMenuItem *menuItem(int) const; MSMenuItem *findItem(int x_,int y_); int itemCount(void) const; int selectedItem(void) const; void selectedItem(int); //calculateNaturalSize returns the width and height & placeMenuItems places items //in correct x,y coordinates. without having to be mapped first virtual void calculateNaturalSize(int&,int&); void placeMenuItems(void); virtual void computeSize(void); virtual void removeAllItems(void); virtual void drawItems(void); virtual void drawItem(int item_,MSBoolean select_); virtual void drawSelectedItem(void); virtual void undrawSelectedItem(void); virtual void placement(void); virtual void focusIn(void); virtual void focusOut(void); virtual MSBoolean loseFocus(void); virtual void motionNotify(const XEvent *); virtual void buttonRelease(const XEvent *); virtual void buttonPress(const XEvent *); virtual void keyPress(const XEvent *,KeySym,unsigned int,const char *); virtual void childConfigure(MSWidget *); virtual void childCreate(MSWidget *); virtual void childDestroy(MSWidget *); virtual void childMap(MSWidget *); virtual void updateBackground(unsigned long); virtual void updateForeground(unsigned long); virtual void updateFont(Font); virtual void firstMapNotify(void); virtual void configure(void); virtual void accelerator(char aChar_); virtual void pulldownMenus(void); MSMenu *grabber(void); void grabber(MSMenu *); MSMenuBar *menuBar(void); void menuBar(MSMenuBar*); MSDisplayCursor *grabCursor(void); static MSMenuList &menuList(void) { return _menuList; } virtual void pointerLeave(void); virtual void reselect(void); virtual void selectNone(void); virtual MSMenuItem *nextRightItem(void); virtual MSMenuItem *nextLeftItem(void); virtual MSMenuItem *nextUpItem(void); virtual MSMenuItem *nextDownItem(void); MSBoolean insideColumn(unsigned column_,int item_); // Checks if item_ is in column_ unsigned rowCount(unsigned column_); // Returns the number of rows in column_ MSIntVector rowItems(int item_); // Returns all the items in the row that contains item_ void setItem(MSMenuItem *, int); // Sets the item value of a menuItem. }; inline MSWidgetVector& MSMenu::itemVector(void) { return _itemVector; } inline const MSWidgetVector& MSMenu::itemVector(void) const { return _itemVector; } inline MSWidgetVector& MSMenu::hiddenItemVector(void) { return _hiddenItemVector; } inline const MSWidgetVector& MSMenu::hiddenItemVector(void) const { return _hiddenItemVector; } inline int MSMenu::itemCount(void) const { return _itemVector.length(); } inline int MSMenu::selectedItem(void) const { return _selectedItem; } inline int MSMenu::entryBorder(void) const { return _entryBorder; } inline MSBoolean MSMenu::radioBehavior(void) const { return _radioBehavior; } inline unsigned MSMenu::columns(void) const { return _columns; } inline MSMenu *MSMenu::grabber(void) { return (MSMenu*)server()->menuGrabber(); } inline MSMenuBar *MSMenu::menuBar(void) { return (MSMenuBar*)server()->menuBar(); } inline MSDisplayCursor *MSMenu::grabCursor(void) { return server()->menuGrabCursor(); } inline void MSMenu::grabber(MSMenu *menu_) { server()->menuGrabber(menu_); } inline void MSMenu::menuBar(MSMenuBar* bar_) { server()->menuBar((MSWidget*)bar_); } inline void MSMenu::selectedItem(int item_) { _selectedItem=item_; } inline unsigned MSMenu::rowCount(unsigned column_) { return (itemCount()/columns()+((itemCount()%columns())>column_?1:0)); } inline MSMenuItem * MSMenu::parentMenuItem(void) { return _parentMenuItem; } inline const MSMenuItem * MSMenu::parentMenuItem(void) const { return _parentMenuItem; } #endif aplus-fsf-4.22/src/MSGUI/MSMenuBar.H0000644000265000001440000000277410772770426012421 #ifndef MSMenuBarHEADER #define MSMenuBarHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSGUIExport MSMenuBar : public MSMenu { public: enum Orientation { Horizontal, Vertical }; protected: friend class MSMenu; Orientation _orientation; virtual void computeSize(void); virtual void placement(void); virtual void pointerLeave(void); virtual void selectNone(void); virtual void buttonPress(const XEvent *); virtual void keyPress(const XEvent *,KeySym,unsigned int,const char *); virtual MSMenuItem *nextRightItem(void); virtual MSMenuItem *nextLeftItem(void); virtual MSMenuItem *nextUpItem(void); virtual MSMenuItem *nextDownItem(void); void dropMenu(MSMenuItem *); void moveToMenu(MSMenuItem* ); public: MSMenuBar(MSWidget *); ~MSMenuBar(void); MSMenu *selectedMenu(void); const MSMenu *selectedMenu(void) const; Orientation orientation(void) const { return _orientation; } void orientation(Orientation); virtual void done(void); virtual void up(void); virtual void down(void); virtual void left(void); virtual void right(void); virtual void unmap(void); virtual void map(void); virtual MSAttrValueList& get(MSAttrValueList&); virtual void set(MSAttrValueList&); }; #endif aplus-fsf-4.22/src/MSGUI/MSMenuBarItem.H0000644000265000001440000000271610772770426013234 #ifndef MSMenuBarItemHEADER #define MSMenuBarItemHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSGUIExport MSMenuBarItem : public MSMenuItem { friend class MSPulldownMenu; protected: MSPulldownMenu *_pulldownMenu; void init(void); virtual int computeYCoord(void); virtual MSMenu* cascadedMenu(void); virtual const MSMenu* cascadedMenu(void) const; void pulldownMenu(MSPulldownMenu *); void menuDestroy(MSPulldownMenu *); virtual void updateFont(Font); virtual void updateForeground(unsigned long); virtual void updateBackground(unsigned long); virtual void menushow(void); virtual MSAttrValueList& get(MSAttrValueList&); public: MSMenuBarItem(MSMenuBar *); MSMenuBarItem(MSMenuBar *,const char *,char mnemonic_=0,int tag_=0); MSMenuBarItem(MSMenuBar *,const MSString&,char mnemonic_=0,int tag_=0); MSMenuBarItem(MSMenuBar *,const MSPixmap &pixmap_,const MSPixmap &insensitivePixmap_,int tag_=0); ~MSMenuBarItem(void); MSPulldownMenu *pulldownMenu(void) { return _pulldownMenu; } const MSPulldownMenu *pulldownMenu(void) const { return _pulldownMenu; } virtual void grab(void); virtual void arm(void); virtual void disarm(void); }; #endif aplus-fsf-4.22/src/MSGUI/MSMenuItem.H0000644000265000001440000001465610772770426012615 #ifndef MSMenuItemHEADER #define MSMenuItemHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1998-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include class MSFontObject; class MSArrow; class MSPixmap; class MSMenu; class MSMenuBar; class MSPulldownMenu; class MSPopupMenu; class MSCascadeMenu; class MSGUIExport MSMenuItem : public MSWidgetOutput { friend class MSMenu; friend class MSMenuBar; friend class MSPulldownMenu; friend class MSPopupMenu; friend class MSCascadeMenu; protected: enum ShowState { ShowLabel, ShowPixmap, ShowBoth }; public: MSMenuItem(MSMenu *); MSMenuItem(MSMenu *,const char *,char mnemonic_=0,int tag_=0); MSMenuItem(MSMenu *,const MSString&,char mnemonic_=0,int tag_=0); MSMenuItem(MSMenu *,const MSPixmap &pixmap_,const MSPixmap &insensitivePixmap_,int tag_=0); MSMenuItem(MSMenu *,const MSString &,const MSPixmap &pixmap_,const MSPixmap &insensitivePixmap_, char mnemonic_=0,int tag_=0); MSMenuItem(MSMenu *,const char*,const MSPixmap &pixmap_,const MSPixmap &insensitivePixmap_, char mnemonic_=0,int tag_=0); ~MSMenuItem(void); MSMenu *menu(void); const MSMenu *menu(void) const; int tag(void) const; void tag(int tag_); char mnemonic(void) const; void mnemonic(char); MSBoolean armed(void) const; void armed(MSBoolean); MSBoolean state(void) const; void state(MSBoolean); MSBoolean selected(void) const; MSBoolean cascade(void) const; const MSString& label(void) const; void label(const MSString&); const MSPixmap *pixmap(void) const; void pixmap(const MSPixmap&); const MSPixmap *insensitivePixmap(void) const; void insensitivePixmap(const MSPixmap&); int marginWidth(void) const; void marginWidth (int); int marginHeight(void) const; void marginHeight (int); void spacing(int); int spacing(void) const; virtual void select(void); virtual void unselect(void); virtual void grab(void); virtual void arm(void); virtual void disarm(void); virtual void activate(void); virtual void redraw(void); virtual void naturalSize(void); virtual MSWidgetVector children(void); MSBoolean changeState(void) const; void changeState(MSBoolean); virtual void set(MSAttrValueList& avList_); virtual MSAttrValueList& get(MSAttrValueList& avList_); static MSBoolean defaultMnemonic(void); static void defaultMnemonic(MSBoolean); protected: MSString _label; MSPixmap *_pixmap; MSPixmap *_insensitivePixmap; char _mnemonic; int _item; int _tag; MSBoolean _armed; MSBoolean _selected; MSBoolean _cascade; MSBoolean _changeState; MSGC _textMSGC; MSFontObject *_fontObject; int _marginWidth; int _marginHeight; int _indent; int _spacing; MSPixmap *_stipple; GC _pixmapGC; ShowState _showState; static MSBoolean _defaultMnemonic; MSGC& textMSGC(void); GC textGC(void) const; MSFontObject *fontObject(void) const; MSPixmap *stipple(void) const; GC pixmapGC(void); void init(void); void initPixmaps(const MSPixmap&,const MSPixmap&); void createGCs(void); MSPixmap *createDefaultPixmap(int,int,unsigned long,unsigned long); int drawWidth(void) const; int drawHeight(void) const; void indent(int); int indent(void) const; int item(void) const; void item(int item_); ShowState showState(void) const { return _showState; } void showState(ShowState); int labelWidth(void); int labelHeight(void); int pixmapWidth(void); int pixmapHeight(void); virtual void updateFont(Font); virtual void updateForeground(unsigned long); virtual void updateBackground(unsigned long); virtual void updateSensitivity(void); virtual MSMenu* cascadedMenu(void); virtual const MSMenu* cascadedMenu(void) const; virtual void radioDisarm(void); virtual void computeSize(void); virtual void configure(void); virtual void focusIn(void); virtual void focusOut(void); virtual void drawSymbol(void); virtual void drawLabel(void); virtual void drawPixmap(void); virtual void computePixmapDrawingCoord(const MSPixmap *,int&,int&,int&,int&,int&,int&); virtual int computeYCoord(void); virtual int computeXCoord(void); virtual int computeIndentation(void); virtual const MSPixmap *currentPixmap(void) const; }; inline MSFontObject *MSMenuItem::fontObject(void) const { return _fontObject; } inline MSPixmap *MSMenuItem::stipple(void) const { return _stipple; } inline int MSMenuItem::item(void) const { return _item; } inline void MSMenuItem::item(int item_) { _item=item_; } inline MSMenu *MSMenuItem::menu(void) { return (MSMenu *)owner(); } inline const MSMenu *MSMenuItem::menu(void) const { return (MSMenu *)owner(); } inline int MSMenuItem::tag(void) const { return _tag; } inline char MSMenuItem::mnemonic(void) const { return _mnemonic; } inline MSBoolean MSMenuItem::armed(void) const { return _armed; } inline MSBoolean MSMenuItem::state(void) const { return _armed; } inline MSBoolean MSMenuItem::selected(void) const { return _selected; } inline MSBoolean MSMenuItem::cascade(void) const { return _cascade; } inline const MSString& MSMenuItem::label(void) const { return _label; } inline const MSPixmap *MSMenuItem::pixmap(void) const { return _pixmap; } inline const MSPixmap *MSMenuItem::insensitivePixmap(void) const { return _insensitivePixmap; } inline int MSMenuItem::marginWidth(void) const { return _marginWidth; } inline int MSMenuItem::marginHeight(void) const { return _marginHeight; } inline int MSMenuItem::indent(void) const { return _indent; } inline void MSMenuItem::tag(int tag_) { _tag=tag_; } inline void MSMenuItem::mnemonic(char c_) { _mnemonic=c_; } inline void MSMenuItem::state(MSBoolean b_) { _armed=b_; } inline void MSMenuItem::armed(MSBoolean b_) { _armed=b_; } inline MSBoolean MSMenuItem::changeState(void) const { return _changeState; } inline void MSMenuItem::changeState(MSBoolean changeState_) { _changeState = changeState_; } inline int MSMenuItem::spacing(void) const { return _spacing; } #endif aplus-fsf-4.22/src/MSGUI/MSMenuShell.H0000644000265000001440000000306410772770426012755 #ifndef MSMenuShellHEADER #define MSMenuShellHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSGUIExport MSMenuShell : public MSShell { public: MSMenuShell(const char *windowTitle_=0); MSMenuShell(MSDisplayServer *,const char *windowTitle_=0); ~MSMenuShell(void); MSMenuBar *menuBar(void); const MSMenuBar *menuBar(void) const; protected: void init(void); int menuBarWidth(void) const; int menuBarHeight(void) const; MSBoolean placementFlag(void) const; virtual int idealShellWidth(void) const; virtual int idealShellHeight(void) const; virtual void adjustChildPosition(void); virtual void adjustChildSize(void); virtual void showChildren(void); virtual void childConfigure(MSWidget *); virtual void childDestroy(MSWidget *); virtual MSBoolean processAltKey(const XEvent *,KeySym,unsigned int,const char *); virtual MSBoolean processFunctionKey(const XEvent *,KeySym,unsigned int,const char *); virtual MSWidgetVector children(void); private: MSMenuBar *_menuBar; MSBoolean _placementFlag; }; inline MSMenuBar *MSMenuShell::menuBar(void) { return _menuBar; } inline const MSMenuBar *MSMenuShell::menuBar(void) const { return _menuBar; } inline MSBoolean MSMenuShell::placementFlag(void) const { return _placementFlag; } #endif aplus-fsf-4.22/src/MSGUI/MSMethodButton.H0000644000265000001440000000276210772770426013501 #ifndef MSMethodButtonHEADER #define MSMethodButtonHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include template class MSMethodButton : public MSButton { typedef void (MethodClass::*Method)(void); private: Method _method; MethodClass *_object; public: MSMethodButton(MSWidget *owner_,MethodClass *object_,Method method_) : _object(object_),_method(method_), MSButton(owner_) {} MSMethodButton(MSWidget *owner_,const char *label_,MethodClass *object_,Method method_) : _object(object_),_method(method_), MSButton(owner_,label_) {} MSMethodButton(MSWidget *owner_,const MSStringVector& label_, MethodClass *object_,Method method_) : _object(object_),_method(method_), MSButton(owner_,label_) {} MSMethodButton(MSWidget *owner_,const MSPixmap& pixmap_,const MSPixmap& insensitivePixmap_, const MSPixmap& armedPixmap_,MethodClass *object_,Method method_) : _object(object_),_method(method_), MSButton(owner_,pixmap_,insensitivePixmap_,armedPixmap_) {} ~MSMethodButton(void) {} Method method(void) const {return _method;} MethodClass *object(void) const {return _object;} virtual void activate(void) { if (_object!=0&&_method!=0) (_object->*_method)(); } }; #endif aplus-fsf-4.22/src/MSGUI/MSMethodCheckButton.H0000644000265000001440000000424510772770426014435 #ifndef MSMethodCheckButtonHEADER #define MSMethodCheckButtonHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #ifndef MSDefinesHEADER #include #endif #if defined(MS_NEED_IMPLEMENTATION_PRAGMA) #pragma implementation("MSMethodCheckButton.C") #endif template class MSMethodCheckButton : public MSCheckButton { typedef void (MethodClass::*Method)(void); private: Method _armMethod; Method _disarmMethod; MethodClass *_object; protected: virtual void arm(void); virtual void disarm(void); public: MSMethodCheckButton(MSWidget *,const char *label_, MethodClass *object_,Method armMethod_,Method disarmMethod_, const MSSymbol& tag_=MSSymbol::nullSymbol()); MSMethodCheckButton(MSWidget *,const MSStringVector& label_, MethodClass *object_,Method armMethod_,Method disarmMethod_, const MSSymbol& tag_=MSSymbol::nullSymbol()); MSMethodCheckButton(MSWidget *,const MSPixmap& pixmap_,const MSPixmap& insensitivePixmap_, const MSPixmap& armedPixmap_, MethodClass *object_,Method armMethod_,Method disarmMethod_, const MSSymbol& tag_=MSSymbol::nullSymbol()); MSMethodCheckButton(MSWidget *,const char *label_, MethodClass *object_,Method armMethod_,Method disarmMethod_, int integerTag_); MSMethodCheckButton(MSWidget *,const MSStringVector& label_, MethodClass *object_,Method armMethod_,Method disarmMethod_, int integerTag_); MSMethodCheckButton(MSWidget *,const MSPixmap& pixmap_,const MSPixmap& insensitivePixmap_, const MSPixmap& armedPixmap_, MethodClass *object_,Method armMethod_,Method disarmMethod_, int integerTag_); ~MSMethodCheckButton(void) {} Method armMethod(void) const { return _armMethod; } Method disarmMethod(void) const { return _disarmMethod; } MethodClass *object(void) const { return _object; } }; #endif aplus-fsf-4.22/src/MSGUI/MSMethodMenuItem.H0000644000265000001440000000306610772770426013747 #ifndef MSMethodMenuItemHEADER #define MSMethodMenuItemHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include template class MSMethodMenuItem : public MSMenuItem { typedef void (MethodClass::*Method)(void); private: Method _method; MethodClass *_object; public: MSMethodMenuItem(MSMenu *owner_,const char *label_, MethodClass *object_,Method method_,char mnemonic_=0,int tag_=0) : _object(object_),_method(method_), MSMenuItem(owner_,label_,mnemonic_,tag_) {} MSMethodMenuItem(MSMenu *owner_,const MSString& label_, MethodClass *object_,Method method_,char mnemonic_=0,int tag_=0) : _object(object_),_method(method_), MSMenuItem(owner_,label_,mnemonic_,tag_) {} MSMethodMenuItem(MSMenu *owner_,const MSPixmap &pixmap_, const MSPixmap &insensitivePixmap_, MethodClass *object_,Method method_,int tag_=0) : _object(object_),_method(method_), MSMenuItem(owner_,pixmap_,insensitivePixmap_,tag_) {} ~MSMethodMenuItem(void) {} Method method(void) const {return _method;} MethodClass *object(void) const {return _object;} virtual void activate(void) { if (menu()!=0) { menu()->releaseGrab(); if (_object!=0&&_method!=0) (_object->*_method)(); menu()->done(); } } }; #endif aplus-fsf-4.22/src/MSGUI/MSMethodRadioButton.H0000644000265000001440000000373510772770426014461 #ifndef MSMethodRadioButtonHEADER #define MSMethodRadioButtonHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #ifndef MSDefinesHEADER #include #endif #if defined(MS_NEED_IMPLEMENTATION_PRAGMA) #pragma implementation("MSMethodRadioButton.C") #endif template class MSMethodRadioButton : public MSRadioButton { typedef void (MethodClass::*Method)(void); private: Method _armMethod; MethodClass *_object; protected: virtual void arm(MSBoolean); virtual void arm(void); public: MSMethodRadioButton(MSRadioBox *,const char *label_, MethodClass *object_,Method armMethod_, const MSSymbol& tag_=MSSymbol::nullSymbol()); MSMethodRadioButton(MSRadioBox *,const MSStringVector& label_, MethodClass *object_,Method armMethod_, const MSSymbol& tag_=MSSymbol::nullSymbol()); MSMethodRadioButton(MSRadioBox *,const MSPixmap& pixmap_, const MSPixmap& insensitivePixmap_,const MSPixmap& armedPixmap_, MethodClass *object_,Method armMethod_, const MSSymbol& tag_=MSSymbol::nullSymbol()); MSMethodRadioButton(MSRadioBox *,const char *label_, MethodClass *object_,Method armMethod_, int integerTag_); MSMethodRadioButton(MSRadioBox *,const MSStringVector& label_, MethodClass *object_,Method armMethod_, int integerTag_); MSMethodRadioButton(MSRadioBox *,const MSPixmap& pixmap_, const MSPixmap& insensitivePixmap_,const MSPixmap& armedPixmap_, MethodClass *object_,Method armMethod_, int integerTag_); ~MSMethodRadioButton(void) {} Method armMethod(void) const { return _armMethod; } MethodClass *object(void) const { return _object; } }; #endif aplus-fsf-4.22/src/MSGUI/MSModalPopup.H0000644000265000001440000000115310772770426013136 #ifndef MSModalPopupHEADER #define MSModalPopupHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSGUIExport MSModalPopup : public MSPopup { public: MSModalPopup(const char *windowTitle_=0); MSModalPopup(MSDisplayServer *,const char *windowTitle_=0); MSModalPopup(MSShell *,const char *windowTitle_=0); ~MSModalPopup(void); }; #endif aplus-fsf-4.22/src/MSGUI/MSModelCheckBox.H0000644000265000001440000000162610772770426013532 #ifndef MSModelCheckBoxHEADER #define MSModelCheckBoxHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSGUIExport MSModelCheckBox : public MSCheckBox { friend class MSCheckButton; public: MSModelCheckBox(MSWidget *,const char *title_=0); MSModelCheckBox(MSWidget *,const MSStringVector &title_); ~MSModelCheckBox(void); protected: virtual void arm(MSCheckButton *); virtual void disarm(MSCheckButton *); virtual void update(const MSIndexVector &); virtual void updateData(void); virtual void firstMapNotify(void); virtual void drawCurrentState(void)=0; virtual void setModel(void)=0; }; #endif aplus-fsf-4.22/src/MSGUI/MSMoneyEntryField.H0000644000265000001440000000354610772770426014143 #ifndef MSMoneyEntryFieldHEADER #define MSMoneyEntryFieldHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include // We provide explicit "do_not_instantiate" pragmas here to avoid instantiation complications in // MStk applications. // #if !defined(__MSGUILIBRARY_BUILD__) && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma do_not_instantiate MSTypeEntryField #endif // !__MSGUILIBRARY_BUILD__ && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #if defined(MS_VC_NEED_TEMPLATE_EXPORT) class MSGUIExport MSTypeEntryField; #endif class MSGUIExport MSMoneyEntryField : public MSTypeEntryField { protected: MSMoney::SymbolType _symbolType; MSMoney::SymbolLocation _symbolLocation; virtual const char *formatOutput(MSString &); void init(); public: MSMoneyEntryField(MSWidget *,const char *label_=0, const MSSymbol& tag_=MSSymbol::nullSymbol()); MSMoneyEntryField(MSWidget *,MSMoney&,const char *label_=0, const MSSymbol& tag_=MSSymbol::nullSymbol()); ~MSMoneyEntryField(void); MSMoneyEntryField& operator=(const MSMoney& money_) {value(money_); return *this;} operator MSMoney&() {return value();} MSMoney::SymbolType symbolType(void) const { return _symbolType;} void symbolType(MSMoney::SymbolType); MSMoney::SymbolLocation symbolLocation(void) const { return _symbolLocation;} void symbolLocation(MSMoney::SymbolLocation); virtual void set(MSAttrValueList&); virtual MSAttrValueList& get(MSAttrValueList&); }; #endif aplus-fsf-4.22/src/MSGUI/MSMonthView.H0000644000265000001440000001122310772770426012775 #ifndef MSMonthViewHEADER #define MSMonthViewHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include class MSGUIExport MSMonthView : public MSPrimitiveText, public MSDoubleClick { public: enum TitleFormat { Month, MonthYear }; MSMonthView(MSWidget *, const char *title_=0); MSMonthView(MSWidget *, const MSDate&); MSMonthView(MSWidget *, MSDate&); ~MSMonthView(void); TitleFormat titleFormat(void) const { return _titleFormat; } void titleFormat(TitleFormat); int margin(void) const { return _margin; } void margin(int); MSBoolean arrowButtons(void) const { return _arrowButtons; } void arrowButtons(MSBoolean); unsigned long arrowColor(void) const; void arrowColor(const char *); void arrowColor(unsigned long); MSBoolean showSelection(void) const { return _showSelection; } void showSelection(MSBoolean); MSBoolean showGrid(void) const { return _showGrid; } void showGrid(MSBoolean); MSDate& viewDate(void) { return (MSDate &)*_model;} const MSDate& viewDate(void) const { return (MSDate &)*_model;} void viewDate(const MSDate&); void model(MSDate&); void model(const MSDate&); MSDate& viewModel(void) { return *((MSDate*)_model); } const MSDate& viewModel(void) const { return *((MSDate*)_model); } operator MSDate&(void) { return (MSDate &)*_model;} MSMonthView& operator=(const MSDate& date_) { viewDate(date_); return *this; } virtual void print(const char *file_=0); virtual void redraw(void); virtual void set(MSAttrValueList&); virtual MSAttrValueList& get(MSAttrValueList&); protected: class MSGUIExport GridLocation { unsigned _row; unsigned _column; public: GridLocation(void) : _row(0),_column(0) {} GridLocation(const GridLocation& aGL_) : _row(aGL_._row),_column(aGL_._column) {} GridLocation(unsigned row_,unsigned column_) : _row(row_),_column(column_) {} GridLocation& operator=(const GridLocation& aGL_) { return _row=aGL_._row,_column=aGL_._column,*this; } unsigned row(void) const {return _row;} unsigned column(void) const {return _column;} void row(unsigned row_) {_row=row_;} void column(unsigned column_) {_column=column_;} }; class MSGUIExport MonthViewArrow : public MSArrowButton { protected: virtual void activate(void); virtual void buttonPress(const XEvent *); MSMonthView * monthView(void) { return (MSMonthView *)owner();} public: MonthViewArrow(MSWidget *, MSArrow::ArrowType); }; friend class MonthViewArrow; protected: int _margin; MSRect _dayRect; unsigned _firstDayOffset; MSBoolean _arrowButtons; MonthViewArrow *_leftArrow; MonthViewArrow *_rightArrow; MSBoolean _showSelection; TitleFormat _titleFormat; MSBoolean _showGrid; void init(void); virtual void computeSize(void); virtual void firstMapNotify(void); virtual void configure(void); virtual void updateTitle(void); virtual void updateBackground(unsigned long); virtual void updateForeground(unsigned long); virtual void updateFont(Font); virtual void updateSensitivity(void); virtual void drawCalendar(void); virtual void drawDayGrid(void); virtual void drawDay(MSDay); virtual void drawTitle(void); virtual void drawDayHeadings(void); virtual void drawSelection(MSBoolean); virtual void drawSeparators(void); virtual void keyPress(const XEvent *,KeySym,unsigned int,const char*); virtual void buttonPress(const XEvent*); virtual void up(void); virtual void down(void); virtual void right(void); virtual void left(void); virtual void pageUp(void); virtual void pageDown(void); virtual void home(void); virtual void end(void); virtual void returnKey(void); virtual void escape(void); virtual void nextMonth(void); virtual void prevMonth(void); virtual void activate(void); virtual void update(const MSIndexVector&); virtual void updateData(void); virtual void dateChanged(void); GridLocation gridLocationFor(MSDay); void selectedDay(MSDay); MSDay selectedDay(void) const { return showSelection() ? viewDate().dayOfMonth() : 0; } int outerMargin(void) const; int idealWidth(void); int idealHeight(void); }; #endif aplus-fsf-4.22/src/MSGUI/MSNotebook.H0000644000265000001440000003215010772770426012637 #ifndef MSNotebookHEADER #define MSNotebookHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include class MSNotebook; class MSGUIExport MSNotebookTabAttribute { protected: unsigned long _fg; unsigned long _bg; Font _font; MSBoolean _sensitive; MSStringVector _label; MSPixmap *_pixmap; MSAlignment _labelAlignment; unsigned long _setFlag; MSBoolean _displayToolTip; MSStringVector _toolTip; MSNotebook *_notebook; public: enum SetFlag {TabBackground=0x1,TabForeground=0x2,TabFont=0x4, TabSensitivity=0x8,TabLabel=0x10,TabPixmap=0x20, TabLabelAlignment=0x40, TabDisplayToolTip=0x80, TabToolTip=0x100}; MSNotebookTabAttribute(MSNotebook *); ~MSNotebookTabAttribute(void); MSNotebook *notebook(void) const {return _notebook;} void label(const MSStringVector &label_) {_label=label_,_setFlag|=TabLabel;} const MSStringVector &label(void) const {return _label;} void pixmap(const MSPixmap &pixmap_); const MSPixmap *pixmap(void) const {return _pixmap;} void labelAlignment(MSAlignment labelAlignment_) {_labelAlignment=labelAlignment_,_setFlag|=TabLabelAlignment;} MSAlignment labelAlignment(void) const {return _labelAlignment;} void foreground(unsigned long fg_) {_fg=fg_,_setFlag|=TabForeground;} unsigned long foreground(void) const {return _fg;} void background(unsigned long bg_) {_bg=bg_,_setFlag|=TabBackground;} unsigned long background(void) const {return _bg;} void font(Font font_) {_font=font_,_setFlag|=TabFont;} Font font(void) const {return _font;} void sensitive(MSBoolean sensitive_) {_sensitive=sensitive_,_setFlag|=TabSensitivity;} MSBoolean sensitive(void) const {return _sensitive;} void displayToolTip(MSBoolean displayTooltip_) {_displayToolTip=displayTooltip_,_setFlag|=TabDisplayToolTip;} MSBoolean displayToolTip(void) const {return _displayToolTip;} void toolTip(const MSStringVector& toolTip_) {_toolTip=toolTip_,_setFlag|=TabToolTip;} const MSStringVector &toolTip(void) const { return _toolTip; } MSBoolean isSet(SetFlag flag_) const { return (_setFlag&flag_)?MSTrue:MSFalse;} void reset(void); }; class MSGUIExport MSNotebook : public MSManager { public: enum Orientation {Vertical=0,Horizontal=1}; MSNotebook(MSWidget *,const char *title_=0); MSNotebook(MSWidget *,const MSStringVector&); ~MSNotebook(void); void pageTitle(MSWidget *child_,const char *title_); // Associate a child with a page title const char *pageTitle(MSWidget *child_) const; // Same as titleFromWidget MSStringVector titles(void) const {return _titleVector;} MSStringVector hiddenTitles(void) const; // Returns all hidden titles const char *titleFromWidget(MSWidget *widget_) const; MSWidget *widgetFromTitle(const char *title_) const; void currentTitle(const char *); const char *currentTitle(void) const; void currentWidget(MSWidget *); MSWidget *currentWidget(void) const; void tabAttribute(MSWidget *child_,const MSNotebookTabAttribute &); MSNotebookTabAttribute tabAttribute(MSWidget *child_) const; void orientation(Orientation); Orientation orientation(void) const {return _orientation;} void tabAlignment(MSAlignment); MSAlignment tabAlignment(void) const {return _tabAlignment;} void tabSpacing(unsigned); unsigned tabSpacing(void) const {return _tabSpacing;} void showBinding(MSBoolean); MSBoolean showBinding(void) const {return _showBinding;} void showTabs(MSBoolean); MSBoolean showTabs(void) const {return _showTabs;} void showPopup(MSBoolean showPopup_) {_showPopup=showPopup_;} MSBoolean showPopup(void) const {return _showPopup;} void installPopup(MSPopupMenu *); void bindingWidth(unsigned); unsigned bindingWidth(void) const {return _bindingWidth;} void frameThickness(unsigned); unsigned frameThickness(void) const {return _frameThickness;} void borderWidth(unsigned); unsigned borderWidth(void) const {return _borderWidth;} void borderHeight(unsigned); unsigned borderHeight(void) const {return _borderHeight;} void marginWidth(unsigned); unsigned marginWidth(void) const {return _marginWidth;} void marginHeight(unsigned); unsigned marginHeight(void) const {return _marginHeight;} void backpages(unsigned); unsigned backpages(void) const {return _backpages;} void backpageThickness(unsigned); unsigned backpageThickness(void) const {return _backpageThickness;} void backpageForeground(unsigned long); void backpageForeground(const char *); unsigned long backpageForeground(void) const {return _backpageForeground;} void backpageBackground(unsigned long); void backpageBackground(const char *); unsigned long backpageBackground(void) const {return _backpageBackground;} void selectedPageForeground(unsigned long); void selectedPageForeground(const char *); unsigned long selectedPageForeground(void) const {return _selectedPageForeground;} void selectedPageBackground(unsigned long); void selectedPageBackground(const char *); unsigned long selectedPageBackground(void) const {return _selectedPageBackground;} void frameBackground(unsigned long); void frameBackground(const char *); unsigned long frameBackground(void) const {return _frameBackground;} void lockSize(MSBoolean lockSize_) {_lockSize=lockSize_;} MSBoolean lockSize(void) const {return _lockSize;} void nextPage(MSBoolean = MSTrue); void previousPage(MSBoolean = MSTrue); virtual void permuteTitles(const MSStringVector &); virtual void permuteWidgets(const MSWidgetVector &); virtual void set(MSAttrValueList& avList_); virtual MSAttrValueList& get(MSAttrValueList& avList_); virtual void naturalSize(void); virtual void redraw(void); virtual void show(void); virtual void unfreeze(void); virtual void print(const char *); virtual MSWidgetVector children(void); protected: class NotebookTab; class NotebookArrow; friend class NotebookTab; friend class NotebookArrow; public: // This class declaration should be protected, but Lucid complains... class NotebookEntry; friend class NotebookEntry; class MSGUIExport NotebookEntry { private: MSWidget *_widget; NotebookTab *_tab; MSBoolean _managed; public: NotebookEntry(MSNotebook *owner_,MSWidget *widget_,const char *title_="Untitled"); ~NotebookEntry(void); MSWidget *widget(void) {return _widget;} const NotebookTab *tab(void) const {return _tab;} NotebookTab *tab(void) {return _tab;} MSBoolean managed(void) {return _managed;} void managed(MSBoolean managed_) {_managed=managed_;} const MSStringVector &title(void) const {return tab()->label();} void title(const char *title_) {tab()->label(MSStringVector(title_));} }; protected: class MSGUIExport NotebookTab : public MSIconButton { protected: unsigned long _modifiedFlag; unsigned long _tabBackground; unsigned long _tabForeground; NotebookEntry *_entry; unsigned long modifiedFlag(void) const {return _modifiedFlag;} virtual void activate(void); virtual void arm(void); virtual void disarm(void); virtual void buttonPress(const XEvent *); virtual void motionNotify(const XEvent *); void blendIn(void); public: NotebookTab(MSWidget *,NotebookEntry *,const char *); ~NotebookTab(void); const NotebookEntry *entry(void) const {return _entry;} NotebookEntry *entry(void) {return _entry;} void tabBackground(unsigned long,MSBoolean modified_=MSTrue); unsigned long tabBackground(void) const {return _tabBackground;} void tabForeground(unsigned long,MSBoolean modified_=MSTrue); unsigned long tabForeground(void) const {return _tabForeground;} void tabFont(Font,MSBoolean modified_=MSTrue); Font tabFont(void) const {return font();} MSBoolean isModified(MSNotebookTabAttribute::SetFlag); virtual void redraw(void); }; class MSGUIExport NotebookArrow : public MSArrowButton { protected: enum Mode {Search,Browse}; Mode _mode; virtual void activate(void); virtual void browse(void); virtual void search(void); virtual void buttonPress(const XEvent *); virtual void button1Press(const XEvent *); public: NotebookArrow(MSWidget *owner_,MSArrow::ArrowType); ~NotebookArrow(void); void mode(Mode mode_) {_mode=mode_;} Mode mode(void) {return _mode;} }; MSBackingStorePixmap *_redrawPixmap; MSBoolean _lockSize; MSBoolean _internalEvent; NotebookEntry *_firstEntry; NotebookEntry *_currentEntry; Orientation _orientation; MSAlignment _tabAlignment; MSBoolean _showBinding; MSBoolean _showTabs; MSBoolean _showPopup; unsigned _bindingWidth; unsigned _frameThickness; unsigned _borderWidth; unsigned _borderHeight; unsigned _marginWidth; unsigned _marginHeight; unsigned long _backpageForeground; unsigned long _backpageBackground; unsigned long _frameBackground; unsigned long _selectedPageForeground; unsigned long _selectedPageBackground; unsigned _backpages; unsigned _backpageThickness; unsigned _tabSpacing; unsigned _arrowOffset; MSLabel *_label; NotebookArrow *_upLeftArrow; NotebookArrow *_downRightArrow; Pixmap _bindingPixmap; GC _notebookGC; GC _bindingGC; GC _backpageGC; MSStringPopupMenu *_popupMenu; MSPopupMenu *_applicationPopup; MSStringVector _titleVector; void init(void); MSBackingStorePixmap *redrawPixmap(void) {return _redrawPixmap;} MSLabel *label(void) {return _label;} const MSLabel *label(void) const {return _label;} NotebookArrow *upLeftArrow(void) {return _upLeftArrow;} NotebookArrow *downRightArrow(void) {return _downRightArrow;} unsigned arrowOffset(void) {return _arrowOffset;} Pixmap bindingPixmap(void) {return _bindingPixmap;} GC notebookGC(void) {return _notebookGC;} GC bindingGC(void) {return _bindingGC;} GC backpageGC(void) {return _backpageGC;} MSStringVector &titleVector(void) {return _titleVector;} void internalEvent(MSBoolean internalEvent_) {_internalEvent=internalEvent_;} MSBoolean internalEvent(void) {return _internalEvent;} NotebookEntry *getEntry(MSWidget *) const; NotebookEntry *getEntry(const char *) const; NotebookEntry *getEntry(unsigned i) const; NotebookEntry *firstItem(void); NotebookEntry *lastItem(void); NotebookEntry *currentEntry(void) const {return _currentEntry;} void currentEntry(NotebookEntry *); NotebookEntry *firstEntry(void) const {return _firstEntry;} void firstEntry(NotebookEntry *); void lastEntry(NotebookEntry *); NotebookEntry *nextEntry(void); NotebookEntry *nextBrowseEntry(MSBoolean cycle_=MSFalse); NotebookEntry *previousEntry(void); NotebookEntry *previousBrowseEntry(MSBoolean cycle_=MSFalse); void resetFirstEntry(void); int numManaged(void); MSWidgetVector managedChildren(void); int visibleTabs(void); int totalTabWidth(void); int maxTabWidth(void); int availableWidthForTabs(void); int totalTabHeight(void); int maxTabHeight(void); int availableHeightForTabs(void); int backpageMargin(void); int arrowWidth(void); int arrowHeight(void); int labelWidth(void); int labelHeight(void); void positionLabel(void); void positionTabs(MSBoolean increment_=MSTrue); void insertChild(MSWidget *); void removeChild(MSWidget *); void drawBackpage(Window); void drawBinding(Window); void drawFrameShadow(Window); void createBindingPixmap(void); void drawSpiral(void); void computeChildSize(int &,int &); int computeMinimumWidth(void); int computeMinimumHeight(void); void menuSelection(void); MSBoolean okToSwitch(void); void pageSelected(NotebookEntry *); virtual MSPopupMenu *popupMenu(void); virtual void pageChanged(void); virtual void configure(void); virtual void adjustSize(void); virtual void computeSize(void); virtual void placement(void); virtual void firstMapNotify(void); virtual void childCreate(MSWidget *); virtual void childDestroy(MSWidget *); virtual void childInsert(MSWidget *); virtual void childRemove(MSWidget *); virtual void childMap(MSWidget *); virtual void childConfigure(MSWidget *); virtual void visibilityObscured(void); virtual void visibilityUnobscured(void); virtual void buttonPress(const XEvent *); virtual void button3Press(const XEvent *); virtual void updateTitle(void); virtual void updateBackground(unsigned long); virtual void updateForeground(unsigned long); virtual void updateFont(Font); virtual void updateTitleVector(void); virtual void updatePopupMenu(void); }; #endif aplus-fsf-4.22/src/MSGUI/MSNumericArrayView.H0000644000265000001440000000202010772770427014305 #ifndef MSNumericArrayViewHEADER #define MSNumericArrayViewHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSString; class MSGUIExport MSNumericArrayView : public MSArrayView { public: MSNumericArrayView(MSWidget *,const char *title_=0); MSNumericArrayView(MSWidget *,const MSStringVector&); ~MSNumericArrayView(void); const MSFormat& format(void) const; void format(const MSFormat&); const char *formatValue(MSString &,double); const char *formatValue(MSString &,int); protected: virtual void updateFormat(void); MSClipMode columnClipMode(unsigned) const; private: MSFormat _format; }; inline const MSFormat& MSNumericArrayView::format(void) const { return _format; } #endif aplus-fsf-4.22/src/MSGUI/MSOptionMenu.H0000644000265000001440000001223310772770427013155 #ifndef MSOptionMenuHEADER #define MSOptionMenuHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include class MSOptionMenu; class MSGUIExport MSOptionPopupMenu : public MSPopupMenu { friend class MSOptionMenu; public: MSOptionPopupMenu(MSOptionMenu *); MSOptionPopupMenu(MSOptionMenu *,MSStringVector&); void model(MSStringVector&); void options(const MSStringVector&); virtual void popup(MSBoolean,unsigned long); virtual void activate(void); protected: virtual void motionNotify(const XEvent *); virtual void buttonRelease(const XEvent *); virtual void buttonPress(const XEvent *); virtual void updateData(void); virtual void update(const MSIndexVector&); int menuItemXOffset(int); int menuItemYOffset(int); private: MSOptionMenu *_optionMenu; unsigned long _lastShowTime; unsigned long _threshold; MSOptionMenu *optionMenu(void) const {return _optionMenu;} MSStringVector& optionsModel(void) const {return (MSStringVector&)*_model;} unsigned long lastShowTime(void) const { return _lastShowTime; } void lastShowTime(unsigned long lastShowTime_) { _lastShowTime=lastShowTime_; } unsigned long threshold(void) const { return _threshold; } void threshold(unsigned long threshold_) { _threshold=threshold_; } void init(void); void rebuildMenu(void); }; class MSGUIExport MSOptionMenu : public MSCompositeField { friend class MSOptionPopupMenu; public: MSOptionMenu(MSWidget *,const char *label_=0); MSOptionMenu(MSWidget *,const char *label_,MSStringVector& optionsModel_); MSOptionMenu(MSWidget *,MSStringVector& optionsModel_,const char *label_); MSOptionMenu(MSWidget *,MSString& model_,MSStringVector& optionsModel_,const char *label_); ~MSOptionMenu(void); int selectedItem(void) const; void selectedItem(int); virtual void options(const MSStringVector&); void optionsModel(MSStringVector&); MSStringVector& optionsModel(void); const MSStringVector& optionsModel(void) const; void model(MSStringVector &model_); //optionsModel void model(MSString &model_); MSString& viewModel(void); const MSString& viewModel(void) const; unsigned columns(void) const; void columns(unsigned); virtual MSAttrValueList& get(MSAttrValueList&); virtual void set(MSAttrValueList&); protected: MSOptionPopupMenu *_optionMenu; int _selectedItem; unsigned _columns; MSBoolean _internalEvent; MSOptionPopupMenu *optionMenu(void); const MSOptionPopupMenu *optionMenu(void) const; void init(void); virtual void showMenu(unsigned long); virtual void placement(void); virtual void drawFieldValue(void); virtual void drawFieldValue(unsigned long,unsigned long); virtual void updateData(void); virtual void update(const MSIndexVector&); virtual void updateFont(Font); virtual void updateBackground(unsigned long); virtual void updateForeground(unsigned long); virtual void updateSensitivity(void); virtual void activate(int); virtual void activate(void); virtual void escape(void); virtual MSBoolean loseFocus(void); virtual void keyPress(const XEvent *,KeySym,unsigned int,const char *); virtual void buttonPress(const XEvent *); virtual void buttonRelease(const XEvent *); virtual void motionNotify(const XEvent *); // The following virtual methods can be overriden by subclassers to // obtain model specific behavior: // numberOfItems - number of options in the model // itemLabel - return the label for the nth item // itemForeground - return the foreground for the nth item // formatOuput - format the selectedItem for the entry part of the display // maxValueWidth - return the max pixel width over all item labels in the option Menu virtual const char *formatOutput(MSString &); virtual const char *itemLabel(unsigned); virtual unsigned long itemForeground(unsigned); virtual unsigned maxValueWidth(void); virtual unsigned numberOfItems(void) const; virtual unsigned computeValuePixelWidth(void); void setSelectedItem(int); }; inline MSOptionPopupMenu *MSOptionMenu::optionMenu(void) { return _optionMenu; } inline const MSOptionPopupMenu *MSOptionMenu::optionMenu(void) const { return _optionMenu; } inline MSStringVector& MSOptionMenu::optionsModel(void) { return optionMenu()->optionsModel(); } inline const MSStringVector& MSOptionMenu::optionsModel(void) const { return optionMenu()->optionsModel(); } inline void MSOptionMenu::model(MSStringVector &model_) { optionsModel(model_); } inline int MSOptionMenu::selectedItem(void) const { return _selectedItem; } inline unsigned MSOptionMenu::columns(void) const { return _columns; } inline MSString& MSOptionMenu::viewModel(void) { return (MSString&)*_model; } inline const MSString& MSOptionMenu::viewModel(void) const { return (const MSString&)*_model; } #endif aplus-fsf-4.22/src/MSGUI/MSP.H0000644000265000001440000000266310772770427011265 #ifndef MSPHEADER #define MSPHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// class MSP { public: MSP(void) {} ~MSP(void) {} enum {buflen=128}; enum DisclaimerStyle {Text=41,Rule=43,Toprule=44,AppendBox=45,Append=46,Box=64,NoDisclaimer=1}; enum PageSize {Letter=1,Legal=2,A4=3,B5=4,A=5,B=6}; enum PageOrientation {Portrait=7,Landscape=8,UpsideDown=14,Seascape=15,Default=1}; enum PrintMode {Mono=10,Color=11,Colorfg=12,Reverse=13}; enum OutputMode {PS=27,EPS=28,PPM=29,ASCII=30}; enum OutputStyle {ColMajor=2,RowMajor=4,Aligned=8,NoHeadings=16,Stacked=32,Quoted=64}; enum BreakProcessMode {Total=2,Minimum=4,Maximum=8,Average=16}; enum Occurrence {EveryPage=1,OddPage=2,EvenPage=4,FirstPage=8,LastPage=16,AnyButFirstAndLast=32, IfNextPage=64}; enum BannerStyle {Diagonal=128,Repetitive=256}; enum Style {Underline=128,DUnderline=256,Superscript=512,Subscript=1024,Outline=2048, Smallcap=4096,Strikethru=8192,BoxL=16384,BoxR=32768,BoxT=65536,BoxB=131072, Cell=262144,Stipple=524288,CharOnly=1048576,PosAbove=2097152,PosBelow=4194304}; }; #endif aplus-fsf-4.22/src/MSGUI/MSPage.H0000644000265000001440000001750010772770427011736 #ifndef MSPageHEADER #define MSPageHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include class MSGUIExport ColorCell { protected: int _id; unsigned long _fg; unsigned long _bg; public: ColorCell(int id_,unsigned long fg_,unsigned long bg_) { _id=id_,_fg=fg_,_bg=bg_; } ~ColorCell(void) {} int id(void) const { return _id; } unsigned long fg(void) const { return _fg; } unsigned long bg(void) const { return _bg; } void fg(unsigned long fg_) { _fg=fg_; } void bg(unsigned long bg_) { _bg=bg_; } }; class MSPage; class MSGUIExport MSPageBlinkTimer : public MSIntervalTimer { private: MSPage *_page; MSPage *page(void) { return _page; } public: MSPageBlinkTimer(MSPage *page_,unsigned long interval_); virtual void process(void); }; class MSGUIExport RubberBand { public: int _x; int _y; int _xs; int _ys; RubberBand(void) { configure(0,0,0,0); } RubberBand(int x_,int y_,int xs_,int ys_) { configure(x_,y_,xs_,ys_); } void configure(int x_,int y_,int xs_,int ys_) { _x=x_,_y=y_,_xs=xs_,_ys=ys_; } int x(void) const { return _x; } int y(void) const { return _y; } int xs(void) const { return _xs; } int ys(void) const { return _ys; } }; class MSGUIExport MSPage : public MSCompositeText { friend class MSPageBlinkTimer; public: enum BlinkPhase{Normal,Reverse}; protected: int _x_cursor; int _y_cursor; int _margin; int _lineWidth; MSNodeItem _colorListHead; MSNodeItem _boxListHead; MSPageBlinkTimer *_blinkTimer; BlinkPhase _blinkPhase; unsigned long _blinkRate; Font _boldFontID; MSIntMatrix _colorMatrix; MSBinaryMatrix _boldMatrix; MSBinaryMatrix _underlineMatrix; MSBinaryMatrix _blinkMatrix; MSBinaryMatrix _currentBlinkMatrix; MSIntMatrix _boxMatrix; MSIntMatrix _lineMatrix; MSIntVector _boxColors; RubberBand _rubberBandRect; MSNodeItem *colorListHead(void) { return &_colorListHead; } MSNodeItem *boxListHead(void) { return &_boxListHead; } const MSNodeItem *colorListHead(void) const { return &_colorListHead; } const MSNodeItem *boxListHead(void) const { return &_boxListHead; } MSPageBlinkTimer *blinkTimer(void) const { return _blinkTimer; } BlinkPhase blinkPhase(void) const { return _blinkPhase; } Font boldFontID(void) const { return _boldFontID; } RubberBand& rubberBandRect(void) { return _rubberBandRect; } const RubberBand& rubberBandRect(void) const { return _rubberBandRect; } const MSIntVector& boxColors(void) const { return _boxColors; } const MSIntMatrix& boxMatrix(void) const { return _boxMatrix; } const MSIntMatrix& lineMatrix(void) const { return _lineMatrix; } MSIntMatrix& colorMatrix(void) { return _colorMatrix; } MSBinaryMatrix& boldMatrix(void) { return _boldMatrix; } MSBinaryMatrix& underlineMatrix(void) { return _underlineMatrix; } MSBinaryMatrix& blinkMatrix(void) { return _blinkMatrix; } MSBinaryMatrix& currentBlinkMatrix(void) { return _currentBlinkMatrix; } int x_cursor(void) const { return _x_cursor; } int y_cursor(void) const { return _y_cursor; } unsigned long boxColor(int row_) const { return (row_ #include #include class MSPane; class MSGUIExport MSSash : public MSWidgetCommon { protected: MSDisplayCursor *_crossCursor; MSGC _drawGC; int _row; int _column; int _min; int _max; GC gc(void) const; virtual void redraw(void); virtual void drawSash(void); virtual void drawSeparator(void); virtual void size(int); virtual void moveSash(int); virtual void buttonPress(const XEvent *); virtual void updateBackground(unsigned long); public: MSSash(MSPane *); ~MSSash(void); int row(void) const {return _row;} int column(void) const {return _column;} int min(void) const {return _min;} int max(void) const {return _max;} void row(int row_) {_row=row_;} void column(int col_) {_column=col_;} void min(int min_) {_min=min_;} void max(int max_) {_max=max_;} }; class MSGUIExport MSVSash : public MSSash { protected: virtual void drawSash(void); virtual void drawSeparator(void); virtual void size(int size_); virtual void moveSash(int delta_); virtual void button1Press(const XEvent *); public: MSVSash(MSPane *); ~MSVSash(void); }; class MSGUIExport MSHSash : public MSSash { protected: virtual void drawSash(void); virtual void drawSeparator(void); virtual void size(int size_); virtual void moveSash(int delta_); virtual void button1Press(const XEvent *); public: MSHSash(MSPane *); ~MSHSash(void); }; class MSGUIExport MSPane : public MSLayout { friend class MSSash; friend class MSHSash; friend class MSVSash; public: MSPane(MSWidget *,const char *title_=0); MSPane(MSWidget *,const MSStringVector&); ~MSPane(void); MSBoolean ignoreResizeConstraints(void) const { return _ignoreResizeConstraints; } void ignoreResizeConstraints(MSBoolean); virtual MSAttrValueList& get(MSAttrValueList& avList_); virtual void set(MSAttrValueList& avList_); protected: MSWidgetVector _sashList; MSBoolean _sashAction; // true when a sash action is under way-create,map etc.. MSBoolean _ignoreResizeConstraints; MSWidgetVector& sashList(void) {return _sashList;} const MSWidgetVector& sashList(void) const {return _sashList;} MSBoolean sashAction(void) const {return _sashAction;} void sashAction(MSBoolean action_) { _sashAction=action_; } void init(void); void removeSash(int row_,int col_); MSSash *sash(int row_,int col_); int numSashes(void); virtual void removeAllSashes(void); virtual void removeExtraSashes(void); virtual void placeSashes(void); void adjustRowHeight(int row_,int height_); void adjustColumnWidth(int col_,int width_); virtual void placement(void); virtual At childPosition(MSWidget *); virtual void childPosition(MSWidget *,const At&); virtual void childResizeConstraints(MSWidget *); virtual void childConfigure(MSWidget *); virtual void childMap(MSWidget *); virtual void childUnmap(MSWidget *); virtual void childCreate(MSWidget *); virtual void childDestroy(MSWidget *); virtual void updateBackground(unsigned long); virtual void updateOrientation(void); }; #endif aplus-fsf-4.22/src/MSGUI/MSParagraph.H0000644000265000001440000001575410772770427013000 #ifndef MSParagraphHEADER #define MSParagraphHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include class MSParagraph; typedef class MSParagraph MSPrintText; class MSReport; class MSPostScript; class MSReportTable; class MSGUIExport MSParagraph : public MSPrintItem { friend class MSReport; friend class MSReportTable; //hack that should removed with redesign. public: MSParagraph(const MSStringVector&,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSParagraph(const MSStringVector&,int row_,int col_,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSParagraph(const MSStringVector&,const char *font_,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSParagraph(const MSStringVector&,int row_,int col_,const char *font_,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSParagraph(const MSParagraph&); MSParagraph(void); ~MSParagraph(void); MSParagraph& operator=(const MSParagraph&); void operator=(const MSStringVector&); void operator=(const MSString&); void operator=(const char *); operator const MSStringVector&() const; virtual int computePrintSize(MSReport*,int,int,int,int,int,int); virtual int print(MSReport*,int,int,int,int,int,int); MSParagraph& firstLineIndent(double); MSParagraph& leftMargin(double); MSParagraph& rightMargin(double); MSParagraph& text(const MSStringVector&); MSParagraph& tag(const MSSymbol&); MSParagraph& justification(MSAlignment); MSParagraph& justification(unsigned long); MSParagraph& leading(unsigned); MSParagraph& topPixel(unsigned); MSParagraph& bottomPixel(unsigned); MSParagraph& lineWidth(unsigned); MSParagraph& printRow(int); MSParagraph& printColumn(int); MSParagraph& fgGrayScale(double); MSParagraph& bgGrayScale(double); MSParagraph& font(const char *); MSParagraph& style(unsigned long); MSParagraph& xOrigin(double); MSParagraph& yOrigin(double); MSParagraph& topOffset(double); MSParagraph& bottomOffset(double); MSParagraph& foreground(const char* ); MSParagraph& background(const char *); MSParagraph& fontSize(unsigned); MSParagraph& fontScale(double); MSParagraph& fontID(Font); MSParagraph& firstColumn(unsigned); MSParagraph& columnSpan(unsigned); MSParagraph& occurrence(unsigned long); MSParagraph& occurrence(Occurrence); MSParagraph& pageAlignment(MSAlignment); MSParagraph& pageAlignment(unsigned long); MSParagraph& orphanRows(unsigned); MSParagraph& widowRows(unsigned); //obsolete. left for backward compatibility MSParagraph& row(int); MSParagraph& column(int); int row(void) const {return MSPrintItem::printRow();} int column(void) const {return MSPrintItem::printColumn();} const MSStringVector& text(void) const {return _text;} const MSString& fontName(void) const {return printFont();} const MSString& foreground(void) const {return _foreground;} const MSString& background(void) const {return _background;} const MSSymbol& tag(void) const {return _tag;} unsigned long style(void) const {return _style|justification();} unsigned widowRows(void) const {return _widowRows;} unsigned orphanRows(void) const {return _orphanRows;} int fontSize(void) const {return _fontSize;} int leading(void) const {return _leading;} double fontScale(void) const {return _fontScale;} double fgGrayScale(void) const {return _fgGrayScale;} double bgGrayScale(void) const {return _bgGrayScale;} int xPixel(void) const {return _xPixel;} int yPixel(void) const {return _yPixel;} int lineWidth(void) const {return _lineWidth;} int topPixel(void) const {return MSPrintItem::topPixel();} int bottomPixel(void) const {return MSPrintItem::bottomPixel();} int printRow(void) const {return MSPrintItem::printRow();} int printColumn(void) const {return MSPrintItem::printColumn();} unsigned long occurrence(void) const {return MSPrintItem::occurrence();} unsigned long justification(void) const {return MSPrintItem::justification();} unsigned long pageAlignment(void) const {return MSPrintItem::pageAlignment();} int columnSpan(void) const {return _columnSpan;} Font fontID(void) {return _fontID;} virtual int height(void) const; double xOrigin(void) const; double yOrigin(void) const; double topOffset(void) const; double bottomOffset(void) const; double firstLineIndent(void) const; double leftMargin(void) const; double rightMargin(void) const; protected: int firstLineIndentPixel(void) const {return _firstLineIndentPixel;} int lastLineWidth(void) const {return _lastLineWidth;} int textLineWidth(void) const {return _textLineWidth;} const MSStringVector& outputText(void) const {return _outputText;} MSStringVector& outputText(void) {return _outputText;} MSFloatVector& wordSpacing(void) {return _wordSpacing;} void firstLineIndentPixel(int x_) {_firstLineIndentPixel=x_;} void lastLineWidth(int x_) {_lastLineWidth=x_;} void textLineWidth(int x_) {_textLineWidth=x_;} virtual const MSSymbol& printTag(void) const; void computeParagraphSize(MSReport*); void printParagraph(MSReport*,int,int,int); void printParagraphDecorations(MSReport*,int,int,int,int,int); double dissectWord(MSReport*,MSString&,int,double); MSString wordToNext(const MSString&,unsigned) const; void init(void); private: MSFloatVector _wordSpacing; MSStringVector _outputText; MSStringVector _text; MSSymbol _tag; MSString _foreground; MSString _background; unsigned long _style; unsigned _widowRows; unsigned _orphanRows; Font _fontID; int _fontSize; int _leading; int _firstLineIndentPixel; int _lastLineWidth; int _textLineWidth; int _xPixel; int _yPixel; int _lineWidth; double _fontScale; double _fgGrayScale; double _bgGrayScale; int _columnSpan; }; #endif aplus-fsf-4.22/src/MSGUI/MSPixmap.H0000644000265000001440000001241010772770427012313 #ifndef MSPixmapHEADER #define MSPixmapHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #ifndef MSDefinesHEADER #include #endif #ifndef MSWidgetHEADER #include #endif #ifdef MS_MULTI_THREAD #include #endif // Predefined Pixmap names defined in MSBitmaps.H class MSHashTable; class MSPixmapData; class MSGUIExport MSPixmap { public: static const char *SolidBackgroundPixmap; static const char *ForegroundTwentyFivePixmap; static const char *ForegroundFiftyPixmap; static const char *ForegroundSeventyFivePixmap; static const char *VerticalPixmap; static const char *HorizontalPixmap; static const char *SlantRightPixmap; static const char *SlantLeftPixmap; static const char *MenuCascadePixmap; static const char *MenuCheckmarkPixmap; static const char *MenuDashPixmap; static const char *MagnifyingGlassPixmap; static const char *MagnifyingGlassMaskPixmap; static const char *HourGlassPixmap; static const char *HourGlassMaskPixmap; public: // Construct a pixmap from an array of characters MSPixmap(MSDisplayServer*,const char *pName_,const char *bitArray_,int w_,int h_); MSPixmap(MSDisplayServer*,const char *pName_,const char *bitArray_,int w_,int h_, unsigned long fg_,unsigned long bg_); MSPixmap(MSDisplayServer*,const char *pName_,const char *bitArray_,int w_,int h_, const char *fg_,const char *bg_); // Construct a pixmap from an X11 bitmap file MSPixmap(MSDisplayServer*,const char *name,const char *bitmapFile_); MSPixmap(MSDisplayServer*,const char *name,const char *bitmapFile_, unsigned long fg_,unsigned long bg_); MSPixmap(MSDisplayServer*,const char *name,const char *bitmapFile_, const char *fg_,const char *bg_); // Construct a predefined pixmap of specified foreground & background MSPixmap(MSDisplayServer *,const char *pName_); MSPixmap(MSDisplayServer *,const char *pName_,unsigned long fg_,unsigned long bg_); MSPixmap(MSDisplayServer *,const char *pName_,const char *fg_,const char *bg_); // Construct a predefined pixmap of specified foreground, background, & depth MSPixmap(MSDisplayServer *,const char *pName_,unsigned long fg_,unsigned long bg_,int depth_); // Construct a pixmap of geometry w by h and foreground & background MSPixmap(MSDisplayServer *,const char *pName_,int w_,int h_,unsigned long fg_,unsigned long bg_); MSPixmap(MSDisplayServer *,const char *pName_,int w_,int h_,const char *fg_,const char *bg_); // Copy Constructor MSPixmap(const MSPixmap&); ~MSPixmap(void); MSPixmap& operator=(const MSPixmap&); // Default constructor is public only for use in containers. // Should not be used directly. MSPixmap(void); MSDisplayServer *server(void); const MSDisplayServer *server(void) const; int width(void) const; int height(void) const; int depth(void) const; unsigned long foreground(void) const; unsigned long background(void) const; Pixmap pixmap(void) const; Pixmap clipMask(void) const; const MSString &name(void) const {return _name;} protected: static MSHashTable *_pPixmapHashTable; MSPixmapData *_pData; MSString _name; void init(void); void create(MSDisplayServer *,const char *pName_,Pixmap pixmap_, int w_,int h_,int depth_,unsigned long fg_,unsigned long bg_); void create(MSDisplayServer *,const char *pName_,Pixmap pixmap_,Pixmap clipMask_, int w_,int h_,int depth_,unsigned long fg_,unsigned long bg_); void create(MSDisplayServer *,const char *pName_,const char *bitmap_,int w_,int h_); void create(MSDisplayServer *,const char *pName_,const char *bitmapFile_); void create(MSDisplayServer *,const char *pName_); void create(MSDisplayServer *,const char *pName_,int w_,int h_,unsigned long fg_,unsigned long bg_); void create(MSDisplayServer *,const char *pName_,unsigned long fg_,unsigned long bg_); void create(MSDisplayServer *,const char *pName_,unsigned long fg_,unsigned long bg_,int depth_); void create(MSDisplayServer *,const char *pName_,const char *bitmap_,int w_,int h_,unsigned long fg_,unsigned long bg_); void create(MSDisplayServer *,const char *pName_,const char *bitmapFile_,unsigned long fg_,unsigned long bg_); const char *dataName(void) const; void addReference(void); void removeReference(void); void *pixmapDataWithKey(const char *); void copyPixmapData(void *); void addToHashTable(const char *,void *); MSBoolean copyPixmapDataWithKey(const char *); #ifdef MS_MULTI_THREAD protected: static MSMutex _hashTableMutex; #endif }; // Following functions make it possible to use MSPixmap as an element in MSGenericVector // compare function needed for MSGenericVector inline long compare(const MSPixmap&, const MSPixmap&) { return 0; } #if defined(_AIX) && defined(__xlC__) // xlC will instantiate ostream function from MSGenericVector even if it's not used. // This requires to provide dummy << operator for element of MSGenericVector. inline ostream& operator<<(ostream& aStream_,const MSPixmap&) { return aStream_; } #endif #endif aplus-fsf-4.22/src/MSGUI/MSPointerArray.H0000644000265000001440000000312610772770427013500 #ifndef MSPointerArrayHEADER #define MSPointerArrayHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #ifndef MSDefinesHEADER #include #endif #if defined(MS_NEED_IMPLEMENTATION_PRAGMA) #pragma implementation("MSPointerArray.C") #endif template class MSPointerArray { private: Type **_array; unsigned _size; unsigned _count; MSBoolean _frozen; protected: void reserve(unsigned); int size(void) const {return _size;} MSBoolean frozen(void) const {return _frozen;} public: MSPointerArray(void); ~MSPointerArray(void); inline int count(void) const; inline Type *array(unsigned) const; inline Type *array(unsigned); void freeze(void) {_frozen=MSTrue;} void unfreeze(void) {_frozen=MSFalse;} MSBoolean assign(Type *,unsigned); MSBoolean find(Type *); MSBoolean add(Type *); MSBoolean remove(Type *); MSBoolean removeAll(void); MSBoolean insert(Type *,unsigned); MSBoolean exchange(unsigned,unsigned); }; template inline int MSPointerArray::count(void) const {return _count;} template inline Type *MSPointerArray::array(unsigned i_) const {return (i_ inline Type *MSPointerArray::array(unsigned i_) {return (i_ class MSGUIExport MSPopup : public MSShell { public: MSPopup(const char *windowTitle_=0); MSPopup(MSDisplayServer *,const char *windowTitle_=0); MSPopup(MSShell *,const char *windowTitle_=0); ~MSPopup(void); MSBoolean pushPinState(void) const; void pinIn(void); void pinOut(void); void transientFor(MSShell *); void modal(MSBoolean); MSBoolean modal(void) const; virtual void map(void); virtual void unmap(void); virtual void set(MSAttrValueList&); virtual MSAttrValueList& get(MSAttrValueList&); private: MSBoolean _pushPinState; MSBoolean _modal; void init(void); void pushPinState(MSBoolean); virtual void setWinAttr(void); virtual void dismiss(void); virtual void clientMessage(const XEvent *event_); virtual void propertyNotify(const XEvent *event_); }; inline MSBoolean MSPopup::pushPinState(void) const { return _pushPinState; } inline void MSPopup::pushPinState(MSBoolean s_) { _pushPinState=s_; } inline MSBoolean MSPopup::modal(void) const { return _modal; } #endif aplus-fsf-4.22/src/MSGUI/MSPopupMenu.H0000644000265000001440000000104610772770427013010 #ifndef MSPopupMenuHEADER #define MSPopupMenuHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSGUIExport MSPopupMenu : public MSMenu { public: MSPopupMenu(MSDisplayServer *); ~MSPopupMenu(void); virtual void show(void); virtual void showAtPointer(void); }; #endif aplus-fsf-4.22/src/MSGUI/MSPostScript.H0000644000265000001440000002267610772770427013206 #ifndef MSPostScriptHEADER #define MSPostScriptHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #if HAVE_FSTREAM #include #else #include #endif #include #include #include #include #include class MSPrintFontData; class MSGUIExport MSPrintFontHashTable:public MSHashTable { public: MSPrintFontHashTable(void):MSHashTable() {} MSPrintFontHashTable(int size_):MSHashTable(size_) {} ~MSPrintFontHashTable(void); }; class MSGUIExport MSPostScript:public MSPrintFont,public MSP { //friend class MSDisplayPrint; friend class MSPrintDisclaimer; public: MSPostScript(void); ~MSPostScript(void); virtual MSBoolean printOpen(void); virtual MSBoolean printClose(void); MSPrintDisclaimer& disclaimer(void) const {return *_disclaimer;} int x_org(void) const {return _x_org;} int y_org(void) const {return _y_org;} PageOrientation pageOrientation(void) const {return _pageOrientation;} PageSize pageSize(void) const {return _pageSize;} PrintMode printMode(void) const {return _printMode;} unsigned long pageLayout(void) const {return _pageLayout;} OutputMode outputMode(void) const {return _outputMode;} int defaultFontSize(void) const {return _defaultFontSize;} const MSString& defaultFontString(void) const {return _defaultFontString;} const MSString& defaultFontName(void) const {return _defaultFontName;} const MSString& fileName(void) const {return _fileName;} const MSString& fontPath(void) const {return _fontPath;} const MSString& fontFileName(void) const {return _fontFileName;} Font fontID(void) const {return _fontID;} unsigned leftPixel(void) const {return _leftPixel;} unsigned rightPixel(void) const {return _rightPixel;} unsigned topPixel(void) const {return _topPixel;} unsigned bottomPixel(void) const {return _bottomPixel;} int pages(void) const {return _pages;} int fontSize(void) const {return _fontSize;} XGCValues& gcValues(void) {return _gcValues;} // The fileName, with the suffix corrected for outputMode MSString adjustedFileName(void) const; void x_org(int x_) {_x_org=x_;} void y_org(int x_) {_y_org=x_;} void pageOrientation(PageOrientation x_) {_pageOrientation=x_;} void pageSize(PageSize x_) {_pageSize=x_;} void printMode(PrintMode x_) {_printMode=x_;} void pageLayout(unsigned long x_) {_pageLayout=x_;} void outputMode(OutputMode x_) {_outputMode=x_;} void defaultFontSize(int x_) {_defaultFontSize=x_;} void fileName(const char *x_) {_fileName=x_;} void fontID(Font x_) {_fontID=x_;} void fontSize(int x_) {_fontSize=x_;} void pages(int x_) {_pages=x_;} Font font(const char *); const char *fontName(Font); void fontPath(const char *); void defaultFontString(const char *); void defaultFontName(const char *); void leftMargin(double); void rightMargin(double); void topMargin(double); void bottomMargin(double); double leftMargin(void) const; double rightMargin(void) const; double topMargin(void) const; double bottomMargin(void) const; ofstream pout; void setAttributes(void); MSPrintFontData *fontStruct(Font); Font printFontID(const char *); const MSPrintFontData *fontdata(Font); virtual void printLine(double,double,double,double); protected: enum DrawMode {Stroke=0,Fill=1}; void initFont(void); void initPS(void); void addFont(const char *); MSBoolean findFont(const char *); MSPrintFontHashTable& fontDataHashTable(void) {return _fontDataHashTable;} MSHashTable& printFontIDHashTable(void) {return _printFontIDHashTable;} MSStringVector& documentFonts(void) {return _documentFonts;} XColor& fgRGB(void) {return _fgRGB;} XColor& bgRGB(void) {return _bgRGB;} int lineWidth(void) {return _lineWidth;} int lineStyle(void) {return _lineStyle;} int dashOffset(void) {return _dashOffset;} int capStyle(void) {return _capStyle;} int joinStyle(void) {return _joinStyle;} int fillStyle(void) {return _fillStyle;} int fillRule(void) {return _fillRule;} int arcMode(void) {return _arcMode;} unsigned long fgColor(void) {return _foreground;} unsigned long bgColor(void) {return _background;} double gscale(void) {return _gscale;} int bwidth(void) {return _bwidth;} int bheight(void) {return _bheight;} int x_translate(void) {return _x_translate;} int y_translate(void) {return _y_translate;} double x_printScale(void) {return _x_printScale;} double y_printScale(void) {return _y_printScale;} int fontCount(void) {return _fontCount;} const MSString& fontString(void) const {return _fontString;} const MSString& path(void) const {return _path;} void lineWidth(int x_) {_lineWidth=x_;} void lineStyle(int x_) {_lineStyle=x_;} void dashOffset(int x_) {_dashOffset=x_;} void capStyle(int x_) {_capStyle=x_;} void joinStyle(int x_) {_joinStyle=x_;} void fillStyle(int x_) {_fillStyle=x_;} void fillRule(int x_) {_fillRule=x_;} void arcMode(int x_) {_arcMode=x_;} void fgColor(unsigned long x_) {_foreground=x_;} void bgColor(unsigned long x_) {_background=x_;} void gscale(double x_) {_gscale=x_;} void bwidth(int x_) {_bwidth=x_;} void bheight(int x_) {_bheight=x_;} void x_translate(int x_) {_x_translate=x_;} void y_translate(int x_) {_y_translate=x_;} void x_printScale(double x_) {_x_printScale=x_;} void y_printScale(double x_) {_y_printScale=x_;} void fontCount(int x_) {_fontCount=x_;} void fontString(const char *x_) {_fontString=x_;} void fontFileName(const char *x_) {_fontFileName=x_;} static unsigned long blackPixel(void) {return _blackPixel;} static unsigned long whitePixel(void) {return _whitePixel;} static void blackPixel(unsigned long x_) {_blackPixel=x_;} static void whitePixel(unsigned long x_) {_whitePixel=x_;} void init(void); MSBoolean setForeground(void); void setBackground(int mode_=0); MSBoolean setBGColor(void); MSBoolean setFGColor(int mode_=0); MSBoolean setLineAttributes(void); void setFontAttributes(void); void setFillStyle(void); void setFillRule(void); void setArcMode(void); int extractFontSize(const char *); const char *extractFontString(const char*); const char *formatFontString(const char*); virtual void printProlog(void); virtual void printEpilog(void); virtual void printSetup(void); virtual void printArc(int,int,int,int,int,int,int,DrawMode); virtual void printRectangle(double,double,double,double); virtual void printString(int,int,const char *,int); virtual void setClipRectangle(int,int,int,int); virtual void updateForeground(int mode_=0); virtual void updateBackground(void); virtual void updateFont(void); int _pages; private: int _fontSize; int _defaultFontSize; int _fontCount; Font _fontID; MSStringVector _documentFonts; MSString _fileName; MSString _defaultFontString; MSString _defaultFontName; MSString _fontName; MSString _fontString; MSString _fontFileName; MSString _fontPath; MSString _path; PageOrientation _pageOrientation; PageSize _pageSize; PrintMode _printMode; unsigned long _pageLayout; OutputMode _outputMode; int _x_org; int _y_org; int _bwidth; int _bheight; int _x_translate; int _y_translate; double _x_printScale; double _y_printScale; double _fontScale; double _gscale; int _leftPixel; int _rightPixel; int _topPixel; int _bottomPixel; XGCValues _gcValues; XColor _fgRGB; XColor _bgRGB; int _lineWidth; int _lineStyle; int _dashOffset; int _capStyle; int _joinStyle; int _fillStyle; int _fillRule; int _arcMode; unsigned long _foreground; unsigned long _background; static unsigned long _blackPixel; static unsigned long _whitePixel; MSPrintDisclaimer *_disclaimer; MSHashTable _printFontIDHashTable; MSPrintFontHashTable _fontDataHashTable; }; #endif aplus-fsf-4.22/src/MSGUI/MSPostScriptView.H0000644000265000001440000001442210772770427014027 #ifndef MSPostScriptViewHEADER #define MSPostScriptViewHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include class MSPostScriptViewInChannel; class MSPostScriptViewOutChannel; class MSPostScriptViewDocument; class MSGUIExport MSPostScriptView: public MSWidgetCommon, public MSP { public: enum ErrorCode { NoError = 0, BadFile = 1, InvalidPostScript=2, NOGS=3 }; static MSSymbol ghostscriptexecerror; static MSSymbol ghostscriptwriteerror; static MSSymbol ghostscriptfileerror; static MSSymbol ghostscriptmessage; MSPostScriptView(MSWidget *); ~MSPostScriptView(); ErrorCode loadFile(const MSString& file_, int firstPage_ = 0); void unloadFile(void); void reload(void); void reloadPage(void); MSBoolean isFileLoaded(void) const; MSBoolean isBusy(void) const { return _busy; } MSBoolean isRunning(void) const { return (_pid==-1)?MSFalse:MSTrue; } MSBoolean isReady(void) const { return (_pid!=-1&&_busy==MSFalse)?MSTrue:MSFalse;} MSBoolean showBusyCursor(void) const { return _showBusyCursor; } void showBusyCursor(MSBoolean sbc_); PageOrientation pageOrientation(void) const { return _orientation; } void pageOrientation(PageOrientation); double zoomFactor(void) const { return _zoomFactor; } void zoomFactor(double); PageSize pageSize(void) const { return _pageSize; } void pageSize(PageSize ); void scrollbarBackground(const char *); void scrollbarBackground(unsigned long); unsigned long scrollbarBackground(void) const; void scrollInc(int); int scrollInc(void) const { return _hsb->inc(); } int pageCount(void) const; int currentPage(void) const { return _currentPage; } void currentPage(int); void nextPage(void); void prevPage(void); void firstPage(void); void lastPage(void); int pageWidth(void) const; int pageHeight(void) const; int pointPageWidth(void) const; int pointPageHeight(void) const; virtual void naturalSize(void); virtual void redraw(void); void redrawImmediately(void); ErrorCode printToFile(const MSString& fileName, const MSIndexVector& pageIndex); ErrorCode printToPrinter(const MSString& printerCmd, const MSIndexVector& pageIndex); virtual void pageUp(void); virtual void pageDown(void); virtual void home(void); virtual void end(void); virtual void up(void); virtual void down(void); virtual void left(void); virtual void right(void); const MSString& fileName(void) const { return _fileName; } static const MSString& gsInterpreter(void) { return _gsInterpreter; } static void gsInterpreter(const MSString& gsInterpreter_) { _gsInterpreter=gsInterpreter_;} protected: class MSGUIExport VScrollBar : public MSVScrollBar { protected: virtual void change(void); public: VScrollBar(MSWidget *); }; class MSGUIExport HScrollBar : public MSHScrollBar { protected: virtual void change(void); public: HScrollBar(MSWidget *); }; class MSGUIExport ClipWindow : public MSWidgetCommon { public: ClipWindow(MSWidget *); }; friend class VScrollBar; friend class HScrollBar; friend class MSPostScriptViewInChannel; friend class MSPostScriptViewOutChannel; void writeFailed(void); void init(void); double PointToPixel(double pt_,double) const; double PixelToPoint(double pixel_,double) const; virtual void keyPress(const XEvent *,KeySym,unsigned int,const char *); void drawAreaShadow(void); void drawPage(void); MSBoolean startInterpreter(MSBoolean p=MSFalse); int stopInterpreter(void); void interpreterFinished(); void setProperties(void); void setEnviroment(void); void updateDpi(void); void updatePixmap(MSBoolean bCreate_=MSFalse); void updateRectangle(void); void updateFile(void); void setBusyState(MSBoolean); void sendNextEvent(void); virtual void ghostScriptExecError(void); virtual void ghostScriptWriteError(void); virtual void ghostScriptFileError(const MSString&); virtual void ghostScriptMessage(const MSString&); const MSString& errorString(void) { return _errorString; } virtual void focusIn(void); virtual void focusOut(void); virtual void clientMessage(const XEvent *); virtual void configure(void); virtual void updateForeground(unsigned long); virtual void updateBackground(unsigned long); virtual void button1Press(const XEvent*); virtual void firstMapNotify(void); virtual void updateBusyState(void); virtual void pageChange(void); void adjustXPos(void); void adjustYPos(void); void hsbChanged(void); void vsbChanged(void); void updateHsb(void); void updateVsb(void); void clearPixmap(void); MSPixmap * redrawPixmap(void) { return _redrawPixmap; } HScrollBar *hsb(void) {return _hsb;} VScrollBar *vsb(void) {return _vsb;} ClipWindow *clipWindow(void) {return _clipWindow;} int xPos(void) { return _xPos; } void xPos(int); int yPos(void) { return _yPos; } void yPos(int); void printPages(FILE *, const MSIndexVector& pageIndex); static MSString _gsInterpreter; Atom GHOSTVIEW; Atom GHOSTVIEW_COLORS; Atom PAGE; Atom DONE; Atom NEXT; double _defaultXdpi; double _defaultYdpi; HScrollBar *_hsb; VScrollBar *_vsb; ClipWindow *_clipWindow; MSPixmap *_redrawPixmap; double _xdpi; double _ydpi; int _llx; int _lly; int _urx; int _ury; PageSize _pageSize; PageOrientation _orientation; double _zoomFactor; int _currentPage; MSString _fileName; FILE *_docFile; int _xPos; int _yPos; //gs info. int _pid; Window _replyWin; MSBoolean _busy; MSBoolean _showBusyCursor; MSShellBusy *_busyObject; MSPostScriptViewDocument *_doc; MSPostScriptViewInChannel *_in; MSPostScriptViewOutChannel *_out; MSPostScriptViewOutChannel *_err; int _naturalWidth; int _naturalHeight; static int _pixmapCount; MSString _errorString; MSString _pixmapName; }; #endif aplus-fsf-4.22/src/MSGUI/MSPrimitive.H0000644000265000001440000000140110772770427013023 #ifndef MSPrimitiveHEADER #define MSPrimitiveHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSGUIExport MSPrimitive : public MSWidgetCommon { public: MSPrimitive(MSWidget *,const char *title_=0); MSPrimitive(MSWidget *,const MSStringVector&); ~MSPrimitive(void); virtual void redraw(void); virtual void print(const char *file_=0); protected: void init(void); void verifyBell(void); virtual void focusIn(void); virtual void focusOut(void); }; #endif aplus-fsf-4.22/src/MSGUI/MSPrimitiveText.H0000644000265000001440000000316210772770427013676 #ifndef MSPrimitiveTextHEADER #define MSPrimitiveTextHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSPixmap; class MSGUIExport MSPrimitiveText : public MSPrimitive { public: MSPrimitiveText(MSWidget *); ~MSPrimitiveText(void); unsigned alignment(void) const; void alignment(unsigned); protected: GC _textGC; XFontStruct *_textFontStruct; unsigned _alignment; MSPixmap *_stipple; void init(void); GC textGC(void) const; const XFontStruct *textFontStruct(void) const; MSPixmap *stipple(void) const; MSBoolean fixedWidth(void) const; MSBoolean doubleByte(void) const; int textWidth(const char *pString_) const; int textWidth(const char *pString_,int len_) const; int charWidth(void) const; int charLbearing(void) const; int charRbearing(void) const; int textAscent(void) const; int textDescent(void) const; int textHeight(void) const; int charWidth(char) const; int charLbearing(char) const; int charRbearing(char) const; virtual void updateBackground(unsigned long); virtual void updateForeground(unsigned long); virtual void updateFont(Font); virtual void updateSensitivity(void); private: const XCharStruct *charStruct(char) const; }; #ifndef MS_NO_INLINES #ifndef MSPrimitiveTextINLINES #include #endif #endif #endif aplus-fsf-4.22/src/MSGUI/MSPrintColumn.H0000644000265000001440000001352610772770427013340 #ifndef MSPrintColumnHEADER #define MSPrintColumnHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include class MSReportTable; class MSPrintHeaders; class MSGUIExport MSPrintColumn : public MSPrintItem, public MSPrintManager { friend class MSPrintHeaders; public: MSPrintColumn(MSPrintManager *,unsigned numColumns_,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSPrintColumn(MSPrintManager *,MSFloatVector& columnWidths_,unsigned numColumns_=1, const MSSymbol& tag_=MSSymbol::nullSymbol()); MSPrintColumn(unsigned numColumns_,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSPrintColumn(MSFloatVector& columnWidths_,unsigned numColumns_=1, const MSSymbol& tag_=MSSymbol::nullSymbol()); ~MSPrintColumn(); void init(void); const MSSymbol& tag(void) const {return _tag;} const MSFloatVector& columnWidths(void) const {return _columnWidths;} unsigned long justification(void) const {return MSPrintItem::justification();} const MSString& fontName(void) const {return printFont();} unsigned long occurrence(void) const {return MSPrintItem::occurrence();} unsigned long pageAlignment(void) const {return MSPrintItem::pageAlignment();} unsigned long style(void) const {return _style;} unsigned leftIndent(void) const {return _leftIndent;} unsigned rightIndent(void) const {return _rightIndent;} unsigned indents(void) const {return _leftIndent+_rightIndent;} unsigned topPixel(void) const {return MSPrintItem::topPixel();} unsigned bottomPixel(void) const {return MSPrintItem::bottomPixel();} int printRow(void) const {return MSPrintItem::printRow();} int printColumn(void) const {return MSPrintItem::printColumn();} unsigned numColumns(void) const {return _numColumns;} MSBoolean headingsOn(void) const {return _headingsOn;} MSPrintColumn& tag(const MSSymbol&); MSPrintColumn& columnWidths(const MSFloatVector&); MSPrintColumn& justification(MSAlignment); MSPrintColumn& justification(unsigned long); MSPrintColumn& leftIndent(unsigned); MSPrintColumn& rightIndent(unsigned); MSPrintColumn& topPixel(unsigned); MSPrintColumn& bottomPixel(unsigned); MSPrintColumn& numColumns(unsigned); MSPrintColumn& printRow(int); MSPrintColumn& printColumn(int); MSPrintColumn& occurrence(unsigned long); MSPrintColumn& occurrence(Occurrence); MSPrintColumn& pageAlignment(unsigned long); MSPrintColumn& pageAlignment(MSAlignment); MSPrintColumn& font(const char *); MSPrintColumn& style(unsigned long); MSPrintColumn& topOffset(double); MSPrintColumn& bottomOffset(double); MSPrintColumn& leftMargin(double); MSPrintColumn& rightMargin(double); MSPrintColumn& headingsOn(MSBoolean); //obsolete. left for backward compatibility MSPrintColumn& row(int); MSPrintColumn& column(int); int row(void) const {return printRow();} int column(void) const {return printColumn();} double topOffset(void) const; double bottomOffset(void) const; double leftMargin(void) const; double rightMargin(void) const; protected: unsigned columnPixel(unsigned); unsigned columnPixelWidth(unsigned); void computeChildrenSize(MSReport*,int,int,int,int,int,int); void computeColumnWidths(void); void sortPrintItemsByRowColumn(void); void computeConfiguration(void); unsigned rowCount(unsigned); MSPrintHeaders *owner(void) {return _owner;} MSUnsignedVector& rowPageCounts(void) {return _rowPageCounts;} MSUnsignedVector& rowHeights(void) {return _rowHeights;} MSUnsignedVector& columnPixelWidth(void) {return _columnPixelWidth;} MSUnsignedVector& columnRowCounts(void) {return _columnRowCounts;} int residualHeight(void) const {return _residualHeight;} unsigned fixedRowCount(void) const {return _fixedRowCount;} unsigned columnCount(void) const {return _columnCount;} unsigned pixelWidth(void) const {return _pixelWidth;} unsigned pixelHeight(void) const {return _pixelHeight;} void owner(MSPrintHeaders *x_) {_owner=x_;} void residualHeight(int x_) {_residualHeight=x_;} void fixedRowCount(unsigned x_) {_fixedRowCount=x_;} void columnCount(unsigned x_) {_columnCount=x_;} void pixelWidth(unsigned x_) {_pixelWidth=x_;} void pixelHeight(unsigned x_) {_pixelHeight=x_;} virtual int computePrintSize(MSReport*,int,int,int,int,int,int); virtual int print(MSReport*,int,int,int,int,int,int); virtual const MSSymbol& printTag(void) const; private: MSPrintHeaders *_owner; MSSymbol _tag; MSFloatVector _columnWidths; MSUnsignedVector _rowPageCounts; MSUnsignedVector _rowHeights; MSUnsignedVector _columnPixelWidth; MSUnsignedVector _columnRowCounts; MSBoolean _headingsOn; unsigned long _style; unsigned _pixelWidth; unsigned _pixelHeight; unsigned _numColumns; unsigned _leftIndent; unsigned _rightIndent; unsigned _fixedRowCount; unsigned _columnCount; int _residualHeight; }; #endif aplus-fsf-4.22/src/MSGUI/MSPrintDisclaimer.H0000644000265000001440000000720710772770430014150 #ifndef MSPrintDisclaimerHEADER #define MSPrintDisclaimerHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #if HAVE_FSTREAM #include #else #include #endif #include #include #include class MSPostScript; class MSGUIExport MSPrintDisclaimer : public MSP { public: MSPrintDisclaimer(MSPostScript *); ~MSPrintDisclaimer(void); void closeFile(void); void computeSize(void); void print(void); void printRule(void); const MSString& fileName(void) const {return _fileName;} const MSString& fontName(void) const {return _fontName;} PageOrientation orientation(void) const {return _orientation;} DisclaimerStyle style(void) const {return _style;} int lineWidth(void) const {return _lineWidth;} int height(void) const {return _height;} int width(void) const {return _width;} int fontSize(void) const {return _fontSize;} int leftPixel(void) const {return _leftPixel;} int rightPixel(void) const {return _rightPixel;} int topPixel(void) const {return _topPixel;} int bottomPixel(void) const {return _bottomPixel;} void fileName(const char *x_) {_fileName=x_;} void orientation(PageOrientation x_) {_orientation=x_;} void style(DisclaimerStyle x_) {_style=x_;} void lineWidth(int x_) {_lineWidth=x_;} void height(int x_) {_height=x_;} void font(const MSString&); void leftMargin(double); void rightMargin(double); void topMargin(double); void bottomMargin(double); double leftMargin(void) const; double rightMargin(void) const; double topMargin(void) const; double bottomMargin(void) const; protected: MSPostScript *owner(void) const; ofstream& pout(void); int xTrans(void) const {return _xTrans;} int yTrans(void) const {return _yTrans;} int rowCount(void) const {return _rowCount;} int wordCount(int i_) const {return _wordCount[i_];} int spaceWidth(int i_) const {return _spaceWidth[i_];} int residualSpace(int i_) const {return _residualSpace[i_];} Font fontID(void) const {return _fontID;} const MSString& fontString(void) const {return _fontString;} void xTrans(int x_) {_xTrans=x_;} void yTrans(int x_) {_yTrans=x_;} void width(int x_) {_width=x_;} void fontSize(int x_) {_fontSize=x_;} void fontID(Font x_) {_fontID=x_;} void fontString(const char *x_) {_fontString=x_;} private: MSPostScript *_owner; int _xTrans; int _yTrans; int _rowCount; int _wordCount[buflen]; int _spaceWidth[buflen]; int _residualSpace[buflen]; int _leftPixel; int _rightPixel; int _topPixel; int _bottomPixel; int _lineWidth; int _height; int _width; int _fontSize; Font _fontID; MSString _fontName; MSString _fontString; MSString _fileName; DisclaimerStyle _style; PageOrientation _orientation; ifstream pin; }; //for backward compatibility. typedef MSPrintDisclaimer MSDisclaimer; #endif aplus-fsf-4.22/src/MSGUI/MSPrintFont.H0000644000265000001440000000163010772770430012774 #ifndef MSPrintFontHEADER #define MSPrintFontHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSGUIExport MSPrintFont { static MSHashTable *_fontHashTable; static MSStringHashTable *_afmfilesHashTable; static const char *_defaultFontPath; static const char *_altDefaultFontPath; public: MSPrintFont(void); ~MSPrintFont(void); MSHashTable *fontHashTable(void); MSStringHashTable *afmfilesHashTable(void); void initFontHashTable(void); MSBoolean initAfmfilesHashTable(const char *path_=0); static const char *defaultFontPath(void); static const char *altDefaultFontPath(void); }; #endif aplus-fsf-4.22/src/MSGUI/MSPrintFontData.H0000644000265000001440000000602410772770430013570 #ifndef MSPrintFontDataHEADER #define MSPrintFontDataHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSGUIExport MSPrintFontData { public: enum {MSBadFontID=0}; MSPrintFontData(void); MSPrintFontData(const MSString&); MSPrintFontData(const MSString&,const MSString&); ~MSPrintFontData(void); void init(void); void loadFont(void); void fontName(const MSString& x_) {_fontName=x_;} void fontPath(const MSString& x_) {_fontPath=x_;} void fontID(int x_) {_fontID=x_;} void bufsize(int x_) {_bufsize=x_;} void offset(int x_) {_offset=x_;} void capHeight(int x_) {_capHeight=x_;} void xHeight(int x_) {_xHeight=x_;} void underlineThichness(int x_) {_underlineThickness=x_;} void underlinePosition(int x_) {_underlinePosition=x_;} void ascender(int x_) {_ascender=x_;} void descender(int x_) {_descender=x_;} void isFixedPitch(MSBoolean x_) {_isFixedPitch=x_;} int fontID(void) const {return _fontID;} int bufsize(void) const {return _bufsize;} int offset(void) const {return _offset;} int capHeight(void) const {return _capHeight;} int xHeight(void) const {return _xHeight;} int underlineThichness(void) const {return _underlineThickness;} int underlinePosition(void) const {return _underlinePosition;} int ascender(void) const {return _ascender;} int descender(void) const {return _descender;} MSBoolean isFixedPitch(void) const {return _isFixedPitch;} const MSString& fileName(void) const {return _fileName;} const MSString& fontName(void) const {return _fontName;} const MSString& fontPath(void) const {return _fontPath;} int ascent(unsigned) const; int descent(unsigned) const; int width(unsigned) const; int lbearing(unsigned) const; int rbearing(unsigned) const; int height(unsigned) const; double fontOffset(int); double textWidth(int,const char *,int); void showFontError(void); void showFileError(void); protected: MSRect& fontBox(void) {return _fontBox;} private: enum {_buflen=128}; char _pbuf[_buflen]; MSString _fontName; MSString _fontPath; MSString _fileName; int _fontID; int _bufsize; int _offset; int _capHeight; int _xHeight; int _underlineThickness; int _underlinePosition; int _ascender; int _descender; int *_ascent; int *_descent; int *_width; int *_lbearing; int *_rbearing; MSBoolean _isFixedPitch; MSRect _fontBox; }; #endif aplus-fsf-4.22/src/MSGUI/MSPrintHeaders.H0000644000265000001440000000714410772770430013447 #ifndef MSPrintHeadersHEADER #define MSPrintHeadersHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include class MSPrintColumn; class MSGUIExport MSPrintHeaders { public: MSPrintHeaders(void); ~MSPrintHeaders(void); // // MSParagraph lists // MSBoolean removeHeader(const MSSymbol&); MSBoolean removeHeader(MSPrintItem*); MSBoolean removeFooter(const MSSymbol&); MSBoolean removeFooter(MSPrintItem*); void removeAllHeaders(void); void removeAllFooters(void); const MSParagraph& header(const MSSymbol&) const; const MSParagraph& footer(const MSSymbol&) const; MSParagraph& header(const MSSymbol&); MSParagraph& footer(const MSSymbol&); MSParagraph& addHeader(const MSParagraph&); MSParagraph& addHeader(const MSStringVector&); MSParagraph& addHeader(const MSString&); MSParagraph& addHeader(const char *); MSPrintColumn& addHeader(MSPrintColumn*); MSParagraph& addFooter(const MSParagraph&); MSParagraph& addFooter(const MSStringVector&); MSParagraph& addFooter(const MSString&); MSParagraph& addFooter(const char *); MSPrintColumn& addFooter(MSPrintColumn*); const MSParagraph& defaultParagraph(void) const {return _defaultParagraph;} MSParagraph& defaultParagraph(void) {return _defaultParagraph;} MSIntVector& headerHeights(void) {return _headerHeights;} MSIntVector& footerHeights(void) {return _footerHeights;} protected: const MSPointerArray& headerList(void) const {return _headerList;} const MSPointerArray& footerList(void) const {return _footerList;} const MSPointerArray& textList(void) const {return _textList;} const MSPrintItem *header(unsigned i_) const {return _headerList.array(i_);} const MSPrintItem *footer(unsigned i_) const {return _footerList.array(i_);} const MSParagraph *text(unsigned i_) const {return _textList.array(i_);} const MSParagraph& headerParagraph(const MSSymbol&) const; MSParagraph& headerParagraph(const MSSymbol&); MSPointerArray& headerList(void) {return _headerList;} MSPointerArray& footerList(void) {return _footerList;} MSPointerArray& textList(void) {return _textList;} MSPrintItem *header(unsigned i_) {return _headerList.array(i_);} MSPrintItem *footer(unsigned i_) {return _footerList.array(i_);} MSParagraph *text(unsigned i_) {return _textList.array(i_);} private: MSPointerArray _headerList; MSPointerArray _footerList; MSPointerArray _textList; MSParagraph _defaultParagraph; MSIntVector _headerHeights; MSIntVector _footerHeights; }; // We provide explicit "do_not_instantiate" pragmas here to avoid instantiation complications in // MStk applications. // #if !defined(__MSGUILIBRARY_BUILD__) && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma do_not_instantiate MSPointerArray #pragma do_not_instantiate MSPointerArray #endif // !__MSGUILIBRARY_BUILD__ && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #endif aplus-fsf-4.22/src/MSGUI/MSPrintItem.H0000644000265000001440000001232110772770430012763 #ifndef MSPrintItemHEADER #define MSPrintItemHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include class MSReport; class MSPrintManager; class MSGUIExport MSPrintItem : public MSP { public: MSPrintItem(void); MSPrintItem(const MSPrintItem&); virtual ~MSPrintItem(void); MSPrintItem& operator=(const MSPrintItem&); virtual int computePrintSize(MSReport*,int,int,int,int,int,int); virtual int print(MSReport*,int,int,int,int,int,int); virtual const MSSymbol& printTag(void) const; double leftMargin(void) const; void leftMargin(double); double rightMargin(void) const; void rightMargin(double); double topOffset(void) const; void topOffset(double); double bottomOffset(void) const; void bottomOffset(double); const MSString& printFont(void) const {return _printFont;} void printFont(const char *x_) {_printFont=x_;} int currentPage(void) const {return _currentPage;} void currentPage(int x_) {_currentPage=x_;} int pageCount(void) const {return _pageCount;} void pageCount(int x_) {_pageCount=x_;} int residual(void) const {return _residual;} void residual(int x_) {_residual=x_;} int printRow(void) const {return _printRow;} void printRow(int x_) {_printRow=x_;} int printColumn(void) const {return _printColumn;} void printColumn(int x_) {_printColumn=x_;} int printHeight(void) const {return _printHeight;} void printHeight(int x_) {_printHeight=x_;} int pageBreakRow(void) const {return _pageBreakRow;} void pageBreakRow(int x_) {_pageBreakRow=x_;} unsigned long occurrence(void) const {return _occurrence;} void occurrence(unsigned long x_) {_occurrence=x_;} void occurrence(Occurrence x_) {_occurrence=x_;} MSBoolean isDestroyable(void) const {return _destroyable;} void destroyable(MSBoolean x_) {_destroyable=x_;} MSBoolean changed(void) const {return _changed;} void changed(MSBoolean x_) {_changed=x_;} unsigned long pageAlignment(void) const {return _pageAlignment;} void pageAlignment(unsigned long x_) {_pageAlignment=x_;} unsigned long justification(void) const {return _justification;} void justification(MSAlignment x_) {_justification=x_;} void justification(unsigned long x_) {_justification=x_;} void currentPageInc(void) {_currentPage++;} int leftPixel(void) const {return _leftPixel;} void leftPixel(unsigned x_) {_leftPixel=x_;} int rightPixel(void) const {return _rightPixel;} void rightPixel(unsigned x_) {_rightPixel=x_;} int topPixel(void) const {return _topPixel;} void topPixel(unsigned x_) {_topPixel=x_;} int bottomPixel(void) const {return _bottomPixel;} void bottomPixel(unsigned x_) {_bottomPixel=x_;} void printManager(MSPrintManager *x_) {_printManager=x_;} MSPrintManager *printManager(void) {return _printManager;} protected: void reset(void); MSPrintManager *_printManager; MSBoolean _destroyable; MSBoolean _changed; int _printRow; int _printColumn; int _leftPixel; int _rightPixel; int _topPixel; int _bottomPixel; int _pageBreakRow; int _printHeight; unsigned long _pageAlignment; unsigned long _occurrence; unsigned long _justification; MSString _printFont; int _currentPage; int _pageCount; int _residual; }; class MSGUIExport MSPageBreakPrintItem : public MSPrintItem { public: MSPageBreakPrintItem(void); ~MSPageBreakPrintItem(void); virtual int computePrintSize(MSReport*,int,int,int,int,int,int); virtual int print(MSReport*,int,int,int,int,int,int); }; class MSGUIExport MSRulePrintItem : public MSPrintItem { public: MSRulePrintItem(unsigned ruleWidth_=0); ~MSRulePrintItem(void); void ruleWidth(unsigned x_) {if (x_<100) _ruleWidth=x_;} void fgGrayScale(double x_) {if (x_>=0.0&&x_<=1.0) _fgGrayScale=x_;} unsigned ruleWidth(void) const {return _ruleWidth;} double fgGrayScale(void) const {return _fgGrayScale;} virtual int computePrintSize(MSReport*,int,int,int,int,int,int); virtual int print(MSReport*,int,int,int,int,int,int); void printRulePrintItem(MSReport*,int,int,int); private: int _ruleWidth; double _fgGrayScale; }; #endif aplus-fsf-4.22/src/MSGUI/MSPrintManager.H0000644000265000001440000000760510772770430013450 #ifndef MSPrintManagerHEADER #define MSPrintManagerHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSGraph; class MSReportTable; class MSPrintColumn; class MSPrintItem; class MSGUIExport MSPrintManager { public: MSPrintManager(MSPrintManager *); MSPrintManager(void); ~MSPrintManager(void); MSPrintManager *parent(void) {return _parent;} const MSPrintManager *parent(void) const {return _parent;} MSPrintManager *topLevel(void); const MSPrintManager *topLevel(void) const; MSPrintItem& addPageBreak(void); MSRulePrintItem& addRule(int width_=0); MSParagraph& addParagraph(const MSParagraph&); MSParagraph& addParagraph(const MSStringVector&); MSPrintColumn& addPrintItem(MSPrintColumn *); MSReportTable& addPrintItem(MSReportTable *); MSGraph& addPrintItem(MSGraph *); MSPrintItem& addPrintItem(MSPrintItem *); MSBoolean removeParagraph(const MSSymbol&); MSBoolean removePrintItem(const MSSymbol&); MSBoolean removePrintItem(MSPrintItem *); void removeAllPageBreaks(void); void removeAllParagraphs(void); void removeAll(void); const MSParagraph& paragraph(const MSSymbol&) const; MSParagraph& paragraph(const MSSymbol&); const MSPrintItem &printItem(const MSSymbol&) const; MSPrintItem &printItem(const MSSymbol&); const MSParagraph& paragraph(unsigned) const; MSParagraph& paragraph(unsigned); int paragraphCount(void) const {return _paragraphList.count();} const MSParagraph& defaultParagraph(void) const {return _defaultParagraph;} MSParagraph& defaultParagraph(void) {return _defaultParagraph;} friend MSGUIExport MSParagraph& operator<<(MSPrintManager&,const MSParagraph&); friend MSGUIExport MSParagraph& operator<<(MSPrintManager&,const MSStringVector&); friend MSGUIExport MSPrintColumn& operator<<(MSPrintManager&,MSPrintColumn *); friend MSGUIExport MSPrintItem& operator<<(MSPrintManager&,MSPrintItem *); friend MSGUIExport MSReportTable& operator<<(MSPrintManager&,MSReportTable *); friend MSGUIExport MSGraph& operator<<(MSPrintManager&,MSGraph *); protected: MSPointerArray& childList(void) {return _childList;} MSPointerArray& paragraphList(void) {return _paragraphList;} MSPointerArray& printItemList(void) {return _printItemList;} MSPrintItem *item(unsigned i_) {return _printItemList.array(i_);} const MSPointerArray& childList(void) const {return _childList;} const MSPointerArray& paragraphList(void) const {return _paragraphList;} const MSPointerArray& printItemList(void) const {return _printItemList;} const MSPrintItem *item(unsigned i_) const {return _printItemList.array(i_);} void parent(MSPrintManager *x_) {_parent=x_;} private: MSPrintManager *_parent; static MSParagraph _defaultParagraph; MSPointerArray _paragraphList; MSPointerArray _printItemList; MSPointerArray _childList; }; // We provide explicit "do_not_instantiate" pragmas here to avoid instantiation complications in // MStk applications. // #if !defined(__MSGUILIBRARY_BUILD__) && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma do_not_instantiate MSPointerArray #pragma do_not_instantiate MSPointerArray #endif // !__MSGUILIBRARY_BUILD__ && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #endif aplus-fsf-4.22/src/MSGUI/MSPrintTool.H0000644000265000001440000000062210772770430013003 #ifndef MSPrintToolHEADER #define MSPrintToolHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #define MSPrintTool MSReport #endif aplus-fsf-4.22/src/MSGUI/MSRadioBox.H0000644000265000001440000000227610772770430012567 #ifndef MSRadioBoxHEADER #define MSRadioBoxHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSGUIExport MSRadioBox : public MSActionBox { friend class MSRadioButton; public: MSRadioBox(MSWidget *,const char *title_=0); MSRadioBox(MSWidget *,const MSStringVector&); ~MSRadioBox(void); MSRadioButton *activeButton(void); const MSRadioButton *activeButton(void) const; void activeButton(MSRadioButton *radioButton_, MSBoolean callback_=MSFalse); virtual const MSSymbol& widgetType(void) const; protected: virtual void firstMapNotify(void); virtual void arm(MSRadioButton *); virtual void disarm(void); static const MSSymbol& symbol(void); }; inline MSRadioButton *MSRadioBox::activeButton(void) { return (MSRadioButton *)_activeButton; } inline const MSRadioButton *MSRadioBox::activeButton(void) const { return (const MSRadioButton *)_activeButton; } #endif aplus-fsf-4.22/src/MSGUI/MSPulldownMenu.H0000644000265000001440000000144610772770430013507 #ifndef MSPulldownMenuHEADER #define MSPulldownMenuHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSMenuBarItem; class MSGUIExport MSPulldownMenu : public MSMenu { protected: MSMenuBarItem *item(void) { return (MSMenuBarItem*)parentMenuItem(); } const MSMenuBarItem *item(void) const { return (MSMenuBarItem*)parentMenuItem(); } public: MSPulldownMenu(MSMenuBarItem *); ~MSPulldownMenu(void); virtual void activate(void); virtual void done(void); virtual void left(void); virtual void right(void); }; #endif aplus-fsf-4.22/src/MSGUI/MSRadioButton.H0000644000265000001440000000326110772770430013305 #ifndef MSRadioButtonHEADER #define MSRadioButtonHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSRadioBox; class MSGUIExport MSRadioButton : public MSToggleButtonBase { friend class MSRadioBox; public: MSRadioButton(MSRadioBox *,const char *label_,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSRadioButton(MSRadioBox *,const MSStringVector& label_,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSRadioButton(MSRadioBox *,const MSPixmap &pixmap_,const MSPixmap &insensitivePixmap_, const MSPixmap &armedPixmap_,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSRadioButton(MSRadioBox *,const char *label_,int integerTag_); MSRadioButton(MSRadioBox *,const MSStringVector& label_,int integerTag_); MSRadioButton(MSRadioBox *,const MSPixmap &pixmap_,const MSPixmap &insensitivePixmap_, const MSPixmap &armedPixmap_,int integerTag_); ~MSRadioButton(void); virtual MSAttrValueList& get(MSAttrValueList&); virtual void set(MSAttrValueList&); protected: void drawDiamond(void); virtual void arm(MSBoolean callback_); virtual void arm(void); virtual void disarm(void); virtual void drawSymbol(void); MSRadioBox *radioBox(void) const; virtual void radioBoxArm(void); virtual void radioBoxDisarm(void); virtual void radioBoxActivate(void); // Arrow Key Traversal virtual void up(void); virtual void down(void); virtual void left(void); virtual void right(void); }; #endif aplus-fsf-4.22/src/MSGUI/MSRadioMenuItem.H0000644000265000001440000000305210772770430013553 #ifndef MSRadioMenuItemHEADER #define MSRadioMenuItemHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1998-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSGUIExport MSRadioMenuItem : public MSToggleMenuItem { protected: virtual void drawSymbol(void); virtual void radioDisarm(void); virtual int symbolHeight(void) const; virtual int symbolWidth(void) const; public: MSRadioMenuItem(MSMenu *); MSRadioMenuItem(MSMenu *,const char *,char mnemonic_=0,int tag_=0); MSRadioMenuItem(MSMenu *,const MSString&,char mnemonic_=0,int tag_=0); MSRadioMenuItem(MSMenu *,const MSPixmap &pixmap_,const MSPixmap &insensitivePixmap_,int tag_=0); MSRadioMenuItem(MSMenu *,const MSString &,const MSPixmap &pixmap_,const MSPixmap &armedPixmap_, const MSPixmap &insensitivePixmap_,char mnemonic_=0,int tag_=0); MSRadioMenuItem(MSMenu *,const MSString &,const MSPixmap &pixmap_,const MSPixmap &armedPixmap_, char mnemonic_=0,int tag_=0); MSRadioMenuItem(MSMenu *,const char *,const MSPixmap &pixmap_,const MSPixmap &armedPixmap_, const MSPixmap &insensitivePixmap_,char mnemonic_=0,int tag_=0); MSRadioMenuItem(MSMenu *,const char *,const MSPixmap &pixmap_,const MSPixmap &armedPixmap_,char mnemonic_=0,int tag_=0); ~MSRadioMenuItem(void); virtual void activate(void); }; #endif aplus-fsf-4.22/src/MSGUI/MSRateEntryField.H0000644000265000001440000000275210772770430013740 #ifndef MSRateEntryFieldHEADER #define MSRateEntryFieldHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include // We provide explicit "do_not_instantiate" pragmas here to avoid instantiation complications in // MStk applications. // #if !defined(__MSGUILIBRARY_BUILD__) && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma do_not_instantiate MSTypeEntryField #endif // !__MSGUILIBRARY_BUILD__ && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #if defined(MS_VC_NEED_TEMPLATE_EXPORT) class MSGUIExport MSTypeEntryField; #endif class MSGUIExport MSRateEntryField : public MSTypeEntryField { protected: void init(void); public: MSRateEntryField(MSWidget *,const char *label_=0, const MSSymbol& tag_=MSSymbol::nullSymbol()); MSRateEntryField(MSWidget *,MSRate&,const char *label_=0, const MSSymbol& tag_=MSSymbol::nullSymbol()); ~MSRateEntryField(void); MSRateEntryField& operator=(const MSRate& value_) {value(value_); return *this;} operator MSRate&() {return value();} virtual void set(MSAttrValueList&); virtual MSAttrValueList& get(MSAttrValueList&); }; #endif aplus-fsf-4.22/src/MSGUI/MSRect.H0000644000265000001440000000152510772770430011751 #ifndef MSRectHEADER #define MSRectHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSGUIExport MSRect { protected: int _x; int _y; int _width; int _height; public: MSRect(void); MSRect(const MSRect&); MSRect(int x_,int y_,int w_,int h_); virtual ~MSRect(void); int x(void) const; int y(void) const; int width(void) const; int height(void) const; void x(int x_); void y(int y_); void width(int w_); void height(int h_); void configuration(int x_,int y_,int w_,int h_); MSRect& operator=(const MSRect&); }; #endif aplus-fsf-4.22/src/MSGUI/MSReport.H0000644000265000001440000003252410772770430012332 #ifndef MSReportHEADER #define MSReportHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #include #include #include typedef void (*MSReportCallbackFunc)(void*, void*); class MSReportCallbackNode; class MSGUIExport MSReport : public MSPostScript, public MSPrintHeaders, public MSPrintManager { public: MSReport(void); ~MSReport(void); virtual void cancelReport(void) {_cancelReport=MSTrue;} void reset(void); void print(const char *file_=0); void computeOutputSize(void); // callbacks static MSSymbol pagebreak; static MSSymbol computesize; // defaults inherited by children void defaultFont(const MSString& x_); int defaultFontSize(void) const {return _defaultFontSize;} Font defaultFontID(void) const {return _defaultFontID;} const MSString& defaultFont(void) const {return _defaultFont;} const MSFloatVector& tabStop(void) const {return _tabStop;} void tabStop(const MSFloatVector& x_) {_tabStop=x_;} // // Style methods // unsigned long pageFrameStyle(void) const {return _pageFrameStyle;} MSBoolean uniformScaling(void) const {return _uniformScaling;} MSFloat::MSFloatFormat asciiFloatFormat(void) const {return (MSFloat::MSFloatFormat)_asciiFloatFormat;} MSInt::MSIntFormat asciiIntFormat(void) const {return (MSInt::MSIntFormat)_asciiIntFormat;} void pageFrameStyle(unsigned long x_) {_pageFrameStyle=x_;} void uniformScaling(MSBoolean x_) {_uniformScaling=x_;} void asciiFloatFormatClear(void) {_asciiFloatFormat=0;} void asciiFloatFormat(MSFloat::MSFloatFormat x_) {_asciiFloatFormat=x_;} void asciiIntFormatClear(void) {_asciiIntFormat=0;} void asciiIntFormat(MSInt::MSIntFormat x_) {_asciiIntFormat=x_;} // // Miscellaneous dimensions // int headerOffset(void) const {return _headerOffset;} int footerOffset(void) const {return _footerOffset;} int pageNumberOffset(void) const {return _pageNumberOffset;} int pageFrameOffset(void) const {return _pageFrameOffset;} int pageFrameLineWidth(void) const {return _pageFrameLineWidth;} int pageFrameExtent(void) const {return _pageFrameExtent;} void headerOffset(unsigned x_) {_headerOffset=x_;} void footerOffset(unsigned x_) {_footerOffset=x_;} void pageNumberOffset(unsigned x_) {_pageNumberOffset=x_;} void pageFrameOffset(unsigned x_) {_pageFrameOffset=x_;} void pageFrameLineWidth(unsigned x_) {_pageFrameLineWidth=x_;} void pageFrameExtent(unsigned x_) {_pageFrameExtent=x_;} // // internal values for diagnostics // int pageCount(void) const {return _pageCount;} int pageCountTotal(void) const {return _pageCountTotal;} // // page banner methods // MSParagraph& banner(const MSParagraph&); MSParagraph& banner(const MSStringVector&); MSParagraph& banner(const char *); const MSParagraph& banner(void) const {return _banner;} MSParagraph& banner(void) {return _banner;} // // page numbering methods // const MSUnsignedVector& pageNumbers(void) const {return _pageNumbers;} const MSParagraph& pageNumber(void) const {return _pageNumber;} MSParagraph& pageNumber(void) {return _pageNumber;} MSBoolean pageNumbering(void) const {return _pageNumbering;} void pageNumbers(const MSUnsignedVector& x_) {_pageNumbers=x_;} MSParagraph& pageNumber(const MSParagraph& x_) {_pageNumber=x_; return _pageNumber;} MSParagraph& pageNumber(const MSStringVector& x_) {_pageNumber=x_; return _pageNumber;} MSParagraph& pageNumber(const char *x_) {_pageNumber=x_; return _pageNumber;} void pageNumbering(MSBoolean x_) {_pageNumbering=x_;} MSStringVector& pageNumberText(void) {return _pageNumberText;} // Callback methods void callback(const MSSymbol&,MSCallback *callback_); void callback(const MSSymbol&,MSReportCallbackFunc,void *clientData_=0); MSCallback *callback(const MSSymbol&); // the following methods return the top and bottom positions // based on the value of pageCount. int bodyTop(int); int bodyBottom(int); int bodyTop(void); int bodyBottom(void); int pageEnd(void) {return _pageEnd;} void pageEnd(int x_) {_pageEnd=x_;} int yPixel(void) const {return _yPixel;} void yPixel(int x_) {_yPixel=x_;} // the following is True when there are different header/footer sizes for // different pages. A lot of unnecessary processing is avoided if not True. MSBoolean conditionalPageSize(void) {return _conditionalPageSize;} void conditionalPageSize(MSBoolean x_) {_conditionalPageSize=x_;} int bodyTopBase(void) const {return _bodyTopBase;} int bodyBottomBase(void) const {return _bodyBottomBase;} int bodyLeft(void) const {return _bodyLeft;} int bodyRight(void) const {return _bodyRight;} int x_end(void) const {return _x_end;} int y_end(void) const {return _y_end;} int psFontSize(void) const {return _psFontSize;} double fgGrayScale(void) const {return _fgGrayScale;} double bgGrayScale(void) const {return _bgGrayScale;} void bodyTopBase(int x_) {_bodyTopBase=x_;} void bodyBottomBase(int x_) {_bodyBottomBase=x_;} void bodyLeft(int x_) {_bodyLeft=x_;} void bodyRight(int x_) {_bodyRight=x_;} void x_end(int x_) {_x_end=x_;} void y_end(int x_) {_y_end=x_;} void psFontSize(int x_) {_psFontSize=x_;} void pageCount(int x_) {_pageCount=x_;} void pageCountTotal(int x_) {_pageCountTotal=x_;} void pageCountIncrement(void) {_pageCount++;} void fgGrayScale(double x_) {_fgGrayScale=x_;} void bgGrayScale(double x_) {_bgGrayScale=x_;} void defaultFontID(Font x_) {_defaultFontID=x_;} void defaultFontSize(int x_) {_defaultFontSize=x_;} virtual MSBoolean reportOpen(void); virtual MSBoolean reportClose(void); virtual void init(void); virtual void postScriptStackInit(void); virtual void printProlog(void); virtual void printEpilog(void); virtual void printSetup(void); virtual void startPage(void); virtual void endPage(void); virtual void updateForeground(int); virtual void updateBackground(void); virtual void updateFont(void); virtual void strokeRectangle(double,double,double,double); virtual void fillRectangle(double,double,double,double); virtual void printReportString(unsigned long,int,int,const char *,int); virtual void setClipRectangle(int,int,int,int); void computePrintScale(void); void computePageSize(void); void printPageFrame(void); void printPageStart(void); void setFgGrayScale(void); void setBgGrayScale(void); void setFont(void); void printPageTranslate(void); void translate(double,double); void translateScale(double,double,int,int); void printBox(unsigned long,double,double,double,double); void push(void); void pop(void); unsigned long formatStyle(unsigned long); MSBoolean printOnPage(MSPrintItem&,int,int); ////////////////////////////////////////////////////////////////////////// // // page banner methods // ////////////////////////////////////////////////////////////////////////// double bannerAngle(void) {return _bannerAngle;} double bannerXtrans(void) {return _bannerXtrans;} double bannerYtrans(void) {return _bannerYtrans;} double bannerWidth(void) {return _bannerWidth;} void bannerAngle(double x_) {_bannerAngle=x_;} void bannerWidth(double x_) {_bannerWidth=x_;} void bannerXtrans(double x_) {_bannerXtrans=x_;} void bannerYtrans(double x_) {_bannerYtrans=x_;} void computeBannerExtents(void); virtual void printBanner(void); ////////////////////////////////////////////////////////////////////////// // // page number methods // ////////////////////////////////////////////////////////////////////////// MSBoolean insertPageNumString(MSStringVector&); const MSString& insertString(void) const {return _insertString;} const MSString& pageNumberString(void) const {return _pageNumberString;} MSBoolean pageNumIncludeStatus(void) const {return _pageNumIncludeStatus;} void pageNumIncludeStatus(MSBoolean x_) {_pageNumIncludeStatus=x_;} MSBoolean cancelReportStatus(void) {return _cancelReport;} void computePageNumber(void); void printPageNumber(void); int tabStop(int); ////////////////////////////////////////////////////////////////////////// // // callback methods // ////////////////////////////////////////////////////////////////////////// MSNodeItem *callbackListHead(void); MSReportCallbackNode *callbackNode(const MSSymbol&); MSBoolean activateCallback(const MSSymbol&); void deleteCallbackList(void); int _pageCount; MSBoolean printHeaderStatus(void) {return _printHeaderStatus;} protected: ////////////////////////////////////////////////////////////////////////// // //header/footer methods // ////////////////////////////////////////////////////////////////////////// void computePageHeaderSize(int); void computePageFooterSize(int); void printPageHeaders(void); void printPageFooters(void); void printHeaderStatus(MSBoolean x_) {_printHeaderStatus=x_;} ////////////////////////////////////////////////////////////////////////// // //general print methods // ////////////////////////////////////////////////////////////////////////// MSRect& printArea(void) {return _printArea;} private: int _x_end; int _y_end; int _yPixel; double _bannerWidth; double _bannerAngle; double _bannerXtrans; double _bannerYtrans; double _fgGrayScale; double _bgGrayScale; MSBoolean _cancelReport; MSBoolean _uniformScaling; MSBoolean _conditionalPageSize; MSBoolean _printHeaderStatus; unsigned long _pageFrameStyle; unsigned _headerOffset; unsigned _footerOffset; unsigned _pageNumberOffset; unsigned _pageFrameOffset; unsigned _pageFrameLineWidth; unsigned _pageFrameExtent; unsigned _bindingWidth; int _defaultFontSize; Font _defaultFontID; MSString _defaultFont; MSParagraph _banner; MSFloatVector _tabStop; MSStringVector _pageNumberText; MSUnsignedVector _pageNumbers; MSParagraph _pageNumber; MSString _pageNumberString; MSBoolean _pageNumIncludeStatus; MSBoolean _pageNumbering; MSString _insertString; int _pageCountTotal; int _psFontSize; int _columnHeadingHeight; MSRect _printArea; int _pageEnd; int _bodyTopBase; int _bodyBottomBase; int _bodyLeft; int _bodyRight; MSNodeItem *_callbackListHead; unsigned long _asciiFloatFormat; unsigned long _asciiIntFormat; }; inline MSNodeItem *MSReport::callbackListHead(void) { return _callbackListHead; } class MSGUIExport MSReportCallbackNode { protected: MSCallback *_callback; MSSymbol _name; public: MSReportCallbackNode(const MSSymbol& name_,MSCallback *pCallback_) : _name(name_),_callback(pCallback_) {} ~MSReportCallbackNode(void) { delete _callback; _callback=0; } void callback(MSCallback *pCallback_) { if (callback()!=pCallback_) { delete _callback; _callback=pCallback_; } } const MSSymbol& name(void) const { return _name; } MSCallback *callback(void) const { return _callback; } }; #endif aplus-fsf-4.22/src/MSGUI/MSReportTable.H0000644000265000001440000005567110772770431013313 #ifndef MSReportTableHEADER #define MSReportTableHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #include #include #include class MSGUIExport MSReportTable : public MSPrintItem, public MSPrintHeaders { friend class MSTableColumn; public: MSReportTable(const char *title_=0,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSReportTable(const MSStringVector&,const MSSymbol& tag_=MSSymbol::nullSymbol()); ~MSReportTable(void); virtual int computePrintSize(MSReport*,int,int,int,int,int,int); virtual int print(MSReport*,int,int,int,int,int,int); // // screen and print methods // MSSymbolVector tags(void); MSSymbolVector tags(void) const; MSSymbolVector hiddenTags(void); MSSymbolVector hiddenTags(void) const; MSTableColumn *reportColumn(const MSSymbol&); MSTableColumn *reportColumn(unsigned int); const MSTableColumn *reportColumn(const MSSymbol&) const; const MSTableColumn *reportColumn(unsigned int) const; unsigned numRows(void) const; virtual unsigned numColumns(void) const; virtual unsigned dataRows(void) const; virtual unsigned numRows(unsigned) const; virtual void exchangeColumns(unsigned int,unsigned int); virtual void placeColumnAt(MSTableColumn *,unsigned); virtual void permuteColumns(const MSIndexVector& aIndexVector_); virtual void permuteColumns(const MSSymbolVector& aSymbolVector_); virtual void permuteColumns(const MSWidgetVector& aColumnVector_); virtual MSIndexVector sortUp(const MSIndexVector &); virtual MSIndexVector sortUp(const MSSymbolVector &); virtual MSIndexVector sortDown(const MSIndexVector &); virtual MSIndexVector sortDown(const MSSymbolVector &); virtual const char *formatOutput(MSString &,unsigned,unsigned); void headingForeground(unsigned long); void headingForeground(const char *); // // reporting attributes // MSReport* report(void); MSIndexVector& breakTextColumn(void) {return _breakTextColumn;} MSIndexVector& breakColumn(void) {return _breakColumn;} const MSSymbol& tag(void) const {return _tag;} MSBoolean reportTotalOn(void) const {return _reportTotalOn;} MSBoolean reportGrandTotalOn(void) const {return _reportGrandTotalOn;} MSBoolean pageTotalOn(void) const {return _pageTotalOn;} MSFloat& grandTotal(void) {return _grandTotal;} MSParagraph& grandTotalText(void) {return _grandTotalText;} const MSFloat& grandTotal(void) const {return _grandTotal;} const MSParagraph& grandTotalText(void) const {return _grandTotalText;} const MSStringVector& reportTitle(void) const {return _reportTitle;} const MSString& reportTotalFont(void) const {return _reportTotalFont;} const MSString& breakFont(void) const {return _breakFont;} const MSIndexVector& breakIndex(void) const {return _breakIndex;} MSIndexVector& breakIndex(void) {return _breakIndex;} MSIndexVector& pageBreakIndex(void) {return _pageBreakIndex;} unsigned long frameStyle(void) const {return _frameStyle;} int frameOffset(void) const {return _frameOffset;} int frameLineWidth(void) const {return _frameLineWidth;} unsigned long style(void) const {return _style;} unsigned long reportTotalStyle(void) const {return _reportTotalStyle;} unsigned long breakStyle(void) const {return _breakStyle;} unsigned long headingStyle(void) const {return _headingStyle;} unsigned long headingForeground(void) const {return _headingForeground;} double fgGrayScale(void) const {return _fgGrayScale;} double bgGrayScale(void) const {return _bgGrayScale;} double headingFgGrayScale(void) const {return _headingFgGrayScale;} double headingBgGrayScale(void) const {return _headingBgGrayScale;} int breakOffset(void) const {return _breakOffset;} int breakLeading(void) const {return _breakLeading;} int reportTotalLeading(void) const {return _reportTotalLeading;} int reportHeadingOffset(void) const {return _reportHeadingOffset;} const MSFloatVector& reportColumnSpacing(void) const {return _reportColumnSpacing;} const MSString& reportHeadingFont(void) const {return _reportHeadingFont;} virtual int fixedReportColumns(void) const; virtual MSDisplayServer *displayServer(void); virtual void generateReport(const char *file_=0); virtual void computeBreaks(void); virtual void updateBreaks(void); virtual void updateBreaks(unsigned); void tag(const MSSymbol& x_) {_tag=x_;} void fixedReportColumns(int x_) {_fixedReportColumns=x_;} void reportTotalOn(MSBoolean x_) {_reportTotalOn=x_;} void reportGrandTotalOn(MSBoolean x_) {_reportGrandTotalOn=x_;} void pageTotalOn(MSBoolean x_) {_pageTotalOn=x_;} void reportTitle(const MSStringVector& x_) {_reportTitle=x_;} void reportTotalFont(const char *x_) {_reportTotalFont=x_;} void reportHeadingFont(const char *x_) {_reportHeadingFont=x_;} void breakFont(const char *x_) {_breakFont=x_;} void frameOffset(unsigned x_) {_frameOffset=x_;} void frameLineWidth(unsigned x_) {_frameLineWidth=x_;} void frameStyle(unsigned long x_) {_frameStyle=x_;} void headingStyle(unsigned long x_) {_headingStyle=x_;} void reportTotalStyle(unsigned long x_) {_reportTotalStyle=x_;} void breakStyle(unsigned long x_) {_breakStyle=x_;} void reportTotalLeading(int x_) {_reportTotalLeading=x_;} void reportHeadingOffset(unsigned x_) {_reportHeadingOffset=x_;} void breakOffset(int x_) {_breakOffset=x_;} void breakLeading(int x_) {_breakLeading=x_;} void fgGrayScale(double x_) {if (x_>=0.0&&x_<=1.0) _fgGrayScale=x_;} void bgGrayScale(double x_) {if (x_>=0.0&&x_<=1.0) _bgGrayScale=x_;} void headingFgGrayScale(double x_) {_headingFgGrayScale=x_;} void headingBgGrayScale(double x_) {_headingBgGrayScale=x_;} MSParagraph& grandTotalText(MSParagraph& x_) {_grandTotalText=x_; return _grandTotalText;} MSParagraph& grandTotalText(MSStringVector& x_) {_grandTotalText=x_; return _grandTotalText;} MSParagraph& grandTotalText(const char *x_) {_grandTotalText=x_; return _grandTotalText;} void report(MSReport *x_) {_report=x_;} void reportColumnSpacing(const MSFloatVector& x_) {_reportColumnSpacing=x_;} const MSParagraph& defaultText(void) const {return _defaultText;} MSParagraph& defaultText(void) {return _defaultText;} MSBoolean scaleHeaders(void) const { return _scaleHeaders;} void scaleHeaders(MSBoolean scaleHeaders_) { _scaleHeaders=scaleHeaders_;} // Group Headings // void removeGroupHeading(const MSSymbol&); void removeAllGroupHeadings(void); MSParagraph& addGroupHeading(const MSParagraph&); MSParagraph& addGroupHeading(const MSStringVector&); MSParagraph& reportGroupHeading(const MSSymbol&); const MSParagraph& reportGroupHeading(const MSSymbol&) const; // // row/column/page control // const MSUnsignedVector& leading(void) const {return _leading;} unsigned long outputStyle(void) const {return _outputStyle;} unsigned widowRows(void) const {return _widowRows;} unsigned orphanRows(void) const {return _orphanRows;} unsigned rowPageSpan(void) const {return _rowPageSpan;} unsigned columnPageSpan(void) const {return _columnPageSpan;} const MSUnsignedVector& rowControl(void) const {return _rowControl;} const MSUnsignedVector& columnControl(void) const {return _columnControl;} unsigned newspaperColumns(void) const {return _newspaperColumns;} void leading(const MSUnsignedVector& x_) {_leading=x_;} void outputStyle(MSP::OutputStyle x_) {_outputStyle=x_;} void outputStyle(unsigned long x_) {_outputStyle=x_;} void rowPageSpan(unsigned x_) {_rowPageSpan=x_;} void columnPageSpan(unsigned x_) {_columnPageSpan=x_;} void rowControl(const MSUnsignedVector& x_) {_rowControl=x_;} void columnControl(const MSUnsignedVector& x_) {_columnControl=x_;} void newspaperColumns(unsigned x_) {_newspaperColumns=x_>0?x_:1;} // // internal values for diagnostics // const MSIndexVector& columnIndex(void) const {return _columnIndex;} const MSIndexVector& columnPageBreak(void) const {return _columnPageBreak;} const MSIndexVector& rowPageBreak(void) const {return _rowPageBreak;} const MSIndexVector& stackPageBreak(void) const {return _stackPageBreak;} const MSIndexVector& tableWidths(void) const {return _tableWidths;} // // for printing with MSPrintTool // virtual const MSSymbol& printTag(void) const; void computeTableRowColumnSize(void); void setTableParameters(void); void computeGroupHeadingSize(void); void computeTableHeadingSize(void); void computeColumnPartitions(void); void computeRowColumnPartitions(void); void computeRowPartitions(double); void computeRowPartitions(int,double); void computeXFontScale(int); void computeYFontScale(int); void computePageIndices(int,int&,int&); int computeTableSegmentHeight(int,int); void computeTableHeaderSize(int); void computeTableFooterSize(int); void computeBreakTextSizes(void); void computeBreakTextSize(MSParagraph&); int tableHeaderHeight(void); int tableFooterHeight(void); int tablePageSize(int); int setTableX(int,int); int setTableY(int,int); int columnsPerPage(int); int rowsPerPage(int); int leading(int); int reportColumnSpacing(int); void printCellBox(unsigned long,int,int,int,int); void printTableHeadings(int,int); void printTableRows(int,int,int,int); void printTableFrame(int,int,int,int); void printBreakText(MSParagraph&,int); void printTableHeaders(int,int); void printTableFooters(int,int); int printTableSegment(int,int); void printTableScale(int,int); void printASCIITable(void); void printGroupHeadings(int,int); void printGroupHeadingBox(unsigned long,int,int,int,int,int); void sortGroupHeadingsByColumn(void); void sortTextListByRow(MSPointerArray&); MSReportTable& leftMargin(double); MSReportTable& rightMargin(double); MSReportTable& topOffset(double); MSReportTable& bottomOffset(double); MSReportTable& topPixel(unsigned); MSReportTable& bottomPixel(unsigned); MSReportTable& justification(MSAlignment); MSReportTable& justification(unsigned long); MSReportTable& printRow(int); MSReportTable& printColumn(int); MSReportTable& reportFont(const char *); MSReportTable& style(unsigned long); MSReportTable& widowRows(unsigned); MSReportTable& orphanRows(unsigned); MSReportTable& pageAlignment(MSAlignment); MSReportTable& pageAlignment(unsigned long); double leftMargin(void) const; double rightMargin(void) const; double topOffset(void) const; double bottomOffset(void) const; unsigned topPixel(void) const; unsigned bottomPixel(void) const; unsigned long justification(void) const; int printRow(void) const; int printColumn(void) const; const MSString& reportFont(void) const; unsigned long pageAlignment(void) const {return MSPrintItem::pageAlignment();} int tableLeft(void) const {return _tableLeft;} int tableRight(void) const {return _tableRight;} int tableTop(void) const {return _tableTop;} int tableBottom(void) const {return _tableBottom;} int pageWidth(void) const {return _pageWidth;} int pageHeight(void) const {return _pageHeight;} void tableLeft(int x_) {_tableLeft=x_;} void tableRight(int x_) {_tableRight=x_;} void tableTop(int x_) {_tableTop=x_;} void tableBottom(int x_) {_tableBottom=x_;} void pageWidth(int x_) {_pageWidth=x_;} void pageHeight(int x_) {_pageHeight=x_;} int tableTopPosition(int); int tableBottomPosition(int); const MSString& delimiter(void) const {return _delimiter;} void delimiter(const MSString& x_) {_delimiter=x_;} protected: void init(void); void clearBreaks(void); void resetColumnLocations(); void maxRowsClear(void); void maxRowsSet(unsigned); virtual void updateScreen(void); virtual void breakProcess(MSIndexVector&); virtual void computeColumnTotals(void); virtual void addColumn(MSTableColumn *); virtual void removeColumn(MSTableColumn *); virtual unsigned long convertForeground(const char *); virtual unsigned long style(unsigned,unsigned); virtual unsigned long breakStyle(unsigned,unsigned); virtual int breakOffset(unsigned,unsigned); virtual int breakLeading(unsigned,unsigned); virtual const char *reportFont(unsigned,unsigned); virtual const char *breakFont(unsigned,unsigned); virtual double fgGrayScale(unsigned,unsigned); virtual double bgGrayScale(unsigned,unsigned); MSParagraph *groupHeading(unsigned); const MSParagraph *groupHeading(unsigned) const; MSParagraph& grandTotalBaseText(void) {return *_grandTotalBaseText;} MSPointerArray *columnList(void) const {return _columnList;} MSPointerArray *columnList(void) {return _columnList;} MSPointerArray *hiddenColumnList(void) const {return _hiddenColumnList;} MSPointerArray *hiddenColumnList(void) {return _hiddenColumnList;} MSPointerArray *breakTextList(void) const {return _breakTextList;} MSPointerArray *breakTextList(void) {return _breakTextList;} MSPointerArray *groupHeadingList(void) const {return _groupHeadingList;} MSPointerArray *groupHeadingList(void) {return _groupHeadingList;} int headingHeight(void) const {return _headingHeight;} int orphanRowHeight(void) const {return _orphanRowHeight;} MSIndexVector& columnIndex(void) {return _columnIndex;} MSIndexVector& columnPageBreak(void) {return _columnPageBreak;} MSIndexVector& rowPageBreak(void) {return _rowPageBreak;} MSIndexVector& stackPageBreak(void) {return _stackPageBreak;} MSIndexVector& tableWidths(void) {return _tableWidths;} MSIntVector& rowHeights(void) {return _rowHeights;} MSIntVector& rowLeadings(void) {return _rowLeadings;} MSIntVector& columnWidths(void) {return _columnWidths;} MSIntVector& groupHeadingHeights(void) {return _groupHeadingHeights;} int groupHeadingHeight(void) {return _groupHeadingHeight;} void groupHeadingHeight(int x_) {_groupHeadingHeight=x_;} void headingHeight(int x_) {_headingHeight=x_;} void orphanRowHeight(int x_) {_orphanRowHeight=x_;} double x_printScale(void) {return _x_printScale;} double y_printScale(void) {return _y_printScale;} void x_printScale(double x_) {_x_printScale=x_;} void y_printScale(double x_) {_y_printScale=x_;} int pageCountTotal(void) const {return _pageCountTotal;} int totalSegments(void) const {return _totalSegments;} int segment(void) const {return _segment;} int stackCount(void) const {return _stackCount;} int lastPageCount(void) const {return _lastPageCount;} void pageCountTotal(int x_) {_pageCountTotal=x_;} void totalSegments(int x_) {_totalSegments=x_;} void segment(int x_) {_segment=x_;} void stackCount(int x_) {_stackCount=x_;} void lastPageCount(int x_) {_lastPageCount=x_;} ////////////////////////////////////////////////////////////////////////// // // table report methods // ////////////////////////////////////////////////////////////////////////// int breakCount(void) const {return _breakCount;} int breakTextCount(void) const {return _breakTextCount;} int columnCount(void) const {return _columnCount;} int rowCount(void) const {return _rowCount;} int numFixedFields(void) const {return _numFixedFields;} int fixedFieldWidth(void) const {return _fixedFieldWidth;} void breakCount(int x_) {_breakCount=x_;} void breakTextCount(int x_) {_breakTextCount=x_;} void columnCount(int x_) {_columnCount=x_;} void rowCount(int x_) {_rowCount=x_;} void numFixedFields(int x_) {_numFixedFields=x_;} void fixedFieldWidth(int x_) {_fixedFieldWidth=x_;} MSIndexVector& breakTextIndex(void) {return _breakTextIndex;} MSParagraph *breakText(unsigned i_) {return breakTextList()->array(i_);} void breakText(MSParagraph *x_); unsigned long _headingForeground; int _fixedReportColumns; private: MSIndexVector _breakTextIndex; int _breakCount; int _breakTextCount; int _rowCount; int _columnCount; int _numFixedFields; int _fixedFieldWidth; int _lastPageCount; MSString _delimiter; MSReport *_report; MSParagraph _grandTotalText; MSParagraph *_grandTotalBaseText; MSParagraph _defaultText; MSFloat _grandTotal; MSSymbol _tag; unsigned _numRows; unsigned long _style; unsigned long _breakStyle; int _breakOffset; int _breakLeading; double _fgGrayScale; double _bgGrayScale; double _headingFgGrayScale; double _headingBgGrayScale; MSString _reportTotalFont; MSString _breakFont; MSString _reportHeadingFont; MSStringVector _reportTitle; unsigned long _headingStyle; unsigned long _reportTotalStyle; MSFloatVector _reportColumnSpacing; MSIndexVector _columnIndex; MSIndexVector _columnPageBreak; MSIndexVector _rowPageBreak; MSIndexVector _stackPageBreak; MSIndexVector _tableWidths; MSIndexVector _breakIndex; MSIndexVector _pageBreakIndex; MSIndexVector _breakColumn; MSIndexVector _breakTextColumn; MSBoolean _reportTotalOn; MSBoolean _reportGrandTotalOn; MSBoolean _pageTotalOn; int _reportTotalLeading; int _headingHeight; int _orphanRowHeight; int _reportHeadingOffset; MSIntVector _rowHeights; MSIntVector _columnWidths; MSIntVector _rowLeadings; MSIntVector _groupHeadingHeights; int _groupHeadingHeight; MSUnsignedVector _rowControl; MSUnsignedVector _columnControl; MSUnsignedVector _leading; unsigned _widowRows; unsigned _orphanRows; unsigned _rowPageSpan; unsigned _columnPageSpan; unsigned _newspaperColumns; unsigned _frameOffset; unsigned _frameLineWidth; unsigned long _frameStyle; unsigned long _outputStyle; double _x_printScale; double _y_printScale; int _tableLeft; int _tableRight; int _tableTop; int _tableBottom; int _pageWidth; int _pageHeight; int _segment; int _totalSegments; int _pageCountTotal; int _stackCount; int _printPage; MSBoolean _scaleHeaders; int _topMargin; MSPointerArray *_groupHeadingList; MSPointerArray *_breakTextList; MSPointerArray *_columnList; MSPointerArray *_hiddenColumnList; }; inline MSParagraph *MSReportTable::groupHeading(unsigned i_) {return (groupHeadingList()!=0)?groupHeadingList()->array(i_):0;} inline const MSParagraph *MSReportTable::groupHeading(unsigned i_) const {return (groupHeadingList()!=0)?groupHeadingList()->array(i_):0;} inline void MSReportTable::maxRowsClear(void) {_numRows=0;} inline unsigned MSReportTable::numRows(void) const {return _numRows;} // We provide explicit "do_not_instantiate" pragmas here to avoid instantiation complications in // MStk applications. // #if !defined(__MSGUILIBRARY_BUILD__) && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma do_not_instantiate MSPointerArray #pragma do_not_instantiate MSPointerArray #endif // !__MSGUILIBRARY_BUILD__ && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #endif aplus-fsf-4.22/src/MSGUI/MSResourceChangeCallback.H0000644000265000001440000000132310772770431015363 #ifndef MSResourceChangeCallbackHEADER #define MSResourceChangeCallbackHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1998-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSWidget; class MSGUIExport MSResourceChangeCallback : public MSCallback { protected: MSWidget *_widget; public: MSResourceChangeCallback(MSWidget *widget_=0) :_widget(widget_) {} MSWidget *widget(void) {return _widget;} virtual void process(void) {} virtual void resourceChanged(const char *)=0; }; #endif aplus-fsf-4.22/src/MSGUI/MSResourceChangeMethodCallback.H0000644000265000001440000000160110772770431016523 #ifndef MSResourceChangeMethodCallbackHEADER #define MSResourceChangeMethodCallbackHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1998-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include template class MSResourceChangeMethodCallback : public MSResourceChangeCallback { typedef void (WidgetClass::*Method)(const char *); private: Method _method; public: MSResourceChangeMethodCallback(WidgetClass *widget_,Method method_) : MSResourceChangeCallback(widget_),_method(method_) {} virtual void resourceChanged(const char *newValue_) { if (_widget!=0&&_method!=0) (((WidgetClass *)_widget)->*_method)(newValue_); } }; #endif aplus-fsf-4.22/src/MSGUI/MSRowColumnView.H0000644000265000001440000003067410772770431013644 #ifndef MSRowColumnViewHEADER #define MSRowColumnViewHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #include #include #include #include #include #include class MSGUIExport MSRowColumnView : public MSCompositeText, public MSDoubleClick { public: class MSGUIExport Panner : public MSPrimitive { friend class MSRowColumnView; public: Panner(MSWidget *owner_); ~Panner(void); virtual void redraw(void); protected: virtual void expose(const XEvent *); }; class MSGUIExport Editor : public MSTextField { public: Editor(MSWidget *owner_); ~Editor(void); virtual void up(void); virtual void down(void); virtual void tab(void); virtual void shiftTab(void); virtual void activate(void); virtual void escape(void); }; class MSGUIExport Vsb : public MSVScrollBar { protected: virtual void change(void); public: Vsb(MSWidget *owner_); ~Vsb() {} }; class MSGUIExport Hsb : public MSHScrollBar { protected: virtual void change(void); public: Hsb(MSWidget *owner_); ~Hsb() {} }; class MSGUIExport CycleTimer : public MSIntervalTimer { protected: MSRowColumnView *_array; public: CycleTimer(MSRowColumnView *,unsigned long); ~CycleTimer(void); virtual void process(void); }; friend class Panner; friend class Editor; friend class Vsb; friend class Hsb; friend class CycleTimer; public: int rows(void) const; void rows(int); int columns(void) const; void columns(int); int firstRow(void) const; void firstRow(int); int firstColumn(void) const; void firstColumn(int); int spacing(void) const; void spacing(int); void selectionMode(MSSelectionMode); MSSelectionMode selectionMode(void) const; const MSUnsignedLongVector& foregroundColors(void) const; void foregroundColors(const MSUnsignedLongVector&); void foregroundColors(const MSStringVector&); const MSUnsignedLongVector& backgroundColors(void) const; void backgroundColors(const MSUnsignedLongVector&); void backgroundColors(const MSStringVector&); const MSUnsignedLongVector& cycleColors(void) const; void cycleColors(const MSUnsignedLongVector&); void cycleColors(const MSStringVector&); MSCycleColorMode cycleColorMode(void) const; void cycleColorMode(MSCycleColorMode); unsigned long cycleInterval(void) const; void cycleInterval(unsigned long); int scrollBarSize(void) const; void scrollBarSize(int); int vsbSize(void) const; void vsbSize(int); int hsbSize(void) const; void hsbSize(int); MSBoolean isVsbEnabled(void) const; void showVsb(void); void hideVsb(void); MSBoolean isHsbEnabled(void) const; void showHsb(void); void hideHsb(void); unsigned long vsbBackground(void) const; void vsbBackground(unsigned long pixel_); void vsbBackground(const char *color_); unsigned long hsbBackground(void) const; void hsbBackground(unsigned long pixel_); void hsbBackground(const char *color_); unsigned long editorBackground(void) const; void editorBackground(unsigned long pixel_); void editorBackground(const char *color_); unsigned long editorForeground(void) const; void editorForeground(unsigned long pixel_); void editorForeground(const char *color_); int selectedRow(void) const; void selectedRow(int); const MSIndexVector& selectionVector(void) const; void selectionVector(const MSIndexVector&); unsigned long selectedRowBackground(void) const; void selectedRowBackground(unsigned long pixel_); void selectedRowBackground(const char *color_); void rowDragDrop(MSBoolean rowDragDrop_); MSBoolean rowDragDrop(void) const; virtual void moveRow(int from_, int to_); virtual void set(MSAttrValueList& avList_); virtual MSAttrValueList& get(MSAttrValueList& avList_); //The following are key press handlers virtual void pageUp(void); virtual void pageDown(void); virtual void home(void); virtual void end(void); virtual void up(void); virtual void down(void); virtual void left(void); virtual void right(void); virtual void increment(void); virtual void decrement(void); virtual void tab(void); virtual void shiftTab(void); virtual void returnKey(void); virtual void backspace(void); virtual void doubleClick(void); virtual void insertAbove(void); virtual void insertBelow(void); virtual void deleteKey(void); virtual void edit(void); virtual MSBoolean editorActivate(void); MSBoolean editing(void) const; virtual void mapEditor(void); virtual void unmapEditor(void); virtual MSString selection(void); // Override some methods from MSWidget class virtual void redraw(void); virtual void print(const char *file_=0); virtual void naturalSize(void); virtual void unfreeze(void); unsigned long addEditorKeyCallback( const char*,MSKeyCallback*); void removeEditorKeyCallback(unsigned long); void removeEditorKeyCallback(const char*); protected: enum {VsbEnabled=1,HsbEnabled=2}; enum SizeState{Valid=0,Invalid=1,RowsValid=2,ColsValid=4,AdjustSize=8}; MSRowColumnView(MSWidget *,const char *title_=0); MSRowColumnView(MSWidget *,const MSStringVector&); ~MSRowColumnView(void); //Attributes int _rows; int _columns; int _firstRow; int _firstColumn; int _spacing; int _selectedRow; MSSelectionMode _selectionMode; MSIndexVector _selectionVector; unsigned long _rowBg; // selected row background MSUnsignedLongVector _foregroundColors; MSUnsignedLongVector _backgroundColors; MSUnsignedLongVector _cycleColors; MSCycleColorMode _cycleMode; unsigned long _cycleInterval; //Data member to support implementation Vsb *_vsb; Hsb *_hsb; Panner *_panner; MSLabel *_label; Editor *_editor; MSBackingStorePixmap *_redrawPixmap; int _naturalRows; int _naturalCols; int _rowSpacing; int _columnSpacing; unsigned long _sizeState; // does the size need to be adjusted unsigned long _scrollBarState; // are the scrollbars enabled or disabled MSUnsignedLongVector _cycleList; CycleTimer *_cycleTimer; MSGC _selectionVectorMSGC; int _rowHeight; int _headingsHeight; int _lastBlock; MSDisplayCursor *_dragRowCursor; Window _dragRowWindow; MSBoolean _rowDragDrop; //Accessors to implementation data MSDisplayCursor *dragRowCursor(void) { return _dragRowCursor;} Window dragRowWindow(void) { return _dragRowWindow;} Vsb *vsb(void) const; Hsb *hsb(void) const; Panner *panner(void) const; MSLabel *label(void) const; Editor *editor(void) const; MSBackingStorePixmap *redrawPixmap(void) const; int naturalRows(void) const; int naturalCols(void) const; int rowSpacing(void) const; int columnSpacing(void) const; unsigned long sizeState(void) const; unsigned long scrollBarState(void) const; MSUnsignedLongVector &cycleList(void); CycleTimer *cycleTimer(void) const; MSGC& selectionVectorMSGC(void); GC selectionVectorGC(void) const; void headingsHeight(int); virtual int headingsHeight(void); void rowHeight(int); virtual int rowHeight(void); void lastBlock(int block_); int lastBlock(void) const; virtual int clearSelection(void); void init(void); void initKeyTranslations(void); void initHsb(void); void initVsb(void); virtual void redrawImmediately(void); virtual void configure(void); virtual void computeSize(void); virtual void placement(void); virtual void updateData(void); virtual void adjustSize(void); virtual void adjustView(void); // for subclass to override virtual void adjustNumVisible(void); // for subclass to override virtual void adjustFirstRow(void); // for subclass to override virtual void adjustFirstColumn(void); // for subclass to override virtual void defaultNumVisible(void); // for subclass to override virtual int yToRow(int); virtual int inRowRange(int); virtual int rowFromEvent(const XEvent *); virtual int xToColumn(int); virtual int inColRange(int); virtual int columnFromEvent(const XEvent *); virtual int computeYCoord(int row_); void removeAllCycles(void); void removeCycle(MSColorCycle *); void startCycle(int,int,const MSUnsignedLongVector&,MSCycleColorMode); virtual void cycleCell(MSColorCycle *); // for subclass to override virtual void drawRow(int); // for subclass to override virtual void drawRows(int,int); // for subclass to override virtual void drawSelectedRow(int,MSBoolean); virtual void undrawSelectedRow(int); virtual void moveEditorToSelection(const MSString &); // for subclass to override virtual void keyPress(const XEvent *,KeySym,unsigned int,const char *); virtual void buttonPress(const XEvent *); virtual void buttonRelease(const XEvent *); virtual void defaultButtonBehavior(const XEvent *); virtual void defaultDoubleClickBehavior(const XEvent *); virtual void defaultButton1Behavior(const XEvent *); virtual void defaultButton2Behavior(const XEvent *); virtual void defaultButton3Behavior(const XEvent *); virtual int dragRowFromEvent(const XEvent *); virtual void dragRow(const XEvent *); virtual void shuffleRow(int from_, int to_); virtual void startEditing(const XEvent *); // for subclass to override virtual void expose(const XEvent *); virtual void firstMapNotify(void); virtual void processCycleTimer(void); virtual int drawWidth(void); // for subclass to override virtual int drawHeight(void); // for subclass to override virtual unsigned numColumns(void) const; // for subclass to override; virtual unsigned numRows(void) const; // for subclass to override; virtual int lastColumn(void); virtual int lastRow(void); MSBoolean selected(unsigned); virtual void scrollUp(int count_); virtual void scrollUp(int,int,MSBoolean drawNewRow_=MSTrue); virtual void scrollDown(int count_); virtual void scrollDown(int,int,MSBoolean drawNewRow_=MSTrue); virtual void scrollRight(int); virtual void scrollLeft(int); virtual void postVerticalScrollDraw(int,int,MSBoolean); virtual void drawSelected(int); // for subclass to override virtual void undrawSelected(int); // for subclass to override virtual void fillSelection(int,int); virtual void unfillSelection(int,int); // Events from scrollbars virtual void hsbValueUpdate(void); // for subclass to override virtual void vsbValueUpdate(void); // for subclass to override // Update scrollbars' views virtual void updateScrollBars(void); virtual void updateHsb(void); // for subclass to override virtual void updateVsb(void); // for subclass to override virtual void updateInternalState(void); // for subclass to override virtual void calculateRowHeight(void); virtual void calculateHeadingsHeight(void); // The following methods activate callbacks virtual void firstColumnChangeNotify(void); virtual void firstRowChangeNotify(void); virtual void rowSelection(void); virtual void rowMovedNotify(void); // The following methods are called in response to public attribute changes virtual void updateBackground(unsigned long); virtual void updateForeground(unsigned long); virtual void updateFont(Font); virtual void updateTitle(void); virtual void updateFirstRow(int); virtual void updateFirstColumn(int); virtual void updateSelectedRow(int); virtual void updateSelectionVector(const MSIndexVector&); virtual void updateSelectionMode(MSSelectionMode); }; #ifndef MS_NO_INLINES #ifndef MSRowColumnViewINLINES #include #endif #endif #endif aplus-fsf-4.22/src/MSGUI/MSScale.H0000644000265000001440000004140710772770431012107 #ifndef MSScaleHEADER #define MSScaleHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #include class MSGUIExport MSScale : public MSPrimitive { friend class ValueWin; public: MSScale(MSWidget *,const char *title_=0); MSScale(MSWidget *,const MSStringVector&); MSScale(MSWidget *,MSFloat& model_,const char *title_=0); MSScale(MSWidget *,MSFloat& model_,const MSStringVector&); MSScale(MSWidget *,MSInt& model_,const char *title_=0); MSScale(MSWidget *,MSInt& model_,const MSStringVector&); ~MSScale(void); virtual void naturalSize(void); virtual void redraw(void); virtual void print(const char *file_=0); virtual void sliderSize(int); virtual int sliderSize(void) const; virtual double currentValue(void); virtual double currentValue(void) const; unsigned long titleAlignment(void) const {return _titleAlignment;} const MSStringVector& subtitle(void) const {return _subtitle;} Font subtitleFont(void) const {return _subtitleFont;} unsigned long subtitleForeground(void) const {return _subtitleForeground;} unsigned long subtitleAlignment(void) const {return _subtitleAlignment;} const MSStringVector& mintitle(void) const {return _mintitle;} unsigned long mintitleForeground(void) const {return _mintitleForeground;} unsigned long mintitleAlignment(void) const {return _mintitleAlignment;} Font mintitleFont(void) const {return _mintitleFont;} const MSStringVector& maxtitle(void) const {return _maxtitle;} unsigned long maxtitleForeground(void) const {return _maxtitleForeground;} unsigned long maxtitleAlignment(void) const {return _maxtitleAlignment;} Font maxtitleFont(void) const {return _maxtitleFont;} Font labelFont(void) const {return _labelFont;} unsigned long labelForeground(void) const {return _labelForeground;} double labelInc(void) const {return _labelInc;} unsigned long labelAlignment(void) const {return _labelAlignment;} MSLabelOutPtr labelOut(void) const {return _labelOut; } double valueMin(void) const {return _valueMin;} double valueMax(void) const {return _valueMax;} double valueInc(void) const {return _valueInc;} double valuePageInc(void) const {return _valuePageInc;} double valueChange(void) const {return _valueChange;} unsigned long valueForeground(void) const {return _valueWin->foreground();} unsigned long valueAlignment(void) const {return _valueAlignment;} Font valueFont(void) const {return _valueWin->font();} MSBoolean valueSensitive(void) const {return _valueWin->sensitive();} int majorTickSize(void) const {return _majorTickSize;} int minorTickSize(void) const {return _minorTickSize;} int minorTickCount(void) const {return _minorTickCount;} unsigned long sliderForeground(void) const {return _slider->foreground();} unsigned long sliderBackground(void) const {return _slider->background();} void titleAlignment(unsigned long); void subtitle(const MSStringVector& ); void subtitleAlignment(unsigned long); void subtitleForeground(unsigned long); void subtitleForeground(const char *); void subtitleFont(Font); void subtitleFont(const char *); void mintitle(const MSStringVector&); void mintitleAlignment(unsigned long); void mintitleForeground(unsigned long); void mintitleForeground(const char *); void mintitleFont(Font); void mintitleFont(const char *); void maxtitle(const MSStringVector&); void maxtitleAlignment(unsigned long); void maxtitleForeground(unsigned long); void maxtitleForeground(const char *); void maxtitleFont(Font); void maxtitleFont(const char *); void labelFont(Font); void labelFont(const char *); void labelAlignment(unsigned long); void labelForeground(unsigned long); void labelForeground(const char *); void labelInc(double); void labelOut(MSLabelOut *); void labelOut(MSLabelOutPtr); void sliderForeground(unsigned long); void sliderForeground(const char *); void sliderBackground(unsigned long); void sliderBackground(const char *); void valueMin(double); void valueMax(double); void valueInc(double); void valuePageInc(double); void valueChange(double); void valueAlignment(unsigned long); void valueForeground(unsigned long); void valueForeground(const char *); void valueFont(Font); void valueFont(const char *); void valueSensitive(MSBoolean); void majorTickSize(int); void minorTickSize(int); void minorTickCount(int); void model(MSFloat&); void model(const MSFloat&); void model(MSInt&); void model(const MSInt&); MSModel& viewModel(void) { return *_model; } const MSModel& viewModel(void) const { return *_model; } const MSSymbol& modelType(void) const { return _modelType; } MSScale& operator=(const MSFloat& x_) {value(x_); return *this;} MSScale& operator=(double x_) {value(x_); return *this;} MSScale& operator=(const MSInt& x_) {value(x_); return *this;} MSScale& operator=(int x_) {value(x_); return *this;} operator double() const {return (double)asFloat();} // operator int() const {return (int)asInt();} MSInt asInt(void) const; MSFloat asFloat(void) const; const MSFormat& format(void) const; void format(const MSFormat&); const char *formatValue(MSString &,double); unsigned long addEditorKeyCallback( const char*,MSKeyCallback*); void removeEditorKeyCallback(unsigned long); void removeEditorKeyCallback(const char*); virtual void set(MSAttrValueList&); virtual MSAttrValueList& get(MSAttrValueList&); class MSGUIExport Slider:public MSWidgetCommon { friend class MSScale; public: Slider(MSWidget *); ~Slider(void); virtual void drawSliderEtch(void); virtual void adjustSize(int,int); virtual void moveTo(int,int); virtual void redraw(void); int offset(void) const {return highlightThickness()+shadowThickness();} protected: MSScale *scale(void) {return (MSScale *)owner();} GC gc(void) {return _gc;} void setValueWinXCoord(int); void setValueWinYCoord(int); virtual void configure(void); virtual void button1Press(const XEvent *); private: GC _gc; }; class MSGUIExport ValueWin:public MSWidgetCommon { public: ValueWin(MSWidget *); ~ValueWin(void); virtual void updateValue(const char *); MSScale *scale(void) const {return (MSScale *)owner();} int textHeight(void) const {return _fontInfo->ascent+_fontInfo->descent;} int offset(void) const {return _offset;} int x_org(void) const {return _x_org;} int y_org(void) const {return _y_org;} GC gc(void) const {return _gc;} XFontStruct *fontInfo(void) const {return _fontInfo;} void offset(int x_) {_offset=x_;} void x_org(int x_) {_x_org=x_;} void y_org(int x_) {_y_org=x_;} private: int _minWidth; int _offset; int _x_org; int _y_org; GC _gc; XFontStruct *_fontInfo; virtual void redraw(void); virtual void updateFont(Font); virtual void updateForeground(unsigned long); }; class MSGUIExport Editor:public MSTextField { friend class MSScale; public: Editor(MSWidget *); ~Editor(void); virtual void activate(void); virtual void escape(void); }; class MSGUIExport DelayTimer:public MSRegularTimer { public: DelayTimer(MSScale *,unsigned long); ~DelayTimer(void); virtual void process(void); protected: MSScale *_scale; }; class MSGUIExport RepeatTimer:public MSIntervalTimer { public: RepeatTimer(MSScale *,unsigned long); ~RepeatTimer(void); virtual void process(void); protected: MSScale *_scale; }; friend class Slider; friend class Editor; friend class DelayTimer; friend class RepeatTimer; friend class MSHScale; friend class MSVScale; protected: GC gc(void) {return _gc;} MSLabelFormat& outFmt(void) {return _outFormat;} DelayTimer *delayTimer(void) const {return _delayTimer;} RepeatTimer *repeatTimer(void) const {return _repeatTimer;} ValueWin *valueWin(void) const {return _valueWin;} Slider *slider(void) const {return _slider;} Editor *editor(void) const {return _editor;} MSRect& sliderAreaRect(void) {return _sliderAreaRect;} const MSRect& sliderAreaRect(void) const {return _sliderAreaRect;} int x_org(void) const {return sliderAreaRect().x();} int x_end(void) const {return x_org()+sliderAreaRect().width();} int y_org(void) const {return sliderAreaRect().y();} int y_end(void) const {return y_org()+sliderAreaRect().height();} double incData(void) const {return _incData;} double base(void) const {return _base;} double scale(void) const {return _scale;} int titleHeight(void) const {return _titleHeight;} int titleWidth(void) const {return _titleWidth;} int mintitleWidth(void) const {return _mintitleWidth;} int mintitleHeight(void) const {return _mintitleHeight;} int maxtitleWidth(void) const {return _maxtitleWidth;} int maxtitleHeight(void) const {return _maxtitleHeight;} int topOffset(void) const {return _topOffset;} int bottomOffset(void) const {return _bottomOffset;} int leftOffset(void) const {return _leftOffset;} int rightOffset(void) const {return _rightOffset;} int naturalScaleSize(void) const {return _naturalScaleSize; } MSBoolean internalUpdateStatus() const {return _internalUpdateStatus;} void value(const MSFloat&); void value(const MSInt&); void value(double); void value(int); void base(double x_) {_base=x_;} void scale(double x_) {_scale=x_;} void incData(double x_) {_incData=x_;} void titleHeight(int x_) {_titleHeight=x_;} void titleWidth(int x_) {_titleWidth=x_;} void naturalScaleSize(int x_) {_naturalScaleSize=x_; } void internalUpdateStatus(MSBoolean x_) {_internalUpdateStatus=x_;} void setValue(double); void mintitleHeight(int x_) {_mintitleHeight=x_;} void maxtitleHeight(int x_) {_maxtitleHeight=x_;} void mintitleWidth(int x_) {_mintitleWidth=x_;} void maxtitleWidth(int x_) {_maxtitleWidth=x_;} void topOffset(int x_) {_topOffset=x_;} void bottomOffset(int x_) {_bottomOffset=x_;} void leftOffset(int x_) {_leftOffset=x_;} void rightOffset(int x_) {_rightOffset=x_;} void labelOffset(int x_) {_labelOffset=x_;} void labelSpacing(int x_) {_labelSpacing=x_;} void sliderWidth(int x_) {_slider->width(x_);} void sliderHeight(int x_) {_slider->height(x_);} int labelOffset(void) {return _labelOffset;} int labelSpacing(void) {return _labelSpacing;} int sliderWidth(void) {return _slider->width();} int sliderHeight(void) {return _slider->height();} const char *formatLabel(MSString &buffer_,double x_) {return labelOut()->formatOutput(buffer_,x_);} virtual double pixelToValue(int); virtual int valueToPixel(double); virtual int incFactor(int,int); void drawTitles(void); void processDelayTimer(void); void processRepeatTimer(void); virtual void update(const MSIndexVector&); virtual MSBoolean assignValue(double); virtual void drawSliderEtch(void); virtual void sliderRedrawNotify(); virtual void drawTickLabels(void); virtual void drawSliderTitles(void); virtual void moveSlider(const XEvent *); virtual void editValue(const char *); void drawSliderValue(void); void startDelayTimer(void); void startRepeatTimer(void); void stopRepeatTimer(void); void updateSliderValue(void); void startTimedUpdate(void); virtual void drawSubWindows(void); virtual void drawSliderArea(void); virtual void computeLabelOffset(void); virtual void computeSliderAreaSize(void); virtual void computeSliderScale(void); virtual void computeTickInc(void); virtual void computeValueWinSize(void); virtual void focusIn(void); virtual void focusOut(void); virtual MSBoolean loseFocus(void); virtual void buttonPress(const XEvent *); virtual void button1Press(const XEvent *); virtual void button2Press(const XEvent *); virtual void button3Press(const XEvent *); virtual void buttonRelease(const XEvent *); virtual void keyPress(const XEvent *,KeySym,unsigned int,const char *); virtual void keyRelease(const XEvent *,KeySym,unsigned int,const char *); virtual void keyRelease(const XEvent *); virtual void editorActivate(void); virtual void editorEscape(void); virtual MSBoolean validate(const char *); virtual void computeSize(void); virtual void configure(void); virtual void firstMapNotify(void); virtual void setSliderPosition(int); virtual void updateTitle(void); virtual void updateFormat(void); virtual void updateData(void); void init(void); virtual void updateBackground(unsigned long); virtual void updateForeground(unsigned long); virtual void updateFont(Font); virtual void home(void); virtual void end(void); virtual void up(void); virtual void down(void); virtual void pageUp(void); virtual void pageDown(void); virtual void left(void); virtual void right(void); private: GC _gc; unsigned long _titleAlignment; MSStringVector _subtitle; Font _subtitleFont; unsigned long _subtitleForeground; unsigned long _subtitleAlignment; MSStringVector _mintitle; unsigned long _mintitleForeground; unsigned long _mintitleAlignment; int _mintitleWidth; int _mintitleHeight; Font _mintitleFont; MSStringVector _maxtitle; unsigned long _maxtitleForeground; unsigned long _maxtitleAlignment; int _maxtitleWidth; int _maxtitleHeight; Font _maxtitleFont; unsigned long _labelForeground; Font _labelFont; double _labelInc; unsigned long _labelAlignment; MSLabelOutPtr _labelOut; int _labelOffset; int _labelSpacing; double _valueMin; double _valueMax; double _valueInc; double _valuePageInc; double _valueChange; unsigned long _valueAlignment; int _majorTickSize; int _minorTickSize; int _minorTickCount; Slider *_slider; ValueWin *_valueWin; double _scale; double _base; double _incData; int _titleHeight; int _titleWidth; int _topOffset; int _bottomOffset; int _leftOffset; int _rightOffset; int _naturalScaleSize; MSRect _sliderAreaRect; DelayTimer *_delayTimer; RepeatTimer *_repeatTimer; Editor *_editor; MSBoolean _repeatOn; MSBoolean _internalUpdateStatus; static MSLabelFormat _outFormat; static MSLabelOutPtr _defaultLabelOut; MSFormat _format; MSSymbol _modelType; }; inline const MSFormat& MSScale::format(void) const { return _format; } inline void MSScale::format(const MSFormat& format_) { _format=format_; } #endif aplus-fsf-4.22/src/MSGUI/MSScrollBar.H0000644000265000001440000001340110772770431012734 #ifndef MSScrollBarHEADER #define MSScrollBarHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include class MSScrollBar; class MSArrow; class MSGUIExport MSScrollBar : public MSPrimitive { public: class MSGUIExport DelayTimer : public MSRegularTimer { protected: MSScrollBar *_scrollbar; public: DelayTimer(MSScrollBar *,unsigned long); ~DelayTimer(void); virtual void process(void); }; class MSGUIExport RepeatTimer : public MSIntervalTimer { protected: MSScrollBar *_scrollbar; public: RepeatTimer(MSScrollBar *,unsigned long); ~RepeatTimer(void); virtual void process(void); }; class MSGUIExport PopupMenu : public MSPopupMenu { protected: MSScrollBar *_scrollbar; enum {Openlook=0,Motif=1,Windows=2,GotoTop=3,GotoBottom=4}; public: PopupMenu(MSScrollBar *); void scrollbar(MSScrollBar *scrollbar_); virtual void activate(void); }; class MSGUIExport Elevator : public MSWidgetCommon { friend class MSScrollBar; public: MSArrow *_arrow1; MSArrow *_arrow2; void drawArrows(void); virtual void configure(void); virtual void updateBackground(unsigned long); public: Elevator(MSScrollBar *); ~Elevator(void); MSArrow *arrow1(void) const; MSArrow *arrow2(void) const; MSScrollBar *scrollBar(void) const; virtual void draw(void); virtual void redraw(void); virtual void select(void); virtual void unselect(void); }; friend class DelayTimer; friend class RepeatTimer; friend class Elevator; friend class PopupMenu; public: enum Change {Inc,Dec,PageDown,PageUp,ValueChange,Drag,Home,End,NoChange}; enum Style {Openlook=0,Motif=1,Windows=2}; MSScrollBar(MSWidget *,int min_=0,int max_=100,int inc_=1); ~MSScrollBar(void); int min(void) const; int max(void) const; int inc(void) const; int pageInc(void) const; int value(void) const; int viewSize(void) const; MSScrollBar::Style style(void) const; static MSScrollBar::Style defaultStyle(void); void min(int); void max(int); void inc(int); void pageInc(int); void value(int); void viewSize(int); void valueChange(int); // changes value without invoking callbacks void view(int start_,int size_); // changes view without invoking callbacks void style(MSScrollBar::Style); static void defaultStyle(MSScrollBar::Style); virtual void redraw(void); protected: Elevator *_elevator; MSPixmap *_cablePixmap; int _value; int _savedValue; int _max; int _min; int _inc; int _pageInc; int _viewSize; MSBoolean _slidingOn; MSBoolean _markersOn; MSBoolean _elevatorOn; MSBoolean _repeatOn; int _separation_x; int _separation_y; int _initial_x; int _initial_y; MSRect _sliderAreaRect; DelayTimer *_delayTimer; RepeatTimer *_repeatTimer; MSScrollBar::Change _changeType; MSScrollBar::Style _style; MSRect& sliderAreaRect(void); MSPixmap *cablePixmap(void) const; Elevator *elevator(void) const; PopupMenu *popupMenu(void); MSScrollBar::Change changeType(void) const; MSTimer *delayTimer(void) const; MSTimer *repeatTimer(void) const; MSBoolean repeatOn(void) const; MSBoolean slidingOn(void) const; MSBoolean markersOn(void) const; MSBoolean elevatorOn(void) const; void init(void); void createPopupMenu(void); void processDelayTimer(void); void processRepeatTimer(void); virtual void redrawElevator(void); virtual void configureElevator(void); virtual void drawElevator(void); virtual void drawElevatorCable(void); virtual void drawPropIndicator(void); virtual void drawMarkers(void); virtual void drawArrows(void); void updateSliderValue(void); void setCablePixmap(void); virtual void adjustPointer(void); virtual void calcPropIndicator(void); void repeat(void); void delay(void); void startDelayTimer(void); void startRepeatTimer(void); void stopRepeatTimer(void); virtual int calcSliderValue(int,int); void release(void); // valueChange methods to be overriden by subclasses virtual void increment(void); virtual void decrement(void); virtual void pageDown(void); virtual void pageUp(void); virtual void drag(void); virtual void home(void); virtual void end(void); virtual void change(void); virtual void firstMapNotify(void); virtual void notify(int value_); virtual void expose(const XEvent*); virtual void buttonPress(const XEvent*); virtual void buttonRelease(const XEvent*); virtual void button1Press(const XEvent*); virtual void button2Press(const XEvent*); virtual void button3Press(const XEvent*); virtual void openlookButton1Press(const XEvent*); virtual void openlookButton2Press(const XEvent*); virtual void motifButton1Press(const XEvent*); virtual void motifButton2Press(const XEvent*); virtual void configure(void); virtual void configureForOpenlook(void); virtual void configureForMotif(void); virtual void configureForWindows(void); virtual void updateBackground(unsigned long); private: static MSScrollBar::Style _defaultStyle; }; #endif aplus-fsf-4.22/src/MSGUI/MSScrollableWidget.H0000644000265000001440000000736010772770431014306 #ifndef MSScrollableWidgetHEADER #define MSScrollableWidgetHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include class MSGUIExport MSScrollableWidget : public MSWidgetCommon { public: MSScrollableWidget(MSWidget *owner_); ~MSScrollableWidget(void); virtual void show(void); virtual void redraw(void); virtual void print(const char *file_=0); virtual void naturalSize(void); protected: class MSGUIExport Vsb : public MSVScrollBar { protected: virtual void drag(void); virtual void change(void); void scroll(void); MSScrollableWidget *scrollableWidget(void) const { return (MSScrollableWidget *)owner(); } public: Vsb(MSWidget *); ~Vsb(void); }; class MSGUIExport Hsb : public MSHScrollBar { protected: virtual void drag(void); virtual void change(void); void scroll(void); MSScrollableWidget *scrollableWidget(void) const { return (MSScrollableWidget *)owner(); } public: Hsb(MSWidget *); ~Hsb(void); }; class MSGUIExport ViewPort : public MSWidgetCommon { protected: friend class MSScrollableWidget; MSScrollableWidget *scrollableWidget(void) const { return (MSScrollableWidget *)owner(); } public: ViewPort(MSWidget *); void redraw(void); }; class MSGUIExport DrawAreaWidget : public MSWidgetCommon { protected: friend class MSScrollableWidget; MSScrollableWidget *scrollableWidget(void) const { return (MSScrollableWidget *)(owner()->owner()); } public: DrawAreaWidget(MSWidget *); virtual void redraw(void); }; friend class Vsb; friend class Hsb; friend class ViewPort; friend class DrawAreaWidget; Vsb *_vsb; Hsb *_hsb; ViewPort *_viewPort; DrawAreaWidget *_drawAreaWidget; int _naturalWidth; int _naturalHeight; Hsb *hsb(void) {return _hsb;} Vsb *vsb(void) {return _vsb;} MSWidgetCommon *viewPort(void) {return _viewPort;} DrawAreaWidget *drawAreaWidget(void) {return _drawAreaWidget;} int naturalWidth(void) {return _naturalWidth;} void naturalWidth(int naturalWidth_) {_naturalWidth=naturalWidth_;} int naturalHeight(void) {return _naturalHeight;} void naturalHeight(int naturalHeight_) {_naturalHeight=naturalHeight_;} void init(void); virtual void redrawScrollableWidget(void); virtual void redrawScrollableWidgetImmediately(void); virtual void firstMapNotify(void); virtual void computeSize(void); virtual void configure(void); virtual void expose(const XEvent *); virtual void focusIn(void); virtual void focusOut(void); virtual void updateBackground(unsigned long); // Convenient methods to map (x,y) coordinates from the Scrollable Widget // to the Draw Area and the View Port. void drawAreaXY(int &x_,int &y_); void viewPortXY(int &x_,int &y_); // Can be overriden by subclasses to get notification when // scrollbar is changed by the user, default implementation // moves the draw area accordingly virtual void vsbChange(void); virtual void hsbChange(void); virtual void drawAreaGeometry(int &x_,int &y_,int &w_,int &h_); virtual void moveDrawArea(int,int); virtual void resizeDrawArea(int,int); virtual void resizeViewPort(int,int); // To be provided by subclasses virtual void redrawDrawAreaImmediately(void); virtual void redrawDrawArea(void); // To be provided by subclasses virtual void redrawViewPortImmediately(void); virtual void redrawViewPort(void); }; #endif aplus-fsf-4.22/src/MSGUI/MSScrolledWindow.H0000644000265000001440000001014010772770431014005 #ifndef MSScrolledWindowHEADER #define MSScrolledWindowHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include class MSGUIExport MSScrolledWindow : public MSManager { class MSGUIExport Vsb : public MSVScrollBar { protected: virtual void drag(void); virtual void change(void); MSScrolledWindow *scrolledWindow(void) const { return (MSScrolledWindow *)owner(); } public: Vsb(MSWidget *); ~Vsb(void); }; class MSGUIExport Hsb : public MSHScrollBar { protected: virtual void drag(void); virtual void change(void); MSScrolledWindow *scrolledWindow(void) const { return (MSScrolledWindow *)owner(); } public: Hsb(MSWidget *); ~Hsb(void); }; friend class Vsb; friend class Hsb; public: enum ScrollBarDisplayPolicy{Static,AsNeeded}; MSScrolledWindow(MSWidget *); ~MSScrolledWindow(void); void scrollBarDisplayPolicy(ScrollBarDisplayPolicy); ScrollBarDisplayPolicy scrollBarDisplayPolicy(void) const; MSWidget *scrollWindow(void); const MSWidget *scrollWindow(void) const; MSScrollBar *vsb(void) const; MSScrollBar *hsb(void) const; int viewWidth(void) const; int viewHeight(void) const; int scrollBarSize(void) const; void viewHeight(int); void viewWidth(int); void scrollBarSize(int); void vsbBackground(unsigned long pixel_); void hsbBackground(unsigned long pixel_); void vsbBackground(const char *color_); void hsbBackground(const char *color_); virtual void show(void); virtual void naturalSize(void); virtual void print(const char *file_=0); virtual void set(MSAttrValueList& avList_); virtual MSAttrValueList& get(MSAttrValueList& avList_); protected: Vsb *_vsb; Hsb *_hsb; MSPrimitive *_clipWindow; MSWidget *_scrollWindow; int _viewHeight; int _viewWidth; ScrollBarDisplayPolicy _scrollBarDisplayPolicy; MSPrimitive *clipWindow(void) const; void init(void); virtual void computeSize(void); virtual void placement(void); virtual void pageUp(void); virtual void pageDown(void); virtual void home(void); virtual void end(void); virtual void focusIn(void); virtual void focusOut(void); virtual void childConfigure(MSWidget *); virtual void childCreate(MSWidget *); virtual void childDestroy(MSWidget *); virtual void childInsert(MSWidget *); virtual void childRemove(MSWidget *); virtual void visibilityObscured(void); virtual void visibilityUnobscured(void); virtual MSWidgetVector children(void); virtual void updateBackground(unsigned long); }; inline MSPrimitive *MSScrolledWindow::clipWindow(void) const { return _clipWindow; } inline MSScrollBar *MSScrolledWindow::vsb(void) const { return _vsb; } inline MSScrollBar *MSScrolledWindow::hsb(void) const { return _hsb; } inline MSWidget *MSScrolledWindow::scrollWindow(void) { return _scrollWindow; } inline const MSWidget *MSScrolledWindow::scrollWindow(void) const { return _scrollWindow; } inline int MSScrolledWindow::viewWidth(void) const { return _viewWidth; } inline int MSScrolledWindow::viewHeight(void) const { return _viewHeight; } inline int MSScrolledWindow::scrollBarSize(void) const { return _vsb->width(); } inline void MSScrolledWindow::vsbBackground(unsigned long pixel_) { _vsb->background(pixel_); } inline void MSScrolledWindow::hsbBackground(unsigned long pixel_) { _hsb->background(pixel_); } inline void MSScrolledWindow::vsbBackground(const char *color_) { _vsb->background(color_); } inline void MSScrolledWindow::hsbBackground(const char *color_) { _hsb->background(color_); } inline MSScrolledWindow::ScrollBarDisplayPolicy MSScrolledWindow::scrollBarDisplayPolicy(void) const { return _scrollBarDisplayPolicy; } #endif aplus-fsf-4.22/src/MSGUI/MSSeparator.H0000644000265000001440000000234210772770431013013 #ifndef MSSeparatorHEADER #define MSSeparatorHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSGUIExport MSSeparator : public MSWidgetCommon { public: int marginWidth(void) const; void marginWidth(int); int marginHeight(void) const; void marginHeight(int); int thickness(void) const; void thickness(int); virtual void naturalSize(void); virtual void set(MSAttrValueList&); virtual MSAttrValueList& get(MSAttrValueList&); protected: MSSeparator(MSWidget *owner_); int _marginWidth; int _marginHeight; int _thickness; void init(void); virtual void firstMapNotify(void); virtual void updateBackground(unsigned long); }; inline int MSSeparator::marginWidth(void) const { return _marginWidth; } inline int MSSeparator::marginHeight(void) const { return _marginHeight; } inline int MSSeparator::thickness(void) const { return _thickness; } inline void MSSeparator::firstMapNotify(void) { computeSize(); } #endif aplus-fsf-4.22/src/MSGUI/MSSeparatorMenuItem.H0000644000265000001440000000115210772770431014455 #ifndef MSSeparatorMenuItemHEADER #define MSSeparatorMenuItemHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSGUIExport MSSeparatorMenuItem : public MSMenuItem { protected: void computeSize(void); void init(void); virtual void drawSymbol(void); public: MSSeparatorMenuItem(MSMenu *); ~MSSeparatorMenuItem(void); }; #endif aplus-fsf-4.22/src/MSGUI/MSShadow.H0000644000265000001440000000464010772770431012303 #ifndef MSShadowHEADER #define MSShadowHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include class MSDisplayServer; class MSWidget; class MSGUIExport MSShadow { private: class MSGUIExport ShadowColors { public: GC _tsGC; GC _bsGC; GC _selectGC; GC _bgGC; XColor _bgColor; XColor _fgColor; XColor _selectColor; XColor _tsColor; XColor _bsColor; int _count; void increment(void) { _count++; } void decrement(void) { if (--_count==0) delete this; } int count(void) const { return _count; } ShadowColors(void); ~ShadowColors(void); }; private: MSDisplayServer *_server; ShadowColors *_shadowColors; #ifdef MS_MULTI_THREAD static MSMutex _shadowHashTableMutex; #endif void createGCs(void); unsigned long brightness(void); void setMonochromeColors(void); void calculateRGBColors(void); void calculateColorsForLightBackground(void); void calculateColorsForMediumBackground(void); void calculateColorsForDarkBackground(void); void deleteColors(void); public: MSShadow(void); MSShadow(MSWidget *); MSShadow(MSDisplayServer *); MSShadow(const MSShadow&); ~MSShadow(void); MSShadow& operator=(const MSShadow&); void color(unsigned long); void displayServer(MSDisplayServer *); MSBoolean isSet(void) const {return MSBoolean(_shadowColors!=0);} unsigned long foreground(void) const {return _shadowColors->_fgColor.pixel;} unsigned long background(void) const {return _shadowColors->_bgColor.pixel;} unsigned long select(void) const {return _shadowColors->_selectColor.pixel;} unsigned long topShadow(void) const {return _shadowColors->_tsColor.pixel;} unsigned long bottomShadow(void) const {return _shadowColors->_bsColor.pixel;} GC topShadowGC(void) const {return _shadowColors->_tsGC;} GC bottomShadowGC(void) const {return _shadowColors->_bsGC;} GC selectShadowGC(void) const {return _shadowColors->_selectGC;} GC backgroundShadowGC(void) const {return _shadowColors->_bgGC;} }; #endif aplus-fsf-4.22/src/MSGUI/MSShell.H0000644000265000001440000001523210772770431012124 #ifndef MSShellHEADER #define MSShellHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSShellBusy; class MSApplicationBusy; class MSGUIExport MSShell : public MSTopLevel { friend class MSShellBusy; friend class MSApplicationBusy; friend MSGUIExport void changeBusyState(MSShell *,MSBoolean); friend MSGUIExport void changeBusyState(MSBoolean); public: MSShell(const char *windowTitle_=0); MSShell(MSDisplayServer *,const char *windowTitle_=0); ~MSShell(void); static MSShell *defaultLeader(void); static void defaultLeader(MSShell *); static const MSWidgetVector& topLevelList(void); MSWidgetVector followerList(void); const MSWidgetVector& traversalList(void) const; const MSWidgetVector& traversalList(void); void traversalList(const MSWidgetVector&); MSWidget *child(void); MSShell *leader(void); MSShell *windowGroup(void); MSWidget *focusWidget(void); virtual MSWidget *inputFocus(void); const MSWidget *child(void) const; const MSShell *leader(void) const; const MSShell *windowGroup(void) const; const MSWidget *focusWidget(void) const; virtual const MSWidget *inputFocus(void) const; virtual MSBoolean traverseFocus(MSWidget *); virtual MSBoolean traverseToNext(void); virtual MSBoolean traverseToPrevious(void); virtual void traverse(void); MSBoolean windowGroup(MSShell *); void leader(MSShell *); void moveToCenter(void); virtual void naturalSize(void); virtual void resize(int,int); virtual void moveTo(int,int); virtual void print(const char *file_=0); virtual void unmap(void); virtual void map(void); virtual void show(void); virtual void showCentered(void); virtual MSWidgetVector children(void); virtual void loadAndShow(const char *fileName_); virtual void loadAndShow(const MSWidgetState &); virtual void loadAndShow(istream &); virtual void loadStateFrom(const MSWidgetState &); virtual void loadStateFrom(const char *fileName_); virtual void loadStateFrom(istream &); virtual void saveStateTo(const char *fileName_); virtual void saveStateTo(ostream &); virtual void set(MSAttrValueList& avList_); virtual MSAttrValueList& get(MSAttrValueList& avList_); friend MSGUIExport ostream &operator<<(ostream &,MSShell &); friend MSGUIExport istream &operator>>(istream &,MSShell &); public: class MSGUIExport Follower { public: MSShell *_pShell; MSBoolean _remap; Follower(MSShell *shell_); ~Follower(void); }; class MSGUIExport GroupList { public: MSUnsignedLongVector _groupList; GroupList(void); ~GroupList(void); void removeAll(void); void removeAt(unsigned); void append(Follower *); unsigned numberOfFollowers(void) const; Follower *operator()(unsigned index_) const; Follower *operator()(unsigned index_); }; protected: static MSWidgetVector _shellList; static MSShell *_defaultLeader; int _busyCount; // ref counting for busy cursor GroupList _groupList; MSWidgetVector _traversalList; MSWidget *_focusWidget; MSShell *_leader; MSWidget *_child; MSBoolean _created; // set after the first mapping event is received int _offsetX; // window manager x offset int _offsetY; // window manager y offset MSBoolean _nestedTraversal; MSBoolean _inCurrentWorkspace; // is this window in the current workspace void init(void); static MSWidgetVector& shellList(void); virtual int offsetX(void) const; virtual int offsetY(void) const; int childWidth(void) const; int childHeight(void) const; virtual int idealShellWidth(void) const; virtual int idealShellHeight(void) const; virtual void showChildren(void); virtual void adjustChildPosition(void); virtual void adjustChildSize(void); virtual void adjustSize(void); MSBoolean doesLeaderFollowThis(MSShell *); void addFollower(MSShell *); void removeFollower(MSShell *); void unmapFollowers(void); void mapFollowers(void); void focusWidget(MSWidget *); void nestedTraversal(MSBoolean nestedTraversal_); MSWidget *getNextFocus(void); MSWidget *getPreviousFocus(void); virtual MSBoolean traverseFocusToNext(void); virtual MSBoolean traverseFocusToPrevious(void); virtual void addToFocusList(MSWidget *); virtual void removeFromFocusList(MSWidget *); void setDefaultFocus(void); void setDefaultTraversal(void); virtual MSBoolean processAltKey(const XEvent *,KeySym,unsigned int,const char *); virtual MSBoolean processFunctionKey(const XEvent *,KeySym,unsigned int,const char *); virtual void traverseToNextShell(void); virtual void traverseToPreviousShell(void); virtual void firstMapNotify(void); virtual void tab(void); virtual void shiftTab(void); virtual void configure(void); virtual void childCreate(MSWidget *); virtual void childInsert(MSWidget *); virtual void childRemove(MSWidget *); virtual void childConfigure(MSWidget *); virtual void childDestroy(MSWidget *); virtual void configureNotify(const XEvent *); virtual void mapNotify(const XEvent *); virtual void keyPress(const XEvent *,KeySym,unsigned int,const char *); virtual void keyRelease(const XEvent *,KeySym,unsigned int,const char *); virtual void keyRelease(const XEvent *); virtual void enterNotify(const XEvent *); virtual void leaveNotify(const XEvent *); virtual void propertyNotify(const XEvent *); virtual void focusInEventNotify(const XEvent *); virtual void focusOutEventNotify(const XEvent *); void processFocusIn(void); void processFocusOut(void); virtual void iconized(void); virtual void deiconized(void); virtual void focusIn(void); virtual void focusOut(void); virtual void takeFocus(void); virtual MSBoolean loseFocus(void); virtual void visibilityObscured(void); virtual void visibilityUnobscured(void); virtual void inCurrentWorkspaceNotify(void); virtual void outOfCurrentWorkspaceNotify(void); static void updateCurrentWorkspace(Atom); void updateCurrentWorkspaceState(Atom); void updateWMState(void); static void changeBusyState(MSShell *,MSBoolean); static void changeBusyState(MSBoolean); void setBusyState(MSBoolean); int busyCount(void); void busyCount(int); private: void setOffsets(void); void offsetX(int); void offsetY(int); }; #endif aplus-fsf-4.22/src/MSGUI/MSStandardDisclaimer.H0000644000265000001440000000425010772770431014610 #ifndef MSPrintStandardHEADER #define MSPrintStandardHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include static const char *Disclaimer="This memorandum is based on information generally available to the public from sources believed to be reliable. No representation is made that it is accurate or complete. Certain assumptions may have been made in this analysis which have resulted in any returns detailed herein. No representation is made that any returns indicated will be achieved. Changes to the assumptions may have a material impact on any returns detailed. Past performance is not necessarily indicative of future returns. Price and availability are subject to change without notice. The foregoing has been prepared solely for informational purposes, and is not an offer to buy or sell or a solicitation of an offer to buy or sell any security or instrument or to participate in any particular trading strategy. Morgan Stanley & Co. Incorporated, Morgan Stanley & Co. International Limited, Morgan Stanley Japan Ltd. and/or their affiliates may have positions in, and effect transactions in securities and instruments of issuers mentioned herein and may also provide or seek to provide significant advice or investment services, including investment banking, for the issuers of such securities and instruments. Additional information is available upon request. To Our Readers Worldwide: In addition please note that this publication has been issued by Morgan Stanley & Co. Incorporated and approved by Morgan Stanley & Co. International Limited, a member of The Securities and Futures Authority and Morgan Stanley Japan, Ltd. We recommend that investors obtain the advice of their Morgan Stanley & Co. International limited or Morgan Stanley Japan, Ltd. representative about the investments concerned. NOT FOR DISTRIBUTION TO PRIVATE CUSTOMERS AS DEFINED BY THE U.K. SECURITIES AND FUTURES AUTHORITY.\n"; #endif aplus-fsf-4.22/src/MSGUI/MSStringDelimiterList.H0000644000265000001440000000361310772770431015016 #ifndef MSStringDelimiterListHEADER #define MSStringDelimiterListHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSGUIExport MSStringDelimiterList : public MSDelimiterList { public: MSStringDelimiterList(MSWidget *,const char *title_=0); MSStringDelimiterList(MSWidget *,const MSStringVector&); MSStringDelimiterList(MSWidget *,MSStringVector&,const char *title_=0); MSStringDelimiterList(MSWidget *,MSStringVector&,const MSStringVector&); ~MSStringDelimiterList(void); void model(MSStringVector&); MSStringVector& viewModel(void) { return *((MSStringVector*)_model); } const MSStringVector& viewModel(void) const { return *((MSStringVector*)_model); } MSStringDelimiterList& operator=(const MSStringVector& list_); operator MSStringVector&() const; protected: virtual unsigned numColumns(void) const; virtual unsigned numRows(void) const; virtual void calculateMaxLength(void); virtual unsigned rowLength(unsigned) const; virtual void incrementalSearch(unsigned row_=0); virtual MSBoolean validate(const char *string_,unsigned row_); virtual const char *formatOutput(MSString &,unsigned row_); void moveRow(int from_,int to_); MSStringVector& list(void) { return (MSStringVector&)*_model; } const MSStringVector& list(void) const { return (MSStringVector&)*_model; } void list(const MSStringVector&); }; inline MSStringDelimiterList& MSStringDelimiterList::operator=(const MSStringVector& list_) { list(list_); return *this; } inline MSStringDelimiterList ::operator MSStringVector&() const { return *((MSStringVector *)_model); } #endif aplus-fsf-4.22/src/MSGUI/MSStringEntryField.H0000644000265000001440000000307710772770431014315 #ifndef MSStringEntryFieldHEADER #define MSStringEntryFieldHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include class MSGUIExport MSStringEntryField : public MSEntryFieldPlus { protected: virtual MSBoolean validate(const char *); virtual const char *formatOutput(MSString &); const char *svalue(void) const { return (MSView::model()!=0)?value().string():0; } MSString& value(void) const { return (MSString&)*_model; } void value(const char *); virtual void updateData(void); public: MSStringEntryField(MSWidget *,const char *label_=0,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSStringEntryField(MSWidget *,MSString&,const char *label_=0,const MSSymbol& tag_=MSSymbol::nullSymbol()); ~MSStringEntryField(void); void model(MSString&); void model(const MSString&); MSString& viewModel(void) { return *((MSString*)_model); } const MSString& viewModel(void) const { return *((MSString*)_model); } MSStringEntryField& operator=(const char *value_) {value(value_); return *this;} operator MSString&() {return *((MSString *)_model);} operator const char *() {return svalue();} virtual MSAttrValueList& get(MSAttrValueList&); }; #endif aplus-fsf-4.22/src/MSGUI/MSStringList.H0000644000265000001440000000346010772770432013160 #ifndef MSStringListHEADER #define MSStringListHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSGUIExport MSStringList : public MSList { public: MSStringList(MSWidget *,const char *title_=0); MSStringList(MSWidget *,const MSStringVector&); MSStringList(MSWidget *,MSStringVector&,const char *title_=0); MSStringList(MSWidget *,MSStringVector&,const MSStringVector&); ~MSStringList(void); void model(MSStringVector&); void model(const MSStringVector&); MSStringVector& viewModel(void) { return *((MSStringVector*)_model); } const MSStringVector& viewModel(void) const { return *((MSStringVector*)_model); } MSStringList& operator=(const MSStringVector& list_); operator MSStringVector&() const; protected: virtual unsigned numColumns(void) const; virtual unsigned numRows(void) const; virtual void calculateMaxLength(void); virtual unsigned rowLength(unsigned) const; virtual void incrementalSearch(unsigned row_=0); virtual void moveRow(int,int); virtual MSBoolean validate(const char *string_,unsigned row_); virtual const char *formatOutput(MSString &,unsigned row_); MSStringVector& list(void) { return (MSStringVector&)*_model; } const MSStringVector& list(void) const { return (MSStringVector&)*_model; } void list(const MSStringVector&); }; inline MSStringList& MSStringList::operator=(const MSStringVector& list_) { list(list_); return *this; } inline MSStringList::operator MSStringVector&() const { return *((MSStringVector *)_model); } #endif aplus-fsf-4.22/src/MSGUI/MSStringPopupMenu.H0000644000265000001440000000155010772770432014173 #ifndef MSStringPopupMenuHEADER #define MSStringPopupMenuHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSGUIExport MSStringPopupMenu : public MSPopupMenu { public: MSStringPopupMenu(MSDisplayServer *); MSStringPopupMenu(MSDisplayServer *,MSStringVector& aModel_); void model(const MSStringVector& aModel_); const MSStringVector& viewModel(void) const { return (MSStringVector&)*_model; } protected: const MSStringVector& stringVector(void) const { return (MSStringVector&)*_model; } virtual void updateData(void); virtual void receiveEvent(MSEvent&); }; #endif aplus-fsf-4.22/src/MSGUI/MSStringTableColumn.H0000644000265000001440000000507410772770432014455 #ifndef MSStringTableColumnHEADER #define MSStringTableColumnHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSGUIExport MSStringTableColumn : public MSTableColumn { public: MSStringTableColumn(MSReportTable *,const char *heading_=0,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSStringTableColumn(MSReportTable *,const MSStringVector&,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSStringTableColumn(MSReportTable *,MSStringVector&,const char *heading_=0,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSStringTableColumn(MSReportTable *,MSStringVector&,const MSStringVector&,const MSSymbol& tag_=MSSymbol::nullSymbol()); ~MSStringTableColumn(void); void model(MSStringVector&); void model(const MSStringVector&); MSStringVector& viewModel(void) { return (MSStringVector&)*_model; } const MSStringVector& viewModel(void) const { return (MSStringVector&)*_model; } MSStringTableColumn& operator=(const MSStringVector& vector_); operator MSStringVector&() const; virtual MSIndexVector gradeUp(void) const; virtual MSIndexVector gradeDown(void) const; virtual void permute(const MSIndexVector &); virtual void range(MSIndexVector &start_,MSIndexVector &end_); virtual MSIndexVector rangeGradeUp(const MSIndexVector &start_,const MSIndexVector &end_); virtual MSIndexVector rangeGradeDown(const MSIndexVector &start_,const MSIndexVector &end_); virtual unsigned numRows(void) const; virtual MSBoolean isDuplicate(unsigned); virtual MSBoolean breakCriteria(unsigned); virtual const char *formatOutput(MSString &,unsigned); virtual const char *formatBreak(MSString &,unsigned,unsigned); virtual void set(MSAttrValueList& avList_); virtual MSAttrValueList& get(MSAttrValueList& avList_); protected: void init(void); virtual MSBoolean validate(const char *,unsigned); virtual void moveRow(int, int); MSStringVector& vector(void) { return (MSStringVector&)*_model; } const MSStringVector& vector(void) const { return (MSStringVector&)*_model; } void vector(const MSStringVector&); }; inline MSStringTableColumn& MSStringTableColumn::operator=(const MSStringVector& vector_) { vector(vector_); return *this; } inline MSStringTableColumn::operator MSStringVector&() const { return *((MSStringVector *)_model); } #endif aplus-fsf-4.22/src/MSGUI/MSStringVectorTraceSet.H0000644000265000001440000000475310772770432015150 #ifndef MSStringVectorTraceSetHEADER #define MSStringVectorTraceSetHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSGUIExport MSStringVectorTraceSet:public MSTraceSet { public: MSStringVectorTraceSet(MSGraph *,const char *legends_=0,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSStringVectorTraceSet(MSGraph *,const MSStringVector&,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSStringVectorTraceSet(MSGraph *,MSStringVector&,const char *legends_=0,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSStringVectorTraceSet(MSGraph *,MSStringVector&,const MSStringVector&,const MSSymbol& tag_=MSSymbol::nullSymbol()); ~MSStringVectorTraceSet(void); virtual void moveTo(int,int); virtual void moveTo(double,double); virtual void xOrigin(double); virtual void yOrigin(double); void model(MSStringVector&); void model(const MSStringVector&); MSStringVector& viewModel(void) { return *((MSStringVector*)_model); } const MSStringVector& viewModel(void) const { return *((MSStringVector*)_model); } virtual MSStringVector& text(void); virtual const MSStringVector& text(void) const; virtual unsigned textLength(void) const; MSStringVectorTraceSet& operator=(const MSStringVector& vector_) {vector(vector_); return *this;} operator MSStringVector&() const {return *((MSStringVector *)_model);} virtual unsigned long style(unsigned) const; virtual void style(Style); virtual void style(unsigned long); // the trace style mutator methods are disabled as // they are not applicable to this trace set virtual void style(unsigned long,unsigned); virtual void style(const MSUnsignedLongVector&); virtual void set(MSAttrValueList&); virtual MSAttrValueList& get(MSAttrValueList&); protected: void init(void); MSStringVector& vector(void) {return *((MSStringVector *)_model); } const MSStringVector& vector(void) const {return *((MSStringVector *)_model); } void vector(const MSStringVector& v_) {if (MSView::model()!=0) vector()=v_;} virtual int dataCount(void) const; virtual double x(int) const; virtual double y(int,int) const; virtual void validate(int,int,double,double); private: double _x; double _y; }; #endif aplus-fsf-4.22/src/MSGUI/MSSymbolCheckBox.H0000644000265000001440000000226510772770432013734 #ifndef MSSymbolCheckBoxHEADER #define MSSymbolCheckBoxHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSGUIExport MSSymbolCheckBox : public MSModelCheckBox { friend class MSCheckButton; public: MSSymbolCheckBox(MSWidget *,const char *title_=0); MSSymbolCheckBox(MSWidget *,const MSStringVector &title_); MSSymbolCheckBox(MSWidget *,MSSymbolVector& model_,const char *title_=0); MSSymbolCheckBox(MSWidget *,MSSymbolVector& model_,const MSStringVector& title_); ~MSSymbolCheckBox(void); void model(MSSymbolVector&); MSSymbolVector& viewModel(void) { return *((MSSymbolVector*)_model); } const MSSymbolVector& viewModel(void) const { return *((MSSymbolVector*)_model); } operator MSSymbolVector &() { return *((MSSymbolVector *)_model); } protected: virtual void drawCurrentState(void); virtual void setModel(void); }; #endif aplus-fsf-4.22/src/MSGUI/MSSymbolList.H0000644000265000001440000000345510772770432013163 #ifndef MSSymbolListHEADER #define MSSymbolListHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSGUIExport MSSymbolList : public MSList { public: MSSymbolList(MSWidget *,const char *title_=0); MSSymbolList(MSWidget *,const MSStringVector&); MSSymbolList(MSWidget *,MSSymbolVector&,const char *title_=0); MSSymbolList(MSWidget *,MSSymbolVector&,const MSStringVector&); ~MSSymbolList(void); void model(MSSymbolVector&); void model(const MSSymbolVector&); MSSymbolVector& viewModel(void) { return *((MSSymbolVector*)_model); } const MSSymbolVector& viewModel(void) const { return *((MSSymbolVector*)_model); } MSSymbolList& operator=(const MSSymbolVector&); operator MSSymbolVector&() const; protected: virtual unsigned numColumns(void) const; virtual unsigned numRows(void) const; virtual void calculateMaxLength(void); virtual unsigned rowLength(unsigned) const; virtual void incrementalSearch(unsigned row_=0); virtual void moveRow(int,int); virtual MSBoolean validate(const char *pString_,unsigned row_); virtual const char *formatOutput(MSString &,unsigned row_); MSSymbolVector& list(void) { return *((MSSymbolVector *)_model); } const MSSymbolVector& list(void) const { return *((MSSymbolVector *)_model); } void list(const MSSymbolVector&); }; inline MSSymbolList& MSSymbolList::operator=(const MSSymbolVector& list_) { list(list_); return *this; } inline MSSymbolList::operator MSSymbolVector&() const { return *((MSSymbolVector *)_model); } #endif aplus-fsf-4.22/src/MSGUI/MSTabStringList.H0000644000265000001440000000251610772770432013610 #ifndef MSTabStringListHEADER #define MSTabStringListHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSGUIExport MSTabStringList : public MSStringList { public: MSTabStringList(MSWidget *,const char *title_=0); MSTabStringList(MSWidget *,const MSStringVector& title_); MSTabStringList(MSWidget *,MSStringVector&, const char*title_=0); MSTabStringList(MSWidget *,MSStringVector&, const MSStringVector& title_); ~MSTabStringList(void); const unsigned long& tabSize(void) const; void tabSize(unsigned long); const MSUnsignedLongVector& tabStops(void) const; void tabStops(const MSUnsignedLongVector&); virtual void set(MSAttrValueList&); virtual MSAttrValueList& get(MSAttrValueList&); protected: virtual void calculateMaxLength(void); virtual unsigned rowLength(unsigned) const; virtual void drawString(Display *,Window,GC,const XFontStruct *,int,int,const char *,int); virtual int nextTabPosition(int,int,int&) const; unsigned long _tabSize; MSUnsignedLongVector _tabStops; }; #endif aplus-fsf-4.22/src/MSGUI/MSTable.H0000644000265000001440000002722510772770432012112 #ifndef MSTableHEADER #define MSTableHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include class MSStringPopupMenu; class MSTableColumn; class MSGUIExport MSTable : public MSReportTable, public MSArrayView { public: class MSGUIExport ColumnPopupMenu : public MSStringPopupMenu { protected: MSStringVector _choices; MSTable *_table; virtual void activate(void); public: ColumnPopupMenu(MSTable *pTable_) : _table(pTable_),MSStringPopupMenu(pTable_->server()) { model(_choices); } void choices(const MSStringVector& choices_) { _choices=choices_; } }; friend class ColumnPopupMenu; friend class MSTableColumn; public: enum ChoiceStyle {ChoicePopupMenu, ChoiceOptionMenu, ChoiceOptionMenuAlwaysDrawn }; MSTable(MSWidget *,const char *title_=0); MSTable(MSWidget *,const MSStringVector&); ~MSTable(void); // return column associated with tag_ const MSTableColumn *tableColumn(const MSSymbol& tag_) const; MSTableColumn *tableColumn(const MSSymbol& tag_); // return column at column index_ const MSTableColumn *tableColumn(unsigned index_) const; MSTableColumn *tableColumn(unsigned index_); MSBoolean columnDragDrop(void) const; void columnDragDrop(MSBoolean columnDragDrop_); MSBoolean columnResize(void) const; void columnResize(MSBoolean); void choiceStyle(ChoiceStyle); ChoiceStyle choiceStyle(void) const; Font headingFont(void) const; void headingFont(Font); void headingFont(const char *); unsigned long headingAlignment(void) const; void headingAlignment(unsigned long); MSBoolean showBreaks(void) const; void showBreaks(MSBoolean); MSBoolean dynamicRecompute(void) const; void dynamicRecompute(MSBoolean); const MSIndexVector& viewVector(void) const; void viewVector(const MSIndexVector&); int selectedDataRow(void) const; void selectedDataRow(int); MSIndexVector selectionDataVector(void) const; void selectionDataVector(const MSIndexVector&); virtual MSString selection(void); virtual void computeBreaks(void); int columnCount(void) const; virtual unsigned numColumns(void) const; virtual unsigned numRows(void) const; virtual unsigned numDataRows(void) const; virtual int fixedReportColumns(void) const; virtual void exchangeColumns(unsigned x_,unsigned y__); virtual void placeColumnAt(MSTableColumn *,unsigned); virtual void permuteColumns(const MSIndexVector& aIndexVector_); virtual void permuteColumns(const MSSymbolVector& aSymbolVector_); virtual void permuteColumns(const MSWidgetVector &); virtual void increment(void); virtual void decrement(void); virtual MSWidgetVector children(void); virtual MSDisplayServer *displayServer(void); virtual const MSString& virtualHelpString(int x_,int y_); virtual MSIndexVector sortUp(const MSIndexVector &); virtual MSIndexVector sortUp(const MSSymbolVector &); virtual MSIndexVector sortDown(const MSIndexVector &); virtual MSIndexVector sortDown(const MSSymbolVector &); void columnGroups(const MSTableColumnGroup &); MSTableColumnGroup columnGroups(void) const; MSWidgetVector columnsOfGroup(const MSSymbol &); void groupForeground(const MSSymbol &,const char *); void groupForeground(const MSSymbol &,unsigned long); unsigned long groupForeground(const MSSymbol &) const; void groupFont(const MSSymbol &,const char *); void groupFont(const MSSymbol &,Font); Font groupFont(const MSSymbol &) const; void groupHeading(const MSSymbol &,const MSStringVector &); const MSStringVector &groupHeading(const MSSymbol &) const; virtual void moveRow(int from_,int to_); virtual void set(MSAttrValueList& avList_); virtual MSAttrValueList& get(MSAttrValueList& avList_); typedef MSGenericVector > ColumnGroupList; protected: Font _headingFont; unsigned long _headingAlignment; MSBoolean _columnDragDrop; MSBoolean _columnResize; Window _dragWindow; MSDisplayCursor *_dragCursor; MSDisplayCursor *_resizeCursor; MSGC _movegc; MSIndexVector _viewVector; ColumnPopupMenu *_choicesMenu; MSBoolean _showBreaks; MSBoolean _dynamicRecompute; //_headingsHeight=_groupHeadingsHeight+_columnHeadingsHeight+extra space int _columnHeadingsHeight; int _groupHeadingsHeight; MSIntVector _groupHeadingsHeightVector; ColumnGroupList _columnGroupList; ChoiceStyle _choiceStyle; void init(void); GC moveGC(void); Window dragWindow(void); MSDisplayCursor *dragCursor(void); MSDisplayCursor *resizeCursor(void); void updateBreakStatus(unsigned,unsigned); virtual void updateInternalState(void); virtual void calculateHeadingsHeight(void); virtual void appendUpdate(void); virtual void columnUpdate(int); virtual void updateScreen(); virtual void createCycle(int,int); virtual void drawHeadings(Window); virtual void drawHeadings(Window,int,int); virtual void drawFixedColumnHeadings(Window); virtual void clearColumn(int); virtual void dragColumn(const XEvent *,int); virtual void shuffleColumns(MSIndexVector &); virtual void resizeColumn(int,int); MSBoolean insideSeparator(int,int,int&); virtual MSBoolean editorActivate(void); virtual void valueChange(void); virtual void columnChoiceActivate(const MSString&); virtual unsigned numRows(unsigned) const; virtual int columnPixelWidth(int); virtual unsigned columnLength(unsigned); virtual void updateFont(Font); virtual void updateForeground(unsigned long); virtual void updateBackground(unsigned long); virtual void updateTitle(void); virtual void returnKey(void); virtual void visibilityUnobscured(void); virtual void visibilityObscured(void); virtual void defaultButton3Behavior(const XEvent *); virtual void motionNotify(const XEvent *); virtual void headingAreaSelection(const XEvent *); virtual void dataAreaSelection(const XEvent *); virtual void insertChild(MSWidget *); virtual void removeChild(MSWidget *); virtual void childInsert(MSWidget *); virtual void childRemove(MSWidget *); virtual void childCreate(MSWidget *); virtual void childDestroy(MSWidget *); virtual unsigned long convertForeground(const char *); // getDataRow() returns the corresponding model-specific row of the specified // view-specific row. isBreakRow_ returns MSTrue if the viewRow_ is indeed a // break row, and MSFalse otherwise. This method calls adjustRowForBreaks() // and adjustRowForViewVector(). unsigned getDataRow(unsigned viewRow_,MSBoolean &isBreakRow_) const; unsigned adjustRowForViewVector(unsigned) const; unsigned adjustRowForBreaks(unsigned) const; unsigned adjustPositionForBreaks(unsigned) const; // The following methods override the default provided by MSArray because MSTable // supports column semantics where each column can have its own color, font, // number of rows, alignment, etc. virtual const XFontStruct *columnFontStruct(unsigned); virtual unsigned long columnBackground(unsigned); virtual unsigned long columnForeground(unsigned); virtual MSClipMode columnClipMode(unsigned) const; virtual unsigned columnEditWidth(unsigned); virtual unsigned columnNumRows(unsigned) const; // The following methods override the default provided by MSArray because MSTable // supports extra view manipulation functionalities such as view vector and breaks. virtual const char *viewFormatOutput(MSString &,unsigned,unsigned); virtual MSBoolean viewValidate(const char *,unsigned,unsigned); virtual MSBoolean isViewProtected(unsigned,unsigned); virtual MSBoolean isViewValid(unsigned,unsigned); virtual unsigned long viewCellForeground(unsigned,unsigned); virtual unsigned long viewCellBackground(unsigned,unsigned); virtual Font viewCellFont(unsigned,unsigned); virtual MSAlignment viewCellAlignment(unsigned,unsigned); // The following methods override the default provided by MSArray because MSTable // forwards them to the corresponding table column object. virtual const char *formatOutput(MSString &,unsigned,unsigned); virtual MSBoolean validate(const char *,unsigned,unsigned); virtual MSBoolean isCellProtected(unsigned,unsigned); virtual MSBoolean isValid(unsigned,unsigned); virtual unsigned long cellForeground(unsigned,unsigned); virtual unsigned long cellBackground(unsigned,unsigned); virtual Font cellFont(unsigned,unsigned); virtual MSAlignment cellAlignment(unsigned,unsigned); //Methods that support column grouping MSIntVector &groupHeadingsHeightVector(void); const MSIntVector &groupHeadingsHeightVector(void) const; ColumnGroupList &columnGroupList(void); const ColumnGroupList &columnGroupList(void) const; int columnHeadingsHeight(void) const; void columnHeadingsHeight(int); int groupHeadingsHeight(void) const; void groupHeadingsHeight(int); virtual void calculateColumnHeadingsHeight(void); virtual void calculateGroupHeadingsHeight(void); virtual void calculateGroupHeadingsHeight(MSTableColumn *,MSIntVector &); virtual void calculateRowHeight(void); virtual void drawGroupHeadings(Window); virtual void drawGroupHeadings(Window,int,int); virtual void drawGroupHeading(Window,MSTableColumnGroup *,int,int,int); virtual void drawGroupHeading(Window,MSTableColumnGroup *,MSRect&); virtual void drawCell(Window,int,int,int,int); virtual void drawCell(Window,int,int,int,int,unsigned long,unsigned long,Font, MSBoolean,MSBoolean,MSBoolean); virtual void updateColumnHeadings(void); virtual void drawColumnHeadings(Window,int,int); virtual void drawColumnHeading(Window,MSTableColumn *,const MSRect&,int); virtual int computeXCoord(int column_); virtual int computeXCoord(MSTableColumn *); virtual int columnHeadingsOffset(void); virtual void redrawHeadings(Window,int,int); virtual void drawHSeparator(Window,int,int,int,int); virtual void drawVSeparator(Window,int,int,int,int); MSBoolean sanityCheck(const MSTableColumnGroup &) const; virtual void updateChoices(void); virtual void showOptions(int row_,int column_); virtual MSBoolean columnHasOptions(int column_); virtual ChoiceStyle columnChoiceStyle(int column_); virtual const MSStringVector &cellOptions(int row_,int column_); virtual void cellRootXY(int row_,int column_,int &x_,int &y_); virtual void dragRow(const XEvent *); void resetSortingArrows(void); friend ostream &operator<<(ostream &,MSManagedPointer const &); }; DECLARE_ELEMENT_FOR_OPS(MSManagedPointer,MSTableColumnGroup) #ifndef MS_NO_INLINES #ifndef MSTableINLINES #include #endif #endif // We provide explicit "do_not_instantiate" pragmas here to avoid instantiation complications in // MStk applications. // #if !defined(__MSGUILIBRARY_BUILD__) && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma do_not_instantiate MSGenericVector > #pragma do_not_instantiate MSGenericVectorOps > #pragma do_not_instantiate MSGenericData > #endif // !__MSGUILIBRARY_BUILD__ && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #endif aplus-fsf-4.22/src/MSGUI/MSTableColumn.H0000644000265000001440000002553510772770432013272 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MSTableColumnHEADER #define MSTableColumnHEADER #include #include #include #include #include #include #include #include #include #include #include class MSGUIExport MSTableColumn : public MSWidgetView, public MSValidationInterface { friend class MSReport; friend class MSReportTable; friend class MSTable; friend class MSTableColumnIterator; public: MSTableColumn(MSReportTable *,const char *heading_=0, const MSSymbol& tag_=MSSymbol::nullSymbol()); MSTableColumn(MSReportTable *,const MSStringVector& heading_, const MSSymbol& tag_=MSSymbol::nullSymbol()); ~MSTableColumn(void); unsigned long style(void) const; unsigned long breakStyle(void) const; unsigned long headingStyle(void) const; const MSString& reportFont(void) const; const MSString& breakFont(void) const; const MSString& reportHeadingFont(void) const; const MSParagraph& breakText(const MSSymbol&) const; MSParagraph& breakText(const MSSymbol&); MSReportTable *reportTable(void) const; const MSSymbol& tag(void) const; unsigned column(void) const; double fgGrayScale(void) const; double bgGrayScale(void) const; const MSString& breakFgString(void) const; const MSString& breakBgString(void) const; unsigned long breakFgPixel(void) const; unsigned long breakBgPixel(void) const; const MSStringVector& breakString(void) const; MSStringVector& breakString(void); const MSIndexVector& breakIndex(void) const; const MSIndexVector& breakInvalid(void) const; MSBoolean suppressDuplicate(void) const; MSBoolean breakOn(void) const; MSBoolean pageBreakOn(void) const; MSBoolean breakProcessOn(void) const; int breakOffset(void) const; int breakLeading(void) const; double headingFgGrayScale(void) const; double headingBgGrayScale(void) const; double breakFgGrayScale(void) const; double breakBgGrayScale(void) const; MSP::BreakProcessMode breakProcessMode(void) const; virtual unsigned numRows(void) const; virtual MSBoolean breakCriteria(unsigned); virtual MSBoolean isDuplicate(unsigned); virtual unsigned long style(unsigned); virtual unsigned long breakStyle(unsigned); virtual int breakOffset(unsigned); virtual int breakLeading(unsigned); virtual const char *reportFont(unsigned); virtual const char *breakFont(unsigned); virtual double fgGrayScale(unsigned); virtual double bgGrayScale(unsigned); virtual double breakFgGrayScale(unsigned); virtual double breakBgGrayScale(unsigned); virtual const char *breakFgString(unsigned); virtual const char *breakBgString(unsigned); virtual unsigned long breakFgPixel(unsigned); virtual unsigned long breakBgPixel(unsigned); void tag(const MSSymbol&); void fgGrayScale(double); void bgGrayScale(double); void breakFgGrayScale(double); void breakBgGrayScale(double); void headingFgGrayScale(double); void headingBgGrayScale(double); void style(unsigned long); void breakStyle(unsigned long); void headingStyle(unsigned long); void reportFont(const char *); void reportHeadingFont(const char *); void breakFont(const char *); void breakOn(MSBoolean); void pageBreakOn(MSBoolean); void breakProcessOn(MSBoolean); void suppressDuplicate(MSBoolean); void breakOffset(long); void breakLeading(long); void breakString(const MSStringVector&); void breakProcessMode(MSP::BreakProcessMode); void breakFg(const char *); void breakBg(const char *); void removeBreakText(const MSSymbol&); void removeAllBreakText(void); MSParagraph& addBreakText(const MSParagraph&); MSParagraph& addBreakText(const MSStringVector&); MSParagraph& addBreakText(const char *); const MSStringVector& heading(void) const; void heading(const MSStringVector&); unsigned long headingForeground(void) const; void headingForeground(unsigned long); void headingForeground(const char *); virtual const char *formatBreak(MSString &,unsigned,unsigned); virtual const char *formatOutput(MSString &,unsigned); virtual MSIndexVector gradeUp(void) const; virtual MSIndexVector gradeDown(void) const; virtual void permute(const MSIndexVector&); virtual void range(MSIndexVector&,MSIndexVector&); virtual MSIndexVector rangeGradeUp(const MSIndexVector&,const MSIndexVector&); virtual MSIndexVector rangeGradeDown(const MSIndexVector&,const MSIndexVector&); void weights(const MSFloatVector&); const MSFloatVector& weights(void) const; MSFloatVector& weights(void); const MSParagraph& defaultText(void) const; MSParagraph& defaultText(void); MSTable *table(void) const; const MSStringVector& choices(void) const; const MSUnsignedLongVector& cycleColors(void) const; MSCycleColorMode cycleColorMode(void) const; MSFormat& format(void); const MSFormat& format(void) const; unsigned columnWidth(void) const; unsigned editWidth(void) const; MSAlignment columnAlignment(void) const; MSClipMode clipMode(void) const; MSBoolean resizable(void) const; Font headingFont(void) const; unsigned long headingAlignment(void) const; MSBoolean valueQuoted(void) const; void format(const MSFormat&); void choices(const MSStringVector&); void cycleColorMode(MSCycleColorMode); void cycleColors(const MSUnsignedLongVector&); void cycleColors(const MSStringVector&); void columnWidth(unsigned); void editWidth(unsigned); void columnAlignment(MSAlignment); void clipMode(MSClipMode); void resizable(MSBoolean); void headingFont(Font); void headingFont(const char *); void headingAlignment(unsigned long); MSSymbolVector groups(void) const; void valueQuoted(MSBoolean); virtual void redraw(void); virtual void map(void); virtual void unmap(void); MSBoolean sortArrowEnabled(void) const; void sortArrowEnabled(MSBoolean); virtual void set(MSAttrValueList& avList_); virtual MSAttrValueList& get(MSAttrValueList& avList_); protected: MSReportTable *_reportTable; MSSymbol _tag; unsigned _column; unsigned long _breakFgPixel; unsigned long _breakBgPixel; unsigned long _style; unsigned long _breakStyle; unsigned long _headingStyle; unsigned long _headingForeground; double _headingFgGrayScale; double _headingBgGrayScale; double _breakFgGrayScale; double _breakBgGrayScale; double _fgGrayScale; double _bgGrayScale; MSParagraph _defaultText; MSString _breakFgString; MSString _breakBgString; MSString _reportFont; MSString _reportHeadingFont; MSString _breakFont; MSBoolean _suppressDuplicate; MSBoolean _breakOn; MSBoolean _pageBreakOn; MSBoolean _breakProcessOn; MSStringVector _heading; MSStringVector _breakString; MSIndexVector _breakIndex; MSIndexVector _breakInvalid; MSFloatVector _weights; int _breakOffset; int _breakLeading; MSBoolean _valueQuoted; MSBoolean _sortArrowEnabled; MSP::BreakProcessMode _breakProcessMode; MSPointerArray _breakTextList; Font _headingFont; unsigned long _headingAlignment; unsigned _columnWidth; unsigned _editWidth; MSAlignment _columnAlignment; MSClipMode _clipMode; XFontStruct *_fontStruct; XFontStruct *_headingFontStruct; MSGC _textMSGC; MSUnsignedLongVector _cycleColors; MSCycleColorMode _cycleMode; MSBoolean _resizable; MSFormat _format; MSStringVector _choices; MSTable::ColumnGroupList _groupList; void column(unsigned); virtual double computeColumnFunction(void); virtual void breakProcess(MSIndexVector&); MSIndexVector& breakIndex(void); MSIndexVector& breakInvalid(void); MSParagraph *breakText(unsigned i_) const; const MSPointerArray& breakTextList(void) const; MSGC& textMSGC(void); GC textGC(void) const; const XFontStruct *fontStruct(void) const; const XFontStruct *headingFontStruct(void) const; void createGCs(void); void init(void); void fontStruct(XFontStruct *); void headingFontStruct(XFontStruct *); int textAscent(void) const; int textDescent(void) const; int charWidth(void) const; int textHeight(void) const; int headingAscent(void) const; int headingDescent(void) const; int headingCharWidth(void) const; int headingHeight(void) const; int headingWidth(void) const; int textWidth(const char *pString_) const; int textWidth(const char *pString_,unsigned len_) const; const XCharStruct *charStruct(char aChar_) const; const XCharStruct *headingCharStruct(char aChar_) const; int charWidth(char aChar_) const; int headingCharWidth(char aChar_) const; virtual void updateHeading(void); virtual void updateHeadingForeground(void); virtual void updateData(void); virtual void updateFont(Font); virtual void updateForeground(unsigned long); virtual void updateBackground(unsigned long); virtual void updateSensitivity(void); virtual void update(const MSIndexVector&); virtual int columnPixelWidth(void); virtual MSBoolean validate(const char *,unsigned); virtual MSBoolean isCellProtected(unsigned); virtual MSBoolean isValid(unsigned); virtual unsigned long cellForeground(unsigned); virtual unsigned long cellBackground(unsigned); virtual Font cellFont(unsigned); virtual MSAlignment cellAlignment(unsigned); virtual void moveRow(int, int); virtual MSBoolean hasOptions(void); virtual const MSStringVector& cellChoices(unsigned); virtual void increment(int); virtual void decrement(int); virtual void decoupleWidget(void); MSTable::ColumnGroupList &groupList(void); const MSTable::ColumnGroupList &groupList(void) const; //For backward compatibility only. virtual MSBoolean isProtected(unsigned); virtual MSBoolean isProtected(void) const; }; #ifndef MS_NO_INLINES #ifndef MSTableColumnINLINES #include #endif #endif // We provide explicit "do_not_instantiate" pragmas here to avoid instantiation complications in // MStk applications. // #if !defined(__MSGUILIBRARY_BUILD__) && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma do_not_instantiate MSPointerArray #pragma do_not_instantiate MSPointerArray #endif // !__MSGUILIBRARY_BUILD__ && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #endif aplus-fsf-4.22/src/MSGUI/MSTableColumnGroup.H0000644000265000001440000001270410772770433014302 #ifndef MSTableColumnGroupHEADER #define MSTableColumnGroupHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include class MSTable; class MSTableColumn; #if HAVE_IOSTREAM #include #else class ostream; using namespace std; #endif class MSGUIExport MSTableColumnGroup { public: typedef MSGenericVector ColumnGroupList; // typedef MSGenericVector ColumnGroupList; class MSGUIExport Iterator { public: virtual MSBoolean applyTo(MSTableColumnGroup &,const ColumnGroupList &)=0; virtual MSBoolean applyTo(MSTableColumn *,const ColumnGroupList &)=0; }; class MSGUIExport ConstIterator { public: virtual MSBoolean applyTo(const MSTableColumnGroup &,const ColumnGroupList &)=0; virtual MSBoolean applyTo(const MSTableColumn *,const ColumnGroupList &)=0; }; public: MSTableColumnGroup(MSTable *,const MSStringVector &headings_, const MSSymbol &tag_=MSSymbol::nullSymbol()); MSTableColumnGroup(MSTable *,const char *headings_=0, const MSSymbol &tag_=MSSymbol::nullSymbol()); MSTableColumnGroup(const MSTableColumnGroup &); ~MSTableColumnGroup(void); MSTableColumnGroup &operator=(const MSTableColumnGroup &); MSTableColumnGroup &operator<<(MSTableColumn *); MSTableColumnGroup &operator<<(MSTableColumnGroup &); MSTable *table(void) const {return _table;} const MSSymbol &tag(void) const {return _tag;} void tag(const MSSymbol &); const MSStringVector &heading(void) const {return _heading;} void heading(const MSStringVector &); Font font(void) const {return _font;} void font(Font); void font(const char *); unsigned long foreground(void) const {return _foreground;} void foreground(unsigned long); void foreground(const char *); void allNodesDo(Iterator &); void allNodesDo(ConstIterator &) const; MSTableColumnGroup &deepCopy(const MSTableColumnGroup &); MSTableColumnGroup &shallowCopy(const MSTableColumnGroup &); MSBoolean shallowCompare(const MSTableColumnGroup &) const; MSBoolean deepCompare(const MSTableColumnGroup &) const; friend MSGUIExport MSBoolean operator==(const MSTableColumnGroup &,const MSTableColumnGroup &); public: class MSGUIExport Node { public: enum NodeType {Undefined,Group,Column}; Node(MSTableColumnGroup&); Node(MSTableColumn *); Node(const Node &); Node(); Node &operator=(const Node &); ~Node(); NodeType type(void) const {return _type;} const MSTableColumnGroup *group(void) const {return _group;} MSTableColumnGroup *group(void) {return _group;} const MSTableColumn *column(void) const {return _column;} MSTableColumn *column(void) {return _column;} private: MSTableColumnGroup *_group; MSTableColumn *_column; NodeType _type; }; typedef MSGenericVector NodeList; protected: MSTable *_table; MSSymbol _tag; MSStringVector _heading; Font _font; unsigned long _foreground; NodeList _nodeList; void init(void); const NodeList &nodeList(void) const {return _nodeList;} NodeList &nodeList(void) {return _nodeList;} MSBoolean isEmpty(void) const {return MSBoolean(_nodeList.length()==0);} MSBoolean isOkToAdd(MSTableColumn *); MSBoolean isOkToAdd(MSTableColumnGroup &); MSBoolean depthFirstNodeIteration(Iterator &,ColumnGroupList &); MSBoolean depthFirstNodeIteration(ConstIterator &,ColumnGroupList &) const; void print(ostream &,unsigned) const; friend class MSTable; friend MSGUIExport ostream &operator<<(ostream &,MSTableColumnGroup const &); //Required for MSGenericVector template friend MSGUIExport ostream &operator<<(ostream &,MSTableColumnGroup::Node const &); friend MSGUIExport ostream &operator<<(ostream &,const MSTableColumnGroup * const &); }; inline long compare(MSTableColumnGroup::Node const &,MSTableColumnGroup::Node const &) {return 0;} inline long compare(MSTableColumnGroup const &,MSTableColumnGroup const &) {return 0;} // SUNPRO complains when elementForOps is specified for const arguments. // Provide specific function when const elements are used. #if defined(MS_CONST_ELEMENT_FOR_OPS_BUG) inline const MSTableColumnGroup* const& elementForOps (const MSTableColumnGroup* const & e) { return e; } #endif DECLARE_ELEMENT_FOR_OPS_TYPE(MSTableColumnGroup::Node) DECLARE_ELEMENT_FOR_OPS_TYPE(const MSTableColumnGroup*) // We provide explicit "do_not_instantiate" pragmas here to avoid instantiation complications in // MStk applications. // #if !defined(__MSGUILIBRARY_BUILD__) && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma do_not_instantiate MSGenericVector #pragma do_not_instantiate MSGenericVectorOps #pragma do_not_instantiate MSGenericData #pragma do_not_instantiate MSGenericVector #pragma do_not_instantiate MSGenericVectorOps #pragma do_not_instantiate MSGenericData #endif // !__MSGUILIBRARY_BUILD__ && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #endif aplus-fsf-4.22/src/MSGUI/MSTermEntryField.H0000644000265000001440000000406210772770433013753 #ifndef MSTermEntryFieldHEADER #define MSTermEntryFieldHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSGUIExport MSTermEntryField : public MSEntryFieldPlus { protected: MSTerm _incrementValue; MSTerm _minimumValue; MSTerm _maximumValue; virtual MSBoolean validate(const char *); virtual const char *formatOutput(MSString &); virtual void increment(void); void init(void); MSTerm& value(void) const { return *((MSTerm *)_model); } void value(const MSTerm& value_) const { if (MSView::model()!=0) value()=value_; } virtual void generateInputMask(void); virtual void updateData(void); public: MSTermEntryField(MSWidget *,const char *label_=0, const MSSymbol& tag_=MSSymbol::nullSymbol()); MSTermEntryField(MSWidget *,MSTerm&,const char *label_=0, const MSSymbol& tag_=MSSymbol::nullSymbol()); ~MSTermEntryField(void); void model(MSTerm&); void model(const MSTerm&); MSTerm& viewModel(void) { return *((MSTerm*)_model); } const MSTerm& viewModel(void) const { return *((MSTerm*)_model); } const MSTerm& incrementValue(void) const {return _incrementValue;} const MSTerm& maximumValue(void) const {return _maximumValue;} const MSTerm& minimumValue(void) const {return _minimumValue;} void incrementValue(const MSTerm& incrementValue_) {_incrementValue=incrementValue_;} void maximumValue(const MSTerm& maximumValue_) {_maximumValue=maximumValue_;} void minimumValue(const MSTerm& minimumValue_) {_minimumValue=minimumValue_;} MSTermEntryField& operator=(const MSTerm& value_) {value(value_); return *this;} operator MSTerm&() {return value();} virtual void set(MSAttrValueList&); virtual MSAttrValueList& get(MSAttrValueList&); }; #endif aplus-fsf-4.22/src/MSGUI/MSText.H0000644000265000001440000002404610772770433012006 #ifndef MSTextHEADER #define MSTextHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include class MSText; class MSGC; class MSPixmap; class MSGUIExport MSText : public MSCompositeText { public: class MSGUIExport Panner : public MSPrimitive { friend class MSText; protected: virtual void expose(const XEvent *); public: Panner(MSWidget *); ~Panner(void); }; class MSGUIExport Vsb : public MSVScrollBar { protected: virtual void drag(void); virtual void change(void); public: Vsb(MSWidget *); ~Vsb(void); }; class MSGUIExport CursorTimer : public MSIntervalTimer { protected: MSText *_text; public: CursorTimer(MSText *,unsigned long); ~CursorTimer(void); virtual void process(void); }; class MSGUIExport ScrollTimer : public MSIntervalTimer { public: enum Direction{Up,Down}; ScrollTimer(MSText *,Direction direction_=Down); void direction(Direction direction_) {_direction=direction_;} Direction direction(void) {return _direction;} virtual void process(void); private: Direction _direction; MSText *_text; MSText *text(void) {return _text;} }; friend class Panner; friend class Vsb; friend class CursorTimer; friend class ScrollTimer; public: MSText(MSWidget *,const char *title_=0); MSText(MSWidget *,const MSStringVector&); ~MSText(void); void model(MSString&); void model(const MSString&); MSString& viewModel(void) { return *((MSString*)_model); } const MSString& viewModel(void) const { return *((MSString*)_model); } virtual void redraw(void); virtual void refresh(void); virtual void print(const char *file_=0); virtual void naturalSize(void); virtual void save(void); const char *string(void) const; unsigned length(void) const; unsigned maxEditLength(void) const; unsigned rows(void) const; unsigned columns(void) const; unsigned cursorPosition(void) const; unsigned firstLine(void) const; MSString selectedString(void) const; void string(const char *string_); void cursorPosition(unsigned position_); void firstLine(int firstLine_); void maxEditLength(unsigned); void rows(unsigned rows_); void columns(unsigned columns_); // key actions methods virtual void kill(void); virtual void yank(void); virtual void returnKey(void); virtual void escape(void); virtual void forwardChar(void); virtual void backwardChar(void); virtual void home(void); virtual void end(void); virtual void pageUp(void); virtual void pageDown(void); virtual void startOfLine(void); virtual void endOfLine(void); virtual void deleteChar(void); virtual void backspace(void); virtual void tab(void); virtual void shiftTab(void); virtual void up(void); virtual void down(void); virtual void insertMode(void); virtual void set(MSAttrValueList& avList_); virtual MSAttrValueList& get(MSAttrValueList& avList_); protected: class MSGUIExport Line { protected: unsigned _start; unsigned _end; MSBoolean _dirty; public: Line(void) { _start=0,_end=0,_dirty=MSTrue; } ~Line(void) {} void start(unsigned start_) { if (start_!=_start) {_start=start_;}} void end(unsigned end_) { if (end_!=_end) {_end=end_;}} void dirty(MSBoolean dirty_) { _dirty=dirty_; } void clean(void) { _dirty=MSFalse; } unsigned start(void) const { return _start; } unsigned end(void) const { return _end; } MSBoolean dirty(void) const { return _dirty; } }; protected: MSString _text; MSString _yankBuffer; Vsb *_vsb; Panner *_panner; MSLabel *_label; MSPixmap *_cursorPixmap; MSGC *_imageMSGC; CursorTimer *_blinkTimer; Line **_lines; unsigned _firstLine; unsigned _cursorPosition; unsigned _cursorX; unsigned _cursorY; unsigned _rows; unsigned _columns; unsigned _naturalRows; unsigned _naturalCols; unsigned _numLines; unsigned _maxNumLines; unsigned _maxEditLength; unsigned _selectionStart; unsigned _selectionLength; MSBoolean _blinkOn; MSBoolean _haveFocus; MSBoolean _cursorOn; int _startDrag; ScrollTimer *_scrollTimer; MSPixmap *cursorPixmap(void) const { return _cursorPixmap; } MSGC *imageMSGC(void)const { return _imageMSGC; } GC imageGC(void) const; Vsb *vsb(void) const { return _vsb; } Panner *panner(void) const { return _panner; } MSLabel *label(void) const { return _label; } CursorTimer *blinkTimer(void) const { return _blinkTimer; } Line *line(unsigned line_) const { return _lines[line_]; } Line **lines(void) const { return _lines; } MSBoolean blinkOn(void) const { return _blinkOn; } MSBoolean haveFocus(void) const { return _haveFocus; } MSBoolean cursorOn(void) const { return _cursorOn; } unsigned selectionStart(void) const { return _selectionStart; } unsigned selectionLength(void) const { return _selectionLength; } unsigned naturalRows(void) const { return _naturalRows; } unsigned naturalCols(void) const { return _naturalCols; } ScrollTimer *scrollTimer(void) { return _scrollTimer; } int startDrag(void) const { return _startDrag; } int selectionEnd(void) const { return _selectionStart+_selectionLength-1; } void init(void); void selectionStart(unsigned start_) { _selectionStart=start_; } void selectionLength(unsigned len_) { _selectionLength=len_; } MSBoolean primaryIsOurs(void) const; void startBlinking(void); void stopBlinking(void); void initLines(unsigned n_); void resetLines(void) { resetLinesFrom(0); } void resetLinesFrom(unsigned line_); void resetLinesAfterInsert(unsigned line_,unsigned cp_,unsigned slen_,MSBoolean insert_); void resetLinePosition(unsigned line_,unsigned pos_); void makeIBeamCursor(void); void createGCs(void); void moveCursorY(int); void moveCursorX(int); void moveCursor(int,int); virtual void scrollUp(unsigned n_); virtual void scrollDown(unsigned n_); virtual void positionLabel(void); virtual void placement(void); virtual void computeSize(void); virtual void drawTextFrom(unsigned pos_); virtual void drawLines(unsigned sl_,unsigned el_); virtual void drawCursor(void); virtual void clearCursor(void); virtual unsigned computeCursorPosition(void); virtual unsigned computeNumLines(unsigned start_,unsigned end_); virtual unsigned computeMaxNumLines(void); unsigned computeEndPosition(unsigned pos_); unsigned lineToPosition(unsigned line_); unsigned positionToRow(unsigned pos_); unsigned positionToCol(unsigned pos_); void positionToRowCol(unsigned pos_,unsigned& r_,unsigned& c_); void positionToXY(unsigned pos_,unsigned& x_,unsigned& y_); unsigned computeCursorX(unsigned,unsigned); unsigned lineLength(unsigned row_); unsigned yToRow(unsigned); unsigned computeX(unsigned,unsigned); unsigned lastLine(void); MSBoolean inRange(unsigned pos_); void selectRange(unsigned selectionStart_,unsigned selectionLength_); void clearSelection(void); void vsbValueUpdate(void); void updateVsb(void); void resetVsb(void); void insertString(const char *pString_); void deleteString(int start_,unsigned nunChars_); MSString& text(void); const MSString& text(void) const; MSString& yankBuffer(void); unsigned numLines(void); unsigned maxNumLines(void); unsigned cursorX(void); unsigned cursorY(void); unsigned drawHeight(void); unsigned drawWidth(void); void numLines(unsigned); void cursorX(unsigned xpos_); void cursorY(unsigned ypos_); virtual void updateData(void); void processCursorTimer(void); void lineStatus(void); void debugMode(MSBoolean); virtual void focusIn(void); virtual void focusOut(void); virtual void keyPress(const XEvent *,KeySym,unsigned int,const char *); virtual void buttonPress(const XEvent *); virtual void buttonRelease(const XEvent *); virtual void motionNotify(const XEvent *); virtual const char* getPrimarySelection(MSString&, int&); virtual void insertPrimarySelection(void); virtual void selectionClear(const XEvent *); virtual void configure(void); virtual void firstMapNotify(void); virtual void updateBackground(unsigned long); virtual void updateForeground(unsigned long); virtual void updateFont(Font); virtual void updateTitle(void); virtual void update(const MSIndexVector&); void updateCursor(void); virtual void updateSensitivity(void); virtual void updateReadOnly(void); }; inline MSString& MSText::text(void) { return _text; } inline const MSString& MSText::text(void) const { return _text; } inline const char *MSText::string(void) const { return (const char *)text(); } inline unsigned MSText::length(void) const { return _text.length(); } inline void MSText::maxEditLength(unsigned maxEditLength_) { _maxEditLength=maxEditLength_; } inline unsigned MSText::maxEditLength(void) const { return _maxEditLength; } inline unsigned MSText::rows(void) const { return _rows; } inline unsigned MSText::columns(void) const { return _columns; } inline unsigned MSText::cursorPosition(void) const { return _cursorPosition; } inline unsigned MSText::firstLine(void) const { return _firstLine; } inline MSString& MSText::yankBuffer(void) { return _yankBuffer; } inline unsigned MSText::numLines(void) { return _numLines; } inline unsigned MSText::maxNumLines(void) { return _maxNumLines; } inline unsigned MSText::cursorX(void) { return _cursorX; } inline unsigned MSText::cursorY(void) { return _cursorY; } inline unsigned MSText::drawHeight(void) { return _rows*textHeight(); } #endif aplus-fsf-4.22/src/MSGUI/MSTextEditor.H0000644000265000001440000007750210772770433013162 #ifndef MSTextEditorHEADER #define MSTextEditorHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include typedef struct ccf_ContextRec * ccf_Context; typedef void * MSTextEditorTextTag; class InsertContext; class MSTextEditor; class MSGUIExport MSTextEditorTypes { public: class InsertContext; enum ContentFormat { FormatUnknown, // Unknown format FormatIso2022, // ISO 2022 octet stream FormatTiff, // TIFF 6.0 Base line FormatJpeg, // JPEG/JFIF stream FormatGif, // GIF89a stream FormatCgm, // CGM octet stream FormatH261, // H.261 octet stream FormatOdif, // ODA/ODIF stream FormatRLE, // RLE stream FormatPBM // PBMPLUS Image streams }; enum Scaling { NOSCALING, // No scaling, visualize in real size WIDTH, // Width controlled, preserve aspect ratio HEIGHT, // Height controlled, preserve aspect ratio MAXASPECT, // Max size withing window, preserve aspect FITAREA // Fit exactly into window, change aspect }; enum InsertMode { RESET = 0, /* From initial state only */ CURRENT = -1, /* From insert pnt + initial state */ FOLLOWING = 1 /* Following insert pnt + init.state */ }; class TextFlowCallback; class MSGUIExport SnipMode { public: SnipMode(unsigned long bits_=0, MSTextEditorTextTag tag_=0, unsigned short size_mod_=100) : bits(bits_), tag(tag_), size_modification(size_mod_), _callback(0) { } ~SnipMode(); unsigned long bits; /* Mode bit vector, must be at least 32 bits */ MSTextEditorTextTag tag; /* Logical Content TAG */ unsigned short /* Graphic Size Modification for the font ** height. Specified as a percentage of the ** actual font size as defined by fonts ** resource. Default value is 100. */ size_modification; TextFlowCallback *_callback; SnipMode& operator=(const SnipMode&); }; // // SnipData // struct SnipData { unsigned short refs; /* # of Snip's referencing this data */ unsigned short bytes; /* # of bytes in character 1, 2 or 4 */ char *character_set; /* Character Set Registry & Encoding */ XFontStruct *font; /* Font information associated with data */ char s[1]; /* Start of data, dynamically allocated */ }; enum SnipBreak { Break_NONE, Break_BPH, /* Break Permitted Here */ Break_NBH /* No Break Permitted Here */ }; // // SnipSequenceEnd // Is non-zero for the last Snip belonging to the sequence. End of // sequence indicates also that the current position should be moved // the left margin of the positioning area. Additionally, "NL" can // be coded into it and causes the current position to move into the // next line. // enum SnipSequenceEnd { NoEnd = 0, /* Next Snip will continue the same sequence */ End = 1, /* End sequence, move to same "line origin" */ EndLine = 2, /* End sequence && terminate line */ EndParagraph = 3 /* End sequence && terminate paragraph */ }; // // text flow callbacks // class MSGUIExport TextFlowCallback { public: typedef void (*CallbackFunction)(MSWidget*, const MSSymbol&); TextFlowCallback(CallbackFunction function_, MSWidget* owner_, const MSSymbol name_) : _function(function_), _name(name_), _owner(owner_), _ref_count(1) {} TextFlowCallback(TextFlowCallback *c_); MSWidget* owner() { return _owner; } const MSSymbol& name() { return _name; } CallbackFunction func() { return _function; } static void deref(TextFlowCallback *); private: CallbackFunction _function; MSSymbol _name; // keep a local copy MSWidget * _owner; unsigned _ref_count; // callbacks are reference counted }; // // Snip // class MSGUIExport Snip { public: Snip(); ~Snip(); MSBoolean hasLayoutContents(); MSBoolean hasEditableContents(); MSBoolean hasProtectedContents(); MSBoolean hasEndPosition() { return MSBoolean((unsigned int)endseq != NoEnd); } MSBoolean hasEndLine() { return MSBoolean(endseq & 2); } MSBoolean hasEndParagraph() { return MSBoolean((unsigned int)endseq != EndParagraph); } int virtualLength() { return MSBoolean(length + hasEndPosition()); } Snip *previous(); Snip *next; /* Link to next Snip or NULL, if last */ Snip **back; /* Back link to from where this was pointed */ SnipMode mode; /* Current Snip state */ /* ** "Spot" flags concerning this snip (tab, tabref and quad are ** only examined if endseq is non-zero). */ unsigned int tabref:16; /* Tabulation Reference */ unsigned int tab:1; /* MSTrue, if Tabulation Reference present */ unsigned int quad:3; /* Forced quad (Alignment) */ unsigned int brk:2; /* NONE, BPH, NBH */ unsigned int endseq:2; /* This marks end of sequence */ unsigned int space:1; /* MSTrue, if Snip represents white space */ unsigned int layout:1; /* MSTrue, if layout information computed */ unsigned int valid:1; /* MSTrue, if layout need not be redone */ unsigned int widget:1; /* MSTrue, if this Snip is a child Widget */ /* ** 'floating' content is actually placed somewhere else and the ** Snip acts as a place holder only. Sometimes it will be ** useful to know this and ignore the xWidth, ascent and descent ** temporarily for such Snip (currently only for widget Snips). */ unsigned int floating:1;/* MSTrue, if floating content */ /* ** NOTE: ** because the Widget variant is very rare compared to the ** text variant of Snip, it is guaranteed that the 'data' ** field is NULL and 'length' is ZERO when the widget ** variant is set. This way most processing has no need to test ** widget variant specially. */ union { SnipData *head; /* Pointer to head of Data */ MSWidget *widget; /* Data==NULL, length==0 */ } content; char *data; /* Pointer to actual character codes */ int length; /* Number of characters */ /* ** Fields filled by the content layout process (layout information) ** Snip rectangle: ** Upper Left Corner = (x, y - ascent) ** Height = ascent + descent ** Width = xWidth ** ** The flags layout and valid used as follows ** ** layout valid ** False False Default initial state. Snip has not been ** assigned a position on display yet. ** True True State, when layout information has been ** computed and it matches the current display ** True False State, when layout information reflects the ** current display, but the real position after ** layout would be elsewhere (needed when the ** content is deleted). ** False True Illegal combination. Should never appear. */ int x, y; /* Position of this Snip */ int xWidth; /* The width of this element */ short ascent; /* Backward extent of this Snip */ short descent; /* Forward extent of this Snip */ /* ** 'offset' is mostly ZERO. When displaying the actual content ** of the Snip, it is added to the 'x' value to get the real ** x coordinate of the actual content. This is currently needed ** in the implementation of the 'framed' rendition, but may have ** other uses. */ short offset; /* Offset from x point to real content */ static Snip *Insert(Snip **list_); static Snip *Split(InsertContext *cx, Snip *t, int offset); static void Delete(Snip **list_); // // callback implementation support, creates a copy of the callback // object passed to it, and deletes the copy when the snip is // deleted. // Initially, callback() return 0. It returns the callback object // when a text flow callback has been set for this text. // MSBoolean activateCallback(); TextFlowCallback *callback() { return mode._callback; } void callback(TextFlowCallback *callback_); }; class MSGUIExport TextLocation { public: Snip *snip; int offset; }; enum Alignment { NOALIGNMENT, START, END, CENTER, JUSTIFIED, AROUND }; // TextExport // Defines the valid values for the exportFormat resource. This // resource selects the format for the exported selections, // GetString and TextSaveAsFile. In selections, the formats // are mapped to target atoms // // STRING* <-> STRING // ODIF* <-> COMPOUND_TEXT, STRING // // If exportFormat is STRING*start_, the widget will only // recognize STRING target; if ODIF*, the widget will // recognize both STRING and COMPOUND_TEXT, and the ODIF variants // are returned as COMPOUND_TEXT. // // The 'formatted' variants will include the line breaks caused // by possible word/line breaking algorithms. Source variant includes // only original "hard" line breaks. The 'formatted processable' // includes both source text and layout generated information // delimited by .. controls (as defined in ODA standard). // // NOTE: The numeric values have been designed (and are used) such that // value & 1 => include formatted information // value & 2 => produce ODIF (COMPOUND_TEXT) // value & 4 => produce ODIF enclosings for layout // control functions enum TextExport { STRING = 0, // 0, Latin1 source text STRING_F = 1, // 1, Latin1 formatted text ODIF = 2, // 2, COMPOUND_TEXT source text ODIF_F = 3, // 3, COMPOUND_TEXT formatted text ODIF_FP = 7 // 7, ODIF formatted processable }; typedef struct EditorFontListRec *EditorFontList; // Defined in TextFont.c class MSGUIExport EditorFont { public: int font_size; EditorFontList font_list; }; class MSGUIExport Itemization { public: int identifier_alignment; int identifier_start_offset; int identifier_end_offset; }; // TabStop // XtNlineLayoutTable is a pointer to an array of TabStop. The // last entry of the array must have negative value as a tabulation // reference. class MSGUIExport TabStop { public: int reference; int position; int alignment; char alignment_string[4]; // Currently only 3 chars can be used }; typedef struct _ClassRec *TextWidgetClass; typedef struct _Rec *TextWidget; // Run all of the widget content trough the layout process and // redisplay the new content. void Layout (); enum TextUnit { POINT, // Current point POSITION, // Virtual positions WORD, // A word LINE, // A line LINE_BEGIN, // Beginning of current line LINE_END, // End of current line PAGE, // Page PARAGRAPH, // Paragraph TAG, // Content with the same tag ALL // All content, End/Begin "file" }; enum TextHighlight { UNUSED, // Do not use in application NOHIGHLIGHT, // No special highlighting REVERSE, // Highlite with reverse video FRAME // Highlite with wire frame } ; class MSGUIExport TextRegion { public: TextRegion() : nrect(0), mode(NOHIGHLIGHT) { range[0]=range[1]=0; } TextHighlight mode; // Highlite mode int nrect; // Number rectangles in 'rect' long range[2]; // Affected text area (virtual offsets) XRectangle rect[3]; // Covering rectangles (for expose) }; class MSGUIExport TextSelection { public: TextSelection() : size(0), length(0), data(0) { } ~TextSelection() { if (data) free(data); } int size; // Current Size of data buffer int length; // Bytes in the data buffer char *data; // Allocated data buffer }; class MSGUIExport InsertContext { public: InsertContext(); ~InsertContext(); void adjustLastPointer(Snip *s_); void updateExposeArea(int x_, int y_, int w_, int h_); void flushAppend(); void initGxMap() { /* cmap?? */ } void lock(MSBoolean mode_) { _locked = mode_; } int feedContent(const char *s_, long n_); void insertLocation(TextLocation *dot_, Region expose_); Snip *endContent(Region expose_); Snip *beginAppend(int position_, char *character_set_, int nbytes_); Snip *insertSnip(Snip **where_); Snip *appendSnip(); SnipMode _mode; // Current Mode SnipMode _lock; // Locked Modes (mask bits) int _locked; // True if modes locked (InitialState) Snip **_list; // Current Snip List Head Pointer Snip *_last; // Current Last Snip int _pendingAccent; // Special for ISO 6937 conversion MSTextEditor *_editor; // Text Widget being processed Snip *_first; // First snip referencing current data int _size; // Total available bytes in data int _used; // Used bytes in data unsigned long _fontinfo; // Font information of the current data SnipData *_head; // Current data being collected ccf_Context _ccf; // Text filtering context Region _expose; // Bounding region of changed area. This // only covers the changes into snips that // already had layout=MSTrue and which were // changed. It cannot cover *new* inserted // content. Empty, until width is non-zero. }; enum MarkerId { MARK_Single, MARK_Double, MARK_Crossed, MARK_Overlined, MARK_Framed, MARK_Encircled, MARK_EnumSize /* Number of elements in Enum */ }; class MSGUIExport CornerMark { public: int x, y, h; Snip *s; }; class MSGUIExport ExposeContext { public: ExposeContext() : p(0,0,100) { } void markArea(Snip *s, Drawable d, MarkerId id, int x, int y, int h); void changeUnderline(Snip *s, Drawable d, int x, int y); void changeCrossedOut(Snip *s, Drawable d, int x, int y); void changeFraming(Snip *s, Drawable d, int x, int y); void changeForeground(Snip *s, Drawable d); void changeBackground(Snip *s, Drawable d); void flushPendingGraphics(Snip *s, int x, int y); MSTextEditor *editor; /* Current Text Widget */ Region my_r; /* Expose Area */ SnipMode p; /* Current Snip Mode */ CornerMark markers[(int)MARK_EnumSize]; }; // // LAYOUT_CONTENT_TAG // is an internal and special tag value that is associated with the // snips that are generated by this layout process self. It is used // to differentiate between application generated layout and normal // layout content. Currently application generated layout content // gets NULL tag. // // // The layout process needs to keep up quite a // lot of state information. This state is kept in static // variables local to this module to lessen the need to // pass many between local functions here. // class MSGUIExport SequenceState { public: short maxAscent; // Max character backward extent // short maxDescent; // Max character forward extent // MSTextEditorTextTag tag; // Current tag at this point // int wNow; // Total width up to this point // int spaces; // Number adjustable spaces *inside* line // int framed; // Non-zero, if framed state // }; // // ExpectEntry // stores the original Snip layout information if it was laid out // before this layout process. This is needed only because of the need // to generate good expose area and terminate layout process as // soon as possible after no changes start to happen to the line // boxes (This is a huge ugly hack of jugling x,y values in Snips // and I don't like it a bit.. --msa) // class MSGUIExport ExpectEntry { public: Snip *s; int x, y; int xWidth; short ascent, descent, offset; MSBoolean snip_moved; }; // // LayoutContext // collects all of the layout state variables into single structure // which will be dynamically allocated for each layout process (cannot // use global variables because it can happen that the layout process // is called for another widget in the middle of layout. // class MSGUIExport LayoutContext { public: MSTextEditor *editor; // Back Link to the Widget // int firstLine; // True, if this is the first LineBox // int lineLength; // Current available line length // int lineOffset; // Offset of from the line Home // int lineSpacing; // Current line spacing // short backwardExtent; // Line box backward extent // short forwardExtent; // Line box forward extent // short previousExtent; // Forward extent of the previous line box // short // Framing values for framed texts // top_framing, bottom_framing, left_framing, right_framing; int yShift; // Font baseline shift from line baseline // // // Wrap around parameters // int leftWidgetIndent; int rightWidgetIndent; SequenceState current; // Current sequence state // SequenceState lastSpace;// State at last space // Snip *firstSnip; // First Snip of the sequence // Snip *beginLine; // First Snip of the line box // }; class MSGUIExport InsertCursor { public: enum CursorMode { UnderLine, IBar, Solid, NoCursor }; InsertCursor(Display *, Window); ~InsertCursor(); void draw(GC gc, Drawable d, XPoint *origin, int lineSpacing, int width); void getBounds(XRectangle *rect); void cursorMode(CursorMode newMode) { draw_mode = newMode; } CursorMode cusorMode() { return draw_mode; } int x, y; unsigned int w, h; char *bits; Pixmap pixmap; int valid; TextLocation location; short goal; long position; Display *display; Window window; CursorMode draw_mode; }; enum DeleteOrKill { TEXT_KILL, TEXT_DELETE }; class MSGUIExport Vsb : public MSVScrollBar { protected: virtual void drag(void); virtual void change(void); public: Vsb(MSWidget *); ~Vsb(void); }; class MSGUIExport Hsb : public MSHScrollBar { protected: virtual void drag(void); virtual void change(void); public: Hsb(MSWidget *); ~Hsb(void); }; class MSGUIExport CursorTimer : public MSIntervalTimer { protected: MSTextEditor *_editor; public: CursorTimer(MSTextEditor *,unsigned long); ~CursorTimer(void); virtual void process(void); }; class MSGUIExport Panner : public MSPrimitive { friend class MSTextEditor; protected: virtual void expose(const XEvent *); public: Panner(MSWidget *); ~Panner(void); }; }; class MSGUIExport MSTextEditor : public MSTextEditorTypes, public MSWidgetCommon { friend class Vsb; friend class Hsb; friend class Panner; public: MSTextEditor(MSWidget *,const char *title_=0); MSTextEditor(MSWidget *,const MSStringVector&); ~MSTextEditor(void); typedef int (*ExtractFeedFunction) (char *text, int len, MSTextEditorTextTag content_TAG_value, void * client_data); void unfreeze(); void freeze(); void redraw(); void redrawImmediately(); MSBoolean saveInString(MSString &string_, MSBoolean textOnly_); MSBoolean saveAsFile(const char *name_ ); MSBoolean loadFromFile(const char *name_ ); char * getString(long *len_ ); char * getSubstring(long *len_, long start_, long end_ ); void extract(long start_, long end_, ExtractFeedFunction f_, void *data_); void replace(long start_, long end_, char *octects_, long len_); void insert(const char *str_, long len_); void insert(const char *str_); virtual void keyPress(const XEvent *pEvent_,KeySym keysym_, unsigned int state_,const char *buffer_); virtual void buttonPress(const XEvent *pEvent_); virtual void motionNotify(const XEvent *pEvent_); virtual void buttonRelease(const XEvent *pEvent_); void readonly(MSBoolean mode_); MSBoolean readonly(); void deleteBackwardChar(); void deleteBackwardWord(); void deleteCurrentSelection(); void deleteForwardChar(); void deleteForwardWord(); void deleteWholeContents(); void insertNewLine(); void insertNewLineAndBackup(); void insertSelection(); void killBackwardWord(); void killCurrentSelection(); void killForwardWord(); void killToEndOfLine(); void killToEndOfParagraph(); void moveBackwardChar(); void moveBackwardParagraph(); void moveBackwardWord(); void moveBackwardPage(); void moveBeginningOfFile(); void moveEndOfFile(); void moveForwardChar(); void moveForwardParagraph(); void moveForwardWord(); void moveForwardPage(); void moveNextLine(); void movePreviousLine(); void moveToLineEnd(); void moveToLineStart(); void moveToXY(int x, int y); void redrawDisplay(); void setColorBlack(); void setColorRed(); void setColorGreen(); void setColorYellow(); void setColorBlue(); void setColorMagenta(); void setColorCyan(); void setColorWhite(); void setColorDefault(); void setBackColorBlack(); void setBackColorRed(); void setBackColorGreen(); void setBackColorYellow(); void setBackColorBlue(); void setBackColorMagenta(); void setBackColorCyan(); void setBackColorWhite(); void setBackColorDefault(); static const char *GRSetFontDefault; static const char *GRSetFont1; static const char *GRSetFont2; static const char *GRSetFont3; static const char *GRSetFont4; static const char *GRSetFont5; static const char *GRSetFont6; static const char *GRSetFont7; static const char *GRSetFont8; static const char *GRSetFont9; static const char *GRSetForegroundDefault; static const char *GRSetForegroundBlack; static const char *GRSetForegroundRed; static const char *GRSetForegroundGreen; static const char *GRSetForegroundYellow; static const char *GRSetForegroundBlue; static const char *GRSetForegroundMagenta; static const char *GRSetForegroundCyan; static const char *GRSetForegroundWhite; static const char *GRSetBackgroundDefault; static const char *GRSetBackgroundBlack; static const char *GRSetBackgroundRed; static const char *GRSetBackgroundGreen; static const char *GRSetBackgroundYellow; static const char *GRSetBackgroundBlue; static const char *GRSetBackgroundMagenta; static const char *GRSetBackgroundCyan; static const char *GRSetBackgroundWhite; void insertWidget(MSWidget *widget_); void escape(); void tab(); void shiftTab(); TextFlowCallback *getInsertionPointCurrentCallback() const; static TextFlowCallback *NoCallback; const char * getInsertionPointCurrentForeground() const; const char * getInsertionPointCurrentBackground() const; const char * getInsertionPointCurrentFont() const; void replaceTagged(long start_, long end_, char *octects_, long len_, MSTextEditorTextTag tag_); void insertPrefix(char *octects_, long len_); long getInsertionPoint(); long scanLocation(TextUnit type_, int amount_, TextLocation *location_); long search(int amount_, char *string_, long len_, int caseSensitive_); MSTextEditorTextTag getInsertionTag(); void setInsertionTag(MSTextEditorTextTag tag_); void getSelectionPosition(Snip **start_, Snip **end_); void setSelection(Snip *start_, Snip *end_); void unsetSelection(); void getRegionPosition(TextRegion id_, long *start_, long *end_); int setRegion(long start_, long end_, TextHighlight mode_); int unsetRegion (TextRegion id_); Pixmap pixmap(void) { return _pixmap->pixmap(); } void setColors(const MSStringVector color_names_); const MSStringVector & getColors(void) { return _color_names; } void setFonts(const MSStringVector font_names_); void setFontDefault(); void setFont1(); void setFont2(); void setFont3(); void setFont4(); void setFont5(); void setFont6(); void setFont7(); void setFont8(); void setFont9(); // update notification methods - i.e. notify the widget that its font has // changed. The old value of the attribute is passed to the function virtual void updateFont(Font); virtual void updateForeground(unsigned long); virtual void updateBackground(unsigned long); void selectionStart(const XEvent *e); void selectionExtendAdjust(const XEvent *e); void selectionAdjust(const XEvent *e); void selectionEnd(const XEvent *e); void selectionExtendStart(const XEvent *e); void selectWord(const XEvent *e); void selectAll(const XEvent *e); void moveInsertionPoint(unsigned long location_); friend MSTextEditor& operator<<(MSTextEditor&, const char *); MSBoolean isInFormattingMode() { return _format; } void format(MSBoolean yes_or_no_) { _format = yes_or_no_; } // // text flow callbacks // void insert(const char *str_, TextFlowCallback *callback_); friend MSTextEditor& operator<<(MSTextEditor&, TextFlowCallback *); void selectLine(); void selectWord(); void selectAll(); static char *charsetDefault(); static int copy1_GL(InsertContext *cx, int n, unsigned char *s, unsigned char *tt, char *cset); unsigned long color(int n); void setForeground(unsigned long pixel_); void setBackground(unsigned long pixel_); void switchColor(); static void findExtents(Snip *s, Snip *e, int *ascent, int *descent); GC gc_Normal() { return _mygc; } GC gc_XOR() { return _mygcXOR; } int _rotation; // Rotation angle (degrees) [0-360] MSBoolean _resize; MSBoolean _content_loaded; MSBoolean _use_shm; MSBoolean _mirror_image; MSBoolean _parent_background; char * _content_file; char * _content_filter; FILE * _content_stream; char * _content_string; long _content_length; long _content_offset; Alignment _alignment; TextExport _export_format; int _first_line_offset; EditorFont* _fonts; Itemization * _itemization; TabStop * _line_layout_table; int * _kerning_offset; char * _graphic_rendition; char * _initial_state; MSBoolean _format; MSBoolean _proportional; MSBoolean _invert_shadow; int _line_spacing; int _defaultFontSize; int _column_width; int _indentation; int _shadow_contrast[2]; MSBoolean _allow_edit; // True, if editing allowed MSBoolean _display_caret; // True, if caret symbol is visible InsertCursor *cursor(); // Current insert cursor protected: virtual void configure(); void resetScrollbars(); void updateScrollbars(); void scrollbarsUpdated(); int numLines(void); int computeMaxNumLines(void); int numColumns(void); int computeMaxNumColumns(void); int firstLine(void); int firstColumn(void); Vsb *vsb() { return _vsb; } Hsb *hsb() { return _hsb; } Panner *panner(void) const { return _panner; } int pWidth(); int offset(); int pHeight(); InsertCursor *_cursor; // Current insert cursor private: void redisplay(XExposeEvent *event_, Region r, Drawable d); void initRefreshRegion(); void updateCursorPosition(MSBoolean goal_, MSBoolean expose_, MSBoolean bounds_); void updateTextRegions(MSBoolean bounds_); void updateTextRegion(TextRegion *region_, MSBoolean bounds_); void doRefreshRegions(); int startEditing(InsertMode mode_, XEvent *event_); void endEditing(int deleted_); void layout(int text_width_, Snip *start_, Region region_); void adjustSnipFirst(TextLocation *location_); void adjustSnipBeginning(TextLocation *location_); void adjustSnipEnding(TextLocation *location_); InsertContext *insertContent(Snip *after_, int position_, int mode_); InsertContext *beginContent(); long offset(TextLocation *dot_); void locations(long *offsets_, int n_, TextLocation *loc_return_, XPoint *p_); void coordinates(Snip *s, int offset, XPoint *xy); int snipWidth(Snip *snip_, char *str_, int len_); long findPosition(XPoint *goal, TextLocation *dot); long findPosition(int x, int y); void snipExtents(Snip *snip_); void checkBounds(XRectangle *area_); XFontStruct *findFont(char *charset, EditorFontList font, int font_nr, int weight, int posture, int size); int setupContent(int dolayout, int allow_resize); void insetSnipExtents(LayoutContext *cx, Snip *t); void computeWidth(LayoutContext *cx, Snip *t); int closeLineBox(LayoutContext *cx, Snip *end); Snip *wrapUpSequence(LayoutContext *cx, SequenceState *s, Snip *end, int x_adj); Snip *position_TEXT(LayoutContext *cx, SequenceState *text, Snip *last, Snip *end); Snip *position_ITEM(LayoutContext *cx, SequenceState *item, Snip *last); char *lookFor(char *d, char *s, int n); Snip *splitLine(LayoutContext *cx, SequenceState *text, Snip *last); void updateExposeArea(XRectangle *r, int x, int y, int width, int height); int updateExpose(XRectangle *expose, ExpectEntry *start, ExpectEntry *end, Snip *last, int mode); int adjustForWidgets(LayoutContext *cx, Snip *s); void moveCursor(unsigned long location_); void moveCursor(TextUnit move, int amount); void moveCursor(int x, int y); void startMoving(); void setOrigin(); void endMoving(); void notePosition(XEvent *event, XPoint *p); int deleteOrKillRange(int amount, DeleteOrKill mode); void deleteOrKill(TextUnit move, int amount, DeleteOrKill mode); Snip *deleteContent(InsertContext *cx, long amount); void initKeyTable(); void init(); void initColors(); void freeColors(); void modifySelection(const XEvent *event, int mode); void markSelection(Drawable d); MSString extractSelectedContent(); CursorTimer *blinkTimer(void) const { return _blinkTimer; } void processCursorTimer(void); void drawCursor(void); Vsb *_vsb; Hsb *_hsb; Panner *_panner; // // insert_prefix and insert_prefix_length define an octet string // that will be implicitly inserted every time an insert point // is opened. It should contain only control sequences to change // the graphic presentation from the default initialState. The // modes set by insert_prefix will be locked. The value can be set // with InsertPrefix function. // char *_insert_prefix; long _insert_prefix_length; // // Information about the cursor location in various levels. To // speed up some processing, the some precomputed information // is maintained (matching the cursor_location). // // (cursor_x, cursor_y) is the current (x,y) location matching // cursor_location. // cursor_location is the current (Snip, offset) pointer // matching the cursor_position. This is information is // the primary for defining the cursor position. // cursor_position // is the virtual offset matching the cursor_location. This // value is valid if cursor_valid is True (always True when // the control is outside the TextEd widget). // TextSelection _s; // Current text Selection int _mult; // Repeater count for actions Time _time; // Time of the last event Region _refresh; // Region requiring refresh on display // // Current Text Regions. A text region is a text segment defined by // two virtual offsets, and it may optionally be assocated with some // automatic highlighting. The first text region (id = 0) always // exists and is reserved for the selection mechanism. The remaining // entries are available for the application use and text_regions // array is resized as needed. The region identifier is an index // to this array. Unset region entries will be re-used, and the // text_regions array never shrinks. // int _num_regions; // Highest region entry in use int _max_regions; // Current size of text regions array TextRegion *_regions; // Text regions array pointer int _enable_display; // No layout and update processing while < 0 InsertContext *_inserting; // Non-NULL, if text inserting in progress int _num_tabs; // Number of entries in lineLayoutTable int _set_width; // The target width of the last layout Snip *_first; // Snips of this block GC _mygc; GC _mygcXOR; MSBoolean _highlight; // True when widget highlight is ON int _num_fonts; // Number of fonts MSStringVector _font_names; // user defined array of font names int _n_font_names; // Number of font names MSStringVector _color_names; // user defined array of color names int _n_color_names; // Number of color names unsigned long *_colors; // n_color_names longs, if texts uses colors int _num_colors; // Actual count of different colors in image int _num_allocated; // Number of allocated colors unsigned long *_alloc; // List of allocated colors Colormap _cmap; // Private Colormap MSBackingStorePixmap *_pixmap;// used for double buffering XPoint _origin; // Origin used when scrolling void computeVisibleSequence(Region r); MSBoolean _readonly; CursorTimer *_blinkTimer; friend class CursorTimer; }; #endif aplus-fsf-4.22/src/MSGUI/MSTextField.H0000644000265000001440000001723710772770433012756 #ifndef MSTextFieldHEADER #define MSTextFieldHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include class MSTextField; class MSGC; class MSTimer; class MSIntervalTimer; class MSGUIExport MSTextField : public MSPrimitiveText,public MSDoubleClick { class MSGUIExport CursorTimer : public MSIntervalTimer { private: MSTextField *_textField; public: CursorTimer(MSTextField *,unsigned long); ~CursorTimer(void); virtual void process(void); }; friend class CursorTimer; public: typedef const char *(*KeyTranslationFunction)(const XEvent *); enum EditingMode{InsertMode,OverstrikeMode}; MSTextField(MSWidget *); ~MSTextField(void); const MSString& text(void) const; unsigned margin(void) const; unsigned xMargin(void) const; unsigned yMargin(void) const; EditingMode editMode(void) const; unsigned maxLength(void) const; unsigned cursorPosition(void) const; unsigned length(void) const; virtual const char *string(void); unsigned scrollIndex(void) const; void margin(unsigned); // set both xMargin and yMargin to the same value void xMargin(unsigned); void yMargin(unsigned); void editMode(EditingMode); void maxLength(unsigned); void string(const char *); void cursorPosition(unsigned); void scrollIndex(unsigned); void selectRange(unsigned,unsigned); void selectAll(void); void clearSelection(void); static KeyTranslationFunction keyTranslationFunction(void); static void keyTranslationFunction(KeyTranslationFunction); void color(unsigned long,unsigned long); virtual void redraw(void); virtual void activate(void); virtual void escape(void); // key action methods virtual void insertKey(void); virtual void returnKey(void); virtual void kill(void); virtual void yank(void); virtual void forwardChar(void); virtual void backwardChar(void); virtual void home(void); virtual void end(void); virtual void deleteChar(void); virtual void backspace(void); virtual void tab(void); virtual void shiftTab(void); virtual void up(void); virtual void down(void); unsigned firstCursorPosition(void) const; const MSString& inputMask(void) const; void inputMask(const MSString&); char inputMaskCharacter(void) const; void inputMaskCharacter(char); MSBoolean inputMaskMode(void) const; // equivalent to inputMask.length()>0 void startEditing(EditingMode,unsigned); private: static KeyTranslationFunction _keyTranslationFunction; private: MSString _string; unsigned _cursorPosition; unsigned _xMargin; unsigned _yMargin; unsigned _maxLength; unsigned _selectionStart; unsigned _selectionEnd; EditingMode _editMode; MSPixmap *_cursorPixmap; MSGC *_imageMSGC; MSTimer *_blinkTimer; MSString _yankBuffer; protected: char *_selfInsertData; unsigned _scrollIndex; MSBoolean _blinkOn; MSBoolean _haveFocus; MSBoolean _cursorOn; MSString _inputMask; char _inputMaskCharacter; MSBoolean _masking; void init(void); void initKeyTranslations(void); void updateCursor(void); void makeIBeamCursor(void); void createGCs(void); void moveCursor(unsigned); void drawInsertCursor(void); void drawOverstrikeCursor(void); virtual void drawText(MSBoolean clear_=MSTrue); virtual void drawText(unsigned startPos_); virtual void drawCursor(void); virtual void clearCursor(void); virtual void clearTextArea(void); virtual unsigned computeCursorPosition(unsigned); unsigned computeVisibleLength(void); virtual void computeSize(void); unsigned positionToX(unsigned); MSBoolean haveFocus(void) const; MSBoolean blinkOn(void) const; MSBoolean cursorOn(void) const; MSPixmap *cursorPixmap(void) const; MSString& yankBuffer(void); MSGC *imageMSGC(void) const; GC imageGC(void) const; MSTimer *blinkTimer(void) const; const char *selfInsertData(void) const; unsigned selectionStart(void) const; unsigned selectionEnd(void) const; virtual unsigned textX(void); virtual unsigned textY(void); void startBlinking(void); void stopBlinking(void); void selfInsert(void); void selfInsertData(char *data_); void insertString(const char *string_); void deleteString(unsigned startPos_,unsigned numChars_); virtual void focusIn(void); virtual void focusOut(void); virtual void keyPress(const XEvent *,KeySym,unsigned int,const char*); virtual void buttonPress(const XEvent *); virtual void button1Press(const XEvent *); virtual void button2Press(const XEvent *); virtual void button3Press(const XEvent *); virtual void defaultDoubleClickBehavior(const XEvent *); virtual void configure(void); virtual void firstMapNotify(void); void processCursorTimer(void); virtual void updateBackground(unsigned long); virtual void updateForeground(unsigned long); virtual void updateFont(Font); void cursorPositionForw(unsigned); void cursorPositionBack(unsigned); MSBoolean masking(void) const; MSBoolean matchStringToMask(const MSString&) const; protected: MSBoolean isSelected(void) const; virtual void trackSelection(const XEvent *); }; inline MSBoolean MSTextField::haveFocus(void) const { return _haveFocus; } inline MSBoolean MSTextField::blinkOn(void) const { return _blinkOn; } inline MSBoolean MSTextField::cursorOn(void) const { return _cursorOn; } inline const MSString& MSTextField::text(void) const { return _string; } inline MSPixmap *MSTextField::cursorPixmap(void) const { return _cursorPixmap; } inline MSString& MSTextField::yankBuffer(void) { return _yankBuffer; } inline MSGC *MSTextField::imageMSGC(void) const { return _imageMSGC; } inline MSTimer *MSTextField::blinkTimer(void) const { return _blinkTimer; } inline const char *MSTextField::selfInsertData(void) const { return _selfInsertData; } inline unsigned MSTextField::scrollIndex(void) const { return _scrollIndex; } inline unsigned MSTextField::selectionStart(void) const { return _selectionStart; } inline unsigned MSTextField::selectionEnd(void) const { return _selectionEnd; } inline void MSTextField::selfInsertData(char *data_) { _selfInsertData=data_; } inline unsigned MSTextField::xMargin(void) const { return _xMargin; } inline unsigned MSTextField::yMargin(void) const { return _yMargin; } inline unsigned MSTextField::margin(void) const // need to bag - remove ref in MSGraphUI { return _yMargin; } inline MSTextField::EditingMode MSTextField::editMode(void) const { return _editMode; } inline unsigned MSTextField::maxLength(void) const { return _maxLength; } inline unsigned MSTextField::cursorPosition(void) const { return _cursorPosition; } inline unsigned MSTextField::length(void) const { return text().length(); } inline MSTextField::KeyTranslationFunction MSTextField::keyTranslationFunction(void) { return _keyTranslationFunction; } inline void MSTextField::keyTranslationFunction(KeyTranslationFunction function_) { _keyTranslationFunction=function_; } inline MSBoolean MSTextField::inputMaskMode(void) const { return _inputMask.length() == 0 ? MSFalse:MSTrue; } inline MSBoolean MSTextField::masking(void) const { return _masking; } inline char MSTextField::inputMaskCharacter(void) const { return _inputMaskCharacter; } inline const MSString& MSTextField::inputMask(void) const { return _inputMask; } inline void MSTextField::inputMaskCharacter(char wild_) { _inputMaskCharacter = wild_; } #endif aplus-fsf-4.22/src/MSGUI/MSTextRect.H0000644000265000001440000000470710772770433012626 #ifndef MSTextRectHEADER #define MSTextRectHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include class MSPixmap; class MSGUIExport MSTextRect : public MSRect { public: MSTextRect(MSWidget *); MSTextRect(MSWidget *,const char *); MSTextRect(MSWidget *,const MSString&); ~MSTextRect(void); MSWidget *owner(void) const; Display *display(void) const; MSDisplayServer *server(void) const; Window window(void) const; GC textGC(void) const; MSPixmap *stipple(void) const; const XFontStruct *textFontStruct(void) const; const MSString& label(void) const; int length(void) const; const char *string(void) const; unsigned long foreground(void) const; unsigned long background(void) const; Font font(void) const; MSBoolean sensitive(void) const; MSBoolean doubleByte(void) const; int textWidth(void) const; int textWidth(const char *pString_) const; int textWidth(const char *pString_,int len_) const; int charWidth(void) const; int charLbearing(void) const; int charRbearing(void) const; int textAscent(void) const; int textDescent(void) const; int textHeight(void) const; int charWidth(char aChar_) const; int charLbearing(char aChar_) const; int charRbearing(char aChar_) const; MSBoolean label(const MSString&); MSBoolean label(const char *); void resize(int w_,int h_); void moveTo(int x_,int y_); void font(Font); void background(unsigned long); void foreground(unsigned long); void sensitive(MSBoolean); protected: MSWidget *_owner; MSGC _textMSGC; XFontStruct *_textFontStruct; Font _fid; unsigned long _fg; unsigned long _bg; MSBoolean _sensitive; MSPixmap *_stipple; MSString _string; MSGC& textMSGC(void); void init(void); virtual void computeSize(void); virtual void updateForeground(unsigned long); virtual void updateBackground(unsigned long); virtual void updateFont(Font); virtual void updateSensitivity(void); private: const XCharStruct *charStruct(char aChar_) const; }; #ifndef MS_NO_INLINES #ifndef MSTextRectINLINES #include #endif #endif #endif aplus-fsf-4.22/src/MSGUI/MSTimeEntryField.H0000644000265000001440000000431610772770433013744 #ifndef MSTimeEntryFieldHEADER #define MSTimeEntryFieldHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSGUIExport MSTimeEntryField : public MSEntryFieldPlus { private: long _incrementValue; MSTime _minimumValue; MSTime _maximumValue; MSTime::MSTimeZone _timeZone; protected: virtual MSBoolean validate(const char *); virtual const char *formatOutput(MSString &); virtual void increment(void); virtual void decrement(void); MSTime& value(void) const { return *((MSTime *)_model); } void value(const MSTime& value_) const { if (MSView::model()!=0) value()=value_; } void init(void); virtual void generateInputMask(void); virtual void updateData(void); public: MSTimeEntryField(MSWidget *,const char *label_=0, const MSSymbol& tag_=MSSymbol::nullSymbol()); MSTimeEntryField(MSWidget *,MSTime&,const char *label_=0, const MSSymbol& tag_=MSSymbol::nullSymbol()); ~MSTimeEntryField(void); void model(MSTime&); void model(const MSTime&); MSTime& viewModel(void) { return *((MSTime*)_model); } const MSTime& viewModel(void) const { return *((MSTime*)_model); } long incrementValue(void) const {return _incrementValue;} const MSTime& maximumValue(void) const {return _maximumValue;} const MSTime& minimumValue(void) const {return _minimumValue;} void incrementValue(long incrementValue_) {_incrementValue=incrementValue_;} void maximumValue(const MSTime& maximumValue_) {_maximumValue=maximumValue_;} void minimumValue(const MSTime& minimumValue_) {_minimumValue=minimumValue_;} MSTimeEntryField& operator=(const MSTime& value_) {value(value_); return *this;} operator MSTime&() {return value();} void timeZone(MSTime::MSTimeZone); MSTime::MSTimeZone timeZone(void) const {return _timeZone;} virtual void set(MSAttrValueList&); virtual MSAttrValueList& get(MSAttrValueList&); }; #endif aplus-fsf-4.22/src/MSGUI/MSTitleMenuItem.H0000644000265000001440000000163610772770433013607 #ifndef MSTitleMenuItemHEADER #define MSTitleMenuItemHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSGUIExport MSTitleMenuItem : public MSMenuItem { public: MSTitleMenuItem(MSMenu *); MSTitleMenuItem(MSMenu *, const char *title_); MSTitleMenuItem(MSMenu *, const MSString& title_); ~MSTitleMenuItem(void); void alignment(MSAlignment); MSAlignment alignment(void) const { return _alignment; } virtual MSAttrValueList& get(MSAttrValueList&); virtual void set(MSAttrValueList&); protected: MSAlignment _alignment; void init(void); virtual void updateSensitivity(void); virtual int computeXCoord(void); }; #endif aplus-fsf-4.22/src/MSGUI/MSToggleButton.H0000644000265000001440000000233610772770433013475 #ifndef MSToggleButtonHEADER #define MSToggleButtonHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSToggleButton: public MSToggleButtonBase { public: MSToggleButton(MSWidget *,const char *label_, const MSSymbol& tag_=MSSymbol::nullSymbol()); MSToggleButton(MSWidget *,const MSStringVector& label_, const MSSymbol& tag_=MSSymbol::nullSymbol()); MSToggleButton(MSWidget *,const MSPixmap &pixmap_,const MSPixmap &insensitivePixmap_, const MSPixmap &armedPixmap_,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSToggleButton(MSWidget *,const char *label_,int integerTag_); MSToggleButton(MSWidget *,const MSStringVector& label_,int integerTag_); MSToggleButton(MSWidget *,const MSPixmap &pixmap_,const MSPixmap &insensitivePixmap_, const MSPixmap &armedPixmap_,int integerTag_); ~MSToggleButton(void); protected: void init(void); virtual void redraw(void); virtual void arm(void); virtual void disarm(void); }; #endif aplus-fsf-4.22/src/MSGUI/MSToggleButtonBase.H0000644000265000001440000000525510772770433014273 #ifndef MSToggleButtonBaseHEADER #define MSToggleButtonBaseHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSGUIExport MSToggleButtonBase : public MSActionButton { public: MSToggleButtonBase(MSWidget *,const char *label_, const MSSymbol& tag_=MSSymbol::nullSymbol()); MSToggleButtonBase(MSWidget *,const MSStringVector& label_, const MSSymbol& tag_=MSSymbol::nullSymbol()); MSToggleButtonBase(MSWidget *,const MSPixmap &pixmap_,const MSPixmap &insensitivePixmap_, const MSPixmap &armedPixmap_,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSToggleButtonBase(MSWidget *,const char *label_,int integerTag_); MSToggleButtonBase(MSWidget *,const MSStringVector& label_,int integerTag_); MSToggleButtonBase(MSWidget *,const MSPixmap &pixmap_,const MSPixmap &insensitivePixmap_, const MSPixmap &armedPixmap_,int integerTag_); ~MSToggleButtonBase(void); int toggleShadowThickness(void) const; unsigned long selectColor(void) const; void toggleShadowThickness(int); void selectColor(unsigned long); void selectColor(const char *); virtual void redraw(void); virtual MSAttrValueList& get(MSAttrValueList&); virtual void set(MSAttrValueList&); protected: int _toggleShadowThickness; int _spacing; unsigned long _selectColor; MSGC _selectMSGC; MSGC& selectMSGC(void); GC selectGC(void) const; int spacing(void) const; void init(void); void createGCs(void); virtual int computeXCoord(int row_,int column_,const char *,int); virtual void arm(void); virtual void disarm(void); virtual void activate(void); virtual void key(KeySym,unsigned int,const char*); virtual int computePixmapXCoord(const MSPixmap *); virtual int computePixmapYCoord(const MSPixmap *); virtual void computeSize(void); virtual void configure(void); virtual void button1Press(const XEvent *); virtual void button1Release(const XEvent *); virtual void motionNotify(const XEvent *); }; inline int MSToggleButtonBase::toggleShadowThickness(void) const { return _toggleShadowThickness; } inline unsigned long MSToggleButtonBase::selectColor(void) const { return _selectColor; } inline int MSToggleButtonBase::spacing(void) const { return _spacing; } inline MSGC& MSToggleButtonBase::selectMSGC(void) { return _selectMSGC; } inline GC MSToggleButtonBase::selectGC(void) const { return _selectMSGC.gc(); } #endif aplus-fsf-4.22/src/MSGUI/MSToggleMenuItem.H0000644000265000001440000000441010772770433013740 #ifndef MSToggleMenuItemHEADER #define MSToggleMenuItemHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1998-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSGUIExport MSToggleMenuItem : public MSMenuItem { public: MSToggleMenuItem(MSMenu *); MSToggleMenuItem(MSMenu *,const char *,char mnemonic_=0,int tag_=0); MSToggleMenuItem(MSMenu *,const MSString&,char mnemonic_=0,int tag_=0); MSToggleMenuItem(MSMenu *,const MSPixmap &pixmap_,const MSPixmap &insensitivePixmap_,int tag_=0); MSToggleMenuItem(MSMenu *,const MSString &,const MSPixmap &pixmap_,const MSPixmap &armedPixmap_, const MSPixmap &insensitivePixmap_,char mnemonic_=0,int tag_=0); MSToggleMenuItem(MSMenu *,const char *,const MSPixmap &pixmap_,const MSPixmap &armedPixmap_, const MSPixmap &insensitivePixmap_,char mnemonic_=0,int tag_=0); ~MSToggleMenuItem(void); void armedPixmap(const MSPixmap&); const MSPixmap *armedPixmap(void) const; void showDisarmState(MSBoolean); MSBoolean showDisarmState(void) const; void selectColor(unsigned long); void selectColor(const char *); unsigned long selectColor(void) const; // methods for builder support virtual void set(MSAttrValueList& avList_); virtual MSAttrValueList& get(MSAttrValueList& avList_); protected: MSPixmap *_armedPixmap; MSBoolean _showDisarmState; MSGC _selectMSGC; unsigned long _selectColor; void init(void); void initArmedPixmap(const MSPixmap &); virtual const MSPixmap *currentPixmap(void) const; virtual void computeSize(void); virtual int computeIndentation(void); virtual int symbolHeight(void) const; virtual int symbolWidth(void) const; }; inline const MSPixmap *MSToggleMenuItem::armedPixmap(void) const { return _armedPixmap; } inline MSBoolean MSToggleMenuItem::showDisarmState(void) const { return _showDisarmState; } inline void MSToggleMenuItem::showDisarmState(MSBoolean showDisarmState_) { _showDisarmState = showDisarmState_; } inline unsigned long MSToggleMenuItem::selectColor(void) const { return _selectColor; } #endif aplus-fsf-4.22/src/MSGUI/MSToolTip.H0000644000265000001440000000436510772770433012456 #ifndef MSToolTipHEADER #define MSToolTipHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include class MSPixmap; class ToolTipTimer; class MSGUIExport MSToolTip : public MSWidget { public: enum TailPosition{Top=1,Bottom=2,Left=4,Right=8}; enum Style{Bubble,Box}; MSToolTip(MSDisplayServer *); ~MSToolTip(void); const MSStringVector &toolTip(void) const {return _toolTip;} void toolTip(const MSStringVector &,MSWidget *displayFor_=0); Style style(void) const {return _style;} void style(Style); unsigned long delay(void) const {return _delay;} void delay(unsigned long); void tailPosition(unsigned tailPosition_) {_tailPosition=tailPosition_;} unsigned tailPosition(void) const {return _tailPosition;} MSWidget *displayFor(void) const {return _displayFor;} static MSBoolean displayToolTip(void); static void displayToolTip(MSBoolean); virtual void redraw(void); virtual void map(void); virtual void unmap(void); private: friend class ToolTipTimer; static MSBoolean _displayToolTip; MSStringVector _toolTip; unsigned _marginHeight; unsigned _marginWidth; unsigned _bubbleMarginHeight; unsigned _bubbleMarginWidth; MSFontObject _fontObject; GC _gc; ToolTipTimer *_timer; unsigned long _delay; unsigned _tailPosition; Style _style; MSWidget *_displayFor; MSFontObject &fontObject(void) {return _fontObject;} GC gc(void) {return _gc;} ToolTipTimer *timer(void) {return _timer;} unsigned marginHeight(void) {return _marginHeight;} unsigned marginWidth(void) {return _marginWidth;} unsigned bubbleMarginHeight(void) {return _bubbleMarginHeight;} unsigned bubbleMarginWidth(void) {return _bubbleMarginWidth;} virtual void updateFont(Font); virtual void updateForeground(unsigned long); virtual void updateBackground(unsigned long); virtual void computeSize(void); }; #endif aplus-fsf-4.22/src/MSGUI/MSTopLevel.H0000644000265000001440000000617110772770433012613 #ifndef MSTopLevelHEADER #define MSTopLevelHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSPixmap; class MSGUIExport MSTopLevel : public MSWidgetCommon { public: enum {WindowBorder=2,ResizeHandles=4,TitleBar=8, Menu=16,IconifyButton=32,MaximizeButton=64}; enum {Resize=2,Move=4,Minimize=8,Maximize=16,Close=32}; public: MSTopLevel(const char *windowTitle_=0); MSTopLevel(MSDisplayServer *,const char *windowTitle_=0); ~MSTopLevel(void); MSBoolean footer(void) const; MSBoolean header(void) const; MSBoolean resizeable(void) const; const MSString& windowManagerCommand(void) const; MSString windowTitle(void) const; MSString iconTitle(void) const; void minimumSize(int width_,int height_); void resizeable(MSBoolean); void footer(MSBoolean); void header(MSBoolean); void windowManagerCommand(const char *); void windowTitle(const char *); void iconTitle(const char *); void iconPixmap(const MSPixmap&); void addWMDecorations(unsigned long); void addWMFunctions(unsigned long); void removeWMDecorations(unsigned long); void removeWMFunctions(unsigned long); void workspacePresence(const MSString&); void workspacePresence(const MSStringVector&); MSStringVector workspacePresence(void) const; virtual void iconify(void); virtual void set(MSAttrValueList&); virtual MSAttrValueList& get(MSAttrValueList&); protected: struct MWMHints { enum Flags {FunctionsFlag=1,DecorationsFlag=2,InputModeFlag=4}; enum Functions {FAll=1,FResize=2,FMove=4,FMinimize=8,FMaximize=16,FClose=32}; enum Decorations {DAll=1,DBorder=2,DResizeHandles=4,DTitle=8, DMenu=16,DMinimize=32,DMaximize=64}; enum InputMode {IModeless=0,IPrimaryApplicationModal=1, ISystemModal=2,IFullApplicationModal=3}; long _flags; long _functions; long _decorations; int _inputMode; }; static MSString _windowManagerCommand; unsigned long _workspacePresenceCount; Atom *_workspacePresenceAtoms; MSBoolean _footer; MSBoolean _header; MSBoolean _resizeable; MSPixmap *_iconPixmap; MWMHints _mwmHints; MSBoolean _adjustWMPosition; MSPixmap *iconPixmap(void); void init(const char *windowTitle_); MSBoolean inWorkspace(Atom) const; void updateWorkspacePresence(void); virtual void workspacePresenceChangeNotify(void); void setWMSize(void); void setWMPosition(void); void setWMProtocols(void); void setWMSaveYourself(void); void setWMClientMachine(void); void setWMHints(void); void setWMNormalHints(void); void setWMCommand(void); void setWMDecorations(unsigned long,MSBoolean); void setWMFunctions(unsigned long,MSBoolean); virtual void quit(void); virtual void save(void); virtual void clientMessage(const XEvent *); }; #endif aplus-fsf-4.22/src/MSGUI/MSTrace.H0000644000265000001440000001203310772770434012112 #ifndef MSTraceHEADER #define MSTraceHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include class MSTraceSet; class MSGUIExport MSTrace : public MSG { friend class MSGraph; friend class MSTraceSet; public: MSTrace(MSTraceSet *,int col_=0,const MSSymbol& tag_=MSSymbol::nullSymbol()); ~MSTrace(void); MSTraceSet *traceSet(void) const {return _traceSet;} const MSSymbol& tag(void) const {return _tag;} void tag(const MSSymbol& tag_) {_tag=tag_;} protected: void init(void); int virtualCol(void) const {return _virtualCol;} int point(void) const {return _point;} int barCount(void) const {return _barCount;} int xOffset(void) const {return _xOffset;} int yOffset(void) const {return _yOffset;} int offset(void) const {return _offset;} double xShift(void) const {return _xShift;} MSBoolean autoScale(void) const {return _autoScale;} double lastDataPoint(void) const {return _lastDataPoint;} double yMax(void) const {return _yMax;} double yMin(void) const {return _yMin;} int dataCount(void) const; void virtualCol(int x_) {_virtualCol=x_;} void point(int x_) {_point=x_;} void barCount(int x_) {_barCount=x_;} void xOffset(int x_) {_xOffset=x_;} void yOffset(int x_) {_yOffset=x_;} void offset(int x_) {_offset=x_;} void xShift(double x_) {_xShift=x_;} void autoScale(MSBoolean x_) {_autoScale=x_;} void lastDataPoint(double x_) {_lastDataPoint=x_;} void yMin(double x_) {_yMin=x_;} void yMax(double x_) {_yMax=x_;} Font font(void) const {return _font;} const MSStringVector& textSymbol(void) const {return _textSymbol;} Pixmap stipple(void) const {return _stipple;} int symbolSize(void) const {return _symbolSize;} int lineWidth(void) const {return _lineWidth;} int xAxis(void) const {return _xAxis;} int yAxis(void) const {return _yAxis;} unsigned long lineStyle(void) const {return _lineStyle;} unsigned long lineWeight(void) const {return _lineWeight;} unsigned long style(void) const {return _hidden==MSTrue?MSNone:_style;} unsigned long symbol(void) const {return _symbol;} MSBoolean hidden(void) const {return _hidden;} MSBoolean x(void) const {return MSFalse;} unsigned long lineColor(void) const; unsigned long fillColor(void) const; const char *legend(void) const; const char *legend(unsigned) const; unsigned long lineColor(int,int) const; unsigned long fillColor(int,int) const; unsigned long lineColor(int) const; unsigned long fillColor(int) const; virtual double x(int) const; virtual double y(int) const; virtual double y(int,int) const; void font(const char *x_); void legend(const char *x_); void font(Font x_) {_font=x_;} void textSymbol(const MSStringVector& x_) {_textSymbol=x_;} void xAxis(int x_) {_xAxis=x_;} void yAxis(int x_) {_yAxis=x_;} void stipple(Pixmap x_) {_stipple=x_;} void symbolSize(int x_) {_symbolSize=x_%2==0?x_-1:x_;} void lineWidth(int x_) {_lineWidth=x_<35?x_:35;} void lineStyle(unsigned long x_) {_lineStyle=x_;} void lineWeight(int x_) {_lineWeight=x_<0?0:x_>4?4:x_;} void symbol(unsigned long x_) {_symbol=x_;} void hidden(MSBoolean x_) {_hidden=x_;} void style(unsigned long x_) {_style=x_;} private: MSTraceSet *_traceSet; MSSymbol _tag; MSStringVector _textSymbol; Pixmap _stipple; int _symbolSize; int _lineWidth; int _xOffset; int _yOffset; int _offset; int _xAxis; int _yAxis; int _virtualCol; int _point; int _barCount; int _lineWeight; unsigned long _symbol; unsigned long _style; unsigned long _lineStyle; Font _font; MSBoolean _autoScale; MSBoolean _hidden; double _xShift; double _lastDataPoint; double _yMin; double _yMax; }; #endif aplus-fsf-4.22/src/MSGUI/MSTraceSet.H0000644000265000001440000002415510772770434012576 #ifndef MSTraceSetHEADER #define MSTraceSetHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #include class MSGraph; class MSTrace; class MSTraceSet; class MSGUIExport MSTraceSet:public MSWidgetView,public MSG { friend class MSTrace; friend class MSGraph; public: MSTraceSet(MSGraph *,const char *legend_=0,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSTraceSet(MSGraph *,const MSStringVector& legend_,const MSSymbol& tag_=MSSymbol::nullSymbol()); ~MSTraceSet(void); const MSStringVector& legend(void) const; Font textFont(void) const; unsigned long textForeground(void) const; const MSSymbol& tag(void) const; MSGraph *graph(void) const; MSBoolean overlap(void) const; double pieAspectRatio(void) const; double pieDepthFactor(void) const; int primarySlice(void) const; MSAlignment primarySliceAlignment(void) const; int pieAngle(void) const; void tag(const MSSymbol&); void overlap(MSBoolean); void pieDepthFactor(double); void pieAspectRatio(double); void primarySlice(int); void primarySliceAlignment(MSAlignment); void pieAngle(int); void textFont(const char *); void textFont(Font); void textForeground(const char *); void textForeground(unsigned long); MSUnsignedLongVector& lineColors(void); MSUnsignedLongVector& fillColors(void); const MSUnsignedLongVector& lineColors(void) const; const MSUnsignedLongVector& fillColors(void) const; void pieOffsets(double); void pieOffsets(const MSFloatVector&); const MSFloatVector *pieOffsets(void) const; MSFloatVector *pieOffsets(void); unsigned long pieLegendAlignment(void) const; void pieLegendAlignment(unsigned long); void pieLegendAlignment(MSAlignment); unsigned long pieValueAlignment(void) const; void pieValueAlignment(unsigned long); void pieValueAlignment(MSAlignment); unsigned long piePercentAlignment(void) const; void piePercentAlignment(unsigned long); void piePercentAlignment(MSAlignment); MSFloat::MSFloatFormat piePercentFormat(void) const; void piePercentFormat(MSFloat::MSFloatFormat); double pieOffset(unsigned) const; double pieOffset(void) const; void pieProfiles(const MSFloatVector&); const MSFloatVector *pieProfiles(void) const; MSFloatVector *pieProfiles(void); double pieProfile(unsigned) const; void lineColor(unsigned long); void fillColor(unsigned long); void lineColor(unsigned long,unsigned); void fillColor(unsigned long,unsigned); void lineColor(const MSUnsignedLongVector&); void fillColor(const MSUnsignedLongVector&); void lineColor(const MSStringVector&); void fillColor(const MSStringVector&); void lineColor(const char *); void fillColor(const char *); unsigned long lineColor(unsigned) const; unsigned long fillColor(unsigned) const; unsigned long lineColor(unsigned,unsigned) const; unsigned long fillColor(unsigned,unsigned) const; virtual void selectable(MSBoolean); virtual void constraint(unsigned long); virtual MSBoolean selectable(void) const; virtual unsigned long constraint(void) const; virtual MSBoolean mapped(void) const; virtual void unmap(void); virtual void hide(void); virtual void show(void); virtual const char *legend(unsigned); virtual const MSStringVector& textSymbol(unsigned); virtual Font font(unsigned) const; virtual Pixmap stipple(unsigned) const; virtual void validateText(const MSStringVector); virtual const char *formatText(MSString &,unsigned); virtual unsigned textLength(void) const; virtual MSStringVector& text(void); virtual const MSStringVector& text(void) const; virtual MSUnsignedVector lineWidth(void) const; virtual MSUnsignedVector symbolSize(void) const; virtual MSUnsignedVector lineWeight(void) const; virtual MSAlignment xAxis(unsigned) const; virtual MSAlignment yAxis(unsigned) const; virtual unsigned long style(unsigned) const; virtual unsigned long symbol(unsigned) const; virtual unsigned lineWidth(unsigned) const; virtual unsigned symbolSize(unsigned) const; virtual unsigned long lineStyle(unsigned) const; virtual unsigned lineWeight(unsigned) const; virtual unsigned long traceFillColor(int,int) const; virtual unsigned long traceLineColor(int,int) const; virtual void legend(const char *); virtual void font(Font); virtual void font(const char *); virtual void stipple(Pixmap); virtual void lineWidth(unsigned); virtual void lineStyle(MSLineStyle); virtual void lineStyle(unsigned long); virtual void lineWeight(unsigned); virtual void xAxis(MSAlignment); virtual void yAxis(MSAlignment); virtual void style(Style); virtual void style(unsigned long); virtual void symbol(Symbol); virtual void symbol(unsigned long); virtual void symbolSize(unsigned); virtual void legend(const char *,unsigned); virtual void textSymbol(const MSStringVector&,unsigned); virtual void font(Font,unsigned); virtual void font(const char *,unsigned); virtual void stipple(Pixmap,unsigned); virtual void lineWidth(unsigned,unsigned); virtual void lineStyle(unsigned long,unsigned); virtual void lineWeight(unsigned,unsigned); virtual void xAxis(MSAlignment,unsigned); virtual void yAxis(MSAlignment,unsigned); virtual void style(unsigned long,unsigned); virtual void symbol(unsigned long,unsigned); virtual void symbolSize(unsigned,unsigned); virtual void legend(const MSStringVector&); virtual void textSymbol(const MSStringVector&); virtual void font(const MSUnsignedLongVector&); virtual void font(const MSStringVector&); virtual void stipple(const MSUnsignedLongVector&); virtual void lineWidth(const MSUnsignedVector&); virtual void lineStyle(const MSUnsignedLongVector&); virtual void lineWeight(const MSUnsignedVector&); virtual void xAxis(const MSUnsignedLongVector&, MSExplicitInit); virtual void yAxis(const MSUnsignedLongVector&, MSExplicitInit); virtual void style(const MSUnsignedLongVector&); virtual void symbol(const MSUnsignedLongVector&); virtual void symbolSize(const MSUnsignedVector&); virtual void xOrigin(double); virtual void yOrigin(double); virtual void set(MSAttrValueList&); virtual MSAttrValueList& get(MSAttrValueList&); const MSFormat& format(void) const; void format(const MSFormat&); unsigned selectRow(void) const; unsigned selectCol(void) const; protected: MSPointerArray& traceList(void); const MSPointerArray& traceList(void) const; MSTrace *trace(int i_) const; MSStringVector& legend(void); unsigned updateIndex(void) const; unsigned lastDataCount(void) const; int normalizedOffset(void) const; double xMax(void) const; double xMin(void) const; double yMax(void) const; double yMin(void) const; double xDelta(void) const; double xOffset(void) const; double yOffset(void) const; virtual int numColumns(void) const; virtual int dataCount(void) const; virtual double x(int) const; virtual double y(int,int) const; void selectRow(unsigned); void selectCol(unsigned); void updateIndex(unsigned); void lastDataCount(unsigned); void normalizedOffset(int); void xMin(double); void xMax(double); void yMin(double); void yMax(double); void xDelta(double); void xOffset(double); void yOffset(double); void selected(unsigned,unsigned); Font traceFont(MSTrace *); void deleteTraces(void); void computeExtents(void); void computeExtents(const MSIndexVector&); void configureTraces(void); virtual void create(void); virtual void map(void); virtual void updateData(void); virtual void setData(void); virtual void update(const MSIndexVector&); virtual void validate(int,int,double,double); virtual MSBoolean moveTraceValidate(double,double); virtual MSTraceSet* copyTraceValidate(MSGraph*,const char*, const MSSymbol&); virtual MSFloatMatrix asFloatMatrix(void) const; virtual void updateTraceStyle(unsigned long); void init(void); virtual const char *formatOutput(MSString &,unsigned,unsigned); private: MSSymbol _tag; unsigned _selectRow; unsigned _selectCol; MSBoolean _selectable; MSBoolean _overlap; double _xMin; double _xMax; double _yMin; double _yMax; double _xDelta; double _xOffset; double _yOffset; double _pieDepthFactor; double _pieAspectRatio; int _primarySlice; MSAlignment _primarySliceAlignment; double _pieOffset; int _pieAngle; unsigned _updateIndex; unsigned _lastDataCount; int _normalizedOffset; unsigned long _constraint; unsigned long _pieLegendAlignment; unsigned long _pieValueAlignment; unsigned long _piePercentAlignment; MSFloat::MSFloatFormat _piePercentFormat; static MSStringVector _text; MSStringVector _legend; MSUnsignedLongVector _lineColors; MSUnsignedLongVector _fillColors; Font _textFont; unsigned long _textForeground; MSPointerArray _traceList; MSFloatVector *_pieOffsets; MSFloatVector *_pieProfiles; MSFormat _format; }; #ifndef MS_NO_INLINES #ifndef MSTraceSetINLINES #include #endif #endif // We provide explicit "do_not_instantiate" pragmas here to avoid instantiation complications in // MStk applications. // #if !defined(__MSGUILIBRARY_BUILD__) && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma do_not_instantiate MSPointerArray #endif // !__MSGUILIBRARY_BUILD__ && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #endif aplus-fsf-4.22/src/MSGUI/MSTreeFormatFunctions.H0000644000265000001440000000167510772770434015027 #ifndef MSTreeFormatFunctionsHEADER #define MSTreeFormatFunctionsHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1999-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// /*************************************************************************************/ // msTreeFormatType - default calls member function format, specialize as necessary // msTreeSetType - default calls member function set , specialize as necessary /*************************************************************************************/ #include template inline void msTreeFormatType(T& t_, MSString& buffer_) { t_.format(buffer_); } template inline MSError::ErrorStatus msTreeSetType(T& t_, const char *buffer_) { return t_.set(buffer_); } #endif aplus-fsf-4.22/src/MSGUI/MSTreeListView.H0000644000265000001440000005534210772770434013454 #ifndef MSTreeListViewHEADER #define MSTreeListViewHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include template class VScrollBar; template class HScrollBar; template class MSTreeListView : public MSWidgetCommon, public MSDoubleClick { friend class VScrollBar; friend class HScrollBar; public: typedef MSObservableTree TreeModel; typedef MSObservableTree::Cursor TreeModelCursor; class NodeAttribute { protected: MSBoolean _sensitive; MSBoolean _expandable; MSBoolean _expandedState; MSStringVector _pixmap; MSStringVector _insensitivePixmap; MSStringVector _selectedPixmap; public: #if defined(MS_INLINE_TEMPLATE_NESTED_CLASS) NodeAttribute(void) : _sensitive(MSTrue),_expandable(MSFalse),_expandedState(MSFalse) {} ~NodeAttribute(void){} #else NodeAttribute(void); ~NodeAttribute(void); #endif MSBoolean sensitive(void) const { return _sensitive; } void sensitive(MSBoolean sensitive_) { _sensitive=sensitive_; } MSBoolean expandable(void) const { return _expandable; } void expandable(MSBoolean expandable_) { _expandable=expandable_; } MSBoolean expandedState(void) const { return _expandedState; } void expandedState(MSBoolean expandedState_) { _expandedState=expandedState_; } const MSStringVector &pixmap(void) const { return _pixmap; } void pixmap(const MSStringVector &pixmap_) { _pixmap=pixmap_; } const MSStringVector &insensitivePixmap(void) const { return _insensitivePixmap; } void insensitivePixmap(const MSStringVector &insensitivePixmap_) { _insensitivePixmap=insensitivePixmap_; } const MSStringVector &selectedPixmap(void) const { return _selectedPixmap; } void selectedPixmap(const MSStringVector &selectedPixmap_) { _selectedPixmap=selectedPixmap_; } }; class Iterator { public: virtual void nodeAttribute(const TreeModelCursor&,NodeAttribute &)=0; }; class ConstIterator { public: virtual void nodeAttribute(const TreeModelCursor&,const NodeAttribute &)=0; }; typedef MSGenericVector PixmapList; typedef MSIHashKeySet PixmapRegistry; typedef MSIHashKeySet::Cursor PixmapRegistryCursor; class NodeInfo; friend class NodeInfo; class NodeInfo { protected: int _level; MSBoolean _sensitive; MSBoolean _expandedState; MSBoolean _expandable; PixmapList _pixmap; PixmapList _insensitivePixmap; PixmapList _selectedPixmap; TreeModelCursor _modelCursor; NodeInfo *_parent; public: #if defined(MS_INLINE_TEMPLATE_NESTED_CLASS) NodeInfo(const MSTreeListView *treeView_, const NodeAttribute & nodeAttribute_, TreeModelCursor & modelCursor_,NodeInfo * parent_,int level_) : _modelCursor(modelCursor_),_parent(parent_),_level(level_) { attribute(treeView_,nodeAttribute_); } ~NodeInfo(void){} void attribute(const MSTreeListView *treeView_,const NodeAttribute& nodeAttribute_) { sensitive(nodeAttribute_.sensitive()); expandable(nodeAttribute_.expandable()); expandedState(nodeAttribute_.expandedState()); buildPixmapList(treeView_->pixmapRegistry(),pixmap(),nodeAttribute_.pixmap()); buildPixmapList(treeView_->pixmapRegistry(),insensitivePixmap(),nodeAttribute_.insensitivePixmap()); buildPixmapList(treeView_->pixmapRegistry(),selectedPixmap(),nodeAttribute_.selectedPixmap()); } NodeAttribute attribute(void) const { MSTreeListView::NodeAttribute nodeAttribute; nodeAttribute.sensitive(sensitive()); nodeAttribute.expandable(expandable()); nodeAttribute.expandedState(expandedState()); MSStringVector names; unsigned int i,nElements; nElements=pixmap().length(); for (i=0;i *,const NodeAttribute &,TreeModelCursor &,NodeInfo *,int); ~NodeInfo(void); void attribute(const MSTreeListView *,const NodeAttribute&); NodeAttribute attribute(void) const; #endif int level(void) const { return _level; } void level(int level_) { _level=level_; } MSBoolean sensitive(void) const { return _sensitive; } void sensitive(MSBoolean sensitive_) { _sensitive=sensitive_; } MSBoolean expandedState(void) const { return _expandedState; } void expandedState(MSBoolean expandedState_) { _expandedState=expandedState_; } MSBoolean expandable(void) const { return _expandable; } void expandable(MSBoolean expandable_) { _expandable=expandable_; } PixmapList &pixmap(void) { return _pixmap; } const PixmapList &pixmap(void) const { return _pixmap; } PixmapList &insensitivePixmap(void) { return _insensitivePixmap; } const PixmapList &insensitivePixmap(void) const { return _insensitivePixmap; } PixmapList &selectedPixmap(void) { return _selectedPixmap; } const PixmapList &selectedPixmap(void) const { return _selectedPixmap; } const TreeModelCursor &modelCursor(void) const { return _modelCursor; } TreeModelCursor &modelCursor(void) { return _modelCursor; } void parent(NodeInfo *parent_) {_parent=parent_;} NodeInfo *parent(void) const {return _parent;} #if !defined(MS_INLINE_TEMPLATE_NESTED_CLASS) MSBoolean isLastChild(void) const; void buildPixmapList(const PixmapRegistry&,PixmapList&,const MSStringVector&); #else MSBoolean isLastChild(void) const { if (parent()==0) return MSTrue; else { TreeModelCursor parentCursor(parent()->modelCursor()); parentCursor.setToLastExistingChild(); if (parentCursor==modelCursor()) return MSTrue; else return MSFalse; } } void buildPixmapList(const PixmapRegistry& pixmapRegistry_,PixmapList& pixmapList_, const MSStringVector& pixmapNames_) { pixmapList_.removeAll(); PixmapRegistryCursor cursor(pixmapRegistry_); for (unsigned i=0;i TreeEvent; typedef MSManagedPointer ManagedInfo; typedef MSTabularTree ResourceTree; typedef MSTabularTreeCursor ResourceTreeCursor; typedef MSISequence ScreenVector; typedef MSISequence::Cursor ScreenVectorCursor; protected: class Editor : public MSTextField { public: #if defined(MS_INLINE_TEMPLATE_NESTED_CLASS) Editor(MSWidget * owner_) : MSTextField(owner_) { _highlightThickness=0; selectInput(ExposureMask|ButtonPressMask); } ~Editor() {} virtual void activate(void) { ((MSTreeListView *)(owner()))->editorActivate(); } virtual void escape(void) { ((MSTreeListView *)(owner()))->editorEscape(); } #else Editor(MSWidget *); ~Editor(); virtual void activate(void); virtual void escape(void); #endif }; friend class Editor; MSVScrollBar *_vsb; MSHScrollBar *_hsb; MSWidgetCommon *_clipWindow; MSBackingStorePixmap *_redrawPixmap; MSPixmap *_collapsedButtonPixmap; MSPixmap *_expandedButtonPixmap; MSPixmap *_stipplePixmap; MSPixmap *_dotPixmap; MSPixmap *_dashPixmap; MSGC _gc; MSGC _linegc; MSGC _pixmapgc; MSFontObject _fontObject; MSIntVector _maxWidths; MSIntVector _tabStops; int _tabSpacing; int _maxRowHeight; int _maxRowWidth; int _rows; int _columns; int _rowHorizontalSpacing; int _rowVerticalSpacing; int _buttonShadowThickness; MSShadowStyle _buttonShadowStyle; int _firstRow; int _levelOffset; MSBoolean _showButtons; MSBoolean _showLines; MSBoolean _showRootNode; MSBoolean _useBackingStore; MSBoolean _hasFocus; unsigned long _lineForeground; MSLineStyle _lineStyle; unsigned long _selectedRowForeground; unsigned long _selectedRowBackground; ResourceTree _resourceTree; ScreenVector _screenVector; PixmapRegistry _pixmapRegistry; TreeModelCursor *_selectedNode; TreeModelCursor *_activatedNode; MSTextField *_pEditor; MSHScrollBar *hsb(void) {return _hsb;} MSVScrollBar *vsb(void) {return _vsb;} MSWidgetCommon *clipWindow(void) {return _clipWindow;} MSBackingStorePixmap *redrawPixmap(void) {return _redrawPixmap;} MSPixmap *stipplePixmap(void) {return _stipplePixmap;} MSPixmap *dotPixmap(void) {return _dotPixmap;} MSPixmap *dashPixmap(void) {return _dashPixmap;} MSIntVector &maxWidths(void) {return _maxWidths;} MSIntVector &tabStops(void) {return _tabStops;} int tabPixelSpacing(void) {return _tabSpacing*fontObject().charWidth();} void maxRowHeight(int maxRowHeight_) {_maxRowHeight=maxRowHeight_;} int maxRowHeight(void) const {return _maxRowHeight;} void maxRowWidth(int maxRowWidth_) {_maxRowWidth=maxRowWidth_;} int maxRowWidth(void) const {return _maxRowWidth;} void rowHorizontalSpacing(int rowHorizontalSpacing_) {_rowHorizontalSpacing=rowHorizontalSpacing_;} int rowHorizontalSpacing(void) const {return _rowHorizontalSpacing;} void rowVerticalSpacing(int rowVerticalSpacing_) {_rowVerticalSpacing=rowVerticalSpacing_;} int rowVerticalSpacing(void) const {return _rowVerticalSpacing;} int selectedHighlightThickness(void) const {return 1;} int highlightGap(void) const {return 1;} MSBoolean useBackingStore(void) {return _useBackingStore;} void useBackingStore(MSBoolean); MSBoolean hasFocus(void) {return _hasFocus;} void hasFocus(MSBoolean hasFocus_) {_hasFocus=hasFocus_;} int buttonWidth(void) const; int buttonHeight(void) const; MSGC &gc(void) {return _gc;} MSGC &linegc(void) {return _linegc;} MSGC &pixmapgc(void) {return _pixmapgc;} MSFontObject &fontObject(void) {return _fontObject; } TreeModel &modelTree(void) {return *(TreeModel *)_model;} const TreeModel &modelTree(void) const {return *(TreeModel *)_model;} ResourceTree &resourceTree(void) {return _resourceTree;} const ResourceTree &resourceTree(void) const {return _resourceTree;} ScreenVector &screenVector(void) {return _screenVector;} const ScreenVector &screenVector(void) const {return _screenVector;} PixmapRegistry &pixmapRegistry(void) {return _pixmapRegistry;} const PixmapRegistry &pixmapRegistry(void) const {return _pixmapRegistry;} virtual void configure(void); virtual void computeSize(void); virtual void firstMapNotify(void); virtual void focusIn(void); virtual void focusOut(void); virtual MSBoolean loseFocus(void); virtual void receiveEvent(MSEvent &); virtual void processPermuteEvent(TreeEvent &); virtual void processReshapeEvent(TreeEvent &); virtual void processDeleteEvent(TreeEvent &); virtual void processCopyEvent(TreeEvent &); virtual void processAssignEvent(TreeEvent &); virtual void updateData(void); virtual void keyPress(const XEvent *,KeySym,unsigned int,const char *); virtual void buttonPress(const XEvent *); virtual void button1Press(const XEvent *); virtual void button2Press(const XEvent *); virtual void button3Press(const XEvent *); virtual void up(void); virtual void down(void); virtual void left(void); virtual void right(void); virtual void home(void); virtual void end(void); virtual void pageUp(void); virtual void pageDown(void); virtual void returnKey(void); virtual ScreenVectorCursor nextUpScreenCursor(unsigned long &); virtual ScreenVectorCursor nextDownScreenCursor(unsigned long &); virtual void updateForeground(unsigned long); virtual void updateBackground(unsigned long); virtual void updateFont(Font); void init(void); void setGeometryDefaults(void); int rowFromY(int); int branchLength(void); void drawHighlight(Window); void clearDrawingArea(Window); void drawingAreaShadow(Window); void clearRow(Window,int); void buildCollapsedButtonPixmap(void); void buildExpandedButtonPixmap(void); void computeMaxRowSize(void); void computeMaxRowSize(ScreenVectorCursor &,ScreenVectorCursor &); void calculateRowSize(const ManagedInfo &,MSIntVector&,int&); void calculatePixmapSize(const PixmapList&,int&,int&); void rebuildScreen(MSBoolean); void buildResourceTreeAndScreenVector(Iterator *iterator_=0); void buildScreenVector(void); // The following are all recursive methods and build either the resource tree, // the screen vector or both void updateResourceTreeAndScreenVector(ResourceTreeCursor&,ScreenVectorCursor&,MSBoolean, Iterator *iterator_=0); void updateResourceTree(ResourceTreeCursor,TreeModelCursor); void updateScreenVector(ScreenVectorCursor &,ResourceTreeCursor); // The following method set/get all node attributes without rebuilding the resource tree void setAttributes(Iterator &); void getAttributes(ConstIterator &) const; ScreenVectorCursor findScreenCursor(const ResourceTreeCursor&,unsigned long &) const; ResourceTreeCursor findResourceCursor(const TreeModelCursor&) const; MSBoolean buttonSelected(ManagedInfo &,int,int); MSBoolean labelSelected(ManagedInfo &,int,int); MSBoolean isSelected(TreeModelCursor &); MSBoolean isRowOnScreen(int); MSBoolean locateSelectedNode(ResourceTreeCursor); virtual void reportError(const char *) const; virtual void vsbChanged(void); virtual void hsbChanged(void); virtual void updateVsb(void); virtual void updateHsb(void); virtual void adjustRowColumn(void); virtual void adjustFirstRow(void); virtual void adjustFirstColumn(void); virtual void adjustLevels(void); virtual void adjustSize(void); virtual void adjustView(void); virtual void resetFirstRowColumn(void); virtual void resetSelectedNode(void); virtual void redrawImmediately(void); virtual void updateRow(TreeModelCursor&); virtual void updateRow(ManagedInfo&,int); virtual void drawRows(Window,int,int); virtual void drawRow(Window,const ManagedInfo&,int); virtual void drawRow(Window,const ManagedInfo&,int,int); virtual void drawPixmaps(Window,const PixmapList&,int&,int&); virtual void drawString(Window,const ManagedInfo&,int,int); virtual void drawTabbedString(Window,const ManagedInfo&,int,int); virtual void scrollUp(int); virtual void scrollDown(int); virtual void expandSubTree(ScreenVectorCursor &,unsigned long); virtual void collapseSubTree(ScreenVectorCursor &,unsigned long); virtual void subTreeCollapsed(ManagedInfo &); virtual void subTreeExpanded(ManagedInfo &); //The followings can be overriden by subclasses to respond to different types of event //instead of receiving a callback. The default implementation of these methods just //trigger the appropriate callback. virtual void subTreeCollapsedNotify(void); virtual void subTreeExpandedNotify(void); virtual void doubleClickNotify(void); virtual void nodeSelectionNotify(void); virtual void button2SelectionNotify(void); virtual void button3SelectionNotify(void); //The followings can be overriden by subclasses to control the attribute of each node //The following virtual void nodeModified(const TreeModelCursor &,NodeAttribute &); virtual void nodeAttribute(const TreeModelCursor &,NodeAttribute &); virtual MSBoolean isSensitive(const NodeInfo *); virtual MSBoolean isExpandable(const NodeInfo *); virtual MSBoolean isExpanded(const NodeInfo *); virtual MSBoolean isNodeProtected(const NodeInfo *); virtual const PixmapList &pixmap(const NodeInfo *); virtual const PixmapList &selectedPixmap(const NodeInfo *); virtual const PixmapList &insensitivePixmap(const NodeInfo *); virtual unsigned long nodeForeground(const NodeInfo *); virtual const char *formatOutput(MSString &, TreeModelCursor &); virtual MSBoolean validate(TreeModelCursor &,const char *); virtual void editorEscape(void); virtual void editorActivate(void); virtual void mapEditor(void); MSTextField *editor(void) {return _pEditor;} public: MSTreeListView(MSWidget *owner_,TreeModel &tree_); MSTreeListView(MSWidget *owner_); ~MSTreeListView(void); void model(TreeModel &); void model(const TreeModel &); TreeModel& viewModel(void) { return modelTree(); } const TreeModel& viewModel(void) const { return modelTree(); } void rows(int); int rows(void) const {return _rows;} void columns(int); int columns(void) const {return _columns;} void firstRow(int); int firstRow(void) const {return _firstRow;} void firstNode(const TreeModelCursor &); TreeModelCursor firstNode(void) const; void selectedNode(const TreeModelCursor &); TreeModelCursor selectedNode(void) const; TreeModelCursor activatedNode(void) const; void collapsedButtonPixmap(const MSPixmap &); const MSPixmap &collapsedButtonPixmap(void) const {return *_collapsedButtonPixmap;} void expandedButtonPixmap(const MSPixmap &); const MSPixmap &expandedButtonPixmap(void) const {return *_expandedButtonPixmap;} void buttonShadowThickness(int buttonShadowThickness_); int buttonShadowThickness(void) const {return _buttonShadowThickness;} void buttonShadowStyle(MSShadowStyle buttonShadowStyle_); MSShadowStyle buttonShadowStyle(void) const {return _buttonShadowStyle;} void sensitive(const TreeModelCursor &,MSBoolean); MSBoolean sensitive(const TreeModelCursor &) const; void expandedState(const TreeModelCursor &,MSBoolean); MSBoolean expandedState(const TreeModelCursor &) const; void expandable(const TreeModelCursor &,MSBoolean); MSBoolean expandable(const TreeModelCursor &) const; void pixmap(const TreeModelCursor &,const MSStringVector &); MSStringVector pixmap(const TreeModelCursor &) const; void insensitivePixmap(const TreeModelCursor &,const MSStringVector &); MSStringVector insensitivePixmap(const TreeModelCursor &) const; void selectedPixmap(const TreeModelCursor &,const MSStringVector &); MSStringVector selectedPixmap(const TreeModelCursor &) const; void lineForeground(const char *); void lineForeground(unsigned long); unsigned long lineForeground(void) const {return _lineForeground;} void lineStyle(MSLineStyle); MSLineStyle lineStyle(void) const {return _lineStyle;} void selectedRowForeground(const char *); void selectedRowForeground(unsigned long); unsigned long selectedRowForeground(void) const {return _selectedRowForeground;} void selectedRowBackground(const char *); void selectedRowBackground(unsigned long); unsigned long selectedRowBackground(void) const {return _selectedRowBackground;} void levelOffset(int); int levelOffset(void) const {return _levelOffset;} void tabSpacing(int); int tabSpacing(void) const {return _tabSpacing;} void showButtons(MSBoolean); MSBoolean showButtons(void) const {return _showButtons;} void showLines(MSBoolean); MSBoolean showLines(void) const {return _showLines;} void showRootNode(MSBoolean); MSBoolean showRootNode(void) const {return _showRootNode;} void registerPixmap(const MSPixmap &); const MSPixmap *pixmap(const MSString &) const; void setNodeAttributes(Iterator &); void getNodeAttributes(ConstIterator &) const; void setDefaultNodeAttributes(void); int numRows(void) const; virtual void redraw(void); virtual void naturalSize(void); virtual void unfreeze(void); //Make MSWidgets' sensitive visible, because //we also have node specific sensitive functions. void sensitive(MSBoolean); MSBoolean sensitive(void) const; void makeVisible(const TreeModelCursor &); MSBoolean isVisible(const TreeModelCursor &) const; void edit(void); MSBoolean editing(void) const; unsigned long addEditorKeyCallback( const char*,MSKeyCallback*); void removeEditorKeyCallback(unsigned long); void removeEditorKeyCallback(const char*); virtual void set(MSAttrValueList& avList_); virtual MSAttrValueList& get(MSAttrValueList& avList_); }; #ifndef MSTreeViewHEADER DECLARE_ELEMENT_FOR_OPS_TYPE(MSPixmap) inline MSString const &key(const MSPixmap &pixmap_) { return pixmap_.name(); } #endif // We provide explicit "do_not_instantiate" pragmas here to avoid instantiation complications in // MStk applications. // #if !defined(__MSGUILIBRARY_BUILD__) && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma do_not_instantiate MSIHashKeySet #pragma do_not_instantiate MSIHashKeySetNode #pragma do_not_instantiate MSIHashKeySetCursor #pragma do_not_instantiate MSGenericVector #pragma do_not_instantiate MSGenericVectorOps #pragma do_not_instantiate MSGenericData #endif // !__MSGUILIBRARY_BUILD__ && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #endif aplus-fsf-4.22/src/MSGUI/MSTreeView.H0000644000265000001440000005376110772770434012623 #ifndef MSTreeViewHEADER #define MSTreeViewHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #include #include class MSPixmap; template class MSTreeView : public MSScrollableWidget, public MSDoubleClick { public: typedef MSObservableTree TreeModel; typedef typename MSObservableTree::Cursor TreeModelCursor; #ifdef MS_CLASS_ENUM_OVERLOADING_BUG enum Orientation2 {Vertical=0,Horizontal=1}; typedef int Orientation; #else enum Orientation {Vertical=0,Horizontal=1}; #endif class NodeAttribute { protected: MSBoolean _sensitive; MSBoolean _expandable; MSBoolean _expandedState; MSStringVector _pixmap; MSStringVector _insensitivePixmap; MSStringVector _selectedPixmap; public: #if defined(MS_INLINE_TEMPLATE_NESTED_CLASS) NodeAttribute(void) : _sensitive(MSTrue),_expandable(MSFalse),_expandedState(MSFalse) {} NodeAttribute(const NodeAttribute &nodeAttr_) : _sensitive(nodeAttr_.sensitive()), _expandable(nodeAttr_.expandable()), _expandedState(nodeAttr_.expandedState()),_pixmap(nodeAttr_.pixmap()), _insensitivePixmap(nodeAttr_.insensitivePixmap()), _selectedPixmap(nodeAttr_.selectedPixmap()) {} ~NodeAttribute(void) {} #else NodeAttribute(void); NodeAttribute(const NodeAttribute &); ~NodeAttribute(void); #endif MSBoolean sensitive(void) const { return _sensitive; } void sensitive(MSBoolean sensitive_) { _sensitive=sensitive_; } MSBoolean expandable(void) const { return _expandable; } void expandable(MSBoolean expandable_) { _expandable=expandable_; } MSBoolean expandedState(void) const { return _expandedState; } void expandedState(MSBoolean expandedState_) { _expandedState=expandedState_; } const MSStringVector &pixmap(void) const { return _pixmap; } void pixmap(const MSStringVector & pixmap_) { _pixmap=pixmap_; } const MSStringVector &insensitivePixmap(void) const { return _insensitivePixmap; } void insensitivePixmap(const MSStringVector & pixmap_) { _insensitivePixmap=pixmap_; } const MSStringVector &selectedPixmap(void) const { return _selectedPixmap; } void selectedPixmap(const MSStringVector& selectedPixmap_) { _selectedPixmap=selectedPixmap_; } #if defined(MS_INLINE_TEMPLATE_NESTED_CLASS) NodeAttribute & operator=(const NodeAttribute &nodeAttr_) { if (&nodeAttr_!=this) { _sensitive=nodeAttr_.sensitive(); _expandable=nodeAttr_.expandable(); _expandedState=nodeAttr_.expandedState(); _pixmap=nodeAttr_.pixmap(); _insensitivePixmap=nodeAttr_.insensitivePixmap(); _selectedPixmap=nodeAttr_.selectedPixmap(); } return *this; } MSBoolean operator==(const NodeAttribute &nodeAttr_) { if (sensitive()==nodeAttr_.sensitive()&& expandable()==nodeAttr_.expandable()&& expandedState()==nodeAttr_.expandedState()&& pixmap()==nodeAttr_.pixmap()&& insensitivePixmap()==nodeAttr_.insensitivePixmap()&& selectedPixmap()==nodeAttr_.selectedPixmap()) { return MSTrue; } else { return MSFalse; } } #else NodeAttribute &operator=(const NodeAttribute &nodeAttr_); MSBoolean operator==(const NodeAttribute &nodeAttr_); #endif }; class Iterator { public: virtual void nodeAttribute(const TreeModelCursor&,NodeAttribute &)=0; }; class ConstIterator { public: virtual void nodeAttribute(const TreeModelCursor&,const NodeAttribute &)=0; }; MSTreeView(MSWidget *owner_,TreeModel &); MSTreeView(MSWidget *owner_); ~MSTreeView(void); void model(TreeModel &); void model(const TreeModel &); TreeModel& viewModel(void) { return modelTree(); } const TreeModel& viewModel(void) const { return modelTree(); } void selectedNode(const TreeModelCursor &); TreeModelCursor selectedNode(void) const; void startNode(const TreeModelCursor &); TreeModelCursor startNode(void) const; void sensitive(const TreeModelCursor &,MSBoolean); MSBoolean sensitive(const TreeModelCursor &) const; void expandedState(const TreeModelCursor &,MSBoolean); MSBoolean expandedState(const TreeModelCursor &) const; void expandable(const TreeModelCursor &,MSBoolean); MSBoolean expandable(const TreeModelCursor &) const; void pixmap(const TreeModelCursor &,const MSStringVector &); MSStringVector pixmap(const TreeModelCursor &) const; void insensitivePixmap(const TreeModelCursor &,const MSStringVector &); MSStringVector insensitivePixmap(const TreeModelCursor &) const; void selectedPixmap(const TreeModelCursor &,const MSStringVector &); MSStringVector selectedPixmap(const TreeModelCursor &) const; void makeVisible(const TreeModelCursor &); MSBoolean isVisible(const TreeModelCursor &) const; MSPopupMenu *popupMenu(void) {return _pPopupMenu;} const MSPopupMenu *popupMenu(void) const {return _pPopupMenu;} void popupMenu(MSPopupMenu *); void collapsedButtonPixmap(const MSPixmap &); const MSPixmap &collapsedButtonPixmap(void) const {return *_collapsedButtonPixmap;} void expandedButtonPixmap(const MSPixmap &); const MSPixmap &expandedButtonPixmap(void) const {return *_expandedButtonPixmap;} void showButtons(MSBoolean); MSBoolean showButtons(void) const {return _showButtons;} void showLabels(MSBoolean); MSBoolean showLabels(void) const {return _showLabels;} void showPixmaps(MSBoolean); MSBoolean showPixmaps(void) const {return _showPixmaps;} void buttonShadowThickness(int buttonShadowThickness_); int buttonShadowThickness(void) const {return _buttonShadowThickness;} void lineForeground(const char *); void lineForeground(unsigned long); unsigned long lineForeground(void) const {return _lineForeground;} void nodeForeground(const char *); void nodeForeground(unsigned long); unsigned long nodeForeground(void) const {return _nodeForeground;} void nodeBackground(const char *); void nodeBackground(unsigned long); unsigned long nodeBackground(void) const {return _nodeBackground;} void selectedNodeForeground(const char *); void selectedNodeForeground(unsigned long); unsigned long selectedNodeForeground(void) const {return _selectedNodeForeground;} void selectedNodeBackground(const char *); void selectedNodeBackground(unsigned long); unsigned long selectedNodeBackground(void) const {return _selectedNodeBackground;} void orientation(Orientation); Orientation orientation(void) const {return _orientation;} void verticalSpacing(int); int verticalSpacing(void) const {return _verticalSpacing;} void horizontalSpacing(int); int horizontalSpacing(void) const {return _horizontalSpacing;} void showRootNode(MSBoolean); MSBoolean showRootNode(void) const {return _showRootNode;} void setNodeAttributes(Iterator &); void getNodeAttributes(ConstIterator &) const; void setDefaultNodeAttributes(void); void registerPixmap(const MSPixmap &); const MSPixmap *pixmap(const MSString &) const; TreeModelCursor activatedNode(void) const; virtual void activate(void); virtual void up(void); virtual void down(void); virtual void left(void); virtual void right(void); virtual void set(MSAttrValueList& avList_); virtual MSAttrValueList& get(MSAttrValueList& avList_); virtual void print(const char *file_=0); virtual void unfreeze(void); virtual void show(void); void sensitive(MSBoolean); MSBoolean sensitive(void) const; void edit(void); MSBoolean editing(void) const; unsigned long addEditorKeyCallback( const char*,MSKeyCallback*); void removeEditorKeyCallback(unsigned long); void removeEditorKeyCallback(const char*); protected: typedef MSGenericVector PixmapList; typedef MSIHashKeySet PixmapRegistry; typedef MSIHashKeySet::Cursor PixmapRegistryCursor; class Editor : public MSTextField { public: #if defined(MS_INLINE_TEMPLATE_NESTED_CLASS) Editor(MSWidget * owner_) : MSTextField(owner_) { _highlightThickness=0; color(owner()->background(),owner()->foreground()); selectInput(ExposureMask|ButtonPressMask); } ~Editor() {} virtual void activate(void) { ((MSTreeView *)(owner()->owner()))->editorActivate(); } virtual void escape(void) { ((MSTreeView *)(owner()->owner()))->editorEscape(); } #else Editor(MSWidget *); ~Editor(); virtual void activate(void); virtual void escape(void); #endif }; friend class Editor; public: class TreeNode; friend class TreeNode; class TreeNode { private: int _x; int _y; int _width; int _height; MSBoolean _sensitive; MSBoolean _expandedState; MSBoolean _expandable; PixmapList _pixmap; PixmapList _insensitivePixmap; PixmapList _selectedPixmap; TreeModelCursor _cursor; public: TreeNode(const MSTreeView *treeView_, const TreeModelCursor &cursor_, const NodeAttribute &nodeAttribute_) : _cursor(cursor_), _x(0), _y(0), _width(0), _height(0), _sensitive(nodeAttribute_.sensitive()), _expandedState(nodeAttribute_.expandedState()), _expandable(nodeAttribute_.expandable()) { buildPixmapList(treeView_->pixmapRegistry(),pixmap(),nodeAttribute_.pixmap()); buildPixmapList(treeView_->pixmapRegistry(),insensitivePixmap(),nodeAttribute_.insensitivePixmap()); buildPixmapList(treeView_->pixmapRegistry(),selectedPixmap(),nodeAttribute_.selectedPixmap()); } TreeNode& operator=(const TreeNode& aTreeNode_) { if (this!=&aTreeNode_) { _cursor=aTreeNode_._cursor; } return *this; } MSBoolean operator==(const TreeNode& aTreeNode_) { if (cursor()==aTreeNode_.cursor()) return MSTrue; else return MSFalse; } ~TreeNode(void) {} int x(void) const {return _x;} void x(int x_) {_x=x_;} int y(void) const {return _y;} void y(int y_) {_y=y_;} int width(void) const {return _width;} void width(int width_) {_width=width_;} int height(void) const {return _height;} void height(int height_) {_height=height_;} MSBoolean sensitive(void) const {return _sensitive;} void sensitive(MSBoolean sensitive_) {_sensitive=sensitive_;} MSBoolean expandedState(void) const {return _expandedState;} void expandedState(MSBoolean expandedState_) {_expandedState=expandedState_;} MSBoolean expandable(void) const {return _expandable;} void expandable(MSBoolean expandable_) {_expandable=expandable_;} PixmapList &pixmap(void) { return _pixmap; } const PixmapList &pixmap(void) const { return _pixmap; } PixmapList &insensitivePixmap(void) { return _insensitivePixmap; } const PixmapList &insensitivePixmap(void) const { return _insensitivePixmap; } PixmapList &selectedPixmap(void) { return _selectedPixmap; } const PixmapList &selectedPixmap(void) const { return _selectedPixmap; } const TreeModelCursor &cursor(void) const {return _cursor;} TreeModelCursor &cursor(void) {return _cursor;} void configuration(int x_,int y_,int w_,int h_) { _x=x_;_y=y_;_width=w_;_height=h_; } void attribute(const MSTreeView *treeView_,const NodeAttribute& nodeAttribute_) { sensitive(nodeAttribute_.sensitive()); expandable(nodeAttribute_.expandable()); expandedState(nodeAttribute_.expandedState()); buildPixmapList(treeView_->pixmapRegistry(),pixmap(),nodeAttribute_.pixmap()); buildPixmapList(treeView_->pixmapRegistry(),insensitivePixmap(),nodeAttribute_.insensitivePixmap()); buildPixmapList(treeView_->pixmapRegistry(),selectedPixmap(),nodeAttribute_.selectedPixmap()); } NodeAttribute attribute(void) const { NodeAttribute nodeAttr; nodeAttr.sensitive(sensitive()); nodeAttr.expandable(expandable()); nodeAttr.expandedState(expandedState()); MSStringVector names; unsigned long i,nElements; nElements=pixmap().length(); for (i=0;i ElementTree; typedef typename ElementTree::Cursor ElementTreeCursor; typedef MSObservableTreeEvent TreeEvent; ElementTree _elementTree; ElementTreeCursor _selectedCursor; TreeModelCursor *_activatedNode; int _verticalSpacing; int _horizontalSpacing; int _maxWidth; int _maxHeight; int _margin; int _nodeMargin; MSBoolean _showRootNode; unsigned long _lineForeground; unsigned long _nodeForeground; unsigned long _nodeBackground; unsigned long _selectedNodeForeground; unsigned long _selectedNodeBackground; Orientation _orientation; MSIntVector _verticalPositions; MSIntVector _horizontalPositions; MSShadow _nodeShadow; MSShadow _selectedShadow; MSTextField *_pEditor; MSPopupMenu *_pPopupMenu; MSBoolean _showButtons; MSBoolean _showLabels; MSBoolean _showPixmaps; int _buttonShadowThickness; int _buttonNodeMargin; MSPixmap *_collapsedButtonPixmap; MSPixmap *_expandedButtonPixmap; MSFontObject _fontObject; GC _textGC; GC _pixmapGC; MSPixmap *_redrawPixmap; MSPixmap *_stipplePixmap; PixmapRegistry _pixmapRegistry; ElementTreeCursor _startCursor; virtual TreeModel &modelTree(void); virtual const TreeModel &modelTree(void) const; ElementTreeCursor &selectedCursor(void) {return _selectedCursor;} const ElementTreeCursor &selectedCursor(void) const {return _selectedCursor;} ElementTreeCursor &startCursor(void) {return _startCursor;} const ElementTreeCursor &startCursor(void) const {return _startCursor;} TreeNode& nodeAt(ElementTreeCursor& aCursor_) {return _elementTree.elementAt(aCursor_);} const TreeNode& nodeAt(ElementTreeCursor& aCursor_) const {return _elementTree.elementAt(aCursor_);} ElementTree& elementTree(void) {return _elementTree;} const ElementTree& elementTree(void) const {return _elementTree;} MSTextField *editor(void) {return _pEditor;} MSIntVector& verticalPositions(void) {return _verticalPositions;} MSIntVector& horizontalPositions(void) {return _horizontalPositions;} MSShadow& nodeShadow(void) {return _nodeShadow;} MSShadow& selectedShadow(void) {return _selectedShadow;} int maxWidth(void) const {return _maxWidth;} int maxHeight(void) const {return _maxHeight;} int margin(void) const {return _margin;} int nodeMargin(void) const {return _nodeMargin;} int buttonNodeMargin(void) const {return _buttonNodeMargin;} int verticalPosition(int depth_) const {return _verticalPositions(depth_);} int horizontalPosition(int depth_) const {return _horizontalPositions(depth_);} MSFontObject &fontObject(void) {return _fontObject;} GC textGC(void) {return _textGC;} GC pixmapGC(void) {return _pixmapGC;} MSPixmap *redrawPixmap(void) {return _redrawPixmap;} MSPixmap *stipplePixmap(void) {return _stipplePixmap;} PixmapRegistry &pixmapRegistry(void) {return _pixmapRegistry;} const PixmapRegistry &pixmapRegistry(void) const {return _pixmapRegistry;} virtual void adjustSize(void); virtual void recompVectors(void); void verticalPosition(int depth_,int value_) {_verticalPositions.set(depth_,value_);} void horizontalPosition(int depth_,int value_) {_horizontalPositions.set(depth_,value_);} int computeTreeDepth(void); int computeTreeDepth(ElementTreeCursor,int); void computePositions(void); void setPositions(void); void rebuildScreen(Iterator *iterator_=0); void updateElementTree(TreeModelCursor,ElementTreeCursor &,Iterator *iterator_=0); void buildCollapsedButtonPixmap(void); void buildExpandedButtonPixmap(void); int computeVerticalPositions(ElementTreeCursor,int depth_); int computeHorizontalPositions(ElementTreeCursor,int depth_); void setPositions(ElementTreeCursor,int depth_); void computeMaxExtents(ElementTreeCursor); void computeMaxExtents(void); void drawTree(void); void drawTree(ElementTreeCursor,Window); void drawNode(ElementTreeCursor&,Window,MSBoolean clear_=MSTrue); void drawPixmaps(Window,const PixmapList &,int &,int &,int); void shiftHorizontalPosition(ElementTreeCursor,int x_); void shiftVerticalPosition(ElementTreeCursor,int y_); MSBoolean selectNode(ElementTreeCursor&); ElementTreeCursor findElementCursor(const TreeModelCursor& cursor_) const; virtual void buttonPress(const XEvent *); virtual void keyPress(const XEvent *,KeySym,unsigned int,const char*); virtual void focusIn(void); virtual void focusOut(void); virtual void firstMapNotify(void); virtual void editorActivate(void); virtual void editorEscape(void); virtual void mapEditor(void); virtual MSBoolean loseFocus(void); virtual void backgroundAreaSelection(const XEvent *); virtual void updateForeground(unsigned long); virtual void updateBackground(unsigned long); virtual void updateFont(Font); MSBoolean positionToCursor(ElementTreeCursor &cursor_,int x_,int y_); ElementTreeCursor positionToCursor(int x_,int y_); MSBoolean locateTreeCursor(ElementTreeCursor,ElementTreeCursor); void collapseSubTree(ElementTreeCursor &); void expandSubTree(ElementTreeCursor &); void moveToPreviousNode(void); void moveToNextNode(void); void moveToParentNode(void); void moveToChildNode(void); virtual void nodeSelectionNotify(void); virtual void doubleClickNotify(void); virtual void subTreeCollapsedNotify(void); virtual void subTreeExpandedNotify(void); virtual void receiveEvent(MSEvent &); virtual void processPermuteEvent(TreeEvent &); virtual void processReshapeEvent(TreeEvent &); virtual void processDeleteEvent(TreeEvent &); virtual void processCopyEvent(TreeEvent &); virtual void processAssignEvent(TreeEvent &); virtual void updateData(void); void init(void); void resizeRedrawPixmap(int,int); virtual void moveDrawArea(int,int); virtual void redrawViewPortImmediately(void); virtual void redrawViewPort(void); void drawShadow(Window,const MSRect &,int,GC,GC); void calculatePixmapSize(const PixmapList&,int&,int&); virtual void calculateNodeSize(TreeNode &,int &,int &); virtual void nodeModified(const TreeModelCursor &,NodeAttribute &); virtual void nodeAttribute(const TreeModelCursor &,NodeAttribute &); virtual MSBoolean validate(TreeModelCursor &,const char *); virtual const char *formatOutput(MSString &,TreeModelCursor &); virtual MSBoolean isSensitive(const TreeNode *); virtual MSBoolean isExpandable(const TreeNode *); virtual MSBoolean isExpanded(const TreeNode *); virtual const PixmapList &pixmap(const TreeNode *); virtual const PixmapList &selectedPixmap(const TreeNode *); virtual const PixmapList &insensitivePixmap(const TreeNode *); virtual unsigned long nodeForegroundColor(const TreeNode *); virtual unsigned long nodeBackgroundColor(const TreeNode *); virtual unsigned long lineForegroundColor(const TreeNode *); virtual MSBoolean isNodeProtected(const TreeNode *); }; #ifndef MSTreeListViewHEADER DECLARE_ELEMENT_FOR_OPS_TYPE(MSPixmap) inline MSString const &key(const MSPixmap &pixmap_) { return pixmap_.name(); } #endif // We provide explicit "do_not_instantiate" pragmas here to avoid instantiation complications in // MStk applications. // #if !defined(__MSGUILIBRARY_BUILD__) && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma do_not_instantiate MSIHashKeySet #pragma do_not_instantiate MSIHashKeySetNode #pragma do_not_instantiate MSIHashKeySetCursor #pragma do_not_instantiate MSGenericVector #pragma do_not_instantiate MSGenericVectorOps #pragma do_not_instantiate MSGenericData #endif // !__MSGUILIBRARY_BUILD__ && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #endif aplus-fsf-4.22/src/MSGUI/MSTypeEntryField.H0000644000265000001440000000417710772770434013775 #ifndef MSTypeEntryFieldHEADER #define MSTypeEntryFieldHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MSDefinesHEADER #include #endif #include #if defined(MS_NEED_IMPLEMENTATION_PRAGMA) #pragma implementation("MSTypeEntryField.C") #endif template class MSTypeEntryField : public MSEntryFieldPlus { protected: Type _incrementValue; Type _minimumValue; Type _maximumValue; virtual MSBoolean validate(const char *); virtual const char *formatOutput(MSString &); virtual void increment(void); virtual void decrement(void); virtual void updateData(void); Type& value(void) const { return *((Type *)_model); } void value(const Type& value_) const { if (MSView::model()!=0) value()=value_; } public: MSTypeEntryField(MSWidget *,const char *label_=0, const MSSymbol& tag_=MSSymbol::nullSymbol()); MSTypeEntryField(MSWidget *,Type&,const char *label_=0, const MSSymbol& tag_=MSSymbol::nullSymbol()); ~MSTypeEntryField(void); void model(Type&); void model(const Type&); Type& viewModel(void) { return *((Type*)_model); } const Type& viewModel(void) const { return *((Type*)_model); } const Type& incrementValue(void) const {return _incrementValue;} const Type& maximumValue(void) const {return _maximumValue;} const Type& minimumValue(void) const {return _minimumValue;} void incrementValue(const Type& incrementValue_) {_incrementValue=incrementValue_;} void maximumValue(const Type& maximumValue_) {_maximumValue=maximumValue_;} void minimumValue(const Type& minimumValue_) {_minimumValue=minimumValue_;} MSTypeEntryField& operator=(const Type& value_) {value(value_); return *this;} operator Type&() {return value();} virtual void set(MSAttrValueList&); virtual MSAttrValueList& get(MSAttrValueList&); }; #endif aplus-fsf-4.22/src/MSGUI/MSUnsignedEntryField.H0000644000265000001440000000330110772770434014614 #ifndef MSUnsignedEntryFieldHEADER #define MSUnsignedEntryFieldHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include // We provide explicit "do_not_instantiate" pragmas here to avoid instantiation complications in // MStk applications. // #if !defined(__MSGUILIBRARY_BUILD__) && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma do_not_instantiate MSTypeEntryField #endif // !__MSGUILIBRARY_BUILD__ && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #if defined(MS_VC_NEED_TEMPLATE_EXPORT) class MSGUIExport MSTypeEntryField; #endif class MSGUIExport MSUnsignedEntryField : public MSTypeEntryField { protected: void init(void); public: MSUnsignedEntryField(MSWidget *,const char *label_=0, const MSSymbol& tag_=MSSymbol::nullSymbol()); MSUnsignedEntryField(MSWidget *,MSUnsigned&,const char *label_=0, const MSSymbol& tag_=MSSymbol::nullSymbol()); ~MSUnsignedEntryField(void); void increment(void); void decrement(void); MSUnsignedEntryField& operator=(unsigned value_) {value(value_); return *this;} MSUnsignedEntryField& operator=(const MSUnsigned& value_) {value(value_); return *this;} operator MSUnsigned&() {return *((MSUnsigned *)_model);} operator unsigned() {return (unsigned)value();} }; #endif aplus-fsf-4.22/src/MSGUI/MSVGauge.H0000644000265000001440000000407710772770434012243 #ifndef MSVGaugeHEADER #define MSVGaugeHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSGUIExport MSVGauge:public MSVScale { public: MSVGauge(MSWidget *,const char *title_=0); MSVGauge(MSWidget *,const MSStringVector&); MSVGauge(MSWidget *,MSFloat&,const char *title_=0); MSVGauge(MSWidget *,MSFloat&,const MSStringVector&); MSVGauge(MSWidget *,MSInt&,const char *title_=0); MSVGauge(MSWidget *,MSInt&,const MSStringVector&); ~MSVGauge(void); MSScale& operator=(const MSFloat& x_) {value(x_); return *this;} MSScale& operator=(double x_) {value(x_); return *this;} MSScale& operator=(const MSInt& x_) {value(x_); return *this;} MSScale& operator=(int x_) {value(x_); return *this;} const MSFloat& startValue(void) const { return _startValue; } void startValue(const MSFloat& value_); virtual void set(MSAttrValueList&); virtual MSAttrValueList& get(MSAttrValueList&); protected: enum Direction { Up, Down }; int gaugeHeight(void) {return _gaugeHeight;} void gaugeHeight(int x_) {_gaugeHeight=x_;} void init(void); void drawGauge(void); void updateGauge(int); void drawGaugeShadow(int,int,int,int,Direction); void updateGaugeShadow(int,int,int,int,Direction); virtual void redraw(void); virtual void moveValueWin(int,int); virtual void computeLabelOffset(void); virtual void updateSliderSize(double); virtual void drawSubWindows(void); virtual void update(const MSIndexVector&); virtual void buttonPress(const XEvent *); virtual void keyPress(const XEvent *,KeySym,unsigned int,const char *); virtual void drawSliderEtch(void); virtual void sliderRedrawNotify(void); private: int _gaugeHeight; MSFloat _startValue; Direction _direction; }; #endif aplus-fsf-4.22/src/MSGUI/MSVLayout.H0000644000265000001440000000107610772770434012464 #ifndef MSVLayoutHEADER #define MSVLayoutHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSGUIExport MSVLayout : public MSLayout { public: MSVLayout(MSWidget *,const char *title_=0); MSVLayout(MSWidget *,const MSStringVector&); ~MSVLayout(void); private: void init(void); }; #endif aplus-fsf-4.22/src/MSGUI/MSVPane.H0000644000265000001440000000106210772770434012065 #ifndef MSVPaneHEADER #define MSVPaneHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSGUIExport MSVPane : public MSPane { public: MSVPane(MSWidget *,const char *title_=0); MSVPane(MSWidget *,const MSStringVector&); ~MSVPane(void); protected: void init(void); }; #endif aplus-fsf-4.22/src/MSGUI/MSVScale.H0000644000265000001440000000415210772770434012234 #ifndef MSVScaleHEADER #define MSVScaleHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSVScale; class MSVGauge; class MSGUIExport MSVScale : public MSScale { public: MSVScale(MSWidget *,const char *title_=0); MSVScale(MSWidget *,const MSStringVector&); MSVScale(MSWidget *,MSFloat&,const char *title_=0); MSVScale(MSWidget *,MSFloat&,const MSStringVector&); MSVScale(MSWidget *,MSInt&,const char *title_=0); MSVScale(MSWidget *,MSInt&,const MSStringVector&); ~MSVScale(void); virtual int sliderSize(void) const; virtual void sliderSize(int); MSScale& operator=(const MSFloat& x_) {value(x_); return *this;} MSScale& operator=(double x_) {value(x_); return *this;} MSScale& operator=(const MSInt& x_) {value(x_); return *this;} MSScale& operator=(int x_) {value(x_); return *this;} class MSGUIExport VSlider : public MSScale::Slider { friend class MSVScale; friend class MSGauge; protected: virtual void drawSliderEtch(void); virtual void moveTo(int,int); public: VSlider(MSWidget *); ~VSlider(void); }; protected: int titleWidth(void) {return _titleWidth;} void titleWidth(int x_) {_titleWidth=x_>_titleWidth?x_:_titleWidth;} void init(void); virtual void computeSize(void); virtual void computeLabelOffset(void); virtual void computeSliderAreaSize(void); virtual void computeSliderScale(void); virtual void computeTickInc(void); virtual void setSliderPosition(int); virtual double pixelToValue(int); virtual int valueToPixel(double); virtual int incFactor(int,int); virtual void drawSliderTitles(void); virtual void drawTickLabels(void); virtual void moveSlider(const XEvent *); virtual void drawSliderEtch(void); virtual void home(void); virtual void end(void); private: int _titleWidth; }; #endif aplus-fsf-4.22/src/MSGUI/MSVScrollBar.H0000644000265000001440000000307710772770434013075 #ifndef MSVScrollBarHEADER #define MSVScrollBarHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSVScrollBar; class MSGUIExport MSVScrollBar : public MSScrollBar { public: class MSGUIExport VElevator : public MSScrollBar::Elevator { friend class MSVScrollBar; public: VElevator(MSVScrollBar *); ~VElevator(void); virtual void select(void); virtual void unselect(void); protected: virtual void draw(void); virtual void configure(void); }; public: MSVScrollBar(MSWidget *,int min_=0,int max_=100,int inc_=1); ~MSVScrollBar(void); protected: void init(void); void moveElevator(int x_,int y_); virtual void configureForOpenlook(void); virtual void configureForMotif(void); int calcYValue(int value_); int boundsCheckY(int y_); virtual int calcSliderValue(int x_,int y_); virtual void redrawElevator(void); virtual void configureElevator(void); virtual void drawElevatorCable(void); virtual void drawPropIndicator(void); virtual void drawMarkers(void); virtual void adjustPointer(void); virtual void motionLoop(void); virtual void openlookButton1Press(const XEvent*); virtual void openlookButton2Press(const XEvent*); virtual void motifButton1Press(const XEvent*); virtual void motifButton2Press(const XEvent*); }; #endif aplus-fsf-4.22/src/MSGUI/MSVSeparator.H0000644000265000001440000000105310772770434013142 #ifndef MSVSeparatorHEADER #define MSVSeparatorHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSGUIExport MSVSeparator : public MSSeparator { public: MSVSeparator(MSWidget *owner_); virtual void redraw(void); protected: virtual void computeSize(void); }; #endif aplus-fsf-4.22/src/MSGUI/MSValidationCallback.H0000644000265000001440000000106110772770435014563 #ifndef MSValidationCallbackHEADER #define MSValidationCallbackHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSGUIExport MSValidationCallback { public: MSValidationCallback(void); virtual ~MSValidationCallback(void); virtual MSBoolean validate(MSString&)=0; }; #endif aplus-fsf-4.22/src/MSGUI/MSValidationInterface.H0000644000265000001440000000225210772770435014772 #ifndef MSValidationInterfaceHEADER #define MSValidationInterfaceHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSGUIExport MSValidationInterface { public: typedef MSBoolean (*ValidationFunction)(MSString&,void *); class MSGUIExport DefaultValidationCallback : public MSValidationCallback { private: ValidationFunction _function; void *_clientData; public: DefaultValidationCallback(ValidationFunction func_,void *clientData_=0); ~DefaultValidationCallback(void); virtual MSBoolean validate(MSString&); }; protected: MSValidationCallback *_validationCallback; public: MSValidationInterface(void); ~MSValidationInterface(void); MSValidationCallback *validationCallback(void) {return _validationCallback;} void validationCallback(ValidationFunction,void *clientData_=0); void validationCallback(MSValidationCallback *); }; #endif aplus-fsf-4.22/src/MSGUI/MSValidationMethod.H0000644000265000001440000000245210772770435014314 #ifndef MSValidationMethodHEADER #define MSValidationMethodHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include template class MSValidationMethod : public MSValidationCallback { typedef MSBoolean (MethodClass::*Method)(MSString&); private: Method _method; MethodClass *_object; public: #ifdef MS_METHOD_POINTER_DEFAULTARG_BUG MSValidationMethod(MethodClass *object_=0) : _object(object_),_method(0) {} MSValidationMethod(MethodClass *object_,Method method_) : _object(object_),_method(method_) {} #else MSValidationMethod(MethodClass *object_=0,Method method_=0) : _object(object_),_method(method_) {} #endif ~MSValidationMethod(void) {} void method(MethodClass *object_,Method method_) {_object=object_,_method=method_;} Method method(void) {return _method;} MethodClass *object(void) {return _object;} virtual MSBoolean validate(MSString& aString_) { if (_object!=0&&_method!=0) return (_object->*_method)(aString_); else return MSFalse; } }; #endif aplus-fsf-4.22/src/MSGUI/MSVectorTableColumn.H0000644000265000001440000000565610772770435014462 #ifndef MSVectorTableColumnHEADER #define MSVectorTableColumnHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MSDefinesHEADER #include #endif #include #include #include #if defined(MS_NEED_IMPLEMENTATION_PRAGMA) #pragma implementation("MSVectorTableColumn.C") #endif template class MSVectorTableColumn : public MSTableColumn { public: MSVectorTableColumn(MSReportTable *,const char *title_=0, const MSSymbol& tag_=MSSymbol::nullSymbol()); MSVectorTableColumn(MSReportTable *,const MSStringVector&, const MSSymbol& tag_=MSSymbol::nullSymbol()); MSVectorTableColumn(MSReportTable *,MSTypeVector&,const char *title_=0, const MSSymbol& tag_=MSSymbol::nullSymbol()); MSVectorTableColumn(MSReportTable *,MSTypeVector&,const MSStringVector&, const MSSymbol& tag_=MSSymbol::nullSymbol()); ~MSVectorTableColumn(void); void model(MSTypeVector&); void model(const MSTypeVector&); MSTypeVector& viewModel(void) { return *((MSTypeVector*)_model); } const MSTypeVector& viewModel(void) const { return *((MSTypeVector*)_model); } MSVectorTableColumn& operator=(const MSTypeVector& vector_); // This member function now inlined, because of bug in Visual C++ operator MSTypeVector&() const { return *((MSTypeVector *)_model); } virtual MSIndexVector gradeUp(void) const; virtual MSIndexVector gradeDown(void) const; virtual void permute(const MSIndexVector &); virtual void range(MSIndexVector &start_,MSIndexVector &end_); virtual MSIndexVector rangeGradeUp(const MSIndexVector &start_,const MSIndexVector &end_); virtual MSIndexVector rangeGradeDown(const MSIndexVector &start_,const MSIndexVector &end_); virtual unsigned numRows(void) const; virtual MSBoolean isDuplicate(unsigned); virtual MSBoolean breakCriteria(unsigned); virtual const char *formatOutput(MSString &,unsigned); virtual const char *formatBreak(MSString &,unsigned,unsigned); protected: void init(void); virtual void breakProcess(MSIndexVector&); virtual MSBoolean validate(const char *,unsigned); virtual void moveRow(int, int); inline MSTypeVector& vector(void); inline const MSTypeVector& vector(void) const; void vector(const MSTypeVector&); static const Type& getType(void); }; template inline MSTypeVector& MSVectorTableColumn::vector(void) { return (MSTypeVector&)*_model; } template inline const MSTypeVector& MSVectorTableColumn::vector(void) const { return (MSTypeVector&)*_model; } #endif aplus-fsf-4.22/src/MSGUI/MSVectorTraceSet.H0000644000265000001440000000371010772770435013754 #ifndef MSVectorTraceSetHEADER #define MSVectorTraceSetHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #ifndef MSDefinesHEADER #include #endif #if defined(MS_NEED_IMPLEMENTATION_PRAGMA) #pragma implementation("MSVectorTraceSet.C") #endif template class MSVectorTraceSet : public MSTraceSet { public: MSVectorTraceSet(MSGraph *,const char *title_,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSVectorTraceSet(MSGraph *,const MSStringVector&,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSVectorTraceSet(MSGraph *,MSTypeVector&,const char *,const MSSymbol& tag_=MSSymbol::nullSymbol()); MSVectorTraceSet(MSGraph *,MSTypeVector&,const MSStringVector&,const MSSymbol& tag_=MSSymbol::nullSymbol()); ~MSVectorTraceSet(void); void model(MSTypeVector&); void model(const MSTypeVector&); MSTypeVector& viewModel(void) { return *((MSTypeVector*)_model); } const MSTypeVector& viewModel(void) const { return *((MSTypeVector*)_model); } protected: MSTypeVector& vector(void); // this member function now inlined, because of bug in Visual C++ 2.0 const MSTypeVector& vector(void) const {return *((MSTypeVector *)_model); } virtual int dataCount(void) const; virtual double y(int row_,int) const; void vector(const MSTypeVector& aVector_); virtual void validate(int r_,int c_,double x_,double y_); virtual const char *formatOutput(MSString &,unsigned,unsigned); MSVectorTraceSet& operator=(const MSTypeVector& aVector_); operator MSTypeVector&() const; }; #endif aplus-fsf-4.22/src/MSGUI/MSView.H0000644000265000001440000000374710772770435012003 #ifndef MSViewHEADER #define MSViewHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include class MSGUIExport MSView : public MSEventReceiver { friend class MSModel; protected: MSModel *_model; MSBoolean _internalModel; MSBoolean _readOnlyModel; MSBoolean internalModel(void) const; void internalModel(MSBoolean); void readOnlyModel(MSBoolean); MSBoolean readOnlyModel(void) const; virtual void addSenderNotify(MSEventSender *); virtual void removeSenderNotify(MSEventSender *); virtual void decouple(void); // internal notification that this view is no longer dependent on model virtual void couple(MSModel *); // internal notification that this view is now dependent on model virtual void constCouple(const MSModel*); //binding to a "const model" virtual void internalCouple(MSModel *); // couple as an internal model, i.e. delete on decouple virtual void updateData(void); virtual void update(const MSIndexVector&); virtual void receiveEvent(MSEvent&); public: MSView(void); ~MSView(void); MSModel *model(void); const MSModel *model(void) const; virtual MSBoolean hasModel(void) const; MSBoolean isReadOnlyModel(void) const; void decoupleModel(void); }; inline MSBoolean MSView::internalModel(void) const { return _internalModel; } inline void MSView::internalModel(MSBoolean b_) { _internalModel=b_; } inline MSBoolean MSView::readOnlyModel(void) const { return _readOnlyModel; } inline void MSView::readOnlyModel(MSBoolean b_) { _readOnlyModel=b_; } inline MSModel *MSView::model(void) { return _model; } inline const MSModel *MSView::model(void) const { return _model; } #endif aplus-fsf-4.22/src/MSGUI/MSWidget.H0000644000265000001440000003321710772770435012307 #ifndef MSWidgetHEADER #define MSWidgetHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// // this is a big list, but we will build a precompiled // header for MSWidget.H and then having these here is // a bonus - i.e. they will all be pre-compiled. #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include typedef void (*MSWidgetCallbackFunction)(MSWidget*, void*); class MSGUIExport MSWidget : public MSRect, public MSCallbackBehavior { friend class MSDisplayServer; public: MSWidget(void); MSWidget(MSDisplayServer *server_,int x_=0,int y_=0,int w_=10,int h_=10); MSWidget(MSWidget *owner_,int x_=0,int y_=0,int w_=10,int h_=10); ~MSWidget(void); // Mutator Methods void move(int,int); // move by delta x,y virtual void moveTo(int,int); // move to absolute x,y virtual void resize(int,int); // resize the widget void warpTo(int x_=0,int y_=0); // warp the cursor to x,y relative to this window void width(int); void height(int); void reparent(MSWidget *); void background(unsigned long); void foreground(unsigned long); void font(Font); void background(const char *); void foreground(const char *); void font(const char *); void sensitive(MSBoolean); void readOnly(MSBoolean); virtual void freeze(void); virtual void unfreeze(void); void acceptFocus(MSBoolean); void dynamic(MSBoolean); void helpString(const MSString&); // Position/Constraint Management Methods void resizeConstraints(const char *opts_); void resizeConstraints(unsigned long); void at(const At& at_); At at(void); // Widget Instance Name const MSString &instanceName(void) const; void instanceName(const MSString &); MSString instanceFullname(void) const; // Access Methods MSWidget *owner(void); const MSWidget *owner(void) const; MSDisplayServer *server(void); const MSDisplayServer *server(void) const; Display *display(void) const; Window window(void) const; Colormap colormap(void) const; MSColorManager *colorManager(void); const MSColorManager *colorManager(void) const; MSFontManager *fontManager(void); const MSFontManager *fontManager(void) const; int x_origin(void) const; int y_origin(void) const; int width(void) const; int height(void) const; unsigned long background(void) const; unsigned long foreground(void) const; Font font(void) const; MSBoolean sensitive(void) const; MSBoolean readOnly(void) const; MSBoolean acceptFocus(void) const; MSBoolean acceptTab(void) const; MSBoolean dynamic(void) const; MSBoolean visible(void) const; MSBoolean frozen(void) const; MSBoolean firstMap(void) const; MSBoolean mapped(void) const; unsigned long resizeConstraints(void) const; long eventMask(void) const; Screen *screen(int) const; Screen *screen(void) const; int depth(void) const; Window parent(void) const; MSWidget *widget(Window); MSWidget *top(void); const MSWidget *widget(Window) const; const MSWidget *top(void) const; const MSString& helpString(void) const; virtual const MSString& virtualHelpString(int x_,int y_); // Position Access Methods int rootX(void) const; int rootY(void) const; void rootXY(int& x,int& y) const; // get the root coords of this window void pointerXY(int& x,int& y) const; // get the pointer x,y in root coords // Window methods virtual void redraw(void); virtual void print(const char *file_=0); virtual void map(void); virtual void unmap(void); virtual void show(void); virtual void hide(void); virtual void raise(void); virtual void lower(void); virtual void clear(void); virtual void naturalSize(void); virtual void destroy(void); virtual void safeDestroy(MSWidget *); // Focus/Traverse Methods void addToFocusList(void); void removeFromFocusList(void); virtual MSWidget *inputFocus(void); virtual const MSWidget *inputFocus(void) const; virtual MSBoolean traverseFocus(MSWidget *); virtual MSBoolean traverseToNext(void); virtual MSBoolean traverseToPrevious(void); MSBoolean obtainFocus(void); MSBoolean isTraversable(void) const; MSBoolean isTraversable(MSWidget *) const; // Callback methods MSCallback *callback(const MSSymbol& name_); void callback(const MSSymbol& name_,MSCallback *callback_); void callback(const MSSymbol& name_,MSWidgetCallbackFunction function_,void *clientData_=0); // keyCallback methods unsigned long addKeyCallback( const char*, MSKeyCallback*); void removeKeyCallback(unsigned long); void removeKeyCallback(const char*); // busy cursor routines static void busyOn(void); static void busyOff(void); //children list and Iteration methods virtual MSWidgetVector children(void); MSBoolean allWidgetsDo(MSWidgetIterator& iterator_, MSWidgetIterationType type_=MSBreadthFirst); MSBoolean allWidgetsDo(MSWidgetIteratorFunction function_, void *clientData_=0, MSWidgetIterationType type_=MSBreadthFirst); // methods for builder support virtual void set(MSAttrValueList& avList_); virtual MSAttrValueList& get(MSAttrValueList& avList_); typedef void (*EventHandler)(MSWidget *widget_,const XEvent *event_,void *clientData_); void eventHandler(long mask_,EventHandler eventHandler_,void *clientData_=0); typedef MSBoolean (*EventOverride)(int eventType); void eventOverride(EventOverride); // will be removed when dynamic_cast (RTTI) becomes available const MSSymbol& parentWidgetType(void) const; virtual const MSSymbol& widgetType(void) const; // X11 Selection Buffer Functions MSStatus copyPrimary(const char *data_,int itemCount_); void convertSelection(void); // focusWindow returns the shell that currently has the focus static MSWidget *focusWindow(void); static void focusWindow(MSWidget *); //Can this widget be modified by user. virtual MSBoolean isProtected(void) const; protected: MSWidget *_owner; Window _window; MSDisplayServer *_server; unsigned long _bg; unsigned long _fg; Font _fontID; MSBoolean _sensitive; // is this widget greyed-out and sensitive to button/key events MSBoolean _readOnly; // is this widget responsive to button/key events MSBoolean _acceptFocus; // will this widget accept focus MSBoolean _acceptTab; // does this widget accept a tab MSBoolean _mapped; // set on a map,unset on an unmap MSBoolean _firstMap; // set the first time a widget is mapped MSBoolean _visible; // is the widget visible MSBoolean _dynamic; // is the resize behavior dynamic? MSBoolean _freezeStatus; // is the widget diabled unsigned long _resizeConstraints; long _eventMask; MSKeyTranslationTable _keyTranslationTable; static MSWidget *_focusWindow; EventHandler _eventHandler; // instance variables for builder support void *_eventHandlerData; EventOverride _eventOverride; MSString _helpString; MSString _instanceName; MSKeyTranslationTable *keyTranslationTable(void); virtual int offsetX(void) const; virtual int offsetY(void) const; void init(void); virtual void computeSize(void); void eventMask(long); void selectInput(long); void selectInput(void); void backingStore(int); void overrideRedirect(MSBoolean); void saveUnder(MSBoolean); void acceptTab(MSBoolean); void freezeStatus(MSBoolean); void visible(MSBoolean); void firstMap(MSBoolean); MSBoolean activateCallback(const MSSymbol&); MSBoolean activateCallback(MSWidget *,const MSSymbol&); virtual MSBoolean keyTranslate(const MSKeyPress&); MSBoolean hasKeyCallback(const MSKeyPress&) ; void removeAllKeyCallbacks(); void prepareForDestruction(void); void decoupleAllWidgets(void); virtual void decoupleWidget(void); virtual void childPosition(MSWidget *,const At&); virtual At childPosition(MSWidget *); virtual void addToFocusList(MSWidget *); virtual void removeFromFocusList(MSWidget *); static MSBoolean setFocus(MSWidget *); static MSBoolean releaseFocus(void); // property methods virtual MSStatus ownSelection(Atom); virtual void disownSelection(Atom); virtual MSStatus propertyData(Atom prop_,Atom target_); virtual Atom convertTarget(Atom target_); virtual int propertyFormat(Atom target_); virtual void propertyToString(Atom target_,char *data_,int itemCount_); virtual void atomsFromData(char *data_,int itemCount_); XEvent *compressMotion(const XEvent *); public: // update notification methods - i.e. notify the widget that its font has changed // the old value of the attribute is passed to the function virtual void updateFont(Font); virtual void updateForeground(unsigned long); virtual void updateBackground(unsigned long); virtual void updateSensitivity(void); virtual void updateReadOnly(void); protected: // X event methods virtual void expose(const XEvent *event_); virtual void noExpose(const XEvent *); virtual void graphicsExpose(const XEvent *); virtual void visibilityNotify(const XEvent *); virtual void keyPressEvent(const XEvent *); virtual void keyRelease(const XEvent *); virtual void buttonPress(const XEvent *); virtual void buttonRelease(const XEvent *); virtual void motionNotify(const XEvent *); virtual void mapNotify(const XEvent *); virtual void unmapNotify(const XEvent *); virtual void configureNotify(const XEvent *); virtual void createNotify(const XEvent *); virtual void destroyNotify(const XEvent *); virtual void enterNotify(const XEvent *); virtual void leaveNotify(const XEvent *); virtual void focusInEventNotify(const XEvent *); virtual void focusOutEventNotify(const XEvent *); virtual void reparentNotify(const XEvent *); virtual void propertyNotify(const XEvent *); virtual void clientMessage(const XEvent *); virtual void selectionNotify(const XEvent *); virtual void selectionClear(const XEvent *); virtual void selectionRequest(const XEvent *); virtual void errorEvent(const XEvent *); virtual void event(const XEvent *); // synthetic events virtual void configure(void); virtual void firstMapNotify(void); virtual void enter(void); virtual void leave(void); virtual void focusIn(void); virtual void focusOut(void); virtual void takeFocus(void); virtual MSBoolean loseFocus(void); virtual void button1Press(const XEvent *); virtual void button2Press(const XEvent *); virtual void button3Press(const XEvent *); virtual void button1Release(const XEvent *); virtual void button2Release(const XEvent *); virtual void button3Release(const XEvent *); virtual void visibilityObscured(void); virtual void visibilityUnobscured(void); virtual void keyPress(const XEvent *,KeySym,unsigned int,const char *); virtual void keyRelease(const XEvent *,KeySym,unsigned int,const char *); virtual void key(KeySym,unsigned int,const char *); virtual void childMap(MSWidget *); virtual void childUnmap(MSWidget *); virtual void childConfigure(MSWidget *); virtual void childMove(MSWidget *); virtual void childResizeConstraints(MSWidget *); virtual void childDestroy(MSWidget *); virtual void childCreate(MSWidget *); virtual void childInsert(MSWidget *); virtual void childRemove(MSWidget *); // synthetic event generation // these events are delivered to the owner of 'this' void childMapNotify(void); void childUnmapNotify(void); void childConfigureNotify(void); void childMoveNotify(void); void childResizeConstraintsNotify(void); void childDestroyNotify(void); void childCreateNotify(void); void childInsertNotify(void); void childRemoveNotify(void); // these events are forwarded to the widget passed on the stack void visibilityObscuredNotify(MSWidget *); void visibilityUnobscuredNotify(MSWidget *); void buttonMotionNotify(MSWidget *,const XEvent *); void buttonPressNotify(MSWidget *,const XEvent *); void buttonReleaseNotify(MSWidget *,const XEvent *); void keyTranslateNotify(MSWidget *,const XEvent *,KeySym,unsigned int,const char *); void keyPressNotify(MSWidget *,const XEvent *,KeySym,unsigned int,const char *); void keyReleaseNotify(MSWidget *,const XEvent *,KeySym,unsigned int,const char *); void focusInNotify(MSWidget *); void focusOutNotify(MSWidget *); void takeFocusNotify(MSWidget *); MSBoolean loseFocusNotify(MSWidget *); void selectionClearNotify(MSWidget *,const XEvent *); // Selection notification virtual const char * getPrimarySelection(MSString&, int&); virtual void insertPrimarySelection(void); // Iteration methods MSBoolean breadthFirstIteration(MSWidgetVector&,MSWidgetIterator&); MSBoolean depthFirstIteration(MSWidgetIterator&); }; #ifndef MS_NO_INLINES #ifndef MSWidgetINLINES #include #endif #endif #endif aplus-fsf-4.22/src/MSGUI/MSWidgetCallback.H0000644000265000001440000000570710772770435013727 #ifndef MSWidgetCallbackHEADER #define MSWidgetCallbackHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include // this should be a C++ NameSpace, but the NameSpace feature of C++ has not yet // been implemented by any of the commercial compilers - some day we will change this. class MSGUIExport MSWidgetCallback { public: static MSSymbol activate; static MSSymbol arm; static MSSymbol disarm; static MSSymbol reference; static MSSymbol valuechange; static MSSymbol save; static MSSymbol quit; static MSSymbol dismiss; static MSSymbol destroy; static MSSymbol deleterow; static MSSymbol saveyourself; static MSSymbol selectionnotify; static MSSymbol selectionclear; static MSSymbol selection; static MSSymbol rowselection; static MSSymbol columnselection; static MSSymbol columnresize; static MSSymbol delimiterchange; static MSSymbol delimiterselection; static MSSymbol permutecolumns; static MSSymbol labelselection; static MSSymbol insertbelow; static MSSymbol insertabove; static MSSymbol tracereference; static MSSymbol traceptreference; static MSSymbol graphreference; static MSSymbol graphzoom; static MSSymbol addtrace; static MSSymbol copytrace; static MSSymbol addtexttrace; static MSSymbol copytexttrace; static MSSymbol deletetrace; static MSSymbol firstcolumnchange; static MSSymbol firstrowchange; static MSSymbol pagechange; static MSSymbol doubleclick; static MSSymbol increment; static MSSymbol decrement; static MSSymbol pagedecrement; static MSSymbol pageincrement; static MSSymbol takefocus; static MSSymbol rowmoved; static MSSymbol drag; static MSSymbol subtreecollapsed; static MSSymbol subtreeexpanded; static MSSymbol button2selection; static MSSymbol button3selection; static MSSymbol directorychange; static MSSymbol fileselection; static MSSymbol childresize; static MSSymbol home; static MSSymbol end; static MSSymbol yes; static MSSymbol no; static MSSymbol ok; static MSSymbol cancel; static MSSymbol help; static MSSymbol apply; static MSSymbol close; static MSSymbol iconized; static MSSymbol deiconized; static MSSymbol incurrentworkspace; static MSSymbol outofcurrentworkspace; static MSSymbol workspacepresencechange; static MSSymbol buttonactivate; static MSSymbol menubutton; static MSSymbol columnmenubutton; static MSSymbol editbegin; static MSSymbol editend; static MSSymbol menushow; static MSSymbol f1; static MSSymbol f2; static MSSymbol f3; static MSSymbol f4; static MSSymbol f5; static MSSymbol f6; static MSSymbol f7; static MSSymbol f8; static MSSymbol f9; static MSSymbol f10; static MSSymbol f11; static MSSymbol f12; }; #endif aplus-fsf-4.22/src/MSGUI/MSWidgetCommon.H0000644000265000001440000000310610772770435013452 #ifndef MSWidgetCommonHEADER #define MSWidgetCommonHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSGUIExport MSWidgetCommon : public MSWidgetView { public: MSWidgetCommon(void); MSWidgetCommon(MSDisplayServer *); MSWidgetCommon(MSWidget *,const char *title_=0); MSWidgetCommon(MSWidget *,const MSStringVector&); ~MSWidgetCommon(void); const MSStringVector& title(void) const; unsigned long titleForeground(void) const; Font titleFont(void) const; unsigned long titleAlignment(void) const; void title(const MSStringVector&); void title(const char *); void titleForeground(unsigned long); void titleForeground(const char *); void titleFont(Font); void titleFont(const char *); void titleAlignment(unsigned long); // methods for builder support virtual void set(MSAttrValueList& avList_); virtual MSAttrValueList& get(MSAttrValueList& avList_); protected: MSStringVector _title; // title of this widget unsigned long _titleFg; Font _titleFont; unsigned long _titleAlignment; void init(void); void create(void); virtual void computeSize(void); virtual void updateTitle(void); }; #ifndef MS_NO_INLINES #ifndef MSWidgetCommonINLINES #include #endif #endif #endif aplus-fsf-4.22/src/MSGUI/MSWidgetCursor.H0000644000265000001440000000217110772770435013500 #ifndef MSWidgetCursorHEADER #define MSWidgetCursorHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSGUIExport MSWidgetCursor { protected: MSWidgetVector _vector; unsigned _index; MSWidgetVector &vector(void) {return _vector;} unsigned index(void) const {return _index;} void buildBreadthFirst(MSWidgetVector &); void buildDepthFirst(MSWidget *); public: MSWidgetCursor(MSWidget *,MSWidgetIterationType type_=MSBreadthFirst); MSBoolean setToFirst(void); MSBoolean setToLast(void); MSBoolean setToNext(void); MSBoolean setToPrevious(void); void invalidate(void) {_index=vector().length();} MSBoolean isValid(void) {return (index()==vector().length()?MSFalse:MSTrue);} MSWidget *widget(void) {return (index()==vector().length()?0:_vector(index()));} }; #endif aplus-fsf-4.22/src/MSGUI/MSWidgetFreezer.H0000644000265000001440000000105610772770435013626 #ifndef MSWidgetFreezerHEADER #define MSWidgetFreezerHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1998-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSWidget; class MSGUIExport MSWidgetFreezer { public: MSWidgetFreezer(MSWidget *); ~MSWidgetFreezer(); private: MSWidget *_widget; MSBoolean _wasFrozen; }; #endif aplus-fsf-4.22/src/MSGUI/MSWidgetIterator.H0000644000265000001440000000116710772770435014020 #ifndef MSWidgetIteratorHEADER #define MSWidgetIteratorHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSWidget; typedef MSBoolean (*MSWidgetIteratorFunction)(MSWidget*, void*); class MSGUIExport MSWidgetIterator { public: MSWidgetIterator(void); virtual ~MSWidgetIterator(void); virtual MSBoolean applyTo(MSWidget *)=0; }; #endif aplus-fsf-4.22/src/MSGUI/MSWidgetOutput.H0000644000265000001440000001516710772770435013534 #ifndef MSWidgetOutputHEADER #define MSWidgetOutputHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MSWidgetHEADER #include #endif #include #include class MSDisplayPrint; #if HAVE_IOSTREAM #include #else #include #endif #if HAVE_FSTREAM #include #else class ofstream; #endif class MSPixmap; class MSGUIExport MSWidgetOutput : public MSWidget { public: class MSGUIExport DisplayPrint { public: MSDisplayPrint *_displayPrint; DisplayPrint(void); ~DisplayPrint(void); }; public: enum OutputMode {Draw=0,DrawPPM=1,Print=2}; protected: static OutputMode _outputMode; static DisplayPrint _displayPrint; public: MSWidgetOutput(void); MSWidgetOutput(MSDisplayServer*); MSWidgetOutput(MSWidget*); ~MSWidgetOutput(void); static MSDisplayPrint *displayPrint(void); static OutputMode outputMode(void); static void outputMode(OutputMode mode_); static MSBoolean displayPrintOpen(void); static MSBoolean displayPrintOpen(MSWidget *); static MSBoolean displayPrintClose(void); static int displayPrintMode(void); static Window displayPrintPixmap(void); static void displayPrintOriginInc(MSWidget *); static void displayPrintOriginDec(MSWidget *); static void displayPrintFileName(const char *); static void displayPrintXorigin(int); static void displayPrintYorigin(int); static void displayPrintInit(MSWidget *); static void displayPrintClear(void); static ofstream& displayPrintStream(void); void XClearArea(Display *,Window,int,int,int,int,int); void XCopyArea(Display *,Window,Window,GC,int,int,int,int,int,int); void XDrawArc(Display *,Window,GC,int,int,int,int,int,int); void XDrawArcs(Display *,Window,GC,XArc *,int); void XDrawLine(Display *,Window,GC,int,int,int,int); void XDrawLines(Display *,Window,GC,XPoint *,int,int); void XDrawSegments(Display *,Window,GC,XSegment *,int); void XDrawPoint(Display *,Window,GC,int,int); void XDrawPoints(Display *,Window,GC,XPoint *,int,int); void XDrawRectangle(Display *,Window,GC,int,int,int,int); void XDrawRectangles(Display *,Window,GC,XRectangle *,int); void XDrawString(Display *,Window,GC,const XFontStruct *,int,int,const char *,int); void XDrawImageString(Display *,Window,GC,const XFontStruct *,int,int,const char *,int); void XFillArc(Display *,Window,GC,int,int,int,int,int,int); void XFillArcs(Display *,Window,GC,XArc *,int); void XFillPolygon(Display *,Window,GC,XPoint *,int,int,int); void XFillRectangle(Display *,Window,GC,int,int,int,int); void XFillRectangles(Display *,Window ,GC,XRectangle *,int); void XBFillPolygon(Display *,Window ,GC,XPoint *,int,int,int); void XBFillRectangle(Display *,Window ,GC,int,int,int,int); void XBFillRectangles(Display *,Window ,GC,XRectangle *,int); void PFillPolygon(Display *,Window ,GC,XPoint *,int,int,int); void PFillRectangle(Display *,Window ,GC,int,int,int,int); void PFillRectangles(Display *,Window ,GC,XRectangle *,int); int XTextWidth(const XFontStruct *,const char *,int) const; int XTextExtents(const XFontStruct *,const char *,int,int*,int*,int*,XCharStruct*); void XSetClipRectangles(Display *,GC,int,int,XRectangle *,int,int); void XSetDashes(Display *,GC,int,const char *,int); void XFreeGC(Display *,GC); int XTextLength(const XFontStruct *,const char *) const; MSBoolean doubleByte(const XFontStruct *) const; void drawFlatShadow(Window,const MSRect&,int,GC); void drawBevelShadow(Window,const MSRect&,int,GC,GC); void drawEtchedShadow(Window,const MSRect&,MSShadowStyle,int,GC,GC); void drawDiamondShadow(Window,const MSRect&,MSBoolean,GC,GC,GC,GC); public: MSShadow& shadow(void); const MSShadow& shadow(void) const; GC highlightGC(void) const; GC bottomShadowGC(void) const; GC topShadowGC(void) const; GC backgroundShadowGC(void) const; GC selectShadowGC(void) const; unsigned long selectShadowColor(void) const; unsigned long topShadowColor(void) const; unsigned long bottomShadowColor(void) const; unsigned long highlightColor(void) const; MSShadowStyle shadowStyle(void) const; int highlightThickness(void) const; int shadowThickness(void) const; void shadowStyle(MSShadowStyle); void highlightThickness(int); void shadowThickness(int); void highlightColor(unsigned long); void highlightColor(const char *); virtual void clear(void); // methods for builder support virtual void set(MSAttrValueList& avList_); virtual MSAttrValueList& get(MSAttrValueList& avList_); protected: void init(void); void initColors(void); void createGCs(void); MSBoolean highlighted(void) const; MSGC& highlightMSGC(void); int topShadowOffset(void) const; void topShadowOffset(int); void drawBackground(void); void drawHighlight(void); void undrawHighlight(void); void drawShadow(void); void drawShadow(MSShadowStyle); void undrawShadow(void); void drawRaised(void); void drawSunken(void); void drawEtchedIn(void); void drawEtchedOut(void); void drawRaised(Window,const MSRect&,int); void drawSunken(Window,const MSRect&,int); void drawEtchedIn(Window,const MSRect&,int); void drawEtchedOut(Window,const MSRect&,int); void undrawBevel(void); void undrawBevel(const MSRect&,int); void undrawBevel(Window,const MSRect&,int); void drawBevel(void); void drawBevel(int); void drawBevel(const MSRect&,MSShadowStyle); void drawBevel(const MSRect&,MSShadowStyle,int); void drawBevel(Window,const MSRect&,MSShadowStyle,int); void drawBevel(Window,const MSRect&,int,GC,GC); void highlight(void); void unHighlight(void); void drawHighlightBorder(int); void undrawHighlightBorder(int); void drawHighlightBorder(GC,int,int,int,int,int); void copyPixmap(Display*,const MSPixmap&,Window,GC,int,int); void copyPixmap(Display*,const MSPixmap&,Window,GC,int,int,int,int,int,int,int,int); virtual void updateBackground(unsigned long); private: Window windowForDrawing(void); MSBoolean canDraw(void); int xDrawingOffset(void); int yDrawingOffset(void); protected: MSShadow _shadow; MSGC _highlightMSGC; int _highlightThickness; MSBoolean _highlighted; unsigned long _highlightColor; int _shadowThickness; MSShadowStyle _shadowStyle; int _topShadowOffset; }; #ifndef MS_NO_INLINES #ifndef MSWidgetOutputINLINES #include #endif #endif #endif aplus-fsf-4.22/src/MSGUI/MSWidgetResourceMapper.H0000644000265000001440000001012710772770435015157 #ifndef MSWidgetResourceMapperHEADER #define MSWidgetResourceMapperHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include // 4 situations that require fast lookup: // a) when the real value is needed from a logical value. // b) when the mapping between a pair of logical and real values is changed - need to update // the mapping and notify all widgets that registered for this change. // c) when the mapper is destroyed - need to remove destroy callback from widgets. // d) when a widget is destroyed - need to remove all resource-change callbacks registered // by this widget from our internal callback list. class MSWidget; class MSGUIExport MSWidgetResourceMapper { public: class MSGUIExport MapperItem : public MSCallbackBehavior { private: MSString _logicalValue; MSString _realValue; MSUnsignedLongVector _destroyCBList; protected: virtual void doCallback(MSCallback *); public: MapperItem() {} MapperItem(const MSString &logical_,const MSString &real_); MSUnsignedLongVector &destroyCBList(void) {return _destroyCBList;} const MSString &logicalValue(void) const {return _logicalValue;} const MSString &realValue(void) const {return _realValue;} void realValue(const MSString &realValue_) {_realValue=realValue_;} }; class MSGUIExport WidgetDestroyCallback : public MSCallback { private: MSWidgetResourceMapper &_mapper; MapperItem &_mapperItem; MSWidget *_widget; void *_id; public: WidgetDestroyCallback(MSWidgetResourceMapper &mapper_,MapperItem &mapperItem_,MSWidget *widget_,void *id_) :_mapper(mapper_),_mapperItem(mapperItem_),_widget(widget_),_id(id_) {} ~WidgetDestroyCallback(void) {} MSWidgetResourceMapper &mapper(void) {return _mapper;} MapperItem &mapperItem(void) {return _mapperItem;} MSWidget *widget(void) {return _widget;} void *id(void) {return _id;} virtual void process(void); }; friend class WidgetDestroyCallback; inline friend MSGUIExport const MSString &key(const MapperItem &item_) { return item_.logicalValue(); } typedef MSIHashKeySet ResourceSet; protected: ResourceSet _resourceSet; ResourceSet &resourceSet(void) {return _resourceSet;} const ResourceSet &resourceSet(void) const {return _resourceSet;} void widgetDestroyed(WidgetDestroyCallback *); public: MSWidgetResourceMapper(void); ~MSWidgetResourceMapper(void); // Associate a logical value with a real value void associate(const char *logicalValue_,const char *realValue_); // Return the real value of the corresponding logical value. const char *value(const char *logicalValue_) const; // Return a list of logical values that are current registered. MSStringVector logicalValues(void) const; // Add and remove a resource change callback. void addCallback(const char *,MSResourceChangeCallback *); void removeCallback(const char *,MSResourceChangeCallback *); }; // We provide explicit "do_not_instantiate" pragmas here to avoid instantiation complications in // MStk applications. // #if !defined(__MSGUILIBRARY_BUILD__) && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma do_not_instantiate MSIHashKeySet #pragma do_not_instantiate MSIHashKeySetNode #pragma do_not_instantiate MSIHashKeySetCursor #endif // !__MSGUILIBRARY_BUILD__ && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) DECLARE_ELEMENT_FOR_OPS_TYPE(MSWidgetResourceMapper::MapperItem) #endif aplus-fsf-4.22/src/MSGUI/MSWidgetState.H0000644000265000001440000000107510772770436013306 #ifndef MSWidgetStateHEADER #define MSWidgetStateHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #if HAVE_IOSTREAM #include #else class istream; #endif class MSGUIExport MSWidgetState : public MSHashTable { public: MSWidgetState (istream &is_); ~MSWidgetState(void); }; #endif aplus-fsf-4.22/src/MSGUI/MSWidgetVector.H0000644000265000001440000000550710772770436013474 #ifndef MSWidgetVectorHEADER #define MSWidgetVectorHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSWidget; class MSGUIExport MSWidgetVector : public MSUnsignedLongVector { public: class MSGUIExport Pick { friend class MSWidgetVector; public: Pick& operator=(MSWidget *); operator MSWidget *() const; MSWidgetVector *pVector(void) const; unsigned index(void) const; unsigned length(void) const; MSWidget *value(void) const; private: Pick(const MSWidgetVector&,unsigned); Pick(const Pick&); MSWidgetVector *_pVector; unsigned _index; }; friend class Pick; MSWidgetVector(void); MSWidgetVector(const MSWidgetVector&); MSWidgetVector(MSWidget *); ~MSWidgetVector(void); MSWidget *operator()(unsigned) const; MSWidget *operator()(unsigned); MSWidget *operator[](unsigned) const; Pick operator[](unsigned); MSWidgetVector& operator=(const MSWidgetVector&); MSWidgetVector& append(MSWidget *); MSWidgetVector& append(const MSWidgetVector &); MSWidgetVector& operator<<(MSWidget *); MSWidgetVector& operator<<(const MSWidgetVector&); // friend MSGUIExport MSWidgetVector& operator<<(MSWidgetVector&,MSWidget *); // friend MSGUIExport MSWidgetVector& operator<<(MSWidgetVector&,const MSWidgetVector&); }; // Pick inline methods inline MSWidgetVector *MSWidgetVector::Pick::pVector(void) const { return _pVector; } inline unsigned MSWidgetVector::Pick::index(void) const { return _index; } inline unsigned MSWidgetVector::Pick::length(void) const { return _pVector->length(); } inline MSWidgetVector::Pick::operator MSWidget *() const { return (MSWidget *)((const MSWidgetVector *)_pVector)->elementAt(_index); } inline MSWidget *MSWidgetVector::Pick::value(void) const { return (MSWidget *)((const MSWidgetVector *)_pVector)->elementAt(_index); } inline MSWidgetVector::Pick::Pick(const MSWidgetVector& aVector_,unsigned index_) { _pVector=&(MSWidgetVector&)aVector_; _index=index_; } inline MSWidgetVector::Pick::Pick(const Pick& aPick_) { _pVector=aPick_.pVector(); _index=aPick_.index(); } inline MSWidget *MSWidgetVector::operator()(unsigned index_) const { return (MSWidget *)elementAt(index_); } inline MSWidget *MSWidgetVector::operator()(unsigned index_) { return (MSWidget *)((const MSWidgetVector *)this)->elementAt(index_); } inline MSWidget *MSWidgetVector::operator[](unsigned index_) const { return (MSWidget *)elementAt(index_); } inline MSWidgetVector::Pick MSWidgetVector::operator[](unsigned index_) { return Pick(*this,index_); } #endif aplus-fsf-4.22/src/MSGUI/MSWidgetView.H0000644000265000001440000000126610772770436013142 #ifndef MSWidgetViewHEADER #define MSWidgetViewHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSGUIExport MSWidgetView : public MSWidgetOutput,public MSView { public: MSWidgetView(void); MSWidgetView(MSDisplayServer *); MSWidgetView(MSWidget *); ~MSWidgetView(void); protected: virtual void decoupleWidget(void); virtual MSBoolean isProtected(void) const; }; #endif aplus-fsf-4.22/src/MSGUI/MSWindow.H0000644000265000001440000000153510772770436012332 #ifndef MSWindowHEADER #define MSWindowHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSGUIExport MSWindow : public MSMenuShell { public: MSWindow(const char * windowTitle_=0); MSWindow(MSDisplayServer *,const char *windowTitle_=0); ~MSWindow(void); MSLayout * layout(void); const MSLayout * layout(void) const; protected: void init(void); private: }; inline MSLayout * MSWindow::layout(void) { return (MSLayout *) _child; } inline const MSLayout * MSWindow::layout(void) const { return (const MSLayout *) _child; } #endif aplus-fsf-4.22/src/MSGUI/MSArrayViewInlines.C0000644000265000001440000000272110772770436014307 #ifndef MSArrayViewINLINES #define MSArrayViewINLINES /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MS_NO_INLINES #define INLINELINKAGE inline #else #define INLINELINKAGE #endif INLINELINKAGE int MSArrayView::rowSeparator(void) const { return _rowSeparator; } INLINELINKAGE int MSArrayView::columnSeparator(void) const { return _columnSeparator; } INLINELINKAGE int MSArrayView::fixedColumns(void) const { return _fixedColumns; } INLINELINKAGE int MSArrayView::columnWidth(void) const { return _columnWidth; } INLINELINKAGE int MSArrayView::selectedColumn(void) const { return _selectedColumn; } INLINELINKAGE unsigned long MSArrayView::selectedCellBackground(void) const { return _selectBg; } INLINELINKAGE MSBoolean MSArrayView::needRowSep(int row_) { if (rowSeparator()>0) return MSBoolean((row_%rowSeparator())==(rowSeparator()-1)||row_==numRows()-1); else return MSFalse; } INLINELINKAGE MSBoolean MSArrayView::needColSep(int col_) { if (columnSeparator()>0) return MSBoolean((col_%columnSeparator())==(columnSeparator()-1)||col_==numColumns()-1); else return MSFalse; } #endif aplus-fsf-4.22/src/MSGUI/MSCompositeTextInlines.C0000644000265000001440000000634210772770436015210 #ifndef MSCompositeTextINLINES #define MSCompositeTextINLINES /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MS_NO_INLINES #define INLINELINKAGE inline #else #define INLINELINKAGE #endif INLINELINKAGE GC MSCompositeText::textGC(void) const { return _textGC; } INLINELINKAGE GC MSCompositeText::backgroundGC(void) const { return _backgroundGC; } INLINELINKAGE const XFontStruct *MSCompositeText::textFontStruct(void) const { return _textFontStruct; } INLINELINKAGE MSBoolean MSCompositeText::fixedWidth(void) const { return MSBoolean(_textFontStruct->per_char==0); } INLINELINKAGE MSBoolean MSCompositeText::doubleByte(void) const { if (_textFontStruct->min_byte1!=0||_textFontStruct->max_byte1!=0) return MSTrue; else if (_textFontStruct->max_char_or_byte2>255) return MSTrue; else return MSFalse; } INLINELINKAGE int MSCompositeText::textWidth(const char *pString_) const { if (pString_!=0) { unsigned len=strlen(pString_); if (doubleByte()==MSTrue) { return (int)XTextWidth16(_textFontStruct,(XChar2b*)pString_,len/2); } else return XTextWidth(_textFontStruct,pString_,len); } return 0; } INLINELINKAGE int MSCompositeText::textWidth(const char *pString_,int len_) const { if (pString_!=0) { if (doubleByte()==MSTrue) { return (int)XTextWidth16(_textFontStruct,(XChar2b*)pString_,len_/2); } else return (int)XTextWidth(_textFontStruct,pString_,len_); } return 0; } INLINELINKAGE int MSCompositeText::charWidth(void) const { return _textFontStruct->max_bounds.width; } INLINELINKAGE int MSCompositeText::charLbearing(void) const { return _textFontStruct->max_bounds.lbearing; } INLINELINKAGE int MSCompositeText::charRbearing(void) const { return _textFontStruct->max_bounds.rbearing; } INLINELINKAGE int MSCompositeText::textAscent(void) const { return _textFontStruct->max_bounds.ascent; } INLINELINKAGE int MSCompositeText::textDescent(void) const { return _textFontStruct->max_bounds.descent; } INLINELINKAGE int MSCompositeText::textHeight(void) const { return (textAscent()+textDescent()); } INLINELINKAGE const XCharStruct *MSCompositeText::charStruct(char aChar_) const { return &(_textFontStruct->per_char[aChar_-_textFontStruct->min_char_or_byte2]); } INLINELINKAGE int MSCompositeText::charWidth(char aChar_) const { return (_textFontStruct->per_char!=0&&aChar_>=_textFontStruct->min_char_or_byte2&& aChar_<=_textFontStruct->max_char_or_byte2)?charStruct(aChar_)->width:charWidth(); } INLINELINKAGE int MSCompositeText::charLbearing(char aChar_) const { return (_textFontStruct->per_char!=0&&aChar_>=_textFontStruct->min_char_or_byte2&& aChar_<=_textFontStruct->max_char_or_byte2)? charStruct(aChar_)->lbearing:charLbearing(); } INLINELINKAGE int MSCompositeText::charRbearing(char aChar_) const { return (_textFontStruct->per_char!=0&&aChar_>=_textFontStruct->min_char_or_byte2&& aChar_<=_textFontStruct->max_char_or_byte2)? charStruct(aChar_)->rbearing:charRbearing(); } #endif aplus-fsf-4.22/src/MSGUI/MSDisplayServerInlines.C0000644000265000001440000000625610772770436015201 #ifndef MSDisplayServerINLINES #define MSDisplayServerINLINES /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// INLINELINKAGE Display *MSDisplayServer::display(void) const { return _dpy; } INLINELINKAGE const char *MSDisplayServer::name(void) const { return _name; } INLINELINKAGE MSColorManager *MSDisplayServer::colorManager(void) const { return _colorManager; } INLINELINKAGE MSFontManager *MSDisplayServer::fontManager(void) const { return _fontManager; } INLINELINKAGE MSAtomTable& MSDisplayServer::atomTable(void) { return _atomTable; } INLINELINKAGE const MSAtomTable& MSDisplayServer::atomTable(void) const { return _atomTable; } INLINELINKAGE MSHashTable *MSDisplayServer::shadowHashTable(void) const { return _shadowHashTable; } INLINELINKAGE MSHashTable *MSDisplayServer::widgetHashTable(void) const { return _widgetHashTable; } INLINELINKAGE MSHashTable *MSDisplayServer::toolTipHashTable(void) const { return _toolTipHashTable; } INLINELINKAGE const MSString& MSDisplayServer::copyBuffer(void) const { return _copyBuffer; } INLINELINKAGE const MSString& MSDisplayServer::pasteBuffer(void) const { return _pasteBuffer; } INLINELINKAGE MSDisplayCursor *MSDisplayServer::watch(void) const { return _watchCursor; } INLINELINKAGE Font MSDisplayServer::defaultFont(void) const { return _defaultFont; } INLINELINKAGE unsigned long MSDisplayServer::defaultForeground(void) const { return _defaultFg; } INLINELINKAGE unsigned long MSDisplayServer::defaultBackground(void) const { return _defaultBg; } INLINELINKAGE Window MSDisplayServer::keyboardGrabber(void) const { return _keyboardGrabber; } INLINELINKAGE Window MSDisplayServer::pointerGrabber(void) const { return _pointerGrabber; } INLINELINKAGE unsigned long MSDisplayServer::defaultValueBackground(void) const { return _defaultValueBg; } INLINELINKAGE unsigned long MSDisplayServer::defaultHighlightColor(void) const { return _defaultHighlightColor; } INLINELINKAGE const MSWidget *MSDisplayServer::primarySelectionOwner(void) const { return _primarySelectionOwner; } INLINELINKAGE MSWidget *MSDisplayServer::primarySelectionOwner(void) { return _primarySelectionOwner; } INLINELINKAGE void MSDisplayServer::primarySelectionOwner(MSWidget *primarySelectionOwner_) { _primarySelectionOwner=primarySelectionOwner_; } INLINELINKAGE MSWidget *MSDisplayServer::menuGrabber(void) { return _menuGrabber; } INLINELINKAGE void MSDisplayServer::menuGrabber(MSWidget* menuGrabber_) { _menuGrabber=menuGrabber_; } INLINELINKAGE MSWidget *MSDisplayServer::menuBar(void) { return _menuBar; } INLINELINKAGE void MSDisplayServer::menuBar(MSWidget* menuBar_) { _menuBar=menuBar_; } INLINELINKAGE MSDisplayCursor *MSDisplayServer::menuGrabCursor(void) { return _menuGrabCursor; } INLINELINKAGE MSWidget* MSDisplayServer::scrollBarMenu(void) { return _scrollBarMenu; } INLINELINKAGE void MSDisplayServer::scrollBarMenu(MSWidget *menu_) { _scrollBarMenu=menu_; } #endif aplus-fsf-4.22/src/MSGUI/MSPrimitiveTextInlines.C0000644000265000001440000000655510772770436015224 #ifndef MSPrimitiveTextINLINES #define MSPrimitiveTextINLINES /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MS_NO_INLINES #define INLINELINKAGE inline #else #define INLINELINKAGE #endif INLINELINKAGE GC MSPrimitiveText::textGC(void) const { return _textGC; } INLINELINKAGE const XFontStruct *MSPrimitiveText::textFontStruct(void) const { return _textFontStruct; } INLINELINKAGE MSPixmap *MSPrimitiveText::stipple(void) const { return _stipple; } INLINELINKAGE MSBoolean MSPrimitiveText::fixedWidth(void) const { return MSBoolean(_textFontStruct->per_char==0); } INLINELINKAGE MSBoolean MSPrimitiveText::doubleByte(void) const { if (_textFontStruct->min_byte1!=0||_textFontStruct->max_byte1!=0) return MSTrue; else if (_textFontStruct->max_char_or_byte2>255) return MSTrue; else return MSFalse; } INLINELINKAGE int MSPrimitiveText::charWidth(void) const { return _textFontStruct->max_bounds.width; } INLINELINKAGE int MSPrimitiveText::charLbearing(void) const { return _textFontStruct->max_bounds.lbearing; } INLINELINKAGE int MSPrimitiveText::charRbearing(void) const { return _textFontStruct->max_bounds.rbearing; } INLINELINKAGE int MSPrimitiveText::textAscent(void) const { return _textFontStruct->max_bounds.ascent; } INLINELINKAGE int MSPrimitiveText::textDescent(void) const { return _textFontStruct->max_bounds.descent; } INLINELINKAGE int MSPrimitiveText::textHeight(void) const { return (textAscent()+textDescent()); } INLINELINKAGE int MSPrimitiveText::textWidth(const char *pString_) const { if (doubleByte()) { return (pString_!=0)? (int)XTextWidth16((XFontStruct*)_textFontStruct,(XChar2b*)pString_,strlen(pString_)/2):0; } else { return (pString_!=0)? (int)XTextWidth((XFontStruct*)_textFontStruct,pString_,strlen(pString_)):0; } } INLINELINKAGE int MSPrimitiveText::textWidth(const char *pString_,int len_) const { if (doubleByte()) { return (pString_!=0)? (int)XTextWidth16((XFontStruct*)_textFontStruct,(XChar2b*)pString_,len_/2):0; } else { return (pString_!=0)?(int)XTextWidth((XFontStruct*)_textFontStruct,pString_,len_):0; } } INLINELINKAGE const XCharStruct *MSPrimitiveText::charStruct(char aChar_) const { return &(_textFontStruct->per_char[aChar_-_textFontStruct->min_char_or_byte2]); } INLINELINKAGE int MSPrimitiveText::charWidth(char aChar_) const { return (_textFontStruct->per_char!=0&&aChar_>=_textFontStruct->min_char_or_byte2&& aChar_<=_textFontStruct->max_char_or_byte2)? charStruct(aChar_)->width:charWidth(); } INLINELINKAGE int MSPrimitiveText::charLbearing(char aChar_) const { return (_textFontStruct->per_char!=0&&aChar_>=_textFontStruct->min_char_or_byte2&& aChar_<=_textFontStruct->max_char_or_byte2)? charStruct(aChar_)->lbearing:charLbearing(); } INLINELINKAGE int MSPrimitiveText::charRbearing(char aChar_) const { return (_textFontStruct->per_char!=0&&aChar_>=_textFontStruct->min_char_or_byte2&& aChar_<=_textFontStruct->max_char_or_byte2)? charStruct(aChar_)->rbearing:charRbearing(); } INLINELINKAGE unsigned MSPrimitiveText::alignment(void) const { return _alignment; } #endif aplus-fsf-4.22/src/MSGUI/MSRowColumnViewInlines.C0000644000265000001440000001252210772770436015156 #ifndef MSRowColumnViewINLINES #define MSRowColumnViewINLINES /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// INLINELINKAGE MSSelectionMode MSRowColumnView::selectionMode(void) const { return _selectionMode; } INLINELINKAGE MSRowColumnView::Panner *MSRowColumnView::panner(void) const { return _panner; } INLINELINKAGE MSRowColumnView::Vsb *MSRowColumnView::vsb(void) const { return _vsb; } INLINELINKAGE MSRowColumnView::Hsb *MSRowColumnView::hsb(void) const { return _hsb; } INLINELINKAGE MSLabel *MSRowColumnView::label(void) const { return _label; } INLINELINKAGE MSRowColumnView::Editor *MSRowColumnView::editor(void) const { return _editor; } INLINELINKAGE MSBackingStorePixmap *MSRowColumnView::redrawPixmap(void) const { return _redrawPixmap; } INLINELINKAGE MSGC& MSRowColumnView::selectionVectorMSGC(void) { return _selectionVectorMSGC; } INLINELINKAGE GC MSRowColumnView::selectionVectorGC(void) const { return _selectionVectorMSGC.gc(); } INLINELINKAGE unsigned long MSRowColumnView::sizeState(void) const { return _sizeState; } INLINELINKAGE unsigned long MSRowColumnView::scrollBarState(void) const { return _scrollBarState; } INLINELINKAGE MSBoolean MSRowColumnView::isVsbEnabled(void) const { return MSBoolean((VsbEnabled&scrollBarState())==VsbEnabled); } INLINELINKAGE MSBoolean MSRowColumnView::isHsbEnabled(void) const { return MSBoolean((HsbEnabled&scrollBarState())==HsbEnabled); } INLINELINKAGE int MSRowColumnView::naturalRows(void) const { return _naturalRows; } INLINELINKAGE int MSRowColumnView::naturalCols(void) const { return _naturalCols; } INLINELINKAGE MSUnsignedLongVector &MSRowColumnView::cycleList(void) { return _cycleList; } INLINELINKAGE MSRowColumnView::CycleTimer *MSRowColumnView::cycleTimer(void) const { return _cycleTimer; } INLINELINKAGE const MSIndexVector& MSRowColumnView::selectionVector(void) const { return _selectionVector; } INLINELINKAGE MSCycleColorMode MSRowColumnView::cycleColorMode(void) const { return _cycleMode; } INLINELINKAGE const MSUnsignedLongVector& MSRowColumnView::foregroundColors(void) const { return _foregroundColors; } INLINELINKAGE const MSUnsignedLongVector& MSRowColumnView::backgroundColors(void) const { return _backgroundColors; } INLINELINKAGE const MSUnsignedLongVector& MSRowColumnView::cycleColors(void) const { return _cycleColors; } INLINELINKAGE unsigned long MSRowColumnView::cycleInterval(void) const { return _cycleInterval; } INLINELINKAGE int MSRowColumnView::firstRow(void) const { return _firstRow; } INLINELINKAGE int MSRowColumnView::firstColumn(void) const { return _firstColumn; } INLINELINKAGE int MSRowColumnView::selectedRow(void) const { return _selectedRow; } INLINELINKAGE int MSRowColumnView::rows(void) const { return _rows; } INLINELINKAGE int MSRowColumnView::columns(void) const { return _columns; } INLINELINKAGE int MSRowColumnView::columnSpacing(void) const { return _columnSpacing; } INLINELINKAGE int MSRowColumnView::rowSpacing(void) const { return _rowSpacing; } INLINELINKAGE int MSRowColumnView::spacing(void) const { return _spacing; } INLINELINKAGE unsigned long MSRowColumnView::selectedRowBackground(void) const { return _rowBg; } INLINELINKAGE unsigned long MSRowColumnView::editorBackground(void) const { return _editor->background(); } INLINELINKAGE unsigned long MSRowColumnView::editorForeground(void) const { return _editor->foreground(); } INLINELINKAGE unsigned long MSRowColumnView::vsbBackground(void) const { return _vsb->background(); } INLINELINKAGE unsigned long MSRowColumnView::hsbBackground(void) const { return _hsb->background(); } INLINELINKAGE MSBoolean MSRowColumnView::editing(void) const { return _editor->mapped(); } INLINELINKAGE int MSRowColumnView::scrollBarSize(void) const { return _vsb->width(); } INLINELINKAGE int MSRowColumnView::rowHeight(void) { return _rowHeight; } INLINELINKAGE void MSRowColumnView::rowHeight(int rh_) { _rowHeight=rh_; } INLINELINKAGE int MSRowColumnView::headingsHeight(void) { return _headingsHeight; } INLINELINKAGE void MSRowColumnView::headingsHeight(int hh_) { _headingsHeight=hh_; } INLINELINKAGE int MSRowColumnView::lastBlock(void) const { return _lastBlock; } INLINELINKAGE void MSRowColumnView::lastBlock(int block_) { _lastBlock=block_; } INLINELINKAGE unsigned long MSRowColumnView::addEditorKeyCallback( const char* pString_,MSKeyCallback* keyCallback_) {return editor()->addKeyCallback(pString_,keyCallback_);} INLINELINKAGE void MSRowColumnView::removeEditorKeyCallback(unsigned long id_) { editor()->removeKeyCallback(id_); } INLINELINKAGE void MSRowColumnView::removeEditorKeyCallback(const char* pString_) { editor()->removeKeyCallback(pString_); } #endif aplus-fsf-4.22/src/MSGUI/MSTreeView.C0000644000265000001440000024655610772770436012626 #ifndef MSTreeViewIMPLEMENTATION #define MSTreeViewIMPLEMENTATION /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include // look for elementForOps #include const int MSTreeViewDefaultButtonShadowThickness=2; const int MSTreeViewDefaultButtonNodeMargin=2; const unsigned long MSTreeViewEventMask=(ExposureMask|ButtonPressMask); const int MSTreeViewDefaultNodeMargin=8; const int MSTreeViewDefaultMargin=10; const int MSTreeViewMinimumEditorWidth=75; const int MSTreeViewDefaultHorizontalSpacing=25; const int MSTreeViewDefaultVerticalSpacing=15; #define MSTreeViewCollapsedButtonPixmapName "__MSTreeViewCollapsedButtonPixmap__" #define MSTreeViewExpandedButtonPixmapName "__MSTreeViewExpandedButtonPixmap__" #define MSTreeView_ExpandedPixmap_width 10 #define MSTreeView_ExpandedPixmap_height 10 #define MSTreeView_CollapsedPixmap_width 10 #define MSTreeView_CollapsedPixmap_height 10 //NodeAttribute #if !defined(MS_INLINE_TEMPLATE_NESTED_CLASS) template MSTreeView::NodeAttribute::NodeAttribute(const NodeAttribute &nodeAttr_) :_sensitive(nodeAttr_.sensitive()), _expandable(nodeAttr_.expandable()), _expandedState(nodeAttr_.expandedState()), _pixmap(nodeAttr_.pixmap()), _insensitivePixmap(nodeAttr_.insensitivePixmap()), _selectedPixmap(nodeAttr_.selectedPixmap()) {} template MSTreeView::NodeAttribute::NodeAttribute(void) :_sensitive(MSTrue),_expandable(MSFalse),_expandedState(MSFalse) {} template MSTreeView::NodeAttribute::~NodeAttribute(void) {} template typename MSTreeView::NodeAttribute &MSTreeView::NodeAttribute::operator=(const NodeAttribute &nodeAttr_) { if (&nodeAttr_!=this) { _sensitive=nodeAttr_.sensitive(); _expandable=nodeAttr_.expandable(); _expandedState=nodeAttr_.expandedState(); _pixmap=nodeAttr_.pixmap(); _insensitivePixmap=nodeAttr_.insensitivePixmap(); _selectedPixmap=nodeAttr_.selectedPixmap(); } return *this; } template MSBoolean MSTreeView::NodeAttribute::operator==(const NodeAttribute &nodeAttr_) { if (sensitive()==nodeAttr_.sensitive()&& expandable()==nodeAttr_.expandable()&& expandedState()==nodeAttr_.expandedState()&& pixmap()==nodeAttr_.pixmap()&& insensitivePixmap()==nodeAttr_.insensitivePixmap()&& selectedPixmap()==nodeAttr_.selectedPixmap()) { return MSTrue; } else { return MSFalse; } } #endif #if !defined(MS_INLINE_TEMPLATE_NESTED_CLASS) // Editor template MSTreeView::Editor::Editor(MSWidget *owner_) : MSTextField(owner_) { _highlightThickness=0; color(owner()->background(),owner()->foreground()); selectInput(ExposureMask|ButtonPressMask); } template MSTreeView::Editor::~Editor(void) {} template void MSTreeView::Editor::activate(void) { ((MSTreeView *)(owner()->owner()))->editorActivate(); } template void MSTreeView::Editor::escape(void) { ((MSTreeView *)(owner()->owner()))->editorEscape(); } #endif // !MS_INLINE_TEMPLATE_NESTED_CLASS // MSTreeView template MSTreeView::MSTreeView(MSWidget *owner_,TreeModel &model_) : MSScrollableWidget(owner_), _nodeShadow(server()), _selectedShadow(server()), _selectedCursor(_elementTree), _activatedNode(0), _redrawPixmap(0) { init(); couple(&model_); } template MSTreeView::MSTreeView(MSWidget *owner_) : MSScrollableWidget(owner_), _nodeShadow(server()), _selectedShadow(server()), _selectedCursor(_elementTree), _activatedNode(0), _redrawPixmap(0) { init(); } template void MSTreeView::init(void) { _pPopupMenu=0; _orientation=Horizontal; _showButtons=MSTrue; _showLabels=MSTrue; _showPixmaps=MSTrue; _buttonShadowThickness=MSTreeViewDefaultButtonShadowThickness; _buttonNodeMargin=MSTreeViewDefaultButtonNodeMargin; _collapsedButtonPixmap=0; _expandedButtonPixmap=0; _showRootNode=MSTrue; _horizontalSpacing=MSTreeViewDefaultHorizontalSpacing; _verticalSpacing=MSTreeViewDefaultVerticalSpacing; _maxWidth=0; _maxHeight=0; _margin=MSTreeViewDefaultMargin; _nodeMargin=MSTreeViewDefaultNodeMargin; _pEditor=new Editor(viewPort()); _pEditor->xMargin(2); selectInput(MSTreeViewEventMask); _lineForeground=foreground(); _nodeForeground=foreground(); _nodeBackground=background(); _selectedNodeForeground=_nodeBackground; _selectedNodeBackground=_nodeForeground; _nodeShadow.color(_nodeBackground); _selectedShadow.color(_selectedNodeBackground); editor()->color(_selectedNodeBackground,_selectedNodeForeground); addToFocusList(); _stipplePixmap=new MSPixmap(server(),MSPixmap::ForegroundFiftyPixmap,1,0,1); XGCValues values; values.foreground=foreground(); values.background=background(); values.font=font(); values.stipple=stipplePixmap()->pixmap(); values.fill_style=FillSolid; _textGC=XCreateGC(display(),window(),(GCForeground|GCBackground|GCFont|GCStipple|GCFillStyle), &values); fontObject().fontStruct(server()->fontStruct(font())); values.foreground=foreground(); values.background=background(); _pixmapGC=XCreateGC(display(),window(),(GCForeground|GCBackground),&values); XSetWindowAttributes attrs; attrs.backing_store=WhenMapped; XChangeWindowAttributes(display(),viewPort()->window(),CWBackingStore,&attrs); buildCollapsedButtonPixmap(); buildExpandedButtonPixmap(); } template void MSTreeView::buildCollapsedButtonPixmap(void) { static char MSTreeView_CollapsedPixmap_bits[] = { 0x00, 0x00, 0x78, 0x00, 0xfc, 0x00, 0xfe, 0x01, 0xfe, 0x01, 0xfe, 0x01, 0xfe, 0x01, 0xfc, 0x00, 0x78, 0x00, 0x00, 0x00}; if (_collapsedButtonPixmap!=0) delete _collapsedButtonPixmap; _collapsedButtonPixmap=new MSPixmap(server(),MSTreeViewCollapsedButtonPixmapName, MSTreeView_CollapsedPixmap_bits, MSTreeView_CollapsedPixmap_width, MSTreeView_CollapsedPixmap_height); } template void MSTreeView::buildExpandedButtonPixmap(void) { static char MSTreeView_ExpandedPixmap_bits[] = { 0x00, 0x00, 0x78, 0x00, 0xfc, 0x00, 0xce, 0x01, 0x86, 0x01, 0x86, 0x01, 0xce, 0x01, 0xfc, 0x00, 0x78, 0x00, 0x00, 0x00}; if (_expandedButtonPixmap!=0) delete _expandedButtonPixmap; _expandedButtonPixmap=new MSPixmap(server(),MSTreeViewExpandedButtonPixmapName, MSTreeView_ExpandedPixmap_bits, MSTreeView_ExpandedPixmap_width, MSTreeView_ExpandedPixmap_height); } template void MSTreeView::lineForeground(unsigned long pixel_) { if (pixel_!=_lineForeground) { _lineForeground=pixel_; redrawViewPortImmediately(); } } template void MSTreeView::nodeForeground(unsigned long pixel_) { if (pixel_!=_nodeForeground) { if(selectedNodeBackground()==nodeForeground()) { _selectedNodeBackground=pixel_; _selectedShadow.color(_selectedNodeBackground); } _nodeForeground=pixel_; redrawViewPortImmediately(); } } template void MSTreeView::nodeBackground(unsigned long pixel_) { if (pixel_!=_nodeBackground) { if(selectedNodeForeground()==nodeBackground()) { _selectedNodeForeground=pixel_; } _nodeBackground=pixel_; _nodeShadow.color(_nodeBackground); redrawViewPortImmediately(); } } template void MSTreeView::selectedNodeForeground(unsigned long pixel_) { if (pixel_!=_selectedNodeForeground) { _selectedNodeForeground=pixel_; redrawViewPortImmediately(); } } template void MSTreeView::selectedNodeBackground(unsigned long pixel_) { if (pixel_!=_selectedNodeBackground) { _selectedNodeBackground=pixel_; _selectedShadow.color(_selectedNodeBackground); redrawViewPortImmediately(); } } template void MSTreeView::lineForeground(const char *pString_) { lineForeground(server()->pixel(pString_)); } template void MSTreeView::nodeForeground(const char *pString_) { nodeForeground(server()->pixel(pString_)); } template void MSTreeView::nodeBackground(const char *pString_) { nodeBackground(server()->pixel(pString_)); } template void MSTreeView::selectedNodeForeground(const char *pString_) { selectedNodeForeground(server()->pixel(pString_)); } template void MSTreeView::selectedNodeBackground(const char *pString_) { selectedNodeBackground(server()->pixel(pString_)); } template MSTreeView::~MSTreeView(void) { if (_pPopupMenu!=0) _pPopupMenu->destroy(); _pEditor->destroy(); if (_collapsedButtonPixmap!=0) delete _collapsedButtonPixmap; if (_expandedButtonPixmap!=0) delete _expandedButtonPixmap; if (textGC()!=0) XFreeGC(display(),_textGC); if (pixmapGC()!=0) XFreeGC(display(),_pixmapGC); if (stipplePixmap()!=0) delete stipplePixmap(); if (redrawPixmap()!=0) delete _redrawPixmap; } template void MSTreeView::popupMenu(MSPopupMenu *popupMenu_) { if (_pPopupMenu!=0) _pPopupMenu->destroy(); _pPopupMenu=popupMenu_; } template void MSTreeView::orientation(MSTreeView::Orientation orientation_) { if (orientation()!=orientation_) { _orientation=orientation_; XFillRectangle(display(),viewPort()->window(),backgroundShadowGC(),0,0,viewPort()->width(),viewPort()->height()); adjustSize(); } } template void MSTreeView::verticalSpacing(int value_) { if (verticalSpacing()!=value_) { _verticalSpacing=value_; adjustSize(); } } template void MSTreeView::horizontalSpacing(int value_) { if (horizontalSpacing()!=value_) { _horizontalSpacing=value_; adjustSize(); } } template void MSTreeView::editorActivate(void) { if (selectedCursor().isValid()==True) { TreeNode &aNode=nodeAt(selectedCursor()); MSString currentString; formatOutput(currentString,aNode.cursor()); if (editor()->text()!=currentString) { if (validate(aNode.cursor(),editor()->string())==MSTrue) { editor()->unmap(); modelTree().elementChanged(aNode.cursor()); } else server()->bell(); } else editor()->unmap(); } } template MSBoolean MSTreeView::validate(TreeModelCursor &cursor_,const char *pString_) { if (msTreeSetType(elementForOps(modelTree().elementAt(cursor_)),pString_)==MSError::MSSuccess) return MSTrue; else return MSFalse; } template const char *MSTreeView::formatOutput(MSString &buffer_,TreeModelCursor &cursor_) { if (cursor_.isValid()) msTreeFormatType(elementForOps(modelTree().elementAt(cursor_)),buffer_); return buffer_.string(); } template void MSTreeView::nodeModified(const TreeModelCursor &cursor_,NodeAttribute &attribute_) { nodeAttribute(cursor_,attribute_); } template void MSTreeView::nodeAttribute(const TreeModelCursor &,NodeAttribute &) {} template void MSTreeView::editorEscape(void) { loseFocusNotify(editor()); editor()->unmap(); } template void MSTreeView::mapEditor(void) { if (showLabels()==MSTrue&&selectedCursor().isValid()==True) { TreeNode& aNode=nodeAt(selectedCursor()); int x=aNode.x()-hsb()->value(); int y=aNode.y()-vsb()->value(); int pw=0,ph=0; if (showPixmaps()==MSTrue) { calculatePixmapSize(aNode.selectedPixmap(),pw,ph); } pw+=(pw>0)?buttonNodeMargin():0; x+=pw; int th=fontObject().textHeight()+nodeMargin(); if (thmoveTo(x,y); int ww=aNode.width()-pw; int hh=th; if (showButtons()==MSTrue&&aNode.expandable()==MSTrue) { if (orientation()==Horizontal) { ww-=(collapsedButtonPixmap().width()+buttonShadowThickness()*2+buttonNodeMargin()); } } editor()->resize((ww>MSTreeViewMinimumEditorWidth)?ww:MSTreeViewMinimumEditorWidth,hh); editor()->foreground(selectedNodeBackground()); editor()->background(selectedNodeForeground()); editor()->map(); takeFocusNotify(editor()); } } template void MSTreeView::firstMapNotify(void) { if (elementTree().isEmpty()==True) rebuildScreen(); adjustSize(); MSScrollableWidget::firstMapNotify(); } template void MSTreeView::redrawViewPortImmediately(void) { if (firstMap()==MSTrue) { drawTree(); if (mapped()==MSTrue) redrawViewPort(); } } template void MSTreeView::redrawViewPort(void) { if (frozen()==MSFalse) { XCopyArea(display(),redrawPixmap()->pixmap(),viewPort()->window(),textGC(), hsb()->value(),vsb()->value(),viewPort()->width(),viewPort()->height(),0,0); } } template void MSTreeView::moveDrawArea(int x_,int y_) { if (x_!=drawAreaWidget()->x()||y_!=drawAreaWidget()->y()) { MSScrollableWidget::moveDrawArea(x_,y_); if (editor()->mapped()==MSTrue) { TreeNode& aNode=nodeAt(selectedCursor()); int x=aNode.x()-hsb()->value(); int y=aNode.y()-vsb()->value(); editor()->moveTo(x,y); } if (mapped()==MSTrue) redrawViewPort(); } } template void MSTreeView::adjustSize(void) { if (firstMap()==MSTrue&&frozen()==MSFalse) { MSShellBusy busy((MSShell *)top()); recompVectors(); _maxWidth=0; _maxHeight=0; computeMaxExtents(); int offset=2*(margin()+shadowThickness()+highlightThickness()); int ww=maxWidth()+offset; int hh=maxHeight()+offset; resizeRedrawPixmap(ww,hh); drawTree(); if (ww!=drawAreaWidget()->width()||hh!=drawAreaWidget()->height()) { resizeDrawArea(ww,hh); } redrawViewPort(); } } template void MSTreeView::resizeRedrawPixmap(int w_,int h_) { // We only want to create new pixmap if new size is bigger than what we already had if (redrawPixmap()!=0&&redrawPixmap()->width()>=w_&&redrawPixmap()->height()>=h_) return; if (redrawPixmap()!=0) delete _redrawPixmap; if(w_>0 && h_>0) { MSString name((unsigned long)this); _redrawPixmap=new MSPixmap(server(),name,w_,h_,foreground(),background()); } } template int MSTreeView::computeTreeDepth(void) { ElementTreeCursor treeCursor(elementTree()); if(_startCursor.isValid()) treeCursor=_startCursor; else treeCursor.setToRoot(); if(showRootNode()==MSFalse) { // root node is not shown and doesn't exist or is not expandable then // the depth should be 0, as nothing will be shown. if(treeCursor.isValid()==MSFalse) return 0; const TreeNode &aNode= nodeAt(treeCursor); if(aNode.expandable()==MSFalse || aNode.expandedState()==MSFalse) { return 0; } } return computeTreeDepth(treeCursor,1); } template int MSTreeView::computeTreeDepth(ElementTreeCursor treeCursor_,int depth_) { if (treeCursor_.isValid()==MSTrue) { const TreeNode &aNode=nodeAt(treeCursor_); if (aNode.expandable()==MSTrue&&aNode.expandedState()==MSTrue) { depth_++; for (treeCursor_.setToFirstExistingChild();treeCursor_.isValid();treeCursor_.setToNextExistingChild()) { int maxDepth=computeTreeDepth(treeCursor_,depth_); depth_=(maxDepth>depth_)?maxDepth:depth_; } } } return depth_; } template void MSTreeView::recompVectors(void) { if (frozen()==MSFalse) { int offset=margin()+shadowThickness()+highlightThickness(); int depth=computeTreeDepth(); if (depth>_verticalPositions.length()) { _verticalPositions=_horizontalPositions=MSIntVector(depth,offset); } else { _verticalPositions=offset; _horizontalPositions=offset; } if(depth>0) computePositions(); setPositions(); } } template void MSTreeView::computeMaxExtents(void) { ElementTreeCursor treeCursor(elementTree()); if(_startCursor.isValid()) treeCursor=_startCursor; else treeCursor.setToRoot(); if (treeCursor.isValid()==True) computeMaxExtents(treeCursor); } template void MSTreeView::drawTree(void) { if (frozen()==MSFalse) { XSetForeground(display(),textGC(),background()); XFillRectangle(display(),redrawPixmap()->pixmap(),textGC(),0,0,redrawPixmap()->width(),redrawPixmap()->height()); ElementTreeCursor treeCursor(elementTree()); if(_startCursor.isValid()) treeCursor=_startCursor; else treeCursor.setToRoot(); if (treeCursor.isValid()==True) { if (showRootNode()==MSTrue) drawTree(treeCursor,redrawPixmap()->pixmap()); // do not draw the root - i.e. draw the tree as if it has multiple roots else { const TreeNode &aNode=nodeAt(treeCursor); if (aNode.expandable()==MSTrue&&aNode.expandedState()==MSTrue) { for (treeCursor.setToFirstExistingChild();treeCursor.isValid();treeCursor.setToNextExistingChild()) { drawTree(treeCursor,redrawPixmap()->pixmap()); } } } } } } template void MSTreeView::drawTree(ElementTreeCursor treeCursor_,Window window_) { if (frozen()==MSFalse) { drawNode(treeCursor_,window_,MSFalse); TreeNode& aNode=nodeAt(treeCursor_); int rootX,rootY; if (orientation()==Horizontal) { rootX=aNode.x()+aNode.width(); rootY=aNode.y()+aNode.height()/2; } else { rootX=aNode.x()+aNode.width()/2; rootY=aNode.y()+aNode.height(); } if (aNode.expandable()==MSTrue&&aNode.expandedState()==MSTrue) { for (treeCursor_.setToFirstExistingChild();treeCursor_.isValid();treeCursor_.setToNextExistingChild()) { TreeNode& aChildInstance=nodeAt(treeCursor_); XSetForeground(display(),textGC(),foreground()); int childX,childY; if (orientation()==Horizontal) { childX=aChildInstance.x(); childY=aChildInstance.y()+(aChildInstance.height()/2); } else { childX=aChildInstance.x()+(aChildInstance.width()/2); childY=aChildInstance.y(); } XSetForeground(display(),textGC(),lineForegroundColor(&aChildInstance)); XDrawLine(display(),window_,textGC(),rootX,rootY,childX,childY); drawTree(treeCursor_,window_); } } } } template void MSTreeView::drawNode(ElementTreeCursor &treeCursor_,Window window_,MSBoolean clear_) { TreeNode& aNode=nodeAt(treeCursor_); if (aNode.width()>0&&aNode.height()>0) { if (clear_==MSTrue) { XFillRectangle(display(),window_,backgroundShadowGC(),aNode.x(),aNode.y(), aNode.width(),aNode.height()); } MSBoolean displayButton=MSBoolean(showButtons()==MSTrue&&aNode.expandable()==MSTrue); // bw and bh are values to be deducted from the node width and node height // based on whether the collapse/expand button will be drawn and the orientation int bw,bh; MSPixmap *buttonPixmap=0; if (displayButton==MSTrue) { if (orientation()==Horizontal) { if (aNode.expandedState()==MSTrue) buttonPixmap=_expandedButtonPixmap; else buttonPixmap=_collapsedButtonPixmap; bw=buttonPixmap->width()+buttonShadowThickness()*2+buttonNodeMargin(); bh=0; } else { if (aNode.expandedState()==MSTrue) buttonPixmap=_expandedButtonPixmap; else buttonPixmap=_collapsedButtonPixmap; bh=buttonPixmap->height()+buttonShadowThickness()*2+buttonNodeMargin(); bw=0; } } else { bh=0; bw=0; } // Figure out the sensitivity and the selected state of the node MSBoolean sensitive=isSensitive(&aNode); MSBoolean selected; if (selectedCursor().isValid()==True&&selectedCursor()==treeCursor_) selected=MSTrue; else selected=MSFalse; // Draw the pixmaps if necessary. hLimit specifies the available height for // pixmap rendering. The drawPixmaps() method potentially alters the parameter // x. The new x value will be the starting position for the rest of the drawing. // i.e., label and button. int x=aNode.x(); int y=aNode.y(); int hLimit=aNode.height()-bh; if (showPixmaps()==MSTrue) { if (selected==MSTrue) drawPixmaps(window_,selectedPixmap(&aNode),x,y,hLimit); else if (sensitive==MSTrue) drawPixmaps(window_,pixmap(&aNode),x,y,hLimit); else drawPixmaps(window_,insensitivePixmap(&aNode),x,y,hLimit); } // Draw the label if necessary. pw is the width consumed by the pixmaps. // th is text height, and tw is text width. int pw=x-aNode.x(); int th=0; int tw=0; if (showLabels()==MSTrue) { MSString aString; formatOutput(aString,aNode.cursor()); th=fontObject().textHeight()+nodeMargin(); if (thtopShadowGC(),pShadow->bottomShadowGC()); unsigned long fg=nodeForegroundColor(&aNode); XSetForeground(display(),textGC(),fg); if (sensitive==MSFalse) XSetFillStyle(display(),textGC(),FillStippled); XDrawString(display(),window_,textGC(),fontObject().fontStruct(), x+4,y+fontObject().textAscent()+4, aString,aString.length()); if (sensitive==MSFalse) XSetFillStyle(display(),textGC(),FillSolid); } // Draw the button if necessary if (displayButton==MSTrue) { int startx,starty; if (orientation()==Horizontal) { startx=aNode.x()+aNode.width()-buttonPixmap->width()-buttonShadowThickness(); starty=aNode.y()+(aNode.height()-(buttonPixmap->height()+buttonShadowThickness()*2))/2+buttonShadowThickness(); } else { startx=aNode.x()+(aNode.width()/2)-(buttonPixmap->width()/2); starty=aNode.y()+aNode.height()-(buttonPixmap->height()+buttonShadowThickness()*2)+buttonShadowThickness(); } XSetForeground(display(),pixmapGC(),foreground()); copyPixmap(display(),*buttonPixmap,window_,pixmapGC(),startx,starty); if (buttonShadowThickness()>0) { drawShadow(window_, MSRect(startx-buttonShadowThickness(),starty-buttonShadowThickness(), buttonPixmap->width()+buttonShadowThickness()*2, buttonPixmap->height()+buttonShadowThickness()*2), buttonShadowThickness(),topShadowGC(),bottomShadowGC()); } } } } template void MSTreeView::drawPixmaps(Window window_,const PixmapList &pixmapList_, int &x_,int &y_,int hLimit_) { unsigned long nElements=pixmapList_.length(); for (unsigned long i=0;i void MSTreeView::drawShadow(Window window_,const MSRect& aRect_, int thickness_,GC topGC_,GC bottomGC_) { XPoint points[7]; if (thickness_>0) { points[0].x=points[1].x=points[6].x=aRect_.x(); points[0].y=points[6].y=aRect_.y()+aRect_.height(); points[1].y=points[2].y=aRect_.y(); points[2].x=aRect_.x()+aRect_.width(); points[3].x=aRect_.x()+aRect_.width()-thickness_; points[3].y=points[4].y=aRect_.y()+thickness_; points[4].x=points[5].x=aRect_.x()+thickness_; points[5].y=aRect_.y()+aRect_.height()-thickness_; XBFillRectangle(display(),window_,bottomGC_, aRect_.x(),aRect_.y()+aRect_.height()-thickness_, aRect_.width(),thickness_); XBFillRectangle(display(),window_,bottomGC_, aRect_.x()+aRect_.width()-thickness_,aRect_.y(), thickness_,aRect_.height()); XBFillPolygon(display(),window_,topGC_,points,7,Nonconvex,CoordModeOrigin); } } template void MSTreeView::shiftVerticalPosition(ElementTreeCursor treeCursor_,int y_) { TreeNode& aNode=nodeAt(treeCursor_); aNode.y(aNode.y()+y_); for (treeCursor_.setToFirstExistingChild();treeCursor_.isValid();treeCursor_.setToNextExistingChild()) { shiftVerticalPosition(treeCursor_,y_); } } template void MSTreeView::shiftHorizontalPosition(ElementTreeCursor treeCursor_,int x_) { TreeNode& aNode=nodeAt(treeCursor_); aNode.x(aNode.x()+x_); for (treeCursor_.setToFirstExistingChild();treeCursor_.isValid();treeCursor_.setToNextExistingChild()) { shiftHorizontalPosition(treeCursor_,x_); } } template void MSTreeView::setPositions(void) { ElementTreeCursor treeCursor(elementTree()); if(_startCursor.isValid()) treeCursor=_startCursor; else treeCursor.setToRoot(); if (treeCursor.isValid()==True) { setPositions(treeCursor,0); if (showRootNode()==MSFalse) { TreeNode& aNode=nodeAt(treeCursor); int offset; if (orientation()==Horizontal) { offset=aNode.width()+horizontalSpacing(); shiftHorizontalPosition(treeCursor,-offset); } else { offset=aNode.height()+verticalSpacing(); shiftVerticalPosition(treeCursor,-offset); } } } } template void MSTreeView::setPositions(ElementTreeCursor treeCursor_,int depth_) { TreeNode& aNode=nodeAt(treeCursor_); int sum=0; int j; int offset=margin()+shadowThickness()+highlightThickness(); if (orientation()==Vertical) { for (j=0;j void MSTreeView::computeMaxExtents(ElementTreeCursor treeCursor_) { TreeNode& aNode=nodeAt(treeCursor_); int w=aNode.x()+aNode.width(); int h=aNode.y()+aNode.height(); _maxWidth=(w>maxWidth())?w:maxWidth(); _maxHeight=(h>maxHeight())?h:maxHeight(); if (aNode.expandable()==MSTrue&&aNode.expandedState()==MSTrue) { for (treeCursor_.setToFirstExistingChild();treeCursor_.isValid();treeCursor_.setToNextExistingChild()) { computeMaxExtents(treeCursor_); } } } template void MSTreeView::computePositions(void) { ElementTreeCursor treeCursor(elementTree()); if(_startCursor.isValid()) treeCursor=_startCursor; else treeCursor.setToRoot(); if (treeCursor.isValid()==True) { if (orientation()==Vertical) { computeHorizontalPositions(treeCursor,0); } else { computeVerticalPositions(treeCursor,0); } } } // computeHorizontalPositions will compute the positions for each node // when the orientation is Vertical. The Vertical position is // purely related to the depth of the node in the tree while the // horizontal position depends on the number of children from all nodes // at the same depth template int MSTreeView::computeHorizontalPositions(ElementTreeCursor treeCursor_,int depth_) { int offset=margin()+shadowThickness()+highlightThickness(); int depth=0,childDepth=0; int hpos=horizontalPosition(depth_); int vpos=verticalPosition(depth_); TreeNode& aNode=nodeAt(treeCursor_); int width,height; calculateNodeSize(aNode,width,height); aNode.configuration(offset,offset,width,height); verticalPosition(depth_,(vpos>aNode.height())?vpos:aNode.height()); MSBoolean hasChildren(MSFalse); if (aNode.expandable()==MSTrue&&aNode.expandedState()==MSTrue) { if (elementTree().numberOfSubtreeElements(treeCursor_)>1) hasChildren=MSTrue; } if (hasChildren==MSFalse) aNode.x(hpos); else { ElementTreeCursor saveCursor=treeCursor_; for (treeCursor_.setToFirstExistingChild();treeCursor_.isValid();treeCursor_.setToNextExistingChild()) { childDepth = computeHorizontalPositions(treeCursor_,depth_+1); //compute the maximum child depth depth=childDepth>depth?childDepth:depth; } treeCursor_=saveCursor; treeCursor_.setToFirstExistingChild(); TreeNode& firstChild=nodeAt(treeCursor_); treeCursor_.setToParent(); treeCursor_.setToLastExistingChild(); TreeNode& lastChild=nodeAt(treeCursor_); treeCursor_.setToParent(); int leftPosition=firstChild.x()+(firstChild.width()/2); int rightPosition=lastChild.x()+(lastChild.width()/2); aNode.x(((leftPosition+rightPosition)/2)-(aNode.width()/2)); if (aNode.x()depth)?depth_:depth; } // computeVerticalPositions will compute the positions for each node // when the orientation is Horizontal. The Horizontal position is // purely related to the depth of the node in the tree while the // vertical position depends on the number of children from all nodes // at the same depth template int MSTreeView::computeVerticalPositions(ElementTreeCursor treeCursor_,int depth_) { int offset=margin()+shadowThickness()+highlightThickness(); int depth=0,childDepth=0; int hpos=horizontalPosition(depth_); int vpos=verticalPosition(depth_); TreeNode& aNode=nodeAt(treeCursor_); int width,height; calculateNodeSize(aNode,width,height); aNode.configuration(offset,offset,width,height); horizontalPosition(depth_,(hpos>aNode.width())?hpos:aNode.width()); MSBoolean hasChildren(MSFalse); if (aNode.expandable()==MSTrue&&aNode.expandedState()==MSTrue) { if (elementTree().numberOfSubtreeElements(treeCursor_)>1) hasChildren=MSTrue; } if (hasChildren==MSFalse) aNode.y(vpos); else { ElementTreeCursor saveCursor=treeCursor_; for (treeCursor_.setToFirstExistingChild();treeCursor_.isValid();treeCursor_.setToNextExistingChild()) { childDepth=computeVerticalPositions(treeCursor_,depth_+1); depth=childDepth>depth?childDepth:depth; } treeCursor_=saveCursor; treeCursor_.setToFirstExistingChild(); TreeNode& firstChild=nodeAt(treeCursor_); treeCursor_.setToParent(); treeCursor_.setToLastExistingChild(); TreeNode& lastChild=nodeAt(treeCursor_); treeCursor_.setToParent(); int top=firstChild.y()+(firstChild.height()/2); int bottom=lastChild.y()+(lastChild.height()/2); aNode.y(((top+bottom)/2)-(aNode.height()/2)); if (aNode.y()depth)?depth_:depth; } template MSBoolean MSTreeView::selectNode(ElementTreeCursor& treeCursor_) { if (showRootNode()==MSFalse&&elementTree().isRoot(treeCursor_)==True) return MSFalse; if (selectedCursor().isValid()==True) { ElementTreeCursor cursor=selectedCursor(); selectedCursor().invalidate(); drawNode(cursor,redrawPixmap()->pixmap()); } _selectedCursor=treeCursor_; if (selectedCursor().isValid()==True) { drawNode(selectedCursor(),redrawPixmap()->pixmap()); if (mapped()==MSTrue) redrawViewPort(); return MSTrue; } else { if (mapped()==MSTrue) redrawViewPort(); return MSFalse; } } template void MSTreeView::buttonPress(const XEvent *pEvent_) { if (sensitive()==MSTrue) { if (traverseFocus(this)==MSTrue) { if (editor()->mapped()==MSTrue) { editorActivate(); } if (editor()->mapped()==MSFalse) { int x=pEvent_->xbutton.x,y=pEvent_->xbutton.y; drawAreaXY(x,y); ElementTreeCursor treeCursor=positionToCursor(x,y); if (treeCursor.isValid()) { TreeNode& aNode=nodeAt(treeCursor); if (aNode.x()<=x&& aNode.y()<=y&& aNode.x()+aNode.width()>=x&& aNode.y()+aNode.height()>=y) { MSBoolean labelSelected; MSBoolean buttonSelected; if (showButtons()==MSTrue&&aNode.expandable()==MSTrue) { if (orientation()==Horizontal) { if (x<(aNode.x()+aNode.width()-collapsedButtonPixmap().width()- buttonShadowThickness()*2-buttonNodeMargin())) { labelSelected=MSTrue; buttonSelected=MSFalse; } else { labelSelected=MSFalse; buttonSelected=MSTrue; } } else { if (y<(aNode.y()+aNode.height()-collapsedButtonPixmap().height()- buttonShadowThickness()*2-buttonNodeMargin())) { labelSelected=MSTrue; buttonSelected=MSFalse; } else if (x<(aNode.x()+aNode.width()/2-((collapsedButtonPixmap().width()+buttonShadowThickness()*2)/2))|| x>(aNode.x()+aNode.width()/2+((collapsedButtonPixmap().width()+buttonShadowThickness()*2)/2))) { labelSelected=MSFalse; buttonSelected=MSFalse; } else { labelSelected=MSFalse; buttonSelected=MSTrue; } } } else { labelSelected=MSTrue; buttonSelected=MSFalse; } if (labelSelected==MSTrue&& (showLabels()==MSTrue||showPixmaps()==MSTrue)) { if (isSensitive(&aNode)==MSTrue) { MSBoolean alreadySelected=(selectedCursor().isValid()==True&& selectedCursor()==treeCursor)?MSTrue:MSFalse; // was this a click on the selected node?? // if it is, then if it is a double click we will call // the activate processing method if (pEvent_->xbutton.button==Button1&&alreadySelected==MSTrue) { if (isDoubleClick(pEvent_)==MSTrue) doubleClickNotify(); } else { eventTime(pEvent_->xbutton.time); if (alreadySelected==MSFalse) { selectNode(treeCursor); nodeSelectionNotify(); } if (pEvent_->xbutton.button==Button3&&popupMenu()!=0) { if (selectedCursor().isValid()==True) { popupMenu()->showAtPointer(); } } else if (showLabels()==MSTrue&&pEvent_->xbutton.button==Button2) { if (isNodeProtected(&aNode)==MSFalse) { int pw=0,ph=0; if (showPixmaps()==MSTrue) { calculatePixmapSize(aNode.selectedPixmap(),pw,ph); } if (x>aNode.x()+pw) { MSString string; formatOutput(string,aNode.cursor()); editor()->string(string); mapEditor(); XEvent *pEvent=(XEvent *)pEvent_; pEvent->xbutton.x-=editor()->x_origin(); pEvent->xbutton.y-=editor()->y_origin(); buttonPressNotify(editor(),pEvent); } } } } } } else if (buttonSelected==MSTrue) { _activatedNode=&aNode.cursor(); if (aNode.expandedState()==MSTrue) { aNode.expandedState(MSFalse); collapseSubTree(treeCursor); subTreeCollapsedNotify(); } else { aNode.expandedState(MSTrue); expandSubTree(treeCursor); subTreeExpandedNotify(); } _activatedNode=0; } else backgroundAreaSelection(pEvent_); } } // if we get here, that means we didn't find any node else backgroundAreaSelection(pEvent_); } } } } template void MSTreeView::activate(void) { doubleClickNotify(); } template void MSTreeView::doubleClickNotify(void) { activateCallback(MSWidgetCallback::doubleclick); } template void MSTreeView::nodeSelectionNotify(void) { activateCallback(MSWidgetCallback::selection); } template void MSTreeView::subTreeCollapsedNotify(void) { activateCallback(MSWidgetCallback::subtreecollapsed); } template void MSTreeView::subTreeExpandedNotify(void) { activateCallback(MSWidgetCallback::subtreeexpanded); } template void MSTreeView::backgroundAreaSelection(const XEvent *) {} template void MSTreeView::moveToPreviousNode(void) { if (selectedCursor().isValid()==True && selectedCursor()!=startCursor()) { ElementTreeCursor treeCursor(selectedCursor()); for (treeCursor.setToPreviousExistingChild(); treeCursor.isValid(); treeCursor.setToPreviousExistingChild()) { const TreeNode &node=nodeAt(treeCursor); if (isSensitive(&node)==MSTrue) { if (selectNode(treeCursor)==MSTrue) nodeSelectionNotify(); return; } } treeCursor=selectedCursor(); treeCursor.setToParent(); if (treeCursor.isValid()) { for (treeCursor.setToLastExistingChild(); treeCursor.isValid()&&treeCursor!=selectedCursor(); treeCursor.setToPreviousExistingChild()) { const TreeNode &node=nodeAt(treeCursor); if (isSensitive(&node)==MSTrue) { if (selectNode(treeCursor)==MSTrue) nodeSelectionNotify(); return; } } } } } template void MSTreeView::moveToNextNode(void) { if (selectedCursor().isValid()==True && selectedCursor()!=startCursor()) { ElementTreeCursor treeCursor(selectedCursor()); for (treeCursor.setToNextExistingChild(); treeCursor.isValid(); treeCursor.setToNextExistingChild()) { const TreeNode &node=nodeAt(treeCursor); if (isSensitive(&node)==MSTrue) { if (selectNode(treeCursor)==MSTrue) nodeSelectionNotify(); return; } } treeCursor=selectedCursor(); treeCursor.setToParent(); if (treeCursor.isValid()) { for (treeCursor.setToFirstExistingChild(); treeCursor.isValid()&&treeCursor!=selectedCursor(); treeCursor.setToNextExistingChild()) { const TreeNode &node=nodeAt(treeCursor); if (isSensitive(&node)==MSTrue) { if (selectNode(treeCursor)==MSTrue) nodeSelectionNotify(); return; } } } } } template void MSTreeView::moveToParentNode(void) { if (selectedCursor().isValid()==True) { ElementTreeCursor treeCursor(selectedCursor()); while (treeCursor!=startCursor() && treeCursor.setToParent()==True) { const TreeNode &treeNode=nodeAt(treeCursor); if (isSensitive(&treeNode)==MSTrue) { if (selectNode(treeCursor)==MSTrue) nodeSelectionNotify(); break; } } } } template void MSTreeView::moveToChildNode(void) { //This algorithm only moves selection to the first sensitive child node. //If all the children of current selected node are insensitive, no search is //done to check the next level. if (selectedCursor().isValid()==True) { TreeNode &aNode=nodeAt(selectedCursor()); if (aNode.expandable()==MSTrue&&aNode.expandedState()==MSTrue) { ElementTreeCursor treeCursor(selectedCursor()); for (treeCursor.setToFirstExistingChild(); treeCursor.isValid(); treeCursor.setToNextExistingChild()) { const TreeNode &node=nodeAt(treeCursor); if (isSensitive(&node)==MSTrue) { if (selectNode(treeCursor)==MSTrue) nodeSelectionNotify(); return; } } } } } template void MSTreeView::up(void) { if (orientation()==Horizontal) moveToPreviousNode(); else moveToParentNode(); } template void MSTreeView::down(void) { if (orientation()==Horizontal) moveToNextNode(); else moveToChildNode(); } template void MSTreeView::left(void) { if (orientation()==Horizontal) moveToParentNode(); else moveToPreviousNode(); } template void MSTreeView::right(void) { if (orientation()==Horizontal) moveToChildNode(); else moveToNextNode(); } template void MSTreeView::keyPress(const XEvent *pEvent_,KeySym keysym_,unsigned int state_,const char *pString_) { MSKeyPress keyPress(keysym_, state_); if (selectedCursor().isValid()==True&&keyTranslate(keyPress)==MSFalse) { if (editor()->mapped()==MSTrue) keyPressNotify(editor(),pEvent_,keysym_,state_,pString_); else if (selectedCursor().isValid()==True&&elementTree().isEmpty()==False) { switch (keysym_) { case XK_Up: up(); break; case XK_Down: down(); break; case XK_Right: right(); break; case XK_Left: left(); break; case XK_Return: activate(); break; default: { TreeNode& aNode=nodeAt(selectedCursor()); if (isNodeProtected(&aNode)==MSFalse) { if (keysym_==XK_BackSpace) { editor()->string(""); mapEditor(); } else if (keysym_==XK_Insert) { MSString string; formatOutput(string,aNode.cursor()); editor()->string(string); editor()->editMode(MSTextField::InsertMode); mapEditor(); } else if (strlen(pString_)>0) { editor()->string(""); keyPressNotify(editor(),pEvent_,keysym_,state_,pString_); if (editor()->length()>0) mapEditor(); } } break; } } } } } template MSBoolean MSTreeView::loseFocus(void) { if (editor()->mapped()==MSTrue) editorActivate(); if (editor()->mapped()==MSTrue) return MSFalse; else { unHighlight(); return MSTrue; } } template void MSTreeView::updateBackground(unsigned long oldBg_) { MSScrollableWidget::updateBackground(oldBg_); if (nodeBackground()==oldBg_) { nodeBackground(background()); } else redrawViewPortImmediately(); } template void MSTreeView::updateForeground(unsigned long oldFg_) { MSScrollableWidget::updateForeground(oldFg_); if (nodeForeground()==oldFg_) { nodeForeground(foreground()); } else redrawViewPortImmediately(); } template void MSTreeView::updateFont(Font oldfid_) { MSScrollableWidget::updateFont(oldfid_); XSetFont(display(),textGC(),font()); fontObject().fontStruct(server()->fontStruct(font())); editor()->font(font()); adjustSize(); } template void MSTreeView::receiveEvent(MSEvent &event_) { if (event_.type()==TreeEvent::symbol()) { TreeEvent &treeEvent=(TreeEvent &)event_; switch (treeEvent.treeEventType()) { case MSObservableTreeInsert: case MSObservableTreeReplace: processReshapeEvent(treeEvent); break; case MSObservableTreeDelete: processDeleteEvent(treeEvent); break; case MSObservableTreeCopy: processCopyEvent(treeEvent); break; case MSObservableTreeAssign: processAssignEvent(treeEvent); break; case MSObservableTreePermute: processPermuteEvent(treeEvent); break; } } else if (event_.type()==MSNullEvent::symbol()) { updateData(); } } template void MSTreeView::processReshapeEvent(TreeEvent &treeEvent_) { if (elementTree().isEmpty()==False) { TreeModelCursor modelCursor(treeEvent_.cursor()); unsigned long pos=treeEvent_.position(); MSBoolean rebuild=MSFalse; ElementTreeCursor elementCursor=findElementCursor(modelCursor); if (elementCursor.isValid()) { TreeNode &node=elementTree().elementAt(elementCursor); modelTree().setToChild(pos,modelCursor); NodeAttribute nodeAttr; nodeAttribute(modelCursor,nodeAttr); TreeNode newNode(this,modelCursor,nodeAttr); if (treeEvent_.treeEventType()==MSObservableTreeReplace) { ElementTreeCursor replaceCursor(elementCursor); replaceCursor.setToChild(pos); elementTree().removeSubtree(replaceCursor); } elementTree().addAsChild(elementCursor,pos,newNode); elementTree().setToChild(pos,elementCursor); if (modelTree().isLeaf(modelCursor)==False) { updateElementTree(modelCursor,elementCursor); } nodeAttr=node.attribute(); nodeModified(node.cursor(),nodeAttr); node.attribute(this,nodeAttr); if (node.expandable()==MSTrue&&node.expandedState()==MSTrue) rebuild=MSTrue; } if (rebuild==MSTrue&&frozen()==MSFalse) { adjustSize(); } } } template void MSTreeView::processPermuteEvent(TreeEvent &treeEvent_) { if (elementTree().isEmpty()==False) { TreeModelCursor modelCursor(treeEvent_.cursor()); const MSIndexVector& index=treeEvent_.index(); ElementTreeCursor elementCursor=findElementCursor(modelCursor); if (elementCursor.isValid()) { TreeNode &node=elementTree().elementAt(elementCursor); elementTree().permuteChildren(elementCursor,index); } if (frozen()==MSFalse) { adjustSize(); } } } template void MSTreeView::processDeleteEvent(TreeEvent &treeEvent_) { if (elementTree().isEmpty()==False) { ElementTreeCursor deleteCursor(elementTree()); ElementTreeCursor elementCursor=findElementCursor(treeEvent_.cursor()); if (elementCursor.isValid()) { TreeNode &nodeInfo=elementTree().elementAt(elementCursor); deleteCursor=elementCursor; elementCursor.setToChild(treeEvent_.position()); if (selectedCursor().isValid()&&locateTreeCursor(selectedCursor(),elementCursor)==MSTrue) { selectedCursor().invalidate(); } if (startCursor().isValid()&&locateTreeCursor(startCursor(),elementCursor)==MSTrue) { startCursor().invalidate(); } elementTree().removeSubtree(elementCursor); NodeAttribute nodeAttr(nodeInfo.attribute()); NodeAttribute before(nodeAttr); nodeModified(nodeInfo.cursor(),nodeAttr); nodeInfo.attribute(this,nodeAttr); if (before==nodeAttr) { MSBoolean shown=MSTrue; while (deleteCursor.isValid()) { const TreeNode node=elementTree().elementAt(deleteCursor); if (node.expandable()==MSFalse||node.expandedState()==MSFalse) { shown=MSFalse; break; } deleteCursor.setToParent(); } if (shown==MSTrue) adjustSize(); } else adjustSize(); } } } template void MSTreeView::processCopyEvent(TreeEvent &) { updateData(); } template void MSTreeView::processAssignEvent(TreeEvent &) { adjustSize(); } template void MSTreeView::updateData(void) { if (firstMap()==MSTrue) { elementTree().removeAll(); _selectedCursor.invalidate(); _startCursor.invalidate(); rebuildScreen(); adjustSize(); } } template void MSTreeView::model(TreeModel &model_) { couple(&model_); } template void MSTreeView::model(const TreeModel &model_) { constCouple(&model_); } template void MSTreeView::selectedNode(const TreeModelCursor &modelCursor_) { ElementTreeCursor treeCursor=findElementCursor(modelCursor_); if(treeCursor.isValid()) { TreeNode& aNode=nodeAt(treeCursor); ElementTreeCursor tc(treeCursor); MSBoolean resizeNeeded=MSFalse; while (elementTree().setToParent(tc)) { TreeNode& parentNode=nodeAt(tc); if (parentNode.expandedState()==MSFalse) { parentNode.expandedState(MSTrue); resizeNeeded=MSTrue; } } if (resizeNeeded==MSTrue) { adjustSize(); selectNode(treeCursor); } else if (firstMap()==MSTrue) selectNode(treeCursor); } } template typename MSTreeView::TreeModelCursor MSTreeView::selectedNode(void) const { if (selectedCursor().isValid()) return elementTree().elementAt(selectedCursor()).cursor(); else return TreeModelCursor(TreeModel()); } template void MSTreeView::expandedState(const TreeModelCursor &modelCursor_,MSBoolean expandedState_) { if (elementTree().isEmpty()==True) rebuildScreen(); ElementTreeCursor treeCursor=findElementCursor(modelCursor_); if(treeCursor.isValid()) { TreeNode& aNode=nodeAt(treeCursor); if (aNode.expandedState()!=expandedState_) { aNode.expandedState(expandedState_); if (aNode.expandable()==MSTrue) { if (expandedState_==MSFalse) collapseSubTree(treeCursor); else expandSubTree(treeCursor); } } } } template MSBoolean MSTreeView::expandedState(const TreeModelCursor &modelCursor_) const { // load the element tree if it hasn't been loaded. But since rebuildScreen // is not a const method, we need to cast away the const-ness. This is a work around // in order to preserve the const-ness of this method. if (elementTree().isEmpty()==True) { MSTreeView *myself=(MSTreeView *)this; myself->rebuildScreen(); } ElementTreeCursor treeCursor=findElementCursor(modelCursor_); if(treeCursor.isValid()) { const TreeNode& aNode=nodeAt(treeCursor); return aNode.expandedState(); } return MSFalse; } template void MSTreeView::expandable(const TreeModelCursor &modelCursor_,MSBoolean expandable_) { if (elementTree().isEmpty()==True) rebuildScreen(); ElementTreeCursor treeCursor=findElementCursor(modelCursor_); if(treeCursor.isValid()) { TreeNode& aNode=nodeAt(treeCursor); if (aNode.expandable()!=expandable_) { aNode.expandable(expandable_); if (aNode.expandable()==MSFalse&&elementTree().isLeaf(treeCursor)==False) { collapseSubTree(treeCursor); } else adjustSize(); } } } template MSBoolean MSTreeView::expandable(const TreeModelCursor &modelCursor_) const { // load the element tree if it hasn't been loaded. But since rebuildScreen // is not a const method, we need to cast away the const-ness. This is a work around // in order to preserve the const-ness of this method. if (elementTree().isEmpty()==True) { MSTreeView *myself=(MSTreeView *)this; myself->rebuildScreen(); } ElementTreeCursor treeCursor=findElementCursor(modelCursor_); if(treeCursor.isValid()) { const TreeNode& aNode=nodeAt(treeCursor); return aNode.expandable(); } return MSFalse; } template void MSTreeView::makeVisible(const TreeModelCursor &modelCursor_) { if (elementTree().isEmpty()==True) rebuildScreen(); ElementTreeCursor treeCursor=findElementCursor(modelCursor_); if(treeCursor.isValid()) { TreeNode& aNode=nodeAt(treeCursor); MSBoolean redrawNeeded=MSFalse; while (elementTree().setToParent(treeCursor)) { TreeNode& parentNode=nodeAt(treeCursor); if (parentNode.expandedState()==MSFalse) { parentNode.expandedState(MSTrue); redrawNeeded=MSTrue; } } if (redrawNeeded==MSTrue) adjustSize(); } } template MSBoolean MSTreeView::isVisible(const TreeModelCursor &modelCursor_) const { // load the element tree if it hasn't been loaded. But since rebuildScreen // is not a const method, we need to cast away the const-ness. This is a work around // in order to preserve the const-ness of this method. if (elementTree().isEmpty()==True) { MSTreeView *myself=(MSTreeView *)this; myself->rebuildScreen(); } ElementTreeCursor treeCursor=findElementCursor(modelCursor_); if(treeCursor.isValid()) { const TreeNode& aNode=nodeAt(treeCursor); MSBoolean visible=MSTrue; while (elementTree().setToParent(treeCursor)) { const TreeNode& parentNode=nodeAt(treeCursor); if (parentNode.expandedState()==MSFalse||parentNode.expandable()==MSFalse) { visible=MSFalse; break; } } return visible; } return MSFalse; } template void MSTreeView::rebuildScreen(Iterator *iterator_) { if (hasModel()==MSTrue&&elementTree().isEmpty()==True) { TreeModelCursor modelCursor(modelTree()); modelCursor.setToRoot(); if (modelCursor.isValid()) { NodeAttribute attr; if (iterator_==0) nodeAttribute(modelCursor,attr); else iterator_->nodeAttribute(modelCursor,attr); elementTree().addAsRoot(TreeNode(this,modelCursor,attr)); ElementTreeCursor elementCursor(elementTree()); elementCursor.setToRoot(); updateElementTree(modelCursor,elementCursor,iterator_); } } } template void MSTreeView::updateElementTree(TreeModelCursor modelCursor_,ElementTreeCursor &elementCursor_,Iterator *iterator_) { if (elementCursor_.isValid()) { for (modelCursor_.setToFirstExistingChild();modelCursor_.isValid();modelCursor_.setToNextExistingChild()) { NodeAttribute attr; if (iterator_==0) nodeAttribute(modelCursor_,attr); else iterator_->nodeAttribute(modelCursor_,attr); unsigned long pos=modelTree().position(modelCursor_); elementTree().addAsChild(elementCursor_,pos,TreeNode(this,modelCursor_,attr)); ElementTreeCursor newElementCursor(elementCursor_); elementTree().setToChild(pos,newElementCursor); updateElementTree(modelCursor_,newElementCursor,iterator_); } } } template void MSTreeView::showButtons(MSBoolean showButtons_) { if (_showButtons!=showButtons_) { _showButtons=showButtons_; adjustSize(); } } template void MSTreeView::showLabels(MSBoolean showLabels_) { if (_showLabels!=showLabels_) { _showLabels=showLabels_; adjustSize(); } } template void MSTreeView::showPixmaps(MSBoolean showPixmaps_) { if (_showPixmaps!=showPixmaps_) { _showPixmaps=showPixmaps_; adjustSize(); } } template void MSTreeView::showRootNode(MSBoolean showRootNode_) { if (_showRootNode!=showRootNode_) { _showRootNode=showRootNode_; adjustSize(); } } template void MSTreeView::buttonShadowThickness(int buttonShadowThickness_) { if (_buttonShadowThickness!=buttonShadowThickness_) { _buttonShadowThickness=buttonShadowThickness_; adjustSize(); } } template void MSTreeView::collapsedButtonPixmap(const MSPixmap &collapsedButtonPixmap_) { if (_collapsedButtonPixmap!=0) delete _collapsedButtonPixmap; _collapsedButtonPixmap=new MSPixmap(collapsedButtonPixmap_); adjustSize(); } template void MSTreeView::expandedButtonPixmap(const MSPixmap &expandedButtonPixmap_) { if (_expandedButtonPixmap!=0) delete _expandedButtonPixmap; _expandedButtonPixmap=new MSPixmap(expandedButtonPixmap_); adjustSize(); } template void MSTreeView::set(MSAttrValueList& avList_) { MSScrollableWidget::set(avList_); MSIndexVector index; for (unsigned i=0;i MSAttrValueList& MSTreeView::get(MSAttrValueList& avList_) { avList_<colorName(lineForeground()),MSAttrValue::Color); avList_<colorName(nodeForeground()),MSAttrValue::Color); avList_<colorName(nodeBackground()),MSAttrValue::Color); avList_<colorName(selectedNodeForeground()),MSAttrValue::Color); avList_<colorName(selectedNodeBackground()),MSAttrValue::Color); avList_< void MSTreeView::print(const char *file_) { MSBoolean fileOpen=MSFalse; MSBoolean open=MSTrue; if (outputMode()==Draw) { if (file_!=0) displayPrintFileName(file_); if ((open=displayPrintOpen(this))==MSTrue) { fileOpen=MSTrue; outputMode(Print); displayPrintXorigin(0); displayPrintYorigin(0); } } if (open==MSTrue) { displayPrintOriginInc(drawAreaWidget()); redrawDrawAreaImmediately(); redrawViewPortImmediately(); displayPrintOriginDec(drawAreaWidget()); redrawScrollableWidgetImmediately(); if (vsb()->mapped()) { displayPrintOriginInc(vsb()); vsb()->redraw(); displayPrintOriginDec(vsb()); } if (hsb()->mapped()) { displayPrintOriginInc(hsb()); hsb()->redraw(); displayPrintOriginDec(hsb()); } if (fileOpen==MSTrue) { displayPrintClose(); outputMode(Draw); } } } template void MSTreeView::unfreeze(void) { MSScrollableWidget::unfreeze(); adjustSize(); } template void MSTreeView::show(void) { if (mapped()==MSFalse) { viewPort()->show(); map(); } } template void MSTreeView::focusIn(void) { highlight(); if (editor()->mapped()==MSTrue) takeFocusNotify(editor()); } template void MSTreeView::focusOut(void) { unHighlight(); if (editor()->mapped()==MSTrue) loseFocusNotify(editor()); } template typename MSTreeView::ElementTreeCursor MSTreeView::positionToCursor(int x_,int y_) { ElementTreeCursor elementCursor(elementTree()); if(_startCursor.isValid()) elementCursor=_startCursor; else elementCursor.setToRoot(); if (elementCursor.isValid()==True) { TreeNode& aNode=nodeAt(elementCursor); if (showRootNode()==MSTrue) { if (aNode.x()<=x_&& aNode.y()<=y_&& aNode.x()+aNode.width()>=x_&& aNode.y()+aNode.height()>=y_) { return elementCursor; } } if (aNode.expandable()==MSTrue&&aNode.expandedState()==MSTrue) { for (elementCursor.setToFirstExistingChild();elementCursor.isValid();elementCursor.setToNextExistingChild()) { ElementTreeCursor cursor(elementCursor); if (positionToCursor(cursor,x_,y_)==MSTrue) return cursor; } } } elementCursor.invalidate(); return elementCursor; } template MSBoolean MSTreeView::positionToCursor(ElementTreeCursor &cursor_,int x_,int y_) { if (cursor_.isValid()==True) { TreeNode& aNode=nodeAt(cursor_); if (aNode.x()<=x_&& aNode.y()<=y_&& aNode.x()+aNode.width()>=x_&& aNode.y()+aNode.height()>=y_) { return MSTrue; } else if (aNode.expandable()==MSTrue&&aNode.expandedState()==MSTrue) { ElementTreeCursor elementCursor(cursor_); for (elementCursor.setToFirstExistingChild();elementCursor.isValid();elementCursor.setToNextExistingChild()) { ElementTreeCursor cursor(elementCursor); if (positionToCursor(cursor,x_,y_)==MSTrue) { cursor_=cursor; return MSTrue; } } } } return MSFalse; } template void MSTreeView::collapseSubTree(ElementTreeCursor &cursor_) { if (elementTree().isLeaf(cursor_)==False) { if (selectedCursor().isValid()==True) { for (cursor_.setToFirstExistingChild();cursor_.isValid();cursor_.setToNextExistingChild()) { if (locateTreeCursor(selectedCursor(),cursor_)==MSTrue) { selectedCursor().invalidate(); } } } adjustSize(); } else { if (firstMap()==MSTrue&&frozen()==MSFalse) { drawNode(cursor_,redrawPixmap()->pixmap()); redrawViewPort(); } } } template void MSTreeView::expandSubTree(ElementTreeCursor &cursor_) { if (elementTree().isLeaf(cursor_)==False) adjustSize(); else { if (firstMap()==MSTrue&&frozen()==MSFalse) { drawNode(cursor_,redrawPixmap()->pixmap()); redrawViewPort(); } } } template MSBoolean MSTreeView::locateTreeCursor(ElementTreeCursor locateCursor_, ElementTreeCursor cursor_) { if (locateCursor_==cursor_) return MSTrue; else { TreeNode &aNode=nodeAt(cursor_); if (aNode.expandable()==MSTrue&&aNode.expandedState()==MSTrue) { for (cursor_.setToFirstExistingChild();cursor_.isValid();cursor_.setToNextExistingChild()) { if (locateTreeCursor(locateCursor_,cursor_)==MSTrue) return MSTrue; } } else return MSFalse; } return MSFalse; } template typename MSTreeView::TreeModelCursor MSTreeView::activatedNode(void) const { if (hasModel()==MSTrue) { if (_activatedNode==0) return TreeModelCursor(modelTree()); else return *_activatedNode; } else return TreeModelCursor(TreeModel()); } template void MSTreeView::getNodeAttributes(MSTreeView::ConstIterator &iterator_) const { // load the element tree if it hasn't been loaded. But since rebuildScreen // is not a const method, we need to cast away the const-ness. This is a work around // in order to preserve the const-ness of this method. if (elementTree().isEmpty()==True) { MSTreeView *myself=(MSTreeView *)this; myself->rebuildScreen(); } NodeAttribute attr; ElementTreeCursor elementCursor(elementTree()); for (elementTree().setToFirst(elementCursor,MSPreorder); elementCursor.isValid(); elementTree().setToNext(elementCursor,MSPreorder)) { const TreeNode &node=elementTree().elementAt(elementCursor); attr=node.attribute(); iterator_.nodeAttribute(node.cursor(),attr); } } template void MSTreeView::setNodeAttributes(MSTreeView::Iterator &iterator_) { if (hasModel()==MSTrue) { if (elementTree().isEmpty()==True) rebuildScreen(&iterator_); else { NodeAttribute attr; ElementTreeCursor elementCursor(elementTree()); for (elementTree().setToFirst(elementCursor,MSPreorder); elementCursor.isValid(); elementTree().setToNext(elementCursor,MSPreorder)) { TreeNode &node=elementTree().elementAt(elementCursor); attr=node.attribute(); iterator_.nodeAttribute(node.cursor(),attr); node.attribute(this,attr); } } adjustSize(); } } template void MSTreeView::registerPixmap(const MSPixmap &pixmap_) { pixmapRegistry().addOrReplaceElementWithKey(pixmap_); } template const MSPixmap *MSTreeView::pixmap(const MSString &key_) const { PixmapRegistryCursor cursor(_pixmapRegistry); _pixmapRegistry.locateElementWithKey(key_,cursor); if (cursor.isValid()) return &_pixmapRegistry.elementAt(cursor); else return 0; } template MSBoolean MSTreeView::isSensitive(const TreeNode *treeNode_) { return treeNode_->sensitive(); } template MSBoolean MSTreeView::isExpandable(const TreeNode *treeNode_) { return treeNode_->expandable(); } template MSBoolean MSTreeView::isExpanded(const TreeNode *treeNode_) { if (treeNode_->expandable()==MSFalse) return MSFalse; else return treeNode_->expandedState(); } template const typename MSTreeView::PixmapList &MSTreeView::pixmap(const TreeNode *treeNode_) { return treeNode_->pixmap(); } template const typename MSTreeView::PixmapList &MSTreeView::selectedPixmap(const TreeNode *treeNode_) { return treeNode_->selectedPixmap(); } template const typename MSTreeView::PixmapList &MSTreeView::insensitivePixmap(const TreeNode *treeNode_) { return treeNode_->insensitivePixmap(); } template unsigned long MSTreeView::nodeForegroundColor(const TreeNode *treeNode_) { if (selectedCursor().isValid()&&treeNode_==&nodeAt(selectedCursor())) return selectedNodeForeground(); else return nodeForeground(); } template unsigned long MSTreeView::nodeBackgroundColor(const TreeNode *treeNode_) { if (selectedCursor().isValid()&&treeNode_==&nodeAt(selectedCursor())) return selectedNodeBackground(); else return nodeBackground(); } template unsigned long MSTreeView::lineForegroundColor(const TreeNode * /*treeNode_*/) { return lineForeground();} template void MSTreeView::calculateNodeSize(TreeNode &treeNode_,int &width_,int &height_) { int pixmapWidth=0,pixmapHeight=0; if (showPixmaps()==MSTrue) { // Calculate the maximum pixmap width and height int pw=0,ph=0; calculatePixmapSize(pixmap(&treeNode_),pw,ph); pixmapHeight=(ph>pixmapHeight)?ph:pixmapHeight; pixmapWidth=(pw>pixmapWidth)?pw:pixmapWidth; calculatePixmapSize(insensitivePixmap(&treeNode_),pw,ph); pixmapHeight=(ph>pixmapHeight)?ph:pixmapHeight; pixmapWidth=(pw>pixmapWidth)?pw:pixmapWidth; calculatePixmapSize(selectedPixmap(&treeNode_),pw,ph); pixmapHeight=(ph>pixmapHeight)?ph:pixmapHeight; pixmapWidth=(pw>pixmapWidth)?pw:pixmapWidth; } width_=pixmapWidth; height_=pixmapHeight; if (showLabels()==MSTrue) { MSString string; formatOutput(string,treeNode_.cursor()); width_+=(width_>0?buttonNodeMargin():0); width_+=(fontObject().textWidth(string)+nodeMargin()); height_=fontObject().textHeight()+nodeMargin(); height_=(height_>pixmapHeight)?height_:pixmapHeight; } if (showButtons()==MSTrue&&treeNode_.expandable()==MSTrue) { int margin=buttonShadowThickness()*2; if (orientation()==Vertical) { height_+=(height_>0?buttonNodeMargin():0); height_+=collapsedButtonPixmap().height()+margin; int bw=collapsedButtonPixmap().width()+margin; width_=(width_>bw)?width_:bw; } else { width_+=(width_>0?buttonNodeMargin():0); width_+=collapsedButtonPixmap().width()+margin; int bh=collapsedButtonPixmap().height()+margin; height_=(height_>bh)?height_:bh; } } } template void MSTreeView::calculatePixmapSize(const PixmapList &pixmapList_,int &w_,int &h_) { w_=h_=0; unsigned long nElements=pixmapList_.length(); for (unsigned long i=0;ih_)?pHeight:h_; } } template void MSTreeView::sensitive(const TreeModelCursor &modelCursor_,MSBoolean sensitive_) { if (elementTree().isEmpty()==True) rebuildScreen(); ElementTreeCursor treeCursor=findElementCursor(modelCursor_); if(treeCursor.isValid()) { TreeNode& aNode=nodeAt(treeCursor); if (aNode.sensitive()!=sensitive_) { aNode.sensitive(sensitive_); drawNode(treeCursor,redrawPixmap()->pixmap()); if (mapped()==MSTrue) redrawViewPort(); } } } template MSBoolean MSTreeView::sensitive(const TreeModelCursor &modelCursor_) const { // load the element tree if it hasn't been loaded. But since rebuildScreen // is not a const method, we need to cast away the const-ness. This is a work around // in order to preserve the const-ness of this method. if (elementTree().isEmpty()==True) { MSTreeView *myself=(MSTreeView *)this; myself->rebuildScreen(); } ElementTreeCursor treeCursor=findElementCursor(modelCursor_); if(treeCursor.isValid()) { const TreeNode& aNode=nodeAt(treeCursor); return aNode.sensitive(); } return MSFalse; } template void MSTreeView::pixmap(const TreeModelCursor &modelCursor_,const MSStringVector &pixmap_) { if (elementTree().isEmpty()==True) rebuildScreen(); ElementTreeCursor treeCursor=findElementCursor(modelCursor_); if(treeCursor.isValid()) { TreeNode& aNode=nodeAt(treeCursor); aNode.buildPixmapList(pixmapRegistry(),aNode.pixmap(),pixmap_); adjustSize(); } } template MSStringVector MSTreeView::pixmap(const TreeModelCursor &modelCursor_) const { MSStringVector names; // load the element tree if it hasn't been loaded. But since rebuildScreen // is not a const method, we need to cast away the const-ness. This is a work around // in order to preserve the const-ness of this method. if (elementTree().isEmpty()==True) { MSTreeView *myself=(MSTreeView *)this; myself->rebuildScreen(); } ElementTreeCursor treeCursor=findElementCursor(modelCursor_); if(treeCursor.isValid()) { const TreeNode& aNode=nodeAt(treeCursor); unsigned long nElements=aNode.pixmap().length(); for (unsigned long i=0;i void MSTreeView::insensitivePixmap(const TreeModelCursor &modelCursor_,const MSStringVector &insensitivePixmap_) { if (elementTree().isEmpty()==True) rebuildScreen(); ElementTreeCursor treeCursor=findElementCursor(modelCursor_); if(treeCursor.isValid()) { TreeNode& aNode=nodeAt(treeCursor); aNode.buildPixmapList(pixmapRegistry(),aNode.insensitivePixmap(),insensitivePixmap_); adjustSize(); } } template MSStringVector MSTreeView::insensitivePixmap(const TreeModelCursor &modelCursor_) const { MSStringVector names; // load the element tree if it hasn't been loaded. But since rebuildScreen // is not a const method, we need to cast away the const-ness. This is a work around // in order to preserve the const-ness of this method. if (elementTree().isEmpty()==True) { MSTreeView *myself=(MSTreeView *)this; myself->rebuildScreen(); } ElementTreeCursor treeCursor=findElementCursor(modelCursor_); if(treeCursor.isValid()) { const TreeNode& aNode=nodeAt(treeCursor); unsigned long nElements=aNode.insensitivePixmap().length(); for (unsigned long i=0;i void MSTreeView::selectedPixmap(const TreeModelCursor &modelCursor_,const MSStringVector &selectedPixmap_) { if (elementTree().isEmpty()==True) rebuildScreen(); ElementTreeCursor treeCursor=findElementCursor(modelCursor_); if(treeCursor.isValid()) { TreeNode& aNode=nodeAt(treeCursor); aNode.buildPixmapList(pixmapRegistry(),aNode.selectedPixmap(),selectedPixmap_); adjustSize(); } } template MSStringVector MSTreeView::selectedPixmap(const TreeModelCursor &modelCursor_) const { MSStringVector names; // load the element tree if it hasn't been loaded. But since rebuildScreen // is not a const method, we need to cast away the const-ness. This is a work around // in order to preserve the const-ness of this method. if (elementTree().isEmpty()==True) { MSTreeView *myself=(MSTreeView *)this; myself->rebuildScreen(); } ElementTreeCursor treeCursor=findElementCursor(modelCursor_); if(treeCursor.isValid()) { const TreeNode& aNode=nodeAt(treeCursor); unsigned long nElements=aNode.selectedPixmap().length(); for (unsigned long i=0;i MSBoolean MSTreeView::sensitive(void) const { return MSScrollableWidget::sensitive(); } template void MSTreeView::sensitive(MSBoolean sensitive_) { MSScrollableWidget::sensitive(sensitive_); } template class MSTreeViewDefaultIterator : public MSTreeView::Iterator { protected: typename MSTreeView::TreeModel &_treeModel; public: MSTreeViewDefaultIterator(typename MSTreeView::TreeModel &treeModel_) :_treeModel(treeModel_) {} virtual void nodeAttribute(const typename MSTreeView::TreeModelCursor&, typename MSTreeView::NodeAttribute &); }; template void MSTreeViewDefaultIterator::nodeAttribute(const typename MSTreeView::TreeModelCursor &cursor_, typename MSTreeView::NodeAttribute &nodeAttr_) { if (_treeModel.isLeaf(cursor_)) { nodeAttr_.expandable(MSFalse); nodeAttr_.expandedState(MSFalse); } else { nodeAttr_.expandable(MSTrue); nodeAttr_.expandedState(MSTrue); } } template void MSTreeView::setDefaultNodeAttributes(void) { if (hasModel()==MSTrue) { MSTreeViewDefaultIterator iterator(modelTree()); setNodeAttributes(iterator); } } template MSBoolean MSTreeView::isNodeProtected(const TreeNode *) { return isProtected();} template typename MSTreeView::TreeModelCursor MSTreeView::startNode(void) const { if (startCursor().isValid()) return elementTree().elementAt(startCursor()).cursor(); else return TreeModelCursor(TreeModel()); } template void MSTreeView::startNode(const TreeModelCursor & modelCursor_) { ElementTreeCursor treeCursor=findElementCursor(modelCursor_); if(treeCursor.isValid()) { TreeNode& aNode=nodeAt(treeCursor); ElementTreeCursor tc(treeCursor); while (elementTree().setToParent(tc)) { TreeNode& parentNode=nodeAt(tc); if (parentNode.expandedState()==MSFalse) { parentNode.expandedState(MSTrue); } } _startCursor=treeCursor; if(locateTreeCursor(selectedCursor(),_startCursor)==MSFalse) { _selectedCursor.invalidate(); } adjustSize(); } } template MSBoolean MSTreeView::editing(void) const { return _pEditor->mapped(); } template void MSTreeView::edit(void) { if (editor()->mapped()==MSFalse) { TreeNode& aNode=nodeAt(selectedCursor()); if (isNodeProtected(&aNode)==MSFalse) { MSString string; formatOutput(string,aNode.cursor()); editor()->string(string); // editor()->selectAll(); mapEditor(); } } } template typename MSTreeView::ElementTreeCursor MSTreeView::findElementCursor(const TreeModelCursor& modelCursor_) const { ElementTreeCursor elementCursor(elementTree()); for (elementTree().setToFirst(elementCursor,MSPreorder); elementCursor.isValid(); elementTree().setToNext(elementCursor,MSPreorder)) { if(elementCursor.element().cursor()==modelCursor_) break; } return elementCursor; } template typename MSTreeView::TreeModel& MSTreeView::modelTree(void) { return *(TreeModel *)_model; } template const typename MSTreeView::TreeModel& MSTreeView::modelTree(void) const { return *(TreeModel *)_model; } template unsigned long MSTreeView::addEditorKeyCallback( const char* pString_,MSKeyCallback* keyCallback_) { return editor()->addKeyCallback(pString_,keyCallback_);} template void MSTreeView::removeEditorKeyCallback(unsigned long id_) { editor()->removeKeyCallback(id_); } template void MSTreeView::removeEditorKeyCallback(const char* pString_) { editor()->removeKeyCallback(pString_); } #endif aplus-fsf-4.22/src/MSGUI/MSTableColumnInlines.C0000644000265000001440000002060010772770436014577 #ifndef MSTableColumnINLINES #define MSTableColumnINLINES /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MS_NO_INLINES #define INLINELINKAGE inline #else #define INLINELINKAGE #endif // These used to be MSBaseTableColumn's inlines INLINELINKAGE MSReportTable *MSTableColumn::reportTable(void) const {return _reportTable;} INLINELINKAGE const MSSymbol& MSTableColumn::tag(void) const {return _tag;} INLINELINKAGE unsigned MSTableColumn::column(void) const {return _column;} INLINELINKAGE double MSTableColumn::fgGrayScale(void) const {return _fgGrayScale;} INLINELINKAGE double MSTableColumn::bgGrayScale(void) const {return _bgGrayScale;} INLINELINKAGE const MSString& MSTableColumn::breakFgString(void) const {return _breakFgString;} INLINELINKAGE const MSString& MSTableColumn::breakBgString(void) const {return _breakBgString;} INLINELINKAGE unsigned long MSTableColumn::breakFgPixel(void) const {return _breakFgPixel;} INLINELINKAGE unsigned long MSTableColumn::breakBgPixel(void) const {return _breakBgPixel;} INLINELINKAGE const MSStringVector& MSTableColumn::breakString(void) const {return _breakString;} INLINELINKAGE MSStringVector& MSTableColumn::breakString(void) {return _breakString;} INLINELINKAGE const MSIndexVector& MSTableColumn::breakIndex(void) const {return _breakIndex;} INLINELINKAGE const MSIndexVector& MSTableColumn::breakInvalid(void) const {return _breakInvalid;} INLINELINKAGE MSBoolean MSTableColumn::suppressDuplicate(void) const {return _suppressDuplicate;} INLINELINKAGE MSBoolean MSTableColumn::breakOn(void) const {return _breakOn;} INLINELINKAGE MSBoolean MSTableColumn::pageBreakOn(void) const {return _pageBreakOn;} INLINELINKAGE MSBoolean MSTableColumn::breakProcessOn(void) const {return _breakProcessOn;} INLINELINKAGE int MSTableColumn::breakOffset(void) const {return _breakOffset;} INLINELINKAGE int MSTableColumn::breakLeading(void) const {return _breakLeading;} INLINELINKAGE double MSTableColumn::headingFgGrayScale(void) const {return _headingFgGrayScale;} INLINELINKAGE double MSTableColumn::headingBgGrayScale(void) const {return _headingBgGrayScale;} INLINELINKAGE double MSTableColumn::breakFgGrayScale(void) const {return _breakFgGrayScale;} INLINELINKAGE double MSTableColumn::breakBgGrayScale(void) const {return _breakBgGrayScale;} INLINELINKAGE MSP::BreakProcessMode MSTableColumn::breakProcessMode(void) const {return _breakProcessMode;} INLINELINKAGE void MSTableColumn::tag(const MSSymbol& x_) {_tag=x_;} INLINELINKAGE void MSTableColumn::fgGrayScale(double x_) {_fgGrayScale=x_<0?0:x_>1?1:x_;} INLINELINKAGE void MSTableColumn::bgGrayScale(double x_) {_bgGrayScale=x_<0?0:x_>1?1:x_;} INLINELINKAGE void MSTableColumn::breakFgGrayScale(double x_) {_breakFgGrayScale=x_<0?0:x_>1?1:x_;} INLINELINKAGE void MSTableColumn::breakBgGrayScale(double x_) {_breakBgGrayScale=x_<0?0:x_>1?1:x_;} INLINELINKAGE void MSTableColumn::headingFgGrayScale(double x_) {_headingFgGrayScale=x_<0?0:x_>1?1:x_;} INLINELINKAGE void MSTableColumn::headingBgGrayScale(double x_) {_headingBgGrayScale=x_<0?0:x_>1?1:x_;} INLINELINKAGE void MSTableColumn::style(unsigned long x_) {_style=x_;} INLINELINKAGE void MSTableColumn::breakStyle(unsigned long x_) {_breakStyle=x_;} INLINELINKAGE void MSTableColumn::headingStyle(unsigned long x_) {_headingStyle=x_;} INLINELINKAGE void MSTableColumn::reportFont(const char *x_) {_reportFont=x_;} INLINELINKAGE void MSTableColumn::reportHeadingFont(const char *x_) {_reportHeadingFont=x_;} INLINELINKAGE void MSTableColumn::breakFont(const char *x_) {_breakFont=x_;} INLINELINKAGE void MSTableColumn::breakOn(MSBoolean x_) {_breakOn=x_;} INLINELINKAGE void MSTableColumn::pageBreakOn(MSBoolean x_) {_pageBreakOn=x_;} INLINELINKAGE void MSTableColumn::breakProcessOn(MSBoolean x_) {_breakProcessOn=x_;} INLINELINKAGE void MSTableColumn::suppressDuplicate(MSBoolean x_) {_suppressDuplicate=x_;} INLINELINKAGE void MSTableColumn::breakOffset(long x_) {_breakOffset=x_;} INLINELINKAGE void MSTableColumn::breakLeading(long x_) {_breakLeading=x_;} INLINELINKAGE void MSTableColumn::breakString(const MSStringVector& x_) {_breakString=x_;} INLINELINKAGE void MSTableColumn::breakProcessMode(MSP::BreakProcessMode x_) {_breakProcessMode=x_;} INLINELINKAGE const MSStringVector& MSTableColumn::heading(void) const {return _heading;} INLINELINKAGE unsigned long MSTableColumn::headingForeground(void) const {return _headingForeground;} INLINELINKAGE void MSTableColumn::weights(const MSFloatVector& x_) {_weights=x_;} INLINELINKAGE const MSFloatVector& MSTableColumn::weights(void) const {return _weights;} INLINELINKAGE MSFloatVector& MSTableColumn::weights(void) {return _weights;} INLINELINKAGE const MSParagraph& MSTableColumn::defaultText(void) const {return _defaultText;} INLINELINKAGE MSParagraph& MSTableColumn::defaultText(void) {return _defaultText;} INLINELINKAGE void MSTableColumn::column(unsigned x_) {_column=x_;} INLINELINKAGE MSIndexVector& MSTableColumn::breakIndex(void) {return _breakIndex;} INLINELINKAGE MSIndexVector& MSTableColumn::breakInvalid(void) {return _breakInvalid;} INLINELINKAGE MSParagraph *MSTableColumn::breakText(unsigned i_) const {return _breakTextList.array(i_);} INLINELINKAGE const MSPointerArray& MSTableColumn::breakTextList(void) const {return _breakTextList;} // These are MSTableColumn's inlines INLINELINKAGE const MSFormat& MSTableColumn::format(void) const { return _format; } INLINELINKAGE MSFormat& MSTableColumn::format(void) { return _format; } INLINELINKAGE MSBoolean MSTableColumn::resizable(void) const { return _resizable; } INLINELINKAGE Font MSTableColumn::headingFont(void) const { return _headingFont;} INLINELINKAGE unsigned long MSTableColumn::headingAlignment(void) const { return _headingAlignment;} INLINELINKAGE MSGC& MSTableColumn::textMSGC(void) { return _textMSGC; } INLINELINKAGE const XFontStruct *MSTableColumn::fontStruct(void) const { return _fontStruct; } INLINELINKAGE const XFontStruct *MSTableColumn::headingFontStruct(void) const { return _headingFontStruct; } INLINELINKAGE int MSTableColumn::textAscent(void) const { return _fontStruct->max_bounds.ascent; } INLINELINKAGE int MSTableColumn::textDescent(void) const { return _fontStruct->max_bounds.descent; } INLINELINKAGE int MSTableColumn::charWidth(void) const { return _fontStruct->max_bounds.width; } INLINELINKAGE int MSTableColumn::textHeight(void) const { return (_fontStruct->max_bounds.ascent+_fontStruct->max_bounds.descent); } INLINELINKAGE int MSTableColumn::headingAscent(void) const { return _headingFontStruct->max_bounds.ascent; } INLINELINKAGE int MSTableColumn::headingDescent(void) const { return _headingFontStruct->max_bounds.descent; } INLINELINKAGE int MSTableColumn::headingCharWidth(void) const { return _headingFontStruct->max_bounds.width; } INLINELINKAGE const MSStringVector& MSTableColumn::choices(void) const { return _choices; } INLINELINKAGE MSCycleColorMode MSTableColumn::cycleColorMode(void) const { return _cycleMode; } INLINELINKAGE const MSUnsignedLongVector& MSTableColumn::cycleColors(void) const { return _cycleColors; } INLINELINKAGE unsigned MSTableColumn::columnWidth(void) const { return _columnWidth; } INLINELINKAGE unsigned MSTableColumn::editWidth(void) const { return _editWidth; } INLINELINKAGE MSAlignment MSTableColumn::columnAlignment(void) const { return _columnAlignment; } INLINELINKAGE MSClipMode MSTableColumn::clipMode(void) const { return _clipMode; } INLINELINKAGE MSTable::ColumnGroupList &MSTableColumn::groupList(void) {return _groupList;} INLINELINKAGE const MSTable::ColumnGroupList &MSTableColumn::groupList(void) const {return _groupList;} INLINELINKAGE MSBoolean MSTableColumn::valueQuoted(void) const { return _valueQuoted; } INLINELINKAGE void MSTableColumn::valueQuoted(MSBoolean bool_) { _valueQuoted=bool_; } #endif aplus-fsf-4.22/src/MSGUI/MSTableInlines.C0000644000265000001440000000446710772770436013436 #ifndef MSTableINLINES #define MSTableINLINES /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MS_NO_INLINES #define INLINELINKAGE inline #else #define INLINELINKAGE #endif INLINELINKAGE Window MSTable::dragWindow(void) { return _dragWindow; } INLINELINKAGE MSDisplayCursor *MSTable::dragCursor(void) { return _dragCursor; } INLINELINKAGE MSDisplayCursor *MSTable::resizeCursor(void) { return _resizeCursor; } INLINELINKAGE int MSTable::columnCount(void) const { return columnList()->count(); } INLINELINKAGE MSBoolean MSTable::showBreaks(void) const { return _showBreaks; } INLINELINKAGE MSBoolean MSTable::dynamicRecompute(void) const { return _dynamicRecompute; } INLINELINKAGE Font MSTable::headingFont(void) const { return _headingFont;} INLINELINKAGE unsigned long MSTable::headingAlignment(void) const { return _headingAlignment;} INLINELINKAGE MSBoolean MSTable::columnDragDrop(void) const { return _columnDragDrop; } INLINELINKAGE void MSTable::columnDragDrop(MSBoolean columnDragDrop_) { _columnDragDrop=columnDragDrop_; } INLINELINKAGE MSBoolean MSTable::columnResize(void) const { return _columnResize; } INLINELINKAGE const MSIndexVector& MSTable::viewVector(void) const {return _viewVector;} INLINELINKAGE MSIntVector &MSTable::groupHeadingsHeightVector(void) {return _groupHeadingsHeightVector;} INLINELINKAGE const MSIntVector &MSTable::groupHeadingsHeightVector(void) const {return _groupHeadingsHeightVector;} INLINELINKAGE MSTable::ColumnGroupList &MSTable::columnGroupList(void) {return _columnGroupList;} INLINELINKAGE const MSTable::ColumnGroupList &MSTable::columnGroupList(void) const {return _columnGroupList;} INLINELINKAGE int MSTable::columnHeadingsHeight(void) const { return _columnHeadingsHeight; } INLINELINKAGE void MSTable::columnHeadingsHeight(int columnHeadingsHeight_) { _columnHeadingsHeight=columnHeadingsHeight_; } INLINELINKAGE int MSTable::groupHeadingsHeight(void) const { return _groupHeadingsHeight; } INLINELINKAGE void MSTable::groupHeadingsHeight(int groupHeadingsHeight_) { _groupHeadingsHeight=groupHeadingsHeight_; } #endif aplus-fsf-4.22/src/MSGUI/MSTextRectInlines.C0000644000265000001440000001003610772770436014136 #ifndef MSTextRectINLINES #define MSTextRectINLINES /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MS_NO_INLINES #define INLINELINKAGE inline #else #define INLINELINKAGE #endif INLINELINKAGE MSWidget *MSTextRect::owner(void) const { return _owner; } INLINELINKAGE Display *MSTextRect::display(void) const { return _owner->display(); } INLINELINKAGE MSDisplayServer *MSTextRect::server(void) const { return _owner->server(); } INLINELINKAGE Window MSTextRect::window(void) const { return _owner->window(); } INLINELINKAGE MSGC& MSTextRect::textMSGC(void) { return _textMSGC; } INLINELINKAGE MSPixmap *MSTextRect::stipple(void) const { return _stipple; } INLINELINKAGE const XFontStruct *MSTextRect::textFontStruct(void) const { return _textFontStruct; } INLINELINKAGE const MSString& MSTextRect::label(void) const { return _string; } INLINELINKAGE int MSTextRect::length(void) const { return _string.length(); } INLINELINKAGE const char *MSTextRect::string(void) const { return _string.string(); } INLINELINKAGE unsigned long MSTextRect::foreground(void) const { return _fg; } INLINELINKAGE unsigned long MSTextRect::background(void) const { return _bg; } INLINELINKAGE Font MSTextRect::font(void) const { return _fid; } INLINELINKAGE MSBoolean MSTextRect::sensitive(void) const { return _sensitive; } INLINELINKAGE MSBoolean MSTextRect::doubleByte(void) const { if (_textFontStruct->min_byte1!=0||_textFontStruct->max_byte1!=0) return MSTrue; else if (_textFontStruct->max_char_or_byte2>255) return MSTrue; else return MSFalse; } INLINELINKAGE int MSTextRect::textWidth(const char *pString_) const { if (doubleByte()==MSTrue) return (pString_!=0)? (int)XTextWidth16(_textFontStruct,(XChar2b*)pString_,strlen(pString_)/2):0; else return (pString_!=0)?(int)XTextWidth(_textFontStruct,pString_,strlen(pString_)):0; } INLINELINKAGE int MSTextRect::textWidth(const char *pString_,int len_) const { if (doubleByte()==MSTrue) return (pString_!=0)?(int)XTextWidth16(_textFontStruct,(XChar2b*)pString_,len_/2):0; else return (pString_!=0)?(int)XTextWidth(_textFontStruct,pString_,len_):0; } INLINELINKAGE int MSTextRect::textWidth(void) const { return textWidth(string(),length()); } INLINELINKAGE int MSTextRect::charWidth(void) const { return _textFontStruct->max_bounds.width; } INLINELINKAGE int MSTextRect::charLbearing(void) const { return _textFontStruct->max_bounds.lbearing; } INLINELINKAGE int MSTextRect::charRbearing(void) const { return _textFontStruct->max_bounds.rbearing; } INLINELINKAGE int MSTextRect::textAscent(void) const { return _textFontStruct->max_bounds.ascent; } INLINELINKAGE int MSTextRect::textDescent(void) const { return _textFontStruct->max_bounds.descent; } INLINELINKAGE int MSTextRect::textHeight(void) const { return (textAscent()+textDescent()); } INLINELINKAGE const XCharStruct *MSTextRect::charStruct(char aChar_) const { return &(_textFontStruct->per_char[aChar_-_textFontStruct->min_char_or_byte2]); } INLINELINKAGE int MSTextRect::charWidth(char aChar_) const { return (_textFontStruct->per_char!=0&&aChar_>=_textFontStruct->min_char_or_byte2&& aChar_<=_textFontStruct->max_char_or_byte2)? charStruct(aChar_)->width:charWidth(); } INLINELINKAGE int MSTextRect::charLbearing(char aChar_) const { return (_textFontStruct->per_char!=0&&aChar_>=_textFontStruct->min_char_or_byte2&& aChar_<=_textFontStruct->max_char_or_byte2)? charStruct(aChar_)->lbearing:charLbearing(); } INLINELINKAGE int MSTextRect::charRbearing(char aChar_) const { return (_textFontStruct->per_char!=0&&aChar_>=_textFontStruct->min_char_or_byte2&& aChar_<=_textFontStruct->max_char_or_byte2)? charStruct(aChar_)->rbearing:charRbearing(); } INLINELINKAGE void MSTextRect::resize(int w_,int h_) { width(w_),height(h_); } INLINELINKAGE void MSTextRect::moveTo(int x_,int y_) { x(x_),y(y_); } #endif aplus-fsf-4.22/src/MSGUI/MSTraceSetInlines.C0000644000265000001440000001437110772770437014115 #ifndef MSTraceSetINLINES #define MSTraceSetINLINES /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MS_NO_INLINES #define INLINELINKAGE inline #else #define INLINELINKAGE #endif INLINELINKAGE const MSStringVector& MSTraceSet::legend(void) const {return _legend;} INLINELINKAGE Font MSTraceSet::textFont(void) const {return _textFont;} INLINELINKAGE unsigned long MSTraceSet::textForeground(void) const {return _textForeground;} INLINELINKAGE const MSSymbol& MSTraceSet::tag(void) const {return _tag;} INLINELINKAGE MSGraph *MSTraceSet::graph(void) const {return (MSGraph *)owner();} INLINELINKAGE MSBoolean MSTraceSet::overlap(void) const {return _overlap;} INLINELINKAGE unsigned long MSTraceSet::pieLegendAlignment(void) const {return _pieLegendAlignment;} INLINELINKAGE unsigned long MSTraceSet::pieValueAlignment(void) const {return _pieValueAlignment;} INLINELINKAGE unsigned long MSTraceSet::piePercentAlignment(void) const {return _piePercentAlignment;} INLINELINKAGE MSFloat::MSFloatFormat MSTraceSet::piePercentFormat(void) const {return _piePercentFormat;} INLINELINKAGE void MSTraceSet::piePercentFormat(MSFloat::MSFloatFormat x_) {_piePercentFormat=x_;} INLINELINKAGE void MSTraceSet::pieLegendAlignment(MSAlignment align_) {pieLegendAlignment((unsigned long) align_);} INLINELINKAGE void MSTraceSet::pieValueAlignment(MSAlignment align_) {pieValueAlignment((unsigned long) align_);} INLINELINKAGE void MSTraceSet::piePercentAlignment(MSAlignment align_) {piePercentAlignment((unsigned long) align_);} INLINELINKAGE double MSTraceSet::pieDepthFactor(void) const {return _pieDepthFactor;} INLINELINKAGE double MSTraceSet::pieAspectRatio(void) const {return _pieAspectRatio;} INLINELINKAGE int MSTraceSet::primarySlice(void) const {return _primarySlice;} INLINELINKAGE MSAlignment MSTraceSet::primarySliceAlignment(void) const {return _primarySliceAlignment;} INLINELINKAGE int MSTraceSet::pieAngle(void) const {return _pieAngle;} INLINELINKAGE void MSTraceSet::tag(const MSSymbol& tag_) {_tag=tag_;} INLINELINKAGE void MSTraceSet::overlap(MSBoolean x_) {_overlap=x_;} INLINELINKAGE MSUnsignedLongVector& MSTraceSet::lineColors(void) {return _lineColors;} INLINELINKAGE MSUnsignedLongVector& MSTraceSet::fillColors(void) {return _fillColors;} INLINELINKAGE const MSUnsignedLongVector& MSTraceSet::lineColors(void) const {return _lineColors;} INLINELINKAGE const MSUnsignedLongVector& MSTraceSet::fillColors(void) const {return _fillColors;} INLINELINKAGE const MSFloatVector *MSTraceSet::pieOffsets(void) const {return _pieOffsets;} INLINELINKAGE double MSTraceSet::pieOffset(void) const {return _pieOffset;} INLINELINKAGE MSFloatVector *MSTraceSet::pieOffsets(void) {return _pieOffsets;} INLINELINKAGE const MSFloatVector *MSTraceSet::pieProfiles(void) const {return _pieProfiles;} INLINELINKAGE MSFloatVector *MSTraceSet::pieProfiles(void) {return _pieProfiles;} INLINELINKAGE MSPointerArray& MSTraceSet::traceList(void) {return _traceList;} INLINELINKAGE const MSPointerArray& MSTraceSet::traceList(void) const {return _traceList;} INLINELINKAGE MSTrace *MSTraceSet::trace(int i_) const {return _traceList.array(i_);} INLINELINKAGE MSStringVector& MSTraceSet::legend(void) {return _legend;} INLINELINKAGE unsigned MSTraceSet::selectRow(void) const {return _selectRow;} INLINELINKAGE unsigned MSTraceSet::selectCol(void) const {return _selectCol;} INLINELINKAGE unsigned MSTraceSet::updateIndex(void) const {return _updateIndex;} INLINELINKAGE unsigned MSTraceSet::lastDataCount(void) const {return _lastDataCount;} INLINELINKAGE int MSTraceSet::normalizedOffset(void) const {return _normalizedOffset;} INLINELINKAGE double MSTraceSet::xMax(void) const {return _xMax;} INLINELINKAGE double MSTraceSet::xMin(void) const {return _xMin;} INLINELINKAGE double MSTraceSet::yMax(void) const {return _yMax;} INLINELINKAGE double MSTraceSet::yMin(void) const {return _yMin;} INLINELINKAGE double MSTraceSet::xDelta(void) const {return _xDelta;} INLINELINKAGE double MSTraceSet::xOffset(void) const {return _xOffset;} INLINELINKAGE double MSTraceSet::yOffset(void) const {return _yOffset;} INLINELINKAGE void MSTraceSet::selectRow(unsigned x_) {_selectRow=x_;} INLINELINKAGE void MSTraceSet::selectCol(unsigned x_) {_selectCol=x_;} INLINELINKAGE void MSTraceSet::updateIndex(unsigned x_) {_updateIndex=x_;} INLINELINKAGE void MSTraceSet::lastDataCount(unsigned x_) {_lastDataCount=x_;} INLINELINKAGE void MSTraceSet::normalizedOffset(int x_) {_normalizedOffset=x_;} INLINELINKAGE void MSTraceSet::xMin(double x_) {_xMin=x_;} INLINELINKAGE void MSTraceSet::xMax(double x_) {_xMax=x_;} INLINELINKAGE void MSTraceSet::yMin(double x_) {_yMin=x_;} INLINELINKAGE void MSTraceSet::yMax(double x_) {_yMax=x_;} INLINELINKAGE void MSTraceSet::xDelta(double x_) {_xDelta=x_display(); } INLINELINKAGE Colormap MSWidget::colormap(void) const { return _server->colormap(); } INLINELINKAGE Window MSWidget::window(void) const { return _window; } INLINELINKAGE MSColorManager *MSWidget::colorManager(void) { return _server->colorManager(); } INLINELINKAGE const MSColorManager *MSWidget::colorManager(void) const { return _server->colorManager(); } INLINELINKAGE MSFontManager *MSWidget::fontManager(void) { return _server->fontManager(); } INLINELINKAGE const MSFontManager *MSWidget::fontManager(void) const { return _server->fontManager(); } INLINELINKAGE int MSWidget::x_origin(void) const { return MSRect::x(); } INLINELINKAGE int MSWidget::y_origin(void) const { return MSRect::y(); } INLINELINKAGE int MSWidget::width(void) const { return MSRect::width(); } INLINELINKAGE int MSWidget::height(void) const { return MSRect::height(); } INLINELINKAGE unsigned long MSWidget::background(void) const { return _bg; } INLINELINKAGE unsigned long MSWidget::foreground(void) const { return _fg; } INLINELINKAGE Font MSWidget::font(void) const { return _fontID; } INLINELINKAGE MSBoolean MSWidget::sensitive(void) const { return _sensitive; } INLINELINKAGE MSBoolean MSWidget::readOnly(void) const { return _readOnly; } INLINELINKAGE MSBoolean MSWidget::acceptFocus(void) const { return _acceptFocus; } INLINELINKAGE MSBoolean MSWidget::acceptTab(void) const { return _acceptTab; } INLINELINKAGE MSBoolean MSWidget::dynamic(void) const { return _dynamic; } INLINELINKAGE MSBoolean MSWidget::visible(void) const { return _visible; } INLINELINKAGE MSBoolean MSWidget::frozen(void) const { return _freezeStatus; } INLINELINKAGE MSBoolean MSWidget::firstMap(void) const { return _firstMap; } INLINELINKAGE MSBoolean MSWidget::mapped(void) const { return _mapped; } INLINELINKAGE unsigned long MSWidget::resizeConstraints(void) const { return _resizeConstraints; } INLINELINKAGE long MSWidget::eventMask(void) const { return _eventMask; } INLINELINKAGE MSWidget *MSWidget::focusWindow(void) { return _focusWindow; } INLINELINKAGE MSKeyTranslationTable *MSWidget::keyTranslationTable(void) { return &_keyTranslationTable; } INLINELINKAGE Screen *MSWidget::screen(int n_) const { return ScreenOfDisplay(display(),n_); } INLINELINKAGE Screen *MSWidget::screen(void) const { return _server->screen(); } INLINELINKAGE int MSWidget::depth(void) const { return DefaultDepthOfScreen(screen()); } INLINELINKAGE unsigned long MSWidget::addKeyCallback( const char* pString_, MSKeyCallback* keyCallback_) { return keyTranslationTable()->addCallback(pString_,keyCallback_);} INLINELINKAGE void MSWidget::removeKeyCallback( unsigned long identifier_ ) { keyTranslationTable()->removeCallback(identifier_);} INLINELINKAGE void MSWidget::removeKeyCallback( const char* pString_) { keyTranslationTable()->removeCallback(pString_);} INLINELINKAGE MSBoolean MSWidget::hasKeyCallback( const MSKeyPress& keyPress_) { return keyTranslationTable()->hasMatch(keyPress_); } INLINELINKAGE void MSWidget::removeAllKeyCallbacks() { keyTranslationTable()->removeAll(); } #endif aplus-fsf-4.22/src/MSGUI/MSWidgetOutputInlines.C0000644000265000001440000000454510772770437015051 #ifndef MSWidgetOutputINLINES #define MSWidgetOutputINLINES /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MS_NO_INLINES #define INLINELINKAGE inline #else #define INLINELINKAGE #endif INLINELINKAGE unsigned long MSWidgetOutput::highlightColor(void) const { return _highlightColor; } INLINELINKAGE MSBoolean MSWidgetOutput::highlighted(void) const { return _highlighted; } INLINELINKAGE int MSWidgetOutput::highlightThickness(void) const { return _highlightThickness; } INLINELINKAGE int MSWidgetOutput::shadowThickness(void) const { return _shadowThickness; } INLINELINKAGE MSShadowStyle MSWidgetOutput::shadowStyle(void) const { return _shadowStyle; } INLINELINKAGE int MSWidgetOutput::topShadowOffset(void) const { return _topShadowOffset; } INLINELINKAGE MSWidgetOutput::OutputMode MSWidgetOutput::outputMode(void) {return _outputMode;} INLINELINKAGE MSBoolean MSWidgetOutput::doubleByte(const XFontStruct *fs_) const { if (fs_->min_byte1!=0||fs_->max_byte1!=0) return MSTrue; else if (fs_->max_char_or_byte2>255) return MSTrue; else return MSFalse; } INLINELINKAGE void MSWidgetOutput::XClearArea(Display *dpy_,Window id_, int x_,int y_,int w_,int h_,int exposures_) { if (_outputMode MSPointerArray::MSPointerArray(void) {_size=0,_count=0,_array=0,_frozen=MSFalse;} template MSPointerArray::~MSPointerArray(void) { if (_array!=0) { for (unsigned i=0;i void MSPointerArray::reserve(unsigned size_) { unsigned n=size_+1; if (size() MSBoolean MSPointerArray::assign(Type* object_,unsigned location_) { if (location_ MSBoolean MSPointerArray::find(Type *object_) { unsigned n=count(); for (unsigned i=0;i MSBoolean MSPointerArray::add(Type *object_) { if (find(object_)==MSFalse) { reserve(count()); _array[_count++]=object_; return MSTrue; } return MSFalse; } template MSBoolean MSPointerArray::remove(Type *object_) { if (frozen()==MSFalse) { unsigned n=count(); for (unsigned i=0;i MSBoolean MSPointerArray::removeAll(void) { if (frozen()==MSFalse) { while (count()>0) _array[--_count]=0; return MSTrue; } return MSFalse; } template MSBoolean MSPointerArray::insert(Type *object_,unsigned location_) { if (location_location_;i--) _array[i]=_array[i-1]; _array[location_]=object_; _count++; return MSTrue; } else if (location_==count()) { return add(object_); } return MSFalse; } template MSBoolean MSPointerArray::exchange(unsigned x_,unsigned y_) { if (x_ #include #include // look for elementForOps #include #include const int MSTreeListViewDefaultRows=15; const int MSTreeListViewDefaultColumns=30; const int MSTreeListViewDefaultRowHorizontalSpacing=2; const int MSTreeListViewDefaultRowVerticalSpacing=2; const int MSTreeListViewDefaultButtonShadowThickness=2; const int MSTreeListViewMinimumButtonSize=8; const int MSTreeListViewDefaultScrollBarSize=15; const unsigned long MSTreeListViewEventMask=(ButtonPressMask|ButtonReleaseMask|ExposureMask); const int MSTreeListViewMinimumEditorWidth=75; // Since this is a template class all global defines should be unique #define MSTreeListViewCollapsedButtonPixmapName "__MSTreeListViewCollapsedButtonPixmap__" #define MSTreeListViewExpandedButtonPixmapName "__MSTreeListViewExpandedButtonPixmap__" #define MSTreeListViewDashPixmapName "__MSTreeListViewDashPixmap__" #define MSTreeListView_Expanded_width 12 #define MSTreeListView_Expanded_height 12 #define MSTreeListView_Collapsed_width 12 #define MSTreeListView_Collapsed_height 12 #define MSTreeListView_dash_width 12 #define MSTreeListView_dash_height 12 template class VScrollBar : public MSVScrollBar { protected: virtual void change(void); public: VScrollBar(MSWidget *); ~VScrollBar(void); }; template class HScrollBar : public MSHScrollBar { protected: virtual void change(void); public: HScrollBar(MSWidget *); ~HScrollBar(void); }; template VScrollBar::VScrollBar(MSWidget *owner_) : MSVScrollBar(owner_) { inc(1); pageInc(1); _highlightThickness=0; _acceptFocus=MSFalse; width(MSTreeListViewDefaultScrollBarSize); } template VScrollBar::~VScrollBar(void) {} template void VScrollBar::change(void) { ((MSTreeListView*)owner())->vsbChanged(); } template HScrollBar::HScrollBar(MSWidget *owner_) : MSHScrollBar(owner_) { min(0); inc(1); pageInc(1); _highlightThickness=0; _acceptFocus=MSFalse; height(MSTreeListViewDefaultScrollBarSize); } template HScrollBar::~HScrollBar(void) {} template void HScrollBar::change(void) { ((MSTreeListView*)owner())->hsbChanged(); } #if !defined(MS_INLINE_TEMPLATE_NESTED_CLASS) // Editor template MSTreeListView::Editor::Editor(MSWidget *owner_) : MSTextField(owner_) { _highlightThickness=0; selectInput(ExposureMask|ButtonPressMask); } template MSTreeListView::Editor::~Editor(void) {} template void MSTreeListView::Editor::activate(void) { ((MSTreeListView *)(owner()))->editorActivate(); } template void MSTreeListView::Editor::escape(void) { ((MSTreeListView *)(owner()))->editorEscape(); } #endif // !MS_INLINE_TEMPLATE_NESTED_CLASS template MSTreeListView::MSTreeListView(MSWidget *owner_,TreeModel &tree_) : MSWidgetCommon(owner_) { init(); couple(&tree_); } template MSTreeListView::MSTreeListView(MSWidget *owner_) : MSWidgetCommon(owner_) { init(); } template MSTreeListView::~MSTreeListView(void) { if (_collapsedButtonPixmap!=0) delete _collapsedButtonPixmap; if (_expandedButtonPixmap!=0) delete _expandedButtonPixmap; if (vsb()!=0) safeDestroy(vsb()); if (hsb()!=0) safeDestroy(hsb()); if (clipWindow()!=0) safeDestroy(clipWindow()); if (redrawPixmap()!=0) delete redrawPixmap(); if (stipplePixmap()!=0) delete stipplePixmap(); if (dotPixmap()!=0) delete dotPixmap(); if (dashPixmap()!=0) delete dashPixmap(); if (_selectedNode!=0) delete _selectedNode; if (_activatedNode!=0) delete _activatedNode; _pEditor->destroy(); } template void MSTreeListView::init(void) { _useBackingStore=MSFalse; _shadowStyle=MSSunken; _acceptFocus=MSTrue; addToFocusList(); _hasFocus=MSFalse; _vsb=new VScrollBar(this); _hsb=new HScrollBar(this); _clipWindow=new MSWidgetCommon(this); _clipWindow->highlightThickness(0); _clipWindow->shadowThickness(0); _clipWindow->acceptFocus(MSFalse); _pEditor = new Editor(this); _pEditor->xMargin(2); _redrawPixmap=new MSBackingStorePixmap(server(),"MSGeneral"); _showButtons=MSTrue; _showLines=MSTrue; _showRootNode=MSTrue; _tabSpacing=0; _selectedNode=0; _firstRow=0; _activatedNode=0; _collapsedButtonPixmap=0; _expandedButtonPixmap=0; _lineForeground=foreground(); _lineStyle=MSSolid; _buttonShadowStyle=MSRaised; _selectedRowForeground=background(); _selectedRowBackground=foreground(); fontObject().fontStruct(server()->fontStruct(font())); hsb()->inc(fontObject().charWidth()); _stipplePixmap=new MSPixmap(server(),MSPixmap::ForegroundFiftyPixmap,1,0,1); _dotPixmap=0; _dashPixmap=0; XGCValues values; values.font=font(); values.stipple=stipplePixmap()->pixmap(); values.fill_style=FillSolid; gc().setGCValues(server(),MSFalse,&values,GCFont|GCStipple|GCFillStyle); values.fill_style=FillSolid; values.foreground=lineForeground(); linegc().setGCValues(server(),MSFalse,&values,GCFillStyle|GCForeground); values.foreground=foreground(); values.background=background(); pixmapgc().setGCValues(server(),MSFalse,&values,GCForeground|GCBackground); buildCollapsedButtonPixmap(); buildExpandedButtonPixmap(); setGeometryDefaults(); useBackingStore(MSTrue); readOnly(MSTrue); selectInput(MSTreeListViewEventMask); } template void MSTreeListView::setGeometryDefaults(void) { _highlightThickness=0; _shadowThickness=2; _rows=MSTreeListViewDefaultRows; _columns=MSTreeListViewDefaultColumns; _rowHorizontalSpacing=MSTreeListViewDefaultRowHorizontalSpacing; _rowVerticalSpacing=MSTreeListViewDefaultRowVerticalSpacing; _buttonShadowThickness=MSTreeListViewDefaultButtonShadowThickness; _levelOffset=collapsedButtonPixmap().width()+buttonShadowThickness()*2+rowHorizontalSpacing()*2; _maxRowHeight=0; _maxRowWidth=0; } template void MSTreeListView::rebuildScreen(MSBoolean recomputeSize_) { buildResourceTreeAndScreenVector(); computeMaxRowSize(); if (recomputeSize_==MSTrue) computeSize(); else { configure(); redrawImmediately(); } } template void MSTreeListView::expandSubTree(ScreenVectorCursor &cursor_,unsigned long pos_) { if (frozen()==MSFalse) { ResourceTreeCursor &resourceCursor=screenVector().elementAt(cursor_); ManagedInfo &node=resourceTree().elementAt(resourceCursor); if (resourceTree().isLeaf(resourceCursor)) { updateRow(node,pos_-1); } else { ScreenVectorCursor start(cursor_); ScreenVectorCursor end(cursor_); end.setToNext(); updateScreenVector(cursor_,resourceCursor); start.setToNext(); computeMaxRowSize(start,end); configure(); redrawImmediately(); } } } template void MSTreeListView::collapseSubTree(ScreenVectorCursor &cursor_,unsigned long pos_) { if (frozen()==MSFalse) { ResourceTreeCursor &resourceCursor=screenVector().elementAt(cursor_); ManagedInfo &node=resourceTree().elementAt(resourceCursor); if (_selectedNode!=0&&node->modelCursor()!=*_selectedNode&&locateSelectedNode(resourceCursor)==MSTrue) resetSelectedNode(); int level=node->level(); pos_++; if (pos_<=screenVector().numberOfElements()) { while (pos_<=screenVector().numberOfElements()) { screenVector().setToPosition(pos_,cursor_); ResourceTreeCursor &rCursor=screenVector().elementAt(cursor_); ManagedInfo &nodeInfo=resourceTree().elementAt(rCursor); if (nodeInfo->level()>level) { screenVector().removeAt(cursor_); } else break; } if (dynamic()==MSTrue) adjustView(); configure(); redrawImmediately(); } else { updateRow(node,pos_-2); } } } template void MSTreeListView::updateScreenVector(ScreenVectorCursor &cursor_,ResourceTreeCursor resourceCursor_) { for (resourceCursor_.setToFirstExistingChild();resourceCursor_.isValid();resourceCursor_.setToNextExistingChild()) { if (screenVector().isEmpty()) { screenVector().addAsFirst(resourceCursor_); cursor_.setToFirst(); } else screenVector().addAsNext(resourceCursor_,cursor_); ManagedInfo &node=resourceTree().elementAt(resourceCursor_); if (isExpanded(node)==MSTrue) updateScreenVector(cursor_,resourceCursor_); } } template void MSTreeListView::updateResourceTree(ResourceTreeCursor resourceCursor_,TreeModelCursor modelCursor_) { ManagedInfo &nodeInfo=resourceTree().elementAt(resourceCursor_); for (modelCursor_.setToFirstExistingChild();modelCursor_.isValid();modelCursor_.setToNextExistingChild()) { NodeAttribute nodeAttr; nodeAttribute(modelCursor_,nodeAttr); NodeInfo *newNode=new NodeInfo(this,nodeAttr,modelCursor_,(NodeInfo*)nodeInfo,nodeInfo->level()+1); unsigned long pos=modelTree().position(modelCursor_); resourceTree().addAsChild(resourceCursor_,pos,ManagedInfo(newNode,MSInit)); if (modelTree().isLeaf(modelCursor_)==False) { ResourceTreeCursor rCursor=resourceCursor_; rCursor.setToChild(pos); updateResourceTree(rCursor,modelCursor_); } } } template void MSTreeListView::setAttributes(Iterator &iterator_) { ResourceTreeCursor resourceCursor(resourceTree()); for (resourceTree().setToFirst(resourceCursor,MSPreorder); resourceCursor.isValid(); resourceTree().setToNext(resourceCursor,MSPreorder)) { ManagedInfo &info=resourceTree().elementAt(resourceCursor); NodeAttribute nodeAttr=info->attribute(); iterator_.nodeAttribute(info->modelCursor(),nodeAttr); info->attribute(this,nodeAttr); } } template void MSTreeListView::getAttributes(ConstIterator &iterator_) const { ResourceTreeCursor resourceCursor(resourceTree()); for (resourceTree().setToFirst(resourceCursor,MSPreorder); resourceCursor.isValid(); resourceTree().setToNext(resourceCursor,MSPreorder)) { const ManagedInfo &info=resourceTree().elementAt(resourceCursor); NodeAttribute nodeAttr=info->attribute(); iterator_.nodeAttribute(info->modelCursor(),nodeAttr); } } template void MSTreeListView::buildScreenVector(void) { screenVector().removeAll(); if (resourceTree().isEmpty()==False) { ResourceTreeCursor resourceCursor(resourceTree()); resourceCursor.setToRoot(); ScreenVectorCursor screenCursor(screenVector()); if (showRootNode()==MSTrue) { screenVector().addAsFirst(resourceCursor,screenCursor); screenCursor.setToFirst(); } ManagedInfo &info=resourceTree().elementAt(resourceCursor); if (isExpanded(info)==MSTrue) updateScreenVector(screenCursor,resourceCursor); } } template void MSTreeListView::buildResourceTreeAndScreenVector(Iterator *iterator_) { if (MSView::model()!=0&&resourceTree().isEmpty()==True) { TreeModelCursor modelCursor(modelTree()); modelCursor.setToRoot(); if (modelCursor.isValid()) { int level=0; if (showRootNode()==MSFalse) level--; NodeInfo *nodeInfo; NodeAttribute nodeAttr; if (iterator_==0) { nodeAttribute(modelCursor,nodeAttr); } else { iterator_->nodeAttribute(modelCursor,nodeAttr); } nodeInfo=new NodeInfo(this,nodeAttr,modelCursor,0,level); ManagedInfo managedInfo(nodeInfo, MSInit); resourceTree().addAsRoot(managedInfo); ResourceTreeCursor resourceCursor(resourceTree()); resourceCursor.setToRoot(); ScreenVectorCursor screenCursor(screenVector()); if (showRootNode()==MSTrue) { screenVector().addAsFirst(resourceCursor); screenCursor.setToFirst(); } updateResourceTreeAndScreenVector(resourceCursor,screenCursor,isExpanded(nodeInfo),iterator_); } } } template void MSTreeListView::updateResourceTreeAndScreenVector(ResourceTreeCursor &resourceCursor_, ScreenVectorCursor &screenCursor_, MSBoolean parentExpanded_, Iterator *iterator_) { if (resourceCursor_.isValid()) { ManagedInfo &nodeInfo=resourceTree().elementAt(resourceCursor_); TreeModelCursor modelCursor=nodeInfo->modelCursor(); int level=nodeInfo->level()+1; for (modelCursor.setToFirstExistingChild();modelCursor.isValid();modelCursor.setToNextExistingChild()) { NodeInfo *newNodeInfo; NodeAttribute nodeAttr; if (iterator_==0) { nodeAttribute(modelCursor,nodeAttr); } else { iterator_->nodeAttribute(modelCursor,nodeAttr); } newNodeInfo=new NodeInfo(this,nodeAttr,modelCursor,(NodeInfo*)nodeInfo,level); unsigned long pos=modelTree().position(modelCursor); resourceTree().addAsChild(resourceCursor_,pos,ManagedInfo(newNodeInfo,MSInit)); ResourceTreeCursor newResourceCursor(resourceTree()); newResourceCursor=resourceCursor_; resourceTree().setToChild(pos,newResourceCursor); if (parentExpanded_) { if (screenVector().isEmpty()) { screenVector().addAsFirst(newResourceCursor); screenCursor_.setToFirst(); } else screenVector().addAsNext(newResourceCursor,screenCursor_); } MSBoolean expanded=MSFalse; if (parentExpanded_==MSTrue&&isExpanded(newNodeInfo)==MSTrue) expanded=MSTrue; updateResourceTreeAndScreenVector(newResourceCursor,screenCursor_,expanded,iterator_); } } else reportError("Warning: Invalid Cursor in MSTreeListView::updateResourceTreeAndScreenVector()"); } template void MSTreeListView::nodeModified(const TreeModelCursor &cursor_,NodeAttribute &attribute_) { nodeAttribute(cursor_,attribute_); } template void MSTreeListView::nodeAttribute(const TreeModelCursor &,NodeAttribute &) {} template void MSTreeListView::setNodeAttributes(MSTreeListView::Iterator &iterator_) { // If resourceTree hasn't been built yet, then build it with the iterator // Otherwise just traverse the resourceTree and rebuild only the screen vector if (resourceTree().isEmpty()==True) buildResourceTreeAndScreenVector(&iterator_); else { setAttributes(iterator_); buildScreenVector(); } adjustView(); } template void MSTreeListView::getNodeAttributes(MSTreeListView::ConstIterator &iterator_) const { // load the resource tree if it hasn't been loaded. But since buildResourceTreeAndScreenVector() // is not a const method, we need to cast away the const-ness. This is a work around in order // to preserve the const-ness of this method. if (resourceTree().isEmpty()==True) { MSTreeListView *myself=(MSTreeListView *)this; myself->buildResourceTreeAndScreenVector(); } getAttributes(iterator_); } template void MSTreeListView::model(TreeModel &modelTree_) { couple(&modelTree_); } template void MSTreeListView::model(const TreeModel &modelTree_) { constCouple(&modelTree_); } template void MSTreeListView::rows(int rows_) { if (_rows!=rows_) { _rows=rows_; if (firstMap()==MSTrue) computeSize(); } } template void MSTreeListView::columns(int columns_) { if (_columns!=columns_) { _columns=columns_; if (firstMap()==MSTrue) computeSize(); } } template void MSTreeListView::firstRow(int firstRow_) { if (_firstRow!=firstRow_) { int oldFirstRow=firstRow(); _firstRow=firstRow_; if (firstMap()==MSTrue) { adjustFirstRow(); if (oldFirstRow!=firstRow()) { if (useBackingStore()==MSTrue) { int diff=MSUtil::abs(oldFirstRow-firstRow()); if (diff void MSTreeListView::firstNode(const TreeModelCursor &modelCursor_) { ResourceTreeCursor resourceCursor=findResourceCursor(modelCursor_); if (resourceCursor.isValid()) { unsigned long pos; ScreenVectorCursor screenCursor=findScreenCursor(resourceCursor,pos); if (screenCursor.isValid()) firstRow(pos-1); } } template MSTreeListView::TreeModelCursor MSTreeListView::firstNode(void) const { if (MSView::model()!=0&&numRows()>0&&firstRow()modelCursor()); } else return TreeModelCursor(TreeModel()); } template void MSTreeListView::scrollUp(int numToScroll_) { int offset=highlightThickness()+shadowThickness(); int border=offset*2; int viewWidth=width()-border; viewWidth-=(vsb()->mapped()==MSTrue)?vsb()->width():0; int viewHeight=height()-border; viewHeight-=(hsb()->mapped()==MSTrue)?hsb()->height():0; int emptyRegionHeight=numToScroll_*maxRowHeight(); int x=offset; int y=offset+emptyRegionHeight; int w=viewWidth; int h=viewHeight-emptyRegionHeight; XCopyArea(display(),window(),window(),gc().gc(),x,y,w,h,x,offset); int from=firstRow()+rows()-numToScroll_; int to=firstRow()+rows(); clearDrawingArea(redrawPixmap()->pixmap()); drawRows(redrawPixmap()->pixmap(),from,to); drawingAreaShadow(redrawPixmap()->pixmap()); drawHighlight(redrawPixmap()->pixmap()); y=offset+(from-firstRow())*maxRowHeight(); h=(numToScroll_+1)*maxRowHeight(); XCopyArea(display(),redrawPixmap()->pixmap(),window(),gc().gc(),x,y,w,h,x,y); } template void MSTreeListView::scrollDown(int numToScroll_) { clearDrawingArea(redrawPixmap()->pixmap()); int offset=highlightThickness()+shadowThickness(); int border=offset*2; int viewWidth=width()-border; viewWidth-=(vsb()->mapped()==MSTrue)?vsb()->width():0; int viewHeight=height()-border; viewHeight-=(hsb()->mapped()==MSTrue)?hsb()->height():0; int emptyRegionHeight=numToScroll_*maxRowHeight(); int x=offset; int y=offset; int w=viewWidth; int h=viewHeight-emptyRegionHeight; XCopyArea(display(),window(),redrawPixmap()->pixmap(),gc().gc(),x,y,w,h,x,y+emptyRegionHeight); int from=firstRow(); int to=firstRow()+numToScroll_-1; drawRows(redrawPixmap()->pixmap(),from,to); XCopyArea(display(),redrawPixmap()->pixmap(),window(),gc().gc(),offset,offset,viewWidth,viewHeight,offset,offset); } template void MSTreeListView::collapsedButtonPixmap(const MSPixmap &collapsedButtonPixmap_) { if (_collapsedButtonPixmap!=0) delete _collapsedButtonPixmap; _collapsedButtonPixmap=new MSPixmap(collapsedButtonPixmap_); adjustView(); } template void MSTreeListView::expandedButtonPixmap(const MSPixmap &expandedButtonPixmap_) { if (_expandedButtonPixmap!=0) delete _expandedButtonPixmap; _expandedButtonPixmap=new MSPixmap(expandedButtonPixmap_); adjustView(); } template void MSTreeListView::buttonShadowThickness(int buttonShadowThickness_) { if (_buttonShadowThickness!=buttonShadowThickness_) { _buttonShadowThickness=buttonShadowThickness_; adjustView(); } } template void MSTreeListView::buttonShadowStyle(MSShadowStyle buttonShadowStyle_) { if (_buttonShadowStyle!=buttonShadowStyle_) { _buttonShadowStyle=buttonShadowStyle_; redrawImmediately(); } } template void MSTreeListView::selectedNode(const TreeModelCursor &modelCursor_) { TreeModelCursor *oldSelectedNode=_selectedNode; if (oldSelectedNode==0||*oldSelectedNode!=modelCursor_) { if (oldSelectedNode!=0&&oldSelectedNode->isValid()&&mapped()==MSTrue) { _selectedNode=0; updateRow(*oldSelectedNode); _selectedNode=oldSelectedNode; } } if (_selectedNode!=0) *_selectedNode=modelCursor_; else if (MSView::model()!=0) { _selectedNode=new TreeModelCursor(modelTree()); *_selectedNode=modelCursor_; } updateRow(*_selectedNode); } template MSTreeListView::TreeModelCursor MSTreeListView::selectedNode(void) const { if (MSView::model()!=0) { if (_selectedNode==0) return TreeModelCursor(modelTree()); else return *_selectedNode; } else return TreeModelCursor(TreeModel()); } template MSTreeListView::TreeModelCursor MSTreeListView::activatedNode(void) const { if (MSView::model()!=0) { if (_activatedNode==0) return TreeModelCursor(modelTree()); else return *_activatedNode; } else return TreeModelCursor(TreeModel()); } template void MSTreeListView::sensitive(const TreeModelCursor &modelCursor_,MSBoolean sensitive_) { if (resourceTree().isEmpty()==True) buildResourceTreeAndScreenVector(); ResourceTreeCursor resourceCursor=findResourceCursor(modelCursor_); if (resourceCursor.isValid()) { ManagedInfo &info=resourceTree().elementAt(resourceCursor); if (info->sensitive()!=sensitive_) { info->sensitive(sensitive_); if (firstMap()==MSTrue) { unsigned long pos; ScreenVectorCursor screenCursor=findScreenCursor(resourceCursor,pos); if (screenCursor.isValid()&&isRowOnScreen(pos-1)) { updateRow(info,pos-1); } } } } } template MSBoolean MSTreeListView::sensitive(const TreeModelCursor &modelCursor_) const { // load the resource tree if it hasn't been loaded. But since buildResourceTreeAndScreenVector() // is not a const method, we need to cast away the const-ness. This is a work around in order // to preserve the const-ness of this method. if (resourceTree().isEmpty()==True) { MSTreeListView *myself=(MSTreeListView *)this; myself->buildResourceTreeAndScreenVector(); } ResourceTreeCursor resourceCursor=findResourceCursor(modelCursor_); if (resourceCursor.isValid()) { const ManagedInfo &nodeInfo=resourceTree().elementAt(resourceCursor); return nodeInfo->sensitive(); } else { reportError("Warning : MSTreeListView::sensitive() - Can't find element at cursor"); return MSFalse; } } template void MSTreeListView::expandedState(const TreeModelCursor &modelCursor_,MSBoolean expandedState_) { if (resourceTree().isEmpty()==True) buildResourceTreeAndScreenVector(); ResourceTreeCursor resourceCursor=findResourceCursor(modelCursor_); if (resourceCursor.isValid()) { ManagedInfo &info=resourceTree().elementAt(resourceCursor); if (info->expandedState()!=expandedState_) { info->expandedState(expandedState_); if (info->expandable()==MSTrue) { if (firstMap()==MSTrue) { unsigned long pos; ScreenVectorCursor screenCursor=findScreenCursor(resourceCursor,pos); if (screenCursor.isValid()&&isRowOnScreen(pos-1)) { if (info->expandedState()==MSTrue) expandSubTree(screenCursor,pos); else collapseSubTree(screenCursor,pos); } } } } } } template MSBoolean MSTreeListView::expandedState(const TreeModelCursor &modelCursor_) const { // load the resource tree if it hasn't been loaded. But since buildResourceTreeAndScreenVector() // is not a const method, we need to cast away the const-ness. This is a work around in order // to preserve the const-ness of this method. if (resourceTree().isEmpty()==True) { MSTreeListView *myself=(MSTreeListView *)this; myself->buildResourceTreeAndScreenVector(); } ResourceTreeCursor resourceCursor=findResourceCursor(modelCursor_); if (resourceCursor.isValid()) { const ManagedInfo &nodeInfo=resourceTree().elementAt(resourceCursor); return nodeInfo->expandedState(); } else { reportError("Warning : MSTreeListView::expandedState() - Can't find element at cursor"); return MSFalse; } } template void MSTreeListView::expandable(const TreeModelCursor &modelCursor_,MSBoolean expandable_) { if (resourceTree().isEmpty()==True) buildResourceTreeAndScreenVector(); ResourceTreeCursor resourceCursor=findResourceCursor(modelCursor_); if (resourceCursor.isValid()) { ManagedInfo &info=resourceTree().elementAt(resourceCursor); if (info->expandable()!=expandable_) { info->expandable(expandable_); if (firstMap()==MSTrue) { unsigned long pos; ScreenVectorCursor screenCursor=findScreenCursor(resourceCursor,pos); if (screenCursor.isValid()&&isRowOnScreen(pos-1)) { if (info->expandable()==MSTrue&&info->expandedState()==MSTrue) expandSubTree(screenCursor,pos); else updateRow(info,pos-1); } } } } } template MSBoolean MSTreeListView::expandable(const TreeModelCursor &modelCursor_) const { // load the resource tree if it hasn't been loaded. But since buildResourceTreeAndScreenVector() // is not a const method, we need to cast away the const-ness. This is a work around in order // to preserve the const-ness of this method. if (resourceTree().isEmpty()==True) { MSTreeListView *myself=(MSTreeListView *)this; myself->buildResourceTreeAndScreenVector(); } ResourceTreeCursor resourceCursor=findResourceCursor(modelCursor_); if (resourceCursor.isValid()) { const ManagedInfo &nodeInfo=resourceTree().elementAt(resourceCursor); return nodeInfo->expandable(); } else { reportError("Warning : MSTreeListView::expandable() - Can't find element at cursor"); return MSFalse; } } template void MSTreeListView::pixmap(const TreeModelCursor &modelCursor_,const MSStringVector &pixmap_) { if (resourceTree().isEmpty()==True) buildResourceTreeAndScreenVector(); ResourceTreeCursor resourceCursor=findResourceCursor(modelCursor_); if (resourceCursor.isValid()) { ManagedInfo &info=resourceTree().elementAt(resourceCursor); info->buildPixmapList(pixmapRegistry(),info->pixmap(),pixmap_); if (firstMap()==MSTrue) adjustView(); } } template MSStringVector MSTreeListView::pixmap(const TreeModelCursor &modelCursor_) const { // load the resource tree if it hasn't been loaded. But since buildResourceTreeAndScreenVector() // is not a const method, we need to cast away the const-ness. This is a work around in order // to preserve the const-ness of this method. if (resourceTree().isEmpty()==True) { MSTreeListView *myself=(MSTreeListView *)this; myself->buildResourceTreeAndScreenVector(); } ResourceTreeCursor resourceCursor=findResourceCursor(modelCursor_); MSStringVector names; if (resourceCursor.isValid()) { const ManagedInfo &nodeInfo=resourceTree().elementAt(resourceCursor); const PixmapList &pixmapList=nodeInfo->pixmap(); unsigned long nElements=pixmapList.length(); for (unsigned long i=0;i void MSTreeListView::insensitivePixmap(const TreeModelCursor &modelCursor_,const MSStringVector &insensitivePixmap_) { if (resourceTree().isEmpty()==True) buildResourceTreeAndScreenVector(); ResourceTreeCursor resourceCursor=findResourceCursor(modelCursor_); if (resourceCursor.isValid()) { ManagedInfo &info=resourceTree().elementAt(resourceCursor); info->buildPixmapList(pixmapRegistry(),info->insensitivePixmap(),insensitivePixmap_); if (firstMap()==MSTrue) adjustView(); } } template MSStringVector MSTreeListView::insensitivePixmap(const TreeModelCursor &modelCursor_) const { // load the resource tree if it hasn't been loaded. But since buildResourceTreeAndScreenVector() // is not a const method, we need to cast away the const-ness. This is a work around in order // to preserve the const-ness of this method. if (resourceTree().isEmpty()==True) { MSTreeListView *myself=(MSTreeListView *)this; myself->buildResourceTreeAndScreenVector(); } ResourceTreeCursor resourceCursor=findResourceCursor(modelCursor_); MSStringVector names; if (resourceCursor.isValid()) { const ManagedInfo &nodeInfo=resourceTree().elementAt(resourceCursor); const PixmapList &pixmapList=nodeInfo->insensitivePixmap(); unsigned long nElements=pixmapList.length(); for (unsigned long i=0;i void MSTreeListView::selectedPixmap(const TreeModelCursor &modelCursor_,const MSStringVector &selectedPixmap_) { if (resourceTree().isEmpty()==True) buildResourceTreeAndScreenVector(); ResourceTreeCursor resourceCursor=findResourceCursor(modelCursor_); if (resourceCursor.isValid()) { ManagedInfo &info=resourceTree().elementAt(resourceCursor); info->buildPixmapList(pixmapRegistry(),info->selectedPixmap(),selectedPixmap_); if (firstMap()==MSTrue) adjustView(); } } template MSStringVector MSTreeListView::selectedPixmap(const TreeModelCursor &modelCursor_) const { // load the resource tree if it hasn't been loaded. But since buildResourceTreeAndScreenVector() // is not a const method, we need to cast away the const-ness. This is a work around in order // to preserve the const-ness of this method. if (resourceTree().isEmpty()==True) { MSTreeListView *myself=(MSTreeListView *)this; myself->buildResourceTreeAndScreenVector(); } ResourceTreeCursor resourceCursor=findResourceCursor(modelCursor_); MSStringVector names; if (resourceCursor.isValid()) { const ManagedInfo &nodeInfo=resourceTree().elementAt(resourceCursor); const PixmapList &pixmapList=nodeInfo->selectedPixmap(); unsigned long nElements=pixmapList.length(); for (unsigned long i=0;i void MSTreeListView::registerPixmap(const MSPixmap &pixmap_) { pixmapRegistry().addOrReplaceElementWithKey(pixmap_); } template const MSPixmap *MSTreeListView::pixmap(const MSString &key_) const { PixmapRegistryCursor cursor(_pixmapRegistry); _pixmapRegistry.locateElementWithKey(key_,cursor); if (cursor.isValid()) return &_pixmapRegistry.elementAt(cursor); else return 0; } template void MSTreeListView::clearDrawingArea(Window window_) { XFillRectangle(display(),window_,backgroundShadowGC(),0,0,width(),height()); } template void MSTreeListView::drawingAreaShadow(Window window_) { if (shadowThickness()>0) { int viewWidth=width()-highlightThickness()*2; viewWidth-=(vsb()->mapped()==MSTrue)?vsb()->width():0; int viewHeight=height()-highlightThickness()*2; viewHeight-=(hsb()->mapped()==MSTrue)?hsb()->height():0; drawBevel(window_,MSRect(highlightThickness(),highlightThickness(),viewWidth,viewHeight),shadowStyle(),shadowThickness()); } } template void MSTreeListView::redrawImmediately(void) { if (frozen()==MSFalse&&mapped()==MSTrue) redraw(); } template void MSTreeListView::redraw(void) { clearDrawingArea(redrawPixmap()->pixmap()); if (MSView::model()!=0&&screenVector().isEmpty()==False) { int lastRow=firstRow()+rows(); drawRows(redrawPixmap()->pixmap(),firstRow(),lastRow); } drawingAreaShadow(redrawPixmap()->pixmap()); drawHighlight(redrawPixmap()->pixmap()); XCopyArea(display(),redrawPixmap()->pixmap(),window(),backgroundShadowGC(),0,0,width(),height(),0,0); } template void MSTreeListView::unfreeze(void) { MSWidgetCommon::unfreeze(); buildScreenVector(); adjustView(); } template void MSTreeListView::drawHighlight(Window window_) { if (highlightThickness()>0) { GC gc=(highlighted()==MSTrue)?highlightGC():backgroundShadowGC(); drawFlatShadow(window_,MSRect(0,topShadowOffset(),width(),height()-topShadowOffset()), highlightThickness(),gc); } } template void MSTreeListView::clearRow(Window window_,int row_) { int lastRow=firstRow()+rows(); if (row_>=firstRow()&&row_<=lastRow) { int offset=highlightThickness()+shadowThickness(); int x=offset; int y=offset+maxRowHeight()*(row_-firstRow()); int w=width()-offset*2-(vsb()->mapped()==MSTrue?vsb()->width():0); int h=maxRowHeight(); XFillRectangle(display(),window_,backgroundShadowGC(),x,y,w,h); } } template void MSTreeListView::buildCollapsedButtonPixmap(void) { static char MSTreeListView_Collapsed_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0xfc, 0x03, 0xfc, 0x03, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00}; if (_collapsedButtonPixmap!=0) delete _collapsedButtonPixmap; _collapsedButtonPixmap=new MSPixmap(server(),MSTreeListViewCollapsedButtonPixmapName, MSTreeListView_Collapsed_bits, MSTreeListView_Collapsed_width, MSTreeListView_Collapsed_height); } template void MSTreeListView::buildExpandedButtonPixmap(void) { static char MSTreeListView_Expanded_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x03, 0xfc, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; if (_expandedButtonPixmap!=0) delete _expandedButtonPixmap; _expandedButtonPixmap=new MSPixmap(server(),MSTreeListViewExpandedButtonPixmapName, MSTreeListView_Expanded_bits, MSTreeListView_Expanded_width, MSTreeListView_Expanded_height); } template void MSTreeListView::updateRow(ManagedInfo &nodeInfo_,int row_) { if (frozen()==MSFalse&&mapped()==MSTrue&&isRowOnScreen(row_)==MSTrue) { clearRow(redrawPixmap()->pixmap(),row_); drawRow(redrawPixmap()->pixmap(),nodeInfo_,row_); drawingAreaShadow(redrawPixmap()->pixmap()); drawHighlight(redrawPixmap()->pixmap()); int offset=highlightThickness()+shadowThickness(); int x=offset; int y=offset+maxRowHeight()*(row_-firstRow()); int w=width()-offset*2-((vsb()->mapped()==MSTrue)?vsb()->width():0); int h=maxRowHeight(); XCopyArea(display(),redrawPixmap()->pixmap(),window(),gc().gc(),x,y,w,h,x,y); } } template void MSTreeListView::updateRow(TreeModelCursor &modelCursor_) { int lastRow=firstRow()+rows(); ScreenVectorCursor screenCursor(screenVector()); int nRows=numRows(); // We're checking pass lastRow because we Do draw pass the last row for (int i=firstRow();i<=lastRow&&imodelCursor()) { updateRow(node,i); break; } } } } // This method assumes to_ is always bigger than from_ template void MSTreeListView::drawRows(Window window_,int from_,int to_) { int nRows=numRows(); int lastRow=firstRow()+rows(); lastRow=(lastRow>=nRows)?nRows-1:lastRow; from_=(from_lastRow)?lastRow:to_; int offset=highlightThickness()+shadowThickness(); int x=offset-hsb()->value(); int y=offset+maxRowHeight()*(from_-firstRow()); ScreenVectorCursor cursor(screenVector()); screenVector().setToPosition(from_+1,cursor); for (int i=from_;i<=to_;i++) { if (cursor.isValid()==False) break; ResourceTreeCursor &resourceCursor=screenVector().elementAt(cursor); ManagedInfo &node=resourceTree().elementAt(resourceCursor); drawRow(window_,node,x,y); y+=maxRowHeight(); cursor.setToNext(); } } template void MSTreeListView::drawRow(Window window_,const ManagedInfo &node_,int row_) { int lastRow=firstRow()+rows(); if (row_=firstRow()&&row_<=lastRow) { int offset=highlightThickness()+shadowThickness(); int x=offset-hsb()->value(); int y=offset+maxRowHeight()*(row_-firstRow()); drawRow(window_,node_,x,y); } } template void MSTreeListView::drawRow(Window window_,const ManagedInfo &node_,int x_,int y_) { int bWidth=buttonWidth(); int level=node_->level(); int loffset=levelOffset(); int totalOffset=level*loffset; int midY=y_+maxRowHeight()/2; int fullY=y_+maxRowHeight(); int drawLine=(showLines()==MSTrue)&&level>0; if (drawLine) { int len=branchLength(); int x=x_+totalOffset-len; XDrawLine(display(),window_,linegc().gc(),x,midY,x+len,midY); if (node_->isLastChild()==MSTrue) XDrawLine(display(),window_,linegc().gc(),x,y_,x,midY); else XDrawLine(display(),window_,linegc().gc(),x,y_,x,fullY); NodeInfo *parent=node_->parent(); for (int i=node_->level()-2;i>=0;i--) { x-=loffset; if (parent->isLastChild()==MSFalse) XDrawLine(display(),window_,linegc().gc(),x,y_,x,fullY); parent=parent->parent(); } } int x=x_+totalOffset; int y=y_; if (showButtons()==MSTrue) { if (isExpandable(node_)==MSTrue) { int pixmapWidth,pixmapHeight; x+=rowHorizontalSpacing(); MSBoolean expanded=isExpanded(node_); if (expanded==MSTrue) { pixmapWidth=expandedButtonPixmap().width(); pixmapHeight=expandedButtonPixmap().height(); } else { pixmapWidth=collapsedButtonPixmap().width(); pixmapHeight=collapsedButtonPixmap().height(); } y=y_+(maxRowHeight()-pixmapHeight-buttonShadowThickness()*2)/2; int pixmapX=x+buttonShadowThickness(); int pixmapY=y+buttonShadowThickness(); copyPixmap(display(),expanded==MSTrue?expandedButtonPixmap():collapsedButtonPixmap(), window_,pixmapgc().gc(),pixmapX,pixmapY); if (buttonShadowThickness()>0) { drawBevel(window_, MSRect(x,y,pixmapWidth+buttonShadowThickness()*2, pixmapHeight+buttonShadowThickness()*2), buttonShadowStyle(),buttonShadowThickness()); } x+=bWidth; } else if (drawLine) { XDrawLine(display(),window_,linegc().gc(),x,midY,x+bWidth+rowHorizontalSpacing(),midY); x+=bWidth+rowHorizontalSpacing(); } else if (showRootNode()==MSFalse||level>0) x+=bWidth+rowHorizontalSpacing(); } x+=rowHorizontalSpacing(); y=y_; if (isSelected(node_->modelCursor())==MSTrue) drawPixmaps(window_,selectedPixmap(node_),x,y); else if (isSensitive(node_)==MSTrue) drawPixmaps(window_,pixmap(node_),x,y); else drawPixmaps(window_,insensitivePixmap(node_),x,y); if (tabSpacing()>0) drawTabbedString(window_,node_,x,y); else drawString(window_,node_,x,y); } template void MSTreeListView::drawString(Window window_,const ManagedInfo &node_,int x_,int y_) { MSString buffer; formatOutput(buffer,node_->modelCursor()); if (buffer.length()>0) { int tWidth=fontObject().textWidth(buffer); int tHeight=fontObject().textHeight(); int offset=selectedHighlightThickness()+highlightGap(); int offset2=offset*2; if (isSelected(node_->modelCursor())==MSTrue) { gc().foreground(selectedRowBackground()); int y=y_+(maxRowHeight()-tHeight-offset2)/2; if (hasFocus()==MSTrue) { gc().lineWidth(selectedHighlightThickness()); XDrawRectangle(display(),window_,gc().gc(),x_,y,tWidth+offset2-1,tHeight+offset2-1); gc().lineWidth(1); } x_+=offset; XFillRectangle(display(),window_,gc().gc(),x_,y+offset,tWidth,tHeight); gc().foreground(selectedRowForeground()); } else { x_+=offset; gc().foreground(nodeForeground(node_)); } MSBoolean nodeSensitive=isSensitive(node_); if (nodeSensitive==MSTrue) gc().fillStyle(FillSolid); else gc().fillStyle(FillStippled); int y=y_+(maxRowHeight()-tHeight-offset2)/2+fontObject().textAscent()+offset; XDrawString(display(),window_,gc().gc(),fontObject().fontStruct(),x_,y,buffer,buffer.length()); //Reset the fillStyle if (nodeSensitive==MSFalse) gc().fillStyle(FillSolid); } } template void MSTreeListView::drawTabbedString(Window window_,const ManagedInfo &node_,int x_,int y_) { MSString buffer; formatOutput(buffer,node_->modelCursor()); if (buffer.length()>0) { buffer.change('\t','\n'); MSStringVector strings(buffer); if (strings.length()>0) { int tWidth=0; int tHeight=fontObject().textHeight(); int tps=tabPixelSpacing(); int offset=selectedHighlightThickness()+highlightGap(); int offset2=offset*2; unsigned i; if (isSelected(node_->modelCursor())==MSTrue) { if (strings.length()>1) { tWidth=maxWidths()(0)+tps-x_-hsb()->value(); unsigned len=strings.length()-1; for (i=1;ivalue(); XDrawString(display(),window_,gc().gc(),fontObject().fontStruct(),x,y,text,text.length()); } //Reset the fillStyle if (nodeSensitive==MSFalse) gc().fillStyle(FillSolid); } } } template void MSTreeListView::drawPixmaps(Window window_,const PixmapList &pixmapList_,int &x_,int &y_) { unsigned long nElements=pixmapList_.length(); for (unsigned long i=0;i void MSTreeListView::naturalSize(void) { setGeometryDefaults(); resetFirstRowColumn(); adjustSize(); } template MSBoolean MSTreeListView::isSensitive(const NodeInfo *nodeInfo_) { return nodeInfo_->sensitive(); } template MSBoolean MSTreeListView::isExpandable(const NodeInfo *nodeInfo_) { return nodeInfo_->expandable(); } template MSBoolean MSTreeListView::isExpanded(const NodeInfo *nodeInfo_) { if (nodeInfo_->expandable()==MSFalse) return MSFalse; else return nodeInfo_->expandedState(); } template MSBoolean MSTreeListView::isNodeProtected(const NodeInfo *) { return isProtected();} template const MSTreeListView::PixmapList &MSTreeListView::pixmap(const NodeInfo *nodeInfo_) { return nodeInfo_->pixmap(); } template const MSTreeListView::PixmapList &MSTreeListView::selectedPixmap(const NodeInfo *nodeInfo_) { return nodeInfo_->selectedPixmap(); } template const MSTreeListView::PixmapList &MSTreeListView::insensitivePixmap(const NodeInfo *nodeInfo_) { return nodeInfo_->insensitivePixmap(); } template unsigned long MSTreeListView::nodeForeground(const NodeInfo *) { return foreground(); } template const char *MSTreeListView::formatOutput(MSString &buffer_,TreeModelCursor &cursor_) { if (cursor_.isValid()) msTreeFormatType(elementForOps(modelTree().elementAt(cursor_)),buffer_); return buffer_.string(); } template MSBoolean MSTreeListView::validate(TreeModelCursor &cursor_,const char *pString_) { if (msTreeSetType(elementForOps(modelTree().elementAt(cursor_)),pString_)==MSError::MSSuccess) return MSTrue; else return MSFalse; } template void MSTreeListView::configure(void) { _redrawPixmap->resize(width(),height()); if (firstMap()==MSTrue&&frozen()==MSFalse) { int border=shadowThickness()*2+highlightThickness()*2; int requiredWidth=maxRowWidth()+border; int requiredHeight=numRows()*maxRowHeight()+border; if (width()>=requiredWidth) hsb()->hide(); else { hsb()->show(); requiredHeight+=hsb()->height(); } if (height()>=requiredHeight) vsb()->hide(); else { vsb()->show(); if (hsb()->mapped()==MSFalse) { requiredWidth+=vsb()->width(); if (width()show(); } } adjustRowColumn(); adjustFirstRow(); adjustFirstColumn(); updateHsb(); updateVsb(); if (vsb()->mapped()==MSTrue&&hsb()->mapped()==MSTrue) { clipWindow()->resize(vsb()->width(),hsb()->height()); clipWindow()->moveTo(hsb()->x()+hsb()->width(),vsb()->y()+vsb()->height()); clipWindow()->show(); } else clipWindow()->hide(); } } template void MSTreeListView::adjustRowColumn(void) { int border=highlightThickness()*2+shadowThickness()*2; int viewableWidth=width()-border; viewableWidth-=(vsb()->mapped()==MSTrue)?vsb()->width():0; int viewableHeight=height()-border; viewableHeight-=(hsb()->mapped()==MSTrue)?hsb()->height():0; int maxRH=(maxRowHeight()>0)? maxRowHeight(): fontObject().textHeight()+selectedHighlightThickness()*2+highlightGap()*2; _rows=viewableHeight/maxRH; _columns=viewableWidth/fontObject().charWidth(); } template void MSTreeListView::adjustFirstRow(void) { if (firstRow()<0||vsb()->mapped()==MSFalse) _firstRow=0; else { if (firstRow()+rows()>numRows()) { if (numRows()<=rows()) _firstRow=0; else _firstRow=numRows()-rows(); } } vsb()->valueChange(firstRow()); } template void MSTreeListView::adjustFirstColumn(void) { if (hsb()->mapped()==MSTrue) { int viewSize=width()-highlightThickness()*2-shadowThickness()*2; if (hsb()->value()+viewSize>maxRowWidth()) { if (viewSize<=maxRowWidth()) hsb()->valueChange(0); else hsb()->valueChange(maxRowWidth()-viewSize); } } else hsb()->valueChange(0); } template void MSTreeListView::adjustLevels(void) { ResourceTreeCursor resourceCursor(resourceTree()); for (resourceTree().setToFirst(resourceCursor,MSPreorder); resourceCursor.isValid(); resourceTree().setToNext(resourceCursor,MSPreorder)) { ManagedInfo &info=resourceTree().elementAt(resourceCursor); if (showRootNode()==MSTrue) info->level(info->level()+1); else info->level(info->level()-1); } } template void MSTreeListView::adjustSize(void) { int oldMaxRW=maxRowWidth(); int oldMaxRH=maxRowHeight(); computeMaxRowSize(); if (oldMaxRW!=maxRowWidth()||oldMaxRH!=maxRowHeight()) computeSize(); else redrawImmediately(); } template void MSTreeListView::adjustView(void) { computeMaxRowSize(); configure(); redrawImmediately(); } template MSBoolean MSTreeListView::locateSelectedNode(ResourceTreeCursor resourceCursor_) { if (_selectedNode!=0&&resourceCursor_.isValid()) { ManagedInfo &info=resourceTree().elementAt(resourceCursor_); if (info->modelCursor()==*_selectedNode) return MSTrue; else { for (resourceCursor_.setToFirstExistingChild();resourceCursor_.isValid();resourceCursor_.setToNextExistingChild()) { if (locateSelectedNode(resourceCursor_)==MSTrue) return MSTrue; } return MSFalse; } } else return MSFalse; } // computeSize() assumes _maxRowWidth and _maxRowHeight are properly set template void MSTreeListView::computeSize(void) { if (firstMap()==MSTrue) { int border=shadowThickness()*2+highlightThickness()*2; int requiredRows=numRows(); int requiredColumns=maxRowWidth()/fontObject().charWidth(); int w=columns()*fontObject().charWidth()+border; if (rows()width(); int maxRH=(maxRowHeight()>0)? maxRowHeight(): fontObject().textHeight()+selectedHighlightThickness()*2+highlightGap()*2; int h=rows()*maxRH+border; if (columns()height(); if (width()!=w||height()!=h) { resize(w,h); } else { configure(); redrawImmediately(); } } } template void MSTreeListView::updateHsb(void) { if (hsb()->mapped()==MSTrue) { int w=(vsb()->mapped()==MSTrue)?width()-vsb()->width()-highlightThickness()*2:width()-highlightThickness()*2; w=(w>0)?w:1; hsb()->width(w); hsb()->moveTo(highlightThickness(),height()-highlightThickness()-hsb()->height()); hsb()->max(maxRowWidth()); int viewSize=width()-highlightThickness()*2-shadowThickness()*2; if (vsb()->mapped()==MSTrue) viewSize-=vsb()->width(); hsb()->viewSize(viewSize); hsb()->pageInc(viewSize); } } template void MSTreeListView::updateVsb(void) { if (vsb()->mapped()==MSTrue) { int h=(hsb()->mapped()==MSTrue)?height()-hsb()->height()-highlightThickness()*2:height()-highlightThickness()*2; h=(h>0)?h:1; vsb()->height(h); vsb()->moveTo(width()-highlightThickness()-vsb()->width(),highlightThickness()); vsb()->max(numRows()); vsb()->viewSize(rows()); vsb()->pageInc(rows()-1); } } template void MSTreeListView::vsbChanged(void) { if(editor()->mapped()==MSTrue) editorActivate(); if(editor()->mapped()==MSFalse) firstRow(vsb()->value()); else vsb()->valueChange(firstRow()); } template void MSTreeListView::hsbChanged(void) { if(editor()->mapped()==MSTrue) editorActivate(); if(editor()->mapped()==MSFalse) redrawImmediately(); } // Pre-condition for this method is that screenVector() is already populated. template void MSTreeListView::computeMaxRowSize(void) { maxRowHeight(0); maxRowWidth(0); tabStops().removeAll(); maxWidths().removeAll(); int maxHeight=0; if (numRows()!=0) { ScreenVectorCursor cursor(screenVector()); for (cursor.setToFirst();cursor.isValid();cursor.setToNext()) { ResourceTreeCursor &resourceCursor=screenVector().elementAt(cursor); const ManagedInfo &node=resourceTree().elementAt(resourceCursor); calculateRowSize(node,maxWidths(),maxHeight); } maxRowHeight(maxHeight); int maxWidth=0; if (maxWidths().length()>0) { int tps=tabPixelSpacing(); int tabstoplen=maxWidths().length()-1; for (unsigned i=0;i void MSTreeListView::computeMaxRowSize(ScreenVectorCursor &start_,ScreenVectorCursor &end_) { tabStops().removeAll(); int maxHeight=maxRowHeight(); while (start_.isValid()) { ResourceTreeCursor &resourceCursor=screenVector().elementAt(start_); ManagedInfo &node=resourceTree().elementAt(resourceCursor); calculateRowSize(node,maxWidths(),maxHeight); if (end_.isValid()&&start_==end_) start_.invalidate(); else start_.setToNext(); } maxRowHeight(maxHeight); int maxWidth=0; if (maxWidths().length()>0) { int tps=tabPixelSpacing(); int tabstoplen=maxWidths().length()-1; for (unsigned i=0;i void MSTreeListView::calculateRowSize(const ManagedInfo &node_, MSIntVector &maxWidths_, int &maxHeight_) { // Each row can be consisted of one to three items along with the connecting lines. // The items are Collapsed/Expanded Pixmap, item pixmap, and item label. Each item is // padded on either side by "rowHorizontalSpacing" number of pixels. int pixmapHeight=0,pixmapWidth=0; int items=0; int h=0; // We always use the Collapsed pixmap for the calculation of the button // if the Collapsed and the Expanded pixmap are different in size..., // well life is tough, isn't it? if (buttonHeight()>0) { items++; h=buttonHeight(); } // Calculate the maximum pixmap width and height int pw=0,ph=0; calculatePixmapSize(pixmap(node_),pw,ph); pixmapHeight=(ph>pixmapHeight)?ph:pixmapHeight; pixmapWidth=(pw>pixmapWidth)?pw:pixmapWidth; calculatePixmapSize(insensitivePixmap(node_),pw,ph); pixmapHeight=(ph>pixmapHeight)?ph:pixmapHeight; pixmapWidth=(pw>pixmapWidth)?pw:pixmapWidth; calculatePixmapSize(selectedPixmap(node_),pw,ph); pixmapHeight=(ph>pixmapHeight)?ph:pixmapHeight; pixmapWidth=(pw>pixmapWidth)?pw:pixmapWidth; if (pixmapWidth>0) { items++; h=(pixmapHeight>h)?pixmapHeight:h; } int level=node_->level(); level=(level>0)?level:0; // Calculate the text width and height MSString buffer; formatOutput(buffer,node_->modelCursor()); if (buffer.length()>0) { items+=2; //If text output is non-empty, add 2 to number of items // Only do this expensive algorithm for tabs if tab spacing is greater than zero if (tabSpacing()>0) { buffer.change('\t','\n'); MSStringVector strings(buffer); int firstSegmentWidth=buttonWidth()+pixmapWidth+fontObject().textWidth(strings(0)) +items*rowHorizontalSpacing()+level*levelOffset(); if (maxWidths_.length()>0) maxWidths_[0]=(firstSegmentWidth>maxWidths_(0))?firstSegmentWidth:maxWidths_(0); else maxWidths_<i) maxWidths_[i]=(textWidth>maxWidths_(i))?textWidth:maxWidths_(i); else maxWidths_<0) maxWidths_[0]=(firstSegmentWidth>maxWidths_(0))?firstSegmentWidth:maxWidths_(0); else maxWidths_<h)?textHeight:h; } else { items++; int firstSegmentWidth=buttonWidth()+pixmapWidth+items*rowHorizontalSpacing()+level*levelOffset(); if (maxWidths_.length()>0) maxWidths_[0]=(firstSegmentWidth>maxWidths_(0))?firstSegmentWidth:maxWidths_(0); else maxWidths_<maxHeight_)?h:maxHeight_; } template void MSTreeListView::calculatePixmapSize(const PixmapList &pixmapList_, int &w_,int &h_) { w_=h_=0; unsigned long nElements=pixmapList_.length(); for (unsigned long i=0;ih_)?pHeight:h_; } } template void MSTreeListView::firstMapNotify(void) { if (MSView::model()!=0) rebuildScreen(MSTrue); } template void MSTreeListView::focusIn(void) { hasFocus(MSTrue); highlight(); if (editor()->mapped()==MSTrue) takeFocusNotify(editor()); else if (_selectedNode!=0) updateRow(*_selectedNode); } template void MSTreeListView::focusOut(void) { hasFocus(MSFalse); unHighlight(); if (editor()->mapped()==MSTrue) loseFocusNotify(editor()); else if (_selectedNode!=0) updateRow(*_selectedNode); } template void MSTreeListView::receiveEvent(MSEvent &event_) { if (event_.type()==TreeEvent::symbol()) { TreeEvent &treeEvent=(TreeEvent &)event_; switch (treeEvent.treeEventType()) { case MSObservableTreeInsert: case MSObservableTreeReplace: processReshapeEvent(treeEvent); break; case MSObservableTreeDelete: processDeleteEvent(treeEvent); break; case MSObservableTreeCopy: processCopyEvent(treeEvent); break; case MSObservableTreeAssign: processAssignEvent(treeEvent); break; case MSObservableTreePermute: processPermuteEvent(treeEvent); break; } } else if (event_.type()==MSNullEvent::symbol()) { updateData(); } } template void MSTreeListView::updateData(void) { screenVector().removeAll(); resourceTree().removeAll(); resetFirstRowColumn(); resetSelectedNode(); if (firstMap()==MSTrue) rebuildScreen(MSFalse); } template void MSTreeListView::resetFirstRowColumn(void) { _firstRow=0; vsb()->valueChange(0); hsb()->valueChange(0); } template void MSTreeListView::resetSelectedNode(void) { if (_selectedNode!=0) { delete _selectedNode; _selectedNode=0; } } template int MSTreeListView::branchLength(void) { int loffset=levelOffset(); int indent=buttonWidth()/2; indent=(indent>0)?indent:fontObject().charWidth()/2; int len=loffset-indent-rowHorizontalSpacing(); return (len>0)?len:0; } template int MSTreeListView::rowFromY(int y_) { y_-=(highlightThickness()+shadowThickness()); if (y_>0&&maxRowHeight()>0) { int row=y_/maxRowHeight(); row+=firstRow(); return (row MSTreeListView::ResourceTreeCursor MSTreeListView::findResourceCursor(const TreeModelCursor &modelCursor_) const { ResourceTreeCursor resourceCursor(resourceTree()); for (resourceTree().setToFirst(resourceCursor,MSPreorder); resourceCursor.isValid(); resourceTree().setToNext(resourceCursor,MSPreorder)) { const ManagedInfo &info=resourceTree().elementAt(resourceCursor); if (info->modelCursor()==modelCursor_) break; } return resourceCursor; } template MSTreeListView::ScreenVectorCursor MSTreeListView::findScreenCursor(const ResourceTreeCursor &resourceCursor_,unsigned long &pos_) const { ScreenVectorCursor screenCursor(screenVector()); pos_=0; for (screenCursor.setToFirst();screenCursor.isValid();screenCursor.setToNext()) { pos_++; const ResourceTreeCursor &rCursor=screenVector().elementAt(screenCursor); if (((ResourceTreeCursor&)rCursor)==resourceCursor_) break; } return screenCursor; } template void MSTreeListView::keyPress(const XEvent *pEvent_,KeySym keySym_, unsigned int state_,const char *pString_) { MSKeyPress keyPress(keySym_, state_); if (MSWidget::sensitive()==MSTrue&&keyTranslate(keyPress)==MSFalse) { if(editor()->mapped()==MSTrue) keyPressNotify(editor(),pEvent_,keySym_,state_,pString_); else { switch(keySym_) { case XK_Up: up(); break; case XK_Down: down(); break; case XK_Left: left(); break; case XK_Right: right(); break; case XK_Home: case XK_F27: home(); break; case XK_End: case XK_F33: end(); break; case XK_Prior: case XK_F29: pageUp(); break; case XK_Next: case XK_F35: pageDown(); break; case XK_Return: case XK_KP_Enter: returnKey(); break; case XK_plus: case XK_KP_Add: if(_selectedNode!=0) { MSBoolean state= expandedState(*_selectedNode); if(state == MSFalse) expandedState(*_selectedNode,MSTrue); } break; case XK_KP_Subtract: case XK_F24: case XK_minus: if(_selectedNode!=0) { MSBoolean state= expandedState(*_selectedNode); if(state == MSTrue) expandedState(*_selectedNode,MSFalse); } break; default: { TreeModelCursor selectedCursor(selectedNode()); ResourceTreeCursor resourceCursor=findResourceCursor(selectedCursor); if (resourceCursor.isValid()) { ManagedInfo &info=resourceTree().elementAt(resourceCursor); if(isNodeProtected(info) == MSFalse) { if (keySym_==XK_BackSpace) { editor()->string(""); mapEditor(); } else if (keySym_==XK_Insert) { MSString string; formatOutput(string,selectedCursor); editor()->string(string); editor()->editMode(MSTextField::InsertMode); mapEditor(); } else if (strlen(pString_)>0) { editor()->string(""); keyPressNotify(editor(),pEvent_,keySym_,state_,pString_); if (editor()->length()>0) mapEditor(); } } } } } } } } template void MSTreeListView::up(void) { if( screenVector().isEmpty()==False) { unsigned long pos; ScreenVectorCursor screenCursor=nextUpScreenCursor(pos); if (screenCursor.isValid()) { ResourceTreeCursor resourceCursor=screenVector().elementAt(screenCursor); ManagedInfo &info=resourceTree().elementAt(resourceCursor); selectedNode(info->modelCursor()); int row=pos-1; if (row=firstRow()+rows()) { firstRow(row-rows()+1); } nodeSelectionNotify(); } } } template void MSTreeListView::down(void) { if( screenVector().isEmpty()==False) { unsigned long pos; ScreenVectorCursor screenCursor=nextDownScreenCursor(pos); if (screenCursor.isValid()) { ResourceTreeCursor resourceCursor=screenVector().elementAt(screenCursor); ManagedInfo &info=resourceTree().elementAt(resourceCursor); selectedNode(info->modelCursor()); int row=pos-1; if (row=firstRow()+rows()) { firstRow(row-rows()+1); } nodeSelectionNotify(); } } } template void MSTreeListView::left(void) { if (hsb()->mapped()==MSTrue) { if (hsb()->value()>hsb()->min()) { int newValue=hsb()->value()-fontObject().charWidth(); newValue=(newValue>hsb()->min())?newValue:hsb()->min(); hsb()->value(newValue); } } } template void MSTreeListView::right(void) { if (hsb()->mapped()==MSTrue) { if (hsb()->value()max()) { int newValue=hsb()->value()+fontObject().charWidth(); newValue=(newValuemax())?newValue:hsb()->max(); hsb()->value(newValue); } } } template void MSTreeListView::home(void) { int nRows=numRows(); if (nRows!=0) { firstRow(0); const ResourceTreeCursor &resourceCursor=screenVector().elementAtPosition(1); const ManagedInfo &info=resourceTree().elementAt(resourceCursor); if (_selectedNode==0||info->modelCursor()!=selectedNode()) { selectedNode(info->modelCursor()); nodeSelectionNotify(); } } } template void MSTreeListView::end(void) { int nRows=numRows(); if (nRows!=0) { firstRow(numRows()-rows()); const ResourceTreeCursor &resourceCursor=screenVector().elementAtPosition(nRows); const ManagedInfo &info=resourceTree().elementAt(resourceCursor); if (_selectedNode==0||info->modelCursor()!=selectedNode()) { selectedNode(info->modelCursor()); nodeSelectionNotify(); } } } template void MSTreeListView::pageUp(void) { int nRows=numRows(); if (nRows!=0&&nRows>rows()) { firstRow(firstRow()-(rows()-1)); const ResourceTreeCursor &resourceCursor=screenVector().elementAtPosition(firstRow()+rows()); const ManagedInfo &info=resourceTree().elementAt(resourceCursor); if (_selectedNode==0||info->modelCursor()!=selectedNode()) { selectedNode(info->modelCursor()); nodeSelectionNotify(); } } } template void MSTreeListView::pageDown(void) { int nRows=numRows(); if (nRows!=0&&nRows>rows()) { firstRow(firstRow()+(rows()-1)); const ResourceTreeCursor &resourceCursor=screenVector().elementAtPosition(firstRow()+1); const ManagedInfo &info=resourceTree().elementAt(resourceCursor); if (_selectedNode==0||info->modelCursor()!=selectedNode()) { selectedNode(info->modelCursor()); nodeSelectionNotify(); } } } template void MSTreeListView::returnKey(void) { if (_selectedNode!=0) doubleClickNotify(); } template MSTreeListView::ScreenVectorCursor MSTreeListView::nextUpScreenCursor(unsigned long &pos_) { ScreenVectorCursor screenCursor(screenVector()); if (screenVector().isEmpty()==False) { if (_selectedNode==0) { screenCursor.setToLast(); pos_=screenVector().numberOfElements(); } else { pos_=0; for (screenVector().setToFirst(screenCursor);screenCursor.isValid();screenVector().setToNext(screenCursor)) { ResourceTreeCursor &resourceCursor=screenVector().elementAt(screenCursor); ManagedInfo &info=resourceTree().elementAt(resourceCursor); if (info->modelCursor()==*_selectedNode) { if (screenVector().isFirst(screenCursor)==False) screenCursor.setToPrevious(); else screenCursor.invalidate(); break; } else pos_++; } } for (;screenCursor.isValid();screenVector().setToPrevious(screenCursor)) { ResourceTreeCursor resourceCursor=screenVector().elementAt(screenCursor); ManagedInfo &info=resourceTree().elementAt(resourceCursor); if (info->sensitive()==MSTrue) break; else pos_--; } } return screenCursor; } template MSTreeListView::ScreenVectorCursor MSTreeListView::nextDownScreenCursor(unsigned long &pos_) { ScreenVectorCursor screenCursor(screenVector()); if (screenVector().isEmpty()==False) { if (_selectedNode==0) { screenCursor.setToFirst(); pos_=1; } else { pos_=1; for (screenVector().setToFirst(screenCursor);screenCursor.isValid();screenVector().setToNext(screenCursor)) { ResourceTreeCursor &resourceCursor=screenVector().elementAt(screenCursor); ManagedInfo &info=resourceTree().elementAt(resourceCursor); if (info->modelCursor()==*_selectedNode) { if (screenVector().isLast(screenCursor)==False) screenCursor.setToNext(); else screenCursor.invalidate(); break; } else pos_++; } } for (;screenCursor.isValid();screenVector().setToNext(screenCursor)) { pos_++; ResourceTreeCursor resourceCursor=screenVector().elementAt(screenCursor); ManagedInfo &info=resourceTree().elementAt(resourceCursor); if (info->sensitive()==MSTrue) break; } } return screenCursor; } template void MSTreeListView::buttonPress(const XEvent *event_) { if (MSWidget::sensitive()==MSTrue) { if (acceptFocus()==MSFalse||traverseFocus(this)==MSTrue) { if (editor()->mapped()==MSTrue) { editorActivate(); } if (editor()->mapped()==MSFalse) { buttonPressNotify(this,event_); } } } } template void MSTreeListView::button1Press(const XEvent *event_) { int row=rowFromY(event_->xbutton.y); if (row!=-1) { unsigned long position=row+1; ScreenVectorCursor cursor(screenVector()); screenVector().setToPosition(position,cursor); ResourceTreeCursor &resourceCursor=screenVector().elementAt(cursor); ManagedInfo &info=resourceTree().elementAt(resourceCursor); if (isSensitive(info)==MSTrue) { if (labelSelected(info,event_->xbutton.x,event_->xbutton.y)==MSTrue) { if (isSelected(info->modelCursor())==MSTrue) { if (isDoubleClick(event_)==MSTrue) doubleClickNotify(); } else { eventTime(event_->xbutton.time); selectedNode(info->modelCursor()); nodeSelectionNotify(); } } else if (showButtons()==MSTrue&&isExpandable(info)==MSTrue) { if (buttonSelected(info,event_->xbutton.x,event_->xbutton.y)==MSTrue) { TreeModelCursor activatedCursor=info->modelCursor(); _activatedNode=&activatedCursor; if (isExpanded(info)==MSTrue) { info->expandedState(MSFalse); collapseSubTree(cursor,position); subTreeCollapsed(info); } else { info->expandedState(MSTrue); expandSubTree(cursor,position); subTreeExpanded(info); } } } } } } template void MSTreeListView::button2Press(const XEvent *event_) { int row=rowFromY(event_->xbutton.y); if (row!=-1) { unsigned long position=row+1; ScreenVectorCursor cursor(screenVector()); screenVector().setToPosition(position,cursor); ResourceTreeCursor &resourceCursor=screenVector().elementAt(cursor); ManagedInfo &info=resourceTree().elementAt(resourceCursor); if (isSensitive(info)==MSTrue) { if (labelSelected(info,event_->xbutton.x,event_->xbutton.y)==MSTrue) { if (isSelected(info->modelCursor())==MSFalse) { eventTime(event_->xbutton.time); selectedNode(info->modelCursor()); nodeSelectionNotify(); } button2SelectionNotify(); } } } } template void MSTreeListView::button3Press(const XEvent *event_) { int row=rowFromY(event_->xbutton.y); if (row!=-1) { unsigned long position=row+1; ScreenVectorCursor cursor(screenVector()); screenVector().setToPosition(position,cursor); ResourceTreeCursor &resourceCursor=screenVector().elementAt(cursor); ManagedInfo &info=resourceTree().elementAt(resourceCursor); if (isSensitive(info)==MSTrue) { if (labelSelected(info,event_->xbutton.x,event_->xbutton.y)==MSTrue) { if (isSelected(info->modelCursor())==MSFalse) { eventTime(event_->xbutton.time); selectedNode(info->modelCursor()); nodeSelectionNotify(); } button3SelectionNotify(); } } } } template MSBoolean MSTreeListView::buttonSelected(ManagedInfo &info_,int x_,int) { x_+=hsb()->value(); int level=info_->level(); int left=level*levelOffset()+highlightThickness()+shadowThickness()+rowHorizontalSpacing(); if (x_>=left) { if (x_ MSBoolean MSTreeListView::labelSelected(ManagedInfo &info_,int x_,int) { x_+=hsb()->value(); int bWidth=buttonWidth(); int rhs=(bWidth>0)?rowHorizontalSpacing()*2:rowHorizontalSpacing(); int level=info_->level(); int left=level*levelOffset()+bWidth+rhs+highlightThickness()+shadowThickness(); if (x_>=left) return MSTrue; else return MSFalse; } template MSBoolean MSTreeListView::isSelected(TreeModelCursor &_modelCursor) { if (_selectedNode==0) return MSFalse; else return (*_selectedNode==_modelCursor)?MSTrue:MSFalse; } template MSBoolean MSTreeListView::isRowOnScreen(int row_) { int lastRow=firstRow()+rows(); if (row_>=firstRow()&&row_<=lastRow) return MSTrue; else return MSFalse; } template void MSTreeListView::subTreeCollapsed(ManagedInfo &info_) { TreeModelCursor activatedCursor=info_->modelCursor(); _activatedNode=&activatedCursor; subTreeCollapsedNotify(); _activatedNode=0; } template void MSTreeListView::subTreeExpanded(ManagedInfo &info_) { TreeModelCursor activatedCursor=info_->modelCursor(); _activatedNode=&activatedCursor; subTreeExpandedNotify(); _activatedNode=0; } template void MSTreeListView::subTreeCollapsedNotify(void) { activateCallback(MSWidgetCallback::subtreecollapsed); } template void MSTreeListView::subTreeExpandedNotify(void) { activateCallback(MSWidgetCallback::subtreeexpanded); } template void MSTreeListView::doubleClickNotify(void) { activateCallback(MSWidgetCallback::doubleclick); } template void MSTreeListView::nodeSelectionNotify(void) { activateCallback(MSWidgetCallback::selection); } template void MSTreeListView::button2SelectionNotify(void) { activateCallback(MSWidgetCallback::button2selection);} template void MSTreeListView::button3SelectionNotify(void) { activateCallback(MSWidgetCallback::button3selection);} template void MSTreeListView::updateForeground(unsigned long oldFg_) { MSWidgetCommon::updateForeground(oldFg_); XSetForeground(display(),pixmapgc().gc(),foreground()); if (selectedRowBackground()==oldFg_&&selectedRowForeground()==background()) _selectedRowBackground=foreground(); hsb()->foreground(foreground()); vsb()->foreground(foreground()); clipWindow()->foreground(foreground()); redrawImmediately(); } template void MSTreeListView::updateBackground(unsigned long oldBg_) { MSWidgetCommon::updateBackground(oldBg_); XSetBackground(display(),pixmapgc().gc(),background()); if (selectedRowForeground()==oldBg_&&selectedRowBackground()==foreground()) _selectedRowForeground=background(); hsb()->background(background()); vsb()->background(background()); clipWindow()->background(background()); redrawImmediately(); } template void MSTreeListView::updateFont(Font font_) { MSWidgetCommon::updateFont(font_); fontObject().fontStruct(server()->fontStruct(font())); hsb()->inc(fontObject().charWidth()); gc().font(font()); editor()->font(font()); adjustView(); } template void MSTreeListView::levelOffset(int levelOffset_) { if (_levelOffset!=levelOffset_) { _levelOffset=levelOffset_; adjustView(); } } template void MSTreeListView::tabSpacing(int tabSpacing_) { if (_tabSpacing!=tabSpacing_) { _tabSpacing=tabSpacing_; adjustView(); } } template void MSTreeListView::showButtons(MSBoolean showButtons_) { if (_showButtons!=showButtons_) { _showButtons=showButtons_; adjustView(); } } template void MSTreeListView::showLines(MSBoolean showLines_) { if (_showLines!=showLines_) { _showLines=showLines_; redrawImmediately(); } } template void MSTreeListView::showRootNode(MSBoolean showRootNode_) { if (_showRootNode!=showRootNode_) { _showRootNode=showRootNode_; adjustLevels(); buildScreenVector(); adjustView(); } } template void MSTreeListView::lineForeground(const char *color_) { lineForeground(server()->pixel(color_)); } template void MSTreeListView::lineForeground(unsigned long lineForeground_) { static char MSTreeListView_dash_bits[] = { 0xc7, 0x01, 0xc7, 0x01, 0xc7, 0x01, 0x38, 0x0e, 0x38, 0x0e, 0x38, 0x0e, 0xc7, 0x01, 0xc7, 0x01, 0xc7, 0x01, 0x38, 0x0e, 0x38, 0x0e, 0x38, 0x0e}; if (_lineForeground!=lineForeground_) { _lineForeground=lineForeground_; if (dotPixmap()!=0) { delete _dotPixmap; _dotPixmap=0; if (lineStyle()==MSDot) { _dotPixmap=new MSPixmap(server(),MSPixmap::ForegroundFiftyPixmap,lineForeground(),background()); linegc().tile(dotPixmap()->pixmap()); } } if (dashPixmap()!=0) { delete _dashPixmap; _dashPixmap=0; if (lineStyle()==MSDash) { _dashPixmap=new MSPixmap(server(),MSTreeListViewDashPixmapName, MSTreeListView_dash_bits, MSTreeListView_dash_width, MSTreeListView_dash_height, lineForeground(),background()); linegc().tile(dashPixmap()->pixmap()); } } linegc().foreground(lineForeground()); redrawImmediately(); } } template void MSTreeListView::lineStyle(MSLineStyle lineStyle_) { static char MSTreeListView_dash_bits[] = { 0xc7, 0x01, 0xc7, 0x01, 0xc7, 0x01, 0x38, 0x0e, 0x38, 0x0e, 0x38, 0x0e, 0xc7, 0x01, 0xc7, 0x01, 0xc7, 0x01, 0x38, 0x0e, 0x38, 0x0e, 0x38, 0x0e}; if (_lineStyle!=lineStyle_) { _lineStyle=lineStyle_; if (lineStyle()==MSDot) { if (dotPixmap()==0) { _dotPixmap=new MSPixmap(server(),MSPixmap::ForegroundFiftyPixmap,lineForeground(),background()); } linegc().tile(dotPixmap()->pixmap()); linegc().fillStyle(FillTiled); } else if (lineStyle()==MSDash) { if (dashPixmap()==0) { _dashPixmap=new MSPixmap(server(),MSTreeListViewDashPixmapName, MSTreeListView_dash_bits, MSTreeListView_dash_width, MSTreeListView_dash_height, lineForeground(),background()); } linegc().tile(dashPixmap()->pixmap()); linegc().fillStyle(FillTiled); } else linegc().fillStyle(FillSolid); if (showLines()==MSTrue) redrawImmediately(); } } template void MSTreeListView::selectedRowForeground(const char *color_) { selectedRowForeground(server()->pixel(color_)); } template void MSTreeListView::selectedRowForeground(unsigned long selectedRowForeground_) { if (_selectedRowForeground!=selectedRowForeground_) { _selectedRowForeground=selectedRowForeground_; redrawImmediately(); } } template void MSTreeListView::selectedRowBackground(const char *color_) { selectedRowBackground(server()->pixel(color_)); } template void MSTreeListView::selectedRowBackground(unsigned long selectedRowBackground_) { if (_selectedRowBackground!=selectedRowBackground_) { _selectedRowBackground=selectedRowBackground_; redrawImmediately(); } } template int MSTreeListView::buttonWidth(void) const { if (showButtons()==MSTrue) return collapsedButtonPixmap().width()+buttonShadowThickness()*2; else return 0; } template int MSTreeListView::buttonHeight(void) const { if (showButtons()==MSTrue) return collapsedButtonPixmap().height()+buttonShadowThickness()*2; else return 0; } template int MSTreeListView::numRows(void) const { return screenVector().numberOfElements(); } template void MSTreeListView::useBackingStore(MSBoolean useBackingStore_) { if (_useBackingStore!=useBackingStore_) { _useBackingStore=useBackingStore_; if (useBackingStore()==MSTrue) { // if the server doesn't support backing store, then set the flag back to MSFalse if (DoesBackingStore(screen())!=NotUseful) backingStore(WhenMapped); else _useBackingStore=MSFalse; } else backingStore(NotUseful); } } #if !defined(MS_INLINE_TEMPLATE_NESTED_CLASS) template MSTreeListView::NodeAttribute::NodeAttribute(void) : _sensitive(MSTrue),_expandable(MSFalse),_expandedState(MSFalse) {} template MSTreeListView::NodeAttribute::~NodeAttribute(void) {} template MSTreeListView::NodeInfo::NodeInfo(const MSTreeListView *treeView_, const MSTreeListView::NodeAttribute &nodeAttribute_, MSTreeListView::TreeModelCursor &modelCursor_, NodeInfo *parent_,int level_) : _modelCursor(modelCursor_),_parent(parent_),_level(level_) { attribute(treeView_,nodeAttribute_); } template void MSTreeListView::NodeInfo::attribute(const MSTreeListView *treeView_, const MSTreeListView::NodeAttribute &nodeAttribute_) { sensitive(nodeAttribute_.sensitive()); expandable(nodeAttribute_.expandable()); expandedState(nodeAttribute_.expandedState()); buildPixmapList(treeView_->pixmapRegistry(),pixmap(),nodeAttribute_.pixmap()); buildPixmapList(treeView_->pixmapRegistry(),insensitivePixmap(),nodeAttribute_.insensitivePixmap()); buildPixmapList(treeView_->pixmapRegistry(),selectedPixmap(),nodeAttribute_.selectedPixmap()); } template MSTreeListView::NodeAttribute MSTreeListView::NodeInfo::attribute(void) const { MSTreeListView::NodeAttribute nodeAttribute; nodeAttribute.sensitive(sensitive()); nodeAttribute.expandable(expandable()); nodeAttribute.expandedState(expandedState()); MSStringVector names; unsigned long i,nElements; nElements=pixmap().length(); for (i=0;i MSTreeListView::NodeInfo::~NodeInfo(void) {} template MSBoolean MSTreeListView::NodeInfo::isLastChild(void) const { if (parent()==0) return MSTrue; else { TreeModelCursor parentCursor(parent()->modelCursor()); parentCursor.setToLastExistingChild(); if (parentCursor==modelCursor()) return MSTrue; else return MSFalse; } } template void MSTreeListView::NodeInfo::buildPixmapList(const MSTreeListView::PixmapRegistry &pixmapRegistry_, MSTreeListView::PixmapList &pixmapList_,const MSStringVector& pixmapNames_) { pixmapList_.removeAll(); PixmapRegistryCursor cursor(pixmapRegistry_); for (unsigned i=0;i void MSTreeListView::processReshapeEvent(TreeEvent &treeEvent_) { // If resourceTree hasn't been built yet, that means we haven't been mapped, so we can // safely defer the processing if (resourceTree().isEmpty()==False) { ScreenVectorCursor screenCursor(screenVector()); TreeModelCursor modelCursor(treeEvent_.cursor()); unsigned long pos=treeEvent_.position(); ResourceTreeCursor resourceCursor(resourceTree()); MSBoolean rebuild=MSFalse; MSBoolean needRedraw=MSFalse; //Traverse the resource tree under we find the parent node that the //insertion took place. for (resourceTree().setToFirst(resourceCursor,MSPreorder); resourceCursor.isValid(); resourceTree().setToNext(resourceCursor,MSPreorder)) { ManagedInfo &info=resourceTree().elementAt(resourceCursor); if (info->modelCursor()==modelCursor) { modelTree().setToChild(pos,modelCursor); NodeAttribute nodeAttr; nodeAttribute(modelCursor,nodeAttr); NodeInfo *newNode=new NodeInfo(this,nodeAttr,modelCursor,(NodeInfo*)info,info->level()+1); if (treeEvent_.treeEventType()==MSObservableTreeReplace) { ResourceTreeCursor replaceCursor(resourceCursor); replaceCursor.setToChild(pos); resourceTree().removeSubtree(replaceCursor); } resourceTree().addAsChild(resourceCursor,pos,ManagedInfo(newNode,MSInit)); resourceTree().setToChild(pos,resourceCursor); if (modelTree().isLeaf(modelCursor)==False) { updateResourceTree(resourceCursor,modelCursor); } nodeAttr=info->attribute(); MSBoolean nodeExpandable = isExpandable(info); nodeModified(info->modelCursor(),nodeAttr); info->attribute(this,nodeAttr); if (isExpanded(info)==MSTrue) rebuild=MSTrue; else if(isExpandable(info)!=nodeExpandable) needRedraw=MSTrue; break; } } if (frozen()==MSFalse) { if(rebuild==MSTrue) { buildScreenVector(); //Can be optimized adjustView(); } else if(needRedraw==MSTrue) redrawImmediately(); } } } template void MSTreeListView::processPermuteEvent(TreeEvent &treeEvent_) { // If resourceTree hasn't been built yet, that means we haven't been mapped, so we can // safely defer the processing if (resourceTree().isEmpty()==False) { ScreenVectorCursor screenCursor(screenVector()); TreeModelCursor modelCursor(treeEvent_.cursor()); const MSIndexVector& index=treeEvent_.index(); ResourceTreeCursor resourceCursor(resourceTree()); //Traverse the resource tree under we find the parent node that the //insertion took place. for (resourceTree().setToFirst(resourceCursor,MSPreorder); resourceCursor.isValid(); resourceTree().setToNext(resourceCursor,MSPreorder)) { ManagedInfo &info=resourceTree().elementAt(resourceCursor); if (info->modelCursor()==modelCursor) { resourceTree().permuteChildren(resourceCursor,index); break; } } if (frozen()==MSFalse) { buildScreenVector(); //Can be optimized adjustView(); } } } template void MSTreeListView::processDeleteEvent(TreeEvent &treeEvent_) { // If resourceTree hasn't been built yet, that means we haven't been mapped, so we can // safely defer the processing if (resourceTree().isEmpty()==False) { MSBoolean redrawNecessary=MSFalse; MSBoolean reconfigNecessary=MSFalse; MSBoolean checkParent=MSFalse; ResourceTreeCursor deleteCursor(resourceTree()); ResourceTreeCursor resourceCursor(resourceTree()); for (resourceTree().setToFirst(resourceCursor,MSPreorder); resourceCursor.isValid(); resourceTree().setToNext(resourceCursor,MSPreorder)) { const ManagedInfo &nodeInfo=resourceTree().elementAt(resourceCursor); if (nodeInfo->modelCursor()==treeEvent_.cursor()) { deleteCursor=resourceCursor; deleteCursor.setToChild(treeEvent_.position()); // We'll using two loops here for optimizatioin reason, the first // loop get us to the node to be deleted quickly, there second one // deleted all the necessary nodes ScreenVectorCursor screenCursor(screenVector()); unsigned long pos=1; for (screenCursor.setToFirst();screenCursor.isValid();screenCursor.setToNext()) { ResourceTreeCursor &rCursor=screenVector().elementAt(screenCursor); if (resourceCursor==rCursor) checkParent=MSTrue; if (screenVector().elementAt(screenCursor)==deleteCursor) { reconfigNecessary=MSTrue; redrawNecessary=MSTrue; const ManagedInfo &info=resourceTree().elementAt(deleteCursor); int level=info->level(); screenVector().removeAt(screenCursor); while (pos<=screenVector().numberOfElements()) { screenVector().setToPosition(pos,screenCursor); ResourceTreeCursor &rCursor=screenVector().elementAt(screenCursor); ManagedInfo &node=resourceTree().elementAt(rCursor); if (node->level()>level) screenVector().removeAt(screenCursor); else break; } break; } else pos++; } NodeAttribute nodeAttr=nodeInfo->attribute(); MSBoolean nodeExpandable = isExpandable(nodeInfo); nodeModified(nodeInfo->modelCursor(),nodeAttr); nodeInfo->attribute(this,nodeAttr); if(isExpandable(nodeInfo)!=nodeExpandable) redrawNecessary=MSTrue; break; } } if (locateSelectedNode(deleteCursor)==MSTrue) { redrawNecessary=MSTrue; resetSelectedNode(); } if (deleteCursor.isValid()) { resourceTree().removeSubtree(deleteCursor); } if (checkParent==MSTrue) { if (resourceTree().isLeaf(resourceCursor)) { ManagedInfo &info=resourceTree().elementAt(resourceCursor); info->expandedState(MSFalse); redrawNecessary=MSTrue; } } if (reconfigNecessary==MSTrue) configure(); if (redrawNecessary==MSTrue) redrawImmediately(); } } template void MSTreeListView::processCopyEvent(TreeEvent &) { updateData(); } template void MSTreeListView::processAssignEvent(TreeEvent &treeEvent_) { // If resourceTree hasn't been built yet, that means we haven't been mapped, so we can // safely defer the processing if (resourceTree().isEmpty()==False) { int row=0; ScreenVectorCursor screenCursor(screenVector()); for (screenCursor.setToFirst();screenCursor.isValid();screenCursor.setToNext()) { ResourceTreeCursor &resourceCursor=screenVector().elementAt(screenCursor); ManagedInfo &info=resourceTree().elementAt(resourceCursor); if (info->modelCursor()==treeEvent_.cursor()) { int maxWidth=maxRowWidth(); int maxHeight=maxRowHeight(); computeMaxRowSize(screenCursor,screenCursor); if (maxWidth!=maxRowWidth()||maxHeight!=maxRowHeight()) { configure(); redrawImmediately(); } else updateRow(info,row); break; } else row++; } } } template void MSTreeListView::reportError(const char *error_) const { MSMessageLog::warningMessage(error_); } template void MSTreeListView::set(MSAttrValueList& avList_) { MSWidgetCommon::set(avList_); MSIndexVector index; for (unsigned i=0;i MSAttrValueList& MSTreeListView::get(MSAttrValueList& avList_) { avList_<colorName(lineForeground()),MSAttrValue::Color); avList_<colorName(selectedRowForeground()),MSAttrValue::Color); avList_<colorName(selectedRowBackground()),MSAttrValue::Color); avList_< MSBoolean MSTreeListView::sensitive(void) const { return MSWidgetCommon::sensitive(); } template void MSTreeListView::sensitive(MSBoolean sensitive_) { MSWidgetCommon::sensitive(sensitive_); } template class MSTreeListViewDefaultIterator : public MSTreeListView::Iterator { protected: MSTreeListView::TreeModel &_treeModel; public: MSTreeListViewDefaultIterator(MSTreeListView::TreeModel &treeModel_) :_treeModel(treeModel_) {} virtual void nodeAttribute(const MSTreeListView::TreeModelCursor&, MSTreeListView::NodeAttribute &); }; template void MSTreeListViewDefaultIterator::nodeAttribute(const MSTreeListView::TreeModelCursor &cursor_, MSTreeListView::NodeAttribute &nodeAttr_) { if (_treeModel.isLeaf(cursor_)) { nodeAttr_.expandable(MSFalse); nodeAttr_.expandedState(MSFalse); } else { nodeAttr_.expandable(MSTrue); nodeAttr_.expandedState(MSTrue); } } template void MSTreeListView::setDefaultNodeAttributes(void) { if (MSView::model()!=0) { MSTreeListViewDefaultIterator iterator(modelTree()); setNodeAttributes(iterator); } } template void MSTreeListView::makeVisible(const TreeModelCursor &modelCursor_) { if (resourceTree().isEmpty()==True) buildResourceTreeAndScreenVector(); ResourceTreeCursor resourceCursor=findResourceCursor(modelCursor_); if (resourceCursor.isValid()) { MSBoolean redrawNeeded=MSFalse; while (resourceTree().setToParent(resourceCursor)) { ManagedInfo &info=resourceTree().elementAt(resourceCursor); if (info->expandedState()==MSFalse) { info->expandedState(MSTrue); redrawNeeded=MSTrue; } } if (redrawNeeded==MSTrue) { buildScreenVector(); adjustView(); } } } template MSBoolean MSTreeListView::isVisible(const TreeModelCursor &modelCursor_) const { // load the element tree if it hasn't been loaded. But since rebuildScreen // is not a const method, we need to cast away the const-ness. This is a work around // in order to preserve the const-ness of this method. if (resourceTree().isEmpty()==True) { MSTreeListView *myself=(MSTreeListView *)this; myself->buildResourceTreeAndScreenVector(); } ResourceTreeCursor resourceCursor=findResourceCursor(modelCursor_); if (resourceCursor.isValid()) { MSBoolean visible=MSTrue; while (resourceTree().setToParent(resourceCursor)) { const ManagedInfo &info=resourceTree().elementAt(resourceCursor); if (info->expandedState()==MSFalse || info->expandable()==MSFalse) { visible=MSFalse; break; } } return visible; } return MSFalse; } template void MSTreeListView::editorActivate(void) { TreeModelCursor selectedCursor (selectedNode()); if (selectedCursor.isValid()==True) { MSString currentString; formatOutput(currentString,selectedCursor); if (editor()->text()!=currentString) { if (validate(selectedCursor,editor()->string())==MSTrue) { editor()->unmap(); modelTree().elementChanged(selectedCursor); } else server()->bell(); } else editor()->unmap(); } } template void MSTreeListView::editorEscape(void) { loseFocusNotify(editor()); editor()->unmap(); } template void MSTreeListView::mapEditor(void) { TreeModelCursor selectedCursor (selectedNode()); if (selectedCursor.isValid()==True) { int row=0; ScreenVectorCursor screenCursor(screenVector()); for (screenCursor.setToFirst();screenCursor.isValid();screenCursor.setToNext()) { ResourceTreeCursor &resourceCursor=screenVector().elementAt(screenCursor); ManagedInfo &info=resourceTree().elementAt(resourceCursor); if (info->modelCursor()==selectedCursor) { int offset=highlightThickness()+shadowThickness(); int x=offset-hsb()->value(); int y=offset+maxRowHeight()*(row-firstRow()); /// int level=info->level(); int totalOffset=level*levelOffset(); x +=totalOffset+ 2*rowHorizontalSpacing()+buttonWidth(); const PixmapList& pixList=selectedPixmap(info); unsigned long nElements=pixList.length(); for (unsigned long i=0;imodelCursor()); int hOffset=2*(selectedHighlightThickness()+highlightGap())+2; int h=fontObject().textHeight()+hOffset; int w =fontObject().textWidth(buffer.string())+hOffset; w=(w>MSTreeListViewMinimumEditorWidth)?w:MSTreeListViewMinimumEditorWidth; editor()->moveTo(x,y); editor()->resize(w,h); editor()->foreground(background()); editor()->background(foreground()); editor()->map(); editor()->raise(); takeFocusNotify(editor()); } else row++; } } } template MSBoolean MSTreeListView::loseFocus(void) { if (editor()->mapped()==MSTrue) editorActivate(); if (editor()->mapped()==MSTrue) return MSFalse; else { focusOut(); return MSTrue; } } template MSBoolean MSTreeListView::editing(void) const { return _pEditor->mapped(); } template void MSTreeListView::edit(void) { if (editor()->mapped()==MSFalse) { TreeModelCursor selectedCursor(selectedNode()); ResourceTreeCursor resourceCursor=findResourceCursor(selectedCursor); if (resourceCursor.isValid()) { ManagedInfo &info=resourceTree().elementAt(resourceCursor); if(isNodeProtected(info) == MSFalse) { MSString string; formatOutput(string,selectedCursor); editor()->string(string); // editor()->selectAll(); mapEditor(); } } } } template unsigned long MSTreeListView::addEditorKeyCallback( const char* pString_,MSKeyCallback* keyCallback_) { return editor()->addKeyCallback(pString_,keyCallback_);} template void MSTreeListView::removeEditorKeyCallback(unsigned long id_) { editor()->removeKeyCallback(id_); } template void MSTreeListView::removeEditorKeyCallback(const char* pString_) { editor()->removeKeyCallback(pString_); } #endif aplus-fsf-4.22/src/MSGUI/MSTypeEntryField.C0000644000265000001440000001063310772770437013765 #ifndef MSTypeEntryFieldIMPLEMENTATION #define MSTypeEntryFieldIMPLEMENTATION /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include template MSTypeEntryField:: MSTypeEntryField(MSWidget *owner_,const char *label_,const MSSymbol& tag_) : MSEntryFieldPlus(owner_,label_,tag_) { _minimumValue.unset(); _maximumValue.unset(); internalCouple(new Type()); } template MSTypeEntryField:: MSTypeEntryField(MSWidget *owner_,Type& model_,const char *label_,const MSSymbol& tag_) : MSEntryFieldPlus(owner_,label_,tag_) { _minimumValue.unset(); _maximumValue.unset(); model(model_); } template MSTypeEntryField::~MSTypeEntryField(void) {} template void MSTypeEntryField::model(Type& model_) { couple(&model_); } template void MSTypeEntryField::model(const Type& model_) { constCouple(&model_); } template void MSTypeEntryField::updateData(void) { if(MSView::model() == 0) internalCouple(new Type()); MSEntryFieldPlus::updateData(); } template const char *MSTypeEntryField::formatOutput(MSString &buffer_) { if (MSView::model()!=0) value().format(buffer_,format()); return buffer_.string(); } template MSBoolean MSTypeEntryField::validate(const char *pString_) { if (MSView::model()!=0) { Type aType; if (aType.set(pString_)==MSError::MSSuccess) { if (minimumValue().isSet()==MSTrue&&maximumValue().isSet()==MSTrue) { if (aType>=minimumValue()&&aType<=maximumValue()) { value()=aType; return MSTrue; } } else if (minimumValue().isSet()==MSTrue) { if (aType>=minimumValue()) { value()=aType; return MSTrue; } } else if (maximumValue().isSet()==MSTrue) { if (aType<=maximumValue()) { value()=aType; return MSTrue; } } else { value()=aType; return MSTrue; } } } return MSFalse; } template void MSTypeEntryField::increment(void) { if (MSView::model()!=0) { if (maximumValue().isSet()==MSTrue) { Type aType=value(); aType+=incrementValue(); if (aType<=maximumValue()) { value()=aType; valueChange(); } } else { value()+=incrementValue(); valueChange(); } } } template void MSTypeEntryField::decrement(void) { if (MSView::model()!=0) { if (minimumValue().isSet()==MSTrue) { Type aType=value(); aType-=incrementValue(); if (aType>=minimumValue()) { value()=aType; valueChange(); } } else { value()-=incrementValue(); valueChange(); } } } template void MSTypeEntryField::set(MSAttrValueList& avList_) { MSEntryFieldPlus::set(avList_); MSIndexVector index; for (unsigned i=0;i MSAttrValueList& MSTypeEntryField::get(MSAttrValueList& avList_) { avList_< #include #include #include #include #if !defined (MS_NO_FILIO_HEADER) #include #endif #if defined(MSTK_MANUAL_INSTANTIATION) #include #if defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma instantiate MSProtocolConnection #endif #if defined(MS_XLC_TEMPLATE_INSTANTIATION) #pragma define(MSProtocolConnection) #endif #if defined(MS_STD_TEMPLATE_INSTANTIATION) template class MSProtocolConnection; #endif #if defined(MS_VC_TEMPLATE_INSTANTIATION) template MSProtocolConnection; #endif #endif //MSTK_MANUAL_INSTANTIATION MSAConnection::MSAConnection(const char *name_, const char *host_, int port_) : MSProtocolConnection(name_, host_, port_) { _bytesToNextMessage=0; } MSAConnection::MSAConnection(const char *name_, const MSString &serviceName_) : MSProtocolConnection(name_, serviceName_) { _bytesToNextMessage=0; } MSAConnection::MSAConnection(const char *name_, int fd_) : MSProtocolConnection(name_, fd_) { _bytesToNextMessage=0; } MSAConnection::~MSAConnection(void) {} int MSAConnection::send(const MSA &v_) { if (isSet(MSProtocolConnection::Reset)==MSTrue) return MSFalse; if (readChannel()==0) return 0; MSBuffer *b=exportAObject( v_); if (b==NULL) return MSFalse; sendTheBuffer(b); if (isSet(MSProtocolConnection::WritePause)==MSFalse) writeChannel()->enable(); // attempt to immediately write buffer return doWrite(MSFalse); } void MSAConnection::doRead(void) { MSBuffer *hb=headBuffer() ; MSBuffer *db=readBuffer() ; int s,n; if (isSet(MSProtocolConnection::Reset)==MSTrue) return; if((s=hb->put()-hb->get())<4) { if((n=readTheBuffer(hb,4-s))<0) return; if((s=hb->put()-hb->get())<4) return; _bytesToNextMessage=MSA::longAt(hb->get()); if (_bytesToNextMessage<=0) { hb->reset(); unset(MSProtocolConnection::Read); return; } } if((n=readTheBuffer(db,_bytesToNextMessage))<0) return; if((_bytesToNextMessage-=n)==0) { MSA d=MSA::importAObject( (char *) db->get(), db->put()-db->get(), (char *)0); hb->reset(); db->clear(); unset(MSProtocolConnection::Read); if(d.isNullMSA()==MSTrue){resetWithError(MSProtocolConnection::Read);return;} readNotify(d); } return; } MSA MSAConnection::getAobjectFromBuffer(MSBuffer *buf_) { MSBuffer *hb=headBuffer(); MSBuffer *db=readBuffer(); int s,n; if (isSet(MSProtocolConnection::Reset)==MSTrue) return MSA(); if((s=hb->put()-hb->get())<4) { if((n=MSBuffer::buffToBuff(buf_,hb,4-s))<0) return MSA(); if((s=hb->put()-hb->get())<4) return MSA(); _bytesToNextMessage=MSA::longAt(hb->get()); if (_bytesToNextMessage<=0) { hb->reset(); unset(MSProtocolConnection::Read); return MSA(); } } if((n=MSBuffer::buffToBuff(buf_,db,_bytesToNextMessage))<0) return MSA(); if((_bytesToNextMessage-=n)==0) { MSA d=MSA::importAObject( (char *) db->get(), db->put()-db->get(), (char *)0); hb->reset(); db->clear(); unset(MSProtocolConnection::Read); if(d.isNullMSA()==MSTrue) { resetWithError(MSProtocolConnection::Read);return MSA(); } return d; } return MSA(); } void MSAConnection::doReadBurst(void) { int burstLength,n; if (isSet(MSProtocolConnection::Reset)==MSTrue) return; #ifdef MS_WINSOCK if (ioctlsocket(fd(),FIONREAD,(unsigned long*)&burstLength) == -1) #else if (ioctl(fd(),FIONREAD,(caddr_t)&burstLength) == -1) #endif { resetWithError(MSProtocolConnection::Read); return; } if (burstLength<0) {return;} if (burstLength==0) { MSMessageLog::infoMessage("MSAConnection: No data to be read on read event\n"); burstLength=4; } MSBuffer b(burstLength); if (n=readTheBuffer(&b,burstLength)<0) { return; } if (n==0&&burstLength==0) { unset(MSProtocolConnection::Read); return; } MSA d(getAobjectFromBuffer(&b)); if (d.isNullMSA()==MSTrue) {return;} int count=1,s=0; char *cp; for(cp=b.get();cp=s) ++count; } MSA z(MSA::gv(MSA::ETYPE,count)); int i; for(i=0;ip[i]=0; int index=0; z.aStructPtr()->p[index++]=(long)d.aStructPtr(); while(indexp[index++]=(long)d.aStructPtr(); } if (index::Read); else { d=getAobjectFromBuffer(&b); if (d.isNullMSA()==MSFalse || b.get()!=b.put()) { MSMessageLog::warningMessage("MSAConnection: Burst Buffer Not Cleared\n"); } } readNotify(d); } int MSAConnection::syncSend(const MSA &v_,double seconds_) { return syncSend(v_,(int)(floor(seconds_)), (int)(1000000.0*(seconds_-floor(seconds_))),MSFalse); } int MSAConnection::syncSend(const MSA &v_,int seconds_,int microseconds_,MSBoolean isAbsolute_) { if (isSet(MSProtocolConnection::Reset)==MSTrue) return 0; struct timeval timeout, now, tvp; if (isAbsolute_==MSTrue) { if (0 > microseconds_) return 0; tvp.tv_sec=seconds_; tvp.tv_usec=microseconds_; } else { gettimeofday(&now,NULL); timeout.tv_sec=seconds_; timeout.tv_usec=microseconds_; tvsum(&now,&timeout,&tvp); } if(writeChannel()==0) { MSMessageLog::errorMessage("MSAConnection: No Write Channel\n"); return 0; } MSBuffer *b=exportAObject(v_); if (b==NULL) return 0; sendTheBuffer(b); return syncWriteSelectLoop(&tvp); } int MSAConnection::doSyncRead(MSA &result_) { MSBuffer *hb=headBuffer(); MSBuffer *db=readBuffer(); int s,n; if (isSet(MSProtocolConnection::Reset)==MSTrue) return 0; if ((s=hb->put()-hb->get())<4) { if ((n=readTheBuffer(hb,4-s))<0) return 0; if((s=hb->put()-hb->get())<4) return 0; _bytesToNextMessage=MSA::longAt(hb->get()); } if((n=readTheBuffer(db,_bytesToNextMessage))<0) return 0; if((_bytesToNextMessage-=n)==0) { result_=MSA::importAObject((char *) db->get(), db->put()-db->get(), (char *)0); hb->reset(); db->clear(); unset(MSProtocolConnection::Read); if((result_.aStructPtr())==(MSAStruct *)0){resetWithError(MSProtocolConnection::Read);return 0;} } return 1; } MSBuffer * MSAConnection::exportAObject(const MSA& aObj_) { long headsize,datasize; int size,temp; int rc; rc=aObj_.exportAObjectSizePass(&headsize,&datasize); if(rc!=0) return NULL; size=headsize+datasize; MSBuffer *msg=new MSBuffer(4+size); temp=htonl(size); msg->stuff((char *)(&temp),4); //bump the put because we are writing ourselves aObj_.exportAObjectFillPass(msg->put(),headsize,(char *) 0,1); msg->put(msg->put()+size); return(msg); } #ifdef MS_64BIT MSBuffer * MSAConnection::export64AObject(const MSA& aObj_) { long headsize,datasize; int size,temp; int rc; rc=aObj_.exportAObjectSizePass(&headsize,&datasize,8); if(rc!=0) return NULL; size=headsize+datasize; MSBuffer *msg=new MSBuffer(4+size); temp=htonl(size); msg->stuff((char *)(&temp),4); //bump the put because we are writing ourselves aObj_.exportAObjectFillPass(msg->put(),headsize,(char *) 0,1,8); msg->put(msg->put()+size); return(msg); } #endif aplus-fsf-4.22/src/MSIPC/MSAbsoluteTimer.C0000644000265000001440000000116210772770440013613 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include MSAbsoluteTimer::MSAbsoluteTimer(unsigned long interval_,MSCallback *cb_) : MSTimer(MSTimer::Absolute,interval_,cb_) {} MSAbsoluteTimer::MSAbsoluteTimer(time_t sec_,long usec_,MSCallback *cb_) : MSTimer(MSTimer::Absolute,sec_,usec_,cb_) {} MSAbsoluteTimer::~MSAbsoluteTimer(void) {} aplus-fsf-4.22/src/MSIPC/MSBuffer.C0000644000265000001440000000640010772770440012245 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #include MSBuffer::MSBuffer(int l_) { _buffer=_minofbuffer=_get=_put=_maxofbuffer=0; reserve(l_); } void MSBuffer::reserve(int add_) { int def; if ((def=add_-(_maxofbuffer-_put))>0) { int len=_put-_get; int off=_get-_minofbuffer; if (def>off) // deficiency is more than the offset { int siz=_maxofbuffer-_minofbuffer; int req=siz+def; siz+=siz/2; if (siznby_) { MSMessageLog::criticalMessage("MSBuffer::read: abort: read(%d): too many bytes: %d>%d\n", fd_,rby,nby_); MSTKTHROWEXCEPTION(MSExceptionError("MSBuffer::read too many bytes")); } _put+=rby; return rby; } int MSBuffer::write(int fd_,int nby_) { int wby; if (nby_<=0) return 0; if ((wby=_put-_get)nby_) { MSMessageLog::criticalMessage("MSBuffer::write: abort: write(%d): too many bytes: %d>%d\n", fd_,wby,nby_); MSTKTHROWEXCEPTION(MSExceptionError("MSBuffer::write too many bytes")); } _get+=wby; return wby; } int MSBuffer::buffToBuff(MSBuffer *sp,MSBuffer *dp,int n) { if (sp!=0 && dp!=0) { if (n>sp->put()-sp->get()) n=sp->put()-sp->get(); dp->stuff(sp->get(),n); sp->get(sp->get()+n); return n; } return -1; } void MSBuffer::stuff(const char *value_,int size_) { if (size_>0) { if (_maxofbuffer-_put0) { if (_maxofbuffer-_put #include #include #include #include #include #include #include #ifdef MS_NEED_CTL // We probably should get the following macros from ipc_const.h, // but for ease of compilation, we'll hard code them for now. #define IPC_READ_MASK 0x1 #define IPC_WRITE_MASK 0x2 #define IPC_EXCEPT_MASK 0x4 extern "C" { int ipc_set_external(int,int,void(*)(int,int,void*),void*); int ipc_del_external(int); int ipc_dsa_external(int,int); int ipc_ena_external(int,int); } #endif MSNodeItem *MSChannel::_pCtlChannelList=0; MSFds *MSChannel::_pFds=0; MSNodeItem *MSChannel::_pChannelList=0; MSChannel::MSChannel(const char *name_,int fd_,int pri_,Type type_,MSCallback *pCallback_) { init(); _pNode=new MSNodeItem((void *)this); _name=(name_==0)?"":name_; _pCallback=pCallback_; #if !defined(MS_WINSOCK) //This check is not valid in windows. if ((fd_<0)||(fd_>=_pFds->size())) { MSMessageLog::warningMessage("MSChannel: %s: warning: bad fd==%d\n",name_,fd_); } #endif _fd=fd_; _type=type_; switch (type_) { case Read: _efds=_pFds->r(); _afds=_pFds->ra(); break; case Write: _efds=_pFds->w(); _afds=_pFds->wa(); break; case Exception: default: _efds=_pFds->x(); _afds=_pFds->xa(); break; } _pFds->fdsclr(_efds,_fd); _pFds->fdsclr(_afds,_fd); priority(pri_); _pCtlObject=0; #ifdef MS_NEED_CTL MSNodeItem *hp=_pCtlChannelList; MSNodeItem *tnp; for (tnp=hp->next();tnp!=hp;tnp=tnp->next()) { CtlObject *co=(CtlObject *) tnp->data(); if (co->fd()==_fd) { _pCtlObject=co; break; } } if (_pCtlObject==0) { _pCtlObject=new CtlObject(_fd); MSNodeItem *item=new MSNodeItem(_pCtlObject); item->insert(hp->next()); _pCtlObject->node(item); } switch (_type) { case Read: _pCtlObject->readChannel(this); ipc_set_external(_fd,_pCtlObject->mask(),ctlHandler,_pCtlObject); break; case Write: _pCtlObject->writeChannel(this); ipc_set_external(_fd,_pCtlObject->mask(),ctlHandler,_pCtlObject); break; case Exception: _pCtlObject->exceptionChannel(this); ipc_set_external(_fd,_pCtlObject->mask(),ctlHandler,_pCtlObject); break; } #endif } MSChannel::~MSChannel(void) { #ifdef MS_NEED_CTL if (_type==Read) { _pCtlObject->readChannel(0); _pCtlObject->mask(_pCtlObject->mask()&~IPC_READ_MASK); ipc_dsa_external(_fd,IPC_READ_MASK); } else if (_type==Write) { _pCtlObject->writeChannel(0); _pCtlObject->mask(_pCtlObject->mask()&~IPC_WRITE_MASK); ipc_dsa_external(_fd,IPC_WRITE_MASK); } else if (_type==Exception) { _pCtlObject->exceptionChannel(0); _pCtlObject->mask(_pCtlObject->mask()&~IPC_EXCEPT_MASK); ipc_dsa_external(_fd,IPC_EXCEPT_MASK); } if (_pCtlObject->readChannel()==0 && _pCtlObject->writeChannel()==0 && _pCtlObject->exceptionChannel()==0) { ipc_del_external(_fd); delete _pCtlObject->node(); delete _pCtlObject; } #endif _pFds->fdsclr(_afds,_fd); _pFds->fdsclr(_efds,_fd); if (_pCallback!=0) delete _pCallback; delete _pNode; } void MSChannel::init(void) { if (_pFds==0) _pFds=new MSFds; if (_pChannelList==0) _pChannelList=new MSNodeItem; #ifdef MS_NEED_CTL if (_pCtlChannelList==0) _pCtlChannelList=new MSNodeItem; #endif } MSFds *MSChannel::fds(void) { return _pFds; } fd_set *MSChannel::afds(void) { return _afds; } fd_set *MSChannel::efds(void) { return _efds; } MSCallback *MSChannel::callback(void) { return _pCallback; } int MSChannel::priority(void) const { return _priority; } int MSChannel::fd(void) const { return _fd; } const char *MSChannel::name(void) const { return _name.string(); } MSChannel::Type MSChannel::type(void) const { return _type; } MSBoolean MSChannel::enabled(void) { return (_pFds->fdsisset(_efds,_fd))?MSTrue:MSFalse; } MSBoolean MSChannel::disabled(void) { return (_pFds->fdsisset(_efds,_fd))?MSFalse:MSTrue; } void MSChannel::callback(MSCallback *pCallback_) { if (_pCallback!=pCallback_) { if (_pCallback!=0) delete _pCallback; _pCallback=pCallback_; } } void MSChannel::priority(int pri_) { MSNodeItem *hp=_pChannelList; MSNodeItem *tnp; _pNode->remove(); _priority=pri_; for (tnp=hp->next();tnp!=hp;tnp=tnp->next()) { MSChannel *pChannel=(MSChannel *) tnp->data(); if (priority()>=pChannel->priority()) break; } _pNode->insert(tnp); } void MSChannel::fdsfresh(int fd_) { init(); _pFds->fdsfresh(fd_); } void MSChannel::fdscopy(void) { init(); _pFds->fdscopy(); } void MSChannel::fdszero(void) { init(); _pFds->fdszero(); } void MSChannel::process(void) { if (_pCallback!=0) _pCallback->process(); } int MSChannel::select(int size_, fd_set *r_, fd_set *w_, fd_set *e_, struct timeval *t_) { #if defined(MS_USE_MSSELECT) return MSXselect(size_,r_,w_,e_,t_); #else return ::select(size_,r_,w_,e_,t_); #endif } int MSChannel::select(struct timeval *pTimeout_) { return select(_pFds->size(),_pFds->ra(),_pFds->wa(),_pFds->xa(),pTimeout_); } // return codes: // rc==0 timeout // rc>0 select fired on given file descriptor // rc<0 check errno, // rc==-1 && errno==EIO - select poped incorrectly (fdisset(fd) failed) int MSChannel::select(int fd_,MSChannel::Type type_,struct timeval *pTimeout_) { int rc=0; int size=_pFds->size(); fd_set fdSet; _pFds->fdszero(&fdSet); _pFds->fdsset(&fdSet,fd_); switch (type_) { case Read: rc=select(size,&fdSet,0,0,pTimeout_); break; case Write: rc=select(size,0,&fdSet,0,pTimeout_); break; case Exception: rc=select(size,0,0,&fdSet,pTimeout_); break; } if (rc>0&&!_pFds->fdsisset(&fdSet,fd_)) { rc=-1; errno=EIO; } return rc; } // Notes for MSChannel::processChannels() [maus: 1/96] // // _pChannelList is a pointer to the head node of a double-linked, // circular list. A large part of the complexity of this routine // relates to the workings of circular lists. In particular, it // is worth remembering that header nodes can be considered the start // or end of the list, and that the insert() function actually // serves a number of functions, including splitting a list into // two pieces! // // "work" and "done" are temporary header nodes. wp and dp point to // them. They will be inserted into the Channel list to mark the // top and bottom of a section of the list to be detached from the // main list, looped over, and then rejoined to the main list. This // section is called the "work list". When it is created, wp marks // the start of the work list, and dp marks the end. (But remember // that the list is circular!) // // np is a pointer to the "current node"--the node currently being // examined or processed. // // When the work list is looped over, a function called process() is // called, which may have side-effects, including changes to the // Channel list, and removal or deletion of the node being // processed. // // The complexity of processChannels reflects this. // // The basic structure of the program is this: // // 1. Find the first node of the Channel list to process. Put wp // before that node. // // 2. Find the next node *not* to process. Put dp before that node. // // 3. Remove the sub-list wp->...->dp from the Channel list. Call // this the work list. All items in the work list have equal // priority. // // 4. Loop over the work list. For each node, move wp ahead of np, // and process the node. This may result in the node's destruction. // It may also change the Channel list. Keeping wp ahead of np // allows us to loop using wp->next() instead of np->next(), which // protects up from np's possible deletion. // // At the end of the loop, wp is at the end of the list, and is // removed. Thanks to the circularity of the list, dp still acts as // a head node. // // 5. Re-insert the work list into the Channel list, maintaining the // ordering by priority. MSBoolean MSChannel::processChannels(void) { if (MSChannel::_pChannelList!=0) { MSNodeItem work; // work queue marker MSNodeItem done; // done queue marker MSNodeItem *hp=_pChannelList; MSNodeItem *wp=work.address(); MSNodeItem *dp=done.address(); MSNodeItem *np; MSChannel *pChannel; int pri; // Find the first node to process. Store its priority as pri. for (np=hp->next();np!=hp;np=np->next()) { pChannel=(MSChannel *) np->data(); if (_pFds->fdsisset(pChannel->_afds,pChannel->_fd)) { pri=pChannel->_priority; break; } } if (np==hp) return MSFalse; // nothing found to do // insert wp before np, to mark the start of the work list. wp->insert(np); // search forward for first node with a different priority while ((np=np->next())!=hp) { MSChannel *pPriChannel=(MSChannel *) np->data(); if (pPriChannel->_priority!=pri) break; } // "Pinch off" the list between wp and np. This will become the work // list. Note that the insert() call is a misnomer, and, in the // obscure physics of circular lists, will actually remove all // nodes between wp and np (including wp, but not including np) // from the Channel list. wp->insert(np); // Place dp behind wp. The work list now has two head nodes. // wp will be used to control the loop over the work list. dp->insert(wp); // process work list while ((np=wp->next())!=dp) { wp->toad(); // this moves wp ahead of np pChannel=(MSChannel *) np->data(); if (_pFds->fdsisset(pChannel->_afds,pChannel->_fd)) { _pFds->fdsclr(pChannel->_afds,pChannel->_fd); pChannel->process(); } } // wp is now at the end of the list, behind dp. remove it. wp->remove(); // Now we are going to put the work list back into the Channel // list, which may have changed out from under us. The Channel // list is sorted by priority, so the first step is to loop thru // the list until we find the first node past the point we want // to insert the work list. for (np=hp->next();np!=hp;np=np->next()) { MSChannel *pPriChannel=(MSChannel *) np->data(); if (pri>=pPriChannel->_priority) break; } // splice the work list into the Channel list in front of np. dp->insert(np); // take out dp, which has done its job. dp->remove(); return MSTrue; } return MSFalse; } MSBoolean MSChannel::removeBadFds() { MSNodeItem *hp=_pChannelList; MSNodeItem *np; MSChannel *pChannel; MSBoolean ret=MSFalse; struct timeval timeout; int rc=0; // zero time value to ensure unblocking select timeout.tv_sec=(unsigned long)0; timeout.tv_usec=(unsigned long)0; // run unblocking select on all enabled channels and remove ones with bad fd for (np=hp->next();np!=hp;np=np->next()) { pChannel=(MSChannel *) np->data(); if (pChannel->enabled()==MSTrue) { rc = select(pChannel->fd(), pChannel->type(), &timeout); if (rc==-1&&errno==EBADF) { // found bad fd pChannel->disable(); MSNodeItem* tmp = np->prev(); np->remove(); // remove from the list np=tmp; } else { // fds availible, set to return true to continue select ret=MSTrue; } } } return ret; } #ifdef MS_NEED_CTL void MSChannel::ctlHandler(int,int reason_,void *client_) { CtlObject *obj=(CtlObject *) client_; MSChannel *pChannel=0; if (reason_==IPC_READ_MASK) pChannel=obj->readChannel(); else if (reason_==IPC_WRITE_MASK) pChannel=obj->writeChannel(); else if (reason_==IPC_EXCEPT_MASK) pChannel=obj->exceptionChannel(); if (pChannel!=0) pChannel->process(); else { MSMessageLog::warningMessage("MSChannel: Getting called from IPC with no channel to Handle\n"); } } #else void MSChannel::ctlHandler(int,int,void *) {} #endif void MSChannel::disable(void) { _pFds->fdsclr(_efds,_fd); #ifdef MS_NEED_CTL switch (_type) { case Read: _pCtlObject->mask(_pCtlObject->mask()&~IPC_READ_MASK); ipc_dsa_external(_fd,IPC_READ_MASK); break; case Write: _pCtlObject->mask(_pCtlObject->mask()&~IPC_WRITE_MASK); ipc_dsa_external(_fd,IPC_WRITE_MASK); break; case Exception: _pCtlObject->mask(_pCtlObject->mask()&~IPC_EXCEPT_MASK); ipc_dsa_external(_fd,IPC_EXCEPT_MASK); break; } #endif } void MSChannel::enable(void) { _pFds->fdsset(_efds,_fd); #ifdef MS_NEED_CTL switch (_type) { case Read: _pCtlObject->mask(_pCtlObject->mask()|IPC_READ_MASK); ipc_ena_external(_fd,IPC_READ_MASK); break; case Write: _pCtlObject->mask(_pCtlObject->mask()|IPC_WRITE_MASK); ipc_ena_external(_fd,IPC_WRITE_MASK); break; case Exception: _pCtlObject->mask(_pCtlObject->mask()|IPC_EXCEPT_MASK); ipc_ena_external(_fd,IPC_EXCEPT_MASK); break; } #endif } // MSChannel::CtlObject implementation MSChannel::CtlObject::CtlObject(int fd_) : _fd(fd_), _mask(0), _readChannel(0), _writeChannel(0), _exceptionChannel(0) {} MSChannel::CtlObject::~CtlObject(void) {} void MSChannel::CtlObject::readChannel(MSChannel *read_) {_readChannel=read_;} void MSChannel::CtlObject::writeChannel(MSChannel *write_) {_writeChannel=write_;} void MSChannel::CtlObject::exceptionChannel(MSChannel *except_) {_exceptionChannel=except_;} void MSChannel::CtlObject::mask(int mask_) {_mask=mask_;} void MSChannel::CtlObject::node(MSNodeItem *node_) {_node=node_;} MSChannel *MSChannel::CtlObject::readChannel(void) {return _readChannel;} MSChannel *MSChannel::CtlObject::writeChannel(void) {return _writeChannel;} MSChannel *MSChannel::CtlObject::exceptionChannel(void) {return _exceptionChannel;} int MSChannel::CtlObject::mask(void) {return _mask;} int MSChannel::CtlObject::fd(void) {return _fd;} MSNodeItem *MSChannel::CtlObject::node(void) {return _node;} aplus-fsf-4.22/src/MSIPC/MSConnection.C0000644000265000001440000001657110772770440013145 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #if defined(__NetBSD__) #include #endif #include #include #if defined(MS_USE_FCNTL_BLOCKING) #include #else #include #endif // MS_USE_FCNTL_BLOCKING MSConnection::MSConnection(const char *name_,int pri_,MSConnection::Retry retry_, int firstRetry_, int lastRetry_,int domain_,int type_,int protocol_) : _retryTime(firstRetry_,lastRetry_), _name((name_==0)?"":name_), _pri(pri_), _retry(retry_), _domain(domain_), _type(type_), _protocol(protocol_), _retryTimer(0), _fd(-1), _remoteNamelen(0), _remoteName((struct sockaddr *)(0)), _establishChannel(0), _openTod((time_t)(0)), _connectTod((time_t)(0)), _establishTod((time_t)(0)), _disconnectTod((time_t)(0)), _closeTod((time_t)(0)), _openedTime((time_t)(0)), _established(MSFalse), _establishedTime((time_t)(0)), _openCount((unsigned)(0)), _connectCount((unsigned)(0)), _establishCount((unsigned)(0)), _disconnectCount((unsigned)(0)), _closeCount((unsigned)(0)) { _createTod=todsec(); } MSConnection::~MSConnection(void) {} void MSConnection::doReadCall(void) { doRead();} void MSConnection::doWriteCall(void) { doWrite();} void MSConnection::doConnectCall(void) { doConnect();} void MSConnection::writeResetCall(void) { writeReset();} void MSConnection::open(void) { doOpen(); } void MSConnection::close(void) { doClose();} void MSConnection::initRetryTimer(void) { _retryTimer=0; } void MSConnection::createRetryTimer(time_t rt_) { _retryTimer=new MSRegularTimer(rt_,0,new MSMethodCallback(this,&MSConnection::open)); } void MSConnection::removeRetryTimer() { // retry timer can only be removed if it did not expired yet. if (_retryTimer) delete _retryTimer; _retryTimer=0; } void MSConnection::doOpen(void) { if (fd()<0) { int cfd; initRetryTimer(); if ((cfd=socket(domain(),type(),protocol()))<0) { MSMessageLog::warningMessage("MSConnection::open(%s) : error: socket()\n",name().string()); close(); return; } _openTod=todsec(); _openCount++; MSChannel::fdsfresh(fd()); _fd=cfd; setBlockingMode(_fd); if (setup()==MSFalse) { close(); return; } if (remoteName()==(struct sockaddr *)(0)) { close(); return; } if (connect(fd(),remoteName(),remoteNamelen())<0) { #if defined(MS_WINSOCK) int err=WSAGetLastError(); if(err==WSAEWOULDBLOCK) #else if (errno==EINPROGRESS) #endif { _connectTod=todsec(); _connectCount++; createEstablishChannel(); return; } #if defined(MS_WINSOCK) if (err != WSAEISCONN) #else if (errno!=EISCONN) #endif { MSMessageLog::warningMessage("MSConnection::open(%s): error: Connect(%d)\n",name().string(),fd()); close(); return; } // we treat EISCONN as though the connection succeeded } _connectTod=todsec(); _connectCount++; if (establish()==MSTrue) acknowledge(); } } void MSConnection::doClose(void) { if (fd()<0) { removeRetryTimer(); } else { if (isEstablished()==MSTrue) { _retryTime.reset(); _established=MSFalse; cleanup(); _disconnectTod=todsec(); _disconnectCount++; _establishedTime+=(disconnectTod()-establishTod()); } else { delete _establishChannel; _establishChannel=0; } MSChannel::fdsfresh(fd()); #if defined(MS_WINSOCK) if (::closesocket(fd())==SOCKET_ERROR) #else if (::close(fd())<0) #endif { MSMessageLog::warningMessage("MSConnection::close(%s) : warning: close(%d)\n",name().string(),fd()); } _fd=-1; _closeTod=todsec(); _closeCount++; _openedTime+=(closeTod()-openTod()); } if (_remoteName!=0) delete [] _remoteName; _remoteName=(struct sockaddr *)(0); _remoteNamelen=0; if (retry()==MSConnection::Yes) doRetry(); } void MSConnection::doRetry() { time_t rt=(time_t)_retryTime.value(); MSMessageLog::debugMessage("MSConnection::close(%s) : note: retrying in %d seconds\n",name().string(),rt); createRetryTimer(rt); _retryTime.backoff(); } void MSConnection::createEstablishChannel(void) { _establishChannel=new MSChannel(name().string(),fd(), priority(),MSChannel::Write,new MSMethodCallback (this,&MSConnection::processEstablish)); _establishChannel->enable(); } void MSConnection::removeEstablishChannel(void) { delete _establishChannel; _establishChannel=0; } void MSConnection::setBlockingMode(int fd_) { #if defined(MS_USE_FCNTL_BLOCKING) int fdFlags=fcntl(fd_,F_GETFL,0); fdFlags|=O_NONBLOCK; if (fcntl(fd(),F_SETFL,fdFlags)<0) #else #if defined(MS_WINSOCK) unsigned long toggle=1; if (ioctlsocket(fd(),FIONBIO,&toggle)<0) #else int toggle=1; if (ioctl(fd(),FIONBIO,(caddr_t)&toggle)<0) #endif #endif { MSMessageLog::infoMessage ("MSConnection::setBlockingMode(%s):Error seting %d fd to non blocking mode", name().string(),fd_); } } void MSConnection::processEstablish(void) { removeEstablishChannel(); if (establish()==MSTrue) acknowledge(); } void MSConnection::acknowledge(void) { if (isEstablished()==MSFalse) { _establishTod=todsec(); _establishCount++; _established=MSTrue; } } void MSConnection::cleanup(void) { MSMessageLog::debugMessage("MSConnection: cleanup not defined\n"); } MSBoolean MSConnection::establish(void) { MSMessageLog::debugMessage("MSConnection: establish not defined\n"); return MSFalse; } static long setNoDelayOnFd(int fd_,int val_) { struct protoent *ProtoEnt; MSMessageLog::debugMessage("MSConnection: setNoDelayOnFd(%d,%d)\n",fd_,val_); char sockname[16]; int socklen=14; if((ProtoEnt=getprotobyname("tcp"))==NULL) { MSMessageLog::warningMessage("MSConnection: getprotobyname failed\n"); return -1; } #if defined(HAVE_SOCKLEN_T) if (getpeername(fd_,(struct sockaddr *)sockname, (socklen_t *)&socklen)) #else if (getpeername(fd_,(struct sockaddr *)sockname, &socklen)) #endif { MSMessageLog::warningMessage("MSConnection: getpeername failed: errno=%d\n",errno); return -1; } sockname[socklen]='\0'; int rc=setsockopt(fd_,ProtoEnt->p_proto,TCP_NODELAY,(char *)(&val_),sizeof(int)); if(rc>=0) return 0; MSMessageLog::warningMessage("MSConnection: Error setting nodelay: errno=%d\n",errno); return -2; } void MSConnection::tcpNoDelay(MSBoolean tcpNoDelay_) { if(tcpNoDelay_!=_tcpNoDelay) { if(fd()==-1||setNoDelayOnFd(fd(),tcpNoDelay_==MSTrue?1:0)==0) { _tcpNoDelay=tcpNoDelay_; // set on if connection is not available yet as well } } } // virtual methods that should be defined by // a subclass to deal with the specifics of the // connection. MSBoolean MSConnection::setup(void) { return MSTrue; } void MSConnection::doRead(void) {} int MSConnection::doWrite(void) { return MSTrue; } int MSConnection::doWrite(MSBoolean) { return MSTrue; } void MSConnection::doConnect(void) {} void MSConnection::writeReset(void) {} aplus-fsf-4.22/src/MSIPC/MSExpBackoff.C0000644000265000001440000000161010772770440013042 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include MSExpBackoff::MSExpBackoff(int first_,int last_) { if (first_<0) { _negative=1; first_*=-1; last_*=-1; } else _negative=0; if (last_<0) last_=0; _first=(unsigned)first_; _current=(unsigned)first_; _last=(unsigned)last_; } MSExpBackoff::~MSExpBackoff(void) {} int MSExpBackoff::backoff(void) { if (_current<_last) { _current*=2; if (_current>_last) _current=_last; } else if (_current>_last) { _current/=2; if (_current<_last) _current=_last; } return (_negative?-1*(int)(_current):(int)(_current)); } aplus-fsf-4.22/src/MSIPC/MSFds.C0000644000265000001440000001276510772770440011563 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #if defined (MS_NO_GETRLIMIT) #include #else #include #endif #if defined(MS_HOWMANY_IN_SYS_PARAM) #include #endif // On glibc 2 for Linux the "fds_bits" item in fd_set structure // is no longer called that to disable direct access. However they // provide a macro to get access to it. #if defined(__FDS_BITS) #define MS_FDSBITS(set) __FDS_BITS(set) #else #define MS_FDSBITS(set) ((set)->fds_bits) #endif MSFds::MSFds(void) { init(); } MSFds::~MSFds(void) { } void MSFds::init(void) { int i; #if !defined(MS_NO_GETRLIMIT) struct rlimit rl; if (getrlimit(RLIMIT_NOFILE,&rl)<0) { MSMessageLog::infoMessage("MSFds::init: getrlimit check failed\n"); _size=FD_SETSIZE; } else _size=rl.rlim_cur; #elif !defined(MS_WINSOCK) if ((i=getdtablesize())<0) { MSMessageLog::infoMessage("MSFds::init: warning: getdtablesize()\n"); _size=FD_SETSIZE; } else _size=i; #else _size= FD_SETSIZE; #endif // make sure that _size is not bigger than FD_SETSIZE or // we'll be overwriting extra memory when accessing fd_set. if(_size>FD_SETSIZE) _size=FD_SETSIZE; #ifdef MS_WINSOCK _howmany=_size; _sizeof=sizeof(fd_set); for (i=0;i<_howmany;i++) _all.fd_array[i]=i; _all.fd_count=_howmany; #else _howmany=howmany(_size,NFDBITS); _sizeof=_howmany*sizeof(fd_mask); for (i=0;i<_howmany;i++) MS_FDSBITS(&_all)[i]=(fd_mask)(~0); #endif memset((void *)(&_none),0,sizeof(_none)); memset((void *)(&_r),0,sizeof(_r)); memset((void *)(&_ra),0,sizeof(_ra)); memset((void *)(&_w),0,sizeof(_w)); memset((void *)(&_wa),0,sizeof(_wa)); memset((void *)(&_x),0,sizeof(_x)); memset((void *)(&_xa),0,sizeof(_xa)); } void MSFds::fdscopy(fd_set *p1,fd_set *p2) { if (p2!=(fd_set *)(0)) { if (p1==(fd_set *)(0)) memset((char *)p2,0,sizeOf()); else memcpy((char *)p2,(char *)p1,sizeOf()); } } fd_set *MSFds::fdsdup(register fd_set *p) { register fd_set *p2=(fd_set *)malloc(sizeOf()); fdscopy(p,p2); return p2; } void MSFds::fdsfree(register fd_set *p) { if (p!=(fd_set *)(0)) free((char *)p); } void MSFds::fdsfresh(register int fd) { fdsclr(r(),fd); fdsclr(ra(),fd); fdsclr(w(),fd); fdsclr(wa(),fd); fdsclr(x(),fd); fdsclr(xa(),fd); } void MSFds::fdscopy(void) { fdscopy(r(),ra()); fdscopy(w(),wa()); fdscopy(x(),xa()); } void MSFds::fdszero(void) { fdszero(ra()); fdszero(wa()); fdszero(xa()); } void MSFds::fdszero(register fd_set *p) { if (p!=(fd_set *)(0)) memset((char *)p,0,sizeOf()); } #if !defined(MS_WINSOCK) int MSFds::fdsanyset(register fd_set *p) { if (p!=(fd_set *)(0)) { for (int i=0;i=0)&&(fd=0)&&(fd=0)&&(fd=0)/*&&(fdfd_count; return 0; } void MSFds::fdsset(register fd_set *p,register int fd) { if ((p!=(fd_set *)(0))&&(fd>=0)/*&&(fdfd_count;i++) r->fd_array[i]=p1->fd_array[i]; r->fd_count=p1->fd_count; for(i=0;ifd_count;i++) fdsset(r,p2->fd_array[i]); } else fdszero(r); } void MSFds::fdsor(fd_set *p1,fd_set *p2,fd_set *r) { if (p1!=(fd_set *)(0)) { if (p2!=(fd_set *)(0)) { fdszero(r); //inefficent but how often if any it happens?? int i; for(i=0;ifd_count;i++) r->fd_array[i]=p1->fd_array[i]; r->fd_count=p1->fd_count; for(i=0;ifd_count;i++) { if(fdsisset(r,p2->fd_array[i])) fdsclr(r,p2->fd_array[i]); else fdsset(r,p2->fd_array[i]); } } else fdscopy(p1,r); } else if (p2!=(fd_set *)(0)) fdscopy(p2,r); else fdszero(r); } int MSFds::fdsisset(register fd_set *p,register int fd) { return ((p!=(fd_set *)(0))&&(fd>=0)/*&&(fd #include #include #include #include #include extern "C" { #include } #include #include MSHostPort::MSHostPort(void) { _host=""; _port=0; } MSHostPort::MSHostPort(const char *host_,int port_) { _host=host_; _port=port_; } // translate internet style address (struct sockaddr_in) // into hostname and port style address MSHostPort::MSHostPort(struct sockaddr_in *name_) { if (name_!=(struct sockaddr_in *)(0)) { if (name_->sin_addr.s_addr==INADDR_ANY) _host=""; else { struct in_addr *a=&(name_->sin_addr); struct hostent *hp; hp=gethostbyaddr((char *)a,sizeof(*a),AF_INET); if (hp==(struct hostent *)(0)) _host=inet_ntoa(name_->sin_addr); else _host=hp->h_name; } _port=ntohs(name_->sin_port); } else { _host=""; _port=0; } } void MSHostPort::set(const char *host_,int port_) { _host=host_; _port=port_; } // translate hostname and port style address // into an internet style address: struct sockaddr_in struct sockaddr_in *MSHostPort::sockaddr_in(int& len_) { struct hostent *hostp; struct sockaddr_in *name=(struct sockaddr_in *)new char[sizeof(struct sockaddr_in)]; name->sin_family=AF_INET; if (host().length()>0) { if ((hostp=gethostbyname(host().string()))==(struct hostent *)(0)) { MSMessageLog::errorMessage("MSHostPort:sockaddr: error: %s not found\n",host().string()); delete [] name; return (struct sockaddr_in *)0; } if (hostp->h_addrtype!=AF_INET) { MSMessageLog::errorMessage("MSHostPort::sockaddr: error: %s not in AF_INET domain\n",host().string()); delete [] name; return (struct sockaddr_in *)0; } if (hostp->h_length!=sizeof(name->sin_addr.s_addr)) { MSMessageLog::errorMessage("MSHostPort::sockaddr: error: %s address length mismatch\n",host().string()); delete [] name; return (struct sockaddr_in *)0; } memcpy((char *)(&(name->sin_addr.s_addr)),hostp->h_addr,sizeof(name->sin_addr.s_addr)); } else name->sin_addr.s_addr=INADDR_ANY; name->sin_port=htons(port()); memset(name->sin_zero,0,8); len_=sizeof(*name); return name; } aplus-fsf-4.22/src/MSIPC/MSIPService.C0000644000265000001440000002112610772770440012667 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #include #include #include static char *domain; static char *map = "remprogs"; static char *file = "/etc/remprogs"; int MSIPService::_countService, MSIPService::_currentService, MSIPService::_countRemprogEntries=0; #define MAX_TRIES 3 MSIPService::MSIPService(const MSString &serviceName_) : _hostport("",-1), _serviceName(serviceName_) { _isValid=MSFalse; _isReady=MSFalse; _remprogEntries=(Remprog *)0; _remprogBuffer=(char *)0; } MSIPService::MSIPService(void) : _hostport("",-1), _serviceName("") { _isValid=MSFalse; _isReady=MSFalse; _remprogEntries=(Remprog *)0; _remprogBuffer=(char *)0; } MSIPService::~MSIPService(void) { if (_remprogEntries!=0) delete [] _remprogEntries; if (_remprogBuffer!=0) free(_remprogBuffer); } void MSIPService::establish(const MSString &serviceName_) { _serviceName=serviceName_; establish(); } void MSIPService::establish(void) { switch(inp_parse(serviceName())) { case MSIPService::CN_TYPE_ERR: /* Shouldn't get here */ MSMessageLog::warningMessage("MSIPService: Invalid service type: (%s)\n", serviceName().string()); break; case MSIPService::CN_TYPE_REMPROGS: if (lookupRemprogService()==0) { MSMessageLog::warningMessage("MSIPService: Unknown service: (%s)\n",serviceName().string()); } else { _isValid=MSTrue; _isReady=MSTrue; } break; case MSIPService::CN_TYPE_HOSTPORT: if (getServByName()==MSFalse) // attempt to use getservbyname { MSMessageLog::warningMessage("Unknown service: (%s)\n",serviceName().string()); } else { _isValid=MSTrue; _isReady=MSTrue; } break; default: MSMessageLog::warningMessage("Error: Invalid service type: (%s)\n", serviceName().string()); break; } } MSIPService::CN_TYPE MSIPService::inp_parse(const char *serviceName_) { if (serviceName_ == NULL || *serviceName_ == '\0') return MSIPService::CN_TYPE_ERR; if (strchr(serviceName_, '@') != NULL) return MSIPService::CN_TYPE_HOSTPORT; if (strchr(serviceName_, ':') != NULL) return MSIPService::CN_TYPE_HOSTPORT; /* * Restriction: remprogs can't start w. digit, in order to tell * port. */ if (serviceName_[0] >= '0' && serviceName_[0] <= '9') return MSIPService::CN_TYPE_ERR; return MSIPService::CN_TYPE_REMPROGS; } MSBoolean MSIPService::getServByName(void) { struct servent *sp; int v; unsigned cp; if (isValid()) return (-1==port())?MSFalse:MSTrue; if ((cp=serviceName().indexOf("@")) != serviceName().length()) { if ((sp = getservbyname((char *)serviceName().subString(0,cp).string(), "tcp")) == NULL) { if ((v = (serviceName().subString(0,cp)).asInt()) == 0) return MSFalse; setHostPort(serviceName().subString(cp+1),v); } else { setHostPort(serviceName().subString(cp+1),ntohs(sp->s_port)); } return MSTrue; } else { if ((cp=serviceName().indexOf(":")) != serviceName().length()) { if ((sp = getservbyname((char *)serviceName().subString(cp+1).string(), "tcp")) == NULL) { if ((v = (serviceName().subString(cp+1)).asInt()) == 0) return MSFalse; setHostPort(serviceName().subString(0,cp),v); } else { setHostPort(serviceName().subString(0,cp),ntohs(sp->s_port)); } return MSTrue; } } return MSFalse; } MSBoolean MSIPService::lookupRemprogService(void) { if (isValid()==MSTrue) return (-1==port())?MSFalse:MSTrue; if (0 >= getIPService()) {return MSFalse;} if (0 > nextIPService()) {return MSFalse;} return MSTrue; } int MSIPService::getIPService(void) { if (_countService > 0) _countService = _currentService = 0; return(_countService = getRemprog()); } int MSIPService::getRemprog(void) { int tries = 0; for (;;) { switch (getRemprogByName()) { /* Success */ case 0: _remprogEntryPointer = _remprogEntry; return(_countRemprogEntries); /* Not necessarily fatal errors - worth retrying */ case YPERR_RPC: case YPERR_DOMAIN: case YPERR_MAP: case YPERR_KEY: case YPERR_YPERR: case YPERR_PMAP: case YPERR_YPBIND: case YPERR_YPSERV: case YPERR_RESRC: case YPERR_NOMORE: case YPERR_NODOM: case YPERR_BADDB: case YPERR_VERS: #ifdef YPERR_BUSY case YPERR_BUSY: #endif #ifdef YPERR_ACCESS case YPERR_ACCESS: #endif if (++tries > MAX_TRIES) { MSMessageLog::warningMessage("MSIPService: Cannot find service (%s)\n", serviceName().string()); return(-1); } break; /* Fatal errors */ case YPERR_BADARGS: /* Args to function are bad */ default: MSMessageLog::warningMessage("MSIPService: Cannot find service (%s)\n", serviceName().string()); return(-1); } } /*NOTREACHED*/ } int MSIPService::getRemprogByName(void) { FILE *fp; int len, ret; register int i; if (domain == (char *)(0)) (void)yp_get_default_domain(&domain); if (_remprogBuffer != (char *)0) free(_remprogBuffer); _remprogBuffer = (char *)(0); if (_remprogEntries != (Remprog *)0) delete [] _remprogEntries; _remprogEntries=(Remprog *)0; ret = yp_match(domain, map, (char *)serviceName().string(), strlen((char *)serviceName().string()), &_remprogBuffer, &len); switch(ret) { case YPERR_BADARGS: case YPERR_MAP: case YPERR_KEY: case YPERR_NOMORE: case YPERR_ACCESS: return(ret); case 0: { int retval=remprogParseValue(_remprogBuffer); return retval; } } /* Try opening the file directly */ if ((fp = fopen(file, "r")) == (FILE *)(0)) return(ret);/* return YP error */ char buf[128]; /* default buffer size */ while (fgets(buf, sizeof(buf), fp) == buf) { for (i = 0; buf[i] != 0; i++) { if(isspace(buf[i])) break; } buf[i] = 0; if (strcmp((char *)buf, (char *)serviceName().string())==0) { (void)fclose(fp); return(remprogParseValue(&buf[i+1])); } } (void)fclose(fp); return(ret); /* return YP error */ } int MSIPService::remprogParseValue(char *value_) { register char *cp = value_; register char *p; Remprog *rp; int i, nrp = 1; compress(value_); for (cp = value_; *cp; cp++) { if (*cp == ' ') nrp++; } _remprogEntries = new Remprog[nrp+1]; if (_remprogEntries == (Remprog *)(0)) return(YPERR_RESRC); rp = &_remprogEntries[nrp]; rp->_rp_host = rp->_rp_protocol = (char *)0; rp->_rp_prognum = 0; compress(value_); cp = value_; p = value_; for (i = 0; i < nrp; i++) { if (cp = (char *)strchr((char *)cp, ' ')) { *cp = 0; cp++; } _remprogEntries[i]._rp_host = p; p = (char *)strchr((char *)p, ':'); *p = 0; p++; _remprogEntries[i]._rp_prognum = atoi(p); p = (char *)strchr((char *)p, ':'); p++; _remprogEntries[i]._rp_protocol = p; p = cp; } _remprogEntry = _remprogEntries; _countRemprogEntries = nrp; return(0); } void MSIPService::compress(register char *fromptr_) { register char chr, *toptr = fromptr_; chr = ' '; /* init to skip leading spaces */ while ((*toptr = *fromptr_++) != '\0') { /* convert newlines and tabs to */ if (isspace (*toptr)) { /* only save first space */ if (chr != ' ') { *toptr++ = chr = ' '; } } else chr = *toptr++; } if (chr == ' ') { /* remove trailing space if any */ *--toptr = '\0'; } return; } int MSIPService::nextIPService(void) { /* eh? */ if (_countService == 0) { MSMessageLog::infoMessage("Next Service before get?\n"); return(-1); } /* fill in the blanks */ setHostPort(_remprogEntryPointer->_rp_host,_remprogEntryPointer->_rp_prognum); protocol(_remprogEntryPointer->_rp_protocol); _currentService++, _remprogEntryPointer++; if (_currentService == _countService) { _currentService = 0, _remprogEntryPointer = _remprogEntry; } return(_currentService); } aplus-fsf-4.22/src/MSIPC/MSIntervalTimer.C0000644000265000001440000000207610772770440013626 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include MSIntervalTimer::MSIntervalTimer(unsigned long interval_,MSCallback *cb_) : MSTimer(MSTimer::Interval,interval_,cb_) {} MSIntervalTimer::~MSIntervalTimer(void) {} void MSIntervalTimer::expirationInterval(unsigned long msec_) { unsigned long msec=interval()->tv_sec*1000+interval()->tv_usec/1000; if (msec!=msec_) { interval()->tv_sec=msec_/1000; interval()->tv_usec=(msec_%1000)*1000; (void) tvnorm(interval()); // Reset myself if I'm not currently stopped if (pNode()->next()!=pNode()&&pNode()->prev()!=pNode()) reset(); } } unsigned long MSIntervalTimer::expirationInterval(void) const { unsigned long msec=_interval.tv_sec*1000+_interval.tv_usec/1000; return msec; } aplus-fsf-4.22/src/MSIPC/MSIpcConnection.C0000644000265000001440000000276710772770440013603 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #if defined(MSTK_MANUAL_INSTANTIATION) #include #if defined (MS_EDG_TEMPLATE_INSTANTIATION) #pragma instantiate MSProtocolConnection #endif #if defined(MS_XLC_TEMPLATE_INSTANTIATION) #pragma define(MSProtocolConnection) #endif #if defined (MS_STD_TEMPLATE_INSTANTIATION) template class MSProtocolConnection; #endif #if defined(MS_VC_TEMPLATE_INSTANTIATION) template MSProtocolConnection; #endif #endif //MSTK_MANUAL_INSTANTIATION MSIpcConnection::MSIpcConnection(const char *name_, const char *host_, int port_) : MSProtocolConnection(name_, host_, port_) { } MSIpcConnection::MSIpcConnection(const char *name_, const MSString &serviceName_) : MSProtocolConnection(name_, serviceName_) { } MSIpcConnection::MSIpcConnection(const char *name_, int fd_) : MSProtocolConnection(name_, fd_) { } MSIpcConnection::~MSIpcConnection(void) {} void MSIpcConnection::doRead(void) { } int MSIpcConnection::send(const XDR &) { return 0; } int MSIpcConnection::syncSend(const XDR &,double) { return 0; } int MSIpcConnection::syncSend(const XDR &,int,int,MSBoolean) { return 0; } int MSIpcConnection::doSyncRead(XDR &) { return 0; } aplus-fsf-4.22/src/MSIPC/MSListener.C0000644000265000001440000001714010772770440012624 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #if defined(MS_USE_FCNTL_BLOCKING) #include #else #include #endif // MS_USE_FCNTL_BLOCKING static const int DefaultRemoteNameLength=128; MSListener::MSListener(const char *name_,int pri_,MSListener::LRetry retry_,int firstRetry_, int lastRetry_,int domain_,int type_,int protocol_) : _name((name_==0)?"":name_), _pri(pri_), _retryTime(firstRetry_,lastRetry_), _retry(retry_), _domain(domain_), _type(type_), _protocol(protocol_), _remoteNamelen(DefaultRemoteNameLength), _remoteName((struct sockaddr *)(0)), _retryTimer(0), _fd(-1), _localNamelen(0), _localName((struct sockaddr *)(0)), _acceptChannel(0), _openTod((time_t)(0)), _listenTod((time_t)(0)), _acceptTod((time_t)(0)), _deafTod((time_t)(0)), _closeTod((time_t)(0)), _openedTime((time_t)(0)), _listenedTime((time_t)(0)), _openCount((unsigned)(0)), _listenCount((unsigned)(0)), _acceptCount((unsigned)(0)), _deafCount((unsigned)(0)), _closeCount((unsigned)(0)) { _createTod=todsec(); } MSListener::~MSListener(void) {} void MSListener::open(void) { doOpen(); } void MSListener::close(void) { doClose();} void MSListener::initRetryTimer(void) { _retryTimer=0; } void MSListener::createRetryTimer(time_t rt_) { _retryTimer=new MSRegularTimer(rt_,0,new MSMethodCallback(this,&MSListener::open)); } void MSListener::removeRetryTimer() { // retry timer can only be removed if it did not expired yet. if (_retryTimer) delete _retryTimer; _retryTimer=0; } void MSListener::doOpen(void) { if (fd()<0) { int lfd; initRetryTimer(); if ((lfd=socket(domain(),type(),protocol()))<0) { MSMessageLog::warningMessage("MSListener::open(%s): error: socket()\n",name().string()); close(); return; } _openTod=todsec(); _openCount++; MSChannel::fdsfresh(lfd); _fd=lfd; setBlockingMode(_fd); int toggle=1; if (setsockopt(fd(),SOL_SOCKET,SO_REUSEADDR,(char *)(&toggle),sizeof(toggle))<0) { MSMessageLog::warningMessage("MSListener::open(%s): warning: setsockopt(%d,REUSEADDR)\n",name().string(),fd()); } if (establish()==MSFalse) { close(); return; } if (localName()==(struct sockaddr *)(0)) { _localName=(struct sockaddr *)new char[localNamelen()]; memset((char *)(localName()),0,localNamelen()); } else { if (bind(fd(),localName(),localNamelen())<0) { MSMessageLog::warningMessage("MSListener::open(%s): error: bind(%d)\n",name().string(),fd()); close(); return; } } if (listen(fd(),5)<0) { MSMessageLog::warningMessage("MSListener::open(%s): error: listen(%d)\n",name().string(),fd()); close(); return; } #if defined(HAVE_SOCKLEN_T) if (getsockname(fd(),localName(),(socklen_t *)&_localNamelen)<0) #else if (getsockname(fd(),localName(),&_localNamelen)<0) #endif { MSMessageLog::warningMessage("MSListener::open(%s): error: getsockname(%d)\n",name().string(),fd()); close(); return; } if (publish()==MSFalse) { close(); return; } _listenTod=todsec(); _listenCount++; createAcceptChannel(); _retryTime.reset(); } } void MSListener::doClose(void) { if (fd()<0) { removeRetryTimer(); } else { if (acceptChannel()!=0) { removeAcceptChannel(); _deafTod=todsec(); _listenedTime+=(deafTod()-listenTod()); } delete [] _localName; _localName=(struct sockaddr *)(0); _localNamelen=0; MSChannel::fdsfresh(fd()); #if defined(MS_WINSOCK) if (::closesocket(fd())==SOCKET_ERROR) #else if (::close(fd())<0) #endif { MSMessageLog::warningMessage("MSListener::close(%s) : warning: close(%d)\n",name().string(),fd()); } _fd=-1; _closeTod=todsec(); _closeCount++; _openedTime+=(closeTod()-openTod()); } if (retry()==MSListener::Yes) doRetry(); } void MSListener::doRetry(void) { time_t rt=(time_t)_retryTime.value(); MSMessageLog::debugMessage("MSListener::close(%s) : note: retrying in %d seconds\n", name().string(),rt); createRetryTimer(rt); _retryTime.backoff(); } void MSListener::acceptNotify(int rfd,const struct sockaddr *rn,int rlen,const struct sockaddr *ln,int llen) { if (acceptCallback()!=0) (*acceptCallback())(rfd,rn,rlen,ln,llen,acceptCallbackData()); } void MSListener::processAccept(void) { int rfd; int rlen=remoteNamelen(); struct sockaddr *rname; struct sockaddr *lname; int llen=localNamelen(); rname=(struct sockaddr *)new char[rlen]; #if defined(HAVE_SOCKLEN_T) if ((rfd=::accept(fd(),rname,(socklen_t *)&rlen))<0) #else if ((rfd=::accept(fd(),rname,&rlen))<0) #endif { #if defined(MS_WINSOCK) int err=WSAGetLastError(); if(err==WSAEWOULDBLOCK||err==WSAEINTR){} else if(err==WSAEMFILE) #else if ((errno==EWOULDBLOCK)||(errno==EINTR)) {} // nothing to report else if ((errno==EMFILE)||(errno==ENFILE)||(errno==ENXIO)||(errno==EIO)) #endif { MSMessageLog::warningMessage("MSListener::accept(%s): error: accept(%d)\n",name().string(),fd()); } else { MSMessageLog::warningMessage("MSListener::accept(%s): error: accept(%d)\n",name().string(),fd()); close(); } delete [] rname; return; } lname=(struct sockaddr *)new char [llen]; #if defined(HAVE_SOCKLEN_T) if (getsockname(rfd,lname,(socklen_t *)&llen)<0) #else if (getsockname(rfd,lname,&llen)<0) #endif { MSMessageLog::warningMessage("MSListener::accept(%s): error: getsockname(%d)\n",name().string(),fd()); #if defined(MS_WINSOCK) ::closesocket(fd()); #else ::close(fd()); #endif delete [] rname; delete [] lname; return; } _acceptTod=todsec(); _acceptCount++; struct sockaddr *rn=(struct sockaddr *)new char[rlen]; struct sockaddr *ln=(struct sockaddr *)new char[llen]; memcpy((char *)rn,(char *)rname,rlen); memcpy((char *)ln,(char *)lname,llen); delete [] rname; delete [] lname; acceptNotify(rfd,rn,rlen,ln,llen); delete [] rn; delete [] ln; } void MSListener::setBlockingMode(int fd_) { #if defined(MS_USE_FCNTL_BLOCKING) int fdFlags=fcntl(fd(),F_GETFL,0); fdFlags|=O_NONBLOCK; if (fcntl(fd(),F_SETFL,fdFlags)<0) #else #if defined(MS_WINSOCK) unsigned long toggle=1; if (ioctlsocket(fd(),FIONBIO,&toggle)<0) #else int toggle=1; if (ioctl(fd(),FIONBIO,(caddr_t)&toggle)<0) #endif #endif { MSMessageLog::infoMessage("MSListener::open(%s): Error seting %d fd to non blocking mode", name().string(),fd()); } } void MSListener::createAcceptChannel(void) { _acceptChannel=new MSChannel(name().string(),fd(),priority(),MSChannel::Read, new MSMethodCallback(this,&MSListener::processAccept)); _acceptChannel->enable(); } void MSListener::removeAcceptChannel(void) { delete _acceptChannel; _acceptChannel=0; } void MSListener::acceptCallback(MSListener::AcceptCallback pCallback_,void *pData_) { _acceptCB=pCallback_; _acceptCBData=pData_; } MSBoolean MSListener::establish(void) { MSMessageLog::debugMessage("MSListener::establish: not defined\n"); return MSFalse; } MSBoolean MSListener::publish(void) { return MSTrue; } aplus-fsf-4.22/src/MSIPC/MSMainLoop.C0000644000265000001440000001025010772770440012550 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include MSBoolean MSMainLoop::_zeroTimeOut=MSFalse; MSBoolean MSMainLoop::_continueLoop=MSTrue; // ctl support added by Kenny Chien #ifdef MS_NEED_CTL extern "C" int ctl_wait(int*,int*,char*,int*,int,int,int); extern "C" int ctl_get_timeout(void); extern "C" char *ctl_global_init(void); static char *_ctlBuffer=0; // we really should include the file "ipc_const.h" // to get the value of IPC_TCP. But for ease of // compilation, we'll hard code this one #define IPC_TCP 0x0080 #endif MSMainLoop::MSMainLoop(void) { #ifdef MS_NEED_CTL if (_ctlBuffer==0) _ctlBuffer=ctl_global_init(); #endif } MSMainLoop::~MSMainLoop(void) {} void MSMainLoop::continueLoop(MSBoolean continueLoop_) { _continueLoop=continueLoop_; } MSBoolean MSMainLoop::continueLoop(void) { return _continueLoop; } MSBoolean MSMainLoop::zeroTimeOut(void) { return _zeroTimeOut; } void MSMainLoop::zeroTimeOut(MSBoolean zeroTimeOut_) { _zeroTimeOut=zeroTimeOut_; } MSBoolean MSMainLoop::processTimers(void) { return MSTimer::processTimers(); } MSBoolean MSMainLoop::flush(void) { return MSFalse; } void MSMainLoop::flushAndProcess(MSBoolean blocking_) { innerLoop(blocking_); } void MSMainLoop::quit(void) { continueLoop(MSFalse); } void MSMainLoop::loop(void) { outerLoop(); terminateLoop(); } void MSMainLoop::terminateLoop(void) {} void MSMainLoop::outerLoop(void) { while (_continueLoop==MSTrue) innerLoop(); } void MSMainLoop::innerLoop(MSBoolean blocking_) { userProcessing(); innerLoopFlush(blocking_); selectAndProcess(); userProcessing(); processTimers(); } void MSMainLoop::innerLoopFlush(MSBoolean blocking_) { if (blocking_==MSFalse) { zeroTimeOut(MSTrue); flush(); } else zeroTimeOut(flush()); } void MSMainLoop::userProcessing(void) {} #ifdef MS_NEED_CTL void MSMainLoop::selectAndProcess(void) { struct timeval *tvpnext,tvp; int chan,sub,blen,next,ctl_timeout; if (_zeroTimeOut==MSTrue) next=0; else { ctl_timeout=ctl_get_timeout(); if ((tvpnext=MSTimer::nextTimeVal())==(struct timeval *)(0)) next=ctl_timeout; else { (void)tvdiff(tvpnext,tod(),&tvp); if (tvp.tv_sec<0) next=0; else next=tvp.tv_sec*1000000+tvp.tv_usec; next=(nexttv_sec=tvp->tv_usec=(long)(0); } else if ((tvpnext=MSTimer::nextTimeVal())==(struct timeval *)(0)) { tvp=(struct timeval *)(0); } else { tvp=&timeout; (void) tvdiff(tvpnext,tod(),tvp); if (tvp->tv_sec<0) tvp->tv_sec=tvp->tv_usec=(long)(0); } MSBoolean selectAgain; do { selectAgain=MSFalse; rc=MSChannel::select(tvp); if (rc==-1) { switch (errno) { case EINTR: // MSMessageLog::debugMessage("MSMainLoop: WARNING: select() was interrupted\n"); break; case EBADF: MSMessageLog::warningMessage("MSMainLoop: WARNING: invalid fd removed in select()\n"); selectAgain=MSChannel::removeBadFds(); MSChannel::fdscopy(); break; case EINVAL: MSMessageLog::errorMessage("MSMainLoop: ERROR: Invalid timeval in select()\n"); break; default: MSMessageLog::errorMessage("MSMainLoop: ERROR: errno=%d from select()\n",errno); break; } } } while(selectAgain==MSTrue); if (rc<=0) MSChannel::fdszero(); (void)MSChannel::processChannels(); } #endif aplus-fsf-4.22/src/MSIPC/MSProtocolListener.C0000644000265000001440000000227110772770440014345 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include MSProtocolListener::MSProtocolListener(const char *name_,int port_) : MSListener(name_,0,MSListener::Yes,2,2,PF_INET,SOCK_STREAM,0) { hostPort().set((const char *) 0,port_); _name=name_; } MSProtocolListener::MSProtocolListener(const char *name_,const MSString &serviceName_) : MSListener(name_,0,MSListener::Yes,2,2,PF_INET,SOCK_STREAM,0) { service().establish(serviceName_); hostPort().set((const char *) 0,service().port()); _name=name_; } MSProtocolListener::~MSProtocolListener(void) { _retry=MSListener::No; close(); } MSBoolean MSProtocolListener::establish(void) { if (service().isValid()==MSTrue) { if (service().isReady()==MSFalse) { service().establish(); hostPort().set((const char *) 0,service().port()); } } _localName=(struct sockaddr *)hostPort().sockaddr_in(_localNamelen); return (_localName!=0)?MSTrue:MSFalse; } aplus-fsf-4.22/src/MSIPC/MSRawConnection.C0000644000265000001440000000666710772770441013625 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include static const int MaxReadSize=8192; #if defined(MSTK_MANUAL_INSTANTIATION) #include #if defined (MS_EDG_TEMPLATE_INSTANTIATION) #pragma instantiate MSProtocolConnection #endif #if defined(MS_XLC_TEMPLATE_INSTANTIATION) #pragma define(MSProtocolConnection) #endif #if defined (MS_STD_TEMPLATE_INSTANTIATION) template class MSProtocolConnection; #endif #if defined (MS_VC_TEMPLATE_INSTANTIATION) template MSProtocolConnection; #endif #endif //MSTK_MANUAL_INSTANTIATION MSRawConnection::MSRawConnection(const char *name_, const char *host_, int port_) : MSProtocolConnection(name_, host_, port_) { } MSRawConnection::MSRawConnection(const char *name_, const MSString &serviceName_) : MSProtocolConnection(name_, serviceName_) { } MSRawConnection::MSRawConnection(const char *name_, int fd_) : MSProtocolConnection(name_, fd_) { } MSRawConnection::~MSRawConnection(void) { } void MSRawConnection::doRead(void) { int n; MSBuffer *db=headBuffer(); if (isSet(MSProtocolConnection::Reset)==MSTrue) return; if((n=readTheBuffer(db,MaxReadSize))<0) return; if((n=db->put()-db->get())>0) { unset(MSProtocolConnection::Read); MSString d(db->get(),n); db->get(db->get()+n); readNotify(d); } } int MSRawConnection::send(const MSString& aString_) { if (isSet(MSProtocolConnection::Reset)==MSTrue) return MSFalse; if (readChannel()==0) return MSFalse; MSBuffer *pBuffer=new MSBuffer; pBuffer->stuff(aString_.string(),aString_.length()); sendTheBuffer(pBuffer); if (isSet(MSProtocolConnection::WritePause)==MSFalse) writeChannel()->enable(); // attempt to immediately write the buffer return doWrite(MSFalse); } int MSRawConnection::syncSend(const MSString &aString_,double seconds_) { return syncSend(aString_,(int)(floor(seconds_)), (int)(1000000.0*(seconds_-floor(seconds_)))); } int MSRawConnection::syncSend(const MSString &aString_,int seconds,int microseconds,MSBoolean isAbsolute) { if (isSet(MSProtocolConnection::Reset)) return 0; struct timeval timeout, now, tvp; if (isAbsolute==MSTrue) { if (0 > microseconds) return 0; tvp.tv_sec=seconds; tvp.tv_usec=microseconds; } else { gettimeofday(&now,NULL); timeout.tv_sec=seconds; timeout.tv_usec=microseconds; tvsum(&now,&timeout,&tvp); } if(writeChannel()==0) { MSMessageLog::errorMessage("MSRawConnection::syncSend: No Write Channel\n"); return 0; } MSBuffer *b=new MSBuffer; if (b==NULL) return 0; b->stuff(aString_.string(),aString_.length()); sendTheBuffer(b); return syncWriteSelectLoop(&tvp); } int MSRawConnection::doSyncRead(MSString &result_) { MSBuffer *db=headBuffer(); int n; if (isSet(MSProtocolConnection::Reset)==MSTrue) return 0; if ((n=readTheBuffer(db,MaxReadSize))<0) return 0; if((n=db->put()-db->get())>0) { unset(MSProtocolConnection::Read); result_=MSString(db->get(),n); db->get(db->get()+n); } return 1; } aplus-fsf-4.22/src/MSIPC/MSRegularTimer.C0000644000265000001440000000115210772770441013436 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include MSRegularTimer::MSRegularTimer(unsigned long interval_,MSCallback *cb_) : MSTimer(MSTimer::Regular,interval_,cb_) {} MSRegularTimer::MSRegularTimer(time_t sec_, long usec_,MSCallback *cb_) : MSTimer(MSTimer::Regular,sec_,usec_,cb_) {} MSRegularTimer::~MSRegularTimer(void) {} aplus-fsf-4.22/src/MSIPC/MSTimer.C0000644000265000001440000000707410772770441012125 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include MSNodeItem *MSTimer::_pTimerList=0; MSTimer::MSTimer(TType type_,unsigned long interval_,MSCallback *pCallback_) { time_t sec=interval_/1000; long usec=(interval_%1000)*1000; init(type_,sec,usec,pCallback_); } MSTimer::MSTimer(TType type_,time_t sec_,long usec_,MSCallback *pCallback_) { init(type_,sec_,usec_,pCallback_); } void MSTimer::init(TType type_,time_t sec_,long usec_,MSCallback *pCallback_) { if (_pTimerList==0) _pTimerList=new MSNodeItem; struct timeval *tvp=expire(); MSNodeItem *hp=_pTimerList; MSNodeItem *np; _pNode=new MSNodeItem((void *)this); _type=type_; _pCallback=pCallback_; if (type()==Absolute) { tvp->tv_sec=(long)sec_; tvp->tv_usec=usec_; (void)tvnorm(tvp); } else { interval()->tv_sec=(long)sec_; interval()->tv_usec=usec_; (void) tvnorm(interval()); (void) tvsum(tod(),interval(),tvp); } for (np=hp->prev();np!=hp;np=np->prev()) { MSTimer *pTimer=(MSTimer *)np->data(); if (tvcmp(tvp,pTimer->expire())>=0) break; } _pNode->insert(np->next()); } MSTimer::~MSTimer(void) { if (_pCallback!=0) delete _pCallback; delete _pNode; } void MSTimer::callback(MSCallback *pCallback_) { if (_pCallback!=pCallback_) { if (_pCallback!=0) delete _pCallback; _pCallback=pCallback_; } } void MSTimer::process(void) { if (_pCallback!=0) _pCallback->process(); } void MSTimer::stop(void) { if (type()!=Interval) { delete this; return; } _pNode->remove(); } void MSTimer::reset(void) { if (type()!=Interval) { delete this; return; } MSNodeItem *hp=_pTimerList; struct timeval *tvp=expire(); MSNodeItem *np; (void) tvsum(tod(),interval(),tvp); _pNode->remove(); for (np=hp->prev();np!=hp;np=np->prev()) { MSTimer *pTimer=(MSTimer *) np->data(); if (tvcmp(tvp,pTimer->expire())>=0) break; } _pNode->insert(np->next()); } struct timeval *MSTimer::nextTimeVal(void) { if (MSTimer::_pTimerList!=0) { MSTimer *pTimer; if ((pTimer=(MSTimer *)MSTimer::_pTimerList->next()->data())==(MSTimer *)(0)) { return ((struct timeval *)(0)); } return (pTimer->expire()); } return ((struct timeval *)(0)); } MSBoolean MSTimer::processTimers(void) { MSBoolean didwork=MSFalse; if (_pTimerList!=0) { MSNodeItem *hp=_pTimerList; MSNodeItem *np; struct timeval now=*tod(); while ((np=hp->next())!=hp) { MSTimer *pTimer=(MSTimer *) np->data(); struct timeval *tvp=pTimer->expire(); if (tvcmp(&now,tvp)>=0) { // cache this before calling process(), so that we do not have to access // the pTimer object after it is called. this allows a user to safely // delete an interval timer from within a process callback. MSBoolean deleteTimerAfterProcess=(pTimer->type()!=Interval)?MSTrue:MSFalse; if (pTimer->type()==Interval) pTimer->reset(); else pTimer->_pNode->remove(); pTimer->process(); if (deleteTimerAfterProcess==MSTrue) delete pTimer; } else break; didwork=MSTrue; } } return didwork; } aplus-fsf-4.22/src/MSIPC/MSTv.C0000644000265000001440000001373310772770441011435 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include struct timeval tod_l; /* p1 is compared to p2. If it is earlier,-1 is returned. * If it is latter 1 is returned. If it is the same,0 is * returned. It is assumed that the inputs are normalized. */ int tvcmp(struct timeval *p1,struct timeval *p2) { if (p1->tv_sectv_sec) return -1; else if (p1->tv_sec>p2->tv_sec) return 1; else if (p1->tv_usectv_usec) return -1; else if (p1->tv_usec>p2->tv_usec) return 1; return 0; } /* p2 is subtracted from p1 and the result is placed in p3. * 0 is returned if the operation succeeds. 1 is * returned if a positive overflow was encountered * while preparing the result. 2 is returned if * negative overflow was encountered. The inputs are * assumed to be normalized. */ int tvdiff(struct timeval *p1,struct timeval *p2,struct timeval *p3) { if ((p1->tv_sec<(long)(0))&&(p2->tv_sec>(long)(0))) { p3->tv_sec=p1->tv_sec-p2->tv_sec; if (p3->tv_sec>=(long)(0)) { MSMessageLog::warningMessage("tvdiff: Warning: negative overflow\n"); p3->tv_sec=LONG_MIN; p3->tv_usec=(long)(0); return 2; } p3->tv_usec=p1->tv_usec-p2->tv_usec; } else if ((p1->tv_sec>(long)(0))&&(p2->tv_sec<(long)(0))) { p3->tv_sec=p1->tv_sec-1; p3->tv_sec-=p2->tv_sec+1; if (p3->tv_sec<(long)(0)) { /* overflow positive */ MSMessageLog::warningMessage("tvdiff: Warning: positive overflow\n"); p3->tv_sec=LONG_MAX; p3->tv_usec=MILLION_USECS-1; return 1; } p3->tv_usec=p1->tv_usec+MILLION_USECS; p3->tv_usec-=p2->tv_usec-MILLION_USECS; } else { p3->tv_sec=p1->tv_sec-p2->tv_sec; p3->tv_usec=p1->tv_usec-p2->tv_usec; } return tvnorm(p3); } /* If sec_i and usec_i are the initial time value * members,and sec_f and usec_f are the final * time value members,then the normalized time value * satisfies * 1000000*sec_f+usec_f=1000000*sec_i+usec_i * and * 0<=usec_f<1000000 * Normalization is optimized for normalizing sums * and differences of normalized time values. * * returns 0 if successful * returns 1 if normalization caused overflow of positive time * returns 2 if normalization caused overflow of negative time * * The present implementation assumes a signed 2's complement * integer representation for type time_t. Furthermore,it * is assumed that integer addition overflow is not trapped. * * Upon overflow to either positive or negative values, * a warning message is logged and the maximum or minumum possible * normalized timeval is substituted. */ int tvnorm(struct timeval *p) { register long usec=p->tv_usec; if (usec>=MILLION_USECS) { register long sec; if (usec>=(2*MILLION_USECS)) { /* usec is not the result of sum of two normalized *time values. We therefore use slow division and *remainder to normalize it. */ sec=p->tv_sec+usec / MILLION_USECS; usec %= MILLION_USECS; } else { /* we use fast reduction */ sec=p->tv_sec+1; usec-=MILLION_USECS; } if (sectv_sec) { /* overflow positive */ MSMessageLog::warningMessage("tvnorm: Warning: positive overflow\n"); p->tv_sec=LONG_MAX; p->tv_usec=MILLION_USECS-1; return 1; } p->tv_sec=sec; p->tv_usec=usec; } else if (usec<(long)(0)) { register long sec; if ((usec+MILLION_USECS)<(long)(0)) { /* usec is not the result of diff of two normalized *time values. We therefore use slow division and *remainder to normalize it. */ usec=- 1-usec; /* no overflow in two-complement */ sec=(p->tv_sec-1)-(usec / MILLION_USECS); usec=(MILLION_USECS-1)-(usec % MILLION_USECS); } else { /* we use fast reduction */ sec=p->tv_sec-1; usec+=MILLION_USECS; } if (sec>p->tv_sec) { /* overflow negative */ MSMessageLog::warningMessage("tvnorm: Warning: negative overflow\n"); p->tv_sec=LONG_MIN; p->tv_usec=(long)(0); return 2; } p->tv_sec=sec; p->tv_usec=usec; } return 0; } /* p1 is added to p2 and the result is placed in p3. *0 is returned if the operation succeeds. 1 is *returned if a positive overflow was encountered *while preparing the result. 2 is returned if *negative overflow was encountered. The inputs are *assumed to be normalized. */ /* external function definitions */ int tvsum(struct timeval *p1,struct timeval *p2,struct timeval *p3) { if ((p1->tv_sec<(long)(0))&&(p2->tv_sec<(long)(0))) { p3->tv_sec=(p1->tv_sec+1); p3->tv_sec+=(p2->tv_sec+1); if (p3->tv_sec>=(long)(0)) { MSMessageLog::warningMessage("tvsum: Warning: negative overflow\n"); p3->tv_sec=LONG_MIN; p3->tv_usec=(long)(0); return 2; } p3->tv_usec=(p1->tv_usec-MILLION_USECS); p3->tv_usec+=(p2->tv_usec-MILLION_USECS); } else if ((p1->tv_sec>(long)(0))&&(p2->tv_sec>(long)(0))) { p3->tv_sec=p1->tv_sec+p2->tv_sec; if (p3->tv_sec<(long)(0)) { /* overflow positive */ MSMessageLog::warningMessage("tvsum: Warning: positive overflow\n"); p3->tv_sec=LONG_MAX; p3->tv_usec=MILLION_USECS-1; return 1; } p3->tv_usec=p1->tv_usec+p2->tv_usec; } else { p3->tv_sec=p1->tv_sec+p2->tv_sec; p3->tv_usec=p1->tv_usec+p2->tv_usec; } return tvnorm(p3); } time_t todsec(void) { return (time_t)tod()->tv_sec; } struct timeval *tod(void) { static int first=0; struct timeval now; if (first==0) // JMB: done in dapterm { tod_l.tv_sec=(long)(0); tod_l.tv_usec=(long)(0); first=1; } if (gettimeofday(&now,(struct timezone *)(0))<0) { MSMessageLog::warningMessage("tod: Error: gettimeofday()\n"); } else tod_l=now; return &tod_l; } aplus-fsf-4.22/src/MSIPC/MSA.H0000644000265000001440000000054510772770441011226 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1998-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// /*This file exists for backwoard compatibility*/ #include aplus-fsf-4.22/src/MSIPC/MSAConnection.H0000644000265000001440000000326310772770441013246 #ifndef MSAConnectionHEADER #define MSAConnectionHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #ifdef MS_VC_TEMPLATE_INSTANTIATION class MSIPCExport MSProtocolConnection; #endif class MSIPCExport MSAConnection : public MSProtocolConnection { protected: int _bytesToNextMessage; virtual void doRead(void); virtual void doReadBurst(void); MSA getAobjectFromBuffer(MSBuffer *buf); public: MSAConnection(const char *name_, const char *host_, int port_); MSAConnection(const char *name_, const MSString &serviceName_); MSAConnection(const char *name_, int fd_); ~MSAConnection(void); virtual int send(const MSA &); virtual int syncSend(const MSA &msg_,double seconds); virtual int syncSend(const MSA &msg_,int seconds,int microseconds,MSBoolean isAbsolute); virtual int doSyncRead(MSA &); MSBuffer *exportAObject(const MSA& aObj_); #ifdef MS_64BIT MSBuffer *export64AObject(const MSA& aObj_); #endif }; // We provide explicit "do_not_instantiate" pragmas here to avoid instantiation complications in // MStk applications. // #if !defined(__MSIPCLIBRARY_BUILD__) && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma do_not_instantiate MSProtocolConnection #endif // !__MSIPCLIBRARY_BUILD__ && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #endif aplus-fsf-4.22/src/MSIPC/MSAbsoluteTimer.H0000644000265000001440000000111210772770441013614 #ifndef MSAbsoluteTimerHEADER #define MSAbsoluteTimerHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSIPCExport MSAbsoluteTimer : public MSTimer { public: MSAbsoluteTimer(unsigned long msec_,MSCallback *cb_); MSAbsoluteTimer(time_t sec_,long usec_,MSCallback *cb_); ~MSAbsoluteTimer(void); }; #endif aplus-fsf-4.22/src/MSIPC/MSBuffer.H0000644000265000001440000000713610772770441012262 #ifndef MSBufferHEADER #define MSBufferHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSIPCExport MSBuffer { protected: char *_buffer; char *_minofbuffer; char *_get; char *_put; char *_maxofbuffer; void reserve(int); public: inline MSBuffer(void); MSBuffer(int); inline ~MSBuffer(void); inline char *buffer(void); inline char *minofbuffer(void); inline char *get(void); inline char *put(void); inline char *maxofbuffer(void); inline void minofbuffer(char *c_); inline void get(char *c_); inline void put(char *c_); inline void maxofbuffer(char *c_); inline void clear(void); inline void reset(void); inline void put(char c_); inline void put(double d_); inline void put(int d_); inline void put(short d_); inline void put(long d_); inline void put(const char *s_); inline MSBuffer& operator>>(int& d_); inline MSBuffer& operator>>(char& d_); inline MSBuffer& operator<<(char d_); inline MSBuffer& operator<<(double d_); inline MSBuffer& operator<<(int d_); inline MSBuffer& operator<<(short d_); inline MSBuffer& operator<<(long d_); inline MSBuffer& operator<<(const char *d_); void stuff(const char *,int); static int buffToBuff(MSBuffer *,MSBuffer *,int); void zero(int); int read(int,int); int write(int,int); }; inline MSBuffer::MSBuffer(void) { _buffer=_minofbuffer=_get=_put=_maxofbuffer=0; } inline MSBuffer::~MSBuffer(void) { if (_minofbuffer!=0) delete [] _minofbuffer; } inline char *MSBuffer::buffer(void) { return _buffer; } inline char *MSBuffer::minofbuffer(void) { return _minofbuffer; } inline char *MSBuffer::get(void) { return _get; } inline char *MSBuffer::put(void) { return _put; } inline char *MSBuffer::maxofbuffer(void) { return _maxofbuffer; } inline void MSBuffer::minofbuffer(char *c_) { _minofbuffer=c_; } inline void MSBuffer::get(char *c_) { _get=c_; } inline void MSBuffer::put(char *c_) { _put=c_; } inline void MSBuffer::maxofbuffer(char *c_) { _maxofbuffer=c_; } inline void MSBuffer::clear(void) { if (_minofbuffer!=0) delete [] _minofbuffer; _minofbuffer=_get=_put=_maxofbuffer=0; } inline void MSBuffer::reset(void) { _get=_put=_minofbuffer; } inline void MSBuffer::put(char c_) { if (_maxofbuffer-_put<1) reserve(1); *(_put++)=c_; } inline void MSBuffer::put(double d_) { stuff((char *)(&d_),sizeof(d_)); } inline void MSBuffer::put(int d_) { stuff((char *)(&d_),sizeof(d_)); } inline void MSBuffer::put(short d_) { stuff((char *)(&d_),sizeof(d_)); } inline void MSBuffer::put(long d_) { stuff((char *)(&d_),sizeof(d_)); } inline void MSBuffer::put(const char *s_) { if (s_!=0) stuff(s_,strlen(s_)); } inline MSBuffer& MSBuffer::operator>>(int& d_) { d_=(_get!=_put)?(0xff & *_get++):-1; return *this; } inline MSBuffer& MSBuffer::operator>>(char& d_) { d_=(_get!=_put)?(0xff & *_get++):-1; return *this; } inline MSBuffer& MSBuffer::operator<<(char d_) { put(d_); return *this; } inline MSBuffer& MSBuffer::operator<<(double d_) { put(d_); return *this; } inline MSBuffer& MSBuffer::operator<<(int d_) { put(d_); return *this; } inline MSBuffer& MSBuffer::operator<<(short d_) { put(d_); return *this; } inline MSBuffer& MSBuffer::operator<<(long d_) { put(d_); return *this; } inline MSBuffer& MSBuffer::operator<<(const char *d_) { put(d_); return *this; } #endif aplus-fsf-4.22/src/MSIPC/MSChannel.H0000644000265000001440000000554710772770441012425 #ifndef MSChannelHEADER #define MSChannelHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MSDefinesHEADER #include #endif #include #if !defined(INT_MAX) #include #endif #include #include #include #include #include class MSNodeItem; class MSFds; #if !defined(MS_FD_SET_NOT_STRUCT) struct fd_set; #endif class MSIPCExport MSChannel { public: enum Priority {Default=0,High=INT_MAX,Low=0}; enum Type {Read=0,Write=1,Execute=2,Exception=2}; private: static MSFds *_pFds; static MSNodeItem *_pChannelList; MSString _name; int _priority; int _fd; Type _type; MSNodeItem *_pNode; MSCallback *_pCallback; fd_set *_efds; // enabled fd set fd_set *_afds; // available fd set // The following class members are for CTL support class MSIPCExport CtlObject { public: CtlObject(int fd_); ~CtlObject(void); void readChannel(MSChannel *read_); void writeChannel(MSChannel *write_); void exceptionChannel(MSChannel *except_); void mask(int mask_); void node(MSNodeItem *node_); MSChannel *readChannel(void); MSChannel *writeChannel(void); MSChannel *exceptionChannel(void); int mask(void); int fd(void); MSNodeItem *node(void); private: MSChannel *_readChannel; MSChannel *_writeChannel; MSChannel *_exceptionChannel; int _fd; int _mask; MSNodeItem *_node; }; static MSNodeItem *_pCtlChannelList; CtlObject *_pCtlObject; static void ctlHandler(int,int,void*); static int select(int, fd_set *, fd_set *, fd_set *, struct timeval *); public: MSChannel(const char *name_,int fd_,int pri_,Type type_,MSCallback *pCallback_=0); virtual ~MSChannel(void); static MSFds *fds(void); fd_set *afds(void); fd_set *efds(void); MSCallback *callback(void); int priority(void) const; int fd(void) const; const char *name(void) const; Type type(void) const; MSBoolean enabled(void); MSBoolean disabled(void); void disable(void); void enable(void); void priority(int); void callback(MSCallback *); static void init(void); static void fdsfresh(int fd_); static void fdscopy(void); static void fdszero(void); static MSBoolean processChannels(void); static MSBoolean removeBadFds(void); static int select(struct timeval *pTimeout_); static int select(int fd_,Type,struct timeval *pTimeout_); virtual void process(void); }; #endif aplus-fsf-4.22/src/MSIPC/MSConnection.H0000644000265000001440000001231210772770441013140 #ifndef MSConnectionHEADER #define MSConnectionHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MSDefinesHEADER #include #endif #include #include #include #include #include #include #include #include class MSIPCExport MSConnection { public: enum Retry{No=0,Yes=1}; protected: // configuration information MSString _name; // connection's name int _pri; // connection accept priority MSConnection::Retry _retry; // retry connection after failure int _domain; // socket address domain int _type; // socket type int _protocol; // socket protocol MSBoolean _tcpNoDelay; // TCP_NODELAY socket option on connection // state information MSExpBackoff _retryTime; // retry time limit with back-off int _fd; // file descriptor int _remoteNamelen; // local name length struct sockaddr *_remoteName; // local name MSRegularTimer *_retryTimer; // retry timer MSChannel *_establishChannel; // connection establishment channel MSBoolean _established; // administrative information time_t _createTod; // time connection was created time_t _openTod; // time connection was opened time_t _connectTod; // time connection was attempted time_t _establishTod; // time connection was established time_t _disconnectTod; // time connection was disconnected time_t _closeTod; // time connection was closed time_t _openedTime; // seconds opened in prev instances time_t _establishedTime; // seconds established in prev instances unsigned _openCount; // number of times opened unsigned _connectCount; // number of times connected unsigned _establishCount; // number of times established unsigned _disconnectCount; // number of times disconnected unsigned _closeCount; // number of times closed int priority(void) const {return _pri;} int domain(void) const {return _domain;} int type(void) const {return _type;} int protocol(void) const {return _protocol;} time_t createTod(void) const {return _createTod;} time_t openTod(void) const {return _openTod;} time_t connectTod(void) const {return _connectTod;} time_t establishTod(void) const {return _establishTod;} time_t disconnectTod(void) const {return _disconnectTod;} time_t closeTod(void) const {return _closeTod;} time_t openedTime(void) const {return _openedTime;} time_t establishedTime(void) const {return _establishedTime;} MSExpBackoff& retryTime(void) {return _retryTime;} MSRegularTimer *retryTimer(void) {return _retryTimer;} int remoteNamelen(void) {return _remoteNamelen;} struct sockaddr *remoteName(void) {return _remoteName;} MSChannel *establishChannel(void) {return _establishChannel;} // callback entry points void doReadCall(void); void doWriteCall(void); void doConnectCall(void); void writeResetCall(void); void processEstablish(void); virtual void doRead(void); virtual int doWrite(void); virtual int doWrite(MSBoolean); virtual void doConnect(void); virtual void writeReset(void); virtual void cleanup(void); virtual MSBoolean establish(void); virtual MSBoolean setup(void); virtual void acknowledge(void); virtual void doRetry(void); virtual void doOpen(void); virtual void doClose(void); void createRetryTimer(time_t); void removeRetryTimer(void); void initRetryTimer(void); void createEstablishChannel(void); void removeEstablishChannel(void); void setBlockingMode(int fd_); public: MSConnection(const char *,int,Retry,int,int,int,int,int); virtual ~MSConnection(void); void retry(MSConnection::Retry retry_) {_retry=retry_;} int fd(void) const {return _fd;} MSConnection::Retry retry(void) const {return _retry;} const MSString& name(void) const {return _name;} unsigned openCount(void) const {return _openCount;} unsigned connectCount(void) const {return _connectCount;} unsigned disconnectCount(void) const {return _disconnectCount;} unsigned establishCount(void) const {return _establishCount;} unsigned closeCount(void) const {return _closeCount;} MSBoolean isEstablished(void) const {return _established;} MSBoolean tcpNoDelay(void) const {return _tcpNoDelay;} void tcpNoDelay(MSBoolean); void open(void); void close(void); }; #endif aplus-fsf-4.22/src/MSIPC/MSExpBackoff.H0000644000265000001440000000175410772770441013061 #ifndef MSExpBackoffHEADER #define MSExpBackoffHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSIPCExport MSExpBackoff { protected: unsigned _negative; unsigned _first; unsigned _current; unsigned _last; public: MSExpBackoff(int first_=0,int last_=0); virtual ~MSExpBackoff(void); unsigned negative(void) const { return _negative; } unsigned first(void) const { return _first; } unsigned current(void) const { return _current; } unsigned last(void) const { return _last; } virtual int backoff(void); int value(void) { return (_negative?-1*(int)(_current):(int)(_current)); } int reset(void) { _current=_first; return (_negative?-1*(int)(_current):(int)(_current)); } }; #endif aplus-fsf-4.22/src/MSIPC/MSFds.H0000644000265000001440000000312010772770441011552 #ifndef MSFdsHEADER #define MSFdsHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MSDefinesHEADER #include #endif #include #if defined(MS_FDSET_IN_SYS_SELECT) #include #endif class MSIPCExport MSFds { private: int _howmany; int _size; int _sizeof; fd_set _all; fd_set _none; fd_set _r; fd_set _ra; fd_set _w; fd_set _wa; fd_set _x; fd_set _xa; void init(void); public: MSFds(void); ~MSFds(void); int howMany(void) { return _howmany; } int size(void) { return _size; } int sizeOf(void) { return _sizeof; } fd_set *all(void) { return &_all; } fd_set *none(void) { return &_none; } fd_set *r(void) { return &_r; } fd_set *ra(void) { return &_ra; } fd_set *w(void) { return &_w; } fd_set *wa(void) { return &_wa; } fd_set *x(void) { return &_x; } fd_set *xa(void) { return &_xa; } int fdsanyset(fd_set *p); void fdsclr(fd_set *p,int fd); void fdscopy(fd_set *p1,fd_set *p2); fd_set *fdsdup(fd_set *p); void fdsfree(fd_set *p); void fdsfresh(int fd); void fdsinit(void); int fdsisset(fd_set *p,int fd); void fdsset(fd_set *p,int fd); void fdszero(fd_set *p); void fdsand(fd_set *p1,fd_set *p2,fd_set *r); void fdsor(fd_set *p1,fd_set *p2,fd_set *r); void fdscopy(void); void fdszero(void); }; #endif aplus-fsf-4.22/src/MSIPC/MSHostPort.H0000644000265000001440000000140710772770441012626 #ifndef MSHostPortHEADER #define MSHostPortHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSIPCExport MSHostPort { protected: MSString _host; int _port; public: MSHostPort(void); MSHostPort(struct sockaddr_in *); MSHostPort(const char *host_,int port_); ~MSHostPort(void) {} void set(const char *host_,int port_); const MSString& host(void) const {return _host;} int port(void) const {return _port;} struct sockaddr_in *sockaddr_in(int&); }; #endif aplus-fsf-4.22/src/MSIPC/MSIPC.H0000644000265000001440000000074710772770441011465 #ifndef MSIPCHEADER #define MSIPCHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #endif aplus-fsf-4.22/src/MSIPC/MSIPService.H0000644000265000001440000000521310772770442012675 #ifndef MSIPServiceHEADER #define MSIPServiceHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSIPCExport MSIPService { public: enum CN_TYPE{CN_TYPE_ERR=0x1,CN_TYPE_HOSTPORT=0x2,CN_TYPE_REMPROGS=0x3}; class MSIPCExport Remprog { friend class MSIPService; char *_rp_host; long _rp_prognum; char *_rp_protocol; }; private: static int _countRemprogEntries; static int _countService; static int _currentService; MSHostPort _hostport; MSString _serviceName; MSString _protocol; char *_remprogBuffer; Remprog *_remprogEntry,*_remprogEntryPointer,*_remprogEntries; MSBoolean _isValid; MSBoolean _isReady; protected: int getIPService(void); int getRemprog(void); int nextIPService(void); MSBoolean getServByName(void); int getRemprogByName(void); int remprogParseValue(char *); MSBoolean lookupRemprogService(void); static void compress(register char *fromptr); CN_TYPE inp_parse(const char *serviceName_); public: MSIPService(const MSString &serviceName); MSIPService(void); ~MSIPService(void); void establish(const MSString &serviceName_); void establish(void); const MSString &protocol(void); void protocol(const MSString &new_); const MSString &serviceName(void); void serviceName(const MSString &new_); const MSString &host(void); int port(void); const MSHostPort &hostPort(void); void setHostPort(const MSString &host_,long port_); MSBoolean isValid(void); MSBoolean isReady(void); void isReady(MSBoolean set_); }; inline const MSString &MSIPService::protocol(void) { return _protocol; } inline void MSIPService::protocol(const MSString &new_) { _protocol=new_; } inline const MSString &MSIPService::serviceName(void) { return _serviceName; } inline void MSIPService::serviceName(const MSString &new_) { _serviceName=new_; } inline const MSString &MSIPService::host(void) { return _hostport.host(); } inline int MSIPService::port(void) { return _hostport.port(); } inline const MSHostPort &MSIPService::hostPort(void) { return _hostport; } inline void MSIPService::setHostPort(const MSString &host_,long port_){ _hostport.set(host_,port_); } inline MSBoolean MSIPService::isValid(void) { return _isValid; } inline MSBoolean MSIPService::isReady(void) { return _isReady; } inline void MSIPService::isReady(MSBoolean set_) { _isReady=set_; } #endif aplus-fsf-4.22/src/MSIPC/MSIntervalTimer.H0000644000265000001440000000116210772770442013630 #ifndef MSIntervalTimerHEADER #define MSIntervalTimerHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSIPCExport MSIntervalTimer : public MSTimer { public: MSIntervalTimer(unsigned long msec_,MSCallback *cb_=0); ~MSIntervalTimer(void); void expirationInterval(unsigned long msec_); unsigned long expirationInterval(void) const; }; #endif aplus-fsf-4.22/src/MSIPC/MSIpcConnection.H0000644000265000001440000000275610772770442013610 #ifndef MSIpcConnectionHEADER #define MSIpcConnectionHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSIPCExport XDR { private: void *_data; public: XDR(void){} ~XDR(void){} }; #ifdef MS_VC_TEMPLATE_INSTANTIATION class MSIPCExport MSProtocolConnection; #endif class MSIPCExport MSIpcConnection : public MSProtocolConnection { protected: virtual void doRead(void); public: MSIpcConnection(const char *name_, const char *host_, int port_); MSIpcConnection(const char *name_, const MSString &serviceName_); MSIpcConnection(const char *name_, int fd_); ~MSIpcConnection(void); virtual int send(const XDR &); virtual int syncSend(const XDR &msg_,double seconds); virtual int syncSend(const XDR &msg_,int seconds,int microseconds,MSBoolean isAbsolute); virtual int doSyncRead(XDR &msg_); }; // We provide explicit "do_not_instantiate" pragmas here to avoid instantiation complications in // MStk applications. // #if !defined(__MSIPCLIBRARY_BUILD__) && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma do_not_instantiate MSProtocolConnection #endif // !__MSIPCLIBRARY_BUILD__ && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #endif aplus-fsf-4.22/src/MSIPC/MSLimits.H0000644000265000001440000000210310772770442012300 #ifndef MSLimitsHEADER #define MSLimitsHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #if !defined(MS_NO_LIMITS_HEADER) #include #else #if defined(MS_HAS_SYS_LIMITS_HEADER) #include #else #define CHAR_BIT (8) #define CHAR_MAX ((char)(127)) #define CHAR_MIN ((char)(-128)) #define SCHAR_MAX ((char)(127)) #define SCHAR_MIN ((char)(-128)) #define UCHAR_MAX ((unsigned char)(255)) #define SHRT_MAX ((short)(32767)) #define SHRT_MIN ((short)(-32768)) #define USHRT_MAX ((unsigned short)(65535)) #define INT_MAX ((int)(2147483647)) #define INT_MIN ((int)(-2147483648)) #define UINT_MAX ((unsigned)(4294967295)) #define LONG_MAX ((long)(2147483647)) #define LONG_MIN ((long)(-2147483648)) #define ULONG_MAX ((unsigned long)(4294967295)) #endif // MS_HAS_SYS_LIMITS_HEADER #endif //MS_NO_LIMITS_HEADER #endif aplus-fsf-4.22/src/MSIPC/MSListener.H0000644000265000001440000001516310772770442012636 #ifndef MSListenerHEADER #define MSListenerHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #include class MSIPCExport MSListener { public: enum LRetry{No=0,Yes=1}; typedef void (*AcceptCallback)(int,const struct sockaddr *,int,const struct sockaddr *,int,void *); protected: // configuration information MSString _name; // MSListener's name int _pri; // connection accept priority MSListener::LRetry _retry; // retry listening after failure int _domain; // socket address domain int _type; // socket type int _protocol; // socket protocol int _remoteNamelen; // maximum remote name len on accept // state information MSExpBackoff _retryTime; // retry time limit with back-off int _fd; // file descriptor int _localNamelen; // local name length struct sockaddr *_localName; // local name struct sockaddr *_remoteName; // remote name MSRegularTimer *_retryTimer; // retry timer MSChannel *_acceptChannel; // administrative information time_t _createTod; // time MSListener was created time_t _openTod; // time MSListener was opened time_t _listenTod; // time MSListener started listening time_t _acceptTod; // time of last accept time_t _deafTod; // time of MSListener stopped listening time_t _closeTod; // time of last close time_t _openedTime; // seconds opened in prev instances time_t _listenedTime; // seconds listened in prev instances unsigned _openCount; // number of times opened unsigned _listenCount; // number of times listening unsigned _acceptCount; // number of connections accepted unsigned _deafCount; // number of times stopped listening unsigned _closeCount; // number of times closed AcceptCallback _acceptCB; void *_acceptCBData; inline int priority(void) const; inline int domain(void) const; inline int type(void) const; inline int protocol(void) const; inline int remoteNamelen(void) const; inline int fd(void) const; inline int localNamelen(void) const; inline MSExpBackoff& retryTime(void); inline MSRegularTimer *retryTimer(void); inline struct sockaddr *localName(void); inline struct sockaddr *remoteName(void); inline MSChannel *acceptChannel(void); inline time_t createTod(void) const; inline time_t openTod(void) const; inline time_t listenTod(void) const; inline time_t acceptTod(void) const; inline time_t deafTod(void) const; inline time_t closeTod(void) const; inline time_t openedTime(void) const; inline time_t listenedTime(void) const; inline unsigned openCount(void) const; inline unsigned listenCount(void) const; inline unsigned acceptCount(void) const; inline unsigned deafCount(void) const; inline unsigned closeCount(void) const; void processAccept(void); void setBlockingMode(int fd_); void createRetryTimer(time_t); void removeRetryTimer(void); void initRetryTimer(void); void createAcceptChannel(void); void removeAcceptChannel(void); virtual void doRetry(void); virtual void doOpen(void); virtual void doClose(void); public: MSListener(const char *,int,LRetry,int,int,int,int,int); virtual ~MSListener(void); inline const MSString& name(void) const; inline MSListener::LRetry retry(void) const; inline void retry(MSListener::LRetry retry_); void acceptCallback(AcceptCallback,void *); inline AcceptCallback acceptCallback(void); inline void *acceptCallbackData(void); void open(void); void close(void); virtual MSBoolean establish(void); virtual MSBoolean publish(void); virtual void acceptNotify(int,const struct sockaddr *,int,const struct sockaddr *,int); }; inline void MSListener::retry(MSListener::LRetry retry_) { _retry=retry_;} inline const MSString& MSListener::name(void) const {return _name;} inline int MSListener::priority(void) const {return _pri;} inline MSListener::LRetry MSListener::retry(void) const {return _retry;} inline int MSListener::domain(void) const {return _domain;} inline int MSListener::type(void) const {return _type;} inline int MSListener::protocol(void) const {return _protocol;} inline int MSListener::remoteNamelen(void) const {return _remoteNamelen;} inline int MSListener::fd(void) const {return _fd;} inline int MSListener::localNamelen(void) const {return _localNamelen;} inline time_t MSListener::createTod(void) const {return _createTod;} inline time_t MSListener::openTod(void) const {return _openTod;} inline time_t MSListener::listenTod(void) const {return _listenTod;} inline time_t MSListener::acceptTod(void) const {return _acceptTod;} inline time_t MSListener::deafTod(void) const {return _deafTod;} inline time_t MSListener::closeTod(void) const {return _closeTod;} inline time_t MSListener::openedTime(void) const {return _openedTime;} inline time_t MSListener::listenedTime(void) const {return _listenedTime;} inline unsigned MSListener::openCount(void) const {return _openCount;} inline unsigned MSListener::listenCount(void) const {return _listenCount;} inline unsigned MSListener::acceptCount(void) const {return _acceptCount;} inline unsigned MSListener::deafCount(void) const {return _deafCount;} inline unsigned MSListener::closeCount(void) const {return _closeCount;} inline MSExpBackoff& MSListener::retryTime(void) {return _retryTime;} inline MSRegularTimer *MSListener::retryTimer(void) {return _retryTimer;} inline struct sockaddr *MSListener::localName(void) {return _localName;} inline struct sockaddr *MSListener::remoteName(void) {return _remoteName;} inline MSChannel *MSListener::acceptChannel(void) {return _acceptChannel;} inline MSListener::AcceptCallback MSListener::acceptCallback(void) {return _acceptCB;} inline void *MSListener::acceptCallbackData(void) {return _acceptCBData;} #endif aplus-fsf-4.22/src/MSIPC/MSMainLoop.H0000644000265000001440000000224210772770442012561 #ifndef MSMainLoopHEADER #define MSMainLoopHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSIPCExport MSMainLoop { public: MSMainLoop(void); virtual ~MSMainLoop(void); virtual void loop(void); virtual void flushAndProcess(MSBoolean blocking_=MSFalse); static void continueLoop(MSBoolean continueLoop_); static MSBoolean continueLoop(void); static void quit(void); protected: virtual MSBoolean processTimers(void); virtual MSBoolean flush(void); virtual void selectAndProcess(void); virtual void outerLoop(void); virtual void innerLoop(MSBoolean blocking_=MSTrue); virtual void innerLoopFlush(MSBoolean blocking_); virtual void userProcessing(void); virtual void terminateLoop(void); static MSBoolean zeroTimeOut(void); static void zeroTimeOut(MSBoolean zeroTimeOut_); private: static MSBoolean _zeroTimeOut; static MSBoolean _continueLoop; }; #endif aplus-fsf-4.22/src/MSIPC/MSProtocolConnection.H0000644000265000001440000002051510772770442014667 #ifndef MSProtocolConnectionHEADER #define MSProtocolConnectionHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include template class MSProtocolConnection: public MSConnection { public: #ifdef MS_CLASS_ENUM_OVERLOADING_BUG enum State2{ReadPause=0x1,WritePause=0x2,Debug=0x10,Read=0x20,Write=0x40,Reset=0x80}; typedef int State; #else enum State{ReadPause=0x1,WritePause=0x2,Debug=0x10,Read=0x20,Write=0x40,Reset=0x80}; #endif typedef void (*ReadCallback)(const Type &,void *); typedef void (*SentCallback)(int,void *); typedef void (*ConnectCallback)(void *); typedef void (*ResetCallback)(MSProtocolConnection::State,void *); protected: MSHostPort _hostPort; MSIPService _service; MSNodeItem _writeList; MSBuffer *_headBuffer; MSBuffer *_readBuffer; MSRegularTimer *_timer; MSString _name; MSChannel *_readChannel; MSChannel *_writeChannel; ReadCallback _readCB; void *_readCBData; SentCallback _sentCB; void *_sentCBData; ConnectCallback _connectCB; void *_connectCBData; ResetCallback _resetCB; void *_resetCBData; unsigned long _state; MSBoolean _burstMode; char *_syncErrorBuffer; inline MSHostPort& hostPort(void); inline MSRegularTimer *timer(void); // workaround a lucid compiler bug - i.e. MethodCallbacks // cannot directly invoke a virtual method. inline void doReadCall(void); inline void doWriteCall(void); inline void doConnectCall(void); inline void doWriteResetCall(void); void init(void); virtual void doRead(void); virtual void doReadBurst(void); virtual int doWrite(void); virtual int doWrite(MSBoolean); virtual void doConnect(void); virtual int doSyncWrite(void); virtual int doSyncRead(Type &); int syncReadSelectLoop(Type &,struct timeval *timeout); int syncWriteSelectLoop(struct timeval *timeout); virtual void syncErrorReport(void); int syncError(int rc,const char *symbol_,const char *fmt_, ...); virtual void writeReset(void); virtual void reset(void); // reset the connection virtual void cleanup(void); // cleanup before connection close virtual MSBoolean establish(void); // establish connection virtual MSBoolean setup(void); // setup the connection remote name virtual int readTheBuffer(MSBuffer *,int); virtual void sendTheBuffer(MSBuffer *); virtual int writeTheBuffer(MSBuffer *,int); public: MSProtocolConnection(const char *name_,const char *host_,int port_); MSProtocolConnection(const char *name_,const MSString &serviceName_); MSProtocolConnection(const char *name_,int fd_); ~MSProtocolConnection(void); inline MSBoolean isSet(State); inline MSChannel *readChannel(void); inline MSChannel *writeChannel(void); inline MSNodeItem *writeList(void); inline MSBuffer *headBuffer(void); inline MSBuffer *readBuffer(void); inline MSIPService& service(void); inline const MSString& host(void) const; inline int port(void) const; inline const MSString& name(void) const; inline unsigned long state(void) const; inline MSBoolean burstMode(void); inline void burstMode(MSBoolean burstMode_); inline void set(State); inline void unset(State); virtual int send(const Type&); virtual int syncRead(Type &,double seconds); virtual int syncRead(Type &,int seconds,int microseconds,MSBoolean isAbsolute=MSFalse); virtual int syncSend(const Type &,double seconds); virtual int syncSend(const Type &,int seconds,int microseconds,MSBoolean isAbsolute=MSFalse); virtual void readNotify(const Type&); virtual void sentNotify(int); virtual void connectNotify(void); virtual void resetNotify(State); virtual void resetWithError(State); // Callback API void readCallback(ReadCallback,void *); inline ReadCallback readCallback(void); inline void *readCallbackData(void); void sentCallback(SentCallback,void *); inline SentCallback sentCallback(void); inline void *sentCallbackData(void); void connectCallback(ConnectCallback,void *); inline ConnectCallback connectCallback(void); inline void *connectCallbackData(void); void resetCallback(ResetCallback,void *); inline ResetCallback resetCallback(void); inline void *resetCallbackData(void); }; template inline MSHostPort& MSProtocolConnection:: hostPort(void) { return _hostPort; } template inline MSIPService& MSProtocolConnection:: service(void) { return _service; } template inline const MSString& MSProtocolConnection:: name(void) const { return _name; } template inline unsigned long MSProtocolConnection:: state(void) const { return _state; } template inline MSBoolean MSProtocolConnection:: burstMode(void) { return _burstMode; } template inline void MSProtocolConnection:: burstMode(MSBoolean burstMode_) { _burstMode=burstMode_; } template inline typename MSProtocolConnection::ReadCallback MSProtocolConnection:: readCallback(void) { return _readCB; } template inline void *MSProtocolConnection:: readCallbackData(void) { return _readCBData; } template inline typename MSProtocolConnection::SentCallback MSProtocolConnection:: sentCallback(void) { return _sentCB; } template inline void *MSProtocolConnection:: sentCallbackData(void) { return _sentCBData; } template inline typename MSProtocolConnection::ConnectCallback MSProtocolConnection:: connectCallback(void) { return _connectCB; } template inline void *MSProtocolConnection:: connectCallbackData(void) { return _connectCBData; } template inline typename MSProtocolConnection::ResetCallback MSProtocolConnection:: resetCallback(void) { return _resetCB; } template inline void *MSProtocolConnection:: resetCallbackData(void) { return _resetCBData; } template inline MSRegularTimer *MSProtocolConnection:: timer(void) { return _timer; } template inline MSBoolean MSProtocolConnection:: isSet(State s_) { return (_state&s_)?MSTrue:MSFalse; } template inline MSChannel *MSProtocolConnection:: readChannel(void) { return _readChannel; } template inline MSChannel *MSProtocolConnection:: writeChannel(void) { return _writeChannel; } template inline MSNodeItem *MSProtocolConnection:: writeList(void) { return &_writeList; } template inline MSBuffer *MSProtocolConnection:: headBuffer(void) { return _headBuffer; } template inline MSBuffer *MSProtocolConnection:: readBuffer(void) { return _readBuffer; } template inline const MSString& MSProtocolConnection:: host(void) const { return _hostPort.host(); } template inline int MSProtocolConnection:: port(void) const { return _hostPort.port(); } template inline void MSProtocolConnection:: set(State s_) { _state|=s_; } template inline void MSProtocolConnection:: unset(State s_) { _state&=~s_; } template inline void MSProtocolConnection:: doReadCall(void) { if (burstMode()==MSTrue) doReadBurst(); else doRead(); } template inline void MSProtocolConnection:: doWriteCall(void) { doWrite(); } template inline void MSProtocolConnection:: doConnectCall(void) { doConnect(); } template inline void MSProtocolConnection:: doWriteResetCall(void) { writeReset(); } #endif aplus-fsf-4.22/src/MSIPC/MSProtocolListener.H0000644000265000001440000000216010772770442014351 #ifndef MSProtocolListenerHEADER #define MSProtocolListenerHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include class MSIPCExport MSProtocolListener : public MSListener { protected: MSHostPort _hostPort; MSString _name; MSIPService _service; MSHostPort& hostPort(void) {return _hostPort;} MSIPService& service(void) {return _service;} public: MSProtocolListener(const char *name_,int port_); MSProtocolListener(const char *name_,const MSString &serviceName_); ~MSProtocolListener(void); const MSString& name(void) const {return _name;} const MSString& host(void) const {return _hostPort.host();} int port(void) const {return _hostPort.port();} virtual MSBoolean establish(void); }; #endif aplus-fsf-4.22/src/MSIPC/MSRawConnection.H0000644000265000001440000000267710772770442013630 #ifndef MSRawConnectionHEADER #define MSRawConnectionHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #ifdef MS_VC_TEMPLATE_INSTANTIATION class MSIPCExport MSProtocolConnection; #endif class MSIPCExport MSRawConnection : public MSProtocolConnection { protected: virtual void doRead(void); public: MSRawConnection(const char *name_, const char *host_, int port_); MSRawConnection(const char *name_, const MSString &serviceName_); MSRawConnection(const char *name_, int fd_); ~MSRawConnection(void); virtual int send(const MSString &); virtual int syncSend(const MSString &msg_,double seconds); virtual int syncSend(const MSString &msg_,int seconds,int microseconds,MSBoolean isAbsolute=MSFalse); virtual int doSyncRead(MSString &); }; // We provide explicit "do_not_instantiate" pragmas here to avoid instantiation complications in // MStk applications. // #if !defined(__MSIPCLIBRARY_BUILD__) && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma do_not_instantiate MSProtocolConnection #endif // !__MSIPCLIBRARY_BUILD__ && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #endif aplus-fsf-4.22/src/MSIPC/MSRegularTimer.H0000644000265000001440000000110410772770442013441 #ifndef MSRegularTimerHEADER #define MSRegularTimerHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSIPCExport MSRegularTimer : public MSTimer { public: MSRegularTimer(unsigned long msec_,MSCallback *cb_); MSRegularTimer(time_t sec_,long usec_,MSCallback *cb_); ~MSRegularTimer(void); }; #endif aplus-fsf-4.22/src/MSIPC/MSTimer.H0000644000265000001440000000326710772770442012133 #ifndef MSTimerHEADER #define MSTimerHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include class MSNodeItem; class MSIPCExport MSTimer { public: enum TType {Regular,Absolute,Interval}; protected: static MSNodeItem *_pTimerList; struct timeval _expire; struct timeval _interval; TType _type; MSNodeItem *_pNode; MSCallback *_pCallback; void init(TType type_,time_t sec_,long usec_,MSCallback *pCallback_); MSNodeItem *pNode(void); public: MSTimer(TType type_,unsigned long msec_,MSCallback *pCallback_); MSTimer(TType type_,time_t sec_,long usec_,MSCallback *pCallback_); virtual ~MSTimer(void); static struct timeval *nextTimeVal(void); inline struct timeval *expire(void); inline struct timeval *interval(void); inline MSTimer::TType type(void) const; void callback(MSCallback *); inline MSCallback *callback(void); void reset(void); void stop(void); static MSBoolean processTimers(void); virtual void process(void); }; inline MSNodeItem *MSTimer::pNode(void) {return _pNode;} inline struct timeval *MSTimer::expire(void) {return &_expire;} inline struct timeval *MSTimer::interval(void) {return &_interval;} inline MSTimer::TType MSTimer::type(void) const {return _type;} inline MSCallback *MSTimer::callback(void) {return _pCallback;} #endif aplus-fsf-4.22/src/MSIPC/MSTv.H0000644000265000001440000000163410772770442011440 #ifndef MSTvHEADER #define MSTvHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #define MILLION_USECS ((long)(1000000)) extern MSIPCExport int tvcmp(struct timeval *p1,struct timeval *p2); extern MSIPCExport int tvdiff(struct timeval *p1,struct timeval *p2,struct timeval *p3); extern MSIPCExport int tvnorm(struct timeval *p); extern MSIPCExport int tvsum(struct timeval *p1,struct timeval *p2,struct timeval *p3); extern MSIPCExport struct timeval tod_l; extern MSIPCExport struct timeval *tod(void); extern MSIPCExport time_t todsec(void); #endif aplus-fsf-4.22/src/MSIPC/MSProtocolConnection.C0000644000265000001440000003463210772770442014667 #ifndef MSProtocolConnectionIMPLEMENTATION #define MSProtocolConnectionIMPLEMENTATION /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #if defined(MS_NEED_SYS_NERR_DECLARATION) extern "C" int sys_nerr; extern "C" char* sys_errlist[]; #endif template MSProtocolConnection::MSProtocolConnection(const char *name_, const char *host_,int port_) : MSConnection(name_,0,MSConnection::Yes,1,16,AF_INET,SOCK_STREAM,0) { init(); _hostPort.set(host_,port_); _name=name_; } template MSProtocolConnection::MSProtocolConnection(const char *name_, const MSString &serviceName_) : MSConnection(name_,0,MSConnection::Yes,1,16,AF_INET,SOCK_STREAM,0) { init(); _service.establish(serviceName_); _hostPort.set(_service.host(),_service.port()); _name=name_; } template MSProtocolConnection::MSProtocolConnection(const char *name_,int fd_) : MSConnection(name_,0,MSConnection::No,1,16,AF_INET,SOCK_STREAM,0) { init(); _fd=fd_; _name=name_; if (establish()==MSTrue) acknowledge(); } template void MSProtocolConnection::init(void) { _readChannel=0; _writeChannel=0; _headBuffer=0; _readBuffer=0; _state=0; _burstMode=MSFalse; _timer=0; _readCB=0; _sentCB=0; _connectCB=0; _resetCB=0; _readCBData=0; _sentCBData=0; _connectCBData=0; _resetCBData=0; _syncErrorBuffer=0; } template MSProtocolConnection::~MSProtocolConnection(void) { _retry=MSConnection::No; close(); cleanup(); } // subclasses should provide their own send and read methods // based on the particualars of the data. template int MSProtocolConnection::send(const Type&) { return 0; } template void MSProtocolConnection::doRead(void) {} template void MSProtocolConnection::doReadBurst(void) {} template MSBoolean MSProtocolConnection::setup(void) { if (service().isValid()==MSTrue) { if (service().isReady()==MSFalse) { service().establish(); hostPort().set(service().host(),service().port()); } } _remoteName=(struct sockaddr *)hostPort().sockaddr_in(_remoteNamelen); return (_remoteName!=0)?MSTrue:MSFalse; } template MSBoolean MSProtocolConnection::establish(void) { int kaf=1; struct sockaddr sockname; int socklen=sizeof(struct sockaddr); // check to see if connection is really there #if defined(HAVE_SOCKLEN_T) if (getpeername(fd(),(struct sockaddr *)&sockname,(socklen_t *)&socklen)) #else if (getpeername(fd(),(struct sockaddr *)&sockname,&socklen)) #endif { MSMessageLog::warningMessage("MSProtocolConnection: getpeername failed: %s\n", (errno >(this, &MSProtocolConnection::doReadCall)); _writeChannel=new MSChannel(name().string(),fd(),0,MSChannel::Write, new MSMethodCallback >(this, &MSProtocolConnection::doWriteCall)); _headBuffer=new MSBuffer; _readBuffer=new MSBuffer; #if !defined(MS_NO_FCNTL) fcntl(fd(),F_SETFD,1); // turn on close-on-exec #endif int rc=setsockopt(fd(),SOL_SOCKET,SO_KEEPALIVE,(const char *)&kaf,sizeof(int)); if(rc==-1) return MSFalse; _timer=new MSRegularTimer(0,0, new MSMethodCallback > (this,&MSProtocolConnection::doConnectCall)); return MSTrue; } template int MSProtocolConnection::readTheBuffer(MSBuffer *b_,int n_) { int n; if (isSet(MSProtocolConnection::Reset)==MSTrue) return 0; if ((n=b_->read(fd(),n_))<0) resetWithError(MSProtocolConnection::Read); else if (n>0) { set(MSProtocolConnection::Read); } return n; } template void MSProtocolConnection::readNotify(const Type &message_) { if (readCallback()!=0) (*readCallback())(message_,readCallbackData()); } template void MSProtocolConnection::sentNotify(int sent_) { if (sentCallback()!=0) (*sentCallback())(sent_,sentCallbackData()); } template void MSProtocolConnection::connectNotify(void) { if (connectCallback()!=0) (*connectCallback())(connectCallbackData()); } template void MSProtocolConnection::resetNotify(MSProtocolConnection::State state_) { if (resetCallback()!=0) (*resetCallback())(state_,resetCallbackData()); } template void MSProtocolConnection::sendTheBuffer(MSBuffer *b_) { MSNodeItem *np=new MSNodeItem((void *)b_); np->insert(writeList()); // fifo for writing } template int MSProtocolConnection::writeTheBuffer(MSBuffer *b_,int n_) { if (isSet(MSProtocolConnection::Reset)==MSTrue) return 0; int s=0,n=0; while ((n_>0)&&((n=b_->write(fd(),n_))>0)) { s+=n; n_-=n; } if (n<0) { resetWithError(MSProtocolConnection::Write); s=n;} return s; } template void MSProtocolConnection::doConnect(void) { _timer=0; if (isSet(MSProtocolConnection::ReadPause)==MSFalse) readChannel()->enable(); if (isSet(MSProtocolConnection::Reset)==MSTrue) unset(MSProtocolConnection::Reset); connectNotify(); } template void MSProtocolConnection::writeReset(void) { _timer=0; resetWithError(MSProtocolConnection::Write); } template void MSProtocolConnection::resetWithError(MSProtocolConnection::State state_) { reset(); resetNotify(state_); } template void MSProtocolConnection::cleanup(void) { if (readChannel()!=0) { delete _readChannel; _readChannel=0; } if (headBuffer()!=0) { delete _headBuffer; _headBuffer=0; } if (readBuffer()!=0) { delete _readBuffer; _readBuffer=0; } if (writeChannel()!=0) { delete _writeChannel; _writeChannel=0; } if (_timer!=0) { delete _timer; _timer=0; } if(0!=_syncErrorBuffer){ delete _syncErrorBuffer; _syncErrorBuffer=0;} if (service().isValid()==MSTrue) { service().isReady(MSFalse); } MSNodeItem *hp=writeList(); MSNodeItem *np; while((np=hp->next())!=hp) { delete (MSBuffer *)np->data(); delete np; } } template void MSProtocolConnection::reset(void) { set(MSProtocolConnection::Reset); close(); } template int MSProtocolConnection::doWrite(void) { return doWrite(MSTrue); } template int MSProtocolConnection::doWrite(MSBoolean sw_) { if (isSet(MSProtocolConnection::Reset)==MSTrue) return 0; MSBoolean cont=MSTrue; int bytes=0,msgs=0; int c,s,n; MSNodeItem *hp=writeList(); MSNodeItem *np; MSBuffer *pBuffer; while (cont==MSTrue&&((np=hp->next())!=hp)&&isSet(MSProtocolConnection::WritePause)==MSFalse) { pBuffer=(MSBuffer *)np->data(); c=pBuffer->put()-pBuffer->get(); s=n=0; while ((c>0)&&((n=pBuffer->write(fd(),c))>0)) { s+=n; c-=n; bytes+=n; } if (pBuffer->get()==pBuffer->put()) { delete pBuffer; delete np; msgs++; unset(MSProtocolConnection::Write); } else { cont=MSFalse; set(MSProtocolConnection::Write); } if (n<0) { _timer=new MSRegularTimer(0,0, new MSMethodCallback > (this,&MSProtocolConnection::doWriteResetCall)); set(MSProtocolConnection::Reset); if (sw_==MSTrue&&msgs!=0) { sentNotify(msgs); } return msgs; } } if (hp==hp->next()) writeChannel()->disable(); if (sw_==MSTrue&&msgs!=0) { sentNotify(msgs); } return msgs; } template void MSProtocolConnection:: readCallback(MSProtocolConnection::ReadCallback pCallback_,void *pData_) { _readCB=pCallback_; _readCBData=pData_; } template void MSProtocolConnection:: sentCallback(MSProtocolConnection::SentCallback pCallback_,void *pData_) { _sentCB=pCallback_; _sentCBData=pData_; } template void MSProtocolConnection:: connectCallback(MSProtocolConnection::ConnectCallback pCallback_,void *pData_) { _connectCB=pCallback_; _connectCBData=pData_; } template void MSProtocolConnection:: resetCallback(MSProtocolConnection::ResetCallback pCallback_,void *pData_) { _resetCB=pCallback_; _resetCBData=pData_; } template int MSProtocolConnection::syncError(int rc,const char *symbol_,const char *fmt_,...) { va_list ap; if(0==_syncErrorBuffer) _syncErrorBuffer=new char[256]; strcpy(_syncErrorBuffer,symbol_); va_start(ap,fmt_); (void)vsprintf(_syncErrorBuffer+20,fmt_,ap); va_end(ap); syncErrorReport(); return rc; } template void MSProtocolConnection::syncErrorReport(void) { MSMessageLog::infoMessage(_syncErrorBuffer+20); } template int MSProtocolConnection::doSyncWrite(void) { if (isSet(MSProtocolConnection::Reset)==MSTrue) return syncError(-1,"closed","Connection Not Open\n");; MSBoolean cont=MSTrue; int bytes=0; int c,s,n; MSNodeItem *hp=writeList(); MSNodeItem *np; MSBuffer *pBuffer; while (cont==MSTrue&&((np=hp->next())!=hp)) { pBuffer=(MSBuffer *)np->data(); c=pBuffer->put()-pBuffer->get(); s=n=0; while ((c>0)&&((n=pBuffer->write(fd(),c))>0)) { s+=n; c-=n; bytes+=n; } if (pBuffer->get()==pBuffer->put()) { delete pBuffer; delete np; unset(MSProtocolConnection::Write); } else { cont=MSFalse; set(MSProtocolConnection::Write); } if (n<0) { _timer=new MSRegularTimer(0,0, new MSMethodCallback > (this,&MSProtocolConnection::doWriteResetCall)); set(MSProtocolConnection::Reset); return -1; } } if (hp==hp->next()) { if(writeChannel()->enabled()==MSTrue) { writeChannel()->disable(); } return 1; } else { return 0; } } template int MSProtocolConnection::doSyncRead(Type &) { return 0; } template int MSProtocolConnection::syncRead(Type &data_,double seconds_) { return syncRead(data_,(int)(floor(seconds_)), (int)(1000000.0*(seconds_-floor(seconds_)))); } template int MSProtocolConnection::syncRead(Type &data_,int seconds_,int microseconds_,MSBoolean isAbsolute_) { if (isSet(MSProtocolConnection::Reset)==MSTrue) return syncError(-1,"closed","Connection Not Open.\n"); struct timeval timeout, now, tvp; if (isAbsolute_==MSTrue) { if (microseconds_<0) return syncError(-1,"timeval","Negative Absolute Time\n"); tvp.tv_sec=seconds_; tvp.tv_usec=microseconds_; } else { gettimeofday(&now,NULL); timeout.tv_sec=seconds_; timeout.tv_usec=microseconds_; tvsum(&now,&timeout,&tvp); } if(readChannel()==0) return syncError(-1,"nochan","No Read Channel\n"); return syncReadSelectLoop(data_,&tvp); } template int MSProtocolConnection::syncSend(const Type &,double) { return syncError(-1,"bogus","syncSend Is Not Defined\n."); } template int MSProtocolConnection::syncSend(const Type &,int,int,MSBoolean) { return syncError(-1,"bogus","syncSend Is Not Defined\n."); } template int MSProtocolConnection::syncReadSelectLoop(Type &data_, struct timeval *timeout_) { int rc=0,result=0; struct timeval timeLeft, *tvp; if (timeout_ != (struct timeval *)0) { tvp=&timeLeft; tvnorm(timeout_); tvdiff(timeout_,tod(),tvp); if (tvp->tv_sec<0||tvp->tv_usec<0) tvp->tv_sec=tvp->tv_usec=0; } else tvp=NULL; for(;;) { if(readChannel()==0) return syncError(-1,"readchan","Lost Read Channel\n"); rc=MSChannel::select(fd(),MSChannel::Read,tvp); if(rc<0) { if (EINTR==errno) return syncError(-1,"interrupt","select() received an interrupt\n"); else if (EIO==errno) return syncError(-1,"fdsisset","unexpected event from select\n"); else return syncError(-1,"select","select() returned %d, errno %d\n", rc, errno); } else if (rc>0) { if ((result=doSyncRead(data_)) != 0 ) break; } if (tvp != (struct timeval *)0) { tvdiff(timeout_,tod(),tvp); if (tvp->tv_sec<0||tvp->tv_usec<0) tvp->tv_sec=tvp->tv_usec=0; if (tvp->tv_sec==0 && tvp->tv_usec==0) { return syncError(0,"timeout","Sync read loop timed out...\n"); } } } return result; } template int MSProtocolConnection::syncWriteSelectLoop(struct timeval *timeout_) { long result=0; long rc=0; struct timeval timeLeft, *tvp; if (timeout_!=(struct timeval *)0) { tvp=&timeLeft; tvnorm(timeout_); tvdiff(timeout_,tod(),tvp); if (tvp->tv_sec<0||tvp->tv_usec<0) tvp->tv_sec=tvp->tv_usec=0; } else tvp=NULL; for (;;) { if(writeChannel()==0) return syncError(-1,"writechan","Lost Write Channel\n"); rc=MSChannel::select(fd(),MSChannel::Write,tvp); if(rc<0) { if (errno==EINTR) return syncError(-1,"interrupt", "select() received an interrupt\n"); else if (errno==EIO) return syncError(-1,"fdsisset","unexpected event broke select()\n"); else return syncError(-1,"select", "select() returned %d, errno %d\n",rc,errno); } else if(rc>0) { if ((result=doSyncWrite()) < 0) return syncError(-1,"syncwrite","reset during sync write\n"); else if (result>0) break; } if (tvp != NULL) { tvdiff(timeout_,tod(),tvp); if (tvp->tv_sec<0||tvp->tv_usec<0) tvp->tv_sec=tvp->tv_usec=0; if (tvp->tv_sec==0 && tvp->tv_usec==0) { if(writeChannel()->enabled()==MSFalse) { writeChannel()->enable(); } return syncError(0,"timeout", "Sync write loop timed out...\n"); } } } return result; } #endif aplus-fsf-4.22/src/MSTypes/0000777000265000001440000000000010774512650011244 5aplus-fsf-4.22/src/MSTypes/Makefile.am0000444000265000001440000001354707232123632013215 ## Process this file with automake to produce Makefile.in ############################################################################### ## ## ## Copyright (c) 2001 Morgan Stanley Dean Witter & Co. All rights reserved. ## ## See .../src/LICENSE for terms of distribution. ## ## ## ## ## ############################################################################### lib_LTLIBRARIES = libMSTypes.la libMSTypes_la_SOURCES = \ MSA.C \ MSAspectEvent.C \ MSBinaryMatrix.C \ MSBinaryVector.C \ MSBool.C \ MSBoolVector.C \ MSBoyerMoore.C \ MSBuiltinVectorImpl.C \ MSCalendar.C \ MSCallback.C \ MSCallbackBehavior.C \ MSChangedCallback.C \ MSCharMatrix.C \ MSCharVector.C \ MSConvert.C \ MSData.C \ MSDate.C \ MSDateVector.C \ MSError.C \ MSEvent.C \ MSEventBlocker.C \ MSEventReceiver.C \ MSEventSender.C \ MSException.C \ MSFloat.C \ MSFloatMatrix.C \ MSFloatVector.C \ MSFormat.C \ MSFractionTables.C \ MSHashTable.C \ MSHoliday.C \ MSIndexVector.C \ MSIndexedAspectEvent.C \ MSIndexedEvent.C \ MSIndexedFunctions.C \ MSIndexedModel.C \ MSInt.C \ MSIntMatrix.C \ MSIntVector.C \ MSLongMatrix.C \ MSLongVector.C \ MSMBSDate.C \ MSMBStringBuffer.C \ MSMMap.C \ MSMappedFileAccess.C \ MSMatrix.C \ MSMessageLog.C \ MSModel.C \ MSMoney.C \ MSMoneyVector.C \ MSNameSpace.C \ MSNodeList.C \ MSNormalizedYears.C \ MSNullEvent.C \ MSOid.C \ MSRandom.C \ MSRange.C \ MSRate.C \ MSRateVector.C \ MSRefCount.C \ MSRegexp.C \ MSResourceCodeSet.C \ MSScalarModel.C \ MSSimpleString.C \ MSStack.C \ MSStopWatch.C \ MSString.C \ MSStringBuffer.C \ MSStringParser.C \ MSStringParserData.C \ MSStringTest.C \ MSStringVector.C \ MSSymbol.C \ MSSymbolVector.C \ MSTerm.C \ MSTime.C \ MSTimeVector.C \ MSUnsigned.C \ MSUnsignedLongMatrix.C \ MSUnsignedLongVector.C \ MSUnsignedMatrix.C \ MSUnsignedVector.C \ MSUtil.C \ MSVector.C \ MSVectorImpl.C \ MSCharData.T.C \ MSFloatData.T.C \ MSIntData.T.C \ MSLongData.T.C \ MSUnsignedCharData.T.C \ MSUnsignedData.T.C \ MSUnsignedLongData.T.C \ MSVariableRegistry.T.C \ MSA.H\ MSAllocator.H\ MSAspectEvent.H\ MSAutoPointer.H\ MSBaseTypeVector.H\ MSBinaryMatrix.H\ MSBinarySearch.H\ MSBinaryVector.H\ MSBool.H\ MSBoolVector.H\ MSBoyerMoore.H\ MSBuiltinSPick.H\ MSBuiltinTypeVector.H\ MSBuiltinVector.H\ MSBuiltinVectorImpl.H\ MSCFRInterpolater.H\ MSCFVInterpolater.H\ MSCalendar.H\ MSCallback.H\ MSCallbackBehavior.H\ MSChangedCallback.H\ MSCharMatrix.H\ MSCharVector.H\ MSComparator.H\ MSConstantInterpolater.H\ MSConvert.H\ MSCurve.H\ MSCurveInterpolater.H\ MSData.H\ MSDate.H\ MSDateVector.H\ MSDefines.H\ MSDependentVector.H\ MSEnum.H\ MSError.H\ MSEvent.H\ MSEventBlocker.H\ MSEventReceiver.H\ MSEventReceiverMethod.H\ MSEventSender.H\ MSException.H\ MSFloat.H\ MSFloatMatrix.H\ MSFloatSPick.H\ MSFloatVector.H\ MSFormat.H\ MSFormatFunctions.H\ MSFractionTables.H\ MSGenericArray.H\ MSGenericVector.H\ MSGlobalInlines.H\ MSHashTable.H\ MSHoliday.H\ MSIHashKeySet.H\ MSISequence.H\ MSIndexVector.H\ MSIndexedAspectEvent.H\ MSIndexedEvent.H\ MSIndexedFunctions.H\ MSIndexedModel.H\ MSInt.H\ MSIntMatrix.H\ MSIntVector.H\ MSLinearInterpolater.H\ MSLongMatrix.H\ MSLongVector.H\ MSMBSDate.H\ MSMBStringBuffer.H\ MSMMap.H\ MSManagedPointer.H\ MSMappedFileAccess.H\ MSMathDeclare.H\ MSMatrix.H\ MSMergeSort.H\ MSMessageLog.H\ MSMethodCallback.H\ MSModel.H\ MSMoney.H\ MSMoneyVector.H\ MSMutex.H\ MSNameSpace.H\ MSNodeList.H\ MSNormalizedYears.H\ MSNullEvent.H\ MSObjectTypeVector.H\ MSObservableTree.H\ MSObservableTreeEvent.H\ MSOid.H\ MSPoint.H\ MSPointer.H\ MSRandom.H\ MSRange.H\ MSRate.H\ MSRateVector.H\ MSRefCount.H\ MSRegexp.H\ MSResourceCodeSet.H\ MSScalarModel.H\ MSSimpleString.H\ MSSpecializedVector.H\ MSSplineInterpolater.H\ MSStack.H\ MSStandardOps.H\ MSStopWatch.H\ MSString.H\ MSStringBuffer.H\ MSStringEnum.H\ MSStringParser.H\ MSStringParserData.H\ MSStringTest.H\ MSStringTestMemberFn.H\ MSStringVector.H\ MSSymbol.H\ MSSymbolVector.H\ MSTabularTree.H\ MSTabularTreeCursor.H\ MSTabularTreeDefs.H\ MSTerm.H\ MSTime.H\ MSTimeVector.H\ MSTypeData.H\ MSTypeMatrix.H\ MSTypeVector.H\ MSTypes_MSF.H\ MSUnsigned.H\ MSUnsignedLongMatrix.H\ MSUnsignedLongVector.H\ MSUnsignedMatrix.H\ MSUnsignedVector.H\ MSUtil.H\ MSVariable.H\ MSVariableRegistry.H\ MSVector.H\ MSVectorImpl.H\ mp.h EXTRA_DIST = \ MSAllocatorInlines.C\ MSBaseTypeVectorInlines.C\ MSBinaryVectorInlines.C\ MSBoolInlines.C\ MSBuiltinSPickInlines.C\ MSBuiltinTypeVectorInlines.C\ MSBuiltinVectorImplInlines.C\ MSCharVectorInlines.C\ MSConvertInlines.C\ MSDataInlines.C\ MSDateInlines.C\ MSFloatInlines.C\ MSFloatSPickInlines.C\ MSFloatVectorInlines.C\ MSFormatInlines.C\ MSGenericVectorInlines.C\ MSGlobalInlines.H\ MSIndexVectorInlines.C\ MSIntInlines.C\ MSIntVectorInlines.C\ MSLongVectorInlines.C\ MSMBSDateInlines.C\ MSMoneyInlines.C\ MSNumberInlines.C\ MSObjectTypeVectorInlines.C\ MSRateInlines.C\ MSStringBufferInlines.C\ MSStringInlines.C\ MSStringVectorInlines.C\ MSSymbolInlines.C\ MSSymbolVectorInlines.C\ MSTermInlines.C\ MSTimeInlines.C\ MSTypeDataInlines.C\ MSTypeVectorInlines.C\ MSUnsignedInlines.C\ MSUnsignedLongVectorInlines.C\ MSUnsignedVectorInlines.C\ MSVectorImplInlines.C\ MSBaseTypeVector.C\ MSBuiltinSPick.C\ MSBuiltinTypeVector.C\ MSFloatSPick.C\ MSGenericVector.C\ MSIHashKeySet.C\ MSISequence.C\ MSManagedPointer.C\ MSMergeSort.C\ MSObjectTypeVector.C\ MSObservableTree.C\ MSObservableTreeEvent.C\ MSTabularTree.C\ MSTabularTreeCursor.C\ MSTypeData.C\ MSTypeMatrix.C\ MSTypeVector.C INCLUDES = -I.. aplus-fsf-4.22/src/MSTypes/Makefile.in0000644000265000001440000006761010774512521013234 # Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ ############################################################################### ############################################################################### SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CXX = @CXX@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ STRIP = @STRIP@ VERSION = @VERSION@ X_INCLUDES = @X_INCLUDES@ X_LIBS = @X_LIBS@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ lib_LTLIBRARIES = libMSTypes.la libMSTypes_la_SOURCES = \ MSA.C \ MSAspectEvent.C \ MSBinaryMatrix.C \ MSBinaryVector.C \ MSBool.C \ MSBoolVector.C \ MSBoyerMoore.C \ MSBuiltinVectorImpl.C \ MSCalendar.C \ MSCallback.C \ MSCallbackBehavior.C \ MSChangedCallback.C \ MSCharMatrix.C \ MSCharVector.C \ MSConvert.C \ MSData.C \ MSDate.C \ MSDateVector.C \ MSError.C \ MSEvent.C \ MSEventBlocker.C \ MSEventReceiver.C \ MSEventSender.C \ MSException.C \ MSFloat.C \ MSFloatMatrix.C \ MSFloatVector.C \ MSFormat.C \ MSFractionTables.C \ MSHashTable.C \ MSHoliday.C \ MSIndexVector.C \ MSIndexedAspectEvent.C \ MSIndexedEvent.C \ MSIndexedFunctions.C \ MSIndexedModel.C \ MSInt.C \ MSIntMatrix.C \ MSIntVector.C \ MSLongMatrix.C \ MSLongVector.C \ MSMBSDate.C \ MSMBStringBuffer.C \ MSMMap.C \ MSMappedFileAccess.C \ MSMatrix.C \ MSMessageLog.C \ MSModel.C \ MSMoney.C \ MSMoneyVector.C \ MSNameSpace.C \ MSNodeList.C \ MSNormalizedYears.C \ MSNullEvent.C \ MSOid.C \ MSRandom.C \ MSRange.C \ MSRate.C \ MSRateVector.C \ MSRefCount.C \ MSRegexp.C \ MSResourceCodeSet.C \ MSScalarModel.C \ MSSimpleString.C \ MSStack.C \ MSStopWatch.C \ MSString.C \ MSStringBuffer.C \ MSStringParser.C \ MSStringParserData.C \ MSStringTest.C \ MSStringVector.C \ MSSymbol.C \ MSSymbolVector.C \ MSTerm.C \ MSTime.C \ MSTimeVector.C \ MSUnsigned.C \ MSUnsignedLongMatrix.C \ MSUnsignedLongVector.C \ MSUnsignedMatrix.C \ MSUnsignedVector.C \ MSUtil.C \ MSVector.C \ MSVectorImpl.C \ MSCharData.T.C \ MSFloatData.T.C \ MSIntData.T.C \ MSLongData.T.C \ MSUnsignedCharData.T.C \ MSUnsignedData.T.C \ MSUnsignedLongData.T.C \ MSVariableRegistry.T.C \ MSA.H\ MSAllocator.H\ MSAspectEvent.H\ MSAutoPointer.H\ MSBaseTypeVector.H\ MSBinaryMatrix.H\ MSBinarySearch.H\ MSBinaryVector.H\ MSBool.H\ MSBoolVector.H\ MSBoyerMoore.H\ MSBuiltinSPick.H\ MSBuiltinTypeVector.H\ MSBuiltinVector.H\ MSBuiltinVectorImpl.H\ MSCFRInterpolater.H\ MSCFVInterpolater.H\ MSCalendar.H\ MSCallback.H\ MSCallbackBehavior.H\ MSChangedCallback.H\ MSCharMatrix.H\ MSCharVector.H\ MSComparator.H\ MSConstantInterpolater.H\ MSConvert.H\ MSCurve.H\ MSCurveInterpolater.H\ MSData.H\ MSDate.H\ MSDateVector.H\ MSDefines.H\ MSDependentVector.H\ MSEnum.H\ MSError.H\ MSEvent.H\ MSEventBlocker.H\ MSEventReceiver.H\ MSEventReceiverMethod.H\ MSEventSender.H\ MSException.H\ MSFloat.H\ MSFloatMatrix.H\ MSFloatSPick.H\ MSFloatVector.H\ MSFormat.H\ MSFormatFunctions.H\ MSFractionTables.H\ MSGenericArray.H\ MSGenericVector.H\ MSGlobalInlines.H\ MSHashTable.H\ MSHoliday.H\ MSIHashKeySet.H\ MSISequence.H\ MSIndexVector.H\ MSIndexedAspectEvent.H\ MSIndexedEvent.H\ MSIndexedFunctions.H\ MSIndexedModel.H\ MSInt.H\ MSIntMatrix.H\ MSIntVector.H\ MSLinearInterpolater.H\ MSLongMatrix.H\ MSLongVector.H\ MSMBSDate.H\ MSMBStringBuffer.H\ MSMMap.H\ MSManagedPointer.H\ MSMappedFileAccess.H\ MSMathDeclare.H\ MSMatrix.H\ MSMergeSort.H\ MSMessageLog.H\ MSMethodCallback.H\ MSModel.H\ MSMoney.H\ MSMoneyVector.H\ MSMutex.H\ MSNameSpace.H\ MSNodeList.H\ MSNormalizedYears.H\ MSNullEvent.H\ MSObjectTypeVector.H\ MSObservableTree.H\ MSObservableTreeEvent.H\ MSOid.H\ MSPoint.H\ MSPointer.H\ MSRandom.H\ MSRange.H\ MSRate.H\ MSRateVector.H\ MSRefCount.H\ MSRegexp.H\ MSResourceCodeSet.H\ MSScalarModel.H\ MSSimpleString.H\ MSSpecializedVector.H\ MSSplineInterpolater.H\ MSStack.H\ MSStandardOps.H\ MSStopWatch.H\ MSString.H\ MSStringBuffer.H\ MSStringEnum.H\ MSStringParser.H\ MSStringParserData.H\ MSStringTest.H\ MSStringTestMemberFn.H\ MSStringVector.H\ MSSymbol.H\ MSSymbolVector.H\ MSTabularTree.H\ MSTabularTreeCursor.H\ MSTabularTreeDefs.H\ MSTerm.H\ MSTime.H\ MSTimeVector.H\ MSTypeData.H\ MSTypeMatrix.H\ MSTypeVector.H\ MSTypes_MSF.H\ MSUnsigned.H\ MSUnsignedLongMatrix.H\ MSUnsignedLongVector.H\ MSUnsignedMatrix.H\ MSUnsignedVector.H\ MSUtil.H\ MSVariable.H\ MSVariableRegistry.H\ MSVector.H\ MSVectorImpl.H\ mp.h EXTRA_DIST = \ MSAllocatorInlines.C\ MSBaseTypeVectorInlines.C\ MSBinaryVectorInlines.C\ MSBoolInlines.C\ MSBuiltinSPickInlines.C\ MSBuiltinTypeVectorInlines.C\ MSBuiltinVectorImplInlines.C\ MSCharVectorInlines.C\ MSConvertInlines.C\ MSDataInlines.C\ MSDateInlines.C\ MSFloatInlines.C\ MSFloatSPickInlines.C\ MSFloatVectorInlines.C\ MSFormatInlines.C\ MSGenericVectorInlines.C\ MSGlobalInlines.H\ MSIndexVectorInlines.C\ MSIntInlines.C\ MSIntVectorInlines.C\ MSLongVectorInlines.C\ MSMBSDateInlines.C\ MSMoneyInlines.C\ MSNumberInlines.C\ MSObjectTypeVectorInlines.C\ MSRateInlines.C\ MSStringBufferInlines.C\ MSStringInlines.C\ MSStringVectorInlines.C\ MSSymbolInlines.C\ MSSymbolVectorInlines.C\ MSTermInlines.C\ MSTimeInlines.C\ MSTypeDataInlines.C\ MSTypeVectorInlines.C\ MSUnsignedInlines.C\ MSUnsignedLongVectorInlines.C\ MSUnsignedVectorInlines.C\ MSVectorImplInlines.C\ MSBaseTypeVector.C\ MSBuiltinSPick.C\ MSBuiltinTypeVector.C\ MSFloatSPick.C\ MSGenericVector.C\ MSIHashKeySet.C\ MSISequence.C\ MSManagedPointer.C\ MSMergeSort.C\ MSObjectTypeVector.C\ MSObservableTree.C\ MSObservableTreeEvent.C\ MSTabularTree.C\ MSTabularTreeCursor.C\ MSTypeData.C\ MSTypeMatrix.C\ MSTypeVector.C INCLUDES = -I.. subdir = src/MSTypes mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_CLEAN_FILES = LTLIBRARIES = $(lib_LTLIBRARIES) libMSTypes_la_LDFLAGS = libMSTypes_la_LIBADD = am_libMSTypes_la_OBJECTS = MSA.lo MSAspectEvent.lo MSBinaryMatrix.lo \ MSBinaryVector.lo MSBool.lo MSBoolVector.lo MSBoyerMoore.lo \ MSBuiltinVectorImpl.lo MSCalendar.lo MSCallback.lo \ MSCallbackBehavior.lo MSChangedCallback.lo MSCharMatrix.lo \ MSCharVector.lo MSConvert.lo MSData.lo MSDate.lo \ MSDateVector.lo MSError.lo MSEvent.lo MSEventBlocker.lo \ MSEventReceiver.lo MSEventSender.lo MSException.lo MSFloat.lo \ MSFloatMatrix.lo MSFloatVector.lo MSFormat.lo \ MSFractionTables.lo MSHashTable.lo MSHoliday.lo \ MSIndexVector.lo MSIndexedAspectEvent.lo MSIndexedEvent.lo \ MSIndexedFunctions.lo MSIndexedModel.lo MSInt.lo MSIntMatrix.lo \ MSIntVector.lo MSLongMatrix.lo MSLongVector.lo MSMBSDate.lo \ MSMBStringBuffer.lo MSMMap.lo MSMappedFileAccess.lo MSMatrix.lo \ MSMessageLog.lo MSModel.lo MSMoney.lo MSMoneyVector.lo \ MSNameSpace.lo MSNodeList.lo MSNormalizedYears.lo \ MSNullEvent.lo MSOid.lo MSRandom.lo MSRange.lo MSRate.lo \ MSRateVector.lo MSRefCount.lo MSRegexp.lo MSResourceCodeSet.lo \ MSScalarModel.lo MSSimpleString.lo MSStack.lo MSStopWatch.lo \ MSString.lo MSStringBuffer.lo MSStringParser.lo \ MSStringParserData.lo MSStringTest.lo MSStringVector.lo \ MSSymbol.lo MSSymbolVector.lo MSTerm.lo MSTime.lo \ MSTimeVector.lo MSUnsigned.lo MSUnsignedLongMatrix.lo \ MSUnsignedLongVector.lo MSUnsignedMatrix.lo MSUnsignedVector.lo \ MSUtil.lo MSVector.lo MSVectorImpl.lo MSCharData.T.lo \ MSFloatData.T.lo MSIntData.T.lo MSLongData.T.lo \ MSUnsignedCharData.T.lo MSUnsignedData.T.lo \ MSUnsignedLongData.T.lo MSVariableRegistry.T.lo libMSTypes_la_OBJECTS = $(am_libMSTypes_la_OBJECTS) DEFS = @DEFS@ DEFAULT_INCLUDES = -I. -I$(srcdir) CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/MSA.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSAspectEvent.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSBinaryMatrix.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSBinaryVector.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSBool.Plo ./$(DEPDIR)/MSBoolVector.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSBoyerMoore.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSBuiltinVectorImpl.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSCalendar.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSCallback.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSCallbackBehavior.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSChangedCallback.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSCharData.T.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSCharMatrix.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSCharVector.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSConvert.Plo ./$(DEPDIR)/MSData.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSDate.Plo ./$(DEPDIR)/MSDateVector.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSError.Plo ./$(DEPDIR)/MSEvent.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSEventBlocker.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSEventReceiver.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSEventSender.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSException.Plo ./$(DEPDIR)/MSFloat.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSFloatData.T.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSFloatMatrix.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSFloatVector.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSFormat.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSFractionTables.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSHashTable.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSHoliday.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSIndexVector.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSIndexedAspectEvent.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSIndexedEvent.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSIndexedFunctions.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSIndexedModel.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSInt.Plo ./$(DEPDIR)/MSIntData.T.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSIntMatrix.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSIntVector.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSLongData.T.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSLongMatrix.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSLongVector.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSMBSDate.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSMBStringBuffer.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSMMap.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSMappedFileAccess.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSMatrix.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSMessageLog.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSModel.Plo ./$(DEPDIR)/MSMoney.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSMoneyVector.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSNameSpace.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSNodeList.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSNormalizedYears.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSNullEvent.Plo ./$(DEPDIR)/MSOid.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSRandom.Plo ./$(DEPDIR)/MSRange.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSRate.Plo ./$(DEPDIR)/MSRateVector.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSRefCount.Plo ./$(DEPDIR)/MSRegexp.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSResourceCodeSet.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSScalarModel.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSSimpleString.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSStack.Plo ./$(DEPDIR)/MSStopWatch.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSString.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSStringBuffer.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSStringParser.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSStringParserData.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSStringTest.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSStringVector.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSSymbol.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSSymbolVector.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSTerm.Plo ./$(DEPDIR)/MSTime.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSTimeVector.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSUnsigned.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSUnsignedCharData.T.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSUnsignedData.T.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSUnsignedLongData.T.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSUnsignedLongMatrix.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSUnsignedLongVector.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSUnsignedMatrix.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSUnsignedVector.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSUtil.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSVariableRegistry.T.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSVector.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/MSVectorImpl.Plo CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ CXXFLAGS = @CXXFLAGS@ CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ DIST_SOURCES = $(libMSTypes_la_SOURCES) DIST_COMMON = Makefile.am Makefile.in SOURCES = $(libMSTypes_la_SOURCES) all: all-am .SUFFIXES: .SUFFIXES: .C .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/MSTypes/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) libLTLIBRARIES_INSTALL = $(INSTALL) install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(libdir) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f"; \ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p"; \ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test -z "$dir" && dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libMSTypes.la: $(libMSTypes_la_OBJECTS) $(libMSTypes_la_DEPENDENCIES) $(CXXLINK) -rpath $(libdir) $(libMSTypes_la_LDFLAGS) $(libMSTypes_la_OBJECTS) $(libMSTypes_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSA.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSAspectEvent.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSBinaryMatrix.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSBinaryVector.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSBool.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSBoolVector.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSBoyerMoore.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSBuiltinVectorImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSCalendar.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSCallback.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSCallbackBehavior.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSChangedCallback.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSCharData.T.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSCharMatrix.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSCharVector.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSConvert.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSData.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSDate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSDateVector.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSError.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSEvent.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSEventBlocker.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSEventReceiver.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSEventSender.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSException.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSFloat.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSFloatData.T.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSFloatMatrix.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSFloatVector.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSFormat.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSFractionTables.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSHashTable.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSHoliday.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSIndexVector.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSIndexedAspectEvent.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSIndexedEvent.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSIndexedFunctions.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSIndexedModel.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSInt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSIntData.T.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSIntMatrix.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSIntVector.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSLongData.T.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSLongMatrix.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSLongVector.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSMBSDate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSMBStringBuffer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSMMap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSMappedFileAccess.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSMatrix.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSMessageLog.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSModel.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSMoney.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSMoneyVector.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSNameSpace.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSNodeList.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSNormalizedYears.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSNullEvent.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSOid.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSRandom.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSRange.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSRate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSRateVector.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSRefCount.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSRegexp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSResourceCodeSet.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSScalarModel.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSSimpleString.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSStack.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSStopWatch.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSString.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSStringBuffer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSStringParser.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSStringParserData.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSStringTest.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSStringVector.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSSymbol.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSSymbolVector.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSTerm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSTime.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSTimeVector.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSUnsigned.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSUnsignedCharData.T.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSUnsignedData.T.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSUnsignedLongData.T.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSUnsignedLongMatrix.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSUnsignedLongVector.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSUnsignedMatrix.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSUnsignedVector.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSUtil.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSVariableRegistry.T.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSVector.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSVectorImpl.Plo@am__quote@ distclean-depend: -rm -rf ./$(DEPDIR) .C.o: @AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< .C.obj: @AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CXXCOMPILE) -c -o $@ `cygpath -w $<` .C.lo: @AMDEP_TRUE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(LTCXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< CXXDEPMODE = @CXXDEPMODE@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ETAGS = etags ETAGSFLAGS = tags: TAGS 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; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ 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; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = ../.. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: $(mkinstalldirs) $(DESTDIR)$(libdir) 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_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_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-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-compile distclean-depend \ distclean-generic distclean-libtool distclean-tags dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-exec-am: install-libLTLIBRARIES install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES .PHONY: GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool distclean distclean-compile \ distclean-depend distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am info info-am install \ install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am \ install-libLTLIBRARIES install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool tags uninstall \ uninstall-am uninstall-info-am uninstall-libLTLIBRARIES # 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: aplus-fsf-4.22/src/MSTypes/MSA.C0000644000265000001440000014777710772770442011736 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #if HAVE_FSTREAM #include #else #include #endif #include #include #include #include #include #include #if defined(MS_NEED_FSYNC_DECLARATION) extern "C" int fsync(int); #endif #define CDRXRHOLEN 4 #define CDRRTLEN 1 #define CDRRLLEN 1 #define CDRRANKLEN 2 #define CDRRHOLEN 4 #define CDRFLAGSLEN 1 #define CDRLENLEN 3 #define CDRFLAGSMAGIC 0x80 #define CDRFLAGS64 0x01 #define CDRFLAGSLITTLE 0x02 #define MINIMPLEN 4 /* This are from A+, and are copied for simplification of "code-sharing". */ typedef long I; typedef double F; typedef char C; typedef MSAStruct * A; #define Tt32(t,x) ((x)<<(t+2&3)) #define Tt64(t,x) ((x)<<((((t>>1)&1)+3)&3)) #if (_MIPS_SZLONG == 64) || defined(__alpha) || defined(__ia64) #define Tt(t,x) ((x)<<((((t>>1)&1)+3)&3)) #else #define Tt(t,x) ((x)<<(t+2&3)) #endif #define aplusMask 7 #define QA(a) (0==((I)(a)&aplusMask)) #define QS(a) (a&&(a->t==STRINGTYPE)) #define It INTEGERTYPE #define Ft FLOATTYPE #define Ct CHARACTERTYPE #define Et ETYPE /* * This is a 64BIT-safe export struct header. */ struct impexpHeader { int xrho; char rt; char rl; short rank; int d[MSA::MAXRANK]; }; /* template helper function */ template static MSTypeData > * msaConvertData(MSA::a *aStructPtr, FromType *, ToType *) { MSTypeData > *d=0; if (aStructPtr!=0) { unsigned count_=(unsigned)aStructPtr->n; d = MSTypeData >::allocateWithLength(count_); ToType *dp=d->data(); FromType *data=(FromType*)(aStructPtr->p); for (unsigned i=0;ip[i]=0; } } } MSA::MSA(MSAStruct * aStructPtr_,MSBoolean iced_) { _aStructPtr=0; if (QS(aStructPtr_)) { // we don't want any "naked" symbols so we need to enclose at top level long d[MAXRANK]={ 0,0,0,0,0,0,0,0,0 }; aStructPtr(ga(ETYPE,0,1,d)); if (_aStructPtr!=0) { *_aStructPtr->p=(long) aStructPtr_; } } else { aStructPtr(aStructPtr_); } if (_aStructPtr!=0&&iced_==MSFalse) { // ic the a object passed in, do not overwrite the // internal astruct data member as it may not be equal // to the one passed in, i.e. STRINGTYPE above. (void)ic(aStructPtr_); } } MSA::MSA(const MSA& aObject_) { _aStructPtr=0; _aStructPtr=copyAStruct(aObject_._aStructPtr); } MSA::~MSA(void) { if (_aStructPtr) MSA::dc(_aStructPtr); } MSA::MSA(char msg_) { _aStructPtr=0; long d[MAXRANK]={ 1,0,0,0,0,0,0,0,0 }; aStructPtr(ga(CHARACTERTYPE,0,1,d)); if (_aStructPtr) { char *data=(char *)_aStructPtr->p; data[0]=msg_; } } MSA::MSA(long msg_) { _aStructPtr=0; long d[MAXRANK]={ 1,0,0,0,0,0,0,0,0 }; aStructPtr(ga(INTEGERTYPE,0,1,d)); if (_aStructPtr) { long *data=_aStructPtr->p; data[0]= (long) msg_; } } MSA::MSA(unsigned msg_) { _aStructPtr=0; long d[MAXRANK]={ 1,0,0,0,0,0,0,0,0 }; aStructPtr(ga(INTEGERTYPE,0,1,d)); if (_aStructPtr) { long *data=_aStructPtr->p; data[0]= (long) msg_; } } MSA::MSA(double msg_) { _aStructPtr=0; long d[MAXRANK]={ 1,0,0,0,0,0,0,0,0 }; aStructPtr(ga(FLOATTYPE,0,1,d)); if (_aStructPtr) { double *data=(double *)_aStructPtr->p; data[0]=(double)msg_; } } MSA::MSA(const MSInt& msg_) { _aStructPtr=0; long d[MAXRANK]={ 1,0,0,0,0,0,0,0,0 }; aStructPtr(ga(INTEGERTYPE,0,1,d)); if (_aStructPtr) { long *data=_aStructPtr->p; data[0]=(long)((int)msg_); } } MSA::MSA(const MSFloat& msg_) { _aStructPtr=0; long d[MAXRANK]={ 1,0,0,0,0,0,0,0,0 }; aStructPtr(ga(FLOATTYPE,0,1,d)); if (_aStructPtr) { double *data=(double *)_aStructPtr->p; data[0]=(double)msg_; } } MSA::MSA(const MSString& msg_) { _aStructPtr=0; long d[MAXRANK]={ 0,0,0,0,0,0,0,0,0 }; d[0]=msg_.length(); aStructPtr(gc(CHARACTERTYPE,1,msg_.length(),d,(long *)msg_.string())); } MSA::MSA(const MSSymbol& msg_,MSBoolean encloseSymbols_) { _aStructPtr=0; long d[MAXRANK]={ 0,0,0,0,0,0,0,0,0 }; if (encloseSymbols_==MSTrue) { aStructPtr(ga(ETYPE,0,1,d)); if (_aStructPtr) _aStructPtr->p[0] = si((char *) msg_.symbolName()); } else _aStructPtr= (MSAStruct *) si((char *) msg_.symbolName()); } MSA::MSA(const MSIntVector& msg_) { _aStructPtr=0; long d[MAXRANK]={ 0,0,0,0,0,0,0,0,0 }; long xrho=msg_.length(); d[0]=xrho; int *dp=msg_.data(); aStructPtr(ga(INTEGERTYPE,1,xrho,d)); if (_aStructPtr) { long *data=_aStructPtr->p; for (long i=0; ip; for (long i=0; ip[i]=(long) ga(ETYPE,0,1,d); if (_aStructPtr->p[i]) ((MSAStruct *) _aStructPtr->p[i])->p[0]=si((char *) msg_.elementAt(i).symbolName()); } else { _aStructPtr->p[i]=si((char *) msg_.elementAt(i).symbolName()); } } } } MSA::MSA(const MSStringVector& msg_) { _aStructPtr=0; long d[MAXRANK]={ 0,0,0,0,0,0,0,0,0 }; long xrho=msg_.length(); d[0]=xrho; aStructPtr(ga(ETYPE,1,xrho,d)); if (_aStructPtr) { for (long i=0; ip[i]=(long) gc(CHARACTERTYPE,1,msg_.elementAt(i).length(),d,(long *)msg_.elementAt(i).string()); } } } MSA::MSA(const MSCharMatrix& msg_) { _aStructPtr=0; long d[MAXRANK]={ 0,0,0,0,0,0,0,0,0 }; d[0]=msg_.rows(); d[1]=msg_.columns(); long xrho=msg_.length(); char *dp=msg_.data(); aStructPtr(ga(CHARACTERTYPE,2,xrho,d)); if (_aStructPtr) { char *data=(char *)_aStructPtr->p; for (long i=0; ip; for (long i=0; ip; for (long i=0; id[i]; } return dims; } void MSA::simpleSpecify(const MSIndexVector& location_,const MSA& aObjectB_) { unsigned index,product; if (_aStructPtr&&aObjectB_._aStructPtr&&_aStructPtr->t==ETYPE&& _aStructPtr->n!=0&&!(_aStructPtr->n==0&&_aStructPtr->r>0)) { long r=rank(); MSIntVector s=shape(); if (_aStructPtr->c > 1) { aStructPtr(gc(_aStructPtr->t, _aStructPtr->r,_aStructPtr->n, _aStructPtr->d,_aStructPtr->p)); } if (r==0) { dc((MSAStruct *)_aStructPtr->p[0]); _aStructPtr->p[0]=(long) ic(aObjectB_._aStructPtr); return; } index=location_(0); if ((r==1)&&index) { dc((MSAStruct *)_aStructPtr->p[index]); _aStructPtr->p[index]=(long) ic(aObjectB_._aStructPtr); return; } else { index=location_(r-1); product=1; for (long i=r-2; i>=0; i--) { product=product*(unsigned) s(i+1); index=index+product*(unsigned) location_(i); } dc((MSAStruct *)_aStructPtr->p[index]); _aStructPtr->p[index]=(long) ic(aObjectB_._aStructPtr); } } } void MSA::iterativeSpecify(const MSIndexVector& location_,const MSA& aObjectB_) { unsigned length=location_.length(); MSAStruct **index; index=&_aStructPtr; for (unsigned i=0;it!=ETYPE|| (*index)->n==0||((*index)->n==0&&(*index)->r>0)) return; if ((*index)->c!=1) { MSAStruct *tmp=gc((*index)->t,(*index)->r,(*index)->n, (*index)->d,(*index)->p); dc(*index); *index=tmp; } if ((*index)->r==0) index=(MSAStruct **) &((*index)->p[0]); if ((*index)->r >= 1) index=(MSAStruct **) &((*index)->p[location_(i)]); } dc(*index); *index=ic(aObjectB_._aStructPtr); } MSA MSA::simplePick(unsigned pickIndex_) const { if ( _aStructPtr==0||_aStructPtr->t!=ETYPE|| _aStructPtr->n==0||(_aStructPtr->n==0&&_aStructPtr->r>0)) return MSA(); long r=rank(); if (r==0&&((MSAStruct *) _aStructPtr->p[0])->t!=STRINGTYPE) return MSA((MSAStruct *) _aStructPtr->p[0]); else if (r>=1) return MSA((MSAStruct *) _aStructPtr->p[pickIndex_]); return MSA(); } MSA MSA::simplePick(const MSIndexVector& pickIndex_) const { unsigned I,product; if (_aStructPtr==0||_aStructPtr->t!=ETYPE|| _aStructPtr->n==0||(_aStructPtr->n==0&&_aStructPtr->r>0)) return MSA(); long r=rank(); MSIntVector s=shape(); if (r==0&&((MSAStruct *) _aStructPtr->p[0])->t!=STRINGTYPE) return MSA((MSAStruct *) _aStructPtr->p[0]); if (r==1&&pickIndex_.length()==1) { I=pickIndex_(0); return MSA((MSAStruct *) _aStructPtr->p[I]); } if (r>1&&pickIndex_.length()==r) { I=pickIndex_(r-1); product=1; for (long i=r-2; i>=0; i--) { product=product*(unsigned) s(i+1); I=I+product*(unsigned) pickIndex_(i); } return MSA((MSAStruct *) _aStructPtr->p[I]); } return MSA(); } MSA MSA::complexPick(const MSA& pickIndex_) const { if (_aStructPtr) return MSA(gpick(pickIndex_._aStructPtr,_aStructPtr),MSTrue); else return MSA(); } MSA MSA::iterativePick(const MSIndexVector& pickIndex_) const { unsigned length=pickIndex_.length(); MSAStruct * const *index; index=&(_aStructPtr); for (unsigned i=0;it!=ETYPE|| (*index)->n==0||((*index)->n==0&&(*index)->r>0)) return MSA(); if ((*index)->r==0) index=(MSAStruct **) &((*index)->p[0]); else { if ((*index)->r >= 1) index=(MSAStruct **) &((*index)->p[pickIndex_(i)]); } } return MSA(*index); } MSIntVector MSA::shape(void) const { if (_aStructPtr==0) return MSIntVector(); MSIntVector aShape(_aStructPtr->r); for (long i=0; i<_aStructPtr->r; i++) aShape.replaceAt(i,_aStructPtr->d[i]); return aShape; } static long dp(MSAStruct *aobj_) { long k=0; long depth=0; if (aobj_==0) return(depth); long t=aobj_->t; if (t==MSA::STRINGTYPE) return(-1); if ((t==MSA::INTEGERTYPE)||(t==MSA::FLOATTYPE)||(t==MSA::CHARACTERTYPE)) return(0); else { long i=0; long xrho=(aobj_->n); for (; i < xrho; ++i) { if ((k = 1 + (dp((MSAStruct *)aobj_->p[i]))) > depth) depth = k; } } return depth; } long MSA::depth(void) const { long depth=0; if (_aStructPtr!=0) { long t=_aStructPtr->t; if (t==STRINGTYPE) depth=-1; else if (t==ETYPE &&_aStructPtr->n!=0) depth=dp(_aStructPtr); } return depth; } MSA& MSA::operator=(const MSA& aObject_) { if (this!=&aObject_) { if (_aStructPtr!=0) { dc(_aStructPtr); } _aStructPtr=copyAStruct(aObject_._aStructPtr); } return *this; } char MSA::asChar(void) const { if (_aStructPtr&&_aStructPtr->t==CHARACTERTYPE) { return (char)(((char *)_aStructPtr->p)[0]); } return char('\0'); } long MSA::asLong(void) const { long d=0; if (_aStructPtr) { if (_aStructPtr->t==INTEGERTYPE) return ((long)*((long *)_aStructPtr->p)); if (_aStructPtr->t==CHARACTERTYPE) return ((long)*((char *)_aStructPtr->p)); } return d; } unsigned long MSA::asUnsignedLong(void) const { unsigned long d=0; if (_aStructPtr) { if (_aStructPtr->t==INTEGERTYPE) return ((unsigned long) *((long *)_aStructPtr->p)); if (_aStructPtr->t==CHARACTERTYPE) return ((unsigned long) *((char *)_aStructPtr->p)); } return d; } double MSA::asDouble(void) const { double d=0; if (_aStructPtr) { if (_aStructPtr->t==FLOATTYPE) return ((double)*((double *)_aStructPtr->p)); if (_aStructPtr->t==INTEGERTYPE) return ((double)*((long *)_aStructPtr->p)); if (_aStructPtr->t==CHARACTERTYPE) return ((double)*((char *)_aStructPtr->p)); } return d; } MSInt MSA::asMSInt(void) const { if (_aStructPtr) { if (_aStructPtr->t==INTEGERTYPE) return MSInt((int)*(long *)_aStructPtr->p); if (_aStructPtr->t==CHARACTERTYPE) return MSInt((int)*(char *)_aStructPtr->p); } return MSInt(); } MSFloat MSA::asMSFloat(void) const { if (_aStructPtr) { if (_aStructPtr->t==FLOATTYPE) return MSFloat((double)*((double *)_aStructPtr->p)); if (_aStructPtr->t==INTEGERTYPE) return MSFloat((double)*((long *)_aStructPtr->p)); } return MSFloat(); } MSSymbol MSA::asMSSymbol(void) const { if (_aStructPtr) { if (_aStructPtr->t==STRINGTYPE) { return MSSymbol((char *)(_aStructPtr->p)); } if (_aStructPtr->t==ETYPE&& _aStructPtr->n!=0 &&((MSAStruct *) *_aStructPtr->p)->t==STRINGTYPE) { return MSSymbol((const char *)((MSAStruct *) *_aStructPtr->p)->p); } if ( _aStructPtr->t==ETYPE&& _aStructPtr->n!=0 && ((MSAStruct *) *_aStructPtr->p)->t==ETYPE&& ((MSAStruct *) *_aStructPtr->p)->n!=0&& ((MSAStruct *) *(((MSAStruct *) _aStructPtr->p))->p)->t==STRINGTYPE) { return MSSymbol((const char *) ((MSAStruct *) *(((MSAStruct *) _aStructPtr->p))->p)->p); } } return MSSymbol(); } MSString MSA::asMSString(void) const { if (_aStructPtr) { if (_aStructPtr->t==STRINGTYPE) { return MSString((char *)(_aStructPtr->p),_aStructPtr->n); } if (_aStructPtr->t==CHARACTERTYPE) { return MSString((char *)(_aStructPtr->p),_aStructPtr->n); } if (_aStructPtr->t==ETYPE&& _aStructPtr->n!=0&&((MSAStruct *) *_aStructPtr->p)->t==STRINGTYPE) { return MSString((const char *)((MSAStruct *) *_aStructPtr->p)->p,((MSAStruct *) *_aStructPtr->p)->n); } if ( _aStructPtr->t==ETYPE&& _aStructPtr->n!=0 && ((MSAStruct *) *_aStructPtr->p)->t==ETYPE&& ((MSAStruct *) *_aStructPtr->p)->n!=0&& ((MSAStruct *) *(((MSAStruct *) _aStructPtr->p))->p)->t==STRINGTYPE) { return MSString((const char *) ((MSAStruct *) *(((MSAStruct *) _aStructPtr->p))->p)->p,((MSAStruct *) *(((MSAStruct *) _aStructPtr->p))->p)->n); } } return MSString(); } MSIntMatrix MSA::asMSIntMatrix(void) const { if (_aStructPtr&&_aStructPtr->t==INTEGERTYPE&&_aStructPtr->r>=2) { MSTypeData > *d=msaConvertData(_aStructPtr,(long*)0,(int*)0); return MSIntMatrix(d,allButLastAxis(),lastAxis()); } else return MSIntMatrix(); } MSLongMatrix MSA::asMSLongMatrix(void) const { if (_aStructPtr&&_aStructPtr->t==INTEGERTYPE&&_aStructPtr->r>=2) { MSTypeData > *d=msaConvertData(_aStructPtr,(long*)0,(long*)0); return MSLongMatrix(d,allButLastAxis(),lastAxis()); } else return MSLongMatrix(); } MSUnsignedLongMatrix MSA::asMSUnsignedLongMatrix(void) const { if (_aStructPtr&&_aStructPtr->t==INTEGERTYPE&&_aStructPtr->r>=2) { MSTypeData > *d= msaConvertData(_aStructPtr,(long*)0,(unsigned long*)0); return MSUnsignedLongMatrix(d,allButLastAxis(),lastAxis()); } else return MSUnsignedLongMatrix(); } MSCharMatrix MSA::asMSCharMatrix(void) const { if (_aStructPtr&&_aStructPtr->t==CHARACTERTYPE&&_aStructPtr->r>=2) { MSTypeData > *d=msaConvertData(_aStructPtr,(long *)0,(char*)0); return MSCharMatrix(d,allButLastAxis(),lastAxis()); } else return MSCharMatrix(); } MSFloatMatrix MSA::asMSFloatMatrix(void) const { MSTypeData > *d=0; if (_aStructPtr&&_aStructPtr->r>=2) { if(_aStructPtr->t==FLOATTYPE) d= msaConvertData(_aStructPtr,(double*)0,(double*)0); else if(_aStructPtr->t==INTEGERTYPE) d=msaConvertData(_aStructPtr,(long*)0,(double*)0); } if(d!=0) return MSFloatMatrix(d,allButLastAxis(),lastAxis()); else return MSFloatMatrix(); } MSIntVector MSA::asMSIntVector(void) const { MSTypeData > *d=0; unsigned n=0; if (_aStructPtr) { n=_aStructPtr->n; if(_aStructPtr->t==INTEGERTYPE) d=msaConvertData(_aStructPtr,(long*)0,(int*)0); else if(_aStructPtr->t==CHARACTERTYPE) d=msaConvertData(_aStructPtr,(char*)0,(int*)0); } if(d!=0) return MSIntVector(d,n); else return MSIntVector(); } MSUnsignedLongVector MSA::asMSUnsignedLongVector(void) const { if (_aStructPtr&&_aStructPtr->t==INTEGERTYPE) { unsigned n=_aStructPtr->n; MSTypeData > *d=msaConvertData(_aStructPtr,(long*)0,(unsigned long*)0); return MSUnsignedLongVector(d,n); } else return MSUnsignedLongVector(); } MSLongVector MSA::asMSLongVector(void) const { if (_aStructPtr&&_aStructPtr->t==INTEGERTYPE) { unsigned n=_aStructPtr->n; MSTypeData > *d=msaConvertData(_aStructPtr,(long*)0,(long*)0); return MSLongVector(d,n); } else return MSLongVector(); } MSCharVector MSA::asMSCharVector(void) const { if (_aStructPtr&&_aStructPtr->t==CHARACTERTYPE) { unsigned n=_aStructPtr->n; MSTypeData > *d=msaConvertData(_aStructPtr,(char*)0,(char*)0); return MSCharVector(d,n); } else return MSCharVector(); } MSFloatVector MSA::asMSFloatVector(void) const { MSTypeData > *d=0; unsigned n=0; if (_aStructPtr) { n=_aStructPtr->n; if(_aStructPtr->t==FLOATTYPE) d=msaConvertData(_aStructPtr,(double*)0,(double*)0); else if(_aStructPtr->t==INTEGERTYPE) d=msaConvertData(_aStructPtr,(long*)0,(double*)0); } if (d!=0) return MSFloatVector(d,n); else return MSFloatVector(); } MSStringVector MSA::asMSStringVector(void) const { if (_aStructPtr) { unsigned n=_aStructPtr->n; MSStringVector d; if (_aStructPtr->t==CHARACTERTYPE) { if (_aStructPtr->r==0||_aStructPtr->r==1) { //turn a char vector or 1 char into an MSStringvector of one string d<p,_aStructPtr->n); return d; } else { if (_aStructPtr->r >1) { unsigned rows=allButLastAxis(); // loop over number of rows - will // handle multiple dimensions by treating them // as two dimensional arrays unsigned cols=lastAxis(); for (unsigned i=0;ip)+i*cols,cols); return d; } } } else { if (_aStructPtr->t==ETYPE) { for (unsigned i=0;ip[i]))->t==CHARACTERTYPE) { d<p[i]))->p,((MSAStruct *) (_aStructPtr->p[i]))->n); } else { return MSStringVector(); // whole vector is illegal,not all CHARACTERTYPE } } return d; } } } return MSStringVector(); } MSSymbolVector MSA::asMSSymbolVector(void) const { if (_aStructPtr) { unsigned n=_aStructPtr->n; MSSymbolVector d; if (_aStructPtr->t==STRINGTYPE) { d<p)); return d; } else { if (_aStructPtr->t==ETYPE) { for (unsigned i=0;ip[i]))->t==STRINGTYPE) { d<p[i]))->p); } else return MSSymbolVector(); // whole vector is illegal,not all CHARACTERTYPE } return d; } } } return MSSymbolVector(); } MSA::MSAplusType MSA::aPlusType(void) const { if (_aStructPtr!=0) { switch(_aStructPtr->t) { case INTEGERTYPE: return MSAInt; case FLOATTYPE: return MSAFloat; case CHARACTERTYPE: return MSAChar; case STRINGTYPE: return MSAInvalidType; case ETYPE: { if (_aStructPtr->n==0&&_aStructPtr->r>0) return MSANull; if (((MSAStruct *)_aStructPtr->p[0]) && ((MSAStruct *)_aStructPtr->p[0])->t==STRINGTYPE) { // this is a symbol with rank==0 or a symbol vector return MSASymbol; } if (((MSAStruct *)_aStructPtr->p[0]) && (((MSAStruct *)_aStructPtr->p[0])->t==INTEGERTYPE || ((MSAStruct *)_aStructPtr->p[0])->t==FLOATTYPE || ((MSAStruct *)_aStructPtr->p[0])->t==CHARACTERTYPE || ((MSAStruct *)_aStructPtr->p[0])->t==ETYPE)) return MSABox; break; } } return MSAInvalidType; } return MSANull; } long *MSA::mab(long i_) { return (long *) MSA::balloc(i_); } long *MSA::ma(long i_) { return (long *) MSA::balloc(i_*sizeof(long)); } void MSA::mf(long *p_) { (void) MSA::bfree((char *)p_); } MSAStruct *MSA::ic(MSAStruct * aobj_) { MSAStruct *r=aobj_;; if(aobj_ && QA(aobj_)) { if(aobj_->c==0) r=gc(aobj_->t,aobj_->r,aobj_->n,aobj_->d,aobj_->p); else { ++r->c; } } return r; } void MSA::dc(MSAStruct * aobj_) { if(aobj_ && QA(aobj_)) { if(aobj_->c==0) return; if((--aobj_->c)==0) MSA::dec(aobj_); } } void MSA::dec(MSAStruct * aobj_) { if (aobj_==0) return; aobj_->c=-1; if(aobj_->t==ETYPE) { long i=0,_i=(aobj_->n); for(;i<_i;++i) { MSA::dc((MSAStruct *)(aobj_->p[i])); } } mf((long *)aobj_); } void MSA::mv(long *d_,long *s_,long n_) { long i=0,_i=(n_); for(;i<_i;++i) { *d_++=*s_++; } } char *MSA::tmv(long t_,long *d_,long *s_,long n_) { switch(t_) { case INTEGERTYPE: { long i=0,_i=(n_); for(;i<_i;++i) { *d_++=*s_++; } } return(char*)d_ ; case ETYPE: { MSAStruct **aobj=(MSAStruct **)d_; MSAStruct **b=(MSAStruct **)s_; { long i=0,_i=(n_); for(;i<_i;++i) { *aobj++=MSA::ic( (MSAStruct *) *b++); } } return (char*) aobj ; }; case FLOATTYPE: { double *aobj=(double*)d_; double *b=(double*)s_; { long i=0,_i=(n_); for(;i<_i;++i){*aobj++=*b++;} } return (char*) aobj; }; case CHARACTERTYPE: { char *aobj=(char*)d_; char *b=(char*)s_; { long i=0,_i=(n_); for(;i<_i;++i) { *aobj++=*b++; } } return (char*) aobj; }; case STRINGTYPE: { char *aobj=(char*)d_; char *b=(char*)s_; { long i=0,_i=(n_); for(;i<_i;++i) { *aobj++=*b++; } } return (char*) aobj; }; } return 0; } MSAStruct *MSA::gm(long t_,long m_,long n_) { MSAStruct * z=(MSAStruct *)mab(AHEADER+dataSize(t_,m_*n_)); z->c=1,z->t=t_,z->r=2,z->n=m_*n_; *z->d=m_; z->d[1]=n_; if (t_==CHARACTERTYPE) ((char*)z->p)[m_*n_]=0; return z; } MSAStruct *MSA::gv(long t_,long n_) { MSAStruct * z=(MSAStruct *)mab(AHEADER+dataSize(t_,n_)); z->c=1,z->t=t_,z->r=1,z->n=n_; *z->d=n_; if (t_==CHARACTERTYPE) ((char*)z->p)[n_]=0; return z; } MSAStruct *MSA::gd(long t_,MSAStruct * aobj_) { MSAStruct * z=(MSAStruct *)mab(AHEADER+dataSize(t_,aobj_->n)); z->c=1,z->t=t_,z->r=aobj_->r,z->n=aobj_->n; mv(z->d,aobj_->d,aobj_->r); if (t_==CHARACTERTYPE) ((char*)z->p)[aobj_->n]=0; return z; } MSAStruct *MSA::ga(long t_,long r_,long n_,long *d_) { MSAStruct * z=(MSAStruct *)mab(AHEADER+dataSize(t_,n_)); z->c=1,z->t=t_,z->r=r_,z->n=n_; mv(z->d,d_,r_); if (t_==CHARACTERTYPE) ((char*)z->p)[n_]=0; return z; } MSAStruct *MSA::gc(long t_,long r_,long n_,long *d_,long *p_) { MSAStruct * z=(MSAStruct *)mab(AHEADER+dataSize(t_,n_)); z->c=1,z->t=t_,z->r=r_,z->n=n_; memset((char *) z->d,0,MAXRANK*sizeof(long)); mv(z->d,d_,r_); tmv(t_,z->p,p_,n_); if (t_==CHARACTERTYPE) ((char*)z->p)[n_]=0; return z; } MSAStruct *MSA::gi(long i_) { MSAStruct * z=(MSAStruct *)mab(AHEADER+dataSize(INTEGERTYPE,1)); z->c=1,z->t=INTEGERTYPE,z->r=0,z->n=1; *z->p=i_; return z; } MSAStruct *MSA::gf(double f_) { MSAStruct * z=(MSAStruct *)mab(AHEADER+dataSize(FLOATTYPE,1)); z->c=1,z->t=FLOATTYPE,z->r=0,z->n=1; *(double*)z->p=f_; return z; } MSAStruct *MSA::gs(long t_) { MSAStruct * z=(MSAStruct *)mab(AHEADER+dataSize(t_,1)); z->c=1,z->t=t_,z->r=0,z->n=1; if(t_==CHARACTERTYPE)((char *)z->p)[1]=0; return z; } long MSA::si(char * s_) { long n=strlen(s_); MSAStruct * z; z=gv(CHARACTERTYPE,n); strcpy((char *)z->p,s_); z->t=STRINGTYPE; return (long) z; } long MSA::longAt(char *c_) { int r; memcpy((char *) &r,c_,4); r=ntohl(r); return r; } /* Description of exportAObject() sizepass() and fillpass() * ------------------------------------------------------- * This is to convert from A format data to Msvp format data. * The A object is converted into a character vector suitable * for transmission through msvp. The return is a 1 or 2 element * enclosed vector. The first element is a scaler integer * completion code. The second element,if present,is a character * vector. The second element is only present when the first * element is the scalar integer zero. */ /* importAObject() and extractpass() * * In a single traversal of the object,it should be possible to * convert from the CDR format to A objects. The header of the * CDR message should indicate that it is of dense form. Pointer * form messages are rejected. The CDRDLEN field is used to * index into the message and locate the data that will fill * the a objects described by the descriptors. Each descriptor * is handled in the extract pass function. If the extract pass * is called for a general array descriptor,then it will be called * recursively for each element of the general array. The conversion * from APL2 types to A types is as follows: B1,B4 and B8 are * converted to INTEGERTYPE. I2 and I4 are converted to INTEGERTYPE. E4 and E8 are * converted to FLOATTYPE. E16 is rejected. E4 and E8 are assumed to be in * IEEE floating point format. J8,J16 and J32 are rejected. C1 * is converted to CHARACTERTYPE. C4 is rejected. A8 is rejected. Pn is * rejected. Zn is rejected. X0 is ignored. G0 is converted into ETYPE. */ /* Export generates either I-8 or I-4 integers in 64-bit mode, and I-4 only in 32-bit mode. Import will read I-2, I-4, or I-8 (in 64 bit mode only). */ long MSA::sizepass(MSAStruct * a,long *hszp,long *dszp, int long_bytes) { register I t; if (QS(a)) { /* turn symbol into character vector */ // S s = XS(a); *hszp += (I)(CDRXRHOLEN+CDRRTLEN+CDRRLLEN+CDRRANKLEN+CDRRHOLEN); *dszp += strlen((char*)a->p); return (I)0; } else if (a && QA(a)) { *hszp += (I)(CDRXRHOLEN+CDRRTLEN+CDRRLLEN+CDRRANKLEN) + (a->r * (I)CDRRHOLEN); if ((t = a->t) == Et) { I rc, *p, n, i; if ((n = a->n) == (I)0) { /*descriptor length of prototype */ *hszp += (I)(2*(CDRXRHOLEN+CDRRTLEN+CDRRLLEN+CDRRANKLEN)+CDRRHOLEN); return (I)0; } p = a->p; for (i = (I)0; i < n; i++) { if (rc = sizepass((A)p[i], hszp, dszp, long_bytes)) return rc; } return (I)0; } switch (t) { case It: { #ifdef MS_64BIT /* we going to bail out of the export here if we don't like the size of the values stuffed in 4 byte longs */ I j; /* check for data overflow now */ if(long_bytes < sizeof(I)) { for(j=0; j < a->n; j++) if(a->p[j] > INT_MAX || a->p[j] < INT_MIN) return(54); } #endif *dszp += long_bytes * a->n; return (I)0; } case Ft: *dszp += (I)sizeof(F) * a->n; return (I)0; case Ct: *dszp += a->n; return (I)0; } return (I)54; } else { return (I)55; } } void MSA::fillpass(MSAStruct * a,char **hpp,char **dpp,char *trp,long for_a,int long_bytes) { register char *hp, *dp; I xrho; register I t, dlen, hlen; register char rt, rl; impexpHeader h; hp = *hpp; dp = *dpp; if (QS(a)) { /* turn symbol into character vector */ // S s = XS(a); // xrho = strlen(s->n); xrho=strlen((char *) a->p); h.xrho = htonl(xrho); h.rt = (for_a ? 'S' : 'C'); h.rl = 1; h.rank = htons((short)1); h.d[0] = htonl(xrho); hlen = CDRXRHOLEN+CDRRTLEN+CDRRLLEN+CDRRANKLEN+CDRRHOLEN; memcpy(hp,(char*)&h,hlen); hp+=hlen; /* CDRDSECT */ if (trp != (char *)(0)) { char *src, *end_dp; for (src = (char*)a->p, end_dp = dp + xrho; dp != end_dp; *dp++ = trp[(unsigned)(*src++ & 0xff)]); } else { memcpy(dp,(char*)a->p, (I)xrho); dp += xrho; } *hpp = hp; *dpp = dp; return; } xrho = a->n; t = a->t; switch (t) { /* changed the rl value for type It */ case It: rt = 'I'; rl = long_bytes; dlen = (I)rl * xrho; break; case Ft: rt = 'E'; rl = sizeof(F); dlen = (I)rl * xrho; break; case Ct: rt = 'C'; rl = sizeof(C); dlen = (I)rl * xrho; break; case Et: rt = 'G'; rl = 0; break; } h.xrho = htonl(xrho); h.rt = rt; h.rl = rl; h.rank = htons((short)a->r); #if defined(MS_64BIT) || defined(MS_LITTLE_ENDIAN) /* CDRRHO */ for(int i=0; i< a->r; i++) { h.d[i] = htonl(a->d[i]); } hlen = CDRXRHOLEN+CDRRTLEN+CDRRLLEN+CDRRANKLEN+a->r*CDRRHOLEN; memcpy(hp,(char*)&h,hlen); hp+=hlen; #else /* 32-bit big endian optimization for eficiency so that not to copy a->d twice.*/ hlen = CDRXRHOLEN+CDRRTLEN+CDRRLLEN+CDRRANKLEN; memcpy(hp,(char*)&h,hlen); hp+=hlen; hlen = (I)CDRRHOLEN * a->r; memcpy(hp,(char *)(a->d), hlen); hp += hlen; #endif if (t == Et) { if (xrho == (I)0) { h.xrho = htonl(1); h.rt = 'G'; h.rl = 0; h.rank = 0; hlen = CDRXRHOLEN+CDRRTLEN+CDRRLLEN+CDRRANKLEN; memcpy(hp,(char*)&h,hlen); hp+=hlen; h.xrho = 0; h.rt = 'I'; h.rl = (char)long_bytes; h.rank = htons(1); h.d[0] = htonl(xrho); hlen = CDRXRHOLEN+CDRRTLEN+CDRRLLEN+CDRRANKLEN +CDRRHOLEN; memcpy(hp,(char*)&h,hlen); hp+=hlen; } *hpp = hp; *dpp = dp; for (int i = 0; i < xrho; i++) { fillpass((A)a->p[i], hpp, dpp, trp, for_a,long_bytes); } return; } if ((t == Ct) && (trp != (char *)(0))) { char *src, *end_dp; for (src = (char *)(a->p), end_dp = dp + xrho; dp != end_dp; *dp++ = trp[(unsigned)(*src++ & 0xff)]); } #ifdef MS_64BIT else if(t == It && (long_bytes < sizeof(I))) { /* 32 bit backward compatibility mode */ #ifndef MS_LITTLE_ENDIAN hlen = sizeof(I)-long_bytes; #else hlen = 0; #endif for(int i=0; i < xrho; i++) { memcpy(dp,(char *)(a->p+i)+hlen, long_bytes); dp += long_bytes; } } #endif else { memcpy(dp,(char *)(a->p), (I)dlen); dp += dlen; } *hpp = hp; *dpp = dp; return; } /* Endian conversion routines */ void MSA::ndn16copy(char *from, char *to, int n) { for(;n--;from+=2,to+=2) { to[1]=from[0];to[0]=from[1]; } } void MSA::ndn32copy(char *from, char *to, int n) { for(;n--;from+=4,to+=4) { to[3]=from[0];to[2]=from[1];to[1]=from[2];to[0]=from[3]; } } void MSA::ndn64copy(char *from, char *to, int n) { for(;n--;from+=8,to+=8) { to[7]=from[0];to[6]=from[1];to[5]=from[2];to[4]=from[3]; to[3]=from[4];to[2]=from[5];to[1]=from[6];to[0]=from[7]; } } /* The extract pass function takes a pointer the end of the CDR * format buffer and pointers to pointers into the header and * data sections of the CDR buffer. It returns an A object that * is the importation of its part of the CDR format buffer. If * the extraction fails, a zero pointer is returned. The extract * pass handles general arrays by calling itself recursively. If * One of these calls returns zero then extract pass frees its A * object and returns zero to its caller. */ MSAStruct *MSA::extractpass(char **hpp,char **dpp,char *endp,long *erp,char *trp, int swap) { register char *hp, *dp; I xrho=0, rt, rl, rank, hlen; register I i; register A a; I d[MAXRANK]; impexpHeader h; /* process descriptor into ga call */ hp = *hpp; if ((endp - hp) < 8) { *erp = (I)1; return (A)0; } hlen = CDRXRHOLEN+CDRRTLEN+CDRRLLEN+CDRRANKLEN; memcpy((char*)&h,hp,hlen); hp+=hlen; xrho = ntohl(h.xrho); rt = h.rt; rl = h.rl; rank = ntohs(h.rank); if (rank > MAXRANK) { *erp = (I)1; return (A)0; } if ((endp - hp) < (CDRRHOLEN * rank)) { *erp = (I)1; return (A)0; } #if defined(MS_64BIT) || defined(MS_LITTLE_ENDIAN) for(i=0; i < rank; i++) { d[i] =ntohl((int)(*(int *)hp)); hp+=CDRRHOLEN; } for(i=rank; i < MAXRANK; i++) d[i] = 0; #else /* this is more efficient in this case */ memcpy((char *)(d), hp, 4 * rank); hp += 4 * rank; memset((char *)(d) + (4 * rank),0,4 * (MAXRANK - rank)); #endif *hpp = hp; if ((rt == 'P') || (rt == 'J') || (rt == 'Z') || ((rt == 'C') && (rl == 4)) || ((rt == 'E') && (rl == 16))) { /* nonce error */ *erp = (I)1; return (A)0; } if (dpp == (char **)(0)) { /* prototype */ if ((rt == 'G') && (rl== 0)) { for (i = 0; i < xrho; i++) { (void)extractpass(hpp, dpp, endp, erp, trp,swap); if (*erp != (I)0) break; } return (A)0; } if (((rt == 'X') && (rl == 0)) || ((rt == 'I') && ((rl == 2) || (rl == 4) #ifdef MS_64BIT || (rl == 8) #endif )) || ((rt == 'B') && ((rl == 1) || (rl == 4) || (rl == 8))) || ((rt == 'E') && ((rl == 4) || (rl == 8))) || ((rt == 'C') && (rl == 1)) || ((rt == 'S') && (rl == 1))) { return (A)0; } *erp = 1; return (A)0; } if ((rt == 'G') && (rl == 0)) { register A *ap; if (xrho == 0) { /* do the prototype */ (void)extractpass(hpp, (char **)(0), endp, erp, trp, swap); if (*erp != (I)0) { return (A)0; } } a = ga(Et, rank, xrho, d); ap = (A *)(a->p); memset((char *)ap,0,sizeof(I) * xrho); for (i = 0; i < xrho; i++) { if ((ap[i] = extractpass(hpp, dpp, endp, erp, trp, swap)) == (A)0) { if (*erp != 0) { dc(a); return (A)0; } /* type X0 filler */ i--; } } return a; } dp = *dpp; #ifdef MS_64BIT if ((rt == 'I') && (rl == 8)) { register C *ap; if ((endp - dp) < (rl * xrho)) { *erp = 1; return (A)0; } a = ga(It, rank, xrho, d); ap = (C *)(a->p); if(swap) ndn64copy(dp, ap, xrho); else memcpy(ap,dp,8 * xrho); dp += 8 * xrho; *dpp = dp; return a; } if ((rt == 'I') && (rl == 4)) { register I *ap; int itmp; if ((endp - dp) < (4 * xrho)) { *erp = 1; return (A)0; } a = ga(It, rank, xrho, d); ap = (I *)(a->p); for (i = 0; i < xrho; i++) { if(swap) ndn32copy(dp, (char *)&itmp, 1); else memcpy((char*)&itmp, dp, 4); ap[i] = itmp; dp += 4; } *dpp = dp; return a; } #else if ((rt == 'I') && (rl == 4)) { register C *ap; if ((endp - dp) < (4 * xrho)) { *erp = 1; return (A)0; } a = ga(It, rank, xrho, d); ap = (C *)(a->p); if(swap) ndn32copy(dp, ap, xrho); else memcpy(ap, dp, 4 * xrho); dp += 4 * xrho; *dpp = dp; return a; } #endif if ((rt == 'I') && (rl == 2)) { register I *ap; short stmp; if ((endp - dp) < (2 * xrho)) { *erp = 1; return (A)0; } a = ga(It, rank, xrho, d); ap = (I *)(a->p); for (i = 0; i < xrho; i++) { if(swap) ndn16copy(dp, (char *)&stmp, 1); else memcpy((char*)&stmp, dp, 2); ap[i] = stmp; dp += 2; } *dpp = dp; return a; } if ((rt == 'E') && (rl == 4)) { register F *ap; float ftmp; if ((endp - dp) < (rl * xrho)) { *erp = 1; return (A)0; } a = ga(Ft, rank, xrho, d); ap = (F *)(a->p); for (i = 0; i < xrho; i++) { if(swap) ndn32copy(dp, (char *)&ftmp, 1); else memcpy((char*)&ftmp, dp, 4); ap[i] = ftmp; dp += 4; } *dpp = dp; return a; } if ((rt == 'E') && (rl == 8)) { register C *ap; if ((endp - dp) < (rl * xrho)) { *erp = 1; return (A)0; } a = ga(Ft, rank, xrho, d); ap = (C *)(a->p); if(swap) ndn64copy(dp, ap, xrho); else memcpy(ap, dp, 8 * xrho); dp += 8 * xrho; *dpp = dp; return a; } if ((rt == 'C') && (rl == 1)) { register C *ap; if ((endp - dp) < xrho) { *erp = 1; return (A)0; } a = ga(Ct, rank, xrho, d); ap = (C *)(a->p); if (trp != (char *)(0)) { for (i = 0; i < xrho; i++) { ap[i] = trp[(unsigned)(*dp++ & 0xff)]; } } else { memcpy(ap, dp, xrho); dp += xrho; } *dpp = dp; return a; } if ((rt == 'S') && (rl == 1)) { register C *ap; register I s; if ((endp - dp) < xrho) { *erp = 1; return (A)0; } a = ga(Ct, 1, xrho, d); ap = (C *)(a->p); if (trp != (char *)(0)) { for (i = 0; i < xrho; i++) { ap[i] = trp[(unsigned)(*dp++ & 0xff)]; } } else { memcpy(ap, dp, xrho); dp += xrho; } *dpp = dp; s = si(ap); dc(a); return (A)s; } if ((rt == 'B') && (rl == 8)) { register I *ap; if ((endp - dp) < xrho) { *erp = 1; return (A)0; } a = ga(It, rank, xrho, d); ap = (I *)(a->p); for (i = 0; i < xrho; i++) { ap[i] = *dp; dp += 1; } *dpp = dp; return a; } if ((rt == 'B') && (rl == 4)) { register I *ap; I m; if ((endp - dp) < (xrho + 1)/2) { *erp = 1; return (A)0; } a = ga(It, rank, xrho, d); ap = (I *)(a->p); for (m = 0, i = 0; i < xrho; i++) { m = rl * (1 - (i % 2)); ap[i] = (*dp >> m) & 0x0f; dp += (m == 0); } /* skip partially used byte */ if (m != 0) dp++; *dpp = dp; return a; } if ((rt == 'B') && (rl == 1)) { register I *ap; I m; if ((endp - dp) < (xrho + 7)/8) { *erp = 1; return (A)0; } a = ga(It, rank, xrho, d); ap = (I *)(a->p); for (m = 0, i = 0; i < xrho; i++) { m = 7 - (i % 8); ap[i] = (*dp >> m) & 0x01; dp += (m == 0); } /* skip partially used byte */ if (m != 0) dp++; *dpp = dp; return a; } if ((rt == 'X') && (rl == 0)) { if ((endp - dp) < xrho) { *erp = 1; return (A)0; } dp += xrho; *dpp = dp; return (A)0; } *erp = 1; return (A)0; } void MSA::fillExportBuffer(MSAStruct * aobj,char *hp,long hsz,char *trp,long for_a,int long_bytes) { char *dp=hp+hsz; char flag = CDRFLAGSMAGIC; /* CDRFLAGS */ #ifdef MS_64BIT if(long_bytes == 8) flag |= CDRFLAGS64; #endif #ifdef MS_LITTLE_ENDIAN flag |= CDRFLAGSLITTLE; #endif *hp = flag; hp += CDRFLAGSLEN; /* CDRDLEN */ int sz=htonl((int)hsz); memcpy(hp,((char *)(&sz))+1, CDRLENLEN); hp += CDRLENLEN; fillpass(aobj, &hp, &dp, trp, for_a, long_bytes); } /* ExportAObject * * Creates a Msvp format char vector out of an A object. * * aobj is the A object to be abused. trp is a translation vector, which * must have length of 256, or be NULL. for_a is a boolean flag, if 0 A * symbols are translated to character strings, 1 uses an extention to * Msvp format. * * Result is a pointer to the character vector created. *plen is set to * the length of that vector, which may have embedded nulls. In case of * error, the result is NULL, and *plen is an error code. * */ MSA MSA::exportAObject(void) const { /* char *hp,*dp; */ long hsz=4; long dsz=0; long sz; if ((sz=sizepass(_aStructPtr,&hsz,&dsz,4))!=0) { MSMessageLog::errorMessage("MSA Error: Attempt to export an object that is not an A Object.\n"); // this should throw an exception. return MSA(); } sz=hsz+dsz; MSA result(gv(CHARACTERTYPE,sz),MSTrue); fillExportBuffer(_aStructPtr,(char *) (((MSAStruct *)result._aStructPtr)->p),hsz,(char *) 0,1,4); return result; } /* ImportAObject * * Creates an A object out of Msvp format char vector * * cvp points to the beginning of the msvp vector. cvlen is the length * of the vector. trp is a translation vector, which must have length * of 256, or be NULL. * * Result is A object created, or (A)0 in case of error. * */ MSA MSA::importAObject(char *cvp,long cvlen,char *trp) { MSA result; /* will be (A)0 if an error is detected */ register char *endp; char *hp, *dp; I hsz, rc=0; I swap =0; unsigned char flag; if (MINIMPLEN>cvlen) return MSA(); hp = cvp; endp = cvp + cvlen; flag = *hp; if ((flag&0xfC) != CDRFLAGSMAGIC) return MSA(); /* 0xfC == 11111100 */ /* Do not accept 64 bit header if we are NOT 64 bit!. */ #if !defined(MS_64BIT) if (flag&CDRFLAGS64) return MSA(); #endif /* Determine if we need to swap data bytes */ #if defined(MS_LITTLE_ENDIAN) if ((flag&CDRFLAGSLITTLE)==0) swap=1; #else if (flag&CDRFLAGSLITTLE) swap=1; #endif hp += CDRFLAGSLEN; hsz = 0; int sz=0; memcpy(((char *)(&sz))+1,hp,CDRLENLEN); hsz=ntohl(sz); hp += CDRLENLEN; dp = cvp + hsz; MSAStruct *aPtr=extractpass(&hp,&dp,endp,&rc,trp,swap); if (aPtr!=0) return MSA(aPtr,MSTrue); return MSA(); } int MSA::exportAObjectSizePass(long * hsz_, long *dsz_, int long_bytes) const { *hsz_=4; *dsz_=0; return sizepass(_aStructPtr,hsz_,dsz_,long_bytes); } int MSA::exportAObjectFillPass(char *dest_, long hsz_, char * trp_,long for_a_,int long_bytes) const { fillExportBuffer(_aStructPtr,dest_,hsz_,trp_,for_a_,long_bytes); return 0; } void MSA::beamOut(const char *fileName_,MSBoolean bExport_) const { int fd; if (fileName_!=0) { MSA data; MSAStruct *pAStruct; if(bExport_==MSTrue) { data=exportAObject(); pAStruct=data.aStructPtr(); } else { pAStruct=aStructPtr(); if(pAStruct->t==ETYPE) { MSMessageLog::errorMessage("MSA Error: Tried to beamOut a nested array without exporting.\n"); return; } } fd = open(fileName_, 1); if (fd >= 0) { (void)lseek(fd,0,SEEK_SET); long t; if (pAStruct->c!=0) pAStruct->c=0; pAStruct->i=pAStruct->r?*pAStruct->d:1; long len=AHEADER+Tt(pAStruct->t,pAStruct->n); char *pString=(char *)pAStruct; do { t=write(fd,pString,len); } while (pString+=t,t!=-1&&(len-=t)); fsync(fd); (void)close(fd); } } } MSBoolean MSA::import(void) { MSA d; d=importAObject((char *)(_aStructPtr)->p,(_aStructPtr)->n,(char *)0); *this=d; return isNullMSA(); } MSBoolean MSA::import(const MSMMap &aMap_) { *this=importAObject((char *)(aMap_.aplusData())->p,(aMap_.aplusData())->n,(char *)0); return isNullMSA(); } void *MSA::balloc(int size_) { void *p; if (size_ <= 0) { return (void *)(0); } if ((p = (void *)malloc((unsigned)size_))==(void *)(0)) { MSTKTHROWEXCEPTION(MSOutOfMemory("MSA: OUT OF MEMORY\n")); } return p; } void MSA::bfree(char *p_) { if (p_!=(char *)(0)) { free(p_); } return; } /* pcki checks for index error,pck does not */ long MSA::pcki(int i_,MSAStruct *a_) { long z; long t=a_->t; if(!a_->r)return 0; if((unsigned)i_>=a_->d[0])return 0; return t==ETYPE&&(z=(long) a_->p[i_],!((!(0==((long)(z)&7))||((MSAStruct *)z)->t>ETYPE)&&!(0&&(3==((long)(z)&7)))))?(long) MSA::ic((MSAStruct *)z):(long) MSA::gc(t,0,1,0,(long *) ((char *)a_->p+((i_)<<(t+2&3)))); } long MSA::gpu_fillivec(long *ivec_,MSAStruct *aobj_) { long i; double f,*fvec=(double *)aobj_->p; for (i=0;in;++i) { if (fvec[i]!=(f=rint(fvec[i]))) return 1; ivec_[i]=(int)f; } return 0; } long MSA::gpi_num(MSAStruct *apick_,MSAStruct *aobj_) { long idx,i,ivec[9],*ip; if (ETYPE!= aobj_->t) { return(0); }; if (2 <= apick_->r||apick_->n!=aobj_->r) { return(0); }; if (FLOATTYPE==apick_->t) { if (gpu_fillivec(ivec,apick_)) { return(0); }; ip=ivec; } else ip=apick_->p; if (aobj_->d[0]<=(unsigned)(idx=ip[0])) { return(0); }; for (i=1;in;++i) { if (aobj_->d[i]<=(unsigned)(ip[i])) { return(0); }; idx*=aobj_->d[i]; idx+=ip[i]; } return idx; } long MSA::gpi_sym(long key_,MSAStruct *aobj_) { long i,tt; MSAStruct *t0,*t1; if (ETYPE!= aobj_->t||2!=aobj_->n) {return(-1);} t0=(MSAStruct *)aobj_->p[0]; t1=(MSAStruct *)aobj_->p[1]; if ((!(0==((long)(t0)&7)))||(!(0==((long)(t1)&7)))||ETYPE!=t1->t||t0->n!=t1->n) {return (-1);} for (i=0;in;++i) { tt=t0->p[i]; if (!(STRINGTYPE==((MSAStruct *) tt)->t)) {return(-1);} if (!strcmp((const char *) ((MSAStruct *) key_)->p,(const char *) ((MSAStruct *) tt)->p)) return i; } return(-1); } MSAStruct *MSA::gp_scalar(long idx_,MSAStruct *aobj_) { MSAStruct * z,* zz; char *cvec; if (1!=aobj_->r) { return(0); }; if ((unsigned)idx_>=aobj_->n) { return(0); }; if (STRINGTYPE==aobj_->t) { return(0); }; switch (aobj_->t) { case INTEGERTYPE:return MSA::gi(aobj_->p[idx_]); case FLOATTYPE:return MSA::gf(((double *)aobj_->p)[idx_]); case CHARACTERTYPE:z=MSA::gs(CHARACTERTYPE);cvec=(char *)z->p;cvec[0]=((char *)aobj_->p)[idx_];cvec[1]='\0';return z; case ETYPE:return (MSAStruct *)pcki(idx_,aobj_); default:z=(MSAStruct *)MSA::gs(ETYPE);zz=MSA::gs(ETYPE);z->p[0]=(long)zz;zz->p[0]=aobj_->p[idx_];return z; } } MSAStruct *MSA::gp_nested(MSAStruct *apick_,MSAStruct *aobj_) { long idx,i,issymbol=0; MSAStruct * atarg,* ares=aobj_; if (2 <= apick_->r) { return(0); }; if (0==apick_->n) return (MSAStruct *)MSA::ic(ares); for (i=0;in;++i) { atarg=(MSAStruct *)apick_->p[i]; if ( (!(0==((long)(ares)&7)))||ETYPE!= ares->t) { return(0); }; if (STRINGTYPE==atarg->t) { if (-1==issymbol) { return(0); }; issymbol=1; idx=gpi_sym((long)atarg,ares); ares=(MSAStruct *)ares->p[1]; } else { if (1==issymbol) { return(0); }; issymbol=-1; if (INTEGERTYPE==atarg->t||FLOATTYPE==atarg->t) { idx=gpi_num(atarg,ares); } else if (ETYPE==atarg->t) { if (0==atarg->n&&1==ares->n) { ares=(MSAStruct *)*ares->p; continue;} if ((STRINGTYPE==atarg->t)||1!=atarg->n) { return(0); }; atarg=(MSAStruct *)*atarg->p; if (!(STRINGTYPE==atarg->t)) { return(0); }; idx=gpi_sym((long)atarg,ares); ares=(MSAStruct *)ares->p[1]; } else { return(0); }; } ares=(MSAStruct *)ares->p[idx]; } if (!(0==((long)(ares)&7))) { return(0); }; return ((!(0==((long)(ares)&7))||((MSAStruct *)ares)->t>ETYPE)&&!(0&&(3==((long)(ares)&7))))?MSA::gc(ETYPE,0,1,0,(long *) &ares):(MSAStruct *)MSA::ic(ares); } MSAStruct *MSA::gp_num(MSAStruct *apick_,MSAStruct *aobj_) { long i,*ivec=(long*)0,*ip; MSAStruct * ares=aobj_; if (2 <= apick_->r) { return(0); }; if (0==apick_->n) return (MSAStruct *)MSA::ic(ares); if (FLOATTYPE==apick_->t) { ivec=(long *) MSA::balloc(apick_->n * sizeof(long)); if (gpu_fillivec(ivec,apick_)) { MSA::bfree((char *) ivec); { return(0); }; } ip=ivec; } else ip=apick_->p; for (i=0;in;++i) { if ( (!(0==((long)(ares)&7)))||ETYPE!= ares->t) {MSA::bfree((char *) ivec);{ return(0); };} if ( 2 <= ares->r) {MSA::bfree((char *) ivec);{ return(0); };} if ((unsigned)(ip[i])>=ares->n) {MSA::bfree((char *) ivec);{ return(0); };} ares=(MSAStruct *)ares->p[ip[i]]; } MSA::bfree((char *) ivec); if (!(0==((long)(ares)&7))) { return(0); }; return ((!(0==((long)(ares)&7))||((MSAStruct *)ares)->t>ETYPE)&&!(0&&(3==((long)(ares)&7))))?MSA::gc(ETYPE,0,1,0,(long *) &ares):(MSAStruct *)MSA::ic(ares); } MSAStruct *MSA::gpick(MSAStruct *apick_,MSAStruct *aobj_) { long idx; MSAStruct * z; switch(apick_->t) { case INTEGERTYPE: case FLOATTYPE: if (1==apick_->n) { if (1!=aobj_->r) { return(0); }; if (INTEGERTYPE==apick_->t) z=(MSAStruct *)pcki(*apick_->p,aobj_); else if (gpu_fillivec(&idx,apick_)) { return(0); } else z=(MSAStruct *)pcki(idx,aobj_); } else z=gp_num(apick_,aobj_); break; case ETYPE: z=gp_nested(apick_,aobj_); break; default: { return(0); } } return z; } MSAStruct* MSA::copyAStruct(MSAStruct *aStructPtr_) { MSAStruct * aStructPtr=0; if (aStructPtr_) { long xrho=aStructPtr_->n; aStructPtr = ga(aStructPtr_->t,aStructPtr_->r,aStructPtr_->n,aStructPtr_->d); if (aStructPtr) { aStructPtr->i=aStructPtr_->i; switch(aStructPtr_->t) { case INTEGERTYPE: memcpy(aStructPtr->p,(char *) (aStructPtr_->p),(int)(sizeof(long)) *xrho); break; case FLOATTYPE: memcpy(aStructPtr->p,(char *) (aStructPtr_->p),(int)(sizeof(double)) *xrho); break; case CHARACTERTYPE: memcpy(aStructPtr->p,(char *) (aStructPtr_->p),(int)(sizeof(char)) *xrho); break; case STRINGTYPE: // we do't want any "naked" symbols so we need to enclose at top level { long d[MAXRANK]={ 0,0,0,0,0,0,0,0,0 }; MSAStruct *tmpaStructPtr; memcpy(aStructPtr->p,(char *) (aStructPtr_->p),(int)(sizeof(char)) *xrho); tmpaStructPtr = aStructPtr; aStructPtr=ga(ETYPE,0,1,d); if (aStructPtr!=0) *aStructPtr->p=(long) tmpaStructPtr; } break; case ETYPE: if (aStructPtr_->n!=0&&!(aStructPtr_->n==0&&aStructPtr_->r>0)) { for (long i=0; ip[i]=(long) ic((MSAStruct *)aStructPtr_->p[i]); } } break; default: break; } } } return aStructPtr; } aplus-fsf-4.22/src/MSTypes/MSAspectEvent.C0000644000265000001440000000072610772770443013756 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include MSAspectEvent::~MSAspectEvent(void) {} const MSSymbol& MSAspectEvent::symbol(void) { static MSSymbol symbol("MSAspectEvent"); return symbol; } aplus-fsf-4.22/src/MSTypes/MSBinaryMatrix.C0000644000265000001440000015024110772770443014144 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #if HAVE_IOSTREAM #include #else #include #endif #if HAVE_SSTREAM #include #include #else #include #endif #include #include #include #include #include #include unsigned char MSBinaryMatrix::_badData=0; const MSSymbol& MSBinaryMatrix::type(void) const { return symbol(); } MSString MSBinaryMatrix::className(void) const { return MSString("MSBinaryMatrix"); } MSString MSBinaryMatrix::asString(void) const { MSString result; result+='('; result+=MSString(rows()); result+=','; result+=MSString(columns()); result+=") "; unsigned n=count(); for (unsigned i=0;i0) { result+=MSMSF_US; result+=MSString(_rows); result+=MSMSF_US; result+=MSString(_columns); for (unsigned i=0;i<_count;i++) { result+=MSMSF_US; result+=MSString((unsigned)data()[i]); } } return result; } MSString MSBinaryMatrix::asDebugInfo(void) const { MSString result("MSBinaryMatrix(@"); result+=MSString((unsigned long)this).d2x().lowerCase(); result+=",_rows="; result+=MSString(rows()); result+=",_columns="; result+=MSString(columns()); result+=",_count="; result+=MSString(length()); result+=",_size="; result+=MSString(size()); result+=",_data="; result+=pData()->asDebugInfo(); result+=",_type="; result+=type().symbolName(); result+=")"; return MSString(result); } MSModel *MSBinaryMatrix::clone(void) const { return new MSBinaryMatrix(*this); } MSModel *MSBinaryMatrix::create(void) const { return new MSBinaryMatrix(); } void MSBinaryMatrix::assign(const MSModel& aModel_) { *this=(MSBinaryMatrix&)aModel_; } long MSBinaryMatrix::compare(const MSModel& aModel_) const { return ::compare(*this,(MSBinaryMatrix&)aModel_); } const MSSymbol& MSBinaryMatrix::symbol(void) { static MSSymbol sym ("MSBinaryMatrix"); return sym; } void MSBinaryMatrix::blockLeft(unsigned target_,unsigned moveCount_) { unsigned char *dp=data(); for (unsigned i=target_;moveCount_>0;i++,moveCount_--) dp[i]=dp[i+1]; } void MSBinaryMatrix::blockRight(unsigned target_,unsigned moveCount_) { unsigned char *dp=data(); for (unsigned i=target_+moveCount_-1;moveCount_>0;i--,moveCount_--) dp[i]=dp[i-1]; } void MSBinaryMatrix::allocData(unsigned length_) { _count=length_; if (length()>0) { _pData=MSTypeData >::allocateWithLength(length()); } else { _pData=0; } } void MSBinaryMatrix::makeUniqueCopy(void) { if (_pData!=0) { MSTypeData > *dst=MSTypeData >::allocateWithSize(size()); MSTypeData >::copy(_pData->elements(),dst->elements(),length()); //src,dst,len _pData->decrementCount(); _pData=dst; } } void MSBinaryMatrix::prepareToChange(void) { if (_pData!=0) { if (_pData->refCount()>1) makeUniqueCopy(); } else allocData(length()); } void MSBinaryMatrix::freeData(void) { decrementCount(),_pData=0; } // make sure there are at least size_+1 elements in the array void MSBinaryMatrix::reserve(unsigned size_) { unsigned n=size_+1; if (size() > *newData=MSTypeData >::allocateWithLength(n); unsigned char *dp=newData->elements(); unsigned char *sp=data(); MSTypeData >::copy(sp,dp,size()); freeData(); _pData=newData; } } //------------------------------------------------------------------------------------------------- // MSBinaryMatrix //------------------------------------------------------------------------------------------------- ostream& operator<<(ostream& aStream_,const MSBinaryMatrix& aBinaryMatrix_) { unsigned r=aBinaryMatrix_.rows(); unsigned c=aBinaryMatrix_.columns(); for (unsigned i=0;i0) { unsigned n=length(); unsigned char fill=fill_>0?1:0; allocData(n); unsigned char *dp=data(); while (n--) *dp++=fill; } else _pData=0; _blocked=MSFalse; } MSBinaryMatrix::MSBinaryMatrix(const MSBinaryMatrix& aBinaryMatrix_) :MSMatrix(aBinaryMatrix_.rows(),aBinaryMatrix_.columns()) { _pData=aBinaryMatrix_.pData(); _blocked=MSFalse; (void)incrementCount(); } // special private constructor used to avoid temporary object creation // on return by value - see ARM page 267 MSBinaryMatrix::MSBinaryMatrix(MSTypeData > *data_,unsigned rows_,unsigned cols_) :MSMatrix(rows_,cols_) { _pData=data_; _blocked=MSFalse; } MSBinaryMatrix::MSBinaryMatrix(const unsigned char *pElements_, unsigned rows_, unsigned cols_) : MSMatrix(rows_,cols_) { _pData = MSTypeData >::allocateWithLength(_count, MSRaw); MSTypeData >::copy(pElements_, _pData->elements(), _count, MSRaw); } MSBinaryMatrix::~MSBinaryMatrix(void) { freeData(); } MSError::ErrorStatus MSBinaryMatrix::set(const char *pString_) { freeData(); if (pString_!=0) { #if defined(MS_NO_ISTRSTREAM_CONSTCHAR_CONSTRUCTOR) // Visual C++ does not define a constructor that takes a const char *, // therefore we have to do the following cast. istrstream ist((char *)(void *)pString_,strlen(pString_)); #else #if HAVE_SSTREAM istringstream ist(pString_); #else istrstream ist(pString_,strlen(pString_)); #endif #endif char c='\0'; // extract '(' while (c!='('&&ist) ist>>c; ist>>_rows; while (c!=','&&ist) ist>>c; ist>>_columns; while (c!=')'&&ist) ist>>c; if (!ist) { _rows=_columns=_count=0; return MSError::MSFailure; } _count=rows()*columns(); if (length()>0) _pData=MSTypeData >::allocateWithLength(length()); unsigned n=length(); unsigned char *dp=data(); for (unsigned i=0;i>dp[i]; if (!ist) return MSError::MSFailure; } changed(); return MSError::MSSuccess; } MSError::ErrorStatus MSBinaryMatrix::setFromMSF(const char *pString_) { MSError::ErrorStatus code; unsigned int i; unsigned int startpos; unsigned int value[2]; const char *pcurrent; char *pstring; if ((pString_!=0&&(*pString_==MSMSF_US)&&(strlen(pString_)>sizeof(MSMSF_US)))) { code=MSError::MSSuccess; freeData(); _rows=0,_columns=0,_count=0; MSString decode(pString_); decode.decodeMSF(); unsigned int slen=decode.length(); startpos=sizeof (MSMSF_US); pcurrent=(const char *)decode.string()+startpos; // first get the size of the matrix....its the first two elements in // the string for (i=0;i<2;i++) { value[i]=0; if (isdigit(*pcurrent)) value[i]=strtoul(pcurrent,&pstring,10); if (*pstring!='\0') { startpos=decode.indexOf (MSMSF_US, startpos); startpos+=sizeof(MSMSF_US); if (startpos >::allocateWithLength(length()); if (_pData!=0) { for (i=0;i<_count;i++) { if (startposelements()[index_]=(aValue_==0?0:1); if (doChanged()==MSTrue) changed(index_); return MSError::MSSuccess; } return MSError::MSFailure; } MSError::ErrorStatus MSBinaryMatrix::set(unsigned index_,const char *pString_) { char *cp=0; unsigned long lnum=strtoul(pString_,&cp,10); // Base 10 if (cp==pString_) return MSError::MSFailure; else return set(index_,(unsigned char)(lnum==0?0:1)); } unsigned MSBinaryMatrix::indexOf(unsigned char aValue_,unsigned startPos_) const { unsigned n=length(); for (unsigned i=startPos_;i0) { unsigned i; if (startPos_>=length()) i=length()-1; else i=startPos_; for (;i!=0;i--) if (elementAt(i)==aValue_) return i; if (i==0) if (elementAt(i)==aValue_) return i; } return length(); } // Assign a MSBinaryMatrix to this MSBinaryMatrix // aBinaryMatrix=bBinaryMatrix MSBinaryMatrix& MSBinaryMatrix::operator=(const MSBinaryMatrix& aBinaryMatrix_) { if (this!=&aBinaryMatrix_) { freeData(); _count=aBinaryMatrix_.length(); _rows=aBinaryMatrix_.rows(); _columns=aBinaryMatrix_.columns(); _pData=aBinaryMatrix_.pData(); (void)incrementCount(); changed(); } return *this; } // Assign a unsigned index selected element of a MSBinaryMatrix to all elements of this MSBinaryMatrix. // aBinaryMatrix=bBinaryMatrix[index] MSBinaryMatrix& MSBinaryMatrix::operator=(const MSBinaryMatrixSTypePick& aPick_) { prepareToChange(); unsigned n=length(); unsigned char s=aPick_.value(); unsigned char *dp=data(); while (n--) *dp++=s; changed(); return *this; } // Assign a unsigned char to all elements of this MSBinaryMatrix. // aBinaryMatrix=aBinaryValue MSBinaryMatrix& MSBinaryMatrix::operator=(unsigned char scalar_) { prepareToChange(); unsigned n=length(); unsigned char s=scalar_==0?0:1; unsigned char *dp=data(); while (n--) *dp++=s; changed(); return *this; } //------------------------------------------------------------------------------------------ // relational operator functions //------------------------------------------------------------------------------------------ long MSBinaryMatrix::compare(const MSBinaryMatrix& aBinaryMatrix_) const { unsigned n=MSUtil::min(length(),aBinaryMatrix_.length()); for (unsigned i=0;i > *d=MSTypeData >::allocateWithSize(aSize); const unsigned char *ap=data(); const unsigned char *bp=aBinaryMatrix_.data(); unsigned char *dp=d->elements(); unsigned i; switch (aComparison_) { case MSLessThan: for (i=0;ibp[i]); break; case MSGreaterThanOrEqualTo: for (i=0;i=bp[i]); break; } return MSBinaryMatrix(d,rows(),columns()); } MSBinaryMatrix MSBinaryMatrix::binaryCompare(unsigned char aBinaryValue_,MSComparison aComparison_) const { unsigned aSize=size(); unsigned n=length(); MSTypeData > *d=MSTypeData >::allocateWithSize(aSize); const unsigned char *ap=data(); unsigned char *dp=d->elements(); unsigned i; switch (aComparison_) { case MSLessThan: for (i=0;iaBinaryValue_); break; case MSGreaterThanOrEqualTo: for (i=0;i=aBinaryValue_); break; } return MSBinaryMatrix(d,rows(),columns()); } MSBoolean MSBinaryMatrix::scalarCompare(unsigned char aBinaryValue_,MSComparison aComparison_) const { unsigned n=length(); if (n>0) { const unsigned char *ap=data(); unsigned i; switch (aComparison_) { case MSLessThan: for (i=0;i=aBinaryValue_) return MSFalse; break; case MSLessThanOrEqualTo: for (i=0;iaBinaryValue_) return MSFalse; break; case MSEqualTo: for (i=0;i > *d=0; unsigned n=aBinaryMatrix_.length(); unsigned aSize=aBinaryMatrix_.size(); if (n>0) { d=MSTypeData >::allocateWithSize(aSize); unsigned char *dp=d->elements(); const unsigned char *sp=aBinaryMatrix_.data(); for (unsigned i=0;i > *d=0; unsigned n=aBinaryMatrix_.length(); unsigned aSize=aBinaryMatrix_.size(); if (n>0) { d=MSTypeData >::allocateWithSize(aSize); unsigned char *dp=d->elements(); const unsigned char *sp=aBinaryMatrix_.data(); for (unsigned i=0;i > *d=0; unsigned n=aBinaryMatrix_.length(); unsigned aSize=aBinaryMatrix_.size(); if (n>0) { d=MSTypeData >::allocateWithSize(aSize); unsigned char *dp=d->elements(); const unsigned char *ap=aBinaryMatrix_.data(); for (unsigned i=0;i > *d=0; unsigned n=aBinaryMatrix_.length(); unsigned aSize=aBinaryMatrix_.size(); if (n>0) { d=MSTypeData >::allocateWithSize(aSize); unsigned char *dp=d->elements(); const unsigned char *ap=aBinaryMatrix_.data(); const unsigned char *bp=aBinaryMatrix_.data(); for (unsigned i=0;i0) { unsigned char *dp=data(); const unsigned char *bp=aBinaryMatrix_.data(); while (n--) *dp++ &= *bp++; changed(); } return *this; } MSBinaryMatrix& MSBinaryMatrix::operator&=(unsigned char aBinaryValue_) { prepareToChange(); unsigned n=length(); if (n>0) { unsigned char c=aBinaryValue_==0?0:1; unsigned char *dp=data(); while (n--) *dp++ &= c; changed(); } return *this; } //------------------------------------------------------------------------------------------ // arithmetic | operator functions //------------------------------------------------------------------------------------------ MSBinaryMatrix operator|(const MSBinaryMatrix& aBinaryMatrix_,unsigned char aBinaryValue_) { MSTypeData > *d=0; unsigned n=aBinaryMatrix_.length(); unsigned aSize=aBinaryMatrix_.size(); if (n>0) { d=MSTypeData >::allocateWithSize(aSize); unsigned char *dp=d->elements(); const unsigned char *ap=aBinaryMatrix_.data(); for (unsigned i=0;i > *d=0; unsigned n=aBinaryMatrix_.length(); unsigned aSize=aBinaryMatrix_.size(); if (n>0) { d=MSTypeData >::allocateWithSize(aSize); unsigned char *dp=d->elements(); const unsigned char *ap=aBinaryMatrix_.data(); const unsigned char *bp=aBinaryMatrix_.data(); for (unsigned i=0;i0) { unsigned char *dp=data(); const unsigned char *bp=aBinaryMatrix_.data(); while (n--) *dp++ |= *bp++; changed(); } return *this; } MSBinaryMatrix& MSBinaryMatrix::operator|=(unsigned char aBinaryValue_) { prepareToChange(); unsigned n=length(); if (n>0) { unsigned char c=aBinaryValue_==0?0:1; unsigned char *dp=data(); while (n--) *dp++ |= c; changed(); } return *this; } //------------------------------------------------------------------------------------------ // arithmetic ^ operator functions //------------------------------------------------------------------------------------------ MSBinaryMatrix operator^(const MSBinaryMatrix& aBinaryMatrix_,unsigned char aBinaryValue_) { MSTypeData > *d=0; unsigned n=aBinaryMatrix_.length(); unsigned aSize=aBinaryMatrix_.size(); if (n>0) { d=MSTypeData >::allocateWithSize(aSize); unsigned char *dp=d->elements(); const unsigned char *ap=aBinaryMatrix_.data(); for (unsigned i=0;i > *d=0; unsigned n=aBinaryMatrix_.length(); unsigned aSize=aBinaryMatrix_.size(); if (n>0) { d=MSTypeData >::allocateWithSize(aSize); unsigned char *dp=d->elements(); const unsigned char *ap=aBinaryMatrix_.data(); const unsigned char *bp=aBinaryMatrix_.data(); for (unsigned i=0;i0) { unsigned char *dp=data(); const unsigned char *bp=aBinaryMatrix_.data(); while (n--) *dp++ ^= *bp++; changed(); } return *this; } MSBinaryMatrix& MSBinaryMatrix::operator^=(unsigned char aBinaryValue_) { prepareToChange(); unsigned n=length(); if (n>0) { unsigned char c=aBinaryValue_==0?0:1; unsigned char *dp=data(); while (n--) *dp++ ^= c; changed(); } return *this; } //------------------------------------------------------------------------------------------------- // stack, adjoin //------------------------------------------------------------------------------------------------- MSBinaryMatrix stack(const MSBinaryMatrix& aBinaryMatrix_,const MSBinaryMatrix& bBinaryMatrix_) { if (aBinaryMatrix_.columns()!=bBinaryMatrix_.columns()) { aBinaryMatrix_.error("nonconformant MSBinaryMatrix stack operands."); return MSBinaryMatrix(); } MSTypeData > *d=0; unsigned newLength=(aBinaryMatrix_.rows()+bBinaryMatrix_.rows())*aBinaryMatrix_.columns(); if (newLength>0) { d=MSTypeData >::allocateWithLength(newLength); unsigned char *dp=d->elements(); unsigned char *mp=aBinaryMatrix_.data(); unsigned char *row=aBinaryMatrix_.data()+aBinaryMatrix_.columns(); if (mp>0) { do { while (mp0) { do { while (mp > *d=0; if (newLength>0) { d=MSTypeData >::allocateWithLength(newLength); unsigned char *dp=d->elements(); unsigned char *mp=data(); unsigned char *row=data()+columns(); if (mp>0) { do { while (mp0) { do { while (mp0) { MSIndexVector iv; iv.series(aBinaryMatrix_.length(),oldLength); changed(iv); } return *this; } MSBinaryMatrix adjoin(const MSBinaryMatrix& aBinaryMatrix_,const MSBinaryMatrix& bBinaryMatrix_) { if (aBinaryMatrix_.rows()!=bBinaryMatrix_.rows()) { aBinaryMatrix_.error("nonconformant MSBinaryMatrix adjoin operands."); return MSBinaryMatrix(); } MSTypeData > *d=0; unsigned newLength=aBinaryMatrix_.rows()*(aBinaryMatrix_.columns()+bBinaryMatrix_.columns()); if (newLength>0) { d=MSTypeData >::allocateWithLength(newLength); unsigned char *dp=d->elements(); unsigned char *mp=aBinaryMatrix_.data(); unsigned char *row=aBinaryMatrix_.data()+aBinaryMatrix_.columns(); if (mp>0) { do { while (mpelements()+aBinaryMatrix_.columns(); mp=bBinaryMatrix_.data(); row=bBinaryMatrix_.data()+bBinaryMatrix_.columns(); if (mp>0) { do { while (mp > *d=0; unsigned newLength=rows()*(columns()+aBinaryMatrix_.columns()); if (newLength>0) { d=MSTypeData >::allocateWithLength(newLength); unsigned char *dp=d->elements(); unsigned char *mp=data(); unsigned char *row=data()+columns(); if (mp>0) { do { while (mpelements()+columns(); mp=aBinaryMatrix_.data(); row=aBinaryMatrix_.data()+aBinaryMatrix_.columns(); if (mp>0) { do { while (mp0) changed(); return *this; } MSBinaryMatrix& MSBinaryMatrix::random(void) { int n=length(); if (n>0) { prepareToChange(); unsigned char *dp=data(); MSRandom rand; while (n--) *dp++=(unsigned char)rand(2); // limit is always 2; nothing else makes sense changed(); } return *this; } unsigned long MSBinaryMatrix::sum(void) const { unsigned long sum=0; unsigned char *dp=data(); unsigned n=length(); while (n--) sum+=*dp++; return sum; } void MSBinaryMatrix::error(const char* msg_) const { (*_matrixErrorHandler)(msg_); } //------------------------------------------------------------------------------------------ // matrix manipulation methods //------------------------------------------------------------------------------------------------- MSBinaryMatrix& MSBinaryMatrix::appendColumn(const MSBinaryVector& aBinaryVector_) { if (rows()==0||aBinaryVector_.length()!=rows()) { error("MSBinaryMatrix length error."); return *this; } unsigned newLength=rows()*(columns()+1); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); unsigned char *dp=d->elements(); unsigned char *mp=data(); unsigned char *vp=aBinaryVector_.data(); unsigned i,j; for (j=0;j > *d=MSTypeData >::allocateWithLength(newLength); unsigned char *dp=d->elements(); unsigned char *mp=data(); unsigned i,j; unsigned char fill=fill_>0?1:0; for (j=0;j > *d=MSTypeData >::allocateWithLength(newLength); unsigned char *dp=d->elements(); unsigned char *mp=data(); unsigned char *vp=aBinaryVector_.data(); unsigned i; for (i=0;i > *d=MSTypeData >::allocateWithLength(newLength); unsigned char *dp=d->elements(); unsigned char *mp=data(); unsigned i,appendLength=columns()*rows_; unsigned char fill=fill_>0?1:0; for (i=0;icolumns()||bColumn_+1>columns()||aColumn_==bColumn_) return *this; prepareToChange(); unsigned char *aPtr=data()+aColumn_; unsigned char *bPtr=data()+bColumn_; register unsigned char tVal; for (unsigned i=0;irows()||bRow_+1>rows()||aRow_==bRow_) return *this; prepareToChange(); unsigned char *aPtr=data()+aRow_*columns(); unsigned char *bPtr=data()+bRow_*columns(); register unsigned char tVal; for (unsigned i=0;icolumns()) return *this; unsigned newLength=rows()*(columns()+1); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); unsigned char *dp=d->elements(); unsigned char *mp=data(); unsigned i,j; unsigned char fill=fill_>0?1:0; for (j=0;jcolumns()) return *this; if (aBinaryVector_.length()!=rows()) { error("MSBinaryMatrix length error."); return *this; } unsigned newLength=rows()*(columns()+1); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); unsigned char *dp=d->elements(); unsigned char *mp=data(); unsigned char *vp=aBinaryVector_.data(); unsigned i,j; for (j=0;jcolumns()) return *this; unsigned newLength=rows()*(columns()+1); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); unsigned char *dp=d->elements(); unsigned char *mp=data(); unsigned i,j; unsigned char fill=fill_>0?1:0; for (j=0;jcolumns()) return *this; if (aBinaryVector_.length()!=rows()) { error("MSBinaryMatrix length error."); return *this; } unsigned newLength=rows()*(columns()+1); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); unsigned char *dp=d->elements(); unsigned char *mp=data(); unsigned char *vp=aBinaryVector_.data(); unsigned i,j; for (j=0;jrows()) return *this; unsigned newLength=(rows()+1)*columns(); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); unsigned char *dp=d->elements(); unsigned char *mp=data(); unsigned i,j; unsigned char fill=fill_>0?1:0; for (j=0;jrows()) return *this; if (aBinaryVector_.length()!=columns()) { error("MSBinaryMatrix length error."); return *this; } unsigned newLength=(rows()+1)*columns(); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); unsigned char *dp=d->elements(); unsigned char *mp=data(); unsigned char *vp=aBinaryVector_.data(); unsigned i,j; for (j=0;jrows()) return *this; unsigned newLength=(rows()+1)*columns(); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); unsigned char *dp=d->elements(); unsigned char *mp=data(); unsigned i,j; unsigned char fill=fill_>0?1:0; for (j=0;jrows()) return *this; if (aBinaryVector_.length()!=columns()) { error("MSBinaryMatrix length error."); return *this; } unsigned newLength=(rows()+1)*columns(); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); unsigned char *dp=d->elements(); unsigned char *mp=data(); unsigned char *vp=aBinaryVector_.data(); unsigned i,j; for (j=0;j > *d=0; unsigned newLength=rows_*cols_; if (newLength>0) { d=MSTypeData >::allocateWithLength(newLength); unsigned char *dp=d->elements(); unsigned char *mp=data(); unsigned char *end=data()+length(); if (mp==0) for (unsigned i=0;inewLength) for (unsigned i=0;icolumns()) return *this; prepareToChange(); unsigned char *mp=data(); unsigned i,j; if (receiverList()!=0) { MSIndexVector iv(rows()); for (i=0,j=col_;irows()) return *this; prepareToChange(); unsigned char *mp=data(); unsigned i,j; for (i=row_*columns(),j=0;jcolumns()) return *this; if (aBinaryVector_.length()!=rows()) { error("MSBinaryMatrix length error."); return *this; } prepareToChange(); unsigned char *mp; unsigned i; for (i=0,mp=data()+col_;irows()) return *this; if (aBinaryVector_.length()!=columns()) { error("MSBinaryMatrix length error."); return *this; } prepareToChange(); unsigned char *mp; unsigned i; for (i=0,mp=data()+row_*columns();irows()) return *this; if (data()==0) return *this; unsigned newLength=(rows()-1)*columns(); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); unsigned char *dp=d->elements(); unsigned char *mp=data(); unsigned i,j; for (i=0;icolumns()) return *this; if (data()==0) return *this; unsigned newLength=rows()*(columns()-1); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); unsigned char *dp=d->elements(); unsigned char *mp=data(); unsigned i,j; for (i=0;i > *d=MSTypeData >::allocateWithLength(newLength); unsigned char *dp=d->elements(); unsigned char *mp=data(); unsigned i,j; for (i=0;i > *d=MSTypeData >::allocateWithLength(newLength); unsigned char *dp=d->elements(); unsigned char *mp=data(); unsigned i,j; for (i=0;i > *d=MSTypeData >::allocateWithSize(aSize); unsigned char *dp=d->elements(); unsigned char *mp=data(); unsigned i,j; for (i=0;i0&&rowPosition!=rows()) { unsigned i; unsigned aSize=size(); MSTypeData > *d=MSTypeData >::allocateWithSize(aSize); if (rowPosition>rows()) rowPosition%=rows(); if (position_<0) rowPosition=rows()-rowPosition; unsigned start=rowPosition*columns(); unsigned char *mp=data()+start; unsigned char *dp=d->elements(); for (i=start;i0&&columnPosition!=columns()) { unsigned i,j; unsigned aSize=size(); MSTypeData > *d=MSTypeData >::allocateWithSize(aSize); if (columnPosition>columns()) columnPosition%=columns(); if (position_<0) columnPosition=columns()-columnPosition; unsigned char *mp=data()+columnPosition; unsigned char *dp=d->elements(); for (j=0;j0&&numberOfRows!=rows()) { unsigned i; unsigned newLength=numberOfRows*columns(); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); unsigned char *mp=data(); unsigned char *dp=d->elements(); if (numberOfRows>rows()) { if (numberOfRows_>0) for (i=0;i0) for (i=0;i0&&numberOfColumns!=columns()) { unsigned i,j; unsigned newLength=numberOfColumns*rows(); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); unsigned char *mp=data(); unsigned char *dp=d->elements(); if (numberOfColumns>columns()) { if (numberOfColumns_>0) { for (i=0;i0) { for (i=0;i0) { if (numberOfRows > *d=MSTypeData >::allocateWithLength(newLength); unsigned char *mp=data(); unsigned char *dp=d->elements(); if (numberOfRows_>0) mp+=numberOfRows*columns(); for (i=0;i0) { if (numberOfColumns > *d = MSTypeData >::allocateWithLength(newLength); unsigned char *mp=data(); unsigned char *dp=d->elements(); if (numberOfColumns_>0) { for (i=0;irows()||columns()==0) return MSBinaryVector(); MSBinaryVector::Data *d = MSBinaryVector::Data::allocateWithLength (columns()); unsigned char *mp; unsigned char *dp=d->elements(); unsigned i; for (i=0,mp=data()+row_*columns();icolumns()||rows()==0) return MSBinaryVector(); MSBinaryVector::Data *d = MSBinaryVector::Data::allocateWithLength (rows()); unsigned char *mp; unsigned char *dp=d->elements(); unsigned i; for (i=0,mp=data()+column_;i // defines offsetof macro used in MSTypeData::operator new #if HAVE_IOSTREAM #include #else #include #endif #include #include #include #include #include #if defined(MSTK_MANUAL_INSTANTIATION) #include #endif // MSTK_MANUAL_INSTANTIATION #ifdef MS_NO_INLINES #include #endif //MS_NO_INLINES #ifdef MS_MULTI_THREAD MSMutex MSBinaryVector::_operationsMutex; MSMutex MSBinaryVector::Operations::_nullDataMutex; #endif MSBinaryVector::MSBinaryVector() : MSVector() { _pImpl = new MSVectorImpl(&ops()); } MSBinaryVector::MSBinaryVector(unsigned int length_, unsigned char filler_) : MSVector() { unsigned char c = (filler_==0) ? 0 : 1; _pImpl = new MSVectorImpl(&ops(), length_, (void *)&c); } MSBinaryVector::MSBinaryVector (const MSBinaryVector & vect_) : MSVector(), _pImpl (new MSVectorImpl (*vect_._pImpl)) { } MSBinaryVector::MSBinaryVector (const char *pString_) : MSVector() { _pImpl = new MSVectorImpl(&ops()); _pImpl->setFromString (pString_); } MSBinaryVector::MSBinaryVector (MSVectorImpl *pImpl_) : MSVector(), _pImpl (pImpl_) { } MSBinaryVector::MSBinaryVector (MSBinaryVector::Data *pData_, unsigned int len_) : MSVector() { _pImpl = new MSVectorImpl(&ops(), (void *)pData_, len_); } MSBinaryVector::MSBinaryVector (const unsigned char *pElements_, unsigned int len_) : MSVector() { Data *pData = Data::allocateWithLength (len_); Data::copy (pElements_, pData->elements(), len_); _pImpl = new MSVectorImpl(&ops(), (void *)pData, len_); } MSBinaryVector::~MSBinaryVector() { delete _pImpl; } MSBinaryVector & MSBinaryVector::operator= (const MSBinaryVector & vect_) { if (this != &vect_) { *_pImpl = *vect_._pImpl; changed(); } return *this; } MSBinaryVector & MSBinaryVector::operator= (const unsigned char value_) { unsigned char c = value_ ? 1 : 0; _pImpl->setAll ((void *)&c); changed(); return *this; } MSString MSBinaryVector::asString() const { return _pImpl->asString(); } MSString MSBinaryVector::asMSF() const { return _pImpl->asMSF(); } MSString MSBinaryVector::asDebugInfo() const { MSString result (className()); return result << "(@" << MSString((unsigned long)this).d2x().lowerCase() << ",_elements=" << ((Data *)_pImpl->data())->asDebugInfo() << ",_size=" << MSString(size()) << ",_length=" << MSString(length()) << ",_type=" << type().symbolName() << ")"; } MSString MSBinaryVector::className() const { return MSString ("MSBinaryVector"); } const MSSymbol & MSBinaryVector::type() const { return symbol(); } MSModel * MSBinaryVector::clone() const { return new MSBinaryVector (*this); } MSModel * MSBinaryVector::create() const { return new MSBinaryVector; } void MSBinaryVector::assign (const MSModel & aModel_) { *this = (MSBinaryVector &)aModel_; } long MSBinaryVector::compare (const MSModel & aModel_) const { return compare ((MSBinaryVector &)aModel_); } MSError::ErrorStatus MSBinaryVector::set (const char *pString_) { MSError::ErrorStatus retval = _pImpl->setFromString (pString_); changed(); return retval; } MSError::ErrorStatus MSBinaryVector::setFromMSF (const char *pString_) { MSError::ErrorStatus retval = _pImpl->setFromMSF (pString_); changed(); return retval; } const MSSymbol & MSBinaryVector::symbol() { static MSSymbol sym ("MSBinaryVector"); return sym; } unsigned char * MSBinaryVector::data() const { return ((Data *)_pImpl->data())->elements(); } unsigned int MSBinaryVector::length() const { // length() method might potentially be called after the destructor of MSBinaryVector, // so safeguard yourself here by checking if _pImpl has already been deleted... return _pImpl ? _pImpl->length() : 0; } // virtual version of length() unsigned int MSBinaryVector::getLength() const { return _pImpl->length(); } MSError::ErrorStatus MSBinaryVector::set (unsigned int index_, const unsigned char value_) { unsigned char c = value_ ? 1 : 0; if (index_ < _pImpl->length()) { _pImpl->set (index_, (void *)&c); if (doChanged() == MSTrue) changed (index_); return MSError::MSSuccess; } else { _pImpl->vectorIndexError (index_); return MSError::MSFailure; } } MSBinaryVector & MSBinaryVector::append (const unsigned char value_) { unsigned char c = value_ ? 1 : 0; _pImpl->append ((void *) &c); appendUpdate (_pImpl->length(), 1); return *this; } MSBinaryVector & MSBinaryVector::append (const MSBinaryVector & vect_) { if (_pImpl->append (*vect_._pImpl) == MSError::MSSuccess) appendUpdate (_pImpl->length(), vect_._pImpl->length()); return *this; } MSBinaryVector & MSBinaryVector::insertAt (unsigned int index_, const unsigned char value_) { if (index_ == _pImpl->length()) // NEW FEATURE: insert right after the last element return append (value_); // if inserting inside the vector unsigned char c = value_ ? 1 : 0; if (_pImpl->insertAt (index_, (void *) &c) == MSError::MSSuccess) changed(); return *this; } MSBinaryVector & MSBinaryVector::insertAt (unsigned int index_, const MSBinaryVector & vect_) { if (index_ == _pImpl->length()) // NEW FEATURE: insert right after the last element return append (vect_); // if inserting inside the vector if (_pImpl->insertAt (index_, *vect_._pImpl) == MSError::MSSuccess) changed(); return *this; } MSBinaryVector & MSBinaryVector::removeAt (unsigned int index_) { if (_pImpl->removeAt (index_) == MSError::MSSuccess) changed(); return *this; } MSBinaryVector & MSBinaryVector::removeAt (unsigned int startPos_, unsigned int numEls_) { if (numEls_ > 0) if (_pImpl->removeAt (startPos_, numEls_) == MSError::MSSuccess) changed(); return *this; } MSBinaryVector & MSBinaryVector::remove (const MSIndexVector & iVect_) { if (_pImpl->remove (iVect_) == MSError::MSSuccess) changed(); return *this; } MSBinaryVector & MSBinaryVector::remove (const MSBinaryVector & bVect_) { if (_pImpl->remove (bVect_) == MSError::MSSuccess) changed(); return *this; } MSBinaryVector & MSBinaryVector::removeAll() { if (_pImpl->removeAll() == MSError::MSSuccess) changed(); return *this; } MSBinaryVector & MSBinaryVector::select (const MSIndexVector & iVect_) { if (_pImpl->select (iVect_) == MSError::MSSuccess) changed(); return *this; } MSBinaryVector & MSBinaryVector::compress (const MSBinaryVector & bVect_) { if (_pImpl->compress (bVect_) == MSError::MSSuccess) changed(); return *this; } MSBinaryVector & MSBinaryVector::reshape (unsigned int newLen_) { if (_pImpl->reshape (newLen_) == MSError::MSSuccess) changed(); return *this; } MSBinaryVector & MSBinaryVector::exchange (unsigned int index1_, unsigned int index2_) { if (_pImpl->exchange (index1_, index2_) == MSError::MSSuccess && doChanged() == MSTrue) { MSIndexVector iVect (2); iVect.data()[0] = index1_; iVect.data()[1] = index2_; changed (iVect); } return *this; } MSBinaryVector & MSBinaryVector::reverse() { if (_pImpl->reverse() == MSError::MSSuccess) changed(); return *this; } MSBinaryVector & MSBinaryVector::rotate (int amount_) { if (_pImpl->rotate (amount_) == MSError::MSSuccess) changed(); return *this; } MSBinaryVector & MSBinaryVector::take (int numEls_, const unsigned char filler_) { const unsigned char c = filler_ ? 1 : 0; if (_pImpl->take (numEls_, (void *)&c) == MSError::MSSuccess) changed(); return *this; } MSBinaryVector & MSBinaryVector::drop (int numEls_) { if (_pImpl->drop (numEls_) == MSError::MSSuccess) changed(); return *this; } MSBinaryVector MSBinaryVector::reverse (const MSBinaryVector & vect_) { MSVectorImpl *impl = vect_._pImpl->create(); impl->reverse (*vect_._pImpl); return MSBinaryVector (impl); } MSBinaryVector MSBinaryVector::rotate (const MSBinaryVector & vect_, int amount_) { MSVectorImpl *impl = vect_._pImpl->create(); impl->rotate (*vect_._pImpl, amount_); return MSBinaryVector (impl); } MSBinaryVector MSBinaryVector::take (const MSBinaryVector & vect_, int numEls_, const unsigned char filler_) { const unsigned char c = filler_ ? 1 : 0; MSVectorImpl *impl = vect_._pImpl->create(); impl->take (*vect_._pImpl, numEls_, (void *)&c); return MSBinaryVector (impl); } MSBinaryVector MSBinaryVector::drop (const MSBinaryVector & vect_, int numEls_) { MSVectorImpl *impl = vect_._pImpl->create(); impl->drop (*vect_._pImpl, numEls_); return MSBinaryVector (impl); } MSBinaryVector MSBinaryVector::select (const MSBinaryVector & vect_, const MSIndexVector & iVect_) { MSVectorImpl *impl = vect_._pImpl->create(); impl->select (*vect_._pImpl, iVect_); return MSBinaryVector (impl); } MSBinaryVector MSBinaryVector::compress (const MSBinaryVector & vect_, const MSBinaryVector & bVect_) { MSVectorImpl *impl = vect_._pImpl->create(); impl->compress (*vect_._pImpl, bVect_); return MSBinaryVector (impl); } MSBinaryVector & MSBinaryVector::selectiveAssign (const MSIndexVector & iVect_, const unsigned char value_) { unsigned char c = value_ ? 1 : 0; _pImpl->setSelected (iVect_, (void *)&c); changed (iVect_); return *this; } MSBinaryVector & MSBinaryVector::selectiveAssign (const MSIndexVector & iVect_, const MSBinaryVector & vect_) { _pImpl->setSelected (iVect_, *vect_._pImpl); changed (iVect_); return *this; } MSBinaryVector & MSBinaryVector::selectiveAssign (const MSBinaryVector & bVect_, const unsigned char value_) { unsigned char c = value_ ? 1 : 0; if (doChanged() == MSTrue) changed (_pImpl->setIndexSelected (bVect_, (void *)&c)); else _pImpl->setSelected (bVect_, (void *)&c); return *this; } MSBinaryVector & MSBinaryVector::selectiveAssign (const MSBinaryVector & bVect_, const MSBinaryVector & vect_) { if (doChanged() == MSTrue) changed (_pImpl->setIndexSelected (bVect_, *vect_._pImpl)); else _pImpl->setSelected (bVect_, *vect_._pImpl); return *this; } MSBinaryVector& MSBinaryVector::random(void) { unsigned int len=_pImpl->length(); if (len>0) { _pImpl->prepareToChangeWithoutCopy(); MSRandom rand; unsigned char *pData=data(); while (len--) { *pData++ = (unsigned char)rand(2); // limit is always 2; nothing else makes sense } changed(); } return *this; } ostream & operator<< (ostream & stream_, const MSBinaryVector & vect_) { vect_._pImpl->print (stream_); return stream_; } MSBinaryVector MSBinaryVector::doBitwiseOp (const MSBinaryVector & vect1_, const MSBinaryVector & vect2_, MSBinaryVector::BitwiseOp op_) { unsigned int len = vect1_.length(); assert (len == vect2_.length()); MSVectorImpl *pImpl = vect1_._pImpl->create (len, vect1_.size()); const unsigned char *pData1 = vect1_.data(), *pData2 = vect2_.data(); unsigned char *pData = ((Data *)pImpl->data())->elements(); while (len--) (*op_)(*pData++, *pData1++, *pData2++); return MSBinaryVector (pImpl); } MSBinaryVector MSBinaryVector::doBitwiseOp (const MSBinaryVector & vect_, const unsigned char value_, MSBinaryVector::BitwiseOp op_) { unsigned int len = vect_.length(); const unsigned char c = (value_ > 0) ? 1 : 0; MSVectorImpl *pImpl = vect_._pImpl->create (len, vect_.size()); const unsigned char *pData1 = vect_.data(); unsigned char *pData = ((Data *)pImpl->data())->elements(); while (len--) (*op_)(*pData++, c, *pData1++); return MSBinaryVector (pImpl); } MSBinaryVector & MSBinaryVector::doBitwiseOp (const MSBinaryVector & vect_, MSBinaryVector::BitwiseAssignOp assignOp_, MSBinaryVector::BitwiseOp op_) { unsigned len = length(); assert (len == vect_.length()); unsigned char *pData = data(), *pDataSrc = vect_.data(); // What we do below is a little bit of a hack; since we have a reference counted vector data, we have to check // the reference count to see if we need to allocate our own copy of the data. However, the data itself is stored // in MSVectorImpl, and we don't have direct access to it. Therefore, we here reallocate the whole implementation // class, which shouldn't be much slower since the bulk of it is the vector data anyway. // if (ops().refCount(_pImpl->data())>1) { MSVectorImpl *pNewImpl = _pImpl->create (len, size()); unsigned char *pNewData = ((Data *)pNewImpl->data())->elements(); while (len--) (*op_)(*pNewData++, *pData++, *pDataSrc++); delete _pImpl; _pImpl = pNewImpl; } else // refCount == 1 while (len--) (*assignOp_)(*pData++, *pDataSrc++); changed(); return *this; } MSBinaryVector & MSBinaryVector::doBitwiseOp (const unsigned char value_, MSBinaryVector::BitwiseAssignOp assignOp_, MSBinaryVector::BitwiseOp op_) { unsigned len = length(); const unsigned char c = (value_ > 0) ? 1 : 0; unsigned char *pData = data(); if (ops().refCount(_pImpl->data())>1) { MSVectorImpl *pNewImpl = _pImpl->create (len, size()); unsigned char *pNewData = ((Data *)pNewImpl->data())->elements(); while (len--) (*op_)(*pNewData++, *pData++, c); delete _pImpl; _pImpl = pNewImpl; } else // refCount == 1 while (len--) (*assignOp_)(*pData++, c); changed(); return *this; } MSBinaryVector operator! (const MSBinaryVector & vect_) { unsigned int len = vect_.length(); MSVectorImpl *pImpl = vect_._pImpl->create (len, vect_.size()); const unsigned char *pDataSrc = vect_.data(); unsigned char *pDataDest = ((MSBinaryVector::Data *)pImpl->data())->elements(); while (len--) *pDataDest++ = !(*pDataSrc++); return MSBinaryVector (pImpl); } MSBinaryVector & MSBinaryVector::complement() { unsigned int len = length(); unsigned char *pData = data(); if (ops().refCount(_pImpl->data())>1) { MSVectorImpl *pNewImpl = _pImpl->create (len, size()); unsigned char *pNewData = ((Data *)pNewImpl->data())->elements(); while (len--) *pNewData++ = !(*pData++); delete _pImpl; _pImpl = pNewImpl; } else // refCount == 1 for (unsigned int i=0; idecrementCount(); } void MSBinaryVector::Operations::incrementCount (void *data_) const { ((Data *)data_)->incrementCount(); } unsigned int MSBinaryVector::Operations::refCount (const void *data_) const { return ((Data *)data_)->refCount(); } void MSBinaryVector::Operations::set (void *data_, unsigned int index_, const void *value_, MSAllocationFlag) const { ((Data *)data_)->elements()[index_] = *(unsigned char *)value_; } void MSBinaryVector::Operations::set (void *pDest_, unsigned int destInd_, const void *pSrc_, unsigned int srcInd_, MSAllocationFlag) const { ((Data *)pDest_)->elements()[destInd_] = ((Data *)pSrc_)->elements()[srcInd_]; } void MSBinaryVector::Operations::fill (void *pElements_, unsigned int start_, unsigned int numToFill_, const void *pValue_, MSAllocationFlag) const { unsigned char *pStart = ((Data *)pElements_)->elements() + start_; if (pValue_) Data::fill (pStart, numToFill_, *(unsigned char *)pValue_); else Data::fill (pStart, numToFill_, *(unsigned char *)defaultFiller()); } void MSBinaryVector::Operations::copy (const void *src_, void *dest_, unsigned int length_, unsigned int srcInd_, unsigned int destInd_, MSAllocationFlag) const { Data::copy (((Data *)src_)->elements() + srcInd_, ((Data *)dest_)->elements() + destInd_, length_); } void MSBinaryVector::Operations::copyBackward (void *pElements_, unsigned int src_, unsigned int dest_, unsigned int numToCopy_) const { unsigned char *pElements = ((Data *)pElements_)->elements(); Data::copyBackward (pElements+src_, pElements+dest_, numToCopy_); } void MSBinaryVector::Operations::destroy (void *, unsigned int, unsigned int) const { } int MSBinaryVector::Operations::isElementEqual (const void *pElements_, unsigned int index_, const void *pValue_) const { return ((Data *)pElements_)->elements()[index_] == *(unsigned char *)pValue_; } int MSBinaryVector::Operations::isElementLess (const void *pElements_, unsigned int index_, const void *pValue_) const { return ((Data *)pElements_)->elements()[index_] < *(unsigned char *)pValue_; } int MSBinaryVector::Operations::isElementLessEqual (const void *pElements_, unsigned int index_, const void *pValue_) const { return ((Data *)pElements_)->elements()[index_] <= *(unsigned char *)pValue_; } long MSBinaryVector::Operations::compareElement (const void *data_, unsigned int index_, const void *value_) const { const unsigned char el1 = ((Data *)data_)->elements()[index_], el2 = *(unsigned char *)value_; return (el1 == el2) ? 0 : ((el1 < el2) ? -1 : 1); } void *MSBinaryVector::Operations::elementAt (const void *pElements_, unsigned int index_) const { return & ((Data *)pElements_)->elementAt (index_); } unsigned int MSBinaryVector::Operations::size (const void *pElements_) const { return ((Data *)pElements_)->size(); } void MSBinaryVector::Operations::swapElements (void *data_, unsigned int ind1_, unsigned int ind2_) const { unsigned char *pElements = ((Data *)data_)->elements(); unsigned char temp = pElements[ind1_]; pElements[ind1_] = pElements[ind2_], pElements[ind2_] = temp; } unsigned int MSBinaryVector::Operations::gradeUp (const void *pData_, unsigned int len_, unsigned int *pResult_) const { return msMergeSortUp (len_, ((Data *)pData_)->elements(), pResult_, (unsigned int)0, len_); } unsigned int MSBinaryVector::Operations::gradeDown (const void *pData_, unsigned int len_, unsigned int *pResult_) const { return msMergeSortDown (len_, ((Data *)pData_)->elements(), pResult_, (unsigned int)0, len_); } void *MSBinaryVector::Operations::badData() const { static unsigned char badValue =0; return (void *)&badValue; } void *MSBinaryVector::Operations::defaultFiller() const { static unsigned char filler =0; return (void *)&filler; } MSString MSBinaryVector::Operations::asString (const void *pData_, unsigned int index_) const { return MSString ((unsigned int)((Data *)pData_)->elements()[index_]); } MSString MSBinaryVector::Operations::asMSF (const void *pData_, unsigned int index_) const { return MSString ((unsigned int)((Data *)pData_)->elements()[index_]); } unsigned int MSBinaryVector::Operations::elementLen (const void *, unsigned int) const { return 0; } MSError::ErrorStatus MSBinaryVector::Operations::setFromString (void *pData_, unsigned int index_, const char *pString_) const { ((Data *)pData_)->elements()[index_] = (*pString_=='0') ? 0 : 1; return MSError::MSSuccess; } MSError::ErrorStatus MSBinaryVector::Operations::setFromMSF (void *pData_, unsigned int index_, const char *pString_) const { return setFromString (pData_, index_, pString_); } void MSBinaryVector::Operations::setFromMSString (void *pData_, unsigned int vectIndex_, const MSString & str_, unsigned int& startPos_, const char) const { if (startPos_=str_.length()) { return; } } unsigned int endPos = str_.indexOfAnyOf(MSStringTest(APLUS_ISPACE),startPos_); ((Data *)pData_)->elements()[vectIndex_] = (str_(startPos_)=='0') ? 0 : 1; startPos_ = str_.indexOfAnyBut(MSStringTest(APLUS_ISPACE),endPos); } } unsigned int MSBinaryVector::Operations::numElements (const MSString & str_, const char) const { return str_.numWords(); } void MSBinaryVector::Operations::print (const void *pData_, unsigned int index_, ostream & stream_) const { stream_ << (unsigned int)((Data *)pData_)->elements()[index_] << " "; } MSBinaryVector::Data& MSBinaryVector::Operations::nullData(void) { MS_SAFE_STATIC_INIT(Data,_nullDataMutex); } MSBinaryVector::Data::Data (unsigned int size_) : MSData (size_) { } MSBinaryVector::Data::~Data() { } MSString MSBinaryVector::Data::asDebugInfo() const { MSString result ("MSBinaryVector::Data(@"); result += MSString((unsigned long)this).d2x().lowerCase(); result += ",_data="; result += MSString((unsigned long)elements()).d2x().lowerCase(); result += ",_refCount="; result += MSString(refCount()); result += ")"; return result; } void * MSBinaryVector::Data::operator new(size_t, unsigned int numEls_) { // We need to allocate memory for sizeof(Data) plus the size of the data elements array // except for the first element which is included in the size of Data // unsigned int realSize; if (numEls_>1) { realSize = sizeof(Data) + (numEls_-1)*sizeof(unsigned char); } else // 0 or 1 elements to be allocated { realSize = sizeof(Data); // Data already includes 1 data element } return (void *) ::new char[realSize]; } MSBinaryVector::Data *MSBinaryVector::Data::allocateWithLength (unsigned length_) { unsigned int newLength = MSData::computeSize(length_); return new (newLength)Data(newLength); } MSBinaryVector::Data *MSBinaryVector::Data::allocateWithSize (unsigned size_) { return new (size_)Data(size_); } void MSBinaryVector::Data::deallocate() { delete this; } void MSBinaryVector::Data::fill (unsigned char *pElements_, unsigned int length_, const unsigned char value_) { while (length_--) *pElements_++ = value_; } void MSBinaryVector::Data::copy(const unsigned char *src_, unsigned char *dst_, unsigned int length_) { while (length_--) *dst_++ = *src_++; } void MSBinaryVector::Data::copyBackward (const unsigned char *pSrc_, unsigned char *pDest_, unsigned int length_) { while (length_--) *pDest_-- = *pSrc_--; } MSBinaryVector::SPick & MSBinaryVector::SPick::operator= (const MSBinaryVector::SPick & sPick_) { _pVector->set (_index, (*sPick_._pVector)(sPick_._index)); return *this; } MSBinaryVector::SPick & MSBinaryVector::SPick::operator= (const unsigned char aScalar_) { _pVector->set (_index, aScalar_); return *this; } void bitwiseAND (unsigned char & res, const unsigned char a, const unsigned char b) { res = a & b; } unsigned char & bitwiseAND (unsigned char & res, const unsigned char a) { return (res &= a); } void bitwiseOR (unsigned char & res, const unsigned char a, const unsigned char b) { res = a | b; } unsigned char & bitwiseOR (unsigned char & res, const unsigned char a) { return (res |= a); } void bitwiseXOR (unsigned char & res, const unsigned char a, const unsigned char b) { res = a ^ b; } unsigned char & bitwiseXOR (unsigned char & res, const unsigned char a) { return (res ^= a); } aplus-fsf-4.22/src/MSTypes/MSBool.C0000644000265000001440000001127110772770443012425 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #if HAVE_IOSTREAM #include #else #include #endif #include #include #include #include #include #ifdef MS_NO_INLINES #include #endif ostream& operator<<(ostream& aStream_,const MSBool& aBool_) { return aStream_<<(aBool_._bool==MSTrue?"1":"0"); } istream &operator>>(istream &aStream_,MSBool &aBool_) { MSString aString; aStream_>>aString; if (aString.length()>0) aBool_.set(aString); return aStream_; } MSString MSBool::asString(void) const { if (_bool==MSTrue) return MSString("1"); else return MSString("0"); } MSString MSBool::asDebugInfo(void) const { MSString result("MSBool(@"); result+=MSString((unsigned long)this).d2x().lowerCase(); result+=",_bool="; result+=_bool==MSTrue?"MSTrue":"MSFalse"; result+=",_isSet="; result+=_isSet==MSTrue?"MSTrue":"MSFalse"; result+=",_type="; result+=type().symbolName(); result+=")"; return MSString(result); } MSString MSBool::className(void) const { return MSString("MSBool"); } const MSSymbol& MSBool::type(void) const { return symbol(); } MSModel *MSBool::clone(void) const { return new MSBool(*this); } MSModel *MSBool::create(void) const { return new MSBool(); } void MSBool::assign(const MSModel& aModel_) { *this=(MSBool&)aModel_; } long MSBool::compare(const MSModel& aModel_) const { return ::compare(*this,(MSBool&)aModel_); } MSString MSBool::asMSF(void) const { if (isSet()==MSTrue) { if(_bool==MSTrue) return MSString("T"); else return MSString("F"); } return MSString(); } MSError::ErrorStatus MSBool::setFromMSF(const char *pString_) { int code; if (pString_!=0) { if (*pString_=='T') code=set(1); else code=set(0); } else code=MSError::BadMSFString; return (MSError::ErrorStatus)code; } const MSSymbol& MSBool::symbol(void) { static MSSymbol sym ("MSBool"); return sym; } void MSBool::unset(void) { if (isSet()==MSTrue) { _bool=MSFalse; _isSet=MSFalse; changed(); } } MSError::ErrorStatus MSBool::set(int i_) { _bool=i_?MSTrue:MSFalse; _isSet=MSTrue; return changed(),MSError::MSSuccess; } MSError::ErrorStatus MSBool::set(const MSString& aString_) { MSString aString=aString_; aString.strip(); // remove leading and trailing whitespace aString.lower(); if(aString=="0"||aString=="no"||aString=="n"||aString=="false"||aString=="f") { _bool=MSFalse;_isSet=MSTrue; return changed(),MSError::MSSuccess; } if(aString=="1"||aString=="yes"||aString=="y"||aString=="true"||aString=="t") { _bool=MSTrue;_isSet=MSTrue; return changed(),MSError::MSSuccess; } _isSet=MSFalse; return changed(),MSError::BadBool; } MSError::ErrorStatus MSBool::set(const char *pString_) { return set(MSString(pString_)); } MSError::ErrorStatus MSBool::set(const MSString *pString_) { return set(*pString_); } const char *MSBool::format(MSString *pString_) const { return format(*pString_); } const char *MSBool::format(MSString& aString_) const { aString_=_bool?"1":"0"; return aString_.string(); } const char *MSBool::format(MSString *pString_,MSBoolFormat format_) const { return format(*pString_,format_); } const char *MSBool::format(MSString& aString_,MSBoolFormat format_) const { switch (format_) { case YesAndNo: aString_=(_bool==MSTrue)?"Yes":"No"; break; case TrueAndFalse: aString_=(_bool==MSTrue)?"True":"False"; break; case Binary: aString_=(_bool==MSTrue)?"1":"0"; break; default: MSMessageLog::warningMessage("MSBool: invalid value of format\n"); } return aString_.string(); } const char *MSBool::format(MSString& aString_,const MSFormat& aFormat_) const { return (aFormat_.formatType()==MSFormat::FBool)? format(aString_,aFormat_.boolFormat()):format(aString_); } const char *MSBool::format(MSString *pString_,const MSFormat& aFormat_) const { return format(*pString_,aFormat_); } MSBoolean operator==(int i_,const MSBool& aBoolean_) { return MSBoolean(i_?aBoolean_._bool:!aBoolean_._bool); } MSBoolean operator!=(int i_,const MSBool& aBoolean_) { return MSBoolean(i_?!aBoolean_._bool:aBoolean_._bool); } #if !defined (MS_ENUM_COMPARE_BUG) MSBoolean operator==(MSBoolean bool_,const MSBool& aBoolean_) { return MSBoolean(bool_==aBoolean_._bool); } MSBoolean operator!=(MSBoolean bool_,const MSBool& aBoolean_) { return MSBoolean(bool_!=aBoolean_._bool); } #endif aplus-fsf-4.22/src/MSTypes/MSBoolVector.C0000644000265000001440000000344110772770443013610 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #if defined(MSTK_MANUAL_INSTANTIATION) #include #if defined(MS_XLC_TEMPLATE_INSTANTIATION) #pragma define (MSTypeVector) #endif #if defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma instantiate MSBaseVector > #pragma instantiate MSObjectVector #pragma instantiate MSTypeVector #if !defined(MS_TEMPLATE_MANUAL_FRIEND_BUG) // The version of EDG used by SGI's dcc compiler has a bug related to access from friends #pragma instantiate ostream & operator<< (ostream &, const MSBaseVector > &) #endif //__sgi #endif #if defined(MS_VC_TEMPLATE_INSTANTIATION) template MSBaseVector >; template MSBaseVectorOps >; template MSObjectVector; template MSTypeVector; // instantiate non-inline friend template functions static int __dummy01__() { if (0) operator<<(cout, MSBaseVector >()); return 0; } static int __dummyInt01__=__dummy01__(); #endif //MS_VC_TEMPLATE_INSTANTIATION #if defined(MS_STD_TEMPLATE_INSTANTIATION) template class MSBaseVector >; template class MSBaseVectorOps >; template class MSObjectVector; template class MSTypeVector; template ostream& operator<<(ostream&,const MSBaseVector >&); #endif #endif aplus-fsf-4.22/src/MSTypes/MSBoyerMoore.C0000644000265000001440000000425310772770443013616 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include const unsigned MSBoyerMoore::DeltaTableSize=256; MSBoyerMoore::MSBoyerMoore(void) { _deltaTable=0; } MSBoyerMoore::MSBoyerMoore(const MSString& sourceString_):_sourceString(sourceString_) { _deltaTable=0; } MSBoyerMoore::~MSBoyerMoore(void) { if (_deltaTable!=0) delete [] _deltaTable; } void MSBoyerMoore::sourceString(const MSString& sourceString_) { _sourceString=sourceString_; } void MSBoyerMoore::searchPattern(const MSString& searchPattern_) { if (_deltaTable==0) _deltaTable=new unsigned[deltaTableSize()]; unsigned i; if (searchPattern_.length()>0) { if (searchPattern_!=searchPattern()) { _searchPattern=searchPattern_; for(i=0;i0) { const char *pat=searchPattern(); const char *str=sourceString(); unsigned len=searchPattern().length(); unsigned slen=sourceString().length(); unsigned i=startPos_+len; // index into target unsigned j; // index into pattern while (i<=slen) { j=len; while (pat[j-1]==str[i-1]) { if (j>1) { --j,--i; } // move left for next comparison else return i-1; // we've reached the beginning of pat } i+=delta(str[i-1]); // move target index by delta of mismatched character } } } return sourceString().length(); } aplus-fsf-4.22/src/MSTypes/MSBuiltinVectorImpl.C0000644000265000001440000002704010772770443015146 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #if HAVE_IOSTREAM #include #else #include #endif #if HAVE_SSTREAM #include #else #include #endif #include #if defined(MS_REQUIRE_IEEEFP) #include #endif #include #include #include #include MSBuiltinVectorImpl::MSBuiltinVectorImpl (MSVectorImplOps *pOps_, MSBuiltinVectorImplOps *pBuiltInOps_, unsigned int length_) : MSVectorImpl(pOps_,length_), _pBuiltInOps(pBuiltInOps_) { } MSBuiltinVectorImpl::MSBuiltinVectorImpl (MSVectorImplOps *pOps_, MSBuiltinVectorImplOps *pBuiltInOps_, unsigned int length_, void *pFiller_) : MSVectorImpl(pOps_,length_,pFiller_), _pBuiltInOps(pBuiltInOps_) { } MSBuiltinVectorImpl::MSBuiltinVectorImpl (const MSBuiltinVectorImpl & vImpl_) : MSVectorImpl(vImpl_), _pBuiltInOps(vImpl_._pBuiltInOps) { } MSBuiltinVectorImpl::MSBuiltinVectorImpl (MSVectorImplOps *pOps_, MSBuiltinVectorImplOps *pBuiltInOps_, void *pData_, unsigned int len_) : MSVectorImpl(pOps_, pData_, len_), _pBuiltInOps(pBuiltInOps_) { } MSBuiltinVectorImpl::~MSBuiltinVectorImpl() { } MSVectorImpl *MSBuiltinVectorImpl::create (unsigned int len_, unsigned int size_) const { if (size_) return new MSBuiltinVectorImpl (_pOperations, _pBuiltInOps, _pOperations->allocateWithSize (size_), len_); else return new MSBuiltinVectorImpl (_pOperations, _pBuiltInOps, len_); } MSVectorImpl *MSBuiltinVectorImpl::clone() const { return new MSBuiltinVectorImpl (*this); } MSString MSBuiltinVectorImpl::asMSF() { MSString result; static char buf[64]; #if HAVE_SSTREAM static ostringstream oss (buf, ios::out); #else static ostrstream oss (buf, 64, ios::out); #endif oss.precision (8); result << MSMSF_US << MSString(_len); for (unsigned int i=0; i<_len; i++) { oss.seekp (ios::beg); oss << MSMSF_US; _pBuiltInOps->writeToStream (_pElements, i, oss); oss << ends; result << buf; } result.encodeMSF(); return result; } MSError::ErrorStatus MSBuiltinVectorImpl::setFromString (const char *pString_, const char) { MSError::ErrorStatus rc = MSError::MSSuccess; _pOperations->deallocate (_pElements); if (pString_) { #if defined(MS_NO_ISTRSTREAM_CONSTCHAR_CONSTRUCTOR) istrstream ist ((char *)(void *)pString_, strlen(pString_)); #else #if HAVE_SSTREAM istringstream ist (pString_, istringstream::in); #else istrstream ist (pString_, strlen(pString_)); #endif #endif _len = _pBuiltInOps->stringLen (pString_); _pElements = _pOperations->allocate (_len); if (_len) { _pBuiltInOps->whitespace (ist); for (unsigned int i=0; i<_len; i++) _pBuiltInOps->readFromStream (_pElements, i, ist); if (!ist) rc = MSError::MSFailure; } else rc = MSError::MSFailure; } else // if pString is NULL { _len = 0; _pElements = _pOperations->allocate (0); } return rc; } MSError::ErrorStatus MSBuiltinVectorImpl::setFromMSF (const char *pString_) { MSError::ErrorStatus rc; unsigned int startpos; unsigned int value; char *pstring; const char *pcurrent; if (pString_ && (*pString_ == MSMSF_US) && (strlen (pString_) > sizeof(MSMSF_US))) { rc = MSError::MSSuccess; _pOperations->deallocate (_pElements); MSString decode (pString_); decode.decodeMSF(); unsigned int slen = decode.length(); startpos = sizeof(MSMSF_US); pcurrent = (const char *)decode.string() + startpos; // first get the size of the array....it the first element in the string // then point to the beginning of the data // value = 0; if (isdigit (*pcurrent)) { value = strtoul (pcurrent, &pstring, 10); if (*pstring != '\0') startpos = decode.indexOf (MSMSF_US, startpos); else { value = 0; rc = MSError::BadMSFString; } } _len = value; _pElements = _pOperations->allocate (_len); if (_len) { if (_pElements) { for (unsigned int i=0; i<_len; i++) { if (startpos < slen) { startpos += sizeof(MSMSF_US); rc = _pOperations->setFromString (_pElements, i, (const char *)decode.string()+startpos); if (rc == MSError::MSSuccess) startpos = decode.indexOf (MSMSF_US, startpos); else { rc = MSError::BadMSFString; break; } } else { rc = MSError::BadMSFString; break; } } } else rc = MSError::MSFailure; } else rc = MSError::BadMSFString; } else rc = MSError::BadMSFString; if (rc != MSError::MSSuccess) removeAll(); return rc; } MSIndexVector MSBuiltinVectorImpl::gradeUp() const { #if defined(MS_64BIT) return MSVectorImpl::gradeUp(); #else struct HH { struct HH *h; unsigned i; }; unsigned int size = _pOperations->size (_pElements); MSIndexVector::Data *d = MSIndexVector::Data::allocateWithSize (size); if (_len > 0) { unsigned int *pIndices = d->elements(); double x, u, y; unsigned int i, c=_len*20; unsigned int *pGradient = new unsigned [3*_len]; HH *h = (HH *)(pGradient + _len); HH *j, *k; u = _pBuiltInOps->getAsNumber (_pElements, 0); y = u; for (i=0; i<_len; i++) // get upper,lower bound, and initialize pGradient { pGradient[i] = 0; x = _pBuiltInOps->getAsNumber (_pElements, i); if (finite(x)==0) // if the element is Inf or NaN { // only "normal" numbers are allowed in this sort algorithm // mergeSortUp(pGradient,pIndices); delete [] pGradient; return MSIndexVector(d,_len); } if (x < u) u = x; else if (x > y) y = x; } y -= u; if (y>=DBL_MAX || finite(y)==0) { // range too large--bail out into merge sort mergeSortUp(pGradient,pIndices); delete [] pGradient; return MSIndexVector(d,_len); } if (y) y = _len / (y*(1+1E-13)); for (i=_len; i--;) { x = _pBuiltInOps->getAsNumber (_pElements, i); k = (HH *)(pGradient + (int)((x-u)*y)); for (;(j=k->h) && x>_pBuiltInOps->getAsNumber(_pElements,j->i); k=j) { if (!--c) { // hash not going well--bail out into merge sort mergeSortUp(pGradient,pIndices); delete [] pGradient; return MSIndexVector(d,_len); } } h->h = j; h->i = i; k->h = h++; } for (i=0; i<_len; i++) for (h=(HH *)pGradient[i]; h!=0; h=h->h) *pIndices++ = h->i; delete [] pGradient; } return MSIndexVector (d, _len); #endif //MS_64BIT } MSIndexVector MSBuiltinVectorImpl::gradeDown() const { #if defined(MS_64BIT) return MSVectorImpl::gradeDown(); #else struct HH { struct HH *h; unsigned i; }; unsigned int size = _pOperations->size (_pElements); MSIndexVector::Data *d = MSIndexVector::Data::allocateWithSize (size); if (_len > 0) { unsigned int *pIndices = d->elements(); double x, u, y; unsigned int i, c=_len*20; unsigned int *pGradient = new unsigned [3*_len]; HH *h = (HH *)(pGradient + _len); HH *j, *k; u = - _pBuiltInOps->getAsNumber (_pElements, 0); y = u; for (i=0; i<_len; i++) // get upper,lower bound, and initialize pGradient { pGradient[i] = 0; x = - _pBuiltInOps->getAsNumber (_pElements, i); if (finite(x)==0) // if the element is Inf or NaN { // only "normal" numbers are allowed in this sort algorithm, no NaN or Inf // mergeSortDown(pGradient,pIndices); delete [] pGradient; return MSIndexVector(d,_len); } if (x < u) u = x; else if (x > y) y = x; } y -= u; if (y>=DBL_MAX || finite(y)==0) { // range too large--bail out into merge sort mergeSortDown(pGradient,pIndices); delete [] pGradient; return MSIndexVector(d,_len); } if (y) y = _len / (y*(1+1E-13)); for (i=_len; i--;) { x = - _pBuiltInOps->getAsNumber (_pElements, i); k = (HH *)(pGradient + (int)((x-u)*y)); for (;(j=k->h) && x>-_pBuiltInOps->getAsNumber(_pElements,j->i); k=j) { if (!--c) { // hash not going well--bail out into merge sort mergeSortDown(pGradient,pIndices); delete [] pGradient; return MSIndexVector(d,_len); } } h->h = j; h->i = i; k->h = h++; } for (i=0; i<_len; i++) for (h=(HH *)pGradient[i]; h!=0; h=h->h) *pIndices++ = h->i; delete [] pGradient; } return MSIndexVector (d, _len); #endif //MS_64BIT } double MSBuiltinVectorImpl::median() const { if (!_len) return 0.0; if (_len % 2 == 0) // is it even? if so, be pedantic about the median - { // some books say don't bother for n>100 const MSIndexVector i=gradeUp(); unsigned n = _len / 2; return (_pBuiltInOps->getAsNumber(_pElements,i(n-1))+_pBuiltInOps->getAsNumber(_pElements,i(n))) / 2; } else return (_pBuiltInOps->getAsNumber(_pElements, gradeUp()(_len/2))); } double MSBuiltinVectorImpl::variance(double mean_, MSEstimateType estType_) const { if (_len > 1) { double t = 0.0, r = 0.0; // // The variance is a measure of how spread out a distribution is. // It is computed as the average squared deviation of each number from its mean. // The formula for the variance in a *population* is: // // sigma^2 = SUMMATION(i=1,n,(X(i)-mu)^2) / n // // where n is the size of the population, mu is its mean, and X(i) is the value of i-th data element. // // When the variance is computed in a *sample*, the following statistic can be used: // // S^2 = SUMMATION(i=1,N,(X(i)-M)^2) / N // // where N is the size of the sample, and M is its mean. S is a *biased* estimate of sigma, however. // An *unbiased* estimate of sigma^2 can be found by the following formula: // // S^2 = SUMMATION(i=1,N,(X(i)-M)^2) / (N-1) // // In this method, the estimate type (biased or unbiased) is controlled by the estType_ parameter. // double denom = (estType_==MSBiased) ? _len : _len-1; for (unsigned int i=0; i<_len; i++) { t = _pBuiltInOps->getAsNumber (_pElements, i) - mean_; r += t * t; } return (r/denom); } return 0.0; } MSBuiltinVectorImpl *MSBuiltinVectorImpl::movingAverage (unsigned int width_) { if (_len < width_) return (MSBuiltinVectorImpl *)create(); unsigned int newLen = _len - width_ +1; // because of the above test, newLen >= 1 MSBuiltinVectorImpl *mvAvg = (MSBuiltinVectorImpl *) create (newLen); double sum = 0.0; unsigned int i, j; for (i=0; igetAsNumber (_pElements, i); for (i=0, j=width_; ; i++, j++) { mvAvg->_pBuiltInOps->setToNumber (mvAvg->_pElements, i, sum/width_); if (j == _len) break; sum += _pBuiltInOps->getAsNumber (_pElements, j) - _pBuiltInOps->getAsNumber (_pElements, i); } return mvAvg; } MSBuiltinVectorImplOps::MSBuiltinVectorImplOps() { } MSBuiltinVectorImplOps::~MSBuiltinVectorImplOps() { } aplus-fsf-4.22/src/MSTypes/MSCalendar.C0000644000265000001440000006527010772770443013253 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #if HAVE_IOSTREAM #include #else #include #endif #if HAVE_FSTREAM #include #else #include #endif #include #include #include #if defined(MSTK_MANUAL_INSTANTIATION) #include #if defined(MS_XLC_TEMPLATE_INSTANTIATION) #pragma define(MSIHashKeySet) #pragma define(MSIHashKeySet) #pragma define(MSIHashKeySet) #endif #if defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma instantiate MSIHashKeySet #pragma instantiate MSIHashKeySet #pragma instantiate MSIHashKeySet #endif #if defined(MS_STD_TEMPLATE_INSTANTIATION) template class MSIHashKeySet; template class MSIHashKeySet; template class MSIHashKeySet; #endif #if defined(MS_VC_TEMPLATE_INSTANTIATION) template MSIHashKeySet; template MSIHashKeySet; template MSIHashKeySet; #endif #endif //MSTK_MANUAL_INSTANTIATION //####################################################### // MSCalendar //####################################################### MSString MSCalendar::_defaultHolidayFile("./holidays.dat"); MSString MSCalendar::_defaultHolidayDescriptionFile("./holidays.des"); MSBoolean MSCalendar::_isDescriptionDataInstalled=MSFalse; unsigned int MSResourceCodeDesc::_count=0; MSString MSCalendar::_invalidResourceCodeMessage="INVALID MSResourceCode !! "; MSResourceCodeDescriptionSet MSCalendar::_descSet; MSResourceCodeDescriptionSetCursor MSCalendar::_descSetCursor(MSCalendar::_descSet); MSHolidaySet MSCalendar::_holidaySet; #if defined(MS_MULTI_THREAD) static MSMutex descSetMutex; static MSMutex holidaySetMutex; #endif //MS_MULTI_THREAD // The functions below implement layering technique in MSCalendar. The idea // behind layering is to separate internal (implementation) and external // (interface) methods of a class. Interface methods will be called by the // user and will never be called internally by other class functions. // Interface methods will call implementation methods to do the actual work. // Implementation methods can call other implementation methods. This // separation of the code into different layers is especially useful when // implementing thread safety of a class. Implementation methods *never* // do any locking; locking is full responsibility of interface methods. // This helps prevent deadlocks (e.g., a method acquires a lock, and then calls // another method, which tries to acquire the same lock), which would be quite // difficult if the code were not organized this way. // // By convention, all functions whose names start with an underscore ('_') are // internal (implementation) functions. Regularly, they would be protected // member functions of the class; however, since these changes are for a patch // release (of 2.6), we cannot make any header file changes - thus, we have to // make the functions global. // static MSBoolean _installHolidaySet(MSHolidaySet&, const MSResourceCode&, MSHolidaySet::Cursor&); static MSBoolean _parseAndAddHolidaySet(MSHolidaySet&, const MSString&, const MSResourceCode, MSHolidaySet::Cursor&); static MSBoolean _locateOrInstallHolidaySet(MSHolidaySet&, const MSResourceCode&, MSHolidaySet::Cursor&); inline MSBoolean _isHoliday(const MSDate&, const MSResourceHolidaySet&); static MSBoolean _isHoliday(const MSDate&, MSHolidaySet&, const MSResourceCode&); static MSBoolean _isHoliday(const MSDate&, MSHolidaySet&, const MSResourceCodeSet&); static MSBoolean _isValidTradeDate(const MSDate&, const MSResourceHolidaySet&); static MSBoolean _isValidTradeDate(const MSDate&, MSHolidaySet&, const MSResourceCode&); static MSBoolean _isValidTradeDate(const MSDate&, MSHolidaySet&, const MSResourceCodeSet&); static MSDate _nextTradeDate(const MSDate&, MSHolidaySet&, const MSResourceCode&); static MSDate _nextTradeDate(const MSDate&, MSHolidaySet&, const MSResourceCodeSet&); MSCalendar::MSCalendar(void) {} MSCalendar::~MSCalendar(void) {} const MSString& MSCalendar::defaultHolidayFile(void) { return _defaultHolidayFile; } void MSCalendar::defaultHolidayFile(const MSString& file_) { _defaultHolidayFile=file_; } const MSString& MSCalendar::defaultHolidayDescriptionFile(void) { return _defaultHolidayDescriptionFile; } void MSCalendar::defaultHolidayDescriptionFile(const MSString& file_) { _defaultHolidayDescriptionFile=file_; } // format of holiday file: // // resourceCode date,"description" date,"description" .... eol // resourceCode date,"description" date,"description" .... eol // eof // // returns MSTrue if the holiday set for resourceCode_ parsed and added successfully MSBoolean MSCalendar::parseAndAddHolidaySet(const MSString& holidayString_,const MSResourceCode& resourceCode_) { MSHolidaySet::Cursor c(holidaySet()); return _parseAndAddHolidaySet(holidaySet(),holidayString_,resourceCode_,c); } // this will removeAll resources in the holiday set and // rebuild the calendar from the database // MSBoolean MSCalendar::installHolidaySet(void) { return installHolidaySetFrom(defaultHolidayFile()); } MSBoolean MSCalendar::installHolidaySetFrom(const MSString& holidayFile_) { MSGUARD(holidaySetMutex); ifstream fin(holidayFile_); if (fin.fail()==ios::goodbit) { MSString line; unsigned position; MSHolidaySet::Cursor c(holidaySet()); holidaySet().removeAll(); while (!fin.eof()) { line=MSString::lineFrom(fin); if (line.length()>0) { position=line.indexOf(' '); if (position=firstDayOfMonth) { if (_isValidTradeDate(tradeDate,aSet1_)==MSTrue && _isValidTradeDate(tradeDate,aSet2_)==MSTrue) return tradeDate; tradeDate--; } return tradeDate; } MSDate MSCalendar::lastTradeDateOfMonth(const MSDate& aDate_, const MSResourceCodeSet& rCodeSet_) { if(aDate_.isSet()==MSFalse) return MSDate::nullDate(); MSDate tradeDate(aDate_); MSDate firstDayOfMonth(aDate_); tradeDate.setLastDayOfMonth(); firstDayOfMonth.setFirstDayOfMonth(); MSGUARD(holidaySetMutex); while (tradeDate>=firstDayOfMonth) { if (_isValidTradeDate(tradeDate,holidaySet(),rCodeSet_)==MSTrue) { return tradeDate; } tradeDate--; } return tradeDate; } MSDate MSCalendar::firstTradeDateOfMonth(const MSDate& aDate_, const MSResourceCodeSet& rCodeSet_) { if(aDate_.isSet()==MSFalse) return MSDate::nullDate(); MSDate tradeDate(aDate_); MSDate lastDayOfMonth(aDate_); tradeDate.setFirstDayOfMonth(); lastDayOfMonth.setLastDayOfMonth(); MSGUARD(holidaySetMutex); while (tradeDate<=lastDayOfMonth) { if (_isValidTradeDate(tradeDate,holidaySet(),rCodeSet_)==MSTrue) { return tradeDate; } tradeDate++; } return tradeDate; } MSDate MSCalendar::lastTradeDateOfPrevMonth(const MSDate& aDate_, const MSResourceCodeSet& rCodeSet_) { if(aDate_.isSet()==MSFalse) return MSDate::nullDate(); MSDate aDayOfPrevMonth(aDate_-MSTerm(0,1,0)); return (lastTradeDateOfMonth(aDayOfPrevMonth, rCodeSet_)); } // calcForwardDate // parameters: // MSTerm aTerm - e.g. '1M', '14M', '1Y' // MSDate startingDate - represents the date which you should start with when calculating the // forward date. // MSString resourceCode1 - // MSString resourceCode2 - // // calcForwardDate does calendar-smart arithmetic, i.e. it skips weekends // and holidays. // // it computes the forward date by adding the term to starting date. // if it is a common trade date, return forward date // else return next trade date of forward date // // business-unit specific rules will be handled in MSBusinessDate/Time // and their subclasses. // MSDate MSCalendar::calcForwardDate(const MSTerm& aTerm_, const MSResourceCode& resourceCode_, const MSDate& startingDate_) { if(startingDate_.isSet()==MSFalse) return MSDate::nullDate(); MSHolidaySet::Cursor c(holidaySet()); MSGUARD(holidaySetMutex); if (_locateOrInstallHolidaySet(holidaySet(),resourceCode_,c)==MSTrue) { const MSResourceHolidaySet& aSet=c.element(); MSDate forwardDate(startingDate_+aTerm_); if (_isValidTradeDate(forwardDate,aSet)==MSTrue) return forwardDate; else { do { forwardDate++; } while (_isValidTradeDate(forwardDate,aSet)!=MSTrue); return forwardDate; } } return MSDate(MSDate::nullDate()); } MSDate MSCalendar::calcForwardDate(const MSTerm& aTerm_, const MSResourceCodeSet& rCodeSet_, const MSDate& startingDate_) { if(startingDate_.isSet()==MSFalse) return MSDate::nullDate(); unsigned len=rCodeSet_.numberOfElements(); MSHolidaySet::Cursor c(holidaySet()); MSGUARD(holidaySetMutex); for(unsigned int i=0; i 0) { do { ++aDate; } while (_isValidTradeDate(aDate,holidaySet(),rCodeSet_)!=MSTrue); --numOfDay_; } return aDate; } MSDate MSCalendar::prevNTradeDate(const MSDate & aDate_, int numOfDay_, const MSResourceCodeSet & rCodeSet_) { if(aDate_.isSet()==MSFalse) return MSDate::nullDate(); MSDate aDate(aDate_); MSGUARD(holidaySetMutex); while (numOfDay_ > 0) { do { --aDate; } while (_isValidTradeDate(aDate,holidaySet(),rCodeSet_)!=MSTrue); --numOfDay_; } return aDate; } ostream& operator<<(ostream& aStream_,const MSCalendar& aCalendar_) { MSGUARD(holidaySetMutex); MSHolidaySet::Cursor holidaySetCursor(aCalendar_.holidaySet()); forCursor(holidaySetCursor) aStream_<0) { position=holidayString_.indexOf(' '); if (position0&&resourceCode==rCode_) { MSResourceHolidaySet aResourceHolidaySet(resourceCode); while ((position=holidayString_.indexOf(',',lastPosition))startDescriptionPosition&&length>1) { description=holidayString_.subString(startDescriptionPosition+1,length-1); } else description=""; aResourceHolidaySet.add(MSHoliday(aDate,resourceCode,description)); lastPosition=holidayString_.indexOf(' ',endDescriptionPosition)+1; } if (set_.addOrReplaceElementWithKey(aResourceHolidaySet,c_)==MSTrue) return MSTrue; } } } return MSFalse; } MSBoolean _locateOrInstallHolidaySet(MSHolidaySet& set_, const MSResourceCode& rCode_, MSHolidaySet::Cursor& cursor_) { if (set_.locateElementWithKey(rCode_,cursor_)==MSFalse) { return _installHolidaySet(set_,rCode_,cursor_); } return MSTrue; } inline MSBoolean _isHoliday(const MSDate& date_, const MSResourceHolidaySet& set_) { return set_.containsElementWithKey(date_); } MSBoolean _isHoliday(const MSDate& date_, MSHolidaySet& set_, const MSResourceCode& rCode_) { MSHolidaySet::Cursor c(set_); if (_locateOrInstallHolidaySet(set_,rCode_,c)==MSTrue) { const MSResourceHolidaySet& aSet=c.element(); return _isHoliday(date_,aSet); } else { return MSFalse; } } MSBoolean _isHoliday(const MSDate& date_, MSHolidaySet& set_, const MSResourceCodeSet& rCodeSet_) { if (rCodeSet_.isEmpty()==MSTrue || date_.isSet()==MSFalse) { return MSFalse; } unsigned len=rCodeSet_.numberOfElements(); for(unsigned int i=0; i MSCallback::MSCallback(void) {} MSCallback::~MSCallback(void) {} aplus-fsf-4.22/src/MSTypes/MSCallbackBehavior.C0000644000265000001440000001600410772770443014705 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class CallbackNode { public: MSCallback *_pCallback; MSSymbol _name; void *_pIdentifier; CallbackNode(const MSSymbol& name_,MSCallback *pCallback_); CallbackNode(const MSSymbol& name_,MSCallback *pCallback_,void *pIdentifier_); ~CallbackNode(void); void callback(MSCallback *pCallback_); }; class CallbackVector { public: enum State {Normal=0,Processing=1,Dirty=2}; CallbackVector(void); ~CallbackVector(void); CallbackNode *node(unsigned i) {return (CallbackNode *)_callbackVector(i);} unsigned length(void) const {return _callbackVector.length();} void markForRemoval(unsigned i); void removeMarkedElements(void); CallbackVector& append(CallbackNode *node_); void state(State state_) {_state=state_;} MSUnsignedLongVector _callbackVector; State _state; }; MSCallbackBehavior::MSCallbackBehavior(void) : _pCallbackVector(0) {} MSCallbackBehavior::~MSCallbackBehavior(void) { deleteCallbackList();} // add a callback for the given event, replacing the current // callback. the identifier will be equal to the callback pointer // and thus will allow it to be uniquely identified. void MSCallbackBehavior::callback(const MSSymbol& name_,MSCallback *pCallback_) { CallbackNode *node; if ((node=callbackNode(name_))!=0) node->callback(pCallback_); else { if (_pCallbackVector==0) _pCallbackVector=new CallbackVector; node=new CallbackNode(name_,pCallback_); _pCallbackVector->append(node); } } // add a callback to the end of the callback list void MSCallbackBehavior::addCallback(const MSSymbol& name_,MSCallback *pCallback_,void *pIdentifier_) { if (_pCallbackVector==0) _pCallbackVector=new CallbackVector; CallbackNode *node=new CallbackNode(name_,pCallback_,pIdentifier_); _pCallbackVector->append(node); } // remove the callback with the given name and identifier void MSCallbackBehavior::removeCallback(const MSSymbol& name_,void *pIdentifier_) { if (_pCallbackVector!=0) { unsigned n=_pCallbackVector->length(); for (unsigned i=0;inode(i); if (node!=0&&node->_name==name_&&node->_pIdentifier==pIdentifier_) { delete node; _pCallbackVector->markForRemoval(i); break; } } } } void MSCallbackBehavior::removeCallback(const MSSymbol& name_) { if (_pCallbackVector!=0) { unsigned n=_pCallbackVector->length(); for (unsigned i=0;inode(i); if (node!=0&&node->_name==name_) { delete node; _pCallbackVector->markForRemoval(i); } } } } MSBoolean MSCallbackBehavior::activateCallback(const MSSymbol& name_) { if (_pCallbackVector!=0) { unsigned n=_pCallbackVector->length(); MSBoolean rValue=MSFalse; CallbackVector::State previousState=_pCallbackVector->_state; if (_pCallbackVector->_state==CallbackVector::Normal) { _pCallbackVector->state(CallbackVector::Processing); } for (unsigned i=0;inode(i); if (node!=0&&node->_name==name_) { MSCallback *pCallback=node->_pCallback; if (pCallback!=0) doCallback(pCallback); rValue=MSTrue; } } CallbackVector::State afterState=_pCallbackVector->_state; if (previousState==CallbackVector::Normal) // first entry { if (afterState==CallbackVector::Dirty) _pCallbackVector->removeMarkedElements(); _pCallbackVector->state(previousState); } else if (previousState==CallbackVector::Processing) // reentrant { if (afterState!=CallbackVector::Dirty) _pCallbackVector->state(previousState); } return rValue; } return MSFalse; } MSCallback *MSCallbackBehavior::callback(const MSSymbol& name_) { CallbackNode *node=callbackNode(name_); return (node!=0)?node->_pCallback:0; } CallbackNode *MSCallbackBehavior::callbackNode(const MSSymbol& name_) { if (_pCallbackVector!=0) { unsigned n=_pCallbackVector->length(); for (unsigned i=0;inode(i); if (node!=0&&node->_name==name_&&node->_pIdentifier==(void *)node) { return node; } } } return 0; } void MSCallbackBehavior::removeAllCallbacks(void) { if (_pCallbackVector!=0) { unsigned n=_pCallbackVector->length(); for (unsigned i=0;inode(i); if (node!=0) { delete node; _pCallbackVector->markForRemoval(i); } } } } void MSCallbackBehavior::deleteCallbackList(void) { if (_pCallbackVector!=0) { removeAllCallbacks(); delete _pCallbackVector; _pCallbackVector=0; } } MSBoolean MSCallbackBehavior::hasCallback(const MSSymbol& name_) const { if (_pCallbackVector!=0) { unsigned n=_pCallbackVector->length(); for (unsigned i=0;inode(i); if (node!=0&&node->_name==name_) return MSTrue; } } return MSFalse; } MSBoolean MSCallbackBehavior::hasCallback(const MSSymbol& name_, void *pIdentifier_) const { if (_pCallbackVector!=0) { unsigned n=_pCallbackVector->length(); for (unsigned i=0;inode(i); if (node!=0&&node->_name==name_&&node->_pIdentifier==pIdentifier_) return MSTrue; } } return MSFalse; } void MSCallbackBehavior::doCallback(MSCallback *callback_) { callback_->process(); } // ######################################################### // CallbackVector // ######################################################### CallbackVector::CallbackVector(void) : _state(Normal) {} CallbackVector::~CallbackVector(void) {} void CallbackVector::markForRemoval(unsigned i) { _callbackVector.replaceAt(i,0); _state=Dirty; } void CallbackVector::removeMarkedElements(void) { _callbackVector.remove(_callbackVector.binaryCompare(0,MSEqualTo)); _state=Normal; } CallbackVector& CallbackVector::append(CallbackNode *node_) { _callbackVector.append((unsigned long)node_); return *this; } // ######################################################### // CallbackNode // ######################################################### CallbackNode::CallbackNode(const MSSymbol& name_,MSCallback *pCallback_) : _name(name_), _pCallback(pCallback_) { _pIdentifier=(void *)this; } CallbackNode::CallbackNode(const MSSymbol& name_,MSCallback *pCallback_,void *pIdentifier_) : _name(name_), _pCallback(pCallback_), _pIdentifier(pIdentifier_) {} CallbackNode::~CallbackNode(void) { delete _pCallback; _pCallback=0; } void CallbackNode::callback(MSCallback *pCallback_) { if (_pCallback!=pCallback_) { delete _pCallback; _pCallback=pCallback_; } } aplus-fsf-4.22/src/MSTypes/MSChangedCallback.C0000644000265000001440000000100210772770443014467 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include MSChangedCallback::MSChangedCallback(void) {} MSChangedCallback::~MSChangedCallback(void) {} void MSChangedCallback::receiveEvent(MSEvent& aEvent_) { process(aEvent_.sender()); } aplus-fsf-4.22/src/MSTypes/MSCharMatrix.C0000644000265000001440000001352110772770443013574 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MSTypeMatrixHEADER #include #endif #ifndef MSTypeDataHEADER #include #endif #if HAVE_IOSTREAM #include #else #include #endif #if defined(MSTK_MANUAL_INSTANTIATION) #include #include #if defined(MS_XLC_TEMPLATE_INSTANTIATION) #pragma define (MSTypeMatrix) #endif #if defined(MS_VC_TEMPLATE_INSTANTIATION) template MSTypeMatrix; #endif #if defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma do_not_instantiate MSString MSTypeMatrix::asString(void) const #pragma instantiate MSTypeMatrix #pragma instantiate MSMatrixSTypePick #if !defined(MS_TEMPLATE_MANUAL_FRIEND_BUG) // The version of EDG used by SGI's dcc compiler has a bug related to access from friends #pragma instantiate MSTypeMatrix operator-(const MSTypeMatrix&) #pragma instantiate MSTypeMatrix operator+(const MSTypeMatrix&,char) #pragma instantiate MSTypeMatrix operator+(char,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix operator+(const MSTypeMatrix&,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix operator-(const MSTypeMatrix&,char) #pragma instantiate MSTypeMatrix operator-(const MSTypeMatrix&,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix operator*(const MSTypeMatrix&,char) #pragma instantiate MSTypeMatrix operator*(char,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix operator*(const MSTypeMatrix&,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix operator/(const MSTypeMatrix&,char) #pragma instantiate MSTypeMatrix operator/(const MSTypeMatrix&,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix operator+(const MSTypeMatrix&,const MSTypeVector&) #pragma instantiate MSTypeMatrix operator-(const MSTypeMatrix&,const MSTypeVector&) #pragma instantiate MSTypeMatrix operator*(const MSTypeMatrix&,const MSTypeVector&) #pragma instantiate MSTypeMatrix operator/(const MSTypeMatrix&,const MSTypeVector&) #pragma instantiate MSTypeMatrix operator+(const MSTypeVector&,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix operator*(const MSTypeVector&,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix multiply(const MSTypeMatrix&,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix stack(const MSTypeMatrix&,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix adjoin(const MSTypeMatrix&,const MSTypeMatrix&) #endif //!MS_TEMPLATE_MANUAL_FRIEND_BUG #endif //MS_EDG_TEMPLATE_INSTANTIATION #if defined(MS_STD_TEMPLATE_INSTANTIATION) template class MSTypeMatrix; template class MSMatrixSTypePick; template MSTypeMatrix operator-(const MSTypeMatrix&); template MSTypeMatrix operator+(const MSTypeMatrix&,char); template MSTypeMatrix operator+(char,const MSTypeMatrix&); template MSTypeMatrix operator+(const MSTypeMatrix&,const MSTypeMatrix&); template MSTypeMatrix operator-(const MSTypeMatrix&,char); template MSTypeMatrix operator-(const MSTypeMatrix&,const MSTypeMatrix&); template MSTypeMatrix operator*(const MSTypeMatrix&,char); template MSTypeMatrix operator*(char,const MSTypeMatrix&); template MSTypeMatrix operator*(const MSTypeMatrix&,const MSTypeMatrix&); template MSTypeMatrix operator/(const MSTypeMatrix&,char); template MSTypeMatrix operator/(const MSTypeMatrix&,const MSTypeMatrix&); template MSTypeMatrix operator+(const MSTypeMatrix&,const MSTypeVector&); template MSTypeMatrix operator-(const MSTypeMatrix&,const MSTypeVector&); template MSTypeMatrix operator*(const MSTypeMatrix&,const MSTypeVector&); template MSTypeMatrix operator/(const MSTypeMatrix&,const MSTypeVector&); template MSTypeMatrix operator+(const MSTypeVector&,const MSTypeMatrix&); template MSTypeMatrix operator*(const MSTypeVector&,const MSTypeMatrix&); template MSTypeMatrix multiply(const MSTypeMatrix&,const MSTypeMatrix&); template MSTypeMatrix stack(const MSTypeMatrix&,const MSTypeMatrix&); template MSTypeMatrix adjoin(const MSTypeMatrix&,const MSTypeMatrix&); #endif //MS_STD_TEMPLATE_INSTANTIATION #endif //MSTK_MANUAL_INSTANTIATION //---------------------------------------------------------------------- // specializations for MSTypeMatrix //---------------------------------------------------------------------- // this method cannot be specialized with sunpro because a defintion // exists and thus it will be automatically instantiated in the template // database and lead to "multiply defined symbols". #if !defined(MS_TEMPLATE_FUNCTION_SPECILIZATON_BUG) MSString MSTypeMatrix::asString(void) const { MSString result; result+='('; result+=MSString(rows()); result+=','; result+=MSString(columns()); result+=") "; unsigned n=length(); for (unsigned i=0;i& aTypeMatrix_) { unsigned r=aTypeMatrix_.rows(); unsigned c=aTypeMatrix_.columns(); for (unsigned i=0;i #if defined(MS_FORCE_INTERNAL_TEMPLATE_INSTANTIATION) #define MS_MSCharVector_INSTANTIATE #define MSTK_MANUAL_INSTANTIATION #endif #include #if HAVE_IOSTREAM #include #else #include #include #endif #ifdef MS_NO_INLINES #include #endif // MS_NO_INLINES MSTypeVector::MSTypeVector() : BuiltinVectorChar() { } MSTypeVector::MSTypeVector (unsigned int length_) : BuiltinVectorChar (length_) { } MSTypeVector::MSTypeVector (unsigned int length_, const char filler_) : BuiltinVectorChar (length_, filler_) { } MSTypeVector::MSTypeVector (const MSTypeVector & vect_) : BuiltinVectorChar (vect_) { } MSTypeVector::MSTypeVector (const BuiltinVectorChar & vect_) : BuiltinVectorChar (vect_) { } MSTypeVector::MSTypeVector (const BaseVectorChar & vect_) : BuiltinVectorChar ((BuiltinVectorChar &)vect_) { } MSTypeVector::MSTypeVector (const char *pString_) : BuiltinVectorChar (pString_) { } MSTypeVector::MSTypeVector (MSTypeData > *pData_, unsigned int len_) : BuiltinVectorChar (pData_, len_) { } MSTypeVector::MSTypeVector (const char *pElements_, unsigned int len_) : BuiltinVectorChar (pElements_, len_) { } MSTypeVector::~MSTypeVector() { } MSTypeVector & MSTypeVector::operator= (const MSTypeVector & vect_) { return (MSTypeVector &) BuiltinVectorChar::operator= (vect_); } MSTypeVector & MSTypeVector::operator= (const BuiltinVectorChar & vect_) { return (*this = (MSTypeVector &)vect_); } MSTypeVector & MSTypeVector::operator= (const BaseVectorChar & vect_) { return (*this = (MSTypeVector &)vect_); } MSTypeVector & MSTypeVector::operator= (const char value_) { return (MSTypeVector &) BuiltinVectorChar::operator= (value_); } MSTypeVector & MSTypeVector::operator= (const char *pString_) { return (*this = MSTypeVector(pString_)); // return (MSTypeVector &) BuiltinVectorChar::operator= (pString_); } MSString MSTypeVector::className() const { return MSString ("MSTypeVector"); } const MSSymbol & MSTypeVector::type() const { return symbol(); } MSModel * MSTypeVector::clone() const { return new MSTypeVector (*this); } MSModel * MSTypeVector::create() const { return new MSTypeVector; } const MSSymbol & MSTypeVector::symbol() { static MSSymbol sym ("MSTypeVector"); return sym; } #if HAVE_SSTREAM void whitespace (const char &, istringstream & ist) #else void whitespace (const char &, istrstream & ist) #endif { ist.unsetf (ios::skipws); } #if defined(MSTK_MANUAL_INSTANTIATION) #include #include #if defined(MS_XLC_TEMPLATE_INSTANTIATION) #pragma define (MSTypeVector) #endif #if defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma instantiate MSBaseVector > #pragma instantiate MSBuiltinVector #pragma instantiate MSBuiltinSPick #if !defined(MS_TEMPLATE_MANUAL_FRIEND_BUG) // The version of EDG used by SGI's dcc compiler has a bug related to access from friends #pragma instantiate ostream & operator<<(ostream&, const MSBaseVector >&) #endif //__DELTA #endif //__sgi || __edgfe #if defined(MS_VC_TEMPLATE_INSTANTIATION) template MSBaseVector >; template MSBaseVectorOps >; template MSBuiltinVector; template MSBuiltinVectorOps; template MSBuiltinSPick; static int __instantiateFriends__() // instantiate non-inline friend template functions { if (0) { MSBuiltinVector dummy; operator<<(cout, dummy); } return 0; } static int __dummyInt__=__instantiateFriends__(); #endif // MS_VC_TEMPLATE_INSTANTIATION #if defined(MS_STD_TEMPLATE_INSTANTIATION) template class MSBaseVector >; template class MSBaseVectorOps >; template class MSBuiltinVector; template class MSBuiltinVectorOps; template class MSBuiltinSPick; template ostream& operator<<(ostream&,const MSBaseVector >&); #endif #endif // MSTK_MANUAL_INSTANTIATION aplus-fsf-4.22/src/MSTypes/MSConvert.C0000644000265000001440000000264510772770444013160 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #ifdef MS_NO_INLINES #include #endif // MS_NO_INLINES MSError::ErrorStatus msConvert(const MSIntVector& iv_, MSFloatVector& fv_) { unsigned int n=iv_.length(); fv_.reshape(n); // // fv_'s reference count should now be 1, so it's safe to write directly into elements // const int *ivData=iv_.data(); double *fvData=fv_.data(); while (n--) { *fvData++ = (double)*ivData++; } return MSError::MSSuccess; } MSError::ErrorStatus msConvert(const MSBinaryVector& bv_, MSIndexVector& iv_) { unsigned int n=bv_.length(); iv_.reshape((unsigned int)(bv_.sum())); // the number of elements in iv_ is the number of 1's in bv_ // // iv_'s reference count should now be 1, so it's safe to write directly into elements // const unsigned char *bvData=bv_.data(); unsigned int *ivData=iv_.data(); for (unsigned int i=0; i #ifdef MS_NO_INLINES #include #endif // MS_NO_INLINES MSData::MSData (unsigned int size_) : _size(size_), _refCount(1) { } MSData::~MSData() { } unsigned int MSData::computeSize (unsigned int len_) { if (len_ > 0) { unsigned l=len_>>1,p=1; for (;l!=0;l>>=1,p++); return (1< #include #if HAVE_IOSTREAM #include #else #include #endif #include #include #include #include #include #include #include #include #include #include // static constants const unsigned long SEP_14_1752=2361222; // first day of Gregorian calendar static const char *NullString=""; // months 1-12, 0 is padding const unsigned char MSDate::_daysInMonth[13]={0,31,28,31,30,31,30,31,31,30,31,30,31}; const MSDay MSDate::_firstDayOfEachMonth[13]={0,1,32,60,91,121,152,182,213,244,274,305,335}; const char *MSDate::_monthNames[12]={"January","February","March","April","May","June","July", "August","September","October","November","December"}; const char *MSDate::_ucMonthNames[12]={"JANUARY","FEBRUARY","MARCH","APRIL","MAY","JUNE","JULY", "AUGUST","SEPTEMBER","OCTOBER","NOVEMBER","DECEMBER"}; const char *MSDate::_weekDayNames[7]={"Monday","Tuesday","Wednesday","Thursday","Friday", "Saturday","Sunday"}; const char *MSDate::_ucWeekDayNames[7]={"MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY", "SATURDAY","SUNDAY" }; MSDate::MSDateFormat MSDate::_defaultFormat=MSDate::Slash4; MSString MSDate::_strftimeDefaultFormat="%D"; MSJulian MSDate::_nullDate=0; MSBoolean MSDate::_defaultConstructToToday=MSFalse; #ifdef MS_NO_INLINES #include #endif MSDate::MSDate(const MSTime &time_,MSTime::MSTimeZone zone_) { MSString s; (void)time_.format(&s,MSTime::MonthDayYear,zone_); set(&s); } #if defined(MS_NEED_STRPTIME_DECLARATION) extern "C" char *strptime(const char*, const char*, struct tm*); #endif MSDate::MSDate(const MSString& aString_,const char* strptimeFormat_) { struct tm aTimeStruct={0}; #if defined(MS_NO_STRPTIME) MSMessageLog::errorMessage("MSDate: strptime() not supported for this platform.\n"); _date=0; #else char *pString=strptime((char *)aString_.string(),(char *)strptimeFormat_,&aTimeStruct); if (pString==0) _date=0; else _date=asJulianNumber(aTimeStruct.tm_mon+1,aTimeStruct.tm_mday,aTimeStruct.tm_year+1900); #endif } MSDate::~MSDate(void) {} //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // MSModel virtual methods //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MSString MSDate::asString(void) const { MSString aString; return MSString(format(aString,MSDate::defaultFormat())); } MSString MSDate::asDebugInfo(void) const { MSString result("MSDate(@"); result+=MSString((unsigned long)this).d2x().lowerCase(); result+=",_date="; result+=MSString((unsigned long)date()); result+=",_locale="; result+=MSString((int)_locale); result+=",_override="; result+=MSString((unsigned long)_override); result+=",_useOverride="; result+=MSString((int)_useOverride); result+=",_firstTime="; result+=MSString((int)_firstTime); result+=",_defaultFormat="; result+=MSString((int)_defaultFormat); result+=",_strftimeDefaultFormat="; result+=_strftimeDefaultFormat; result+=",_defaultConstructToToday="; result+=(defaultConstructToToday()==MSTrue?"MSTrue":"MSFalse"); result+=",_type="; result+=type().symbolName(); result+=")"; return MSString(result); } const MSSymbol& MSDate::symbol(void) { static MSSymbol sym("MSDate"); return sym; } MSString MSDate::className(void) const { return MSString("MSDate"); } const MSSymbol& MSDate::type(void) const { return symbol(); } MSModel *MSDate::clone(void) const { return new MSDate(*this); } MSModel *MSDate::create(void) const { return new MSDate(); } void MSDate::assign(const MSModel& aModel_) { *this=(MSDate&)aModel_; } long MSDate::compare(const MSModel& aModel_) const { return ::compare(*this,(MSDate&)aModel_); } MSString MSDate::asMSF(void) const { MSString buf; if (isSet()==MSTrue) (void) format(&buf,MSDate::Database); return buf; } MSError::ErrorStatus MSDate::setFromMSF(const char *pString_) { int code; if (pString_!=0) code=set(pString_); else code=MSError::BadMSFString; return (MSError::ErrorStatus)code; } void MSDate::unset(void) { if (isSet()==MSTrue) { _date=nullDate(); changed(); } } MSError::ErrorStatus MSDate::set(const MSString *pString_) { return set(pString_->string()); } MSError::ErrorStatus MSDate::set(const MSString& aString_) { return set(aString_.string()); } MSError::ErrorStatus MSDate::set(const char *pString_) { MSError::ErrorStatus rc=MSError::MSSuccess; char *f1,*f2,*f3; char buf[80]; char *cp; static char separators[] = { '/', '.', '-' }; // possible separators between day, month, and year if (pString_==0) rc=MSError::BadDate; else { if (*pString_=='\0'||strcmp(pString_,NullString)==0||strcmp(pString_,"/ /")==0) { _date=nullDate(); // handle null string } else if (MSUtil::hasAlpha(pString_)) { // No alpha input formats are currently allowed // in the future we could allow any of the // output formats, e.g., 11-Nov-1992 rc=MSError::BadDate; } else { strncpy(buf,pString_,sizeof(buf)); f1=buf; // point to the start of string // // see if different parts of the date are separated by one of the items in separators[] array // for (unsigned int i=0; i7) { f1=f2=f3=buf; strncpy(buf,pString_,4); f1[4]='\0'; // strncpy won't insert null if not encountered f2+=5; strncpy(f2,pString_+4,2); f2[2]='\0'; f3+=8; strncpy(f3,pString_+6,2); f3[2]='\0'; // set expects month, day, year return set(f2,f3,f1); } else rc=MSError::BadDate; } } } if (rc!=MSError::MSSuccess) _date=nullDate(); return changed(),rc; } MSError::ErrorStatus MSDate::set(const char *m_,const char *d_,const char *y_) { if ((MSUtil::isNumeric(m_)==MSFalse)|| (MSUtil::isNumeric(d_)==MSFalse)|| (MSUtil::isNumeric(y_)==MSFalse)) { _date=nullDate(); return changed(),MSError::BadDate; } MSJulian date=asJulianNumber(atoi(m_),atoi(d_),atoi(y_)); if (date==nullDate()||datetm_sec=0; pCalendarTime->tm_min=0; pCalendarTime->tm_hour=0; pCalendarTime->tm_mday=d; pCalendarTime->tm_mon=m-1; pCalendarTime->tm_year=y-1900; pCalendarTime->tm_wday=weekDay()==7?0:weekDay(); pCalendarTime->tm_yday=dayOfYear()-1; pCalendarTime->tm_isdst=-1; int numberOfChars; while ((numberOfChars=strftime((char*)aString.string(),aString.length(),format_,pCalendarTime))==0) { aString=MSString(0,2*aString.length()); } // remove the terminating null from strftime. strftime returns the number of characters // produced not including the terminating null character. aString=MSString(aString.string(),numberOfChars); aString_=aString.string(); return aString_; } const char *MSDate::format(MSString& aString_,const MSFormat& aFormat_) const { return (aFormat_.formatType()==MSFormat::Date)?format(aString_,aFormat_.dateFormat()):format(aString_); } const char *MSDate::format(MSString *pString_,const MSFormat& aFormat_) const { return format(*pString_,aFormat_); } const char *MSDate::format(MSString *pString_,MSDateFormat format_) const { return format(*pString_,format_); } const char *MSDate::format(MSString& aString_,MSDateFormat format_) const { char buf[64]; MSMonth m; MSDay d; MSYear y; // Don't want to call asMonthDayYear if the format is Strftime. // It gets called in the strftime format method. if (format_!=Strftime) asMonthDayYear(m,d,y); aString_.removeAll(); buf[0]='\0'; switch (format_) { case Slash: if (_date==nullDate()) aString_=NullString; else { // Format as 11/15/92 switch (_locale) { case European: sprintf(buf,"%02d/%02d/%02d",d,m,y%100); break; case American: sprintf(buf,"%02d/%02d/%02d",m,d,y%100); break; case Japanese: sprintf(buf,"%02d/%02d/%02d",y%100,m,d); break; default: MSMessageLog::warningMessage("MSDate: invalid value of order flag\n"); break; } aString_+=buf; } break; case Slash4: if (_date==nullDate()) aString_=NullString; else { // Format as 11/15/1992 switch (_locale) { case European: sprintf(buf,"%02d/%02d/%04d",d,m,y); break; case American: sprintf(buf,"%02d/%02d/%04d",m,d,y); break; case Japanese: sprintf(buf,"%04d/%02d/%02d",y,m,d); break; default: MSMessageLog::warningMessage("MSDate: invalid value of order flag\n"); break; } aString_+=buf; } break; case Terse: if (_date==nullDate()) aString_=" - - "; else { // Format as 11-Nov-92 switch (_locale) { case European: sprintf(buf,"%02d-%3.3s-%02d",d,_monthNames[m-1],y%100); break; case American: sprintf(buf,"%02d-%3.3s-%02d",d,_monthNames[m-1],y%100); break; case Japanese: sprintf(buf,"%02d-%3.3s-%02d",y%100,_monthNames[m-1],d); break; default: MSMessageLog::warningMessage("MSDate: invalid value of order flag\n"); break; } aString_+=buf; } break; case Terse4: if (_date==nullDate()) aString_=" - - "; else { // Format as 11-Nov-1992 switch (_locale) { case European: sprintf(buf,"%02d-%3.3s-%04d",d,_monthNames[m-1],y); break; case American: sprintf(buf,"%02d-%3.3s-%04d",d,_monthNames[m-1],y); break; case Japanese: sprintf(buf,"%04d-%3.3s-%02d",y,_monthNames[m-1],d); break; default: MSMessageLog::warningMessage("MSDate: invalid value of order flag\n"); break; } aString_+=buf; } break; case Long: if (_date==nullDate()) aString_=" , "; else { // Format as November 15, 1992 switch (_locale) { case European: sprintf(buf,"%s %d, %4d",_monthNames[m-1],d,y); break; case American: sprintf(buf,"%s %d, %4d",_monthNames[m-1],d,y); break; case Japanese: sprintf(buf,"%4d %s %d",y,_monthNames[m-1],d); break; default: MSMessageLog::warningMessage("MSDate: invalid value of order flag\n"); break; } aString_+=buf; } break; case MonthYear: if (_date==nullDate()) aString_=" "; else { // Format as Nov 92 sprintf(buf,"%3.3s %02d",_monthNames[m-1],y%100); aString_+=buf; } break; case YearMonthDay: if (_date==nullDate()) aString_=" / / "; else { sprintf(buf,"%04d/%02d/%02d",y,m,d); aString_+=buf; } break; case Year2MonthDay: if (_date==nullDate()) aString_=" / / "; else { sprintf(buf,"%02d/%02d/%02d",y%100,m,d); aString_+=buf; } break; case EuropeanDot: if (_date==nullDate()) aString_=" . . "; else { // Format as dd.mm.yy sprintf(buf,"%02d.%02d.%02d",d,m,y%100); aString_+=buf; } break; case EuropeanDot4: if (_date==nullDate()) aString_=" . . "; else { // Format as dd.mm.yyyy sprintf(buf,"%02d.%02d.%04d",d,m,y); aString_+=buf; } break; case Database: if (_date==nullDate()) aString_=NullString; else { // Format as yyyymmdd sprintf(buf,"%04d%02d%02d",y,m,d); aString_+=buf; } break; case Julian: if (_date==nullDate()) aString_=NullString; else { sprintf(buf,"%d",(_date-SEP_14_1752)); aString_+=buf; } break; case Strftime: if (_date==nullDate()) aString_=NullString; else format(aString_,(const char *)strftimeDefaultFormat()); break; default: MSMessageLog::warningMessage("MSDate: invalid value of format\n"); break; } return aString_.string(); } void MSDate::setToday(void) { _date = currentDate(); changed(); } // static member functions // Returns a string name for the weekday number. // Monday == 1, ... , Sunday == 7 // Return 0 for weekday number out of range const char *MSDate::dayName(MSDay d_) { return assertWeekDayNumber(d_)==MSTrue?_weekDayNames[d_-1]:0; } // Return the number, 1-7, of the day of the week named nameOfDay. // Return 0 if name doesn't match. MSDay MSDate::dayOfWeek(const char *d_) { return MSDay(findMatch(d_,_ucWeekDayNames,7)+1); } // Is a day (1-31) within a given month? MSBoolean MSDate::dayWithinMonth(MSMonth month_,MSDay day_,MSYear year_) { if (day_<=0||assertIndexOfMonth(month_)==MSFalse) return MSFalse; unsigned d=_daysInMonth[month_]; if (month_==2&&leapYear(year_)==MSTrue) d++; return MSBoolean(day_<=d); } MSDay MSDate::daysInMonth(MSMonth month_,MSYear year_) { if (assertIndexOfMonth(month_)==MSFalse) return 0; return (month_==2&&leapYear(year_)==MSTrue)?_daysInMonth[month_]+1:_daysInMonth[month_]; } MSDay MSDate::daysInYear(MSYear year_) { return leapYear(year_)==MSTrue?366:365; } // Returns the number, 1-12, of the month named nameOfMonth. // Return 0 for no match. MSMonth MSDate::indexOfMonth(const char *c_) { return MSMonth(findMatch(c_,_ucMonthNames,12)+1); } // Convert Gregorian calendar date to the corresponding Julian day // number. Algorithm 199 from Communications of the ACM, Volume 6, No. // 8, (Aug. 1963), p. 444. Gregorian calendar started on Sep. 14, 1752. // This function not valid before that. // Returns 0 if the date is invalid. MSJulian MSDate::asJulianNumber(MSMonth month_,MSDay day_,MSYear year_) { unsigned long c,ya; if (year_<=99) year_+=year_<=MS_PIVOT_YEAR?2000:1900; if (dayWithinMonth(month_,day_,year_)==MSFalse) return MSJulian(0); if (month_>2) month_-=3; else { month_+=9; year_--; } c=year_/100; ya=year_-100*c; return ((146097*c)>>2)+((1461*ya)>>2)+(153*month_+2)/5+day_+1721119; } // Algorithm from K & R, "The C Programming Language", 1st ed. MSBoolean MSDate::leapYear(MSYear y_) { return MSBoolean((y_&3)==0&&y_%100!=0||y_%400==0); } // Returns a string name for the month number. // Return 0 if invalid month number. const char *MSDate::monthName(MSMonth m_) { return assertIndexOfMonth(m_)==MSTrue?_monthNames[m_-1]:0; } // Algorithm from "Standard Security Calculation Methods // by Spence, Graudenz, and Lynch (SIA) Forward is dated April 19, 1973 int MSDate::dcb30_360(const MSDate& d1_,const MSDate& d2_) { MSDate dt1=d1_,dt2=d2_; MSMonth Tm1,Tm2; MSDay Td1,Td2; MSYear Ty1,Ty2; int m1,m2,d1,d2,y1,y2; int result; // order the dates long compareResult=::compare(d1_,d2_); if (compareResult>0) { dt1=d2_; dt2=d1_; } else if (compareResult==0) return 0; // format m, d, y and convert to signed ints dt1.asMonthDayYear(Tm1,Td1,Ty1); m1=Tm1; d1=Td1; y1=Ty1; dt2.asMonthDayYear(Tm2,Td2,Ty2); m2=Tm2; d2=Td2; y2=Ty2; // The algorithm is... if (d1==31) d1=30; if (d2==31&&(d1==30||d1==31)) d2=30; result=(y2-y1)*360+(m2-m1)*30+(d2-d1); return result; } // Return index of case-insensitive match; -1 if no match. int MSDate::findMatch(const char *str_,const char **candidates_,int icand_) { unsigned len=strlen(str_); #if !defined(MS_HAS_STRNICMP) register unsigned N=len; register char *up; char *p=up=new char[len+1]; while(N--) {*up++=islower(*str_)?toupper(*str_):*str_;str_++;} *up='\0'; while(icand_--) { if (strncmp(p,candidates_[icand_],len)==0) break; } delete [] p; #else while(icand_--) { if (strnicmp(str_,candidates_[icand_],len)==0) break; } #endif return icand_; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Member Functions //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MSJulian MSDate::date(void) const { return _date; } MSBoolean MSDate::between(const MSDate& d1_,const MSDate& d2_) const { return MSBoolean(_date>=d1_._date&&_date<=d2_._date); } MSDay MSDate::dayOfYear(void) const { return _date-asJulianNumber(12,31,year()-1); } // Returns the day of the month of this MSDate. MSDay MSDate::dayOfMonth(void) const { MSMonth m; MSDay d; MSYear y; asMonthDayYear(m,d,y); return d; } MSDay MSDate::daysInMonth(void) const { MSMonth m; MSDay d; MSYear y; asMonthDayYear(m,d,y); return daysInMonth(m,y); } MSDay MSDate::daysInYear(void) const { MSMonth m; MSDay d; MSYear y; asMonthDayYear(m,d,y); return leapYear(y)==MSTrue?366:365; } unsigned MSDate::weekOfYear(void) const { return (dayOfYear()/7)+1; } // Return the number of the first day of a given month // Return 0 if "month" is outside of the range 1 through 12, inclusive. MSDay MSDate::firstDayOfMonth(void) const { return firstDayOfMonth(month()); } MSDay MSDate::firstDayOfMonth(MSMonth month) const { if (assertIndexOfMonth(month)==MSFalse) return 0; unsigned firstDay=_firstDayOfEachMonth[month]; if (month>2&&leap()==MSTrue)firstDay++; return firstDay; } void MSDate::setFirstDayOfMonth(void) { MSMonth m; MSDay d; MSYear y; asMonthDayYear(m,d,y); _date-=(d-1); changed(); } // Return the number of the last day of a given month by // looking up the first day of the next month and subtracting // 1 from it. // Return 0 if "month" is outside of the range 1 through 12, inclusive. MSDay MSDate::lastDayOfMonth(void) const { return lastDayOfMonth(month()); } MSDay MSDate::lastDayOfMonth(MSMonth month_) const { MSDay answer; if (month_==12) return leap()==MSTrue?MSDay(366):MSDay(365); else answer=firstDayOfMonth(month_+1); return answer?answer-1:0; } void MSDate::setLastDayOfMonth(void) { MSMonth m; MSDay d; MSYear y; asMonthDayYear(m,d,y); _date+=((leapYear(y)==MSTrue)&&(m==2))?29-d:_daysInMonth[m]-d; changed(); } MSBoolean MSDate::isValid(void) const { return MSBoolean(_date>0); } MSBoolean MSDate::isLeapYear(void) const { return leapYear(year()); } MSBoolean MSDate::leap(void) const { return leapYear(year()); } const char* MSDate::nameOfDay(void) const { return dayName(weekDay());} const char* MSDate::nameOfMonth(void) const { return monthName(month());} MSDate MSDate::min(const MSDate& d_) const { return d_._date<_date?d_:*this; } MSDate MSDate::max(const MSDate& d_) const { return d_._date>_date?d_:*this; } // Returns the month of this MSDate. MSMonth MSDate::month() const { MSMonth m; MSDay d; MSYear y; asMonthDayYear(m,d,y); return m; } MSDate MSDate::previous(const char *dayName) const { return previous(dayOfWeek(dayName)); } MSDate MSDate::previous(MSDay desiredDayOfWeek_) const { // Renumber the desired and current day of week to start at 0 (Monday) // and end at 6 (Sunday). desiredDayOfWeek_--; MSDay thisDayOfWeek=weekDay()-1; MSJulian j=_date; // Have to determine how many days difference from current day back to // desired, if any. Special calculation under the 'if' statement to // effect the wraparound counting from Monday (0) back to Sunday (6). if (desiredDayOfWeek_>thisDayOfWeek) thisDayOfWeek+=7-desiredDayOfWeek_; else thisDayOfWeek-=desiredDayOfWeek_; j-=thisDayOfWeek; // Adjust j to set it at desired day of week. return MSDate(j); } MSDay MSDate::weekDay(void) const { return ((((_date+1)%7)+6)%7)+1; } // Returns the year of this MSDate. MSYear MSDate::year(void) const { MSMonth m; MSDay d; MSYear y; asMonthDayYear(m,d,y); return y; } // Convert a Julian day number to its corresponding Gregorian calendar // date. Algorithm 199 from Communications of the ACM, Volume 6, No. 8, // (Aug. 1963), p. 444. Gregorian calendar started on Sep. 14, 1752. // This function not valid before that. void MSDate::asMonthDayYear(MSMonth& month_,MSDay& day_,MSYear& year_) const { unsigned long d; MSJulian j=_date-1721119; year_=(MSYear) (((j<<2)-1)/146097); j=(j<<2)-1-146097*year_; d=(j>>2); j=((d<<2)+3)/1461; d=(d<<2)+3-1461*j; d=(d+4)>>2; month_=(MSMonth)(5*d-3)/153; d=5*d-3-153*month_; day_=(MSDay)((d+5)/5); year_=(MSYear)(100*year_+j); if (month_<10) month_+=3; else { month_-=9; year_++; } } void MSDate::nextWeekday(void) { switch (weekDay()) { case Saturday: _date+=2; changed(); break; case Sunday: _date++; changed(); break; default: break; } } void MSDate::prevWeekday(void) { switch (weekDay()) { case Saturday: _date--; changed(); break; case Sunday: _date-=2; changed(); break; default: break; } } MSBoolean MSDate::isWeekday(void) const { MSBoolean rc; switch (weekDay()) { case Monday: case Tuesday: case Wednesday: case Thursday: case Friday: rc=MSTrue; break; case Saturday: case Sunday: rc=MSFalse; break; default: rc=MSFalse; break; } return rc; } MSBoolean MSDate::isWeekend(void) const { MSBoolean rc; switch (weekDay()) { case Monday: case Tuesday: case Wednesday: case Thursday: case Friday: rc=MSFalse; break; case Saturday: case Sunday: rc=MSTrue; break; default: rc=MSFalse; break; } return rc; } // This is the tricky part. Adding a term to a date. // NormalizeAndSet is an internal function to // set the date to the given month, day, and year, forcing it to // be the last day of the month if lastOfMonth is MSTrue. Day must be // 1-31, and lastOfMonth must be true if day is 31. Month may be negative. void MSDate::normalizeAndSet(int m_, int d_,int y_,int lastOfMonth_) { // normalize month if (m_>12) { m_-=1; y_+=m_/12; m_%=12; m_+=1; } else if (m_<1) { // must be careful because (-14/-12) can be -1 or -2, // and (-14%-12) can be -2 or 10. Let's keep everything positive. int yearsBack=((-m_)/12)+1; m_+=yearsBack*12; y_-=yearsBack; } // Now fix up the day of the month. // If the start date was the end of the month, the end date is the // end of the month. Otherwise, if the start date was not the end // of the month, but its day of month is illegal in the end month // (which can only happen if the end month is Feb.), set the end date // to the end of the month if (lastOfMonth_) d_=(m_==2)&&(leapYear(y_)==MSTrue)?29:_daysInMonth[m_]; else if ((d_>28)&&(m_==2)) d_=leapYear(y_)==MSTrue?29:28; _date=asJulianNumber(m_,d_,y_); changed(); } MSDate& MSDate::operator+=(const MSTerm& t_) { if ((t_.years()!=0)||(t_.months()!=0)) { int m; int d; int y; MSMonth mT; MSDay dT; MSYear yT; asMonthDayYear(mT,dT,yT); m=int(mT); d=int(dT); y=int(yT); int wasLastOfMonth=(((m==2)&&leapYear(y))?d==29:d==_daysInMonth[m]); y+=t_.years(); m+=t_.months(); normalizeAndSet(m,d,y,wasLastOfMonth); } // now add in the number of days in term _date+=t_.days(); changed(); return *this; } MSDate& MSDate::operator-=(const MSTerm& t_) { if ((t_.years() != 0) || (t_.months() != 0)) { int m; int d; int y; MSMonth mT; MSDay dT; MSYear yT; asMonthDayYear(mT,dT,yT); m=int(mT); d=int(dT); y=int(yT); int wasLastOfMonth=(((m==2)&&(leapYear(y)==MSTrue))?d==29:d==_daysInMonth[m]); y-=t_.years(); m-=t_.months(); normalizeAndSet(m,d,y,wasLastOfMonth); } // now subtract out the number of days in term _date-=t_.days(); changed(); return *this; } // Special private constructors. They allow us to take advantage of the // return value optimization (RV0). See section 12.1c of the ARM. MSDate::MSDate(const MSDate& date_,const MSTerm& term_,MSDate::Operator operator_) { _date=date_._date; switch(operator_) { case Plus: *this+=term_; break; case Minus: *this-=term_; break; default: break; } } MSDate::MSDate(const MSDate& date_,const MSNormalizedYears& ny_,MSDate::Operator operator_) { _date=date_._date; switch(operator_) { case Plus: _date+=ny_.days(); break; case Minus: _date-=ny_.days(); break; default: break; } } int MSDate::operator-(const MSDate& d_) const { return int(long(_date)-long(d_._date)); } MSDate MSDate::operator+(const MSTerm& term_) const { return MSDate(*this,term_,MSDate::Plus); } MSDate MSDate::operator+(const MSNormalizedYears& ny_) const { return MSDate(*this,ny_,MSDate::Plus); } MSDate MSDate::operator-(const MSTerm& term_) const { return MSDate(*this,term_,MSDate::Minus); } MSDate MSDate::operator-(const MSNormalizedYears& ny_) const { return MSDate(*this,ny_,MSDate::Minus); } MSDate MSDate::operator+(int d_) const { return MSDate(_date+d_); } MSDate MSDate::operator-(int d_) const { return MSDate(_date-d_); } MSDate& MSDate::operator+=(int d_) { _date+=d_; changed(); return *this; } MSDate& MSDate::operator-=(int d_) { _date-=d_; changed(); return *this; } MSDate& MSDate::operator+=(const MSNormalizedYears& ny_) { *this+=ny_.days(); return *this; } MSDate& MSDate::operator-=(const MSNormalizedYears& ny_) { *this-=ny_.days(); return *this; } MSDate operator+(int i_,const MSDate& d_) { return d_+i_; } MSDate operator+(const MSTerm& t_,const MSDate& d_) { return d_+t_; } MSDate operator+(const MSNormalizedYears& y_,const MSDate& d_) { return d_+y_.days(); } ostream& operator<<(ostream& aStream_,const MSDate& aDate_) { MSString s; return aStream_<>(istream& aStream_,MSDate& aDate_) { MSString aString; aStream_>>aString; aDate_.set(aString); return aStream_; } MSBoolean MSDate::isSet() const { return _date==nullDate()?MSFalse:MSTrue; } MSDate::MSDateLocale MSDate::initLocale(void) { char *cp=getenv("LC_TIME"); if (cp) { if (strcmp(cp,"japanese")==0) return MSDate::Japanese; else if (strcmp(cp,"european")==0) return MSDate::European; else return MSDate::American; } else { return MSDate::American; } } MSDate::MSDateLocale MSDate::_locale=MSDate::initLocale(); MSJulian MSDate::_override=0; int MSDate::_useOverride=MSFalse; int MSDate::_firstTime=MSTrue; MSJulian MSDate::currentDate(void) { if (_firstTime) { _firstTime=MSFalse; char *cp=getenv("TB_DATE_OVERRIDE"); if (cp) { MSDate d; if (d.set(cp)==MSError::MSSuccess) { _override=d._date; _useOverride=MSTrue; } else { MSMessageLog::errorMessage("MSDate: TB_DATE_OVERRIDE contains an invalid date\n"); MSMessageLog::errorMessage("MSDate: ignoring attempt to override\n"); _useOverride=MSFalse; } } else { _useOverride=MSFalse; } } if (_useOverride) { return _override; } else { #ifdef MS_THREAD_SAFE_FUNCTIONS struct tm tms; #endif //MS_THREAD_SAFE_FUNCTIONS time_t clk=time(0); struct tm *now=MS_LOCALTIME(&clk,&tms); return asJulianNumber(now->tm_mon+1,now->tm_mday,now->tm_year+1900); } } // converts this MSDate to GMT calendar time - time in seconds // since 00:00:00 January 1, 1970, with a correction for the time // zone. The time is set to midnight of this date. time_t MSDate::asCalendarTime(MSTime::MSTimeZone zone_) const { time_t rc=-1; if (date()!=nullDate()) { struct tm aTimeStruct={0}; MSMonth m; MSDay d; MSYear y; asMonthDayYear(m,d,y); aTimeStruct.tm_mday=d; aTimeStruct.tm_mon=m-1; //Do not substruct 1900 from the year as greenwichMeanTime will add it //back on anyway if the year is smaller than 100. Otherwise it will do //nothing which is good. aTimeStruct.tm_year=y; aTimeStruct.tm_isdst=-1; // tm_wday and tm_yday fields are ignored rc = MSTime::greenwichMeanTime(&aTimeStruct, zone_); } return rc; } MSDate::MSDateLocale MSDate::locale(void) { return _locale; } void MSDate::locale(MSDate::MSDateLocale locale_) { _locale=locale_; } aplus-fsf-4.22/src/MSTypes/MSDateVector.C0000644000265000001440000000374410772770444013601 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #if defined(MSTK_MANUAL_INSTANTIATION) #include #if defined(MS_XLC_TEMPLATE_INSTANTIATION) #pragma define (MSTypeVector) #endif #if defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma instantiate MSBaseVector > #pragma instantiate MSObjectVector #pragma instantiate MSTypeVector #if !defined(MS_TEMPLATE_MANUAL_FRIEND_BUG) // The version of EDG used by SGI's dcc compiler has a bug related to access from friends #pragma instantiate ostream & operator<< (ostream &, const MSBaseVector > &) #endif //MS_TEMPLATE_MANUAL_FRIEND_BUG #endif //MS_EDG_TEMPLATE_INSTANTIATION #if defined(MS_VC_TEMPLATE_INSTANTIATION) template MSBaseVector >; template MSBaseVectorOps >; template MSObjectVector; template MSVectorElement; template MSTypeVector; // instantiate non-inline friend template functions static int __dummy01__() { if (0) operator<<(cout, MSBaseVector >()); return 0; } static int __dummyInt01__=__dummy01__(); #endif // MS_VC_TEMPLATE_INSTANTIATION #if defined(MS_STD_TEMPLATE_INSTANTIATION) template class MSBaseVector >; template class MSBaseVectorOps >; template class MSObjectVector; template class MSVectorElement; template class MSTypeVector; template ostream& operator<<(ostream&,const MSBaseVector >&); #endif // MS_STD_TEMPLATE_INSTANTIATION #endif // MSTK_MANUAL_INSTANTIATION aplus-fsf-4.22/src/MSTypes/MSError.C0000644000265000001440000000065610772770444012631 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include // varargs #include int MSError::error(MSError::ErrorStatus,const char *,const char *, ...) { return 0;} aplus-fsf-4.22/src/MSTypes/MSEvent.C0000644000265000001440000000052710772770444012616 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include MSEvent::~MSEvent(void) {} aplus-fsf-4.22/src/MSTypes/MSEventBlocker.C0000644000265000001440000000115110772770444014112 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include MSEventBlocker::MSEventBlocker(MSEventSender *sender_,MSBoolean sendEvent_) : _sender(sender_),_sendEvent(sendEvent_) { if (_sender!=0) _sender->blockEvents(); } MSEventBlocker::~MSEventBlocker(void) { if (_sender!=0) _sender->unblockEvents(_sendEvent); } aplus-fsf-4.22/src/MSTypes/MSEventReceiver.C0000644000265000001440000000411010772770444014273 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include MSEventReceiver::~MSEventReceiver(void) { if (senderList()!=0) { Node *np=senderList(); Node *tp; MSEventSender *sndr; _senderList=0; // prevent removeReceiver from calling removeSender and // deleting the node twice - also this prevents a search // of the list should removeSender get called while (np!=0) { tp=np->next(); sndr=np->sender(); delete np; sndr->removeReceiver(this); removeSenderNotify(sndr); np=tp; } } } void MSEventReceiver::receiveEvent(MSEvent&) {} // this allows subclasses to get notified of the add or remove void MSEventReceiver::addSenderNotify(MSEventSender *) {} void MSEventReceiver::removeSenderNotify(MSEventSender *) {} MSBoolean MSEventReceiver::addSender(MSEventSender *pSender_) { if (pSender_!=0) { if (senderList()!=0) { Node *next=0; Node *np=senderList(); for (;np!=0;np=np->next()) { if (np->sender()==pSender_) return MSFalse; else next=np; } next->next(new Node(pSender_)); } else _senderList=new Node(pSender_); pSender_->addReceiver(this); addSenderNotify(pSender_); return MSTrue; } return MSFalse; } MSBoolean MSEventReceiver::removeSender(MSEventSender *pSender_) { if (pSender_!=0) { Node *np=senderList(); Node *pp=np; for (;np!=0;pp=np,np=np->next()) { if (np->sender()==pSender_) { pp->next(np->next()); if (np==senderList()) _senderList=pp->next(); delete np; pSender_->removeReceiver(this); removeSenderNotify(pSender_); return MSTrue; } } } return MSFalse; } aplus-fsf-4.22/src/MSTypes/MSEventSender.C0000644000265000001440000001061010772770445013752 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include MSEventSender::~MSEventSender(void) { removeAllReceivers(); } void MSEventSender::removeAllReceivers(void) { if (_pReceiverList!=0) { List *pList=_pReceiverList; unsigned n=pList->_allocated; MSEventReceiver *pReceiver; // prevent removeSender from calling removeReceiver and // deleting the pReceiver twice - also this prevents a search // of the list should removeReceiver get called _pReceiverList=0; for (unsigned i=0;i_array[i]; if (pReceiver!=0) { pList->_array[i]=0; pReceiver->removeSender(this); } } delete pList; _pReceiverList=0; } } MSBoolean MSEventSender::addReceiver(MSEventReceiver *pReceiver_) { if (pReceiver_!=0) { // special case for first time if (_pReceiverList==0) { _pReceiverList=new (1) List; _pReceiverList->_allocated=1; _pReceiverList->_array[0]=pReceiver_; pReceiver_->addSender(this); // return MSTrue; } else { // check for open slot List *pList=_pReceiverList; unsigned i,n=pList->_allocated; unsigned j=n; for (i=0;i_array[i]==pReceiver_) return MSTrue; else if (j==n&&pList->_array[i]==0) j=i; } if (j!=n) { pList->_array[j]=pReceiver_; pReceiver_->addSender(this); // return MSTrue; } else { // need a new slot unsigned newSize=n+1; List *pNewList=new (newSize) List; pNewList->_allocated=newSize; for (i=0;i_array[i]=pList->_array[i]; pNewList->_array[n]=pReceiver_; delete pList; _pReceiverList=pNewList; pReceiver_->addSender(this); // return MSTrue; } } addReceiverNotify(pReceiver_); return MSTrue; } return MSFalse; } // this method must insure that the _receiverList, which is a special // type of Node (HeadNode) is preserved. if the receiver to be // removed is stored in this node, then we delete the next node // and move its contents into the _receiverList node MSBoolean MSEventSender::removeReceiver(MSEventReceiver *pReceiver_) { if (_pReceiverList!=0&&pReceiver_!=0) { List *pList=_pReceiverList; unsigned n=pList->_allocated; for (unsigned i=0;i_array[i]==pReceiver_) { pList->_array[i]=0; pReceiver_->removeSender(this); removeReceiverNotify(pReceiver_); return MSTrue; } } } return MSFalse; } // virtual classes called respectively from addReceiver() (after the receiver has been added) // and from removeReceiver() (after the receiver has been removed), to provide notification // mechanism for subclasses void MSEventSender::addReceiverNotify(MSEventReceiver *) {} void MSEventSender::removeReceiverNotify(MSEventReceiver *) {} unsigned MSEventSender::numReceivers() const { unsigned count=0; if (_pReceiverList) { List *pList=_pReceiverList; unsigned n=pList->_allocated; for (unsigned i=0;i_array[i]) ++count; } return count; } void MSEventSender::blockEvents(void) { if (_pReceiverList!=0) _pReceiverList->_blockCount++; } void MSEventSender::unblockEvents(MSBoolean sendEvent_) { if (_pReceiverList!=0&&_pReceiverList->_blockCount>0) { _pReceiverList->_blockCount--; if (sendEvent_==MSTrue&&_pReceiverList->_blockCount==0) { MSNullEvent aEvent; sendEvent(aEvent); } } } void MSEventSender::sendEvent(MSEvent& aEvent_) { if (_pReceiverList!=0) { if (_pReceiverList->_blockCount==0) { unsigned n=_pReceiverList->_allocated; MSEventSender *lastSender=aEvent_.sender(); aEvent_.sender(this); for (unsigned i=0;i_array[i]!=0) _pReceiverList->_array[i]->receiveEvent(aEvent_); } aEvent_.sender(lastSender); } } } void *MSEventSender::List::operator new(size_t,unsigned realSize_) { return ::new char[sizeof(unsigned)+sizeof(unsigned)+(sizeof(MSEventReceiver *)*realSize_)]; } void MSEventSender::List::operator delete(void *pData_) { ::delete [](char*)pData_; } aplus-fsf-4.22/src/MSTypes/MSException.C0000644000265000001440000000245110772770445013472 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include // // MSException // MSException::~MSException() {} const char* MSException::what() const { return ""; } // // MSException error // MSExceptionError& MSExceptionError::operator=(const MSExceptionError& anError_) { if(this!=&anError_) { if(_pMessage!=0) { delete [] _pMessage; _pMessage=0; } init(anError_._pMessage); } return *this; } MSExceptionError::~MSExceptionError() { if(_pMessage) delete [] _pMessage; } void MSExceptionError::init(const char* pMessage_) { if(pMessage_ != 0) { _pMessage=new char[strlen(pMessage_)+1]; strcpy(_pMessage,pMessage_); } } const char* MSExceptionError::what() const { return _pMessage; } // MStk exceptions MSOutOfMemory::MSOutOfMemory(const char * what_) : MSExceptionError(what_) {} MSOutOfMemory::~MSOutOfMemory() {} MSCollectionError::MSCollectionError(const char * what_) : MSExceptionError(what_) {} MSCollectionError::~MSCollectionError() {} aplus-fsf-4.22/src/MSTypes/MSFloat.C0000644000265000001440000005723310772770445012611 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #if HAVE_IOSTREAM #include #else #include #endif #include #include #include #include #include #include #include #include // MSRealMaximumLength specifies the maximum length (in characters) of the // decimal part of a string representation of double. We use this as a // shortcut during parsing. DBL_DIG defined in float.h specifies the maximum // *total* number of digits in a double. The longest decimal part is in the // exponential format: e.g., 1.79769313486232e+308. Thus, we need to subtract // 1 from DBL_DIG to exclude the digit *before* the decimal (there can be only // one digit before the decimal point in the exponential format) and add 5 to // include the exponent part, which is at most 5 characters long. Thus, in // total we need to add -1+5=4 to get MSRealMaximumLength. // const int MSRealMaximumLength=DBL_DIG+4; const double MSFloatDelta=0.00000000000001; // for comparison of doubles ostream& operator<<(ostream& aStream_,const MSFloat& aFloat_) { return aStream_<>(istream& aStream_,MSFloat& aFloat_) { double d; aStream_>>d; aFloat_=d; return aStream_; } #ifdef MS_NO_INLINES #include #endif MSFloat::~MSFloat(void) {} MSString MSFloat::asString(void) const { return MSString(_real); } MSString MSFloat::asDebugInfo(void) const { MSString result("MSFloat(@"); result+=MSString((unsigned long)this).d2x().lowerCase(); result+=",_real="; result+=MSString(_real); result+=",_isSet="; result+=(isSet()==MSTrue)?"MSTrue":"MSFalse"; result+=",_isValid="; result+=(isValid()==MSTrue)?"MSTrue":"MSFalse"; result+=",_type="; result+=type().symbolName(); result+=")"; return MSString(result); } MSString MSFloat::className(void) const { return MSString("MSFloat"); } const MSSymbol& MSFloat::type(void) const { return symbol(); } MSModel *MSFloat::clone(void) const { return new MSFloat(*this); } MSModel *MSFloat::create(void) const { return new MSFloat(); } void MSFloat::assign(const MSModel& aModel_) { *this=(MSFloat&)aModel_; } long MSFloat::compare(const MSModel& aModel_) const { return ::compare(*this,(MSFloat&)aModel_); } MSString MSFloat::asMSF(void) const { MSString aString; if (isSet()==MSTrue) (void)formatReal(aString,MSFloat::MaximumPrecision,MSFormat::NoModifier,_real); return aString; } MSError::ErrorStatus MSFloat::setFromMSF(const char *pString_) { int code; if (pString_!=0) code=set(pString_); else code=MSError::BadMSFString; return (MSError::ErrorStatus)code; } const MSSymbol& MSFloat::symbol(void) { static MSSymbol sym ("MSFloat"); return sym; } MSError::ErrorStatus MSFloat::internalSet(const char *pString_) { char *np,buf[512]; _real=0.0; _flags=MSFloat::Set; // clear the Valid bit, i.e. isValid==MSFalse if (*pString_=='\0') { _real=0.0; setToValid(); return (MSError::MSSuccess); } else if (strncmp(pString_,"NaN",3)==0) { _real=0.0; return (MSError::MSSuccess); } else if ((np=strchr(pString_,'.'))&&(strchr(++np,'.'))) { return (MSError::BadReal); } // Disallow more than one decimal point else if ((np=strchr(pString_,'.'))&&(strchr(++np,','))) { return (MSError::BadReal); } // Disallow commas after the decimal point else if (*pString_==',') { return (MSError::BadReal); } // Disallow leading commas // Make sure we don't save too many characters after the decimal char *decimal=strchr(pString_,'.'); if ((decimal!=0)&&(strlen(decimal+1)>MSRealMaximumLength)) { return (MSError::IntTooBig); } strcpy(buf,pString_); // Check for bad (alpha) characters -- the letter "e" is ok for (char *cp1=buf; *cp1!='\0'; cp1++) { if (isalpha(*cp1)) switch (*cp1) { case 'e': case 'E': break; default: return (MSError::BadReal); } } // If there are commas,make sure they are correctly spaced if (strchr(buf,',')!=NULL) { int i; char *cp2; // Find the end of the units part of the number if ((cp2=strchr(buf,'.'))==NULL) { cp2=buf; cp2+=strlen(buf); } // no decimal point, go for the end of the string for (i=0; cp2>buf; cp2--,i++) { if (*cp2==','&&i%4!=0) return (MSError::BadReal); } } // Remove the commas and parse it MSUtil::remove(buf,','); // Looks OK after preliminary checks-now let's parse it int units,numerator,denominator; if (sscanf(buf,"%d %d/%d",&units,&numerator,&denominator)==3) { if (denominator>0) { if (units<0) // if number is negative, we need to subtract fractional part { _real=units-double(numerator)/double(denominator); } else // if the number is non-negative, we need to add fractional part { _real=units+double(numerator)/double(denominator); } } else { return (MSError::BadReal); } } else if (sscanf(buf,"%d/%d",&numerator,&denominator)==2) { if (denominator>0) _real=double(numerator)/double(denominator); else return (MSError::BadReal); } else _real=atof(buf); if (finite(_real)>0) setToValid(); return (MSError::MSSuccess); } void MSFloat::unset(void) { if (isSet()==MSTrue) { _real=0.0; _flags=MSFloat::Valid; // clear the set bit changed(); } } MSError::ErrorStatus MSFloat::set(const char *pString_) { MSError::ErrorStatus status=internalSet(pString_); return changed(),status; } MSFloat& MSFloat::operator=(const MSFloat& aFloat_) { if (this!=&aFloat_) { _real=aFloat_._real; _flags=aFloat_._flags; changed(); } return *this; } MSError::ErrorStatus MSFloat::set(double d) { _real=d; _flags=MSFloat::Set; // clean the valid bit if (finite(_real)>0) setToValid(); return changed(),(MSError::MSSuccess); } MSError::ErrorStatus MSFloat::set(const MSString *pString_) { return MSFloat::set(pString_->string()); } MSError::ErrorStatus MSFloat::set(const MSString& aString_) { return MSFloat::set(aString_.string()); } const char *MSFloat::format(MSString *pString_) const { return formatReal(*pString_,Decimal2,MSFormat::NoModifier,_real); } const char *MSFloat::format(MSString& aString_) const { return format(&aString_); } MSBoolean MSFloat::operator==(double d_) const { d_-=_real; return MSBoolean(d_0) { setToValid(); } else { setToInValid(); } changed(); } return *this; } MSFloat& MSFloat::operator+=(int i_) { if (isSet()==MSTrue) { _real+=i_; if (finite(_real)>0) { setToValid(); } else { setToInValid(); } changed(); } return *this; } MSFloat& MSFloat::operator-=(double r_) { if (isSet()==MSTrue) { _real-=r_; if (finite(_real)>0) { setToValid(); } else { setToInValid(); } changed(); } return *this; } MSFloat& MSFloat::operator-=(int i_) { if (isSet()==MSTrue) { _real-=i_; if (finite(_real)>0) { setToValid(); } else { setToInValid(); } changed(); } return *this; } MSFloat& MSFloat::operator*=(double r_) { if (isSet()==MSTrue) { _real*=r_; if (finite(_real)>0) { setToValid(); } else { setToInValid(); } changed(); } return *this; } MSFloat& MSFloat::operator*=(int i_) { if (isSet()==MSTrue) { _real*=i_; if (finite(_real)>0) { setToValid(); } else { setToInValid(); } changed(); } return *this; } MSFloat& MSFloat::operator/=(double r_) { if (isSet()==MSTrue) { _real/=r_; if (finite(_real)>0) { setToValid(); } else { setToInValid(); } changed(); } return *this; } MSFloat& MSFloat::operator/=(int i_) { if (isSet()==MSTrue) { _real/=i_; if (finite(_real)>0) { setToValid(); } else { setToInValid(); } changed(); } return *this; } MSFloat& MSFloat::operator+=(const MSFloat& aFloat_) { _flags &= aFloat_._flags; // combine _flags with aFloat_._flags by ANDing them together; // the result will be valid and/or set only if *both* numbers are // valid and/or set, respectively _real+=aFloat_._real; if (isValid()==MSTrue) { if (finite(_real)<=0) { setToInValid(); } } // // We could have optimized this method for calls to changed() by providing a more // rigorous checking of the original state of both numbers. For example, if "this" number // is *not* set originally, then we don't do anything to it and it stays unset; thus, we // don't need to call changed(). However, doing this proper testing of the valid and set // states requires additional bit extractions and comparisons. Thus, we optimize for the // most common case - that is, when both numbers are set and valid, which probably accounts // for a good 99% of all situations - at the expense of some very rare cases, when "this" // number is either unset or invalid. // return changed(), *this; } MSFloat& MSFloat::operator+=(const MSInt& aInt_) { // we are clearing the Valid bit and setting the Set bit to AND of Set state and // aInt's Set state // _flags &= (aInt_.isSet()==MSTrue) ? Set : 0; _real+=int(aInt_); if (finite(_real)>0) { setToValid(); } return changed(),*this; } MSFloat& MSFloat::operator*=(const MSFloat& aFloat_) { _flags &= aFloat_._flags; // combine _flags with aFloat_._flags by ANDing them together; // the result will be valid and/or set only if *both* numbers are // valid and/or set, respectively _real*=aFloat_._real; if (isValid()==MSTrue) { if (finite(_real)<=0) { setToInValid(); } } return changed(), *this; } MSFloat& MSFloat::operator*=(const MSInt& aInt_) { _real*=int(aInt_); _flags &= (aInt_.isSet()==MSTrue) ? Set : 0; if (finite(_real)>0) { setToValid(); } return changed(),*this; } MSFloat& MSFloat::operator-=(const MSFloat& aFloat_) { _flags &= aFloat_._flags; // combine _flags with aFloat_._flags by ANDing them together; // the result will be valid and/or set only if *both* numbers are // valid and/or set, respectively _real-=aFloat_._real; if (isValid()==MSTrue) { if (finite(_real)<=0) { setToInValid(); } } return changed(), *this; } MSFloat& MSFloat::operator-=(const MSInt& aInt_) { _real-=int(aInt_); _flags &= (aInt_.isSet()==MSTrue) ? Set : 0; if (finite(_real)>0) { setToValid(); } return changed(),*this; } MSFloat& MSFloat::operator/=(const MSFloat& aFloat_) { _flags &= aFloat_._flags; // combine _flags with aFloat_._flags by ANDing them together; // the result will be valid and/or set only if *both* numbers are // valid and/or set, respectively _real/=aFloat_._real; if (isValid()==MSTrue) { if (finite(_real)<=0) { setToInValid(); } } return changed(), *this; } MSFloat& MSFloat::operator/=(const MSInt& aInt_) { _real/=int(aInt_); _flags &= (aInt_.isSet()==MSTrue) ? Set : 0; if (finite(_real)>0) { setToValid(); } return changed(),*this; } // this code takes advantage of the return value optimization (RVO) // discussed in section 12.1c of the ARM MSFloat::MSFloat(const MSFloat& a_,const MSFloat& b_,MSFloat::FloatOperator operator_) : _flags(a_._flags&b_._flags) { if (isSet()==MSTrue) { switch (operator_) { case Plus: _real=a_._real+b_._real; break; case Minus: _real=a_._real-b_._real; break; case Multiply: _real=a_._real*b_._real; break; case Divide: _real=a_._real/b_._real; break; } if (isValid()==MSTrue) // if both a_ and b_ are valid, check if the result is valid { if (finite(_real)<=0) { setToInValid(); } } } else { _real=0.0; } } MSFloat::MSFloat(const MSFloat& a_,const MSInt& b_,MSFloat::FloatOperator operator_) { _flags = a_._flags & ((b_.isSet()==MSTrue) ? Set : 0); // set _flags to AND of the set states of a_ and b_ if (isSet()==MSTrue) { switch (operator_) { case Plus: _real=a_._real+(double)b_; break; case Minus: _real=a_._real-(double)b_; break; case Multiply: _real=a_._real*(double)b_; break; case Divide: _real=a_._real/(double)b_; break; } if (a_.isValid()==MSTrue) // if a_ is valid (and we know that b_ is always valid), check if result is valid { if (finite(_real)>0) { setToValid(); } } } else { _real=0.0; } } MSFloat::MSFloat(const MSInt& a_,const MSFloat& b_,MSFloat::FloatOperator operator_) { _flags = ((a_.isSet()==MSTrue) ? Set : 0) & b_._flags; // set _flags to AND of the set states of a_ and b_ if (isSet()==MSTrue) { switch (operator_) { case Plus: _real=(double)a_+b_._real; break; case Minus: _real=(double)a_-b_._real; break; case Multiply: _real=(double)a_*b_._real; break; case Divide: _real=(double)a_/b_._real; break; } if (b_.isValid()==MSTrue) // if b_ is valid (and we know that a_ is always valid), check if result is valid { if (finite(_real)>0) { setToValid(); } } } else { _real=0.0; } } MSFloat::MSFloat(const MSFloat& a_,double b_,MSFloat::FloatOperator operator_) : _flags(a_._flags) { if (isSet()==MSTrue) { switch (operator_) { case Plus: _real=a_._real+b_; break; case Minus: _real=a_._real-b_; break; case Multiply: _real=a_._real*b_; break; case Divide: _real=a_._real/b_; break; } if (isValid()==MSTrue) { if (finite(_real)<=0) { setToInValid(); } } } else { _real=0.0; } } MSFloat::MSFloat(double a_,const MSFloat& b_,MSFloat::FloatOperator operator_) : _flags(b_._flags) { if (isSet()==MSTrue) { switch (operator_) { case Plus: _real=a_+b_._real; break; case Minus: _real=a_-b_._real; break; case Multiply: _real=a_*b_._real; break; case Divide: _real=a_/b_._real; break; } if (isValid()==MSTrue) { if (finite(_real)<=0) { setToInValid(); } } } else { _real=0.0; } } // these two functions are only provided to save the finite check-i.e. // we could have casted the int to double and used the above constructors. MSFloat::MSFloat(const MSFloat& a_,int b_,MSFloat::FloatOperator operator_) : _flags(a_._flags) { if (isSet()==MSTrue) { switch (operator_) { case Plus: _real=a_._real+b_; break; case Minus: _real=a_._real-b_; break; case Multiply: _real=a_._real*b_; break; case Divide: _real=a_._real/b_; break; } if (isValid()==MSTrue) { if (finite(_real)<=0) { setToInValid(); } } } else { _real=0.0; } } MSFloat::MSFloat(int a_,const MSFloat& b_,MSFloat::FloatOperator operator_) : _flags(b_._flags) { if (isSet()==MSTrue) { switch (operator_) { case Plus: _real=a_+b_._real; break; case Minus: _real=a_-b_._real; break; case Multiply: _real=a_*b_._real; break; case Divide: _real=a_/b_._real; break; } if (isValid()==MSTrue) { if (finite(_real)<=0) { setToInValid(); } } } else { _real=0.0; } } MSFloat operator+(const MSFloat& a_,const MSFloat& b_) { return MSFloat(a_,b_,MSFloat::Plus); } MSFloat operator-(const MSFloat& a_,const MSFloat& b_) { return MSFloat(a_,b_,MSFloat::Minus); } MSFloat operator*(const MSFloat& a_,const MSFloat& b_) { return MSFloat(a_,b_,MSFloat::Multiply);} MSFloat operator/(const MSFloat& a_,const MSFloat& b_) { return MSFloat(a_,b_,MSFloat::Divide); } MSFloat operator+(const MSFloat& a_,const MSInt& b_) { return MSFloat(a_,b_,MSFloat::Plus); } MSFloat operator-(const MSFloat& a_,const MSInt& b_) { return MSFloat(a_,b_,MSFloat::Minus); } MSFloat operator*(const MSFloat& a_,const MSInt& b_) { return MSFloat(a_,b_,MSFloat::Multiply);} MSFloat operator/(const MSFloat& a_,const MSInt& b_) { return MSFloat(a_,b_,MSFloat::Divide); } MSFloat operator+(const MSInt& a_,const MSFloat& b_) { return MSFloat(a_,b_,MSFloat::Plus); } MSFloat operator-(const MSInt& a_,const MSFloat& b_) { return MSFloat(a_,b_,MSFloat::Minus); } MSFloat operator*(const MSInt& a_,const MSFloat& b_) { return MSFloat(a_,b_,MSFloat::Multiply);} MSFloat operator/(const MSInt& a_,const MSFloat& b_) { return MSFloat(a_,b_,MSFloat::Divide); } MSFloat operator+(const MSFloat& a_,double b_) { return MSFloat(a_,b_,MSFloat::Plus); } MSFloat operator-(const MSFloat& a_,double b_) { return MSFloat(a_,b_,MSFloat::Minus); } MSFloat operator*(const MSFloat& a_,double b_) { return MSFloat(a_,b_,MSFloat::Multiply);} MSFloat operator/(const MSFloat& a_,double b_) { return MSFloat(a_,b_,MSFloat::Divide); } MSFloat operator+(double a_,const MSFloat& b_) { return MSFloat(a_,b_,MSFloat::Plus); } MSFloat operator-(double a_,const MSFloat& b_) { return MSFloat(a_,b_,MSFloat::Minus); } MSFloat operator*(double a_,const MSFloat& b_) { return MSFloat(a_,b_,MSFloat::Multiply);} MSFloat operator/(double a_,const MSFloat& b_) { return MSFloat(a_,b_,MSFloat::Divide); } MSFloat operator+(const MSFloat& a_,int b_) { return MSFloat(a_,b_,MSFloat::Plus); } MSFloat operator-(const MSFloat& a_,int b_) { return MSFloat(a_,b_,MSFloat::Minus); } MSFloat operator*(const MSFloat& a_,int b_) { return MSFloat(a_,b_,MSFloat::Multiply);} MSFloat operator/(const MSFloat& a_,int b_) { return MSFloat(a_,b_,MSFloat::Divide); } MSFloat operator+(int a_,const MSFloat& b_) { return MSFloat(a_,b_,MSFloat::Plus); } MSFloat operator-(int a_,const MSFloat& b_) { return MSFloat(a_,b_,MSFloat::Minus); } MSFloat operator*(int a_,const MSFloat& b_) { return MSFloat(a_,b_,MSFloat::Multiply);} MSFloat operator/(int a_,const MSFloat& b_) { return MSFloat(a_,b_,MSFloat::Divide); } const char *MSFloat::format(MSString& aString_,const MSFormat& aFormat_) const { return (aFormat_.formatType()==MSFormat::Float)? formatReal(aString_,aFormat_.floatFormat(),aFormat_.formatModifier(),_real):format(aString_); } const char *MSFloat::format(MSString *pString_,const MSFormat& aFormat_) const { return format(*pString_,aFormat_); } const char *MSFloat::format(MSString& aString_,MSFloatFormat format_) const { return formatReal(aString_,format_,MSFormat::NoModifier,_real); } const char *MSFloat::format(MSString *pString_,MSFloatFormat format_) const { return formatReal(*pString_,format_,MSFormat::NoModifier,_real); } // MSUtil::comma is too inefficient, and one reason is becuase it does useful // checking to avoid writing past the end of a string (another reason may // be that it doesn't use "register" storage). We need as efficient // a function as possible, otherwise we will spend more time here than // anywhere else. addCommas runs in about 1/100 of the time of MSUtil::comma. // Plan on having enough space in outBuffer_. static void addCommas(register char *inBuffer_,register char *outBuffer_) { // addCommas takes the number string in inBuffer_ and copies it to // outBuffer_,adding commas between the first character and the decimal // point according to American convention. If inBuffer_ does not have // a '.', then no commas are added. register char *cp; // pointer to the decimal point register int places; // number of digits to the left of the decimal point // ignore leading minus sign if (*inBuffer_=='-') *outBuffer_++=*inBuffer_++; cp=strchr(inBuffer_,'.'); // No commas need to be added, just do the copy. if ((cp==NULL)||((places=cp-inBuffer_)<=3)) strcpy(outBuffer_,inBuffer_); else { // copy 1 to 3 digits before the first comma. register int remainder=((places-1) % 3)+1; while (remainder-->0) *outBuffer_++=*inBuffer_++; // copy a comma and 3 digits until we format to the decimal point. while (inBuffer_0) { if (aString_(0)=='-') aString_[0]='('; else aString_.insert("("); aString_<<")"; } } return aString_.string(); } aplus-fsf-4.22/src/MSTypes/MSFloatMatrix.C0000644000265000001440000017706710772770445014006 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #define MS_MSFloatMatrix_INSTANTIATE #include #include #if HAVE_SSTREAM #include #else #include #endif #include #include #include #include #include #include #include double MSTypeMatrix::_badData(0.0); const MSSymbol& MSTypeMatrix::type(void) const { return symbol(); } MSString MSTypeMatrix::asString(void) const { MSString result; result+='('; result+=MSString(rows()); result+=','; result+=MSString(columns()); result+=") "; unsigned n=count(); for (unsigned i=0;i::asMSF(void) const { #if HAVE_SSTREAM static string buf; static ostringstream oss(buf,ios::out); #else static char buf[64]; static ostrstream oss(buf,64,ios::out); #endif oss.precision(8); MSString result; if (_count>0) { result+=MSMSF_US; result+=MSString(_rows); result+=MSMSF_US; result+=MSString(_columns); for (unsigned i=0;i<_count;i++) { oss.seekp(ios::beg); oss<::asDebugInfo(void) const { MSString result("MSTypeMatrix(@"); result+=MSString((unsigned long)this).d2x().lowerCase(); result+=",_rows="; result+=MSString(rows()); result+=",_columns="; result+=MSString(columns()); result+=",_count="; result+=MSString(length()); result+=",_size="; result+=MSString(size()); result+=",_data="; result+=pData()->asDebugInfo(); result+=",_type="; result+=type().symbolName(); result+=")"; return MSString(result); } MSString MSTypeMatrix::className(void) const { return MSString("MSTypeMatrix"); } MSModel *MSTypeMatrix::clone(void) const { return new MSTypeMatrix(*this); } MSModel *MSTypeMatrix::create(void) const { return new MSTypeMatrix(); } void MSTypeMatrix::assign(const MSModel& aModel_) { *this=(MSTypeMatrix&)aModel_; } long MSTypeMatrix::compare(const MSModel& aModel_) const { return compare((MSTypeMatrix&)aModel_); } const MSSymbol& MSTypeMatrix::symbol(void) { static MSSymbol sym ("MSTypeMatrix"); return sym; } void MSTypeMatrix::blockLeft(unsigned target_,unsigned moveCount_) { double *dp=data(); for (unsigned i=target_;moveCount_>0;i++,moveCount_--) dp[i]=dp[i+1]; } void MSTypeMatrix::blockRight(unsigned target_,unsigned moveCount_) { double *dp=data(); for (unsigned i=target_+moveCount_-1;moveCount_>0;i--,moveCount_--) dp[i]=dp[i-1]; } void MSTypeMatrix::allocData(unsigned length_) { _count=length_; if (length()>0) { _pData = MSTypeData >::allocateWithLength (length()); } else { _pData=0; } } void MSTypeMatrix::makeUniqueCopy(void) { if (_pData!=0) { MSTypeData > *dst=MSTypeData >::allocateWithSize(size()); MSTypeData >::copy(_pData->elements(),dst->elements(),length()); //src,dst,len _pData->decrementCount(); _pData=dst; } } void MSTypeMatrix::prepareToChange(void) { if (_pData!=0) { if (_pData->refCount()>1) makeUniqueCopy(); } else allocData(length()); } void MSTypeMatrix::freeData(void) { decrementCount(),_pData=0; } // make sure there are at least size_+1 elements in the array void MSTypeMatrix::reserve(unsigned size_) { unsigned n=size_+1; if (size() > *newData=MSTypeData >::allocateWithLength(n); double *dp=newData->elements(); double *sp=data(); MSTypeData >::copy(sp,dp,size()); freeData(); _pData=newData; } } //------------------------------------------------------------------------------------------------- // MSTypeMatrix //------------------------------------------------------------------------------------------------- ostream& operator<<(ostream& aStream_,const MSTypeMatrix& aTypeMatrix_) { unsigned r=aTypeMatrix_.rows(); unsigned c=aTypeMatrix_.columns(); for (unsigned i=0;i::MSTypeMatrix(void) :MSMatrix() { _pData=0;_blocked=MSFalse; } MSTypeMatrix::MSTypeMatrix(unsigned rows_,unsigned cols_) :MSMatrix(rows_,cols_) { allocData(length()); _blocked=MSFalse; } MSTypeMatrix::MSTypeMatrix(unsigned rows_,unsigned cols_,double fill_) :MSMatrix(rows_,cols_) { if (length()>0) { unsigned n=length(); allocData(n); double *dp=data(); while (n--) *dp++=fill_; } else _pData=0; _blocked=MSFalse; } MSTypeMatrix::MSTypeMatrix(const MSTypeMatrix& aTypeMatrix_) :MSMatrix(aTypeMatrix_.rows(),aTypeMatrix_.columns()) { _pData=aTypeMatrix_.pData(); _blocked=MSFalse; (void)incrementCount(); } // special private constructor used to avoid temporary object creation // on return by value - see ARM page 267 MSTypeMatrix::MSTypeMatrix(MSTypeData > *data_,unsigned rows_,unsigned cols_) :MSMatrix(rows_,cols_) { _pData=data_; _blocked=MSFalse; } MSTypeMatrix::MSTypeMatrix(const double *pElements_, unsigned rows_, unsigned cols_) : MSMatrix(rows_,cols_) { _pData = MSTypeData >::allocateWithLength(_count, MSRaw); MSTypeData >::copy(pElements_, _pData->elements(), _count, MSRaw); } MSTypeMatrix::~MSTypeMatrix(void) { freeData(); } MSError::ErrorStatus MSTypeMatrix::set(unsigned index_,double aValue_) { if (index_elements()[index_]=aValue_; if (doChanged()==MSTrue) changed(index_); return MSError::MSSuccess; } return MSError::MSFailure; } MSError::ErrorStatus MSTypeMatrix::set(unsigned index_,const char *pString_) { char *cp=0; double dnum=strtod(pString_,&cp); // Base 10 if (cp==pString_) return MSError::MSFailure; else return set(index_,dnum); } MSError::ErrorStatus MSTypeMatrix::set(const char *pString_) { freeData(); if (pString_!=0) { #if defined(MS_NO_ISTRSTREAM_CONSTCHAR_CONSTRUCTOR) // Visual C++ does not define a constructor that takes a const char *, // therefore we have to do the following cast. istrstream ist((char *)(void *)pString_,strlen(pString_)); #else #if HAVE_SSTREAM istringstream ist(pString_); #else istrstream ist(pString_,strlen(pString_)); #endif #endif char c='\0'; // extract '(' while (c!='('&&ist) ist>>c; ist>>_rows; while (c!=','&&ist) ist>>c; ist>>_columns; while (c!=')'&&ist) ist>>c; if (!ist) { _rows=_columns=_count=0; return MSError::MSFailure; } _count=rows()*columns(); unsigned n=length(); if (n>0) _pData = MSTypeData >::allocateWithLength (n); double *dp=data(); for (unsigned i=0;i>dp[i]; if (!ist) return MSError::MSFailure; } changed(); return MSError::MSSuccess; } MSError::ErrorStatus MSTypeMatrix::setFromMSF(const char *pString_) { MSError::ErrorStatus code; unsigned i; unsigned startpos; unsigned value[2]; const char *pcurrent; char *pstring; if ((pString_!=0 &&(*pString_==MSMSF_US)&&(strlen(pString_)>sizeof(MSMSF_US)))) { code=MSError::MSSuccess; freeData(); _rows=0,_columns=0,_count=0; MSString decode(pString_); decode.decodeMSF(); unsigned slen=decode.length(); startpos=sizeof (MSMSF_US); pcurrent=(const char *)decode.string()+startpos; // first get the size of the matrix....its the first two elements in // the string for (i=0;i<2;i++) { value[i]=0; if (isdigit(*pcurrent)) value[i]=strtoul(pcurrent,&pstring,10); if (*pstring!='\0') { startpos=decode.indexOf (MSMSF_US,startpos); startpos+=sizeof(MSMSF_US); if (startpos >::allocateWithLength(length()); if (_pData!=0) { for (i=0;i<_count;i++) { if (startpos::indexOf(double aValue_,unsigned startPos_) const { unsigned n=length(); for (unsigned i=startPos_;i::lastIndexOf(double aValue_,unsigned startPos_) const { if (length()>0) { unsigned i; if (startPos_>=length()) i=length()-1; else i=startPos_; for (;i!=0;i--) if (elementAt(i)==aValue_) return i; if (i==0) if (elementAt(i)==aValue_) return i; } return length(); } // Assign a MSTypeMatrix to this MSTypeMatrix // aTypeMatrix=bTypeMatrix MSTypeMatrix& MSTypeMatrix::operator=(const MSTypeMatrix& aTypeMatrix_) { if (this!=&aTypeMatrix_) { freeData(); _count=aTypeMatrix_.length(); _rows=aTypeMatrix_.rows(); _columns=aTypeMatrix_.columns(); _pData=aTypeMatrix_.pData(); (void)incrementCount(); changed(); } return *this; } // Assign a unsigned index selected element of a MSTypeMatrix to all elements of this MSTypeMatrix. // aTypeMatrix=bTypeMatrix[index] MSTypeMatrix& MSTypeMatrix::operator=(const MSMatrixSTypePick& aPick_) { prepareToChange(); unsigned n=length(); double s=aPick_.value(); double *dp=data(); while (n--) *dp++=s; changed(); return *this; } // Assign a double to all elements of this MSTypeMatrix. // aTypeMatrix=aScalar MSTypeMatrix& MSTypeMatrix::operator=(double scalar_) { prepareToChange(); unsigned n=length(); double s=scalar_; double *dp=data(); while (n--) *dp++=s; changed(); return *this; } MSTypeMatrix& MSTypeMatrix::series(double offset_) { prepareToChange(); double j=offset_; unsigned n=length(); double *dp=data(); while (n--) *dp++=j++; changed(); return *this; } //------------------------------------------------------------------------------------------------- // relational operator functions //------------------------------------------------------------------------------------------------- long MSTypeMatrix::compare(const MSTypeMatrix& aTypeMatrix_) const { unsigned n=MSUtil::min(length(),aTypeMatrix_.length()); for (unsigned i=0;i::binaryCompare(const MSTypeMatrix& aTypeMatrix_,MSComparison aComparison_) const { assert(rows()==aTypeMatrix_.rows()&&columns()==aTypeMatrix_.columns()); unsigned aSize=size(); unsigned n=length(); MSTypeData > *d=MSTypeData >::allocateWithSize(aSize); const double *ap=data(); const double *bp=aTypeMatrix_.data(); unsigned char *dp=d->elements(); unsigned i; switch (aComparison_) { case MSLessThan: for (i=0;ibp[i]); break; case MSGreaterThanOrEqualTo: for (i=0;i=bp[i]); break; } return MSBinaryMatrix(d,rows(),columns()); } MSBinaryMatrix MSTypeMatrix::binaryCompare(double aScalar_,MSComparison aComparison_) const { unsigned aSize=size(); unsigned n=length(); MSTypeData > *d=MSTypeData >::allocateWithSize(aSize); const double *ap=data(); unsigned char *dp=d->elements(); unsigned i; switch (aComparison_) { case MSLessThan: for (i=0;iaScalar_); break; case MSGreaterThanOrEqualTo: for (i=0;i=aScalar_); break; } return MSBinaryMatrix(d,rows(),columns()); } MSBoolean MSTypeMatrix::scalarCompare(double aScalar_,MSComparison aComparison_) const { unsigned n=length(); if (n>0) { const double *ap=data(); unsigned i; switch (aComparison_) { case MSLessThan: for (i=0;i=aScalar_) return MSFalse; break; case MSLessThanOrEqualTo: for (i=0;iaScalar_) return MSFalse; break; case MSEqualTo: for (i=0;i operator-(const MSTypeMatrix& aTypeMatrix_) { unsigned aSize=aTypeMatrix_.size(); unsigned n=aTypeMatrix_.length(); MSTypeData > *d=MSTypeData >::allocateWithSize(aSize); double *sp=aTypeMatrix_.data(); double *dp=d->elements(); while (n--) *dp++=-*sp++; return MSTypeMatrix(d,aTypeMatrix_.rows(),aTypeMatrix_.columns()); } //------------------------------------------------------------------------------------------------- // Prefix/Postfix increment/decrement //------------------------------------------------------------------------------------------------- // Prefix - add/subtract one, then return result MSTypeMatrix& MSTypeMatrix::operator++() { if (length()>0) { prepareToChange(); unsigned n=length(); double *sp=data(); for (unsigned i=0;i& MSTypeMatrix::operator--() { if (length()>0) { prepareToChange(); unsigned n=length(); double *sp=data(); for (unsigned i=0;i MSTypeMatrix::operator++(int) { if (length()>0) { MSTypeMatrix r(*this); prepareToChange(); unsigned n=length(); double *sp=data(); for (unsigned i=0;i(); } MSTypeMatrix MSTypeMatrix::operator--(int) { if (length()>0) { MSTypeMatrix r(*this); prepareToChange(); unsigned n=length(); double *sp=data(); for (unsigned i=0;i(); } MSMatrixSTypePick& MSMatrixSTypePick::operator++(int) { double value=pMatrix()->elementAt(_index)+1; _pMatrix->set(_index,value); return *this; } MSMatrixSTypePick& MSMatrixSTypePick::operator--(int) { double value=pMatrix()->elementAt(_index)-1; _pMatrix->set(_index,value); return *this; } //------------------------------------------------------------------------------------------------- // arithmetic operator + //------------------------------------------------------------------------------------------------- MSTypeMatrix operator+(const MSTypeMatrix& aTypeMatrix_,double aScalar_) { MSTypeData > *d=0; unsigned n=aTypeMatrix_.length(); unsigned aSize=aTypeMatrix_.size(); if (n>0) { d=MSTypeData >::allocateWithSize(aSize); double *dp=d->elements(); const double *ap=aTypeMatrix_.data(); for (unsigned i=0;i(d,aTypeMatrix_.rows(),aTypeMatrix_.columns()); } MSTypeMatrix operator+(double aScalar_,const MSTypeMatrix& aTypeMatrix_) { return aTypeMatrix_+aScalar_; } MSTypeMatrix operator+(const MSTypeMatrix& aTypeMatrix_,const MSTypeMatrix& bTypeMatrix_) { assert(aTypeMatrix_.rows()==bTypeMatrix_.rows()&&aTypeMatrix_.columns()==bTypeMatrix_.columns()); MSTypeData > *d=0; unsigned n=aTypeMatrix_.length(); unsigned aSize=aTypeMatrix_.size(); if (n>0) { d=MSTypeData >::allocateWithSize(aSize); double *dp=d->elements(); const double *ap=aTypeMatrix_.data(); const double *bp=bTypeMatrix_.data(); for (unsigned i=0;i(d,aTypeMatrix_.rows(),aTypeMatrix_.columns()); } // apl operation aMatrix_ (x @1 0) aVector_ MSTypeMatrix operator+(const MSTypeMatrix& aMatrix_,const MSTypeVector& aVector_) { if (aMatrix_.rows()!=aVector_.length()) { aMatrix_.error("(x @1 0) Mismatch."); return MSTypeMatrix(); } MSTypeData > *d=0; unsigned n=aMatrix_.length(); unsigned aSize=aMatrix_.size(); unsigned rows=aMatrix_.rows(),cols=aMatrix_.columns(); if (n>0) { d=MSTypeData >::allocateWithSize(aSize); double *dp=d->elements(); const double *mp=aMatrix_.data(); const double *vp=aVector_.data(); unsigned j; for (unsigned i=0;i(d,rows,cols); } // apl operation aVector_ (x @1 0) aMatrix_ MSTypeMatrix operator+(const MSTypeVector& aVector_,const MSTypeMatrix& aMatrix_) { return aMatrix_+aVector_; } //------------------------------------------------------------------------------------------------- // arithmetic assignment + operator //------------------------------------------------------------------------------------------------- MSTypeMatrix& MSTypeMatrix::operator+=(double aScalar_) { prepareToChange(); unsigned n=length(); double c=aScalar_; double *dp=data(); while (n--) *dp++ += c; changed(); return *this; } MSMatrixSTypePick& MSMatrixSTypePick::operator+=(double aScalar_) { double value=pMatrix()->elementAt(_index)+aScalar_; _pMatrix->set(_index,value); return *this; } //------------------------------------------------------------------------------------------------- // arithmetic operator - //------------------------------------------------------------------------------------------------- MSTypeMatrix operator-(const MSTypeMatrix& aTypeMatrix_,double aScalar_) { MSTypeData > *d=0; unsigned n=aTypeMatrix_.length(); unsigned aSize=aTypeMatrix_.size(); if (n>0) { d=MSTypeData >::allocateWithSize(aSize); double *dp=d->elements(); const double *ap=aTypeMatrix_.data(); for (unsigned i=0;i(d,aTypeMatrix_.rows(),aTypeMatrix_.columns()); } MSTypeMatrix operator-(const MSTypeMatrix& aTypeMatrix_,const MSTypeMatrix& bTypeMatrix_) { assert(aTypeMatrix_.rows()==bTypeMatrix_.rows()&&aTypeMatrix_.columns()==bTypeMatrix_.columns()); MSTypeData > *d=0; unsigned n=aTypeMatrix_.length(); unsigned aSize=aTypeMatrix_.size(); if (n>0) { d=MSTypeData >::allocateWithSize(aSize); double *dp=d->elements(); const double *ap=aTypeMatrix_.data(); const double *bp=bTypeMatrix_.data(); for (unsigned i=0;i(d,aTypeMatrix_.rows(),aTypeMatrix_.columns()); } // apl operation aMatrix_ (x @1 0) aVector_ MSTypeMatrix operator-(const MSTypeMatrix& aMatrix_,const MSTypeVector& aVector_) { if (aMatrix_.rows()!=aVector_.length()) { aMatrix_.error("(x @1 0) Mismatch."); return MSTypeMatrix(); } MSTypeData > *d=0; unsigned n=aMatrix_.length(); unsigned aSize=aMatrix_.size(); unsigned rows=aMatrix_.rows(),cols=aMatrix_.columns(); if (n>0) { d=MSTypeData >::allocateWithSize(aSize); double *dp=d->elements(); const double *mp=aMatrix_.data(); const double *vp=aVector_.data(); unsigned j; for (unsigned i=0;i(d,rows,cols); } //------------------------------------------------------------------------------------------------- // arithmetic assignment - operator //------------------------------------------------------------------------------------------------- MSTypeMatrix& MSTypeMatrix::operator-=(double aScalar_) { prepareToChange(); unsigned n=length(); double c=aScalar_; double *dp=data(); while (n--) *dp++ -= c; changed(); return *this; } MSMatrixSTypePick& MSMatrixSTypePick::operator-=(double aScalar_) { double value=pMatrix()->elementAt(_index)-aScalar_; _pMatrix->set(_index,value); return *this; } //------------------------------------------------------------------------------------------------- // arithmetic operator * //------------------------------------------------------------------------------------------------- MSTypeMatrix operator*(const MSTypeMatrix& aTypeMatrix_,double aScalar_) { MSTypeData > *d=0; unsigned n=aTypeMatrix_.length(); unsigned aSize=aTypeMatrix_.size(); if (n>0) { d=MSTypeData >::allocateWithSize(aSize); double *dp=d->elements(); const double *ap=aTypeMatrix_.data(); for (unsigned i=0;i(d,aTypeMatrix_.rows(),aTypeMatrix_.columns()); } MSTypeMatrix operator*(double aScalar_,const MSTypeMatrix& aTypeMatrix_) { return aTypeMatrix_*aScalar_; } MSTypeMatrix operator*(const MSTypeMatrix& aTypeMatrix_,const MSTypeMatrix& bTypeMatrix_) { assert(aTypeMatrix_.rows()==bTypeMatrix_.rows()&&aTypeMatrix_.columns()==bTypeMatrix_.columns()); MSTypeData > *d=0; unsigned n=aTypeMatrix_.length(); unsigned aSize=aTypeMatrix_.size(); if (n>0) { d=MSTypeData >::allocateWithSize(aSize); double *dp=d->elements(); const double *ap=aTypeMatrix_.data(); const double *bp=bTypeMatrix_.data(); for (unsigned i=0;i(d,aTypeMatrix_.rows(),aTypeMatrix_.columns()); } // apl operation aTypeMatrix_ (x @1 0) aTypeVector_ MSTypeMatrix operator*(const MSTypeMatrix& aMatrix_,const MSTypeVector& aVector_) { if (aMatrix_.rows()!=aVector_.length()) { aMatrix_.error("(x @1 0) Mismatch."); return MSTypeMatrix(); } MSTypeData > *d=0; unsigned n=aMatrix_.length(); unsigned aSize=aMatrix_.size(); unsigned rows=aMatrix_.rows(),cols=aMatrix_.columns(); if (n>0) { d=MSTypeData >::allocateWithSize(aSize); double *dp=d->elements(); const double *mp=aMatrix_.data(); const double *vp=aVector_.data(); unsigned j; for (unsigned i=0;i(d,rows,cols); } // apl operation aVector_ (x @1 0) aMatrix_ MSTypeMatrix operator*(const MSTypeVector& aVector_,const MSTypeMatrix& aMatrix_) { return aMatrix_+aVector_; } //------------------------------------------------------------------------------------------------- // arithmetic assignment * operator //------------------------------------------------------------------------------------------------- MSTypeMatrix& MSTypeMatrix::operator*=(double aScalar_) { prepareToChange(); unsigned n=length(); double c=aScalar_; double *dp=data(); while (n--) *dp++ *= c; changed(); return *this; } MSMatrixSTypePick& MSMatrixSTypePick::operator*=(double aScalar_) { double value=pMatrix()->elementAt(_index)*aScalar_; _pMatrix->set(_index,value); return *this; } //------------------------------------------------------------------------------------------------- // arithmetic operator / //------------------------------------------------------------------------------------------------- MSTypeMatrix operator/(const MSTypeMatrix& aTypeMatrix_,double aScalar_) { MSTypeData > *d=0; unsigned n=aTypeMatrix_.length(); unsigned aSize=aTypeMatrix_.size(); if (n>0) { d=MSTypeData >::allocateWithSize(aSize); double *dp=d->elements(); const double *ap=aTypeMatrix_.data(); for (unsigned i=0;i(d,aTypeMatrix_.rows(),aTypeMatrix_.columns()); } MSTypeMatrix operator/(const MSTypeMatrix& aTypeMatrix_,const MSTypeMatrix& bTypeMatrix_) { assert(aTypeMatrix_.rows()==bTypeMatrix_.rows()&&aTypeMatrix_.columns()==bTypeMatrix_.columns()); MSTypeData > *d=0; unsigned n=aTypeMatrix_.length(); unsigned aSize=aTypeMatrix_.size(); if (n>0) { d=MSTypeData >::allocateWithSize(aSize); double *dp=d->elements(); const double *ap=aTypeMatrix_.data(); const double *bp=bTypeMatrix_.data(); for (unsigned i=0;i(d,aTypeMatrix_.rows(),aTypeMatrix_.columns()); } // apl operation aMatrix_ (x @1 0) aVector_ MSTypeMatrix operator/(const MSTypeMatrix& aMatrix_,const MSTypeVector& aVector_) { if (aMatrix_.rows()!=aVector_.length()) { aMatrix_.error("(x @1 0) Mismatch."); return MSTypeMatrix(); } MSTypeData > *d=0; unsigned n=aMatrix_.length(); unsigned aSize=aMatrix_.size(); unsigned rows=aMatrix_.rows(),cols=aMatrix_.columns(); if (n>0) { d=MSTypeData >::allocateWithSize(aSize); double *dp=d->elements(); const double *mp=aMatrix_.data(); const double *vp=aVector_.data(); unsigned j; for (unsigned i=0;i(d,rows,cols); } //------------------------------------------------------------------------------------------------- // arithmetic assignment / operator //------------------------------------------------------------------------------------------------- MSTypeMatrix& MSTypeMatrix::operator/=(double aScalar_) { prepareToChange(); unsigned n=length(); double c=aScalar_; double *dp=data(); while (n--) *dp++ /= c; changed(); return *this; } MSMatrixSTypePick& MSMatrixSTypePick::operator/=(double aScalar_) { double value=pMatrix()->elementAt(_index)/aScalar_; _pMatrix->set(_index,value); return *this; } //------------------------------------------------------------------------------------------------- // multiply, stack, adjoin //------------------------------------------------------------------------------------------------- // inner product MSTypeMatrix multiply(const MSTypeMatrix& aTypeMatrix_,const MSTypeMatrix& bTypeMatrix_) { if (aTypeMatrix_.columns()!=bTypeMatrix_.rows()) { aTypeMatrix_.error("nonconformant MSTypeMatrix multiply operands."); return MSTypeMatrix(); } unsigned len=aTypeMatrix_.rows()*bTypeMatrix_.columns(); MSTypeData > *d=MSTypeData >::allocateWithLength(len); double *dp=d->elements(); double *row=aTypeMatrix_.data(); double *ap=aTypeMatrix_.data(); double *bp; unsigned column; if (ap!=0) { while ((row+=aTypeMatrix_.columns())<=aTypeMatrix_.data()+aTypeMatrix_.length()) { for (column=0;column(d,aTypeMatrix_.rows(),bTypeMatrix_.columns()); } MSTypeMatrix stack(const MSTypeMatrix& aTypeMatrix_,const MSTypeMatrix& bTypeMatrix_) { if (aTypeMatrix_.columns()!=bTypeMatrix_.columns()) { aTypeMatrix_.error("nonconformant MSTypeMatrix stack operands."); return MSTypeMatrix(); } MSTypeData > *d=0; unsigned newLength=(aTypeMatrix_.rows()+bTypeMatrix_.rows())*aTypeMatrix_.columns(); if (newLength>0) { d=MSTypeData >::allocateWithLength(newLength); double *dp=d->elements(); double *mp=aTypeMatrix_.data(); double *row=aTypeMatrix_.data()+aTypeMatrix_.columns(); if (mp!=0) { do { while (mp(d,aTypeMatrix_.rows()+bTypeMatrix_.rows(),aTypeMatrix_.columns()); } MSTypeMatrix& MSTypeMatrix::stack(const MSTypeMatrix& aTypeMatrix_) { if (aTypeMatrix_.columns()!=columns()) { error("nonconformant stack operands."); return *this; } unsigned newLength=(rows()+aTypeMatrix_.rows())*columns(); MSTypeData > *d=0; if (newLength>0) { d=MSTypeData >::allocateWithLength(newLength); double *dp=d->elements(); double *mp=data(); double *row=data()+columns(); if (mp!=0) { do { while (mp0) { MSIndexVector iv; iv.series(aTypeMatrix_.length(),oldLength); changed(iv); } return *this; } MSTypeMatrix adjoin(const MSTypeMatrix& aTypeMatrix_,const MSTypeMatrix& bTypeMatrix_) { if (aTypeMatrix_.rows()!=bTypeMatrix_.rows()) { aTypeMatrix_.error("nonconformant MSTypeMatrix adjoin operands."); return MSTypeMatrix(); } MSTypeData > *d=0; unsigned newLength=aTypeMatrix_.rows()*(aTypeMatrix_.columns()+bTypeMatrix_.columns()); if (newLength>0) { d=MSTypeData >::allocateWithLength(newLength); double *dp=d->elements(); double *mp=aTypeMatrix_.data(); double *row=aTypeMatrix_.data()+aTypeMatrix_.columns(); if (mp!=0) { do { while (mpelements()+aTypeMatrix_.columns(); mp=bTypeMatrix_.data(); row=bTypeMatrix_.data()+bTypeMatrix_.columns(); if (mp!=0) { do { while (mp(d,aTypeMatrix_.rows(),aTypeMatrix_.columns()+bTypeMatrix_.columns()); } MSTypeMatrix& MSTypeMatrix::adjoin(const MSTypeMatrix& aTypeMatrix_) { if (rows()!=aTypeMatrix_.rows()) { aTypeMatrix_.error("nonconformant MSTypeMatrix adjoin operands."); return *this; } MSTypeData > *d=0; unsigned newLength=rows()*(columns()+aTypeMatrix_.columns()); if (newLength>0) { d=MSTypeData >::allocateWithLength(newLength); double *dp=d->elements(); double *mp=data(); double *row=data()+columns(); if (mp!=0) { do { while (mpelements()+columns(); mp=aTypeMatrix_.data(); row=aTypeMatrix_.data()+aTypeMatrix_.columns(); if (mp!=0) { do { while (mp0) changed(); return *this; } MSTypeMatrix& MSTypeMatrix::random(unsigned long limit_) { int n=length(); if (n>0) { prepareToChange(); if (limit_==0) limit_=length(); double *dp=data(); MSRandom rand; while (n--) *dp++=(double)rand(limit_); changed(); } return *this; } double MSTypeMatrix::min(void) const { double min; unsigned n=length(); if (n>0) { double *dp=data(); min=dp[0]; for (unsigned i=1;i::max(void) const { double max; unsigned n=length(); if (n>0) { double *dp=data(); max=dp[0]; for (unsigned i=1;imax) max=dp[i]; } else max=0.0; return max; } double MSTypeMatrix::sum(void) const { double sum=0.0; double *dp=data(); unsigned n=length(); while (n--) sum+=*dp++; return sum; } void MSTypeMatrix::error(const char* msg_) const { (*_matrixErrorHandler)(msg_); } //------------------------------------------------------------------------------------------ // matrix manipulation methods //------------------------------------------------------------------------------------------------- MSTypeMatrix& MSTypeMatrix::appendColumn(const MSTypeVector& aTypeVector_) { if (rows()==0||aTypeVector_.length()!=rows()) { error("MSTypeMatrix length error."); return *this; } unsigned newLength=rows()*(columns()+1); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); double *dp=d->elements(); double *mp=data(); double *vp=aTypeVector_.data(); unsigned i,j; for (j=0;j& MSTypeMatrix::appendColumns(unsigned cols_,double fill_) { if (rows()==0) { error("MSTypeMatrix length error."); return *this; } unsigned newLength=rows()*(columns()+cols_); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); double *dp=d->elements(); double *mp=data(); unsigned i,j; for (j=0;j& MSTypeMatrix::appendRow(const MSTypeVector& aTypeVector_) { if (columns()==0||aTypeVector_.length()!=columns()) { error("MSTypeMatrix length error."); return *this; } unsigned newLength=(rows()+1)*columns(); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); double *dp=d->elements(); double *mp=data(); double *vp=aTypeVector_.data(); unsigned i; for (i=0;i& MSTypeMatrix::appendRows(unsigned rows_, double fill_) { if (columns()==0) { error("MSTypeMatrix length error."); return *this; } unsigned newLength=(rows()+rows_)*columns(); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); double *dp=d->elements(); double *mp=data(); unsigned i,appendLength=columns()*rows_; for (i=0;i& MSTypeMatrix::exchangeColumns(unsigned aColumn_,unsigned bColumn_) { if (aColumn_+1>columns()||bColumn_+1>columns()||aColumn_==bColumn_) return *this; prepareToChange(); double *aPtr=data()+aColumn_; double *bPtr=data()+bColumn_; register double tVal; for (unsigned i=0;i& MSTypeMatrix::exchangeRows(unsigned aRow_,unsigned bRow_) { if (aRow_+1>rows()||bRow_+1>rows()||aRow_==bRow_) return *this; prepareToChange(); double *aPtr=data()+aRow_*columns(); double *bPtr=data()+bRow_*columns(); register double tVal; for (unsigned i=0;i& MSTypeMatrix::insertColumnBefore(unsigned col_,double fill_) { if (col_+1>columns()) return *this; unsigned newLength=rows()*(columns()+1); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); double *dp=d->elements(); double *mp=data(); unsigned i,j; for (j=0;j& MSTypeMatrix::insertColumnBefore(unsigned col_,const MSTypeVector& aTypeVector_) { if (col_+1>columns()) return *this; if (aTypeVector_.length()!=rows()) { error("MSTypeMatrix length error."); return *this; } unsigned newLength=rows()*(columns()+1); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); double *dp=d->elements(); double *mp=data(); double *vp=aTypeVector_.data(); unsigned i,j; for (j=0;j& MSTypeMatrix::insertColumnAfter(unsigned col_,double fill_) { if (col_+1>columns()) return *this; unsigned newLength=rows()*(columns()+1); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); double *dp=d->elements(); double *mp=data(); unsigned i,j; for (j=0;j& MSTypeMatrix::insertColumnAfter(unsigned col_,const MSTypeVector& aTypeVector_) { if (col_+1>columns()) return *this; if (aTypeVector_.length()!=rows()) { error("MSTypeMatrix length error."); return *this; } unsigned newLength=rows()*(columns()+1); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); double *dp=d->elements(); double *mp=data(); double *vp=aTypeVector_.data(); unsigned i,j; for (j=0;j& MSTypeMatrix::insertRowBefore(unsigned row_,double fill_) { if (row_+1>rows()) return *this; unsigned newLength=(rows()+1)*columns(); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); double *dp=d->elements(); double *mp=data(); unsigned i,j; for (j=0;j& MSTypeMatrix::insertRowBefore(unsigned row_,const MSTypeVector& aTypeVector_) { if (row_+1>rows()) return *this; if (aTypeVector_.length()!=columns()) { error("MSTypeMatrix length error."); return *this; } unsigned newLength=(rows()+1)*columns(); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); double *dp=d->elements(); double *mp=data(); double *vp=aTypeVector_.data(); unsigned i,j; for (j=0;j& MSTypeMatrix::insertRowAfter(unsigned row_,double fill_) { if (row_+1>rows()) return *this; unsigned newLength=(rows()+1)*columns(); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); double *dp=d->elements(); double *mp=data(); unsigned i,j; for (j=0;j& MSTypeMatrix::insertRowAfter(unsigned row_,const MSTypeVector& aTypeVector_) { if (row_>rows()) return *this; if (aTypeVector_.length()!=columns()) { error("MSTypeMatrix length error."); return *this; } unsigned newLength=(rows()+1)*columns(); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); double *dp=d->elements(); double *mp=data(); double *vp=aTypeVector_.data(); unsigned i,j; for (j=0;j& MSTypeMatrix::reshape(unsigned rows_,unsigned cols_) { MSTypeData > *d=0; unsigned newLength=rows_*cols_; if (newLength>0) { d=MSTypeData >::allocateWithLength(newLength); double *dp=d->elements(); double *mp=data(); double *end=data()+length(); if (mp==0) for (unsigned i=0;inewLength) for (unsigned i=0;i& MSTypeMatrix::removeAll(void) { freeData(); _rows=0,_columns=0,_count=0; changed(); return *this; } MSTypeMatrix& MSTypeMatrix::removeAllRows(void) { freeData(); _rows=0,_count=0; changed(); return *this; } MSTypeMatrix& MSTypeMatrix::removeAllColumns(void) { freeData(); _columns=0,_count=0; changed(); return *this; } MSTypeMatrix& MSTypeMatrix::assignColumn(unsigned col_,double scalar_) { if (col_+1>columns()) return *this; prepareToChange(); double *mp=data(); unsigned i,j; if (receiverList()!=0) { MSIndexVector iv(rows()); for (i=0,j=col_;i& MSTypeMatrix::assignRow(unsigned row_,double scalar_) { if (row_+1>rows()) return *this; prepareToChange(); double *mp=data(); unsigned i,j; for (i=row_*columns(),j=0;j& MSTypeMatrix::assignColumn(unsigned col_, const MSTypeVector& aTypeVector_) { if (col_+1>columns()) return *this; if (aTypeVector_.length()!=rows()) { error("MSTypeMatrix length error."); return *this; } prepareToChange(); double *mp; unsigned i; for (i=0,mp=data()+col_;i& MSTypeMatrix::assignRow(unsigned row_, const MSTypeVector& aTypeVector_) { if (row_+1>rows()) return *this; if (aTypeVector_.length()!=columns()) { error("MSTypeMatrix length error."); return *this; } prepareToChange(); double *mp; unsigned i; for (i=0,mp=data()+row_*columns();i& MSTypeMatrix::removeRow(unsigned row_) { if (row_+1>rows()) return *this; if (data()==0) return *this; unsigned newLength=(rows()-1)*columns(); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); double *dp=d->elements(); double *mp=data(); unsigned i,j; for (i=0;i& MSTypeMatrix::removeColumn(unsigned col_) { if (col_+1>columns()) return *this; if (data()==0) return *this; unsigned newLength=rows()*(columns()-1); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); double *dp=d->elements(); double *mp=data(); unsigned i,j; for (i=0;i& MSTypeMatrix::compressRows(const MSBinaryVector& aBinaryVector_ ) { if (data()==0) return *this; if (aBinaryVector_.length()!=rows()) { error("MSTypeMatrix length error."); return *this; } unsigned newLength=(unsigned)(aBinaryVector_.sum()*columns()); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); double *dp=d->elements(); double *mp=data(); unsigned i,j; for (i=0;i& MSTypeMatrix::compressColumns(const MSBinaryVector& aBinaryVector_ ) { if (data()==0) return *this; if (aBinaryVector_.length()!=columns()) { error("MSTypeMatrix length error."); return *this; } unsigned newLength=(unsigned)(rows()*aBinaryVector_.sum()); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); double *dp=d->elements(); double *mp=data(); unsigned i,j; for (i=0;i& MSTypeMatrix::reverseRows(void) { if (data()==0) return *this; prepareToChange(); unsigned i,j; double *upperRow=data(); double *lowerRow=data()+rows()*columns()-columns(); register double tVal; unsigned n=unsigned(rows()/2); for (i=0;i& MSTypeMatrix::reverseColumns(void) { if (data()==0) return *this; prepareToChange(); unsigned i,j; double *leftColumn=data(); double *rightColumn=data()+columns()-1; register double tVal; unsigned n=unsigned(columns()/2); for (i=0;i& MSTypeMatrix::transpose(void) { if (data()==0) return *this; unsigned aSize=size(); MSTypeData > *d=MSTypeData >::allocateWithSize(aSize); double *dp=d->elements(); double *mp=data(); unsigned i,j; for (i=0;i& MSTypeMatrix::rotateRows(int position_) { int rowPosition=MSUtil::abs(position_); if (rowPosition>0&&rowPosition!=rows()) { unsigned i; unsigned aSize=size(); MSTypeData > *d=MSTypeData >::allocateWithSize(aSize); if (rowPosition>rows()) rowPosition%=rows(); if (position_<0) rowPosition=rows()-rowPosition; unsigned start=rowPosition*columns(); double *mp=data()+start; double *dp=d->elements(); for (i=start;i& MSTypeMatrix::rotateColumns(int position_) { int columnPosition=MSUtil::abs(position_); if (columnPosition>0&&columnPosition!=columns()) { unsigned i,j; unsigned aSize=size(); MSTypeData > *d=MSTypeData >::allocateWithSize(aSize); if (columnPosition>columns()) columnPosition%=columns(); if (position_<0) columnPosition=columns()-columnPosition; double *mp=data()+columnPosition; double *dp=d->elements(); for (j=0;j& MSTypeMatrix::takeRows(int numberOfRows_) { int numberOfRows=MSUtil::abs(numberOfRows_); if (numberOfRows>0&&numberOfRows!=rows()) { unsigned i; unsigned newLength=numberOfRows*columns(); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); double *mp=data(); double *dp=d->elements(); if (numberOfRows>rows()) { if (numberOfRows_>0) for (i=0;i0) for (i=0;i& MSTypeMatrix::takeColumns(int numberOfColumns_) { int numberOfColumns=MSUtil::abs(numberOfColumns_); if (numberOfColumns>0&&numberOfColumns!=columns()) { unsigned i,j; unsigned newLength=numberOfColumns*rows(); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); double *mp=data(); double *dp=d->elements(); if (numberOfColumns>columns()) { if (numberOfColumns_>0) { for (i=0;i0) { for (i=0;i& MSTypeMatrix::dropRows(int numberOfRows_) { int numberOfRows=MSUtil::abs(numberOfRows_); if (numberOfRows>0) { if (numberOfRows > *d=MSTypeData >::allocateWithLength(newLength); double *mp=data(); double *dp=d->elements(); if (numberOfRows_>0) mp+=numberOfRows*columns(); for (i=0;i& MSTypeMatrix::dropColumns(int numberOfColumns_) { int numberOfColumns=MSUtil::abs(numberOfColumns_); if (numberOfColumns>0) { if (numberOfColumns > *d=MSTypeData >::allocateWithLength(newLength); double *mp=data(); double *dp=d->elements(); if (numberOfColumns_>0) { for (i=0;i MSTypeMatrix::rowAt(unsigned row_) const { if (row_+1>rows()||columns()==0) return MSTypeVector(); MSTypeData > *d=MSTypeData >::allocateWithLength(columns()); double *mp; double *dp=d->elements(); unsigned i; for (i=0,mp=data()+row_*columns();i (d,columns()); } MSTypeVector MSTypeMatrix::columnAt(unsigned column_) const { if (column_+1>columns()||rows()==0) return MSTypeVector(); MSTypeData > *d=MSTypeData >::allocateWithLength(rows()); double *mp; double *dp=d->elements(); unsigned i; for (i=0,mp=data()+column_;i(d,rows()); } //------------------------------------------------------------ // Math Functions //------------------------------------------------------------ MSTypeMatrix& MSTypeMatrix::sin(void) { return allElementsDo(::sin); } MSTypeMatrix& MSTypeMatrix::sinh(void) { return allElementsDo(::sinh); } MSTypeMatrix& MSTypeMatrix::cos(void) { return allElementsDo(::cos); } MSTypeMatrix& MSTypeMatrix::cosh(void) { return allElementsDo(::cosh); } MSTypeMatrix& MSTypeMatrix::tan(void) { return allElementsDo(::tan); } MSTypeMatrix& MSTypeMatrix::tanh(void) { return allElementsDo(::tanh); } MSTypeMatrix& MSTypeMatrix::asin(void) { return allElementsDo(::asin); } MSTypeMatrix& MSTypeMatrix::acos(void) { return allElementsDo(::acos); } MSTypeMatrix& MSTypeMatrix::atan(void) { return allElementsDo(::atan); } MSTypeMatrix& MSTypeMatrix::exp(void) { return allElementsDo(::exp); } MSTypeMatrix& MSTypeMatrix::log(void) { return allElementsDo(::log); } MSTypeMatrix& MSTypeMatrix::sqrt(void) { return allElementsDo(::sqrt); } MSTypeMatrix& MSTypeMatrix::ceil(void) { return allElementsDo(::ceil); } MSTypeMatrix& MSTypeMatrix::floor(void) { return allElementsDo(::floor); } MSTypeMatrix& MSTypeMatrix::abs(void) { return allElementsDo(::fabs); } MSTypeMatrix& MSTypeMatrix::pow(double exponent_) { return allElementsDo(_pow,(void *)&exponent_); } MSTypeMatrix& MSTypeMatrix::allElementsDo(MathFunction aFunction_) { prepareToChange(); double *dp=data(); double *end=data()+length(); while (dp& MSTypeMatrix::allElementsDo(ElementWiseFunction aFunction_,void *clientData_) { prepareToChange(); double *dp=data(); double *end=data()+length(); while (dp allElementsDo(const MSTypeMatrix& aFloatMatrix_,MathFunction aFunction_) { MSTypeData > *d=MSTypeData >::allocateWithSize(aFloatMatrix_.size()); const double *sp=aFloatMatrix_.data(); double *dp=d->elements(); double *end=d->elements()+aFloatMatrix_.length(); while (dp(d,aFloatMatrix_.rows(),aFloatMatrix_.columns()); } MSTypeMatrix allElementsDo(const MSTypeMatrix& aTypeMatrix_, ElementWiseFunction aFunction_,void *clientData_) { unsigned n=aTypeMatrix_.count(); unsigned aSize=aTypeMatrix_.size(); MSTypeData > *d=MSTypeData >::allocateWithSize(aSize); const double *sp=aTypeMatrix_.data(); double *dp=d->elements(); for (unsigned i=0;i(d,aTypeMatrix_.rows(),aTypeMatrix_.columns()); } MSTypeMatrix sin(const MSTypeMatrix& aFloatMatrix_) {return allElementsDo(aFloatMatrix_,::sin);} MSTypeMatrix sinh(const MSTypeMatrix& aFloatMatrix_) {return allElementsDo(aFloatMatrix_,::sinh);} MSTypeMatrix cos(const MSTypeMatrix& aFloatMatrix_) {return allElementsDo(aFloatMatrix_,::cos);} MSTypeMatrix cosh(const MSTypeMatrix& aFloatMatrix_) {return allElementsDo(aFloatMatrix_,::cosh);} MSTypeMatrix tan(const MSTypeMatrix& aFloatMatrix_) {return allElementsDo(aFloatMatrix_,::tan);} MSTypeMatrix tanh(const MSTypeMatrix& aFloatMatrix_) {return allElementsDo(aFloatMatrix_,::tanh);} MSTypeMatrix asin(const MSTypeMatrix& aFloatMatrix_) {return allElementsDo(aFloatMatrix_,::asin);} MSTypeMatrix acos(const MSTypeMatrix& aFloatMatrix_) {return allElementsDo(aFloatMatrix_,::acos);} MSTypeMatrix atan(const MSTypeMatrix& aFloatMatrix_) {return allElementsDo(aFloatMatrix_,::atan);} MSTypeMatrix exp(const MSTypeMatrix& aFloatMatrix_) {return allElementsDo(aFloatMatrix_,::exp);} MSTypeMatrix log(const MSTypeMatrix& aFloatMatrix_) {return allElementsDo(aFloatMatrix_,::log);} MSTypeMatrix sqrt(const MSTypeMatrix& aFloatMatrix_) {return allElementsDo(aFloatMatrix_,::sqrt);} MSTypeMatrix ceil(const MSTypeMatrix& aFloatMatrix_) {return allElementsDo(aFloatMatrix_,::ceil);} MSTypeMatrix floor(const MSTypeMatrix& aFloatMatrix_) {return allElementsDo(aFloatMatrix_,::floor);} MSTypeMatrix abs(const MSTypeMatrix& aFloatMatrix_) {return allElementsDo(aFloatMatrix_,::fabs);} MSTypeMatrix pow(const MSTypeMatrix& aFloatMatrix_,double exponent_) {return allElementsDo(aFloatMatrix_,MSTypeMatrix::_pow,(void *)&exponent_);} // ElementWiseFunction that returns x**y double MSTypeMatrix::_pow(double x_,void *y_) {return ::pow(x_,*(double *)y_);} aplus-fsf-4.22/src/MSTypes/MSFloatVector.C0000644000265000001440000002665410772770445013777 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #if defined(MS_FORCE_INTERNAL_TEMPLATE_INSTANTIATION) #define MS_MSFloatVector_INSTANTIATE #define MSTK_MANUAL_INSTANTIATION #endif #include #ifndef MSDefinesHEADER #include #endif #ifdef MS_NO_INLINES #include #endif // MS_NO_INLINES #if defined(MSTK_MANUAL_INSTANTIATION) #include #if defined(MS_XLC_TEMPLATE_INSTANTIATION) #pragma define (MSTypeVector) #endif #if defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma instantiate MSBaseVector > #pragma instantiate MSBuiltinVector #if !defined(MS_TEMPLATE_MANUAL_FRIEND_BUG) // The version of EDG used by SGI's dcc compiler has a bug related to access from friends #pragma instantiate ostream & operator<<(ostream &, const MSBaseVector >&) #endif //MS_TEMPLATE_MANUAL_FRIEND_BUG #endif //MS_EDG_TEMPLATE_INSTANTIATION_ #if defined(MS_VC_TEMPLATE_INSTANTIATION) template MSBaseVector >; template MSBaseVectorOps >; template class MSBuiltinVector; template class MSBuiltinVectorOps; static int __instantiateFriends__() // instantiate non-inline friend template functions { if (0) { MSBuiltinVector dummy; operator<<(cout, dummy); } return 0; } static int __dummyInt__=__instantiateFriends__(); #endif // MS_VC_TEMPLATE_INSTANTIATION #if defined(MS_STD_TEMPLATE_INSTANTIATION) template class MSBaseVector >; template class MSBaseVectorOps >; template class MSBuiltinVector; template class MSBuiltinVectorOps; template ostream& operator<<(ostream&,const MSBaseVector >&); #endif #endif // MSTK_MANUAL_INSTANTIATION #include MSTypeVector::MSTypeVector() : BuiltinVectorDouble() { } MSTypeVector::MSTypeVector (unsigned int length_) : BuiltinVectorDouble (length_) { } MSTypeVector::MSTypeVector (unsigned int length_, const double & filler_) : BuiltinVectorDouble (length_, filler_) { } MSTypeVector::MSTypeVector (const MSTypeVector & vect_) : BuiltinVectorDouble (vect_) { } MSTypeVector::MSTypeVector (const BuiltinVectorDouble & vect_) : BuiltinVectorDouble (vect_) { } MSTypeVector::MSTypeVector (const BaseVectorDouble & vect_) : BuiltinVectorDouble ((BuiltinVectorDouble &)vect_) { } MSTypeVector::MSTypeVector (const char *pString_) : BuiltinVectorDouble (pString_) { } MSTypeVector::MSTypeVector (MSTypeData > *pData_, unsigned int len_) : BuiltinVectorDouble (pData_, len_) { } MSTypeVector::MSTypeVector (const double *pElements_, unsigned int len_) : BuiltinVectorDouble (pElements_, len_) { } MSTypeVector::~MSTypeVector() { } MSTypeVector & MSTypeVector::operator= (const MSTypeVector & vect_) { return (MSTypeVector &) BuiltinVectorDouble::operator= (vect_); } MSTypeVector & MSTypeVector::operator= (const BuiltinVectorDouble & vect_) { return (*this = (MSTypeVector &)vect_); } MSTypeVector & MSTypeVector::operator= (const BaseVectorDouble & vect_) { return (*this = (MSTypeVector &)vect_); } MSTypeVector & MSTypeVector::operator= (const double & value_) { return (MSTypeVector &) BuiltinVectorDouble::operator= (value_); } MSTypeVector & MSTypeVector::operator= (const char *pString_) { return (*this = MSTypeVector(pString_)); // return (MSTypeVector &) BuiltinVectorDouble::operator= (pString_); } MSString MSTypeVector::className() const { return MSString ("MSTypeVector"); } const MSSymbol & MSTypeVector::type() const { return symbol(); } MSModel * MSTypeVector::clone() const { return new MSTypeVector (*this); } MSModel * MSTypeVector::create() const { return new MSTypeVector; } const MSSymbol & MSTypeVector::symbol() { static MSSymbol sym ("MSTypeVector"); return sym; } MSTypeVector & MSTypeVector::allElementsDo (MathFunction aFunction_) { unsigned int len = length(); double *dp = data(); // What we do below is a little bit of a hack; since we have a reference counted vector data, we have to check // the reference count to see if we need to allocate our own copy of the data. However, the data itself is stored // in BuiltInVectorImpl, and we don't have direct access to it. Therefore, we here reallocate the whole // implementation class, which shouldn't be much slower since the bulk of it is the vector data anyway. // if (ops().refCount (_pImpl->data()) > 1) { MSBuiltinVectorImpl *pNewImpl = (MSBuiltinVectorImpl *)_pImpl->create (len, size()); double *pNewData = ((MSTypeData > *)pNewImpl->data())->elements(); while (len--) *pNewData++ = aFunction_ (*dp++); delete _pImpl; _pImpl = pNewImpl; } else // refCount == 1 { while (len--) { *dp = aFunction_ (*dp); dp++; } } changed(); return *this; } MSTypeVector & MSTypeVector::allElementsDo (ElementWiseFunction aFunction_, void *pClientData_) { unsigned int len = length(); double *dp = data(); // What we do below is a little bit of a hack; since we have a reference counted vector data, we have to check // the reference count to see if we need to allocate our own copy of the data. However, the data itself is stored // in BuiltInVectorImpl, and we don't have direct access to it. Therefore, we here reallocate the whole // implementation class, which shouldn't be much slower since the bulk of it is the vector data anyway. // if (ops().refCount (_pImpl->data()) > 1) { MSBuiltinVectorImpl *pNewImpl = (MSBuiltinVectorImpl *)_pImpl->create (len, size()); double *pNewData = ((MSTypeData > *)pNewImpl->data())->elements(); while (len--) *pNewData++ = aFunction_ (*dp++, pClientData_); delete _pImpl; _pImpl = pNewImpl; } else // refCount == 1 { while (len--) { *dp = aFunction_ (*dp, pClientData_); dp++; } } changed(); return *this; } MSTypeVector MSTypeVector::allElementsDo (const MSTypeVector & vect_, MathFunction func_) { unsigned int len = vect_.length(); MSTypeData > *pNewData = MSTypeData >::allocateWithSize (vect_.size()); const double *pElements = vect_.data(); double *pNewElements = pNewData->elements(); while (len--) *pNewElements++ = func_ (*pElements++); return MSTypeVector (pNewData, vect_.length()); } MSTypeVector MSTypeVector::allElementsDo (const MSTypeVector& vect_, ElementWiseFunction aFunction_, void *pClientData_) { unsigned int len = vect_.length(); MSTypeData > *pNewData = MSTypeData >::allocateWithSize (vect_.size()); const double *pElements = vect_.data(); double *pNewElements = pNewData->elements(); while (len--) *pNewElements++ = aFunction_ (*pElements++, pClientData_); return MSTypeVector (pNewData, vect_.length()); } MSTypeVector & MSTypeVector::sin() { return allElementsDo (::sin); } MSTypeVector & MSTypeVector::cos() { return allElementsDo (::cos); } MSTypeVector & MSTypeVector::tan() { return allElementsDo (::tan); } MSTypeVector & MSTypeVector::asin() { return allElementsDo (::asin); } MSTypeVector & MSTypeVector::acos() { return allElementsDo (::acos); } MSTypeVector & MSTypeVector::atan() { return allElementsDo (::atan); } MSTypeVector & MSTypeVector::sinh() { return allElementsDo (::sinh); } MSTypeVector & MSTypeVector::cosh() { return allElementsDo (::cosh); } MSTypeVector & MSTypeVector::tanh() { return allElementsDo (::tanh); } MSTypeVector & MSTypeVector::exp() { return allElementsDo (::exp); } MSTypeVector & MSTypeVector::log() { return allElementsDo (::log); } MSTypeVector & MSTypeVector::sqrt() { return allElementsDo (::sqrt); } MSTypeVector & MSTypeVector::ceil() { return allElementsDo (::ceil); } MSTypeVector & MSTypeVector::floor() { return allElementsDo (::floor); } MSTypeVector & MSTypeVector::abs() { return allElementsDo (::fabs); } MSTypeVector & MSTypeVector::pow (double exponent_) { return allElementsDo (&MSTypeVector::powFunc, (void *)&exponent_); } MSTypeVector sin (const MSTypeVector & vect_) { return MSTypeVector::allElementsDo (vect_, ::sin); } MSTypeVector cos (const MSTypeVector & vect_) { return MSTypeVector::allElementsDo (vect_, ::cos); } MSTypeVector tan (const MSTypeVector & vect_) { return MSTypeVector::allElementsDo (vect_, ::tan); } MSTypeVector asin (const MSTypeVector & vect_) { return MSTypeVector::allElementsDo (vect_, ::asin); } MSTypeVector acos (const MSTypeVector & vect_) { return MSTypeVector::allElementsDo (vect_, ::acos); } MSTypeVector atan (const MSTypeVector & vect_) { return MSTypeVector::allElementsDo (vect_, ::atan); } MSTypeVector sinh (const MSTypeVector & vect_) { return MSTypeVector::allElementsDo (vect_, ::sinh); } MSTypeVector cosh (const MSTypeVector & vect_) { return MSTypeVector::allElementsDo (vect_, ::cosh); } MSTypeVector tanh (const MSTypeVector & vect_) { return MSTypeVector::allElementsDo (vect_, ::tanh); } MSTypeVector exp (const MSTypeVector & vect_) { return MSTypeVector::allElementsDo (vect_, ::exp); } MSTypeVector log (const MSTypeVector & vect_) { return MSTypeVector::allElementsDo (vect_, ::log); } MSTypeVector sqrt (const MSTypeVector & vect_) { return MSTypeVector::allElementsDo (vect_, ::sqrt); } MSTypeVector ceil (const MSTypeVector & vect_) { return MSTypeVector::allElementsDo (vect_, ::ceil); } MSTypeVector floor (const MSTypeVector & vect_) { return MSTypeVector::allElementsDo (vect_, ::floor); } MSTypeVector abs (const MSTypeVector & vect_) { return MSTypeVector::allElementsDo (vect_, ::fabs); } MSTypeVector pow (const MSTypeVector & vect_, double exponent_) { return MSTypeVector::allElementsDo (vect_, &MSTypeVector::powFunc, (void *)&exponent_); } // ElementWiseFunction that returns x**y double MSTypeVector::powFunc (double x_, void *pY_) { return ::pow (x_,*(double *)pY_); } aplus-fsf-4.22/src/MSTypes/MSFormat.C0000644000265000001440000005100310772770445012761 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #if HAVE_IOSTREAM #include #else #include #endif #include #include #include #ifdef MS_NO_INLINES #include #endif MSFormat::MSFormat(void) : _formatType(MSFormat::NoFormat),_formatModifier(MSFormat::NoModifier) { _format._any=0; } MSFormat::MSFormat(MSBool::MSBoolFormat format_,unsigned long formatModifier_) { format(format_); formatModifier(formatModifier_); } MSFormat::MSFormat(MSDate::MSDateFormat format_,unsigned long formatModifier_) { format(format_); formatModifier(formatModifier_); } MSFormat::MSFormat(MSFloat::MSFloatFormat format_,unsigned long formatModifier_) { format(format_); formatModifier(formatModifier_); } MSFormat::MSFormat(MSInt::MSIntFormat format_,unsigned long formatModifier_) { format(format_); formatModifier(formatModifier_); } MSFormat::MSFormat(MSMoney::MSMoneyFormat format_,unsigned long formatModifier_) { format(format_); formatModifier(formatModifier_); } MSFormat::MSFormat(MSRate::MSRateFormat format_,unsigned long formatModifier_) { format(format_); formatModifier(formatModifier_); } MSFormat::MSFormat(MSTerm::MSTermFormat format_,unsigned long formatModifier_) { format(format_); formatModifier(formatModifier_); } MSFormat::MSFormat(MSTime::MSTimeFormat format_,unsigned long formatModifier_) { format(format_); formatModifier(formatModifier_); } MSFormat::MSFormat(const MSFormat& aFormat_) { format(aFormat_); } MSFormat::MSFormat(const char *formatString_,const char *modifierString_) { _format._any=0; if (formatString_!=0) { MSFormat *pFormat=(MSFormat *)formatHashTable()->lookup(formatString_); if (pFormat!=0) format(*pFormat); else _formatType=NoFormat; } else _formatType=NoFormat; _formatModifier=NoModifier; if (modifierString_!=0) { MSString modifierString(modifierString_); modifierString.change("|","\n"); MSStringVector modifierVector(modifierString); for (unsigned i=0;ilookup(modifierVector(i)); } } } MSFormat::~MSFormat(void) {} MSFormat& MSFormat::operator=(const MSFormat& aFormat_) { _formatType=aFormat_._formatType,_formatModifier=aFormat_._formatModifier,_format=aFormat_._format; return *this; } void MSFormat::format(const MSFormat& aFormat_) { _formatType=aFormat_._formatType,_formatModifier=aFormat_._formatModifier,_format=aFormat_._format; } void MSFormat::format(MSBool::MSBoolFormat format_) { _formatType=FBool,_format._bool=format_;} void MSFormat::format(MSDate::MSDateFormat format_) { _formatType=Date,_format._date=format_;} void MSFormat::format(MSFloat::MSFloatFormat format_) { _formatType=Float,_format._float=format_;} void MSFormat::format(MSInt::MSIntFormat format_) { _formatType=Int,_format._int=format_;} void MSFormat::format(MSMoney::MSMoneyFormat format_) { _formatType=Money,_format._money=format_;} void MSFormat::format(MSRate::MSRateFormat format_) { _formatType=Rate,_format._rate=format_;} void MSFormat::format(MSTerm::MSTermFormat format_) { _formatType=Term,_format._term=format_;} void MSFormat::format(MSTime::MSTimeFormat format_) { _formatType=Time,_format._time=format_;} void MSFormat::formatModifier(unsigned long formatModifier_) { _formatModifier=formatModifier_; } MSString MSFormat::asString(void) const { if (_formatType!=MSFormat::NoFormat) { const char *pString=(char *)enumHashTable()->lookup((unsigned long)_format._any); if (pString==0) return MSString("NoFormat"); return MSString(pString); } return MSString("NoFormat"); } MSString MSFormat::asModifierString(void) const { MSString modifierString; if (formatModifier()&UpperCaseK) { if (modifierString.length()>0) modifierString<<"|"; modifierString<<"UpperCaseK"; } if (formatModifier()&LowerCaseK) { if (modifierString.length()>0) modifierString<<"|"; modifierString<<"LowerCaseK"; } if (formatModifier()&UpperCaseM) { if (modifierString.length()>0) modifierString<<"|"; modifierString<<"UpperCaseM"; } if (formatModifier()&LowerCaseM) { if (modifierString.length()>0) modifierString<<"|"; modifierString<<"LowerCaseM"; } if (formatModifier()&Parenthesis) { if (modifierString.length()>0) modifierString<<"|"; modifierString<<"Parenthesis"; } if (modifierString.length()==0) modifierString="NoModifier"; return modifierString; } const MSStringVector& MSFormat::formats(void) const { switch (_formatType) { case FBool: return boolFormats(); case Date: return dateFormats(); case Float: return floatFormats(); case Int: return intFormats(); case Money: return moneyFormats(); case Rate: return rateFormats(); case Term: return termFormats(); case Time: return timeFormats(); case NoFormat: default: return noFormats(); } } MSHashTable *MSFormat::initFormatHashTable(void) { MSHashTable *pHashTable=new MSHashTable(64); pHashTable->notFound((unsigned long)0x0); // MSFloat pHashTable->add("Decimal0",new MSFormat(MSFloat::Decimal0)); pHashTable->add("Decimal1",new MSFormat(MSFloat::Decimal1)); pHashTable->add("Decimal2",new MSFormat(MSFloat::Decimal2)); pHashTable->add("Decimal3",new MSFormat(MSFloat::Decimal3)); pHashTable->add("Decimal4",new MSFormat(MSFloat::Decimal4)); pHashTable->add("Decimal5",new MSFormat(MSFloat::Decimal5)); pHashTable->add("Decimal6",new MSFormat(MSFloat::Decimal6)); pHashTable->add("Decimal7",new MSFormat(MSFloat::Decimal7)); pHashTable->add("Decimal8",new MSFormat(MSFloat::Decimal8)); pHashTable->add("CommaDecimal0",new MSFormat(MSFloat::CommaDecimal0)); pHashTable->add("CommaDecimal1",new MSFormat(MSFloat::CommaDecimal1)); pHashTable->add("CommaDecimal2",new MSFormat(MSFloat::CommaDecimal2)); pHashTable->add("CommaDecimal3",new MSFormat(MSFloat::CommaDecimal3)); pHashTable->add("CommaDecimal4",new MSFormat(MSFloat::CommaDecimal4)); pHashTable->add("CommaDecimal5",new MSFormat(MSFloat::CommaDecimal5)); pHashTable->add("CommaDecimal6",new MSFormat(MSFloat::CommaDecimal6)); pHashTable->add("CommaDecimal7",new MSFormat(MSFloat::CommaDecimal7)); pHashTable->add("CommaDecimal8",new MSFormat(MSFloat::CommaDecimal8)); pHashTable->add("MaximumPrecision",new MSFormat(MSFloat::MaximumPrecision)); pHashTable->add("Default",new MSFormat(MSFloat::Default)); // MSInt pHashTable->add("WithoutCommas",new MSFormat(MSInt::WithoutCommas)); pHashTable->add("WithCommas",new MSFormat(MSInt::WithCommas)); // MSDate pHashTable->add("Slash",new MSFormat(MSDate::Slash)); pHashTable->add("Slash4",new MSFormat(MSDate::Slash4)); pHashTable->add("Terse",new MSFormat(MSDate::Terse)); pHashTable->add("Terse4",new MSFormat(MSDate::Terse4)); pHashTable->add("Long",new MSFormat(MSDate::Long)); pHashTable->add("MonthYear",new MSFormat(MSDate::MonthYear)); pHashTable->add("YearMonthDay",new MSFormat(MSDate::YearMonthDay)); pHashTable->add("Year2MonthDay",new MSFormat(MSDate::Year2MonthDay)); pHashTable->add("EuropeanDot",new MSFormat(MSDate::EuropeanDot)); pHashTable->add("EuropeanDot4",new MSFormat(MSDate::EuropeanDot4)); pHashTable->add("Database",new MSFormat(MSDate::Database)); pHashTable->add("DataBase",new MSFormat(MSDate::DataBase)); // for backward compatibility only pHashTable->add("Julian",new MSFormat(MSDate::Julian)); // MSTime pHashTable->add("HoursMinutesSeconds",new MSFormat(MSTime::HoursMinutesSeconds)); pHashTable->add("MonthDayYear",new MSFormat(MSTime::MonthDayYear)); pHashTable->add("HoursMinutesSecondsSlash",new MSFormat(MSTime::HoursMinutesSecondsSlash)); pHashTable->add("HoursMinutesSecondsSlashZone",new MSFormat(MSTime::HoursMinutesSecondsSlashZone)); pHashTable->add("HoursMinutesSecondsSlash4",new MSFormat(MSTime::HoursMinutesSecondsSlash4)); pHashTable->add("HoursMinutesSecondsSlash4Zone",new MSFormat(MSTime::HoursMinutesSecondsSlash4Zone)); pHashTable->add("CalendarTime",new MSFormat(MSTime::CalendarTime)); // MSMoney pHashTable->add("CurrencyPrecision",new MSFormat(MSMoney::CurrencyPrecision)); pHashTable->add("CommaCurrencyPrecision",new MSFormat(MSMoney::CommaCurrencyPrecision)); pHashTable->add("Eights",new MSFormat(MSMoney::Eights)); pHashTable->add("Sixteenths",new MSFormat(MSMoney::Sixteenths)); pHashTable->add("ThirtySeconds",new MSFormat(MSMoney::ThirtySeconds)); pHashTable->add("SixtyForths",new MSFormat(MSMoney::SixtyForths)); pHashTable->add("OneTwentyEights",new MSFormat(MSMoney::OneTwentyEights)); pHashTable->add("TwoFiftySixths",new MSFormat(MSMoney::TwoFiftySixths)); pHashTable->add("Tenths",new MSFormat(MSMoney::Tenths)); pHashTable->add("Hundredths",new MSFormat(MSMoney::Hundredths)); pHashTable->add("Thousandths",new MSFormat(MSMoney::Thousandths)); pHashTable->add("TenThousandths",new MSFormat(MSMoney::TenThousandths)); pHashTable->add("HundredThousandths",new MSFormat(MSMoney::HundredThousandths)); pHashTable->add("Millionths",new MSFormat(MSMoney::Millionths)); pHashTable->add("TenMillionths",new MSFormat(MSMoney::TenMillionths)); pHashTable->add("HundredMillionths",new MSFormat(MSMoney::HundredMillionths)); // MSRate pHashTable->add("Percent0",new MSFormat(MSRate::Percent0)); pHashTable->add("Percent1",new MSFormat(MSRate::Percent1)); pHashTable->add("Percent2",new MSFormat(MSRate::Percent2)); pHashTable->add("Percent3",new MSFormat(MSRate::Percent3)); pHashTable->add("Percent4",new MSFormat(MSRate::Percent4)); pHashTable->add("Percent5",new MSFormat(MSRate::Percent5)); pHashTable->add("BasisPoint",new MSFormat(MSRate::BasisPoint)); // MSTerm pHashTable->add("YearsMonthsDays",new MSFormat(MSTerm::YearMonthDay)); pHashTable->add("YearsMonthsDaysPad",new MSFormat(MSTerm::YearMonthDayPad)); pHashTable->add("YearsMonthsDaysNoPad",new MSFormat(MSTerm::YearMonthDayNoPad)); // MSBool pHashTable->add("YesAndNo",new MSFormat(MSBool::YesAndNo)); pHashTable->add("TrueAndFalse",new MSFormat(MSBool::TrueAndFalse)); pHashTable->add("Binary",new MSFormat(MSBool::Binary)); return pHashTable; } MSHashTable *MSFormat::initEnumHashTable(void) { MSHashTable *pHashTable=new MSHashTable(64); pHashTable->notFound((unsigned long)0x0); // MSFloat pHashTable->add((unsigned long)MSFloat::Decimal0,(void *)"Decimal0"); pHashTable->add((unsigned long)MSFloat::Decimal1,(void *)"Decimal1"); pHashTable->add((unsigned long)MSFloat::Decimal2,(void *)"Decimal2"); pHashTable->add((unsigned long)MSFloat::Decimal3,(void *)"Decimal3"); pHashTable->add((unsigned long)MSFloat::Decimal4,(void *)"Decimal4"); pHashTable->add((unsigned long)MSFloat::Decimal5,(void *)"Decimal5"); pHashTable->add((unsigned long)MSFloat::Decimal6,(void *)"Decimal6"); pHashTable->add((unsigned long)MSFloat::Decimal7,(void *)"Decimal7"); pHashTable->add((unsigned long)MSFloat::Decimal8,(void *)"Decimal8"); pHashTable->add((unsigned long)MSFloat::CommaDecimal0,(void *)"CommaDecimal0"); pHashTable->add((unsigned long)MSFloat::CommaDecimal1,(void *)"CommaDecimal1"); pHashTable->add((unsigned long)MSFloat::CommaDecimal2,(void *)"CommaDecimal2"); pHashTable->add((unsigned long)MSFloat::CommaDecimal3,(void *)"CommaDecimal3"); pHashTable->add((unsigned long)MSFloat::CommaDecimal4,(void *)"CommaDecimal4"); pHashTable->add((unsigned long)MSFloat::CommaDecimal5,(void *)"CommaDecimal5"); pHashTable->add((unsigned long)MSFloat::CommaDecimal6,(void *)"CommaDecimal6"); pHashTable->add((unsigned long)MSFloat::CommaDecimal7,(void *)"CommaDecimal7"); pHashTable->add((unsigned long)MSFloat::CommaDecimal8,(void *)"CommaDecimal8"); pHashTable->add((unsigned long)MSFloat::MaximumPrecision,(void *)"MaximumPrecision"); pHashTable->add((unsigned long)MSFloat::Default,(void *)"Default"); // MSInt pHashTable->add((unsigned long)MSInt::WithoutCommas,(void *)"WithoutCommas"); pHashTable->add((unsigned long)MSInt::WithCommas,(void *)"WithCommas"); // MSDate pHashTable->add((unsigned long)MSDate::Slash,(void *)"Slash"); pHashTable->add((unsigned long)MSDate::Slash4,(void *)"Slash4"); pHashTable->add((unsigned long)MSDate::Terse,(void *)"Terse"); pHashTable->add((unsigned long)MSDate::Terse4,(void *)"Terse4"); pHashTable->add((unsigned long)MSDate::Long,(void *)"Long"); pHashTable->add((unsigned long)MSDate::MonthYear,(void *)"MonthYear"); pHashTable->add((unsigned long)MSDate::YearMonthDay,(void *)"YearMonthDay"); pHashTable->add((unsigned long)MSDate::Year2MonthDay,(void *)"Year2MonthDay"); pHashTable->add((unsigned long)MSDate::EuropeanDot,(void *)"EuropeanDot"); pHashTable->add((unsigned long)MSDate::EuropeanDot4,(void *)"EuropeanDot4"); pHashTable->add((unsigned long)MSDate::Database,(void *)"Database"); pHashTable->add((unsigned long)MSDate::Julian,(void *)"Julian"); // MSTime pHashTable->add((unsigned long)MSTime::HoursMinutesSeconds,(void *)"HoursMinutesSeconds"); pHashTable->add((unsigned long)MSTime::MonthDayYear,(void *)"MonthDayYear"); pHashTable->add((unsigned long)MSTime::HoursMinutesSecondsSlash,(void *)"HoursMinutesSecondsSlash"); pHashTable->add((unsigned long)MSTime::HoursMinutesSecondsSlashZone,(void *)"HoursMinutesSecondsSlashZone"); pHashTable->add((unsigned long)MSTime::HoursMinutesSecondsSlash4,(void *)"HoursMinutesSecondsSlash4"); pHashTable->add((unsigned long)MSTime::HoursMinutesSecondsSlash4Zone,(void *)"HoursMinutesSecondsSlash4Zone"); pHashTable->add((unsigned long)MSTime::CalendarTime,(void *)"CalendarTime"); // MSMoney pHashTable->add((unsigned long)MSMoney::CurrencyPrecision,(void *)"CurrencyPrecision"); pHashTable->add((unsigned long)MSMoney::CommaCurrencyPrecision,(void *)"CommaCurrencyPrecision"); pHashTable->add((unsigned long)MSMoney::Eights,(void *)"Eights"); pHashTable->add((unsigned long)MSMoney::Sixteenths,(void *)"Sixteenths"); pHashTable->add((unsigned long)MSMoney::ThirtySeconds,(void *)"ThirtySeconds"); pHashTable->add((unsigned long)MSMoney::SixtyForths,(void *)"SixtyForths"); pHashTable->add((unsigned long)MSMoney::OneTwentyEights,(void *)"OneTwentyEights"); pHashTable->add((unsigned long)MSMoney::TwoFiftySixths,(void *)"TwoFiftySixths"); // MSRate pHashTable->add((unsigned long)MSRate::Percent0,(void *)"Percent0"); pHashTable->add((unsigned long)MSRate::Percent1,(void *)"Percent1"); pHashTable->add((unsigned long)MSRate::Percent2,(void *)"Percent2"); pHashTable->add((unsigned long)MSRate::Percent3,(void *)"Percent3"); pHashTable->add((unsigned long)MSRate::Percent4,(void *)"Percent4"); pHashTable->add((unsigned long)MSRate::Percent5,(void *)"Percent5"); pHashTable->add((unsigned long)MSRate::BasisPoint,(void *)"BasisPoint"); // MSTerm pHashTable->add((unsigned long)MSTerm::YearMonthDay,(void *)"YearsMonthsDays"); pHashTable->add((unsigned long)MSTerm::YearMonthDayPad,(void *)"YearsMonthsDaysPad"); pHashTable->add((unsigned long)MSTerm::YearMonthDayNoPad,(void *)"YearsMonthsDaysNoPad"); // MSBool pHashTable->add((unsigned long)MSBool::YesAndNo,(void *)"YesAndNo"); pHashTable->add((unsigned long)MSBool::TrueAndFalse,(void *)"TrueAndFalse"); pHashTable->add((unsigned long)MSBool::Binary,(void *)"Binary"); return pHashTable; } MSHashTable *MSFormat::initModifierHashTable(void) { MSHashTable *pHashTable=new MSHashTable(16); pHashTable->notFound((unsigned long)NoModifier); pHashTable->add("NoModifier",(void *)NoModifier); pHashTable->add("UpperCaseK",(void *)UpperCaseK); pHashTable->add("LowerCaseK",(void *)LowerCaseK); pHashTable->add("UpperCaseM",(void *)UpperCaseM); pHashTable->add("LowerCaseM",(void *)LowerCaseM); pHashTable->add("Parenthesis",(void *)Parenthesis); return pHashTable; } MSBoolean MSFormat::operator==(const MSFormat& aFormat_) const { return MSBoolean(_formatType==aFormat_._formatType&&_formatModifier==aFormat_._formatModifier &&_format._any==aFormat_._format._any); } MSBoolean MSFormat::operator!=(const MSFormat& aFormat_) const { if (_formatType!=aFormat_._formatType) return MSTrue; else if (_formatModifier!=aFormat_._formatModifier) return MSTrue; else if (_format._any!=aFormat_._format._any) return MSTrue; return MSFalse; } MSBoolean MSFormat::operator==(MSBool::MSBoolFormat format_) const { return MSBoolean(_formatType==MSFormat::FBool&&_format._bool==format_); } MSBoolean MSFormat::operator==(MSDate::MSDateFormat format_) const { return MSBoolean(_formatType==MSFormat::Date&&_format._date==format_); } MSBoolean MSFormat::operator==(MSFloat::MSFloatFormat format_) const { return MSBoolean(_formatType==MSFormat::Float&&_format._float==format_); } MSBoolean MSFormat::operator==(MSInt::MSIntFormat format_) const { return MSBoolean(_formatType==MSFormat::Int&&_format._int==format_); } MSBoolean MSFormat::operator==(MSMoney::MSMoneyFormat format_) const { return MSBoolean(_formatType==MSFormat::Money&&_format._money==format_); } MSBoolean MSFormat::operator==(MSRate::MSRateFormat format_) const { return MSBoolean(_formatType==MSFormat::Rate&&_format._rate==format_); } MSBoolean MSFormat::operator==(MSTerm::MSTermFormat format_) const { return MSBoolean(_formatType==MSFormat::Term&&_format._term==format_); } MSBoolean MSFormat::operator==(MSTime::MSTimeFormat format_) const { return MSBoolean(_formatType==MSFormat::Time&&_format._time==format_); } const MSStringVector& MSFormat::boolFormats(void) { static MSStringVector formats ("YesAndNo\n"\ "TrueAndFalse\n"\ "Binary"); return formats; } const MSStringVector& MSFormat::dateFormats(void) { static MSStringVector formats ("Slash\n"\ "Slash4\n"\ "Terse\n"\ "Terse4\n"\ "Long\n"\ "MonthYear\n"\ "YearMonthDay\n"\ "Year2MonthDay\n"\ "EuropeanDot\n"\ "EuropeanDot4\n"\ "Database\n"\ "Julian"); return formats; } const MSStringVector& MSFormat::floatFormats(void) { static MSStringVector formats ("Decimal0\n"\ "Decimal1\n"\ "Decimal2\n"\ "Decimal3\n"\ "Decimal4\n"\ "Decimal5\n"\ "Decimal6\n"\ "Decimal7\n"\ "Decimal8\n"\ "CommaDecimal0\n"\ "CommaDecimal1\n"\ "CommaDecimal2\n"\ "CommaDecimal3\n"\ "CommaDecimal4\n"\ "CommaDecimal5\n"\ "CommaDecimal6\n"\ "CommaDecimal7\n"\ "CommaDecimal8\n"\ "MaximumPrecision\n"\ "Default"); return formats; } const MSStringVector& MSFormat::intFormats(void) { static MSStringVector formats ("WithoutCommas\n"\ "WithCommas"); return formats; } const MSStringVector& MSFormat::moneyFormats(void) { static MSStringVector formats ("CurrencyPrecision\n"\ "CommaCurrencyPrecision\n"\ "Eights\n"\ "Sixteenths\n"\ "ThirtySeconds\n"\ "SixtyForths\n"\ "OneTwentyEights\n"\ "TwoFiftySixths\n"\ "Tenths\n"\ "Hundredths\n"\ "Thousandths\n"\ "TenThousandths\n"\ "HundredThousandths\n"\ "Millionths\n"\ "TenMillionths\n"\ "HundredMillionths"); return formats; } const MSStringVector& MSFormat::rateFormats(void) { static MSStringVector formats ("Percent0\n"\ "Percent1\n"\ "Percent2\n"\ "Percent3\n"\ "Percent4\n"\ "Percent5\n"\ "BasisPoint"); return formats; } const MSStringVector& MSFormat::termFormats(void) { static MSStringVector formats( "YearsMonthsDays\n"\ "YearsMonthsDaysPad\n"\ "YearsMonthsDaysNoPad"); return formats; } const MSStringVector& MSFormat::timeFormats(void) { static MSStringVector formats ("HoursMinutesSeconds\n"\ "MonthDayYear\n"\ "HoursMinutesSecondsSlash\n"\ "HoursMinutesSecondsSlashZone\n"\ "HoursMinutesSecondsSlash4\n"\ "HoursMinutesSecondsSlash4Zone\n"\ "CalendarTime"); return formats; } const MSStringVector& MSFormat::noFormats(void) { static MSStringVector formats; return formats; } const MSStringVector& MSFormat::modifiers(void) { static MSStringVector formats ("NoModifier\n"\ "UpperCaseK\n"\ "LowerCaseK\n"\ "UpperCaseM\n"\ "LowerCaseM\n"\ "Parenthesis"); return formats; } const MSHashTable *MSFormat::formatHashTable(void) { static MSHashTable *hashTable = initFormatHashTable(); return hashTable; } const MSHashTable *MSFormat::enumHashTable(void) { static MSHashTable *hashTable = initEnumHashTable(); return hashTable; } const MSHashTable *MSFormat::modifierHashTable(void) { static MSHashTable *hashTable = initModifierHashTable(); return hashTable; } aplus-fsf-4.22/src/MSTypes/MSFractionTables.C0000644000265000001440000006243410772770445014443 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include FractionTable EightsTable= { 16, { {(0.0/16.0),""},{(1.0/16.0),"1/8"},{(2.0/16.0),"1/8"},{(3.0/16.0),"1/4"}, {(4.0/16.0),"1/4"},{(5.0/16.0),"3/8"},{(6.0/16.0),"3/8"},{(7.0/16.0),"1/2"}, {(8.0/16.0),"1/2"},{(9.0/16.0),"5/8"},{(10.0/16.0),"5/8"},{(11.0/16.0),"3/4"}, {(12.0/16.0),"3/4"},{(13.0/16.0),"7/8"},{(14.0/16.0),"7/8"},{(15.0/16.0),"1/1"}, } }; FractionTable SixteenthsTable= { 32, { {(0.0/32.0),""},{(1.0/32.0),"1/16"},{(2.0/32.0),"1/16"},{(3.0/32.0),"1/8"}, {(4.0/32.0),"1/8"},{(5.0/32.0),"3/16"},{(6.0/32.0),"3/16"},{(7.0/32.0),"1/4"}, {(8.0/32.0),"1/4"},{(9.0/32.0),"5/16"},{(10.0/32.0),"5/16"},{(11.0/32.0),"3/8"}, {(12.0/32.0),"3/8"},{(13.0/32.0),"7/16"},{(14.0/32.0),"7/16"},{(15.0/32.0),"1/2"}, {(16.0/32.0),"1/2"},{(17.0/32.0),"9/16"},{(18.0/32.0),"9/16"},{(19.0/32.0),"5/8"}, {(20.0/32.0),"5/8"},{(21.0/32.0),"11/16"},{(22.0/32.0),"11/16"},{(23.0/32.0),"3/4"}, {(24.0/32.0),"3/4"},{(25.0/32.0),"13/16"},{(26.0/32.0),"13/16"},{(27.0/32.0),"7/8"}, {(28.0/32.0),"7/8"},{(29.0/32.0),"15/16"},{(30.0/32.0),"15/16"},{(31.0/32.0),"1/1"} } }; FractionTable ThirtySecondsTable= { 64, { {(0.0/64.0),""},{(1.0/64.0),"1/32"},{(2.0/64.0),"1/32"},{(3.0/64.0),"1/16"}, {(4.0/64.0),"1/16"},{(5.0/64.0),"3/32"},{(6.0/64.0),"3/32"},{(7.0/64.0),"1/8"}, {(8.0/64.0),"1/8"},{(9.0/64.0),"5/32"},{(10.0/64.0),"5/32"},{(11.0/64.0),"3/16"}, {(12.0/64.0),"3/16"},{(13.0/64.0),"7/32"},{(14.0/64.0),"7/32"},{(15.0/64.0),"1/4"}, {(16.0/64.0),"1/4"},{(17.0/64.0),"9/32"},{(18.0/64.0),"9/32"},{(19.0/64.0),"5/16"}, {(20.0/64.0),"5/16"},{(21.0/64.0),"11/32"},{(22.0/64.0),"11/32"},{(23.0/64.0),"3/8"}, {(24.0/64.0),"3/8"},{(25.0/64.0),"13/32"},{(26.0/64.0),"13/32"},{(27.0/64.0),"7/16"}, {(28.0/64.0),"7/16"},{(29.0/64.0),"15/32"},{(30.0/64.0),"15/32"},{(31.0/64.0),"1/2"}, {(32.0/64.0),"1/2"},{(33.0/64.0),"17/32"},{(34.0/64.0),"17/32"},{(35.0/64.0),"9/16"}, {(36.0/64.0),"9/16"},{(37.0/64.0),"19/32"},{(38.0/64.0),"19/32"},{(39.0/64.0),"5/8"}, {(40.0/64.0),"5/8"},{(41.0/64.0),"21/32"},{(42.0/64.0),"21/32"},{(43.0/64.0),"11/16"}, {(44.0/64.0),"11/16"},{(45.0/64.0),"23/32"},{(46.0/64.0),"23/32"},{(47.0/64.0),"3/4"}, {(48.0/64.0),"3/4"},{(49.0/64.0),"25/32"},{(50.0/64.0),"25/32"},{(51.0/64.0),"13/16"}, {(52.0/64.0),"13/16"},{(53.0/64.0),"27/32"},{(54.0/64.0),"27/32"},{(55.0/64.0),"7/8"}, {(56.0/64.0),"7/8"},{(57.0/64.0),"29/32"},{(58.0/64.0),"29/32"},{(59.0/64.0),"15/16"}, {(60.0/64.0),"15/16"},{(61.0/64.0),"31/32"},{(62.0/64.0),"31/32"},{(63.0/64.0),"1/1"}, } }; FractionTable SixtyForthsTable= { 128, { {(0.0/128.0),""},{(1.0/128.0),"1/64"},{(2.0/128.0),"1/64"},{(3.0/128.0),"1/32"}, {(4.0/128.0),"1/32"},{(5.0/128.0),"3/64"},{(6.0/128.0),"3/64"},{(7.0/128.0),"1/16"}, {(8.0/128.0),"1/16"},{(9.0/128.0),"5/64"},{(10.0/128.0),"5/64"},{(11.0/128.0),"3/32"}, {(12.0/128.0),"3/32"},{(13.0/128.0),"7/64"},{(14.0/128.0),"7/64"},{(15.0/128.0),"1/8"}, {(16.0/128.0),"1/8"},{(17.0/128.0),"9/64"},{(18.0/128.0),"9/64"},{(19.0/128.0),"5/32"}, {(20.0/128.0),"5/32"},{(21.0/128.0),"11/64"},{(22.0/128.0),"11/64"},{(23.0/128.0),"3/16"}, {(24.0/128.0),"3/16"},{(25.0/128.0),"13/64"},{(26.0/128.0),"13/64"},{(27.0/128.0),"7/32"}, {(28.0/128.0),"7/32"},{(29.0/128.0),"15/64"},{(30.0/128.0),"15/64"},{(31.0/128.0),"1/4"}, {(32.0/128.0),"1/4"},{(33.0/128.0),"17/64"},{(34.0/128.0),"17/64"},{(35.0/128.0),"9/32"}, {(36.0/128.0),"9/32"},{(37.0/128.0),"19/64"},{(38.0/128.0),"19/64"},{(39.0/128.0),"5/16"}, {(40.0/128.0),"5/16"},{(41.0/128.0),"21/64"},{(42.0/128.0),"21/64"},{(43.0/128.0),"11/32"}, {(44.0/128.0),"11/32"},{(45.0/128.0),"23/64"},{(46.0/128.0),"23/64"},{(47.0/128.0),"3/8"}, {(48.0/128.0),"3/8"},{(49.0/128.0),"25/64"},{(50.0/128.0),"25/64"},{(51.0/128.0),"13/32"}, {(52.0/128.0),"13/32"},{(53.0/128.0),"27/64"},{(54.0/128.0),"27/64"},{(55.0/128.0),"7/16"}, {(56.0/128.0),"7/16"},{(57.0/128.0),"29/64"},{(58.0/128.0),"29/64"},{(59.0/128.0),"15/32"}, {(60.0/128.0),"15/32"},{(61.0/128.0),"31/64"},{(62.0/128.0),"31/64"},{(63.0/128.0),"1/2"}, {(64.0/128.0),"1/2"},{(65.0/128.0),"33/64"},{(66.0/128.0),"33/64"},{(67.0/128.0),"17/32"}, {(68.0/128.0),"17/32"},{(69.0/128.0),"35/64"},{(70.0/128.0),"35/64"},{(71.0/128.0),"9/16"}, {(72.0/128.0),"9/16"},{(73.0/128.0),"37/64"},{(74.0/128.0),"37/64"},{(75.0/128.0),"19/32"}, {(76.0/128.0),"19/32"},{(77.0/128.0),"39/64"},{(78.0/128.0),"39/64"},{(79.0/128.0),"5/8"}, {(80.0/128.0),"5/8"},{(81.0/128.0),"41/64"},{(82.0/128.0),"41/64"},{(83.0/128.0),"21/32"}, {(84.0/128.0),"21/32"},{(85.0/128.0),"43/64"},{(86.0/128.0),"43/64"},{(87.0/128.0),"11/16"}, {(88.0/128.0),"11/16"},{(89.0/128.0),"45/64"},{(90.0/128.0),"45/64"},{(91.0/128.0),"23/32"}, {(92.0/128.0),"23/32"},{(93.0/128.0),"47/64"},{(94.0/128.0),"47/64"},{(95.0/128.0),"3/4"}, {(96.0/128.0),"3/4"},{(97.0/128.0),"49/64"},{(98.0/128.0),"49/64"},{(99.0/128.0),"25/32"}, {(100.0/128.0),"25/32"},{(101.0/128.0),"51/64"},{(102.0/128.0),"51/64"},{(103.0/128.0),"13/16"}, {(104.0/128.0),"13/16"},{(105.0/128.0),"53/64"},{(106.0/128.0),"53/64"},{(107.0/128.0),"27/32"}, {(108.0/128.0),"27/32"},{(109.0/128.0),"55/64"},{(110.0/128.0),"55/64"},{(111.0/128.0),"7/8"}, {(112.0/128.0),"7/8"},{(113.0/128.0),"57/64"},{(114.0/128.0),"57/64"},{(115.0/128.0),"29/32"}, {(116.0/128.0),"29/32"},{(117.0/128.0),"59/64"},{(118.0/128.0),"59/64"},{(119.0/128.0),"15/16"}, {(120.0/128.0),"15/16"},{(121.0/128.0),"61/64"},{(122.0/128.0),"61/64"},{(123.0/128.0),"31/32"}, {(124.0/128.0),"31/32"},{(125.0/128.0),"63/64"},{(126.0/128.0),"63/64"},{(127.0/128.0),"1/1"}, } }; FractionTable OneTwentyEightsTable= { 256, { {(0.0/256.0),""},{(1.0/256.0),"1/128"},{(2.0/256.0),"1/128"},{(3.0/256.0),"1/64"}, {(4.0/256.0),"1/64"},{(5.0/256.0),"3/128"},{(6.0/256.0),"3/128"},{(7.0/256.0),"1/32"}, {(8.0/256.0),"1/32"},{(9.0/256.0),"5/128"},{(10.0/256.0),"5/128"},{(11.0/256.0),"3/64"}, {(12.0/256.0),"3/64"},{(13.0/256.0),"7/128"},{(14.0/256.0),"7/128"},{(15.0/256.0),"1/16"}, {(16.0/256.0),"1/16"},{(17.0/256.0),"9/128"},{(18.0/256.0),"9/128"},{(19.0/256.0),"5/64"}, {(20.0/256.0),"5/64"},{(21.0/256.0),"11/128"},{(22.0/256.0),"11/128"},{(23.0/256.0),"3/32"}, {(24.0/256.0),"3/32"},{(25.0/256.0),"13/128"},{(26.0/256.0),"13/128"},{(27.0/256.0),"7/64"}, {(28.0/256.0),"7/64"},{(29.0/256.0),"15/128"},{(30.0/256.0),"15/128"},{(31.0/256.0),"1/8"}, {(32.0/256.0),"1/8"},{(33.0/256.0),"17/128"},{(34.0/256.0),"17/128"},{(35.0/256.0),"9/64"}, {(36.0/256.0),"9/64"},{(37.0/256.0),"19/128"},{(38.0/256.0),"19/128"},{(39.0/256.0),"5/32"}, {(40.0/256.0),"5/32"},{(41.0/256.0),"21/128"},{(42.0/256.0),"21/128"},{(43.0/256.0),"11/64"}, {(44.0/256.0),"11/64"},{(45.0/256.0),"23/128"},{(46.0/256.0),"23/128"},{(47.0/256.0),"3/16"}, {(48.0/256.0),"3/16"},{(49.0/256.0),"25/128"},{(50.0/256.0),"25/128"},{(51.0/256.0),"13/64"}, {(52.0/256.0),"13/64"},{(53.0/256.0),"27/128"},{(54.0/256.0),"27/128"},{(55.0/256.0),"7/32"}, {(56.0/256.0),"7/32"},{(57.0/256.0),"29/128"},{(58.0/256.0),"29/128"},{(59.0/256.0),"15/64"}, {(60.0/256.0),"15/64"},{(61.0/256.0),"31/128"},{(62.0/256.0),"31/128"},{(63.0/256.0),"1/4"}, {(64.0/256.0),"1/4"},{(65.0/256.0),"33/128"},{(66.0/256.0),"33/128"},{(67.0/256.0),"17/64"}, {(68.0/256.0),"17/64"},{(69.0/256.0),"35/128"},{(70.0/256.0),"35/128"},{(71.0/256.0),"9/32"}, {(72.0/256.0),"9/32"},{(73.0/256.0),"37/128"},{(74.0/256.0),"37/128"},{(75.0/256.0),"19/64"}, {(76.0/256.0),"19/64"},{(77.0/256.0),"39/128"},{(78.0/256.0),"39/128"},{(79.0/256.0),"5/16"}, {(80.0/256.0),"5/16"},{(81.0/256.0),"41/128"},{(82.0/256.0),"41/128"},{(83.0/256.0),"21/64"}, {(84.0/256.0),"21/64"},{(85.0/256.0),"43/128"},{(86.0/256.0),"43/128"},{(87.0/256.0),"11/32"}, {(88.0/256.0),"11/32"},{(89.0/256.0),"45/128"},{(90.0/256.0),"45/128"},{(91.0/256.0),"23/64"}, {(92.0/256.0),"23/64"},{(93.0/256.0),"47/128"},{(94.0/256.0),"47/128"},{(95.0/256.0),"3/8"}, {(96.0/256.0),"3/8"},{(97.0/256.0),"49/128"},{(98.0/256.0),"49/128"},{(99.0/256.0),"25/64"}, {(100.0/256.0),"25/64"},{(101.0/256.0),"51/128"},{(102.0/256.0),"51/128"},{(103.0/256.0),"13/32"}, {(104.0/256.0),"13/32"},{(105.0/256.0),"53/128"},{(106.0/256.0),"53/128"},{(107.0/256.0),"27/64"}, {(108.0/256.0),"27/64"},{(109.0/256.0),"55/128"},{(110.0/256.0),"55/128"},{(111.0/256.0),"7/16"}, {(112.0/256.0),"7/16"},{(113.0/256.0),"57/128"},{(114.0/256.0),"57/128"},{(115.0/256.0),"29/64"}, {(116.0/256.0),"29/64"},{(117.0/256.0),"59/128"},{(118.0/256.0),"59/128"},{(119.0/256.0),"15/32"}, {(120.0/256.0),"15/32"},{(121.0/256.0),"61/128"},{(122.0/256.0),"61/128"},{(123.0/256.0),"31/64"}, {(124.0/256.0),"31/64"},{(125.0/256.0),"63/128"},{(126.0/256.0),"63/128"},{(127.0/256.0),"1/2"}, {(128.0/256.0),"1/2"},{(129.0/256.0),"65/128"},{(130.0/256.0),"65/128"},{(131.0/256.0),"33/64"}, {(132.0/256.0),"33/64"},{(133.0/256.0),"67/128"},{(134.0/256.0),"67/128"},{(135.0/256.0),"17/32"}, {(136.0/256.0),"17/32"},{(137.0/256.0),"69/128"},{(138.0/256.0),"69/128"},{(139.0/256.0),"35/64"}, {(140.0/256.0),"35/64"},{(141.0/256.0),"71/128"},{(142.0/256.0),"71/128"},{(143.0/256.0),"9/16"}, {(144.0/256.0),"9/16"},{(145.0/256.0),"73/128"},{(146.0/256.0),"73/128"},{(147.0/256.0),"37/64"}, {(148.0/256.0),"37/64"},{(149.0/256.0),"75/128"},{(150.0/256.0),"75/128"},{(151.0/256.0),"19/32"}, {(152.0/256.0),"19/32"},{(153.0/256.0),"77/128"},{(154.0/256.0),"77/128"},{(155.0/256.0),"39/64"}, {(156.0/256.0),"39/64"},{(157.0/256.0),"79/128"},{(158.0/256.0),"79/128"},{(159.0/256.0),"5/8"}, {(160.0/256.0),"5/8"},{(161.0/256.0),"81/128"},{(162.0/256.0),"81/128"},{(163.0/256.0),"41/64"}, {(164.0/256.0),"41/64"},{(165.0/256.0),"83/128"},{(166.0/256.0),"83/128"},{(167.0/256.0),"21/32"}, {(168.0/256.0),"21/32"},{(169.0/256.0),"85/128"},{(170.0/256.0),"85/128"},{(171.0/256.0),"43/64"}, {(172.0/256.0),"43/64"},{(173.0/256.0),"87/128"},{(174.0/256.0),"87/128"},{(175.0/256.0),"11/16"}, {(176.0/256.0),"11/16"},{(177.0/256.0),"89/128"},{(178.0/256.0),"89/128"},{(179.0/256.0),"45/64"}, {(180.0/256.0),"45/64"},{(181.0/256.0),"91/128"},{(182.0/256.0),"91/128"},{(183.0/256.0),"23/32"}, {(184.0/256.0),"23/32"},{(185.0/256.0),"93/128"},{(186.0/256.0),"93/128"},{(187.0/256.0),"47/64"}, {(188.0/256.0),"47/64"},{(189.0/256.0),"95/128"},{(190.0/256.0),"95/128"},{(191.0/256.0),"3/4"}, {(192.0/256.0),"3/4"},{(193.0/256.0),"97/128"},{(194.0/256.0),"97/128"},{(195.0/256.0),"49/64"}, {(196.0/256.0),"49/64"},{(197.0/256.0),"99/128"},{(198.0/256.0),"99/128"},{(199.0/256.0),"25/32"}, {(200.0/256.0),"25/32"},{(201.0/256.0),"101/128"},{(202.0/256.0),"101/128"},{(203.0/256.0),"51/64"}, {(204.0/256.0),"51/64"},{(205.0/256.0),"103/128"},{(206.0/256.0),"103/128"},{(207.0/256.0),"13/16"}, {(208.0/256.0),"13/16"},{(209.0/256.0),"105/128"},{(210.0/256.0),"105/128"},{(211.0/256.0),"53/64"}, {(212.0/256.0),"53/64"},{(213.0/256.0),"107/128"},{(214.0/256.0),"107/128"},{(215.0/256.0),"27/32"}, {(216.0/256.0),"27/32"},{(217.0/256.0),"109/128"},{(218.0/256.0),"109/128"},{(219.0/256.0),"55/64"}, {(220.0/256.0),"55/64"},{(221.0/256.0),"111/128"},{(222.0/256.0),"111/128"},{(223.0/256.0),"7/8"}, {(224.0/256.0),"7/8"},{(225.0/256.0),"113/128"},{(226.0/256.0),"113/128"},{(227.0/256.0),"57/64"}, {(228.0/256.0),"57/64"},{(229.0/256.0),"115/128"},{(230.0/256.0),"115/128"},{(231.0/256.0),"29/32"}, {(232.0/256.0),"29/32"},{(233.0/256.0),"117/128"},{(234.0/256.0),"117/128"},{(235.0/256.0),"59/64"}, {(236.0/256.0),"59/64"},{(237.0/256.0),"119/128"},{(238.0/256.0),"119/128"},{(239.0/256.0),"15/16"}, {(240.0/256.0),"15/16"},{(241.0/256.0),"121/128"},{(242.0/256.0),"121/128"},{(243.0/256.0),"61/64"}, {(244.0/256.0),"61/64"},{(245.0/256.0),"123/128"},{(246.0/256.0),"123/128"},{(247.0/256.0),"31/32"}, {(248.0/256.0),"31/32"},{(249.0/256.0),"125/128"},{(250.0/256.0),"125/128"},{(251.0/256.0),"63/64"}, {(252.0/256.0),"63/64"},{(253.0/256.0),"127/128"},{(254.0/256.0),"127/128"},{(255.0/256.0),"1/1"}, } }; FractionTable TwoFiftySixthsTable= { 512, { {(0.0/512.0),""},{(1.0/512.0),"1/256"},{(2.0/512.0),"1/256"},{(3.0/512.0),"1/128"}, {(4.0/512.0),"1/128"},{(5.0/512.0),"3/256"},{(6.0/512.0),"3/256"},{(7.0/512.0),"1/64"}, {(8.0/512.0),"1/64"},{(9.0/512.0),"5/256"},{(10.0/512.0),"5/256"},{(11.0/512.0),"3/128"}, {(12.0/512.0),"3/128"},{(13.0/512.0),"7/256"},{(14.0/512.0),"7/256"},{(15.0/512.0),"1/32"}, {(16.0/512.0),"1/32"},{(17.0/512.0),"9/256"},{(18.0/512.0),"9/256"},{(19.0/512.0),"5/128"}, {(20.0/512.0),"5/128"},{(21.0/512.0),"11/256"},{(22.0/512.0),"11/256"},{(23.0/512.0),"3/64"}, {(24.0/512.0),"3/64"},{(25.0/512.0),"13/256"},{(26.0/512.0),"13/256"},{(27.0/512.0),"7/128"}, {(28.0/512.0),"7/128"},{(29.0/512.0),"15/256"},{(30.0/512.0),"15/256"},{(31.0/512.0),"1/16"}, {(32.0/512.0),"1/16"},{(33.0/512.0),"17/256"},{(34.0/512.0),"17/256"},{(35.0/512.0),"9/128"}, {(36.0/512.0),"9/128"},{(37.0/512.0),"19/256"},{(38.0/512.0),"19/256"},{(39.0/512.0),"5/64"}, {(40.0/512.0),"5/64"},{(41.0/512.0),"21/256"},{(42.0/512.0),"21/256"},{(43.0/512.0),"11/128"}, {(44.0/512.0),"11/128"},{(45.0/512.0),"23/256"},{(46.0/512.0),"23/256"},{(47.0/512.0),"3/32"}, {(48.0/512.0),"3/32"},{(49.0/512.0),"25/256"},{(50.0/512.0),"25/256"},{(51.0/512.0),"13/128"}, {(52.0/512.0),"13/128"},{(53.0/512.0),"27/256"},{(54.0/512.0),"27/256"},{(55.0/512.0),"7/64"}, {(56.0/512.0),"7/64"},{(57.0/512.0),"29/256"},{(58.0/512.0),"29/256"},{(59.0/512.0),"15/128"}, {(60.0/512.0),"15/128"},{(61.0/512.0),"31/256"},{(62.0/512.0),"31/256"},{(63.0/512.0),"1/8"}, {(64.0/512.0),"1/8"},{(65.0/512.0),"33/256"},{(66.0/512.0),"33/256"},{(67.0/512.0),"17/128"}, {(68.0/512.0),"17/128"},{(69.0/512.0),"35/256"},{(70.0/512.0),"35/256"},{(71.0/512.0),"9/64"}, {(72.0/512.0),"9/64"},{(73.0/512.0),"37/256"},{(74.0/512.0),"37/256"},{(75.0/512.0),"19/128"}, {(76.0/512.0),"19/128"},{(77.0/512.0),"39/256"},{(78.0/512.0),"39/256"},{(79.0/512.0),"5/32"}, {(80.0/512.0),"5/32"},{(81.0/512.0),"41/256"},{(82.0/512.0),"41/256"},{(83.0/512.0),"21/128"}, {(84.0/512.0),"21/128"},{(85.0/512.0),"43/256"},{(86.0/512.0),"43/256"},{(87.0/512.0),"11/64"}, {(88.0/512.0),"11/64"},{(89.0/512.0),"45/256"},{(90.0/512.0),"45/256"},{(91.0/512.0),"23/128"}, {(92.0/512.0),"23/128"},{(93.0/512.0),"47/256"},{(94.0/512.0),"47/256"},{(95.0/512.0),"3/16"}, {(96.0/512.0),"3/16"},{(97.0/512.0),"49/256"},{(98.0/512.0),"49/256"},{(99.0/512.0),"25/128"}, {(100.0/512.0),"25/128"},{(101.0/512.0),"51/256"},{(102.0/512.0),"51/256"},{(103.0/512.0),"13/64"}, {(104.0/512.0),"13/64"},{(105.0/512.0),"53/256"},{(106.0/512.0),"53/256"},{(107.0/512.0),"27/128"}, {(108.0/512.0),"27/128"},{(109.0/512.0),"55/256"},{(110.0/512.0),"55/256"},{(111.0/512.0),"7/32"}, {(112.0/512.0),"7/32"},{(113.0/512.0),"57/256"},{(114.0/512.0),"57/256"},{(115.0/512.0),"29/128"}, {(116.0/512.0),"29/128"},{(117.0/512.0),"59/256"},{(118.0/512.0),"59/256"},{(119.0/512.0),"15/64"}, {(120.0/512.0),"15/64"},{(121.0/512.0),"61/256"},{(122.0/512.0),"61/256"},{(123.0/512.0),"31/128"}, {(124.0/512.0),"31/128"},{(125.0/512.0),"63/256"},{(126.0/512.0),"63/256"},{(127.0/512.0),"1/4"}, {(128.0/512.0),"1/4"},{(129.0/512.0),"65/256"},{(130.0/512.0),"65/256"},{(131.0/512.0),"33/128"}, {(132.0/512.0),"33/128"},{(133.0/512.0),"67/256"},{(134.0/512.0),"67/256"},{(135.0/512.0),"17/64"}, {(136.0/512.0),"17/64"},{(137.0/512.0),"69/256"},{(138.0/512.0),"69/256"},{(139.0/512.0),"35/128"}, {(140.0/512.0),"35/128"},{(141.0/512.0),"71/256"},{(142.0/512.0),"71/256"},{(143.0/512.0),"9/32"}, {(144.0/512.0),"9/32"},{(145.0/512.0),"73/256"},{(146.0/512.0),"73/256"},{(147.0/512.0),"37/128"}, {(148.0/512.0),"37/128"},{(149.0/512.0),"75/256"},{(150.0/512.0),"75/256"},{(151.0/512.0),"19/64"}, {(152.0/512.0),"19/64"},{(153.0/512.0),"77/256"},{(154.0/512.0),"77/256"},{(155.0/512.0),"39/128"}, {(156.0/512.0),"39/128"},{(157.0/512.0),"79/256"},{(158.0/512.0),"79/256"},{(159.0/512.0),"5/16"}, {(160.0/512.0),"5/16"},{(161.0/512.0),"81/256"},{(162.0/512.0),"81/256"},{(163.0/512.0),"41/128"}, {(164.0/512.0),"41/128"},{(165.0/512.0),"83/256"},{(166.0/512.0),"83/256"},{(167.0/512.0),"21/64"}, {(168.0/512.0),"21/64"},{(169.0/512.0),"85/256"},{(170.0/512.0),"85/256"},{(171.0/512.0),"43/128"}, {(172.0/512.0),"43/128"},{(173.0/512.0),"87/256"},{(174.0/512.0),"87/256"},{(175.0/512.0),"11/32"}, {(176.0/512.0),"11/32"},{(177.0/512.0),"89/256"},{(178.0/512.0),"89/256"},{(179.0/512.0),"45/128"}, {(180.0/512.0),"45/128"},{(181.0/512.0),"91/256"},{(182.0/512.0),"91/256"},{(183.0/512.0),"23/64"}, {(184.0/512.0),"23/64"},{(185.0/512.0),"93/256"},{(186.0/512.0),"93/256"},{(187.0/512.0),"47/128"}, {(188.0/512.0),"47/128"},{(189.0/512.0),"95/256"},{(190.0/512.0),"95/256"},{(191.0/512.0),"3/8"}, {(192.0/512.0),"3/8"},{(193.0/512.0),"97/256"},{(194.0/512.0),"97/256"},{(195.0/512.0),"49/128"}, {(196.0/512.0),"49/128"},{(197.0/512.0),"99/256"},{(198.0/512.0),"99/256"},{(199.0/512.0),"25/64"}, {(200.0/512.0),"25/64"},{(201.0/512.0),"101/256"},{(202.0/512.0),"101/256"},{(203.0/512.0),"51/128"}, {(204.0/512.0),"51/128"},{(205.0/512.0),"103/256"},{(206.0/512.0),"103/256"},{(207.0/512.0),"13/32"}, {(208.0/512.0),"13/32"},{(209.0/512.0),"105/256"},{(210.0/512.0),"105/256"},{(211.0/512.0),"53/128"}, {(212.0/512.0),"53/128"},{(213.0/512.0),"107/256"},{(214.0/512.0),"107/256"},{(215.0/512.0),"27/64"}, {(216.0/512.0),"27/64"},{(217.0/512.0),"109/256"},{(218.0/512.0),"109/256"},{(219.0/512.0),"55/128"}, {(220.0/512.0),"55/128"},{(221.0/512.0),"111/256"},{(222.0/512.0),"111/256"},{(223.0/512.0),"7/16"}, {(224.0/512.0),"7/16"},{(225.0/512.0),"113/256"},{(226.0/512.0),"113/256"},{(227.0/512.0),"57/128"}, {(228.0/512.0),"57/128"},{(229.0/512.0),"115/256"},{(230.0/512.0),"115/256"},{(231.0/512.0),"29/64"}, {(232.0/512.0),"29/64"},{(233.0/512.0),"117/256"},{(234.0/512.0),"117/256"},{(235.0/512.0),"59/128"}, {(236.0/512.0),"59/128"},{(237.0/512.0),"119/256"},{(238.0/512.0),"119/256"},{(239.0/512.0),"15/32"}, {(240.0/512.0),"15/32"},{(241.0/512.0),"121/256"},{(242.0/512.0),"121/256"},{(243.0/512.0),"61/128"}, {(244.0/512.0),"61/128"},{(245.0/512.0),"123/256"},{(246.0/512.0),"123/256"},{(247.0/512.0),"31/64"}, {(248.0/512.0),"31/64"},{(249.0/512.0),"125/256"},{(250.0/512.0),"125/256"},{(251.0/512.0),"63/128"}, {(252.0/512.0),"63/128"},{(253.0/512.0),"127/256"},{(254.0/512.0),"127/256"},{(255.0/512.0),"1/2"}, {(256.0/512.0),"1/2"},{(257.0/512.0),"129/256"},{(258.0/512.0),"129/256"},{(259.0/512.0),"65/128"}, {(260.0/512.0),"65/128"},{(261.0/512.0),"131/256"},{(262.0/512.0),"131/256"},{(263.0/512.0),"33/64"}, {(264.0/512.0),"33/64"},{(265.0/512.0),"133/256"},{(266.0/512.0),"133/256"},{(267.0/512.0),"67/128"}, {(268.0/512.0),"67/128"},{(269.0/512.0),"135/256"},{(270.0/512.0),"135/256"},{(271.0/512.0),"17/32"}, {(272.0/512.0),"17/32"},{(273.0/512.0),"137/256"},{(274.0/512.0),"137/256"},{(275.0/512.0),"69/128"}, {(276.0/512.0),"69/128"},{(277.0/512.0),"139/256"},{(278.0/512.0),"139/256"},{(279.0/512.0),"35/64"}, {(280.0/512.0),"35/64"},{(281.0/512.0),"141/256"},{(282.0/512.0),"141/256"},{(283.0/512.0),"71/128"}, {(284.0/512.0),"71/128"},{(285.0/512.0),"143/256"},{(286.0/512.0),"143/256"},{(287.0/512.0),"9/16"}, {(288.0/512.0),"9/16"},{(289.0/512.0),"145/256"},{(290.0/512.0),"145/256"},{(291.0/512.0),"73/128"}, {(292.0/512.0),"73/128"},{(293.0/512.0),"147/256"},{(294.0/512.0),"147/256"},{(295.0/512.0),"37/64"}, {(296.0/512.0),"37/64"},{(297.0/512.0),"149/256"},{(298.0/512.0),"149/256"},{(299.0/512.0),"75/128"}, {(300.0/512.0),"75/128"},{(301.0/512.0),"151/256"},{(302.0/512.0),"151/256"},{(303.0/512.0),"19/32"}, {(304.0/512.0),"19/32"},{(305.0/512.0),"153/256"},{(306.0/512.0),"153/256"},{(307.0/512.0),"77/128"}, {(308.0/512.0),"77/128"},{(309.0/512.0),"155/256"},{(310.0/512.0),"155/256"},{(311.0/512.0),"39/64"}, {(312.0/512.0),"39/64"},{(313.0/512.0),"157/256"},{(314.0/512.0),"157/256"},{(315.0/512.0),"79/128"}, {(316.0/512.0),"79/128"},{(317.0/512.0),"159/256"},{(318.0/512.0),"159/256"},{(319.0/512.0),"5/8"}, {(320.0/512.0),"5/8"},{(321.0/512.0),"161/256"},{(322.0/512.0),"161/256"},{(323.0/512.0),"81/128"}, {(324.0/512.0),"81/128"},{(325.0/512.0),"163/256"},{(326.0/512.0),"163/256"},{(327.0/512.0),"41/64"}, {(328.0/512.0),"41/64"},{(329.0/512.0),"165/256"},{(330.0/512.0),"165/256"},{(331.0/512.0),"83/128"}, {(332.0/512.0),"83/128"},{(333.0/512.0),"167/256"},{(334.0/512.0),"167/256"},{(335.0/512.0),"21/32"}, {(336.0/512.0),"21/32"},{(337.0/512.0),"169/256"},{(338.0/512.0),"169/256"},{(339.0/512.0),"85/128"}, {(340.0/512.0),"85/128"},{(341.0/512.0),"171/256"},{(342.0/512.0),"171/256"},{(343.0/512.0),"43/64"}, {(344.0/512.0),"43/64"},{(345.0/512.0),"173/256"},{(346.0/512.0),"173/256"},{(347.0/512.0),"87/128"}, {(348.0/512.0),"87/128"},{(349.0/512.0),"175/256"},{(350.0/512.0),"175/256"},{(351.0/512.0),"11/16"}, {(352.0/512.0),"11/16"},{(353.0/512.0),"177/256"},{(354.0/512.0),"177/256"},{(355.0/512.0),"89/128"}, {(356.0/512.0),"89/128"},{(357.0/512.0),"179/256"},{(358.0/512.0),"179/256"},{(359.0/512.0),"45/64"}, {(360.0/512.0),"45/64"},{(361.0/512.0),"181/256"},{(362.0/512.0),"181/256"},{(363.0/512.0),"91/128"}, {(364.0/512.0),"91/128"},{(365.0/512.0),"183/256"},{(366.0/512.0),"183/256"},{(367.0/512.0),"23/32"}, {(368.0/512.0),"23/32"},{(369.0/512.0),"185/256"},{(370.0/512.0),"185/256"},{(371.0/512.0),"93/128"}, {(372.0/512.0),"93/128"},{(373.0/512.0),"187/256"},{(374.0/512.0),"187/256"},{(375.0/512.0),"47/64"}, {(376.0/512.0),"47/64"},{(377.0/512.0),"189/256"},{(378.0/512.0),"189/256"},{(379.0/512.0),"95/128"}, {(380.0/512.0),"95/128"},{(381.0/512.0),"191/256"},{(382.0/512.0),"191/256"},{(383.0/512.0),"3/4"}, {(384.0/512.0),"3/4"},{(385.0/512.0),"193/256"},{(386.0/512.0),"193/256"},{(387.0/512.0),"97/128"}, {(388.0/512.0),"97/128"},{(389.0/512.0),"195/256"},{(390.0/512.0),"195/256"},{(391.0/512.0),"49/64"}, {(392.0/512.0),"49/64"},{(393.0/512.0),"197/256"},{(394.0/512.0),"197/256"},{(395.0/512.0),"99/128"}, {(396.0/512.0),"99/128"},{(397.0/512.0),"199/256"},{(398.0/512.0),"199/256"},{(399.0/512.0),"25/32"}, {(400.0/512.0),"25/32"},{(401.0/512.0),"201/256"},{(402.0/512.0),"201/256"},{(403.0/512.0),"101/128"}, {(404.0/512.0),"101/128"},{(405.0/512.0),"203/256"},{(406.0/512.0),"203/256"},{(407.0/512.0),"51/64"}, {(408.0/512.0),"51/64"},{(409.0/512.0),"205/256"},{(410.0/512.0),"205/256"},{(411.0/512.0),"103/128"}, {(412.0/512.0),"103/128"},{(413.0/512.0),"207/256"},{(414.0/512.0),"207/256"},{(415.0/512.0),"13/16"}, {(416.0/512.0),"13/16"},{(417.0/512.0),"209/256"},{(418.0/512.0),"209/256"},{(419.0/512.0),"105/128"}, {(420.0/512.0),"105/128"},{(421.0/512.0),"211/256"},{(422.0/512.0),"211/256"},{(423.0/512.0),"53/64"}, {(424.0/512.0),"53/64"},{(425.0/512.0),"213/256"},{(426.0/512.0),"213/256"},{(427.0/512.0),"107/128"}, {(428.0/512.0),"107/128"},{(429.0/512.0),"215/256"},{(430.0/512.0),"215/256"},{(431.0/512.0),"27/32"}, {(432.0/512.0),"27/32"},{(433.0/512.0),"217/256"},{(434.0/512.0),"217/256"},{(435.0/512.0),"109/128"}, {(436.0/512.0),"109/128"},{(437.0/512.0),"219/256"},{(438.0/512.0),"219/256"},{(439.0/512.0),"55/64"}, {(440.0/512.0),"55/64"},{(441.0/512.0),"221/256"},{(442.0/512.0),"221/256"},{(443.0/512.0),"111/128"}, {(444.0/512.0),"111/128"},{(445.0/512.0),"223/256"},{(446.0/512.0),"223/256"},{(447.0/512.0),"7/8"}, {(448.0/512.0),"7/8"},{(449.0/512.0),"225/256"},{(450.0/512.0),"225/256"},{(451.0/512.0),"113/128"}, {(452.0/512.0),"113/128"},{(453.0/512.0),"227/256"},{(454.0/512.0),"227/256"},{(455.0/512.0),"57/64"}, {(456.0/512.0),"57/64"},{(457.0/512.0),"229/256"},{(458.0/512.0),"229/256"},{(459.0/512.0),"115/128"}, {(460.0/512.0),"115/128"},{(461.0/512.0),"231/256"},{(462.0/512.0),"231/256"},{(463.0/512.0),"29/32"}, {(464.0/512.0),"29/32"},{(465.0/512.0),"233/256"},{(466.0/512.0),"233/256"},{(467.0/512.0),"117/128"}, {(468.0/512.0),"117/128"},{(469.0/512.0),"235/256"},{(470.0/512.0),"235/256"},{(471.0/512.0),"59/64"}, {(472.0/512.0),"59/64"},{(473.0/512.0),"237/256"},{(474.0/512.0),"237/256"},{(475.0/512.0),"119/128"}, {(476.0/512.0),"119/128"},{(477.0/512.0),"239/256"},{(478.0/512.0),"239/256"},{(479.0/512.0),"15/16"}, {(480.0/512.0),"15/16"},{(481.0/512.0),"241/256"},{(482.0/512.0),"241/256"},{(483.0/512.0),"121/128"}, {(484.0/512.0),"121/128"},{(485.0/512.0),"243/256"},{(486.0/512.0),"243/256"},{(487.0/512.0),"61/64"}, {(488.0/512.0),"61/64"},{(489.0/512.0),"245/256"},{(490.0/512.0),"245/256"},{(491.0/512.0),"123/128"}, {(492.0/512.0),"123/128"},{(493.0/512.0),"247/256"},{(494.0/512.0),"247/256"},{(495.0/512.0),"31/32"}, {(496.0/512.0),"31/32"},{(497.0/512.0),"249/256"},{(498.0/512.0),"249/256"},{(499.0/512.0),"125/128"}, {(500.0/512.0),"125/128"},{(501.0/512.0),"251/256"},{(502.0/512.0),"251/256"},{(503.0/512.0),"63/64"}, {(504.0/512.0),"63/64"},{(505.0/512.0),"253/256"},{(506.0/512.0),"253/256"},{(507.0/512.0),"127/128"}, {(508.0/512.0),"127/128"},{(509.0/512.0),"255/256"},{(510.0/512.0),"255/256"},{(511.0/512.0),"1/1"}, } }; aplus-fsf-4.22/src/MSTypes/MSHashTable.C0000644000265000001440000002347710772770445013402 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #if HAVE_IOSTREAM #include #else #include #endif #include #include static const unsigned long RESOURCE_ID_MASK=0xfffff; // used in unsigned long key hashing static const unsigned long DefaultNotFound=0x0; // default NotFound value static char *stringDuplicate(const char *src_) { char *dest=0; if (src_!=0) { unsigned len=strlen(src_); dest=new char[len+1]; for (unsigned i=0;i_prev=prev(); if (prev()!=0) prev()->_next=next(); if (stringKey()!=0) delete [] _stringKey; _stringKey=0,_value=0,_key=0,_next=0,_prev=0; } MSHashTable::MSHashTable(unsigned size_) { _size=size_,_bucket=0,_notFound=DefaultNotFound; if (size()>0) init(size_); } MSHashTable::~MSHashTable(void) { removeAll(); } void MSHashTable::removeAll(void) { for (unsigned i=0;inext(); delete entry; entry=bucket(i); } _bucket[i]=0; } if (_bucket!=0) delete [] _bucket; _bucket=0; _size=0; } void MSHashTable::init(unsigned size_) { if (bucket()==0) { _size=computeSize(size_); _bucket=new MSHashEntry*[size()]; unsigned i=size(); MSHashEntry **p=bucket(); while(i--) *p++=0; } else resize(size_); } void MSHashTable::resize(unsigned size_) { MSHashEntry **oldBuckets=bucket(); unsigned oldSize=size(); _size=computeSize(size_); _bucket=new MSHashEntry*[size()]; unsigned i=size(); MSHashEntry **p=bucket(); while(i--) *p++=0; if (oldBuckets!=0) { for (unsigned j=0;jnext()!=0) entry=entry->next(); while (entry!=0) { prev=entry->prev(); entry->prev(0),entry->next(0); addEntry(entry); // rehash and add to the new table entry=prev; } oldBuckets[j]=0; } delete [] oldBuckets; } } // this hash routine comes from the mit sample X server // and is particularly well suited to hashing on memory // addresses unsigned MSHashTable::hash(unsigned long key_) const { key_&=RESOURCE_ID_MASK; return unsigned((key_^(key_>>11))&(size()-1)); } void *MSHashTable::lookup(unsigned long key_) const { MSHashEntry *entry=searchBucketFor(bucket(hash(key_)),key_); if (entry==0) return (void *)notFound(); else return entry->value(); } MSHashEntry *MSHashTable::searchBucketFor(MSHashEntry *entry_,unsigned long key_) const { while (entry_!=0) { if (entry_->key()==key_) return entry_; entry_=entry_->next(); } return entry_; } MSHashEntry *MSHashTable::addElement(unsigned long key_,unsigned whichBucket_) { MSHashEntry *entry=new MSHashEntry(key_); entry->next(bucket(whichBucket_)); if (bucket(whichBucket_)!=0) bucket(whichBucket_)->prev(entry); bucket(whichBucket_,entry); return entry; } MSBoolean MSHashTable::add(unsigned long key_,void *value_) { if (size()==0) { MSMessageLog::errorMessage("MSHashTable: add failed - hash table size==0\n"); return MSFalse; } unsigned whichBucket=hash(key_); MSHashEntry *entry=searchBucketFor(bucket(whichBucket),key_); if (entry!=0) { MSMessageLog::errorMessage("MSHashTable: add failed - key already in table: %d\n",key_); return MSFalse; } entry=addElement(key_,whichBucket); entry->value(value_); return MSTrue; } MSBoolean MSHashTable::remove(unsigned long key_) { unsigned whichBucket=hash(key_); MSHashEntry *entry=searchBucketFor(bucket(whichBucket),key_); if (entry!=0) { if (bucket(whichBucket)==entry) bucket(whichBucket,entry->next()); delete entry; return MSTrue; } return MSFalse; } // this works because the MSHashTable forces size to be a power // of two, otherwise we would have to return value%size(), which // is less efficient than value&(size()-1) unsigned MSHashTable::hash(const char *key_) const { unsigned long h=0; unsigned long c; while ((c=(unsigned long)*key_++)!=0) h+=(h<<5)+c; return unsigned(h&(size()-1)); } void *MSHashTable::lookup(const char *key_) const { MSHashEntry *entry=(key_!=0)?searchBucketFor(bucket(hash(key_)),key_):0; if (entry==0) return (void *)notFound(); else return entry->value(); } MSHashEntry *MSHashTable::searchBucketFor(MSHashEntry *entry_,const char *key_) const { while (entry_!=0) { if (strcmp(entry_->stringKey(),key_)==0) return entry_; entry_=entry_->next(); } return entry_; } MSHashEntry *MSHashTable::addElement(const char *key_,unsigned whichBucket_) { MSHashEntry *entry=new MSHashEntry(key_); entry->next(bucket(whichBucket_)); if (bucket(whichBucket_)) bucket(whichBucket_)->prev(entry); bucket(whichBucket_,entry); return entry; } MSBoolean MSHashTable::add(const char *key_, void *value_) { if (size()==0) { MSMessageLog::errorMessage("MSHashTable: add failed - hash table size==0\n"); return MSFalse; } unsigned whichBucket=hash(key_); MSHashEntry *entry=searchBucketFor(bucket(whichBucket),key_); if (entry!=0) { MSMessageLog::errorMessage("MSHashTable: add failed - key already in table: %d\n",key_); return MSFalse; } entry=addElement(key_,whichBucket); entry->value(value_); return MSTrue; } MSBoolean MSHashTable::remove(const char *key_) { unsigned whichBucket=hash(key_); MSHashEntry *entry=searchBucketFor(bucket(whichBucket),key_); if (entry!=0) { if (bucket(whichBucket)==entry) bucket(whichBucket,entry->next()); delete entry; return MSTrue; } return MSFalse; } // special add method for adding an entry back into the table i.e. rehashing it is // useful for a hash table resize void MSHashTable::addEntry(MSHashEntry *entry_) { unsigned whichBucket=(entry_->stringKey()==0)?hash(entry_->key()):hash(entry_->stringKey()); entry_->next(bucket(whichBucket)); if (bucket(whichBucket)!=0) bucket(whichBucket)->prev(entry_); bucket(whichBucket,entry_); } //####################################################################### // hash statistic methods unsigned MSHashTable::averageChainLength(void) const { MSHashEntry *entry; unsigned n=size(); unsigned r=0; for (unsigned i=0;inext(); r++; } } return (n==0)?0:r/n; } unsigned MSHashTable::maximumChainLength(void) const { MSHashEntry *entry; unsigned n=size(); unsigned r=0; unsigned max=0; for (unsigned i=0;inext(); r++; } if (r>max) max=r; } return max; } unsigned MSHashTable::chainLength(unsigned index_) const { unsigned r=0; if (index_next(); r++; } } return r; } ostream& MSHashTable::printChainLengths(ostream& aStream_) const { for (unsigned i=0;istringKey()<<" "; entry=entry->next(); } aStream_<next(); data=(char *)entry->value(); if (data!=0) delete [] data; delete entry; entry=bucket(i); } _bucket[i]=0; } if (_bucket!=0) delete [] _bucket; _size=0; _bucket=0; } aplus-fsf-4.22/src/MSTypes/MSHoliday.C0000644000265000001440000000245010772770445013124 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #if HAVE_IOSTREAM #include #else #include #endif //####################################################### // MSHoliday //####################################################### MSHoliday::MSHoliday() {} MSHoliday::MSHoliday(const MSDate& date_,const MSResourceCode& resourceCode_,const MSString& description_) : _resourceCode(resourceCode_),_description(description_),MSDate(date_) {} MSHoliday::MSHoliday(const MSHoliday& holiday_) : _resourceCode(holiday_.resourceCode()),_description(holiday_.description()),MSDate(holiday_) {} MSHoliday& MSHoliday::operator=(const MSHoliday& holiday_) { _resourceCode=holiday_.resourceCode(); _description=holiday_.description(); MSDate::operator=(holiday_); return *this; } ostream& operator<<(ostream& aStream_,const MSHoliday& aHoliday_) { aStream_<<"Date: "<<(const MSDate&)aHoliday_; aStream_<<"\tResourceCode: "< #include #include // defines offsetof macro used in MSIndexVector::Data::operator new() #if HAVE_IOSTREAM #include #else #include #endif #include #if HAVE_SSTREAM #include #include #else #include #endif #ifdef MS_NO_INLINES #include #endif // MS_NO_INLINES #include #ifdef MS_MULTI_THREAD MSMutex MSIndexVector::_operationsMutex; MSMutex MSIndexVector::Operations::_nullDataMutex; #endif MSIndexVector::MSIndexVector() : MSVector() { _pImpl = new MSBuiltinVectorImpl(&ops(),&ops()); } MSIndexVector::MSIndexVector (const MSIndexVector & vect_) : MSVector(), _pImpl (new MSBuiltinVectorImpl (*vect_._pImpl)) { // ASSERTION: pOps has been initialized already at latest when vect_ was created } MSIndexVector::MSIndexVector (unsigned int length_) : MSVector() { _pImpl = new MSBuiltinVectorImpl(&ops(),&ops(),length_); } MSIndexVector::MSIndexVector (unsigned int length_, const unsigned int filler_) : MSVector() { _pImpl = new MSBuiltinVectorImpl(&ops(), &ops(), length_, (void *)&filler_); } MSIndexVector::MSIndexVector (const char *pString_) : MSVector() { _pImpl = new MSBuiltinVectorImpl(&ops(),&ops()); _pImpl->setFromString (pString_); } MSIndexVector::MSIndexVector (MSIndexVector::Data *pData_, unsigned int len_) : MSVector() { _pImpl = new MSBuiltinVectorImpl(&ops(), &ops(), (void *)pData_, len_); } MSIndexVector::MSIndexVector (const unsigned int *pElements_, unsigned int len_) : MSVector() { Data *pData = Data::allocateWithLength (len_); Data::copy (pElements_, pData->elements(), len_); _pImpl = new MSBuiltinVectorImpl(&ops(), &ops(), (void *)pData, len_); } MSIndexVector::MSIndexVector (MSBuiltinVectorImpl *pImpl_) : MSVector(), _pImpl (pImpl_) { } MSIndexVector::~MSIndexVector() { delete _pImpl; } MSIndexVector & MSIndexVector::operator= (const MSIndexVector & vect_) { if (this != &vect_) { *_pImpl = *vect_._pImpl; changed(); } return *this; } MSIndexVector & MSIndexVector::operator= (const unsigned int value_) { _pImpl->setAll ((void *)&value_); changed(); return *this; } const MSIndexVector & MSIndexVector::nullVector() { static MSIndexVector nullVect; return nullVect; } MSString MSIndexVector::asString() const { return _pImpl->asString(); } MSString MSIndexVector::asMSF() const { return _pImpl->asMSF(); } MSString MSIndexVector::asDebugInfo() const { MSString result (className()); return result << "(@" << MSString((unsigned long)this).d2x().lowerCase() << ",_elements=" << ((Data *)_pImpl->data())->asDebugInfo() << ",_size=" << MSString(size()) << ",_length=" << MSString(length()) << ",_type=" << type().symbolName() << ")"; } MSString MSIndexVector::className() const { return MSString ("MSIndexVector"); } const MSSymbol & MSIndexVector::type() const { return symbol(); } MSModel * MSIndexVector::clone() const { return new MSIndexVector (*this); } MSModel * MSIndexVector::create() const { return new MSIndexVector; } void MSIndexVector::assign (const MSModel & aModel_) { *this = (MSIndexVector &)aModel_; } long MSIndexVector::compare (const MSModel & aModel_) const { return compare ((MSIndexVector &)aModel_); } MSError::ErrorStatus MSIndexVector::set (const char *pString_) { MSError::ErrorStatus retval = _pImpl->setFromString (pString_); changed(); return retval; } MSError::ErrorStatus MSIndexVector::setFromMSF (const char *pString_) { MSError::ErrorStatus retval = _pImpl->setFromMSF (pString_); changed(); return retval; } const MSSymbol & MSIndexVector::symbol() { static MSSymbol sym ("MSIndexVector"); return sym; } MSError::ErrorStatus MSIndexVector::set (unsigned int index_, const unsigned int value_) { if (index_ < _pImpl->length()) { _pImpl->set (index_, (void *)&value_); if (doChanged() == MSTrue) changed (index_); return MSError::MSSuccess; } else { _pImpl->vectorIndexError (index_); return MSError::MSFailure; } } unsigned int * MSIndexVector::data() const { return ((Data *)_pImpl->data())->elements(); } unsigned int MSIndexVector::length() const { // length() method might potentially be called after the destructor of MSIndexVector, // so safeguard yourself here by checking if _pImpl has already been deleted... return _pImpl ? _pImpl->length() : 0; } // virtual version of length() unsigned int MSIndexVector::getLength() const { return _pImpl->length(); } MSIndexVector & MSIndexVector::append (const unsigned int value_) { _pImpl->append ((void *) &value_); appendUpdate (_pImpl->length(), 1); return *this; } MSIndexVector & MSIndexVector::append (const MSIndexVector & vect_) { if (_pImpl->append (*vect_._pImpl) == MSError::MSSuccess) appendUpdate (_pImpl->length(), vect_._pImpl->length()); return *this; } MSIndexVector & MSIndexVector::insertAt (unsigned int index_, const unsigned int value_) { if (index_ == _pImpl->length()) // NEW FEATURE: insert right after the last element return append (value_); // if inserting inside the vector if (_pImpl->insertAt (index_, (void *) &value_) == MSError::MSSuccess) changed(); return *this; } MSIndexVector & MSIndexVector::insertAt (unsigned int index_, const MSIndexVector & vect_) { if (index_ == _pImpl->length()) // NEW FEATURE: insert right after the last element return append (vect_); // if inserting inside the vector if (_pImpl->insertAt (index_, *vect_._pImpl) == MSError::MSSuccess) changed(); return *this; } MSIndexVector & MSIndexVector::removeAt (unsigned int index_) { if (_pImpl->removeAt (index_) == MSError::MSSuccess) changed(); return *this; } MSIndexVector & MSIndexVector::removeAt (unsigned int startPos_, unsigned int numEls_) { if (numEls_ > 0) if (_pImpl->removeAt (startPos_, numEls_) == MSError::MSSuccess) changed(); return *this; } MSIndexVector & MSIndexVector::remove (const MSIndexVector & iVect_) { if (_pImpl->remove (iVect_) == MSError::MSSuccess) changed(); return *this; } MSIndexVector & MSIndexVector::remove (const MSBinaryVector & bVect_) { if (_pImpl->remove (bVect_) == MSError::MSSuccess) changed(); return *this; } MSIndexVector & MSIndexVector::removeAll() { if (_pImpl->removeAll() == MSError::MSSuccess) changed(); return *this; } MSIndexVector & MSIndexVector::select (const MSIndexVector & iVect_) { if (_pImpl->select (iVect_) == MSError::MSSuccess) changed(); return *this; } MSIndexVector & MSIndexVector::compress (const MSBinaryVector & bVect_) { if (_pImpl->compress (bVect_) == MSError::MSSuccess) changed(); return *this; } MSIndexVector & MSIndexVector::reshape (unsigned int newLen_) { if (_pImpl->reshape (newLen_) == MSError::MSSuccess) changed(); return *this; } MSIndexVector & MSIndexVector::exchange (unsigned int index1_, unsigned int index2_) { if (_pImpl->exchange (index1_, index2_) == MSError::MSSuccess && doChanged() == MSTrue) { MSIndexVector iVect (2); iVect.data()[0] = index1_; iVect.data()[1] = index2_; changed (iVect); } return *this; } MSIndexVector & MSIndexVector::reverse() { if (_pImpl->reverse() == MSError::MSSuccess) changed(); return *this; } MSIndexVector & MSIndexVector::rotate (int amount_) { if (_pImpl->rotate (amount_) == MSError::MSSuccess) changed(); return *this; } MSIndexVector & MSIndexVector::take (int numEls_, const unsigned int filler_) { if (_pImpl->take (numEls_, (void *)&filler_) == MSError::MSSuccess) changed(); return *this; } MSIndexVector & MSIndexVector::drop (int numEls_) { if (_pImpl->drop (numEls_) == MSError::MSSuccess) changed(); return *this; } MSIndexVector MSIndexVector::reverse (const MSIndexVector & vect_) { MSBuiltinVectorImpl *impl = (MSBuiltinVectorImpl *)vect_._pImpl->create(); impl->reverse (*vect_._pImpl); return MSIndexVector (impl); } MSIndexVector MSIndexVector::rotate (const MSIndexVector & vect_, int amount_) { MSBuiltinVectorImpl *impl = (MSBuiltinVectorImpl *)vect_._pImpl->create(); impl->rotate (*vect_._pImpl, amount_); return MSIndexVector (impl); } MSIndexVector MSIndexVector::take (const MSIndexVector & vect_, int numEls_, const unsigned int filler_) { MSBuiltinVectorImpl *impl = (MSBuiltinVectorImpl *)vect_._pImpl->create(); impl->take (*vect_._pImpl, numEls_, (void *)&filler_); return MSIndexVector (impl); } MSIndexVector MSIndexVector::drop (const MSIndexVector & vect_, int numEls_) { MSBuiltinVectorImpl *impl = (MSBuiltinVectorImpl *)vect_._pImpl->create(); impl->drop (*vect_._pImpl, numEls_); return MSIndexVector (impl); } MSIndexVector MSIndexVector::select (const MSIndexVector & vect_, const MSIndexVector & iVect_) { MSBuiltinVectorImpl *impl = (MSBuiltinVectorImpl *)vect_._pImpl->create(); impl->select (*vect_._pImpl, iVect_); return MSIndexVector (impl); } MSIndexVector MSIndexVector::compress (const MSIndexVector & vect_, const MSBinaryVector & bVect_) { MSBuiltinVectorImpl *impl = (MSBuiltinVectorImpl *)vect_._pImpl->create(); impl->compress (*vect_._pImpl, bVect_); return MSIndexVector (impl); } MSIndexVector & MSIndexVector::selectiveAssign (const MSIndexVector & iVect_, const unsigned int value_) { _pImpl->setSelected (iVect_, (void *)&value_); changed (iVect_); return *this; } MSIndexVector & MSIndexVector::selectiveAssign (const MSIndexVector & iVect_, const MSIndexVector & vect_) { _pImpl->setSelected (iVect_, *vect_._pImpl); changed (iVect_); return *this; } MSIndexVector & MSIndexVector::selectiveAssign (const MSBinaryVector & bVect_, const unsigned int value_) { if (doChanged() == MSTrue) changed (_pImpl->setIndexSelected (bVect_, (void *)&value_)); else _pImpl->setSelected (bVect_, (void *)&value_); return *this; } MSIndexVector & MSIndexVector::selectiveAssign (const MSBinaryVector & bVect_, const MSIndexVector & vect_) { if (doChanged() == MSTrue) changed (_pImpl->setIndexSelected (bVect_, *vect_._pImpl)); else _pImpl->setSelected (bVect_, *vect_._pImpl); return *this; } MSIndexVector MSIndexVector::gradeUp() const { return _pImpl->gradeUp(); } MSIndexVector MSIndexVector::gradeDown() const { return _pImpl->gradeDown(); } void MSIndexVector::permute (const MSIndexVector & iVect_) { _pImpl->permute (iVect_); changed(); } ostream & operator<< (ostream & stream_, const MSIndexVector & vect_) { vect_._pImpl->print (stream_); return stream_; } MSIndexVector & MSIndexVector::random (unsigned int limit_) { unsigned int len=_pImpl->length(); if (len>0) { _pImpl->prepareToChangeWithoutCopy(); if (limit_==0) limit_=len; MSRandom rand; unsigned int *pData=data(); while (len--) { *pData++ = (unsigned int)rand(limit_); } changed(); } return *this; } MSIndexVector & MSIndexVector::series (unsigned int length_, unsigned int offset_) { _pImpl->reallocateInPlace(length_); unsigned int *pData=data(); while (length_--) { *pData++ = offset_++; } changed(); return *this; } unsigned int MSIndexVector::min() const { unsigned int len=_pImpl->length(); if (len==0) return 0; unsigned int *pData=data(); unsigned int min=pData[0]; for (unsigned int i=1; ilength(); if (len==0) return 0; unsigned int *pData=data(); unsigned int max=pData[0]; for (unsigned int i=1; imax) { max = pData[i]; } } return max; } double MSIndexVector::sum() const { double sum=0.0; unsigned int len=_pImpl->length(); unsigned int *pData=data(); while (len--) { sum += (double)*pData++; } return sum; } // Unary minus operator MSIndexVector operator- (const MSIndexVector & vect_) { unsigned int len=vect_._pImpl->length(); MSBuiltinVectorImpl *pNewImpl = (MSBuiltinVectorImpl *)vect_._pImpl->create(len, vect_.vectorData()->size()); unsigned int *pSrc=vect_.data(), *pDest=((MSIndexVector::Data *)pNewImpl->data())->elements(); while (len--) { *pDest++ = -*pSrc++; } return MSIndexVector (pNewImpl); } // Prefix increment operator MSIndexVector & MSIndexVector::operator++() { unsigned int len=_pImpl->length(); if (len>0) { unsigned int *pData=data(); _pImpl->prepareToChangeWithoutCopy(); if (pData==data()) // if no reallocation was necessary { for (unsigned int i=0; ilength(); if (len>0) { unsigned int *pData=data(); _pImpl->prepareToChangeWithoutCopy(); if (pData==data()) // if no reallocation was necessary { for (unsigned int i=0; ilength(); assert (len==vect2_._pImpl->length()); MSBuiltinVectorImpl *pResImpl = (MSBuiltinVectorImpl *)vect1_._pImpl->create(len, vect1_.vectorData()->size()); unsigned int *pData1=vect1_.data(), *pData2=vect2_.data(), *pResData=((MSIndexVector::Data *)pResImpl->data())->elements(); while (len--) { *pResData++ = *pData1++ + *pData2++; } return MSIndexVector(pResImpl); } MSIndexVector operator+ (const MSIndexVector & vect_, const unsigned int value_) { unsigned int len=vect_._pImpl->length(); MSBuiltinVectorImpl *pResImpl = (MSBuiltinVectorImpl *)vect_._pImpl->create(len,vect_.vectorData()->size()); unsigned int *pData=vect_.data(), *pResData=((MSIndexVector::Data *)pResImpl->data())->elements(); while (len--) { *pResData++ = *pData++ + value_; } return MSIndexVector(pResImpl); } MSIndexVector operator- (const MSIndexVector & vect1_, const MSIndexVector & vect2_) { unsigned int len=vect1_._pImpl->length(); assert (len==vect2_._pImpl->length()); MSBuiltinVectorImpl *pResImpl = (MSBuiltinVectorImpl *)vect1_._pImpl->create(len, vect1_.vectorData()->size()); unsigned int *pData1=vect1_.data(), *pData2=vect2_.data(), *pResData=((MSIndexVector::Data *)pResImpl->data())->elements(); while (len--) { *pResData++ = *pData1++ - *pData2++; } return MSIndexVector(pResImpl); } MSIndexVector operator- (const MSIndexVector & vect_, const unsigned int value_) { unsigned int len=vect_._pImpl->length(); MSBuiltinVectorImpl *pResImpl = (MSBuiltinVectorImpl *)vect_._pImpl->create(len,vect_.vectorData()->size()); unsigned int *pData=vect_.data(), *pResData=((MSIndexVector::Data *)pResImpl->data())->elements(); while (len--) { *pResData++ = *pData++ - value_; } return MSIndexVector(pResImpl); } MSIndexVector operator- (const unsigned int value_, const MSIndexVector & vect_) { unsigned int len=vect_._pImpl->length(); MSBuiltinVectorImpl *pResImpl = (MSBuiltinVectorImpl *)vect_._pImpl->create(len,vect_.vectorData()->size()); unsigned int *pData=vect_.data(), *pResData=((MSIndexVector::Data *)pResImpl->data())->elements(); while (len--) { *pResData++ = value_ - *pData++; } return MSIndexVector(pResImpl); } MSIndexVector operator* (const MSIndexVector & vect1_, const MSIndexVector & vect2_) { unsigned int len=vect1_._pImpl->length(); assert (len==vect2_._pImpl->length()); MSBuiltinVectorImpl *pResImpl = (MSBuiltinVectorImpl *)vect1_._pImpl->create(len, vect1_.vectorData()->size()); unsigned int *pData1=vect1_.data(), *pData2=vect2_.data(), *pResData=((MSIndexVector::Data *)pResImpl->data())->elements(); while (len--) { *pResData++ = *pData1++ * *pData2++; } return MSIndexVector(pResImpl); } MSIndexVector operator* (const MSIndexVector & vect_, const unsigned int value_) { unsigned int len=vect_._pImpl->length(); MSBuiltinVectorImpl *pResImpl = (MSBuiltinVectorImpl *)vect_._pImpl->create(len,vect_.vectorData()->size()); unsigned int *pData=vect_.data(), *pResData=((MSIndexVector::Data *)pResImpl->data())->elements(); while (len--) { *pResData++ = *pData++ * value_; } return MSIndexVector(pResImpl); } MSIndexVector operator/ (const MSIndexVector & vect1_, const MSIndexVector & vect2_) { unsigned int len=vect1_._pImpl->length(); assert (len==vect2_._pImpl->length()); MSBuiltinVectorImpl *pResImpl = (MSBuiltinVectorImpl *)vect1_._pImpl->create(len, vect1_.vectorData()->size()); unsigned int *pData1=vect1_.data(), *pData2=vect2_.data(), *pResData=((MSIndexVector::Data *)pResImpl->data())->elements(); while (len--) { *pResData++ = *pData1++ / *pData2++; } return MSIndexVector(pResImpl); } MSIndexVector operator/ (const MSIndexVector & vect_, const unsigned int value_) { unsigned int len=vect_._pImpl->length(); MSBuiltinVectorImpl *pResImpl = (MSBuiltinVectorImpl *)vect_._pImpl->create(len,vect_.vectorData()->size()); unsigned int *pData=vect_.data(), *pResData=((MSIndexVector::Data *)pResImpl->data())->elements(); while (len--) { *pResData++ = *pData++ / value_; } return MSIndexVector(pResImpl); } MSIndexVector operator/ (const unsigned int value_, const MSIndexVector & vect_) { unsigned int len=vect_._pImpl->length(); MSBuiltinVectorImpl *pResImpl = (MSBuiltinVectorImpl *)vect_._pImpl->create(len,vect_.vectorData()->size()); unsigned int *pData=vect_.data(), *pResData=((MSIndexVector::Data *)pResImpl->data())->elements(); while (len--) { *pResData++ = value_ / *pData++; } return MSIndexVector(pResImpl); } MSIndexVector & MSIndexVector::operator+= (const MSIndexVector & vect_) { unsigned int len=_pImpl->length(); assert(len=vect_._pImpl->length()); if (len>0) { unsigned int *pData=data(), *pVectData=vect_.data(); _pImpl->prepareToChangeWithoutCopy(); if (pData==data()) // no reallocation was necessary { while (len--) { *pData++ += *pVectData++; } } else // if we had to reallocate { // ASSERTION: pData is still valid unsigned int *pNewData=data(); while (len--) { *pNewData++ = *pData++ + *pVectData++; // increment on-copy } } changed(); } return *this; } MSIndexVector & MSIndexVector::operator+= (const unsigned int value_) { unsigned int len=_pImpl->length(); if (len>0) { unsigned int *pData=data(); _pImpl->prepareToChangeWithoutCopy(); if (pData==data()) // no reallocation was necessary { while (len--) { *pData++ += value_; } } else // if we had to reallocate { // ASSERTION: pData is still valid unsigned int *pNewData=data(); while (len--) { *pNewData++ = *pData++ + value_; // increment on-copy } } changed(); } return *this; } MSIndexVector & MSIndexVector::operator-= (const MSIndexVector & vect_) { unsigned int len=_pImpl->length(); assert(len=vect_._pImpl->length()); if (len>0) { unsigned int *pData=data(), *pVectData=vect_.data(); _pImpl->prepareToChangeWithoutCopy(); if (pData==data()) // no reallocation was necessary { while (len--) { *pData++ -= *pVectData++; } } else // if we had to reallocate { // ASSERTION: pData is still valid unsigned int *pNewData=data(); while (len--) { *pNewData++ = *pData++ - *pVectData++; // increment on-copy } } changed(); } return *this; } MSIndexVector & MSIndexVector::operator-= (const unsigned int value_) { unsigned int len=_pImpl->length(); if (len>0) { unsigned int *pData=data(); _pImpl->prepareToChangeWithoutCopy(); if (pData==data()) // no reallocation was necessary { while (len--) { *pData++ -= value_; } } else // if we had to reallocate { // ASSERTION: pData is still valid unsigned int *pNewData=data(); while (len--) { *pNewData++ = *pData++ - value_; // increment on-copy } } changed(); } return *this; } MSIndexVector & MSIndexVector::operator*= (const MSIndexVector & vect_) { unsigned int len=_pImpl->length(); assert(len=vect_._pImpl->length()); if (len>0) { unsigned int *pData=data(), *pVectData=vect_.data(); _pImpl->prepareToChangeWithoutCopy(); if (pData==data()) // no reallocation was necessary { while (len--) { *pData++ *= *pVectData++; } } else // if we had to reallocate { // ASSERTION: pData is still valid unsigned int *pNewData=data(); while (len--) { *pNewData++ = *pData++ * *pVectData++; // increment on-copy } } changed(); } return *this; } MSIndexVector & MSIndexVector::operator*= (const unsigned int value_) { unsigned int len=_pImpl->length(); if (len>0) { unsigned int *pData=data(); _pImpl->prepareToChangeWithoutCopy(); if (pData==data()) // no reallocation was necessary { while (len--) { *pData++ *= value_; } } else // if we had to reallocate { // ASSERTION: pData is still valid unsigned int *pNewData=data(); while (len--) { *pNewData++ = *pData++ * value_; // increment on-copy } } changed(); } return *this; } MSIndexVector & MSIndexVector::operator/= (const MSIndexVector & vect_) { unsigned int len=_pImpl->length(); assert(len=vect_._pImpl->length()); if (len>0) { unsigned int *pData=data(), *pVectData=vect_.data(); _pImpl->prepareToChangeWithoutCopy(); if (pData==data()) // no reallocation was necessary { while (len--) { *pData++ /= *pVectData++; } } else // if we had to reallocate { // ASSERTION: pData is still valid unsigned int *pNewData=data(); while (len--) { *pNewData++ = *pData++ / *pVectData++; // increment on-copy } } changed(); } return *this; } MSIndexVector & MSIndexVector::operator/= (const unsigned int value_) { unsigned int len=_pImpl->length(); if (len>0) { unsigned int *pData=data(); _pImpl->prepareToChangeWithoutCopy(); if (pData==data()) // no reallocation was necessary { while (len--) { *pData++ /= value_; } } else // if we had to reallocate { // ASSERTION: pData is still valid unsigned int *pNewData=data(); while (len--) { *pNewData++ = *pData++ / value_; // increment on-copy } } changed(); } return *this; } MSIndexVector::Operations& MSIndexVector::ops(void) { MS_SAFE_STATIC_INIT(Operations,_operationsMutex); } MSIndexVector::Operations::Operations() { } MSIndexVector::Operations::~Operations() { } void * MSIndexVector::Operations::allocate (unsigned int length_, unsigned int, MSAllocationFlag) const { if (length_) return Data::allocateWithLength (length_); else // length_ == 0 return nullData().incrementCount(); } void * MSIndexVector::Operations::allocateWithSize (unsigned int size_, unsigned int, MSAllocationFlag) const { if (size_) return Data::allocateWithSize (size_); else // size_ == 0 return nullData().incrementCount(); } void MSIndexVector::Operations::deallocate (void *pData_, unsigned int, MSAllocationFlag) const { ((Data *)pData_)->decrementCount(); } void MSIndexVector::Operations::incrementCount (void *data_) const { ((Data *)data_)->incrementCount(); } unsigned int MSIndexVector::Operations::refCount (const void *data_) const { return ((Data *)data_)->refCount(); } void MSIndexVector::Operations::set (void *pData_, unsigned int index_, const void *pValue_, MSAllocationFlag) const { ((Data *)pData_)->elements()[index_] = *(unsigned int *)pValue_; } void MSIndexVector::Operations::set (void *pDest_, unsigned int destInd_, const void *pSrc_, unsigned int srcInd_, MSAllocationFlag) const { ((Data *)pDest_)->elements()[destInd_] = ((Data *)pSrc_)->elements()[srcInd_]; } void MSIndexVector::Operations::fill (void *pElements_, unsigned int start_, unsigned int numToFill_, const void *pValue_, MSAllocationFlag) const { unsigned int *pStart = ((Data *)pElements_)->elements() + start_; if (pValue_) Data::fill (pStart, numToFill_, *(unsigned int *)pValue_); else Data::fill (pStart, numToFill_, *(unsigned int *)defaultFiller()); } void MSIndexVector::Operations::copy (const void *src_, void *dest_, unsigned int length_, unsigned int srcInd_, unsigned int destInd_, MSAllocationFlag) const { Data::copy (((Data *)src_)->elements() + srcInd_, ((Data *)dest_)->elements() + destInd_, length_); } void MSIndexVector::Operations::copyBackward (void *pElements_, unsigned int src_, unsigned int dest_, unsigned int numToCopy_) const { unsigned int *pElements = ((Data *)pElements_)->elements(); Data::copyBackward (pElements+src_, pElements+dest_, numToCopy_); } void MSIndexVector::Operations::destroy (void *, unsigned int, unsigned int) const { } int MSIndexVector::Operations::isElementEqual (const void *pElements_, unsigned int index_, const void *pValue_) const { return ((Data *)pElements_)->elements()[index_] == *(unsigned int *)pValue_; } int MSIndexVector::Operations::isElementLess (const void *pElements_, unsigned int index_, const void *pValue_) const { return ((Data *)pElements_)->elements()[index_] < *(unsigned int *)pValue_; } int MSIndexVector::Operations::isElementLessEqual (const void *pElements_, unsigned int index_, const void *pValue_) const { return ((Data *)pElements_)->elements()[index_] <= *(unsigned int *)pValue_; } long MSIndexVector::Operations::compareElement (const void *data_, unsigned int index_, const void *value_) const { const unsigned int el1 = ((Data *)data_)->elements()[index_], el2 = *(unsigned int *)value_; return (el1 == el2) ? 0 : ((el1 < el2) ? -1 : 1); } void *MSIndexVector::Operations::elementAt (const void *pElements_, unsigned int index_) const { return & ((Data *)pElements_)->elementAt (index_); } unsigned int MSIndexVector::Operations::size (const void *pElements_) const { return ((Data *)pElements_)->size(); } void MSIndexVector::Operations::swapElements (void *data_, unsigned int ind1_, unsigned int ind2_) const { unsigned int *pElements = ((Data *)data_)->elements(); unsigned int temp = pElements[ind1_]; pElements[ind1_] = pElements[ind2_], pElements[ind2_] = temp; } unsigned int MSIndexVector::Operations::gradeUp (const void *pData_, unsigned int len_, unsigned int *pResult_) const { return msMergeSortUp (len_, ((Data *)pData_)->elements(), pResult_, (unsigned int)0, len_); } unsigned int MSIndexVector::Operations::gradeDown (const void *pData_, unsigned int len_, unsigned int *pResult_) const { return msMergeSortDown (len_, ((Data *)pData_)->elements(), pResult_, (unsigned int)0, len_); } void *MSIndexVector::Operations::badData() const { static unsigned int badValue =0; return (void *)&badValue; } void *MSIndexVector::Operations::defaultFiller() const { static unsigned int filler =0; return (void *)&filler; } MSString MSIndexVector::Operations::asString (const void *pData_, unsigned int index_) const { return MSString (((Data *)pData_)->elements()[index_]); } MSString MSIndexVector::Operations::asMSF (const void *pData_, unsigned int index_) const { return MSString (((Data *)pData_)->elements()[index_]); } unsigned int MSIndexVector::Operations::elementLen (const void *, unsigned int) const { return 0; } MSError::ErrorStatus MSIndexVector::Operations::setFromString (void *pData_, unsigned int index_, const char *pString_) const { char *cp = 0; ((Data *)pData_)->elements()[index_] = (unsigned int) strtoul (pString_, &cp, 10); // Base 10 return (cp == pString_) ? MSError::MSFailure : MSError::MSSuccess; } MSError::ErrorStatus MSIndexVector::Operations::setFromMSF (void *pData_, unsigned int index_, const char *pString_) const { return setFromString (pData_, index_, pString_); } void MSIndexVector::Operations::setFromMSString (void *pData_, unsigned int vectIndex_, const MSString & str_, unsigned int& startPos_, const char) const { if (startPos_=str_.length()) { return; } } unsigned int endPos = str_.indexOfAnyOf(MSStringTest(APLUS_ISPACE),startPos_); ((Data *)pData_)->elements()[vectIndex_] = str_.subString(startPos_,endPos-startPos_).asUnsigned(); startPos_ = str_.indexOfAnyBut(MSStringTest(APLUS_ISPACE),endPos); } } unsigned int MSIndexVector::Operations::numElements (const MSString & str_, const char) const { return str_.numWords(); } void MSIndexVector::Operations::print (const void *pData_, unsigned int index_, ostream & stream_) const { stream_ << ((Data *)pData_)->elements()[index_] << " "; } void MSIndexVector::Operations::setToNumber (void *pElements_, unsigned int index_, double number_) const { ((Data *)pElements_)->elements()[index_] = (unsigned int)number_; } double MSIndexVector::Operations::getAsNumber (const void *pElements_, unsigned int index_) const { return (double)((Data *)pElements_)->elements()[index_]; } #if HAVE_SSTREAM void MSIndexVector::Operations::readFromStream (void *pData_, unsigned int index_, istringstream & ist) const #else void MSIndexVector::Operations::readFromStream (void *pData_, unsigned int index_, istrstream & ist) const #endif { ist >> ((Data *)pData_)->elements()[index_]; } #if HAVE_SSTREAM void MSIndexVector::Operations::writeToStream (const void *pData_, unsigned int index_, ostringstream & ost) const #else void MSIndexVector::Operations::writeToStream (const void *pData_, unsigned int index_, ostrstream & ost) const #endif { ost << ((Data *)pData_)->elements()[index_]; } #if HAVE_SSTREAM void MSIndexVector::Operations::whitespace (istringstream &) const #else void MSIndexVector::Operations::whitespace (istrstream &) const #endif { } unsigned int MSIndexVector::Operations::stringLen (const char *pString_) const { MSString str (pString_); return str.numWords(); } MSIndexVector::Data& MSIndexVector::Operations::nullData(void) { MS_SAFE_STATIC_INIT(Data,_nullDataMutex); } MSIndexVector::Data::Data (unsigned int size_) : MSData (size_) { } MSIndexVector::Data::~Data() { } MSString MSIndexVector::Data::asDebugInfo() const { MSString result ("MSIndexVector::Data(@"); result += MSString((unsigned long)this).d2x().lowerCase(); result += ",_data="; result += MSString((unsigned long)elements()).d2x().lowerCase(); result += ",_refCount="; result += MSString(refCount()); result += ")"; return result; } void * MSIndexVector::Data::operator new (size_t, unsigned int numEls_) { // We need to allocate memory for sizeof(Data) plus the size of the data elements array // except for the first element which is included in the size of Data // unsigned int realSize; if (numEls_>1) { realSize = sizeof(Data) + (numEls_-1)*sizeof(unsigned int); } else // 0 or 1 elements to be allocated { realSize = sizeof(Data); // Data already includes 1 data element } return (void *) ::new char[realSize]; } MSIndexVector::Data *MSIndexVector::Data::allocateWithLength (unsigned length_) { unsigned int newLength = MSData::computeSize(length_); return new (newLength) Data (newLength); } MSIndexVector::Data *MSIndexVector::Data::allocateWithSize (unsigned size_) { return new (size_)Data(size_); } void MSIndexVector::Data::deallocate() { delete this; } void MSIndexVector::Data::fill (unsigned int *pElements_, unsigned int length_, const unsigned int value_) { while (length_--) *pElements_++ = value_; } void MSIndexVector::Data::copy(const unsigned int *src_, unsigned int *dst_, unsigned int length_) { while (length_--) *dst_++ = *src_++; } void MSIndexVector::Data::copyBackward (const unsigned int *pSrc_, unsigned int *pDest_, unsigned int length_) { while (length_--) *pDest_-- = *pSrc_--; } MSIndexVector::SPick & MSIndexVector::SPick::operator= (const MSIndexVector::SPick & sPick_) { _pVector->set (_index, (*sPick_._pVector)(sPick_._index)); return *this; } MSIndexVector::SPick & MSIndexVector::SPick::operator= (const unsigned int aScalar_) { _pVector->set (_index, aScalar_); return *this; } // postfix increment unsigned int MSIndexVector::SPick::operator++ (int) { unsigned int temp = (*_pVector)(_index); _pVector->set (_index, temp+1); return temp; } // postfix decrement unsigned int MSIndexVector::SPick::operator-- (int) { unsigned int temp = (*_pVector)(_index); _pVector->set (_index, temp-1); return temp; } aplus-fsf-4.22/src/MSTypes/MSIndexedAspectEvent.C0000644000265000001440000000076710772770445015266 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include MSIndexedAspectEvent::~MSIndexedAspectEvent(void) {} const MSSymbol& MSIndexedAspectEvent::symbol(void) { static MSSymbol symbol("MSIndexedAspectEvent"); return symbol; } aplus-fsf-4.22/src/MSTypes/MSIndexedEvent.C0000644000265000001440000000072510772770446014121 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include MSIndexedEvent::~MSIndexedEvent(void) {} const MSSymbol& MSIndexedEvent::symbol(void) { static MSSymbol sym ("MSIndexedEvent"); return sym; } aplus-fsf-4.22/src/MSTypes/MSIndexedFunctions.C0000644000265000001440000001351110772770446015005 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include MSIndexedFunctions MSIndexedFunctions::_indexedFuncs; MSIndexedFunctions::MSIndexedFunctions(void) {} MSIndexedFunctions::~MSIndexedFunctions(void) {} MSIndexVector MSIndexedFunctions::computeIndex(const MSVector& model_,MSIndexVector& index_) { MSIndexVector index; unsigned start=0,stop=model_.length(); if (index_.length()>1) { MSIndexVector t(MSIndexVector::take(index_,-2)); start=t(0); stop=t(1)>stop?stop:t(1); } return index<model_(i)?val:model_(i); return val; } double MSIndexedFunctions::computeAverage(const MSFloatVector& model_,const MSFloatVector& weights_, MSIndexVector& index_) { static MSFloatVector *pModel=0,*pWeights=0; double val=0,weightTotal=0.0; int mLen,wLen; MSIndexVector index(computeIndex(model_,index_)); mLen=model_.length(); wLen=weights_.length(); for (unsigned i=index(0);i0.0?weightTotal:1; if (wLen>0&&wLen!=mLen&&(pModel!=&model_&&pWeights!=&weights_)) { pModel=(MSFloatVector*)&model_; pWeights=(MSFloatVector*)&weights_; MSMessageLog::warningMessage("MSIndexedFunctions::computeAverage error: Weights length %d != model length %d\n", wLen,mLen); } return val; } // // MSIntVector methods // double MSIndexedFunctions::computeIndexedFunction(const MSIntVector& model_,int mode_) {return MSIndexedFunctions::computeIndexedFunction(model_,indexedFuncs().defaultWeights(), indexedFuncs().defaultIndex(),mode_);} double MSIndexedFunctions::computeIndexedFunction(const MSIntVector& model_, const MSFloatVector& weights_,int mode_) {return MSIndexedFunctions::computeIndexedFunction(model_,weights_,indexedFuncs().defaultIndex(),mode_);} double MSIndexedFunctions::computeIndexedFunction(const MSIntVector& model_, const MSFloatVector& weights_, MSIndexVector& index_,int mode_) { switch(mode_) { default: case Total: return computeTotal(model_,index_); case Minimum: return computeMinimum(model_,index_); case Maximum: return computeMaximum(model_,index_); case Average: return computeAverage(model_,weights_,index_); } } double MSIndexedFunctions::computeTotal(const MSIntVector& model_,MSIndexVector& index_) { double val=0; MSIndexVector index(computeIndex(model_,index_)); for (unsigned i=index(0);imodel_(i)?val:model_(i); return val; } double MSIndexedFunctions::computeAverage(const MSIntVector& model_,const MSFloatVector& weights_, MSIndexVector& index_) { static MSIntVector *pModel=0; static MSFloatVector *pWeights=0; double val=0,weightTotal=0.0; int mLen,wLen; mLen=model_.length(); wLen=weights_.length(); MSIndexVector index(computeIndex(model_,index_)); for (unsigned i=index(0);i0.0?weightTotal:1; if (wLen>0&&wLen!=mLen&&(pModel!=&model_&&pWeights!=&weights_)) { pModel=(MSIntVector*)&model_; pWeights=(MSFloatVector*)&weights_; MSMessageLog::warningMessage("MSIndexedFunctions::computeAverage warning: Weights length %d != model length %d\n", wLen,mLen); } return val; } aplus-fsf-4.22/src/MSTypes/MSInt.C0000644000265000001440000002126310772770446012271 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #if HAVE_IOSTREAM #include #else #include #endif #include #include ostream& operator<<(ostream& aStream_,const MSInt& aInt_) { return aStream_<>(istream& aStream_,MSInt& aInt_) { int i; aStream_>>i; aInt_=i; return aStream_; } #ifdef MS_NO_INLINES #include #endif MSString MSInt::asString(void) const { return MSString(_int); } MSString MSInt::asDebugInfo(void) const { MSString result("MSInt(@"); result+=MSString((unsigned long)this).d2x().lowerCase(); result+=",_int="; result+=MSString(_int); result+=",_isSet="; result+=(isSet()==MSTrue)?"MSTrue":"MSFalse"; result+=",_type="; result+=type().symbolName(); result+=")"; return MSString(result); } MSString MSInt::className(void) const { return MSString("MSInt"); } const MSSymbol& MSInt::type(void) const { return symbol(); } MSModel *MSInt::clone(void) const { return new MSInt(*this); } MSModel *MSInt::create(void) const { return new MSInt(); } void MSInt::assign(const MSModel& aModel_) { *this=(MSInt&)aModel_; } long MSInt::compare(const MSModel& aModel_) const { return ::compare(*this,(MSInt&)aModel_); } MSString MSInt::asMSF(void) const { if (isSet()==MSTrue) return MSString(_int); return MSString(); } MSError::ErrorStatus MSInt::setFromMSF(const char *pString_) { int code; if (pString_!=0) code=set(pString_); else code=MSError::BadMSFString; return (MSError::ErrorStatus)code; } const MSSymbol& MSInt::symbol(void) { static MSSymbol sym ("MSInt"); return sym; } void MSInt::unset(void) { if (isSet()==MSTrue) { _int=0,_isSet=MSFalse; changed(); } } MSError::ErrorStatus MSInt::set(const MSString& aString_) { MSError::ErrorStatus code=MSError::MSSuccess; _int=0,_isSet=MSTrue; char *pReturnVal=0; MSString aString=aString_; unsigned index=aString.indexOf(','); while (indexMSInt::MaximumLength+1) code=MSError::IntTooBig; } else if (slen>MSInt::MaximumLength) code=MSError::IntTooBig; if (code==MSError::MSSuccess) { _int=strtol(aString.string(),&pReturnVal,10); if (*pReturnVal!=0) _int=0,code=MSError::BadInt; } } return changed(),code; } MSError::ErrorStatus MSInt::set(const char *pString_) { return set(MSString(pString_)); } MSError::ErrorStatus MSInt::set(const MSString *pString_) { return set(*pString_);} MSError::ErrorStatus MSInt::set(int i_) { _int=i_; _isSet=MSTrue; return changed(),MSError::MSSuccess; } const char *MSInt::format(MSString *pString_) const { return format(*pString_,MSInt::WithoutCommas); } const char *MSInt::format(MSString& aString_) const { return format(aString_,MSInt::WithoutCommas); } const char *MSInt::format(MSString& aString_,const MSFormat& aFormat_) const { return (aFormat_.formatType()==MSFormat::Int)? formatInt(aString_,aFormat_.intFormat(),aFormat_.formatModifier(),_int):format(aString_,MSInt::WithoutCommas); } const char *MSInt::format(MSString *pString_,const MSFormat& aFormat_) const { return format(*pString_,aFormat_); } // MSUtil::comma is too inefficient, and one reason is becuase it does useful // checking to avoid writing past the end of a string (another reason may // be that it doesn't use "register" storage). We need as efficient // a function as possible, otherwise we will spend more time here than // anywhere else. addCommas runs in about 1/100 of the time of MSUtil::comma. // Plan on having enough space in outBuffer_. static void addCommas(register char *inBuffer_,register char *outBuffer_) { // addCommas takes the number string in inBuffer_ and copies it to // outBuffer_,adding commas between the first character and the end // point according to American convention. // ignore leading minus sign if (*inBuffer_=='-') *outBuffer_++=*inBuffer_++; register int places=strlen(inBuffer_); // number of digits to the left of the decimal point register char *cp=inBuffer_+places; // pointer to the end register int remainder=((places-1)%3)+1; // copy 1 to 3 digits before the first comma. while (remainder-->0) *outBuffer_++=*inBuffer_++; // copy a comma and 3 digits until we format to the end. while (inBuffer_3) { char outBuffer[32]; addCommas(buf,outBuffer); aString_=outBuffer; } else aString_=buf; if (modifierChar!='\0') aString_< (int a_,const MSInt& b_) { return MSBoolean(a_> b_._int); } MSBoolean operator>=(int a_,const MSInt& b_) { return MSBoolean(a_>=b_._int); } aplus-fsf-4.22/src/MSTypes/MSIndexedModel.C0000644000265000001440000000147110772770446014077 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include void MSIndexedModel::sendIndexedEvent(const MSIndexVector& aIndexVector_) { MSIndexedEvent aEvent(aIndexVector_); sendEvent(aEvent); } void MSIndexedModel::sendIndexedEvent(unsigned int index_) { MSIndexedEvent aEvent(index_); sendEvent(aEvent); } MSIndexedModel::MSIndexedModel() { } MSIndexedModel::~MSIndexedModel() { } const MSIndexVector& MSIndexedModel::nullIndexVector() { return MSIndexVector::nullVector(); } aplus-fsf-4.22/src/MSTypes/MSIntMatrix.C0000644000265000001440000001134710772770446013460 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MSTypeMatrixHEADER #include #endif #ifndef MSTypeDataHEADER #include #endif #ifdef MSTK_MANUAL_INSTANTIATION #include #include #if defined(MS_VC_TEMPLATE_INSTANTIATION) class MSTypesExport MSTypeMatrix; template MSTypeMatrix; #endif #if defined(MS_XLC_TEMPLATE_INSTANTIATION) #pragma define (MSTypeMatrix) #endif #if defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma instantiate MSTypeMatrix #pragma instantiate MSMatrixSTypePick #if !defined(MS_TEMPLATE_MANUAL_FRIEND_BUG) // The version of EDG used by SGI's dcc compiler has a bug related to access from friends #pragma instantiate ostream& operator<<(ostream&,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix operator-(const MSTypeMatrix&) #pragma instantiate MSTypeMatrix operator+(const MSTypeMatrix&,int) #pragma instantiate MSTypeMatrix operator+(int,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix operator+(const MSTypeMatrix&,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix operator-(const MSTypeMatrix&,int) #pragma instantiate MSTypeMatrix operator-(const MSTypeMatrix&,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix operator*(const MSTypeMatrix&,int) #pragma instantiate MSTypeMatrix operator*(int,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix operator*(const MSTypeMatrix&,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix operator/(const MSTypeMatrix&,int) #pragma instantiate MSTypeMatrix operator/(const MSTypeMatrix&,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix operator+(const MSTypeMatrix&,const MSTypeVector&) #pragma instantiate MSTypeMatrix operator-(const MSTypeMatrix&,const MSTypeVector&) #pragma instantiate MSTypeMatrix operator*(const MSTypeMatrix&,const MSTypeVector&) #pragma instantiate MSTypeMatrix operator/(const MSTypeMatrix&,const MSTypeVector&) #pragma instantiate MSTypeMatrix operator+(const MSTypeVector&,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix operator*(const MSTypeVector&,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix multiply(const MSTypeMatrix&,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix stack(const MSTypeMatrix&,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix adjoin(const MSTypeMatrix&,const MSTypeMatrix&) #endif //MS_TEMPLATE_MANUAL_FRIEND_BUG #endif //MS_EDG_TEMPLATE_INSTANTIATION #if defined(MS_STD_TEMPLATE_INSTANTIATION) template class MSTypeMatrix; template class MSMatrixSTypePick; template ostream& operator<<(ostream&,const MSTypeMatrix&); template MSTypeMatrix operator-(const MSTypeMatrix&); template MSTypeMatrix operator+(const MSTypeMatrix&,int); template MSTypeMatrix operator+(int,const MSTypeMatrix&); template MSTypeMatrix operator+(const MSTypeMatrix&,const MSTypeMatrix&); template MSTypeMatrix operator-(const MSTypeMatrix&,int); template MSTypeMatrix operator-(const MSTypeMatrix&,const MSTypeMatrix&); template MSTypeMatrix operator*(const MSTypeMatrix&,int); template MSTypeMatrix operator*(int,const MSTypeMatrix&); template MSTypeMatrix operator*(const MSTypeMatrix&,const MSTypeMatrix&); template MSTypeMatrix operator/(const MSTypeMatrix&,int); template MSTypeMatrix operator/(const MSTypeMatrix&,const MSTypeMatrix&); template MSTypeMatrix operator+(const MSTypeMatrix&,const MSTypeVector&); template MSTypeMatrix operator-(const MSTypeMatrix&,const MSTypeVector&); template MSTypeMatrix operator*(const MSTypeMatrix&,const MSTypeVector&); template MSTypeMatrix operator/(const MSTypeMatrix&,const MSTypeVector&); template MSTypeMatrix operator+(const MSTypeVector&,const MSTypeMatrix&); template MSTypeMatrix operator*(const MSTypeVector&,const MSTypeMatrix&); template MSTypeMatrix multiply(const MSTypeMatrix&,const MSTypeMatrix&); template MSTypeMatrix stack(const MSTypeMatrix&,const MSTypeMatrix&); template MSTypeMatrix adjoin(const MSTypeMatrix&,const MSTypeMatrix&); #endif //MS_STD_TEMPLATE_INSTANTIATION #endif //MSTK_MANUAL_INSTANTIATION aplus-fsf-4.22/src/MSTypes/MSIntVector.C0000644000265000001440000001031510772770446013450 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #if defined(MS_FORCE_INTERNAL_TEMPLATE_INSTANTIATION) #define MS_MSIntVector_INSTANTIATE #define MSTK_MANUAL_INSTANTIATION #endif #include #ifdef MS_NO_INLINES #include #endif // MS_NO_INLINES #ifdef MSTK_MANUAL_INSTANTIATION #include #include #if defined(MS_XLC_TEMPLATE_INSTANTIATION) #pragma define (MSTypeVector) #endif #if defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma instantiate MSBaseVector > #pragma instantiate MSBuiltinVector #pragma instantiate MSBuiltinSPick #if !defined(MS_TEMPLATE_MANUAL_FRIEND_BUG) // The version of EDG used by SGI's dcc compiler has a bug related to access from friends #pragma instantiate ostream & operator<<(ostream&, const MSBaseVector >&) #endif //MS_TEMPLATE_MANUAL_FRIEND_BUG #endif // MS_EDG_TEMPLATE_INSTANTIATION #if defined(MS_VC_TEMPLATE_INSTANTIATION) template MSBaseVector >; template MSBaseVectorOps >; template MSBuiltinVector; template MSBuiltinVectorOps; template MSBuiltinSPick; static int __instantiateFriends__() // instantiate non-inline friend template functions { if (0) { MSBuiltinVector dummy; operator<<(cout, dummy); } return 0; } static int __dummyInt__=__instantiateFriends__(); #endif //MS_VC_TEMPLATE_INSTANTIATION #if defined(MS_STD_TEMPLATE_INSTANTIATION) template class MSBaseVector >; template class MSBaseVectorOps >; template class MSBuiltinVector; template class MSBuiltinVectorOps; template class MSBuiltinSPick; template ostream & operator<<(ostream&, const MSBaseVector >&); #endif #endif // MSTK_MANUAL_INSTANTIATION MSTypeVector::MSTypeVector() : BuiltinVectorInt() { } MSTypeVector::MSTypeVector (unsigned int length_) : BuiltinVectorInt (length_) { } MSTypeVector::MSTypeVector (unsigned int length_, const int filler_) : BuiltinVectorInt (length_, filler_) { } MSTypeVector::MSTypeVector (const MSTypeVector & vect_) : BuiltinVectorInt (vect_) { } MSTypeVector::MSTypeVector (const BuiltinVectorInt & vect_) : BuiltinVectorInt (vect_) { } MSTypeVector::MSTypeVector (const BaseVectorInt & vect_) : BuiltinVectorInt ((BuiltinVectorInt &)vect_) { } MSTypeVector::MSTypeVector (const char *pString_) : BuiltinVectorInt (pString_) { } MSTypeVector::MSTypeVector (MSTypeData > *pData_, unsigned int len_) : BuiltinVectorInt (pData_, len_) { } MSTypeVector::MSTypeVector (const int *pElements_, unsigned int len_) : BuiltinVectorInt (pElements_, len_) { } MSTypeVector::~MSTypeVector() { } MSTypeVector & MSTypeVector::operator= (const MSTypeVector & vect_) { return (MSTypeVector &) BuiltinVectorInt::operator= (vect_); } MSTypeVector & MSTypeVector::operator= (const BuiltinVectorInt & vect_) { return (*this = (MSTypeVector &)vect_); } MSTypeVector & MSTypeVector::operator= (const BaseVectorInt & vect_) { return (*this = (MSTypeVector &)vect_); } MSTypeVector & MSTypeVector::operator= (const int & value_) { return (MSTypeVector &) BuiltinVectorInt::operator= (value_); } MSTypeVector & MSTypeVector::operator= (const char *pString_) { return (*this = MSTypeVector(pString_)); } MSString MSTypeVector::className() const { return MSString ("MSTypeVector"); } const MSSymbol & MSTypeVector::type() const { return symbol(); } MSModel * MSTypeVector::clone() const { return new MSTypeVector (*this); } MSModel * MSTypeVector::create() const { return new MSTypeVector; } const MSSymbol & MSTypeVector::symbol() { static MSSymbol sym ("MSTypeVector"); return sym; } aplus-fsf-4.22/src/MSTypes/MSLongMatrix.C0000644000265000001440000001125510772770446013623 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MSTypeMatrixHEADER #include #endif #ifndef MSTypeDataHEADER #include #endif #if defined (MSTK_MANUAL_INSTANTIATION) #include #include #if defined(MS_XLC_TEMPLATE_INSTANTIATION) #pragma define (MSTypeMatrix) #endif #if defined(MS_VC_TEMPLATE_INSTANTIATION) template MSTypeMatrix; #endif #if defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma instantiate MSTypeMatrix #pragma instantiate MSMatrixSTypePick #if !defined(MS_TEMPLATE_MANUAL_FRIEND_BUG) // The version of EDG used by SGI's dcc compiler has a bug related to access from friends #pragma instantiate ostream& operator<<(ostream&,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix operator-(const MSTypeMatrix&) #pragma instantiate MSTypeMatrix operator+(const MSTypeMatrix&,long) #pragma instantiate MSTypeMatrix operator+(long,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix operator+(const MSTypeMatrix&,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix operator-(const MSTypeMatrix&,long) #pragma instantiate MSTypeMatrix operator-(const MSTypeMatrix&,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix operator*(const MSTypeMatrix&,long) #pragma instantiate MSTypeMatrix operator*(long,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix operator*(const MSTypeMatrix&,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix operator/(const MSTypeMatrix&,long) #pragma instantiate MSTypeMatrix operator/(const MSTypeMatrix&,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix operator+(const MSTypeMatrix&,const MSTypeVector&) #pragma instantiate MSTypeMatrix operator-(const MSTypeMatrix&,const MSTypeVector&) #pragma instantiate MSTypeMatrix operator*(const MSTypeMatrix&,const MSTypeVector&) #pragma instantiate MSTypeMatrix operator/(const MSTypeMatrix&,const MSTypeVector&) #pragma instantiate MSTypeMatrix operator+(const MSTypeVector&,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix operator*(const MSTypeVector&,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix multiply(const MSTypeMatrix&,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix stack(const MSTypeMatrix&,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix adjoin(const MSTypeMatrix&,const MSTypeMatrix&) #endif //!MS_TEMPLATE_MANUAL_FRIEND_BUG #endif //MS_EDG_TEMPLATE_INSTANTIATION #if defined(MS_STD_TEMPLATE_INSTANTIATION) template class MSTypeMatrix; template class MSMatrixSTypePick; template MSTypeMatrix operator-(const MSTypeMatrix&); template MSTypeMatrix operator+(const MSTypeMatrix&,long); template MSTypeMatrix operator+(long,const MSTypeMatrix&); template MSTypeMatrix operator+(const MSTypeMatrix&,const MSTypeMatrix&); template MSTypeMatrix operator-(const MSTypeMatrix&,long); template MSTypeMatrix operator-(const MSTypeMatrix&,const MSTypeMatrix&); template MSTypeMatrix operator*(const MSTypeMatrix&,long); template MSTypeMatrix operator*(long,const MSTypeMatrix&); template MSTypeMatrix operator*(const MSTypeMatrix&,const MSTypeMatrix&); template MSTypeMatrix operator/(const MSTypeMatrix&,long); template MSTypeMatrix operator/(const MSTypeMatrix&,const MSTypeMatrix&); template MSTypeMatrix operator+(const MSTypeMatrix&,const MSTypeVector&); template MSTypeMatrix operator-(const MSTypeMatrix&,const MSTypeVector&); template MSTypeMatrix operator*(const MSTypeMatrix&,const MSTypeVector&); template MSTypeMatrix operator/(const MSTypeMatrix&,const MSTypeVector&); template MSTypeMatrix operator+(const MSTypeVector&,const MSTypeMatrix&); template MSTypeMatrix operator*(const MSTypeVector&,const MSTypeMatrix&); template MSTypeMatrix multiply(const MSTypeMatrix&,const MSTypeMatrix&); template MSTypeMatrix adjoin(const MSTypeMatrix&,const MSTypeMatrix&); #endif //MS_STD_TEMPLATE_INSTANTIATION #endif // MSTK_MANUAL_INSTANTIATION aplus-fsf-4.22/src/MSTypes/MSLongVector.C0000644000265000001440000001054710772770446013624 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #if defined(MS_FORCE_INTERNAL_TEMPLATE_INSTANTIATION) #define MS_MSLongVector_INSTANTIATE #define MSTK_MANUAL_INSTANTIATION #endif #include #ifdef MS_NO_INLINES #include #endif // MS_NO_INLINES #ifdef MSTK_MANUAL_INSTANTIATION #include #include #if defined(MS_XLC_TEMPLATE_INSTANTIATION) #pragma define (MSTypeVector) #endif #if defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma instantiate MSBaseVector > #pragma instantiate MSBuiltinVector #pragma instantiate MSBuiltinSPick #if !defined(MS_TEMPLATE_MANUAL_FRIEND_BUG) // The version of EDG used by SGI's dcc compiler has a bug related to access from friends #pragma instantiate ostream & operator<<(ostream&, const MSBaseVector >&) #endif //MS_TEMPLATE_MANUAL_FRIEND_BUG #endif //MS_EDG_TEMPLATE_INSTANTIATION #if defined(MS_VC_TEMPLATE_INSTANTIATION) template MSBaseVector >; template MSBaseVectorOps >; template MSBuiltinVector; template MSBuiltinVectorOps; template MSBuiltinSPick; static int __instantiateFriends__() // instantiate non-inline friend template functions { if (0) { MSBuiltinVector dummy; operator<<(cout, dummy); } return 0; } static int __dummyInt__=__instantiateFriends__(); #endif //MS_VC_TEMPLATE_INSTANTIATION #if defined(MS_STD_TEMPLATE_INSTANTIATION) template class MSBaseVector >; template class MSBaseVectorOps >; template class MSBuiltinVector; template class MSBuiltinVectorOps; template class MSBuiltinSPick; template ostream & operator<<(ostream&, const MSBaseVector >&); #endif #endif // MSTK_MANUAL_INSTANTIATION MSTypeVector::MSTypeVector() : BuiltinVectorLong() { } MSTypeVector::MSTypeVector (unsigned int length_) : BuiltinVectorLong (length_) { } MSTypeVector::MSTypeVector (unsigned int length_, const long & filler_) : BuiltinVectorLong (length_, filler_) { } MSTypeVector::MSTypeVector (const MSTypeVector & vect_) : BuiltinVectorLong (vect_) { } MSTypeVector::MSTypeVector (const BuiltinVectorLong & vect_) : BuiltinVectorLong (vect_) { } MSTypeVector::MSTypeVector (const BaseVectorLong & vect_) : BuiltinVectorLong ((BuiltinVectorLong &)vect_) { } MSTypeVector::MSTypeVector (const char *pString_) : BuiltinVectorLong (pString_) { } MSTypeVector::MSTypeVector (MSTypeData > *pData_, unsigned int len_) : BuiltinVectorLong (pData_, len_) { } MSTypeVector::MSTypeVector (const long *pElements_, unsigned int len_) : BuiltinVectorLong (pElements_, len_) { } MSTypeVector::~MSTypeVector() { } MSTypeVector & MSTypeVector::operator= (const MSTypeVector & vect_) { return (MSTypeVector &) BuiltinVectorLong::operator= (vect_); } MSTypeVector & MSTypeVector::operator= (const BuiltinVectorLong & vect_) { return (*this = (MSTypeVector &)vect_); } MSTypeVector & MSTypeVector::operator= (const BaseVectorLong & vect_) { return (*this = (MSTypeVector &)vect_); } MSTypeVector & MSTypeVector::operator= (const long & value_) { return (MSTypeVector &) BuiltinVectorLong::operator= (value_); } MSTypeVector & MSTypeVector::operator= (const char *pString_) { return (*this = MSTypeVector(pString_)); // return (MSTypeVector &) BuiltinVectorLong::operator= (pString_); } MSString MSTypeVector::className() const { return MSString ("MSTypeVector"); } const MSSymbol & MSTypeVector::type() const { return symbol(); } MSModel * MSTypeVector::clone() const { return new MSTypeVector (*this); } MSModel * MSTypeVector::create() const { return new MSTypeVector; } const MSSymbol & MSTypeVector::symbol() { static MSSymbol sym ("MSTypeVector"); return sym; } aplus-fsf-4.22/src/MSTypes/MSMBSDate.C0000644000265000001440000006630510772770446012764 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #if HAVE_IOSTREAM #include #else #include #endif #include #include #include #include #include #include #include #include #include #include // static constants const unsigned long JAN_01_1900=1900; // Reference date for 30/360 calculations static const char *NullString=""; MSDate::MSDateFormat MSMBSDate::_defaultFormat(MSDate::Slash4); MSString MSMBSDate::_strftimeDefaultFormat("%D"); MSBoolean MSMBSDate::_defaultConstructToToday(MSFalse); #ifdef MS_NO_INLINES #include #endif //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // other constructors //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MSMBSDate::MSMBSDate(const MSDate& aDate_) { MSMonth m; MSDay d; MSYear y; aDate_.asMonthDayYear(m,d,y); if (d==31) d--; _date=as30_360(m,d,y); } MSMBSDate::MSMBSDate(const MSTime &aDate_,MSTime::MSTimeZone zone_) : MSDate(MSJulian(0)) { MSString s; (void)aDate_.format(&s,MSTime::MonthDayYear,zone_); set(&s); } #if defined(MS_NEED_STRPTIME_DECLARATION) extern "C" char *strptime(const char*, const char*, struct tm*); #endif MSMBSDate::MSMBSDate(const MSString& aString_,const char* strptimeFormat_) : MSDate(MSJulian(0)) { struct tm aTimeStruct={0}; #if defined(MS_NO_STRPTIME) MSMessageLog::errorMessage("MSMBSDate: strptime() not supported for this platform.\n"); _date=0; #else char *pString=strptime((char *)aString_.string(),(char *)strptimeFormat_,&aTimeStruct); if (pString==0) _date=0; else _date=as30_360(aTimeStruct.tm_mon+1,aTimeStruct.tm_mday,aTimeStruct.tm_year+1900); #endif } MSMBSDate::~MSMBSDate(void) {} //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // MSModel virtual methods //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MSString MSMBSDate::asString(void) const { MSString aString; return MSString(format(aString,MSDate::defaultFormat())); } MSString MSMBSDate::asDebugInfo(void) const { MSString result("MSMBSDate(@"); result+=MSString((unsigned long)this).d2x().lowerCase(); result+=",_date="; result+=MSString((unsigned long)asInternal()); result+=",_locale="; result+=MSString((int)_locale); result+=",_override="; result+=MSString((unsigned long)_override); result+=",_useOverride="; result+=MSString((int)_useOverride); result+=",_firstTime="; result+=MSString((int)_firstTime); result+=",_defaultFormat="; result+=MSString((int)_defaultFormat); result+=",_strftimeDefaultFormat="; result+=_strftimeDefaultFormat; result+=",_defaultConstructToToday="; result+=(defaultConstructToToday()==MSTrue?"MSTrue":"MSFalse"); result+=",_type="; result+=type().symbolName(); result+=")"; return MSString(result); } MSString MSMBSDate::className(void) const { return MSString("MSMBSDate"); } const MSSymbol& MSMBSDate::type(void) const { return symbol(); } MSModel *MSMBSDate::clone(void) const { return new MSMBSDate(*this); } MSModel *MSMBSDate::create(void) const { return new MSMBSDate(); } void MSMBSDate::assign(const MSModel& aModel_) { *this=(MSMBSDate&)aModel_; } long MSMBSDate::compare(const MSModel& aModel_) const { return ::compare(*this,(MSMBSDate&)aModel_); } MSString MSMBSDate::asMSF(void) const { MSString buf; if (isSet()==MSTrue) (void)format(&buf,MSDate::Database); return buf; } MSError::ErrorStatus MSMBSDate::setFromMSF(const char *pString_) { int code; if (pString_!=0) code=set(pString_); else code=MSError::BadMSFString; return (MSError::ErrorStatus)code; } const MSSymbol& MSMBSDate::symbol(void) { static MSSymbol sym ("MSMBSDate"); return sym; } MSError::ErrorStatus MSMBSDate::set(const MSString *pString_) { return set(pString_->string()); } MSError::ErrorStatus MSMBSDate::set(const MSString& aString_) { return set(aString_.string()); } MSError::ErrorStatus MSMBSDate::set(const char *pString_) { MSError::ErrorStatus rc=MSError::MSSuccess; char *f1,*f2,*f3; char buf[80]; char *cp; if (*pString_=='\0'||strcmp(pString_,NullString)==0||strcmp(pString_,"/ /")==0) { _date=nullDate(); // handle null string } else if (MSUtil::hasAlpha(pString_)) { // No alpha input formats are currently allowed // in the future we could allow any of the // output formats, e.g., 11-Nov-1992 rc=MSError::BadDate; } else { // Look for slashes strncpy(buf,pString_,sizeof(buf)); f1=buf; // point to the start of string cp=strchr(buf,'/'); if (cp) { *cp='\0'; // nul-terminate first field cp++; // point to the start of second field f2=cp; cp=strchr(f2,'/'); if (cp) { *cp='\0'; // nul-terminate second field cp++; // point to the start of third field f3=cp; switch (_locale) { // set expects month, day, year case European: return set(f2,f1,f3); case American: return set(f1,f2,f3); case Japanese: return set(f2,f3,f1); default: MSMessageLog::warningMessage("MSMBSDate: invalid value of order flag\n"); } } else rc=MSError::BadDate; } cp=strchr(buf,'.'); if(cp!=0) { // check if format = dd.mm.yyyy *cp='\0'; // nul-terminate first field cp++; // point to the start of second field f2=cp; cp=strchr(f2,'.'); if (cp!=0) { *cp='\0'; // nul-terminate second field cp++; // point to the start of third field f3=cp; // set expects month, day, year return set(f2,f1,f3); } else rc=MSError::BadDate; } cp=strchr(buf,'-'); if (cp) { *cp='\0'; // nul-terminate first field cp++; // point to the start of second field f2=cp; cp=strchr(f2,'-'); if (cp) { *cp='\0'; // nul-terminate second field cp++; // point to the start of third field f3=cp; switch (_locale) { // set expects month, day, year case European: return set(f2,f1,f3); case American: return set(f1,f2,f3); case Japanese: return set(f2,f3,f1); default: MSMessageLog::warningMessage("MSMBSDate: invalid value of order flag\n"); } } else rc=MSError::BadDate; } else { // no slashes, no period, no dashes, no alpha - must be internal fmt (digits) if (MSUtil::isNumeric(buf)==MSFalse) { if (MSUtil::isSpace(buf)==MSTrue) _date=nullDate(); // May be full of spaces else rc=MSError::BadDate; } else { // format of yyyymmdd if(strlen(pString_)>7) { f1=f2=f3=buf; strncpy(buf,pString_,4); f1[4]='\0'; // strncpy won't insert null if not encountered f2+=5; strncpy(f2,pString_+4,2); f2[2]='\0'; f3+=8; strncpy(f3,pString_+6,2); f3[2]='\0'; // set expects month, day, year return set(f2,f3,f1); } else rc=MSError::BadDate; } } } if (rc==MSError::MSSuccess) changed(); return (rc); } MSError::ErrorStatus MSMBSDate::set(const char *m_,const char *d_,const char *y_) { if ((MSUtil::isNumeric(m_)==MSFalse)|| (MSUtil::isNumeric(d_)==MSFalse)|| (MSUtil::isNumeric(y_)==MSFalse)) { _date=nullDate(); changed(); return MSError::BadDate; } MSDay day=atoi(d_); if (day==31) day--; MSJulian date=as30_360(atoi(m_),day,atoi(y_)); if (date==nullDate()) return MSError::BadDate; _date=date; changed(); return (MSError::MSSuccess); } MSError::ErrorStatus MSMBSDate::set(int m_,int d_,int y_) { MSDay d=(d_==31?30:d_); _date=as30_360(m_,d,y_); changed(); return (_date!=nullDate())?MSError::MSSuccess:MSError::BadDate; } const char *MSMBSDate::format(MSString *pString_) const { return format(pString_,defaultFormat()); } const char *MSMBSDate::format(MSString& aString_) const { return format(&aString_,defaultFormat()); } const char *MSMBSDate::format(MSString *pString_,const char *format_) const { return format(*pString_,format_); } const char *MSMBSDate::format(MSString& aString_,const char *format_) const { #ifdef MS_THREAD_SAFE_FUNCTIONS struct tm tms; #endif //MS_THREAD_SAFE_FUNCTIONS MSString aString(0,((format_!=0)?strlen(format_):0)+3); // __tm_zone, a member of struct tm for the sun architecture // must be initialized if the strftime format %Z is used. Can // get this value from localtime. time_t now=time(0); struct tm *pCalendarTime=MS_LOCALTIME(&now,&tms); MSMonth m; MSDay d; MSYear y; asMonthDayYear(m,d,y); pCalendarTime->tm_sec=0; pCalendarTime->tm_min=0; pCalendarTime->tm_hour=0; pCalendarTime->tm_mday=d; pCalendarTime->tm_mon=m-1; pCalendarTime->tm_year=y-1900; pCalendarTime->tm_wday=weekDay()==7?0:weekDay(); pCalendarTime->tm_yday=dayOfYear()-1; pCalendarTime->tm_isdst=-1; int numberOfChars; while ((numberOfChars=strftime((char*)aString.string(),aString.length(),format_,pCalendarTime))==0) { aString=MSString(0,2*aString.length()); } // remove the terminating null from strftime. strftime returns the number of characters // produced not including the terminating null character. aString=MSString(aString.string(),numberOfChars); aString_=aString.string(); return aString_; } const char *MSMBSDate::format(MSString& aString_,const MSFormat& aFormat_) const { return (aFormat_.formatType()==MSFormat::Date)?format(aString_,aFormat_.dateFormat()):format(aString_); } const char *MSMBSDate::format(MSString *pString_,const MSFormat& aFormat_) const { return format(*pString_,aFormat_); } const char *MSMBSDate::format(MSString *pString_,MSDateFormat format_) const { return format(*pString_,format_); } const char *MSMBSDate::format(MSString& aString_,MSDateFormat format_) const { char buf[64]; MSMonth m; MSDay d; MSYear y; // Don't want to call asMonthDayYear if the format is Strftime. // It gets called in the strftime format method. if (format_!=Strftime) asMonthDayYear(m,d,y); aString_.removeAll(); buf[0]='\0'; switch (format_) { case Slash: if (_date==nullDate()) aString_=NullString; else { // Format as 11/15/92 switch (_locale) { case European: sprintf(buf,"%02d/%02d/%02d",d,m,y%100); break; case American: sprintf(buf,"%02d/%02d/%02d",m,d,y%100); break; case Japanese: sprintf(buf,"%02d/%02d/%02d",y%100,m,d); break; default: MSMessageLog::warningMessage("MSMBSDate: invalid value of order flag\n"); break; } aString_+=buf; } break; case Slash4: if (_date==nullDate()) aString_=NullString; else { // Format as 11/15/1992 switch (_locale) { case European: sprintf(buf,"%02d/%02d/%04d",d,m,y); break; case American: sprintf(buf,"%02d/%02d/%04d",m,d,y); break; case Japanese: sprintf(buf,"%04d/%02d/%02d",y,m,d); break; default: MSMessageLog::warningMessage("MSMBSDate: invalid value of order flag\n"); break; } aString_+=buf; } break; case Terse: if (_date==nullDate()) aString_=" - - "; else { // Format as 11-Nov-92 switch (_locale) { case European: sprintf(buf,"%02d-%3.3s-%02d",d,_monthNames[m-1],y%100); break; case American: sprintf(buf,"%02d-%3.3s-%02d",d,_monthNames[m-1],y%100); break; case Japanese: sprintf(buf,"%02d-%3.3s-%02d",y%100,_monthNames[m-1],d); break; default: MSMessageLog::warningMessage("MSMBSDate: invalid value of order flag\n"); break; } aString_+=buf; } break; case Terse4: if (_date==nullDate()) aString_=" - - "; else { // Format as 11-Nov-1992 switch (_locale) { case European: sprintf(buf,"%02d-%3.3s-%04d",d,_monthNames[m-1],y); break; case American: sprintf(buf,"%02d-%3.3s-%04d",d,_monthNames[m-1],y); break; case Japanese: sprintf(buf,"%04d-%3.3s-%02d",y,_monthNames[m-1],d); break; default: MSMessageLog::warningMessage("MSMBSDate: invalid value of order flag\n"); break; } aString_+=buf; } break; case Long: if (_date==nullDate()) aString_=" , "; else { // Format as November 15, 1992 switch (_locale) { case European: sprintf(buf,"%s %d, %4d",_monthNames[m-1],d,y); break; case American: sprintf(buf,"%s %d, %4d",_monthNames[m-1],d,y); break; case Japanese: sprintf(buf,"%4d %s %d",y,_monthNames[m-1],d); break; default: MSMessageLog::warningMessage("MSMBSDate: invalid value of order flag\n"); break; } aString_+=buf; } break; case MonthYear: if (_date==nullDate()) aString_=" "; else { // Format as Nov 92 sprintf(buf,"%3.3s %02d",_monthNames[m-1],y%100); aString_+=buf; } break; case YearMonthDay: if (_date==nullDate()) aString_=" / / "; else { sprintf(buf,"%04d/%02d/%02d",y,m,d); aString_+=buf; } break; case Year2MonthDay: if (_date==nullDate()) aString_=" / / "; else { sprintf(buf,"%02d/%02d/%02d",y%100,m,d); aString_+=buf; } break; case EuropeanDot: if (_date==nullDate()) aString_=" . . "; else { // Format as dd.mm.yy sprintf(buf,"%02d.%02d.%02d",d,m,y%100); aString_+=buf; } break; case EuropeanDot4: if (_date==nullDate()) aString_=" . . "; else { // Format as dd.mm.yyyy sprintf(buf,"%02d.%02d.%04d",d,m,y); aString_+=buf; } break; case Database: if (_date==nullDate()) aString_=NullString; else { // Format as yyyymmdd sprintf(buf,"%04d%02d%02d",y,m,d); aString_+=buf; } break; case Julian: if (_date==nullDate()) aString_=NullString; else { sprintf(buf,"%d",(_date)); aString_+=buf; } break; case Strftime: if (_date==nullDate()) aString_=NullString; else format(aString_,(const char *)strftimeDefaultFormat()); break; default: MSMessageLog::warningMessage("MSMBSDate: invalid value of format\n"); break; } return aString_.string(); } void MSMBSDate::setToday(void) { _date = currentDate(); changed(); } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // static member functions //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Convert Gregorian calendar date to the corresponding 30/360 day number. // Gregorian calendar started on Sep. 14, 1752. // Returns 0 if the date is invalid. MSJulian MSMBSDate::as30_360(MSMonth month_,MSDay day_,MSYear year_) { if (year_<=99) year_+=year_<=MS_PIVOT_YEAR?2000:1900; if (year_0) { dt1=d2_; dt2=d1_; } else if (compareResult==0) return 0; // format m, d, y and convert to signed ints dt1.asMonthDayYear(Tm1,Td1,Ty1); m1=Tm1; d1=Td1; y1=Ty1; dt2.asMonthDayYear(Tm2,Td2,Ty2); m2=Tm2; d2=Td2; y2=Ty2; // The algorithm is... // if (m1==2) // if February { // modification from MSDate's algorithm - normalize the last day of Februrary // (based on request for change from Dan Evison (2/7/97) // MSDay lastFebDay = (MSDate::leapYear(Ty1)==MSTrue) ? _daysInMonth[m1]+1 : _daysInMonth[m1]; if (d1==lastFebDay) { d1=30; } } if (d1==31) d1=30; if (d2==31&&(d1==30||d1==31)) d2=30; result=(y2-y1)*360+(m2-m1)*30+(d2-d1); return result; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Member Functions //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // return represenation of this date as a julian number MSJulian MSMBSDate::date(void) const { MSMonth m; MSDay d; MSYear y; asMonthDayYear(m,d,y); return asJulianNumber(m,d,y); } MSBoolean MSMBSDate::between(const MSDate& d1_,const MSDate& d2_) const { return MSBoolean(_date>=d1_.asInternal()&&_date<=d2_.asInternal()); } MSDay MSMBSDate::dayOfYear(void) const { return _date-as30_360(12,31,year()-1); } // Returns the day of the month of this MSMBSDate. MSDay MSMBSDate::dayOfMonth(void) const { MSMonth m; MSDay d; MSYear y; asMonthDayYear(m,d,y); return d; } MSDay MSMBSDate::daysInMonth(void) const { return 30; } MSDay MSMBSDate::daysInYear(void) const { return 360; } unsigned MSMBSDate::weekOfYear(void) const { return (dayOfYear()/7)+1; } // Return the number of the first day of a given month // Return 0 if "month" is outside of the range 1 through 12, inclusive. MSDay MSMBSDate::firstDayOfMonth(void) const { return firstDayOfMonth(month()); } MSDay MSMBSDate::firstDayOfMonth(MSMonth month_) const { if (assertIndexOfMonth(month_)==MSFalse) return 0; return (month_-1)*30+1; } void MSMBSDate::setFirstDayOfMonth(void) { MSMonth m; MSDay d; MSYear y; asMonthDayYear(m,d,y); _date-=(d-1); changed(); } // Return the number of the last day of a given month. // Return 0 if "month" is outside of the range 1 through 12, inclusive. MSDay MSMBSDate::lastDayOfMonth(void) const { return lastDayOfMonth(month()); } MSDay MSMBSDate::lastDayOfMonth(MSMonth month_) const { MSDay answer=firstDayOfMonth(month_+1); return answer?answer-1:0; } void MSMBSDate::setLastDayOfMonth(void) { MSMonth m; MSDay d; MSYear y; asMonthDayYear(m,d,y); _date+=30-d; changed(); } MSBoolean MSMBSDate::isSet() const { return _date==nullDate()?MSFalse:MSTrue; } MSBoolean MSMBSDate::isValid(void) const { return MSBoolean(_date>0); } MSBoolean MSMBSDate::isLeapYear(void) const { return leapYear(year()); } MSBoolean MSMBSDate::leap(void) const { return leapYear(year()); } const char* MSMBSDate::nameOfDay(void) const { return dayName(weekDay());} const char* MSMBSDate::nameOfMonth(void) const { return monthName(month());} MSDate MSMBSDate::min(const MSDate& d_) const { if (d_.asInternal()<_date) return d_; else return *this; } MSDate MSMBSDate::max(const MSDate& d_) const { if (d_.asInternal()>_date) return d_; else return *this; } // Returns the month of this MSMBSDate. MSMonth MSMBSDate::month() const { MSMonth m; MSDay d; MSYear y; asMonthDayYear(m,d,y); return m; } MSDate MSMBSDate::previous(const char *dayName) const { return previous(dayOfWeek(dayName)); } MSDate MSMBSDate::previous(MSDay desiredDayOfWeek_) const { // Renumber the desired and current day of week to start at 0 (Monday) // and end at 6 (Sunday). desiredDayOfWeek_--; MSDay thisDayOfWeek=weekDay()-1; MSJulian j=_date; // Have to determine how many days difference from current day back to // desired, if any. Special calculation under the 'if' statement to // effect the wraparound counting from Monday (0) back to Sunday (6). if (desiredDayOfWeek_>thisDayOfWeek) thisDayOfWeek+=7-desiredDayOfWeek_; else thisDayOfWeek-=desiredDayOfWeek_; j-=thisDayOfWeek; // Adjust j to set it at desired day of week. return MSMBSDate(j); } MSDay MSMBSDate::weekDay(void) const { MSDate d(*this); return d.weekDay(); } // Returns the year of this MSMBSDate. MSYear MSMBSDate::year(void) const { MSMonth m; MSDay d; MSYear y; asMonthDayYear(m,d,y); return y; } // Convert a 30/360 day number to its corresponding Gregorian calendar date. void MSMBSDate::asMonthDayYear(MSMonth& month_,MSDay& day_,MSYear& year_) const { month_=day_=year_=0; if (_date!=nullDate()) { div_t year=div(_date,360); div_t month=div(year.rem,30); year_=year.quot+JAN_01_1900; month_=month.quot+1; day_=month.rem; if (month.rem==0) { day_=30,month_--; if (month.quot==0) month_=12,year_--; } } } void MSMBSDate::nextWeekday(void) { switch (weekDay()) { case Saturday: _date+=2; changed(); break; case Sunday: _date++; changed(); break; default: break; } } void MSMBSDate::prevWeekday(void) { switch (weekDay()) { case Saturday: _date--; changed(); break; case Sunday: _date-=2; changed(); break; default: break; } } MSBoolean MSMBSDate::isWeekday(void) const { MSBoolean rc; switch (weekDay()) { case Monday: case Tuesday: case Wednesday: case Thursday: case Friday: rc=MSTrue; break; case Saturday: case Sunday: rc=MSFalse; break; default: rc=MSFalse; break; } return rc; } MSBoolean MSMBSDate::isWeekend(void) const { MSBoolean rc; switch (weekDay()) { case Monday: case Tuesday: case Wednesday: case Thursday: case Friday: rc=MSFalse; break; case Saturday: case Sunday: rc=MSTrue; break; default: rc=MSFalse; break; } return rc; } // This is the tricky part. Adding a term to a date. // NormalizeAndSet is an internal function to // set the date to the given month, day, and year, forcing it to // be the last day of the month if lastOfMonth is MSTrue. Day must be // 1-31, and lastOfMonth must be true if day is 31. Month may be negative. void MSMBSDate::normalizeAndSet(int m_, int d_,int y_,int lastOfMonth_) { // normalize month if (m_>12) { m_-=1; y_+=m_/12; m_%=12; m_+=1; } else if (m_<1) { // must be careful because (-14/-12) can be -1 or -2, // and (-14%-12) can be -2 or 10. Let's keep everything positive. int yearsBack=((-m_)/12)+1; m_+=yearsBack*12; y_-=yearsBack; } // Now fix up the day of the month. // If the start date was the end of the month, the end date is the // end of the month. Otherwise, if the start date was not the end // of the month, but its day of month is illegal in the end month // (which can only happen if the end month is Feb.), set the end date // to the end of the month if (lastOfMonth_) d_=30; _date=as30_360(m_,d_,y_); changed(); } MSMBSDate& MSMBSDate::operator+=(const MSTerm& t_) { if ((t_.years()!=0)||(t_.months()!=0)) { int m; int d; int y; MSMonth mT; MSDay dT; MSYear yT; asMonthDayYear(mT,dT,yT); m=int(mT); d=int(dT); y=int(yT); int wasLastOfMonth=(((m==2)&&leapYear(y))?d==29:d==_daysInMonth[m]); y+=t_.years(); m+=t_.months(); normalizeAndSet(m,d,y,wasLastOfMonth); } // now add in the number of days in term _date+=t_.days(); changed(); return *this; } MSMBSDate& MSMBSDate::operator-=(const MSTerm& t_) { if ((t_.years() != 0) || (t_.months() != 0)) { int m; int d; int y; MSMonth mT; MSDay dT; MSYear yT; asMonthDayYear(mT,dT,yT); m=int(mT); d=int(dT); y=int(yT); int wasLastOfMonth=(((m==2)&&(leapYear(y)==MSTrue))?d==29:d==_daysInMonth[m]); y-=t_.years(); m-=t_.months(); normalizeAndSet(m,d,y,wasLastOfMonth); } // now subtract out the number of days in term _date-=t_.days(); changed(); return *this; } // Special private constructors. They allow us to take advantage of the // return value optimization (RV0). See section 12.1c of the ARM. MSMBSDate::MSMBSDate(const MSMBSDate& date_,const MSTerm& term_,MSMBSDate::Operator operator_) { _date=date_._date; switch(operator_) { case Plus: *this+=term_; break; case Minus: *this-=term_; break; default: break; } } MSMBSDate::MSMBSDate(const MSMBSDate& date_,const MSNormalizedYears& ny_,MSMBSDate::Operator operator_) { _date=date_._date; switch(operator_) { case Plus: _date+=ny_.days(); break; case Minus: _date-=ny_.days(); break; default: break; } } int MSMBSDate::operator-(const MSMBSDate& d_) const { return int(long(_date)-long(d_._date)); } MSMBSDate MSMBSDate::operator+(const MSTerm& term_) const { return MSMBSDate(*this,term_,MSMBSDate::Plus); } MSMBSDate MSMBSDate::operator+(const MSNormalizedYears& ny_) const { return MSMBSDate(*this,ny_,MSMBSDate::Plus); } MSMBSDate MSMBSDate::operator-(const MSTerm& term_) const { return MSMBSDate(*this,term_,MSMBSDate::Minus); } MSMBSDate MSMBSDate::operator-(const MSNormalizedYears& ny_) const { return MSMBSDate(*this,ny_,MSMBSDate::Minus); } MSMBSDate MSMBSDate::operator+(int d_) const { return MSMBSDate(_date+d_); } MSMBSDate MSMBSDate::operator-(int d_) const { return MSMBSDate(_date-d_); } MSMBSDate& MSMBSDate::operator+=(int d_) { _date+=d_; changed(); return *this; } MSMBSDate& MSMBSDate::operator-=(int d_) { _date-=d_; changed(); return *this; } MSMBSDate& MSMBSDate::operator+=(const MSNormalizedYears& ny_) { *this+=ny_.days(); return *this; } MSMBSDate& MSMBSDate::operator-=(const MSNormalizedYears& ny_) { *this-=ny_.days(); return *this; } MSMBSDate operator+(int i_,const MSMBSDate& d_) { return d_+i_; } MSMBSDate operator+(const MSTerm& t_,const MSMBSDate& d_) { return d_+t_; } MSMBSDate operator+(const MSNormalizedYears& y_,const MSMBSDate& d_) { return d_+y_.days(); } ostream& operator<<(ostream& aStream_,const MSMBSDate& aDate_) { MSString s; return aStream_<>(istream& aStream_,MSMBSDate& aDate_) { MSString aString; aStream_>>aString; aDate_.set(aString); return aStream_; } MSJulian MSMBSDate::currentDate(void) { static MSBoolean firstTime=MSTrue; static MSJulian override=0; static MSBoolean useOverride=MSFalse; if (firstTime==MSTrue) { firstTime=MSFalse; char *cp=getenv("TB_DATE_OVERRIDE"); if (cp) { MSMBSDate d; if (d.set(cp)==MSError::MSSuccess) { override=d._date; useOverride=MSTrue; } else { MSMessageLog::errorMessage("MSMBSDate: TB_DATE_OVERRIDE contains an invalid date\n"); MSMessageLog::errorMessage("MSMBSDate: ignoring attempt to override\n"); useOverride=MSFalse; } } else { useOverride=MSFalse; } } if (useOverride==MSTrue) { return override; } else { #ifdef MS_THREAD_SAFE_FUNCTIONS struct tm tms; #endif //MS_THREAD_SAFE_FUNCTIONS time_t clk=time(0); struct tm *now=MS_LOCALTIME(&clk,&tms); return as30_360(now->tm_mon+1,now->tm_mday,now->tm_year+1900); } } // converts this MSMBSDate to calendar time - time in seconds // since 00:00:00, January 1, 1970, with a correction for the time // zone. The time is set to midnight of this date. time_t MSMBSDate::asCalendarTime(MSTime::MSTimeZone zone_) const { time_t rc=-1; if (asInternal()!=nullDate()) { struct tm aTimeStruct={0}; MSMonth m; MSDay d; MSYear y; asMonthDayYear(m,d,y); aTimeStruct.tm_mday=d; aTimeStruct.tm_mon=m-1; aTimeStruct.tm_year=y; aTimeStruct.tm_isdst=-1; // tm_wday and tm_yday fields are ignored rc = MSTime::greenwichMeanTime(&aTimeStruct, zone_); } return rc; } aplus-fsf-4.22/src/MSTypes/MSMBStringBuffer.C0000644000265000001440000021001010772770446014344 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// extern "C" { #include #include #include #include } #include #ifndef MSStringEnumHEADER #include #endif #ifndef MSStringTestHEADER #include #endif /*------------------------------------------------------------------------------ | createMSMBStringBuffer(void) | | used by MSStringBuffer to create MSMSStringBuffer objects | ------------------------------------------------------------------------------*/ MSStringBuffer *createMSMBStringBuffer(void) { return new (0) MSMBStringBuffer(0); } /*------------------------------------------------------------------------------ | MSMBStringBuffer::className | ------------------------------------------------------------------------------*/ const char *MSMBStringBuffer::className(void) const { return "MSMBStringBuffer"; } /*------------------------------------------------------------------------------ | MSMBStringBuffer::MSMBStringBuffer | | | | Construct a buffer of the specified length. The "data" member | | array must actually be of length 1 greater than the argument | | value (this is achieved automatically via use of the overloaded | | operator new for class MSStringBuffer). | | | | The terminating (extra) byte is set to null. | | | | Notes: | | 1. This method is protected. MSMBStringBufferss must be obtained by using | | MSMBStringBuffer::nullBuffer and subsequent newBuffer calls to existing | | MSMBStringBuffer objects. The only non-heap instance of this class is | | the static MSMBStringBuffer::nullBuffer object. | ------------------------------------------------------------------------------*/ MSMBStringBuffer::MSMBStringBuffer(unsigned len) : MSStringBuffer(len) {} /*------------------------------------------------------------------------------ | MSMBStringBuffer::~MSMBStringBuffer | | | | Empty dtor to prevent generation of static version. | ------------------------------------------------------------------------------*/ MSMBStringBuffer::~MSMBStringBuffer(void) {} /*------------------------------------------------------------------------------ | MSMBStringBuffer::allocate | | | | Allocate a new MSStringBuffer of the same type as the receiver | ------------------------------------------------------------------------------*/ MSStringBuffer *MSMBStringBuffer::allocate(unsigned newLen) const { return new (newLen)MSMBStringBuffer(newLen); } /*------------------------------------------------------------------------------ | MSMBStringBuffer::rightJustify | | | | This function right justifies the receiver in a new buffer of the | | given length and returns the address of the new buffer. | | | | The right justification algorithm is as follows: | | | | 1. Calculate how much padding will be needed on the left. | | 2. Calculate how many bytes of the current buffer will be | | transferred to the right-justified result. | | 3. Determine if the first byte of the new buffer is the 2nd byte | | of a DBCS character. If so,replace it with the padCharacter. | | 4. return a new buffer comprised of the "prefix" pad bytes | | and the portion of the receiver calculated at step 2. | | | | Notes: | | 1. This function (and likewise all the similar "editing" functions) | | is usually called in the following context: | | MSString::xxxxx() | | { | | ... | | MSString old(pBuffer); | | pBuffer=old.pBuffer->rightJustify(...); | | ... | | } | ------------------------------------------------------------------------------*/ MSStringBuffer *MSMBStringBuffer::rightJustify(unsigned newLength,char padCharacter) { MSStringBuffer *result=this; if (newLength!=length()) { unsigned prefix=(newLength>length())?newLength-length():0; unsigned fromReceiver=(length()MSStringEnum::DBCS1) // should be MBCS1 { result->contents()[i]=padCharacter; } } } } return result; } /*------------------------------------------------------------------------------ | MSMBStringBuffer::remove | | | | If the buffer will remain unmodified (starting index is beyond | | the end or receiver is null),then the receiver is returned | | unmodified. | | | | Else,if the number of characters to delete is zero,or passes | | the end of the receiver,then it is defaulted to the rest of the | | buffer. Then,check to see if the result of removing the characters | | will split a DBCS character on either end. If so,replace that | | character with a SBCS space. Finally,the new buffer is allocated | | and filled in via a call to newBuffer(). | | | | Notes: | | 1. See notes 1. and 2. under MSMBStringBuffer::rightJustify. | ------------------------------------------------------------------------------*/ MSStringBuffer *MSMBStringBuffer::remove(unsigned startPos,unsigned numChars) { MSStringBuffer *result=this; if (startPos<=length()&&length()!=0) { //------------------------------------------------------------------------ // Consider startPos 0 to be 1: //------------------------------------------------------------------------ if (startPos==0) startPos++; //------------------------------------------------------------------------ // Default numChars to rest of string: //------------------------------------------------------------------------ if (numChars>length()-startPos) numChars=length()-startPos+1; //------------------------------------------------------------------------ // Initialize from current contents before/after deleted chars: //------------------------------------------------------------------------ result=newBuffer(contents(),startPos-1, contents()+startPos+numChars-1, length()-numChars-startPos+1, 0,0, 0); //------------------------------------------------------------------------ // If the byte at (startPos-1) is the first byte of a DBCS character, // then that byte should be replaced with a SBCS space. // If the byte at (startPos+numChars) is the second byte of a DBCS // character,then that byte should be replaced with a SBCS space. //------------------------------------------------------------------------ if (startPos<=length()) { MSStringEnum::CharType typeOfFirstRemoved=charType(startPos); if (typeOfFirstRemoved>MSStringEnum::DBCS1) { for (unsigned i=1;icontents()[startPos-1-i]=' '; } } } for (unsigned i=0;startPos+numChars+i<=length();i++) { if (charType(startPos+numChars+i)>MSStringEnum::DBCS1) result->contents()[startPos-1+i]=' '; } } return result; } size_t MSMBStringBuffer::prevCharLength(unsigned pos) const { if (pos==1) return 1; else { MSStringEnum::CharType ctype=charType(pos-1); if (ctype==MSStringEnum::SBCS) return 1; else return (size_t) ctype; } } /*------------------------------------------------------------------------------ | MSMBStringBuffer::isMBCS | | | | isMBCS returns MSTrue if the string consists of only MBCS characters | ------------------------------------------------------------------------------*/ MSBoolean MSMBStringBuffer::isMBCS() const { unsigned i; const char *p=contents(); for (i=0;i0 and index<=length()) before | | calling charType. | ------------------------------------------------------------------------------*/ MSStringEnum::CharType MSMBStringBuffer::charType(unsigned index) const { unsigned i=0; for (;;) { unsigned next=i+charLength(&contents()[i]); if (next>=index) { if (next-i==1) return MSStringEnum::SBCS; else return MSStringEnum::CharType(index-i); } else i=next; } } /*------------------------------------------------------------------------------ | MSMBStringBuffer::isCharValid | | | | This function determines if a character,pChar (which can be either a SBCS | | or DBCS character) is in the string of valid characters,pValidChars (which | | can contain any combination of SBCS and DBCS characters). | ------------------------------------------------------------------------------*/ MSBoolean MSMBStringBuffer::isCharValid(unsigned pos,const char *pValidChars,unsigned numValidChars) const { char const *c=&contents()[pos-1]; size_t lc=charLength(c); while (numValidChars>=lc) { size_t len=charLength(pValidChars); if (len==lc) { MSBoolean match=MSTrue; for (unsigned i=0;iMSStringEnum::DBCS1) result->contents()[i]=padCharacter; } if (startPos+fromReceiver<=length()) { MSStringEnum::CharType typeOfFirstAfterSubstring=charType(startPos+len); if (typeOfFirstAfterSubstring>MSStringEnum::DBCS1) { for (unsigned i=1;icontents()[len-i]=padCharacter; } } } return result; } /*------------------------------------------------------------------------------ | MSMBStringBuffer::startSearch | ------------------------------------------------------------------------------*/ unsigned MSMBStringBuffer::startSearch(unsigned startPos,unsigned searchLen) const { unsigned result=MSStringBuffer::startSearch(startPos,searchLen); while (charType(result)>MSStringEnum::DBCS1) { if (++result>length()) { result=0; break; } } return result; } /*------------------------------------------------------------------------------ | MSMBStringBuffer::startBackwardsSearch | ------------------------------------------------------------------------------*/ unsigned MSMBStringBuffer::startBackwardsSearch(unsigned startPos,unsigned searchLen) const { unsigned result=MSStringBuffer::startBackwardsSearch(startPos,searchLen); while (result>0&&charType(result)>MSStringEnum::DBCS1) result--; return result; } /*------------------------------------------------------------------------------ | MSMBStringBuffer::indexOf | | | | 1. First,check whether the search can succeed (and set the point at which | | the search is to start) by calling startSearch(). | | 2. If the search cannot succeed,then return 0. | | 3. Otherwise,compare the buffer contents starting at each index to the | | search string until a match is found (in which case we return the index) | | or the entire buffer is tested (in which case 0 is returned). | | | | | | Notes: | | 1. If the search string is a single character,then this function is | | implemented via the equivalent invocation of indexOfAnyOf (which is | | optimized for that case). This saves the addtional logic of special | | code to handle that case here,as well. | | 2. If the search string is null,then 0 is returned. | ------------------------------------------------------------------------------*/ unsigned MSMBStringBuffer::indexOf(const char *pSearchString,unsigned searchLen,unsigned startPos) const { if (searchLen==1) return indexOfAnyOf(pSearchString,searchLen,startPos); startPos=startSearch(startPos,searchLen); if (startPos&&searchLen) { while (startPos<=length()) { if (memcmp(contents()+startPos-1,pSearchString,searchLen)==0) return startPos; else startPos+=charLength(startPos); } } return 0; } /*------------------------------------------------------------------------------ | MSMBStringBuffer::indexOf | | | | Simply invokes the functionally equivalent indexOf function. | | | | Notes: | | 1. If the search string is null,then 0 is returned. | ------------------------------------------------------------------------------*/ unsigned MSMBStringBuffer::indexOf(const MSStringTest &aTest,unsigned startPos) const { return MSStringBuffer::indexOf(aTest,startPos); } /*------------------------------------------------------------------------------ | MSMBStringBuffer::indexOfAnyBut | | | | 1. Checking that the search can succeed (and establishing the starting | | point) by calling startSearch(). | | 2. If it can't succeed,return 0. | | 3. If it can succeed,the starting point is converted to an array (0-based) | | index. | | 4. Search for the first character not in the set of valid characters,based | | on the number of valid characters: | | 0 -return 1;i.e.,the first character of the buffer | | isn't in the (empty) set of valid characters | | 1 -compare each character of the buffer to the valid | | character until one doesn't match | | >1-call memchr for each character of the buffer to see if the | | character is in the set of valid characters; | | return the index of the first that isn't found | | | | If all characters pass the test,return 0. | ------------------------------------------------------------------------------*/ unsigned MSMBStringBuffer::indexOfAnyBut(const char *pValidChars,unsigned numValidChars,unsigned startPos) const { startPos=startSearch(startPos,1); if (startPos) { switch(numValidChars) { case 0: return startPos; case 1: // No character can match single DBCS first-byte: if (! isSBC(pValidChars)) return startPos; // Examine each character of this string... while (startPos<=length()) { // Compare this character. Note that if current character // is DBCS first-byte,this compare will fail. if (contents()[startPos-1]!=*pValidChars) return startPos; else startPos++; } break; default: while (startPos<=length()) { if (!isCharValid(startPos,pValidChars,numValidChars)) return startPos; else startPos+=charLength(startPos); } } } return 0; } /*------------------------------------------------------------------------------ | MSMBStringBuffer::indexOfAnyBut | | | | 1. Checking that the search can succeed (and establishing the starting | | point) by calling startSearch(). | | 2. Invokes the MSStringTest test method against each character in turn,until | | the argument MSStringTest returns a MSFalse result. | | | | If all characters pass the test,return 0. | ------------------------------------------------------------------------------*/ unsigned MSMBStringBuffer::indexOfAnyBut(const MSStringTest& aTest,unsigned startPos) const { startPos=startSearch(startPos,1); if (startPos) { while (startPos<=length()) { // Note: This is broken! Must somehow pass both bytes of DBCS! if (!aTest.test(contents()[startPos-1])) return startPos; else startPos+=charLength(startPos); } } return 0; } /*------------------------------------------------------------------------------ | MSMBStringBuffer::indexOfAnyOf | | | | 1. Checking that the search can succeed (and establishing the starting | | point) by calling startSearch(). | | 2. If it can't succeed,return 0. | | 3. If it can succeed,the starting point is converted to an array (0-based) | | index. | | 4. Search for the first character in the set of search characters,based | | on the number of search characters: | | 0 -return 0;i.e.,no characters of the buffer are in the (empty) | | set of search characters | | 1 -search for a matching character in the buffer using memchr | | >1-call memchr for each character of the buffer to see if the | | character is in the set of search characters; | | return the index of the first that is found | | | | If all characters fail the test,return 0. | ------------------------------------------------------------------------------*/ unsigned MSMBStringBuffer::indexOfAnyOf(const char *pValidChars,unsigned numValidChars,unsigned startPos) const { startPos=startSearch(startPos,1); if (startPos) { switch(numValidChars) { case 0: break; case 1: while (startPos<=length()) { if (contents()[startPos-1]==*pValidChars) return startPos; startPos+=charLength(startPos); } break; default: while (startPos<=length()) { if (isCharValid(startPos,pValidChars,numValidChars)) return startPos; else startPos+=charLength(startPos); } } } return 0; } /*------------------------------------------------------------------------------ | MSMBStringBuffer::indexOfAnyOf | | | | 1. Checking that the search can succeed (and establishing the starting | | point) by calling startSearch(). | | 2. Invokes the MSStringTest test method against each character in turn,until | | the argument MSStringTest returns a MSTrue result. | | | | If all characters fail the test,return 0. | ------------------------------------------------------------------------------*/ unsigned MSMBStringBuffer::indexOfAnyOf(const MSStringTest &aTest,unsigned startPos) const { startPos=startSearch(startPos,1); if (startPos) { while (startPos<=length()) { if (aTest.test(contents()[startPos-1])) return startPos; else startPos++; } } return 0; } /*------------------------------------------------------------------------------ | MSMBStringBuffer::lastIndexOf | | | | 1. Adjust starting position and see if the search can | | succeed by calling startBackwardsSearch(). | | 2. If a match isn't possible,return 0. | | 3. Otherwise,search (backward) according to length of search | | string: | | 0 -return 0; | | 1 -search for a matching character in the buffer by | | comparing one byte at a time | | >1-call memcmp for each character of the buffer to see | | if the characters starting here match the search string. | | | | If no match is found,return 0. | ------------------------------------------------------------------------------*/ unsigned MSMBStringBuffer::lastIndexOf(const char *pSearchString,unsigned searchLen,unsigned startPos) const { startPos=startBackwardsSearch(startPos,searchLen); if (startPos) { switch(searchLen) { case 0: break; case 1: while (startPos) { if (contents()[startPos-1]==*pSearchString) return startPos; else startPos-=prevCharLength(startPos); } break; default: while (startPos) { if (memcmp(contents()+startPos-1,pSearchString,searchLen)==0) return startPos; else startPos-=prevCharLength(startPos); } } } return 0; } /*------------------------------------------------------------------------------ | MSMBStringBuffer::lastIndexOf | ------------------------------------------------------------------------------*/ unsigned MSMBStringBuffer::lastIndexOf(const MSStringTest &aTest,unsigned startPos) const { return MSStringBuffer::lastIndexOf(aTest,startPos); } /*------------------------------------------------------------------------------ | MSMBStringBuffer::lastIndexOfAnyBut | | | | 1. Checking that the search can succeed (and establishing the | | starting point) by calling startBackwardsSearch(). | | 2. If it can't succeed,return 0. | | 3. If it can succeed,the starting point is converted to an | | array (0-based) index. | | 4. Search (going backwards) for the first character not in the | | set of valid characters,based on the number of valid | | characters: | | 0 -return the buffer length;i.e.,the last character of | | the buffer isn't in the (empty) set of valid characters | | 1 -compare each character of the buffer to the valid | | character until one doesn't match | | >1-call memchr for each character of the buffer to see | | if the character is in the set of valid characters; | | return the index of the first that isn't found | | | | If all characters pass the test,return 0. | ------------------------------------------------------------------------------*/ unsigned MSMBStringBuffer::lastIndexOfAnyBut(const char *pValidChars,unsigned numValidChars,unsigned startPos) const { startPos=startBackwardsSearch(startPos,1); if (startPos) { switch(numValidChars) { case 0: return startPos; case 1: if (! isSBC(pValidChars)) return 0; while (startPos) { if (contents()[startPos-1]!=*pValidChars) return startPos; else startPos-=prevCharLength(startPos); } break; default: while (startPos) { if (!isCharValid(startPos,pValidChars,numValidChars)) return startPos; else startPos-=prevCharLength(startPos); } } } return 0; } /*------------------------------------------------------------------------------ | MSMBStringBuffer::lastIndexOfAnyBut | | | | 1. Checking that the search can succeed (and establishing the starting | | point) by calling startBackwardsSearch(). | | 2. Invokes the MSStringTest test method against each character in turn,until | | the argument MSStringTest returns a MSFalse result. | | | | If all characters pass the test,return 0. | ------------------------------------------------------------------------------*/ unsigned MSMBStringBuffer::lastIndexOfAnyBut(const MSStringTest &aTest,unsigned startPos) const { startPos=startBackwardsSearch(startPos,1); while (startPos) { if (!aTest.test(contents()[startPos-1])) return startPos; else startPos-=prevCharLength(startPos); } return 0; } /*------------------------------------------------------------------------------ | MSMBStringBuffer::lastIndexOfAnyOf | | | | 1. Checking that the search can succeed (and establishing the | | starting point) by calling startBackwardsSearch(). | | 2. If it can't succeed,return 0. | | 3. Otherwise,search for the first character in the set of | | search characters,based on the number of search characters: | | 0 -return 0;i.e.,no characters of the buffer are in | | the (empty) set of search characters | | 1 -search for a matching character in the buffer by | | comparing buffer characters one-by-one (going backwards). | | >1-call memchr for each character of the buffer to see | | if the character is in the set of search characters | | return the index of the first that is found | | | | If all characters fail the test,return 0. | ------------------------------------------------------------------------------*/ unsigned MSMBStringBuffer::lastIndexOfAnyOf(const char *pValidChars,unsigned numValidChars,unsigned startPos) const { startPos=startBackwardsSearch(startPos,1); if (startPos) { switch(numValidChars) { case 0: break; case 1: while (startPos) { if (contents()[startPos-1]==*pValidChars) return startPos; else startPos-=prevCharLength(startPos); } break; default: while (startPos) { if (isCharValid(startPos,pValidChars,numValidChars)) return startPos; else startPos-=prevCharLength(startPos); } } } return 0; } /*------------------------------------------------------------------------------ | MSMBStringBuffer::lastIndexOfAnyOf | | | | 1. Checking that the search can succeed (and establishing the starting | | point) by calling startBackwardsSearch(). | | 2. Invokes the MSStringTest test method against each character in turn,until | | the argument MSStringTest returns a MSTrue result. | | | | If all characters fail the test,return 0. | ------------------------------------------------------------------------------*/ unsigned MSMBStringBuffer::lastIndexOfAnyOf(const MSStringTest &aTest,unsigned startPos) const { startPos=startBackwardsSearch(startPos,1); while (startPos) { if (aTest.test(contents()[startPos-1])) return startPos; else startPos-=prevCharLength(startPos); } return 0; } /*============================================================================== Notes: 1. Each of these functions returns a pointer to an MSMBStringBuffer object. The resulting buffer contains the edited result. It may or not be a different buffer than the receiver,depending on the nature of the change and the use count of the receiver. 2. It is presumed that the caller has properly adjusted the use count for the receiver prior to calling any of these functions (that is,the use count is accurate). 3. It is presumed that the caller will attach the resulting buffer to an MSString so that the built-in use count in the returned buffer is accurate. 4. Typical usage is as follows: ... // Preserve old contents. MSString old(aString.pBuffer); ... // Reset aString to point to (possibly) new edited buffer: aString.pBuffer=aString.pBuffer->xxxxxxx(); ... ==============================================================================*/ /*------------------------------------------------------------------------------ | MSMBStringBuffer::center | | | | If the requested length is equal to the length of the receiver, | | then the receiver is returned unmodified. Otherwise,the | | receiver's length is reset to the argument length and space is | | allocated for the centered buffer. The new buffer is built | | one of two ways,depending on whether the new length is larger | | or smaller than the original length of the receiver's buffer. | | | | In the former case,the amount of padding required before and | | after the centered string is calculated. Then,the new string | | is filled with pad characters,the old contents are copied,and | | then the remainder is filled with more pad characters. | | | | In the latter case,a substring of the receiver (the center portion | | of the requested length) is copied to the result buffer. | ------------------------------------------------------------------------------*/ MSStringBuffer *MSMBStringBuffer::center(unsigned newLength,char padCharacter) { MSStringBuffer *result=this; if (newLength!=length()) { //----------------------------------------------------------------------- // Initialize parameters to likely values: //----------------------------------------------------------------------- unsigned prefix=0,suffix=0,fromReceiver=length(),startPos=1; //----------------------------------------------------------------------- // Adjust initialization parameters: //----------------------------------------------------------------------- if (newLength>length()) { prefix=(newLength-length())/2; suffix=newLength-length()-prefix; } else { fromReceiver=newLength; startPos=(length()-fromReceiver)/2+1; //--------------------------------------------------------------------- // If the byte at startPos is the second byte of a DBCS character,then // the startPos is decremented so that the string will get cut from the // previous byte. //--------------------------------------------------------------------- while (startPos>1&&charType(startPos)>MSStringEnum::DBCS1) startPos--; } //----------------------------------------------------------------------- // Allocate space and copy receiver to middle: //----------------------------------------------------------------------- result=newBuffer(0,prefix, contents()+startPos-1,fromReceiver, 0,suffix, padCharacter); //----------------------------------------------------------------------- // If the last byte of the new string is the first byte of a DBCS // character,then that byte gets set to the padCharacter. //----------------------------------------------------------------------- if (startPos+fromReceiver<=length()) { MSStringEnum::CharType typeOfFirstAfterSubstring=charType(startPos+fromReceiver); unsigned len=result->length(); if (typeOfFirstAfterSubstring>MSStringEnum::DBCS1) { for (unsigned i=1;icontents()[len-i]=padCharacter; } } } } else addRef(); return result; } /*------------------------------------------------------------------------------ | MSMBStringBuffer::insert | | | | This function accepts as arguments: | | -pointer to string to be inserted | | -length of string to be inserted | | -position at which to insert the string | | -pad character. | | | | It returns the receiver unmodified if both the string to be inserted is | | null and the index at which it is to be inserted is not off the end of | | the receiver buffer. | | | | Otherwise,space is allocated for the combined buffers. The insertion | | is accomplished in four steps: | | | | 1. The portion of the receiver prior to the index at which | | the new string is to be inserted is copied (may be null). | | 2. If the receiver isn't this long,then it is padded out | | to the insert index using the pad character. | | 3. The to-be-inserted string is copied (may be null). | | 4. The portion of the receiver following the index at which | | the new string is to be inserted is copied (may be null). | | | | All this is accomplished with a single call to newBuffer(). | ------------------------------------------------------------------------------*/ MSStringBuffer *MSMBStringBuffer::insert(const char *pInsert,unsigned len,unsigned index,char padCharacter) { MSStringBuffer *result=this; if (len!=0||index>length()) { //----------------------------------------------------------------------- // If the index is somewhere in the existing string,then // check to see if the insertion point is between bytes of a DBCS // character. If so,then move the insertion point back one. //----------------------------------------------------------------------- if (index0&&charType(index+1)>MSStringEnum::DBCS1) index--; } unsigned len1=(length()length()) { //--------------------------------------------------------------------- // Second initializer is pad characters: //--------------------------------------------------------------------- len2=index-length(), p2=0, //--------------------------------------------------------------------- // Third initializer is the string to be inserted: //--------------------------------------------------------------------- len3=len, p3=pInsert; } else { //--------------------------------------------------------------------- // Second initializer is the string to be inserted: //--------------------------------------------------------------------- len2=len, p2=pInsert, //--------------------------------------------------------------------- // Third initializer is the rest of the receiver: //--------------------------------------------------------------------- len3=length()-index, p3=contents()+index; } //----------------------------------------------------------------------- // Return new buffer: //----------------------------------------------------------------------- result=newBuffer(p1,len1,p2,len2,p3,len3,padCharacter); } else addRef(); return result; } /*------------------------------------------------------------------------------ | MSMBStringBuffer::leftJustify | | | | If the new length is the same as the receiver's current length, | | then the receiver is returned unmodified. | | | | Otherwise,the new buffer is generated via an invocation of the | | newBuffer() function. The new contents are built from the | | receiver (either its full length or truncated at the new length | | if that is shorter) and a string of pad characters (of sufficient | | length to fill the result out to the specified length). | ------------------------------------------------------------------------------*/ MSStringBuffer *MSMBStringBuffer::leftJustify(unsigned newLength,char padCharacter) { MSStringBuffer *result=this; unsigned len2=0; if (newLength!=length()) { if (newLength>length()) len2=newLength-length(); result=newBuffer(contents(),(length()MSStringEnum::DBCS1) { for (unsigned i=1;icontents()[newLength-i]=padCharacter; } } } } else addRef(); return result; } /*------------------------------------------------------------------------------ | MSMBStringBuffer::lowerCase | | | | Starting at the beginning of the buffer,scan for the next capital | | letter and if found,convert it to lower case. Quit as soon as | | the search for a capital (via indexOfAnyOf()) fails. | ------------------------------------------------------------------------------*/ static const char caps[]="ABCDEFGHIJKLMNOPQRSTUVWXYZ"; MSStringBuffer *MSMBStringBuffer::lowerCase() { MSStringBuffer *result=this; unsigned pos=indexOfAnyOf(caps,26,0); if (pos1) result=newBuffer(contents(),length()); else addRef(); char *p=result->contents(); while (poslength()) { //------------------------------------------------------------------------ // Treat index 0 like index 1: //------------------------------------------------------------------------ if (index==0) index=1; unsigned len1=(length()=index+len) { len3=length()-index-len+1; p3=contents()+index+len-1; } else { len3=0; p3=0; } } //------------------------------------------------------------------------ // Obtain new buffer: //------------------------------------------------------------------------ result=newBuffer(p1,len1,p2,len2,p3,len3,padCharacter); //------------------------------------------------------------------------ // If the byte at (index-1) is the first byte of a DBCS character, // then that byte should be replaced with padCharacter. // If the byte at (index+len) is the second byte of a DBCS // character,then that byte should be replaced with padCharacter. //------------------------------------------------------------------------ if (index<=length()) { MSStringEnum::CharType typeOfFirstOverlayed=charType(index); if (typeOfFirstOverlayed>MSStringEnum::DBCS1) { for (unsigned i=1;icontents()[index-1-i]=' '; } } } for (unsigned i=0;index+len+i<=length();i++) { if (charType(index+len+i)>MSStringEnum::DBCS1) result->contents()[index+len-1+i]=padCharacter; } } else addRef(); return result; } /*------------------------------------------------------------------------------ | MSMBStringBuffer::reverse | | | | If the string is not null,reverse its bytes. Since the MSStringBuffer is | | not guaranteed to not have null characters,we can't use strrev() | | and instead roll our own. | ------------------------------------------------------------------------------*/ MSStringBuffer *MSMBStringBuffer::reverse() { MSStringBuffer *result=this; if (length()>1) { if (useCount()>1) result=newBuffer(contents(),length()); else addRef(); char *p1=result->contents(); char *p2=result->contents()+result->length()-1; // Swap string end for end... while (p1=p2) break; char c2[MB_LEN_MAX]; size_t len2; char *p; unsigned i; for (len2=0,p=p2;len2lastP1;len2++,p--) c2[len2]=*p; for (i=0;icontents(); while (p2>p1) { char c2[MB_LEN_MAX]; char *p; unsigned i; for (i=0,p=p2;i=p1;i++,p--) c2[i]=*p; size_t len2=charLength(c2); if (len2>1) { for (i=0;iaddRef(); } } else addRef(); } else addRef(); return result; } /*------------------------------------------------------------------------------ | MSMBStringBuffer::strip | | | | This method uses an MSStringTest object to determine which characters are to | | be stripped. A "mode" indicator specifies whether leading,trailing,or, | | both leading and trailing characters meeting the criteria are to be | | stripped. | | | | 1. Find the first character that fails the criteria | | 2. Find the last character that fails the criteria | | 3. Allocate space for and copy the intervening characters | | 4. Return the resulting buffer. | ------------------------------------------------------------------------------*/ MSStringBuffer *MSMBStringBuffer::strip(const MSStringTest& aTest, MSStringEnum::StripMode mode) { MSStringBuffer *result=this; if (length()!=0) { unsigned start=1,stop=length(); if (mode!=MSStringEnum::Trailing) start=indexOfAnyBut(aTest,1); if (mode!=MSStringEnum::Leading&&start!=0) { stop=lastIndexOfAnyBut(aTest,length()); // If last char to keep is DBCS,keep two bytes. stop+=charLength(stop)-1; } if (start!=1||stop!=length()) { if (start!=0) result=newBuffer(contents()+start-1,stop-start+1); else { result=null(); result->addRef(); } } else addRef(); } else addRef(); return result; } /*------------------------------------------------------------------------------ | MSStringBuffer::translate | | | | The translation is accomplished by: | | | | 1. Determine the number of logical characters in the input string | | (pInputChars) that are to be translated. | | 2. Set up a translation table that consists of an entry for each | | logical character to be translated,and contains information | | such as the input character,input character length,output character, | | output character length,and difference between outlen and inlen. | | 3. Set up a translation occurrence linked list which consists of | | one node per translation that is to occur. Each node contains 1) the | | position in self.data that contains a character to be translated, | | and 2) an index into the transTable that contains the translation | | info. This is accomplished by finding all occurrences of each | | inputCharacter (which is a logical character) in the string (via | | indexOfAnyOf()). | | 4. A new buffer is allocated (with a new length if required) and filled | | in by processing each node in the translation occurrence linked list. | ------------------------------------------------------------------------------*/ class transTable { public: char in[MB_LEN_MAX]; // Input character to be translated char out[MB_LEN_MAX]; // Output character char inLen; // Length of input character (1 for // single byte,2 for double byte) char outLen; // Length of output character (1 for // single byte,2 for double byte) int diff; // outlen-inlen }; class Occurrence { public: Occurrence* pNext; // pointer to next occurrence unsigned int pos; // position in string of occurrence Occurrence(unsigned int i) : pNext(0),pos(i) {}; ~Occurrence() { if (pNext!=0) delete pNext; }; }; class transOccurrence : public Occurrence { public: unsigned int n; // corresponding index in transTable transOccurrence(unsigned int i,unsigned int j); ~transOccurrence(); }; transOccurrence::transOccurrence(unsigned int i,unsigned int j) : Occurrence(i),n(j) {} transOccurrence::~transOccurrence() {} MSStringBuffer *MSMBStringBuffer::translate(const char *pInputChars,unsigned inputLen, const char *pOutputChars,unsigned outputLen, char padCharacter) { MSStringBuffer *result=this; //-------------------------------------------------------------------------- // Determine the number of characters (NOT bytes) to be translated. //-------------------------------------------------------------------------- unsigned int numChars=0,n=0; while (n=pOutputChars+outputLen) { transTbl[n].outLen=1; transTbl[n].out[0]=padCharacter; } else { transTbl[n].outLen=(char) charLength(po); for (i=0;ipNext=new transOccurrence(pos-1,n)); count++; lengthChange+=transTbl[n].diff; } //-------------------------------------------------------------------------- // Allocate the new,translated string;this string will reflect any length // change calculated above. //-------------------------------------------------------------------------- char *pOld=contents(); result=newBuffer(contents(),length(),0,lengthChange,0,0,0); pTransOcc=(transOccurrence*)head.pNext; char* pSource=pOld; char* pDest=result->contents(); unsigned int previousPos=0; //-------------------------------------------------------------------------- // Copy the contents of the old string into the new string (result) until // we get to a position that requires a translation. At that point,copy // the translation character into the new string,based on the // information in the transTable. Continue this until all nodes in // transOccurrence have been processed (number of nodes==count). //-------------------------------------------------------------------------- while (count--) { unsigned int len=pTransOcc->pos-previousPos; memcpy(pDest,pSource,len); pDest+=len; pSource+=len; memcpy(pDest,transTbl[pTransOcc->n].out,len=transTbl[pTransOcc->n].outLen); pDest+=len; pSource+=transTbl[pTransOcc->n].inLen; previousPos=pSource-pOld; pTransOcc=(transOccurrence*)pTransOcc->pNext; } //-------------------------------------------------------------------------- // Finish filling in the new string (result) with the remaining string // contents. //-------------------------------------------------------------------------- while ((*pDest++=*pSource++)!=0) { ;/* empty */ } delete [] transTbl; return result; } /*------------------------------------------------------------------------------ | MSMBStringBuffer::upperCase | | | | Starting at the beginning of the string,scan for the next lower | | case letter and if found,convert it to upper case. Quit as soon | | as the search for a lowercase (via indexOfAnyOf()) fails. | ------------------------------------------------------------------------------*/ static const char lowers[]="abcdefghijklmnopqrstuvwxyz"; MSStringBuffer *MSMBStringBuffer::upperCase() { MSStringBuffer *result=this; unsigned pos=indexOfAnyOf(lowers,26,0); if (pos1) result=newBuffer(contents(),length()); else addRef(); char *p=result->contents(); while (pos #else #include #endif #include #include #include #include #include #include #include #include #include #ifndef MSDefinesHEADER #include #endif #if defined(MS_NEED_FSYNC_DECLARATION) extern "C" int fsync(int); #endif MSMMap::MSMMap(void) : _aplusData(0),_mappedData(0),_fileSize(0) { } MSMMap::MSMMap(const char *fileName_) : _aplusData(0),_mappedData(0),_fileSize(0) { beamIn(fileName_); } MSMMap::~MSMMap(void) { if (_mappedData!=0) { munmap(_mappedData,_fileSize); _mappedData=0; _aplusData=0; } else if(_aplusData!=0) { MSA::dc(_aplusData); _aplusData=0; } } MSBoolean MSMMap::beamIn(const char *fileName_) { int fd; if (fileName_!=0) { fstream mappedFile; fd = open(fileName_,0); if (fd != -1) { lseek(fd,0,SEEK_SET); _fileSize=(int)lseek(fd,0,SEEK_END); char *mfp=(char *)mmap(0,_fileSize,PROT_READ,MAP_SHARED,fd,0); if (mfp!=((void *)-1)) //64 bit clean check { _mappedData=mfp; _aplusData=(MSAStruct *)mfp; close(fd); return checkEndiness(); } else MSMessageLog::errorMessage("MSMMap: Unable to map data: %s - errno: %d\n",fileName_,errno); close(fd); } else MSMessageLog::errorMessage("MSMMap: Unable to map data: %s - cannot open file\n",fileName_); } return MSFalse; } int MSMMap::isWrongEndian(MSAStruct *aobj) { return (aobj->r)?(!(1<=aobj->r&&MSA::MAXRANK>=aobj->r)):1!=aobj->n; } MSBoolean MSMMap::checkEndiness(void) { static MSAStruct tempAobj; if(isWrongEndian(_aplusData)) { MSMessageLog::warningMessage("MSMMap warning: Mapped file is wrong endian. Making local copy\n"); MSAStruct *z=0; long n,t; MSA::ndnicopy((long *)_aplusData,(long *)&tempAobj,MSA::AHEADER/sizeof(long)); z=MSA::gd(tempAobj.t,&tempAobj); n=z->n; t=z->t; switch(t) { case MSA::INTEGERTYPE: MSA::ndnicopy((long *)_aplusData->p,(long *)z->p,n); break; case MSA::FLOATTYPE: MSA::ndnfcopy((double *)_aplusData->p,(double *)z->p,n); break; case MSA::CHARACTERTYPE: memcpy(z->p,_aplusData->p,n+1); break; default: MSMessageLog::errorMessage("MSMMap error: Endian conversion encountered bad type:%d\n",t); z=0; break; } munmap(_mappedData,_fileSize); _mappedData=0; _aplusData=z; } return (_aplusData==0)?MSFalse:MSTrue; } aplus-fsf-4.22/src/MSTypes/MSMappedFileAccess.C0000644000265000001440000001472310772770446014672 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #if HAVE_FSTREAM #include #else #include #endif #include #include #include #include #include #include #include #include #include #include #include #ifndef MSDefinesHEADER #include #endif #if defined(MS_NEED_FSYNC_DECLARATION) extern "C" int fsync(int); #endif #if defined(MS_NEED_MUNMAP_DECLARATION) extern "C" int munmap(caddr_t,int); #endif template inline void getArray(MSMMap& aMMap, const Type*& t_) { t_=0; } inline void getArray(MSMMap& aMMap, const int*& t_) { t_=aMMap.getIntArray(); } inline void getArray(MSMMap& aMMap, const char*& t_) { t_=aMMap.getCharArray(); } inline void getArray(MSMMap& aMMap, const double*& t_) { t_=aMMap.getDoubleArray(); } inline void getArray(MSMMap& aMMap, const long*& t_) { t_=aMMap.getLongArray(); } template static MSBoolean beamInVector(MSTypeVector& vector_, const char *fileName_, MSA::AType type_) { int count=0; MSTypeData > *d=0; MSMMap aMMap; if (aMMap.beamIn(fileName_)==MSTrue) { if (aMMap.type()==type_) { if (aMMap.rank()==1) { count=(unsigned)aMMap.count(); d=MSTypeData >::allocateWithLength(count); Type *dp=d->elements(); const Type *sp; getArray(aMMap,sp); memcpy(dp,sp,count*sizeof(Type)); } else MSMessageLog::errorMessage("Unable to map data: %s - rank != 1.\n",fileName_); } else MSMessageLog::errorMessage("Unable to map data: %s - incorrect type.\n",fileName_); } if(d!=0&&count>0) { vector_=MSTypeVector(d,count); return MSTrue; } else { vector_=MSTypeVector(); return MSFalse; } } template static MSBoolean beamInMatrix(MSTypeMatrix& matrix_, const char *fileName_, MSA::AType type_) { int count=0, rows=0, columns=0; MSTypeData > *d=0; MSMMap aMMap; if (aMMap.beamIn(fileName_)==MSTrue) { if (aMMap.type()==type_) { if (aMMap.rank()==2) { count=aMMap.count(); rows=aMMap.aplusData()->d[0]; columns=aMMap.aplusData()->d[1]; d=MSTypeData >::allocateWithLength(count); Type *dp=d->elements(); const Type *sp; getArray(aMMap,sp); memcpy(dp,sp,count*sizeof(Type)); } else MSMessageLog::errorMessage("Unable to map data: %s - rank != 2.\n",fileName_); } else MSMessageLog::errorMessage("Unable to map data: %s - incorrect type.\n",fileName_); } if(d!=0&&count>0) { matrix_=MSTypeMatrix(d,rows,columns); return MSTrue; } else { matrix_=MSTypeMatrix(); return MSFalse; } } template static void writeOut(const char *fileName_,const Type *data_, MSA::AType type_, unsigned int rows_,unsigned int columns_,int rank_) { int fd; if (fileName_!=0) { fd = open(fileName_, 1); if (fd != -1) { (void)lseek(fd,0,SEEK_SET); MSAStruct a; a.i=(long)rows_*columns_; a.c=0; a.t=(long)type_; a.r=rank_; a.n=a.i; a.d[0]=rows_; a.d[1]=columns_; for (int i=2;i0;d+=wc,n-=wc) wc=write(fd,d,n); fsync(fd); close(fd); } else MSMessageLog::errorMessage("Unable to map data: %s - cannot open file\n",fileName_); } } MSBoolean MSMappedFileAccess::beamIn(MSCharVector &vector_,const char *fileName_) { return beamInVector(vector_,fileName_,MSA::CHARACTERTYPE); } MSBoolean MSMappedFileAccess::beamIn(MSIntVector &vector_,const char *fileName_) { return beamInVector(vector_,fileName_,MSA::INTEGERTYPE); } MSBoolean MSMappedFileAccess::beamIn(MSLongVector &vector_,const char *fileName_) { return beamInVector(vector_,fileName_,MSA::INTEGERTYPE); } MSBoolean MSMappedFileAccess::beamIn(MSFloatVector &vector_,const char *fileName_) { return beamInVector(vector_,fileName_,MSA::FLOATTYPE); } MSBoolean MSMappedFileAccess::beamIn(MSCharMatrix &matrix_,const char *fileName_) { return beamInMatrix(matrix_,fileName_,MSA::CHARACTERTYPE); } MSBoolean MSMappedFileAccess::beamIn(MSIntMatrix &matrix_,const char *fileName_) { return beamInMatrix(matrix_,fileName_,MSA::INTEGERTYPE); } MSBoolean MSMappedFileAccess::beamIn(MSFloatMatrix &matrix_,const char *fileName_) { return beamInMatrix(matrix_,fileName_,MSA::FLOATTYPE); } MSBoolean MSMappedFileAccess::beamIn(MSLongMatrix &matrix_,const char *fileName_) { return beamInMatrix(matrix_,fileName_,MSA::INTEGERTYPE); } void MSMappedFileAccess::beamOut(const char *fileName_,const MSCharVector &vector_) { writeOut(fileName_,vector_.data(),MSA::CHARACTERTYPE,vector_.length(),1U,1); } void MSMappedFileAccess::beamOut(const char *fileName_,const MSIntVector &vector_) { writeOut(fileName_,vector_.data(),MSA::INTEGERTYPE,vector_.length(),1U,1); } void MSMappedFileAccess::beamOut(const char *fileName_,const MSLongVector &vector_) { writeOut(fileName_,vector_.data(),MSA::INTEGERTYPE,vector_.length(),1U,1); } void MSMappedFileAccess::beamOut(const char *fileName_,const MSFloatVector &vector_) { writeOut(fileName_,vector_.data(),MSA::FLOATTYPE,vector_.length(),1U,1); } void MSMappedFileAccess::beamOut(const char *fileName_,const MSCharMatrix &matrix_) { writeOut(fileName_,matrix_.data(),MSA::CHARACTERTYPE,matrix_.rows(),matrix_.columns(),2); } void MSMappedFileAccess::beamOut(const char *fileName_,const MSIntMatrix &matrix_) { writeOut(fileName_,matrix_.data(),MSA::INTEGERTYPE,matrix_.rows(),matrix_.columns(),2); } void MSMappedFileAccess::beamOut(const char *fileName_,const MSLongMatrix &matrix_) { writeOut(fileName_,matrix_.data(),MSA::INTEGERTYPE,matrix_.rows(),matrix_.columns(),2); } void MSMappedFileAccess::beamOut(const char *fileName_,const MSFloatMatrix &matrix_) { writeOut(fileName_,matrix_.data(),MSA::FLOATTYPE,matrix_.rows(),matrix_.columns(),2); } aplus-fsf-4.22/src/MSTypes/MSMatrix.C0000644000265000001440000000217510772770447013005 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include MSMatrix::MSMatrix() : _rows(0), _columns(0), _count(0) { // _rows=_columns=_count=0; } MSMatrix::MSMatrix (unsigned rows_,unsigned columns_) : _rows(rows_),_columns(columns_),_count(rows_*columns_) { // _rows=rows_,_columns=columns_,_count=rows_*columns_; } MSMatrix::~MSMatrix() { } void MSMatrix::indexError(unsigned i_,unsigned l_) { MSMessageLog::errorMessage("MSMatrix Index Error: index %d\tcount %d\n",i_,l_); } void MSMatrix::matrixErrorHandler(const char* msg_) { MSMessageLog::errorMessage("MSMatrix Error: %s\n",msg_); } MSMatrixErrorHandler MSMatrix::_matrixErrorHandler=matrixErrorHandler; MSMatrixErrorHandler MSMatrix::setMatrixErrorHandler(MSMatrixErrorHandler aFunction_) { MSMatrixErrorHandler old=_matrixErrorHandler; _matrixErrorHandler=aFunction_; return old; } aplus-fsf-4.22/src/MSTypes/MSMessageLog.C0000644000265000001440000000740610772770447013571 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #include #include #if defined(MS_WINDOWS) #include #endif MSMessageLog::Destination MSMessageLog::_destination=StdErr; MSMessageLog::Priority MSMessageLog::_threshold=Warning; MSMessageLog::LogFunction MSMessageLog::_mstkLogFunc =0; MSBoolean MSMessageLog::_quietMode=MSFalse; static int fileOut=0; static char fileName[FILENAME_MAX]="\0"; #if defined(MS_MULTI_THREAD) static MSMutex logMutex; #endif void MSMessageLog::outputMessage(Priority pri_,const char *buf) { switch(_destination) { case StdOut: fprintf(stdout,buf); break; case DebugOut: #if defined(MS_WINDOWS) OutputDebugString(buf); break; #endif //else fall through case StdErr: fprintf(stderr,buf); break; case Function: if(_mstkLogFunc) (*_mstkLogFunc)(pri_,buf); break; case File: if(fileOut!=0) { write(fileOut,buf,strlen(buf)); } break; default: break; } } void MSMessageLog::logDestination(Destination dest_) { MSGUARD(logMutex); if(_destination!=dest_) { _destination=dest_; if(_destination!=File) { if(fileOut!=0) { close(fileOut); fileOut=0; } } else { if(fileOut==0 && fileName[0]) { fileOut = open(fileName,O_CREAT|O_RDWR|O_APPEND,0666); if(errno==21) { close(fileOut); fileOut=0; } if(fileOut==0) { fprintf(stderr,"MSMessageLog::logFileName: Error: Unable to open file `%s'\n",fileName); } } } } } const char* MSMessageLog::logFileName(void) { return fileName; } int MSMessageLog::logFileName(const char *name_) { MSGUARD(logMutex); if(fileOut!=0) { close(fileOut); fileOut=0; } if(name_==0 || *name_==0) fileName[0]='\0'; else { strcpy(fileName,name_); if(_destination==File) { fileOut = open(fileName,O_CREAT|O_RDWR|O_APPEND,0666); if(errno==21) { close(fileOut); fileOut=0; } if(fileOut==0) { fprintf(stderr,"MSMessageLog::logFileName: Error: Unable to open file `%s'\n",fileName); } } } return (fileOut==0)?0:1; } /* * This is a body for all *message functions * The code is almost identical, but we can't just call a common * function because of necessary vararg setup/cleanup steps in each function. */ #define OUTPUT_MESSAGE(pri,fmt,buf) \ if(_quietMode==MSFalse && pri<=_threshold) \ {\ MSGUARD(logMutex);\ va_list ap;\ va_start(ap,fmt);\ if(fmt) vsprintf(buf,fmt,ap);\ else buf[0]=0;\ va_end(ap); \ outputMessage(pri,buf);\ } static char msgBuf[1024]; void MSMessageLog::message(Priority pri_, const char *fmt,...) { OUTPUT_MESSAGE(pri_,fmt,msgBuf) } void MSMessageLog::criticalMessage(const char *fmt,...) { OUTPUT_MESSAGE(Critical,fmt,msgBuf) } void MSMessageLog::errorMessage(const char *fmt,...) { OUTPUT_MESSAGE(Error,fmt,msgBuf) } void MSMessageLog::warningMessage(const char *fmt,...) { OUTPUT_MESSAGE(Warning,fmt,msgBuf) } void MSMessageLog::infoMessage(const char *fmt,...) { OUTPUT_MESSAGE(Info,fmt,msgBuf) } void MSMessageLog::debugMessage(const char *fmt,...) { OUTPUT_MESSAGE(Debug,fmt,msgBuf) } aplus-fsf-4.22/src/MSTypes/MSModel.C0000644000265000001440000000236110772770447012576 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include MSModel::~MSModel(void) {} const MSSymbol& MSModel::symbol(void) { return MSSymbol::nullSymbol(); } MSModel *MSModel::create(void) const { return (MSModel *)0; } void MSModel::assign(const MSModel&) {} long MSModel::compare(const MSModel&) const { return 0; } // The functions below, dbg_asString() and dbg_asDebugInfo() are provided for debugging purposes only. // Their only usage is to be called from a debugger. This provides a universal interface for accessing // data of any MSModel subclass from any debugger (assuming that any debugger has the basic capability // to call a global, non-overloaded function which returns a character string. // const char *dbg_asString(const MSModel& model_) { static MSString buf; buf = model_.asString(); return buf.string(); } const char *dbg_asDebugInfo(const MSModel& model_) { static MSString buf; buf = model_.asDebugInfo(); return buf.string(); } aplus-fsf-4.22/src/MSTypes/MSMoney.C0000644000265000001440000006117510772770447012635 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #include #include #include #if HAVE_IOSTREAM #include #else #include #endif #include #include #include #include MSMoney::Currency MSMoney::_defaultCurrency=MSMoney::USDollar; #ifdef MS_NO_INLINES #include #endif MSString MSMoney::asString(void) const { MSString s; format(s,MSMoney::CurrencyPrecision,MSMoney::LocalSymbol); return s; } MSString MSMoney::asDebugInfo(void) const { MSString result("MSMoney(@"); result+=MSString((unsigned long)this).d2x().lowerCase(); result+=",_real="; result+=MSString(_real); result+=",_isSet="; result+=(isSet()==MSTrue)?"MSTrue":"MSFalse"; result+=",_isValid="; result+=(isValid()==MSTrue)?"MSTrue":"MSFalse"; result+=",_currency="; result+=MSString((int)_currency); result+=",_defaultCurrency="; result+=MSString((int)_defaultCurrency); result+=",_type="; result+=type().symbolName(); result+=")"; return MSString(result); } MSString MSMoney::className(void) const { return MSString("MSMoney"); } const MSSymbol& MSMoney::type(void) const { return symbol(); } MSModel *MSMoney::clone(void) const { return new MSMoney(*this); } MSModel *MSMoney::create(void) const { return new MSMoney(); } void MSMoney::assign(const MSModel& aModel_) { *this=(MSMoney&)aModel_; } long MSMoney::compare(const MSModel& aModel_) const { return ::compare(*this,(MSMoney&)aModel_); } const MSSymbol& MSMoney::symbol(void) { static MSSymbol sym ("MSMoney"); return sym; } // currency information structure // struct CurrencyData { MSMoney::Currency curr; const char *isoSym; const char *localSym; MSMoney::SymbolLocation symLocation; MSBoolean isSpaceSep; MSMoney::MSMoneyFormat decimalFormat; MSMoney::MSMoneyFormat commaDecimalFormat; }; // table mapping currency enumeration types to ISO symbols and other currency info - relies on sequential // ordering of the enumerations as the code just indexes into the table using the enumeration value as the index. // CurrencyData currencyTable[] = { {MSMoney::DefaultCurrency, "", "", MSMoney::DefaultLocation, MSFalse, MSMoney::Decimal2, MSMoney::CommaDecimal2}, // the most important and common currencies go first {MSMoney::USDollar, "USD", "$", MSMoney::SymbolAtStart, MSFalse, MSMoney::Decimal2, MSMoney::CommaDecimal2}, {MSMoney::CanadianDollar, "CAD", "$", MSMoney::SymbolAtStart, MSFalse, MSMoney::Decimal2, MSMoney::CommaDecimal2}, {MSMoney::BritishPound, "GBP", "\x0a3", MSMoney::SymbolAtStart, MSFalse, MSMoney::Decimal2, MSMoney::CommaDecimal2}, {MSMoney::JapaneseYen, "JPY", "\x0a5", MSMoney::SymbolAtStart, MSFalse, MSMoney::Decimal0, MSMoney::CommaDecimal0}, {MSMoney::DeutscheMark, "DEM", "DM", MSMoney::SymbolAtStart, MSFalse, MSMoney::Decimal2, MSMoney::CommaDecimal2}, {MSMoney::FrenchFranc, "FRF", "F", MSMoney::SymbolAtEnd, MSTrue, MSMoney::Decimal2, MSMoney::CommaDecimal2}, {MSMoney::SwissFranc, "CHF", "F", MSMoney::SymbolAtStart, MSFalse, MSMoney::Decimal2, MSMoney::CommaDecimal2}, {MSMoney::DutchGuilder, "NLG", "FL", MSMoney::SymbolAtStart, MSTrue, MSMoney::Decimal2, MSMoney::CommaDecimal2}, {MSMoney::AustralianDollar, "AUD", "$", MSMoney::SymbolAtStart, MSFalse, MSMoney::Decimal2, MSMoney::CommaDecimal2}, {MSMoney::ItalianLira, "ITL", "L", MSMoney::SymbolAtStart, MSTrue, MSMoney::Decimal2, MSMoney::CommaDecimal2}, {MSMoney::SpanishPeseta, "ESP", "Pts", MSMoney::SymbolAtStart, MSTrue, MSMoney::Decimal2, MSMoney::CommaDecimal2}, {MSMoney::Euro,"EUR", "EUR",MSMoney::SymbolAtStart, MSTrue, MSMoney::Decimal2, MSMoney::CommaDecimal2}, // the rest of the currencies in alphabetical order {MSMoney::ArgentinianPeso, "ARS", "$", MSMoney::SymbolAtStart, MSFalse, MSMoney::Decimal2, MSMoney::CommaDecimal2}, {MSMoney::AustrianSchilling,"ATS", "S", MSMoney::SymbolAtStart, MSFalse, MSMoney::Decimal2, MSMoney::CommaDecimal2}, {MSMoney::BelgianFranc, "BEF", "F", MSMoney::SymbolAtStart, MSFalse, MSMoney::Decimal2, MSMoney::CommaDecimal2}, {MSMoney::BrazilianReal, "BRL", "R$", MSMoney::SymbolAtStart, MSFalse, MSMoney::Decimal2, MSMoney::CommaDecimal2}, {MSMoney::BulgarianLev, "BGL", "Lv", MSMoney::SymbolAtEnd, MSTrue, MSMoney::Decimal2, MSMoney::CommaDecimal2}, {MSMoney::ChileanPeso, "CLP", "N$", MSMoney::SymbolAtStart, MSTrue, MSMoney::Decimal2, MSMoney::CommaDecimal2}, {MSMoney::ChineseRenminbi, "CNY", "Y", MSMoney::SymbolAtStart, MSFalse, MSMoney::Decimal2, MSMoney::CommaDecimal2}, {MSMoney::CzechKoruna, "CSK", "CK", MSMoney::SymbolAtStart, MSFalse, MSMoney::Decimal2, MSMoney::CommaDecimal2}, {MSMoney::DanishKrone, "DKK", "Kr", MSMoney::SymbolAtStart, MSTrue, MSMoney::Decimal2, MSMoney::CommaDecimal2}, {MSMoney::FinnishMarkka, "FIM", "FM", MSMoney::SymbolAtStart, MSTrue, MSMoney::Decimal2, MSMoney::CommaDecimal2}, {MSMoney::GreekDrachma, "GRD", "Dr", MSMoney::SymbolAtEnd, MSTrue, MSMoney::Decimal2, MSMoney::CommaDecimal2}, {MSMoney::HongKongDollar, "HKD", "$", MSMoney::SymbolAtStart, MSFalse, MSMoney::Decimal2, MSMoney::CommaDecimal2}, {MSMoney::HungarianForint, "HUF", "Ft", MSMoney::SymbolAtEnd, MSTrue, MSMoney::Decimal2, MSMoney::CommaDecimal2}, {MSMoney::IcelandKrona, "ISK", "Kr", MSMoney::SymbolAtStart, MSFalse, MSMoney::Decimal2, MSMoney::CommaDecimal2}, {MSMoney::IndianRupee, "INR", "Rs", MSMoney::SymbolAtStart, MSFalse, MSMoney::Decimal2, MSMoney::CommaDecimal2}, {MSMoney::IrishPunt, "IEP", "\x0a3", MSMoney::SymbolAtStart, MSFalse, MSMoney::Decimal2, MSMoney::CommaDecimal2}, {MSMoney::IsraeliShekel, "ILS", "NIS", MSMoney::SymbolAtStart, MSTrue, MSMoney::Decimal2, MSMoney::CommaDecimal2}, {MSMoney::MexicanPeso, "MXN", "$", MSMoney::SymbolAtStart, MSFalse, MSMoney::Decimal2, MSMoney::CommaDecimal2}, {MSMoney::NewZealandDollar, "NZD", "$", MSMoney::SymbolAtStart, MSFalse, MSMoney::Decimal2, MSMoney::CommaDecimal2}, {MSMoney::NorwegianKrone, "NOK", "Kr", MSMoney::SymbolAtStart, MSFalse, MSMoney::Decimal2, MSMoney::CommaDecimal2}, {MSMoney::PolishZloty, "PLN", "Zl", MSMoney::SymbolAtEnd, MSTrue, MSMoney::Decimal2, MSMoney::CommaDecimal2}, {MSMoney::PortugueseEscudo, "PTE", "Esc", MSMoney::SymbolAtEnd, MSTrue, MSMoney::Decimal2, MSMoney::CommaDecimal2}, {MSMoney::RomanianLeu, "ROL", "L", MSMoney::SymbolAtEnd, MSTrue, MSMoney::Decimal2, MSMoney::CommaDecimal2}, {MSMoney::RussianRouble, "RUR", "R", MSMoney::SymbolAtEnd, MSTrue, MSMoney::Decimal2, MSMoney::CommaDecimal2}, {MSMoney::SingaporeDollar, "SGD", "$", MSMoney::SymbolAtStart, MSFalse, MSMoney::Decimal2, MSMoney::CommaDecimal2}, {MSMoney::SlovakianKoruna, "SKK", "Ks", MSMoney::SymbolAtEnd, MSTrue, MSMoney::Decimal2, MSMoney::CommaDecimal2}, {MSMoney::SouthKoreanWon, "KRW", "W", MSMoney::SymbolAtStart, MSFalse, MSMoney::Decimal2, MSMoney::CommaDecimal2}, {MSMoney::SwedishKrona, "SEK", "kr", MSMoney::SymbolAtEnd, MSTrue, MSMoney::Decimal2, MSMoney::CommaDecimal2}, {MSMoney::TaiwanDollar, "TWD", "NT$", MSMoney::SymbolAtStart, MSFalse, MSMoney::Decimal2, MSMoney::CommaDecimal2}, {MSMoney::TurkishLira, "TRL", "TL", MSMoney::SymbolAtStart, MSFalse, MSMoney::Decimal2, MSMoney::CommaDecimal2}, {MSMoney::VenezuelanBolivar,"VEB", "Bs", MSMoney::SymbolAtStart, MSTrue, MSMoney::Decimal2, MSMoney::CommaDecimal2} }; const char *MSMoney::isoCurrency(void) const { // find the ISO symbol for the currency in use,ignore DefaultCurrency as // this is resolved by currency() // return currencyTable[currency()].isoSym; } MSMoney::Currency MSMoney::isoConvert(const char *piso_sym_) const { CurrencyData *pCurrData = findCurrency(piso_sym_); return (pCurrData==0) ? defaultCurrency() : pCurrData->curr; } // creates string float priceISO Currency string MSString MSMoney::asMSF(void) const { MSString aString; if (isSet()==MSTrue) { aString+=MSFloat::asMSF(); aString+=MSMSF_SPACE; aString+=isoCurrency(); } return aString; } // parses string float priceISO Currency string MSError::ErrorStatus MSMoney::setFromMSF(const char *pString_) { int code; // first parse out the price and set it // then find the ISO unit of currency string and use it to set the currency if ((pString_!=0)) { unsigned found; unsigned size=strlen(pString_); ; unsigned i; char *buff=new char[size]; if (buff!=0) { found=0; for (i=0; istring()); } MSError::ErrorStatus MSMoney::set(const MSString& aString_) { return set(aString_.string()); } MSError::ErrorStatus MSMoney::set(double d) { return MSFloat::set(d); } MSError::ErrorStatus MSMoney::set(const char *pString_) { // All MSFloat formats for the number part are supported here, except for the exponential // format (e.g., 1.23E+4), which is not used with money anyway. // if (pString_!=0) { if (*pString_=='\0') { _currency = DefaultCurrency; return MSFloat::set(pString_); } MSString str(pString_); str.strip(); // remove leading and trailing whitespace unsigned int strLen = str.length(); unsigned int currStart = str.indexOf(MSStringTest(iscurr)); if (currStartcurr; // set the currency str.set(currEnd,c); // restore the first character of the number part if (currStart==0) // if the currency is in the beginning (e.g. "$5.00") { return MSFloat::set(str.string()+currEnd); // set the number part; calls changed() internally } else // the currency is in the middle of the string (e.g. "-$5.00") { str.remove(currStart,currEnd-currStart); // remove the currency part from the string return MSFloat::set(str.string()); // set the number part; calls changed() internally } } else // the currency part extends to the end of the string (e.g "5.00 USD") { CurrencyData *pCurr=findCurrency(str.string()+currStart); // find the symbol in the currency table if (pCurr==0) // could not match the symbol part { return MSError::BadMoney; } _currency = pCurr->curr; // set the currency str.set(currStart,'\0'); // null-terminate the number part; str's length is unchanged return MSFloat::set(str.string()); // set the number part; calls changed() internally } } else // no currency specified in the string { _currency = DefaultCurrency; return MSFloat::set(str.string()); } } return MSError::MSFailure; } static char *lookupFraction(FractionTable *fractionTable_,double fractionValue_) { register int low,mid,high; // Do a binary search of the security array. // Complements of Kernighan and Ritchie. low=0; mid=0; high=fractionTable_->length-1; fractionValue_=MSUtil::abs(fractionValue_); while (low<=high) { mid=(low+high)/2; if (fractionValue_table[mid].value) high=mid-1; else if (fractionValue_>fractionTable_->table[mid].value) low=mid+1; else break; // found it } return fractionTable_->table[mid].fraction; } void MSMoney::currency(Currency c_) { if (c_!=currency()) { _currency=c_; changed(); } } const char *MSMoney::format(MSString *pString_) const { return format(*pString_,CurrencyPrecision,NoCurrencySymbol); } const char *MSMoney::format(MSString& aString_) const { return format(aString_,CurrencyPrecision,NoCurrencySymbol); } const char *MSMoney::format(MSString *pString_,MSMoneyFormat format_,MSBoolean justify_) const { return format(*pString_,format_,NoCurrencySymbol,DefaultLocation,justify_);} const char *MSMoney::format(MSString& aString_,MSMoneyFormat format_,MSBoolean justify_) const { return format(aString_,format_,NoCurrencySymbol,DefaultLocation,justify_); } const char *MSMoney::format(MSString *pString_,const MSFormat& aFormat_,MSBoolean justify_) const { return format(*pString_,aFormat_,justify_); } const char *MSMoney::format(MSString& aString_,const MSFormat& aFormat_,MSBoolean justify_) const { if (aFormat_.formatType()==MSFormat::Money) return format(aString_,aFormat_.moneyFormat(),justify_); else return format(aString_); } const char *MSMoney::format(MSString *pString_, MSMoneyFormat f_, MSMoney::SymbolType symType_, MSMoney::SymbolLocation symLocation_, MSBoolean justify_) const { return format(*pString_,f_,symType_,symLocation_,justify_); } const char *MSMoney::format(MSString& aString_, MSMoneyFormat moneyFormat_, MSMoney::SymbolType symType_, MSMoney::SymbolLocation symLocation_, MSBoolean justify_) const { char buf[512]; char *fract_str; int mantisa; double fraction; int fieldWidth=0; CurrencyData *currData = ¤cyTable[currency()]; if (moneyFormat_==CurrencyPrecision) { // determine appropriate precision for currency type and use that // moneyFormat_ = currData->decimalFormat; } else if (moneyFormat_==CommaCurrencyPrecision) { // determine appropriate precision for currency type and use that // moneyFormat_ = currData->commaDecimalFormat; } switch (moneyFormat_) { // "inherited" formats from MSFloat case Decimal0: case Decimal1: case Decimal2: case Decimal3: case Decimal4: case Decimal5: case Decimal6: case Decimal7: case Decimal8: case CommaDecimal0: case CommaDecimal1: case CommaDecimal2: case CommaDecimal3: case CommaDecimal4: case CommaDecimal5: case CommaDecimal6: case CommaDecimal7: case CommaDecimal8: MSFloat::format(aString_,(MSFloatFormat) moneyFormat_); break; case Eights: if (justify_) fieldWidth=3; mantisa=int(_real); fraction=_real-mantisa; fract_str=lookupFraction(&EightsTable, fraction); if (mantisa!=0) sprintf(buf,"%d %-*s",mantisa,fieldWidth,fract_str); else { if (fraction<0.0) sprintf(buf,"-%-*s",fieldWidth,fract_str); else sprintf(buf,"%-*s",fieldWidth,fract_str); } aString_=buf; break; case Sixteenths: if (justify_) fieldWidth=3; mantisa=int(_real); fraction=_real-mantisa; fract_str=lookupFraction(&SixteenthsTable, fraction); if (mantisa!=0) sprintf(buf,"%d %-*s",mantisa,fieldWidth,fract_str); else { if (fraction<0.0) sprintf(buf,"-%-*s",fieldWidth,fract_str); else sprintf(buf,"%-*s",fieldWidth,fract_str); } aString_=buf; break; case ThirtySeconds: if (justify_) fieldWidth=5; mantisa=int(_real); fraction=_real-mantisa; fract_str=lookupFraction(&ThirtySecondsTable, fraction); if (mantisa!=0) sprintf(buf,"%d %-*s",mantisa,fieldWidth,fract_str); else { if (fraction<0.0) sprintf(buf,"-%-*s",fieldWidth,fract_str); else sprintf(buf,"%-*s",fieldWidth,fract_str); } aString_=buf; break; case SixtyForths: if (justify_) fieldWidth=5; mantisa=int(_real); fraction=_real-mantisa; fract_str=lookupFraction(&SixtyForthsTable, fraction); if (mantisa!=0) sprintf(buf,"%d %-*s",mantisa,fieldWidth,fract_str); else { if (fraction<0.0) sprintf(buf,"-%-*s",fieldWidth,fract_str); else sprintf(buf,"%-*s",fieldWidth,fract_str); } aString_=buf; break; case OneTwentyEights: if (justify_) fieldWidth=7; mantisa=int(_real); fraction=_real-mantisa; fract_str=lookupFraction(&OneTwentyEightsTable, fraction); if (mantisa!=0) sprintf(buf,"%d %-*s",mantisa,fieldWidth,fract_str); else { if (fraction<0.0) sprintf(buf,"-%-*s",fieldWidth,fract_str); else sprintf(buf,"%-*s",fieldWidth,fract_str); } aString_=buf; break; case TwoFiftySixths: { mantisa=int(_real); fraction=_real-mantisa; // try to figure out if the original number was set as // a fraction or decimal by doing a fudge-factor comparison // with the number rounded to the nearest 1/256 MSMoney rounded((fraction*256)/256); if (rounded==fraction) { // multiple of 256 if (justify_) fieldWidth=7; fract_str=lookupFraction(&TwoFiftySixthsTable,fraction); if (mantisa!=0) sprintf(buf,"%d %-*s",mantisa,fieldWidth,(char *)fract_str); else { if (fraction<0.0) sprintf(buf,"-%-*s",fieldWidth,fract_str); else sprintf(buf,"%-*s",fieldWidth,fract_str); } } else { // use decimal format if (justify_) fieldWidth=5; // align decimal point with space sprintf(buf,"%.2f%*s",_real,fieldWidth,""); } aString_=buf; } break; case CurrencyPrecision: case CommaCurrencyPrecision: default: MSError::error(MSError::MSFailure,"MSMoney::MSMoneyFormat","Invalid Format"); return format(aString_); } if (symLocation_==DefaultLocation) { symLocation_ = currData->symLocation; } if (symType_!=NoCurrencySymbol) { char newbuf[512]; const char *currSymbol = (symType_==ISOSymbol) ? currData->isoSym : currData->localSym; const char *sep = (symType_==ISOSymbol || currData->isSpaceSep==MSTrue) ? " " : ""; if (symLocation_==SymbolAtStart) { sprintf(newbuf,"%s%s%s",currSymbol,sep,aString_.string()); } else { sprintf(newbuf,"%s%s%s",aString_.string(),sep,currSymbol); } aString_=newbuf; } return (aString_.string()); } //#################################################################################### // operators MSMoney& MSMoney::operator=(const MSMoney& aMoney_) { if (this!=&aMoney_) { _currency=aMoney_._currency; MSFloat::operator=(aMoney_); } return *this; } MSMoney& MSMoney::operator=(const MSFloat& f_) { return MSFloat::operator=(f_),*this; } MSMoney& MSMoney::operator=(const MSInt& i_) { return MSFloat::operator=((int)i_),*this; } MSMoney& MSMoney::operator=(double d_) { return MSFloat::operator=(d_),*this; } MSMoney& MSMoney::operator=(int i_) { return MSFloat::operator=(i_),*this; } MSMoney MSMoney::operator+(const MSMoney& m_) const { if (currency()!=m_.currency()) { MSMessageLog::errorMessage("MSMoney::operator+(): currencies don't match\n"); return MSMoney(*this); } else { return MSMoney(*this,m_,Plus); } } MSMoney MSMoney::operator-(const MSMoney& m_) const { if (currency()!=m_.currency()) { MSMessageLog::errorMessage("MSMoney::operator-(): currencies don't match\n"); return MSMoney(*this); } else { return MSMoney(*this,m_,Minus); } } //######################################################################################### // special protected constructors used for return value optimization //######################################################################################### MSMoney::MSMoney(const MSMoney& a_,const MSMoney& b_,MSFloat::FloatOperator operator_) : MSFloat(a_,b_,operator_), _currency(a_._currency) // assumes a_._currency==b_._currency { } MSMoney::MSMoney(const MSMoney& a_,const MSFloat& b_,MSFloat::FloatOperator operator_) : MSFloat(a_,b_,operator_), _currency(a_._currency) { } MSMoney::MSMoney(const MSMoney& a_,const MSInt& b_,MSFloat::FloatOperator operator_) : MSFloat(a_,b_,operator_), _currency(a_._currency) { } MSMoney::MSMoney(const MSMoney& a_,double b_,MSFloat::FloatOperator operator_) : MSFloat(a_,b_,operator_), _currency(a_._currency) { } MSMoney::MSMoney(const MSMoney& a_,int b_,MSFloat::FloatOperator operator_) : MSFloat(a_,b_,operator_), _currency(a_._currency) { } MSMoney::MSMoney(const MSFloat& a_,const MSMoney& b_,MSFloat::FloatOperator operator_) : MSFloat(a_,b_,operator_), _currency(b_._currency) { } MSMoney::MSMoney(const MSInt& a_,const MSMoney& b_,MSFloat::FloatOperator operator_) : MSFloat(a_,b_,operator_), _currency(b_._currency) { } MSMoney::MSMoney(double a_,const MSMoney& b_,MSFloat::FloatOperator operator_) : MSFloat(a_,b_,operator_), _currency(b_._currency) { } MSMoney::MSMoney(int a_,const MSMoney& b_,MSFloat::FloatOperator operator_) : MSFloat(a_,b_,operator_), _currency(b_._currency) { } MSMoney& MSMoney::operator+=(const MSMoney& aMoney_) { if (aMoney_.currency()!=currency()) { MSError::error(MSError::MSFailure,"MSMoney::operator+=","currencies don't match"); setInvalid(); return changed(),*this; } else { MSFloat::operator+=(aMoney_); return *this; } } MSMoney& MSMoney::operator-=(const MSMoney& aMoney_) { if (aMoney_.currency()!=currency()) { MSError::error(MSError::MSFailure,"MSMoney::operator-=","currencies don't match"); setInvalid(); return changed(),*this; } else { MSFloat::operator-=(aMoney_); return *this; } } ostream& operator<<(ostream& aStream_,const MSMoney& aMoney_) { MSString aString; return aStream_<notFound(0x0); // add the ISO symbols to the table first for (unsigned int i=0; iadd(currencyTable[i].isoSym, (void *)¤cyTable[i]); // // Unlike ISO currency symbols, local currency symbols are not unique // therefore, check if a symbol (e.g., "$") has already been added to the // hash table; if not, add it. Thus, if a local currency symbol is used // in more than one country, the first one added here will be returned. // This is why the most common/important currencies (USDollar, FrenchFranc, etc.) // are laid down *first* in the currencyTable. // CurrencyData *pData = (CurrencyData *)currSymTable->lookup(currencyTable[i].localSym); if (pData==(CurrencyData *)currSymTable->notFound()) // if it's not in the table yet { currSymTable->add(currencyTable[i].localSym, (void *)¤cyTable[i]); } } } return (CurrencyData *)currSymTable->lookup(sym_); } int MSMoney::iscurr(int c) { return (c=='$' || !(isdigit(c) || ispunct(c) || isspace(c))); } aplus-fsf-4.22/src/MSTypes/MSMoneyVector.C0000644000265000001440000000361010772770447014006 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #ifdef MSTK_MANUAL_INSTANTIATION #include #if defined(MS_XLC_TEMPLATE_INSTANTIATION) #pragma define (MSTypeVector) #endif #if defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma instantiate MSBaseVector > #pragma instantiate MSObjectVector #pragma instantiate MSTypeVector #if !defined(MS_TEMPLATE_MANUAL_FRIEND_BUG) // The version of EDG used by SGI's dcc compiler has a bug related to access from friends #pragma instantiate ostream & operator<< (ostream &, const MSBaseVector > &) #endif //MS_TEMPLATE_MANUAL_FRIEND_BUG #endif //MS_EDG_TEMPLATE_INSTANTIATION #if defined(MS_VC_TEMPLATE_INSTANTIATION) template MSBaseVector >; template MSBaseVectorOps >; template MSObjectVector; template MSTypeVector; // instantiate non-inline friend template functions static int __dummy01__() { if (0) operator<<(cout, MSBaseVector >()); return 0; } static int __dummyInt01__=__dummy01__(); #endif //MS_VC_TEMPLATE_INSTANTIATION #if defined(MS_STD_TEMPLATE_INSTANTIATION) template class MSBaseVector >; template class MSBaseVectorOps >; template class MSObjectVector; template class MSTypeVector; template ostream& operator<<(ostream&,const MSBaseVector >&); #endif #endif // MSTK_MANUAL_INSTANTIATION aplus-fsf-4.22/src/MSTypes/MSNameSpace.C0000644000265000001440000000743610772770447013402 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #if HAVE_IOSTREAM #include #else #include #endif static const unsigned MSSymbolHashTableChainLengthThreshold=4; static char *nullString=""; class MSNameSpaceHashTable : public MSHashTable { public: MSNameSpaceHashTable(unsigned size_); MSHashEntry *addSymbol(const char *,MSAtom); }; MSNameSpaceHashTable::MSNameSpaceHashTable(unsigned size_) : MSHashTable(size_) { _notFound=MSNullAtom; } MSHashEntry *MSNameSpaceHashTable::addSymbol(const char *pSymbol_,MSAtom atomValue_) { if (size()==0) { MSMessageLog::errorMessage("MSHashTable: add failed - hash table size==0\n"); return 0; } unsigned whichBucket=hash(pSymbol_); MSHashEntry *entry=searchBucketFor(bucket(whichBucket),pSymbol_); if (entry!=0) { MSMessageLog::errorMessage("MSHashTable: add failed - key already in table: %s\n",pSymbol_); return 0; } entry=addElement(pSymbol_,whichBucket); entry->value((void *)atomValue_); return entry; } MSNameSpace::MSNameSpace(unsigned size_) { _size=size_; _symbolHashTable=new MSNameSpaceHashTable(size()); _stringTable=new char*[size()]; _averageChainLengthThreshold=MSSymbolHashTableChainLengthThreshold; for (unsigned i=0;ilookup(pSymbol_); } MSHashEntry *MSNameSpace::addSymbol(const char *pSymbol_,MSAtom atomValue_) { return _symbolHashTable->addSymbol(pSymbol_,atomValue_); } // make sure there are at least size_+1 elements in the array void MSNameSpace::reserve(unsigned size_) { unsigned n=size_+1; if (size()averageChainLength()>averageChainLengthThreshold()) { _symbolHashTable->resize(_symbolHashTable->size()<<1); } } } MSAtom MSNameSpace::intern(const char *symbol_) { MSAtom r=MSNullAtom; if (symbol_!=0) { if ((r=(MSAtom)_symbolHashTable->lookup(symbol_))==MSNullAtom) { #ifdef MS_MULTI_THREAD MSGuard guard(_mutex); //double check again under guard to prevent possible double addition //if 2 threads trying to intern the same thing at the same time. if ((r=(MSAtom)_symbolHashTable->lookup(symbol_))==MSNullAtom) { #endif r=nextAtomValue(); MSHashEntry *entry=addSymbol(symbol_,_nextAtomValue); if (entry!=0) { _nextAtomValue++; reserve(count()); _stringTable[count()]=entry->stringKey(); _count++; } } #ifdef MS_MULTI_THREAD } #endif } return r; } ostream& operator<<(ostream& aStream_,const MSNameSpace& aNameSpace_) { aStream_<<*(aNameSpace_._symbolHashTable)< #include MSNodeItem::~MSNodeItem(void) { remove(); _next=0; _prev=0; _data=0; } // cuts head circular list before h and inserts new circular list, // making large circular list. This operation is semetrical with // respect to interchange of h and p. void MSNodeItem::insert(MSNodeItem *h_) { if (h_!=0) { MSNodeItem *t=this->_prev; // temporary node this->_prev->_next=h_; this->_prev=h_->_prev; h_->_prev->_next=this; h_->_prev=t; } return; } // remove node from its doubly linked list -- idempotent void MSNodeItem::remove(void) { this->_prev->_next=this->_next; this->_next->_prev=this->_prev; this->_prev=this; this->_next=this; } // Take Out node And Deposit one position forward (leap-frog) void MSNodeItem::toad(void) { MSNodeItem *o=this->_prev; MSNodeItem *q=this->_next; MSNodeItem *r; o->_next=q; q->_prev=o; this->_next=r=q->_next; this->_prev=q; q->_next=this; r->_prev=this; } void MSNodeItem::sort(MSNodeItem *hp_,NodeSortFunc func_) { if (hp_!=0) { register int c; register MSNodeItem *np; for (c=0,np=hp_->next(); np!=hp_; c++,np=np->next()); if (c!=0) { register MSNodeItem **ap; register MSNodeItem **ai; register MSNodeItem **ae; ap=new MSNodeItem*[c]; for (ae=(ai=ap)+c; ai!=ae; ai++) { np=hp_->next(); np->remove(); *ai=np; } if (func_!=(NodeSortFunc) 0) { qsort((char *)(ap),c,sizeof(*ap),func_); for (ai=ap; ai!=ae; ai++) { np=*ai; np->insert(hp_); *ap=0; } } delete [] ap; } } return; } MSNodeList& MSNodeList::append(MSNodeItem *l_) { if (_last) { _last->_next=l_; l_->_prev=_last; } else _first=l_; _last=l_; _first->_prev=_last; l_->_next=_first; return *this; } MSNodeList& MSNodeList::prepend(MSNodeItem *l_) { if (_first) { _first->_prev=l_; l_->_next=_first; } else _last=l_; _first=l_; _last->_next=_first; l_->_prev=_last; return *this; } MSNodeList& MSNodeList::unlink(MSNodeItem *l_) { if (l_==_first&&l_==_last) { _first=0; _last=0; l_->_next=l_; l_->_prev=l_; } else { if (l_==_first) _first=_first->_next; if (l_==_last) _last=_last->_prev; if (l_->_next) l_->_next->_prev=l_->_prev; if (l_->_prev) l_->_prev->_next=l_->_next; l_->_next=l_; l_->_prev=l_; } return *this; } aplus-fsf-4.22/src/MSTypes/MSNormalizedYears.C0000644000265000001440000000312210772770447014642 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include static const double DaysInYear=365.25; MSString MSNormalizedYears::asString(void) const { return MSString(_years); } MSString MSNormalizedYears::asDebugInfo(void) const { MSString result("MSNormalizedYears(@"); result+=MSString((unsigned long)this).d2x().lowerCase(); result+=",_years="; result+=MSString(_years); result+=",_basis="; result+=MSString((int)_basis); result+=",_type="; result+=type().symbolName(); result+=")"; return MSString(result); } MSString MSNormalizedYears::className(void) const { return MSString("MSNormalizedYears"); } const MSSymbol& MSNormalizedYears::type(void) const { return symbol(); } const MSSymbol& MSNormalizedYears::symbol(void) { static MSSymbol sym ("MSNormalizedYears"); return sym; } void MSNormalizedYears::makeFromDates(const MSDate& d1_, const MSDate& d2_) { makeFromDays(d1_-d2_); } void MSNormalizedYears::makeFromDays(int i_) { // absolute value if (i_<0) i_=-i_; _years=double(i_)/daysInYear(); } double MSNormalizedYears::daysInYear() const { switch (_basis) { case AIBD30_360: return 360.0; case Actual365: case Euro365: return 365.0; case ActualActual: return DaysInYear; } return 0; } aplus-fsf-4.22/src/MSTypes/MSNullEvent.C0000644000265000001440000000070710772770447013454 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include MSNullEvent::~MSNullEvent(void) {} const MSSymbol& MSNullEvent::symbol(void) { static MSSymbol sym ("MSNullEvent"); return sym; } aplus-fsf-4.22/src/MSTypes/MSOid.C0000644000265000001440000001061210772770447012247 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #define VERSIONID 0 #define SEQUENCE_MAX 255 #define SEQUENCE_SHIFT 24 #define VERSION_SHIFT 20 #define OIDSIZE 32 // number characters in hex string rep of oid #include #include #if HAVE_IOSTREAM #include #else #include #endif #include #include #include #include #if defined(MS_GETPID_IN_PROCESS) #include #endif #if defined(MS_HAS_SYSTEMINFO) #include #elif ! defined(MS_HAS_GETHOSTID_DECLARATION) // does not appear to exist in a standard include file on all platforms extern "C" long int gethostid(); #endif // Class instances: MSOid const MSOid::null(MSOid::MSOidNull); unsigned MSOid::_hid = 0; unsigned MSOid::_pid = 0; unsigned MSOid::_seq = SEQUENCE_MAX; unsigned long MSOid::_sec = 0; // fast conversion to printable hex: inline char toHex(unsigned char b) { b &= 0x0F; // Chop off top nybble return (b <= 9) ? b+'0' : (b-10)+'A'; } // and reverse: inline unsigned char fromHex(char ch) { return (ch >= '0' && ch <= '9') ? ch-'0' : (toupper(ch)-'A')+10; } void MSOid::newPid() { _pid = getpid(); } void MSOid::newOid() { if (*this != MSOid::null) return; if (!_hid) { #if defined(MS_HAS_SYSTEMINFO) char buf[128]; if (sysinfo(SI_HW_SERIAL, buf, 128) == -1) { cerr<<"sysinfo: Can't get serial number."< MSOid::_sec) MSOid::_sec = tval.tv_sec; else MSOid::_sec += 1; MSOid::_seq = 0; } else MSOid::_seq += 1; // first byte-sequence number and second byte bits 0-3-version // the reset of second byte and bytes 3 and 4 are reserved for the class id _oid[0] = MSOid::_seq << SEQUENCE_SHIFT; _oid[0] += VERSIONID << VERSION_SHIFT; _oid[1] = _hid; _oid[2] = MSOid::_sec; _oid[3] = _pid; } int MSOid::parse(register const char *str) { if ((!str) || (strlen(str) != OIDSIZE)) return MSError::BadString; register unsigned char* memptr = (unsigned char *)_oid; while(str[0] && str[1]) { *memptr++ = (fromHex(str[0]) << 4) | (fromHex(str[1])); str += 2; } return MSError::MSSuccess; } istream & operator>>(istream& s, MSOid& target) { const int expectedLength = sizeof(target._oid) * 2; char buf[expectedLength + 1], *bp = buf, *end = bp + expectedLength; while (bp < end) { char c; if (s >> c) { if (isxdigit(c)) { *bp++ = c; } else { s.clear(s.rdstate() | ios::failbit); // set translation error return s; } } else { return s; // eof error already set } } // Got all hex chars. *bp = 0; target.parse(buf); return s; } ostream & operator<<(ostream& s, const MSOid& source) { if (!s) return s; const char *memptr = (const char*)source._oid; const char *end = memptr + sizeof(source._oid); while(memptr < end) { s << toHex(*memptr >> 4) << toHex(*memptr); memptr++; } return s; } const MSString MSOid::asString() const { static char chBuff[(2*sizeof(_oid))+1]; char* str = chBuff; const unsigned char * memptr = (unsigned char *)_oid; while(memptr < (unsigned char *)(_oid+NPARTS)) { *str++ = toHex(*memptr >> 4); // Do the high nibble *str++ = toHex(*memptr); // And the low one memptr++; } *str = '\0'; return MSString(chBuff); } aplus-fsf-4.22/src/MSTypes/MSRandom.C0000644000265000001440000000301010772770447012746 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #if HAVE_IOSTREAM #include #else #include #endif #include #include #include #include #if defined(MS_MULTI_THREAD) static MSMutex defaultGenMutex; #endif //MS_MULTI_THREAD MSRandom::MSRandom(void) : _useDefaultGen(MSTrue) // dispatch to default generator { } MSRandom::MSRandom(unsigned long seed_) : _useDefaultGen(MSFalse) // use private generator { if (seed_==0) { struct timeval now; gettimeofday(&now,(struct timezone *)(0)); seed_ = now.tv_sec; } _seed = seed_; } MSRandom::~MSRandom(void) {} void MSRandom::seed(unsigned long seed_) { // switch to private generator _useDefaultGen = MSFalse; _seed = seed_; } unsigned long MSRandom::random(unsigned long limit_) { if (_useDefaultGen==MSTrue) // use the global generator { MSGUARD(defaultGenMutex); return defaultGen().random(limit_); } else // use own generator { _seed=_seed*5709421UL+1UL; return ((_seed>>16)%limit_); } } MSRandom& MSRandom::defaultGen(void) { // initialize default generator with a seed of 0, which means that // gettimeofday() will be used as the seed static MSRandom rn(0); return rn; } aplus-fsf-4.22/src/MSTypes/MSRange.C0000644000265000001440000000105010772770447012564 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #if HAVE_IOSTREAM #include #else #include #endif #include ostream& operator<<(ostream& aStream_,const MSRange& aRange_) { return aStream_<<"min: "< #include #include #include #if HAVE_IOSTREAM #include #else #include #endif #include #include #include #ifdef MS_NO_INLINES #include #endif MSString MSRate::asString(void) const { MSString s; return MSString(format(s,MSRate::Percent4)); } MSString MSRate::asDebugInfo(void) const { MSString result("MSRate(@"); result+=MSString((unsigned long)this).d2x().lowerCase(); result+=",_real="; result+=MSString(_real); result+=",_isSet="; result+=isSet()==MSTrue?"MSTrue":"MSFalse"; result+=",_isValid="; result+=isValid()==MSTrue?"MSTrue":"MSFalse"; result+=",_type="; result+=type().symbolName(); result+=")"; return result; } MSString MSRate::className(void) const { return MSString("MSRate"); } const MSSymbol& MSRate::type(void) const { return symbol(); } MSModel *MSRate::clone(void) const { return new MSRate(*this); } MSModel *MSRate::create(void) const { return new MSRate(); } void MSRate::assign(const MSModel& aModel_) { *this=(MSRate&)aModel_; } long MSRate::compare(const MSModel& aModel_) const { return ::compare(*this,(MSRate&)aModel_); } const MSSymbol& MSRate::symbol(void) { static MSSymbol sym ("MSRate"); return sym; } MSRate::~MSRate(void) {} MSError::ErrorStatus MSRate:: set(const char *pString_) { // create copy in case we have to remove bp/% // MSFloat::set handles valid and set flags MSString copy(pString_); copy.stripTrailing(); int len=copy.length(); // check for percent if (copy.last()=='%') // if ((len>0)&&(pString_[len-1]=='%')) -- old style { copy.truncate(1); MSError::ErrorStatus status=MSFloat::internalSet(copy.string()); if (status!=MSError::MSSuccess) return status; _real/=100.0; return changed(),MSError::MSSuccess; } // check for basis points if ((len>1)&&(((pString_[len-2]=='b')&&(pString_[len-1]=='p'))|| ((pString_[len-2]=='B')&&(pString_[len-1]=='P')))) { MSString copy(pString_); copy.truncate(2); MSError::ErrorStatus status=MSFloat::internalSet(copy.string()); if (status!=MSError::MSSuccess) return status; _real/=10000.0; return changed(),MSError::MSSuccess; } if (MSFloat::internalSet(pString_)!=MSError::MSSuccess) return MSError::BadRate; return changed(),MSError::MSSuccess; } MSError::ErrorStatus MSRate:: set(const MSString *pString_) { return set(pString_->string()); } MSError::ErrorStatus MSRate:: set(const MSString& aString_) { return set(aString_.string()); } MSError::ErrorStatus MSRate:: set(double d_) { return MSFloat::set(d_); } const char *MSRate:: format(MSString *pString_) const { return MSFloat::format(pString_); } const char *MSRate:: format(MSString& aString_) const { return MSFloat::format(aString_); } const char *MSRate::format(MSString& aString_,const MSFormat& aFormat_) const { return (aFormat_.formatType()==MSFormat::Rate)?format(aString_,aFormat_.rateFormat()):format(aString_); } const char *MSRate::format(MSString *pString_,const MSFormat& aFormat_) const { return format(*pString_,aFormat_); } const char *MSRate:: format(MSString *pString_,MSRateFormat format_) const { return format(*pString_,format_); } const char *MSRate:: format(MSString& aString_,MSRateFormat format_) const { if (isSet()==MSFalse) { aString_=""; return aString_.string(); } if (isValid()==MSFalse) { aString_="?"; MSError::error(MSError::MSFailure,"MSRate::MSRateFormat","Invalid Value"); return aString_.string(); } char buf[80]; switch (format_) { case Decimal0: case Decimal1: case Decimal2: case Decimal3: case Decimal4: case Decimal5: case Decimal6: case Decimal7: case Decimal8: case CommaDecimal0: case CommaDecimal1: case CommaDecimal2: case CommaDecimal3: case CommaDecimal4: case CommaDecimal5: case CommaDecimal6: case CommaDecimal7: case CommaDecimal8: return formatReal(aString_,MSFloatFormat(format_),MSFormat::NoModifier,_real); case Percent0: sprintf(buf,"%.0f%%",_real*100); break; case Percent1: sprintf(buf,"%.1f%%",_real*100); break; case Percent2: sprintf(buf,"%.2f%%",_real*100); break; case Percent3: sprintf(buf,"%.3f%%",_real*100); break; case Percent4: sprintf(buf,"%.4f%%",_real*100); break; case Percent5: sprintf(buf,"%.5f%%",_real*100); break; case BasisPoint: sprintf(buf,"%.0fbp",_real*10000); break; default: MSError::error(MSError::MSFailure,"MSRate::MSRateFormat","Invalid Value"); return format(aString_); } aString_=buf; return aString_.string(); } ostream& operator<<(ostream& aStream_,const MSRate& aRate_) { MSString aString; return aStream_< #ifndef MSDefinesHEADER #include #endif #if defined(MSTK_MANUAL_INSTANTIATION) #include #if defined(MS_XLC_TEMPLATE_INSTANTIATION) #pragma define (MSTypeVector) #endif #if defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma instantiate MSBaseVector > #pragma instantiate MSObjectVector #pragma instantiate MSTypeVector #if !defined(MS_TEMPLATE_MANUAL_FRIEND_BUG) // The version of EDG used by SGI's dcc compiler has a bug related to access from friends #pragma instantiate ostream & operator<< (ostream &, const MSBaseVector > &) #endif //MS_TEMPLATE_MANUAL_FRIEND_BUG #endif #if defined(MS_VC_TEMPLATE_INSTANTIATION) template MSBaseVector >; template MSBaseVectorOps >; template MSObjectVector; template MSTypeVector; // instantiate non-inline friend template functions static int __dummy01__() { if (0) operator<<(cout, MSBaseVector >()); return 0; } static int __dummyInt01__=__dummy01__(); #endif // MS_VC_TEMPLATE_INSTANTIATION #if defined(MS_STD_TEMPLATE_INSTANTIATION) template class MSBaseVector >; template class MSBaseVectorOps >; template class MSObjectVector; template class MSTypeVector; template ostream& operator<<(ostream&,const MSBaseVector >&); #endif #endif // MSTK_MANUAL_INSTANTIATION aplus-fsf-4.22/src/MSTypes/MSRefCount.C0000644000265000001440000000053710772770450013260 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include MSRefCount::~MSRefCount(void) { } aplus-fsf-4.22/src/MSTypes/MSRegexp.C0000644000265000001440000007535710772770450013001 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include typedef struct regexp { char *startp[NSUBEXP]; char *endp[NSUBEXP]; char regstart; /* Internal use only. */ char reganch; /* Internal use only. */ char *regmust; /* Internal use only. */ int regmlen; /* Internal use only. */ char program[1]; /* Unwarranted chumminess with compiler. */ } regexp; regexp *regcomp(const char *); int regexec(regexp *,const char *); MSRegexp::RegexpData::RegexpData(const char *pattern_,MSRegexp::CaseFlag caseFlag_) : _target(0),_pattern(0),_caseFlag(caseFlag_),_regularExpression(0),_status(MSTrue) { if (pattern_!=0) { _pattern=new char[strlen(pattern_)+1]; strcpy(_pattern,pattern_); if (_caseFlag==MSRegexp::IgnoreCase) { char *pString=new char[strlen(pattern_)+1]; strcpy(pString,pattern_); strlwr(pString); if ((_regularExpression=regcomp(pString))==0) _status=MSFalse; delete [] pString; } else if ((_regularExpression=regcomp(_pattern))==0) _status=MSFalse; if (_status==MSFalse) MSMessageLog::errorMessage("MSRegexp: error compiling regular expression pattern\n"); } } MSRegexp::RegexpData::~RegexpData(void) { if (_regularExpression!=0) free((char *)_regularExpression); if (_pattern!=0) delete [] _pattern; } MSBoolean MSRegexp::RegexpData::isMatch(const char *target_) { int res=0; _numGroups=0; if (target_!=0&®ularExpression()!=0) { if (_caseFlag==MSRegexp::IgnoreCase) { char *pString=new char[strlen(target_)+1]; strcpy(pString,target_); strlwr(pString); res=regexec(regularExpression(),pString); _target=pString; // need this for groupRange delete [] pString; } else { res=regexec(regularExpression(),target_); _target=(char *)target_; } if (res!=0) { for (unsigned i=0;istartp[i]==NULL) break; _numGroups++; } } } return (res==0)?MSFalse:MSTrue; } MSRange MSRegexp::RegexpData::groupRange(unsigned index_) const { if (index_startp[index_]-(char *)_target; int end=regularExpression()->endp[index_]-(char *)_target; if (end>0) end--; return MSRange(start,end); } return MSRange(); } MSRegexp::MSRegexp(void) { init(0,IgnoreCase); } MSRegexp::MSRegexp(const MSRegexp& aRegexp_) { _regexpData=aRegexp_._regexpData; _regexpData->increment(); } MSRegexp::MSRegexp(const char *pattern_,MSRegexp::CaseFlag caseFlag_) { init(pattern_,caseFlag_); } MSRegexp::~MSRegexp(void) { _regexpData->decrement(); } void MSRegexp::init(const char *pattern_,MSRegexp::CaseFlag caseFlag_) { _regexpData=new RegexpData(pattern_,caseFlag_); _regexpData->increment(); } MSRegexp& MSRegexp::operator=(const MSRegexp& aRegexp_) { if (&aRegexp_!=this) { _regexpData->decrement(); _regexpData=aRegexp_._regexpData; _regexpData->increment(); } return *this; } MSBoolean MSRegexp::match(const char *target_) { return isMatch(target_); } MSBoolean MSRegexp::isMatch(const char *target_) { if (_regexpData->count()>1) { RegexpData *newRegexpData=new RegexpData(_regexpData->_pattern,_regexpData->_caseFlag); _regexpData->decrement(); _regexpData=newRegexpData; _regexpData->increment(); } return _regexpData->isMatch(target_); } /* * regcomp and regexec -- regsub and regerror are elsewhere * * Copyright (c) 1986 by University of Toronto. * Written by Henry Spencer. Not derived from licensed software. * * Permission is granted to anyone to use this software for any * purpose on any computer system, and to redistribute it freely, * subject to the following restrictions: * * 1. The author is not responsible for the consequences of use of * this software, no matter how awful, even if they arise * from defects in it. * * 2. The origin of this software must not be misrepresented, either * by explicit claim or by omission. * * 3. Altered versions must be plainly marked as such, and must not * be misrepresented as being the original software. * * Beware that some of this code is subtly aware of the way operator * precedence is structured in regular expressions. Serious changes in * regular-expression syntax might require a total rethink. */ /* * The first byte of the regexp internal "program" is actually this magic * number; the start node begins in the second byte. */ #define MAGIC 0234 /* * The "internal use only" fields in regexp.h are present to pass info from * compile to execute that permits the execute phase to run lots faster on * simple cases. They are: * * regstart char that must begin a match; '\0' if none obvious * reganch is the match anchored (at beginning-of-line only)? * regmust string (pointer into program) that match must include, or NULL * regmlen length of regmust string * * Regstart and reganch permit very fast decisions on suitable starting points * for a match, cutting down the work a lot. Regmust permits fast rejection * of lines that cannot possibly match. The regmust tests are costly enough * that regcomp() supplies a regmust only if the r.e. contains something * potentially expensive (at present, the only such thing detected is * or + * at the start of the r.e., which can involve a lot of backup). Regmlen is * supplied because the test in regexec() needs it and regcomp() is computing * it anyway. */ /* * Structure for regexp "program". This is essentially a linear encoding * of a nondeterministic finite-state machine (aka syntax charts or * "railroad normal form" in parsing technology). Each node is an opcode * plus a "next" pointer, possibly plus an operand. "Next" pointers of * all nodes except BRANCH implement concatenation; a "next" pointer with * a BRANCH on both ends of it is connecting two alternatives. (Here we * have one of the subtle syntax dependencies: an individual BRANCH (as * opposed to a collection of them) is never concatenated with anything * because of operator precedence.) The operand of some types of node is * a literal string; for others, it is a node leading into a sub-FSM. In * particular, the operand of a BRANCH node is the first node of the branch. * (NB this is *not* a tree structure: the tail of the branch connects * to the thing following the set of BRANCHes.) The opcodes are: */ /* definition number opnd? meaning */ #define END 0 /* no End of program. */ #define BOL 1 /* no Match "" at beginning of line. */ #define EOL 2 /* no Match "" at end of line. */ #define ANY 3 /* no Match any one character. */ #define ANYOF 4 /* str Match any character in this string. */ #define ANYBUT 5 /* str Match any character not in this string. */ #define BRANCH 6 /* node Match this alternative, or the next... */ #define BACK 7 /* no Match "", "next" ptr points backward. */ #define EXACTLY 8 /* str Match this string. */ #define NOTHING 9 /* no Match empty string. */ #define STAR 10 /* node Match this (simple) thing 0 or more times. */ #define PLUS 11 /* node Match this (simple) thing 1 or more times. */ #define OPEN 20 /* no Mark this point in input as start of #n. */ /* OPEN+1 is number 1, etc. */ #define CLOSE 30 /* no Analogous to OPEN. */ /* * Opcode notes: * * BRANCH The set of branches constituting a single choice are hooked * together with their "next" pointers, since precedence prevents * anything being concatenated to any individual branch. The * "next" pointer of the last BRANCH in a choice points to the * thing following the whole choice. This is also where the * final "next" pointer of each individual branch points; each * branch starts with the operand node of a BRANCH node. * * BACK Normal "next" pointers all implicitly point forward; BACK * exists to make loop structures possible. * * STAR,PLUS '?', and complex '*' and '+', are implemented as circular * BRANCH structures using BACK. Simple cases (one character * per match) are implemented with STAR and PLUS for speed * and to minimize recursive plunges. * * OPEN,CLOSE ...are numbered at compile time. */ /* * A node is one char of opcode followed by two chars of "next" pointer. * "Next" pointers are stored as two 8-bit pieces, high order first. The * value is a positive offset from the opcode of the node containing it. * An operand, if any, simply follows the node. (Note that much of the * code generation knows about this implicit relationship.) * * Using two bytes for the "next" pointer is vast overkill for most things, * but allows patterns to get big without disasters. */ #define OP(p) (*(p)) #define NEXT(p) (((*((p)+1)&0377)<<8) + (*((p)+2)&0377)) #define OPERAND(p) ((p) + 3) /* * Utility definitions. */ void regerror(char *s) { MSMessageLog::errorMessage("regerror: %s\n", s); } #ifndef CHARBITS #define UCHARAT(p) ((int)*(unsigned char *)(p)) #else #define UCHARAT(p) ((int)*(p)&CHARBITS) #endif #define FAIL(m) { regerror(m); return(NULL); } #define ISMULT(c) ((c) == '*' || (c) == '+' || (c) == '?') #define META "^$.[()|?+*\\" /* * Flags to be passed up and down. */ #define HASWIDTH 01 /* Known never to match null string. */ #define SIMPLE 02 /* Simple enough to be STAR/PLUS operand. */ #define SPSTART 04 /* Starts with * or +. */ #define WORST 0 /* Worst case. */ /* * Global work variables for regcomp(). */ static char *regparse; /* Input-scan pointer. */ static int regnpar; /* () count. */ static char regdummy; static char *regcode; /* Code-emit pointer; ®dummy = don't. */ static long regsize; /* Code size. */ /* * Forward declarations for regcomp()'s friends. */ #ifndef STATIC #define STATIC static #endif STATIC char *reg(int,int *); STATIC char *regbranch(int *); STATIC char *regpiece(int *); STATIC char *regatom(int *); STATIC char *regnode(char); STATIC char *regnext(char *); STATIC void regc(char); STATIC void reginsert(char,char *); STATIC void regtail(char *,char *); STATIC void regoptail(char *,char *); STATIC int regtry(regexp *,char *); #ifdef STRCSPN STATIC int strcspn(char *,char *); #endif /* - regcomp - compile a regular expression into internal code * * We can't allocate space until we know how big the compiled form will be, * but we can't compile it (and thus know how big it is) until we've got a * place to put the code. So we cheat: we compile it twice, once with code * generation turned off and size counting turned on, and once "for real". * This also means that we don't allocate space until we are sure that the * thing really will compile successfully, and we never have to move the * code and thus invalidate pointers into it. (Note that it has to be in * one piece because free() must be able to free it all.) * * Beware that the optimization-preparation code in here knows about some * of the structure of the compiled regexp. */ regexp * regcomp(const char *exp) { register regexp *r; register char *scan; register char *longest; register int len; int flags; if (exp == NULL) FAIL("NULL argument"); /* First pass: determine size, legality. */ regparse = (char *)exp; regnpar = 1; regsize = 0L; regcode = ®dummy; regc(MAGIC); if (reg(0, &flags) == NULL) return(NULL); /* Small enough for pointer-storage convention? */ if (regsize >= 32767L) /* Probably could be 65535L. */ FAIL("regexp too big"); /* Allocate space. */ r = (regexp *)malloc(sizeof(regexp) + (unsigned)regsize); if (r == NULL) FAIL("out of space"); /* Second pass: emit code. */ regparse = (char *)exp; regnpar = 1; regcode = r->program; regc(MAGIC); if (reg(0, &flags) == NULL) return(NULL); /* Dig out information for optimizations. */ r->regstart = '\0'; /* Worst-case defaults. */ r->reganch = 0; r->regmust = NULL; r->regmlen = 0; scan = r->program+1; /* First BRANCH. */ if (OP(regnext(scan)) == END) { /* Only one top-level choice. */ scan = OPERAND(scan); /* Starting-point info. */ if (OP(scan) == EXACTLY) r->regstart = *OPERAND(scan); else if (OP(scan) == BOL) r->reganch++; /* * If there's something expensive in the r.e., find the * longest literal string that must appear and make it the * regmust. Resolve ties in favor of later strings, since * the regstart check works with the beginning of the r.e. * and avoiding duplication strengthens checking. Not a * strong reason, but sufficient in the absence of others. */ if (flags&SPSTART) { longest = NULL; len = 0; for (; scan != NULL; scan = regnext(scan)) if (OP(scan) == EXACTLY && strlen(OPERAND(scan)) >= len) { longest = OPERAND(scan); len = strlen(OPERAND(scan)); } r->regmust = longest; r->regmlen = len; } } return(r); } /* - reg - regular expression, i.e. main body or parenthesized thing * * Caller must absorb opening parenthesis. * * Combining parenthesis handling with the base level of regular expression * is a trifle forced, but the need to tie the tails of the branches to what * follows makes it hard to avoid. */ static char * reg(int paren, int *flagp) /* Parenthesized? */ { register char *ret; register char *br; register char *ender; register int parno; int flags; *flagp = HASWIDTH; /* Tentatively. */ /* Make an OPEN node, if parenthesized. */ if (paren) { if (regnpar >= NSUBEXP) FAIL("too many ()"); parno = regnpar; regnpar++; ret = regnode(OPEN+parno); } else ret = NULL; /* Pick up the branches, linking them together. */ br = regbranch(&flags); if (br == NULL) return(NULL); if (ret != NULL) regtail(ret, br); /* OPEN -> first. */ else ret = br; if (!(flags&HASWIDTH)) *flagp &= ~HASWIDTH; *flagp |= flags&SPSTART; while (*regparse == '|') { regparse++; br = regbranch(&flags); if (br == NULL) return(NULL); regtail(ret, br); /* BRANCH -> BRANCH. */ if (!(flags&HASWIDTH)) *flagp &= ~HASWIDTH; *flagp |= flags&SPSTART; } /* Make a closing node, and hook it on the end. */ ender = regnode((paren) ? CLOSE+parno : END); regtail(ret, ender); /* Hook the tails of the branches to the closing node. */ for (br = ret; br != NULL; br = regnext(br)) regoptail(br, ender); /* Check for proper termination. */ if (paren && *regparse++ != ')') { FAIL("unmatched ()"); } else if (!paren && *regparse != '\0') { if (*regparse == ')') { FAIL("unmatched ()"); } else FAIL("junk on end"); /* "Can't happen". */ /* NOTREACHED */ } return(ret); } /* - regbranch - one alternative of an | operator * * Implements the concatenation operator. */ static char * regbranch(int *flagp) { register char *ret; register char *chain; register char *latest; int flags; *flagp = WORST; /* Tentatively. */ ret = regnode(BRANCH); chain = NULL; while (*regparse != '\0' && *regparse != '|' && *regparse != ')') { latest = regpiece(&flags); if (latest == NULL) return(NULL); *flagp |= flags&HASWIDTH; if (chain == NULL) /* First piece. */ *flagp |= flags&SPSTART; else regtail(chain, latest); chain = latest; } if (chain == NULL) /* Loop ran zero times. */ (void) regnode(NOTHING); return(ret); } /* - regpiece - something followed by possible [*+?] * * Note that the branching code sequences used for ? and the general cases * of * and + are somewhat optimized: they use the same NOTHING node as * both the endmarker for their branch list and the body of the last branch. * It might seem that this node could be dispensed with entirely, but the * endmarker role is not redundant. */ static char * regpiece(int *flagp) { register char *ret; register char op; register char *next; int flags; ret = regatom(&flags); if (ret == NULL) return(NULL); op = *regparse; if (!ISMULT(op)) { *flagp = flags; return(ret); } if (!(flags&HASWIDTH) && op != '?') FAIL("*+ operand could be empty"); *flagp = (op != '+') ? (WORST|SPSTART) : (WORST|HASWIDTH); if (op == '*' && (flags&SIMPLE)) reginsert(STAR, ret); else if (op == '*') { /* Emit x* as (x&|), where & means "self". */ reginsert(BRANCH, ret); /* Either x */ regoptail(ret, regnode(BACK)); /* and loop */ regoptail(ret, ret); /* back */ regtail(ret, regnode(BRANCH)); /* or */ regtail(ret, regnode(NOTHING)); /* null. */ } else if (op == '+' && (flags&SIMPLE)) reginsert(PLUS, ret); else if (op == '+') { /* Emit x+ as x(&|), where & means "self". */ next = regnode(BRANCH); /* Either */ regtail(ret, next); regtail(regnode(BACK), ret); /* loop back */ regtail(next, regnode(BRANCH)); /* or */ regtail(ret, regnode(NOTHING)); /* null. */ } else if (op == '?') { /* Emit x? as (x|) */ reginsert(BRANCH, ret); /* Either x */ regtail(ret, regnode(BRANCH)); /* or */ next = regnode(NOTHING); /* null. */ regtail(ret, next); regoptail(ret, next); } regparse++; if (ISMULT(*regparse)) FAIL("nested *?+"); return(ret); } /* - regatom - the lowest level * * Optimization: gobbles an entire sequence of ordinary characters so that * it can turn them into a single node, which is smaller to store and * faster to run. Backslashed characters are exceptions, each becoming a * separate node; the code is simpler that way and it's not worth fixing. */ static char * regatom(int *flagp) { register char *ret; int flags; *flagp = WORST; /* Tentatively. */ switch (*regparse++) { case '^': ret = regnode(BOL); break; case '$': ret = regnode(EOL); break; case '.': ret = regnode(ANY); *flagp |= HASWIDTH|SIMPLE; break; case '[': { register int clas; register int clasend; if (*regparse == '^') /* Complement of range. */ { ret = regnode(ANYBUT); regparse++; } else ret = regnode(ANYOF); if (*regparse == ']' || *regparse == '-') regc(*regparse++); while (*regparse != '\0' && *regparse != ']') { if (*regparse == '-') { regparse++; if (*regparse == ']' || *regparse == '\0') regc('-'); else { clas = UCHARAT(regparse-2)+1; clasend = UCHARAT(regparse); if (clas > clasend+1) FAIL("invalid [] range"); for (; clas <= clasend; clas++) regc(clas); regparse++; } } else regc(*regparse++); } regc('\0'); if (*regparse != ']') FAIL("unmatched []"); regparse++; *flagp |= HASWIDTH|SIMPLE; } break; case '(': ret = reg(1, &flags); if (ret == NULL) return(NULL); *flagp |= flags&(HASWIDTH|SPSTART); break; case '\0': case '|': case ')': FAIL("internal urp"); /* Supposed to be caught earlier. */ break; case '?': case '+': case '*': FAIL("?+* follows nothing"); break; case '\\': if (*regparse == '\0') FAIL("trailing \\"); ret = regnode(EXACTLY); regc(*regparse++); regc('\0'); *flagp |= HASWIDTH|SIMPLE; break; default: { register int len; register char ender; regparse--; len = strcspn(regparse, META); if (len <= 0) FAIL("internal disaster"); ender = *(regparse+len); if (len > 1 && ISMULT(ender)) len--; /* Back off clear of ?+* operand. */ *flagp |= HASWIDTH; if (len == 1) *flagp |= SIMPLE; ret = regnode(EXACTLY); while (len > 0) { regc(*regparse++); len--; } regc('\0'); } break; } return(ret); } /* - regnode - emit a node */ static char * /* Location. */ regnode(char op) { register char *ret; register char *ptr; ret = regcode; if (ret == ®dummy) { regsize += 3; return(ret); } ptr = ret; *ptr++ = op; *ptr++ = '\0'; /* Null "next" pointer. */ *ptr++ = '\0'; regcode = ptr; return(ret); } /* - regc - emit (if appropriate) a byte of code */ static void regc(char b) { if (regcode != ®dummy) *regcode++ = b; else regsize++; } /* - reginsert - insert an operator in front of already-emitted operand * * Means relocating the operand. */ static void reginsert(char op, char *opnd) { register char *src; register char *dst; register char *place; if (regcode == ®dummy) { regsize += 3; return; } src = regcode; regcode += 3; dst = regcode; while (src > opnd) *--dst = *--src; place = opnd; /* Op node, where operand used to be. */ *place++ = op; *place++ = '\0'; *place++ = '\0'; } /* - regtail - set the next-pointer at the end of a node chain */ static void regtail(char *p, char *val) { register char *scan; register char *temp; register int offset; if (p == ®dummy) return; /* Find last node. */ scan = p; for (;;) { temp = regnext(scan); if (temp == NULL) break; scan = temp; } if (OP(scan) == BACK) offset = scan - val; else offset = val - scan; *(scan+1) = (offset>>8)&0377; *(scan+2) = offset&0377; } /* - regoptail - regtail on operand of first argument; nop if operandless */ static void regoptail(char *p, char *val) { /* "Operandless" and "op != BRANCH" are synonymous in practice. */ if (p == NULL || p == ®dummy || OP(p) != BRANCH) return; regtail(OPERAND(p), val); } /* * regexec and friends */ /* * Global work variables for regexec(). */ static char *reginput; /* String-input pointer. */ static char *regbol; /* Beginning of input, for ^ check. */ static char **regstartp; /* Pointer to startp array. */ static char **regendp; /* Ditto for endp. */ /* * Forwards. */ STATIC int regmatch(char *); STATIC int regrepeat(char *); #ifdef DEBUG int regnarrate = 0; void regdump(regexp *); STATIC char *regprop(char *); #endif /* - regexec - match a regexp against a string */ int regexec(regexp *prog, const char *string) { register char *s; /* Be paranoid... */ if (prog == NULL || string == NULL) { regerror("NULL parameter"); return(0); } /* Check validity of program. */ if (UCHARAT(prog->program) != MAGIC) { regerror("corrupted program"); return(0); } /* If there is a "must appear" string, look for it. */ if (prog->regmust != NULL) { s = (char *)string; while ((s = strchr(s, prog->regmust[0])) != NULL) { if (strncmp(s, prog->regmust, prog->regmlen) == 0) break; /* Found it. */ s++; } if (s == NULL) /* Not present. */ return(0); } /* Mark beginning of line for ^ . */ regbol = (char *)string; /* Simplest case: anchored match need be tried only once. */ if (prog->reganch) return(regtry(prog, (char *)string)); /* Messy cases: unanchored match. */ s = (char *)string; if (prog->regstart != '\0') /* We know what char it must start with. */ while ((s = strchr(s, prog->regstart)) != NULL) { if (regtry(prog, s)) return(1); s++; } else /* We don't -- general case. */ do { if (regtry(prog, s)) return(1); } while (*s++ != '\0'); /* Failure. */ return(0); } /* - regtry - try match at specific point */ static int /* 0 failure, 1 success */ regtry(regexp *prog, char *string) { register int i; register char **sp; register char **ep; reginput = string; regstartp = prog->startp; regendp = prog->endp; sp = prog->startp; ep = prog->endp; for (i = NSUBEXP; i > 0; i--) { *sp++ = NULL; *ep++ = NULL; } if (regmatch(prog->program + 1)) { prog->startp[0] = string; prog->endp[0] = reginput; return(1); } else return(0); } /* - regmatch - main matching routine * * Conceptually the strategy is simple: check to see whether the current * node matches, call self recursively to see whether the rest matches, * and then act accordingly. In practice we make some effort to avoid * recursion, in particular by going through "ordinary" nodes (that don't * need to know whether the rest of the match failed) by a loop instead of * by recursion. */ static int /* 0 failure, 1 success */ regmatch(char *prog) { register char *scan; /* Current node. */ char *next; /* Next node. */ scan = prog; #ifdef DEBUG if (scan != NULL && regnarrate) MSMessageLog::debugMessage("%s(\n", regprop(scan)); #endif while (scan != NULL) { #ifdef DEBUG if (regnarrate) MSMessageLog::debugMessage("%s...\n", regprop(scan)); #endif next = regnext(scan); switch (OP(scan)) { case BOL: if (reginput != regbol) return(0); break; case EOL: if (*reginput != '\0') return(0); break; case ANY: if (*reginput == '\0') return(0); reginput++; break; case EXACTLY: { register int len; register char *opnd; opnd = OPERAND(scan); /* Inline the first character, for speed. */ if (*opnd != *reginput) return(0); len = strlen(opnd); if (len > 1 && strncmp(opnd, reginput, len) != 0) return(0); reginput += len; } break; case ANYOF: if (*reginput == '\0' || strchr(OPERAND(scan), *reginput) == NULL) return(0); reginput++; break; case ANYBUT: if (*reginput == '\0' || strchr(OPERAND(scan), *reginput) != NULL) return(0); reginput++; break; case NOTHING: break; case BACK: break; case OPEN+1: case OPEN+2: case OPEN+3: case OPEN+4: case OPEN+5: case OPEN+6: case OPEN+7: case OPEN+8: case OPEN+9: { register int no; register char *save; no = OP(scan) - OPEN; save = reginput; if (regmatch(next)) { /* * Don't set startp if some later * invocation of the same parentheses * already has. */ if (regstartp[no] == NULL) regstartp[no] = save; return(1); } else return(0); } break; case CLOSE+1: case CLOSE+2: case CLOSE+3: case CLOSE+4: case CLOSE+5: case CLOSE+6: case CLOSE+7: case CLOSE+8: case CLOSE+9: { register int no; register char *save; no = OP(scan) - CLOSE; save = reginput; if (regmatch(next)) { /* * Don't set endp if some later * invocation of the same parentheses * already has. */ if (regendp[no] == NULL) regendp[no] = save; return(1); } else return(0); } break; case BRANCH: { register char *save; if (OP(next) != BRANCH) /* No choice. */ next = OPERAND(scan); /* Avoid recursion. */ else { do { save = reginput; if (regmatch(OPERAND(scan))) return(1); reginput = save; scan = regnext(scan); } while (scan != NULL && OP(scan) == BRANCH); return(0); /* NOTREACHED */ } } break; case STAR: case PLUS: { register char nextch; register int no; register char *save; register int min; /* * Lookahead to avoid useless match attempts * when we know what character comes next. */ nextch = '\0'; if (OP(next) == EXACTLY) nextch = *OPERAND(next); min = (OP(scan) == STAR) ? 0 : 1; save = reginput; no = regrepeat(OPERAND(scan)); while (no >= min) { /* If it could work, try it. */ if (nextch == '\0' || *reginput == nextch) if (regmatch(next)) return(1); /* Couldn't or didn't -- back up. */ no--; reginput = save + no; } return(0); } break; case END: return(1); /* Success! */ default: regerror("memory corruption"); return(0); } scan = next; } /* * We get here only if there's trouble -- normally "case END" is * the terminating point. */ regerror("corrupted pointers"); return(0); } /* - regrepeat - repeatedly match something simple, report how many */ static int regrepeat(char *p) { register int count = 0; register char *scan; register char *opnd; scan = reginput; opnd = OPERAND(p); switch (OP(p)) { case ANY: count = strlen(scan); scan += count; break; case EXACTLY: while (*opnd == *scan) { count++; scan++; } break; case ANYOF: while (*scan != '\0' && strchr(opnd, *scan) != NULL) { count++; scan++; } break; case ANYBUT: while (*scan != '\0' && strchr(opnd, *scan) == NULL) { count++; scan++; } break; default: /* Oh dear. Called inappropriately. */ regerror("internal foulup"); count = 0; /* Best compromise. */ break; } reginput = scan; return(count); } /* - regnext - dig the "next" pointer out of a node */ static char * regnext(char *p) { register int offset; if (p == ®dummy) return(NULL); offset = NEXT(p); if (offset == 0) return(NULL); if (OP(p) == BACK) return(p-offset); else return(p+offset); } #ifdef DEBUG STATIC char *regprop(); /* - regdump - dump a regexp onto stdout in vaguely comprehensible form */ void regdump(regexp *r) { register char *s; register char op = EXACTLY; /* Arbitrary non-END op. */ register char *next; extern char *strchr(); s = r->program + 1; while (op != END) { /* While that wasn't END last time... */ op = OP(s); printf("%2d%s", s-r->program, regprop(s)); /* Where, what. */ next = regnext(s); if (next == NULL) /* Next ptr. */ printf("(0)"); else printf("(%d)", (s-r->program)+(next-s)); s += 3; if (op == ANYOF || op == ANYBUT || op == EXACTLY) { /* Literal string, where present. */ while (*s != '\0') { putchar(*s); s++; } s++; } putchar('\n'); } /* Header fields of interest. */ if (r->regstart != '\0') printf("start `%c' ", r->regstart); if (r->reganch) printf("anchored "); if (r->regmust != NULL) printf("must have \"%s\"", r->regmust); printf("\n"); } /* - regprop - printable representation of opcode */ static char * regprop(char *op) { register char *p; static char buf[50]; (void) strcpy(buf, ":"); switch (OP(op)) { case BOL: p = "BOL"; break; case EOL: p = "EOL"; break; case ANY: p = "ANY"; break; case ANYOF: p = "ANYOF"; break; case ANYBUT: p = "ANYBUT"; break; case BRANCH: p = "BRANCH"; break; case EXACTLY: p = "EXACTLY"; break; case NOTHING: p = "NOTHING"; break; case BACK: p = "BACK"; break; case END: p = "END"; break; case OPEN+1: case OPEN+2: case OPEN+3: case OPEN+4: case OPEN+5: case OPEN+6: case OPEN+7: case OPEN+8: case OPEN+9: sprintf(buf+strlen(buf), "OPEN%d", OP(op)-OPEN); p = NULL; break; case CLOSE+1: case CLOSE+2: case CLOSE+3: case CLOSE+4: case CLOSE+5: case CLOSE+6: case CLOSE+7: case CLOSE+8: case CLOSE+9: sprintf(buf+strlen(buf), "CLOSE%d", OP(op)-CLOSE); p = NULL; break; case STAR: p = "STAR"; break; case PLUS: p = "PLUS"; break; default: regerror("corrupted opcode"); break; } if (p != NULL) (void) strcat(buf, p); return(buf); } #endif /* * The following is provided for those people who do not have strcspn() in * their C libraries. They should get off their butts and do something * about it; at least one public-domain implementation of those (highly * useful) string routines has been published on Usenet. */ #ifdef STRCSPN /* * strcspn - find length of initial segment of s1 consisting entirely * of characters not from s2 */ static int strcspn(char *s1, char *s2) { register char *scan1; register char *scan2; register int count; count = 0; for (scan1 = s1; *scan1 != '\0'; scan1++) { for (scan2 = s2; *scan2 != '\0';) /* ++ moved down. */ if (*scan1 == *scan2++) return(count); count++; } return(count); } #endif aplus-fsf-4.22/src/MSTypes/MSResourceCodeSet.C0000644000265000001440000000423710772770450014572 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #if HAVE_IOSTREAM #include #else #include #endif MSResourceCodeSet::MSResourceCodeSet() {} MSResourceCodeSet::MSResourceCodeSet(const MSResourceCodeSet & rCodeSet_) : _stringVector(rCodeSet_._stringVector) {} MSResourceCodeSet::MSResourceCodeSet(const MSResourceCode & rCode_) : _stringVector(rCode_) {} MSBoolean MSResourceCodeSet::add(const MSResourceCode & rCode_) { if (_stringVector.indexOf(rCode_)==_stringVector.length()) { _stringVector.append(rCode_); return MSTrue; } return MSFalse; } void MSResourceCodeSet::removeAll(void) { _stringVector.removeAll(); } MSResourceCodeSet & MSResourceCodeSet::operator=(const MSResourceCodeSet & rCodeSet_) { if (this!=&rCodeSet_) { _stringVector=rCodeSet_._stringVector; } return *this; } MSResourceCodeSet::~MSResourceCodeSet() {} unsigned int MSResourceCodeSet::numberOfElements() const { return _stringVector.length() ; } MSBoolean MSResourceCodeSet::isEmpty() const { return (numberOfElements()<=0 ? MSTrue : MSFalse); } const MSResourceCode& MSResourceCodeSet::elementAt(unsigned int i) const { return _stringVector.elementAt(i); } ostream& operator<<(ostream& os,const MSResourceCodeSet& rCodeSet_) { os <<"MSResourceCodeSet: " ; int num=rCodeSet_.numberOfElements(); os << num << " elements:<" ; for (int i=0; i' << endl; return os; } MSString MSResourceCodeSet::asDebugInfo(void) const { MSString result("MSResourceCodeSet(@"); result+=MSString((unsigned long) this).d2x().lowerCase(); result+=",<"; int num=numberOfElements(); for (int i=0; i #include MSScalarModel::~MSScalarModel(void) {} aplus-fsf-4.22/src/MSTypes/MSSimpleString.C0000644000265000001440000001366510772770450014161 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #if HAVE_IOSTREAM #include #else #include #endif #include #include static void fastcopy(const char *src_,char *dst_,int count_) { memcpy((char *)dst_,(const char *)src_,count_); } char MSSimpleString::_badData='\0'; // this originally printed "", if the string was null ostream& operator<<(ostream& os_,const MSSimpleString& s_) { return os_<<((s_.string()!=0)?s_.string():"")<0) { char *dp=_string; if (aString.length()>0) fastcopy(aString.string(),dp,aString.length()); if (bString.length()>0) fastcopy(bString.string(),dp+aString.length(),bString.length()); } _string[length()]='\0'; } MSSimpleString::MSSimpleString(const MSSimpleString& aString,const char *pString) { unsigned slen=(pString!=0)?strlen(pString):0; _length=aString.length()+slen; _string=new char[length()+1]; if (length()>0) { char *dp=_string; if (aString.length()>0) fastcopy(aString.string(),dp,aString.length()); if (slen>0) fastcopy(pString,dp+aString.length(),slen); } _string[length()]='\0'; } MSSimpleString::MSSimpleString(const char *pString,const MSSimpleString& aString) { unsigned slen=(pString!=0)?strlen(pString):0; _length=aString.length()+slen; _string=new char[length()+1]; if (length()>0) { char *dp=_string; if (slen>0) fastcopy(pString,dp,slen); if (aString.length()>0) fastcopy(aString.string(),dp+slen,aString.length()); } _string[length()]='\0'; } MSSimpleString::MSSimpleString(const MSSimpleString& aString,char aChar) { _length=1+aString.length(); _string=new char[length()+1]; if (aString.length()>0) fastcopy(aString.string(),_string,aString.length()); _string[length()-1]=aChar; _string[length()]='\0'; } MSSimpleString::MSSimpleString(char aChar,const MSSimpleString& aString) { _length=1+aString.length(); _string=new char[length()+1]; _string[0]=aChar; if (aString.length()>0) fastcopy(aString.string(),_string+1,aString.length()); _string[length()]='\0'; } MSSimpleString::MSSimpleString(const char *pString) { duplicate(pString); } MSSimpleString::~MSSimpleString(void) { if (string()!=0) delete [] _string; } void MSSimpleString::duplicate(const char *pString) { if (pString!=0) { _length=strlen(pString); _string=new char[length()+1]; fastcopy(pString,_string,strlen(pString)); _string[length()]='\0'; } else { _string=0,_length=0; } } MSSimpleString& MSSimpleString::catenate(const char *pString) { if (pString!=0) { unsigned slen=strlen(pString); unsigned len=length()+slen; char *temp=new char[len+1]; if (string()!=0) fastcopy(string(),temp,length()); fastcopy(pString,temp+length(),slen); if (string()!=0) delete [] _string; _string=temp; _length=len; } return *this; } void MSSimpleString::string(const char *pString) { if (pString!=0) { char *s=_string; duplicate(pString); if (s!=0) delete [] s; } else { _length=0; if (string()!=0) { delete [] _string; _string=0; } } } MSBoolean MSSimpleString::operator==(const MSSimpleString& aString) const { if (length()!=aString.length()) return MSFalse; if (string()==0&&aString.string()==0) return MSTrue; if (string()!=0&&aString.string()!=0) { return (strcmp(string(),aString.string())==0)?MSTrue:MSFalse; } return MSFalse; } MSBoolean MSSimpleString::operator!=(const MSSimpleString& aString) const { if (length()!=aString.length()) return MSTrue; if (string()==0&&aString.string()==0) return MSFalse; if (string()!=0&&aString.string()!=0) { return (strcmp(string(),aString.string())==0)?MSFalse:MSTrue; } return MSTrue; } MSSimpleString& MSSimpleString::operator=(const MSSimpleString& aString) { if (this==&aString) return *this; return operator=(aString.string()); } MSSimpleString& MSSimpleString::operator=(const char *pString) { string(pString); return *this; } MSSimpleString& MSSimpleString::operator=(char aChar) { char buf[2]; buf[0]=aChar; buf[1]='\0'; string(buf); return *this; } MSSimpleString& MSSimpleString::operator<<=(char aChar) { char buf[2]; buf[0]=aChar; buf[1]='\0'; catenate(buf); return *this; } MSSimpleString& MSSimpleString::operator<<(const MSSimpleString &aString) { return operator<<= (aString); } MSSimpleString& MSSimpleString::operator<<(const char *pString) { return operator<<= (pString); } MSSimpleString& MSSimpleString::operator<<(char aChar) { return operator<<= (aChar); } MSSimpleString operator+(const MSSimpleString& aString,const MSSimpleString& bString) { return MSSimpleString(aString,bString); } MSSimpleString operator+(const MSSimpleString& aString,const char *pString) { return MSSimpleString(aString,pString); } MSSimpleString operator+(const MSSimpleString& aString,char aChar) { return MSSimpleString(aString,aChar); } MSSimpleString operator+(const char *pString,const MSSimpleString& aString) { return MSSimpleString(pString,aString); } MSSimpleString operator+(char aChar,const MSSimpleString& aString) { return MSSimpleString(aChar,aString); } aplus-fsf-4.22/src/MSTypes/MSStack.C0000644000265000001440000000100610772770450012570 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include void MSStack::push(MSNodeItem *n_) { n_->insert(next()); } MSNodeItem *MSStack::pop(void) { if (next()==this) return 0; else { MSNodeItem *r=next(); r->remove(); return r; } } aplus-fsf-4.22/src/MSTypes/MSStopWatch.C0000644000265000001440000000340310772770450013442 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #if HAVE_IOSTREAM #include #else #include #endif #include #if defined(MS_HAS_TMS_STRUCT) #include //sgi needs this for sysconf, whic is used by CLK_TCK #include #elif !defined(MS_NO_CPU_TIME) #include #if !defined(MS_HAS_GETRUSAGE_DECLARATION) extern "C" int getrusage(int,struct rusage *); #endif #else #include #endif MSTimeStat& MSTimeStat::operator=(const MSTimeStat& a_) { set(a_.user(),a_.sys(),a_.elapsed()); return *this; } MSTimeStat operator-(const MSTimeStat& a_,const MSTimeStat& b_) { return MSTimeStat(a_.user()-b_.user(),a_.sys()-b_.sys(),a_.elapsed()-b_.elapsed()); } ostream& operator<<(ostream& os_,const MSTimeStat& ts_) { os_< #include #include #include #include } #if HAVE_IOSTREAM #include // #include #else #include #endif #include #ifndef MSStringBufferHEADER #include #endif #ifndef MSStringTestHEADER #include #endif #define QUOTE(x) #x #define STRING(x) QUOTE(x) #ifndef MSSymbolHEADER #include #endif #ifdef MS_NO_INLINES #include #endif /*------------------------------------------------------------------------------ |Member Name: MSString::null | | MSString::zero | | MSString::maxLong | | MSString::hexDigits | | | | These are static MSString and char* objects used by the MSSring | | implementation: | | | | null -Null(zero length) MSString | | zero -MSString with value=="0" | | maxLong -MSString with ascii representation of LONG_MAX | | hexDigits-pointer to array of hex digits,in order | ------------------------------------------------------------------------------*/ const char *MSString::null=""; const char *MSString::maxLong=STRING(LONG_MAX); MSModel *MSString::clone(void) const { return new MSString(*this); } MSModel *MSString::create(void) const { return new MSString(); } void MSString::assign(const MSModel& aModel_) { *this=(MSString&)aModel_; } long MSString::compare(const MSModel& aModel_) const { return compare((MSString&)aModel_); } const MSSymbol& MSString::type(void) const { return symbol(); } const MSSymbol& MSString::symbol(void) { static MSSymbol sym ("MSString"); return sym; } //static const char *MSMSF_PROHIBIT=" ,;\'\"-*?!^)}("; // character prohibited in MSF messages //static const char *MSMSF_TRANSLATE="\01\02\03\04\05\06\021\022\023\024\025\026\027"; // probited character translations MSString& MSString::decodeMSF(void) { return *this; } MSString& MSString::encodeMSF(void) { return *this; } MSString MSString::asMSF(void) const { if (isSet()==MSTrue) return MSString(*this); return MSString(); } MSError::ErrorStatus MSString::setFromMSF(const char *pString_) { int code; if (pString_!=0) code=set(pString_); else code=MSError::BadMSFString; return (MSError::ErrorStatus)code; } /*------------------------------------------------------------------------------ | MSString::MSString | | | | Initialize the string with as accurrate a representation of the input | | argument as possible. | | | | All constructors(except as noted below) *must* initialize the pBuffer data | | member to point to an appropriate null MSStringBuffer object. This will | | cause the resulting MSString to be DBCS-enabled if need be. This is | | accomplished via the static member function MSString::defaultBuffer. It | | will return a pointer to a null Buffer of the appropriate type. | | | | The MSString is actually "constructed"(that is,storage buffer allocated and | | initialized) via application of the initBuffer function to the just | | initialized MSStringBuffer. | | | | The copy constructor simply sets the pBuffer data member to point to the | | buffer of the argument MSString and bumps that buffer's use count. | | | | The special protected constructor that accepts an MSStringBuffer pointer | | is another special case. This constructor is used to pass control of an | | MSStringBuffer to another MSString. It is typically used within non-const | | MSString member functions to delay disposal of an MSString's MSStringBuffer | | (in cases where that MSStringBuffer may be needed during construction of the | | new MSString contents). | | | | Notes: | | 1. The use count for the null buffer returned by | | MSString::defaultBuffer is *not* incremented. This is because | | that buffer(in almost all instances) will be "discarded"(via | | the call to MSString::initBuffer). The exception is the default | | constructor,which will retain its reference to the null buffer | | and therefore must increment the buffer's use count. | ------------------------------------------------------------------------------*/ // See MSString.H /*------------------------------------------------------------------------------ | operator<< | | | | Display the MSString contents on the output stream. | ------------------------------------------------------------------------------*/ ostream& operator<<(ostream& aStream,const MSString& aString) { return aStream<> | | | | Read characters one at a time until a whitespace is reached. | | This method will skip leading white space and then proceed to read | | characters from the stream until a white space character is | | encountered. It will leave the terminating white space character on the | | stream. This behavior duplicates the behavior of reading char * from a | | stream. | ------------------------------------------------------------------------------*/ istream &operator>>(istream &aStream_,MSString &aString_) { MSString result(0,128); unsigned bytes=0; char aChar; #if (__GNUC__ < 3) #if defined(MS_IOSTREAM_IPFX_NEEDS_ARGUMENT) aStream_.ipfx(0); #else aStream_.ipfx(); // skip initial white space #endif #else while (!aStream_.fail()){ aChar=aStream_.peek(); if (!isspace(aChar)) break; } #endif while (!aStream_.fail()) { aChar=aStream_.peek(); if (isspace(aChar)) break; else { if (bytes==result.length()) result+=MSString(0,bytes); result.data()[bytes++]=aChar; // we know the refCount of result is 1, so this safe aStream_.get(); } } // Remove trailing stuff... aString_=result.remove(bytes); return aStream_; } /*------------------------------------------------------------------------------ | MSString::lineFrom | | | | Read characters up to a delimiter. | ------------------------------------------------------------------------------*/ MSString MSString::lineFrom(istream &aStream_,char delim_) { MSString result(0,128); unsigned bytes=0; char aChar=delim_; for (aStream_.get(aChar);aChar!=delim_&&!aStream_.fail();aStream_.get(aChar)) { if (bytes==result.length()) result+=MSString(0,bytes); result.data()[bytes++]=aChar; // we know the refCount of result is 1, so this safe } // Remove trailing stuff... result.remove(bytes); return MSString(result); } /*------------------------------------------------------------------------------ | MSString::initBuffer | | | | The "base" version of this function simply invokes the corresponding | | MSStringBuffer::newBuffer function against the pBuffer member. | | | | The long/unsigned long/double functions convert their arguments to strings | | and invoke the "base" version. | ------------------------------------------------------------------------------*/ MSString& MSString::initBuffer(const void *p1,unsigned l1, const void *p2,unsigned l2,const void *p3,unsigned l3, char padChar) { return setBuffer(_pBuffer->newBuffer(p1,l1,p2,l2,p3,l3,padChar)); } /*------------------------------------------------------------------------------ | MSString::initBuffer | ------------------------------------------------------------------------------*/ MSString& MSString::initBuffer(long n) { char buffer[32]; sprintf(buffer,"%ld",n); return initBuffer(buffer,lengthOf(buffer),0,0,0,0,0); } /*------------------------------------------------------------------------------ | MSString::initBuffer | ------------------------------------------------------------------------------*/ MSString& MSString::initBuffer(unsigned long n) { char buffer[32]; sprintf(buffer,"%lu",n); return initBuffer(buffer,lengthOf(buffer),0,0,0,0,0); } /*------------------------------------------------------------------------------ | MSString::initBuffer | ------------------------------------------------------------------------------*/ MSString& MSString::initBuffer(double d) { char buffer[32]; sprintf(buffer,"%.*g",DBL_DIG,d); return initBuffer(buffer,lengthOf(buffer),0,0,0,0,0); } /*------------------------------------------------------------------------------ | MSString::initBuffer | ------------------------------------------------------------------------------*/ MSString& MSString::initBuffer(void *p_) { char buffer[32]; sprintf(buffer,"%#x",p_); return initBuffer(buffer,lengthOf(buffer),0,0,0,0,0); } /*------------------------------------------------------------------------------ | MSString::defaultBuffer | | | | If DBCS environment is active,return &MSDBCSBuffer::nullBuffer. | | Otherwise,return &MSStringBuffer::nullBuffer. | ------------------------------------------------------------------------------*/ // See MSString.H /*------------------------------------------------------------------------------ | MSString::data | | | | Simply return a pointer to the start of the associated MSStringBuffer's buffer. | ------------------------------------------------------------------------------*/ // See MSString.H /*------------------------------------------------------------------------------ | MSString::lengthOf | | | | If the argument char* pointer is zero,return 0; Otherwise,return the | | length as calculated by strlen. | ------------------------------------------------------------------------------*/ // See MSString.H /*------------------------------------------------------------------------------ | MSString::prepareToChange | | | | If the reference count for the referenced MSStringBuffer is greater than one | |(i.e.,if another MSString is pointing to it),then make a copy. | ------------------------------------------------------------------------------*/ MSString& MSString::prepareToChange() { if (_pBuffer->useCount()>1) { MSStringBuffer *oldBuffer=_pBuffer; initBuffer(data(),length(),0,0,0,0,0); oldBuffer->removeRef(); } return *this; } /*------------------------------------------------------------------------------ | MSString::rightJustify | | | | If the new length differs from the current length,delegate the call to the | | MSStringBuffer contents. The receiver's contents will be replaced with the | | new buffer returned. | | | ------------------------------------------------------------------------------*/ MSString& MSString::rightJustify(unsigned newLength,char padCharacter) { if (length()!=newLength) { MSStringBuffer *oldBuffer=_pBuffer; setBuffer(_pBuffer->rightJustify(newLength,padCharacter)); oldBuffer->removeRef(); } return *this; } /*------------------------------------------------------------------------------ | MSString::remove | | | | If the number of characters to be removed is non-zero,then delegate this | | function via the MSStringBuffer contents. The receiver's contents are | | replaced with the MSStringBuffer returned from that call. | | | ------------------------------------------------------------------------------*/ MSString& MSString::remove(unsigned startPos) { return remove(startPos,UINT_MAX); } /*------------------------------------------------------------------------------ | MSString::remove | ------------------------------------------------------------------------------*/ MSString& MSString::remove(unsigned startPos,unsigned numChars) { if (numChars>0&&startPos0) { MSStringBuffer *oldBuffer=_pBuffer; setBuffer(_pBuffer->remove(startPos,numChars)); oldBuffer->removeRef(); } return *this; } /*------------------------------------------------------------------------------ | MSString::remove | ------------------------------------------------------------------------------*/ MSString MSString::remove(const MSString &aString,unsigned startPos,unsigned numChars) { return MSString(aString).remove(startPos,numChars); } /*------------------------------------------------------------------------------ | MSString::setBuffer | ------------------------------------------------------------------------------*/ // See MSString.H /*------------------------------------------------------------------------------ | MSString::asDebugInfo | ------------------------------------------------------------------------------*/ MSString MSString::asDebugInfo() const { MSString result("MSString(@"); result+=MSString((unsigned long)this).d2x().lowerCase(); result+=",pBuffer->"; result+=_pBuffer->asDebugInfo(); result+=")"; return result; } /*------------------------------------------------------------------------------ | MSString::className | ------------------------------------------------------------------------------*/ MSString MSString::className() const { return MSString("MSString"); } MSString& MSString::operator=(const char *pString) { MSStringBuffer *b=_pBuffer; setBuffer(b->newBuffer(pString,lengthOf(pString),0,0,0,0,0)); b->removeRef(); return *this; } /******************************************************************************* * DESCRIPTION: * * This section contains the implementation of the constructors for the * * class MSString. * *******************************************************************************/ MSString::MSString(const void *pBuffer,unsigned len,char padCharacter):_pBuffer(MSString::defaultBuffer()) { initBuffer(pBuffer,len,0,0,0,0,padCharacter); } MSString::MSString(const void *pBuffer1,unsigned len1, const void *pBuffer2,unsigned len2, char padCharacter):_pBuffer(MSString::defaultBuffer()) { initBuffer(pBuffer1,len1,pBuffer2,len2,0,0,padCharacter); } MSString::MSString(const void *pBuffer1,unsigned len1, const void *pBuffer2,unsigned len2, const void *pBuffer3,unsigned len3, char padCharacter):_pBuffer(MSString::defaultBuffer()) { initBuffer(pBuffer1,len1,pBuffer2,len2,pBuffer3,len3,padCharacter); } MSString::MSString(int n):_pBuffer(MSString::defaultBuffer()) { initBuffer((long) n); } MSString::MSString(long n):_pBuffer(MSString::defaultBuffer()) { initBuffer(n); } MSString::MSString(short n):_pBuffer(MSString::defaultBuffer()) { initBuffer((long)n); } MSString::MSString(unsigned n):_pBuffer(MSString::defaultBuffer()) { initBuffer((unsigned long) n); } MSString::MSString(unsigned long n):_pBuffer(MSString::defaultBuffer()) { initBuffer(n); } MSString::MSString(unsigned short n):_pBuffer(MSString::defaultBuffer()) { initBuffer((unsigned long)n); } MSString::MSString(double aDouble):_pBuffer(MSString::defaultBuffer()) { initBuffer(aDouble); } MSString::MSString(char aChar):_pBuffer(MSString::defaultBuffer()) { initBuffer((const void *)&aChar,1,0,0,0,0,0); } MSString::MSString(unsigned char aChar):_pBuffer(MSString::defaultBuffer()) { initBuffer((const void *)&aChar,1,0,0,0,0,0); } MSString::MSString(signed char aChar):_pBuffer(MSString::defaultBuffer()) { initBuffer((const void *)&aChar,1,0,0,0,0,0); } MSString::MSString(const char *p):_pBuffer(MSString::defaultBuffer()) { initBuffer((const void*)p,lengthOf(p),0,0,0,0,0); } MSString::MSString(const unsigned char *p):_pBuffer(MSString::defaultBuffer()) { initBuffer((const void*)p,lengthOf((const char *)p),0,0,0,0,0); } MSString::MSString(const signed char *p):_pBuffer(MSString::defaultBuffer()) { initBuffer((const void*)p,lengthOf((const char *)p),0,0,0,0,0); } MSString::MSString(const MSString &aString) { setBuffer(aString._pBuffer->addRef()); } MSString::MSString():_pBuffer(MSString::defaultBuffer()) { _pBuffer->addRef(); } MSString::MSString(MSStringBuffer *oldBuffer) { setBuffer(oldBuffer); } /*------------------------------------------------------------------------------ | MSString::~MSString | ------------------------------------------------------------------------------*/ MSString::~MSString() { _pBuffer->removeRef(),_pBuffer=0; } /******************************************************************************* * DESCRIPTION: * * This section contains the implementation of the testing functions of * * the class MSString. * *******************************************************************************/ /*------------------------------------------------------------------------------ | MSString::isAlnum | | MSString::isAlpha | | MSString::isAscii | | MSString::isCntrl | | MSString::isDigits | | MSString::isHexDigits | | MSString::isLowerCase | | MSString::isPrintable | | MSString::isPunctuation | | MSString::isUpperCase | | MSString::isWhiteSpace | | | | Each of these functions is delegated to the associated MSStringBuffer | | holding the contents of the receiving MSString. | | | | Notes: | | 1. The default(SBCS) implementation is to utilize the | | corresponding standard C library function to test the string | | contents. | ------------------------------------------------------------------------------*/ // See MSString.H /*------------------------------------------------------------------------------ | MSString::isBinaryDigits | | | | Examine each character of the receiver in turn,returning MSFalse if a non '0'| | or '1' is found. Otherwise,return MSTrue. | | | | The test for '0'/'1' is made by exclusive-or-ing with '1'; this yields all | | the bits that differ from '1'. If any but the least significant vary,then | | the test fails. | | | | Notes: | | 1. If the string is null(of length 0) then 1(MSTrue) is returned. | ------------------------------------------------------------------------------*/ MSBoolean MSString::isBinaryDigits() const { const char *p=data(); unsigned pos=length(); while (pos--) if ((*p++ ^ '1')>1) return MSFalse; return MSTrue; } /*------------------------------------------------------------------------------ | MSString::isLike | | | | This function is implemented by invoking the protected version that accepts | | a char* pointer and length. | ------------------------------------------------------------------------------*/ MSBoolean MSString::isLike(const char *pPattern,unsigned patternLen,char zeroOrMore,char anyChar) const { // Answer MSTrue if the receiver and pattern are equal. if (_pBuffer->compare(pPattern,patternLen)==MSStringBuffer::equal) return MSTrue; // Index into strings: unsigned iText=0,iPattern=0,lastStar=0,len=length(); // Continue till we get to the end of the pattern... while (iPattern=patternLen) return MSTrue; else lastStar=iPattern; else // Not a *. If we are at the end of the text,then the // result is MSFalse(since there is no character to match // the next pattern character). if (iText>=len) return MSFalse; else { // Compare text/pattern characters... char t=data()[iText++]; if (p==anyChar||p==t) // Characters match. If we had a*somewhere,are at // the end of the pattern,and not at the end of the // text,then we need to restart the scan from the last //*while using it to swallow one more character of // the text. // // This situation arises in cases like the following: // pattern=*abc // text =123abcabc // // If these conditions aren't met,then we simply go // back to the top of the while loop and process the // next pattern character. if (lastStar>0&&iPattern>=patternLen&&iText=len); } /*------------------------------------------------------------------------------ | MSString::isAbbrevFor | | | | This function is implemented via the protected member of the same name. | | That function accepts as arguments a full specification of the "full" | | string(pointer *and* length) and the minimum abbreviation length. It | | determines whether the receiver is an acceptable abbreviation by comparing | | the appreviation to beginning of the full string and if equal,comparing the | | length of the abbreviation to the minimum. | ------------------------------------------------------------------------------*/ MSBoolean MSString::isAbbrevFor(const char *pFullString,unsigned fullStringLen,unsigned minLen) const { if (minLen==0) minLen=length(); if (length()<=fullStringLen&&length()>=minLen&&memcmp(data(),pFullString,length())==0) return MSTrue; else return MSFalse; } /*------------------------------------------------------------------------------ | MSString::includes | | | | Simply invoke the equivalent indexOf function. | | | | Notes: | | 1. These funcions are essentially just shorthand for the corresponding | | indexOf functions. It provides a more meaningful function name | | in cases where invoked to obtain a MSBoolean result(rather than the | | specific index within the string). | ------------------------------------------------------------------------------*/ // See MSString.H /******************************************************************************* * DESCRIPTION: * * This section contains the implementation of the comparison operators for * * the class MSString. * *******************************************************************************/ /*------------------------------------------------------------------------------ | operator== | | operator!= | | operator< | | operator<= | | operator> | | operator>= | | | | Compares two MSStrings(or a MSString and a char* string) for the specified | | condition by calling MSStringBuffer::compare(). | ------------------------------------------------------------------------------*/ // See MSString.H /******************************************************************************* * DESCRIPTION: * * This section contains the implementation of the "conversion" functions for * * the class MSString. * *******************************************************************************/ /*------------------------------------------------------------------------------ | MSString::operator char* | | MSString::unsigned char* | | MSString::signed char* | | MSString::asInt | | MSString::asUnsigned | | MSString::asBoolean | | MSString::asDouble | | | | | | Convert the string contents to the appropriate type,using the appropriate | | strto library function. Conversion to char* simply obtains the address | | of the associated buffer data. | ------------------------------------------------------------------------------*/ // See MSString.H // this is ugly, but the goal is speed, i.e. the most likely hits are first MSBoolean MSString::asBoolean() const { MSString buf(lowerCase(*this)); if (buf=="0") return MSFalse; if (buf=="1") return MSTrue; if (buf=="false") return MSFalse; if (buf=="true") return MSTrue; if (buf=="no") return MSFalse; if (buf=="yes") return MSTrue; if (buf=="mstrue") return MSTrue; if (buf=="msfalse") return MSFalse; return MSFalse; } /******************************************************************************* * DESCRIPTION: * * This section contains the implementation of the MSString manipulation * * operators. * *******************************************************************************/ /*------------------------------------------------------------------------------ | MSString::operator= | | | | Assign the argument string to this MSString by copying its contents. Note | | that since MSStrings can be constructed from any basic type,any basic type | | can be assigned to an MSString object. | | | | Notes: | | 1. An MSString is constructed from this object's MSStringBuffer. This will| | ensure the previously referenced MSStringBuffer's reference count gets | | decremented at the appropriate time. This technique is used | | throughout the MSString implementation; it will rarely be noted | | elsewhere. | | | | 2. We add the reference to the source MSStringBuffer prior to removing | | the reference to the receiver's MSStringBuffer(which happens at exit | | during deletion of "old"); this ensures the proper result when | | assigning an MSString to | ------------------------------------------------------------------------------*/ // See MSString.H /*------------------------------------------------------------------------------ | MSString::operator ~ | | | | Create the one's complement of the receiver by negating each byte. | ------------------------------------------------------------------------------*/ MSString MSString::operator ~() const { unsigned len=length(); const unsigned char *pSource=(unsigned char *) data(); MSString result(0,len); unsigned char *pDest=(unsigned char *) result.data(); while (len--) *pDest++=~*pSource++; return result; } /*------------------------------------------------------------------------------ | MSString::operator+ | | | | Concatenate the argument string to the receiver. Each of these is | | implemented using the constructor accepting two buffers | |(as pointer/length pairs). | | | | Notes: | | 1. These functions(along with the other const operators) return | | the result of the operation in a new MSString. | ------------------------------------------------------------------------------*/ MSString MSString::operator+(const MSString &aString) const { return MSString(data(),length(),aString.data(),aString.length()); } MSString MSString::operator+(const char *pString) const { return MSString(data(),length(),pString,lengthOf(pString)); } MSString MSString::operator+(char aChar) const { return MSString(data(),length(),&aChar,1); } MSString operator+(const char *pString,const MSString &aString) { return MSString(pString,MSString::lengthOf(pString),(const char*)aString,aString.length()); } MSString operator+(char aChar,const MSString &aString) { return MSString(&aChar,1,(const char*)aString,aString.length()); } /*------------------------------------------------------------------------------ | MSString::operator+= | | MSString::operator<<= | | | | Concatenate the argument string to the receiver's contents. These are all | | implemented using the MSStringBuffer->initBuffer function. If the argument | | string is null,simply return the receiver unmodified. | ------------------------------------------------------------------------------*/ MSString& MSString::operator+=(const MSString &aString) { if (aString.length()>0) { MSStringBuffer *oldBuffer=_pBuffer; initBuffer(data(),length(),aString.data(),aString.length(),0,0,0); oldBuffer->removeRef(); } return *this; } MSString& MSString::operator+=(const char *pString) { unsigned argLen=lengthOf(pString); if (argLen>0) { MSStringBuffer *oldBuffer=_pBuffer; initBuffer(data(),length(),pString,argLen,0,0,0); oldBuffer->removeRef(); } return *this; } MSString& MSString::operator+=(char aChar) { MSStringBuffer *oldBuffer=_pBuffer; initBuffer(data(),length(),&aChar,1,0,0,0); oldBuffer->removeRef(); return *this; } MSString& MSString::operator<<=(const MSString& aString) { return (*this)+=aString; } MSString& MSString::operator<<=(const char *pString) { return (*this)+=pString; } MSString& MSString::operator<<=(char aChar) { return (*this)+=aChar; } MSString& MSString::operator<<(const MSString& aString) { return (*this)+=aString; } MSString& MSString::operator<<(const char *pString) { return (*this)+=pString; } MSString& MSString::operator<<(char aChar) { return (*this)+=aChar; } /*------------------------------------------------------------------------------ | MSString::operator& | | MSString::operator| | | MSString::operator ^ | | | | These functions return a MSString corresponding to the receiver's contents | | operated on via one of the bit-wise operators &(and),|(or),or | | ^(exclusive or) and the provided argument. If the argument string is | | shorter than the receiver,then that string is replicated in order to | | perform the operation. | | | | These are all implemented by constructing a result string from the receiver | | and invoking the protected member function applyBitOp(). The arguments to | | that function are the argument string and the bitOpFunction(either and,or, | | or exclusiveOr). | ------------------------------------------------------------------------------*/ MSString MSString::operator &(const MSString &aString) const { return MSString(*this).applyBitOp(aString.data(),aString.length(),And); } /*------------------------------------------------------------------------------ | MSString::operator& | ------------------------------------------------------------------------------*/ MSString MSString::operator &(const char *pString) const { return MSString(*this).applyBitOp(pString,lengthOf(pString),And); } /*------------------------------------------------------------------------------ | operator& | ------------------------------------------------------------------------------*/ MSString operator &(const char *pString,const MSString &aString) { return MSString(pString).applyBitOp(aString.data(),aString.length(),MSString::And); } /*------------------------------------------------------------------------------ | MSString::operator| | ------------------------------------------------------------------------------*/ MSString MSString::operator |(const MSString &aString) const { return MSString(*this).applyBitOp(aString.data(),aString.length(),Or); } /*------------------------------------------------------------------------------ | MSString::operator| | ------------------------------------------------------------------------------*/ MSString MSString::operator |(const char *pString) const { return MSString(*this).applyBitOp(pString,lengthOf(pString),Or); } /*------------------------------------------------------------------------------ | operator| | ------------------------------------------------------------------------------*/ MSString operator |(const char *pString,const MSString &aString) { return MSString(pString).applyBitOp(aString.data(),aString.length(),MSString::Or); } /*------------------------------------------------------------------------------ | MSString::operator ^ | ------------------------------------------------------------------------------*/ MSString MSString::operator ^(const MSString &aString) const { return MSString(*this).applyBitOp(aString.data(),aString.length(),ExclusiveOr); } /*------------------------------------------------------------------------------ | MSString::operator ^ | ------------------------------------------------------------------------------*/ MSString MSString::operator ^(const char *pString) const { return MSString(*this).applyBitOp(pString,lengthOf(pString),ExclusiveOr); } /*------------------------------------------------------------------------------ | operator ^ | ------------------------------------------------------------------------------*/ MSString operator ^(const char *pString,const MSString &aString) { return MSString(pString).applyBitOp(aString.data(),aString.length(),MSString::ExclusiveOr); } /*------------------------------------------------------------------------------ | MSString::operator &= | | MSString::operator |= | | MSString::operator ^= | | | | The receiver's contents are operated on via a bit-wise operator and the | | argument string(which can be either a MSString object or a char*). These | | are all implemented by invoking the protected member function applyBitOp() | | with the appropriate BitOp(either "And","or",Or "ExclusiveOr." | ------------------------------------------------------------------------------*/ MSString& MSString::operator &=(const MSString &aString) { return applyBitOp(aString.data(),aString.length(),And); } /*------------------------------------------------------------------------------ | MSString::operator &= | ------------------------------------------------------------------------------*/ MSString& MSString::operator &=(const char *pString) { return applyBitOp(pString,lengthOf(pString),And); } /*------------------------------------------------------------------------------ | MSString::operator |= | ------------------------------------------------------------------------------*/ MSString& MSString::operator |=(const MSString &aString) { return applyBitOp(aString.data(),aString.length(),Or); } /*------------------------------------------------------------------------------ | MSString::operator |= | ------------------------------------------------------------------------------*/ MSString& MSString::operator |=(const char *pString) { return applyBitOp(pString,lengthOf(pString),Or); } /*------------------------------------------------------------------------------ | MSString::operator ^= | ------------------------------------------------------------------------------*/ MSString& MSString::operator ^=(const MSString &aString) { return applyBitOp(aString.data(),aString.length(),ExclusiveOr); } /*------------------------------------------------------------------------------ | MSString::operator ^= | ------------------------------------------------------------------------------*/ MSString& MSString::operator ^=(const char *pString) { return applyBitOp(pString,lengthOf(pString),ExclusiveOr); } /*------------------------------------------------------------------------------ | MSString::applyBitOp | | | | If the argument is null,then the receiver is returned unmodified. | | Otherwise,the receiver is operated on according to the length of | | the argument: | | | | if 1,then each character of the receiver is operated on with | | the single byte of the argument | | | | else,the receiver is broken up into chunks the size of the | | argument and then each byte of the chunk is operated on with | | the corresponding byte of the argument. | | | | To as great an extent as possible,the switch on operator type is | | performed outside of the loops that perform the operations. | ------------------------------------------------------------------------------*/ MSString& MSString::applyBitOp(const char *pArg,unsigned argLen,BitOperator op) { if (argLen!=0) { prepareToChange(); char *pt=data(); unsigned n=length(); if (argLen==1) { switch(op) { case And: while (n--) *pt++ &= *pArg; break; case Or: while (n--) *pt++ |= *pArg; break; case ExclusiveOr: while (n--) *pt++ ^= *pArg; } } else { while (n) { const char *pa=pArg; unsigned m =(argLensubString(startPos,len,padCharacter)); } MSString MSString::operator()(unsigned startPos,unsigned len,char padCharacter) const { return MSString(_pBuffer->subString(startPos,len,padCharacter)); } MSString MSString::operator()(unsigned startPos,unsigned len) const { return MSString(_pBuffer->subString(startPos,len,' ')); } /*------------------------------------------------------------------------------ | MSString::operator[] | | | | The const and non-const version of these functions differ in the way | | indexing off the end of the string is handled. For the const case,an | | Invalid request exception is thrown. In the non-const case,the string is | | extended with blanks(and a reference to the last blank added is returned). | | | | Otherwise,return the specified element of the receiver's buffer. | | | | Notes: | | 1. The indexing is 0-based. | | 2. This function presents some problems for the integrity of MSString | | contents(as does operator char*). While some precautions are | | taken(ensuring the receiver has the only reference to its | | buffer) subsequent assignment of the MSString and manipulation via | | the char& returned by this function may cause unexpected result. | ------------------------------------------------------------------------------*/ char MSString::operator()(unsigned index) const { static char overFlow=0; return (index=_pBuffer->length()) { // It does, MSStringBuffer *oldBuffer=_pBuffer; initBuffer(oldBuffer->contents(),oldBuffer->length(),0,index-oldBuffer->length()+1,0,0,' '); oldBuffer->removeRef(); } else { // It doesn't,but make sure we've got our own copy. prepareToChange(); } return MSString::CharPick(this,index); } /******************************************************************************* * DESCRIPTION: * * This section contains the implementation of the searching functions of * * the class MSString. * *******************************************************************************/ /*------------------------------------------------------------------------------ | MSString::indexOf | | MSString::indexOfAnyBut | | MSString::indexOfAnyOf | | | | Each of these functions is implemented by delegating to the string's | | MSStringBuffer contents. | ------------------------------------------------------------------------------*/ // See MSString.H unsigned MSString::indexOf(char aChar,unsigned startPos) const { return _pBuffer->indexOf(&aChar,1,startPos); } /*------------------------------------------------------------------------------ | MSString::lastIndexOf | | MSString::lastIndexOfAnyBut | | MSString::lastIndexOfAnyOf | | | | Each of these functions is implemented by delegating to the string's | | MSStringBuffer contents. | ------------------------------------------------------------------------------*/ // See MSString.H unsigned MSString::lastIndexOf(char aChar,unsigned startPos) const { return _pBuffer->lastIndexOf(&aChar,1,startPos); } /*------------------------------------------------------------------------------ | MSString::occurrencesOf | | | | The public versions of this function that accept char* and char | | arguments are implementd via a common protected version that accepts | | char* and length. It in turn implements the function by repetitive | | calls to MSStringBuffer::indexOf,keeping count of the number of instances | | of the search string that are located. | | | | The public function accepting an MSStringTest argument implements the | | function by repetitive calls to the corresponding MSStringBuffer::indexOf | | function,counting the number of characters for which the "test" is | | successful. | ------------------------------------------------------------------------------*/ unsigned MSString::occurrencesOf(const char *pSearchString,unsigned searchLen,unsigned startPos) const { unsigned count=0; while ((startPos=_pBuffer->indexOf(pSearchString,searchLen,startPos))<_pBuffer->length()) { count++; startPos+=searchLen; } return count; } /*------------------------------------------------------------------------------ | MSString::occurrencesOf | ------------------------------------------------------------------------------*/ unsigned MSString::occurrencesOf(const MSStringTest &aTest,unsigned startPos) const { unsigned count=0; while ((startPos=_pBuffer->indexOf(aTest,startPos))<_pBuffer->length()) count++,startPos++; return count; } /*------------------------------------------------------------------------------ | MSString::occurrencesOf | ------------------------------------------------------------------------------*/ unsigned MSString::occurrencesOf(char searchChar,unsigned startPos) const { return occurrencesOf(&searchChar,1,startPos); } /******************************************************************************* * DESCRIPTION: * * This section contains the implementation of the formatting functions of * * the class MSString. * *******************************************************************************/ /*------------------------------------------------------------------------------ | MSString::format | ------------------------------------------------------------------------------*/ const char *MSString::format(MSString *pString_) const { *pString_=*this; return pString_->data();;} const char *MSString::format(MSString& aString_) const { aString_=*this; return aString_.data(); } const char *MSString::format(MSString *pString_,const MSFormat&) const { *pString_=*this; return pString_->data();;} const char *MSString::format(MSString& aString_,const MSFormat&) const { aString_=*this; return aString_.data(); } /******************************************************************************* * DESCRIPTION: * * This section contains the implementation of the editing functions of * * the class MSString. * *******************************************************************************/ /*------------------------------------------------------------------------------ | MSString::set | ------------------------------------------------------------------------------*/ MSError::ErrorStatus MSString::set(unsigned index,char aChar) { if (indexcenter(newLength,padCharacter)); oldBuffer->removeRef(); return *this; } /*------------------------------------------------------------------------------ | MSString::center | ------------------------------------------------------------------------------*/ MSString MSString::center(const MSString &aString,unsigned newLength,char padCharacter) { return MSString(aString).center(newLength,padCharacter); } /*------------------------------------------------------------------------------ | MSString::change | ------------------------------------------------------------------------------*/ MSString& MSString::change(const char *pPattern,unsigned patternLen, const char *pReplacement,unsigned replacementLen, unsigned startPos,unsigned numChanges) { MSStringBuffer *oldBuffer=_pBuffer; setBuffer(_pBuffer->change(pPattern,patternLen,pReplacement,replacementLen,startPos,numChanges)); oldBuffer->removeRef(); return *this; } /*------------------------------------------------------------------------------ | MSString::change | ------------------------------------------------------------------------------*/ MSString MSString::change(const MSString &aString,const MSString &aPattern, const MSString &aReplacement, unsigned startPos,unsigned numChanges) { return MSString(aString).change(aPattern,aReplacement,startPos,numChanges); } /*------------------------------------------------------------------------------ | MSString::copy | ------------------------------------------------------------------------------*/ MSString& MSString::copy(unsigned numCopies) { MSStringBuffer *oldBuffer=_pBuffer; setBuffer(_pBuffer->copy(numCopies)); oldBuffer->removeRef(); return *this; } /*------------------------------------------------------------------------------ | MSString::insert | ------------------------------------------------------------------------------*/ MSString& MSString::insert(const char *pString,unsigned len,unsigned index,char padCharacter) { MSStringBuffer *oldBuffer=_pBuffer; setBuffer(_pBuffer->insert(pString,len,index,padCharacter)); oldBuffer->removeRef(); return *this; } /*------------------------------------------------------------------------------ | MSString::leftJustify | ------------------------------------------------------------------------------*/ MSString& MSString::leftJustify(unsigned newLength,char padCharacter) { MSStringBuffer *oldBuffer=_pBuffer; setBuffer(_pBuffer->leftJustify(newLength,padCharacter)); oldBuffer->removeRef(); return *this; } /*------------------------------------------------------------------------------ | MSString::lowerCase | ------------------------------------------------------------------------------*/ MSString& MSString::lowerCase() { MSStringBuffer *oldBuffer=_pBuffer; setBuffer(_pBuffer->lowerCase()); oldBuffer->removeRef(); return *this; } /*------------------------------------------------------------------------------ | MSString::overlayWith | ------------------------------------------------------------------------------*/ MSString& MSString::overlayWith(const char *pOverlay,unsigned len,unsigned index,char padCharacter) { MSStringBuffer *oldBuffer=_pBuffer; setBuffer(_pBuffer->overlayWith(pOverlay,len,index,padCharacter)); oldBuffer->removeRef(); return *this; } /*------------------------------------------------------------------------------ | MSString::reverse | ------------------------------------------------------------------------------*/ MSString& MSString::reverse() { MSStringBuffer *oldBuffer=_pBuffer; setBuffer(_pBuffer->reverse()); oldBuffer->removeRef(); return *this; } /*------------------------------------------------------------------------------ | MSString::strip | ------------------------------------------------------------------------------*/ MSString& MSString::strip() { return strip(MSStringTest(APLUS_ISPACE),MSStringEnum::Both); } /*------------------------------------------------------------------------------ | MSString::strip | ------------------------------------------------------------------------------*/ MSString& MSString::strip(const char *pString,unsigned len,MSStringEnum::StripMode mode) { MSStringBuffer *oldBuffer=_pBuffer; setBuffer(_pBuffer->strip(pString,len,mode)); oldBuffer->removeRef(); return *this; } /*------------------------------------------------------------------------------ | MSString::strip | ------------------------------------------------------------------------------*/ MSString& MSString::strip(const MSStringTest &aTest,MSStringEnum::StripMode mode) { MSStringBuffer *oldBuffer=_pBuffer; setBuffer(_pBuffer->strip(aTest,mode)); oldBuffer->removeRef(); return *this; } /*------------------------------------------------------------------------------ | MSString::translate | ------------------------------------------------------------------------------*/ MSString& MSString::translate(const char *pInputChars, unsigned inputLen, const char *pOutputChars,unsigned outputLen, char padCharacter) { MSStringBuffer *oldBuffer=_pBuffer; setBuffer(_pBuffer->translate(pInputChars,inputLen,pOutputChars,outputLen,padCharacter)); oldBuffer->removeRef(); return *this; } /*------------------------------------------------------------------------------ | MSString::upperCase | ------------------------------------------------------------------------------*/ MSString& MSString::upperCase() { MSStringBuffer *oldBuffer=_pBuffer; setBuffer(_pBuffer->upperCase()); oldBuffer->removeRef(); return *this; } /*------------------------------------------------------------------------------ | MSString::upperCase | ------------------------------------------------------------------------------*/ MSString MSString::upperCase(const MSString &aString) { return MSString(aString).upperCase(); } /******************************************************************************* * DESCRIPTION: * * This section contains the implementation of the word manipulation * * functions of the class MSString. * *******************************************************************************/ // Class to record occurrence of a word: struct WordOccurrence { WordOccurrence *pNext; unsigned pos; unsigned len; WordOccurrence(unsigned p):pos(p),len(0),pNext(0) {} ~WordOccurrence() { if (pNext!=0) delete pNext; }; }; // Class to hold length/position for all words: struct Words { unsigned count; WordOccurrence *p; Words(const MSString& aString); ~Words() { delete p; } WordOccurrence &operator[](unsigned n) const; }; /*------------------------------------------------------------------------------ | Words::operator[] | | | | The wordOccurance is returned by the operator [] | | | | Notes: | | 1) Index is 0 based. | | 2) If the index is greater than the number of words then return the head | | of the linked list which has a pos of 0. | ------------------------------------------------------------------------------*/ inline WordOccurrence& Words::operator[](unsigned n) const { WordOccurrence *result=p; if (n>=count) return *result; result=result->pNext; while (n--) result=result->pNext; return *result; } /*------------------------------------------------------------------------------ | Words::Words | | | | The constructor for the Words class parses the argument MSString for | | whitespace-delimited "words." The resulting Words object contains a count | | of the number of words and a pointer to an array of WordOccurrence objects. | | Each Word object specifies the starting index of the word in the receiver | | and the length of the word. | | | | A word is parsed by: | | 1. Looking for the first non-whitespace character(via the | | function indexOfAnyBut()). | | 2. Recording this position as the start of the word. | | 3. Scanning for the next whitespace character(via | | indexOfAnyOf()),or,the end of the argument MSString. | | 4. Calculating from this the length of the word. | | 5. Performing steps 1-4 until all the words have been parsed. | | | | During this process,the position and length of each word are | | recorded in a chain of WordOccurrence objects. | ------------------------------------------------------------------------------*/ static const char whiteSpace[]="\t\n\v\f\r "; Words::Words(const MSString &aString):p(new WordOccurrence(0)),count(0) { WordOccurrence *pLast=p; unsigned pos=0; while (pos!=aString.length()) { pos=aString.indexOfAnyBut(whiteSpace,pos); if (pospNext=new WordOccurrence(pos); pLast=pLast->pNext; unsigned j=aString.indexOfAnyOf(whiteSpace,pos); if (j==aString.length()) { j=aString.size()-pos; pos=aString.length(); } else { j-=pos; pos+=j; } pLast->len=j; } } } /*------------------------------------------------------------------------------ | MSString::removeWords | | | | First,the position of the first word to be deleted is calculated via a call | | to indexOfWord(). If the word is found,then the position of the next word | | that would not be deleted is calculated(again,via indexOfWord()),and the | | substring deleted via a call to remove(). | ------------------------------------------------------------------------------*/ MSString& MSString::removeWords(unsigned firstWord,unsigned numWords) { if (numWords!=0) { unsigned startIndex=indexOfWord(firstWord,0,0); if (startIndex=phraseWords.count) return ((charOrWord==CharIndex)?stringWords[stringIndex].pos:stringIndex); else stringIndex++; // Loop exit was due to mismatch, advance index. } // No match was found. return ((charOrWord==CharIndex)?length():stringWords.count); } /*------------------------------------------------------------------------------ | MSString::indexOfWord | | | | Simply returns the result of evaluating the protected member function of the | | same name that accepts additional arguments for the position at which to | | start searching and the number of words occurring prior to this position. | ------------------------------------------------------------------------------*/ unsigned MSString::indexOfWord(unsigned wordNumber,unsigned startPos,unsigned numWords) const { unsigned result=length(); while (startPosnewBuffer(data()+myWords[0].pos,myWords[0].len,0,j,0,0,spaceChar)); i=1,j=0; while (i*this: memcpy(data()+(j+=myWords[i-1].len+numSpaces),oldBuffer->contents()+myWords[i].pos,myWords[i].len); i++; } oldBuffer->removeRef(); } else *this=MSString::null; } return *this; } /*------------------------------------------------------------------------------ | MSString::word | | | | The position of the specified word is obtained via a call to indexOfWord(). | | Then,the length of this word is deduced via a call to indexOfAnyOf() | |(using whiteSpace as the set of valid characters). Finally,a result string | | is built from the portion of the receiver between these two positions. | ------------------------------------------------------------------------------*/ MSString MSString::word(unsigned wordNumber) const { // Treat word zero like word 1: unsigned start=indexOfWord(wordNumber); unsigned end=0; if (startstart) return MSString(data()+start,end-start); else return MSString::null; } /*------------------------------------------------------------------------------ | MSString::words | | | | First,we locate the index of the first word. If found,then we locate the | | end of the last word by getting its index and then searching for a | | whiteSpace character. Once these indices have been calculated,we simply | | allocate space for the result and copy the specified portion of the receiver.| ------------------------------------------------------------------------------*/ MSString MSString::words(unsigned firstWord,unsigned numWords) const { // Treat word zero like word 1: unsigned start=indexOfWord(firstWord); unsigned len=0; // Default is none. if (startUINT_MAX-firstWord) numWords=UINT_MAX-firstWord+1; // Use maximum possible. unsigned end=indexOfWord(firstWord+numWords-1); // Get index of last word: // If found, get index of end of last word: if (end==length()) end=lastIndexOfAnyBut(whiteSpace)+1; // Word not found,use last word. else // Word found,skip to next blank. { end=indexOfAnyOf(whiteSpace,end+1); if (end==length()) end=length(); } len=end-start; } return subString(start,len); } return MSString::null; } /******************************************************************************* * DESCRIPTION: * * This section contains the implementation of the advanced "2" * * MSString conversion functions. * *******************************************************************************/ /*------------------------------------------------------------------------------ | MSString::c2b | | | | If the receiver is null,then the result is a null string. Otherwise,a char | | array 8 times as long as the receiver is allocated. This string is filled | | with ones and zeros,8 from each byte of the receiver string. | ------------------------------------------------------------------------------*/ MSString& MSString::c2b() { if (length()!=0) { MSString old(_pBuffer); MSStringBuffer *oldBuffer=_pBuffer; const char *pSource=oldBuffer->contents(); unsigned n =oldBuffer->length(); initBuffer(0,MSStringBuffer::checkMultiplication(n,8),0,0,0,0,'0'); char *pDest=data(); while (n--) { char c=*pSource++; unsigned int mask=1 << 8; while (mask >>= 1) *pDest++|=((c&mask)!=0); // Mask bit on->'1'. } oldBuffer->removeRef(); } return *this; } /*------------------------------------------------------------------------------ | MSString::c2d | | | | If the receiver is null,then it becomes '0'. Otherwise,we convert the | | receiver to digits by: | | | | -Starting with the first 4 bytes to an unsigned long and then | | to a MSString using the constructor that accepts an unsigned long | | -"Multiplying" by 256 and adding in the next character for each | | of the rest of the characters in the receiver. | ------------------------------------------------------------------------------*/ MSString& MSString::c2d() { if (length()!=0) { MSStringBuffer *oldBuffer=_pBuffer; unsigned const char *pSource=(unsigned char*) oldBuffer->contents(); // Set init to value of first n bytes(n<=4): unsigned int n=(oldBuffer->length()<4)?oldBuffer->length():4; unsigned long init=*pSource++; while (--n) init=init*256+*pSource++; // Initialize receiver with MSString equivalent of this value: initBuffer(init); // Now handle additional bytes: if (oldBuffer->length()>4) { n=oldBuffer->length()-4; // Pad with leading zeros to streamline math: rightJustify(MSStringBuffer::checkAddition(length(),MSStringBuffer::checkMultiplication(n,3)),'0'); while (n--) decimalMath(*pSource++); // Strip leading zeros: if ((n=indexOfAnyBut("0"))removeRef(); } return *this; } /*------------------------------------------------------------------------------ | MSString::c2x | | | | If the receiver is null,return a null string. Otherwise,allocate a char | | array twice as big as the receiver's. Then,we fill the array with the | | ascii representation of the nibbles of each byte of the receiver string. | ------------------------------------------------------------------------------*/ static const char hexDigits[]="0123456789ABCDEF"; MSString& MSString::c2x() { if (length()!=0) { MSStringBuffer *oldBuffer=_pBuffer; const unsigned char *pSource=(unsigned char *) oldBuffer->contents(); unsigned n=oldBuffer->length(); initBuffer(0,n,0,n); char* pDest=data(); while (n--) { unsigned char c=*pSource++; *pDest++=hexDigits[c/16]; *pDest++=hexDigits[c%16]; } oldBuffer->removeRef(); } return *this; } /*------------------------------------------------------------------------------ | MSString::b2c | | | | If the receiver is null,do nothing. If the receiver is not comprised of | | binary digits,reset the receiver to null. | | | | Otherwise,we process bytes of the receiver,8 at a time,adding into a | | character the corresponding bits. The resulting character is placed into | | the new buffer. | ------------------------------------------------------------------------------*/ MSString& MSString::b2c() { if (length()!=0&&isBinaryDigits()) { MSStringBuffer *oldBuffer=_pBuffer; const char *pSource=oldBuffer->contents(); unsigned int newLen =(oldBuffer->length()+7)/8; unsigned int bitCount=(oldBuffer->length()-1)%8+1; initBuffer(0,newLen); unsigned char *pDest=(unsigned char *)data(); while (newLen--) { unsigned char c=0; while (bitCount--) { c<<=1; // Multiply previous bits by 2. c+=(*pSource++=='1'); // Add: '1'->1,'0'->0 } *pDest++=c; bitCount=8; } oldBuffer->removeRef(); } else *this=null; return *this; } /*------------------------------------------------------------------------------ | MSString::b2d | | | | Convert the receiver to "character" and then to decimal. | ------------------------------------------------------------------------------*/ // See MSString.H /*------------------------------------------------------------------------------ | MSString::b2x | | | | Convert the receiver to "character" and then to hexidecimal. | ------------------------------------------------------------------------------*/ // See MSString.H /*------------------------------------------------------------------------------ | MSString::d2c | | | | If the receiver is not decimal digits,reset to null. | | | | Otherwise,we convert to binary by: | | | | -Converting up front as many digits as can fit in a long. | | -Converting additional digits by multiplying by 10 and adding | | in additional digits. | ------------------------------------------------------------------------------*/ MSString& MSString::d2c() { if (isDigits()) { if (length()!=0) { // Set init to value of first n-1 bytes(n==maxLong size): unsigned int n=(lengthOf(maxLong)<=length())?(lengthOf(maxLong)-1):length(); unsigned long init=subString(0,n).asInt(); MSStringBuffer *oldBuffer=_pBuffer; // Initialize receiver with appropriate bytes from init: n=sizeof init; initBuffer(0,n); unsigned char *p=(unsigned char *)this->data(); while (n--) { p[n]=(unsigned char)(init%256); init/=256; } // Now handle additional bytes: if (oldBuffer->length()>lengthOf(maxLong)-1) { unsigned const char *pSource=(unsigned char*) oldBuffer->contents()+lengthOf(maxLong)-1; n=oldBuffer->length()-lengthOf(maxLong)+1; // Pad with leading zeros to streamline math: rightJustify(length()+n/3,0); while (n--) binaryMath(*pSource++-'0'); } // Strip leading zeros: stripLeading('\0'); // If null,reset to "0": if (length()==0) *this='\0'; oldBuffer->removeRef(); } } else *this=MSString::null; return *this; } /*------------------------------------------------------------------------------ | MSString::d2b | | | | Convert the receiver to "character" and then to binary. | ------------------------------------------------------------------------------*/ // See MSString.H /*------------------------------------------------------------------------------ | MSString::d2x | | | | Convert the receiver to "character" and then to hex. | ------------------------------------------------------------------------------*/ // See MSString.H /*------------------------------------------------------------------------------ | x2c | | | | Function to transform hex digit to number between 0 and 15: | ------------------------------------------------------------------------------*/ static inline unsigned char x2c(unsigned char x) { return(x>'9')?(x>'F')?x-'a'+10:x-'A'+10:x-'0'; } /*------------------------------------------------------------------------------ | MSString::x2c | | | | If the receiver is null,return a null string. If the receiver is not | | comprised of hex digits,return a null string. | | | | Otherwise,allocate a new buffer one half as big. Process the source | | string two bytes(nibbles) at a time,generating one character per 2 | | hex digits. | ------------------------------------------------------------------------------*/ MSString& MSString::x2c() { if (length()>0&&isHexDigits()) { MSStringBuffer *oldBuffer=_pBuffer; const unsigned char *pSource=(unsigned char *) oldBuffer->contents(); unsigned int newLen =(oldBuffer->length()+1)/2; // Get first digit,if length is odd,presume leading '0': unsigned char c=(oldBuffer->length()%2)?'0':*pSource++; initBuffer(0,newLen); unsigned char *pDest=(unsigned char *) data(); while (newLen--) { // Next character is 16 times first digit plus second digit: *pDest++=::x2c(c)*16+::x2c(*pSource++); // Get first digit of next character: c=*pSource++; } oldBuffer->removeRef(); } else *this=MSString::null; return *this; } /*------------------------------------------------------------------------------ | MSString::x2b | | | | Convert the receiver to "character" and then to binary digits. | ------------------------------------------------------------------------------*/ // See MSString.H /*------------------------------------------------------------------------------ | MSString::x2d | | | | Convert the receiver to "character" and then to decimal. | ------------------------------------------------------------------------------*/ // See MSString.H /*------------------------------------------------------------------------------ | MSString::decimalMath | | | | We process the digits of the receiver one at a time from right to left. We | | calculate the result of multiplying this digit by 256 and adding in the | | input "carry in" digit(which must be in the range [0,255]. | | | | The result is then divided by 10. The remainder is used as the result | | digit and the quotient is propogated as the "carry" into the calculation of | | the next digit to the left. | | | | If,after all digits are processed,the carry is non-zero,then we convert | | this to decimal digits and prepend it to what was calculated so far. | | | | The receiver is prefixed with sufficient leading zeros to ensure there will | | be sufficient room for these carry digits. | ------------------------------------------------------------------------------*/ void MSString::decimalMath(unsigned char newDigit) { MSStringBuffer *oldBuffer=_pBuffer; const unsigned char *pSource=(unsigned char *)oldBuffer->contents()+oldBuffer->length()-1; // Add enough leading zeros to handle carry out of high order digit: unsigned int n=indexOfAnyBut("0"); // First non-0 digit. if (n==length()) n=oldBuffer->length(); // All digits are zeros. // Never remove leading zeros. if (n>3) n=3; initBuffer(0,oldBuffer->length(),0,3-n,0,0,'0'); // At least 3 leading 0s. unsigned char *pDest=(unsigned char *) data()+length()-1; n=oldBuffer->length(); unsigned int carry=newDigit; while (n--) { unsigned int digit=*(pSource--)-(unsigned char)'0'; digit=256u*digit+carry; carry=digit/10u; *pDest--='0'+(unsigned char)(digit%10u); } while (carry) { *pDest--='0'+(unsigned char)(carry%10u); carry=carry/10u; } oldBuffer->removeRef(); } /*------------------------------------------------------------------------------ | MSString::binaryMath | | | | We process the bytes of the receiver one at a time from right to left. We | | calculate the result of multiplying each byte by 10 and adding in the input | | "carry in" digit(which must be in the range [0,9]). | | | | The result is then divided by 256. The remainder is used as the result | | byte and the quotient is propogated as the "carry" into the calculation of | | the next byte to the left. | | | | If,after all bytes are processed,the carry is non-zero,then this value is | | used to set the leading byte. The receiver is prefixed with a zero byte to | | ensure there is room for this. | ------------------------------------------------------------------------------*/ void MSString::binaryMath(unsigned char newDigit) { MSStringBuffer *oldBuffer=_pBuffer; const unsigned char *pSource=(unsigned char *) oldBuffer->contents()+oldBuffer->length()-1; // Add enough leading zeros to handle carry out of high order byte: unsigned int n=indexOfAnyBut("\0"); // First non-0 byte. n=(n==0); // Add a zero only if first digit is non-zero. initBuffer(0,oldBuffer->length(),0,n); unsigned char *pDest=(unsigned char *) data()+length()-1; n=oldBuffer->length(); unsigned int carry=newDigit; while (n--) { unsigned int digit=*pSource--; digit=10u*digit+carry; carry=digit/256u; *pDest--=(unsigned char)(digit%256u); } if (carry) *pDest=carry; oldBuffer->removeRef(); } //############################################################################### // misc primitive functions - truncate,zero,exchange,upper,lower,reverse,rotate,take,drop MSString& MSString::truncate(unsigned len) { return remove(length()-len); } MSString& MSString::removeAll(void) { MSStringBuffer *oldBuffer=_pBuffer; setBuffer(oldBuffer->newBuffer(0,0,0,0,0,0,0)); oldBuffer->removeRef(); return *this; } MSString& MSString::exchange(unsigned index1,unsigned index2) { if (index1!=index2&&index1rotate(count)); oldBuffer->removeRef(); return *this; } MSString rotate(const MSString& aString,int count) { return MSString(aString).rotate(count); } MSString& MSString::take(int count) { MSStringBuffer *oldBuffer=_pBuffer; setBuffer(_pBuffer->take(count)); oldBuffer->removeRef(); return *this; } MSString take(const MSString& aString,int count) { return MSString(aString).take(count); } MSString& MSString::drop(int count) { MSStringBuffer *oldBuffer=_pBuffer; setBuffer(_pBuffer->drop(count)); oldBuffer->removeRef(); return *this; } MSString drop(const MSString& aString,int count) { return MSString(aString).drop(count); } /*--------------------------- Comparison Operators ---------------------------*/ MSBoolean operator==(const MSString &string1,const MSString &string2) { return MSBoolean((string1._pBuffer->compare(string2.data(),string2.length())==MSStringBuffer::equal)); } MSBoolean operator==(const MSString &string1,const char *pString2) { return MSBoolean((string1._pBuffer->compare(pString2,MSString::lengthOf(pString2))==MSStringBuffer::equal)); } MSBoolean operator==(const char *pString1,const MSString &string2) { return MSBoolean((string2._pBuffer->compare(pString1,MSString::lengthOf(pString1))==MSStringBuffer::equal)); } MSBoolean operator!=(const MSString &string1,const MSString &string2) { return MSBoolean((string1._pBuffer->compare(string2.data(),string2.length())!=MSStringBuffer::equal)); } MSBoolean operator!=(const MSString &string1,const char *pString2) { return MSBoolean((string1._pBuffer->compare(pString2,MSString::lengthOf(pString2))!=MSStringBuffer::equal)); } MSBoolean operator!=(const char *pString1,const MSString &string2) { return MSBoolean((string2._pBuffer->compare(pString1,MSString::lengthOf(pString1))!=MSStringBuffer::equal)); } MSBoolean operator>(const MSString &string1,const MSString &string2) { return MSBoolean((string1._pBuffer->compare(string2.data(),string2.length())==MSStringBuffer::greaterThan)); } MSBoolean operator>(const MSString &string1,const char *pString2) { return MSBoolean((string1._pBuffer->compare(pString2,MSString::lengthOf(pString2))==MSStringBuffer::greaterThan)); } MSBoolean operator>(const char *pString1,const MSString &string2) { return MSBoolean((string2._pBuffer->compare(pString1,MSString::lengthOf(pString1))==MSStringBuffer::lessThan)); } MSBoolean operator>=(const MSString &string1,const MSString &string2) { return MSBoolean((string1._pBuffer->compare(string2.data(),string2.length())==MSStringBuffer::lessThan)==MSFalse); } MSBoolean operator>=(const MSString &string1,const char *pString2) { return MSBoolean((string1._pBuffer->compare(pString2,MSString::lengthOf(pString2))==MSStringBuffer::lessThan)==MSFalse); } MSBoolean operator>=(const char *pString1,const MSString &string2) { return MSBoolean((string2._pBuffer->compare(pString1,MSString::lengthOf(pString1))==MSStringBuffer::greaterThan)==MSFalse); } MSBoolean operator<(const MSString &string1,const MSString &string2) { return MSBoolean((string1._pBuffer->compare(string2.data(),string2.length())==MSStringBuffer::lessThan)); } MSBoolean operator<(const MSString &string1,const char *pString2) { return MSBoolean((string1._pBuffer->compare(pString2,MSString::lengthOf(pString2))==MSStringBuffer::lessThan)); } MSBoolean operator<(const char *pString1,const MSString &string2) { return MSBoolean((string2._pBuffer->compare(pString1,MSString::lengthOf(pString1))==MSStringBuffer::greaterThan)); } MSBoolean operator<=(const MSString &string1,const MSString &string2) { return MSBoolean((string1._pBuffer->compare(string2.data(),string2.length())==MSStringBuffer::greaterThan)==MSFalse); } MSBoolean operator<=(const MSString &string1,const char *pString2) { return MSBoolean((string1._pBuffer->compare(pString2,MSString::lengthOf(pString2))==MSStringBuffer::greaterThan)==MSFalse); } MSBoolean operator<=(const char *pString1,const MSString &string2) { return MSBoolean((string2._pBuffer->compare(pString1,MSString::lengthOf(pString1))==MSStringBuffer::lessThan)==MSFalse); } aplus-fsf-4.22/src/MSTypes/MSStringBuffer.C0000644000265000001440000023614610772770450014142 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// extern "C" { #include #include } #ifdef __cfront #undef isalnum #undef isalpha #undef iscntrl #undef isdigit #undef isgraph #undef isxdigit #undef islower #undef isprint #undef ispunct #undef isupper #endif #include #ifndef MSStringHEADER #include #endif #ifndef MSStringTestHEADER #include #endif #ifdef MS_NO_INLINES #include #endif MSBaseStringBuffer::~MSBaseStringBuffer() {} /*------------------------------------------------------------------------------ | MSStringBuffer::className | ------------------------------------------------------------------------------*/ const char *MSStringBuffer::className(void) const { return "MSStringBuffer"; } /*------------------------------------------------------------------------------ | MSStringBuffer::asDebugInfo | ------------------------------------------------------------------------------*/ MSString MSStringBuffer::asDebugInfo(void) const { MSString result(className()); result+="(@"; result+=MSString((unsigned long)this).d2x().lowerCase(); result+=",refs="; result+=MSString(useCount()); result+=",len="; result+=MSString(length()); result+=",data=["; if (length()>23) { result+=MSString(contents(),10); result+="..."; result+=MSString(contents()+length()-10,10); } else result+=contents(); result+="])"; return result; } /*------------------------------------------------------------------------------ | MSStringBuffer::charType | ------------------------------------------------------------------------------*/ MSStringEnum::CharType MSStringBuffer::charType(unsigned) const { return MSStringEnum::SBCS; } /*------------------------------------------------------------------------------ | MSStringBuffer::allocate | ------------------------------------------------------------------------------*/ MSStringBuffer *MSStringBuffer::allocate(unsigned newLen) const { return new (newLen)MSStringBuffer(newLen); } /*------------------------------------------------------------------------------ | MSStringBuffer::null | ------------------------------------------------------------------------------*/ MSStringBuffer *MSStringBuffer::null(void) const { return MSStringBuffer::defaultBuffer(); } /*------------------------------------------------------------------------------ | MSStringBuffer::defaultBuffer | | | | MSStringBuffer with "null" value. | | | | This buffer is the "default" buffer used to construct MSStrings. | | | | All "null" MSStrings will point to this instance. Its "contents" | | are a single null character. This ensures that using a null | | MSString equates to using a null string(in more of the C sense). | ------------------------------------------------------------------------------*/ MSStringBuffer *MSStringBuffer::defaultBuffer(void) { static MSStringBuffer *pNullBuffer = MSStringBuffer::initialize(); return pNullBuffer; } /*------------------------------------------------------------------------------ | MSStringBuffer::initialize | | | | Build DBCS table and return pointer to appropriate(null) MSStringBuffer. | ------------------------------------------------------------------------------*/ extern MSStringBuffer *createMSMBStringBuffer(void); MSStringBuffer *MSStringBuffer::initialize(void) { if (MB_CUR_MAX>1) return (MSStringBuffer *)createMSMBStringBuffer(); return new(0) MSStringBuffer(0); } /*------------------------------------------------------------------------------ | MSStringBuffer::next | ------------------------------------------------------------------------------*/ char *MSStringBuffer::next(const char *prev) { return(char*)prev++; } /*------------------------------------------------------------------------------ | MSStringBuffer::next | ------------------------------------------------------------------------------*/ const char *MSStringBuffer::next(const char *prev) const { return prev++; } /*------------------------------------------------------------------------------ | MSStringBuffer::MSStringBuffer | | | | Construct a buffer of the specified length. The "data" member | | array must actually be of length 1 greater than the argument | | value(this is achieved automatically via use of the overloaded | | operator new for class MSStringBuffer). | | | | The terminating(extra) byte is set to null. | | | | Notes: | | 1. This method is protected. MSStringBuffers must be obtained by using | | MSStringBuffer::nullBuffer and subsequent newBuffer calls to existing | | MSStringBuffer objects. The only non-heap instance of this class is | | the static MSStringBuffer::nullBuffer object. | | 2. This method should be inline(in context of MSStringBuffer::newBuffer). | ------------------------------------------------------------------------------*/ MSStringBuffer::MSStringBuffer(unsigned length):refs(1),len(length) { data[length]='\0'; } MSStringBuffer::~MSStringBuffer() {} /*------------------------------------------------------------------------------ | MSStringBuffer::newBuffer | | | | Allocate a new MSStringBuffer of the same type as the receiver and | | initialize it with the provided data. | ------------------------------------------------------------------------------*/ MSStringBuffer *MSStringBuffer::newBuffer(const void *p1,unsigned len1, const void *p2,unsigned len2, const void *p3,unsigned len3,char padChar) const { unsigned newLen=checkAddition(checkAddition(len1,len2),len3); MSStringBuffer *buffer; if (newLen) { buffer=allocate(newLen); char *p=buffer->contents(); // Copy first portion(or pad). if (p1) memcpy(p,p1,len1); else memset(p,padChar,len1); p+=len1; // Copy second portion(or pad). if (p2) memcpy(p,p2,len2); else memset(p,padChar,len2); p+=len2; // Copy third portion(or pad). if (p3) memcpy(p,p3,len3); else memset(p,padChar,len3); } else { buffer=null(); buffer->addRef(); } return buffer; } /*------------------------------------------------------------------------------ | MSStringBuffer::operator new | | | | Allocate an MSStringBuffer object with "data" array of requested size. | | | | Notes: | | 1. The argument size is the size of the string to be placed in | | the buffer,*excluding* the terminating null. The total amount | | of space is thus the size of the MSStringBuffer header(use count and | | length fields),plus the string length(as given by the argument), | | plus 1 more byte(for the terminating null). Since one byte of | | the data array is declared in MSStringBuffer,the proper amount of | | space is calculated by the expression used below. | ------------------------------------------------------------------------------*/ // See MSStringBufferInlines.C /*------------------------------------------------------------------------------ | MSStringBuffer::operator delete | | | | Delete the storage using the inverse of the operator used to allocate it. | ------------------------------------------------------------------------------*/ void MSStringBuffer::operator delete(void *p) { ::delete [](char*)p; } /*------------------------------------------------------------------------------ | MSStringBuffer::addRef | | | | Increment use count for this MSStringBuffer. | ------------------------------------------------------------------------------*/ // See MSStringBufferInlines.C /*------------------------------------------------------------------------------ | MSStringBuffer::removeRef | | | | Decrement the use count of the receiver. | | | | If the resulting use count is now zero,release the MSStringBuffer by | | calling delete against "this." | | | | Notes: | | 1. This function appears dangerous. However,a call to this function | | is interpreted as giving up access to the associated buffer. At | | that point,only other references are valid(and if there are none, | | then the receiver can be deleted). | ------------------------------------------------------------------------------*/ // See MSStringBufferInlines.C /*------------------------------------------------------------------------------ | MSStringBuffer::rightJustify | | | | This function right justifies the receiver in a new buffer of the given | | length and returns the address of the new buffer. | | | | The right justification algorithm is as follows: | | | | 1. Calculate how much padding will be needed on the left. | | 2. Calculate how many bytes of the current buffer will be | | transferred to the right-justified result. | | 3. return a new buffer comprised of the "prefix" pad bytes | | and the portion of the receiver calculated at step 2. | | | | Notes: | | 1. This function(and likewise all the similar "editing" functions) | | is usually called in the following context: | | MSString::xxxxx() | | { | | ... | | MSString old(self.pBuffer); | | self.pBuffer=old.pBuffer->rightJustify(...); | | ... | | } | ------------------------------------------------------------------------------*/ MSStringBuffer *MSStringBuffer::rightJustify(unsigned newLength,char padCharacter) { if (newLength!=length()) { unsigned prefix=(newLength>length())?newLength-length():0; unsigned fromReceiver=(length()length()-startPos) numChars=length()-startPos; // Initialize from current contents before/after deleted chars: return newBuffer(contents(),startPos, contents()+startPos+numChars,length()-numChars-startPos, 0,0, 0); } return this; } /*------------------------------------------------------------------------------ | MSStringBuffer::overflow | | | | Throw "overflow" exception. | ------------------------------------------------------------------------------*/ unsigned MSStringBuffer::overflow(void) { // ITHROWLIBRARYERROR(ICMSStringHEADEROVERFLOW,IErrorInfo::invalidRequest,IException::recoverable); return 0; } /******************************************************************************* * DESCRIPTION: * * This section contains the implementation of the MSStringBuffer testing * * functions. * *******************************************************************************/ /*------------------------------------------------------------------------------ | MSStringBuffer::isAlnum | | MSStringBuffer::isAlpha | | MSStringBuffer::isAscii | | MSStringBuffer::isCntrl | | MSStringBuffer::isDigits | | MSStringBuffer::isGraphics | | MSStringBuffer::isHexDigits | | MSStringBuffer::isLowerCase | | MSStringBuffer::isPrintable | | MSStringBuffer::isPunctuation | | MSStringBuffer::isUpperCase | | MSStringBuffer::isWhitespace | | | | Each of these functions is implemented by constructing(implicitly) | | an MSStringTest with the corresponding standard library function. | | This MSStringTest is then applied to the buffer contents using the | | indexOfAnyBut member function(which returns the index of the first | | character that fails the test). This "index" is then compared to | | achieve the desired result: | | 0 (no characters failed the test) ->"MSTrue" | | >0(some character failed the test)->"MSFalse" | | | | Notes: | | 1. This simplistic implementation fails NLS/DBCS criteria,the | | determination of alpha/lowercase/etc. must be made on a per | | code page basis. | ------------------------------------------------------------------------------*/ #if defined(__APPLE__) int MS_ISALNUM(int c) { return isalnum(c); } int MS_ISALPHA(int c) { return isalpha(c); } int MS_ISCNTRL(int c) { return iscntrl(c); } int MS_ISUPPER(int c) { return isupper(c); } int MS_ISPUNCT(int c) { return ispunct(c); } int MS_ISPRINT(int c) { return isprint(c); } int MS_ISLOWER(int c) { return islower(c); } int MS_ISXDIGIT(int c) { return isxdigit(c); } int MS_ISGRAPH(int c) { return isgraph(c); } int MS_ISDIGIT(int c) { return isdigit(c); } #else #define MS_ISALNUM isalnum #define MS_ISALPHA isalpha #define MS_ISCNTRL iscntrl #define MS_ISUPPER isupper #define MS_ISPUNCT ispunct #define MS_ISPRINT isprint #define MS_ISLOWER islower #define MS_ISXDIGIT isxdigit #define MS_ISGRAPH isgraph #define MS_ISDIGIT isdigit #endif MSBoolean MSStringBuffer::isAlphanumeric() const { return MSBoolean(indexOfAnyBut(MSStringTest(MS_ISALNUM))==length()); } /*------------------------------------------------------------------------------ | MSStringBuffer::isAlphabetic | ------------------------------------------------------------------------------*/ MSBoolean MSStringBuffer::isAlphabetic() const { return MSBoolean(indexOfAnyBut(MSStringTest(MS_ISALPHA))==length()); } /*------------------------------------------------------------------------------ | MSStringBuffer::isASCII | ------------------------------------------------------------------------------*/ MSBoolean MSStringBuffer::isASCII() const { unsigned i=length(); const unsigned char *p=(unsigned char *)contents(); while (i--) if (*p++>127) return MSFalse; return MSTrue; } /*------------------------------------------------------------------------------ | MSStringBuffer::isControl | ------------------------------------------------------------------------------*/ MSBoolean MSStringBuffer::isControl() const { return MSBoolean(indexOfAnyBut(MSStringTest(MS_ISCNTRL))==length()); } /*------------------------------------------------------------------------------ | MSStringBuffer::isDigits | ------------------------------------------------------------------------------*/ MSBoolean MSStringBuffer::isDigits() const { return MSBoolean(indexOfAnyBut(MSStringTest(MS_ISDIGIT))==length()); } /*------------------------------------------------------------------------------ | MSStringBuffer::isGraphics | ------------------------------------------------------------------------------*/ MSBoolean MSStringBuffer::isGraphics() const { return MSBoolean(indexOfAnyBut(MSStringTest(MS_ISGRAPH))==length()); } /*------------------------------------------------------------------------------ | MSStringBuffer::isHexDigits | ------------------------------------------------------------------------------*/ MSBoolean MSStringBuffer::isHexDigits() const { return MSBoolean(indexOfAnyBut(MSStringTest(MS_ISXDIGIT))==length()); } /*------------------------------------------------------------------------------ | MSStringBuffer::isLowerCase | ------------------------------------------------------------------------------*/ MSBoolean MSStringBuffer::isLowerCase() const { return MSBoolean(indexOfAnyBut(MSStringTest(MS_ISLOWER))==length()); } /*------------------------------------------------------------------------------ | MSStringBuffer::isPrintable | ------------------------------------------------------------------------------*/ MSBoolean MSStringBuffer::isPrintable() const { return MSBoolean(indexOfAnyBut(MSStringTest(MS_ISPRINT))==length()); } /*------------------------------------------------------------------------------ | MSStringBuffer::isPunctuation | ------------------------------------------------------------------------------*/ MSBoolean MSStringBuffer::isPunctuation() const { return MSBoolean(indexOfAnyBut(MSStringTest(MS_ISPUNCT))==length()); } /*------------------------------------------------------------------------------ | MSStringBuffer::isUpperCase | ------------------------------------------------------------------------------*/ MSBoolean MSStringBuffer::isUpperCase() const { return MSBoolean(indexOfAnyBut(MSStringTest(MS_ISUPPER))==length()); } /*------------------------------------------------------------------------------ | MSStringBuffer::isWhiteSpace | ------------------------------------------------------------------------------*/ MSBoolean MSStringBuffer::isWhiteSpace() const { return MSBoolean(indexOfAnyBut(MSStringTest(APLUS_ISPACE))==length()); } /*------------------------------------------------------------------------------ | MSStringBuffer::isMBCS | ------------------------------------------------------------------------------*/ MSBoolean MSStringBuffer::isMBCS() const { return MSFalse; } /*------------------------------------------------------------------------------ | MSStringBuffer::isDBCS | ------------------------------------------------------------------------------*/ MSBoolean MSStringBuffer::isDBCS() const { return isMBCS(); } /*------------------------------------------------------------------------------ | MSStringBuffer::isSBCS | ------------------------------------------------------------------------------*/ MSBoolean MSStringBuffer::isSBCS() const { return MSTrue; } /*------------------------------------------------------------------------------ | MSStringBuffer::includesMBCS | ------------------------------------------------------------------------------*/ MSBoolean MSStringBuffer::includesMBCS() const { return MSFalse; } /*------------------------------------------------------------------------------ | MSStringBuffer::includesDBCS | ------------------------------------------------------------------------------*/ MSBoolean MSStringBuffer::includesDBCS() const { return includesMBCS(); } /*------------------------------------------------------------------------------ | MSStringBuffer::includesSBCS | ------------------------------------------------------------------------------*/ MSBoolean MSStringBuffer::includesSBCS() const { return MSTrue; } /*------------------------------------------------------------------------------ | MSStringBuffer::isValidMBCS | ------------------------------------------------------------------------------*/ MSBoolean MSStringBuffer::isValidMBCS() const { return MSTrue; } /*------------------------------------------------------------------------------ | MSStringBuffer::isValidDBCS | ------------------------------------------------------------------------------*/ MSBoolean MSStringBuffer::isValidDBCS() const { return isValidMBCS(); } /******************************************************************************* * DESCRIPTION: * * This section contains the implementation of the MSStringBuffer comparison * * function "compare". * *******************************************************************************/ /*------------------------------------------------------------------------------ | MSStringBuffer::compare | | | | Initialize result to "less than". | | | | If neither string is null,we compare as many bytes as in the | | shorter of the two,using memcmp. | | | | If these sections compare equal,then,if the lengths are the same, | | set the result to "equal." Otherwise,set the result to either | | "less than" or "greater than," depending on which string is longer | |(the longer one is "greater"). | | | | If these sections aren't equal,then simply set the result to | | "less than" or "greater than" according to the result of the call | | to memcmp. | | | | If the receiver isn't null,but the argument is,then return | | "greater than." If both the receiver and argument are null, | | return "equal." | | | | Notes: | | 1. A quick check is made to see if the receiver's buffer and the | | argument coincide(in which case "equal" is returned). | ------------------------------------------------------------------------------*/ MSStringBuffer::Comparison MSStringBuffer::compare(const void *pArg,unsigned argLen) const { Comparison result=lessThan; if (contents()==pArg&&length()==argLen) result=equal; else if (length()>0) { if (argLen>0) { int rc=memcmp(contents(),pArg,(length()length()||searchLen>length()-startPos)?length():startPos; } /*------------------------------------------------------------------------------ | MSStringBuffer::startBackwardsSearch | | | | This function returns the "adjusted" starting position for a | | backward search ostensibly starting at position "startPos" for a | | search string of length "searchLen". A return value of length() indicates | | that the search cannot succeed. | | | | If the length of the search string exceeds the length of the buffer, | | then the search cannot succeed,so return length(). | | | | If the starting position is zero,or,the specified starting position | | is beyond the end of the buffer,then start the search at the end | | of the buffer(index equal to buffer length). | | | | Finally,the starting point is moved back so that the search string | | starting at that point won't run off the end of the buffer. | ------------------------------------------------------------------------------*/ unsigned MSStringBuffer::startBackwardsSearch(unsigned startPos,unsigned searchLen) const { if (searchLen<=length()) { if (startPos>=length()) startPos=length()-1; if (startPos>length()-searchLen) startPos=length()-searchLen; } else startPos=length(); return startPos; } /*------------------------------------------------------------------------------ | MSStringBuffer::indexOf | | | | 1. First,check whether the search can succeed(and set the | | point at which the search is to start) by calling startSearch(). | | 2. If the search cannot succeed,then return length(). | | 3. Otherwise,compare the buffer contents starting at each index | | to the search string until a match is found(in which case we | | return the index) or the entire buffer is tested(in which case | | 0 is returned). | | | | Notes: | | 1. If the search string is a single character,then this function is | | implemented via the equivalent invocation of indexOfAnyOf(which is | | optimized for that case). This saves the additional logic of | | special code to handle that case here,as well. | | 2. If the search string is null,then length() is returned. | ------------------------------------------------------------------------------*/ unsigned MSStringBuffer::indexOf(const char *pSearchString,unsigned searchLen,unsigned startPos) const { if (searchLen>0&&length()>0) { if (searchLen==1) return indexOfAnyOf(pSearchString,searchLen,startPos); startPos=startSearch(startPos,searchLen); if (startPos1-call memchr for each character of the buffer to see | | if the character is in the set of valid characters; | | return the index of the first that isn't found | | | | If all characters pass the test,return length(). | ------------------------------------------------------------------------------*/ unsigned MSStringBuffer::indexOfAnyBut(const char *pValidChars,unsigned numValidChars,unsigned startPos) const { startPos=startSearch(startPos,1); if (startPos1-call memchr for each character of the buffer to see | | if the character is in the set of search characters; | | return the index of the first that is found | | | | If all characters fail the test,return length(). | ------------------------------------------------------------------------------*/ unsigned MSStringBuffer::indexOfAnyOf(const char *pValidChars,unsigned numValidChars,unsigned startPos) const { startPos=startSearch(startPos,1); if (startPos1-call memcmp for each character of the buffer to see | | if the characters starting here match the search | | string | | If no match is found,return length(). | ------------------------------------------------------------------------------*/ unsigned MSStringBuffer::lastIndexOf(const char *pSearchString,unsigned searchLen,unsigned startPos) const { startPos=startBackwardsSearch(startPos,searchLen); if (startPos1-call memchr for each character of the buffer to see | | if the character is in the set of valid characters; | | return the index of the first that isn't found | | | | If all characters pass the test,return length(). | ------------------------------------------------------------------------------*/ unsigned MSStringBuffer::lastIndexOfAnyBut(const char *pValidChars,unsigned numValidChars,unsigned startPos) const { startPos=startBackwardsSearch(startPos,1); if (startPos1-call memchr for each character of the buffer to see | | if the character is in the set of search characters; | | return the index of the first that is found | | | | If all characters fail the test,return length(). | ------------------------------------------------------------------------------*/ unsigned MSStringBuffer::lastIndexOfAnyOf(const char *pValidChars,unsigned numValidChars,unsigned startPos) const { startPos=startBackwardsSearch(startPos,1); if (startPosxxxxxxx(); ... ==============================================================================*/ /*------------------------------------------------------------------------------ | MSStringBuffer::center | | | | If the requested length is equal to the length of the receiver, | | then the reciever is returned unmodified. Otherwise,the | | receiver's length is reset to the argument length and space is | | allocated for the centered buffer. The new buffer is built | | one of two ways,depending on whether the new length is larger | | or smaller than the original length of the reciever's buffer. | | | | In the former case,the amount of padding required before and | | after the centered string is calculated. Then,the new string | | is filled with pad characters,the old contents are copied,and | | then the remainder is filled with more pad characters. | | | | In the latter case,a substring of the receiver(the center portion | | of the requested length) is copied to the result buffer. | ------------------------------------------------------------------------------*/ MSStringBuffer *MSStringBuffer::center(unsigned newLength,char padCharacter) { MSStringBuffer *result=this; if (newLength!=length()) { // Initialize parameters to likely values: unsigned prefix=0,suffix=0,fromReceiver=length(),startPos=1; // Adjust initialization parameters: if (newLength>length()) { prefix =(newLength-length())/2; suffix=newLength-length()-prefix; } else { fromReceiver=newLength; startPos=(length()-fromReceiver)/2+1; } // Allocate space and copy receiver to middle: result=newBuffer(0,prefix, contents()+startPos-1,fromReceiver, 0,suffix, padCharacter); } else addRef(); return result; } // Class to maintain a linked list of occurrences of patterns. struct Occurrence { Occurrence *pNext; // Pointer to next occurrence. unsigned int pos; // Index of this occurrence. Occurrence(unsigned int i):pNext(0),pos(i) {} ~Occurrence() { if (pNext!=0) delete pNext; }; }; /*------------------------------------------------------------------------------ | MSStringBuffer::change | | | | This function is implemented by: | | 1. Making a pass through the receiver,noting the number of occurrences | | of the pattern and the position of each. | | 2. Calculating the new length of the receiver,based on the relative | | lengths of the pattern and replacement strings. | | 3. Filling the new buffer,alternating pieces of the old buffer with the | | new replacement string. | | | | The information collected during the the first pass through the receiver is | | maintained in a linked list of Occurrence objects. Each has a data member | | to record the position in the receiver of the pattern occurrence and a | | pointer to the Occurrence object for the next occurrence of the pattern. | ------------------------------------------------------------------------------*/ MSStringBuffer *MSStringBuffer::change(const char *pPattern,unsigned patternLen, const char *pReplacement,unsigned replacementLen, unsigned startPos,unsigned numChanges) { MSStringBuffer *result=this; unsigned count=0; // Number of occurrences. // Initialize occurrence chain with a dummy entry at head. // pOccurrence is used to step through the chain; it points // to the last occurrence during search,current occurrence // during pattern replacement. Note that when "head" is // destructed,it will delete all the other Occurrences. Occurrence head =Occurrence(0); Occurrence *pOccurrence=&head; // Search for occurrences till all(we need) are found: while (countpNext=new Occurrence(startPos); startPos+=patternLen; } else break; // No more occurrences... } if (count!=0) { // Occurrences were found,replace them... // Add dummy occurrence at end to ensure tail end of receiver // gets copied to destination: pOccurrence->pNext=new Occurrence(length()+1); // Start at first actual occurrence: pOccurrence=head.pNext; const char *pSource=contents()+pOccurrence->pos; // Allocate new buffer if size is changing: if (patternLen!=replacementLen) { unsigned newLen=length(); if (patternLen>replacementLen) newLen-=checkMultiplication(patternLen-replacementLen,count); else newLen=checkAddition(newLen,checkMultiplication(replacementLen-patternLen,count)); // Allocate new buffer and fill with old contents up to // first occurrence of the pattern: result=newBuffer(contents(),pSource-contents(), 0,newLen-(pSource-contents()), 0,0, 0); } else { // See if we need new buffer for receiver: if (useCount()==1) addRef(); // Hang on to this buffer. else result=newBuffer(contents(),length()); // Copy shared buffer. } char *pDest=result->contents()+(pOccurrence->pos); // For each occurrence,replace pattern and copy up to next occurrence: while (count--) { unsigned previousPos=pOccurrence->pos; pOccurrence=pOccurrence->pNext; memcpy(pDest,pReplacement,replacementLen); pDest +=replacementLen; pSource+=patternLen; // Copy source string up to next occurrence: unsigned n=(pOccurrence->pos-previousPos)-patternLen; if (patternLen!=replacementLen) memcpy(pDest,pSource,n); pDest +=n; pSource+=n; } } else addRef(); // No change,reuse receiver: return result; } /*------------------------------------------------------------------------------ | MSStringBuffer::copy | | | | If the number of copies is 1,or the receiver is a null buffer, | | then the receiver is returned unmodified. | | | | If the number of copies is zero,then the result is the null buffer. | | | | Otherwise,the actual number of copies to be made is calculated and | | space allocated. The old receiver contents are copied to the new | | buffer. Then,we loop,copying as much as we have(or need) from | | the beginning of the buffer to the end. | ------------------------------------------------------------------------------*/ MSStringBuffer *MSStringBuffer::copy(unsigned int numCopies) { MSStringBuffer *result=this; if (length()!=0&&numCopies!=1) { // MSStringBuffer contents will change. if (numCopies) { // Initialize new buffer with first copy: result=newBuffer(contents(),length(),0,checkMultiplication(--numCopies,length())); // Make additional copies: // Where second copy goes. char *pDest=result->contents()+length(); while (numCopies>0) { // Duplicate as much as we can from what we've already got: unsigned n =(pDest-result->contents()contents():numCopies*length(); memcpy(pDest,result->contents(),n); pDest+=n; numCopies-=n/length(); } } else { result=null(); result->addRef(); } } else addRef(); // This buffer will be maintained: return result; } /*------------------------------------------------------------------------------ | MSStringBuffer::insert | | | | This function accepts as arguments: | | -pointer to string to be inserted | | -length of string to be inserted | | -position at which to insert the string | | -pad character. | | | | It returns the receiver unmodified if both the string to be | | inserted is null and the index at which it is to be inserted is | | not off the end of the receiver buffer. | | | | Otherwise,space is allocated for the combined buffers. The | | insertion is accomplished in four steps: | | | | 1. The portion of the receiver prior to the index at which | | the new string is to be inserted is copied(may be null). | | 2. If the receiver isn't this long,then it is padded out | | to the insert index using the pad character. | | 3. The to-be-inserted string is copied(may be null). | | 4. The portion of the receiver following the index at which | | the new string is to be inserted is copied(may be null). | | | | All this is accomplished with a single call to newBuffer(). | ------------------------------------------------------------------------------*/ MSStringBuffer *MSStringBuffer::insert(const char *pInsert,unsigned len_, unsigned index,char padCharacter) { MSStringBuffer *result=this; if (len_!=0||index>length()) { unsigned len1=(length()length()) { // Second initializer is pad characters: // Third initializer is the string to be inserted: len2=index-length(),p2=0; len3=len_,p3=pInsert; } else { // Second initializer is the string to be inserted: // Third initializer is the rest of the receiver: len2=len_,p2=pInsert; len3=length()-index,p3=contents()+index; } // Return new buffer: result=newBuffer(p1,len1, p2,len2, p3,len3, padCharacter); } else addRef(); return result; } /*------------------------------------------------------------------------------ | MSStringBuffer::leftJustify | | | | If the new length is the same as the receiver's current length,then the | | receiver is returned unmodified. | | | | Otherwise,the new buffer is generated via an invocation of the | | newBuffer() function. The new contents are built from the receiver(either | | its full length or truncated at the new length if that is shorter) and a | | string of pad characters(of sufficient length to fill the result out to | | the specified length). | ------------------------------------------------------------------------------*/ MSStringBuffer *MSStringBuffer::leftJustify(unsigned newLength,char padCharacter) { MSStringBuffer *result=this; if (newLength!=length()) { result=newBuffer(contents(),(length()length())?newLength-length():0, 0,0, padCharacter); } else addRef(); return result; } /*------------------------------------------------------------------------------ | MSStringBuffer::lowerCase | | | | Starting at the beginning of the buffer,scan for the next capital | | letter and if found,convert it to lower case. Quit as soon as | | the search for a capital(via indexOfAnyOf()) fails. | ------------------------------------------------------------------------------*/ static const char caps[]="ABCDEFGHIJKLMNOPQRSTUVWXYZ"; MSStringBuffer *MSStringBuffer::lowerCase() { MSStringBuffer *result=this; unsigned pos=indexOfAnyOf(caps,26,0); if (pos1) result=newBuffer(contents(),length()); else addRef(); char *p=result->contents(); while (poslength()) { unsigned len1=(length()=index+len_) len3=length()-index-len_,p3=contents()+index+len_; else len3=0,p3=0; } // Return new buffer: result=newBuffer(p1,len1,p2,len2,p3,len3,padCharacter); } else addRef(); return result; } /*------------------------------------------------------------------------------ | MSStringBuffer::reverse | | | | If the string is not null,reverse its bytes. Since the MSStringBuffer is | | not guaranteed to not have null characters,we can't use strrev() | | and instead roll our own. | ------------------------------------------------------------------------------*/ MSStringBuffer *MSStringBuffer::reverse() { MSStringBuffer *result=this; if (length()>1) { if (useCount()>1) result=newBuffer(contents(),length()); else addRef(); char* p1=result->contents(); char* p2=result->contents()+result->length()-1; char c; while (p10&&startaddRef(); } } else addRef(); } else addRef(); return result; } /*------------------------------------------------------------------------------ | MSStringBuffer::strip | | | | This method uses an MSStringTest object to determine which characters are to | | be stripped. A "mode" indicator specifies whether leading,trailing,or, | | both leading and trailing characters meeting the criteria are to be | | stripped. | | | | 1. Find the first character that fails the criteria | | 2. Find the last character that fails the criteria | | 3. Allocate space for and copy the intervening characters | | 4. Return the resulting buffer. | ------------------------------------------------------------------------------*/ MSStringBuffer *MSStringBuffer::strip(const MSStringTest &aTest,MSStringEnum::StripMode mode) { MSStringBuffer *result=this; if (length()!=0) { unsigned start=0,stop=length()-1; unsigned newLength=length(); switch (mode) { case MSStringEnum::Trailing: stop=lastIndexOfAnyBut(aTest,length()); if (stop0&&startaddRef(); } } else addRef(); } else addRef(); return result; } /*------------------------------------------------------------------------------ | MSStringBuffer::translate | | | | The translation is accomplished by searching for the next occurrence of one | | of the input characters(via indexOfAnyOf()) and then converting it to the | | corresponding output character. The index into the character arrays is | | calculated via memchr(). If the output character array isn't this long, | | then it is effectively padded with the pad character. The process stops | | when the call to indexOfAnyOf() fails. | ------------------------------------------------------------------------------*/ MSStringBuffer *MSStringBuffer::translate(const char *pInputChars,unsigned inputLen, const char *pOutputChars,unsigned outputLen, char padCharacter) { MSStringBuffer *result=this; unsigned pos=indexOfAnyOf(pInputChars,inputLen,0); if (pos1) result=newBuffer(contents(),length()); else addRef(); char *p=result->contents(); // Create copies of source/target characters to avoid // problems if either overlap the receiver: char *pIn =(char*) memcpy(new char[inputLen],pInputChars,inputLen); char *pOut =(char*) memcpy(new char[inputLen], pOutputChars, (outputLen1) result=newBuffer(contents(),length()); else addRef(); char *p=result->contents(); while (pos=0)?count:-count; if (n>0&&n!=length()) { if (useCount()>1) result=newBuffer(contents(),length()); else addRef(); char *dp=result->contents(); unsigned i=0,j=0; if (n>length()) n%=length(); if (count<0) n=length()-n; if (n>0) { char *tp=new char[n]; for (i=0;i=0)?count:-count; if (count!=0&&an<=length()) { unsigned n=length()-an; result=newBuffer((count<0)?contents():0,n); char *dp=result->contents(); const char *sp=contents(); if (count>=0) for (unsigned i=0;i=0)?count:-count; if (an>0) { unsigned n=an; int i=0; if (an<=length()) result=newBuffer(contents(),an); else result=newBuffer(contents(),length(),0,an-length()); char *dp=result->contents(); const char *sp=contents(); if (count<0) { int k=int(length())-int(n); for (i=0;i=0)?sp[k+i]:' '; } else if (count>=0) for (i=length();i #include #include /*------------------------------------------------------------------------------ | MSStringParser::~MSStringParser | ------------------------------------------------------------------------------*/ MSStringParser::~MSStringParser(void) { if(_parseData) _parseData->removeRef(); } /*------------------------------------------------------------------------------ | operator>>(const MSString& aString_,MSString aToken_) | | | | Create an MSStringParser object from a parse string and a aToken_ | ------------------------------------------------------------------------------*/ MSStringParser operator>>(const MSString& aString_,MSString& aToken_) { return(MSStringParser(aString_)>>aToken_); } /*------------------------------------------------------------------------------ | operator>>(const MSString& aString_,const MSString aPattern_) | | | | Create an MSStringParser object from a parse string and a aPattern_ | ------------------------------------------------------------------------------*/ MSStringParser operator>>(const MSString& aString_,const MSString& aPattern_) { return(MSStringParser(aString_)>>aPattern_); } /*------------------------------------------------------------------------------ | operator>>(const MSString& aString_,const char *pPattern_) | | | | Create an MSStringParser object from a parse string and a pPattern_ | ------------------------------------------------------------------------------*/ MSStringParser operator>>(const MSString& aString_,const char *pPattern_) { return(MSStringParser(aString_)>>pPattern_); } /*------------------------------------------------------------------------------ | operator>>(const MSString& aString_,char patternChar_) | | | | Create an MSStringParser object from a parse string and a patternChar_ | ------------------------------------------------------------------------------*/ MSStringParser operator>>(const MSString& aString_,char patternChar_) { return(MSStringParser(aString_)>>patternChar_); } /*------------------------------------------------------------------------------ | operator>>(const MSString& aString_,unsigned position_) | | | | Create an MSStringParser object from a parse string and a position | ------------------------------------------------------------------------------*/ MSStringParser operator>>(const MSString& aString_,unsigned position_) { return(MSStringParser(aString_)>>position_); } /*------------------------------------------------------------------------------ | operator>>(const MSString& aString_,int position_) | | | | Create an MSStringParser object from a parse string and a position | ------------------------------------------------------------------------------*/ MSStringParser operator>>(const MSString& aString_,int position_) { return(MSStringParser(aString_)>>position_); } /*------------------------------------------------------------------------------ | operator<<(const MSString& aString_,unsigned position_) | | | | Create an MSStringParser object from a parse string and a position | ------------------------------------------------------------------------------*/ MSStringParser operator<<(const MSString& aString_,unsigned position_) { return(MSStringParser(aString_)<>(const MSString& aString_,const MSStringTest& aStringTest_) { return(MSStringParser(aString_)>>aStringTest_); } /*------------------------------------------------------------------------------ | MSStringParser::operator>>(MSString& aToken_) | ------------------------------------------------------------------------------*/ MSStringParser& MSStringParser::operator>>(MSString& aToken_) { _parseData->processToken(aToken_); return *this; } /*------------------------------------------------------------------------------ | MSStringParser::operator>>(const MSString& aPattern_) | ------------------------------------------------------------------------------*/ MSStringParser& MSStringParser::operator>>(const MSString& aPattern_) { _parseData->processPattern(aPattern_); return *this; } /*------------------------------------------------------------------------------ | MSStringParser::operator>>(const char *pPattern_) | ------------------------------------------------------------------------------*/ MSStringParser& MSStringParser::operator>>(const char *pPattern_) { _parseData->processPattern(pPattern_); return *this; } /*------------------------------------------------------------------------------ | MSStringParser::operator>>(char patternChar_) | ------------------------------------------------------------------------------*/ MSStringParser& MSStringParser::operator>>(char patternChar_) { _parseData->processPattern(patternChar_); return *this; } /*------------------------------------------------------------------------------ | MSStringParser::operator>>(const MSStringTest& test) | ------------------------------------------------------------------------------*/ MSStringParser& MSStringParser::operator>>(const MSStringTest& test) { _parseData->processTest(test); return *this; } /*------------------------------------------------------------------------------ | MSStringParser::operator>>(int delta_) | ------------------------------------------------------------------------------*/ MSStringParser& MSStringParser::operator>>(int delta_) { _parseData->changePosition(delta_); return *this; } /*------------------------------------------------------------------------------ | MSStringParser::operator>>(unsigned delta_) | ------------------------------------------------------------------------------*/ MSStringParser& MSStringParser::operator>>(unsigned delta_) { _parseData->changePosition(delta_); return *this; } /*------------------------------------------------------------------------------ | MSStringParser::operator<<(unsigned position_) | ------------------------------------------------------------------------------*/ MSStringParser& MSStringParser::operator<<(unsigned position_) { _parseData->setPosition(position_); return *this; } /*------------------------------------------------------------------------------ | MSStringParser::Skip::Skip | ------------------------------------------------------------------------------*/ MSStringParser::Skip::Skip(unsigned numWords) : _numSkip(numWords) { } /*------------------------------------------------------------------------------ | MSStringParser::Skip::numWords | ------------------------------------------------------------------------------*/ unsigned MSStringParser::Skip::numWords(void) const { return _numSkip; } /*------------------------------------------------------------------------------ | operator<<(const MSString& aString_,MSStringParser::Command aCommand_) | | | | Create an MSStringParser object from a parse string and a command | ------------------------------------------------------------------------------*/ MSStringParser operator>>(const MSString& aString_,MSStringParser::Command aCommand_) { return(MSStringParser(aString_)>>aCommand_); } /*------------------------------------------------------------------------------ | operator<<(const MSString& aString_,const MSStringParser::Skip& aSkipObj_) | | | | Create an MSStringParser object from a parse string and a skip object | ------------------------------------------------------------------------------*/ MSStringParser operator>>(const MSString& aString_,const MSStringParser::Skip& aSkipObj_) { return(MSStringParser(aString_)>>aSkipObj_); } /*------------------------------------------------------------------------------ | MSStringParser::operator<<(Command aCommand_) | ------------------------------------------------------------------------------*/ MSStringParser& MSStringParser::operator>>(Command aCommand_) { switch (aCommand_) { case reset: _parseData->setPosition(0); break; case skip: _parseData->processSkip(); break; default: break; } return *this; } /*------------------------------------------------------------------------------ | MSStringParser::operator<<(const Skip&) | ------------------------------------------------------------------------------*/ MSStringParser& MSStringParser::operator>>(const Skip& aSkipObj_) { unsigned skipCnt=aSkipObj_.numWords(); while(skipCnt-->0) _parseData->processSkip(); return *this; } /*------------------------------------------------------------------------------ | MSStringParser::MSStringParser | ------------------------------------------------------------------------------*/ MSStringParser::MSStringParser(const MSString& aString_) { _parseData=new MSStringParserData(aString_); } /*------------------------------------------------------------------------------ | MSStringParser::MSStringParser(copy constructor) | ------------------------------------------------------------------------------*/ MSStringParser::MSStringParser(const MSStringParser& aParser) { _parseData=aParser._parseData; _parseData->addRef(); } aplus-fsf-4.22/src/MSTypes/MSStringParserData.C0000644000265000001440000003671710772770451014762 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// /******************************************************************************* * FILE NAME: MSStringParserData.C * * * * DESCRIPTION: * * This file contains the implementation of classes/functions declared * * in MSStringParserData.H * *******************************************************************************/ extern "C" { #include #include } #include /*------------------------------------------------------------------------------ | Define whiteSpace characters | ------------------------------------------------------------------------------*/ static const char whiteSpace[]="\t\n\v\f\r "; static const MSString emptyString; /*------------------------------------------------------------------------------ | MSStringParserData::MSStringParserData | ------------------------------------------------------------------------------*/ MSStringParserData::MSStringParserData(const MSString &aString_) : _parseText(aString_), _currentPosition(0), _patternPosition(0), _patternLength(0), _tokenArraySize(0), _tokenCount(0), _lastToken(0), _lastSkip(MSFalse), _usedTokens(0), _refs(1) { } /*------------------------------------------------------------------------------ | MSStringParserData::~MSStringParserData | ------------------------------------------------------------------------------*/ MSStringParserData::~MSStringParserData(void) { if (_usedTokens) delete _usedTokens; } /*------------------------------------------------------------------------------ | MSStringParserData::processToken | | | | Parse the remaining string data into the token. If this is a token reparse | | then do not save the token(since it will not be parsed again). | ------------------------------------------------------------------------------*/ MSStringParserData& MSStringParserData::processToken(MSString &aToken_,MSBoolean reparse_) { reparseLastToken(); if (_currentPosition>=_parseText.length()) aToken_=emptyString; else aToken_=_parseText.subString(_currentPosition); _lastToken=&aToken_; _lastSkip=MSFalse; if (reparse_==MSFalse) saveToken(_lastToken); return *this; } /*------------------------------------------------------------------------------ | MSStringParserData::processPattern(const MSString&) | | | | Searches for the specified pattern(from the end of the last pattern) and | | re-parses the string that preceded the match. If the pattern was not found | | position at end of string. | ------------------------------------------------------------------------------*/ MSStringParserData& MSStringParserData::processPattern(const MSString& aPattern_) { unsigned startPos=_patternPosition+_patternLength; _patternPosition=_parseText.indexOf(aPattern_,startPos); if (_patternPosition<_parseText.length()) { _patternLength=aPattern_.length(); if (_tokenCount>0) reparseTokens(startPos,_patternPosition); } else { _patternPosition=_parseText.length(); _patternLength=0; } _currentPosition=_patternPosition+_patternLength; clearSavedTokens(); return *this; } /*------------------------------------------------------------------------------ | MSStringParserData::processPattern(const char *) | | | | Searches for the specified pattern(from the end of the last pattern) and | | re-parses the aString_ that preceded the match. If the pattern was not | | found position at end of string. | ------------------------------------------------------------------------------*/ MSStringParserData& MSStringParserData::processPattern(const char *pPattern_) { unsigned startPos=_patternPosition+_patternLength; _patternPosition=_parseText.indexOf(pPattern_,startPos); if (_patternPosition<_parseText.length()) { _patternLength=strlen(pPattern_); if (_tokenCount>0) reparseTokens(startPos,_patternPosition); } else { _patternPosition=_parseText.length(); _patternLength=0; } _currentPosition=_patternPosition+_patternLength; clearSavedTokens(); return *this; } /*------------------------------------------------------------------------------ | MSStringParserData::processPattern(char) | | | | Searches for the specified pattern(from the end of the last pattern) and | | re-parses the aString_ that preceded the match. If the pattern was not | | found position at end of string aString_. | ------------------------------------------------------------------------------*/ MSStringParserData& MSStringParserData::processPattern(char aPatternChar_) { unsigned startPos=_patternPosition+_patternLength; _patternPosition=_parseText.indexOf(aPatternChar_,startPos); if (_patternPosition<_parseText.length()) { _patternLength=1; if (_tokenCount>0) reparseTokens(startPos,_patternPosition); } else { _patternPosition=_parseText.length(); _patternLength=0; } _currentPosition=_patternPosition+_patternLength; clearSavedTokens(); return *this; } /*------------------------------------------------------------------------------ | MSStringParserData::processSkip | | | | Parse the remaining string data as if a token was specified,except in this | | case the token does not exist. If this is a reparse_ of a skip,do not save | | the skip marker in the token list. | ------------------------------------------------------------------------------*/ MSStringParserData& MSStringParserData::processSkip(MSBoolean reparse_) { reparseLastToken(); _lastToken=0; _lastSkip=MSTrue; if (!reparse_) saveToken(0); return *this; } /*------------------------------------------------------------------------------ | MSStringParserData::processTest | | | | Use the MSStringTest object to set the parse position | ------------------------------------------------------------------------------*/ MSStringParserData& MSStringParserData::processTest(const MSStringTest &aStringTest_) { unsigned position=_parseText.indexOf(aStringTest_,_patternPosition+_patternLength); if (position==_parseText.length()) position=_parseText.length(); return setPosition(position); } /*------------------------------------------------------------------------------ | MSStringParserData::setPosition | | | | Sets the current location for parsing to the position specified in the | | original parse aString_ string. Since positioning acts like a pattern match,| | the pattern position will be updated to reflect the positioning. | ------------------------------------------------------------------------------*/ MSStringParserData& MSStringParserData::setPosition(unsigned position_) { if (position_>=_parseText.length()) { _patternPosition=_parseText.length(); } else { unsigned startPos=_patternPosition+_patternLength; if ((position_>startPos)&&(_tokenCount>0)) reparseTokens(startPos,position_); _patternPosition=position_; } _patternLength=0; _currentPosition=_patternPosition; clearSavedTokens(); return *this; } /*------------------------------------------------------------------------------ | MSStringParserData::changePosition(using signed value) | | | | Sets the current location for parsing to the relative position specified. | | For negative values,do the processing here with underflow checking. For | | positive values,use the unsigned delta_ method. | ------------------------------------------------------------------------------*/ MSStringParserData& MSStringParserData::changePosition(int delta_) { if (delta_<0) { unsigned newPosition; if ((_patternPosition<(-delta_))||(delta_==INT_MIN)) newPosition=0; else newPosition=_patternPosition+delta_; if ((_patternLength>0)&&(_tokenCount>0)) reparseTokens(_patternPosition,_parseText.length()); _patternLength=0; setPosition(newPosition); } else changePosition((unsigned)delta_); return *this; } /*------------------------------------------------------------------------------ | MSStringParserData::changePosition(using unsigned value) | | | | Sets the current location for parsing to the relative position specified | | with overflow checking. | ------------------------------------------------------------------------------*/ MSStringParserData& MSStringParserData::changePosition(unsigned delta_) { unsigned newPosition=_patternPosition+delta_; if (_patternPosition>(UINT_MAX-delta_)) newPosition=_parseText.length(); if ((_patternLength>0)&&(_tokenCount>0)&&(newPosition>=_parseText.length())) { reparseTokens(_patternPosition,_parseText.length()); } _patternLength=0; return setPosition(newPosition); } /*------------------------------------------------------------------------------ | MSStringParserData::reparseLastToken | | | | This method is used to reparse the last parsed token so that it only | | contains the next word and then positions around the parsed word. If no | | word is found,set the token to an empty string and position at end of | | aString_. | ------------------------------------------------------------------------------*/ MSStringParserData& MSStringParserData::reparseLastToken(void) { if (_lastToken) { unsigned startPos=_parseText.indexOfAnyBut(whiteSpace,_currentPosition); if (startPos<_parseText.length()) { unsigned stopPos=_parseText.indexOfAnyOf(whiteSpace,startPos); if (stopPos<_parseText.length()) { if (startPos==_currentPosition) _lastToken->remove(stopPos-startPos+1); else *_lastToken=_parseText.subString(startPos,stopPos-startPos); _currentPosition=stopPos+1; } else { if (startPos>_currentPosition) *_lastToken=_parseText.subString(startPos); _currentPosition=_parseText.length(); } } else { *_lastToken=emptyString; _currentPosition=_parseText.length(); } } if (_lastSkip) { unsigned startPos=_parseText.indexOfAnyBut(whiteSpace,_currentPosition); if (startPos<_parseText.length()) { unsigned stopPos=_parseText.indexOfAnyOf(whiteSpace,startPos); if (stopPos<_parseText.length()) _currentPosition=stopPos+1; else _currentPosition=_parseText.length(); } else _currentPosition=_parseText.length(); } return *this; } /*------------------------------------------------------------------------------ | MSStringParserData::reparseTokens | | | | This method is used to reparse all saved tokens. A reparse value of MSTrue is| | used when calling processToken and processSkip so that the token pointer or | | skip marker is not saved for later parsing. | ------------------------------------------------------------------------------*/ MSStringParserData& MSStringParserData::reparseTokens(unsigned startPos_,unsigned stopPos_) { MSStringParserData preText(_parseText.subString(startPos_,stopPos_-startPos_)); for(int cursor=0;cursor<_tokenCount;cursor++) { MSString *token=_usedTokens[cursor]; if (token!=0) preText.processToken(*token,MSTrue); else preText.processSkip(MSTrue); } clearSavedTokens(); return *this; } /*------------------------------------------------------------------------------ | MSStringParserData::saveToken | | | | This method saves a token pointer or skip marker so that it can be reparsed | ------------------------------------------------------------------------------*/ MSStringParserData& MSStringParserData::saveToken(MSString *pToken_) { if (!_usedTokens) { _usedTokens=new MSTokenPointer[10]; _tokenArraySize=10; } if (_tokenArraySize<=_tokenCount+1) { MSTokenPointer *oldList=_usedTokens; _usedTokens=new MSTokenPointer[_tokenArraySize+10]; for(int tmp=0;tmp<_tokenCount;tmp++) _usedTokens[tmp]=oldList[tmp]; delete oldList; _tokenArraySize+=10; } _usedTokens[_tokenCount]=pToken_; _tokenCount++; return *this; } /*------------------------------------------------------------------------------ | MSStringParserData::clearSavedTokens | | | | This method clears all references to saved tokens | ------------------------------------------------------------------------------*/ MSStringParserData& MSStringParserData::clearSavedTokens(void) { _tokenCount=0; _lastToken=0; _lastSkip=MSFalse; return *this; } /*------------------------------------------------------------------------------ | MSStringParserData::addRef | | | | Add a reference by incrementing the reference count | ------------------------------------------------------------------------------*/ void MSStringParserData::addRef(void) { _refs++; } /*------------------------------------------------------------------------------ | MSStringParserData::removeRef | | | | Remove a reference by decrementing the reference count. If the refernce | | count goes to 0 then delete this. | ------------------------------------------------------------------------------*/ void MSStringParserData::removeRef(void) { if (--_refs==0) delete this; } aplus-fsf-4.22/src/MSTypes/MSStringTest.C0000644000265000001440000000134110772770451013634 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MSStringTestHEADER #include #endif MSStringTest::MSStringTest(CFunction *cfunc):type(c) { data.cFn=cfunc; } MSStringTest::~MSStringTest() {} MSBoolean MSStringTest::test(int aInt_) const { if (this->type==MSStringTest::c) return MSBoolean(data.cFn(aInt_)!=0); #if defined(MS_C_LINKAGE_INCOMPATIBILITY) else if(this->type==MSStringTest::cpp) return MSBoolean(data.cppFn(aInt_)!=0); #endif else return MSFalse; } aplus-fsf-4.22/src/MSTypes/MSStringVector.C0000644000265000001440000001205210772770452014161 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #if defined(MS_FORCE_INTERNAL_TEMPLATE_INSTANTIATION) #define MS_MSStringVector_INSTANTIATE #define MSTK_MANUAL_INSTANTIATION #endif #include #include #ifdef MS_NO_INLINES #include #endif // MS_NO_INLINES #if defined(MSTK_MANUAL_INSTANTIATION) #include #include #if defined(MS_XLC_TEMPLATE_INSTANTIATION) #pragma define (MSTypeVector) #endif #if defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma instantiate MSBaseVector > #pragma instantiate MSObjectVector #if !defined (MS_TEMPLATE_MANUAL_FRIEND_BUG) // The version of EDG used by SGI's dcc compiler has a bug related to access from friends #pragma instantiate ostream & operator<< (ostream &, const MSBaseVector > &) #endif // MS_TEMPLATE_MANUAL_FRIEND_BUG #endif // MS_EDG_TEMPLATE_INSTANTIATION #if defined(MS_VC_TEMPLATE_INSTANTIATION) template MSBaseVector >; template MSBaseVectorOps >; template MSObjectVector; template MSVectorElement; // instantiate non-inline friend template functions static int __dummy01__() { if (0) operator<<(cout, MSBaseVector >()); return 0; } static int __dummyInt01__=__dummy01__(); #endif // MS_VC_TEMPLATE_INSTANTIATION #if defined(MSTK_MANUAL_INSTANTIATION) #if defined(MS_STD_TEMPLATE_INSTANTIATION) template class MSBaseVector >; template class MSBaseVectorOps >; template class MSObjectVector; template class MSVectorElement; template ostream& operator<<(ostream&,const MSBaseVector >&); #endif #endif #endif // MSTK_MANUAL_INSTANTIATION MSTypeVector::MSTypeVector() : ObjectVectorString() { } MSTypeVector::MSTypeVector (unsigned int length_) : ObjectVectorString (length_) { } MSTypeVector::MSTypeVector (unsigned int length_, const MSString & filler_) : ObjectVectorString (length_, filler_) { } MSTypeVector::MSTypeVector (const MSTypeVector & vect_) : ObjectVectorString (vect_) { } MSTypeVector::MSTypeVector (const BaseVectorString & vect_) : ObjectVectorString (vect_) { } MSTypeVector::MSTypeVector (const char *pString_, const char delimiter_) : ObjectVectorString (pString_, delimiter_) { } MSTypeVector::MSTypeVector (MSTypeData > *pData_, unsigned int len_) : ObjectVectorString (pData_, len_) { } MSTypeVector::MSTypeVector (const MSString *pElements_, unsigned int len_) : ObjectVectorString (pElements_, len_) { } MSTypeVector::~MSTypeVector() { } MSTypeVector & MSTypeVector::operator= (const MSTypeVector & vect_) { return (MSTypeVector &) ObjectVectorString::operator= (vect_); } MSTypeVector & MSTypeVector::operator= (const BaseVectorString & vect_) { return (*this = (MSTypeVector &)vect_); } MSTypeVector & MSTypeVector::operator= (const MSString & value_) { return (MSTypeVector &) ObjectVectorString::operator= ((const char *)value_); } MSTypeVector & MSTypeVector::operator= (const char *pString_) { return (MSTypeVector &) ObjectVectorString::operator= (pString_); } MSString MSTypeVector::asString() const { return MSBaseVector >::asString(); } MSString MSTypeVector::className() const { return MSString ("MSTypeVector"); } const MSSymbol & MSTypeVector::type() const { return symbol(); } MSModel * MSTypeVector::clone() const { return new MSTypeVector (*this); } MSModel * MSTypeVector::create() const { return new MSTypeVector; } MSError::ErrorStatus MSTypeVector::set (const char *pString_) { return set (pString_, '\n'); } MSError::ErrorStatus MSTypeVector::set (const char *pString_, const char delimiter_) { MSError::ErrorStatus retval = _pImpl->setFromString (pString_, delimiter_); changed(); return retval; } const MSSymbol & MSTypeVector::symbol() { static MSSymbol sym ("MSTypeVector"); return sym; } MSTypeVector & MSTypeVector::append (const char *pString_, const char delimiter_) { unsigned int numEls = _pImpl->append (pString_, delimiter_); if (numEls) appendUpdate (_pImpl->length(), numEls); return *this; } aplus-fsf-4.22/src/MSTypes/MSSymbol.C0000644000265000001440000001012510772770452012774 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #if HAVE_IOSTREAM #include #else #include #endif static const unsigned long _intializationMagicNumber=0x55AA; static unsigned long _symbolTableInitialized=0; static MSNameSpace *_symbolTable=0; #ifdef MS_NO_INLINES #include #endif MSSymbol::MSSymbol(void) : _atom(0x0) {} MSSymbol::MSSymbol(const MSSymbol& aSymbol_) : _atom(aSymbol_._atom) {} MSSymbol::MSSymbol(const char *symbolName_) : _atom(0x0) { // this is a hack to force initialization // of the symbol table before any symbols are constructed if (_symbolTableInitialized!=_intializationMagicNumber) { _symbolTable=new MSNameSpace; _symbolTableInitialized=_intializationMagicNumber; } if (symbolName_!=0) _atom=_symbolTable->intern(symbolName_); } MSSymbol::~MSSymbol(void) {} MSSymbol& MSSymbol::operator=(const MSSymbol& aSymbol_) { _atom=aSymbol_._atom; return *this; } MSBoolean MSSymbol::operator==(const MSSymbol& aSymbol_) const { return MSBoolean(_atom==aSymbol_._atom); } MSBoolean MSSymbol::operator!=(const MSSymbol& aSymbol_) const { return MSBoolean(_atom!=aSymbol_._atom); } unsigned long hash(const MSSymbol& aSymbol_,unsigned long size_) { return aSymbol_._atom%size_; } long MSSymbol::compare(const MSSymbol& aSymbol_) const { if (_atom==aSymbol_._atom) return 0; if (_atom!=MSNullAtom&&aSymbol_._atom!=MSNullAtom) { return strcmp(symbolName(),aSymbol_.symbolName()); } else if (_atom==MSNullAtom) return -1; else return 1; } MSBoolean MSSymbol::operator<(const MSSymbol& aSymbol_) const { if (_atom==aSymbol_._atom) return MSFalse; if (_atom!=MSNullAtom&&aSymbol_._atom!=MSNullAtom) { return MSBoolean(strcmp(symbolName(),aSymbol_.symbolName())<0); } return MSBoolean(_atom(const MSSymbol& aSymbol_) const { if (_atom==aSymbol_._atom) return MSFalse; if (_atom!=MSNullAtom&&aSymbol_._atom!=MSNullAtom) { return MSBoolean(strcmp(symbolName(),aSymbol_.symbolName())>0); } return MSBoolean(_atom>aSymbol_._atom); } MSBoolean MSSymbol::operator<=(const MSSymbol& aSymbol_) const { if (_atom!=MSNullAtom&&aSymbol_._atom!=MSNullAtom) { return MSBoolean(strcmp(symbolName(),aSymbol_.symbolName())<=0); } return MSBoolean(_atom<=aSymbol_._atom); } MSBoolean MSSymbol::operator>=(const MSSymbol& aSymbol_) const { if (_atom!=MSNullAtom&&aSymbol_._atom!=MSNullAtom) { return MSBoolean(strcmp(symbolName(),aSymbol_.symbolName())>=0); } return MSBoolean(_atom>=aSymbol_._atom); } const MSSymbol& MSSymbol::nullSymbol(void) { static MSSymbol aSymbol; return aSymbol; } const char *MSSymbol::symbolName(void) const { return _symbolTable->atomName(atom()); } MSString MSSymbol::asString(void) const { return MSString(_symbolTable->atomName(atom())); } MSString MSSymbol::asDebugInfo(void) const { MSString result("MSSymbol(@"); result+=MSString((unsigned long)this).d2x().lowerCase(); result+=",_atom="; result+=MSString(atom()); result+=")"; return result; } MSString MSSymbol::className(void) const { return MSString("MSSymbol"); } MSBoolean MSSymbol::doesASymbolExistFor(const char *pString_) { return (_symbolTable->lookup(pString_)==MSNullAtom)?MSFalse:MSTrue; } ostream& MSSymbol::printSymbolTable(ostream& aStream_) { if (_symbolTable==0) return aStream_; return aStream_<<*_symbolTable; } ostream& operator<<(ostream& aStream_,const MSSymbol& aSymbol_) { return aStream_<>(istream &aStream_,MSSymbol &aSymbol_) { MSString aString; aStream_>>aString; if (aString.length()>0) aSymbol_=MSSymbol(aString); else aSymbol_=MSSymbol::nullSymbol(); return aStream_; } aplus-fsf-4.22/src/MSTypes/MSSymbolVector.C0000644000265000001440000001161610772770452014165 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #if defined(MS_FORCE_INTERNAL_TEMPLATE_INSTANTIATION) #define MS_MSSymbolVector_INSTANTIATE #define MSTK_MANUAL_INSTANTIATION #endif #include #if defined(MSTK_MANUAL_INSTANTIATION) #include #include #if defined(MS_XLC_TEMPLATE_INSTANTIATION) #pragma define (MSTypeVector) #endif #if defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma instantiate MSBaseVector > #if !defined (MS_TEMPLATE_MANUAL_FRIEND_BUG) // The version of EDG used by SGI's dcc compiler has a bug related to access from friends #pragma instantiate ostream & operator<< (ostream &, const MSBaseVector > &) #endif // MS_TEMPLATE_MANUAL_FRIEND_BUG #endif // MS_EDG_TEMPLATE_INSTANTIATION #if defined(MS_VC_TEMPLATE_INSTANTIATION) template MSBaseVector >; template MSBaseVectorOps >; // instantiate non-inline friend template functions static int __dummy01__() { if (0) operator<<(cout, MSBaseVector >()); return 0; } static int __dummyInt01__=__dummy01__(); #endif //MS_VC_TEMPLATE_INSTANTIATION #if defined(MS_STD_TEMPLATE_INSTANTIATION) template class MSBaseVector >; template class MSBaseVectorOps >; template ostream& operator<<(ostream&,const MSBaseVector >&); #endif #endif // MSTK_MANUAL_INSTANTIATION MSTypeVector::MSTypeVector() : MSBaseVector >() { } MSTypeVector::MSTypeVector (unsigned int length_) #if !defined MS_TEMPLATE_CONSTRUCTOR_OVERLOAD_BUG : MSBaseVector > (length_) #else // Visual C++ bug in overloading resolution : MSBaseVector > (length_, 0, 0) #endif //MS_TEMPLATE_CONSTRUCTOR_OVERLOAD_BUG { } MSTypeVector::MSTypeVector (unsigned int length_, const MSSymbol & filler_) : MSBaseVector > (length_, filler_) { } MSTypeVector::MSTypeVector (const MSTypeVector & vect_) : MSBaseVector > (vect_) { } MSTypeVector::MSTypeVector (const MSBaseVector > & vect_) : MSBaseVector > (vect_) { } MSTypeVector::MSTypeVector (const char *pString_) : MSBaseVector > (pString_) { } MSTypeVector::MSTypeVector (MSTypeData > *pData_, unsigned int len_) : MSBaseVector > (pData_, len_) { } MSTypeVector::MSTypeVector (const MSSymbol *pElements_, unsigned int len_) : MSBaseVector > (pElements_, len_) { } MSTypeVector::~MSTypeVector() { } MSTypeVector & MSTypeVector::operator= (const MSTypeVector & vect_) { return (MSTypeVector &) MSBaseVector >::operator= (vect_); } MSTypeVector & MSTypeVector::operator= (const MSBaseVector > & vect_) { return (*this = (MSTypeVector &)vect_); } MSTypeVector & MSTypeVector::operator= (const MSSymbol & value_) { return (MSTypeVector &) MSBaseVector >::operator= (value_); } MSTypeVector & MSTypeVector::operator= (const char *pString_) { return (*this = MSTypeVector(pString_)); } MSString MSTypeVector::className() const { return MSString ("MSTypeVector"); } const MSSymbol & MSTypeVector::type() const { return symbol(); } MSModel * MSTypeVector::clone() const { return new MSTypeVector (*this); } MSModel * MSTypeVector::create() const { return new MSTypeVector; } const MSSymbol & MSTypeVector::symbol() { static MSSymbol sym ("MSTypeVector"); return sym; } MSTypeVector::SPick & MSTypeVector::SPick::operator= (const MSTypeVector::SPick & sPick_) { _pVector->set (_index, (*sPick_._pVector)(sPick_._index)); return *this; } MSTypeVector::SPick & MSTypeVector::SPick::operator= (const MSSymbol & value_) { _pVector->set (_index, value_); return *this; } istream & operator>> (istream & stream_, MSTypeVector::SPick & symPick_) { MSSymbol sym; stream_ >> sym; symPick_._pVector->set (symPick_._index, sym); return stream_; } aplus-fsf-4.22/src/MSTypes/MSTerm.C0000644000265000001440000002267410772770452012452 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #if HAVE_IOSTREAM #include #else #include #endif #include #include #include #include static const char MSTermDelimiter=','; static const double DaysInYear=365.25; ostream& operator<<(ostream& aStream_,const MSTerm& aTerm_) { MSString aString; return aStream_< #endif MSString MSTerm::asString(void) const { MSString aString; return MSString(format(aString)); } MSString MSTerm::asDebugInfo(void) const { MSString result("MSTerm(@"); result+=MSString((unsigned long)this).d2x().lowerCase(); result+=",_years="; result+=MSString(_years); result+=",_months="; result+=MSString(_months); result+=",_days="; result+=MSString(_days); result+=",_isSet="; if (isSet()==MSTrue) result+="MSTrue"; else result+="MSFalse"; result+=",_type="; result+=type().symbolName(); result+=")"; return MSString(result); } MSString MSTerm::className(void) const { return MSString("MSTerm"); } const MSSymbol& MSTerm::type(void) const { return symbol(); } MSModel *MSTerm::clone(void) const { return new MSTerm(*this); } MSModel *MSTerm::create(void) const { return new MSTerm(); } void MSTerm::assign(const MSModel& aModel_) { *this=(MSTerm&)aModel_; } long MSTerm::compare(const MSModel& aModel_) const { return ::compare(*this,(MSTerm&)aModel_); } MSString MSTerm::asMSF(void) const { MSString aString; if (isSet()==MSTrue) { aString+=MSString(_years); aString+='y'; aString+=MSMSF_SPACE; aString+=MSString(_months); aString+='m'; aString+=MSMSF_SPACE; aString+=MSString(_days); aString+='d'; } return aString; } MSError::ErrorStatus MSTerm::setFromMSF(const char *pString_) { int code; if (pString_!=0) { MSString s(pString_); s.decodeMSF(); code=set(s); } else code=MSError::BadMSFString; return (MSError::ErrorStatus)code; } const MSSymbol& MSTerm::symbol(void) { static MSSymbol sym ("MSTerm"); return sym; } MSTerm::MSTerm(void) : _isSet(MSFalse),_years(0),_months(0),_days(0) {} MSTerm::MSTerm(const MSTerm& aTerm_) : _isSet(aTerm_._isSet),_years(aTerm_._years),_months(aTerm_._months),_days(aTerm_._days) {} MSTerm::MSTerm(const MSTerm& a_,const MSTerm& b_) : _isSet(MSBoolean(a_._isSet&&b_._isSet)), _years(a_.years()+b_.years()), _months(a_.months()+b_.months()), _days(a_.days()+b_.days()) {} MSTerm::MSTerm(int y_,int m_,int d_) : _isSet(MSTrue),_years(y_),_months(m_),_days(d_) {} MSTerm::MSTerm(const MSDate& a_,const MSDate& b_) : _isSet(MSTrue) { MSDate min=a_,max=b_; if (a_>b_) { min=b_; max=a_; } MSYear year; MSMonth month; MSDay day; int minY,maxY,minM,maxM; min.asMonthDayYear(month,day,year); minY=year; minM=month; max.asMonthDayYear(month,day,year); maxY=year; maxM=month; _years=maxY-minY; _months=maxM-minM; // earlier month in later year if (_months<0) { _years--; _months+=12; } _days=0; MSDate test=min+*this; // last-of-month to last-of-month, or day-of-month to same day-of-month if (test==max) return; // day-of-month to earlier day of later month if (test>max) { _months--; // day-of-month to earlier day of same month in later year if (_months<0) { _years--; _months+=12; } test=min+*this; } // test had better be <= max at this point _days=max-test; } MSTerm& MSTerm::operator=(const MSTerm& aTerm_) { if (this!=&aTerm_) { _years=aTerm_._years; _months=aTerm_._months; _days=aTerm_._days; _isSet=aTerm_._isSet; changed(); } return *this; } void MSTerm::getToken(const char *pString_,int *pos_,Token *token_,int *value_) { // Skip white space and commas. while (isspace(pString_[*pos_])||pString_[*pos_]==',') (*pos_)++; // Are we at the end? if (*pos_>=strlen(pString_)) { *token_=END; return; } // What is it? int start=*pos_; // Must have at least one digit. if (!isdigit(pString_[*pos_])) { *token_=BAD; return; } while (isdigit(pString_[*pos_])) (*pos_)++; *value_=atoi(&pString_[start]); if (pString_[*pos_]=='y'||pString_[*pos_]=='Y') { (*pos_)++; *token_=YEARS; return; } else if (pString_[*pos_]=='m'||pString_[*pos_]=='M') { (*pos_)++; *token_=MONTHS; return; } else if (pString_[*pos_]=='w'||pString_[*pos_]=='W') { (*pos_)++; *token_=WEEKS; return; } else if (pString_[*pos_]=='d'||pString_[*pos_]=='D') { (*pos_)++; *token_=DAYS; return; } else { *token_=BAD; return; } } void MSTerm::unset(void) { if (isSet()==MSTrue) { _isSet=MSFalse; _years=0; _months=0; _days=0; changed(); } } MSError::ErrorStatus MSTerm::set(const char *pString_) { // Allow input of Ny Nm Nw Nd in any order,with commas treated // as white space,and any of the pieces optional. Weeks are // translated into 7 seven days. int y,m,d; if (sscanf(pString_,"%d,%d,%d",&y,&m,&d)==3) { _years=y; _months=m; _days=d; _isSet=MSTrue; return changed(),MSError::MSSuccess; } // Okay. Now let's go to the more free-format inputs. We'll read stuff // char by char, skipping white space and commas, and look for a match // of Ny, Nm, Nw, or Nd in any order. Repeats are considered an error. int pos=0; int value; Token token; MSBoolean yearsDone,monthsDone,weeksDone,daysDone; yearsDone=monthsDone=weeksDone=daysDone=MSFalse; y=m=d=0; // The odd looking "for" statement below is due to the fact that the DEC // compiler will not allow the private type Token to be a return value. for (getToken(pString_,&pos,&token,&value);token!=END;getToken(pString_,&pos,&token,&value)) { if (token==BAD) { return changed(),MSError::BadTerm; } else if (token==YEARS) { if (yearsDone) return changed(),MSError::BadTerm; else { y=value; yearsDone=MSTrue; } } else if (token==MONTHS) { if (monthsDone) return changed(),MSError::BadTerm; else { m=value; monthsDone=MSTrue; } } else if (token==WEEKS) { if (weeksDone) return changed(),MSError::BadTerm; else { d+=(value*7); weeksDone=MSTrue; } } else if (token==DAYS) { if (daysDone) return changed(),MSError::BadTerm; else { d+=value; daysDone=MSTrue; } } } _years=y,_months=m,_days=d, _isSet=MSTrue; return changed(),MSError::MSSuccess; } MSError::ErrorStatus MSTerm::set(int y_,int m_,int d_) { _isSet=MSTrue,_years=y_,_months=m_,_days=d_; return changed(),MSError::MSSuccess; } MSError::ErrorStatus MSTerm::set(const MSString *sp_) { return set(sp_->string()); } MSError::ErrorStatus MSTerm::set(const MSString& sp_) { return set(sp_.string()); } const char *MSTerm::format(MSString *pString_) const { return format(*pString_); } const char *MSTerm::format(MSString& aString_) const { // This is the default (unformated) version of format: Y,M,D. char buf[64]; sprintf(buf,"%d%c%d%c%d",_years,MSTermDelimiter,_months,MSTermDelimiter,_days); aString_=buf; return aString_.string(); } long MSTerm::compare(const MSTerm *pTerm_) const { double diff=this->normalizedYears()-pTerm_->normalizedYears(); if (diff<0) diff=-1; else if (diff>0) diff=1; return((long)diff); } long MSTerm::compare(const MSTerm& aTerm_) const { double diff=this->normalizedYears()-aTerm_.normalizedYears(); if (diff<0) diff=-1; else if (diff>0) diff=1; return((long)diff); } double MSTerm::normalizedYears(void) const { return double(_days)/DaysInYear+double(_months)/12.0+double(_years); } const char *MSTerm::format(MSString *pString_,MSTermFormat format_) const { return format(*pString_,format_); } const char *MSTerm::format(MSString& aString_,MSTermFormat format_) const { // This is the formatted format. char buf[64]; switch (format_) { case YearMonthDay: // example: 1y 3d // suppresses empty terms aString_.removeAll(); if (_years!=0) { sprintf(buf,"%dy ",_years); aString_+=buf; } if (_months!=0) { sprintf(buf,"%dm ",_months); aString_+=buf; } if (_days!=0) { sprintf(buf,"%dd",_days); aString_+=buf; } break; case YearMonthDayPad: // example: 1y 0m 3d // aligns columns (assumes max of 2 digits) sprintf(buf,"%2dy %2dm %2dd",_years,_months,_days); aString_=buf; break; case YearMonthDayNoPad: // example: 1y 2m 3d sprintf(buf,"%dy %dm %dd",_years,_months,_days); aString_=buf; break; default: MSMessageLog::warningMessage("MSTerm: invalid value of format enum\n"); } return aString_.string(); } const char *MSTerm::format(MSString& aString_,const MSFormat& aFormat_) const { return (aFormat_.formatType()==MSFormat::Term)? format(aString_,aFormat_.termFormat()):format(aString_); } const char *MSTerm::format(MSString *pString_,const MSFormat& aFormat_) const { return format(*pString_,aFormat_); } MSTerm& MSTerm::operator+=(const MSTerm& aTerm_) { _years+=aTerm_._years; _months+=aTerm_._months; _days+=aTerm_._days; _isSet=MSBoolean(_isSet&&aTerm_._isSet); return changed(),*this; } aplus-fsf-4.22/src/MSTypes/MSTime.C0000644000265000001440000007434210772770452012440 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #if HAVE_IOSTREAM #include #else #include #endif #include // for getenv #include #ifndef MSDefinesHEADER #include #endif // these two constants are no longer used //char *const MSStandardTimeFormat="%H:%M:%S %m/%d/%Y %Z"; //char *const MSStandardTimeDefinition=" : : / / "; const int MSTimeBufferSize=64; const char ZoneLength=10; MSTime::MSTimeFormat MSTime::_defaultFormat=MSTime::HoursMinutesSeconds; MSString MSTime::_strftimeDefaultFormat="%D %T %Z"; time_t MSTime::_nullTime=0; MSBoolean MSTime::_defaultConstructToNow=MSFalse; const long MSTime::SECS_IN_MIN =60; const long MSTime::SECS_IN_HOUR=3600; const long MSTime::SECS_IN_DAY =86400; #ifdef MS_NO_INLINES #include #endif MSString MSTime::asString(void) const { MSString aString; return MSString(format(aString)); } MSString MSTime::asDebugInfo(void) const { MSString result("MSTime(@"); result+=MSString((unsigned long)this).d2x().lowerCase(); result+=",_time="; result+=MSString(_time); result+=",_zoneHashTable="; result+=MSString((unsigned long)_zoneHashTable).d2x().lowerCase(); result+=",_localTimeZone="; result+=MSString((int)_localTimeZone); result+=",_defaultFormat="; result+=MSString((int)_defaultFormat); result+=",_strftimeDefaultFormat="; result+=_strftimeDefaultFormat; result+=",_defaultConstructToNow="; result+=(defaultConstructToNow()==MSTrue?"MSTrue":"MSFalse"); result+=",_type="; result+=type().symbolName(); result+=")"; return MSString(result); } MSTime::MSTime(const MSDate& aDate_,MSTimeZone aTimeZone_) { _time=aDate_.asCalendarTime(aTimeZone_); if (_time<0) _time=0; } #if defined(MS_NEED_STRPTIME_DECLARATION) extern "C" char *strptime(const char*, const char*, struct tm*); #endif MSTime::MSTime(const MSString& aString_,const char* strptimeFormat_,MSTimeZone zone_) { #if defined(MS_NO_STRPTIME) MSMessageLog::errorMessage("MSTime: strptime() not supported for this platform.\n"); _time = 0; #else struct tm tms={0}; tms.tm_mon=tms.tm_mday=tms.tm_year=tms.tm_isdst=-1; char *pStr; #if !defined(MS_NO_CONSTCHAR_STRPTIME) pStr = strptime(aString_.string(),strptimeFormat_,&tms); #else pStr = strptime((char *)aString_.string(),(char *)strptimeFormat_,&tms); #endif if (pStr==0) // if the string could not be parsed { _time = 0; return; } int isDaySet=0, isMonthSet=0, isYearSet=0; #if defined(MS_TMS_RESET_BY_STRPTIME) // On some systems, strptime() resets the tm structure, setting to 0 all fields not mentioned in the format string. // This make it hard for us to determine if a field has been set or not because 0 is a valid value for some of the // fields. One assumption we are making here is that if strptime() zeroes out the unset fields, it will make sure // that the 2-digit years are handled correctly (that is, add 100 if it's <38). This assumption is currently true, // except on SGI platforms, where we have submitted a bug report and are waiting for a fix. // isDaySet = tms.tm_mday>0; // valid range is [1,31] // // If all unset fields are 0, it is impossible to determine if the month has not been set or has been set to 0, since // tm_mon's valid range is [0,11]. Therefore, we are doing some guess work here: if tm_mon>0, then it is definitely // set; otherwise (if tm_mon==0), we will consider it in pair with tm_mday -- either both are set (i.e., if tm_mday // is set and tm_mon==0, then tm_mon is considered set as well) or both are unset (i.e., if tm_mday is unset and // tm_mon==0, then tm_mon is considered unset as well). This makes sense since a format containing just the month, // without the day of the month, is considered invalid in construction of an MSTime object. // isMonthSet = (tms.tm_mon>0 || (tms.tm_mon==0 && isDaySet)); // valid range is [0,11] isYearSet = tms.tm_year>0; // valid range is [70,138] tms.tm_isdst = -1; #else isDaySet = tms.tm_mday>0; // valid range is [1,31] isMonthSet = tms.tm_mon>=0; // valid range is [0,11] isYearSet = tms.tm_year>=0; // valid range is [0,38] and [70,138] // // 2-digit years <=MS_PIVOT_YEAR (really <=38, since 2038 is the limit of time_t type) are considered to be // in 21st century; however, strptime() on some systems does not adjust the year by 100; thus, we do it here // ourselves // if (isYearSet && tms.tm_year<=MS_PIVOT_YEAR) tms.tm_year+=100; #endif //MS_TMS_RESET_BY_STRPTIME // // if only the time is specified (no date), then today's date is taken; // if the date is specified (both tm_mon and tm_mday) but without the year, the current year is taken // if (!isYearSet) // the year is not set { if (!isDaySet && !isMonthSet) // neither month nor day is set { #ifdef MS_THREAD_SAFE_FUNCTIONS struct tm tmp; #endif //MS_THREAD_SAFE_FUNCTIONS time_t curTime = time(0); struct tm *pCur_tm; if (zone_==Local) // for local time zone, we cannot determine DST presence without calling localtime() { pCur_tm = MS_LOCALTIME(&curTime,&tmp); } else // for a specific time zone, we can get adjust the time with a cached offset and call gmtime() { curTime += zoneOffset(zone_); pCur_tm = MS_GMTIME(&curTime,&tmp); } tms.tm_year = pCur_tm->tm_year; tms.tm_mon = pCur_tm->tm_mon; tms.tm_mday = pCur_tm->tm_mday; } else if (isDaySet && isMonthSet) // both month and day are set { #ifdef MS_THREAD_SAFE_FUNCTIONS struct tm tmp; #endif //MS_THREAD_SAFE_FUNCTIONS time_t curTime = time(0); if (zone_==Local) // for local time zone, we cannot determine DST presence without calling localtime() { tms.tm_year = MS_LOCALTIME(&curTime,&tmp)->tm_year; } else // for a specific time zone, we can adjust the time with a cached offset and call gmtime() { curTime += zoneOffset(zone_); tms.tm_year = MS_GMTIME(&curTime,&tmp)->tm_year; } } } else // the year is set { if (!isDaySet) tms.tm_mday=1; if (!isMonthSet) tms.tm_mon=0; } _time = greenwichMeanTime(&tms,zone_); #endif //MS_NO_STRPTIME } MSString MSTime::className(void) const { return MSString("MSTime"); } const MSSymbol& MSTime::type(void) const { return symbol(); } MSModel *MSTime::clone(void) const { return new MSTime(*this); } MSModel *MSTime::create(void) const { return new MSTime(); } void MSTime::assign(const MSModel& aModel_) { *this=(MSTime&)aModel_; } long MSTime::compare(const MSModel& aModel_) const { return ::compare(*this,(MSTime&)aModel_); } MSString MSTime::asMSF(void) const { MSString buf; (void) format (&buf,MSTime::HoursMinutesSecondsSlash4); return buf.encodeMSF(); } MSError::ErrorStatus MSTime::setFromMSF(const char *pString_) { MSError::ErrorStatus code=MSError::BadMSFString; if (pString_!=0) { MSString buf(pString_); buf.decodeMSF(); code=set(buf); } return code; } const MSSymbol& MSTime::symbol(void) { static MSSymbol sym ("MSTime"); return sym; } struct zoneoff { char *zname; MSTime::MSTimeZone zone; int hr_off; int mn_off; }; static int mtbl[]={ 0,31,59,90,120,151,181,212,243,273,304,334 }; static struct zoneoff TimeZones[]= { // Military Time { "A",MSTime::A, 1, 0 }, { "N",MSTime::N, -1, 0 }, { "B",MSTime::B, 2, 0 }, { "O",MSTime::O, -2, 0 }, { "C",MSTime::C, 3, 0 }, { "P",MSTime::P, -3, 0 }, { "D",MSTime::D, 4, 0 }, { "Q",MSTime::Q, -4, 0 }, { "E",MSTime::E, 5, 0 }, { "R",MSTime::R, -5, 0 }, { "F",MSTime::F, 6, 0 }, { "S",MSTime::S, -6, 0 }, { "G",MSTime::G, 7, 0 }, { "T",MSTime::T, -7, 0 }, { "H",MSTime::H, 8, 0 }, { "U",MSTime::U, -8, 0 }, { "I",MSTime::I, 9, 0 }, { "V",MSTime::V, -9, 0 }, { "K",MSTime::K, 10, 0 }, { "W",MSTime::W, -10, 0 }, { "L",MSTime::L, 11, 0 }, { "X",MSTime::X, -11, 0 }, { "M",MSTime::M, 12, 0 }, { "Y",MSTime::Y, -12, 0 }, { "Z",MSTime::Z, 0, 0 }, // Europe { "BST",MSTime::BST, 1, 0 }, // British Summer { "EET",MSTime::EET, 2, 0 }, { "EET DST",MSTime::EET_DST, 3, 0 }, // Eastern Europe { "MET",MSTime::MET, 1, 0 }, { "MET DST",MSTime::MET_DST, 2, 0 }, // Middle Europe { "WET",MSTime::WET, 0, 0 }, { "WET DST",MSTime::WET_DST, 1, 0 }, // Western Europe { "MSK",MSTime::MSK, 3, 0 }, { "MSD",MSTime::MSD, 4, 0 }, // Russia (Moscow) // Asia and Australasia { "JST",MSTime::JST, 9, 0 }, // Japan { "HKT",MSTime::HKT, 8, 0 }, // Hong Kong { "SGT",MSTime::SGT, 8, 0 }, // Singapore { "KST",MSTime::KST, 9, 0 }, { "KDT",MSTime::KDT, 10, 0 }, // South Korea { "AEST",MSTime::AEST, 10, 0 }, { "AESST",MSTime::AESST, 11, 0 }, // Eastern Australia { "ACST",MSTime::ACST, 9, 30 }, { "ACSST",MSTime::ACSST, 10, 30 }, // Central Australia { "AWST",MSTime::AWST, 8, 0 }, // Western Australia { "NZST",MSTime::NZST, 12, 0 }, { "NZDT",MSTime::NZDT, 13, 0 }, // New Zealand // North America { "NST",MSTime::NST, -3,-30 }, { "NDT",MSTime::NDT, -2,-30 }, // Newfoundland { "AST",MSTime::AST, -4, 0 }, { "ADT",MSTime::ADT, -3, 0 }, // Atlantic { "EST",MSTime::EST, -5, 0 }, { "EDT",MSTime::EDT, -4, 0 }, // Eastern { "CST",MSTime::CST, -6, 0 }, { "CDT",MSTime::CDT, -5, 0 }, // Central { "MST",MSTime::MST, -7, 0 }, { "MDT",MSTime::MDT, -6, 0 }, // Mountain { "PST",MSTime::PST, -8, 0 }, { "PDT",MSTime::PDT, -7, 0 }, // Pacific { "AKST",MSTime::AKST, -9, 0 }, { "AKDT",MSTime::AKDT, -8, 0 }, // Alaska { "HAST",MSTime::HAST, -10, 0 }, { "HADT",MSTime::HADT, -9, 0 }, // Aleutian { "HST",MSTime::HST, -10, 0 }, // Hawaii // Universal Time { "UT",MSTime::UT, 0, 0 }, { "GMT",MSTime::GMT, 0, 0 }, { "Local",MSTime::Local, 0, 0 }, // Also legal is +/- followed by hhmm offset from UT { 0,MSTime::A,0,0 } }; MSHashTable *MSTime::_zoneHashTable=MSTime::initZoneHashTable(); MSTime::MSTimeZone MSTime::_localTimeZone=MSTime::setLocalTimeZone(); void MSTime::unset(void) { if (isSet()==MSTrue) { _time=nullTime(); changed(); } } // Values that can be passed to ::set() // 1) A value of "0", which causes the time to be set to nullTime(). // 2) A value in the form "secs timezone" (i.e. "701296172 GMT+9:00"). // 3) A user-supplied value which is assumed to be in locale-specific format. MSError::ErrorStatus MSTime::set(const MSString *pString_, MSTimeZone zone_) { return set(pString_->string(),zone_); } MSError::ErrorStatus MSTime::set(const MSString& aString_, MSTimeZone zone_) { return set(aString_.string(),zone_); } MSError::ErrorStatus MSTime::set(const char *pString_) { return set(pString_,Local); } MSError::ErrorStatus MSTime::set(const char *pString_, MSTimeZone zone_) { MSError::ErrorStatus status=internalSet(pString_,zone_); return changed(),status; } MSError::ErrorStatus MSTime::internalSet(const char *cp_, MSTimeZone zone_) { static char *fname="MSTime::set"; struct tm tmStruct={0},*now; char buf[ZoneLength]; time_t aTime; MSError::ErrorStatus rc=MSError::MSSuccess; #ifdef MS_THREAD_SAFE_FUNCTIONS struct tm tmp; #endif //MS_THREAD_SAFE_FUNCTIONS tmStruct.tm_isdst=-1; // when tm_isdst<0, libc functions will determine the correct time zone if (cp_==0) rc=MSError::MSFailure; else { if (*cp_=='\0'||(cp_[0]=='0'&&cp_[1] =='\0')) { _time=nullTime(); return MSError::MSSuccess; } int assigned=sscanf(cp_,"%d:%d:%d %d/%d/%d %s", &tmStruct.tm_hour,&tmStruct.tm_min,&tmStruct.tm_sec, &tmStruct.tm_mon,&tmStruct.tm_mday,&tmStruct.tm_year,buf); switch (assigned) { case 1: // format of "seconds GMT+hh:mm" or a valid date format // check for valid date format aTime=MSDate(cp_).asCalendarTime(zone_); if (aTime>=0) { _time=aTime; } // check for format of "seconds GMT+hh:mm" else { assigned=sscanf(cp_,"%d %s",&aTime,buf); if (assigned==1) // simply seconds, without a time zone { _time=aTime-zoneOffset(zone_); } else if (assigned==2) // seconds plus time zone (in which case it overrides the zone_ argument) { _time=aTime-scanTimeZone(buf); } else { MSMessageLog::errorMessage("Invalid format in %s: \"%s\"\n",fname,cp_); rc=MSError::Internal; } } break; case 2: // i.e. format of hh:mm" tmStruct.tm_sec=0; // FALL THRU case 3: // i.e. format of hh:mm:ss" (void)time(&_time); if (zone_==Local) // cannot determine DST presence => have to use localtime() { now=MS_LOCALTIME(&_time,&tmp); } else // any specific time zone => can use gmtime() { time_t t=_time+zoneOffset(zone_); now=MS_GMTIME(&t,&tmp); } // // _time is now set to current time; we need to set it to the given number of hours, minutes, and seconds // of the *same* day. Thus, instead of calling greenwichMeanTime() with now pointer and recomputing // everything from scratch, we can simply adjust _time to the desired time of day. // _time += SECS_IN_HOUR*(tmStruct.tm_hour-now->tm_hour) + SECS_IN_MIN*(tmStruct.tm_min-now->tm_min) + tmStruct.tm_sec-now->tm_sec; break; case 6: // i.e. format of "hh:mm:ss mm/dd/yyyy" or "hh:mm:ss mm/dd/yy" --tmStruct.tm_mon; // tm_mon is 0-based if (tmStruct.tm_year<100) { // this should be consistent with MSDate: 2-digit years <=MS_PIVOT_YEAR (defined in MSDefines.H) // are considered to be in 21st century (e.g., 3/10/29 is 3/10/2029) while those >MS_PIVOT_YEAR // are in the 20th century (3/10/79 is 3/10/1979) // tmStruct.tm_year += (tmStruct.tm_year<=MS_PIVOT_YEAR) ? 2000 : 1900; } _time=greenwichMeanTime(&tmStruct,zone_); break; case 7: { // i.e. format of "hh:mm:ss mm/dd/yyyy GMT+9:00" or "hh:mm:ss mm/dd/yy GMT+9:00"; // the time zone in the string overrides the zone_ argument // if (strlen(buf)>=ZoneLength) { MSMessageLog::errorMessage("Cannot store buf=\"%s\" in %s(): too large\n",buf,fname); rc=MSError::Internal; break; } MSString zone; time_t offset = scanTimeZone(buf); --tmStruct.tm_mon; // tm_mon is 0-based if (tmStruct.tm_year<100) { // this should be consistent with MSDate: 2-digit years <=MS_PIVOT_YEAR (defined in MSDefines.H) // are considered to be in 21st century (e.g., 3/10/29 is 3/10/2029) while those >MS_PIVOT_YEAR // are in the 20th century (3/10/79 is 3/10/1979) // tmStruct.tm_year += (tmStruct.tm_year<=MS_PIVOT_YEAR) ? 2000 : 1900; } _time=greenwichMeanTime(&tmStruct,GMT)-offset; } break; default: rc=MSError::MSFailure; break; } } return rc; } const char *MSTime::format(MSString *pString_) const { return format(*pString_,defaultFormat()); } const char *MSTime::format(MSString& aString_) const { return format(aString_,defaultFormat()); } const char *MSTime::format(MSString *pString_,const char *format_) const { return format(*pString_,format_); } const char *MSTime::format(MSString& aString_,const char *format_) const { #ifdef MS_THREAD_SAFE_FUNCTIONS struct tm tmp; #endif //MS_THREAD_SAFE_FUNCTIONS MSString aString(0,((format_!=0)?strlen(format_):0)+6); struct tm *pCalendarTime=MS_LOCALTIME((time_t *)&_time,&tmp); int numberOfChars; while ((numberOfChars=strftime((char*)aString.string(),aString.length(),format_,pCalendarTime))==0) { aString=MSString(0,2*aString.length()); } // // remove the terminating null from strftime. strftime returns the number of characters // produced not including the terminating null character. // aString_=MSString(aString.string(),numberOfChars); return aString_; } const char *MSTime::format(MSString& aString_,const MSFormat& aFormat_,MSTime::MSTimeZone zone_) const { return (aFormat_.formatType()==MSFormat::Time)?format(aString_,aFormat_.timeFormat(),zone_):format(aString_); } const char *MSTime::format(MSString *pString_,const MSFormat& aFormat_,MSTime::MSTimeZone zone_) const { return format(*pString_,aFormat_,zone_); } const char *MSTime::format(MSString *pString_,MSTimeFormat format_,MSTime::MSTimeZone zone_) const { return format(*pString_,format_,zone_); } const char *MSTime::format(MSString& aString_,MSTimeFormat format_,MSTime::MSTimeZone zone_) const { aString_.removeAll(); if (_time==nullTime()) aString_="0"; else { switch (format_) { case HoursMinutesSeconds: strftimeFormat(aString_,"%H:%M:%S",zone_); break; case MonthDayYear: strftimeFormat(aString_,"%m/%d/%Y",zone_); break; case HoursMinutesSecondsSlash: strftimeFormat(aString_,"%H:%M:%S %m/%d/%y",zone_); break; case HoursMinutesSecondsSlashZone: strftimeFormat(aString_,"%H:%M:%S %m/%d/%y ",zone_,MSTrue); break; case HoursMinutesSecondsSlash4: strftimeFormat(aString_,"%H:%M:%S %m/%d/%Y",zone_); break; case HoursMinutesSecondsSlash4Zone: strftimeFormat(aString_,"%H:%M:%S %m/%d/%Y ",zone_,MSTrue); break; case CalendarTime: { char buf[MSTimeBufferSize]; const char *zname; time_t t; if (zone_==Local) // can't determine DST presence for local time zone => use localtime() to find zone name and offset { #ifdef MS_THREAD_SAFE_FUNCTIONS struct tm tmp; #endif //MS_THREAD_SAFE_FUNCTIONS struct tm *pTm=MS_LOCALTIME(&_time,&tmp); zname=zoneName(pTm); t=_time+zoneOffset(pTm); } else // specific time zone => use the cached name and offset values from the time zone table { zname=TimeZones[zone_].zname; t=_time+zoneOffset(zone_); } sprintf(buf,"%d %s",t,zname); aString_=buf; break; } case Strftime: format(aString_,(const char *)strftimeDefaultFormat()); break; default: MSMessageLog::warningMessage("MSTime: invalid value of format\n"); break; } } return aString_.string(); } void MSTime::strftimeFormat(MSString& aString_,const char *format_,MSTime::MSTimeZone zone_, MSBoolean appendZoneName_) const { char buf[MSTimeBufferSize]; const char *zname; struct tm *now; #ifdef MS_THREAD_SAFE_FUNCTIONS struct tm tmp; #endif //MS_THREAD_SAFE_FUNCTIONS if (zone_==Local) // cannot determine if DST is on or not; have to use localtime() { now=MS_LOCALTIME(&_time,&tmp); zname=zoneName(now); } else // a specific, non-local time zone -> can use the cached values from the table { long src=_time+zoneOffset(zone_); now=MS_GMTIME((time_t *)&src,&tmp); zname=TimeZones[zone_].zname; } strftime(buf,sizeof(buf),format_,now); aString_=buf; if (appendZoneName_==MSTrue) { aString_+=zname; } } const char *MSTime::format(MSString *pString_,MSTimeFormat format_,const char *zone_) const { return format(*pString_,format_,zone_); } const char *MSTime::format(MSString& aString_,MSTimeFormat format_,const char *zone_) const { aString_.removeAll(); if (_time==nullTime()) aString_="0"; else { switch (format_) { case HoursMinutesSeconds: strftimeFormat(aString_,"%H:%M:%S",zone_); break; case MonthDayYear: strftimeFormat(aString_,"%m/%d/%Y",zone_); break; case HoursMinutesSecondsSlash: strftimeFormat(aString_,"%H:%M:%S %m/%d/%y",zone_); break; case HoursMinutesSecondsSlashZone: strftimeFormat(aString_,"%H:%M:%S %m/%d/%y ",zone_); aString_+=zone_; break; case HoursMinutesSecondsSlash4: strftimeFormat(aString_,"%H:%M:%S %m/%d/%Y",zone_); break; case HoursMinutesSecondsSlash4Zone: strftimeFormat(aString_,"%H:%M:%S %m/%d/%Y ",zone_); aString_+=zone_; break; case CalendarTime: { char buf[MSTimeBufferSize]; long src=_time+zoneOffset(zone_); sprintf(buf,"%d %s",src,zone_); aString_=buf; break; } case Strftime: format(aString_,(const char *)strftimeDefaultFormat()); break; default: MSMessageLog::warningMessage("MSTime: invalid value of format\n"); break; } } return aString_.string(); } void MSTime::strftimeFormat(MSString& aString_,const char *format_,const char *zone_) const { #ifdef MS_THREAD_SAFE_FUNCTIONS struct tm tmp; #endif //MS_THREAD_SAFE_FUNCTIONS char buf[MSTimeBufferSize]; long src=_time+zoneOffset(zone_); struct tm *now=MS_GMTIME((time_t *)&src,&tmp); strftime(buf,sizeof(buf),format_,now); aString_=buf; } // this uses an MSDate to set the time MSError::ErrorStatus MSTime::setNow(void) { _time = currentTime(); changed(); return MSError::MSSuccess; } unsigned long MSTime::differenceInDays(const MSTime& aTime_,MSTimeZone zone_) const { time_t t1offset=_time+zoneOffset(zone_); time_t t2offset=aTime_._time+aTime_.zoneOffset(zone_); time_t t1=(t1offset-t1offset%SECS_IN_DAY); time_t t2=(t2offset-t2offset%SECS_IN_DAY); if (t2>=t1) return (t2-t1)/SECS_IN_DAY; else return (t1-t2)/SECS_IN_DAY; } long MSTime::scanTimeZone(const char *zone_) { if (zone_==0 || *zone_=='\0') { return 0; } MSString zone(zone_); unsigned signIndex = zone.indexOfAnyOf("+-"); int adjust=0; if (signIndex format is "TZ+hh:mm" or "TZ-hh:mm" { int hours, mins; switch (sscanf(zone.string()+signIndex,"%d:%d",&hours,&mins)) { case 1: adjust=hours*SECS_IN_HOUR; break; case 2: adjust=hours*SECS_IN_HOUR+mins*SECS_IN_MIN; break; default: MSMessageLog::errorMessage("Bad time zone specification in MSTime::scanTimeZone(): \"%s\"\n",zone_); adjust=0; break; } if (zone(signIndex)=='+') { adjust=-adjust; } zone.take(signIndex); // cut off the adjustment portion, leaving only the time zone name } zone.upper(); return zoneOffset(zone)+adjust; } long MSTime::zoneOffset(const char *zoneName_) const { // This method looks for an exact match of zoneName_ to one of the time zone names in // the _zoneHashTable; thus, zoneName_ has to be in the same case (upper) and without // any adjustment portions - all this should have already been done in the calling function. // struct zoneoff *zp = (struct zoneoff *)zoneHashTable()->lookup(zoneName_); if (zp==(struct zoneoff *)zoneHashTable()->notFound()) { MSMessageLog::warningMessage("Invalid timezone: \"%s\"\n",zoneName_); return 0; } else { return zoneOffset(zp->zone); } } long MSTime::zoneOffset(time_t t_, MSTime::MSTimeZone zone_) { if (zone_==Local) // cannot properly determine if DST is on - have to call localtime() { #ifdef MS_THREAD_SAFE_FUNCTIONS struct tm tmp; #endif //MS_THREAD_SAFE_FUNCTIONS return zoneOffset(MS_LOCALTIME(&t_,&tmp)); } else { return (TimeZones[zone_].hr_off*SECS_IN_HOUR+TimeZones[zone_].mn_off*SECS_IN_MIN); } } long MSTime::zoneOffset(const struct tm *pTm_) { if (pTm_==0) { return 0; } #if !defined(MS_STRUCT_TM_TZ) if (pTm_->tm_isdst<=0) // if DST is not in effect or information is not available { return -timezone; } else // DST is in effect { #if defined(MS_NO_ALTZONE) return (-timezone+SECS_IN_HOUR); // add 1 hour to the opposite of offset #else return -altzone; #endif // MS_NO_ALTZONE } #else // MS_STRUCT_TM_TZ return pTm_->tm_gmtoff; #endif // MS_STRUCT_TM_TZ } const char *MSTime::zoneName(const struct tm *pTm_) { if (pTm_==0) { return ""; } #if !defined(MS_STRUCT_TM_TZ) if (pTm_->tm_isdst<=0) // if DST is not in effect or information is not available { return tzname[0]; } else // DST is in effect { return tzname[1]; } #else // MS_STRUCT_TM_TZ return pTm_->tm_zone; #endif // MS_STRUCT_TM_TZ } // Kind of the reverse of localtime() and gmtime() -- converts a struct tm // to time in seconds since 1970. Valid until 2038. // If the "zone" argument is present, it modifies the return value. long MSTime::greenwichMeanTime(struct tm *time_, MSTimeZone zone_) { // The following rules are used for determining the year: // // - the tm structure cannot represent any dates before 1900 or after 2038 // // - if the year is >=1900, then it's taken to be an "absolute" year - that is, it's // assumed to be represented as a full 4-digit number (e.g., 1997 or 2047) // // - if the year is <1900, then it's taken to be a "relative" year - that is, it's the // real year minus 1900; thus, 96 represents (1900+96)=1996 and 136 represents // (1900+136)=2036; of course, the valid range for a "relative" year is 0-138 // if (zone_==Local) // cannot determine if DST is on or not; have to use libc functions { if (time_->tm_year>=1900) // if the year is "absolute" (see above) { time_->tm_year-=1900; // make the year relative to 1900 so that libc functions work correctly } #if defined(MS_HAS_MKTIME) || defined(HAVE_MKTIME) time_t t=mktime(time_); // mktime() assumes that the tm structure it gets is relative to the local time zone #else time_t t=timelocal(time_); #endif //MS_HAS_MKTIME return (t<0) ? 0 : t; } long julian, year; if (time_->tm_year<1900) // if the year is "relative" to 1900 { year=time_->tm_year+1900; } else // if the year is absolute, i.e., represented by all 4 digits { year=time_->tm_year; } julian=365*(year-1970)+(int)((year-1970+1)/4)+mtbl[time_->tm_mon]+time_->tm_mday-1; // time_->tm_yday might not be valid if (time_->tm_mon>1&&year%4==0&&(year%100!=0||year%400==0)) julian++; // convert to seconds julian*=SECS_IN_DAY; julian+=(time_->tm_hour*SECS_IN_MIN+time_->tm_min)*SECS_IN_MIN+time_->tm_sec; return julian-zoneOffset(julian,zone_); } MSTime::MSTimeZone MSTime::setLocalTimeZone(void) { // // There is a possibility that the local time zone returned by localtime() is not in our TimeZones table // and, correspondingly, not in the _zoneHashTable. Then we have to add it to both tables so that we are // able to use the local time zone, even though we haven't accounted for it originally. // static char buf[MSTimeBufferSize]; struct zoneoff *zp=&TimeZones[Local]; // zoneoff structure for the local time zone #ifdef MS_THREAD_SAFE_FUNCTIONS struct tm tmp; #endif //MS_THREAD_SAFE_FUNCTIONS time_t now; (void)time(&now); struct tm *pTime=MS_LOCALTIME(&now,&tmp); long gmtoff = zoneOffset(pTime); strcpy(buf,zoneName(pTime)); zp->hr_off=gmtoff/SECS_IN_HOUR; zp->mn_off=(gmtoff%SECS_IN_HOUR)/SECS_IN_MIN; zp->zname=buf; if (zoneHashTable()->lookup(buf)==(void *)zoneHashTable()->notFound()) // if local zone is not in the table yet { zoneHashTable()->add(buf,(void *)zp); // add it to the hash table } return zp->zone; } time_t MSTime::currentTime(void) { static int checked=0; static int override=0; static MSDate date; time_t timeNow; if (checked++==0) { char *ep=getenv("TB_DATE_OVERRIDE"); if (ep!=0) { date.setToday(); override=1; } } (void)time(&timeNow); if (override) { #ifdef MS_THREAD_SAFE_FUNCTIONS struct tm tmp; #endif //MS_THREAD_SAFE_FUNCTIONS struct tm *pTmStruct; pTmStruct=MS_LOCALTIME(&timeNow,&tmp); pTmStruct->tm_mday=date.dayOfMonth(); pTmStruct->tm_mon=date.month()-1; pTmStruct->tm_year=date.year(); // we don't need to subtract 1900, since greenwichMeanTime() will handle that // // We have to call greenwichMeanTime() with Local (instead of trying to find out the zone offset from pTmStruct) // because the current time and the override date may be on different sides of daylight savings "barrier". // return greenwichMeanTime(pTmStruct,Local); } else { return timeNow; } } MSTime MSTime::operator+(long seconds_) const { return MSTime(_time+seconds_); } MSTime MSTime::operator-(long seconds_) const { return MSTime(_time-seconds_); } MSTime operator+(long seconds_,const MSTime &aTime_) { return MSTime(aTime_._time+seconds_); } // This is an internal method that returns the unix time // of the given MSDate offset by the hours, minutes, // and seconds of this object. time_t MSTime::convertDate(const MSDate& aDate_) const { #ifdef MS_THREAD_SAFE_FUNCTIONS struct tm tmp; #endif //MS_THREAD_SAFE_FUNCTIONS time_t t=aDate_.asCalendarTime(); struct tm *pTimeStruct=MS_LOCALTIME(&_time,&tmp); unsigned long s=pTimeStruct->tm_sec; unsigned long m=pTimeStruct->tm_min*SECS_IN_MIN; unsigned long h=pTimeStruct->tm_hour*SECS_IN_HOUR; return t+s+m+h; } MSTime MSTime::operator+(const MSTerm& aTerm_) const { MSDate d(*this); d+=aTerm_; return MSTime(convertDate(d)); } MSTime operator+(const MSTerm& aTerm_,const MSTime &aTime_) { MSDate d(aTime_); d+=aTerm_; return MSTime(aTime_.convertDate(d)); } MSTime& MSTime::operator+=(const MSTerm& aTerm_) { MSDate d(*this); d+=aTerm_; _time=convertDate(d); return changed(),*this; } MSTime MSTime::operator-(const MSTerm& aTerm_) const { MSDate d(*this); d-=aTerm_; return MSTime(convertDate(d)); } MSTime& MSTime::operator-=(const MSTerm& aTerm_) { MSDate d(*this); d-=aTerm_; _time=convertDate(d); return changed(),*this; } MSHashTable *MSTime::initZoneHashTable(void) { MSHashTable *ht=new MSHashTable(64); ht->notFound(0x0); for (int i=0;TimeZones[i].zname!=0;i++) ht->add(TimeZones[i].zname,(void *)&TimeZones[i]); return ht; } ostream& operator<<(ostream& os_,const MSTime& aTime_) { MSString s; return os_< #if defined(MSTK_MANUAL_INSTANTIATION) #include #if defined(MS_XLC_TEMPLATE_INSTANTIATION) #pragma define (MSTypeVector) #endif #if defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma instantiate MSBaseVector > #pragma instantiate MSObjectVector #pragma instantiate MSTypeVector #if !defined (MS_TEMPLATE_MANUAL_FRIEND_BUG) // The version of EDG used by SGI's dcc compiler has a bug related to access from friends #pragma instantiate ostream & operator<< (ostream &, const MSBaseVector > &) #endif // MS_TEMPLATE_MANUAL_FRIEND_BUG #endif // MS_EDG_TEMPLATE_INSTANTIATION #if defined(MS_VC_TEMPLATE_INSTANTIATION) template MSBaseVector >; template MSBaseVectorOps >; template MSObjectVector; template MSTypeVector; // instantiate non-inline friend template functions static int __dummy01__() { if (0) operator<<(cout, MSBaseVector >()); return 0; } static int __dummyInt01__=__dummy01__(); #endif //MS_VC_TEMPLATE_INSTANTIATION #if defined(MS_STD_TEMPLATE_INSTANTIATION) template class MSBaseVector >; template class MSBaseVectorOps >; template class MSObjectVector; template class MSTypeVector; template ostream& operator<<(ostream&,const MSBaseVector >&); #endif #endif // MSTK_MANUAL_INSTANTIATION aplus-fsf-4.22/src/MSTypes/MSUnsigned.C0000644000265000001440000001723210772770452013311 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #if HAVE_IOSTREAM #include #else #include #endif #include #include ostream& operator<<(ostream& aStream_,const MSUnsigned& aUnsigned_) { return aStream_<>(istream& aStream_,MSUnsigned& aUnsigned_) { unsigned i; aStream_>>i; aUnsigned_=i; return aStream_; } #ifdef MS_NO_INLINES #include #endif MSString MSUnsigned::asString(void) const { return MSString(_unsigned); } MSString MSUnsigned::asDebugInfo(void) const { MSString result("MSUnsigned(@"); result+=MSString((unsigned long)this).d2x().lowerCase(); result+=",_unsigned="; result+=MSString(_unsigned); result+=",_isSet="; result+=(isSet()==MSTrue)?"MSTrue":"MSFalse"; result+=",_type="; result+=type().symbolName(); result+=")"; return MSString(result); } MSString MSUnsigned::className(void) const { return MSString("MSUnsigned"); } const MSSymbol& MSUnsigned::type(void) const { return symbol(); } MSModel *MSUnsigned::clone(void) const { return new MSUnsigned(*this); } MSModel *MSUnsigned::create(void) const { return new MSUnsigned(); } void MSUnsigned::assign(const MSModel& aModel_) { *this=(MSUnsigned&)aModel_; } long MSUnsigned::compare(const MSModel& aModel_) const { return ::compare(*this,(MSUnsigned&)aModel_); } MSString MSUnsigned::asMSF(void) const { if (isSet()==MSTrue) return MSString(_unsigned); return MSString(); } MSError::ErrorStatus MSUnsigned::setFromMSF(const char *pString_) { int code; if (pString_!=0) code=set(pString_); else code=MSError::BadMSFString; return (MSError::ErrorStatus)code; } const MSSymbol& MSUnsigned::symbol(void) { static MSSymbol sym ("MSUnsigned"); return sym; } void MSUnsigned::unset(void) { if (isSet()==MSTrue) { _unsigned=0,_isSet=MSFalse; changed(); } } MSError::ErrorStatus MSUnsigned::set(const MSString& aString_) { MSError::ErrorStatus code=MSError::MSSuccess; _unsigned=0,_isSet=MSTrue; MSString aString=aString_; unsigned index=aString.indexOf(','); while (indexMSUnsigned::MaximumLength) code=MSError::IntTooBig; if (code==MSError::MSSuccess) { if (sscanf(aString.string(),"%u",&_unsigned) != 1) _unsigned=0,code=MSError::BadInt; else if (_unsigned == 0) // could be the result of overflow in scanf { for (int n=slen-1;n>=0;n--) if (aString(n)>='1'&&aString(n)<='9') // result > 0 _unsigned=0,code=MSError::BadInt; // -> overflow } } } return changed(),code; } MSError::ErrorStatus MSUnsigned::set(const char *pString_) { return set(MSString(pString_)); } MSError::ErrorStatus MSUnsigned::set(const MSString *pString_) { return set(*pString_);} MSError::ErrorStatus MSUnsigned::set(unsigned i_) { _unsigned=i_; _isSet=MSTrue; return changed(),MSError::MSSuccess; } const char *MSUnsigned::format(MSString *pString_) const { return format(*pString_,MSInt::WithoutCommas); } const char *MSUnsigned::format(MSString& aString_) const { return format(aString_,MSInt::WithoutCommas); } const char *MSUnsigned::format(MSString& aString_,const MSFormat& aFormat_) const { return (aFormat_.formatType()==MSFormat::Int)? formatUnsigned(aString_,aFormat_.intFormat(),aFormat_.formatModifier(),_unsigned):format(aString_,MSInt::WithoutCommas); } const char *MSUnsigned::format(MSString *pString_,const MSFormat& aFormat_) const { return format(*pString_,aFormat_); } // MSUtil::comma is too inefficient, and one reason is becuase it does useful // checking to avoid writing past the end of a string (another reason may // be that it doesn't use "register" storage). We need as efficient // a function as possible, otherwise we will spend more time here than // anywhere else. addCommas runs in about 1/100 of the time of MSUtil::comma. // Plan on having enough space in outBuffer_. static void addCommas(register char *inBuffer_,register char *outBuffer_) { // addCommas takes the number string in inBuffer_ and copies it to // outBuffer_,adding commas between the first character and the end // point according to American convention. // ignore leading minus sign if (*inBuffer_=='-') *outBuffer_++=*inBuffer_++; register int places=strlen(inBuffer_); // number of digits to the left of the decimal point register char *cp=inBuffer_+places; // pointer to the end register int remainder=((places-1)%3)+1; // copy 1 to 3 digits before the first comma. while (remainder-->0) *outBuffer_++=*inBuffer_++; // copy a comma and 3 digits until we format to the end. while (inBuffer_3) { char outBuffer[32]; addCommas(buf,outBuffer); aString_=outBuffer; } else aString_=buf; if (modifierChar!='\0') aString_< #endif #ifndef MSTypeMatrixHEADER #include #endif #ifndef MSTypeDataHEADER #include #endif #if defined(MSTK_MANUAL_INSTANTIATION) #include #include #if defined(MS_XLC_TEMPLATE_INSTANTIATION) #pragma define (MSTypeMatrix) #endif #if defined(MS_VC_TEMPLATE_INSTANTIATION) template MSTypeMatrix; #endif #if defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma instantiate MSTypeMatrix #pragma instantiate MSMatrixSTypePick #if !defined (MS_TEMPLATE_MANUAL_FRIEND_BUG) // The version of EDG used by SGI's dcc compiler has a bug related to access from friends #pragma instantiate ostream& operator<<(ostream&,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix operator-(const MSTypeMatrix&) #pragma instantiate MSTypeMatrix operator+(const MSTypeMatrix&,unsigned long) #pragma instantiate MSTypeMatrix operator+(unsigned long,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix operator+(const MSTypeMatrix&, \ const MSTypeMatrix&) #pragma instantiate MSTypeMatrix operator-(const MSTypeMatrix&,unsigned long) #pragma instantiate MSTypeMatrix operator-(const MSTypeMatrix&, \ const MSTypeMatrix&) #pragma instantiate MSTypeMatrix operator*(const MSTypeMatrix&,unsigned long) #pragma instantiate MSTypeMatrix operator*(unsigned long,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix operator*(const MSTypeMatrix&, \ const MSTypeMatrix&) #pragma instantiate MSTypeMatrix operator/(const MSTypeMatrix&,unsigned long) #pragma instantiate MSTypeMatrix operator/(const MSTypeMatrix&, \ const MSTypeMatrix&) #pragma instantiate MSTypeMatrix operator+(const MSTypeMatrix&, \ const MSTypeVector&) #pragma instantiate MSTypeMatrix operator-(const MSTypeMatrix&, \ const MSTypeVector&) #pragma instantiate MSTypeMatrix operator*(const MSTypeMatrix&, \ const MSTypeVector&) #pragma instantiate MSTypeMatrix operator/(const MSTypeMatrix&, \ const MSTypeVector&) #pragma instantiate MSTypeMatrix operator+(const MSTypeVector&, \ const MSTypeMatrix&) #pragma instantiate MSTypeMatrix operator*(const MSTypeVector&, \ const MSTypeMatrix&) #pragma instantiate MSTypeMatrix multiply(const MSTypeMatrix&,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix stack(const MSTypeMatrix&,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix adjoin(const MSTypeMatrix&,const MSTypeMatrix&) #endif // !MS_TEMPLATE_MANUAL_FRIEND_BUG #endif // MS_EDG_TEMPLATE_INSTANTIATION #if defined(MS_STD_TEMPLATE_INSTANTIATION) template class MSTypeMatrix; template class MSMatrixSTypePick; template ostream& operator<<(ostream&,const MSTypeMatrix&); template MSTypeMatrix operator-(const MSTypeMatrix&); template MSTypeMatrix operator+(const MSTypeMatrix&,unsigned long); template MSTypeMatrix operator+(unsigned long,const MSTypeMatrix&); template MSTypeMatrix operator+(const MSTypeMatrix&,const MSTypeMatrix&); template MSTypeMatrix operator-(const MSTypeMatrix&,unsigned long); template MSTypeMatrix operator-(const MSTypeMatrix&,const MSTypeMatrix&); template MSTypeMatrix operator*(const MSTypeMatrix&,unsigned long); template MSTypeMatrix operator*(unsigned long,const MSTypeMatrix&); template MSTypeMatrix operator*(const MSTypeMatrix&,const MSTypeMatrix&); template MSTypeMatrix operator/(const MSTypeMatrix&,unsigned long); template MSTypeMatrix operator/(const MSTypeMatrix&,const MSTypeMatrix&); template MSTypeMatrix operator+(const MSTypeMatrix&,const MSTypeVector&); template MSTypeMatrix operator-(const MSTypeMatrix&,const MSTypeVector&); template MSTypeMatrix operator*(const MSTypeMatrix&,const MSTypeVector&); template MSTypeMatrix operator/(const MSTypeMatrix&,const MSTypeVector&); template MSTypeMatrix operator+(const MSTypeVector&,const MSTypeMatrix&); template MSTypeMatrix operator*(const MSTypeVector&,const MSTypeMatrix&); template MSTypeMatrix multiply(const MSTypeMatrix&,const MSTypeMatrix&); template MSTypeMatrix stack(const MSTypeMatrix&,const MSTypeMatrix&); template MSTypeMatrix adjoin(const MSTypeMatrix&,const MSTypeMatrix&); #endif // MS_STD_TEMPLATE_INSTANTIATION #endif // MSTK_MANUAL_INSTANTIATION aplus-fsf-4.22/src/MSTypes/MSUnsignedLongVector.C0000644000265000001440000001216210772770452015311 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #if defined(MS_FORCE_INTERNAL_TEMPLATE_INSTANTIATION) #define MS_MSUnsignedLongVector_INSTANTIATE #define MSTK_MANUAL_INSTANTIATION #endif #include #ifdef MS_NO_INLINES #include #endif // MS_NO_INLINES #if defined(MSTK_MANUAL_INSTANTIATION) #include #include #if defined(MS_XLC_TEMPLATE_INSTANTIATION) #pragma define (MSTypeVector) #endif #if defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma instantiate MSBaseVector > #pragma instantiate MSBuiltinVector #pragma instantiate MSBuiltinSPick #if !defined (MS_TEMPLATE_MANUAL_FRIEND_BUG) // The version of EDG used by SGI's dcc compiler has a bug related to access from friends #pragma instantiate ostream & operator<<(ostream&, const MSBaseVector >&) #endif // MS_TEMPLATE_MANUAL_FRIEND_BUG #endif // MS_EDG_TEMPLATE_INSTANTIATION #if defined(MS_VC_TEMPLATE_INSTANTIATION) template MSBaseVector >; template MSBaseVectorOps >; template MSBuiltinVector; template MSBuiltinVectorOps; template MSBuiltinSPick; static int __instantiateFriends__() // instantiate non-inline friend template functions { if (0) { MSBuiltinVector dummy; operator<<(cout, dummy); } return 0; } static int __dummyInt__=__instantiateFriends__(); #endif // MS_VC_TEMPLATE_INSTANTIATION #if defined(MS_STD_TEMPLATE_INSTANTIATION) template class MSBaseVector >; template class MSBaseVectorOps >; template class MSBuiltinVector; template class MSBuiltinVectorOps; template class MSBuiltinSPick; template ostream & operator<<(ostream&, const MSBaseVector >&); #endif #endif // MSTK_MANUAL_INSTANTIATION MSTypeVector::MSTypeVector() : BuiltinVectorUnsignedLong() { } MSTypeVector::MSTypeVector (unsigned int length_) : BuiltinVectorUnsignedLong (length_) { } MSTypeVector::MSTypeVector (unsigned int length_, const unsigned long & filler_) : BuiltinVectorUnsignedLong (length_, filler_) { } MSTypeVector::MSTypeVector (const MSTypeVector & vect_) : BuiltinVectorUnsignedLong (vect_) { } MSTypeVector::MSTypeVector (const BuiltinVectorUnsignedLong & vect_) : BuiltinVectorUnsignedLong (vect_) { } MSTypeVector::MSTypeVector (const BaseVectorUnsignedLong & vect_) : BuiltinVectorUnsignedLong ((BuiltinVectorUnsignedLong &)vect_) { } MSTypeVector::MSTypeVector (const char *pString_) : BuiltinVectorUnsignedLong (pString_) { } MSTypeVector::MSTypeVector (MSTypeData > *pData_, unsigned int len_) : BuiltinVectorUnsignedLong (pData_, len_) { } MSTypeVector::MSTypeVector (const unsigned long *pElements_, unsigned int len_) : BuiltinVectorUnsignedLong (pElements_, len_) { } MSTypeVector::~MSTypeVector() { } MSTypeVector & MSTypeVector::operator= (const MSTypeVector & vect_) { return (MSTypeVector &) BuiltinVectorUnsignedLong::operator= (vect_); } MSTypeVector & MSTypeVector::operator= (const BuiltinVectorUnsignedLong & vect_) { return (*this = (MSTypeVector &)vect_); } MSTypeVector & MSTypeVector::operator= (const BaseVectorUnsignedLong & vect_) { return (*this = (MSTypeVector &)vect_); } MSTypeVector & MSTypeVector::operator= (const unsigned long & value_) { return (MSTypeVector &) BuiltinVectorUnsignedLong::operator= (value_); } MSTypeVector & MSTypeVector::operator= (const char *pString_) { return (*this = MSTypeVector(pString_)); // return (MSTypeVector &) BuiltinVectorUnsignedLong::operator= (pString_); } MSString MSTypeVector::className() const { return MSString ("MSTypeVector"); } const MSSymbol & MSTypeVector::type() const { return symbol(); } MSModel * MSTypeVector::clone() const { return new MSTypeVector (*this); } MSModel * MSTypeVector::create() const { return new MSTypeVector; } const MSSymbol & MSTypeVector::symbol() { static MSSymbol sym ("MSTypeVector"); return sym; } aplus-fsf-4.22/src/MSTypes/MSUnsignedMatrix.C0000644000265000001440000001250310772770452014472 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MSTypeMatrixHEADER #include #endif #ifndef MSTypeDataHEADER #include #endif #if defined(MSTK_MANUAL_INSTANTIATION) #include #include #if defined(MS_XLC_TEMPLATE_INSTANTIATION) #pragma define (MSTypeMatrix) #endif #if defined(MS_VC_TEMPLATE_INSTANTIATION) template MSTypeMatrix; #endif #if defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma instantiate MSTypeMatrix #pragma instantiate MSMatrixSTypePick #if !defined (MS_TEMPLATE_MANUAL_FRIEND_BUG) // The version of EDG used by SGI's dcc compiler has a bug related to access from friends #pragma instantiate ostream& operator<<(ostream&,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix operator-(const MSTypeMatrix&) #pragma instantiate MSTypeMatrix operator+(const MSTypeMatrix&,unsigned) #pragma instantiate MSTypeMatrix operator+(unsigned,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix operator+(const MSTypeMatrix&,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix operator-(const MSTypeMatrix&,unsigned) #pragma instantiate MSTypeMatrix operator-(const MSTypeMatrix&,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix operator*(const MSTypeMatrix&,unsigned) #pragma instantiate MSTypeMatrix operator*(unsigned,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix operator*(const MSTypeMatrix&,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix operator/(const MSTypeMatrix&,unsigned) #pragma instantiate MSTypeMatrix operator/(const MSTypeMatrix&,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix operator+(const MSTypeMatrix&,const MSTypeVector&) #pragma instantiate MSTypeMatrix operator-(const MSTypeMatrix&,const MSTypeVector&) #pragma instantiate MSTypeMatrix operator*(const MSTypeMatrix&,const MSTypeVector&) #pragma instantiate MSTypeMatrix operator/(const MSTypeMatrix&,const MSTypeVector&) #pragma instantiate MSTypeMatrix operator+(const MSTypeVector&,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix operator*(const MSTypeVector&,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix multiply(const MSTypeMatrix&,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix stack(const MSTypeMatrix&,const MSTypeMatrix&) #pragma instantiate MSTypeMatrix adjoin(const MSTypeMatrix&,const MSTypeMatrix&) #endif // !MS_TEMPLATE_MANUAL_FRIEND_BUG #endif // MS_EDG_TEMPLATE_INSTANTIATION #if defined(MS_STD_TEMPLATE_INSTANTIATION) template class MSTypeMatrix; template class MSMatrixSTypePick; template ostream& operator<<(ostream&,const MSTypeMatrix&); template MSTypeMatrix operator-(const MSTypeMatrix&); template MSTypeMatrix operator+(const MSTypeMatrix&,unsigned); template MSTypeMatrix operator+(unsigned,const MSTypeMatrix&); template MSTypeMatrix operator+(const MSTypeMatrix&,const MSTypeMatrix&); template MSTypeMatrix operator-(const MSTypeMatrix&,unsigned); template MSTypeMatrix operator-(const MSTypeMatrix&,const MSTypeMatrix&); template MSTypeMatrix operator*(const MSTypeMatrix&,unsigned); template MSTypeMatrix operator*(unsigned,const MSTypeMatrix&); template MSTypeMatrix operator*(const MSTypeMatrix&,const MSTypeMatrix&); template MSTypeMatrix operator/(const MSTypeMatrix&,unsigned); template MSTypeMatrix operator/(const MSTypeMatrix&,const MSTypeMatrix&); template MSTypeMatrix operator+(const MSTypeMatrix&,const MSTypeVector&); template MSTypeMatrix operator-(const MSTypeMatrix&,const MSTypeVector&); template MSTypeMatrix operator*(const MSTypeMatrix&,const MSTypeVector&); template MSTypeMatrix operator/(const MSTypeMatrix&,const MSTypeVector&); template MSTypeMatrix operator+(const MSTypeVector&,const MSTypeMatrix&); template MSTypeMatrix operator*(const MSTypeVector&,const MSTypeMatrix&); template MSTypeMatrix multiply(const MSTypeMatrix&,const MSTypeMatrix&); template MSTypeMatrix stack(const MSTypeMatrix&,const MSTypeMatrix&); template MSTypeMatrix adjoin(const MSTypeMatrix&,const MSTypeMatrix&); #endif // MS_STD_TEMPLATE_INSTANTIATION #endif // MSTK_MANUAL_INSTANTIATION aplus-fsf-4.22/src/MSTypes/MSUnsignedVector.C0000644000265000001440000001170110772770452014467 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #if defined(MS_FORCE_INTERNAL_TEMPLATE_INSTANTIATION) #define MS_MSUnsignedVector_INSTANTIATE #define MSTK_MANUAL_INSTANTIATION #endif #include #ifdef MS_NO_INLINES #include #endif //MS_NO_INLINES #if defined(MSTK_MANUAL_INSTANTIATION) #include #include #if defined(MS_XLC_TEMPLATE_INSTANTIATION) #pragma define (MSTypeVector) #endif #if defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma instantiate MSBaseVector > #pragma instantiate MSBuiltinVector #pragma instantiate MSBuiltinSPick #if !defined (MS_TEMPLATE_MANUAL_FRIEND_BUG) // The version of EDG used by SGI's dcc compiler has a bug related to access from friends #pragma instantiate ostream & operator<<(ostream&, const MSBaseVector >&) #endif // MS_TEMPLATE_MANUAL_FRIEND_BUG #endif // MS_EDG_TEMPLATE_INSTANTIATION #if defined(MS_VC_TEMPLATE_INSTANTIATION) template MSBaseVector >; template MSBaseVectorOps >; template MSBuiltinVector; template MSBuiltinVectorOps; template MSBuiltinSPick; static int __instantiateFriends__() // instantiate non-inline friend template functions { if (0) { MSBuiltinVector dummy; operator<<(cout, dummy); } return 0; } static int __dummyInt__=__instantiateFriends__(); #endif // MS_VC_TEMPLATE_INSTANTIATION #if defined(MS_STD_TEMPLATE_INSTANTIATION) template class MSBaseVector >; template class MSBaseVectorOps >; template class MSBuiltinVector; template class MSBuiltinVectorOps; template class MSBuiltinSPick; template ostream & operator<<(ostream&, const MSBaseVector >&); #endif #endif // MSTK_MANUAL_INSTANTIATION MSTypeVector::MSTypeVector() : BuiltinVectorUnsigned() { } MSTypeVector::MSTypeVector (unsigned int length_) : BuiltinVectorUnsigned (length_) { } MSTypeVector::MSTypeVector (unsigned int length_, const unsigned int filler_) : BuiltinVectorUnsigned (length_, filler_) { } MSTypeVector::MSTypeVector (const MSTypeVector & vect_) : BuiltinVectorUnsigned (vect_) { } MSTypeVector::MSTypeVector (const BuiltinVectorUnsigned & vect_) : BuiltinVectorUnsigned (vect_) { } MSTypeVector::MSTypeVector (const BaseVectorUnsigned & vect_) : BuiltinVectorUnsigned ((BuiltinVectorUnsigned &)vect_) { } MSTypeVector::MSTypeVector (const char *pString_) : BuiltinVectorUnsigned (pString_) { } MSTypeVector::MSTypeVector (MSTypeData > *pData_, unsigned int len_) : BuiltinVectorUnsigned (pData_, len_) { } MSTypeVector::MSTypeVector (const unsigned int *pElements_, unsigned int len_) : BuiltinVectorUnsigned (pElements_, len_) { } MSTypeVector::~MSTypeVector() { } MSTypeVector & MSTypeVector::operator= (const MSTypeVector & vect_) { return (MSTypeVector &) BuiltinVectorUnsigned::operator= (vect_); } MSTypeVector & MSTypeVector::operator= (const BuiltinVectorUnsigned & vect_) { return (*this = (MSTypeVector &)vect_); } MSTypeVector & MSTypeVector::operator= (const BaseVectorUnsigned & vect_) { return (*this = (MSTypeVector &)vect_); } MSTypeVector & MSTypeVector::operator= (const unsigned int & value_) { return (MSTypeVector &) BuiltinVectorUnsigned::operator= (value_); } MSTypeVector & MSTypeVector::operator= (const char *pString_) { return (*this = MSTypeVector(pString_)); // return (MSTypeVector &) BuiltinVectorUnsigned::operator= (pString_); } MSString MSTypeVector::className() const { return MSString ("MSTypeVector"); } const MSSymbol & MSTypeVector::type() const { return symbol(); } MSModel * MSTypeVector::clone() const { return new MSTypeVector (*this); } MSModel * MSTypeVector::create() const { return new MSTypeVector; } const MSSymbol & MSTypeVector::symbol() { static MSSymbol sym ("MSTypeVector"); return sym; } aplus-fsf-4.22/src/MSTypes/MSUtil.C0000644000265000001440000000366610772770452012460 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include int aplus_isspace(int c) { return isspace(c); } // if a string contains any alphabetic characters return true // otherwise, return false MSBoolean MSUtil::hasAlpha(register const char *s_) { if(*s_=='\0') return MSFalse; for(;*s_!='\0';s_++) if(isalpha(*s_)) return MSTrue; return MSFalse; } void MSUtil::comma(const char *fromBuffer_,char *toBuffer_,int size_) { int places,len,i,j; char *cp; if ((cp=strchr(fromBuffer_,'.'))!=NULL) { places=cp-fromBuffer_; for (i=0,j=0,len=strlen(fromBuffer_); j<=len&&i<(size_-1); j++,i++) { // move the digits from left to right if (places>0&&(places%3)==0&&j>0&&(fromBuffer_[j-1]!='-')) { toBuffer_[i]=','; i++; if (i>=(size_-1)) { continue; } } toBuffer_[i]=fromBuffer_[j]; places--; } } else { strncpy(toBuffer_,fromBuffer_,size_); } } // remove all instances of character c from string s void MSUtil::remove(register char *s_,register int c_) { register char *t; for (t=s_;*t;t++) { if (*t!=c_) *s_++=*t; } *s_='\0'; return; } // if the null-terminated string is not the null string and contains only // space characters return true, otherwise return false MSBoolean MSUtil::isSpace(register const char *s_) { if(*s_=='\0') return MSFalse; for(;*s_;s_++) if(*s_!=' ') return MSFalse; return MSTrue; } // if the null-terminated string contains only digits return true // else return false MSBoolean MSUtil::isNumeric(register const char *s_) { for(;*s_!='\0';s_++) if(!isascii(*s_)||!isdigit(*s_)) return MSFalse; return MSTrue; } aplus-fsf-4.22/src/MSTypes/MSVector.C0000644000265000001440000000167610772770453013005 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include MSVector::MSVector() {} MSVector::~MSVector() {} unsigned int MSVector::getLength() const { return 0; } MSIndexVector MSVector::gradeUp(void) const { return MSIndexVector(); } MSIndexVector MSVector::gradeDown(void) const { return MSIndexVector(); } void MSVector::permute(const MSIndexVector&) {} void MSVector::processAppendUpdate (unsigned length_, unsigned numAppended_) { // optimize for length 1 append, most common case if (numAppended_==1) changed(length_-1); else { MSIndexVector index(numAppended_); changed(index.series(numAppended_,length_-numAppended_)); } } aplus-fsf-4.22/src/MSTypes/MSVectorImpl.C0000644000265000001440000014136310772770453013625 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #if HAVE_IOSTREAM #include #else #include #endif #include #include #include #include #include MSVectorImpl::MSVectorImpl (MSVectorImplOps *pOperations_, unsigned int length_) : _pOperations(pOperations_), _len(length_), _pElements(pOperations_->allocate(length_, length_)) { } MSVectorImpl::MSVectorImpl (MSVectorImplOps *pOps_, unsigned int length_, void *pFiller_) : _pOperations(pOps_), _len(length_), _pElements(pOps_->allocate(length_)) { _pOperations->fill (_pElements, 0, _len, pFiller_, MSRaw); } MSVectorImpl::MSVectorImpl (const MSVectorImpl & vImpl_) : _pOperations(vImpl_._pOperations), _len(vImpl_._len), _pElements(vImpl_._pElements) { _pOperations->incrementCount (_pElements); } MSVectorImpl::MSVectorImpl (MSVectorImplOps *pOps_, void *pData_, unsigned int len_) : _pOperations(pOps_), _len(len_), _pElements(pData_) { } MSVectorImpl::~MSVectorImpl() { _pOperations->deallocate (_pElements, _len); } MSVectorImpl *MSVectorImpl::create (unsigned int len_, unsigned int size_) const { if (size_) return new MSVectorImpl (_pOperations, _pOperations->allocateWithSize (size_, len_), len_); else return new MSVectorImpl (_pOperations, len_); } MSVectorImpl *MSVectorImpl::clone() const { return new MSVectorImpl (*this); } void MSVectorImpl::indexError (unsigned int index_) const { MSMessageLog::errorMessage("MSVectorImpl Index Error: index %d\tlength %d\n",index_, _len ); } unsigned int MSVectorImpl::minSize() { static unsigned int size = 8; return size; } void *MSVectorImpl::reallocate (unsigned int newLen_) { unsigned int size = _pOperations->size (_pElements); unsigned int min_size = minSize(); if (newLen_ > size || _pOperations->refCount (_pElements) > 1 || (newLen_min_size)) return (newLen_ <= min_size) ? _pOperations->allocateWithSize (min_size) : _pOperations->allocate (newLen_); else return _pElements; } void MSVectorImpl::reallocateAndCopy(unsigned int newLen_) { void *pNewElements=reallocate(newLen_); if (pNewElements!=_pElements) // if reallocation took place { _pOperations->copy(_pElements,pNewElements,_len,0,0,MSRaw); _pOperations->deallocate(_pElements,_len); _pElements=pNewElements; } } void MSVectorImpl::blockLeft (unsigned int start_, unsigned int width_, unsigned int moveCount_) { // ASSERTION: the move is within bounds unsigned int target = start_ - moveCount_; _pOperations->copy (_pElements, _pElements, width_, start_, target); } void MSVectorImpl::blockRight (unsigned int start_, unsigned int width_, unsigned int moveCount_) { // *** ASSERTION ***: the move is within bounds // if (width_==0 || moveCount_==0) { return; } unsigned int end = start_ + width_; unsigned int targetEnd = end + moveCount_; if (targetEnd>_len) // if we have to construct some elements on the end { // find how many elements need to be constructed unsigned int numToConstruct = (start_+moveCount_<_len) ? targetEnd-_len : width_; // construct those elements with the copy constructor _pOperations->copy (_pElements, _pElements, numToConstruct, end-numToConstruct, targetEnd-numToConstruct, MSRaw); // copy the rest of the elements _pOperations->copyBackward (_pElements, end-numToConstruct-1, targetEnd-numToConstruct-1, width_-numToConstruct); } else // if no element construction is necessary { _pOperations->copyBackward (_pElements, end-1, targetEnd-1, width_); } } void MSVectorImpl::prepareToChangeWithoutCopy() { if (_pOperations->refCount (_pElements) > 1) { _pOperations->deallocate (_pElements); _pElements = _pOperations->allocateWithSize (_pOperations->size (_pElements)); } } void MSVectorImpl::reallocateInPlace(unsigned int length_) { void *pNewData = reallocate (length_); if (pNewData != _pElements) { _pOperations->deallocate (_pElements); _pElements = pNewData; } _len = length_; } void MSVectorImpl::makeUniqueCopy() { void *newData = _pOperations->allocate (_len); _pOperations->copy (_pElements, newData, _len, 0, 0, MSRaw); _pOperations->deallocate (_pElements, _len); _pElements = newData; } MSVectorImpl & MSVectorImpl::operator= (const MSVectorImpl & vectImpl_) { if (this != &vectImpl_) { _pOperations->deallocate (_pElements, _len); // decrement reference count on the current data _pElements = vectImpl_._pElements; _pOperations->incrementCount (_pElements); // increment reference count on the new data _len = vectImpl_._len; } return *this; } MSString MSVectorImpl::asString (const char separator_) { MSString result; if (_len) { if (separator_) { for (unsigned int i=0;;) { // _len is at least 1 result << _pOperations->asString (_pElements, i++); if (i < _len) result << separator_; else break; } } else // we don't wont any separators between the elements { for (unsigned int i=0; i<_len; ++i) result << _pOperations->asString (_pElements, i); } } return result; } MSString MSVectorImpl::asMSF() { MSString result; result << MSMSF_US << MSString (_len); for (unsigned int i=0; i<_len; i++) result << MSMSF_US << _pOperations->asMSF (_pElements, i); return result; } MSError::ErrorStatus MSVectorImpl::setFromString (const char *pString_, const char delimiter_) { MSError::ErrorStatus rc = MSError::MSSuccess; _pOperations->deallocate (_pElements, _len); _len = 0; if (pString_) { _pElements = _pOperations->allocate (0); // here it's almost a no-op simply returning the null VectorData if (! append (pString_, delimiter_)) rc = MSError::MSFailure; } else // if pString is NULL _pElements = _pOperations->allocate (0); return rc; } MSError::ErrorStatus MSVectorImpl::setFromMSF (const char *pString_) { MSError::ErrorStatus rc; unsigned int i; unsigned int startpos; unsigned int value; char *pstring; const char *pcurrent; if (pString_ && (*pString_ == MSMSF_US) && (strlen (pString_) > sizeof(MSMSF_US))) { rc = MSError::MSSuccess; _pOperations->deallocate (_pElements, _len); _len = 0; MSString decode (pString_); unsigned int slen = decode.length(); startpos = sizeof(MSMSF_US); pcurrent = (const char *)decode.string()+startpos; // first get the size of the array....it the first element in the string then point to the beginning of the data // value = 0; if (isdigit (*pcurrent)) { value = strtoul (pcurrent, &pstring, 10); if (*pstring != '\0') startpos = decode.indexOf (MSMSF_US, startpos); else { value = 0; rc = MSError::BadMSFString; } } // needs to handle two cases as single MSMSF_US between vector elements and two // MSMSF_US between vector elements. There will be only one delimiter in // between nonvector types and there will be two delimiters separating vector // types _len = value; _pElements = _pOperations->allocate (_len, _len); if (_len > 0) { unsigned int nextpos, objectsize, nextvector, startvector; for (i=0; i<_len; i++) { if (startpos < slen) { startpos = startpos + sizeof(MSMSF_US); nextpos = decode.indexOf (MSMSF_US, startpos); objectsize = 0; // if its a vector in a vector need to parse past the size and all its elements for // each element in the contained vector, be sure to exclude end of string if (nextpos == startpos) { startvector = nextpos; nextvector = startvector + sizeof(MSMSF_US); value = 0; pcurrent = (const char *)decode.string() + nextvector; if (isdigit (*pcurrent)) { value = strtoul (pcurrent, &pstring, 10); if (*pstring != '\0') nextvector = decode.indexOf (MSMSF_US, nextvector); else value=0; } if ((value == 0) || (nextvector >= slen)) { rc = MSError::BadMSFString; break; } // now skip past all the elements in this subvector for (int j=0; jsetFromMSF (_pElements, i, buf); delete [] buf; if (rc == MSError::MSSuccess) startpos = nextpos; else break; } else { rc = MSError::BadMSFString; break; } } } else rc = MSError::BadMSFString; } else rc = MSError::BadMSFString; if (rc != MSError::MSSuccess) removeAll(); return rc; } void MSVectorImpl::set (unsigned index_, void *value_) { // we avoid calling reallocate() here to reduce the number of comparisons that it makes to determine // if reallocation is needed; we need only to check the reference count since the length remains the // same if (_pOperations->refCount (_pElements) > 1) { void *pNewData = _pOperations->allocateWithSize (_pOperations->size (_pElements)); _pOperations->copy (_pElements, pNewData, index_, 0, 0, MSRaw); _pOperations->copy (_pElements, pNewData, _len-index_-1, index_+1, index_+1, MSRaw); _pOperations->set (pNewData, index_, value_, MSRaw); _pOperations->deallocate (_pElements, _len); _pElements = pNewData; } else // if (refCount == 1) --> no reallocation _pOperations->set (_pElements, index_, value_); } void MSVectorImpl::setAll (const void *pValue_) { if (_pOperations->refCount (_pElements) > 1) { _pOperations->deallocate (_pElements, _len); _pElements = _pOperations->allocateWithSize (_pOperations->size (_pElements)); _pOperations->fill (_pElements, 0, _len, pValue_, MSRaw); } else // if (refCount == 1) --> no reallocation _pOperations->fill (_pElements, 0, _len, pValue_); } void MSVectorImpl::setSelected (const MSIndexVector & iVect_, const MSVectorImpl & vImpl_) { assert (vImpl_._len == iVect_.length()); // The test below means that if &vImpl_ == this, we are, in effect, permuting the vector (since the // index vector is not necessarily sorted up). This situation may arise, for example, if the user is doing // something like this: // // vect [vect.gradeUp()] = vect; // // This will effectively sort the vector up. However, it will be slower than using sortUp() directly. // if (this == &vImpl_) { permute (iVect_); return; } // we don't optimize reallocation here since there is no easy way to copy the elements NOT selected by an index vector prepareToChange(); const unsigned int *pv = iVect_.data(); for (unsigned int i=0; irefCount (_pElements) == 1) { for (; jallocateWithSize (_pOperations->size (_pElements)); unsigned int end = MSUtil::min (_len, bVect_.length()); for (; iset (pNewData, i, vImpl_._pElements, j++, MSRaw); else _pOperations->set (pNewData, i, _pElements, i, MSRaw); } if (i < _len) // if bVect_.length() < _len _pOperations->copy (_pElements, pNewData, _len-i, i, i, MSRaw); // copy the rest of the elements _pOperations->deallocate (_pElements, _len); _pElements = pNewData; } } void MSVectorImpl::setSelected (const MSBinaryVector & bVect_, const void *pValue_) { unsigned int n=bVect_.length(), i=0; const unsigned char *pBinaries = bVect_.data(); if (_pOperations->refCount (_pElements) == 1) { for (; iallocateWithSize (_pOperations->size (_pElements)); unsigned int end = MSUtil::min (_len, bVect_.length()); for (; iset (pNewData, i, pValue_, MSRaw); else _pOperations->set (pNewData, i, _pElements, i, MSRaw); } if (i < _len) _pOperations->copy (_pElements, pNewData, _len-i, i, i, MSRaw); // copy the rest of the elements _pOperations->deallocate (_pElements, _len); _pElements = pNewData; } } MSIndexVector MSVectorImpl::setIndexSelected (const MSBinaryVector & bVect_, const MSVectorImpl & vImpl_) { assert (vImpl_._len == bVect_.sum()); if (this == &vImpl_) return MSIndexVector::nullVector(); const unsigned char *pBinaries = bVect_.data(); MSIndexVector::Data *pIndexData = MSIndexVector::Data::allocateWithSize (_pOperations->size (vImpl_._pElements)); unsigned int *pIndices = pIndexData->elements(); unsigned int i=0, j=0; if (_pOperations->refCount (_pElements) == 1) { for (; jallocateWithSize (_pOperations->size (_pElements)); unsigned int end = MSUtil::min (_len, bVect_.length()); for (; iset (pNewData, i, vImpl_._pElements, j++, MSRaw); *pIndices++ = i; } else _pOperations->set (pNewData, i, _pElements, i, MSRaw); } if (i < _len) _pOperations->copy (_pElements, pNewData, _len-i, i, i, MSRaw); // copy the rest of the elements _pOperations->deallocate (_pElements, _len); _pElements = pNewData; } return MSIndexVector (pIndexData, vImpl_._len); } MSIndexVector MSVectorImpl::setIndexSelected (const MSBinaryVector & bVect_, const void *pValue_) { unsigned int n = bVect_.length(), numChanged = (unsigned int)bVect_.sum(), i=0; const unsigned char *pBinaries = bVect_.data(); MSIndexVector::Data *pIndexData = MSIndexVector::Data::allocateWithLength (numChanged); unsigned int *pIndices = pIndexData->elements(); if (_pOperations->refCount (_pElements) == 1) { for (; iallocateWithSize (_pOperations->size (_pElements)); unsigned int end = MSUtil::min (_len, bVect_.length()); for (; iset (pNewData, i, pValue_, MSRaw); *pIndices++ = i; } else _pOperations->set (pNewData, i, _pElements, i, MSRaw); } if (i < _len) _pOperations->copy (_pElements, pNewData, _len-i, i, i, MSRaw); // copy the rest of the elements _pOperations->deallocate (_pElements, _len); _pElements = pNewData; } return MSIndexVector (pIndexData, numChanged); } void MSVectorImpl::print (ostream & stream_) const { for (unsigned int i=0; i<_len; i++) _pOperations->print (_pElements, i, stream_); stream_ << flush; } unsigned int MSVectorImpl::indexOf (void *value_, unsigned int startPos_) const { for (unsigned int i=startPos_; i<_len; i++) if (_pOperations->isElementEqual (_pElements, i, value_)) return i; return _len; } unsigned int MSVectorImpl::lastIndexOf (void *value_, unsigned int startPos_) const { if (_len > 0) { unsigned int i; i = (startPos_ < _len) ? startPos_ : _len -1; for (; i; --i) if (_pOperations->isElementEqual (_pElements, i, value_)) return i; if (_pOperations->isElementEqual (_pElements, i, value_)) return i; } return _len; } unsigned int MSVectorImpl::occurrencesOf (const void *pValue_, unsigned int startPos_) const { unsigned int i,count; for (i=startPos_, count=0; i<_len; ++i) if (_pOperations->isElementEqual (_pElements, i, pValue_)) ++count; return count; } MSIndexVector MSVectorImpl::indicesOf (const MSVectorImpl & vImpl_) const { if (_len > 0 && vImpl_._len > 0) { MSIndexVector::Data *d = MSIndexVector::Data::allocateWithSize (_pOperations->size (vImpl_._pElements)); unsigned int *pIndices = d->elements(); unsigned int i, j; for (i=0; ielementAt (vImpl_._pElements, i); for (j=0; j<_len; j++) { if (_pOperations->isElementEqual (_pElements, j, element)) { pIndices[i] = j; break; } } if (j == _len) pIndices[i] = _len; } return MSIndexVector (d, vImpl_._len); } return MSIndexVector(); } MSBinaryVector MSVectorImpl::memberOf (const MSVectorImpl & vImpl_) const { if (_len > 0 && vImpl_._len > 0) { MSBinaryVector::Data *d = MSBinaryVector::Data::allocateWithSize (_pOperations->size (_pElements)); unsigned char *pIndices = d->elements(); unsigned int i, j; for (i=0; i<_len; i++) { void *element = _pOperations->elementAt (_pElements, i); for (j=0; jisElementEqual (vImpl_._pElements, j, element)) { pIndices[i] = 1; break; } } if (j == vImpl_._len) pIndices[i] = 0; } return MSBinaryVector (d, _len); } return MSBinaryVector(); } MSError::ErrorStatus MSVectorImpl::append (void *newElement) { reallocateAndCopy(_len+1); _pOperations->set (_pElements, _len, newElement, MSRaw); ++_len; return MSError::MSSuccess; } unsigned int MSVectorImpl::append (const char *pString_, const char delimiter_) { MSString aString (pString_); unsigned int numNew = _pOperations->numElements (aString, delimiter_); if (!numNew) return 0; reallocateAndCopy(_len + numNew); // a little hack: default-construct the new elements so that setFromMSString doesn't have // to worry about it _pOperations->fill (_pElements, _len, numNew, 0, MSRaw); unsigned int startPos=0; for (unsigned int i=0; isetFromMSString(_pElements, _len++, aString, startPos, delimiter_); } return numNew; } MSError::ErrorStatus MSVectorImpl::append (const MSVectorImpl & vImpl_) { if (vImpl_._len > 0) { reallocateAndCopy(_len + vImpl_._len); _pOperations->copy (vImpl_._pElements, _pElements, vImpl_._len, 0, _len, MSRaw); _len += vImpl_._len; return MSError::MSSuccess; } return MSError::MSFailure; } MSError::ErrorStatus MSVectorImpl::insertAt (unsigned int index_, void *value_) { // ASSERTION: index_ != _len if (index_ < _len) { // checkpoint: _len > 0 since index_<_len void *pNewData = reallocate (_len +1); if (pNewData != _pElements) // if we had to do reallocation { _pOperations->copy (_pElements, pNewData, index_, 0, 0, MSRaw); _pOperations->copy (_pElements, pNewData, _len-index_, index_, index_+1, MSRaw); _pOperations->set (pNewData, index_, value_, MSRaw); // we have copied all of existing data; now we can get switch to the new copy _pOperations->deallocate (_pElements, _len); _pElements = pNewData; } else // if we are doing insertion in-place { blockRight (index_, _len-index_, 1); _pOperations->set (_pElements, index_, value_); } _len++; return MSError::MSSuccess; } return MSError::MSFailure; } MSError::ErrorStatus MSVectorImpl::insertAt (unsigned int index_, const MSVectorImpl & vImpl_) { // ASSERTION: index_ != _len if (index_ < _len) { unsigned int newLen = _len + vImpl_._len; // checkpoint: newLen > 0 since index_<_len void *pNewData = reallocate (newLen); if (pNewData != _pElements) // if we had to do reallocation { // copy elements before index_ _pOperations->copy (_pElements, pNewData, index_, 0, 0, MSRaw); // copy elements after index_ _pOperations->copy (_pElements, pNewData, _len-index_, index_, index_ + vImpl_._len, MSRaw); // copy the elements from vImpl_ starting at index_ _pOperations->copy (vImpl_._pElements, pNewData, vImpl_._len, 0, index_, MSRaw); // we can get switch to the new copy of the data _pOperations->deallocate (_pElements, _len); _pElements = pNewData; } else // if we are doing insertion in-place { blockRight (index_, _len-index_, vImpl_._len); if (index_+vImpl_._len > _len) // if some elements will need to be constructed { unsigned int n = _len-index_; // copy the already-constructed elements _pOperations->copy (vImpl_._pElements, _pElements, n, 0, index_); // copy the uninitialized (raw) elements _pOperations->copy (vImpl_._pElements, _pElements, vImpl_._len-n, n, _len, MSRaw); } else // if no element construction is necessary { _pOperations->copy (vImpl_._pElements, _pElements, vImpl_._len, 0, index_); } } _len = newLen; return MSError::MSSuccess; } return MSError::MSFailure; } MSError::ErrorStatus MSVectorImpl::removeAt (unsigned int startPos_, unsigned int numEls_) { if (startPos_ < _len) { unsigned int numDoomed = (startPos_+numEls_ <= _len) ? numEls_ : _len - startPos_; unsigned int newLen = _len - numDoomed, endPos = startPos_ + numDoomed; void *pNewData = reallocate (newLen); if (pNewData != _pElements) // if we had to do reallocation { _pOperations->copy (_pElements, pNewData, startPos_, 0, 0, MSRaw); _pOperations->copy (_pElements, pNewData, _len-endPos, endPos, startPos_, MSRaw); // we have copied all of existing data; now we can switch to the new copy _pOperations->deallocate (_pElements, _len); _pElements = pNewData; } else // if removing in-place { if (startPos_ < newLen) // if we are not removing the last elements, move them to the left blockLeft (endPos, _len-endPos, numDoomed); _pOperations->destroy (_pElements, newLen, numDoomed); } _len = newLen; return MSError::MSSuccess; } return MSError::MSFailure; } MSError::ErrorStatus MSVectorImpl::remove (const MSIndexVector & iVect_) { const unsigned int iVectLen = iVect_.length(); if (iVectLen > 0) { const MSIndexVector sortVect = iVect_.gradeUp(); unsigned int numRemoved = 0; unsigned int dataIndex = iVect_(sortVect(0)); // start at the first element to be removed unsigned int newDataIndex = dataIndex; unsigned int *pIndices = iVect_.data(); unsigned int *pSortedIndices = sortVect.data(); // since we don't know for sure the resulting length, we will make reallocate() do reallocation only if the // reference count is >1 void *pNewData = reallocate (_len); MSAllocationFlag flag = (pNewData==_pElements) ? MSConstructed : MSRaw; for (unsigned int iVectIndex=0; dataIndex < _len && iVectIndex < iVectLen; dataIndex++) { if (dataIndex == pIndices [pSortedIndices[iVectIndex]]) // if this element is to be removed { numRemoved++; do // skip through all indices that are same as current iVectIndex iVectIndex++; while (iVectIndex < iVectLen && dataIndex==pIndices[pSortedIndices[iVectIndex]]); } else // if this element will remain in the vector, move it to new location _pOperations->set (pNewData, newDataIndex++, _pElements, dataIndex, flag); } unsigned int newLen = _len - numRemoved; if (pNewData == _pElements) { if (dataIndex < _len) // if all corresponding elements have been removed, move the rest to the left blockLeft (dataIndex, _len - dataIndex, dataIndex - newDataIndex); _pOperations->destroy (_pElements, newLen, numRemoved); } else // we had to reallocate { // copy the beginning and trailing elements (before and after the boundaries of iVect_) _pOperations->copy (_pElements, pNewData, pIndices[pSortedIndices[0]], 0, 0, MSRaw); _pOperations->copy (_pElements, pNewData, _len-dataIndex, dataIndex, newDataIndex, MSRaw); _pOperations->deallocate (_pElements, _len); _pElements = pNewData; } _len = newLen; if (numRemoved > 0) return MSError::MSSuccess; } return MSError::MSFailure; } MSError::ErrorStatus MSVectorImpl::remove (const MSBinaryVector & bVect_) { unsigned int numDoomed = (unsigned int)bVect_.sum(); unsigned int numLeft = _len - numDoomed; if (numLeft != _len && _len==bVect_.length()) { unsigned char *pBinaries = bVect_.data(); unsigned int i=0, j=0; void *pNewData = reallocate (numLeft); if (pNewData != _pElements) // if had to reallocate data { for (; jset (pNewData, j++, internalGet (i), MSRaw); _pOperations->deallocate (_pElements, _len); _pElements = pNewData; } else // if removing in-place { for (; jset (_pElements, j, internalGet (i)); j++; } } _pOperations->destroy (_pElements, numLeft, numDoomed); } _len = numLeft; return MSError::MSSuccess; } return MSError::MSFailure; } MSError::ErrorStatus MSVectorImpl::removeAll() { if (_len > 0) { _pOperations->deallocate (_pElements, _len); _pElements = _pOperations->allocate (0); _len = 0; return MSError::MSSuccess; } return MSError::MSFailure; } MSError::ErrorStatus MSVectorImpl::select (const MSIndexVector & iVect_) { unsigned int newLen = iVect_.length(); if (newLen == 0) // selecting no elements removeAll(); else { // we CANNOT do select() in-place: we always need additional storage so that we don't overwrite any // elements before we actually move them to the proper location void *newData = _pOperations->allocate (newLen); unsigned int *pIndices = iVect_.data(); for (unsigned int i=0; iset (newData, i, internalGet (pIndices[i]), MSRaw); _pOperations->deallocate (_pElements, _len); _pElements = newData; _len = newLen; } return MSError::MSSuccess; } MSError::ErrorStatus MSVectorImpl::compress (const MSBinaryVector & bVect_) { unsigned int newLen = (unsigned int)bVect_.sum(); unsigned int bVectLen = bVect_.length(); if (_len != bVectLen || _len == newLen) // if bVect_ is invalid or ineffective return MSError::MSFailure; if (newLen == 0) removeAll(); else { // unlike with select(), we CAN compress() in-place since the binary vector is ordered; here, there is no issue // of overwriting elements which we have not yet moved // unsigned char *pBinaries = bVect_.data(); unsigned int i=0, j=0; void *pNewData = reallocate (newLen); if (pNewData == _pElements) // we are doing compression in-place { for (; jset (_pElements, j, internalGet (i)); j++; } _pOperations->destroy (_pElements, newLen, _len-newLen); } else { for (; jset (pNewData, j++, internalGet (i), MSRaw); _pOperations->deallocate (_pElements, _len); _pElements = pNewData; } _len = newLen; } return MSError::MSSuccess; } MSBinaryVector MSVectorImpl::unique() { MSBinaryVector::Data *d = MSBinaryVector::Data::allocateWithSize (_pOperations->size (_pElements)); unsigned char *pBinaries = d->elements(); switch (_len) // for efficiency, we'll deal with a couple of the simplest cases individually { case 0: break; case 1: pBinaries[0] = 1; break; case 2: pBinaries[0] = 1; if (_pOperations->isElementEqual (_pElements, 0, _pOperations->elementAt (_pElements, 1))) pBinaries[1] = 0; else // if the two elements are different pBinaries[1] = 1; break; default: // _len > 2 MSIndexVector iVect = gradeUp(); unsigned int *pIndices = iVect.data(); for (unsigned int i=0, j=1; i<_len; i=j++) { pBinaries[pIndices[i]] = 1; void *pUnique = _pOperations->elementAt (_pElements, pIndices[i]); while (j<_len && _pOperations->isElementEqual (_pElements, pIndices[j], pUnique)) pBinaries[pIndices[j++]] = 0; } break; } return MSBinaryVector (d, _len); } MSError::ErrorStatus MSVectorImpl::reshape (unsigned int newLen_) { if (newLen_ == _len) return MSError::MSFailure; // do nothing if (newLen_ == 0) removeAll(); else { void *pNewData = reallocate (newLen_); if (pNewData == _pElements) // if reshaping in-place { if (newLen_ < _len) _pOperations->destroy (_pElements, newLen_, _len-newLen_); else { if (_len) { unsigned int numCycles=newLen_/_len, lastCycleLen=newLen_%_len; for (unsigned int i=1; icopy (_pElements, _pElements, _len, 0, i*_len, MSRaw); _pOperations->copy (_pElements, _pElements, lastCycleLen, 0, numCycles*_len, MSRaw); } else // _len == 0 _pOperations->fill (_pElements, 0, newLen_, 0, MSRaw); } } else // if reallocation was done { if (newLen_ < _len) _pOperations->copy (_pElements, pNewData, newLen_, 0, 0, MSRaw); else // if newLen_>_len (we've tested for equality in the beginning) { if (_len) // if copying is needed { unsigned int numCycles = newLen_ / _len; unsigned int lastCycleLen = newLen_ % _len; for (unsigned int i=0; icopy (_pElements, pNewData, _len, 0, i*_len, MSRaw); _pOperations->copy (_pElements, pNewData, lastCycleLen, 0, numCycles*_len, MSRaw); } else // _len == 0 _pOperations->fill (pNewData, 0, newLen_, 0, MSRaw); } _pOperations->deallocate (_pElements, _len); _pElements = pNewData; } _len = newLen_; } return MSError::MSSuccess; } MSError::ErrorStatus MSVectorImpl::exchange (unsigned int index1_, unsigned int index2_) { if (index1_ < _len && index2_ < _len && index1_ != index2_) { if (_pOperations->refCount (_pElements) > 1) { void *pNewData = _pOperations->allocateWithSize (_pOperations->size (_pElements)); if (index1_ < index2_) { _pOperations->copy (_pElements, pNewData, index1_, 0, 0, MSRaw); _pOperations->copy (_pElements, pNewData, index2_-index1_-1, index1_+1, index1_+1, MSRaw); _pOperations->copy (_pElements, pNewData, _len-index2_-1, index2_+1, index2_+1, MSRaw); } else // index1_ > index2_ { _pOperations->copy (_pElements, pNewData, index2_, 0, 0, MSRaw); _pOperations->copy (_pElements, pNewData, index1_-index2_-1, index2_+1, index2_+1, MSRaw); _pOperations->copy (_pElements, pNewData, _len-index1_-1, index1_+1, index1_+1, MSRaw); } _pOperations->set (pNewData, index1_, _pElements, index2_, MSRaw); _pOperations->set (pNewData, index2_, _pElements, index1_, MSRaw); _pOperations->deallocate (_pElements, _len); _pElements = pNewData; } else // if refCount == 1 _pOperations->swapElements (_pElements, index1_, index2_); return MSError::MSSuccess; } return MSError::MSFailure; } MSError::ErrorStatus MSVectorImpl::reverse() { if (_len > 1) { unsigned int i=0, j=_len-1; if (_pOperations->refCount (_pElements) > 1) { void *pNewData = _pOperations->allocateWithSize (_pOperations->size (_pElements)); for (; i<_len; i++, j--) _pOperations->set (pNewData, i, _pElements, j, MSRaw); _pOperations->deallocate (_pElements, _len); _pElements = pNewData; } else // if refCount == 1 for (; i < j; i++, j--) _pOperations->swapElements (_pElements, i, j); return MSError::MSSuccess; } return MSError::MSFailure; } MSError::ErrorStatus MSVectorImpl::rotate (int amount_) { unsigned int absAmount = MSUtil::abs (amount_) % _len; if (absAmount) // if amount_ is neither 0 nor a multiple of _len { if (_pOperations->refCount (_pElements) > 1) { void *pNewData = _pOperations->allocateWithSize (_pOperations->size (_pElements)); unsigned int numRest = _len - absAmount; if (amount_ > 0) { _pOperations->copy (_pElements, pNewData, numRest, absAmount, 0, MSRaw); _pOperations->copy (_pElements, pNewData, absAmount, 0, numRest, MSRaw); } else // if amount_ < 0 { _pOperations->copy (_pElements, pNewData, numRest, 0, absAmount, MSRaw); _pOperations->copy (_pElements, pNewData, absAmount, numRest, 0, MSRaw); } _pOperations->deallocate (_pElements, _len); _pElements = pNewData; } else { // rotating n elements in one direction is equivalent to rotating _len-n elements in the opposite // direction; therefore, we can optimize for additional temporary memory allocated below // (savedElements) by doing a check here and flipping sign if necessary... if (absAmount > _len / 2) { amount_ = - amount_; // we will need only the sign of the amount_ below, the value is in absAmount absAmount = _len - absAmount; } unsigned int blockWidth = _len - absAmount; void *savedElmts = _pOperations->allocateWithSize (absAmount); if (amount_ > 0) // rotating counter-clockwise { _pOperations->copy (_pElements, savedElmts, absAmount, 0, 0, MSRaw); blockLeft (absAmount, blockWidth, absAmount); _pOperations->copy (savedElmts, _pElements, absAmount, 0, blockWidth); } else // rotating clockwise { _pOperations->copy (_pElements, savedElmts, absAmount, blockWidth, 0, MSRaw); blockRight (0, blockWidth, absAmount); _pOperations->copy (savedElmts, _pElements, absAmount); } _pOperations->deallocate (savedElmts, absAmount); } return MSError::MSSuccess; } return MSError::MSFailure; } MSError::ErrorStatus MSVectorImpl::take (int numEls_, const void *pFiller_) { unsigned int newLen = MSUtil::abs (numEls_); if (newLen == _len) return MSError::MSFailure; if (newLen) { unsigned int lenDiff; if (newLen > _len) { lenDiff = newLen-_len; void *pNewData = reallocate (newLen); if (pNewData == _pElements) // if we are doing take() in-place { if (numEls_ < 0) // if elements have to be at the end of the array { blockRight (0, _len, lenDiff); if (_len < lenDiff) // i.e., if newLen>2*_len, which means some elements are unconstructed { // simply fill in the constructed elements _pOperations->fill (_pElements, 0, _len, pFiller_); // initialize the unconstructed elements with the copy constructor _pOperations->fill (_pElements, _len, lenDiff-_len, pFiller_, MSRaw); } else // newLen<=2*_len, which means that all the elements are constructed by now { _pOperations->fill (_pElements, 0, lenDiff, pFiller_); } } else _pOperations->fill (_pElements, _len, lenDiff, pFiller_, MSRaw); } else // if reallocation has been done { void *pOldData = _pElements; _pElements = pNewData; if (numEls_ < 0) // copy the elements to the end of the new array { _pOperations->copy (pOldData, _pElements, _len, 0, lenDiff, MSRaw); _pOperations->fill (_pElements, 0, lenDiff, pFiller_, MSRaw); } else // if numEls_>0 (we've already tested for the equality) { _pOperations->copy (pOldData, _pElements, _len, 0, 0, MSRaw); _pOperations->fill (_pElements, _len, lenDiff, pFiller_, MSRaw); } _pOperations->deallocate (pOldData, _len); } _len = newLen; } else // if (newLen < _len) { lenDiff = _len - newLen; if (numEls_ < 0) removeAt (0, lenDiff); // leave only the last newLen elements else removeAt (newLen, lenDiff); // leave only the first newLen elements } } else // if (newLen == 0) removeAll(); return MSError::MSSuccess; } MSError::ErrorStatus MSVectorImpl::drop (int numEls_) { if (numEls_ == 0) return MSError::MSFailure; unsigned int numDoomed = MSUtil::abs (numEls_); if (numDoomed >= _len) removeAll(); else // if numDoomed < _len { if (numEls_ > 0) removeAt (0, numDoomed); // remove the first numDoomed elements else // if numEls_ < 0 removeAt (_len-numDoomed, numDoomed); // remove the last numDoomed elements } return MSError::MSSuccess; } void MSVectorImpl::reverse (const MSVectorImpl & vImpl_) { if (this == &vImpl_) { reverse(); return; } _pOperations->deallocate (_pElements, _len); _pElements = _pOperations->allocateWithSize (vImpl_._pOperations->size (vImpl_._pElements)); _len = vImpl_._len; unsigned int fwdInd,bkwdInd; for (fwdInd=0, bkwdInd=_len-1; fwdInd < bkwdInd; fwdInd++, bkwdInd--) { _pOperations->copy (vImpl_._pElements, _pElements, 1, bkwdInd, fwdInd, MSRaw); _pOperations->copy (vImpl_._pElements, _pElements, 1, fwdInd, bkwdInd, MSRaw); } if (fwdInd == bkwdInd) // if _len is odd, the middle element doesn't get set in the loop _pOperations->set (_pElements, fwdInd, vImpl_._pElements, fwdInd, MSRaw); } void MSVectorImpl::rotate (const MSVectorImpl & vImpl_, int amount_) { if (this == &vImpl_) { rotate (amount_); return; } _pOperations->deallocate (_pElements, _len); _pElements = _pOperations->allocateWithSize (vImpl_._pOperations->size (vImpl_._pElements)); _len = vImpl_._len; unsigned int absAmount = MSUtil::abs (amount_) % _len; unsigned int blockWidth = _len - absAmount; if (amount_ > 0) // rotating counter-clockwise { _pOperations->copy (vImpl_._pElements, _pElements, blockWidth, absAmount, 0, MSRaw); _pOperations->copy (vImpl_._pElements, _pElements, absAmount, 0, blockWidth, MSRaw); } else // rotating clockwise { _pOperations->copy (vImpl_._pElements, _pElements, absAmount, blockWidth, 0, MSRaw); _pOperations->copy (vImpl_._pElements, _pElements, blockWidth, 0, absAmount, MSRaw); } } void MSVectorImpl::take (const MSVectorImpl & vImpl_, int numEls_, const void *pFiller_) { if (this == &vImpl_) { take (numEls_); return; } _pOperations->deallocate (_pElements, _len); _len = MSUtil::abs (numEls_); _pElements = _pOperations->allocate (_len); if (_len) { if (_len > vImpl_._len) { unsigned int lenDiff = _len - vImpl_._len; if (numEls_ > 0) // copy the elements to the beginning of the vector { _pOperations->copy (vImpl_._pElements, _pElements, vImpl_._len, 0, 0, MSRaw); _pOperations->fill (_pElements, vImpl_._len, lenDiff, pFiller_, MSRaw); } else // copy the elements to the end of the vector { _pOperations->copy (vImpl_._pElements, _pElements, vImpl_._len, 0, _len - vImpl_._len, MSRaw); _pOperations->fill (_pElements, 0, lenDiff, pFiller_, MSRaw); } } else // if (_len <= vImpl_._len) { if (numEls_ > 0) // copy only the first _len elements _pOperations->copy (vImpl_._pElements, _pElements, _len, 0, 0, MSRaw); else // if numEls_ < 0, copy only the last _len elements _pOperations->copy (vImpl_._pElements, _pElements, _len, vImpl_._len - _len, 0, MSRaw); } } } void MSVectorImpl::drop (const MSVectorImpl & vImpl_, int numEls_) { if (this == &vImpl_) { drop (numEls_); return; } unsigned int numDoomed = MSUtil::abs (numEls_); _pOperations->deallocate (_pElements, _len); if (numDoomed < vImpl_._len) // if there will be any elements left in the vector { _len = vImpl_._len - numDoomed; _pElements = _pOperations->allocate (_len); if (numEls_ > 0) // copy everything except the first numDoomed elements _pOperations->copy (vImpl_._pElements, _pElements, _len, numDoomed, 0, MSRaw); else // if numEls_ <= 0, copy everything except the last numDoomed elements _pOperations->copy (vImpl_._pElements, _pElements, _len, 0, 0, MSRaw); } else { _len = 0; _pElements = _pOperations->allocate (0); } } void MSVectorImpl::select (const MSVectorImpl & vImpl_, const MSIndexVector & iVect_) { if (this == &vImpl_) { select (iVect_); return; } _pOperations->deallocate (_pElements, _len); _len = iVect_.length(); _pElements = _pOperations->allocate (_len); if (_len) // if selecting at least one element { unsigned int *pIndices = iVect_.data(); for (unsigned int i=0; i<_len; i++) _pOperations->set (_pElements, i, vImpl_.internalGet (pIndices[i]), MSRaw); } } void MSVectorImpl::compress (const MSVectorImpl & vImpl_, const MSBinaryVector & bVect_) { if (this == &vImpl_) { compress (bVect_); return; } _pOperations->deallocate (_pElements, _len); _len = (unsigned int)bVect_.sum(); _pElements = _pOperations->allocate (_len); if (_len) // if there will be any elements left in the vector { unsigned char *pBinaries = bVect_.data(); for (unsigned int i=0, newDataInd=0; newDataInd<_len; i++) if (pBinaries[i]) _pOperations->set (_pElements, newDataInd++, vImpl_.internalGet (i), MSRaw); } } MSIndexVector MSVectorImpl::gradeUp() const { unsigned int size = _pOperations->size (_pElements); MSIndexVector::Data *d = MSIndexVector::Data::allocateWithSize (size); if (_len > 0) { unsigned int *pGradient = new unsigned int [_len]; mergeSortUp(pGradient,d->elements()); delete [] pGradient; } return MSIndexVector (d, _len); } MSIndexVector MSVectorImpl::gradeDown() const { unsigned int size = _pOperations->size (_pElements); MSIndexVector::Data *d = MSIndexVector::Data::allocateWithSize (size); if (_len > 0) { unsigned int *pGradient = new unsigned int [_len]; mergeSortDown(pGradient,d->elements()); delete [] pGradient; } return MSIndexVector(d, _len); } unsigned int MSVectorImpl::maxLength() const { unsigned int max = 0; for (unsigned int i=0; i<_len; i++) max = MSUtil::max (max, _pOperations->elementLen (_pElements, i)); return max; } long MSVectorImpl::compare (const MSVectorImpl & vImpl_) const { long result; unsigned n = MSUtil::min (_len, vImpl_._len); for (unsigned int i=0; icompareElement (_pElements, i, _pOperations->elementAt (vImpl_._pElements, i)); if (result != 0) return result; } return (_len == vImpl_._len) ? 0 : ((_len < vImpl_._len) ? -1 : 1); } MSBinaryVector MSVectorImpl::binaryCompare (const MSVectorImpl & vImpl_, MSComparison cmp_) const { assert (_len == vImpl_._len); unsigned int size = _pOperations->size (_pElements); MSBinaryVector::Data *d = MSBinaryVector::Data::allocateWithSize (_pOperations->size (_pElements)); unsigned char *pCmpData = d->elements(); unsigned int i; switch (cmp_) { case MSLessThan: for (i=0; i<_len; i++) pCmpData[i] = _pOperations->isElementLess (_pElements, i, _pOperations->elementAt (vImpl_._pElements, i)); break; case MSLessThanOrEqualTo: for (i=0; i<_len; i++) pCmpData[i] = _pOperations->isElementLessEqual (_pElements, i, _pOperations->elementAt (vImpl_._pElements, i)); break; case MSEqualTo: for (i=0; i<_len; i++) pCmpData[i] = _pOperations->isElementEqual (_pElements, i, _pOperations->elementAt (vImpl_._pElements, i)); break; case MSNotEqualTo: for (i=0; i<_len; i++) pCmpData[i] = ! _pOperations->isElementEqual (_pElements, i, _pOperations->elementAt (vImpl_._pElements, i)); break; case MSGreaterThan: for (i=0; i<_len; i++) pCmpData[i] = ! _pOperations->isElementLessEqual (_pElements, i, _pOperations->elementAt (vImpl_._pElements, i)); break; case MSGreaterThanOrEqualTo: for (i=0; i<_len; i++) pCmpData[i] = ! _pOperations->isElementLess (_pElements, i, _pOperations->elementAt (vImpl_._pElements, i)); break; } return MSBinaryVector (d, _len); } MSBinaryVector MSVectorImpl::binaryCompare (const void *value_, MSComparison cmp_) const { unsigned int size = _pOperations->size (_pElements); MSBinaryVector::Data *d = MSBinaryVector::Data::allocateWithSize (_pOperations->size (_pElements)); unsigned char *pCmpData = d->elements(); unsigned int i; switch (cmp_) { case MSLessThan: for (i=0; i<_len; i++) pCmpData[i] = _pOperations->isElementLess (_pElements, i, value_); break; case MSLessThanOrEqualTo: for (i=0; i<_len; i++) pCmpData[i] = _pOperations->isElementLessEqual (_pElements, i, value_); break; case MSEqualTo: for (i=0; i<_len; i++) pCmpData[i] = _pOperations->isElementEqual (_pElements, i, value_); break; case MSNotEqualTo: for (i=0; i<_len; i++) pCmpData[i] = ! _pOperations->isElementEqual (_pElements, i, value_); break; case MSGreaterThan: for (i=0; i<_len; i++) pCmpData[i] = ! _pOperations->isElementLessEqual (_pElements, i, value_); break; case MSGreaterThanOrEqualTo: for (i=0; i<_len; i++) pCmpData[i] = ! _pOperations->isElementLess (_pElements, i, value_); break; } return MSBinaryVector (d, _len); } MSBoolean MSVectorImpl::scalarCompare (const void *pValue_, MSComparison cmp_) const { if (_len > 0) { unsigned int i; switch (cmp_) { case MSLessThan: for (i=0; i<_len; i++) if (! _pOperations->isElementLess (_pElements, i, pValue_)) return MSFalse; break; case MSLessThanOrEqualTo: for (i=0; i<_len; i++) if (! _pOperations->isElementLessEqual (_pElements, i, pValue_)) return MSFalse; break; case MSEqualTo: for (i=0; i<_len; i++) if (! _pOperations->isElementEqual (_pElements, i, pValue_)) return MSFalse; break; case MSNotEqualTo: for (i=0; i<_len; i++) if (_pOperations->isElementEqual (_pElements, i, pValue_)) return MSFalse; break; case MSGreaterThan: for (i=0; i<_len; i++) if (_pOperations->isElementLessEqual (_pElements, i, pValue_)) return MSFalse; break; case MSGreaterThanOrEqualTo: for (i=0; i<_len; i++) if (_pOperations->isElementLess (_pElements, i, pValue_)) return MSFalse; break; default: return MSFalse; } return MSTrue; } return (cmp_ == MSNotEqualTo) ? MSTrue : MSFalse; } void MSVectorImpl::mergeSortUp(unsigned int *pGradient_, unsigned int *pIndices_) const { // This is a purely internal function. It assumes that _len>0 and that pGradient_ // and pIndices_ point to an allocated piece of memory of _len*sizeof(unsigned int) bytes. // pIndices_[0]=_pOperations->gradeUp(_pElements,_len,pGradient_); for (unsigned int i=0; i<_len-1; ++i) { pIndices_[i+1] = pGradient_[pIndices_[i]]; } } void MSVectorImpl::mergeSortDown(unsigned int *pGradient_, unsigned int *pIndices_) const { // This is a purely internal function. It assumes that _len>0 and that pGradient_ // and pIndices_ point to an allocated piece of memory of _len*sizeof(unsigned int) bytes. // pIndices_[0]=_pOperations->gradeDown(_pElements,_len,pGradient_); for (unsigned int i=0; i<_len-1; ++i) { pIndices_[i+1] = pGradient_[pIndices_[i]]; } } MSVectorImplOps::MSVectorImplOps() { } MSVectorImplOps::~MSVectorImplOps() { } aplus-fsf-4.22/src/MSTypes/MSCharData.T.C0000644000265000001440000000165710772770453013413 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MSTypeDataHEADER #include #endif //MSTypeDataHEADER #ifndef MSAllocatorHEADER #include #endif //MSAllocatorHEADER #ifdef MSTK_MANUAL_INSTANTIATION #include #ifdef MS_XLC_TEMPLATE_INSTANTIATION #pragma define (MSTypeData >) #endif #ifdef MS_EDG_TEMPLATE_INSTANTIATION #pragma instantiate MSTypeData > #endif #ifdef MS_VC_TEMPLATE_INSTANTIATION template MSTypeData >; #endif #ifdef MS_STD_TEMPLATE_INSTANTIATION template class MSTypeData >; #endif #endif //MSTK_MANUAL_INSTANTIATION aplus-fsf-4.22/src/MSTypes/MSFloatData.T.C0000644000265000001440000000201210772770453013565 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MSTypeDataHEADER #include #endif #ifndef MSAllocatorHEADER #include #endif //MSAllocatorHEADER #if defined(MSTK_MANUAL_INSTANTIATION) #include #if defined(MS_XLC_TEMPLATE_INSTANTIATION) #pragma define (MSTypeData >) #endif #if defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma instantiate MSTypeData > #endif //MS_EDG_TEMPLATE_INSTANTIATION #if defined(MS_VC_TEMPLATE_INSTANTIATION) template MSTypeData >; #endif //MS_VC_TEMPLATE_INSTANTIATION #if defined(MS_STD_TEMPLATE_INSTANTIATION) template class MSTypeData >; #endif #endif //MSTK_MANUAL_INSTANTIATION aplus-fsf-4.22/src/MSTypes/MSIntData.T.C0000644000265000001440000000167310772770453013266 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #if defined(MSTK_MANUAL_INSTANTIATION) #include #if defined(MS_XLC_TEMPLATE_INSTANTIATION) #pragma define (MSTypeData >) #endif #if defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma instantiate MSTypeData > #endif //MS_EDG_TEMPLATE_INSTANTIATION #if defined(MS_VC_TEMPLATE_INSTANTIATION) template MSTypeData >; #endif //MS_VC_TEMPLATE_INSTANTIATION #if defined(MS_STD_TEMPLATE_INSTANTIATION) template class MSTypeData >; #endif #endif //MSTK_MANUAL_INSTANTIATION aplus-fsf-4.22/src/MSTypes/MSLongData.T.C0000644000265000001440000000170410772770453013426 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #if defined(MSTK_MANUAL_INSTANTIATION) #include #if defined(MS_XLC_TEMPLATE_INSTANTIATION) #pragma define (MSTypeData >) #endif #if defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma instantiate MSTypeData > #endif //MS_EDG_TEMPLATE_INSTANTIATION #if defined(MS_VC_TEMPLATE_INSTANTIATION) template MSTypeData >; #endif //MS_VC_TEMPLATE_INSTANTIATION #if defined(MS_STD_TEMPLATE_INSTANTIATION) template class MSTypeData >; #endif #endif //MSTK_MANUAL_INSTANTIATION aplus-fsf-4.22/src/MSTypes/MSUnsignedCharData.T.C0000644000265000001440000000171410772770453015102 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #if defined(MSTK_MANUAL_INSTANTIATION) #include #if defined(MS_XLC_TEMPLATE_INSTANTIATION) #pragma define (MSTypeData >) #endif #if defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma instantiate MSTypeData > #endif #if defined(MS_VC_TEMPLATE_INSTANTIATION) template MSTypeData >; #endif #if defined(MS_STD_TEMPLATE_INSTANTIATION) template class MSTypeData >; #endif #endif //MSTK_MANUAL_INSTANTIATION aplus-fsf-4.22/src/MSTypes/MSUnsignedData.T.C0000644000265000001440000000170510772770453014304 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #if defined(MSTK_MANUAL_INSTANTIATION) #include #if defined(MS_XLC_TEMPLATE_INSTANTIATION) #pragma define (MSTypeData >) #endif #if defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma instantiate MSTypeData > #endif #if defined(MS_VC_TEMPLATE_INSTANTIATION) template MSTypeData >; #endif #if defined(MS_STD_TEMPLATE_INSTANTIATION) template class MSTypeData >; #endif #endif //MSTK_MANUAL_INSTANTIATION aplus-fsf-4.22/src/MSTypes/MSUnsignedLongData.T.C0000644000265000001440000000171510772770453015125 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #if defined(MSTK_MANUAL_INSTANTIATION) #include #if defined(MS_XLC_TEMPLATE_INSTANTIATION) #pragma define (MSTypeData >) #endif #if defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma instantiate MSTypeData > #endif #if defined(MS_VC_TEMPLATE_INSTANTIATION) template MSTypeData >; #endif #if defined(MS_STD_TEMPLATE_INSTANTIATION) template class MSTypeData >; #endif #endif //MSTK_MANUAL_INSTANTIATION aplus-fsf-4.22/src/MSTypes/MSVariableRegistry.T.C0000644000265000001440000000160710772770453015215 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #if defined(MSTK_MANUAL_INSTANTIATION) #include #if defined(MS_XLC_TEMPLATE_INSTANTIATION) #pragma define(MSIHashKeySet) #endif #if defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma instantiate MSIHashKeySet #endif #if defined(MS_STD_TEMPLATE_INSTANTIATION) template class MSIHashKeySet; #endif #if defined(MS_VC_TEMPLATE_INSTANTIATION) template MSIHashKeySet; #endif #endif //MSTK_MANUAL_INSTANTIATION aplus-fsf-4.22/src/MSTypes/MSA.H0000644000265000001440000001604010772770453011717 #ifndef MSAHEADER #define MSAHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__) #include #else #include #endif #include #include #include #include #include // Due to Lucid's template specialization bug, // inside MStk MSFloatVector.H must be included BEFORE all the other // built-in vectors. #include #include #include #include #include #include #include // Note: MSStringVector must be included after the specialized type vectors. #include #include #include #include #include #include class MSMMap; template class MSTypeData; class MSTypesExport MSA { public: enum {MAXRANK=9}; enum AType {INTEGERTYPE=0L,FLOATTYPE=1L,CHARACTERTYPE=2L,STRINGTYPE=3L,ETYPE=4L,UTYPE=8L,XTYPE=UTYPE}; enum MSAplusType {MSAInt,MSAFloat,MSAChar,MSASymbol,MSABox,MSAInvalidType,MSANull}; struct a { long c,t,r,n,d[MAXRANK],i,p[1]; }; enum {AHEADER=sizeof(struct a)-sizeof(long)}; protected: MSA::a *_aStructPtr; public: MSA(void); MSA(long,long,long,long *); MSA(a *,MSBoolean iced_=MSFalse); MSA(const MSA&); MSA(char); MSA(unsigned); MSA(long); MSA(double); MSA(const MSInt&); MSA(const MSFloat&); MSA(const MSString&); MSA(const MSSymbol&,MSBoolean encloseSymbols_=MSTrue); MSA(const MSIntVector&); MSA(const MSFloatVector&); MSA(const MSSymbolVector&,MSBoolean encloseSymbols_=MSFalse); MSA(const MSStringVector&); MSA(const MSIntMatrix&); MSA(const MSFloatMatrix&); MSA(const MSCharMatrix&); MSA(const MSMMap&, MSBoolean bImport_=MSTrue); ~MSA(void); MSA& operator=(const MSA&); void aStructPtr(MSA::a *aStructPtr_); inline MSA::a *aStructPtr(void) const; MSBoolean isNullMSA(void) const; inline unsigned numberOfElements(void) const; MSA simplePick( unsigned) const; MSA simplePick(const MSIndexVector&) const; MSA complexPick(const MSA&) const; MSA iterativePick(const MSIndexVector&) const; void simpleSpecify(const MSIndexVector& Index_, const MSA& BaObject_); void iterativeSpecify(const MSIndexVector& Index_, const MSA& BaObject_); long depth(void) const; inline unsigned rank(void) const; MSIntVector shape(void) const; MSAplusType aPlusType(void) const; MSString asDebugInfo(void) const; char asChar(void) const; long asLong(void) const; unsigned long asUnsignedLong(void) const; double asDouble(void) const; MSInt asMSInt(void) const; MSString asMSString(void) const; MSFloat asMSFloat(void) const; MSSymbol asMSSymbol(void) const; MSIntVector asMSIntVector(void) const; MSUnsignedLongVector asMSUnsignedLongVector(void) const; MSLongVector asMSLongVector(void) const; MSCharVector asMSCharVector(void) const; MSFloatVector asMSFloatVector(void) const; MSSymbolVector asMSSymbolVector(void) const; MSStringVector asMSStringVector(void) const; MSFloatMatrix asMSFloatMatrix(void) const; MSCharMatrix asMSCharMatrix(void) const; MSIntMatrix asMSIntMatrix(void) const; MSLongMatrix asMSLongMatrix(void) const; MSUnsignedLongMatrix asMSUnsignedLongMatrix(void) const; void beamOut(const char *fileName_, MSBoolean bExport_=MSTrue) const; MSA exportAObject(void) const; //This 2 api for use by MSAConnection and anyone else who wants to export //an MSA object into a string without constructing another MSA first. int exportAObjectSizePass(long * hsz_, long *dsz_, int long_bytes=4) const ; int exportAObjectFillPass(char *dest_, long hsz_, char * trp_,long for_a_,int long_bytes=4) const; MSBoolean import(const MSMMap &aMap); MSBoolean import(void); static MSA importAObject(char *cvp,long cvlen,char *trp); static void dc(MSA::a *aobj); static void dec(MSA::a *); static MSA::a *ga(long t,long r,long n,long *d); static MSA::a *gc(long t,long r,long n,long *d,long *p); static MSA::a *gd(long t,MSA::a * aobj); static MSA::a *gf(double f); static MSA::a *gi(long i); static MSA::a *gm(long t_,long m_,long n_); static MSA::a *gv(long t,long n); static MSA::a *gs(long t); static MSA::a *ic(MSA::a *aobj); static long longAt(char *c); static long *ma(long i); static long *mab(long i); static void mf(long *p); static void mv(long *d,long *s,long n); static long si(char * s); static char *tmv(long t,long *d,long *s,long n); static void *balloc(int); static void bfree(char *); /* Endian Conversion routines */ static void ndn16copy(char *from, char *to, int n); static void ndn32copy(char *from, char *to, int n); static void ndn64copy(char *from, char *to, int n); static inline void ndnicopy(long *from, long *to, int n) { #ifdef MS_64BIT ndn64copy((char*)from,(char *)to,n); #else ndn32copy((char *)from,(char *)to,n); #endif } static inline void ndnfcopy(double *from, double *to, int n) { ndn64copy((char*)from,(char*)to,n); } static inline long dataSize(long t, long x) /* like A+'s Tt macro */ { #if defined(MS_64BIT) return ((x)<<((((t>>1)&1)+3)&3)) + (t==CHARACTERTYPE); #else return ((x)<<(t+2&3)) + (t==CHARACTERTYPE); #endif } protected: inline unsigned lastAxis(void) const; unsigned allButLastAxis(void) const; static MSA::a * gpick(MSA::a *apick_, MSA::a *aobj_); static MSA::a * gp_num(MSA::a *apick_, MSA::a *aobj_); static MSA::a * gp_nested(MSA::a *apick_, MSA::a *aobj_); static MSA::a * gp_scalar(long idx_,MSA::a *aobj_); static long gpi_sym(long key_,MSA::a *aobj_); static long gpi_num(MSA::a *apick_, MSA::a *aobj_); static long gpu_fillivec(long *ivec_, MSA::a *aobj_); static long pcki(int i_,MSA::a *a_); static void fillExportBuffer(MSA::a * aobj_, char *hp_, long hsz_, char *trp_, long for_a_,int); static MSA::a * extractpass(char **hpp_, char **dpp_, char *endp_, long *erp_, char *trp_, int); static void fillpass(MSA::a * aobj_, char **hpp_, char **dpp_, char *trp_, long for_a_,int); static long sizepass(MSA::a * aobj_, long *hszp_, long *dszp_,int); static MSA::a *copyAStruct(MSA::a *); }; inline unsigned MSA::lastAxis(void) const { return (_aStructPtr==0) ? 0: _aStructPtr->d[_aStructPtr->r-1]; } inline MSA::a *MSA::aStructPtr(void) const { return _aStructPtr; } inline unsigned MSA::numberOfElements(void) const { return (_aStructPtr==0) ? 0 : _aStructPtr->n;} inline unsigned MSA::rank(void) const { return(_aStructPtr==0) ? 0 : _aStructPtr->r; } typedef MSA::a MSAStruct; #endif aplus-fsf-4.22/src/MSTypes/MSAllocator.H0000644000265000001440000000217110772770453013457 #ifndef MSAllocatorHEADER #define MSAllocatorHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include // for size_t #ifndef MSDefinesHEADER #include // for INLINELINKAGE #endif //MSDefinesHEADER template class MSAllocator { public: INLINELINKAGE MSAllocator(void); INLINELINKAGE ~MSAllocator(void); INLINELINKAGE Type *allocate(size_t n_, Type *); INLINELINKAGE Type *allocate(size_t size_); INLINELINKAGE void deallocate(Type *p_); INLINELINKAGE void construct(Type *p_, const Type& value_); INLINELINKAGE void destroy(Type *p_); }; template INLINELINKAGE void msConstruct(Type *, const Type&); template INLINELINKAGE void msDestroy(Type *); #ifndef MS_NO_INLINES #ifndef MSAllocatorINLINES #include #endif //MSAllocatorINLINES #endif //MS_NO_INLINES #endif //MSAllocatorHEADER aplus-fsf-4.22/src/MSTypes/MSAspectEvent.H0000644000265000001440000000245010772770453013760 #ifndef MSAspectEventHEADER #define MSAspectEventHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSTypesExport MSAspectEvent : public MSEvent { public: MSAspectEvent(void); MSAspectEvent(const MSAspectEvent & ); MSAspectEvent(const MSSymbol & tag_); virtual ~MSAspectEvent(void); MSAspectEvent & operator=(const MSAspectEvent &); static const MSSymbol& symbol(void); const MSSymbol & tag (void) const; protected: MSSymbol _tag; }; inline const MSSymbol& MSAspectEvent::tag (void) const { return _tag; } inline MSAspectEvent::MSAspectEvent(void) : MSEvent(MSAspectEvent::symbol()) {} inline MSAspectEvent::MSAspectEvent(const MSAspectEvent & ev_) : MSEvent(ev_), _tag(ev_._tag) {} inline MSAspectEvent::MSAspectEvent(const MSSymbol & tag_) : MSEvent(MSAspectEvent::symbol()), _tag(tag_) {} inline MSAspectEvent& MSAspectEvent::operator=(const MSAspectEvent & ev_) { if (this==&ev_) return *this; _tag=ev_._tag; MSEvent::operator=(ev_); return *this; } #endif aplus-fsf-4.22/src/MSTypes/MSAutoPointer.H0000644000265000001440000000530210772770454014010 #ifndef MSAutoPointerHEADER #define MSAutoPointerHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MSDefinesHEADER #include #endif #include #if defined(MS_NEED_IMPLEMENTATION_PRAGMA) #pragma implementation("MSAutoPointer.C") #endif #if HAVE_IOSTREAM #include #else class ostream; using namespace std; #endif #if defined(MS_PREDECLARE_TEMPLATE_FRIENDS) && !defined(MS_PREDECLARE_TEMPLATE_FRIENDS_BUG) template class MSAutoPointer; template ostream& operator<<(ostream&,const MSAutoPointer&); #if !defined(MS_SPECIALIZE_ELEMENT_FOR_OPS) template inline Type& elementForOps(MSAutoPointer&); template inline const Type& elementForOps(const MSAutoPointer&); #endif //MS_SPECIALIZE_ELEMENT_FOR_OPS #endif //MS_PREDECLARE_TEMPLATE_FRIENDS template class MSAutoPointer { public: MSAutoPointer(Type *pObject_,MSExplicitInit) : _pObject(pObject_) {} MSAutoPointer(void) : _pObject(0) {} #if !defined (MS_NO_EXPLICIT_KEYWORD) explicit MSAutoPointer(Type *pObject_) : _pObject(pObject_) {} #endif MSAutoPointer(const MSAutoPointer&); ~MSAutoPointer(void) { delete _pObject; } void operator=(const MSAutoPointer&); Type& operator*() const { return *_pObject; } Type* operator->() const { return _pObject; } operator Type*() const { return _pObject; } inline Type* release (); inline void reset(Type* pType_); friend ostream& operator<<(ostream&,const MSAutoPointer&); #if !defined(MS_SPECIALIZE_ELEMENT_FOR_OPS) friend inline Type & elementForOps (MSAutoPointer & ptr_) { return *ptr_; } friend inline const Type & elementForOps (const MSAutoPointer & ptr_) { return *ptr_; } #endif protected: Type *_pObject; }; template inline MSAutoPointer::MSAutoPointer(const MSAutoPointer& aAutoPointer_) { _pObject=aAutoPointer_._pObject; ((MSAutoPointer&)aAutoPointer_)._pObject=0; } template inline void MSAutoPointer::operator=(const MSAutoPointer& aAutoPointer_) { delete _pObject; _pObject=aAutoPointer_._pObject; ((MSAutoPointer&) aAutoPointer_)._pObject=0; } template inline Type* MSAutoPointer::release() { Type* tmp=_pObject;_pObject=0;return tmp; } template inline void MSAutoPointer::reset(Type* aType_) { if(_pObject) delete _pObject; _pObject=aType_; } #endif aplus-fsf-4.22/src/MSTypes/MSBaseTypeVector.H0000644000265000001440000003703710772770454014450 #ifndef MSBaseTypeVectorHEADER #define MSBaseTypeVectorHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #if defined(MS_NEED_IMPLEMENTATION_PRAGMA) #pragma implementation("MSBaseTypeVector.C") #endif class MSIndexVector; class MSBinaryVector; #if defined(MS_PREDECLARE_TEMPLATE_FRIENDS) template class MSBaseVector; template INLINELINKAGE MSBoolean operator<(const MSBaseVector&, const MSBaseVector&); template INLINELINKAGE MSBoolean operator>(const MSBaseVector&, const MSBaseVector&); template INLINELINKAGE MSBoolean operator<=(const MSBaseVector&, const MSBaseVector&); template INLINELINKAGE MSBoolean operator>=(const MSBaseVector&, const MSBaseVector&); template INLINELINKAGE MSBoolean operator<(const MSBaseVector&, const Type&); template INLINELINKAGE MSBoolean operator<(const Type&, const MSBaseVector&); template INLINELINKAGE MSBoolean operator>(const MSBaseVector&, const Type&); template INLINELINKAGE MSBoolean operator>(const Type&, const MSBaseVector&); template INLINELINKAGE MSBoolean operator<=(const MSBaseVector&, const Type&); template INLINELINKAGE MSBoolean operator<=(const Type&, const MSBaseVector&); template INLINELINKAGE MSBoolean operator>=(const MSBaseVector&, const Type&); template INLINELINKAGE MSBoolean operator>=(const Type&, const MSBaseVector&); template INLINELINKAGE MSBoolean operator==(const MSBaseVector&, const Type&); template INLINELINKAGE MSBoolean operator==(const Type&, const MSBaseVector&); template INLINELINKAGE MSBoolean operator!=(const MSBaseVector&, const Type&); template INLINELINKAGE MSBoolean operator!=(const Type&, const MSBaseVector&); template INLINELINKAGE MSBoolean operator==(const MSBaseVector&, const MSBaseVector&); template INLINELINKAGE MSBoolean operator!=(const MSBaseVector&, const MSBaseVector&); template INLINELINKAGE MSBaseVector& operator<< ( MSBaseVector&, const MSBaseVector&); template INLINELINKAGE MSBaseVector& operator<< ( MSBaseVector&, const Type&); #if defined(MS_TEMPLATE_MANUAL_FRIEND_BUG) template INLINELINKAGE ostream& operator<<(ostream&, const MSBaseVector&); #else template ostream& operator<<(ostream&, const MSBaseVector&); #endif //MS_MANUAL_FRIEND_ACCESS_BUG #endif //MS_PREDECLARE_TEMPLATE_FRIENDS template class MSBaseVectorOps : public MSVectorImplOps { public: typedef MSTypeData Data; MSBaseVectorOps(); virtual ~MSBaseVectorOps(); virtual void * allocate (unsigned int, unsigned int =0, MSAllocationFlag =MSRaw) const; virtual void * allocateWithSize(unsigned int, unsigned int =0, MSAllocationFlag =MSRaw) const; virtual void deallocate (void *, unsigned int =0, MSAllocationFlag =MSRaw) const ; virtual void incrementCount (void *) const; virtual unsigned int refCount(const void *) const; virtual void set (void *, unsigned int, const void *, MSAllocationFlag =MSConstructed) const; virtual void set (void *, unsigned int, const void *, unsigned int, MSAllocationFlag =MSConstructed) const; virtual void fill(void *, unsigned int, unsigned int, const void *, MSAllocationFlag =MSConstructed) const; virtual void copy(const void *, void *, unsigned int, unsigned int =0, unsigned int =0, MSAllocationFlag =MSConstructed) const; virtual void copyBackward(void *, unsigned int, unsigned int, unsigned int) const; virtual void destroy(void *, unsigned int, unsigned int) const; virtual int isElementEqual (const void *, unsigned int, const void *) const; virtual int isElementLess (const void *, unsigned int, const void *) const; virtual int isElementLessEqual(const void *, unsigned int, const void *) const; virtual long compareElement (const void *, unsigned int, const void *) const; virtual void *elementAt(const void *, unsigned int) const; virtual unsigned int size(const void *) const; virtual void swapElements(void *, unsigned int, unsigned int) const; virtual unsigned int gradeUp (const void *, unsigned int, unsigned int *) const; virtual unsigned int gradeDown(const void *, unsigned int, unsigned int *) const; virtual void *badData() const; virtual void *defaultFiller() const; virtual MSString asString(const void *, unsigned int) const; virtual MSString asMSF (const void *, unsigned int) const; virtual unsigned int elementLen(const void *, unsigned int) const; virtual MSError::ErrorStatus setFromString(void *, unsigned int, const char *) const; virtual MSError::ErrorStatus setFromMSF(void *, unsigned int, const char *) const; virtual void print(const void *, unsigned int, ostream&) const; virtual unsigned int numElements(const MSString&, const char) const; virtual void setFromMSString(void *, unsigned int, const MSString&, unsigned int&, const char) const; protected: #ifdef MS_MULTI_THREAD static MSMutex _nullDataMutex; #endif static Data& nullData(void); }; template class MSBaseVector : public MSVector { protected: typedef MSBaseVectorOps Operations; MSVectorImpl *_pImpl; MSBoolean _blocked; #ifdef MS_MULTI_THREAD static MSMutex _operationsMutex; #endif INLINELINKAGE MSBaseVector(MSVectorImpl *); INLINELINKAGE MSTypeData *vectorData() const; virtual unsigned int getLength() const; static Operations& ops(void); public: MSBaseVector(); MSBaseVector(const MSBaseVector&); #if defined(MS_TEMPLATE_CONSTRUCTOR_OVERLOAD_BUG) // Visual C++ bug dealing with overloading resolution; only first argument is used MSBaseVector(unsigned int, int, int); #else MSBaseVector(unsigned int); #endif //MS_TEMPLATE_CONSTRUCTOR_OVERLOAD_BUG MSBaseVector(unsigned int, const Type&); MSBaseVector(const char *, const char=' '); MSBaseVector(MSTypeData *, unsigned int); MSBaseVector(const Type *, unsigned int); virtual ~MSBaseVector(); MSBaseVector& operator=(const MSBaseVector&); MSBaseVector& operator=(const Type&); /*** MSModel pure virtual functions overriden here ***/ virtual MSString asString() const; virtual MSString asMSF() const; virtual MSString asDebugInfo() const; virtual MSString className() const; virtual const MSSymbol& type() const; virtual MSModel *clone() const; virtual MSModel *create() const; virtual void assign(const MSModel&); virtual long compare(const MSModel&) const; virtual MSError::ErrorStatus set(const char *); virtual MSError::ErrorStatus setFromMSF(const char *); MSError::ErrorStatus set(unsigned int, const Type&); MSError::ErrorStatus set(unsigned int, const char *); INLINELINKAGE unsigned int maxLength() const; INLINELINKAGE unsigned int size() const; INLINELINKAGE unsigned int length() const; Type * data() const; Type * elements() const; INLINELINKAGE unsigned int indexOf(const Type&, unsigned int =0) const; INLINELINKAGE unsigned int lastIndexOf(const Type&, unsigned int =UINT_MAX-1) const; INLINELINKAGE unsigned int occurrencesOf(const Type&, unsigned int =0) const; // the following method is equivalent to dyadic iota in apl(indexOf on vectors) INLINELINKAGE MSIndexVector indicesOf(const MSBaseVector&) const; // the following method is equivalent to membership in apl INLINELINKAGE MSBinaryVector memberOf(const MSBaseVector&) const; INLINELINKAGE MSBinaryVector uniqueElements() const; INLINELINKAGE MSBaseVector& replaceAt(unsigned int, const Type&); MSBaseVector& removeAll(); MSBaseVector& append (const Type&); MSBaseVector& append (const MSBaseVector&); MSBaseVector& insertAt (unsigned int, const Type&); MSBaseVector& insertAt (unsigned int, const MSBaseVector&); MSBaseVector& removeAt (unsigned int); MSBaseVector& removeAt (unsigned int, unsigned int); MSBaseVector& remove (const MSIndexVector&); MSBaseVector& remove (const MSBinaryVector&); MSBaseVector& select (const MSIndexVector&); MSBaseVector& compress (const MSBinaryVector&); INLINELINKAGE MSBaseVector& selectUnique(); MSBaseVector& reshape (unsigned int); MSBaseVector& exchange(unsigned int, unsigned int); MSBaseVector& reverse (); MSBaseVector& rotate (int); MSBaseVector& drop (int); MSBaseVector& take (int); MSBaseVector& take (int, const Type&); static MSBaseVector reverse(const MSBaseVector&); static MSBaseVector rotate (const MSBaseVector&, int); static MSBaseVector take (const MSBaseVector&, int); static MSBaseVector take (const MSBaseVector&, int, const Type&); static MSBaseVector drop (const MSBaseVector&, int); static MSBaseVector select (const MSBaseVector&, const MSIndexVector&); static MSBaseVector compress(const MSBaseVector&, const MSBinaryVector&); INLINELINKAGE static MSBaseVector selectUnique(const MSBaseVector&); MSBaseVector& selectiveAssign(const MSIndexVector &, const Type&); MSBaseVector& selectiveAssign(const MSIndexVector &, const MSBaseVector&); MSBaseVector& selectiveAssign(const MSBinaryVector&, const Type&); MSBaseVector& selectiveAssign(const MSBinaryVector&, const MSBaseVector&); virtual MSIndexVector gradeUp() const; virtual MSIndexVector gradeDown() const; virtual void permute(const MSIndexVector&); INLINELINKAGE MSBaseVector& sortUp(); INLINELINKAGE MSBaseVector& sortDown(); // The version of EDG used by SGI's dcc compiler has a bug related to access from friends during manual instantiation; // therefore, for SGI, make operator<<() inline so that it does not need to be manually instantiated in the library. #if defined(MS_TEMPLATE_MANUAL_FRIEND_BUG) INLINELINKAGE friend ostream& operator<< MS_FRIEND_TEMPLATEID (ostream&,const MSBaseVector&); #else friend MSTypesExport ostream& operator<< MS_FRIEND_TEMPLATEID (ostream&, const MSBaseVector&); #endif //MS_MANUAL_FRIEND_ACCESS_BUG INLINELINKAGE long compare(const MSBaseVector&) const; INLINELINKAGE MSBinaryVector binaryCompare(const MSBaseVector&, MSComparison) const; INLINELINKAGE MSBinaryVector binaryCompare(const Type&, MSComparison) const; INLINELINKAGE2 friend MSBoolean operator< MS_FRIEND_TEMPLATEID (const MSBaseVector&, const MSBaseVector&); INLINELINKAGE2 friend MSBoolean operator> MS_FRIEND_TEMPLATEID (const MSBaseVector&, const MSBaseVector&); INLINELINKAGE2 friend MSBoolean operator<= MS_FRIEND_TEMPLATEID (const MSBaseVector&, const MSBaseVector&); INLINELINKAGE2 friend MSBoolean operator>= MS_FRIEND_TEMPLATEID (const MSBaseVector&, const MSBaseVector&); INLINELINKAGE2 friend MSBoolean operator< MS_FRIEND_TEMPLATEID (const MSBaseVector&, const Type&); INLINELINKAGE2 friend MSBoolean operator< MS_FRIEND_TEMPLATEID (const Type&, const MSBaseVector&); INLINELINKAGE2 friend MSBoolean operator> MS_FRIEND_TEMPLATEID (const MSBaseVector&, const Type&); INLINELINKAGE2 friend MSBoolean operator> MS_FRIEND_TEMPLATEID (const Type&, const MSBaseVector&); INLINELINKAGE2 friend MSBoolean operator<= MS_FRIEND_TEMPLATEID (const MSBaseVector&, const Type&); INLINELINKAGE2 friend MSBoolean operator<= MS_FRIEND_TEMPLATEID (const Type&, const MSBaseVector&); INLINELINKAGE2 friend MSBoolean operator>= MS_FRIEND_TEMPLATEID (const MSBaseVector&, const Type&); INLINELINKAGE2 friend MSBoolean operator>= MS_FRIEND_TEMPLATEID (const Type&, const MSBaseVector&); INLINELINKAGE2 friend MSBoolean operator== MS_FRIEND_TEMPLATEID (const MSBaseVector&, const Type&); INLINELINKAGE2 friend MSBoolean operator== MS_FRIEND_TEMPLATEID (const Type&, const MSBaseVector&); INLINELINKAGE2 friend MSBoolean operator!= MS_FRIEND_TEMPLATEID (const MSBaseVector&, const Type&); INLINELINKAGE2 friend MSBoolean operator!= MS_FRIEND_TEMPLATEID (const Type&, const MSBaseVector&); INLINELINKAGE2 friend MSBoolean operator== MS_FRIEND_TEMPLATEID (const MSBaseVector&, const MSBaseVector&); INLINELINKAGE2 friend MSBoolean operator!= MS_FRIEND_TEMPLATEID (const MSBaseVector&, const MSBaseVector&); INLINELINKAGE2 friend MSBaseVector& operator<< MS_FRIEND_TEMPLATEID (MSBaseVector&, const MSBaseVector&); INLINELINKAGE2 friend MSBaseVector& operator<< MS_FRIEND_TEMPLATEID (MSBaseVector&, const Type&); INLINELINKAGE MSBaseVector& operator<<=(const MSBaseVector&); INLINELINKAGE MSBaseVector& operator<<=(const Type&); }; #ifndef MS_NO_INLINES #include #endif //MS_NO_INLINES #endif // MSBaseTypeVectorHEADER aplus-fsf-4.22/src/MSTypes/MSBinaryMatrix.H0000644000265000001440000004241710772770454014160 #ifndef MSBinaryMatrixHEADER #define MSBinaryMatrixHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include class MSBinaryVector; class MSBinaryMatrixSTypePick; // MSBinaryMatrix indexed by an unsigned int class MSTypesExport MSBinaryMatrix : public MSMatrix { public: MSBinaryMatrix(void); MSBinaryMatrix(unsigned rows_,unsigned columns_); MSBinaryMatrix(unsigned rows_,unsigned columns_,unsigned char fill_); MSBinaryMatrix(const MSBinaryMatrix&); MSBinaryMatrix(MSTypeData > *dp_,unsigned rows_,unsigned columns_); MSBinaryMatrix(const unsigned char *pElements_, unsigned rows_, unsigned cols_); ~MSBinaryMatrix(void); virtual MSString asString(void) const; virtual MSString asMSF(void) const; virtual MSString asDebugInfo(void) const; virtual MSString className(void) const; virtual const MSSymbol& type(void) const; virtual MSModel *clone(void) const; virtual MSModel *create(void) const; virtual void assign(const MSModel&); virtual long compare(const MSModel&) const; virtual MSError::ErrorStatus set(const char *pString_); virtual MSError::ErrorStatus setFromMSF(const char *pString_); inline static const MSSymbol& symbol(void); MSError::ErrorStatus set(unsigned index_,const char *pString_); MSError::ErrorStatus set(unsigned index_,unsigned char); unsigned indexOf(unsigned char aBinaryValue_,unsigned startPos_=0) const; unsigned lastIndexOf(unsigned char aBinaryValue_,unsigned startPos_=UINT_MAX-1) const; inline const unsigned char& elementAt(unsigned) const; inline const unsigned char& elementAt(unsigned,unsigned) const; MSBinaryMatrix& random(void); // limit is always 2; nothing else makes sense unsigned char min(void) const; unsigned char max(void) const; unsigned long sum(void) const; MSBinaryMatrix& operator=(const MSBinaryMatrix&); MSBinaryMatrix& operator=(const MSBinaryMatrixSTypePick&); MSBinaryMatrix& operator=(unsigned char); inline unsigned char operator()(unsigned index_) const; inline unsigned char operator[](unsigned index_) const; inline unsigned char operator()(unsigned row_,unsigned column_) const; inline MSBinaryMatrixSTypePick operator()(unsigned index_); inline MSBinaryMatrixSTypePick operator[](unsigned index_); inline MSBinaryMatrixSTypePick operator()(unsigned row_,unsigned column_); friend MSTypesExport ostream& operator<<(ostream&,const MSBinaryMatrix&); long compare(const MSBinaryMatrix&) const; inline long compare(const MSBinaryMatrix&,const MSBinaryMatrix&); MSBinaryMatrix binaryCompare(const MSBinaryMatrix&,MSComparison) const; MSBinaryMatrix binaryCompare(unsigned char,MSComparison) const; MSBoolean scalarCompare(unsigned char,MSComparison) const; inline MSBoolean operator==(const MSBinaryMatrix&) const; inline MSBoolean operator!=(const MSBinaryMatrix&) const; inline friend MSTypesExport MSBoolean operator<(const MSBinaryMatrix&,const MSBinaryMatrix&); inline friend MSTypesExport MSBoolean operator>(const MSBinaryMatrix&,const MSBinaryMatrix&); inline friend MSTypesExport MSBoolean operator<=(const MSBinaryMatrix&,const MSBinaryMatrix&); inline friend MSTypesExport MSBoolean operator>=(const MSBinaryMatrix&,const MSBinaryMatrix&); inline friend MSTypesExport MSBoolean operator<(const MSBinaryMatrix&,unsigned char); inline friend MSTypesExport MSBoolean operator<(unsigned char,const MSBinaryMatrix&); inline friend MSTypesExport MSBoolean operator>(const MSBinaryMatrix&,unsigned char); inline friend MSTypesExport MSBoolean operator>(unsigned char,const MSBinaryMatrix&); inline friend MSTypesExport MSBoolean operator<=(const MSBinaryMatrix&,unsigned char); inline friend MSTypesExport MSBoolean operator<=(unsigned char,const MSBinaryMatrix&); inline friend MSTypesExport MSBoolean operator>=(const MSBinaryMatrix&,unsigned char); inline friend MSTypesExport MSBoolean operator>=(unsigned char,const MSBinaryMatrix&); inline friend MSTypesExport MSBoolean operator==(const MSBinaryMatrix&,unsigned char); inline friend MSTypesExport MSBoolean operator==(unsigned char,const MSBinaryMatrix&); inline friend MSTypesExport MSBoolean operator!=(const MSBinaryMatrix&,unsigned char); inline friend MSTypesExport MSBoolean operator!=(unsigned char,const MSBinaryMatrix&); friend MSTypesExport MSBinaryMatrix operator!(const MSBinaryMatrix&); friend MSTypesExport MSBinaryMatrix operator~(const MSBinaryMatrix&); friend MSTypesExport MSBinaryMatrix operator&(const MSBinaryMatrix&,unsigned char); friend MSTypesExport MSBinaryMatrix operator&(unsigned char,const MSBinaryMatrix&); friend MSTypesExport MSBinaryMatrix operator&(const MSBinaryMatrix&,const MSBinaryMatrix&); MSBinaryMatrix& operator&=(const MSBinaryMatrix&); MSBinaryMatrix& operator&=(unsigned char); friend MSTypesExport MSBinaryMatrix operator|(const MSBinaryMatrix&,unsigned char); friend MSTypesExport MSBinaryMatrix operator|(unsigned char,const MSBinaryMatrix&); friend MSTypesExport MSBinaryMatrix operator|(const MSBinaryMatrix&,const MSBinaryMatrix&); MSBinaryMatrix& operator|=(const MSBinaryMatrix&); MSBinaryMatrix& operator|=(unsigned char); friend MSTypesExport MSBinaryMatrix operator^(const MSBinaryMatrix&,unsigned char); friend MSTypesExport MSBinaryMatrix operator^(unsigned char,const MSBinaryMatrix&); friend MSTypesExport MSBinaryMatrix operator^(const MSBinaryMatrix&,const MSBinaryMatrix&); MSBinaryMatrix& operator^=(const MSBinaryMatrix&); MSBinaryMatrix& operator^=(unsigned char); // stack matrices vertically MSBinaryMatrix& stack(const MSBinaryMatrix&); friend MSTypesExport MSBinaryMatrix stack(const MSBinaryMatrix&,const MSBinaryMatrix&); // adjoin matrices horizontally MSBinaryMatrix& adjoin(const MSBinaryMatrix&); friend MSTypesExport MSBinaryMatrix adjoin(const MSBinaryMatrix&,const MSBinaryMatrix&); MSBinaryMatrix& appendColumn(const MSBinaryVector&); MSBinaryMatrix& appendColumns(unsigned columns_, unsigned char fill_=0); MSBinaryMatrix& appendRow(const MSBinaryVector&); MSBinaryMatrix& appendRows(unsigned rows_, unsigned char fill_=0); MSBinaryMatrix& exchangeColumns(unsigned a_,unsigned b_); MSBinaryMatrix& exchangeRows(unsigned a_,unsigned b_); MSBinaryMatrix& insertColumnBefore(unsigned column_,unsigned char fill_=0); MSBinaryMatrix& insertColumnBefore(unsigned column_,const MSBinaryVector&); MSBinaryMatrix& insertColumnAfter(unsigned column_,unsigned char fill_=0); MSBinaryMatrix& insertColumnAfter(unsigned column_,const MSBinaryVector&); MSBinaryMatrix& insertRowBefore(unsigned row_,unsigned char fill_=0); MSBinaryMatrix& insertRowBefore(unsigned row_,const MSBinaryVector&); MSBinaryMatrix& insertRowAfter(unsigned row_,unsigned char fill_=0); MSBinaryMatrix& insertRowAfter(unsigned row_,const MSBinaryVector&); MSBinaryMatrix& reshape(unsigned rows_,unsigned columns_); MSBinaryMatrix& removeAll(void); MSBinaryMatrix& removeAllRows(void); MSBinaryMatrix& removeAllColumns(void); MSBinaryMatrix& assignRow(unsigned row_, unsigned char scalar_); MSBinaryMatrix& assignColumn(unsigned column_, unsigned char scalar_); MSBinaryMatrix& assignColumn(unsigned column_, const MSBinaryVector&); MSBinaryMatrix& assignRow(unsigned row_, const MSBinaryVector&); MSBinaryMatrix& removeRow(unsigned row_); MSBinaryMatrix& removeColumn(unsigned column_); MSBinaryMatrix& compressRows(const MSBinaryVector&); MSBinaryMatrix& compressColumns(const MSBinaryVector&); MSBinaryMatrix& reverseRows(void); MSBinaryMatrix& reverseColumns(void); MSBinaryMatrix& transpose(void); MSBinaryMatrix& rotateRows(int position_); MSBinaryMatrix& rotateColumns(int position_); MSBinaryMatrix& takeRows(int numberOfRows_); MSBinaryMatrix& takeColumns(int numberOfColumns_); MSBinaryMatrix& dropRows(int numberOfRows_); MSBinaryMatrix& dropColumns(int numberOfColumns_); MSBinaryVector rowAt(unsigned row_) const; MSBinaryVector columnAt(unsigned column_) const; void error(const char *) const; inline unsigned char *data(void) const; inline unsigned size(void) const; inline unsigned length(void) const; protected: friend class MSBinaryMatrixSTypePick; static unsigned char _badData; // used as return value for index errors MSTypeData > *_pData; // unsigned _size; MSBoolean _blocked; inline MSTypeData > *pData(void) const; inline MSBoolean blocked(void) const; inline void blocked(MSBoolean); void reserve(unsigned); void blockLeft(unsigned target_,unsigned moveCount_); void blockRight(unsigned target_,unsigned moveCount_); void freeData(void); void allocData(unsigned); void makeUniqueCopy(void); void prepareToChange(void); inline MSTypeData > *incrementCount(void); inline void decrementCount(void); inline unsigned char& elementAt(unsigned); inline unsigned char& elementAt(unsigned,unsigned); void appendString(const char *); }; class MSTypesExport MSBinaryMatrixSTypePick { public: inline MSBinaryMatrixSTypePick& operator=(unsigned char); inline operator unsigned char() const; inline MSBinaryMatrix *pMatrix(void) const; inline unsigned char value(void) const; inline unsigned index(void) const; private: friend class MSBinaryMatrix; inline MSBinaryMatrixSTypePick(const MSBinaryMatrix&,unsigned); inline MSBinaryMatrixSTypePick(const MSBinaryMatrixSTypePick&); MSBinaryMatrix *_pMatrix; unsigned _index; }; //------------------------------------------------------------ // MSBinaryMatrix inlines //------------------------------------------------------------ inline MSTypeData > *MSBinaryMatrix::pData(void) const { return _pData; } inline unsigned MSBinaryMatrix::size(void) const { return _pData->size(); } //{ return _size; } inline unsigned MSBinaryMatrix::length(void) const { return _count; } inline MSBoolean MSBinaryMatrix::blocked(void) const { return _blocked; } inline void MSBinaryMatrix::blocked(MSBoolean blocked_) { _blocked=blocked_; } inline unsigned char& MSBinaryMatrix::elementAt(unsigned index_) { #if defined(MS_NO_INDEX_ERROR) return _pData->elementAt(index_); #else if (index_<_count) return _pData->elementAt(index_); else return (indexError(index_,length()),_badData); #endif } inline const unsigned char& MSBinaryMatrix::elementAt(unsigned index_) const { #if defined(MS_NO_INDEX_ERROR) return _pData->elementAt(index_); #else if (index_<_count) return _pData->elementAt(index_); else return (indexError(index_,length()),_badData); #endif } inline unsigned char& MSBinaryMatrix::elementAt(unsigned row_,unsigned column_) { #if defined(MS_NO_INDEX_ERROR) return _pData->elementAt(index(row_,column_)); #else unsigned ravel=index(row_,column_); if (ravel<_count) return _pData->elementAt(ravel); else return (indexError(ravel,length()),_badData); #endif } inline const unsigned char& MSBinaryMatrix::elementAt(unsigned row_,unsigned column_) const { #if defined(MS_NO_INDEX_ERROR) return _pData->elementAt(index(row_,column_)); #else unsigned ravel=index(row_,column_); if (ravel<_count) return _pData->elementAt(ravel); else return (indexError(ravel,length()),_badData); #endif } inline unsigned char MSBinaryMatrix::operator()(unsigned index_) const { return elementAt(index_); } inline unsigned char MSBinaryMatrix::operator[](unsigned index_) const { return elementAt(index_); } inline unsigned char MSBinaryMatrix::operator()(unsigned row_,unsigned column_) const { return elementAt(index(row_,column_)); } inline MSTypeData > *MSBinaryMatrix::incrementCount(void) { return (_pData!=0)?_pData->incrementCount():0; } inline void MSBinaryMatrix::decrementCount(void) { if (_pData!=0) _pData->decrementCount(); } inline unsigned char *MSBinaryMatrix::data(void) const { return (_pData!=0)?_pData->elements():0; } inline long compare(const MSBinaryMatrix& aBinaryMatrix_,const MSBinaryMatrix& bBinaryMatrix_) { return aBinaryMatrix_.compare(bBinaryMatrix_); } inline MSBoolean MSBinaryMatrix::operator==(const MSBinaryMatrix& aBinaryMatrix_) const { return MSBoolean(compare(aBinaryMatrix_)==0); } inline MSBoolean MSBinaryMatrix::operator!=(const MSBinaryMatrix& aBinaryMatrix_) const { return MSBoolean(compare(aBinaryMatrix_)!=0); } inline MSBoolean operator<(const MSBinaryMatrix& aBinaryMatrix_,const MSBinaryMatrix& bBinaryMatrix_) { return MSBoolean(aBinaryMatrix_.compare(bBinaryMatrix_)>0); } inline MSBoolean operator>(const MSBinaryMatrix& aBinaryMatrix_,const MSBinaryMatrix& bBinaryMatrix_) { return MSBoolean(aBinaryMatrix_.compare(bBinaryMatrix_)<0); } inline MSBoolean operator<=(const MSBinaryMatrix& aBinaryMatrix_,const MSBinaryMatrix& bBinaryMatrix_) { return MSBoolean(aBinaryMatrix_.compare(bBinaryMatrix_)>=0); } inline MSBoolean operator>=(const MSBinaryMatrix& aBinaryMatrix_,const MSBinaryMatrix& bBinaryMatrix_) { return MSBoolean(aBinaryMatrix_.compare(bBinaryMatrix_)<=0); } inline MSBoolean operator<(const MSBinaryMatrix& aBinaryMatrix_,unsigned char aBinaryValue_) { return aBinaryMatrix_.scalarCompare(aBinaryValue_,MSLessThan); } inline MSBoolean operator<(unsigned char aBinaryValue_,const MSBinaryMatrix& aBinaryMatrix_) { return aBinaryMatrix_.scalarCompare(aBinaryValue_,MSGreaterThan); } inline MSBoolean operator>(const MSBinaryMatrix& aBinaryMatrix_,unsigned char aBinaryValue_) { return aBinaryMatrix_.scalarCompare(aBinaryValue_,MSGreaterThan); } inline MSBoolean operator>(unsigned char aBinaryValue_,const MSBinaryMatrix& aBinaryMatrix_) { return aBinaryMatrix_.scalarCompare(aBinaryValue_,MSLessThan); } inline MSBoolean operator<=(const MSBinaryMatrix& aBinaryMatrix_,unsigned char aBinaryValue_) { return aBinaryMatrix_.scalarCompare(aBinaryValue_,MSLessThanOrEqualTo); } inline MSBoolean operator<=(unsigned char aBinaryValue_,const MSBinaryMatrix& aBinaryMatrix_) { return aBinaryMatrix_.scalarCompare(aBinaryValue_,MSGreaterThanOrEqualTo); } inline MSBoolean operator>=(const MSBinaryMatrix& aBinaryMatrix_,unsigned char aBinaryValue_) { return aBinaryMatrix_.scalarCompare(aBinaryValue_,MSGreaterThanOrEqualTo); } inline MSBoolean operator>=(unsigned char aBinaryValue_,const MSBinaryMatrix& aBinaryMatrix_) { return aBinaryMatrix_.scalarCompare(aBinaryValue_,MSLessThanOrEqualTo); } inline MSBoolean operator==(const MSBinaryMatrix& aBinaryMatrix_,unsigned char aBinaryValue_) { return aBinaryMatrix_.scalarCompare(aBinaryValue_,MSEqualTo); } inline MSBoolean operator==(unsigned char aBinaryValue_,const MSBinaryMatrix& aBinaryMatrix_) { return aBinaryMatrix_.scalarCompare(aBinaryValue_,MSEqualTo); } inline MSBoolean operator!=(const MSBinaryMatrix& aBinaryMatrix_,unsigned char aBinaryValue_) { return aBinaryMatrix_.scalarCompare(aBinaryValue_,MSNotEqualTo); } inline MSBoolean operator!=(unsigned char aBinaryValue_,const MSBinaryMatrix& aBinaryMatrix_) { return aBinaryMatrix_.scalarCompare(aBinaryValue_,MSNotEqualTo); } //------------------------------------------------------------ // MSBinaryMatrixSTypePick inlines //------------------------------------------------------------ inline MSBinaryMatrixSTypePick::MSBinaryMatrixSTypePick(const MSBinaryMatrix& aTypeMatrix_,unsigned index_) { _pMatrix=&(MSBinaryMatrix&)aTypeMatrix_; _index=index_; } inline MSBinaryMatrixSTypePick::MSBinaryMatrixSTypePick(const MSBinaryMatrixSTypePick& aPick_) { _pMatrix=aPick_.pMatrix(); _index=aPick_.index(); } inline MSBinaryMatrixSTypePick& MSBinaryMatrixSTypePick::operator=(unsigned char aBinaryValue_) { _pMatrix->set(_index,aBinaryValue_); return *this; } inline MSBinaryMatrix *MSBinaryMatrixSTypePick::pMatrix(void) const { return _pMatrix; } inline unsigned MSBinaryMatrixSTypePick::index(void) const { return _index; } inline MSBinaryMatrixSTypePick::operator unsigned char() const { return _pMatrix->elementAt(_index); } inline unsigned char MSBinaryMatrixSTypePick::value(void) const { return _pMatrix->elementAt(_index); } //------------------------------------------------------------ // Pick Indexing operators - define here to avoid inline problem //------------------------------------------------------------ inline MSBinaryMatrixSTypePick MSBinaryMatrix::operator()(unsigned index_) { return MSBinaryMatrixSTypePick(*this,index_); } inline MSBinaryMatrixSTypePick MSBinaryMatrix::operator[](unsigned index_) { return MSBinaryMatrixSTypePick(*this,index_); } inline MSBinaryMatrixSTypePick MSBinaryMatrix::operator()(unsigned row_,unsigned column_) { return MSBinaryMatrixSTypePick(*this,index(row_,column_)); } // We provide provide explicit "do_not_instantiate" pragmas here to avoid instantiation complications in // MStk applications. // #if !defined(__MSTYPESLIBRARY_BUILD__) && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma do_not_instantiate MSAllocator #pragma do_not_instantiate MSTypeData > #endif // !__MSTYPESLIBRARY_BUILD__ && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #endif aplus-fsf-4.22/src/MSTypes/MSBinarySearch.H0000644000265000001440000000256610772770454014122 #ifndef MSBinarySearchHEADER #define MSBinarySearchHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #if defined(MS_NEED_IMPLEMENTATION_PRAGMA) #pragma implementation("MSBinarySearch.C") #endif template class MSBinarySearch { public: MSBinarySearch(const MSTypeVector& sourceVector_); ~MSBinarySearch(void) {} unsigned occurrencesOf(const Type& aKey_) const; unsigned indexOf(const Type& aKey_) const; unsigned firstIndexOf(const Type& aKey_) const; unsigned lastIndexOf(const Type& aKey_) const; MSIndexVector indicesOf(const Type& aKey_) const; const MSTypeVector& sourceVector(void) const; const MSIndexVector& indexVector(void) const; private: const MSTypeVector& _sourceVector; MSIndexVector _indexVector; }; template inline const MSTypeVector& MSBinarySearch::sourceVector(void) const { return _sourceVector; } template inline const MSIndexVector& MSBinarySearch::indexVector(void) const { return _indexVector; } #endif aplus-fsf-4.22/src/MSTypes/MSBinaryVector.H0000644000265000001440000003602510772770454014154 #ifndef MSBinaryVectorHEADER #define MSBinaryVectorHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #if HAVE_NEW #include #else #include #endif #include #include #include #include #include #include #include #include #include #include #if HAVE_IOSTREAM #include // #include using namespace std; #else class ostream; #endif class istrstream; class ostrstream; class MSIndexVector; class MSTypesExport MSBinaryVector : public MSVector { public: class Data; #if defined(MS_NESTED_CLASSES_ACCESS_BUG) public: #else protected: #endif class MSTypesExport Operations : public MSVectorImplOps { protected: #ifdef MS_MULTI_THREAD static MSMutex _nullDataMutex; #endif static Data& nullData(void); public: Operations(); virtual ~Operations(); virtual void * allocate (unsigned int, unsigned int =0, MSAllocationFlag =MSRaw) const; virtual void * allocateWithSize (unsigned int, unsigned int =0, MSAllocationFlag =MSRaw) const; virtual void deallocate (void *, unsigned int =0, MSAllocationFlag =MSRaw) const ; virtual void incrementCount (void *) const; virtual unsigned int refCount (const void *) const; virtual void set (void *, unsigned int, const void *, MSAllocationFlag =MSConstructed) const; virtual void set (void *, unsigned int, const void *, unsigned int, MSAllocationFlag =MSConstructed) const; virtual void fill (void *, unsigned int, unsigned int, const void *, MSAllocationFlag =MSConstructed) const; virtual void copy (const void *, void *, unsigned int, unsigned int =0, unsigned int =0, MSAllocationFlag =MSConstructed) const; virtual void copyBackward (void *, unsigned int, unsigned int, unsigned int) const; virtual void destroy (void *, unsigned int, unsigned int) const; virtual int isElementEqual (const void *, unsigned int, const void *) const; virtual int isElementLess (const void *, unsigned int, const void *) const; virtual int isElementLessEqual (const void *, unsigned int, const void *) const; virtual long compareElement (const void *, unsigned int, const void *) const; virtual void *elementAt (const void *, unsigned int) const; virtual unsigned int size (const void *) const; virtual void swapElements (void *, unsigned int, unsigned int) const; virtual unsigned int gradeUp (const void *, unsigned int, unsigned int *) const; virtual unsigned int gradeDown (const void *, unsigned int, unsigned int *) const; virtual void *badData() const; virtual void *defaultFiller() const; virtual MSString asString (const void *, unsigned int) const; virtual MSString asMSF (const void *, unsigned int) const; virtual unsigned int elementLen (const void *, unsigned int) const; virtual MSError::ErrorStatus setFromString (void *, unsigned int, const char *) const; virtual MSError::ErrorStatus setFromMSF (void *, unsigned int, const char *) const; virtual void print (const void *, unsigned int, ostream &) const; virtual unsigned int numElements (const MSString &, const char) const; virtual void setFromMSString (void *, unsigned int, const MSString &, unsigned int&, const char) const; }; #if defined(MS_NESTED_CLASSES_ACCESS_BUG) public: #endif class MSTypesExport SPick { protected: unsigned int _index; MSBinaryVector *_pVector; public: INLINELINKAGE SPick (MSBinaryVector &, unsigned int); INLINELINKAGE SPick (const SPick &); SPick & operator= (const SPick &); SPick & operator= (const unsigned char); INLINELINKAGE SPick & operator&= (const unsigned char); INLINELINKAGE SPick & operator|= (const unsigned char); INLINELINKAGE SPick & operator^= (const unsigned char); INLINELINKAGE operator unsigned char() const; }; protected: //*** data members ***// MSVectorImpl *_pImpl; #ifdef MS_MULTI_THREAD static MSMutex _operationsMutex; #endif MSBinaryVector (MSVectorImpl *); virtual unsigned int getLength() const; static Operations& ops(void); public: class MSTypesExport Data : public MSData { public: Data (unsigned int =0); ~Data(); void *operator new (size_t, unsigned =0); MSString asDebugInfo() const; INLINELINKAGE Data * incrementCount(); INLINELINKAGE void decrementCount(); INLINELINKAGE const unsigned char * elements() const; INLINELINKAGE const unsigned char * data() const; // same as elements(); used for backward compatibility only INLINELINKAGE unsigned char * elements(); INLINELINKAGE unsigned char * data(); // same as elements(); used for backward compatibility only INLINELINKAGE const unsigned char & elementAt (unsigned index_) const; INLINELINKAGE unsigned char & elementAt (unsigned index_); static void fill (unsigned char *, unsigned int, const unsigned char); static void copy (const unsigned char *src_, unsigned char *dst_, unsigned int length_); static void copyBackward (const unsigned char *, unsigned char *, unsigned int); static Data *allocateWithSize (unsigned int); static Data *allocateWithLength (unsigned int); void deallocate(); protected: unsigned char _pElements[1]; }; MSBinaryVector (); MSBinaryVector (unsigned int, unsigned char =0); MSBinaryVector (const MSBinaryVector &); MSBinaryVector (const char *); MSBinaryVector (Data *, unsigned int); MSBinaryVector (const unsigned char *, unsigned int); virtual ~MSBinaryVector(); MSBinaryVector & operator= (const MSBinaryVector &); MSBinaryVector & operator= (const unsigned char); virtual MSString asString() const; virtual MSString asMSF() const; virtual MSString asDebugInfo() const; virtual MSString className() const; virtual const MSSymbol & type() const; virtual MSModel *clone() const; virtual MSModel *create() const; virtual void assign (const MSModel &); virtual long compare (const MSModel &) const; virtual MSError::ErrorStatus set (const char *); virtual MSError::ErrorStatus setFromMSF (const char *); static const MSSymbol & symbol(); INLINELINKAGE unsigned int size() const; unsigned int length() const; unsigned char * data() const; INLINELINKAGE unsigned int indexOf (const unsigned char, unsigned int =0) const; INLINELINKAGE unsigned int lastIndexOf (const unsigned char, unsigned int =UINT_MAX-1) const; INLINELINKAGE unsigned int occurrencesOf (const unsigned char, unsigned int =0) const; INLINELINKAGE MSIndexVector indicesOf (const MSBinaryVector &) const; INLINELINKAGE MSBinaryVector memberOf (const MSBinaryVector &) const; MSError::ErrorStatus set (unsigned int, const unsigned char); INLINELINKAGE MSBinaryVector & replaceAt (unsigned int, const unsigned char); MSBinaryVector & append (const unsigned char); MSBinaryVector & append (const MSBinaryVector &); MSBinaryVector & insertAt (unsigned int, const unsigned char); MSBinaryVector & insertAt (unsigned int, const MSBinaryVector &); MSBinaryVector & removeAt (unsigned int); MSBinaryVector & removeAt (unsigned int, unsigned int); MSBinaryVector & remove (const MSIndexVector &); MSBinaryVector & remove (const MSBinaryVector &); MSBinaryVector & removeAll (); MSBinaryVector & select (const MSIndexVector &); MSBinaryVector & compress (const MSBinaryVector &); MSBinaryVector & reshape (unsigned int); MSBinaryVector & exchange (unsigned int, unsigned int); MSBinaryVector & reverse (); MSBinaryVector & rotate (int); MSBinaryVector & take (int, const unsigned char =0); MSBinaryVector & drop (int); static MSBinaryVector reverse (const MSBinaryVector &); static MSBinaryVector rotate (const MSBinaryVector &, int); static MSBinaryVector take (const MSBinaryVector &, int, const unsigned char =0); static MSBinaryVector drop (const MSBinaryVector &, int); static MSBinaryVector select (const MSBinaryVector &, const MSIndexVector &); static MSBinaryVector compress(const MSBinaryVector &, const MSBinaryVector &); MSBinaryVector & selectiveAssign (const MSIndexVector &, const unsigned char); MSBinaryVector & selectiveAssign (const MSIndexVector &, const MSBinaryVector &); MSBinaryVector & selectiveAssign (const MSBinaryVector &, const unsigned char); MSBinaryVector & selectiveAssign (const MSBinaryVector &, const MSBinaryVector &); virtual void permute (const MSIndexVector &); INLINELINKAGE unsigned char firstElement() const; INLINELINKAGE unsigned char lastElement () const; INLINELINKAGE unsigned char operator[] (unsigned int) const; INLINELINKAGE unsigned char operator() (unsigned int) const; INLINELINKAGE const unsigned char & elementAt (unsigned int) const; INLINELINKAGE SPick operator[] (unsigned int); INLINELINKAGE MSBinaryVector operator[] (const MSIndexVector &) const; INLINELINKAGE MSBinaryVector operator[] (const MSBinaryVector &) const; MSBinaryVector& random(void); // limit is always 2; nothing else makes sense friend MSTypesExport ostream & operator<< (ostream &, const MSBinaryVector &); INLINELINKAGE long compare (const MSBinaryVector &) const; INLINELINKAGE MSBinaryVector binaryCompare (const MSBinaryVector &, MSComparison) const; INLINELINKAGE MSBinaryVector binaryCompare (const unsigned char, MSComparison) const; INLINELINKAGE MSBoolean operator== (const MSBinaryVector &) const; INLINELINKAGE MSBoolean operator!= (const MSBinaryVector &) const; INLINELINKAGE friend MSTypesExport MSBoolean operator< (const MSBinaryVector &, const MSBinaryVector &); INLINELINKAGE friend MSTypesExport MSBoolean operator> (const MSBinaryVector &, const MSBinaryVector &); INLINELINKAGE friend MSTypesExport MSBoolean operator<= (const MSBinaryVector &, const MSBinaryVector &); INLINELINKAGE friend MSTypesExport MSBoolean operator>= (const MSBinaryVector &, const MSBinaryVector &); INLINELINKAGE friend MSTypesExport MSBoolean operator< (const MSBinaryVector &, const unsigned char); INLINELINKAGE friend MSTypesExport MSBoolean operator< (const unsigned char, const MSBinaryVector &); INLINELINKAGE friend MSTypesExport MSBoolean operator> (const MSBinaryVector &, const unsigned char); INLINELINKAGE friend MSTypesExport MSBoolean operator> (const unsigned char, const MSBinaryVector &); INLINELINKAGE friend MSTypesExport MSBoolean operator<= (const MSBinaryVector &, const unsigned char); INLINELINKAGE friend MSTypesExport MSBoolean operator<= (const unsigned char, const MSBinaryVector &); INLINELINKAGE friend MSTypesExport MSBoolean operator>= (const MSBinaryVector &, const unsigned char); INLINELINKAGE friend MSTypesExport MSBoolean operator>= (const unsigned char, const MSBinaryVector &); INLINELINKAGE friend MSTypesExport MSBoolean operator== (const MSBinaryVector &, const unsigned char); INLINELINKAGE friend MSTypesExport MSBoolean operator== (const unsigned char, const MSBinaryVector &); INLINELINKAGE friend MSTypesExport MSBoolean operator!= (const MSBinaryVector &, const unsigned char); INLINELINKAGE friend MSTypesExport MSBoolean operator!= (const unsigned char, const MSBinaryVector &); INLINELINKAGE MSBinaryVector & operator<<= (const unsigned char); INLINELINKAGE MSBinaryVector & operator<<= (const MSBinaryVector &); INLINELINKAGE MSBinaryVector & operator<< (const unsigned char); INLINELINKAGE MSBinaryVector & operator<< (const MSBinaryVector &); typedef void (*BitwiseOp)(unsigned char &, const unsigned char, const unsigned char); typedef unsigned char & (*BitwiseAssignOp)(unsigned char &, const unsigned char); static MSBinaryVector doBitwiseOp (const MSBinaryVector &, const MSBinaryVector &, BitwiseOp); static MSBinaryVector doBitwiseOp (const MSBinaryVector &, const unsigned char, BitwiseOp); MSBinaryVector & doBitwiseOp (const MSBinaryVector &, BitwiseAssignOp, BitwiseOp); MSBinaryVector & doBitwiseOp (const unsigned char, BitwiseAssignOp, BitwiseOp); INLINELINKAGE friend MSTypesExport MSBinaryVector operator& (const MSBinaryVector &, const MSBinaryVector &); INLINELINKAGE friend MSTypesExport MSBinaryVector operator& (const unsigned char, const MSBinaryVector &); INLINELINKAGE friend MSTypesExport MSBinaryVector operator& (const MSBinaryVector &, const unsigned char); INLINELINKAGE MSBinaryVector & operator&= (const MSBinaryVector &); INLINELINKAGE MSBinaryVector & operator&= (const unsigned char); INLINELINKAGE friend MSTypesExport MSBinaryVector operator| (const MSBinaryVector &, const MSBinaryVector &); INLINELINKAGE friend MSTypesExport MSBinaryVector operator| (const unsigned char, const MSBinaryVector &); INLINELINKAGE friend MSTypesExport MSBinaryVector operator| (const MSBinaryVector &, const unsigned char); INLINELINKAGE MSBinaryVector & operator|= (const MSBinaryVector &); INLINELINKAGE MSBinaryVector & operator|= (const unsigned char); INLINELINKAGE friend MSTypesExport MSBinaryVector operator^ (const MSBinaryVector &, const MSBinaryVector &); INLINELINKAGE friend MSTypesExport MSBinaryVector operator^ (const unsigned char, const MSBinaryVector &); INLINELINKAGE friend MSTypesExport MSBinaryVector operator^ (const MSBinaryVector &, const unsigned char); INLINELINKAGE MSBinaryVector & operator^= (const MSBinaryVector &); INLINELINKAGE MSBinaryVector & operator^= (const unsigned char); friend MSTypesExport MSBinaryVector operator! (const MSBinaryVector &); INLINELINKAGE friend MSTypesExport MSBinaryVector operator~ (const MSBinaryVector &); MSBinaryVector & complement(); double sum() const; }; void bitwiseAND (unsigned char &, const unsigned char, const unsigned char); void bitwiseOR (unsigned char &, const unsigned char, const unsigned char); void bitwiseXOR (unsigned char &, const unsigned char, const unsigned char); unsigned char & bitwiseAND (unsigned char &, const unsigned char); unsigned char & bitwiseOR (unsigned char &, const unsigned char); unsigned char & bitwiseXOR (unsigned char &, const unsigned char); #ifndef MS_NO_INLINES #include #endif // MS_NO_INLINES // We provide provide explicit "do_not_instantiate" pragmas here to avoid instantiation complications in // MStk applications. // #if !defined(__MSTYPESLIBRARY_BUILD__) && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma do_not_instantiate unsigned int msMergeSortUp(unsigned int,unsigned char *,unsigned int *,unsigned int,unsigned int) #pragma do_not_instantiate unsigned int msMergeSortDown(unsigned int,unsigned char *,unsigned int *,unsigned int,unsigned int) #endif // !__MSTYPESLIBRARY_BUILD__ && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #endif // MSBinaryVectorHEADER aplus-fsf-4.22/src/MSTypes/MSBool.H0000644000265000001440000000623410772770454012437 #ifndef MSBoolHEADER #define MSBoolHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include class MSFormat; #if defined (MS_PREDECLARE_NONTEMPLATE_FRIEND_FUNCTIONS) class MSBool; inline long compare (const MSBool &, const MSBool &); #endif class MSTypesExport MSBool: public MSScalarModel { public: enum MSBoolFormat {YesAndNo=0,TrueAndFalse=1,Binary=2}; MSBool(MSBoolean); MSBool(void); virtual MSString asString(void) const; virtual MSString asDebugInfo(void) const; virtual MSString asMSF(void) const; virtual MSString className(void) const; virtual const MSSymbol& type(void) const; virtual MSModel *clone(void) const; virtual MSModel *create(void) const; virtual void assign(const MSModel&); virtual long compare(const MSModel&) const; virtual MSError::ErrorStatus set(const char*); virtual MSError::ErrorStatus setFromMSF(const char*); static const MSSymbol& symbol(void); virtual MSError::ErrorStatus set(const MSString*); virtual MSError::ErrorStatus set(const MSString&); virtual MSError::ErrorStatus set(int); const char *format(MSString*) const; const char *format(MSString&) const; const char *format(MSString*,MSBoolFormat) const; const char *format(MSString&,MSBoolFormat) const; const char *format(MSString*,const MSFormat&) const; const char *format(MSString&,const MSFormat&) const; MSBoolean isSet(void) const; MSBoolean isTrue(void) const; MSBoolean isFalse(void) const; void unset(void); operator int() const; operator MSBoolean() const; inline friend MSTypesExport long compare (const MSBool &, const MSBool &); MSBoolean operator==(const MSBool&) const; MSBoolean operator==(int) const; MSBoolean operator!=(const MSBool&) const; MSBoolean operator!=(int) const; #if !defined MS_ENUM_COMPARE_BUG MSBoolean operator!=(MSBoolean) const; MSBoolean operator==(MSBoolean) const; friend MSTypesExport MSBoolean operator==(MSBoolean,const MSBool&); friend MSTypesExport MSBoolean operator!=(MSBoolean,const MSBool&); #endif MSBoolean operator <(const MSBool&) const; MSBoolean operator >(const MSBool&) const; MSBoolean operator<=(const MSBool&) const; MSBoolean operator>=(const MSBool&) const; friend MSTypesExport MSBoolean operator==(int,const MSBool&); friend MSTypesExport MSBoolean operator!=(int,const MSBool&); friend MSTypesExport ostream& operator<<(ostream& os_,const MSBool&); friend MSTypesExport istream& operator>>(istream& aStream_,MSBool&); MSBool& operator=(const MSBool&); MSBool& operator=(MSBoolean); MSBool& operator=(int); private: MSBoolean _bool; MSBoolean _isSet; }; inline long compare(const MSBool & aBool_,const MSBool & bBool_) { return (aBool_._bool==bBool_._bool)?0:(aBool_._bool>bBool_._bool)?1:-1; } #ifndef MS_NO_INLINES #include #endif #endif aplus-fsf-4.22/src/MSTypes/MSBoolVector.H0000644000265000001440000000326210772770454013620 #ifndef MSBoolVectorHEADER #define MSBoolVectorHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include typedef MSTypeVector MSBoolVector; inline MSBool msBadData(const MSBool&) { return MSBool(MSFalse); } // We provide provide explicit "do_not_instantiate" pragmas here to avoid instantiation complications in // MStk applications. // #if !defined(__MSTYPESLIBRARY_BUILD__) && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma do_not_instantiate MSVectorModelAllocator #pragma do_not_instantiate MSTypeData > #pragma do_not_instantiate MSBaseVector > #pragma do_not_instantiate MSBaseVectorOps > #pragma do_not_instantiate MSObjectVector #pragma do_not_instantiate MSVectorElement #pragma do_not_instantiate MSTypeVector #pragma do_not_instantiate ostream& operator<<(ostream&, const MSBaseVector >&) #pragma do_not_instantiate unsigned int msMergeSortUp(unsigned int, MSBool *, unsigned int *,unsigned int, unsigned int) #pragma do_not_instantiate unsigned int msMergeSortDown(unsigned int, MSBool *, unsigned int *,unsigned int, unsigned int) #endif // !__MSTYPESLIBRARY_BUILD__ && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #endif //MSBoolVectorHEADER aplus-fsf-4.22/src/MSTypes/MSBoyerMoore.H0000644000265000001440000000214110772770454013617 #ifndef MSBoyerMooreHEADER #define MSBoyerMooreHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSTypesExport MSBoyerMoore { private: static const unsigned DeltaTableSize; MSString _sourceString; MSString _searchPattern; unsigned *_deltaTable; unsigned deltaTableSize(void) const { return DeltaTableSize; } public: MSBoyerMoore(void); MSBoyerMoore(const MSString&); ~MSBoyerMoore(void); unsigned delta(char aChar_) const { return _deltaTable[(unsigned)aChar_]; } const MSString& sourceString(void) const { return _sourceString; } const MSString& searchPattern(void) const { return _searchPattern; } void searchPattern(const MSString& searchPattern_); void sourceString(const MSString& sourceString_); unsigned indexOf(unsigned startPos_,const char *searchPattern_=0); }; #endif aplus-fsf-4.22/src/MSTypes/MSBuiltinSPick.H0000644000265000001440000000367110772770454014106 #ifndef MSBuiltinSPickHEADER #define MSBuiltinSPickHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include template class MSBuiltinVector; template class MSBuiltinSPick { protected: unsigned int _index; MSBuiltinVector *_pVector; public: INLINELINKAGE MSBuiltinSPick (MSBuiltinVector &, unsigned int); INLINELINKAGE MSBuiltinSPick (const MSBuiltinSPick &); MSBuiltinSPick & operator= (const MSBuiltinSPick &); MSBuiltinSPick & operator= (const Type &); INLINELINKAGE MSBuiltinSPick & operator++(); // prefix increment INLINELINKAGE MSBuiltinSPick & operator--(); // prefix decrement INLINELINKAGE Type operator++ (int); // postfix increment INLINELINKAGE Type operator-- (int); // postfix decrement INLINELINKAGE MSBuiltinSPick & operator+= (const Type &); INLINELINKAGE MSBuiltinSPick & operator-= (const Type &); INLINELINKAGE MSBuiltinSPick & operator*= (const Type &); INLINELINKAGE MSBuiltinSPick & operator/= (const Type &); // these operators are for integral types only INLINELINKAGE MSBuiltinSPick & operator%= (const Type &); INLINELINKAGE MSBuiltinSPick & operator<<= (const Type &); INLINELINKAGE MSBuiltinSPick & operator>>= (const Type &); INLINELINKAGE MSBuiltinSPick & operator&= (const Type &); INLINELINKAGE MSBuiltinSPick & operator|= (const Type &); INLINELINKAGE MSBuiltinSPick & operator^= (const Type &); INLINELINKAGE operator Type() const; }; #ifndef MS_NO_INLINES #include #endif // MS_NO_INLINES #endif // MSBuiltinSPickHEADER aplus-fsf-4.22/src/MSTypes/MSBuiltinTypeVector.H0000644000265000001440000002444410772770454015202 #ifndef MSBuiltinTypeVectorHEADER #define MSBuiltinTypeVectorHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // /////////////////////////////////////////////////////////////////////////////// #if HAVE_IOSTREAM #include #endif #if HAVE_SSTREAM #include #include #else #include #endif #include #include #include #if defined(MS_NEED_IMPLEMENTATION_PRAGMA) #pragma implementation("MSBuiltinTypeVector.C") #endif template class MSBuiltinSPick; #if defined(MS_PREDECLARE_TEMPLATE_FRIENDS) template class MSBuiltinVector; template INLINELINKAGE MSBuiltinVector movingAverage(const MSBuiltinVector&, unsigned int); template INLINELINKAGE MSBuiltinVector operator-(const MSBuiltinVector&); template INLINELINKAGE MSBuiltinVector operator+(const MSBuiltinVector&, const MSBuiltinVector&); template INLINELINKAGE MSBuiltinVector operator-(const MSBuiltinVector&, const MSBuiltinVector&); template INLINELINKAGE MSBuiltinVector operator*(const MSBuiltinVector&, const MSBuiltinVector&); template INLINELINKAGE MSBuiltinVector operator/(const MSBuiltinVector&, const MSBuiltinVector&); template INLINELINKAGE MSBuiltinVector operator+(const MSBuiltinVector&, const Type&); template INLINELINKAGE MSBuiltinVector operator-(const MSBuiltinVector&, const Type&); template INLINELINKAGE MSBuiltinVector operator*(const MSBuiltinVector&, const Type&); template INLINELINKAGE MSBuiltinVector operator/(const MSBuiltinVector&, const Type&); template INLINELINKAGE MSBuiltinVector operator+(const Type&, const MSBuiltinVector&); template INLINELINKAGE MSBuiltinVector operator*(const Type&, const MSBuiltinVector&); template INLINELINKAGE MSBuiltinVector operator-(const Type&, const MSBuiltinVector&); template INLINELINKAGE MSBuiltinVector operator/(const Type&, const MSBuiltinVector&); #endif //MS_PREDECLARE_TEMPLATE_FRIENDS template class MSBuiltinVectorOps : public MSBaseVectorOps >, public MSBuiltinVectorImplOps { public: MSBuiltinVectorOps(); virtual ~MSBuiltinVectorOps(); virtual void set (void *, unsigned int, const void *, MSAllocationFlag =MSConstructed) const; virtual void set (void *, unsigned int, const void *, unsigned int, MSAllocationFlag =MSConstructed) const; virtual void setToNumber (void *, unsigned int, double) const; virtual double getAsNumber (const void *, unsigned int) const; #if HAVE_SSTREAM virtual void readFromStream (void *, unsigned int, istringstream &) const; virtual void writeToStream (const void *, unsigned int, ostringstream &) const; virtual void whitespace (istringstream &) const; #else virtual void readFromStream (void *, unsigned int, istrstream &) const; virtual void writeToStream (const void *, unsigned int, ostrstream &) const; virtual void whitespace (istrstream &) const; #endif virtual unsigned int stringLen (const char *) const; virtual void print (const void *, unsigned int, ostream &) const; virtual void *defaultFiller() const; }; template class MSBuiltinVector : public MSBaseVector > { protected: typedef MSBuiltinVectorOps Operations; #ifdef MS_MULTI_THREAD static MSMutex _operationsMutex; #endif static Operations& ops(void); #ifdef MS_CLASS_ENUM_OVERLOADING_BUG enum MathOp2 {Plus,Minus,Divide,Times,Incr,Decr,Unary}; typedef int MathOp; #else enum MathOp {Plus,Minus,Divide,Times,Incr,Decr,Unary}; #endif public: MSBuiltinVector (); MSBuiltinVector (unsigned int); MSBuiltinVector (unsigned int, const Type &); MSBuiltinVector (const MSBuiltinVector &); MSBuiltinVector (const MSBaseVector > &); MSBuiltinVector (const char *); MSBuiltinVector (MSBuiltinVectorImpl *); MSBuiltinVector (MSTypeData > *, unsigned int); MSBuiltinVector (const Type *, unsigned int); virtual ~MSBuiltinVector(); MSBuiltinVector & operator= (const MSBuiltinVector &); MSBuiltinVector & operator= (const MSBaseVector > &); MSBuiltinVector & operator= (const Type &); INLINELINKAGE Type firstElement() const; INLINELINKAGE Type lastElement () const; INLINELINKAGE Type operator() (unsigned int) const; INLINELINKAGE Type operator[] (unsigned int) const; INLINELINKAGE const Type & elementAt (unsigned int) const; INLINELINKAGE MSBuiltinSPick operator[] (unsigned int); INLINELINKAGE MSBuiltinVector operator[] (const MSIndexVector &) const; INLINELINKAGE MSBuiltinVector operator[] (const MSBinaryVector &) const; MSBuiltinVector & random (unsigned long =0); MSBuiltinVector & series (unsigned int, Type =0); INLINELINKAGE MSBuiltinVector & series (); Type min() const; Type max() const; double sum() const; INLINELINKAGE double avg() const; INLINELINKAGE double mean() const; INLINELINKAGE double median() const; INLINELINKAGE double variance(MSEstimateType =MSUnbiased) const; INLINELINKAGE double stdDeviation(MSEstimateType =MSUnbiased) const; INLINELINKAGE2 friend MSTypesExport MSBuiltinVector movingAverage MS_FRIEND_TEMPLATEID (const MSBuiltinVector &, unsigned int); INLINELINKAGE2 friend MSTypesExport MSBuiltinVector operator- MS_FRIEND_TEMPLATEID (const MSBuiltinVector &); INLINELINKAGE MSBuiltinVector & operator++ (); // prefix increment INLINELINKAGE MSBuiltinVector & operator-- (); // prefix decrement INLINELINKAGE MSBuiltinVector operator++ (int); // postfix increment INLINELINKAGE MSBuiltinVector operator-- (int); // postfix decrement INLINELINKAGE2 friend MSTypesExport MSBuiltinVector operator+ MS_FRIEND_TEMPLATEID (const MSBuiltinVector&, const MSBuiltinVector&); INLINELINKAGE2 friend MSTypesExport MSBuiltinVector operator- MS_FRIEND_TEMPLATEID (const MSBuiltinVector&, const MSBuiltinVector&); INLINELINKAGE2 friend MSTypesExport MSBuiltinVector operator* MS_FRIEND_TEMPLATEID (const MSBuiltinVector&, const MSBuiltinVector&); INLINELINKAGE2 friend MSTypesExport MSBuiltinVector operator/ MS_FRIEND_TEMPLATEID (const MSBuiltinVector&, const MSBuiltinVector&); INLINELINKAGE2 friend MSTypesExport MSBuiltinVector operator+ MS_FRIEND_TEMPLATEID(const MSBuiltinVector&, const Type&); INLINELINKAGE2 friend MSTypesExport MSBuiltinVector operator- MS_FRIEND_TEMPLATEID (const MSBuiltinVector&, const Type&); INLINELINKAGE2 friend MSTypesExport MSBuiltinVector operator* MS_FRIEND_TEMPLATEID (const MSBuiltinVector&, const Type&); INLINELINKAGE2 friend MSTypesExport MSBuiltinVector operator/ MS_FRIEND_TEMPLATEID (const MSBuiltinVector&, const Type&); INLINELINKAGE2 friend MSTypesExport MSBuiltinVector operator+ MS_FRIEND_TEMPLATEID (const Type&, const MSBuiltinVector&); INLINELINKAGE2 friend MSTypesExport MSBuiltinVector operator* MS_FRIEND_TEMPLATEID (const Type&, const MSBuiltinVector&); INLINELINKAGE2 friend MSTypesExport MSBuiltinVector operator- MS_FRIEND_TEMPLATEID (const Type&, const MSBuiltinVector&); INLINELINKAGE2 friend MSTypesExport MSBuiltinVector operator/ MS_FRIEND_TEMPLATEID (const Type&, const MSBuiltinVector&); INLINELINKAGE MSBuiltinVector& operator+=(const MSBuiltinVector&); INLINELINKAGE MSBuiltinVector& operator-=(const MSBuiltinVector&); INLINELINKAGE MSBuiltinVector& operator*=(const MSBuiltinVector&); INLINELINKAGE MSBuiltinVector& operator/=(const MSBuiltinVector&); INLINELINKAGE MSBuiltinVector& operator+=(const Type&); INLINELINKAGE MSBuiltinVector& operator-=(const Type&); INLINELINKAGE MSBuiltinVector& operator*=(const Type&); INLINELINKAGE MSBuiltinVector& operator/=(const Type&); protected: // operations on the current vector void doMath(const MSBuiltinVector&, MathOp); void doMath(const Type&, MathOp); // static operations static MSBuiltinVectorImpl* doMath(const MSBuiltinVector&, const MSBuiltinVector&, MathOp); static MSBuiltinVectorImpl* doMath(const MSBuiltinVector&, const Type&, MathOp); static MSBuiltinVectorImpl* doMath(const Type&, const MSBuiltinVector&, MathOp); }; #if HAVE_SSTREAM template void whitespace (const Type &, istringstream &); #else template void whitespace (const Type &, istrstream &); #endif template INLINELINKAGE unsigned int stringLen (const Type &, const char *); #ifndef MS_NO_INLINES #include #endif // MS_NO_INLINES #endif // MSBuiltinTypeVectorHEADER aplus-fsf-4.22/src/MSTypes/MSBuiltinVector.H0000644000265000001440000000107110772770454014327 #ifndef MSBuiltinVectorHEADER #define MSBuiltinVectorHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #endif aplus-fsf-4.22/src/MSTypes/MSBuiltinVectorImpl.H0000644000265000001440000000457110772770454015161 #ifndef MSBuiltinVectorImplHEADER #define MSBuiltinVectorImplHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include // #if HAVE_IOSTREAM // #include // // #include // using namespace std; // #else // class ostream; // #endif #if HAVE_SSTREAM #include #else class istrstream; class ostrstream; #endif class MSTypesExport MSBuiltinVectorImplOps { public: MSBuiltinVectorImplOps(); virtual ~MSBuiltinVectorImplOps(); virtual void setToNumber (void *, unsigned int, double) const =0; virtual double getAsNumber (const void *, unsigned int) const =0; #if HAVE_SSTREAM virtual void readFromStream (void *, unsigned int, istringstream &) const =0; virtual void writeToStream (const void *, unsigned int, ostringstream &) const =0; virtual void whitespace (istringstream &) const =0; #else virtual void readFromStream (void *, unsigned int, istrstream &) const =0; virtual void writeToStream (const void *, unsigned int, ostrstream &) const =0; virtual void whitespace (istrstream &) const =0; #endif virtual unsigned int stringLen (const char *) const =0; }; class MSTypesExport MSBuiltinVectorImpl : public MSVectorImpl { protected: MSBuiltinVectorImplOps *_pBuiltInOps; public: MSBuiltinVectorImpl (MSVectorImplOps *, MSBuiltinVectorImplOps *, unsigned int =0); MSBuiltinVectorImpl (MSVectorImplOps *, MSBuiltinVectorImplOps *, unsigned int, void *); MSBuiltinVectorImpl (const MSBuiltinVectorImpl &); MSBuiltinVectorImpl (MSVectorImplOps *, MSBuiltinVectorImplOps *, void *, unsigned int); virtual ~MSBuiltinVectorImpl(); virtual MSVectorImpl *create (unsigned int =0, unsigned int =0) const; virtual MSVectorImpl *clone () const; virtual MSString asMSF(); virtual MSError::ErrorStatus setFromString (const char *, const char =' '); virtual MSError::ErrorStatus setFromMSF (const char *); virtual MSIndexVector gradeUp () const; virtual MSIndexVector gradeDown() const; double median() const; double variance(double, MSEstimateType =MSUnbiased) const; MSBuiltinVectorImpl *movingAverage (unsigned int); }; #endif // MSBuiltinVectorImplHEADER aplus-fsf-4.22/src/MSTypes/MSCFRInterpolater.H0000644000265000001440000000201210772770454014535 #ifndef MSCFRInterpolaterHEADER #define MSCFRInterpolaterHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #if defined(MS_NEED_IMPLEMENTATION_PRAGMA) #pragma implementation("MSCFRInterpolater.C") #endif template class MSCFRInterpolater : public MSCurveInterpolater { public: MSCFRInterpolater(MSCurve *curve_,const X& xOrigin_); MSCFRInterpolater(MSCurve& curve_,const X& xOrigin_); ~MSCFRInterpolater(); virtual Y interpolate(const X& xValue_) const; virtual MSTypeVector interpolate(const MSTypeVector&) const; const X& xOrigin(void) const; protected: X _xOrigin; }; template inline const X& MSCFRInterpolater::xOrigin(void) const { return _xOrigin; } #endif aplus-fsf-4.22/src/MSTypes/MSCFVInterpolater.H0000644000265000001440000000200210772770454014540 #ifndef MSCFVInterpolaterHEADER #define MSCFVInterpolaterHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #if defined(MS_NEED_IMPLEMENTATION_PRAGMA) #pragma implementation("MSCFVInterpolater.C") #endif template class MSCFVInterpolater : public MSCurveInterpolater { public: MSCFVInterpolater(MSCurve *curve_,const X& xOrigin_); MSCFVInterpolater(MSCurve& curve_,const X& xOrigin_); ~MSCFVInterpolater(); virtual Y interpolate(const X& xValue_) const; virtual MSTypeVector interpolate(const MSTypeVector&) const; const X& xOrigin(void) const; protected: X _xOrigin; }; template inline const X& MSCFVInterpolater::xOrigin(void) const { return _xOrigin; } #endif aplus-fsf-4.22/src/MSTypes/MSCalendar.H0000644000265000001440000002221310772770455013251 #ifndef MSCalendarHEADER #define MSCalendarHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #if defined (MS_PREDECLARE_TEMPLATE_OP_FUNCTIONS) class MSResourceHolidaySet; class MSResourceCodeDesc; inline MSResourceCode const& key(MSResourceHolidaySet const& holidaySet_); inline MSResourceCode const& key(MSResourceCode const& resourceCode_); inline MSResourceCode const& key(MSResourceCode & resourceCode_); inline MSResourceCode const& key(MSResourceCodeDesc const& rcd_); #endif DECLARE_ELEMENT_FOR_OPS_TYPE(MSHoliday) class MSTypesExport MSResourceHolidaySet : public MSIHashKeySet { public: MSResourceHolidaySet() {} MSResourceHolidaySet(const MSResourceCode&); MSResourceHolidaySet(const MSResourceHolidaySet&); MSResourceHolidaySet& operator=(const MSResourceHolidaySet&); friend MSTypesExport ostream& operator<<(ostream&,const MSResourceHolidaySet&); const MSResourceCode& resourceCode(void) const; private: MSResourceCode _resourceCode; }; class MSTypesExport MSResourceCodeDesc { public: MSResourceCodeDesc() : _index(0) {} MSResourceCodeDesc(const MSResourceCode &,const MSString &); MSResourceCodeDesc(const MSResourceCodeDesc &); MSResourceCodeDesc& operator=(const MSResourceCodeDesc &); MSBoolean operator==(const MSResourceCodeDesc &) const; ~MSResourceCodeDesc() {}; unsigned int index() const {return _index;} const MSResourceCode & resourceCode() const {return _resourceCode;} const MSString & description() const {return _description;} void dump(void) const; private: MSResourceCode _resourceCode; unsigned int _index; // from 1 to 52 MSString _description; static unsigned int _count; }; DECLARE_ELEMENT_FOR_OPS_TYPE(MSResourceCodeDesc) DECLARE_ELEMENT_FOR_OPS_TYPE(MSResourceCodeHolidaySet) typedef MSIHashKeySet MSHolidaySet; typedef MSIHashKeySet MSResourceCodeDescriptionSet; typedef MSIHashKeySet::Cursor MSResourceCodeDescriptionSetCursor; class MSTypesExport MSCalendar { public: MSCalendar(void); ~MSCalendar(void); // returns list of holiday dates for a resource. static MSResourceHolidaySet holidayDateList(const MSResourceCode& resourceCode_) ; // returns true if date is a holiday for specific resource - if no // resource is supplied,the user's local country could be used. static MSBoolean isHoliday(const MSDate& aDate_="",const MSResourceCode& resourceCode_=""); static MSBoolean isHoliday(const MSDate& aDate_,const MSResourceCodeSet& resourceCodeSet_); // checks if valid trade date for supplied date and resource static MSBoolean isValidTradeDate(const MSDate& aDate_=MSDate::today(), const MSResourceCode& resourceCode_=""); static MSBoolean isValidTradeDate(const MSDate& aDate_,const MSResourceCodeSet & resourceCodeSet_); // return next/prev valid business date from the passed date argument // and resource codes static MSDate nextTradeDate(const MSDate& aDate_=MSDate::today(),const MSResourceCode& resourceCode_=""); static MSDate nextTradeDate(const MSDate& aDate_,const MSResourceCodeSet& resourceCodeSet_); static MSDate prevTradeDate(const MSDate& aDate_=MSDate::today(),const MSResourceCode& resourceCode_=""); static MSDate prevTradeDate(const MSDate& aDate_,const MSResourceCodeSet& resourceCodeSet_); // calculate the forward date from the passed string argument // (ex: 1M - one month) - if resourceCodes are supplied holidays for // those resources are taken into account static MSDate calcForwardDate(const MSTerm& aTerm_, const MSResourceCode& resourceCode_, const MSDate& startingDate_=MSDate::today()); static MSDate calcForwardDate(const MSTerm& aTerm_, const MSResourceCodeSet& resourceCodeSet_, const MSDate& startingDate_=MSDate::today()); // installs holidays for all resources a specified database static MSBoolean installHolidaySetFrom(const MSString&); // installs holidays for all resources from database static MSBoolean installHolidaySet(void); // installs holidays for a resource from database - used for demand loading static MSBoolean installHolidaySet(const MSString& resourceCode_); static MSBoolean installHolidaySet(const MSResourceCodeSet& resourceCodeSet_); // find the holiday set for a given resource code(s),if not in,load from // database static MSBoolean locateOrInstallHolidaySet(const MSResourceCode& resourceCode_); static MSBoolean locateOrInstallHolidaySet(const MSResourceCodeSet& resourceCodeSet_); // adds a single holiday for a given resource code static MSBoolean addHoliday(const MSHoliday& aHoliday_); static MSDate nextNTradeDate(const MSDate &,int,const MSResourceCodeSet &); static MSDate prevNTradeDate(const MSDate &,int,const MSResourceCodeSet &); friend MSTypesExport ostream& operator<<(ostream&,const MSCalendar&); static const MSString& defaultHolidayFile(void); static void defaultHolidayFile(const MSString&); static const MSString& defaultHolidayDescriptionFile(void); static void defaultHolidayDescriptionFile(const MSString&); static MSDate lastTradeDateOfMonth(const MSDate& aDate_,const MSResourceCodeSet & rCodeSet_); static MSDate lastTradeDateOfPrevMonth(const MSDate& aDate_,const MSResourceCodeSet & ); static MSDate firstTradeDateOfMonth(const MSDate& aDate_,const MSResourceCodeSet & rCodeSet_); static MSBoolean isLastTradeDateOfMonth(const MSDate & aDate_,const MSResourceCodeSet & rCodeSet_) { return (aDate_==lastTradeDateOfMonth(aDate_,rCodeSet_) ? MSTrue : MSFalse); } static MSBoolean isFirstTradeDateOfMonth(const MSDate & aDate_,const MSResourceCodeSet & rCodeSet_) { return (aDate_==firstTradeDateOfMonth(aDate_,rCodeSet_) ? MSTrue : MSFalse); } static MSBoolean isValidResourceCode(const MSResourceCode &); static unsigned int numberOfResourceCodes() ; static const MSString& descriptionOfResourceCode(const MSResourceCode & rCode_) ; static void dumpDescriptionSet(void); private: static MSResourceCodeDescriptionSet _descSet; static MSResourceCodeDescriptionSetCursor _descSetCursor; static MSString _defaultHolidayFile; static MSString _defaultHolidayDescriptionFile; static MSHolidaySet _holidaySet; static MSBoolean _isDescriptionDataInstalled; static MSString _invalidResourceCodeMessage; static MSBoolean installHolidayDescriptionData(void); static MSHolidaySet& holidaySet(void) { return _holidaySet; } static MSBoolean hasDescriptionDataInstalled(void); static MSBoolean isResourceCodeInDescSet(const MSResourceCode &); static MSBoolean parseAndAddHolidaySet(const MSString& holidayString_, const MSResourceCode& resourceCode_); static MSBoolean isHoliday(const MSDate& aDate_,const MSResourceHolidaySet&); static MSBoolean isValidTradeDate(const MSDate& aDate_,const MSResourceHolidaySet&); static MSDate lastTradeDateOfMonth(const MSDate& aDate_, const MSResourceHolidaySet& aSet1_, const MSResourceHolidaySet& aSet2_); }; // MSResourceHolidaySet inlines inline const MSResourceCode& MSResourceHolidaySet::resourceCode(void) const { return _resourceCode; } inline MSResourceCode const& key(MSResourceHolidaySet const& holidaySet_) { return holidaySet_.resourceCode(); } inline MSResourceCode const& key(MSResourceCode const& resourceCode_) { return resourceCode_; } inline MSResourceCode const& key(MSResourceCode & resourceCode_) { return resourceCode_; } // MSResourceCodeDesc inlines inline const MSResourceCode & key(const MSResourceCodeDesc & rcd_) { return rcd_.resourceCode(); } // We provide provide explicit "do_not_instantiate" pragmas here to avoid instantiation complications in // MStk applications. // #if !defined(__MSTYPESLIBRARY_BUILD__) && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma do_not_instantiate MSIHashKeySet #pragma do_not_instantiate MSIHashKeySetNode #pragma do_not_instantiate MSIHashKeySetCursor #pragma do_not_instantiate MSIHashKeySet #pragma do_not_instantiate MSIHashKeySetNode #pragma do_not_instantiate MSIHashKeySetCursor #pragma do_not_instantiate MSIHashKeySet #pragma do_not_instantiate MSIHashKeySetNode #pragma do_not_instantiate MSIHashKeySetCursor #endif // !__MSTYPESLIBRARY_BUILD__ && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) DECLARE_ELEMENT_FOR_OPS_TYPE(MSHoliday) DECLARE_ELEMENT_FOR_OPS_TYPE(MSResourceCodeDesc) DECLARE_ELEMENT_FOR_OPS_TYPE(MSResourceHolidaySet) #endif aplus-fsf-4.22/src/MSTypes/MSCallback.H0000644000265000001440000000076610772770455013245 #ifndef MSCallbackHEADER #define MSCallbackHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSTypesExport MSCallback { public: MSCallback(void); virtual ~MSCallback(void); virtual void process()=0; }; #endif aplus-fsf-4.22/src/MSTypes/MSCallbackBehavior.H0000644000265000001440000000255410772770455014722 #ifndef MSCallbackBehaviorHEADER #define MSCallbackBehaviorHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class CallbackVector; class CallbackNode; class MSTypesExport MSCallbackBehavior { protected: CallbackVector *_pCallbackVector; CallbackNode *callbackNode(const MSSymbol&); void deleteCallbackList(void); virtual void doCallback(MSCallback *); public: MSCallbackBehavior(void); virtual ~MSCallbackBehavior(void); // Callback methods - old API - should use add/remove API MSCallback *callback(const MSSymbol& name_); void callback(const MSSymbol& name_,MSCallback *callback_); // Callback interface void addCallback(const MSSymbol&,MSCallback *,void *); void removeCallback(const MSSymbol&,void *); void removeCallback(const MSSymbol&); void removeAllCallbacks(void); // does a callback exist for the given symbol MSBoolean hasCallback(const MSSymbol&) const; MSBoolean hasCallback(const MSSymbol&,void *) const; // activate all callbacks associated with the symbol MSBoolean activateCallback(const MSSymbol&); }; #endif aplus-fsf-4.22/src/MSTypes/MSChangedCallback.H0000644000265000001440000000313310772770455014506 #ifndef MSChangedCallbackHEADER #define MSChangedCallbackHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSTypesExport MSChangedCallback : public MSEventReceiver { public: MSChangedCallback(void); ~MSChangedCallback(void); virtual void process(MSEventSender *)=0; protected: virtual void receiveEvent(MSEvent&); }; template class MSMethodChangedCallback : public MSChangedCallback { typedef void (MethodClass::*Method)(MSEventSender *); private: Method _method; MethodClass *_object; public: #ifdef MS_METHOD_POINTER_DEFAULTARG_BUG MSMethodChangedCallback(MethodClass *object_,Method method_) : _object(object_),_method(method_) {} MSMethodChangedCallback(MethodClass *object_=0) : _object(object_),_method(0) {} #else MSMethodChangedCallback(MethodClass *object_=0,Method method_=0) : _object(object_),_method(method_) {} #endif void method(MethodClass* object_,Method method_) {_object=object_,_method=method_;} Method method(void) { return _method; } MethodClass *object(void) { return _object; } virtual void process(MSEventSender *); }; template inline void MSMethodChangedCallback::process(MSEventSender *sender_) { if(object()!=0&&method()!=0) (object()->*method())(sender_); } #endif aplus-fsf-4.22/src/MSTypes/MSCharMatrix.H0000644000265000001440000000664510772770455013615 #ifndef MSCharMatrixHEADER #define MSCharMatrixHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #ifndef MSTypeMatrixHEADER #include #endif typedef MSTypeMatrix MSCharMatrix; // We provide explicit "do_not_instantiate" pragmas here to avoid instantiation complications in // MStk applications. // #if !defined(__MSTYPESLIBRARY_BUILD__) #if defined(MS_EDG_TEMPLATE_INSTANTIATION) #if defined(MS_DO_NOT_INSTANTIATE) // // MStk templates are manually instantiated: provide "do_not_instantiate" pragmas for the manually instantiated entities // #pragma do_not_instantiate MSAllocator #pragma do_not_instantiate MSTypeData > #pragma do_not_instantiate MSTypeMatrix #pragma do_not_instantiate MSMatrixSTypePick #pragma do_not_instantiate MSTypeMatrix operator-(const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix operator+(const MSTypeMatrix&,char) #pragma do_not_instantiate MSTypeMatrix operator+(char,const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix operator+(const MSTypeMatrix&,const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix operator-(const MSTypeMatrix&,char) #pragma do_not_instantiate MSTypeMatrix operator-(const MSTypeMatrix&,const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix operator*(const MSTypeMatrix&,char) #pragma do_not_instantiate MSTypeMatrix operator*(char,const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix operator*(const MSTypeMatrix&,const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix operator/(const MSTypeMatrix&,char) #pragma do_not_instantiate MSTypeMatrix operator/(const MSTypeMatrix&,const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix operator+(const MSTypeMatrix&,const MSTypeVector&) #pragma do_not_instantiate MSTypeMatrix operator-(const MSTypeMatrix&,const MSTypeVector&) #pragma do_not_instantiate MSTypeMatrix operator*(const MSTypeMatrix&,const MSTypeVector&) #pragma do_not_instantiate MSTypeMatrix operator/(const MSTypeMatrix&,const MSTypeVector&) #pragma do_not_instantiate MSTypeMatrix operator+(const MSTypeVector&,const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix operator*(const MSTypeVector&,const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix multiply(const MSTypeMatrix&,const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix stack(const MSTypeMatrix&,const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix adjoin(const MSTypeMatrix&,const MSTypeMatrix&) #else // // MStk templates are automatically instantiated: provide "do_not_instantiate" pragmas for template function specializations // #pragma do_not_instantiate MSString MSTypeMatrix::asString(void) const #pragma do_not_instantiate ostream& operator<<(ostream&,const MSTypeMatrix&) #endif // MS_DO_NOT_INSTANTIATE #endif // MS_EDG_TEMPLATE_INSTANTIATION #endif // !__MSTYPESLIBRARY_BUILD__ #endif aplus-fsf-4.22/src/MSTypes/MSCharVector.H0000644000265000001440000001060610772770455013603 #ifndef MSCharVectorHEADER #define MSCharVectorHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #if defined(MS_NEED_IMPLEMENTATION_PRAGMA) #pragma implementation("MSCharVector.C") #endif #include #include #if defined(MS_TEMPLATE_BEFORE_SPECIALIZATION) #include #endif template class MSTypeVector; typedef MSBaseVector > BaseVectorChar; typedef MSBuiltinVector BuiltinVectorChar; #ifndef MS_MSCharVector_INSTANTIATE #ifdef MS_DECLARE_TEMPLATE_SPECIALIZATION template <> class MSBaseVector >; template <> class MSBaseVectorOps >; template <> class MSBuiltinVector; template <> class MSBuiltinVectorOps; template <> class MSBuiltinSPick; template <> MSBuiltinVector operator- (const MSBuiltinVector&); template <> ostream& operator<<(ostream&,const MSBaseVector >&); #endif #endif #if defined(MS_VC_NEED_TEMPLATE_EXPORT) class MSTypesExport MSBaseVector >; class MSTypesExport MSBaseVectorOps >; class MSTypesExport MSBuiltinVector; class MSTypesExport MSBuiltinVectorOps; class MSTypesExport MSBuiltinSPick; #endif #if !defined(MS_MSCharVector_INSTANTIATE) && defined(MS_STD_TEMPLATE_SPECIALIZATION) template <> class MSTypeVector : public BuiltinVectorChar #else template <> class MSTypesExport MSTypeVector : public BuiltinVectorChar #endif { public: MSTypeVector (); MSTypeVector (unsigned int); MSTypeVector (unsigned int, const char); MSTypeVector (const MSTypeVector &); MSTypeVector (const BuiltinVectorChar &); MSTypeVector (const BaseVectorChar &); MSTypeVector (const char *); MSTypeVector (MSTypeData > *, unsigned int); MSTypeVector (const char *, unsigned int); virtual ~MSTypeVector(); MSTypeVector & operator= (const MSTypeVector &); MSTypeVector & operator= (const BuiltinVectorChar &); MSTypeVector & operator= (const BaseVectorChar &); MSTypeVector & operator= (const char); MSTypeVector & operator= (const char *); virtual const MSSymbol & type() const; virtual MSString className() const; virtual MSModel *clone() const; virtual MSModel *create() const; static const MSSymbol & symbol(); }; typedef MSTypeVector MSCharVector; #ifndef MS_NO_INLINES #include #endif // MS_NO_INLINES // We provide explicit "do_not_instantiate" pragmas here to avoid instantiation complications in // MStk applications. // #if !defined(__MSTYPESLIBRARY_BUILD__) #if defined(MS_EDG_TEMPLATE_INSTANTIATION) #if defined(MS_DO_NOT_INSTANTIATE) // // MStk templates are manually instantiated: provide "do_not_instantiate" pragmas for the manually instantiated entities // #pragma do_not_instantiate MSAllocator #pragma do_not_instantiate MSTypeData > #pragma do_not_instantiate MSBaseVector > #pragma do_not_instantiate MSBaseVectorOps > #pragma do_not_instantiate MSBuiltinVector #pragma do_not_instantiate MSBuiltinVectorOps #pragma do_not_instantiate MSBuiltinSPick #pragma do_not_instantiate ostream& operator<<(ostream&, const MSBaseVector >&) #pragma do_not_instantiate unsigned int msMergeSortUp(unsigned int, char *, unsigned int *,unsigned int, unsigned int) #pragma do_not_instantiate unsigned int msMergeSortDown(unsigned int, char *, unsigned int *,unsigned int, unsigned int) #else // // MStk templates are automatically instantiated: provide "do_not_instantiate" pragmas for template function specializations // #pragma do_not_instantiate MSString MSBaseVector >::asString(void) const #pragma do_not_instantiate void MSBuiltinVectorOps::print(const void *,unsigned int,ostream&) const #pragma do_not_instantiate void whitespace(const char &,istrstream &) #endif // MS_DO_NOT_INSTANTIATE #endif // MS_EDG_TEMPLATE_INSTANTIATION #endif // !__MSTYPESLIBRARY_BUILD__ #endif // MSCharVectorHEADER aplus-fsf-4.22/src/MSTypes/MSComparator.H0000644000265000001440000001225710772770455013656 #ifndef MSOVComparatorHEADER #define MSOVComparatorHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include // // MSComparator, encapsulates a pointer to a class member function. // // // MSComparatorList, a sequence of pointers to MSComparator objects // template class MSBaseComparator { public: MSBaseComparator(MSBoolean ascendingOrder_=MSTrue) :_ascendingOrder(ascendingOrder_) {} virtual ~MSBaseComparator(void) {} MSBaseComparator(const MSBaseComparator &comp_) { _ascendingOrder=comp_._ascendingOrder; } MSBaseComparator &operator=(const MSBaseComparator &comp_) { if (this!=&comp_) _ascendingOrder=comp_._ascendingOrder; return *this; } virtual long compare(const ArrayElementType&, const ArrayElementType&) { return 0;} void ascendingOrder(MSBoolean b_){_ascendingOrder=b_;} MSBoolean ascendingOrder(void) const { return _ascendingOrder; } virtual MSBaseComparator* clone(void) const { return new MSBaseComparator(*this);} protected: MSBoolean _ascendingOrder; }; template class MSComparator : public MSBaseComparator { public: typedef const Type& (ElementType::*GetMethod)(void) const; MSComparator(GetMethod getMethod_, MSBoolean order_ = MSTrue) :MSBaseComparator(order_),_getMethod(getMethod_) {} virtual long compare(const ArrayElementType& r1_, const ArrayElementType& r2_) { const Type& aType = (elementForOps(r1_).*_getMethod)(); const Type& bType = (elementForOps(r2_).*_getMethod)(); if ( &aType != &bType) // check if it's not a reference to the same static variable { return _ascendingOrder ? ::compare(aType,bType) : ::compare(bType,aType); } else //if it is make local copies { const Type bValue = bType; const Type aValue = (elementForOps(r1_).*_getMethod)(); return _ascendingOrder ? ::compare(aValue,bValue) : ::compare(bValue,aValue); } } virtual MSBaseComparator* clone(void) const { return new MSComparator(*this); } protected: GetMethod _getMethod; }; template class MSAscComparator : public MSComparator { public: typedef MSComparator::GetMethod GetMethod; MSAscComparator(GetMethod getMethod_) : MSComparator(getMethod_) {} ~MSAscComparator() {} }; template class MSDescComparator : public MSComparator { public: typedef MSComparator::GetMethod GetMethod; MSDescComparator(GetMethod getMethod_) : MSComparator(getMethod_,MSFalse) {} ~MSDescComparator() {} }; // // Array of MSComparators. Keeps a MSManagedPointer to a comparator. // Use comparator clone function to make sure comparator created on the heap. // Provides simple IBM Sequence interface // template < class ArrayElementType > class MSComparatorList : private ITabularSequence > > { typedef MSBaseComparator MSBaseComparatorType; typedef MSManagedPointer MSComparatorListElem; typedef ITabularSequence MSComparatorListBaseType; public: MSComparatorList() {} ~MSComparatorList() {} // Add functions void add(const MSBaseComparatorType& comp_) { MSComparatorListBaseType::add(MSComparatorListElem(comp_.clone(), MSInit)); } void addAsLast(const MSBaseComparatorType& comp_) { MSComparatorListBaseType::addAsLast(MSComparatorListElem(comp_.clone(), MSInit)); } void addAtPosition(unsigned pos_,const MSBaseComparatorType& comp_) { MSComparatorListBaseType::addAtPosition(pos_,MSComparatorListElem(comp_.clone(), MSInit)); } // Access functions const MSBaseComparatorType& elementAtPosition(unsigned pos_) const { return *MSComparatorListBaseType::elementAtPosition(pos_); } MSBaseComparatorType& elementAtPosition(unsigned pos_) { return *MSComparatorListBaseType::elementAtPosition(pos_); } const MSBaseComparatorType& firstElement() const { return *MSComparatorListBaseType::firstElement(); } const MSBaseComparatorType& lastElement() const { return *MSComparatorListBaseType::lastElement(); } unsigned long numberOfElements() const { return MSComparatorListBaseType::numberOfElements(); } // Remove functions void removeAtPosition(unsigned pos_) { MSComparatorListBaseType::removeAtPosition(pos_); } void removeAll() { MSComparatorListBaseType::removeAll(); } }; #endif aplus-fsf-4.22/src/MSTypes/MSConstantInterpolater.H0000644000265000001440000000154310772770455015725 #ifndef MSConstantInterpolaterHEADER #define MSConstantInterpolaterHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #if defined(MS_NEED_IMPLEMENTATION_PRAGMA) #pragma implementation("MSConstantInterpolater.C") #endif template class MSConstantInterpolater : public MSCurveInterpolater { public: MSConstantInterpolater(MSCurve *curve_); MSConstantInterpolater(MSCurve& curve_); ~MSConstantInterpolater(); virtual Y interpolate(const X& xValue_) const; virtual MSTypeVector interpolate(const MSTypeVector&) const; }; #endif aplus-fsf-4.22/src/MSTypes/MSConvert.H0000644000265000001440000000145710772770455013167 #ifndef MSConvertHEADER #define MSConvertHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include template class MSTypeVector; typedef MSTypeVector MSIntVector; typedef MSTypeVector MSFloatVector; class MSIndexVector; class MSBinaryVector; MSError::ErrorStatus msConvert(const MSIntVector&, MSFloatVector&); MSError::ErrorStatus msConvert(const MSBinaryVector&, MSIndexVector&); #ifndef MS_NO_INLINES #include #endif // MS_NO_INLINES #endif //MSConvertHEADER aplus-fsf-4.22/src/MSTypes/MSCurve.H0000644000265000001440000003276510772770455012641 #ifndef MSCurveHEADER #define MSCurveHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #ifndef MSDefinesHEADER #include #endif #if defined(MS_NEED_IMPLEMENTATION_PRAGMA) #pragma implementation("MSCurve.C") #endif template class MSIPointPick; // MSCurve indexed by MSIndexVector template class MSBPointPick; // MSCurve indexed by MSBinaryVector template class MSSPointPick; // MSCurve indexed by a MSPoint template class MSCurveInterpolater; #if defined(MS_PREDECLARE_TEMPLATE_FRIENDS) template class MSCurve; template ostream& operator<<(ostream& aStream_, const MSCurve& aCurve_); #endif //MS_PREDECLARE_TEMPLATE_FRIENDS template class MSCurve : public MSIndexedModel, public MSEventReceiver { friend MSIPointPick; friend MSBPointPick; public: enum Method {Linear,Quadratic,Cubic,CubicSpline,Exponential,Polynomial}; virtual MSString asString(void) const; virtual MSString asDebugInfo(void) const; virtual MSString asMSF(void) const; virtual MSString className(void) const; virtual const MSSymbol& type(void) const; virtual MSError::ErrorStatus set(const char *); virtual MSError::ErrorStatus setFromMSF(const char *); virtual MSModel *clone(void) const; virtual MSModel *create(void) const; virtual void assign(const MSModel&); virtual long compare(const MSModel&) const; static const MSSymbol& symbol(void); // ------------------------------------------------------------- // INSTANCE CREATION // ------------------------------------------------------------- MSCurve(unsigned numPoints_=0); MSCurve(const MSCurve&); MSCurve(const MSTypeVector&,const MSTypeVector&); ~MSCurve(); virtual void receiveEvent(MSEvent&); // ------------------------------------------------------------- // ASSIGNMENT // ------------------------------------------------------------- MSCurve& operator=(const MSCurve&); MSCurve& operator=(const MSIPointPick&); MSCurve& operator=(const MSBPointPick&); MSCurve& operator=(const MSPoint&); void setXValue(unsigned index_,X value_); void setYValue(unsigned index_,Y value_); void replaceAt(unsigned index_,const MSPoint& point_); void replaceAt(unsigned index_,const X& xValue_,const Y& yValue_); // ------------------------------------------------------------- // ACCESSING // ------------------------------------------------------------- inline MSTypeVector& xVector(void); inline MSTypeVector& yVector(void); inline const MSTypeVector& xVector(void) const; inline const MSTypeVector& yVector(void) const; friend ostream& operator<<(ostream& aStream_,const MSCurve& aCurve_); inline MSPoint operator()(unsigned index_) const; inline MSPoint operator[](unsigned index_) const; inline MSSPointPick operator()(unsigned index_); inline MSSPointPick operator[](unsigned index_); inline MSIPointPick operator[](const MSIndexVector&); inline const MSIPointPick operator[](const MSIndexVector&) const; inline MSBPointPick operator[](const MSBinaryVector&); inline const MSBPointPick operator[](const MSBinaryVector&) const; inline MSPoint firstElement(void) const; inline MSPoint lastElement(void) const; inline MSPoint elementAt(unsigned index_) const; inline unsigned length(void) const; // ------------------------------------------------------------- // UPDATING // ------------------------------------------------------------- MSCurve& removeAll(void); MSCurve& append(const X&,const Y&); MSCurve& append(const MSPoint&); MSCurve& append(const MSTypeVector&,const MSTypeVector&); MSCurve& insertAt(unsigned index_,const MSPoint&); MSCurve& insertAt(unsigned index_,const MSTypeVector&,const MSTypeVector&); MSCurve& removeAt(unsigned index_); MSCurve& removeAt(unsigned startPos_,unsigned numElements_); MSCurve& remove(const MSIndexVector&); MSCurve& remove(const MSBinaryVector&); MSCurve& exchange(unsigned,unsigned); MSCurve& select(const MSIndexVector&); MSCurve& compress(const MSBinaryVector&); // ------------------------------------------------------------- // QUERY // ------------------------------------------------------------- inline unsigned numberOfPoints(void) const; inline MSBoolean isEmpty(void) const; // ------------------------------------------------------------- // INTERPOLATION // ------------------------------------------------------------- Y operator()(const X&,MSCurveInterpolater *pInterpolater_) const; Y operator()(const X&,MSCurveInterpolater& pInterpolater_) const; MSTypeVector operator()(const MSTypeVector&,MSCurveInterpolater *pInterpolater_) const; MSTypeVector operator()(const MSTypeVector&,MSCurveInterpolater& pInterpolater_) const; Y interpolate(const X&,MSCurveInterpolater *pInterpolater_) const; Y interpolate(const X&,MSCurveInterpolater& pInterpolater_) const; MSTypeVector interpolate(const MSTypeVector&,MSCurveInterpolater *pInterpolater_) const; MSTypeVector interpolate(const MSTypeVector&,MSCurveInterpolater& pInterpolater_) const; // ------------------------------------------------------------- // ARITHMETIC // ------------------------------------------------------------- // ------------------------------------------------------------- // BOOLEAN // ------------------------------------------------------------- //inline friend long compare(const MSCurve&,const MSCurve&); // ------------------------------------------------------------- // STATISTICS // ------------------------------------------------------------- // ------------------------------------------------------------- // DEPENDENCY // ------------------------------------------------------------- protected: MSTypeVector _xVector; MSTypeVector _yVector; MSBoolean _blocked; void init(void); inline MSBoolean blocked(void); inline void blocked(MSBoolean); }; //-------------------- // MSCurve inlines //-------------------- template inline MSTypeVector& MSCurve::xVector(void) { return _xVector; } template inline MSTypeVector& MSCurve::yVector(void) { return _yVector; } template inline const MSTypeVector& MSCurve::xVector(void) const { return _xVector; } template inline const MSTypeVector& MSCurve::yVector(void) const { return _yVector; } template inline MSBoolean MSCurve::blocked(void) { return _blocked; } template inline void MSCurve::blocked(MSBoolean aBool_) { _blocked=aBool_; } template inline unsigned MSCurve::length(void) const { return _xVector.length(); } template inline MSPoint MSCurve::firstElement(void) const { return MSPoint(xVector()(0),yVector()(0)); } template inline MSPoint MSCurve::lastElement(void) const { return MSPoint(xVector()(length()-1),yVector()(length()-1)); } template inline MSPoint MSCurve::elementAt(unsigned index_) const { return MSPoint(xVector()(index_),yVector()(index_)); } template inline unsigned MSCurve::numberOfPoints(void) const { return length(); } template inline MSBoolean MSCurve::isEmpty(void) const { return length()==0?MSTrue:MSFalse; } // template // inline long compare(const MSCurve& aCurve_,const MSCurve& bCurve_) // { return aCurve_.xVector().compare(bCurve_.xVector()); } //------------------------- // MSIPointPick declaration //------------------------- template class MSIPointPick { public: MSIPointPick& operator=(const MSCurve&); MSIPointPick& operator=(const MSIPointPick&); MSIPointPick& operator=(const MSBPointPick&); MSIPointPick& operator=(const MSPoint&); inline MSCurve *pCurve(void) const; inline const MSIndexVector *pIndexVector(void) const; private: friend MSCurve; friend MSIndexVector; inline MSIPointPick(const MSCurve&,const MSIndexVector&); inline MSIPointPick(const MSIPointPick&); void changed(void); MSCurve *_pCurve; const MSIndexVector *_pIndexVector; }; //---------------------- // MSIPointPick inlines //---------------------- template inline MSIPointPick::MSIPointPick(const MSCurve& aCurve_,const MSIndexVector& aIndexVector_) { _pCurve=&(MSCurve&)aCurve_; _pIndexVector=&aIndexVector_; } template inline MSIPointPick::MSIPointPick(const MSIPointPick& aPick_) { _pCurve=aPick_.pCurve(); _pIndexVector=aPick_.pIndexVector(); } template inline MSCurve *MSIPointPick::pCurve(void) const { return _pCurve; } template inline const MSIndexVector *MSIPointPick::pIndexVector(void) const { return _pIndexVector; } //------------------------- // MSBPointPick declaration //------------------------- template class MSBPointPick { public: MSBPointPick& operator=(const MSCurve&); MSBPointPick& operator=(const MSBPointPick&); MSBPointPick& operator=(const MSIPointPick&); MSBPointPick& operator=(const MSPoint&); inline MSCurve *pCurve(void) const; inline const MSBinaryVector *pBinaryVector(void) const; private: friend MSCurve; friend MSBinaryVector; inline MSBPointPick(const MSCurve&,const MSBinaryVector&); inline MSBPointPick(const MSBPointPick&); void changed(void); MSCurve *_pCurve; const MSBinaryVector *_pBinaryVector; }; //------------------------- // MSBPointPick inlines //------------------------- template inline MSCurve *MSBPointPick::pCurve(void) const { return _pCurve; } template inline const MSBinaryVector *MSBPointPick::pBinaryVector(void) const { return _pBinaryVector; } template inline MSBPointPick::MSBPointPick(const MSCurve& aCurve_,const MSBinaryVector& aBinaryVector_) { _pCurve=&(MSCurve&)aCurve_; _pBinaryVector=&aBinaryVector_; } template inline MSBPointPick::MSBPointPick(const MSBPointPick& aPick_) { _pCurve=aPick_.pCurve(); _pBinaryVector=aPick_.pBinaryVector(); } //------------------------- // MSSPointPick declaration //------------------------- template class MSSPointPick { public: MSSPointPick& operator=(const MSPoint&); inline MSCurve *pCurve(void) const; inline unsigned index(void) const; private: friend MSCurve; inline MSSPointPick(const MSCurve& aCurve_,unsigned index_); inline MSSPointPick(const MSSPointPick& aPoint_); MSCurve *_pCurve; unsigned _index; }; //---------------------- // MSSPointPick inlines //---------------------- template MSSPointPick::MSSPointPick(const MSCurve& aCurve_,unsigned index_) { _pCurve=&(MSCurve&)aCurve_; _index=index_; } template MSSPointPick::MSSPointPick(const MSSPointPick& aPoint_) { _pCurve=aPoint_.pCurve(); _index=aPoint_.index(); } template MSCurve *MSSPointPick::pCurve(void) const { return _pCurve; } template unsigned MSSPointPick::index(void) const { return _index; } //---------------------------------------------------------------------- // Pick Indexing operators - define here to avoid inline problem //---------------------------------------------------------------------- template inline MSIPointPick MSCurve::operator[](const MSIndexVector& aIndexVector_) { return MSIPointPick(*this,aIndexVector_); } template inline const MSIPointPick MSCurve::operator[](const MSIndexVector& aIndexVector_) const { return MSIPointPick(*this,aIndexVector_); } template inline MSBPointPick MSCurve::operator[](const MSBinaryVector& aBinaryVector_) { return MSBPointPick(*this,aBinaryVector_); } template inline const MSBPointPick MSCurve::operator[](const MSBinaryVector& aBinaryVector_) const { return MSBPointPick(*this,aBinaryVector_); } template inline MSSPointPick MSCurve::operator[](unsigned index_) { return MSSPointPick(*this,index_); } template inline MSSPointPick MSCurve::operator()(unsigned index_) { return MSSPointPick(*this,index_); } template inline MSPoint MSCurve::operator[](unsigned index_) const { return elementAt(index_); } template inline MSPoint MSCurve::operator()(unsigned index_) const { return elementAt(index_); } #endif aplus-fsf-4.22/src/MSTypes/MSCurveInterpolater.H0000644000265000001440000000363010772770455015217 #ifndef MSCurveInterpolaterHEADER #define MSCurveInterpolaterHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #ifndef MSDefinesHEADER #include #endif #if defined(MS_NEED_IMPLEMENTATION_PRAGMA) #pragma implementation("MSCurveInterpolater.C") #endif template class MSCurve; template class MSTypeVector; // WARNING - PLEASE READ THIS: // // We have observed a problem when passing any of the // built-in types by const reference: for example, // // template // void Foo::doSomething(const X& x_) // // Foo foo; // int x=99; // foo.doSomething(x++); // // It turns out that in foo, the value of x is 100, when it should // be 99. This problem can be avoided if the prototype was pass by // value instead of pass by reference. We believe this to be a compiler // bug, but one should be cautious and avoid this type of syntax. template class MSCurveInterpolater : public MSEventReceiver { public: MSCurveInterpolater(MSCurve *curve_); MSCurveInterpolater(MSCurve& curve_); ~MSCurveInterpolater(); virtual Y interpolate(const X&) const=0; virtual MSTypeVector interpolate(const MSTypeVector&) const=0; MSBoolean isValid(void) const; MSCurve *curve(void) const; protected: MSCurve *_curve; MSBoolean _isValid; virtual void receiveEvent(MSEvent&); }; template inline MSBoolean MSCurveInterpolater::isValid(void) const { return _isValid; } template inline MSCurve *MSCurveInterpolater::curve(void) const { return _curve; } #endif aplus-fsf-4.22/src/MSTypes/MSData.H0000644000265000001440000000447210772770455012420 #ifndef MSDataHEADER #define MSDataHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #ifdef MS_MULTI_THREAD #include #endif class MSTypesExport MSData { protected: #ifdef MS_MULTI_THREAD MSMutex _mutex; // ref count lock #endif unsigned _size; unsigned _refCount; public: MSData (unsigned int =0); ~MSData(); INLINELINKAGE unsigned size() const; INLINELINKAGE unsigned refCount() const; static unsigned int computeSize (unsigned int); }; // // MSDataAlignment structure is a special way of calculating // the appropriate alignment of MSData. MSData is implicitly going // to be followed by an array of data elements; however, depending // on what type those elements actually are (or what types they // contain inside), we may need to align the beginning of the array // correctly - in the same way as it would be aligned automatically // by the compiler. // For example, if we have an array of double's following MSData, // then that array has to start on an 8-byte boundary. MSData itself // does not guarantee that, since it does not know what type of // elements are coming after it. Therefore, if we want to align the // array correctly, we cannot simply use sizeof(MSData) to see where // MSData ends and where the array should start. That's why we need // an auxiliary structure - MSDataAlignment. // // MSDataAlignment structure can be used to find out how MSData // should be aligned when it's followed by an array of elements of // type Type. To get the *real* size of MSData (including possible // alignment), we can just use the offsetof() macro to find out where // _pElements starts: offsetof(MSDataAlignment,_pElements). // This can be done in subclasses of MSData (such as MSTypeData) // to calculate the total number of bytes to be allocated considering // alignment issues. // template struct MSDataAlignment { MSData _msData; Type _pElements[1]; }; #ifndef MS_NO_INLINES #include #endif // MS_NO_INLINES #endif // MSDataHEADER aplus-fsf-4.22/src/MSTypes/MSDate.H0000644000265000001440000002224310772770455012420 #ifndef MSDateHEADER #define MSDateHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include class MSFormat; typedef unsigned MSDay; typedef unsigned MSMonth; typedef unsigned MSYear; typedef unsigned long MSJulian; class MSTypesExport MSDate : public MSScalarModel { public: enum MSDateFormat { Slash=100, // Format as 11/15/92 (American) Slash4=101, // Format as 11/15/1992 (American) Terse=102, // Format as 11-Nov-92 Terse4=103, // Format as 11-Nov-1992 Long=104, // Format as November 15, 1992 MonthYear=105, // Format as Nov 92 YearMonthDay=106, // Format as 1992/11/15 Year2MonthDay=107, // Format as 92/11/15 EuropeanDot=108, // Format as 15.11.92 EuropeanDot4=109, // Format as 15.11.1992 Database=110, // Format as 19921115 (yyyymmdd) DataBase=Database, // Same as above (preserved for backward compatibility only) Julian=111, // Format as a Julian day number Strftime=112 // Format as Standard C Library strftime format }; // order of printing fields in the above formats // used also for scanning fields on input enum MSDateLocale {European,American,Japanese}; enum MSWeekDays {Monday=1,Tuesday=2,Wednesday=3,Thursday=4,Friday=5,Saturday=6,Sunday=7}; MSDate(void); MSDate(const char *); MSDate(const MSDate&); MSDate(const MSTime&,MSTime::MSTimeZone=MSTime::Local); MSDate(const MSString&); MSDate(MSJulian); MSDate(int month_,int day_,int year_); MSDate(const MSString&,const char* strptimeFormat_); ~MSDate(void); virtual MSString asString(void) const; virtual MSString asDebugInfo(void) const; virtual MSString asMSF(void) const; virtual MSString className(void) const; virtual const MSSymbol& type(void) const; virtual MSModel *clone(void) const; virtual MSModel *create(void) const; virtual void assign(const MSModel&); virtual long compare(const MSModel&) const; virtual MSError::ErrorStatus set(const char*); virtual MSError::ErrorStatus setFromMSF(const char*); static const MSSymbol& symbol(void); virtual MSError::ErrorStatus set(const MSString*); virtual MSError::ErrorStatus set(const MSString&); virtual MSError::ErrorStatus set(const char *month_,const char *day_,const char *year_); virtual MSError::ErrorStatus set(int month_,int day_,int year_); virtual const char *format(MSString*) const; virtual const char *format(MSString&) const; virtual const char *format(MSString*,MSDateFormat) const; virtual const char *format(MSString&,MSDateFormat) const; virtual const char *format(MSString*,const MSFormat&) const; virtual const char *format(MSString&,const MSFormat&) const; virtual const char *format(MSString*,const char *format_) const; virtual const char *format(MSString&,const char *format_) const; virtual void setToday(void); virtual time_t asCalendarTime(MSTime::MSTimeZone=MSTime::Local) const; // return represenation of this date as a julian number virtual MSJulian date(void) const; // return internal representation of this date MSJulian asInternal(void) const; // Date-specific functions virtual MSBoolean between(const MSDate&,const MSDate&) const; virtual MSDay dayOfYear(void) const; // 1-366 virtual MSDay dayOfMonth(void) const; // 1-31 virtual MSDay daysInMonth(void) const; // 1-31 virtual MSDay daysInYear(void) const; // 1-366 virtual unsigned weekOfYear(void) const; // 1-52 virtual MSDay firstDayOfMonth(void) const; virtual MSDay firstDayOfMonth(MSMonth) const; virtual void setFirstDayOfMonth(void); virtual MSDay lastDayOfMonth(void) const; virtual MSDay lastDayOfMonth(MSMonth) const; virtual void setLastDayOfMonth(void); virtual MSBoolean isSet(void) const; virtual MSBoolean isValid(void) const; virtual MSBoolean isLeapYear(void) const; virtual MSBoolean leap(void) const; virtual const char *nameOfDay(void) const; virtual const char *nameOfMonth(void) const; virtual MSDate max(const MSDate&) const; virtual MSDate min(const MSDate&) const; virtual MSMonth month(void) const; virtual MSDate previous(const char* dayName) const; virtual MSDate previous(MSDay) const; virtual MSDay weekDay(void) const; virtual MSYear year(void) const; virtual void asMonthDayYear(MSMonth&,MSDay&,MSYear&) const; virtual void nextWeekday(void); virtual void prevWeekday(void); virtual MSBoolean isWeekday(void) const; virtual MSBoolean isWeekend(void) const; virtual void unset(void); friend MSTypesExport ostream& operator<<(ostream&,const MSDate&); friend MSTypesExport istream& operator>>(istream&,MSDate&); operator double() const; operator unsigned long() const; MSDate& operator=(const MSDate&); INLINELINKAGE MSBoolean operator <(const MSDate&) const; INLINELINKAGE MSBoolean operator >(const MSDate&) const; INLINELINKAGE MSBoolean operator<=(const MSDate&) const; INLINELINKAGE MSBoolean operator>=(const MSDate&) const; INLINELINKAGE MSBoolean operator==(const MSDate&) const; INLINELINKAGE MSBoolean operator!=(const MSDate&) const; inline friend MSTypesExport unsigned long hash(const MSDate&,unsigned long size_); // date - date returns difference in days. int operator-(const MSDate&) const; // date + term = date MSDate operator+(const MSTerm&) const; MSDate& operator+=(const MSTerm&); // date + days = date MSDate operator+(int) const; MSDate& operator+=(int); // date + NormYr = date MSDate operator+(const MSNormalizedYears&) const; MSDate& operator+=(const MSNormalizedYears&); // Note: (Date + Term) - Term != Date in some cases // 3/30/90 + 1 month = 4/30/90 // 4/30/90 - 1 month = 3/31/90 // Avoid using (date - term) if possible MSDate operator -(const MSTerm&) const; MSDate& operator-=(const MSTerm&); // date - days = date MSDate operator -(int) const; MSDate& operator-=(int); // date - NormYr = date MSDate operator -(const MSNormalizedYears&) const; MSDate& operator-=(const MSNormalizedYears&); friend MSTypesExport MSDate operator+(int,const MSDate&); friend MSTypesExport MSDate operator+(const MSNormalizedYears&,const MSDate&); friend MSTypesExport MSDate operator+(const MSTerm&,const MSDate&); MSDate& operator++(); // Prefix MSDate& operator--(); MSDate operator++(int); // Postfix MSDate operator--(int); static const char* dayName(MSDay); static MSDay dayOfWeek(const char*); static MSBoolean dayWithinMonth(MSMonth,MSDay,MSYear); static MSDay daysInMonth(MSMonth,MSYear); static MSDay daysInYear(MSYear); static MSMonth indexOfMonth(const char*); static MSJulian asJulianNumber(MSMonth,MSDay,MSYear); static MSBoolean leapYear(MSYear); static const char* monthName(MSMonth); static int dcb30_360(const MSDate&,const MSDate&); static int findMatch(const char*,const char**,int); static MSDate today(void); static MSJulian currentDate(void); static MSJulian nullDate(void); static MSDateFormat defaultFormat(void); static void defaultFormat(MSDateFormat); static const MSString& strftimeDefaultFormat(void); static void strftimeDefaultFormat(MSString&); static void strftimeDefaultFormat(const char *); static void defaultConstructToToday(MSBoolean); static MSBoolean defaultConstructToToday(void); static MSDateLocale locale(void); static void locale(MSDateLocale); protected: MSJulian _date; // Julian Day Number (Not same as Julian date.) static MSDateLocale _locale; static MSJulian _override; static int _useOverride; static int _firstTime; static MSDateFormat _defaultFormat; static MSString _strftimeDefaultFormat; static MSBoolean _defaultConstructToToday; static MSJulian _nullDate; static const unsigned char _daysInMonth[]; static const MSDay _firstDayOfEachMonth[]; static const char *_monthNames[]; static const char *_ucMonthNames[]; static const char *_weekDayNames[]; static const char *_ucWeekDayNames[]; static MSBoolean assertWeekDayNumber(MSDay); static MSBoolean assertIndexOfMonth(MSMonth); void normalizeAndSet(int month,int day,int year,int lastOfMonth); enum Operator {Plus,Minus}; MSDate(const MSDate&,const MSTerm&,Operator); MSDate(const MSDate&,const MSNormalizedYears&,Operator); static MSDateLocale initLocale(void); }; inline long compare(const MSDate& aDate_,const MSDate& bDate_) { return aDate_==bDate_?0:(aDate_>bDate_?1:-1); } inline unsigned long hash(const MSDate& aDate_,unsigned long size_) { return aDate_._date%size_; } #ifndef MS_NO_INLINES #ifndef MSDateINLINES #include #endif #endif #endif aplus-fsf-4.22/src/MSTypes/MSDateVector.H0000644000265000001440000000377710772770455013616 #ifndef MSDateVectorHEADER #define MSDateVectorHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include typedef MSTypeVector MSDateVector; inline MSDate msBadData(const MSDate&) { return MSDate::nullDate(); } // We provide provide explicit "do_not_instantiate" pragmas here to avoid instantiation complications in // MStk applications. // #if !defined(__MSTYPESLIBRARY_BUILD__) && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma do_not_instantiate MSVectorModelAllocator #pragma do_not_instantiate MSTypeData > #pragma do_not_instantiate MSBaseVector > #pragma do_not_instantiate MSBaseVectorOps > #pragma do_not_instantiate MSObjectVector #pragma do_not_instantiate MSVectorElement #pragma do_not_instantiate MSTypeVector #pragma do_not_instantiate ostream& operator<<(ostream&, const MSBaseVector >&) #pragma do_not_instantiate unsigned int msMergeSortUp(unsigned int, MSDate *, unsigned int *,unsigned int, unsigned int) #pragma do_not_instantiate unsigned int msMergeSortDown(unsigned int, MSDate *, unsigned int *,unsigned int, unsigned int) #endif // !__MSTYPESLIBRARY_BUILD__ && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #if defined(MS_VC_NEED_TEMPLATE_EXPORT) class MSTypesExport MSBaseVector >; class MSTypesExport MSBaseVectorOps >; class MSTypesExport MSObjectVector; class MSTypesExport MSVectorElement; class MSTypesExport MSTypeVector; #endif #endif //MSDateVectorHEADER aplus-fsf-4.22/src/MSTypes/MSDefines.H0000644000265000001440000011713510772770456013126 #ifndef MSDefinesHEADER #define MSDefinesHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // /////////////////////////////////////////////////////////////////////////////// /*****************************************************************************/ // MSDefines.H /*****************************************************************************/ /*****************************************************************************/ // General conrols. /*****************************************************************************/ /* * MS_NO_EXCEPTIONS -- Defined if compiler does not support exceptions * * MS_NO_BOOL -- Defined if compiler does not support the bool type * * MS_NO_WIDE_CHAR -- Defined If compiler does not have a wchar_t type * * MS_NO_INDEX_ERROR -- turns off indexError reports from Vectors and Matrices * * MS_NO_INLINES -- turns off usage of inlines * * MS_WINDOWS -- compiling on Windows platform. * * MS_NEED_CTL -- uses ctl loop instead of our own Main Loop. * * MS_DIR_SEPARATOR -- defined to '\\' or '/' depending on platform (windows vs. unix) * * MS_KEYPAD_BUG -- Defined if correction is needed to fix keypad bug. */ /*****************************************************************************/ // Template Controls /*****************************************************************************/ /* * MS_NO_SIMPLE_TEMPLATE_DEFAULTS -- The compiler does not support simple * default template parameters (SunCC, * xlC, Visual C++ 4.x) * e.g.: template * * MS_SIMPLE_TEMPLATE_DEFAULT(a) -- Produces '=a' if simple default template * parameters are supported by the compiler * (as determined by the flag above) or * nothing otherwise * * MS_NO_COMPLEX_TEMPLATE_DEFAULTS -- The compiler does not support complex * default template parameters (all * compilers at this point) * e.g.: template > * * MS_COMPLEX_TEMPLATE_DEFAULT(a) -- Same as MS_SIMPLE_TEMPLATE_DEFAULT(a) */ /*****************************************************************************/ // Issues related to template instantiation /*****************************************************************************/ /* * MS_NEED_IMPLEMENTATION_PRAGMA -- Need #pragma implementation keyword in * the header file of the temaplte. (xlC) * * MS_PREDECLARE_TEMPLATE_FRIENDS -- Need to predeclare friend functions of * template. While it's actually required * by some compilers (VC, SUNPRO), it's a good * practice in general, and helps avoid confusion * by the compiler during automatic instantiation. * Thus, we will define it to 1 for all compilers. * * MS_TEMPLATE_TYPE_DESTROY_BUG -- Bug call ::typeDestroy from vector template.(DCC) * * MS_TEMPLATE_CONSTRUCTOR_OVERLOAD_BUG -- Bug when overloading template constructor (VC 4.x) * * MS_TEMPLATE_MANUAL_FRIEND_BUG -- Bug of access from friend during manual * instantiation. (DCC) * * MS_TEMPLATE_BEFORE_SPECIALIZATION -- Need to see the template declaration before * its specialization. (xlC) * * MS_NEED_TEMPLATE_SPECIALIZATION_BUG -- Need template specialization before template * declaration.(VC) * * MS_NO_PREDECLARE_SPECIALIZATION -- Can not predeclare template specializations. (xlC, SUNPRO) * * MS_TEMPLATE_FUNCTION_SPECILIZATON_BUG -- Can not specilize individual function of the template. * * * MS_DECLARE_TEMPLATE_SPECIALIZATION -- template specialization need to be declared to * class users with "template <>" syntax, except when * it is compiled in the library. * * MS_FORCE_INTERNAL_TEMPLATE_INSTANTIATION -- Forces instantiatoin of certain classes, like Vectors * in the library even if MSTK_MANUAL_INSTANTIATION is not set. * * MSTK_MANUAL_INSTANTIATION -- Templates are manually instantiated inside MStk libraries * * MS_EDG_TEMPLATE_INSTANTIATION -- Use EDG's manual instantiation directives (edenCC, DCC, SGI CC) * * MS_XLC_TEMPLATE_INSTANTIATION -- Use C++ standard manual instantiation directives (SUNPRO) * * MS_STD_TEMPLATE_INSTANTIATION -- Use xlC's manual instantiation directives (xlC) * * MS_VC_TEMPLATE_INSTANTIATION -- Use Visual C++ manual instantiation directives (VC) * * MS_DO_NOT_INSTANTIATE_BUG -- Compiler erroneously generates DNI symbols during *manual* * instantiation, when "do_not_instantiate" directives are used, * leading to large binaries (SGI CC) */ /*****************************************************************************/ // Issues concerning time and zone /*****************************************************************************/ /* * MS_NEED_STRPTIME_DECLARATION -- Need to declare strptime (HAVE_SVR4) * * MS_NO_STRPTIME -- There is no strptime (__sgi || _WINDOWS) * * MS_NO_CONSTCHAR_STRPTIME -- Need cast to char* when calling strptime * * MS_TMS_RESET_BY_STRPTIME -- strptime() zeroes out the unset fields of tms structure * * MS_HAS_MKTIME -- Has mktime. * * MS_NO_ALTZONE -- No altzone variable for DST.(AIX, Windows) * * MS_HAS_TMS_STRUCT -- Defined if tms and times.h exist. * else use rusage. (HAVE_SVR4) * * MS_STRUCT_TM_TZ -- Defined if has a struct tm with * extra member data "tm_zone" and "tm_gmtoff." * * MS_NO_CPU_TIME -- there is no getrusage or times functions. */ /*****************************************************************************/ // Issues concerning wait and signal functions. /*****************************************************************************/ /* * MS_SIGNAL_HAS_DOT_PARAM -- Defined if signal callback takes ... instead of int * * MS_WAIT_RETURNS_STATUS -- Defined if status is actualy returned from wait(). * * MS_WAIT_MACROS_NEED_UNION_CAST -- Defined if WEXITSTATUS requires parameter of type "union wait" * */ /*****************************************************************************/ // Issues dealing with elementForOps(); /*****************************************************************************/ /* * MS_NEED_CONST_ELEMENT_FOR_OPS -- For not ANSI C++ complient compilers need const version * of msElementForOps global template function (xlC) * * MS_NO_NONCONST_ELEMENT_FOR_OPS -- Visual C++ compilers only understands const version * of elementforOps * * MS_CONST_ELEMENT_FOR_OPS_BUG -- Bug that screws up calling elementForOps on const classes. * * * MS_SPECIALIZE_ELEMENT_FOR_OPS -- elementForOps can't be defined for template pointers * but needs to specialized for each defined one. (VC++) * * MS_SPECIALIZE_ELEMENT_FOR_OPS_TYPE -- elementForOps can't be defined for as a template at ALL. * needs to specialized for everything! (VC++ 5.0) * */ /*****************************************************************************/ // Misc. compiler specific workarounds and bugs /*****************************************************************************/ /* * MS_NO_ISTRSTREAM_CONSTCHAR_CONSTRUCTOR -- istrstream class has no "const char*" constructor.(VC) * * MS_REQUIRE_IEEEFP -- finite() is in ieefp. (HAVE_SVR4, VC) * * MS_NESTED_CLASSES_ACCESS_BUG -- compiler requires that nested classes be public (SUNPRO) * * MS_STATIC_VARIABLE_INITIALIZATION_BUG -- Bug dealing with initaliazation of static variables (Lucid) * * MS_NEED_FSYNC_DECLARATION -- Need to declare fsync (__xlC__) * * MS_HAS_GETHOSTID_DECLARATION -- platform declares gethostid in unistd.h (AIX41) * * MS_HAS_STRNICMP -- strnicmp exists [ ??] ?????????????????????????? * * MS_MATH_EXCEPTION_CONFLICT -- Conflict between stdlib exception and math.h * * MS_NEED_MUNMAP_DECLARATION -- sys/mman.h does not have munmap declaration. * * MS_OSTRSTREAM_FORMATING_BUG -- lucid ostrstream bug. * and suncc UMR from ostrstream bug. * * MS_HAS_SYSTEMINFO -- Defined if and sysinfo() exist. * * MS_HAS_MSG -- Defined if platform already has MSG keyword. (WINDOWS) * * MS_NEED_ERRNO_DECLARATION -- Defined if errno is not defined in * * MS_NEED_STRCASECMP_DECLARATION -- Defined if strcasecmp is not declared in * * MS_UNISTD_HAS_GETHOSTNAME -- Defined if defines gethostname * * MS_64BIT -- Defined on 64-bit platforms. * * MS_ENUM_COMPARE_BUG -- Compiler ambiguity in compare of enum types if * that enum type is used in compare with another type (xlC) * * MS_NO_EXPLICIT_KEYWORD -- Compiler doesn't support explicit keyword * * MS_MAPNOTIFY_ON_MAP_BUG -- in modal map() shouldn't wait for MapNotify, * this is true for Windows NT X11 emulation layer. * * MS_HAS_M_2PI -- platform system headers define M_2PI * * MS_NEED_INLINE_SQRT_INT -- compiler requires sqrt(int) defined to avoid * ambiguities between sqrt(double) and sqrt(lont) * * MS_INLINE_TEMPLATE_NESTED_CLASS -- nested template classes need to be fully inlined [Visual C++] * * MS_PREDECLARE_TEMPLATE_OP_FUNCTIONS -- operation functions like key, compare, etc.. need to * be predeclared before the classs that is deriving from collection. * * MS_CLASS_ENUM_OVERLOADING_BUG -- Overloaded functions in template classes that take an * enum defined inside that class, as one of the parameters * don't get instantiated. [VC++] * * MS_METHOD_POINTER_DEFAULTARG_BUG -- Method pointers cannot take 0 as a default argument in * template functions. VC++ * * MS_OFFSETOF_IN_STDDEF -- offsetof macro is defined in */ /*****************************************************************************/ // Thread Support /*****************************************************************************/ /* * MS_NO_THREADS -- Can be defined externally, to compile without threads. * But must link with non-multithread libraries. * * MS_MULTI_THREAD -- Defined if threads are supported and MS_NO_THREADS is * not defined * * MS_SOLARIS_THREADS -- Native Solaris Threads are supported * * MS_POSIX_THREADS -- Platform supports standard Posix Threads * * MS_WINDOWS_THREADS -- Window Threads are supported * * MS_NO_MUTEX_INIT -- Platform doesn't need mutex initialization * * MS_POSIX_D10_THREADS -- Platform meets Posix Draft 10 threads description * * MS_MUTEXATTR_DEFAULT -- pthread_mutexattr_default is provided. * * MS_THREAD_SAFE_FUNCTIONS -- Defined if "_r" (re-entrant) versions of system * functions are available on that architecture * (e.g., gmtime_r()) */ /*****************************************************************************/ // MSIPC related defines. /*****************************************************************************/ /* * MS_WINSOCK -- use Microsoft Windows WinSock interface. * * MS_USE_MSSELECT -- use MStk's select instead of ::select call. * * MS_NEED_CTL -- use ctl's main loop instead of our own. * * MS_USE_FCNTL_BLOCKING -- use fcntl() to set [non]blocking state of sockets. * otherwise use ioctl. (HAVE_SVR4) * MS_NO_GETRLIMIT -- there is not getrlimit function. * * MS_FDSET_IN_SYS_SELECT -- fd_set is which needs to be included. * * MS_NEED_SYS_NERR_DECLARATION -- need to declare sys_nerr & sys_errlist * * MS_NO_LIMITS_HEADER -- defined if doesn't exist. * * MS_HAS_SYS_LIMITS_HEADER -- defined if exists. [used only if no * * MS_NO_FILIO_HEADER -- Platform doesn't have sys/filio.h (AIX) * * MS_NO_FCNTL -- there is no fcntl. (windows) */ /*****************************************************************************/ // Architecture specific settings - a beginning in the cleanup of this file #if defined(_ABI64) # define MS_64BIT 1 #endif #if defined(__alpha) || defined(__ia64) # define MS_LITTLE_ENDIAN 1 # define MS_64BIT 1 #endif #if defined(__i386) # define MS_LITTLE_ENDIAN 1 #endif /*****************************************************************************/ // Compiler specific settings /*****************************************************************************/ # if defined (__EDEN__) && defined (__sun) && !defined (HAVE_SVR4) /* TAG: Lexa,SunOS */ # define MS_NEVER_ENTER_DEFAULT_HEADER_BLOCK 1 # define MS_LEXA_SUNOS 1 # define MSTK_MANUAL_INSTANTIATION 1 # define MS_EDG_TEMPLATE_INSTANTIATION 1 # define MS_STRUCT_TM_TZ 1 # define MS_NO_CONSTCHAR_STRPTIME 1 # define MS_NEED_MUNMAP_DECLARATION 1 # define MS_USE_FCNTL_BLOCKING 1 # define MS_NO_EXPLICIT_KEYWORD 1 # define MS_NO_COMPLEX_TEMPLATE_DEFAULTS 1 # define MS_PREDECLARE_TEMPLATE_FRIENDS 1 # define MS_KEYPAD_BUG 1 # endif /*****************************************************************************/ # if defined(__EDEN__) && defined (HAVE_SVR4) /* TAG: EDG,Lexa,Solaris */ # define MS_LEXA_SOLARIS 1 # define MSTK_MANUAL_INSTANTIATION 1 # define MS_EDG_TEMPLATE_INSTANTIATION 1 # define MS_REQUIRE_IEEEFP 1 # define MS_NEED_STRPTIME_DECLARATION 1 # define MS_TMS_RESET_BY_STRPTIME 1 # define MS_HAS_MKTIME 1 # define MS_HAS_TMS_STRUCT 1 # define MS_HAS_SYSTEMINFO 1 # define MS_USE_FCNTL_BLOCKING 1 # define MS_NEED_SYS_NERR_DECLARATION 1 # define MS_SOLARIS_THREADS 1 # define MS_NO_MUTEX_INIT 1 # define MS_NO_EXPLICIT_KEYWORD 1 # define MS_NO_COMPLEX_TEMPLATE_DEFAULTS 1 # define MS_PREDECLARE_TEMPLATE_FRIENDS 1 # define MS_MULTI_THREAD 1 # ifdef MS_NEVER_ENTER_DEFAULT_HEADER_BLOCK # error Ambiguous define settings: more than one platform possible # endif # define MS_NEVER_ENTER_DEFAULT_HEADER_BLOCK 1 # endif /*****************************************************************************/ # if defined(__SUNPRO_CC) && defined(HAVE_SVR4) /* TAG: sunCC,Solaris */ # define MS_SUNPRO_CC 1 # define MS_NO_BOOL 1 # define MS_STD_TEMPLATE_INSTANTIATION 1 # define MS_PREDECLARE_TEMPLATE_FRIENDS 1 # define MS_NO_PREDECLARE_SPECIALIZATION 1 # define MS_REQUIRE_IEEEFP 1 # define MS_TMS_RESET_BY_STRPTIME 1 # define MS_HAS_MKTIME 1 # define MS_HAS_TMS_STRUCT 1 # define MS_HAS_SYSTEMINFO 1 # define MS_USE_FCNTL_BLOCKING 1 # define MS_NEED_SYS_NERR_DECLARATION 1 # define MS_SOLARIS_THREADS 1 # define MS_NO_MUTEX_INIT 1 # define MS_OPERATOR_CONVERSION_BUG 1 # define MS_MULTI_THREAD 1 # define MS_THREAD_SAFE_FUNCTIONS 1 # if !defined(_POSIX_PTHREAD_SEMANTICS) # define MS_OLD_POSIX_THREAD_SAFE_FUNCTIONS 1 # endif # define MS_NO_COMPLEX_TEMPLATE_DEFAULTS 1 # define MS_TEMPLATE_FUNCTION_SPECILIZATON_BUG 1 # define MS_CONST_ELEMENT_FOR_OPS_BUG 1 # define MS_STD_TEMPLATE_SPECIALIZATION 1 # if __SUNPRO_CC < 0x500 //SunCC 4.2 only # define MS_OSTRSTREAM_FORMATING_BUG 1 # define MS_NO_SIMPLE_TEMPLATE_DEFAULTS 1 # define MS_NEED_STRPTIME_DECLARATION 1 # define MS_NESTED_CLASSES_ACCESS_BUG 1 # define MS_NO_EXPLICIT_KEYWORD 1 # define MS_FORCE_INTERNAL_TEMPLATE_INSTANTIATION 1 # define MS_TEMPLATE_BEFORE_SPECIALIZATION 1 # define MS_DECLARE_TEMPLATE_SPECIALIZATION 1 # else // SunCC 5.0 only # define MS_NEED_TEMPLATE_SPECIALIZATION_BUG 1 # define MS_C_LINKAGE_INCOMPATIBILITY 1 # define MS_PREDECLARE_NONTEMPLATE_FRIEND_FUNCTIONS 1 # define MS_PREDECLARE_TEMPLATE_FRIENDS_BUG 1 # endif # ifdef MS_NEVER_ENTER_DEFAULT_HEADER_BLOCK # error Ambiguous define settings: more than one platform possible # endif # define MS_NEVER_ENTER_DEFAULT_HEADER_BLOCK 1 # endif /*****************************************************************************/ # if defined(_AIX) # define MS_NO_BOOL 1 # define MS_NO_PREDECLARE_SPECIALIZATION 1 # define MS_TEMPLATE_BEFORE_SPECIALIZATION 1 # define MS_NEED_FSYNC_DECLARATION 1 # define MS_HAS_MKTIME 1 # define MS_NEED_CONST_ELEMENT_FOR_OPS 1 # define MS_HAS_GETHOSTID_DECLARATION 1 # define MS_NO_GETRLIMIT 1 # define MS_FDSET_IN_SYS_SELECT 1 # define MS_NO_FILIO_HEADER 1 # define MS_NEED_SYS_NERR_DECLARATION 1 # define MS_POSIX_THREADS 1 # define MS_POSIX_D10_THREADS 1 # define MS_NEED_STRCASECMP_DECLARATION 1 # define MS_WAIT_RETURNS_STATUS 1 # define MS_ENUM_COMPARE_BUG 1 # define MS_NO_EXPLICIT_KEYWORD 1 # define MS_NO_SIMPLE_TEMPLATE_DEFAULTS 1 # define MS_HAS_M_2PI 1 # define MS_PREDECLARE_TEMPLATE_OP_FUNCTIONS 1 # define MS_KEYPAD_BUG 1 # ifdef _BSD # define MS_WAIT_MACROS_NEED_UNION_CAST 1 # endif # endif /*****************************************************************************/ # if defined(__sgi) && defined(__DELTA) /* TAG: DCC */ # define MS_SGI_DCC 1 # define MS_NO_BOOL 1 # define MS_NO_WIDE_CHAR 1 # define MS_NO_EXCEPTIONS 1 # define MSTK_MANUAL_INSTANTIATION 1 # define MS_EDG_TEMPLATE_INSTANTIATION 1 # define MS_TEMPLATE_TYPE_DESTROY_BUG 1 # define MS_TEMPLATE_MANUAL_FRIEND_BUG 1 # define MS_REQUIRE_IEEEFP 1 # define MS_NEED_STRPTIME_DECLARATION 1 # define MS_HAS_MKTIME 1 # define MS_HAS_TMS_STRUCT 1 # define MS_HAS_SYSTEMINFO 1 # define MS_NO_EXPLICIT_KEYWORD 1 # define MS_NO_COMPLEX_TEMPLATE_DEFAULTS 1 # define MS_PREDECLARE_TEMPLATE_FRIENDS 1 # define MS_KEYPAD_BUG 1 # ifdef MS_NEVER_ENTER_DEFAULT_HEADER_BLOCK # error Ambiguous define settings: more than one platform possible # endif # define MS_NEVER_ENTER_DEFAULT_HEADER_BLOCK 1 # endif /*****************************************************************************/ # if defined(__sgi) && defined(_ABIO32) /* TAG: sgi32 */ # define MS_SGI32 1 # define MS_NO_BOOL 1 # define MS_NO_WIDE_CHAR 1 # define MSTK_MANUAL_INSTANTIATION 1 # define MS_EDG_TEMPLATE_INSTANTIATION 1 # define MS_REQUIRE_IEEEFP 1 # define MS_TMS_RESET_BY_STRPTIME 1 # define MS_HAS_MKTIME 1 # define MS_HAS_TMS_STRUCT 1 # define MS_HAS_SYSTEMINFO 1 # define MS_USE_FCNTL_BLOCKING 1 # define MS_POSIX_THREADS 1 # define MS_POSIX_D10_THREADS 1 # define MS_NO_EXPLICIT_KEYWORD 1 # define MS_NO_COMPLEX_TEMPLATE_DEFAULTS 1 # define MS_PREDECLARE_TEMPLATE_FRIENDS 1 # define MS_MULTI_THREAD 1 # define MS_THREAD_SAFE_FUNCTIONS 1 # define MS_KEYPAD_BUG 1 # ifdef MS_NEVER_ENTER_DEFAULT_HEADER_BLOCK # error Ambiguous define settings: more than one platform possible # endif # define MS_NEVER_ENTER_DEFAULT_HEADER_BLOCK 1 # endif /*****************************************************************************/ # if defined(__sgi) && defined(_ABIN32) /* TAG: sgin32 */ # define MS_SGIN32 1 # define MSTK_MANUAL_INSTANTIATION 1 # define MS_EDG_TEMPLATE_INSTANTIATION 1 # if defined(_COMPILER_VERSION) && _COMPILER_VERSION<720 # define MS_DO_NOT_INSTANTIATE_BUG 1 # endif //_COMPILER_VERSION<720 # define MS_REQUIRE_IEEEFP 1 # define MS_TMS_RESET_BY_STRPTIME 1 # define MS_HAS_MKTIME 1 # define MS_HAS_TMS_STRUCT 1 # define MS_HAS_SYSTEMINFO 1 # define MS_USE_FCNTL_BLOCKING 1 # define MS_POSIX_THREADS 1 # define MS_POSIX_D10_THREADS 1 # define MS_NO_EXPLICIT_KEYWORD 1 # define MS_NO_COMPLEX_TEMPLATE_DEFAULTS 1 # define MS_PREDECLARE_TEMPLATE_FRIENDS 1 # define MS_MULTI_THREAD 1 # define MS_THREAD_SAFE_FUNCTIONS 1 # define MS_KEYPAD_BUG 1 # define MS_UNISTD_HAS_GETHOSTNAME 1 # if !defined(__GNUC__) # define __MSTYPESLIBRARY_BUILD__ 1 # define __MSIPCLIBRARY_BUILD__ 1 # define __MSGUILIBRARY_BUILD__ 1 # endif # if defined(__GNUC__) /* TAG: g++ */ # define MS_GCC 1 # define MS_NO_ALTZONE 1 # define MS_STD_TEMPLATE_INSTANTIATION 1 # define MS_PREDECLARE_TEMPLATE_FRIENDS 1 # define MS_GCC_FUNCTION_CAST_BUG 1 //egcs 1.1.1 # define MS_TEMPLATE_FUNCTION_SPECILIZATON_BUG 1 # if defined(HAVE_SVR4) # define MS_USE_FCNTL_BLOCKING 1 # define MS_NEED_SYS_NERR_DECLARATION 1 # define MS_IOSTREAM_IPFX_NEEDS_ARGUMENT 1 # endif # endif //temporary # define MS_SPECIALIZE_ELEMENT_FOR_OPS 1 # ifdef MS_NEVER_ENTER_DEFAULT_HEADER_BLOCK # error Ambiguous define settings: more than one platform possible # endif # define MS_NEVER_ENTER_DEFAULT_HEADER_BLOCK 1 #endif /*****************************************************************************/ #if defined(__sgi) && defined(_ABI64) /* TAG: sgi64 */ #define MS_SGI64 1 #define MS_64BIT 1 #define MSTK_MANUAL_INSTANTIATION 1 #define MS_EDG_TEMPLATE_INSTANTIATION 1 #if defined(_COMPILER_VERSION) && _COMPILER_VERSION<720 #define MS_DO_NOT_INSTANTIATE_BUG 1 #endif //_COMPILER_VERSION<720 #define MS_REQUIRE_IEEEFP 1 #define MS_TMS_RESET_BY_STRPTIME 1 #define MS_HAS_MKTIME 1 #define MS_HAS_TMS_STRUCT 1 #define MS_HAS_SYSTEMINFO 1 #define MS_USE_FCNTL_BLOCKING 1 #define MS_POSIX_THREADS 1 #define MS_POSIX_D10_THREADS 1 #define MS_NO_EXPLICIT_KEYWORD 1 #define MS_NO_COMPLEX_TEMPLATE_DEFAULTS 1 #define MS_PREDECLARE_TEMPLATE_FRIENDS 1 #define MS_MULTI_THREAD 1 #define MS_THREAD_SAFE_FUNCTIONS 1 #define MS_KEYPAD_BUG 1 # if !defined(__GNUC__) # define __MSTYPESLIBRARY_BUILD__ 1 # define __MSIPCLIBRARY_BUILD__ 1 # define __MSGUILIBRARY_BUILD__ 1 # endif # if defined(__GNUC__) /* TAG: g++ */ # define MS_GCC 1 # define MS_NO_ALTZONE 1 # define MS_STD_TEMPLATE_INSTANTIATION 1 # define MS_PREDECLARE_TEMPLATE_FRIENDS 1 # define MS_GCC_FUNCTION_CAST_BUG 1 //egcs 1.1.1 # define MS_TEMPLATE_FUNCTION_SPECILIZATON_BUG 1 # if defined(HAVE_SVR4) # define MS_USE_FCNTL_BLOCKING 1 # define MS_NEED_SYS_NERR_DECLARATION 1 # define MS_IOSTREAM_IPFX_NEEDS_ARGUMENT 1 # endif # endif //temporary # define MS_SPECIALIZE_ELEMENT_FOR_OPS 1 # ifdef MS_NEVER_ENTER_DEFAULT_HEADER_BLOCK # error Ambiguous define settings: more than one platform possible # endif # define MS_NEVER_ENTER_DEFAULT_HEADER_BLOCK 1 #endif /*****************************************************************************/ #if defined(_MSC_VER) /* TAG: Visual C++ */ #define MS_VISUALC 1 #define MS_WINDOWS 1 #define MSTK_MANUAL_INSTANTIATION 1 #define MS_VC_TEMPLATE_INSTANTIATION 1 #define MS_NO_DEFAULT_COMPILER_DEFINES 1 #define MS_TEMPLATE_CONSTRUCTOR_OVERLOAD_BUG 1 #define MS_NO_ISTRSTREAM_CONSTCHAR_CONSTRUCTOR 1 #define MS_REQUIRE_IEEEFP 1 #define MS_NO_STRPTIME 1 #define MS_NEED_TEMPLATE_SPECIALIZATION_BUG 1 #define MS_NO_ALTZONE 1 #define MS_NO_CONSTCHAR_STRPTIME 1 #define MS_HAS_MSG 1 #define MS_WINSOCK 1 #define MS_USE_MSSELECT 1 #define MS_NO_GETRLIMIT 1 #define MS_WINDOWS_THREADS 1 #define MS_UNISTD_HAS_GETHOSTNAME 1 #define MS_MAPNOTIFY_ON_MAP_BUG 1 // #define MS_MULTI_THREAD 1 #define MS_HAS_MKTIME 1 #define MS_NEED_INLINE_SQRT_INT 1 #define MS_NO_CPU_TIME 1 #define MS_GETPID_IN_PROCESS 1 #define MS_NO_FILIO_HEADER 1 #define MS_NO_FCNTL 1 #define MS_FDSET_IN_SYS_SELECT 1 #define MS_INLINE_TEMPLATE_NESTED_CLASS 1 //#define MS_KEYPAD_BUG 1 #define MS_PREDECLARE_TEMPLATE_OP_FUNCTIONS 1 #define MS_PREDECLARE_TEMPLATE_FRIENDS 1 #define MS_COMPILE_INSTANTIATE 1 #ifndef NOMINMAX #define NOMINMAX #endif #ifdef max #undef max #endif #ifdef min #undef min #endif #define DllExport __declspec(dllexport) #define DllImport __declspec(dllimport) #pragma warning( disable: 4275 4251 4273 4018 4660 4305 4309) //This bug is only in VC++ 5.0 BUT //we must turn it on for both 4.2 and 5.0 if we //want to be able to compile with both compilers against //one set of libraries [4.2] #define MS_CLASS_ENUM_OVERLOADING_BUG 1 #if _MSC_VER < 1100 // VC++ 4.x #define MS_NO_EXPLICIT_KEYWORD 1 #define MS_NO_COMPLEX_TEMPLATE_DEFAULTS 1 #define MS_NEED_CONST_ELEMENT_FOR_OPS 1 #define MS_NO_NONCONST_ELEMENT_FOR_OPS 1 #define MS_SPECIALIZE_ELEMENT_FOR_OPS 1 #endif #if _MSC_VER <= 1100 //VC++ 4.x AND 5.0 #define MS_VC_NEED_TEMPLATE_EXPORT 1 #endif #if _MSC_VER >= 1100 //VC++ 5.0 and later //#define MS_NEED_CONST_ELEMENT_FOR_OPS 1 #define MS_NO_NONCONST_ELEMENT_FOR_OPS 1 #define MS_SPECIALIZE_ELEMENT_FOR_OPS 1 #define MS_SPECIALIZE_ELEMENT_FOR_OPS_TYPE 1 #define MS_METHOD_POINTER_DEFAULTARG_BUG 1 #define MS_OFFSETOF_IN_STDDEF 1 #endif #if _MSC_VER > 1100 //VC++ 6.0 and later #define MS_TEMPLATE_FRIEND_CLASS_BUG 1 #pragma warning( disable: 4291) #endif #ifdef MS_NEVER_ENTER_DEFAULT_HEADER_BLOCK #error Ambiguous define settings: more than one platform possible #endif #define MS_NEVER_ENTER_DEFAULT_HEADER_BLOCK 1 #else //_MSC_VER #define DllExport #define DllImport #endif //_MSC_VER /*****************************************************************************/ #if defined (__osf__) #define MS_HAS_MKTIME 1 #define MS_NO_ALTZONE 1 #define MS_NO_COMPLEX_TEMPLATE_DEFAULTS 1 #define MS_CXX_MANUAL_INSTANTIATION 1 #define MS_NO_FILIO_HEADER 1 //#define MS_NO_EXPLICIT_KEYWORD 1 #define MS_64BIT 1 #define MS_LITTLE_ENDIAN 1 #define MS_HAS_M_2PI 1 #define MS_FRIEND_TEMPLATEID_NOT_NEEDED 1 #ifdef MS_NEVER_ENTER_DEFAULT_HEADER_BLOCK #error Ambiguous define settings: more than one platform possible #endif #define MS_NEVER_ENTER_DEFAULT_HEADER_BLOCK 1 #endif /*****************************************************************************/ #if defined(__GNUC__) && !defined(MS_GCC) /* TAG: g++ */ # define MS_GCC 1 # define MS_NO_COMPLEX_TEMPLATE_DEFAULTS 1 # define MS_NO_ALTZONE 1 # define MSTK_MANUAL_INSTANTIATION 1 # define MS_STD_TEMPLATE_INSTANTIATION 1 # define MS_PREDECLARE_TEMPLATE_FRIENDS 1 # define MS_GCC_FUNCTION_CAST_BUG 1 //egcs 1.1.1 # define MS_TEMPLATE_FUNCTION_SPECILIZATON_BUG 1 # if defined(HAVE_SVR4) # define MS_USE_FCNTL_BLOCKING 1 # define MS_NEED_SYS_NERR_DECLARATION 1 # define MS_IOSTREAM_IPFX_NEEDS_ARGUMENT 1 # define MS_HAS_MKTIME 1 # define MS_REQUIRE_IEEEFP 1 # endif # if defined(__APPLE__) # define MS_NO_STRPTIME # endif # if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__) # define MS_NO_GETRLIMIT 1 # define MS_STRUCT_TM_TZ 1 # endif # if defined(linux) # define MS_LINUX 1 # define MS_NEED_STRPTIME_DECLARATION 1 # define MS_XSYNCHRONIZE_FULL_SIGNATURE 1 # define MS_HAS_GETRUSAGE_DECLARATION 1 # define MS_FD_SET_NOT_STRUCT 1 # define MS_NO_FILIO_HEADER 1 # define MS_HOWMANY_IN_SYS_PARAM 1 # define MS_LITTLE_ENDIAN 1 # endif //temporary # define MS_SPECIALIZE_ELEMENT_FOR_OPS 1 //#define MS_TEMPLATE_MANUAL_FRIEND_BUG 1 # ifdef MS_NEVER_ENTER_DEFAULT_HEADER_BLOCK # error Ambiguous define settings: more than one platform possible # endif # define MS_NEVER_ENTER_DEFAULT_HEADER_BLOCK 1 #endif /*****************************************************************************/ #ifndef MS_NEVER_ENTER_DEFAULT_HEADER_BLOCK /*TAG */ #error Unsupported compiler & platform combination #endif /*****************************************************************************/ // Misc. settings /*****************************************************************************/ // Windows DLL settings #if !defined(_MSTKLIB) //Building or using MStk dll #ifdef __MSTYPESLIBRARY_BUILD__ # define MSTypesExport DllExport #else # define MSTypesExport DllImport #endif #ifdef __MSIPCLIBRARY_BUILD__ # define MSIPCExport DllExport #else # define MSIPCExport DllImport #endif #ifdef __MSGUILIBRARY_BUILD__ # define MSGUIExport DllExport #else # define MSGUIExport DllImport #endif #ifdef __MS3dLIBRARY_BUILD__ # define MS3dExport DllExport #else # define MS3dExport DllImport #endif #ifdef __MSUTILLIBRARY_BUILD__ # define MSUtilExport DllExport #else # define MSUtilExport DllImport #endif #ifdef __MSPROTOLIBRARY_BUILD__ # define MSProtoExport DllExport #else # define MSProtoExport DllImport #endif #else # define MS3dExport # define MSTypesExport # define MSIPCExport # define MSGUIExport # define MSUtilExport # define MSProtoExport #endif //_MSTKDLL // exception handling #if defined(MS_NO_EXCEPTIONS) // If we don't have exceptions, then we'll use assert. // We don't allow users to turn off the assert() in which such // a thrown exception would result. #ifdef NDEBUG #define __MS_NDEBUG #undef NDEBUG #endif #include #define MSTKTHROWEXCEPTION(exc) assert(0) #ifdef __MS_NDEBUG #define NDEBUG #undef __MS_NDEBUG #endif #else // we have exception support #define MSTKTHROWEXCEPTION(exc) throw(exc) #endif // MS_NO_EXCEPTIONS //directory #ifdef MS_WINDOWS #define MS_DIR_SEPARATOR '\\' #else #define MS_DIR_SEPARATOR '/' #endif // threads #if defined(MS_NO_THREADS) #undef MS_MULTI_THREAD #endif // Wrappers around system function that have mt-safe (_r) versions. // The macros take as many parameters as the _r versions. The regular // versions of these macros ignore extra parameters and thus they don't // have to be declared when MS_THREAD_SAFE_FUNCTIONS is not defined. // To declare a direntry struct forREADDIR macro MS_DECLARE_DIRENT should be // used because it correctly allocates enough memory for dirEntry. #ifdef MS_THREAD_SAFE_FUNCTIONS #define MS_DECLARE_DIRENT(dirEntry) \ char dirEntry##Buffer[1025+sizeof(struct dirent)];\ struct dirent *dirEntry = (struct dirent *)dirEntry##Buffer; #define MS_LOCALTIME(numSecs,pTm) localtime_r(numSecs,pTm) #define MS_GMTIME(numSecs,pTm) gmtime_r(numSecs,pTm) #if defined(MS_OLD_POSIX_THREAD_SAFE_FUNCTIONS) #define MS_ASCTIME(tp,charBuf,n) asctime_r(tp,charBuf,n) #define MS_GETPWUID(uid,pStruct,charBuf,n,pwd) (pwd=getpwuid_r(uid,pStruct,charBuf,n)) #define MS_GETPWNAM(name,pStruct,charBuf,n,pwd) (pwd=getpwnam_r(name,pStruct,charBuf,n)) #define MS_READDIR(dp,entry,res) (res=readdir_r(dp,entry)) #else #define MS_ASCTIME(tp,charBuf,n) asctime_r(tp,charBuf) #define MS_GETPWUID(uid,pStruct,charBuf,n,pwd) (getpwuid_r(uid,pStruct,charBuf,n,&pwd),pwd) #define MS_GETPWNAM(name,pStruct,charBuf,n,pwd) (getpwnam_r(name,pStruct,charBuf,n,&pwd),pwd) #define MS_READDIR(dp,entry,res) (readdir_r(dp,entry,&res),res) #endif #else #define MS_DECLARE_DIRENT(dirEntry) #define MS_LOCALTIME(numSecs,pTm) localtime(numSecs) #define MS_GMTIME(numSecs,pTm) gmtime(numSecs) #define MS_ASCTIME(tp,charBuf,n) asctime(tp) #define MS_GETPWUID(uid,pStruct,charBuf,n,pwd) (pwd=getpwuid(uid)) #define MS_GETPWNAM(name,pStruct,charBuf,n,pwd) (pwd=getpwnam(name)) #define MS_READDIR(dp,entry,res) (res=readdir(dp)) #endif //MS_THREAD_SAFE_FUNCTIONS // inlining #if defined(MS_NO_INLINES) #define INLINELINKAGE #else #define INLINELINKAGE inline #endif //MS_NO_INLINES #if defined(__GNUC__) || ((defined(_ABIN32)||defined(_ABI64)) && (_COMPILER_VERSION > 720)) #define INLINELINKAGE2 #else #define INLINELINKAGE2 inline #endif // __GNUC__ // explicit keyword #if defined (MS_NO_EXPLICIT_KEYWORD) #define MSExplicit #else #define MSExplicit explicit #endif // Macro for forming or ommitting default template parameters. #ifndef MS_NO_SIMPLE_TEMPLATE_DEFAULTS # define MS_SIMPLE_TEMLATE_DEFAULT(a) =a # ifndef MS_NO_COMPLEX_TEMPLATE_DEFAULTS # define MS_COMPLEX_TEMPLATE_DEFAULT(a) =a # else # define MS_COMPLEX_TEMPLATE_DEFAULT(a) # endif //MS_NO_COMPLEX_TEMPLATE_DEFAULTS #else # ifndef MS_NO_COMPLEX_TEMPLATE_DEFAULTS # define MS_NO_COMPLEX_TEMPLATE_DEFAULTS # endif //MS_NO_COMPLEX_TEMPLATE_DEFAULTS # define MS_SIMPLE_TEMPLATE_DEFAULT(a) # define MS_COMPLEX_TEMPLATE_DEFAULT(a) #endif //MS_NO_SIMPLE_TEMPLATE_DEFAULTS #ifdef __makedep__ #undef MS_NEED_IMPLEMENTATION_PRAGMA #undef MS_VC_TEMPLATE_INSTANTIATION #undef MS_XLC_TEMPLATE_INSTANTIATION #undef MS_EDG_TEMPLATE_INSTANTIATION #undef MS_STD_TEMPLATE_INSTANTIATION #endif // assume RW stdlib #if !defined(MS_NO_STL) #define MS_USE_RW_STDLIB 1 #endif // MS_DO_NOT_INSTANTIATE controls whether "do_not_instantiate" directives are // provided for the templates that are instantiated inside MStk. It is only // necessary if MStk has been built with manual instantiation AND if the compiler // does not have a bug related to "do_not_instantiate" (see the description of // of MS_DO_NOT_INSTANTIATE_BUG above). If MS_DO_NOT_INSTANTIATE is not defined, // the only "do_not_instantiate" directives will be those for specializations // inside MStk. // // This flag is user-controllable. // #if defined(MSTK_MANUAL_INSTANTIATION) && !defined(MS_DO_NOT_INSTANTIATE_BUG) #define MS_DO_NOT_INSTANTIATE #endif // MSTK_MANUAL_INSTANTIATION && !MS_DO_NOT_INSTANTIATE_BUG // A pivot year is the number used to deduce the century of a 2-digit year specification. // The standard pivot year is 70, which means that all 2-digit years less than or equal to // 70 refer to the 21st century, while all 2-digit years greater than 70 refer to the 20th // century. For example, 1/1/69 means 1/1/2069, but 1/1/71 means 1/1/1971. // #define MS_PIVOT_YEAR 70 // // A macro for MT-safe static initialization // #ifdef MS_MULTI_THREAD #define MS_SAFE_STATIC_INIT(Type,mutex)\ static Type *p##Type=0;\ \ if (p##Type==0)\ {\ MSGUARD(mutex);\ if (p##Type==0)\ {\ static char Type##Buf[sizeof(Type)];\ p##Type = ::new (&Type##Buf[0]) Type;\ }\ }\ \ return *p##Type; #else #define MS_SAFE_STATIC_INIT(Type,mutex)\ static Type *p##Type=0;\ \ if (p##Type==0)\ {\ static char Type##Buf[sizeof(Type)];\ p##Type = ::new (&Type##Buf[0]) Type;\ }\ \ return *p##Type; #endif #if !defined (MS_FRIEND_TEMPLATEID_NOT_NEEDED) # define MS_FRIEND_TEMPLATEID <> #else # define MS_FRIEND_TEMPLATEID #endif #if defined(__APPLE__) #define APLUS_ISPACE aplus_isspace extern "C" int aplus_isspace(int); #else #define APLUS_ISPACE isspace #endif #endif //MSDefinesHEADER aplus-fsf-4.22/src/MSTypes/MSDependentVector.H0000644000265000001440000001214710772770456014637 #ifndef MSDependentVectorHEADER #define MSDependentVectorHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #if defined(MS_NEED_IMPLEMENTATION_PRAGMA) #pragma implementation("MSDependentVector.C") #endif #if defined(MS_PREDECLARE_TEMPLATE_FRIENDS) template class MSDependentVector; template ostream& operator<<(ostream&, const MSDependentVector&); #endif //MS_PREDECLARE_TEMPLATE_FRIENDS template class MSDependentVector : public MSIndexedModel, public MSEventReceiver { public: class MSTypesExport Pick { protected: MSTypeVector *_pVector; unsigned _index; public: Pick(MSTypeVector *pVector_,unsigned index_) : _pVector(pVector_),_index(index_) {} MSTypeVector& vector(void) { return *_pVector; } unsigned index(void) { return _index; } Pick& operator=(const Type&); }; MSDependentVector(const MSDependentVector&); MSDependentVector(MSTypeVector&,MSIndexVector&); virtual MSString asString(void) const; virtual MSString asMSF(void) const; virtual MSString asDebugInfo(void) const; virtual MSString className(void) const; virtual const MSSymbol& type(void) const; virtual MSModel *clone(void) const; virtual MSModel *create(void) const; virtual void assign(const MSModel&); virtual long compare(const MSModel&) const; virtual MSError::ErrorStatus set(const char *pString_); virtual MSError::ErrorStatus setFromMSF(const char *pString_); static const MSSymbol& symbol(void); friend MSTypesExport ostream& operator<<(ostream&,const MSDependentVector&); MSError::ErrorStatus set(unsigned index_,const char *pString_); inline Pick operator[](unsigned); inline const Type& operator()(unsigned) const; MSDependentVector& operator=(const MSDependentVector&); long compare(const MSDependentVector&) const; inline const Type& elementAt(unsigned) const; inline unsigned length(void) const; unsigned indexOf(const Type&,unsigned startPos_=0) const; unsigned lastIndexOf(const Type&,unsigned startPos_=UINT_MAX-1) const; virtual void receiveEvent(MSEvent&); MSIndexVector gradeUp(void) const; MSIndexVector gradeDown(void) const; void permute(const MSIndexVector&); MSDependentVector& sortUp(void); MSDependentVector& sortDown(void); // the following method is equivalent to dyadic iota in apl (indexOf on vectors) MSIndexVector indicesOf(const MSDependentVector&) const; // the following method is equivalent to membership in apl MSBinaryVector memberOf(const MSDependentVector&) const; static MSDependentVector select(const MSDependentVector&, const MSIndexVector&,MSIndexVector&); static MSDependentVector compress(const MSDependentVector&, const MSBinaryVector&,MSIndexVector&); MSTypeVector *sourceVector(void) const { return _sourceVector; } MSIndexVector *indexVector(void) const { return _indexVector; } protected: MSTypeVector *_sourceVector; MSIndexVector *_indexVector; static unsigned mergeSortUp(unsigned n_,MSDependentVector *sp_, unsigned *p_,unsigned low_,unsigned high_); static unsigned mergeSortDown(unsigned n_,MSDependentVector *sp_, unsigned *p_,unsigned low_,unsigned high_); static unsigned indexCompareUp(MSDependentVector *p_,unsigned i_,unsigned j_); static unsigned indexCompareDown(MSDependentVector *p_,unsigned i_,unsigned j_); private: static MSSymbol initializeType(void); }; template inline MSDependentVector::Pick MSDependentVector::operator[](unsigned index_) { return Pick(_sourceVector,(*_indexVector)(index_)); } template inline MSDependentVector::Pick& MSDependentVector::Pick::operator=(const Type& aType_) { _pVector->set(_index,aType_); return *this; } template inline MSError::ErrorStatus MSDependentVector::set(unsigned index_,const char *pString_) { return _sourceVector->set((*_indexVector)(index_),pString_); } template inline const Type& MSDependentVector::elementAt(unsigned index_) const // cannot use operator() for the integral types - it returns by value // { return (*_sourceVector)((*_indexVector)(index_)); } { return ((const MSTypeVector&)(*_sourceVector)).elementAt((*_indexVector)(index_)); } template inline const Type& MSDependentVector::operator()(unsigned index_) const { return elementAt(index_); } template inline unsigned MSDependentVector::length(void) const { return _indexVector->length(); } template inline long compare(const MSDependentVector& a_,const MSDependentVector& b_) { return a_.compare(b_); } #endif aplus-fsf-4.22/src/MSTypes/MSEnum.H0000644000265000001440000000146610772770456012454 #ifndef MSEnumHEADER #define MSEnumHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include enum MSBoolean {MSFalse=0,MSTrue=1}; enum MSComparison {MSLessThan,MSGreaterThan,MSLessThanOrEqualTo,MSGreaterThanOrEqualTo, MSEqualTo,MSNotEqualTo}; enum MSExplicitInit {MSInit}; enum MSAllocationFlag {MSRaw,MSConstructed}; enum MSEstimateType {MSBiased,MSUnbiased}; // for variance and standard deviation in vectors typedef unsigned long Atom; typedef unsigned long MSAtom; const MSAtom MSNullAtom=0x0; const Atom NullAtom=0; #endif aplus-fsf-4.22/src/MSTypes/MSError.H0000644000265000001440000000455510772770456012643 #ifndef MSErrorHEADER #define MSErrorHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSTypesExport MSError { public: enum ErrorStatus { MSSuccess=0, // Successful completion MSFailure=1, // General failure Internal=2, // Internal error BadPrice=3, // *Invalid price string BadString=4, // *Invalid string format BadDate=5, // Invalid date; a valid date is 01/31/92 BadTerm=6, // Invalid term; a valid term is 3,11,25 or 3y, 11m, 25d BadRate=7, // Invalid rate; a valid rate is .725 or 7.25% BadInt=8, // Invalid integer; an example of an integer is 7231 BadReal=9, // Invalid real; an example of a real is 7231.295 BadTime=10, // *Invalid time; an example of a time is 15:30:00 04/13/1992 JST BadBool=11, // *Invalid boolean; an example of a boolean is 1 or 0 BadMoney=12, // *Invalid money amount; an example of a valid money amount is 3257.29 IntTooBig=13, // Integer amount is greater than the maximum allowed by the system BadMSFString=14, // The MSFString cannot be converted to the specified object BadMSDNFieldName=15, // Invalid MSF field name MSDNcfdcError=16, // Encountered error in MSDN cfdc layer MSDNctlError=17, // Encountered error in MSDN ctl layer StringTooBig=18, // String is too big, can not be copied NoMemory=19, // Unable to allocate memory TimeOut=20, // Time-out occurred OldObject=21, // New object is older than current object NoPrototype=22, // Class Prototype not found NoMSOid=23, // Object does not contain MSOid MatchExpParse=24, // Match expression parsing error BadItem=25, // Invalid MSDNItem BadClone=26, // Bad clone, can't clone object BadClient=27, // Bad Client, client not found BadCriteria=28 // Bad Criteria }; static int error(ErrorStatus status,const char *function,const char *format_, ...); }; #endif aplus-fsf-4.22/src/MSTypes/MSEvent.H0000644000265000001440000000250310772770456012622 #ifndef MSEventHEADER #define MSEventHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSEventSender; class MSTypesExport MSEvent { public: MSEvent(void); MSEvent(const MSEvent&); MSEvent(const MSSymbol&); virtual ~MSEvent(void); const MSSymbol& type(void) const; MSEventSender *sender(void) const; MSEvent& operator=(const MSEvent&); protected: friend class MSEventSender; void sender(MSEventSender *); MSSymbol _type; MSEventSender *_sender; }; inline const MSSymbol& MSEvent::type(void) const { return _type; } inline MSEventSender *MSEvent::sender(void) const { return _sender; } inline void MSEvent::sender(MSEventSender *pSender_) { _sender=pSender_; } inline MSEvent::MSEvent(void) : _sender(0) {} inline MSEvent::MSEvent(const MSEvent& aEvent_) : _type(aEvent_.type()),_sender(aEvent_.sender()) {} inline MSEvent::MSEvent(const MSSymbol& aSymbol_) : _type(aSymbol_),_sender(0) {} inline MSEvent& MSEvent::operator=(const MSEvent& aEvent_) { _type=aEvent_.type(),_sender=aEvent_.sender(); return *this; } #endif aplus-fsf-4.22/src/MSTypes/MSEventBlocker.H0000644000265000001440000000113710772770456014126 #ifndef MSEventBlockerHEADER #define MSEventBlockerHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSEventSender; class MSTypesExport MSEventBlocker { public: MSEventBlocker(MSEventSender *,MSBoolean sendEvent_=MSTrue); ~MSEventBlocker(void); private: MSEventSender *_sender; MSBoolean _sendEvent; }; #endif aplus-fsf-4.22/src/MSTypes/MSEventReceiver.H0000644000265000001440000000272010772770456014310 #ifndef MSEventReceiverHEADER #define MSEventReceiverHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSEventSender; class MSTypesExport MSEventReceiver { public: MSEventReceiver(void) : _senderList(0) {}; MSEventReceiver(const MSEventReceiver&) : _senderList(0) {}; virtual ~MSEventReceiver(void); // message for receiving MSEvents from MSEventSenders virtual void receiveEvent(MSEvent&); // protection against pointer bit wise copy MSEventReceiver& operator=(const MSEventReceiver&) { return *this; } protected: virtual void addSenderNotify(MSEventSender *); virtual void removeSenderNotify(MSEventSender *); virtual MSBoolean addSender(MSEventSender *); virtual MSBoolean removeSender(MSEventSender *); private: friend class MSEventSender; class MSTypesExport Node { private: Node *_next; MSEventSender *_sender; public: Node(MSEventSender *sender_=0,Node *next_=0):_next(next_),_sender(sender_) {} ~Node(void) {} void next(Node *next_) { _next=next_; } Node *next(void) { return _next; } MSEventSender *sender(void) { return _sender; } }; Node *_senderList; Node *senderList(void) const { return _senderList; } }; #endif aplus-fsf-4.22/src/MSTypes/MSEventReceiverMethod.H0000644000265000001440000000500510772770456015450 #ifndef MSEventReceiverMethodHEADER #define MSEventReceiverMethodHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #if defined(MS_NEED_IMPLEMENTATION_PRAGMA) #pragma implementation("MSEventReceiverMethod.C") #endif #ifndef MSEventReceiverHEADER #include #endif template class MSEventReceiverMethod : public MSEventReceiver { //############################################################################## // The template class MSEventReceiverMethod is used to provide an // MSEventReceiver-type wrapper for particular C++ member methods. // // The template class argument is the class name MethodClass of the class whose // member method is to be wrapped. // // The constructor for the object requires two things: // - An instance of class MethodClass. // - A pointer to a member method of the class MethodClass. This member method // will be applied to the object specified on the constructor when the // callback is invoked. // // - The method should have the following prototype: // // void MethodClass::method(MSEvent& aEvent_) // { // } // // Only non-const member methods are supported. // //############################################################################### typedef void (MethodClass::*Method)(MSEvent&); private: Method _method; MethodClass *_object; protected: virtual MSBoolean addSender(MSEventSender *); virtual MSBoolean removeSender(MSEventSender *); public: #ifdef MS_METHOD_POINTER_DEFAULTARG_BUG MSEventReceiverMethod(MethodClass *object_,Method method_) : _object(object_),_method(method_) {} MSEventReceiverMethod(MethodClass *object_=0) : _object(object_),_method(0) {} #else MSEventReceiverMethod(MethodClass *object_=0,Method method_=0) : _object(object_),_method(method_) {} #endif ~MSEventReceiverMethod(void); void method(MethodClass* object_,Method method_) {_object=object_,_method=method_;} Method method(void) { return _method; } MethodClass *object(void) { return _object; } inline virtual void receiveEvent(MSEvent&); }; template inline void MSEventReceiverMethod::receiveEvent(MSEvent& aEvent_) { if (_object!=0&&_method!=0) (_object->*_method)(aEvent_); } #endif aplus-fsf-4.22/src/MSTypes/MSEventSender.H0000644000265000001440000000303610772770456013765 #ifndef MSEventSenderHEADER #define MSEventSenderHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #if HAVE_NEW #include #else #include #endif class MSTypesExport MSEventSender { public: MSEventSender(void) { _pReceiverList=0; } MSEventSender(const MSEventSender&) { _pReceiverList=0; } virtual ~MSEventSender(void); // protection against pointer bit wise copy MSEventSender& operator=(const MSEventSender&) { return *this; } MSBoolean addReceiver(MSEventReceiver *); MSBoolean removeReceiver(MSEventReceiver *); void removeAllReceivers(void); void blockEvents(void); void unblockEvents(MSBoolean sendEvent_=MSTrue); protected: virtual void sendEvent(MSEvent&); virtual void addReceiverNotify(MSEventReceiver *); virtual void removeReceiverNotify(MSEventReceiver *); unsigned numReceivers() const; public: class MSTypesExport List { public: unsigned _blockCount; unsigned _allocated; MSEventReceiver *_array[1]; List(void) : _blockCount(0),_allocated(0) {} void *operator new(size_t,unsigned); void operator delete(void *); }; protected: List *_pReceiverList; List *receiverList(void) const { return _pReceiverList; } }; #endif aplus-fsf-4.22/src/MSTypes/MSException.H0000644000265000001440000000343310772770456013502 #ifndef MSExceptionHEADER #define MSExceptionHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include /****************************************************************************************/ // MStk exceptions defines. // /****************************************************************************************/ // // Class MSException defines a standard interface for exception handling. // class MSTypesExport MSException { public: MSException () {} MSException (const MSException&) {} MSException& operator= (const MSException&) { return *this; } virtual ~MSException (); virtual const char * what () const; }; // // MSExceptionError provides a string constructor that allows to define exception message // class MSTypesExport MSExceptionError : public MSException { public: MSExceptionError (const MSExceptionError& anError_) : _pMessage(0) { init(anError_._pMessage); } MSExceptionError (const char* pMessage_) : _pMessage(0) { init(pMessage_); } MSExceptionError& operator=(const MSExceptionError&); virtual ~MSExceptionError (); virtual const char * what () const; protected: MSExceptionError(void) {} private: void init(const char* pMessage_); char* _pMessage; }; // A few standard mstk Errors. class MSTypesExport MSOutOfMemory : public MSExceptionError { public: MSOutOfMemory(const char * what_); ~MSOutOfMemory(); }; class MSTypesExport MSCollectionError : public MSExceptionError { public: MSCollectionError(const char * what_); ~MSCollectionError(); }; #endif aplus-fsf-4.22/src/MSTypes/MSFloat.H0000644000265000001440000002372010772770457012613 #ifndef MSFloatHEADER #define MSFloatHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #if HAVE_SVR4 #include #endif #if defined(MS_C_LINKAGE_INCOMPATIBILITY) extern "C" { typedef double (*FloatMathFunction)(double); } #else typedef double (*FloatMathFunction)(double); #endif class MSFormat; class MSTypesExport MSFloat : public MSScalarModel { public: // Formats for formats. Note that since MSRate and MSMoney // are derived from MSFloat,these formats are "inherited". enum MSFloatFormat { Decimal0=200, // 1234 Decimal1=201, // 1234.2 Decimal2=202, // 1234.17 Decimal3=203, // 1234.171 Decimal4=204, // 1234.1712 Decimal5=205, // 1234.17123 Decimal6=206, // 1234.171234 Decimal7=207, // 1234.1712345 Decimal8=208, // 1234.17123456 CommaDecimal0=209, // 1,234 CommaDecimal1=210, // 1,234.2 CommaDecimal2=211, // 1,234.17 CommaDecimal3=212, // 1,234.171 CommaDecimal4=213, // 1,234.1712 CommaDecimal5=214, // 1,234.17123 CommaDecimal6=215, // 1,234.171234 CommaDecimal7=216, // 1,234.1712345 CommaDecimal8=217, // 1,234.17123456 MaximumPrecision=218, Default=219 }; // These constructors and destructors are *very* heavily used. When // they were out-of-line they amounted to around 5% of total execution // time for one project. MSFloat(void) : _flags(MSFloat::Valid),_real(0.0) {} MSFloat(double r_) : _flags(MSFloat::Set),_real(r_) {if (finite(r_)>0) _flags|=MSFloat::Valid;} MSFloat(int i_) : _real(i_),_flags(MSFloat::Set|MSFloat::Valid) {} MSFloat(const MSFloat& f_) : _real(f_._real),_flags(f_._flags) {} MSFloat(const MSInt& i_) : _real(int(i_)),_flags((i_.isSet()==MSTrue) ? Set|Valid : Valid) {} virtual ~MSFloat(void); inline friend MSTypesExport unsigned long hash(const MSFloat&,unsigned long size_); inline long compare(const MSFloat&) const; inline long compare(const MSFloat*) const; virtual MSString asString(void) const; virtual MSString asDebugInfo(void) const; virtual MSString asMSF(void) const; virtual MSString className(void) const; virtual const MSSymbol& type(void) const; virtual MSModel *clone(void) const; virtual MSModel *create(void) const; virtual void assign(const MSModel&); virtual long compare(const MSModel&) const; virtual MSError::ErrorStatus set(const char *); virtual MSError::ErrorStatus setFromMSF(const char*); static const MSSymbol& symbol(void); virtual MSError::ErrorStatus set(const MSString *); virtual MSError::ErrorStatus set(const MSString &); virtual MSError::ErrorStatus set(double); const char *format(MSString *) const; const char *format(MSString &) const; const char *format(MSString *,MSFloatFormat) const; const char *format(MSString &,MSFloatFormat) const; const char *format(MSString*,const MSFormat&) const; const char *format(MSString&,const MSFormat&) const; // operators // Most of the time, MSFloat will be automatically converted to // a double, the built-in double operators will be used, and the // result will be converted back into a MSFloat automatically. operator double() const { return _real; } double operator()() const { return _real; } // function call operator MSFloat& operator=(const MSFloat&); MSFloat& operator=(int value_) { set((double)value_); return *this; } MSFloat& operator=(double value_) { set(value_); return *this; } MSFloat& operator=(const char *value_) { set(value_); return *this; } MSFloat& sin(void) { return apply(::sin); } MSFloat& sinh(void) { return apply(::sinh); } MSFloat& cos(void) { return apply(::cos); } MSFloat& cosh(void) { return apply(::cosh); } MSFloat& tan(void) { return apply(::tan); } MSFloat& tanh(void) { return apply(::tanh); } MSFloat& asin(void) { return apply(::asin); } MSFloat& acos(void) { return apply(::acos); } MSFloat& atan(void) { return apply(::atan); } MSFloat& exp(void) { return apply(::exp); } MSFloat& log(void) { return apply(::log); } MSFloat& sqrt(void) { return apply(::sqrt); } MSFloat& ceil(void) { return apply(::ceil); } MSFloat& floor(void) { return apply(::floor); } MSFloat& abs(void) { return apply(::fabs); } // The equality operators return MSTrue if the difference between // the values is less than MSFloatDelta (see MSFloat.C) MSBoolean operator==(const MSFloat &r_) const { return *this==r_._real; } MSBoolean operator==(int i_) const { return *this==(double)i_; } MSBoolean operator==(const MSInt& i_) const { return *this==(double)((int)i_); } MSBoolean operator==(double d_) const; MSBoolean operator!=(const MSFloat &r_) const { return (*this==r_._real)?MSFalse:MSTrue; } MSBoolean operator!=(double r_) const { return (_real==r_)?MSFalse:MSTrue; } MSBoolean operator!=(int i_) const { return *this!=(double)i_; } MSBoolean operator!=(const MSInt& i_) const { return *this!=(double)((int)i_); } friend MSTypesExport MSFloat operator+(const MSFloat&,const MSFloat&); friend MSTypesExport MSFloat operator-(const MSFloat&,const MSFloat&); friend MSTypesExport MSFloat operator*(const MSFloat&,const MSFloat&); friend MSTypesExport MSFloat operator/(const MSFloat&,const MSFloat&); friend MSTypesExport MSFloat operator+(const MSFloat&,const MSInt&); friend MSTypesExport MSFloat operator-(const MSFloat&,const MSInt&); friend MSTypesExport MSFloat operator*(const MSFloat&,const MSInt&); friend MSTypesExport MSFloat operator/(const MSFloat&,const MSInt&); friend MSTypesExport MSFloat operator+(const MSInt&,const MSFloat&); friend MSTypesExport MSFloat operator-(const MSInt&,const MSFloat&); friend MSTypesExport MSFloat operator*(const MSInt&,const MSFloat&); friend MSTypesExport MSFloat operator/(const MSInt&,const MSFloat&); friend MSTypesExport MSFloat operator+(double,const MSFloat&); friend MSTypesExport MSFloat operator-(double,const MSFloat&); friend MSTypesExport MSFloat operator*(double,const MSFloat&); friend MSTypesExport MSFloat operator/(double,const MSFloat&); friend MSTypesExport MSFloat operator+(const MSFloat&,double); friend MSTypesExport MSFloat operator-(const MSFloat&,double); friend MSTypesExport MSFloat operator*(const MSFloat&,double); friend MSTypesExport MSFloat operator/(const MSFloat&,double); friend MSTypesExport MSFloat operator+(int,const MSFloat&); friend MSTypesExport MSFloat operator-(int,const MSFloat&); friend MSTypesExport MSFloat operator*(int,const MSFloat&); friend MSTypesExport MSFloat operator/(int,const MSFloat&); friend MSTypesExport MSFloat operator+(const MSFloat&,int); friend MSTypesExport MSFloat operator-(const MSFloat&,int); friend MSTypesExport MSFloat operator*(const MSFloat&,int); friend MSTypesExport MSFloat operator/(const MSFloat&,int); MSFloat& operator+=(const MSFloat&); MSFloat& operator+=(const MSInt&); MSFloat& operator+=(double r_); MSFloat& operator+=(int i_); MSFloat& operator-=(const MSFloat&); MSFloat& operator-=(const MSInt&); MSFloat& operator-=(double r_); MSFloat& operator-=(int i_); MSFloat& operator*=(const MSFloat&); MSFloat& operator*=(const MSInt&); MSFloat& operator*=(double r_); MSFloat& operator*=(int i_); MSFloat& operator/=(const MSFloat&); MSFloat& operator/=(const MSInt&); MSFloat& operator/=(double r_); MSFloat& operator/=(int i_); MSFloat operator-() { return -_real; } MSBoolean isSet(void) const; MSBoolean isValid(void) const; void setInvalid(void); void unset(void); friend MSTypesExport ostream& operator<<(ostream& aStream_,const MSFloat&); friend MSTypesExport istream& operator>>(istream& aStream_,MSFloat&); protected: enum BitFlag {Valid=0x1,Set=0x2}; double _real; unsigned _flags; MSError::ErrorStatus internalSet(const char *); // nuts-and-bolts of formatted format function const char *formatReal(MSString&,MSFloatFormat,unsigned long modifier_,double value) const; MSFloat& apply(FloatMathFunction func_) { set(func_(_real)); return *this; } enum FloatInitialization {Uninitialized}; MSFloat(FloatInitialization) {} // optimization - we want an unitialized float // // The following methods are used to maintain the state bits for // the object // MSBoolean bitState(MSFloat::BitFlag) const; void setToValid(void); void setToInValid(void); void setBit(MSFloat::BitFlag); void unsetBit(MSFloat::BitFlag); // special protected constructors - they allow us to take advantage of the // return value optimization (RV0) - see section 12.1c of the ARM enum FloatOperator{Plus,Minus,Multiply,Divide}; MSFloat(const MSFloat&,const MSFloat&,FloatOperator); MSFloat(const MSFloat&,const MSInt&,FloatOperator); MSFloat(const MSInt&,const MSFloat&,FloatOperator); MSFloat(const MSFloat&,double,FloatOperator); MSFloat(double,const MSFloat&,FloatOperator); MSFloat(const MSFloat&,int,FloatOperator); MSFloat(int,const MSFloat&,FloatOperator); }; // Note that "equivalence" has a fudge factor, so comparisons // have to check for "equality" first inline long MSFloat::compare(const MSFloat& aFloat_) const { return aFloat_==_real?0:(_real>aFloat_._real?1:-1); } inline long MSFloat::compare(const MSFloat *pFloat_) const { return compare(*pFloat_); } inline long compare(const MSFloat& aFloat_,const MSFloat& bFloat_) { return aFloat_.compare(bFloat_); } inline unsigned long hash(const MSFloat& aFloat_,unsigned long size_) { return int(aFloat_._real)%size_; } #ifndef MS_NO_INLINES #ifndef MSFloatINLINES #include #endif #endif #endif aplus-fsf-4.22/src/MSTypes/MSFloatMatrix.H0000644000265000001440000006206310772770457014003 #ifndef MSFloatMatrixHEADER #define MSFloatMatrixHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #if defined(MS_TEMPLATE_BEFORE_SPECIALIZATION) #include #endif #include #include #include #include #include class MSBinaryVector; template class MSTypeMatrix; template class MSTypeVector; template class MSMatrixSTypePick; // MSTypeMatrix indexed by an unsigned int #if !defined(MS_NO_PREDECLARE_SPECIALIZATION) class MSMatrixSTypePick; #endif #if !defined(MS_MSFloatMatrix_INSTANTIATE) && defined(MS_STD_TEMPLATE_SPECIALIZATION) template <> class MSTypeMatrix : public MSMatrix #else template <> class MSTypesExport MSTypeMatrix : public MSMatrix #endif { public: MSTypeMatrix(void); MSTypeMatrix(unsigned rows_,unsigned columns_); MSTypeMatrix(unsigned rows_,unsigned columns_,double fill_); MSTypeMatrix(const MSTypeMatrix&); MSTypeMatrix(MSTypeData > *dp_,unsigned rows_,unsigned columns_); MSTypeMatrix(const double *pElements_,unsigned rows_,unsigned columns_); ~MSTypeMatrix(void); virtual MSString asString(void) const; virtual MSString asMSF(void) const; virtual MSString asDebugInfo(void) const; virtual MSString className(void) const; virtual const MSSymbol& type(void) const; virtual MSModel *clone(void) const; virtual MSModel *create(void) const; virtual void assign(const MSModel&); virtual long compare(const MSModel&) const; virtual MSError::ErrorStatus set(const char *pString_); virtual MSError::ErrorStatus setFromMSF(const char *pString_); static const MSSymbol& symbol(void); MSError::ErrorStatus set(unsigned index_,const char *pString_); MSError::ErrorStatus set(unsigned index_,double); unsigned indexOf(double aValue_,unsigned startPos_=0) const; unsigned lastIndexOf(double aValue_,unsigned startPos_=UINT_MAX-1) const; inline const double& elementAt(unsigned) const; inline const double& elementAt(unsigned,unsigned) const; MSTypeMatrix& series(double offset_=0.0); MSTypeMatrix& random(unsigned long limit_=0); double min(void) const; double max(void) const; double sum(void) const; MSTypeMatrix& operator=(const MSTypeMatrix&); MSTypeMatrix& operator=(const MSMatrixSTypePick&); MSTypeMatrix& operator=(double); inline double operator()(unsigned index_) const; inline double operator[](unsigned index_) const; inline double operator()(unsigned row_,unsigned column_) const; inline MSMatrixSTypePick operator()(unsigned index_); inline MSMatrixSTypePick operator[](unsigned index_); inline MSMatrixSTypePick operator()(unsigned row_,unsigned column_); friend MSTypesExport ostream& operator<<(ostream&,const MSTypeMatrix&); friend MSTypesExport MSTypeMatrix operator-(const MSTypeMatrix&); MSTypeMatrix& operator++(); // Prefix MSTypeMatrix& operator--(); MSTypeMatrix operator++(int); // Postfix MSTypeMatrix operator--(int); long compare(const MSTypeMatrix&) const; //inline friend MSTypesExport long compare(const MSTypeMatrix&,const MSTypeMatrix&); MSBinaryMatrix binaryCompare(const MSTypeMatrix&,MSComparison) const; MSBinaryMatrix binaryCompare(double,MSComparison) const; MSBoolean scalarCompare(double,MSComparison) const; inline MSBoolean operator==(const MSTypeMatrix&) const; inline MSBoolean operator!=(const MSTypeMatrix&) const; inline friend MSTypesExport MSBoolean operator<(const MSTypeMatrix&,const MSTypeMatrix&); inline friend MSTypesExport MSBoolean operator>(const MSTypeMatrix&,const MSTypeMatrix&); inline friend MSTypesExport MSBoolean operator<=(const MSTypeMatrix&,const MSTypeMatrix&); inline friend MSTypesExport MSBoolean operator>=(const MSTypeMatrix&,const MSTypeMatrix&); inline friend MSTypesExport MSBoolean operator<(const MSTypeMatrix&,double); inline friend MSTypesExport MSBoolean operator<(double,const MSTypeMatrix&); inline friend MSTypesExport MSBoolean operator>(const MSTypeMatrix&,double); inline friend MSTypesExport MSBoolean operator>(double,const MSTypeMatrix&); inline friend MSTypesExport MSBoolean operator<=(const MSTypeMatrix&,double); inline friend MSTypesExport MSBoolean operator<=(double,const MSTypeMatrix&); inline friend MSTypesExport MSBoolean operator>=(const MSTypeMatrix&,double); inline friend MSTypesExport MSBoolean operator>=(double,const MSTypeMatrix&); inline friend MSTypesExport MSBoolean operator==(const MSTypeMatrix&,double); inline friend MSTypesExport MSBoolean operator==(double,const MSTypeMatrix&); inline friend MSTypesExport MSBoolean operator!=(const MSTypeMatrix&,double); inline friend MSTypesExport MSBoolean operator!=(double,const MSTypeMatrix&); friend MSTypesExport MSTypeMatrix operator+(const MSTypeMatrix&,double); friend MSTypesExport MSTypeMatrix operator+(double,const MSTypeMatrix&); friend MSTypesExport MSTypeMatrix operator+(const MSTypeMatrix&,const MSTypeMatrix&); MSTypeMatrix& operator+=(double); friend MSTypesExport MSTypeMatrix operator-(const MSTypeMatrix&,double); friend MSTypesExport MSTypeMatrix operator-(const MSTypeMatrix&,const MSTypeMatrix&); MSTypeMatrix& operator-=(double); friend MSTypesExport MSTypeMatrix operator*(const MSTypeMatrix&,double); friend MSTypesExport MSTypeMatrix operator*(double,const MSTypeMatrix&); friend MSTypesExport MSTypeMatrix operator*(const MSTypeMatrix&,const MSTypeMatrix&); MSTypeMatrix& operator*=(double); friend MSTypesExport MSTypeMatrix operator/(const MSTypeMatrix&,double); friend MSTypesExport MSTypeMatrix operator/(const MSTypeMatrix&,const MSTypeMatrix&); MSTypeMatrix& operator/=(double); // The following operators are equivalent to the apl operation m_ (x @1 0) v_ friend MSTypesExport MSTypeMatrix operator+(const MSTypeMatrix& m_,const MSTypeVector& v_); friend MSTypesExport MSTypeMatrix operator-(const MSTypeMatrix& m_,const MSTypeVector& v_); friend MSTypesExport MSTypeMatrix operator*(const MSTypeMatrix& m_,const MSTypeVector& v_); friend MSTypesExport MSTypeMatrix operator/(const MSTypeMatrix& m_,const MSTypeVector& v_); // The following operators are equivalent to the apl operation v_ (x @0 1) m_ friend MSTypesExport MSTypeMatrix operator+(const MSTypeVector& v_,const MSTypeMatrix& m_); friend MSTypesExport MSTypeMatrix operator*(const MSTypeVector& v_,const MSTypeMatrix& m_); // matrix multiplication (inner product) friend MSTypesExport MSTypeMatrix multiply(const MSTypeMatrix&,const MSTypeMatrix&); // stack matrices vertically MSTypeMatrix& stack(const MSTypeMatrix&); friend MSTypesExport MSTypeMatrix stack(const MSTypeMatrix&,const MSTypeMatrix&); // adjoin matrices horizontally MSTypeMatrix& adjoin(const MSTypeMatrix&); friend MSTypesExport MSTypeMatrix adjoin(const MSTypeMatrix&,const MSTypeMatrix&); MSTypeMatrix& appendColumn(const MSTypeVector&); MSTypeMatrix& appendColumns(unsigned columns_,double fill_=0); MSTypeMatrix& appendRow(const MSTypeVector&); MSTypeMatrix& appendRows(unsigned rows_,double fill_=0); MSTypeMatrix& exchangeColumns(unsigned a_,unsigned b_); MSTypeMatrix& exchangeRows(unsigned a_,unsigned b_); MSTypeMatrix& insertColumnBefore(unsigned column_,double fill_=0); MSTypeMatrix& insertColumnBefore(unsigned column_,const MSTypeVector&); MSTypeMatrix& insertColumnAfter(unsigned column_,double fill_=0); MSTypeMatrix& insertColumnAfter(unsigned column_,const MSTypeVector&); MSTypeMatrix& insertRowBefore(unsigned row_,double fill_=0); MSTypeMatrix& insertRowBefore(unsigned row_,const MSTypeVector&); MSTypeMatrix& insertRowAfter(unsigned row_,double fill_=0); MSTypeMatrix& insertRowAfter(unsigned row_,const MSTypeVector&); MSTypeMatrix& reshape(unsigned rows_,unsigned columns_); MSTypeMatrix& removeAll(void); MSTypeMatrix& removeAllRows(void); MSTypeMatrix& removeAllColumns(void); MSTypeMatrix& assignRow(unsigned row_, double scalar_); MSTypeMatrix& assignColumn(unsigned column_, double scalar_); MSTypeMatrix& assignColumn(unsigned column_, const MSTypeVector&); MSTypeMatrix& assignRow(unsigned row_, const MSTypeVector&); MSTypeMatrix& removeRow(unsigned row_); MSTypeMatrix& removeColumn(unsigned column_); MSTypeMatrix& compressRows(const MSBinaryVector&); MSTypeMatrix& compressColumns(const MSBinaryVector&); MSTypeMatrix& reverseRows(void); MSTypeMatrix& reverseColumns(void); MSTypeMatrix& transpose(void); MSTypeMatrix& rotateRows(int position_); MSTypeMatrix& rotateColumns(int position_); MSTypeMatrix& takeRows(int numberOfRows_); MSTypeMatrix& takeColumns(int numberOfColumns_); MSTypeMatrix& dropRows(int numberOfRows_); MSTypeMatrix& dropColumns(int numberOfColumns_); MSTypeVector rowAt(unsigned row_) const; MSTypeVector columnAt(unsigned column_) const; MSTypeMatrix& allElementsDo(ElementWiseFunction,void *clientData_=0); MSTypeMatrix& allElementsDo(MathFunction); friend MSTypesExport MSTypeMatrix allElementsDo(const MSTypeMatrix&,MathFunction); friend MSTypesExport MSTypeMatrix allElementsDo(const MSTypeMatrix&, ElementWiseFunction, void *clientData_=0); MSTypeMatrix& sin(void); MSTypeMatrix& sinh(void); MSTypeMatrix& cos(void); MSTypeMatrix& cosh(void); MSTypeMatrix& tan(void); MSTypeMatrix& tanh(void); MSTypeMatrix& asin(void); MSTypeMatrix& acos(void); MSTypeMatrix& atan(void); MSTypeMatrix& exp(void); MSTypeMatrix& log(void); MSTypeMatrix& sqrt(void); MSTypeMatrix& ceil(void); MSTypeMatrix& floor(void); MSTypeMatrix& abs(void); MSTypeMatrix& pow(double); friend MSTypesExport MSTypeMatrix sin(const MSTypeMatrix&); friend MSTypesExport MSTypeMatrix sinh(const MSTypeMatrix&); friend MSTypesExport MSTypeMatrix cos(const MSTypeMatrix&); friend MSTypesExport MSTypeMatrix cosh(const MSTypeMatrix&); friend MSTypesExport MSTypeMatrix tan(const MSTypeMatrix&); friend MSTypesExport MSTypeMatrix tanh(const MSTypeMatrix&); friend MSTypesExport MSTypeMatrix asin(const MSTypeMatrix&); friend MSTypesExport MSTypeMatrix acos(const MSTypeMatrix&); friend MSTypesExport MSTypeMatrix atan(const MSTypeMatrix&); friend MSTypesExport MSTypeMatrix exp(const MSTypeMatrix&); friend MSTypesExport MSTypeMatrix log(const MSTypeMatrix&); friend MSTypesExport MSTypeMatrix sqrt(const MSTypeMatrix&); friend MSTypesExport MSTypeMatrix ceil(const MSTypeMatrix&); friend MSTypesExport MSTypeMatrix floor(const MSTypeMatrix&); friend MSTypesExport MSTypeMatrix abs(const MSTypeMatrix&); friend MSTypesExport MSTypeMatrix pow(const MSTypeMatrix&,double); void error(const char *) const; inline double *data(void) const; inline unsigned size(void) const; inline unsigned length(void) const; protected: friend class MSMatrixSTypePick; static double _badData; // used as return value for index errors MSTypeData > *_pData; // unsigned _size; MSBoolean _blocked; inline MSTypeData > *pData(void) const; inline MSBoolean blocked(void) const; inline void blocked(MSBoolean); void reserve(unsigned); void blockLeft(unsigned target_,unsigned moveCount_); void blockRight(unsigned target_,unsigned moveCount_); void freeData(void); void allocData(unsigned); void makeUniqueCopy(void); void prepareToChange(void); inline MSTypeData > *incrementCount(void); inline void decrementCount(void); inline double& elementAt(unsigned); inline double& elementAt(unsigned,unsigned); // ElementWiseFunction that returns x**y static double _pow(double x_,void *y_); }; #if !defined(MS_MSFloatMatrix_INSTANTIATE) && defined(MS_STD_TEMPLATE_SPECIALIZATION) template <> class MSMatrixSTypePick #else template <> class MSTypesExport MSMatrixSTypePick #endif { public: inline MSMatrixSTypePick& operator=(double); MSMatrixSTypePick& operator+=(double); MSMatrixSTypePick& operator-=(double); MSMatrixSTypePick& operator*=(double); MSMatrixSTypePick& operator/=(double); MSMatrixSTypePick& operator++(int); MSMatrixSTypePick& operator--(int); inline operator double() const; inline MSTypeMatrix *pMatrix(void) const; inline double value(void) const; inline unsigned index(void) const; private: #ifdef MS_TEMPLATE_FRIEND_CLASS_BUG friend MSTypeMatrix; #else friend class MSTypeMatrix; #endif inline MSMatrixSTypePick(const MSTypeMatrix&,unsigned); inline MSMatrixSTypePick(const MSMatrixSTypePick&); MSTypeMatrix *_pMatrix; unsigned _index; }; //------------------------------------------------------------ // MSTypeMatrix inlines //------------------------------------------------------------ inline MSTypeData > *MSTypeMatrix::pData(void) const { return _pData; } inline unsigned MSTypeMatrix::size(void) const { return _pData->size(); } //{ return _size; } inline unsigned MSTypeMatrix::length(void) const { return _count; } inline MSBoolean MSTypeMatrix::blocked(void) const { return _blocked; } inline void MSTypeMatrix::blocked(MSBoolean blocked_) { _blocked=blocked_; } inline double& MSTypeMatrix::elementAt(unsigned index_) { #if !defined(MS_NO_INDEX_ERROR) return (index_<_count)?_pData->elementAt(index_):(indexError(index_,length()),_badData); #else return _pData->elementAt(index_); #endif } inline const double& MSTypeMatrix::elementAt(unsigned index_) const { #if !defined(MS_NO_INDEX_ERROR) // return (index_<_count)?_pData->get(index_):(indexError(index_,length()),_badData); return (index_<_count)?_pData->elementAt(index_):(indexError(index_,length()),_badData); #else return _pData->elementAt(index_); #endif } inline double& MSTypeMatrix::elementAt(unsigned row_,unsigned column_) { #if !defined(MS_NO_INDEX_ERROR) unsigned ravel=index(row_,column_); return (ravel<_count)?_pData->elementAt(ravel):(indexError(ravel,length()),_badData); #else return _pData->elementAt(index(row_,column_)); #endif } inline const double& MSTypeMatrix::elementAt(unsigned row_,unsigned column_) const { #if !defined(MS_NO_INDEX_ERROR) unsigned ravel=index(row_,column_); return (ravel<_count)?_pData->elementAt(ravel):(indexError(ravel,length()),_badData); #else return _pData->elementAt(index(row_,column_)); #endif } inline double MSTypeMatrix::operator()(unsigned index_) const { return elementAt(index_); } inline double MSTypeMatrix::operator[](unsigned index_) const { return elementAt(index_); } inline double MSTypeMatrix::operator()(unsigned row_,unsigned column_) const { return elementAt(index(row_,column_)); } inline MSTypeData > *MSTypeMatrix::incrementCount(void) { return (_pData!=0)?_pData->incrementCount():0; } inline void MSTypeMatrix::decrementCount(void) { if (_pData!=0) _pData->decrementCount(); } inline double *MSTypeMatrix::data(void) const { return (_pData!=0)?_pData->elements():0; } // // inline long compare(const MSTypeMatrix& aTypeMatrix_,const MSTypeMatrix& bTypeMatrix_) // { return aTypeMatrix_.compare(bTypeMatrix_); } inline MSBoolean MSTypeMatrix::operator==(const MSTypeMatrix& aTypeMatrix_) const { return MSBoolean(compare(aTypeMatrix_)==0); } inline MSBoolean MSTypeMatrix::operator!=(const MSTypeMatrix& aTypeMatrix_) const { return MSBoolean(compare(aTypeMatrix_)!=0); } inline MSBoolean operator<(const MSTypeMatrix& aTypeMatrix_,const MSTypeMatrix& bTypeMatrix_) { return MSBoolean(aTypeMatrix_.compare(bTypeMatrix_)>0); } inline MSBoolean operator>(const MSTypeMatrix& aTypeMatrix_,const MSTypeMatrix& bTypeMatrix_) { return MSBoolean(aTypeMatrix_.compare(bTypeMatrix_)<0); } inline MSBoolean operator<=(const MSTypeMatrix& aTypeMatrix_,const MSTypeMatrix& bTypeMatrix_) { return MSBoolean(aTypeMatrix_.compare(bTypeMatrix_)>=0); } inline MSBoolean operator>=(const MSTypeMatrix& aTypeMatrix_,const MSTypeMatrix& bTypeMatrix_) { return MSBoolean(aTypeMatrix_.compare(bTypeMatrix_)<=0); } inline MSBoolean operator<(const MSTypeMatrix& aTypeMatrix_,double aType_) { return aTypeMatrix_.scalarCompare(aType_,MSLessThan); } inline MSBoolean operator<(double aType_,const MSTypeMatrix& aTypeMatrix_) { return aTypeMatrix_.scalarCompare(aType_,MSGreaterThan); } inline MSBoolean operator>(const MSTypeMatrix& aTypeMatrix_,double aType_) { return aTypeMatrix_.scalarCompare(aType_,MSGreaterThan); } inline MSBoolean operator>(double aType_,const MSTypeMatrix& aTypeMatrix_) { return aTypeMatrix_.scalarCompare(aType_,MSLessThan); } inline MSBoolean operator<=(const MSTypeMatrix& aTypeMatrix_,double aType_) { return aTypeMatrix_.scalarCompare(aType_,MSLessThanOrEqualTo); } inline MSBoolean operator<=(double aType_,const MSTypeMatrix& aTypeMatrix_) { return aTypeMatrix_.scalarCompare(aType_,MSGreaterThanOrEqualTo); } inline MSBoolean operator>=(const MSTypeMatrix& aTypeMatrix_,double aType_) { return aTypeMatrix_.scalarCompare(aType_,MSGreaterThanOrEqualTo); } inline MSBoolean operator>=(double aType_,const MSTypeMatrix& aTypeMatrix_) { return aTypeMatrix_.scalarCompare(aType_,MSLessThanOrEqualTo); } inline MSBoolean operator==(const MSTypeMatrix& aTypeMatrix_,double aType_) { return aTypeMatrix_.scalarCompare(aType_,MSEqualTo); } inline MSBoolean operator==(double aType_,const MSTypeMatrix& aTypeMatrix_) { return aTypeMatrix_.scalarCompare(aType_,MSEqualTo); } inline MSBoolean operator!=(const MSTypeMatrix& aTypeMatrix_,double aType_) { return aTypeMatrix_.scalarCompare(aType_,MSNotEqualTo); } inline MSBoolean operator!=(double aType_,const MSTypeMatrix& aTypeMatrix_) { return aTypeMatrix_.scalarCompare(aType_,MSNotEqualTo); } //------------------------------------------------------------ // MSMatrixSTypePick inlines //------------------------------------------------------------ inline MSMatrixSTypePick::MSMatrixSTypePick(const MSTypeMatrix& aTypeMatrix_,unsigned index_) { _pMatrix=&(MSTypeMatrix&)aTypeMatrix_; _index=index_; } inline MSMatrixSTypePick::MSMatrixSTypePick(const MSMatrixSTypePick& aPick_) { _pMatrix=aPick_.pMatrix(); _index=aPick_.index(); } inline MSMatrixSTypePick& MSMatrixSTypePick::operator=(double aType_) { _pMatrix->set(_index,aType_); return *this; } inline MSTypeMatrix *MSMatrixSTypePick::pMatrix(void) const { return _pMatrix; } inline unsigned MSMatrixSTypePick::index(void) const { return _index; } inline MSMatrixSTypePick::operator double() const { return _pMatrix->elementAt(_index); } inline double MSMatrixSTypePick::value(void) const { return _pMatrix->elementAt(_index); } //------------------------------------------------------------ // Pick Indexing operators - define here to avoid inline problem //------------------------------------------------------------ inline MSMatrixSTypePick MSTypeMatrix::operator()(unsigned index_) { return MSMatrixSTypePick(*this,index_); } inline MSMatrixSTypePick MSTypeMatrix::operator[](unsigned index_) { return MSMatrixSTypePick(*this,index_); } inline MSMatrixSTypePick MSTypeMatrix::operator()(unsigned row_,unsigned column_) { return MSMatrixSTypePick(*this,index(row_,column_)); } typedef MSTypeMatrix MSFloatMatrix; #ifndef MS_MSFloatMatrix_INSTANTIATE #ifdef MS_DECLARE_TEMPLATE_SPECIALIZATION template <> ostream& operator<<(ostream&,const MSTypeMatrix&); template <> MSTypeMatrix operator-(const MSTypeMatrix&); template <> MSTypeMatrix operator+(const MSTypeMatrix&,double); template <> MSTypeMatrix operator+(double,const MSTypeMatrix&); template <> MSTypeMatrix operator+(const MSTypeMatrix&,const MSTypeMatrix&); template <> MSTypeMatrix operator-(const MSTypeMatrix&,double); template <> MSTypeMatrix operator-(const MSTypeMatrix&,const MSTypeMatrix&); template <> MSTypeMatrix operator*(const MSTypeMatrix&,double); template <> MSTypeMatrix operator*(double,const MSTypeMatrix&); template <> MSTypeMatrix operator*(const MSTypeMatrix&,const MSTypeMatrix&); template <> MSTypeMatrix operator/(const MSTypeMatrix&,double); template <> MSTypeMatrix operator/(const MSTypeMatrix&,const MSTypeMatrix&); template <> MSTypeMatrix operator+(const MSTypeMatrix&,const MSTypeVector&); template <> MSTypeMatrix operator-(const MSTypeMatrix&,const MSTypeVector&); template <> MSTypeMatrix operator*(const MSTypeMatrix&,const MSTypeVector&); template <> MSTypeMatrix operator/(const MSTypeMatrix&,const MSTypeVector&); template <> MSTypeMatrix operator+(const MSTypeVector&,const MSTypeMatrix&); template <> MSTypeMatrix operator*(const MSTypeVector&,const MSTypeMatrix&); template <> MSTypeMatrix multiply(const MSTypeMatrix&,const MSTypeMatrix&); template <> MSTypeMatrix stack(const MSTypeMatrix&,const MSTypeMatrix&); template <> MSTypeMatrix adjoin(const MSTypeMatrix&,const MSTypeMatrix&); template <> MSTypeMatrix allElementsDo(const MSTypeMatrix&,MathFunction); template <> MSTypeMatrix allElementsDo(const MSTypeMatrix&,ElementWiseFunction,void *clientData_); template <> MSTypeMatrix sin(const MSTypeMatrix&); template <> MSTypeMatrix sinh(const MSTypeMatrix&); template <> MSTypeMatrix cos(const MSTypeMatrix&); template <> MSTypeMatrix cosh(const MSTypeMatrix&); template <> MSTypeMatrix tan(const MSTypeMatrix&); template <> MSTypeMatrix tanh(const MSTypeMatrix&); template <> MSTypeMatrix asin(const MSTypeMatrix&); template <> MSTypeMatrix acos(const MSTypeMatrix&); template <> MSTypeMatrix atan(const MSTypeMatrix&); template <> MSTypeMatrix exp(const MSTypeMatrix&); template <> MSTypeMatrix log(const MSTypeMatrix&); template <> MSTypeMatrix sqrt(const MSTypeMatrix&); template <> MSTypeMatrix ceil(const MSTypeMatrix&); template <> MSTypeMatrix floor(const MSTypeMatrix&); template <> MSTypeMatrix abs(const MSTypeMatrix&); template <> MSTypeMatrix pow(const MSTypeMatrix&,double); #endif #endif // We provide provide explicit "do_not_instantiate" pragmas here to avoid instantiation complications in // MStk applications. // #if !defined(__MSTYPESLIBRARY_BUILD__) && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma do_not_instantiate MSAllocator #pragma do_not_instantiate MSTypeData > #endif // !__MSTYPESLIBRARY_BUILD__ && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #endif aplus-fsf-4.22/src/MSTypes/MSFloatSPick.H0000644000265000001440000000325110772770457013542 #ifndef MSFloatSPickHEADER #define MSFloatSPickHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #if defined(MS_TEMPLATE_BEFORE_SPECIALIZATION) #include #endif template class MSBuiltinSPick; template class MSBuiltinVector; template <> class MSTypesExport MSBuiltinSPick { protected: unsigned int _index; MSBuiltinVector *_pVector; public: INLINELINKAGE MSBuiltinSPick (MSBuiltinVector &, unsigned int); INLINELINKAGE MSBuiltinSPick (const MSBuiltinSPick &); MSBuiltinSPick & operator= (const MSBuiltinSPick &); MSBuiltinSPick & operator= (const double &); INLINELINKAGE MSBuiltinSPick & operator++(); // prefix increment INLINELINKAGE MSBuiltinSPick & operator--(); // prefix decrement INLINELINKAGE double operator++ (int); // postfix increment INLINELINKAGE double operator-- (int); // postfix decrement INLINELINKAGE MSBuiltinSPick & operator+= (const double &); INLINELINKAGE MSBuiltinSPick & operator-= (const double &); INLINELINKAGE MSBuiltinSPick & operator*= (const double &); INLINELINKAGE MSBuiltinSPick & operator/= (const double &); INLINELINKAGE operator double() const; }; #ifndef MS_NO_INLINES #include #endif // MS_NO_INLINES #endif // MSFloatSPickHEADER aplus-fsf-4.22/src/MSTypes/MSFloatVector.H0000644000265000001440000001665410772770457014006 #ifndef MSFloatVectorHEADER #define MSFloatVectorHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MSDefinesHEADER #include #endif #if defined(MS_NEED_IMPLEMENTATION_PRAGMA) #pragma implementation("MSFloatVector.C") #endif #include #include #include #if defined(MS_TEMPLATE_BEFORE_SPECIALIZATION) #include #endif template class MSTypeVector; typedef MSBaseVector > BaseVectorDouble; typedef MSBuiltinVector BuiltinVectorDouble; #if defined(MS_VC_NEED_TEMPLATE_EXPORT) class MSTypesExport MSBaseVector >; class MSTypesExport MSBaseVectorOps >; class MSTypesExport MSBuiltinVector; class MSTypesExport MSBuiltinVectorOps; #endif #ifndef MS_MSFloatVector_INSTANTIATE #ifdef MS_DECLARE_TEMPLATE_SPECIALIZATION template <> class MSBaseVector >; template <> class MSBaseVectorOps >; template <> class MSBuiltinVector; template <> class MSBuiltinVectorOps; template <> ostream& operator<<(ostream&,const MSBaseVector >&); template <> MSTypeVector sin (const MSTypeVector &); template <> MSTypeVector cos (const MSTypeVector &); template <> MSTypeVector tan (const MSTypeVector &); template <> MSTypeVector asin (const MSTypeVector &); template <> MSTypeVector acos (const MSTypeVector &); template <> MSTypeVector atan (const MSTypeVector &); template <> MSTypeVector sinh (const MSTypeVector &); template <> MSTypeVector cosh (const MSTypeVector &); template <> MSTypeVector tanh (const MSTypeVector &); template <> MSTypeVector exp (const MSTypeVector &); template <> MSTypeVector log (const MSTypeVector &); template <> MSTypeVector sqrt (const MSTypeVector &); template <> MSTypeVector ceil (const MSTypeVector &); template <> MSTypeVector floor (const MSTypeVector &); template <> MSTypeVector abs (const MSTypeVector &); template <> MSTypeVector pow (const MSTypeVector &, double); #endif #endif #if defined(MS_C_LINKAGE_INCOMPATIBILITY) extern "C" { typedef double (*MathFunction)(double); } #else typedef double (*MathFunction)(double); #endif typedef double (*ElementWiseFunction)(double, void *); #if !defined(MS_MSFloatVector_INSTANTIATE) && defined(MS_STD_TEMPLATE_SPECIALIZATION) template <> class MSTypeVector : public BuiltinVectorDouble #else template <> class MSTypesExport MSTypeVector : public BuiltinVectorDouble #endif { protected: // ElementWiseFunction that returns x**y INLINELINKAGE static double powFunc (double x_,void *y_); public: MSTypeVector (); MSTypeVector (unsigned int); MSTypeVector (unsigned int, const double &); MSTypeVector (const MSTypeVector &); MSTypeVector (const BuiltinVectorDouble &); MSTypeVector (const BaseVectorDouble &); MSTypeVector (const char *); MSTypeVector (MSTypeData > *, unsigned int); MSTypeVector (const double *, unsigned int); virtual ~MSTypeVector(); MSTypeVector & operator= (const MSTypeVector &); MSTypeVector & operator= (const BuiltinVectorDouble &); MSTypeVector & operator= (const BaseVectorDouble &); MSTypeVector & operator= (const double &); MSTypeVector & operator= (const char *); virtual const MSSymbol & type() const; virtual MSString className() const; virtual MSModel *clone() const; virtual MSModel *create() const; static const MSSymbol & symbol(); MSTypeVector & allElementsDo (MathFunction); MSTypeVector & allElementsDo (ElementWiseFunction, void * =0); static MSTypeVector allElementsDo (const MSTypeVector &, MathFunction); static MSTypeVector allElementsDo (const MSTypeVector &, ElementWiseFunction, void * =0); MSTypeVector & sin(); MSTypeVector & cos(); MSTypeVector & tan(); MSTypeVector & asin(); MSTypeVector & acos(); MSTypeVector & atan(); MSTypeVector & sinh(); MSTypeVector & cosh(); MSTypeVector & tanh(); MSTypeVector & exp(); MSTypeVector & log(); MSTypeVector & sqrt(); MSTypeVector & ceil(); MSTypeVector & floor(); MSTypeVector & abs(); MSTypeVector & pow (double); friend MSTypesExport MSTypeVector sin (const MSTypeVector &); friend MSTypesExport MSTypeVector cos (const MSTypeVector &); friend MSTypesExport MSTypeVector tan (const MSTypeVector &); friend MSTypesExport MSTypeVector asin (const MSTypeVector &); friend MSTypesExport MSTypeVector acos (const MSTypeVector &); friend MSTypesExport MSTypeVector atan (const MSTypeVector &); friend MSTypesExport MSTypeVector sinh (const MSTypeVector &); friend MSTypesExport MSTypeVector cosh (const MSTypeVector &); friend MSTypesExport MSTypeVector tanh (const MSTypeVector &); friend MSTypesExport MSTypeVector exp (const MSTypeVector &); friend MSTypesExport MSTypeVector log (const MSTypeVector &); friend MSTypesExport MSTypeVector sqrt (const MSTypeVector &); friend MSTypesExport MSTypeVector ceil (const MSTypeVector &); friend MSTypesExport MSTypeVector floor (const MSTypeVector &); friend MSTypesExport MSTypeVector abs (const MSTypeVector &); friend MSTypesExport MSTypeVector pow (const MSTypeVector &, double); }; typedef MSTypeVector MSFloatVector; #ifndef MS_NO_INLINES #include #endif // MS_NO_INLINES // We provide provide explicit "do_not_instantiate" pragmas here to avoid instantiation complications in // MStk applications. // #if !defined(__MSTYPESLIBRARY_BUILD__) && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma do_not_instantiate MSAllocator #pragma do_not_instantiate MSTypeData > #pragma do_not_instantiate MSBaseVector > #pragma do_not_instantiate MSBaseVectorOps > #pragma do_not_instantiate MSBuiltinVector #pragma do_not_instantiate MSBuiltinVectorOps #pragma do_not_instantiate ostream& operator<<(ostream&, const MSBaseVector >&) #pragma do_not_instantiate unsigned int msMergeSortUp(unsigned int, double *, unsigned int *,unsigned int, unsigned int) #pragma do_not_instantiate unsigned int msMergeSortDown(unsigned int, double *, unsigned int *,unsigned int, unsigned int) #endif // !__MSTYPESLIBRARY_BUILD__ && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #endif // MSFloatVectorHEADER aplus-fsf-4.22/src/MSTypes/MSFormat.H0000644000265000001440000001061710772770457012777 #ifndef MSFormatHEADER #define MSFormatHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include template class MSTypeVector; typedef MSTypeVector MSStringVector; class MSHashTable; class MSTypesExport MSFormat { public: enum MSFormatType {NoFormat=0,FBool,Date,Float,Int,Money,Rate,Term,Time}; enum MSFormatModifier {NoModifier=0,UpperCaseK=1,LowerCaseK=2, UpperCaseM=4,LowerCaseM=8,Parenthesis=16}; MSFormat(void); MSFormat(const MSFormat&); MSFormat(const char *,const char *modifierString_="NoModifier"); MSFormat(MSBool::MSBoolFormat,unsigned long formatModifier_=NoModifier); MSFormat(MSDate::MSDateFormat,unsigned long formatModifier_=NoModifier); MSFormat(MSFloat::MSFloatFormat,unsigned long formatModifier_=NoModifier); MSFormat(MSInt::MSIntFormat,unsigned long formatModifier_=NoModifier); MSFormat(MSMoney::MSMoneyFormat,unsigned long formatModifier_=NoModifier); MSFormat(MSRate::MSRateFormat,unsigned long formatModifier_=NoModifier); MSFormat(MSTerm::MSTermFormat,unsigned long formatModifier_=NoModifier); MSFormat(MSTime::MSTimeFormat,unsigned long formatModifier_=NoModifier); ~MSFormat(void); MSFormat& operator=(const MSFormat&); MSBoolean operator==(const MSFormat&) const; MSBoolean operator!=(const MSFormat&) const; MSBoolean operator==(MSBool::MSBoolFormat) const; MSBoolean operator==(MSDate::MSDateFormat) const; MSBoolean operator==(MSFloat::MSFloatFormat) const; MSBoolean operator==(MSInt::MSIntFormat) const; MSBoolean operator==(MSMoney::MSMoneyFormat) const; MSBoolean operator==(MSRate::MSRateFormat) const; MSBoolean operator==(MSTerm::MSTermFormat) const; MSBoolean operator==(MSTime::MSTimeFormat) const; void format(const MSFormat&); void format(MSBool::MSBoolFormat); void format(MSDate::MSDateFormat); void format(MSFloat::MSFloatFormat); void format(MSInt::MSIntFormat); void format(MSMoney::MSMoneyFormat); void format(MSRate::MSRateFormat); void format(MSTerm::MSTermFormat); void format(MSTime::MSTimeFormat); void formatModifier(unsigned long); MSFormatType formatType(void) const; unsigned long formatModifier(void) const; MSString asString(void) const; MSString asModifierString(void) const; const MSStringVector& formats(void) const; MSBool::MSBoolFormat boolFormat(void) const; MSDate::MSDateFormat dateFormat(void) const; MSFloat::MSFloatFormat floatFormat(void) const; MSInt::MSIntFormat intFormat(void) const; MSMoney::MSMoneyFormat moneyFormat(void) const; MSRate::MSRateFormat rateFormat(void) const; MSTerm::MSTermFormat termFormat(void) const; MSTime::MSTimeFormat timeFormat(void) const; static const MSStringVector& boolFormats(void); static const MSStringVector& dateFormats(void); static const MSStringVector& floatFormats(void); static const MSStringVector& intFormats(void); static const MSStringVector& moneyFormats(void); static const MSStringVector& rateFormats(void); static const MSStringVector& termFormats(void); static const MSStringVector& timeFormats(void); static const MSStringVector& noFormats(void); static const MSStringVector& modifiers(void); private: MSFormatType _formatType; unsigned long _formatModifier; union { int _any; MSBool::MSBoolFormat _bool; MSDate::MSDateFormat _date; MSFloat::MSFloatFormat _float; MSInt::MSIntFormat _int; MSMoney::MSMoneyFormat _money; MSRate::MSRateFormat _rate; MSTerm::MSTermFormat _term; MSTime::MSTimeFormat _time; } _format; static MSHashTable *initFormatHashTable(void); static MSHashTable *initEnumHashTable(void); static MSHashTable *initModifierHashTable(void); static const MSHashTable *formatHashTable(void); static const MSHashTable *enumHashTable(void); static const MSHashTable *modifierHashTable(void); }; #ifndef MS_NO_INLINES #ifndef MSFormatINLINES #include #endif #endif #endif aplus-fsf-4.22/src/MSTypes/MSFormatFunctions.H0000644000265000001440000001165610772770457014674 #ifndef MSFormatFunctions_H #define MSFormatFunctions_H /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// // Do not use MSFormatFunctionsHEADER since it's used in MSOV/MSFormatFunction.H /*************************************************************************************/ // msFormatType - default calls member function format, specialized for all built in types /*************************************************************************************/ #include #include class MSInt; class MSMoney; class MSRate; class MSFormat; template < class Type> inline void msFormatType(const Type& aType, MSString& formatString_, const MSFormat& format_) { aType.format(formatString_, format_); } inline void msFormatType(const double& aType, MSString& formatString_, const MSFormat& format_) { MSFloat(aType).format(formatString_, format_); } inline void msFormatType(const float& aType, MSString& formatString_, const MSFormat&) { formatString_ = MSString(aType); } inline void msFormatType(const int& aType, MSString& formatString_, const MSFormat&) { formatString_ = MSString(aType); } inline void msFormatType(const long& aType, MSString& formatString_, const MSFormat&) { formatString_ = MSString(aType); } inline void msFormatType(const short& aType, MSString& formatString_, const MSFormat&) { formatString_ = MSString(aType); } inline void msFormatType(const char& aType, MSString& formatString_, const MSFormat&) { formatString_ = MSString(aType); } inline void msFormatType(const unsigned int& aType, MSString& formatString_, const MSFormat&) { formatString_ = MSString(aType); } inline void msFormatType(const unsigned long& aType, MSString& formatString_, const MSFormat&) { formatString_ = MSString(aType); } inline void msFormatType(const unsigned char& aType, MSString& formatString_, const MSFormat&) { formatString_ = MSString(aType); } inline void msFormatType(const unsigned short& aType, MSString& formatString_, const MSFormat&) { formatString_ = MSString(aType); } inline void msFormatType(const MSString& aType, MSString& formatString_, const MSFormat&) { formatString_ = aType; } inline void msFormatType(const MSSymbol& aType, MSString& formatString_, const MSFormat&) { formatString_ = aType.symbolName(); } /*************************************************************************************/ // msIsNumericType - default returns MSFalse, specialized for built in and MStk numeric types /*************************************************************************************/ template inline MSBoolean msIsNumericType(const Type&) { return MSFalse;} inline MSBoolean msIsNumericType(const MSFloat&) { return MSTrue; } inline MSBoolean msIsNumericType(const MSInt&) { return MSTrue; } inline MSBoolean msIsNumericType(const MSMoney&) { return MSTrue; } inline MSBoolean msIsNumericType(const MSRate&) { return MSTrue; } inline MSBoolean msIsNumericType(const short&) { return MSTrue; } inline MSBoolean msIsNumericType(const int&) { return MSTrue; } inline MSBoolean msIsNumericType(const float&) { return MSTrue; } inline MSBoolean msIsNumericType(const double&) { return MSTrue; } inline MSBoolean msIsNumericType(const long&) { return MSTrue; } inline MSBoolean msIsNumericType(const unsigned int&) { return MSTrue; } inline MSBoolean msIsNumericType(const unsigned long&) { return MSTrue; } inline MSBoolean msIsNumericType(const unsigned short&) { return MSTrue; } /*************************************************************************************/ // msToDoubleConversion - default doesn't perform any conversion, specialized /*************************************************************************************/ template inline double msToDoubleConversion (const Type&) { return 0; } inline double msToDoubleConversion (const MSFloat& aType_) { return (double)aType_; } inline double msToDoubleConversion (const MSInt& aType_) { return (double)aType_; } inline double msToDoubleConversion (const MSMoney& aType_) { return (double)aType_; } inline double msToDoubleConversion (const MSRate& aType_) { return (double)aType_; } inline double msToDoubleConversion (const short& aType_) { return (double)aType_; } inline double msToDoubleConversion (const int& aType_) { return (double)aType_; } inline double msToDoubleConversion (const double& aType_) { return aType_; } inline double msToDoubleConversion (const long& aType_) { return (double)aType_; } inline double msToDoubleConversion (const unsigned short& aType_) { return (double)aType_; } inline double msToDoubleConversion (const unsigned int& aType_) { return (double)aType_; } inline double msToDoubleConversion (const unsigned long& aType_) { return (double)aType_; } #endif aplus-fsf-4.22/src/MSTypes/MSFractionTables.H0000644000265000001440000000131110772770457014436 #ifndef MSFractionTablesHEADER #define MSFractionTablesHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// typedef struct { int length; struct { double value; char *fraction; } table[512]; } FractionTable; extern FractionTable EightsTable; extern FractionTable SixteenthsTable; extern FractionTable ThirtySecondsTable; extern FractionTable SixtyForthsTable; extern FractionTable OneTwentyEightsTable; extern FractionTable TwoFiftySixthsTable; #endif aplus-fsf-4.22/src/MSTypes/MSGenericArray.H0000644000265000001440000002342010772770457014116 #ifndef MSGenericArrayHEADER #define MSGenericArrayHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MSEnumHEADER #include #endif #ifndef MSDefinesHEADER #include #endif #include #include #include #include #include #if defined(MS_NEED_IMPLEMENTATION_PRAGMA) #pragma implementation("MSGenericArray.C") #endif /*************************************************************************************/ // MSGenericArray is a zero based array of event senders, currently implemented on // ITabularSequence. Elements are coupled with array on addition and decoupled on remove or // replace. MSGenericArray receives an event from it's elements and sends an indexed event // to the array event receiver. Both objects derived from MSEventSender and it's pointers // can be stored in the array. /*************************************************************************************/ class MSIndexVector; template class MSBaseComparator; template class MSComparatorList; template class MSGenericArray : public MSIndexedModel, public MSEventReceiver { public: typedef ITabularSequence ImplClass; typedef ITabularSequence::Cursor CursorClass; typedef long (*CompareFunction)(const Record&, const Record&); class Cursor : public ITabularSequence::Cursor { public: Cursor (const MSGenericArray& array_) : CursorClass(array_.sequence()) {} }; MSGenericArray(unsigned size_=100); MSGenericArray(const MSGenericArray& ); MSGenericArray & operator=(MSGenericArray const &) ; virtual ~MSGenericArray(void) ; // MSModel support methods virtual void receiveEvent(MSEvent & aEvent_); virtual MSString asString(void) const; virtual MSString asDebugInfo(void) const; virtual MSString asMSF(void) const; virtual MSString className(void) const; virtual const MSSymbol& type(void) const; virtual MSError::ErrorStatus set(const char*); virtual MSError::ErrorStatus setFromMSF(const char*); virtual MSModel *clone(void) const; virtual MSBoolean addSender(MSEventSender*); virtual MSBoolean removeSender(MSEventSender*); virtual void addReceiverNotify(MSEventReceiver*); virtual void removeReceiverNotify(MSEventReceiver*); static const MSSymbol& symbol(void); // access functions inline const Record& elementAt(unsigned) const; inline const Record& elementAt(const CursorClass&) const; inline const Record& elementAtPosition(unsigned) const; inline const Record& firstElement() const; inline const Record& lastElement() const; inline Record& elementAt(unsigned); inline Record& elementAt(const CursorClass&); inline unsigned numberOfElements(void) const; inline unsigned maxNumberOfElements(void) const; inline MSBoolean isEmpty(void) const; inline MSBoolean isLast(CursorClass const & cursor_) const; inline MSBoolean isFirst(CursorClass const & cursor_) const; // set functions inline MSBoolean setToFirst(CursorClass & cursor_) const; inline MSBoolean setToLast(CursorClass & cursor_) const; inline MSBoolean setToNext(CursorClass & cursor_) const; inline MSBoolean setToPrevious(CursorClass & cursor_) const; inline void setToPosition(unsigned int,CursorClass & cursor_) const; inline MSBoolean blocked(void) const; inline void blocked(MSBoolean); // add functions virtual MSBoolean add(Record const&); virtual MSBoolean add(Record const&,CursorClass&); virtual void addAsFirst(Record const&); virtual void addAsFirst(Record const&,CursorClass&); virtual void addAsLast(Record const&); virtual void addAsLast(Record const&,CursorClass&); virtual void addAsNext(Record const&,CursorClass &); virtual void addAsPrevious(Record const&,CursorClass &); virtual void addAllFrom(MSGenericArray const & array_); virtual void addAtPosition(unsigned position_,Record const& record_); virtual void addAtPosition(unsigned position_,Record const& record_,CursorClass & cursor_); // remove functions unsigned removeAll(MSBoolean (*property_)(Record const &,void*),void *additionalArgument_=0); void removeAll(void); void removeAt(CursorClass & cursor_); void removeAtPosition(unsigned position_); void removeFirst(void); void removeLast(void); void replaceAt(const CursorClass & cursor_,Record const & record_); // grade & sort functions void sort(CompareFunction); void sort(const MSBaseComparator&); void sort(const MSComparatorList&); void rangeSort(const MSBaseComparator&,unsigned start_,unsigned end_); void rangeSort(const MSComparatorList&,unsigned start_,unsigned end_); MSIndexVector grade(const MSBaseComparator&) const; MSIndexVector grade(const MSComparatorList&) const; MSIndexVector rangeGrade(const MSBaseComparator&, unsigned,unsigned) const; MSIndexVector rangeGrade(const MSComparatorList&, unsigned,unsigned) const; void permute(const MSIndexVector&); const ImplClass& sequence() const { return _seq; } protected: virtual MSBoolean deferredDeleteNeeded(void) const; void dereference(const CursorClass &); inline void changed(const MSIndexVector& indices_=MSIndexedModel::nullIndexVector()); inline unsigned int adjustPosition(unsigned int) const; // coupling and decoupling functions virtual void handleNotificationsFor(Record & aRecord_); virtual void stopHandlingNotificationsFor(Record & aRecord_); void handleNotificationsForAllElements(void); void stopHandlingNotificationsForAllElements(void); void handleNotificationsForBothEnds(void); void handleNotificationsForInsertion(Record&); void handleNotificationsForAddition(Record&); void stopHandlingNotificationsForBothEnds(void); void internalCheck(void); MSBoolean hasImplSizeChanged(void); void notifyReceivers(const MSIndexedAspectEvent & ev_); // members ImplClass _seq; unsigned int _addr; unsigned int _allocSize; MSBoolean _isElementPointer; MSBoolean _blocked; static long _pseudoCompare(const MSComparatorList&,const Record&,const Record&); static unsigned mergeSort(const MSComparatorList&,const MSGenericArray& a_,unsigned *p_,unsigned low_,unsigned high_); }; // inline functions definition template inline const Record & MSGenericArray::elementAt(unsigned index_) const { return _seq.elementAtPosition(adjustPosition(index_)); } template inline const Record & MSGenericArray::elementAtPosition(unsigned index_) const { return _seq.elementAtPosition(adjustPosition(index_)); } template const Record & MSGenericArray::elementAt(const CursorClass & cursor_) const { return _seq.elementAt(cursor_); } template inline Record & MSGenericArray::elementAt(const CursorClass & cursor_) { return _seq.elementAt(cursor_); } template inline Record & MSGenericArray::elementAt(unsigned index_) { CursorClass cursor(_seq); _seq.setToPosition(adjustPosition(index_),cursor); return _seq.elementAt(cursor); } template inline const Record & MSGenericArray::firstElement() const { return _seq.firstElement(); } template inline const Record & MSGenericArray::lastElement() const { return _seq.lastElement(); } template inline unsigned MSGenericArray::numberOfElements(void) const { return _seq.numberOfElements(); } template inline unsigned MSGenericArray::maxNumberOfElements(void) const { return _seq.maxNumberOfElements(); } template inline MSBoolean MSGenericArray::isEmpty(void) const { return (_seq.isEmpty()==True ? MSTrue : MSFalse); } template inline MSBoolean MSGenericArray::isLast(CursorClass const & cursor_) const { return (_seq.isLast(cursor_)==True ? MSTrue : MSFalse); } template inline MSBoolean MSGenericArray::isFirst(CursorClass const & cursor_) const { return (_seq.isFirst(cursor_)==True ? MSTrue : MSFalse ); } template inline MSBoolean MSGenericArray::setToFirst(CursorClass & cursor_) const { return (_seq.setToFirst(cursor_)==True ? MSTrue : MSFalse ); } template inline MSBoolean MSGenericArray::setToNext(CursorClass & cursor_) const { return (_seq.setToNext(cursor_)==True ? MSTrue : MSFalse ); } template inline MSBoolean MSGenericArray::setToLast(CursorClass & cursor_) const { return (_seq.setToLast(cursor_)==True ? MSTrue : MSFalse ); } template inline MSBoolean MSGenericArray::setToPrevious(CursorClass & cursor_) const { return (_seq.setToPrevious(cursor_)==True ? MSTrue : MSFalse ); } template inline void MSGenericArray::setToPosition(unsigned int position_,CursorClass & cursor_) const { _seq.setToPosition(adjustPosition(position_),cursor_); } template inline MSBoolean MSGenericArray::blocked(void) const { return _blocked; } template inline void MSGenericArray::blocked(MSBoolean aBoolean_) { _blocked=aBoolean_; } template inline void MSGenericArray::changed(const MSIndexVector& indices_) { if (receiverList()!=0&&blocked()==MSFalse) sendIndexedEvent(indices_); } template inline unsigned int MSGenericArray::adjustPosition(unsigned int position_) const { return position_+1; } #endif aplus-fsf-4.22/src/MSTypes/MSGenericVector.H0000644000265000001440000004011210772770457014277 #ifndef MSGenericVectorHEADER #define MSGenericVectorHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // /////////////////////////////////////////////////////////////////////////////// #ifndef MSDefinesHEADER #include #endif #if defined(MS_NEED_IMPLEMENTATION_PRAGMA) #pragma implementation("MSGenericVector.C") #endif #include #include #include #include #include #include template class MSGenericData; #if defined(MS_PREDECLARE_TEMPLATE_FRIENDS) template class MSGenericVector; template ostream& operator<< (ostream&, const MSGenericVector&); template INLINELINKAGE MSBoolean operator< (const MSGenericVector&, const MSGenericVector&); template INLINELINKAGE MSBoolean operator> (const MSGenericVector&, const MSGenericVector&); template INLINELINKAGE MSBoolean operator<=(const MSGenericVector&, const MSGenericVector&); template INLINELINKAGE MSBoolean operator>=(const MSGenericVector&, const MSGenericVector&); template INLINELINKAGE MSBoolean operator< (const MSGenericVector&, const Type&); template INLINELINKAGE MSBoolean operator< (const Type&, const MSGenericVector&); template INLINELINKAGE MSBoolean operator> (const MSGenericVector&, const Type&); template INLINELINKAGE MSBoolean operator> (const Type&, const MSGenericVector&); template INLINELINKAGE MSBoolean operator<=(const MSGenericVector&, const Type&); template INLINELINKAGE MSBoolean operator<=(const Type&, const MSGenericVector&); template INLINELINKAGE MSBoolean operator>=(const MSGenericVector&, const Type&); template INLINELINKAGE MSBoolean operator>=(const Type&, const MSGenericVector&); template INLINELINKAGE MSBoolean operator==(const MSGenericVector&, const Type&); template INLINELINKAGE MSBoolean operator==(const Type&, const MSGenericVector&); template INLINELINKAGE MSBoolean operator!=(const MSGenericVector&, const Type&); template INLINELINKAGE MSBoolean operator!=(const Type&, const MSGenericVector&); template INLINELINKAGE MSBoolean operator==(const MSGenericVector&, const MSGenericVector&); template INLINELINKAGE MSBoolean operator!=(const MSGenericVector&, const MSGenericVector&); template INLINELINKAGE MSGenericVector& operator<<(MSGenericVector&, const MSGenericVector&); template INLINELINKAGE MSGenericVector& operator<<(MSGenericVector&, const Type&); #endif //MS_PREDECLARE_TEMPLATE_FRIENDS template class MSGenericVectorOps : public MSVectorImplOps { protected: typedef MSGenericData Data; #ifdef MS_MULTI_THREAD static MSMutex _nullDataMutex; #endif static Data& nullData(void); static unsigned mergeSortUp (unsigned, Type *, unsigned *, unsigned, unsigned); static unsigned mergeSortDown (unsigned, Type *, unsigned *, unsigned, unsigned); INLINELINKAGE static unsigned indexCompareUp (Type *, unsigned, unsigned); INLINELINKAGE static unsigned indexCompareDown (Type *, unsigned, unsigned); public: MSGenericVectorOps(); virtual ~MSGenericVectorOps(); virtual void * allocate (unsigned int, unsigned int =0, MSAllocationFlag =MSRaw) const; virtual void * allocateWithSize (unsigned int, unsigned int =0, MSAllocationFlag =MSRaw) const; virtual void deallocate (void *, unsigned int =0, MSAllocationFlag =MSRaw) const; virtual void incrementCount (void *) const; virtual unsigned int refCount (const void *) const; virtual void set (void *, unsigned int, const void *, MSAllocationFlag =MSConstructed) const; virtual void set (void *, unsigned int, const void *, unsigned int, MSAllocationFlag =MSConstructed) const; virtual void fill (void *, unsigned int, unsigned int, const void *, MSAllocationFlag =MSConstructed) const; virtual void copy (const void *, void *, unsigned int, unsigned int =0, unsigned int =0, MSAllocationFlag =MSConstructed) const; virtual void copyBackward (void *, unsigned int, unsigned int, unsigned int) const; virtual void destroy (void *, unsigned int, unsigned int) const; virtual int isElementEqual (const void *, unsigned int, const void *) const; virtual int isElementLess (const void *, unsigned int, const void *) const; virtual int isElementLessEqual (const void *, unsigned int, const void *) const; virtual long compareElement (const void *, unsigned int, const void *) const; virtual void *elementAt (const void *, unsigned int) const; virtual unsigned int size (const void *) const; virtual void swapElements (void *, unsigned int, unsigned int) const; virtual unsigned int gradeUp (const void *, unsigned int, unsigned int *) const; virtual unsigned int gradeDown (const void *, unsigned int, unsigned int *) const; virtual void *badData() const; virtual void *defaultFiller() const; virtual MSString asString (const void *, unsigned int) const; virtual MSString asMSF (const void *, unsigned int) const; virtual unsigned int elementLen (const void *, unsigned int) const; virtual MSError::ErrorStatus setFromString (void *, unsigned int, const char *) const; virtual MSError::ErrorStatus setFromMSF (void *, unsigned int, const char *) const; virtual void print (const void *, unsigned int, ostream &) const; virtual unsigned int numElements (const MSString &, const char) const; virtual void setFromMSString (void *, unsigned int, const MSString &, unsigned int&, const char) const; }; template class MSGenericData : public MSData { public: MSGenericData (unsigned int =0); ~MSGenericData(); MSString asDebugInfo(void) const; void *operator new (size_t, unsigned =0); void operator delete (void *); INLINELINKAGE MSGenericData * incrementCount(); INLINELINKAGE void decrementCount (MSAllocationFlag =MSConstructed, unsigned int =0); INLINELINKAGE const Type * elements() const; INLINELINKAGE const Type * data() const; // same as elements(); used for backward compatibility only INLINELINKAGE Type * elements(); INLINELINKAGE Type * data(); // same as elements(); used for backward compatibility only INLINELINKAGE const Type & elementAt (unsigned index_) const; INLINELINKAGE Type & elementAt (unsigned index_); void set (unsigned int, const Type &, MSAllocationFlag =MSConstructed); static void constructElements(Type *, unsigned int, const Type&); static void destroyElements(Type *, unsigned int); static void fill (Type *, unsigned int, const Type &, MSAllocationFlag =MSConstructed); static void copy (const Type *, Type *, unsigned int, MSAllocationFlag =MSConstructed); static void copyBackward (const Type *, Type *, unsigned int); static MSGenericData *allocateWithSize (unsigned int, MSAllocationFlag =MSConstructed, unsigned int =0); static MSGenericData *allocateWithLength (unsigned int, MSAllocationFlag =MSConstructed, unsigned int =0); void deallocate (MSAllocationFlag =MSConstructed, unsigned int =0); protected: INLINELINKAGE static unsigned int dataOffset(void); // // ***** PLEASE NOTE ***** // // This class cannot contain any data members of its own; the only data members that it can have // are those inherited from MSData base class. The reason for this is that MSGenericData will // allocate an array of data elements **directly following** the end of MSData data members, // including the possible padding for alignment. // }; template class MSGenericVector { protected: typedef MSGenericVectorOps Operations; MSVectorImpl *_pImpl; #ifdef MS_MULTI_THREAD static MSMutex _operationsMutex; #endif MSGenericVector (MSVectorImpl *); static Operations& ops(void); public: MSGenericVector (); MSGenericVector (const MSGenericVector &); MSGenericVector (unsigned int); MSGenericVector (unsigned int, const Type &); // special constructor used for return value optimization MSGenericVector (MSGenericData *, unsigned int); MSGenericVector (const Type *, unsigned int); ~MSGenericVector(); MSGenericVector & operator= (const MSGenericVector &); MSGenericVector & operator= (const Type &); MSString asDebugInfo() const; MSError::ErrorStatus set (unsigned int, const Type &); INLINELINKAGE unsigned int length() const; INLINELINKAGE unsigned int size() const; INLINELINKAGE Type * elements() const; INLINELINKAGE unsigned int indexOf (const Type &, unsigned int =0) const; INLINELINKAGE unsigned int lastIndexOf (const Type &, unsigned int =UINT_MAX-1) const; INLINELINKAGE unsigned int occurrencesOf (const Type &, unsigned int =0) const; INLINELINKAGE MSIndexVector indicesOf (const MSGenericVector &) const; INLINELINKAGE MSBinaryVector memberOf (const MSGenericVector &) const; INLINELINKAGE MSBinaryVector uniqueElements() const; INLINELINKAGE MSGenericVector & replaceAt (unsigned int, const Type &); INLINELINKAGE MSGenericVector & append (const Type &); INLINELINKAGE MSGenericVector & append (const MSGenericVector &); MSGenericVector & insertAt (unsigned int, const Type &); MSGenericVector & insertAt (unsigned int, const MSGenericVector &); INLINELINKAGE MSGenericVector & removeAt (unsigned int); INLINELINKAGE MSGenericVector & removeAt (unsigned int, unsigned int); INLINELINKAGE MSGenericVector & remove (const MSIndexVector &); INLINELINKAGE MSGenericVector & remove (const MSBinaryVector &); INLINELINKAGE MSGenericVector & removeAll (); INLINELINKAGE MSGenericVector & select (const MSIndexVector &); INLINELINKAGE MSGenericVector & compress (const MSBinaryVector &); INLINELINKAGE MSGenericVector & selectUnique(); INLINELINKAGE MSGenericVector & reshape (unsigned int); INLINELINKAGE MSGenericVector & exchange (unsigned int, unsigned int); INLINELINKAGE MSGenericVector & reverse (); INLINELINKAGE MSGenericVector & rotate (int); INLINELINKAGE MSGenericVector & take (int); INLINELINKAGE MSGenericVector & take (int, const Type &); INLINELINKAGE MSGenericVector & drop (int); static MSGenericVector reverse (const MSGenericVector &); static MSGenericVector rotate (const MSGenericVector &, int); static MSGenericVector take (const MSGenericVector &, int); static MSGenericVector take (const MSGenericVector &, int, const Type &); static MSGenericVector drop (const MSGenericVector &, int); static MSGenericVector select (const MSGenericVector &, const MSIndexVector &); static MSGenericVector compress(const MSGenericVector &, const MSBinaryVector &); INLINELINKAGE static MSGenericVector selectUnique (const MSGenericVector &); INLINELINKAGE MSGenericVector& selectiveAssign(const MSIndexVector&, const Type&); INLINELINKAGE MSGenericVector& selectiveAssign(const MSIndexVector&, const MSGenericVector&); INLINELINKAGE MSGenericVector& selectiveAssign(const MSBinaryVector&, const Type&); INLINELINKAGE MSGenericVector& selectiveAssign(const MSBinaryVector&, const MSGenericVector&); INLINELINKAGE MSIndexVector gradeUp() const; INLINELINKAGE MSIndexVector gradeDown() const; INLINELINKAGE void permute (const MSIndexVector &); INLINELINKAGE MSGenericVector & sortUp(); INLINELINKAGE MSGenericVector & sortDown(); INLINELINKAGE const Type & firstElement() const; INLINELINKAGE const Type & lastElement() const; INLINELINKAGE const Type & operator[] (unsigned int) const; INLINELINKAGE const Type & operator() (unsigned int) const; INLINELINKAGE const Type & elementAt (unsigned int) const; INLINELINKAGE Type & firstElement(); INLINELINKAGE Type & lastElement(); INLINELINKAGE Type & operator[] (unsigned int); Type & elementAt (unsigned int); INLINELINKAGE MSGenericVector operator[](const MSIndexVector&) const; INLINELINKAGE MSGenericVector operator[](const MSBinaryVector&) const; friend ostream& operator<< MS_FRIEND_TEMPLATEID (ostream&, const MSGenericVector&); INLINELINKAGE long compare (const MSGenericVector &) const; INLINELINKAGE MSBinaryVector binaryCompare (const MSGenericVector &, MSComparison) const; INLINELINKAGE MSBinaryVector binaryCompare (const Type &, MSComparison) const; INLINELINKAGE2 friend MSBoolean operator< MS_FRIEND_TEMPLATEID (const MSGenericVector &, const MSGenericVector &); INLINELINKAGE2 friend MSBoolean operator> MS_FRIEND_TEMPLATEID (const MSGenericVector &, const MSGenericVector &); INLINELINKAGE2 friend MSBoolean operator<= MS_FRIEND_TEMPLATEID (const MSGenericVector &, const MSGenericVector &); INLINELINKAGE2 friend MSBoolean operator>= MS_FRIEND_TEMPLATEID (const MSGenericVector &, const MSGenericVector &); INLINELINKAGE2 friend MSBoolean operator< MS_FRIEND_TEMPLATEID (const MSGenericVector &, const Type &); INLINELINKAGE2 friend MSBoolean operator< MS_FRIEND_TEMPLATEID (const Type &, const MSGenericVector &); INLINELINKAGE2 friend MSBoolean operator> MS_FRIEND_TEMPLATEID (const MSGenericVector &, const Type &); INLINELINKAGE2 friend MSBoolean operator> MS_FRIEND_TEMPLATEID (const Type &, const MSGenericVector &); INLINELINKAGE2 friend MSBoolean operator<= MS_FRIEND_TEMPLATEID (const MSGenericVector &, const Type &); INLINELINKAGE2 friend MSBoolean operator<= MS_FRIEND_TEMPLATEID (const Type &, const MSGenericVector &); INLINELINKAGE2 friend MSBoolean operator>= MS_FRIEND_TEMPLATEID (const MSGenericVector &, const Type &); INLINELINKAGE2 friend MSBoolean operator>= MS_FRIEND_TEMPLATEID (const Type &, const MSGenericVector &); INLINELINKAGE2 friend MSBoolean operator== MS_FRIEND_TEMPLATEID (const MSGenericVector &, const Type &); INLINELINKAGE2 friend MSBoolean operator== MS_FRIEND_TEMPLATEID (const Type &, const MSGenericVector &); INLINELINKAGE2 friend MSBoolean operator!= MS_FRIEND_TEMPLATEID (const MSGenericVector &, const Type &); INLINELINKAGE2 friend MSBoolean operator!= MS_FRIEND_TEMPLATEID (const Type &, const MSGenericVector &); INLINELINKAGE2 friend MSBoolean operator== MS_FRIEND_TEMPLATEID (const MSGenericVector &, const MSGenericVector &); INLINELINKAGE2 friend MSBoolean operator!= MS_FRIEND_TEMPLATEID (const MSGenericVector &, const MSGenericVector &); INLINELINKAGE2 friend MSGenericVector& operator<< MS_FRIEND_TEMPLATEID (MSGenericVector&, const MSGenericVector&); INLINELINKAGE2 friend MSGenericVector& operator<< MS_FRIEND_TEMPLATEID (MSGenericVector&, const Type&); INLINELINKAGE MSGenericVector & operator<<= (const Type &); INLINELINKAGE MSGenericVector & operator<<= (const MSGenericVector &); }; template INLINELINKAGE MSBoolean isGenericConstructionNeeded(Type *); template INLINELINKAGE MSBoolean isGenericDestructionNeeded(Type *); #ifndef MS_NO_INLINES #include #endif // MS_NO_INLINES #if defined(MS_COMPILE_INSTANTIATE) #include #endif #endif // MSGenericVectorHEADER aplus-fsf-4.22/src/MSTypes/MSGlobalInlines.H0000644000265000001440000002531210772770457014267 #ifndef MSGlobalInlinesHEADER #define MSGlobalInlinesHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// /*************************************************************************************/ // Global template inlines. Used inside MStk. /*************************************************************************************/ #include #include #if HAVE_IOSTREAM #include #else #include #endif /*************************************************************************************/ // msClassName - default implementation calls class member function: className() /*************************************************************************************/ template inline MSString msClassName(const Type& aType) { return aType.className(); } inline MSString msClassName(double ) { return MSString("double"); } inline MSString msClassName(int ) { return MSString("int"); } inline MSString msClassName(long ) { return MSString("long"); } inline MSString msClassName(short ) { return MSString("short"); } inline MSString msClassName(char ) { return MSString("char"); } inline MSString msClassName(unsigned ) { return MSString("unsigned"); } inline MSString msClassName(unsigned long ) { return MSString("unsigned long"); } inline MSString msClassName(unsigned short ) { return MSString("unsigned short"); } inline MSString msClassName(unsigned char ) { return MSString("unsigned char"); } /*************************************************************************************/ // msAsString - default implementation calls class member function: asString() /*************************************************************************************/ template inline MSString msAsString (const Type & value_) { return value_.asString(); } inline MSString msAsString (const char & value_) { return MSString ((char)value_); } inline MSString msAsString (const double & value_) { return MSString ((double)value_); } inline MSString msAsString (const float & value_) { return MSString ((double)value_); } inline MSString msAsString (const int & value_) { return MSString ((int)value_); } inline MSString msAsString (const long & value_) { return MSString ((long)value_); } inline MSString msAsString (const short & value_) { return MSString ((short)value_); } inline MSString msAsString (const unsigned char & value_) { return MSString ((unsigned char)value_); } inline MSString msAsString (const unsigned long & value_) { return MSString ((unsigned long)value_); } inline MSString msAsString (const unsigned short & value_) { return MSString ((unsigned short)value_); } inline MSString msAsString (const unsigned int & value_) { return MSString ((unsigned int)value_); } /*************************************************************************************/ // msAsMSF- default implementation class class member function /*************************************************************************************/ template inline MSString msAsMSF (const Type & value_) { return value_.asMSF(); } inline MSString msAsMSF (const char & value_) { return MSString ((char)value_); } inline MSString msAsMSF (const double & value_) { return MSString ((double)value_); } inline MSString msAsMSF (const float & value_) { return MSString ((double)value_); } inline MSString msAsMSF (const int & value_) { return MSString ((int)value_); } inline MSString msAsMSF (const long & value_) { return MSString ((long)value_); } inline MSString msAsMSF (const short & value_) { return MSString ((short)value_); } inline MSString msAsMSF (const unsigned char & value_) { return MSString ((unsigned char)value_); } inline MSString msAsMSF (const unsigned long & value_) { return MSString ((unsigned long)value_); } inline MSString msAsMSF (const unsigned short & value_) { return MSString ((unsigned short)value_); } inline MSString msAsMSF (const unsigned int & value_) { return MSString ((unsigned int)value_); } /*************************************************************************************/ // msSetFromString- default implementation class class member function /*************************************************************************************/ template inline MSError::ErrorStatus msSetFromString (Type & value_, const char * pString_) { value_.set (pString_); return MSError::MSSuccess; } // builtin types inline MSError::ErrorStatus msSetFromString (char & value_, const char *pString_) { value_ = pString_[0]; return MSError::MSSuccess; } inline MSError::ErrorStatus msSetFromString (double & value_, const char *pString_) { char *cp = 0; value_ = strtod (pString_, &cp); // Base 10 return (cp == pString_) ? MSError::MSFailure : MSError::MSSuccess; } inline MSError::ErrorStatus msSetFromString (int & value_, const char *pString_) { char *cp = 0; value_ = (int) strtol (pString_, &cp, 10); // Base 10 return (cp == pString_) ? MSError::MSFailure : MSError::MSSuccess; } inline MSError::ErrorStatus msSetFromString (long & value_, const char *pString_) { char *cp = 0; value_ = strtol (pString_, &cp, 10); // Base 10 return (cp == pString_) ? MSError::MSFailure : MSError::MSSuccess; } inline MSError::ErrorStatus msSetFromString (short & value_, const char *pString_) { char *cp = 0; value_ = (short) strtol (pString_, &cp, 10); // Base 10 return (cp == pString_) ? MSError::MSFailure : MSError::MSSuccess; } inline MSError::ErrorStatus msSetFromString (unsigned char & value_, const char *pString_) { value_ = pString_[0]; return MSError::MSSuccess; } inline MSError::ErrorStatus msSetFromString (unsigned long & value_, const char *pString_) { char *cp = 0; value_ = strtoul (pString_, &cp, 10); // Base 10 return (cp == pString_) ? MSError::MSFailure : MSError::MSSuccess; } inline MSError::ErrorStatus msSetFromString (unsigned short & value_, const char *pString_) { char *cp = 0; value_ = (unsigned short) strtoul (pString_, &cp, 10); // Base 10 return (cp == pString_) ? MSError::MSFailure : MSError::MSSuccess; } inline MSError::ErrorStatus msSetFromString (unsigned int & value_, const char *pString_) { char *cp = 0; value_ = (unsigned int) strtoul (pString_, &cp, 10); // Base 10 return (cp == pString_) ? MSError::MSFailure : MSError::MSSuccess; } /*************************************************************************************/ // msSetFromMSF- default implementation call class member function /*************************************************************************************/ template inline MSError::ErrorStatus msSetFromMSF (Type & value_, const char * pString_) { value_.setFromMSF (pString_); return MSError::MSSuccess; } // builtin types inline MSError::ErrorStatus msSetFromMSF (char&, const char*) { return MSError::MSFailure; } inline MSError::ErrorStatus msSetFromMSF (short&, const char*) { return MSError::MSFailure; } inline MSError::ErrorStatus msSetFromMSF (int&, const char*) { return MSError::MSFailure; } inline MSError::ErrorStatus msSetFromMSF (double&, const char*) { return MSError::MSFailure; } inline MSError::ErrorStatus msSetFromMSF (long&, const char*) { return MSError::MSFailure; } inline MSError::ErrorStatus msSetFromMSF (unsigned char&, const char*) { return MSError::MSFailure; } inline MSError::ErrorStatus msSetFromMSF (unsigned short&, const char*) { return MSError::MSFailure; } inline MSError::ErrorStatus msSetFromMSF (unsigned int&, const char*) { return MSError::MSFailure; } inline MSError::ErrorStatus msSetFromMSF (unsigned long&, const char*) { return MSError::MSFailure; } /*************************************************************************************/ // msBadData - returns Type as default, specialized for builtin and MStk types /*************************************************************************************/ template inline Type msBadData(const Type&) { return Type(); } // builtin types inline char msBadData(const char&) { return 0; } inline double msBadData(const double&) { return 0.0;} inline int msBadData(const int&) { return 0; } inline long msBadData(const long&) { return 0; } inline short msBadData(const short&) { return 0; } inline unsigned int msBadData(const unsigned int&) { return 0; } inline unsigned long msBadData(const unsigned long&) { return 0; } inline unsigned short msBadData(const unsigned short&) { return 0; } inline unsigned char msBadData(const unsigned char&) { return 0; } ///////// // Global functions and specializations for vectors. //////////// template inline unsigned int msNumElements(T*, const MSString& str_, const char ) { return str_.numWords(); } inline unsigned int msNumElements(MSString*, const MSString & str_, const char delimiter_) { if (str_.length()==0) return 0; unsigned int num = str_.occurrencesOf (delimiter_); return (str_.last() == delimiter_) ? num : num+1; } template inline void msVectorSetFromString(T& t_, const MSString& str_, unsigned int& startPos_, const char delimiter_) { if (startPos_=str_.length()) { return; } } unsigned int endPos = str_.indexOfAnyOf(MSStringTest(APLUS_ISPACE),startPos_); ::msSetFromString(t_,(const char *)str_.subString(startPos_,endPos-startPos_)); startPos_ = str_.indexOfAnyBut(MSStringTest(APLUS_ISPACE),endPos); } } inline void msVectorSetFromString(MSString& dest_, const MSString& str_, unsigned int& startPos_, const char delimiter_) { unsigned int endPos=0; if (startPos_ inline void msOutputItem(const T& data_, ostream & stream_) { stream_ << data_<< " "; } inline void msOutputItem(const char& data_, ostream & stream_) { stream_ << (char)data_; } template inline MSString msVectorAsString(T*,MSVectorImpl *pImpl_) { return pImpl_->asString(); } inline MSString msVectorAsString(char *, MSVectorImpl *pImpl_) { return pImpl_->asString(0); } #endif aplus-fsf-4.22/src/MSTypes/MSHashTable.H0000644000265000001440000000707210772770457013403 #ifndef MSHashTableHEADER #define MSHashTableHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #if HAVE_IOSTREAM #include // #include using namespace std; #else class ostream; #endif class MSTypesExport MSHashEntry { friend class MSHashTable; private: unsigned long _key; char *_stringKey; void *_value; MSHashEntry *_next; MSHashEntry *_prev; public: MSHashEntry(void); MSHashEntry(unsigned long key_); MSHashEntry(const char *key_); ~MSHashEntry(void); unsigned long key(void) const { return _key; } char *stringKey(void) const { return _stringKey; } void *value(void) const { return _value; } MSHashEntry *next(void) const { return _next; } MSHashEntry *prev(void) const { return _prev; } void value(void *value_) { _value=value_; } void next(MSHashEntry *next_) { _next=next_; } void prev(MSHashEntry *prev_) { _prev=prev_; } }; class MSTypesExport MSHashTable { public: MSHashTable(unsigned size_=0); virtual ~MSHashTable(void); unsigned size(void) const; unsigned long notFound(void) const; void init(unsigned size_); void resize(unsigned size_); void notFound(unsigned long value_); MSBoolean add(unsigned long key_,void *value_); MSBoolean add(const char *key_,void *value_); MSBoolean remove(unsigned long key_); MSBoolean remove(const char *key_); void *lookup(unsigned long key_) const; // return _notFound when it fails void *lookup(const char *key_) const; // return _notFound when it fails virtual void removeAll(void); unsigned averageChainLength(void) const; unsigned maximumChainLength(void) const; unsigned chainLength(unsigned index_) const; ostream& printStringKeys(ostream& aStream) const; ostream& printChainLengths(ostream& aStream) const; ostream& printHashStatistics(ostream& aStream) const; friend MSTypesExport ostream& operator<<(ostream& aStream,const MSHashTable& aHashTable); protected: unsigned _size; MSHashEntry **_bucket; unsigned long _notFound; MSHashEntry **bucket(void) const { return _bucket; } MSHashEntry *bucket(unsigned index_) const { return _bucket[index_]; } unsigned hash(unsigned long key_) const; unsigned hash(const char *key_) const; void bucket(unsigned index_,MSHashEntry *entry_); void addEntry(MSHashEntry *); MSHashEntry *addElement(unsigned long key_,unsigned whichBucket_); MSHashEntry *addElement(const char *key_,unsigned whichBucket_); MSHashEntry *searchBucketFor(MSHashEntry *entry_,unsigned long key_) const; MSHashEntry *searchBucketFor(MSHashEntry *entry_,const char *key_) const; }; inline unsigned MSHashTable::size(void) const { return _size; } inline unsigned long MSHashTable::notFound(void) const { return _notFound; } inline void MSHashTable::notFound(unsigned long value_) { _notFound=value_; } inline void MSHashTable::bucket(unsigned index_,MSHashEntry *entry_) { _bucket[index_]=entry_; } // this represents a special case of a MSHashTable // the keyed data is a char string that needs to be freed when the entry // is deleted. // it will be used for things like binding pixel values to strings or // font ids to strings. class MSTypesExport MSStringHashTable : public MSHashTable { public: MSStringHashTable(unsigned size_=0); ~MSStringHashTable(void); }; #endif aplus-fsf-4.22/src/MSTypes/MSHoliday.H0000644000265000001440000000244110772770457013134 #ifndef MSHolidayHEADER #define MSHolidayHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #if HAVE_IOSTREAM #include // #include using namespace std; #else class ostream; #endif typedef MSString MSResourceCode; class MSTypesExport MSHoliday : public MSDate { public: MSHoliday(void); MSHoliday(const MSHoliday&); MSHoliday(const MSDate&,const MSResourceCode&,const MSString& description_=""); const MSResourceCode& resourceCode(void) const; const MSString& description(void) const; MSHoliday& operator=(const MSHoliday&); friend MSTypesExport ostream& operator<<(ostream&,const MSHoliday&); private: MSResourceCode _resourceCode; MSString _description; }; // MSHoliday inlines inline const MSResourceCode& MSHoliday::resourceCode(void) const { return _resourceCode; } inline const MSString& MSHoliday::description(void) const { return _description; } inline MSDate const& key(MSHoliday const& holiday_) { return (MSDate const&)holiday_; } #endif aplus-fsf-4.22/src/MSTypes/MSIHashKeySet.H0000644000265000001440000003436110772770460013664 #ifndef MSIHashKeySetHEADER #define MSIHashKeySetHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997 -2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include template class MSIHashKeySet; template class MSIHashKeySetNode { public: MSIHashKeySetNode *ivNext; Element ivElement; MSIHashKeySetNode(Element const& element) : ivElement(element),ivNext(0) {}; }; template class MSIHashKeySetCursor { public: ~MSIHashKeySetCursor(void) {} protected: MSIHashKeySet const *ivCollection; unsigned long ivEntryNumber; MSIHashKeySetNode *ivNode; friend class MSIHashKeySet; MSBoolean isFor(MSIHashKeySet const& c) const { return ivCollection==&c?MSTrue:MSFalse; } public: MSIHashKeySetCursor() : ivCollection(0),ivNode(0) {}; MSIHashKeySetCursor(MSIHashKeySet const& c) : ivCollection(&c),ivNode(0) {}; MSBoolean setToFirst() {return ivCollection->setToFirst(*this);} MSBoolean setToNext() {return ivCollection->setToNext(*this);} MSBoolean isValid() const {return ivNode!=0?MSTrue:MSFalse;} void invalidate() {ivNode=0;} Element const& element() const { return ivCollection->elementAt(*this); } MSBoolean operator==(MSIHashKeySetCursor const& cursor) const { return ivCollection==cursor.ivCollection&&ivNode==cursor.ivNode&&ivEntryNumber==cursor.ivEntryNumber?MSTrue:MSFalse; } MSBoolean operator!=(MSIHashKeySetCursor const& cursor) const { return operator==(cursor)==MSTrue?MSFalse:MSTrue; } }; template class MSIHashKeySet { public: typedef MSIHashKeySetCursor Cursor; typedef MSIHashKeySetNode Node; MSIHashKeySet(unsigned long numberOfElements=16); MSIHashKeySet(MSIHashKeySet const&); ~MSIHashKeySet(); MSIHashKeySet& operator=(MSIHashKeySet const&); MSBoolean add(Element const&); MSBoolean add(Element const&,Cursor&); void addAllFrom(MSIHashKeySet const&); Element const& elementAt(Cursor const&) const; Element& elementAt(Cursor const&); Element const& anyElement() const; void removeAt(Cursor const&); unsigned long removeAll(MSBoolean(*property)(Element const&,void*),void* additionalArgument=0); void replaceAt(Cursor const&,Element const&); void removeAll(); unsigned long maxNumberOfElements() const; unsigned long numberOfElements() const { return ivNoElements; } MSBoolean isEmpty() const { return ivNoElements==0?MSTrue:MSFalse; } MSBoolean setToFirst(Cursor&) const; MSBoolean setToNext(Cursor&) const; Key const& key(Element const&) const; MSBoolean containsElementWithKey(Key const&) const; MSBoolean containsAllKeysFrom(MSIHashKeySet const&) const; MSBoolean locateElementWithKey(Key const&,Cursor&)const; MSBoolean replaceElementWithKey(Element const&); MSBoolean replaceElementWithKey(Element const&,Cursor&); MSBoolean locateOrAddElementWithKey(Element const&); MSBoolean locateOrAddElementWithKey(Element const&,Cursor&); MSBoolean addOrReplaceElementWithKey(Element const&); MSBoolean addOrReplaceElementWithKey(Element const&,Cursor&); MSBoolean removeElementWithKey(Key const&); Element const& elementWithKey(Key const&) const; Element& elementWithKey(Key const&); private: #if defined(MS_NESTED_CLASSES_ACCESS_BUG) public: #endif friend class Operations; class Operations { friend class MSIHashKeySet; public: ~Operations(void) {} private: Node* newNode(Element const& element) const { return new Node(element); } Node* copyNode(Node const* node) const { return new Node(node->ivElement); } void deleteNode(Node * node) const {delete node;} void* newBlock(size_t size) const { return ::operator new (size); } void removeBlock(void* p,size_t) const { ::operator delete (p);; } unsigned long getHashvalue(Key const& key,unsigned long noEntries) const { return ::hash(key,noEntries); } Element& elementAt(Node* node) { return node->ivElement; } const Element& elementAt(Node* node) const { return node->ivElement; } Key const& key(Element const& element) const { return key(elementForOps(element));} #if !defined(MS_CONST_ELEMENT_FOR_OPS_BUG) Key const& key(Element& element) { return key(elementForOps(element));} #endif Key const& keyAt(Node const* node) const { return key(node->ivElement);} MSBoolean isKeyEqualToElement(Node const* node,Element const& element) const { return isKeysEqual(keyAt(node),key(element)); } MSBoolean isKeyEqualToKey(const Node *node,Key const& key) const { return isKeysEqual(keyAt(node),key); } MSBoolean isKeysEqual(const Key& key1, const Key& key2) const { return key1==key2?MSTrue:MSFalse; } void copyFrom(Node *node,Element const& element) const { node->ivElement=element; } MSBoolean constantFunctionIteration(void *iterationFunction,void* env,Node const* node) { return(*(MSBoolean(*)(Element const&,void*)) iterationFunction)(node->ivElement,env); } #if !defined(MS_GCC_FUNCTION_CAST_BUG) MSBoolean functionIteration(void *iterationFunction,void* env,Node* node) { return(*(MSBoolean(*)(Element&,void*)) iterationFunction)(node->ivElement,env); } #endif }; #if defined(MS_NESTED_CLASSES_ACCESS_BUG) private: #endif Operations ivOps; unsigned long ivNoEntries; unsigned long ivNoElements; Node **ivTable; unsigned long *ivCollList; private: void checkNotEmpty() const; void checkCursorIsForThis(Cursor const&) const; void checkCursor(Cursor const&) const; void createHashtable(unsigned long); void copyHashtable(MSIHashKeySet const&); void resize(Node*,unsigned long&); MSBoolean add(Element const& element,unsigned long,Cursor&); MSBoolean add(Element const& element,unsigned long); unsigned long removeAll(void* predicate,void* environment); MSBoolean containsElementWithKey(Key const& key,unsigned long) const; unsigned long numberOfElementsWithKey(Key const& key,unsigned long) const; MSBoolean locateElementWithKey(Key const& key,unsigned long,Cursor&) const; MSBoolean locateElementWithKey(Key const& key,unsigned long,Node *&) const; MSBoolean locateElementWithKeyOfElement(Element const& element,unsigned long,Cursor&) const; MSBoolean replaceElementWithKey(Element const& element,unsigned long,Cursor&); MSBoolean replaceElementWithKey(Element const& element,unsigned long); MSBoolean locateOrAddElementWithKey(Element const& element,unsigned long,Cursor&); MSBoolean locateOrAddElementWithKey(Element const& element,unsigned long); MSBoolean addOrReplaceElementWithKey(Element const& element,unsigned long,Cursor&); MSBoolean addOrReplaceElementWithKey(Element const& element,unsigned long); MSBoolean removeElementWithKey(Key const& key,unsigned long); const Element& elementWithKey(Key const& key,unsigned long) const; Element& elementWithKey(Key const& key,unsigned long); MSBoolean locateNextElementWithKey(Key const& key,unsigned long,Cursor&) const; unsigned long removeAllElementsWithKey(Key const& key,unsigned long); unsigned long numberOfDifferentKeys() const; MSBoolean setToNextWithDifferentKey(Cursor&) const; unsigned long noEntries() const { return ivNoEntries; } // this private constructor was created to avoid memory leak or extra deallocation // in resize function inline MSIHashKeySet(unsigned,unsigned) {} }; #ifndef MSICollectionCheck #if defined (MS_NO_EXCEPTIONS) #define MSICollectionCheck(test,msgID) #else #define MSICollectionCheck(test,msgID) if (!test) throw(MSCollectionError(msgID)); #endif #endif // inline definitions template inline void MSIHashKeySet:: checkNotEmpty() const { MSICollectionCheck(!isEmpty(),"collection is empty") } template inline void MSIHashKeySet:: checkCursorIsForThis(MSIHashKeySet::Cursor const& c) const { MSICollectionCheck(((Cursor const&)c).isFor(*this),"cursor not for this collection") } template inline void MSIHashKeySet:: checkCursor(MSIHashKeySet::Cursor const& cursor) const { MSICollectionCheck(cursor.isFor(*this),"cursor not for this collection") MSICollectionCheck(cursor.isValid(),"invalid cursor") } template inline MSBoolean MSIHashKeySet:: add(Element const& e,MSIHashKeySet::Cursor& c) { return locateOrAddElementWithKey(e,c)==MSTrue?MSFalse:MSTrue; } template inline MSBoolean MSIHashKeySet:: add(Element const& e) { return locateOrAddElementWithKey(e)==MSTrue?MSFalse:MSTrue; } template inline Element const& MSIHashKeySet:: elementAt(MSIHashKeySet::Cursor const& c) const { checkCursor(c); return ivOps.elementAt(c.ivNode); } template inline Element& MSIHashKeySet:: elementAt(MSIHashKeySet::Cursor const& c) { checkCursor(c); return ivOps.elementAt(c.ivNode); } template inline unsigned long MSIHashKeySet:: removeAll(MSBoolean(*predicate)(Element const&,void*),void* env) { return removeAll(predicate,env); } template inline void MSIHashKeySet:: replaceAt(MSIHashKeySet::Cursor const& c,Element const& e) { checkCursor(c); MSICollectionCheck(ivOps.isKeysEqual(ivOps.key(((Cursor const&)c).ivNode->ivElement),ivOps.key(e)), "invalid replacement") ivOps.copyFrom(c.ivNode,e); } template inline unsigned long MSIHashKeySet:: maxNumberOfElements() const { return 0; } template inline Key const& MSIHashKeySet:: key(Element const& element) const { return ivOps.key(element); } template inline MSBoolean MSIHashKeySet:: containsElementWithKey(Key const& k) const { return containsElementWithKey(k,::hash(k,noEntries())); } template inline MSBoolean MSIHashKeySet:: locateElementWithKey(Key const& k,MSIHashKeySet::Cursor& c) const { checkCursorIsForThis(c); return locateElementWithKey(k,::hash(k,noEntries()),((Cursor&)c)); } template inline MSBoolean MSIHashKeySet:: replaceElementWithKey(Element const& e,MSIHashKeySet::Cursor& c) { checkCursorIsForThis(c); return replaceElementWithKey(e,::hash((ivOps.key(e)),noEntries()),((Cursor&)c)); } template inline MSBoolean MSIHashKeySet:: replaceElementWithKey(Element const& e) { return replaceElementWithKey(e,::hash((ivOps.key(e)),noEntries())); } template inline MSBoolean MSIHashKeySet:: locateOrAddElementWithKey(Element const& e,MSIHashKeySet::Cursor& c) { checkCursorIsForThis(c); return locateOrAddElementWithKey(e,::hash((ivOps.key(e)),noEntries()),((Cursor&)c)); } template inline MSBoolean MSIHashKeySet:: locateOrAddElementWithKey(Element const& e) { return locateOrAddElementWithKey(e,::hash((ivOps.key(e)),noEntries())); } template inline MSBoolean MSIHashKeySet:: addOrReplaceElementWithKey(Element const& e,MSIHashKeySet::Cursor& c) { checkCursorIsForThis(c); return addOrReplaceElementWithKey(e,::hash((ivOps.key(e)),noEntries()),((Cursor&)c)); } template inline MSBoolean MSIHashKeySet:: addOrReplaceElementWithKey(Element const& e) { return addOrReplaceElementWithKey(e,::hash((ivOps.key(e)),noEntries())); } template inline MSBoolean MSIHashKeySet:: removeElementWithKey(Key const& k) { return removeElementWithKey(k,::hash(k,noEntries())); } // the following lookup functions are hand coded for speed, i.e // they eliminate all generalized levels of indirection that would // cause function call overhead template inline Element const& MSIHashKeySet:: elementWithKey(Key const& k) const { Node *pNode=ivTable[::hash(k,ivNoEntries)]; while (!(pNode==0||ivOps.isKeysEqual(ivOps.key(pNode->ivElement),k))) pNode=pNode->ivNext; MSICollectionCheck(pNode,"key not contained"); return pNode->ivElement; } template inline Element& MSIHashKeySet:: elementWithKey(Key const& k) { Node *pNode=ivTable[::hash(k,ivNoEntries)]; while (!(pNode==0||ivOps.isKeysEqual(ivOps.key(pNode->ivElement),k))) pNode=pNode->ivNext; MSICollectionCheck(pNode,"key not contained"); return pNode->ivElement; } template inline MSBoolean MSIHashKeySet:: locateElementWithKey(Key const& k,unsigned long hashvalue,MSIHashKeySet::Cursor& cursor) const { cursor.ivEntryNumber=hashvalue; cursor.ivNode=ivTable[cursor.ivEntryNumber]; while (!(cursor.ivNode==0||ivOps.isKeysEqual(ivOps.key(cursor.ivNode->ivElement),k))) { cursor.ivNode=cursor.ivNode->ivNext; } return cursor.ivNode!=0?MSTrue:MSFalse; } template inline MSBoolean MSIHashKeySet:: locateElementWithKeyOfElement(Element const& element,unsigned long hashvalue,MSIHashKeySet::Cursor& cursor) const { cursor.ivEntryNumber=hashvalue; cursor.ivNode=ivTable[cursor.ivEntryNumber]; while (!(cursor.ivNode==0 || ivOps.isKeysEqual(ivOps.key(cursor.ivNode->ivElement), ivOps.key(element)) )) { cursor.ivNode=cursor.ivNode->ivNext; } return cursor.ivNode!=0?MSTrue:MSFalse; } #endif aplus-fsf-4.22/src/MSTypes/MSISequence.H0000644000265000001440000003361710772770460013427 #ifndef MSISequenceHEADER #define MSISequenceHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997 -2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include template class MSISequence; template class MSISequenceNode { public: MSISequenceNode (Element const& element) : ivElement (element) {}; MSISequenceNode* ivNext; MSISequenceNode* ivPrevious; Element ivElement; }; template class MSISequenceCursor { public: friend class MSISequence ; MSISequenceCursor (MSISequence < Element> const& c) : ivCollection (&c), ivNode (0) {}; ~MSISequenceCursor(void) {} MSBoolean setToFirst () { return ivCollection->setToFirst (*this);} MSBoolean setToNext () { return ivCollection->setToNext (*this); } MSBoolean isValid () const { return MSBoolean(ivNode!=0);} void invalidate () { ivNode = 0; } Element const& element () const { return ivCollection->elementAt (*this); } MSBoolean setToLast () { return ivCollection->setToLast (*this); } MSBoolean setToPrevious () { return ivCollection->setToPrevious (*this); } MSBoolean operator==(MSISequenceCursor const& cursor) const { return ivCollection==cursor.ivCollection&&ivNode==cursor.ivNode?MSTrue:MSFalse; } MSBoolean operator!=(MSISequenceCursor const& cursor) const { return operator==(cursor)==MSTrue?MSFalse:MSTrue; } protected: MSISequence const *ivCollection; MSISequenceNode *ivNode; MSBoolean isFor (MSISequence < Element> const& c) const { return MSBoolean(ivCollection==&c); } }; template < class Element > class MSISequence { public: typedef MSISequenceCursor Cursor; typedef MSISequenceNode Node; MSISequence (unsigned long numberOfElements = 100); MSISequence (MSISequence < Element> const&); MSISequence < Element>& operator=(MSISequence < Element> const&); ~MSISequence (); MSBoolean add(Element const&); MSBoolean add(Element const&,Cursor&); void addAllFrom(MSISequence < Element> const&); Element const& elementAt(Cursor const&) const; Element& elementAt(Cursor const&); Element const& anyElement() const; void removeAt(Cursor const&); unsigned long removeAll(MSBoolean(*property)(Element const&,void*),void* additionalArgument=0); void replaceAt(Cursor const&,Element const&); void removeAll(); MSBoolean isBounded() const; unsigned long maxNumberOfElements() const; unsigned long numberOfElements() const; MSBoolean isEmpty() const; MSBoolean isFull() const; Cursor* newCursor() const; MSBoolean setToFirst(Cursor&) const; MSBoolean setToNext(Cursor&) const; MSBoolean allElementsDo(MSBoolean (*function)(Element&, void*),void*additionalArgument=0); MSBoolean allElementsDo(MSBoolean (*function)(Element const&, void*), void* additionalArgument=0) const; MSBoolean isConsistent() const; void removeFirst(); void removeLast(); void removeAtPosition(unsigned long); Element const& firstElement() const; Element const& lastElement () const; Element const& elementAtPosition(unsigned long) const; MSBoolean setToLast(Cursor&) const; MSBoolean setToPrevious(Cursor&) const; void setToPosition(unsigned long,Cursor&) const; MSBoolean isFirst(Cursor const&) const; MSBoolean isLast(Cursor const&) const; void addAsFirst (Element const&); void addAsFirst (Element const&,Cursor&); void addAsLast (Element const&); void addAsLast (Element const&,Cursor&); void addAsNext (Element const&,Cursor&); void addAsPrevious(Element const&,Cursor&); void addAtPosition(unsigned long,Element const&); void addAtPosition(unsigned long,Element const&,Cursor&); void sort(long (*comparisonFunction)(Element const&,Element const&)); private: #if defined(MS_NESTED_CLASSES_ACCESS_BUG) public: #endif friend class Operations; class Operations { public: friend class MSISequence; virtual ~Operations(void) {} private: Node* newNode (Node const* node) const { Node *result = new Node (node->ivElement); return result; } void deleteNode (Node* node) const { delete node; } MSBoolean constantFunctionIteration (void *iterationFunction,void* env,Node const* node) const { return (*(MSBoolean (*) (Element const&, void*)) iterationFunction) (node->ivElement, env); } MSBoolean functionIteration (void *iterationFunction, void* env, Node* node) { return (*(MSBoolean (*) (Element&, void*)) iterationFunction) (node->ivElement, env); } long functionComparison (void *comparisonFunction,Node const* node1,Node const* node2) { return (*(long (*) (Element const&, Element const&)) comparisonFunction) ( node1->ivElement,node2->ivElement ); } }; #if defined(MS_NESTED_CLASSES_ACCESS_BUG) private: #endif Node *ivFirst; Node *ivLast; unsigned long ivNumberOfElements; Operations ivOps; private: void checkNotEmpty() const; void checkCursorIsForThis (Cursor const&) const; void checkCursor (Cursor const&) const; void checkPositionExists (unsigned long) const; void checkPositionForAdd (unsigned long) const; MSBoolean setToFirst (Node*& node) const; MSBoolean setToNext (Node*& node) const; MSBoolean setToLast (Node*& node) const; MSBoolean setToPrevious (Node*& node) const; void setToPosition (unsigned long position, Node*& node) const; void removeAt (Node* node); Node* addAsFirst (Node* newNode); Node* addAsLast (Node* newNode); Node* addAsNext (Node *node, Node* newNode); Node* addAsPrevious (Node *node, Node* newNode); Node* addAtPosition (unsigned long position, Node* newNode); }; #ifndef MSICollectionCheck #if defined (MS_NO_EXCEPTIONS) #define MSICollectionCheck(test,msgID) #else #define MSICollectionCheck(test,msgID) if (!test) throw(MSCollectionError(msgID)); #endif #endif // inline definitions template < class Element > inline void MSISequence < Element>::checkNotEmpty () const { MSICollectionCheck (!isEmpty(),"collection is empty") } template < class Element > inline void MSISequence ::checkCursorIsForThis(MSISequence::Cursor const& cursor) const { MSICollectionCheck (cursor.isFor(*this),"cursor not for this collection") } template < class Element > inline void MSISequence < Element>::checkCursor (MSISequence::Cursor const& cursor) const { MSICollectionCheck (cursor.isFor(*this),"cursor not for this collection") MSICollectionCheck (cursor.isValid(),"invalid cursor") } template < class Element > inline void MSISequence ::checkPositionExists (unsigned long position) const { MSICollectionCheck ((position<=numberOfElements()+1),"invalid position") } template < class Element > inline void MSISequence ::checkPositionForAdd (unsigned long position) const { MSICollectionCheck ((position<=numberOfElements()+1),"invalid position") } template < class Element > inline MSBoolean MSISequence::add (Element const& element, MSISequence::Cursor& cursor) { addAsLast (element, cursor); return MSTrue; } template < class Element > inline MSBoolean MSISequence ::add (Element const& element) { Cursor cursor (*this); return add (element, cursor); } template inline Element const& MSISequence ::elementAt (MSISequence::Cursor const& cursor) const { checkCursor (cursor); return cursor.ivNode->ivElement; } template inline Element& MSISequence ::elementAt (MSISequence::Cursor const& cursor) { checkCursor (cursor); return cursor.ivNode->ivElement; } template inline Element const& MSISequence ::anyElement () const { return firstElement (); } template < class Element > inline void MSISequence ::removeAt (MSISequence::Cursor const& cursor) { checkCursor (cursor); removeAt(cursor.ivNode); } template < class Element > inline void MSISequence ::replaceAt (MSISequence::Cursor const& cursor, Element const& element) { checkCursor (cursor); cursor.ivNode->ivElement=element; } template inline MSBoolean MSISequence ::isBounded () const { return MSFalse; } template inline unsigned long MSISequence ::maxNumberOfElements () const { return 0; } template inline unsigned long MSISequence ::numberOfElements () const { return ivNumberOfElements; } template inline MSBoolean MSISequence ::isEmpty () const { return MSBoolean(ivNumberOfElements==0); } template inline MSBoolean MSISequence ::isFull () const { return MSFalse; } template inline MSISequence::Cursor* MSISequence ::newCursor () const { Cursor* result = new Cursor (*this); MSICollectionCheck (result!=0,"out of memory") return result; } template inline MSBoolean MSISequence ::setToFirst (MSISequence::Cursor& cursor) const { checkCursorIsForThis (cursor); return setToFirst(cursor.ivNode); } template inline MSBoolean MSISequence ::setToNext (MSISequence::Cursor& cursor) const { checkCursor (cursor); return setToNext(cursor.ivNode); } template inline Element const& MSISequence ::firstElement () const { checkNotEmpty (); Node *node; setToFirst (node); return node->ivElement; } template inline Element const& MSISequence ::lastElement () const { checkNotEmpty (); Node *node; setToLast (node); return node->ivElement; } template inline Element const& MSISequence ::elementAtPosition (unsigned long position) const { checkPositionExists (position); Node *node; setToPosition (position, node); return node->ivElement; } template inline MSBoolean MSISequence ::setToLast (MSISequence::Cursor& cursor) const { checkCursorIsForThis (cursor); return setToLast(cursor.ivNode); } template inline MSBoolean MSISequence ::setToPrevious (MSISequence::Cursor& cursor) const { checkCursor (cursor); return setToPrevious(cursor.ivNode); } template inline void MSISequence ::setToPosition (unsigned long position, MSISequence::Cursor& cursor) const { checkPositionExists (position); checkCursorIsForThis (cursor); setToPosition (position, cursor.ivNode); } template inline MSBoolean MSISequence ::isFirst (MSISequence::Cursor const& cursor) const { checkCursor (cursor); return cursor.ivNode!=0&&cursor.ivNode==ivFirst?MSTrue:MSFalse; } template inline MSBoolean MSISequence ::isLast (MSISequence::Cursor const& cursor) const { checkCursor (cursor); return cursor.ivNode!=0&&cursor.ivNode==ivLast?MSTrue:MSFalse; } template inline void MSISequence ::addAsFirst (Element const& element) { Cursor cursor (*this); addAsFirst (element, cursor); } template inline void MSISequence ::addAsFirst (Element const& element, MSISequence::Cursor& cursor) { checkCursorIsForThis (cursor); Node* newNode = new Node (element); MSICollectionCheck (newNode!=0,"out of memory") cursor.ivNode = addAsFirst (newNode); } template inline void MSISequence ::addAsLast (Element const& element) { Cursor cursor (*this); addAsLast (element, cursor); } template inline void MSISequence ::addAsLast (Element const& element, MSISequence::Cursor& cursor) { checkCursorIsForThis (cursor); Node* newNode = new Node (element); MSICollectionCheck (newNode!=0,"out of memory") cursor.ivNode = addAsLast (newNode); } template inline void MSISequence ::addAsNext (Element const& element, MSISequence::Cursor& cursor) { checkCursor (cursor); Node* newNode = new Node (element); MSICollectionCheck (newNode!=0,"out of memory") cursor.ivNode=addAsNext (cursor.ivNode, newNode); } template inline void MSISequence ::addAsPrevious (Element const& element, MSISequence::Cursor& cursor) { checkCursor (cursor); Node* newNode = new Node (element); MSICollectionCheck (newNode!=0,"out of memory") cursor.ivNode=addAsPrevious (cursor.ivNode, newNode); } template inline void MSISequence ::addAtPosition (unsigned long position, Element const& element) { Cursor cursor (*this); addAtPosition (position, element, cursor); } template inline void MSISequence ::addAtPosition (unsigned long position, Element const& element, MSISequence::Cursor& cursor) { checkPositionForAdd (position); checkCursorIsForThis (cursor); Node* newNode = new Node (element); MSICollectionCheck (newNode!=0,"out of memory") cursor.ivNode=addAtPosition (position,newNode); } #if defined(MS_COMPILE_INSTANTIATE) #include #endif #endif aplus-fsf-4.22/src/MSTypes/MSIndexVector.H0000644000265000001440000004120410772770460013767 #ifndef MSIndexVectorHEADER #define MSIndexVectorHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #if HAVE_NEW #include #else #include #endif #include #include #include #include #include #include #include #include #include #include #ifndef MSDefinesHEADER #include #endif #if HAVE_IOSTREAM #include #include using namespace std; #else class ostream; #endif #if HAVE_SSTREAM #include #include #else class istrstream; class ostrstream; #endif class MSBinaryVector; class MSTypesExport MSIndexVector : public MSVector { public: class Data; #ifdef MS_NESTED_CLASSES_ACCESS_BUG public: #else protected: #endif class MSTypesExport Operations : public MSVectorImplOps, public MSBuiltinVectorImplOps { protected: #ifdef MS_MULTI_THREAD static MSMutex _nullDataMutex; #endif static Data& nullData(void); public: Operations(); virtual ~Operations(); virtual void * allocate (unsigned int, unsigned int =0, MSAllocationFlag =MSRaw) const; virtual void * allocateWithSize (unsigned int, unsigned int =0, MSAllocationFlag =MSRaw) const; virtual void deallocate (void *, unsigned int =0, MSAllocationFlag =MSRaw) const ; virtual void incrementCount (void *) const; virtual unsigned int refCount (const void *) const; virtual void set (void *, unsigned int, const void *, MSAllocationFlag =MSConstructed) const; virtual void set (void *, unsigned int, const void *, unsigned int, MSAllocationFlag =MSConstructed) const; virtual void fill (void *, unsigned int, unsigned int, const void *, MSAllocationFlag =MSConstructed) const; virtual void copy (const void *, void *, unsigned int, unsigned int =0, unsigned int =0, MSAllocationFlag =MSConstructed) const; virtual void copyBackward (void *, unsigned int, unsigned int, unsigned int) const; virtual void destroy (void *, unsigned int, unsigned int) const; virtual int isElementEqual (const void *, unsigned int, const void *) const; virtual int isElementLess (const void *, unsigned int, const void *) const; virtual int isElementLessEqual (const void *, unsigned int, const void *) const; virtual long compareElement (const void *, unsigned int, const void *) const; virtual void *elementAt (const void *, unsigned int) const; virtual unsigned int size (const void *) const; virtual void swapElements (void *, unsigned int, unsigned int) const; virtual unsigned int gradeUp (const void *, unsigned int, unsigned int *) const; virtual unsigned int gradeDown (const void *, unsigned int, unsigned int *) const; virtual void *badData() const; virtual void *defaultFiller() const; virtual MSString asString (const void *, unsigned int) const; virtual MSString asMSF (const void *, unsigned int) const; virtual unsigned int elementLen (const void *, unsigned int) const; virtual MSError::ErrorStatus setFromString (void *, unsigned int, const char *) const; virtual MSError::ErrorStatus setFromMSF (void *, unsigned int, const char *) const; virtual void print (const void *, unsigned int, ostream &) const; virtual unsigned int numElements (const MSString &, const char) const; virtual void setFromMSString (void *, unsigned int, const MSString &, unsigned int&, const char) const; virtual void setToNumber (void *, unsigned int, double) const; virtual double getAsNumber (const void *, unsigned int) const; #if HAVE_SSTREAM virtual void readFromStream (void *, unsigned int, istringstream &) const; virtual void writeToStream (const void *, unsigned int, ostringstream &) const; virtual void whitespace (istringstream &) const; virtual unsigned int stringLen (const char *) const; #else virtual void readFromStream (void *, unsigned int, istrstream &) const; virtual void writeToStream (const void *, unsigned int, ostrstream &) const; virtual void whitespace (istrstream &) const; virtual unsigned int stringLen (const char *) const; #endif }; #ifdef MS_NESTED_CLASSES_ACCESS_BUG public: #endif class MSTypesExport SPick { protected: unsigned int _index; MSIndexVector *_pVector; public: INLINELINKAGE SPick (MSIndexVector &, unsigned int); INLINELINKAGE SPick (const SPick &); SPick & operator= (const SPick &); SPick & operator= (const unsigned int); INLINELINKAGE SPick & operator++(); // prefix increment INLINELINKAGE SPick & operator--(); // prefix decrement unsigned int operator++ (int); // postfix increment unsigned int operator-- (int); // postfix decrement INLINELINKAGE SPick & operator+= (const unsigned int); INLINELINKAGE SPick & operator-= (const unsigned int); INLINELINKAGE SPick & operator*= (const unsigned int); INLINELINKAGE SPick & operator/= (const unsigned int); INLINELINKAGE SPick & operator%= (const unsigned int); INLINELINKAGE SPick & operator<<= (const unsigned int); INLINELINKAGE SPick & operator>>= (const unsigned int); INLINELINKAGE SPick & operator&= (const unsigned int); INLINELINKAGE SPick & operator|= (const unsigned int); INLINELINKAGE SPick & operator^= (const unsigned int); INLINELINKAGE operator unsigned int() const; }; public: class MSTypesExport Data : public MSData { public: Data (unsigned int =0); ~Data(); void *operator new (size_t, unsigned =0); MSString asDebugInfo() const; INLINELINKAGE Data * incrementCount(); INLINELINKAGE void decrementCount(); INLINELINKAGE const unsigned int * elements() const; INLINELINKAGE const unsigned int * data() const; // same as elements(); used for backward compatibility only INLINELINKAGE unsigned int * elements(); INLINELINKAGE unsigned int * data(); // same as elements(); used for backward compatibility only INLINELINKAGE const unsigned int & elementAt (unsigned index_) const; INLINELINKAGE unsigned int & elementAt (unsigned index_); static void fill (unsigned int *, unsigned int, const unsigned int); static void copy (const unsigned int *src_, unsigned int *dst_, unsigned int length_); static void copyBackward (const unsigned int *, unsigned int *, unsigned int); static Data *allocateWithSize (unsigned int); static Data *allocateWithLength (unsigned int); void deallocate(); protected: unsigned int _pElements[1]; }; protected: MSBuiltinVectorImpl *_pImpl; #ifdef MS_MULTI_THREAD static MSMutex _operationsMutex; #endif MSIndexVector (MSBuiltinVectorImpl *); virtual unsigned int getLength() const; INLINELINKAGE Data *vectorData() const; static Operations& ops(void); public: MSIndexVector (); MSIndexVector (const MSIndexVector &); MSIndexVector (unsigned int); MSIndexVector (unsigned int, const unsigned int); MSIndexVector (const char *); MSIndexVector (Data *, unsigned int); MSIndexVector (const unsigned int *, unsigned int); virtual ~MSIndexVector(); MSIndexVector & operator= (const MSIndexVector &); MSIndexVector & operator= (const unsigned int); virtual MSString asString() const; virtual MSString asMSF() const; virtual MSString asDebugInfo() const; virtual MSString className() const; virtual const MSSymbol & type() const; virtual MSModel *clone() const; virtual MSModel *create() const; virtual void assign (const MSModel &); virtual long compare (const MSModel &) const; virtual MSError::ErrorStatus set (const char *); virtual MSError::ErrorStatus setFromMSF (const char *); static const MSSymbol & symbol(); MSError::ErrorStatus set (unsigned int, const unsigned int); INLINELINKAGE unsigned int size() const; unsigned int length() const; unsigned int * data() const; static const MSIndexVector & nullVector(); INLINELINKAGE unsigned int indexOf (const unsigned int, unsigned int =0) const; INLINELINKAGE unsigned int lastIndexOf (const unsigned int, unsigned int =UINT_MAX-1) const; INLINELINKAGE unsigned int occurrencesOf (const unsigned int, unsigned int =0) const; INLINELINKAGE MSIndexVector indicesOf (const MSIndexVector &) const; INLINELINKAGE MSBinaryVector memberOf (const MSIndexVector &) const; INLINELINKAGE MSBinaryVector uniqueElements() const; INLINELINKAGE MSIndexVector & replaceAt (unsigned int, const unsigned int); MSIndexVector & append (const unsigned int); MSIndexVector & append (const MSIndexVector &); MSIndexVector & insertAt (unsigned int, const unsigned int); MSIndexVector & insertAt (unsigned int, const MSIndexVector &); MSIndexVector & removeAt (unsigned int); MSIndexVector & removeAt (unsigned int, unsigned int); MSIndexVector & remove (const MSIndexVector &); MSIndexVector & remove (const MSBinaryVector &); MSIndexVector & removeAll (); MSIndexVector & select (const MSIndexVector &); MSIndexVector & compress (const MSBinaryVector &); INLINELINKAGE MSIndexVector & selectUnique(); MSIndexVector & reshape (unsigned int); MSIndexVector & exchange (unsigned int, unsigned int); MSIndexVector & reverse (); MSIndexVector & rotate (int); MSIndexVector & take (int, const unsigned int =0); MSIndexVector & drop (int); static MSIndexVector reverse (const MSIndexVector &); static MSIndexVector rotate (const MSIndexVector &, int); static MSIndexVector take (const MSIndexVector &, int, const unsigned int =0); static MSIndexVector drop (const MSIndexVector &, int); static MSIndexVector select (const MSIndexVector &, const MSIndexVector &); static MSIndexVector compress(const MSIndexVector &, const MSBinaryVector &); INLINELINKAGE static MSIndexVector selectUnique (const MSIndexVector &); MSIndexVector & selectiveAssign (const MSIndexVector &, const unsigned int); MSIndexVector & selectiveAssign (const MSIndexVector &, const MSIndexVector &); MSIndexVector & selectiveAssign (const MSBinaryVector &, const unsigned int); MSIndexVector & selectiveAssign (const MSBinaryVector &, const MSIndexVector &); virtual MSIndexVector gradeUp() const; virtual MSIndexVector gradeDown() const; virtual void permute (const MSIndexVector &); INLINELINKAGE MSIndexVector & sortUp(); INLINELINKAGE MSIndexVector & sortDown(); INLINELINKAGE unsigned int firstElement() const; INLINELINKAGE unsigned int lastElement () const; INLINELINKAGE unsigned int operator[] (unsigned int) const; INLINELINKAGE unsigned int operator() (unsigned int) const; INLINELINKAGE const unsigned int & elementAt (unsigned int) const; INLINELINKAGE SPick operator[] (unsigned int); INLINELINKAGE MSIndexVector operator[] (const MSIndexVector &) const; INLINELINKAGE MSIndexVector operator[] (const MSBinaryVector &) const; friend MSTypesExport ostream & operator<< (ostream &, const MSIndexVector &); INLINELINKAGE long compare (const MSIndexVector &) const; INLINELINKAGE MSBinaryVector binaryCompare (const MSIndexVector &, MSComparison) const; INLINELINKAGE MSBinaryVector binaryCompare (const unsigned int, MSComparison) const; INLINELINKAGE MSBoolean operator== (const MSIndexVector &) const; INLINELINKAGE MSBoolean operator!= (const MSIndexVector &) const; INLINELINKAGE friend MSTypesExport MSBoolean operator< (const MSIndexVector &, const MSIndexVector &); INLINELINKAGE friend MSTypesExport MSBoolean operator> (const MSIndexVector &, const MSIndexVector &); INLINELINKAGE friend MSTypesExport MSBoolean operator<= (const MSIndexVector &, const MSIndexVector &); INLINELINKAGE friend MSTypesExport MSBoolean operator>= (const MSIndexVector &, const MSIndexVector &); INLINELINKAGE friend MSTypesExport MSBoolean operator< (const MSIndexVector &, const unsigned int); INLINELINKAGE friend MSTypesExport MSBoolean operator< (const unsigned int, const MSIndexVector &); INLINELINKAGE friend MSTypesExport MSBoolean operator> (const MSIndexVector &, const unsigned int); INLINELINKAGE friend MSTypesExport MSBoolean operator> (const unsigned int, const MSIndexVector &); INLINELINKAGE friend MSTypesExport MSBoolean operator<= (const MSIndexVector &, const unsigned int); INLINELINKAGE friend MSTypesExport MSBoolean operator<= (const unsigned int, const MSIndexVector &); INLINELINKAGE friend MSTypesExport MSBoolean operator>= (const MSIndexVector &, const unsigned int); INLINELINKAGE friend MSTypesExport MSBoolean operator>= (const unsigned int, const MSIndexVector &); INLINELINKAGE friend MSTypesExport MSBoolean operator== (const MSIndexVector &, const unsigned int); INLINELINKAGE friend MSTypesExport MSBoolean operator== (const unsigned int, const MSIndexVector &); INLINELINKAGE friend MSTypesExport MSBoolean operator!= (const MSIndexVector &, const unsigned int); INLINELINKAGE friend MSTypesExport MSBoolean operator!= (const unsigned int, const MSIndexVector &); INLINELINKAGE MSIndexVector & operator<<= (const unsigned int); INLINELINKAGE MSIndexVector & operator<<= (const MSIndexVector &); INLINELINKAGE MSIndexVector & operator<< (const unsigned int); INLINELINKAGE MSIndexVector & operator<< (const MSIndexVector &); MSIndexVector & random (unsigned int =0); MSIndexVector & series (unsigned int, unsigned int =0); INLINELINKAGE MSIndexVector & series (); unsigned int min() const; unsigned int max() const; double sum() const; INLINELINKAGE double avg() const; INLINELINKAGE double mean() const; INLINELINKAGE double median() const; INLINELINKAGE double variance() const; INLINELINKAGE double stdDeviation() const; INLINELINKAGE friend MSTypesExport MSIndexVector movingAverage (const MSIndexVector &, unsigned int); // Arithmetic Operations friend MSTypesExport MSIndexVector operator- (const MSIndexVector &); MSIndexVector & operator++ (); // prefix increment MSIndexVector & operator-- (); // prefix decrement INLINELINKAGE MSIndexVector operator++ (int); // postfix increment INLINELINKAGE MSIndexVector operator-- (int); // postfix decrement friend MSTypesExport MSIndexVector operator+ (const MSIndexVector &, const MSIndexVector &); friend MSTypesExport MSIndexVector operator- (const MSIndexVector &, const MSIndexVector &); friend MSTypesExport MSIndexVector operator* (const MSIndexVector &, const MSIndexVector &); friend MSTypesExport MSIndexVector operator/ (const MSIndexVector &, const MSIndexVector &); friend MSTypesExport MSIndexVector operator+ (const MSIndexVector &, const unsigned int); friend MSTypesExport MSIndexVector operator- (const MSIndexVector &, const unsigned int); friend MSTypesExport MSIndexVector operator* (const MSIndexVector &, const unsigned int); friend MSTypesExport MSIndexVector operator/ (const MSIndexVector &, const unsigned int); INLINELINKAGE friend MSTypesExport MSIndexVector operator+ (const unsigned int, const MSIndexVector &); INLINELINKAGE friend MSTypesExport MSIndexVector operator* (const unsigned int, const MSIndexVector &); friend MSTypesExport MSIndexVector operator- (const unsigned int, const MSIndexVector &); friend MSTypesExport MSIndexVector operator/ (const unsigned int, const MSIndexVector &); MSIndexVector & operator+= (const MSIndexVector &); MSIndexVector & operator-= (const MSIndexVector &); MSIndexVector & operator*= (const MSIndexVector &); MSIndexVector & operator/= (const MSIndexVector &); MSIndexVector & operator+= (const unsigned int); MSIndexVector & operator-= (const unsigned int); MSIndexVector & operator*= (const unsigned int); MSIndexVector & operator/= (const unsigned int); }; #ifndef MS_NO_INLINES #include #endif // MS_NO_INLINES // We provide provide explicit "do_not_instantiate" pragmas here to avoid instantiation complications in // MStk applications. // #if !defined(__MSTYPESLIBRARY_BUILD__) && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma do_not_instantiate unsigned int msMergeSortUp(unsigned int,unsigned int *,unsigned int *,unsigned int,unsigned int) #pragma do_not_instantiate unsigned int msMergeSortDown(unsigned int,unsigned int *,unsigned int *,unsigned int,unsigned int) #endif // !__MSTYPESLIBRARY_BUILD__ && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #endif // MSIndexVectorHEADER aplus-fsf-4.22/src/MSTypes/MSIndexedAspectEvent.H0000644000265000001440000000350410772770460015260 #ifndef MSIndexedAspectEventHEADER #define MSIndexedAspectEventHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include class MSTypesExport MSIndexedAspectEvent : public MSEvent { public: MSIndexedAspectEvent(void); MSIndexedAspectEvent(const MSIndexedAspectEvent&); MSIndexedAspectEvent(const MSIndexVector&, const MSSymbol& tag=MSSymbol("*")); virtual ~MSIndexedAspectEvent(void); MSIndexedAspectEvent& operator=(const MSIndexedAspectEvent& aEvent_); static const MSSymbol& symbol(void); const MSIndexVector& index(void) const; const MSSymbol& tag(void) const; protected: MSSymbol _tag; MSIndexVector _index; }; inline const MSSymbol& MSIndexedAspectEvent::tag(void) const { return _tag; } inline const MSIndexVector& MSIndexedAspectEvent::index(void) const { return _index; } inline MSIndexedAspectEvent::MSIndexedAspectEvent(void) : MSEvent(MSIndexedAspectEvent::symbol()), _tag("*") {} inline MSIndexedAspectEvent::MSIndexedAspectEvent(const MSIndexedAspectEvent& aEvent_) : MSEvent(aEvent_.symbol()), _index(aEvent_.index()), _tag(aEvent_.tag()) {} inline MSIndexedAspectEvent::MSIndexedAspectEvent(const MSIndexVector& aIntVector_, const MSSymbol & tag_) : MSEvent(MSIndexedAspectEvent::symbol()),_index(aIntVector_),_tag(tag_) {} inline MSIndexedAspectEvent& MSIndexedAspectEvent::operator=(const MSIndexedAspectEvent& aEvent_) { if (this!=&aEvent_) { _index=aEvent_.index(),_tag=aEvent_.tag(),sender(aEvent_.sender()); } return *this; } #endif aplus-fsf-4.22/src/MSTypes/MSIndexedEvent.H0000644000265000001440000000275610772770460014130 #ifndef MSIndexedEventHEADER #define MSIndexedEventHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSTypesExport MSIndexedEvent : public MSEvent { public: MSIndexedEvent(void); MSIndexedEvent(const MSIndexedEvent&); MSIndexedEvent(const MSIndexVector&); MSIndexedEvent(unsigned int); ~MSIndexedEvent(void); static const MSSymbol& symbol(void); const MSIndexVector& index(void) const; MSIndexedEvent& operator=(const MSIndexedEvent& aEvent_); private: MSIndexVector _index; }; inline const MSIndexVector& MSIndexedEvent::index(void) const { return _index; } inline MSIndexedEvent::MSIndexedEvent(void) : MSEvent(MSIndexedEvent::symbol()) {} inline MSIndexedEvent::MSIndexedEvent(const MSIndexedEvent& aEvent_) : _index(aEvent_.index()),MSEvent(aEvent_.symbol()) {} inline MSIndexedEvent::MSIndexedEvent(const MSIndexVector& aIntVector_) : _index(aIntVector_),MSEvent(MSIndexedEvent::symbol()) {} inline MSIndexedEvent::MSIndexedEvent(unsigned int index_) : _index(1,index_),MSEvent(MSIndexedEvent::symbol()) {} inline MSIndexedEvent& MSIndexedEvent::operator=(const MSIndexedEvent& aEvent_) { _index=aEvent_.index(),sender(aEvent_.sender()); return *this; } #endif aplus-fsf-4.22/src/MSTypes/MSIndexedFunctions.H0000644000265000001440000000545510772770460015016 #ifndef MSIndexedFunctionHEADER #define MSIndexedFunctionHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSTypesExport MSIndexedFunctions { public: enum Mode {Total=2,Minimum=4,Maximum=8,Average=16}; MSIndexedFunctions(void); ~MSIndexedFunctions(void); static MSIndexedFunctions& indexedFuncs(void) {return _indexedFuncs; } const MSFloatVector& defaultWeights(void) {return _defaultWeights;} MSIndexVector& defaultIndex(void) {return _defaultIndex;} void defaultWeights(MSFloatVector& x_) {_defaultWeights=x_;} void defaultIndex(MSIndexVector& x_) {_defaultIndex=x_;} static double computeIndexedFunction(const MSFloatVector& model_,int mode_=MSIndexedFunctions::Total); static double computeIndexedFunction(const MSFloatVector& model_, const MSFloatVector& weights_=indexedFuncs().defaultWeights(), int mode_=MSIndexedFunctions::Total); static double computeIndexedFunction(const MSFloatVector& model_, const MSFloatVector& weights_=indexedFuncs().defaultWeights(), MSIndexVector& index_=indexedFuncs().defaultIndex(), int mode_=MSIndexedFunctions::Total); static double computeTotal(const MSFloatVector&,MSIndexVector&); static double computeMinimum(const MSFloatVector&,MSIndexVector&); static double computeMaximum(const MSFloatVector&,MSIndexVector&); static double computeAverage(const MSFloatVector&,const MSFloatVector&,MSIndexVector&); static double computeIndexedFunction(const MSIntVector& model_,int mode_=MSIndexedFunctions::Total); static double computeIndexedFunction(const MSIntVector& model_, const MSFloatVector& weights_=indexedFuncs().defaultWeights(), int mode_=MSIndexedFunctions::Total); static double computeIndexedFunction(const MSIntVector& model_, const MSFloatVector& weights_=indexedFuncs().defaultWeights(), MSIndexVector& index_=indexedFuncs().defaultIndex(), int mode_=MSIndexedFunctions::Total); static double computeTotal(const MSIntVector&,MSIndexVector&); static double computeMinimum(const MSIntVector&,MSIndexVector&); static double computeMaximum(const MSIntVector&,MSIndexVector&); static double computeAverage(const MSIntVector&,const MSFloatVector&,MSIndexVector&); protected: static MSIndexVector computeIndex(const MSVector&,MSIndexVector&); private: static MSIndexedFunctions _indexedFuncs; MSIndexVector _defaultIndex; MSFloatVector _defaultWeights; }; #endif aplus-fsf-4.22/src/MSTypes/MSIndexedModel.H0000644000265000001440000000233210772770460014075 #ifndef MSIndexedModelHEADER #define MSIndexedModelHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSIndexVector; // indexing vector for updates class MSTypesExport MSIndexedModel : public MSModel { public: MSIndexedModel(); virtual ~MSIndexedModel(); protected: static const MSIndexVector& nullIndexVector(void); MSBoolean doChanged(void); void changed(const MSIndexVector& indices_=MSIndexedModel::nullIndexVector()); void changed(unsigned int index_); void sendIndexedEvent(const MSIndexVector& indices_=MSIndexedModel::nullIndexVector()); void sendIndexedEvent(unsigned int index_); }; inline MSBoolean MSIndexedModel::doChanged(void) { return MSBoolean(receiverList()!=0); } inline void MSIndexedModel::changed(const MSIndexVector& aIndexVector_) { if (receiverList()!=0) sendIndexedEvent(aIndexVector_); } inline void MSIndexedModel::changed(unsigned int index_) { if (receiverList()!=0) sendIndexedEvent(index_); } #endif aplus-fsf-4.22/src/MSTypes/MSInt.H0000644000265000001440000001177310772770460012277 #ifndef MSIntHEADER #define MSIntHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #ifndef MSDefinesHEADER #include #endif class MSFormat; #if defined (MS_PREDECLARE_NONTEMPLATE_FRIEND_FUNCTIONS) class MSInt; inline long compare (const MSInt &, const MSInt &); #endif class MSTypesExport MSInt : public MSScalarModel { public: enum MSIntFormat { WithoutCommas=50, // 1234 WithCommas=51 // 1,234 }; enum {MaximumLength=10}; MSInt(void); MSInt(int); MSInt(const MSInt&); virtual MSString asString(void) const; virtual MSString asDebugInfo(void) const; virtual MSString asMSF(void) const; virtual MSString className(void) const; virtual const MSSymbol& type(void) const; virtual MSModel *clone(void) const; virtual MSModel *create(void) const; virtual void assign(const MSModel&); virtual long compare(const MSModel&) const; virtual MSError::ErrorStatus set(const char *); virtual MSError::ErrorStatus setFromMSF(const char*); static const MSSymbol& symbol(void); virtual MSError::ErrorStatus set(const MSString *); virtual MSError::ErrorStatus set(const MSString &); virtual MSError::ErrorStatus set(int); const char *format(MSString*) const; const char *format(MSString&) const; const char *format(MSString*,MSIntFormat) const; const char *format(MSString&,MSIntFormat) const; const char *format(MSString*,const MSFormat&) const; const char *format(MSString&,const MSFormat&) const; operator int() const; operator double() const; int operator()() const; // function call operator MSInt& operator=(const MSInt&); MSInt& operator=(int); MSInt& operator=(const char *); inline friend MSTypesExport long compare(const MSInt&,const MSInt&); inline friend MSTypesExport unsigned long hash(const MSInt&,unsigned long size_); MSBoolean operator==(const MSInt&) const; MSBoolean operator!=(const MSInt&) const; MSBoolean operator< (const MSInt&) const; MSBoolean operator<=(const MSInt&) const; MSBoolean operator> (const MSInt&) const; MSBoolean operator>=(const MSInt&) const; MSBoolean operator==(int) const; MSBoolean operator!=(int) const; MSBoolean operator< (int) const; MSBoolean operator<=(int) const; MSBoolean operator> (int) const; MSBoolean operator>=(int) const; // Prefix - add/subtract one, then return result MSInt& operator++(); MSInt& operator--(); // Postfix - add/subtract one, then return the initial value MSInt operator++(int); MSInt operator--(int); MSInt& operator+=(const MSInt&); MSInt& operator+=(int); MSInt& operator-=(const MSInt&); MSInt& operator-=(int); MSInt& operator*=(const MSInt&); MSInt& operator*=(int); MSInt& operator/=(const MSInt&); MSInt& operator/=(int); MSInt operator-(); friend MSTypesExport int operator+(const MSInt&,int); friend MSTypesExport int operator+(int,const MSInt&); friend MSTypesExport int operator+(const MSInt& d1,const MSInt&); friend MSTypesExport int operator-(const MSInt&,int); friend MSTypesExport int operator-(int,const MSInt&); friend MSTypesExport int operator-(const MSInt& d1,const MSInt&); friend MSTypesExport int operator*(const MSInt&,int); friend MSTypesExport int operator*(int,const MSInt&); friend MSTypesExport int operator*(const MSInt& d1,const MSInt&); friend MSTypesExport int operator/(const MSInt&,int); friend MSTypesExport int operator/(int,const MSInt&); friend MSTypesExport int operator/(const MSInt&,const MSInt&); friend MSTypesExport int operator%(const MSInt&,int); friend MSTypesExport int operator%(int,const MSInt&); friend MSTypesExport int operator%(const MSInt&,const MSInt&); friend MSTypesExport MSBoolean operator==(int,const MSInt&); friend MSTypesExport MSBoolean operator!=(int,const MSInt&); friend MSTypesExport MSBoolean operator< (int,const MSInt&); friend MSTypesExport MSBoolean operator<=(int,const MSInt&); friend MSTypesExport MSBoolean operator> (int,const MSInt&); friend MSTypesExport MSBoolean operator>=(int,const MSInt&); friend MSTypesExport ostream& operator<<(ostream& aStream_,const MSInt&); friend MSTypesExport istream& operator>>(istream& aStream_,MSInt&); MSBoolean isSet(void) const; void unset(void); protected: const char *formatInt(MSString& aString_,MSIntFormat format_,unsigned long modifier_,int value_) const; private: int _int; MSBoolean _isSet; }; inline long compare(const MSInt& aInt_,const MSInt& bInt_) { return (aInt_._int-bInt_._int); } inline unsigned long hash(const MSInt& aInt_,unsigned long size_) { return aInt_._int%size_; } #ifndef MS_NO_INLINES #ifndef MSIntINLINES #include #endif #endif #endif aplus-fsf-4.22/src/MSTypes/MSIntMatrix.H0000644000265000001440000000624710772770460013464 #ifndef MSIntMatrixHEADER #define MSIntMatrixHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MSDefinesHEADER #include #endif #include #ifndef MSTypeMatrixHEADER #include #endif typedef MSTypeMatrix MSIntMatrix; // We provide provide explicit "do_not_instantiate" pragmas here to avoid instantiation complications in // MStk applications. // #if !defined(__MSTYPESLIBRARY_BUILD__) && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma do_not_instantiate MSAllocator #pragma do_not_instantiate MSTypeData > #pragma do_not_instantiate MSTypeMatrix #pragma do_not_instantiate MSMatrixSTypePick #pragma do_not_instantiate ostream& operator<<(ostream&,const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix operator-(const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix operator+(const MSTypeMatrix&,int) #pragma do_not_instantiate MSTypeMatrix operator+(int,const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix operator+(const MSTypeMatrix&,const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix operator-(const MSTypeMatrix&,int) #pragma do_not_instantiate MSTypeMatrix operator-(const MSTypeMatrix&,const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix operator*(const MSTypeMatrix&,int) #pragma do_not_instantiate MSTypeMatrix operator*(int,const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix operator*(const MSTypeMatrix&,const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix operator/(const MSTypeMatrix&,int) #pragma do_not_instantiate MSTypeMatrix operator/(const MSTypeMatrix&,const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix operator+(const MSTypeMatrix&,const MSTypeVector&) #pragma do_not_instantiate MSTypeMatrix operator-(const MSTypeMatrix&,const MSTypeVector&) #pragma do_not_instantiate MSTypeMatrix operator*(const MSTypeMatrix&,const MSTypeVector&) #pragma do_not_instantiate MSTypeMatrix operator/(const MSTypeMatrix&,const MSTypeVector&) #pragma do_not_instantiate MSTypeMatrix operator+(const MSTypeVector&,const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix operator*(const MSTypeVector&,const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix multiply(const MSTypeMatrix&,const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix stack(const MSTypeMatrix&,const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix adjoin(const MSTypeMatrix&,const MSTypeMatrix&) #endif // !__MSTYPESLIBRARY_BUILD__ && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #if defined(MS_VC_NEED_TEMPLATE_EXPORT) class MSTypesExport MSTypeMatrix; #endif #endif aplus-fsf-4.22/src/MSTypes/MSIntVector.H0000644000265000001440000001004110772770460013445 #ifndef MSIntVectorHEADER #define MSIntVectorHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MSDefinesHEADER #include #endif #if defined(MS_NEED_IMPLEMENTATION_PRAGMA) #pragma implementation("MSIntVector.C") #endif #include #include #include #if defined(MS_TEMPLATE_BEFORE_SPECIALIZATION) #include #endif template class MSTypeVector; typedef MSBaseVector > BaseVectorInt; typedef MSBuiltinVector BuiltinVectorInt; #ifndef MS_MSIntVector_INSTANTIATE #ifdef MS_DECLARE_TEMPLATE_SPECIALIZATION template <> class MSBaseVector >; template <> class MSBaseVectorOps >; template <> class MSBuiltinVector; template <> class MSBuiltinVectorOps; template <> class MSBuiltinSPick; template <> MSBuiltinVector operator- (const MSBuiltinVector&); template <> ostream& operator<<(ostream&,const MSBaseVector >&); #endif #endif #if defined(MS_VC_NEED_TEMPLATE_EXPORT) class MSTypesExport MSBaseVector >; class MSTypesExport MSBaseVectorOps >; class MSTypesExport MSBuiltinVector; class MSTypesExport MSBuiltinVectorOps; class MSTypesExport MSBuiltinSPick; //template <> MSBuiltinVector operator- (const MSBuiltinVector&); //template <> ostream& operator<<(ostream&,const MSBaseVector >&); #endif #if !defined(MS_MSIntVector_INSTANTIATE) && defined(MS_STD_TEMPLATE_SPECIALIZATION) template <> class MSTypeVector : public BuiltinVectorInt #else template <> class MSTypesExport MSTypeVector : public BuiltinVectorInt #endif { public: MSTypeVector (); MSTypeVector (unsigned int); MSTypeVector (unsigned int, const int); MSTypeVector (const MSTypeVector &); MSTypeVector (const BuiltinVectorInt &); MSTypeVector (const BaseVectorInt &); MSTypeVector (const char *); MSTypeVector (MSTypeData > *, unsigned int); MSTypeVector (const int *, unsigned int); virtual ~MSTypeVector(); MSTypeVector & operator= (const MSTypeVector &); MSTypeVector & operator= (const BuiltinVectorInt &); MSTypeVector & operator= (const BaseVectorInt &); MSTypeVector & operator= (const int &); MSTypeVector & operator= (const char *); virtual const MSSymbol & type() const; virtual MSString className() const; virtual MSModel *clone() const; virtual MSModel *create() const; static const MSSymbol & symbol(); }; typedef MSTypeVector MSIntVector; #ifndef MS_NO_INLINES #include #endif // MS_NO_INLINES // We provide provide explicit "do_not_instantiate" pragmas here to avoid instantiation complications in // MStk applications. // #if !defined(__MSTYPESLIBRARY_BUILD__) && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma do_not_instantiate MSAllocator #pragma do_not_instantiate MSTypeData > #pragma do_not_instantiate MSBaseVector > #pragma do_not_instantiate MSBaseVectorOps > #pragma do_not_instantiate MSBuiltinVector #pragma do_not_instantiate MSBuiltinVectorOps #pragma do_not_instantiate MSBuiltinSPick #pragma do_not_instantiate ostream& operator<<(ostream&, const MSBaseVector >&) #pragma do_not_instantiate unsigned int msMergeSortUp(unsigned int, int *, unsigned int *,unsigned int, unsigned int) #pragma do_not_instantiate unsigned int msMergeSortDown(unsigned int, int *, unsigned int *,unsigned int, unsigned int) #endif // !__MSTYPESLIBRARY_BUILD__ && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #endif // MSIntVectorHEADER aplus-fsf-4.22/src/MSTypes/MSLinearInterpolater.H0000644000265000001440000000152510772770460015342 #ifndef MSLinearInterpolaterHEADER #define MSLinearInterpolaterHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #if defined(MS_NEED_IMPLEMENTATION_PRAGMA) #pragma implementation("MSLinearInterpolater.C") #endif template class MSLinearInterpolater : public MSCurveInterpolater { public: MSLinearInterpolater(MSCurve *curve_); MSLinearInterpolater(MSCurve& curve_); ~MSLinearInterpolater(); virtual Y interpolate(const X& xValue_) const; virtual MSTypeVector interpolate(const MSTypeVector&) const; }; #endif aplus-fsf-4.22/src/MSTypes/MSLongMatrix.H0000644000265000001440000000612710772770460013626 #ifndef MSLongMatrixHEADER #define MSLongMatrixHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #ifndef MSTypeMatrixHEADER #include #endif typedef MSTypeMatrix MSLongMatrix; // We provide provide explicit "do_not_instantiate" pragmas here to avoid instantiation complications in // MStk applications. // #if !defined(__MSTYPESLIBRARY_BUILD__) && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma do_not_instantiate MSAllocator #pragma do_not_instantiate MSTypeData > #pragma do_not_instantiate MSTypeMatrix #pragma do_not_instantiate MSMatrixSTypePick #pragma do_not_instantiate ostream& operator<<(ostream&,const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix operator-(const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix operator+(const MSTypeMatrix&,long) #pragma do_not_instantiate MSTypeMatrix operator+(long,const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix operator+(const MSTypeMatrix&,const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix operator-(const MSTypeMatrix&,long) #pragma do_not_instantiate MSTypeMatrix operator-(const MSTypeMatrix&,const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix operator*(const MSTypeMatrix&,long) #pragma do_not_instantiate MSTypeMatrix operator*(long,const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix operator*(const MSTypeMatrix&,const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix operator/(const MSTypeMatrix&,long) #pragma do_not_instantiate MSTypeMatrix operator/(const MSTypeMatrix&,const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix operator+(const MSTypeMatrix&,const MSTypeVector&) #pragma do_not_instantiate MSTypeMatrix operator-(const MSTypeMatrix&,const MSTypeVector&) #pragma do_not_instantiate MSTypeMatrix operator*(const MSTypeMatrix&,const MSTypeVector&) #pragma do_not_instantiate MSTypeMatrix operator/(const MSTypeMatrix&,const MSTypeVector&) #pragma do_not_instantiate MSTypeMatrix operator+(const MSTypeVector&,const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix operator*(const MSTypeVector&,const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix multiply(const MSTypeMatrix&,const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix stack(const MSTypeMatrix&,const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix adjoin(const MSTypeMatrix&,const MSTypeMatrix&) #endif // !__MSTYPESLIBRARY_BUILD__ && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #endif aplus-fsf-4.22/src/MSTypes/MSLongVector.H0000644000265000001440000000755710772770460013634 #ifndef MSLongVectorHEADER #define MSLongVectorHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MSDefinesHEADER #include #endif #if defined(MS_NEED_IMPLEMENTATION_PRAGMA) #pragma implementation("MSLongVector.C") #endif #include #include #if defined(MS_TEMPLATE_BEFORE_SPECIALIZATION) #include #endif template class MSTypeVector; typedef MSBaseVector > BaseVectorLong; typedef MSBuiltinVector BuiltinVectorLong; #ifndef MS_MSLongVector_INSTANTIATE #ifdef MS_DECLARE_TEMPLATE_SPECIALIZATION template <> class MSBaseVector >; template <> class MSBaseVectorOps >; template <> class MSBuiltinVector; template <> class MSBuiltinVectorOps; template <> class MSBuiltinSPick; template <> MSBuiltinVector operator- (const MSBuiltinVector&); template <> ostream& operator<<(ostream&,const MSBaseVector >&); #endif #endif #if defined(MS_VC_NEED_TEMPLATE_EXPORT) class MSTypesExport MSBaseVector >; class MSTypesExport MSBaseVectorOps >; class MSTypesExport MSBuiltinVector; class MSTypesExport MSBuiltinVectorOps; #endif #if !defined(MS_MSLongVector_INSTANTIATE) && defined(MS_STD_TEMPLATE_SPECIALIZATION) template <> class MSTypeVector : public BuiltinVectorLong #else template <> class MSTypesExport MSTypeVector : public BuiltinVectorLong #endif { public: MSTypeVector (); MSTypeVector (unsigned int); MSTypeVector (unsigned int, const long &); MSTypeVector (const MSTypeVector &); MSTypeVector (const BuiltinVectorLong &); MSTypeVector (const BaseVectorLong &); MSTypeVector (const char *); MSTypeVector (MSTypeData > *, unsigned int); MSTypeVector (const long *, unsigned int); virtual ~MSTypeVector(); MSTypeVector & operator= (const MSTypeVector &); MSTypeVector & operator= (const BuiltinVectorLong &); MSTypeVector & operator= (const BaseVectorLong &); MSTypeVector & operator= (const long &); MSTypeVector & operator= (const char *); virtual const MSSymbol & type() const; virtual MSString className() const; virtual MSModel *clone() const; virtual MSModel *create() const; static const MSSymbol & symbol(); }; typedef MSTypeVector MSLongVector; #ifndef MS_NO_INLINES #include #endif // MS_NO_INLINES // We provide provide explicit "do_not_instantiate" pragmas here to avoid instantiation complications in // MStk applications. // #if !defined(__MSTYPESLIBRARY_BUILD__) && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma do_not_instantiate MSAllocator #pragma do_not_instantiate MSTypeData > #pragma do_not_instantiate MSBaseVector > #pragma do_not_instantiate MSBaseVectorOps > #pragma do_not_instantiate MSBuiltinVector #pragma do_not_instantiate MSBuiltinVectorOps #pragma do_not_instantiate MSBuiltinSPick #pragma do_not_instantiate ostream& operator<<(ostream&, const MSBaseVector >&) #pragma do_not_instantiate unsigned int msMergeSortUp(unsigned int, long *, unsigned int *,unsigned int, unsigned int) #pragma do_not_instantiate unsigned int msMergeSortDown(unsigned int, long *, unsigned int *,unsigned int, unsigned int) #endif // !__MSTYPESLIBRARY_BUILD__ && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #endif // MSLongVectorHEADER aplus-fsf-4.22/src/MSTypes/MSMBSDate.H0000644000265000001440000001667710772770460012774 #ifndef MSMBSDateHEADER #define MSMBSDateHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MSDefinesHEADER #include #endif #include class MSTypesExport MSMBSDate : public MSDate { public: MSMBSDate(void); MSMBSDate(const char *); MSMBSDate(const MSMBSDate&); MSMBSDate(const MSDate&); MSMBSDate(const MSTime&,MSTime::MSTimeZone=MSTime::Local); MSMBSDate(const MSString&); MSMBSDate(MSJulian); MSMBSDate(int month_,int day_,int year_); MSMBSDate(const MSString&,const char* strptimeFormat_); ~MSMBSDate(void); virtual MSString asString(void) const; virtual MSString asDebugInfo(void) const; virtual MSString asMSF(void) const; virtual MSString className(void) const; virtual const MSSymbol& type(void) const; virtual MSModel *clone(void) const; virtual MSModel *create(void) const; virtual void assign(const MSModel&); virtual long compare(const MSModel&) const; virtual MSError::ErrorStatus set(const char*); virtual MSError::ErrorStatus setFromMSF(const char*); static const MSSymbol& symbol(void); virtual MSError::ErrorStatus set(const MSString*); virtual MSError::ErrorStatus set(const MSString&); virtual MSError::ErrorStatus set(const char *month_,const char *day_,const char *year_); virtual MSError::ErrorStatus set(int month_,int day_,int year_); virtual const char *format(MSString*) const; virtual const char *format(MSString&) const; virtual const char *format(MSString*,MSDateFormat) const; virtual const char *format(MSString&,MSDateFormat) const; virtual const char *format(MSString*,const MSFormat&) const; virtual const char *format(MSString&,const MSFormat&) const; virtual const char *format(MSString*,const char *format_) const; virtual const char *format(MSString&,const char *format_) const; virtual void setToday(void); virtual time_t asCalendarTime(MSTime::MSTimeZone=MSTime::Local) const; // return represenation of this date as a julian number virtual MSJulian date(void) const; // Date-specific functions virtual MSBoolean between(const MSDate&,const MSDate&) const; virtual MSDay dayOfYear(void) const; // 1-366 virtual MSDay dayOfMonth(void) const; // 1-31 virtual MSDay daysInMonth(void) const; // 1-31 virtual MSDay daysInYear(void) const; // 1-366 virtual unsigned weekOfYear(void) const; // 1-52 virtual MSDay firstDayOfMonth(void) const; virtual MSDay firstDayOfMonth(MSMonth) const; virtual void setFirstDayOfMonth(void); virtual MSDay lastDayOfMonth(void) const; virtual MSDay lastDayOfMonth(MSMonth) const; virtual void setLastDayOfMonth(void); virtual MSBoolean isSet(void) const; virtual MSBoolean isValid(void) const; virtual MSBoolean isLeapYear(void) const; virtual MSBoolean leap(void) const; virtual const char *nameOfDay(void) const; virtual const char *nameOfMonth(void) const; virtual MSDate max(const MSDate&) const; virtual MSDate min(const MSDate&) const; virtual MSMonth month(void) const; virtual MSDate previous(const char* dayName) const; virtual MSDate previous(MSDay) const; virtual MSDay weekDay(void) const; virtual MSYear year(void) const; virtual void asMonthDayYear(MSMonth&,MSDay&,MSYear&) const; virtual void nextWeekday(void); virtual void prevWeekday(void); virtual MSBoolean isWeekday(void) const; virtual MSBoolean isWeekend(void) const; friend MSTypesExport ostream& operator<<(ostream&,const MSMBSDate&); friend MSTypesExport istream& operator>>(istream&,MSMBSDate&); operator double() const; operator unsigned long() const; MSMBSDate& operator=(const MSMBSDate&); INLINELINKAGE MSBoolean operator <(const MSMBSDate&) const; INLINELINKAGE MSBoolean operator >(const MSMBSDate&) const; INLINELINKAGE MSBoolean operator<=(const MSMBSDate&) const; INLINELINKAGE MSBoolean operator>=(const MSMBSDate&) const; INLINELINKAGE MSBoolean operator==(const MSMBSDate&) const; INLINELINKAGE MSBoolean operator!=(const MSMBSDate&) const; inline friend MSTypesExport unsigned long hash(const MSMBSDate&,unsigned long size_); // date - date returns difference in days. int operator-(const MSMBSDate&) const; // date + term = date MSMBSDate operator+(const MSTerm&) const; MSMBSDate& operator+=(const MSTerm&); // date + days = date MSMBSDate operator+(int) const; MSMBSDate& operator+=(int); // date + NormYr = date MSMBSDate operator+(const MSNormalizedYears&) const; MSMBSDate& operator+=(const MSNormalizedYears&); // Note: (Date + Term) - Term != Date in some cases // 3/30/90 + 1 month = 4/30/90 // 4/30/90 - 1 month = 3/31/90 // Avoid using (date - term) if possible MSMBSDate operator -(const MSTerm&) const; MSMBSDate& operator-=(const MSTerm&); // date - days = date MSMBSDate operator -(int) const; MSMBSDate& operator-=(int); // date - NormYr = date MSMBSDate operator -(const MSNormalizedYears&) const; MSMBSDate& operator-=(const MSNormalizedYears&); friend MSTypesExport MSMBSDate operator+(int,const MSMBSDate&); friend MSTypesExport MSMBSDate operator+(const MSNormalizedYears&,const MSMBSDate&); friend MSTypesExport MSMBSDate operator+(const MSTerm&,const MSMBSDate&); MSMBSDate& operator++(); // Prefix MSMBSDate& operator--(); MSMBSDate operator++(int); // Postfix MSMBSDate operator--(int); static const char* dayName(MSDay); static MSDay dayOfWeek(const char*); static MSBoolean dayWithinMonth(MSMonth,MSDay,MSYear); static MSDay daysInMonth(MSMonth,MSYear); static MSDay daysInYear(MSYear); static MSMonth indexOfMonth(const char*); static MSJulian asJulianNumber(MSMonth,MSDay,MSYear); static MSJulian as30_360(MSMonth,MSDay,MSYear); static MSBoolean leapYear(MSYear); static const char* monthName(MSMonth); static int dcb30_360(const MSMBSDate&,const MSMBSDate&); static int findMatch(const char*,const char**,int); static MSMBSDate today(void); static MSJulian currentDate(void); static MSJulian nullDate(void); static MSDateFormat defaultFormat(void); static void defaultFormat(MSDateFormat); static const MSString& strftimeDefaultFormat(void); static void strftimeDefaultFormat(MSString&); static void strftimeDefaultFormat(const char *); static void defaultConstructToToday(MSBoolean); static MSBoolean defaultConstructToToday(void); protected: static MSDateFormat _defaultFormat; static MSString _strftimeDefaultFormat; static MSBoolean _defaultConstructToToday; static MSBoolean assertWeekDayNumber(MSDay); static MSBoolean assertIndexOfMonth(MSMonth); void normalizeAndSet(int month,int day,int year,int lastOfMonth); enum Operator {Plus,Minus}; MSMBSDate(const MSMBSDate&,const MSTerm&,Operator); MSMBSDate(const MSMBSDate&,const MSNormalizedYears&,Operator); }; inline long compare(const MSMBSDate& aDate_,const MSMBSDate& bDate_) { return aDate_==bDate_?0:(aDate_>bDate_?1:-1); } inline unsigned long hash(const MSMBSDate& aDate_,unsigned long size_) { return aDate_._date%size_; } #ifndef MS_NO_INLINES #ifndef MSMBSDateINLINES #include #endif #endif #endif aplus-fsf-4.22/src/MSTypes/MSMBStringBuffer.H0000644000265000001440000002403710772770461014362 #ifndef MSMBStringBufferHEADER #define MSMBStringBufferHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// /******************************************************************************* * FILE NAME: MSMBStringBuffer.H * * * * DESCRIPTION: * * This file contains the declaration(s) of the class(es): * * MSMBStringBuffer-DBCS buffer class * * * *******************************************************************************/ #include #include #ifndef MSStringBufferHEADER #include #endif class MSTypesExport MSMBStringBuffer : public MSStringBuffer { friend MSTypesExport MSStringBuffer *createMSMBStringBuffer(void); /******************************************************************************* * The MSMBStringBuffer class implements the version of MSString contents that * * supports mixed double-byte character set (DBCS) characters. This * * class ensures that multi-byte characters are processed properly. * * * * The use of this class is transparent to the user of class MSString. * *******************************************************************************/ public: /*-------------------------------- Overrides ----------------------------------- | This class re-implements the following MSStringBuffer functions as public: | | subString -See MSStringBuffer::subString. | | charType -See MSStringBuffer::charType. | | allocate -See MSStringBuffer::allocate. | | next -See MSStringBuffer::next. | | | | This class re-implements the following MSString version of MSStringBuffer | | functions: | | isMBCS -See MSString::isMBCS. | | isSBCS -See MSString::isSBCS. | | isValidMBCS -See MSString::isValidMBCS. | | includesMBCS -See MSString::includesMBCS. | | includesSBCS -See MSString::includesSBCS. | | indexOf -See MSString::indexOf. | | indexOfAnyBut -See MSString::indexOfAnyBut. | | indexOfAnyOf -See MSString::indexOfAnyOf. | | lastIndexOf -See MSString::lastIndexOf. | | lastIndexOfAnyBut -See MSString::lastIndexOfAnyBut. | | lastIndexOfAnyOf -See MSString::lastIndexOfAnyOf. | | center -See MSString::center. | | insert -See MSString::insert. | | leftJustify -See MSString::leftJustify. | | lowerCase -See MSString::lowerCase. | | overlayWith -See MSString::overlayWith. | | remove -See MSString::remove. | | reverse -See MSString::reverse. | | rightJustify -See MSString::rightJustify. | | strip -See MSString::strip. | | translate -See MSString::translate. | | upperCase -See MSString::upperCase. | | className -Returns "MSMBStringBuffer". | ------------------------------------------------------------------------------*/ virtual MSStringBuffer *subString(unsigned startPos,unsigned len,char padCharacter) const; virtual MSStringEnum::CharType charType(unsigned index) const; virtual char *next(const char *prev); virtual const char *next(const char *prev) const; virtual MSBoolean isMBCS() const; virtual MSBoolean isSBCS() const; virtual MSBoolean isValidMBCS() const; virtual MSBoolean includesMBCS() const; virtual MSBoolean includesSBCS() const; virtual unsigned indexOf(const char *pString,unsigned len,unsigned startPos=0) const; virtual unsigned indexOf(const MSStringTest &aTest,unsigned startPos=0) const; virtual unsigned indexOfAnyBut(const char *pString,unsigned len,unsigned startPos=0) const; virtual unsigned indexOfAnyBut(const MSStringTest &aTest,unsigned startPos=0) const; virtual unsigned indexOfAnyOf(const char *pString,unsigned len,unsigned startPos=0) const; virtual unsigned indexOfAnyOf(const MSStringTest &aTest,unsigned startPos=0) const; virtual unsigned lastIndexOf(const char *pString,unsigned len,unsigned startPos=UINT_MAX-1) const; virtual unsigned lastIndexOf(const MSStringTest &aTest,unsigned startPos=UINT_MAX-1) const; virtual unsigned lastIndexOfAnyBut(const char *pString,unsigned len,unsigned startPos=UINT_MAX-1) const; virtual unsigned lastIndexOfAnyBut(const MSStringTest &aTest,unsigned startPos=UINT_MAX-1) const; virtual unsigned lastIndexOfAnyOf(const char *pString,unsigned len,unsigned startPos=UINT_MAX-1) const; virtual unsigned lastIndexOfAnyOf(const MSStringTest &aTest,unsigned startPos=UINT_MAX-1) const; virtual MSStringBuffer *center(unsigned newLen,char padCharacter); virtual MSStringBuffer *insert(const char *pInsert,unsigned insertLen,unsigned pos,char padCharacter); virtual MSStringBuffer *leftJustify(unsigned newLen,char padCharacter); virtual MSStringBuffer *lowerCase(); virtual MSStringBuffer *overlayWith(const char *overlay,unsigned len,unsigned pos,char padCharacter); virtual MSStringBuffer *remove(unsigned startPos,unsigned numChars); virtual MSStringBuffer *reverse(); virtual MSStringBuffer *rightJustify(unsigned newLen,char padCharacter); virtual MSStringBuffer *strip(const char *pChars,unsigned len,MSStringEnum::StripMode mode); virtual MSStringBuffer *strip(const MSStringTest &aTest,MSStringEnum::StripMode mode); virtual MSStringBuffer *translate(const char *pInputChars,unsigned inputLen, const char *pOutputChars,unsigned outputLen,char padCharacter); virtual MSStringBuffer *upperCase(); protected: /*---------------------- Protected Overrides ----------------------------------- | This class re-implements the following MSStringBuffer functions as protected:| | | | startSearch -See MSStringBuffer::startSearch. | | startBackwardsSearch-See MSStringBuffer::startBackwardsSearch. | | className -Returns "MSMBStringBuffer". | ------------------------------------------------------------------------------*/ virtual MSStringBuffer *allocate(unsigned newLen) const; virtual const char *className() const; virtual unsigned startSearch(unsigned startPos,unsigned searchLen) const; virtual unsigned startBackwardsSearch(unsigned startPos,unsigned searchLen) const; /*------------------------------ Implementation -------------------------------- | These functions provide services used to implement this class: | | isCharValid-Returns MSTrue if and only if the character at the given | | index is in the set of valid characters. | | isDBCS1 -Returns MSTrue if and only if the byte at the given offset | | is the first byte of DBCS. | | isPrevDBCS -Returns MSTrue if and only if the preceding character to the | | one at the given offset is a DBCS character. | | charLength - | | maxCharLength-returns maximum length of a multibyte character | | prevCharLength- | | isSBC -returns MSTrue if character is NOT a multibyte character | | | ------------------------------------------------------------------------------*/ MSBoolean isCharValid(unsigned pos,const char *pValidChars,unsigned numValidChars) const; static size_t charLength(char const*); static size_t maxCharLength(); size_t charLength(unsigned pos) const; size_t prevCharLength(unsigned pos) const; static MSBoolean isSBC(char const*); friend class MSStringBuffer; /*------------------------------- Constructor ---------------------------------- | The constructor for this class is protected. It is only called from the | | member function allocate and the static member function | | MSStringBuffer::initialize. | ------------------------------------------------------------------------------*/ MSMBStringBuffer(unsigned bufLength); ~MSMBStringBuffer(void); }; inline size_t MSMBStringBuffer::charLength(char const *pString_) { if (*pString_==0) return 1; else return mblen(pString_,MB_LEN_MAX); } inline size_t MSMBStringBuffer::charLength(unsigned pos) const { return charLength(contents()+pos-1); } inline size_t MSMBStringBuffer::maxCharLength() { return MB_CUR_MAX; } inline MSBoolean MSMBStringBuffer::isSBC(char const *pString_) { return MSBoolean(charLength(pString_)==1); } #endif aplus-fsf-4.22/src/MSTypes/MSMMap.H0000644000265000001440000000541310772770461012372 #ifndef MSMMapHEADER #define MSMMapHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSTypesExport MSMMap { public: MSMMap(void); MSMMap(const char *fileName_); ~MSMMap(void); MSBoolean beamIn(const char *fileName_); MSAStruct *aplusData(void) const {return _aplusData;} MSBoolean isValid(void) const {return (_aplusData!=0)?MSTrue:MSFalse;} long type(void) const {return (_aplusData!=0)?_aplusData->t:MSA::UTYPE;} long rank(void) const {return (_aplusData!=0)?_aplusData->r:0;} long size(void) const {return (_aplusData!=0)?(MSA::dataSize(_aplusData->t,_aplusData->n)):0;} long count(void) const {return (_aplusData!=0)?_aplusData->n:0;} inline int getIntAt(unsigned) const; inline long getLongAt(unsigned) const; inline double getDoubleAt(unsigned) const; inline char getCharAt(unsigned) const; inline const int *getIntArray(void) const; inline const long *getLongArray(void) const; inline const double *getDoubleArray(void) const; inline const char *getCharArray(void) const; protected: MSAStruct *_aplusData; char *_mappedData; long _fileSize; MSBoolean checkEndiness(void); int isWrongEndian(MSAStruct*); }; inline const int* MSMMap::getIntArray(void) const { if (_aplusData!=0) return (int *)(_aplusData->p); else return 0; } inline const long* MSMMap::getLongArray(void) const { if (_aplusData!=0) return (long *)(_aplusData->p); else return 0; } inline const double* MSMMap::getDoubleArray(void) const { if (_aplusData!=0) return (double *)(_aplusData->p); else return 0; } inline const char* MSMMap::getCharArray(void) const { if (_aplusData!=0) return (char *)(_aplusData->p); else return 0; } inline int MSMMap::getIntAt(unsigned index_) const { if (_aplusData!=0&&index_<_aplusData->n) { int *pData=(int *)(_aplusData->p); return pData[index_]; } return 0; } inline long MSMMap::getLongAt(unsigned index_) const { if (_aplusData!=0&&index_<_aplusData->n) { long *pData=(long *)(_aplusData->p); return pData[index_]; } return 0; } inline double MSMMap::getDoubleAt(unsigned index_) const { if (_aplusData!=0&&index_<_aplusData->n) { double *pData=(double *)(_aplusData->p); return pData[index_]; } return 0; } inline char MSMMap::getCharAt(unsigned index_) const { if (_aplusData!=0&&index_<_aplusData->n) { char *pData=(char *)(_aplusData->p); return pData[index_]; } return 0; } #endif aplus-fsf-4.22/src/MSTypes/MSManagedPointer.H0000644000265000001440000001036510772770461014437 #ifndef MSManagedPointerHEADER #define MSManagedPointerHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MSDefinesHEADER #include #endif #ifdef MS_MULTI_THREAD #include #endif #include #if defined(MS_NEED_IMPLEMENTATION_PRAGMA) #pragma implementation("MSManagedPointer.C") #endif #if HAVE_IOSTREAM #include // #include using namespace std; #else class ostream; #endif #if defined(MS_PREDECLARE_TEMPLATE_FRIENDS) && !defined(MS_PREDECLARE_TEMPLATE_FRIENDS_BUG) template class MSManagedPointer; template ostream& operator<<(ostream&,const MSManagedPointer&); #if !defined(MS_SPECIALIZE_ELEMENT_FOR_OPS) template inline Type& elementForOps (MSManagedPointer&); template inline const Type& elementForOps(const MSManagedPointer&); #endif //MS_SPECIALIZE_ELEMENT_FOR_OPS #endif //MS_PREDECLARE_TEMPLATE_FRIENDS template class MSManagedPointer { protected: struct Node { Type *_pObject; unsigned _refCount; Node(Type *pType_) : _pObject(pType_),_refCount(1) {} ~Node(void) { delete _pObject; } #ifdef MS_MULTI_THREAD MSMutex _mutex; void addRef() { _mutex.acquire(); _refCount++; _mutex.release(); } unsigned remRef() { MSGuard g(_mutex); _refCount--; return _refCount; } #endif } *_node; public: MSManagedPointer(void) : _node(0) {} #if !defined (MS_NO_EXPLICIT_KEYWORD) explicit MSManagedPointer(Type *pType_) : _node(new Node(pType_)) {} #endif MSManagedPointer(Type *pType_,MSExplicitInit) : _node(new Node(pType_)) {} MSManagedPointer(const MSManagedPointer& aType_) { _node=aType_._node; #ifdef MS_MULTI_THREAD if (_node!=0) _node->addRef(); #else if (_node!=0) _node->_refCount++; #endif } ~MSManagedPointer(void) { #ifdef MS_MULTI_THREAD if (_node!=0&&_node->remRef()==0) delete _node; #else if (_node!=0&&--_node->_refCount==0) delete _node; #endif } MSManagedPointer& operator=(const MSManagedPointer&); Type& operator*() const { return *_node->_pObject; } Type* operator->() const { return _node->_pObject; } operator Type*() const { if (_node==0) return 0; else return _node->_pObject; } inline void reset(Type* pType_=0); inline Type* release(); inline void unset(); friend ostream& operator<< MS_FRIEND_TEMPLATEID(ostream&,const MSManagedPointer&); #if !defined(MS_SPECIALIZE_ELEMENT_FOR_OPS) friend inline Type & elementForOps (MSManagedPointer & ptr_) { return *(Type*)ptr_; } friend inline const Type & elementForOps (const MSManagedPointer & ptr_) { return *(Type*)ptr_; } #endif }; template inline MSManagedPointer& MSManagedPointer::operator=(const MSManagedPointer& aType_) { if (_node!=aType_._node) { #ifdef MS_MULTI_THREAD if (_node&&_node->remRef()==0) delete _node; #else if (_node&&--_node->_refCount==0) delete _node; #endif _node=aType_._node; #ifdef MS_MULTI_THREAD if (_node!=0) _node->addRef(); #else if (_node!=0) _node->_refCount++; #endif } return *this; } template inline void MSManagedPointer::reset(Type* pType_) { if ( !_node || pType_!=_node->_pObject ) { #ifdef MS_MULTI_THREAD if (_node&&_node->remRef()==0) delete _node; #else if (_node&&--_node->_refCount==0) delete _node; #endif _node=new Node(pType_); } } template inline Type* MSManagedPointer::release() { // if this managed pointer is the only reference to the underlying object, release it // otherwise ignore. if (_node&&_node->_refCount==1) { Type* tmp=_node->_pObject; _node->_pObject=0; _node->_refCount=0; return tmp; } return 0; } template inline void MSManagedPointer::unset() { if (_node) { #ifdef MS_MULTI_THREAD if (_node->remRef()==0) delete _node; #else if (--_node->_refCount==0) delete _node; #endif _node=0; } } #endif aplus-fsf-4.22/src/MSTypes/MSMappedFileAccess.H0000644000265000001440000000343010772770461014665 #ifndef MSMappedFileAccessHEADER #define MSMappedFileAccessHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include class MSTypesExport MSMappedFileAccess { public: static MSBoolean beamIn(MSCharVector &,const char *fileName_); static MSBoolean beamIn(MSIntVector &,const char *fileName_); static MSBoolean beamIn(MSLongVector &,const char *fileName_); static MSBoolean beamIn(MSFloatVector &,const char *fileName_); static MSBoolean beamIn(MSCharMatrix &,const char *fileName_); static MSBoolean beamIn(MSIntMatrix &,const char *fileName_); static MSBoolean beamIn(MSLongMatrix &,const char *fileName_); static MSBoolean beamIn(MSFloatMatrix &,const char *fileName_); static void beamOut(const char *fileName_,const MSCharVector &vector_); static void beamOut(const char *fileName_,const MSIntVector &vector_); static void beamOut(const char *fileName_,const MSLongVector &vector_); static void beamOut(const char *fileName_,const MSFloatVector &vector_); static void beamOut(const char *fileName_,const MSCharMatrix &matrix_); static void beamOut(const char *fileName_,const MSIntMatrix &matrix_); static void beamOut(const char *fileName_,const MSLongMatrix &matrix_); static void beamOut(const char *fileName_,const MSFloatMatrix &matrix_); protected: }; #endif aplus-fsf-4.22/src/MSTypes/MSMathDeclare.H0000644000265000001440000000273010772770461013710 #ifndef MSMathDeclareHEADER #define MSMathDeclareHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MSDefinesHEADER #include #endif #if !defined(MS_MATH_EXCEPTION_CONFLICT) #include #if defined(MS_NEED_INLINE_SQRT_INT) inline double sqrt(int l) { return sqrt((double)l); } #endif #else /*********************************************************************/ // Obsolete workaround for exception conflict between and // RW stdlib library. It doesn't seem to be needed anymore. /*********************************************************************/ extern "C" double sin(double); extern "C" double sinh(double); extern "C" double cos(double); extern "C" double cosh(double); extern "C" double tan(double); extern "C" double tanh(double); extern "C" double asin(double); extern "C" double acos(double); extern "C" double atan(double); extern "C" double exp(double); extern "C" double log(double); extern "C" double sqrt(double); extern "C" double ceil(double); extern "C" double floor(double); extern "C" double fabs(double); extern "C" double rint(double); extern "C" double pow(double,double); extern "C" double fmod(double,double); extern "C" int finite(double); #endif #endif aplus-fsf-4.22/src/MSTypes/MSMatrix.H0000644000265000001440000000304310772770461013001 #ifndef MSMatrixHEADER #define MSMatrixHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include typedef void (*MSMatrixErrorHandler)(const char*); #if HAVE_IOSTREAM #include // #include using namespace std; #else class ostream; #endif const unsigned MSMatrixDefaultMinimumAllocationSize=8; class MSTypesExport MSMatrix : public MSIndexedModel { protected: unsigned _count; unsigned _rows; unsigned _columns; static void indexError(unsigned,unsigned); static MSMatrixErrorHandler _matrixErrorHandler; static void matrixErrorHandler(const char*); static MSMatrixErrorHandler setMatrixErrorHandler(MSMatrixErrorHandler); public: MSMatrix(); MSMatrix(unsigned rows_,unsigned columns_); virtual ~MSMatrix(); unsigned count(void) const; unsigned rows(void) const; unsigned columns(void) const; unsigned index(unsigned row_,unsigned column_) const; }; inline unsigned MSMatrix::count(void) const { return _count; } inline unsigned MSMatrix::rows(void) const { return _rows; } inline unsigned MSMatrix::columns(void) const { return _columns; } inline unsigned MSMatrix::index(unsigned row_,unsigned column_) const { return (row_*columns())+column_; } #endif aplus-fsf-4.22/src/MSTypes/MSMergeSort.H0000644000265000001440000000146710772770461013454 #ifndef MSMergeSortHEADER #define MSMergeSortHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include // look for size_t #ifndef MSDefinesHEADER #include #endif #if defined(MS_NEED_IMPLEMENTATION_PRAGMA) #pragma implementation("MSMergeSort.C") #endif template unsigned int msMergeSortUp(unsigned int n,Type *sp_,unsigned int *p_,unsigned int low_,unsigned int high_); template unsigned int msMergeSortDown(unsigned int n,Type *sp_,unsigned int *p_,unsigned int low_,unsigned int high_); #endif //MSMergeSortHEADER aplus-fsf-4.22/src/MSTypes/MSMessageLog.H0000644000265000001440000000400510772770461013562 #ifndef MSMessageLogHEADER #define MSMessageLogHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MSDefinesHEADER #include #endif #include class MSTypesExport MSMessageLog { public: enum Priority { Critical,Error,Warning,Info,Debug}; enum Destination { StdErr,StdOut,Function,File,DebugOut }; typedef void (*LogFunction)(Priority,const char *); static void quietMode(MSBoolean mode_) { _quietMode=mode_; } static MSBoolean quietMode(void) { return _quietMode; } //Default threshold is Warning static void logThreshold(Priority threshold_) { _threshold=threshold_; } static Priority logThreshold(void) { return _threshold; } //Default destination is stdErr static void logDestination(Destination dest_); static Destination logDestination(void) { return _destination; } //Default function is 0 static void logFunction(LogFunction func_) { _mstkLogFunc=func_; } static LogFunction logFunction(void) { return _mstkLogFunc; } static int logFileName(const char *fileName_); static const char *logFileName(void); //-------------------------------------------------- //Below is interface for reporting messages. //It is for MSTK internal usage. static void message(Priority,const char *,...); //convinience functions. static void criticalMessage(const char *,...); static void errorMessage(const char *,...); static void warningMessage(const char *,...); static void infoMessage(const char *,...); static void debugMessage(const char *,...); private: static void outputMessage(Priority,const char*); static Destination _destination; static Priority _threshold; static LogFunction _mstkLogFunc; static MSBoolean _quietMode; }; #endif aplus-fsf-4.22/src/MSTypes/MSMethodCallback.H0000644000265000001440000000435510772770461014401 #ifndef MSMethodCallbackHEADER #define MSMethodCallbackHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include template class MSMethodCallback : public MSCallback { //############################################################################## // The template class MSMethodCallback is used to provide an // MSCallback-type wrapper for particular C++ member methods. // // The template class argument is the class name MethodClass of the class whose // member method is to be wrappered. // // The constructor for the object requires two things: // - An instance of class T. // - A pointer to a member method of the class T. This member method // will be applied to the object specified on the constructor when the // callback is invoked. // // Only non-const member methods are supported. // // Example: // // Any arbitrary class with appropriate method... // class MyWindow // { // void doSomething(void) const; // }; // MyWindow window; // MSList list(&window); // ... // list.callback(MSWidgetCallback::selection, // new MSMethodCallback(&window,&MyWindow::doSomething)); // //############################################################################### typedef void (MethodClass::*Method)(void); private: Method _method; MethodClass *_object; public: #ifdef MS_METHOD_POINTER_DEFAULTARG_BUG MSMethodCallback(MethodClass *object_,Method method_) : _object(object_),_method(method_) {} MSMethodCallback(MethodClass *object_=0) : _method(0),_object(object_) {} #else MSMethodCallback(MethodClass *object_=0,Method method_=0) : _method(method_),_object(object_) {} #endif ~MSMethodCallback(void) {} void method(MethodClass *object_,Method method_) {_object=object_,_method=method_;} Method method(void) {return _method;} MethodClass *object(void) {return _object;} virtual void process(void) { if (_object!=0&&_method!=0) (_object->*_method)(); } }; #endif aplus-fsf-4.22/src/MSTypes/MSModel.H0000644000265000001440000000254510772770461012603 #ifndef MSModelHEADER #define MSModelHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include class MSString; class MSTypesExport MSModel : public MSEventSender { public: MSModel(void) {} MSModel(const MSModel&) {} ~MSModel(void); // this protocol needs to be implemented by each MSModel subclass that intends to // be instantiable virtual MSString asString(void) const=0; virtual MSString asDebugInfo(void) const=0; virtual MSString asMSF(void) const=0; virtual MSString className(void) const=0; virtual const MSSymbol& type(void) const=0; virtual MSError::ErrorStatus set(const char *)=0; virtual MSError::ErrorStatus setFromMSF(const char *)=0; virtual MSModel *clone(void) const=0; // these are additions to the MSModel protocol - they will become // pure virtual virtual MSModel *create(void) const; virtual void assign(const MSModel&); virtual long compare(const MSModel&) const; static const MSSymbol& symbol(void); }; #endif aplus-fsf-4.22/src/MSTypes/MSMoney.H0000644000265000001440000002654410772770461012637 #ifndef MSMoneyHEADER #define MSMoneyHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include class MSRate; class MSFormat; struct CurrencyData; class MSTypesExport MSMoney : public MSFloat { public: enum Currency { DefaultCurrency, // currency is the one in _defaultCurrency USDollar, USDollars=USDollar, // the enums in 2nd column are aliases provided for CanadianDollar, CanadianDollars=CanadianDollar, // backward compatibility only BritishPound, Pound=BritishPound, JapaneseYen, Yen=JapaneseYen, DeutscheMark, Deutchmark=DeutscheMark, FrenchFranc, SwissFranc, DutchGuilder, Gilder=DutchGuilder, AustralianDollar, Aus=AustralianDollar, ItalianLira, Lira=ItalianLira, SpanishPeseta, Peseta=SpanishPeseta, Euro, ArgentinianPeso, AustrianSchilling, BelgianFranc, BrazilianReal, BulgarianLev, ChileanPeso, ChineseRenminbi, CzechKoruna, DanishKrone, FinnishMarkka, GreekDrachma, HongKongDollar, HungarianForint, IcelandKrona, IndianRupee, IrishPunt, IsraeliShekel, MexicanPeso, NewZealandDollar, NorwegianKrone, PolishZloty, PortugueseEscudo, RomanianLeu, RussianRouble, SingaporeDollar, SlovakianKoruna, SouthKoreanWon, SwedishKrona, TaiwanDollar, TurkishLira, VenezuelanBolivar }; enum MSMoneyFormat { // "inherited" formats from MSFloat Decimal0=MSFloat::Decimal0, // 1234 Decimal1=MSFloat::Decimal1, // 1234.2 Decimal2=MSFloat::Decimal2, // 1234.17 Decimal3=MSFloat::Decimal3, // 1234.171 Decimal4=MSFloat::Decimal4, // 1234.1712 Decimal5=MSFloat::Decimal5, // 1234.17123 Decimal6=MSFloat::Decimal6, // 1234.171234 Decimal7=MSFloat::Decimal7, // 1234.1712345 Decimal8=MSFloat::Decimal8, // 1234.17123456 CommaDecimal0=MSFloat::CommaDecimal0, // 1,234 CommaDecimal1=MSFloat::CommaDecimal1, // 1,234.2 CommaDecimal2=MSFloat::CommaDecimal2, // 1,234.17 CommaDecimal3=MSFloat::CommaDecimal3, // 1,234.171 CommaDecimal4=MSFloat::CommaDecimal4, // 1,234.1712 CommaDecimal5=MSFloat::CommaDecimal5, // 1,234.17123 CommaDecimal6=MSFloat::CommaDecimal6, // 1,234.171234 CommaDecimal7=MSFloat::CommaDecimal7, // 1,234.1712345 CommaDecimal8=MSFloat::CommaDecimal8, // 1,234.17123456 // Use precision appropriate to currency CurrencyPrecision=300, // default if not specified CommaCurrencyPrecision=301, // same as above with commas Eights=302, Sixteenths=303, ThirtySeconds=304, SixtyForths=305, OneTwentyEights=306, TwoFiftySixths=307, Tenths=Decimal1, Hundredths=Decimal2, Thousandths=Decimal3, TenThousandths=Decimal4, HundredThousandths=Decimal5, Millionths=Decimal6, TenMillionths=Decimal7, HundredMillionths=Decimal8 }; enum SymbolLocation { SymbolAtStart, SymbolAtEnd, DefaultLocation }; enum SymbolType { ISOSymbol, LocalSymbol, NoCurrencySymbol }; MSMoney(void); MSMoney(const MSMoney& m_); MSMoney(double d_,Currency c_=DefaultCurrency); MSMoney(int i_,Currency c_=DefaultCurrency); MSMoney(const MSFloat& f_,Currency c_=DefaultCurrency); MSMoney(const MSInt& i_,Currency c_=DefaultCurrency); ~MSMoney(void); virtual MSString asString(void) const; virtual MSString asMSF(void) const; virtual MSString asDebugInfo(void) const; virtual MSString className(void) const; virtual const MSSymbol& type(void) const; virtual MSModel *clone(void) const; virtual MSModel *create(void) const; virtual void assign(const MSModel&); virtual long compare(const MSModel&) const; virtual MSError::ErrorStatus setFromMSF(const char *); virtual MSError::ErrorStatus set(const char *); static const MSSymbol& symbol(void); MSError::ErrorStatus set(const MSString *); MSError::ErrorStatus set(const MSString &); MSError::ErrorStatus set(double); const char *format(MSString*) const; const char *format(MSString&) const; const char *format(MSString*,MSMoneyFormat,MSBoolean justify=MSFalse) const; const char *format(MSString&,MSMoneyFormat,MSBoolean justify=MSFalse) const; const char *format(MSString*,const MSFormat&,MSBoolean justify=MSFalse) const; const char *format(MSString&,const MSFormat&,MSBoolean justify=MSFalse) const; const char *format(MSString*, MSMoneyFormat, SymbolType, SymbolLocation =DefaultLocation, MSBoolean justify=MSFalse) const; const char *format(MSString&, MSMoneyFormat, SymbolType, SymbolLocation =DefaultLocation, MSBoolean justify=MSFalse) const; void currency(Currency); Currency currency(void) const; const char *isoCurrency (void) const; Currency isoConvert(const char *pisoSymbol_) const; // Currency conversion // Returns this value converted to "dest" currency, optionally using // rate at passed time instead of current rate. MSMoney convert(Currency) const; MSMoney convert(Currency,const MSTime&) const; operator double() const; // Combining money is only allowed if currencies match. // Note that money*money=real, but money*real=money and // real/money=real. operator=/+/- (MSFloat) is explicitly // left out, to catch incorrect types in the applications. MSMoney& operator=(const MSMoney&); MSMoney& operator=(const MSFloat&); MSMoney& operator=(const MSInt&); MSMoney& operator=(double); MSMoney& operator=(int); MSMoney operator+(const MSMoney&) const; MSMoney operator-(const MSMoney&) const; double operator/(const MSMoney&) const; // MSMoney operator*(const MSMoney& m_) -- generate compile time error - makes no sense INLINELINKAGE friend MSTypesExport MSMoney operator+(const MSMoney&,const MSFloat&); INLINELINKAGE friend MSTypesExport MSMoney operator-(const MSMoney&,const MSFloat&); INLINELINKAGE friend MSTypesExport MSMoney operator*(const MSMoney&,const MSFloat&); INLINELINKAGE friend MSTypesExport MSMoney operator/(const MSMoney&,const MSFloat&); INLINELINKAGE friend MSTypesExport MSMoney operator+(const MSMoney&,const MSInt&); INLINELINKAGE friend MSTypesExport MSMoney operator-(const MSMoney&,const MSInt&); INLINELINKAGE friend MSTypesExport MSMoney operator*(const MSMoney&,const MSInt&); INLINELINKAGE friend MSTypesExport MSMoney operator/(const MSMoney&,const MSInt&); INLINELINKAGE friend MSTypesExport MSMoney operator+(const MSMoney&,double); INLINELINKAGE friend MSTypesExport MSMoney operator-(const MSMoney&,double); INLINELINKAGE friend MSTypesExport MSMoney operator*(const MSMoney&,double); INLINELINKAGE friend MSTypesExport MSMoney operator/(const MSMoney&,double); INLINELINKAGE friend MSTypesExport MSMoney operator+(const MSMoney&,int); INLINELINKAGE friend MSTypesExport MSMoney operator-(const MSMoney&,int); INLINELINKAGE friend MSTypesExport MSMoney operator*(const MSMoney&,int); INLINELINKAGE friend MSTypesExport MSMoney operator/(const MSMoney&,int); INLINELINKAGE friend MSTypesExport MSMoney operator+(const MSFloat&,const MSMoney&); INLINELINKAGE friend MSTypesExport MSMoney operator-(const MSFloat&,const MSMoney&); INLINELINKAGE friend MSTypesExport MSMoney operator*(const MSFloat&,const MSMoney&); INLINELINKAGE friend MSTypesExport double operator/(const MSFloat&,const MSMoney&); INLINELINKAGE friend MSTypesExport MSMoney operator+(const MSInt&,const MSMoney&); INLINELINKAGE friend MSTypesExport MSMoney operator-(const MSInt&,const MSMoney&); INLINELINKAGE friend MSTypesExport MSMoney operator*(const MSInt&,const MSMoney&); INLINELINKAGE friend MSTypesExport double operator/(const MSInt&,const MSMoney&); INLINELINKAGE friend MSTypesExport MSMoney operator+(double,const MSMoney&); INLINELINKAGE friend MSTypesExport MSMoney operator-(double,const MSMoney&); INLINELINKAGE friend MSTypesExport MSMoney operator*(double,const MSMoney&); INLINELINKAGE friend MSTypesExport double operator/(double,const MSMoney&); INLINELINKAGE friend MSTypesExport MSMoney operator+(int,const MSMoney&); INLINELINKAGE friend MSTypesExport MSMoney operator-(int,const MSMoney&); INLINELINKAGE friend MSTypesExport MSMoney operator*(int,const MSMoney&); INLINELINKAGE friend MSTypesExport double operator/(int,const MSMoney&); // Be sure to preserve the currency MSMoney operator-(); MSMoney& operator+=(const MSMoney&); MSMoney& operator-=(const MSMoney&); INLINELINKAGE MSMoney& operator+=(const MSFloat&); INLINELINKAGE MSMoney& operator+=(const MSInt&); INLINELINKAGE MSMoney& operator+=(double); INLINELINKAGE MSMoney& operator+=(int); INLINELINKAGE MSMoney& operator-=(const MSFloat&); INLINELINKAGE MSMoney& operator-=(const MSInt&); INLINELINKAGE MSMoney& operator-=(double); INLINELINKAGE MSMoney& operator-=(int); // MSMoney& operator*=(const MSMoney&); -- generate compile time error - makes no sense INLINELINKAGE MSMoney& operator*=(const MSFloat&); INLINELINKAGE MSMoney& operator*=(const MSInt&); INLINELINKAGE MSMoney& operator*=(double); INLINELINKAGE MSMoney& operator*=(int); // MSMoney& operator/=(const MSMoney&); -- generate compile time error - makes no sense INLINELINKAGE MSMoney& operator/=(const MSFloat&); INLINELINKAGE MSMoney& operator/=(const MSInt&); INLINELINKAGE MSMoney& operator/=(double); INLINELINKAGE MSMoney& operator/=(int); friend MSTypesExport ostream& operator<<(ostream&,const MSMoney&); static void declareConversionRate(Currency a_,Currency b_,const MSRate& r_) { declareConversionRate(a_,b_,r_,MSTime()); } static void declareConversionRate(Currency,Currency,const MSRate&,const MSTime&) {} static void declareRecipConversionRate(Currency a_,Currency b_,const MSRate& r_) { declareRecipConversionRate(a_,b_,r_,MSTime()); } static void declareRecipConversionRate(Currency,Currency,const MSRate&,const MSTime&) {} static void setDefaultCurrency(Currency); static Currency defaultCurrency() { return _defaultCurrency; } protected: Currency _currency; static Currency _defaultCurrency; // initially USD // special protected constructors - they allow us to take advantage of the // return value optimization (RV0) - see section 12.1c of the ARM MSMoney(const MSMoney&,const MSMoney&,FloatOperator); MSMoney(const MSMoney&,const MSInt&,FloatOperator); MSMoney(const MSMoney&,const MSFloat&,FloatOperator); MSMoney(const MSMoney&,double,FloatOperator); MSMoney(const MSMoney&,int,FloatOperator); MSMoney(const MSFloat&,const MSMoney&,FloatOperator); MSMoney(const MSInt&,const MSMoney&,FloatOperator); MSMoney(int,const MSMoney&,FloatOperator); MSMoney(double,const MSMoney&,FloatOperator); static CurrencyData *findCurrency(const char *); static int iscurr(int); }; inline long compare(const MSMoney& aMoney_,const MSMoney& bMoney_) { return compare((MSFloat&)aMoney_,(MSFloat&)bMoney_); } #ifndef MS_NO_INLINES #ifndef MSMoneyINLINES #include #endif #endif #endif //MSMoneyHEADER aplus-fsf-4.22/src/MSTypes/MSMoneyVector.H0000644000265000001440000000330510772770461014010 #ifndef MSMoneyVectorHEADER #define MSMoneyVectorHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include typedef MSTypeVector MSMoneyVector; inline MSMoney msBadData(const MSMoney&) { return MSMoney(0.0); } // We provide provide explicit "do_not_instantiate" pragmas here to avoid instantiation complications in // MStk applications. // #if !defined(__MSTYPESLIBRARY_BUILD__) && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma do_not_instantiate MSVectorModelAllocator #pragma do_not_instantiate MSTypeData > #pragma do_not_instantiate MSBaseVector > #pragma do_not_instantiate MSBaseVectorOps > #pragma do_not_instantiate MSObjectVector #pragma do_not_instantiate MSVectorElement #pragma do_not_instantiate MSTypeVector #pragma do_not_instantiate ostream& operator<<(ostream&, const MSBaseVector >&) #pragma do_not_instantiate unsigned int msMergeSortUp(unsigned int, MSMoney *, unsigned int *,unsigned int, unsigned int) #pragma do_not_instantiate unsigned int msMergeSortDown(unsigned int, MSMoney *, unsigned int *,unsigned int, unsigned int) #endif // !__MSTYPESLIBRARY_BUILD__ && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #endif //MSMoneyVectorHEADER aplus-fsf-4.22/src/MSTypes/MSMutex.H0000644000265000001440000000721010772770461012637 #ifndef MSMutexHEADER #define MSMutexHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MSDefinesHEADER #include #endif // // Simple Mutex Lock. Relevant only in mt situation // #if defined(MS_MULTI_THREAD) #if defined (MS_POSIX_THREADS) #undef MIN #undef MAX #include typedef pthread_mutex_t MSMutexType; #elif defined (MS_SOLARIS_THREADS) #include typedef mutex_t MSMutexType; #elif defined (MS_WINDOWS_THREADS) #include typedef CRITICAL_SECTION MSMutexType; #else #error Class MSMutex is not yet supported in this environment #endif // // MSMutex // class MSTypesExport MSMutex { public: enum StaticCtorType { StaticCtor }; MSMutex (); // Construct the mutex. MSMutex (StaticCtorType); // Constructor for static use ~MSMutex (); // Destroy the mutex. void acquire (); // Acquire the mutex. void release (); // Release the mutex. private: void init (); MSMutex (const MSMutex&); MSMutex& operator= (const MSMutex&); MSMutexType mutex; #if !defined (MS_NO_MUTEX_INIT) int initFlag; #endif }; // // MSGuard, acquire associated mutex upon construction, release when destructed. // class MSTypesExport MSGuard { public: MSGuard (MSMutex& m); ~MSGuard (); private: MSMutex& _msmutex; }; void inline MSMutex::init () { #if defined (MS_POSIX_THREADS) # if defined(MS_POSIX_D10_THREADS) # if defined(MS_MUTEXATTR_DEFAULT) pthread_mutex_init(&mutex, &pthread_mutexattr_default); # else pthread_mutex_init(&mutex, 0); # endif # else pthread_mutex_init(&mutex, pthread_mutexattr_default); # endif #elif defined (MS_SOLARIS_THREADS) mutex_init(&mutex, USYNC_THREAD, NULL); #elif defined (MS_WINDOWS_THREADS) InitializeCriticalSection(&mutex); #endif #if !defined (MS_NO_MUTEX_INIT) initFlag = 1; #endif } inline MSMutex::MSMutex () { init(); } // // Inline definitions of MSMutex class // inline MSMutex::MSMutex (MSMutex::StaticCtorType) { // Empty, because acquire() may already have been used. } inline MSMutex::~MSMutex () { #if !defined (MS_NO_MUTEX_INIT) if (initFlag) { initFlag=0; #endif #if defined (MS_POSIX_THREADS) pthread_mutex_destroy(&mutex); #elif defined (MS_SOLARIS_THREADS) mutex_destroy(&mutex); #elif defined (MS_WINDOWS_THREADS) DeleteCriticalSection(&mutex); #endif #if !defined (MS_NO_MUTEX_INIT) } #endif } inline void MSMutex::acquire () { #if !defined (MS_NO_MUTEX_INIT) if(initFlag==0) init(); #endif #if defined (MS_POSIX_THREADS) pthread_mutex_lock(&mutex); #elif defined (MS_SOLARIS_THREADS) mutex_lock(&mutex); #elif defined (MS_WINDOWS_THREADS) EnterCriticalSection(&mutex); #endif } inline void MSMutex::release () { #if defined (MS_POSIX_THREADS) pthread_mutex_unlock(&mutex); #elif defined (MS_SOLARIS_THREADS) mutex_unlock(&mutex); #elif defined (MS_WINDOWS_THREADS) LeaveCriticalSection(&mutex); #endif } // // Inline definitions of MSGuard class // inline MSGuard::MSGuard (MSMutex& msmutex_) : _msmutex(msmutex_) { _msmutex.acquire(); } inline MSGuard::~MSGuard () { _msmutex.release(); } //useful macro for protecting a piece of code with a guard on a stack. #define MSGUARD(mutex) MSGuard mutex##Guard (mutex) #else // MS_MULTI_THREAD #define MSGUARD(mutex) #endif // MS_MULTI_THREAD #endif // MSMutexHEADER aplus-fsf-4.22/src/MSTypes/MSNameSpace.H0000644000265000001440000000447110772770461013377 #ifndef MSNameSpaceHEADER #define MSNameSpaceHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #ifdef MS_MULTI_THREAD #include #endif class MSHashTable; class MSNameSpaceHashTable; class MSHashEntry; #if HAVE_IOSTREAM #include // #include using namespace std; #else class ostream; #endif class MSTypesExport MSNameSpace { public: MSNameSpace(unsigned size_=128); ~MSNameSpace(void); static MSAtom nullAtom(void); MSAtom intern(const char *symbol_); MSAtom lookup(const char *symbol_) const; const char *atomName(MSAtom atom_) const; unsigned averageChainLengthThreshold(void) const; void averageChainLengthThreshold(unsigned); friend MSTypesExport ostream& operator<<(ostream& aStream_,const MSNameSpace& aNameSpace_); private: MSNameSpaceHashTable *_symbolHashTable; char **_stringTable; unsigned _count; unsigned _size; unsigned _averageChainLengthThreshold; MSAtom _nextAtomValue; #ifdef MS_MULTI_THREAD MSMutex _mutex; // namespace lock #endif MSNameSpaceHashTable *symbolHashTable(void) const; MSAtom nextAtomValue(void) const; unsigned size(void) const; unsigned count(void) const; void reserve(unsigned size_); MSHashEntry *addSymbol(const char *,MSAtom); }; inline MSAtom MSNameSpace::nullAtom(void) { return MSNullAtom; } inline MSNameSpaceHashTable *MSNameSpace::symbolHashTable(void) const { return _symbolHashTable; } inline MSAtom MSNameSpace::nextAtomValue(void) const { return _nextAtomValue; } inline unsigned MSNameSpace::size(void) const { return _size; } inline unsigned MSNameSpace::count(void) const { return _count; } inline unsigned MSNameSpace::averageChainLengthThreshold(void) const { return _averageChainLengthThreshold; } inline void MSNameSpace::averageChainLengthThreshold(unsigned avg_) { if (avg_>0) _averageChainLengthThreshold=avg_; } inline const char *MSNameSpace::atomName(MSAtom atom_) const { return (const char *)_stringTable[atom_]; } #endif aplus-fsf-4.22/src/MSTypes/MSNodeList.H0000644000265000001440000000267210772770462013266 #ifndef MSNodeListHEADER #define MSNodeListHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include typedef int (*NodeSortFunc)(const void *,const void *); class MSTypesExport MSNodeItem { friend class MSNodeList; private: MSNodeItem *_next; MSNodeItem *_prev; void *_data; public: MSNodeItem(void) { _data=0; _next=this; _prev=this; } MSNodeItem(void *d) { _data=d; _next=this; _prev=this; } ~MSNodeItem(void); void insert(MSNodeItem *h); void remove(void); void sort(MSNodeItem *hp,NodeSortFunc func_); void toad(void); void data(void *d) {_data=d;} void *data(void) {return _data;} MSNodeItem *next(void) {return _next;} MSNodeItem *prev(void) {return _prev;} MSNodeItem *address(void) {return this;} }; class MSTypesExport MSNodeList { protected: MSNodeItem *_first; MSNodeItem *_last; public: MSNodeList(void) : _first(0),_last(0) {} ~MSNodeList(void) {} MSNodeItem *first(void) {return _first;} MSNodeItem *head(void) {return _first;} MSNodeItem *last(void) {return _last;} MSNodeList& append(MSNodeItem*); MSNodeList& prepend(MSNodeItem*); MSNodeList& unlink(MSNodeItem*); }; #endif aplus-fsf-4.22/src/MSTypes/MSNormalizedYears.H0000644000265000001440000000553610772770462014657 #ifndef MSNormalizedYearsHEADER #define MSNormalizedYearsHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSDate; class MSTypesExport MSNormalizedYears { public: enum Basis { ActualActual,Actual365,AIBD30_360,Euro365 }; // make directly from days or from (MSDate - MSDate) // uses absolute value of d // default was unitialized MSNormalizedYears() : _basis(ActualActual),_years(0.0) {} MSNormalizedYears(int i_, Basis b_=ActualActual) : _basis(b_) { makeFromDays(i_); } // make from analytics normalized years MSNormalizedYears(double d_, Basis b_=ActualActual) : _basis(b_),_years(d_) {} // absolute difference between dates MSNormalizedYears(const MSDate& d1_, const MSDate& d2_,Basis b_=ActualActual) : _basis(b_) { makeFromDates(d1_,d2_); } MSNormalizedYears(const MSNormalizedYears& n_) : _basis(n_._basis),_years(n_._years) {} virtual MSString asString(void) const; virtual MSString asDebugInfo(void) const; virtual MSString className(void) const; virtual const MSSymbol& type(void) const; static const MSSymbol& symbol(void); void set(int i_,Basis b_=ActualActual) { _basis=b_; makeFromDays(i_); } void set(double d_,Basis b_=ActualActual) { _basis=b_; _years=d_; } void set(const MSDate& d1_,const MSDate& d2_, Basis b_=ActualActual) { _basis=b_; makeFromDates(d1_,d2_); } // We only add 0.49 so that 2 years is 365*2 days, not 365+366 days int days() const { return int((_years*daysInYear())+0.49); } Basis basis() const { return _basis; } double daysInYear() const; MSNormalizedYears operator+=(const MSNormalizedYears); MSNormalizedYears operator+ (const MSNormalizedYears) const; MSNormalizedYears operator-=(const MSNormalizedYears); MSNormalizedYears operator- (const MSNormalizedYears) const; MSNormalizedYears operator-() const { return MSNormalizedYears(-_years); } operator double() const { return _years; } protected: virtual void makeFromDays(int); virtual void makeFromDates(const MSDate&, const MSDate&); private: double _years; Basis _basis; }; inline MSNormalizedYears MSNormalizedYears::operator+=(const MSNormalizedYears x) { _years+=x._years; return *this; } inline MSNormalizedYears MSNormalizedYears::operator+(const MSNormalizedYears y) const { return MSNormalizedYears(_years+y._years); } inline MSNormalizedYears MSNormalizedYears::operator-=(const MSNormalizedYears x) { _years-=x._years; return *this; } inline MSNormalizedYears MSNormalizedYears::operator-(const MSNormalizedYears y) const { return MSNormalizedYears(_years-y._years); } #endif aplus-fsf-4.22/src/MSTypes/MSNullEvent.H0000644000265000001440000000160210772770462013451 #ifndef MSNullEventHEADER #define MSNullEventHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSTypesExport MSNullEvent : public MSEvent { public: MSNullEvent(void); MSNullEvent(const MSNullEvent&); ~MSNullEvent(void); static const MSSymbol& symbol(void); MSNullEvent& operator=(const MSNullEvent& aEvent_); }; inline MSNullEvent::MSNullEvent(void) : MSEvent(MSNullEvent::symbol()) {} inline MSNullEvent::MSNullEvent(const MSNullEvent& aEvent_) : MSEvent(aEvent_.symbol()) {} inline MSNullEvent& MSNullEvent::operator=(const MSNullEvent& aEvent_) { sender(aEvent_.sender()); return *this; } #endif aplus-fsf-4.22/src/MSTypes/MSObjectTypeVector.H0000644000265000001440000000564510772770462015003 #ifndef MSObjectTypeVectorHEADER #define MSObjectTypeVectorHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MSBaseTypeVectorHEADER #include #endif //MSBaseTypeVectorHEADER #ifndef MSAllocatorHEADER #include #endif //MSAllocatorHEADER #ifndef MSDefinesHEADER #include #endif //MSDefinesHEADER #if defined(MS_NEED_IMPLEMENTATION_PRAGMA) #pragma implementation("MSObjectTypeVector.C") #endif template class MSVectorElement; template class MSVectorModelAllocator : public MSAllocator { public: INLINELINKAGE MSVectorModelAllocator(void); INLINELINKAGE ~MSVectorModelAllocator(void); INLINELINKAGE void construct(Type *p_, const Type& value_); }; template class MSObjectVector : public MSBaseVector > { friend class MSVectorElement; public: MSObjectVector (); MSObjectVector (unsigned int); MSObjectVector (unsigned int, const Type &); MSObjectVector (const MSObjectVector &); MSObjectVector (const MSBaseVector > &); MSObjectVector (const char *, const char =' '); MSObjectVector (MSTypeData > *, unsigned int); MSObjectVector (const Type *, unsigned int); virtual ~MSObjectVector(); MSObjectVector & operator= (const MSObjectVector &); MSObjectVector & operator= (const MSBaseVector > &); MSObjectVector & operator= (const Type &); MSObjectVector & operator= (const char *); INLINELINKAGE Type & firstElement(); INLINELINKAGE Type & lastElement (); INLINELINKAGE const Type & firstElement() const; INLINELINKAGE const Type & lastElement () const; INLINELINKAGE const Type & operator[] (unsigned int) const; INLINELINKAGE const Type & operator() (unsigned int) const; INLINELINKAGE const Type & elementAt (unsigned int) const; INLINELINKAGE Type & operator[] (unsigned int); Type & elementAt (unsigned int); INLINELINKAGE MSObjectVector operator[] (const MSIndexVector &) const; INLINELINKAGE MSObjectVector operator[] (const MSBinaryVector &) const; }; template class MSVectorElement : public Type { protected: virtual void sendEvent (MSEvent &); public: INLINELINKAGE MSVectorElement (); INLINELINKAGE MSVectorElement (const MSVectorElement &); INLINELINKAGE MSVectorElement (const Type &); ~MSVectorElement(); INLINELINKAGE void vector (MSObjectVector *); }; #ifndef MS_NO_INLINES #include #endif // MS_NO_INLINES #endif // MSObjectTypeVectorHEADER aplus-fsf-4.22/src/MSTypes/MSObservableTree.H0000644000265000001440000000477410772770462014456 #ifndef MSObservableTreeHEADER #define MSObservableTreeHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include template class MSObservableTree : public MSModel, public MSTabularTree { public: typedef MSTabularTreeCursor Cursor; typedef MSObservableTreeEvent TreeEvent; MSObservableTree(void); MSObservableTree(const MSObservableTree&); ~MSObservableTree(void); MSObservableTree& operator=(const MSObservableTree&); static const MSSymbol& symbol(void); void elementChanged(const MSTabularTreeCursor&); //The following are the same API's as MSTabularTree void addAsChild(const MSTabularTreeCursor&,unsigned long,const Element&); void addAsRoot(const Element&); void attachAsChild(const MSTabularTreeCursor&,unsigned long,MSObservableTree&); void attachSubtreeAsChild(const MSTabularTreeCursor&,unsigned long, MSObservableTree&,const MSTabularTreeCursor&); void attachAsRoot(MSObservableTree&); void attachSubtreeAsRoot(MSObservableTree&,const MSTabularTreeCursor&); void copy(const MSTabularTree&); void copySubtree(const MSTabularTree&,const MSTabularTreeCursor&); void removeAll(void); void removeSubtree(const MSTabularTreeCursor&); void replaceAt(const MSTabularTreeCursor&,const Element&); void replaceAt(const MSTabularTreeCursor&,MSObservableTree&); void permuteChildren(MSTabularTreeCursor const&, const MSIndexVector&); //Fill in the pure virtuals from MSModel virtual MSString asString(void) const; virtual MSString asDebugInfo(void) const; virtual MSString asMSF(void) const; virtual MSString className(void) const; virtual const MSSymbol& type(void) const; virtual MSError::ErrorStatus set(const char *); virtual MSError::ErrorStatus setFromMSF(const char *); virtual MSModel *clone(void) const; protected: void changed(void); void changed(const MSTabularTreeCursor&,unsigned long,MSObservableTreeEventType); }; #endif aplus-fsf-4.22/src/MSTypes/MSObservableTreeEvent.H0000644000265000001440000000427510772770462015454 #ifndef MSObservableTreeEventHEADER #define MSObservableTreeEventHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include enum MSObservableTreeEventType {MSObservableTreeInsert,MSObservableTreeDelete, MSObservableTreeCopy,MSObservableTreeAssign, MSObservableTreeReplace,MSObservableTreePermute }; template class MSObservableTreeEvent : public MSEvent { public: MSObservableTreeEvent(const MSObservableTreeEvent &aEvent_) :MSEvent(aEvent_), _position(aEvent_._position), _treeEventType(aEvent_._treeEventType), _cursor(aEvent_._cursor) {} MSObservableTreeEvent(const MSTabularTreeCursor &cursor_, unsigned long position_,MSObservableTreeEventType treeEventType_) :MSEvent(symbol()), _position(position_), _cursor(cursor_), _treeEventType(treeEventType_) {} MSObservableTreeEvent(const MSTabularTreeCursor &cursor_, const MSIndexVector& index_,MSObservableTreeEventType treeEventType_) :MSEvent(symbol()), _position(0), _index(index_), _cursor(cursor_), _treeEventType(treeEventType_) {} ~MSObservableTreeEvent(void); MSObservableTreeEvent& operator=(const MSObservableTreeEvent&); const MSTabularTreeCursor& cursor(void) const {return _cursor;} unsigned long position(void) const {return _position;} MSObservableTreeEventType treeEventType(void) const {return _treeEventType;} const MSIndexVector& index(void) const {return _index; } static const MSSymbol& symbol(void); protected: unsigned long _position; MSTabularTreeCursor _cursor; MSObservableTreeEventType _treeEventType; MSIndexVector _index; }; #endif aplus-fsf-4.22/src/MSTypes/MSOid.H0000644000265000001440000000775710772770462012271 #ifndef MSOid_HEADER #define MSOid_HEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #if HAVE_IOSTREAM #include // #include using namespace std; #else class ostream; class istream; #endif class MSString; #define NPARTS 4 class MSTypesExport MSOid { public: enum MSOidFormat { MSOidNull=0 }; MSOid(); // Create computed OID MSOid(const MSOid& o); // Copy other OID MSOid(const MSOidFormat); // use a "null oid" int set(const char *); // Create from 32 character hex representation. void setData(void *); // Create from 16 byte binary representation. MSOid& operator=(const MSOid& o_); // Fast copying int operator==(const MSOid& o_) const; // == comparison int operator!=(const MSOid& o_) const; // != comparison int operator!() const; // Is this OID null? Returns 1 of so, else 0. // Used as a boolean. // E.g. // MSOid oid; // if (!oid) ... operator const void *() const; // Is this OID null? Returns (non-zero) address of object // if the OID's value is not null, else 0. Used as a boolean. // E.g. // MSOid oid; // if (oid) ... static void newPid(); // Call MSOid::newPid() in the child after a fork(). E.g. // if (fork() == 0) { // MSOid::newPid(); // ... // } void newOid(); // If the current OID is null, generates a new non-null value. friend MSTypesExport ostream &operator<<(ostream&, const MSOid&); // Insert in ostream. friend MSTypesExport istream &operator>>(istream&, MSOid&); // Extract from istream. ~MSOid(); const MSString asString() const; // comparisons needed for collections long int compare(const MSOid& c) const; friend MSTypesExport long int compare(const MSOid& o1_, const MSOid& o2_); private: static unsigned _pid; static unsigned _hid; static unsigned _seq; static unsigned long _sec; static const MSOid null; int parse(const char *hexRepresentation); // Oid definition of broken down into 4, 4 byte pieces, the // first 4 bytes are further broken down into 3 pieces // first byte-cyclic sequence number; // second byte bits 0-3-version, bits 4-7-class id; // third/fourth byte-rest of class id // second 4 bytes is processor id, // third 4 bytes is a time stamp in seconds since 1/1/1970 // last 4 bytes is a process id unsigned _oid[NPARTS]; }; inline MSOid::MSOid() { memset((void*)&_oid, 0, sizeof(_oid)); newOid(); } inline MSOid::MSOid(const MSOidFormat) { memset((void*)&_oid, 0, sizeof(_oid)); } inline MSOid::MSOid(const MSOid& o_) { memcpy((void*)&_oid, (void*)&o_._oid, sizeof(_oid)); } inline MSOid & MSOid::operator=(const MSOid& o_) { memcpy(_oid,o_._oid,sizeof(_oid)); return *this; } inline int MSOid::operator==(const MSOid& o_) const { return memcmp((void*)&_oid, (void*)&o_._oid, sizeof(_oid)) ? 0 : 1; } inline int MSOid::operator!=(const MSOid& o_) const { return !(*this == o_); } inline int MSOid::set(const char *hexStr_) { return parse(hexStr_); } inline void MSOid::setData(void * data_) { // copy whatever number of bytes from data_ to fill oid memcpy((void*)&_oid, data_, sizeof(_oid)); } inline MSOid::operator const void *() const { return *this == MSOid::null ? 0 : this; } inline int MSOid::operator!() const { return *this == MSOid::null ? 1 : 0; } inline MSOid::~MSOid() { } inline long int compare(const MSOid& o1_, const MSOid& o2_) { return memcmp(o1_._oid, o2_._oid, sizeof(o2_._oid)); } inline long int MSOid::compare(const MSOid& o_) const { return ::compare(*this, o_); } const MSSymbol MSOID("msoid"); #endif // MSOid_HEADER aplus-fsf-4.22/src/MSTypes/MSPoint.H0000644000265000001440000000274110772770462012633 #ifndef MSPointHEADER #define MSPointHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MSDefinesHEADER #include #endif #if defined(MS_NEED_IMPLEMENTATION_PRAGMA) #pragma implementation("MSPoint.C") #endif #if defined(MS_PREDECLARE_TEMPLATE_FRIENDS) template class MSPoint; template ostream& operator<<(ostream&, const MSPoint&); #endif //MS_PREDECLARE_TEMPLATE_FRIENDS template class MSPoint { public: inline MSPoint(const X&,const Y&); inline X& x(void); inline Y& y(void); inline const X& x(void) const; inline const Y& y(void) const; friend MSTypesExport ostream& operator<<(ostream& aStream_,const MSPoint& aPoint_); protected: X _x; Y _y; }; //-------------------- // MSPoint inlines //-------------------- template inline MSPoint::MSPoint(const X& x_,const Y& y_) { _x=x_,_y=y_; } template inline const X& MSPoint::x(void) const { return _x; } template inline const Y& MSPoint::y(void) const { return _y; } template inline X& MSPoint::x(void) { return _x; } template inline Y& MSPoint::y(void) { return _y; } #endif aplus-fsf-4.22/src/MSTypes/MSPointer.H0000644000265000001440000000343710772770462013165 #ifndef MSPointerHEADER #define MSPointerHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MSDefinesHEADER #include #endif #include #if defined(MS_NEED_IMPLEMENTATION_PRAGMA) #pragma implementation("MSPointer.C") #endif #if HAVE_IOSTREAM #include // #include using namespace std; #else class ostream; #endif #if defined(MS_PREDECLARE_TEMPLATE_FRIENDS) && !defined(MS_PREDECLARE_TEMPLATE_FRIENDS_BUG) template class MSPointer; template ostream& operator<<(ostream&,const MSPointer&); #if !defined(MS_SPECIALIZE_ELEMENT_FOR_OPS) template inline Type& elementForOps(MSPointer&); template inline const Type& elementForOps(const MSPointer&); #endif #endif //MS_PREDECLARE_TEMPLATE_FRIENDS template class MSPointer { public: MSPointer(void) : _pObject(0) {} MSPointer(Type* pObject_,MSExplicitInit=MSInit) : _pObject(pObject_) {} #if !defined (MS_NO_EXPLICIT_KEYWORD) explicit MSPointer(Type* pObject_) : _pObject(pObject_) {} #endif Type& operator*() const { return *_pObject; } Type* operator->() const { return _pObject; } operator Type*() const { return _pObject; } friend ostream& operator<<(ostream&,const MSPointer&); #if !defined(MS_SPECIALIZE_ELEMENT_FOR_OPS) friend inline Type & elementForOps (MSPointer & ptr_) { return *ptr_; } friend inline const Type & elementForOps (const MSPointer & ptr_) { return *ptr_; } #endif protected: Type *_pObject; }; #endif aplus-fsf-4.22/src/MSTypes/MSRandom.H0000644000265000001440000000352510772770462012763 #ifndef MSRandomHEADER #define MSRandomHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// // The MSRandom class defines a psedo-random number generator // that uses the linear congruential method (rand,srand). #include #include // Most applications should NOT have to create their own random number generators. // Instead, they should use the default generator, accessible via MSRandom::defaultGen() // method. To preserve backward compatibility with MStk version <=2.4, the old MSRandom // interface, where the application would create an MSRandom object whenever it needed // to generate random numbers, is still supported. However, under the covers this will // dispatch everything to the global (default) generator, unless the application sets // the seed explicitly (either through the constructor or through seed() method), in // which case the MSRandom object will switch to its private generator. class MSTypesExport MSRandom { protected: unsigned long _seed; MSBoolean _useDefaultGen; public: MSRandom(void); MSRandom(unsigned long seed_); ~MSRandom(void); inline unsigned long seed(void) const; void seed(unsigned long seed_); // iterator - get next random number between 0 and limit-1 unsigned long random(unsigned long limit_); inline unsigned long operator() (unsigned long limit_); static MSRandom & defaultGen(void); }; inline unsigned long MSRandom::seed(void) const { return (_useDefaultGen==MSTrue) ? defaultGen().seed() : _seed; } inline unsigned long MSRandom::operator() (unsigned long limit_) { return random(limit_); } #endif //MSRandomHEADER aplus-fsf-4.22/src/MSTypes/MSRange.H0000644000265000001440000000360310772770462012574 #ifndef MSRangeHEADER #define MSRangeHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include //for size_t #if HAVE_IOSTREAM #include // #include using namespace std; #else class ostream; #endif class MSTypesExport MSRange { protected: unsigned _min; unsigned _max; unsigned _length; public: MSRange(void) : _min(0),_max(0),_length(0) {} MSRange(const MSRange& aRange_) : _min(aRange_._min),_max(aRange_._max),_length(aRange_._length) {} MSRange(unsigned min_,unsigned max_) { range(min_,max_); } ~MSRange(void) {} unsigned min(void) const {return _min;} unsigned max(void) const {return _max;} unsigned length(void) const {return _length;} unsigned firstIndexOf(void) const {return _min;} unsigned lastIndexOf(void) const {return _max;} MSBoolean isValid(void) const {return MSBoolean(_length>0);} void range(unsigned min_,unsigned max_) { if (min_<=max_) _min=min_,_max=max_,_length=(max_-min_)+1; else _min=0,_max=0,_length=0; } void min(unsigned min_) {range(min_,_max);} void max(unsigned max_) {range(_min,max_);} MSRange& operator=(const MSRange& aRange_) { if (&aRange_!=this) _min=aRange_.min(),_max=aRange_.max(),_length=aRange_._length; return *this; } MSBoolean operator==(const MSRange& aRange_) { return MSBoolean(_min==aRange_.min()&&_max==aRange_.max()); } MSBoolean operator!=(const MSRange& aRange_) { return MSBoolean(_min!=aRange_.min()||_max!=aRange_.max()); } friend MSTypesExport ostream& operator<<(ostream&,const MSRange&); }; #endif aplus-fsf-4.22/src/MSTypes/MSRate.H0000644000265000001440000000666210772770462012443 #ifndef MSRateHEADER #define MSRateHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include class MSFormat; class MSTypesExport MSRate: public MSFloat { public: enum MSRateFormat { Decimal0=MSFloat::Decimal0, // 1234 Decimal1=MSFloat::Decimal1, // 1234.2 Decimal2=MSFloat::Decimal2, // 1234.17 Decimal3=MSFloat::Decimal3, // 1234.171 Decimal4=MSFloat::Decimal4, // 1234.1712 Decimal5=MSFloat::Decimal5, // 1234.17123 Decimal6=MSFloat::Decimal6, // 1234.171234 Decimal7=MSFloat::Decimal7, // 1234.1712345 Decimal8=MSFloat::Decimal8, // 1234.17123456 CommaDecimal0=MSFloat::CommaDecimal0, // 1,234 CommaDecimal1=MSFloat::CommaDecimal1, // 1,234.2 CommaDecimal2=MSFloat::CommaDecimal2, // 1,234.17 CommaDecimal3=MSFloat::CommaDecimal3, // 1,234.171 CommaDecimal4=MSFloat::CommaDecimal4, // 1,234.1712 CommaDecimal5=MSFloat::CommaDecimal5, // 1,234.17123 CommaDecimal6=MSFloat::CommaDecimal6, // 1,234.171234 CommaDecimal7=MSFloat::CommaDecimal7, // 1,234.1712345 CommaDecimal8=MSFloat::CommaDecimal8, // 1,234.17123456 Percent0=400, // 17% Percent1=401, // 17.1% Percent2=402, // 17.12% Percent3=403, // 17.123% Percent4=404, // 17.1234% Percent5=405, // 17.12345% BasisPoint=406 // 17bp }; MSRate(void) {} MSRate(const MSRate& aRate_) : MSFloat(aRate_) {} MSRate(const MSFloat& f_) : MSFloat(f_) {} MSRate(const MSInt& i_) : MSFloat(i_) {} MSRate(int i_) : MSFloat(i_) {} MSRate(double d_) : MSFloat(d_) {} ~MSRate(void); virtual MSString asString(void) const; virtual MSString asDebugInfo(void) const; virtual MSString className(void) const; virtual const MSSymbol& type(void) const; virtual MSModel *clone(void) const; virtual MSModel *create(void) const; virtual void assign(const MSModel&); virtual long compare(const MSModel&) const; static const MSSymbol& symbol(void); // On entry, if the string has a trailing percent sign the number is // divided by 100 and then stored; if the string has a trailing bp // (for "basis points"), the number is divided by 10000 and then stored; // otherwise, the number itself is stored. For example, // entering ".0725", "7.25%", and "725bp" format you the same thing. virtual MSError::ErrorStatus set(const char*); MSError::ErrorStatus set(const MSString*); MSError::ErrorStatus set(const MSString&); MSError::ErrorStatus set(double); const char *format(MSString*) const; const char *format(MSString&) const; const char *format(MSString*,MSRateFormat) const; const char *format(MSString&,MSRateFormat) const; const char *format(MSString*,const MSFormat&) const; const char *format(MSString&,const MSFormat&) const; friend MSTypesExport ostream& operator<<(ostream&,const MSRate&); operator double() const { return _real; } }; inline long compare(const MSRate& aRate_,const MSRate& bRate_) { return compare((MSFloat&)aRate_,(MSFloat&)bRate_); } // nothing in this file as 25 Feb 96 - JMB // #ifndef MS_NO_INLINES // #ifndef MSRateINLINES // #include // #endif // #endif #endif aplus-fsf-4.22/src/MSTypes/MSRateVector.H0000644000265000001440000000325610772770462013622 #ifndef MSRateVectorHEADER #define MSRateVectorHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include typedef MSTypeVector MSRateVector; inline MSRate msBadData(const MSRate&) { return MSRate(0.0); } // We provide provide explicit "do_not_instantiate" pragmas here to avoid instantiation complications in // MStk applications. // #if !defined(__MSTYPESLIBRARY_BUILD__) && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma do_not_instantiate MSVectorModelAllocator #pragma do_not_instantiate MSTypeData > #pragma do_not_instantiate MSBaseVector > #pragma do_not_instantiate MSBaseVectorOps > #pragma do_not_instantiate MSObjectVector #pragma do_not_instantiate MSVectorElement #pragma do_not_instantiate MSTypeVector #pragma do_not_instantiate ostream& operator<<(ostream&, const MSBaseVector >&) #pragma do_not_instantiate unsigned int msMergeSortUp(unsigned int, MSRate *, unsigned int *,unsigned int, unsigned int) #pragma do_not_instantiate unsigned int msMergeSortDown(unsigned int, MSRate *, unsigned int *,unsigned int, unsigned int) #endif // !__MSTYPESLIBRARY_BUILD__ && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #endif //MSRateVectorHEADER aplus-fsf-4.22/src/MSTypes/MSRefCount.H0000644000265000001440000000120410772770462013260 #ifndef MSRefCountHEADER #define MSRefCountHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSTypesExport MSRefCount { private: int _count; public: MSRefCount(void) { _count=0; } virtual ~MSRefCount(void); int count(void) const { return _count; } void increment(void) { _count++; } void decrement(void) { if (--_count==0) delete this; } }; #endif aplus-fsf-4.22/src/MSTypes/MSRegexp.H0000644000265000001440000000554010772770463012775 #ifndef MSRegexpHEADER #define MSRegexpHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include // Definitions etc. for regexp(3) routines. // Caveat: this is V8 regexp(3) [actually, a reimplementation thereof], // not the System V one. #define NSUBEXP 10 struct regexp; class MSTypesExport MSRegexp { public: enum CaseFlag {ConsiderCase=0,IgnoreCase=1}; private: class MSTypesExport RegexpData : public MSRefCount { public: RegexpData(const char *pattern_,CaseFlag caseFlag_=ConsiderCase); ~RegexpData(void); regexp *_regularExpression; char *_pattern; char *_target; // only used as a base address to get an offset MSBoolean _status; CaseFlag _caseFlag; int _numGroups; regexp *regularExpression(void) const {return _regularExpression;} MSBoolean isMatch(const char *pattern_); MSRange groupRange(unsigned) const; void strlwr(char *pString_) const {while(*pString_) {*pString_=tolower(*pString_),pString_++;}} }; RegexpData *_regexpData; RegexpData *regexpData(void) const {return _regexpData;} CaseFlag caseFlag(void) const {return _regexpData->_caseFlag;} void init(const char *pattern_,CaseFlag); public: MSRegexp(void); MSRegexp(const char *pattern_,CaseFlag caseFlag_=ConsiderCase); MSRegexp(const MSRegexp&); ~MSRegexp(void); MSBoolean match(const char *target_); // old API, replaced by isMatch MSBoolean isMatch(const char *target_); MSBoolean isCaseSensitive(void) const {return MSBoolean(caseFlag()==ConsiderCase);} const char *pattern(void) const {return _regexpData->_pattern;} MSBoolean isValid(void) const {return _regexpData->_status;} unsigned numberOfGroups(void) const {return _regexpData->_numGroups;} MSRange groupRange(unsigned index_) const {return _regexpData->groupRange(index_);} MSRegexp& operator=(const MSRegexp&); friend MSTypesExport MSBoolean operator==(MSRegexp& aRegexp_,const char *target_) { return aRegexp_.isMatch(target_); } friend MSTypesExport MSBoolean operator==(const char *target_,MSRegexp& aRegexp_) { return aRegexp_.isMatch(target_); } friend MSTypesExport MSBoolean operator!=(MSRegexp& aRegexp_,const char *target_) { return (aRegexp_.isMatch(target_)==MSTrue)?MSFalse:MSTrue; } friend MSTypesExport MSBoolean operator!=(const char *target_,MSRegexp& aRegexp_) { return (aRegexp_.isMatch(target_)==MSTrue)?MSFalse:MSTrue; } }; #endif aplus-fsf-4.22/src/MSTypes/MSResourceCodeSet.H0000644000265000001440000000223310772770463014575 #ifndef MSResourceCodeSetHEADER #define MSResourceCodeSetHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #if HAVE_IOSTREAM #include // #include using namespace std; #else class ostream; #endif class MSTypesExport MSResourceCodeSet { public: MSResourceCodeSet(); MSResourceCodeSet(const MSResourceCodeSet &); MSResourceCodeSet(const MSResourceCode &); ~MSResourceCodeSet(); MSBoolean add(const MSResourceCode &); void removeAll(void); const MSResourceCode& elementAt(unsigned int ) const; MSResourceCodeSet & operator=(const MSResourceCodeSet &) ; MSBoolean isEmpty(void) const; unsigned int numberOfElements(void) const; friend MSTypesExport ostream& operator<<(ostream&,const MSResourceCodeSet&); MSString asDebugInfo(void) const; private: MSStringVector _stringVector; }; #endif aplus-fsf-4.22/src/MSTypes/MSScalarModel.H0000644000265000001440000000153010772770463013724 #ifndef MSScalarModelHEADER #define MSScalarModelHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSTypesExport MSScalarModel : public MSModel { public: MSScalarModel(void) {} virtual ~MSScalarModel(void); protected: void changed(void); void sendNullEvent(void); }; inline void MSScalarModel::sendNullEvent(void) { MSNullEvent aEvent; sendEvent((MSEvent&)aEvent); } inline void MSScalarModel::changed(void) { if (receiverList()!=0) sendNullEvent(); } #ifndef MSStringHEADER #include #endif #endif aplus-fsf-4.22/src/MSTypes/MSSimpleString.H0000644000265000001440000000777010772770463014172 #ifndef MSSimpleStringHEADER #define MSSimpleStringHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #if HAVE_IOSTREAM #include // #include using namespace std; #else class ostream; #endif class MSTypesExport MSSimpleString { public: MSSimpleString(void); MSSimpleString(const char *); MSSimpleString(const MSSimpleString&); MSSimpleString(const MSSimpleString&,const MSSimpleString&); ~MSSimpleString(void); operator const char*() const; const char *string(void) const; unsigned length(void) const; MSSimpleString& operator=(const MSSimpleString&); MSSimpleString& operator=(const char *); MSSimpleString& operator=(char); MSSimpleString& operator<<=(const MSSimpleString&); MSSimpleString& operator<<=(const char *); MSSimpleString& operator<<=(char); MSSimpleString& operator<< (const MSSimpleString&); MSSimpleString& operator<< (const char *); MSSimpleString& operator<< (char); MSSimpleString& operator+=(const MSSimpleString&); MSSimpleString& operator+=(const char *); MSSimpleString& operator+=(char); MSBoolean operator==(const MSSimpleString&) const; MSBoolean operator!=(const MSSimpleString&) const; char operator[](unsigned) const; char& operator[](unsigned); char operator()(unsigned) const; char& operator()(unsigned); friend MSTypesExport MSSimpleString operator+(const MSSimpleString&,const MSSimpleString&); friend MSTypesExport MSSimpleString operator+(const MSSimpleString&,const char *); friend MSTypesExport MSSimpleString operator+(const char *,const MSSimpleString&); friend MSTypesExport MSSimpleString operator+(const MSSimpleString&,char); friend MSTypesExport MSSimpleString operator+(char,const MSSimpleString&); friend MSTypesExport ostream& operator<<(ostream&,const MSSimpleString&); protected: static char _badData; // used as return value for index errors char *_string; unsigned _length; void indexError(unsigned,unsigned) const; void duplicate(const char *); void string(const char *); MSSimpleString& catenate(const char *); private: // special private constructors for catenation - take advantage of // RVO - return value optimization - see 12.1c of the ARM MSSimpleString(const MSSimpleString&,const char *); MSSimpleString(const char *,const MSSimpleString&); MSSimpleString(const MSSimpleString&,char); MSSimpleString(char,const MSSimpleString&); }; inline MSSimpleString::operator const char*() const { return _string; } inline const char *MSSimpleString::string(void) const { return _string; } inline unsigned MSSimpleString::length(void) const { return _length; } inline char MSSimpleString::operator[](unsigned i_) const { return (i_<_length)?_string[i_]:(indexError(i_,length()),_badData); } inline char& MSSimpleString::operator[](unsigned i_) { if (i_<_length) return _string[i_]; else return (indexError(i_,length()),_badData); } inline char MSSimpleString::operator()(unsigned i_) const { if (i_<_length) return _string[i_]; else return (indexError(i_,length()),_badData); } inline char& MSSimpleString::operator()(unsigned i_) { if (i_<_length) return _string[i_]; else return (indexError(i_,length()),_badData); } inline MSSimpleString& MSSimpleString::operator<<=(const MSSimpleString& aString) { return catenate(aString.string()); } inline MSSimpleString& MSSimpleString::operator<<=(const char *pString) { return catenate(pString); } inline MSSimpleString& MSSimpleString::operator+=(const MSSimpleString& aString) { return *this<<=aString; } inline MSSimpleString& MSSimpleString::operator+=(const char *pString) { return *this<<=pString; } inline MSSimpleString& MSSimpleString::operator+=(char aChar) { return *this<<=aChar; } #endif aplus-fsf-4.22/src/MSTypes/MSSpecializedVector.H0000644000265000001440000000072610772770463015163 #ifndef MSSpecializedVectorHEADER #define MSSpecializedVectorHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #endif aplus-fsf-4.22/src/MSTypes/MSSplineInterpolater.H0000644000265000001440000000220210772770463015356 #ifndef MSSplineInterpolaterHEADER #define MSSplineInterpolaterHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #if defined(MS_NEED_IMPLEMENTATION_PRAGMA) #pragma implementation("MSSplineInterpolater.C") #endif // This class will do efficient cubic spline interpolation given a single x-value // or a vector of x-values. The interpolation on a vector of x-values utilizes a // sequential search and assumes that the values are in sort order. template class MSSplineInterpolater : public MSCurveInterpolater { public: MSSplineInterpolater(MSCurve *curve_); MSSplineInterpolater(MSCurve& curve_); virtual ~MSSplineInterpolater(); virtual Y interpolate(const X& xValue_) const; virtual MSTypeVector interpolate(const MSTypeVector&) const; private: void initY2(void); double *_y2; }; #endif aplus-fsf-4.22/src/MSTypes/MSStack.H0000644000265000001440000000100710772770463012602 #ifndef MSStackHEADER #define MSStackHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSTypesExport MSStack : public MSNodeItem { public: MSStack() {}; ~MSStack(void) {} void push(MSNodeItem*); MSNodeItem *pop(void); }; #endif aplus-fsf-4.22/src/MSTypes/MSStandardOps.H0000644000265000001440000000644510772770463013772 #ifndef MSStandardOpsHEADER #define MSStandardOpsHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #ifndef MSDefinesHEADER #include #endif /*************************************************************************************/ // Global template functions from IBM collection classes. // Redefined here with different names to remove conflict and dependancy with ccl. /*************************************************************************************/ // compareElements - forwarding compare to msCompare using msElementForOps // compare - comparing two elements using ccl style // elementForOps - default implementation, specialized by pointer classes. /*************************************************************************************/ template inline long compareElements(const Type & aType_, const Type & bType_) { #if defined(MS_CONST_ELEMENT_FOR_OPS_BUG) return compare(elementForOps((Type&)aType_),elementForOps((Type&)bType_)); #else return compare(elementForOps(aType_),elementForOps(bType_)); #endif } #if !defined(MS_GLOBAL_COMPARE) #define MS_GLOBAL_COMPARE 1 // ordering relation template < class Element > inline long compare (Element const& e1, Element const& e2) { if (e1 < e2) return -1; else if (e2 < e1) return 1; else return 0; } inline long compare (int e1, int e2) { return e1 - e2; } inline long compare (char const* e1, char const* e2) { return strcmp (e1, e2); } #endif // MS_GLOBAL_COMPARE #if !defined(MS_ELEMENT_FOR_OPS) #define MS_ELEMENT_FOR_OPS 1 #if !defined(MS_NO_NONCONST_ELEMENT_FOR_OPS) template < class Element > inline Element& elementForOps (Element& e) { return e; } #endif // this function is redundant for ANSI C++ compliant compilers #if defined(MS_NEED_CONST_ELEMENT_FOR_OPS) template < class Element > inline Element const& elementForOps (Element const& e) { return e; } #endif #if defined(MS_SPECIALIZE_ELEMENT_FOR_OPS) #define DECLARE_ELEMENT_FOR_OPS(Pointer,Type) \ inline const Type & elementForOps (Pointer const & ptr_) { return *(Type*)ptr_; } \ inline Type & elementForOps (Pointer & ptr_) { return *(Type*)ptr_; } #else #define DECLARE_ELEMENT_FOR_OPS(Pointer,Type) #endif #if defined (MS_SPECIALIZE_ELEMENT_FOR_OPS_TYPE) #define DECLARE_ELEMENT_FOR_OPS_TYPE(Type) \ inline Type const & elementForOps (Type const& ptr_) { return ptr_; } \ inline Type & elementForOps (Type& ptr_) { return ptr_; } DECLARE_ELEMENT_FOR_OPS_TYPE(int) DECLARE_ELEMENT_FOR_OPS_TYPE(float) DECLARE_ELEMENT_FOR_OPS_TYPE(double) DECLARE_ELEMENT_FOR_OPS_TYPE(long) DECLARE_ELEMENT_FOR_OPS_TYPE(short) DECLARE_ELEMENT_FOR_OPS_TYPE(char) DECLARE_ELEMENT_FOR_OPS_TYPE(unsigned int) DECLARE_ELEMENT_FOR_OPS_TYPE(unsigned short) DECLARE_ELEMENT_FOR_OPS_TYPE(unsigned long) DECLARE_ELEMENT_FOR_OPS_TYPE(unsigned char) #else #define DECLARE_ELEMENT_FOR_OPS_TYPE(Type) #endif #endif // MS_ELEMENT_FOR_OPS #ifndef forCursor #define forCursor(c) for ((c).setToFirst (); (c).isValid (); (c).setToNext ()) #endif #endif //MSStandardOpsHEADER aplus-fsf-4.22/src/MSTypes/MSStopWatch.H0000644000265000001440000000401010772770463013446 #ifndef MSStopWatchHEADER #define MSStopWatchHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MSDefinesHEADER #include #endif #include #include #if HAVE_IOSTREAM #include // #include using namespace std; #else class ostream; #endif class MSTypesExport MSTimeStat { public: int _user; int _sys; int _elapsed; MSTimeStat(void) {_user=0;_sys=0;_elapsed=0;} MSTimeStat(const MSTimeStat& a_) {_user=a_.user();_sys=a_.sys();_elapsed=a_.elapsed();} MSTimeStat(int user_,int sys_,int elapsed_) {_user=user_;_sys=sys_;_elapsed=elapsed_;} ~MSTimeStat(void) {} int user(void) const { return _user; } int sys(void) const { return _sys; } int elapsed(void) const { return _elapsed; } void user(int user_) { _user=user_; } void sys(int sys_) { _sys=sys_; } void elapsed(int elapsed_){ _elapsed=elapsed_; } void set(int user_,int sys_,int elapsed_) {_user=user_;_sys=sys_;_elapsed=elapsed_;} MSTimeStat& operator=(const MSTimeStat&); friend MSTypesExport MSTimeStat operator-(const MSTimeStat&,const MSTimeStat&); friend MSTypesExport ostream& operator<<(ostream& os_,const MSTimeStat& ts_); }; class MSTypesExport MSStopWatch { public: MSTimeStat _startStat; MSTimeStat _stopStat; MSStopWatch(void) {} ~MSStopWatch(void) {} void time(MSTimeStat&); void start(void) { time(_startStat); } void stop(void) { time(_stopStat); } const MSTimeStat& startStat(void) const { return _startStat; } const MSTimeStat& stopStat(void) const { return _stopStat; } int normalize(struct timeval tv_) { return tv_.tv_sec*1000+10*(tv_.tv_usec/10000); } friend MSTypesExport ostream& operator<<(ostream& os_,const MSStopWatch& time_); }; #endif aplus-fsf-4.22/src/MSTypes/MSString.H0000644000265000001440000015035010772770463013011 #ifndef MSStringHEADER #define MSStringHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MSStringEnumHEADER #include #endif #ifndef MSScalarModelHEADER #include #endif #include extern "C" { #include #include #include #include } class MSStringTest; class MSStringBuffer; class CharPick; #if HAVE_IOSTREAM #include // #include using namespace std; #else class ostream; class istream; #endif class MSSymbol; class MSFormat; class MSTypesExport MSString : public MSScalarModel { /******************************************************************************* * Objects of the MSString class are arrays of characters. * * * * MSStrings provide the following function beyond that available from the * * standard C char* arrays and the string.h library functions: * * o No restrictions on string contents. In other words, strings can * * contain null characters. * * o Automatic conversion from and to numeric types * * o Automatic deletion of string buffer when the MSString is destroyed * * o Full support for the following: * * - All comparison operators * * - All bitwise operators * * - Concatenation using the more natural "+" operator. * * o String data testing, such as for characters, digits, and hexadecimal * * digits * * o A full complement of the following: * * - String manipulation functions, such as center, left and right * * justification, stripping of leading and trailing characters, * * substring deletion, and insertion of strings * * - Corresponding string manipulation functions that return a new * * MSString rather than modifying the receiver * * - String searching functions, such as index of string and last * * index of string. * * o Word manipulation, such as index of word and search for word phrase * * o Support for mixed strings that contain both single-byte character set * * (SBCS) and double-byte character set (DBCS) characters. * * * * When a program using MSStrings is run on OS/2J, the MSString objects * * support DBCS characters within the string contents. The various * * MSString searching functions will not accidentally match an SBCS * * character with the second byte of a DBCS character that happens to * * have the same value. Also, MSString functions that modify MSStrings, * * such as subString, remove, and translate, will never separate two * * bytes of a DBCS character. If one of the two bytes of a DBCS * * character is removed, the remaining byte will be replaced with the * * appropriate pad character (if the function performing the change has * * one), or a blank. * * * * Care must be taken with MSStrings that contain DBCS data to ensure that * * the contents are not altered in such a way as to corrupt the data. * * For example, the statement: * * * * aString[ n ]= 'x'; * * * * would be in error if the nth character of the MSString was the first * * or second byte of a DBCS character. * *******************************************************************************/ public: /*------------------------- Constructors/Destructor ---------------------------- | You can construct instances of this class in the following ways: | | - Construct a null string. | | - Construct a string with the ASCII representation of a given numeric | | value, supporting all flavors of int and double. | | - Construct a string with a copy of the given character data, supporting | | ASCIIZ strings, characters, and MSStrings. The character data passed | | will be converted to its ASCII representation. | | - Construct a string with contents that consist of copies of up to three | | buffers of arbitrary data (void*). Optionally, only the length need | | be provided, in which case the MSString contents are initialized to a | | given pad character. The default is a blank. | ------------------------------------------------------------------------------*/ class MSTypesExport CharPick { private: friend class MSString; MSString *_pString; unsigned _index; public: CharPick(MSString *pString,unsigned index); CharPick(const CharPick& index); CharPick& operator=(char aChar); operator char() const; MSString *string(void) const; char value(void) const; unsigned index(void) const; }; MSString(); MSString(const MSString& aString); MSString(int); MSString(unsigned); MSString(long); MSString(unsigned long); MSString(short); MSString(unsigned short); MSString(double); MSString(char); MSString(unsigned char); MSString(signed char); MSString(const char *); MSString(const unsigned char *); MSString(const signed char *); MSString(const void *pBuffer1,unsigned lenBuffer1,char padCharacter=' '); MSString(const void *pBuffer1,unsigned lenBuffer1, const void *pBuffer2,unsigned lenBuffer2,char padCharacter=' '); MSString(const void *pBuffer1,unsigned lenBuffer1, const void *pBuffer2,unsigned lenBuffer2, const void *pBuffer3,unsigned lenBuffer3,char padCharacter=' '); ~MSString(); /*-------------------------------- Stream I/O ---------------------------------- The following functions provide for reading and writing MSStrings from and to standard C++ streams: operator << - Puts an MSString's contents to an output stream. operator >> - Puts the next whitespace-delimited word from an input stream into an MSString. lineFrom - Static function that returns the next line from the argument input stream. This function accepts an optional line delimiter, which defaults to \n; the resulting MSString contains the characters up to the next occurrence of the delimiter. The delimiter character is skipped. ------------------------------------------------------------------------------*/ friend MSTypesExport ostream &operator<<(ostream &aStream,const MSString &aString); friend MSTypesExport istream &operator>>(istream &aStream,MSString &aString); static MSString lineFrom(istream &aStream,char delim='\n'); /*--------------------------------- Testing ------------------------------------ | The following functions test the characters that comprise the string: | | isAlphanumeric - MSTrue if and only if all characters are in | | {'A'-'Z','a'-'z','0'-'9'}. | | isAlphabetic - MSTrue if and only if all characters are in | | {'A'-'Z','a'-'z'}. | | isASCII - MSTrue if and only if all characters are in {0x00-0x7F}.| | isControl - MSTrue if and only if all characters are in | | {0x00-0x1F,0x7F}. | | isDigits - MSTrue if and only if all characters are in {'0'-'9'}. | | isGraphics - MSTrue if and only if all characters are in {0x21-0x7E}.| | isHexDigits - MSTrue if and only if all characters are in | | {'0'-'9','A'-'F','a'-'f'}. | | isBinaryDigits - MSTrue if and only if all characters are either '0' or | | '1'. | | isLowerCase - MSTrue if and only if all characters are in {'a'-'z'}. | | isPrintable - MSTrue if and only if all characters are in {0x20-0x7E}.| | isPunctuation - MSTrue if and only if none of the characters are | | whitespace, control characters, or alphanumeric. | | isWhiteSpace - MSTrue if and only if all characters are in | | {0x09-0x0D,0x20}. | | isUpperCase - MSTrue if and only if all characters are in {'A'-'Z'}. | | isDBCS - MSTrue if and only if all characters are DBCS | | (double-byte). | | isSBCS - MSTrue if and only if all characters are SBCS | | (single-byte). | | isValidDBCS - MSTrue if and only if no DBCS characters have a 0 | | second byte. | | includesDBCS - MSTrue if and only if any characters are DBCS | | (double-byte). | | includesSBCS - MSTrue if and only if any characters are SBCS | | (single-byte). | | isLike - MSTrue if and only if the receiver matches the argument | | pattern, which can contain wildcard characters. | | isAbbreviationFor - MSTrue if the receiver is a valid abbreviation of the | | argument string. | | includes - MSTrue if the receiver contains the argument search | | string. | ------------------------------------------------------------------------------*/ MSBoolean isAlphanumeric() const; MSBoolean isAlphabetic() const; MSBoolean isASCII() const; MSBoolean isControl() const; MSBoolean isDigits() const; MSBoolean isGraphics() const; MSBoolean isHexDigits() const; MSBoolean isBinaryDigits() const; MSBoolean isLowerCase() const; MSBoolean isPrintable() const; MSBoolean isPunctuation() const; MSBoolean isUpperCase() const; MSBoolean isWhiteSpace() const; MSBoolean isMBCS() const; MSBoolean isDBCS() const; MSBoolean isSBCS() const; MSBoolean isValidMBCS() const; MSBoolean isValidDBCS() const; MSBoolean includesMBCS() const; MSBoolean includesDBCS() const; MSBoolean includesSBCS() const; MSBoolean isLike(const MSString &aPattern,char zeroOrMore='*',char anyChar='?') const; MSBoolean isLike(const char *pPattern,char zeroOrMore='*',char anyChar='?') const; MSBoolean isAbbreviationFor(const MSString &fullString,unsigned minAbbrevLength=0) const; MSBoolean isAbbreviationFor(const char *pFullString,unsigned minAbbrevLength=0) const; MSBoolean includes(const MSString &aString) const; MSBoolean includes(const char *pString) const; MSBoolean includes(char aChar) const; MSBoolean includes(const MSStringTest &aTest) const; /*------------------------------- Comparison ----------------------------------- | All MSBoolean operators are defined for strings. The following functions | | are overloaded so that MSStrings can be compared to objects of type char*, | | as well as to other MSStrings. | | operator! - is this a null string | | operator == - MSTrue if and only if the strings are identical. | | operator != - MSTrue if and only if the strings are not identical. | | operator < - MSTrue if and only if the first string is less than the | | second, applying the standard collating scheme (memcmp). | | operator > - Equivalent to '!(string1 <= string2)'. | | operator <= - Equivalent to '(string1 < string2) || (string1== string2)'. | | operator >= - Equivalent to '!(string1 < string2)'. | ------------------------------------------------------------------------------*/ MSBoolean operator!() const; long compare(const MSString&) const; inline friend MSTypesExport unsigned long hash(const MSString&,unsigned long size_); friend MSTypesExport MSBoolean operator==(const MSString &string1,const MSString &string2); friend MSTypesExport MSBoolean operator==(const MSString &string1,const char *pString2); friend MSTypesExport MSBoolean operator==(const char *pString1,const MSString &string2); friend MSTypesExport MSBoolean operator!=(const MSString &string1,const MSString &string2); friend MSTypesExport MSBoolean operator!=(const MSString &string1,const char *pString2); friend MSTypesExport MSBoolean operator!=(const char *pString1,const MSString &string2); friend MSTypesExport MSBoolean operator<(const MSString &string1,const MSString &string2); friend MSTypesExport MSBoolean operator<(const MSString &string1,const char *pString2); friend MSTypesExport MSBoolean operator<(const char *pString1,const MSString &string2); friend MSTypesExport MSBoolean operator<=(const MSString &string1,const MSString &string2); friend MSTypesExport MSBoolean operator<=(const MSString &string1,const char *pString2); friend MSTypesExport MSBoolean operator<=(const char *pString1,const MSString &string2); friend MSTypesExport MSBoolean operator>(const MSString &string1,const MSString &string2); friend MSTypesExport MSBoolean operator>(const MSString &string1,const char *pString2); friend MSTypesExport MSBoolean operator>(const char *pString1,const MSString &string2); friend MSTypesExport MSBoolean operator>=(const MSString &string1,const MSString &string2); friend MSTypesExport MSBoolean operator>=(const MSString &string1,const char *pString2); friend MSTypesExport MSBoolean operator>=(const char *pString1,const MSString &string2); /*------------------------------- Conversion ----------------------------------- | The following functions permit the conversion of a string to various other | | data types. The types supported are the same set as are supported by the | | MSString constructors: | | | | operator const char* - Returns a char* pointer to the string's | | contents. | | operator const unsigned char* - Returns an unsigned char* pointer to the | | string's contents. | | asString - Returns the string itself | | asDebugInfo - Returns information about the MSString's | | internal representation that can be used for | | debugging. | | asInt - Returns, as a long integer, the number that the | | string represents. | | asUnsigned - Returns, as an unsigned long, the number that | | the string represents. | | asBoolean - Returns, as an MSBoolean, the boolean that | | the string represents - case independent. | | asDouble - Returns, as a double, the number that the | | string represents. | | | | In addition, a complete set of functions is provided for converting a | | String from any of the following formats to another format: | | b - A string of binary digits ('0' and '1'). | | c - A normal string of characters. | | d - A string of decimal digits ('0' through '9'). | | x - A string of hexadecimal digits ('0' through '9' and 'a/A' through | | 'f/F'). | | | | The following functions work if isBinaryDigits()== MSTrue; if not, they | | return a null string: | | b2c - Changes '01' to '\x01', '00110011' to '3'. | | b2d - Changes '00011001' to '25', '0001001000110100' to '4660'. | | b2x - Changes '00011011' to '1b', '10001001000110100' to '11234'. | | | | The following functions always work: | | c2b - Changes 'a' to '01010001', '12' to '11000100110010'. | | c2d - Changes 'a' to '97', 'ab' to '24930'. | | c2x - Changes 'a' to '61', 'ab' to '6162'. | | | | The following functions work if isDigits()== MSTrue; if not, they return a | | null string: | | d2b - Changes '12' to '1100', '123' to '1111011'. | | d2c - Changes '12' to '\x0c', '56' to '8'. | | d2x - Changes '12' to 'c', '123' to '7b'. | | | | The following functions work if isHexDigits()== MSTrue; if not, they return | | a null string: | | x2b - Changes 'a1c' to '101000011100', 'f3' to '11110011'. | | x2c - Changes '8' to '\x08', '31393932' to '1992'. | | x2d - Changes 'a1c' to '2588', '10000' to '65536'. | | | | Static functions by the same name can be applied to a String to return the | | modified string, without changing the argument String. These functions | | are used much like the similar REXX functions. For example: | | | | aString.c2b(); // Changes aString. | | String binaryDigits= MSString::c2b( aString ); // Leaves aString alone. | ------------------------------------------------------------------------------*/ operator const char*() const; operator const unsigned char*() const; virtual MSString asString(void) const; virtual MSString asDebugInfo(void) const; virtual MSString asMSF(void) const; long asInt(void) const; unsigned long asUnsigned(void) const; MSBoolean asBoolean(void) const; double asDouble(void) const; MSString &decodeMSF(void); MSString &encodeMSF(void); MSString &b2c(); MSString &b2d(); MSString &b2x(); MSString &c2b(); MSString &c2d(); MSString &c2x(); MSString &d2b(); MSString &d2c(); MSString &d2x(); MSString &x2b(); MSString &x2c(); MSString &x2d(); static MSString b2c(const MSString &aString); static MSString b2d(const MSString &aString); static MSString b2x(const MSString &aString); static MSString c2b(const MSString &aString); static MSString c2d(const MSString &aString); static MSString c2x(const MSString &aString); static MSString d2b(const MSString &aString); static MSString d2c(const MSString &aString); static MSString d2x(const MSString &aString); static MSString x2b(const MSString &aString); static MSString x2c(const MSString &aString); static MSString x2d(const MSString &aString); const char *format(MSString*) const; const char *format(MSString&) const; const char *format(MSString*,const MSFormat&) const; const char *format(MSString&,const MSFormat&) const; /*------------------------- Manipulation Operators ----------------------------- | The following functions allow the string's contents to be manipulated. | | All are overloaded so that standard C "strings" can be used efficiently, | | without constructing an equivalent String first. | | operator = - Replaces the contents of the string. | | operator ~ - Returns bitwise negation (one's complement). | | operator + - Concatenates two strings. | | operator += - Concatenates and replaces. | | operator << - Concatenates rhs to lhs - treats lhs as a sink. | | operator <<= - Concatenates and replaces. | | operator & - Performs bitwise AND. | | operator &= - Performs bitwise AND and replaces the receiver. | | operator | - Performs bitwise OR. | | operator |= - Performs bitwise OR and replaces the receiver. | | operator ^ - Performs bitwise XOR. | | operator ^= - Performs bitwise XOR and replaces the receiver. | ------------------------------------------------------------------------------*/ MSString &operator=(const MSString &aString); MSString &operator=(const char *pString); MSString operator~() const; MSString operator+(const MSString &aString) const; MSString operator+(const char *pString) const; MSString operator+(char aChar) const; MSString &operator+=(const MSString &aString); MSString &operator+=(const char *pString); MSString &operator+=(char aChar); MSString &operator<<=(const MSString &aString); MSString &operator<<=(const char *pString); MSString &operator<<=(char aChar); MSString &operator<<(const MSString &aString); MSString &operator<<(const char *pString); MSString &operator<<(char aChar); MSString operator&(const MSString &aString) const; MSString operator&(const char *pString) const; MSString &operator&=(const MSString &aString); MSString &operator&=(const char *pString); MSString operator|(const MSString &aString) const; MSString operator|(const char *pString) const; MSString &operator|=(const MSString &aString); MSString &operator|=(const char *pString); MSString operator^(const MSString &aString) const; MSString operator^(const char *pString) const; MSString &operator^=(const MSString &aString); MSString &operator^=(const char *pString); friend MSTypesExport MSString operator+(char aChar,const MSString &aString); friend MSTypesExport MSString operator+(const char *pString,const MSString &aString); friend MSTypesExport MSString operator&(const char *pString,const MSString &aString); friend MSTypesExport MSString operator|(const char *pString,const MSString &aString); friend MSTypesExport MSString operator^(const char *pString,const MSString &aString); /*------------------------------- Accessors ------------------------------------ | The following functions provide access to general information about the | | string: | | size - Returns the length of the string, not counting the | | terminating null character. | | length - Same as size. | | subString - Returns a given substring of the receiver. | | operator [] - Returns a reference to the nth character of the string. | | NOTE: The non-const version of this function extends the | | string if it is invoked with an index beyond the end. | | charType - Returns the type of the character at the argument index. | | first - Returns the first character in the string. | | last - Returns the last character in the string. | | className - Returns the string's class name. | | type - Returns the string's symbol type - virtual method. | | symbol - Returns the string's symbol type - static method. | | stringType - Returns the string's symbol type - static method. | ------------------------------------------------------------------------------*/ const char *string() const; unsigned size() const; unsigned length() const; MSString subString(unsigned startPos) const; MSString subString(unsigned startPos,unsigned length,char padCharacter=' ') const; MSString operator()(unsigned startPos,unsigned length) const; MSString operator()(unsigned startPos,unsigned length,char padCharacter) const; CharPick operator[](unsigned index); const char &operator[](unsigned index) const; CharPick operator[](int index); const char &operator[](int index) const; char operator()(unsigned index); char operator()(unsigned index) const; MSStringEnum::CharType charType(unsigned index) const; char first(void) const; char last(void) const; virtual MSString className(void) const; static const MSSymbol& symbol(void); static const MSSymbol& stringType(void); virtual const MSSymbol& type(void) const; virtual MSModel *clone(void) const; virtual MSModel *create(void) const; virtual void assign(const MSModel&); virtual long compare(const MSModel&) const; /*------------------------------- Searching ------------------------------------ | The following functions permit searching the string in various ways: | | indexOfAnyBut - Returns the index of the first character of the receiver | | that is not in the argument set of characters; length() is | | returned if there are no characters. Alternatively, it | | returns the index of the first character that fails the | | test prescribed by an argument MSStringTest object. | | indexOfAnyOf - Returns the index of the first character of the receiver | | that is a character in the argument set of characters; | | length() is returned if there are no characters. | | Alternatively, | | it returns the index of the first character that passes | | the test prescribed by an argument MSStringTest object. | | indexOf - Returns the index of the first occurrence of the | | argument string within the receiver; length() is returned | | if there are no occurrences. The argument can also be a | | single character or an MSStringTest object. | | occurrencesOf - Returns the number of occurrences of the argument | | MSString,char*,char,test. This is slower than indexOf if | | you just want a MSBoolean test. | | | | You can specify an optional index that indicates where in the String the | | search is to start. The default is to start at the beginning of the string. | | | | Each of the indexing functions also has a lastIndexOf version that returns | | the index of the last character in the receiver MSString that satisfies the | | search criteria. These functions accept an optional argument that | | specifies where the search is to begin. The default is to begin searching | | at the end of the string. Searching proceeds from right to left for these | | functions. | | | | lastIndexOf - Returns the index of the last occurrence of the | | argument. | | lastIndexOfAnyBut - Returns the index of the last character not in the | | argument. | | lastIndexOfAnyOf - Returns the index of the last character in the | | argument. | ------------------------------------------------------------------------------*/ unsigned indexOf(const MSString &aString,unsigned startPos=0) const; unsigned indexOf(const char *pString,unsigned startPos=0) const; unsigned indexOf(char aCharacter,unsigned startPos=0) const; unsigned indexOf(const MSStringTest &aTest,unsigned startPos=0) const; unsigned indexOfAnyBut(const MSString &validChars,unsigned startPos=0) const; unsigned indexOfAnyBut(const char *pValidChars,unsigned startPos=0) const; unsigned indexOfAnyBut(char validChar,unsigned startPos=0) const; unsigned indexOfAnyBut(const MSStringTest &aTest,unsigned startPos=0) const; unsigned indexOfAnyOf(const MSString &searchChars,unsigned startPos=0) const; unsigned indexOfAnyOf(const char *pSearchChars,unsigned startPos=0) const; unsigned indexOfAnyOf(char searchChar,unsigned startPos=0) const; unsigned indexOfAnyOf(const MSStringTest &aTest,unsigned startPos=0) const; unsigned lastIndexOf(const MSString &aString,unsigned startPos=UINT_MAX-1) const; unsigned lastIndexOf(const char *pString,unsigned startPos=UINT_MAX-1) const; unsigned lastIndexOf(char aCharacter,unsigned startPos=UINT_MAX-1) const; unsigned lastIndexOf(const MSStringTest &aTest,unsigned startPos=UINT_MAX-1) const; unsigned lastIndexOfAnyBut(const MSString &validChars,unsigned startPos=UINT_MAX-1) const; unsigned lastIndexOfAnyBut(const char *pValidChars,unsigned startPos=UINT_MAX-1) const; unsigned lastIndexOfAnyBut(char validChar,unsigned startPos=UINT_MAX-1) const; unsigned lastIndexOfAnyBut(const MSStringTest &aTest,unsigned startPos=UINT_MAX-1) const; unsigned lastIndexOfAnyOf(const MSString &searchChars,unsigned startPos=UINT_MAX-1) const; unsigned lastIndexOfAnyOf(const char *pSearchChars,unsigned startPos=UINT_MAX-1) const; unsigned lastIndexOfAnyOf(char searchChar,unsigned startPos=UINT_MAX-1) const; unsigned lastIndexOfAnyOf(const MSStringTest &aTest,unsigned startPos=UINT_MAX-1) const; unsigned occurrencesOf(const MSString &aString,unsigned startPos=0) const; unsigned occurrencesOf(const char *pString,unsigned startPos=0) const; unsigned occurrencesOf(char aCharacter,unsigned startPos=0) const; unsigned occurrencesOf(const MSStringTest &aTest,unsigned startPos=0) const; /*-------------------------------- Editing ------------------------------------- | The following functions are used to edit the string. All return a | | reference to the modified receiver. Many that are length related, such as | | center and leftJustify, accept a pad character that defaults to a blank. | | In all cases, argument strings can be specified as either objects of the | | MSString class or by using char*. | | | | Static functions by the same name can be applied to an MSString to obtain | | the modified MSString without affecting the argument. For example: | | | | aString.change('\t',' '); // Changes all tabs in aString to 3 blanks. | | MSString s= MSString::change(aString,'\t', ' '); // Leaves aString as is. | | | | center - Centers the receiver within a string of the | | specified length. | | change - Changes occurrences of an argument pattern to an | | argument replacement string. The number of changes | | to perform can be specified. The default is to | | change all occurrences of the pattern. You can | | also specify the position in the receiver at which | | to begin. | | copy - Replaces the receiver's contents with a given | | number of replications of itself. | | remove - Deletes the specified substring from the receiver. | | insert - Inserts an argument string at a given location. | | leftJustify - Left-justifies the receiver in a string of the | | specified length. | | lowerCase - Translates all upper case letters in the receiver | | to lower case. | | overlayWith - Replaces a given portion of the receiver's contents | | with an argument string. | | reverse - Reverses the receiver's contents. | | rightJustify - Right-justifies the receiver in a string of the | | specified length. | | strip - Strips both leading and trailing character or | | characters; the character or characters can be | | specified either as a single char, a String or | | char* array, or with an MSStringTest object. The | | default is whitespace. | | stripBlanks - Static function that strips both leading and | | trailing whitespace. This function is the static | | version of strip (renamed to avoid duplicate | | definition). | | stripLeading - Strips the leading character or characters. | | stripLeadingBlanks - Static version of stripLeading (renamed to avoid | | duplicate definition). | | stripTrailing - Strips the trailing character or characters. | | stripTrailingBlanks - Static version of stripTrailing (renamed to avoid | | duplicate definition). | | translate - Converts all of the receiver's characters that are | | in one argument string to the corresponding | | character in a second argument string. | | upperCase - Translates all lower case letters in the receiver | | to upper case. | ------------------------------------------------------------------------------*/ MSString ¢er(unsigned length,char padCharacter=' '); MSString &change(const MSString &inputString,const MSString &outputString, unsigned startPos=0,unsigned numChanges=UINT_MAX); MSString &change(const MSString &inputString,const char *pOutputString, unsigned startPos=0,unsigned numChanges=UINT_MAX); MSString &change(const char *pInputString,const MSString &outputString, unsigned startPos=0,unsigned numChanges=UINT_MAX); MSString &change(const char *pInputString,const char *pOutputString, unsigned startPos=0,unsigned numChanges=UINT_MAX); MSString ©(unsigned numCopies); MSString &insert(const MSString &aString,unsigned index=0,char padCharacter=' '); MSString &insert(const char *pString,unsigned index=0,char padCharacter=' '); MSString &leftJustify(unsigned length,char padCharacter=' '); MSString &lowerCase(); MSString &upperCase(); MSString &overlayWith(const MSString &aString,unsigned index=0,char padCharacter=' '); MSString &overlayWith(const char *pString,unsigned index=0,char padCharacter=' '); MSString &remove(unsigned startPos); MSString &remove(unsigned startPos,unsigned numChars); MSString &reverse(); MSString &rightJustify(unsigned length,char padCharacter=' '); MSString &strip(); MSString &strip(char aCharacter); MSString &strip(const MSString &aString); MSString &strip(const char *pString); MSString &strip(const MSStringTest &aTest); MSString &stripLeading(); MSString &stripLeading(char aCharacter); MSString &stripLeading(const MSString &aString); MSString &stripLeading(const char *pString); MSString &stripLeading(const MSStringTest &aTest); MSString &stripTrailing(); MSString &stripTrailing(char aCharacter); MSString &stripTrailing(const MSString &aString); MSString &stripTrailing(const char *pString); MSString &stripTrailing(const MSStringTest &aTest); MSString &translate(const MSString &inputChars,const MSString &outputChars,char padCharacter=' '); MSString &translate(const MSString &inputChars,const char *pOutputChars,char padCharacter=' '); MSString &translate(const char *pInputChars,const MSString &outputChars,char padCharacter=' '); MSString &translate(const char *pInputChars,const char *pOutputChars,char padCharacter=' '); static MSString center(const MSString &aString,unsigned length,char padCharacter=' '); static MSString change(const MSString &aString,const MSString &inputString, const MSString &outputString,unsigned startPos=0,unsigned numChanges=UINT_MAX); static MSString change(const MSString &aString,const MSString &inputString, const char *pOutputString,unsigned startPos=0,unsigned numChanges=UINT_MAX); static MSString change(const MSString &aString,const char *pInputString, const MSString &outputString,unsigned startPos=0,unsigned numChanges=UINT_MAX); static MSString change(const MSString &aString,const char *pInputString, const char *pOutputString,unsigned startPos=0,unsigned numChanges=UINT_MAX); static MSString copy(const MSString &aString,unsigned numCopies); static MSString insert(const MSString &aString,const MSString &anInsert,unsigned index=0,char padCharacter=' '); static MSString insert(const MSString &aString,const char *pInsert,unsigned index=0,char padCharacter=' '); static MSString leftJustify(const MSString &aString,unsigned length,char padCharacter=' '); static MSString lowerCase(const MSString &aString); static MSString overlayWith(const MSString &aString,const MSString &anOverlay,unsigned index=0,char padCharacter=' '); static MSString overlayWith(const MSString &aString,const char *pOverlay,unsigned index=0,char padCharacter=' '); static MSString remove(const MSString &aString,unsigned startPos); static MSString remove(const MSString &aString,unsigned startPos,unsigned numChars); static MSString reverse(const MSString &aString); static MSString rightJustify(const MSString &aString,unsigned length,char padCharacter=' '); static MSString stripBlanks(const MSString &aString); static MSString strip(const MSString &aString,char aChar); static MSString strip(const MSString &aString,const MSString &aStringOfChars); static MSString strip(const MSString &aString,const char *pStringOfChars); static MSString strip(const MSString &aString,const MSStringTest &aTest); static MSString stripLeadingBlanks(const MSString &aString); static MSString stripLeading(const MSString &aString,char aChar); static MSString stripLeading(const MSString &aString,const MSString &aStringOfChars); static MSString stripLeading(const MSString &aString,const char *pStringOfChars); static MSString stripLeading(const MSString &aString,const MSStringTest &aTest); static MSString stripTrailingBlanks(const MSString &aString); static MSString stripTrailing(const MSString &aString,char aChar); static MSString stripTrailing(const MSString &aString,const MSString &aStringOfChars); static MSString stripTrailing(const MSString &aString,const char *pStringOfChars); static MSString stripTrailing(const MSString &aString,const MSStringTest &aTest); static MSString translate(const MSString &aString,const MSString &inputChars, const MSString &outputChars,char padCharacter=' '); static MSString translate(const MSString &aString,const MSString &inputChars, const char *pOutputChars,char padCharacter=' '); static MSString translate(const MSString &aString,const char *pInputChars, const MSString &outputChars,char padCharacter=' '); static MSString translate(const MSString &aString,const char *pInputChars, const char *pOutputChars,char padCharacter=' '); static MSString upperCase(const MSString &aString); virtual MSError::ErrorStatus set(const char *pString); virtual MSError::ErrorStatus setFromMSF(const char *pString); virtual MSError::ErrorStatus set(unsigned index,char aChar); virtual MSError::ErrorStatus set(const MSString *pString); virtual MSError::ErrorStatus set(const MSString &aString); MSBoolean isSet() const; MSString& truncate(unsigned len=0); MSString& exchange(unsigned index1,unsigned index2); MSString& removeAll(); MSString& lower(); MSString& upper(); MSString& rotate(int count); MSString& take(int count); MSString& drop(int count); friend MSTypesExport MSString lower(const MSString& aString); friend MSTypesExport MSString upper(const MSString& aString); friend MSTypesExport MSString rotate(const MSString& aString,int count); friend MSTypesExport MSString take(const MSString& aString,int count); friend MSTypesExport MSString drop(const MSString& aString,int count); /*----------------------------- Word Functions --------------------------------- | The following functions operate on the string as a collection of words | | separated by whitespace characters: | | | | indexOfPhrase - Returns the position of the first occurrence of the | | argument phrase in the receiver. Returns 0 if the | | phrase is not found. | | indexOfWord - Returns the index of the nth whitespace-delimited | | word in the receiver. Returns length() if the word is not | | found. | | lengthOfWord - Returns the length of the nth whitespace-delimited | | word in the receiver. | | numWords - Returns the number of whitespace-delimited words in | | the receiver. | | removeWords - Deletes the specified words from the receiver's | | contents; the words are specified by using a starting | | word number and the number of words. The latter | | defaults to the rest of the string. | | NOTE: The static functions space and removeWords | | obtain the same result, but do not affect the | | String to which they are applied. | | space - Modifies the receiver so that all words are separated | | by the specified number of blanks. The default is | | one blank. All whitespace is converted to simple | | blanks. | | NOTE: The static functions space and removeWords | | obtain the same result, but do not affect the | | String to which they are applied. | | word - Returns a copy of the nth whitespace-delimited word | | in the receiver. | | wordIndexOfPhrase - Returns the word number of the first word in the | | receiver that matches the argument phrase. It starts | | searching with the word number in the startWord | | argument, which defaults to 0. It returns word count | | if the phrase is not found. | | words - Returns a substring of the receiver that starts at a | | given word and is comprised of a given number of | | words; the word separators are copied to the result | | intact. | ------------------------------------------------------------------------------*/ MSString &removeWords(unsigned firstWord); MSString &removeWords(unsigned firstWord,unsigned numWords); MSString &space(unsigned numSpaces=1,char spaceChar=' '); MSString word(unsigned wordNumber) const; MSString words(unsigned firstWord) const; MSString words(unsigned firstWord,unsigned numWords) const; unsigned indexOfPhrase(const MSString &wordString,unsigned startWord=0) const; unsigned indexOfWord(unsigned wordNumber) const; unsigned lengthOfWord(unsigned wordNumber) const; unsigned numWords() const; unsigned wordIndexOfPhrase(const MSString &aPhrase,unsigned startWord=0) const; static MSString space(const MSString &aString,unsigned numSpaces=1,char spaceChar=' '); static MSString removeWords(const MSString &aString,unsigned startWord); static MSString removeWords(const MSString &aString,unsigned startWord,unsigned numWords); protected: /*------------------------------ Related Types --------------------------------- The following enumeration types are defined to pass "modes" to various implementation functions: BitOperator - Enumeration that specifies the bit operator to apply to the applyBitOp function. Valid bit operators are 'and', 'or', and 'exclusiveOr'. IndexType - Enumeration that specifies whether the result from the findPhrase function is a word index or a character index. The valid values are: charIndex - Returns the result as the byte index within the string. wordIndex - Returns the result as the index of the matching word. For example, the first word is 1, the second word is 2, and so forth. ------------------------------------------------------------------------------*/ enum BitOperator {And,Or,ExclusiveOr}; enum IndexType {CharIndex,WordIndex}; /*--------------------------- Static Data Members ------------------------------ The following are static data members: null - A string that contains no element. maxLong - The maximum value of a long, which is "2147483647" on OS/2 with 32-bit unsigned long integers. ------------------------------------------------------------------------------*/ static const char *null; static const char *maxLong; /*------------------------------ Implementation -------------------------------- The following functions are used to implement this class: data - Returns the address of the contents of the MSString. setBuffer - Sets the private data member to point to a new MSStringBuffer object. buffer - Returns the address of the MSStringBuffer referred to by this MSString. lengthOf - Returns the length of a plain C character array. initBuffer - Resets the contents from an argument buffer or buffers. defaultBuffer - Returns a pointer to the MSStringBuffer::defaultBuffer. The following are common implementations of various overloaded versions of similarly named public functions: occurrencesOf - See MSString::occurrencesOf. isLike - See MSString::isLike. isAbbrevFor - See MSString::isAbbrevFor. change - See MSString::change. insert - See MSString::insert. overlayWith - See MSString::overlayWith. strip - See MSString::strip. translate - See MSString::translate. indexOfWord - See MSString::indexOfWord. The following are used to implement various public functions of this class: applyBitOp - Implements bitwise operators &, |, and ^. findPhrase - Locates a given string of words for indexOfWord functions. ------------------------------------------------------------------------------*/ char *data() const; MSStringBuffer *buffer() const; static unsigned lengthOf(const char *p); static MSStringBuffer *defaultBuffer(); MSString &setBuffer(MSStringBuffer *ibuff); MSString &initBuffer(const void *p1,unsigned len1, const void *p2=0,unsigned len2=0, const void *p3=0,unsigned len3=0,char padChar=0); MSString &initBuffer(long n); MSString &initBuffer(unsigned long n); MSString &initBuffer(double d); MSString &initBuffer(void *p_); MSString &applyBitOp(const char *pArg,unsigned argLen,BitOperator op); MSString &change(const char *pPattern, unsigned patternLen, const char *pReplacement,unsigned replacementLen,unsigned startPos,unsigned numChanges); MSString &insert(const char *pInsert,unsigned insertLen,unsigned startPos,char padCharacter); MSString &overlayWith(const char *pOverlay,unsigned overlayLen,unsigned index,char padCharacter); MSString &strip(const char *p,unsigned len,MSStringEnum::StripMode mode); MSString &strip(const MSStringTest &aTest,MSStringEnum::StripMode mode); MSString &translate(const char *pInputChars,unsigned inputLen, const char *pOutputChars,unsigned outputLen,char padCharacter); unsigned indexOfWord(unsigned wordNumber,unsigned startPos,unsigned numWords) const; unsigned occurrencesOf(const char *pSearchString,unsigned searchLen,unsigned startPos) const; unsigned findPhrase(const MSString &aPhrase,unsigned startWord,IndexType charOrWord) const; MSBoolean isLike(const char *pPattern,unsigned patternLen,char zeroOrMore,char anyChar) const; MSBoolean isAbbrevFor(const char *pFullString,unsigned fullLen,unsigned minLen) const; private: /*------------------------ PRIVATE ----------------------------------*/ friend class MSStringBuffer; friend class CharPick; MSString(MSStringBuffer *pBuffer); MSString &prepareToChange(); void binaryMath(unsigned char newDigit); void decimalMath(unsigned char newDigit); MSStringBuffer *_pBuffer; }; #ifndef MSStringTestHEADER #include #endif #ifndef MS_NO_INLINES #ifndef MSStringINLINES #include #endif #endif /*------------------------ Comparison Function ------------------------*/ inline long compare(const MSString &aString_,const MSString &bString_) { return aString_.compare(bString_); } /*--------------------------- Hash Function ---------------------------*/ inline unsigned long hash(const MSString& aString_,unsigned long size_) { char *pString=aString_.data(); unsigned long h=0,c; while ((c=(unsigned long)*pString++)!=0) h+=(h<<5)+c; return h%size_; } #if defined (MS_SPECIALIZE_ELEMENT_FOR_OPS_TYPE) #include DECLARE_ELEMENT_FOR_OPS_TYPE(MSString) #endif #endif aplus-fsf-4.22/src/MSTypes/MSStringBuffer.H0000644000265000001440000004151010772770463014140 #ifndef MSStringBufferHEADER #define MSStringBufferHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// /******************************************************************************* * DESCRIPTION: * * This file contains the declaration(s) of the class(es): * * MSStringBuffer - class to hold MSString contents * *******************************************************************************/ extern "C" { #include } #include #ifndef MSDefinesHEADER #include #endif #ifdef MS_MULTI_THREAD #include #endif #ifndef MSStringEnumHEADER #include #endif class MSStringTest; class MSString; // MSBaseStringBuffer class is needed here so that that virtual function table // pointer gets placed on top of MSStringBuffer in memory layout, in the base // class portion, rather than after the MSStringBuffer data members, since we // are going to allocate more space than we declare to the compiler. // class MSTypesExport MSBaseStringBuffer { public: virtual ~MSBaseStringBuffer(); }; class MSTypesExport MSStringBuffer : public MSBaseStringBuffer { friend class MSString; /******************************************************************************* * The MSStringBuffer class defines the contents of an MSString. * * * * Notes: * * * * 1) This class is intended only to support the implementation of the * * MSString class. Objects of this class should not be created or * * manipulated except through the containing MSString object. * * * * 2) Use the following information to guide you when allocating * * objects of this class: * * * * - Subclasses must not add any data members. * * * * - The operator new is protected so that it can be called only from * * the newBuffer member function. * * * * - The destructor is protected so that instances of this class cannot * * easily be created on the stack or as statics. * *******************************************************************************/ public: /*------------------------------- Reallocating --------------------------------- | The following function manages the reallocation of MSStringBuffers when | | strings' contents are modified: | | newBuffer - Allocates a new buffer and initializes it with the | | contents of up to three argument buffers. | | checkAddition - Verifies that the two arguments, when added, will | | not overflow an unsigned int. | | checkMultiplication - Verifies that the two arguments, when multiplied, | | will not overflow an unsigned int. | | overflow - Function that throws exception when overflow is | | detected by checkAddition or checkMultiplication. | ------------------------------------------------------------------------------*/ MSStringBuffer *newBuffer(const void *p1,unsigned len1, const void *p2=0,unsigned len2=0, const void *p3=0,unsigned len3=0, char padChar=0) const; static unsigned checkAddition(unsigned addend1,unsigned addend2); static unsigned checkMultiplication(unsigned factor1,unsigned factor2); static unsigned overflow(); static MSStringBuffer *defaultBuffer(); #if 0 static MSStringBuffer *fromContents(const char *pBuffer); #endif /*-------------------------------- Accessing ----------------------------------- | The following functions provide access to various attributes of a buffer: | | null - Returns the address of the null buffer. | | useCount - Returns the number of MSStrings that refer to the buffer. | | length - Returns the length of the buffer's contents. | | contents - Returns the address of the buffer's contents. | | defaultBuffer - Static member function that returns the address of the | | null buffer for the class. | | fromContents - Static member function that returns the address of | | MSStringBuffer, given a pointer to its contents. | | charType - Returns the type of a character at a given index. | | next - Returns a pointer to the next character, not the next | | byte, in the buffer. | ------------------------------------------------------------------------------*/ MSStringBuffer *null() const; unsigned useCount() const; unsigned length() const; const char *contents() const; char *contents(); virtual MSStringEnum::CharType charType(unsigned index) const; virtual char *next(const char *prev); virtual const char *next(const char *prev) const; /*---------------------------- Reference Counting ------------------------------ | The following functions manage the buffer reference count: | | addRef - Increments the usage count. | | removeRef - Decrements the usage count and deletes the buffer when the | | usage count goes to 0. | ------------------------------------------------------------------------------*/ MSStringBuffer *addRef(); void removeRef(); void unSafeRemoveRef(void) { if (--refs==0) delete this; } /*-------------------------------- Comparing ----------------------------------- | The following functions permit the MSStringBuffer's contents to be compared | | to some other character array: | | Comparison - Enumeration of the possible return codes from | | MSStringBuffer::compare. | | compare - Compares the buffer to an argument character array. | ------------------------------------------------------------------------------*/ enum Comparison {equal,greaterThan,lessThan}; virtual Comparison compare(const void *p,unsigned len) const; /*-------------------------------- Character Subsetting ------------------------ | The following function is used when a subset of characters is required: | | subString - Returns a new MSStringBuffer, of the same type as the previous | | one, that contains the specified subset of characters. | ------------------------------------------------------------------------------*/ virtual MSStringBuffer *subString(unsigned startPos,unsigned len,char padCharacter) const; /*-------------------------------- Diagnostics --------------------------------- | The following function provides diagnostic information about the buffer: | | asDebugInfo - Returns information about the buffer's internal | | representation that can be used for debugging. | ------------------------------------------------------------------------------*/ MSString asDebugInfo() const; /*--------------------------------- Testing ------------------------------------ | The following functions are called by the corresponding MSString functions | | to test the buffer's contents: | | isAlphanumeric- See MSString::isAlphanumeric. | | isAlphabetic - See MSString::isAlphabetic. | | isASCII - See MSString::isASCII. | | isControl - See MSString::isControl. | | isDigits - See MSString::isDigits. | | isGraphics - See MSString::isGraphics. | | isHexDigits - See MSString::isHexDigits. | | isLowerCase - See MSString::isLowerCase. | | isPrintable - See MSString::isPrintable. | | isPunctuation - See MSString::isPunctuation. | | isUpperCase - See MSString::isUpperCase. | | isWhiteSpace - See MSString::isWhiteSpace. | | isMBCS - See MSString::isMBCS. | | isSBCS - See MSString::isSBCS. | | isValidMBCS - See MSString::isValidMBCS. | | includesMBCS - See MSString::includesMBCS. | | includesSBCS - See MSString::includesSBCS. | ------------------------------------------------------------------------------*/ MSBoolean isAlphanumeric() const; MSBoolean isAlphabetic() const; MSBoolean isASCII () const; MSBoolean isControl() const; MSBoolean isDigits() const; MSBoolean isGraphics() const; MSBoolean isHexDigits() const; MSBoolean isLowerCase() const; MSBoolean isPrintable() const; MSBoolean isPunctuation() const; MSBoolean isUpperCase() const; MSBoolean isWhiteSpace() const; // these need to be virtual so that the MSMBStringBuffer can deal with // them correctly. virtual MSBoolean isMBCS() const; virtual MSBoolean isSBCS() const; virtual MSBoolean isValidMBCS() const; virtual MSBoolean includesMBCS() const; virtual MSBoolean includesSBCS() const; // these methods are here for backward compatibility - use MBCS methods MSBoolean isDBCS() const; MSBoolean isValidDBCS() const; MSBoolean includesDBCS() const; /*-------------------------------- Searching ----------------------------------- | The following functions are called by the corresponding MSString | | functions to search the buffer's contents: | | indexOf - See MSString::indexOf. | | indexOfAnyBut - See MSString::indexOfAnyBut. | | indexOfAnyOf - See MSString::indexOfAnyOf. | | lastIndexOf - See MSString::lastIndexOf. | | lastIndexOfAnyBut - See MSString::lastIndexOfAnyBut. | | lastIndexOfAnyOf - See MSString::lastIndexOfAnyOf. | ------------------------------------------------------------------------------*/ virtual unsigned indexOf(const char *pString,unsigned len,unsigned startPos=0) const; virtual unsigned indexOf(const MSStringTest &aTest,unsigned startPos=0) const; virtual unsigned indexOfAnyBut(const char *pString,unsigned len,unsigned startPos=0) const; virtual unsigned indexOfAnyBut(const MSStringTest &aTest,unsigned startPos=0) const; virtual unsigned indexOfAnyOf (const char *pString,unsigned len,unsigned startPos=0) const; virtual unsigned indexOfAnyOf (const MSStringTest &aTest,unsigned startPos=0) const; virtual unsigned lastIndexOf(const char *pString,unsigned len,unsigned startPos=UINT_MAX-1) const; virtual unsigned lastIndexOf(const MSStringTest &aTest,unsigned startPos=UINT_MAX-1) const; virtual unsigned lastIndexOfAnyBut(const char *pString,unsigned len,unsigned startPos=UINT_MAX-1) const; virtual unsigned lastIndexOfAnyBut(const MSStringTest &aTest,unsigned startPos=UINT_MAX-1) const; virtual unsigned lastIndexOfAnyOf(const char *pString,unsigned len,unsigned startPos=UINT_MAX-1) const; virtual unsigned lastIndexOfAnyOf(const MSStringTest &aTest,unsigned startPos=UINT_MAX-1) const; /*--------------------------------- Editing ------------------------------------ The following functions are called by the corresponding MSString functions to edit the buffer's contents: center - See MSString::center. change - See MSString::change. copy - See MSString::copy. drop - See MSString::drop. insert - See MSString::insert. leftJustify - See MSString::leftJustify. lowerCase - See MSString::lowerCase. overlayWith - See MSString::overlayWith. remove - See MSString::remove. reverse - See MSString::reverse. rotate - See MSString::rotate. rightJustify - See MSString::rightJustify. strip - See MSString::strip. take - See MSString::take. translate - See MSString::translate. upperCase - See MSString::upperCase. ------------------------------------------------------------------------------*/ virtual MSStringBuffer *center(unsigned newLen,char padCharacter); virtual MSStringBuffer *change(const char *pSource,unsigned sourceLen, const char *pTarget,unsigned targetLen, unsigned startPos,unsigned numChanges); virtual MSStringBuffer *copy(unsigned numCopies); virtual MSStringBuffer *drop(int count); virtual MSStringBuffer *insert(const char *pInsert,unsigned insertLen, unsigned pos,char padCharacter); virtual MSStringBuffer *leftJustify(unsigned newLen,char padCharacter); virtual MSStringBuffer *lowerCase(); virtual MSStringBuffer *overlayWith(const char *overlay,unsigned len, unsigned pos,char padCharacter); virtual MSStringBuffer *remove(unsigned startPos,unsigned numChars); virtual MSStringBuffer *reverse(); virtual MSStringBuffer *rotate(int count); virtual MSStringBuffer *rightJustify(unsigned newLen,char padCharacter); virtual MSStringBuffer *strip(const char *pChars,unsigned len,MSStringEnum::StripMode mode); virtual MSStringBuffer *strip(const MSStringTest &aTest,MSStringEnum::StripMode mode); virtual MSStringBuffer *take(int count); virtual MSStringBuffer *translate(const char *pInputChars,unsigned inputLen, const char *pOutputChars,unsigned outputLen,char padCharacter); virtual MSStringBuffer *upperCase(); protected: /*------------------------------ Implementing ---------------------------------- The following functions provide utilities used to implement this class: startSearch - Initializes an indexOf search. startBackwardsSearch - Initializes a lastIndexOf search. allocate - Returns a new buffer of the required length. operator new - Allocates space for a buffer of the specified length. operator delete - Deallocates a buffer. initialize - Static member function used to initialize (set up null buffer, DBCS table, and so forth). className - Returns the name of the class (MSStringBuffer). ------------------------------------------------------------------------------*/ virtual unsigned startSearch(unsigned startPos,unsigned searchLen) const; virtual unsigned startBackwardsSearch(unsigned startPos,unsigned searchLen) const; virtual MSStringBuffer *allocate(unsigned bufLength) const; void *operator new(size_t t,unsigned bufLen); void operator delete(void *p); static MSStringBuffer *initialize(); virtual const char *className() const; /*-------------------------- Constructor/Destructor ---------------------------- The constructor for this class requires the length of the buffer(the value to be stored in the length data member). ------------------------------------------------------------------------------*/ MSStringBuffer(unsigned newLen); ~MSStringBuffer(); private: /*--------------------------------- Private ----------------------------------*/ #ifdef MS_MULTI_THREAD MSMutex _mutex; // buffer lock, protects reference counting #endif unsigned refs; unsigned len; char data[1]; }; /*---------------------------- Inline Methods --------------------------------*/ #ifndef MS_NO_INLINES #ifndef MSStringBufferINLINES #include #endif #endif #endif aplus-fsf-4.22/src/MSTypes/MSStringEnum.H0000644000265000001440000000430310772770464013633 #ifndef MSStringEnumHEADER #define MSStringEnumHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include /******************************************************************************* * DESCRIPTION: * * This file contains the declaration(s) of the class(es): * * MSStringEnum - Placeholder for enumerations related to class MSString. * *******************************************************************************/ class MSStringEnum { /******************************************************************************* The MSStringEnum class serves as a repository for enumeration types related to the MSString class. These enumeration types are placed here so they can easily be shared between code that implements the MSString class and the MSStringBuffer and MSMBStringBuffer classes. *******************************************************************************/ public: /*------------------------------ Related Types --------------------------------- This class defines the following enumeration types: StripMode - Enumeration that defines the mode of operation of various functions that strip leading characters, trailing characters, or both from MSStrings. CharType - Enumeration that defines the various types of characters that comprise an MSString. ------------------------------------------------------------------------------*/ enum StripMode {Leading,Trailing,Both}; /*---------------------------------- Note: ------------------------------------- Code for mbcs must be the same as the length of the corresponding characters. ------------------------------------------------------------------------------*/ enum CharType {SBCS, DBCS1=1,MBCS1=1, DBCS2=2,MBCS2=2, MBCS3=3, MBCS4=4}; }; // class MSStringEnum #endif // MSStringEnumHEADER aplus-fsf-4.22/src/MSTypes/MSStringParser.H0000644000265000001440000003133010772770464014163 #ifndef MSStringParserHEADER #define MSStringParserHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MSStringHEADER #include #endif class MSStringParserData; class MSTypesExport MSStringParser { /******************************************************************************* * Objects of this class enable you to "parse" the contents of MSStrings and * * place portions of the string into other strings. You can control the * * parsing of the string by specifying patterns that must be matched and * * by specifying relative and absolute column numbers. * * * You usually will not create MSStringParser objects explicitly. Instead,you * * will create them implicitly by applying the right-shift operator to an * * MSString. MSStringParser also provides the right-shift operator as a member * * function so that you can chain together invocations of the operator. For * * example,a typical expression that uses MSStringParser objects might look * * like: * * aFileName>>drive>>':'>>path; * * * * The right shift operator does one of four things,depending on the * * type of the right-hand operand: * * * * MSString- If the argument is an MSString,then the string parser object * * will set this string to the next token from the text being * * parsed. * * * * pattern- If the argument is a "pattern" then the parser advances to the * * next character beyond the occurrence of that pattern in its * * text. The pattern can be any of: * * const char* - Searches for the sequence of characters * * described by the character array. * * const MSString - Searches for the sequence of characters * * described by the string. Note that the * * treatment of a const MSString is * * fundamentally different than the treatment * * of a non-const one! * * char - Searches for the next occurrence of the * * argument character. * * MSStringTest - Searches for the next character in the * * text for which the string test object * * returns MSTrue. * * * * number - If the argument is a number then the current parser text * * position is adjusted by the argument amount. The value can * * be positive or negative. * * * * special- MSStringParser defines some special right-shift operands that * * perform special purpose parser operations: * * MSStringParser::reset- This enumeration value resets the * * parser text position to 0. * * MSStringParser::skip - This enumeration value skips one * * token in the text. It is equivalent * * to ">> temp" where temp is a temporary * * MSString that is discarded. * * MSStringParser::Skip - An object of this class skips a given * * number of tokens. * * * * You can also use the left-shift operator with an unsigned numeric argument. * * This will cause the parser object to reposition to the column specified * * by the argument. Note that the argument is not relative as it is in the * * case of the right-shift operator. Instead,it is an abosulte column * * position. * *******************************************************************************/ public: ~MSStringParser(void); /*------------------------- Special Parsing Operands --------------------------- | These types permit special-purpose parsing techniques: | | Command- Enumeration defining special-purpose parsing tokens. | | reset- Resets the parser position to 0. | | skip - Causes the parser to skip one token(word) in the | | input text. | | Skip - Object used to skip a given number of words(tokens) in the | | input text without assigning those words to output strings. | ------------------------------------------------------------------------------*/ enum Command {reset,skip}; class MSTypesExport Skip { public: Skip(unsigned numWords=1); unsigned numWords(void) const; private: unsigned _numSkip; }; /*-------------------------- Parsing Initialization ---------------------------- | These operators let you construct parser objects from strings. In effect, | | they implicitly construct an MSStringParser object for you when you apply | | the ">>" or "<<" operators to a string. An expression of the form: | | aString>>x | | -or- | | aString<>x | | -or- | | MSStringParser(aString)<>(const MSString&,MSString& aToken_); friend MSTypesExport MSStringParser operator>>(const MSString&,const MSString& aPattern_); friend MSTypesExport MSStringParser operator>>(const MSString&,const char *pPattern_); friend MSTypesExport MSStringParser operator>>(const MSString&,char aCharPattern_); friend MSTypesExport MSStringParser operator>>(const MSString&,unsigned position_); friend MSTypesExport MSStringParser operator>>(const MSString&,int position_); friend MSTypesExport MSStringParser operator<<(const MSString&,unsigned position_); friend MSTypesExport MSStringParser operator>>(const MSString&,const MSStringTest&); friend MSTypesExport MSStringParser operator>>(const MSString&,MSStringParser::Command); friend MSTypesExport MSStringParser operator>>(const MSString&,const MSStringParser::Skip&); /*-------------------------------- Tokenizing ---------------------------------- | This function parses the next "token" from the parser object and places | | it into the MSString operand. By necessity,this operatorplaces the rest | | of the parser text into the string. When the parser encounters a subsequent | | parsing instructions it will go back and adjust the token placed into the | | string. | | | | For example: | | "token1 token2">>token1 // token1=="token1 token2" at this point | | >>token2; // token2=="token2" and | | // token1=="token1". | ------------------------------------------------------------------------------*/ MSStringParser& operator>>(MSString& aToken_); /*----------------------------- Pattern Matching ------------------------------- | These operators advance to the next occurrence of the argument pattern | | in the parser text. Upon return,the parser will be positioned at the | | next character beyond the text that matched the pattern. If the pattern | | is not found,the parser will be positioned off the end of the text. | | | | Note that when using and MSString as a pattern you should cast it to a const | | MSString reference. | ------------------------------------------------------------------------------*/ MSStringParser& operator>>(const MSString& aPattern_); MSStringParser& operator>>(const char *pPattern_); MSStringParser& operator>>(char aCharPattern_); MSStringParser& operator>>(const MSStringTest&); /*----------------------- Relative Column Positioning -------------------------- | These operators move the parser text position relative to its current | | position. A negative argument moves backward,a positive argument forward. | | The adjustment is made starting at the point at which the prior parsing | | instruction *started*. For example: | | "1234">>token1>>1>>token2>>2>>token3; | | will result in: | | token1=="1" | | token2=="23" | | token3=="4". | ------------------------------------------------------------------------------*/ MSStringParser& operator>>(int delta_); MSStringParser& operator>>(unsigned delta_); /*----------------------- Absolute Column Positioning -------------------------- | These operators reset the parser text position to an absolute column | | number. | ------------------------------------------------------------------------------*/ MSStringParser& operator<<(unsigned position_); /*----------------------------- Special Parsing -------------------------------- | These operators handle the special commands and skip objects | ------------------------------------------------------------------------------*/ MSStringParser& operator>>(Command); MSStringParser& operator>>(const Skip&); protected: /*------------------------- Constructors/Destructor ---------------------------- | You can construct a parser object by providing: | | o a string that defines the text to be parsed | | o from an existing parser object(copy constructor) | | | | Note that usually you will construct parser objects by applying the | | right-shift operatorto a string. The constructor is protected to prevent | | you from creating objects except via use of those operators. Creation is | | prevented because of the nature of string parser objects. Since they hold | | references to operands,it is unwise to permit the objects to persist beyond | | the scope of those operands. | ------------------------------------------------------------------------------*/ MSStringParser(const MSString&); MSStringParser(const MSStringParser&); /*--------------------------------- PRIVATE ----------------------------------*/ private: MSStringParserData *_parseData; }; #endif aplus-fsf-4.22/src/MSTypes/MSStringParserData.H0000644000265000001440000001005410772770464014755 #ifndef MSStringParserDataHEADER #define MSStringParserDataHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MSStringHEADER #include #endif /*----------------------------------------------------------------------------*/ /* Define token pointer type */ /*----------------------------------------------------------------------------*/ typedef MSString* MSTokenPointer; class MSTypesExport MSStringParserData { /******************************************************************************* * Objects of this class are used to store and manage the data for parsing * * strings. * *******************************************************************************/ public: /*------------------------- Constructor and Destructor ------------------------- | The constructor accepts the text string to be parsed and initialized the | | parse history information. The parse history information is used to track | | what parsing has been performed(but may not be the final results). | | | | The destructor is used to delete possible parse history information. | ------------------------------------------------------------------------------*/ MSStringParserData(const MSString&); ~MSStringParserData(void); /*--------------------------------- Parsing ------------------------------------ | These methods are used to perform the actual string parsing and to store a | | record of the actions performed. These methods are intended to be called | | only by MSStringParse objects. | ------------------------------------------------------------------------------*/ MSStringParserData& processToken(MSString& aToken_,MSBoolean reparse_=MSFalse); MSStringParserData& processPattern(const MSString& aPattern_); MSStringParserData& processPattern(const char *pPattern_); MSStringParserData& processPattern(char aPatternChar_); MSStringParserData& processSkip(MSBoolean reparse_=MSFalse); MSStringParserData& processTest(const MSStringTest&); MSStringParserData& setPosition(unsigned position_); MSStringParserData& changePosition(int delta_); MSStringParserData& changePosition(unsigned delta_); /*------------------------------ Implementation -------------------------------- | The following methods are used to implement common actions performed during | | string parsing. | ------------------------------------------------------------------------------*/ MSStringParserData& reparseLastToken(void); MSStringParserData& reparseTokens(unsigned startPos,unsigned stopPos); MSStringParserData& saveToken(MSString *token); MSStringParserData& clearSavedTokens(void); /*---------------------------- Reference Counting ------------------------------ | The following functions manage the buffer reference count: | | addRef -Increments the usage count. | | removeRef-Decrements the usage count and deletes the buffer when the | | usage count goes to 0. | ------------------------------------------------------------------------------*/ void addRef(void); void removeRef(void); /*--------------------------------- PRIVATE ----------------------------------*/ private: MSString _parseText; unsigned _currentPosition; unsigned _patternPosition; unsigned _patternLength; unsigned _tokenCount; unsigned _tokenArraySize; MSString *_lastToken; MSBoolean _lastSkip; MSTokenPointer *_usedTokens; unsigned _refs; }; #endif aplus-fsf-4.22/src/MSTypes/MSStringTest.H0000644000265000001440000001150410772770464013647 #ifndef MSStringTestHEADER #define MSStringTestHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// /******************************************************************************* * DESCRIPTION: * * This file contains the declaration(s) of the class(es): * * MSStringTest-Abstract "string test" class. * *******************************************************************************/ #include extern "C" { typedef int MSCStringTestFn(int); } #if defined(MS_C_LINKAGE_INCOMPATIBILITY) typedef int (*MSCPPStringTestFn)(int); #endif class MSTypesExport MSStringTest { /******************************************************************************* The MSStringTest class defines the basic protocol for test objects that can be passed to MSStrings to assist in performing various testing and searching functions. It also provides concrete implementation for the common case of using a plain C function for such testing. A derived template class,MSStringTestMemberFn,is provided to permit the use of member functions of any class on the MSString functions that support MSStringTest. Derived classes should re-implement the test virtual function to test characters passed by the MSString and return the appropriate result. A constructor for this class accepts a pointer to a C function that accepts an integer as an argument and returns a MSBoolean. Such functions can be used anywhere an MSStringTest can be used. Note that this is the type of the standard C library is.... functions that check the type of C characters. Example: // Strip leading alphanumerics from aString... MSString aString; ... aString.stripLeading(isalnum); // Uses C library isalnum function. *******************************************************************************/ public: /*------------------------------ Function Types -------------------------------- CFunction -Pointer to the C function that accepts an integer argument and returns MSBoolean. ------------------------------------------------------------------------------*/ typedef MSCStringTestFn CFunction; /*------------------------------- Constructor --------------------------------- An object of this class can be constructed with a pointer to the C function to be used to implement the test member function. ------------------------------------------------------------------------------*/ MSStringTest(CFunction *cFunc); virtual ~MSStringTest(void); #if defined(MS_C_LINKAGE_INCOMPATIBILITY) typedef MSCPPStringTestFn CPPFunction; MSStringTest(CPPFunction cFunc); #endif /*--------------------------------- Testing ------------------------------------ test-This function tests the argument integer(character) and returns MSMSTrue or MSMSFalse as returned by the C function provided at construction. Derived classes should override this function to implement their own testing function. ------------------------------------------------------------------------------*/ virtual MSBoolean test(int) const; protected: /*------------------------------ Implementation -------------------------------- FnType-Enumeration describing the various flavors of functions supported. user - User-defined. c - C. cpp - C++ static or non-member function. memFn - C++ member function. cMemFn- Const C++ member function. data - Data member union,varying by FnType: cFn -Pointer to a C function. user -Pointer to an arbitrary derived-class data(if FnType is neither c nor cpp). ------------------------------------------------------------------------------*/ enum FnType {user,c,cpp,memFn,cMemFn}; FnType type; #if defined(MS_C_LINKAGE_INCOMPATIBILITY) union {CFunction *cFn; CPPFunction cppFn; void *user;} data; #else union {CFunction *cFn;void *user;} data; #endif /*--------------------- Protected Constructor ---------------------------------- This protected constructor can be used by derived classes to reuse the space for the C/C++ function pointer. ------------------------------------------------------------------------------*/ MSStringTest(FnType type,void *userData); }; // class MSStringTest #if defined(MS_C_LINKAGE_INCOMPATIBILITY) inline MSStringTest::MSStringTest(CPPFunction cppfunc):type(cpp) { data.cppFn=cppfunc; } #endif inline MSStringTest::MSStringTest(FnType typ,void *p):type(typ) { data.user=p; } #endif // MSStringTestHEADER aplus-fsf-4.22/src/MSTypes/MSStringTestMemberFn.H0000644000265000001440000000715210772770464015267 #ifndef MSStringTestMemberFnHEADER #define MSStringTestMemberFnHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include template class MSStringTestMemberFn : public MSStringTest { /******************************************************************************* The template class MSStringTestMemberFn is used to provide an MSStringTest-type wrapper for particular C++ member functions. This permits such member functions to be used in conjunction with the MSString functions that accept an MSStringTest object as an argument. The template class argument is the class name T of the class whose member function is to be wrappered. The constructor for the object requires two things: - An instance of class T. - A pointer to a member function of the class T. This member function will be applied to the object specified on the constructor to test each character passed to the test function of this class. The member function must accept a single integer argument and return MSBoolean. Both const and non-const member functions are supported. The latter require that a non-const member be specified as the first argument. Example: // Any arbitrary class with appropriate function... struct StringTester { MSBoolean charTest(int c) const; }; // StringTester object... StringTester tester; // Test aString using tester object... MSString aString; ... aString .includes(MSStringTestMemberFn(tester, StringTester::charTest)); Customization(Template Arguments) Class MSStringTestMemberFn is a template class instantiated with the template arguments: class MSTypesExport T *******************************************************************************/ public: /*------------------------------ Related Types --------------------------------- ConstFn -Const member function of the appropriate type. NonconstFn-Non-const member function of the appropriate type. ------------------------------------------------------------------------------*/ typedef MSBoolean(T::*ConstFn)(int) const; typedef MSBoolean(T::*NonconstFn)(int); /*------------------------------- Constructors --------------------------------- There are two constructors,one supporting const member functions,the other non-const member functions. The constructors also require an object of the class T(non-const object for non-const member functions). ------------------------------------------------------------------------------*/ MSStringTestMemberFn(const T &object,ConstFn constFn) :MSStringTest(user,(void*)&object),cMF(constFn) {} MSStringTestMemberFn(T &object,NonconstFn nonconstFn) :MSStringTest(user,(void*)&object),ncMF(nonconstFn) {} /*-------------------------------- Overrides ----------------------------------- test-Overridden to dispatch a member function against an object. ------------------------------------------------------------------------------*/ virtual MSBoolean test(int aChar_) const { if (type==cMemFn) return MSBoolean(((const T*)data.user->*cMF)(aChar_)>0); else return MSBoolean(((T*)data.user->*ncMF)(aChar_)>0); } private: /*------------------------ PRIVATE ----------------------------------*/ union {ConstFn cMF;NonconstFn ncMF;}; }; #endif // MSStringTestMemberFnHEADER aplus-fsf-4.22/src/MSTypes/MSStringVector.H0000644000265000001440000001337610772770464014203 #ifndef MSStringVectorHEADER #define MSStringVectorHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #ifndef MSDefinesHEADER #include #endif #if defined(MS_NEED_IMPLEMENTATION_PRAGMA) #pragma implementation("MSStringVector.C") #endif #if defined(MS_TEMPLATE_BEFORE_SPECIALIZATION) #include #endif template class MSTypeVector; typedef MSBaseVector > BaseVectorString; typedef MSObjectVector ObjectVectorString; #ifndef MS_MSStringVector_INSTANTIATE #ifdef MS_DECLARE_TEMPLATE_SPECIALIZATION template <> class MSBaseVector >; template <> class MSBaseVectorOps >; template <> class MSObjectVector; template <> class MSVectorElement; template <> ostream& operator<<(ostream&,const MSBaseVector >&); #endif #endif #if defined(MS_VC_NEED_TEMPLATE_EXPORT) class MSTypesExport MSBaseVector >; class MSTypesExport MSBaseVectorOps >; class MSTypesExport MSObjectVector; class MSTypesExport MSObjectVector; class MSTypesExport MSVectorElement; #endif #if !defined(MS_MSStringVector_INSTANTIATE) && defined(MS_STD_TEMPLATE_SPECIALIZATION) template <> class MSTypeVector : public ObjectVectorString #else template <> class MSTypesExport MSTypeVector : public ObjectVectorString #endif { public: MSTypeVector (); MSTypeVector (unsigned int); MSTypeVector (unsigned int, const MSString &); MSTypeVector (const MSTypeVector &); MSTypeVector (const BaseVectorString &); MSTypeVector (const char *, const char ='\n'); MSTypeVector (MSTypeData > *, unsigned int); MSTypeVector (const MSString *, unsigned int); virtual ~MSTypeVector(); MSTypeVector & operator= (const MSTypeVector &); MSTypeVector & operator= (const BaseVectorString &); MSTypeVector & operator= (const MSString &); MSTypeVector & operator= (const char *); virtual MSString asString () const; INLINELINKAGE MSString asString (const char) const; virtual const MSSymbol & type() const; virtual MSString className() const; virtual MSModel *clone() const; virtual MSModel *create() const; virtual MSError::ErrorStatus set (const char *); virtual MSError::ErrorStatus set (const char *, const char); static const MSSymbol & symbol(); INLINELINKAGE MSError::ErrorStatus set (unsigned int, const MSString &); INLINELINKAGE MSTypeVector & appendSingle (const MSString &); MSTypeVector & append (const char *, const char ='\n'); INLINELINKAGE MSTypeVector & append (const MSString &, const char ='\n'); INLINELINKAGE MSTypeVector & append (const MSTypeVector &); INLINELINKAGE MSTypeVector & operator<<= (const MSString &); INLINELINKAGE MSTypeVector & operator<<= (const char *); INLINELINKAGE MSTypeVector & operator<<= (const MSTypeVector &); INLINELINKAGE MSTypeVector & operator<< (const MSString &); INLINELINKAGE MSTypeVector & operator<< (const char *); INLINELINKAGE MSTypeVector & operator<< (const MSTypeVector &); }; inline MSString msBadData(const MSString&) { return MSString(""); } typedef MSTypeVector MSStringVector; #ifndef MS_NO_INLINES #include #endif // MS_NO_INLINES // We provide explicit "do_not_instantiate" pragmas here to avoid instantiation complications in // MStk applications. // #if !defined(__MSTYPESLIBRARY_BUILD__) #if defined(MS_EDG_TEMPLATE_INSTANTIATION) #if defined(MS_DO_NOT_INSTANTIATE) // // MStk templates are manually instantiated: provide "do_not_instantiate" pragmas for the manually instantiated entities // #pragma do_not_instantiate MSVectorModelAllocator #pragma do_not_instantiate MSTypeData > #pragma do_not_instantiate MSBaseVector > #pragma do_not_instantiate MSBaseVectorOps > #pragma do_not_instantiate MSObjectVector #pragma do_not_instantiate MSVectorElement #pragma do_not_instantiate ostream& operator<<(ostream&, const MSBaseVector >&) #pragma do_not_instantiate unsigned int msMergeSortUp(unsigned int, MSString *, unsigned int *,unsigned int, unsigned int) #pragma do_not_instantiate unsigned int msMergeSortDown(unsigned int, MSString *, unsigned int *,unsigned int, unsigned int) #else // // MStk templates are automatically instantiated: provide "do_not_instantiate" pragmas for template function specializations // #pragma do_not_instantiate unsigned MSBaseVectorOps >::numElements(const MSString&,\ const char) const #pragma do_not_instantiate void MSBaseVectorOps >::setFromMSString(void *,\ unsigned int,\ const MSString&,\ unsigned int,\ const char) const #endif // MS_DO_NOT_INSTANTIATE #endif // MS_EDG_TEMPLATE_INSTANTIATION #endif // !__MSTYPESLIBRARY_BUILD__ #endif // MSStringVectorHEADER aplus-fsf-4.22/src/MSTypes/MSSymbol.H0000644000265000001440000000372410772770464013013 #ifndef MSSymbolHEADER #define MSSymbolHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #ifndef MSDefinesHEADER #include #endif class MSNameSpace; class MSString; #if HAVE_IOSTREAM #include // #include using namespace std; #else class istream; class ostream; #endif class MSTypesExport MSSymbol { public: MSSymbol(void); MSSymbol(const char *symbolName_); MSSymbol(const MSSymbol& aSymbol_); ~MSSymbol(void); const char *symbolName(void) const; MSString asString(void) const; MSString asDebugInfo(void) const; MSString className(void) const; INLINELINKAGE MSAtom atom(void) const; MSSymbol& operator=(const MSSymbol& aSymbol_); MSBoolean operator==(const MSSymbol& aSymbol_) const; MSBoolean operator!=(const MSSymbol& aSymbol_) const; MSBoolean operator<(const MSSymbol& aSymbol_) const; MSBoolean operator>(const MSSymbol& aSymbol_) const; MSBoolean operator<=(const MSSymbol& aSymbol_) const; MSBoolean operator>=(const MSSymbol& aSymbol_) const; long compare(const MSSymbol& aSymbol_) const; friend MSTypesExport unsigned long hash(const MSSymbol&,unsigned long size_); static MSBoolean doesASymbolExistFor(const char *); static const MSSymbol& nullSymbol(void); static ostream& printSymbolTable(ostream& aStream_); friend MSTypesExport ostream& operator<<(ostream& aStream_,const MSSymbol& aSymbol_); friend MSTypesExport istream& operator>>(istream& aStream_,MSSymbol& aSymbol_); private: MSAtom _atom; }; inline long compare(const MSSymbol& aSymbol_,const MSSymbol& bSymbol_) { return aSymbol_.compare(bSymbol_); } #ifndef MS_NO_INLINES #ifndef MSSymbolINLINES #include #endif #endif #endif aplus-fsf-4.22/src/MSTypes/MSSymbolVector.H0000644000265000001440000001215010772770464014167 #ifndef MSSymbolVectorHEADER #define MSSymbolVectorHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #ifndef MSDefinesHEADER #include #endif #if defined(MS_NEED_IMPLEMENTATION_PRAGMA) #pragma implementation("MSSymbolVector.C") #endif #if defined(MS_TEMPLATE_BEFORE_SPECIALIZATION) #include #endif #if HAVE_IOSTREAM #include // #include using namespace std; #else class istream; #endif template class MSTypeVector; #ifndef MS_MSSymbolVector_INSTANTIATE #ifdef MS_DECLARE_TEMPLATE_SPECIALIZATION template <> class MSBaseVector >; template <> class MSBaseVectorOps >; template <> ostream& operator<<(ostream&,const MSBaseVector >&); #endif #endif #if defined(MS_VC_NEED_TEMPLATE_EXPORT) class MSTypesExport MSBaseVector >; class MSTypesExport MSBaseVectorOps >; #endif #if !defined(MS_MSSymbolVector_INSTANTIATE) && defined(MS_STD_TEMPLATE_SPECIALIZATION) template <> class MSTypeVector : public MSBaseVector > #else template <> class MSTypesExport MSTypeVector : public MSBaseVector > #endif { public: class MSTypesExport SPick { protected: MSTypeVector *_pVector; unsigned _index; public: INLINELINKAGE SPick (MSTypeVector &, unsigned int); INLINELINKAGE SPick (const SPick &); SPick & operator= (const MSSymbol&); SPick & operator= (const SPick &); friend MSTypesExport istream & operator>> (istream &, SPick &); INLINELINKAGE operator MSSymbol() const; }; public: MSTypeVector (); MSTypeVector (unsigned int); MSTypeVector (unsigned int, const MSSymbol &); MSTypeVector (const MSTypeVector &); MSTypeVector (const MSBaseVector > &); MSTypeVector (const char *); MSTypeVector (MSTypeData > *, unsigned int); MSTypeVector (const MSSymbol *, unsigned int); virtual ~MSTypeVector(); MSTypeVector & operator= (const MSTypeVector &); MSTypeVector & operator= (const MSBaseVector > &); MSTypeVector & operator= (const MSSymbol &); MSTypeVector & operator= (const char *); virtual const MSSymbol & type() const; virtual MSString className() const; virtual MSModel *clone() const; virtual MSModel *create() const; static const MSSymbol & symbol(); INLINELINKAGE const MSSymbol & firstElement() const; INLINELINKAGE const MSSymbol & lastElement () const; INLINELINKAGE const MSSymbol & operator[] (unsigned int) const; INLINELINKAGE const MSSymbol & operator() (unsigned int) const; INLINELINKAGE const MSSymbol & elementAt (unsigned int) const; INLINELINKAGE SPick operator[] (unsigned int); INLINELINKAGE MSTypeVector operator[] (const MSIndexVector &) const; INLINELINKAGE MSTypeVector operator[] (const MSBinaryVector &) const; }; typedef MSTypeVector MSSymbolVector; // MSSymbol specializations inline MSString msAsMSF (const MSSymbol & value_) { return value_.symbolName(); } inline MSError::ErrorStatus msSetFromString (MSSymbol & value_, const char *pString_) { value_ = MSSymbol(pString_); return MSError::MSSuccess; } inline MSError::ErrorStatus msSetFromMSF (MSSymbol & sym_, const char *pBuf) { MSString str; MSError::ErrorStatus rc = str.setFromMSF (pBuf); sym_ = MSSymbol((const char *)str); return rc; } inline MSSymbol msBadData(const MSSymbol&) { return MSSymbol::nullSymbol(); } #ifndef MS_NO_INLINES #include #endif // MS_NO_INLINES // We provide provide explicit "do_not_instantiate" pragmas here to avoid instantiation complications in // MStk applications. // #if !defined(__MSTYPESLIBRARY_BUILD__) && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma do_not_instantiate MSAllocator #pragma do_not_instantiate MSTypeData > #pragma do_not_instantiate MSBaseVector > #pragma do_not_instantiate MSBaseVectorOps > #pragma do_not_instantiate ostream& operator<<(ostream&, const MSBaseVector >&) #pragma do_not_instantiate unsigned int msMergeSortUp(unsigned int, MSSymbol *, unsigned int *,unsigned int, unsigned int) #pragma do_not_instantiate unsigned int msMergeSortDown(unsigned int, MSSymbol *, unsigned int *,unsigned int, unsigned int) #endif // !__MSTYPESLIBRARY_BUILD__ && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #endif // MSSymbolVectorHEADER aplus-fsf-4.22/src/MSTypes/MSTabularTree.H0000644000265000001440000002332110772770464013753 #ifndef MSTabularTreeHEADER #define MSTabularTreeHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include template class MSTabularTreeIterator { public: virtual MSBoolean applyTo(Element&)=0; }; template class MSTabularTreeConstantIterator { public: virtual MSBoolean applyTo(Element const&)=0; }; #include template class MSTabularTreeNode { //friend class MSTabularTree; //friend class MSTabularTreeCursor; public: Element _element; unsigned long _numberOfChildren; MSTabularTreeNode *_pParentNode; MSTabularTreeNode **_pChildren; MSTabularTreeNode(Element const& element) : _numberOfChildren(0),_pChildren(0),_pParentNode(0),_element(element) {} ~MSTabularTreeNode(void) { if (_numberOfChildren>0) delete [] _pChildren; } }; template class MSTabularTree { private: MSTabularTreeNode *_pRootNode; public: typedef MSTabularTreeCursor Cursor; MSTabularTree(void); MSTabularTree(MSTabularTree const&); ~MSTabularTree(void); MSTabularTree& operator=(MSTabularTree const&); void copy(MSTabularTree const&); void copySubtree(MSTabularTree const&,MSTabularTreeCursor const&); void addAsRoot(Element const&); void addAsChild(MSTabularTreeCursor const&, unsigned long, Element const&); void attachAsRoot(MSTabularTree&); void attachAsChild(MSTabularTreeCursor const&, unsigned long, MSTabularTree&); void attachSubtreeAsRoot(MSTabularTree&, MSTabularTreeCursor const&); void attachSubtreeAsChild(MSTabularTreeCursor const&, unsigned long, MSTabularTree&, MSTabularTreeCursor const&); void permuteChildren(MSTabularTreeCursor const&, const MSIndexVector&); unsigned long removeAll(void); unsigned long removeSubtree(MSTabularTreeCursor const&); Element const& elementAt(MSTabularTreeCursor const&) const; Element& elementAt(MSTabularTreeCursor const&); void replaceAt(MSTabularTreeCursor const&,Element const&); unsigned long numberOfElements(void) const; unsigned long numberOfSubtreeElements(MSTabularTreeCursor const&) const; unsigned long numberOfLeaves(void) const; unsigned long numberOfSubtreeLeaves(MSTabularTreeCursor const&) const; unsigned long position(MSTabularTreeCursor const&) const; MSTabularTreeCursor* newCursor(void) const; MSBoolean isEmpty(void) const; MSBoolean isRoot(MSTabularTreeCursor const&) const; MSBoolean isLeaf(MSTabularTreeCursor const&) const; MSBoolean hasChild(unsigned long,MSTabularTreeCursor const&) const; MSBoolean setToRoot(MSTabularTreeCursor&) const; MSBoolean setToChild(unsigned long,MSTabularTreeCursor&) const; MSBoolean setToParent(MSTabularTreeCursor&) const; MSBoolean setToFirstExistingChild(MSTabularTreeCursor&) const; MSBoolean setToNextExistingChild(MSTabularTreeCursor&) const; MSBoolean setToLastExistingChild(MSTabularTreeCursor&) const; MSBoolean setToPreviousExistingChild(MSTabularTreeCursor&) const; MSBoolean setToFirst(MSTabularTreeCursor&,MSTabularTreeIterationOrder) const; MSBoolean setToNext(MSTabularTreeCursor&,MSTabularTreeIterationOrder) const; MSBoolean setToLast(MSTabularTreeCursor&,MSTabularTreeIterationOrder) const; MSBoolean setToPrevious(MSTabularTreeCursor&,MSTabularTreeIterationOrder) const; MSBoolean allElementsDo(MSBoolean (*function)(Element&,void*), MSTabularTreeIterationOrder, void* additionalArgument=0); MSBoolean allElementsDo(MSTabularTreeIterator&, MSTabularTreeIterationOrder); MSBoolean allElementsDo(MSBoolean (*function)(Element const&,void*), MSTabularTreeIterationOrder, void* additionalArgument=0) const; MSBoolean allElementsDo(MSTabularTreeConstantIterator&, MSTabularTreeIterationOrder) const; MSBoolean allSubtreeElementsDo(MSTabularTreeCursor const&, MSBoolean (*function)(Element&,void*), MSTabularTreeIterationOrder, void* additionalArgument=0); MSBoolean allSubtreeElementsDo(MSTabularTreeCursor const&, MSTabularTreeIterator&,MSTabularTreeIterationOrder); MSBoolean allSubtreeElementsDo(MSTabularTreeCursor const&, MSBoolean (*function)(Element const&,void*), MSTabularTreeIterationOrder,void* additionalArgument=0) const; MSBoolean allSubtreeElementsDo(MSTabularTreeCursor const&, MSTabularTreeConstantIterator&, MSTabularTreeIterationOrder) const; MSBoolean isConsistent(void) const; private: void copySubtree(MSTabularTreeNode* from); void copySubtree(MSTabularTreeNode*& to,MSTabularTreeNode* from); unsigned long removeSubtree(MSTabularTreeNode*); MSTabularTreeNode *newNode(Element const&); MSTabularTreeNode *nodeAt(MSTabularTreeCursor const&) const; MSTabularTreeNode *nodeAt(MSTabularTreeCursor&); void checkCursorIsForThis(MSTabularTreeCursor const&) const; void checkCursor(MSTabularTreeCursor const&) const; void checkCursorOfTree(MSTabularTree const&,MSTabularTreeCursor const&) const; void reservePosition(unsigned long position,MSTabularTreeNode*); void checkPosition(unsigned long position,MSTabularTreeNode*) const; void checkRootNotExists(void) const; void checkChildNotExists(MSTabularTreeNode*) const; static MSBoolean constantFunctionIteration(void *function,void* env,void const* node); static MSBoolean functionIteration(void *function,void* env,void* node); static MSBoolean constantIteratorIteration(void* iterator,void const* node); static MSBoolean iteratorIteration(void* iterator,void* node); MSBoolean setToParent(MSTabularTreeNode*& node) const; MSBoolean setToFirstExistingChild(MSTabularTreeNode*& node) const; MSBoolean setToNextExistingChild(MSTabularTreeNode*& node) const; MSBoolean setToLastExistingChild(MSTabularTreeNode*& node) const; MSBoolean setToPreviousExistingChild(MSTabularTreeNode*& node) const; MSBoolean setToFirst(MSTabularTreeNode*& node,MSTabularTreeIterationOrder order) const; MSBoolean setToNext(MSTabularTreeNode*& node,MSTabularTreeIterationOrder order) const; MSBoolean setToLast(MSTabularTreeNode*& node,MSTabularTreeIterationOrder order) const; MSBoolean setToPrevious(MSTabularTreeNode*& node,MSTabularTreeIterationOrder order) const; void initNode(MSTabularTreeNode* node,MSTabularTreeNode* parent) const; unsigned long numberOfSubtreeElements(MSTabularTreeNode const*) const; unsigned long numberOfSubtreeLeaves(MSTabularTreeNode const*) const; MSBoolean isLeaf(MSTabularTreeNode const*) const; unsigned long position(MSTabularTreeNode const*) const; void attachSubtreeAsRoot(MSTabularTree&,MSTabularTreeNode*); void attachSubtreeAsChild(MSTabularTreeNode* to, unsigned long pos, MSTabularTree&, MSTabularTreeNode* from); MSBoolean allElementsDo(void* function, MSTabularTreeIterationOrder order, void* env, MSBoolean (*apply) (void *function,void* env,void* node), MSTabularTreeNode* subtreeRoot); MSBoolean allElementsDo(void* function, MSTabularTreeIterationOrder order, void* env, MSBoolean (*apply) (void *function,void* env,void const* node), MSTabularTreeNode* subtreeRoot) const; MSBoolean allElementsDo(void* iterator, MSTabularTreeIterationOrder order, MSBoolean (*apply) (void* iterator,void* node), MSTabularTreeNode* subtreeRoot); MSBoolean allElementsDo(void* iterator, MSTabularTreeIterationOrder order, MSBoolean (*apply) (void* iterator,void const* node), MSTabularTreeNode* subtreeRoot) const; MSBoolean checkNode(MSTabularTreeNode const*,MSTabularTreeNode const*) const; MSBoolean checkNode(MSTabularTreeNode const*) const; protected: MSBoolean isConsistent(MSTabularTreeNode const*) const; }; #endif aplus-fsf-4.22/src/MSTypes/MSTabularTreeCursor.H0000644000265000001440000000322710772770464015154 #ifndef MSTabularTreeCursorHEADER #define MSTabularTreeCursorHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include template class MSTabularTree; template class MSTabularTreeNode; template class MSTabularTreeCursor { protected: MSTabularTree const *_pTabularTree; MSTabularTreeNode *_pNode; friend class MSTabularTree; MSBoolean isFor(MSTabularTree const& c) const { return MSBoolean(_pTabularTree==&c); } public: MSTabularTreeCursor(MSTabularTree const& collection) : _pTabularTree(&collection),_pNode(0) {}; MSTabularTreeCursor() : _pTabularTree(0),_pNode(0) {}; MSBoolean setToRoot(); MSBoolean setToChild(unsigned long); MSBoolean setToParent(); MSBoolean setToFirstExistingChild(); MSBoolean setToNextExistingChild(); MSBoolean setToLastExistingChild(); MSBoolean setToPreviousExistingChild(); MSBoolean isValid() const; void invalidate(); Element const& element() const { return _pTabularTree->elementAt(*this); } MSBoolean operator==(MSTabularTreeCursor const& cursor) const { return (_pTabularTree==cursor._pTabularTree&&_pNode==cursor._pNode)?MSTrue:MSFalse; } MSBoolean operator!=(MSTabularTreeCursor const& cursor) const { return (_pTabularTree!=cursor._pTabularTree||_pNode!=cursor._pNode)?MSTrue:MSFalse; } }; #endif aplus-fsf-4.22/src/MSTypes/MSTabularTreeDefs.H0000644000265000001440000000347310772770464014563 #ifndef MSTabularTreeDefsHEADER #define MSTabularTreeDefsHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include enum MSTabularTreeIterationOrder {MSPreorder,MSPostorder}; #define MSTabularTreeCursorNotForThisText "cursor not for this tree" #define MSTabularTreeCursorNotForGivenText "cursor not for given tree" #define MSTabularTreeCursorNotContainedText "cursor not contained" #define MSTabularTreeInvalidCursorText "invalid cursor" #define MSTabularTreeInvalidPositionText "invalid position" #define MSTabularTreeRootAlreadyExistsText "root already exists" #define MSTabularTreeChildAlreadyExistsText "child already exists" #define MSTabularTreeOutOfCollectionMemoryText "out of memory" class MSTabularTreeCursorInvalid : public MSExceptionError { public: MSTabularTreeCursorInvalid(const char* what_arg) : MSExceptionError(what_arg) {;} }; class MSTabularTreePositionInvalid : public MSExceptionError { public: MSTabularTreePositionInvalid(const char* what_arg) : MSExceptionError(what_arg) {;} }; class MSTabularTreeRootAlreadyExists : public MSExceptionError { public: MSTabularTreeRootAlreadyExists(const char* what_arg) : MSExceptionError(what_arg) {;} }; class MSTabularTreeChildAlreadyExists : public MSExceptionError { public: MSTabularTreeChildAlreadyExists(const char* what_arg) : MSExceptionError(what_arg) {;} }; class MSTabularTreeOutOfMemory : public MSOutOfMemory { public: MSTabularTreeOutOfMemory(const char* what_arg) : MSOutOfMemory(what_arg) {;} }; #endif aplus-fsf-4.22/src/MSTypes/MSTerm.H0000644000265000001440000003536310772770464012461 #ifndef MSTermHEADER #define MSTermHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include /*---------------------------------------------------------------------------------| | DESCRIPTION | | | | MSTerm represents a span of time, given in days, calendar months, and | | calendar years. It is primarily used to calculate what date a term | | would end on, given a specific starting date. Given a MSDate which is | | set to the starting date, you can simply add the MSTerm to it (using | | the MSDate::operator+(const MSTerm&) function) and the result will | | be a MSDate set to the date the term ends on. We generally describe | | how MSTerms work by describing what MSDate is produced when they are | | added to a given MSDate. | | | | In general, the number of days in a MSTerm is not a constant because | | the number of days in a month (or days in a year) in not a constant; | | the length of a term depends on the date that you start from. In the | | common case, if you add 1 month to a date you will end on the same day | | of the month in the next month, e.g. Jan. 15 plus 1 month yields Feb. | | 15 (for a term of 31 days), Feb. 15 plus 1 month yields Mar. 15 (for a | | term of 28 days, or 29 days in a leap year). | | | | There are some special cases, though. If you start on the last day of | | the month and add some number of months (and no days), you always will | | end on the last day of a month. For example, one month from March 31 | | is April 30 (30 days), while one month from April 30 is May 31 (31 | | days). Also, adding a month to a date will never actually skip a | | month. For example, if you add one month to Jan. 29, you will not end | | on a date sometime in March, but rather you will end on Feb. 28 (or | | Feb. 29 in a leap year). | | | | Because of the special way months (and years) are handled with a | | MSTerm, you need to be careful about defining terms; a term of 90 | | days is always 90 days, while a term of 3 calendar months can be | | anywhere from 89 to 92 days. | | | | Terms which have 0 years and 0 months do not do anything special with | | the days. Terms are, by convention, never negative periods of time, | | but you can subtract them from dates (see "Warnings"). There is no | | checking on the days, months, or years to see if they are negative, | | so be careful when setting them. Adding terms toformather produces terms | | which are the sums of their periods: | | | | | 1year 9months 5days + 1year 6months 28days = 2years 15months 33days | | | | Note that MSTerms are not "inclusive" when used with MSDates; when | | you add one month to Jan. 1 you format Feb. 1, not Jan. 31. Also, because | | of the special handling of months, (date + term1) + term2 is not | | necessarily the same as date + (term1 + term2). You really need to | | think carefully about what you want to do. | | | | Two MSTerms are == only if they have identical years, months, and | | days. In general, you should not be comparing terms. To see which of | | two terms is longer, pick a starting date, add each of the terms to | | it, and see which produces the latest result (see which MSDate is > | | the other). The compare() function is provided for sorting terms by | | length, and is approximately correct (it assumes equal length months | | and equal length years); it is fine for ordering lists of similar | | kinds of terms, but it should not be relied on for critical date | | calculations. | | | |----------------------------------------------------------------------------------| | OTHER WAYS | | | | There are other ways to represent time periods, and you need to think | | about which way to do it.: | | | | MSDate gives you a time span in days when you subtract one date from | | another; this is the best method for representing a definite period of | | time and should always be used if possible. | | | | The MSNormalizedYears object represents a time span based on a | | 365.25-day year and is only for use with the analytics library; | | applications should always use dates, days, and terms. If you want the | | difference between two random dates, in years (for analytics), use the | | MSNormalizedYears(const MSDate&, const MSDate&) constructor, which | | gives you the absolute (never negative) difference between the two | | dates, in years. See MSNormalizedYears for more details about | | normalized years. | | | | Use MSTerms only when the real-world specification is given in months | | or years; for example, to find out what date is 3 months from today, | | create a term of 3 months and add it to today. | | | |----------------------------------------------------------------------------------| | EXAMPLE DATE CALCULATIONS | | | | MSDate + MSTerm gives MSDate: 1/31/90 + 2yrs1mo0day gives 2/29/92 | | | | MSDate + int (days) gives MSDate: 1/31/92 + 30 give 3/1/92 | | | | To convert MSNormalizedYears to a number of days use MSNormalizedYears.days() | | | | MSDate + MSNormalizedYears == MSDate + MSNormalizedYears.days() gives MSDate | | | | MSNormalizedYears between two dates: MSNormalizedYears(MSDate, MSDate) | | | | Days between two dates: MSDate - MSDate (can be negative); | | | | Term of given number of days: MSTerm(0,0,days) | | | |----------------------------------------------------------------------------------| | CONVERTING A MSTerm TO SOMETHING ELSE | | | | You cannot directly convert a MSTerm to any other time span, since | | terms are varying lengths of time based on the starting date. If you | | have the real starting date, use it; otherwise, you can format an | | approximate answer by using today as a starting date: | | | | Days in term: ((MSDate + MSTerm) - MSDate). | | | | Normalized years in term: MSNormalizedYears((MSDate + MSTerm), MSDate). | | | |----------------------------------------------------------------------------------| | TERM BETWEEN TWO DATES | | | | You usually don't want to represent the time between two given dates | | as a term. What you usually want is to determine if some date is more | | than some term away from some other date. Use (MSDate + MSTerm) and | | compare to other MSDate. | | | | Example, is date_x more than 2 years after date_y? | | | | date_x > (MSTerm(2,0,0) + date_y) | | | | If you have to, you can construct a MSTerm from two MSDates, which | | will give you a term that, when added to the earlier date, will give | | you the later date, and that has years >= 0, 12 > months >= 0, 30 >= | | days >= 0. The only reason to do this is when you need to display a | | time span as a term; otherwise, it is much better to use the number of | | days between the two dates. As discussed under "Warnings," there can | | be several different ways of describing the term between two dates, | | so this method of constructing a MSTerm is somewhat unreliable. The | | number of days between two dates is unique and always accurate. | | | |----------------------------------------------------------------------------------| | WARNINGS | |----------------------------------------------------------------------------------| | | | There are fundamental asymmetries in calendar arithmetic. For example, | | 3/30/90 + 1 month is 4/30/90, but 3/31/90 + 1 month is 4/30/90, so | | what is 4/30/90 - 1 month? MSDate says that 4/30/90 - 1 month is | | 3/31/90. Similarly, there can be many different terms that, when added | | to a date, give the same final date. Some of these will, when | | subtracted from the final date, give the original start date, and some | | will not. There is no way to tell which of the terms you really want | | when constructing a term from two dates, so MSTerm cannot guarantee | | that MSTerm(date, date + term) will give you back your original term. | | And since two terms are equal only if they have identical years, | | months, and days, it is common for MSTerm(date, date + term) != term. | | | | When constructing a MSTerm from two dates, MSTerm tries to minimize | | the number of days (as opposed to months) in the term; given a choice | | between a term of 30 days and a term of 1 month, MSTerm will create a | | term of 1 month. MSTerm promises that min(date1,date2) + | | MSTerm(date1, date2) is always equal to max(date1,date2), but will | | not promise that max(date1,date2) - MSTerm(date2, date2) is equal to | | min(date1,date2). Going back to our example, MSTerm(3/30/90, 4/30/90) | | is 1 month, so the addition works but the subtraction fails. We could | | insure that both addition and subtraction would work for any date | | pair, but this would mean that the term between 3/30/90 and 4/30/90 is | | 31 days, while the term between 3/29/90 and 4/29/90 is one month. We | | have chosen one irregularity over the other. | | | | Be careful when using MSNormalizedYears. Just calculate them and pass | | them to analytics. Don't try to use them on your own; use the real | | number of days instead. | | | |----------------------------------------------------------------------------------| | WHERE ARE THE OPERATORS? | | | | The actual MSDate + MSTerm operators are declared in and | | are documented (briefly) in the MSDate documentation. The | | description of what they actually do is in the paragraphs above. | | | |---------------------------------------------------------------------------------*/ class MSDate; class MSFormat; // The "smart" date + term operator is in MSDate, becuase MSDate // has all the tables of calendar data. class MSTypesExport MSTerm: public MSScalarModel { public: enum MSTermFormat { // YearMonthDayPad pads y,m,d if needed so they line // up, YearMonthDayNoPad uses no extra padding YearsMonthsDays=500, // Format as "11y 3d" YearsMonthsDaysPad=501, // Format as "11y 0m 0w 3d" YearsMonthsDaysNoPad=502, // Format as "11y 0m 0w 3d" // for backward compatibility YearMonthDay=YearsMonthsDays, // Format as "11y 3d" YearMonthDayPad=YearsMonthsDaysPad, // Format as "11y 0m 0w 3d" YearMonthDayNoPad=YearsMonthsDaysNoPad // Format as "11y 0m 0w 3d" }; MSTerm(void); MSTerm(const MSTerm&); MSTerm(int y,int m=0,int d=0); MSTerm(const char *s) {set(s); } // Term between two dates. Use only for display,otherwise use // number of days. Order of dates not important. See Warning above. MSTerm(const MSDate&,const MSDate&); virtual MSString asString(void) const; virtual MSString asDebugInfo(void) const; virtual MSString asMSF(void) const; virtual MSString className(void) const; virtual const MSSymbol& type(void) const; virtual MSModel *clone(void) const; virtual MSModel *create(void) const; virtual void assign(const MSModel&); virtual long compare(const MSModel&) const; virtual MSError::ErrorStatus set(const char *); virtual MSError::ErrorStatus setFromMSF(const char *); static const MSSymbol& symbol(void); MSTerm& operator=(const MSTerm&); MSError::ErrorStatus set(const MSString *); MSError::ErrorStatus set(const MSString &); MSError::ErrorStatus set(int y,int m,int d); const char *format(MSString *) const; const char *format(MSString &) const; const char *format(MSString *,MSTermFormat) const; const char *format(MSString &,MSTermFormat) const; const char *format(MSString*,const MSFormat&) const; const char *format(MSString&,const MSFormat&) const; long compare(const MSTerm *) const; long compare(const MSTerm &) const; int years(void) const { return _years; } int months(void) const { return _months; } int days(void) const { return _days; } MSBoolean isSet(void) const { return _isSet; } void unset(void); MSTerm operator+(const MSTerm&) const; MSTerm& operator+=(const MSTerm&); MSBoolean operator==(const MSTerm&) const; MSBoolean operator!=(const MSTerm&) const; MSBoolean operator<(const MSTerm&) const; MSBoolean operator<=(const MSTerm&) const; MSBoolean operator>(const MSTerm&) const; MSBoolean operator>=(const MSTerm&) const; friend MSTypesExport ostream& operator<<(ostream&,const MSTerm&); private: int _years; int _months; int _days; MSBoolean _isSet; double normalizedYears(void) const; MSTerm(const MSTerm&,const MSTerm&); // use to add two terms // The following is used for parsing input. enum Token {BAD,YEARS,MONTHS,WEEKS,DAYS,END}; unsigned totalDays(void); static void getToken(const char*,int*,Token*,int*); }; inline long compare(const MSTerm& aTerm_,const MSTerm& bTerm_) { return aTerm_.compare(bTerm_); } #ifndef MS_NO_INLINES #ifndef MSTermINLINES #include #endif #endif #endif aplus-fsf-4.22/src/MSTypes/MSTime.H0000644000265000001440000001736010772770464012445 #ifndef MSTimeHEADER #define MSTimeHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include class MSDate; class MSMBSDate; class MSFormat; class MSHashTable; class MSTypesExport MSTime : public MSScalarModel { public: friend class MSDate; friend class MSMBSDate; enum MSTimeZone { A=0,N,B,O,C,P,D,Q,E,R,F,S,G,T,H,U,I,V,K,W,L,X,M,Y,Z, BST,EET,EET_DST,EEST=EET_DST,MET,MET_DST,MEST=MET_DST,WET,WET_DST,WEST=WET_DST,MSK,MSD, JST,HKT,SGT,KST,KDT,AEST,AESST,ACST,ACSST,AWST,NZST,NZDT, NST,NDT,AST,ADT,EST,EDT,CST,CDT,MST,MDT,PST,PDT,AKST,YST=AKST,AKDT,YDT=AKDT,HAST,HADT,HST, UT,GMT,Local }; enum MSTimeFormat { HoursMinutesSeconds=600, // Format as 12:30:28 MonthDayYear=601, // Format as 02/28/94 HoursMinutesSecondsSlash=602, // Format as 12:30:28 02/28/94 HoursMinutesSecondsSlashZone=603, // Format as 12:30:28 02/28/94 PST HoursMinutesSecondsSlash4=604, // Format as 12:30:28 02/28/1994 HoursMinutesSecondsSlash4Zone=605, // Format as 12:30:28 02/28/1994 PST CalendarTime=606, // Format as seconds since 1970 GMT, plus the source time zone Strftime=607 // Format as Standard C Library strftime format }; INLINELINKAGE MSTime(void); INLINELINKAGE MSTime(const MSTime&); INLINELINKAGE MSTime(const char *, MSTimeZone =Local); INLINELINKAGE MSTime(const MSString&, MSTimeZone =Local); MSTime(const MSString&,const char* strptimeFormat_,MSTimeZone=Local); MSTime(const MSDate&,MSTimeZone=Local); INLINELINKAGE MSTime(time_t); INLINELINKAGE ~MSTime(void); virtual MSString asString(void) const; virtual MSString asDebugInfo(void) const; virtual MSString asMSF(void) const; virtual MSString className(void) const; virtual const MSSymbol& type(void) const; virtual MSModel *clone(void) const; virtual MSModel *create(void) const; virtual void assign(const MSModel&); virtual long compare(const MSModel&) const; virtual MSError::ErrorStatus set(const char *); virtual MSError::ErrorStatus setFromMSF(const char *); static const MSSymbol& symbol(void); MSError::ErrorStatus set(const char *, MSTimeZone); MSError::ErrorStatus set(const MSString*, MSTimeZone =Local); MSError::ErrorStatus set(const MSString&, MSTimeZone =Local); const char *format(MSString*) const; const char *format(MSString&) const; const char *format(MSString*,MSTimeFormat,MSTimeZone=MSTime::Local) const; const char *format(MSString&,MSTimeFormat,MSTimeZone=MSTime::Local) const; const char *format(MSString*,MSTimeFormat,const char *timeZone_) const; const char *format(MSString&,MSTimeFormat,const char *timeZone_) const; const char *format(MSString*,const MSFormat&,MSTimeZone=MSTime::Local) const; const char *format(MSString&,const MSFormat&,MSTimeZone=MSTime::Local) const; const char *format(MSString*,const char* strftimeFormat_) const; const char *format(MSString&,const char* strftimeFormat_) const; MSError::ErrorStatus setNow(void); INLINELINKAGE void setInvalid(void); INLINELINKAGE MSTime max(const MSTime&) const; INLINELINKAGE MSTime min(const MSTime&) const; INLINELINKAGE MSBoolean between(const MSTime&,const MSTime&) const; INLINELINKAGE MSTime atMidnight(MSTimeZone=Local) const; INLINELINKAGE MSBoolean isAtMidnight(MSTimeZone=Local) const; unsigned long differenceInDays(const MSTime&,MSTimeZone=Local) const; INLINELINKAGE unsigned long secondsPastMinute(MSTimeZone=Local) const; INLINELINKAGE unsigned long minutesPastHour(MSTimeZone=Local) const; INLINELINKAGE unsigned long hoursPastMidnight(MSTimeZone=Local) const; INLINELINKAGE MSBoolean isSet(void) const; INLINELINKAGE MSBoolean isValid(void) const; void unset(void); INLINELINKAGE operator double() const; INLINELINKAGE operator time_t() const; INLINELINKAGE MSBoolean operator==(const MSTime&) const; INLINELINKAGE MSBoolean operator!=(const MSTime&) const; INLINELINKAGE MSBoolean operator<=(const MSTime&) const; INLINELINKAGE MSBoolean operator>=(const MSTime&) const; INLINELINKAGE MSBoolean operator< (const MSTime&) const; INLINELINKAGE MSBoolean operator> (const MSTime&) const; INLINELINKAGE MSTime& operator=(const MSTime&); INLINELINKAGE MSTime& operator=(const MSString&); INLINELINKAGE MSTime& operator=(const char *); INLINELINKAGE MSTime& operator=(time_t); inline friend MSTypesExport unsigned long hash(const MSTime&,unsigned long size_); // Add seconds. MSTime operator+(long) const; INLINELINKAGE MSTime& operator+=(long); friend MSTypesExport MSTime operator+(long,const MSTime&); // Subtract seconds. MSTime operator-(long) const; INLINELINKAGE MSTime& operator-=(long); // time + term = time MSTime operator+(const MSTerm&) const; MSTime& operator+=(const MSTerm&); friend MSTypesExport MSTime operator+(const MSTerm&,const MSTime&); // Note: (Time + Term) - Time != time in some cases // 00:00:00 3/30/90 + 1 month = 00:00:00 4/30/90 // 00:00:00 4/30/90 - 1 month = 00:00:00 3/31/90 // Avoid using (time - term) if possible MSTime operator-(const MSTerm&) const; MSTime& operator-=(const MSTerm&); INLINELINKAGE MSTime& operator++(); // Prefix INLINELINKAGE MSTime& operator--(); INLINELINKAGE MSTime operator++(int); // Postfix INLINELINKAGE MSTime operator--(int); static MSTimeZone setLocalTimeZone(void); static INLINELINKAGE MSTimeZone localTimeZone(void); static time_t currentTime(void); static INLINELINKAGE time_t nullTime(void); static INLINELINKAGE MSTime now(void); static INLINELINKAGE MSTimeFormat defaultFormat(void); static INLINELINKAGE void defaultFormat(MSTimeFormat); static INLINELINKAGE const MSString& strftimeDefaultFormat(void); static INLINELINKAGE void strftimeDefaultFormat(MSString&); static INLINELINKAGE void strftimeDefaultFormat(const char *); static INLINELINKAGE void defaultConstructToNow(MSBoolean); static INLINELINKAGE MSBoolean defaultConstructToNow(void); friend MSTypesExport ostream& operator<<(ostream&,const MSTime&); protected: time_t _time; // Seconds since 1970 GMT static MSHashTable *_zoneHashTable; static MSTimeZone _localTimeZone; static MSTimeFormat _defaultFormat; static MSString _strftimeDefaultFormat; static MSBoolean _defaultConstructToNow; static time_t _nullTime; static const long SECS_IN_MIN; static const long SECS_IN_HOUR; static const long SECS_IN_DAY; time_t convertDate(const MSDate&) const; long zoneOffset(const char*) const; INLINELINKAGE long zoneOffset(MSTimeZone) const; static long zoneOffset(time_t, MSTimeZone); static long zoneOffset(const struct tm *); static const char *zoneName(const struct tm *); MSError::ErrorStatus internalSet(const char *, MSTimeZone =Local); void strftimeFormat(MSString&,const char*,const char*) const; void strftimeFormat(MSString&,const char*,MSTimeZone,MSBoolean =MSFalse) const; long scanTimeZone(const char *); static MSHashTable *zoneHashTable(void) { return _zoneHashTable; } static MSHashTable *initZoneHashTable(void); static long greenwichMeanTime(struct tm*,MSTimeZone); }; inline long compare(const MSTime& aTime_,const MSTime& bTime_) { return aTime_==bTime_?0:(aTime_>bTime_?1:-1); } inline unsigned long hash(const MSTime& aTime_,unsigned long size_) { return aTime_._time%size_; } #ifndef MS_NO_INLINES #ifndef MSTimeINLINES #include #endif #endif #endif aplus-fsf-4.22/src/MSTypes/MSTimeVector.H0000644000265000001440000000377710772770465013640 #ifndef MSTimeVectorHEADER #define MSTimeVectorHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include typedef MSTypeVector MSTimeVector; inline MSTime msBadData(const MSTime&) { return MSTime::nullTime(); } // We provide provide explicit "do_not_instantiate" pragmas here to avoid instantiation complications in // MStk applications. // #if !defined(__MSTYPESLIBRARY_BUILD__) && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma do_not_instantiate MSVectorModelAllocator #pragma do_not_instantiate MSTypeData > #pragma do_not_instantiate MSBaseVector > #pragma do_not_instantiate MSBaseVectorOps > #pragma do_not_instantiate MSObjectVector #pragma do_not_instantiate MSVectorElement #pragma do_not_instantiate MSTypeVector #pragma do_not_instantiate ostream& operator<<(ostream&, const MSBaseVector >&) #pragma do_not_instantiate unsigned int msMergeSortUp(unsigned int, MSTime *, unsigned int *,unsigned int, unsigned int) #pragma do_not_instantiate unsigned int msMergeSortDown(unsigned int, MSTime *, unsigned int *,unsigned int, unsigned int) #endif // !__MSTYPESLIBRARY_BUILD__ && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #if defined(MS_VC_NEED_TEMPLATE_EXPORT) class MSTypesExport MSBaseVector >; class MSTypesExport MSBaseVectorOps >; class MSTypesExport MSObjectVector; class MSTypesExport MSVectorElement; class MSTypesExport MSTypeVector; #endif #endif //MSTimeVectorHEADER aplus-fsf-4.22/src/MSTypes/MSTypeData.H0000644000265000001440000000624610772770465013264 #ifndef MSTypeDataHEADER #define MSTypeDataHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MSDefinesHEADER #include #endif #ifdef MS_MULTI_THREAD #include #endif #if defined(MS_NEED_IMPLEMENTATION_PRAGMA) #pragma implementation("MSTypeData.C") #endif #if HAVE_NEW #include #else #include #endif #include #include #ifdef MS_OFFSETOF_IN_STDDEF #include #endif class MSString; // // Note that MS_COMPLEX_TEMPLATE_DEFAULT(x) will expand to: ' =x' or nothing, // depending on the compiler's capabilities and/or flag settings (see MSDefines.H). // template ) > class MSTypeData : public MSData { public: MSTypeData(); MSTypeData (unsigned int); ~MSTypeData(); MSString asDebugInfo() const; void *operator new (size_t, unsigned =0); void operator delete (void *); INLINELINKAGE MSTypeData *incrementCount(); INLINELINKAGE void decrementCount (MSAllocationFlag =MSConstructed, unsigned int =0); INLINELINKAGE const Type *elements() const; INLINELINKAGE const Type *data() const; // same as elements(); used for backward compatibility only INLINELINKAGE Type *elements(); INLINELINKAGE Type *data(); // same as elements(); used for backward compatibility only INLINELINKAGE const Type& elementAt(unsigned index_) const; INLINELINKAGE Type& elementAt(unsigned index_); void set (unsigned int, const Type &, MSAllocationFlag =MSConstructed); static void constructElements(Type *, unsigned int, const Type&); static void destroyElements(Type *, unsigned int); static void fill (Type *, unsigned int, const Type &, MSAllocationFlag =MSConstructed); static void copy (const Type *, Type *, unsigned int, MSAllocationFlag =MSConstructed); static void copyBackward (const Type *, Type *, unsigned int); static MSTypeData *allocateWithSize (unsigned int, MSAllocationFlag =MSConstructed, unsigned int =0); static MSTypeData *allocateWithLength (unsigned int, MSAllocationFlag =MSConstructed, unsigned int =0); void deallocate(MSAllocationFlag =MSConstructed, unsigned int =0); protected: INLINELINKAGE static unsigned int dataOffset(void); // // ***** PLEASE NOTE ***** // // This class cannot contain any data members of its own; the only data members that it can have // are those inherited from MSData base class. The reason for this is that MSTypeData will // allocate an array of data elements **directly following** the end of MSData data members, // including the possible padding for alignment. // }; template INLINELINKAGE MSBoolean isConstructionNeeded(Type *); template INLINELINKAGE MSBoolean isDestructionNeeded(Type *); #ifndef MS_NO_INLINES #include #endif // MS_NO_INLINES #endif // MSTypeDataHEADER aplus-fsf-4.22/src/MSTypes/MSTypeMatrix.H0000644000265000001440000006064010772770465013655 #ifndef MSTypeMatrixHEADER #define MSTypeMatrixHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // /////////////////////////////////////////////////////////////////////////////// #include #include #include #ifndef MSDefinesHEADER #include #endif #if defined(MS_NEED_IMPLEMENTATION_PRAGMA) #pragma implementation("MSTypeMatrix.C") #endif // These are specializations of MSTypeMatrix // and need to be included before MSTypeMatrix // is defined or else lcc cannot deal correctly // with automatic template instantiation. // Same for Visual C++ #if defined(MS_NEED_TEMPLATE_SPECIALIZATION_BUG) #if !defined(__MSTYPESLIBRARY_BUILD__) #include #endif #endif template class MSTypeMatrix; template class MSTypeVector; template class MSMatrixSTypePick; // MSTypeMatrix indexed by an unsigned int class MSBinaryVector; #if defined(MS_PREDECLARE_TEMPLATE_FRIENDS) template class MSTypeMatrix; template ostream& operator<<(ostream&, const MSTypeMatrix&); template MSTypeMatrix operator-(const MSTypeMatrix&); template inline MSBoolean operator<(const MSTypeMatrix&, const MSTypeMatrix&); template inline MSBoolean operator>(const MSTypeMatrix&, const MSTypeMatrix&); template inline MSBoolean operator<=(const MSTypeMatrix&, const MSTypeMatrix&); template inline MSBoolean operator>=(const MSTypeMatrix&, const MSTypeMatrix&); template inline MSBoolean operator<(const MSTypeMatrix&, Type); template inline MSBoolean operator<(Type, const MSTypeMatrix&); template inline MSBoolean operator>(const MSTypeMatrix&, Type); template inline MSBoolean operator>(Type, const MSTypeMatrix&); template inline MSBoolean operator<=(const MSTypeMatrix&, Type); template inline MSBoolean operator<=(Type, const MSTypeMatrix&); template inline MSBoolean operator>=(const MSTypeMatrix&, Type); template inline MSBoolean operator>=(Type, const MSTypeMatrix&); template inline MSBoolean operator==(const MSTypeMatrix&, Type); template inline MSBoolean operator==(Type, const MSTypeMatrix&); template inline MSBoolean operator!=(const MSTypeMatrix&, Type); template inline MSBoolean operator!=(Type, const MSTypeMatrix&); template inline MSBoolean operator==(const MSTypeMatrix&, const MSTypeMatrix&); template inline MSBoolean operator!=(const MSTypeMatrix&, const MSTypeMatrix&); template MSTypeMatrix operator+(const MSTypeMatrix&, Type); template MSTypeMatrix operator+(Type, const MSTypeMatrix&); template MSTypeMatrix operator+(const MSTypeMatrix&, const MSTypeMatrix&); template MSTypeMatrix operator-(const MSTypeMatrix&, Type); template MSTypeMatrix operator-(const MSTypeMatrix&, const MSTypeMatrix&); template MSTypeMatrix operator*(const MSTypeMatrix&, Type); template MSTypeMatrix operator*(Type, const MSTypeMatrix&); template MSTypeMatrix operator*(const MSTypeMatrix&, const MSTypeMatrix&); template MSTypeMatrix operator/(const MSTypeMatrix&, Type); template MSTypeMatrix operator/(const MSTypeMatrix&, const MSTypeMatrix&); template MSTypeMatrix operator+(const MSTypeMatrix&, const MSTypeVector&); template MSTypeMatrix operator-(const MSTypeMatrix&, const MSTypeVector&); template MSTypeMatrix operator*(const MSTypeMatrix&, const MSTypeVector&); template MSTypeMatrix operator/(const MSTypeMatrix&, const MSTypeVector&); template MSTypeMatrix operator+(const MSTypeVector&, const MSTypeMatrix&); template MSTypeMatrix operator*(const MSTypeVector&, const MSTypeMatrix&); #endif // MS_PREDECLARE_TEMPLATE_FRIENDS template class MSTypeMatrix : public MSMatrix { public: MSTypeMatrix(void); MSTypeMatrix(unsigned rows_,unsigned columns_); MSTypeMatrix(unsigned rows_,unsigned columns_,Type fill_); MSTypeMatrix(const MSTypeMatrix&); MSTypeMatrix(MSTypeData > *dp_,unsigned rows_,unsigned columns_); MSTypeMatrix(const Type *, unsigned rows_, unsigned columns_); ~MSTypeMatrix(void); virtual MSString asString(void) const; virtual MSString asMSF(void) const; virtual MSString asDebugInfo(void) const; virtual MSString className(void) const; virtual const MSSymbol& type(void) const; virtual MSModel *clone(void) const; virtual MSModel *create(void) const; virtual void assign(const MSModel&); virtual long compare(const MSModel&) const; virtual MSError::ErrorStatus set(const char *pString_); virtual MSError::ErrorStatus setFromMSF(const char *pString_); static const MSSymbol& symbol(void); MSError::ErrorStatus set(unsigned index_,const char *pString_); MSError::ErrorStatus set(unsigned index_,Type); unsigned indexOf(Type aType_,unsigned startPos_=0) const; unsigned lastIndexOf(Type aType_,unsigned startPos_=UINT_MAX-1) const; inline const Type& elementAt(unsigned) const; inline const Type& elementAt(unsigned,unsigned) const; MSTypeMatrix& series(Type offset_=0); MSTypeMatrix& random(unsigned long limit_=0); Type min(void) const; Type max(void) const; double sum(void) const; MSTypeMatrix& operator=(const MSTypeMatrix&); MSTypeMatrix& operator=(const MSMatrixSTypePick&); MSTypeMatrix& operator=(Type); inline Type operator()(unsigned index_) const; inline Type operator[](unsigned index_) const; inline Type operator()(unsigned row_,unsigned column_) const; inline MSMatrixSTypePick operator()(unsigned index_); inline MSMatrixSTypePick operator[](unsigned index_); inline MSMatrixSTypePick operator()(unsigned row_,unsigned column_); friend MSTypesExport ostream& operator<< MS_FRIEND_TEMPLATEID (ostream&,const MSTypeMatrix&); friend MSTypesExport MSTypeMatrix operator- MS_FRIEND_TEMPLATEID (const MSTypeMatrix&); MSTypeMatrix& operator++(); // Prefix MSTypeMatrix& operator--(); MSTypeMatrix operator++(int); // Postfix MSTypeMatrix operator--(int); long compare(const MSTypeMatrix&) const; //inline friend MSTypesExport long compare(const MSTypeMatrix&,const MSTypeMatrix&); MSBinaryMatrix binaryCompare(const MSTypeMatrix&,MSComparison) const; MSBinaryMatrix binaryCompare(Type,MSComparison) const; MSBoolean scalarCompare(Type,MSComparison) const; INLINELINKAGE2 friend MSTypesExport MSBoolean operator< MS_FRIEND_TEMPLATEID (const MSTypeMatrix&, const MSTypeMatrix&); INLINELINKAGE2 friend MSTypesExport MSBoolean operator> MS_FRIEND_TEMPLATEID (const MSTypeMatrix&, const MSTypeMatrix&); INLINELINKAGE2 friend MSTypesExport MSBoolean operator<= MS_FRIEND_TEMPLATEID (const MSTypeMatrix&, const MSTypeMatrix&); INLINELINKAGE2 friend MSTypesExport MSBoolean operator>= MS_FRIEND_TEMPLATEID (const MSTypeMatrix&, const MSTypeMatrix&); INLINELINKAGE2 friend MSTypesExport MSBoolean operator< MS_FRIEND_TEMPLATEID (const MSTypeMatrix&,Type); INLINELINKAGE2 friend MSTypesExport MSBoolean operator< MS_FRIEND_TEMPLATEID (Type,const MSTypeMatrix&); INLINELINKAGE2 friend MSTypesExport MSBoolean operator> MS_FRIEND_TEMPLATEID (const MSTypeMatrix&,Type); INLINELINKAGE2 friend MSTypesExport MSBoolean operator> MS_FRIEND_TEMPLATEID (Type,const MSTypeMatrix&); INLINELINKAGE2 friend MSTypesExport MSBoolean operator<= MS_FRIEND_TEMPLATEID (const MSTypeMatrix&,Type); INLINELINKAGE2 friend MSTypesExport MSBoolean operator<= MS_FRIEND_TEMPLATEID (Type,const MSTypeMatrix&); INLINELINKAGE2 friend MSTypesExport MSBoolean operator>= MS_FRIEND_TEMPLATEID (const MSTypeMatrix&,Type); INLINELINKAGE2 friend MSTypesExport MSBoolean operator>= MS_FRIEND_TEMPLATEID (Type,const MSTypeMatrix&); INLINELINKAGE2 friend MSTypesExport MSBoolean operator== MS_FRIEND_TEMPLATEID(const MSTypeMatrix&,Type); INLINELINKAGE2 friend MSTypesExport MSBoolean operator== MS_FRIEND_TEMPLATEID (Type,const MSTypeMatrix&); INLINELINKAGE2 friend MSTypesExport MSBoolean operator!= MS_FRIEND_TEMPLATEID (const MSTypeMatrix&,Type); INLINELINKAGE2 friend MSTypesExport MSBoolean operator!= MS_FRIEND_TEMPLATEID(Type,const MSTypeMatrix&); INLINELINKAGE2 friend MSTypesExport MSBoolean operator== MS_FRIEND_TEMPLATEID(const MSTypeMatrix&,const MSTypeMatrix&); INLINELINKAGE2 friend MSTypesExport MSBoolean operator!= MS_FRIEND_TEMPLATEID(const MSTypeMatrix&,const MSTypeMatrix&); friend MSTypesExport MSTypeMatrix operator+ MS_FRIEND_TEMPLATEID (const MSTypeMatrix&,Type); friend MSTypesExport MSTypeMatrix operator+ MS_FRIEND_TEMPLATEID (Type,const MSTypeMatrix&); friend MSTypesExport MSTypeMatrix operator+ MS_FRIEND_TEMPLATEID (const MSTypeMatrix&, const MSTypeMatrix&); MSTypeMatrix& operator+=(Type); friend MSTypesExport MSTypeMatrix operator- MS_FRIEND_TEMPLATEID (const MSTypeMatrix&,Type); friend MSTypesExport MSTypeMatrix operator- MS_FRIEND_TEMPLATEID (const MSTypeMatrix&, const MSTypeMatrix&); MSTypeMatrix& operator-=(Type); friend MSTypesExport MSTypeMatrix operator* MS_FRIEND_TEMPLATEID (const MSTypeMatrix&,Type); friend MSTypesExport MSTypeMatrix operator* MS_FRIEND_TEMPLATEID (Type,const MSTypeMatrix&); friend MSTypesExport MSTypeMatrix operator* MS_FRIEND_TEMPLATEID (const MSTypeMatrix&, const MSTypeMatrix&); MSTypeMatrix& operator*=(Type); friend MSTypesExport MSTypeMatrix operator/ MS_FRIEND_TEMPLATEID (const MSTypeMatrix&,Type); friend MSTypesExport MSTypeMatrix operator/ MS_FRIEND_TEMPLATEID (const MSTypeMatrix&, const MSTypeMatrix&); MSTypeMatrix& operator/=(Type); // The following operators are equivalent to the apl operation m_ (x @1 0) v_ friend MSTypesExport MSTypeMatrix operator+ MS_FRIEND_TEMPLATEID (const MSTypeMatrix& m_, const MSTypeVector& v_); friend MSTypesExport MSTypeMatrix operator- MS_FRIEND_TEMPLATEID (const MSTypeMatrix& m_, const MSTypeVector& v_); friend MSTypesExport MSTypeMatrix operator* MS_FRIEND_TEMPLATEID (const MSTypeMatrix& m_, const MSTypeVector& v_); friend MSTypesExport MSTypeMatrix operator/ MS_FRIEND_TEMPLATEID (const MSTypeMatrix& m_, const MSTypeVector& v_); // The following operators are equivalent to the apl operation v_ (x @0 1) m_ friend MSTypesExport MSTypeMatrix operator+ MS_FRIEND_TEMPLATEID (const MSTypeVector& v_, const MSTypeMatrix& m_); friend MSTypesExport MSTypeMatrix operator* MS_FRIEND_TEMPLATEID (const MSTypeVector& v_, const MSTypeMatrix& m_); // matrix multiplication (inner product) static MSTypeMatrix multiply(const MSTypeMatrix&, const MSTypeMatrix&); // stack matrices vertically MSTypeMatrix& stack(const MSTypeMatrix&); static MSTypeMatrix stack(const MSTypeMatrix&, const MSTypeMatrix&); // adjoin matrices horizontally MSTypeMatrix& adjoin(const MSTypeMatrix&); static MSTypeMatrix adjoin(const MSTypeMatrix&, const MSTypeMatrix&); MSTypeMatrix& appendColumn(const MSTypeVector&); MSTypeMatrix& appendColumns(unsigned columns_, Type fill_=0); MSTypeMatrix& appendRow(const MSTypeVector&); MSTypeMatrix& appendRows(unsigned rows_, Type fill_=0); MSTypeMatrix& exchangeColumns(unsigned a_,unsigned b_); MSTypeMatrix& exchangeRows(unsigned a_,unsigned b_); MSTypeMatrix& insertColumnBefore(unsigned column_,Type fill_=0); MSTypeMatrix& insertColumnBefore(unsigned column_,const MSTypeVector&); MSTypeMatrix& insertColumnAfter(unsigned column_,Type fill_=0); MSTypeMatrix& insertColumnAfter(unsigned column_,const MSTypeVector&); MSTypeMatrix& insertRowBefore(unsigned row_,Type fill_=0); MSTypeMatrix& insertRowBefore(unsigned row_,const MSTypeVector&); MSTypeMatrix& insertRowAfter(unsigned row_,Type fill_=0); MSTypeMatrix& insertRowAfter(unsigned row_,const MSTypeVector&); MSTypeMatrix& reshape(unsigned rows_,unsigned columns_); MSTypeMatrix& removeAll(void); MSTypeMatrix& removeAllRows(void); MSTypeMatrix& removeAllColumns(void); MSTypeMatrix& assignRow(unsigned row_, Type scalar_); MSTypeMatrix& assignColumn(unsigned column_, Type scalar_); MSTypeMatrix& assignColumn(unsigned column_,const MSTypeVector&); MSTypeMatrix& assignRow(unsigned row_,const MSTypeVector&); MSTypeMatrix& removeRow(unsigned row_); MSTypeMatrix& removeColumn(unsigned column_); MSTypeMatrix& compressRows(const MSBinaryVector&); MSTypeMatrix& compressColumns(const MSBinaryVector&); MSTypeMatrix& reverseRows(void); MSTypeMatrix& reverseColumns(void); MSTypeMatrix& transpose(void); MSTypeMatrix& rotateRows(int position_); MSTypeMatrix& rotateColumns(int position_); MSTypeMatrix& takeRows(int numberOfRows_); MSTypeMatrix& takeColumns(int numberOfColumns_); MSTypeMatrix& dropRows(int numberOfRows_); MSTypeMatrix& dropColumns(int numberOfColumns_); MSTypeVector rowAt(unsigned row_) const; MSTypeVector columnAt(unsigned column_) const; void error(const char *) const; inline Type *data(void) const; inline unsigned size(void) const; inline unsigned length(void) const; inline MSTypeData > *pData(void) const; protected: friend class MSMatrixSTypePick; static Type _badData; // used as return value for index errors MSTypeData > *_pData; // unsigned _size; MSBoolean _blocked; // inline MSTypeData > *pData(void) const; inline MSBoolean blocked(void) const; inline void blocked(MSBoolean); void reserve(unsigned); void blockLeft(unsigned target_,unsigned moveCount_); void blockRight(unsigned target_,unsigned moveCount_); void freeData(void); void allocData(unsigned); void makeUniqueCopy(void); void prepareToChange(void); inline MSTypeData > *incrementCount(void); inline void decrementCount(void); inline Type& elementAt(unsigned); inline Type& elementAt(unsigned,unsigned); }; template class MSMatrixSTypePick { public: inline MSMatrixSTypePick& operator=(Type); MSMatrixSTypePick& operator+=(Type); MSMatrixSTypePick& operator-=(Type); MSMatrixSTypePick& operator*=(Type); MSMatrixSTypePick& operator/=(Type); MSMatrixSTypePick& operator++(int); MSMatrixSTypePick& operator--(int); inline operator Type() const; inline MSTypeMatrix *pMatrix(void) const; inline Type value(void) const; inline unsigned index(void) const; private: friend class MSTypeMatrix; inline MSMatrixSTypePick(const MSTypeMatrix&,unsigned); inline MSMatrixSTypePick(const MSMatrixSTypePick&); MSTypeMatrix *_pMatrix; unsigned _index; }; //------------------------------------------------------------ // MSTypeMatrix inlines //------------------------------------------------------------ template inline MSTypeData > *MSTypeMatrix::pData(void) const { return _pData; } template inline unsigned MSTypeMatrix::size(void) const { return _pData->size(); } //{ return _size; } template inline unsigned MSTypeMatrix::length(void) const { return _count; } template inline MSBoolean MSTypeMatrix::blocked(void) const { return _blocked; } template inline void MSTypeMatrix::blocked(MSBoolean blocked_) { _blocked=blocked_; } template inline Type& MSTypeMatrix::elementAt(unsigned index_) { #if !defined (MS_NO_INDEX_ERROR) if(index_<_count) return _pData->elementAt(index_); else return indexError(index_,length()),_badData; #else return _pData->elementAt(index_); #endif } template inline const Type& MSTypeMatrix::elementAt(unsigned index_) const { #if !defined (MS_NO_INDEX_ERROR) if(index_<_count) return _pData->elementAt(index_); else return indexError(index_,length()),_badData; #else return _pData->elementAt(index_); #endif } template inline Type& MSTypeMatrix::elementAt(unsigned row_,unsigned column_) { #if !defined (MS_NO_INDEX_ERROR) unsigned ravel=index(row_,column_); if(ravel<_count) return _pData->elementAt(ravel); else return indexError(ravel,length()),_badData; #else return _pData->elementAt(index(row_,column_)); #endif } template inline const Type& MSTypeMatrix::elementAt(unsigned row_,unsigned column_) const { #if !defined (MS_NO_INDEX_ERROR) unsigned ravel=index(row_,column_); if(ravel<_count) return _pData->elementAt(ravel); else return indexError(ravel,length()),_badData; #else return _pData->elementAt(index(row_,column_)); #endif } template inline Type MSTypeMatrix::operator()(unsigned index_) const { return elementAt(index_); } template inline Type MSTypeMatrix::operator[](unsigned index_) const { return elementAt(index_); } template inline Type MSTypeMatrix::operator()(unsigned row_,unsigned column_) const { return elementAt(index(row_,column_)); } template inline MSTypeData > *MSTypeMatrix::incrementCount(void) { return (_pData!=0)?_pData->incrementCount():0; } template inline void MSTypeMatrix::decrementCount(void) { if (_pData!=0) _pData->decrementCount(); } template inline Type *MSTypeMatrix::data(void) const { return (_pData!=0)?_pData->elements():0; } template inline MSBoolean operator<(const MSTypeMatrix& aTypeMatrix_, const MSTypeMatrix& bTypeMatrix_) { return MSBoolean(aTypeMatrix_.compare(bTypeMatrix_)>0); } template inline MSBoolean operator>(const MSTypeMatrix& aTypeMatrix_, const MSTypeMatrix& bTypeMatrix_) { return MSBoolean(aTypeMatrix_.compare(bTypeMatrix_)<0); } template inline MSBoolean operator<=(const MSTypeMatrix& aTypeMatrix_, const MSTypeMatrix& bTypeMatrix_) { return MSBoolean(aTypeMatrix_.compare(bTypeMatrix_)>=0); } template inline MSBoolean operator>=(const MSTypeMatrix& aTypeMatrix_ ,const MSTypeMatrix& bTypeMatrix_) { return MSBoolean(aTypeMatrix_.compare(bTypeMatrix_)<=0); } template inline MSBoolean operator<(const MSTypeMatrix& aTypeMatrix_, Type aType_) { return aTypeMatrix_.scalarCompare(aType_,MSLessThan); } template inline MSBoolean operator<(Type aType_,const MSTypeMatrix& aTypeMatrix_) { return aTypeMatrix_.scalarCompare(aType_,MSGreaterThan); } template inline MSBoolean operator>(const MSTypeMatrix& aTypeMatrix_,Type aType_) { return aTypeMatrix_.scalarCompare(aType_,MSGreaterThan); } template inline MSBoolean operator>(Type aType_,const MSTypeMatrix& aTypeMatrix_) { return aTypeMatrix_.scalarCompare(aType_,MSLessThan); } template inline MSBoolean operator<=(const MSTypeMatrix& aTypeMatrix_,Type aType_) { return aTypeMatrix_.scalarCompare(aType_,MSLessThanOrEqualTo); } template inline MSBoolean operator<=(Type aType_,const MSTypeMatrix& aTypeMatrix_) { return aTypeMatrix_.scalarCompare(aType_,MSGreaterThanOrEqualTo); } template inline MSBoolean operator>=(const MSTypeMatrix& aTypeMatrix_,Type aType_) { return aTypeMatrix_.scalarCompare(aType_,MSGreaterThanOrEqualTo); } template inline MSBoolean operator>=(Type aType_,const MSTypeMatrix& aTypeMatrix_) { return aTypeMatrix_.scalarCompare(aType_,MSLessThanOrEqualTo); } template inline MSBoolean operator==(const MSTypeMatrix& aTypeMatrix_,Type aType_) { return aTypeMatrix_.scalarCompare(aType_,MSEqualTo); } template inline MSBoolean operator==(Type aType_,const MSTypeMatrix& aTypeMatrix_) { return aTypeMatrix_.scalarCompare(aType_,MSEqualTo); } template inline MSBoolean operator!=(const MSTypeMatrix& aTypeMatrix_,Type aType_) { return aTypeMatrix_.scalarCompare(aType_,MSNotEqualTo); } template inline MSBoolean operator!=(Type aType_,const MSTypeMatrix& aTypeMatrix_) { return aTypeMatrix_.scalarCompare(aType_,MSNotEqualTo); } template inline MSBoolean operator==(const MSTypeMatrix& a_, const MSTypeMatrix& b_) { return MSBoolean(a_.compare(b_)==0);} template inline MSBoolean operator!=(const MSTypeMatrix& a_, const MSTypeMatrix& b_) { return MSBoolean(a_.compare(b_)!=0);} //------------------------------------------------------------ // MSMatrixSTypePick inlines //------------------------------------------------------------ template inline MSMatrixSTypePick::MSMatrixSTypePick(const MSTypeMatrix& aTypeMatrix_,unsigned index_) { _pMatrix=&(MSTypeMatrix&)aTypeMatrix_; _index=index_; } template inline MSMatrixSTypePick::MSMatrixSTypePick(const MSMatrixSTypePick& aPick_) { _pMatrix=aPick_.pMatrix(); _index=aPick_.index(); } template inline MSMatrixSTypePick& MSMatrixSTypePick::operator=(Type aType_) { _pMatrix->set(_index,aType_); return *this; } template inline MSTypeMatrix *MSMatrixSTypePick::pMatrix(void) const { return _pMatrix; } template inline unsigned MSMatrixSTypePick::index(void) const { return _index; } template inline MSMatrixSTypePick::operator Type() const { return _pMatrix->elementAt(_index); } template inline Type MSMatrixSTypePick::value(void) const { return _pMatrix->elementAt(_index); } //------------------------------------------------------------ // Pick Indexing operators - define here to avoid inline problem //------------------------------------------------------------ template inline MSMatrixSTypePick MSTypeMatrix::operator()(unsigned index_) { return MSMatrixSTypePick(*this,index_); } template inline MSMatrixSTypePick MSTypeMatrix::operator[](unsigned index_) { return MSMatrixSTypePick(*this,index_); } template inline MSMatrixSTypePick MSTypeMatrix::operator()(unsigned row_,unsigned column_) { return MSMatrixSTypePick(*this,index(row_,column_)); } #endif aplus-fsf-4.22/src/MSTypes/MSTypeVector.H0000644000265000001440000000325310772770465013650 #ifndef MSTypeVectorHEADER #define MSTypeVectorHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #ifndef MSDefinesHEADER #include #endif #if defined(MS_NEED_IMPLEMENTATION_PRAGMA) #pragma implementation("MSTypeVector.C") #endif template class MSTypeVector : public MSObjectVector { protected: INLINELINKAGE static MSString name(); public: MSTypeVector (); MSTypeVector (unsigned int); MSTypeVector (unsigned int, const Type &); MSTypeVector (const MSTypeVector &); MSTypeVector (const MSBaseVector > &); MSTypeVector (const char *); MSTypeVector (MSTypeData > *, unsigned int); MSTypeVector (const Type *, unsigned int); virtual ~MSTypeVector(); MSTypeVector & operator= (const MSTypeVector &); MSTypeVector & operator= (const MSBaseVector > &); MSTypeVector & operator= (const Type &); MSTypeVector & operator= (const char *); virtual MSString className() const; virtual const MSSymbol & type() const; virtual MSModel *clone() const; virtual MSModel *create() const; static const MSSymbol & symbol(); }; template INLINELINKAGE MSString className (const Type &); #ifndef MS_NO_INLINES #include #endif // MS_NO_INLINES #endif // MSTypeVectorHEADER aplus-fsf-4.22/src/MSTypes/MSTypes_MSF.H0000644000265000001440000000220010772770465013344 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// /* file: MSTypes_MSF.H Delimiters needed to delimit MSF message data elements and fields fields are composed of a field name and its data elements. There are two cases that need to have delimiters: strings: A space is placed between elements of multi-component scalar MSTypes, such as MSMoney. arrays: Elements in arrays must be flattened in such a way that the are can be reconstructed from the flattened object. The , \37, character was chosen as this character is not printable and can be used as separated in string arrays as well as numeric one. */ #ifndef MSTypes_MSFHEADER #define MSTypes_MSFHEADER const char MSMSF_US='\37'; // unit separate-delimit data elements const char MSMSF_SPACE=' '; // space separator between components. #endif // MSTypes_MSFHEADER aplus-fsf-4.22/src/MSTypes/MSUnsigned.H0000644000265000001440000001727210772770465013326 #ifndef MSUnsignedHEADER #define MSUnsignedHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include // for MSIntFormat class MSFormat; #if defined (MS_PREDECLARE_NONTEMPLATE_FRIEND_FUNCTIONS) class MSUnsigned; inline long compare (const MSUnsigned &, const MSUnsigned &); #endif class MSTypesExport MSUnsigned : public MSScalarModel { public: enum {MaximumLength=10}; MSUnsigned(void); MSUnsigned(unsigned); MSUnsigned(const MSUnsigned&); virtual MSString asString(void) const; virtual MSString asDebugInfo(void) const; virtual MSString asMSF(void) const; virtual MSString className(void) const; virtual const MSSymbol& type(void) const; virtual MSModel *clone(void) const; virtual MSModel *create(void) const; virtual void assign(const MSModel&); virtual long compare(const MSModel&) const; virtual MSError::ErrorStatus set(const char *); virtual MSError::ErrorStatus setFromMSF(const char*); static const MSSymbol& symbol(void); virtual MSError::ErrorStatus set(const MSString *); virtual MSError::ErrorStatus set(const MSString &); virtual MSError::ErrorStatus set(unsigned); const char *format(MSString*) const; const char *format(MSString&) const; const char *format(MSString*,MSInt::MSIntFormat) const; const char *format(MSString&,MSInt::MSIntFormat) const; const char *format(MSString*,const MSFormat&) const; const char *format(MSString&,const MSFormat&) const; operator unsigned() const; operator double() const; unsigned operator()() const; // function call operator MSUnsigned& operator=(const MSUnsigned&); MSUnsigned& operator=(unsigned); MSUnsigned& operator=(const char *); inline friend MSTypesExport long compare(const MSUnsigned&,const MSUnsigned&); inline friend MSTypesExport unsigned long hash(const MSUnsigned&,unsigned long size_); MSBoolean operator==(const MSUnsigned&) const; MSBoolean operator!=(const MSUnsigned&) const; MSBoolean operator< (const MSUnsigned&) const; MSBoolean operator<=(const MSUnsigned&) const; MSBoolean operator> (const MSUnsigned&) const; MSBoolean operator>=(const MSUnsigned&) const; MSBoolean operator==(unsigned) const; MSBoolean operator!=(unsigned) const; MSBoolean operator< (unsigned) const; MSBoolean operator<=(unsigned) const; MSBoolean operator> (unsigned) const; MSBoolean operator>=(unsigned) const; // Prefix - add/subtract one, then return result MSUnsigned& operator++(); MSUnsigned& operator--(); // Postfix - add/subtract one, then return the initial value MSUnsigned operator++(int); MSUnsigned operator--(int); MSUnsigned& operator+=(const MSUnsigned&); MSUnsigned& operator+=(unsigned); MSUnsigned& operator-=(const MSUnsigned&); MSUnsigned& operator-=(unsigned); MSUnsigned& operator*=(const MSUnsigned&); MSUnsigned& operator*=(unsigned); MSUnsigned& operator/=(const MSUnsigned&); MSUnsigned& operator/=(unsigned); MSUnsigned operator-(); inline friend MSTypesExport unsigned operator+(const MSUnsigned&,unsigned); inline friend MSTypesExport unsigned operator+(unsigned,const MSUnsigned&); inline friend MSTypesExport unsigned operator+(const MSUnsigned& d1,const MSUnsigned&); inline friend MSTypesExport unsigned operator-(const MSUnsigned&,unsigned); inline friend MSTypesExport unsigned operator-(unsigned,const MSUnsigned&); inline friend MSTypesExport unsigned operator-(const MSUnsigned& d1,const MSUnsigned&); inline friend MSTypesExport unsigned operator*(const MSUnsigned&,unsigned); inline friend MSTypesExport unsigned operator*(unsigned,const MSUnsigned&); inline friend MSTypesExport unsigned operator*(const MSUnsigned& d1,const MSUnsigned&); inline friend MSTypesExport unsigned operator/(const MSUnsigned&,unsigned); inline friend MSTypesExport unsigned operator/(unsigned,const MSUnsigned&); inline friend MSTypesExport unsigned operator/(const MSUnsigned&,const MSUnsigned&); inline friend MSTypesExport unsigned operator%(const MSUnsigned&,unsigned); inline friend MSTypesExport unsigned operator%(unsigned,const MSUnsigned&); inline friend MSTypesExport unsigned operator%(const MSUnsigned&,const MSUnsigned&); inline friend MSTypesExport MSBoolean operator==(unsigned,const MSUnsigned&); inline friend MSTypesExport MSBoolean operator!=(unsigned,const MSUnsigned&); inline friend MSTypesExport MSBoolean operator< (unsigned,const MSUnsigned&); inline friend MSTypesExport MSBoolean operator<=(unsigned,const MSUnsigned&); inline friend MSTypesExport MSBoolean operator> (unsigned,const MSUnsigned&); inline friend MSTypesExport MSBoolean operator>=(unsigned,const MSUnsigned&); friend MSTypesExport ostream& operator<<(ostream& aStream_,const MSUnsigned&); friend MSTypesExport istream& operator>>(istream& aStream_,MSUnsigned&); MSBoolean isSet(void) const; void unset(void); protected: const char *formatUnsigned(MSString& aString_,MSInt::MSIntFormat format_,unsigned long modifier_,unsigned value_) const; private: unsigned _unsigned; MSBoolean _isSet; }; inline long compare(const MSUnsigned& aUnsigned_,const MSUnsigned& bUnsigned_) { return (aUnsigned_._unsigned-bUnsigned_._unsigned); } inline unsigned long hash(const MSUnsigned& aUnsigned_,unsigned long size_) { return aUnsigned_._unsigned%size_; } #ifndef MS_NO_INLINES #ifndef MSUnsignedINLINES #include #endif #endif inline unsigned operator+(const MSUnsigned& a_,unsigned b_) { return a_._unsigned+b_; } inline unsigned operator+(unsigned a_,const MSUnsigned& b_) { return a_+b_._unsigned; } inline unsigned operator+(const MSUnsigned& a_,const MSUnsigned& b_) { return a_._unsigned+b_._unsigned; } inline unsigned operator-(const MSUnsigned& a_,unsigned b_) { return a_._unsigned-b_; } inline unsigned operator-(unsigned a_,const MSUnsigned& b_) { return a_-b_._unsigned; } inline unsigned operator-(const MSUnsigned& a_,const MSUnsigned& b_) { return a_._unsigned-b_._unsigned; } inline unsigned operator*(const MSUnsigned& a_,unsigned b_) { return a_._unsigned*b_; } inline unsigned operator*(unsigned a_,const MSUnsigned& b_) { return a_*b_._unsigned; } inline unsigned operator*(const MSUnsigned& a_,const MSUnsigned& b_) { return a_._unsigned*b_._unsigned; } inline unsigned operator/(const MSUnsigned& a_,unsigned b_) { return a_._unsigned/b_; } inline unsigned operator/(unsigned a_,const MSUnsigned& b_) { return a_/b_._unsigned; } inline unsigned operator/(const MSUnsigned& a_,const MSUnsigned& b_) { return a_._unsigned/b_._unsigned; } inline unsigned operator%(const MSUnsigned& a_,unsigned b_) { return a_._unsigned%b_; } inline unsigned operator%(unsigned a_,const MSUnsigned& b_) { return a_%b_._unsigned; } inline unsigned operator%(const MSUnsigned& a_,const MSUnsigned& b_) { return a_._unsigned%b_._unsigned; } inline MSBoolean operator==(unsigned a_,const MSUnsigned& b_) { return MSBoolean(a_==b_._unsigned); } inline MSBoolean operator!=(unsigned a_,const MSUnsigned& b_) { return MSBoolean(a_!=b_._unsigned); } inline MSBoolean operator< (unsigned a_,const MSUnsigned& b_) { return MSBoolean(a_< b_._unsigned); } inline MSBoolean operator<=(unsigned a_,const MSUnsigned& b_) { return MSBoolean(a_<=b_._unsigned); } inline MSBoolean operator> (unsigned a_,const MSUnsigned& b_) { return MSBoolean(a_> b_._unsigned); } inline MSBoolean operator>=(unsigned a_,const MSUnsigned& b_) { return MSBoolean(a_>=b_._unsigned); } #endif aplus-fsf-4.22/src/MSTypes/MSUnsignedLongMatrix.H0000644000265000001440000000753610772770465015335 #ifndef MSUnsignedLongMatrixHEADER #define MSUnsignedLongMatrixHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #ifndef MSTypeMatrixHEADER #include #endif typedef MSTypeMatrix MSUnsignedLongMatrix; // We provide provide explicit "do_not_instantiate" pragmas here to avoid instantiation complications in // MStk applications. // #if !defined(__MSTYPESLIBRARY_BUILD__) && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma do_not_instantiate MSAllocator #pragma do_not_instantiate MSTypeData > #pragma do_not_instantiate MSTypeMatrix #pragma do_not_instantiate MSMatrixSTypePick #pragma do_not_instantiate ostream& operator<<(ostream&,const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix operator-(const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix operator+(const MSTypeMatrix&,unsigned long) #pragma do_not_instantiate MSTypeMatrix operator+(unsigned long,const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix operator+(const MSTypeMatrix&,\ const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix operator-(const MSTypeMatrix&,unsigned long) #pragma do_not_instantiate MSTypeMatrix operator-(const MSTypeMatrix&,\ const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix operator*(const MSTypeMatrix&,unsigned long) #pragma do_not_instantiate MSTypeMatrix operator*(unsigned long,const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix operator*(const MSTypeMatrix&,\ const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix operator/(const MSTypeMatrix&,unsigned long) #pragma do_not_instantiate MSTypeMatrix operator/(const MSTypeMatrix&,\ const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix operator+(const MSTypeMatrix&,\ const MSTypeVector&) #pragma do_not_instantiate MSTypeMatrix operator-(const MSTypeMatrix&,\ const MSTypeVector&) #pragma do_not_instantiate MSTypeMatrix operator*(const MSTypeMatrix&,\ const MSTypeVector&) #pragma do_not_instantiate MSTypeMatrix operator/(const MSTypeMatrix&,\ const MSTypeVector&) #pragma do_not_instantiate MSTypeMatrix operator+(const MSTypeVector&,\ const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix operator*(const MSTypeVector&,\ const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix multiply(const MSTypeMatrix&,\ const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix stack(const MSTypeMatrix&,\ const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix adjoin(const MSTypeMatrix&,\ const MSTypeMatrix&) #endif // !__MSTYPESLIBRARY_BUILD__ && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #endif aplus-fsf-4.22/src/MSTypes/MSUtil.H0000644000265000001440000000727410772770465012470 #ifndef MSUtilHEADER #define MSUtilHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include class MSTypesExport MSUtil { public: static MSBoolean hasAlpha(const char *s_); static void comma(const char *from_,char *to_,int size_); static void remove(char *s_, int c_); static MSBoolean isSpace(const char *s_); static MSBoolean isNumeric(const char *s_); static int abs(int x_) { return x_>=0?x_:-x_; } static short abs(short x_) { return x_>=0?x_:-x_; } static long abs(long x_) { return x_>=0?x_:-x_; } static double abs(double x_) { return x_>=0?x_:-x_; } static int max(int a_,int b_) { return a_>=b_?a_:b_; } static unsigned max(unsigned a_,unsigned b_) { return a_>=b_?a_:b_; } static double max(double a_,double b_) { return a_>=b_?a_:b_; } static int min(int a_,int b_) { return a_<=b_?a_:b_; } static unsigned min(unsigned a_,unsigned b_) { return a_<=b_?a_:b_; } static double min(double a_,double b_) { return a_<=b_?a_:b_; } inline static MSBoolean isEqualTo(double a_, double b_, double tolerance_ =0.00000000000001); inline static MSBoolean isNotEqualTo(double a_, double b_, double tolerance_ =0.00000000000001); inline static MSBoolean isGreaterThan(double a_, double b_, double tolerance_ =0.00000000000001); inline static MSBoolean isGreaterThanOrEqualTo(double a_, double b_, double tolerance_ =0.00000000000001); inline static MSBoolean isLessThan(double a_, double b_, double tolerance_ =0.00000000000001); inline static MSBoolean isLessThanOrEqualTo(double a_, double b_, double tolerance_ =0.00000000000001); }; inline MSBoolean MSUtil::isEqualTo(double a_, double b_, double tolerance_) { a_-=b_; // // If tolerance is negative (which is meaningless), it will always // return MSFalse. // // Otherwise, it will check if both a_ and -a_ (after having done // a_-=b) are <= tolerance_: // // - if a_ is negative (i.e., a_=b_), then -a_ will always be // less than tolerance_ (since tolerance_ is non-negative) and // then a_ will be compared to tolerance_ to decide if the // difference between the original a_ and b_ is within tolerance_. // // This algorithm is faster than taking the absolute value of a_ and // comparing if it is <= tolerance_. // // Please note that the tolerance interval is *closed*. // return MSBoolean(a_<=tolerance_ && -a_<=tolerance_); } inline MSBoolean MSUtil::isNotEqualTo(double a_, double b_, double tolerance_) { a_-=b_; return MSBoolean(a_>=tolerance_ || -a_>=tolerance_); } inline MSBoolean MSUtil::isGreaterThan(double a_, double b_, double tolerance_) { a_-=b_; return MSBoolean(a_>0 && a_>tolerance_); } inline MSBoolean MSUtil::isGreaterThanOrEqualTo(double a_, double b_, double tolerance_) { a_-=b_; return MSBoolean(a_>=0 || -a_<=tolerance_); } inline MSBoolean MSUtil::isLessThan(double a_, double b_, double tolerance_) { a_-=b_; return MSBoolean(a_<0 && -a_>tolerance_); } inline MSBoolean MSUtil::isLessThanOrEqualTo(double a_, double b_, double tolerance_) { a_-=b_; return MSBoolean(a_<=0 || a_<=tolerance_); } #endif //MSUtilHEADER aplus-fsf-4.22/src/MSTypes/MSUnsignedLongVector.H0000644000265000001440000001125110772770465015320 #ifndef MSUnsignedLongVectorHEADER #define MSUnsignedLongVectorHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MSDefinesHEADER #include #endif #if defined(MS_NEED_IMPLEMENTATION_PRAGMA) #pragma implementation("MSUnsignedLongVector.C") #endif #include #include #if defined(MS_TEMPLATE_BEFORE_SPECIALIZATION) #include #endif template class MSTypeVector; typedef MSBaseVector > BaseVectorUnsignedLong; typedef MSBuiltinVector BuiltinVectorUnsignedLong; #ifndef MS_MSUnsignedLongVector_INSTANTIATE #ifdef MS_DECLARE_TEMPLATE_SPECIALIZATION template <> class MSBaseVector >; template <> class MSBaseVectorOps >; template <> class MSBuiltinVector; template <> class MSBuiltinVectorOps; template <> class MSBuiltinSPick; template <> MSBuiltinVector operator- (const MSBuiltinVector&); template <> ostream& operator<<(ostream&,const MSBaseVector >&); #endif #endif #if defined(MS_VC_NEED_TEMPLATE_EXPORT) class MSTypesExport MSBaseVector >; class MSTypesExport MSBaseVectorOps >; class MSTypesExport MSBuiltinVector; class MSTypesExport MSBuiltinVectorOps; class MSTypesExport MSBuiltinSPick; //template <> MSBuiltinVector operator- (const MSBuiltinVector&); //template <> ostream& operator<<(ostream&,const MSBaseVector >&); #endif #if !defined(MS_MSUnsignedLongVector_INSTANTIATE) && defined(MS_STD_TEMPLATE_SPECIALIZATION) template <> class MSTypeVector : public BuiltinVectorUnsignedLong #else template <> class MSTypesExport MSTypeVector : public BuiltinVectorUnsignedLong #endif { public: MSTypeVector (); MSTypeVector (unsigned int); MSTypeVector (unsigned int, const unsigned long &); MSTypeVector (const MSTypeVector &); MSTypeVector (const BuiltinVectorUnsignedLong &); MSTypeVector (const BaseVectorUnsignedLong &); MSTypeVector (const char *); MSTypeVector (MSTypeData > *, unsigned int); MSTypeVector (const unsigned long *, unsigned int); virtual ~MSTypeVector(); MSTypeVector & operator= (const MSTypeVector &); MSTypeVector & operator= (const BuiltinVectorUnsignedLong &); MSTypeVector & operator= (const BaseVectorUnsignedLong &); MSTypeVector & operator= (const unsigned long &); MSTypeVector & operator= (const char *); virtual const MSSymbol & type() const; virtual MSString className() const; virtual MSModel *clone() const; virtual MSModel *create() const; static const MSSymbol & symbol(); }; typedef MSTypeVector MSUnsignedLongVector; #ifndef MS_NO_INLINES #include #endif // MS_NO_INLINES // We provide provide explicit "do_not_instantiate" pragmas here to avoid instantiation complications in // MStk applications. // #if !defined(__MSTYPESLIBRARY_BUILD__) && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma do_not_instantiate MSAllocator #pragma do_not_instantiate MSTypeData > #pragma do_not_instantiate MSBaseVector > #pragma do_not_instantiate MSBaseVectorOps > #pragma do_not_instantiate MSBuiltinVector #pragma do_not_instantiate MSBuiltinVectorOps #pragma do_not_instantiate MSBuiltinSPick #pragma do_not_instantiate ostream& operator<<(ostream&, const MSBaseVector >&) #pragma do_not_instantiate unsigned int msMergeSortUp(unsigned int,unsigned long *,unsigned int *,unsigned int,unsigned int) #pragma do_not_instantiate unsigned int msMergeSortDown(unsigned int,unsigned long *,unsigned int *,unsigned int,unsigned int) #endif // !__MSTYPESLIBRARY_BUILD__ && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #endif // MSUnsignedLongVectorHEADER aplus-fsf-4.22/src/MSTypes/MSUnsignedMatrix.H0000644000265000001440000000655710772770465014517 #ifndef MSUnsignedMatrixHEADER #define MSUnsignedMatrixHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #ifndef MSTypeMatrixHEADER #include #endif typedef MSTypeMatrix MSUnsignedMatrix; // We provide provide explicit "do_not_instantiate" pragmas here to avoid instantiation complications in // MStk applications. // #if !defined(__MSTYPESLIBRARY_BUILD__) && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma do_not_instantiate MSAllocator #pragma do_not_instantiate MSTypeData > #pragma do_not_instantiate MSTypeMatrix #pragma do_not_instantiate MSMatrixSTypePick #pragma do_not_instantiate ostream& operator<<(ostream&,const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix operator-(const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix operator+(const MSTypeMatrix&,unsigned) #pragma do_not_instantiate MSTypeMatrix operator+(unsigned,const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix operator+(const MSTypeMatrix&,const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix operator-(const MSTypeMatrix&,unsigned) #pragma do_not_instantiate MSTypeMatrix operator-(const MSTypeMatrix&,const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix operator*(const MSTypeMatrix&,unsigned) #pragma do_not_instantiate MSTypeMatrix operator*(unsigned,const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix operator*(const MSTypeMatrix&,const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix operator/(const MSTypeMatrix&,unsigned) #pragma do_not_instantiate MSTypeMatrix operator/(const MSTypeMatrix&,const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix operator+(const MSTypeMatrix&,const MSTypeVector&) #pragma do_not_instantiate MSTypeMatrix operator-(const MSTypeMatrix&,const MSTypeVector&) #pragma do_not_instantiate MSTypeMatrix operator*(const MSTypeMatrix&,const MSTypeVector&) #pragma do_not_instantiate MSTypeMatrix operator/(const MSTypeMatrix&,const MSTypeVector&) #pragma do_not_instantiate MSTypeMatrix operator+(const MSTypeVector&,const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix operator*(const MSTypeVector&,const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix multiply(const MSTypeMatrix&,const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix stack(const MSTypeMatrix&,const MSTypeMatrix&) #pragma do_not_instantiate MSTypeMatrix adjoin(const MSTypeMatrix&,const MSTypeMatrix&) #endif // !__MSTYPESLIBRARY_BUILD__ && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #endif aplus-fsf-4.22/src/MSTypes/MSUnsignedVector.H0000644000265000001440000001014610772770465014502 #ifndef MSUnsignedVectorHEADER #define MSUnsignedVectorHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MSDefinesHEADER #include #endif #if defined(MS_NEED_IMPLEMENTATION_PRAGMA) #pragma implementation("MSUnsignedVector.C") #endif #include #include #if defined(MS_TEMPLATE_BEFORE_SPECIALIZATION) #include #endif template class MSTypeVector; typedef MSBaseVector > BaseVectorUnsigned; typedef MSBuiltinVector BuiltinVectorUnsigned; #ifndef MS_MSUnsignedVector_INSTANTIATE #ifdef MS_DECLARE_TEMPLATE_SPECIALIZATION template <> class MSBaseVector >; template <> class MSBaseVectorOps >; template <> class MSBuiltinVector; template <> class MSBuiltinVectorOps; template <> class MSBuiltinSPick; template <> MSBuiltinVector operator- (const MSBuiltinVector&); template <> ostream& operator<<(ostream&,const MSBaseVector >&); #endif #endif #if defined(MS_VC_NEED_TEMPLATE_EXPORT) class MSTypesExport MSBaseVector >; class MSTypesExport MSBaseVectorOps >; class MSTypesExport MSBuiltinVector; class MSTypesExport MSBuiltinVectorOps; class MSTypesExport MSBuiltinSPick; #endif #if !defined(MS_MSUnsignedVector_INSTANTIATE) && defined(MS_STD_TEMPLATE_SPECIALIZATION) template <> class MSTypeVector : public BuiltinVectorUnsigned #else template <> class MSTypesExport MSTypeVector : public BuiltinVectorUnsigned #endif { public: MSTypeVector (); MSTypeVector (unsigned int); MSTypeVector (unsigned int, const unsigned int); MSTypeVector (const MSTypeVector &); MSTypeVector (const BuiltinVectorUnsigned &); MSTypeVector (const BaseVectorUnsigned &); MSTypeVector (const char *); MSTypeVector (MSTypeData > *, unsigned int); MSTypeVector (const unsigned int *, unsigned int); virtual ~MSTypeVector(); MSTypeVector & operator= (const MSTypeVector &); MSTypeVector & operator= (const BuiltinVectorUnsigned &); MSTypeVector & operator= (const BaseVectorUnsigned &); MSTypeVector & operator= (const unsigned int &); MSTypeVector & operator= (const char *); virtual const MSSymbol & type() const; virtual MSString className() const; virtual MSModel *clone() const; virtual MSModel *create() const; static const MSSymbol & symbol(); }; typedef MSTypeVector MSUnsignedVector; #ifndef MS_NO_INLINES #include #endif // MS_NO_INLINES // We provide provide explicit "do_not_instantiate" pragmas here to avoid instantiation complications in // MStk applications. // #if !defined(__MSTYPESLIBRARY_BUILD__) && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma do_not_instantiate MSAllocator #pragma do_not_instantiate MSTypeData > #pragma do_not_instantiate MSBaseVector > #pragma do_not_instantiate MSBaseVectorOps > #pragma do_not_instantiate MSBuiltinVector #pragma do_not_instantiate MSBuiltinVectorOps #pragma do_not_instantiate MSBuiltinSPick #pragma do_not_instantiate ostream& operator<<(ostream&, const MSBaseVector >&) #endif // !__MSTYPESLIBRARY_BUILD__ && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #endif // MSUnsignedVectorHEADER aplus-fsf-4.22/src/MSTypes/MSVariable.H0000644000265000001440000000167310772770465013275 #ifndef VaraibleHEADER #define VaraibleHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include class MSTypesExport MSVariable { public: MSModel *_pModel; MSString _name; MSVariable(void) : _pModel(0) {} MSVariable(const MSVariable& aVariable_) : _pModel(aVariable_._pModel),_name(aVariable_._name) {} MSVariable(MSModel *pModel_,const char *name_) : _pModel(pModel_),_name(name_) {} MSVariable& operator=(const MSVariable& aVariable_) { if (this!=&aVariable_) _pModel=aVariable_._pModel,_name=aVariable_._name; return *this; } }; inline const MSString& key(const MSVariable& aVariable_) { return aVariable_._name; } #endif aplus-fsf-4.22/src/MSTypes/MSVariableRegistry.H0000644000265000001440000000223410772770465015020 #ifndef MSVaraibleRegistryHEADER #define MSVaraibleRegistryHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #if defined(MS_VC_NEED_TEMPLATE_EXPORT) class MSTypesExport MSIHashKeySet; #endif typedef MSIHashKeySet MSVariableRegistry; DECLARE_ELEMENT_FOR_OPS_TYPE(MSVariable) // We provide provide explicit "do_not_instantiate" pragmas here to avoid instantiation complications in // MStk applications. // #if !defined(__MSTYPESLIBRARY_BUILD__) && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #pragma do_not_instantiate MSIHashKeySet #pragma do_not_instantiate MSIHashKeySetNode #pragma do_not_instantiate MSIHashKeySetCursor #endif // !__MSTYPESLIBRARY_BUILD__ && defined(MS_DO_NOT_INSTANTIATE) && defined(MS_EDG_TEMPLATE_INSTANTIATION) #endif aplus-fsf-4.22/src/MSTypes/MSVector.H0000644000265000001440000000267010772770465013010 #ifndef MSVectorHEADER #define MSVectorHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #if HAVE_IOSTREAM #include // #include using namespace std; #else class ostream; #endif class MSIndexVector; // indexing vector //const unsigned MSVectorDefaultMinimumAllocationSize=8; class MSTypesExport MSVector : public MSIndexedModel { protected: void processAppendUpdate(unsigned int, unsigned int); void appendUpdate(unsigned int, unsigned int); virtual unsigned int getLength() const; public: MSVector(); virtual ~MSVector(); inline unsigned int length() const; inline unsigned rows(void) const; virtual MSIndexVector gradeUp(void) const; virtual MSIndexVector gradeDown(void) const; virtual void permute(const MSIndexVector&); }; inline void MSVector::appendUpdate (unsigned int oldLength_, unsigned int numAppended_) { if (doChanged()==MSTrue) processAppendUpdate(oldLength_,numAppended_); } inline unsigned int MSVector::length() const { return getLength(); } inline unsigned MSVector::rows() const { return length(); } #endif //MSVectorHEADER aplus-fsf-4.22/src/MSTypes/MSVectorImpl.H0000644000265000001440000001647310772770466013641 #ifndef MSVectorImplHEADER #define MSVectorImplHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #ifndef MSDefinesHEADER #include #endif //*** forward declarations ***// #if HAVE_IOSTREAM #include // #include using namespace std; #else class ostream; #endif class MSIndexVector; class MSBinaryVector; class MSTypesExport MSVectorImplOps { public: MSVectorImplOps(); virtual ~MSVectorImplOps(); virtual void *allocate (unsigned int, unsigned int =0, MSAllocationFlag =MSRaw) const =0; virtual void *allocateWithSize (unsigned int, unsigned int =0, MSAllocationFlag =MSRaw) const =0; virtual void deallocate (void *, unsigned int =0, MSAllocationFlag =MSRaw) const =0; virtual void incrementCount (void *) const =0; virtual unsigned int refCount (const void *) const =0; virtual void set (void *, unsigned int, const void *, MSAllocationFlag =MSConstructed) const =0; virtual void set (void *, unsigned int, const void *, unsigned int, MSAllocationFlag =MSConstructed) const =0; virtual void fill (void *, unsigned int, unsigned int, const void *, MSAllocationFlag =MSConstructed) const =0; virtual void copy (const void *, void *, unsigned int, unsigned int =0, unsigned int =0, MSAllocationFlag =MSConstructed) const =0; virtual void copyBackward (void *, unsigned int, unsigned int, unsigned int) const =0; virtual void destroy (void *, unsigned int, unsigned int) const =0; virtual int isElementEqual (const void *, unsigned int, const void *) const =0; virtual int isElementLess (const void *, unsigned int, const void *) const =0; virtual int isElementLessEqual (const void *, unsigned int, const void *) const =0; virtual long compareElement (const void *, unsigned int, const void *) const =0; virtual void * elementAt (const void *, unsigned int) const =0; virtual unsigned int size (const void *) const =0; virtual void swapElements (void *, unsigned int, unsigned int) const =0; virtual unsigned int gradeUp (const void *, unsigned int, unsigned int *) const =0; virtual unsigned int gradeDown (const void *, unsigned int, unsigned int *) const =0; virtual void *badData() const =0; virtual void *defaultFiller() const =0; virtual MSString asString (const void *, unsigned int) const =0; virtual MSString asMSF (const void *, unsigned int) const =0; virtual unsigned int elementLen (const void *, unsigned int) const =0; virtual MSError::ErrorStatus setFromString (void *, unsigned int, const char *) const =0; virtual MSError::ErrorStatus setFromMSF (void *, unsigned int, const char *) const =0; virtual void print (const void *, unsigned int, ostream &) const =0; virtual unsigned int numElements (const MSString &, const char) const =0; virtual void setFromMSString (void *, unsigned int, const MSString &, unsigned int&, const char) const =0; }; class MSTypesExport MSVectorImpl { public: MSVectorImpl (MSVectorImplOps *, unsigned int =0); MSVectorImpl (MSVectorImplOps *, unsigned int, void *); MSVectorImpl (const MSVectorImpl &); MSVectorImpl (MSVectorImplOps *, void *, unsigned int); virtual ~MSVectorImpl(); virtual MSVectorImpl *create (unsigned int =0, unsigned int =0) const; virtual MSVectorImpl *clone() const; void makeUniqueCopy(); INLINELINKAGE void prepareToChange(); void prepareToChangeWithoutCopy(); void reallocateInPlace(unsigned int); INLINELINKAGE void *internalGet (unsigned int) const; INLINELINKAGE void vectorIndexError (unsigned int) const; MSVectorImpl & operator= (const MSVectorImpl &); MSString asString (const char =' '); virtual MSString asMSF(); virtual MSError::ErrorStatus setFromString (const char *, const char =' '); virtual MSError::ErrorStatus setFromMSF (const char *); void set (unsigned, void *); void setAll (const void *); void setSelected (const MSIndexVector &, const MSVectorImpl &); void setSelected (const MSIndexVector &, const void *); void setSelected (const MSBinaryVector &, const MSVectorImpl &); void setSelected (const MSBinaryVector &, const void *); MSIndexVector setIndexSelected (const MSBinaryVector &, const MSVectorImpl &); MSIndexVector setIndexSelected (const MSBinaryVector &, const void *); void print (ostream &) const; unsigned int indexOf (void *, unsigned int) const; unsigned int lastIndexOf (void *, unsigned int) const; unsigned int occurrencesOf (const void *, unsigned int) const; MSIndexVector indicesOf (const MSVectorImpl &) const; MSBinaryVector memberOf (const MSVectorImpl &) const; MSError::ErrorStatus append (void *); MSError::ErrorStatus append (const MSVectorImpl &); unsigned int append (const char *, const char =' '); MSError::ErrorStatus insertAt (unsigned int, void *); MSError::ErrorStatus insertAt (unsigned int, const MSVectorImpl &); MSError::ErrorStatus removeAt (unsigned int, unsigned int =1); MSError::ErrorStatus remove (const MSIndexVector &); MSError::ErrorStatus remove (const MSBinaryVector &); MSError::ErrorStatus removeAll(); MSError::ErrorStatus select (const MSIndexVector &); MSError::ErrorStatus compress (const MSBinaryVector &); MSError::ErrorStatus reshape (unsigned int); MSError::ErrorStatus exchange (unsigned int, unsigned int); MSError::ErrorStatus reverse (); MSError::ErrorStatus rotate (int); MSError::ErrorStatus take (int, const void * =0); MSError::ErrorStatus drop (int); void reverse (const MSVectorImpl &); void rotate (const MSVectorImpl &, int); void take (const MSVectorImpl &, int, const void * =0); void drop (const MSVectorImpl &, int); void select (const MSVectorImpl &, const MSIndexVector &); void compress (const MSVectorImpl &, const MSBinaryVector &); MSBinaryVector unique(); virtual MSIndexVector gradeUp () const; virtual MSIndexVector gradeDown() const; INLINELINKAGE void permute (const MSIndexVector &); unsigned int maxLength() const; INLINELINKAGE unsigned int length() const; INLINELINKAGE void *data() const; long compare (const MSVectorImpl &) const; MSBinaryVector binaryCompare (const MSVectorImpl &, MSComparison) const; MSBinaryVector binaryCompare (const void *, MSComparison) const; MSBoolean scalarCompare (const void *, MSComparison) const; protected: MSVectorImplOps *_pOperations; void *_pElements; unsigned int _len; void *reallocate(unsigned int); void reallocateAndCopy(unsigned int); void blockLeft (unsigned int, unsigned int, unsigned int); void blockRight (unsigned int, unsigned int, unsigned int); INLINELINKAGE void internalSet (unsigned int, const void *); INLINELINKAGE void internalSet (unsigned int, const MSVectorImpl &, unsigned int); void indexError (unsigned int) const; static unsigned int minSize(); void mergeSortUp(unsigned int *, unsigned int *) const; void mergeSortDown(unsigned int *, unsigned int *) const; }; #endif // MSVectorImplHEADER aplus-fsf-4.22/src/MSTypes/mp.h0000644000265000001440000000156110772770466011761 /*****************************************************************************/ /* */ /* Copyright (c) 1997-2008 Morgan Stanley All rights reserved. */ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* * Header file for the MSTypes library. This will include * the GNU math precision library header file in libGNUmp. * This header is only for development purposes and should * not be installed in the MSTypes include directory. The * correct header file to install is mp.h from libGNUmp. */ #include aplus-fsf-4.22/src/MSTypes/MSAllocatorInlines.C0000644000265000001440000000576010772770466015007 #ifndef MSAllocatorINLINES #define MSAllocatorINLINES /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// template INLINELINKAGE MSAllocator::MSAllocator(void) {} template INLINELINKAGE MSAllocator::~MSAllocator(void) {} template INLINELINKAGE Type *MSAllocator::allocate(size_t n_, Type *) { return (Type *)::operator new(n_*sizeof(Type)); } template INLINELINKAGE Type *MSAllocator::allocate(size_t size_) { return (Type *)::operator new(size_); } template INLINELINKAGE void MSAllocator::deallocate(Type *p_) { ::operator delete(p_); } template INLINELINKAGE void MSAllocator::construct(Type *p_, const Type& value_) { msConstruct(p_,value_); } template INLINELINKAGE void MSAllocator::destroy(Type *p_) { msDestroy(p_); } template INLINELINKAGE void msConstruct(Type *p_, const Type& value_) { new (p_) Type(value_); } template INLINELINKAGE void msDestroy(Type *p_) { p_->~Type(); } INLINELINKAGE void msDestroy(void *) {} INLINELINKAGE void msDestroy(char *) {} INLINELINKAGE void msDestroy(unsigned char *) {} INLINELINKAGE void msDestroy(short *) {} INLINELINKAGE void msDestroy(unsigned short *) {} INLINELINKAGE void msDestroy(int *) {} INLINELINKAGE void msDestroy(unsigned int *) {} INLINELINKAGE void msDestroy(long *) {} INLINELINKAGE void msDestroy(unsigned long *) {} INLINELINKAGE void msDestroy(float *) {} INLINELINKAGE void msDestroy(double *) {} INLINELINKAGE void msDestroy(void **) {} INLINELINKAGE void msDestroy(char **) {} INLINELINKAGE void msDestroy(unsigned char **) {} INLINELINKAGE void msDestroy(short **) {} INLINELINKAGE void msDestroy(unsigned short **) {} INLINELINKAGE void msDestroy(int **) {} INLINELINKAGE void msDestroy(unsigned int **) {} INLINELINKAGE void msDestroy(long **) {} INLINELINKAGE void msDestroy(unsigned long **) {} INLINELINKAGE void msDestroy(float **) {} INLINELINKAGE void msDestroy(double **) {} INLINELINKAGE void msDestroy(void ***) {} INLINELINKAGE void msDestroy(char ***) {} INLINELINKAGE void msDestroy(unsigned char ***) {} INLINELINKAGE void msDestroy(short ***) {} INLINELINKAGE void msDestroy(unsigned short ***) {} INLINELINKAGE void msDestroy(int ***) {} INLINELINKAGE void msDestroy(unsigned int ***) {} INLINELINKAGE void msDestroy(long ***) {} INLINELINKAGE void msDestroy(unsigned long ***) {} INLINELINKAGE void msDestroy(float ***) {} INLINELINKAGE void msDestroy(double ***) {} #endif //MSAllocatorINLINES aplus-fsf-4.22/src/MSTypes/MSBaseTypeVectorInlines.C0000644000265000001440000002414610772770466015765 #ifndef MSBaseTypeVectorINLINES #define MSBaseTypeVectorINLINES /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // /////////////////////////////////////////////////////////////////////////////// // The version of EDG used by SGI's dcc compiler has a bug related to access from friends during manual instantiation; // therefore, for SGI, make operator<<() inline so that it does not need to be manually instantiated in the library. #if defined(MS_TEMPLATE_MANUAL_FRIEND_BUG) #include #endif //MS_MANUAL_FRIEND_ACCESS_BUG #include #include #include #ifndef MS_NO_INLINES #include #endif // MS_NO_INLINES template INLINELINKAGE unsigned int MSBaseVector::length() const { // // length() method might potentially get called AFTER the destructor of MSBaseVector; // // therefore, safeguard yourself here by checking if _pImpl has already been deleted... return _pImpl ? _pImpl->length() : 0; } template INLINELINKAGE MSBaseVector::MSBaseVector (MSVectorImpl *pImpl_) : MSVector(), _pImpl(pImpl_), _blocked(MSFalse) { } template INLINELINKAGE unsigned int MSBaseVector::indexOf (const Type & value_, unsigned int startPos_) const { return _pImpl->indexOf ((void *)&value_, startPos_); } template INLINELINKAGE unsigned int MSBaseVector::lastIndexOf (const Type & value_, unsigned int startPos_) const { return _pImpl->lastIndexOf ((void *)&value_, startPos_); } template INLINELINKAGE unsigned int MSBaseVector::occurrencesOf (const Type & value_, unsigned int startPos_) const { return _pImpl->occurrencesOf ((void *)&value_, startPos_); } template INLINELINKAGE MSIndexVector MSBaseVector::indicesOf (const MSBaseVector &v_) const { return _pImpl->indicesOf (*v_._pImpl); } template INLINELINKAGE MSBinaryVector MSBaseVector::memberOf (const MSBaseVector &v_) const { return _pImpl->memberOf (*v_._pImpl); } template INLINELINKAGE MSBinaryVector MSBaseVector::uniqueElements() const { return _pImpl->unique(); } template INLINELINKAGE MSBaseVector & MSBaseVector::replaceAt (unsigned int index_, const Type & aType_) { set (index_, aType_); return *this; } template INLINELINKAGE MSBaseVector & MSBaseVector::selectUnique() { return compress (_pImpl->unique()); } template INLINELINKAGE MSBaseVector MSBaseVector::selectUnique (const MSBaseVector & vect_) { return compress (vect_, vect_._pImpl->unique()); } template INLINELINKAGE MSTypeData * MSBaseVector::vectorData() const { return (MSTypeData*)_pImpl->data(); } template INLINELINKAGE unsigned int MSBaseVector::maxLength() const { return _pImpl->maxLength(); } template INLINELINKAGE unsigned int MSBaseVector::size() const { return vectorData()->size(); } template INLINELINKAGE MSBaseVector & MSBaseVector::sortUp() { permute (gradeUp()); return *this; } template INLINELINKAGE MSBaseVector & MSBaseVector::sortDown() { permute (gradeDown()); return *this; } #if defined(MS_TEMPLATE_MANUAL_FRIEND_BUG) // The version of EDG used by SGI's dcc compiler has a bug related to access from friends during manual instantiation; // therefore, for SGI, make operator<<() inline so that it does not need to be manually instantiated in the library. template INLINELINKAGE ostream & operator<< (ostream & stream_, const MSBaseVector & vect_) { vect_._pImpl->print (stream_); return stream_; } #endif //MS_TEMPLATE_INLINE_FRIEND_BUG template INLINELINKAGE long MSBaseVector::compare (const MSBaseVector & vect_) const { return _pImpl->compare (*vect_._pImpl); } template INLINELINKAGE MSBinaryVector MSBaseVector::binaryCompare (const MSBaseVector & vect_, MSComparison comp_) const { return _pImpl->binaryCompare (*vect_._pImpl, comp_); } template INLINELINKAGE MSBinaryVector MSBaseVector::binaryCompare (const Type & value_, MSComparison comp_) const { return _pImpl->binaryCompare ((void *)&value_, comp_); } template INLINELINKAGE MSBoolean operator< (const MSBaseVector & vect1_, const MSBaseVector & vect2_) { return MSBoolean (vect1_.compare(vect2_) < 0); } template INLINELINKAGE MSBoolean operator> (const MSBaseVector & vect1_, const MSBaseVector & vect2_) { return MSBoolean (vect1_.compare(vect2_) > 0); } template INLINELINKAGE MSBoolean operator<= (const MSBaseVector & vect1_, const MSBaseVector & vect2_) { return MSBoolean (vect1_.compare(vect2_) <= 0); } template INLINELINKAGE MSBoolean operator>= (const MSBaseVector & vect1_, const MSBaseVector & vect2_) { return MSBoolean (vect1_.compare(vect2_) >= 0); } template INLINELINKAGE MSBoolean operator< (const MSBaseVector & vect_, const Type & value_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSLessThan); } template INLINELINKAGE MSBoolean operator< (const Type & value_, const MSBaseVector & vect_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSGreaterThan); } template INLINELINKAGE MSBoolean operator> (const MSBaseVector & vect_, const Type & value_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSGreaterThan); } template INLINELINKAGE MSBoolean operator> (const Type & value_, const MSBaseVector & vect_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSLessThan); } template INLINELINKAGE MSBoolean operator<= (const MSBaseVector & vect_, const Type & value_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSLessThanOrEqualTo); } template INLINELINKAGE MSBoolean operator<= (const Type & value_, const MSBaseVector & vect_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSGreaterThanOrEqualTo); } template INLINELINKAGE MSBoolean operator>= (const MSBaseVector & vect_, const Type & value_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSGreaterThanOrEqualTo); } template INLINELINKAGE MSBoolean operator>= (const Type & value_, const MSBaseVector & vect_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSLessThanOrEqualTo); } template INLINELINKAGE MSBoolean operator== (const MSBaseVector & vect_, const Type & value_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSEqualTo); } template INLINELINKAGE MSBoolean operator== (const Type & value_, const MSBaseVector & vect_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSEqualTo); } template INLINELINKAGE MSBoolean operator!= (const MSBaseVector & vect_, const Type & value_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSNotEqualTo); } template INLINELINKAGE MSBoolean operator!= (const Type & value_, const MSBaseVector & vect_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSNotEqualTo); } template INLINELINKAGE MSBaseVector & MSBaseVector::operator<<= (const MSBaseVector & vect_) { return append (vect_); } template INLINELINKAGE MSBaseVector & MSBaseVector::operator<<= (const Type & value_) { return append (value_); } template INLINELINKAGE MSBoolean operator==(const MSBaseVector &a_, const MSBaseVector & b_) { return MSBoolean (a_.compare(b_) == 0); } template INLINELINKAGE MSBoolean operator!=(const MSBaseVector &a_, const MSBaseVector & b_) { return MSBoolean (a_.compare(b_) != 0); } template INLINELINKAGE MSBaseVector& operator<<( MSBaseVector & a_, const MSBaseVector & b_) { return a_.append(b_); } template INLINELINKAGE MSBaseVector& operator<<( MSBaseVector & vect_, const Type & value_) { return vect_.append(value_); } template INLINELINKAGE unsigned int msVectorElementLength (const Type &) { return 0; } inline unsigned int msVectorElementLength (const MSString & str_) { return str_.length(); } inline unsigned int msVectorElementLength (const MSSymbol & sym_) { const char *pString = sym_.symbolName(); return (pString) ? strlen (pString) : 0; } #endif // MSBaseTypeVectorINLINES aplus-fsf-4.22/src/MSTypes/MSBinaryVectorInlines.C0000644000265000001440000002653310772770466015477 #ifndef MSBinaryVectorINLINES #define MSBinaryVectorINLINES /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #ifndef MS_NO_INLINES #include #endif //MS_NO_INLINES INLINELINKAGE unsigned int MSBinaryVector::size() const { return ((Data *)_pImpl->data())->size(); } INLINELINKAGE unsigned int MSBinaryVector::indexOf (const unsigned char value_, unsigned int startPos_) const { unsigned char c = value_ ? 1 : 0; return _pImpl->indexOf ((void *)&c, startPos_); } INLINELINKAGE unsigned int MSBinaryVector::lastIndexOf (const unsigned char value_, unsigned int startPos_) const { unsigned char c = value_ ? 1 : 0; return _pImpl->lastIndexOf ((void *)&c, startPos_); } INLINELINKAGE unsigned int MSBinaryVector::occurrencesOf (const unsigned char value_, unsigned int startPos_) const { unsigned char c = value_ ? 1 : 0; return _pImpl->occurrencesOf ((const void *)&c, startPos_); } INLINELINKAGE MSIndexVector MSBinaryVector::indicesOf (const MSBinaryVector &v_) const { return _pImpl->indicesOf (*v_._pImpl); } INLINELINKAGE MSBinaryVector MSBinaryVector::memberOf (const MSBinaryVector &v_) const { return _pImpl->memberOf (*v_._pImpl); } INLINELINKAGE MSBinaryVector & MSBinaryVector::replaceAt (unsigned int index_, const unsigned char value_) { set (index_, value_); return *this; } INLINELINKAGE void MSBinaryVector::permute (const MSIndexVector & iVect_) { _pImpl->permute (iVect_); changed(); } INLINELINKAGE unsigned char MSBinaryVector::firstElement() const { return elementAt (0); } INLINELINKAGE unsigned char MSBinaryVector::lastElement() const { return elementAt (_pImpl->length() -1); } INLINELINKAGE unsigned char MSBinaryVector::operator[] (unsigned int index_) const { return elementAt (index_); } INLINELINKAGE unsigned char MSBinaryVector::operator() (unsigned int index_) const { return elementAt (index_); } INLINELINKAGE const unsigned char & MSBinaryVector::elementAt (unsigned int index_) const { #if !defined(MS_NO_INDEX_ERROR) if (index_ >= _pImpl->length()) { _pImpl->vectorIndexError (index_); return *(const unsigned char *)ops().badData(); } #endif //!MS_NO_INDEX_ERROR return data()[index_]; } INLINELINKAGE MSBinaryVector::SPick MSBinaryVector::operator[] (unsigned int index_) { return SPick (*this, index_); } INLINELINKAGE MSBinaryVector MSBinaryVector::operator[] (const MSIndexVector & iVect_) const { return select (*this, iVect_); } INLINELINKAGE MSBinaryVector MSBinaryVector::operator[] (const MSBinaryVector & bVect_) const { return compress (*this, bVect_); } INLINELINKAGE long MSBinaryVector::compare (const MSBinaryVector & vect_) const { return _pImpl->compare (*vect_._pImpl); } INLINELINKAGE MSBinaryVector MSBinaryVector::binaryCompare (const MSBinaryVector & vect_, MSComparison comp_) const { return _pImpl->binaryCompare (*vect_._pImpl, comp_); } INLINELINKAGE MSBinaryVector MSBinaryVector::binaryCompare (const unsigned char value_, MSComparison comp_) const { return _pImpl->binaryCompare ((void *)&value_, comp_); } INLINELINKAGE MSBoolean MSBinaryVector::operator== (const MSBinaryVector & vect_) const { return MSBoolean (compare(vect_) == 0); } INLINELINKAGE MSBoolean MSBinaryVector::operator!= (const MSBinaryVector & vect_) const { return MSBoolean (compare(vect_) != 0); } INLINELINKAGE MSBoolean operator< (const MSBinaryVector & vect1_, const MSBinaryVector & vect2_) { return MSBoolean (vect1_.compare(vect2_) < 0); } INLINELINKAGE MSBoolean operator> (const MSBinaryVector & vect1_, const MSBinaryVector & vect2_) { return MSBoolean (vect1_.compare(vect2_) > 0); } INLINELINKAGE MSBoolean operator<= (const MSBinaryVector & vect1_, const MSBinaryVector & vect2_) { return MSBoolean (vect1_.compare(vect2_) <= 0); } INLINELINKAGE MSBoolean operator>= (const MSBinaryVector & vect1_, const MSBinaryVector & vect2_) { return MSBoolean (vect1_.compare(vect2_) >= 0); } INLINELINKAGE MSBoolean operator< (const MSBinaryVector & vect_, const unsigned char value_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSLessThan); } INLINELINKAGE MSBoolean operator< (const unsigned char value_, const MSBinaryVector & vect_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSGreaterThan); } INLINELINKAGE MSBoolean operator> (const MSBinaryVector & vect_, const unsigned char value_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSGreaterThan); } INLINELINKAGE MSBoolean operator> (const unsigned char value_, const MSBinaryVector & vect_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSLessThan); } INLINELINKAGE MSBoolean operator<= (const MSBinaryVector & vect_, const unsigned char value_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSLessThanOrEqualTo); } INLINELINKAGE MSBoolean operator<= (const unsigned char value_, const MSBinaryVector & vect_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSGreaterThanOrEqualTo); } INLINELINKAGE MSBoolean operator>= (const MSBinaryVector & vect_, const unsigned char value_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSGreaterThanOrEqualTo); } INLINELINKAGE MSBoolean operator>= (const unsigned char value_, const MSBinaryVector & vect_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSLessThanOrEqualTo); } INLINELINKAGE MSBoolean operator== (const MSBinaryVector & vect_, const unsigned char value_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSEqualTo); } INLINELINKAGE MSBoolean operator== (const unsigned char value_, const MSBinaryVector & vect_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSEqualTo); } INLINELINKAGE MSBoolean operator!= (const MSBinaryVector & vect_, const unsigned char value_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSNotEqualTo); } INLINELINKAGE MSBoolean operator!= (const unsigned char value_, const MSBinaryVector & vect_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSNotEqualTo); } INLINELINKAGE MSBinaryVector & MSBinaryVector::operator<<= (const unsigned char value_) { return append (value_); } INLINELINKAGE MSBinaryVector & MSBinaryVector::operator<<= (const MSBinaryVector & vect_) { return append (vect_); } INLINELINKAGE MSBinaryVector & MSBinaryVector::operator<< (const unsigned char value_) { return append (value_); } INLINELINKAGE MSBinaryVector & MSBinaryVector::operator<< (const MSBinaryVector & vect_) { return append (vect_); } /*** INLINELINKAGE MSBinaryVector & operator<< (MSBinaryVector & vect1_, const MSBinaryVector & vect2_) { return vect1_.append (vect2_); } INLINELINKAGE MSBinaryVector & operator<< (MSBinaryVector & vect_, const unsigned char value_) { return vect_.append (value_); } ***/ INLINELINKAGE MSBinaryVector operator& (const MSBinaryVector & vect1_, const MSBinaryVector & vect2_) { return MSBinaryVector::doBitwiseOp (vect1_, vect2_, ::bitwiseAND); } INLINELINKAGE MSBinaryVector operator& (const unsigned char value_, const MSBinaryVector & vect_) { return MSBinaryVector::doBitwiseOp (vect_, value_, ::bitwiseAND); } INLINELINKAGE MSBinaryVector operator& (const MSBinaryVector & vect_, const unsigned char value_) { return MSBinaryVector::doBitwiseOp (vect_, value_, ::bitwiseAND); } INLINELINKAGE MSBinaryVector & MSBinaryVector::operator&= (const MSBinaryVector & vect_) { return doBitwiseOp (vect_, ::bitwiseAND, ::bitwiseAND); } INLINELINKAGE MSBinaryVector & MSBinaryVector::operator&= (const unsigned char value_) { return doBitwiseOp (value_, ::bitwiseAND, ::bitwiseAND); } INLINELINKAGE MSBinaryVector operator| (const MSBinaryVector & vect1_, const MSBinaryVector & vect2_) { return MSBinaryVector::doBitwiseOp (vect1_, vect2_, ::bitwiseOR); } INLINELINKAGE MSBinaryVector operator| (const unsigned char value_, const MSBinaryVector & vect_) { return MSBinaryVector::doBitwiseOp (vect_, value_, ::bitwiseOR); } INLINELINKAGE MSBinaryVector operator| (const MSBinaryVector & vect_, const unsigned char value_) { return MSBinaryVector::doBitwiseOp (vect_, value_, ::bitwiseOR); } INLINELINKAGE MSBinaryVector & MSBinaryVector::operator|= (const MSBinaryVector & vect_) { return doBitwiseOp (vect_, ::bitwiseOR, ::bitwiseOR); } INLINELINKAGE MSBinaryVector & MSBinaryVector::operator|= (const unsigned char value_) { return doBitwiseOp (value_, ::bitwiseOR, ::bitwiseOR); } INLINELINKAGE MSBinaryVector operator^ (const MSBinaryVector & vect1_, const MSBinaryVector & vect2_) { return MSBinaryVector::doBitwiseOp (vect1_, vect2_, ::bitwiseXOR); } INLINELINKAGE MSBinaryVector operator^ (const unsigned char value_, const MSBinaryVector & vect_) { return MSBinaryVector::doBitwiseOp (vect_, value_, ::bitwiseXOR); } INLINELINKAGE MSBinaryVector operator^ (const MSBinaryVector & vect_, const unsigned char value_) { return MSBinaryVector::doBitwiseOp (vect_, value_, ::bitwiseXOR); } INLINELINKAGE MSBinaryVector & MSBinaryVector::operator^= (const MSBinaryVector & vect_) { return doBitwiseOp (vect_, ::bitwiseXOR, ::bitwiseXOR); } INLINELINKAGE MSBinaryVector & MSBinaryVector::operator^= (const unsigned char value_) { return doBitwiseOp (value_, ::bitwiseXOR, ::bitwiseXOR); } INLINELINKAGE MSBinaryVector operator~ (const MSBinaryVector & vect_) { return ! vect_; } INLINELINKAGE MSBinaryVector::Data * MSBinaryVector::Data::incrementCount() { _refCount++; return this; } INLINELINKAGE void MSBinaryVector::Data::decrementCount() { if (--_refCount == 0) delete this; } INLINELINKAGE const unsigned char * MSBinaryVector::Data::elements() const { return &_pElements[0]; } // same as elements(); used for backward compatibility only INLINELINKAGE const unsigned char * MSBinaryVector::Data::data() const { return &_pElements[0]; } INLINELINKAGE unsigned char * MSBinaryVector::Data::elements() { return &_pElements[0]; } // same as elements(); used for backward compatibility only INLINELINKAGE unsigned char * MSBinaryVector::Data::data() { return &_pElements[0]; } INLINELINKAGE const unsigned char & MSBinaryVector::Data::elementAt (unsigned index_) const { return elements()[index_]; } INLINELINKAGE unsigned char & MSBinaryVector::Data::elementAt (unsigned index_) { return elements()[index_]; } INLINELINKAGE MSBinaryVector::SPick::SPick (MSBinaryVector & aVector_, unsigned int index_) : _index(index_), _pVector(&aVector_) { } INLINELINKAGE MSBinaryVector::SPick::SPick (const SPick & aPick_) : _index(aPick_._index), _pVector(aPick_._pVector) { } INLINELINKAGE MSBinaryVector::SPick & MSBinaryVector::SPick::operator&= (const unsigned char value_) { _pVector->set (_index, (*_pVector)(_index) & value_); return *this; } INLINELINKAGE MSBinaryVector::SPick & MSBinaryVector::SPick::operator|= (const unsigned char value_) { _pVector->set (_index, (*_pVector)(_index) | value_); return *this; } INLINELINKAGE MSBinaryVector::SPick & MSBinaryVector::SPick::operator^= (const unsigned char value_) { _pVector->set (_index, (*_pVector)(_index) ^ value_); return *this; } INLINELINKAGE MSBinaryVector::SPick::operator unsigned char() const { return (*_pVector)(_index); } #endif // MSBinaryVectorINLINES aplus-fsf-4.22/src/MSTypes/MSBoolInlines.C0000644000265000001440000000467510772770466013766 #ifndef MSBoolINLINES #define MSBoolINLINES /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// INLINELINKAGE MSBool::MSBool(MSBoolean aBoolean_) { _isSet=MSTrue; _bool=aBoolean_; } INLINELINKAGE MSBool::MSBool(void) { _isSet=MSFalse; _bool=MSFalse; } INLINELINKAGE MSBoolean MSBool::isSet(void) const { return _isSet; } INLINELINKAGE MSBoolean MSBool::isTrue(void) const { return _bool; } INLINELINKAGE MSBoolean MSBool::isFalse(void) const { return MSBoolean(_bool==MSFalse); } INLINELINKAGE MSBool::operator int() const { return _bool; } INLINELINKAGE MSBool::operator MSBoolean() const { return _bool; } INLINELINKAGE MSBoolean MSBool::operator==(const MSBool& aBoolean_) const { return MSBoolean(_bool==aBoolean_._bool); } INLINELINKAGE MSBoolean MSBool::operator==(int i_) const { return MSBoolean(i_?_bool:!_bool); } INLINELINKAGE MSBoolean MSBool::operator!=(const MSBool& aBoolean_) const { return MSBoolean(_bool!=aBoolean_._bool); } INLINELINKAGE MSBoolean MSBool::operator!=(int i_) const { return MSBoolean(i_?!_bool:_bool); } INLINELINKAGE MSBoolean MSBool::operator <(const MSBool& aBoolean_) const { return _bool==MSFalse&&aBoolean_._bool==MSTrue?MSTrue:MSFalse; } INLINELINKAGE MSBoolean MSBool::operator >(const MSBool& aBoolean_) const { return _bool==MSTrue&&aBoolean_._bool==MSFalse?MSTrue:MSFalse; } INLINELINKAGE MSBoolean MSBool::operator<=(const MSBool& aBoolean_) const { return _bool==aBoolean_._bool||aBoolean_._bool==MSTrue?MSTrue:MSFalse; } INLINELINKAGE MSBoolean MSBool::operator>=(const MSBool& aBoolean_) const { return _bool==aBoolean_._bool||aBoolean_._bool==MSFalse?MSFalse:MSTrue; } INLINELINKAGE MSBool& MSBool::operator=(const MSBool& aBoolean_) { _isSet=aBoolean_._isSet,_bool=aBoolean_._bool; return changed(),*this; } INLINELINKAGE MSBool& MSBool::operator=(MSBoolean aBoolean_) { _isSet=MSTrue,_bool=aBoolean_; return changed(),*this; } INLINELINKAGE MSBool& MSBool::operator=(int i_) { _isSet=MSTrue,_bool=(i_?MSTrue:MSFalse); return changed(),*this; } #if !defined (MS_ENUM_COMPARE_BUG) INLINELINKAGE MSBoolean MSBool::operator!=(MSBoolean bool_) const { return MSBoolean(_bool!=bool_); } INLINELINKAGE MSBoolean MSBool::operator==(MSBoolean bool_) const { return MSBoolean(_bool==bool_); } #endif #endif aplus-fsf-4.22/src/MSTypes/MSBuiltinSPickInlines.C0000644000265000001440000000673210772770466015427 #ifndef MSBuiltinSPickINLINES #define MSBuiltinSPickINLINES /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include template INLINELINKAGE MSBuiltinSPick::MSBuiltinSPick (MSBuiltinVector & aVector_, unsigned int index_) : _pVector(&aVector_), _index(index_) { } template INLINELINKAGE MSBuiltinSPick::MSBuiltinSPick (const MSBuiltinSPick & aPick_) : _pVector(aPick_._pVector), _index(aPick_._index) { } // prefix increment template INLINELINKAGE MSBuiltinSPick & MSBuiltinSPick::operator++() { _pVector->set (_index, (*_pVector)(_index) +1); return *this; } // prefix decrement template INLINELINKAGE MSBuiltinSPick & MSBuiltinSPick::operator--() { _pVector->set (_index, (*_pVector)(_index) -1); return *this; } // postfix increment template INLINELINKAGE Type MSBuiltinSPick::operator++ (int) { Type temp = (*_pVector)(_index); _pVector->set (_index, temp+1); return temp; } template INLINELINKAGE Type MSBuiltinSPick::operator-- (int) { Type temp = (*_pVector)(_index); _pVector->set (_index, temp-1); return temp; } template INLINELINKAGE MSBuiltinSPick & MSBuiltinSPick::operator+= (const Type & value_) { _pVector->set (_index, (*_pVector)(_index) + value_); return *this; } template INLINELINKAGE MSBuiltinSPick & MSBuiltinSPick::operator-= (const Type & value_) { _pVector->set (_index, (*_pVector)(_index) - value_); return *this; } template INLINELINKAGE MSBuiltinSPick & MSBuiltinSPick::operator*= (const Type & value_) { _pVector->set (_index, (*_pVector)(_index) * value_); return *this; } template INLINELINKAGE MSBuiltinSPick & MSBuiltinSPick::operator/= (const Type & value_) { _pVector->set (_index, (*_pVector)(_index) / value_); return *this; } template INLINELINKAGE MSBuiltinSPick::operator Type() const { return (*_pVector)(_index); } template INLINELINKAGE MSBuiltinSPick & MSBuiltinSPick::operator%= (const Type & value_) { _pVector->set (_index, (*_pVector)(_index) % value_); return *this; } template INLINELINKAGE MSBuiltinSPick & MSBuiltinSPick::operator<<= (const Type & value_) { _pVector->set (_index, (*_pVector)(_index) << value_); return *this; } template INLINELINKAGE MSBuiltinSPick & MSBuiltinSPick::operator>>= (const Type & value_) { _pVector->set (_index, (*_pVector)(_index) >> value_); return *this; } template INLINELINKAGE MSBuiltinSPick & MSBuiltinSPick::operator&= (const Type & value_) { _pVector->set (_index, (*_pVector)(_index) & value_); return *this; } template INLINELINKAGE MSBuiltinSPick & MSBuiltinSPick::operator|= (const Type & value_) { _pVector->set (_index, (*_pVector)(_index) | value_); return *this; } template INLINELINKAGE MSBuiltinSPick & MSBuiltinSPick::operator^= (const Type & value_) { _pVector->set (_index, (*_pVector)(_index) ^ value_); return *this; } #endif // MSBuiltinSPickINLINES aplus-fsf-4.22/src/MSTypes/MSBuiltinTypeVectorInlines.C0000644000265000001440000002146410774212423016503 #ifndef MSBuiltinTypeVectorInlinesHEADER #define MSBuiltinTypeVectorInlinesHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #ifndef MS_NO_INLINES #include #endif // MS_NO_INLINES template INLINELINKAGE Type MSBuiltinVector::firstElement() const { return elementAt (0); } template INLINELINKAGE Type MSBuiltinVector::lastElement() const { return elementAt (this->_pImpl->length() -1); } template INLINELINKAGE Type MSBuiltinVector::operator() (unsigned int index_) const { return elementAt (index_); } template INLINELINKAGE Type MSBuiltinVector::operator[] (unsigned int index_) const { return elementAt (index_); } template INLINELINKAGE const Type & MSBuiltinVector::elementAt (unsigned int index_) const { #if !defined(MS_NO_INDEX_ERROR) if (index_ >= this->_pImpl->length()) { this->_pImpl->vectorIndexError (index_); return *(const Type *)this->ops().badData(); } #endif //MS_NO_INDEX_ERROR return this->data()[index_]; } template INLINELINKAGE MSBuiltinSPick MSBuiltinVector::operator[] (unsigned int index_) { return MSBuiltinSPick (*this, index_); } template INLINELINKAGE MSBuiltinVector MSBuiltinVector::operator[] (const MSIndexVector & iVect_) const { return this->select (*this, iVect_); } template INLINELINKAGE MSBuiltinVector MSBuiltinVector::operator[] (const MSBinaryVector & bVect_) const { return compress (*this, bVect_); } template INLINELINKAGE MSBuiltinVector & MSBuiltinVector::series() { return series(this->_pImpl->length()); } template INLINELINKAGE double MSBuiltinVector::avg() const { return sum()/this->_pImpl->length(); } template INLINELINKAGE double MSBuiltinVector::mean() const { return sum()/this->_pImpl->length(); } template INLINELINKAGE double MSBuiltinVector::median() const { return ((MSBuiltinVectorImpl *)this->_pImpl)->median(); } template INLINELINKAGE double MSBuiltinVector::variance(MSEstimateType estType_) const { return ((MSBuiltinVectorImpl *)this->_pImpl)->variance(mean(), estType_); } template INLINELINKAGE double MSBuiltinVector::stdDeviation(MSEstimateType estType_) const { return ::sqrt(variance(estType_)); } template INLINELINKAGE MSBuiltinVector movingAverage (const MSBuiltinVector & vect_, unsigned int width_) { return MSBuiltinVector (((MSBuiltinVectorImpl *)vect_._pImpl)->movingAverage (width_)); } // Unary minus operator template INLINELINKAGE MSBuiltinVector operator- (const MSBuiltinVector & vect_) { return MSBuiltinVector(MSBuiltinVector::doMath(vect_,1,MSBuiltinVector::Unary)); } // Prefix increment operator template INLINELINKAGE MSBuiltinVector& MSBuiltinVector::operator++() { doMath(1,Incr); return *this; } // Prefix decrement operator template INLINELINKAGE MSBuiltinVector& MSBuiltinVector::operator--() { doMath(1,Decr); return *this; } // Postfix increment operator template INLINELINKAGE MSBuiltinVector MSBuiltinVector::operator++(int) { MSBuiltinVectorImpl *pResImpl = (MSBuiltinVectorImpl *)this->_pImpl->clone(); return operator++(), MSBuiltinVector(pResImpl); // call the prefix operator & return the old data } // Postfix decrement operator template INLINELINKAGE MSBuiltinVector MSBuiltinVector::operator--(int) { MSBuiltinVectorImpl *pResImpl = (MSBuiltinVectorImpl *)this->_pImpl->clone(); return operator--(), MSBuiltinVector(pResImpl); // call the prefix operator & return the old data } // operator + template INLINELINKAGE MSBuiltinVector operator+ (const MSBuiltinVector & vect1_, const MSBuiltinVector & vect2_) { return MSBuiltinVector(MSBuiltinVector::doMath(vect1_,vect2_,MSBuiltinVector::Plus)); } template INLINELINKAGE MSBuiltinVector operator+ (const MSBuiltinVector& vect_, const Type& value_) { return MSBuiltinVector(MSBuiltinVector::doMath(vect_,value_,MSBuiltinVector::Plus)); } template INLINELINKAGE MSBuiltinVector operator+ (const Type & value_, const MSBuiltinVector & vect_) { return MSBuiltinVector(MSBuiltinVector::doMath(value_,vect_,MSBuiltinVector::Plus)); } // operator - template INLINELINKAGE MSBuiltinVector operator- (const MSBuiltinVector & vect1_, const MSBuiltinVector & vect2_) { return MSBuiltinVector(MSBuiltinVector::doMath(vect1_,vect2_,MSBuiltinVector::Minus)); } template INLINELINKAGE MSBuiltinVector operator- (const MSBuiltinVector & vect_, const Type & value_) { return MSBuiltinVector(MSBuiltinVector::doMath(vect_,value_,MSBuiltinVector::Minus)); } template INLINELINKAGE MSBuiltinVector operator- (const Type & value_, const MSBuiltinVector & vect_) { return MSBuiltinVector(MSBuiltinVector::doMath(value_,vect_,MSBuiltinVector::Minus)); } // operator * template INLINELINKAGE MSBuiltinVector operator* (const MSBuiltinVector & vect1_, const MSBuiltinVector & vect2_) { return MSBuiltinVector(MSBuiltinVector::doMath(vect1_,vect2_,MSBuiltinVector::Times)); } template INLINELINKAGE MSBuiltinVector operator* (const MSBuiltinVector & vect_, const Type & value_) { return MSBuiltinVector(MSBuiltinVector::doMath(vect_,value_,MSBuiltinVector::Times)); } template INLINELINKAGE MSBuiltinVector operator* (const Type & value_, const MSBuiltinVector & vect_) { return MSBuiltinVector(MSBuiltinVector::doMath(value_,vect_,MSBuiltinVector::Times)); } // operator - template INLINELINKAGE MSBuiltinVector operator/(const MSBuiltinVector& vect1_, const MSBuiltinVector& vect2_) { return MSBuiltinVector(MSBuiltinVector::doMath(vect1_,vect2_,MSBuiltinVector::Divide)); } template INLINELINKAGE MSBuiltinVector operator/(const MSBuiltinVector& vect_, const Type& value_) { return MSBuiltinVector(MSBuiltinVector::doMath(vect_,value_,MSBuiltinVector::Divide)); } template INLINELINKAGE MSBuiltinVector operator/(const Type& value_, const MSBuiltinVector& vect_) { return MSBuiltinVector(MSBuiltinVector::doMath(value_,vect_,MSBuiltinVector::Divide)); } // operator += template INLINELINKAGE MSBuiltinVector& MSBuiltinVector::operator+=(const MSBuiltinVector& vect_) { doMath(vect_,Plus); return *this; } template INLINELINKAGE MSBuiltinVector& MSBuiltinVector::operator+=(const Type& value_) { doMath(value_,Plus); return *this; } // operator -= template INLINELINKAGE MSBuiltinVector& MSBuiltinVector::operator-=(const MSBuiltinVector& vect_) { doMath(vect_,Minus); return *this; } template INLINELINKAGE MSBuiltinVector& MSBuiltinVector::operator-=(const Type& value_) { doMath(value_,Minus);return *this; } // operator *= template INLINELINKAGE MSBuiltinVector& MSBuiltinVector::operator*=(const MSBuiltinVector& vect_) { doMath(vect_,Times); return *this; } template INLINELINKAGE MSBuiltinVector& MSBuiltinVector::operator*=(const Type& value_) { doMath(value_,Times);return *this; } // operator /= template INLINELINKAGE MSBuiltinVector& MSBuiltinVector::operator/=(const MSBuiltinVector& vect_) { doMath(vect_,Divide); return *this; } template INLINELINKAGE MSBuiltinVector& MSBuiltinVector::operator/=(const Type& value_) { doMath(value_,Divide);return *this; } template INLINELINKAGE unsigned int stringLen (const Type &, const char *pString_) { MSString str (pString_); return str.numWords(); } INLINELINKAGE unsigned int stringLen (const char &, const char *pString_) { return strlen (pString_); } INLINELINKAGE unsigned int stringLen (const unsigned char &, const char *pString_) { return strlen (pString_); } #endif // MSBuiltinTypeVectorInlinesHEADER aplus-fsf-4.22/src/MSTypes/MSBuiltinVectorImplInlines.C0000644000265000001440000000100110772770466016462 #ifndef MSBuiltinVectorImplINLINES #define MSBuiltinVectorImplINLINES /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #ifndef MS_NO_INLINES #include #endif //MS_NO_INLINES #endif // MSBuiltinVectorImplINLINES aplus-fsf-4.22/src/MSTypes/MSCharVectorInlines.C0000644000265000001440000000112410772770466015115 #ifndef MSCharVectorINLINES #define MSCharVectorINLINES /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MS_NO_INLINES #define INLINELINKAGE inline #else #define INLINELINKAGE #endif //MS_NO_INLINES /*** INLINELINKAGE MSTypeVector::MSTypeVector (MSBuiltinVectorImpl *pImpl) : BuiltinVectorChar (pImpl) { } ***/ #endif // MSCharVectorINLINES aplus-fsf-4.22/src/MSTypes/MSConvertInlines.C0000644000265000001440000000061110772770466014475 #ifndef MSConvertINLINES #define MSConvertINLINES /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #endif //MSConvertINLINES aplus-fsf-4.22/src/MSTypes/MSDataInlines.C0000644000265000001440000000075610772770466013740 #ifndef MSDataINLINES #define MSDataINLINES /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// INLINELINKAGE unsigned MSData::size() const { return _size; } INLINELINKAGE unsigned MSData::refCount () const { return _refCount; } #endif // MSDataINLINES aplus-fsf-4.22/src/MSTypes/MSDateInlines.C0000644000265000001440000000660510772770467013744 #ifndef MSDateINLINES #define MSDateINLINES /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// INLINELINKAGE MSDate::MSDateFormat MSDate::defaultFormat(void) { return _defaultFormat; } INLINELINKAGE void MSDate::defaultFormat(MSDate::MSDateFormat format_) { _defaultFormat=format_; } INLINELINKAGE void MSDate::defaultConstructToToday(MSBoolean aBoolean_) { _defaultConstructToToday=aBoolean_; } INLINELINKAGE MSBoolean MSDate::defaultConstructToToday(void) { return _defaultConstructToToday; } INLINELINKAGE const MSString& MSDate::strftimeDefaultFormat(void) { return _strftimeDefaultFormat; } INLINELINKAGE void MSDate::strftimeDefaultFormat(MSString& format_) { _strftimeDefaultFormat=format_; } INLINELINKAGE void MSDate::strftimeDefaultFormat(const char *pFormat_) { _strftimeDefaultFormat=pFormat_; } INLINELINKAGE MSBoolean MSDate::assertWeekDayNumber(MSDay d_) { return MSBoolean(d_>=1&&d_<=7); } INLINELINKAGE MSBoolean MSDate::assertIndexOfMonth(MSMonth m_) { return MSBoolean(m_>=1&&m_<=12); } INLINELINKAGE MSJulian MSDate::nullDate(void) { return _nullDate; } INLINELINKAGE MSDate::MSDate(void) : _date(0) { if (defaultConstructToToday()==MSTrue) _date=currentDate(); } INLINELINKAGE MSDate::MSDate(const MSString& aString_) { _date=nullDate(),set((const char *)aString_); } INLINELINKAGE MSDate::MSDate(const char *pString_) { _date=nullDate(),set(pString_); } INLINELINKAGE MSDate::MSDate(int m_,int d_,int y_) { _date=asJulianNumber(m_,d_,y_); } INLINELINKAGE MSDate::MSDate(const MSDate& d_) { _date=d_.date(); } INLINELINKAGE MSDate::MSDate(MSJulian j_) { _date=j_; } INLINELINKAGE MSDate MSDate::today(void) { return MSDate(currentDate()); } INLINELINKAGE MSJulian MSDate::asInternal(void) const { return _date; } INLINELINKAGE MSDate::operator double() const { return _date; } INLINELINKAGE MSDate::operator unsigned long() const { return _date; } // Prefix - add/subtract one, then return result INLINELINKAGE MSDate& MSDate::operator++() { return ++_date,changed(),*this; } INLINELINKAGE MSDate& MSDate::operator--() { return --_date,changed(),*this; } // Postfix - add/subtract one, then return the initial value INLINELINKAGE MSDate MSDate::operator++(int) { MSJulian d=_date++; return changed(),MSDate(d); } INLINELINKAGE MSDate MSDate::operator--(int) { MSJulian d=_date--; return changed(),MSDate(d); } INLINELINKAGE MSDate& MSDate::operator=(const MSDate& date_) {_date=date_.date(); return changed(),*this; } INLINELINKAGE MSBoolean MSDate::operator <(const MSDate& date_) const { return MSBoolean(_date(const MSDate& date_) const { return MSBoolean(_date>date_._date); } INLINELINKAGE MSBoolean MSDate::operator<=(const MSDate& date_) const { return MSBoolean(_date<=date_._date); } INLINELINKAGE MSBoolean MSDate::operator>=(const MSDate& date_) const { return MSBoolean(_date>=date_._date); } INLINELINKAGE MSBoolean MSDate::operator==(const MSDate& date_) const { return MSBoolean(_date==date_._date); } INLINELINKAGE MSBoolean MSDate::operator!=(const MSDate& date_) const { return MSBoolean(_date!=date_._date); } #endif aplus-fsf-4.22/src/MSTypes/MSFloatInlines.C0000644000265000001440000001255010772770467014130 #ifndef MSFloatINLINES #define MSFloatINLINES /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// //-------------------------------------------------------------------------------- // MSFloat bit flags methods - protected API //-------------------------------------------------------------------------------- INLINELINKAGE MSBoolean MSFloat::bitState(MSFloat::BitFlag flag_) const { return (_flags&flag_)?MSTrue:MSFalse; } INLINELINKAGE void MSFloat::setToValid(void) { _flags|=MSFloat::Valid; } INLINELINKAGE void MSFloat::setToInValid(void) { _flags&=~MSFloat::Valid; } INLINELINKAGE void MSFloat::setBit(MSFloat::BitFlag flag_) { _flags|=flag_; } INLINELINKAGE void MSFloat::unsetBit(MSFloat::BitFlag flag_) { _flags&=~flag_; } //-------------------------------------------------------------------------------- // MSFloat bit flags methods - public API //-------------------------------------------------------------------------------- INLINELINKAGE MSBoolean MSFloat::isValid(void) const { return bitState(MSFloat::Valid); } INLINELINKAGE MSBoolean MSFloat::isSet(void) const { return bitState(MSFloat::Set); } INLINELINKAGE void MSFloat::setInvalid(void) { setToInValid(); } //-------------------------------------------------------------------------------- // MSFloat comparison methods //-------------------------------------------------------------------------------- INLINELINKAGE MSBoolean operator==(double d_,const MSFloat& f_) { return MSBoolean(f_==d_); } INLINELINKAGE MSBoolean operator==(int i_,const MSFloat& f_) { return MSBoolean(f_==i_); } INLINELINKAGE MSBoolean operator==(const MSInt& i_,const MSFloat& f_) { return MSBoolean(f_==i_); } INLINELINKAGE MSBoolean operator!=(double d_,const MSFloat& f_) { return MSBoolean(!(f_==d_)); } INLINELINKAGE MSBoolean operator!=(int i_,const MSFloat& f_) { return MSBoolean(!(f_==i_)); } INLINELINKAGE MSBoolean operator!=(const MSInt& i_,const MSFloat& f_) { return MSBoolean(!(f_==i_)); } // compare MSFloat to MSFloat INLINELINKAGE MSBoolean operator <(const MSFloat& a_,const MSFloat& b_) { return MSBoolean(a_.compare(b_)<0); } INLINELINKAGE MSBoolean operator >(const MSFloat& a_,const MSFloat& b_) { return MSBoolean(a_.compare(b_)>0); } INLINELINKAGE MSBoolean operator<=(const MSFloat& a_,const MSFloat& b_) { return MSBoolean(a_.compare(b_)<=0);} INLINELINKAGE MSBoolean operator>=(const MSFloat& a_,const MSFloat& b_) { return MSBoolean(a_.compare(b_)>=0);} // compare MSFloat to double INLINELINKAGE MSBoolean operator <(const MSFloat& f_,double d_) { return MSBoolean(f_.compare(d_)<0); } INLINELINKAGE MSBoolean operator >(const MSFloat& f_,double d_) { return MSBoolean(f_.compare(d_)>0); } INLINELINKAGE MSBoolean operator<=(const MSFloat& f_,double d_) { return MSBoolean(f_.compare(d_)<=0);} INLINELINKAGE MSBoolean operator>=(const MSFloat& f_,double d_) { return MSBoolean(f_.compare(d_)>=0);} // compare double to MSFloat INLINELINKAGE MSBoolean operator <(double d_,const MSFloat& f_) { return MSBoolean(f_.compare(d_)>0); } INLINELINKAGE MSBoolean operator<=(double d_,const MSFloat& f_) { return MSBoolean(f_.compare(d_)>=0);} INLINELINKAGE MSBoolean operator >(double d_,const MSFloat& f_) { return MSBoolean(f_.compare(d_)<0); } INLINELINKAGE MSBoolean operator>=(double d_,const MSFloat& f_) { return MSBoolean(f_.compare(d_)<=0);} // compare MSFloat to int INLINELINKAGE MSBoolean operator <(const MSFloat& f_,int i_) { return MSBoolean(f_.compare(i_)<0); } INLINELINKAGE MSBoolean operator<=(const MSFloat& f_,int i_) { return MSBoolean(f_.compare(i_)<=0);} INLINELINKAGE MSBoolean operator >(const MSFloat& f_,int i_) { return MSBoolean(f_.compare(i_)>0); } INLINELINKAGE MSBoolean operator>=(const MSFloat& f_,int i_) { return MSBoolean(f_.compare(i_)>=0);} // compare int to MSFloat INLINELINKAGE MSBoolean operator <(int i_,const MSFloat& f_) { return MSBoolean(f_.compare(i_)>0); } INLINELINKAGE MSBoolean operator<=(int i_,const MSFloat& f_) { return MSBoolean(f_.compare(i_)>=0);} INLINELINKAGE MSBoolean operator >(int i_,const MSFloat& f_) { return MSBoolean(f_.compare(i_)<0); } INLINELINKAGE MSBoolean operator>=(int i_,const MSFloat& f_) { return MSBoolean(f_.compare(i_)<=0);} // compare MSFloat to MSInt INLINELINKAGE MSBoolean operator <(const MSFloat& f_,const MSInt& i_) { return MSBoolean(f_.compare((int)i_)<0); } INLINELINKAGE MSBoolean operator<=(const MSFloat& f_,const MSInt& i_) { return MSBoolean(f_.compare((int)i_)<=0);} INLINELINKAGE MSBoolean operator >(const MSFloat& f_,const MSInt& i_) { return MSBoolean(f_.compare((int)i_)>0); } INLINELINKAGE MSBoolean operator>=(const MSFloat& f_,const MSInt& i_) { return MSBoolean(f_.compare((int)i_)>=0);} // compare MSInt to MSFloat INLINELINKAGE MSBoolean operator <(const MSInt& i_,const MSFloat& f_) { return MSBoolean(f_.compare((int)i_)>0); } INLINELINKAGE MSBoolean operator<=(const MSInt& i_,const MSFloat& f_) { return MSBoolean(f_.compare((int)i_)>=0);} INLINELINKAGE MSBoolean operator >(const MSInt& i_,const MSFloat& f_) { return MSBoolean(f_.compare((int)i_)<0); } INLINELINKAGE MSBoolean operator>=(const MSInt& i_,const MSFloat& f_) { return MSBoolean(f_.compare((int)i_)<=0);} #endif aplus-fsf-4.22/src/MSTypes/MSFloatSPickInlines.C0000644000265000001440000000434010772770467015060 #ifndef MSFloatSPickINLINES #define MSFloatSPickINLINES /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #ifndef MS_NO_INLINES #include #endif INLINELINKAGE MSBuiltinSPick::MSBuiltinSPick (MSBuiltinVector & aVector_, unsigned int index_) : _pVector(&aVector_), _index(index_) { } INLINELINKAGE MSBuiltinSPick::MSBuiltinSPick (const MSBuiltinSPick & aPick_) : _pVector(aPick_._pVector), _index(aPick_._index) { } // prefix increment INLINELINKAGE MSBuiltinSPick & MSBuiltinSPick::operator++() { _pVector->set (_index, (*_pVector)(_index) +1); return *this; } // prefix decrement INLINELINKAGE MSBuiltinSPick & MSBuiltinSPick::operator--() { _pVector->set (_index, (*_pVector)(_index) -1); return *this; } // postfix increment INLINELINKAGE double MSBuiltinSPick::operator++ (int) { double temp = (*_pVector)(_index); _pVector->set (_index, temp+1); return temp; } INLINELINKAGE double MSBuiltinSPick::operator-- (int) { double temp = (*_pVector)(_index); _pVector->set (_index, temp-1); return temp; } INLINELINKAGE MSBuiltinSPick & MSBuiltinSPick::operator+= (const double & value_) { _pVector->set (_index, (*_pVector)(_index) + value_); return *this; } INLINELINKAGE MSBuiltinSPick & MSBuiltinSPick::operator-= (const double & value_) { _pVector->set (_index, (*_pVector)(_index) - value_); return *this; } INLINELINKAGE MSBuiltinSPick & MSBuiltinSPick::operator*= (const double & value_) { _pVector->set (_index, (*_pVector)(_index) * value_); return *this; } INLINELINKAGE MSBuiltinSPick & MSBuiltinSPick::operator/= (const double & value_) { _pVector->set (_index, (*_pVector)(_index) / value_); return *this; } INLINELINKAGE MSBuiltinSPick::operator double() const { return (*_pVector)(_index); } #endif // MSFloatSPickINLINES aplus-fsf-4.22/src/MSTypes/MSFloatVectorInlines.C0000644000265000001440000000065510772770467015316 #ifndef MSFloatVectorInlinesHEADER #define MSFloatVectorInlinesHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #endif // MSFloatVectorInlinesHEADER aplus-fsf-4.22/src/MSTypes/MSFormatInlines.C0000644000265000001440000000242210772770467014310 #ifndef MSFormatINLINES #define MSFormatINLINES /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// INLINELINKAGE MSFormat::MSFormatType MSFormat::formatType(void) const { return _formatType; } INLINELINKAGE unsigned long MSFormat::formatModifier(void) const { return _formatModifier; } INLINELINKAGE MSBool::MSBoolFormat MSFormat::boolFormat(void) const { return _format._bool; } INLINELINKAGE MSDate::MSDateFormat MSFormat::dateFormat(void) const { return _format._date; } INLINELINKAGE MSFloat::MSFloatFormat MSFormat::floatFormat(void) const { return _format._float; } INLINELINKAGE MSInt::MSIntFormat MSFormat::intFormat(void) const { return _format._int; } INLINELINKAGE MSMoney::MSMoneyFormat MSFormat::moneyFormat(void) const { return _format._money; } INLINELINKAGE MSRate::MSRateFormat MSFormat::rateFormat(void) const { return _format._rate; } INLINELINKAGE MSTerm::MSTermFormat MSFormat::termFormat(void) const { return _format._term; } INLINELINKAGE MSTime::MSTimeFormat MSFormat::timeFormat(void) const { return _format._time; } #endif aplus-fsf-4.22/src/MSTypes/MSGenericVectorInlines.C0000644000265000001440000005207310772770467015626 #ifndef MSGenericVectorINLINES #define MSGenericVectorINLINES /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include // define compareElements() method #ifndef MS_NO_INLINES #include #endif // MS_NO_INLINES template INLINELINKAGE unsigned int MSGenericVector::length() const { return _pImpl->length(); } template INLINELINKAGE unsigned int MSGenericVector::size() const { return ((MSGenericData *)_pImpl->data())->size(); } template INLINELINKAGE Type * MSGenericVector::elements() const { return ((MSGenericData *)_pImpl->data())->elements(); } template INLINELINKAGE unsigned int MSGenericVector::indexOf (const Type & value_, unsigned int startPos_) const { return _pImpl->indexOf ((void *)&value_, startPos_); } template INLINELINKAGE unsigned int MSGenericVector::lastIndexOf (const Type & value_, unsigned int startPos_) const { return _pImpl->lastIndexOf ((void *)&value_, startPos_); } template INLINELINKAGE unsigned int MSGenericVector::occurrencesOf (const Type & value_, unsigned int startPos_) const { return _pImpl->occurrencesOf ((const void *)&value_, startPos_); } template INLINELINKAGE MSIndexVector MSGenericVector::indicesOf (const MSGenericVector & v_) const { return _pImpl->indicesOf (*v_._pImpl); } template INLINELINKAGE MSBinaryVector MSGenericVector::memberOf (const MSGenericVector &v_) const { return _pImpl->memberOf (*v_._pImpl); } template INLINELINKAGE MSBinaryVector MSGenericVector::uniqueElements() const { return _pImpl->unique(); } template INLINELINKAGE MSGenericVector & MSGenericVector::append (const Type & value_) { _pImpl->append ((void *) &value_); return *this; } template INLINELINKAGE MSGenericVector & MSGenericVector::append (const MSGenericVector & vect_) { _pImpl->append (*vect_._pImpl); return *this; } template INLINELINKAGE MSGenericVector & MSGenericVector::removeAt (unsigned int index_) { _pImpl->removeAt (index_); return *this; } template INLINELINKAGE MSGenericVector & MSGenericVector::removeAt (unsigned int startPos_, unsigned int numEls_) { if (numEls_ > 0) _pImpl->removeAt (startPos_, numEls_); return *this; } template INLINELINKAGE MSGenericVector & MSGenericVector::remove (const MSIndexVector & iVect_) { _pImpl->remove (iVect_); return *this; } template INLINELINKAGE MSGenericVector & MSGenericVector::remove (const MSBinaryVector & bVect_) { _pImpl->remove (bVect_); return *this; } template INLINELINKAGE MSGenericVector & MSGenericVector::removeAll() { _pImpl->removeAll(); return *this; } template INLINELINKAGE MSGenericVector & MSGenericVector::select (const MSIndexVector & iVect_) { _pImpl->select (iVect_); return *this; } template INLINELINKAGE MSGenericVector & MSGenericVector::compress (const MSBinaryVector & bVect_) { _pImpl->compress (bVect_); return *this; } template INLINELINKAGE MSGenericVector & MSGenericVector::reshape (unsigned int newLen_) { _pImpl->reshape (newLen_); return *this; } template INLINELINKAGE MSGenericVector & MSGenericVector::exchange (unsigned int index1_, unsigned int index2_) { _pImpl->exchange (index1_, index2_); return *this; } template INLINELINKAGE MSGenericVector & MSGenericVector::reverse() { _pImpl->reverse(); return *this; } template INLINELINKAGE MSGenericVector & MSGenericVector::rotate (int amount_) { _pImpl->rotate (amount_); return *this; } template INLINELINKAGE MSGenericVector & MSGenericVector::take (int numEls_) { _pImpl->take (numEls_); return *this; } template INLINELINKAGE MSGenericVector & MSGenericVector::take (int numEls_, const Type & filler_) { _pImpl->take (numEls_, (void *)&filler_); return *this; } template INLINELINKAGE MSGenericVector & MSGenericVector::drop (int numEls_) { _pImpl->drop (numEls_); return *this; } template INLINELINKAGE MSGenericVector & MSGenericVector::replaceAt (unsigned int index_, const Type & value_) { set (index_, value_); return *this; } template INLINELINKAGE MSGenericVector & MSGenericVector::selectUnique() { return compress (_pImpl->unique()); } template INLINELINKAGE MSGenericVector MSGenericVector::selectUnique (const MSGenericVector & vect_) { return compress (vect_, vect_._pImpl->unique()); } template INLINELINKAGE MSGenericVector& MSGenericVector::selectiveAssign(const MSIndexVector& iVect_, const Type& value_) { _pImpl->setSelected(iVect_,(void *)&value_); return *this; } template INLINELINKAGE MSGenericVector& MSGenericVector::selectiveAssign(const MSIndexVector& iVect_, const MSGenericVector& vect_) { _pImpl->setSelected(iVect_,*vect_._pImpl); return *this; } template INLINELINKAGE MSGenericVector& MSGenericVector::selectiveAssign(const MSBinaryVector& bVect_, const Type& value_) { _pImpl->setSelected(bVect_,(void *)&value_); return *this; } template INLINELINKAGE MSGenericVector& MSGenericVector::selectiveAssign(const MSBinaryVector& bVect_, const MSGenericVector& vect_) { _pImpl->setSelected(bVect_,*vect_._pImpl); return *this; } template INLINELINKAGE MSIndexVector MSGenericVector::gradeUp() const { return _pImpl->gradeUp(); } template INLINELINKAGE MSIndexVector MSGenericVector::gradeDown() const { return _pImpl->gradeDown(); } template INLINELINKAGE void MSGenericVector::permute (const MSIndexVector & iVect_) { _pImpl->permute (iVect_); } template INLINELINKAGE MSGenericVector & MSGenericVector::sortUp() { permute (gradeUp()); return *this; } template INLINELINKAGE MSGenericVector & MSGenericVector::sortDown() { permute (gradeDown()); return *this; } template INLINELINKAGE Type & MSGenericVector::firstElement() { return elementAt (0); } template INLINELINKAGE Type & MSGenericVector::lastElement() { return elementAt (_pImpl->length() -1); } template INLINELINKAGE const Type & MSGenericVector::firstElement() const { return elementAt (0); } template INLINELINKAGE const Type & MSGenericVector::lastElement() const { return elementAt (_pImpl->length() -1); } template INLINELINKAGE const Type & MSGenericVector::operator[] (unsigned int index_) const { return elementAt (index_); } template INLINELINKAGE const Type & MSGenericVector::operator() (unsigned int index_) const { return elementAt (index_); } template INLINELINKAGE const Type & MSGenericVector::elementAt (unsigned int index_) const { #if !defined(MS_NO_INDEX_ERROR) if (index_ >= _pImpl->length()) { _pImpl->vectorIndexError (index_); return *(const Type *)ops().badData(); } else #endif //MSPRODUCTION_BUILD return ((MSGenericData *)_pImpl->data())->elements()[index_]; } template INLINELINKAGE Type & MSGenericVector::operator[] (unsigned int index_) { return elementAt (index_); } template INLINELINKAGE MSGenericVector MSGenericVector::operator[](const MSIndexVector& iVect_) const { return select(*this, iVect_); } template INLINELINKAGE MSGenericVector MSGenericVector::operator[](const MSBinaryVector& bVect_) const { return compress(*this, bVect_); } template INLINELINKAGE long MSGenericVector::compare (const MSGenericVector & vect_) const { return _pImpl->compare (*vect_._pImpl); } template INLINELINKAGE MSBinaryVector MSGenericVector::binaryCompare (const MSGenericVector & vect_, MSComparison comp_) const { return _pImpl->binaryCompare (*vect_._pImpl, comp_); } template INLINELINKAGE MSBinaryVector MSGenericVector::binaryCompare (const Type & value_, MSComparison comp_) const { return _pImpl->binaryCompare ((void *)&value_, comp_); } template INLINELINKAGE MSBoolean operator< (const MSGenericVector & vect1_, const MSGenericVector & vect2_) { return MSBoolean (vect1_.compare(vect2_) < 0); } template INLINELINKAGE MSBoolean operator> (const MSGenericVector & vect1_, const MSGenericVector & vect2_) { return MSBoolean (vect1_.compare(vect2_) > 0); } template INLINELINKAGE MSBoolean operator<= (const MSGenericVector & vect1_, const MSGenericVector & vect2_) { return MSBoolean (vect1_.compare(vect2_) <= 0); } template INLINELINKAGE MSBoolean operator>= (const MSGenericVector & vect1_, const MSGenericVector & vect2_) { return MSBoolean (vect1_.compare(vect2_) >= 0); } template INLINELINKAGE MSBoolean operator< (const MSGenericVector & vect_, const Type & value_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSLessThan); } template INLINELINKAGE MSBoolean operator< (const Type & value_, const MSGenericVector & vect_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSGreaterThan); } template INLINELINKAGE MSBoolean operator> (const MSGenericVector & vect_, const Type & value_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSGreaterThan); } template INLINELINKAGE MSBoolean operator> (const Type & value_, const MSGenericVector & vect_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSLessThan); } template INLINELINKAGE MSBoolean operator<= (const MSGenericVector & vect_, const Type & value_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSLessThanOrEqualTo); } template INLINELINKAGE MSBoolean operator<= (const Type & value_, const MSGenericVector & vect_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSGreaterThanOrEqualTo); } template INLINELINKAGE MSBoolean operator>= (const MSGenericVector & vect_, const Type & value_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSGreaterThanOrEqualTo); } template INLINELINKAGE MSBoolean operator>= (const Type & value_, const MSGenericVector & vect_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSLessThanOrEqualTo); } template INLINELINKAGE MSBoolean operator== (const MSGenericVector & vect_, const Type & value_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSEqualTo); } template INLINELINKAGE MSBoolean operator== (const Type & value_, const MSGenericVector & vect_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSEqualTo); } template INLINELINKAGE MSBoolean operator!= (const MSGenericVector & vect_, const Type & value_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSNotEqualTo); } template INLINELINKAGE MSBoolean operator!= (const Type & value_, const MSGenericVector & vect_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSNotEqualTo); } template INLINELINKAGE MSBoolean operator== (const MSGenericVector & vect1_, const MSGenericVector & vect2_) { return MSBoolean (vect1_.compare(vect2_) == 0); } template INLINELINKAGE MSBoolean operator!= (const MSGenericVector & vect1_, const MSGenericVector & vect2_) { return MSBoolean (vect1_.compare(vect2_) != 0); } template INLINELINKAGE MSGenericVector & operator<< (MSGenericVector & vect1_, const MSGenericVector & vect2_) { return vect1_.append(vect2_); } template INLINELINKAGE MSGenericVector & operator<< (MSGenericVector & vect_, const Type& value_) { return vect_.append(value_); } template INLINELINKAGE unsigned MSGenericVectorOps::indexCompareUp (Type *p_, unsigned i_, unsigned j_) { long val = ::compareElements (p_[i_], p_[j_]); return (val != 0) ? val<0 : i_ INLINELINKAGE unsigned MSGenericVectorOps::indexCompareDown (Type *p_, unsigned i_, unsigned j_) { long val = ::compareElements (p_[i_], p_[j_]); return (val != 0) ? val>0 : i_ INLINELINKAGE MSGenericData * MSGenericData::incrementCount() { #ifdef MS_MULTI_THREAD _mutex.acquire(); #endif _refCount++; #ifdef MS_MULTI_THREAD _mutex.release(); #endif return this; } template INLINELINKAGE void MSGenericData::decrementCount (MSAllocationFlag flag_, unsigned int numToDestroy_) { #ifdef MS_MULTI_THREAD _mutex.acquire(); if(--_refCount==0) { _mutex.release(); deallocate(flag_, numToDestroy_); } else { _mutex.release(); } #else if (--_refCount == 0) { deallocate (flag_, numToDestroy_); } #endif } template INLINELINKAGE const Type *MSGenericData::elements() const { // use dataOffset() method to find the proper offset of the data elements // return (const Type *)(((char *)this) + dataOffset()); } // same as elements(); used for backward compatibility only template INLINELINKAGE const Type *MSGenericData::data() const { return elements(); } template INLINELINKAGE Type * MSGenericData::elements() { // use dataOffset() method to find the proper offset of the data elements // return (Type *)(((char *)this) + dataOffset()); } // same as elements(); used for backward compatibility only template INLINELINKAGE Type * MSGenericData::data() { return elements(); } template INLINELINKAGE const Type & MSGenericData::elementAt (unsigned index_) const { return elements()[index_]; } template INLINELINKAGE Type & MSGenericData::elementAt (unsigned index_) { return elements()[index_]; } template INLINELINKAGE unsigned int MSGenericData::dataOffset(void) { // we have to use MSDataAlignment structure to find out the proper offset // of the data elements, taking possible alignment into consideration // return offsetof(MSDataAlignment,_pElements); } template INLINELINKAGE MSBoolean isGenericConstructionNeeded(Type *) { return MSTrue; } INLINELINKAGE MSBoolean isGenericConstructionNeeded(void *) { return MSFalse; } INLINELINKAGE MSBoolean isGenericConstructionNeeded(char *) { return MSFalse; } INLINELINKAGE MSBoolean isGenericConstructionNeeded(unsigned char *) { return MSFalse; } INLINELINKAGE MSBoolean isGenericConstructionNeeded(short *) { return MSFalse; } INLINELINKAGE MSBoolean isGenericConstructionNeeded(unsigned short *) { return MSFalse; } INLINELINKAGE MSBoolean isGenericConstructionNeeded(int *) { return MSFalse; } INLINELINKAGE MSBoolean isGenericConstructionNeeded(unsigned int *) { return MSFalse; } INLINELINKAGE MSBoolean isGenericConstructionNeeded(long *) { return MSFalse; } INLINELINKAGE MSBoolean isGenericConstructionNeeded(unsigned long *) { return MSFalse; } INLINELINKAGE MSBoolean isGenericConstructionNeeded(float *) { return MSFalse; } INLINELINKAGE MSBoolean isGenericConstructionNeeded(double *) { return MSFalse; } INLINELINKAGE MSBoolean isGenericConstructionNeeded(void **) { return MSFalse; } INLINELINKAGE MSBoolean isGenericConstructionNeeded(char **) { return MSFalse; } INLINELINKAGE MSBoolean isGenericConstructionNeeded(unsigned char **) { return MSFalse; } INLINELINKAGE MSBoolean isGenericConstructionNeeded(short **) { return MSFalse; } INLINELINKAGE MSBoolean isGenericConstructionNeeded(unsigned short **) { return MSFalse; } INLINELINKAGE MSBoolean isGenericConstructionNeeded(int **) { return MSFalse; } INLINELINKAGE MSBoolean isGenericConstructionNeeded(unsigned int **) { return MSFalse; } INLINELINKAGE MSBoolean isGenericConstructionNeeded(long **) { return MSFalse; } INLINELINKAGE MSBoolean isGenericConstructionNeeded(unsigned long **) { return MSFalse; } INLINELINKAGE MSBoolean isGenericConstructionNeeded(float **) { return MSFalse; } INLINELINKAGE MSBoolean isGenericConstructionNeeded(double **) { return MSFalse; } INLINELINKAGE MSBoolean isGenericConstructionNeeded(void ***) { return MSFalse; } INLINELINKAGE MSBoolean isGenericConstructionNeeded(char ***) { return MSFalse; } INLINELINKAGE MSBoolean isGenericConstructionNeeded(unsigned char ***) { return MSFalse; } INLINELINKAGE MSBoolean isGenericConstructionNeeded(short ***) { return MSFalse; } INLINELINKAGE MSBoolean isGenericConstructionNeeded(unsigned short ***) { return MSFalse; } INLINELINKAGE MSBoolean isGenericConstructionNeeded(int ***) { return MSFalse; } INLINELINKAGE MSBoolean isGenericConstructionNeeded(unsigned int ***) { return MSFalse; } INLINELINKAGE MSBoolean isGenericConstructionNeeded(long ***) { return MSFalse; } INLINELINKAGE MSBoolean isGenericConstructionNeeded(unsigned long ***) { return MSFalse; } INLINELINKAGE MSBoolean isGenericConstructionNeeded(float ***) { return MSFalse; } INLINELINKAGE MSBoolean isGenericConstructionNeeded(double ***) { return MSFalse; } template INLINELINKAGE MSBoolean isGenericDestructionNeeded(Type *) { return MSTrue; } INLINELINKAGE MSBoolean isGenericDestructionNeeded(void *) { return MSFalse; } INLINELINKAGE MSBoolean isGenericDestructionNeeded(char *) { return MSFalse; } INLINELINKAGE MSBoolean isGenericDestructionNeeded(unsigned char *) { return MSFalse; } INLINELINKAGE MSBoolean isGenericDestructionNeeded(short *) { return MSFalse; } INLINELINKAGE MSBoolean isGenericDestructionNeeded(unsigned short *) { return MSFalse; } INLINELINKAGE MSBoolean isGenericDestructionNeeded(int *) { return MSFalse; } INLINELINKAGE MSBoolean isGenericDestructionNeeded(unsigned int *) { return MSFalse; } INLINELINKAGE MSBoolean isGenericDestructionNeeded(long *) { return MSFalse; } INLINELINKAGE MSBoolean isGenericDestructionNeeded(unsigned long *) { return MSFalse; } INLINELINKAGE MSBoolean isGenericDestructionNeeded(float *) { return MSFalse; } INLINELINKAGE MSBoolean isGenericDestructionNeeded(double *) { return MSFalse; } INLINELINKAGE MSBoolean isGenericDestructionNeeded(void **) { return MSFalse; } INLINELINKAGE MSBoolean isGenericDestructionNeeded(char **) { return MSFalse; } INLINELINKAGE MSBoolean isGenericDestructionNeeded(unsigned char **) { return MSFalse; } INLINELINKAGE MSBoolean isGenericDestructionNeeded(short **) { return MSFalse; } INLINELINKAGE MSBoolean isGenericDestructionNeeded(unsigned short **) { return MSFalse; } INLINELINKAGE MSBoolean isGenericDestructionNeeded(int **) { return MSFalse; } INLINELINKAGE MSBoolean isGenericDestructionNeeded(unsigned int **) { return MSFalse; } INLINELINKAGE MSBoolean isGenericDestructionNeeded(long **) { return MSFalse; } INLINELINKAGE MSBoolean isGenericDestructionNeeded(unsigned long **) { return MSFalse; } INLINELINKAGE MSBoolean isGenericDestructionNeeded(float **) { return MSFalse; } INLINELINKAGE MSBoolean isGenericDestructionNeeded(double **) { return MSFalse; } INLINELINKAGE MSBoolean isGenericDestructionNeeded(void ***) { return MSFalse; } INLINELINKAGE MSBoolean isGenericDestructionNeeded(char ***) { return MSFalse; } INLINELINKAGE MSBoolean isGenericDestructionNeeded(unsigned char ***) { return MSFalse; } INLINELINKAGE MSBoolean isGenericDestructionNeeded(short ***) { return MSFalse; } INLINELINKAGE MSBoolean isGenericDestructionNeeded(unsigned short ***) { return MSFalse; } INLINELINKAGE MSBoolean isGenericDestructionNeeded(int ***) { return MSFalse; } INLINELINKAGE MSBoolean isGenericDestructionNeeded(unsigned int ***) { return MSFalse; } INLINELINKAGE MSBoolean isGenericDestructionNeeded(long ***) { return MSFalse; } INLINELINKAGE MSBoolean isGenericDestructionNeeded(unsigned long ***) { return MSFalse; } INLINELINKAGE MSBoolean isGenericDestructionNeeded(float ***) { return MSFalse; } INLINELINKAGE MSBoolean isGenericDestructionNeeded(double ***) { return MSFalse; } #endif //MSGenericVectorINLINES aplus-fsf-4.22/src/MSTypes/MSIndexVectorInlines.C0000644000265000001440000002765610772770467015332 #ifndef MSIndexVectorINLINES #define MSIndexVectorINLINES /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #ifndef MS_NO_INLINES #include #endif //MS_NO_INLINES INLINELINKAGE unsigned int MSIndexVector::size() const { return ((Data *)_pImpl->data())->size(); } INLINELINKAGE unsigned int MSIndexVector::indexOf (const unsigned int value_, unsigned int startPos_) const { return _pImpl->indexOf ((void *)&value_, startPos_); } INLINELINKAGE unsigned int MSIndexVector::lastIndexOf (const unsigned int value_, unsigned int startPos_) const { return _pImpl->lastIndexOf ((void *)&value_, startPos_); } INLINELINKAGE unsigned int MSIndexVector::occurrencesOf (const unsigned int value_, unsigned int startPos_) const { return _pImpl->occurrencesOf ((const void *)&value_, startPos_); } INLINELINKAGE MSIndexVector MSIndexVector::indicesOf (const MSIndexVector &v_) const { return _pImpl->indicesOf (*v_._pImpl); } INLINELINKAGE MSBinaryVector MSIndexVector::memberOf (const MSIndexVector &v_) const { return _pImpl->memberOf (*v_._pImpl); } INLINELINKAGE MSBinaryVector MSIndexVector::uniqueElements() const { return _pImpl->unique(); } INLINELINKAGE MSIndexVector & MSIndexVector::replaceAt (unsigned int index_, const unsigned int value_) { set (index_, value_); return *this; } INLINELINKAGE MSIndexVector & MSIndexVector::selectUnique() { return compress (_pImpl->unique()); } INLINELINKAGE MSIndexVector MSIndexVector::selectUnique (const MSIndexVector & vect_) { return compress (vect_, vect_._pImpl->unique()); } INLINELINKAGE MSIndexVector::Data *MSIndexVector::vectorData() const { return (Data *)_pImpl->data(); } INLINELINKAGE MSIndexVector & MSIndexVector::sortUp() { permute (gradeUp()); return *this; } INLINELINKAGE MSIndexVector & MSIndexVector::sortDown() { permute (gradeDown()); return *this; } INLINELINKAGE unsigned int MSIndexVector::firstElement() const { return elementAt (0); } INLINELINKAGE unsigned int MSIndexVector::lastElement() const { return elementAt (_pImpl->length() -1); } INLINELINKAGE unsigned int MSIndexVector::operator[] (unsigned int index_) const { return elementAt (index_); } INLINELINKAGE unsigned int MSIndexVector::operator() (unsigned int index_) const { return elementAt (index_); } INLINELINKAGE const unsigned int & MSIndexVector::elementAt (unsigned int index_) const { #ifndef MSPRODUCTION_BUILD if (index_ >= _pImpl->length()) { _pImpl->vectorIndexError (index_); return *(const unsigned int *)ops().badData(); } #endif //MSPRODUCTION_BUILD return data()[index_]; } INLINELINKAGE MSIndexVector::SPick MSIndexVector::operator[] (unsigned int index_) { return SPick (*this, index_); } INLINELINKAGE MSIndexVector MSIndexVector::operator[] (const MSIndexVector & iVect_) const { return select (*this, iVect_); } INLINELINKAGE MSIndexVector MSIndexVector::operator[] (const MSBinaryVector & bVect_) const { return compress (*this, bVect_); } INLINELINKAGE long MSIndexVector::compare (const MSIndexVector & vect_) const { return _pImpl->compare (*vect_._pImpl); } INLINELINKAGE MSBinaryVector MSIndexVector::binaryCompare (const MSIndexVector & vect_, MSComparison comp_) const { return _pImpl->binaryCompare (*vect_._pImpl, comp_); } INLINELINKAGE MSBinaryVector MSIndexVector::binaryCompare (const unsigned int value_, MSComparison comp_) const { return _pImpl->binaryCompare ((void *)&value_, comp_); } INLINELINKAGE MSBoolean MSIndexVector::operator== (const MSIndexVector & vect_) const { return MSBoolean (compare(vect_) == 0); } INLINELINKAGE MSBoolean MSIndexVector::operator!= (const MSIndexVector & vect_) const { return MSBoolean (compare(vect_) != 0); } INLINELINKAGE MSBoolean operator< (const MSIndexVector & vect1_, const MSIndexVector & vect2_) { return MSBoolean (vect1_.compare(vect2_) < 0); } INLINELINKAGE MSBoolean operator> (const MSIndexVector & vect1_, const MSIndexVector & vect2_) { return MSBoolean (vect1_.compare(vect2_) > 0); } INLINELINKAGE MSBoolean operator<= (const MSIndexVector & vect1_, const MSIndexVector & vect2_) { return MSBoolean (vect1_.compare(vect2_) <= 0); } INLINELINKAGE MSBoolean operator>= (const MSIndexVector & vect1_, const MSIndexVector & vect2_) { return MSBoolean (vect1_.compare(vect2_) >= 0); } INLINELINKAGE MSBoolean operator< (const MSIndexVector & vect_, const unsigned int value_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSLessThan); } INLINELINKAGE MSBoolean operator< (const unsigned int value_, const MSIndexVector & vect_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSGreaterThan); } INLINELINKAGE MSBoolean operator> (const MSIndexVector & vect_, const unsigned int value_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSGreaterThan); } INLINELINKAGE MSBoolean operator> (const unsigned int value_, const MSIndexVector & vect_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSLessThan); } INLINELINKAGE MSBoolean operator<= (const MSIndexVector & vect_, const unsigned int value_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSLessThanOrEqualTo); } INLINELINKAGE MSBoolean operator<= (const unsigned int value_, const MSIndexVector & vect_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSGreaterThanOrEqualTo); } INLINELINKAGE MSBoolean operator>= (const MSIndexVector & vect_, const unsigned int value_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSGreaterThanOrEqualTo); } INLINELINKAGE MSBoolean operator>= (const unsigned int value_, const MSIndexVector & vect_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSLessThanOrEqualTo); } INLINELINKAGE MSBoolean operator== (const MSIndexVector & vect_, const unsigned int value_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSEqualTo); } INLINELINKAGE MSBoolean operator== (const unsigned int value_, const MSIndexVector & vect_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSEqualTo); } INLINELINKAGE MSBoolean operator!= (const MSIndexVector & vect_, const unsigned int value_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSNotEqualTo); } INLINELINKAGE MSBoolean operator!= (const unsigned int value_, const MSIndexVector & vect_) { return vect_._pImpl->scalarCompare ((void *)&value_, MSNotEqualTo); } INLINELINKAGE MSIndexVector & MSIndexVector::operator<<= (const unsigned int value_) { return append (value_); } INLINELINKAGE MSIndexVector & MSIndexVector::operator<<= (const MSIndexVector & vect_) { return append (vect_); } INLINELINKAGE MSIndexVector & MSIndexVector::operator<< (const unsigned int value_) { return append (value_); } INLINELINKAGE MSIndexVector & MSIndexVector::operator<< (const MSIndexVector & vect_) { return append (vect_); } INLINELINKAGE MSIndexVector& MSIndexVector::series(void) { return series(_pImpl->length()); } // Postfix increment operator INLINELINKAGE MSIndexVector MSIndexVector::operator++ (int) { MSBuiltinVectorImpl *pResImpl = (MSBuiltinVectorImpl *)_pImpl->clone(); return operator++(), MSIndexVector(pResImpl); // call the prefix operator and return the old data } // Postfix decrement operator INLINELINKAGE MSIndexVector MSIndexVector::operator-- (int) { MSBuiltinVectorImpl *pResImpl = (MSBuiltinVectorImpl *)_pImpl->clone(); return operator--(), MSIndexVector(pResImpl); // call the prefix operator and return the old data } INLINELINKAGE double MSIndexVector::avg() const { return sum()/_pImpl->length(); } INLINELINKAGE double MSIndexVector::mean() const { return sum()/_pImpl->length(); } INLINELINKAGE double MSIndexVector::median() const { return _pImpl->median(); } INLINELINKAGE double MSIndexVector::variance() const { return _pImpl->variance(mean()); } INLINELINKAGE double MSIndexVector::stdDeviation() const { return ::sqrt (variance()); } INLINELINKAGE MSIndexVector movingAverage (const MSIndexVector & vect_, unsigned int width_) { return MSIndexVector (vect_._pImpl->movingAverage (width_)); } INLINELINKAGE MSIndexVector operator+ (const unsigned int value_, const MSIndexVector & vect_) { return vect_+value_; } INLINELINKAGE MSIndexVector operator* (const unsigned int value_, const MSIndexVector & vect_) { return vect_*value_; } INLINELINKAGE MSIndexVector::Data * MSIndexVector::Data::incrementCount() { _refCount++; return this; } INLINELINKAGE void MSIndexVector::Data::decrementCount() { if (--_refCount == 0) deallocate(); } INLINELINKAGE const unsigned int * MSIndexVector::Data::elements() const { return &_pElements[0]; } // same as elements(); used for backward compatibility only INLINELINKAGE const unsigned int * MSIndexVector::Data::data() const { return &_pElements[0]; } INLINELINKAGE unsigned int * MSIndexVector::Data::elements() { return &_pElements[0]; } // same as elements(); used for backward compatibility only INLINELINKAGE unsigned int * MSIndexVector::Data::data() { return &_pElements[0]; } INLINELINKAGE const unsigned int & MSIndexVector::Data::elementAt (unsigned index_) const { return elements()[index_]; } INLINELINKAGE unsigned int & MSIndexVector::Data::elementAt (unsigned index_) { return elements()[index_]; } INLINELINKAGE MSIndexVector::SPick::SPick (MSIndexVector & aVector_, unsigned int index_) : _pVector(&aVector_), _index(index_) { } INLINELINKAGE MSIndexVector::SPick::SPick (const SPick & aPick_) : _pVector(aPick_._pVector), _index(aPick_._index) { } // prefix increment INLINELINKAGE MSIndexVector::SPick & MSIndexVector::SPick::operator++() { _pVector->set (_index, (*_pVector)(_index) +1); return *this; } // prefix decrement INLINELINKAGE MSIndexVector::SPick & MSIndexVector::SPick::operator--() { _pVector->set (_index, (*_pVector)(_index) -1); return *this; } INLINELINKAGE MSIndexVector::SPick & MSIndexVector::SPick::operator+= (const unsigned int value_) { _pVector->set (_index, (*_pVector)(_index) + value_); return *this; } INLINELINKAGE MSIndexVector::SPick & MSIndexVector::SPick::operator-= (const unsigned int value_) { _pVector->set (_index, (*_pVector)(_index) - value_); return *this; } INLINELINKAGE MSIndexVector::SPick & MSIndexVector::SPick::operator*= (const unsigned int value_) { _pVector->set (_index, (*_pVector)(_index) * value_); return *this; } INLINELINKAGE MSIndexVector::SPick & MSIndexVector::SPick::operator/= (const unsigned int value_) { _pVector->set (_index, (*_pVector)(_index) / value_); return *this; } INLINELINKAGE MSIndexVector::SPick & MSIndexVector::SPick::operator%= (const unsigned int value_) { _pVector->set (_index, (*_pVector)(_index) % value_); return *this; } INLINELINKAGE MSIndexVector::SPick & MSIndexVector::SPick::operator<<= (const unsigned int value_) { _pVector->set (_index, (*_pVector)(_index) << value_); return *this; } INLINELINKAGE MSIndexVector::SPick & MSIndexVector::SPick::operator>>= (const unsigned int value_) { _pVector->set (_index, (*_pVector)(_index) >> value_); return *this; } INLINELINKAGE MSIndexVector::SPick & MSIndexVector::SPick::operator&= (const unsigned int value_) { _pVector->set (_index, (*_pVector)(_index) & value_); return *this; } INLINELINKAGE MSIndexVector::SPick & MSIndexVector::SPick::operator|= (const unsigned int value_) { _pVector->set (_index, (*_pVector)(_index) | value_); return *this; } INLINELINKAGE MSIndexVector::SPick & MSIndexVector::SPick::operator^= (const unsigned int value_) { _pVector->set (_index, (*_pVector)(_index) ^ value_); return *this; } INLINELINKAGE MSIndexVector::SPick::operator unsigned int() const { return (*_pVector)(_index); } #endif // MSIndexVectorINLINES aplus-fsf-4.22/src/MSTypes/MSIntInlines.C0000644000265000001440000000617110772770467013617 #ifndef MSIntINLINES #define MSIntINLINES /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// INLINELINKAGE MSInt::MSInt(void) : _isSet(MSFalse),_int(0) {} INLINELINKAGE MSInt::MSInt(int i_) : _isSet(MSTrue),_int(i_) {} INLINELINKAGE MSInt::MSInt(const MSInt& i_) : _isSet(i_._isSet),_int(i_._int) {} INLINELINKAGE MSInt::operator int() const { return _int; } INLINELINKAGE MSInt::operator double() const { return double(_int); } INLINELINKAGE int MSInt::operator()() const { return _int; } // function call operator INLINELINKAGE MSInt& MSInt::operator=(const MSInt& aInt_) { if (this!=&aInt_) { _int=aInt_._int; _isSet=aInt_._isSet; changed(); } return *this; } INLINELINKAGE MSInt& MSInt::operator=(int aInt_) { _int=aInt_; _isSet=MSTrue; return changed(),*this; } INLINELINKAGE MSInt& MSInt::operator=(const char *value_) { set(value_); return *this; } INLINELINKAGE MSBoolean MSInt::operator==(const MSInt& i_) const { return MSBoolean(_int==i_._int); } INLINELINKAGE MSBoolean MSInt::operator!=(const MSInt& i_) const { return MSBoolean(_int!=i_._int); } INLINELINKAGE MSBoolean MSInt::operator< (const MSInt& i_) const { return MSBoolean(_int< i_._int); } INLINELINKAGE MSBoolean MSInt::operator<=(const MSInt& i_) const { return MSBoolean(_int<=i_._int); } INLINELINKAGE MSBoolean MSInt::operator> (const MSInt& i_) const { return MSBoolean(_int> i_._int); } INLINELINKAGE MSBoolean MSInt::operator>=(const MSInt& i_) const { return MSBoolean(_int>=i_._int); } INLINELINKAGE MSBoolean MSInt::operator==(int i_) const { return MSBoolean(_int==i_); } INLINELINKAGE MSBoolean MSInt::operator!=(int i_) const { return MSBoolean(_int!=i_); } INLINELINKAGE MSBoolean MSInt::operator< (int i_) const { return MSBoolean(_int< i_); } INLINELINKAGE MSBoolean MSInt::operator<=(int i_) const { return MSBoolean(_int<=i_); } INLINELINKAGE MSBoolean MSInt::operator> (int i_) const { return MSBoolean(_int> i_); } INLINELINKAGE MSBoolean MSInt::operator>=(int i_) const { return MSBoolean(_int>=i_); } // Prefix - add/subtract one, then return result INLINELINKAGE MSInt& MSInt::operator++() { return ++_int,changed(),*this; } INLINELINKAGE MSInt& MSInt::operator--() { return --_int,changed(),*this; } // Postfix - add/subtract one, then return the initial value INLINELINKAGE MSInt MSInt::operator++(int) { int i=_int++; return changed(),MSInt(i); } INLINELINKAGE MSInt MSInt::operator--(int) { int i=_int--; return changed(),MSInt(i); } INLINELINKAGE MSInt& MSInt::operator+=(int i_) { _int+=i_; return changed(),*this; } INLINELINKAGE MSInt& MSInt::operator-=(int i_) { _int-=i_; return changed(),*this; } INLINELINKAGE MSInt& MSInt::operator*=(int i_) { _int*=i_; return changed(),*this; } INLINELINKAGE MSInt& MSInt::operator/=(int i_) { _int/=i_; return changed(),*this; } INLINELINKAGE MSInt MSInt::operator-() { return -_int; } INLINELINKAGE MSBoolean MSInt::isSet(void) const { return _isSet; } #endif aplus-fsf-4.22/src/MSTypes/MSIntVectorInlines.C0000644000265000001440000000074710772770467015005 #ifndef MSIntVectorINLINES #define MSIntVectorINLINES /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// /*** INLINELINKAGE MSTypeVector::MSTypeVector (MSBuiltinVectorImpl *pImpl) : BuiltinVectorInt (pImpl) { } ***/ #endif // MSIntVectorINLINES aplus-fsf-4.22/src/MSTypes/MSLongVectorInlines.C0000644000265000001440000000077610772770467015154 #ifndef MSLongVectorInlinesHEADER #define MSLongVectorInlinesHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// /*** INLINELINKAGE MSTypeVector::MSTypeVector (MSBuiltinVectorImpl *pImpl) : BuiltinVectorLong (pImpl) { } ***/ #endif // MSLongVectorInlinesHEADER aplus-fsf-4.22/src/MSTypes/MSMBSDateInlines.C0000644000265000001440000001113010772770467014273 #ifndef MSMBSDateINLINES #define MSMBSDateINLINES /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// INLINELINKAGE MSMBSDate::MSMBSDate(void) : MSDate((MSJulian)0) { if (_defaultConstructToToday==MSTrue) _date=currentDate(); } INLINELINKAGE MSMBSDate::MSMBSDate(const MSString& aString_) { _date=_nullDate,set((const char *)aString_); } INLINELINKAGE MSMBSDate::MSMBSDate(const char *pString_) { _date=_nullDate,set(pString_); } INLINELINKAGE MSMBSDate::MSMBSDate(int m_,int d_,int y_) { _date=as30_360(m_,d_,y_); } INLINELINKAGE MSMBSDate::MSMBSDate(const MSMBSDate& d_) { _date=d_.asInternal(); } INLINELINKAGE MSMBSDate::MSMBSDate(MSJulian j_) { _date=j_; } INLINELINKAGE MSMBSDate MSMBSDate::today(void) { return MSMBSDate(currentDate()); } INLINELINKAGE MSMBSDate::operator double() const { return _date; } INLINELINKAGE MSMBSDate::operator unsigned long() const { return _date; } // Prefix - add/subtract one, then return result INLINELINKAGE MSMBSDate& MSMBSDate::operator++() { return ++_date,changed(),*this; } INLINELINKAGE MSMBSDate& MSMBSDate::operator--() { return --_date,changed(),*this; } // Postfix - add/subtract one, then return the initial value INLINELINKAGE MSMBSDate MSMBSDate::operator++(int) { MSJulian d=_date++; return changed(),MSMBSDate(d); } INLINELINKAGE MSMBSDate MSMBSDate::operator--(int) { MSJulian d=_date--; return changed(),MSMBSDate(d); } INLINELINKAGE MSMBSDate& MSMBSDate::operator=(const MSMBSDate& date_) {_date=date_._date; return changed(),*this; } INLINELINKAGE MSBoolean MSMBSDate::operator <(const MSMBSDate& date_) const { return MSBoolean(_date(const MSMBSDate& date_) const { return MSBoolean(_date>date_._date); } INLINELINKAGE MSBoolean MSMBSDate::operator<=(const MSMBSDate& date_) const { return MSBoolean(_date<=date_._date); } INLINELINKAGE MSBoolean MSMBSDate::operator>=(const MSMBSDate& date_) const { return MSBoolean(_date>=date_._date); } INLINELINKAGE MSBoolean MSMBSDate::operator==(const MSMBSDate& date_) const { return MSBoolean(_date==date_._date); } INLINELINKAGE MSBoolean MSMBSDate::operator!=(const MSMBSDate& date_) const { return MSBoolean(_date!=date_._date); } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // static inlines //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INLINELINKAGE const char* MSMBSDate::dayName(MSDay day_) { return MSDate::dayName(day_); } INLINELINKAGE MSDay MSMBSDate::dayOfWeek(const char *pString_) { return MSDate::dayOfWeek(pString_); } INLINELINKAGE MSBoolean MSMBSDate::dayWithinMonth(MSMonth m_,MSDay d_,MSYear y_) { return MSDate::dayWithinMonth(m_,d_,y_); } INLINELINKAGE MSDay MSMBSDate::daysInMonth(MSMonth,MSYear) { return 30; } INLINELINKAGE MSDay MSMBSDate::daysInYear(MSYear y_) { return 360; } INLINELINKAGE MSMonth MSMBSDate::indexOfMonth(const char* pString_) { return MSDate::indexOfMonth(pString_); } INLINELINKAGE MSJulian MSMBSDate::asJulianNumber(MSMonth m_,MSDay d_,MSYear y_) { return MSDate::asJulianNumber(m_,d_,y_); } INLINELINKAGE MSBoolean MSMBSDate::leapYear(MSYear y_) { return MSDate::leapYear(y_); } INLINELINKAGE const char *MSMBSDate::monthName(MSMonth m_) { return MSDate::monthName(m_); } INLINELINKAGE int MSMBSDate::findMatch(const char* pString_,const char** candidates_,int icand_) { return MSDate::findMatch(pString_,candidates_,icand_); } INLINELINKAGE MSJulian MSMBSDate::nullDate(void) { return MSDate::nullDate(); } INLINELINKAGE MSDate::MSDateFormat MSMBSDate::defaultFormat(void) { return _defaultFormat; } INLINELINKAGE void MSMBSDate::defaultFormat(MSDate::MSDateFormat aFormat_) { _defaultFormat=aFormat_; } INLINELINKAGE const MSString& MSMBSDate::strftimeDefaultFormat(void) { return _strftimeDefaultFormat; } INLINELINKAGE void MSMBSDate::strftimeDefaultFormat(MSString& aString_) { _strftimeDefaultFormat=aString_; } INLINELINKAGE void MSMBSDate::strftimeDefaultFormat(const char *pString_) { _strftimeDefaultFormat=pString_; } INLINELINKAGE void MSMBSDate::defaultConstructToToday(MSBoolean flag_) { _defaultConstructToToday=flag_; } INLINELINKAGE MSBoolean MSMBSDate::defaultConstructToToday(void) { return _defaultConstructToToday; } INLINELINKAGE MSBoolean MSMBSDate::assertWeekDayNumber(MSDay d_) { return MSBoolean(d_>=1&&d_<=7); } INLINELINKAGE MSBoolean MSMBSDate::assertIndexOfMonth(MSMonth m_) { return MSBoolean(m_>=1&&m_<=12); } #endif aplus-fsf-4.22/src/MSTypes/MSMoneyInlines.C0000644000265000001440000001533710772770467014160 #ifndef MSMoneyINLINES #define MSMoneyINLINES /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MS_NO_INLINES #define INLINELINKAGE inline #else #define INLINELINKAGE #endif INLINELINKAGE MSMoney::MSMoney(void): _currency(DefaultCurrency) {} INLINELINKAGE MSMoney::MSMoney(const MSMoney& m_): _currency(m_._currency),MSFloat(m_) {} INLINELINKAGE MSMoney::MSMoney(double d_,Currency c_): _currency(c_),MSFloat(d_) {} INLINELINKAGE MSMoney::MSMoney(int i_,Currency c_): _currency(c_),MSFloat(i_) {} INLINELINKAGE MSMoney::MSMoney(const MSFloat& f_,Currency c_): _currency(c_),MSFloat(f_) {} INLINELINKAGE MSMoney::MSMoney(const MSInt& i_,Currency c_): _currency(c_),MSFloat(i_) {} INLINELINKAGE MSMoney MSMoney::convert(MSMoney::Currency,const MSTime&) const { return MSMoney(*this); } INLINELINKAGE MSMoney MSMoney::convert(MSMoney::Currency c_) const { return convert(c_,MSTime()); } INLINELINKAGE MSMoney::Currency MSMoney::currency(void) const { if (_currency!=DefaultCurrency) return _currency; else return _defaultCurrency; } INLINELINKAGE MSMoney::operator double() const { return _real; } INLINELINKAGE double MSMoney::operator/(const MSMoney& m_) const {return _real/m_._real;} // Be sure to preserve the currency INLINELINKAGE MSMoney MSMoney::operator-() { return MSMoney(0.0,*this,Minus); } INLINELINKAGE MSMoney& MSMoney::operator+=(const MSFloat& aFloat_) { MSFloat::operator+=(aFloat_); return *this; } INLINELINKAGE MSMoney& MSMoney::operator+=(const MSInt& aInt_) { MSFloat::operator+=(aInt_); return *this; } INLINELINKAGE MSMoney& MSMoney::operator+=(double aFloat_) { MSFloat::operator+=(aFloat_); return *this; } INLINELINKAGE MSMoney& MSMoney::operator+=(int aInt_) { MSFloat::operator+=(aInt_); return *this; } INLINELINKAGE MSMoney& MSMoney::operator-=(const MSFloat& aFloat_) { MSFloat::operator-=(aFloat_); return *this; } INLINELINKAGE MSMoney& MSMoney::operator-=(const MSInt& aInt_) { MSFloat::operator-=(aInt_); return *this; } INLINELINKAGE MSMoney& MSMoney::operator-=(double aFloat_) { MSFloat::operator-=(aFloat_); return *this; } INLINELINKAGE MSMoney& MSMoney::operator-=(int aInt_) { MSFloat::operator-=(aInt_); return *this; } INLINELINKAGE MSMoney& MSMoney::operator*=(const MSFloat& aFloat_) { MSFloat::operator*=(aFloat_); return *this; } INLINELINKAGE MSMoney& MSMoney::operator*=(const MSInt& aInt_) { MSFloat::operator*=(aInt_); return *this; } INLINELINKAGE MSMoney& MSMoney::operator*=(double aFloat_) { MSFloat::operator*=(aFloat_); return *this; } INLINELINKAGE MSMoney& MSMoney::operator*=(int aInt_) { MSFloat::operator*=(aInt_); return *this; } INLINELINKAGE MSMoney& MSMoney::operator/=(const MSFloat& aFloat_) { MSFloat::operator/=(aFloat_); return *this; } INLINELINKAGE MSMoney& MSMoney::operator/=(const MSInt& aInt_) { MSFloat::operator/=(aInt_); return *this; } INLINELINKAGE MSMoney& MSMoney::operator/=(double aFloat_) { MSFloat::operator/=(aFloat_); return *this; } INLINELINKAGE MSMoney& MSMoney::operator/=(int aInt_) { MSFloat::operator/=(aInt_); return *this; } // friend operators INLINELINKAGE MSMoney operator+(const MSMoney& a_,const MSFloat& b_) {return MSMoney(a_,b_,MSMoney::Plus);} INLINELINKAGE MSMoney operator-(const MSMoney& a_,const MSFloat& b_) {return MSMoney(a_,b_,MSMoney::Minus);} INLINELINKAGE MSMoney operator*(const MSMoney& a_,const MSFloat& b_) {return MSMoney(a_,b_,MSMoney::Multiply);} INLINELINKAGE MSMoney operator/(const MSMoney& a_,const MSFloat& b_) {return MSMoney(a_,b_,MSMoney::Divide);} INLINELINKAGE MSMoney operator+(const MSMoney& a_,const MSInt& b_) {return MSMoney(a_,b_,MSMoney::Plus);} INLINELINKAGE MSMoney operator-(const MSMoney& a_,const MSInt& b_) {return MSMoney(a_,b_,MSMoney::Minus);} INLINELINKAGE MSMoney operator*(const MSMoney& a_,const MSInt& b_) {return MSMoney(a_,b_,MSMoney::Multiply);} INLINELINKAGE MSMoney operator/(const MSMoney& a_,const MSInt& b_) {return MSMoney(a_,b_,MSMoney::Divide);} INLINELINKAGE MSMoney operator+(const MSMoney& a_,double b_) {return MSMoney(a_,b_,MSMoney::Plus);} INLINELINKAGE MSMoney operator-(const MSMoney& a_,double b_) {return MSMoney(a_,b_,MSMoney::Minus);} INLINELINKAGE MSMoney operator*(const MSMoney& a_,double b_) {return MSMoney(a_,b_,MSMoney::Multiply);} INLINELINKAGE MSMoney operator/(const MSMoney& a_,double b_) {return MSMoney(a_,b_,MSMoney::Divide);} INLINELINKAGE MSMoney operator+(const MSMoney& a_,int b_) {return MSMoney(a_,b_,MSMoney::Plus);} INLINELINKAGE MSMoney operator-(const MSMoney& a_,int b_) {return MSMoney(a_,b_,MSMoney::Minus);} INLINELINKAGE MSMoney operator*(const MSMoney& a_,int b_) {return MSMoney(a_,b_,MSMoney::Multiply);} INLINELINKAGE MSMoney operator/(const MSMoney& a_,int b_) {return MSMoney(a_,b_,MSMoney::Divide);} INLINELINKAGE MSMoney operator+(const MSFloat& a_,const MSMoney& b_) {return MSMoney(a_,b_,MSMoney::Plus);} INLINELINKAGE MSMoney operator-(const MSFloat& a_,const MSMoney& b_) {return MSMoney(a_,b_,MSMoney::Minus);} INLINELINKAGE MSMoney operator*(const MSFloat& a_,const MSMoney& b_) {return MSMoney(a_,b_,MSMoney::Multiply);} INLINELINKAGE double operator/(const MSFloat& a_,const MSMoney& b_) {return double(double(a_)/double(b_));} INLINELINKAGE MSMoney operator+(const MSInt& a_,const MSMoney& b_) {return MSMoney(a_,b_,MSMoney::Plus);} INLINELINKAGE MSMoney operator-(const MSInt& a_,const MSMoney& b_) {return MSMoney(a_,b_,MSMoney::Minus);} INLINELINKAGE MSMoney operator*(const MSInt& a_,const MSMoney& b_) {return MSMoney(a_,b_,MSMoney::Multiply);} INLINELINKAGE double operator/(const MSInt& a_,const MSMoney& b_) {return double(double(a_)/double(b_));} INLINELINKAGE MSMoney operator+(double a_,const MSMoney& b_) {return MSMoney(a_,b_,MSMoney::Plus);} INLINELINKAGE MSMoney operator-(double a_,const MSMoney& b_) {return MSMoney(a_,b_,MSMoney::Minus);} INLINELINKAGE MSMoney operator*(double a_,const MSMoney& b_) {return MSMoney(a_,b_,MSMoney::Multiply);} INLINELINKAGE double operator/(double a_,const MSMoney& b_) {return double(double(a_)/double(b_));} INLINELINKAGE MSMoney operator+(int a_,const MSMoney& b_) {return MSMoney(a_,b_,MSMoney::Plus);} INLINELINKAGE MSMoney operator-(int a_,const MSMoney& b_) {return MSMoney(a_,b_,MSMoney::Minus);} INLINELINKAGE MSMoney operator*(int a_,const MSMoney& b_) {return MSMoney(a_,b_,MSMoney::Multiply);} INLINELINKAGE double operator/(int a_,const MSMoney& b_) {return double(double(a_)/double(b_));} #endif //MSMoneyINLINES aplus-fsf-4.22/src/MSTypes/MSNumberInlines.C0000644000265000001440000000331710772770467014314 #ifndef MSNumberINLINES #define MSNumberINLINES /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// //-------------------------------------------------------------------------------- // MSNumber::Buffer INLINELINKAGE methods //-------------------------------------------------------------------------------- INLINELINKAGE int MSNumber::Buffer::decimalPlace(void) const { return _exponent; } INLINELINKAGE MSBoolean MSNumber::Buffer::isValid(void) const { return MSBoolean(this != _pInvalidBuffer); } INLINELINKAGE MSBoolean MSNumber::Buffer::isSet(void) const { return MSBoolean(this != _pNullBuffer); } //-------------------------------------------------------------------------------- // MSNumber INLINELINKAGE methods //-------------------------------------------------------------------------------- INLINELINKAGE MSNumber::Buffer *MSNumber::buffer() const { return _pBuffer; } INLINELINKAGE MSBoolean MSNumber::isValid(void) const { return buffer()->isValid(); } INLINELINKAGE MSBoolean MSNumber::isSet(void) const { return buffer()->isSet(); } INLINELINKAGE int MSNumber::decimalPlace(void) const { return buffer()->decimalPlace(); } //-------------------------------------------------------------------------------- // MSNumber unary operators. //-------------------------------------------------------------------------------- INLINELINKAGE MSNumber MSNumber::operator+() { return MSNumber(*this); } INLINELINKAGE MSNumber MSNumber::operator-() { return MSNumber(0)-MSNumber(*this); } #endif aplus-fsf-4.22/src/MSTypes/MSObjectTypeVectorInlines.C0000644000265000001440000000564610774212422016306 #ifndef MSObjectTypeVectorINLINES #define MSObjectTypeVectorINLINES /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MS_NO_INLINES #include #endif // MS_NO_INLINES template INLINELINKAGE Type & MSObjectVector::firstElement() { return elementAt (0); } template INLINELINKAGE Type & MSObjectVector::lastElement() { return elementAt (this->_pImpl->length() -1); } template INLINELINKAGE const Type & MSObjectVector::firstElement() const { return elementAt (0); } template INLINELINKAGE const Type & MSObjectVector::lastElement() const { return elementAt (this->_pImpl->length() -1); } template INLINELINKAGE const Type & MSObjectVector::operator() (unsigned int index_) const { return elementAt (index_); } template INLINELINKAGE const Type & MSObjectVector::operator[] (unsigned int index_) const { return elementAt (index_); } template INLINELINKAGE const Type & MSObjectVector::elementAt (unsigned int index_) const { #if !defined(MS_NO_INDEX_ERROR) if (index_ >= this->_pImpl->length()) { this->_pImpl->vectorIndexError (index_); return *(const Type *)this->ops().badData(); } #endif //MSPRODUCTION_BUILD return this->data()[index_]; } template INLINELINKAGE Type & MSObjectVector::operator[] (unsigned int index_) { return elementAt (index_); } template INLINELINKAGE MSObjectVector MSObjectVector::operator[] (const MSIndexVector & iVect_) const { return this->select (*this, iVect_); } template INLINELINKAGE MSObjectVector MSObjectVector::operator[] (const MSBinaryVector & bVect_) const { return compress (*this, bVect_); } template INLINELINKAGE MSVectorElement::MSVectorElement() : Type() { } template INLINELINKAGE MSVectorElement::MSVectorElement (const MSVectorElement & value_) : Type(value_) { } template INLINELINKAGE MSVectorElement::MSVectorElement (const Type & value_) : Type(value_) { } template INLINELINKAGE void MSVectorElement::vector (MSObjectVector *pVect_) { this->_pReceiverList = (MSEventSender::List *)pVect_; } template INLINELINKAGE MSVectorModelAllocator::MSVectorModelAllocator(void) {} template INLINELINKAGE MSVectorModelAllocator::~MSVectorModelAllocator(void) {} template INLINELINKAGE void MSVectorModelAllocator::construct(Type *p_, const Type& value_) { new (p_) MSVectorElement(value_); } #endif // MSObjectTypeVectorINLINES aplus-fsf-4.22/src/MSTypes/MSRateInlines.C0000644000265000001440000000064710772770467013762 #ifndef MSRateINLINES #define MSRateINLINES /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MS_NO_INLINES #define INLINELINKAGE inline #else #define INLINELINKAGE #endif #endif aplus-fsf-4.22/src/MSTypes/MSStringBufferInlines.C0000644000265000001440000000414410772770470015455 #ifndef MSStringBufferINLINES #define MSStringBufferINLINES /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// extern "C" { #include } #ifndef MS_NO_INLINES #define INLINELINKAGE inline #else #define INLINELINKAGE #endif /*---------------------------- Overflow Checking -----------------------------*/ INLINELINKAGE unsigned MSStringBuffer::checkAddition(unsigned addend1,unsigned addend2) { return(addend1 #include } #ifdef __cfront #undef isspace #endif #ifndef MSStringBufferHEADER #include #endif #ifndef MSStringTestHEADER #include #endif #ifndef MS_NO_INLINES #define INLINELINKAGE inline #else #define INLINELINKAGE #endif /*---------------------------- INLINELINKAGE Methods --------------------------------*/ INLINELINKAGE MSStringBuffer *MSString::buffer(void) const { #ifdef IC_DEVELOP IASSERT(_pBuffer!=0); #endif return _pBuffer; } INLINELINKAGE MSStringBuffer *MSString::defaultBuffer(void) { return MSStringBuffer::defaultBuffer(); } INLINELINKAGE char *MSString::data(void) const { return _pBuffer->data; } INLINELINKAGE const char *MSString::string(void) const { return _pBuffer->data; } INLINELINKAGE unsigned MSString::lengthOf(const char *pString_) { return (pString_!=0)?strlen(pString_):0; } INLINELINKAGE MSString &MSString::setBuffer(MSStringBuffer *pBuffer_) { #ifdef IC_DEVELOP IASSERT(pBuffer_!=0); #endif _pBuffer=pBuffer_; return changed(),*this; } /*-------------------------------- Accessors ---------------------------------*/ INLINELINKAGE unsigned MSString::length(void) const { return _pBuffer->len; } INLINELINKAGE unsigned MSString::size(void) const { return _pBuffer->len; } INLINELINKAGE MSStringEnum::CharType MSString::charType(unsigned index) const { return _pBuffer->charType(index); } INLINELINKAGE MSBoolean MSString::isSet(void) const { return MSBoolean(length()>0); } INLINELINKAGE char MSString::first(void) const { return (length()>0)?((*this)(0)):0; } INLINELINKAGE char MSString::last(void) const { return (length()>0)?((*this)(length()-1)):0; } INLINELINKAGE const MSSymbol& MSString::stringType(void) { return symbol(); } /*-------------------------------- Assignment ---------------------------------*/ INLINELINKAGE MSString& MSString::operator=(const MSString &aString) { aString._pBuffer->addRef(); _pBuffer->removeRef(); setBuffer(aString._pBuffer); return *this; } /*-------------------------------- Searching ---------------------------------*/ INLINELINKAGE unsigned MSString::indexOf(const MSString &aString,unsigned startPos) const { return _pBuffer->indexOf(aString.data(),aString.length(),startPos); } INLINELINKAGE unsigned MSString::indexOf(const char *pString,unsigned startPos) const { return _pBuffer->indexOf(pString,lengthOf(pString),startPos); } INLINELINKAGE unsigned MSString::indexOf(const MSStringTest &aTest,unsigned startPos) const { return _pBuffer->indexOf(aTest,startPos); } INLINELINKAGE unsigned MSString::indexOfAnyBut(const MSString &aString,unsigned startPos) const { return _pBuffer->indexOfAnyBut(aString.data(),aString.length(),startPos); } INLINELINKAGE unsigned MSString::indexOfAnyBut(const char *pValidChars,unsigned startPos) const { return _pBuffer->indexOfAnyBut(pValidChars,lengthOf(pValidChars),startPos); } INLINELINKAGE unsigned MSString::indexOfAnyBut(char validChar,unsigned startPos) const { return _pBuffer->indexOfAnyBut(&validChar,1,startPos); } INLINELINKAGE unsigned MSString::indexOfAnyBut(const MSStringTest &aTest,unsigned startPos) const { return _pBuffer->indexOfAnyBut(aTest,startPos); } INLINELINKAGE unsigned MSString::indexOfAnyOf(const MSString &aString,unsigned startPos) const { return _pBuffer->indexOfAnyOf(aString.data(),aString.length(),startPos); } INLINELINKAGE unsigned MSString::indexOfAnyOf(const char *pSearchChars,unsigned startPos) const { return _pBuffer->indexOfAnyOf(pSearchChars,lengthOf(pSearchChars),startPos); } INLINELINKAGE unsigned MSString::indexOfAnyOf(char searchChar,unsigned startPos) const { return _pBuffer->indexOfAnyOf(&searchChar,1,startPos); } INLINELINKAGE unsigned MSString::indexOfAnyOf(const MSStringTest &aTest,unsigned startPos) const { return _pBuffer->indexOfAnyOf(aTest,startPos); } INLINELINKAGE unsigned MSString::lastIndexOf(const MSString &aString,unsigned startPos) const { return _pBuffer->lastIndexOf(aString.data(),aString.length(),startPos); } INLINELINKAGE unsigned MSString::lastIndexOf(const char *pString,unsigned startPos) const { return _pBuffer->lastIndexOf(pString,lengthOf(pString),startPos); } INLINELINKAGE unsigned MSString::lastIndexOf(const MSStringTest &aTest,unsigned startPos) const { return _pBuffer->lastIndexOf(aTest,startPos); } INLINELINKAGE unsigned MSString::lastIndexOfAnyBut(const MSString &aString,unsigned startPos) const { return _pBuffer->lastIndexOfAnyBut(aString.data(),aString.length(),startPos); } INLINELINKAGE unsigned MSString::lastIndexOfAnyBut(const char *pValidChars,unsigned startPos) const { return _pBuffer->lastIndexOfAnyBut(pValidChars,lengthOf(pValidChars),startPos); } INLINELINKAGE unsigned MSString::lastIndexOfAnyBut(char validChar,unsigned startPos) const { return _pBuffer->lastIndexOfAnyBut(&validChar,1,startPos); } INLINELINKAGE unsigned MSString::lastIndexOfAnyBut(const MSStringTest &aTest,unsigned startPos) const { return _pBuffer->lastIndexOfAnyBut(aTest,startPos); } INLINELINKAGE unsigned MSString::lastIndexOfAnyOf(const MSString &aString,unsigned startPos) const { return _pBuffer->lastIndexOfAnyOf(aString.data(),aString.length(),startPos); } INLINELINKAGE unsigned MSString::lastIndexOfAnyOf(const char *pSearchChars,unsigned startPos) const { return _pBuffer->lastIndexOfAnyOf(pSearchChars,lengthOf(pSearchChars),startPos); } INLINELINKAGE unsigned MSString::lastIndexOfAnyOf(char searchChar,unsigned startPos) const { return _pBuffer->lastIndexOfAnyOf(&searchChar,1,startPos); } INLINELINKAGE unsigned MSString::lastIndexOfAnyOf(const MSStringTest &aTest,unsigned startPos) const { return _pBuffer->lastIndexOfAnyOf(aTest,startPos); } INLINELINKAGE unsigned MSString::occurrencesOf(const MSString &aString,unsigned startPos) const { return occurrencesOf(aString.data(),aString.length(),startPos); } INLINELINKAGE unsigned MSString::occurrencesOf(const char *pString,unsigned startPos) const { return occurrencesOf(pString,lengthOf(pString),startPos); } /*--------------------------------- Testing ----------------------------------*/ INLINELINKAGE MSBoolean MSString::isAlphanumeric() const { return _pBuffer->isAlphanumeric(); } INLINELINKAGE MSBoolean MSString::isAlphabetic() const { return _pBuffer->isAlphabetic(); } INLINELINKAGE MSBoolean MSString::isASCII() const { return _pBuffer->isASCII(); } INLINELINKAGE MSBoolean MSString::isControl() const { return _pBuffer->isControl(); } INLINELINKAGE MSBoolean MSString::isDigits() const { return _pBuffer->isDigits(); } INLINELINKAGE MSBoolean MSString::isGraphics() const { return _pBuffer->isGraphics(); } INLINELINKAGE MSBoolean MSString::isHexDigits() const { return _pBuffer->isHexDigits(); } INLINELINKAGE MSBoolean MSString::isLowerCase() const { return _pBuffer->isLowerCase(); } INLINELINKAGE MSBoolean MSString::isPrintable() const { return _pBuffer->isPrintable(); } INLINELINKAGE MSBoolean MSString::isPunctuation() const { return _pBuffer->isPunctuation(); } INLINELINKAGE MSBoolean MSString::isUpperCase() const { return _pBuffer->isUpperCase(); } INLINELINKAGE MSBoolean MSString::isWhiteSpace() const { return _pBuffer->isWhiteSpace(); } INLINELINKAGE MSBoolean MSString::isMBCS() const { return _pBuffer->isMBCS(); } INLINELINKAGE MSBoolean MSString::isDBCS() const { return _pBuffer->isDBCS(); } INLINELINKAGE MSBoolean MSString::isSBCS() const { return _pBuffer->isSBCS(); } INLINELINKAGE MSBoolean MSString::isValidMBCS() const { return _pBuffer->isValidMBCS(); } INLINELINKAGE MSBoolean MSString::isValidDBCS() const { return _pBuffer->isValidDBCS(); } INLINELINKAGE MSBoolean MSString::includesMBCS() const { return _pBuffer->includesMBCS(); } INLINELINKAGE MSBoolean MSString::includesDBCS() const { return _pBuffer->includesDBCS(); } INLINELINKAGE MSBoolean MSString::includesSBCS() const { return _pBuffer->includesSBCS(); } INLINELINKAGE MSBoolean MSString::isLike(const MSString &aPattern,char zeroOrMore,char anyChar) const { return isLike(aPattern.data(),aPattern.length(),zeroOrMore,anyChar); } INLINELINKAGE MSBoolean MSString::isLike(const char *pPattern,char zeroOrMore,char anyChar) const { return isLike(pPattern,lengthOf(pPattern),zeroOrMore,anyChar); } INLINELINKAGE MSBoolean MSString::isAbbreviationFor(const MSString &aString,unsigned minAbbrevLength) const { return isAbbrevFor(aString.data(),aString.length(),minAbbrevLength); } INLINELINKAGE MSBoolean MSString::isAbbreviationFor(const char *pString,unsigned minAbbrevLength) const { return isAbbrevFor(pString,lengthOf(pString),minAbbrevLength); } INLINELINKAGE MSBoolean MSString::includes(const MSString &aString) const { return MSBoolean(indexOf(aString)compare(aString_.data(),aString_.length())) { case MSStringBuffer::equal: return 0; case MSStringBuffer::greaterThan: return 1; case MSStringBuffer::lessThan: return -1; } return 0; } /*-------------------------------- Conversion --------------------------------*/ INLINELINKAGE MSString MSString::asString() const { return MSString(*this); } INLINELINKAGE long int MSString::asInt() const { return strtol(data(),0,10); } INLINELINKAGE unsigned long MSString::asUnsigned() const { return strtoul(data(),0,10); } INLINELINKAGE double MSString::asDouble() const { return strtod(data(),0); } INLINELINKAGE MSString::operator const char*() const { return data(); } INLINELINKAGE MSString::operator const unsigned char*() const { return (unsigned char*)data(); } INLINELINKAGE MSString MSString::c2b(const MSString &aString) { return MSString(aString).c2b(); } INLINELINKAGE MSString MSString::c2d(const MSString &aString) { return MSString(aString).c2d(); } INLINELINKAGE MSString MSString::c2x(const MSString &aString) { return MSString(aString).c2x(); } INLINELINKAGE MSString MSString::b2c(const MSString &aString) { return MSString(aString).b2c(); } INLINELINKAGE MSString& MSString::b2d() { return b2c().c2d(); } INLINELINKAGE MSString MSString::b2d(const MSString &aString) { return MSString(aString).b2d(); } INLINELINKAGE MSString& MSString::b2x() { return b2c().c2x(); } INLINELINKAGE MSString MSString::b2x(const MSString &aString) { return MSString(aString).b2x(); } INLINELINKAGE MSString MSString::d2c(const MSString &aString) { return MSString(aString).d2c(); } INLINELINKAGE MSString& MSString::d2b() { return d2c().c2b(); } INLINELINKAGE MSString MSString::d2b(const MSString &aString) { return MSString(aString).d2b(); } INLINELINKAGE MSString& MSString::d2x() { return d2c().c2x(); } INLINELINKAGE MSString MSString::d2x(const MSString &aString) { return MSString(aString).d2x(); } INLINELINKAGE MSString MSString::x2c(const MSString &aString) { return MSString(aString).x2c(); } INLINELINKAGE MSString& MSString::x2b() { return x2c().c2b(); } INLINELINKAGE MSString MSString::x2b(const MSString &aString) { return MSString(aString).x2b(); } INLINELINKAGE MSString& MSString::x2d() { return x2c().c2d(); } INLINELINKAGE MSString MSString::x2d(const MSString &aString) { return MSString(aString).x2d(); } /*--------------------------------- Editing ----------------------------------*/ INLINELINKAGE MSString& MSString::change(const MSString &aPattern,const MSString &aReplacement, unsigned startPos,unsigned numChanges) { return change(aPattern.data(),aPattern.length(),aReplacement.data(),aReplacement.length(),startPos,numChanges); } INLINELINKAGE MSString& MSString::change(const MSString &aPattern,const char *pReplacement,unsigned startPos,unsigned numChanges) { return change(aPattern.data(),aPattern.length(),pReplacement,lengthOf(pReplacement),startPos,numChanges); } INLINELINKAGE MSString& MSString::change(const char *pPattern,const MSString &aReplacement,unsigned startPos,unsigned numChanges) { return change(pPattern,lengthOf(pPattern),aReplacement.data(),aReplacement.length(),startPos,numChanges); } INLINELINKAGE MSString& MSString::change(const char *pPattern,const char *pReplacement,unsigned startPos,unsigned numChanges) { return change(pPattern,lengthOf(pPattern),pReplacement,lengthOf(pReplacement),startPos,numChanges); } INLINELINKAGE MSString MSString::change(const MSString &aString,const MSString &aPattern,const char *pReplacement, unsigned startPos,unsigned numChanges) { return MSString(aString).change(aPattern,pReplacement,startPos,numChanges); } INLINELINKAGE MSString MSString::change(const MSString &aString,const char *pPattern,const MSString &aReplacement, unsigned startPos,unsigned numChanges) { return MSString(aString).change(pPattern,aReplacement,startPos,numChanges); } INLINELINKAGE MSString MSString::change(const MSString &aString,const char *pPattern,const char *pReplacement, unsigned startPos,unsigned numChanges) { return MSString(aString).change(pPattern,pReplacement,startPos,numChanges); } INLINELINKAGE MSString MSString::copy(const MSString &aString,unsigned numCopies) { return MSString(aString).copy(numCopies); } INLINELINKAGE MSString& MSString::insert(const MSString &aString,unsigned index,char padCharacter) { return insert(aString.data(),aString.length(),index,padCharacter); } INLINELINKAGE MSString& MSString::insert(const char *pString,unsigned index,char padCharacter) { return insert(pString,lengthOf(pString),index,padCharacter); } INLINELINKAGE MSString MSString::insert(const MSString &aString,const MSString &anInsert,unsigned index,char padCharacter) { return MSString(aString).insert(anInsert,index,padCharacter); } INLINELINKAGE MSString MSString::insert(const MSString &aString,const char *pInsert,unsigned index,char padCharacter) { return MSString(aString).insert(pInsert,index,padCharacter); } INLINELINKAGE MSString MSString::leftJustify(const MSString &aString,unsigned newLength,char padCharacter) { return MSString(aString).leftJustify(newLength,padCharacter); } INLINELINKAGE MSString MSString::lowerCase(const MSString &aString) { return MSString(aString).lowerCase(); } INLINELINKAGE MSString& MSString::overlayWith(const MSString &aString,unsigned index,char padCharacter) { return overlayWith(aString.data(),aString.length(),index,padCharacter); } INLINELINKAGE MSString& MSString::overlayWith(const char *pString,unsigned index,char padCharacter) { return overlayWith(pString,lengthOf(pString),index,padCharacter); } INLINELINKAGE MSString MSString::overlayWith(const MSString &aString,const MSString &anOverlay,unsigned index,char padCharacter) { return MSString(aString).overlayWith(anOverlay,index,padCharacter); } INLINELINKAGE MSString MSString::overlayWith(const MSString &aString,const char *pOverlay,unsigned index,char padCharacter) { return MSString(aString).overlayWith(pOverlay,index,padCharacter); } INLINELINKAGE MSString MSString::remove(const MSString &aString,unsigned startPos) { return MSString::remove(aString,startPos,UINT_MAX); } INLINELINKAGE MSString MSString::reverse(const MSString &aString) { return MSString(aString).reverse(); } INLINELINKAGE MSString MSString::rightJustify(const MSString &aString,unsigned newLength,char padCharacter) { return MSString(aString).rightJustify(newLength,padCharacter); } INLINELINKAGE MSString& MSString::stripLeading() { return strip(MSStringTest(APLUS_ISPACE),MSStringEnum::Leading); } INLINELINKAGE MSString& MSString::stripTrailing() { return strip(MSStringTest(APLUS_ISPACE),MSStringEnum::Trailing); } INLINELINKAGE MSString& MSString::strip(char aChar) { return strip(&aChar,1,MSStringEnum::Both); } INLINELINKAGE MSString& MSString::stripLeading(char aChar) { return strip(&aChar,1,MSStringEnum::Leading); } INLINELINKAGE MSString& MSString::stripTrailing(char aChar) { return strip(&aChar,1,MSStringEnum::Trailing); } INLINELINKAGE MSString& MSString::strip(const MSString &aString) { return strip(aString.data(),aString.length(),MSStringEnum::Both); } INLINELINKAGE MSString& MSString::stripLeading(const MSString &aString) { return strip(aString.data(),aString.length(),MSStringEnum::Leading); } INLINELINKAGE MSString& MSString::stripTrailing(const MSString &aString) { return strip(aString.data(),aString.length(),MSStringEnum::Trailing); } INLINELINKAGE MSString& MSString::strip(const char *pString) { return strip(pString,lengthOf(pString),MSStringEnum::Both); } INLINELINKAGE MSString& MSString::stripLeading(const char *pString) { return strip(pString,lengthOf(pString),MSStringEnum::Leading); } INLINELINKAGE MSString& MSString::stripTrailing(const char *pString) { return strip(pString,lengthOf(pString),MSStringEnum::Trailing); } INLINELINKAGE MSString& MSString::strip(const MSStringTest &aTest) { return strip(aTest,MSStringEnum::Both); } INLINELINKAGE MSString& MSString::stripLeading(const MSStringTest &aTest) { return strip(aTest,MSStringEnum::Leading); } INLINELINKAGE MSString& MSString::stripTrailing(const MSStringTest &aTest) { return strip(aTest,MSStringEnum::Trailing); } INLINELINKAGE MSString MSString::stripBlanks(const MSString &aString) { return MSString(aString).strip(); } INLINELINKAGE MSString MSString::strip(const MSString &aString,char aChar) { return MSString(aString).strip(aChar); } INLINELINKAGE MSString MSString::strip(const MSString &aString,const MSString &aStringOfChars) { return MSString(aString).strip(aStringOfChars); } INLINELINKAGE MSString MSString::strip(const MSString &aString,const char *pStringOfChars) { return MSString(aString).strip(pStringOfChars); } INLINELINKAGE MSString MSString::strip(const MSString &aString,const MSStringTest &aTest) { return MSString(aString).strip(aTest); } INLINELINKAGE MSString MSString::stripLeadingBlanks(const MSString &aString) { return MSString(aString).stripLeading(); } INLINELINKAGE MSString MSString::stripLeading(const MSString &aString,char aChar) { return MSString(aString).stripLeading(aChar); } INLINELINKAGE MSString MSString::stripLeading(const MSString &aString,const MSString &aStringOfChars) { return MSString(aString).stripLeading(aStringOfChars); } INLINELINKAGE MSString MSString::stripLeading(const MSString &aString,const char *pStringOfChars) { return MSString(aString).stripLeading(pStringOfChars); } INLINELINKAGE MSString MSString::stripLeading(const MSString &aString,const MSStringTest &aTest) { return MSString(aString).stripLeading(aTest); } INLINELINKAGE MSString MSString::stripTrailingBlanks(const MSString &aString) { return MSString(aString).stripTrailing(); } INLINELINKAGE MSString MSString::stripTrailing(const MSString &aString,char aChar) { return MSString(aString).stripTrailing(aChar); } INLINELINKAGE MSString MSString::stripTrailing(const MSString &aString,const MSString &aStringOfChars) { return MSString(aString).stripTrailing(aStringOfChars); } INLINELINKAGE MSString MSString::stripTrailing(const MSString &aString,const char *pStringOfChars) { return MSString(aString).stripTrailing(pStringOfChars); } INLINELINKAGE MSString MSString::stripTrailing(const MSString &aString,const MSStringTest &aTest) { return MSString(aString).stripTrailing(aTest); } INLINELINKAGE MSString& MSString::translate(const MSString &inputChars,const MSString &outputChars,char padCharacter) { return translate(inputChars.data(),inputChars.length(),outputChars.data(),outputChars.length(),padCharacter); } INLINELINKAGE MSString& MSString::translate(const MSString &inputChars,const char *pOutputChars,char padCharacter) { return translate(inputChars.data(),inputChars.length(),pOutputChars,lengthOf(pOutputChars),padCharacter); } INLINELINKAGE MSString& MSString::translate(const char *pInputChars,const MSString &outputChars,char padCharacter) { return translate(pInputChars,lengthOf(pInputChars),outputChars.data(),outputChars.length(),padCharacter); } INLINELINKAGE MSString& MSString::translate(const char *pInputChars,const char *pOutputChars,char padCharacter) { return translate(pInputChars,lengthOf(pInputChars),pOutputChars,lengthOf(pOutputChars),padCharacter); } INLINELINKAGE MSString MSString::translate(const MSString &aString,const MSString &inputChars, const MSString &outputChars,char padCharacter) { return MSString(aString).translate(inputChars,outputChars,padCharacter); } INLINELINKAGE MSString MSString::translate(const MSString &aString,const MSString &inputChars, const char *pOutputChars,char padCharacter) { return MSString(aString).translate(inputChars,pOutputChars,padCharacter); } INLINELINKAGE MSString MSString::translate(const MSString &aString,const char *pInputChars, const MSString &outputChars,char padCharacter) { return MSString(aString).translate(pInputChars,outputChars,padCharacter); } INLINELINKAGE MSString MSString::translate(const MSString &aString,const char *pInputChars, const char *pOutputChars,char padCharacter) { return MSString(aString).translate(pInputChars,pOutputChars,padCharacter); } /*------------------------------ Word Functions ------------------------------*/ INLINELINKAGE MSString& MSString::removeWords(unsigned firstWord) { return removeWords(firstWord,UINT_MAX); } INLINELINKAGE MSString MSString::removeWords(const MSString &aString,unsigned firstWord) { return MSString(aString).removeWords(firstWord); } INLINELINKAGE MSString MSString::removeWords(const MSString &aString,unsigned firstWord,unsigned numWords) { return MSString(aString).removeWords(firstWord,numWords); } INLINELINKAGE unsigned MSString::indexOfPhrase(const MSString &aPhrase,unsigned startWord) const { return findPhrase(aPhrase,startWord,CharIndex); } INLINELINKAGE unsigned MSString::indexOfWord(unsigned wordNumber) const { return indexOfWord(wordNumber,0,0); } INLINELINKAGE unsigned MSString::wordIndexOfPhrase(const MSString &aPhrase,unsigned startWord) const { return findPhrase(aPhrase,startWord,WordIndex); } INLINELINKAGE MSString MSString::space(const MSString &aString,unsigned numSpaces,char spaceChar) { return MSString(aString).space(numSpaces,spaceChar); } INLINELINKAGE MSString MSString::words(unsigned firstWord) const { return words(firstWord,UINT_MAX); } /*------------------------------ Subscripting operators ---------------------------*/ INLINELINKAGE MSString::CharPick MSString::operator[](int index) { return (*this)[(unsigned)index]; } INLINELINKAGE const char &MSString::operator[](int index) const { return (*this)[(unsigned)index]; } /*------------------------------ CharPick Methods ------------------------------*/ INLINELINKAGE MSString::CharPick::CharPick(MSString *pString,unsigned index) { _pString=pString,_index=index; } INLINELINKAGE MSString::CharPick::CharPick(const CharPick& rChar) { _pString=rChar._pString,_index=rChar._index; } INLINELINKAGE MSString *MSString::CharPick::string() const { return _pString; } INLINELINKAGE char MSString::CharPick::value() const { return (*_pString)(_index); } INLINELINKAGE unsigned MSString::CharPick::index() const { return _index; } INLINELINKAGE MSString::CharPick& MSString::CharPick::operator=(char aChar) { _pString->set(_index,aChar); return *this; } INLINELINKAGE MSString::CharPick::operator char() const { return value(); } #endif aplus-fsf-4.22/src/MSTypes/MSStringVectorInlines.C0000644000265000001440000000413410772770470015505 #ifndef MSStringVectorINLINES #define MSStringVectorINLINES /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MS_NO_INLINES #define INLINELINKAGE inline #else #define INLINELINKAGE #endif // MS_NO_INLINES INLINELINKAGE MSString MSTypeVector::asString (const char separator_) const { return _pImpl->asString (separator_); } INLINELINKAGE MSError::ErrorStatus MSTypeVector::set (unsigned int index_, const MSString & value_) { return ObjectVectorString::set (index_, value_); } INLINELINKAGE MSTypeVector & MSTypeVector::appendSingle (const MSString & string_) { ObjectVectorString::append (string_); return *this; } INLINELINKAGE MSTypeVector & MSTypeVector::append (const MSString & string_, const char delimiter_) { return append ((const char *)string_, delimiter_); } INLINELINKAGE MSTypeVector & MSTypeVector::append (const MSTypeVector & vect_) { ObjectVectorString::append (vect_); return *this; } INLINELINKAGE MSTypeVector & MSTypeVector::operator<<= (const MSTypeVector & vect_) { return append (vect_); } INLINELINKAGE MSTypeVector & MSTypeVector::operator<<= (const MSString & value_) { return append ((const char *)value_); } INLINELINKAGE MSTypeVector & MSTypeVector::operator<<= (const char *pString_) { return append (pString_); } INLINELINKAGE MSTypeVector & MSTypeVector::operator<< (const MSTypeVector & vect_) { return append (vect_); } INLINELINKAGE MSTypeVector & MSTypeVector::operator<< (const MSString & value_) { return append ((const char *)value_); } INLINELINKAGE MSTypeVector & MSTypeVector::operator<< (const char *pString_) { return append (pString_); } #endif // MSStringVectorINLINES aplus-fsf-4.22/src/MSTypes/MSSymbolInlines.C0000644000265000001440000000121210772770470014313 #ifndef MSSymbolINLINES #define MSSymbolINLINES /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MS_NO_INLINES #define INLINELINKAGE inline #else #define INLINELINKAGE #endif // we use MSNullAtom here instead of MSNameSpace::nullAtom() // for efficiency and compile performance - i.e. we do not // need to include MSNameSpace.H INLINELINKAGE MSAtom MSSymbol::atom(void) const { return _atom; } #endif aplus-fsf-4.22/src/MSTypes/MSSymbolVectorInlines.C0000644000265000001440000000377210772770470015513 #ifndef MSSymbolVectorINLINES #define MSSymbolVectorINLINES /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// INLINELINKAGE const MSSymbol & MSTypeVector::firstElement() const { return elementAt (0); } INLINELINKAGE const MSSymbol & MSTypeVector::lastElement() const { return elementAt (_pImpl->length() -1); } INLINELINKAGE const MSSymbol & MSTypeVector::operator() (unsigned int index_) const { return elementAt (index_); } INLINELINKAGE const MSSymbol & MSTypeVector::operator[] (unsigned int index_) const { return elementAt (index_); } INLINELINKAGE const MSSymbol & MSTypeVector::elementAt (unsigned int index_) const { #if !defined MS_NO_INDEX_ERROR if (index_ >= _pImpl->length()) { _pImpl->vectorIndexError (index_); return *(const MSSymbol *)ops().badData(); } #endif // MS_NO_INDEX_ERROR return data()[index_]; } INLINELINKAGE MSTypeVector::SPick MSTypeVector::operator[] (unsigned int index_) { return SPick (*this, index_); } INLINELINKAGE MSTypeVector MSTypeVector::operator[] (const MSIndexVector & iVect_) const { return select (*this, iVect_); } INLINELINKAGE MSTypeVector MSTypeVector::operator[] (const MSBinaryVector & bVect_) const { return compress (*this, bVect_); } INLINELINKAGE MSTypeVector::SPick::SPick (MSTypeVector & aVector_, unsigned int index_) : _pVector(&aVector_), _index(index_) { } INLINELINKAGE MSTypeVector::SPick::SPick (const MSTypeVector::SPick & aPick_) : _pVector(aPick_._pVector), _index(aPick_._index) { } INLINELINKAGE MSTypeVector::SPick::operator MSSymbol() const { return (*_pVector)(_index); } #endif //MSSymbolVectorINLINES aplus-fsf-4.22/src/MSTypes/MSTermInlines.C0000644000265000001440000000235610772770470013767 #ifndef MSTermINLINES #define MSTermINLINES /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MSDefinesHEADER #include #endif INLINELINKAGE MSTerm MSTerm::operator+(const MSTerm& term_) const { return MSTerm(*this,term_); } INLINELINKAGE MSBoolean MSTerm::operator==(const MSTerm &term_) const { return MSBoolean(_years==term_._years&&_months==term_._months&&_days==term_._days); } INLINELINKAGE MSBoolean MSTerm::operator!=(const MSTerm &term_) const { return MSBoolean(_years!=term_._years||_months!=term_._months||_days!=term_._days); } INLINELINKAGE MSBoolean MSTerm::operator<(const MSTerm &term_) const { return MSBoolean(compare(term_)==-1); } INLINELINKAGE MSBoolean MSTerm::operator<=(const MSTerm &term_) const { return MSBoolean(compare(term_)<=0); } INLINELINKAGE MSBoolean MSTerm::operator>(const MSTerm &term_) const { return MSBoolean(compare(term_)==1); } INLINELINKAGE MSBoolean MSTerm::operator>=(const MSTerm &term_) const { return MSBoolean(compare(term_)>=0); } #endif aplus-fsf-4.22/src/MSTypes/MSTimeInlines.C0000644000265000001440000001217410772770470013755 #ifndef MSTimeINLINES #define MSTimeINLINES /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MSDefinesHEADER #include #endif INLINELINKAGE MSTime::~MSTime(void) {} INLINELINKAGE time_t MSTime::nullTime(void) { return _nullTime; } INLINELINKAGE void MSTime::defaultConstructToNow(MSBoolean aBoolean_) { _defaultConstructToNow=aBoolean_; } INLINELINKAGE MSBoolean MSTime::defaultConstructToNow(void) { return _defaultConstructToNow; } INLINELINKAGE MSTime::MSTime(void) : _time(0) { if (defaultConstructToNow()==MSTrue) _time=currentTime(); } INLINELINKAGE MSTime::MSTime(const MSTime& aTime_) { _time=aTime_._time; } INLINELINKAGE MSTime::MSTime(const MSString& aString_, MSTimeZone zone_) { _time=nullTime(),internalSet((const char *)aString_,zone_); } INLINELINKAGE MSTime::MSTime(const char *pString_, MSTimeZone zone_) { _time=nullTime(),internalSet(pString_,zone_); } INLINELINKAGE MSTime::MSTime(time_t aTime_) { _time=aTime_; } INLINELINKAGE MSTime MSTime::now(void) { return MSTime(currentTime()); } INLINELINKAGE MSTime::MSTimeZone MSTime::localTimeZone(void) { return _localTimeZone; } INLINELINKAGE MSTime::MSTimeFormat MSTime::defaultFormat(void) { return _defaultFormat; } INLINELINKAGE void MSTime::defaultFormat(MSTime::MSTimeFormat format_) { _defaultFormat=format_; } INLINELINKAGE const MSString& MSTime::strftimeDefaultFormat(void) { return _strftimeDefaultFormat; } INLINELINKAGE void MSTime::strftimeDefaultFormat(MSString& format_) { _strftimeDefaultFormat=format_; } INLINELINKAGE void MSTime::strftimeDefaultFormat(const char *pFormat_) { _strftimeDefaultFormat=pFormat_; } INLINELINKAGE void MSTime::setInvalid(void) { _time=nullTime(); changed(); } INLINELINKAGE MSTime MSTime::max(const MSTime& aTime_) const { return aTime_._time>_time?aTime_:*this; } INLINELINKAGE MSTime MSTime::min(const MSTime& aTime_) const { return aTime_._time<_time?aTime_:*this; } INLINELINKAGE MSBoolean MSTime::between(const MSTime& t1_,const MSTime& t2_) const { return MSBoolean(_time>=t1_._time&&_time<=t2_._time); } INLINELINKAGE MSBoolean MSTime::isSet(void) const { return MSBoolean(_time!=nullTime()); } INLINELINKAGE MSBoolean MSTime::isValid(void) const { return MSBoolean(_time!=nullTime()); } INLINELINKAGE MSTime::operator double() const { return _time; } INLINELINKAGE MSTime::operator time_t() const { return _time; } INLINELINKAGE MSTime MSTime::atMidnight(MSTimeZone zone_) const { return MSTime(_time-(_time+zoneOffset(zone_))%SECS_IN_DAY); } INLINELINKAGE MSBoolean MSTime::isAtMidnight(MSTimeZone zone_) const { return ((_time+zoneOffset(zone_))%SECS_IN_DAY)==0?MSTrue:MSFalse; } INLINELINKAGE unsigned long MSTime::secondsPastMinute(MSTimeZone zone_) const { return (_time+zoneOffset(zone_))%SECS_IN_MIN; } INLINELINKAGE unsigned long MSTime::minutesPastHour(MSTimeZone zone_) const { return ((_time+zoneOffset(zone_))%SECS_IN_HOUR)/SECS_IN_MIN; } INLINELINKAGE unsigned long MSTime::hoursPastMidnight(MSTimeZone zone_) const { return ((_time+zoneOffset(zone_))%SECS_IN_DAY)/SECS_IN_HOUR; } INLINELINKAGE long MSTime::zoneOffset(MSTimeZone zone_) const { return zoneOffset(_time, zone_); } // Prefix - add/subtract one, then return result INLINELINKAGE MSTime& MSTime::operator++() { return ++_time,changed(),*this; } INLINELINKAGE MSTime& MSTime::operator--() { return --_time,changed(),*this; } // Postfix - add/subtract one, then return the initial value INLINELINKAGE MSTime MSTime::operator++(int) { time_t t=_time++; return changed(),MSTime(t); } INLINELINKAGE MSTime MSTime::operator--(int) { time_t t=_time--; return changed(),MSTime(t); } INLINELINKAGE MSTime& MSTime::operator+=(long seconds_) { _time+=seconds_; return changed(),*this; } INLINELINKAGE MSTime& MSTime::operator-=(long seconds_) { _time-=seconds_; return changed(),*this; } INLINELINKAGE MSBoolean MSTime::operator==(const MSTime &aTime_) const { return MSBoolean(_time==aTime_._time); } INLINELINKAGE MSBoolean MSTime::operator!=(const MSTime &aTime_) const { return MSBoolean(_time!=aTime_._time); } INLINELINKAGE MSBoolean MSTime::operator<=(const MSTime &aTime_) const { return MSBoolean(_time<=aTime_._time); } INLINELINKAGE MSBoolean MSTime::operator>=(const MSTime &aTime_) const { return MSBoolean(_time>=aTime_._time); } INLINELINKAGE MSBoolean MSTime::operator< (const MSTime &aTime_) const { return MSBoolean(_time (const MSTime &aTime_) const { return MSBoolean(_time>aTime_._time); } INLINELINKAGE MSTime& MSTime::operator=(const MSTime& aTime_) { _time=aTime_._time; return changed(),*this; } INLINELINKAGE MSTime& MSTime::operator=(const MSString& aString_) { set(aString_,Local); return *this; } INLINELINKAGE MSTime& MSTime::operator=(const char *pString_) { set(pString_,Local); return *this; } INLINELINKAGE MSTime& MSTime::operator=(time_t aTime_) { _time=aTime_; return changed(),*this; } #endif aplus-fsf-4.22/src/MSTypes/MSTypeDataInlines.C0000644000265000001440000002017710772770470014574 #ifndef MSTypeDataINLINES #define MSTypeDataINLINES /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// template INLINELINKAGE MSTypeData * MSTypeData::incrementCount() { #ifdef MS_MULTI_THREAD _mutex.acquire(); #endif ++_refCount; #ifdef MS_MULTI_THREAD _mutex.release(); #endif return this; } template INLINELINKAGE void MSTypeData::decrementCount (MSAllocationFlag flag_, unsigned int numToDestroy_) { #ifdef MS_MULTI_THREAD _mutex.acquire(); if (--_refCount==0) { _mutex.release(); deallocate(flag_, numToDestroy_); } else { _mutex.release(); } #else if (--_refCount==0) deallocate(flag_, numToDestroy_); #endif } template INLINELINKAGE const Type *MSTypeData::elements() const { // use dataOffset() method to find the proper offset of the data elements // return (const Type *)(((char *)this) + dataOffset()); } // same as elements(); used for backward compatibility only template INLINELINKAGE const Type *MSTypeData::data() const { return elements(); } template INLINELINKAGE Type *MSTypeData::elements() { // use dataOffset() method to find the proper offset of the data elements // return (Type *)(((char *)this) + dataOffset()); } // same as elements(); used for backward compatibility only template INLINELINKAGE Type *MSTypeData::data() { return elements(); } template INLINELINKAGE const Type & MSTypeData::elementAt (unsigned index_) const { return elements()[index_]; } template INLINELINKAGE Type & MSTypeData::elementAt (unsigned index_) { return elements()[index_]; } template INLINELINKAGE unsigned int MSTypeData::dataOffset(void) { // we have to use MSDataAlignment structure to find out the proper offset // of the data elements, taking possible alignment into consideration // return offsetof(MSDataAlignment,_pElements); } template INLINELINKAGE MSBoolean isConstructionNeeded(Type *) { return MSTrue; } INLINELINKAGE MSBoolean isConstructionNeeded(void *) { return MSFalse; } INLINELINKAGE MSBoolean isConstructionNeeded(char *) { return MSFalse; } INLINELINKAGE MSBoolean isConstructionNeeded(unsigned char *) { return MSFalse; } INLINELINKAGE MSBoolean isConstructionNeeded(short *) { return MSFalse; } INLINELINKAGE MSBoolean isConstructionNeeded(unsigned short *) { return MSFalse; } INLINELINKAGE MSBoolean isConstructionNeeded(int *) { return MSFalse; } INLINELINKAGE MSBoolean isConstructionNeeded(unsigned int *) { return MSFalse; } INLINELINKAGE MSBoolean isConstructionNeeded(long *) { return MSFalse; } INLINELINKAGE MSBoolean isConstructionNeeded(unsigned long *) { return MSFalse; } INLINELINKAGE MSBoolean isConstructionNeeded(float *) { return MSFalse; } INLINELINKAGE MSBoolean isConstructionNeeded(double *) { return MSFalse; } INLINELINKAGE MSBoolean isConstructionNeeded(void **) { return MSFalse; } INLINELINKAGE MSBoolean isConstructionNeeded(char **) { return MSFalse; } INLINELINKAGE MSBoolean isConstructionNeeded(unsigned char **) { return MSFalse; } INLINELINKAGE MSBoolean isConstructionNeeded(short **) { return MSFalse; } INLINELINKAGE MSBoolean isConstructionNeeded(unsigned short **) { return MSFalse; } INLINELINKAGE MSBoolean isConstructionNeeded(int **) { return MSFalse; } INLINELINKAGE MSBoolean isConstructionNeeded(unsigned int **) { return MSFalse; } INLINELINKAGE MSBoolean isConstructionNeeded(long **) { return MSFalse; } INLINELINKAGE MSBoolean isConstructionNeeded(unsigned long **) { return MSFalse; } INLINELINKAGE MSBoolean isConstructionNeeded(float **) { return MSFalse; } INLINELINKAGE MSBoolean isConstructionNeeded(double **) { return MSFalse; } INLINELINKAGE MSBoolean isConstructionNeeded(void ***) { return MSFalse; } INLINELINKAGE MSBoolean isConstructionNeeded(char ***) { return MSFalse; } INLINELINKAGE MSBoolean isConstructionNeeded(unsigned char ***) { return MSFalse; } INLINELINKAGE MSBoolean isConstructionNeeded(short ***) { return MSFalse; } INLINELINKAGE MSBoolean isConstructionNeeded(unsigned short ***) { return MSFalse; } INLINELINKAGE MSBoolean isConstructionNeeded(int ***) { return MSFalse; } INLINELINKAGE MSBoolean isConstructionNeeded(unsigned int ***) { return MSFalse; } INLINELINKAGE MSBoolean isConstructionNeeded(long ***) { return MSFalse; } INLINELINKAGE MSBoolean isConstructionNeeded(unsigned long ***) { return MSFalse; } INLINELINKAGE MSBoolean isConstructionNeeded(float ***) { return MSFalse; } INLINELINKAGE MSBoolean isConstructionNeeded(double ***) { return MSFalse; } template INLINELINKAGE MSBoolean isDestructionNeeded(Type *) { return MSTrue; } INLINELINKAGE MSBoolean isDestructionNeeded(void *) { return MSFalse; } INLINELINKAGE MSBoolean isDestructionNeeded(char *) { return MSFalse; } INLINELINKAGE MSBoolean isDestructionNeeded(unsigned char *) { return MSFalse; } INLINELINKAGE MSBoolean isDestructionNeeded(short *) { return MSFalse; } INLINELINKAGE MSBoolean isDestructionNeeded(unsigned short *) { return MSFalse; } INLINELINKAGE MSBoolean isDestructionNeeded(int *) { return MSFalse; } INLINELINKAGE MSBoolean isDestructionNeeded(unsigned int *) { return MSFalse; } INLINELINKAGE MSBoolean isDestructionNeeded(long *) { return MSFalse; } INLINELINKAGE MSBoolean isDestructionNeeded(unsigned long *) { return MSFalse; } INLINELINKAGE MSBoolean isDestructionNeeded(float *) { return MSFalse; } INLINELINKAGE MSBoolean isDestructionNeeded(double *) { return MSFalse; } INLINELINKAGE MSBoolean isDestructionNeeded(void **) { return MSFalse; } INLINELINKAGE MSBoolean isDestructionNeeded(char **) { return MSFalse; } INLINELINKAGE MSBoolean isDestructionNeeded(unsigned char **) { return MSFalse; } INLINELINKAGE MSBoolean isDestructionNeeded(short **) { return MSFalse; } INLINELINKAGE MSBoolean isDestructionNeeded(unsigned short **) { return MSFalse; } INLINELINKAGE MSBoolean isDestructionNeeded(int **) { return MSFalse; } INLINELINKAGE MSBoolean isDestructionNeeded(unsigned int **) { return MSFalse; } INLINELINKAGE MSBoolean isDestructionNeeded(long **) { return MSFalse; } INLINELINKAGE MSBoolean isDestructionNeeded(unsigned long **) { return MSFalse; } INLINELINKAGE MSBoolean isDestructionNeeded(float **) { return MSFalse; } INLINELINKAGE MSBoolean isDestructionNeeded(double **) { return MSFalse; } INLINELINKAGE MSBoolean isDestructionNeeded(void ***) { return MSFalse; } INLINELINKAGE MSBoolean isDestructionNeeded(char ***) { return MSFalse; } INLINELINKAGE MSBoolean isDestructionNeeded(unsigned char ***) { return MSFalse; } INLINELINKAGE MSBoolean isDestructionNeeded(short ***) { return MSFalse; } INLINELINKAGE MSBoolean isDestructionNeeded(unsigned short ***) { return MSFalse; } INLINELINKAGE MSBoolean isDestructionNeeded(int ***) { return MSFalse; } INLINELINKAGE MSBoolean isDestructionNeeded(unsigned int ***) { return MSFalse; } INLINELINKAGE MSBoolean isDestructionNeeded(long ***) { return MSFalse; } INLINELINKAGE MSBoolean isDestructionNeeded(unsigned long ***) { return MSFalse; } INLINELINKAGE MSBoolean isDestructionNeeded(float ***) { return MSFalse; } INLINELINKAGE MSBoolean isDestructionNeeded(double ***) { return MSFalse; } #endif //MSTypeDataINLINES aplus-fsf-4.22/src/MSTypes/MSTypeVectorInlines.C0000644000265000001440000000126610772770470015163 #ifndef MSTypeVectorINLINES #define MSTypeVectorINLINES /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// template INLINELINKAGE MSString MSTypeVector::name() { Type aType; // return MSString("MSTypeVector<") + aType.className() + ">"; return MSString("MSTypeVector<") + ::className(aType) + ">"; } template INLINELINKAGE MSString className (const Type & t) { return t.className(); } #endif // MSTypeVectorINLINES aplus-fsf-4.22/src/MSTypes/MSUnsignedInlines.C0000644000265000001440000000740110772770470014630 #ifndef MSUnsignedINLINES #define MSUnsignedINLINES /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #ifndef MSDefinesHEADER #include #endif INLINELINKAGE MSUnsigned::MSUnsigned(void) : _isSet(MSFalse),_unsigned(0) {} INLINELINKAGE MSUnsigned::MSUnsigned(unsigned i_) : _isSet(MSTrue),_unsigned(i_) {} INLINELINKAGE MSUnsigned::MSUnsigned(const MSUnsigned& i_) : _isSet(i_._isSet),_unsigned(i_._unsigned) {} INLINELINKAGE MSUnsigned::operator unsigned() const { return _unsigned; } INLINELINKAGE MSUnsigned::operator double() const { return double(_unsigned); } INLINELINKAGE unsigned MSUnsigned::operator()() const { return _unsigned; } // function call operator INLINELINKAGE MSUnsigned& MSUnsigned::operator=(const MSUnsigned& aUnsigned_) { if (this!=&aUnsigned_) { _unsigned=aUnsigned_._unsigned; _isSet=aUnsigned_._isSet; changed(); } return *this; } INLINELINKAGE MSUnsigned& MSUnsigned::operator=(unsigned aUnsigned_) { _unsigned=aUnsigned_; _isSet=MSTrue; return changed(),*this; } INLINELINKAGE MSUnsigned& MSUnsigned::operator=(const char *value_) { set(value_); return *this; } INLINELINKAGE MSBoolean MSUnsigned::operator==(const MSUnsigned& i_) const { return MSBoolean(_unsigned==i_._unsigned); } INLINELINKAGE MSBoolean MSUnsigned::operator!=(const MSUnsigned& i_) const { return MSBoolean(_unsigned!=i_._unsigned); } INLINELINKAGE MSBoolean MSUnsigned::operator< (const MSUnsigned& i_) const { return MSBoolean(_unsigned< i_._unsigned); } INLINELINKAGE MSBoolean MSUnsigned::operator<=(const MSUnsigned& i_) const { return MSBoolean(_unsigned<=i_._unsigned); } INLINELINKAGE MSBoolean MSUnsigned::operator> (const MSUnsigned& i_) const { return MSBoolean(_unsigned> i_._unsigned); } INLINELINKAGE MSBoolean MSUnsigned::operator>=(const MSUnsigned& i_) const { return MSBoolean(_unsigned>=i_._unsigned); } INLINELINKAGE MSBoolean MSUnsigned::operator==(unsigned i_) const { return MSBoolean(_unsigned==i_); } INLINELINKAGE MSBoolean MSUnsigned::operator!=(unsigned i_) const { return MSBoolean(_unsigned!=i_); } INLINELINKAGE MSBoolean MSUnsigned::operator< (unsigned i_) const { return MSBoolean(_unsigned< i_); } INLINELINKAGE MSBoolean MSUnsigned::operator<=(unsigned i_) const { return MSBoolean(_unsigned<=i_); } INLINELINKAGE MSBoolean MSUnsigned::operator> (unsigned i_) const { return MSBoolean(_unsigned> i_); } INLINELINKAGE MSBoolean MSUnsigned::operator>=(unsigned i_) const { return MSBoolean(_unsigned>=i_); } // Prefix - add/subtract one, then return result INLINELINKAGE MSUnsigned& MSUnsigned::operator++() { return ++_unsigned,changed(),*this; } INLINELINKAGE MSUnsigned& MSUnsigned::operator--() { return --_unsigned,changed(),*this; } // Postfix - add/subtract one, then return the initial value INLINELINKAGE MSUnsigned MSUnsigned::operator++(int) { unsigned i=_unsigned++; return changed(),MSUnsigned(i); } INLINELINKAGE MSUnsigned MSUnsigned::operator--(int) { unsigned i=_unsigned--; return changed(),MSUnsigned(i); } INLINELINKAGE MSUnsigned& MSUnsigned::operator+=(unsigned i_) { _unsigned+=i_; return changed(),*this; } INLINELINKAGE MSUnsigned& MSUnsigned::operator-=(unsigned i_) { _unsigned-=i_; return changed(),*this; } INLINELINKAGE MSUnsigned& MSUnsigned::operator*=(unsigned i_) { _unsigned*=i_; return changed(),*this; } INLINELINKAGE MSUnsigned& MSUnsigned::operator/=(unsigned i_) { _unsigned/=i_; return changed(),*this; } INLINELINKAGE MSUnsigned MSUnsigned::operator-() { return -_unsigned; } INLINELINKAGE MSBoolean MSUnsigned::isSet(void) const { return _isSet; } #endif aplus-fsf-4.22/src/MSTypes/MSUnsignedLongVectorInlines.C0000644000265000001440000000105010772770470016625 #ifndef MSUnsignedLongVectorInlinesHEADER #define MSUnsignedLongVectorInlinesHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// /*** INLINELINKAGE MSTypeVector::MSTypeVector (MSBuiltinVectorImpl *pImpl) : BuiltinVectorUnsignedLong (pImpl) { } ***/ #endif // MSUnsignedLongVectorInlinesHEADER aplus-fsf-4.22/src/MSTypes/MSUnsignedVectorInlines.C0000644000265000001440000000102610772770470016010 #ifndef MSUnsignedVectorInlinesHEADER #define MSUnsignedVectorInlinesHEADER /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// /*** INLINELINKAGE MSTypeVector::MSTypeVector (MSBuiltinVectorImpl *pImpl) : BuiltinVectorUnsigned (pImpl) { } ***/ #endif // MSUnsignedVectorInlinesHEADER aplus-fsf-4.22/src/MSTypes/MSVectorImplInlines.C0000644000265000001440000000356310772770470015145 #ifndef MSVectorImplINLINES #define MSVectorImplINLINES /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #include INLINELINKAGE void MSVectorImpl::prepareToChange() { if (_pOperations->refCount (_pElements) > 1) makeUniqueCopy(); } INLINELINKAGE void MSVectorImpl::internalSet (unsigned int index_, const void *pValue_) { #if !defined (MS_NO_INDEX_ERROR) if (index_ >= _len) vectorIndexError (index_); else #endif _pOperations->set (_pElements, index_, pValue_); } INLINELINKAGE void MSVectorImpl::internalSet (unsigned int index_, const MSVectorImpl & srcImpl_, unsigned int srcIndex_) { #if !defined (MS_NO_INDEX_ERROR) if (index_ >= _len) vectorIndexError (index_); else #endif _pOperations->set (_pElements, index_, srcImpl_._pElements, srcIndex_); } INLINELINKAGE void *MSVectorImpl::internalGet (unsigned int index_) const { #if !defined (MS_NO_INDEX_ERROR) if (index_ >= _len) { vectorIndexError (index_); return _pOperations->badData(); } else #endif return _pOperations->elementAt (_pElements, index_); } #if defined (MS_NO_INDEX_ERROR) INLINELINKAGE void MSVectorImpl::vectorIndexError(unsigned int) const { } #else INLINELINKAGE void MSVectorImpl::vectorIndexError(unsigned int index_) const { indexError(index_); } #endif //MS_NO_INDEX_ERROR INLINELINKAGE unsigned int MSVectorImpl::length() const { return _len; } INLINELINKAGE void * MSVectorImpl::data() const { return _pElements; } INLINELINKAGE void MSVectorImpl::permute (const MSIndexVector & iVect_) { select (iVect_); } #endif // MSVectorImplINLINES aplus-fsf-4.22/src/MSTypes/MSBaseTypeVector.C0000644000265000001440000006430410772770471014437 #ifndef MSBaseTypeVectorIMPLEMENTATION #define MSBaseTypeVectorIMPLEMENTATION /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #if HAVE_IOSTREAM #include #else #include #endif #include #include #include #include #include #include #ifdef MS_NO_INLINES #include #endif // MS_NO_INLINES #ifdef MS_MULTI_THREAD template MSMutex MSBaseVector::_operationsMutex; template MSMutex MSBaseVectorOps::_nullDataMutex; #endif template MSBaseVector::MSBaseVector() : MSVector(), _blocked(MSFalse) { _pImpl = new MSVectorImpl(&ops()); } template MSBaseVector::MSBaseVector (const MSBaseVector & vect_) : MSVector(), _pImpl (new MSVectorImpl (*vect_._pImpl)), _blocked(MSFalse) { } #if defined(MS_TEMPLATE_CONSTRUCTOR_OVERLOAD_BUG) template MSBaseVector::MSBaseVector (unsigned int length_, int, int) : MSVector(), _blocked(MSFalse) { _pImpl = new MSVectorImpl(&ops(),length_); } #else template MSBaseVector::MSBaseVector (unsigned int length_) : MSVector(), _blocked(MSFalse) { _pImpl = new MSVectorImpl(&ops(),length_); } #endif //MS_TEMPLATE_CONSTRUCTOR_OVERLOAD_BUG template MSBaseVector::MSBaseVector (unsigned int length_, const Type & filler_) : MSVector(), _blocked(MSFalse) { _pImpl = new MSVectorImpl(&ops(),length_,(void *)&filler_); } template MSBaseVector::MSBaseVector (const char *pString_, const char delimiter_) : MSVector(), _blocked(MSFalse) { _pImpl = new MSVectorImpl(&ops()); _pImpl->setFromString(pString_,delimiter_); } template MSBaseVector::MSBaseVector (MSTypeData *pData_, unsigned int len_) : MSVector(), _blocked(MSFalse) { _pImpl = new MSVectorImpl(&ops(),pData_,len_); } template MSBaseVector::~MSBaseVector() { delete _pImpl; _pImpl = 0; } template MSBaseVector::MSBaseVector (const Type *pElements_, unsigned int len_) : MSVector(), _blocked(MSFalse) { MSTypeData *pData = MSTypeData::allocateWithLength (len_, MSRaw); MSTypeData::copy (pElements_, pData->elements(), len_, MSRaw); _pImpl = new MSVectorImpl(&ops(),pData,len_); } template MSBaseVector & MSBaseVector::operator= (const MSBaseVector & aVector_) { if (this != &aVector_) { _blocked = MSTrue; *_pImpl = *(aVector_._pImpl); _blocked = MSFalse; changed(); } return *this; } template MSBaseVector & MSBaseVector::operator= (const Type & value_) { _blocked = MSTrue; _pImpl->setAll ((void *)&value_); _blocked = MSFalse; changed(); return *this; } template MSString MSBaseVector::asString() const { return ::msVectorAsString((Type*)0,_pImpl); } template MSString MSBaseVector::asMSF() const { return _pImpl->asMSF(); } template MSString MSBaseVector::asDebugInfo() const { MSString result (className()); return result << "(@" << MSString((unsigned long)this).d2x().lowerCase() << ",_elements=" << vectorData()->asDebugInfo() << ",_size=" << MSString(size()) << ",_length=" << MSString(_pImpl->length()) << ",_type=" << type().symbolName() << ")"; } template MSString MSBaseVector::className() const { return MSString(); } template const MSSymbol & MSBaseVector::type() const { static MSSymbol sym; return sym; } template MSModel * MSBaseVector::clone() const { return new MSBaseVector (*this); } template MSModel * MSBaseVector::create() const { return new MSBaseVector; } template void MSBaseVector::assign (const MSModel & aModel_) { *this = (MSBaseVector &)aModel_; } template long MSBaseVector::compare (const MSModel & aModel_) const { return compare ((MSBaseVector &)aModel_); } template MSError::ErrorStatus MSBaseVector::set (const char *pString_) { _blocked = MSTrue; MSError::ErrorStatus retval = _pImpl->setFromString (pString_); _blocked = MSFalse; changed(); return retval; } template MSError::ErrorStatus MSBaseVector::setFromMSF (const char *pString_) { _blocked = MSTrue; MSError::ErrorStatus retval = _pImpl->setFromMSF (pString_); _blocked = MSFalse; changed(); return retval; } template MSError::ErrorStatus MSBaseVector::set (unsigned int index_, const Type & value_) { if (index_ < _pImpl->length()) { _blocked = MSTrue; _pImpl->set (index_, (void *)&value_); _blocked = MSFalse; changed (index_); return MSError::MSSuccess; } else { _pImpl->vectorIndexError (index_); return MSError::MSFailure; } } template MSError::ErrorStatus MSBaseVector::set (unsigned int index_, const char *pString_) { Type value; return (::msSetFromString (value, pString_) == MSError::MSSuccess) ? set (index_, value) : MSError::MSFailure; } template Type * MSBaseVector::data() const { return vectorData()->elements(); } template Type * MSBaseVector::elements() const { return vectorData()->elements(); } // the virtual version of length() template unsigned int MSBaseVector::getLength() const { return _pImpl->length(); } template MSBaseVector & MSBaseVector::removeAll() { _blocked = MSTrue; if (_pImpl->removeAll() == MSError::MSSuccess) changed(); _blocked = MSFalse; return *this; } template MSBaseVector & MSBaseVector::append (const Type & newElement) { _blocked = MSTrue; _pImpl->append ((void *)& newElement); _blocked = MSFalse; appendUpdate (_pImpl->length(), 1); return *this; } template MSBaseVector & MSBaseVector::append (const MSBaseVector & vect_) { if (_pImpl->append (*vect_._pImpl) == MSError::MSSuccess) appendUpdate (_pImpl->length(), vect_._pImpl->length()); return *this; } template MSBaseVector & MSBaseVector::insertAt (unsigned int index_, const Type & value_) { _blocked = MSTrue; if (index_ == _pImpl->length()) // NEW FEATURE: insert right after the last element return append (value_); // if inserting inside the vector if (_pImpl->insertAt (index_, (void *)& value_) == MSError::MSSuccess) changed(); _blocked = MSFalse; return *this; } template MSBaseVector & MSBaseVector::insertAt (unsigned int index_, const MSBaseVector & vect_) { _blocked = MSTrue; if (index_ == _pImpl->length()) // NEW FEATURE: insert right after the last element return append (vect_); // if inserting inside the vector if (_pImpl->insertAt (index_, *vect_._pImpl) == MSError::MSSuccess) changed(); _blocked = MSFalse; return *this; } template MSBaseVector & MSBaseVector::removeAt (unsigned int index_) { _blocked = MSTrue; if (_pImpl->removeAt (index_) == MSError::MSSuccess) changed(); _blocked = MSFalse; return *this; } template MSBaseVector & MSBaseVector::removeAt (unsigned int startPos_, unsigned int numEls_) { _blocked = MSTrue; if (numEls_ > 0) if (_pImpl->removeAt (startPos_, numEls_) == MSError::MSSuccess) changed(); _blocked = MSFalse; return *this; } template MSBaseVector & MSBaseVector::remove (const MSIndexVector & iVect_) { _blocked = MSTrue; if (_pImpl->remove (iVect_) == MSError::MSSuccess) changed(); _blocked = MSFalse; return *this; } template MSBaseVector & MSBaseVector::remove (const MSBinaryVector & bVect_) { _blocked = MSTrue; if (_pImpl->remove (bVect_) == MSError::MSSuccess) changed(); _blocked = MSFalse; return *this; } template MSBaseVector & MSBaseVector::select (const MSIndexVector & iVect_) { _blocked = MSTrue; if (_pImpl->select (iVect_) == MSError::MSSuccess) changed(); _blocked = MSFalse; return *this; } template MSBaseVector & MSBaseVector::compress (const MSBinaryVector & bVect_) { _blocked = MSTrue; if (_pImpl->compress (bVect_) == MSError::MSSuccess) changed(); _blocked = MSFalse; return *this; } template MSBaseVector & MSBaseVector::reshape (unsigned int newLen_) { _blocked = MSTrue; if (_pImpl->reshape (newLen_) == MSError::MSSuccess) changed(); _blocked = MSFalse; return *this; } template MSBaseVector & MSBaseVector::exchange (unsigned int index1_, unsigned int index2_) { _blocked = MSTrue; if (_pImpl->exchange (index1_, index2_) == MSError::MSSuccess && doChanged() == MSTrue) { MSIndexVector iVect (2); iVect.data()[0] = index1_; iVect.data()[1] = index2_; changed (iVect); } _blocked = MSFalse; return *this; } template MSBaseVector & MSBaseVector::reverse() { _blocked = MSTrue; if (_pImpl->reverse() == MSError::MSSuccess) changed(); _blocked = MSFalse; return *this; } template MSBaseVector & MSBaseVector::rotate (int amount_) { _blocked = MSTrue; if (_pImpl->rotate (amount_) == MSError::MSSuccess) changed(); _blocked = MSFalse; return *this; } template MSBaseVector & MSBaseVector::take (int numEls_) { _blocked = MSTrue; if (_pImpl->take (numEls_) == MSError::MSSuccess) changed(); _blocked = MSFalse; return *this; } template MSBaseVector & MSBaseVector::take (int numEls_, const Type & filler_) { _blocked = MSTrue; if (_pImpl->take (numEls_, (const void *)&filler_) == MSError::MSSuccess) changed(); _blocked = MSFalse; return *this; } template MSBaseVector & MSBaseVector::drop (int numEls_) { _blocked = MSTrue; if (_pImpl->drop (numEls_) == MSError::MSSuccess) changed(); _blocked = MSFalse; return *this; } template MSBaseVector MSBaseVector::reverse (const MSBaseVector & vect_) { MSVectorImpl *impl = vect_._pImpl->create(); impl->reverse (*vect_._pImpl); return MSBaseVector (impl); } template MSBaseVector MSBaseVector::rotate (const MSBaseVector & vect_, int amount_) { MSVectorImpl *impl = vect_._pImpl->create(); impl->rotate (*vect_._pImpl, amount_); return MSBaseVector (impl); } template MSBaseVector MSBaseVector::take (const MSBaseVector & vect_, int numEls_) { MSVectorImpl *impl = vect_._pImpl->create(); impl->take (*vect_._pImpl, numEls_); return MSBaseVector (impl); } template MSBaseVector MSBaseVector::take (const MSBaseVector & vect_, int numEls_, const Type & filler_) { MSVectorImpl *impl = vect_._pImpl->create(); impl->take (*vect_._pImpl, numEls_, (void *)&filler_); return MSBaseVector (impl); } template MSBaseVector MSBaseVector::drop (const MSBaseVector & vect_, int numEls_) { MSVectorImpl *impl = vect_._pImpl->create(); impl->drop (*vect_._pImpl, numEls_); return MSBaseVector (impl); } template MSBaseVector MSBaseVector::select (const MSBaseVector & vect_, const MSIndexVector & iVect_) { MSVectorImpl *impl = vect_._pImpl->create(); impl->select (*vect_._pImpl, iVect_); return MSBaseVector (impl); } template MSBaseVector MSBaseVector::compress (const MSBaseVector & vect_, const MSBinaryVector & bVect_) { MSVectorImpl *impl = vect_._pImpl->create(); impl->compress (*vect_._pImpl, bVect_); return MSBaseVector (impl); } template MSBaseVector & MSBaseVector::selectiveAssign (const MSIndexVector & iVect_, const Type & value_) { _blocked = MSTrue; _pImpl->setSelected (iVect_, (void *)&value_); _blocked = MSFalse; changed (iVect_); return *this; } template MSBaseVector & MSBaseVector::selectiveAssign (const MSIndexVector & iVect_, const MSBaseVector & vect_) { _blocked = MSTrue; _pImpl->setSelected (iVect_, *vect_._pImpl); _blocked = MSFalse; changed (iVect_); return *this; } template MSBaseVector & MSBaseVector::selectiveAssign (const MSBinaryVector & bVect_, const Type & value_) { _blocked = MSTrue; if (doChanged() == MSTrue) changed (_pImpl->setIndexSelected (bVect_, (void *)&value_)); else _pImpl->setSelected (bVect_, (void *)&value_); _blocked = MSFalse; return *this; } template MSBaseVector & MSBaseVector::selectiveAssign (const MSBinaryVector & bVect_, const MSBaseVector & vect_) { _blocked = MSTrue; if (doChanged() == MSTrue) changed (_pImpl->setIndexSelected (bVect_, *vect_._pImpl)); else _pImpl->setSelected (bVect_, *vect_._pImpl); _blocked = MSFalse; return *this; } template MSIndexVector MSBaseVector::gradeUp() const { return _pImpl->gradeUp(); } template MSIndexVector MSBaseVector::gradeDown() const { return _pImpl->gradeDown(); } template void MSBaseVector::permute (const MSIndexVector & iVect_) { _blocked = MSTrue; _pImpl->permute (iVect_); _blocked = MSFalse; changed(); } template typename MSBaseVector::Operations& MSBaseVector::ops(void) { MS_SAFE_STATIC_INIT(Operations,_operationsMutex); } #if !defined(MS_TEMPLATE_MANUAL_FRIEND_BUG) // The version of EDG used by SGI's dcc compiler has a bug related to access from friends during manual instantiation; // therefore, for SGI, make operator<<() inline so that it does not need to be manually instantiated in the library. template ostream & operator<< (ostream & stream_, const MSBaseVector & vect_) { vect_._pImpl->print (stream_); return stream_; } #endif //MS_TEMPLATE_MANUAL_FRIEND_BUG template MSBaseVectorOps::MSBaseVectorOps() { } template MSBaseVectorOps::~MSBaseVectorOps() { } template void * MSBaseVectorOps::allocate (unsigned int length_, unsigned int numToConstruct_, MSAllocationFlag flag_) const { if (length_ > 0) return MSTypeData::allocateWithLength (length_, flag_, numToConstruct_); else // length_ == 0 return nullData().incrementCount(); } template void * MSBaseVectorOps::allocateWithSize (unsigned int size_, unsigned int numToConstruct_, MSAllocationFlag flag_) const { if (size_ > 0) return MSTypeData::allocateWithSize (size_, flag_, numToConstruct_); else // size_ == 0 return nullData().incrementCount(); } template void MSBaseVectorOps::deallocate (void *data_, unsigned int numToDestroy_, MSAllocationFlag flag_) const { ((MSTypeData *)data_)->decrementCount (flag_, numToDestroy_); } template void MSBaseVectorOps::incrementCount (void *data_) const { ((MSTypeData *)data_)->incrementCount(); } template unsigned int MSBaseVectorOps::refCount (const void *data_) const { return ((MSTypeData *)data_)->refCount(); } template void MSBaseVectorOps::set (void *data_, unsigned int index_, const void *pValue_, MSAllocationFlag flag_) const { ((MSTypeData *)data_)->set (index_, *(Type *)pValue_, flag_); } template void MSBaseVectorOps::set (void *pDest_, unsigned int destInd_, const void *pSrc_, unsigned int srcInd_, MSAllocationFlag flag_) const { ((MSTypeData *)pDest_)->set (destInd_, ((MSTypeData *)pSrc_)->elements()[srcInd_], flag_); } template void MSBaseVectorOps::fill (void *pElements_, unsigned int start_, unsigned int numToFill_, const void *pValue_, MSAllocationFlag flag_) const { Type *pStart = ((MSTypeData *)pElements_)->elements() + start_; if (pValue_) MSTypeData::fill (pStart, numToFill_, *(Type *)pValue_, flag_); else MSTypeData::fill (pStart, numToFill_, *(Type *)defaultFiller(), flag_); } template void MSBaseVectorOps::copy (const void *src_, void *dest_, unsigned int length_, unsigned int srcInd_, unsigned int destInd_, MSAllocationFlag flag_) const { MSTypeData::copy (((MSTypeData *)src_)->elements() + srcInd_, ((MSTypeData *)dest_)->elements() + destInd_, length_, flag_); } template void MSBaseVectorOps::copyBackward (void *pElements_, unsigned int src_, unsigned int dest_, unsigned int numToCopy_) const { Type *pElements = ((MSTypeData *)pElements_)->elements(); MSTypeData::copyBackward (pElements+src_, pElements+dest_, numToCopy_); } template void MSBaseVectorOps::destroy (void *pElements_, unsigned int start_, unsigned int numEls_) const { // This is an obscure problem occurring only with DCC compiler on SGI. Calling MSTypeData::destroyElements() to destroy // numEls_ elements of the vector apparently corrupts the stack somehow. The simplest example is creating // a string vector of 10 elements and doing removeAt(0). The program segv's soon after the removeAt() call. // However, if I do not call MSTypeData::destroyElements(), but put the same code HERE (destroying each element individually), // everything works fine. Everything also works fine with all the other compilers (lcc, lexa, xlC), and // Purify displays no run-time errors (which would usually account for the stack corruption -- such as // out-of-bounds array read/write). // #if !defined(MS_TEMPLATE_TYPE_DESTROY_BUG) MSTypeData::destroyElements(((MSTypeData *)pElements_)->elements()+start_, numEls_); #else Type *pData = ((MSTypeData *)pElements_)->elements() + start_; Allocator alloc; while (numEls_--) { alloc.destroy(pData++); } #endif //__sgi } template MSError::ErrorStatus MSBaseVectorOps::setFromString (void *pData_, unsigned int index_, const char *pString_) const { return ::msSetFromString (((MSTypeData *)pData_)->elements()[index_], pString_); } template int MSBaseVectorOps::isElementEqual (const void *pElements_, unsigned int index_, const void *pValue_) const { return ((MSTypeData *)pElements_)->elements()[index_] == *(Type *)pValue_; } template int MSBaseVectorOps::isElementLess (const void *pElements_, unsigned int index_, const void *pValue_) const { return ((MSTypeData *)pElements_)->elements()[index_] < *(Type *)pValue_; } template int MSBaseVectorOps::isElementLessEqual (const void *pElements_, unsigned int index_, const void *pValue_) const { return ((MSTypeData *)pElements_)->elements()[index_] <= *(Type *)pValue_; } template long MSBaseVectorOps::compareElement (const void *data_, unsigned int index_, const void *value_) const { const Type & value1 = ((MSTypeData *)data_)->elements()[index_], & value2 = *(Type *)value_; return ::compare(value1,value2); } template void *MSBaseVectorOps::elementAt (const void *pElements_, unsigned int index_) const { return & ((MSTypeData *)pElements_)->elementAt (index_); } template unsigned int MSBaseVectorOps::size (const void *pElements_) const { return ((MSTypeData *)pElements_)->size(); } template void MSBaseVectorOps::swapElements (void *data_, unsigned int ind1_, unsigned int ind2_) const { Type *pElements = ((MSTypeData *)data_)->elements(); Type temp (pElements[ind1_]); pElements[ind1_] = pElements[ind2_], pElements[ind2_] = temp; } template unsigned int MSBaseVectorOps::gradeUp (const void *pData_, unsigned int len_, unsigned int *pResult_) const { return msMergeSortUp (len_,((MSTypeData *)pData_)->elements(),pResult_,(unsigned int)0,len_); } template unsigned int MSBaseVectorOps::gradeDown (const void *pData_, unsigned int len_, unsigned int *pResult_) const { return msMergeSortDown (len_,((MSTypeData *)pData_)->elements(),pResult_,(unsigned int)0,len_); } template void * MSBaseVectorOps::badData() const { static Type badValue = ::msBadData(Type()); return (void *) &badValue; } template void * MSBaseVectorOps::defaultFiller() const { static Type filler; return (void *) &filler; } template MSString MSBaseVectorOps::asString (const void *pData_, unsigned int index_) const { return ::msAsString (((MSTypeData *)pData_)->elements()[index_]); } template MSString MSBaseVectorOps::asMSF (const void *pData_, unsigned int index_) const { return ::msAsMSF (((MSTypeData *)pData_)->elements()[index_]); } template unsigned int MSBaseVectorOps::elementLen (const void *pData_, unsigned int index_) const { return ::msVectorElementLength (((MSTypeData *)pData_)->elements()[index_]); } template MSError::ErrorStatus MSBaseVectorOps::setFromMSF (void *pData_, unsigned int index_, const char *pBuf_) const { return ::msSetFromMSF (((MSTypeData *)pData_)->elements()[index_], pBuf_); } template void MSBaseVectorOps::print (const void *pData_, unsigned int index_, ostream & ost_) const { ost_ << ((MSTypeData *)pData_)->elements()[index_] << endl; } template unsigned int MSBaseVectorOps::numElements (const MSString & str_, const char delimiter_) const { return ::msNumElements(((Type*)0),str_,delimiter_); } template void MSBaseVectorOps::setFromMSString(void *pData_, unsigned int vectIndex_, const MSString& str_, unsigned int& startPos_, const char delimiter_) const { ::msVectorSetFromString (((MSTypeData *)pData_)->elements()[vectIndex_], str_,startPos_,delimiter_); } template typename MSBaseVectorOps::Data& MSBaseVectorOps::nullData(void) { MS_SAFE_STATIC_INIT(Data,_nullDataMutex); } #endif // MSBaseTypeVectorIMPLEMENTATION aplus-fsf-4.22/src/MSTypes/MSBuiltinSPick.C0000644000265000001440000000156010772770471014073 #ifndef MSBuiltinSPickIMPLEMENTATION #define MSBuiltinSPickIMPLEMENTATION /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #ifdef MS_NO_INLINES #include #endif // MS_NO_INLINES template MSBuiltinSPick & MSBuiltinSPick::operator= (const MSBuiltinSPick & sPick_) { _pVector->set (_index, (*sPick_._pVector)(sPick_._index)); return *this; } template MSBuiltinSPick & MSBuiltinSPick::operator= (const Type & aScalar_) { _pVector->set (_index, aScalar_); return *this; } #endif //MSBuiltinSPickIMPLEMENTATION aplus-fsf-4.22/src/MSTypes/MSBuiltinTypeVector.C0000644000265000001440000003344210772770471015172 #ifndef MSBuiltinTypeVectorIMPLEMENTATION #define MSBuiltinTypeVectorIMPLEMENTATION /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #if HAVE_IOSTREAM #include #else #include #endif #if HAVE_SSTREAM #include #include #else #include #endif #include #include #ifdef MS_NO_INLINES #include #endif // MS_NO_INLINES #include #ifdef MS_MULTI_THREAD template MSMutex MSBuiltinVector::_operationsMutex; #endif template MSBuiltinVector::MSBuiltinVector() : MSBaseVector > ((MSVectorImpl *)0) { this->_pImpl = new MSBuiltinVectorImpl(&ops(),&ops()); } template MSBuiltinVector::MSBuiltinVector (unsigned int length_) : MSBaseVector > ((MSVectorImpl *)0) { this->_pImpl = new MSBuiltinVectorImpl(&ops(),&ops(),length_); } template MSBuiltinVector::MSBuiltinVector (unsigned int length_, const Type & filler_) : MSBaseVector > ((MSVectorImpl *)0) { this->_pImpl = new MSBuiltinVectorImpl(&ops(),&ops(),length_,(void *)&filler_); } template MSBuiltinVector::MSBuiltinVector (const MSBuiltinVector & vect_) : MSBaseVector > (new MSBuiltinVectorImpl (*(MSBuiltinVectorImpl *)vect_._pImpl)) { } template MSBuiltinVector::MSBuiltinVector (const MSBaseVector > & vect_) : MSBaseVector > (new MSBuiltinVectorImpl (*(MSBuiltinVectorImpl *)((MSBuiltinVector &)vect_)._pImpl)) { } template MSBuiltinVector::MSBuiltinVector (MSBuiltinVectorImpl *pImpl_) : MSBaseVector > (pImpl_) { } template MSBuiltinVector::MSBuiltinVector (const char * pString_) : MSBaseVector > ((MSVectorImpl *)0) { this->_pImpl = new MSBuiltinVectorImpl(&ops(),&ops()); this->_pImpl->setFromString (pString_); } template MSBuiltinVector::MSBuiltinVector (MSTypeData > *pData_, unsigned int len_) : MSBaseVector > ((MSVectorImpl *)0) { this->_pImpl = new MSBuiltinVectorImpl(&ops(),&ops(),pData_,len_); } template MSBuiltinVector::MSBuiltinVector (const Type *pElements_, unsigned int len_) : MSBaseVector > ((MSVectorImpl *)0) { MSTypeData > *pData = MSTypeData >::allocateWithLength (len_); MSTypeData >::copy (pElements_, pData->elements(), len_); this->_pImpl = new MSBuiltinVectorImpl(&ops(),&ops(),pData,len_); } template MSBuiltinVector::~MSBuiltinVector() { } template MSBuiltinVector & MSBuiltinVector::operator= (const MSBuiltinVector & vect_) { return (MSBuiltinVector &) MSBaseVector >::operator= (vect_); } template MSBuiltinVector & MSBuiltinVector::operator= (const MSBaseVector > & vect_) { return (*this = (MSBuiltinVector &)vect_); } template MSBuiltinVector & MSBuiltinVector::operator= (const Type & value_) { return (MSBuiltinVector &) MSBaseVector >::operator= (value_); } template MSBuiltinVector & MSBuiltinVector::random (unsigned long limit_) { unsigned int len=this->_pImpl->length(); if (len>0) { this->_pImpl->prepareToChangeWithoutCopy(); if (limit_==0) limit_=len; MSRandom rand; Type *pData=this->data(); while (len--) { *pData++ = (Type)rand(limit_); } this->changed(); } return *this; } template MSBuiltinVector & MSBuiltinVector::series (unsigned int length_, Type offset_) { this->_pImpl->reallocateInPlace(length_); Type *pData=this->data(); while (length_--) { *pData++ = offset_++; } this->changed(); return *this; } template Type MSBuiltinVector::min() const { unsigned int len=this->_pImpl->length(); if (len==0) return 0; Type *pData=this->data(); Type min=pData[0]; for (unsigned int i=1; i Type MSBuiltinVector::max() const { unsigned int len=this->_pImpl->length(); if (len==0) return 0; Type *pData=this->data(); Type max=pData[0]; for (unsigned int i=1; imax) { max = pData[i]; } } return max; } template double MSBuiltinVector::sum() const { double sum=0.0; unsigned int len=this->_pImpl->length(); Type *pData=this->data(); while (len--) { sum += (double)*pData++; } return sum; } // doMath functions template void MSBuiltinVector::doMath(const Type& value_, MathOp op_) { unsigned int len=this->_pImpl->length(); if (len>0) { Type *pData=this->data(); this->_pImpl->prepareToChangeWithoutCopy(); if (pData==this->data()) // no reallocation was necessary { switch(op_) { case Plus: while (len--) *pData++ += value_; break; case Minus: while (len--) *pData++ -= value_; break; case Divide: while (len--) *pData++ /= value_; break; case Times: while (len--) *pData++ *= value_; break; case Incr: while (len--) ++(*pData++); break; case Decr: while (len--) --(*pData++); break; default: break; } } else // if we had to reallocate { // ASSERTION: pData is still valid Type *pNewData=this->data(); switch(op_) { case Plus: while (len--) *pNewData++ = *pData++ + value_;break; case Minus: while (len--) *pNewData++ = *pData++ - value_;break; case Divide: while (len--) *pNewData++ = *pData++ / value_;break; case Times: while (len--) *pNewData++ = *pData++ * value_;break; case Incr: while (len--) *pNewData++ = *pData++ + 1; break; case Decr: while (len--) *pNewData++ = *pData++ - 1; break; default: break; } } this->changed(); } } template void MSBuiltinVector::doMath(const MSBuiltinVector& vect_, MathOp op_) { unsigned int len=this->_pImpl->length(); assert(len=vect_._pImpl->length()); if (len>0) { Type *pData=this->data(), *pVectData=vect_.data(); this->_pImpl->prepareToChangeWithoutCopy(); if (pData==this->data()) // no reallocation was necessary { switch(op_) { case Plus: while (len--) *pData++ += *pVectData++; break; case Minus: while (len--) *pData++ -= *pVectData++; break; case Divide: while (len--) *pData++ /= *pVectData++; break; case Times: while (len--) *pData++ *= *pVectData++; break; default: break; } } else // if we had to reallocate { // ASSERTION: pData is still valid Type *pNewData=this->data(); switch(op_) { case Plus: while (len--) *pNewData++ = *pData++ + *pVectData++; break; case Minus: while (len--) *pNewData++ = *pData++ - *pVectData++; break; case Divide: while (len--) *pNewData++ = *pData++ / *pVectData++; break; case Times: while (len--) *pNewData++ = *pData++ * *pVectData++; break; default: break; } } this->changed(); } } template MSBuiltinVectorImpl* MSBuiltinVector::doMath(const MSBuiltinVector& vect1_, const MSBuiltinVector& vect2_, MathOp op_) { unsigned int len=vect1_._pImpl->length(); assert (len==vect2_._pImpl->length()); MSBuiltinVectorImpl *pResImpl = (MSBuiltinVectorImpl *)vect1_._pImpl->create(len, vect1_.vectorData()->size()); Type *pData1=vect1_.data(), *pData2=vect2_.data(), *pResData=((MSTypeData > *)pResImpl->data())->elements(); switch(op_) { case Plus: while (len--) *pResData++ = *pData1++ + *pData2++;break; case Minus: while (len--) *pResData++ = *pData1++ - *pData2++;break; case Divide: while (len--) *pResData++ = *pData1++ / *pData2++;break; case Times: while (len--) *pResData++ = *pData1++ * *pData2++;break; default: break; } return pResImpl; } template MSBuiltinVectorImpl* MSBuiltinVector::doMath(const MSBuiltinVector& vect_, const Type& value_, MathOp op_) { unsigned int len=vect_._pImpl->length(); MSBuiltinVectorImpl *pResImpl = (MSBuiltinVectorImpl *)vect_._pImpl->create(len,vect_.vectorData()->size()); Type *pData=vect_.data(), *pResData=((MSTypeData > *)pResImpl->data())->elements(); switch(op_) { case Plus: while (len--) *pResData++ = *pData++ + value_;break; case Minus: while (len--) *pResData++ = *pData++ - value_;break; case Divide: while (len--) *pResData++ = *pData++ / value_;break; case Times: while (len--) *pResData++ = *pData++ * value_;break; case Unary: while (len--) *pResData++ = -*pData++; break; default: break; } return pResImpl; } template MSBuiltinVectorImpl* MSBuiltinVector::doMath(const Type& value_, const MSBuiltinVector& vect_, MathOp op_) { unsigned int len=vect_._pImpl->length(); MSBuiltinVectorImpl *pResImpl = (MSBuiltinVectorImpl *)vect_._pImpl->create(len,vect_.vectorData()->size()); Type *pData=vect_.data(), *pResData=((MSTypeData > *)pResImpl->data())->elements(); switch(op_) { case Plus: while (len--) *pResData++ = value_ + *pData++;break; case Minus: while (len--) *pResData++ = value_ * *pData++;break; case Divide: while (len--) *pResData++ = value_ / *pData++;break; case Times: while (len--) *pResData++ = value_ * *pData++;break; default: break; } return pResImpl; } template #if __GNUC__ < 3 MSBuiltinVector::Operations& MSBuiltinVector::ops(void) #else typename MSBuiltinVector::Operations& MSBuiltinVector::ops(void) #endif { MS_SAFE_STATIC_INIT(Operations,_operationsMutex); } template MSBuiltinVectorOps::MSBuiltinVectorOps() : MSBaseVectorOps >(), MSBuiltinVectorImplOps() { } template MSBuiltinVectorOps::~MSBuiltinVectorOps() { } template void MSBuiltinVectorOps::set (void *pElements_, unsigned int index_, const void *pValue_, MSAllocationFlag) const { ((MSTypeData > *)pElements_)->elements()[index_] = *(Type *)pValue_; } template void MSBuiltinVectorOps::set (void *pDest_, unsigned int destInd_, const void *pSrc_, unsigned int srcInd_, MSAllocationFlag) const { ((MSTypeData > *)pDest_)->elements()[destInd_] = ((MSTypeData > *)pSrc_)->elements()[srcInd_]; } template void MSBuiltinVectorOps::setToNumber (void *pElements_, unsigned int index_, double number_) const { ((MSTypeData > *)pElements_)->elements()[index_] = (Type)number_; } template double MSBuiltinVectorOps::getAsNumber (const void *pElements_, unsigned int index_) const { return (double)((MSTypeData > *)pElements_)->elements()[index_]; } template #if HAVE_SSTREAM void MSBuiltinVectorOps::readFromStream (void *pData_, unsigned int index_, istringstream & ist) const #else void MSBuiltinVectorOps::readFromStream (void *pData_, unsigned int index_, istrstream & ist) const #endif { ist >> ((MSTypeData > *)pData_)->elements()[index_]; } template #if HAVE_SSTREAM void MSBuiltinVectorOps::writeToStream (const void *pData_, unsigned int index_, ostringstream & ost) const #else void MSBuiltinVectorOps::writeToStream (const void *pData_, unsigned int index_, ostrstream & ost) const #endif { ost << ((MSTypeData > *)pData_)->elements()[index_]; } template #if HAVE_SSTREAM void MSBuiltinVectorOps::whitespace (istringstream & ist) const #else void MSBuiltinVectorOps::whitespace (istrstream & ist) const #endif { static Type t; ::whitespace (t, ist); } template unsigned int MSBuiltinVectorOps::stringLen (const char *pString_) const { static Type t; return ::stringLen (t, pString_); } template void MSBuiltinVectorOps::print (const void *pData_, unsigned int index_, ostream & stream_) const { ::msOutputItem( ((MSTypeData > *)pData_)->elements()[index_],stream_); } template void * MSBuiltinVectorOps::defaultFiller() const { static Type filler =0; return (void *) &filler; } template #if HAVE_SSTREAM void whitespace (const Type &, istringstream &) #else void whitespace (const Type &, istrstream &) #endif { } #endif // MSBuiltinTypeVectorIMPLEMENTATION aplus-fsf-4.22/src/MSTypes/MSFloatSPick.C0000644000265000001440000000133010772770471013525 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #ifdef MS_NO_INLINES #include #endif // MS_NO_INLINES MSBuiltinSPick & MSBuiltinSPick::operator= (const MSBuiltinSPick & sPick_) { _pVector->set (_index, (*sPick_._pVector)(sPick_._index)); return *this; } MSBuiltinSPick & MSBuiltinSPick::operator= (const double & aScalar_) { _pVector->set (_index, aScalar_); return *this; } aplus-fsf-4.22/src/MSTypes/MSGenericVector.C0000644000265000001440000005331710772770471014301 #ifndef MSGenericVectorIMPLEMENTATION #define MSGenericVectorIMPLEMENTATION /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include // define UINT_MAX for the merge sort routines #if HAVE_IOSTREAM #include #else #include #endif #include // define compareElements() method #include #include #ifdef MS_NO_INLINES #include #endif // MS_NO_INLINES #ifdef MS_MULTI_THREAD template MSMutex MSGenericVector::_operationsMutex; template MSMutex MSGenericVectorOps::_nullDataMutex; #endif template MSGenericVector::MSGenericVector() { _pImpl = new MSVectorImpl(&ops()); } template MSGenericVector::MSGenericVector (const MSGenericVector & vect_) : _pImpl (new MSVectorImpl (*vect_._pImpl)) { } template MSGenericVector::MSGenericVector (unsigned int length_) { _pImpl = new MSVectorImpl(&ops(), length_); } template MSGenericVector::MSGenericVector (unsigned int length_, const Type & filler_) { _pImpl = new MSVectorImpl(&ops(), length_, (void *)&filler_); } template MSGenericVector::MSGenericVector (MSGenericData *pData_, unsigned int len_) { _pImpl = new MSVectorImpl(&ops(), (void *)pData_, len_); } template MSGenericVector::MSGenericVector (const Type *pElements_, unsigned int len_) { MSGenericData *pData = MSGenericData::allocateWithLength (len_, MSRaw); MSGenericData::copy (pElements_, pData->elements(), len_, MSRaw); _pImpl = new MSVectorImpl(&ops(), (void *)pData, len_); } template MSGenericVector::MSGenericVector (MSVectorImpl *pImpl_) : _pImpl (pImpl_) { } template MSGenericVector::~MSGenericVector() { delete _pImpl; } template MSGenericVector & MSGenericVector::operator= (const MSGenericVector & vect_) { if (this != &vect_) *_pImpl = *vect_._pImpl; return *this; } template MSGenericVector & MSGenericVector::operator= (const Type & value_) { _pImpl->setAll ((void *)&value_); return *this; } template MSString MSGenericVector::asDebugInfo() const { MSString result ("MSGenericVector"); return result << "(@" << MSString((unsigned long)this).d2x().lowerCase() << ",_elements=" << ((MSGenericData *)_pImpl->data())->asDebugInfo() << ",_size=" << MSString(size()) << ",_length=" << MSString(length()); } template MSError::ErrorStatus MSGenericVector::set (unsigned int index_, const Type & value_) { if (index_ < _pImpl->length()) { _pImpl->set (index_, (void *)&value_); return MSError::MSSuccess; } else { _pImpl->vectorIndexError (index_); return MSError::MSFailure; } } template MSGenericVector & MSGenericVector::insertAt (unsigned int index_, const Type & value_) { if (index_ == _pImpl->length()) // NEW FEATURE: insert right after the last element return append (value_); // if inserting inside the vector _pImpl->insertAt (index_, (void *) &value_); return *this; } template MSGenericVector & MSGenericVector::insertAt (unsigned int index_, const MSGenericVector & vect_) { if (index_ == _pImpl->length()) // NEW FEATURE: insert right after the last element return append (vect_); // if inserting inside the vector _pImpl->insertAt (index_, *vect_._pImpl); return *this; } template MSGenericVector MSGenericVector::reverse (const MSGenericVector & vect_) { MSVectorImpl *pImpl = (MSVectorImpl *)vect_._pImpl->create(); pImpl->reverse (*vect_._pImpl); return MSGenericVector (pImpl); } template MSGenericVector MSGenericVector::rotate (const MSGenericVector & vect_, int amount_) { MSVectorImpl *pImpl = (MSVectorImpl *)vect_._pImpl->create(); pImpl->rotate (*vect_._pImpl, amount_); return MSGenericVector (pImpl); } template MSGenericVector MSGenericVector::take (const MSGenericVector & vect_, int numEls_) { MSVectorImpl *pImpl = (MSVectorImpl *)vect_._pImpl->create(); pImpl->take (*vect_._pImpl, numEls_); return MSGenericVector (pImpl); } template MSGenericVector MSGenericVector::take (const MSGenericVector & vect_, int numEls_, const Type & filler_) { MSVectorImpl *pImpl = (MSVectorImpl *)vect_._pImpl->create(); pImpl->take (*vect_._pImpl, numEls_, (void *)&filler_); return MSGenericVector (pImpl); } template MSGenericVector MSGenericVector::drop (const MSGenericVector & vect_, int numEls_) { MSVectorImpl *pImpl = (MSVectorImpl *)vect_._pImpl->create(); pImpl->drop (*vect_._pImpl, numEls_); return MSGenericVector (pImpl); } template MSGenericVector MSGenericVector::select (const MSGenericVector & vect_, const MSIndexVector & iVect_) { MSVectorImpl *pImpl = (MSVectorImpl *)vect_._pImpl->create(); pImpl->select (*vect_._pImpl, iVect_); return MSGenericVector (pImpl); } template MSGenericVector MSGenericVector::compress (const MSGenericVector & vect_, const MSBinaryVector & bVect_) { MSVectorImpl *pImpl = (MSVectorImpl *)vect_._pImpl->create(); pImpl->compress (*vect_._pImpl, bVect_); return MSGenericVector (pImpl); } template Type & MSGenericVector::elementAt (unsigned int index_) { // We call prepareToChange() here because we are, in part, releasing control of the vector's element. // By making sure that this vector contains a unique copy of the data, we avoid some unpleasant situations. // For example, consider the case when we don't provide any safeguards, but simply return the reference to the // element here: // // MSGenericVector vect1(5,0), vect2(10,1); // vect1 = vect2; // vect1[0] = 2; // // After this piece of code is executed, both vect1[0] and vect2[0] have the value of 2, since they are actually // referring to the same location in memory. The expected result would be that only vect1[0]==2, but vect2[0]==1. // #if !defined(MS_NO_INDEX_ERROR) if (index_ >= _pImpl->length()) { _pImpl->vectorIndexError (index_); return *(Type *)ops().badData(); } else #endif //MS_NO_INDEX_ERROR if (((MSGenericData *)_pImpl->data())->refCount() > 1) _pImpl->makeUniqueCopy(); return ((MSGenericData *)_pImpl->data())->elements()[index_]; } template typename MSGenericVector::Operations& MSGenericVector::ops(void) { MS_SAFE_STATIC_INIT(Operations,_operationsMutex); } template ostream& operator<<(ostream& stream_, const MSGenericVector& vect_) { // We implement this friend function here rather than go through MSVectorImpl to avoid // imposing a restriction on the element class that it must implement stream operator<<(). // See the comment in MSGenericVectorOps::print() method. // unsigned int len = vect_.length(); Type *pData = vect_.elements(); for (unsigned int i=0; i MSGenericVectorOps::MSGenericVectorOps() { } template MSGenericVectorOps::~MSGenericVectorOps() { } template void * MSGenericVectorOps::allocate (unsigned int length_, unsigned int numToConstruct_, MSAllocationFlag flag_) const { if (length_ > 0) { return MSGenericData::allocateWithLength (length_, flag_, numToConstruct_); } else // length_ == 0 { return nullData().incrementCount(); } } template void * MSGenericVectorOps::allocateWithSize (unsigned int size_, unsigned int numToConstruct_, MSAllocationFlag flag_) const { if (size_ > 0) { return MSGenericData::allocateWithSize (size_, flag_, numToConstruct_); } else // size_ == 0 { return nullData().incrementCount(); } } template void MSGenericVectorOps::deallocate (void *data_, unsigned int numToDestroy_, MSAllocationFlag flag_) const { ((MSGenericData *)data_)->decrementCount (flag_, numToDestroy_); } template void MSGenericVectorOps::incrementCount (void *data_) const { ((MSGenericData *)data_)->incrementCount(); } template unsigned int MSGenericVectorOps::refCount (const void *data_) const { return ((MSGenericData *)data_)->refCount(); } template void MSGenericVectorOps::set (void *data_, unsigned int index_, const void *pValue_, MSAllocationFlag flag_) const { ((MSGenericData *)data_)->set (index_, *(Type *)pValue_, flag_); } template void MSGenericVectorOps::set (void *pDest_, unsigned int destInd_, const void *pSrc_, unsigned int srcInd_, MSAllocationFlag flag_) const { ((MSGenericData *)pDest_)->set (destInd_, ((MSGenericData *)pSrc_)->elements()[srcInd_], flag_); } template void MSGenericVectorOps::fill (void *pElements_, unsigned int start_, unsigned int numToFill_, const void *pValue_, MSAllocationFlag flag_) const { Type *pStart = ((MSGenericData *)pElements_)->elements() + start_; if (pValue_) MSGenericData::fill (pStart, numToFill_, *(Type *)pValue_, flag_); else MSGenericData::fill (pStart, numToFill_, *(Type *)defaultFiller(), flag_); } template void MSGenericVectorOps::copy (const void *src_, void *dest_, unsigned int length_, unsigned int srcInd_, unsigned int destInd_, MSAllocationFlag flag_) const { MSGenericData::copy (((MSGenericData *)src_)->elements() + srcInd_, ((MSGenericData *)dest_)->elements() + destInd_, length_, flag_); } template void MSGenericVectorOps::copyBackward (void *pElements_, unsigned int src_, unsigned int dest_, unsigned int numToCopy_) const { Type *pElements = ((MSGenericData *)pElements_)->elements(); MSGenericData::copyBackward (pElements+src_, pElements+dest_, numToCopy_); } template void MSGenericVectorOps::destroy (void *pElements_, unsigned int start_, unsigned int numEls_) const { // This is an obscure problem occurring only with DCC compiler on SGI. Calling MSGenericData::destroyElements() to destroy // numEls_ elements of the vector apparently corrupts the stack somehow. The simplest example is creating // a string vector of 10 elements and doing removeAt(0). The program segv's soon after the removeAt() call. // However, if I do not call destroyElements(), but put the same code HERE (destroying each element individually), // everything works fine. Everything also works fine with all the other compilers (lcc, lexa, xlC), and // Purify displays no run-time errors (which would usually account for the stack corruption -- such as // out-of-bounds array read/write). // #if !defined(MS_TEMPLATE_TYPE_DESTROY_BUG) MSGenericData::destroyElements(((MSGenericData *)pElements_)->elements()+start_, numEls_); #else Type *pData = ((MSGenericData *)pElements_)->elements() + start_; MSAllocator alloc; while (numEls_--) { alloc.destroy(pData++); } #endif //__sgi } template MSError::ErrorStatus MSGenericVectorOps::setFromString (void *, unsigned int, const char *) const { return MSError::MSFailure; } template int MSGenericVectorOps::isElementEqual (const void *pElements_, unsigned int index_, const void *pValue_) const { return (::compareElements(((MSGenericData *)pElements_)->elements()[index_],*(Type *)pValue_)==0); } template int MSGenericVectorOps::isElementLess (const void *pElements_, unsigned int index_, const void *pValue_) const { return (::compareElements(((MSGenericData *)pElements_)->elements()[index_],*(Type *)pValue_) < 0); } template int MSGenericVectorOps::isElementLessEqual (const void *pElements_, unsigned int index_, const void *pValue_) const { return (::compareElements(((MSGenericData *)pElements_)->elements()[index_],*(Type *)pValue_) <= 0); } template long MSGenericVectorOps::compareElement (const void *data_, unsigned int index_, const void *value_) const { return ::compareElements (((MSGenericData *)data_)->elements()[index_], *(Type *)value_); } template void * MSGenericVectorOps::elementAt (const void *pElements_, unsigned int index_) const { return & ((MSGenericData *)pElements_)->elementAt (index_); } template unsigned int MSGenericVectorOps::size (const void *pElements_) const { return ((MSGenericData *)pElements_)->size(); } template void MSGenericVectorOps::swapElements (void *data_, unsigned int ind1_, unsigned int ind2_) const { Type *pElements = ((MSGenericData *)data_)->elements(); Type temp (pElements[ind1_]); pElements[ind1_] = pElements[ind2_], pElements[ind2_] = temp; } template unsigned int MSGenericVectorOps::gradeUp (const void *pData_, unsigned int len_, unsigned int *pResult_) const { return mergeSortUp (len_, ((MSGenericData *)pData_)->elements(), pResult_, 0, len_); } template unsigned int MSGenericVectorOps::gradeDown (const void *pData_, unsigned int len_, unsigned int *pResult_) const { return mergeSortDown (len_, ((MSGenericData *)pData_)->elements(), pResult_, 0, len_); } template void *MSGenericVectorOps::badData() const { static Type badData; return (void *)&badData; } template void *MSGenericVectorOps::defaultFiller() const { static Type filler; return (void *)&filler; } template MSString MSGenericVectorOps::asString (const void *, unsigned int) const { return MSString(); } template MSString MSGenericVectorOps::asMSF (const void *, unsigned int) const { return MSString(); } template unsigned int MSGenericVectorOps::elementLen (const void *, unsigned int) const { return 0; } template MSError::ErrorStatus MSGenericVectorOps::setFromMSF (void *, unsigned int, const char *) const { return MSError::MSFailure; } template void MSGenericVectorOps::print(const void *, unsigned int, ostream&) const { // This function is empty here because we don't go through MSVectorImpl to print MSGenericVector to // a stream. We implement printing the vector (looping over the elements) in MSGenericVector itself. // This was done in order to avoid calling the friend ostream operator<<() with the element Type: // we don't want to impose a restriction that the element Type class of MSGenericVector must implement // ostream operator<<() friend function. This way, if the application never uses the vector's stream // operator<<(), then it is not instantiated and the application is still be able use MSGenericVector // even though the element class may not support ostream operator<<(). } template unsigned int MSGenericVectorOps::numElements (const MSString &, const char) const { return 0; } template void MSGenericVectorOps::setFromMSString (void *, unsigned int, const MSString &, unsigned int&, const char) const { } template unsigned MSGenericVectorOps::mergeSortUp (unsigned n_,Type *sp_,unsigned *p_,unsigned low_,unsigned high_) { unsigned t,m=(low_+high_+1)>>1; if (high_==m) {p_[low_]=UINT_MAX;return low_;} high_=mergeSortUp(n_,sp_,p_,m,high_); low_=mergeSortUp(n_,sp_,p_,low_,m); if (indexCompareUp(sp_,high_,low_)) {m=low_;low_=high_;high_=m;} for (t=low_;;low_=p_[low_]=high_,high_=m) { L:m=p_[low_]; if (UINT_MAX==m) {p_[low_]=high_;return t;} if (indexCompareUp(sp_,m,high_)) {low_=m;goto L;} } } template unsigned MSGenericVectorOps::mergeSortDown (unsigned n_,Type *sp_,unsigned *p_,unsigned low_,unsigned high_) { unsigned t,m=(low_+high_+1)>>1; if (high_==m) {p_[low_]=UINT_MAX;return low_;} high_=mergeSortDown(n_,sp_,p_,m,high_); low_=mergeSortDown(n_,sp_,p_,low_,m); if (indexCompareDown(sp_,high_,low_)) {m=low_;low_=high_;high_=m;} for (t=low_;;low_=p_[low_]=high_,high_=m) { L:m=p_[low_]; if (UINT_MAX==m) {p_[low_]=high_;return t;} if (indexCompareDown(sp_,m,high_)) {low_=m;goto L;} } } template typename MSGenericVectorOps::Data& MSGenericVectorOps::nullData(void) { MS_SAFE_STATIC_INIT(Data,_nullDataMutex); } template MSGenericData::MSGenericData (unsigned int size_) : MSData (size_) { } template MSGenericData::~MSGenericData() { } template MSString MSGenericData::asDebugInfo() const { MSString result ("MSGenericData(@"); result += MSString((unsigned long)this).d2x().lowerCase(); result += ",_data="; result += MSString((unsigned long)elements()).d2x().lowerCase(); result += ",_refCount="; result += MSString(refCount()); result += ")"; return result; } template void MSGenericData::constructElements(Type *pElements_, unsigned int numToConstruct_, const Type & value_) { MSAllocator alloc; while (numToConstruct_--) { alloc.construct(pElements_++, value_); } } template void MSGenericData::destroyElements(Type *pElements_, unsigned int numToDestroy_) { MSAllocator alloc; while (numToDestroy_--) { alloc.destroy(pElements_++); } } template void * MSGenericData::operator new(size_t, unsigned int numEls_) { // The data elements are going to be allocated right after the end of MSData structure (padded for // possible alignment). We need to allocate memory for everything in MSData (including possible // padding) plus everything for the data elements (number of elements times size of each one). // // We cannot just use sizeof(MSData) in the computation of the total size because we need to know // how it would be aligned given that it's followed by an array of elements of type Type. Instead, // we call the function dataOffset(), which will return where the data elements part starts, including // the alignment padding, which is equivalent to the real size of MSData. // MSAllocator alloc; return alloc.allocate(dataOffset() + numEls_*sizeof(Type)); } template void MSGenericData::operator delete(void *p_) { MSAllocator alloc; alloc.deallocate((Type *)p_); } template void MSGenericData::set (unsigned int index_, const Type & value_, MSAllocationFlag flag_) { if (flag_ == MSConstructed) { elements()[index_] = value_; } else // if (flag_==MSRaw) { MSAllocator alloc; alloc.construct(elements()+index_, value_); } } template void MSGenericData::fill (Type *pElements_, unsigned int length_, const Type & value_, MSAllocationFlag flag_) { if (flag_ == MSConstructed) { while (length_--) { *pElements_++ = value_; } } else // if (flag_==MSRaw) --> elements haven't been constructed yet { constructElements(pElements_, length_, value_); } } template void MSGenericData::copy (const Type *pSrc_, Type *pDest_, unsigned int length_, MSAllocationFlag flag_) { if (flag_ == MSConstructed) { while (length_--) { *pDest_++ = *pSrc_++; } } else // if (flag_==MSRaw) --> elements haven't been constructed yet { MSAllocator alloc; while (length_--) { alloc.construct(pDest_++, *pSrc_++); } } } template void MSGenericData::copyBackward (const Type *pSrc_, Type *pDest_, unsigned int length_) { // ASSERTION: elements in pSrc_ have been constructed while (length_--) *pDest_-- = *pSrc_--; } template MSGenericData *MSGenericData::allocateWithLength (unsigned int length_, MSAllocationFlag flag_, unsigned int numToConstruct_) { return MSGenericData::allocateWithSize (MSData::computeSize(length_), flag_, numToConstruct_); } template MSGenericData *MSGenericData::allocateWithSize (unsigned int size_, MSAllocationFlag flag_, unsigned int numToConstruct_) { MSGenericData *pData = new (size_) MSGenericData (size_); if (isGenericConstructionNeeded((Type *)0)==MSTrue) // default construction is *not* needed for built-in types { if (flag_ == MSConstructed) { constructElements(pData->elements(), size_, Type()); // default-construct all elements } else // if (flag_==MSRaw) { // default-construct first numToConstruct_ elements // constructElements(pData->elements(), numToConstruct_, Type()); } } return pData; } template void MSGenericData::deallocate (MSAllocationFlag flag_, unsigned int numToDestroy_) { if (isGenericDestructionNeeded((Type *)0)==MSTrue) // destruction is *not* needed for built-in types { if (flag_ == MSConstructed) { destroyElements(elements(), size()); } else // if (flag_==MSRaw) { destroyElements(elements(), numToDestroy_); } } delete this; } #endif // MSGenericVectorIMPLEMENTATION aplus-fsf-4.22/src/MSTypes/MSIHashKeySet.C0000644000265000001440000003455110772770471013662 #ifndef MSIHashKeySetIMPLEMENTATION #define MSIHashKeySetIMPLEMENTATION /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997 -2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// // helps us guarantee that the hash table size is a power of 2 // thus,we can value&(size-1) for the hash value,which is // faster than value%size #include inline unsigned computeHashSize(unsigned requestedSize_) { unsigned newSize=1; while (newSize MSIHashKeySet:: MSIHashKeySet(unsigned long n) { createHashtable(::computeHashSize(n)); } template MSIHashKeySet:: MSIHashKeySet(MSIHashKeySet const& h) { createHashtable(h.ivNoEntries); copyHashtable(h); } template MSIHashKeySet:: ~MSIHashKeySet() { removeAll(); ivOps.removeBlock(ivTable,ivNoEntries*sizeof(Node*)); ivOps.removeBlock(ivCollList,ivNoEntries*sizeof(unsigned long)); } template MSIHashKeySet& MSIHashKeySet:: operator=(MSIHashKeySet const& h) { if (this!=&h) { removeAll(); copyHashtable(h); } return *this; } template MSBoolean MSIHashKeySet:: add(Element const& element,unsigned long hashvalue,MSIHashKeySet::Cursor& cursor) { Node* node=ivOps.newNode(element); if (ivTable[hashvalue]!=0) { ivCollList[hashvalue]++; } // // link element in bucket // node->ivNext=ivTable[hashvalue]; ivTable[hashvalue]=node; ivNoElements++; // // Let cursor point to newly added element // cursor.ivEntryNumber=hashvalue; cursor.ivNode=node; if (ivNoEntries*2 MSBoolean MSIHashKeySet:: add(Element const& element,unsigned long hashvalue) { Node* node=ivOps.newNode(element); if (ivTable[hashvalue]!=0) { ivCollList[hashvalue]++; } // // link element in bucket // node->ivNext=ivTable[hashvalue]; ivTable[hashvalue]=node; ivNoElements++; if (ivNoEntries*2 void MSIHashKeySet:: addAllFrom(MSIHashKeySet const& hashtable) { MSICollectionCheck( (this!=&hashtable) ,"identical collection") Cursor c(*this); for (unsigned long i=0;iivNext; } } return; } template Element const& MSIHashKeySet:: anyElement() const { Cursor cursor(*this); setToFirst(cursor); return ivOps.elementAt(cursor.ivNode); } template void MSIHashKeySet:: removeAt(MSIHashKeySet::Cursor const& cursor) { if (cursor.ivNode==ivTable[cursor.ivEntryNumber]) { // // remove first element in a bucket. // ivTable[cursor.ivEntryNumber]=cursor.ivNode->ivNext; } else { // // remove element somewhere in bucket,find previous // Node* prev=ivTable[cursor.ivEntryNumber]; while (prev->ivNext!=cursor.ivNode) { // // find previous of element // prev=prev->ivNext; } // // link next of previous to next of element to remove // prev->ivNext=cursor.ivNode->ivNext; } ivOps.deleteNode(cursor.ivNode); ivNoElements--; if (ivCollList[cursor.ivEntryNumber] > 0) { ivCollList[cursor.ivEntryNumber]--; } return; } template unsigned long MSIHashKeySet:: removeAll(void* predicate,void* env) { Cursor c,next; unsigned long removed=0; for (setToFirst(c),setToFirst(next);c.ivNode!=0;c=next) { setToNext(next); if (ivOps.constantFunctionIteration(predicate,env,c.ivNode)) { removeAt(c); removed++; } } return removed; } template void MSIHashKeySet:: removeAll() { for (unsigned long i=0;iivNext; ivOps.deleteNode(tmp1); tmp1=tmp2; } ivTable[i]=0; ivCollList[i]=0; } ivNoElements=0; return; } template MSBoolean MSIHashKeySet:: setToFirst(MSIHashKeySet::Cursor& cursor) const { cursor.ivEntryNumber=0; if (isEmpty()) { // // setToFirst will return very fast on an empty hashtable // cursor.ivNode=0; } else { // // find first non-empty bucket // while (ivTable[cursor.ivEntryNumber]==0 && cursor.ivEntryNumber MSBoolean MSIHashKeySet:: setToNext(MSIHashKeySet::Cursor& cursor) const { cursor.ivNode=cursor.ivNode->ivNext; if (cursor.ivNode==0) { // // end of the bucket, // try to find new non-empty bucket // while (cursor.ivEntryNumber MSBoolean MSIHashKeySet:: containsElementWithKey(Key const& key,unsigned long hashvalue) const { Cursor cursor(*this); return locateElementWithKey(key,hashvalue,cursor); } template MSBoolean MSIHashKeySet:: containsAllKeysFrom(MSIHashKeySet const& hashtable) const { Cursor cursor(*this); if (hashtable.setToFirst(cursor)) { Key const* key; do { key=&ivOps.keyAt(cursor.ivNode); } while (containsElementWithKey(*key,ivOps.getHashvalue(*key,ivNoEntries)) && hashtable.setToNext(cursor)); } return cursor.ivNode==0?MSTrue:MSFalse; } template unsigned long MSIHashKeySet:: numberOfElementsWithKey(Key const& key,unsigned long hashvalue) const { unsigned long n; Cursor cursor(*this); if (locateElementWithKey(key,hashvalue,cursor)) { n=1; while (locateNextElementWithKey(key,hashvalue,cursor)) { n++; } } else { n=0; } return n; } template MSBoolean MSIHashKeySet:: locateElementWithKey(Key const& key,unsigned long hashvalue,Node *& pNode) const { pNode=ivTable[hashvalue]; // while element available and key not equal to argument key try next one while (!(pNode==0 || ivOps.isKeyEqualToKey(pNode,key))) pNode=pNode->ivNext; return pNode!=0?MSTrue:MSFalse; } template MSBoolean MSIHashKeySet:: replaceElementWithKey(Element const& element,unsigned long hashvalue,MSIHashKeySet::Cursor& cursor) { MSBoolean rv; if (locateElementWithKeyOfElement(element,hashvalue,cursor)) { replaceAt(cursor,element); rv=MSTrue; } else { rv=MSFalse; } return rv; } template MSBoolean MSIHashKeySet:: replaceElementWithKey(Element const& element,unsigned long hashvalue) { MSBoolean rv; Cursor cursor(*this); if (locateElementWithKeyOfElement(element,hashvalue,cursor)) { replaceAt(cursor,element); rv=MSTrue; } else { rv=MSFalse; } return rv; } template MSBoolean MSIHashKeySet:: locateOrAddElementWithKey(Element const& element,unsigned long hashvalue,MSIHashKeySet::Cursor& cursor) { MSBoolean rv=locateElementWithKeyOfElement(element,hashvalue,cursor); if (!rv) add(element,hashvalue,cursor); return rv; } template MSBoolean MSIHashKeySet:: locateOrAddElementWithKey(Element const& element,unsigned long hashvalue) { Cursor cursor(*this); MSBoolean rv=locateElementWithKeyOfElement(element,hashvalue,cursor); if (!rv) add(element,hashvalue); return rv; } template MSBoolean MSIHashKeySet:: addOrReplaceElementWithKey(Element const& element,unsigned long hashvalue,MSIHashKeySet::Cursor& cursor) { MSBoolean rv; if (locateElementWithKeyOfElement(element,hashvalue,cursor)) { replaceAt(cursor,element); rv=MSFalse; } else { rv=add(element,hashvalue,cursor); rv=MSTrue; } return rv; } template MSBoolean MSIHashKeySet:: addOrReplaceElementWithKey(Element const& element,unsigned long hashvalue) { MSBoolean rv; Cursor cursor(*this); if (locateElementWithKeyOfElement(element,hashvalue,cursor)) { replaceAt(cursor,element); rv=MSFalse; } else { rv=add(element,hashvalue); rv=MSTrue; } return rv; } template MSBoolean MSIHashKeySet:: removeElementWithKey(Key const& key,unsigned long hashvalue) { MSBoolean rv; Cursor cursor(*this); if (locateElementWithKey(key,hashvalue,cursor)) { removeAt(cursor); rv=MSTrue; } else { rv=MSFalse; } return rv; } template Element const& MSIHashKeySet:: elementWithKey(Key const& key,unsigned long hashvalue) const { Node *pNode=ivTable[hashvalue]; // while element available and key not equal to argument key, // try next one while (!(pNode==0||ivOps.isKeyEqualToKey(pNode,key))) pNode=pNode->ivNext; MSICollectionCheck(pNode,"key not contained"); return ivOps.elementAt(pNode); } template Element& MSIHashKeySet:: elementWithKey(Key const& key,unsigned long hashvalue) { Node *pNode=ivTable[hashvalue]; // while element available and key not equal to argument key, // try next one while (!(pNode==0||ivOps.isKeyEqualToKey(pNode,key))) pNode=pNode->ivNext; MSICollectionCheck(pNode,"key not contained"); return ivOps.elementAt(pNode); } template MSBoolean MSIHashKeySet:: locateNextElementWithKey(Key const& key,unsigned long,MSIHashKeySet::Cursor& cursor) const { do { cursor.ivNode=cursor.ivNode->ivNext; } while (!(cursor.ivNode==0 || ivOps.isKeyEqualToKey(cursor.ivNode,key))); return cursor.ivNode!=0?MSTrue:MSFalse; } template unsigned long MSIHashKeySet:: removeAllElementsWithKey(Key const& key,unsigned long hashvalue) { Cursor cursor,next; unsigned long count=0; cursor.ivEntryNumber=hashvalue; cursor.ivNode=ivTable[cursor.ivEntryNumber]; if (cursor.ivNode!=0) { next=cursor; do { setToNext(next); if (ivOps.isKeyEqualToKey(cursor.ivNode,key)) { removeAt(cursor); count++; } cursor=next; } while (cursor.ivNode!=0 && cursor.ivEntryNumber==hashvalue); } return count; } template unsigned long MSIHashKeySet:: numberOfDifferentKeys() const { Cursor c(*this); unsigned long result=0; for (setToFirst(c);c.ivNode!=0;setToNextWithDifferentKey(c)) result++; return result; } template MSBoolean MSIHashKeySet:: setToNextWithDifferentKey(MSIHashKeySet::Cursor& cursor) const { Key const& key=ivOps.keyAt(cursor.ivNode); do { setToNext(cursor); } while (cursor.ivNode!=0 && ivOps.isKeyEqualToKey(cursor.ivNode,key)); return cursor.ivNode!=0?MSTrue:MSFalse; } // // PRIVATE methods // template void MSIHashKeySet:: createHashtable(unsigned long noEntries) { if (noEntries==0) noEntries=1; ivNoElements=0; ivNoEntries=0; // in case newBlock() fails ivTable =(Node**) 0; ivTable =(Node**) ivOps.newBlock(noEntries*sizeof(Node*)); ivNoEntries=noEntries; // in case newBlock() fails ivCollList =(unsigned long*) 0; ivCollList =(unsigned long*) ivOps.newBlock(ivNoEntries*sizeof(unsigned long)); for (unsigned long i=0;i void MSIHashKeySet:: copyHashtable(MSIHashKeySet const& hashtable) { if (ivNoEntries==hashtable.ivNoEntries) { // // copy contents of bucket table and collision list // for (unsigned long i=0;iivNext=ivTable[i]; ivTable[i]=node; tmpNode=tmpNode->ivNext; } } ivNoElements=hashtable.ivNoElements; } else { // // add per element, // hashvalue has to be computed for every element // addAllFrom(hashtable); } return; } template void MSIHashKeySet:: resize(Node *newNode,unsigned long& newHashvalue) { MSIHashKeySet old(0,0); // call to private constructor old.ivOps=ivOps; old.ivNoEntries=ivNoEntries; old.ivNoElements=ivNoElements; old.ivTable=ivTable; old.ivCollList=ivCollList; createHashtable(ivNoEntries*2); for (unsigned long i=0;iivNext; unsigned long hashvalue=ivOps.getHashvalue(ivOps.keyAt(node),ivNoEntries); if (node==newNode) newHashvalue=hashvalue; if (ivTable[hashvalue]!=0) ivCollList[hashvalue]++; node->ivNext=ivTable[hashvalue]; ivTable[hashvalue]=node; ivNoElements++; } } } #endif aplus-fsf-4.22/src/MSTypes/MSISequence.C0000644000265000001440000001654210772770471013422 #ifndef MSISequenceIMPLEMENTATION #define MSISequenceIMPLEMENTATION /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997 -2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// #include template < class Element > MSISequence ::MSISequence (unsigned long) { ivFirst = 0; ivLast = 0; ivNumberOfElements = 0; } template < class Element > MSISequence ::MSISequence (const MSISequence & sequence) { ivFirst = 0; ivLast = 0; ivNumberOfElements = 0; addAllFrom (sequence); } template < class Element > MSISequence ::~MSISequence () { removeAll (); } template MSISequence & MSISequence ::operator=(MSISequence < Element> const& sequence) { if (&sequence != this) { removeAll (); addAllFrom (sequence); } return *this; } template < class Element > void MSISequence ::addAllFrom (MSISequence < Element> const& sequence) { MSICollectionCheck( (this!=&sequence),"identical collection") for (Node *node = sequence.ivFirst; node != 0; node = node->ivNext) { addAsLast (ivOps.newNode (node)); } } template < class Element > MSBoolean MSISequence ::setToFirst (MSISequence ::Node*& node) const { node = ivFirst; return MSBoolean(node!=0); } template < class Element > MSBoolean MSISequence ::setToNext (MSISequence ::Node*& node) const { node = node->ivNext; return MSBoolean(node != 0); } template < class Element > MSBoolean MSISequence ::setToLast (MSISequence ::Node*& node) const { node = ivLast; return MSBoolean(node != 0); } template < class Element > MSBoolean MSISequence ::setToPrevious (MSISequence ::Node*& node) const { node = node->ivPrevious; return MSBoolean(node != 0); } template < class Element > unsigned long MSISequence < Element>:: removeAll (MSBoolean (*predicate) (Element const&, void*), void* env) { Node *current, *next; unsigned long removed = 0; for (setToFirst (current), setToFirst (next); current != 0; current = next) { setToNext (next); if (ivOps.constantFunctionIteration((void*)predicate, env, current)) { removeAt (current); removed++; } } return removed; } template void MSISequence ::removeAll () { Node *node2; for (Node *node1 = ivFirst; node1 != 0; node1 = node2) { node2 = node1->ivNext; ivOps.deleteNode (node1); } ivFirst = 0; ivLast = 0; ivNumberOfElements = 0; } template MSBoolean MSISequence :: allElementsDo (MSBoolean (*function) (Element&, void*), void* env) { for (Node *node = ivFirst; node != 0; node = node->ivNext) { if (! ivOps.functionIteration ((void*)function, env, node)) return MSFalse; } return MSTrue; } template inline MSBoolean MSISequence :: allElementsDo (MSBoolean (*function) (Element const&, void*),void* env) const { for (Node *node = ivFirst; node != 0; node = node->ivNext) { if ( !ivOps.constantFunctionIteration ((void *)function, env, node)) return MSFalse; } return MSTrue; } template inline MSBoolean MSISequence ::isConsistent () const { unsigned long nrOfElm = 0; if (ivFirst != 0 && ivFirst->ivPrevious != 0) return MSFalse; for (Node *n = ivFirst; n != 0; n = n->ivNext) { if (n->ivNext != 0 && n->ivNext->ivPrevious != n) return MSFalse; nrOfElm++; } return MSBoolean(nrOfElm==ivNumberOfElements); } template void MSISequence ::removeFirst () { checkNotEmpty (); Node* node; setToFirst (node); removeAt (node); } template void MSISequence ::removeLast () { checkNotEmpty (); Node* node; setToLast (node); removeAt (node); } template void MSISequence::removeAt (MSISequence::Node* node) { if (node == ivFirst) ivFirst = node->ivNext; if (node == ivLast) ivLast = node->ivPrevious; if (node->ivNext != 0) node->ivNext->ivPrevious = node->ivPrevious; if (node->ivPrevious != 0) node->ivPrevious->ivNext = node->ivNext; ivOps.deleteNode (node); ivNumberOfElements--; } template void MSISequence ::removeAtPosition (unsigned long position) { checkPositionExists (position); Node* node; setToPosition (position, node); removeAt (node); } template void MSISequence::setToPosition (unsigned long position, MSISequence::Node*& node) const { setToFirst (node); for (int i = 1; i < position; i++) { node = node->ivNext; } } template MSISequence::Node* MSISequence::addAsFirst (MSISequence::Node* newNode) { return addAsNext (0, newNode); } template MSISequence::Node* MSISequence::addAsLast (MSISequence::Node* newNode) { return addAsNext (ivLast, newNode); } template MSISequence::Node* MSISequence::addAsNext (MSISequence::Node* node, MSISequence::Node* newNode) { if (node == 0) newNode->ivNext = ivFirst; else newNode->ivNext = node->ivNext; newNode->ivPrevious = node; if (newNode->ivNext != 0) newNode->ivNext->ivPrevious = newNode; if (newNode->ivPrevious != 0) newNode->ivPrevious->ivNext = newNode; if (node == 0) ivFirst = newNode; if (node == ivLast) ivLast = newNode; ivNumberOfElements++; return newNode; } template MSISequence::Node* MSISequence ::addAsPrevious (MSISequence::Node* node, MSISequence::Node* newNode) { return addAsNext (node->ivPrevious, newNode); } template MSISequence::Node* MSISequence ::addAtPosition (unsigned long position, MSISequence::Node* newNode) { Node *node; if (position == 1) node = 0; else { node = ivFirst; for (int i = 2; i < position; i++) { node = node->ivNext; } } return addAsNext (node, newNode); } template void MSISequence ::sort (long (*comparisonFunction) (Element const&, Element const&)) { Node *current, *next, *last; for (last = ivLast; last != ivFirst; last = last->ivPrevious) { for (current = ivFirst; current != last; ) { next = current->ivNext; if (0 < ivOps.functionComparison ((void *)comparisonFunction, current, current->ivNext)) { // exchange next and current current->ivNext = next->ivNext; next->ivPrevious = current->ivPrevious; if (current->ivNext != 0) current->ivNext->ivPrevious = current; if (next->ivPrevious != 0) next->ivPrevious->ivNext = next; current->ivPrevious = next; next->ivNext = current; if (next == last) { last = current; if (next == ivLast) { ivLast = current; } } if (current == ivFirst) { ivFirst = next; } } else { current = next; } } // maximum elements sorted in last .. ivLast } } #endif aplus-fsf-4.22/src/MSTypes/MSManagedPointer.C0000644000265000001440000000124010772770471014423 #ifndef MSManagedPointerIMPLEMENTATION #define MSManagedPointerIMPLEMENTATION /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #if HAVE_IOSTREAM #include #else #include #endif template ostream& operator<<(ostream& aStream_,const MSManagedPointer& aPointer_) { aStream_<<(void *)aPointer_._node->_pObject<<" "; return aStream_<<"Ref Count: "<_refCount< template inline unsigned int msIndexCompareUp(Type *p_,unsigned int i_,unsigned int j_) { return (p_[i_]!=p_[j_])?((p_[i_])<(p_[j_])):(i_ inline unsigned int msIndexCompareDown(Type *p_,unsigned int i_,unsigned int j_) { return (p_[i_]!=p_[j_])?((p_[j_])<(p_[i_])):(i_ unsigned int msMergeSortUp(unsigned int n_,Type *sp_,unsigned int *p_,unsigned int low_,unsigned int high_) { unsigned int t,m=(low_+high_+1)>>1; if (high_==m) {p_[low_]=UINT_MAX;return low_;} high_=msMergeSortUp(n_,sp_,p_,m,high_); low_=msMergeSortUp(n_,sp_,p_,low_,m); if (msIndexCompareUp(sp_,high_,low_)) {m=low_;low_=high_;high_=m;} for (t=low_;;low_=p_[low_]=high_,high_=m) { L:m=p_[low_]; if (UINT_MAX==m) {p_[low_]=high_;return t;} if (msIndexCompareUp(sp_,m,high_)) {low_=m;goto L;} } } template unsigned int msMergeSortDown(unsigned int n_,Type *sp_,unsigned int *p_,unsigned int low_,unsigned int high_) { unsigned int t,m=(low_+high_+1)>>1; if (high_==m) {p_[low_]=UINT_MAX;return low_;} high_=msMergeSortDown(n_,sp_,p_,m,high_); low_=msMergeSortDown(n_,sp_,p_,low_,m); if (msIndexCompareDown(sp_,high_,low_)) {m=low_;low_=high_;high_=m;} for (t=low_;;low_=p_[low_]=high_,high_=m) { L:m=p_[low_]; if (UINT_MAX==m) {p_[low_]=high_;return t;} if (msIndexCompareDown(sp_,m,high_)) {low_=m;goto L;} } } #endif aplus-fsf-4.22/src/MSTypes/MSObjectTypeVector.C0000644000265000001440000000776310772770471015001 #ifndef MSObjectTypeVectorIMPLEMENTATION #define MSObjectTypeVectorIMPLEMENTATION /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #ifdef MS_NO_INLINES #include #endif // MS_NO_INLINES #include template MSObjectVector::MSObjectVector() : MSBaseVector >() { } template MSObjectVector::MSObjectVector (unsigned int length_) #if !defined(MS_TEMPLATE_CONSTRUCTOR_OVERLOAD_BUG) : MSBaseVector > (length_) #else // Visual C++ overloading resolution bug : MSBaseVector > (length_, 0, 0) #endif //MS_TEMPLATE_CONSTRUCTOR_OVERLOAD_BUG { } template MSObjectVector::MSObjectVector (unsigned int length_, const Type & filler_) : MSBaseVector > (length_, filler_) { } template MSObjectVector::MSObjectVector (const MSObjectVector & vect_) : MSBaseVector > (vect_) { } template MSObjectVector::MSObjectVector (const MSBaseVector > & vect_) : MSBaseVector > (vect_) { } template MSObjectVector::MSObjectVector (const char *pString_, const char delimiter_) : MSBaseVector > (pString_, delimiter_) { } template MSObjectVector::MSObjectVector (MSTypeData > *pData_, unsigned int len_) : MSBaseVector > (pData_, len_) { } template MSObjectVector::MSObjectVector (const Type *pElements_, unsigned int len_) : MSBaseVector > (pElements_, len_) { } template MSObjectVector::~MSObjectVector() { } template MSObjectVector & MSObjectVector::operator= (const MSObjectVector & vect_) { return (MSObjectVector &) MSBaseVector >::operator= (vect_); } template MSObjectVector & MSObjectVector::operator= (const MSBaseVector > & vect_) { return (*this = (MSObjectVector &)vect_); } template MSObjectVector & MSObjectVector::operator= (const Type & value_) { return (MSObjectVector &) MSBaseVector >::operator= (value_); } template MSObjectVector & MSObjectVector::operator= (const char *pString_) { this->set (pString_); return *this; } template Type & MSObjectVector::elementAt (unsigned int index_) { #if !defined(MS_NO_INDEX_ERROR) if (index_ >= this->_pImpl->length()) { this->_pImpl->vectorIndexError (index_); return *(MSVectorElement *)this->ops().badData(); } #endif //MSPRODUCTION_BUILD if (this->vectorData()->refCount() > 1) this->_pImpl->makeUniqueCopy(); MSVectorElement &element = (MSVectorElement &)this->vectorData()->elements()[index_]; if (this->doChanged()==MSTrue) element.vector (this); return element; } template MSVectorElement::~MSVectorElement() { vector (0); } template void MSVectorElement::sendEvent (MSEvent &) { MSObjectVector *pVect = (MSObjectVector *)this->_pReceiverList; // ASSERTION: pVect != 0 if (pVect->_blocked == MSTrue) vector (0); else // pVect->_blocked == MSFalse { unsigned int index = ((unsigned long)this - (unsigned long)pVect->data()) / sizeof(Type); pVect->changed (index); } } #endif // MSObjectTypeVectorIMPLEMENTATION aplus-fsf-4.22/src/MSTypes/MSObservableTree.C0000644000265000001440000001625510772770471014446 #ifndef MSObservableTreeIMPLEMENTATION #define MSObservableTreeIMPLEMENTATION /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // /////////////////////////////////////////////////////////////////////////////// #include #include template MSObservableTree::MSObservableTree(void) {} template MSObservableTree::MSObservableTree(const MSObservableTree& aTree_) { MSTabularTree::copy(aTree_); } template MSObservableTree& MSObservableTree::operator=(const MSObservableTree& aTree_) { if (this!=&aTree_) copy(aTree_); return *this; } template void MSObservableTree::changed(const MSTabularTreeCursor& cursor_,unsigned long position_, MSObservableTreeEventType type_) { if (receiverList()!=0) { MSObservableTreeEvent e(cursor_,position_,type_); sendEvent(e); } } template void MSObservableTree::changed(void) { if (receiverList()!=0) { MSObservableTreeEvent e(MSTabularTreeCursor(*this), 0, MSObservableTreeCopy); sendEvent(e); } } template MSObservableTree::~MSObservableTree(void) {} template void MSObservableTree::copy(MSTabularTree const& tree_) { if (&tree_!=this) { MSTabularTree::copy(tree_); changed(); } } template void MSObservableTree::copySubtree(MSTabularTreeconst& tree_, MSTabularTreeCursor const& cursor_) { MSTabularTree::copySubtree(tree_,cursor_); changed(); } template void MSObservableTree::addAsChild(MSTabularTreeCursor const& cursor_, unsigned long position_, Element const& element_) { MSTabularTree::addAsChild(cursor_,position_,element_); changed(cursor_,position_,MSObservableTreeInsert); } template void MSObservableTree::removeAll(void) { MSTabularTree::removeAll(); changed(); } template void MSObservableTree::removeSubtree(const MSTabularTreeCursor& cursor_) { MSTabularTreeCursor cursor2(cursor_); unsigned long pos=position(cursor2); cursor2.setToParent(); MSTabularTree::removeSubtree(cursor_); if (cursor2.isValid()) changed(cursor2,pos,MSObservableTreeDelete); else changed(); } template void MSObservableTree::addAsRoot(Element const& element_) { MSTabularTree::addAsRoot(element_); changed(); } template void MSObservableTree::attachAsRoot(MSObservableTree &tree_) { MSTabularTree::attachAsRoot(tree_); changed(); tree_.changed(); } template void MSObservableTree::attachAsChild(MSTabularTreeCursor const& cursor_, unsigned long position_, MSObservableTree& tree_) { MSTabularTree::attachAsChild(cursor_,position_,tree_); changed(cursor_,position_,MSObservableTreeInsert); tree_.changed(); } template void MSObservableTree::attachSubtreeAsRoot(MSObservableTree& tree_, const MSTabularTreeCursor& cursor_) { MSTabularTreeCursor cursor2(cursor_); unsigned long p=tree_.position(cursor2); cursor2.setToParent(); MSTabularTree::attachSubtreeAsRoot(tree_,cursor_); changed(); if (cursor2.isValid()) tree_.changed(cursor2,p,MSObservableTreeDelete); else tree_.changed(); // whole tree is deleted } template void MSObservableTree::attachSubtreeAsChild(const MSTabularTreeCursor &cursorTo_, unsigned long pos_, MSObservableTree& tree_, MSTabularTreeCursor const& cursorFrom_) { MSTabularTreeCursor cursor2(cursorFrom_); unsigned long pos2=tree_.position(cursor2); cursor2.setToParent(); MSTabularTree::attachSubtreeAsChild(cursorTo_,pos_,tree_,cursorFrom_); changed(cursorTo_,pos_,MSObservableTreeInsert); if (cursor2.isValid()) tree_.changed(cursor2,pos2,MSObservableTreeDelete); else tree_.changed(); // whole tree is deleted } template void MSObservableTree::replaceAt(MSTabularTreeCursor const& cursor_,Element const& element_) { MSTabularTree::replaceAt(cursor_,element_); changed(cursor_,position(cursor_),MSObservableTreeAssign); } template void MSObservableTree::replaceAt(MSTabularTreeCursor const& cursor_,MSObservableTree& tree_) { if (&tree_!=this) { if (isRoot(cursor_)) copy(tree_); else { unsigned long pos=position(cursor_); MSTabularTreeCursor cursor=cursor_; cursor.setToParent(); MSTabularTree::removeSubtree(cursor_); MSTabularTree::attachAsChild(cursor,pos,tree_); changed(cursor,pos,MSObservableTreeReplace); } } } template void MSObservableTree::permuteChildren(MSTabularTreeCursor const& cursor_, const MSIndexVector& index_) { MSTabularTree::permuteChildren(cursor_,index_); if (receiverList()!=0) { MSObservableTreeEvent e(cursor_,index_,MSObservableTreePermute); sendEvent(e); } } template void MSObservableTree::elementChanged(MSTabularTreeCursor const& cursor_) { changed(cursor_,position(cursor_),MSObservableTreeAssign); } template const MSSymbol& MSObservableTree::symbol(void) { static MSSymbol aSymbol("MSObservableTree"); return aSymbol; } template MSString MSObservableTree::asString(void) const { return MSString();} template MSString MSObservableTree::asDebugInfo(void) const { return MSString();} template MSString MSObservableTree::asMSF(void) const { return MSString();} template MSString MSObservableTree::className(void) const { return MSString("MSObservableTree"); } template const MSSymbol& MSObservableTree::type(void) const { return symbol(); } template MSError::ErrorStatus MSObservableTree::set(const char *) { return MSError::MSSuccess; } template MSError::ErrorStatus MSObservableTree::setFromMSF(const char *) { return MSError::MSSuccess; } template MSModel *MSObservableTree::clone(void) const { return new MSObservableTree(*this); } #endif aplus-fsf-4.22/src/MSTypes/MSObservableTreeEvent.C0000644000265000001440000000174510772770471015446 #ifndef MSObservableTreeEventIMPLEMENTATION #define MSObservableTreeEventIMPLEMENTATION /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include template MSObservableTreeEvent::~MSObservableTreeEvent(void) {} template const MSSymbol& MSObservableTreeEvent::symbol(void) { static MSSymbol aSymbol("MSObservableTreeEvent"); return aSymbol; } template MSObservableTreeEvent& MSObservableTreeEvent::operator=(const MSObservableTreeEvent& aEvent_) { if (this!=&aEvent_) { _cursor=aEvent_._cursor; _position=aEvent_._position; _index=aEvent_._index; sender(aEvent_.sender()); } return *this; } #endif aplus-fsf-4.22/src/MSTypes/MSTabularTree.C0000644000265000001440000010500710772770471013746 #ifndef MSTabularTreeIMPLEMENTATION #define MSTabularTreeIMPLEMENTATION /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include // ***************************************************************************** // MSTabularTree implementation // ***************************************************************************** template void MSTabularTree::reservePosition(unsigned long position, MSTabularTreeNode* node) { if (position==0) MSTKTHROWEXCEPTION(MSTabularTreePositionInvalid(MSTabularTreeInvalidPositionText)); unsigned long numChildren=node->_numberOfChildren; if (position>numChildren) { unsigned long newNumChildren; if (numChildren==0) newNumChildren=position; else { newNumChildren=2*numChildren; newNumChildren=(position>newNumChildren)?position:newNumChildren; } MSTabularTreeNode **pNodes=new MSTabularTreeNode*[newNumChildren]; if (pNodes==0) MSTKTHROWEXCEPTION(MSTabularTreeOutOfMemory(MSTabularTreeOutOfCollectionMemoryText)); unsigned long i; for (i=0;i_pChildren[i]; for (i=numChildren;i_pChildren!=0) delete[] node->_pChildren; node->_pChildren=pNodes; node->_numberOfChildren=newNumChildren; } } // work needed template void MSTabularTree::copySubtree(MSTabularTreeNode*& to, MSTabularTreeNode* from) { // IASSERT(from!=0); to=newNode(from->_element); if (from->_numberOfChildren>0) { reservePosition(from->_numberOfChildren,to); for (unsigned long n=0;n_numberOfChildren;n++) { if (from->_pChildren[n]==0) to->_pChildren[n]=0; else { copySubtree(to->_pChildren[n],from->_pChildren[n]); to->_pChildren[n]->_pParentNode=to; } } } } template unsigned long MSTabularTree::removeSubtree(MSTabularTreeNode* node) { // IASSERT(node!=0); unsigned long result=0; for (unsigned long n=0;n_numberOfChildren;n++) { if (node->_pChildren[n]!=0) result += removeSubtree(node->_pChildren[n]); } delete node; return result + 1; } template MSBoolean MSTabularTree::constantFunctionIteration(void *iterationFunction, void* env, void const* node) { return MSFalse; //((MSBoolean(*)(Element const&,void*)) iterationFunction) // (((MSTabularTreeNode const*)node)->_element,env); } template MSBoolean MSTabularTree::functionIteration(void *iterationFunction,void* env,void* node) { return MSFalse; //((MSBoolean(*)(Element&,void*)) iterationFunction) // (((MSTabularTreeNode*)node)->_element,env); } template MSBoolean MSTabularTree::constantIteratorIteration(void* iterator,void const* node) { return((MSTabularTreeConstantIterator*)iterator)-> applyTo(((MSTabularTreeNode const*)node)->_element); } template MSBoolean MSTabularTree::iteratorIteration(void* iterator,void* node) { return((MSTabularTreeIterator*)iterator)-> applyTo(((MSTabularTreeNode*)node)->_element); } // ***************************************************************************** // cursor manipulation // ***************************************************************************** template MSBoolean MSTabularTree::setToParent(MSTabularTreeCursor& cursor) const { checkCursor(cursor); // MSTabularTreeNode* node=cursor._pNode; return setToParent(cursor._pNode); } template MSBoolean MSTabularTree::setToParent(MSTabularTreeNode*& node) const { node=node->_pParentNode; return MSBoolean(node!=0); } template MSBoolean MSTabularTree::setToFirstExistingChild(MSTabularTreeCursor& cursor) const { checkCursor(cursor); // MSTabularTreeNode* node=cursor._pNode; return setToFirstExistingChild(cursor._pNode); } template MSBoolean MSTabularTree::setToFirstExistingChild(MSTabularTreeNode*& node) const { for (unsigned long n=0;n_numberOfChildren;n++) { if (node->_pChildren[n]!=0) { node=node->_pChildren[n]; return MSTrue; } } node=0; return MSFalse; } template MSBoolean MSTabularTree::setToNextExistingChild(MSTabularTreeCursor& cursor) const { checkCursor(cursor); // MSTabularTreeNode* node=cursor._pNode; return setToNextExistingChild(cursor._pNode); } template MSBoolean MSTabularTree::setToNextExistingChild(MSTabularTreeNode*& node) const { MSTabularTreeNode* parent=node->_pParentNode; if (parent!=0) { MSBoolean skippedNode=MSFalse; for (unsigned long n=0;n_numberOfChildren;n++) { if (skippedNode) { if (parent->_pChildren[n]!=0) { node=parent->_pChildren[n]; return MSTrue; } } else { if (parent->_pChildren[n]==node) { skippedNode=MSTrue; } } } } node=0; return MSFalse; } template MSBoolean MSTabularTree::setToLastExistingChild(MSTabularTreeCursor& cursor) const { checkCursor(cursor); return setToLastExistingChild(cursor._pNode); } template MSBoolean MSTabularTree::setToLastExistingChild(MSTabularTreeNode*& node) const { for (unsigned long n=node->_numberOfChildren;n>0;) { n--; if (node->_pChildren[n]!=0) { node=node->_pChildren[n]; return MSTrue; } } node=0; return MSFalse; } template MSBoolean MSTabularTree::setToPreviousExistingChild(MSTabularTreeCursor& cursor) const { checkCursor(cursor); return setToPreviousExistingChild(cursor._pNode); } template MSBoolean MSTabularTree::setToPreviousExistingChild(MSTabularTreeNode*& node) const { MSTabularTreeNode* parent=node->_pParentNode; if (parent!=0) { MSBoolean skippedNode=MSFalse; for (unsigned long n=parent->_numberOfChildren;n>0;) { n--; if (skippedNode) { if (parent->_pChildren[n]!=0) { node=parent->_pChildren[n]; return MSTrue; } } else { if (parent->_pChildren[n]==node) { skippedNode=MSTrue; } } } } node=0; return MSFalse; } template MSBoolean MSTabularTree::setToFirst(MSTabularTreeCursor& cursor, MSTabularTreeIterationOrder order) const { checkCursorIsForThis(cursor); return setToFirst(cursor._pNode,order); } template MSBoolean MSTabularTree::setToFirst(MSTabularTreeNode*& node, MSTabularTreeIterationOrder order) const { node=_pRootNode; if (_pRootNode==0) return MSFalse; if (order==MSPostorder) { MSTabularTreeNode* firstChild=node; while (setToFirstExistingChild(firstChild)==MSTrue) node=firstChild; } return MSTrue; } template MSBoolean MSTabularTree::setToNext(MSTabularTreeCursor& cursor, MSTabularTreeIterationOrder order) const { checkCursorIsForThis(cursor); // MSTabularTreeNode* node=cursor._pNode; return setToNext(cursor._pNode,order); } template MSBoolean MSTabularTree::setToNext(MSTabularTreeNode*& node, MSTabularTreeIterationOrder order) const { if (order==MSPreorder) { MSTabularTreeNode* firstChild=node; if (setToFirstExistingChild(firstChild)==MSTrue) { node=firstChild; return MSTrue; } else { MSTabularTreeNode* nextChild=node; while (setToNextExistingChild(nextChild)==MSFalse) { if (!setToParent(node)) return MSFalse; nextChild=node; } node=nextChild; return MSTrue; } } else { MSTabularTreeNode* nextChild=node; if (setToNextExistingChild(nextChild)==MSTrue) { node=nextChild; while (setToFirstExistingChild(nextChild)==MSTrue) node=nextChild; return MSTrue; } else return setToParent(node); } } template MSBoolean MSTabularTree::setToLast(MSTabularTreeCursor& cursor, MSTabularTreeIterationOrder order) const { checkCursorIsForThis(cursor); // MSTabularTreeNode* node=cursor._pNode; return setToLast(cursor._pNode,order); } template MSBoolean MSTabularTree::setToLast(MSTabularTreeNode*& node, MSTabularTreeIterationOrder order) const { node=_pRootNode; if (_pRootNode==0) return MSFalse; if (order==MSPreorder) { MSTabularTreeNode* lastChild=node; while (setToLastExistingChild(lastChild)==MSTrue) node=lastChild; } return MSTrue; } template MSBoolean MSTabularTree::setToPrevious(MSTabularTreeCursor& cursor, MSTabularTreeIterationOrder order) const { checkCursorIsForThis(cursor); // MSTabularTreeNode* node=cursor._pNode; return setToPrevious(cursor._pNode,order); } template MSBoolean MSTabularTree::setToPrevious(MSTabularTreeNode*& node, MSTabularTreeIterationOrder order) const { if (order==MSPostorder) { MSTabularTreeNode* lastChild=node; if (setToLastExistingChild(lastChild)==MSTrue) { node=lastChild; return MSTrue; } else { MSTabularTreeNode* previousChild=node; while (setToPreviousExistingChild(previousChild)==MSFalse) { if (setToParent(node)==MSFalse) return MSFalse; previousChild=node; } node=previousChild; return MSTrue; } } else { MSTabularTreeNode* previousChild=node; if (setToPreviousExistingChild(previousChild)==MSTrue) { node=previousChild; while (setToLastExistingChild(previousChild)==MSTrue) node=previousChild; return MSTrue; } else return setToParent(node); } } // ***************************************************************************** // implementation functions // ***************************************************************************** template void MSTabularTree::initNode(MSTabularTreeNode* node, MSTabularTreeNode* parent) const { node->_pParentNode=parent; for (unsigned long n=0;n_numberOfChildren;n++) node->_pChildren[n]=0; } template unsigned long MSTabularTree::numberOfSubtreeElements(MSTabularTreeNode const* node) const { // IASSERT(node!=0); unsigned long result=0; for (unsigned long n=0;n_numberOfChildren;n++) { if (node->_pChildren[n]!=0) result+=numberOfSubtreeElements(node->_pChildren[n]); } return result + 1; } template unsigned long MSTabularTree::numberOfSubtreeLeaves(MSTabularTreeNode const* node) const { // IASSERT(node!=0); unsigned long result=0; for (unsigned long n=0;n_numberOfChildren;n++) { if (node->_pChildren[n]!=0) result+=numberOfSubtreeLeaves(node->_pChildren[n]); } // node is a leaf if (result==0) result=1; return result; } template MSBoolean MSTabularTree::isLeaf(MSTabularTreeNode const* node) const { for (unsigned long n=0;n_numberOfChildren;n++) { if (node->_pChildren[n]!=0) return MSFalse; } return MSTrue; } template unsigned long MSTabularTree::position(MSTabularTreeNode const* node) const { MSTabularTreeNode* parent=node->_pParentNode; if (parent==0) return 1; for (unsigned long n=0;n_numberOfChildren;n++) { if (parent->_pChildren[n]==node) return n+1; } // IASSERT(MSFalse); return 1; } template void MSTabularTree::attachSubtreeAsRoot(MSTabularTree& tree, MSTabularTreeNode* node) { if (node->_pParentNode==0) tree._pRootNode=0; else node->_pParentNode->_pChildren[tree.position(node)-1]=0; _pRootNode=node; if (_pRootNode!=0) _pRootNode->_pParentNode=0; } template void MSTabularTree::attachSubtreeAsChild(MSTabularTreeNode* parent, unsigned long pos, MSTabularTree& tree, MSTabularTreeNode* from) { if (from->_pParentNode==0) tree._pRootNode=0; else from->_pParentNode->_pChildren[tree.position(from)-1]=0; parent->_pChildren[pos-1]=from; if (from!=0) from->_pParentNode=parent; } // ***************************************************************************** // allElementsDo // ***************************************************************************** template MSBoolean MSTabularTree::allElementsDo(void* function, MSTabularTreeIterationOrder order, void* env, MSBoolean(*apply)(void *function,void* env,void* node), MSTabularTreeNode* subtreeRoot) { if (order==MSPreorder) { if (!(*apply)(function,env,subtreeRoot)) return MSFalse; for (int i=0;i_numberOfChildren;i++) { MSTabularTreeNode* child=subtreeRoot->_pChildren[i]; if (child!=0) { if (!allElementsDo(function,order,env,apply,child)) return MSFalse; } } } else { for (int i=0;i_numberOfChildren;i++) { MSTabularTreeNode* child=subtreeRoot->_pChildren[i]; if (child!=0) { if (!allElementsDo(function,order,env,apply,child)) return MSFalse; } } if (!(*apply)(function,env,subtreeRoot)) return MSFalse; } return MSTrue; } template MSBoolean MSTabularTree::allElementsDo(void* function, MSTabularTreeIterationOrder order, void* env, MSBoolean(*apply)(void *function,void* env,void const* node), MSTabularTreeNode* subtreeRoot) const { if (order==MSPreorder) { if (!(*apply)(function,env,subtreeRoot)) return MSFalse; for (int i=0;i_numberOfChildren;i++) { MSTabularTreeNode* child=subtreeRoot->_pChildren[i]; if (child!=0) { if (!allElementsDo(function,order,env,apply,child)) return MSFalse; } } } else { for (int i=0;i_numberOfChildren;i++) { MSTabularTreeNode* child=subtreeRoot->_pChildren[i]; if (child!=0) { if (!allElementsDo(function,order,env,apply,child)) return MSFalse; } } if (!(*apply)(function,env,subtreeRoot)) return MSFalse; } return MSTrue; } template MSBoolean MSTabularTree::allElementsDo(void* iterator, MSTabularTreeIterationOrder order, MSBoolean(*apply)(void* iterator,void* node), MSTabularTreeNode* subtreeRoot) { if (order==MSPreorder) { if (!(*apply)(iterator,subtreeRoot)) return MSFalse; for (int i=0;i_numberOfChildren;i++) { MSTabularTreeNode* child=subtreeRoot->_pChildren[i]; if (child!=0) { if (!allElementsDo(iterator,order,apply,child)) return MSFalse; } } } else { for (int i=0;i_numberOfChildren;i++) { MSTabularTreeNode* child=subtreeRoot->_pChildren[i]; if (child!=0) { if (!allElementsDo(iterator,order,apply,child)) return MSFalse; } } if (!(*apply)(iterator,subtreeRoot)) return MSFalse; } return MSTrue; } template MSBoolean MSTabularTree::allElementsDo(void* iterator, MSTabularTreeIterationOrder order, MSBoolean(*apply)(void* iterator,void const* node), MSTabularTreeNode* subtreeRoot) const { if (order==MSPreorder) { if (!(*apply)(iterator,subtreeRoot)) return MSFalse; for (int i=0;i_numberOfChildren;i++) { MSTabularTreeNode* child=subtreeRoot->_pChildren[i]; if (child!=0) { if (!allElementsDo(iterator,order,apply,child)) return MSFalse; } } } else { for (int i=0;i_numberOfChildren;i++) { MSTabularTreeNode* child=subtreeRoot->_pChildren[i]; if (child!=0) { if (!allElementsDo(iterator,order,apply,child)) return MSFalse; } } if (!(*apply)(iterator,subtreeRoot)) return MSFalse; } return MSTrue; } template MSBoolean MSTabularTree::checkNode(MSTabularTreeNode const* node) const { if (_pRootNode!=0) return checkNode(node,_pRootNode); return MSFalse; } template MSBoolean MSTabularTree::checkNode(MSTabularTreeNode const* node, MSTabularTreeNode const* current) const { if (node==current) return MSTrue; for (int i=0;i_numberOfChildren;i++) { if (current->_pChildren[i]!=0&& checkNode(node,current->_pChildren[i])) return MSTrue; } return MSFalse; } template MSBoolean MSTabularTree::isConsistent(MSTabularTreeNode const* node) const { for (int i=0;i_numberOfChildren;i++) { if (node->_pChildren[i]!=0&& (node->_pChildren[i]->_pParentNode!=node|| isConsistent(node->_pChildren[i])==MSFalse)) return MSFalse; } return MSTrue; } // ***************************************************************************** // MSTabularTree inlines // ***************************************************************************** template MSTabularTreeNode *MSTabularTree::nodeAt(MSTabularTreeCursor const& cursor) const { return(MSTabularTreeNode *)cursor._pNode; } template MSTabularTreeNode *MSTabularTree::nodeAt(MSTabularTreeCursor& cursor) { return(MSTabularTreeNode *)cursor._pNode; } template void MSTabularTree:: checkCursorIsForThis(MSTabularTreeCursor const& cursor) const { if (cursor.isFor(*this)==MSFalse) { MSTKTHROWEXCEPTION(MSTabularTreeCursorInvalid(MSTabularTreeCursorNotForThisText)); } } template void MSTabularTree::checkCursor(MSTabularTreeCursor const& cursor) const { if (cursor.isFor(*this)==MSFalse) { MSTKTHROWEXCEPTION(MSTabularTreeCursorInvalid(MSTabularTreeCursorNotForThisText)); } if (cursor.isValid()==MSFalse) MSTKTHROWEXCEPTION(MSTabularTreeCursorInvalid(MSTabularTreeInvalidCursorText)); if (checkNode(cursor._pNode)==MSFalse) { MSTKTHROWEXCEPTION(MSTabularTreeCursorInvalid(MSTabularTreeCursorNotContainedText)); } } template void MSTabularTree::checkCursorOfTree(MSTabularTree const& tree, MSTabularTreeCursor const& cursor) const { if (cursor._pTabularTree!=&tree) { MSTKTHROWEXCEPTION(MSTabularTreeCursorInvalid(MSTabularTreeCursorNotForGivenText)); } if (cursor.isValid()==MSFalse) MSTKTHROWEXCEPTION(MSTabularTreeCursorInvalid(MSTabularTreeInvalidCursorText)); if (tree.checkNode(cursor._pNode)==MSFalse) { MSTKTHROWEXCEPTION(MSTabularTreeCursorInvalid(MSTabularTreeCursorNotContainedText)); } } template void MSTabularTree::checkPosition(unsigned long position, MSTabularTreeNode* node) const { if (position<1||position>node->_numberOfChildren) { MSTKTHROWEXCEPTION(MSTabularTreePositionInvalid(MSTabularTreeInvalidPositionText)); } } template void MSTabularTree::checkRootNotExists() const { if (_pRootNode!=0) MSTKTHROWEXCEPTION(MSTabularTreeRootAlreadyExists(MSTabularTreeRootAlreadyExistsText)); } template void MSTabularTree::checkChildNotExists(MSTabularTreeNode* n) const { if (n!=0) MSTKTHROWEXCEPTION(MSTabularTreeChildAlreadyExists(MSTabularTreeChildAlreadyExistsText)); } template void MSTabularTree::copySubtree(MSTabularTreeNode* from) { if (from==0) _pRootNode=0; else { copySubtree((MSTabularTreeNode*&)_pRootNode,from); _pRootNode->_pParentNode=0; } } template MSTabularTree::MSTabularTree() :_pRootNode(0) { } template MSTabularTree::MSTabularTree(MSTabularTree const& tabularTree) { copySubtree((MSTabularTreeNode*)tabularTree._pRootNode); } template MSTabularTree::~MSTabularTree() { removeAll(); } template MSTabularTree& MSTabularTree::operator=(MSTabularTree const& tree) { copy(tree); return *this; } template void MSTabularTree::copy(MSTabularTree const& tree) { if (&tree!=this) { removeAll(); copySubtree((MSTabularTreeNode*)tree._pRootNode); } } template void MSTabularTree::copySubtree(MSTabularTree const& tree, MSTabularTreeCursor const& cursor) { checkCursorOfTree(tree,cursor); if (&tree!=this) { removeAll(); copySubtree((MSTabularTreeNode*)nodeAt(cursor)); } else { MSTabularTree t; t.attachSubtreeAsRoot(*this,cursor); removeAll(); attachAsRoot(t); } } template void MSTabularTree::addAsRoot(Element const& element) { checkRootNotExists(); _pRootNode=(MSTabularTreeNode*) newNode(element); initNode(_pRootNode,0); } template void MSTabularTree::addAsChild(MSTabularTreeCursor const& cursor, unsigned long position, Element const& element) { checkCursor(cursor); MSTabularTreeNode* parent=cursor._pNode; reservePosition(position,parent); MSTabularTreeNode*& child=parent->_pChildren[position-1]; checkChildNotExists(child); child=(MSTabularTreeNode*) newNode(element); initNode(child,parent); } template void MSTabularTree::attachAsRoot(MSTabularTree& tree) { checkRootNotExists(); _pRootNode=tree._pRootNode; tree._pRootNode=0; } template void MSTabularTree::attachAsChild(MSTabularTreeCursor const& cursor, unsigned long position, MSTabularTree& tree) { checkCursor(cursor); MSTabularTreeNode* parent=cursor._pNode; reservePosition(position,parent); MSTabularTreeNode*& child=parent->_pChildren[position-1]; checkChildNotExists(child); child=tree._pRootNode; if (child!=0) child->_pParentNode=parent; tree._pRootNode=0; } template void MSTabularTree::attachSubtreeAsRoot(MSTabularTree& tree, MSTabularTreeCursor const& cursor) { checkCursorOfTree(tree,cursor); checkRootNotExists(); MSTabularTreeNode* node=cursor._pNode; attachSubtreeAsRoot(tree,node); } template void MSTabularTree::attachSubtreeAsChild(MSTabularTreeCursor const& cursorTo, unsigned long position, MSTabularTree& tree, MSTabularTreeCursor const& cursorFrom) { checkCursorOfTree(tree,cursorFrom); checkCursor(cursorTo); MSTabularTreeNode* parent=nodeAt(cursorTo); reservePosition(position,parent); MSTabularTreeNode*& child=parent->_pChildren[position-1]; checkChildNotExists(child); MSTabularTreeNode* nodeFrom=nodeAt(cursorFrom); attachSubtreeAsChild(parent,position,tree,nodeFrom); } template unsigned long MSTabularTree::removeAll() { unsigned long result; if (_pRootNode!=0) { result=removeSubtree((MSTabularTreeNode*)_pRootNode); _pRootNode=0; } else result=0; return result; } template unsigned long MSTabularTree::removeSubtree(MSTabularTreeCursor const& cursor) { checkCursor(cursor); MSTabularTreeNode* node=nodeAt(cursor); if (node->_pParentNode==0) _pRootNode=0; else node->_pParentNode->_pChildren[position(cursor)-1]=0; return removeSubtree((MSTabularTreeNode*)node); } template Element const& MSTabularTree::elementAt(MSTabularTreeCursor const& cursor) const { checkCursor(cursor); return nodeAt(cursor)->_element; } template Element& MSTabularTree::elementAt(MSTabularTreeCursor const& cursor) { checkCursor(cursor); return nodeAt(cursor)->_element; } template void MSTabularTree::replaceAt(MSTabularTreeCursor const& cursor, Element const& element_) { checkCursor(cursor); // assign(((MSTabularTreeNode*)nodeAt(cursor)->_element,element); nodeAt(cursor)->_element=element_; } template unsigned long MSTabularTree::numberOfElements() const { if (_pRootNode==0) return 0; return numberOfSubtreeElements(_pRootNode); } template unsigned long MSTabularTree::numberOfSubtreeElements(MSTabularTreeCursor const& cursor) const { checkCursor(cursor); return numberOfSubtreeElements(nodeAt(cursor)); } template unsigned long MSTabularTree::numberOfLeaves() const { if (_pRootNode==0) return 0; return numberOfSubtreeLeaves(_pRootNode); } template unsigned long MSTabularTree::numberOfSubtreeLeaves(MSTabularTreeCursor const& cursor) const { checkCursor(cursor); return numberOfSubtreeLeaves(nodeAt(cursor)); } template MSBoolean MSTabularTree::isEmpty() const { return MSBoolean(_pRootNode==0); } template MSTabularTreeCursor* MSTabularTree::newCursor() const { MSTabularTreeCursor* result=new MSTabularTreeCursor(*this); if (result==0) MSTKTHROWEXCEPTION(MSTabularTreeOutOfMemory(MSTabularTreeOutOfCollectionMemoryText)); return result; } template MSBoolean MSTabularTree::isRoot(MSTabularTreeCursor const& cursor) const { checkCursor(cursor); return MSBoolean(_pRootNode==nodeAt(cursor)); } template MSBoolean MSTabularTree::isLeaf(MSTabularTreeCursor const& cursor) const { checkCursor(cursor); return isLeaf(nodeAt(cursor)); } template unsigned long MSTabularTree::position(MSTabularTreeCursor const& cursor) const { checkCursor(cursor); return position(nodeAt(cursor)); } template MSBoolean MSTabularTree::hasChild(unsigned long position, MSTabularTreeCursor const& cursor) const { checkCursor(cursor); MSTabularTreeNode* node=nodeAt(cursor); checkPosition(position,node); return MSBoolean(node->_pChildren[position-1]!=0); } template MSBoolean MSTabularTree::setToRoot(MSTabularTreeCursor& cursor) const { checkCursorIsForThis(cursor); cursor._pNode=(MSTabularTreeNode*)_pRootNode; return MSBoolean(_pRootNode!=0); } template MSBoolean MSTabularTree::setToChild(unsigned long position, MSTabularTreeCursor& cursor) const { checkCursor(cursor); MSTabularTreeNode* node=cursor._pNode; checkPosition(position,node); cursor._pNode=node->_pChildren[position-1]; return MSBoolean(cursor._pNode!=0); } // ***************************************************************************** // allElementsDo // ***************************************************************************** template MSBoolean MSTabularTree::allElementsDo(MSBoolean(*function)(Element&,void*), MSTabularTreeIterationOrder order, void* additionalArgument) { if (_pRootNode==0) return MSTrue; return allElementsDo((void *)function,order,additionalArgument, functionIteration,_pRootNode); } template MSBoolean MSTabularTree::allElementsDo(MSTabularTreeIterator& iterator, MSTabularTreeIterationOrder order) { if (_pRootNode==0) return MSTrue; return allElementsDo(&iterator,order, iteratorIteration,_pRootNode); } template MSBoolean MSTabularTree::allElementsDo(MSBoolean(*function)(Element const&,void*), MSTabularTreeIterationOrder order, void* additionalArgument) const { if (_pRootNode==0) return MSTrue; return allElementsDo((void *)function,order,additionalArgument, constantFunctionIteration,_pRootNode); } template MSBoolean MSTabularTree::allElementsDo(MSTabularTreeConstantIterator& iterator, MSTabularTreeIterationOrder order) const { if (_pRootNode==0) return MSTrue; return allElementsDo(&iterator,order, constantIteratorIteration,_pRootNode); } template MSBoolean MSTabularTree::isConsistent() const { return MSBoolean(_pRootNode==0||(_pRootNode->_pParentNode==0&&isConsistent(_pRootNode))); } template MSBoolean MSTabularTree::allSubtreeElementsDo(MSTabularTreeCursor const& cursor, MSBoolean(*function)(Element&,void*), MSTabularTreeIterationOrder order, void* additionalArgument) { checkCursor(cursor); return allElementsDo((void*)function,order,additionalArgument, functionIteration,cursor._pNode); } template MSBoolean MSTabularTree::allSubtreeElementsDo(MSTabularTreeCursor const& cursor, MSTabularTreeIterator& iterator, MSTabularTreeIterationOrder order) { checkCursor(cursor); return allElementsDo(&iterator,order,iteratorIteration, nodeAt(cursor)); } template MSBoolean MSTabularTree::allSubtreeElementsDo(MSTabularTreeCursor const& cursor, MSBoolean(*function)(Element const&,void*), MSTabularTreeIterationOrder order, void* additionalArgument) const { checkCursor(cursor); return allElementsDo((void *)function,order,additionalArgument, constantFunctionIteration,nodeAt(cursor)); } template MSBoolean MSTabularTree::allSubtreeElementsDo(MSTabularTreeCursor const& cursor, MSTabularTreeConstantIterator& iterator, MSTabularTreeIterationOrder order) const { checkCursor(cursor); return allElementsDo(&iterator,order,constantIteratorIteration, nodeAt(cursor)); } template MSTabularTreeNode* MSTabularTree::newNode(Element const& element) { MSTabularTreeNode *result=new MSTabularTreeNode(element); if (result==0) MSTKTHROWEXCEPTION(MSTabularTreeOutOfMemory(MSTabularTreeOutOfCollectionMemoryText)); return result; } template void MSTabularTree::permuteChildren(MSTabularTreeCursor const& cursor_, const MSIndexVector& index_) { checkCursor(cursor_); MSTabularTreeNode* parent=nodeAt(cursor_); MSTabularTreeNode **newChildren=new MSTabularTreeNode*[parent->_numberOfChildren]; unsigned long i,n=index_.length(),pos; for(i=0;i_pChildren[pos]; parent->_pChildren[pos] = 0; } for(;i_numberOfChildren;i++) { newChildren[i]=0; } for(i=0;i_pChildren[i] !=0) removeSubtree(parent->_pChildren[i]); } delete parent->_pChildren; parent->_pChildren=newChildren; } #endif aplus-fsf-4.22/src/MSTypes/MSTabularTreeCursor.C0000644000265000001440000000350210772770471015141 #ifndef MSTabularTreeCursorIMPLEMENTATION #define MSTabularTreeCursorIMPLEMENTATION /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include // ***************************************************************************** // MSTabularTreeCursor MSBoolean MSTabularTreeCursor::setToRoot() { return _pTabularTree->setToRoot(*this); } template MSBoolean MSTabularTreeCursor::setToChild(unsigned long position) { return _pTabularTree->setToChild(position,*this); } template MSBoolean MSTabularTreeCursor::setToParent() { return _pTabularTree->setToParent(*this); } template MSBoolean MSTabularTreeCursor::setToFirstExistingChild() { return _pTabularTree->setToFirstExistingChild(*this); } template MSBoolean MSTabularTreeCursor::setToNextExistingChild() { return _pTabularTree->setToNextExistingChild(*this); } template MSBoolean MSTabularTreeCursor::setToLastExistingChild() { return _pTabularTree->setToLastExistingChild(*this); } template MSBoolean MSTabularTreeCursor::setToPreviousExistingChild() { return _pTabularTree->setToPreviousExistingChild(*this); } template MSBoolean MSTabularTreeCursor::isValid() const { return (_pNode!=0)?MSTrue:MSFalse; } template void MSTabularTreeCursor::invalidate() { _pNode=0; } #endif aplus-fsf-4.22/src/MSTypes/MSTypeData.C0000644000265000001440000001324210772770472013247 #ifndef MSTypeDataIMPLEMENTATION #define MSTypeDataIMPLEMENTATION /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include // defines offsetof macro used in MSTypeData::operator new #include #include #ifdef MS_NO_INLINES #include #endif // MS_NO_INLINES template MSTypeData::MSTypeData() : MSData() { } template MSTypeData::MSTypeData (unsigned int size_) : MSData (size_) { } template MSTypeData::~MSTypeData() { } template MSString MSTypeData::asDebugInfo() const { MSString result ("MSTypeData(@"); result += MSString((unsigned long)this).d2x().lowerCase(); result += ",_data="; result += MSString((unsigned long)elements()).d2x().lowerCase(); result += ",_refCount="; result += MSString(refCount()); result += ")"; return result; } template void MSTypeData::constructElements(Type *pElements_, unsigned int numToConstruct_, const Type & value_) { Allocator alloc; while (numToConstruct_--) { alloc.construct(pElements_++, value_); } } template void MSTypeData::destroyElements(Type *pElements_, unsigned int numToDestroy_) { Allocator alloc; while (numToDestroy_--) { alloc.destroy(pElements_++); } } template void *MSTypeData::operator new(size_t, unsigned int numEls_) { // The data elements are going to be allocated right after the end of MSData structure (padded for // possible alignment). We need to allocate memory for everything in MSData (including possible // padding) plus everything for the data elements (number of elements times size of each one). // // We cannot just use sizeof(MSData) in the computation of the total size because we need to know // how it would be aligned given that it's followed by an array of elements of type Type. Instead, // we call the function dataOffset(), which will return where the data elements part starts, including // the alignment padding, which is equivalent to the real size of MSData. // Allocator alloc; return alloc.allocate(dataOffset() + numEls_*sizeof(Type)); } template void MSTypeData::operator delete(void *p_) { Allocator alloc; alloc.deallocate((Type *)p_); } template void MSTypeData::set (unsigned int index_, const Type & value_, MSAllocationFlag flag_) { if (flag_ == MSConstructed) { elements()[index_] = value_; } else // if (flag_==MSRaw) { Allocator alloc; alloc.construct(elements()+index_, value_); } } template void MSTypeData::fill (Type *pElements_, unsigned int length_, const Type & value_, MSAllocationFlag flag_) { if (flag_==MSConstructed) { while (length_--) { *pElements_++ = value_; } } else // if (flag_==MSRaw) --> elements haven't been constructed yet { constructElements(pElements_, length_, value_); } } template void MSTypeData::copy (const Type *pSrc_, Type *pDest_, unsigned int length_, MSAllocationFlag flag_) { if (flag_ == MSConstructed) { while (length_--) { *pDest_++ = *pSrc_++; } } else // if (flag_==MSRaw) --> elements haven't been constructed yet { Allocator alloc; while (length_--) { alloc.construct(pDest_++, *pSrc_++); } } } template void MSTypeData::copyBackward (const Type *pSrc_, Type *pDest_, unsigned int length_) { // ASSERTION: elements in pSrc_ have been constructed while (length_--) *pDest_-- = *pSrc_--; } template MSTypeData *MSTypeData::allocateWithLength (unsigned int length_, MSAllocationFlag flag_, unsigned int numToConstruct_) { return MSTypeData::allocateWithSize (MSData::computeSize(length_), flag_, numToConstruct_); } template MSTypeData *MSTypeData::allocateWithSize (unsigned int size_, MSAllocationFlag flag_, unsigned int numToConstruct_) { MSTypeData *pData = new (size_) MSTypeData (size_); if (isConstructionNeeded((Type *)0)==MSTrue) // default construction is *not* needed for built-in types { if (flag_==MSConstructed) { constructElements(pData->elements(), size_, Type()); // default-construct all elements } else // if (flag_==MSRaw) { // default-construct first numToConstruct_ elements // constructElements(pData->elements(), numToConstruct_, Type()); } } return pData; } template void MSTypeData::deallocate (MSAllocationFlag flag_, unsigned int numToDestroy_) { if (isDestructionNeeded((Type *)0)==MSTrue) // destruction is *not* needed for built-in types { if (flag_ == MSConstructed) { destroyElements(elements(), size()); } else // if (flag_==MSRaw) { destroyElements(elements(), numToDestroy_); } } delete this; } #endif // MSTypeDataIMPLEMENTATION aplus-fsf-4.22/src/MSTypes/MSTypeMatrix.C0000644000265000001440000016726610772770472013662 #ifndef MSTypeMatrixIMPLEMENTATION #define MSTypeMatrixIMPLEMENTATION /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #if HAVE_SSTREAM #include #else #include #endif #include #include #include #include #include #include #include template Type MSTypeMatrix::_badData=0; template const MSSymbol& MSTypeMatrix::type(void) const { return symbol(); } template MSString MSTypeMatrix::asString(void) const { MSString result; result+='('; result+=MSString(rows()); result+=','; result+=MSString(columns()); result+=") "; unsigned n=count(); for (unsigned i=0;i MSString MSTypeMatrix::asMSF(void) const { #if HAVE_SSTREAM static string buf; static ostringstream oss(buf,ios::out); #else static char buf[64]; static ostrstream oss(buf,64,ios::out); #endif oss.precision(8); MSString result; if (_count>0) { result+=MSMSF_US; result+=MSString(_rows); result+=MSMSF_US; result+=MSString(_columns); for (unsigned i=0;i<_count;i++) { oss.seekp(ios::beg); oss< MSString MSTypeMatrix::asDebugInfo(void) const { MSString result("MSTypeMatrix(@"); result+=MSString((unsigned long)this).d2x().lowerCase(); result+=",_rows="; result+=MSString(rows()); result+=",_columns="; result+=MSString(columns()); result+=",_count="; result+=MSString(length()); result+=",_size="; result+=MSString(size()); result+=",_data="; result+=pData()->asDebugInfo(); result+=",_type="; result+=type().symbolName(); result+=")"; return MSString(result); } template MSModel *MSTypeMatrix::clone(void) const { return new MSTypeMatrix(*this); } template MSModel *MSTypeMatrix::create(void) const { return new MSTypeMatrix(); } template void MSTypeMatrix::assign(const MSModel& aModel_) { *this=(MSTypeMatrix&)aModel_; } template const MSSymbol& MSTypeMatrix::symbol(void) { static MSSymbol sym("MSTypeMatrix<" + msClassName(Type()) + ">"); return sym; } template MSString MSTypeMatrix::className(void) const { return MSString("MSTypeMatrix<" + msClassName(Type()) + ">"); } template long MSTypeMatrix::compare(const MSModel& aModel_) const { return compare((MSTypeMatrix&)aModel_); } template void MSTypeMatrix::blockLeft(unsigned target_,unsigned moveCount_) { Type *dp=data(); for (unsigned i=target_;moveCount_>0;i++,moveCount_--) dp[i]=dp[i+1]; } template void MSTypeMatrix::blockRight(unsigned target_,unsigned moveCount_) { Type *dp=data(); for (unsigned i=target_+moveCount_-1;moveCount_>0;i--,moveCount_--) dp[i]=dp[i-1]; } template void MSTypeMatrix::allocData(unsigned length_) { _count=length_; if (length()>0) { _pData=MSTypeData >::allocateWithLength(length()); } else { _pData=0; } } template void MSTypeMatrix::makeUniqueCopy(void) { if (_pData!=0) { MSTypeData > *dst=MSTypeData >::allocateWithSize(size()); MSTypeData >::copy(_pData->elements(),dst->elements(),length()); //src,dst,len _pData->decrementCount(); _pData=dst; } } template void MSTypeMatrix::prepareToChange(void) { if (_pData!=0) { if (_pData->refCount()>1) makeUniqueCopy(); } else allocData(length()); } template void MSTypeMatrix::freeData(void) { decrementCount(),_pData=0; } // make sure there are at least size_+1 elements in the array template void MSTypeMatrix::reserve(unsigned size_) { unsigned n=size_+1; if (size() > *newData=MSTypeData >::allocateWithLength(n); Type *dp=newData->elements(); Type *sp=data(); MSTypeData >::copy(sp,dp,size()); freeData(); _pData=newData; } } //------------------------------------------------------------------------------------------------- // MSTypeMatrix //------------------------------------------------------------------------------------------------- template ostream& operator<<(ostream& aStream_,const MSTypeMatrix& aTypeMatrix_) { unsigned r=aTypeMatrix_.rows(); unsigned c=aTypeMatrix_.columns(); for (unsigned i=0;i MSTypeMatrix::MSTypeMatrix(void) :MSMatrix() { _pData=0;_blocked=MSFalse; } template MSTypeMatrix::MSTypeMatrix(unsigned rows_,unsigned cols_) :MSMatrix(rows_,cols_) { allocData(length()); _blocked=MSFalse; } template MSTypeMatrix::MSTypeMatrix(unsigned rows_,unsigned cols_,Type fill_) :MSMatrix(rows_,cols_) { if (length()>0) { unsigned n=length(); allocData(n); Type *dp=data(); while (n--) *dp++=fill_; } else _pData=0; _blocked=MSFalse; } template MSTypeMatrix::MSTypeMatrix(const MSTypeMatrix& aTypeMatrix_) :MSMatrix(aTypeMatrix_.rows(),aTypeMatrix_.columns()) { _pData=aTypeMatrix_.pData(); _blocked=MSFalse; (void)incrementCount(); } // special private constructor used to avoid temporary object creation // on return by value - see ARM page 267 template MSTypeMatrix::MSTypeMatrix(MSTypeData > *data_,unsigned rows_,unsigned cols_) :MSMatrix(rows_,cols_) { _pData=data_; _blocked=MSFalse; } template MSTypeMatrix::MSTypeMatrix(const Type *pElements_, unsigned rows_, unsigned cols_) : MSMatrix(rows_,cols_) { _pData = MSTypeData >::allocateWithLength(_count, MSRaw); MSTypeData >::copy(pElements_, _pData->elements(), _count, MSRaw); } template MSTypeMatrix::~MSTypeMatrix(void) { freeData(); } template MSError::ErrorStatus MSTypeMatrix::set(const char *pString_) { freeData(); if (pString_!=0) { #if defined(MS_NO_ISTRSTREAM_CONSTCHAR_CONSTRUCTOR) // Visual C++ does not define a constructor that takes a const char *, // therefore we have to do the following cast. istrstream ist((char *)(void *)pString_,strlen(pString_)); #else #if HAVE_SSTREAM istringstream ist(pString_); #else istrstream ist(pString_,strlen(pString_)); #endif #endif char c='\0'; // extract '(' while (c!='('&&ist) ist>>c; ist>>_rows; while (c!=','&&ist) ist>>c; ist>>_columns; while (c!=')'&&ist) ist>>c; if (!ist) { _rows=_columns=_count=0; return MSError::MSFailure; } _count=rows()*columns(); if (length()>0) _pData=MSTypeData >::allocateWithLength(length()); unsigned n=length(); Type *dp=data(); for (unsigned i=0;i>dp[i]; if (!ist) return MSError::MSFailure; } changed(); return MSError::MSSuccess; } template MSError::ErrorStatus MSTypeMatrix::setFromMSF(const char *pString_) { MSError::ErrorStatus code; unsigned i; unsigned startpos; unsigned value[2]; const char *pcurrent; char *pstring; if ((pString_!=0 &&(*pString_==MSMSF_US)&&(strlen(pString_)>sizeof(MSMSF_US)))) { code=MSError::MSSuccess; freeData(); _rows=0,_columns=0,_count=0; MSString decode(pString_); decode.decodeMSF(); unsigned slen=decode.length(); startpos=sizeof (MSMSF_US); pcurrent=(const char *)decode.string()+startpos; // first get the size of the matrix....its the first two elements in // the string for (i=0;i<2;i++) { value[i]=0; if (isdigit(*pcurrent)) value[i]=strtoul(pcurrent,&pstring,10); if (*pstring!='\0') { startpos=decode.indexOf (MSMSF_US,startpos); startpos+=sizeof(MSMSF_US); if (startpos >::allocateWithLength(length()); if (_pData!=0) { for (i=0;i<_count;i++) { if (startpos MSError::ErrorStatus MSTypeMatrix::set(unsigned index_,const char *pString_) { Type aType; return msSetFromString(aType,pString_)==MSError::MSSuccess?set(index_,aType):MSError::MSFailure; } template MSError::ErrorStatus MSTypeMatrix::set(unsigned index_,Type aValue_) { if (index_elements()[index_]=aValue_; if (doChanged()==MSTrue) changed(index_); return MSError::MSSuccess; } return MSError::MSFailure; } template unsigned MSTypeMatrix::indexOf(Type aValue_,unsigned startPos_) const { unsigned n=length(); for (unsigned i=startPos_;i unsigned MSTypeMatrix::lastIndexOf(Type aValue_,unsigned startPos_) const { if (length()>0) { unsigned i; if (startPos_>=length()) i=length()-1; else i=startPos_; for (;i!=0;i--) if (elementAt(i)==aValue_) return i; if (i==0) if (elementAt(i)==aValue_) return i; } return length(); } // Assign a MSTypeMatrix to this MSTypeMatrix // aTypeMatrix=bTypeMatrix template MSTypeMatrix& MSTypeMatrix::operator=(const MSTypeMatrix& aTypeMatrix_) { if (this!=&aTypeMatrix_) { freeData(); _count=aTypeMatrix_.length(); _rows=aTypeMatrix_.rows(); _columns=aTypeMatrix_.columns(); _pData=aTypeMatrix_.pData(); (void)incrementCount(); changed(); } return *this; } // Assign a unsigned index selected element of a MSTypeMatrix to all elements of this MSTypeMatrix. // aTypeMatrix=bTypeMatrix[index] template MSTypeMatrix& MSTypeMatrix::operator=(const MSMatrixSTypePick& aPick_) { prepareToChange(); unsigned n=length(); Type s=aPick_.value(); Type *dp=data(); while (n--) *dp++=s; changed(); return *this; } // Assign a Type to all elements of this MSTypeMatrix. // aTypeMatrix=aType template MSTypeMatrix& MSTypeMatrix::operator=(Type scalar_) { prepareToChange(); unsigned n=length(); Type s=scalar_; Type *dp=data(); while (n--) *dp++=s; changed(); return *this; } template MSTypeMatrix& MSTypeMatrix::series(Type offset_) { prepareToChange(); Type j=offset_; unsigned n=length(); Type *dp=data(); while (n--) *dp++=j++; changed(); return *this; } //------------------------------------------------------------------------------------------------- // relational operator functions //------------------------------------------------------------------------------------------------- template long MSTypeMatrix::compare(const MSTypeMatrix& aTypeMatrix_) const { unsigned n=MSUtil::min(length(),aTypeMatrix_.length()); for (unsigned i=0;i MSBinaryMatrix MSTypeMatrix::binaryCompare(const MSTypeMatrix& aTypeMatrix_,MSComparison aComparison_) const { assert(rows()==aTypeMatrix_.rows()&&columns()==aTypeMatrix_.columns()); unsigned aSize=size(); unsigned n=length(); MSTypeData > *d = MSTypeData >::allocateWithSize(aSize); const Type *ap=data(); const Type *bp=aTypeMatrix_.data(); unsigned char *dp=d->elements(); unsigned i; switch (aComparison_) { case MSLessThan: for (i=0;ibp[i]); break; case MSGreaterThanOrEqualTo: for (i=0;i=bp[i]); break; } return MSBinaryMatrix(d,rows(),columns()); } template MSBinaryMatrix MSTypeMatrix::binaryCompare(Type aType_,MSComparison aComparison_) const { unsigned aSize=size(); unsigned n=length(); MSTypeData > *d = MSTypeData >::allocateWithSize(aSize); const Type *ap=data(); unsigned char *dp=d->elements(); unsigned i; switch (aComparison_) { case MSLessThan: for (i=0;iaType_); break; case MSGreaterThanOrEqualTo: for (i=0;i=aType_); break; } return MSBinaryMatrix(d,rows(),columns()); } template MSBoolean MSTypeMatrix::scalarCompare(Type aType_,MSComparison aComparison_) const { unsigned n=length(); if (n>0) { const Type *ap=data(); unsigned i; switch (aComparison_) { case MSLessThan: for (i=0;i=aType_) return MSFalse; break; case MSLessThanOrEqualTo: for (i=0;iaType_) return MSFalse; break; case MSEqualTo: for (i=0;i MSTypeMatrix operator-(const MSTypeMatrix& aTypeMatrix_) { unsigned aSize=aTypeMatrix_.size(); unsigned n=aTypeMatrix_.length(); MSTypeData > *d=MSTypeData >::allocateWithSize(aSize); Type *sp=aTypeMatrix_.data(); Type *dp=d->elements(); while (n--) *dp++=-*sp++; return MSTypeMatrix(d,aTypeMatrix_.rows(),aTypeMatrix_.columns()); } //------------------------------------------------------------------------------------------------- // Prefix/Postfix increment/decrement //------------------------------------------------------------------------------------------------- // Prefix - add/subtract one, then return result template MSTypeMatrix& MSTypeMatrix::operator++() { if (length()>0) { prepareToChange(); unsigned n=length(); Type *sp=data(); for (unsigned i=0;i MSTypeMatrix& MSTypeMatrix::operator--() { if (length()>0) { prepareToChange(); unsigned n=length(); Type *sp=data(); for (unsigned i=0;i MSTypeMatrix MSTypeMatrix::operator++(int) { if (length()>0) { MSTypeMatrix r(*this); prepareToChange(); unsigned n=length(); Type *sp=data(); for (unsigned i=0;i(); } template MSTypeMatrix MSTypeMatrix::operator--(int) { if (length()>0) { MSTypeMatrix r(*this); prepareToChange(); unsigned n=length(); Type *sp=data(); for (unsigned i=0;i(); } template MSMatrixSTypePick& MSMatrixSTypePick::operator++(int) { Type value=pMatrix()->elementAt(_index)+1; _pMatrix->set(_index,value); return *this; } template MSMatrixSTypePick& MSMatrixSTypePick::operator--(int) { Type value=pMatrix()->elementAt(_index)-1; _pMatrix->set(_index,value); return *this; } //------------------------------------------------------------------------------------------------- // arithmetic operator + //------------------------------------------------------------------------------------------------- template MSTypeMatrix operator+(const MSTypeMatrix& aTypeMatrix_,Type aType_) { MSTypeData > *d=0; unsigned n=aTypeMatrix_.length(); unsigned aSize=aTypeMatrix_.size(); if (n>0) { d=MSTypeData >::allocateWithSize(aSize); Type *dp=d->elements(); const Type *ap=aTypeMatrix_.data(); for (unsigned i=0;i(d,aTypeMatrix_.rows(),aTypeMatrix_.columns()); } template MSTypeMatrix operator+(Type aType_,const MSTypeMatrix& aTypeMatrix_) { return aTypeMatrix_+aType_; } template MSTypeMatrix operator+(const MSTypeMatrix& aTypeMatrix_,const MSTypeMatrix& bTypeMatrix_) { assert(aTypeMatrix_.rows()==bTypeMatrix_.rows()&&aTypeMatrix_.columns()==bTypeMatrix_.columns()); MSTypeData > *d=0; unsigned n=aTypeMatrix_.length(); unsigned aSize=aTypeMatrix_.size(); if (n>0) { d=MSTypeData >::allocateWithSize(aSize); Type *dp=d->elements(); const Type *ap=aTypeMatrix_.data(); const Type *bp=bTypeMatrix_.data(); for (unsigned i=0;i(d,aTypeMatrix_.rows(),aTypeMatrix_.columns()); } // apl operation aMatrix_ (x @1 0) aVector_ template MSTypeMatrix operator+(const MSTypeMatrix& aMatrix_,const MSTypeVector& aVector_) { if (aMatrix_.rows()!=aVector_.length()) { aMatrix_.error("(x @1 0) Mismatch."); return MSTypeMatrix(); } MSTypeData > *d=0; unsigned n=aMatrix_.length(); unsigned aSize=aMatrix_.size(); unsigned rows=aMatrix_.rows(),cols=aMatrix_.columns(); if (n>0) { d=MSTypeData >::allocateWithSize(aSize); Type *dp=d->elements(); const Type *mp=aMatrix_.data(); const Type *vp=aVector_.data(); unsigned j; for (unsigned i=0;i(d,rows,cols); } // apl operation aVector_ (x @1 0) aMatrix_ template MSTypeMatrix operator+(const MSTypeVector& aVector_,const MSTypeMatrix& aMatrix_) { return aMatrix_+aVector_; } //------------------------------------------------------------------------------------------------- // arithmetic assignment + operator //------------------------------------------------------------------------------------------------- template MSTypeMatrix& MSTypeMatrix::operator+=(Type aScalar_) { prepareToChange(); unsigned n=length(); Type c=aScalar_; Type *dp=data(); while (n--) *dp++ += c; changed(); return *this; } template MSMatrixSTypePick& MSMatrixSTypePick::operator+=(Type aScalar_) { Type value=pMatrix()->elementAt(_index)+aScalar_; _pMatrix->set(_index,value); return *this; } //------------------------------------------------------------------------------------------------- // arithmetic operator - //------------------------------------------------------------------------------------------------- template MSTypeMatrix operator-(const MSTypeMatrix& aTypeMatrix_,Type aType_) { MSTypeData > *d=0; unsigned n=aTypeMatrix_.length(); unsigned aSize=aTypeMatrix_.size(); if (n>0) { d=MSTypeData >::allocateWithSize(aSize); Type *dp=d->elements(); const Type *ap=aTypeMatrix_.data(); for (unsigned i=0;i(d,aTypeMatrix_.rows(),aTypeMatrix_.columns()); } template MSTypeMatrix operator-(const MSTypeMatrix& aTypeMatrix_,const MSTypeMatrix& bTypeMatrix_) { assert(aTypeMatrix_.rows()==bTypeMatrix_.rows()&&aTypeMatrix_.columns()==bTypeMatrix_.columns()); MSTypeData > *d=0; unsigned n=aTypeMatrix_.length(); unsigned aSize=aTypeMatrix_.size(); if (n>0) { d=MSTypeData >::allocateWithSize(aSize); Type *dp=d->elements(); const Type *ap=aTypeMatrix_.data(); const Type *bp=bTypeMatrix_.data(); for (unsigned i=0;i(d,aTypeMatrix_.rows(),aTypeMatrix_.columns()); } // apl operation aMatrix_ (x @1 0) aVector_ template MSTypeMatrix operator-(const MSTypeMatrix& aMatrix_,const MSTypeVector& aVector_) { if (aMatrix_.rows()!=aVector_.length()) { aMatrix_.error("(x @1 0) Mismatch."); return MSTypeMatrix(); } MSTypeData > *d=0; unsigned n=aMatrix_.length(); unsigned aSize=aMatrix_.size(); unsigned rows=aMatrix_.rows(),cols=aMatrix_.columns(); if (n>0) { d=MSTypeData >::allocateWithSize(aSize); Type *dp=d->elements(); const Type *mp=aMatrix_.data(); const Type *vp=aVector_.data(); unsigned j; for (unsigned i=0;i(d,rows,cols); } //------------------------------------------------------------------------------------------------- // arithmetic assignment - operator //------------------------------------------------------------------------------------------------- template MSTypeMatrix& MSTypeMatrix::operator-=(Type aScalar_) { prepareToChange(); unsigned n=length(); Type c=aScalar_; Type *dp=data(); while (n--) *dp++ -= c; changed(); return *this; } template MSMatrixSTypePick& MSMatrixSTypePick::operator-=(Type aScalar_) { Type value=pMatrix()->elementAt(_index)-aScalar_; _pMatrix->set(_index,value); return *this; } //------------------------------------------------------------------------------------------------- // arithmetic operator * //------------------------------------------------------------------------------------------------- template MSTypeMatrix operator*(const MSTypeMatrix& aTypeMatrix_,Type aType_) { MSTypeData > *d=0; unsigned n=aTypeMatrix_.length(); unsigned aSize=aTypeMatrix_.size(); if (n>0) { d=MSTypeData >::allocateWithSize(aSize); Type *dp=d->elements(); const Type *ap=aTypeMatrix_.data(); for (unsigned i=0;i(d,aTypeMatrix_.rows(),aTypeMatrix_.columns()); } template MSTypeMatrix operator*(Type aType_,const MSTypeMatrix& aTypeMatrix_) { return aTypeMatrix_*aType_; } template MSTypeMatrix operator*(const MSTypeMatrix& aTypeMatrix_,const MSTypeMatrix& bTypeMatrix_) { assert(aTypeMatrix_.rows()==bTypeMatrix_.rows()&&aTypeMatrix_.columns()==bTypeMatrix_.columns()); MSTypeData > *d=0; unsigned n=aTypeMatrix_.length(); unsigned aSize=aTypeMatrix_.size(); if (n>0) { d=MSTypeData >::allocateWithSize(aSize); Type *dp=d->elements(); const Type *ap=aTypeMatrix_.data(); const Type *bp=bTypeMatrix_.data(); for (unsigned i=0;i(d,aTypeMatrix_.rows(),aTypeMatrix_.columns()); } // apl operation aMatrix_ (x @1 0) aVector_ template MSTypeMatrix operator*(const MSTypeMatrix& aMatrix_,const MSTypeVector& aVector_) { if (aMatrix_.rows()!=aVector_.length()) { aMatrix_.error("(x @1 0) Mismatch."); return MSTypeMatrix(); } MSTypeData > *d=0; unsigned n=aMatrix_.length(); unsigned aSize=aMatrix_.size(); unsigned rows=aMatrix_.rows(),cols=aMatrix_.columns(); if (n>0) { d=MSTypeData >::allocateWithSize(aSize); Type *dp=d->elements(); const Type *mp=aMatrix_.data(); const Type *vp=aVector_.data(); unsigned j; for (unsigned i=0;i(d,rows,cols); } // apl operation aVector_ (x @1 0) aMatrix_ template MSTypeMatrix operator*(const MSTypeVector& aVector_,const MSTypeMatrix& aMatrix_) { return aMatrix_*aVector_; } //------------------------------------------------------------------------------------------------- // arithmetic assignment * operator //------------------------------------------------------------------------------------------------- template MSTypeMatrix& MSTypeMatrix::operator*=(Type aScalar_) { prepareToChange(); unsigned n=length(); Type c=aScalar_; Type *dp=data(); while (n--) *dp++ *= c; changed(); return *this; } template MSMatrixSTypePick& MSMatrixSTypePick::operator*=(Type aScalar_) { Type value=pMatrix()->elementAt(_index)*aScalar_; _pMatrix->set(_index,value); return *this; } //------------------------------------------------------------------------------------------------- // arithmetic operator / //------------------------------------------------------------------------------------------------- template MSTypeMatrix operator/(const MSTypeMatrix& aTypeMatrix_,Type aType_) { MSTypeData > *d=0; unsigned n=aTypeMatrix_.length(); unsigned aSize=aTypeMatrix_.size(); if (n>0) { d=MSTypeData >::allocateWithSize(aSize); Type *dp=d->elements(); const Type *ap=aTypeMatrix_.data(); for (unsigned i=0;i(d,aTypeMatrix_.rows(),aTypeMatrix_.columns()); } template MSTypeMatrix operator/(const MSTypeMatrix& aTypeMatrix_,const MSTypeMatrix& bTypeMatrix_) { assert(aTypeMatrix_.rows()==bTypeMatrix_.rows()&&aTypeMatrix_.columns()==bTypeMatrix_.columns()); MSTypeData > *d=0; unsigned n=aTypeMatrix_.length(); unsigned aSize=aTypeMatrix_.size(); if (n>0) { d=MSTypeData >::allocateWithSize(aSize); Type *dp=d->elements(); const Type *ap=aTypeMatrix_.data(); const Type *bp=bTypeMatrix_.data(); for (unsigned i=0;i(d,aTypeMatrix_.rows(),aTypeMatrix_.columns()); } // apl operation aMatrix_ (x @1 0) aVector_ template MSTypeMatrix operator/(const MSTypeMatrix& aMatrix_,const MSTypeVector& aVector_) { if (aMatrix_.rows()!=aVector_.length()) { aMatrix_.error("(x @1 0) Mismatch."); return MSTypeMatrix(); } MSTypeData > *d=0; unsigned n=aMatrix_.length(); unsigned aSize=aMatrix_.size(); unsigned rows=aMatrix_.rows(),cols=aMatrix_.columns(); if (n>0) { d=MSTypeData >::allocateWithSize(aSize); Type *dp=d->elements(); const Type *mp=aMatrix_.data(); const Type *vp=aVector_.data(); unsigned j; for (unsigned i=0;i(d,rows,cols); } //------------------------------------------------------------------------------------------------- // arithmetic assignment / operator //------------------------------------------------------------------------------------------------- template MSTypeMatrix& MSTypeMatrix::operator/=(Type aScalar_) { prepareToChange(); unsigned n=length(); Type c=aScalar_; Type *dp=data(); while (n--) *dp++ /= c; changed(); return *this; } template MSMatrixSTypePick& MSMatrixSTypePick::operator/=(Type aScalar_) { Type value=pMatrix()->elementAt(_index)/aScalar_; _pMatrix->set(_index,value); return *this; } //------------------------------------------------------------------------------------------------- // stack, adjoin //------------------------------------------------------------------------------------------------- template MSTypeMatrix stack(const MSTypeMatrix& aTypeMatrix_,const MSTypeMatrix& bTypeMatrix_) { if (aTypeMatrix_.columns()!=bTypeMatrix_.columns()) { aTypeMatrix_.error("nonconformant MSTypeMatrix stack operands."); return MSTypeMatrix(); } MSTypeData > *d=0; unsigned newLength=(aTypeMatrix_.rows()+bTypeMatrix_.rows())*aTypeMatrix_.columns(); if (newLength>0) { d=MSTypeData >::allocateWithLength(newLength); Type *dp=d->elements(); Type *mp=aTypeMatrix_.data(); Type *row=aTypeMatrix_.data()+aTypeMatrix_.columns(); if (mp!=0) { do { while (mp(d,aTypeMatrix_.rows()+bTypeMatrix_.rows(),aTypeMatrix_.columns()); } // inner product template MSTypeMatrix multiply(const MSTypeMatrix& aTypeMatrix_,const MSTypeMatrix& bTypeMatrix_) { if (aTypeMatrix_.columns()!=bTypeMatrix_.rows()) { aTypeMatrix_.error("nonconformant MSTypeMatrix multiply operands."); return MSTypeMatrix(); } unsigned len=aTypeMatrix_.rows()*bTypeMatrix_.columns(); MSTypeData > *d=MSTypeData >::allocateWithLength(len); Type *aData=aTypeMatrix_.data(), *bData=bTypeMatrix_.data(); Type *dp=d->elements(); Type *row=aData; Type *ap=aData; Type *bp; unsigned column; unsigned aColumns=aTypeMatrix_.columns(), bColumns=bTypeMatrix_.columns(); unsigned aCount=aTypeMatrix_.length(); if (ap!=0) { while ((row+=aColumns)<=aData+aCount) { for (column=0;column(d,aTypeMatrix_.rows(),bColumns); } template MSTypeMatrix& MSTypeMatrix::stack(const MSTypeMatrix& aTypeMatrix_) { if (aTypeMatrix_.columns()!=columns()) { error("nonconformant stack operands."); return *this; } unsigned newLength=(rows()+aTypeMatrix_.rows())*columns(); MSTypeData > *d=0; if (newLength>0) { d=MSTypeData >::allocateWithLength(newLength); Type *dp=d->elements(); Type *mp=data(); Type *row=data()+columns(); if (mp!=0) { do { while (mp0) { MSIndexVector iv; iv.series(aTypeMatrix_.length(),oldLength); changed(iv); } return *this; } template MSTypeMatrix adjoin(const MSTypeMatrix& aTypeMatrix_,const MSTypeMatrix& bTypeMatrix_) { if (aTypeMatrix_.rows()!=bTypeMatrix_.rows()) { aTypeMatrix_.error("nonconformant MSTypeMatrix adjoin operands."); return MSTypeMatrix(); } MSTypeData > *d=0; unsigned newLength=aTypeMatrix_.rows()*(aTypeMatrix_.columns()+bTypeMatrix_.columns()); if (newLength>0) { d=MSTypeData >::allocateWithLength(newLength); Type *dp=d->elements(); Type *mp=aTypeMatrix_.data(); Type *row=aTypeMatrix_.data()+aTypeMatrix_.columns(); if (mp!=0) { do { while (mpelements()+aTypeMatrix_.columns(); mp=bTypeMatrix_.data(); row=bTypeMatrix_.data()+bTypeMatrix_.columns(); if (mp!=0) { do { while (mp(d,aTypeMatrix_.rows(),aTypeMatrix_.columns()+bTypeMatrix_.columns()); } template MSTypeMatrix& MSTypeMatrix::adjoin(const MSTypeMatrix& aTypeMatrix_) { if (rows()!=aTypeMatrix_.rows()) { aTypeMatrix_.error("nonconformant MSTypeMatrix adjoin operands."); return *this; } MSTypeData > *d=0; unsigned newLength=rows()*(columns()+aTypeMatrix_.columns()); if (newLength>0) { d=MSTypeData >::allocateWithLength(newLength); Type *dp=d->elements(); Type *mp=data(); Type *row=data()+columns(); if (mp!=0) { do { while (mpelements()+columns(); mp=aTypeMatrix_.data(); row=aTypeMatrix_.data()+aTypeMatrix_.columns(); if (mp!=0) { do { while (mp0) changed(); return *this; } template MSTypeMatrix& MSTypeMatrix::random(unsigned long limit_) { int n=length(); if (n>0) { prepareToChange(); if (limit_==0) limit_=length(); Type *dp=data(); MSRandom rand; while (n--) *dp++=(Type)rand(limit_); changed(); } return *this; } template Type MSTypeMatrix::min(void) const { Type min; unsigned n=length(); if (n>0) { Type *dp=data(); min=dp[0]; for (unsigned i=1;i Type MSTypeMatrix::max(void) const { Type max; unsigned n=length(); if (n>0) { Type *dp=data(); max=dp[0]; for (unsigned i=1;imax) max=dp[i]; } else max=0; return max; } template double MSTypeMatrix::sum(void) const { double sum=0.0; Type *dp=data(); unsigned n=length(); while (n--) sum+=*dp++; return sum; } template void MSTypeMatrix::error(const char* msg_) const { (*_matrixErrorHandler)(msg_); } //------------------------------------------------------------------------------------------ // matrix manipulation methods //------------------------------------------------------------------------------------------------- template MSTypeMatrix& MSTypeMatrix::appendColumn(const MSTypeVector& aTypeVector_) { if (rows()==0||aTypeVector_.length()!=rows()) { error("MSTypeMatrix length error."); return *this; } unsigned newLength=rows()*(columns()+1); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); Type *dp=d->elements(); Type *mp=data(); Type *vp=aTypeVector_.data(); unsigned i,j; for (j=0;j MSTypeMatrix& MSTypeMatrix::appendColumns(unsigned cols_,Type fill_) { if (rows()==0) { error("MSTypeMatrix length error."); return *this; } unsigned newLength=rows()*(columns()+cols_); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); Type *dp=d->elements(); Type *mp=data(); unsigned i,j; for (j=0;j MSTypeMatrix& MSTypeMatrix::appendRow(const MSTypeVector& aTypeVector_) { if (columns()==0||aTypeVector_.length()!=columns()) { error("MSTypeMatrix length error."); return *this; } unsigned newLength=(rows()+1)*columns(); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); Type *dp=d->elements(); Type *mp=data(); Type *vp=aTypeVector_.data(); unsigned i; for (i=0;i MSTypeMatrix& MSTypeMatrix::appendRows(unsigned rows_, Type fill_) { if (columns()==0) { error("MSTypeMatrix length error."); return *this; } unsigned newLength=(rows()+rows_)*columns(); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); Type *dp=d->elements(); Type *mp=data(); unsigned i,appendLength=columns()*rows_; for (i=0;i MSTypeMatrix& MSTypeMatrix::exchangeColumns(unsigned aColumn_,unsigned bColumn_) { if (aColumn_+1>columns()||bColumn_+1>columns()||aColumn_==bColumn_) return *this; prepareToChange(); Type *aPtr=data()+aColumn_; Type *bPtr=data()+bColumn_; register Type tVal; for (unsigned i=0;i MSTypeMatrix& MSTypeMatrix::exchangeRows(unsigned aRow_,unsigned bRow_) { if (aRow_+1>rows()||bRow_+1>rows()||aRow_==bRow_) return *this; prepareToChange(); Type *aPtr=data()+aRow_*columns(); Type *bPtr=data()+bRow_*columns(); register Type tVal; for (unsigned i=0;i MSTypeMatrix& MSTypeMatrix::insertColumnBefore(unsigned col_,Type fill_) { if (col_+1>columns()) return *this; unsigned newLength=rows()*(columns()+1); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); Type *dp=d->elements(); Type *mp=data(); unsigned i,j; for (j=0;j MSTypeMatrix& MSTypeMatrix::insertColumnBefore(unsigned col_,const MSTypeVector& aTypeVector_) { if (col_+1>columns()) return *this; if (aTypeVector_.length()!=rows()) { error("MSTypeMatrix length error."); return *this; } unsigned newLength=rows()*(columns()+1); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); Type *dp=d->elements(); Type *mp=data(); Type *vp=aTypeVector_.data(); unsigned i,j; for (j=0;j MSTypeMatrix& MSTypeMatrix::insertColumnAfter(unsigned col_,Type fill_) { if (col_+1>columns()) return *this; unsigned newLength=rows()*(columns()+1); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); Type *dp=d->elements(); Type *mp=data(); unsigned i,j; for (j=0;j MSTypeMatrix& MSTypeMatrix::insertColumnAfter(unsigned col_,const MSTypeVector& aTypeVector_) { if (col_+1>columns()) return *this; if (aTypeVector_.length()!=rows()) { error("MSTypeMatrix length error."); return *this; } unsigned newLength=rows()*(columns()+1); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); Type *dp=d->elements(); Type *mp=data(); Type *vp=aTypeVector_.data(); unsigned i,j; for (j=0;j MSTypeMatrix& MSTypeMatrix::insertRowBefore(unsigned row_,Type fill_) { if (row_+1>rows()) return *this; unsigned newLength=(rows()+1)*columns(); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); Type *dp=d->elements(); Type *mp=data(); unsigned i,j; for (j=0;j MSTypeMatrix& MSTypeMatrix::insertRowBefore(unsigned row_,const MSTypeVector& aTypeVector_) { if (row_+1>rows()) return *this; if (aTypeVector_.length()!=columns()) { error("MSTypeMatrix length error."); return *this; } unsigned newLength=(rows()+1)*columns(); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); Type *dp=d->elements(); Type *mp=data(); Type *vp=aTypeVector_.data(); unsigned i,j; for (j=0;j MSTypeMatrix& MSTypeMatrix::insertRowAfter(unsigned row_,Type fill_) { if (row_+1>rows()) return *this; unsigned newLength=(rows()+1)*columns(); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); Type *dp=d->elements(); Type *mp=data(); unsigned i,j; for (j=0;j MSTypeMatrix& MSTypeMatrix::insertRowAfter(unsigned row_,const MSTypeVector& aTypeVector_) { if (row_>rows()) return *this; if (aTypeVector_.length()!=columns()) { error("MSTypeMatrix length error."); return *this; } unsigned newLength=(rows()+1)*columns(); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); Type *dp=d->elements(); Type *mp=data(); Type *vp=aTypeVector_.data(); unsigned i,j; for (j=0;j MSTypeMatrix& MSTypeMatrix::reshape(unsigned rows_,unsigned cols_) { MSTypeData > *d=0; unsigned newLength=rows_*cols_; if (newLength>0) { d=MSTypeData >::allocateWithLength(newLength); Type *dp=d->elements(); Type *mp=data(); Type *end=data()+length(); if (mp==0) for (unsigned i=0;inewLength) for (unsigned i=0;i MSTypeMatrix& MSTypeMatrix::removeAll(void) { freeData(); _rows=0,_columns=0,_count=0; changed(); return *this; } template MSTypeMatrix& MSTypeMatrix::removeAllRows(void) { freeData(); _rows=0,_count=0; changed(); return *this; } template MSTypeMatrix& MSTypeMatrix::removeAllColumns(void) { freeData(); _columns=0,_count=0; changed(); return *this; } template MSTypeMatrix& MSTypeMatrix::assignColumn(unsigned col_,Type scalar_) { if (col_+1>columns()) return *this; prepareToChange(); Type *mp=data(); unsigned i,j; if (receiverList()!=0) { MSIndexVector iv(rows()); for (i=0,j=col_;i MSTypeMatrix& MSTypeMatrix::assignRow(unsigned row_,Type scalar_) { if (row_+1>rows()) return *this; prepareToChange(); Type *mp=data(); unsigned i,j; for (i=row_*columns(),j=0;j MSTypeMatrix& MSTypeMatrix::assignColumn(unsigned col_, const MSTypeVector& aTypeVector_) { if (col_+1>columns()) return *this; if (aTypeVector_.length()!=rows()) { error("MSTypeMatrix length error."); return *this; } prepareToChange(); Type *mp; unsigned i; for (i=0,mp=data()+col_;i MSTypeMatrix& MSTypeMatrix::assignRow(unsigned row_, const MSTypeVector& aTypeVector_) { if (row_+1>rows()) return *this; if (aTypeVector_.length()!=columns()) { error("MSTypeMatrix length error."); return *this; } prepareToChange(); Type *mp; unsigned i; for (i=0,mp=data()+row_*columns();i MSTypeMatrix& MSTypeMatrix::removeRow(unsigned row_) { if (row_+1>rows()) return *this; if (data()==0) return *this; unsigned newLength=(rows()-1)*columns(); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); Type *dp=d->elements(); Type *mp=data(); unsigned i,j; for (i=0;i MSTypeMatrix& MSTypeMatrix::removeColumn(unsigned col_) { if (col_+1>columns()) return *this; if (data()==0) return *this; unsigned newLength=rows()*(columns()-1); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); Type *dp=d->elements(); Type *mp=data(); unsigned i,j; for (i=0;i MSTypeMatrix& MSTypeMatrix::compressRows(const MSBinaryVector& aBinaryVector_ ) { if (data()==0) return *this; if (aBinaryVector_.length()!=rows()) { error("MSTypeMatrix length error."); return *this; } unsigned newLength=(unsigned)(aBinaryVector_.sum()*columns()); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); Type *dp=d->elements(); Type *mp=data(); unsigned i,j; for (i=0;i MSTypeMatrix& MSTypeMatrix::compressColumns(const MSBinaryVector& aBinaryVector_ ) { if (data()==0) return *this; if (aBinaryVector_.length()!=columns()) { error("MSTypeMatrix length error."); return *this; } unsigned newLength=(unsigned)(rows()*aBinaryVector_.sum()); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); Type *dp=d->elements(); Type *mp=data(); unsigned i,j; for (i=0;i MSTypeMatrix& MSTypeMatrix::reverseRows(void) { if (data()==0) return *this; prepareToChange(); unsigned i,j; Type *upperRow=data(); Type *lowerRow=data()+rows()*columns()-columns(); register Type tVal; unsigned n=unsigned(rows()/2); for (i=0;i MSTypeMatrix& MSTypeMatrix::reverseColumns(void) { if (data()==0) return *this; prepareToChange(); unsigned i,j; Type *leftColumn=data(); Type *rightColumn=data()+columns()-1; register Type tVal; unsigned n=unsigned(columns()/2); for (i=0;i MSTypeMatrix& MSTypeMatrix::transpose(void) { if (data()==0) return *this; unsigned aSize=size(); MSTypeData > *d=MSTypeData >::allocateWithSize(aSize); Type *dp=d->elements(); Type *mp=data(); unsigned i,j; for (i=0;i MSTypeMatrix& MSTypeMatrix::rotateRows(int position_) { int rowPosition=MSUtil::abs(position_); if (rowPosition>0&&rowPosition!=rows()) { unsigned i; unsigned aSize=size(); MSTypeData > *d=MSTypeData >::allocateWithSize(aSize); if (rowPosition>rows()) rowPosition%=rows(); if (position_<0) rowPosition=rows()-rowPosition; unsigned start=rowPosition*columns(); Type *mp=data()+start; Type *dp=d->elements(); for (i=start;i MSTypeMatrix& MSTypeMatrix::rotateColumns(int position_) { int columnPosition=MSUtil::abs(position_); if (columnPosition>0&&columnPosition!=columns()) { unsigned i,j; unsigned aSize=size(); MSTypeData > *d=MSTypeData >::allocateWithSize(aSize); if (columnPosition>columns()) columnPosition%=columns(); if (position_<0) columnPosition=columns()-columnPosition; Type *mp=data()+columnPosition; Type *dp=d->elements(); for (j=0;j MSTypeMatrix& MSTypeMatrix::takeRows(int numberOfRows_) { int numberOfRows=MSUtil::abs(numberOfRows_); if (numberOfRows>0&&numberOfRows!=rows()) { unsigned i; unsigned newLength=numberOfRows*columns(); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); Type *mp=data(); Type *dp=d->elements(); if (numberOfRows>rows()) { if (numberOfRows_>0) for (i=0;i0) for (i=0;i MSTypeMatrix& MSTypeMatrix::takeColumns(int numberOfColumns_) { int numberOfColumns=MSUtil::abs(numberOfColumns_); if (numberOfColumns>0&&numberOfColumns!=columns()) { unsigned i,j; unsigned newLength=numberOfColumns*rows(); MSTypeData > *d=MSTypeData >::allocateWithLength(newLength); Type *mp=data(); Type *dp=d->elements(); if (numberOfColumns>columns()) { if (numberOfColumns_>0) { for (i=0;i0) { for (i=0;i MSTypeMatrix& MSTypeMatrix::dropRows(int numberOfRows_) { int numberOfRows=MSUtil::abs(numberOfRows_); if (numberOfRows>0) { if (numberOfRows > *d=MSTypeData >::allocateWithLength(newLength); Type *mp=data(); Type *dp=d->elements(); if (numberOfRows_>0) mp+=numberOfRows*columns(); for (i=0;i MSTypeMatrix& MSTypeMatrix::dropColumns(int numberOfColumns_) { int numberOfColumns=MSUtil::abs(numberOfColumns_); if (numberOfColumns>0) { if (numberOfColumns > *d=MSTypeData >::allocateWithLength(newLength); Type *mp=data(); Type *dp=d->elements(); if (numberOfColumns_>0) { for (i=0;i MSTypeVector MSTypeMatrix::rowAt(unsigned row_) const { if (row_+1>rows()||columns()==0) return MSTypeVector(); MSTypeData > *d=MSTypeData >::allocateWithLength(columns()); Type *mp; Type *dp=d->elements(); unsigned i; for (i=0,mp=data()+row_*columns();i(d,columns()); } template MSTypeVector MSTypeMatrix::columnAt(unsigned column_) const { if (column_+1>columns()||rows()==0) return MSTypeVector(); MSTypeData > *d=MSTypeData >::allocateWithLength(rows()); Type *mp; Type *dp=d->elements(); unsigned i; for (i=0,mp=data()+column_;i(d,rows()); } #endif aplus-fsf-4.22/src/MSTypes/MSTypeVector.C0000644000265000001440000000567410772770472013652 #ifndef MSTypeVectorIMPLEMENTATION #define MSTypeVectorIMPLEMENTATION /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution // // /////////////////////////////////////////////////////////////////////////////// #include #ifdef MS_NO_INLINES #include #endif // MS_NO_INLINES #include #include template MSTypeVector::MSTypeVector() : MSObjectVector() { } template MSTypeVector::MSTypeVector (unsigned int length_) : MSObjectVector (length_) { } template MSTypeVector::MSTypeVector (unsigned int length_, const Type & filler_) : MSObjectVector (length_, filler_) { } template MSTypeVector::MSTypeVector (const MSTypeVector & vect_) : MSObjectVector (vect_) { } template MSTypeVector::MSTypeVector (const MSBaseVector > & vect_) : MSObjectVector (vect_) { } template MSTypeVector::MSTypeVector (const char *pString_) : MSObjectVector (pString_) { } template MSTypeVector::MSTypeVector (MSTypeData > *pData_, unsigned int len_) : MSObjectVector (pData_, len_) { } template MSTypeVector::MSTypeVector (const Type *pElements_, unsigned int len_) : MSObjectVector (pElements_, len_) { } template MSTypeVector::~MSTypeVector() { } template MSTypeVector & MSTypeVector::operator= (const MSTypeVector & vect_) { return (MSTypeVector &) MSObjectVector::operator= (vect_); } template MSTypeVector & MSTypeVector::operator= (const MSBaseVector > & vect_) { return (*this = (MSTypeVector &)vect_); } template MSTypeVector & MSTypeVector::operator= (const Type & value_) { return (MSTypeVector &) MSObjectVector::operator= (value_); } template MSTypeVector & MSTypeVector::operator= (const char *pString_) { return (MSTypeVector &) MSObjectVector::operator= (pString_); } template MSString MSTypeVector::className() const { return name(); } template const MSSymbol & MSTypeVector::type() const { return symbol(); } template MSModel * MSTypeVector::clone() const { return new MSTypeVector (*this); } template MSModel * MSTypeVector::create() const { return new MSTypeVector; } template const MSSymbol & MSTypeVector::symbol() { static MSSymbol sym = MSSymbol(name()); return sym; } #endif // MSTypeVectorIMPLEMENTATION aplus-fsf-4.22/src/main/0000777000265000001440000000000010774512651010625 5aplus-fsf-4.22/src/main/Makefile.am0000644000265000001440000000367210304462653012600 ## Process this file with automake to produce Makefile.in ############################################################################### ## ## ## Copyright (c) 2001 Morgan Stanley Dean Witter & Co. All rights reserved. ## ## See .../src/LICENSE for terms of distribution. ## ## ## ## ## ############################################################################### EXTRA_DIST = version.h.template CXXLD = $(CXX) bin_PROGRAMS = aplus aplus_SOURCES = \ mainC.C \ aplus_main.c \ aplus_uext.c \ matherr.c \ version.h CFLAGS = @CFLAGS@ -DBSTUB INCLUDES = -I.. $(X_INCLUDES) aplus_LDADD = \ $(top_srcdir)/src/IPC/libIPC.la \ $(top_srcdir)/src/cxs/libcxs.la \ $(top_srcdir)/src/cxb/libcxb.la \ $(top_srcdir)/src/AplusGUI/libAplusGUI.la \ $(top_srcdir)/src/cxsys/libcxsys.la \ $(top_srcdir)/src/cxc/libcxc.la \ $(top_srcdir)/src/esf/libesf.la \ $(top_srcdir)/src/a/liba.la \ $(top_srcdir)/src/dap/libdap.la \ $(top_srcdir)/src/MSGUI/libMSGUI.la \ $(top_srcdir)/src/MSIPC/libMSIPC.la \ $(top_srcdir)/src/MSTypes/libMSTypes.la aplus_LDFLAGS = \ -L$(top_srcdir)/src/IPC \ -L$(top_srcdir)/src/cxs \ -L$(top_srcdir)/src/cxb \ -L$(top_srcdir)/src/AplusGUI \ -L$(top_srcdir)/src/cxsys \ -L$(top_srcdir)/src/cxc \ -L$(top_srcdir)/src/esf \ -L$(top_srcdir)/src/a \ -L$(top_srcdir)/src/dap \ -L$(top_srcdir)/src/MSGUI \ -L$(top_srcdir)/src/MSIPC \ -L$(top_srcdir)/src/MSTypes \ $(X_LIBS) $(LIBS) install-exec-hook: mv $(DESTDIR)$(bindir)/aplus $(DESTDIR)$(bindir)/a+ # Additional Targets aplus_main.c: version.h version.h: FORCE echo "Making $@";\ rm -f $@;\ cat version.h.template | sed -e s/%RCVAL%/$(VERSION)/ \ -e s/%FNVAL%/$(OWNER_FULLNAME)/ \ -e s@%IMDIRVAL%@$(prefix)@ >$@; FORCE: aplus-fsf-4.22/src/main/Makefile.in0000644000265000001440000003244110774512524012611 # Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ ############################################################################### ############################################################################### SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CXX = @CXX@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ STRIP = @STRIP@ VERSION = @VERSION@ X_INCLUDES = @X_INCLUDES@ X_LIBS = @X_LIBS@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ EXTRA_DIST = version.h.template CXXLD = $(CXX) bin_PROGRAMS = aplus aplus_SOURCES = \ mainC.C \ aplus_main.c \ aplus_uext.c \ matherr.c \ version.h CFLAGS = @CFLAGS@ -DBSTUB INCLUDES = -I.. $(X_INCLUDES) aplus_LDADD = \ $(top_srcdir)/src/IPC/libIPC.la \ $(top_srcdir)/src/cxs/libcxs.la \ $(top_srcdir)/src/cxb/libcxb.la \ $(top_srcdir)/src/AplusGUI/libAplusGUI.la \ $(top_srcdir)/src/cxsys/libcxsys.la \ $(top_srcdir)/src/cxc/libcxc.la \ $(top_srcdir)/src/esf/libesf.la \ $(top_srcdir)/src/a/liba.la \ $(top_srcdir)/src/dap/libdap.la \ $(top_srcdir)/src/MSGUI/libMSGUI.la \ $(top_srcdir)/src/MSIPC/libMSIPC.la \ $(top_srcdir)/src/MSTypes/libMSTypes.la aplus_LDFLAGS = \ -L$(top_srcdir)/src/IPC \ -L$(top_srcdir)/src/cxs \ -L$(top_srcdir)/src/cxb \ -L$(top_srcdir)/src/AplusGUI \ -L$(top_srcdir)/src/cxsys \ -L$(top_srcdir)/src/cxc \ -L$(top_srcdir)/src/esf \ -L$(top_srcdir)/src/a \ -L$(top_srcdir)/src/dap \ -L$(top_srcdir)/src/MSGUI \ -L$(top_srcdir)/src/MSIPC \ -L$(top_srcdir)/src/MSTypes \ $(X_LIBS) $(LIBS) subdir = src/main mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_CLEAN_FILES = bin_PROGRAMS = aplus$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) am_aplus_OBJECTS = mainC.$(OBJEXT) aplus_main.$(OBJEXT) \ aplus_uext.$(OBJEXT) matherr.$(OBJEXT) aplus_OBJECTS = $(am_aplus_OBJECTS) aplus_DEPENDENCIES = $(top_srcdir)/src/IPC/libIPC.la \ $(top_srcdir)/src/cxs/libcxs.la $(top_srcdir)/src/cxb/libcxb.la \ $(top_srcdir)/src/AplusGUI/libAplusGUI.la \ $(top_srcdir)/src/cxsys/libcxsys.la \ $(top_srcdir)/src/cxc/libcxc.la $(top_srcdir)/src/esf/libesf.la \ $(top_srcdir)/src/a/liba.la $(top_srcdir)/src/dap/libdap.la \ $(top_srcdir)/src/MSGUI/libMSGUI.la \ $(top_srcdir)/src/MSIPC/libMSIPC.la \ $(top_srcdir)/src/MSTypes/libMSTypes.la DEFS = @DEFS@ DEFAULT_INCLUDES = -I. -I$(srcdir) CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/aplus_main.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/aplus_uext.Po ./$(DEPDIR)/mainC.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/matherr.Po CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ CXXFLAGS = @CXXFLAGS@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ DIST_SOURCES = $(aplus_SOURCES) DIST_COMMON = Makefile.am Makefile.in SOURCES = $(aplus_SOURCES) all: all-am .SUFFIXES: .SUFFIXES: .C .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/main/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ rm -f $(DESTDIR)$(bindir)/$$f; \ done clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done aplus$(EXEEXT): $(aplus_OBJECTS) $(aplus_DEPENDENCIES) @rm -f aplus$(EXEEXT) $(CXXLINK) $(aplus_LDFLAGS) $(aplus_OBJECTS) $(aplus_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aplus_main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aplus_uext.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mainC.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/matherr.Po@am__quote@ distclean-depend: -rm -rf ./$(DEPDIR) .C.o: @AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< .C.obj: @AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CXXCOMPILE) -c -o $@ `cygpath -w $<` .C.lo: @AMDEP_TRUE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(LTCXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< CXXDEPMODE = @CXXDEPMODE@ .c.o: @AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< .c.obj: @AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(COMPILE) -c `cygpath -w $<` .c.lo: @AMDEP_TRUE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< CCDEPMODE = @CCDEPMODE@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ETAGS = etags ETAGSFLAGS = tags: TAGS 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; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ 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; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = ../.. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: $(mkinstalldirs) $(DESTDIR)$(bindir) 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_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_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 clean-libtool mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-compile distclean-depend \ distclean-generic distclean-libtool distclean-tags dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-exec-am: install-binPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool uninstall-am: uninstall-binPROGRAMS uninstall-info-am .PHONY: GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool distclean distclean-compile \ distclean-depend distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am info info-am install \ install-am install-binPROGRAMS install-data install-data-am \ install-exec install-exec-am install-info install-info-am \ install-man install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool tags uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-info-am install-exec-hook: mv $(DESTDIR)$(bindir)/aplus $(DESTDIR)$(bindir)/a+ # Additional Targets aplus_main.c: version.h version.h: FORCE echo "Making $@";\ rm -f $@;\ cat version.h.template | sed -e s/%RCVAL%/$(VERSION)/ \ -e s/%FNVAL%/$(OWNER_FULLNAME)/ \ -e s@%IMDIRVAL%@$(prefix)@ >$@; FORCE: # 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: aplus-fsf-4.22/src/main/mainC.C0000644000265000001440000000057610772770472011711 /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1990-2008 Morgan Stanley All rights reserved. // See .../src/LICENSE for terms of distribution. // // /////////////////////////////////////////////////////////////////////////////// extern "C" int aplus_main(long, char**); int main(int c, char **v) { return aplus_main(c, v); } aplus-fsf-4.22/src/main/aplus_main.c0000644000265000001440000003576210772745222013052 /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley Dean Witter & Co. All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include extern I Tf; /* internal macro declarations */ #define ACKNOWLEDGE_LICENSE_FILE ".apluslicok" #define BANNER "A+" #define COPYRIGHT \ "Copyright (c) 1990-2008 Morgan Stanley. All rights reserved." #define POR_UNSET (0) #define POR_DEVWORK (1) #define POR_DEV (2) #define POR_MAINTWORK (3) #define POR_MAINT (4) #define POR_ALPHA (5) #define POR_BETA (6) #define POR_PROD (7) #define POR_OFFTRACK (8) #include /* per tree definitions */ /* internal function declarations */ static void initReleaseData(C*); static void initVersion(void); static void initDefaultATREE(C*); static void startupSyslog(C*); void initCallouts(void); static void printId(void); static void envinit(void); static void xi(C*); static I parseargs(I,C**); static void ignore_dup(I); static void argvInstall(I,C**,I); static void atmpinit(void); /* internal data definitions */ static I _majorRelease = 0; static I _minorRelease = 0; static I _phaseOfRelease = POR_UNSET; static C *_workingCopy = OWNER_FULLNAME; static C *_releaseCode = RELEASE_CODE; static C *_whoseTree = ""; static C *_banner = BANNER; static C *_copyright = COPYRIGHT; static C *_defaultATREE = (char *)0; static C *_version = (char *)0; static C *usage = "usage: a+ [-d display] [-s] [-w workarea] [-q] [-h megsforheap] [-m atmpMode] [script [args]]\n"; static I _enable_coredump; static I _backing_store; static C *_display; static I _load_s; static I _workarea; static I _megsforheap; static I _quiet = 0; static I _atmp_mode = WS_ATMP_SHARED; #ifdef _INTERPRETER_ONLY #include static void getm() { fd_set read_fd; FD_ZERO(&read_fd); FD_SET(fileno(stdin),&read_fd); if(-1==select(fileno(stdin)+1, &read_fd,0,0,0) && Tf) NL, sbi(), pr(); else if(FD_ISSET(fileno(stdin), &read_fd)) tf(); } #endif void aplus_main(long argc, char** argv) { #if !defined(_INTERPRETER_ONLY) extern void AplusLoop(); #endif I i; /* the number of arguments parsed */ #if !defined(_INTERPRETER_ONLY) dapinit(); #endif initReleaseData(_releaseCode); initVersion(); initDefaultATREE(argv[0]); initCallouts(); i = parseargs(argc, argv); if( !_quiet ) printId(); atmpinit(); envinit(); if(0!=_megsforheap)setk1(_megsforheap); /* must be before mem init! */ ai(_workarea); /* initialize */ if(_enable_coredump) { setSigv(1); setSigb(1); coreLimSet(aplusInfinity); } versSet(_version); releaseCodeSet(_releaseCode); phaseOfReleaseSet(_phaseOfRelease); majorReleaseSet(_majorRelease); minorReleaseSet(_minorRelease); startupSyslog(_version); xi(argv[0]); /* installation */ argvInstall(argc, argv, i); /* set up _argv */ uextInstall(); /* user lib install */ #if !defined(_INTERPRETER_ONLY) AplusLoop(argc, argv, i); #else if (i < argc && argv[i] && *argv[i]) loadafile(argv[i],0); if (Tf) pr(); while(1) getm(); #endif /********************************************************************** These functions are moved to AplusLoop if (i < argc && argv[i] && *argv[i]) loadafile(argv[i],0); / * load script * / if (Tf) pr(); / * initial prompt * / **********************************************************************/ } static void startupSyslog(C* version) { C *s=bnstring("",0); struct passwd *pwd; uid_t uid=getuid(); openlog(s,LOG_PID,LOG_LOCAL1); if ((pwd = getpwuid(uid)) && pwd->pw_name) syslog(LOG_INFO, pwd->pw_name); else syslog(LOG_INFO, "user == %d",uid); closelog();bfree(s); } static void initReleaseData(C* rcode) { if ('m'==*rcode) { _minorRelease = 0; ++rcode; if (!ISdigit(*rcode)) goto breakout; if (0>=(_majorRelease = (I)strtol(rcode,&rcode,10))) goto breakout; if ('.'==*rcode) { _phaseOfRelease = POR_MAINTWORK; _whoseTree = strdup(1+rcode); } else if (!*rcode) _phaseOfRelease = POR_MAINT; } else if (!strncmp(rcode,"dev",3)) { _minorRelease = 0; _majorRelease = 3; rcode += 3; if ( *rcode && '.'!=*rcode) goto breakout; if ( *rcode) { _phaseOfRelease = POR_DEVWORK; _whoseTree = strdup(1+rcode); } else _phaseOfRelease = POR_DEV; } else if (ISdigit(*rcode)) { if (0>=(_majorRelease = (I)strtol(rcode,&rcode,10))) goto breakout; if ('a'==*rcode) _phaseOfRelease = POR_ALPHA; else if ('b'==*rcode) _phaseOfRelease = POR_BETA; else if ('.'==*rcode) _phaseOfRelease = POR_PROD; else goto breakout; ++rcode; if (POR_ALPHA == _phaseOfRelease && !*rcode) goto breakout; else { if (!ISdigit(*rcode)) { _phaseOfRelease = POR_UNSET; goto breakout; } if (0>(_minorRelease = (I)strtol(rcode,&rcode,10))) goto breakout; } if (*rcode) { _phaseOfRelease = POR_UNSET; goto breakout; } } else if (!strncmp(rcode,"off",3)) { _minorRelease = _majorRelease = 0; rcode +=3; if ( *rcode && '.'!=*rcode) goto breakout; _phaseOfRelease = POR_OFFTRACK; if (*rcode) _whoseTree = strdup(1+rcode); } breakout: if (POR_UNSET == _phaseOfRelease) _majorRelease = _minorRelease = 0; return; } static void initVersion(void) { if (_version != (char *)(0)) return; switch (_phaseOfRelease) { case POR_DEVWORK: _version = bgprintf(strlen((DEV_STRARG)_workingCopy) + 64, "%s's latest development", _workingCopy); break; case POR_DEV: _version = bstring("Development"); break; case POR_MAINTWORK: _version = bgprintf(strlen((DEV_STRARG)_workingCopy) + 64, "%s's latest maintenance of Release %d", _workingCopy, _majorRelease); break; case POR_MAINT: _version = bgprintf(64, "Maintenance of Release %d", _majorRelease); break; case POR_ALPHA: _version = bgprintf(64, "Release %d alpha", _majorRelease); break; case POR_BETA: _version = bgprintf(64, "Release %d beta %0*d", _majorRelease, 100>_minorRelease?2:4, _minorRelease); break; case POR_PROD: if( strlen(_workingCopy) ) _version = bgprintf(64, "%s %d.%0*d",_workingCopy, _majorRelease, 100>_minorRelease?2:4, _minorRelease); else _version = bgprintf(64, "Release %d.%0*d", _majorRelease, 100>_minorRelease?2:4, _minorRelease); break; case POR_OFFTRACK: if (_majorRelease) _version = bgprintf(strlen((DEV_STRARG)_workingCopy) + 64, "%s's off-track version of Release %d", _workingCopy, _majorRelease); else _version = bgprintf(strlen((DEV_STRARG)_workingCopy) + 64, "%s's off-track version of Development Release", _workingCopy); break; default: Exit(1, "PHASE_OF_RELEASE == %d, which is invalid\n", _phaseOfRelease); } return; } static void initDefaultATREE(C *argv0) { if (_defaultATREE != (char *)(0)) return; { /* Try to set ATREE by argv[0] */ int i; C *s, *st, ss[]={"/lib/s.+"}; if(NULL == strchr(argv0,'/')) st=(C *)searchPATH(argv0); else st=strdup(argv0); s=(C *)malloc( (strlen(st)+strlen(ss)+1) * sizeof(C) ); strcpy(s,st); free(st); if ( s && s[0]=='/' ){ /* should be fully qualified */ for(i=strlen(s)-1;i;i--) {if(s[i]=='/') break;} if(0==strncmp(&s[MAX(0,i-4)],"/bin",4)) { s[MAX(0,i-4)]='\0'; strcat(s,ss); if (!unloadable(s,R_OK)){ /* Look for ATREE/lib/s.+ */ s[MAX(0,i-4)]='\0'; _defaultATREE = strdup(s); free(s); return; } } } if(s) free(s); } switch (_phaseOfRelease) { case POR_DEVWORK: case POR_DEV: case POR_MAINTWORK: case POR_MAINT: case POR_OFFTRACK: case POR_ALPHA: case POR_BETA: case POR_PROD: _defaultATREE = bstring(IMDIR); break; default: Exit(1, "PHASE_OF_RELEASE == %d, which is invalid\n", _phaseOfRelease); } return; } static void printId(void) { if (_banner != (char *)(0)) fprintf(stderr, " %s\n", _banner); if (_copyright != (char *)(0)) fprintf(stderr, " %s\n", _copyright); if (_version != (char *)(0)) fprintf(stderr, " This version is %s\n", _version); fflush(stderr); } #ifdef BSTUB extern void setAplusMemStatsMode(int mode_); /* a/bstub.c */ static void atmpinit() { if ( _atmp_mode==WS_MEM_STATS ) setAplusMemStatsMode(1); } #else static void atmpinit() { if ( (_atmp_mode==WS_MALLOC) || (atmpMissing() && _atmp_mode!=WS_ATMP_HEAP) ) { pf_tmp = tmp_malloc; pf_ma = ma_malloc; pf_mf = mf_malloc; } else setAtmpMmapFlags(_atmp_mode); } #endif static void envinit(void) { char *display; char *atree; char *apath; if (_display != (char *)(0)) { display = bnstring("DISPLAY=", _display, (char *)(0)); putenv(display); } if ((atree = getenv("ATREE")) == (char *)(0)) { atree = bnstring("ATREE=", _defaultATREE, (char *)(0)); putenv(atree); atree = getenv("ATREE"); } if ((apath = getenv("APATH")) == (char *)(0)) { apath = bnstring("APATH=.:", atree, "/lib",(char *)(0)); putenv(apath); } return; } static void xi(C* argv0) { ovliInstall(); dyldSlowInstall(argv0); /* both dyme 0 and dyme 2 */ esfInstall(); #if !defined(_INTERPRETER_ONLY) CppInstall(); #endif cInstall(); sysInstall(); binaryInstall(); #if !defined(_INTERPRETER_ONLY) /* TK set backing store */ s_backingStoreOption(_backing_store); XaInstall(); if (_load_s) sInstall(); ipcInstall(); #endif return; } static I parseargs(argc, argv) register I argc; register C *argv[]; { I isinvalid = 0; C *optlist = "bcd:w:sh:qm:"; I bflag = 0, cflag=0, dflag = 0, wflag = 0, sflag = 0, hflag = 0; I qflag = 0, mflag = 0; I c; C *ep; /* points to end of option argument */ if (argsfirst(argc, argv) != 0) { Warn("%t usage: argument list is empty\n"); isinvalid = 1; } while ((c = argsgetopt(argc, argv, optlist)) != -1) { switch (c) { case 'b': if (bflag == 0) { bflag = 1; _backing_store = 0; } else ignore_dup(c); break; case 'c': if (cflag == 0) { cflag = 1; _enable_coredump = 1; } else ignore_dup(c); break; case 'd': if (dflag == 0) { dflag = 1; _display = bstring(args_value); } else ignore_dup(c); break; case 'h': if (hflag == 0) { hflag = 1; _megsforheap = (I)strtol(args_value, &ep, 10); if ((*ep != '\0') || (_megsforheap < 1)) { Warn("%t usage: '%s' is an invalid heap size\n",args_value); isinvalid = 1; } } else ignore_dup(c); break; case 's': if (sflag == 0) { sflag = 1; _load_s = 0; } else ignore_dup(c); break; case 'w': if (wflag == 0) { wflag = 1; _workarea = (I)strtol(args_value, &ep, 10); if ((*ep != '\0') || (_workarea < 1)) { Warn("%t usage: '%s' is an invalid workarea size\n",args_value); isinvalid = 1; } } else ignore_dup(c); break; case 'q': if (qflag == 0) { qflag = 1; _quiet = 1; } else ignore_dup(c); break; case 'm': if (mflag == 0) { mflag = 1; if( !strcmp(args_value,"ws_atmp_noreserve") ) _atmp_mode = WS_ATMP_NORESERVE; else if( !strcmp(args_value,"ws_malloc") ) _atmp_mode = WS_MALLOC; else if( !strcmp(args_value,"ws_atmp_heap") ) _atmp_mode = WS_ATMP_HEAP; else if( !strcmp(args_value,"ws_atmp_private") ) _atmp_mode = WS_ATMP_PRIVATE; else if( !strcmp(args_value,"ws_atmp_shared") ) _atmp_mode = WS_ATMP_SHARED; else if( !strcmp(args_value,"ws_mem_stats") ) _atmp_mode = WS_MEM_STATS; else { Warn("%t usage: '%s' is an invalid memory mode\n", args_value); isinvalid = 1; } } else ignore_dup(c); break; default: Warn("%t usage: -%c is an unknown option\n", c); isinvalid = 1; break; } } /* check for presence of required options */ if (isinvalid) { Exit(1, usage); } /* set up defaults as necessary */ if (cflag == 0) { if( getenv("APLUS_ENABLE_COREDUMP")) _enable_coredump = 1; } if (bflag == 0) _backing_store = 1; if (dflag == 0) _display = (char *)(0); if (sflag == 0) _load_s = 0; if (wflag == 0) _workarea = 4; if (hflag == 0) _megsforheap = 0; if (qflag == 0) _quiet = 0; if (mflag == 0) { char *aplus_atmp_model; /* Set ATMP Platform Defaults */ #if defined(_WS_ATMP_NORESERVE) _atmp_mode = WS_ATMP_NORESERVE; #else _atmp_mode = WS_ATMP_SHARED; #endif /* Check for environment override */ if( aplus_atmp_model=getenv("APLUS_ATMP_MODEL") ) { if( !strcmp(aplus_atmp_model,"ws_atmp_noreserve") ) _atmp_mode = WS_ATMP_NORESERVE; else if( !strcmp(aplus_atmp_model,"ws_malloc") ) _atmp_mode = WS_MALLOC; else if( !strcmp(aplus_atmp_model,"ws_atmp_heap") ) _atmp_mode = WS_ATMP_HEAP; else if( !strcmp(aplus_atmp_model,"ws_atmp_private") ) _atmp_mode = WS_ATMP_PRIVATE; else if( !strcmp(aplus_atmp_model,"ws_atmp_shared") ) _atmp_mode = WS_ATMP_SHARED; else Warn("Invalid Environment Variable APLUS_ATMP_MODEL=%s is ignored...\n", aplus_atmp_model); } } return args_index; } static void ignore_dup(I c) { Warn("%t usage: duplicate -%c option ignored\n", c); return; } static A gst(I x,C* s){A r=(A)gsv(x,s);r->r=1;return r;} static void argvInstall(I argc, C** argv, I offset) { A aobj; V v; I i=0; if (argc < offset) { argv += argc; argc = 0; } else { argv += offset; argc -= offset; } aobj = gv(Et, argc); while (argc--) aobj->p[i++] = (I)gst(0, *argv++); v = vi(si("_argv"), Rx); if (v->a) dc((A)v->a); v->a = (I)aobj; v->t=0; return; } #if defined(_INTERPRETER_ONLY) void no_op(void){}; void initCallouts(void) { extern void stdinDisable(), stdinEnable(); setfunc_dst(no_op); setfunc_xf(no_op); setfunc_xup(no_op); setfunc_vfy(no_op); setfunc_disable(no_op); setfunc_enable(no_op); } #else void initCallouts(void) { extern void destroyVar(), flush(), update(), stdinDisable(), stdinEnable(); extern I verify(); setfunc_dst(destroyVar); setfunc_xf(flush); setfunc_xup(update); setfunc_vfy(verify); setfunc_disable(stdinDisable); setfunc_enable(stdinEnable); } #endif aplus-fsf-4.22/src/main/aplus_uext.c0000644000265000001440000000106310772770472013103 /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ uextInstall() { } aplus-fsf-4.22/src/main/matherr.c0000644000265000001440000000114210772770472012352 /*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #include int matherr(struct exception *exc) {return 1;} aplus-fsf-4.22/src/main/version.h0000644000265000001440000000151210774512650012375 #ifndef included_main_version_h #define included_main_version_h /*****************************************************************************/ /* */ /* Copyright (c) 1990-2001 Morgan Stanley Dean Witter & Co. All rights reserved. */ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* external macro declarations */ #define RELEASE_CODE "4.22" #define OWNER_FULLNAME "" #define IMDIR "/usr/local" #endif /* included_main_version_h */ aplus-fsf-4.22/src/main/version.h.template0000644000265000001440000000152407232124762014210 #ifndef included_main_version_h #define included_main_version_h /*****************************************************************************/ /* */ /* Copyright (c) 1990-2001 Morgan Stanley Dean Witter & Co. All rights reserved. */ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* external macro declarations */ #define RELEASE_CODE "%RCVAL%" #define OWNER_FULLNAME "%FNVAL%" #define IMDIR "%IMDIRVAL%" #endif /* included_main_version_h */ aplus-fsf-4.22/src/html/0000777000265000001440000000000010774512674010652 5aplus-fsf-4.22/src/html/Makefile.am0000444000265000001440000003727107357676174012643 ## Process this file with automake to produce Makefile.in ############################################################################### ## ## ## Copyright (c) 2001 Morgan Stanley Dean Witter and Co. ## ## All rights reserved. ## ## See .../src/LICENSE for terms of distribution. ## ## ## ############################################################################### SUBDIRS = tutorials htmldir = $(prefix)/doc/html html_DATA = \ A-head3.gif \ A2.gif \ A2a50063.gif \ APLcode8m.gif \ APlusRefScreen_AFrame_40R.gif \ APlusRefV2_10.html \ APlusRefV2_11.html \ APlusRefV2_12.html \ APlusRefV2_13.html \ APlusRefV2_14.html \ APlusRefV2_15.html \ APlusRefV2_16.html \ APlusRefV2_17.html \ APlusRefV2_18.html \ APlusRefV2_19.html \ APlusRefV2_2.html \ APlusRefV2_20.html \ APlusRefV2_21.html \ APlusRefV2_22.html \ APlusRefV2_23.html \ APlusRefV2_24.html \ APlusRefV2_25.html \ APlusRefV2_26.html \ APlusRefV2_27.html \ APlusRefV2_28.html \ APlusRefV2_29.html \ APlusRefV2_3.html \ APlusRefV2_30.html \ APlusRefV2_31.html \ APlusRefV2_32.html \ APlusRefV2_32HG.html \ APlusRefV2_32HGr.html \ APlusRefV2_33.html \ APlusRefV2_34.html \ APlusRefV2_34HS.html \ APlusRefV2_35.html \ APlusRefV2_36.html \ APlusRefV2_37.html \ APlusRefV2_37NB.html \ APlusRefV2_38.html \ APlusRefV2_39.html \ APlusRefV2_4.html \ APlusRefV2_40.html \ APlusRefV2_40R.html \ APlusRefV2_41.html \ APlusRefV2_42.html \ APlusRefV2_43.html \ APlusRefV2_44.html \ APlusRefV2_45.html \ APlusRefV2_46.html \ APlusRefV2_46VG.html \ APlusRefV2_46VGr.html \ APlusRefV2_47.html \ APlusRefV2_48.html \ APlusRefV2_48VS.html \ APlusRefV2_49.html \ APlusRefV2_5.html \ APlusRefV2_50.html \ APlusRefV2_51.html \ APlusRefV2_52.html \ APlusRefV2_53.html \ APlusRefV2_54.html \ APlusRefV2_55.html \ APlusRefV2_56.html \ APlusRefV2_56p.html \ APlusRefV2_57.html \ APlusRefV2_58.html \ APlusRefV2_59.html \ APlusRefV2_6.html \ APlusRefV2_60.html \ APlusRefV2_61.html \ APlusRefV2_62.html \ APlusRefV2_63.html \ APlusRefV2_65.html \ APlusRefV2_66.html \ APlusRefV2_67.html \ APlusRefV2_68.html \ APlusRefV2_69.html \ APlusRefV2_7.html \ APlusRefV2_70.html \ APlusRefV2_71.html \ APlusRefV2_72.html \ APlusRefV2_73.html \ APlusRefV2_74.html \ APlusRefV2_75.html \ APlusRefV2_76.html \ APlusRefV2_77.html \ APlusRefV2_78.html \ APlusRefV2_79.html \ APlusRefV2_8.html \ APlusRefV2_80.html \ APlusRefV2_81.html \ APlusRefV2_82.html \ APlusRefV2_83.html \ APlusRefV2_84.html \ APlusRefV2_85.html \ APlusRefV2_86.html \ APlusRefV2_86s.html \ APlusRefV2_86sys.html \ APlusRefV2_87.html \ APlusRefV2_88.html \ APlusRefV2_89.html \ APlusRefV2_9.html \ APlusRefV2_90.html \ APlusRefV2_91.html \ APlusRefV2_92.html \ APlusRefV2_92sc.html \ APlusRefV2_92sf.html \ APlusRefV2_92sv.html \ APlusRefV2_93.html \ APlusRefV2_AFrame_1.gif \ APlusRefV2_AFrame_103.gif \ APlusRefV2_AFrame_119.gif \ APlusRefV2_AFrame_120.gif \ APlusRefV2_AFrame_13.gif \ APlusRefV2_AFrame_133.gif \ APlusRefV2_AFrame_135.gif \ APlusRefV2_AFrame_138.gif \ APlusRefV2_AFrame_16.gif \ APlusRefV2_AFrame_17.gif \ APlusRefV2_AFrame_171.gif \ APlusRefV2_AFrame_177.gif \ APlusRefV2_AFrame_18.gif \ APlusRefV2_AFrame_182.gif \ APlusRefV2_AFrame_195.gif \ APlusRefV2_AFrame_199.gif \ APlusRefV2_AFrame_201.gif \ APlusRefV2_AFrame_203.gif \ APlusRefV2_AFrame_205.gif \ APlusRefV2_AFrame_207.gif \ APlusRefV2_AFrame_210.gif \ APlusRefV2_AFrame_36.gif \ APlusRefV2_AFrame_38.gif \ APlusRefV2_AFrame_4.gif \ APlusRefV2_AFrame_45.gif \ APlusRefV2_AFrame_47.gif \ APlusRefV2_AFrame_49.gif \ APlusRefV2_AFrame_50.gif \ APlusRefV2_AFrame_96.gif \ APlusRefV2_AFrame_97.gif \ APlusRefV2_FootNote_950.html \ APlusRefV2_FootNote_952.html \ APlusRefV2_FootNote_955.html \ APlusRefV2_FootNote_956.html \ APlusRefV2_FootNote_957.html \ APlusRefV2_FootNote_958.html \ APlusRefV2_FootNote_960.html \ APlusRefV2_FootNote_963.html \ APlusRefV2_FootNote_964.html \ APlusRef_3D_1.gif \ APlusRef_3D_2.gif \ APlusRef_3D_3.gif \ APlusRef_3D_4.gif \ APlusRef_3D_4.ras \ APlusRef_ScrnMgmt_1-1a.gif \ APlusRef_ScrnMgmt_1-1b.gif \ APlusRef_ScrnMgmt_1-1c.gif \ APlusRef_ScrnMgmt_1-2.gif \ APlusRef_ScrnMgmt_1-3a.gif \ APlusRef_ScrnMgmt_1-3b.gif \ APlusRef_ScrnMgmt_1-4a.gif \ APlusRef_ScrnMgmt_1-4b.gif \ APlusRef_ScrnMgmt_1-5a.gif \ APlusRef_ScrnMgmt_1-5b.gif \ APlusRef_ScrnMgmt_1-5c.gif \ APlusRef_ScrnMgmt_1-5d.gif \ APlusRef_ScrnMgmt_1-6a.gif \ APlusRef_ScrnMgmt_1-6b.gif \ APlusRef_ScrnMgmt_1-7a.gif \ APlusRef_ScrnMgmt_1-7b.gif \ ARindexindex.html \ ARstart.html \ ARtoc.html \ AcharsRB.gif \ Acro123.pdf \ AcroCh3.pdf \ AcroCh4.pdf \ AcroCh5.pdf \ AcroTest.pdf \ FontAPLonPC.html \ kbchart.a \ keyboard_TOP \ Att-3.gif \ Att-A.gif \ Att-ALL.gif \ Att-ALLlist.gif \ Att-B.gif \ Att-C.gif \ Att-CNFT.gif \ Att-CNT.gif \ Att-D.gif \ Att-E.gif \ Att-G.gif \ Att-GS.gif \ Att-I.gif \ Att-K.gif \ Att-L.gif \ Att-M.gif \ Att-N.gif \ Att-NFT.gif \ Att-O.gif \ Att-P.gif \ Att-Q.gif \ Att-R.gif \ Att-Rp.gif \ Att-S.gif \ Att-T.gif \ Att-TOP.gif \ Att-U.gif \ Att-V.gif \ Att-W.gif \ Att-X.gif \ Att-gT.gif \ Att-hG.gif \ Att-hM.gif \ Att-hP.gif \ Att-hR.gif \ Att-hS.gif \ Att-lca.gif \ Att-lccb.gif \ Att-lccbU.gif \ Att-lcfn.gif \ Att-lcfnU.gif \ Att-lco.gif \ Att-lcp.gif \ Att-lcr.gif \ Att-lcs.gif \ Att-lcx.gif \ Att-lcy.gif \ Att-more.gif \ Att-tF.gif \ Att-vG.gif \ Att-vM.gif \ Att-vP.gif \ Att-vR.gif \ Att-vS.gif \ BN3Xcopyr.jpg \ BN3Xemail.gif \ BN3Xemail.jpg \ BN3Xhome.gif \ BN3Xhome.jpg \ BN3Xlicen.jpg \ BN3Xnews.gif \ BN3Xnews.jpg \ BN3Xonlin.gif \ BN3Xonlin.jpg \ BN3Xrefmn.gif \ BN3Xrefmn.jpg \ BN3copyr.jpg \ BN3email.gif \ BN3email.jpg \ BN3home.gif \ BN3home.jpg \ BN3licen.jpg \ BN3news.gif \ BN3news.jpg \ BN3onlin.gif \ BN3onlin.jpg \ BN3onlin2.gif \ BN3refmn.gif \ BN3refmn.jpg \ BNtop.gif \ Class.png \ ClassHierarchy.gif \ ColorSamples.html \ DefnLM01.gif \ DefnLM02.gif \ DefnLM03.gif \ DefnLM04.gif \ DefnLM05.gif \ DefnLM06.gif \ DefnLM07.gif \ DefnLM08.gif \ DefnLM09.gif \ DefnLM10.gif \ DefnLM11.gif \ DefnLM12.gif \ DefnLM13.gif \ DefnLM14.gif \ DefnMode.html \ DisplayClasses.html \ EbyE1c.gif \ EbyE2c.gif \ EbyE3c.gif \ FigAction.gif \ FigArray.gif \ FigButton.gif \ FigCheck.gif \ FigChoice.gif \ FigChoiceDrop.gif \ Fig_12-6.gif \ FlashCardsLs.gif \ GraphObject.gif \ InfoSign.gif \ KeyXp1.gif \ KeyboardInt.gif \ KeyboardTent.gif \ KeyboardTentL.gif \ LicenseAgreement.html \ ManualCy2.gif \ Manuals.gif \ MapFigDropDown.html \ MapFigFrame.html \ MapFigHighlight.html \ MapFigLabel-ValueAreas.html \ MapFigLabelAreas.html \ MapFigLabels.html \ MapFigMaxButton.html \ MapFigMenuButton.html \ MapFigMenuLabels.html \ MapFigMinButton.html \ MapFigOverall.html \ MapFigResizeCorners.html \ MapFigScrollBars.html \ MapFigShadowBar.html \ MapFigShellTitle.html \ MapFigShellTitleArea.html \ MapFigTitle.html \ MapFigTitleArea.html \ MapFigValueArea.html \ MapFigValueButton.html \ MapFigValueCell.html \ MapFigValueCells.html \ MapFigValueChoice.html \ MapFigValueChoiceArea.html \ PxPurple.gif \ StarburstNew.gif \ StarburstNewB.gif \ TreeObject.gif \ command.gif \ getacro.gif \ hgauge.gif \ hgrid.gif \ hmenu.gif \ hpane.gif \ keybPers.gif \ keybUsers3.gif \ keybUsers5.gif \ keybd90b.gif \ keybdBW.html \ keyboard.gif \ keyboard.html \ keyboard_BOTTOM \ keyboard_help.html \ label.gif \ layout.gif \ matrix.gif \ notebook.gif \ page.gif \ password.gif \ pixel.gif \ radio.gif \ refman.html \ scalar.gif \ slot1.gif \ slot2.gif \ slot3.gif \ style.css \ table.gif \ text.gif \ tree.gif \ view.gif \ vmenu.gif \ vpane.gif \ window.gif EXTRA_DIST = \ A-head3.gif \ A-head3grey3.gif \ A2.gif \ A2a50063.gif \ APLcode8m.gif \ APlusRefScreen_AFrame_40R.gif \ APlusRefV2_10.html \ APlusRefV2_11.html \ APlusRefV2_12.html \ APlusRefV2_13.html \ APlusRefV2_14.html \ APlusRefV2_15.html \ APlusRefV2_16.html \ APlusRefV2_17.html \ APlusRefV2_18.html \ APlusRefV2_19.html \ APlusRefV2_2.html \ APlusRefV2_20.html \ APlusRefV2_21.html \ APlusRefV2_22.html \ APlusRefV2_23.html \ APlusRefV2_24.html \ APlusRefV2_25.html \ APlusRefV2_26.html \ APlusRefV2_27.html \ APlusRefV2_28.html \ APlusRefV2_29.html \ APlusRefV2_3.html \ APlusRefV2_30.html \ APlusRefV2_31.html \ APlusRefV2_32.html \ APlusRefV2_32HG.html \ APlusRefV2_32HGr.html \ APlusRefV2_33.html \ APlusRefV2_34.html \ APlusRefV2_34HS.html \ APlusRefV2_35.html \ APlusRefV2_36.html \ APlusRefV2_37.html \ APlusRefV2_37NB.html \ APlusRefV2_38.html \ APlusRefV2_39.html \ APlusRefV2_4.html \ APlusRefV2_40.html \ APlusRefV2_40R.html \ APlusRefV2_41.html \ APlusRefV2_42.html \ APlusRefV2_43.html \ APlusRefV2_44.html \ APlusRefV2_45.html \ APlusRefV2_46.html \ APlusRefV2_46VG.html \ APlusRefV2_46VGr.html \ APlusRefV2_47.html \ APlusRefV2_48.html \ APlusRefV2_48VS.html \ APlusRefV2_49.html \ APlusRefV2_5.html \ APlusRefV2_50.html \ APlusRefV2_51.html \ APlusRefV2_52.html \ APlusRefV2_53.html \ APlusRefV2_54.html \ APlusRefV2_55.html \ APlusRefV2_56.html \ APlusRefV2_56p.html \ APlusRefV2_57.html \ APlusRefV2_58.html \ APlusRefV2_59.html \ APlusRefV2_6.html \ APlusRefV2_60.html \ APlusRefV2_61.html \ APlusRefV2_62.html \ APlusRefV2_63.html \ APlusRefV2_65.html \ APlusRefV2_66.html \ APlusRefV2_67.html \ APlusRefV2_68.html \ APlusRefV2_69.html \ APlusRefV2_7.html \ APlusRefV2_70.html \ APlusRefV2_71.html \ APlusRefV2_72.html \ APlusRefV2_73.html \ APlusRefV2_74.html \ APlusRefV2_75.html \ APlusRefV2_76.html \ APlusRefV2_77.html \ APlusRefV2_78.html \ APlusRefV2_79.html \ APlusRefV2_8.html \ APlusRefV2_80.html \ APlusRefV2_81.html \ APlusRefV2_82.html \ APlusRefV2_83.html \ APlusRefV2_84.html \ APlusRefV2_85.html \ APlusRefV2_86.html \ APlusRefV2_86s.html \ APlusRefV2_86sys.html \ APlusRefV2_87.html \ APlusRefV2_88.html \ APlusRefV2_89.html \ APlusRefV2_9.html \ APlusRefV2_90.html \ APlusRefV2_91.html \ APlusRefV2_92.html \ APlusRefV2_92sc.html \ APlusRefV2_92sf.html \ APlusRefV2_92sv.html \ APlusRefV2_93.html \ APlusRefV2_94.html \ APlusRefV2_AFrame_1.gif \ APlusRefV2_AFrame_103.gif \ APlusRefV2_AFrame_119.gif \ APlusRefV2_AFrame_120.gif \ APlusRefV2_AFrame_13.gif \ APlusRefV2_AFrame_133.gif \ APlusRefV2_AFrame_135.gif \ APlusRefV2_AFrame_138.gif \ APlusRefV2_AFrame_16.gif \ APlusRefV2_AFrame_17.gif \ APlusRefV2_AFrame_171.gif \ APlusRefV2_AFrame_177.gif \ APlusRefV2_AFrame_18.gif \ APlusRefV2_AFrame_182.gif \ APlusRefV2_AFrame_195.gif \ APlusRefV2_AFrame_199.gif \ APlusRefV2_AFrame_201.gif \ APlusRefV2_AFrame_203.gif \ APlusRefV2_AFrame_205.gif \ APlusRefV2_AFrame_207.gif \ APlusRefV2_AFrame_210.gif \ APlusRefV2_AFrame_36.gif \ APlusRefV2_AFrame_38.gif \ APlusRefV2_AFrame_4.gif \ APlusRefV2_AFrame_45.gif \ APlusRefV2_AFrame_47.gif \ APlusRefV2_AFrame_49.gif \ APlusRefV2_AFrame_50.gif \ APlusRefV2_AFrame_96.gif \ APlusRefV2_AFrame_97.gif \ APlusRefV2_FootNote_950.html \ APlusRefV2_FootNote_952.html \ APlusRefV2_FootNote_955.html \ APlusRefV2_FootNote_956.html \ APlusRefV2_FootNote_957.html \ APlusRefV2_FootNote_958.html \ APlusRefV2_FootNote_960.html \ APlusRefV2_FootNote_963.html \ APlusRefV2_FootNote_964.html \ APlusRef_3D_1.gif \ APlusRef_3D_2.gif \ APlusRef_3D_3.gif \ APlusRef_3D_4.gif \ APlusRef_3D_4.ras \ APlusRef_ScrnMgmt_1-1a.gif \ APlusRef_ScrnMgmt_1-1b.gif \ APlusRef_ScrnMgmt_1-1c.gif \ APlusRef_ScrnMgmt_1-2.gif \ APlusRef_ScrnMgmt_1-3a.gif \ APlusRef_ScrnMgmt_1-3b.gif \ APlusRef_ScrnMgmt_1-4a.gif \ APlusRef_ScrnMgmt_1-4b.gif \ APlusRef_ScrnMgmt_1-5a.gif \ APlusRef_ScrnMgmt_1-5b.gif \ APlusRef_ScrnMgmt_1-5c.gif \ APlusRef_ScrnMgmt_1-5d.gif \ APlusRef_ScrnMgmt_1-6a.gif \ APlusRef_ScrnMgmt_1-6b.gif \ APlusRef_ScrnMgmt_1-7a.gif \ APlusRef_ScrnMgmt_1-7b.gif \ ARindexindex.html \ ARstart.html \ ARtoc.html \ AcharsRB.gif \ Acro123.pdf \ AcroCh3.pdf \ AcroCh4.pdf \ AcroCh5.pdf \ AcroTest.pdf \ Att-3.gif \ Att-A.gif \ Att-ALL.gif \ Att-ALLlist.gif \ Att-B.gif \ Att-C.gif \ Att-CNFT.gif \ Att-CNT.gif \ Att-D.gif \ Att-E.gif \ Att-G.gif \ Att-GS.gif \ Att-I.gif \ Att-K.gif \ Att-L.gif \ Att-M.gif \ Att-N.gif \ Att-NFT.gif \ Att-O.gif \ Att-P.gif \ Att-Q.gif \ Att-R.gif \ Att-Rp.gif \ Att-S.gif \ Att-T.gif \ Att-TOP.gif \ Att-U.gif \ Att-V.gif \ Att-W.gif \ Att-X.gif \ Att-gT.gif \ Att-hG.gif \ Att-hM.gif \ Att-hP.gif \ Att-hR.gif \ Att-hS.gif \ Att-lca.gif \ Att-lccb.gif \ Att-lccbU.gif \ Att-lcfn.gif \ Att-lcfnU.gif \ Att-lco.gif \ Att-lcp.gif \ Att-lcr.gif \ Att-lcs.gif \ Att-lcx.gif \ Att-lcy.gif \ Att-more.gif \ Att-tF.gif \ Att-vG.gif \ Att-vM.gif \ Att-vP.gif \ Att-vR.gif \ Att-vS.gif \ BN3Xcopyr.jpg \ BN3Xemail.gif \ BN3Xemail.jpg \ BN3Xhome.gif \ BN3Xhome.jpg \ BN3Xlicen.jpg \ BN3Xnews.gif \ BN3Xnews.jpg \ BN3Xonlin.gif \ BN3Xonlin.jpg \ BN3Xrefmn.gif \ BN3Xrefmn.jpg \ BN3copyr.jpg \ BN3email.gif \ BN3email.jpg \ BN3home.gif \ BN3home.jpg \ BN3licen.jpg \ BN3news.gif \ BN3news.jpg \ BN3onlin.gif \ BN3onlin.jpg \ BN3onlin2.gif \ BN3refmn.gif \ BN3refmn.jpg \ BNtop.gif \ Class.png \ ClassHierarchy.gif \ ColorSamples.html \ DefnLM01.gif \ DefnLM02.gif \ DefnLM03.gif \ DefnLM04.gif \ DefnLM05.gif \ DefnLM06.gif \ DefnLM07.gif \ DefnLM08.gif \ DefnLM09.gif \ DefnLM10.gif \ DefnLM11.gif \ DefnLM12.gif \ DefnLM13.gif \ DefnLM14.gif \ DefnMode.html \ DisplayClasses.html \ EbyE1c.gif \ EbyE2c.gif \ EbyE3c.gif \ FigAction.gif \ FigArray.gif \ FigButton.gif \ FigCheck.gif \ FigChoice.gif \ FigChoiceDrop.gif \ Fig_12-6.gif \ FlashCardsLs.gif \ FontAPLonPC.html \ GraphObject.gif \ InfoSign.gif \ KeyXp1.gif \ KeyboardInt.gif \ KeyboardTent.gif \ KeyboardTentL.gif \ LicenseAgreement.html \ ManualCy2.gif \ Manuals.gif \ MapFigDropDown.html \ MapFigFrame.html \ MapFigHighlight.html \ MapFigLabel-ValueAreas.html \ MapFigLabelAreas.html \ MapFigLabels.html \ MapFigMaxButton.html \ MapFigMenuButton.html \ MapFigMenuLabels.html \ MapFigMinButton.html \ MapFigOverall.html \ MapFigResizeCorners.html \ MapFigScrollBars.html \ MapFigShadowBar.html \ MapFigShellTitle.html \ MapFigShellTitleArea.html \ MapFigTitle.html \ MapFigTitleArea.html \ MapFigValueArea.html \ MapFigValueButton.html \ MapFigValueCell.html \ MapFigValueCells.html \ MapFigValueChoice.html \ MapFigValueChoiceArea.html \ PxPurple.gif \ StarburstNew.gif \ StarburstNewB.gif \ TreeObject.gif \ command.gif \ disp.doc \ fdl.html \ getacro.gif \ gpl.html \ hgauge.gif \ hgrid.gif \ hmenu.gif \ hpane.gif \ kbchart.a \ keybPers.gif \ keybUsers3.gif \ keybUsers5.gif \ keybd90b.gif \ keybdBW.html \ keyboard.gif \ keyboard.html \ keyboard_BOTTOM \ keyboard_TOP \ keyboard_help.html \ label.gif \ layout.gif \ matrix.gif \ notebook.gif \ page.gif \ password.gif \ pixel.gif \ radio.gif \ refman.html \ scalar.gif \ slot1.gif \ slot2.gif \ slot3.gif \ style.css \ table.gif \ text.gif \ tou.html \ tree.gif \ tutorials \ view.gif \ vmenu.gif \ vpane.gif \ window.gif install-exec-hook: rm -f $(DESTDIR)$(prefix)/doc/html/index.html ln -s refman.html $(DESTDIR)$(prefix)/doc/html/index.html aplus-fsf-4.22/src/html/Makefile.in0000644000265000001440000006351710774512523012640 # Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ ############################################################################### ############################################################################### SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CXX = @CXX@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ STRIP = @STRIP@ VERSION = @VERSION@ X_INCLUDES = @X_INCLUDES@ X_LIBS = @X_LIBS@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ SUBDIRS = tutorials htmldir = $(prefix)/doc/html html_DATA = \ A-head3.gif \ A2.gif \ A2a50063.gif \ APLcode8m.gif \ APlusRefScreen_AFrame_40R.gif \ APlusRefV2_10.html \ APlusRefV2_11.html \ APlusRefV2_12.html \ APlusRefV2_13.html \ APlusRefV2_14.html \ APlusRefV2_15.html \ APlusRefV2_16.html \ APlusRefV2_17.html \ APlusRefV2_18.html \ APlusRefV2_19.html \ APlusRefV2_2.html \ APlusRefV2_20.html \ APlusRefV2_21.html \ APlusRefV2_22.html \ APlusRefV2_23.html \ APlusRefV2_24.html \ APlusRefV2_25.html \ APlusRefV2_26.html \ APlusRefV2_27.html \ APlusRefV2_28.html \ APlusRefV2_29.html \ APlusRefV2_3.html \ APlusRefV2_30.html \ APlusRefV2_31.html \ APlusRefV2_32.html \ APlusRefV2_32HG.html \ APlusRefV2_32HGr.html \ APlusRefV2_33.html \ APlusRefV2_34.html \ APlusRefV2_34HS.html \ APlusRefV2_35.html \ APlusRefV2_36.html \ APlusRefV2_37.html \ APlusRefV2_37NB.html \ APlusRefV2_38.html \ APlusRefV2_39.html \ APlusRefV2_4.html \ APlusRefV2_40.html \ APlusRefV2_40R.html \ APlusRefV2_41.html \ APlusRefV2_42.html \ APlusRefV2_43.html \ APlusRefV2_44.html \ APlusRefV2_45.html \ APlusRefV2_46.html \ APlusRefV2_46VG.html \ APlusRefV2_46VGr.html \ APlusRefV2_47.html \ APlusRefV2_48.html \ APlusRefV2_48VS.html \ APlusRefV2_49.html \ APlusRefV2_5.html \ APlusRefV2_50.html \ APlusRefV2_51.html \ APlusRefV2_52.html \ APlusRefV2_53.html \ APlusRefV2_54.html \ APlusRefV2_55.html \ APlusRefV2_56.html \ APlusRefV2_56p.html \ APlusRefV2_57.html \ APlusRefV2_58.html \ APlusRefV2_59.html \ APlusRefV2_6.html \ APlusRefV2_60.html \ APlusRefV2_61.html \ APlusRefV2_62.html \ APlusRefV2_63.html \ APlusRefV2_65.html \ APlusRefV2_66.html \ APlusRefV2_67.html \ APlusRefV2_68.html \ APlusRefV2_69.html \ APlusRefV2_7.html \ APlusRefV2_70.html \ APlusRefV2_71.html \ APlusRefV2_72.html \ APlusRefV2_73.html \ APlusRefV2_74.html \ APlusRefV2_75.html \ APlusRefV2_76.html \ APlusRefV2_77.html \ APlusRefV2_78.html \ APlusRefV2_79.html \ APlusRefV2_8.html \ APlusRefV2_80.html \ APlusRefV2_81.html \ APlusRefV2_82.html \ APlusRefV2_83.html \ APlusRefV2_84.html \ APlusRefV2_85.html \ APlusRefV2_86.html \ APlusRefV2_86s.html \ APlusRefV2_86sys.html \ APlusRefV2_87.html \ APlusRefV2_88.html \ APlusRefV2_89.html \ APlusRefV2_9.html \ APlusRefV2_90.html \ APlusRefV2_91.html \ APlusRefV2_92.html \ APlusRefV2_92sc.html \ APlusRefV2_92sf.html \ APlusRefV2_92sv.html \ APlusRefV2_93.html \ APlusRefV2_AFrame_1.gif \ APlusRefV2_AFrame_103.gif \ APlusRefV2_AFrame_119.gif \ APlusRefV2_AFrame_120.gif \ APlusRefV2_AFrame_13.gif \ APlusRefV2_AFrame_133.gif \ APlusRefV2_AFrame_135.gif \ APlusRefV2_AFrame_138.gif \ APlusRefV2_AFrame_16.gif \ APlusRefV2_AFrame_17.gif \ APlusRefV2_AFrame_171.gif \ APlusRefV2_AFrame_177.gif \ APlusRefV2_AFrame_18.gif \ APlusRefV2_AFrame_182.gif \ APlusRefV2_AFrame_195.gif \ APlusRefV2_AFrame_199.gif \ APlusRefV2_AFrame_201.gif \ APlusRefV2_AFrame_203.gif \ APlusRefV2_AFrame_205.gif \ APlusRefV2_AFrame_207.gif \ APlusRefV2_AFrame_210.gif \ APlusRefV2_AFrame_36.gif \ APlusRefV2_AFrame_38.gif \ APlusRefV2_AFrame_4.gif \ APlusRefV2_AFrame_45.gif \ APlusRefV2_AFrame_47.gif \ APlusRefV2_AFrame_49.gif \ APlusRefV2_AFrame_50.gif \ APlusRefV2_AFrame_96.gif \ APlusRefV2_AFrame_97.gif \ APlusRefV2_FootNote_950.html \ APlusRefV2_FootNote_952.html \ APlusRefV2_FootNote_955.html \ APlusRefV2_FootNote_956.html \ APlusRefV2_FootNote_957.html \ APlusRefV2_FootNote_958.html \ APlusRefV2_FootNote_960.html \ APlusRefV2_FootNote_963.html \ APlusRefV2_FootNote_964.html \ APlusRef_3D_1.gif \ APlusRef_3D_2.gif \ APlusRef_3D_3.gif \ APlusRef_3D_4.gif \ APlusRef_3D_4.ras \ APlusRef_ScrnMgmt_1-1a.gif \ APlusRef_ScrnMgmt_1-1b.gif \ APlusRef_ScrnMgmt_1-1c.gif \ APlusRef_ScrnMgmt_1-2.gif \ APlusRef_ScrnMgmt_1-3a.gif \ APlusRef_ScrnMgmt_1-3b.gif \ APlusRef_ScrnMgmt_1-4a.gif \ APlusRef_ScrnMgmt_1-4b.gif \ APlusRef_ScrnMgmt_1-5a.gif \ APlusRef_ScrnMgmt_1-5b.gif \ APlusRef_ScrnMgmt_1-5c.gif \ APlusRef_ScrnMgmt_1-5d.gif \ APlusRef_ScrnMgmt_1-6a.gif \ APlusRef_ScrnMgmt_1-6b.gif \ APlusRef_ScrnMgmt_1-7a.gif \ APlusRef_ScrnMgmt_1-7b.gif \ ARindexindex.html \ ARstart.html \ ARtoc.html \ AcharsRB.gif \ Acro123.pdf \ AcroCh3.pdf \ AcroCh4.pdf \ AcroCh5.pdf \ AcroTest.pdf \ FontAPLonPC.html \ kbchart.a \ keyboard_TOP \ Att-3.gif \ Att-A.gif \ Att-ALL.gif \ Att-ALLlist.gif \ Att-B.gif \ Att-C.gif \ Att-CNFT.gif \ Att-CNT.gif \ Att-D.gif \ Att-E.gif \ Att-G.gif \ Att-GS.gif \ Att-I.gif \ Att-K.gif \ Att-L.gif \ Att-M.gif \ Att-N.gif \ Att-NFT.gif \ Att-O.gif \ Att-P.gif \ Att-Q.gif \ Att-R.gif \ Att-Rp.gif \ Att-S.gif \ Att-T.gif \ Att-TOP.gif \ Att-U.gif \ Att-V.gif \ Att-W.gif \ Att-X.gif \ Att-gT.gif \ Att-hG.gif \ Att-hM.gif \ Att-hP.gif \ Att-hR.gif \ Att-hS.gif \ Att-lca.gif \ Att-lccb.gif \ Att-lccbU.gif \ Att-lcfn.gif \ Att-lcfnU.gif \ Att-lco.gif \ Att-lcp.gif \ Att-lcr.gif \ Att-lcs.gif \ Att-lcx.gif \ Att-lcy.gif \ Att-more.gif \ Att-tF.gif \ Att-vG.gif \ Att-vM.gif \ Att-vP.gif \ Att-vR.gif \ Att-vS.gif \ BN3Xcopyr.jpg \ BN3Xemail.gif \ BN3Xemail.jpg \ BN3Xhome.gif \ BN3Xhome.jpg \ BN3Xlicen.jpg \ BN3Xnews.gif \ BN3Xnews.jpg \ BN3Xonlin.gif \ BN3Xonlin.jpg \ BN3Xrefmn.gif \ BN3Xrefmn.jpg \ BN3copyr.jpg \ BN3email.gif \ BN3email.jpg \ BN3home.gif \ BN3home.jpg \ BN3licen.jpg \ BN3news.gif \ BN3news.jpg \ BN3onlin.gif \ BN3onlin.jpg \ BN3onlin2.gif \ BN3refmn.gif \ BN3refmn.jpg \ BNtop.gif \ Class.png \ ClassHierarchy.gif \ ColorSamples.html \ DefnLM01.gif \ DefnLM02.gif \ DefnLM03.gif \ DefnLM04.gif \ DefnLM05.gif \ DefnLM06.gif \ DefnLM07.gif \ DefnLM08.gif \ DefnLM09.gif \ DefnLM10.gif \ DefnLM11.gif \ DefnLM12.gif \ DefnLM13.gif \ DefnLM14.gif \ DefnMode.html \ DisplayClasses.html \ EbyE1c.gif \ EbyE2c.gif \ EbyE3c.gif \ FigAction.gif \ FigArray.gif \ FigButton.gif \ FigCheck.gif \ FigChoice.gif \ FigChoiceDrop.gif \ Fig_12-6.gif \ FlashCardsLs.gif \ GraphObject.gif \ InfoSign.gif \ KeyXp1.gif \ KeyboardInt.gif \ KeyboardTent.gif \ KeyboardTentL.gif \ LicenseAgreement.html \ ManualCy2.gif \ Manuals.gif \ MapFigDropDown.html \ MapFigFrame.html \ MapFigHighlight.html \ MapFigLabel-ValueAreas.html \ MapFigLabelAreas.html \ MapFigLabels.html \ MapFigMaxButton.html \ MapFigMenuButton.html \ MapFigMenuLabels.html \ MapFigMinButton.html \ MapFigOverall.html \ MapFigResizeCorners.html \ MapFigScrollBars.html \ MapFigShadowBar.html \ MapFigShellTitle.html \ MapFigShellTitleArea.html \ MapFigTitle.html \ MapFigTitleArea.html \ MapFigValueArea.html \ MapFigValueButton.html \ MapFigValueCell.html \ MapFigValueCells.html \ MapFigValueChoice.html \ MapFigValueChoiceArea.html \ PxPurple.gif \ StarburstNew.gif \ StarburstNewB.gif \ TreeObject.gif \ command.gif \ getacro.gif \ hgauge.gif \ hgrid.gif \ hmenu.gif \ hpane.gif \ keybPers.gif \ keybUsers3.gif \ keybUsers5.gif \ keybd90b.gif \ keybdBW.html \ keyboard.gif \ keyboard.html \ keyboard_BOTTOM \ keyboard_help.html \ label.gif \ layout.gif \ matrix.gif \ notebook.gif \ page.gif \ password.gif \ pixel.gif \ radio.gif \ refman.html \ scalar.gif \ slot1.gif \ slot2.gif \ slot3.gif \ style.css \ table.gif \ text.gif \ tree.gif \ view.gif \ vmenu.gif \ vpane.gif \ window.gif EXTRA_DIST = \ A-head3.gif \ A-head3grey3.gif \ A2.gif \ A2a50063.gif \ APLcode8m.gif \ APlusRefScreen_AFrame_40R.gif \ APlusRefV2_10.html \ APlusRefV2_11.html \ APlusRefV2_12.html \ APlusRefV2_13.html \ APlusRefV2_14.html \ APlusRefV2_15.html \ APlusRefV2_16.html \ APlusRefV2_17.html \ APlusRefV2_18.html \ APlusRefV2_19.html \ APlusRefV2_2.html \ APlusRefV2_20.html \ APlusRefV2_21.html \ APlusRefV2_22.html \ APlusRefV2_23.html \ APlusRefV2_24.html \ APlusRefV2_25.html \ APlusRefV2_26.html \ APlusRefV2_27.html \ APlusRefV2_28.html \ APlusRefV2_29.html \ APlusRefV2_3.html \ APlusRefV2_30.html \ APlusRefV2_31.html \ APlusRefV2_32.html \ APlusRefV2_32HG.html \ APlusRefV2_32HGr.html \ APlusRefV2_33.html \ APlusRefV2_34.html \ APlusRefV2_34HS.html \ APlusRefV2_35.html \ APlusRefV2_36.html \ APlusRefV2_37.html \ APlusRefV2_37NB.html \ APlusRefV2_38.html \ APlusRefV2_39.html \ APlusRefV2_4.html \ APlusRefV2_40.html \ APlusRefV2_40R.html \ APlusRefV2_41.html \ APlusRefV2_42.html \ APlusRefV2_43.html \ APlusRefV2_44.html \ APlusRefV2_45.html \ APlusRefV2_46.html \ APlusRefV2_46VG.html \ APlusRefV2_46VGr.html \ APlusRefV2_47.html \ APlusRefV2_48.html \ APlusRefV2_48VS.html \ APlusRefV2_49.html \ APlusRefV2_5.html \ APlusRefV2_50.html \ APlusRefV2_51.html \ APlusRefV2_52.html \ APlusRefV2_53.html \ APlusRefV2_54.html \ APlusRefV2_55.html \ APlusRefV2_56.html \ APlusRefV2_56p.html \ APlusRefV2_57.html \ APlusRefV2_58.html \ APlusRefV2_59.html \ APlusRefV2_6.html \ APlusRefV2_60.html \ APlusRefV2_61.html \ APlusRefV2_62.html \ APlusRefV2_63.html \ APlusRefV2_65.html \ APlusRefV2_66.html \ APlusRefV2_67.html \ APlusRefV2_68.html \ APlusRefV2_69.html \ APlusRefV2_7.html \ APlusRefV2_70.html \ APlusRefV2_71.html \ APlusRefV2_72.html \ APlusRefV2_73.html \ APlusRefV2_74.html \ APlusRefV2_75.html \ APlusRefV2_76.html \ APlusRefV2_77.html \ APlusRefV2_78.html \ APlusRefV2_79.html \ APlusRefV2_8.html \ APlusRefV2_80.html \ APlusRefV2_81.html \ APlusRefV2_82.html \ APlusRefV2_83.html \ APlusRefV2_84.html \ APlusRefV2_85.html \ APlusRefV2_86.html \ APlusRefV2_86s.html \ APlusRefV2_86sys.html \ APlusRefV2_87.html \ APlusRefV2_88.html \ APlusRefV2_89.html \ APlusRefV2_9.html \ APlusRefV2_90.html \ APlusRefV2_91.html \ APlusRefV2_92.html \ APlusRefV2_92sc.html \ APlusRefV2_92sf.html \ APlusRefV2_92sv.html \ APlusRefV2_93.html \ APlusRefV2_94.html \ APlusRefV2_AFrame_1.gif \ APlusRefV2_AFrame_103.gif \ APlusRefV2_AFrame_119.gif \ APlusRefV2_AFrame_120.gif \ APlusRefV2_AFrame_13.gif \ APlusRefV2_AFrame_133.gif \ APlusRefV2_AFrame_135.gif \ APlusRefV2_AFrame_138.gif \ APlusRefV2_AFrame_16.gif \ APlusRefV2_AFrame_17.gif \ APlusRefV2_AFrame_171.gif \ APlusRefV2_AFrame_177.gif \ APlusRefV2_AFrame_18.gif \ APlusRefV2_AFrame_182.gif \ APlusRefV2_AFrame_195.gif \ APlusRefV2_AFrame_199.gif \ APlusRefV2_AFrame_201.gif \ APlusRefV2_AFrame_203.gif \ APlusRefV2_AFrame_205.gif \ APlusRefV2_AFrame_207.gif \ APlusRefV2_AFrame_210.gif \ APlusRefV2_AFrame_36.gif \ APlusRefV2_AFrame_38.gif \ APlusRefV2_AFrame_4.gif \ APlusRefV2_AFrame_45.gif \ APlusRefV2_AFrame_47.gif \ APlusRefV2_AFrame_49.gif \ APlusRefV2_AFrame_50.gif \ APlusRefV2_AFrame_96.gif \ APlusRefV2_AFrame_97.gif \ APlusRefV2_FootNote_950.html \ APlusRefV2_FootNote_952.html \ APlusRefV2_FootNote_955.html \ APlusRefV2_FootNote_956.html \ APlusRefV2_FootNote_957.html \ APlusRefV2_FootNote_958.html \ APlusRefV2_FootNote_960.html \ APlusRefV2_FootNote_963.html \ APlusRefV2_FootNote_964.html \ APlusRef_3D_1.gif \ APlusRef_3D_2.gif \ APlusRef_3D_3.gif \ APlusRef_3D_4.gif \ APlusRef_3D_4.ras \ APlusRef_ScrnMgmt_1-1a.gif \ APlusRef_ScrnMgmt_1-1b.gif \ APlusRef_ScrnMgmt_1-1c.gif \ APlusRef_ScrnMgmt_1-2.gif \ APlusRef_ScrnMgmt_1-3a.gif \ APlusRef_ScrnMgmt_1-3b.gif \ APlusRef_ScrnMgmt_1-4a.gif \ APlusRef_ScrnMgmt_1-4b.gif \ APlusRef_ScrnMgmt_1-5a.gif \ APlusRef_ScrnMgmt_1-5b.gif \ APlusRef_ScrnMgmt_1-5c.gif \ APlusRef_ScrnMgmt_1-5d.gif \ APlusRef_ScrnMgmt_1-6a.gif \ APlusRef_ScrnMgmt_1-6b.gif \ APlusRef_ScrnMgmt_1-7a.gif \ APlusRef_ScrnMgmt_1-7b.gif \ ARindexindex.html \ ARstart.html \ ARtoc.html \ AcharsRB.gif \ Acro123.pdf \ AcroCh3.pdf \ AcroCh4.pdf \ AcroCh5.pdf \ AcroTest.pdf \ Att-3.gif \ Att-A.gif \ Att-ALL.gif \ Att-ALLlist.gif \ Att-B.gif \ Att-C.gif \ Att-CNFT.gif \ Att-CNT.gif \ Att-D.gif \ Att-E.gif \ Att-G.gif \ Att-GS.gif \ Att-I.gif \ Att-K.gif \ Att-L.gif \ Att-M.gif \ Att-N.gif \ Att-NFT.gif \ Att-O.gif \ Att-P.gif \ Att-Q.gif \ Att-R.gif \ Att-Rp.gif \ Att-S.gif \ Att-T.gif \ Att-TOP.gif \ Att-U.gif \ Att-V.gif \ Att-W.gif \ Att-X.gif \ Att-gT.gif \ Att-hG.gif \ Att-hM.gif \ Att-hP.gif \ Att-hR.gif \ Att-hS.gif \ Att-lca.gif \ Att-lccb.gif \ Att-lccbU.gif \ Att-lcfn.gif \ Att-lcfnU.gif \ Att-lco.gif \ Att-lcp.gif \ Att-lcr.gif \ Att-lcs.gif \ Att-lcx.gif \ Att-lcy.gif \ Att-more.gif \ Att-tF.gif \ Att-vG.gif \ Att-vM.gif \ Att-vP.gif \ Att-vR.gif \ Att-vS.gif \ BN3Xcopyr.jpg \ BN3Xemail.gif \ BN3Xemail.jpg \ BN3Xhome.gif \ BN3Xhome.jpg \ BN3Xlicen.jpg \ BN3Xnews.gif \ BN3Xnews.jpg \ BN3Xonlin.gif \ BN3Xonlin.jpg \ BN3Xrefmn.gif \ BN3Xrefmn.jpg \ BN3copyr.jpg \ BN3email.gif \ BN3email.jpg \ BN3home.gif \ BN3home.jpg \ BN3licen.jpg \ BN3news.gif \ BN3news.jpg \ BN3onlin.gif \ BN3onlin.jpg \ BN3onlin2.gif \ BN3refmn.gif \ BN3refmn.jpg \ BNtop.gif \ Class.png \ ClassHierarchy.gif \ ColorSamples.html \ DefnLM01.gif \ DefnLM02.gif \ DefnLM03.gif \ DefnLM04.gif \ DefnLM05.gif \ DefnLM06.gif \ DefnLM07.gif \ DefnLM08.gif \ DefnLM09.gif \ DefnLM10.gif \ DefnLM11.gif \ DefnLM12.gif \ DefnLM13.gif \ DefnLM14.gif \ DefnMode.html \ DisplayClasses.html \ EbyE1c.gif \ EbyE2c.gif \ EbyE3c.gif \ FigAction.gif \ FigArray.gif \ FigButton.gif \ FigCheck.gif \ FigChoice.gif \ FigChoiceDrop.gif \ Fig_12-6.gif \ FlashCardsLs.gif \ FontAPLonPC.html \ GraphObject.gif \ InfoSign.gif \ KeyXp1.gif \ KeyboardInt.gif \ KeyboardTent.gif \ KeyboardTentL.gif \ LicenseAgreement.html \ ManualCy2.gif \ Manuals.gif \ MapFigDropDown.html \ MapFigFrame.html \ MapFigHighlight.html \ MapFigLabel-ValueAreas.html \ MapFigLabelAreas.html \ MapFigLabels.html \ MapFigMaxButton.html \ MapFigMenuButton.html \ MapFigMenuLabels.html \ MapFigMinButton.html \ MapFigOverall.html \ MapFigResizeCorners.html \ MapFigScrollBars.html \ MapFigShadowBar.html \ MapFigShellTitle.html \ MapFigShellTitleArea.html \ MapFigTitle.html \ MapFigTitleArea.html \ MapFigValueArea.html \ MapFigValueButton.html \ MapFigValueCell.html \ MapFigValueCells.html \ MapFigValueChoice.html \ MapFigValueChoiceArea.html \ PxPurple.gif \ StarburstNew.gif \ StarburstNewB.gif \ TreeObject.gif \ command.gif \ disp.doc \ fdl.html \ getacro.gif \ gpl.html \ hgauge.gif \ hgrid.gif \ hmenu.gif \ hpane.gif \ kbchart.a \ keybPers.gif \ keybUsers3.gif \ keybUsers5.gif \ keybd90b.gif \ keybdBW.html \ keyboard.gif \ keyboard.html \ keyboard_BOTTOM \ keyboard_TOP \ keyboard_help.html \ label.gif \ layout.gif \ matrix.gif \ notebook.gif \ page.gif \ password.gif \ pixel.gif \ radio.gif \ refman.html \ scalar.gif \ slot1.gif \ slot2.gif \ slot3.gif \ style.css \ table.gif \ text.gif \ tou.html \ tree.gif \ tutorials \ view.gif \ vmenu.gif \ vpane.gif \ window.gif subdir = src/html mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_CLEAN_FILES = DIST_SOURCES = DATA = $(html_DATA) RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ uninstall-info-recursive all-recursive install-data-recursive \ install-exec-recursive installdirs-recursive install-recursive \ uninstall-recursive check-recursive installcheck-recursive DIST_COMMON = Makefile.am Makefile.in DIST_SUBDIRS = $(SUBDIRS) all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/html/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: htmlDATA_INSTALL = $(INSTALL_DATA) install-htmlDATA: $(html_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(htmldir) @list='$(html_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(htmlDATA_INSTALL) $$d$$p $(DESTDIR)$(htmldir)/$$f"; \ $(htmlDATA_INSTALL) $$d$$p $(DESTDIR)$(htmldir)/$$f; \ done uninstall-htmlDATA: @$(NORMAL_UNINSTALL) @list='$(html_DATA)'; for p in $$list; do \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " rm -f $(DESTDIR)$(htmldir)/$$f"; \ rm -f $(DESTDIR)$(htmldir)/$$f; \ done # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ETAGS = etags ETAGSFLAGS = tags: TAGS 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; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ fi; \ done; \ 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; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = ../.. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d $(distdir)/$$subdir \ || mkdir $(distdir)/$$subdir \ || exit 1; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" \ distdir=../$(distdir)/$$subdir \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(DATA) installdirs: installdirs-recursive installdirs-am: $(mkinstalldirs) $(DESTDIR)$(htmldir) install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_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-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: info: info-recursive info-am: install-data-am: install-htmlDATA install-exec-am: @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool uninstall-am: uninstall-htmlDATA uninstall-info-am uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \ clean-generic clean-libtool clean-recursive distclean \ distclean-generic distclean-libtool distclean-recursive \ distclean-tags distdir dvi dvi-am dvi-recursive info info-am \ info-recursive install install-am install-data install-data-am \ install-data-recursive install-exec install-exec-am \ install-exec-recursive install-htmlDATA install-info \ install-info-am install-info-recursive install-man \ install-recursive install-strip installcheck installcheck-am \ installdirs installdirs-am installdirs-recursive \ maintainer-clean maintainer-clean-generic \ maintainer-clean-recursive mostlyclean mostlyclean-generic \ mostlyclean-libtool mostlyclean-recursive tags tags-recursive \ uninstall uninstall-am uninstall-htmlDATA uninstall-info-am \ uninstall-info-recursive uninstall-recursive install-exec-hook: rm -f $(DESTDIR)$(prefix)/doc/html/index.html ln -s refman.html $(DESTDIR)$(prefix)/doc/html/index.html # 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: aplus-fsf-4.22/src/html/A-head3.gif0000444000265000001440000001237107215452773012420 GIF89a|P̙̙f3fff33ffffff3ff33fff333333,|P dihlp,tmx|pH Brl2(t*R,vr0x,.4zn8N(P h~@8~L~cLvrbUHvI""|G      I ˽ڡH 5X;G(,A$3jȱǏÇo/a>TAQLHIX>%)T`G ӧPJj_)JYSPJof2 A#PF3׉ݻxj)."+ڵD9u&(2Q ~@Ea CǷϠCo$Oནw-EH 4Xv) xD9ܢ N1Uǀ Z税%QWɖMQS%09__Ͼ{TjY2wc@0tV(gPAA  ބVha, T;4wVr@%V`lؖMvHSz,y]@Ά<m Ѐ0f-Hcr`%] )dP)$WFrSnPdx+^[eP4;nƧjhHS33)84xGt `w訤}֤G6`[5f>u@|:t&')xhE<.>f-K:-kad4&@t4Skop3)Uߚ)=.'Y): @"F ADSg9ms8:MG6]@YٌWT\0@<Zϓ"(lDc0/,R?Ȋ [ vq>4T76/l-io{` 8 q;Emw_$ʱkLVsa<1 NG RJ,9=IJХw6p?yU0YTSbȈ `>k@>0;eC4B.}:P`.Av* LSi;nqChJ3n!`Y ܢ7/,7Z+VSM HT@ !@]O6m'7EicP HC)# dA%tl6 m%qI`v ?] PKv<`aFVifA;@?1"GCǒЦ1Do|L^-k0Fo[vG$--#'xf:Ve Гפqsx+y`I@j)xm xFmz iTh@"Bd DLX vifP&]$aJ q HRɳ"HNJe e(Ҫ:%jޱF$L\d$}L "."V]) y 5p8!01&h sVMl~| `;fL6r'z-hrJ5 G%WZj8#`zjD]RSn't=e#_Va'`S4s]"PuH8 jWx{iqx&ba ( viFؕ `ڞVH Ѣb5@ R:X*K:AqUv2 #*@{CF aQCE\ a:]q ~;U`+zS3śRn(!$TJwܜ+x8%CokT% \g,H8~  sIɿ$Vņe6R\s$rq8A[@]]<*܌U'Z[ҮY d!h+E?G*CnZP^9I6~ qj1Xvgy@( 7N0!zqmź &^(~*,.024>6^8~:<T IUgwVC~gR!DIN.,IKtJ$!QRBXwD~=AnO!p.t^v~xrPM %ɓ+ ~芞茾>^~隞霾>^~~ۜ돮.,,|y>ĎE ɾ=k>^~؞ھ>^~ XV^q;aplus-fsf-4.22/src/html/A-head3grey3.gif0000444000265000001440000001107307226617743013372 GIF89aMP~~~|||yyywwwvvvtttsssrrrooojjjiiigggfffeeecccaaa```___^^^]]]\\\[[[ZZZYYYXXXVVVTTTRRRPPPOOONNNMMMKKKJJJHHHGGGFFFEEEDDDCCCAAA@@@>>>888555444333111000///---,,,+++)))((('''&&&%%%$$$###"""!!! ,MP/ /;/;;/PP PeProDŽ|џ Ո/1׆ 1NP҆„o|ֆ@7( P,Ur~ BXFI4$ 'eĞɓѪc!y8ӼCP RP0y!ɠ Q*]JfN7elZ8dlW>[ `ʶ-$}UgANC7 XhȊe]X,VmZ"ZqE\s\~F1vS@*Pҳfzj£ 6k}~ͼ:|`N]Zen8czɭK]^HN.S;6p 4~oXde%#7B 3O0]_A;duUTYނ$J(tqB;N5cpP%72he3+[3N/p!-ӞƸI a?<#ُX"2Cnͨ#ӅY*n5.-™He"fa{F %hKENSڦ[4R. ##41b#oyi* @}M 2i#6J_Nfg Mj !%H zZ.b]\ @6 9:FfYyELVL&w:7Q.<[ 8Fjβ[`sȇIχ;p.Y;zK_׷x6|ɭ"Ƒ Q ]TueEH1)^eVg|JVuF ,03{@"v.$ǹ }`?fC K @{k!@HEa .6ŒbL0zk(@P0FH T E@@CT\X &.)΋Wpқ/rA4NPL@B*! QT&Z= 0,RgjC܆IVlIzVHу!+BVq85k_HJ+( ATECvh х^ ȐH@(<,A9qBjXLeZF L!bDg*˥Ow쁔F+Cġ~vtA\'>{Q-z`H:< .lN9?S! [ւxKyh`r{" F$rBA"%\P fMJC2"5\Ҩ(^jL" 8֏=VV<@;FpMH.&[2ePrF" jn$`ɜYx 9`Iլq^a4> ˛ZZfMfW̉8:^]qWM a$q/܏ dL f v\"ͣqWBp0:̌ FR8N¹u=^1& Ǥ\U!C|lt *O}{E *g%y W<C#37W({*C!VlHOpFdBp,#UA X{J=3qy{J1 nRy`rmb$j8dG 7!xeCUf! !&b/}p'.{Cᔱ.QMŧ1@X 4Fpu PpMVǺ 7ȍ9c]"X$nu)(sBqӡo&/j( ;R'$ M 7,KĖ)dN|x5(5js@ 8teRH6kŒbwk.3LװKZ@`l70pLva Iy&tb 2,cqCG$HG Sw 2v56\[WPWuNТS9\Q@'}y12!UޱTI3Ci`i`%l_v/ \[h5k&|Z\Bd0J Xq2'p-6+Ap4 2; HE6~RBfsP3U Džjm6gNd! Lb#r-I5C%}9!p5\,w/es< (jW w$d|q2 b)zJb2 w,Fnsf$QS&&!0'sVF@BW16f8X;/L$?"#:Z9a/P' ƌeWKs#[ G;|93;W =3A9wY3QҖc.GSO0P'8-V(hR1xcq hC4@`>B4<#E 8*(8p`d%\V] 9a5 BpIiQmA9oÎ`T `_?x884sɈ Mqj s+m;6#9 A-aP  #7i5ʗ2qpyQvКsQW38qm@wppy` WHjUV+`g0Fq= 3&z;) H`0pd_ /@ٰcSQ0ysA Қrq d B`*7Ix(U0QЛ ] ֡RrayW%nMapgX(ړ4cG!p{pO-0A[ Ȥi¤򉚁9v*@q2vҨ ᢂAt8$ R2MB Ap(@^ cJ@d68@y60GTz騀R'(u)b$?Hp!@V`c #=g=)!~*8zCF) a!*2AbV(0%1KJHc'@3ZxnSq]4 jKakLM_*A1>/Htp[z@!Tf<|! m^Q4O C@ W$8 FHp PiC J3s#JWh$x+㣔b\Q`^af9BÔ@ J ]\}" la[TêUV` hiy`Xq-ySxH&rrC".s_.DW1޴ EXF6ٽ4Wy"hFN<M;)#6boMz{Ol}dH.)ǚ{'0.@+4tzՅ;aplus-fsf-4.22/src/html/A2a50063.gif0000444000265000001440000000114107215452773012250 GIF89aF2̙f33f3ff!,F20Is`,u2-#zA!l79[*zM^G2wԦ-^x2~pm[jrb |y RHeaoq' =q3z.w=JdHAjNBug/&&2GOPT?k=4$Ȣ-H4eaC䍬@znl,yHkK%Ĕ)ˀ,N̩8xU( 0U~i0)A]~!Q ߏh`)&l>MU *fR">jdhRB6y Cv$ҍ 0iCT>kIw\v%珂1{F`4' zy=ǃ-Dþ .cm )q_r@@όX >^i啮Kɝ/ &([R2Q>}OWzP0Zw"y' 2I\|•\.(T'TjJvVG #2Z-;SZYO\PY:'$; 0VN&2ܺ쿒=Tw &w"gCujjzBf}k~ʉ`7NKbOmZUaAԶat["D]`49Z 5QTI># x&TC&*fgoeaab"!&1eP2.!Uls+cA ?fO>q\-n2~< a2\hXڱ!hǟ^FdE),/¶ջܖmBTbI%xĴtUB  Y[ I܎rvbe,2גbĨah](H*_C}i]YA][P+$iVq $)Y+@+Ls״(Zqrc_Uvʩ 3\yeF -$|*a.`gɊӂ0b-V SEFkʕA 66I<D4ċ-ڬL32dX & J**PL XUT:l1 ,S4POUDM(+z%aV39e߳е^1I_Rz(`%KNU!zp;RtTNjJ]uvFr5!T5d[h`i\,s6/!8F1]tӂ&!K>")S5r!^JcB P/B?]f[StIA.T.E!_5cS0F";Chn+`Skq˥#tU)pDD]i"*#.Bd/Q+1E6"T-Cr*5}K/tзG9`%c~ `- E>A\@pr;SArA.m9kQ 43Xo_&q,p-9*#)y.+xSaeᓩ#)t+z7Y$`/U9qSdƁt$i3Z\RX>3Smq`gT{ Q%g2/ɔ.OXSa}T#2RyS~HMJG1#1Y@WI8`tk+%5rv3y+(~r ;fG:] h ^g;A"vAzBvU.=3Ufb )s1^z`BBQ. (3aQO0{AV>C[h*v,$;9gׅq~#Q4#"_!W")~=fxs{P9./& $?~#gBl$u>%3psQ[lߨDi1gᕌeBӲT3>ys&*O X.")dӌ7Q|Q<`>Uap>0@djٞV X5'Rm]c]$"_aa&*h*dstRC]#A$2$*1@c=L0<Ds%T1Fd 췌2.?Y.Dxe7{P@bN/FBF>s5[٩)QDe>Qew5_eZ"^P' 3 #OfT@t:BBgoe a!.W *5 xHzF8rf-&%U!Z?g<{xPQ n`0(Jrz"RjeC5tn&>AJH Tj&W#Ւ4r%oт7s*.7XI:ךs[HbCq[1%I:W;GӄkA蓎2=r3TZ1e'3!'2IDji,6bcYr,@WٝJb`DWpˬog}_yBh:{FObsu^Xvdg WJ{%4T XvCvqT@k :E!!XCa9(@|!$kӴ3pĒrHJp"C V :ylMGɍrcz!Ah ~ gIrYl 7 f jk6R&N5' ! buL;dlq_U }7po&>P MVCjG6r, %k{:*9%`;2ڞY)yEc$J:-yg8*-,Q'ۊ}9J,1vWFKeL"r*сa#Dn:-0ȱŻx/!VVKFOP6r[(B );vZI7 ʴK$ҊrD2mtJs{Y ucE9G[)]rSQ6/C>fJD|RaRB$v8>awU</ĸYe0,YQ2 Ê8zYCGhue,HnT3"-/Da ⪱2:v"]4? %UnS7|"7I$d&^QI""l=aҚDla)F'+SbׁC%0)ʃqb6?s9 dƤvE!HG"=2TW`N0((TҏYX5ҪRE)) Lh'nSvoiTBsBwv:5h`9-KP2c\C;ԨO1ʌ>9*ޗgaH'78trܒPSF چa }aCk|2.]0q=> Z)Frr|pS$+Z ;PyD227:@xUC` 8"x zI5R2cє[H"xO=giBOF qLTYA!Tlc 3q&"ݽCJ^>93R'TkťOk3Rn7K$1Y"`~Xă^nB,Y9:;i;zfY=<jV+xhdx$eLGQA<.P` q18;Evqc"t[ 8xTY."3i}$7Jy \A${^d\i#CZOٴ%'qvz(sNHVp 7'qh8}`;2rH.!ʹ7:Ru̘IF/T~紶C),͒U9>< vJUDt&Fb»TF!I|D6Tʯ%N(i#վGNjlR2Udks-wã ]v X\PR7]]~58^4)))&͜AT5m$PL8>J\+o粏ScIb$8``El `Æ+VX ʢ)X(c=zBZQa Bh%R$ƠaJ9SOA%ZQl^ ʞ@] Ŧzʓ5e"YW:eBO+c j SMT3(=OVZK16}"RPT{+J-E)[{_)ܕ1bFkرe&b*Uv2PչYz n5؁V W*+ʕLM ˪ozH5*A2 #F=zHl`g2k.jң$+ cJ?(V(a5ipC;6P**e1@J( '8s 6Hbm(oTPA{%Yj*FȲ b($+b≫l*sN:ik#Zbj!r)뉨k"ꤊ1ULYqσ:8 @`A3E^9HBG*S!#{* 5k3_W` P"VZ*8J@H(ᢚ8o>r 4\II=JԾFe> vY?`j.r' _Wcbd7ݣ *E-+XԦL_[IWDPL@VW6d+JS_(cEsygzIY-B)("A&%!,R\S"ET2Hxc5HI 6Klvml;X(^A*V9/Pcz,[K6L$페{ h*n3hf"eӝ2ے]jI8 V87'X5͋7הXҏwV_Ͳ2OF@ 8MS`t{5H94->Ǘ~?l(ހr@ć++%P =| x l7V+z@Pv@@{)\mxB q_C Vm "xD$ 1\f~8RlDgdD,fq?P^Y(=Pkdc>5$fkYI)A빭[mcT0AB!~dd#i80ALC2$ ">RepW‚G KT!Be-m*sGz*Q[&Sk H 'Z-9cpS 3.Sۤ_ rOGJYlrS<^3%)ͧ%I';yO:Ga$hATȠ/DvEFTȪ t`hG=*,(bD?zRAS.6ДT: W3(|j3iOcǘԧC%g 8UK=,ROFuH)`*UJ9\RUQBkY;aplus-fsf-4.22/src/html/APlusRefScreen_AFrame_40R.gif0000444000265000001440000002107007215452773015733 GIF87a;???󿿿,;0I8ͻ`(diNClp,tmx|pH,Ƥrl:ШtDRجvz֯xL.ha8n8q-6|mM1p8s3CjǎAw~@_d??/=4<*.vGp?q ,Ȱ[@ o,lH) WY<ѣIq S3cɗ4PIS0s9KdM:\Z(,I](Aq2HjdHBm+2Ž]KՈG (W-[[0,-.^k,3Ű+$S,e*4si^m ԘTʹ eŵ رy "̺+н4":uU%} icZo}Pg9?>tIo`x` 6( `*L`@GЂEt(D BqQTŃ b 0* ,5"08 v$" %1$yAI?h9Xe9B5he Ѷi'ܻ Թ%';Nl _̫JoiX!qn9iᒌ2চ=z M+M T@>.ϞS툯`~^< ?p1{+MӽEW|ڷ3:ŹgwO嫝ث ;?޳:FEE.0(p@B $E<F `*:^o'ă+!] p.abt0Q*K WPTbD746#N$mDp0b#F1_ ٴ؁"a"+pyx^g3R$kD8r2X u> Fz$l()V0hT-A+*\Թvv^u9~p+X9,bYŒ d#ۖ*BbE:/Yೠ hGKҚ NֺR+W3ͭnwa}BRܗ2 nвȨֳuSt :wnsW]f.v jQծx5 rޖؗQh'![@}o^ AܷDsU8}]\[FBr7f Sb"tNj*$0ίCCb x2ְD-| /35I,Qa"7(-,S'c~fgh ȩYt$F;1ލ W7_l:ftCDKsyqVdկ $@cN #hȁ5/ Ogu~s]9C;LA>h󳕍gAXp~sHv; nxxy۶]3,]8.Rd;Afw!sˮcLoC:1^qQRVq;3޻׍9جu[_~6[Qb>͝WsNÛ9 c:$~d}W>Ǧ=I8Ͼk7#4Vuk"[gzfWsa|pmo6dPr\rS{&d"n'x12c[L|lSm@O~2()5'P(Y@Z 4(v>ggafq{xU\X|h^"#7`zgLJx`ǁs6Ug vfkG pQfwQh2<؀VwGy'l׊Wpq&wV¥kpIl((netHxhe6Qgsvʘx8\hVcҍJQ$x~}Hoȏ HR#↉p[UG ɉ Y)rYg8}7eȊUM  l}В1/'9Uw(]e\qg(y24ɂxkfx`FeVv|ߑHyRlvFy'b0\ Z;ٕnVv6/H}lɶV^g@LY(Q{Ee zb8]DK7gUho>9iη1ɕ{"7 H(}ɒkH%Z h~+ 6fF~цmY)tvXfuXJeL$WvٝWTyY~E镮՞ q('FtFќhwǃwyxIj9jjDw韄x)ʟ+:'G* ,j9ŝ>j 9٘3GY x"[G 䡡q ǘ JQz}Ϙzʘfc=g nʉgAypyHЮ$d:t08~98Ꝏ)z#6#։ )Gt"멩*ڟtq([ ;c?kγG'Z?؊ƈJxY˪ ٺ}% eQ.{gfreG>wQN뵳ʧ }ضZi9r#>fy[{jh뇡٭剖xz:_@Jq[oj`[Grh&۝o-虬Hz+XC1fo$˺W 8:vZh;/8{V˜LrOL2( ۪ Zk*PYk Pش-kԛj 2[뾉 Apy1ɭA7Vp$WкJo)) |УV۽H輟q6;lRkZ8ehFZXi+N)uڪ* -YĞիŬD>; +>ҡ u~ҫſ l ̮N <@?m^768`+gjaZ 携Ui7eJdrxMV5IZo&8 ;H ] mUJػzՅ}PzcО]ˠ J{J8ͳW`]@ieSg(*e\ Z-ʫܾj'ƍ|ҝ:BsM @҅܋ЮXokJaVۦoi4so{k|ޟ]޹+v:{}]\}ѕKgt?2аx^Еj\#o] l.~ݝ nxU#~IxVy@]]2^ӇC#:[ ]$߸ W=#sM0[ %qCUYCPظb]abqBf ~䈭ڍ>RMrҼ7x8;Αȶ s>џN꣧YF|tdjk)K@H{ֵE\MPT;FخnwnaZa~%.}iGeܼZX19^c{(nGnDWnx7TZy ~?Xhe,vUK֞~E֐v 4& N)_ 5aULI/w8u^>;6AWzL|X]%UC?@X rK7G׀^+*Ηo^}d < >Ů8u"Ӫt]P|k f^gƯA]lԤk_;~S_i|]ĦN ɪ Ǐ~?[,/k/(~j+(t<ɏަ0 0I$}Wu9 Xf׽p,tvThTɃ6PA1#ZL I.Ž:^)BiemF~pps Y'zVFuKS|3qmkf*2{e?5RC9 AA΃ѸUƝ|ߋa/,Qk' ufrh$ڬ wи>|BjQ:b; E'.dB*@䜛DQfU5Glq+w.̫RǗ m1hE%$n*զɠ^9,r>0w y#G{سk߾#b˓4yϳm_{_f^!}UDIqމ4|s5xs-(Fy#D)5alxo-i8x~8tSDh9x`(>MBR`H1AUVwC]%=]鋛gjfdg&rIdkީ}%J¹VYN :(1fdr.AhPRr#GiN^*e苈jsR-'$rS+D7Yv2DMv󞶌Ir@+NR %LU)3J<4@3%#$]JFHMF,zS.4p+]O{Z|ⳑ.%1J)~ 3AaZ{b5V+8ZnҦhMFJ52q\'3/b#GiL'ד֜j%+[O42ݫBFƱH,XYNb+kX:SjIhҚ"hY{TSWը,?;[jU]q]b&W>e.n[Y5noՂ黮xǻ݀>uwkk.%|J_P7)mPjj~yV1sOsW4? kI0GA˩ "qb#8ŧؿ2-Czc!xn|}.+m\^QVc^ v2B~wZa/Zf9jsge8Ul|y3|̂|Q78ѓ]s ^&C9AK9Ӱc >O+Sʣk:_Sψ˩nƪhW' .T5;mkᚐz[:MF \lM{1nHf]v29kK[>&D6U۾~̠pӒ' RL7;>o"/;ikMV#t}i;_^s.;eī|at ˼7{ЛOWgO/B>q)(${x2yaƉߨ`/?|NkCȢ)옐.2EFb){)5# b'' 钳:)6鉶<ٓ>@͓;aplus-fsf-4.22/src/html/APlusRefV2_10.html0000444000265000001440000004435310737165214013645 A+ Reference: Monadic Operators

Monadic Operators


Common Error Reports

Multiple errors elicit but one report. If an error report in the following list is issued, then the ones preceding it do not apply. Five reports are common to all monadic operators:

  • parse;
  • value: an argument has no value;
  • nondata: an argument (not an operand) is a function or some other nondata object;
  • an error report from the operand function;
  • wsfull: the workspace is currently not large enough to execute the function in; a bare left arrow (), which dictates resumption of execution, causes the workspace to be enlarged if possible;
  • interrupt (not an error): the user pressed c twice (once if A+ was started from a shell) while holding the Control key down.

Definitions of Monadic Operators

Apply gx and y gx

   Arguments
g is a function scalar; that is, g is <{f} for some function f (other than Assignment). The arguments y and x are suitable arguments for f.
   Definition
The function f described in the arguments section is evaluated, as f x in the monadic case or as y f x in the dyadic case. Indeed, although the two infix forms are shown for definiteness, f{...} is evaluated for any valence of f, zero through nine.

Warning! If instead of a function scalar you give a function expression, (e.g., instead of (+;-;)[1]x or (<{f})x you give -x or fx), you will get a wrong result, namely, the result for the Each operator.

   Additional Error Report
The following report is issued only if there is no parse or value error (see "Common Error Reports"):

  • a nonfunction error is reported if d is not a function scalar (or function expression: see the warning in the definition section); d precedes the colon in the error report.
   Examples
     fns(;;)    Equivalent to <{},<{},<{}

     2 3 fns[0] 4
 8 12

     2 3 fns[1] 4
 0.5 0.75

     2 3 fns[2] 4
 4 4 4
 4 4 4

Bitwise fx and y fx

   Arguments
The operand f is Cast, And, Or, Not, or one of the six relational functions (< = > ). The arguments y and x are suitable arguments for f.

   Definition
The Bitwise operator applies Not to each bit of the argument and applies all the other functions except Cast to each pair of corresponding bits of the arguments.

The derived function Bitwise Not is a monadic scalar function and all the others except Bitwise Cast are dyadic scalar functions, obeying the usual rules of conformability.

Examples for Bitwise Not, And, and Unequal

     ~ 16 15 123 122
 15 16 122 123        
One's complement.

     5 ^ 10
 0 1 0 1 4 5 4 5 0 1

     5  10
 5 4 7 6 1 0 3 2 13 12

And and Or, without the Bitwise operator, give boolean results for all valid arguments - see above.

Bitwise Cast x

Bitwise Cast leaves the data part of the variable unchanged but changes the type indicator and (usually) shape. The conversion of symbol to character, for example, is quite different from plain Cast: for a symbol, the data part is a four-byte pointer, which may differ from process to process but is guaranteed unique and invariant within a process. The data part of a character is, of course, its ASCII code.

The left argument can be `int, `float, or `char; a Bitwise Cast to `sym is not allowed since not all integers are valid symbols, i.e., not all point to symbols. The type of the right argument can be of any of the four.

Since scalars of various types are represented using various numbers of bytes, the length of the last dimension of the result may differ from that of the right argument. There is no padding or truncation. If rb bytes are required to represent the result type and ab to represent the right argument type and rb>ra, then the last dimension of the right argument must be divisible by rbab. The table below exhibits the relation between the shape of the right argument and that of the result.

The rank is changed only when a scalar is cast bitwise to a type that is represented in fewer bytes.

Shape of the Result of Bitwise Cast, for Argument Shape s

From `intFrom `float From `charFrom `sym
To `ints (1s), 211,s (1s), (1s)4 s
To `float (1s), (1s)2s (1s), (1s)8 (1s), (1s)2
To `char (1s), 411,s (1s), 811,s s (1s), 411,s

Examples for Bitwise Cast
     `int  `
 4163890

     `int  1.2 3.4
 1072902963 858993459 1074475827 858993459

     `char  `int  'abcdefgh'
dh   Plain Cast converts just the last byte of an integer to character

     `char  `int  'abcdefgh'
abcdefgh

     `int  'ab'
[error]  : length   The shape is 2, which is not divisible by 4.
   Additional Report
  • An "undefined" token report is issued if f is not one of the functions listed above.

Each fx and y fx

   Arguments and Result
f is any function expression (so Assignment is excluded, as it is for all operators). The result is nested. In the monadic case, the shape of the result is the shape of x. In the dyadic case, the shapes of the arguments and result follow the rules for dyadic scalar functions (see "Application, Conformability, and Result Shape"), except that only scalars are extended, not one-element arrays in general, and nonscalar arguments of differing ranks elicit a rank error report.

   Definition
The derived function, f, is a scalar function.

In the case of monadic f:

     (i#fx)  < f >i#x
for every valid index i. That is, each element of x is selected, f is applied to the Disclose of the selected element, and the result of f is enclosed and inserted in the result of f. (See "Disclose" for the definition of > and "Enclose" for <.) fx is equivalent to (f Each)x for the following defined operator Each:
     (f Each) x: {
          sx;
          x,x;
          z(x)<();
          (iz) do z[i]< f >x[i];
          sz}
In the dyadic case, if x and y have the same shape, then
     (i#y fx)  <(>i#y)f>i#x
for every valid index i. If x has one element, then
     (i#y fx)  <(>i#y)f 0x
for every valid index i. (See "Pick" for the definition of .) The definition is similar if y has one element, or both have one element.

Warning! If instead of a function expression you give a function scalar, (e.g., instead of -x or fx you give (+;-;)[1]x or (<{f})x), you will get a wrong result, namely, the result for the Apply operator.

   Additional Error Reports
Each of the following reports is issued only if there is no parse or value error (see "Common Error Reports") and none of the reports preceding it on this list applies:
  • a nonfunction error is reported if d is not a function expression (or function scalar: see the warning in the definition section); d precedes the colon in the error report;
  • a rank error is reported, when the derived function is dyadic, if neither argument is a one-element array and their ranks differ;
  • a length error is reported, when the derived function is dyadic, if neither argument is a one-element array and their shapes differ.
   Examples
In the first expression, the Each operator is applied to a monadic function (Shape) to give the rank of a scalar, a vector, and a matrix. In the second, it is applied to a monadic (Count, to find the vector lengths) as well as to a dyadic (Take, to pad the vectors to equal lengths for the principal function, Disclose); notice the other use of Disclose to make the Count Each result simple for Max Reduce, which finds the greatest length.

     ҡҡ (2;2;2 3)
 0 1 2

     (/>#vs)١vs('ab';'----';'cde')
ab
----
cde

Reduce f/x

   Arguments and Result
f is one of +, , , , ^, . The argument x is any array whose items are suitable left and right arguments of f. The shape of the result is 1x.
   Definition
If #x is at least two, i.e., if x has at least two items, then f/x is defined to be:
     x[0] f x[1] f ... f x[1+#x]
If #x is one, then f/x is x; while if #x is zero, then f/x is (1x)identity, where identity is a scalar that depends on f, and whose type for + and depends on x. See the table "
Identity Scalars for Reduction".

As pointed out in "Operators and Derived Functions", Reduce is not in the strictest sense an operator, but for most purposes it can be regarded as one.

Identity Scalars for Reduction
FunctionIdentity
+0
1
FunctionIdentity
0
^1
FunctionIdentity
Inf
Inf

   Additional Error Reports
If there is no error reported as a parse error then a similar error may be reported:

  • a token error is reported if f is a primitive function or operator symbol but not one of +^.
The following report is issued only if there is no parse, token, or value error (see "
Common Error Reports"):

  • a valence error is reported if f is a defined function (this report seems worth mentioning here, although it actually comes from Replicate - which of course also produces error reports and results when f is a variable).
   Examples
     +/3 5 2
 6

     3+5+2
 6

     /6 2
 10 11

     +/0
 0

Scan f\x

   Arguments and Result
f is one of +, , , , ^, . The argument x is any array whose items are suitable left and right arguments of f. The shape of the result is the same as the shape for x.
   Definition
If #x is at least one, i.e., if x has at least one item, then:
     (f\x)[i]  f/x[i+1]
for every valid scalar index i. That is, Scan produces a sequence of moving reductions. If #x is zero, then f\x is empty, and its type is integer for ^ and and depends upon x for the rest.

As pointed out in "Operators and Derived Functions", Scan is not in the strictest sense an operator, but for most purposes it can be regarded as one.

   Additional Error Reports
If there is no error reported as a parse error then a similar error may be reported:

  • a token error is reported if f is a primitive function or operator symbol but not one of +^.
The following report is issued only if there is no parse, token, or value error (see "Common Error Reports"):

  • a valence error is reported if f is a defined function (this report seems worth mentioning here, although it actually comes from Expand - which of course also produces error reports and results when f is a variable).
   Examples
     +\3 5 2
 3 8 6

     \3 4
 0 1 2 3
 0 1 2 3
 0 1 2 3

     \3 4
  0  1  2  3
  4  5  6  7
  8  9 10 11

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_11.html0000444000265000001440000006342010737165215013643 A+ Reference: Dyadic Operators

Dyadic Operators


Common Error Reports

Multiple errors elicit but one report. If an error report in the following list is issued, then the ones preceding it do not apply. Five reports are common to all dyadic operators:

  • parse;
  • value: an argument has no value;
  • nondata: an argument (not an operand) is a function or some other nondata object;
  • an error report from an operand function;
  • wsfull: the workspace is currently not large enough to execute the function in; a bare left arrow (), which dictates resumption of execution, causes the workspace to be enlarged if possible;
  • interrupt (not an error): the user pressed c twice (once if A+ was started from a shell) while holding the Control key down.

Definitions of Dyadic Operators

Inner Product y f.g x

   Arguments and Result
There are three inner products in A+: +., .+,  and .+. The arguments y and x must be nonscalars, and 1y must equal 1x. The shape of the result is (1y),1x.
   Definition
For matrices y and x, the function g is applied to row vectors of y on the left and column vectors of x on the right, in all combinations; f/ is applied to each these results. That is:
      (y f.g x)[i;j]  f/y[i;]g x[;j]
for all scalar indices i and j. The general definition of +. is:
     y (pdt@1 1 0)(1x)x
where
     a pdt b:+/ab
The function pdt must be applied to vectors along the last axis of y and vectors along the first axis of x, in all combinations. In order to do this with the Rank operator, the vectors along the first axis of x must be moved to the last axis. The expression (1x)x has the effect of moving the first axis of x to the last, while leaving all other axes in their original order.

Analogous definitions hold for .+ and .+.

As pointed out in "Operators and Derived Functions", Inner Product is not in the strictest sense an operator, but for most purposes it can be regarded as one.

   Additional Error Reports
Each of the following reports is issued only if there is no parse or value error report (see "Common Error Reports") - the token report preceding the value report -, and none of the reports preceding it on this list applies:

  • a token error is reported if f or g is a defined function name or a primitive function or operator symbol such that the derived function is not one of the three permitted forms;
  • a valence error is reported if there is no left argument for the derived function (a missing right argument is a parse error);
  • a rank error is reported if one of the arguments is a scalar;
  • a length error is reported if the last dimension of y and the first dimension of x are not equal.
   Example
     (2 3)+.(3 4)
 20 23 26 29
 56 68 80 92

Outer Product 1   y .f x

   Arguments and Result
f can be one of +, , -, , , , |, <, , =, , >, , and *. The arguments y and x are any arrays whose elements are suitable left and right arguments of f, respectively. The shape of the result is (y),(x).
   Definition
The function f is applied to all combinations of scalars from y and x. In particular, for vectors x and y:
     (y.f x)[i;j]  y[i]f x[j]
for all scalar indices i and j. Similar relations hold for arrays of other ranks. In general, y.f x is equivalent to y(f@0 0 0)x.

As pointed out in the "Operators and Derived Functions", Outer Product is not in the strictest sense an operator, but for most purposes it can be regarded as one.

   Additional Error Reports
If there is no error reported as a parse error, then a similar error may be reported:

  • a token error is reported if f is a defined function name or a primitive function or operator symbol such that the derived function is not one of the permitted forms.
The following report is issued only if there is no parse, token, or value error (see "Common Error Reports"):

  • a valence error is reported if there is no left argument for the derived function (a missing right argument is a parse error).
   Example

     1 10 100.1.2 3 98.2 5
   1.2   3     98.2    5
  12    30    982     50
 120   300   9820    500

Rank f@n x and y f@n x

(Just as for all operators, f cannot be Assignment.) Rank's derivation of monadic functions and its derivation of dyadic functions are covered in separate sections below. First, however, you should understand how the operator decomposes arrays, and the implications for its handling of empty arrays.

   Rank Operator uses Frames and Cells

The Rank operator  (f@n x and y f@n x)  splits an array into equal-shaped cells held in a frame and applies its function to each cell. The frame's shape consists of zero or more leading dimensions of the array and the cells' shape consists of the remaining zero or more trailing dimensions. (Cf. "Dimension, Shape, and Rank".) Rank deriving dyadic splits each argument separately.

For example, a function applied to an array of shape 3 4 5 using the Rank operator may be applied to:

  • cells of shape 0 (scalar) in a frame of shape 3 4 5; or
  • cells of shape 5 in a frame of shape 3 4; or
  • cells of shape 4 5 in a 3-item frame; or
  • a single cell with shape 3 4 5 in a frame with shape 0 (scalar).
Rank allows specification of the rank of either the cells (a positive number in n) or the frame (a negative number in n, whose magnitude is used). For example, to have the Rank operator apply a function to rank-2 cells in a 3-dimensional array, you can use either 2 (for the rank of each cell) or -1 (for a frame rank of 1).

If |n exceeds the rank of an argument to which it is applied, it is treated as if it equaled that rank. Thus you can specify both extreme cases in a way independent of rank: to allot all the axes to the frame, you specify cell rank to be 0, of course; to give all axes to the cells, you specify cell rank to be 9, the limit on ranks.

   The Rank Operator and Empty Arguments

The shape of the result of the derived function is always determined in the same way (with any additional axes on the right produced by the operand function), whether the arguments are empty or not. The type of the result, however, is a different matter. In the absence of an empty frame, the type is determined by the operand function, for the empty cells. On the other hand, if a frame is empty, the Rank operator never calls this function. For a primitive function, Rank uses its result type, or at least its default result type. For a nonprimitive function, it uses null. These examples show this type selection:
     y f x:x      A simple function to be used as an operand.
     2(f@1)0    Scalar frames, empty-vector cells (left argument is made
 `int             to conform to right). An empty integer vector is returned
                  to Rank by f.
     2(f@0)0    An empty-vector frame (from right argument); no (scalar)
 `null            cells for f, so no call. Rank makes the result type null.
     2(+@1)0    Like the first example.
 `int             +0 is integer.
     2(+@0)0    Rank doesn't apply Add to anything, but does use the type
 `int             implied by Add: the Add result type for integers is integer,
                  if the result can be so represented.
     (0) @0 0  Rank passes fake args (the usual zeros, unhappily)
 : domain        to the operand function to determine the size and
                  type of the result. Divide is not amused.

   Rank Deriving Monadic f@n x

The rank specification n is a one-element integer array. For conformity with the discussion of Rank deriving dyadic, assume n is a vector. Then if n is nonnegative, Rank applies f to cells of rank jn[0]x within a frame of shape (-j)x.

If n is negative, Rank applies f to cells of rank k0(x)-|n[0] within a frame of shape (-k)x.

   Additional Error Reports
Each of the following reports is issued for Rank deriving monadic only if there is no parse or value error (see "Common Error Reports") and none of the reports preceding it on this list applies:

  • a type error is reported if n is not a simple integer array;
  • a length error is reported if n has more than 3 elements (although only the first element is used);
  • a nonfunction error is reported if f is not a function.
   Examples
     (+/@1) 2 310 20 30 1 2 3  The data operand must be separated
 60 6               from the left argument of Reshape: parentheses used.
     @1 2 3 4    The frame is of rank 1, so the cells are of rank 2.
  8  9 10 11         is called twice, with matrices as arguments,
  4  5  6  7        so the items whose order is reversed by
  0  1  2  3         are rows.

 20 21 22 23
 16 17 18 19
 12 13 14 15
     @1 2 3 4     The cells are of rank 1, so the frame is of rank 2.
  3  2  1  0         is called six times, with rows as arguments,
  7  6  5  4        so the items whose order is reversed by
 11 10  9  8         are scalars.

 15 14 13 12
 19 18 17 16
 23 22 21 20
     @3 2 3 4     The cells are of rank 3, so the frame is scalar.
 12 13 14 15         is called just once, with a rank-3 array as arg,
 16 17 18 19        so the items whose order is reversed by
 20 21 22 23         are matrices.
                    @3 2 3 4 is equivalent to 2 3 4
  0  1  2  3
  4  5  6  7
  8  9 10 11

   Rank Deriving Dyadic y f@n x

The rank specification n must be an integer array with one, two, or three elements. For convenience, assume n is a vector throughout this description.

There are three behaviors for Rank deriving dyadic, depending upon n;

If n has one element and is nonnegative, Rank applies f to cells of rank jn[0]x within a frame of shape (-j)x on x and to cells of rank kn[0]y within a frame of shape (-k)y on y.

If n has one element and is negative , Rank applies f to cells of rank j0(x)-|n[0] within a frame of shape (-j)x on x and to cells of rank k0(y)-|n[0] within a frame of shape (-k)y on y. A common case is f@1 (which pairs items from both arguments and applies the function f to each pair).

If n has two elements, then the first element of n is used for y and the second element is used for x, each interpreted in the same way as when n has one element.

When n has three elements, the first two are used in the manner just stated. The third element of n breaks the frame into two subframes, leading and trailing. It specifies the number of trailing axes in the frames of x and y in which cells will be paired with corresponding cells, and in which, therefore, mismatched dimensions are forbidden. Any leading dimensions present in one trailing subframe and absent in the other - which must in this case be a whole frame -, are supplied by replicating the latter subframe. Any remaining (leading) axes of the frames are used to create subframes whose members are paired in all possible ways, in the manner of an outer product. Again, n can be excessive; any excess is dealt with as described in the next paragraphs.

Assume, just for convenience, that the first two elements of n are positive. Set
cyn[0]y and cxn[1]x (cell ranks), tyn[2](y)-cy and txn[2](x)-cx (ranks of the trailing parts of the frames), and ly0(y)-cy+ty and lx0(x)-cx+tx (ranks of the leading parts of the frames).

That is, the cell specifications are honored to the extent possible, then the trailing subframe specification is honored to the extent possible, and the leading subframes are whatever is left. The function f is applied to pairs of cells of rank cy and cx taken from y and x respectively, using all combinations of subscripts for the first ly and lx axes and corresponding subscripts for the next tytx axes (after possible replication of one trailing subframe to make these subframes match).

Whether the cells match is the responsibility of the operand function. The two leading subframes have no compatibility requirement. The two trailing subframes must match only as far as they both exist: specifically,

     (-tytx)(-cy)y    (-tytx)(-cx)x.
Clearly, if ty is less than tx (and so the trailing subframe for y is replicated to match the shape of the trailing subframe for x), then ly is zero, and if tx is less than ty, then lx is zero.

Note that:
if n has only one element, y (f@n) x is equivalent to y (f@ n,n) x
        which is equivalent to y (f@ n,n,9) x
and if n has exactly two elements, y (f@n) x is equivalent to y (f@ n,9) x.
When n has fewer than three elements, the trailing subframes are simply the frames.
   Additional Error Reports
Each of the following reports is issued for Rank deriving dyadic only if there is no parse or value error (see "Common Error Reports") and none of the reports preceding it on this list applies:

  • a type error is reported if n is not a simple integer array;
  • a length error is reported if n has more than 3 elements;
  • a mismatch error is reported if the shapes of the subframes do not match;
  • a nonfunction error is reported if f is not a function.
   Examples
     '-->' ,@1 4!'abcdABCD'  Rank 1 cell (rank 0 frame) vs. rank 1
 -->abcd                      cell (rank 1 frame). The scalar left
 -->ABCD                      frame is treated as a 2-element vector.

     '01' ,@1 4!'abcdABCD'  Rank 1 frame (rank 0 cell) vs. rank 1
 0abcd                        frame (rank 1 cell).
 1ABCD

     (3)(,@0 1)2 3 4        Rank 0 cell (rank 1 frame) vs. rank 1
   0  0  1  2  3              cell (rank 2 frame). The vector left
   1  4  5  6  7              frame is treated as a 2 by 3 matrix: the
   2  8  9 10 11              "missing" dimension is supplied.

   0 12 13 14 15
   1 16 17 18 19
   2 20 21 22 23

     (1990+2)(,@0 1 0)2 3   Both left argument scalars vs.
 1990    0    1    2          both right argument vectors. Cells left
 1990    3    4    5          rank 0, right rank 1; rank 0 trailing
                              subframes and rank 1 leading subframes
 1991    0    1    2          for both.
 1991    3    4    5

     (2 3 4),@1 1 2(2 3 9)  Vector vs. vector, rank 0 leading
   0  1  2  3  0  1  2  3  4  5  6  7  8   subframes. The
   4  5  6  7  9 10 11 12 13 14 15 16 17   1 1 2 operand
   8  9 10 11 18 19 20 21 22 23 24 25 26    could as well be
                                           1 1
  12 13 14 15 27 28 29 30 31 32 33 34 35
  16 17 18 19 36 37 38 39 40 41 42 43 44
  20 21 22 23 45 46 47 48 49 50 51 52 53

Now vector cells, from corresponding rows, both planes vs. both planes (rank 1 cells, rank 1 trailing subframes, and rank 1 leading subframes for both). The arguments are:
     2 3 3"my you it  t hedog"
my
you
 it

  t
 he
dog

and

     2 3 4"hat  did is win rs  's  "
hat
 did
 is

win
rs
's
Applying ,@1 1 1 to them yields
     (2 3 3"my you it  t hedog")(,@1 1 1
*     )2 3 4"hat  did is win rs  's  "
my hat
you did
 it is
my win
yours
 it's


  that
 he did
dog is

  twin
 hers
dog's
      Errors
Errors may be reported by either the operator or an operand:

     (2 4 4),@1 1(2 3 9)   One trailing subframe a vector of length
,@1: mismatch                four, the other a vector of length three.
*                           Rank notes the discrepancy in lengths.

     (24)(+@0)23
+@0: mismatch                Rank can't pair scalar cells for Add.
*     

     (24)(+@1)23           Rank can pair vector cells for Add,
 +: length                   but Add can't pair scalar items.
*      
      Inner and Outer Products
If there is no Outer Product for f, f@0 0 0 may be used.
Sine, cosine, tangent of 0 45 90 ... 360 degrees, with the result doctored to show Inf:
     8.4 1 2 3 @0 0 0 .259
  0.0000  0.7071  1.0000  0.7071  0.0000 -0.7071 -1.0000 -0.7071  0.0000
  1.0000  0.7071  0.0000 -0.7071 -1.0000 -0.7071  0.0000  0.7071  1.0000
  0.0000  1.0000     Inf -1.0000  0.0000  1.0000    Inf -1.0000  0.0000
If there is no Inner Product for f and g, f/@(y) x g@0 1 y may be used (if there is no Reduction for f a defined reduction operator may be used). For (2 12)^.<12 24:
     ^/@2 (2 12) <@0 1 12 24
 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_12.html0000444000265000001440000005506510737165215013652 A+ Reference: Control Statements

Control Statements


Unlike functions and operators, which take arguments and return results, control statements are primarily used for their side effects, although they always do have explicit results. Some control statements also have syntax that differs from that of functions taking arguments. The keywords are reserved: the words or names case, do, if, else, and while can appear only as parts of control statements as shown in this chapter.

Error Reports

Multiple errors elicit but one report before suspension. Because these control statements are complex, the order in which the reports are listed here is not necessarily A+'s order of reporting in any particular situation. The five kinds of reports are:

Definitions of Control Statements

Case

   Syntax
There are two forms of case statement:
case (target) {value0; expression0;
               value1; expression1;
                  * * *
               valueN; expressionN;
               default}

and

case (target) {value0; expression0;
               value1; expression1;
                  * * *
               valueN; expressionN}
where case is a keyword, and target, value0, ... , valueN, expression0, ... , expressionN, and default are each an expression or expression group.
   Definition
The values of target, value0, ... , valueN are subject to the requirement that targetvalueN must be a valid expression for each value0, ... , valueN. The case statement is evaluated as follows: the test
     1targetvalue0
is made. If the result of the test is 1, then expression0 is evaluated and its result is the case statement result. No further evaluations within the case statement are made. Otherwise, the expression value1 is evaluated and if the result of the test
     1targetvalue1
is 1, then expression1 is evaluated and its result is the case statement result. This continues until all the expressions up to valueN have been evaluated and tested. If all tests fail and the expression default is present, then it is evaluated, and its result is the case statement result. If all tests fail and default is not present, the case statement result is the Null.
   Additional Error Report:
  • An error report is issued by Find () if the results of target and some valuek are not a suitable pair of arguments for it.
   Examples
     matrix x : {
          case (x) {
               0 ; 1 1x;
               1 ; ((x),1)x;
               2 ; x;
               `rank }
          }
     matrix 4
 1 1
     matrix 3
 0
 1
 2
     matrix 2 3
 0 1 2
 3 4 5
     matrix 3 4 5
.matrix: rank
*     

Do - Monadic (Protected Execution)

   Syntax
do expression ,    where do is a keyword and expression is either an expression or an expression group.
   Definition
The do statement used monadically normally performs a protected execute of expression.  That is, with one exception, execution of expression is always completed, or at least abandoned; it is never suspended.  The exception: a suspension, with a stop error message, can be triggered by the Stop function (monadic ^) when `stop is 1, and by a few other operations, such as an attempt to give a bound variable an impermissible value.  See the last example for treatment of input during a suspension within protected execution.

Execution of monadic do is affected by the Protected Execute Flag, `Gf, as described below. `Gf is set by the command $Gf.

The result of the do statement is usually a two-element vector of the form (error_code;result). If there is no error, the do result is always of that form, error_code is 0, and result is the result of expression.

If an error was encountered when evaluating expression, there are three possibilities, depending upon the value of `Gf:

  • If `Gf is 1 (the normal case), then error_code is nonzero, and result is a character string holding the error message. The table "Error codes for Protected Execution" lists the error codes and messages.

  • If `Gf is 2, then the do result has three items, the first two as just described and a third containing the value of $si at the time of the error.

  • If `Gf is 0, then the execution is not protected and the error message and suspension occur just as they would for expression alone.
Error codes for Protected Execution
If Error Code is not zero, Error Name is the second element of the do result
Error CodeError NameExample
0(no error)
-1 segv, bus, or other error not detected directly by the interpreter,
or a name from Signal
do 'error1'  Signal function causes and names the error
1interrupt do while(1)1  Interrupt: hold Control down, press c twice - once if A+ was started from a shell.
2wsfulldo 1e91
3stack recurse x: recurse x
do recurse 0
4valuedo 1+abcd
5valencedo 3
6typedo "a"
7rankdo 0#0
8lengthdo 1 2 + 3 4 5
9domaindo 00
10indexdo 9#9
11mismatchdo 1 2 +@0 3 4 5
12noncedo 1 23 5
13maxrankdo (101)1
14nonfunctiondo x@1 x1
15parse do '+f'  Where (f x:x), say.
16maxitems do mp[,]item  Too many items.
17 invaliddo {a'abc'; `a .is `label; a3}
18nondatado +{519;+}

Monadic do's can be traced using $dbg do.

Unlike Execute, do cannot successfully execute a command, a function definition, or, unless in braces, an expression that must be alone on a line. Thus 0'$vers' and 0'f{x}:{2x+1}' and 0'+@0' and 0'' all give nonerror results (as does unprotected Execute); do $vers and do f{x}:{2x+1} and do +@0 and do  all yield error results; and do {+@0} and do {} both give nonerror results.

Messages that are not strictly A+ error messages will still appear in the log, e.g.
filename: No such file or directory
not an `a object
and many adap messages.

Warning!  Within a Monadic Do - as in a Protected Execute - Result (x) exits from Monadic Do only, with a 0 return code and the Result argument as result;  it does not exit from the function containing the Monadic Do.

Typically, the monadic do statement is used in the form:

     if (0=0zdo x) {
            ... Normal processing for result 1z}
     else { ... Error processing for error 1z}
For an A+ process started from a shell, the Unix command kill -INT process-id  can be used to interrupt protected execution, like Ctl-c Ctl-c from Emacs (or a single Ctl-c within a session started from a shell), and execution will continue with the next expression. If, however, this kill -INT signal is sent from the shell when protected execution is not in progress, it will cause A+ execution to halt.
   Examples
     y div x: {
          case (0zdo{yx}) {
           0; 1z;    Divide worked, return result.
           9; 0;      Domain error, replace 00 by 0.
           1z }    Failed for another reason, so report.
          }

     2 3 4 div 5 2 1
 0.4 1.5 4

     2 2 2 0 0 div 5 0 0 5 0
 0.4 Inf Inf 0 0     "Fixed" 00, making it 0.

     2 3 4 div 5 2
 .div: length
*     

     2 3 4 div 'abc'
 .div: type
*     

     a div a5e62
 .div: wsfull
*     

 Treatment of input for immediate execution when stopped within protected execution.
     no no no          An expression that cannot be parsed.
[parse] .no: var?
     $stop 1
     do {^a,.0; (n100)do a[,](200+5n)n-40; a}
[error] : stop        Now stopped within immediate execution.
*     9 9 9
 9 9 9                 Result is displayed for any correct input.
*     nonono           Value error ignored: no suspension and NO display.
*     do nonono        The remedy is to use protected execution in input.
<  4                   Protected do is correct input; result is error it found.
< value
*     no no no         Parse error ignored: no suspension and NO display.
*     do no no no      Entire input cannot be parsed: do is ineffective.
*     do 'no no no'
<  15                  do result shows the parse error found by  in its arg.
< parse
*     ()'no no no'     result is code for parse error it found in its arg.
 15
*                     Continue from the point where stop occurred.
<  9                   Result reports domain error from 00.
< domain

Do - Dyadic (Iterative Do)

   Syntax
count do expression,      where do is a keyword and count and expression are either expressions or expression groups. (Typically, count is an expression.)
   Definition
The value of count must be a restricted whole number (a scalar or one-element array). The expression named expression is evaluated count times. There are the same limitations on expression as were stated above in the definition of Monadic Do.

If the expression count is a (perhaps parenthesized) variable name alone or a parenthesized expression that makes an assignment to a variable name, then within expression that variable is successively given the integer values 0, 1, ... , count-1 for the successive evaluations. In these cases, once execution of the do statement is complete, the value of that variable is an integer equal to the value of the expression count.

If count is (*varname) or (*varname...) then execution proceeds as if the * were not present (including the value of varname after the do is completed) and for the successive evaluations of expression the variable is successively given the same integer values except that these values are given in decreasing order.

The explicit result of the do statement is the result of the last evaluation of expression.

Result (x) causes an exit from the function that contains the Protected Do.

   Additional Error Report
  • A domain error report is issued if the result of count is not a restricted whole number.
   Examples
     z00
     n10
     n do zz,n                  Variable name alone:
 0 1 2 3 4 5 6 7 8 9             n is counted up from 0
     n                           to its original setting
 10

     z00
     (i10) do zz,i             Assignment to a variable name:
 0 1 2 3 4 5 6 7 8 9             similar treatment of i
     i
 10

     z00
     v`i
     ((%v)10) do zz,%v         Not just a variable name:
 10 10 10 10 10 10 10 10 10 10   %v remains 10 throughout

If

   Syntax
if (condition) expression,      where if is a keyword and condition and expression are either expressions or expression groups; typically, condition is an expression. If condition is either a single number or name, or it is an expression group and therefore in braces, the parentheses are not necessary (although perhaps still a good idea for clarity).
   Definition
The result of condition is a restricted whole number (a scalar or one-element array). If that result is nonzero then expression is evaluated, and the result of the if statement is the result of expression. Otherwise the result is the Null: i.e., the explicit result is Null if expression is not evaluated.

A note on entry of this statement: A+ considers if (condition) entered alone on a line, with no pending punctuation, to be a complete statement, taking expression to be null.

   Additional Error Report:
  • A domain error report is issued if the result of condition is not a restricted whole number.
   Example
     if (0=x) x,x

If - Else

   Syntax
if (condition) expression1 else expression0,     where if and else are keywords, and condition, expression1, and expression0 are either expressions or expression groups. Typically, condition is an expression. The parentheses are not necessary (although perhaps still a good idea for clarity) if condition is either a single number or name, or an expression group and therefore in braces.

   Definition
The result of condition is a restricted whole number (a scalar or one-element array). If that result is nonzero, then expression1 is evaluated. Otherwise, expression0 is evaluated. The result of the if-else statement is the result of whichever of expression1 or expression0 was evaluated.

   Additional Error Report:
  • A domain error report is issued if the result of condition is not a restricted whole number.
   Example
     if (10|x) x else 10x

While

   Syntax
while (condition) expression,    where while is a keyword and condition and expression are each either an expression or an expression group. Typically, condition is an expression. The parentheses are not necessary (although perhaps still a good idea for clarity) if condition is either a single name or an expression group and therefore in braces.

   Definition
The result of condition is a restricted whole number (a scalar or one-element array). If the value of condition is nonzero, then expression is evaluated. condition is evaluated again, and if its value is nonzero, expression is evaluated again. This continues until the value of condition is 0. The result of the while statement is the result of the last evaluation of expression. If expression is never evaluated, the result is the Null.

A note on entry of this statement: A+ considers while (condition) entered alone on a line without pending punctuation to be a complete statement, taking expression to be null. If you inadvertently enter such a statement, you can recover by pressing Control and holding it while you press c twice.)

   Additional Error Report:
  • A domain error report is issued if the result of condition is not a restricted whole number.
   Example
     penny x: {
          m0.01;
          i1;
          while (m<x) {
               i,m;
               ii+1;
               mm2 }; }
     penny 1
 1 0.01
 2 0.02
 3 0.04
 4 0.08
 5 0.16
 6 0.32
 7 0.64

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_13.html0000444000265000001440000005015210737165215013643 A+ Reference: System Variables

System Variables


Classification of System Variables

Although they are listed alphabetically by English name in this chapter, for convenient reference, the A+ system variables can be grouped, among many other ways, in five categories, dealing with:
  • error handling and debugging: Bus Error Flag, Callback Flag, Core File Size Limit, Dependency Flag, Execution Suspension Flag, Floating Point Exception Flag, K Stack, Protected Execute Flag, Segv Error Flag, Stack Information, Stop, X Events Flag;
  • versions: Compiler, Dynamic Environment, Language Level, Major Release Number, Minor Release Number, Phase of the Release, Release Code, Version;
  • implicit arguments to primitive functions: Context, Printing Precision, Random Link;
  • handling of input: Input Mode, Standard Input, Terminal Flag;
  • files: File Being Loaded.

Setting and Referencing System Variables

System variables cannot be set or referenced directly. The system functions Set System Variable, _ssv, and Get System Variable, _gsv, are used for this purpose. Most system variables can be set and referenced in this way; exceptions are noted in the individual descriptions.

In A+, variables and system variables are in completely distinct domains, with overlapping name spaces; a name's reference is determined not only by the name itself but also sometimes by the situation in which it occurs. As an example, consider the printing precision, `pp: _gsv is willing to accept 'pp' for it, whereas % considers `pp just a way of referring to pp:

     ppû5
     pp
 5
     _gsv `pp
 10
     %`pp
 5
     (_gsv 'pp'),â'pp'
 10 5

Definitions of System Variables

Bus Error Flag `busexit

This flag controls the action when a bus error occurs. If it is 0 (the default), then the usual error message is issued and execution is suspended. If it is 1 or 2, A+ exits and a core dump is taken. On Sun machines, 1 and 2 have the same effect. On AIX machines, 2 causes the FULLDUMP flag to be set, whereas 1 produces a smaller dump. If `corelim is too small to allow a dump, only the exit occurs. A Monadic Do or Protected Execute is overridden when this flag is 1 or 2.
To set up an exit and core dump on bus and segv errors, execute
     Ý `busexit `segvexit `corelim _ssv¡ (1;1;Inf)
or
     Ý `busexit `segvexit `corelim _ssv¡ (2;2;Inf)
or the like, and to re-establish the defaults, execute
     Ý `busexit `segvexit `corelim _ssv¡ 0
All messages from users reporting core files should be sent to email id aplusdev and should contain:
  • The A+ release number involved.

  •  
  • The machine on which it happened, and the machine's domain.

  •  
  • The location of the core file.

  •  
  • The output of the "where" stack. See instructions below for obtaining this output.

  •  
  • All other information you would normally include in a bug report: the application, $si, what you were doing at the time, repeatability, etc.
To get the "where" information:
  • From an XTerm, issue the command

  • dbx `which a+` corefile
    with corefile replaced by the actual filename.
     
  • After a minute or so, you'll see a (dbx) prompt. Enter

  • (dbx) where
    and grab the ensuing output, sometimes quite lengthy, and cut and paste it into your message.
     
  • Issue the command (dbx) quit to exit from dbx.

Callback Flag `Sf

The value of `Sf is either 0 or 1 (the default). See "Callback Flag" ($Sf) for the meaning of these values.

Compiler `CCID

Corresponding to the MSDE convention, identifies the compiler used to build A+. This variable is primarily intended for use by the tidyld{} tool to distinguish future 32 and 64 bit dyload objects.

Context `cx

The value of `cx is a symbol holding the name of the current context.

Core File Size Limit `corelim

The value of `corelim is the size of the largest permissible core file created by a failing A+ process; if the file size would be larger than this value the core file will not be created. A core file will always be created if the value is Inf. The default is 0, so that a core file is never created when the default setting is in effect.

Dependency Flag `Df

The value of `Df is 0 or 1 (the default). See "Dependency Flag" ($Df) for the meaning of these values.

Dynamic Environment `dyme

`dyme has the value -1 if Dynamic Load, _dyld, is not available. Otherwise, it has the value 0 in a Sun OS environment, except as noted below, 1 in an AIX environment, and 2 in Solaris and Irix.

The value is 2 for sunos.4.1.3, reflecting the use of the new Lexa compiler and support for dynamically loaded code. For developers and maintainers of _dylded functions, this change means that shared library versions will need to be built to work with this version.

To ease the conversion, the _dyld{} code will attempt to create a temporary shared library using the "old" nonshared object files, so simple uses of _dyld{} should continue to work, e.g., "xxx.o" _dyld ("_xxx";"xxx";0 0).  This automatic creation of shared libraries will most likely fail with a more complex left argument that contains libraries or other linker options. Please send aplusdev a mail message if you need any assistance with dynamically loaded code or creating shared libraries.

`dyme cannot be set.

Execution Suspension Flag `Ef

The value of `Ef is 0 or 1 (the default). See "Execution Suspension Flag" ($Ef) for the meaning of these values.

File Being Loaded `loadfile

`loadfile is a character string giving the name of the file currently being loaded. It is null if no file is in the process of being loaded. (Typing _gsv `loadfile in an Emacs session yields the Null, since the statement won't be executed while a $load is underway.)

Note that, in the case of nested loads, only the name of the innermost file is returned. Also, if the file is $loaded with a relative pathname, _gsv `loadfile returns a relative pathname.

Floating Point Exception Flag `Xfpef

The value of `Xfpef is 0 (the default) or 1. When it is 1, domain errors that result when external routines generate SIGPFEs (floating point exceptions) are suppressed. When it is 0, they are not suppressed.

Input Mode `mode

The value of `mode is either `apl (the default) or `ascii. See "Input Mode" ($mode) for their meaning.

K Stack `si

The value of `si is a nested vector. It cannot be set. It represents the K stack, which is used by the State Indicator command, $si, and whose contents are subject to change, to improve debugging; furthermore, the format of `si is likewise subject to change. This variable includes all suspensions, unlike State Indicator, which displays only the latest. At present, there are two elements for each level of suspension: an enclosed Null (as a separator between levels) and a nested vector whose (character) elements are indicators, like 'expr', and expressions, like '00'.

Language Level `language

The value of `language is either `a or `aplus. It cannot be set. It is the recommended way for toolkits that are used by A+ to determine the environment.

Major Release Number `majorRelease

The value of `majorRelease is the major release number of the currently running version of A+. See "Invoking A+". It cannot be set.

Mapped Files Limit `maplim

The value of `maplim is the number of files that can be mapped concurrently; the default is 2000.

Minor Release Number `minorRelease

The value of `minorRelease is the minor release number of the currently running version of A+. See "Invoking A+". It cannot be set.

Phase of the Release `phaseOfRelease

The value of `phaseOfRelease is `alpha, `beta, or `prod, according to the currently running version of A+. See "Invoking A+ from the Shell". It cannot be set.

Printing Precision `pp

The value of `pp is a nonnegative integer less than 100; its default value is ten. It specifies the maximum total number of digits to be used in the display of a number, not counting the two digits following the e in exponential notation, with two exceptions:

If `pp is zero, then it is treated as if it were one.

If `pp is less than ten, integers are nevertheless displayed with up to ten digits.

See "Printing Precision", Format () "Examples", and Default Format "Examples".

Protected Execute Flag `Gf

The value of `Gf is 0 or 1 (the default). See "Protected Execute Flag" ($Gf) for the meaning of these values.

Random Link `rl

The value of `rl is a nonnegative integer. It cannot be referenced. See "Random Link" ($rl).

Release Code `releaseCode

The value of `releaseCode is a character vector composed of the characters following a+_ in the value of ATREE for the currently running version of A+. See "Invoking A+". It cannot be set.

Segv Error Flag `segvexit

This flag is exactly like the Bus Error Flag, except that it controls the action when a segv error occurs.

Stack Information `doErrorStack

Enable (1) or disable(0) the stack information on error facility. See _doErrorStack{}.

Standard Input `stdin

The values of `stdin are 1 for normal terminal input mode (the default, of course), and 0 to get the effect of Terminal Flag ($Tf). Unlike $Tf, when `stdin is 0, keyboard entries are queued to be processed when `stdin is subsequently reset to 1. Cf. the Terminal Flag system variable, `Tf.

Stop `stop

The values of `stop are 0, 1, or 2 (the default). See "Stop" ($stop) for the meaning of these values.

Terminal Flag `Tf

The value of `Tf is either 0 or 1 (the default). If 1, terminal input is normal. If 0, terminal input is ignored; see the Terminal Flag command, $Tf. Cf. the system variable `stdin, Standard Input.

Version `vers

The value of `vers is a character vector describing the currently running version of A+; it is the text following the phrase This version is that appears when A+ is invoked. It cannot be set.

X Events Flag `Xf

The value of `Xf is either 0 (the default) or 1. See "X Events Flag" ($Xf) for the meaning of these values.

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_14.html0000444000265000001440000032225510737165216013653 A+ Reference: System Functions

System Functions


Classification of System Functions

Although they are listed alphabetically by English name in this chapter, for convenient reference, the A+ system functions can be grouped, among many other ways, in ten categories, dealing with:

  • system variables:   Get System Variable, Set System Variable;

  • names and references:   Expunge, Expunge Context, Locals, Name, Name Class, Name List, Valence;

  • attributes:   All Attributes, Get Attribute, Set Attribute, Get Client Data, Set Client Data;

  • dependencies:   All Dependent Object Names, Dependency Definition, Dependent Object Names, Remove Dependency Definition;

  • callbacks:   Get Callback, Get Preset Callback, Set Callback, Set Preset Callback;

  • files:   Abort Loading of Script, Change Directory, Dynamic Load, Items of a Mapped File, Load a File, Load and Remove a File;

  • format changes:   Association List to Slotfiller, Comma Fix Input, Fix Input, Flatten, Format, Scalar Comma Fix Input, Scalar Fix Input, Screen Format, Get Format Symbols, Is a Slotfiller;

  • text functions:   General Search and Replace, Index Of, Name Search, Name Search and Replace, String Search, String Search and Replace;

  • indexing:   Permissive Indexing;

  • debugging:   Debug, NaN Find, Stack Information;

  • A+ operation and space:   Execution Profile, Exit, Hash Table Statistics, Work Area.

Querying Syntax

To inquire about the syntax of a system function or external function in an A+ session, enter its name alone on a line. For example:
     _nl
 _nl{any;any} returns any
Because some of the system functions take more than two arguments, they are all shown here in general form, for uniformity, and that is how a syntax query is answered. Nevertheless, infix notation can also, of course, be used to invoke the monadic and dyadic system functions.

Common Error Reports

Multiple errors elicit but one report. If an error report in the following list is issued, then the ones preceding it do not apply. Seven reports are common to all system functions:

  • parse;
  • value: an argument has no value;
  • valence: the wrong number of arguments were given;
  • nondata: the argument is a function or some other nondata object;
  • type or domain: an argument is of the wrong type (nested when it should be simple, numeric when it should be a symbol, and so on) or the wrong class (e.g., a symbol, but not from some required set of symbols); the same error is called type by some functions and domain by others;
  • length: a single number is required and the ravel of the argument does not have a length of one;
  • wsfull: the workspace is currently not large enough to execute the function in; a bare left arrow (), which dictates resumption of execution, causes the workspace to be enlarged if possible;
  • interrupt (not an error): the user pressed c twice while holding the Control key down.

Definitions of System Functions

The Name Argument

Several system functions take names as arguments. A name argument is one of the following:

  • a symbol holding a valid A+ name, e.g., `var or `ctx.var;

  • a pair of symbols holding a valid A+ context name and a valid name, e.g., `ctx `var.
These names always refer to global objects. See "
Symbols and Symbol Constants".

The definition of a system function refers to this section if it has an argument that conforms to this definition.

Abort Loading of Script _abortload{}

   Definition

This system function allows the user to terminate the $loading of a file. Executed in a script, it will terminate that script after the current line is processed. If one script loads a second, and the second script calls _abortload{}, the second script ends immediately, but the first script is not aborted, and continues to be loaded. While the loading of a script is suspended - by an interrupt, error, Stop, or Signal, for example -, entering _abortload{} in the (Emacs or XTerm) session log for execution will terminate its loading, without affecting the suspension.

All Attributes _atts{y;x}

   Argument and Result
The arguments x and y are described in "The Name Argument". The result is a vector of symbols.

   Definition
Lists all attributes set by _set on y with prefix x. E.g., _atts{`a;`appl} lists all attributes of the form `appl.* set on a. If x is Null, lists all attributes set by _set on y. The attributes are listed in random order. If the variable y does not exist, the result is empty. For a list of attributes set by s (which does not currently use _set), i.e., display attributes, use the settings attribute.

All Dependent Object Names _alldep{x}

   Argument and Result
The argument x is described in "The Name Argument". The result is a vector of symbols.

   Definition
The result is the transitive closure of _dep{x} (Dependent Object Names): it returns the dependency set of x, to wit, a list containing _dep{x}, _dep_dep{x}, etc., with duplicates removed.

Note that if f is a dependency and `f is contained in the vector _alldep{`f}, then the dependency set _alldep{`f} is cyclic. See "Cyclic Dependencies".

Association List to Slotfiller _alsf{x}

   Argument and Result
The argument is an association list or a slotfiller. The result is a slotfiller (but see below).

   Definition
This function converts an association list to the equivalent slotfiller. It also accepts slotfillers and returns them unchanged, so that it can be used to obtain a slotfiller from an array that might be either an association list or a slotfiller; no checking is necessary.

An argument that is an association list whose length is odd is accepted in two cases. If the last element is a symbol, a Null is appended before conversion. If the last element is a Null, it is dropped.

In one case the result is not actually a slotfiller: if there are duplicates among the symbols that are to be the elements of the first item of the result, the argument is nevertheless accepted and the duplicates are retained.

   Example
     _alsf(`a;1;`b;2;`c;3 4 5)
< `a `b `c
< < 1
  < 2
  < 3 4 5

Change Directory _cd{x}

   Argument and Result
The argument x is a symbol or character vector. The result is a nested vector with either one or two elements.

   Definition
_cd{x} provides the same function as the $cd command. The argument x specifies the new current directory in Unix format. If the change to the new current directory is successful, the result is 1<`ok; otherwise it is a two-element array of the form (`error;"error message"),  for example if there is no such directory. The PWD environment variable is set.

After a file is loaded, the current directory is the same as it was when the Load function or command was initiated: it is automatically restored if it was changed during execution of the lines of the file.

Comma Fix Input _cfi{y;x}

   Arguments and Result
y is a simple character array of rank less than or equal to two, and x is a scalar restricted whole number. The result is a two-element nested array of the form (bool;data), where #bool equals #data if y is a matrix and equals 1 otherwise, and bool is an integer array of rank 0Ӣ1+y, and data is a numeric array of rank 1y with 1data equal to x0.

   Definition
See "Fix Input" (_fi). The definition of _cfi is the same as Fix Input, except that _cfi permits additional representations (and misrepresentations) of numbers. Specifically, commas and parentheses are permitted in number representations, as well as minus signs, low and the A+ high (). In producing the numeric values, commas are ignored no matter where they appear, and high and low minus signs and each set of enclosing parentheses is replaced by a high minus sign. In other words, commas are not treated as "thousands" separators (although they can be playing that role), and all parentheses and - and are treated as signifiers of negative quantities. For each result number, there can be at most one indication that it is negative: '-16', '(-16)', and the like are not accepted. The parentheses that indicate a number is negative must surround the entire number, those that indicate an exponent (in e-notation) is negative just the exponent itself. A left parenthesis may be followed by blanks.  Note: blanks between numbers are not required, although their absence is obviously inadvisable;  in other words, missing blanks are not used as an indication of possible error any more than missing or extraneous commas are'1e-3.5-7.6.5' is translated as 1e-3 0.5 7.6 0.5.

Scalar Comma Fix Input, _scfi, is expected to be used in `in functions, validating user input. _cfi, on the other hand, is designed for larger arrays, such as text files; the assumption is that the data argument is likely to have been machine generated.

   Additional Error Reports
  • Nonce error if x is greater than 1000.
  • Rank error if the rank of y exceeds two.
   Example
     _cfi{'(1,200)';1}
<  1
<  1200.

Debug _dbg{x}

   Argument and Result
This function takes essentially the same arguments as $dbg and returns essentially the results displayed by it.
   Definition
Provides the functionality of $dbg with different syntax: e.g., _dbg{`cxt;(`only;`)} to trace only the root context. Additionally:

(1) _dbg{`display;`beam} returns a slotfiller with information about all files currently beamed in. The six fields of the slot filler contain entries for each file:
`mode - 0, 1, or 2: the file is copy-on-write, read/write, or local write.
`arg - the righthand argument given to .
`fname - the actual file name `arg was turned into.
`addr - the memory address where the file was mapped.
`refcnt - reference count: how many A-objects point to the file.
`bytes - the size of the file in bytes.

(2) _dbg allows for callbacks at the points where a tracing or tracking message would be displayed. Executing _dbg{`cb;(fn;cd)} sets up the callback function with its client data (static). This function must take five arguments: fn{cd;event;arg1;arg2;arg3}. The events are `func, `xfs, `sfs, `load, `beam, and so on; arg1 is the name of the function, file, or whatever involved; the possible values of arg2 are `enter, `exit, `abort, `in, `out, `unmap, `dep, `func, and how many Infs and how many NaNs; and arg3 is usually null, but for beaming in it is the left argument of .

(3) In the event callback for `inv events, the second argument is null for normal invalidation, and equals `cycle if the `inv event is the detection of a cyclic dependency.

Dependency Definition _def{x}

   Argument and Result
The argument x is described in "The Name Argument". The result is a character vector.

   Definition
The result holds the definition of the dependency named in x. See "Dependencies". If x does not name a dependency, the result is Null.

Dependent Object Names _dep{x}

   Argument and Result
The argument x is described in "The Name Argument". The result is a vector of symbols.

   Definition
The result contains the names of all dependencies whose definitions explicitly reference the object named in x. See "Dependencies".

Dynamic Load _dyld{x;y}

   Arguments and Result
The argument x is a character vector and the argument y is a nested vector. The result is a scalar integer.

   Definition
The effect of this system function is to load C functions into A+ so that they can be used like ordinary user functions. (But the fixed number of arguments for a C function being _dylded cannot exceed 8.) The details can be found in "Calling C Subroutines from A+". System error messages are also displayed. If this function is not available, the Dynamic Environment system variable, `dyme, has the value -1. It is safe to _dyld an object already _dylded.

Warning!  A cover function that takes care of the requirements of different architectures should be used rather than a direct invocation of _dyld, except when "hacking".

Warning! If the A+ name used in _dyld (in its right argument) begins with an underscore, then the function will be installed in the root context, no matter what the current context, and it will be listed by $sfs but not by $xfs.

Execution Profile _profile{x}

   Argument and Result
A meaningful argument is a scalar symbol, one of `on `off `report `reset. If the argument does not cause an error - i.e., if it is a one-element array - then the explicit result is the scalar integer 0.

   Definition
This facility is enabled by executing _profile `on and disabled by _profile `off.  When not enabled, it adds absolutely no overhead to primitive function calls.

When it is enabled, executing _profile `report causes a report to be displayed that gives the number of primitive function executions by function, data type, and array size range (number of elements) since the last time _profile `on or _profile `reset was executed.

Exit _exit{x}

   Argument and Result
The argument x is a scalar integer. There is no result.
   Definition
The expression _exit{x} provides a similar function to the system command $off. The argument x is the value returned when the A+ process terminates. Proper values for x are 0 through 255, although any integer is accepted; by convention, the value 0 means success. Since execution of this system function causes the A+ process to exit, it has no meaningful result. See "Invoking A+".

Expunge _ex{x}

   Argument and Result
The argument x is described in "The Name Argument". The result is an integer scalar.

   Definition
_ex provides the same function as $ex. The object named in x is removed and its associated memory is freed. The result is 0 if the removal is successful, and 1 otherwise. In particular, the result is 1 if the object does not exist. It is also 1 if x is an object bound to a display class (see "is" and "free"); i.e., a bound object cannot be expunged.

Expunge Context _excxt{x}

   Argument and Result
The argument x is described in "The Name Argument". The result is an integer scalar.

   Definition
The context named in x must be empty. If it is, _excxt{x} removes it from the active workspace and returns 0. If the context is not empty, _excxt returns 1. The Name List system function with arguments x and `globs can be used to list all objects that would prevent the expunging of a context. See the "Name List" (_nl{y;x}) function. See also "Expunge Context" ($excxt).

The root context cannot be expunged; an attempt to expunge it yields a result of 1. For a nonexistent context, the result is 1.

Fix Input _fi{y;x}

   Arguments and Result
y is a simple character array of rank less than or equal to two, and x is a scalar restricted whole number. The result is a two-element nested array of the form (bool;data), where #bool equals #data if y is a matrix and equals 1 otherwise, and bool is an integer array of rank 0Ӣ1+y, and data is a numeric array of rank 1y with 1data equal to x0.

   Definition
This function creates a numeric array with x0 elements derived from each row of y (or from y itself, if it is a scalar or vector). If a valid vector is created for the row i#y, it becomes i#data, and i#bool is assigned 1. If i#y does not contain the representations of exactly x0 numbers, then i#bool is assigned 0, and i#data is created by using the first x0 valid nonblank sequences in i#y, and using zeros as fillers if there are not enough valid nonblank sequences. (The term nonblank suggests how you should use the function, with blanks as separators, but see the note with which this definition ends.) If there is a nonblank sequence in i#y that does not represent a number, then i#data contains zeros from the point of invalidity on.

Each row of the argument y for which a valid numeric vector can be created must consist of x common representations of numbers. A common representation is one of the three general forms produced by the Default Format monadic primitive function , namely integer, fixed-point, and exponential, except that low and high minuses are accepted indifferently: a low minus is accepted at the beginning of any number and in exponential form a high minus is accepted in the exponent. The expression

     bool/#y
yields the row indices of y for which a valid numeric vector was created. Note: blanks between numbers are not required. 1e-3.5 7.6.5-2 is translated as 1e-3 0.5 7.6 0.5 2.
   Additional Error Reports
  • Nonce error if x is greater than 1000.
  • Rank error if the rank of y exceeds two.
   Examples
     a3 5'1.34 2 3  2x50 '
1.34
2 3
2x50
     a _fi 1
< 1 0 0
<  1.34
   2
   2
     a _fi 2
< 0 1 0
<  1.34 0
   2    3
   2    0

Flatten _flat{x}

   Argument and Result
The argument x is any array whose simple components are of one type, except that symbols and functions may be mixed and nulls are essentially ignored. The result is a simple vector whose length is the total number of elements in all the simple components of x and whose type is that of the first nonempty simple component of x, if x is not empty.

   Definition
The simple components of x are all those simple objects obtainable by repeated selection and disclosure. If they are all empty, the result is an empty vector whose type is that of the nonnull ones; if they are all null, the result is the Null. If x is simple, the result is the ravel of x. Otherwise, the result is the catenation of the ravels of all the simple components of x.

   Additional Error Report
  • A domain error is reported if two simple components of x (including empty arrays whose types are not null) are of different types, except that symbol and function may both be present.
   Examples
    _flat (3 5;23 34 42;0;0;;<<(<1 2),<1 27 8)
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 23 34 42 0 1 2 7 8
    _flat `a,<2 2`b`c`d`e
 `a `b `c `d `e
    (`a,<{+})_flat(`a;+)
1

Format _fmt{y;x}

   Arguments and Result
y is a character vector or scalar, and x is a simple character or numeric array or a nested array. The result is a simple character array of rank less than or equal to 2.
   Definition
The function _fmt transforms character and numeric data in x into a character table according to specification y, which consist of a series of format phrases - see the "Format Phrases" table - separated by commas. For example, the string 'i6,f8.2,f6.1' contains three phrases. Each phrase governs the appearance of a column in the result. The number of phrases need not match the number of items in x, the phrases being repeated cyclically as needed; furthermore, tab and constant specifications are in separate phrases.

Each phrase has a type, indicated by a letter, such as the letters i and f in the above example. A tab or constant field in y does not correspond to anything in x. A tab field merely contributes to the positioning of the next part of the output, and a constant field is reproduced in the output exactly as shown.

Within each format phrase, to the left of the letter that identifies its type, qualifiers or decorators may be inserted. A qualifier provides additional rules, such as "insert commas between triplets of digits" or "leave this field blank for zero". See the "Qualifiers" table. A decorator is a code letter immediately followed by a piece of text enclosed in angle brackets or whatnot; the text is to be attached to the representation of a number, usually to indicate its sign. See the "Decorators" table.

When rounding is required, IEEE rules are used: see "Format". When a number cannot be formatted in the specified manner, its field is filled with asterisks. A field whose format is valid but for a different type from the data is filled with question marks. In particular, symbols in x do not cause an error message, but the field in which a symbol is to be formatted is filled with question marks.

Normally, x is a matrix, and the application of the formatting phrases is straightforward. It can be of other ranks and of any depth, however. In that case, the columns to be formatted are obtained, conceptually, by the following process. When a nested array is encountered, it is ravelled, and its elements are successively disclosed and treated in the manner being described. When a simple array is encountered, it is transformed into a matrix if it is not already one: a scalar becomes a 1 by 1 matrix, an n-element vector becomes an n by 1 matrix, and any other array a is reshaped as ((/1a),1a)a.  This produces a series of matrices, and thus a series of columns, to which the formatting phrases are applied as stated above. Each formatted column can be viewed as a character matrix; the result has the same number of rows as the one with the most rows. Conceptually, blank rows are appended as necessary to each of these matrices to make them the same length as the result, and they are catenated side by side (,@0) to form the result.

In the "Format Phrases" table, j is an optional repetition factor; q represents an optional qualifier and decorators; w is field width; d denotes significant digits or decimal digits; p is displacement; a, e, f, i, t, and x are literals giving phrase types.

Format Phrases
PhraseApplicationDescription
jaw Character Display each character in a field w positions wide. A w greater than 1 produces blanks between adjacent characters.
jqew.d Exponential Display each number in a field w positions wide, with d significant digits. Align E's and decimal points in fields that are not left justified.
jqfw.d Fixed point Display in a field w positions wide, with d decimal digits, including trailing zeros. Leading zeros are shown as blanks unless the z qualifier is used.
jqiwInteger Display in a field w positions wide. Leading zeros are shown as blanks unless the z qualifier is used.
jqg<txt> Picture Format, rounding arguments to integers In txt, 9 and z are "special characters"; the rest are "ordinary." Round each number to an integer, after scaling if k is present. If s is present, modify txt as required. Then format each number with as many digits as there are special characters in txt, so each digit corresponds to a special character. Display a digit corresponding to a 9 unconditionally. If a digit corresponding to a z is in a sequence of leading or trailing zeros, display a blank; otherwise, display the digit. Display ordinary characters as is, with one exception, intended to exclude superfluous thousands separators but include decimal points: any ordinary character surrounded by special characters is displayed as blank if in the display a blank is next to it, unless it is the last ordinary character and is followed by at most two characters. The only valid decorators and qualifiers are m and p (but only the first character of the text of each), s, and k.
jtpAbsolute tab Start the next field at position p+1. If p is too small, the next field may overwrite earlier ones.
jxpRelative tab Start the next field at a position displaced p positions from the end of the preceding field. If p is negative, the next field may overwrite earlier ones.
<text>Constant: for all Insert text in every row of the result.

Qualifiers
QualifierSummaryDescription
bblanks Make the entire field blank when the value is zero.
ccommas Insert commas between successive triplets of digits in integer and (before the decimal point) fixed-point fields.
kescale Scale the result by displaying a value that is 10e times the value.
ljustify Left justify. The default is right justification.
zzeros Display leading zeroes in integer and fixed-point fields.

In the "Decorators" table, text may also be delimited by , , , //, , .

Decorators
DecoratorSummaryDescription
m<text>Negative-Left Insert text to the left of a negative value, not APL high minus. text can be empty. m and n can be used together.
n<text>Negative-Right Insert text to the right of a negative value rather than use APL high minus. text can be empty. m and n can be used together.
o<text>Zero replacement When the data as formatted is zero, replace the result by text. Valid for the e, f, and i phrase types.
p<text>Positive-Left Insert text to the left of a positive value. p and q can be used together.
q<text>Positive-Right Insert text to the right of a positive value. p and q can be used together.
r<text>Background Fill the field cyclically with text where normally blanks would appear, including blanks from a b qualifier. For e, f, and i phrase types.
s<text>Symbol Substitution For each pair of characters in text, the second indicates a character to replace the first. In e, f, and i phrase types, punctuation, sign, and error characters in the result can be replaced; in a g phrase type, any characters in the picture text and error characters in the result can be replaced; no other replacements can be made. For example, s<,..,> in an f phrase type produces periods where commas usually appear and commas where periods usually appear.

   Examples
     'e9.4' _fmt 200 .987
 2.000E 2                Internal blank used to align decimal points and E's.
 9.870E1


     n123456789 0 123456789 123456
     'bcm<->k-2f13.2' _fmt n
 1,234,567.89

-1,234,567.89
     1,234.56


     'm<(> n<)> q< > b c k-2 f16.2' _fmt n
   1,234,567.89                 Blanks are okay in the left argument.

  (1,234,567.89)
       1,234.56


     'i 6' _fmt `wrong `type
??????
??????


     'g<99:99:99>' _fmt 10033sys.ts{}
07:19:30


     'g<zz9>' _fmt .49 .51 99.47
  0
  1
 99


     rfnd 1.23 10.00 12345.67 332 1234.56
     'k2 g<Your refund is: $z,zz9.99>' _fmt rfnd
Your refund is: $    1.23  k2 applied to 1.23 is 123, and the
Your refund is: $   10.00  decimal point in 1.23 is from g.
*************************  12,345.67 is too long; if we had s<*?>
Your refund is: $  332.00  in the left arg, *...* would be ?...?.
Your refund is: $1,234.56  The comma is needed here, and it appears.


     'k2 g<Your refund is: $z,zz9.zz>' _fmt 1.23 10.00
Your refund is: $    1.23
Your refund is: $   10.    The decimal point is the last ordinary
                           character and it has only two characters
                           after it,so it's shown even when the
                           trailing zeros are dropped.

     's<9#z$>g<$$$# units of product z9>' _fmt 73
  73 units of product z9   s allows 9 and z to be included literally
                           in the output.

General Search and Replace _gsr{y;x;r;n}

   Arguments and Result
y, x, r, and n are all simple character arrays, normally vectors, except that r and n can also be null. The result is either a simple character array or an integer vector or matrix.

   Definition
If x, r, or n is not a vector, its ravel is used. There are eight cases, as determined by n and r:
  • If r is Null, then:
    • If n is Null, then the function is the same as String Search (_ss).
    • If n is not Null, then the function is the same as Name Search (_ns), except that n affects the definition of "namelike" as follows:
      • if n is the empty character vector (''), then the definition is exactly the same as for _ns;
      • if n is nonempty and 0#n is not '', then n replaces '._', and '`' are not considered;
      • if n is '',c, then c replaces the alphabetic characters, digits, and '._', and '`' are not considered.

  • if r is not Null (but possibly ''), then:
    • If n is Null, then the function is the same as String Search and Replace (_ssr).
    • If n is not Null, then the function is the same as Name Search and Replace (_nsr), except that n affects the definition of "namelike" as follows:
      • if n is the empty character vector (''), then the definition is exactly the same as for _nsr;
      • if n is nonempty and 0#n is not '', then n replaces '._', and '`' are not considered;
      • if n is '',c, then c replaces the alphabetic characters, digits, and '._', and '`' are not considered.
   Examples
Name delimiters are okay within target and replacement:
     _gsr{'IO1';'IO';'IO';''}
IO1

     _gsr{'IO1,IO2,BIO3';'IO';'IO';''}
IO1,IO2,BIO3

     _gsr{'IO1,IO2,BIO3';'IO';'IO';''}
IO1,IO2,BIO3


     _gsr{'Mississippi is';'is';'IS';''}
Mississippi IS

     _gsr{'Mississippi is';'is';'IS';}
MISsISsippi IS

Get Attribute _get{y;x}

   Argument and Result
The arguments x and y are described in "The Name Argument". The result is an array.

   Definition
If _set{y;(x;z)} (Set Attribute) has been executed previously, then the result of this function is z, the value for attribute x on variable y. Otherwise, the result is Null, including the case when y does not exist.

Get Callback _gcb{y}

   Argument and Result
The argument y is described in "The Name Argument". The result is a two-element nested array.

   Definition
If _scb{y;x} (Set Callback) has been executed previously, then the value of _gcb{y} is the value of x in the last such setting: function scalar, static data. Although the name displayed for the callback function may now have a new reference, 0_gcb{y} gives the definition of the callback function. Otherwise the value is Null.

Get Client Data _gcd{y}

   Argument and Result
The argument y is described in "The Name Argument". The result is an array.

   Definition
This function is like _get (Get Attribute), but for an implicit, unnamed attribute. It gets the value that was set by the last execution of _scd{y} (Set Client Data); if none was set, it returns the Null. It has been superseded by Get Attribute and is retained only for compatibility.

Get Format Symbols _gfmtsym{}

   Result
The result is a vector of symbols.

   Definition
This function lists the symbols acceptable as values for the out attribute. See the "out Attribute Format Samples" table.

Get Preset Callback _gpcb{y}

   Argument and Result
The argument y is described in "The Name Argument". The result is a two-element nested array.

   Definition
If _spcb{y;x} (Set Preset Callback) has been executed previously, then the value of _gpcb{y} is the value of x in the last such setting: function scalar, static data. Although the name displayed for the preset callback function may now have a new reference, you can obtain the definition of the preset callback function by entering 0_gpcb{y}.

Otherwise the value is Null.

Get System Variable _gsv{x}

   Argument
The argument x is a symbol scalar or a quoted string naming a system variable whose value the user is allowed to access. The result is the value of that system variable.

   Definition
The value is the current value of the system variable named in x. A domain error is reported if x does not name a system variable or access to the system variable named in x is forbidden, as it is for `rl. See "System Variables" for descriptions of the system variables and their values and interdictions.

   Additional Error Report
  • A domain error is reported if x does not name a system variable whose value is accessible.

Hash Table Statistics _hashstat{x}

   Argument and Result
The argument is Null or a symbol naming a context. The result is an integer vector.

   Definition
The result gives the number of entries in each bucket of a hash table. If the argument is Null, the statistics are for the symbol table and the result length is 1024. If the argument names a context, the statistics are for the hash table for that context and the result length is 512. The function +/ applied to the result indicates the number of names that have ever been defined, while / gives a rough indication of collisions and hence possibly reduced execution speed (although for this purpose the whole vector should be examined for clumping).

Index of _index_of{y;x}

   Arguments and Result
y and x must be nested vectors of the same length. For each of them, its elements must all be nested vectors of the same length, or all be enclosed scalars. For y, a scalar is treated as a one-element vector. The result is a simple integer vector or scalar whose shape is the same as an element of x.

   Definition
Call y's contained vectors y1...yn and x's contained vectors x1...xn. The result r is an integer vector of length x1; r[i] is the least j for which xk[i] is equal to yk[j] for all k; if there is no such j, then r[i] is y1. This function is a high performance version of the expression (>yɡy)>yɡx.

Regarding the arguments as matrices whose columns are the contained vectors, so that the matrices have the same number of columns, _index_of yields a vector that gives, for each row of the right argument, the index of the first row of the left argument that it matches; for any row of the right argument that does not have a matching row in the left argument, the corresponding element of the result is the number of rows in the left argument, i.e., the common length of its contained vectors.

   Example
Consider a tiny table with three fields: styles, colors, and prices. The style and color fields can be used as key fields with _index_of to find row indices of the table, and these can be used with Pick to give prices:
   Inventory(("Oxford";"Oxford";"Loafer";"Loafer");
*             ("Brown"; "Tan";   "Black"; "Brown" );
*             (128.98;  175.98;  112.50;  112.50))
   (Inventory[0 1]_index_of(<"Oxford";<"Tan"))2Inventory
 175.98
   Additional Error Reports
  • A length error is reported if the arguments are not the same length.
  • A domain error is reported if the contained vectors of an argument are not of the same length.

Is a Slotfiller _issf{x}

   Argument and Result
x is any array. The result is a scalar boolean integer.

   Definition
If x is a slotfiller, the result is 1. Otherwise the result is 0, e.g., if there are repetitions among the items of 0x.

Items of a Mapped File _items{y;x}

   Arguments and Result
The argument y is a one-element numeric array whose element is a restricted whole number, while the argument x is a symbol or character scalar or character vector. The result is a scalar integer.

   Definition
The argument x holds the name of a mapped file (see "Mapped Files"). A mapped file can be processed within A+ as if it were an ordinary array. In particular, it makes sense to speak of the items of a mapped file. If y is -1, the result is the number of currently allocated items. If y is nonnegative and less than the current number of items, then the effect is to truncate the file. Otherwise, if y is nonnegative the effect of this function is to allocate space (if necessary) on the end of the file so that the file can hold y items. See "Work Area" (_wa) regarding units of storage allocation. The result is the current number of items before the new allocation. See "Examples", and note that the "Operation would block" message and the delay caused by trying to avoid that message can occur for _items.

When a file is written out as a mapped file, the file is made only large enough to hold the actual data.

After a file length is changed by _items, any variables that were associated with it (by Map or Map In) must be remapped (by a new application of Map or Map In), because _items has rewritten the file.

Load _load{x}

   Argument and Result
The argument x is a symbol scalar or a character vector. The result is a two-element nested array.

   Definition
The expression _load{x} provides the same function as $load x (Load command). The argument x names the A+ script file to be loaded. The result is (`ok;file) if the file is found and can be read, where file is a character vector giving the fully qualified name of the file that is loaded, i.e., path/filename. After a file is loaded, the current context and the current directory are the same as they were when the Load function was invoked: each is automatically restored if it was changed during execution of the lines of the file.

If the file is not found the result has the form (`error;"error message"). Note that a result (`ok;file does not mean that the file was loaded without error, just that it was found and can be read.

   Example
     _load 's'
< `ok
< /usr/local/lib/s.+

Load and Remove _loadrm{`delete;x}

   Argument and Result
The right argument x is a symbol scalar or a character vector. The result is a two-element nested array.

   Definition
_loadrm{`delete;x} provides the same function as $loadrm x (Load and Remove command).  The argument x holds the name of the file to be loaded. The file is loaded and then deleted (this is a special function for the Emacs environment). The result is the same as that of _load. The left argument must be `delete or 'delete' or an error message is issued.

Locals _locals{x}

   Argument and Result
x is a symbol, function expression, or function scalar representing a defined or external function; it cannot be a primitive or derived function. The result is a three-element nested array.

   Definition
The first element of the result is the name of the function, as a symbol. If x represents a defined function, the second element is a vector of the names of the arguments to the function and the third element lists its local variables. If x represents an external function, the second element is an integer vector of its argument types (see table in "Calling C Subroutines from A+"), and the third element is null.

Name _name{x}

   Argument and Result
The argument x is a function scalar. The result is a scalar symbol.

   Definition
x is of the form <{fn},  where fn is a defined, primitive, or system function. For a defined function, the only case that really makes sense, the result holds the fully qualified name of fn, i.e., the name of the current context, which will be empty for the root context, followed by a dot as separator, followed by fn. If fn is a system or primitive function, the result is just fn preceded by a backquote.

The expression _name<{&},  either inside the definition of a function fn or entered when a defined function fn is suspended, will produce the fully qualified name of fn.

If in context cx you enter, literally, _name<{f},  you will get either the uninteresting result `cx.f or a value error: the only unqualified name you can use in the argument is one defined in the current context. A more useful case is when you have an expression that yields a function that may or may not be in the current context, an expression that uses _gcb or of or the like.

   Additional Error Report
  • A nonce error report is issued if x is a symbol.
   Example
     $cx sys
     _name <{import}
 `sys.import

Name Class _nc{y;x}

   Arguments and Result
Both arguments and the result are symbol scalars; y can also be Null.

   Definition
If the symbol x holds an unqualified user name, i.e., a name without an explicit reference to its context, and if the symbol y holds a context name, the result is the symbol form of the name class of the user name x, in the context y (see the "Name Classes" table). If x holds a fully qualified name of the form cxt.nm,  the result refers to nm in the context cxt, and the value of y is ignored.

The root context is denoted by the empty symbol (`). The current context is denoted by Null: if _nc is referenced in the form _nc{;x}, the current context is assumed.

Name Classes
Name ClassDescription
`varsUser variables
`fnsDefined functions
`xfsExternal functions
`globsGlobal objects
`depsDependencies
`opsDefined operators
`nullNot in use, not a valid name, or not one of the above

Name List _nl{y;x}

   Arguments and Result
Both y and x are symbols, except that x can be and y can be Null. The result is a vector of symbols.
   Definition
The result is a vector of symbols holding the names of objects of class x (see the "Name Classes" table) in the context identified by y. The empty symbol (`) denotes the root context, and Null denotes the current context. Dependencies are listed only when they have saved values, which need not be valid. See the table "Name List Expressions vs. The Kind of Objects in the Result" for examples of these and other uses of Name List. For the arguments `apl `ascii, and `uni, the order of the symbols is consistent between them (the symbols in the same positions representing the same primitive) within the same version of A+, but the order may change from version to version, and new functions may cause insertion of symbols; any such changes will not be considered upwardly incompatible.
Name List Expressions vs. The Kind of Objects in the Result
Expression (see Note below) Kind of Object Named in the Result
_nl{`ctx;`vars}Variables in the context `ctx
_nl{`ctx;`fns}Functions in the context `ctx
_nl{`ctx;`deps}Dependencies in the context `ctx
_nl{`ctx;`ops}Operators in the context `ctx
_nl{`ctx;`globs} Global objects in the context `ctx
_nl{`ctx;`xfs} External functions in the context `ctx
_nl{`;`cxs}Contexts
_nl{`;`svs}System variables
_nl{`;`sfs}System functions
_nl{`;`cmds}System commands
_nl{`;`apl}All keywords and primitive symbols in APL mode
_nl{`;`ascii}All keywords and primitive symbols in ASCII mode
_nl{`;`uni}All keywords and primitive symbols in UNI mode
_nl{`;`circle} or
_nl{;}
List of symbolic left arguments for Circle function. (Although ` _nl `circle works fine, the parser is confused by ` _nl .  Left arg can be null, with correct result in any current context.)
_nl{`;`errors}Names (as symbols) of errors defined in A+
_nl{`;`nl}Valid right arguments to _nl
_nl{`;`wa}Valid symbol arguments to _wa

Note:

Name Search _ns{y;x}

   Arguments and Result
Both y and x are character arrays, normally vectors. The result is an integer vector or matrix.

   Definition
If x is not a vector, its ravel is used. If y is a vector, the result is a vector of indices of nonoverlapping namelike occurrences of the vector x in y. Each index marks the beginning of an occurrence in y. An empty result signifies that there are no occurrences. A namelike occurrence is one that satisfies the following restrictions:

  • not part of a comment;
  • not in quotes;
  • not immediately preceded by a backquote or a high minus (`) or preceded or followed by an alphabetic character (in upper or lower case), a digit, or a dot or an underscore (._).
If y is a matrix or higher-rank array, then an occurrence is required to be entirely on one line; occurrences spanning rows are not accepted. (An unbalanced quotation mark, perhaps intended as an apostrophe, will block name recognition in later lines, however.) The result is an r by n matrix, where r is the rank of y and n is the number of occurrences found. A column of the result gives the indices of the corresponding occurrence, with the highest-order index at the top and the column index at the bottom. Thus 0# applied to the result gives a list of the items in which occurrences were found.
   Examples
      _ns{'This is ''is''';'is'}
 5
     4 3'abc abc  abc'
abc
 ab
c
abc
     _ns{4 3'abc abc  abc';'abc'}
 0 3
 0 0

Name Search and Replace _nsr{y;x;r}

   Arguments and Result
y, x, r, and the result are all character arrays, normally vectors.

   Definition
If x or r is not a vector, its ravel is used. Occurrences of x are sought in exactly the same way as they are in Name Search, _ns{y;x}, but in two different objects, depending upon y, x, and r:
  • If y is a vector or the ravels of x and r are the same length, then the result is y with r in place of every occurrence of x found in y itself.

  • Otherwise, the result is the ravel of y with r in place of every occurrence of x found in the ravel of y; if no occurrences were found, the result is simply the ravel of y.
See also the
examples in "String Search and Replace".
   Example
     _nsr{'This is ''is''';'is';'are'}
This are 'is'

NaN Find _nanfind{x}

   Argument and Result
The argument is any array. The result is an integer vector.

   Definition
If the type of x is floating point (so x is simple), then the result is a vector consisting of the indices of those elements of the ravel of x that are NaN's. Otherwise the result is 0.

NaN's are used in some systems to represent indeterminate numbers. They are like Infs, but more general. This function can be used to locate NaN's occurring in loaded files or resulting from dynamically loaded code. The nan subcommand of the $dbg command can be used to screen files being beamed in for NaN's. (NaN's are not generated by A+ primitive functions.)

Permissive Indexing _index{i;x;d}

   Arguments and Result
i is a simple array of restricted whole numbers, x is any array, and d conforms to the items of x, i.e., its general type is the same as theirs, and either it is a scalar or its shape is the same as theirs.

   Definition
This function is like i#x, with three exceptions: (1) Only a simple i is allowed, so only items of x are chosen. (2) If i is Null, the result is no items of x, not all items of x. (3) If an element of i is out of range, no index error is reported; instead, d is placed in the corresponding position in the result, replicated if necessary so that it matches the items of x.
   Examples
     _index{2 19 14 1;
        ('Mar 06';'Jul 18';'May 15';'Nov 26');<'n.a.'}
< May 15
< n.a.
< n.a.
< Jul 18

     _index{10 11;11 4;1}
 40 41 42 43
 1 1 1 1

Remove Dependency Definition _undef{name}

   Argument and Result
The argument name is described in "The Name Argument". The result is a boolean integer.

   Definition
The function removes the dependency definition for name, if any, and leaves everything else, such as value and callback function, unchanged. After this function is executed, name is an ordinary, not a dependent, variable. It may not have a value, since Remove Dependency Definition does not cause an evaluation. You may sometimes want to force an evaluation before invoking this function. The result is 0 if a definition was removed, and 1 otherwise - name does not name a dependency. Cf. "Remove Dependency Definition" ($undef).

Scalar Comma Fix Input _scfi{s}

   Argument and Result
The argument s is a character array, normally a vector, and the result is a numeric scalar.

   Definition
This function is like Comma Fix Input (_cfi), except that:  it handles only a single number (so there must be no internal blanks);  it has a simple scalar result;  it has no boolean part to its result, an invalidity being reported as an error instead;  and it treats commas properly, requiring that they be internal to the integer portion of the number, properly placed every three digits leftward from the decimal point (or right end, if there is no decimal point), and that there be either no commas or the full set.  I.e., if s is a valid argument for _scfi, _scfi{s} is exactly equivalent to ''1_cfi{s;1}.

   Additional Error Report
  • A domain error is reported if the first item of _cfi{s;1} would be zero.

Scalar Fix Input _sfi{s}

   Argument and Result
The argument s is a character array, normally a vector, and the result is a numeric scalar.

   Definition
This function is like Fix Input (_fi), except that it handles only a single number, has a scalar result, and has no boolean part to its result, an invalidity being reported as an error instead. I.e., if s is a valid argument, _sfi{s} is exactly equivalent to ''1_fi{s;1}.

   Additional Error Report
  • A domain error is reported if the first item of _fi{s;1} would be zero.

Screen Format _sfmt{f;d}

   Arguments and Result
The left argument is a format specification, either one shown in the "out Attribute Format Samples" table, or one acceptable as a left argument for _fmt (Format), or (Format). The right argument is a simple numeric scalar. The result is a character vector.

   Definition
If the left argument is a symbol, then it and the result are as described in the "out Attribute Format Samples" table. If the left argument is character, then it and the result are as described for _fmt (Format). Otherwise, the left argument is numeric and the result is as described for (Format).

Formats containing y2 are restricted to the years 1950 through 2049, errors in dates return 0's except that an erroneous `y2 is set to "**", and the length of the result returned for a bad date is the same as for a good date.

Warning! If the right argument is numeric but nonscalar, only the first element is used.

Set Attribute _set{y;x}

   Argument and Result
The argument x is a nested vector (w;z),  where z is any array. Both w and the argument y are described in "The Name Argument". The result is a scalar integer.

   Definition
Sets the value for attribute w on global variable y to the value z. If z is Null the attribute is removed. The result is 1 if the value was not previously set or the attribute was removed or y does not exist, and 0 otherwise. The attribute w, which is commonly a name, can be whatever you want; it simply allows you to associate data with y in an easily retrievable way.

Set Callback _scb{y;x}

   Arguments and Result
The argument y is described in "The Name Argument". The argument x is a two-element nested array. The result is Null.

   Definition
The argument x is a pair of the form (f;s),  where s is any array and f is a function expression. Thus the first element of x is a function scalar and not the name of a function, so this assignment is unaffected by any later changes to the meaning of the name of the function f. Executing _scb{y;x} causes the "callback" function f to be called each time the value of the global variable (or, indeed, function) named in y is modified through certain assignments, after the modification has been made. The array s is known as the static data, and is passed as a parameter to f on every call that results from an assignment to the global variable named in y.

If s is omitted the static data is Null. If f is omitted then any callback previously established for the global variable named in y is removed.

The general form of the syntax of f is
f{s;d;i;p;c;v} where

s is the static data
d is the new value
i is an index, nested if for y and simple if for ,y
p is a path
c is a symbol naming the context in which y is defined, and
v is `y
such that

  (i#pc%v)d  if i is nested
  (i#,pc%v)d if i is simple
     or
  (pc%v)[,]d if i is out of range for c%v before this assignment

describes the change that caused f to be called.

A callback function can have any number of arguments from to zero to six, but the meaning of the arguments is always as above, reading from the left. For example, if it has three arguments then the first is static data, the second is new data, and the third is an index. Any explicit result of a callback function is ignored by A+.

Dependencies are global variables, and callbacks can be set on them. However, such a callback function is called only when the dependent variable is explicitly specified using ordinary or selective assignment, and in the latter case only as described above. A callback does not occur when a dependency is marked for evaluation, or when an evaluation occurs (although a preset callback is called in this latter case). Furthermore, during a callback on a dependency, the dependency's value is not marked invalid by any change the function makes in a variable on which it depends. (Cf. "Set Preset Callback".)

Only one callback can be set on a global variable. For example, if _scb{`a;(fn;)} is executed, and then _scb{`a;(gn;)},  the first callback function fn is removed when the second one gn is established. Since it is the callback function itself, and not a name, that is given to _scb, if you redefine the function and want the new definition to apply to the callback, you must call _scb again to set it.

For examples and more detail, see "Callback Functions".

Set Client Data _scd{y;x}

   Arguments and Result
The argument x is any array. The argument y is described in "The Name Argument". The result is an array.

   Definition
This function is like _set (Set Attribute), except that there is no explicit, named attribute and the result is the previous client data, i.e., what the result of _gcd{y}, Get Client Data, would be if it were executed immediately before _scd{y}. This function has been superseded by Set Attribute and is retained only for compatibility.

Set Preset Callback _spcb{y;x}

   Arguments and Result
The argument y is described in "The Name Argument". The argument x is a two-element nested array, as described for Set Callback. The result is Null.

   Definition
The differences between callback functions established by _spcb and _scb are:
  • preset callback functions on dependencies are called when either a dependent variable is assigned a value or a dependency is evaluated (after the evaluation of the dependency definition is completed), whereas callback functions are called only when the dependent variable is assigned a value;

  • _spcb{y;x} causes the callback function specified in x to be called just before the value of the global variable (or, indeed, function) named in y is changed, but _scb is called just after;

  • preset callback functions are used to validate new values for global variables and they therefore return meaningful results (namely, the validated data), whereas callback functions do not;

  • for the Append form of Selective Assignment, the indices i are not valid for _spcb, since the appending has not yet been done, but they are valid for _scb.
Since preset callbacks are used for validating new values of global variables, the following rules should be followed in their definitions:

  • if a new value is valid, set the result of the preset callback function to that value;
  • if a new value is invalid, signal an error (see "Signal"); the value of the global variable will remain unchanged.
For examples and more detail, see "Callback Functions".

Set System Variable _ssv{y;x}

   Arguments and Result
The argument y is a symbol scalar or a quoted string. The result is always Null.

   Definition
This function sets the value of the system variable named in y to the value of the right argument x. A domain error is reported or a correction made (e.g., 100x for `pp) if the right argument is not a valid value of the system variable named in y or if that system variable is not allowed to be set. See "System Variables" for descriptions of the various system variables and their values and interdictions.

   Additional Error Report
  • A domain error is reported if y does not name a system variable that can be set or x is an impermissible setting for y. Although $Df 2 is a no-op, _ssv{`Df;2} is a domain error.

Stack Information _doErrorStack{}

Returns the stack information for the last error that occurred under a Protected Execute while `doErrorStack was enabled (1).

This facility should enable developers to mail error information without having to exit the application.

String Search _ss{y;x}

   Arguments and Result
Both y and x are character arrays, normally vectors. The result is an integer vector or matrix.

   Definition
If x is not a vector, its ravel is used. If y is a vector, the result is a vector of indices of nonoverlapping occurrences of x in y. Each index marks the beginning of an occurrence.

If y is a matrix or higher-rank array, then an occurrence is required to be entirely on one line; occurrences spanning rows are not accepted. The result is an r by n matrix, where r is the rank of y and n is the number of occurrences found. A column of the result gives the indices of the corresponding occurrence, with the highest-order index at the top and the column index at the bottom. Applying 0# to the result gives the indices of the items in which occurrences were found. See also the examples for Name Search.

   Examples
     _ss{'Mississippi';'is'}
 1 4
     _ss{'Mississippi';'issi'}
 1      The instances must be nonoverlapping.

String Search and Replace _ssr{y;x;r}

   Arguments and Result
y, x, r and the result are all character arrays, normally vectors.
   Definition
If x or r is not a vector, its ravel is used. Occurrences of x are sought in exactly the same way as they are in String Search, _ss{y;x}, but in two different objects, depending upon y, x, and r:
  • If y is a vector or the ravels of x and r are the same length, then the result is y with r in place of every occurrence of x found in y itself.

  • Otherwise, the result is the ravel of y with r in place of every occurrence of x found in the ravel of y; if no occurrences were found, the result is simply the ravel of y.
Examples
     _ssr{'Mississippi';'is';'IS'}
MISsISsippi
     3 6'abc abc defgh abcd'
abc ab
c defg
h abcd
     _ssr{3 6'abc abc defgh abcd';'abc';'xyz'}
xyz ab
c defg
h xyzd
     _ssr{3 6'abc abc defgh abcd';'abc';'wxyz'}
wxyz wxyz defgh wxyzd

Valence _valence{x}

   Argument and Result
The argument x is either the name of a defined or external function, as described in "The Name Argument", or a function expression or scalar holding a defined, external, or system function. The result is an integer scalar.

   Definition
The result is the number of arguments taken by the function specified in the argument x.

   Additional Error Reports
  • A nonce error is reported if x is a function scalar that is a primitive function;
  • a domain error is reported if x is a symbol naming a system function, but not if x is a function scalar that is a system function.

Work Area _wa{x}

   Argument and Result
The argument x is a symbol or integer scalar.

   Definition
The expression _wa n,  for n greater than or equal to 1, increases the workspace size by approximately n megabytes; see the first table entry regarding IBM machines. Other values of the argument x will produce information about the amount of available storage in the workspace, as well as the amount and distribution of storage in use, and in one case cause the areas of unused storage to be coalesced. See the "_wa Arguments and Results" table.

Memory allocation for A+ objects is based on an increasing set of integers called fragment sizes. The storage area for a particular object will be a fragment of sufficiently large fragment size to hold the object, but perhaps with extra, unused room. (It always uses a fragment of smallest possible size. Fragments can be split off larger ones as needed.) As noted in "_wa Arguments and Results", _wa can be employed to find out how many fragments of each size are currently in use.

_wa Arguments and Results
ArgumentEffect and Result
n,  for n1 The effect is to increase the workspace size, `size,  by n megabytes (a megabyte is 220 bytes). The effect of giving a noninteger argument is undefined. The result is 0 if successful.

On IBM machines, the workspace size cannot be increased when a mapped file exists for an A+ process, because A+ requires that the entire workspace be contiguous and AIX requires that all space be taken from one end of the address space; thus, the mapped file blocks enlargement of the workspace.

`fragsizes The result is a vector of integers of fragment sizes, in words. This vector is fixed for every A+ session, but may vary with the release number and the machine on which you are running.
`fragcounts or 0 The result is a vector of integers giving the number of free, or available, storage fragments of each fragment size. (Note that these numbers are computed after the argument to _wa is allocated.)
`coalesce or 1 The effect is to combine contiguous free fragments into larger fragments. The result is a vector of the new fragment counts. If there is no writable /var/atmp (see the -m invocation flag, below) nothing is done and the result is all zeros.
`size The result is the workspace size, i.e., its current maximum permitted size, in bytes. It can be increased by _wa n, or by a naked left arrow (, indicating resumption) with a pending wsfull error.
`avail The result is the amount of available storage in the workspace. (Note that the amount is computed after the argument to _wa is allocated.) It is the difference between the workspace size, `size, and the space actually being used, and is almost equal to the result of the command $wa. Usually, some of `avail is in `atmp and some is not.
`atmp The result is the current total size of the files used to hold the workspace. It includes both space that is in use and space that is available. See `avail.
$df /var/atmp tells more about available atmp.
`info The result is a combination of the above information in the following arrangement:
(`size `atmp `avail; `fragcounts; `fragsizes).

A+ data objects (including function arrays but not functions) are stored as 56-byte headers and bodies of varying size. If the number of elements of an object is n, then its body will take, in bytes, depending on its type:
`char     n+1
`int      4n1
`float    8n1
`sym      4n1
`box      4n1
plus the storage for each of its elements
`func     4n1
`null     
usually no space, but sometimes the same formula as `box.

A+ looks for its atmp space in /var/atmp/*. If several A+ processes are running on the same machine, they will compete for the same atmp space. The atmp space is used as both workspace area and mapped file area, so if large mapped files are used it may even be necessary to reduce the workspace size to get an application to work. Usually, it is best to keep the workspace about twice as large as the amount of memory you expect to use; 256Meg is the recommended safe limit, beyond which you may run out of address space.

Modifying Memory Mapping Characteristics

The memory mapping characteristics of atmp can be modified by means of the invocation flag -m with the value ws_atmp_shared, ws_atmp_noreserve, ws_atmp_private, ws_atmp_heap, or ws_malloc. The same settings can be given to APLUS_ATMP_MODEL, an environment variable, with the same effect.

ws_atmp_shared, ws_atmp_noreserve, and ws_atmp_private control the flags used for mmap and atmp (see the man page for mmap); ws_atmp_noreserve is implemented as MAP_AUTORESRV on sgi. ws_atmp_heap will put atmp in memory. ws_malloc will just use malloc and free as needed.  If there is no /var/atmp then the default will be ws_malloc. When /var/atmp does exist, the default is ws_atmp_shared except on UltraSparc and all Solaris machines, which have a default of ws_atmp_noreserve.  Alternatively and temporarily, the memory mapping characteristics of atmp can be modified by setting the environment variable APLUS_ATMP.  This variable is intended for use by system administrators to configure new architectures.  The possible settings for APLUS_ATMP are: MAP_PRIVATE, MAP_NORESERVE, and FROM_HEAP.

The Heap

There is another area of storage in A+, aside from atmp space, namely, the heap. The heap is used for A+ internal memory needs, either temporary or permanent, such as in creating contexts or global names, parsing nested arrays, and buffering outgoing messages in adap. Subsequent uses of a symbol or name within a process do not use more memory, because expunging a name does not free the heap space used for it.

A long-running A+ process can eventually use up its heap, although the heap is pretty large and A+'s demands on it are fairly small. A brealloc() error can then occur. The obvious way of controlling this potential problem is to not use a tremendous number of names. The heap size can be changed at A+ invocation by using the -h flag;  caution: do not use this flag unless it is specifically needed to solve a memory-related problem. The size can be measured using pmon, remotely, from an XTerm, but not from within an A+ process, since pmon is interactive, so $pmon cannot be used.

Another way to monitor heap space use is to run in an XTerm, while A+ is running,
while [ true ]; do pstat -s; sleep 1; done

Handling of Symbols

Memory allocation and hashing algorithms are intended to provide high performance even for applications using 10,000 or more symbols. Symbols are kept in the atmp area rather than in the heap, preventing the bus errors that could occur when an application used hundreds of thousands of symbols, exhausting the heap. Such an application may need a relatively large _wa allocation.

The address space for an A+ process is fixed at two gigabytes. Four things use address space:

  • the actual code of the A+ process, and dynamically loaded routines;
  • dynamic memory (heap space);
  • atmp space;
  • mapped files.

See also "Memory Allocation - What to Do and What Not to Do" and "Memory Allocation in A+ - a Closer Look" in "Calling C Subroutines from A+".


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_15.html0000444000265000001440000017403710737166015013655 A+ Reference: System Commands

System Commands


All system commands begin with a dollar sign ($) as the first nonblank character on the line. They cannot appear directly in defined functions or expression groups, but can appear in character vectors executed by Execute, but not by Value, with $ the first nonblank character. The result of Execute for a command is Null. The result is not the text that appears as a result of executing the system command directly in an A+ session.

If A+ recognizes a command as clearly erroneous, it gives incorrect as a response. It simply ignores (correct) A+ commands that have missing or wrong arguments, like $rl or $rl 'a'.

Any command that is not recognized by A+ as either one of those described below or clearly erroneous is assumed to be a Unix command and is executed in a child process forked from the A+ process, and responded to (including error responses) by that process. A+ invokes sh by default, not ksh, csh, or whatever; in particular, this means that ~ in path names is not interpreted as a "magic" character. If you need this or some other property of one of these shells, invoke that shell explicitly in the command, as in
$ksh -c "ls ~user/dirnm/*.+".
(The quotes in the example are necessary: ksh -c takes only one argument.)

Warning: The result of a Unix command depends upon the particular system under which it is executed - $unixcommand is highly nonportable. If you need advice about the use of such a command, you should usually ask someone who knows a lot about Unix, and not necessarily someone who knows a lot about A+.

Classification of System Commands

Although they are listed alphabetically by English name in this chapter, for convenient reference, the A+ system commands can be grouped, among many other ways, in seven categories, dealing with:


Definitions of System Commands

Callback Flag $Sf [n]

This flag is a debugging aid that enables (1) or disables (0) callback functions. Normally, with callbacks enabled  ($Sf 1),  a callback function is invoked when an associated variable changes. With callbacks disabled  ($Sf 0),  no callback function is invoked. The default setting is 1. $Sf alone displays the current setting. This flag can be used to inhibit callbacks while clearing suspensions: set it to 0, clear, set it back to 1, and continue execution. Note that the screen management system uses callback functions, as may any A+ utility, and therefore setting this flag to 0 can have unpredictable effects. Caution is advised when using $Sf.

Change Directory $cd [path]

If path is present, it must be a valid Unix directory path, and the effect of the command is to change the current directory to the one named in path. If path is not present, the user's home directory becomes the current directory. After a file is loaded, the current directory is the same as it was when the Load function or command was issued: it is automatically restored if it was changed during execution of the lines of the file. The PWD environment variable is set. See "Change Directory" (_cd).

Commands $cmds

Displays a list of the system command names. See "Name List" (_nl).

Context $cx [name]

If name is present, it must be a valid context name (see "User Names"), and the effect of the command is to make that context the current context. If the context does not exist it will be created. The root context is specified by a dot (.). If name is not present, the name of the current context is displayed. If the context is changed when a function is suspended, resumption of execution will automatically change the context back. After a file is loaded, the current context is the same as it was when the Load function or command was initiated: it is automatically restored if it was changed during execution of the lines of the file.

Contexts $cxs

Displays a list of all the context names in the active workspace. See "Name List" (_nl) and "Expunge Context" ($excxt).

Debugging State $dbg [subcommand list]

Several subcommands (with any parameters for them) can be given as arguments to $dbg, separated by blanks, as in
     $dbg +load +beam +dyld +pack
and
     $dbg indent 4 char >.
If no argument is given, the current settings are displayed. A listing of the various arguments together with their meanings is displayed in response to the subcommand help.

There are some additional messages. For example, when load tracking is on and a load command cites a nonexistent file, a debugging message mentioning the failed load command is issued.

The two subcommands char x and indent n are used to control the formatting of debugging messages. For example, if x is | and n is 2, a display when tracing is on might look like this:

    .f entered
    | .g entered
    | | .h entered
    | | .h exited
    | .g exited
    .f exited
whereas if x were > and n were 4, the third line, for instance, would look like this:
    >   >   .h entered
The
table below shows all the subcommands. The arguments that are not entered literally as shown are b, which is 0 or 1 (if b, +, and - are omitted, the command acts as a toggle); c, which is a context name or names; x, which is a character; and n, which is a nonnegative integer. You need enter only initial segments of the literal parts of the arguments just long enough to make them unambiguous.

$dbg Subcommands (Arguments)
SubcommandSignificance
(none)Display all current settings.
1 or 0 Turn all tracing and tracking on (1) or off (0).
beam b
+beam
-beam
Turn beam tracking (mapping and unmapping) on (+beam or b=1) or off (-beam or b=0), or toggle (just beam).
bitwise b
+bitwise
-bitwise
Turn checking for nonboolean And and Or arguments on (+bitwise or b=1) or off (-bitwise or b=0), or toggle (just bitwise). The default is to check.
char x Set character to be used in dbg messages (see example above).
+cxt c
-cxt c
Limit tracing to the contexts listed in c (+) or all but the contexts listed in c (-). If c is absent, trace all contexts (whether + or -). Message indentation always corresponds to execution depth, regardless of omissions.
def b
+def
-def
Turn tracking of function and dependency definition on (+def or b=1) or off (-def or b=0), or toggle (just def).
dep b
+dep
-dep
Turn dependency evaluation tracing on (+dep or b=1) or off (-dep or b=0), or toggle state (just dep).
disp map Display the limit on the number of concurrently mapped files; a list of files currently mapped, with reference counts; and some internal index information.
display beam Display all current mappings of files.
display flags Display the value of several key system variables; highlight nondefault values.
do b
+do
-do
Turn Monadic-Do tracing on (+do or b=1) or off (-do or b=0), or toggle state (just do).
dyld b
+dyld
-dyld
Turn dynamic load tracking on (+dyld or b=1) or off (-dyld or b=0), or toggle state (just dyld).
fmt b
+fmt
-fmt
Turn messages from _fmt on (+fmt or b=1) or off (-fmt or b=0), or toggle state (just fmt). The default is no message display.
func b
+func
-func
Turn defined function and operator tracing on (+func or b=1) or off (-func or b=0), or toggle state (just func).
helpDisplay all permissible settings and their significance.
indent n Set dbg message indentation per level of execution depth.
inv b
+inv
-inv
Turn on (+inv or b=1) or off (-inv or b=0) or toggle (just inv) the tracing of dependency invalidations and the triggering of a callback (if a callback function is defined, using _dbg). Messages are indented to make tracing of dependency trees easier. A warning is issued when inv is on and a cyclic dependency is encountered during invalidation.
levels n Maximum (execution) depth of tracing. 0: off. No n: unlimited.
load b
+load
-load
Turn load tracking on (+load or b=1) - showing full path names - or off (-load or b=0), or toggle state (just load).
nan b
+nan
-nan
Turn on (+nan or b=1) or off (-nan or b=0) or toggle (just nan) the checking of files as they are beamed in for NaN and Inf. If checking is on and such an undesirable is found in a file being beamed in, an error message is sent to stdout. Cf. _nanfind.
pack b
+pack
-pack
Turn packfile command tracing on (+pcb or b=1) or off (-pcb or b=0), or toggle state (just pcb).
pcb b
+pcb
-pcb
Turn preset-callback tracing on (+pcb or b=1) or off (-pcb or b=0), or toggle state (just pcb).
_prcb b
+_prcb
-_prcb
Turn prereference-callback tracing on (+_prcb or b=1) or off (-_prcb or b=0), or toggle state (just _prcb).
print b
+print
-print
Display tracing messages (+print or b=1) or not (-print or b=0), or toggle (just print). The default is to display them. Designed to be used in conjunction with callbacks, which are set using _dbg{`cb;(fn;cd)}.
_rcb b
+_rcb
-_rcb
Turn reference-callback tracing on (+_rcb or b=1) or off (-_rcb or b=0), or toggle state (just _rcb).
scb b
+scb
-scb
Turn set-callback tracing on (+scb or b=1) or off (-scb or b=0), or toggle state (just scb).
sfs b
+sfs
-sfs
Turn system function tracing on (+sfs or b=1) or off (-sfs or b=0), or toggle state (just sfs).
tkerr b
+tkerr
-tkerr
Turn reporting of otherwise silent execution errors that do not cause execution suspension on (+tkerr or b=1) or off (-tkerr or b=0), or toggle state (just tkerr). ("tk" is for toolkit.) The default is 0.
wa b Turn tracing of $wa on or off, or toggle. Will also trace _wa and workspace size changes by soon.
xeq b
+xeq
-xeq
Turn Execute (Protected or not) tracing on (+xeq or b=1) or off (-xeq or b=0), or toggle state (just xeq).
xfs b
+xfs
-xfs
Turn external function tracing on (+xfs or b=1) or off (-xfs or b=0), or toggle state (just xfs).


     Examples:
      2 1 2 ^ 1 1 0     $dbg +bitwise is the default.
     Warning: found 2 nonbooleans in left argument of ^.
  1 1 0

      2 1 2 ^ 7 1 8
     Warning: found 4 nonbooleans in both arguments of ^.
  1 1 1

     f{}:c.g{}
     c.g{}:'c.g'
     $dbg func 1      Trace function calls.
     f{}
    .f entered
      c.g entered
      c.g exited
    .f exited
c.g
     $dbg levels 1    Limit the levels traced to 1.
     f{}
    .f entered
    .f exited
c.g
     $dbg levels      Trace all levels.
     $dbg +cxt c      Limit tracing to the c context.
     f{}
      c.g entered    Note the indentation, which indicates the level.
      c.g exited
c.g

     $dbg 0    Reset debugging; default for fmt is 1: issue _fmt msgs.
     do line'i3,7c1'_fmt(n185;1 7' spread')
 _fmt: Missing edit specification
 _fmt: i3,7c1
 _fmt:     ^^
<  9
< domain
     $dbg -fmt        Turn off messages from _fmt.
     do line'i3,7c1'_fmt(n;1 7' spread')
<  9
< domain

Dependencies $deps [name]

If name is present it must be a valid context name (see "User Names"), and the effect of the command is to display a list of dependency names in that context. If name is not present the names of dependencies in the current context are displayed. See "Name List" with `deps right argument.

Dependency Definition $def name

This command displays the definition of the dependency named in name. See "Dependency Definition" (_def), and "Dependencies".

Dependency Flag $Df [n]

This command enables (1) or disables (0) dependencies, by setting `Df. Normally, with dependencies enabled ($Df 1), dependency definitions are evaluated when dependencies are referenced, and their definitions are marked for evaluation. With dependencies disabled ($Df 0) dependency definitions are never evaluated, which has the effect that dependencies act like normal global variables. However, they are still marked for evaluation and will be evaluated if so marked when referenced after $Df is reset to 1. Display mode ($Df 2) no longer exists, its function having been incorporated in $dbg; the argument 2 is a no-op. If no parameter is given to $Df its current value is displayed. The default setting is 1.

Warning! Disabling dependencies can cause confusion. Be careful.

Dependent Object Names $dep name

This command displays the names of all dependencies whose definitions explicitly reference name. See "Dependent Object Names" (_dep).

Execution Suspension Flag $Ef [n]

Execution suspensions due to A+ errors occur normally when this flag is set to its default value 1. When it is set to 0, these suspensions do not occur: an A+ error causes abandonment of execution instead, without any message. If no argument is given to $Ef, its current value is displayed. Note that errors include signals generated by the primitive function Signal. See also the in attribute. This definition is experimental and may be refined in the future, or replaced by a different mechanism.

Expunge $ex names

This command removes the global objects whose names are listed in names from the active workspace. These objects can be variables, functions, dependencies, and operators. Global variables and dependencies bound to display classes will not be removed (see the functions is and free); in these cases the command will display the message name: is bound.  See "Expunge" (_ex).

Expunge Context $excxt context

This command removes the context whose name is listed in context from the active workspace. The context must be empty, else the command displays the message context: not empty.  The Global Objects command $globs name can be used to list all objects that would prevent the expunging of a context. See "Expunge Context" (_excxt).

The root context cannot be expunged. Any attempt to expunge it or a nonexistent context is ignored.

External Functions $xfs [name]

The command lists external compiled C program names in the current context if name is not present, else in the context name.

Functions $fns [name]

If name is present, it must be a valid context name (see "User Names"), and the effect of the command is to display a list of the user function names in that context. If name is not present, the names of functions in the current context are displayed. See "Name List" (_nl).

Global Objects $globs [context]

This command lists the names of all global objects of any kind that appear in the given context. The list of names includes names for which attributes have been set (using _set), even if they have not been given values and consequently are not listed by $vars. If context is omitted, the current context is assumed. This command is especially useful in connection with the Expunge Context command, $excxt. See "Name List" (_nl).

Input Mode $mode [apl | ascii | uni]

If apl or ascii or uni is present, the keyboard mode is set to the one specified. Otherwise, the current mode is displayed. APL mode means that the special graphic characters that denote A+ primitive functions are to be entered, using the APL union keyboard. ASCII mode means that instead of each of these special graphics a specified sequence of one or more standard ASCII characters is to be entered; see the table below. There is also a mode like ASCII but more consistent and presumably easier to read and remember, namely UNI; see the second table below (which, unlike the first table, includes characters that are the same as for APL mode). It is important to understand that the latter two modes involve only simple token substitution.

Session output is in the specified mode, but expressions being executed, in functions or directly from the session input, are never translated or otherwise reconstructed. Derived functions, however, are re-created when displayed. s.box, incidentally, seems to live at some sort of halfway house.

UNI tokens are:

  1. ASCII characters;

  2. sequences of two ASCII characters in which the second character is =, /, or \ (used because such sequences are not otherwise legal A+ expressions); and

  3. strings consisting of an uppercase letter, a period, and a token as in 1. or 2. (again, not otherwise an A+ expression). The uppercase letters are used to group the symbols:
    • M for mathematical;
    • I for indexing;
    • S for shape;
    • O for outer products, but Q where an M.y is involved, resulting in Q.y;
    • P for inner product;
    • B for bitwise;
    • A for argument;
    • F for file;
    • E for evaluate and inverse evaluate (Format); and
    • Y for symbols.
     Examples:
     $mode apl
     q
     f{}:00
     34
 0.75
     34
 4
     q
()
     $mode uni
     q
(*~)
     3%4
 0.75
     3 M.+ 4
 4
     -3 4
 -3 4
     1 + -3 4
 -2 5
     - 3 4
 -3 -4
     1 + - 3 4
 -2 -3
     g{}:0%0
     g{}
//[error]  %: domain
*     $si
g{}
.g: 0%0

*     
     f{}
//[error]  %: domain
*     $si
f{}
.f: 00

*     
     s.box -3 4
-3 4
     s.box - 3 4
-3 -4
     s.box 2 3 4
2+3
     $mode apl
     s.box 3 4
3 4
     s.box -3 4
3 4
     s.box 2 3 4
2+3
     g{}
[error]  : domain
*     $si
g{}
.g: 0%0

ASCII Mode Equivalents To APL Graphics
APLASCII
APLASCII
APLASCII
APLASCII
:= each ^& ?
* % log ==
max .max.
see below
min in
~= <= >= *^
rot flip iota rho
take drop upg dng
pack unpack bag pick
eval form rtack where
pi mdiv ?rand beam
%ref dot // ~bwnot
^bwand bwor <bwlt bwle
=bweq bwge >bwgt bwne

Note to table: In ASCII mode, every valid outer product .f is replaced by s. (read "s-dot"), where s is the string of symbols that replaces f. For example, >=. replaces ..

UNI Mode Equivalents To APL Graphics
APLUNI  APLUNI  APLUNI  APLUNI
+ + -
(minus)
- (and
perhaps
space
)

(high
minus)
- *
% * M.* M.& | M.|
M.# M.+ M.- M.<
M.> ? M.? M.^ ^ &
| ~ ! < < <=
= = >= > > !=
== E.% E.* % ^
Y.& / / \ \ A.<
A.> := F.! # #
I.> I.# I.+ I.-
I.? I.< S.+ S.-
, , S.? S.| S.\
! S.! +/ +/ / */ / M.+/
/ M.-/ ^/ &/ / |/ +\ +\
\ *\ \ M.+\ \ M.-\ ^\ &\
\ |\ .+ O.+ .- O.- . O.*
. O.% .* Q.* .| Q.| . Q.+
. Q.- .< O.< . O.<= .= O.=
. O.>= .> O.> . O.!= +. P.*
.+ P.+ .+ P.- ^ B.& B.|
~ B.! < B.< B.<= = B.=
B.>= > B.> B.!= @ @
~ time time case case do do
else else if if while while //
+= e e
(e-
notation)
. . $ $
& ? (stack
vars)
` ` (back-
quote)
' ' " "
: : ; ; ( ( ) )
[ [ ] ] { { } }

Note to table: A UNI minus represents an APL high minus if that is syntactically possible. To force it to be an APL minus, use a blank after a UNI minus when necessary, as shown in the examples.

Load $load script

The argument script is a filename. In response to this command, the directories specified in the environment variable APATH are searched for the file named script. If that file is not found and script does not end with .+ or .a,  these directories are searched again for script.+,  and if that file is not found they are searched for script.a.  Once a file is found, it is loaded into the active workspace by interpreting every line of the file, starting at the top, essentially as if the lines had been entered directly in the active workspace. The difference is that after a file is loaded, the current context and the current directory are the same as they were when the Load command was issued: each is automatically restored if it was changed during execution of the lines of the file. The PWD environment variable is set and restored during this operation.

Load and Remove $loadrm script

This command is the same as the Load command, except that the file is deleted after it has been loaded.

Mapped Files Limit $maplim [n]

The value of $maplim is the number of files that can be mapped concurrently. $maplim n sets the limit to n; the default is 2000. Reducing the limit saves space, since it reduces the size of an internal table.

Off $off

The effect of this command is to terminate the active A+ process. See "Exit" (_exit).

Operators $ops [name]

If name is present, it must be a valid context name (see "User Names"), and the effect of the command is to display a list of the user operator names in that context. If name is not present, the names of operators in the current context are displayed. See "Name List".

Pipe $|var cmd

The effect of this command is to pipe the default display of the global variable named in var to the Unix command named in cmd. The argument var can be a fully qualified name, specifying a context. This is actually a Unix command: see a Unix manual for details. Example:
     txt'Allow for 3-day settlement.'
     $|txt cat >>note.asc

Pipe In $<var cmd

The $<var  cmd  command runs the Unix command cmd and puts the result (the standard output) in the global variable var as a character vector. There must be no space between the $ and < symbols and cmd must not be an interactive command.

To read ASCII file myfile into variable myvar, you can use $<var cat myfile.

Pipe Out $>obj filename

The $>obj  nm.asc  command puts an ASCII version of the A+ global object obj in the file nm.asc, replacing the previous contents if the file already exists. It is equivalent to displaying obj and cutting and pasting it into nm.asc after emptying nm.asc if necessary, and basically equivalent to $|obj cat >nm.asc. If obj is a function, its definition is written in the file. There must be no space between the $ and > symbols.

Pipe Out Append $>>obj filename

The $>>obj  nm.asc  command is just like $>obj  nm.asc  except that if the file nm.asc exists the ASCII text version of the default display of the A+ object is appended to it, instead of replacing the previous contents. There must be no space within the $>> sequence.

Printing Precision $pp [d]

If d is present, then, in the usual case, the effect is, loosely speaking, to set the Printing Precision to d. More precisely, the relevant characters of d are the first nonblank character and the character immediately following it, if that character exists and is nonblank. If the relevant characters are digits, the effect of the command is to set the precision to the number they represent.

If d is omitted (or a relevant character is not a digit), the current setting is displayed.

The Printing Precision `pp normally specifies the maximum total number of digits to be used in the display of a number, not counting the two digits following the e in exponential notation. There are two exceptions:

  • If `pp is zero, then it is treated as if it were one.
  • If `pp is less than ten, integers are nevertheless displayed with up to ten digits.

The maximum meaningful value for $pp is 16. Digits displayed on output beyond the 16th digit are not valid.

See "Printing Precision" (`pp), the examples for Format (), and the examples for Default Format.

Protected Execute Flag $Gf [n]

This flag is a debugging aid that enables (1) or disables (0) protected execution. When disabled, a Protected Execute or a Monadic Do produces the same error message as would the A+ expression it executes. The default setting is 1. See "Execute in Context or Protected Execute" () and "Do - Monadic (Protected Execution)".
     Examples
     $Gf 0
     do{234}
 : type
*     
     $Gf 1
     do{234}
<  6
< type

Random Link $rl n

The random link is set to positive integer n. The random link is used as a seed by the primitive functions Roll and Deal. Setting the random link allows the user to produce repeatable sequences of pseudorandom numbers. See "Random Link" (`rl).

Remove Dependency Definition $undef name

This command removes the dependency definition for name, if any. It leaves everything else, such as value and callback function, unchanged. After this command is executed, name is an ordinary, not a dependent, variable (if it was previously a variable). It may not have a value, since Remove Dependency Definition does not cause an evaluation. You may sometimes want to force an evaluation before invoking this command. Cf. "Remove Dependency Definition" (_undef).

Reset $reset [n]

The $reset n  command clears n suspensions, and $reset alone on a line clears all suspensions. A negative or otherwise invalid argument is taken as 0, a no-op, and all arguments equal to or greater than the number of suspensions are equivalent. $reset does not clear a multiline entry with unbalanced punctuation and, indeed, is blocked by it; to abort the expression, use either or $ alone.

In terms of asterisks, (or $) always removes one asterisk and may remove more than one if the innermost asterisks signal unbalanced punctuation, whereas $reset alone on a line removes either all or none (when the innermost asterisks signal unbalanced punctuation) and $reset n  removes either n or none.

Stack Information $doErrorStack

Set the system variable `doErrorStack to 0 or 1. See _doErrorStack{}.

State Indicator $si

The name and current line of the currently suspended function are displayed. Any functions pendent, that is, waiting for the currently suspended function to be completed, are displayed on lines above the display line of the suspended function. Any uncleared previously suspended functions and their pendent functions are not shown. Lines displayed in the state indicator are:
  • Functions or operators, e.g., .sqrt: x*0.5

  • Immediate execution line, e.g., x*0.5
    or sqrt 1

  • File name and failed line number: statfns.+[23]  x*0.5
The user is reminded of the suspension by the appearance of a * in the prompt. To clear the most recent suspension enter $ or right arrow () and press the Enter key. To clear all suspensions, clear each individual suspension in turn. $reset  [n]   allows you to clear as many as you want with one command.

Stop $stop [n]

If n is present, the effect of the command is to set the stop debugging state to n. The valid settings for n are 0 (none), 1 (stop), and 2 (display). See "Stop" (^) for the meaning of the three states. If n is not present, the current value of the stop debugging state is displayed.

Warning: If you are running A+ from Emacs and you set this state to 1, then if the Stop function (^) is executed while a menu's contents are displayed but before a selection is made, the machine is hosed until the Emacs session is killed.

System Functions $sfs

This command displays a list of the system function names. See "Name List" (_nl). ($_sfs lists system functions which are for the use of A+ implementers only.)

Terminal Flag $Tf

Turns terminal input (stdin) off. When programming an A+ application to be run from a Unix shell script, put $Tf at the end of the application file; otherwise A+ will be in open keyboard mode after the application file has been read, and the Unix shell script will not be executed past the point where A+ was invoked. This mechanism will be replaced in the future. See "Standard Input": `stdin when 0 has the effect of $Tf but queues keyboard entries for processing when it is subsequently reset to 1.

Variables $vars [name]

If name is present, it must be a valid context name (see "User Names"), and the effect of the command is to display a list of the variable names in that context. If name is not present, the names of variables in the current context are displayed. Dependencies are listed only if they have saved values, which do not need to be valid. Names that have been given attributes using _set but that have not been given values are not listed; see "Global Objects" ($globs). Also see "Name List" (_nl).

Version $vers

The version of the active A+ system is displayed. See "Version" (`vers).

Workspace Available $wa [n]

If n is a positive integer, $wa n adds n megabytes to the active workspace.1 $wa 0 is almost equal to (_wa `fragcounts),(_wa `size),(_wa `atmp),_wa `avail. $wa (with no argument) is almost equal to _wa `avail.

See "Work Area" (_wa). (The slight differences are accounted for by the system requirements for running the command and the function.)

X Events Flag $Xf [n]

Enable (1) or disable (0) X events. When X events are enabled  ($Xf 1),  X events that do not have A+ callbacks will be processed even when A+ programs are running. This gives the appearance of a multithreaded environment. For example, scrolling a window will work even while a long-executing program is running, as long as there is no A+ callback attached to the scrolling event. This setting is the default.

If X events are disabled  ($Xf 0),  then no X events will be processed when an A+ program is running. Instead, they are queued and dispatched after the program execution is completed.

This command has no use in running applications, but the 0 setting may be useful in debug mode.


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_16.html0000444000265000001440000003432510737165216013653 A+ Reference: Defined Functions and Operators

Defined Functions and Operators


Programs (user-defined functions and operators) are defined when they are entered in an A+ session. They may be entered at the keyboard, effected when a character vector containing a definition is executed, brought in from a script during the execution of a $load command, or, in an Emacs A+ session, brought in from any Emacs buffer, including the A+ one. In any case, the same rules apply regarding the form in which programs must be entered.

In Emacs, to bring in a program all at once, place the cursor anywhere in it and press the F3 key. To bring it in a line at a time, or just to retrieve individual lines, place the cursor on each line successively and press the F2 key. After either of these keys has been pressed, if the source buffer is not the A+ buffer, there will be two buffers in the window, A+ and source. Caution: The F3 key causes the program to be read exactly as it appears in the file, so if there are asterisks indicating continuation of the definition (as in a multiline definition entered in an A+ session), these asterisks will either cause a parse error or result in a presumably unexpected new definition.

(Cf. "The Syntax and Semantics of A+" and "Workspaces and Scripts".)

A program consists of a header and a body separated by a colon (:). The header consists of the name of the program along with its argument names. The body is an expression or expression group. The result of a program is the result of the expression group that forms the body. See "Function Definitions" and "Operator Definitions" for detailed descriptions of headers and bodies. A simple example of a function definition is

     r f p:1+(1+rp)*p     Simple to compound interest, with p periods.

Scope of Names

The value of a local variable in a program (defined function or operator) is strictly local:  it can be seen only within that program, and not by calling programs or called programs.  This rule for local variables is sometimes called static scoping, or lexical scoping.  (Note, however, that if the local variable is a mapped file, the file value can be seen elsewhere; see "Mapped Files".)

The arguments to a program are local to that program.

The name of the program is global, and furthermore the unqualified form of that name is also considered global within the program, and therefore any occurrence of it refers to the program.

Fully qualified names within the program - ones that explicitly refer to contexts, like ctx.var and .fn - are always global, and so are the names (in symbol form) appearing in Value and Value in Context expressions. If possible, these are the preferred ways to indicate that a name is global.

Names in arguments for Execute are not seen during parsing of the program and play no role in determining whether unqualified names are local or global.

Any unqualified name not covered above is local if, anywhere in the program, it is the target, without extra parentheses, of an ordinary or Strand Assignment, for example ab+c or (a;b)(c;d).

Otherwise any such name is global:  either it is only referenced, not specified, in the program, or wherever it appears as a target it is parenthesized, for example (a)b+c or ((a);(b))(c;d).  Because of the way this aspect of Strand Assignment is implemented, at least currently such an assignment does not make a name local if there is more than one right parenthesis between the name and the left arrow;  thus the assignments ((a;b))(x;y) and (c;(d);e)(x;y;z) force only e to be local.

The context for a visible unqualified global name is the context of the program, i.e., the context explicitly given in the program name in the header, or, if that name is unqualified, the current context when the program was defined.  A statement that may later be executed as a Context command, "$cx ...",  does not change the context during program definition.  See "Assignment" and "Contexts". Within a program, the program's context can be obtained by 0#_name<{%}.

A character string or substring or symbol that may later be interpreted as an unqualified global name, using Execute or Value, is not a visible unqualified global name (when the program is defined). The context that is used for such text is determined only when it emerges as a name, i.e., when it is executed, and it will be whatever context is current at that time. That current context could be the context when the program was invoked or one established by the execution of a Context command within the program or a program called by it.

Function Syntax

A function is a program that takes from zero to nine data arguments and returns a result. Examples of functions that take 0 (niladic), 1 (monadic), 2 (dyadic), and 3 arguments are shown in Table 4.3, "Function Call Expressions and Function Header Formats". (Although a dependency is a kind of niladic defined function, it is different enough in form and operation that it is treated separately, in "Dependencies", and ignored here.) For monadic and dyadic functions, for both definition and use, the two possible forms are shown: infix and general. No matter which form is used when the function is defined, either form can appear when it is used.

Operator Syntax

An operator definition is a program that takes
  1. one function operand, two function operands, or a function operand and a data operand, and

  2. one or two data arguments,
and returns a result. It is distinguished from a function definition by parentheses in the header that surround the expression consisting of the operator name and its operands. Examples of the possible headers are shown in "
Operator Header Formats".

In each form in that table, the left operand, f, must be a function. When is the right operand, h, a data variable and when is it a function? If in the operator definition it has the name g, it is a function. If it has any name there other than g, it is a data variable unless in every occurrence of it in the body of the definition it can only be a function. Examples of such occurrences are ... h ... and ... h{...} ... .

To repeat: the left operand is always a function. If the right operand is not named g in the definition, it is a data variable if there is an occurrence of it in the body of the definition where it either must (e.g., ... h[...] ...) or could possibly (e.g., ... h2 3 4 ... or ... h/...) be a data variable. Otherwise the right operand is a function.

Operators have higher priority than functions. The arguments defined within the parentheses are bound to the operators before the derived function is applied to its data arguments.

Operators have long left scope and short right scope. This is the mirror image of functions, which have long right scope and short left scope. For example, the expression 100 200 ,@1@1 2 3 4 is the same as the expression with redundant parentheses 100 200((,@1)@1)2 3 4.

Entry of Programs

Single-statement programs are normally entered on a single line, as in
mean x: (+/x)#x
Multiple-statement programs may be entered on one or more lines. The definition is not complete until any open quotation mark and all open braces and parentheses are closed. Be sure to see "
Workspaces and Scripts" regarding continuation rules during entry of statements and functions, and asterisks that A+ supplies to indicate depth of punctuation. These asterisks are not shown in this chapter.

Here is a sample multistatement multiline function definition:

total m : {
    Append row, column, grand totals to matrix.
   c+/m;           Column totals.
   r+/m;          Row totals.
   ((m),r),c,+/c
   }
This function could be defined more efficiently using the Rank operator rather than Transpose:
total m:{
    Append row, column, grand totals to matrix.
   c+/m;  r+/@1 m;     Column and row totals.
   (m ,@1 0 r),c,+/c
   }
Notice that the comments are comments to lines, not to statements. They do not appear before the statement semicolons and they do not have their own semicolons. Even if there are several statements on a line, there can still be only one comment.

Defined functions can of course appear in the definitions of defined functions, as in

     y f x:0g{y}g{x}
Notice that g appears in general form, not in infix form. Although either form is valid, it is a good practice, especially in scripts, to use the always unambiguous general form within the body of a definition. Then it doesn't matter whether g is defined before or after f; when it appears in the definition of f A+ will surely be able to determine that it is a function and not a variable.

Here is a sample operator definition, showing how the right operand can be a data value:

u(f p a)v:{
     case(a){
               1 ; u f  (u)v;
               1; u f (-u)v;
               0 ; u f     0#v;
               'Incorrect right operand'}
     }
In the following operator definition, both operands must be functions, as shown by the syntax. Defined operators can be used in the definitions of defined operators, like inv in this example:
     y (f iso g) x:(g inv){f{g{y};g{x}}}
     Indentation, Blanks and Tabs
When the name of a program is entered alone on a line, without arguments or braces, A+ displays the program definition. It is shown just as it was entered, with the spacing preserved, with two exceptions:
  1. Any invisible characters (blanks, tabs, ...) before the first visible character in the function are eliminated. If you want to see on entry what will be displayed later, start the header at the left margin, eliminating the blanks supplied at the beginning of each input line in an A+ session.

  2. If the function was entered in an A+ session (rather than in a script or other file), the spacing within each line is preserved but the indentation is generally not: the first nonblank character of each line after the first is shown at the left margin. In these lines, it is specifically the blank character that is dropped, however; other invisible characters are kept. You can force the original indentation to be honored in successor lines by using tabs. All tabs and any blanks that follow a tab are kept.
Thus, if in an Emacs A+ session you enter
     f1{x;y}:{
             if (x=0) {
                    ...;
                    ...};
                else  {
                    ...}
             }
using just blanks to obtain the indentation, you get this display
     f1
f1{x;y}:{
if (x=0) {
...;
...};
else  {
...}
}
whereas if you enter
f1{x;y}:{
       if (x=0) {
          ...;
          ...};
          else  {
          ...}
      }
using tabs, at least as the first character on each successor line, you get a display exactly matching your input.

Formatting a Defined Function or Operator

At times it may be convenient to convert a defined function or operator to text. Examples of the need for this would include printing formatted reports of code from the workspace or dynamic inspection of the code. However, it may not be obvious just how to format these objects into text. It is done like this:

     avg
avg v : {(+/v)#v}

     mat<{avg}      here is the technique

     mat
avg v : {(+/v)#v}

     mat
 18

This is the format () of a function scalar.


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_17.html0000444000265000001440000012050310737165217013647 A+ Reference: Dependencies

Dependencies


A dependency is a global variable (the dependent variable) and an associated definition that is like a function with no arguments. Values can be explicitly set and referenced in exactly the same ways as for a global variable, but they can also be set through the associated definition.

In this chapter the basic characteristics of dependencies are developed through a series of examples, and are then collected in a definition of dependencies. Then, itemwise dependencies are defined and exemplified. Finally, cyclic dependencies are discussed.

Creation and Deletion

A dependency is created by specifying its definition, in the form name:expression. The variable name can be either new or pre-existing. The body of the definition (which follows the colon) is entered in the same way that the body of any defined function is entered, with the same syntax rules, and the variable name can appear within it. The description of Execute in Context shows how you can define dependencies of the same form in several contexts at once. Because a dependency definition contains a colon, it cannot be a statement in a defined function or another dependency definition. To create a dependency within such a definition, use Execute in Context or the like.

A dependency, both variable and definition, can be deleted, and its storage freed, by the Expunge function (_ex) or command ($ex). The Remove Dependency Definition function, (_undef) and command ($undef), as their names imply, delete only the definition, leaving an ordinary variable with all its other properties intact, e.g., its value and any callback function set on it (see "Callback Functions"). They do not cause an evaluation before they remove the definition.

Evaluation

The first time a dependency is referenced after it is created, (assuming it has not been explicitly specified in the meantime) its definition is evaluated and the result is both saved and returned. When the dependency is referenced again, the saved value is returned if it has not been marked invalid in the meantime; otherwise the definition is evaluated and the new result is saved and returned. The saved value can also be set through ordinary Assignment, and this value will be returned until it is marked invalid. For example:
     a3        Define a global variable a
     b:a*2      Define a dependency b
     b
 9              The definition of b is evaluated.
     b
 9              The saved value of b is returned.
     a4        The saved value of b is marked invalid.
     b
 16             The definition of b is evaluated.
     b13       Specify a value for b
     b
 13             The saved value of b is returned.
     a5        The saved value of b is marked invalid.
     b
 25             The definition of b is evaluated.
The rules of localization within the definition of a dependency are the same as those for ordinary functions.

When a dependency is defined, the value, if any, of the dependent variable is marked invalid - not erased, just marked invalid. After that, the saved value (which continues to be retained) is marked invalid (evaluation needed) whenever the source of a value or the dependency itself is changed - i.e.,

A visible use of a name occurs when the name appears in A+ code directly, and not in a character string or a symbol. A use that is not visible is an implicit reference, which occurs through the use of Execute () or Value (%).

For example, if

     a100
     b:a*2
     f x:3+x
     df:a+b+f 2000
     df
 12103             The definition of df is evaluated.
then any one of the following will cause the value of df (saved by the last input line) to be marked invalid:
     a50
     b:a*3
     b625
     f x:4x
     df:a+b+f 3000
Only changes to global variables, functions, and dependencies that have a visible use will cause the saved value of a dependency to be marked invalid: implicit references will not. Moreover, changes to global variables that are assigned but not referenced in a dependency definition will not cause its saved value to be marked invalid. For example, in the dependency df defined below, changing x will cause the saved value of df to be marked invalid, but changing y or z will not, because there are no visible uses of them, and c is only set, not referenced (it is the right argument of the specification, ('y')+%`z,  that is referenced). Entering a new definition of df will of course mark any saved value invalid.
     df:x+.c('y')+%`z   The saved value of df is marked invalid.
     x10
     y100
     z1000
     df
 1110
     x20       The saved value of df is marked invalid.
     df
 1120
     y200      df not marked: no visible use in the definition.
     df
 1120
     z2000     df not marked: no visible use in the definition.
     df
 1120
     c50   df not marked: in the definition c is only assigned, not referenced.
     df
 1120
When a dependency definition is executed, the dependent variable is first marked valid. This validation allows the variable to be referenced during evaluation, either within the definition or in asynchronous execution such as a callback, and it provides a fallback value, which may possibly be of some use.

If execution of a dependency fails, a suspension occurs, as here, where n has no value:

     m:3n
     m
 .n: value
When the suspension is cleared, one of two things happens; if the dependency does not have a saved value, as in this example, then a value error on its name occurs:
*     
 .m: value
*
If, however, it has a saved value then that value has been marked valid. It is returned when the suspension is cleared. Continuing the example:
*          Clear the previous suspension in this example.
     m5    Now m has a saved value that is not marked invalid.
     n'a'  Marks m's saved value invalid and makes its definition erroneous.
     m
 : type    The saved value has now been marked valid.
*     m
* 5
*          Clear the suspension.
 5          The saved value is returned.
More examples of dependencies are presented in the chapters that follow.

Dependencies Defined

A dependency is a global variable, the dependent variable, with an associated niladic definition. It is established by
     name:definition
or
     name[indexname]:definition
The latter form is an itemwise dependency and is treated separately below.

The rules of localization for a dependency definition are the same as those for ordinary functions, and indeed it is interpreted exactly as the body of a niladic function would be. name may appear within definition.

A dependency has a saved value once its current definition has been evaluated or a value has been explicitly assigned. If the variable had a value before the dependency was established, the dependency has a saved value immediately after establishment, but that value is marked invalid.

   Evaluation of Dependencies

When referenced, the value of a dependency is determined as follows:

  • If it has no valid saved value, its definition is evaluated and the result of the evaluation is the value, which is also saved for future references. If it has an invalid saved value, the invalidation is removed as the first step of evaluation, and if the evaluation fails this saved value is returned when the execution suspension is cleared. If the dependent variable is bound to a display class and the definition yields an improper value for that class, then the saved value will be retained (no longer marked invalid, of course), in some cases with no warning or error message.

  • If the dependency has a saved value that is not marked invalid, the saved value is the value.
A dependency that is displayed by s in any sector or workspace and is not iconized is referenced each time A+ goes through its main loop, and likewise if it is bound to the `reference class.

Note that if a dependency has a stored value that is marked invalid, a reference triggers an evaluation not only when the reference requires the value, as in `dep is `table,  but also when the reference does not require the value, as in `class of `dep (supposing `dep not shown, so that its invalidation did not trigger an immediate evaluation).

   Invalidation of Dependencies

The saved value of a dependency is marked invalid:

  • when it is first defined (if it has a saved value), and when its definition is modified;

  • when a change occurs to a global object that is visibly referenced (see below) in its definition, and the definition is not currently being evaluated, nor a callback on the dependency currently being executed.
A
global object is visibly referenced if its name occurs as the source of a value (not just as a specification target) outside an argument to Execute or Value. A change to such an object occurs when:

Note that a global variable that is set in a dependency but never referenced is not a visibly referenced object.

The value of a dependency is marked valid just before its definition is evaluated (if there is a saved value) and whenever a value is explicitly Assigned to the dependent variable - including, of course, at the end of a successful execution of its definition.

A change to a visibly referenced global variable made during evaluation does not cause the dependent variable's value to be marked invalid. Consider

     m:{mm+n; (n)10n; m+n}
     m100
     n1
     m
 111
n1 marks the saved value of m invalid, so the next statement triggers evaluation of its definition. The invalidation mark is changed to an under-evaluation mark, and mm+n uses the previous saved value to produce a new saved value (101). Respecifying n (as 10) at this point does not invalidate this new saved value, since it is marked as under evaluation, and it is used in the final m+n.

On the other hand, a new definition unconditionally invalidates a saved value, as in

     m:{mm+n; "m:n"; m+n}
     m100
     n1
     m
 2
where in the final m+n the new definition (m:n) is executed to evaluate m.

Code in callbacks is treated in this respect like code shown and called explicitly in the body of the dependency. When a dependency that is being evaluated triggers a callback function on another variable, any change made to a variable that is visibly referenced in the dependency does not mark the saved value of the dependency invalid. E.g.,

     {a0; b3;}
     a:(c)10b     Marks the saved value of a invalid.
     f{}:(b)10a   Set b in a callback function.
     `c _scb (f;)   Trigger a callback from c in the dependency definition.
     a              Dependency is evaluated.
 0 10 20
     b              See that b was set in the callback.
 0                  Yes, from a's original stored value.
     a
 0 10 20            The value from the evaluation.
Note that an evaluation is not completed until all callbacks triggered by it have been finished.

If a variable is set during its own callback, its dependents are invalidated (again).

Itemwise Dependencies

Itemwise dependencies are intended to reduce redundant computation by allowing the items of a dependent variable to be marked invalid separately. Only the first axis is singled out in this way. The form is the same as for ordinary dependencies except that Bracket Indexing and an index name are used in the definition:
     name[indexname]:body_of_definition
The variable named by the index name is local and can be used for any purpose within the definition. Since this variable is local, the index name must be unqualified.

A simple example of an itemwise dependency is

     y[i]:f{m[i];c}
Whenever c is changed - even just one of its items -, all of the saved value of y is marked invalid, but when items of m are appropriately changed, then only the corresponding items of the saved value of y are marked invalid.

   Recognition of Itemwise Changes

For itemwise invalidation of the dependent variable, any change in a variable on which the dependency depends itemwise must be made by Bracket Indexing, Choose, or Append Assignment. In the example just shown (leaving aside for the moment an incompatibility between Append and the others), either
   m[3756]expression
or
   (3756#m)expression
marks just y[3756] invalid, and, more generally, each of
   ((expr1)#m)expr2
and
   m[expr3]expr4
and
   m[,]expr5
marks items of y invalid.

All of y, however, is marked invalid by

   ((3756=#m)/m)expression
and, of course,
   m[;5]expression
Moreover, either pair of statements
   m[3756]expression
   m[,]expr5
or
   m[,]expr5
   m[3756]expression
mark all of y invalid (assuming no updating of y between the statements). In effect, when y is updated, it is updated by just one of a Bracket Assignment, an Append Assignment, or an ordinary Assignment. Therefore, itemwise invalidations caused by a Bracket Assignment and an Append Assignment cannot be pending at the same time. (Itemwise invalidations from several Bracket Assignments or several Append Assignments can be pending simultaneously, of course.)

If a is a large itemwise dependency and you know at some point in the code that you may be about to cause a total invalidation in one of the two manners described just above, you might consider avoiding the total invalidation by forcing an itemwise evaluation with a trivial statement such as
{a;};

In y[i]:m[i]  all  of y is marked invalid by m[;1]expr . As discussed above, Append Assignment is recognized as an itemwise change, except that a total invalidation occurs when otherwise an itemwise change from an Append Assignment would be pending at the same time as an itemwise change from a Bracket Indexing or Choose.

   Recognition of Itemwise Dependence

In an itemwise dependency definition, only the form shown, Bracket Indexing with just an index name and no semicolons, is allowed on the left. If any other form appears, the dependency is total, no matter what the rest of the definition is like.

In the body of the definition, to the right of the colon, a similar, but slightly less stringent, rule holds for each variable. To have the dependency depend itemwise on a variable, every referencing of that variable must be a Bracket Indexing using just that same index name for the first axis. None of the following definitions will allow updating of less than all of ns:

ns[i]:(sr+nw)[i]         An expression, not a variable, is being indexed.
ns[i]:{ji;sr[j]+nw[j]}  The index has same value, but not same name.
ns[i]:(i#sr)+i#nw        Choose, not Bracket Indexing, used in the def.
ns[i]:sr[i+1]+nw[i+1]    Indices consist of more than just index name.
ns[i]:sr[i]-sr[i-1]      The bad occurrence negates the good one.
On the other hand, indexing along other axes does not interfere with itemwise invalidation:
     ns[i]:sr[i;50],@1 nw[i;50+50]
allows updating of only the affected items of ns. Obviously, any dependence on a function or operator is total.

Note: At the present time, the parser may confuse the dependent variable with a function when parsing the body of an itemwise dependency definition. If such a parsing error occurs, replace the dependent variable, b, say, in the body by its fully qualified form, cxt.b, say, if the context is known and otherwise by %`b (or more likely (%`b)) to give the parser the hint it needs.

   The Time and Form of Evaluation of an Itemwise Dependency

When an itemwise dependency is defined or its definition is changed, its saved value, if any, is marked invalid, just as is done for any dependency. If the next event for it is a reference, its definition is evaluated, with the index name being given the value Null, to indicate all items (see next section). If at some later time any change occurs in a function, operator, or variable on which it depends, and that change is not recognized as itemwise, then the saved value is again marked invalid. If still later the definition is evaluated, the value of the index name is again the vector Null (again, see next section). Just as for an ordinary dependency, an evaluation with Null index for a variable bound to a screen display class can lead, sometimes with no warning or error message, to a retention of the saved value (no longer marked invalid).

Now suppose a dependent variable is referenced after a series of changes that are recognized as itemwise to variables on which it depends itemwise. (Indices modified by a callback may not be recognized.) Suppose further that no total invalidation has occurred. Then the dependency definition is evaluated with an index vector consisting of the indices for which the changes were recognized, listed in the order in which the changes took place, but without duplication. This vector may contain all indices of the dependent variable; it will nevertheless not be transformed into the Null. Just as for a total invalidation, an evaluation for a variable bound to a screen display class can lead, sometimes with no warning or error message, to a retention of the saved value (no longer marked invalid). Furthermore, for any dependent variable, evaluation with a value that is impermissible for Bracket Indexing leads to validation of the saved value; e.g., if int[i]:fl[i] and fl is set to a floating-point vector, int is set to an integer vector, fl[2] is set to a value that cannot be coerced to an integer, and then int is referenced, the evaluation fails and the saved value of int (no longer marked invalid) is returned, without any error or warning message.

If a Selective Assignment is explicitly made to a dependent variable and there are pending itemwise assignments, the definition is evaluated, for all the pending indices, before the Selective Assignment is made.

When any reference is made to an itemwise dependency, including one by Bracket Indexing, if the saved value is marked invalid, even just itemwise, its definition is evaluated before the reference is executed. Indices are not compared to see whether only valid items are being referenced, so that an evaluation is not actually needed.

If a dependency is defined and the dependent variable is explicitly assigned a value before any reference, then a reference will not trigger an evaluation until one of the variables upon which the dependency depends is changed. In particular, itemwise dependency on a particular variable may only gradually be reflected in the value of the dependency, as illustrated in this example:

     b10+10
     a[i]:{i;'---';b[i]}   Entire saved value of a marked invalid.
     a10                   Now it is not marked invalid.
     a
 0 1 2 3 4 5 6 7 8 9         Uses saved value.
     b[3 5]103 105          Pending change for a[3 5]
     a[0]                    Trigger an evaluation.
 3 5                         Just the changes since a10
---
 0
     a
 0 1 2 103 4 105 6 7 8 9     Old a, with a little new b
     b
 10 11 12 103 14 105 16 17 18 19
You usually want all the dependency to be honored from the beginning, and usually there is no problem, because you do not give an explicit value to a dependency that you have just defined. You should be aware, however, of the use of the saved value in the circumstances just illustrated.

   Evaluation When the Index is the Null

For any vector of indices i that is not the Null, the itemwise dependency definition a[i]:... can be thought of as being executed in the form a[i]... . When the index vector is the Null, however, this view would be incorrect. It is, rather, executed in the form a... . The shape of a can be changed by a total invalidation.

To repeat, for emphasis: when there is a recognized total evaluation of an itemwise dependency:

  • The Null is used to index the variables for which the dependency is itemwise.

  • The result of executing the body of the dependency definition is the new saved value of the dependent variable. The Assignment to the dependent variable is not an Indexed Assignment, but rather an ordinary Assignment, and the shape of the dependent variable can be changed by it.

Cyclic Dependencies

So far only acyclic dependencies have been discussed, i.e., sets of dependencies with no recursive references, where no dependency depends on itself. The Debugging State system command ($dbg) provides a useful tool for analyzing recursive, or cyclic dependencies.

Example 1. Evaluating Cyclic Dependencies

The first example illustrates an important property of cyclic dependencies: if in the course of evaluating a dependency, its name is recursively referenced, that reference will be satisfied with the previously saved value (if there is no saved value, a value error occurs). Unlike a recursive function, a cyclic dependency cannot cause an infinite recursion. For example:

     $dbg dep 1     Show dependency evaluations.
     a:b+2          Marks the saved value of a invalid.
     b:a+g+2
     a12           Assign a and b values to avoid value errors.
     b5            They are now not marked invalid.
     g10           Saved value of b is now marked invalid, so a is also.
     a
    Dependency .a evaluation entered
      Dependency .b evaluation entered
      Dependency .b evaluation exited
    Dependency .a evaluation exited
 26
The new value of a is 26, which means the new value of b is 24. Since g is 10, a must have been 12 when b was evaluated, which was its saved value at the time.

Example 2. Interrelated quantities (rate, yield, spread)

Cyclic dependencies arise quite naturally in applications as sets of interrelated variables. For example, consider the following mutual relationships among underlying rate u, yield y, and spread s:

     y:u+s
     u:y-s
     s:y-u
For initialization set any two of these quantities. After that, if any one of the quantities is set the other two will be automatically updated when referenced. For example:
     $dbg dep 1
     (u;s)(0.08;0.005)  Set both at once else one invalidates the other.
     y            Defining dependency marked any saved value of y invalid.
    Dependency .y evaluation entered
    Dependency .y evaluation exited
 0.085
     y0.09       Marks the saved values of both u and s invalid.
     u
    Dependency .u evaluation entered
      Dependency .s evaluation entered
      Dependency .s evaluation exited
    Dependency .u evaluation exited
 0.08
     s
 0.01             The saved value is returned.
When y was reassigned, the saved values of u and s were marked invalid. When u was then referenced its definition was evaluated, causing s and y to be referenced. The reference to s caused it to be evaluated, using the new value for y and the old value for u. This new value for s was then used with the new value of y to produce a new value of u. Because of the selfconsistency of the mathematical expressions, the new value of u is the same as the old one. However, these computed values would not be the same if u and s had been referenced in the opposite order. To verify this, reproduce the example up to the references of u and s, and then reference them in the opposite order:
     (u;s)(0.08;0.005)
     y
    Dependency .y evaluation entered
    Dependency .y evaluation exited
 0.085

     y0.09
     s
    Dependency .s evaluation entered
      Dependency .u evaluation entered
      Dependency .u evaluation exited
    Dependency .s evaluation exited
 0.005

     u
 0.085
Reasoning as before, u now has a different value from the one originally specified, but s does not. Of course it is not always possible to know the order in which dependencies will reevaluated, which means that one cannot be certain of the new values in cases like this. The only consistent way to use n cyclic dependencies like these is to explicitly set any n-1 of the quantities and use the dependent definition only for the remaining one.

How can the values of several cyclic dependencies be set independently without causing one another's saved values to be marked invalid? In the above example, if y is first specified and then u is specified, the specification of u will cause the saved value of y to be marked invalid, and therefore when y is referenced it will not necessarily return the value to which it was set. The answer to this problem is to set them in a strand assignment, because at the end it marks as valid the values that it has just saved for all targets that are dependencies. Continuing the above example:

     (y;s)(0.09;0.005)
     y
 0.09
     s
 0.005
     u
    Dependency .u evaluation entered
    Dependency .u evaluation exited
 0.85
In practice, the values for y and s may not be conveniently available at the same time, so the information on the right of the strand assignment should be maintained in a set of auxiliary global variables. For this example these variables will be denoted by yA, uA, and sA.
     yA0.09           At some point in an application.
     sA0.005          Probably at some other point.
     (y;s)(yA;sA)     Later, and before referencing u
     u
    Dependency .u evaluation entered
    Dependency .u evaluation exited
 0.085
     uAu              Keep the auxiliary of u current.
By keeping the auxiliary variables current, it is not necessary for an application to respecify all n-1 dependencies in a cyclic set before evaluating the n-th: those not respecified will simply use their current saved values. Continuing the above example:
     yA0.095          A subsequent respecifying of yA
     (y;u)(yA;uA)     Later, before referencing s. Old value of uA used.
     s
    Dependency .s evaluation entered
    Dependency .s evaluation exited
 0.01
     sAs              Keep the auxiliary of s current.
The easiest way to keep the auxiliary variables current with the dependency values is to make them into dependencies as well:
     yA:y
     sA:s
     uA:u
The strand assignments can be incorporated in a function to be called when the current set of assignments to the auxiliary variables has been completed, and before the uncommitted dependency is referenced:
     commit x:(%0x)%1x
For example, the above strand assignment is equivalent to commit(`y`u;`yA`uA).

The use of auxiliary dependencies also makes it easy to cancel, or back out, changes simply by resetting the values of these dependencies to those when the last commitment was made. In the above example, if:

     cancel x:(%1x)%0x
then the values of the auxiliary variables can be reset to their values at the time of the last commitment by:
     cancel(`y`u`s;`yA`uA`sA)

System Functions and System Commands for Dependencies

The system functions and commands discussed here are described in "System Functions", and "System Commands".

The following example will be used to illustrate the system functions and system commands that apply to dependencies.

     p2 31.23 4.5 20 5.6 7 8.95
     p
 1.23  4.5  20
 5.6   7     8.95
     n2 310 1 2 5 3  1
     n
 10  1  2
  5  3  1
     fn{x}:x
In the definitions that follow, m is dependent on p, n, and fn; ct is dependent on m; and gt is dependent on ct.
     m:pfn{n}          Price times number.
     ct:+/m             Column totals.
     gt:+/ct            Grand total.
The system command $deps lists the names of the dependencies, while the system function _nl provides such a list as a vector of symbols when given `deps as an argument:
     $deps
 m ct gt
     list_nl{;`deps}
     list
 `m `ct `gt
     $vars
 p n
     _nl{;`vars}
 `p `n
Dependencies are global variables, and when they have saved values, their names appear in variable lists.
     ct
 40.3 25.5 48.95
     $vars
 p n m ct   The evaluation of ct caused evaluation of m, but not of gt.
The
system command $def dep displays the definition of the dependency dep, while the system function _def `dep returns that definition as a character vector:
     $def gt
gt:+/ct
     def_def `gt
     def
gt:+/ct
The
system command $dep name lists all dependencies in which name is explicitly referenced, where name can be any name, but the only meaningful names are those of global variables, dependencies, or functions. The corresponding system function is _dep:
     $dep n
m
     $dep fn
m
     _dep `ct
 `.gt
The
system function _alldep is the transitive closure of _dep with duplicates removed. The value of _alldep `name is a list consisting of the unique names in _dep `name, _dep_dep `name,  etc.
     _alldep `m
 `.ct `.gt
The command $undef v and function _undef v remove the dependency definition for v while leaving all the other properties of v intact. Forcing evaluation of v just before such a removal will save its latest value.

Finally, there is the Debugging State system command $dbg. The complete definition is given above, in the chapter on system commands. The use illustrated here is $dbg dep 1 for tracing dependency evaluation. Whenever a dependency is referenced, an "entered" and an "exited" message is displayed for each dependency whose definition had to be evaluated in order to satisfy the reference. In the above example, ct has already been referenced. If it is referenced again, its saved value is returned, so no dependencies are evaluated. If gt is referenced, however, its definition will be evaluated.

     $dbg dep 1
     ct
 40.3 25.5 48.95
     gt
    Dependency .gt evaluation entered
    Dependency .gt evaluation exited
 114.75
If one of the underlying variables is changed, all the dependencies are marked for evaluation, so all their names appear when gt is subsequently referenced:
     n[1;1]4
     gt
    Dependency .gt evaluation entered
      Dependency .ct evaluation entered
        Dependency .m evaluation entered
        Dependency .m evaluation exited
      Dependency .ct evaluation exited
    Dependency .gt evaluation exited
 121.75
Note that had m, ct, and gt been defined as niladic functions, the evaluated results illustrated in this example would have been the same. However, niladic functions have no saved values and are therefore always evaluated when referenced. Consequently dependencies provide a generally more efficient evaluation scheme.

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_18.html0000444000265000001440000003456210737165217013661 A+ Reference: Callback Functions

Callback Functions


Variable callbacks are functions associated with global variables, including dependencies, (or, indeed, functions or names that do not yet have a value) that are called just before or after Assignments or certain Selective Assignments are made to those variables. Variable callback functions are the subject of this chapter and will usually be spoken of as just "callback functions". Callbacks are particularly important for asynchronous events, such as in screen management in the s context, for tracking user actions; see "Interprocess Communication: adap", and "Introduction to Screen Management" and the chapters that follow it.

A mapped file mf can have an associated callback, but that callback is associated with the variable mf, not the underlying file. A change to the file through another mapped variable, in the same process or not, or by any other means than an assignment to mf will not trigger a callback for mf.

In A+, variable callback functions (as distinct from event callback functions) have the same basic syntax (variations are discussed below):

     cfn{s;d;i;p;c;v}
For example, if the function cfn is associated with the global variable price defined in the context comp, then when price changes, cfn is automatically called with arguments supplied by A+:
  1. s is static data (see below);

  2. d is the new value, i.e., the value of the righthand side of the Assignment triggering the callback;

  3. i is an index or set of indices (left argument to Choose - see p);

  4. p is a path (left argument to Pick) such that i#pprice is the subarray that changed;

  5. c is the name of the context, in the form of a symbol, `comp; and

  6. v is the name of the global variable in the form of a symbol,`price.
When cfn is called because of an Assignment of a global variable, the change to that variable can be described in terms of the arguments to cfn as

     (i#pc%v)d    if i is nested, or
     (i#,pc%v)d   if i is simple, or
     (pc%v)[,]d   if i is out of range for c%v before this assignment.

The last case involves the Append form of Selective Assignment and i is the set of indices in pc%v (after the assignment) of the appended elements.

The first argument of a callback function is called the static data. Static data is specified when the association between a variable and a callback function is established. Typically, the static data is any constant extra information needed to process the change in the associated variable.

A callback function can have anywhere from zero to six arguments, but no matter how many it has, their meaning from left to right is the same as above. For example, if f{a;b;c} is a callback function, then a is static data, b is new data, and c is an index.

The other type of callback is the event callback. Event callback functions have the basic syntax cfn{s;c;v} where the names s, c, and v have the same significance as above. An event callback function may have from zero to three arguments; the arguments are positional. See the chapters mentioned in the first paragraph of this chapter and especially "Attributes with Callbacks".

Setting and Causing Callbacks

A+ provides the Set Callback (_scb) and Set Preset Callback (_spcb) system functions for establishing and removing the association between a global variable and a callback function. Set Callback is discussed here, and Set Preset Callback below. The left argument is a symbol naming the global variable. The right argument is a pair of the form (fcn_name;static_data), where static_data is the static data (perhaps Null), and fcn_name is a function expression, a name entered without backquote or quotes. Thus the first element of this argument, with the enclosure by strand, is a function scalar and not a name, so this association is unaffected by any later changes to the meaning of the name of fcn_name. For example:
     cbf{s;d;i;p;c;v}:(s;d;i;p;c;v)    A callback function.
     `a _scb (cbf;'-- a --')    Call cbf whenever a is specified.


     a92        Specify a and see the arguments to the callback function.
< -- a --        Static data s
<  92            New data d
<                Index i is null.
<                Path p is null.
< `              c names the root context.
< `a             v names the variable a

     a10 20 30 40   Set a and see args to cbf
< -- a --
<  10 20 30 40
<
<
< `
< `a

     a[1]200        Indexed Assignment.
< -- a --
<  200
<  1
<
< `
< `a

     `a _scb (;)     Remove the callback on a and
     a999           see no callback.
     a
 999

     $cx ctx         Set new context.
     b(`scalar`vector`matrix; (3.14; 'abcdef'; 3 2))
     `b _scb (.cbf;'-- b --')   Call cbf when b changes.

     (1;0)#`matrixb        Pick-Choose 2 from the matrix.
 2

     ((1;0)#`matrixb)22   Change the 2 to a 22.
< -- b --
<  22
< < 1                       Index (1;0)
  < 0
<  `matrix                  Path `matrix
< `ctx
< `b

     (1;0)#`matrixb        Pick-Choose 22 from the matrix.
 22

   Selective Assignment Causes Callbacks

Any form of Selective Assignment can cause a callback function to be executed. Taking the last example from the previous section and continuing:
     (1 0/b)<`Scalar`Vector`Matrix
< -- b --
< < `Scalar `Vector `Matrix
< 0               Index is 0.
<                 Path is Null.
< `ctx
< `b
     b            And the change was made.
<  `Scalar `Vector `Matrix
< <  3.14
  <  abcdef
  <    0  1
      22  3
       4  5
The next example shows an Append Selective Assignment triggering a callback:

     x10
     `x _scb (.cbf;'-- x --')
     x[,]100 200
< -- x --         The callback was triggered.
<  100 200
< <  10 11
<
<  `ctx
<  `x

   Avoiding Callbacks

There may be times when you want to avoid callbacks - for example, when you are clearing a suspension and with normal execution many more suspensions would occur because of errors in callback functions. You can use the $Sf command for that purpose. See "Callback Flag" and note the warnings there.

When Callbacks Occur

It is important to know that callbacks established by _scb are called after the associated global variables have changed. This can be verified by defining a callback function that displays the value of the associated variable. When the function is called, the new value of the variable will be displayed, not the old. Note that the callback argument d is not necessarily this new value; d is, rather, the explicit result of the Assignment.

An ordinary callback function on a dependency is not called when the dependency definition is evaluated, although a preset callback function is. Similarly, during a callback on a dependency, the dependent variable's value is not marked invalid by any change the function makes in a variable on which the dependency depends.

   Preset Callbacks

It is also possible to establish callbacks that are called just before the value of a variable is changed, so that the change can be validated. To do so, use the system function _spcb, which takes the same arguments as _scb.

The differences between callback functions established by _spcb and _scb are:

Since preset callbacks are used for validating new values of global variables, the following rules should be followed in their definitions:

   Callbacks during Dependency Evaluations

The evaluation of a dependency can trigger a callback on the dependent variable, one that was established by the Set Preset Callback function - but not one that was established by the Set Callback function. The callback occurs after the definition body has been evaluated and before the dependent variable is set. The second argument to the callback is the result of evaluating the definition body, and the result of the callback is the value to which the dependent variable is set - or to which the items of the dependent variable are set, in the itemwise case.

Moreover, when a dependency is evaluated, callbacks of either kind can be triggered by assignments to other variables during the evaluation. These callbacks may mark saved values of other dependencies invalid.

A dependency that is currently being evaluated, however, or indeed a dependency whose callback function is being executed is marked as being in that state, and so its value will not be marked invalid while the evaluation or execution is going on.

Evaluation of a dependency is not complete until all callbacks, including any on the dependent variable, have been finished. See "Dependencies" for an example.

   Callbacks during Protected Execute and Monadic Do

An error that occurs during the execution of a callback within the execution of a Protected Execute or Monadic do is reported in the result of the protected execution.

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_19.html0000444000265000001440000005466510737165217013670 A+ Reference: Files in A+

Files in A+


Script Files

As described in earlier chapters, the Load and Load and Remove system functions and the Load and Load and Remove commands deal with script files, loading such a file into the active workspace by interpreting every one of its lines, starting at the top, essentially as if the lines had been entered directly in the active workspace. The difference is that after a file is loaded, the current context and the current directory are the same as they were when the Load command or function was initiated: each is automatically restored if it was changed during execution of the lines of the file. See "Workspaces and Scripts" for more details concerning this kind of file.

Mapped Files

Data files in A+ are called mapped files.

From the viewpoint of the A+ primitive functions, a mapped file is (for the most part) an ordinary array when accessed through an associated variable. A mapped file can always be referenced and (if opened for writing) selectively assigned (see "Selective Assignment") as if it were an ordinary array.

Ordinary (as opposed to selective) Assignment conveys not only value (including shape) but also mapping status to its target.  In particular, a target that is mapped will remain so if and only if the righthand side of the Assignment is mapped (see bullet items below);  otherwise, it will become an ordinary array.  Also, since passing arguments and results acts like ordinary specification, if a function is called with a mapped file as an argument, that (local variable) argument in the function will be mapped, and if the result of the last expression executed in a function is mapped, so is its result.

A+ provides a special syntax that is particularly useful for updating all elements of a mapped file:
     a[]b
and a special syntax that is particularly useful for appending new items to a mapped file:
     a[,]b

Again, see Selective Assignment for definitions of these expressions. Appending items to a mapped file with the latter special sequence is permitted only when enough space already has been allocated for the new items. If not enough space has been allocated, a maxitems error is reported. Such allocation is accomplished with _items ("Items of a Mapped File"). After allocation, the file must be remapped.

On AIX, the workspace size can't be enlarged when there is a file mapped (1 0_dbg{`display;`beam} is nonzero), because A+ requires that the entire workspace be contiguous and AIX requires that all space be taken from one end of the address space; thus, the mapped file blocks workspace enlargement.

When one mapped file is created from another, by ordinary Assignment, the new mapped file has only enough space to contain the data; the value of _items{1;} for the old file is not carried over to the new file.1

Mapped files can be shared by different A+ processes, and all A+ processes on the same machine will immediately see any updates by other A+ processes on that same machine. A+ processes on a different machine, however, may not see the updates immediately, or ever. Whether or not the updates are seen depends on when and if the underlying operating system refreshes certain virtual memory pages. They may be only partly seen when items do not correspond to pages.

When a mapped file is an argument to a defined function, the corresponding local variable is, of course, also a mapped file. If that argument is a global variable, then both variables, global and local, refer to the same file, and therefore can affect each other's values if they have write access to the file. If they have read access only and one variable is used for writing, then it is no longer a mapped file, but this change in its status naturally does not affect the other variable. In short, at the point at which the function is called they are two independent variables referring to the same file.

To obtain just the value of a mapped file, i.e., a copy of the file, the Right function can be used. See the examples below.

The primitive function (Map or Map In, or Beam) is used to create, reference and update mapped files.

   Error Messages

If a Map operation fails, you should get a domain error.  A more specific error message appears in the session log if one is generated by Unix itself.  (The message is not guaranteed to appear, but Unix so reports most problems.)  If the Map is within a protected do, the do result shows the domain error, not the specific error.  To help determine the cause of the failure, you can use sys.errno{} to retrieve the Unix error number, although exactly which system call failed will sometimes be ambiguous.

If an "Operation would block" (or perhaps "interrupted system call") error message is received, it usually means that there has been a temporary network outage or extreme slowdown, so the map operation timed out. Before reporting this problem to the user, A+ makes repeated attempts to carry out the operation, over a period of about a minute. Be aware that such a delay can occur.

If a "not an `a object" error message is received, it may mean that the address space for all mapped files (including atmp) has been exhausted, and that therefore the file header does not agree with the file body. Mortgage files can be especially large, and may contribute to the exhaustion of this 1Gb to 4Gb space.

If a file opened for reading only is "wrong-endian", it is copied into a variable in atmp and a warning message is issued. For writing, including local writing, Beam rejects a "wrong-endian" file.

   Concurrent Reading and Writing of a Mapped File

When two users, A and B, say, map the same NFS file (as A+ variables), A for writing and B only for reading, what B sees when A makes a change depends upon the location of their machines and the file in the network:

  1. A and B are on the same machine and A updates the file in place. B will see the change immediately, regardless of whether B mapped the file before or after A made the change.

  2. A and B are on the same machine and A uses _items and appends to the file before B maps (or remaps) the file. B will see the change immediately.

  3. Like 2, but A uses _items after B maps the file. There is no problem unless A has created a new page and B attempts to reference the new page, in which case B will get a segv error.

  4. Like 1, 2, and 3 except that A and B are on different machines. The results are more or less the same as in those three cases but may be delayed. Unix looks for a page in its cache first, and uses it if it is there. Depending on system activity, a page may remain in the cache even after it has been changed on another machine, as NFS has no way of knowing that the page has been changed. Hence B will see A's change only after the affected old pages are removed from the cache by the system to make way for more recently referenced pages. B can get the new pages by remapping the file before referencing it (and after A's changes), unless A has engaged in the bad practice of changing the file on a machine other than the one on which it resides - in which case any changed pages will have to make their way via NFS to the host machine for the file before users on any other machines see them.

  5. A and B and the file are all on the same machine and A rewrites (remaps) the file. The system creates a new file (a new "inode") and gives it the old name. If anyone has the old copy of the file opened or mapped (the reference count is greater than zero), the system keeps the old file around with the old inode. When B references the mapped variable (without remapping), the reference is by inode and therefore to B's private copy of the old file; A's newly written file is not seen. These old copies take up space on disk and remain until no user has them opened or mapped.

  6. Like 5 except that but B is on a different machine from A and the file, and suppose enough activity has occurred after A rewrote the file to flush the cache in B's machine. A reference to the mapped file by B will produce a "Stale NFS file handle" error report if no one on A's machine has happened to keep the file's reference count above zero and thus preserved the old inode. The system in B's machine has gone looking for an inode that no longer exists (inodes are unique with a domain).

  7. Like 6 except that A renames the file before rewriting (remapping) it (under its original name). Then B sees the old file, as it was before A's actions, even if enough activity has occurred to flush the cache in B's machine, because the old copy of the file, under the old inode, is still around. (For example, files in the mas database that get rewritten are first renamed.)
Warning! An application can crash, with a bus error, if two or more users are writing (not necessarily at the same instant) in the same mapped file. The mapped file mechanism does not mediate independent updates.

   Mapped Files On Remote Machines

Using mapped files across NFS or AFS is problematic for anything other than a simple read, and sometimes even for that. A job which will run on one machine and access data in mapped files on another machine should probably have a server process on the machine where the files are. The application should then submit queries and updates and receive data through an adap connection to that server.

   Map yx

        Arguments
y is an integer and x is a symbol or character string, or y is a symbol or a character string and x is a simple character or numeric array.
        Definition
There are two cases.

When a file is mapped, the Unix command sequence is  open(); mmap(); close().  close() does not unmap the file but does free the file descriptor. When the file is unmapped - by assigning a new value to the variable, expunging the variable, ending the A+ session, or whatever - munmap() is called.

   Map In x

        Argument
x is either a symbol or a character vector.
        Definition
x is equivalent to 0x.

   Examples

     fro0`file    Create a mapping of the file file.m for reading only.
                    If fro is changed, it becomes an unmapped array.
     frw1`file    Create a mapping of file.m for reading and writing.
     frlw2`file   Read and local write: see others' changes; don't show own.
     frw[i]new     Changes in place to frw also modify the file file.m
     frlw[i]new
 1                  Change seen.
     frlw[i]newer  This change will not modify file.m.
     frw[i]newer   Only frlw was modified:
 0                  new and newer are unequal.
     `filearray    Write a simple array as mapped file file.m

     'test.m'0 40   Create a file for a matrix with 0 rows.
      Make the allocation 10 rows. Left argument is the total number of items in the file.
     _items{10;'test.m'}
 0                  Successful allocation: result is the former number of items.
     t1'test.m'   Map the file test.m in read/write mode.
     t
 0 4
     t[,]10 20 30 40     Append a new row.
     t
 1 4
     t[,]1 2 3 4         Append another new row.
     t
 2 4
     t
 10 20 30 40
  1  2  3  4
     _items{1;'test.m'}  Determine number of allocated items.
 10                       Still 10 allocated.
      Make the allocation 20 rows. Left argument is the total number of items in the file.
     _items{20;'test.m'}
 10                   Successful: result is former number of items.
                      Since _items was executed, remap the file test.m
     t1'test.m'
     a1`file        a is a mapped file.
     ba              b is a mapped file.
     ca             c is not a mapped file, but has same current value as a
     f{x;y}:{...}
     f{a;a}          In this invocation of f, arg x is a mapped file and y is not.

Unix Text Files

A simple way to read a Unix text file f is to enter
     msys.readmat{f}
where f is a character vector giving a path name. The file is read into m as a matrix, in which all rows have been made equal in length to the longest row in the file, by appended blanks.

A file can be read as a vector, with newline characters embedded, by a Pipe In command like

    $<FileVarName cat FileName

or by a function such as:

read{file}:{
     if (0>ssys.filesize{file}) 'read failed: ',s;
     as' ';
     fdsys.open{file;`O_RDONLY;0};
     sys.read{fd;a;s};
     sys.close{fd};
     a
     }
Partition Count and Partition () can make the result of such a vector into a nested array of lines.

In this function the local variable s tells sys.read how many characters to read. Clearly, with minor alterations to the code shown, the file can also be read a portion at a time. Moreover, the function sys.lseek can be used to choose a point from which to start reading a portion of the file.

Data can be written to a Unix text file by Pipe Out and Pipe Out Append commands like

	$>FileVarName FileName
	$>>FileVarName FileName
when the data is a character vector with embedded newlines, or by functions like the following, which also convert any character matrix arguments to vectors, deleting trailing blanks and appending newline characters as required:
write{file;data}:{
     if ((`char=data)^2=data) dataclean{data};
     if (0<fdsys.open{file;
                       `O_CREAT`O_TRUNC`O_WRONLY;
                       86 4 4})
        {
        sys.write{fd;data;#data};
        sys.close{fd};
        };
     }

clean{n}:(cleanline<@1 n),<"\n"

cleanline{x}:(-+/^\' '=x)x
You can easily devise variations for yourself, for both reading and writing. For more details, such as the meanings and permissible values of the arguments to the sys functions, see "The sys Context".

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_2.html0000444000265000001440000004010010737165220013545 About The A+ Reference Manual

About This Document, the Online A+ Reference Manual


This manual describes the A+ programming environment. It is intended mainly for reference.

It is recommended that you use Netscape Navigator, Release 4.0 or later. Some portions of these manuals may display incorrectly with other browsers. Be sure you have followed the instructions for displaying the special APL characters, so that you can see this document properly.

Other Sources of A+ Information

Be sure to check the A+ Home Page periodically (www.aplusdev.org). News items will be posted there from time to time. There is also a heading on the A+ Home Page marked "Documentation", which can direct you to some related material, such as tutorials.

Organization of the Manual

Because this manual is intended mostly for reference, the descriptions of the primitive functions, operators, system functions, system variables, and commands are listed alphabetically, by their English names, i.e., names such as Add, Rank, Expunge, Print Precision, and Load. In the text itself, the subheadings include their A+ names also. The attributes are listed alphabetically in the table "Display Attributes", with brief descriptions and links to other text where appropriate.

Among the tables in The "Quick Reference" appendix are four that should be mentioned here. "Primitive Function and Operator Names and Links" lists the symbols for the primitive functions and operators, ordered by category (arithmetical, logical, structural, and so on), gives the corresponding names, and has links to their descriptions. A symbol's dyadic definition has been preferred to its monadic definition where the two would dictate different categories. "System Function Names and Links", "System Variable Names and Links", and "System Command Names and Links" are alphabetized by A+ name and give the corresponding English names, with links.

To find any additional information about an item in a table that does not have a link for it, look up the item in the index.

   The Index

All system commands, system functions, and system variables are listed in their A+ forms in the index under these three headings ("system commands", etc.). They are listed separately under their English names, as well. Primitive functions and operators are each listed under one or more English names. The A+ symbols are listed in the "Symbols" section of the index, and can also be found (with links) in tables in the "Quick Reference" appendix, as already mentioned.

The index includes entries for commonly used alternate names of primitive functions and operators; such an entry includes the name used in this manual, shown in parenthesis, and a link to the section in which the function is defined. The entry constitutes a see reference, while giving you a direct path when all you want is the principal reference for the function. Entries for certain other terms are of this form.

References for an entry are shown as arrows; where there are several, they are separated by commas and the principal one, if any, is indicated by an asterisk following the arrow. For long sections, where a range of pages is shown in the printed version, a link to the end of the section is indicated by "end" following the arrow. Links following "see" or "see also" or "also see" lead to other index entries.

Terms Used in the Manual

   Data Type and General Type

There are seven data types in A+: character, integer, floating point, null, box, symbol, and function. The term integer is always used in this manual in this strict sense, to indicate not only a domain of values but also a particular internal representation, the one identified by the A+ type integer (`int, as the Type function calls it). Integral and integral value also refer to both domain and representation.

The term restricted whole number is used to refer to any representation, integer or floating-point, of a member of the integral domain of values - that is, of a value for which integer internal representation is possible. The floating-point representations in the set of restricted whole numbers need only be equal to integers within the comparison tolerance or be less than 1e-13 in absolute value. See "Representation of Numbers", especially its "Comparison Tolerance" section. (Put another way, a scalar x is a restricted whole number if either (1) x is `int or (2) x is `float and either x is less than 1e-13 or there is a y such that x=y is 1 and y is `int.) The chief significance of this concept, of course, is that any floating-point representation that represents a restricted whole number can always be faithfully coerced to an integer representation. All empty arrays are included in this set, as discussed below.

Many A+ functions and operators take arguments of several types, sometimes with some limitation, and it is convenient to divide A+ data objects into three classes, as they do. These classes are called general types:

  • character, consisting of simple arrays of characters

  • numeric, consisting of simple arrays, unrestricted as to value, of floating-point numbers and integers

  • mixed, containing all other data, namely
    • simple arrays of functions and symbols
    • all nested arrays: box, function, and symbol
Because the set of restricted whole numbers and the general types are used mostly to indicate inclusion in the domains of functions, and because most functions accept empty arrays of any type, all empty arrays are included in the definition of restricted whole numbers and in each general type. For efficiency, the (empty) result of a mathematical function for a Null is whatever is most convenient for the function: Null, integer, or floating point.

These words are used in the obvious ways, such as in the terms symbol array or symbolic array or array of symbols, meaning an array every element of which has data type symbol, and numeric array, meaning an array that has no elements or has only elements whose data type is integer or has only elements whose data type is floating point. The more elaborate term array of type symbol, on the other hand, means only that the first item of the array is of type symbol - i.e., the first item of the first item of ... the first item is a symbol; the other items of the array can be of types symbol, function, or box.

   Index Origin

A+ enumerates lists and whatnot using the integers 0, 1, 2, ...; that is to say, A+ employs 0-origin indexing. This manual uses i-th, for any letter i, in the same sense, to agree with A+. The words first, second, third, and so on, however, are intended to convey their ordinary English meanings. Hence if an element of some list is spoken of as the third element and also as the n-th element, then n has the value 2. Digits are never used in such a construction: 0-th, 2-th, and so forth never appear again in this manual.

   Comparison; Tolerably Equal

A+ makes some comparisons using a tolerance. See "Representation of Numbers", especially its "Comparison Tolerance" section. When two objects are equal within the tolerance, they are called tolerably equal. This term is also used in a more general way, to mean equal within the tolerance for those objects to which the tolerance applies and strictly equal for all others. Tolerably equal is said only with regard to comparisons that employ the tolerance under some circumstances.

   Names and Values

If the name x has the value 2 associated with it, one normally says simply that x is 2. This manual follows that or a similar usage, usually even in more complicated cases. For example, suppose g is the name of a function and the value associated with x is `g, the symbol form of the name g; the manual may simply say that x is a function. If x has the value "`g", which is a character string that gives the display form of the symbol form of the name g, the manual may simply say that x names g when, say, x is an argument and its role is to supply the name of a function.

Notation

The conventions adopted for the use of the APL font, capitalization, backquote, and quotation marks in this book are intended to promote simplicity, readability, and clarity.

   Font Usage

APL font (Kapl) is used as described under the heading "APL Font".

Bold Courier is used for commands and text that you must enter literally, wherever APL font is not appropriate.

Light Courier is used for filenames, pathnames, utilities, Unix commands and command-line options, environment variables, prompts, and so on, wherever neither Bold Courier nor APL font is appropriate, as in
  for(i=0;i<n;++i) result->p[i]=ic(aobj);
or "This function uses the system call ioctl()".

Italic is generally used for variable text that you must enter: e.g.,
"$load filename",
indicating that you must enter the A+ $load command followed by the name of a file, or
"Enter
emacs filename"
to indicate that you must enter the Unix emacs command followed by the name of a file.

Bold Times Roman (or the bold weight of whatever proportional font you have selected) is used for keys and screen (GUI) elements, such as the Shift key, the combination Shift-left-arrow, and the Options menu.

   APL Font

  1. The A+ names of system variables and functions, A+ commands, A+ defined functions and variables, and the s functions (the screen management functions is, show, etc.) and, of course, the A+ primitive function and operator symbols appear in APL font.

  2. All multicomponent A+ expressions appear in APL font, except that `name and 'name' sometimes appear as just name, in ordinary text font, as discussed below.

  3. The A+ keywords (if, do, etc.) appear in APL font in multicomponent A+ expressions, as required by (2), but are shown in ordinary text font elsewhere - here, for instance.

  4. Numbers normally appear in ordinary text font. APL font is used for them, however, in these cases:

    • the number is part of a larger A+ expression, so rule (2) applies;
    • the number is explicitly an entry or display in an A+ session;
    • the same number or an associated number occurs nearby in a setting that requires APL font, so consistency dictates the use of that font;
    • the number is expressed in a form peculiar to A+ (as distinct from mathematics or ordinary English), as in 2.78e-4.

  5. Names of attributes (for screen management) and names of the values that attributes can have are normally set in ordinary text font when they occur alone, but where a particular value is being explicitly given for an attribute, as in the "Default" column of a table, it may appear in APL font, together with a backquote or quotation marks, e.g., `center, 'kaplgallant'.

   Backquote

The backquote (`) is used only for system variables and where the context explicitly requires a symbol. Thus, in the "Attribute" column of a table, only names appear (e.g., titlefg), and of course the response to "show `b" is described as "b is displayed."

   Capitalization

The English names of the A+ primitive functions and operators, as contrasted to their symbols, and of the system functions, variables, and commands always appear in ordinary text font, with an uppercase initial letter and sometimes another uppercase initial: Plus, Grade up, Pi times, Natural log, Value in Context, Less than or Equal to, Inner Product, Set Attribute, Random Link, Global Objects, and so on.

Note: Many names here, such as OLWM, Unix, Sparc, RS/6000, Helvetica, Times, and Palatino, are trademarks or registered trademarks. Except occasionally for font names, initial uppercase letters have been used for those names believed to be trademarks.

Your Questions and Comments

Questions, comments, and corrections are welcome. Please email them to doc@aplusdev, or, if the subject is of general interest or you seek a wider response, to aplus@aplusdev.org.

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_20.html0000444000265000001440000002156010737165221013637 A+ Reference: Timing A+ Functions

Timing A+ Functions


Time  time s, or time(), or time expression, or time{}

   Argument and Result
In the four expressions above, the argument is, respectively, explicitly one or more scalar symbols (not an expression whose value is a scalar symbol or vector of scalar symbols), the Null expressed as a pair of parentheses, some other expression, or absent. The result is a vector that is numeric, symbol, nested, or Null.
   Definition
The effect of time is to set or reset a timer, or to return the results of a timer. All timing information is expressed in milliseconds. In the descriptions that follow, system time refers to the cpu time spent in system calls made by the A+ processor, user time refers to the cpu time spent by the A+ processor directly, and elapsed time is clock time (you will notice it increasing even when you are doing nothing).

When you are timing any code whose execution time is even moderately short, you should use a dyadic do statement to execute the code many times, and take an average. Doing so mitigates any imprecision in the timing and allows for circumstances, like timeslicing, that can vary for the same code.

Timings will generally be different for the same code with different data, being affected by type, size, nesting, and so on. One method of accomplishing something may have a substantial fixed cost but be relatively insensitive to the size of the data, whereas another may have little fixed cost but a strong dependency on size. You should time the various cases that can be expected to arise, so that you can determine which method is best for your expected distribution of cases. It may turn out that you will want to include several methods and choose among them during execution.

time is not a true function, although it has function like attributes. Specifically, if time were a true function then the two expressions time{} and time() could not both be syntactically correct, because the former indicates that time is niladic and the latter monadic. However, both are valid A+ expressions. See the table "Timer Expressions and Their Meanings" for a description of all valid timer expressions. Although its name does not start with an underbar, time is always available, like a system function.

Timer Expressions and Their Meanings
ExpressionEffectResult
time expression Time the indicated A+ expression. 3-element numeric vector of user, system, elapsed time used to evaluate expression.
time s Set the timer for the functions named by the symbols in s. Any external and system functions named in s are ignored. If a function is redefined, the timer switches to the new definition. s, a vector of symbols. Including external or system functions in s may cause a bus error in some releases.
time{}    following    time s Return timer results. 2-element nested vector (s;matrix), explained below.
time{}    otherwise Return timer results. 3-element numeric vector of user, system, elapsed time since the current session began.
time () Reset the timer, i.e., undo the effect of time s. Null.

Result (s; matrix) of time s Explained
ExpressionMeaning
matrix[i+1;0] The number of times the function named in i#s was called.
matrix[i+1;1] Total user time spent in the function named in i#s exclusive of others being timed.
matrix[i+1;2] Total system time spent in the function named in i#s exclusive of others being timed.
matrix[i+1;3] Total elapsed time spent in the function named in i#s exclusive of others being timed.
matrix[0;0] 0 (meaningless - just filler).
matrix[0;1] User time spent outside all functions named in s.
matrix[0;2] System time spent outside all functions named in s.
matrix[0;3] Elapsed time spent outside all functions named in s.
+/matrix[;1] Total user time since time s was executed.
+/matrix[;2] Total system time since time s was executed.
+/matrix[;3] Total elapsed time since time s was executed.

   Examples

    f n:{n do 3;}                  Don't need to see explicit results.
    m g n:{m do f n;}
    time `f `g                     Set timers for f and g
    100 g 10                       Call g and, from g, call f
    1000 g 5                       Call g again.
    10000 do 2+3                   A call outside g
    time{}
<  `f `g
<     0  160    0 7080     160 ms user, 0 system, 7080 elapsed not in f or g
   1100  100  110  230     f: 1100 calls; 100 ms user, 110 system, 230 elapsed.
      2   90  130  250     g: 2 calls; 90 ms user, 130 system, 250 elapsed.

    time ()                        Clear timer.
    time{}
 500 580 20110       500 ms user, 580 system, 20,110 elapsed from the beginning.

    sf(`a`b`c`d`e`f`g`h`i `j `k `l `m `n;
        (1;2;3;4;5;6;7;8;9;10;11;12;13;14))
    s1000(0sf),`o    Includes an invalid index for the slotfiller just defined.

    time (j999) do r 0's[j]sf'
 810 100 920      Times for avoiding index errors by an  Protected Execute.

    time (j999) do r do s[j]sf
 170 70 240       Times for avoiding index errors by a do Protected Execute.

    time (j999) do r {i(0sf)s[j];if (i<#0sf) i1sf}
 300 0 310        Times for avoiding index errors by mimicking symbolic indexing.

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_21.html0000444000265000001440000021004410743450511013631 A+ Reference: Introduction to Screen Management

Introduction to Screen Management


Getting Started

A+ provides a straightforward, easy to understand scheme for visually representing variables in a variety of ways, including graphs. Compound representations can be formed for collections of variables and used as screen interfaces for applications. The connection between the values of A+ variables and their visual representations is maintained by A+ so that the two are always in agreement: a change to the value of a variable will be immediately visible on the screen, and a change to the screen will be immediately reflected in the value of the appropriate variable. (If, however, a mapped file is displayed in one process and a change to that file is made in another process, the change will not be reflected automatically in the display, since the displaying process is not notified of changes made to the file in other processes.) As a simple example, consider:
     $load s    All the screen management functions are in s;
     b2 3     the principal six are loaded into the root context also.
     `b is `array
     show `b
Run this example and you will see a display of the array b on the screen. Change a number on the screen and then examine the value of b in the A+ session; it has changed accordingly. Change an element of b and note the corresponding change to the screen display. And the same consistency between the view of b on the screen and value of b in the A+ session is maintained for any visual representation of b, even a graph. Not only are changes to values reflected in changes to graphs, but when points on a graph are dragged to new positions, values change accordingly.

(At various points throughout this chapter examples of visual displays will be discussed, and it is assumed that the reader is actually running these examples and has the displays available for reference. There are tutorial scripts available under the "Tutorials" item on the "On-Line Documents" section of the home page. They are ASCII text files; use Emacs to access them and the F2 key to execute the lines of code in them.)

The phrase `b is `array in the above example specifies the way in which the variable b will be visually represented, in the display format called array. Array is said to be the name of a class of A+ objects. It is also said that:

The term object b refers to a variable b which has been bound to a class. The terms visual class and display class will be used for class when the emphasis is useful.

Not all variables can be bound to the array class, and usually there is more than one class to which a variable can be bound (but it can be bound to only one class at a time). Each class has it own visual appearance. For example, a character vector can be in the array class:

     c"Visual Displays"
     `c is `array
     show `c
or in the label class:
     d"Visual Displays"
     `d is `label
     show `d
A numeric matrix, however, which can be bound to the array class, cannot be bound to the label class.
     m2 3
     `m is `label
     !!  .m: variable cannot be bound to label
There are several display classes of compound, or container, objects, by which complex displays can be created by arranging collections of objects of simpler classes. The layout display class is one of these.
     w()         Initialize a layout.
     `w is `layout
 `.w
     x"Array Format"
     `x is `label
 `.x
     ww,`x       Add label to layout; context assumed same as container's.
     y2 4
     `y is `array
 `.y
     ww,`y        Add an array to the layout.
     show `w
The display of w should suggest the potential power of the layout class, but it also reveals some characteristics of displays that one might like to modify. For instance, in this example the values of x and y may convey all the information needed, and so it is preferable to remove the variable names y and w from the display. The characteristics that can be modified are called the attributes of the display class. Each class has its own set of attributes; some are shared with other classes, while others are specific to that class.

Continuing with the above example, the variable names, y and w, are the default values of the attribute called title, which is an attribute of both the array and layout classes. A new title can be specified by modifying this attribute:

     `w has (`title;"New Title")
Or the title can be removed by specifying it to be empty:
     `w has (`title;"")
Similarly, the title can be removed from the object y:
     `y has (`title;"")
Just as attributes can be altered, their current values can be determined. For instance, to find out what background color is used for the label in the above example:
     `bg of `x
<  `grey
And to change it:
     `x has (`bg;`yellow)
Another way to alter the behavior of the screen management system is to redefine various global variables in the s context. These variables are discussed at the appropriate places throughout the chapters that follow; in particular, see "
The s Context".

There are now several displays on the screen, and in an application one might want to control potential screen clutter by specifying what is seen and unseen. A+ provides two functions for doing that. It is possible to hide one or more of the displays, perhaps replacing them with icons:

     hide `w
The hide function is an inverse of show. There is also an inverse to the class-binding function is, called free, that releases an object from its specified class and has the side effect of removing its display from the screen:
     free `d
Note that in the case of hide `w, the variable w is still bound to the display class layout; it is simply not visible. Showing w again and getting back the original display verifies this:
     show `w
However, in the case of free `d the variable d is no longer in the label display class; if the variable d is shown again it will be bound to the array class by default, and its display will look different from before:
     show `d
    .d: variable bound to `array
All the basic primitive functions for visual representation, namely is, free, show, hide, of, and has, have now been shown. (These functions are put in both the root and the s contexts by $load s.) Examples have been shown of several display classes, namely array, label, and layout, and two attributes, title and bg (background color). Complete definitions are given in "
Display Classes", and in the chapters that follow.

Controlling Which Screen the Windows Are Displayed On

A+ does not (yet, at least) provide a means to let a single process write to several X displays. You can, however, choose which display your s windows appear on. If, for example, your machine, "mymachine", say, has two displays and you want to show your s windows on the second of them, you can execute
     sys.setenv{"DISPLAY=mymachine:0.1"}
     $load s
Note that you must set DISPLAY before you load s.

Default Behavior

The primitives for visual display often report information in the A+ session when executed, such as binding class assumptions. This information has been mostly left out of the simulated terminal sessions shown here. Whether or not messages appear is controlled by the s context variable s.QUIET. The default value is 0, which causes all messages to be printed. The value 1 causes only error messages to be printed, suppressing any warning or informational messages, and 2 only messages for severe errors. No messages are printed if the value is -1. In addition, the behavior of s context functions when errors occur is controlled by the s context variable s.ABORT, whose default value is 1, meaning that error messages will be displayed (if s.QUIET allows) and function execution will simply end when error conditions arise. The value 0 means that errors will be signalled and execution suspended (see "Signal").

   Example 1. Manipulating Layouts

If you are executing the above layout example, at this point you should have on the screen a label object x and an array object y inside a layout object w. Now append a view object to w. (A view is simply a character matrix.)
     s`name `address `phone
     `s is `view
     ww,`s
     show `s
It is worthwhile to experiment with respecifying w as `s `y, then as `y `s `x, and so on, watching the changes on the screen. In particular, you will note that as objects are removed from w they remain on the screen. This behavior, which is the same for tables, graphs, and windows, is controlled by two s context variables, s.AUTOREPARENT and s.AUTORESHOW, both with default value 1. For example, if
     w1w
the object that was named in w[0], say x, is redisplayed outside the layout. However, if s.AUTORESHOW had been 0 then x would not have been redisplayed. It would, however, have remained bound to the label class. If s.AUTOREPARENT had been 0, then x would have been freed from the label class (and consequently not displayed).

As you proceed with the experiment you may notice that the relative positions of x, y, and s on the screen are not necessarily related to the arrangement of these names in the variable w. The geometry of the layout can be controlled by specifying w as a matrix or a nested array. For example, to put x on the left, y in the middle, and s on the right, set

     w1 3`x `y `s
Or, to put `y above `x and `x above `s, set
     w3 1`y `x `s
Or, to put y to the left of s and x above them both, set
     w`x,1 2`y `s
or
     w(`x;`y `s)
A layout can also be composed on the screen. Set w to Null, so that all the objects that were contained in it will be shown on the screen as independent displays:
     w()
Reset x, y, and s to their original display classes if necessary. Move the displays around so you can see them all, and then move them into an agreeable arrangement. For example, make s larger and x smaller, put x next to y, and s on top of them both. Now set
     `w has (`build;1)      Or s.AUTOBUILD1
     w`x `y `s
The independent objects have now been captured in a layout reflecting their independent arrangement on the screen, and their displays have been replaced with the layout display.

Once a display has been arranged to your liking, it can be saved and redisplayed later using the s context functions s.save and s.load. For example,

     s.save 'testfile.+'
will save all objects created in this session, including the layout w, in the file testfile. Then if the arrays x, y, and s are recreated in some future session, the layout can be recreated and redisplayed as follows:
     s.load 'testfile'
More details can be found in "
Layouts, Geometry, Constraints".

   Example 2. A Text-Graph Dependency

As a second example, consider devising a display with a text input area and a graph area, so that when an expression for a scalar function is entered in the text area, its graph appears. Set
     xc0.11000
Functional expressions can be captured on the screen by a scalar object. For example:
     fn20' '
     show `fn is `scalar
The value area of a scalar can be edited. Move the mouse onto the blank area to the right of the text fn, enter 1xc (i.e., sine of xc), and press the Enter key. Now examine fn and you will see that this expression has been captured.

A trace for a graph of this expression is a two-column matrix, with the domain to the left of the range. To make the trace a dependency on xc and fn (or rather the expression in it):

     tr:xc(,@0)fn
     tr
 1000 2
Now put the graph on the screen:
     g`tr
     show `g is `graph
Quite possibly the graph display has covered the scalar display. Move it so that you can see both. Now enter another expression in the slot. The graph will change automatically and immediately because it displays the value of the dependency tr on the screen. Finally, these two independent displays can be put in a layout:
     l(`fn;`g)
     show `l is `layout

   Default Class Binding

If a global variable or dependency is not bound to a display class and its name is used as the argument to show or as the left argument to the screen management primitive function has when the right argument contains a nonpersistent attribute (see "Persistent Attributes (key = p)"), it will be bound to its default display class1.

The default display class of an object is determined according to the following rules, which are applied in order:

  1. 0 is bound to class array and the Null to class scalar;

  2. if the variable is of type box, attempt to bind it to class radio, and if that fails try class check, and so on through the list of slot, layout, array, scalar (any object can be bound to class scalar);

  3. if it is of type function, bind it to class button;

  4. if it is a matrix, attempt to bind it, in order, to class layout, array, scalar;

  5. if it is a vector, attempt to bind it, in order, to class table, graph, layout, array, scalar;

  6. bind it to class scalar.
Children (see next section) of a table object are always bound to the tableField class and children of a graph are always bound to the graphTrace class.

Display Classes

The descriptions in the following chapters assume default values for the attributes of the display classes. In particular, whenever a display class has a title area, the name of the variable bound to the class is displayed there. Settings other than defaults are controlled by the attributes of the various classes, which are described in the several chapters on attributes as well as in the chapters on the various classes. The classes can be grouped in seven categories:
  • simple classes for displaying individual global variables: array, hgauge, label, matrix, page, scalar, vgauge, and view;

  • classes for entry: command, hscale, password, text, and vscale;

  • the class for functions: button;

  • classes for slotfillers: action, check, choice, hmenu, radio, slot, tree, and vmenu;

  • general container classes, which consist of objects made up of other objects: hgrid, hpane, layout, notebook, vgrid, vpane, and window;

  • special container classes: table and graph, and their special contained classes, tableField and graphTrace;

  • the class for printing reports: report, which cannot actually be displayed.
The objects that can be bound to container classes are variables whose values consist of collections of other objects. For example, in this chapter the value of the layout object w ended up as `x `y, where x is a label object and y is an array object. An object bound to a container class is said to be a parent of the objects named in its value, and these objects are said to be children of the parent. The children of a child are also children of its parent. In A+, no object can be a child (or parent) of itself.

When a child is bound to a container class, its context need not be given if it is the same as the parent's, because the same context is assumed. Different contexts are accommodated by qualifying the child's name.

Entering and Editing Information on the Screen

A+ provides a very simple scheme for entering and editing on the screen. Not all display classes are designed for entering and editing, but those that are all use this same scheme. The way the area to be edited is identified does vary, however, and so this point is discussed first. (A more detailed account can be found in "User Interactions with Displays".)

   Traversal: Activating the Area for Input or Editing

The screen is composed of a series of windows, and to enable keyboard entry the one that holds the area for input or editing must be selected. The usual way to do this is simply to move the mouse pointer onto that window. The appearance of the window will change to indicate that it now has keyboard focus, such as by a change in the background of the title area at the very top of the window.

Assuming that this is a window created by the screen management system, it must have been the result of executing show `a for some object `a. Depending upon the display class of `a, the editing state will be different:

  • If `a is bound to the `scalar display class, a highlight band will be displayed around it and you can begin entry or editing.

  • If `a is bound to the `slot display class, it will look like a collection of scalars, and one of the scalar lookalikes will have a highlight band around. If you want to work in some other area in the slot, use the Tab key or arrow keys to move to it.

  • If `a is bound to the `array, `table, or `matrix display class, a highlight band will appear around the object, not around an individual row or cell. Press the left mouse button when the mouse pointer is in one its rows or cells, and that row or cell will then appear raised. It is called the selected row or cell. If you want to enter or edit some other row or cell, use the Tab key or arrow keys to move to it.

  • If `a is bound to the `layout display class, one of the objects in it will have keyboard focus, as indicated in the previous descriptions. Use Meta-Tab on Sun keyboards and Alt-Tab on IBM keyboards to move around the layout until the object you want has keyboard focus. You can also move the pointer onto the area you want and press the left mouse button to get keyboard focus on that area.

   Input and Editing

Once the row or cell you want has been selected, you can simply start typing to enter input; input mode begins automatically on the first key stroke. Edit mode is ended for that row or cell and the input is sent to the appropriate A+ variable when the Enter key is pressed, or the Tab key, Meta-Tab on a Sun keyboard or Alt-Tab on an IBM keyboard, or an arrow key is used to move to another row or cell.

There are actually three input modes: complete replacement, overwriting, and insertion. When input mode is entered by starting to type, anything previously displayed in the input area is lost; it is completely replaced. If the mouse pointer is on a character in the area to be edited and the middle or right mouse button is pressed, the area takes on the appearance of edit mode and the keyboard focus is on that character. If it is the middle button that is pressed, anything entered overwrites the existing text, starting at that character. If it is the right button that is pressed, anything entered is inserted just to the left of that character.

Windows

A+ windows are tree structures of bound variables. A bound variable is often referred to as an object. For example, in the window consisting of a layout m containing a scalar s, a table t of fields a, b, and c, and a button f:
     abc10
     t`a`b`c
     s101
     foo{s;c;v}:'pressed'
     f<{foo}
     `t is `table
     `s is `scalar
     `f is `button
     m(`s;`f;`t)
     `m is `layout
     show `m
there are seven objects:
       m           `layout
           s           `scalar
           f           `button
           t           `table
               a           `tableField
               b           `tableField
               c           `tableField

     `descendents of `m
<  `.t `.s `.f `.a `.b `.c

   Toplevels and Popups

An A+ process will usually contain several windows. The windows in a process also form a tree. For example, continue the example above by creating three more arrays:
     v1v2v310
     `v1 `v2 `v3 is `array
     show `v1 `v2 `v3
The first thing to note is that the control borders of m and the v-arrays are different. m is a top-level window and the v-arrays are popup windows. The default shelltitle of m is the value of _argv, if it is nonnull, or "A+", and those of the v-arrays are "v1", "v2", and "v3".

   There Is Normally at Most One Toplevel

An A+ process normally has at most one top-level window. By default, this property - top-level windowhood - is given to the first object bound. In the above example, it is t:
     `t is `table           First object bound.
Subsequently bound objects which do not contain t are created as popups. Finally, when a container for t is bound:
     `m is `layout          Layout containing t
the property of top-level windowhood is passed to m.

This can be demonstrated by creating a new layout n containing m.

     n`m `v1
     `n is `layout
     show `n
Top-level windowhood is given to n, since n contains m.

Note that this property can be lost:

     n()                   m reparented to popup.
     free `n                Toplevel freed.
All windows are now popups.

   The Workspace

When the A+ process has a top-level window x, that top-level window is called the workspace of that process. It usually has the shelltitle "A+".

   The Workspace Variable s.WS

The variable s.WS is either () (there is no workspace for the process) or `cx `var, where cx.var is the top-level window. s.WS can be assigned the symbol of any popup window in the process, and no matter what the form in the assignment, fully qualified name, context and unqualified name, or (for the root context) just unqualified name, the value of s.WS will be a two-element symbol vector. Continuing the above example, we can restore the property of top-level windowhood to m:
     s.WS`m
     s.WS
 ` `m

   The Screen Management Function hide{}

The function hide{} dismisses a popup window if its pin is in the 0 state. That is, hide{} will not dismiss a pinned window.

   The `exit Callback

Quitting from a top-level window causes a quit event; dismissing a popup window causes a dismiss event: generically, an `exit event. The default `exit callback function frees a toplevel and hides an unpinned popup. This callback can be reset:
     `popup has (`exit;my.dismiss)
     `top has (`exit;my.quit)

   Leaders and Followers

Construct a set of windows:
     abcde3
     show`a`b`c`d`e
The workspace is a:
     s.WS
 ` `a
b, c, d, and e are popup windows.

Now hide the workspace:

     hide `a
Notice that if they are unpinned the popups "follow" a into hiding.

Now, show the workspace:

     show `a
The popups follow a back into visibility.

Now pin one of the windows, say b, and hide the workspace again. This time, b remains visible.

By default, all popups follow the workspace:

     `followers of `a
< `.b `.c `.d `.e
     `leader of `b
< `.a
     `leader of `c
< `.a
Note that
     `x has `leader `x
is equivalent to
     s.WS`x
I.e., only the workspace follows itself.

Also note that

     `x has (`leader;)
causes x to follow the workspace if there is one. Otherwise, it has the same effect as
     `x has `leader `x

   Follower Trees

More complex hierarchies are possible:
     `c has `leader `b
     `followers of `a
< `.b `.d `.e
     `followers of `b
< `.c
A convenient form for describing the whole leader-follower tree of a process is a nested slotfiller:
     k0    `followertree of `a
<  `.a
< < <  `.e `.d `.b
  < <
    <
    < <  `.c
    < <
     `.a `.bk
<  `.c
< <

   The `iconic Attribute

Any popup window can be converted to a toplevel, and vice versa. For example:
     ab10
     show `a is `array     First object is toplevel.
     show `b is `array     Subsequent objects are popups.
     `b has (`iconic;1)    Convert to toplevel.
     `b has (`iconic;0)    Convert back to popup.

   s.WSNAME Contains the Workspace Shelltitle

By default, the shelltitle on the workspace is either 01_argv, or "A+" if _argv is Null. The default workspace shelltitle can be set to an arbitrary string:
     s.WSNAME"y Application"

   s.SHELL Determines whether Windows are Top-level or Popup.

The first object bound is a toplevel, the workspace; subsequent objects are popup windows. This behavior can be altered at any point by changing the value of the global variable s.SHELL:
     s.SHELL
 1                   1 means popup window.
     show 10         First object bound is a toplevel.
     show 10         Subsequent objects depend on s.SHELL
     s.SHELL0        0 means top-level window.
     show 10         This is a top-level window.

   The s.wstree{sym} Function

This function creates a nested slotfiller dependency which represents the window hierarchy:
     s.wstree{`my.var}
     show `my.var is `tree
The default assignment callback function on my.var shows and raises the selected window. (When a window is raised, wherever it overlaps another window it is shown and the other window is obscured.)

Layouts, Geometry, Constraints

   Containers

A+ windows are trees of screen objects. An A+ screen object is an A+ variable bound to a display class. E.g.,
     a10               A variable
     `a is `array        bound to array display class.
The A+ display classes are of two kinds: data and container. Typically, an A+ window will consist of a container with children, some of which may in turn be containers. All objects at the leaves are data objects, which are childless.

There are eight container classes in A+: table, graph, window, layout, hpane, vpane, hgrid, and vgrid. The following sections explain how to use layouts to create geometry - pictorial structure - in a window tree.

   Layouts

A layout m is a structure of virtual rows and columns. The position of an object p in a layout can be specified by four numbers, called the at of p (in m):
    virtual row
    virtual column
    number of virtual rows spanned
    number of virtual columns spanned.
E.g.,
     `at of `p
< 1 2 1 4
indicates that p is at row 1, column 2, and spans one row and four columns.

Ultimately, all methods of positioning objects in layouts reduce to that of specifying the at of the object.

   The Natural Size of Objects

Every A+ screen object has a natural size. The natural size of an object is a function of its data, font, and other attributes, which might be specific to the object. For example, the natural size of an array class object is a function of the shape of the data, the width of the formatted data, the font, and the settings of the rows and columns attributes for the object. The natural size of a container is a function of the natural sizes of its children and their arrangement within the container. Natural size can always be expressed in pixels (xs and ys).

   The Structure of a Layout

The Simple Symbolic Vector Form

The structure of an A+ layout, as it is manifested on the screen, is a function of the array which is bound to that layout. That is, a layout m containing children a, b, and c is a variable m containing the symbols `a, `b, and `c. In the simplest case, m is just:

example     

     m`a `b `c
which represents vertical stacking of a, b, and c, with at of:
     >0ء`at ofm
 0 0 1 1
 1 0 1 1
 2 0 1 1

Simple symbolic vectors are ambiguous representations. Two attributes control the interpretation of a simple symbolic vector:

  • build:
    if 1, approximate the current arrangement of a, b, and c on the screen;
    if 0, use the default arrangement for `a`b`c, taking the position attribute into account;

  • position (effective when build is 0):
    if 1, place `a`b`c in a vertical column (equivalent to (`a;`b;`c));
    if 0, position each of them at 0 0 for 1 1 (stacked one atop another).
That is, if build is set to 0, then m (i.e., `a`b`c) is taken to represent the geometry of the layout, with the orientation depending on the position attribute. To be effective, position must be set before the layout is built, when m is (), say.

If build is set to 1, a, b, and c retain the same relative positions and sizes when they are orphaned ("zero parented").

     `m has (`build;0; `position;0)  m()
     `m is `layout  m`a`b`c
     >0ء`at ofm
 0 0 1 1
 0 0 1 1
 0 0 1 1

The Nested Vector Form

The simplest method of representing geometry is confined to depth 1 vectors of symbolic vectors. Each symbolic vector in a variable of this form represents a new virtual row of the layout. E.g.,

example     
     m(`a `b;`c `d;`e `f)
     `m is `layout
     >0ء`at ofm
 0 0 1 1
 0 1 1 1
 1 0 1 1
 1 1 1 1
 2 0 1 1
 2 1 1 1
giving the representation shown. Each object spans exactly one row and column; each vector in m represents one virtual row of the layout. (Hence, the ";" in the expression above can be read as a sort of virtual "new line" character.)

     The Span of Objects
This nested vector form works fine in the case where the same number of objects is found on each virtual row of the layout, but what about the case where each row contains a different number of objects? For example,

example     
     m(`a `b;`c;`d `e `f)
In this case, c is meant to span the entire width of the structure, a and b half each, and d, e, and f a third each, as shown, with at of:
     >0ء`at ofm
 0 0 1 3
 0 3 1 3
 1 0 1 6
 2 0 1 2
 2 2 1 2
 2 4 1 2
The total number of virtual columns is the least common multiple of the number of objects in each row.

Note that symbols can appear exactly once in a form of this type, and that depth and rank must be less than or equal to 1, and that the simple symbolic vector v is treated as ۡv.

The Simple Matrix, or Canonical Form

Only certain geometries can be represented using vectors of vectors, namely, those in which row-span is one for all objects. Consider the case in which buttons a and b and table t have the following spatial arrangement:
          a  t
          b  t
a and b are located on successive rows, and t spans both rows. In order to describe this arrangement, we use the canonical A+ notation for layout geometry:
     m2 2`a `t `b `t
which precisely pictures the arrangement described above:
     !@1 m
 at
 bt
The rules of canonical representation are more intuitive than accurate formalization would suggest: where uunique{,m} is the vector of unique symbols in m, there must be a rank 2 subarray mim[j;k] for each u[i] in which all occurrences of u[i] in m are found and no occurrences of any other element of u, and the shape of mi specifies the number of virtual rows and columns spanned by u[i]. Hence, neither of the following counts as a canonical representation:
     2 2`a`t`t`b
     2 2`a`a`a`b
Note that any layout array in nested vector form can be translated into canonical form. E.g.,
     m(`a;`b `c;`d `e `f)
     n3 6`a`a`a`a`a`a`b`b`b`c`c`c`d`d`e`e`f`f
represent the same geometry.
     The Placeholder in Simple Matrix Layouts
Consider the geometry of three objects, a, b, and c, which are to be arranged in a rectangle whose lower left quadrant is intended to be "empty". That is:

example     
     >0ء`at of`a`b`c
 0 0 1 1
 0 1 1 1
 1 1 1 1
To obtain this geometry, use the "placeholder" symbol "`" in the layout variable:
     m(`a `b;` `c)
allowing the c object to span a single column, as shown.

Note that ` is not the symbol of any object.

The Nested Matrix Form

Consider the array m:
  abcdefgh3
  m2 2<()
  m[0;0]<2 1`a`b
  m[0;1]<1 2`c`d
  m[1;1]<4 1`e`f`g`h
m is a 2x2 array of symbolic matrices, where the shapes of the submatrices implicitly specify the relative spans of their children, as shown.
  `m is `layout
   >0ء`at of,,m
 0 0 1 1
 1 0 1 1
 0 1 2 1
 0 2 2 1
 2 1 1 2
 3 1 1 2
 4 1 1 2
 5 1 1 2

example

The ability to manipulate blocks of objects without the intervening step of assigning to a global variable can be extremely convenient in applications with dynamic structures. Thus:

     wxyz3
     r1 2(`w `x;2 1`y `z)
     m[1;0]<r

example

The display of m is modified as shown; note how () is replaced wholesale by the arbitrary structure containing w, x, y, and z.

     >0ء`at ofء,,,m
 0 0 1 3
 1 0 1 3
 0 3 2 1
 0 4 2 1
 2 0 4 1
 2 1 4 1
 2 2 2 1
 4 2 2 1
 2 3 1 2
 3 3 1 2
 4 3 1 2
 5 3 1 2
The placeholder can be restored or another variable inserted:
     m[1;0]<()

example

     v3
     m[1;0]<3 1`v

example

with the results shown. The compactness shown in previous figures can be obtained by freeing m and then rebinding it after inserting the placeholder or variable.

   Constraints on Resizing Objects

Objects can be resized in either of two ways: directly, by specifying values for certain size-dependent attributes (e.g., font, or rows or cols); or indirectly, by resizing the object's container. E.g.,

example     
     a10
     b`a
     show `b is `layout
The natural size of the array-class object a is determined by (among other things) the default number of rows displayed, which in this case is:
     `rows of `a
<  5

example      Now grab the frame of the window with the mouse and pull down until eight rows of a are exposed.
     `rows of `a
<  8
This should look pretty much the same as executing the code
     `a has (`rows;8)
Intuitively, however, they seem to be quite different. In the first case, the size of a is a function of the size of its parent b, while in the second case, the size of b is a function of the size of its child a.

Since the second case will only arise when the program explicitly sets an attribute, there is no real need to constrain or control that kind of resizing. But in the first case, you might want to keep a from being resized no matter what the user does to change the size of b. In this example, you will want to set the "don't grow in height" constraint on a:

example     
     `a has (`resize;'H')
As the window b is resized, a will hang on to its five-row display, centering itself in b-space.

What is actually going on, and what will help in understanding some of the examples to come, is this: suppose you stretch b to include 100 additional height pixels. The layout receives the message
"distribute 100 additional pixels over your rows"
in response to which it expands its only row by 100 pixels. The row of the layout then sends to each of its children - in this case, just a -
"grow by 100 additional pixels"
But a is H-constrained, and refuses to comply.

Consider the case:

example     
     ab10
     c<`a`b
     `a has (`resize;'H')
     show `c is `layout
In this example, only a is constrained. Resizing the layout c has the effect of giving extra space to the sole row of c, which in turn has the effect of giving extra space to each child in that row. Array a rejects the space while b accepts it.

In an example involving more than one row:

example     
     abc10
     d(`a;`b;`c)
     show `d is `layout
Resizing d 300 pixels larger will cause d to send three messages, one to each of its rows:
"grow by 3003 additional pixels"
which in turn causes each row to send to its child the message to grow by that amount. In this case, all three children will expand. But if we were to set the H-constraint on b:
     `b has (`resize;'H')
then we would see that a and c each take their share of the extra space, but b does not, as shown.

The "H" attribute is paired with one for constraining width, called, appropriately enough, "W".

   Constraints on Resizing Layout Structures

Where only constraints on objects are set, resizing the layout causes each of its rows to accept a share of the extra space. You will have noticed that while this method keeps constrained objects from changing size, it does not keep the rows or columns containing these objects from being resized. In the example given above, where b is constrained by "H", what you might have expected was that a and c would absorb all the extra space, leaving b the same size, and leaving the amount of space taken up by the second virtual row of the layout unchanged. Instead, b appears to be floating in empty layout-space. How do you keep b "glued" to a above and c below?

Recall that a resize causes the layout to send messages of the form
"grow/shrink by n pixels"
to each of its rows (or columns), which in turn send messages of the form
"grow/shrink by n pixels"
to each of their children. "H" and "W", set on objects, allow these objects to reject such requests, and remain the same size. We want a similar ability for the virtual rows and columns of a layout, which would enable them to reject resize requests they receive from the layout:

     abc10
     d`a`b`c
     `b has (`resize;'h')
     show `d is `layout
Now suppose you expand d by 300 height-pixels. d receives the message:
"grow in height by 300 pixels."
It then asks each of its rows,
"can you grow in height?"
to which rows 0 and 2 reply "yes" and 1 replies "no". d then sends the following messages:

to row 0: "grow by 3002 pixels"
to row 2: "grow by 3002 pixels"

which in turn send resize messages to their children. But note that row 1, having replied "no" to the message asking whether it could be resized, receives no such message from the layout. Consequently, no "H" constraint need be placed on any object in row 1.

The "h" attribute is similarly paired with one for constraining column width, "w".

   Constraining Layout Structure by Way of the Objects

While syntactically both forms of resize constraint are placed on objects in a layout, semantically they are quite distinct. "H" and "W" constrain the resizing of objects; "h" and "w" constrain the resizing of the structure containing the objects on which these constraints are placed. What this means is that "h" or "w" placed on an object will indirectly constrain all other objects on the same row or column. E.g.,
     abc10
     d(`a;`b `c)
     `b has (`resize;'h')
     `d is `layout
"h", set on b, propagates upward to row 1 of the layout, and hence downward in its effects to c. All extra space accumulates in row 0 of the layout.

Repositioning Objects in a Layout

Consider once again the example:

example     
     abc10
     d(`a;`b;`c)
     show `d is `layout
     `b has (`resize;'H')
Resizing the layout by 300 pixels causes row 1 to grow, but b is constrained. The extra space is allocated: half above b, half below. In other words, b is vertically centered in the row. Suppose we wanted b to stick to the top of its row as it grows:
     `b has (`resize;'t')
This causes the extra space given to row 1 to be allocated: all below b, as shown.

Other justification options are:

     `b has (`resize;'b')         Stick to the bottom.
     `b has (`resize;'l')         Stick to the left.
     `b has (`resize;'r')         Stick to the right.
Justification options can be paired in obvious ways:
     `b has (`resize;'lt')        Stick left and top.
but, of course, the following pair is inconsistent, and s will use the one it prefers, top, for:
     `b has (`resize;'tb')        Stick top and bottom.

Default Constraints

A+ classes such as table and array which come with the concepts of rows and columns are instantiated with no resize constraints. It is assumed that most uses of array will allow for resizing. Other classes, such as label and button, are constrained in the height direction, and are instantiated with both "h" and "H" constraints. No width constraints are set by default on any classes.

For default constraint information, enter, e.g.:

     `resize s.defaultOf `button
< hH

The resize Attribute

The resize attribute is cumulative in its settings unless a period is included somewhere in its value:
     `a is `button
     `resize of `a
<  hH                       Default constraints.
     `a has (`resize;'W')   Set 'W' cumulatively.
     `resize of `a
<  hHW
     `a has (`resize;'lt')  Set 'l' and 't' cumulatively.
     `resize of `a
<  lthHW                    Accumulated.
To set constraints noncumulatively:
     `a has (`resize;'lt.')  Set 'l' and 't'
                             noncumulatively, using a period.
     `resize of `a
<  lt                     Not accumulated: just 'l' and 't'
To reset the default constraints:
     `a has (`resize;)    Set to null.
     `resize of `a
<  hH                     Default constraints.
To eliminate all constraints:
     `a has (`resize;'')  Set to ''. Could have used
                          '.' with the same result.
     `resize of `a
<                         No constraints.

   The Geometry of Slotfiller Objects

A+ currently supports five slotfiller classes: slot, radio, choice, check, and action. Typically, the A+ variable of a slotfiller class has the form:
     (`sym ... `sym;(val;...;val))

Partition Vector Form

The method for controlling the geometry of slotfiller objects is strongly analogous to the one used to position objects in a layout. Conceptually, slotfillers possess row-column structure, within which components can be positioned and which they may span. For example, the slotfiller
     sf(`one `two `three;(10;20;30))
can be laid out as

example

through the geometry setting:

     `sf has (`geometry;1 2)
which specifies: one object on the first row, two objects on the second row. Implicitly, the first object spans two columns, each of the other two span one column.

Note that geometry settings of this form are partition vectors:

     1 2 0sf
<  `one
<  `two `three

Index Matrix, or Canonical Form

A more general method for controlling geometry is, once again, strongly analogous to the method of canonical representation for layouts. Consider the geometry for sf shown as

example

where the object one spans two rows, and two and three each span a single row. This is obtained by means of:

     `sf has (`geometry;2 20 1 0 2)
Note that
     !@ 1 (2 20 1 0 2)#0sf
 one  two
 one  three
     Placeholder Indices in the Canonical Form
Consider the geometry:
one: ___10    two: ___20
              three: ___30
where the lower left quadrant is empty. This is obtained by means of:
     `sf has (`geometry;2 20 1 1 2)
where -1 plays the same role in geometry arrays as ` does in layout variables.
     Symbolic Geometry
The s functions will translate symbolic matrices into geometry matrices:
     `sf has (`geometry;2 2 `one `two ` `three)
is equivalent to
     `sf has (`geometry;2 20 1 1 2)
for slotfillers containing the symbols `one, `two, and `three.
     Horizontal Geometry
The default geometry for a slot is 1; i.e., (#0sf)1. Horizontal geometry for any slot is #0sf. For convenience, this can be specified simply as
     `sf has (`geometry;2)

   Making Objects Equal Sizes

Consider
     a(`one `thirteen `twelve `seven;(;;;))
     `a has (`geometry;2)
     show `a is `action
The buttons have different widths, and grow and shrink proportionally as the object is resized. Objects with geometry - layouts and slotfillers - can be constrained by the R and C attributes:
     `a has (`C;1)
causes all buttons in a to assume the size of the button with maximum width, namely, thirteen.

The R constraint has the same effect on rows:

     a10
     b20
     c`a`b
     show `c is `layout
     `c has (`R;1)
now causes b to assume the height of a.

One consequence of making sizes equal is that virtual row or column ratios can be used to indicate the proportional sizing of objects. For example, compare

     a3 4
     b10
     c`a`b
     show `c is `layout
with
     aa3 4
     bb10
     cc1 4`aa`aa`aa`bb
     `cc is `layout
     `cc has (`C;1)
     show `cc
Both a and aa are at 0 0 1 3 and b and bb are at 0 3 1 1, but only in cc does virtual-columns span determine relative width.

   Locking and Zooming

Suppose you have a layout of four graphs:
     aabbccdd10
     (a;b;c;d)(`aa;`bb;`cc;`dd)
     `a`b`c`d is`graph
     m`a`b`c`d
     `m is `layout
     m has((`at;0 0);(`at;0 1);(`at;1 0);(`at;1 1))
     show `m
You might like a mechanism whereby one of the graphs can be "zoomed" to fill the entire layout and later restored to its original cell. Note that m is not representational: the graphs are explicitly positioned using `at.

     Z()      Symbol of the graph that has been zoomed.
Consider the function
zoom{x}:
      {
      if (x())
              {
              if (~Z())
                    {
                    imZ;
                    s2 2i;
                    yxs`ys `xs of 0#(mZ)/m;
                    hide Z;
                    Z has (`ys `xs `at;yxs,<s,1 1);
                    show Z;
                    }
              }
     else
              {
              if (~Z()) &{()};
              x has (`at `raise;(0 0 2 2;1));
              };
     .Zx;
     }
If the argument to zoom is nonnull, then (1) if something is zoomed, "unzoom" it (see below), and then (2) zoom the object named. To zoom an object, reposition it at 0 0 with a span of 2 2 and raise it to the front.

If the argument to zoom is null and something is zoomed, "unzoom" it by translating its index in m to a position in the layout, get the pixel extent of some other (arbitrary) child of m, hide the object, reset its position and extent, and reshow the object.

These roundabout procedures are necessary because an attempt to reposition the object that was zoomed will cause the layout to expand to accommodate the extent of the formerly zoomed object.

The attribute lock on layouts (and their subclasses) can be turned on, after showing, to force the downsizing of an object that is being positioned so that the object will fit into the cell. In other words, the layout will not expand to fit the object, but will force the object to fit the layout. Now consider the zoom function, rewritten to operate on locked layouts;

     `m has (`lock;1)

     zoom{x}:
            {
            if (x())
               {
               if (~Z()) Z has (`at;(2 2mZ),1 1);
               }
            else
               {
               if (~Z()) &{()};
               x has (`at `raise;(0 0 2 2;1));
               };
            .Zx;
            }

   Natural Size Action

Consider
     abc10
     d(`a;`b `c)
     show `d is `layout
Resize the layout d. Now execute
     `d has `naturalsize
The layout sends the naturalsize message to each of its children. A primitive object that receives the naturalsize message recomputes its natural size (see "
The Natural Size of Objects"). After each child recomputes its natural size and transmits it to the parent, the parent recomputes its own size.

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_22.html0000444000265000001440000005174510737165222013652 A+ Reference: Screen Management Functions

Screen Management Functions


"Introduction to Screen Management" shows all the basic primitive functions for visual representation in action, and in fact includes most forms of their definitions. This chapter gives complete details. The command $load s establishes these functions in both the root and the s contexts.

In this chapter, an object is a symbol holding the name of a global variable or dependency. (It may also be a two-element vector of symbols naming context and variable separately, but it will be described in this chapter as a single symbol, for simplicity.) A class is a visual representation format, e.g., array or label. An attribute is a modifiable characteristic of a class such as title or bg. An object which is not bound to a display class is said to be free.

Definitions of the Screen Management Functions

free

   Syntax
free obj
   Argument and Result
The argument is a symbol scalar or one-element vector. The result is a one-element symbol vector or the Null.
   Definition
If the object (i.e., global variable or dependency) named in the right argument obj is bound to a class, it is unbound. In this case the result is 1obj. Otherwise, the function has no effect and the result is Null. If the class to which the object is bound is a container (see the function is), then all children of the object are also freed. If the object is a child of another object, it is freed but its parent is not.

has

   Syntax
obj has rescs
   Arguments and Result
The left argument obj is a symbol scalar or one-element vector. The result is a symbol scalar.
   Definition
This function sets the attributes named in the right argument for the object (i.e., global variable or dependency) named in the left argument. The attributes can be specified in one of two general ways:

In addition, if all of the values to be set are symbols, then the following symbol array is also permitted:
   `attribute1,value1,`attribute2,value2, ...
There is an additional variation. If a dot is placed before the attribute name, as in `.attribute1, the symbol given for that attribute is not an attribute value itself, but a variable, function, or dependency whose value (at any time of use) will be used for that attribute value. A variable or function provides an "electrical connection", and a dependency does so if it is bound to the reference class (so that it is evaluated as necessary each time the interpreter traverses the mainloop); with such a connection, the display is changed to reflect the new attribute value whenever the variable or function is respecified or the dependency is invalidated. If a Null is given as a value for a dotted attribute, instead of a name, the previous attribute default variable (if any) is no longer connected to this attribute of this object; the value of the attribute does not change. (See "Attribute Default Variables".) See the examples.

The result is ''obj. The expression `obj has (...;) sets the specified attribute to its default value.

If the left argument holds a name that has no value and is not local to a function, then a free global variable with the value Null is assigned to that name - which might possibly cause a binding requested by the right argument, such as to radio, to fail.

If the left argument (after the action just described if necessary) names a free variable or dependency and the right argument does not specify a class binding, then the variable or dependency is bound to its default display class. (In fact, because the attributes are applied sequentially, if the right argument specifies a class binding but first specifies a nonpersistent attribute, the free variable or dependency is bound first to its default display class and then to the specified class.)

   Examples
     `header has (`title `bg;
                  ("Visual Display"; `yellow))
                        Specified as a slotfiller.
 (The responses, `.header and so on, are omitted here.)
     `header has (`title;"Visual Display"; `bg;`yellow)
                        Given as an association list.
     `a has `bg `red    Specify actual value, a symbol so simple form is okay.
     `bg of `a
 `red
     var`blue
     `a has `.bg `var   Specify a variable whose value
                          will be used, by using `.bg
     `bg of `a          Get the value of the attribute.
 `blue
     `.bg of `a         Get the name of the variable
 `var                     holding the attribute's value.

hide

   Syntax
hide obj
   Argument and Result
The argument is a one-element symbol array. The result is Null.
   Definition
Every object displayed on the screen appears in a window under the control of the window manager of the underlying system, and every window created through A+ is the result of applying the function show to some object; that object is called the root object of the window. Windows are either top-level windows or popups, a distinction that is discussed in "Windows" and "Quit, and Open and Close". If the object named in the argument obj is the root object of a top-level window, the effect of this function is to replace the window with an icon. If the object is the root object of a popup window, and the pin is out, the effect is to remove the window from the screen; there is no effect if the pin is in. If the object is a child of a layout, the effect is to remove the object from the screen (but not from the layout definition) and reconfigure the layout if necessary. Otherwise, the function has no effect.

is

   Syntax
obj is cls
   Arguments and Result
The left argument is an array and the right argument is a symbol scalar. The result is also a symbol scalar.
   Definition
This function binds the object represented by obj to the display class named in cls. There are three cases for the left argument, depending on whether it is a global name with a value, just a name, or just a value.
Case 1. The left argument is a one-element symbol array naming a global variable, which may be a dependency. This is the ordinary case, and this global variable is the one that will be bound to a display class cls.

Case 2. The left argument is a one-element symbol array holding a name, but that name has no value. If the name is not local to a function, it is automatically given a prototypical value for an object bound to class cls, and the resulting global variable is bound to that class. (In this case, obj has (`class;cls) would assign the value Null to the object, no matter what the class.)

Case 3. The left argument is an array other than a one-element symbol array. A global variable is created whose value is this array, and this variable is bound to the class named in cls. See the example for show for the rules governing the creation of the variable name.

There are also three cases for the right argument; a container display class (graph, hpane, layout, table, vpane, window), simple classes (all the other display classes except graphTrace and tableField), and a default setting. The graphTrace and tableField classes are not in the domain of is.
Case 1. The right argument names a simple class. The object represented by the left argument is bound to that class and the name of the object is returned as the result.

Case 2. The right argument names a container class. The global variable named by the left argument must be an array of objects. The function behaves as in Case 1, and additionally binds to their default classes any free children of the object being bound. The geometry of the newly bound object is determined by the form of the object's value. "Example 1. Manipulating Layouts" shows how the value of the left argument can determine the geometry of the object.

Case 3. The right argument is the Null. The object named in obj (or created, for Case 3 of the left argument) is bound to its default class. See "Default Class Binding".

If the object to be bound is already bound to a class, it is first freed.

The result in the first two cases for the left argument is ''obj, and in the other case it is a symbol scalar holding the name of the created variable.

See "Assignment of Objects Bound to Display Classes" for a discussion of assigning values to objects that are bound to display classes and the refusals and error messages that can occur.

of

   Syntax
rscs of obj
   Arguments and Result
The right argument obj is a symbol scalar or one-element vector.

In the usual case, the left argument rscs is a symbol array, and the result is a nested vector of the same shape. The left argument can also be a slotfiller or association list suitable as a right argument for has, and the result is a nested vector of shape 0rscs or (rscs)2, respectively.

In the attributed data case, the left argument is either (`out;value) or (`in;string), where value is appropriate for an element of obj and string is appropriate for an entry in a cell of a display of obj, and the result is a nested scalar.

   Definition
Consider the usual case first, and since only the attribute names in a slotfiller or association list are used (the values being ignored), assume that the left argument is a symbol array. For every i of #,rscs, if res is the result, ires is the value of the resource i#,rscs for the object (i.e., global variable or dependency) named in the right argument obj. Place a dot before the attribute name to indicate that you want the variable holding the value, not the value itself. (See "Attribute Default Variables"). If there is no such variable, a Null is returned. See the examples for has.
   Attributed Data
For `out, the result is the enclosure of the formatted string, the string that would appear for an element of obj with value value in a display. For `in, the result is the enclosure of the converted value, the value that would be appropriately placed in obj as a result of the entry of string in a cell of a display of obj. It is not necessary for obj to be shown, although it must be bound.
   Examples
     `title `bg of `header  Continued from has example. Usual case.
< Visual Display
<  `yellow
     (`in;'142.376') of `a  Attributed data, assuming appropriate a
<  142.376                  Converted value, a floating-point number.
     (`out;142.376) of `a
< 142.376                   A character string.
     `a has (`out;'f12.3')  Now change output format.
 `.a
     (`out;142.376) of `a
<     142.376

show

   Syntax
show x
   Argument and Result
The argument is any array. The result is Null.
   Definition
If x is a one-element symbol array representing a bound object, that object is displayed on the screen in the format to which it is bound. If x is a one-element symbol array representing a free object, that object is bound to its default class (see "Default Class Binding") and then displayed. Otherwise, an object is created whose value is that of the expression x, and the object is bound to its default class and displayed on the screen.

If the displayed object is a table or a graph and its children were already bound, either explicitly by the user or as a result of being displayed on the screen, they are re-bound as appropriate for x.

   Example
     show 2 3
     gn: variable generated
     gn: S will bind variable to array
     gn: variable bound to array
gn is a global variable name generated by show. The value of that variable is 2 3. The name is chosen to be the first available name in the root context from the list of names:
.a, .b, .c, ... , .y, .z, .a0, .a1, .a2, ... .

Dependencies and Displayed Objects

Dependencies marked for evaluation will ordinarily be reevaluated only when explicitly referenced. If, however, a dependency is displayed on the screen, it will be automatically referenced upon being marked for evaluation (see the discussion following the next example). The effect is that its value is always current relative to the objects on which it depends, which is the most generally useful behavior for dependencies displayed on a screen. They are, after all, being referenced at unknown times by the user. For example, if a dependency represents a view of a database and the database changes, one would expect to see the view change accordingly. The same automatic referencing can be obtained without actual display on the screen by binding a dependency to the reference display class, as in `d .is `reference.

Immediately referenced dependencies, however, require extra consideration similar to cyclic dependencies. Consider the following simple example:

     a0 3 2 1 5
     b9 2 5 4 3
     c:a+b
     show `c is `array
     bb,10
      +: length
*
This dependency set should be organized in a commit and cancel style. When a, b, and c are displayed and edited on the screen, the decision to commit or cancel can be put on the screen as well, in the form of a commit button and cancel button. There is then no need for a callback function to record update activity or for tests as to when commitments can be done.

There is a general rule for when dependencies that are displayed (or bound to the reference display class) and marked for evaluation will be automatically evaluated. The A+ process is always executing in an event loop. Within this loop it processes, one at a time, messages from Emacs or an XTerm (keyboard entry, or stdin in Unix terminology), from other processes through adap, and from the screen (e.g., key and button presses). Some of these messages are processed by evaluating A+ expressions or invoking callback functions, during which dependencies might be marked for evaluation. During each pass through the event loop, a series of messages is processed and then the screen is refreshed, i.e., all dependencies that are displayed (or bound to the reference display class) and marked for evaluation are evaluated. Since the programmer can't be sure how many messages are processed on each pass, the prudent thing is to assume that it is only one. The assumption, therefore, must be that the screen is refreshed after each message is processed.

For instance, in the above example the expression bb,10 was evaluated, which constitutes a message and caused the displayed dependency c to be marked for evaluation. When execution was complete, c was automatically evaluated. Since this happened before a was adjusted, which would have required a separate message, an error occurred. If, however, the expression (a;b)(a,5;b,10) had been entered, then both a and b would have been updated in the evaluation of this single message, and the subsequent automatic evaluation of c would not have failed because of a length error. Note that had the expression contained a defined function, that function would have been executed to completion before c was automatically evaluated. The respecifications of a and b could have occurred anywhere within that function execution, even in different functions that it called, without a length error.

In sum, if, as in this example, a displayed dependency requires more than one thing to be done before it can be correctly evaluated, then either all those things must be done within a single message, or the evaluation must be deferred, say through a commit and cancel formulation.


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_23.html0000444000265000001440000157672410750124015013653 A+ Reference: Display Attributes

Display Attributes


The colors, fonts, layout arrangements, and many other aspects of the appearance of a screen display are controlled by display attributes. "Screen Management Functions" tells how to use the screen management primitive functions of and has to set and reference values of display attributes.

Every display attribute is listed in "Display Attributes", together with a brief description and a set of keys. The meanings of the alphabetic keys are given in the next section.

  • Keys with capital letters indicate the display classes for which an attribute is meaningful.

  • Keys in lower case letters generally indicate characteristics of the attributes.

  • Links to additional information about the attributes are indicated by "more".
For some display attributes, the information in "Display Attributes" is only a summary. For more information on:

Among the display attributes described here are those for specifying colors and fonts. Both colors and fonts are specified by symbols or character strings, as in `name or 'name'. A list of all available color names can be found in "/usr/X11R6/lib/X11/rgb.txt".

For convenience, a list pruned to the unique colors appears in "Colors". A list of all available font names can be produced by executing xlsfonts in an XTerm session (or $xlsfonts from A+). A list of preferred fonts (those available on the screen and for printing) is in "Preferred Fonts".

Display Attribute Characteristics

   Persistent Attributes (Key = p)

Display attributes are categorized as persistent and nonpersistent. Persistent attributes can be thought of as more directly connected to the concept of an array than nonpersistent ones. For example, the font in which the values of a variable will appear is a persistent attribute, while the thickness of the highlight border in its display is nonpersistent. The most distinguishing feature is that once a persistent attribute is set for a variable x, it will remain set, even as x is bound, freed, and bound again to another class; in effect, a persistent attribute is an attribute of A+ variables, not of particular display classes. Indeed, it can be set on an unbound variable. For this reason persistent attributes are also called attributes of variables. On the other hand, the setting of a nonpersistent attribute will not be maintained when a variable is freed, and some nonpersistent attributes cannot even be specified for variables bound to certain classes. Nonpersistent attributes are attributes of display classes, not of variables bound to those classes. Nonpersistent attributes are also called attributes of classes, or widget attributes.

Even though a persistent attribute can be given a value for an object of any class, that value is not necessarily meaningful. For example, the font attribute, which specifies the font in which values are type set, is not meaningful for line graphs. For each persistent attribute, "Display Attributes" shows "ALL" as the key for the set of display classes to which it applies and - unless it is meaningful for all classes - lists in parentheses the classes for which it is actually meaningful, i.e., for which it has a visual effect. Note that an object contained in a table or graph is bound to the class tableField or graphTrace, respectively, no matter to what class it may have previously belonged.

   Applicable Classes; the ALL and CNT Keys

Keys with capital letters in the second column of "Display Attributes" indicate classes to which the attributes apply. The ALL key means all classes except report, which is fundamentally different from the others, since it cannot be shown, and in some cases, such as navigation, children of reports. Only Rp refers to the report class. CNT means the container classes hgrid, hpane, layout, notebook, vgrid, and vpane.

   Attributes of Objects in Layouts (Key = CNFT)

Objects in layouts and panes have attributes for establishing their relative positions and behavior when the layouts are resized. See "Layouts, Geometry, Constraints", and also "The Layout Display Class".

   Attributes for Top-level Objects (Key = TOP)

Top-level objects, in the broad sense1, are objects that are not contained in other objects (and not reports). It is these objects that appear with certain window manager decorations, and there are attributes associated with this appearance and their interrelations among top-level objects. See "Windows" in "Introduction to Screen Management".

   Graph Attributes for Axes (Keys = o, x, y)

Graphs have four axes, the x axis on the bottom of the plot area, the y axis to the left, an alternate x axis above, and an alternate y axis to the right. Some attributes come in sets of four, with one attribute for each axis. For example, the font for the labels can be set separately for each axis, as xlabelfont for the x axis, ylabelfont for the y axis, Xlabelfont for the alternate x axis, and Ylabelfont for the alternate y axis. Whenever there is such a foursome, only the attribute for the x axis is given, with the key o.

Similarly, for several attributes there are x-axis and alternate x-axis versions, but no y-axis or alternate y-axis versions. For these attributes, only the attribute for the x-axis is given, and with the key x. Analogously, for attributes with y-axis and alternate y-axis versions, but no x-axis or alternate x-axis versions, only the attribute for the y-axis is given, with the key y.

   Action Attributes (Key = a)

Certain attributes express an action to be taken, rather than a quality. For example, naturalsize is the attribute which causes an object to be resized to a size appropriate for its current value and attribute settings. It is not necessary to specify a value for this attribute, but only that the resizing actions should take place, as in
     `object has `naturalsize
Some action attributes also take values, but it is not necessary to specify a value to get the primary action to take place. For example, the show attribute can be given the value 1 to show an object or 0 to hide it, and
`object has (`show;1) is equivalent to `object has `show.

   Attributes that Can Only Be Set (Key = s) or Referenced (Key = r)

Some attributes can only be set, and have no stored value; s will complain if asked for a value. Other attributes can only be referenced; s will complain about any attempts to set values for them.

   Attributes with Callbacks (Key = cb)

These attributes are associated with user interactions such as key and button presses. See "Attributes with Callbacks". This key is used as a link to the corresponding table entry in that chapter. Some attributes with this key have a default value of 0 or 1 and can also be given the other value of 1 or 0; in these cases either `false or `off can be used in place of 0, and either `true or `on can be used in place of 1.

   Functional Attributes (Key = fn)

These attributes provide efficient means for dynamically modifying their values based on changing circumstances in running applications. See "Functional Attributes". This key is used as a link to the corresponding table entry in that chapter.

Table of All Display Attributes

   Keys for the table

The second column of this large table shows keys which explain the applicability of each attribute. To see a brief description of what a key represents, simply point to they key with your mouse... no clicking required.

Alternatively, assuming you are using the frames version of the online manual, when you are looking at an entry in the table and are not sure what a key stands for, you can click on "Keys" under "Table of Attributes" in the lefthand frame. After ascertaining the key's meaning, you can return to the table by pressing the righthand mouse button with the pointer in the main frame and selecting "Back" from the menu that pops up.


Attribute
 

 Meaning
 
A  array
B  label
C  command
D  password
E  choice
G  graph
gT  graphTrace
hG  hgauge
hM  hmenu
hP  hpane
hR  hgrid
hS  hscale
I  radio
K  check
L  layout
M  matrix
N  action
O  notebook
P  page
Q  scalar
R  tree
Rp  report
S  slot
T  table
tF  tableField
U  button
V  view
vG  vgauge
vM  vmenu
vP  vpane
vR  vgrid
vS  vscale
W  window
X  text
ALL  all objects except reports (fundamentally different; can't be shown)      
    ALL (list)       ALL, but meaningful only for the classes in list
CNFT  NFT but only objects in containers
CNT  containers: layout, grids, panes, and notebook
GS  hgauge, vgauge, hscale, and vscale
NFT  not tableField or graphTrace
TOP  top-level and popup objects only
o  also for graph attributes prefixed X, y, Y, or
x  also for the attribute with prefix X
y  also for graph attribute prefixed Y
a  action
cb  attribute with callback
fn  functional
p  persistent
r  reference only (cannot be set)
s  set only

 
Attribute Keys
(POINT TO KEY FOR INFO)
Description Default
acceptfocus E = choice, hM = hmenu, I = radio, K = check, N = action, U = button, V = view, vM = vmenu If 1, this object will accept input focus during traversal; if 0, it will not. 1
active ALL = all objects except reports (fundamentally different; can't be shown), r = reference only (cannot be set) If 1, this object will be automatically updated when marked for reevaluation; if 0, it will not. The value 0 occurs when the show attribute is 0 for this object or one of its ancestors. 1
addtexttrace G = graph, cb = attribute with callback, (click for more info) The action taken on an add-a-text-trace event.  
addtrace G = graph, cb = attribute with callback, (click for more info) The action taken on an add-a-trace event.  
ancestors ALL = all objects except reports (fundamentally different; can't be shown), r = reference only (cannot be set) Vector of objects containing this object.  
arrowbuttons C = command, D = password, Q = scalar, S = slot If 1, incrementing and decrementing arrows (up- and down-pointing triangles) are shown, for each entry in the case of a slot; if 0, they are not shown; if (for a slot) a boolean vector of the same length as the slotfiller, they are shown for the entries corresponding to ones in arrowbuttons. For the action associated with these buttons, see the increment and decrement attributes. Null (0) for slot, 0 for the others.
arrowdown ALL = all objects except reports (fundamentally different; can't be shown), cb = attribute with callback Event callback function, called for a down-arrow keypress. If 1, default action; if 0, no callback. [Future use] Move selection down 1.
arrowkeys ALL = all objects except reports (fundamentally different; can't be shown), r = reference only (cannot be set) Slotfiller of arrow keys and callback functions. Cf. arrowdown, arrowleft, arrowright, arrowup. [Future use]  
arrowleft ALL = all objects except reports (fundamentally different; can't be shown), cb = attribute with callback Event callback function, called for a left-arrow keypress. If 1, default action; if 0, no callback. [Future use] Move selection left 1.
arrowlist NFT = not tableField or graphTrace Matrix with items "fr dir to".  dir is one of `left `right `up `down and fr and to name objects. Connected to upto, downto, etc. [Future use]  
arrowright ALL = all objects except reports (fundamentally different; can't be shown), cb = attribute with callback Event callback function, called for a right-arrow keypress. If 1, default action; if 0, no callback. [Future use] Move selection right 1.
arrowup ALL = all objects except reports (fundamentally different; can't be shown), cb = attribute with callback Event callback function, called for an up-arrow keypress. If 1, default action; if 0, no callback. [Future use] Move selection up 1.
at CNFT = NFT but only objects in containers, (click for more info) Position of this object in a layout: (vrow, vcol, vrows, vcols).  
atsector TOP = top-level and popup objects only A two-element vector designating the (row, col) position of the virtual desktop sector where this object is displayed, or `here for the currently active sector (see s.desktop{}, s.beHere{}). 0, 0
axis G = graph, (click for more info) Specify which axes appear on a graph. `std
Attribute Keys
(POINT TO KEY FOR INFO)
Description Default
b CNFT = NFT but only objects in containers If 1, bottom justify this object in its layout cell. 0
backpagebg O = notebook Background color of tabs and page edges. `deep skyblue4
backpagefg O = notebook Foreground color of tabs and page edges, but not the titles on the tabs, which get their color from fg. `black
backpages O = notebook Number of apparent unshown pages, i.e., page edges. 3
backpage thickness O = notebook Thickness of each (unshown) page edge, in pixels. 4
banner Rp = report Text of banner to be printed diagonally in background on each page, e.g., "Draft", "Internal use only".  
barwidth G = graph, (click for more info) The maximum pixel width of bars in bar and stack graphs. 10
be ALL (list) = ALL, but meaningful only for the classes in list(CNT = containers: layout, grids, panes, and notebook), fn = functional, p = persistent If (cv) has (`be;(f;s)) and cv is a container, then f{s;d;i;p;c;v} is called to bind the child d of cv to a display class; s may be a display class, a list of display classes, or whatever will help in this process.  
bg ALL = all objects except reports (fundamentally different; can't be shown), p = persistent;
fn = functional for A = array, M = matrix, tF = tableField, V = view
The background color of this object. For tables and arrays, does not change the scrollbar background color if that color is different from the bg color that is being changed. A tableField inherits its value from its table, and when the value for tableField is reset to Null it uses the current value for table. grey
bggrayscale tF = tableField, fn = functional Background shade value in reports, 1 - white to 0 - black. A scalar or a function (in the callback i is the row). 1
bindingwidth O = notebook The width (diameter) of the spiral binding, in pixels. 36
blank ALL (list) = ALL, but meaningful only for the classes in list(A = array, M = matrix, T = table, tF = tableField), p = persistent What is to be displayed for a NA, e.g., on insertion of a row. Cf. na and s.AUTOBLANK. Null
blink P = page, fn = functional, (click for more info) Boolean mask controlling whether or not a cell blinks, i.e., its foreground and background colors oscillate. (The blink timer runs only when something is actively blinking).  
blinkrate P = page The rate of blinking in milliseconds. 250
bold P = page, fn = functional Boolean mask indicating which characters are bold.  
borderheight O = notebook Border area above and below the notebook, in pixels. 7
borderwidth O = notebook Border area on each side of the notebook, in pixels. 7
bottom G = graph, (click for more info) Distance from the bottom of the graph window to the x-axis rule (visible or not), as a percentage of the window height. 0
bottom margin Rp = report Bottom margin of report, in inches. 1
bound ALL = all objects except reports (fundamentally different; can't be shown), r = reference only (cannot be set), p = persistent If 1, this object is bound; if 0, this object is free.  
box P = page, (click for more info) An n by 4 matrix of boxes, where each row represents a box as first row, first col, number of rows, number of columns. 0 4 0
boxcolor P = page A symbolic vector of box colors. If boxcolor is specified with fewer colors than boxes, then the remaining boxes stay the color that they were before the specification.  
breakbggray scale tF = tableField, fn = functional Background shade for breaks in reports, 1 - white to 0 - black. A scalar or function. 1
breakcriteria func tF = tableField, fn = functional Determines whether a break occurs for this row (propagated to other columns). Must be functional and return 0 or 1. If row (item) differs from previous row.
breakfggray scale tF = tableField, fn = functional Foreground shade for breaks in reports, 1 - white to 0 - black. A scalar or function. 0
breakfont T = table, tF = tableField, fn = functional Font to be used for printing breaks. Value for table is used as a default if no value set for a tableField.  
breakleading tF = tableField, fn = functional Distance in points between break and next row. 2
breakoffset tF = tableField, fn = functional Distance in points between break and previous row. 2
breakon tF = tableField Whether column can initiate breaks or not. 0
break processfunc tF = tableField, fn = functional Function to be called to process data at a break if breakprocesson is 1. If none, computation mode is used.  
break processon tF = tableField Whether to perform computations at breaks. 1
breakstyle T = table, tF = tableField, fn = functional Style for break: `left, `right, `top, `bottom, or a combination. Value for table used as default. `left
breaktext tF = tableField Text to be inserted at every break.  
buffer C = command, X = text, r = reference only (cannot be set) The character buffer of the command or text display class; a vector.  
build hR = hgrid, L = layout, vR = vgrid, (click for more info) If 1 and this object is a simple vector layout, use autobuilder; if 0, use a default arrangement; if Null, use the value of s.AUTOBUILD. Null (0)
Attribute Keys
(POINT TO KEY FOR INFO)
Description Default
C hP = hpane, I = radio, K = check, L = layout, N = action, S = slot, vP = vpane If 1, make all virtual columns of this object the same size.  
cancel Rp = report Set to 1 (in a callback) to cancel report generation. 0
children CNT = containers: layout, grids, panes, and notebook, G = graph, T = table, W = window A vector of all objects named in this variable.  
class ALL = all objects except reports (fundamentally different; can't be shown), p = persistent The display class of this object.  
clear NFT = not tableField or graphTrace, cb = attribute with callback, (click for more info) Furnishes a callback function for a clear event. See "Accessing the Primary Selection Buffer".  
col A = array, M = matrix, T = table, V = view The column index of the selected cell. Setting this attribute causes the selected column to appear in the display. In addition, if the row attribute is set to a valid row index, the cell at position (row, col) is highlighted. Setting it to -1 signifies that no column is selected (so none is highlighted). 0
colindex M = matrix A vector of indices of the selected column labels when the selectcol attribute is 1, in the order of selection. 0
colindexbg M = matrix The background color of the indexed column labels. medium aquamarine
collabelrows M = matrix The maximum number of rows in the column labels. 1
color P = page, fn = functional Row indices for colormap attribute, for foreground, background color pairs for cells. Functional result must be same shape as variable; if nonfunctional, it is reshaped to match. Null (0)
colormap P = page k by 2 matrix of color symbols; each row is a foreground, background pair. Indexed into by the color attribute. 1 2 `black `grey
colors A = array, C = command, D = password, M = matrix, Q = scalar, S = slot, T = table, tF = tableField, V = view, fn = functional A vector of colors that will be cycled through when a cell is updated by indexed specification (which can be caused by editing the cell on screen); see the cycle attribute.  
cols A = array, E = choice, hM = hmenu, M = matrix, T = table, V = view, vM = vmenu, X = text The number of visible columns. Table: at most 5; text: 40.
colsep A = array, M = matrix, T = table, V = view If n, column separators appear every n columns. 1
colspace M = matrix, fn = functional An integer vector specifying column widths. The first element applies to the row-label column. If there is only one element, it applies to all columns. Otherwise, all elements except the first are used cyclically, as in Reshape. Null
column alignment tF = tableField Horizontal alignment of data in the tableField. One of `left, `center, `right. `left
column control T = table Vector of columns per page.  
column pagespan T = table Number of pages that the table's columns are to span.  
column resize T = table, (click for more info) Controls whether columns can be resized by dragging their right borders (column separators): 1 - yes, 0 - no. 0
column spacing T = table Space between columns in reports, in inches.  
computation mode tF = tableField Specify the default computation mode: `sum, `avg, `max, `min, `stddev, `variance. Used when breakprocesson is 1 and breakprocessfunc is not specified.  
compute pagebreakcb Rp = report, cb = attribute with callback For a callback that occurs at the completion of the pagebreak computation.  
compute sizecb Rp = report, cb = attribute with callback For a callback that occurs at the completion of the computation of the report size.  
constraints hP = hpane, L = layout, O = notebook, vP = vpane A slotfiller containing the resize attribute of each child, indexed by child's name. Defaults for the children
coordinate G = graph, (click for more info) The pointer's x, y coordinates when a refer event occurs.  
gT = graphTrace, (click for more info) All the x axis, y axis coordinates that make up the trace when a refer event occurs.  
Coordinate G = graph, (click for more info) The pointer's X, Y coordinates when a refer event occurs.  
copy ALL (list) = ALL, but meaningful only for the classes in list(A = array, M = matrix, T = table, tF = tableField), p = persistent For an inserted line. If 1, copy the line that the new line is being inserted above or below. If 0, use na value. Cf. s.AUTOCOPY. Null (0)
copy texttrace G = graph, cb = attribute with callback, (click for more info) The action taken on a copy-a-text-trace event.  
copytrace G = graph, cb = attribute with callback, (click for more info) The action taken on a copy-a-trace event.  
cornerindex M = matrix If 1, the corner label is "flagged"; if 0, it is not; see the selectcorner attribute. 0
corner indexbg M = matrix The background color of the corner label when it is flagged. medium aquamarine
current breakcolumn T = table, r = reference only (cannot be set) Column that is currently causing a break.  
current page O = notebook Name of the object that is being shown. Set it to show page.  
cursor C = command, P = page, X = text The position of the cursor (number of characters from the left and, for page, top). page: 1 1; others: 0.
cycle A = array, C = command, D = password, M = matrix, Q = scalar, S = slot, T = table, tF = tableField, V = view The duration in milliseconds of the appearance of each color in the value of the colors attribute. If set on a table, it applies to all tableFields.  
cyclemode A = array, M = matrix, T = table, V = view If `fg, color cycling affects the foreground, if `bg, the background; if `reverse, color cycling is implemented by reverse video and the colors attribute is ignored. `fg
Attribute Keys
(POINT TO KEY FOR INFO)
Description Default
decrement C = command, D = password, Q = scalar, S = slot, cb = attribute with callback An event callback function to be associated with the down arrow button that appears when arrowbuttons is 1. For a slot, there may be several down arrow buttons; the selected attribute gives the symbol for the entry whose button was pressed.  
deiconized TOP = top-level and popup objects only (not popups), cb = attribute with callback Function for event callback when the widget is deiconized, whether or not the window manager is CDE. See the caveats in the callback section. Cf. iconized.  
delete A = array, E = choice, G = graph ((click for more info)), I = radio, K = check, M = matrix, N = action, S = slot, T = table, cb = attribute with callback Controls the action when a user presses Meta-Delete or, on IBM, Alt-Delete. The default action is to delete the selected row. Set delete to 0 to turn off the Delete key, and 1 to get the default action. In the case of a graph, it applies only to selectable traces. See the selectable attribute. 0
delimiter Rp = report To be defined.  
descendents CNT = containers: layout, grids, panes, and notebook, G = graph, T = table, W = window, r = reference only (cannot be set) A vector of all objects contained in this object.  
disclaimer Rp = report Governs disclaimer: `none; `text only; text in `box; text with `rule above and below; text below `toprule; or text `appended to top-level window. `none
disclaimer bottom margin Rp = report The bottom margin of the disclaimer, in inches. .2777777778
disclaimer file Rp = report The file containing the disclaimer text.  
disclaimer leftmargin Rp = report The left margin of the disclaimer, in inches. .2777777778
disclaimer right margin Rp = report The right margin of the disclaimer, in inches. .2777777778
disclaimer rule width Rp = report Width of any ruling for the disclaimer; see the disclaimer attribute.  
disclaimer topmargin Rp = report The top margin of the disclaimer, in inches. .2777777778
disclaimer orientation Rp = report Orientation of the disclaimer:
same as the object if `none;
else `portrait or `landscape regardless of the object.
`none
distribution method 3 = 3dgraph `linear or `table, indicating distributionlevels evenly spaced separators or the separators in distributiontable. `linear
doc ALL = all objects except reports (fundamentally different; can't be shown), p = persistent An attribute that allows documentation, presumably text, to be attached to each object. Cf. s.AUTODOC. >,< s.AUTODOC
done ALL (list) = ALL, but meaningful only for the classes in list(A = array, M = matrix, P = page, Q = scalar, S = slot, tF = tableField), cb = attribute with callback, p = persistent Holds the name of a function to be called at the end of the screen entry and refresh cycle. (The cycle is: in, preset callback, assignment, set callback, out, done.)  
downto NFT = not tableField or graphTrace Object to which Shift-down-arrow moves keyboard focus. Connected to arrowlist. [Future use] Null
dragdrop T = table, (click for more info) Controls whether columns can be moved by dragging:  1 - yes,  0 - no. 0
dynamic NFT = not tableField or graphTrace Set to 1 for this object to be resized automatically when necessary due to a font or text change. 0
Attribute Keys
(POINT TO KEY FOR INFO)
Description Default
edit A = array, C = command, D = password, hG = hgauge, hS = hscale, M = matrix, Q = scalar, S = slot, T = table, vG = vgauge, vS = vscale, a = action When edit is set to any nonzero value, if there is a selected cell and it is not protected, it is put in input (editing) mode. When edit is set to 0, if there is a cell in input mode, its contents are accepted and input mode ended, as if the viewer had pressed Enter while the pointer was in the object.  
editbegincb A = array, C = command, D = password, hS = hscale, M = matrix, Q = scalar, S = slot, T = table, vS = vscale, cb = attribute with callback The callback function to be executed when a user begins editing the widget. Null (none)
editbg A = array, C = command, D = password, hG = hgauge, hS = hscale, M = matrix, Q = scalar, S = slot, T = table, vG = vgauge, vS = vscale The background color of the cell being edited. black
editendcb A = array, C = command, D = password, hS = hscale, M = matrix, Q = scalar, S = slot, T = table, vS = vscale, cb = attribute with callback The callback function to be executed when a user ends editing of the widget. Null (none)
editfg A = array, C = command, D = password, hG = hgauge, hS = hscale, M = matrix, Q = scalar, S = slot, T = table, vG = vgauge, vS = vscale The color of the text being entered while in edit mode. grey
editspace ALL (list) = ALL, but meaningful only for the classes in list(A = array, C = command, D = password, hS = hscale, M = matrix, Q = scalar, S = slot, T = table, tF = tableField, vS = vscale), p = persistent If 0, the space for editing is the same as the current value of the space attribute;
if 1, the value of s.EDITSPACE;
if Null, the value of s.AUTOEDITSPACE.
 
eval ALL = all objects except reports (fundamentally different; can't be shown), cb = attribute with callback, p = persistent Nested pair: variable callback function, static data. Function is called after the variable is evaluated (by %).  
evaluate ALL = all objects except reports (fundamentally different; can't be shown), p = persistent If 0, the variable is not to be evaluated in determining proper attributes for display; they will be set by the application programmer. Use with great caution. Null (1)
execute ALL (list) = ALL, but meaningful only for the classes in list(A = array, hS = hscale, M = matrix, Q = scalar, S = slot, T = table, tF = tableField, vS = vscale), p = persistent If 1, execute input expressions to obtain a value; if 0, don't. The table value is used for a tableField if the tableField's value is null. Null (1)
exit TOP = top-level and popup objects only, cb = attribute with callback, (click for more info) Controls the action taken when a user attempts to remove this object from the screen. The default iconification-or-removal behavior occurs for the default value. 1
extent NFT = not tableField or graphTrace Location and size of an object that is shown: the vector y, x, ys, xs. For a child y and x are relative to its parent.  
extents NFT = not tableField or graphTrace (toplevel CNT), r = reference only (cannot be set) A slotfiller whose indices are the names of all non-container, non-tableField, non-graphTrace descendents and each of whose values would be the extent attribute for the corresponding descendent except that the locations are absolute (relative to the screen, not to parents). Always a null slotfiller except for top-level CNT.
Attribute Keys
(POINT TO KEY FOR INFO)
Description Default
f1 through f12 ALL = all objects except reports (fundamentally different; can't be shown), cb = attribute with callback Controls the action when the F1 - F12 keys are pressed and this object has focus.  
familytree CNT = containers: layout, grids, panes, and notebook, G = graph, T = table, W = window, r = reference only (cannot be set) A nested slotfiller of all objects contained in this object.  
fg ALL = all objects except reports (fundamentally different; can't be shown) except gT = graphTrace and W = window, fn = functional, p = persistent The foreground color of this object, usually text or values.

For tables, cells of any tableField for which fg is not explicitly set. For tableFields, cells.

For page objects, the boxes on the page.

For check and radio objects, a value area button when the corresponding value is 1.

For check, choice, label, radio, tableField, this attribute can be a list of values, which will be used cyclically - in the manner of Reshape - to assign colors to the value area buttons or rows individually;  note that for choice, the chosen item is displayed in the value area, whereas the items in the dropdown list are labels. (If this attribute is a list for a table, only the first value is used.)

For graph, applies to everything except the title and traces.

 
fggrayscale tF = tableField, fn = functional Foreground shade value in reports, 1 - white to 0 - black. A scalar or a function (in the callback i is the row). 0
field T = table The symbol of the selected field, i.e. column. The field and col attributes always indicate the same column. Setting field to Null is the same as setting col to -1: no field is selected.  
fields T = table The number of visible fields, or columns.  
filename Rp = report The name of the output file. report.ps
fill D = password The character displayed for every keyboard entry in the value area; '' for no fill. *
fillcolor gT = graphTrace, fn = functional, (click for more info) The fill color of various graph styles.  
firstcol A = array, M = matrix, T = table, V = view The index of the first visible column. 0
firstfield T = table The symbol of the leftmost displayed field of this object.  
firstrow A = array, M = matrix, T = table, V = view The index of the first visible row of this object. 0
fixedfields T = table The number of fixed fields of this object, i.e., fields on the left that do not participate in horizontal scrolling. The screen-display analogue of fixedreportcolumns. 0
fixedreport columns T = table The number of leftmost table columns that are to appear on the left side of each page of a report for this table. The printed analogue of fixedfields. 0
fkeys ALL = all objects except reports (fundamentally different; can't be shown), r = reference only (cannot be set) A slotfiller of function key, callback fn pairs for this object.  
focus NFT = not tableField or graphTrace Set to any value to give this object keyboard focus.  
followers TOP = top-level and popup objects only, (click for more info) A vector of symbols whose objects are removed from the screen when this object is iconified.  
followertree TOP = top-level and popup objects only, (click for more info) The followers of this object, in a boxed array.  
font ALL = all objects except reports (fundamentally different; can't be shown) except gT = graphTrace, W = window, fn = functional, p = persistent The font in which the value of this variable is set.

For table, used for any tableFields for which font is not explicitly set.

For graph, applies only to characters used as symbols in scatter and line-scatter traces.

kaplgallant
foot TOP = top-level and popup objects only If 1, include a footnote area at the bottom of this object.  
footer Rp = report The footer text.  
footer offset Rp = report The space above the footer text, in inches. 2
footnote G = graph ((click for more info)) The footnote text, a character matrix or vector of vectors. If empty or null, no footnote area is shown. Null (none)
footnote font G = graph ((click for more info)) The font in which the footnote is type set. kaplgallant-19
footnote justify G = graph ((click for more info)) Justify the footnote relative to the margins set with the bottom, top, left, and right attributes.  
format breakfunc tF = tableField, fn = functional The variable callback function that formats the break text. The d parameter contains the unformatted text.  
framebg O = notebook The color of the frame background. `deepskyblue4
frame linewidth Rp = report, T = table Page frame line width. 0 (thinnest)
frameoffset Rp = report, T = table Page frame offset; the spacing between frames, in inches. 2
framestyle Rp = report, T = table Page frame style: `center, `left, `right, `top, `bottom, or a combination, or `none. `none (null)
frame thickness O = notebook The frame thickness in pixels. 2
freeze NFT = not tableField or graphTrace If 1, setting attributes or respecifying variables will not alter the display of the object and its descendents; if 0, they will. Resetting to 0 will cause at least redrawing; for a layout, repositioning. Warning: if color cycling is on for an object, updates that occur while it is frozen will miss the first color, including updates followed immediately by unfreezing. 1
fullscreen TOP = top-level and popup objects only, a = action Make the window exactly as large as the screen and put it at location 0, 0. Setting fullscreen to 0 has no effect. 0
Attribute Keys
(POINT TO KEY FOR INFO)
Description Default
geometry ALL (list) = ALL, but meaningful only for the classes in list(I = radio, K = check, N = action, S = slot), fn = functional, p = persistent, (click for more info) The arrangement of slots in the display of a slotfiller object. 1
gradient gT = graphTrace, fn = functional, (click for more info) If 1, cycle through s.FILLCOLORS for every data point in a scatter plot or bar graph. If a function, call it for each point. 0
grid G = graph, (click for more info) Specify the axes that control the grid lines, or none.  
gridfg G = graph, (click for more info) The color of the grid lines.  
gridstyle G = graph, (click for more info) The style of the grid lines (solid, dotted, etc.).  
gridwidth G = graph, (click for more info) The width in pixels of the grid lines. 0 (thinnest)
h CNFT = NFT but only objects in containers If 1, don't change the height of this object's row on resize. 1 for hmenu
H CNFT = NFT but only objects in containers If 1, do not change the height of this object on resize. 1 for hmenu
has ALL = all objects except reports (fundamentally different; can't be shown), p = persistent If 1, whenever an attribute value is changed, report the new setting in the A+ session log, as a set of comments. 0
head TOP = top-level and popup objects only (popups only) If 0, remove the window manager's header on this object (including, of course, the pin). 1
header Rp = report The header text.  
header offset Rp = report The space below the header text, in inches. 2
headingbg grayscale tF = tableField Background shade value in reports, 1 - white to 0 - black. A scalar or a function (in the callback i is the row). 1
headingfg grayscale tF = tableField Foreground shade value in reports, 1 - white to 0 - black. A scalar or a function (in the callback i is the row). 0
heading style T = table, tF = tableField Heading style in reports: `left, `right, `top, `bottom, or a combination, or `none. `none (null)
hide NFT = not tableField or graphTrace, a = action Set to any value to hide this object. In a child of a layout, it must be set after the layout is shown, since show for a layout sets show for its children. See `show.  
hl NFT = not tableField or graphTrace The highlight border color when the object has focus. yellow
hlthickness NFT = not tableField or graphTrace The width in pixels of the highlight border around the object. 2; 0 for menus.
horizontal space R = tree The minimum distance between nodes in the same row of the widget, in pixels. 15
hscrollsize A = array, M = matrix, T = table, V = view The height in pixels of horizontal scrollbars on this object. 15
hscrollwith A = array, M = matrix, T = table, V = view, (click for more info) A list of names, in symbol form, of objects whose horizontal scrolling and column selection is to be synchronized with this object's; see the setfirstcol and setcol attributes. 0`
Attribute Keys
(POINT TO KEY FOR INFO)
Description Default
icon TOP = top-level and popup objects only An n x m boolean matrix of the bitmap pattern for the icon of this object, where n and m are at most 64. Appears in reverse video.  
iconic TOP = top-level and popup objects only If 1, this object is a top-level window; if 0, a popup. This attribute has no effect on the object named in s.WS when s.AUTOWS is 1. s.WS`a;`a has (`iconic;0) produces an error message.  
iconized TOP = top-level and popup objects only, cb = attribute with callback Function for event callback when the widget is iconized. Also see deiconized.  
icontitle TOP = top-level and popup objects only The title of the icon for this object.  
in ALL (list) = ALL, but meaningful only for the classes in list(A = array, C = command, hS = hscale, M = matrix, Q = scalar, S = slot, T = table, tF = tableField, vS = vscale), fn = functional, p = persistent Used to parse values entered on the screen, which are always in character vector form. Values of this attribute are usually functions. However, if the value is a character matrix and the character vector read from the screen is a row of this matrix, the value created for the workspace is the row index. in x:x for character workspace values; in x:x otherwise.
inc GS = hgauge, vgauge, hscale, and vscale The change in value when an arrow key is pressed: left or up, an increase; right or down, a decrease. Accepted for gauges, but meaningful only for scales. 1
increment C = command, D = password, Q = scalar, S = slot, cb = attribute with callback An event callback to be associated with the up arrow button that appears when arrowbuttons is 1. For a slot, there may be several up arrow buttons; the selected attribute gives the symbol for the entry whose button was pressed.  
incurrent workspace TOP = top-level and popup objects only, cb = attribute with callback In a CDE window, an event callback that is called when the window receives presence in the current workspace: that is, when the presence of a window is changed to include the current workspace or when the current workspace is changed to a workspace which includes this window from a workspace which did not include it. Cf. outofcurrentworkspace. See the caveats for deiconized in the callback section. Ignored outside CDE.  
index A = array, M = matrix, T = table, V = view A vector of indices of the rows that have been chosen (when refer is nonzero) since the object was bound or index was reset; sorted (formerly, in the order of selection).  If selectionmode is `single, index is 0 and can't be set; cf. selected for the index of the selected row. 0
insertabove A = array, M = matrix, T = table, cb = attribute with callback Controls the action when a user presses Shift-Meta-Insert or, on IBM keyboards, Shift-Alt-Insert. The default action is to insert a new row above the selected one. Set insertabove to 0 to turn off this key combination, and 1 to get the default action. 0
insertbelow A = array, M = matrix, T = table, cb = attribute with callback Controls the action when a user presses Meta-Insert or, on IBM keyboards, Alt-Insert. The default action is to insert a new row below the selected one. Set insertbelow to 0 to turn off this key combination, and 1 to get the default action. 0
is ALL = all objects except reports (fundamentally different; can't be shown), cb = attribute with callback, p = persistent Controls the action when the object is bound to a display class.  
Attribute Keys
(POINT TO KEY FOR INFO)
Description Default
justify B = label, N = action, U = button Justify the text in the title area. Settings `left, `right, `top, `bottom, 'l', 'r', 't', and 'b' are cumulative, to give all nine possible positions, unless settings begin with a dot, and several symbols or several characters can be included in one setting. Set to Null to restore the default position, centered both ways. has returns the character vector form. Null (centered)
key C = command, P = page, cb = attribute with callback Controls the action whenever a key is pressed.  
keysym P = page, r = reference only (cannot be set), (click for more info) The value represents the latest key press.  
l CNFT = NFT but only objects in containers If 1, left justify this object in its layout cell. 0
label ALL (list) = ALL, but meaningful only for the classes in list(E = choice, I = radio, K = check, M = matrix, N = action, R = tree, S = slot), fn = functional, p = persistent The text in the label areas.

For a display class for slotfillers, the value can be a single character vector or symbol that applies to every label, or a vector of character vectors or symbols that are used cyclically - in the manner of Reshape - to label each slot individually. A character matrix m can also be used, and it is treated as if it were <@1 m. The values do not replace the symbolic indices of the underlying slotfiller object.

For matrix, a single value can given, or a vector that applies to all labels, or a nested vector of length three, whose items apply to corner, row and column labels, respectively, in the manner just described. Column labels can have more than one row (see collabelrows); these labels can be specified as nested vectors of character vectors, or character matrices.

For a class for slotfillers:
the symbolic indices.

For a matrix:
(''; ('0'; '1'; ...); ('A'; 'B'; ...)).

labelfg ALL (list) = ALL, but meaningful only for the classes in list(E = choice, I = radio, K = check, M = matrix, N = action, R = tree, S = slot, GS = hgauge, vgauge, hscale, and vscale), fn = functional, p = persistent The color of the text in the label areas.

For a display class for slotfillers, this attribute can be given a vector of values that apply cyclically to the label areas.

For matrix, a single value can be given, or a nested vector of three items, each a scalar or vector, that apply to the corner label, the row labels, and the column labels, respectively.

For (gauges and) scales, the foreground color for the scale label.

`black
labelfont ALL (list) = ALL, but meaningful only for the classes in list(E = choice, I = radio, K = check, M = matrix, N = action, R = tree, S = slot, GS = hgauge, vgauge, hscale, and vscale), fn = functional, p = persistent The font in which the text in the label areas is type set. This attribute applies in the same manner as labelfg (above).

For (gauges and) scales, the font in which the scale label appears.

kaplgallant. If null, for matrix use font attribute.
labelinc GS = hgauge, vgauge, hscale, and vscale The increment between labels on the scale. A value of 0 means that s is to select an appropriate increment. 0
label justify GS = hgauge, vgauge, hscale, and vscale The justification of the scale label. One of `left, `right, `bottom, `top, `none. h: `bottom;
v: `left.
labelout GS = hgauge, vgauge, hscale, and vscale, fn = functional A format specification for the scale labels. If not functional, it is one of the forms shown in the next table. `float
leader TOP = top-level and popup objects only, (click for more info) The leader of this object for iconification (when the leader is iconified, this object is removed from the screen).  
leading T = table Default leading for reports: vertical spacing in pixels.  
left G = graph, (click for more info) The distance from the left side of the graph window to the rule of the y axis (visible or not), as a percentage of the window width. 0
left margin Rp = report The left margin of the report, in inches. 1
leftto NFT = not tableField or graphTrace Object to which Shift-left-arrow moves keyboard focus. Connected to arrowlist. [Future use] Null
legend G = graph, (click for more info) Position of the legend on the graph; e.g., `tl for top left.
Includes settings for outside the graph area.
`tl
gT = graphTrace, fn = functional, (click for more info) The text in the legend that identifies this trace. Null (varname[:n])
legendbg G = graph ((click for more info)) Color of rectangle containing legend; follows bg if not set. Null (grey)
legendfg G = graph ((click for more info)) The color of the text naming the traces in the legend. Null (black)
legend font G = graph ((click for more info)) The font in which the legend text is type set. lucidasans typewriter- 10
legendhl thickness G = graph, (click for more info) The width in pixels of the legend highlight area. 1
legend shadow thickness G = graph ((click for more info)) The width in pixels of the shadow area around the legend area, if present. 1
legend style G = graph ((click for more info)) Display the legend vertically, horizontally, horizontally with the last trace values, or not at all, using `ver, `hor, `lastvalue, `none. `ver
line P = page A k by 4 matrix of line coordinates. Each row represents a line with the format (r, c , nr, nc). Vertical lines should have nc equal 0 and horizontal lines should have nr equal 0. If both nr and nc are nonzero a vertical line is drawn, as if nc were 0. A vertical line begins at the top center of the character whose row and column indices in the page variable are r and c, respectively, and extends downward to the bottom center of the character nr rows below. A horizontal line starts at the left center and extends to the right center of the character nc columns to the right.

Line settings are not cumulative. Each setting of this attribute removes previous settings.

 
linecolor gT = graphTrace, R = Tree, fn = functional, (click for more info) The color of line graphs. from s.LINE COLORS
linestyle gT = graphTrace, fn = functional, (click for more info) The style of line graphs, e.g., solid or dashed. from s.LINE STYLES
linewidth gT = graphTrace, fn = functional, (click for more info) The width in pixels of line graphs. 0 (thinnest)
P = page The percent of the character width to be used to draw the lines specified by the line attribute. 10 (%).
literal ALL = all objects except reports (fundamentally different; can't be shown), p = persistent If 1, display character values in single quotes; if 0, don't. 0
lock position hP = hpane, L = layout, O = notebook, vP = vpane If 1, do not reposition the children in this object when some other children are removed (e.g., freed) or unmapped.  
locksize hP = hpane, L = layout, O = notebook, vP = vpane If 1, do not resize the layout when some children are removed (e.g., freed) or unmapped.  
lower TOP = top-level and popup objects only, a = action, s = set only Specify this attribute to send this object to the back of the visible windows.  
Attribute Keys
(POINT TO KEY FOR INFO)
Description Default
majortick size GS = hgauge, vgauge, hscale, and vscale The length in pixels of the major ticks on the scale. 10
mapped ALL (list) = ALL, but meaningful only for the classes in list(NFT = not tableField or graphTrace) The value is 1 if this object is mapped (to the screen), and 0 if unmapped. There are two cases:
  1. If this object is a top-level or popup window, its show attribute has value 1, and it is unmapped, then it is shown with blank contents.
  2. If it is not a top-level or popup window, its show attribute has value 1, and it or one of its ancestors is unmapped, then if it's shown, it is shown blank.
 
margin B = label, U = button Pixel width around text.  
margin height O = notebook The top and bottom margins of an object in its page, in pixels. 4
margins Rp = report, s = set only Use to set all four margins to the same value.  
margin width O = notebook The left and right margins of an object in its page, in pixels. 4
max GS = hgauge, vgauge, hscale, and vscale The maximum graphically displayed value. It is possible for it to be less than the value label. 100
maxtitle GS = hgauge, vgauge, hscale, and vscale The label that is shown for max. If null, there is no label and no space allowance for a label. Null
maxtitlefg GS = hgauge, vgauge, hscale, and vscale The color in which maxtitle appears. black
maxtitle font GS = hgauge, vgauge, hscale, and vscale The font in which maxtitle appears. lucidasanstype writer-bold-12
maxtitle justify GS = hgauge, vgauge, hscale, and vscale The justification for maxtitle. One of `none (no maxtitle), `top, `bottom (meaningful for hG, hS), `left, `right (meaningful for vG, vS), `center. `center
min GS = hgauge, vgauge, hscale, and vscale The minimum graphically displayed value. It is possible for it to be greater than the value label. 0
minortick count GS = hgauge, vgauge, hscale, and vscale The number of minor ticks between major ticks on the scale. 1
minortick size GS = hgauge, vgauge, hscale, and vscale The length in pixels of the minor ticks on the scale. 6
mintitle GS = hgauge, vgauge, hscale, and vscale The same as maxtitle, but for min. Null
mintitlefg GS = hgauge, vgauge, hscale, and vscale The same as maxtitlefg, but for min. black
mintitle font GS = hgauge, vgauge, hscale, and vscale The same as maxtitlefont, but for min. lucidasanstype writer-bold-12
mintitle justify GS = hgauge, vgauge, hscale, and vscale The same as maxtitlefg, but for min. `center
mnemonics hM = hmenu, vM = vmenu Keyboard accelerators for menus; a slotfiller of the same shape as the menu variable. The accelerator is the first letter of the symbolic index; the values are ignored.

If several buttons at the same level are given the same accelerator, it is underlined in all of them but that key affects only the first of those buttons. Note that the default for accelerators when s.MENUDEFAULTMNEMONIC is 1 (menu variable initials) does not address this potential problem; where duplicate initials exist, mnemonics must be set specifically to provide a full set of accelerators.

2<n()
mode G = graph, (click for more info) Set up interactive entry (`addtrace) or
set up text entry at `coordinate (`addtexttrace), or
terminate entry, like Enter or double click (`normal).
 
movelimit gT = graphTrace, fn = functional, (click for more info) Specify whether the x coordinate (`x) or y coordinate (`y) or neither (`none) remains fixed when the pointer is used to move a trace point. `x
Attribute Keys
(POINT TO KEY FOR INFO)
Description Default
na ALL (list) = ALL, but meaningful only for the classes in list(A = array, M = matrix, T = table, tF = tableField), p = persistent The value used for NA in the object, e.g., when new rows or cells are inserted. Cf. blank, and s.NA and t.NA. (x)s.NA for variable x.
naturalsize NFT = not tableField or graphTrace, a = action, s = set only The number of visible rows and columns may change with changes in the size of an object or its column widths. Specify naturalsize to make the number of visible rows and columns the same as when it was first mapped - or, for a container, to do so for its contained objects. At present, at least, setting naturalsize also sets firstrow and firstcol to zero.  
newshow CNT = containers: layout, grids, panes, and notebook, G = graph, T = table, W = window For an existing container: if 1, a reparented child (see reparent) is always reshown and an unbound variable is shown; if 0, a reparented child is reshown only if mapped and an unbound variable is not shown; if Null, use the value of s.AUTONEWSHOW. 0
newspaper column T = table Number of columns in which the table is arranged on the report page (allows a narrow table to fill a page better). 1
nodebg R = tree The background color of the nodes. `violetred
nodefg R = tree The foreground color of the nodes. `yellow
notify NFT = not tableField or graphTrace, cb = attribute with callback Furnishes a callback function for a notify event. See "Accessing the Primary Selection Buffer".  
orientation O = notebook, R = tree, Rp = report Notebook (orientation on page) and tree: `horizontal or `vertical.
Report (orientation of report on paper): `landscape or `portrait.
`horizontal or `landscape
out ALL (list) = ALL, but meaningful only for the classes in list(A = array, C = command, M = matrix, Q = scalar, S = slot, T = table, tF = tableField), fn = functional, p = persistent Specifies the format in which data appears in a display.

The value can be a valid left argument to (Format) or _fmt, in which case the data are formatted according to the rules of those functions. In addition, the value can be one of those in the "out Attribute Format Samples" table. Also see the _sfmt function.

If the object is a slotfiller, individual formats can be given, as in (`out;(fmt1;fmt2;...;fmtn)).

If the value of this attribute is a character matrix and the data to be displayed are valid row indices of the matrix, then each data element is replaced in the display by the text of the row it indexes.

out x:{ 1x} for numeric; out x:x for character; out x:{ s.box{x}} otherwise. Sensitive to the blank attribute.
outofcurrent workspace TOP = top-level and popup objects only, cb = attribute with callback In a CDE window, an event callback that is called when the window loses presence in the current workspace: that is, when the presence of a window is changed to exclude the current workspace or when the current workspace is changed to a workspace which does not include this window from a workspace which included it. Cf. incurrentworkspace. See the caveats for deiconized in the callback section. Ignored outside CDE.  
outputmode Rp = report `ps: PostScript; `eps: Encapsulated PostScript; `ppm: Portable Pixmap. `ps
outputstyle T = table `columnmajor, `rowmajor - report page arrangement.
`aligned, `noheadings - for ASCII tables.
`rowmajor
Attribute Keys
(POINT TO KEY FOR INFO)
Description Default
pagebreakcb Rp = report, fn = functional Function and optional static data for page breaks.  
page breakon tF = tableField When set to 1, a page break is inserted after a column break. 0
page changecb O = notebook, cb = attribute with callback Callback when the current page is changed by a user. Null (none)
pagecontrol Rp = report Vector listing pages to be printed. Null (all)
pagecount Rp = report, r = reference only (cannot be set) Number of pages printed so far.  
pagecount total Rp = report, r = reference only (cannot be set) Total number of pages in the whole report.  
pageinc GS = hgauge, vgauge, hscale, and vscale The amount of the increase in value when PageUp is pressed and decrease when PageDown is pressed. Accepted for gauges, but meaningful only for scales. 10
page numbering Rp = report Print page numbers (1) or not (0). 1
page numbers Rp = report Vector of numbers: i-th element is page number of i-th page. Null (i for i)
pagenumber text Rp = report Vector or nested vector of text to be printed with page numbers.  
page selection ALL = all objects except reports (fundamentally different; can't be shown) (except gT = graphTrace, Rp = report, tF = tableField) If 1, when the object is a child of a notebook, its page can be selected;
if 0, its page cannot be selected and its pagetitle (on the tab) is lightened.
If its page is already selected when its pageselection attribute is set to 0, the page remains displayed (but its pagetitle is lightened).
Null (1;   s.of says 1 when in notebook and null when not).
pagesize Rp = report Page size: one of
`legal (8.5x14");
`letter or `a (both 8.5x11");
`b (11x17");
`a4 (210x279mm); or
`b5 (182x257mm).
May not work on non-HP printers.
`letter
pagetitle ALL = all objects except reports (fundamentally different; can't be shown) (except gT = graphTrace, Rp = report, tF = tableField), but only when the child of a notebook The title to be shown on the notebook tab for an object that is a child of a notebook. Null (the title, which itself has the variable name as default).
parent ALL = all objects except reports (fundamentally different; can't be shown) (except report), r = reference only (cannot be set) The object whose variable explicitly contains this object. Top-level objects are their own parents. Inclusion in a report is ignored - a report object cannot be a parent -, and the parent attribute is not defined for report objects.  
pieangle gT = graphTrace If pieprimaryslicealign is `none, pieangle gives the orientation of the primary slice of a pie chart in counterclockwise degrees from the three o'clock position. 0
pie aspectratio gT = graphTrace The extent to which a pie chart is tilted towards the viewer, ranging from 0.0 to 1.0. 1.0 is a top view, or flat pie. 0.6
pie depthfactor gT = graphTrace The maximum height of the pie in a pie chart, as a fraction of the standard depth factor. Cf. pieprofiles. 1.0
pie legendalign gT = graphTrace Where the legend for each slice of a pie chart is placed. Values are null, `none, `inside, `outside, `left, `right, `top, `center, and `bottom. The last five control placement with regard to values and percentages and will be ignored if not consistent with the values of pievaluealign and piepercentalign. Several values may be concatenated, as in `inside`top`left.  The color is controlled by the trace's titlefg attribute. `center
pie offsetmargin G = graph The margin around pie charts, as a fraction of the available space. The value ranges between 0 (inclusive) and 1 (exclusive). 0 makes pie charts as large as possible in the graph. 0.99 makes them dots. Values close to 1 cause calculation overflows, which appear as A+ domain errors. Approx 0.3
pieoffsets gT = graphTrace The extent to which each slice is separated (pulled out) from the center of a pie chart. Values between 0.0 and 1.0 (inclusive) are treated as fractions of the pie's radius. Values greater than 1.0 and equal to or less than 100.0 are treated as percentages of the pie's radius. The value or values given are used cyclically for the slices. 0
pie percentalign gT = graphTrace Where to place the display of the percentage that each slice is of a pie. Values are null, `none, `inside, `outside, `left, `right, `top, `center, and `bottom. The last five control placement with regard to values and legends and will be ignored if not consistent with the values of pievaluealign and pielegendalign. Several values may be concatenated, as in `inside`top`left.  The color is controlled by the trace's titlefg attribute. Null
pie primaryslice gT = graphTrace The trace index of the slice to be considered the "primary" slice of a pie chart, the slice whose display is controlled by pieprimaryslicealign or pieangle. The value -1 means that the largest slice will be considered the primary slice. For a brief time, called primaryslice. -1
pieprimary slice align gT = graphTrace Where to place the primary slice of a pie chart (by rotating the pie). The possible values are null, `none (see pieangle), `left, `right, `top, `bottom. For a brief time, called primaryslicealign. Null (`top)
pieprofiles gT = graphTrace The height of each slice of a pie, as compared to the maximum height of the pie. Values between 0.0 and 1.0 (inclusive) are treated as fractions of the pie's maximum height. Values greater than 1.0 and equal to or less than 100.0 are treated as percentages of the pie's maximum height. The value or values given are used cyclically for the slices. 1.0
pie valuealign gT = graphTrace Where to place the display of the value of each slice of a pie chart. Values are null, `none, `inside, `outside, `left, `right, `top, `center, and `bottom. The last five control placement with regard to percentages and legends and will be ignored if not consistent with the values of piepercentalign and pielegendalign. Several values may be concatenated, as in `inside`top`left. The format of the value display is controlled by the out attribute, and the color is controlled by the trace's titlefg attribute. Null
pin TOP = top-level and popup objects only (popups only), (click for more info) If 1 and this object is a popup window, the window is pinned; if 0, it is unpinned. 0 if a popup
position hR = hgrid, L = layout, vR = vgrid, (click for more info) Applies to simple vector layouts unless s.AUTOBUILD is 1 and the objects in the layout already appear on the screen.
If 1, the layout will be in the default vertical form;
if 0, all its children have their at attribute equal to 0 0 1 1, so that they overlap;
if Null, use the value of s.AUTOPOSITION.
Note:  this attribute must be set before the layout, lout, say, is built: i.e., start with lout(), set the attribute value, and then set lout to its correct value.
1
preset ALL = all objects except reports (fundamentally different; can't be shown), p = persistent Specify a preset callback on this object.  
primary NFT = not tableField or graphTrace Set this attribute in order to specify the primary selection buffer, and reference it to read that buffer. See "Accessing the Primary Selection Buffer".  
primaryslice gT = graphTrace Briefly called this, but now called pieprimaryslice.  
primaryslice align gT = graphTrace Briefly called this, but now called pieprimaryslicealign.  
print NFT = not tableField or graphTrace, a = action Specify this attribute to "print" the object in a file.
If running in batch mode, not in Emacs, allow a slight delay between mapping a file and printing it, to avoid a race condition: for example, if a legend is specified for a graph and the graph is printed immediately, the legend may not appear in the print file.
 
printable ALL = all objects except reports (fundamentally different; can't be shown), p = persistent If 1, printable by the opt gadget. See /aplus/lib/s/
If Null, use s.AUTOPRINTABLE.
1
printbottom NFT = not tableField or graphTrace The bottom page margin, in inches. 1
print defaultfont NFT = not tableField or graphTrace The printer font used when the display font is unavailable. courier
printdis bottom margin NFT = not tableField or graphTrace Disclaimer offset from bottom edge of paper, whether in portrait or landscape orientation. .27 in.
printdisfile NFT = not tableField or graphTrace Path and file name of an ASCII text file. Spacing between words is honored and newlines are ignored. none
printdisfont NFT = not tableField or graphTrace The font in which to print the disclaimer. times- roman-6
printdis left margin NFT = not tableField or graphTrace Disclaimer offset from left edge of paper, whether in portrait or landscape orientation. .27 in.
printdis orientation NFT = not tableField or graphTrace Controls the orientation of the disclaimer:
same as object if `none or printdisstyle is `append;
else `portrait or `landscape regardless of object orientation.
`none
printdis right margin NFT = not tableField or graphTrace Disclaimer offset from right edge of paper, whether in portrait or landscape orientation. .27 in.
printdis rulewidth NFT = not tableField or graphTrace The width of the disclaimer rules. See printdisstyle, below. 0 (very thin)
printdis style NFT = not tableField or graphTrace Governs printed disclaimer:
`none;
`text only;
text in `box;
text with `rule above and below;
text below `toprule; or
text `appended to top-level window
(scrollbars cause offset in both directions by their width).
`none
printdistop margin NFT = not tableField or graphTrace Minimum distance between disclaimer text and bottom of the object being printed. Maximum setting is one inch. .27 in.
printfile NFT = not tableField or graphTrace Name of the file to receive the printed object. Set printfile to null to restore the default. Use the pageview or ghostview command to show print.ps on a display screen. print.ps
printleft NFT = not tableField or graphTrace The left page margin, in inches. 1
printmode NFT = not tableField or graphTrace Rendition of the object:

`mono - black and white;

`color - color on a color printer, grayscale on others;

`reverse - reverse black and white;

`colorfg - white background and true foreground colors (i.e., colors set with fg attributes) on a color printer, variable shading on a noncolor printer.

`mono
print orientation NFT = not tableField or graphTrace `portrait or `landscape (rotated 90 degrees). `landscape
printoutput mode NFT = not tableField or graphTrace `ps for Postscript.
`eps for encapsulated Postscript and `ppm for portable pixmap;
in these modes, printing the disclaimer is disabled, and if printfile is of the form fn.ps the file that receives the printed object is fn.eps or fn.ppm, respectively.
A ppm file can be converted to a gif file using the Unix command ppmtogif, and Mosaic and Netscape can display gif files directly, as image references in html files.
`ps
printright NFT = not tableField or graphTrace The right page margin, in inches. 1
printsize NFT = not tableField or graphTrace Page size, one of:
`legal (8.5x14");
`letter or `a (both 8.5x11");
`b (11x17");
`a4 (210x279mm); or
`b5 (182x257mm).
May not work on non-HP printers.
`letter
printstyle NFT = not tableField or graphTrace Placement on the paper. One or more of `left, `right, `top, `bottom, `center, and `none. `center
printtop NFT = not tableField or graphTrace The top page margin, in inches. 1
protect ALL (list) = ALL, but meaningful only for the classes in list(A = array, C = command, E = choice, gT = graphTrace, I = radio, K = check, M = matrix, N = action, Q = scalar, S = slot, T = table, tF = tableField, U = button), fn = functional, p = persistent If 1, the values in this object cannot be edited (in the case of a graph trace, a point can't be dragged to a new position); an attempt to do so will elicit a beep.

For array, check, page, slot, and tableField objects, this attribute can be given a list of values, which is used cyclically - in the manner of the A+ primitive function Reshape - to protect each cell, or value area, individually.

A table can be protected entirely or not at all; if it is protected, then so are all its fields, independent of their individual protect settings; see protected, immediately below.

Note that the setting of this attribute has no effect on behavior controlled by the insertabove, insertbelow, select and delete attributes.

0
protected ALL (list) = ALL, but meaningful only for the classes in list(A = array, C = command, E = choice, gT = graphTrace, K = check, M = matrix, N = action, Q = scalar, S = slot, T = table, tF = tableField, U = button), p = persistent, r = reference only (cannot be set) If 1, protection, as defined by the protect attribute, is on for this object. This attribute is most useful for tableFields because the protect setting for the table overrides the settings on the individual tableFields.  
Attribute Keys
(POINT TO KEY FOR INFO)
Description Default
r CNFT = NFT but only objects in containers If 1, right justify this object in its layout cell. 0
R hP = hpane, I = radio, K = check, L = layout, N = action, O = notebook, S = slot, vP = vpane If 1, make all virtual rows of this object the same size.  
raise TOP = top-level and popup objects only, a = action, s = set only Specify this attribute to bring this object to the front.  
rband P = page, cb = attribute with callback, (click for more info), (click for more info) The action taken when a rubberband box is created. If rband is 0, none. If 1, the default.

When a rubberband box is created, the rbandbox attribute is set no matter what the setting of rband, and even for boxes whose number of rows and columns is 0 0.

Draw outline and append new rbandbox setting to box, unless 0 0 size.
rbandbox P = page, r = reference only (cannot be set), (click for more info) (row, col, #rows, #cols) of the most recent rubberband box. 0 0 0 0
realize CNFT = NFT but only objects in containers, a = action, s = set only Specify this attribute to completely prepare this object for showing. Then when this layout object is shown, it will appear all at once, and not in a staggered fashion.  
recursively CNT = containers: layout, grids, panes, and notebook, G = graph, T = table, W = window, a = action, s = set only Propagates an attribute value to the object and all its descendents; the value of recursively is an attribute-value pair, as in
`v has (`recursively; (`attr;val))
which is tantamount to
(`v,`descendents of `v) has <(`attr;val)
 
refer A = array, C = command, D = passwordG = graph, gT = graphTrace ((click for more info));   M = matrix, Q = scalar, R = tree, S = slot, T = table ((click for more info)), V = view;   cb = attribute with callback (G = graph, gT = graphTrace), cb = attribute with callback (the rest), (click for more info) "Double click" left mouse button in a cell. The default action is to highlight the referred row. See index. Set refer to 0 to turn off the left mouse button, and 1 to get the default behavior. Press the left mouse button on a referred row to remove the reference. 0
referpoint gT = graphTrace, cb = attribute with callback, (click for more info) This action controls a referpoint event. Note, for coincident points: trace search order is the same as the drawing order.  
refresh NFT = not tableField or graphTrace, a = action, s = set only Refresh the visual appearance of this object to reflect recent settings of display related attributes such as fg and out.  
reparent CNT = containers: layout, grids, panes, and notebook, G = graph, T = table, W = window If 1, a child removed from the container will become a top-level object; if 0, it is freed; if Null, use the value of s.AUTOREPARENT. Null (1)
report Rp = report, a = action Print all of the object, not just what is shown on the screen, perhaps on several pages.  
reportfont ALL (list) = ALL, but meaningful only for the classes in list(T = table, tF = tableField), fn = functional, p = persistent Font for report. If it is not set on tableField, the value for table is used.  
report headingfont ALL (list) = ALL, but meaningful only for the classes in list(T = table, tF = tableField), fn = functional Font for column heading in report. If it is not set on tableField, the value for table is used.  
report totalfont T = table The font in which the totals (if shown) appear.  
reporttotal leading T = table The vertical space, in points, around totals, if shown. 2
report totalon T = table Whether totals are shown in reports (1) or not (0). 0
report totalstyle T = table One or more of `left `right `top `bottom. `left
request NFT = not tableField or graphTrace, a = action, s = set only Specify this attribute to trigger a subsequent notify event. See "Accessing the Primary Selection Buffer".  
reshow CNT = containers: layout, grids, panes, and notebook, G = graph, T = table, W = window If 1, a reparented child (see reparent) is reshown if it was shown in its previous parent;
if 0, it is not;
if Null, use the value of s.AUTORESHOW.
Null (0)
resize CNFT = NFT but only objects in containers, (click for more info), (click for more info) Constrains resizing the object in a layout, and controls its position within its allotted layout area. Each setting (character string or symbol) is the total constraint if it contains a period; otherwise it is additional to previous settings.

Set to Null to get back to the default setting, and to '' or '.' to eliminate all constraints.

Setting h, H, w, or W to 1 (but not to 0) sets resize; setting resize sets these four attributes.

button, label, scalar, check, radio, and slot: 'hH' (or `hH);
all others: ''.
resizeable TOP = top-level and popup objects only If set to 1, this object can be resized interactively by a viewer; if 0, it cannot. This attribute must be set before this object is mapped.  
respace ALL (list) = ALL, but meaningful only for the classes in list(A = array, C = command, M = matrix, Q = scalar, S = slot, T = table, tF = tableField), p = persistent If respace is 1, the space attribute value is increased if it is less than the length of the result of the default out function;
if 0, it is not;
if Null, use the value of s.AUTORESPACE.
Null (0)
right G = graph, (click for more info) Distance from the right side of the graph window to the Y-axis rule (visible or not), as a percentage of window width. 0
right margin Rp = report The right margin of the report, in inches. 1
rightto NFT = not tableField or graphTrace Object to which Shift-right-arrow moves keyboard focus. Connected to arrowlist. [Future use] Null
row A = array, M = matrix, T = table, V = view The row index of the selected cell. The value can be -1 to indicate that no row or cell is selected. Setting this value causes the selected row to appear in the display, and, if the col attribute is set to a valid column index, the selected cell at position (row, col) to be highlighted. -1
rowbg A = array, M = matrix, T = table, V = view The background color of the selected row. The selected cell is always in the selected row; the value of the selectbg attribute is used in place of the rowbg attribute for this cell. lightsteelblue3
rowcontrol T = table Vector of table rows to be shown on page.  
rowindex M = matrix A vector of indices of the selected row labels when the selectrow attribute is 1, in the order of selection. 0
row indexbg M = matrix The background color of the indexed row labels. medium aquamarine
row pagespan T = table Number of pages that the table rows are to span. 0
rows A = array, M = matrix, T = table, V = view, X = text The number of visible rows in the display of this object. at most 5;
for text, 5.
rowsep A = array, M = matrix, T = table, V = view If n, row separators appear every n rows. 0: no separators. 1
rule G = graph, (click for more info) Specify which axis rules appear. `std
rulewidth G = graph, (click for more info) The width of the axes rules and tick marks, in pixels. 0
Attribute Keys
(POINT TO KEY FOR INFO)
Description Default
save X = text, cb = attribute with callback If 1, the value of the underlying character vector is updated to match the text that appears on the screen (or that can be made to appear with the scrollbars) whenever the user presses the Control-s key combination.
If save is 0, pressing Control-s has no effect.
1
scalefont Rp = report Whether or not to scale the table font when row or column constraints exceed the page size. If the font is not scaled, the exceeded constraints are ignored. 1
scalefontcb Rp = report, fn = functional Function and optional static data for variable-type callback when fonts are scaled.  
script ALL (list) = ALL, but meaningful only for the classes in list(NFT = not tableField or graphTrace), p = persistent If 1, the s definition of this object will appear in the result of s.script{};
if 0, it will not appear;
if Null, use the value of s.AUTOSCRIPT.
Null (1)
scrollbg A = array, M = matrix, T = table, V = view, W = window If one element, the background color of any scrollbars on this object; if two, the vertical, horizontal scrollbar colors. Also see bg. grey, grey
scrollsize A = array, M = matrix, T = table, V = view, W = window The height in pixels of any scrollbars on this object. 15
select A = array, M = matrix, R = tree, T = table, V = view, cb = attribute with callback, (click for more info) Function and static data for an event callback triggered by
a left mouse button click on a value area,
movement from one field to another by an arrow key, or
a deletion that deletes the last row (changing the row attribute).
Select the cell holding the pointer.
selectable gT = graphTrace, fn = functional, (click for more info) If 1, refer events are active for this line or text trace;
if 0, they are not.

For selectable to be nonzero, the trace's trace set must have exactly two columns (i.e., just one trace in the set, with x coordinates explicitly given).

1 if the trace is user created; 0 otherwise.
selectbg A = array, M = matrix, T = table, V = view The background color of a selected cell. grey
selectcol M = matrix, cb = attribute with callback, (click for more info) This action controls a select column event. 0
select corner M = matrix, cb = attribute with callback, (click for more info) This action controls a select corner event. 0
select distance G = graph, (click for more info) The maximum distance in pixels between the pointer and a trace point in order that the point be selected for moving. 10
selected A = array, G = graph, gT = graphTrace ((click for more info)), I = radio, K = check, M = matrix, N = action, R = tree, S = slot, T = table, V = view Row and column indices or symbolic index of selected cell or trace point; for a graph, the selected trace set object.
Also for tree.
 
selected field T = table The value is a pair consisting of the row index and the tableField name (as a symbol) of the selected cell. A row index of -1 means none selected. (-1;x), x being the object in the leftmost column.
selected nodebg R = tree The background color of the currently selected node. Changes when nodefg is changed if the two are alike. `nodefg
selected nodefg R = tree The foreground color of the currently selected node. Changes when nodebg is changed if the two are alike. `nodebg
selected pagebg O = notebook The background color of the currently selected page. `grey
selected pagefg O = notebook The foreground color of the currently selected page. `black
select field T = table, cb = attribute with callback, (click for more info) Mouse button event on the title area of a field. The default action is to select the field whose title area holds the pointer. The selected cell becomes the one at the intersection of the selected row and selected field. See Description.
selection mode A = array, M = matrix, T = table, V = view, (click for more info) Controls whether only one row can be selected at a time (`single) or several (`multiple). When changed to `single, the index attribute is set to 0 and all rows but the one (if any) indicated in the selected attribute are "deselected"; when changed to `multiple, index is set to the row (if any) indicated in selected. `multiple for array and view;
`single for table.
selectrow M = matrix, cb = attribute with callback, (click for more info) This action controls a select row event. 0
sensitive NFT = not tableField or graphTrace If 0, all user interactions with this object and its descendents are blocked. 1
set ALL = all objects except reports (fundamentally different; can't be shown), p = persistent Specify a set callback on this object.  
setcol A = array, M = matrix, T = table, V = view, cb = attribute with callback Callback has been disabled; use the select callback instead.
Here is the definition anyway:
If 0 (the default), no callback when col is set.
If 1, when a column is selected by user or program, but not by a setcol callback, the default callback is executed (see next column).
If (f;s), when a column is selected by user or program, but not by a setcol callback, f{s;c;v} is called.
Set col to the same value in the objects named in hscrollwith.
setfirstcol A = array, M = matrix, T = table, V = view, cb = attribute with callback If 0 (the default), no callback when firstcol is set.
If 1, when firstcol is set by user or program, but not by a setfirstcol callback, the default callback is executed (see next column).
If (f;s), when firstcol is set by user or program, but not by a setfirstcol callback, f{s;c;v} is called.
Note that a setfirstcol callback can be triggered when firstcol is set as a result of the selection (by program) of a column which is not currently being shown.
Set firstcol to the same value in the objects named in hscrollwith.
setfirstrow A = array, M = matrix, T = table, V = view, cb = attribute with callback Like setfirstcol, but for vertical scrolling and vscrollwith. Like setfirstcol
setrow A = array, M = matrix, T = table, V = view, cb = attribute with callback Like setcol, but for row selection and vscrollwith.
Callback has been disabled; use the select callback instead.
Like setcol
settings ALL = all objects except reports (fundamentally different; can't be shown), r = reference only (cannot be set) (`settings;v) of `object is, for a symbol scalar or vector v, a slotfiller holding, generally speaking, the attributes and values of the attributes named in v for `object that have nondefault values; if v is absent, as in `settings of `object, the result is a slotfiller holding, generally speaking, the attributes and values of all attributes for `object that have nondefault values.  
shadow thickness NFT = not tableField or graphTrace, (click for more info) The width in pixels of the shadow area around this object. 0; 2 for graph.
shell ALL = all objects except reports (fundamentally different; can't be shown), r = reference only (cannot be set) The top-level object containing this object.  
shelltitle TOP = top-level and popup objects only The title of this object in the window manager's title area. The default is:
for the first top-level object shown, or the object specified in s.WS, either the contents of s.WSNAME, or if _argv is not empty, 0_argv;
for all others, the name of the object.
See Description.
show NFT = not tableField or graphTrace, a = action If 1, show this object; if 0, hide it. I.e., show and hide a top-level object on the screen, and any other object in its container; see the show and hide functions. Cf. the realize and syncshow attributes.  
show binding O = notebook Show a spiral binding on the notebook (1) or not (0). 1
show popup O = notebook When the right mouse button is pressed with the pointer on the notebook, show a popup menu allowing selection of a page (1), or do not respond to the button press (0). 1
showtabs O = notebook Show tabs at edges of pages of notebook (1) or not (0). 1
size A = array, M = matrix, T = table, V = view, a = action, s = set only Setting size eliminates partial rows and columns.  
sliderbg GS = hgauge, vgauge, hscale, and vscale The color of the slider, the moving part in a gauge or scale. grey
slider height GS = hgauge, vgauge, hscale, and vscale The vertical dimension in pixels of the slider, the moving part in a gauge or scale. A setting given for a vgauge is ignored. vscale: 30; hscale and hgauge: 14.
slider width GS = hgauge, vgauge, hscale, and vscale The horizontal dimension in pixels of the slider, the moving part in a gauge or scale. A setting given for an hgauge is ignored. vscale and vgauge: 14; hscale: 30.
space ALL (list) = ALL, but meaningful only for the classes in list(A = array, C = command, M = matrix, Q = scalar, S = slot, T = table, tF = tableField), p = persistent Width in characters of the data display. If the space originally needed to display the data, computed using the out attribute, exceeds the space attribute, then this attribute is increased to the space needed. If data are changed in an object already being displayed and the space becomes insufficient, then the display is governed by the respace and stars attributes. Setting the title or out attribute increases the space attribute if necessary to fit title or data. depends on the data;
cf. s.WP and s.DATASPACE
stars ALL (list) = ALL, but meaningful only for the classes in list(A = array, M = matrix, Q = scalar, S = slot, T = table, tF = tableField), p = persistent If 1, fill a cell or row with *'s when there is insufficient room for the value; if 0, truncate the value display. 1
state ALL = all objects except reports (fundamentally different; can't be shown), Rp = report, r = reference only (cannot be set) A character vector holding the s definition of this object, but not the value of this variable. In a layout, only one definition is shown for any name that appears in it several times, for economy. For tableFields and graphTraces, the class does not appear in the result of state, to keep it executable.  
stateself ALL = all objects except reports (fundamentally different; can't be shown), Rp = report, r = reference only (cannot be set) Like state, but for the object only, without recursion.  
structure CNT = containers: layout, grids, panes, and notebook, r = reference only (cannot be set) The value is a slotfiller object with the settings of the at attribute for all children of this object.  
style gT = graphTrace ((click for more info)), T = table, tF = tableField, fn = functional The type of graphic representation for a trace set.
Also, the style of a column, one or more of `left `right `top `bottom. If it is not set for a tableField, the value for its table is used, if set.
`line for a trace set. Null (`left) for tableField.
subtitle G = graph ((click for more info)), GS = hgauge, vgauge, hscale, and vscale The subtitle text.  
subtitlefg G = graph ((click for more info)), GS = hgauge, vgauge, hscale, and vscale The color in which the subtitle appears. `axiscolor for graph.
subtitle font G = graph ((click for more info)), GS = hgauge, vgauge, hscale, and vscale The font in which the subtitle is type set. lucidasans type writer- 12 for graph.
subtitle justify G = graph ((click for more info)), GS = hgauge, vgauge, hscale, and vscale Justify the subtitle. `center for graph.
suppress duplicate T = table Suppress (show as blank) any tableField entry that duplicates its immediate predecessor (1) or show it (0). 0
symbol gT = graphTrace, fn = functional, (click for more info) The symbol marking the data points in a scatter trace. `cross
symbolsize gT = graphTrace, fn = functional, (click for more info) The size in pixels of the symbols in a scatter trace. 10
syncshow NFT = not tableField or graphTrace, a = action Like show, except that (`syncshow;1) waits, unlike (`show;1), processing X-Events until its own MapNotify event is found. Processing then continues normally. This avoids the problem that occurs when labels and views in layouts are used as progress indicators (status reports on program initialization, for instance) but are not refreshed until after the program has finished loading and finally hits the mainloop.  
Attribute Keys
(POINT TO KEY FOR INFO)
Description Default
t CNFT = NFT but only objects in containers If 1, top justify this object in its layout cell. 0
tabfrom NFT = not tableField or graphTrace The object preceding this object in traversal order; if this object has focus, then press Meta-Shift-Tab or, on IBM keyboards, Alt-Shift-Tab to give that object focus.  
tablist TOP = top-level and popup objects only Vector of objects within this object in their order of traversal; pressing Meta-Tab or, on IBM keyboards, Alt-Tab repeatedly will give focus to these objects in the stated order. Each object can appear only once in the list.  
tabto NFT = not tableField or graphTrace The object following this object in traversal order; if this object has focus, then Meta-Tab or, on IBM keyboards, Alt-Tab to give that object focus.  
textactivate gT = graphTrace, cb = attribute with callback, (click for more info) The action taken when this text trace is interactively modified.  
textfg gT = graphTrace Color of text trace; symbol or character string (converted to symbol by s). `white
textfont gT = graphTrace Font of text trace; symbol or character string (converted to character by s). lucidasans type writer- 12
3down P = page, cb = attribute with callback A 3down event occurs when the right mouse button is pressed.  
3up P = page, cb = attribute with callback A 3up event occurs when the right mouse button is released.  
title ALL = all objects except reports (fundamentally different; can't be shown) (except B = label, hM = hmenu, hR = hgrid, vM = vmenu, vR = vgrid, X = text), p = persistent, (click for more info) The text in the title area of this object.  The value can be:  for one row, a character vector or scalar, or a symbol;  for one or more rows, a character matrix, a nested vector of character vectors or scalars, or a simple symbol vector.  There are various other possibilities, whose acceptance and interpretation depend upon the display class involved;  avoid them!  For graphTrace, meaningful for text traces only. See "Default and Coincident Titles".
titlefg ALL = all objects except reports (fundamentally different; can't be shown) (except B = label, hM = hmenu, hR = hgrid, vM = vmenu, vR = vgrid, X = text), p = persistent The color in which the text of the title appears. For graphTrace, meaningful for text and pie traces only. A tableField inherits its value from its table, and when the value for tableField is reset to Null it uses the current value for table. black
titlefont ALL = all objects except reports (fundamentally different; can't be shown) (except B = label, hM = hmenu, hR = hgrid, vM = vmenu, vR = vgrid, X = text), p = persistent The font in which the title is set. For graphTrace, meaningful for text and pie traces only. A tableField inherits its value from its table, and when the value for tableField is reset to Null it uses the current value for table. kaplgallant
titlejustify G = graph ((click for more info)), GS = hgauge, vgauge, hscale, and vscale, NFT = not tableField or graphTrace from Rel. 4.10 Justify the title: `left `right `bottom `top `center `none. `center
top G = graph, (click for more info) The distance from the top of the graph window to the X-axis rule (visible or not), as a percentage of the window height. 0
topmargin Rp = report The top margin of the report, in inches. 1
2down P = page, cb = attribute with callback A 2down event occurs when the middle mouse button is pressed.  
2up P = page, cb = attribute with callback A 2up event occurs when the middle mouse button is released.  
Attribute Keys
(POINT TO KEY FOR INFO)
Description Default
underline P = page, fn = functional Boolean mask indicating underlined characters.  
uniform scaling Rp = report Scale proportionally on x and y axes (1) or not (0). 1
upto NFT = not tableField or graphTrace Object to which Shift-up-arrow moves keyboard focus. Connected to arrowlist. [Future use] Null
valid D = password, r = reference only (cannot be set) 1 if the text entered in the value area matches the password for the user name in the global variable; 0 otherwise. 0
validate D = password, cb = attribute with callback The function that is called when keyboard entry is completed (by an Enter).  
valuefg GS = hgauge, vgauge, hscale, and vscale The color of the value label, which shows the present value of the underlying variable. black
valuefont GS = hgauge, vgauge, hscale, and vscale The font of the value label, which shows the present value of the underlying variable. lucidasans typewriter bold-12
value justify GS = hgauge, vgauge, hscale, and vscale The position of the value label, which shows the present value of the underlying variable. Values: `top `bottom `left `right `center `none. The last deletes the number. `center `top
vcol CNFT = NFT but only objects in containers See the at attribute.  
vcols CNFT = NFT but only objects in containers See the at attribute.  
vcolspace hP = hpane, L = layout, O = notebook, vP = vpane Space between the virtual columns of a layout, in pixels. Null (0)
verify ALL = all objects except reports (fundamentally different; can't be shown) Most display classes require a variable to satisfy certain rank and type restrictions.

If 0, the A+ interpreter verifies them; when a bound variable is assigned a value inappropriate to its display class, an " : invalid" message is issued and execution is suspended.

If 1, s context functions verify them; an inappropriate value elicits a more meaningful message, followed by a stop.

If Null, the value of s.VERIFY is used. [Future use]

0
vertical space R = tree The minimum distance between vertically aligned nodes, in pixels. 5
vrow CNFT = NFT but only objects in containers See the at attribute.  
vrows CNFT = NFT but only objects in containers See the at attribute.  
vrow space hP = hpane, L = layout, O = notebook, vP = vpane Space between virtual rows of a layout, in pixels. Null (0)
vscroll size A = array, M = matrix, T = table, V = view The width in pixels of a vertical scrollbar on this object. 15
vscroll with A = array, M = matrix, T = table, V = view, (click for more info) Like hscrollwith, but vertical scrolling, setfirstrow, setrow. 0`
w CNFT = NFT but only objects in containers If 1, do not change the width of the row containing this object on resize. 1 for vmenu
W CNFT = NFT but only objects in containers If 1, do not change the width of this object upon resize. 1 for vmenu
ws ALL (list) = ALL, but meaningful only for the classes in list(NFT = not tableField or graphTrace), p = persistent, (click for more info) When an object is (initially) shown and s.WS is Null, if ws for the object is 1 it becomes the screen workspace and if ws is 0 it does not; when ws is Null, the value of s.AUTOWS is used for it. Null (1)
Attribute Keys
(POINT TO KEY FOR INFO)
Description Default
x NFT = not tableField or graphTrace The x coordinate, in pixels, of this object relative to its parent, or relative to the screen in case this is a top-level object. 0
(upper left corner)
X NFT = not tableField or graphTrace, r = reference only (cannot be set) The x coordinate, in pixels, of this object relative to the screen. 0
if toplevel or popup
xaxis gT = graphTrace, fn = functional, (click for more info) Governs whether a trace is graphed relative to the x axis (`x) or X axis (`X). `x
xextent G = graph, o = also for graph attributes prefixed X, y, Y, r = reference only (cannot be set), (click for more info) A three-element vector from which the length, in pixels, of the x axis can be computed. Can be used to detect zooming.  
xfg G = graph, o = also for graph attributes prefixed X, y, Y, (click for more info) The color of the indicated axis, axis labels, and tick marks. black
xinc G = graph, o = also for graph attributes prefixed X, y, Y, (click for more info) The coordinate increment between major tick marks. 0 (s chooses)
xlabel G = graph, o = also for graph attributes prefixed X, y, Y, fn = functional, (click for more info) Various explicit settings of x-axis label text and tick mark positions and sizes.  
xlabelfont G = graph, o = also for graph attributes prefixed X, y, Y, (click for more info) The font in which the x-axis labels are type set. lucida sans type writer-12
xlabel height G = graph, o = also for graph attributes prefixed X, y, Y, r = reference only (cannot be set), (click for more info) The height in pixels of any x-axis label.  
xlabel justify G = graph, o = also for graph attributes prefixed X, y, Y, (click for more info) Justify the x-axis labels: `left, `right, `center. `center
xlabelout G = graph, o = also for graph attributes prefixed X, y, Y, fn = functional, (click for more info) Controls formatting of x-axis labels. These labels may have any values (integer or not) between xmin and xmax or, if xmin is not less than xmax, any floating-point values. Like out, xlabelout takes a function, a symbol, or a character string; unlike out, it does not take a number.  
xlabel width G = graph, o = also for graph attributes prefixed X, y, Y, r = reference only (cannot be set), (click for more info) The width in pixels of a specified x-axis label.  
xleft G = graph, x = also for the attribute with prefix X, (click for more info) The distance from the rule of the y axis to the bounding rectangle that holds all graph traces whose xaxis setting is `x, as a percentage of the distance between the rules of the y axis and Y axis (visible or not). 0
xlegend G = graph, (click for more info) The x-axis coordinate of the upper left corner of the legend box (when legend is not set after xlegend is set). 0
xmajor ticksize G = graph, o = also for graph attributes prefixed X, y, Y, (click for more info) The length in pixels of the major tick marks on the x axis. 10
xmax G = graph, o = also for graph attributes prefixed X, y, Y, (click for more info) The maximum value on the x axis. For xmax to be honored, it must be greater than xmin.

Setting them all to Null also causes values computed from the trace sets to be used, but these attributes are reported as having the computed values.

Any zooming that the user has done on the screen can be detected in a program by the values of xmax, etc. To undo zooming (in order, for example, to ensure that a new point is shown promptly), reset xmin, xmax, ymin, and ymax to valid values.

Computed value.
xmin G = graph, o = also for graph attributes prefixed X, y, Y, (click for more info) The minimum value on the x axis. For xmin to be honored, it must be less than xmax. Can be used to undo zooming. See xmax. like xmax
xminor ticks G = graph, o = also for graph attributes prefixed X, y, Y, (click for more info) Number of minor ticks between major ticks on the x axis. 1
xminor ticksize G = graph, o = also for graph attributes prefixed X, y, Y, (click for more info) The length in pixels of the minor tick marks on the x axis. 6
xright G = graph, x = also for the attribute with prefix X, (click for more info) The distance from the rule of the Y axis to the bounding rectangle that holds all graph traces whose xaxis setting is `x, as a percentage of the distance between the rules of the y axis and Y axis (visible or not). 0
xs NFT = not tableField or graphTrace (should be set only for TOP = top-level and popup objects only) The horizontal size of this object, in pixels. If the object is not displayed when this attribute is set, the realize attribute for the object must have value 1.  
xsublabel G = graph, x = also for the attribute with prefix X, fn = functional, (click for more info) Various explicit settings of x-axis sublabel text and positions.  
xsublabel justify G = graph, x = also for the attribute with prefix X, (click for more info) Justify the x-axis sublabels: `left, `right, `center. `center
xsublabel out G = graph, x = also for the attribute with prefix X, fn = functional, (click for more info) Controls formatting of x-axis sublabels. See xlabelout.  
xtickstyle G = graph, o = also for graph attributes prefixed X, y, Y, (click for more info) E.g., set the x-axis tick marks to point into the plot area. `out
xtitle G = graph, o = also for graph attributes prefixed X, y, Y, (click for more info) The text of the title on the x axis.  
xtitlefg G = graph, o = also for graph attributes prefixed X, y, Y, (click for more info) The color of the text on the x-axis title. black
xtitlefont G = graph, o = also for graph attributes prefixed X, y, Y, (click for more info) The font in which the text of the x-axis title is type set. lucida sans type writer -12
xtitle justify G = graph, o = also for graph attributes prefixed X, y, Y, (click for more info) Justify the x-axis title: `left, `right, `center. `center
y NFT = not tableField or graphTrace The y coordinate, in pixels, of this object relative to its parent, or relative to the screen in case this is a top-level object. 0
(upper left corner)
Y NFT = not tableField or graphTrace, r = reference only (cannot be set) The y coordinate (pixels) of the object relative to the screen. 0
if toplevel or popup
yaxis gT = graphTrace, fn = functional, (click for more info) Specify whether a trace is graphed relative to the y axis or Y axis. `y
ybottom G = graph, y = also for graph attribute prefixed Y, (click for more info) The distance from the rule of the x axis to the bounding rectangle that holds all graph traces whose yaxis setting is `y, as a percentage of the distance between the rules of the x axis and X axis (visible or not). 0
ylegend G = graph, (click for more info) The y-axis coordinate of the upper left corner of the legend box (when legend is not set after ylegend is set). 0
ymode G = graph, y = also for graph attribute prefixed Y, (click for more info) Controls which way the values run on the y axis and Y axis: `ascend or `descend. `ascend
ys NFT = not tableField or graphTrace (should be set only for TOP = top-level and popup objects only) The vertical size of this object, in pixels. If the object is not displayed when this attribute is set, the realize attribute for the object must have value 1.  
ytitle style G = graph, y = also for graph attribute prefixed Y, (click for more info) Set the y-axis title vertically or horizontally. `hor
ytop G = graph, y = also for graph attribute prefixed Y, (click for more info) The distance from the rule of the X axis to the bounding rectangle that holds all graph traces whose yaxis setting is `y, as a percentage of the distance between the rules of the x axis and X axis (visible or not). 0
yx NFT = not tableField or graphTrace The (y,x) coordinates, in pixels, of this object relative to its parent, or relative to the screen in case this is a top-level object. 0, 0
(upper left corner)
YX NFT = not tableField or graphTrace, r = reference only (cannot be set) The (y,x) coordinates, in pixels, of this object relative to the screen. 0, 0
if toplevel or popup
yxs NFT = not tableField or graphTrace (should be set only for TOP = top-level and popup objects only) The (ys,xs) size, in pixels, of this object. If the object is not displayed when this attribute is set, the realize attribute for the object must have value 1.  
zero G = graph, (click for more info) Controls whether - for which axes - zero axes appear: `none, `x, `X, `y, `Y, `xy, `xY, `Xy, or `XY. `xy
zerofg G = graph, (click for more info) Controls the color of the zero axes. slategray
zerostyle G = graph, (click for more info) Controls the style of the zero axes: `dot1 through `dot5, `dotdash1 through `dotdash5, `dash1 through `dash5, or `solid. `dot1
zerowidth G = graph, (click for more info) Controls the width of the zero axes: 0 through 10. 0
(very thin)

 

   Formats for the out Attribute

Errors in dates return 0's except that an erroneous `y2 is set to "**", and the length of the result returned for a bad date is the same as for a good date.

The intraday formats in the fourth, fifth, and sixth rows of the "out Attribute Format Samples" table take an argument in seconds and use it mod 86400, the number of seconds in a day. For example:

     tsys.ts{}
 1994 10 12 13 22 19 550

     `hrminsec _sfmt 603 4 5#t
01:22:19pm
The formats in the last four rows of the table take an argument of the form yyyymmdd. For each of them, another format with the same name except that _u is appended handles the format for values given in Unix seconds (in the epoch). Unix seconds should be used for graphs with dates that are not contained in a single month, because the yyyymmdd form will cause the last day of one month and the first of the next to be widely separated in the graph.

Formats containing y2 are restricted to the years 1950 through 2049.

out Attribute and _sfmt Format Samples
See the
notes in the preceding section.
FormatExample
FormatExample
`float [(`float;n) accepted, but n ignored; of returns just `float]. 97.7512 `fixed or (`fixed;n) where n is the number of decimal digits; of always returns the latter form. 97.751250
`frac97 601/800 `32nd97/24
`64th97\48 `128th97=096
`320th97'241 `328th97-241
`none97.751250 `hr2pm
`hr2414 `min32
`sec15 `hrmin2:32pm
`hrmin2414:32 `minsec32:15
`hrminsec2:32:15pm `hrminsec2414:32:15
`day7Thu `day365291
`day3121 `m1210
`mOct `y293
`y41993 `dmy221/10/93
`dmy421/10/1993 `mdy210/21/93
`mdy410/21/1993 `mdy Thu Oct 21, 1993

Default and Coincident Titles

Default titles are the names of the displayed global variables and are sensitive to their contexts. Fully qualified names are used for global variables outside the root context, except when a child object is in the same context as its parent, in which case the name of the child will be displayed without a context name. When a variable is reparented, if its title and qualified or unqualified name coincide, its title is set to Null, and so the parent then decides upon the appropriate title. (Therefore, if the title and the unqualified name coincide and the contexts of the parent and child are different, you must set the title just after the variable is placed in the parent, in order to avoid having the variable's context appear in its title.)

Colors

There are 292 named colors available. Many of the following color names have the suffix "4", which means that the four colors with suffixes "1", "2", "3", and "4" are available, in addition to the color without the suffix. For example, azure4 means there are colors azure, azure1, azure2, azure3, and azure4. The numbers indicate varying degrees of grayness in the color, with 1 signifying the least gray and 4 the most. Similarly but oppositely, there is a color grey100 denoting colors grey0 through grey100, where 100 indicates the least gray (white) and 0 the most gray (black).

Spaces in color names are for readability and need not be included in color specifications. Uppercase letters are not allowed.

The s-context variable s.COLOR_NAMES lists the permitted colors.

A+ finds the closest match to a requested color when the window-manager colormap is full.  of returns the color that was requested, which allows the displayed color to be duplicated.

aquamarine4
azure4
beige
bisque4
black
blue4
brown4
burlywood4
chartreuse4
chocolate4
coral4
cornsilk4
cyan4
firebrick4
gainsboro
gold4
goldenrod4
green4
grey100
honeydew4
ivory4
khaki4
lavender
linen
magenta4
maroon4
moccasin
navy
orange4
orchid4
peru
pink4
plum4
purple4
red4
salmon4
seashell4
sienna4
snow4
tan4
thistle4
tomato4
turquoise4
violet
wheat4
white
yellow4

Click here for a table showing a sample of each color.

Preferred Fonts

Since it is possible to obtain hardcopy printout for screen displays, the recommended fonts are the standard 35 PostScript fonts and APL. In the current A+ environment all the standard PostScript fonts can be scaled, and can therefore be used at any pixel size. To specify one of the screen management font attributes, use the name, followed by "-", followed by the pixel size: e.g., Courier-10. Use a character vector, not a symbol, to specify a font with a hyphen in its name. The standard PostScript fonts are:

avantgarde-book
avantgarde-bookoblique
avantgarde-demi
avantgarde-demioblique

bookman-demi
bookman-demiitalic
bookman-light
bookman-lightitalic

courier
courier-bold
courier-boldoblique
courier-oblique

helvetica
helvetica-bold
helvetica-boldoblique
helvetica-narrow
helvetica-narrow-bold
helvetica-narrow-boldoblique
helvetica-narrow-oblique
helvetica-oblique
newcenturyschlbk-bold
newcenturyschlbk-bolditalic
newcenturyschlbk-italic
newcenturyschlbk-roman

palatino-bold
palatino-bolditalic
palatino-italic
palatino-roman

symbol

times-bold
times-bolditalic
times-italic
times-roman

zapfchancery-mediumitalic
zapfdingbats
 
 
 

Kanji font is available on the screen, by setting the font attribute to
"-misc-fixed-medium-r-normal--14-130-75-75-c-140-jisx0208.1983-0"
and using hex codes.

The APL font for printers can be scaled, but no scalable APL screen font is available. There are four APL screen fonts at various pixel sizes:

  • kaplcour (14 pixel font)
  • kaplgallant (19 pixel font, aka bigapl)
  • kaplscreen (11 pixel font)
  • kaplscreen-bold (14 pixel font).
The default for all font attributes is kaplgallant.

Tasks vs. Attributes

The next table classifies all the screen management attributes, except those specifically for reports. Some of them appear in several categories, but, in order to keep the table to a more helpful size, generally each is listed in only the most appropriate category, although there may be other categories that are not inappropriate.

Where (xX) or (xXyY) or the like appears in an attribute listing, the meaning is all attributes formed by prefixing each of the parenthesized letters to the unparenthesized letters.

Classification of Attributes
CategoryRelevant Attributes
ClassesStatus bound, class
Binding is, reparent, verify
AttributesListing has, settings, state, stateself
Using evaluate, freeze, recursively
Presence of featuresText foot, head, labelinc, legendstyle
Traces linestyle, style, symbol
Axes and grids axis, grid, gridstyle, rule, xaxis, (xXyY)minorticks, (xXyY)tickstyle, yaxis, ymode, zero, zerostyle
Other lines backpages, box, collabelrows, colsep, line, minortickcount, rowsep, showbinding
Printing breakcriteriafunc, breakon, breakprocessfunc, breakprocesson, computepagebreakcb, currentbreakcolumn, framestyle, pagebreakcb, pagebreakon, pagecontrol, pagenumbering, pagenumbers, printdisstyle, reporttotalon, rowcontrol, suppressduplicate
Values
def, eval, footnote, icontitle, label, legend, max, min, preset, set, shelltitle, subtitle, title, titles, (xXyY)label, (xX)sublabel, (xXyY)title
Printing banner, breaktext, computationmode, disclaimer, disclaimerfile, footer, header, maxtitle, mintitle, pagenumbertext, printdisfile
SizeObjects constraints, dynamic, extent, extents, fullscreen, H, locksize, naturalsize, resize, resizeable, W, xs, ys, yxs
Non-graph features or parts backpagethickness, bindingwidth, box, C, colspace, editspace, framethickness, h, hlthickness, hscrollsize, linewidth, majorticksize, margin, minorticksize, R, respace, scrollsize, shadowthickness, size, sliderheight, sliderwidth, space, vscrollsize, w
Graph features barwidth, gridwidth, legendhlthickness, legendshadowthickness, rulewidth, symbolsize, (xXyY)extent, (xXyY)inc, (xXyY)label, (xXyY)labelheight, (xXyY)labelwidth, (xXyY)majorticksize, (xXyY)minorticksize, zerowidth
Printing computesizecb, disclaimerrulewidth, framelinewidth, pagecounttotal, pagesize, printdisrulewidth, printsize, scalefont, scalefontcb, uniformscaling
Colors and blinkingSetting backpagebg, backpagefg, bg, blink, blinkrate, boxcolor, colindexbg, color, colormap, colors, cycle, cyclemode, editbg, editfg, fg, framebg, hl, labelfg, maxtitlefg, mintitlefg, nodebg, nodefg, rowbg, rowindexbg, scrollbg, selectbg, selectednodebg, selectednodefg, selectedpagebg, selectedpagefg, sliderbg, titlefg, valuefg
Setting, graphs only fillcolor, gradient, gridfg, legendbg, legendfg, linecolor, subtitlefg, textfg, (xXyY)fg, (xXyY)titlefg, zerofg
Printing bggrayscale, breakbggrayscale, breakfggrayscale, fggrayscale, headingbggrayscale, headingfggrayscale, printmode
Font
bold, font, labelfont, maxtitlefont, mintitlefont, titlefont, underline, valuefont
Graphs only footnotefont, legendfont, subtitlefont, textfont, (xXyY)labelfont, (xXyY)titlefont
Printing breakfont, printdefaultfont, printdisfont, reportfont, reportheadingfont, reporttotalfont
Containment ancestors, children, descendents, familytree, parent, shell
PositionIn field or object columnalignment, geometry, horizontalspace, justify, labeljustify, margin, maxtitlejustify, mintitlejustify, subtitlejustify, titlejustify, valuejustify, vcolspace, verticalspace, vrowspace
In graphs bottom, footnotejustify, left, legend, legendstyle, right, top, (xX)left, (xX)right, (xX)sublabel, (xX)sublabeljustify, (xXyY)label, (xXyY)labeljustify, (xXyY)titlejustify, (xy)legend, (yY)bottom, (yY)labeljustify, (yY)titlestyle, (yY)top
In container at, b, build, extent, l, lockposition, marginheight, marginwidth, orientation, position, r, structure, t, vcol, vcols, vrow, vrows, x, y, yx
In screen atsector, extents, x, X, y, Y, yx, YX
In printed page bottommargin, breakleading, breakoffset, breakstyle, columncontrol, columnpagespan, columnspacing, disclaimerbottommargin, disclaimerleftmargin, disclaimerrightmargin, disclaimertopmargin, disorientation, footeroffset, frameoffset, headeroffset, headingstyle, leading, leftmargin, margins, newspapercolumn, orientation, outputstyle, pagecount, printbottom, printdisbottommargin, printdisleftmargin, printdisorientation, printdisrightmargin, printdistopmargin, printleft, printorientation, printright, printstyle, printtop, reporttotalleading, reporttotalstyle, rightmargin, rowpagespan, topmargin
DisplayGroup followers, followertree, leader, newshow, reparent, reshow, ws
Toplevel iconic, pin, ws
Show, hide currentpage, exit, hide, icon, lower, mapped, newshow, pin, raise, realize, show, syncshow
Portion shown col, cols, fields, firstcol, firstfield, firstrow, fixedfields, naturalsize, row, rows, size, (xXyY)max, (xXyY)min
Changes active, freeze, refresh
User interactionTraversal, focus, selection arrowdown, arrowkeys, arrowleft, arrowlist, arrowright, arrowup, col, colindex, coordinate, Coordinate, cornerindex, downto, field, focus, hscrollwith, index, leftto, mnemonics, preset, refer, referpoint, rightto, row, rowindex, select, selectcol, selectcorner, selected, selectedfield, selectfield, selectionmode, selectrow, set, setcol, setfirstcol, setfirstrow, setrow, tabfrom, tablist, tabto, upto, vscrollwith
Sensitivity acceptfocus, edit, protect, protected, selectable, selectdistance, sensitive
Input blank, buffer, clear, copy, cursor, delete, done, execute, exit, f1-f12, fill, fkeys, in, inc, insertabove, insertbelow, key, keysym, na, notify, pageinc, preset, primary, rband, rbandbox, request, save, set, stars, 3down, 3up, 2down, 2up, valid, validate
Input, graphs addtexttrace, addtrace, copytexttrace, copytrace, mode, movelimit, textactivate
Size and position columnresize, dragdrop
Zooming (xXyY)extent, (xXyY)max, (xXyY)min
Output blank, clear, done, fill, literal, na, notify, out, primary, request, stars, (xX)sublabelout, (xXyY)labelout
Printing cancel, print, report
Data conversion formatbreakfunc, in, labelout, out, (xX)sublabelout, (xXyY)labelout
Saving and restoring;
output files
file, outputmode, printfile, printoutputmode, script, state, stateself
Documenting doc


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_24.html0000444000265000001440000003667610737165223013663 A+ Reference: Functional Attributes

Functional Attributes


Certain attributes are functional: the attribute can be assigned a function instead of a value, and the function will be called any time a value for that attribute is needed. Even though the values of nonfunctional attributes can be reset at any time, functional attributes are more dynamic, because the current state of the application can be tested and attributes set accordingly at the precise time the setting is needed. For example, whenever the value in a cell changes the foreground color of the cell can be set to red if the value is negative and black otherwise (the function producing the attribute value is called after the variable associated with the cell is modified).

An attribute function is one kind of callback function. Its syntax is the same as that of an ordinary variable callback function, and so are the meanings of the arguments (see "Set Callback"). That is, an attribute function can have from zero to six arguments, and the meanings of the arguments, no matter how many are present, are (from left to right in the function header): static data; data value; index; path; context name as symbol; variable name as symbol. These arguments will be denoted by s, d, i, p, c, and v, respectively. Just as ordinary variable callback functions are called when a variable changes, attribute functions are called when values of the variable's attribute are needed, and the function arguments indicate which part of which object needs the value. Unlike an ordinary variable callback function, which need not produce a value, but like a preset variable callback function, an attribute function must produce a value, which must be appropriate to the attribute.

The value of a functional attribute is either the function, say f, or a pair (f;), or a pair (f;s), where s is an array. The form (f;s) specifies the function and its static data s. Both f and (f;) are taken to be equivalent to (f;()), indicating that the static data is Null.

Some of the attribute function arguments differ in form for the various display classes and attributes. "Display Classes vs. Arguments to Attribute Functions" and "Display Attributes vs. Attribute Function Arguments and Rules" give descriptions of these arguments and some comments. The information in any attribute-class pair describes the particular characteristics of an attribute function for that class. The large table in the previous chapter, "Display Attributes", tells to which classes each attribute applies.

Display Classes vs. Arguments to Attribute Functions
Display ClassPath and Index Arguments, p and i
actionSee slot.
arrayThe path p is always Null and the index i is of the form
(row_index;column_index) for a matrix,
(index;) for a vector, and (;) for a scalar.
buttonBoth the path p and the index i are always Null.
check,
choice
See slot.
command,
graph
Both the path argument p and the index argument i are always Null.
graphTraceThe path p is always Null and the index i is always of the form (;column_index), where column_index indicates the visible trace within the trace set being affected. The function for an attribute specific to a graphTrace is called for every visible trace where the attribute has meaning. For example, the function for the fillcolor attribute will not be called for a scatter plot. Note that because of the form of the index i, these attributes can be specified separately for the visible traces within a trace set.
hgrid,
hmenu,
hpane,
label,
layout
Both the path p and the index i are always Null, except that when a label has a multiline value i is the line index for each call to the fg functional attribute. [Future use]
matrixThe path argument p is always Null.
If the index argument i refers to a matrix entry, it is always of the form (row_index;column_index);
if it refers to a row label, it is always of the form (row_index;);
if it refers to a column label, it is always of the form (;column_index);
if it refers to the corner label, it is always 0; and, finally,
if it refers to all entries it is Null.
notebook,
page
Both the path p and the index i are always Null. For page, the function must return an array of the same shape as the underlying variable.
passwordNo functional attribute is meaningful for password.
radioSee slot.
scalarBoth the path p and the index i are always Null.
slotThe path p is always a symbolic index of the slotfiller variable, or Null, whether the attribute refers to the label area or value area of the slot. The index i is always Null.
tableBoth the path p and the index i are always Null, except that i is the break number for report generation.
tableFieldThe path p is always Null. The index i is of the form (row_index;), or just a row index or pair of them, or a report break number. For formatting report break text, d is the unformatted string.
text,
tree,
vgrid
Both the path p and the index i are always Null.
viewThe path p is always Null and the index i is of the form (row_index;).
vmenu,
vpane,
window
Both the path p and the index i are always Null.


Each row of the following
table names one or more display attributes and gives arguments {s;d;i;p;c;v} and rules for them.

The preset and set attributes, although functional, are not included in this table because their arguments are dependent on the changes to the variables for which they are set, rather than the characteristics of display classes.

Display Attributes vs. Attribute Function Arguments and Rules
AttributeArguments {s;d;i;p;c;v} and Rules
beBoth the path p and the index argument i are Null. The data argument d is the name of the child to be bound, in symbol form.
bg These attributes are functional for data cells in the array, matrix, tableField, and view classes; see the descriptions of the arguments for these classes in the previous table.
blink
bold
color
underline
These attributes are for the page display class only, so the arguments are as described in the previous table. The function must return an array of the same shape as the underlying variable.
bggrayscale
breakcriteriafunc
fggrayscale
scalefontcb
The index argument i specifies a row.
breakbggrayscale
breakfggrayscale
breakfont
breakleading
breakoffset
breakstyle
pagebreakcb
The index argument i specifies a break number.
breakprocessfunc Argument i is the beginning and ending row indices for the calculation.
colors The function is called once for each element in an indexed specification (perhaps caused by screen editing), so the arguments specify a cell. The form they take is described in the previous table; see the appropriate one of the nine classes for which this attribute is meaningful.
colspace Both the path p and the index argument i are Null. The function is called whenever the colspace attribute value is established for an object and whenever show is invoked to display that object or an object containing it.
fillcolor
gradient
legend
linecolor
linestyle
linewidth,
movelimit
selectable
style
symbol
symbolsize
These attributes are for the graphTrace display class only, so the arguments are as described in the previous table.

For performance reasons, fillcolor, gradient, legend, linecolor, linewidth, style, symbols, and symbolsize are not fully functional. They are invoked once during assignment and when traces are dynamically added, except that linecolor and fillcolor are fully functional when gradient is true and the style is bar.

fg In the case of an array, matrix, tableField or view, the attribute function is called once for every visible cell, row, or slot value area in the various display classes, whenever the attribute is specified or whenever the object is bound, displayed, or redisplayed. It is also called for any visible cell, row, or value area of a bound object that changes value. When a label has a multiline value, it is called once per line and i is the line number. Otherwise, it is called once for the initial display or any redisplay of the object. The function should return a single color. [Future use]
font The rules for calling this attribute function are the same as for the fg attribute. The function should return a single font.
formatbreakfunc The data argument d is the unformatted string.
geometry The path p and index i are both equal to Null. The function should return the complete geometry specification for the object.
in Attribute functions for the in attribute parse data taken from the screen, which is always in character vector form. The argument d holds a formatted character vector, and the function must produce a value suitable for the object in the workspace. The arguments i and p are of the standard form for each class, except that they are Nulls for attributed data. If the character vector d represents an invalid value, return the Null from this function in order to keep the input area active for another try.
label The function for this attribute is called once for every slot area or matrix label area when the attribute is specified or the object is bound. It is not called when the object is redisplayed or changes occur to the slot value areas or matrix value. The function should return one character vector.
labelfg The function for this attribute is called once for every label area, whenever the attribute is specified or whenever the object is bound, displayed, or redisplayed. The function should return one color.
labelfontSee label.
out A function for this attribute formats data as character vectors to be written on the screen. The data is in the argument d, and the function must produce a character vector of the correct length for the display. The arguments i and p are of the standard form for each class (see previous table), except that they are Nulls for attributed data.
protect The function for this attribute is called whenever a cell, row, slot value area, or visible trace is about to be modified on the screen, to determine whether or not it is protected. To determine the protection on a table cell the attribute function for the table is called first, and if its value is 0, the value or function of the protect attribute for the field holding that cell is used or called.
xaxis
x/Xlabel
x/Xlabelout
x/Xsublabel
x/Xsublabelout
yaxis
y/Ylabel
y/Ylabelout
These attributes are for the graph display class only, so the arguments are as described in the previous table.

For performance reasons, xaxis and yaxis are not fully functional. They are invoked once during assignment and when traces are dynamically added.


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_25.html0000444000265000001440000004434210737165224013652 A+ Reference: Attributes with Callbacks

Attributes with Callbacks


An attribute associated with certain button presses or certain key presses or other events can be assigned an event callback function, which will be invoked whenever an associated button or key is pressed or event takes place. All these functions, except as noted, can have from zero to three arguments, the basic syntax being
     ecfn{s;c;v}
where
  • s is static data (see below);

  • c is a symbol naming the context of the object in which the cursor was positioned when the key or button press took place or for which the event occurred; and

  • v is a symbol giving the unqualified name of this object.
The arguments always have these meanings, in this order, no matter how many (or few) are used in the definition of the function.

The value of an attribute with callback is given as either the function name, say f, or a pair (f;), or a pair (f;s), where s is an array. The form (f;s) specifies the function and its static data s. Both f and (f;) are equivalent to (f;()), indicating that the static data is Null. Note that the first element of the value of the attribute is a function, not the name of a function; if you use the name f in specifying an attribute, change the definition of f, and want the callback to use the new definition, you must specify the attribute again.

The actions of some of these attributes depend on the row or cell that is currently selected; for example, the effect of the delete attribute is to delete the selected row. Whenever a function associated with one of these attributes is called because a key or button was pressed, some row or cell or trace in a displayed object must have been selected. Usually it is important to determine within the function which row or cell it is; the attributes row and col hold the row index and, when it is meaningful, the column index of the selected row or cell. The values of two other attributes are relevant here: the value of selected is the pair (row attribute, col attribute), and the value of selected field, which applies only to tables, is the nested array pair (row attribute; symbol holding the name of the selected field).

Some of these attributes have default behavior. For example, the default behavior of the delete attribute is to delete the selected row. These attributes can be assigned functional values to change the default behavior, or simply be assigned 0 to turn the default behavior off. If off, the default behavior can be turned back on by setting the value to 1. The default behavior can also be turned off with `false or `off in place of 0, or turned back on with `true or `on in place of 1.

When an attribute attr has a default behavior for the class to which an object obj is bound, that behavior can be invoked by s.call{`obj;`attr}. Thus, a callback function can be assigned to an attribute of an object that will, when called, make a decision whether or not to invoke the default action, to do some other work, or to do both or neither. s.call should work for all attributes with default callback behaviors; it will work for all attributes listed in 0s.EVENT_CALLBACKS.

Attributes with Callbacks
(event callbacks - up to three arguments -, except as noted)
AttributeDescriptionDefault
addtexttrace
addtrace
copytexttrace
copytrace
refer
referpoint
textactivate
See the table "Attributes for Interactions with Graphs". See also "refer" in this table.  
clear If an object was the last one in its A+ process to set the primary selection buffer, and that buffer is subsequently set by another process, a clear event occurs for that object. See "Accessing the Primary Selection Buffer".  
deiconized
iconized
These event callbacks occur when the widget is deiconized or iconized.  
delete A delete event occurs when Meta-Delete or, on an IBM keyboard, Alt-Delete is pressed. The default action is to delete the selected row or cell. If the attribute is 1, the default action is taken; if 0, it is not. If the last row is deleted, changing the row attribute, a select event (below) is also triggered. 0
done A done callback function is called at the end of a screen entry and refresh cycle, which consists of some or all of the following actions, in the following order: in, preset callback, set variable, ordinary callback, out, done. Note: this is a variable callback function, taking up to six arguments, {s; data; index; path; c; v}.  
editbegincb
editendcb
These events occur when a user begins or stops editing the widget, i.e., when the widget editor is invoked or unmapped, respectively. For array, matrix, slot, and table, the cell involved is given by selected. Null (none)
exit An exit event occurs when the right button is pressed while the mouse pointer is in the shelltitle area of a window, and Quit, or Dismiss, or Close is selected from the menu. The default action is to remove a top-level object from the screen. If the attribute is 1, it is taken; if 0, it is not. 1
f1 through f12 There is no default action for function key presses. f1 controls the action when F1 is pressed, f2 when F2, and so on.  
increment
decrement
These events occur when, respectively, an up or down arrow button (shown when arrowbuttons is 1) is pressed. A slot may have several such buttons; the selected attribute gives the symbol for the entry whose button was pressed.  
incurrent workspace

outofcurrent workspace
In a CDE window, these callbacks occur when the window:
  • receives presence in the current workspace (i.e., when the presence of a window is changed to include the current workspace or when the current workspace is changed to a workspace which includes this window from a workspace which did not include it) or

  • loses presence in the current workspace (i.e., when the presence of a window is changed to exclude the current workspace or when the current workspace is changed to a workspace which does not include this window from a workspace which included it).
See the
caveats for deiconized. Ignored outside CDE.
 
insertabove An insertabove event occurs when Shift-Meta-Insert or, on an IBM keyboard, Shift-Alt-Insert is pressed. If 1, the default action is to insert a new row or cell above the currently selected one. If 0, the default is not taken. 0
insertbelow An insertbelow event occurs when Meta-Insert or, on an IBM keyboard, Alt-Insert is pressed. If 1, the default action is to insert a new row or cell below the currently selected one. If 0, the default is not taken. 0
is There is no default action associated with this attribute. The function is called when an object is bound to a display class.  
key There is no default action. The function is called when a key press occurs in the value area during editing.  
notify The request attribute is set in order to reference the last entry written to the primary buffer. A notify event occurs when that entry is available for referencing. See "Accessing the Primary Selection Buffer".  
pagechangecb When a user clicks on the tab of a notebook page which is not the current page, thereby making it the current page, this callback is fired. The new page name is, of course, available from the currentpage attribute. Null (none)
rband If the mouse pointer is on a page object and the left mouse button is pressed and held, a rubberband box is created. The box is anchored in the upper left corner of the character on which the pointer rested when the mouse button was pressed, and the diagonally opposite corner of the box moves with the pointer. The rubberband box as drawn disappears and an rband event occurs when the mouse button is released. If rband is 0, the box attribute is unchanged and the page object appears unchanged. If rband is 1, the location and extent of the box that triggered the event is appended to the box attribute and the box is shown in the page object in the color indicated in boxcolor. 0
refer In an array, matrix, table, or view object, a refer event occurs when the pointer is in a selected row or cell that has focus and the left mouse button or the Enter key is pressed. Hence it occurs as the result of a "double click" with the left mouse button in a row or cell. There is a default action for array, matrix, and table only, taken if refer is 1: highlight the referred row in the indexbg color and append the new value of the row attribute to the value of the index attribute. If refer is 0, the default action is not taken. Pressing the left mouse button on a referred row removes the reference.

In a password or scalar object, a refer event occurs when the mouse pointer is in either the title or value area, and the left mouse button is pressed. In a slot, the pointer can be in any label or value area. In a graph, the pointer can be anywhere on the graph; if the pointer is on a line trace, the event occurs for that trace. In all these cases, a refer event occurs only if the area has focus; there is no default action.

0 for array, matrix, table, and view;
Null otherwise.
save A save event occurs when Ctrl-s is pressed while an object bound to the text display class has focus. If save is 1, the edited text on the screen is saved in the workspace variable. If it is 0, this default action is not taken. 1
select There is no default action for mouse button presses or arrow key presses. This attribute can be set for an object of class array, matrix, table, or view, and the function to which it is set will be called whenever the mouse pointer is on a row or cell of the object, that row or cell is not currently selected, and the left mouse button is pressed. The selected cell appears raised and in the color specified by the selectbg attribute, while the rest of the selected row appears in the color specified by the rowbg attribute. Once a row or cell is selected the user can move from row to row or cell to cell with the arrow keys. With each press of an arrow key the row or cell in the indicated direction becomes selected, and the function is called. Orogrammatically setting a row or column to -1 causes a select callback.  
selectcol If 1, the default action is to highlight the selected column labels in the rowindexbg color and update the value of the colindex attribute with the row index of each selected column label. If 0, the default action is not taken. This attribute can be set for a matrix, and the function to which it is set will be called whenever the mouse pointer is on the label area of a column and any mouse button is pressed. If there is a selected row at the time a column label is selected, it remains unchanged, but the selected cell becomes the one at the intersection of the selected row and the column beneath the newly selected column label. In particular, if a new cell is selected, a selected event occurs. Press any mouse button on a referred column to remove the reference. 0
selectcorner If 1, the default action is to highlight the selected corner label in the cornerindexbg color and change the value of the cornerindex attribute to 1. If 0, the default action is not taken. This attribute can be set for a matrix, and the function to which it is set will be called whenever the mouse pointer is on the label area of the upper left corner and any mouse button is pressed. Press any mouse button on the referred corner to remove the reference. 0
selectfield This attribute can be set for a table, and the function to which it is set will be called whenever the mouse pointer is on the title area of a field and any mouse button is pressed. If there is a selected row at the time a field title is selected, it remains unchanged, but the selected cell becomes the one at the intersection of the selected row and the field beneath the newly selected field title. In particular, if a new cell is selected, a selected event occurs.  
selectrow If 1, the default action is to highlight the selected row labels in the rowindexbg color and update the value of the rowindex attribute with the column index of each selected row label. If 0, the default action is not taken. This attribute can be set for a matrix, and the function to which it is set will be called whenever the mouse pointer is on the label area of a row and any mouse button is pressed. The row with the selected label becomes the selected row. If no row was selected at the time the row label is selected, the selected cell is the one in the first column of the selected row. If there was a selected cell at the time the row label was selected, the newly selected cell is the one in the same column, but in the newly selected row. In particular, if a new cell is selected, a selected event occurs. Press any mouse button on a referred row to remove the reference. 0
3down Pressing the right mouse button causes a 3down event.  
3up A 3up event occurs when the right mouse button is released.  
2down Pressing the middle mouse button causes a 2down event.  
2up A 2up event occurs when the middle mouse button is released.  
validate There is no default action associated with this attribute. The function is called when the keyboard entry for a password object is completed (by an Enter).  

Accessing the Primary Selection Buffer

When text is clipped in an Emacs or XTerm window, say by dragging the pointer over the area while the left button is depressed, the text is written in the primary selection buffer, and when text is pasted into an Emacs or XTerm window, it is retrieved from the primary selection buffer. A+ provides four attributes for using this buffer: primary, request, notify, and clear.

To write in the primary selection buffer, give the primary attribute a character value. (Attempted settings with other types of data are quietly ignored; the value of primary remains unchanged.) Since there is only the one buffer, the value of the attribute changes for all objects.

To read the buffer, specify the request attribute for a bound object. If and when primary has been given a proper value, a notify event occurs and the buffer can be read by referencing the primary attribute.

If the buffer is overwritten by another process (not by an object in this A+ process), the A+ object, if any, whose specification of the primary attribute was overwritten will undergo a clear event. Dragging the pointer over text in an Emacs, Xterm, or FrameMaker window, for example, will cause a clear event. The text that is highlighted can then be retrieved through primary, but text that Emacs demarcated by bouncing the cursor back and forth cannot - but can, however, after you press the "0 to PRIMARY" button in an xcutsel window.

See the tutorial scripts, which are available under the "Tutorials" item on the "On-Line Documents" section of the home page. The entry "s.tutorials/data" gives an example, for the view class. It is an ASCII text file; use Emacs to access it.


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_26.html0000444000265000001440000007420310737165224013652 A+ Reference: The Action Display Class

The Action Display Class

The action display class is for the display of any slotfiller variables. The display consists of a title area above a collection of label areas, one for each symbolic index. When the slotfiller has a callback function and the left button is clicked with the mouse cursor on a label, the callback function is called with the path argument p equal to the symbolic index of the pressed label, and the new-value argument d equal to the slotfiller itself. The value of the slotfiller does not actually change; the callback occurs because an assignment of the form:
     (pd)pd
is automatically generated when an action item is selected.

The slotfiller values do not affect the display of an action object, but can be used by the programmer to identify the actions to be taken when the labels are pressed.

The label areas in action objects are treated in exactly the same way as label areas in objects bound to the slot display class. The label areas cannot be edited. There are no value areas.

The label areas that appear in the display and their arrangement can be controlled by the setting of the geometry attribute; see "The Geometry Attribute". All label areas specified for display by this attribute are completely displayed; action displays never have scrollbars.

Visual Representation
     ac(`open `close `save;(;;))
     `ac has (`class;     `action;
              `shelltitle;"ShellTitle";
              `title;     "WidgetTitle")
     show `ac
For information about a widget element, click the left mouse button with tip of the pointer index finger on it. Point inside the frame but outside the widget for attributes governing overall size, position, etc.

The element you are pointing at is named in the status message area at the bottom of the window.

(Clicking the middle mouse button instead displays this information in a new browser.)


Attributes

See the "Display Attributes" chapter for details concerning all the attributes that apply to objects in the action display class, as well as lists of colors and fonts. The keys in the Table of All Display Attributes that pertain to this class are N, ALL, CNFT, NFT, and TOP.

The attributes that are meaningful for the action display class (other than the print... attributes) are:

acceptfocus
active
ancestors
arrowdown
arrowkeys
arrowleft
arrowlist
arrowright
arrowup
at
atsector
b
bg
bound
C
class
clear
deiconized
doc
downto
dynamic
eval
evaluate
exit
extent
f1-f12
fg
fkeys
focus
followers
followertree
foot
font
freeze
fullscreen
geometry
h
H
has
head
hide
hl
hlthickness
icon
iconic
iconized
icontitle
incurrentworkspace
is
justify
l
label
labelfg
labelfont
leader
leftto
literal
lower
mapped
naturalsize
notify
outofcurrentworkspace
parent
pin
preset
primary
protect
protected
r
R
raise
realize
refresh
request
resize
resizeable
rightto
script
selected
sensitive
set
settings
shadowthickness
shell
shelltitle
show
state
stateself
syncshow
t
tabfrom
tablist
tabto
title
titlefg
titlefont
titlejustify
upto
vcol
vcols
verify
vrow
vrows
w
W
ws
x
X
xs
y
Y
ys
yx
YX
yxs
(Point the mouse cursor to an attribute to display a short description at the bottom of the screen)


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_27.html0000444000265000001440000011532110737165225013651 A+ Reference: The Array Display Class

The Array Display Class

Any A+ scalar, vector, or matrix can be displayed as an object of class array. A display of a variable in this class has two parts, a title area and a value area. The value area appears below the title area, and consists of delineated cells. The display is arranged as follows:

  • a scalar or character vector is displayed in one cell;
  • all other vectors are displayed in a column of cells, one for each element in the vector; by default, the first element is in the top cell;
  • a character matrix is also displayed in a column of cells, one for each row, and, by default, the first row is in the top cell;
  • all other matrices are displayed in a two-dimensional arrangement of cells, one for each element; the rows of the matrix appear as rows in the display and, by default, element (0;0) of the matrix in the upper left cell.
If an array requires more than a few cells then, by default, only a subarray is presented on the screen, and the value area is provided with scrollbars. Users control the particular subarray that appears in the value area with the scrollbars; programmers set the attributes firstrow, firstcol, rows, and cols.

The contents of each cell in the value area can be edited.

Visual Representation
   x 20 30
   `x has (`class;      `array;    The default, actually.
           `shelltitle; "ShellTitle";
           `title;      ("This is";"the title"));
   show `x
For information about a widget element, click the left mouse button with the tip of the pointer index finger on it. Point inside the frame but outside the widget for attributes governing overall size, position, etc.

The element you are pointing at is named in the status message area at the bottom of the window.

(Clicking the middle mouse button instead displays this information in a new browser.)


Attributes

See the "Display Attributes" chapter for details concerning all the attributes that apply to objects in the array display class, as well as lists of colors and fonts. The keys in the Table of All Display Attributes that pertain to this class are A, ALL, CNFT, NFT, and TOP.

The attributes that are meaningful for the array display class (other than the print... attributes) are:

active
ancestors
arrowdown
arrowkeys
arrowleft
arrowlist
arrowright
arrowup
at
atsector
b
bg
blank
bound
class
clear
col
colors
cols
colsep
copy
cycle
deiconized
delete
doc
done
downto
dynamic
edit
editbg
editfg
editspace
eval
evaluate
execute
exit
extent
fg
f1-f12
firstcol
firstrow
fkeys
focus
followers
followertree
font
foot
freeze
fullscreen
h
H
has
head
hide
hl
hlthickness
hscrollsize
hscrollwith
icon
iconic
iconized
icontitle
in
incurrentworkspace
index
insertabove
insertbelow
is
l
leader
leftto
literal
lower
mapped
na
naturalsize
notify
out
outofcurrentworkspace
parent
pin
preset
primary
protect
protected
r
raise
realize
refer
refresh
request
resize
resizeable
respace
rightto
row
rowbg
rows
rowsep
script
scrollbg
scrollsize
select
selectbg
selected
selectionmode
sensitive
set
setcol
setfirstcol
setfirstrow
setrow
settings
shadowthickness
shell
shelltitle
show
size
space
stars
state
stateself
syncshow
t
tabfrom
tablist
tabto
title
titlefg
titlefont
titlejustify
upto
vcol
vcols
verify
vrow
vrows
vscrollsize
vscrollwith
w
W
ws
x
X
xs
y
Y
ys
yx
YX
yxs
(Point the mouse cursor to an attribute to display a short description at the bottom of the screen)


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/ARstart.html0000444000265000001440000001364010737165273013034 About The A+ Reference Manual: Size and Face

Using the Online A+ Reference Manual

    Browser

The required browser is Netscape Navigator 4.0, or later, or an equivalent.  In particular, frames and font specification by name must be supported.  If you use the -install option for Netscape, it will have its own color map and not trash colors in other applications;  alternatively, you can try the -visual PseudoColor option for Netscape — it may also avoid trashing colors in other applications.

If you have JavaScript enabled (Edit -> Preferences -> Advanced in 4.0), when you move the mouse pointer onto some of the links, a brief characterization of the linked text appears in the message status area at the bottom of the Netscape window.

    Navigation

For a chapter or a detailed table of contents, choose a link in the frame at left.
For a section of the index to the manual, choose a link in the frame below.

You can adjust the division of space between frames if you want, by dragging the divider while holding down the left mouse button.

    Fonts

Instructions for setting up APL fonts with Microsoft® Windows®

Netscape: Face

Does the A+ character set display correctly on your screen?
Check these sample characters:  If they look okay, you're all set.
Left
arrow
Right
arrow
Up
arrow
Down
arrow
Epsilon
symbol
Iota
symbol
Rho
symbol
Divide
symbol

If these and other special APL characters are not being displayed properly ensure that you have installed the Kapl fonts and you have specified "Use document-specified fonts, including Dynamic Fonts" in your font preferences.

Known font problem when using Internet Explorer

The Domino symbol ("", which should display as a composite of the "" and "" symbols) displays only part of the time under Internet Explorer, and disappears at other times. This is because Internet Explorer interprets this character position as being the Soft Hyphen character (even though a different graphic was intended), and therefore displays it only when it occurs as the last character before a line break (...a seldom-occurring case in A+ code!).

There is no fix that we can offer for this problem with Internet Explorer. Please remember that we recommend the use of Netscape Navigator (4.0 or later) for viewing the web-based A+ documentation.

Netscape: Size

The manual does not impose any font size, since people have varying preferences. This lenience means, however, that you must make sure that the sizes are consistent for the three faces used: the proportional font you have selected (perhaps by default), Courier, and Kapl.

If the APL (Kapl) or Courier size does not match the other faces (as well as possible), select as the fixed width font (via Edit -> Preferences -> Appearance -> Fonts or Options) Kapl or Courier (Adobe) and the font size you prefer. The default fixed font will be the last one selected, but the sizes selected for any faces will be remembered.

It usually doesn't matter what the default fixed font is, because Kapl and Courier are called for explicitly in this documentation. The safest approach, though - one that covers all cases - is to select Kapl as the default fixed font.

And in order to allow these pages to select these fonts, you should select the radio button marked "Use document-specified fonts, including Dynamic Fonts". If that option is not checked, the A+ fonts may not display properly.


Copyright (c) 1995-2008 Morgan Stanley Dean Witter & Co. All rights reserved. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Section, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the appendix entitled "GNU Free Documentation License".


doc@aplusdev.org
aplus-fsf-4.22/src/html/APlusRefV2_28.html0000444000265000001440000007050710737165225013660 A+ Reference: The Button Display Class

The Button Display Class

This is the display class for functions. The display is a labelled button, and when the button is pressed the associated function is executed. (To press a button, move the mouse cursor onto it and click the left button on the mouse.) The function must be monadic or niladic. Specifically, let fn be a monadic function and define a(fn;data). Then the object a can be bound to the class button, and whenever the button is pressed, fn{data} is executed. A second form for defining a button is a<{fn}, which is equivalent to a(fn;) for monadic functions; when the button is pressed, the expression fn{()} or, for a niladic function, fn{} is executed. A dependency of the form a:<{fn} can also be bound to the button class; the value of this indirection is that the button will always invoke the latest definition of fn, since a change to fn will invalidate a and cause <{fn} to be evaluated again.

Note that the value of a variable bound to the button class is never a function, but rather is or includes a function array.

Visual Representation
  fn{s}:s                   fn prints its argument
  b(fn;"Pressed!")          Pressing button prints "Pressed!" in log
  show `b has (`class;      `button;
               `shelltitle; "ShellTitle";
               `title;      "Press this button")
For information about a widget element, click the left mouse button with the tip of the pointer index finger on it. Point inside the frame but outside the widget for attributes governing overall size, position, etc.

The element you are pointing at is named in the status message area at the bottom of the window.

(Clicking the middle mouse button instead displays this information in a new browser.)


Attributes

See the "Display Attributes" chapter for details concerning all the attributes that apply to objects in the button display class, as well as lists of colors and fonts. The keys in the Table of All Display Attributes that pertain to this class are U, ALL, CNFT, NFT, and TOP.

The attributes that are meaningful for the button display class (other than the print... attributes) are:

acceptfocus
active
ancestors
arrowdown
arrowkeys
arrowleft
arrowlist
arrowright
arrowup
at
atsector
b
bg
bound
class
clear
deiconized
doc
downto
dynamic
eval
evaluate
exit
extent
f1-f12
fg
font
fkeys
focus
followers
followertree
foot
freeze
fullscreen
h
H
has
head
hide
hl
hlthickness
icon
iconic
iconized
icontitle
incurrentworkspace
is
justify
l
leader
leftto
literal
lower
mapped
margin
naturalsize
notify
outofcurrentworkspace
parent
pin
preset
primary
protect
protected
r
raise
realize
refresh
request
resize
resizeable
rightto
script
sensitive
set
settings
shadowthickness
shell
shelltitle
show
state
stateself
syncshow
t
tabfrom
tablist
tabto
upto
title
titlefg
titlefont
titlejustify
vcol
vcols
verify
vrow
vrows
w
W
ws
x
X
xs
y
Y
ys
yx
YX
yxs
(Point the mouse cursor to an attribute to display a short description at the bottom of the screen)


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_29.html0000444000265000001440000007463610737165226013671 A+ Reference: The Check Display Class

The Check Display Class

The check class is for check boxes, which are represented by slotfiller variables with boolean values. The display is like that of the slot class, except that the value areas are all square buttons and precede the labels. A button is marked "on" if the corresponding value is 1 and "off" if it is 0. When a button is "on" it has a sunken appearance and is the color specified by the fg attribute, and when "off" it has a raised appearance and is the color specified by the bg attribute. A click with the left mouse button on a check button toggles the appearance of the button between "on" and "off", and at the same time the corresponding value in the A+ variable toggles between 1 and 0. Therefore, if a callback function is defined for the slotfiller variable, mouse clicks cause the callback function to be executed, with the path argument p being the symbolic index of the changed value.

The label areas cannot be edited.

The slot areas that appear in the display and their arrangement can be controlled by the setting of the geometry attribute; see "The Geometry Attribute". All slot areas specified for display by this attribute are completely displayed; check displays never have scrollbars.

Visual Representation
  ck(`a`b`c`d;(0;1;1;1))
  show `ck has (`class;`check;
                `shelltitle;'ShellTitle';
                `title;' Show cols ';
                `label;('Open';'High';'Low';'Close'))
For information about a widget element, click the left mouse button with the tip of the pointer index finger on it. Point inside the frame but outside the widget for attributes governing overall size, position, etc.

The element you are pointing at is named in the status message area at the bottom of the window.

(Clicking the middle mouse button instead displays this information in a new browser.)

Attributes

See the "Display Attributes" chapter for details concerning all the attributes that apply to objects in the check display class, as well as lists of colors and fonts. The keys in the Table of All Display Attributes that pertain to this class are K, ALL, CNFT, NFT, and TOP.

The attributes that are meaningful for the check display class (other than the print... attributes) are:

acceptfocus
active
ancestors
arrowdown
arrowkeys
arrowleft
arrowlist
arrowright
arrowup
at
atsector
b
bg
bound
C
class
clear
deiconized
doc
downto
dynamic
eval
evaluate
exit
extent
f1-f12
fg
fkeys
focus
followers
followertree
font
foot
freeze
fullscreen
geometry
h
H
has
head
hide
hl
hlthickness
icon
iconic
iconized
icontitle
incurrentworkspace
is
l
label
labelfg
labelfont
leader
leftto
literal
lower
mapped
naturalsize
notify
outofcurrentworkspace
parent
pin
preset
primary
protect
protected
r
R
raise
realize
refresh
request
resize
resizeable
rightto
script
selected
sensitive
set
settings
shadowthickness
shell
shelltitle
show
state
stateself
syncshow
t
tabfrom
tablist
tabto
title
titlefg
titlefont
titlejustify
upto
vcol
vcols
verify
vrow
vrows
w
W
ws
x
X
xs
y
Y
ys
yx
YX
yxs
(Point the mouse cursor to an attribute to display a short description at the bottom of the screen)


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_3.html0000444000265000001440000003744210737165226013573 A+ Reference: Overview of A+

Overview of A+


Summary of the A+ Programming Language

A+ is an array-oriented programming language that provides

  • a rich set of primitive functions that act efficiently on arrays
  • general operators that control the ways functions are applied to arrays.
In A+, the ordinary concept of arrays has been enhanced to provide

  • a means by which files can be treated as ordinary arrays
  • a variety of simple, straightforward ways of displaying and editing data on a screen, with automatic synchronization between displayed data and the contents of variables
  • generalized, spreadsheet-like interactions among variables.
These features are realized in A+ by furnishing global variables with

  • the attribute of being specific to one A+ process or more generally accessible
  • visual attributes such as font and color, analogous to the ordinary attributes of shape and type
  • asynchronous execution of functions that have been associated with variables and events
  • definitions describing the spreadsheet-like relations among their values.
Global variables with associated definitions involving other global variables are called dependencies. The values for an interrelated set of dependencies are automatically kept as current as needed: if an object changes, any variable that is dependent upon it is recalculated just before the next use of that dependent variable. Although these spreadsheet-like relations are not new in principle, the definitions on which they are based can employ the full A+ programming language. In particular, the spreadsheet concept of a cell is not restricted to a scalar in A+, but can be any array, so that much more data can be managed by these relations than is usual for spreadsheets, and more efficiently. Similarly, the spreadsheet paradigm is not limited to numeric relations. For example, the concept of a view in a relational database can be realized as a dependency on the source data.

Other A+ features are

  • conventional control structures
  • contexts, or separate namespaces, in a single workspace
  • dynamic linking of C functions, which can be called like ordinary A+ defined functions
  • a Unix operating system environment
  • an Emacs-based application development environment
  • asynchronous communication between processes, based on A+ arrays.

Some Features of the A+ Language

The primitive functions of A+, a variant of APL, can be classified as scalar, structural, or specialized. A scalar primitive is applied independently to the individual elements of its array arguments, but syntactically it can be applied to an entire array, providing a very efficient implicit control structure. The scalar primitives include the ordinary arithmetic functions, comparison functions, logical functions, and certain other mathematical functions. A structural primitive is one that can be defined completely in terms of the indices of its right argument: it rearranges or selects the elements of that argument but otherwise leaves them unmodified. The specialized primitive functions include, for example, ones for sorting arrays and inverting matrices.

   Leading Axis Operations

Most A+ structural primitive functions, and functions derived from the operators called Reduce and Scan, apply to the leading axis of the right argument (cf. "The Structure of Data"). These structural A+ primitives are Catenate, Take, Drop, Reverse, Rotate, Replicate, and Expand. The subarrays obtained by

  • specifying only the leading axis index, and
  • specifying it to be a single, scalar value
are called the items of the array. Another way to say that a structural function applies to the leading axis is to say that it rearranges the items, but not the elements within the items.

   Rank Operator

The concepts of leading axis and item are generalized by treating an array as a frame defined by the array's leading m axes holding cells of rank n defined by the array's trailing n axes, where m+n is the rank of the array. A function f is applied to all cells of rank n with the expression f@n. The rank operator (@) applies uniformly to all functions of one or two arguments: primitive, derived, or defined, except Assignment and (because of its syntax) Bracket Indexing (@ does apply to Choose, which is semantically equivalent).

   Mapped Files

Mapped files are files accessed as simple arrays. These files can be very large (currently of the order of a gigabyte). Only the parts of a file that are actually referenced are brought into real memory, and therefore operations that deal only with parts of files are particularly efficient. Unless the files are extremely large, the transition from application prototypes dealing with ordinary arrays to production applications using mapped files requires only minimal code modification.

   Screens and Workspaces

Screens show views of arrays. A workspace is where computation takes place and where all immediately available A+ objects reside - variables, functions, operators, and so on. An array can be displayed on a screen with the show function. The array in the workspace and the screen view share the same storage. Changes to the array in the workspace are immediately reflected on the screen. Changes can be made to the screen view of the array, and they immediately change the array in the workspace. (The word workspace is also used in a different sense in screen management, to denote the leading top-level window.)

   Callbacks

Callbacks are automatic invocations of functions that have been associated with variables and events. Specification of a variable or selection of a row in its screen display, for example, can trigger the execution of a callback function. Callbacks provide a complete means of responding to asynchronous events.

   Dependencies

Dependencies are global variables with associated definitions. When a dependent variable is referenced its definition will be evaluated if, generally speaking, any objects referenced in the definition have changed since its last evaluation. Otherwise, its stored value is returned. Thus dependencies, like functions, always use the current values of the objects they reference, but are more efficient than functions because they do not reevaluate their definitions until at least one referenced object has changed.

   Contexts

Utilities and toolkits can be included in applications without name conflicts, by using contexts, which allow utility packages and toolkits to have their own private sets of names. Outside a context, names within are referred to by qualifying them with the context name. System commands and system functions provide facilities for working with contexts, such as changing the current context and listing all contexts in the workspace.

Some Features of the A+ System

   Linux, Solaris, and AIX Environments

A+ operates under various forms of Unix (Linux, Solaris, AIX, ...). A+ processes can be started from a shell or an Emacs or XEmacs session. Hereafter, "Emacs" is used here in a general sense, to mean Emacs or Xemacs. Emacs provides the application development environment for A+. It is possible to work in desk calculator mode in an A+ process started under Emacs. In this mode the user's view of the A+ process is an interactive session, where expressions can be entered for evaluation, and results are displayed. A session log is maintained, and can be referenced during the A+ session and saved at the end for future reference. Desk calculator mode is also the default for an A+ session started in a shell, but it is more common to use these A+ sessions for running applications with desk calculator mode turned off. In case an application fails, the appropriate entries to a log file can be written, or the A+ process can be permitted to return to desk calculator mode for debugging. An A+ process can communicate with other processes, A+ or not A+, through a communications interface called adap (see "Interprocess Communication: adap").

   Emacs Programming Development Environment

The A+ mode in Emacs provides programmers with very effective ways of testing and debugging applications. Programmers usually work with two visible buffers, one containing an A+ process and the other the source script of an application. Function keys provide the means to move either a single line from the script to the A+ process, where it is automatically executed, or an entire function definition. It is also possible to scroll back in the session log to bring expressions and function definitions forward for editing and reevaluation.

Applications

Programmers are concerned with three things when writing A+ applications: data, analytics (i.e., computations), and the user interface. The data of interest either reside in files accessible to the application or are maintained by another process. The analytics are the computations run on the data, and the user interface is the means for presenting the data or various aspects of the analytics to users. A+ has been designed for efficient programming of all three aspects of application production, and for efficient execution as well.

Data in files are usually maintained in A+ as so-called mapped files (see "Files in A+"), which are simple (i.e., not enclosed, or nested) arrays. Once an A+ application has opened a mapped file, it deals with it much as it would an ordinary array of its own creation. Mapped files can be shared, although shared updates across the network are problematical, unless mediated by a single process. Unix text files can also be copied into and written out of A+ processes.

Real-time data, which is of the utmost importance to many A+ applications, is accessed through an interprocess communication toolkit called adap. This toolkit provides a small number of functions for establishing and maintaining communication between an A+ process and other processes, such as a set of real-time data managers that read and write A+ arrays.

As an array-oriented language with a set of primitive functions that apply directly to entire arrays, A+ provides very efficient processing of functions that apply to large collections of data, often with less code than more conventional programming languages. Less code generally means fewer chances for failure; moreover, the A+ language processor is interpretive, which makes debugging relatively easy. Unless you take advantage of array calculations, however, being in an interpretive environment is likely to hurt you in performance. Thinking in terms of array algorithms is both a requirement and an opportunity, and it differentiates development in APL-derived environments from development in most other environments.

Application user interfaces are built with the A+ screen management system, a toolkit that relies on a small number of functions to create and interact with a variety of screen objects, such as buttons, tables, and layouts. See the chapters on screen management, display classes, and display attributes.

   Script Files

Applications are maintained in text files called scripts. Scripts contain function and data definitions and executable expressions. A+ has specific facilities for loading scripts. Loading a script has much the same effect as entering the lines of the script one at a time in desk calculator mode, starting at the top. Scripts can contain the A+ expressions for loading other scripts. Consequently application scripts do not have to contain copies of utilities and toolkits, and A+ applications tend to be very modular.

The A+ Keyboard

A+ uses the APL Union Keyboard. The special APL characters are entered by pressing a key while pressing either the Meta key, or both the Meta and Shift keys. The Meta keys (on Sun keyboards) are on either side of the space bar and are marked with diamonds. IBM keyboards have no Meta keys; use the Alt key, similarly situated, instead of Meta.

Note: Meta-Shift-m looks like Meta-m and Shift-\ but does not represent an A+ function.

An Interactive Keyboard Chart is also available, providing additional information about each of the A+ symbols and functions.



Click here for a keyboard diagram which will print more clearly on a black-and-white laser printer.

This figure is available as a printed Keyboard Reference Chart Tentcard, which is designed to stand up on your desktop beside your workstation. To request a copy, contact doc@aplusdev.org.


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_30.html0000444000265000001440000010220410737165226013640 A+ Reference: The Choice Display Class

The Choice Display Class

The choice class, like the radio class, is for boolean-valued slotfiller variables where one and only one of the values is 1. The value area and the button are one. The value area always holds the symbolic index of the only slotfiller value that is equal to 1. The items in the pulldown menu are called the label areas.

In effect, the choice display class is a one-item cascade menu with one submenu. The items of the submenu are the symbolic indices of the slotfiller. The menu is navigated and an item is selected in any one of the ways defined for the menu display classes; see "Selection using the Left Mouse Button", and "Selection and Traversal using the Tab, Arrow and Page Keys". Selecting an item in the submenu amounts to selecting a symbolic index of the slotfiller. When an item is selected, if the value at that symbolic index is 0, then it becomes 1 and the value that was 1 becomes 0. In addition, the submenu disappears and the selected symbolic index - the choice of the selection - is displayed in the value area.

Selecting an item causes a value change in the underlying variable. Therefore, if a callback function is defined for the variable, it is called whenever a new item is selected; the path argument p is the symbolic index to the changed value. Note that even though there are two value changes, any callback function associated with the underlying global variable is called only once, and the path argument of the callback function refers to the value that changed from 0 to 1. If an item in the submenu that already has the value 1 is selected, no callback occurs.

The label areas of an object in the choice display class correspond to the items in the pulldown submenu. They cannot be edited. The text in the value area also cannot be edited.

Visual Representation
  ch(`Name`Account`Date`Security`Amount;(1;0;0;0;0))
  `ch is `choice
  `ch has (`shelltitle;'ShellTitle'; `title;'Sort by:')
  show `ch

The second figure shows the appearance and position of the drop down menu after the user has pressed the left mouse button with the pointer anywhere on the choice button (not just the raised rectangle). It would look the same except that the yellow outline would not appear if Enter had been pressed with the pointer anywhere on the widget.

For information about a widget element, click the left mouse button with the tip of the pointer index finger on it. Point inside the frame but outside the widget for attributes governing overall size, position, etc.

The element you are pointing at is named in the status message area at the bottom of the window.

(Clicking the middle mouse button instead displays this information in a new browser.)



Attributes

See the "Display Attributes" chapter for details concerning all the attributes that apply to objects in the choice display class, as well as lists of colors and fonts. The keys in the Table of All Display Attributes that pertain to this class are E, ALL, CNFT, NFT, and TOP.

The attributes that are meaningful for the choice display class (other than the print... attributes) are:

acceptfocus
active
ancestors
arrowdown
arrowkeys
arrowleft
arrowlist
arrowright
arrowup
at
atsector
b
bg
bound
class
clear
cols
deiconized
doc
downto
dynamic
eval
evaluate
exit
extent
f1-f12
fg
fkeys
focus
followers
followertree
font
foot
freeze
fullscreen
h
H
has
head
hide
hl
hlthickness
icon
iconic
iconized
icontitle
incurrentworkspace
is
l
label
labelfg
labelfont
leader
leftto
literal
lower
mapped
naturalsize
notify
outofcurrentworkspace
parent
pin
preset
primary
protect
protected
r
raise
realize
refresh
request
resize
resizeable
rightto
script
sensitive
set
settings
shadowthickness
shell
shelltitle
show
state
stateself
syncshow
t
tabfrom
tablist
tabto
upto
title
titlefg
titlefont
titlejustify
vcol
vcols
verify
vrow
vrows
w
W
ws
x
X
xs
y
Y
ys
yx
YX
yxs
(Point the mouse cursor to an attribute to display a short description at the bottom of the screen)


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_31.html0000444000265000001440000007704510737165227013660 A+ Reference: The Command Display Class

The Command Display Class

The command display class is for monitoring the character by character input of a command line. The command representation has two parts, a title area on the left and a value area on the right. Text can be entered in the value area, and the entry can be monitored one character at a time, even though the value in the workspace does not change until the input is complete.
Visual Representation
     f{}:{
        (`buffer .of `com),
        (ҡ`buffer .of `com),
        `cursor .of `com
        }
     com0' '
     `com has (`class;      `command;
               `shelltitle; "Shell Title";
               `title;      "Enter command: ";
               `space;      20;   This is the default space, actually.
         Call the callback function f for each keystroke:
               `key;        (f;))
     show `com
The display in the
figure shows the object `com in edit mode. The cursor is positioned just to the right of the character y. At this point the following evaluations can be made:
     `buffer .of `com
< copy
     ҡ`buffer .of `com
<  4
     `cursor .of `com
<  4
If the user now presses t, say, then f is called, and in f these evaluations are made:
     `buffer .of `com
< copyt
     ҡ`buffer .of `com
<  5
     `cursor .of `com
<  5

For information about a widget element, click the left mouse button with the tip of the pointer index finger on it. Point inside the frame but outside the widget for attributes governing overall size, position, etc.

The element you are pointing at is named in the status message area at the bottom of the window.

(Clicking the middle mouse button instead displays this information in a new browser.)

Attributes

See the "Display Attributes" chapter for details concerning all the attributes that apply to objects in the command display class, as well as lists of colors and fonts. The keys in the Table of All Display Attributes that pertain to this class are C, ALL, CNFT, NFT, and TOP.

The attributes that are meaningful for the command display class (other than the print... attributes) are:

active
ancestors
arrowbuttons
arrowdown
arrowkeys
arrowleft
arrowlist
arrowright
arrowup
at
atsector
b
bg
bound
buffer
class
clear
colors
cursor
cycle
decrement
deiconized
doc
downto
dynamic
edit
editbg
editfg
editspace
eval
evaluate
exit
extent
f1-f12
fg
fkeys
focus
followers
followertree
font
foot
freeze
fullscreen
h
H
has
head
hide
hl
hlthickness
icon
iconic
iconized
icontitle
in
increment
incurrentworkspace
is
key
l
leader
leftto
literal
lower
mapped
naturalsize
notify
out
outofcurrentworkspace
parent
pin
preset
primary
protect
protected
r
raise
realize
refer
refresh
request
resize
resizeable
respace
rightto
script
sensitive
set
settings
shadowthickness
shell
shelltitle
show
space
state
stateself
syncshow
t
tabfrom
tablist
tabto
title
titlefg
titlefont
titlejustify
upto
vcol
vcols
verify
vrow
vrows
w
W
ws
x
X
xs
y
Y
ys
yx
YX
yxs
(Point the mouse cursor to an attribute to display a short description at the bottom of the screen)


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_32.html0000444000265000001440000037273010743450151013646 A+ Reference: The Graph Display Class

The Graph Display Class


The graph display class enables graphical representation of data in a variety of styles and formats, and interactive manipulation of that data. This class is a container class. A graph is represented by a global variable whose value is a scalar or vector of symbols. These symbols hold the names of other global variables, which are the children of the graph. Graph children have display class graphTrace. This class is automatically given to all children of a graph, and cannot otherwise be set.

The children of a graph are called graph trace sets. Each graph trace set can contribute one or more visible traces on a graph. The visible traces will simply be called traces. Some attributes are defined for graph trace sets, such as the colors of the traces, while others, such as the legend layout, are defined for the graph itself.

Some major features of a graph are shown in the first figure. Included are three traces, a title, subtitle, axes without rule lines, axis labels and x-axis sublabels, and a legend. The overall arrangement of a graph is fixed, but otherwise what appears in the figure can be set by means of the appropriate attributes.

There are various styles for the visible traces, including bar graph, pie chart, candlestick, and high-low, and a variety of ways users can interact with graphs, including zooming, annotating, and adjusting data points. The attributes available to a programmer for monitoring and controlling user interactions are described in this chapter, in the table "Attributes for Interactions with Graphs"; the user interactions themselves are described in the chapter "User Interactions with Displays", and in particular in "Graph Objects".

This chapter begins with a brief description of the organization of the data to be graphed and the attributes that apply directly to this data. Among these attributes is style, by which the appearance of the graph is specified. Descriptions of the major components of a graph and their associated attributes follow. The chapter concludes with sections on attributes associated with user interactions and miscellaneous attributes.

Trace Set Data

A graph trace set is either a numeric vector or a numeric matrix with at least two columns. The vector form, for a vector v, produces a single trace with x-coordinates #v and corresponding y-coordinates v or a pie chart with areas proportional to the elements of v. The matrix form produces one or more traces, with the first column containing the x-coordinates for all traces in the set. The remaining columns can represent one or more individual traces, such as lines or scatter charts, or one trace that requires more than one y-coordinate for its definition, such as a candlestick. A one-row, two-column matrix is used for a text trace, specifying the position of the lower left corner of the text. The text itself is specified as the title attribute of the trace set.

For performance reasons, when dates of the form yyyymmdd or mmdd appear in the data, they are considered as numbers, not parsed as dates, resulting in a distorted graph, unless the dates are all in the same month. If you convert the dates to Unix seconds, they will be properly distributed.

Trace Set Attributes

Trace set attributes are defined for trace sets, as opposed to the graphs themselves. They are nonpersistent: they disappear when a trace set is freed. They are all functional (see "Functional Attributes"). Each can be set to either a scalar value that applies to all traces, or a vector of values, one for each trace. A summary can be found in the table below. A detailed discussion of each attribute except barwidth follows the table.

Attributes Governing Appearance of Trace Sets in General
These attributes are all for graphTrace objects, except barwidth, which is an attribute of graph objects. See the
next table for the trace styles to which the colors, widths, and linestyle apply.
Attribute (all functional)Summary Description Data FormatDefault Value
barwidth The maximum width in pixels of the bars in a bar or stack graph. (Graph attribute.) numeric10
fillcolor Fill color for bar, pie, stack, area graphs; symbol color for scatter plots. string or symbol s.FILLCOLORS: one per trace set; if only one trace set, one per trace.
gradient If 1, color cycling is used for some styles. numeric0
legendText in the legend box that annotates the traces. string or symboldecorated trace set variable name
linecolor Line color for simple traces like scatter and line plots; component colors for compound traces like high-low and candlestick; outlines for bar, pie, etc. string or symbol s.LINECOLORS: one per trace set; if only one trace set, one per trace.
linestyle The basic styles are `solid, `dot, `dash, and `dotdash. symbol s.LINESTYLES: used for variation in each trace set when more than one set.
linewidth The line width in pixels for line style traces and pie outlines; for high-low style traces, the maximum display width. Not used for candlestick and various high-low graphs if it would cause individual figures to overlap. numeric1
See remark about overlap in description.
styleThe visual appearance of a trace. symbol`line
symbolThe symbol used in scatter plots. symbol`cross
symbolsize The size of the scatter plot symbol. numeric10
textfg The color a text trace appears in. symbol same as its titlefg
textfont The font a text trace appears in. character string same as its titlefont
xaxis If `x, the trace is plotted against an x-axis on the bottom; if `X, it is plotted against an x-axis on the top. symbol`x
yaxis If `y, the trace is plotted against a y-axis on the left; if `Y, it is plotted against a y-axis on the right. symbol`y

   fillcolor

The fillcolor attribute specifies the color used to fill the regions of a bar, pie, stack or area trace, and the color of the symbols of a scatter plot. The default fillcolor value is the value of the linecolor attribute; thus, in the absence of a fillcolor setting the bars appear as a solid rectangle. With a fillcolor different from that of linecolor, the bars appear with a border drawn in the linecolor value. The default behavior for fill coloring is described in the table above.

   gradient

If the gradient attribute has the value 1, then the colors of symbols in a scatter plot and bars in a bar graph are obtained by cycling through the colors listed in s.FILLCOLORS. If the attribute has been assigned a function, that function is called for every scatter point or bar.

   legend

The legend attribute controls the text that annotates the trace segments in the legend. The default is the name of global variable that contains the trace set. If the variable for a trace set is a matrix, then the name is supplemented by ":n", where n is 0, 1, ... . For example, if the global variable name is x, then the annotations are "x:0", "x:1", and so on.

   linecolor

The linecolor attribute specifies the color of the line segments in line, line-scatter, step, step-scatter, and segment traces, and the color of the borders of area, fill, pie, and stack traces. The default behavior of linecolor for these trace styles is described in the table above.

Up to four colors are meaningful for candlesticks and open-high-low-close graphs. In the case of a candlestick graph, the first color specifies the fill color of the candle when the open exceeds the close, the second is the color of the vertical lines segments, or wicks, the third is the candle border, and the fourth is the fill color of the candle when the close exceeds the open. When there is only one linecolor for a candlestick graph, it is used to fill the candle when the open exceeds the close, and the candles are hollow when the close exceeds the open. See the table "Attributes for Text Areas of Graphs".

For open-high-low-close traces, the first color specifies the color of the open ticks, the second is the color of the vertical line segments, the third is unused, and the fourth is the color of the close ticks. The default is to use the line color for all three colors. See the table just mentioned. If fewer than four colors are given they are used cyclically, in the manner of the primitive function Reshape. There are several cases for each of the styles high-low-close, high-low, and close, due to the fact that the data for these styles can have several different formats (i.e., number of columns). See the table "High-low Family; Data and Line Colors".

   linestyle

The basic linestyles are `solid, `dash, `dot, and `dotdash. In addition, `dot1 through `dot5 can be used for various intervals between dots, with `dot1 the smallest interval, `dot5 the largest, and `dot3 the same as `dot. Analogously, there are `dash1 through `dash5, where the dash length varies and `dash is between `dash2 and `dash3, and `dotdash1 through `dotdash5. When there is more than one trace set, the default assigns the basic styles in the order given above to the individual traces in each trace set. If there are more than four traces in a trace set, these styles are repeated as needed. When there is only one trace set, all the traces are `solid. This attribute applies to line, linescatter, and pie traces, as well as to trace sets with styles open-high-low-close, high-low-close, high-low, and close.

   linewidth

The linewidth attribute specifies (in pixels) the width of the line segments in line and linescatter traces, and the high-low style family of traces, and the outlines in pie charts. Line width is limited to 35, even if a higher value is set. Note: a significant performance penalty occurs on Sun Sparc workstations for line and linescatter traces with linewidths greater than 1 and more than 100 data points, due to system limitations. However, the various high-low style graphs look better with line segments wider than the default. See the figure "Various Line and Scatter Trace Styles", where all the graphs have line width 3.

Note: the linewidth setting for candlestick and the various high-low graphs is not used if it would cause the individual figures to overlap.

   symbol

The symbol attribute is used to specify the symbol used in a scatter plot. The values for the various symbols are:
`circle,    `circlefilled,    `cross,
`diamond,   `diamondfilled,
`square,    `squarefilled,    `star,
`triangle,  `trianglefilled,  `xsym.
If the value is any other symbol or a character vector, the text of that value is used for the symbol; the font in which a text symbol appears is specified by the font attribute of the trace set variable.

   symbolsize

The size, in pixels, of the symbol in a scatter plot.

   style

The style of the traces in a trace set, specified as one of the symbols in the table "Trace Styles, Data Format, and Attribute Applicability". See "Trace Styles".

   xaxis, yaxis

The xaxis attribute specifies whether a trace is plotted against the default x-axis at the bottom of the plot area or the alternate x-axis at the top; analogously, yaxis specifies whether the default y-axis on the left is used, or the alternate y-axis on the right. The alternate axes do not normally appear unless at least one trace is associated with them; see, however, the axis attribute.

   Trace Styles

The graph display class supports a variety of trace styles that are summarized in the following table. Included in this table is a cross reference indicating the applicability of the trace attributes discussed above. In addition to the table summary, a discussion and sample graphs of each style follow.

Trace Styles, Data Format, and Attribute Applicability
The attributes pertain to graphTrace objects. An x indicates that the column's attribute is meaningful for the row's trace style.
Trace StyleValue of style AttributeData Format fill-
color
line-
color
line-
style
line-
width
area`areavector, matrix xxxx
bar`barvector, matrix xx  
candlestick`candlen x 5 matrix  x morexx
close `c or `closevector, n x 2 - n x 5 matrix  x morexx
color profile`colorprofile vector, n x 2 - n x 5 matrix xx morexx
fill`fillvector, matrix xxxx
high-low`hlvector, n x 3 - n x 5 matrix  x morexx
high-low- close`hlc vector, n x 4 - n x 5 matrix  x morexx
line`linevector, matrix  xxx
linescatter`linescattervector, matrix xxxx
market profile `marketprofilevector, n x 2 - n x 5 matrix  x morexx
none` or `none any valid trace     
open-high- low-close`ohlc n x 5 matrix  x morexx
outline`outlinevector, matrix xxxx
pie chart`pie vector xxxx
scatter`scattervector, matrix xx  
segment`segmentvector, matrix  xxx
stack`stackvector, matrix xxxx
step`stepvector, matrix  xxx
stepscatter`stepscattervector, matrix xxxx
text`text1 x 2 matrix     

bar

The bar trace style displays trace data as a bar graph. The barwidth attribute (see the table "Miscellaneous Attributes for Graphs") specifies the maximum width for each bar. If a space limitation exists, the actual bar width is adjusted to fit within the available space. When there is a space limitation and the adjusted bar width is less than a threshold value, the border is dropped from the bar display and only the fill color appears.

The fillcolor and linecolor attributes are used to set the colors inside the bars, and the bar border colors, respectively. The linestyle and linewidth attributes have no effect on bar graphs.

The second figure shows a series of graphs with an increasing number of bar style traces in each successive graph. These graphs illustrate both the positioning of the bars on the x-axis relative to the x-value, and the effects of space limitation on the bar width. With each additional bar, the bar width is adjusted to fit within the available space while maintaining the same relative spacing. Notice that the borders around the bars eventually disappear.

A Series of One to Six Bar Traces

line

The line trace style is the default trace style and consists of line segments connecting consecutive data points. See the figure immediately below.

Various Line and Scatter Trace Styles

scatter

The scatter trace style uses a symbol (the default is a cross) to indicate the location of each data point in a trace. To produce scatter plots with small dots, set the trace symbol to `circlefilled and the `symbolsize to 3 (a smaller size will not be shown). See "fillcolor" for a discussion of fill colors and this trace style. See the previous figure.

linescatter

The linescatter trace style is a combination of the line and scatter style traces; the trace is an ordinary line graph, but in addition scatter symbols mark each data point. See the previous figure.

step and stepscatter

The step trace style is a variation of the line style that replaces each line segment with a step consisting of a horizontal and a vertical segment. The stepscatter trace style is the analogous variation of the linescatter style. See the previous figure.

segment

The segment trace style is a variation of the line style that permits a series of disconnected line segments to be specified in one trace. The line segments are every other one of those in a line graph. See the previous figure.

candle, ohlc, hlc, hl, c, marketprofile, colorprofile

The high-low family of trace styles can accept data in a variety of formats, which are summarized in the table "High-low Family; Data and Line Colors". With these flexible trace formats, it is possible to display any of the following graph styles without changing the underlying data: open-high-low-close, candlestick, high-low-close, high-low, close, market profile, and color profile. All these styles can be assigned to five-column trace sets.

Analogously, the following subset can be assigned to four-column trace sets: high-low-close, high-low, and close; to three-column trace sets: high-low and close; to two-column and vector trace sets: close, market profile, and color profile.

For these traces the linewidth attribute specifies the maximum width of line segments, if sufficient space is available. See the following figure.

Various Trace Styles Based on the Same Data

High-low Family; Data and Line Colors
Keys:   x: x coordinate; u: unused; v: vertical line segment color; c: close tick color; t: trace color.
Trace StyleTrace Set Data Column Indexlinecolor Index
01234 0123
ohlc, candlen x 5 matrix xopenhighlowclose See "linecolor"
hlcn x 5 matrix xopenhighlowclose uvuc
n x 4 matrix xhighlowclose  vuc 
hln x 5 matrix xopenhighlowclose uvuu
n x 4 matrix xhighlowclose  vuu 
n x 3 matrix xhighlow   vu  
color profile, close, market profilen x 5 matrix xopenhighlowclose uuut
n x 4 matrix xhighlowclose  uut 
n x 3 matrix xhighlow   ut  
n x 2 matrix xclose    t   
vector close     t   

text

Text traces are positioned on a graph by specifying the coordinates of the lower left corner of the bounding box of the text. The trace set for a text trace is a 1 by 2 matrix holding these coordinates as an (x, y) pair. The text that appears on the graph is the value of the title attribute of the trace set variable; the trace's titlefg attribute applies to the text unless its textfg attribute has been set, and likewise for titlefont and textfont.  The text "All Six Traces" on the lower right graph of the bar trace figure is a text trace.

Text traces do not appear in the graph legend and are superimposed on top of the other traces.

none

A trace on a graph can be hidden from view by setting its style attribute to `none or to the empty symbol (` ), and restored by resetting this attribute to any other appropriate value.

area

All traces with this style are accumulated in one visible trace. If there is only one trace with this style, its graph is the filled-in region bordered by the x axis and the line graph which this trace would form if its style were line. The lower region in the lower right graph in the figure "Various Stack and Area Graphs" is such a graph. If there is more than one trace with this style, the graph is a set of filled-in regions, stacked one above the other. See the filled-in regions in the upper right graph of the figure just mentioned, and compare that graph to the one on the lower left; they differ only in that both traces with style stack in the lower left have style area in the upper right.

fill

If a trace of this style is drawn as a line trace and the first and last points are connected, the result is the border of a closed region. If the style is fill that region is filled-in with the fillcolor. See the lower right graph in the stack and area figure, where the top region has style fill, the bottom region has style area, and their trace sets are equal.

stack

All traces with this style are accumulated in one visible trace, which appears to be a set of bar graphs, stacked one above the other. In fact, those individual bar graphs can be seen by setting the style of all traces with style stack to style bar. See the lower left graph in the stack figure, and compare it to the upper left.

Various Stack and Area Graphs

pie

Only y values are significant for pie charts, which are not graphed against a coordinate. Hence there are no x values, and only a vector is used for a `pie trace. In the absence of other traces in the graph, you might want to set the `axis attribute to `none, as has been done in the pie-chart figure. The attributes specifically for pie charts are shown in the following table.

     p1.2 2.3 3.4 4.5                Set points for the graph
     g`p                             Set up graph

     `g is `graph                     Establish class
     `p has (`style;`pie)             Establish style
     `g has (`axis;`none;             Turn off x-y axis display
             `xs;602;`ys;496;         Set size of window (x-size and y-size, in pixels)
             `pieoffsetmargin;0.35)   Set minimum space between text and edges of pie

     `p has (`pievaluealign;`bottom;
             `piepercentalign;`bottom)
     `p has (`linecolor;`black;`textfg;`black)                 Set colors for pie borders and text
     `p has (`pieoffsets;  0      0            0.15 0;         Pull out one slice
             `fillcolor;   `green `deepskyblue `red `yellow;   Slice colors
             `pieprofiles; 0.75   0.5          1    1)         Slice thicknesses

     show `g

A Pie Chart

Other Attributes Governing Appearance of pie Trace Sets
All attributes are for graphTrace except pieoffsetmargin, which is for graph.
AttributeDescriptionData FormatDefault Value
pieangle If pieprimaryslicealign is `none, pieangle gives the orientation of the primary slice of a pie chart in counterclockwise degrees from the three o'clock position. integer scalar0
pieaspectratio The extent to which a pie chart is tilted towards the viewer, ranging from 0.0 to 1.0. 1.0 is a top view, or flat pie. numeric scalar0.6
piedepthfactor The maximum height of the pie in a pie chart, as a fraction of the standard depth factor. Cf. pieprofiles. numeric scalar1.0
pielegendalign Where the legend for each slice of a pie chart is placed. Values are null, `none, `inside, `outside, `left, `right, `top, `center, and `bottom. The last five control placement with regard to values and percentages and will be ignored if not consistent with the values of pievaluealign and piepercentalign. Several values may be concatenated, as in `inside`top`left. The color and font are controlled by the trace's titlefg and titlefont attributes. scalar or vector `sym`center
pieoffsetmargin This attribute is for graph, not graphTrace. The margin around pie charts, as a fraction of the available space. The value ranges between 0 (inclusive) and 1 (exclusive). 0 makes pie charts as large as possible in the graph. 0.99 makes them dots. Values close to 1 cause calculation overflows, which appear as A+ domain errors. numeric scalarapprox. 0.3
pieoffsets The extent to which each slice is separated (pulled out) from the center of a pie chart. Values between 0.0 and 1.0 (inclusive) are treated as fractions of the pie's radius. Values greater than 1.0 and equal to or less than 100.0 are treated as percentages of the pie's radius. The value or values given are used cyclically for the slices. numeric scalar or vector0
piepercentalign Where to place the display of the percentage that each slice is of a pie. Values are null, `none, `inside, `outside, `left, `right, `top, `center, and `bottom. The last five control placement with regard to values and legends and will be ignored if not consistent with the values of pievaluealign and pielegendalign. Several values may be concatenated, as in `inside`top`left. The color and font are controlled by the trace's titlefg and titlefont attributes. scalar or vector `symNull
pieprimaryslice The trace index of the slice to be considered the "primary" slice of a pie chart, the slice whose display is controlled by pieprimaryslicealign or pieangle. The value -1 means that the largest slice will be considered the primary slice. For a brief time, it was called primaryslice. integer scalar-1
pieprimaryslicealign Where to place the primary slice of a pie chart (by rotating the pie). The possible values are null, `none (see pieangle), `left, `right, `top, `bottom. For a brief time, it was called primaryslicealign. scalar `sym Null (`top)
pieprofiles The height of each slice of a pie, as compared to the maximum height of the pie. Values between 0.0 and 1.0 (inclusive) are treated as fractions of the pie's maximum height. Values greater than 1.0 and equal to or less than 100.0 are treated as percentages of the pie's maximum height. The value or values given are used cyclically for the slices. numeric scalar or vector1.0
pievaluealign Where to place the display of the value of each slice of a pie chart. Values are null, `none, `inside, `outside, `left, `right, `top, `center, and `bottom. The last five control placement with regard to percentages and legends and will be ignored if not consistent with the values of piepercentalign and pielegendalign. Several values may be concatenated, as in `inside`top`left. The format of the value display is controlled by the out attribute, and the color and font are controlled by the trace's titlefg and titlefont attributes. scalar or vector `symNull
primaryslice Called this for a brief time, but now called pieprimaryslice.   
primaryslicealign Called this for a brief time, but now called pieprimaryslicealign.   

 

The Order in Which Traces Are Drawn

The basic order in which traces are drawn is the index order of the graph trace variables in the graph variable, and within each graph trace variable, the index order of the columns. (This order may be changed without freeing the trace variables.) The traces appear in the legend in this order, starting at the top in vertical legends. When multiple bar graphs have common x-coordinates, they are drawn from left to right in this order, clustered near that common value. Stack and area graphs are drawn from top to bottom in this order. All area and fill traces are drawn in this order before traces of any other style are drawn; all bar and stack graphs are then drawn in this order; all remaining traces other than text traces are then drawn in this order; finally, all text traces are drawn in this order. Trace search order is the same as the order in which traces are drawn.
 

The Text Areas of a Graph

The text areas of a graph are its title, subtitle, footnote, and axis titles. The title and subtitle areas are illustrated in the first figure. The title appears at the top of the graph. The subtitle appears below the title, and the footnote appears below the x-axis at the bottom of the graph. Any of the three can have one or more lines, their text can be justified, and their color and font can be specified.

The x-axis title appears under the x-axis labels and sublabels; the y-axis title appears at the top of the y axis. See the table "Axis Attributes for Graphs".

Attributes for Text Areas of Graphs
These are all attributes of graph objects
AttributeDescriptionData FormatDefault Value
footnoteThe text of the footnote on the graph. string, symbol; a nested vector of strings or symbols is accepted for multiline text.null string
footnotefgThe color of the footnote text.string, symbol `axiscolor (inherits the axis color until the footnotefg attribute is set to a different color)
footnotefont The font of the footnote text. stringlucidasans typewriter-12
footnotejustify `center, `left, or `right justify the text. symbol`center
subtitleThe text of the subtitle of the graph. string, symbol; a nested vector of strings or symbols is accepted for multiline text.null string
subtitlefgThe color of the subtitle text.string, symbol `axiscolor (inherits the axis color until the subtitlefg attribute is set to a different color)
subtitlefont The font of the subtitle text. stringlucidasans typewriter-12
subtitlejustify `center, `left, or `right justify the text. symbol`center
title The text of the title of the graph; trace set titles are meaningful for text traces only. string, symbol; a nested vector of strings or symbols is accepted for multiline text. variable name
titlefg The color of the title text. (The trace's titlefg governs the color of text traces and of each pie trace slice's legend, value, and percent text.) string, symbolblack
titlefont The font of the title text. (The trace's titlefont governs the font of text traces and of each pie trace slice's legend, value, and percent text.) stringkaplgallant
titlejustify `center, `left, or `right justify the text. symbol`center

   The Legend of a Graph

The legend appears automatically on a graph. Its default arrangement is vertical, but it can be also be aligned horizontally; see the legendstyle attribute in the table "Legend Attributes for Graphs", and see the bar trace figure for examples. The text that annotates each trace sample is specified using the trace set attribute named legend. The position, or justification, of the legend is specified using the graph attribute named legend. This position can be within the plot area, i.e., the area within the axes, or it can also be outside the plot area. The legend can be removed by setting the graph legend attribute to `none.

Legend Attributes for Graphs
These are all attributes of graph objects
AttributeDescriptionData FormatDefault Value
legend Position of the legend in the plot area or outside it. Values are:

`bc, `bl, `br, `tc, `tl, `tr`none (removes the legend).


Inside: `bottom, `center, `left, `horizontal, `inside (centered both ways), `right, `top, `vertical;
      Outside: `outside, `outsidehorizontal, `outsidevertical.
(xlegend and ylegend, if set, always take precedence over legend, but setting legend clears - unsets - them.)

symbolvector
`left `top `inside
legendbg The background color of the legend. symbol or stringgray
legendfg The foreground color of the legend. symbol or stringblack
legendfont The font of the text in the legend. The legend symbol size depends upon the font size. stringlucidasans typewriter-10
legendhlthickness The thickness of the legend highlight area, in pixels. numeric1
legend shadowthickness The thickness of the legend shadow area, in pixels. numeric1
legendstyle The style of the legend: vertical (`ver), horizontal (`hor), horizontal with the last trace values (`lastvalue), or not at all (`none) (see the bar trace figure).
The last values are those associated with the element or row with the largest index for each trace set.
symbol`ver
xlegend,
ylegend
The x, y coordinates of the upper left corner of the legend when the legend attribute of the graph is set and has not been cleared by a later setting of legend. numeric0, 0

 

The Axes of a Graph

The axes of a graph have the most attributes of the various components. For convenience, the descriptions appear in three tables, one for axes in general ("Axis Attributes for Graphs") and the other two for tick marks and tick labels specifically ("Axis Label and Tick Mark Attributes for Graphs", and "Attributes That Assist in Specifying Tick Marks and Labels"). Many of the axis-related attributes have more than one version, corresponding to more than one axis; the convention for their names is presented next.

   Default and Alternate Axes

Graphs have a default set of axes, with the x axis bordering the bottom of the plot area and the y axis bordering on the left. In addition, an alternate x axis can be drawn on top of the plot area, and an alternate y axis on the right. These alternate axes are referred to as the X axis and Y axis, as opposed to the default x axis and y axis.

These additional axes can be used purely for appearance, either supplementing or replacing the default axes, or they can be used to plot traces with different scales on the same graph (see the trace attributes xaxis and yaxis).

These axes have independent attributes, such as color, and the names of the attributes are prefixed with "x" to indicate the default x axis, "X" the alternate x axis, i.e., the X axis, "y", and "Y". For example, in the case of foreground color, the four attributes are xfg, Xfg, yfg, and Yfg. To save space in the tables, the four attributes may appear in shorthand notation, like x/X/y/Yfg for the four color attributes.

   The axis, grid, and rule Attributes

These attributes determine the appearance of the axes and grid lines.

The standard axis style is specified by the value `std for the axis attribute; see the bar trace figure. The value `std for the axis attribute has the property that when any of the xaxis or yaxis attributes of any trace is set to an alternate axis, that axis automatically appears. The boxed style, specified by the value `box, additionally has a box around the plot area. Axes are removed by setting the axis attribute to `none. Any combination of default and alternate axes can be used by setting the axis attribute to a symbol value containing the appropriate letters x, X, y, and Y (in any order).

The rules on the axes, which are the straight lines that run lengthwise, can be specified separately. For example, the boxed style can be obtained by setting the axis attribute to `xy and the rule attribute to `xXyY. When the rule attribute is set to `axis, its value is effectively the same as that of the axis attribute.

In addition, grid lines can be drawn at the major tick marks on axes by setting the grid attribute.

   The xlabel, Xlabel, ylabel, and Ylabel Attributes

These attributes provide complete control over the placement of tick marks, the text of their labels, their lengths, and the widths of their associated grid lines. A complete specification for any of them is a nested vector of length four, of the form (ticks;labels;sizes;widths), where:
  • The i-th element of ticks specifies the location of the i-th tick mark.

  • labels is either a nested vector of character vectors or a character matrix whose i-th element or row is the label on the i-th tick mark. (A simple scalar or vector is treated as a matrix with one row.)

    Warning! A `null or `symbol item is handled as if it were character and is interpreted as indicating that the default labels, the tick values, should be used! Therefore (see the warning following these bullets) a Null or symbol item can override a character item!

    Warning! If fewer labels than ticks are specified, the last of the specified labels is used for them!

  • The i-th element of sizes is a number between 0 and 1 which, when multiplied by the value of the majorticksize attribute, gives the length of the i-th tick mark. A scalar is treated as a vector with one element.

  • The i-th element of widths is an integer specifying the width, in pixels, of the gridline that intersects the axis at the i-th tick mark. A scalar is treated as a vector with one element.

    Warning! A 0 in widths produces a 1-pixel width grid line (although in printing the line may be narrower than one specified by a 1)!

Warning! The first component, ticks, is positional, as you would expect. The other three components, however, are actually interpreted by type, a `char or nested character item being used for labels, a `float item being used for sizes, and an `int item being used for widths! Their order does not matter! In fact, if two or more of them have the same type, then the last is used and the rest (of the same type) are quietly ignored!

Only the ticks are required, and if they alone are specified the ticks vector does not need to be nested. For any of the other three components, if the number of its elements exceeds the number of ticks, the extra elements are ignored. For sizes and widths, if there are fewer elements than ticks, the elements are used cyclically, in the manner of the A+ Reshape primitive function.

The label attributes are functional, giving a way to set the tick marks and their associated values under a variety of dynamic situations, such as scrolling. There are several attributes whose values can be queried but not set which give information that helps in laying out the tick marks and labels; see the table "Attributes That Assist in Specifying Tick Marks and Labels".

Examples of Correct `xlabel Specifications

(`xlabel;)    Set all to defaults. Labels: values; ticksizes: full (1.); no gridlines.
(`xlabel; 2 3 4)                 Ticks at 2 3 4. Defaults for others.
(`xlabel;(2 3 4; 3 2"abcdef"))  Ticks, labels. Defaults for others.
(`xlabel;(2 3 4; .4 .6 .4))      Ticks and ticksizes.
(`xlabel;(2 3 4; 1 2 1))         Ticks and linewidths.
(`xlabel;(2 3 4; 1 2))           Same effect as preceding.
(`xlabel;(2 3 4; .5; 2))         Ticks, ticksizes, linewidths.
(`xlabel;(2 3 4; 3 2"abcdef"; 1))   Ticks, labels, linewidths.
(`xlabel;(2 3 4;("ab";"cd";"ef"); .7; 1))  All.

   Zero axes

Zero axes can also appear in a graph. For which axes they are shown, their style, their color, and their thickness are governed by the attributes zero, zerostyle, zerofg, and zerowidth. The table "Axis Attributes for Graphs" gives their ranges of values and their defaults.

Axis Attributes for Graphs
These are all attributes of graph objects
AttributeDescriptionData FormatDefault Value
axis `std, `box, `none, or a symbol containing one or more of x, y, X, Y (see "The axis, grid, and rule Attributes")symbol`std
grid `none, or a symbol containing one or more of x, y, X, Y that does not contain both x and X, or y and Y (see "The axis, grid, and rule Attributes").
Grid lines can occur only at major tick marks, and only at all of them. To have irregularly spaced grid lines, instead of using the grid attribute specify traces that each have two points with the same x value and minimum and maximum y values and attributes such as (`legend;`; `linestyle;`dash; `linecolor;`black). These "grid" traces can be dependencies whose values depend upon those of the true traces.
symbol`none
gridfgThe color of the grid lines. string or symbolblack
gridstyle The style of the grid lines; one of `solid, `dash, `dotdash, `dot. symbol`dash
gridwidthThe line width of the grid lines.numeric 0 (very thin; like 1 for display, but finer for printing)
rule `std, `box, `none, `rule, or a symbol containing one or more of x, y, X, Y (see "The axis, grid, and rule Attributes"). symbol`std
rulewidthThe line width of axis rules and tick marks.numeric 0 (very thin; like 1 for display, but finer for printing)
xfg, Xfg,
yfg, Yfg
The color of the indicated axis, axis labels, and tick marks. string or symbolblack
x/X/y/Ymin,
x/X/y/Ymax
The minimum and maximum values of the indicated axes. For these attributes to be effective, min must be less than max (if both are set); otherwise, the minimum and maximum values of the indicated axes are derived from the trace data. Use values in the same domain as the data to which the pair applies, e.g., dates in the same form.
See
xmax in the table listing all attributes.
numeric Computed values used.
xtitle, Xtitle,
ytitle, Ytitle
The text of the indicated axis title.stringnull string
x/X/y/Ytitlefg The color of the text in the indicated axis title. stringblack
x/X/y/Ytitlefont The font in which the text of the indicated axis title is set. stringlucidasans typewriter-12
x/X/y/Ytitlejustify `left, `center, `right for horizontal titles; `top, `center, `bottom for vertical titles. string`center
ymode Controls which way the values run on the y-axis and Y-axis: `ascend or `descend. numeric`ascend
ytitlestyle, Ytitlestyle The y-axis and alternate y-axis titles can each appear above the axes (`hor) or stacked vertically alongside (`ver). In both cases the titles are outside the plot area of the graph. symbol`hor
zero Which zero axes appear: `none, `x, `X, `y, `Y, `xy, `xY, `Xy, or `XY. symbol`xy
zerofgControls the color of the zero axes. string or symbolslategray
zerostyle The style of the zero axes: `dot1 through `dot5, `dotdash1 through `dotdash5, `dash1 through `dash5, or `solid.symbol`dot1
zerowidthControls the width of the zero axes (0 - 10).numeric 0 (very thin; like 1 for display, but finer for printing)

Axis Label and Tick Mark Attributes for Graphs
These are all attributes of graph objects
AttributeDescriptionData FormatDefault Value
x/X/y/Yinc The increment in axis coordinates between adjacent major tick marks on the indicated axis. When it is set to nothing, (`xlabelout;), A+ determines this value based on trace data and axis label size. numeric0
xlabel, Xlabel,
ylabel, Ylabel (functional)
The tick mark locations, and any of the following: the text of the labels, the lengths of the tick marks as fractions of the majorticksize setting, and the widths (in pixels) of the grid lines. For details see "The xlabel, Xlabel, ylabel, and Ylabel Attributes". numeric or nested vector 
xsublabel, Xsublabel (functional) Sublabels provide a second row of axis labels below the label row. The interpretation of these attributes is the same as for label attributes (see above in this table).
x/X/y/YlabelfontThe font in which the labels on the indicated axis are set. symbol, stringlucidasans typewriter-12
x/Xlabeljustify,
x/Xsublabeljustify
Justify the labels or sublabels of the indicated axis: `left, `center, `right. symbol`center
y/Ylabeljustify Justify the labels of the indicated axis: `bottom, `center, `top.
x/X/y/Ylabelout,
x/Xsublabelout (functional)
Specification of tick label and sublabel formatting, in the same way that data formats are specified for the screen with the out attribute. Furthermore, set to ` or `none to remove the labels. If x/Xsublabelout is given a value when no sublabels are present, they appear automatically. symbol, function, or character string 
x/X/y/Ymajorticksize The size of the major ticks on the indicated axis, in pixels. numeric10
x/X/y/Yminorticks The number of minor tick marks that appear between consecutive major tick marks on the indicated axis. numeric1, 1
x/X/y/Yminorticksize The size of the minor ticks on the indicated axis, in pixels. numeric6
x/X/y/Ytickstyle The tick style for the indicated axis: if `out or `in, the tick marks point out of or into the plot area; if `inout, the tick marks straddle the axis. symbol`out

Attributes That Assist in Specifying Tick Marks and Labels
These are all attributes of graph objects
AttributeDescription
x/X/y/Yextent A three-element vector v giving the minimum value for the indicated axis (v[0]), the maximum value (v[1]), and a scale factor (v[2]) such that (v[1]-v[0])v[2] is the length of the axis in pixels.
x/X/y/Ylabelheight The height, in pixels, of any label on the indicated axis, based on the current font.
x/X/y/Ylabelwidth The width, in pixels, of a specified label for the indicated axis. The text of the label is given as a character vector, as for example:
(`xlabelwidth;'label text') of `g
where `g is the graph. A vector of character vectors or a character matrix can also be given for the text, and a vector of pixel lengths is returned. In the case of a matrix, the rows are taken as the labels.

 

Interactions with Graphs

There are a variety of interactions with graphs to customize the display, edit and manipulate trace data, perform detailed examination of traces, and navigate through graphs that are only partially displayed. These interactions are described in "User Interactions with Displays", and particularly in "Graph Objects". The following attributes provide the means for programmers to monitor user interactions and control the responses:

Attributes for Interactions with Graphs
AttributeDescription
addtexttrace Like addtrace, but applies to text traces. See "Example" regarding automatic creation of variable names.
addtrace An attribute with callback (see "Attributes with Callbacks"). If it is set to a value, which must be a function or a (function; static_data) pair, that function is called whenever a numeric trace is created interactively; the value of the coordinate attribute is the trace set of the created trace. The default behavior is to create a global variable containing the trace set and to append the name of this trace-set object (in symbol form) to the graph object; the new trace set is a two-column matrix and its style is `line. See "Example" regarding automatic creation of variable names.
coordinate This is a reference-only attribute whose value is the two-element vector (x-axis coordinate, y-axis coordinate) of the pointer position in the case of a refer event on a graph, or the entire trace in the cases of a refer event on a trace and an interactive creation of a new trace.
Coordinate Like coordinate, but the value is the alternate axis coordinates of the pointer position in the case of a refer event on a graph.
copytexttrace Like addtexttrace, but applies when text traces are copied interactively. See "Example" regarding automatic creation of variable names.
copytrace Like addtrace, but applies when a numeric trace is copied interactively. A numeric trace to be copied interactively must be selectable; see the selectable and refer attributes. See "Example" regarding automatic creation of variable names.
delete Like addtrace, but applies when a trace is deleted interactively. The default value of this attribute is 0, and with this value traces cannot be deleted interactively. If it is 1, traces can be deleted interactively, and the variable of the deleted trace is automatically removed from the graph object. Only text traces and selectable numeric traces can be deleted interactively; see the selectable attribute.
mode Set up interactive entry (`addtrace) or text entry (`addtexttrace) at `coordinate, or terminate entry, like Enter or double click (`normal).
movelimit Restrains the movement of a data point being modified interactively; one of `x (the default), `y, and `none.
refer A refer event occurs on the graph object when the left button is clicked with the pointer anywhere on the graph object except on a data point of a numeric trace. A refer event on a selectable trace occurs when the pointer is on the trace and the left button is double-clicked; see the selectable and coordinate attributes, and "Attributes with Callbacks".
referpoint A referpoint event occurs when the pointer is on any data point of any numeric trace and the left button is clicked; see the selected attribute, and "Attributes with Callbacks".
selectable Effective with two-column line traces only; that is, only two-column line traces are selectable. If the value is 1, the trace can be selected, i.e., the user can interactively manipulate the trace. The default value is 0.
selected The value is the two element vector of row, column indices of the selected data point when a referpoint event occurs.
textactivate A textactivate event occurs a text trace is interactively modified. The default action is to replace the value of the title attribute of the text trace with the new text. Note that there is no counterpart for the interactive modification of a numeric trace, but that action can be monitored with a callback function.
x/X/y/Yextent These attributes can be used to detect zooming, since each one contains the least and greatest values currently shown on its axis, as well as a scale factor.
x/X/y/Ymin, x/X/y/Ymax Resetting these attributes, even to all zeros, is a way of undoing in a program any zooming a user has done on the screen, in order, for example, to ensure that a new point is shown promptly.

Data points can be moved interactively (see "Data-Point Move"). Their movement can be restrained to vertical only, so that x coordinates don't change, by setting the movelimit attribute to `x, or to horizontal only by setting it to `y. There are no restraints when it is set to `none.
 

Miscellaneous Graph Attributes

Miscellaneous Attributes for Graphs
These are all attributes of graph objects.
AttributeDescriptionData FormatDefault Value
barwidth The maximum width in pixels of bars in bar and stack graphs. numeric10
bgThe background color of the graph. string or symbolgray
bottom,
top,
left,
right
The margin width or height of the area consisting of the plot area (the region within the four axis rules, even when some of the rules are absent), axes and labels, and axis titles, as a percentage of the default width or height of that area (a whole number or a fraction, e.g., 20 or 0.20, but only a whole number if in excess of 100%). numeric0
debug If 1, the A+ processor displays a message every time a graph is redrawn, updated (i.e., the last point on a trace is changed), or printed. integer0
fg The color of the axes, axis labels, legend titles and the legend border, subtitle, and footnote when their colors have not been explicitly specified. string or symbolblack
selectdistance The distance in pixels from which a trace data point is selectable for interactive manipulation of its value. numeric10
shadowthickness The width in pixels of the shadow area (the border) around the graph. Set to 0 for no border. numeric2
xleft,
xright,
Xleft,
Xright,
ytop,
ybottom,
Ytop,
Ybottom
xleft is the left margin of the xy trace area and xY trace area as a percentage of the axis range (a whole number or a fraction, e.g., 20 or 0.20, but only a whole number if in excess of 100%). Analogously, Ytop is the top margin of the xY and XY trace areas, and all the others are similar.
The xy trace area is the region holding traces plotted against the x and y axes. By default it coincides with the plot area. There is also an xY trace area holding traces plotted against the x and alternate y axis, as well as Xy and XY trace areas.
numeric0
xs,
ys,
extent
xs, ys: the dimensions of the graph in pixels.
extent: the vector x, y, xs, ys, where x and y are the graph's coordinates in pixels relative to its parent, or to the screen if it is top-level.
numericxs and ys: 200. extent: 0 0 200 200

 

Lists of All Graph and GraphTrace Attributes

The keys in the "Table of All Display Attributes" in the "Display Attributes" chapter that pertain to the graph display class are G, ALL, CNFT, NFT, and TOP.

The attributes that are meaningful for the graph display class (other than the print... attributes) are:

active
addtexttrace
addtrace
ancestors
arrowdown
arrowkeys
arrowleft
arrowlist
arrowright
arrowup
at
atsector
axis
b
barwidth
bg
bottom
bound
children
class
clear
coordinate
Coordinate
copytexttrace
copytrace
deiconized
delete
descendents
doc
downto
dynamic
eval
evaluate
exit
extent
f1-f12
familytree
fg
fkeys
focus
followers
followertree
font
foot
footnote
footnotefont
footnotejustify
freeze
fullscreen
grid
gridfg
gridstyle
gridwidth
h
H
has
head
hide
hl
hlthickness
icon
iconic
iconized
icontitle
incurrentworkspace
is
l
leader
left
leftto
legend
legendbg
legendfg
legendfont
legendhlthickness
legendshadowthickness
legendstyle
literal
lower
mapped
mode
naturalsize
newshow
notify
outofcurrentworkspace
parent
pieoffsetmargin
pin
preset
primary
r
raise
realize
recursively
refer
refresh
reparent
request
reshow
resize
resizeable
right
rightto
rule
rulewidth
script
selectdistance
selected
sensitive
set
settings
shadowthickness
shell
shelltitle
show
state
stateself
subtitle
subtitlefg
subtitlefont
subtitlejustify
syncshow
t
tabfrom
tablist
tabto
title
titlefg
titlefont
titlejustify
top
upto
vcol
vcols
verify
vrow
vrows
w
W
ws
x
X
xextent
xfg
xinc
xlabel
xlabelfont
xlabelheight
xlabeljustify
xlabelout
xlabelwidth
xleft
xlegend
xmajorticksize
xmax
xmin
xminorticks
xminorticksize
xright
xs
xsublabel
xsublabeljustify
xsublabelout
xtickstyle
xtitle
xtitlefg
xtitlefont
xtitlejustify
y
Y
ybottom
ylegend
ymode
ys
ytitlestyle
ytop
yx
YX
yxs
zero
zerofg
zerostyle
zerowidth
The keys in the "Table of All Display Attributes" that pertain to the graphTrace display class are gT and ALL.

The attributes that are meaningful for the graphTrace display class are:

active
ancestors
bg
bound
class
coordinate
doc
f1-f12
eval
evaluate
fillcolor
fkeys
gradient
has
is
legend
linecolor
linestyle
linewidth
movelimit
parent
pieangle
pieaspectratio
piedepthfactor
pielegendalign
pieoffsets
piepercentalign
pieprimaryslice
pieprimaryslicealign
pieprofiles
pievaluealign
preset
protect
protected
refer
referpoint
script
selectable
selected
set
settings
shell
state
stateself
style
symbol
symbolsize
textactivate
textfg
textfont
title
titlefg
titlefont
titlejustify
verify
xaxis
yaxis
(Point the mouse cursor to an attribute to display a short description at the bottom of the screen)


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_32HG.html0000444000265000001440000007662610737165230014076 A+ Reference: The Hgauge Display Class

The Hgauge Display Class

The hgauge display class displays a scalar number in graphical and also (optionally) digital form. The graphical representation shows a slider extending from the value of the min attribute to the value of the variable; the scale continues to the value of the max attribute. If the variable value is out of the min-max range, the slider occupies all or none of the slider slot, but the value label shows the correct number.

Labels for the minimum and maximum values can be specified in the mintitle and maxtitle attributes; their location, font, and color can be set using mintitlejustify, mintitlefont, mintitlefg, etc. Tick size is controlled by majorticksize and minorticksize, and the number of ticks between major ticks by minortickcount. Parallel sets of attributes, label... and value..., govern aspects of the scale and the value label, although labelout and out do not conform to this parallel naming convention. There are sliderbg, sliderheight, and sliderwidth attributes; for an hgauge, sliderwidth is ignored because the width depends upon the value. Other properties are covered by the usual attributes: title, subtitle, bg, etc.

For comparison, the three closely related classes vgauge, hscale, and vscale are also shown in the figure.

Visual Representation
     (a;b;c;d)30 40 50 60
     `a`b`c`d is `hgauge `hscale `vgauge `vscale
     `a`b`c`d has `title,<("hgauge a";"hscale b";"vgauge c";"vscale d")
     show `a`b`c`d
     `a`b`c`d has ((`x;3);(`x;3;`y;155);(`x;225);(`x;416))

Attributes

See the "Display Attributes" chapter for details concerning all the attributes that apply to objects in the hgauge display class, as well as lists of colors and fonts. The keys in the Table of All Display Attributes that pertain to this class are hG, ALL, CNFT, GS, NFT, and TOP.

The attributes that are meaningful for the hgauge display class (other than the print... attributes) are:

active
ancestors
arrowdown
arrowkeys
arrowleft
arrowlist
arrowright
arrowup
at
atsector
b
bg
bound
class
clear
deiconized
doc
downto
dynamic
eval
evaluate
execute
exit
extent
f1-f12
fg
fkeys
focus
followers
followertree
font
foot
freeze
fullscreen
H
h
has
head
hide
hl
hlthickness
icon
iconic
iconized
icontitle
inc
incurrentworkspace
is
l
labelfg
labelfont
labelinc
labeljustify
labelout1
leader
leftto
literal
lower
majorticksize
mapped
max
maxtitle
maxtitlefg
maxtitlefont
maxtitlejustify
min
minortickcount
minorticksize
mintitle
mintitlefg
mintitlefont
mintitlejustify
naturalsize
notify
out1
outofcurrentworkspace
pageinc
parent
pin
preset
primary
r
raise
realize
refresh
request
resize
resizeable
rightto
script
sensitive
set
settings
shadowthickness
shell
shelltitle
show
sliderbg
sliderheight
sliderwidth
state
stateself
subtitle
subtitlefg
subtitlefont
subtitlejustify
syncshow
t
tabfrom
tablist
tabto
title
titlefg
titlefont
titlejustify
upto
valuefg
valuefont
valuejustify
vcol
vcols
verify
vrow
vrows
W
w
ws
X
x
xs
Y
y
ys
YX
yx
yxs
(Point the mouse cursor to an attribute to display a short description at the bottom of the screen)

1. Note that labelout is used to format the scale labels and out to format the value label.


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_32HGr.html0000444000265000001440000007067110737165230014252 A+ Reference: The Hgrid Display Class

The Hgrid Display Class

There are two grid classes, hgrid and vgrid. They are container classes like the layout class, but their children have their natural sizes, rather than being sized to fill the layout as far as possible, any placement requests by the children (right, bottom, etc.) are ignored, and the grid objects have no titles - the value of the title attribute is ignored.

The hgrid class, unlike the vgrid and layout classes, has a horizontal default arrangement. Objects of the three classes, specified in the same way except for class and the geometry of the horizontal layouts, are shown in the figure below for comparison. The layout and grid backgrounds are shown in a lighter grey to make clear what space the objects occupy. Normally, they would appear in the same shade of grey as the rest of the objects, to present a homogeneous appearance, like the vertical layout with no title.

Points to notice in the figure are:

  • The widths of the vertical layouts and grid are determined by the length of the label. The heights of the horizontal layouts and grid are determined by the height of the array.

  • In the layouts, objects are increased from their natural sizes to fill the space available for them, causing the array to have a partial column in the vertical layout. The scalar and label objects, however, are constrained vertically, by default, so they are centered (by default) and the extra space is considered part of the layout background.

  • In the grids, each object is placed (top left) in the next available space. The grid retains the leftover scraps of space. If c5 and c6 had been bound and their rows attribute set to 3, and then were reparented to the grids, there would not be the two rows of leftover space at the bottom.
Visual Representation
    a1a2a3a4a5a610
    b1b2b3b4'An object in a layout'
    b5'An object  in a vgrid'
    b6'An object in an hgrid'
    c1c2c3c4c5c6(10).*3
    l1     `a1`b1`c1; l21 3 `a2`b2`c2; l3`a3`b3`c3
    l41 3 `a4`b4`c4; l5     `a5`b5`c5; l6`a6`b6`c6
     To show layout background:
    `l1`l2`l3`l4`l5`l6 has <`bg `gray90
    `l1`l2`l3`l4`l5`l6 has `title, < ('Layout';'Layout, horizontal'; ''; ''; 'Vgrid'; 'Hgrid')
    {`l1`l2`l3`l4`l5`l6 `b1`b2`b3`b4`b5`b6 s.are
        (4`layout),`vgrid,`hgrid, 6`label;}
    `c1`c2`c3`c4`c5`c6 has <(`rows;3)
    show `l1`l2`l3`l4`l5`l6
    `l2`l4`l6 has<(`x;280)
    `l3`l4`l5`l6 has((`y;240);(`y;240);(`y;450);(`y;450))

Attributes

See the "Display Attributes" chapter for details concerning all the attributes that apply to objects in the hgrid display class, as well as lists of colors and fonts. The keys in the Table of All Display Attributes that pertain to this class are hR, ALL, CNFT, CNT, NFT, and TOP.

The attributes that are meaningful for the hgrid display class (other than the print... attributes) are:

active
ancestors
arrowdown
arrowkeys
arrowleft
arrowlist
arrowright
arrowup
at
atsector
b
be
bg
bound
build
children
class
clear
deiconized
descendents
doc
downto
dynamic
eval
evaluate
exit
extent
extents
f1-f12
familytree
fg
fkeys
focus
followers
followertree
font
foot
freeze
fullscreen
H
h
has
head
hide
hl
hlthickness
icon
iconic
iconized
icontitle
incurrentworkspace
is
l
leader
leftto
literal
lower
mapped
naturalsize
newshow
notify
outofcurrentworkspace
parent
pin
position
preset
primary
r
raise
realize
recursively
refresh
reparent
request
reshow
resize
resizeable
rightto
script
sensitive
set
settings
shadowthickness
shell
shelltitle
show
state
stateself
structure
syncshow
t
tabfrom
tablist
tabto
title
titlefg
titlefont
titlejustify
upto
vcol
vcols
verify
vrow
vrows
W
w
ws
X
x
xs
Y
y
ys
YX
yx
yxs
(Point the mouse cursor to an attribute to display a short description at the bottom of the screen)


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_33.html0000444000265000001440000006334710737165231013655 A+ Reference: The Hmenu Display Class

The Hmenu Display Class

The hmenu and vmenu display classes are for representing nested slotfillers as cascade menus. When hmenu is used the top-level menu is laid out horizontally, whereas vmenu gives a vertical layout. All submenus are vertical in both cases. Menus cannot be edited.

A slotfiller consists of two parts, the symbolic indices and the values. A nested slotfiller is one whose values are also slotfillers. The values within the slotfiller values can also be slotfillers, and so on; slotfillers can be nested to any level. In terms of the menu display classes, the symbols of a slotfiller bound to either menu class correspond to the items in the top level of a menu. If a value is also a slotfiller, then its symbols correspond to a submenu, and so on.

A callback function on the slotfiller is required for menu actions; in the d position, only pd is given when the function is called. A callback occurs whenever a menu item is selected. Selecting an item does not cause a preset callback to fire.

See "The Vmenu Display Class" for details of the vertical menu.

Visual Representation
menus.rsf{
    s.rsf converts a recursive association list to a recursive slotfiller
       (`file;(
                  `new;       newfn;
                  `open;      openfn;
                  `close;     closefn;
                  `save;(
                              `save;      savefn;
                              `save_as;   save_asfn));
       `edit;(
                  `undo;      undofn;
                  `cut;       cutfn;
                  `copy;      copyfn;
                  `paste;     pastefn);
       `format;(
                  `font;(
                              `kaplgallant;;
                              `courier;);
                  `size;      sizelist;
                  `style;     stylelist)
  )
      }

hmenu: Horizontal Cascade Menu:

show `menu is `hmenu
 

  vmenu: Vertical Cascade Menu:

show `menu is `vmenu
 

 
 

Attributes
See the "Display Attributes" chapter for details concerning all the attributes that apply to objects in the hmenu display class, as well as lists of colors and fonts. The keys in the Table of All Display Attributes that pertain to this class are hM, ALL, CNFT, NFT, and TOP.

The attributes that are meaningful for the hmenu display class (other than the print... attributes) are:

acceptfocus
active
ancestors
arrowdown
arrowkeys
arrowleft
arrowlist
arrowright
arrowup
at
atsector
b
bg
bound
class
clear
deiconized
doc
downto
dynamic
eval
evaluate
exit
extent
f1-f12
fg
fkeys
focus
followers
followertree
font
foot
freeze
fullscreen
h
H
has
head
hide
hl
hlthickness
icon
iconic
iconized
icontitle
incurrentworkspace
is
l
leader
leftto
literal
lower
mapped
mnemonics
naturalsize
notify
outofcurrentworkspace
parent
pin
preset
primary
r
raise
realize
refresh
request
resize
resizeable
rightto
script
sensitive
set
settings
script
shadowthickness
shell
shelltitle
show
state
stateself
syncshow
t
tabfrom
tablist
tabto
titlejustify
upto
vcol
vcols
verify
vrow
vrows
w
W
ws
x
X
xs
y
Y
ys
yx
YX
yxs
(Point the mouse cursor to an attribute to display a short description at the bottom of the screen)


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_34.html0000444000265000001440000007137110737165231013652 A+ Reference: The Hpane Display Class

The Hpane Display Class

The hpane and vpane display classes are special layout classes that have movable dividers, or sashes, between the layout children. The user can control the proportion of the layout that each child occupies simply by moving the dividers. Various layout-constraint attributes, such as position and build, are disregarded. The children of an hpane layout should be arranged horizontally, and will have vertical dividers between them.

To move a divider, simply place the mouse pointer on it, press and hold the left mouse button, and then slide the divider left or right. A small button is provided on the bottom of each divider as a convenient place to locate the pointer.

The dividers of an hpane layout always extend from the top to the bottom of the layout, so care must be taken when using hpane layouts with more than one row. For example, in an hpane layout of the form (`a`b;`c), the divider between objects a and b will cut through object c. If several objects line up on a divider boundary, then movement of the divider controls the display sizes of these objects. If all the objects line up on divider boundaries, then movement of the dividers controls the display sizes of entire columns of objects.

There is no direct way for a program to determine where a user has positioned a divider in an hpane layout. Sometimes there are indirect ways to approximate the position, such as checking the values of the rows and cols attributes of a matrix to determine how many rows and columns are currently shown.

Compare HPane with "The Vpane Display Class" for a visual representation of a similar object.

Visual Representation

m10 10
`m has (`class;`matrix;  `title;"Matrix Title";
        `label;("Labels";
                (<"Row"),10;
                (<"Col"),10));
a20
`a has (`class;`array;  `title;("Array";"Title"));
h1 2`m`a
`h has (`class;`hpane;  `title;"HPane Title";
        `shelltitle;"Shell Title"; `show;1);

Attributes
See the "Display Attributes" chapter for details concerning all the attributes that apply to objects in the hpane display class, as well as lists of colors and fonts. The keys in the Table of All Display Attributes that pertain to this class are hP, ALL, CNFT, CNT, NFT, and TOP.

The attributes that are meaningful for the hpane display class (other than the print... attributes) are:

active
ancestors
arrowdown
arrowkeys
arrowleft
arrowlist
arrowright
arrowup
at
atsector
b
be
bg
bound
C
children
class
clear
constraints
deiconized
descendents
doc
downto
dynamic
eval
evaluate
exit
extent
extents
f1-f12
familytree
fg
font
fkeys
focus
followers
followertree
foot
freeze
fullscreen
h
H
has
head
hide
hl
hlthickness
icon
iconic
iconized
icontitle
incurrentworkspace
is
l
leader
leftto
literal
lockposition
locksize
lower
mapped
naturalsize
newshow
notify
outofcurrentworkspace
parent
pin
preset
primary
r
R
raise
realize
recursively
refresh
reparent
request
reshow
resize
resizeable
rightto
script
sensitive
set
settings
shadowthickness
shell
shelltitle
show
state
stateself
structure
syncshow
t
tabfrom
tablist
tabto
title
titlefg
titlefont
titlejustify
upto
vcol
vcols
vcolspace
verify
vrow
vrows
vrowspace
w
W
ws
x
X
xs
y
Y
ys
yx
YX
yxs
(Point the mouse cursor to an attribute to display a short description at the bottom of the screen)


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_34HS.html0000444000265000001440000007760410737165232014113 A+ Reference: The Hscale Display Class

The Hscale Display Class

The hscale class is like the hgauge class except for minor differences in appearance - principally that the slider is fixed in length and its middle points to the object's value - and one major difference: a user can set the value interactively. See the description of the hgauge class and the figure there illustrating all four slider classes.

A user can change the setting of an hscale object (and of course its underlying variable) by editing the value label or moving the slider in several ways. The pageinc attribute, whose default setting is 10, determines the amount of change when Page Up or Page Down is pressed, and inc, whose default setting is 1, the amount of change when an arrow key is pressed. Four attributes control editing behavior and appearance: edit, editbg, editfg, and editspace; currently, the default values of editbg and editfg are both black.

See "Hscale and Vscale Objects", in "User Interactions with Displays".

Attributes

See the "Display Attributes" chapter for details concerning all the attributes that apply to objects in the hscale display class, as well as lists of colors and fonts. The keys in the Table of All Display Attributes that pertain to this class are hS, ALL, CNFT, GS, NFT, and TOP.

The attributes that are meaningful for the hscale display class (other than the print... attributes) are:


active
ancestors
arrowdown
arrowkeys
arrowleft
arrowlist
arrowright
arrowup
at
atsector
b
bg
bound
class
clear
deiconized
doc
downto
dynamic
edit
editbg
editfg
editspace
eval
evaluate
execute
exit
extent
f1-f12
fg
fkeys
focus
followers
followertree
font
foot
freeze
fullscreen
H
h
has
head
hide
hl
hlthickness
icon
iconic
iconized
icontitle
in
inc
incurrentworkspace
is
l
labelfg
labelfont
labelinc
labeljustify
labelout1
leader
leftto
literal
lower
majorticksize
mapped
max
maxtitle
maxtitlefg
maxtitlefont
maxtitlejustify
min
minortickcount
minorticksize
mintitle
mintitlefg
mintitlefont
mintitlejustify
naturalsize
notify
out1
outofcurrentworkspace
pageinc
parent
pin
preset
primary
r
raise
realize
refresh
request
resize
resizeable
rightto
script
sensitive
set
settings
shadowthickness
shell
shelltitle
show
sliderbg
sliderheight
sliderwidth
state
stateself
subtitle
subtitlefg
subtitlefont
subtitlejustify
syncshow
t
tabfrom
tablist
tabto
title
titlefg
titlefont
titlejustify
upto
valuefg
valuefont
valuejustify
vcol
vcols
verify
vrow
vrows
W
w
ws
X
x
xs
Y
y
ys
YX
yx
yxs
(Point the mouse cursor to an attribute to display a short description at the bottom of the screen)

1. Note that labelout is used to format the scale labels and out to format the value label.


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_35.html0000444000265000001440000005647610737165232013665 A+ Reference: The Label Display Class

The Label Display Class

The label class is for displaying text that is in either of the following forms:

  • a simple character scalar, vector, or matrix;
  • a nested scalar or vector whose items are simple character scalars or vectors.
Labels cannot be edited. Unlike views, labels are completely displayed (up to some reasonable limit of the screen capacity) and never have scrollbars.
Visual Representation

     a('The last entry created';
        'out of bounds';
        'results.')
     `a is `label
     `a has (`fg`shelltitle;(`black`red;'a'))
     show `a

Attributes

See the "Display Attributes" chapter for details concerning all the attributes that apply to objects in the label display class, as well as lists of colors and fonts. The keys in the Table of All Display Attributes that pertain to this class are B, ALL, CNFT, NFT, and TOP.

The attributes that are meaningful for the label display class (other than the print... attributes) are:

active
ancestors
arrowdown
arrowkeys
arrowleft
arrowlist
arrowright
arrowup
at
atsector
b
bg
bound
class
clear
deiconized
doc
downto
dynamic
eval
evaluate
exit
extent
f1-f12
fg
fkeys
focus
followers
followertree
font
foot
freeze
fullscreen
h
H
has
head
hide
hl
hlthickness
icon
iconic
iconized
icontitle
incurrentworkspace
is
justify
l
leader
leftto
literal
lower
mapped
margin
naturalsize
notify
outofcurrentworkspace
parent
pin
preset
primary
r
raise
realize
refresh
request
resize
resizeable
rightto
script
sensitive
set
settings
shadowthickness
shell
shelltitle
show
state
stateself
syncshow
t
tabfrom
tablist
tabto
titlejustify
upto
vcol
vcols
verify
vrow
vrows
w
W
ws
x
X
xs
y
Y
ys
yx
YX
yxs
(Point the mouse cursor to an attribute to display a short description at the bottom of the screen)


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_36.html0000444000265000001440000011141510737165233013650 A+ Reference: The Layout Display Class

The Layout Display Class


A layout is a container whose children can be of any classes. The arrangement of the children in a variable x to be bound to this class usually determines the geometry of the display. A+ arranges the display, however, when the variable is a vector. If the value is a boxed vector of vectors, then each item of the value composes a row in the layout. For example, if x is a layout defined by (`a `b;`c), then the display of x as a layout shows the displays of a and b side by side, and the display of c below these two. If x is a matrix and all its elements are distinct, then the display of the child x[i;j] occupies the (i;j)th position in the display of the layout. If there are duplicates in x, then they must occupy contiguous positions in a subrectangle, in which case the display of the child fills all these "positions" in the layout. The (i;j)th position can be left vacant by assigning x[i;j]` (the empty symbol). The arrangement of a layout can also be specified by setting the at attribute on each of its children. Cf. "Layouts, Geometry, Constraints".

A layout can be built from objects already displayed on the screen, and the relative arrangement of those objects on the screen can be maintained in the layout. To do this, set the build attribute or the s-context variable s.AUTOBUILD to 1 - its default is 0 - before creating the layout. (If the attribute is 0 the layout is still built, but the children are arranged in the order implied in the specification of the layout, and thus perhaps more compactly.) Then form the layout variable, as a simple vector of symbols naming the objects that are to go in the layout; any objects that are named but not currently displayed will be put in a pile in the top left corner of the layout - i.e., the default position within the layout is 0, 0. Finally, show the layout variable.

The manner in which a child behaves when a layout is resized depends in part on its display class. A child of class button, scalar, label, slot, check, or radio is called sticky, while all others are called nonsticky. If a layout has at least one row with only nonsticky children, then any row containing sticky children retains its vertical size when the layout is resized. See the resize attribute for other aspects of resizing layouts.

When a child is placed in a layout, the context of its name is assumed to be that of the layout. There is no need to qualify the child's name unless its context differs from the layout's.

Modifying a Layout

If the newshow attribute is 0 (the default), objects appended to an existing layout do not automatically appear; each must be shown with the function show or its mapped or show attribute must be set to 1 or hide to 0.
Visual Representation
A line does not appear between the title area and the rest of the layout. Instead, the frame or outline is brought up higher, into the title area, and the title is set into it. Moreover, the title is left justified rather than centered. Note the change for scalar display also.
     a10
     b'An object in a layout'; `b is `label
     c(10).*3
     l(`a`b;`c)
     `l is `layout
     `l has (`shelltitle;'a')
     show `l

 

Attributes Specific to Layouts

Here "layouts" includes five display classes: layout, hpane, and vpane, and, except for the R and C attributes, hgrid and vgrid.

   at

The at attribute is a four-element integer vector representing the position and extent of an object in a layout:

(virtual row, virtual column, number of virtual rows, number of virtual columns)

Conceptually, a layout can be placed over an imaginary grid so that the border of each object in the layout lies on grid lines. It is then possible to describe the position and size of each object by the row index and column index of the grid block containing the upper left corner of the object, and the number of grid rows and columns that the object overlaps. If the grid is the minimal one, i.e., the one with the fewest possible grid lines, then these four numbers are the value of this attribute. The grid intervals need not be equal in either direction.

The origin for the grid coordinates is the upper left corner of the layout. Note that the four elements of an at attribute value can be set individually using the attributes vrow, vcol, vrows, and vcols.

For example, the arrangement shown in the figures could be obtained by:

     l`a`b`c
     `a has (`at;0 0 1 1); `b has (`at;0 1 1 1);
     `c has (`at;1 0 1 2)

   resize and h, H, t, b, l, r, w, and W

The resize attribute controls the detailed placement of objects in a layout and their behavior when it is resized. The objects in a layout do not necessarily fill in all the background area. For example, the label in a layout consisting of a label next to an array is vertically centered in an area the same height as the array. When an object does not fill its allotted background area it can be positioned in that area by setting this attribute: 't' for top; 'b' for bottom; 'l' for left; and 'r' for right.

The size of an object in a layout, which is normally affected by other objects in its same row and column, or by resizing the layout, can also be controlled: 'H' and 'W' mean do not resize the object's height and width, respectively. If the newly allotted space for the object within the layout is larger than the object, its position within that space is controlled by the justify attribute. Finally, even stronger resize restrictions are available: 'h' and 'w' mean do not resize the entire row and column in which the object is positioned. This attribute can also be set to a character vector holding more than one of the above values.

Each setting takes effect in addition to existing ones unless there is a period in the setting. All settings are removed by setting the resize attribute to the empty character vector or the character period: '' or '.'. The default settings are restored by setting it to the Null.

The cumulative settings of the resize attribute can also be accomplished with the specific attributes for each one:

`layout has (`resize;'t') is equivalent to `layout has (`t;1)

`layout has (`resize;'l') is equivalent to `layout has (`l;1)

Justifications can be removed by specifying the values of these attributes to be 0.

   R and C

The virtual rows or columns (see the description of the at attribute above) can be constrained to be all the same size by setting the R or C attribute to 1, respectively.

   position

Several objects can occupy a layout in such a way that only one is visible at a time, taking up the entire area of the layout, and any other one can be brought into view simply by setting the value of its raise attribute to 1. Since the objects within the layout can themselves be layouts, or other complex objects, this provides a simple, efficient, and general way of displaying multiple objects when only one must be visible at a time.

For example, here is the procedure to follow:

     lo()                   Initialize the layout to the Null.
     `lo is `layout
     `lo has (`position;0)   This establishes the
                             overlapping behavior.
     l0`a`b`c`d`e`f`g       Now specify the layout using
                             the simple vector form; other
                             objects can be appended later.
     show `lo
     `d has (`raise;1)       The object d will now be
                             brought into view.
List of All Attributes for the Layout Display Class

See the "Display Attributes" chapter for details concerning all the attributes that apply to objects in the layout display class, as well as lists of colors and fonts. The keys in the Table of All Display Attributes that pertain to this class are L, ALL, CNFT, CNT, NFT, and TOP.

The attributes that are meaningful for the layout display class (other than the print... attributes) are:

active
ancestors
arrowdown
arrowkeys
arrowleft
arrowlist
arrowright
arrowup
at
atsector
b
be
bg
bound
build
C
children
class
clear
constraints
deiconized
descendents
doc
downto
dynamic
eval
evaluate
exit
extent
extents
f1-f12
familytree
fg
fkeys
focus
followers
followertree
font
foot
freeze
fullscreen
h
H
has
head
hide
hl
hlthickness
icon
iconic
iconized
icontitle
incurrentworkspace
is
l
leader
leftto
literal
lockposition
locksize
lower
mapped
naturalsize
newshow
notify
outofcurrentworkspace
parent
pin
position
preset
primary
r
R
raise
realize
recursively
refresh
reparent
request
reshow
resize
resizeable
rightto
script
sensitive
set
settings
shadowthickness
shell
shelltitle
show
state
stateself
structure
syncshow
t
tabfrom
tablist
tabto
title
titlefg
titlefont
titlejustify
upto
vcol
vcols
vcolspace
verify
vrow
vrows
vrowspace
w
W
ws
x
X
xs
y
Y
ys
yx
YX
yxs
(Point the mouse cursor to an attribute to display a short description at the bottom of the screen)


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_37.html0000444000265000001440000011446710737165233013663 A+ Reference: The Matrix Display Class

The Matrix Display Class

Any A+ matrix that is not a simple character matrix can be displayed as an object of class matrix. A display of a variable in this class has five parts: a title area, three label areas, and a value area. The label area above the value area is called the column label area, the one to the left is called the row label area, and the one in the upper left corner is called the corner label area, and the title area is above them all. The value area appears below the title and column label areas, and consists of delineated cells.

If a matrix requires more than just a few cells, then by default, only a submatrix is presented on the screen, and the value area is provided with scrollbars. The particular subarray that appears in the value area is controlled in two ways: by the scrollbars, manipulated by users, and by the attributes firstrow, firstcol, rows, and cols, set by programmers.

The contents of each cell in the value area can be edited.

Visual Representation
     m?10 10100
     labs(//m;/@1 m;/ m)   Corner label; row labels; column labels.
     `m has (`class;`matrix; `label;labs)
     `m has (`selectionmode;`multiple)     Allows multiple rows to be selected simultaneously
     `m has (`rowindex;1 3)
     `m has (`index;2 5)
     show `m

To select a single row manually, simply click on the row desired. To select multiple rows manually, first enable multiple selections by entering:

     `m has (`selectionmode;`multiple)
Then, click on the first of the rows that you want to select. If the other rows are contiguous with the row that you selected, you can simply drag the mouse over the other rows while the left button remains depressed. To select non-contiguous rows, click on the first of the rows that you want to select, and then hold the Ctrl key down while you click on additional rows.

To see which rows have been selected:

     `index of `m
<  2 5

Attributes
See the "Display Attributes" chapter for details concerning all the attributes that apply to objects in the matrix display class, as well as lists of colors and fonts. The keys in the Table of All Display Attributes that pertain to this class are M, ALL, CNFT, NFT, and TOP.

The attributes that are meaningful for the matrix display class (other than the print... attributes) are:

active
ancestors
arrowdown
arrowkeys
arrowleft
arrowlist
arrowright
arrowup
at
atsector
b
bg
blank
bound
class
clear
col
colindex
colindexbg
collabelrows
colors
cols
colsep
colspace
copy
cornerindex
cornerindexbg
cycle
deiconized
delete
doc
done
downto
dynamic
edit
editbg
editfg
editspace
eval
evaluate
execute
extent
exit
f1-f12
fg
firstcol
firstrow
fkeys
focus
followers
followertree
font
foot
freeze
fullscreen
h
H
has
head
hide
hl
hlthickness
hscrollsize
hscrollwith
icon
iconic
iconized
icontitle
in
incurrentworkspace
index
insertabove
insertbelow
is
l
label
labelfg
labelfont
leader
leftto
literal
lower
mapped
na
naturalsize
notify
out
outofcurrentworkspace
parent
pin
preset
primary
protect
protected
r
raise
realize
refer
refresh
request
resize
resizeable
respace
rightto
row
rowbg
rowindex
rowindexbg
rows
rowsep
script
scrollbg
scrollsize
select
selectbg
selectcol
selectcorner
selected
selectionmode
selectrow
sensitive
set
setcol
setfirstcol
setfirstrow
setrow
settings
shadowthickness
shell
shelltitle
show
size
space
stars
state
stateself
syncshow
t
tabfrom
tablist
tabto
title
titlefg
titlefont
titlejustify
upto
vcol
vcols
verify
vrow
vrows
vscrollsize
vscrollwith
w
W
ws
x
X
xs
y
Y
ys
yx
YX
yxs
(Point the mouse cursor to an attribute to display a short description at the bottom of the screen)


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_37NB.html0000444000265000001440000010043310737165233014067 A+ Reference: The Notebook Display Class

The Notebook Display Class

The notebook is a special layout class for displaying several pages of objects in a compact and easily accessible manner. It has somewhat the appearance of a notebook with tabs, showing one page fully and just tabs and edges for other pages. Each child has its own page, and can, of course, be of any class, including a layout or notebook. The notebook does not honor any constraints on a child, configuring it for the available space.

The user can choose an object to be shown by clicking on the tab of its page, which causes the currentpage attribute to be set to the name of the object and thus that page to be shown. This causes a `pagechangecb callback.

The tabs are actually arranged in a line (rather than apparently attached to the pages), and as many are shown as will fit in the window. When not all are shown, scrolling arrows are provided. The tab of the page being shown is absent if it is outside the range of tabs being shown. Otherwise, it is shown attached to its page and aligned with the position in which it would appear if its page were not being shown.

The backpages attribute controls the apparent thickness of the notebook, i.e., the number of page edges depicted. It is not related to either the number of pages in the notebook or the number of tabs that are shown.

The backpagefg and backpagebg attributes control the colors of the tabs and page edges, but not of the titles on the tabs, which obey the fg attribute (and use the various title... attributes for their text).

Notebooks can be shown in horizontal or vertical orientation, that is, with binding left and tabs right or binding top and tabs bottom. The spiral binding can be shown or not, and its width (diameter) can be specified. The current page (with its tab, if shown) is outlined by a frame, half highlighted and half in shadow, which, especially when thickened, gives it a strange raised and beveled appearance. The background color (framebg) and thickness (framethickness) of that frame can be specified; 0 thickness makes it vanish. There are margins around an object on its page. The top and bottom margins are controlled by the marginheight attribute, the left and right by marginwidth.

Visual Representation
  `page1 is `view    page180 40" view "
  `page2 is `scalar  page2"scalar"
  page310 10
  `page3 has (`class;`array; `title;'Page 3')
  nb`page1 `page2 `page3
  `nb is `notebook
  `nb has (`title;'Sample Notebook';
           `shelltitle;'Window with Notebook')
  `page1 has (`pagetitle;"1. View")    Insert titles for the tabs,
  `page2 has (`pagetitle;"2. Scalar")  after making the objects
  `page3 has (`pagetitle;"3. Array")   the children of notebook.
   To make the tabs readable, lighten their background.
  `nb has `backpagebg `deepskyblue
   Place the third page at the front.
  `nb has (`currentpage;`page3)
  `nb has (`bg;`white)
  `nb has (`selectedpagebg;`yellow)
  show `nb

Attributes
See the "Display Attributes" chapter for details concerning all the attributes that apply to objects in the notebook display class, as well as lists of colors and fonts. The keys in the Table of All Display Attributes that pertain to this class are O, ALL, CNFT, CNT, NFT, and TOP.

The attributes that are meaningful for the notebook display class (other than the print... attributes) are:

active
ancestors
arrowdown
arrowkeys
arrowleft
arrowlist
arrowright
arrowup
at
atsector
b
backpagebg
backpagefg
backpages
backpagethickness
be
bg
bindingwidth
blank
borderheight
borderwidth
bound
children
class
clear
copy
currentpage
deiconized
descendents
doc
downto
dynamic
eval
evaluate
exit
extent
extents
f1-f12
familytree
fg
fkeys
focus
followers
followertree
font
foot
framebg
framethickness
freeze
fullscreen
H
h
has
head
hide
hl
hlthickness
icon
iconic
iconized
icontitle
incurrentworkspace
is
l
leader
leftto
literal
locksize
lower
mapped
marginheight
marginwidth
naturalsize
newshow
notify
orientation
outofcurrentworkspace
pagechangecb
parent
pin
preset
primary
r
raise
realize
recursively
refresh
reparent
request
reshow
resize
resizeable
rightto
script
selectedpagebg
selectedpagefg
sensitive
set
settings
shadowthickness
shell
shelltitle
show
showbinding
showpopup
showtabs
state
stateself
syncshow
t
tabfrom
tablist
tabto
title
titlefg
titlefont
titlejustify
upto
vcol
vcols
verify
vrow
vrows
W
w
ws
X
x
xs
Y
y
ys
YX
yx
yxs
(Point the mouse cursor to an attribute to display a short description at the bottom of the screen)


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_38.html0000444000265000001440000010007110737165234013647 A+ Reference: The Page Display Class

The Page Display Class


The page display class is designed for displaying page-based information from data services. Objects displayed in this format are character matrices. Normally the matrix is completely displayed; there are no scrollbars, and the firstrow, firstcol, cols, and rows attributes do not apply to page objects. This display class is not designed for large objects that require scrollbars, even though scrolling can be provided by putting a page object inside a window (see "The Window Display Class").

Page objects cannot be edited directly. However, keyboard entry can be captured with the key and keysym attributes, and therefore entry and edit modes can be programmed. For best behavior, the font in which the page is set should be fixed width (monospaced).

Boxes can be drawn at the screen. See "User Interactions with Displays", and specifically "Page Objects".

Visual Representation
     r
    The Page Display Class

  This text will illustrate
  page display class.

     r
 5 29
     `r is `page
     `r has (`underline;5r[,0]' ')
     `r has (`box;1 42 2 2 25)
     `r has (`fg;`green)
     show `r

Colors

The fg and bg attributes together determine the color of any box the user draws. The foreground and background colors are not set directly, but rather, in the simplest case, by setting the colormap attribute to be a 1 by 2 matrix whose elements are those colors (and retaining the default setting of the color attribute, Null).

The foreground and background colors can be set separately for each cell. If you want the cells to be shown in k distinct pairs of colors, set the colormap attribute to a k by 2 matrix whose rows are the pairs (in symbol form), and set the color attribute to an array of row indices of colormap. A nonfunctional setting of color is treated as if it were reshaped to the shape of the underlying character matrix, and each element determines the colors of the corresponding cell. A functional setting must always be a value with the same shape as the underlying character matrix.

For example, to have stripes, alternating rows of black on grey, blue on peru (brown), and red on tan:

c(Pg)[1]     Row length
Pg .has(`colormap;3 2`black`grey `blue`peru `red`tan;
        `color;   (c0),(c1),c2);

Page Updates

The cells of a page are redrawn when a change to the corresponding elements of the global variable occurs, and automatically reflect the current settings of the bold, color, and underline attributes for those cells. For any particular cell, whenever one of these attributes is a function, the effect of that attribute on the cell is not reflected until the corresponding element of the global variable is changed.

The blink attribute is somewhat different from the other functional attributes, bold, color, and underline. When it is a function, and when any change to the global variable occurs, the blink function is evaluated for the entire array, not just the part that was changed. Consequently, blinking may be turned on for characters that do not change value.

Key Press Events

The value of the keysym attribute is a nested pair of the form (k;s), where the integer k is the ASCII code of the character pressed, and s is a boolean vector of eight integers indicating which modifier keys were pressed when the key press event occurred. These are:

(Shift, Caps Lock, Control, mod1, mod2, mod3, mod4, mod5)

where mod1 is Meta and mod2 is NumLock, using the standard A+ profiles. mod3 through mod5 are unused.

There is no cursor shown for the page display class. There is a cursor attribute, which is set to the pointer position (row and column) whenever any mouse button is pressed while the pointer is on the page. The programmer can account for the usual cursor with the blink attribute. It is up to the programmer to move this "cursor" - i.e., select an appropriate character to blink - based on the key press and mouse button events.

Attributes
A nonfunctional setting of a functional attribute is treated as if it were reshaped to the shape of the underlying character matrix. A functional setting should always be a value with the same shape as the underlying character matrix.

See the "Display Attributes" chapter for details concerning all the attributes that apply to objects in the page display class, as well as lists of colors and fonts. The keys in the Table of All Display Attributes that pertain to this class are P, ALL, CNFT, NFT, and TOP.

The attributes that are meaningful for the page display class (other than the print... attributes) are:

active
ancestors
arrowdown
arrowkeys
arrowleft
arrowlist
arrowright
arrowup
at
atsector
b
bg
blink
blinkrate
bold
bound
box
boxcolor
class
clear
color
colormap
cursor
deiconized
doc
done
downto
dynamic
eval
evaluate
exit
extent
f1-f12
fg
fkeys
focus
followers
followertree
font
foot
freeze
fullscreen
h
H
has
head
hide
hl
hlthickness
icon
iconic
iconized
icontitle
incurrentworkspace
is
key
keysym
l
leader
leftto
line
linewidth
literal
lower
mapped
naturalsize
notify
outofcurrentworkspace
parent
pin
preset
primary
r
raise
rband
rbandbox
realize
refresh
request
resize
resizeable
rightto
script
sensitive
set
settings
shadowthickness
shell
shelltitle
show
state
stateself
syncshow
t
tabfrom
tablist
tabto
3down
3up
title
titlefg
titlefont
titlejustify
2down
2up
underline
upto
vcol
vcols
verify
vrow
vrows
w
W
ws
x
X
xs
y
Y
ys
yx
YX
yxs
(Point the mouse cursor to an attribute to display a short description at the bottom of the screen)


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_39.html0000444000265000001440000006573410737165234013670 A+ Reference: The Password Display Class

The Password Display Class

The password display class provides password protection to applications. The password representation has two parts, a title area on the left and a value area on the right. The underlying variable holds a user name. Text is entered in the value area and compared to the login password of that user. Kerberos authentication is supported.
Visual Representation
     pw'mahler'
     `pw is `password
     validate{s;c;v}:0`valid of c,v
     `pw has (`validate;validate)
     show `pw
The
figure shows this object as it initially appears and what it looks like as a password is being entered. Here, three characters have been entered, masked by asterisks (the value of the fill attribute), and the cursor is positioned to the right of the third asterisk. When the user completes entry, the function validate is called by the validate event; it displays 1 if the password for mahler has been entered, and 0 otherwise.

The initial state is shown at the left, and the appearance during input is shown at the right:

Attributes
See the "Display Attributes" chapter for details concerning all the attributes that apply to objects in the password display class, as well as lists of colors and fonts. The keys in the Table of All Display Attributes that pertain to this class are D, ALL, CNFT, NFT, and TOP.

The attributes that are meaningful for the password display class (other than the print... attributes) are:

active
ancestors
arrowbuttons
arrowdown
arrowkeys
arrowleft
arrowlist
arrowright
arrowup
at
atsector
b
bg
bound
class
clear
colors
cycle
decrement
deiconized
doc
downto
dynamic
edit
editbg
editfg
editspace
eval
evaluate
exit
extent
f1-f12
fill
fg
fkeys
focus
followers
followertree
font
foot
freeze
fullscreen
h
H
has
head
hide
hl
hlthickness
icon
iconic
iconized
icontitle
increment
incurrentworkspace
is
l
leader
leftto
lower
mapped
naturalsize
notify
outofcurrentworkspace
parent
pin
preset
primary
r
raise
realize
refer
refresh
request
resize
resizeable
rightto
script
sensitive
set
settings
shadowthickness
shell
shelltitle
show
state
stateself
syncshow
t
tabfrom
tablist
tabto
title
titlefg
titlefont
titlejustify
upto
valid
validate
vcol
vcols
verify
vrow
vrows
w
W
ws
x
X
xs
y
Y
ys
yx
YX
yxs
(Point the mouse cursor to an attribute to display a short description at the bottom of the screen)


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_4.html0000444000265000001440000007436410737165235013600 A+ Reference: The Structure of Data

The Structure of Data


In this chapter, the concepts of A+ data and the vocabulary used in describing them are discussed first. Then some A+ primitive functions for creating and indexing arrays and for inquiring into their characteristics are introduced. In these sections a number of examples of arrays are given. Finally, certain classes of arrays which are useful in the description of A+ functions are treated.

Concepts and Terminology

The data objects in A+ are arrays, which can be visualized as rectilinear arrangements of individual values. An individual value in an array is called an element. In the simplest arrays, the elements are either all numbers or all characters. A number or a character is itself an array, of the most elementary kind.

In the rectangular visualization of an array, each set of parallel edges defines a direction. Corresponding to each of these directions is an axis. The axes of an array are ordered. In the visualization of an array with three axes, the first axis is directed away from the viewer, the second is directed downward, and the third is directed to the right. A two-dimensional display of an array with three axes shows it as a series of planes arranged vertically, representing cross sections perpendicular to the first axis. The term leading axes is used for any set composed of all the axes from the first up to some particular axis, inclusive, and trailing axes for any set composed of all the axes from some particular axis through the last one.

An array with no axes, necessarily consisting of a single element, is called a scalar. All elements of arrays are scalars. Arrays with one axis are called vectors or lists, or, if character, strings. Arrays with two axes are called matrices, and sometimes tables. A set of elements lying along, i.e., parallel to, the first axis of a matrix is called a column, and a set along the second axis a row, just the same as in ordinary usage for tables. These terms are also used for elements along the two trailing axes of arrays with more than two axes.

   Dimension, Shape, and Rank

The length of an axis is the number of elements lying along any one of the edges defining that axis. This length is also called a dimension, so an array has as many dimensions as axes. (The word dimension is sometimes used as a synonym for the word axis, but not in this manual.) The vector composed of the lengths of all axes of an array, i.e., the vector of dimensions, is called the shape of the array. The ordering of the dimensions in the shape is the same as the ordering of the axes to which they correspond. The total number of elements in an array can be found by multiplying together all the elements of its shape.

An array can be empty, that is, it can have no elements at all. An empty array can have any number of axes except zero, which is disallowed, essentially because you can't have an empty container without a container. At least one of the dimensions of an empty array is equal to zero.

The rank of an array is the number of its axes, and therefore it is also the number of elements in its shape, i.e., the length of its shape. A scalar has an empty shape - its shape is a vector that has no elements - and its rank is 0. (Incidentally, when all the elements of an empty vector are multiplied together the result is 1, by convention, so that the usual formulation for the number of elements in an array a - namely, /a - works for scalars also.)

Every element of an array can be referenced by a set of coordinates called indices, to retrieve the value of the element or to give it a new value. There is one index, or coordinate, for each axis, and A+ defines its value to be an integer between zero and one less than the length of that axis, inclusive. The number of indices of an element in an array, then, equals the rank of the array.

Some computational languages use the word cell as a synonym for element, but A+ does not (except in connection with the displays created by s, the screen management system): cell is used in connection with the partitioning of an array, as defined by a set of leading axes. In practice, multidimensional arrays are commonly viewed as partitioned into collections of lower dimensional arrays. For example, a numeric matrix containing bond prices may be organized so that the rows are time series of prices for bonds, with one row for each bond of interest, while the columns are collections of prices at particular times. For some calculations the rows would be emphasized, while for others, emphasis would be on the columns. One view represents a partition of the matrix into a collection of row vectors, and the other into column vectors.

A+ emphasizes partitions where the lower dimensional arrays lie along a set of trailing axes. The lower dimensional arrays that comprise such a partition are called cells. The complementary set of leading axes is called the frame of the partition that holds the cells; the cells are said to be in their frame. In the case of the numeric matrix of bond prices, the row vectors are the cells of rank 1, and the first axis is their frame.

Every set of leading axes defines a partition into cells for which it is the frame. The set of all axes is a particular set of leading axes, and therefore defines a partition. Since there are no axes left for the cells, the cells must be the elements of the array; the A+ notion of cell, then, includes the more common one. At the other extreme, the array itself is a cell, i.e., a partition of itself into one subarray. In this case the cell takes all the axes and therefore the frame has no axes.

A cell consists of all those elements that have one particular set of indices for the leading axes that define the partition, and all possible indices for the trailing axes. The entire cell can be selected by specifying only the particular indices for the leading axes. Those leading axes are the frame of the partition, and therefore the frame is, loosely speaking, an array of cells that can be indexed by valid indices of them. A partition creates, then, a view of an array as a frame of cells. There is more about frames and cells, including several examples, later in this chapter. The "Dyadic Operators" chapter, and especially its "Rank Deriving Dyadic" section, has a further discussion of this subject, with examples.

One partition plays a special role in A+, the one defined by the first axis alone; the cells for this partition are called the items of an array. Every array can be regarded as a vector of items, and many A+ functions look at them in just that way. In such a context, a scalar is regarded as having a single item, namely itself.

   Type and Nesting

Another characteristic of arrays is type. In a simple array (definition later), all elements have the same type, but a nonsimple array can contain elements of several different types.

The most common simple arrays are numeric and character. Every element of a simple numeric array is a number, and every element of a simple character array is a character. Numeric arrays can be of either integer or floating-point type. These two types correspond to whole numbers and fractional (sometimes called decimal) numbers. A+ numeric primitive functions applied to integer arrays may automatically convert their arguments to floating point, like the Matrix Inverse function, or may attempt to produce an integer result, like Add and Subtract. If an overflow occurs during this attempt, the type of the result is changed to floating point.

The type of a simple array may also be symbol or function if it is nonempty, or null if it is empty. A symbol is a character string represented as a single scalar; it is denoted by a backquote followed by the string, as in `sym. A function expression, e.g., or +., and a function scalar, e.g., <{-}, both have type function.

While the elements of arrays are often just individual numbers and characters, an element of an array can be an encapsulated multielement array. That is, any array can be enclosed to become a scalar, and this scalar can be an element of another array. Also, any enclosed array, except a function scalar, can be disclosed, in order to work with its contents. (A function scalar is an enclosed function expression. The operator Apply, given a function scalar, produces the underlying function expression.) An array that has an enclosed element other than a function scalar is called nested, and one that has no enclosed elements except function scalars is called simple. A function scalar is simple, but an enclosed function scalar is nested. Any nested array is necessarily nonempty, being or containing a scalar.

A simple scalar symbol or function scalar can be an element of a nested array. In order for data whose type is character, integer, floating point, function, or null to appear in a nested array, however, it must first be enclosed. Clearly, any nonscalar array must be enclosed before being inserted as an element in another array, since the elements of all arrays must be scalars.

When an array other than a function expression is enclosed, the resulting array is a scalar of type box. The type of a nonscalar nested array is the type of its first item. Since a nested array can contain elements whose types are box, symbol, and function, its type can be any one of these three. The disclosure of a box scalar, of course, can yield an array of any type.

Any empty array is simple, because if it were nested, it would contain an enclosed array. An empty array that is reshaped or selected from a character, integer, or floating-point array is of the same type. Empty arrays of these three types can also be produced by explicit type transformations from empty arrays of these types. The type of an empty array of symbols, functions, nulls, or boxes is null. The empty vector whose type is null is called Null or the Null; it can be represented as ().

There is also a type called unknown, to guard against weird cases that might arise. It will not be mentioned further, except in the description of the Type function.

Creating Arrays

A+ provides direct ways to specify constant arrays. A list of numbers separated by blank spaces is one description of a simple constant numeric array. For example, the constant

10 2.3e-2 34.156

is a floating-point array with one axis, of length three. The element at index 0 is 10, at index 1 is .023, and at 2 is 34.156. The expression with e means take the number on the left and multiply it by ten to the power shown on the right. If you omit the blanks between numbers - a poor idea indeed, since it would make your code very difficult to read - , A+ will give you a numeric vector, but probably not the one you intended. If a number is being parsed and a character is examined that can't be part of the number, then a new number is started if the character could begin a number. For instance,

1e-3.5 40.358.62.7   is read by A+ as   0.001 0.5 40.358 0.62 0.7

Simple symbol vectors can be written similarly, and blanks are not needed. One of length five is

`sym1 `sym2 `sym3`sym4`sym5

It is also easy to describe simple constant character vectors. For example,

'axrTVw'

is a character array with one axis, of length six. The elements at indices 0, 1, 2, 3, 4, and 5 are, respectively, 'a', 'x', 'r', 'T', 'V', and 'w'.  The empty character vector can be written most easily as '' - just two quotation marks, with nothing between them.

A nested vector can be described conveniently by a strand, a parenthesized expression in which the vector's elements are separated by semicolons. Enclosure of each element is implied by strand notation. For example,

(`sym; +; 1 2 3 4; 1.7 3.14; 'example';)

is a nested vector of length six. The blanks after the semicolons are not required, but usually promote readability. All of its elements except the second are of type box; the second is a simple function scalar. The types (lengths) of its elements when each is disclosed are: symbol (a scalar), function (a scalar), integer (4), floating point (2), character (7), and null (0). The absence of an expression in any position of the strand implies a Null.

Arrays with more than one axis can be formed using the dyadic primitive function called Reshape and denoted by (rho). For example, the result of the expression

     2 3'axrTVw'  Enter this in an A+ session, and press Enter.
axr                This row and the next display the result.
TVw                Text following "" is a comment.
is an array with two axes - a matrix. The left argument of Reshape in this example is a vector, specifying the shape of the result. The index of an element in the matrix is a pair consisting of one index for axis 0, and one for axis 1. For instance, the element 'r' is indexed by the pair 0, 2.

The monadic primitive function called Interval and denoted by (iota) is somewhat like Reshape. It creates arrays of any specified shape whose elements are the integers 0, 1, ... . For example,

     17           Simple vectors are always displayed horizontally
 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
is an array with one axis. Note that this array has 17 elements, and the index of the i-th element is i for every i from 0 to 16.

The Interval primitive can also create arrays with more than one axis. For example:

     2 3 5        Enter this in an A+ session, and press Enter.
  0  1  2  3  4    These seven rows (one blank) show the result,
  5  6  7  8  9    which is equal to 2 3 5  235
 10 11 12 13 14    (which could be written 2 3 5235).
                   A blank line separates planes. If there were a fourth axis,
 15 16 17 18 19    two blank lines would separate subarrays corresponding to
 20 21 22 23 24    indices along the first axis, with single blank lines between
 25 26 27 28 29    subarrays corresponding to indices along the second axis.
The empty integer vector is most easily written 0 and the empty floating-point vector 00. (decimal point). In displays, all empty arrays occupy one (blank) line, except the Null, which occupies no display space at all.

The function Enclose, denoted by <, is used to enclose arrays; < is used also to indicate enclosure in displays:

     <2 5         Much like the previous example, but an enclosed scalar.
<  0 1 2 3 4       The   < is used to indicate enclosure.
   5 6 7 8 9       < is displayed only at the start of each enclosed array.
Strand notation can be combined with Enclose:
     (1 2 3;<1 2 3;'abc';+;`smbl;)  The last element is Null.
<  1 2 3           Strand encloses the simple vector.
< <  1 2 3         Strand encloses the enclosed vector.
<  abc             Enclosed character vector.
<  +               Enclosed function expression.
<  `smbl           Enclosed symbol.
<                  Enclosed Null.

Indexing Arrays

A+ provides primitive functions to access the elements of an array. One such function is denoted by the bracket pair [] and is called Bracket Indexing. For example, using arrays displayed in the previous section:
     'axrTVw'[4]
V
     'axrTVw'[5 0 1]
wax
     (`sym;+;1 2 3 4;1.7 3.14;'example';)[2]
<  1 2 3 4
     (2 3 5)[0;1;3]
 8
An omitted index implies all permitted indices for that axis, so one can easily obtain a row and a column:
     (2 3 5)[0;0;]   The first row.
 0 1 2 3 4
     (2 3 5)[0;;4]   The fifth column of the first plane of the array;
 4 9 14               vector result.
For a 3-dimensional array, an item is a matrix. In Bracket Indexing, a semicolon may be omitted when all the indices following it are omitted, so one can index an array as if it were a vector containing the array's items:
     (2 3 5)[1]      The second item: any element of it is
 15 16 17 18 19       (2 3 5)[1;j;k] for some j and k.
 20 21 22 23 24
 25 26 27 28 29
More generally, one can index an array of rank r as if it were an (r-n)-rank array (frame) of rank-n cells. Say one has a five-dimensional array; one can view it as a three-dimensional array of two-dimensional cells:
     ( 4 5 6 2 3)[0;0;0]  Any element of the first cell is
 0 1 2               ( 4 5 6 2 3)[0;0;0;j;k]for some j, k.
 3 4 5               The first three indices index the frame.
One more example demonstrates the power of working with items, frames, and cells. For this example, a small part of the capability of the primitive function Take () and the primitive operator Rank (@) must be explained. For positive n, the expression na produces the first n items of a. The derived function @1 applies Take to all cells of rank 1 in its right argument, i.e., to all rows, whose items are elements. Taking a certain number of elements in each row is equivalent to taking a certain number of columns. Thus the following expression takes three rows (items of a matrix) after taking five columns of a five by ten matrix:
     35@1 5 10     3(5(@1)(5 10)) is equivalent.
  0  1  2  3  4        ....
 10 11 12 13 14        Take 5 columns.
 20 21 22 23 24      Take 3 rows.

Inquiring about Arrays

   Shape and Rank

The primitive function denoted by the monadic (i.e., one-argument) form of the symbol (rho) is called Shape. It produces the shape vector of its array argument. For example, 2 3 is the vector 2 3, and 'axrTVw' is the one-element vector whose only element is 6.

The result of a, a double application of Shape, is a one-element vector whose value is the rank of a. In particular, the element of the one-element vector 36 or 'X' is 0; separately entered numbers and characters have no axes, and their rank is therefore 0; they are scalars.

   Type and Depth

The Type monadic primitive function () produces the type of its argument, as a scalar symbol. First, the six types of simple arrays.
     2 5
 `int
     2.71828 3.14159
 `float
     'axrTVw'
 `char
     `pp `rl
 `sym
     {+}             The parser requires the braces as a hint
 `func                that + is an argument.
     <{+}
 `func                A function scalar is also of type `func.
     ()
 `null
Next, the three types of nested arrays.
     <2 3 4
 `box                 The type of a nested array is the type of its first item.
     `rl,(;2.7 3.1)  The comma joins its two arguments
 `sym                 into a single vector.
     (+;)
 `func                A function scalar.
Last, the four types of empty arrays.
     ''
 `char
     0
 `int
     0 1210.1
 `float
     0 4(+;-;;)
 `null
The Depth monadic primitive function () produces the depth of nesting of its argument, as a scalar integer. The depth of a multi-item array is the greatest of the depths of its items. The depth of a function expression is -1, by convention, and the depth of a function scalar, which is an enclosed function expression, is 0.
     2 3 4                   Simple
 0
     <'abc def'               Result of Enclose
 1
     (2 3;+;`a`b`c)           Enclosure implied by strand
 1
     (<2 3;=;`a`b`c)          Strand with enclosed element
 2
     (1 2;(3 4;(5 6;);7);8)   Strand in strand in strand
 3
A shorter definition of a simple array is any array whose depth does not exceed 0. A nested array, which is any array that is not simple, can be defined similarly as one whose depth is at least 1.

   Pictorial Representation

To see a pictorial two-dimensional representation of data, use the "disp" (display) facility, available from /common/a/disp.+. After being loaded, it resides in the disp context. It is used as follows:
     $load disp
     disp.disp 2 3('ab';`abc`def;2 4; 1.1 2.2;;)
+3------------------------------+
2+2-+       +2-------+ +4------+|
||ab|       |`abc`def| 20 1 2 3||
|+"-+       +`-------+ |4 5 6 7||
|                      +i------+|
|+2-------+ +0         +0+      |
||1.1 2.2 | +         ||      |
|+f-------+            ++      |
+------------------------------+

Subtypes and Supertypes

   Slotfillers

A special form of nested array called a slotfiller is recognized by certain primitive functions and toolkits. A slotfiller is a two-element vector (sym;val). sym is a simple vector or scalar of distinct symbols. val has the same number of items as sym (recall that a scalar has one item). It can be either any nested scalar or any vector each of whose items either has a depth of at least 1 or is a function scalar that is the enclosure of a defined function. Thus primitive functions can appear in val only when they are enclosed at least twice, i.e., as enclosed function scalars. A slotfiller can be thought of as a dictionary of keys (with no repetitions) and values.

There is a way to test whether a variable or an expression is a slotfiller or not: _issf x is 1 if x is a slotfiller and 0 if it is not. Cf. the "Is a Slotfiller" section in the "System Functions" chapter.

Examples of slotfillers are:
   (`small `medium `large `super;(16;32;64;72))
   (`a;<97)
and
   (`g `l `w;(f;g;<{+}))
where f and g are user-defined functions, and + is enclosed by < and the strand; but not
   (`g `l `w;(+;-;))
since nonnested primitive functions are prohibited in slotfillers.

Recall that when A+ displays a nested array, it uses an Enclose symbol (<) to indicate the beginning of the display of each nested array. It indents subarrays appropriately to show their total depth of nesting. The first sample slotfiller is displayed as:

<  `small `medium `large `super
< <  16
  <  32
  <  64
  <  72
The Pick function can extract values from slotfillers:
   `medium(`small `medium `large `super;(16;32;64;72))
 32

   Restricted Whole Numbers

Many functions require as arguments whole numbers that are within the range of integer representation but do not insist that the type of these arguments be integer. They also accept floating-point numbers that are tolerably equal to integers (see "Comparison Tolerance") and numbers whose absolute value is less than 1e-13. I.e., they reject floating-point numbers that are significantly fractional or that are too large in magnitude to be represented as integer type. Furthermore, they accept empty arrays regardless of type. For convenience in this manual, the term restricted whole number is used for a member of the set consisting of the integers, these floating-point near-integers, and all empty arrays.

Since the functions that accept restricted whole number arguments use integers internally, floating-point values for these arguments involve a performance penalty, because of the implicit type conversion.

   General Types

Many A+ functions and operators take arguments of several types, sometimes with some limitation, and it is convenient to have a terminology dividing A+ data objects into three classes, as they do. In this manual, these classes are called general types; they are:

Because general types are used mostly to indicate inclusion in the domains of functions and most functions accept empty arrays of any type, all empty arrays are included in each general type. (Although acceptance of empty arrays can cause anomalies like a character result for Add, such results are unlikely in fact to be created; if they do arise, they will probably be accepted by any function to which they are presented. For efficiency, the (empty) result of a mathematical function for a Null is whatever is most convenient for the function: Null, integer, or floating point.)

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_40.html0000444000265000001440000006742510737165235013660 A+ Reference: The Radio Display Class

The Radio Display Class

The radio class is for radio buttons, which, like the check class, are represented by boolean valued slotfiller variables, but with the additional stipulation that one and only one of the values is 1. A button is marked "on" if the corresponding value is 1 and "off" if it is 0. When a button is "on" it has a sunken appearance and is the color specified by the fg attribute, and when "off" it has a raised appearance and is the color specified by the bg attribute. A click with the left mouse button on a radio button that is "off" turns the button "on" and causes the button that had been "on" to be turned "off"; the values of the A+ variables are changed accordingly, to 1 for "on" and 0 for "off". Therefore, if a callback function is defined for the underlying variable, it is called whenever a button is selected, with the path argument p being equal to the symbolic index of the selected button. Note that even though there are two value changes, a callback function associated with the underlying global variable of a radio button is called only once, and the path argument of the callback function refers to the value that changed from 0 to 1.

The underlying slotfiller variable can of course be changed by program, as long as its new values are boolean and exactly one of them is 1. Thus if rd is a radio and

     rd(`a`b`c`d;(1;0;0;0))
its setting can be changed by the statement
     (1rd)[0 2](0;1).
An aid is provided by s: if one value is set to 1 by a symbolic-pick assignment, then s sets any other value that is 1 to 0. Hence the change in setting just instanced could also be accomplished by the statement

     (`crd)1

with s providing the necessary (`ard)0 action.

The label areas cannot be edited.

The slot areas that appear in the display and their arrangement can be controlled by the setting of the geometry attribute; see "The Geometry Attribute", in "The Slot Display Class". All slot areas specified for display by this attribute are completely displayed; radio displays never have scrollbars.

Visual Representation
     rd(`one`two`three;(0;1;0))
     `rd is `radio
     `rd has (`shelltitle;'rd')
     show `rd

Attributes

See the "Display Attributes" chapter for details concerning all the attributes that apply to objects in the radio display class, as well as lists of colors and fonts. The keys in the Table of All Display Attributes that pertain to this class are I, ALL, CNFT, NFT, and TOP.

The attributes that are meaningful for the radio display class (other than the print... attributes) are:

acceptfocus
active
ancestors
arrowdown
arrowkeys
arrowleft
arrowlist
arrowright
arrowup
at
atsector
b
bg
bound
C
class
clear
deiconized
doc
downto
dynamic
eval
evaluate
exit
extent
f1-f12
fg
fkeys
focus
followers
followertree
font
foot
freeze
geometry
fullscreen
h
H
has
head
hide
hl
hlthickness
icon
iconic
iconized
icontitle
incurrentworkspace
is
l
label
labelfg
labelfont
leader
leftto
literal
lower
mapped
naturalsize
notify
outofcurrentworkspace
parent
pin
preset
primary
protect
protected
r
R
raise
realize
refresh
request
resize
resizeable
rightto
script
selected
sensitive
set
settings
shadowthickness
shell
shelltitle
show
state
stateself
syncshow
t
tabfrom
tablist
tabto
title
titlefg
titlefont
titlejustify
upto
vcol
vcols
verify
vrow
vrows
w
W
ws
x
X
xs
y
Y
ys
yx
YX
yxs
(Point the mouse cursor to an attribute to display a short description at the bottom of the screen)


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_40R.html0000444000265000001440000005271310737165236013775 A+ Reference: The Report Display Class

The Report Display Class

When the print attribute is specified for an object, the part of the object that is currently shown on the screen is reproduced in a PostScript (or Encapsulated PostScript) file. The report display class, on the other hand, allows a table that is too large for the screen or too large for the printer paper to be reproduced in a PostScript (or EPS) file, so that it can be printed in its entirety. It also allows breaks within the table, with computations such as subtotals; banners (such as "Internal Use Only"), headers, footers, boxes, frames, and other decorators; monitoring of the printing progress by program; and so on.

The value of a variable bound to the report class is the name of a table object, in symbol form. To produce a print file, specify the report attribute for the report object, as in the example below.

Although show accepts the name of a report object without complaint, it ignores the request: reports cannot be shown on the screen. Use Ghostview, Acrobat, or a similar program to preview report output.

Classes That Attributes Apply To
Some of the attributes that control the production of reports apply to the report class, some to tables, and some to table columns.
     To reports:
See the list at the end of this chapter.
     To tables:
breakfont
breakstyle
columncontrol
columnpagespan
columnspacing
computepagebreakcb
computesizecb
currentbreakcolumn
fixedreportcolumns
framelinewidth
frameoffset
framestyle
headingstyle
leading
newspapercolumn
outputstyle
pagebreakcb
reportfont
reportheadingfont
rowcontrol
rowpagespan
scalefontcb
style
     To tableFields:
bggrayscale
breakcriteriafunc
breakfont
breakleading
breakoffset
breakon
breakprocessfunc
breakprocesson
breakstyle
breaktext
computationmode
fggrayscale
formatbreakfunc
headingbggrayscale
headingfggrayscale
headingstyle
pagebreakon
reportfont
reportheadingfont
style
suppressduplicate
Visual Representation
Set up the table:
dept{(3<"A00"),(3<"C01"),(4<"D11"),
          (4<"D21"),3<"D31"};
names("Haas";"Lucchesi";"Thompson";"Kwan";"Nichols";
       "Quintana";"Adams";"Stern";"Walker";"Yoshimura";
       "Henderson";"Jefferson";"Marino";"Pulaski";
       "Setright";"Smith";"Turner")
amt{52750 38170 41250 40175 35420 33800,
     30280 36250 20450 28680 35750 222180,
     33760 36170 19100 17750 20120};
`t is `table  t`dept`names`amt;
outFunc{s;d;i;p;c;v}:{0d}
`dept has (`title;"Department"; `out;outFunc);
`names has (`title;"Name"; `out;outFunc; `space;9);
`amt has (`title;"Salary");
show `t
Set up the report:
`rep is `report  rep`t;
func{s;d;i;p;c;v}:{(>dept[0i])," Total"}
`dept has (`style;`boxl`boxr`boxt`boxb; `breakon;1;
           `breakstyle;`center`box;
           `breakprocessfunc;(func;);
           `suppressduplicate;1);
`names has (`style;`boxl`boxr`boxt`boxb);
`amt has (`style;`boxl`boxr`boxt`boxb`right;
          `breakprocesson;1; `computationmode; `sum);
`rep has (`margins;1.5; `framestyle;`box;
          `framelinewidth;5; `orientation;`portrait;
          `pagenumbering;0; `file;"simpleReport.ps";
          `header;(`text;
                    ("HEADER 1";"Header 2";"Header 3");
   	        `fggrayscale;0.25 0.5 0.75;
   	        `row;0 0 1; `column;0 2 1;
   	        `justify;`left`right`center;
                   `style;(`outline;;`outline);
                   `leading;10;
   	        `font;
                      ("Times-Roman-24";"Helvetica-24";
                       "NewCenturySchlbk-Bold-36"));
          `footer;(`text;("Footer 1";"Footer 2");
                   `justify;`right;);
          `banner;(`text;
                    ("For Internal Distribution Only");
   	           `mode;`diagonal;
                   `font;"Times-Roman-72";
                   `xorigin;0; `yorigin;0;
                   `fggrayscale;0.95;
                   `justify;`center));
Print it to file:
`rep has `report;
The result as seen in Ghostview is shown in the figure.

 

A Sample Report, As Seen Through Ghostview:


Attributes
See the "Display Attributes" chapter for details concerning all the attributes that apply to objects in the report display class, as well as lists of colors and fonts. The key in the Table of All Display Attributes that pertains to this class is Rp.

The attributes that are meaningful for the report display class are:

banner
bottommargin
cancel
computepagebreakcb
computesizecb
delimiter
disclaimer
disclaimerbottommargin
disclaimerfile
disclaimerleftmargin
disclaimerrightmargin
disclaimerrulewidth
disclaimertopmargin
disclaimerorientation
filename
footer
footeroffset
framelinewidth
frameoffset
framestyle
header
headeroffset
leftmargin
margins
orientation
outputmode
pagebreakcb
pagecontrol
pagecount
pagecounttotal
pagenumbering
pagenumbers
pagenumbertext
pagesize
print
rightmargin
scalefont
scalefontcb
state
stateself
topmargin
uniformscaling (Point the mouse cursor to an attribute to display a short description at the bottom of the screen)


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_41.html0000444000265000001440000007172310737165236013656 A+ Reference: The Scalar Display Class

The Scalar Display Class

Any A+ global variable can be displayed as an object of class scalar. The representation has two parts side-by-side: a title area on the left and a value area on the right. The value area contains an A+ expression that represents the value of the variable, in the sense that the evaluation of the expression is identical to the value of the variable.1

The A+ expression in the value area can be edited like text.

The title area contains the name of the global variable. The width of the title area is always the minimum required to display its text. In particular, all the additional size goes to the value area when the display is resized to be larger. The title can be specified by the title attribute. No title area appears when this attribute is specified to be the empty vector.

The title area cannot be edited.

Visual Representation
     a(3 4;'abcdef'; 5.3 1.4 2.7 0.863)
     `a is `scalar
     `a has (`shelltitle;'a')
     `a has (`fg;'red')
     `a has (`space`stars;(29;0))
     show `a
A Scalar Display:

Attributes

See the "Display Attributes" chapter for details concerning all the attributes that apply to objects in the scalar display class, as well as lists of colors and fonts. The keys in the Table of All Display Attributes that pertain to this class are Q, ALL, CNFT, NFT, and TOP.

The attributes that are meaningful for the scalar display class (other than the print... attributes) are:

active
ancestors
arrowbuttons
arrowdown
arrowkeys
arrowleft
arrowlist
arrowright
arrowup
at
atsector
b
bg
bound
class
clear
colors
cycle
decrement
deiconized
doc
done
downto
dynamic
edit
editbg
editfg
editspace
eval
evaluate
execute
exit
extent
f1-f12
fg
fkeys
focus
followers
followertree
font
foot
freeze
fullscreen
h
H
has
head
hide
hl
hlthickness
icon
iconic
iconized
icontitle
in
increment
incurrentworkspace
is
l
leader
leftto
literal
lower
mapped
naturalsize
notify
out
outofcurrentworkspace
parent
pin
preset
primary
protect
protected
r
raise
realize
refer
refresh
request
resize
resizeable
respace
rightto
script
sensitive
set
settings
shadowthickness
shell
shelltitle
show
space
stars
state
stateself
syncshow
t
tabfrom
tablist
tabto
title
titlefg
titlefont
titlejustify
upto
vcol
vcols
verify
vrow
vrows
w
W
ws
x
X
xs
y
Y
ys
yx
YX
yxs
(Point the mouse cursor to an attribute to display a short description at the bottom of the screen)


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_42.html0000444000265000001440000010631010737165236013646 A+ Reference: The Slot Display Class

The Slot Display Class


The slot class is for the display of any slotfiller variables. The display consists of a title area above a collection of slot areas, one for each symbolic index. Each slot area has two areas side-by-side. The one on the left is called the label area and, by default, contains the symbolic index of the slot. The one on the right is a value area for the corresponding value. The display of each slot area is like that of a scalar object. For example, if
     sl(`one `two `three;
         (0 0 2; "abc"; 3 4))
     `sl is `slot
     `sl has (`shelltitle;'sl';
              `title;'The above example')
     show `sl
then the display has three slot areas: one with label one and value 0 0 2; a second with label two and value abc; and a third with label three and value 3 4. For convenience, 0 is said to be the index of the first slot area, i.e., the one containing one and 0 0 2,  1 the index of the second, and so on.

The value areas can be edited, but the label areas cannot.

The slot areas that appear in the display and their arrangement can be controlled by the setting of the geometry attribute; see "The Geometry Attribute". All slot areas specified for display by this attribute are completely displayed; slotfiller displays never have scrollbars.

The width of the label area in a slot with only one slot area is determined in the same way as the title area of a scalar object. More generally, to determine the width of a particular label area, consider all label areas that line up with it on the left: they all have the same width, which is just large enough to display the longest label among them, except that there is no label area for an empty label.

The labels can be specified using the label attribute. No label area appears when the label for that area is specified to be an empty vector. A vector of n blanks produces a label area filled with n blanks. As with a scalar object, all additional size goes to the value areas when the display is resized larger.

Visual Representation
sl With Default Geometry:

sl With Geometry Changed To 2 1:

sl With Matrix Geometry:

Attributes

   The Geometry Attribute

The geometry attribute controls the arrangement of an object of class slot on the screen. The value can be an integer, a vector, or a matrix.

Geometry Specified as an Integer

An integer specifies the number of columns in the arrangement, with the convention that -2 means a horizontal arrangement (and so is equivalent to the number of slot areas), and -1 means vertical (and so is equivalent to 1). Horizontal and vertical arrangements can also be specified by `horizontal and `vertical, respectively.

Geometry Specified as a Vector

The elements of a vector specify the number of slotfiller elements in the individual rows, the length of the vector being the number of rows.

In both the integer and vector cases, the slot areas fill the first row in order, then the second, and so on, until the elements are exhausted.

Geometry Specified as a Matrix

In the case of a matrix the elements must be from either (but not both) of:

  • the list of integers 1,n, where n is the number of slots;
  • the list of symbols `,0s, where s is the slotfiller array (and 0s is therefore its list of symbols).
The display of the object is subdivided conceptually into blocks with the (i;j)th element of the matrix corresponding to the (i;j)th block; the upper left corner of the display is the origin. A -1 or empty symbol (`) in the matrix indicates that the corresponding block is blank. A nonnegative integer is the index of the slot area (as described above) occupying that block, while a nonempty symbol is the symbolic index associated with that slot area. Repeated integers or symbols must form a submatrix. Not all integers or symbols from their respective lists need be used. See "
Functional Attributes".

   The R and C Attributes

The arrangement of the slot areas can be understood in terms of virtual rows and virtual columns, in the same way as objects in a layout. It is possible to constrain the virtual rows or columns to be all the same size by setting the R or C attribute to 1, respectively.
List of Attributes
See the "Display Attributes" chapter for details concerning all the attributes that apply to objects in the slot display class, as well as lists of colors and fonts. The keys in the Table of All Display Attributes that pertain to this class are S, ALL, CNFT, NFT, and TOP.

The attributes that are meaningful for the slot display class (other than the print... attributes) are:

active
ancestors
arrowbuttons
arrowdown
arrowkeys
arrowleft
arrowlist
arrowright
arrowup
at
atsector
b
bg
bound
C
class
clear
colors
cycle
decrement
deiconized
doc
done
downto
dynamic
edit
editbg
editfg
editspace
eval
evaluate
execute
exit
extent
fg
f1-f12
fkeys
focus
followers
followertree
font
foot
freeze
fullscreen
geometry
h
H
has
head
hide
hl
hlthickness
icon
iconic
iconized
icontitle
in
increment
incurrentworkspace
is
l
label
labelfg
labelfont
leader
leftto
literal
lower
mapped
naturalsize
notify
out
outofcurrentworkspace
parent
pin
preset
primary
protect
protected
r
R
raise
realize
refer
refresh
request
resize
resizeable
respace
rightto
script
selected
sensitive
set
settings
shadowthickness
shell
shelltitle
show
space
stars
state
stateself
syncshow
t
tabfrom
tablist
tabto
title
titlefg
titlefont
titlejustify
upto
vcol
vcols
verify
vrow
vrows
w
W
ws
x
X
xs
y
Y
ys
yx
YX
yxs
(Point the mouse cursor to an attribute to display a short description at the bottom of the screen)


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_43.html0000444000265000001440000017030610737165237013656 A+ Reference: The Table Display Class

The Table Display Class

This container is somewhat different from a window or layout, in that all children are of the class tableField and, if necessary, are re-bound to that class when a table is bound. If a table object is altered so as to omit some of its original children, the usual specification rule applies: those children remain on the screen, but not as part of the table object. Instead, they have independent displays, in the formats of their default display classes. In particular, they do not remain bound to the class tableField. An object can be bound to the tableField class only by A+ and only as a child of a table object. The children of a table object must be unique.

A variable can be bound to the table display class if it is a scalar or vector consisting of object symbols. The child objects, which are also called fields of the table, can be vectors or simple character matrices; they cannot appear more than once in the table variable. The display consists of a title area and a value area. The value area has a title bar on top that holds the names of the fields, while the area below consists of delineated cells, one column for each field. The fields appear on the screen in the same left to right order as their symbols appear in the variable that is bound to the table class. The top cell of each field is the first element of the corresponding variable; in the case of a character matrix field, the cells correspond to rows of the matrix and the top cell is the first row.

If a table requires more than just a few cells, then by default only a subtable is presented on the screen, and the display is provided with scrollbars. If the table fields have different numbers of elements, then whether or not a vertical scrollbar is used depends on the number of elements in the first field (i.e., t[0] for a table t). The particular subarray that appears in the value area can be controlled by the scrollbars and settings of the attributes firstrow, firstcol, rows and cols. Neither by scrollbars nor by firstrow is it possible to display rows for which the first field has no value: the number of elements in the first field completely controls the rows that can be displayed. If the table fields have different numbers of elements and you want to allow the display of all elements, the first field must have at least as many elements as any other field. For a table, the attribute firstcol refers to the leftmost field shown, and cols refers to the number of fields.

Be aware of one situation that can occur. Suppose a visible field is dependent upon the first field and another field, c:a+b, say. If a strand assignment changing their lengths is made to a and b, what happens depends upon the order in which the individual assignments are made. If the assignment to the first field is made last, there is no problem. Otherwise, the assignment to the first field causes the table to use its new length to determine the range of the vertical scrollbar and that involves materializing the field "too early", when a and b have unequal lengths, causing a length error in the evaluation of c. One workaround, as implied above, is to see that the first field is set last. Another is to unmap the table, perform the assignment, and then map it again.

Visual Representation
     thousands10hundreds10tens10ones10
     t`ones`tens`hundreds`thousands
     `t is `table
     `t has (`shelltitle;'t')
     show `t

A Table of Numeric Fields:

Attributes
See the "Display Attributes" chapter for details concerning all the attributes that apply to objects in the table and tableField display classes, as well as lists of colors and fonts. The keys in the Table of All Display Attributes that pertain to the table class are T, ALL, CNFT, NFT, and TOP.

The attributes that are meaningful for the table display class (other than the print... attributes) are:

active
ancestors
arrowdown
arrowkeys
arrowleft
arrowlist
arrowright
arrowup
at
atsector
b
bg
blank
bound
breakfont
breakstyle
children
class
clear
col
colors
cols
colsep
columncontrol
columnpagespan
columnresize
columnspacing
copy
currentbreakcolumn
cycle
deiconized
delete
descendents
doc
downto
dragdrop
dynamic
edit
editbg
editfg
editspace
eval
evaluate
execute
exit
extent
f1-f12
familytree
fg
field
fields
firstcol
firstfield
firstrow
fixedfields
fixedreportcolumns
fkeys
focus
followers
followertree
font
foot
framelinewidth
frameoffset
framestyle
freeze
fullscreen
h
H
has
head
headingstyle
hide
hl
hlthickness
hscrollsize
hscrollwith
icon
iconic
iconized
icontitle
in
incurrentworkspace
index
insertabove
insertbelow
is
l
leader
leading
leftto
literal
lower
mapped
na
naturalsize
newshow
newspapercolumn
notify
out
outofcurrentworkspace
outputstyle
parent
pin
preset
primary
protect
protected
r
raise
realize
recursively
refer
refresh
reparent
reportfont
reportheadingfont
reporttotalfont
reporttotalleading
reporttotalon
reporttotalstyle
request
reshow
resize
resizeable
respace
rightto
row
rowbg
rowcontrol
rowpagespan
rows
rowsep
script
scrollbg
scrollsize
select
selectbg
selected
selectedfield
selectfield
selectionmode
sensitive
set
setcol
setfirstcol
setfirstrow
setrow
settings
shadowthickness
shell
shelltitle
show
size
space
stars
state
stateself
style
syncshow
t
tabfrom
tablist
tabto
title
titlefg
titlefont
titlejustify
upto
vcol
vcols
verify
vrow
vrows
vscrollsize
vscrollwith
w
W
ws
x
X
xs
y
Y
ys
yx
YX
yxs

The keys in the Table of All Display Attributes that pertain to the tableField display class are tF and ALL.

The attributes that are meaningful for the tableField display class are:

active
ancestors
arrowdown
arrowkeys
arrowleft
arrowright
arrowup
bg
bggrayscale
blank
bound
breakbggrayscale
breakcriteriafunc
breakfggrayscale
breakfont
breakleading
breakoffset
breakon
breakprocessfunc
breakprocesson
breakstyle
breaktext
class
colors
columnalignment
computationmode
copy
cycle
doc
done
editspace
eval
evaluate
execute
f1-f12
fg
fggrayscale
fkeys
font
formatbreakfunc
has
headingbggrayscale
headingfggrayscale
headingstyle
in
is
literal
mapped
na
out
pagebreakon
parent
preset
protect
protected
reportfont
reportheadingfont
respace
set
settings
shell
space
stars
state
stateself
style
suppressduplicate
title
titlefg
titlefont
verify
(Point the mouse cursor to an attribute to display a short description at the bottom of the screen)


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_44.html0000444000265000001440000006217010737165240013650 A+ Reference: The Text Display Class

The Text Display Class

The text display class provides a general means for text entry. It can be used wherever a note pad is needed in applications. Any character vector can be displayed in this class. Once an object of this class has focus, editing can begin. New lines are created during text entry by pressing the Enter key, which then appears in the character vector as the character `char10 (newline); this is the only control character that should be used in the text. APL characters can be entered.

There are no user actions that begin and end edit mode; consequently, when the text is entered the underlying character vector may not be automatically updated (see the save attribute). However, even if the character vector is not updated, the current text on the screen can be obtained as the value of the buffer attribute.

Visual Representation

     t"    Note to File  07/12/00 No. 4"
                         Could start with the empty vector
     `t has (`shelltitle `title;('text';'text'))
     show `t is `text

Attributes
See the "Display Attributes" chapter for details concerning all the attributes that apply to objects in the text display class, as well as lists of colors and fonts. The keys in the Table of All Display Attributes that pertain to this class are X, ALL, CNFT, NFT, and TOP.

The attributes that are meaningful for the text display class (other than the print... attributes) are:

active
ancestors
arrowdown
arrowkeys
arrowleft
arrowlist
arrowright
arrowup
at
atsector
b
bg
bound
buffer
class
clear
cols
cursor
deiconized
doc
downto
dynamic
eval
evaluate
exit
extent
f1-f12
fg
fkeys
focus
followers
followertree
font
foot
freeze
fullscreen
h
H
has
head
hide
hl
hlthickness
icon
iconic
iconized
icontitle
incurrentworkspace
is
l
leader
leftto
literal
lower
mapped
naturalsize
notify
outofcurrentworkspace
parent
pin
preset
primary
r
raise
realize
refresh
request
resize
resizeable
rightto
rows
save
script
sensitive
set
settings
shadowthickness
shell
shelltitle
show
state
stateself
syncshow
t
tabfrom
tablist
tabto
title
titlefg
titlefont
titlejustify
upto
vcol
vcols
verify
vrow
vrows
w
W
ws
x
X
xs
y
Y
ys
yx
YX
yxs
(Point the mouse cursor to an attribute to display a short description at the bottom of the screen)


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_45.html0000444000265000001440000007051010737165240013646 A+ Reference: The Tree Display Class

The Tree Display Class


The tree display class is for displaying nested slotfillers as treelike data structures. The symbolic indices are shown; the values at the leaves are omitted, since the primary intended use is to display layouts in tree form. The number of children per node is limited to 128.

If you want to have values at the leaves shown, you must doctor the nested slotfiller, if possible, to turn the values into symbolic indices in slotfillers with arbitrary artificial values. For example, if you want the numeric values shown for the slotfiller

t(`a;<(`b`c`d;(7;(`e`f;(8;9));10)))

you could construct something like

t1(`a;<
    (`b`c`d;
     ((`7;<0);(`e`f;((`8;<0);(`9;<0)));(`10;<0))))

and show t1 as a tree representing t.

Visual Representation
A complicated layout can be represented as a nested slotfiller, and then displayed as a tree for a convenient view of its structure. In fact, the appropriate nested slotfiller representation is produced by the familytree attribute. For example, if ly is a layout, then its organization may look as follows:
     tr0`familytree of `ly
     show `tr is `tree
A Layout Represented as a Tree:

In this example, the ".table1" button has been selected by clicking on it.
 

User Interactions

If a callback function for the object is defined, it is called when: In such a call, the path variable (see "Callback Functions") is the symbol vector path to the node.
Attributes

See the "Display Attributes" chapter for details concerning all the attributes that apply to objects in the tree display class, as well as lists of colors and fonts. The keys in the Table of All Display Attributes that pertain to this class are R, ALL, CNFT, NFT, and TOP.

The attributes that are meaningful for the tree display class (other than the print... attributes) are:

active
ancestors
arrowdown
arrowkeys
arrowleft
arrowlist
arrowright
arrowup
at
atsector
b
bg
bound
class
clear
deiconized
doc
downto
dynamic
eval
evaluate
exit
extent
f1-f12
fg
fkeys
focus
followers
followertree
font
foot
freeze
fullscreen
h
H
has
head
hide
hl
hlthickness
horizontalspace
icon
iconic
iconized
icontitle
incurrentworkspace
is
l
label
labelfg
labelfont
leader
leftto
linecolor
literal
lower
mapped
naturalsize
nodebg
nodefg
notify
orientation
outofcurrentworkspace
parent
pin
preset
primary
r
raise
realize
refer
refresh
request
resize
resizeable
rightto
script
select
selected
selectednodebg
selectednodefg
sensitive
set
settings
shadowthickness
shell
shelltitle
show
state
stateself
syncshow
t
tabfrom
tablist
tabto
title
titlefg
titlefont
titlejustify
upto
vcol
vcols
verify
verticalspace
vrow
vrows
w
W
ws
x
X
xs
y
Y
ys
yx
YX
yxs
(Point the mouse cursor to an attribute to display a short description at the bottom of the screen)


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_46.html0000444000265000001440000007426610750123673013662 A+ Reference: The View Display Class

The View Display Class

The view class is for simple character matrices that are somewhat larger than labels. It is used, for example, to display reports. If the matrix is large, then by default only a subarray is presented on the screen, and the display is provided with scrollbars. Users control the particular subarray that appears in the value area with the scrollbars; programmers use settings of the attributes firstrow, firstcol, rows and cols.

It is recommended that you avoid the use of matrices that contain tabs, backspaces, linefeeds, etc., as these can sometimes produce anomalous results. In general, avoid ASCII control-type characters in any array to be bound to the view class.

Views cannot be edited. Only fixed-width (monospaced) fonts should be used for horizontal scrolling.

Visual Representation
     tsys.readmat 'GettingStarted'
     `t is `view
     `t has (`shelltitle;'text')
     `t has (`title;'The Getting Started Tutorial')
     show `t
A Display of Two-Dimensional Text:

Attributes
See the "Display Attributes" chapter for details concerning all the attributes that apply to objects in the view display class, as well as lists of colors and fonts. The keys in the Table of All Display Attributes that pertain to this class are V, ALL, CNFT, NFT, and TOP.

The attributes that are meaningful for the view display class (other than the print... attributes) are:

acceptfocus
active
ancestors
arrowdown
arrowkeys
arrowleft
arrowlist
arrowright
arrowup
at
atsector
b
bg
bound
class
clear
col
colors
cols
colsep
cycle
deiconized
doc
downto
dynamic
eval
evaluate
exit
extent
f1-f12
fg
firstcol
firstrow
fkeys
focus
followers
followertree
font
foot
freeze
fullscreen
h
H
has
head
hide
hl
hlthickness
hscrollsize
hscrollwith
icon
iconic
iconized
icontitle
incurrentworkspace
index
is
l
leader
leftto
literal
lower
mapped
naturalsize
notify
outofcurrentworkspace
parent
pin
preset
primary
r
raise
realize
refer
refresh
request
resize
resizeable
rightto
row
rowbg
rows
rowsep
script
scrollbg
scrollsize
select
selectbg
selected
selectionmode
sensitive
set
setcol
setfirstcol
setfirstrow
setrow
settings
shadowthickness
shell
shelltitle
show
size
state
stateself
syncshow
t
tabfrom
tablist
tabto
title
titlefg
titlefont
titlejustify
upto
vcol
vcols
verify
vrow
vrows
vscrollsize
vscrollwith
w
W
ws
x
X
xs
y
Y
ys
yx
YX
yxs
(Point the mouse cursor to an attribute to display a short description at the bottom of the screen)


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_46VG.html0000444000265000001440000007362510737165241014117 A+ Reference: The Vgauge Display Class

The Vgauge Display Class

The vgauge class is like the hgauge class, with the obvious differences: sliderwidth is respected and sliderheight is ignored, the justification attributes have different effects, and so on.

Attributes

See the "Display Attributes" chapter for details concerning all the attributes that apply to objects in the vgauge display class, as well as lists of colors and fonts. The keys in the Table of All Display Attributes that pertain to this class are vG, ALL, CNFT, GS, NFT, and TOP.

The attributes that are meaningful for the vgauge display class (other than the print... attributes) are:

active
ancestors
arrowdown
arrowkeys
arrowleft
arrowlist
arrowright
arrowup
at
atsector
b
bg
bound
class
clear
deiconized
doc
downto
dynamic
eval
evaluate
execute
exit
extent
f1-f12
fg
fkeys
focus
followers
followertree
font
foot
freeze
fullscreen
H
h
has
head
hide
hl
hlthickness
icon
iconic
iconized
icontitle
inc
incurrentworkspace
is
l
labelfg
labelfont
labelinc
labeljustify
labelout1
leader
leftto
literal
lower
majorticksize
mapped
max
maxtitle
maxtitlefg
maxtitlefont
maxtitlejustify
min
minortickcount
minorticksize
mintitle
mintitlefg
mintitlefont
mintitlejustify
naturalsize
notify
out1
outofcurrentworkspace
pageinc
parent
pin
preset
primary
r
raise
realize
refresh
request
resize
resizeable
rightto
script
sensitive
set
settings
shadowthickness
shell
shelltitle
show
sliderbg
sliderheight
sliderwidth
state
stateself
subtitle
subtitlefg
subtitlefont
subtitlejustify
syncshow
t
tabfrom
tablist
tabto
title
titlefg
titlefont
titlejustify
upto
valuefg
valuefont
valuejustify
vcol
vcols
verify
vrow
vrows
W
w
ws
X
x
xs
Y
y
ys
YX
yx
yxs
(Point the mouse cursor to an attribute to display a short description at the bottom of the screen)

1. Note that labelout is used to format the scale labels and out to format the value label.


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_46VGr.html0000444000265000001440000006333610737165241014277 A+ Reference: The Vgrid Display Class

The Vgrid Display Class

The vgrid class is like the hgrid class, except that the default arrangement is vertical.

Examples of the Layout and Grid Classes:

Attributes

See the "Display Attributes" chapter for details concerning all the attributes that apply to objects in the vgrid display class, as well as lists of colors and fonts. The keys in the Table of All Display Attributes that pertain to this class are vR, ALL, CNFT, CNT, NFT, and TOP.

The attributes that are meaningful for the vgrid display class (other than the print... attributes) are:

active
ancestors
arrowdown
arrowkeys
arrowleft
arrowlist
arrowright
arrowup
at
atsector
b
be
bg
bound
build
children
class
clear
descendents
deiconized
doc
downto
dynamic
eval
evaluate
exit
extent
extents
f1-f12
familytree
fg
fkeys
focus
followers
followertree
font
foot
freeze
fullscreen
H
h
has
head
hide
hl
hlthickness
icon
iconic
iconized
icontitle
incurrentworkspace
is
l
leader
leftto
literal
lower
mapped
naturalsize
newshow
notify
outofcurrentworkspace
parent
pin
preset
primary
r
raise
realize
recursively
refresh
reparent
request
reshow
resize
resizeable
rightto
script
sensitive
set
settings
shadowthickness
shell
shelltitle
show
state
stateself
structure
syncshow
t
tabfrom
tablist
tabto
title
titlefg
titlefont
titlejustify
upto
vcol
vcols
verify
vrow
vrows
W
w
ws
X
x
xs
Y
y
ys
YX
yx
yxs
(Point the mouse cursor to an attribute to display a short description at the bottom of the screen)


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_47.html0000444000265000001440000006333610737165242013662 A+ Reference: The Vmenu Display Class

The Vmenu Display Class

The vmenu and hmenu display classes are for representing nested slotfillers as cascade menus. When vmenu is used, the top-level menu is laid out vertically, whereas hmenu gives a horizontal layout. All submenus are vertical in both cases.

A slotfiller consists of two parts, the symbolic indices and the values. A nested slotfiller is one whose values are also slotfillers. The values within the slotfiller values can also be slotfillers, and so on; slotfillers can be nested to any level. In terms of the menu display classes, the symbols of a slotfiller bound to either menu class correspond to the items in the top level of a menu. If a value is also a slotfiller, then its symbols correspond to a submenu, and so on.

Menus cannot be edited.

A callback function must be defined for the slotfiller if any actions are to be taken in response to selection of menu items. When a callback occurs, only pd appears in the d position.

Selecting an item does not cause a preset callback to fire.

See "The Hmenu Display Class" for details of the horizontal menu.

Visual Representation
menus.rsf{
    s.rsf converts a recursive association list to a recursive slotfiller
       (`file;(
                  `new;       newfn;
                  `open;      openfn;
                  `close;     closefn;
                  `save;(
                              `save;      savefn;
                              `save_as;   save_asfn));
       `edit;(
                  `undo;      undofn;
                  `cut;       cutfn;
                  `copy;      copyfn;
                  `paste;     pastefn);
       `format;(
                  `font;(
                              `kaplgallant;;
                              `courier;);
                  `size;      sizelist;
                  `style;     stylelist)
  )
      }

vmenu: Vertical Cascade Menu:

show `menu is `vmenu
 

  hmenu: Horizontal Cascade Menu:

show `menu is `hmenu
 

 
 

Attributes

See the "Display Attributes" chapter for details concerning all the attributes that apply to objects in the vmenu display class, as well as lists of colors and fonts. The keys in the Table of All Display Attributes that pertain to this class are vM, ALL, CNFT, NFT, and TOP.

The attributes that are meaningful for the vmenu display class (other than the print... attributes) are:

acceptfocus
active
ancestors
arrowdown
arrowkeys
arrowleft
arrowlist
arrowright
arrowup
at
atsector
b
bg
bound
class
clear
deiconized
doc
downto
dynamic
eval
evaluate
exit
extent
f1-f12
fg
fkeys
focus
followers
followertree
font
foot
freeze
fullscreen
h
H
has
head
hide
hl
hlthickness
icon
iconic
iconized
icontitle
incurrentworkspace
is
l
leader
leftto
literal
lower
mapped
mnemonics
naturalsize
notify
outofcurrentworkspace
parent
pin
preset
primary
r
raise
realize
refresh
request
resize
resizeable
rightto
script
sensitive
set
settings
script
shadowthickness
shell
shelltitle
show
state
stateself
syncshow
t
tabfrom
tablist
tabto
titlejustify
upto
vcol
vcols
verify
vrow
vrows
w
W
ws
x
X
xs
y
Y
ys
yx
YX
yxs
(Point the mouse cursor to an attribute to display a short description at the bottom of the screen)


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_48.html0000444000265000001440000007141310737165242013656 A+ Reference: The Vpane Display Class

The Vpane Display Class

The vpane and hpane display classes are special layout classes that have movable dividers, or sashes, between the layout children. The user can control the proportion of the layout that each child occupies simply by moving the dividers. Various layout-constraint attributes, such as position and build, are disregarded. The children of a vpane layout should be arranged vertically, and will have horizontal dividers between them.

To move a divider, simply place the mouse cursor on it, press and hold the left mouse button, and then slide the divider up and down. A small button is provided on the right end of each divider as a convenient place to locate the cursor.

The dividers of a vpane layout always extend from one side of the layout to the other, so care must be taken when using vpane layouts with more than one column. In a vpane layout of the form 2 2`a`b`a`c,  for example, the divider between objects b and c cuts through object a. If several objects line up on a divider boundary, then movement of the divider controls the display sizes of these objects. If all the objects line up on divider boundaries, then movement of the dividers controls the display sizes of entire rows of objects.

There is no direct way for a program to determine where a user has positioned a divider in a vpane layout. Sometimes there are indirect ways to approximate the position, such as by checking the values of the rows and cols attributes of a matrix to determine how many rows and columns are currently shown.

Compare VPane with "The Hpane Display Class" for a visual representation of a similar object.

Visual Representation

m10 10
`m has (`class;`matrix;  `title;"Matrix Title";
        `label;("Labels";
                (<"Row"),10;
                (<"Col"),10));
a20
`a has (`class;`array;  `title;("Array";"Title"));
h1 2`m`a
`h has (`class;`vpane;  `title;"VPane Title";
        `shelltitle;"Shell Title"; `show;1);

Attributes
See the "Display Attributes" chapter for details concerning all the attributes that apply to objects in the vpane display class, as well as lists of colors and fonts. The keys in the Table of All Display Attributes that pertain to this class are vP, ALL, CNFT, CNT, NFT, and TOP.

The attributes that are meaningful for the vpane display class (other than the print... attributes) are:

active
ancestors
arrowdown
arrowkeys
arrowleft
arrowlist
arrowright
arrowup
at
atsector
b
be
bg
bound
C
children
class
clear
constraints
deiconized
descendents
doc
downto
dynamic
eval
evaluate
exit
extent
extents
f1-f12
familytree
fg
font
fkeys
focus
followers
followertree
foot
freeze
fullscreen
h
H
has
head
hide
hl
hlthickness
icon
iconic
iconized
icontitle
incurrentworkspace
is
l
leader
leftto
literal
lockposition
locksize
lower
mapped
naturalsize
newshow
notify
outofcurrentworkspace
parent
pin
preset
primary
r
R
raise
realize
recursively
refresh
reparent
request
reshow
resize
resizeable
rightto
script
sensitive
set
settings
shadowthickness
shell
shelltitle
show
state
stateself
structure
syncshow
t
tabfrom
tablist
tabto
title
titlefg
titlefont
titlejustify
upto
vcol
vcols
vcolspace
verify
vrow
vrows
vrowspace
w
W
ws
x
X
xs
y
Y
ys
yx
YX
yxs
(Point the mouse cursor to an attribute to display a short description at the bottom of the screen)


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_48VS.html0000444000265000001440000007620110737165243014130 A+ Reference: The Vscale Display Class

The Vscale Display Class

The vscale class is like the hscale class, with a few obvious differences, such as the effects of the justification attributes. See the description of the hgauge class.

Also see "Hscale and Vscale Objects", in "User Interactions with Displays".

Attributes

See the "Display Attributes" chapter for details concerning all the attributes that apply to objects in the vscale display class, as well as lists of colors and fonts. The keys in the Table of All Display Attributes that pertain to this class are vS, ALL, CNFT, GS, NFT, and TOP.

The attributes that are meaningful for the vscale display class (other than the print... attributes) are:

active
ancestors
arrowdown
arrowkeys
arrowleft
arrowlist
arrowright
arrowup
at
atsector
b
bg
bound
class
clear
deiconized
doc
downto
dynamic
edit
editbg
editfg
editspace
eval
evaluate
execute
exit
extent
f1-f12
fg
fkeys
focus
followers
followertree
font
foot
freeze
fullscreen
H
h
has
head
hide
hl
hlthickness
icon
iconic
iconized
icontitle
in
inc
incurrentworkspace
is
l
labelfg
labelfont
labelinc
labeljustify
labelout1
leader
leftto
literal
lower
majorticksize
mapped
max
maxtitle
maxtitlefg
maxtitlefont
maxtitlejustify
min
minortickcount
minorticksize
mintitle
mintitlefg
mintitlefont
mintitlejustify
naturalsize
notify
out1
outofcurrentworkspace
pageinc
parent
pin
preset
primary
r
raise
realize
refresh
request
resize
resizeable
rightto
script
sensitive
set
settings
shadowthickness
shell
shelltitle
show
sliderbg
sliderheight
sliderwidth
state
stateself
subtitle
subtitlefg
subtitlefont
subtitlejustify
syncshow
t
tabfrom
tablist
tabto
title
titlefg
titlefont
titlejustify
upto
valuefg
valuefont
valuejustify
vcol
vcols
verify
vrow
vrows
W
w
ws
X
x
xs
Y
y
ys
YX
yx
yxs
(Point the mouse cursor to an attribute to display a short description at the bottom of the screen)

1. Note that labelout is used to format the scale labels and out to format the value label.


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/ARtoc.html0000444000265000001440000004372710242637220012460
Elsewhere on the A+ website:
Home Page
A+ Keyboard

Reference Manuals:
Introduction:

Online Doc Use
Setting up A+ fonts
The Document

Language:

Overview
Data
Syntax

Mon. Scalar Fns
Dy. Scalar Fns
Nonscalar Fns

Nmbr Reprsntn

Mon. Operators
Dy. Operators
Control Stmts

Sys Vars
Sys Fns
Sys Cmds

Defined Fns
Defined Fns - Tips
Dependencies
Callbacks

Files

Timing

Invoking A+
Emacs
WSs & Scripts

Screen Management:

Screen Mgmt
Screen Fns

Attributes:
    Table
        Keys
    Functional
    Callbacks

Display Classes:
    Action
    Array
    Button
    Check
    Choice
    Command
    Graph, ...Trace
    Hgauge
    Hgrid
    Hmenu
    Hpane
    Hscale
    Label
    Layout
    Matrix
    Notebook
    Page
    Password
    Radio
    Report
    Scalar
    Slot
    Table, tableField
    Text
    Tree
    Vgauge
    Vgrid
    View
    Vmenu
    Vpane
    Vscale
    Window

User Interaction

s Context

Display Classes

Extensions and Tools:

adap (IPC)

b Context
c Context
p Context
sys Context
t Context

C Subroutines

Appendices:

A+ and APL differences
Quick Ref
Miscellany
GNU Free Documentation License

aplus-fsf-4.22/src/html/APlusRefV2_49.html0000444000265000001440000006253010737165243013660 A+ Reference: The Window Display Class

The Window Display Class

A window contains only one object, and has the effect of putting scrollbars on the display of that object. It is therefore useful in displaying large objects, such as a slotfiller array with many slots. The object in a window can be of any display class.

Note that both vertical and horizontal scrollbars will always be shown, even if one of them is not needed - or indeed if neither is needed.

Visual Representation
     sym¡100
     val(<@0) 101+100
     a(sym;val)
     `a is `slot
     labs('one';'two';'three';...)
     `a has (`geometry `label;(2;labs))
     w`a
     `w is `window
     `w has (`shelltitle;'w')
     show `w
A Large Slotfiller in a Window:

Attributes

See the "Display Attributes" chapter for details concerning all the attributes that apply to objects in the window display class, as well as lists of colors and fonts. The keys in the Table of All Display Attributes that pertain to this class are W, ALL, CNFT, NFT, and TOP.

The attributes that are meaningful for the window display class (other than the print... attributes) are:

active
ancestors
arrowdown
arrowkeys
arrowleft
arrowlist
arrowright
arrowup
at
atsector
b
bg
bound
children
class
clear
deiconized
descendents
doc
downto
dynamic
eval
evaluate
exit
extent
extents
f1-f12
familytree
fkeys
focus
followers
followertree
foot
freeze
fullscreen
h
H
has
head
hide
hl
hlthickness
icon
iconic
iconized
icontitle
incurrentworkspace
is
l
leader
leftto
lower
mapped
naturalsize
newshow
notify
outofcurrentworkspace
parent
pin
preset
primary
r
raise
realize
recursively
refresh
reparent
request
reshow
resize
resizeable
rightto
script
scrollbg
scrollsize
sensitive
set
settings
shadowthickness
shell
shelltitle
show
state
stateself
syncshow
t
tabfrom
tablist
tabto
upto
title
titlefg
titlefont
titlejustify
vcol
vcols
verify
vrow
vrows
w
W
ws
x
X
xs
y
Y
ys
yx
YX
yxs
(Point the mouse cursor to an attribute to display a short description at the bottom of the screen)


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_5.html0000444000265000001440000016213210737165244013570 A+ Reference: The Syntax and Semantics of A+

The Syntax and Semantics of A+


The main purpose of this chapter is to describe the syntax of A+, but through a series of examples, rather than in a formal way. Consequently some commonly understood terms are used without being formally defined. In particular, the phrase A+ expression, or simply expression, is taken to have the same general meaning it does in mathematics, namely a well formed sentence that produces a value. In addition, some discussion of semantics has been included, but only where it seemed reasonable in order to complete a description. A brief discussion of well formed expressions is presented at the end of this section, after all the rules for the components of expressions have been presented.

Names and Symbols

   Primitive Function Symbols

A+ uses a mathematical symbol set to denote the functions that are native to the language, which are called primitive functions. This symbol set, part of the APL character set, consists of common mathematical symbols such as + and , commonly used punctuation symbols, and specialized symbols such as and . In some cases it takes more than one symbol to represent a primitive function, as in +/, but the meaning can be deduced from the individual symbols. The symbols are listed in the table "Primitive Function and Operator Names and References".

Two of the symbols can be used alone, viz., and . If the execution of a function or operator has been suspended, they mean resume execution (with increased workspace size if necessary) and abandon execution, respectively; in the absence of a suspension, they are ignored. Instead of , a dollar sign ($) can be used. Inside a function definition, an expression can consist of the symbol alone, but it will be ignored, and the parser rejects alone as a token error.

   User Names

User names fall into two categories, unqualified and qualified. An unqualified name is made up of alphanumeric (alphabetic and numeric) characters and underbars (_). The first character must be alphabetic. For example, a, a1c, and a_1c are unqualified names, but 3xy and _xy are not. (Although underbar is currently permitted as the first character in user names, this manual has been written as if it were not, and you should consider this form reserved for system names and avoid it.) The identifying words in control statements (case, do, else, if, while) are reserved by A+ for that use; they cannot appear as user names, even in qualified names.

A qualified name is either an unqualified user name preceded by a dot (.), or a pair of unqualified user names separated by a dot. In either case there are no intervening blanks. For example, .xw1 and w_2.r2_a are qualified user names. An unqualified name preceding the dot in a qualified name is the name of a context. If there is a dot but no preceding name, the context is the root context.

   System Names

System function names are unqualified names preceded by an underbar, with no intervening spaces, _argv for instance. The use of system function names is reserved by A+.

The name of an object traditionally (and therefore in A+) called a system variable is an unqualified name preceded by a backquote, with no intervening spaces. For example, `rl is the name of the system variable called Random Link. These objects cannot be dealt with directly in A+, but only through certain system and primitive functions and system commands, to which they act as parameters. As indicated in "Symbols and Symbol Constants", they look just like symbols (and may be considered such). They are not, however, the symbol forms of names: A+ will not recognize rl, for instance, as having anything to do with `rl; the quoted form 'rl', however, is recognized by system functions such as _gsv.

   System Command Names

System command names begin with a dollar sign, followed immediately by an unqualified name, which is the name of the command. The name is sometimes followed by a space and then by a sequence of characters whose meaning is specific to the command, usually separated from the name by a space.

Comments

Comments can appear either alone on a line or to the right of an expression. A comment is indicated by the symbol (usually called "lamp," since it looks like a bulb filament and since comments illuminate code), and it and everything to its right on the line constitute the comment. For example:
     a+b   This is the A+ notation for addition.

Infix Notation and Ambi-valence

A+ is a mathematical notation, and as such uses infix notation for primitive functions with two arguments. In infix notation, the symbol or user name for a function with two arguments appears between them. For example, a+b denotes addition, a-b subtraction, ab multiplication, and ab division.

In mathematics, the symbol - can also be used with one argument, as in -b, in which case it denotes negation. This is true in A+ as well. Because the symbol denotes two functions, one with one argument and the other with two, it is called ambi-valent (e.g., it uses "both valences"). A+ has extended the idea of ambi-valence to most of its primitive functions. For example, just as -b denotes the negative of b, so b denotes the reciprocal of b.

Defined functions cannot be ambi-valent.

Functions with one argument are called monadic, and functions with two arguments are called dyadic. One often speaks of the monadic use or dyadic use of an ambi-valent primitive function symbol.

Syntactic Classes

   Numeric Constants

Individual numbers can be expressed in the usual integer, decimal, and exponential formats, with one exception: negative number constants begin with a "high minus" sign () - including Inf, which we will come to later - instead of the more conventional minus sign (-), although negative exponents in the exponential format are denoted by the conventional minus sign.

Exponential format is of the form 1.23e5, meaning 1.23 times 10 to the power 5, 5e2, meaning -500, and 1e-2, meaning .01. Only numbers can appear around the e. The one following it must be an integer - no decimal point - and have a regular minus sign if negative: a high minus there elicits a parse error report. A negative number before the e must have a high minus: a regular minus is considered to lie outside the format.

It is also possible to express a list of numbers as a constant, simply by separating the individual numbers by one or more blank spaces. For example:

 1.23 7 45 3e-5
is a numeric constant with four numbers: 1.23, negative 7, 45, and .00003. Inf can appear in such a list. If you omit the blanks, A+ will give you a numeric vector, but probably not the one you intended. If a number is being parsed and a character is encountered that can't be part of the number, then a new number is started if the character could begin a number. For instance,
1e-3.5 40.358.62.7 is read by A+ as 0.001 0.5 40.358 0.62 0.7 .

   Character Constants

A character constant is expressed as a list of characters surrounded by a pair of single quote marks or a pair of double quote marks. For a quote mark of the same kind as the surrounding quote marks to be included in a list of characters, it must be doubled. For example, both 'abc''d' and "abc'd" are constant expressions for the list of characters abc'd. There is, however, a distinction between the two kinds of quotation marks.

Within single quotes (') the C escape sequences and indeed any \c are not treated in any way, but left as is.

In strings contained within double quotes (") these sequences and \c are treated as follows:

These sequences and their translations are (where parenthesis indicates that A+ does not perform the substitution that the parenthesized term implies):

Double-Quote Translations
NameStringTranslationComment
newline\nnewline character 
(horizontal tab)\ttfor tab use "\11"
(vertical tab)\vv 
(backspace)\bbfor backspace use "\10"
(carriage return)\rrfor carriage return use "\15"
(formfeed)\fffor formfeed use "\14"
(audible alert)\aa 
backslash\\\ 
question mark\?? 
single quote\'' 
double quote\"" 
octal number\oooa charactersee below
(hex number)\xhhxhh 
(any other char)\cc 

Thus "\?\\" is equal to'?\' and "\r\t" is equal to 'rt'\" prevents the double quote from ending a string within double quotes, and \\ allows literal inclusion of \ in a translated string in double quotes.

The translation of an octal sequence - which is of variable length and could be shown as \[[o]o]o - is best understood as occurring in three steps. First, the digits to be translated are found: there is at least one (else this would not be an octal sequence) and at most three, but the end of the string and any nondigit character also act as terminators. Second, the string of digits is taken as an octal number and is translated to a decimal number. Any 8 and 9 digits are accepted as 10 octal and 11 octal, and any overflow is ignored, since only the 256 residue is used. Third, the ASCII character corresponding to that number is found. If the string being translated is digits, the translation is
`char810 10 10digits where 1(digits)3 and digits is `char.

The foregoing implies these equivalences:
"\99""\121"     "\6a""\006a""\06",'a'     "\123456""\123",'456'.

   Symbols and Symbol Constants

A symbol is a backquote (`) followed immediately by a character string made up of alphanumeric characters, underscores (_), and dots (.). Symbol constants can be thought of as character-based counterparts to numeric constants, aggregating several characters into a single symbol. Just as 1 2.34 12e3 3e5 is a list of four numbers, so `a.s `12 `b`w_3 is a list of four symbols. A backquote alone represents the empty symbol.

A user name, like balance, can be put in symbol form by placing a backquote before it, as in `balance. A user name in symbolic form is always taken to refer to a global object (see "Scope of Names"), never a local object. If it has no dot in it, it refers to a global object in the current context.

System variable names, like `rl, are in the form of symbols. Unlike backquoted user names, they are not decomposable. If var is a user name, then `var is recognized by A+ in certain situations as referring to the same object. A+ sees no relation, however, between rl and the system variable `rl.

   The Null

The Null is a special constant that can be formed as follows: (). It is neither numeric nor character, but has a special type, null. It is an empty vector, i.e., its rank is 1 and the length of its only axis is 0.

   Variables

Variables are data objects that are named. They receive their values through Assignment, or Specification, which is denoted by the left-pointing arrow (). For example, the expression
     abc1 2 3
assigns the three-element list consisting of 1, 2, and 3 to the variable named abc. Any user name can serve as a variable name. For more on assignment, see the "
Assignment, or Specification" section.

   Functions and Function Call Expressions

Functions take zero or more arguments and return results. A sequence of characters that constitutes a valid reference to a function will be called a function call expression. That is, a function call expression includes a function symbol or name together with all its arguments and all necessary punctuation. It may also include unnecessary parentheses and blanks; if it does not, we will call it irredundant. In general, the arguments of a function are data objects, which may appear in function call expressions as variable names, constants, or expressions that require evaluation. In addition, for the various forms of function call expressions using braces, arguments can be function expressions (see "Function Expressions"). For example, f{9.98;.0775;} and f{59;125;g}, where g is a defined function, are valid function call expressions.

A function with no arguments, or parameters, - which must be a defined or system, not a primitive, function - is said to be niladic. The only valid irredundant function call expression for a niladic function f is f{}.

Functions with one argument, monadic functions, can be primitive, defined, or system. The valid irredundant function call expressions for a function f with one argument a are f a and f{a}. In the form f a, the blank is required only if f followed by some initial part of a would form a valid name.

Dyadic functions can also be primitive, defined, or system. The valid irredundant function call expressions for a function f with two arguments a and b are a f b and f{a;b}, where a is called the left argument and b the right argument. In the infix form, each blank is required only if its absence could cause a name to be extended, and if the left argument is itself an infix expression it must be parenthesized.

Functions with more than two arguments must be defined or system, not primitive, functions. The only valid irredundant function call expression for a function of more than two arguments a, b, ... , c is f{a;b; ... ;c}.

In functional expressions that use braces, any position adjacent to a semicolon can be left blank. For example, each of the following is a valid functional expression: f{a;}, f{;b}, f{;}, g{;a;b}, g{;;b}. However, if f is monadic then f{} is not valid because f{} is reserved for niladic function call expressions. When an argument position is legitimately left blank, A+ assumes that the argument is the Null.

The number of arguments that a function takes is called its valence. The valence of a defined function is fixed by the form of its definition.

The table "Function Call Expressions and Function Header Formats" summarizes the function call expressions discussed here.

   Operators and Derived Functions

There are three primitive formal operators in A+, known as Apply, Each, and Rank. By a formal operator we mean an operator in the mathematical sense, i.e., a function that takes a function as an operand, or produces a function as a result, or both. The resulting function is called a derived function.

The Apply and Each operators are both denoted by the dieresis, . For a given function f, the function derived from the Each operator is denoted by f. The function f can be either monadic or dyadic, and f has the same valence as f. For a given function scalar g, where g is equal to <{f}, the function derived from the Apply operator is denoted by g. The function f can be either monadic or dyadic, and g has the same valence as f.

The Rank operator is denoted by the at symbol, @. Unlike the Each operator, the Rank operator has both a function argument and a data argument. For a given function f and data value a, the function derived from the Rank operator is denoted by f@a. This derived function has the same valence as f, which can be either monadic or dyadic.

A+ permits defined formal operators. As with primitive operators, only infix notation is allowed for operator and operands. Like the Each operator, the operand of a monadic defined operator is to the left of the operator name. For example, if the operator is monop then +monop denotes the derived function for +. In the case of a dyadic defined operator, one operand is on the left of the operator name and the other is on the right, like the Rank operator. For example, if the operator is dyop then +dyop denotes the derived function for + and . A dyadic defined operator can have a data right operand: see the note following the table "Operator Header Formats". See also the "Operator Syntax" section.

Unlike a primitive operator, the valence of a function derived from a defined operator is not determined by the valence of the function operands, but, like a defined function, by the form of the operator definition.

There are four other symbols (\./) that can appear with certain primitive function symbols and jot (), the resulting sequences representing functions. Their syntax might suggest that these symbols represent operators; however, not all primitive function symbols can be used in these sequences, and neither can defined function names. Consequently it would be misleading to think of them as formal operators, so we have simply listed all the sequences that are allowed. It is often convenient, however, to speak loosely of these sequences as representing derived functions, and of the three symbols in question as representing operators.

From now on, the general terms operator and derived function will include Apply, Each, Rank, defined operators, their derived functions, and the "operators" and "derived functions" in the table "Special Character Sequences (Quasi-Operators)".

Special Character Sequences (Quasi-Operators)
"Operator" Name "Derived" Functions
Bitwise (Cast and Or) ^ ~ < = >
Inner Product +.  .+  .+
Outer Product .+  .-  .  .  .*  .  .
.|  .<  .>  .  .  .=  .
Reduction +/  /  ^/  /  /  /
Scan +\  \  ^\  \  \  \

Operator call expressions should be understood in terms of derived functions and function call expressions. Namely, an operator symbol and its function operands, or in the case of the Rank operator, its function operand to its left and its data object operand immediately to its right, form a derived function. A derived function is syntactically like any other function, and so can be used in the function position of any function call expression, as in f@a{c;d} and b f@a c . See the table "Operator Call Expressions" for a summary; it shows both irredundant expressions and expressions in which the derived functions are parenthesized. As in function call expressions, the blanks are not required in some instances and the left argument may need to be in parenthesis; moreover, a constant data operand and a constant right argument may require punctuation to separate them.

Operator Call Expressions
Operator Valence Forms for Derived Function Having Monadic Valence Forms for Derived Function Having Dyadic Valence
monadic (f op)af op a a(f op)ba f op b
(f op){a}f op{a} (f op){a;b}f op{a;b}
dyadic (f op g)af op g a a(f op g)ba f op g b
(f op g){a}f op g{a} (f op g){a;b}f op g{a;b}

   Function Expressions

The function arguments of operators are function expressions. The simplest function expressions are the names of defined functions and the symbols for primitive functions other than Assignment and Bracket Indexing. Any formulation of a derived function is also a function expression (see "Operators and Derived Functions").

Function expressions are limited to infix notation, since operators are limited to it.

A function expression can be enclosed in parentheses. For example, a(f@1)b is equivalent to a f@1 b. Moreover, a function expression is a valid function argument to a formal operator, and therefore quite complicated function expressions can be built. For example, +/ is a function expression, and therefore so are the following: +/, +/, and +/@a. See the "Scope Rules for Function Expressions" section.

   Bracket Indexing

A+ data objects are arrays, and Bracket Indexing is a way to select subarrays. Bracket Indexing uses special syntax, whose form is
     x[a;b; ... ;c]
where x represents a variable name or an expression in parenthesis, a, b, ... ,c denote expressions, and the number of semicolons is at most one less than the rank of the array being indexed. (The form x[] is, however, allowed for scalars.) The space between the left bracket and the first semicolon, between successive semicolons, and between the last semicolon and the right bracket, can be empty. If there are no semicolons, the space between the left and right brackets can be empty. Inserting semicolons immediately to the left of the right bracket does not change the meaning of the entire expression, as long as the maximum allowable number of semicolons is not exceeded.
The form [a;b; ... ;c] is an index group. See "Sequences of Expressions" and "Bracket Indexing".

   Expression Group

An expression group is a sequence of expressions contained in a pair of braces in which the expressions are separated by semicolons, where there is not a function expression immediately preceding it (except perhaps for spaces), so it is not a set of arguments for a function. Any of the expressions can be null, consisting of zero or more blanks. For example:
     {a;b; ... ;c;}
and
     {a;b; ... ;c}
are expression groups, where a, b, ... ,c denote expressions. See "
Sequences of Expressions".

   Expression Result and Expression Group Result

The result of an expression is the result of the last function executed in the expression, whether primitive, defined, or derived. See "Well Formed Expressions".

The result of an expression group is the result of the last expression executed. It is possible that the last expression in the group may not be the last one executed - indeed, may not be executed at all; see "Result".

   Strands

Aggregate data objects (nested arrays) can be formed by separating the individual data objects by semicolons and surrounding the result with a pair of parentheses. For example:
     (a;b; ... ;c)
where a, b, ... , c denote expressions. Any of these expressions can be function expressions. There must be at least one semicolon. See "
Sequences of Expressions".

   Function Scalars

The above strand notation produces objects with at least two elements. One-element aggregates of data can be formed with the primitive function Enclose, denoted by <. A one-element object holding a function expression, such as
     <{a}
where a is a function expression, is called a function scalar.

The symbol , used also for the Each operator, serves as the Apply operator when the operand (argument) of the operator is a function scalar. For example, a(<{})b is ab.

   Assignment, or Specification

The Assignment primitive, denoted by , is used to associate a name with a value. For example:
     a1
     f+
assigns the value 1 to the name a and the function Add to the name f. The name to the left of the assignment arrow is assigned the value of the expression to the right. If that expression is a function expression, the name to which it is assigned represents a function - not the name of a function, but a function itself. Otherwise it represents a variable.

A series of names can be associated with a series of values, using strand notation; for example,

     (a;b;c)(1 2 3;3 47;'txt')
Ordinary Assignment can also be expressed as (a)b. Any appearance of ab inside a function or operator definition means that a will be a local variable, if a is an unqualified name. The form (a)b can be used to assign a value to the global variable a, provided that a... doesn't appear elsewhere in the definition. If both a... and (a)... appear, they are equivalent: the latter has no special significance.

Assignment behaves somewhat like a dyadic function, in that it has a result, namely, the right argument. The left argument expression is syntactically limited to certain forms. See the table "Targets of Selective Assignment", for a summary of Selective Assignment target expressions, which are additional to those in ordinary assignment.

Assignment, in any form, cannot be the operand of an operator.

Precedence Rules

Precedence rules describe a hierarchy in the syntactic elements of a language that determines how these elements are grouped for execution in an expression. For example, in mathematics has higher precedence than +, which means that is evaluated before +. For example, in the mathematical expression ab+c, the subexpression ab is grouped for execution, and the result is added to c.

The precedence rules in A+ are simple:

  • all functions have equal precedence, whether primitive, defined, or derived
  • all operators have equal precedence
  • operators have higher precedence than functions
  • the formation of numeric constants has higher precedence than operators.

   Right to Left Order of Execution

The way to read A+ expressions is from left to right, like English. For the most part we also read mathematical notation from left to right, although not strictly, because the notation is two-dimensional. To illustrate reading A+ expressions from left to right, consider the following examples.
b+c+d    Read as: "b plus the result of c plus d."
x-y     Read as: "x minus the reciprocal of y."

As you can see, reading from left to right in the suggested style implies that execution takes place right to left. In the first example, to say "b plus the result of c plus d" means that c+d must be formed first, and then added to b. And in the second example, to say "x minus the reciprocal of y" means that y must be formed before it is subtracted from x.

To be sure, reading from left to right is not necessarily associated with execution from right to left. For example, the expression bc+d is read left to right in conventional mathematical notation as well as A+, but the order of evaluation is different in the two; in mathematics b divided by c is formed and added to d, and consequently the expression is read as "b divided by c, [pause] plus d," while in A+, b is divided by c+d. The order of execution is controlled by the relative precedence of the functions, or operations. In mathematics, division has higher precedence than addition, so that in bc+d, division is performed before addition.

Another way to say that A+ expressions are executed from right to left is that functions have long right scope and short left scope. For example, consider:

     a+b-cef
The arguments of the subtraction function are b on the left (short scope) and cef on the right (long scope). The left argument is found by starting at the subtraction symbol and moving to the left until the smallest possible complete subexpression is found. In this example it is simply the name b. If the first nonblank character to the left of the symbol had been a right parenthesis, then the left argument would have included everything to the left up to the matching left parenthesis. For example, the left argument of subtraction in a+(xb)-cef is xb.

The right argument is found by starting at the function symbol and moving to the right, all the way to the end of the expression; or until a semicolon is encountered at the same level of parenthesization, bracketing, or braces; or until a right parenthesis, brace, or bracket is encountered whose matching left partner is to the left of the symbol. In the above example, the right argument of subtraction is everything to its right. If the case of a+b-(ce)f, the right argument is also everything to its right. However, for a+(b-ce)f, the right argument is ce.

   Scope Rules for Function Expressions

Interestingly enough, the scope rules for function expressions are the mirror image of those for ordinary expressions. Namely, operators have long scope to the left and short scope to the right. For example, +/@a is equivalent to ((+/))@a, and if dyop is a dyadic defined operator, +dyop is equivalent to (+dyop), not +dyop().

   Sequences of Expressions

Index groups, expression groups, and strands are forms for sequences of expressions separated by semicolons. The expressions in an expression group are executed in the order suggested for reading, from left to right, like successive statements in a function. Index groups and strands, however, fall within other expressions and are executed right to left. For example, if the variable a has the value 2 and the strand
     b(a5;aa)
is executed, the value in the second element of b will be 4, proving that the assignment a5 happened after the multiplication aa. (A Strand Assignment, however, like an expression group, is executed left to right, after its righthand argument has been evaluated in the usual way.)

To improve readability in source files, sequences of expressions are often broken at the semicolons and continued on the next physical line. Note that in such cases for expression groups the left to right order of execution for the expressions within a sequence becomes a natural top to bottom order.

   Execution Stack References

Execution stack references are &, &0, &1, etc. The symbol & can be used in a function definition to refer to that function. For example, a factorial function can be defined in either of the following ways:
     fact{n}:if (n>0) nfact{n-1} else 1

     fact{n}:if (n>0) n&{n-1} else 1
When execution is suspended, the objects on the execution stack can be referred to by &0 (top of the stack), &1, and so on. These objects can be examined and respecified, and execution resumed (). The left to right order of arguments generally corresponds to increasing stack numbers.

In the definition of a dependency a, the symbol & refers to that definition but a always denotes the (stored) value of a, whereas in the definition of a function f, both & and f denote the definition of f.

Control Statements

For the interpretation of these control statements, see the "Control Statements" chapter. The words case, do, else, if, and while are reserved by A+; they cannot be employed as user names.

   Case Statement

The form of a case statement is the word case, followed by an expression in parentheses, followed by an expression group. When case followed by an expression in parenthesis is entered alone on a line (with no pending unbalanced punctuation), the statement is taken to be complete, with Null for the expression group.

   Do Statement

There are two do statements, which together have the same syntax as an ambi-valent primitive function (with the word do in place of the function symbol). Both the monadic and dyadic forms have an expression or expression group to the right of the word do. The dyadic form also has an expression to the left which would serve as the left argument if the word do were the name of a dyadic function. In the absence of pending punctuation, if do is entered alone on a line, it is taken to be complete, and echoed by A+, and if it is preceded by an expression but followed by nothing, a parse error is reported.

   If Statement

The form of an if statement is the word if, followed by an expression in parentheses, followed by another expression or an expression group. When if followed by an expression in parenthesis is entered alone on a line (with no pending unbalanced punctuation), the statement is taken to be complete, with Null for the expression group.

   If-Else Statement

The form of an if-else statement is the word if, followed by an expression in parenthesis, followed by an expression or expression group, followed by the word else, followed by another expression or expression group. When an if-else is entered, if there is nothing following the else, a parse error is reported in the absence of pending punctuation.

   While Statement

The form of a while statement is the word while, followed by an expression in parentheses, followed by another expression or an expression group. When while followed by an expression in parenthesis is entered alone on a line (with no pending unbalanced punctuation), the statement is taken to be complete, with Null for the expression group. If the expression in parenthesis is valid and nonzero, it is necessary to interrupt execution (by Control-c Control-c) before anything else can be done.

Function Definitions

A function definition consists of a function header, followed by a colon, followed by the function body, which is either an A+ expression or an expression group.

Function headers take the same forms as functional expressions (see "Functions and Function Call Expressions"), except that only names can appear and none can be omitted. A function header has the monadic form, dyadic form, or general form. The monadic form is the function name followed by the argument name, with the two names separated by at least one space. For example, if the function name is correlate then

     correlate a:{ ... }
is a function definition with the monadic form of the header.

The dyadic form of function header is the function name with one argument name on each side, with the names separated by at least one blank. For example:

     a correlate b:{ ... }
is a function definition with the dyadic form of the header.

The third form of function header is the general form, which is the function name followed by a left brace, followed by a list of from zero to nine argument names separated by semicolons, and terminated by a right brace. For example:

     correlate{a;b;c}:{ ... }
is a function definition with the general form of the header. In this example the function has three arguments. Names must appear in all positions of the argument list - no position can be left empty. (In a niladic function definition no argument position is left empty; there just is no argument position.)

A function with one argument can be defined with either the monadic form of function header or the general form and a function with two arguments can be defined with either the dyadic form or the general form. In a reference to the function, either form (of the correct valence) can be used, no matter how it was defined.

The number of arguments of a defined function is nine or fewer. See the table "Function Call Expressions and Function Header Formats" for a summary.

Note: A position adjacent to a semicolon can be left empty for function call expressions.

Function Call Expressions and Function Header Formats
ValenceForms (see note above)
niladicf{}
monadicf a  or  f{a}
dyadica f b  or  f{a;b}
generalf{a;b; ... ;c}

   Function Result

The result of a defined function is the result of the expression or expression group that forms the function body. The result can be used in the same ways as the result of a primitive function.

Operator Definitions

An operator definition consists of an operator header, followed by a colon, followed by the body of the definition, either an A+ expression or an expression group. The header must be in infix, not general, form.

An operator can be monadic or dyadic, depending on whether it has one argument or two, and the derived function can also be monadic or dyadic. Consequently there are four forms for the header. See the table "Operator Header Formats" for a summary.

Note the parentheses in the forms in this table. While parentheses are not necessary in operator call expressions, they are necessary in operator definition headers to specify the function expression part. Compare with the table "Operator Call Expressions".

Operator Header Formats
Operator ValenceMonadic Derived FunctionDyadic Derived Function
monadic(f op)aa(f op)b
dyadic(f op h)aa(f op h)b

NOTE: In the dyadic form, if the right operand is the letter g, then it must be a function; otherwise, it must be data unless every occurrence in the body of the operator syntactically requires it to be a function.

   Operator Result

The result of a defined operator, which is strictly speaking the result of the derived function, is the result of the expression or expression group that forms the body of the definition. The result can be used in the same ways as the result of a primitive operator.

Dependency Definitions

A dependency definition consists of a name (the name of the dependency), followed by a colon, followed by either an A+ expression, or an expression group. An itemwise dependency has the same form except that the name is followed by [i] where i can be any unqualified user name (except the name of the dependency).

   Dependency Result

The result of a dependency is either a value that was assigned to the name, or the result of the expression or expression group that forms the definition, or, for itemwise dependencies, a combination of the two - see the "Dependencies" chapter. The results of dependencies are referenced in the same way that values of variables are referenced, simply by their names.

Well-Formed Expressions

A well-formed expression is one of the basic forms described above, in which all of the constituent expressions are well formed. The potential for complicated expressions arises from the fact that every one of these basic forms produces a result and can therefore be used as a constituent in other forms, except that the right arrow () can only appear alone and the left arrow () must appear alone unless it has an expression to its right. In this building of expressions from simpler ones A+ is very much like mathematical notation.

The concept of the principal subexpression of an expression is useful for analysis. As execution of an expression proceeds in the manner described in the "Right to Left Order of Execution" section, one can imagine that parts of the expression are executed and replaced by their results, and then other parts are executed using these results, and are replaced by their results, and so on. Ultimately the execution comes to the last expression to be executed, which is called the principal subexpression. Once it is executed, its value is the value of the expression. If the principal subexpression is a function call expression or operator call expression, that function or derived function is called the principal function.

For example, the principal subexpression of (a+bc-d)*10n is x*y, where x is the result of a+bc-d and y is the result of 10n. The power function * is the principal function.

As a second example, the principal expression of (x+y;x-y) is (w;z), where w is x+y and z is x-y. In this case we do not refer to a principal function; the last thing done in executing the expression is what is implied by the strand notation - enclosing w and z and catenating them.


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_50.html0000444000265000001440000015436010737165244013654 A+ Reference: User Interactions with Displays

User Interactions with Displays


This chapter describes screen interactions in A+ applications from the user's point of view. These interactions are covered from an application programmer's point of view in "Introduction to Screen Management", "Display Attributes", "Attributes with Callbacks", and some of the chapters devoted to individual display classes - e.g., in a section of the graph chapter. Much of the behavior discussed in this chapter is due to the window manager of the underlying system.

Many screen interactions - repositioning objects, for instance - are with OLVWM or OLWM, rather than with A+, so some aspects of this interaction are discussed here; see "The Window Manager", below. Windows for A+ applications contain buttons, menus, tables, etc., all with various forms of user interactions, which are discussed in "The A+ Screen Manager". Not all interactions can be addressed in a general document like this one. For example, applications may use any of the function keys F1 through F12 for any purpose, but there is no default use of these keys that can be discussed here. For readers familiar with window-based applications, a fast path through this chapter is the first two sections of "The Window Manager" and the sections of "The A+ Screen Manager" up to "Interactions Peculiar To Individual Display Classes".

The Mouse and Pointer

The mouse has three buttons, which in this manual are called simply the left button, middle button, and right button. (When the mouse has only two buttons, the middle button is simulated by using the other two buttons simultaneously.) Depressing a button and releasing it is called clicking. Clicking twice in rapid succession is called double clicking. For mouse buttons only, pressing a button always means holding the button down until you are told to release it. In this chapter, button means either a mouse button or a button object on the screen.

Associated with the mouse is a pointer, which can appear anywhere on a workstation screen. It may take several forms. When it is in the shape of an arrow, it refers to the spot on the screen that is at the point of the arrow. When it is in the shape of a target, you can resize a window. When it is in the shape of a clock or stopwatch, the system is busy. (See the s.BUSY and s.CLOCK parameters to change the appearance of the pointer.) Usually key and button actions that occur when the clock is shown are stored and acted upon as soon as the system is not busy, but sometimes they are ignored.

To click or press on an object, or when in some area, means to take that action when the pointer is in the designated place. In particular, to press a button pictured on the screen means to place the point of the pointer on the button and to click or press a mouse button - usually, to click the left button.

The Window Manager

   Windows

The screen can contain several windows, which appear as delineated rectangular areas. The windows in the first figure illustrate many of the variations that you may see in A+ applications. In A+, one speaks of top-level windows and popups. Popup windows have pins, as illustrated by the middle two windows in the figure; all other windows in shown there are top-level windows.

Samples of Various A+ Windows:

Key and button actions apply to the window with focus, the window that the pointer is in. Usually you are given a visual clue to the window with focus, such as a brightened or different-colored outline, like the top left window in the figure. A window may be composed of several objects, such as buttons and tables, and if the window has focus then at most one of these objects has keyboard focus, meaning that any keys that are pressed will affect that object.

A window always has a frame around it, and the frame may have a header at the top or footer at the bottom, bands as wide as the window. The upper left window in the figure has both a header and a footer, the one on the upper right has neither, and the ones in the middle have headers only. The frame may also have raised corners at the frame corners called resize corners, as shown in these examples.

In addition, windows may have:

The part of a window that is inside its frame is called the body of the window here. Note that the header is not part of the body. The body of a window may contain one or more objects, or panes. The positions of the panes are fixed, but the user can make more of one pane visible and less of another if the pair is separated by a movable divider.

Scroll bars actually belong to objects within windows - their behavior is not controlled by the OL[V]WM - and so it is common to see more than one vertical or more than one horizontal scrollbar in one window, as in the one at the bottom of the figure. Multiple dividers in a window, though less common, are also possible.

   Select and Traverse

The visible sign that a window has been selected - given focus - is a brightening of its frame and frame outline; see the middle right window in the figure. You can select a window simply by moving the pointer into it. (It is possible that a window may come up with the mouse pointer in it but without keyboard focus; if this happens, you can move the pointer out of the window and back into it to get keyboard focus.) The keyboard may also be used to select a window, providing the means to step through the windows one at a time. For this purpose a traversal order is established for each application. When the pointer is in the body of one window of an application, you can select the next one in the traversal order by pressing Control-Tab. To select the previous one, press Shift-Control-Tab. When you use Control-Tab or Shift-Control-Tab, the pointer is automatically moved to the selected window.

   Front, and Raise and Lower

Overlapping windows are presented as if in three dimensions, and the one that is fully visible is said to be in front, or to be raised. To lower a window is to place it furthest back, so that it is obscured by all windows that overlap it. There are several ways to raise and lower windows. They all act as toggles: if the window is not in front, it is moved there; if it is in front, it is moved to the back.

On a keyboard with a Front key, place the pointer anywhere in the visible part of the window and press Front to place it in front or in back, depending upon its present position. On a keyboard without such a key, position the pointer the same way, and press Alt and hold it while pressing F5 (i.e., press Alt-F5). Double-clicking the left button in a visible part of the header but not on the window menu button or pin (if any) will usually accomplish the same result, and pressing the right button there will generally produce a window manager menu that offers you this action. Likewise, if there is a window menu button, pressing the right button on it will produce another menu that may offer you this action.

   Quit, and Open and Close

You can remove a window from the screen entirely by choosing Quit from its application menu. Likewise, pressing the right button while in the header but not on the window menu button usually produces a window manager menu with Quit or, for popups, Dismiss as one of its options (although an application may choose not to honor a request to remove the window from the screen). A popup may have a displayed button labeled Done or Cancel or the like, clicking on which has the effect of a Quit in addition to performing some task for the application.

To leave a temporarily unused top-level window on the screen, but have it take up a lot less screen space, either choose Close from one of these menus or press the Open key (Alt-F6 if you don't have Open) with the pointer anywhere on the window: the window is replaced by an icon, placed somewhere on the screen. To restore the window as it was, except that it will be in front whether or not it was before: with the pointer on the icon, press the right button for a menu with Open, double click the left button, or press the Open key (or Alt-F6).

For popup windows, Close is usually equivalent to Dismiss: the window is removed entirely from the screen; no icon appears for it.

In A+, a programmer can designate windows that are followers of a given window. When the window is closed, its followers will also be closed. If a window was closed in this manner, then it will be opened when its leader window is opened. So if you request that a window be open or closed, several windows may be affected.

   Drag

A window can be dragged around on the screen by placing the pointer on the frame anywhere that does not have special significance - within the header is a convenient place -, pressing the left button, moving the pointer and thereby the window to the desired location, and releasing the button. During this operation, the window will continue to be displayed in its current location, but a rectangle, the outline of the frame, will follow the mouse, so that the potential locations can be seen. Also, a small label or tag may appear that says "location:" and gives the horizontal and vertical coordinates in pixels of the location to which the upper left corner of the outline has so far been dragged.

   Resize

If a window has special corners, as do all but the middle left window in the figure, it can be made larger or smaller by the user. When the mouse pointer is moved to one of these corners, the pointer changes to a target. Then you can press the left button, drag the corner wherever you want, and release the button. The new size and shape of the window is established by the point to which you dragged that corner and the (original) location of the diagonally opposite corner. During this operation, as during dragging, the display of the window remains unchanged but a rectangle gives the outline of the potential new frame for the current mouse location. Also, a small label or tag may appear that says "size:" and gives the horizontal and vertical sizes corresponding to the current location, in characters and lines, respectively.

In one or both dimensions, you can drag the selected corner past the fixed corner, which remains catercorner to it.

   Scroll

Sometimes not all the text or other contents of an object can be displayed in it. When that happens for a dimension, horizontal or vertical, a scroll bar is displayed, an object that looks somewhat like an elevator shaft (see the window on the top left of the figure and the bottom window). At the ends, the scroll bar has anchors. Connecting the anchors is a cable, with a scroll box somewhere along the cable, (Openlook) or a channel with a slab in it (Motif). Stops may appear on the cable that restrain the scroll box from moving all the way to an end, thereby preventing the view area of the object from becoming partially or completely vacant. The relative size of the stops also indicates the proportion of the displayed object that is actually in view; the smaller the stops, the more out of view.

Pressing the right mouse button with the pointer on a scroll bar produces a menu that lets the viewer select the Openlook or Motif look or the beginning or end of the object being viewed. Any change in appearance is only for the scroll bar pointed to, so an ugly combination of vertical and horizontal scroll bars is possible.

The left mouse button is used to select scrolling operations. The top and bottom thirds of the scroll box have arrows. Clicking on an arrow moves the display one element - e.g., line of text or row of data - in the indicated direction. Pressing on an arrow causes the display to move one element at a time until the button is released. Pressing on the middle of the scroll box and dragging it, by moving the pointer toward one anchor or the other, causes the appropriate part of the text to be displayed when the button is released. Clicking on the cable above or to the left of the box moves the display back one windowful (unless an extremity is arrived at), and clicking on the cable below or to the right of the box moves the display ahead one windowful. Pressing on the cable causes successive windowfuls to appear until the button is released. Finally, clicking on an anchor causes the displayed text to include the corresponding extremity.

There is also an action for the middle button: pressing on the cable moves the display so that the middle of the middle of the scroll box moves to the arrow position.

When a user scrolls an object, other objects may be automatically scrolled with it. When a user selects a row or column, the same row or column may be automatically selected in other objects, in which the first (displayed) row or column may consequently change. More elaborate coordination may occur, such as rows with columns, or title or label changes.

   Reapportion

Some windows permit a user to reapportion the relative areas allotted to certain objects. Their special feature is movable sashes, or dividers, between objects, which allow you to control the proportion of the window that each object occupies, simply by moving the sashes. To move a sash, just place the mouse pointer on it, press the left button, drag the sash where you want it, and release the button. A small button is provided on the bottom of a vertical sash and on the right of a horizontal sash as a convenient place to locate the pointer.

The bottom window in the figure has a vertical divider, which has been used to make more of the table on the left visible at the expense of the one on the right. There are also horizontal dividers to separate panes that are stacked vertically.

   Pin and Unpin

Pinning is a facility that allows application programmers to give users the ability to influence the removal of popups. For example, suppose an application has a single commit-or-cancel popup. Normally, such a popup appears when needed and disappears after the user clicks one of its two buttons. The application program can, however, include a pin, shown on its side, unpinned, as in the popups shown in this chapter. If you prefer to leave this popup on the screen instead of having it come and go all the time, you place the pointer on the pin and click the left button, causing the pin to be shown pressed in. The application program, before removing the popup, checks to see whether it was pinned, and if so, leaves it alone. The application can also originally include a pin that is shown pushed in, allowing you to click on it and thus unpin the popup, indicating that you would like it removed.

A+ popups are programmed so that when the pin is pulled out, the popup is removed from the screen. The action is the same no matter who, programmer or user, pushed the pin in. Thus clicking twice on an unpinned pin removes such a popup.

The A+ Screen Manager

A+ provides for multiple objects within one window, each with its own scroll bars, buttons, and entry fields as required (cf. the bottom window in the figure); for convenient movement between objects within a window, and within objects; for indicating actions to be taken through option selection and button presses; and for entering and editing data (even in graphical form).

The interactions you can have with the display and the application program are:

  • selection and traversal: selecting an object or cell for choice or editing;
  • choice: choosing an action or actions, a row or rows of a table, or whatever;
  • editing: including input.
All selections and choices can be made with the left mouse button, and the three forms of editing can be initiated with the three mouse buttons. In addition, selections can also be made by pressing keys. The behavior of the mouse buttons is presented first, followed by the forms of editing and the alternative forms of selection using keys. Finally, there is a series of sections on user interactions that are special to particular display objects like graphs and pages.

The visual form of some objects, such as menus, is distinctive and therefore easily recognized in applications. In other cases objects with very different behavior look alike, e.g., buttons and selected input cells. In practice, of course, confusion is unlikely because the actual behavior of an object will be clear from context, so a comparison of visual forms of the various objects is unnecessary. The basic objects for specifying actions and editing in cells appear in the next figure.

Various Input Objects

   Selection using the Left Mouse Button

Along the top of the figure are various action objects. The object on the left with the title "Reports" is called a vertical cascade menu. The open and save items have small triangles to their right indicating submenus. Click on either item or triangle and a submenu will appear and remain visible. Any submenu item that itself has a submenu also behaves this way. Click on any item without a submenu and that action will be taken; any visible submenus will disappear as well. Click anywhere outside the currently displayed submenu and no action will be taken; once again, any visible submenus will disappear. You can also navigate the menu in the more usual fashion of putting the pointer somewhere on the menu, pressing the left button, and dragging the pointer up and down the menu items and over the submenu indicators. If things freeze up during a menu operation, try pressing the Esc key.

To the right of the vertical cascade menu are two other menus under the title "Data Selection". The top one is a simple menu, holding a set of choices but no further submenus. Click the left button on the triangle to the right of the title "Directory" and the submenu will appear. Then click on any item and it will be chosen, as well as displayed to the right of the triangle. The menu under the label "Directory" is a horizontal cascade menu; except for the top menu's being displayed horizontally, it is exactly like the vertical cascade menu.

The next object to the right is a vertical set of buttons entitled "ReCalc". Press any one of these buttons and the indicated action will be taken. The selected button may appear with a colored band around it, or, depending on the application, some other color indicator.

The next object to the right, entitled "Currency", is a check object, which allows you to select any number of items from the list. Simply click on the object or the square next to it to select it, and click again to "deselect" it. The squares appear depressed and (usually) in a different color to indicate selection.

The final object of the top row of the figure, the one all the way to the right, is a radio box. It is like a check box, except that one and only item can be chosen (as in a pushbutton radio). Check boxes always have square indicators, and radio boxes have diamond indicators.

Below the top row of action objects is an array of cells. Click on any one of them to select it, and it will appear raised. Depending on the application, it may also have a different color, and all the cells in its row may have still another color. Below that array of cells is another array of cells that differs from the first by having column labels C 1, C 2, etc. Note that no cell is selected in this table. A column can be selected by clicking on its label, and the default behavior is:

  • if there is no currently selected cell, the top cell in that column is selected;
  • if there is a currently selected cell, the cell at the intersection of the row of the currently selected cell and the selected column is selected.
The application may do something different, e.g., compute a column total.

Below the table of cells is a third variation that additionally has row labels and a corner label in the upper left. Any row or column can be selected, as well as the corner area, by clicking on its label. Selecting a column proceeds in the same way as above, and selecting a row in a similar way.

Finally, at the bottom there is an array of labelled, raised input cells. Click on a cell or its label to select it; the default behavior is for the label and cell to appear with a highlighted border.

   Choosing using the Left Mouse Button; Multiple Selection

In the above examples of arrays of cells, a single click selects an individual cell or row. Choosing must be done by double-clicking. Choosing causes a "refer" event to occur and a callback to be executed if a refer callback function was set.

There are two selection modes, single and multiple.
In single selection mode, clicking the left mouse button on a cell, with the Control or Shift key or neither held down, selects that row and cell and eliminates any previous selection.
In multiple selection mode: Control-click changes the selection status of the row pointed to; Shift-click extends a selected block to the row pointed to if that row is unselected, and reduces the block otherwise, to "deselect" the row; and click alone selects the row pointed to and eliminates any other rows from the selection. Each of these three actions has a variant, in which the left mouse button is held down and the pointer dragged, involving all the rows the pointer passes over.

   Selection using the Middle or Right Mouse Button

The cells in the arrays of the figure are input-output cells. Data can be displayed in them and users can enter new or modified data in them. An application can protect cells so that users cannot modify them. When a cell is protected, clicking on it with either the middle or right mouse button has the same effect as clicking on it with the left button, and also produces a beep. If the cell is not protected, then clicking on it with the middle or right button, besides producing the ordinary left button effect, causes one of the three input modes to be automatically initiated.

   Input

There are two input modes for cells such as those in the figure:

To enter overwriting mode initially, select the cell using the middle mouse button, taking care that the pointer is at the position where the overwriting is to begin. The text cursor is a blinking block positioned over the character to be overwritten.

To enter insertion mode initially, either: select the cell using the right mouse button, again taking care to position the pointer; or, when the cell is already selected (perhaps by use of the left mouse button), either press the Insert key to begin at the end of the current contents, or press Backspace or just start to type to delete the previous contents. The text cursor is a blinking a vertical bar at the insertion point.

An attempt to enter either input mode when the selected cell is protected will elicit a beep.

For an object of the array, command, matrix, scalar, slot, or table class, the space available for editing, in characters, is either 256 (with scrolling on entry and by use of the arrow keys) or the number that fits in the visible space. An attempt to enter too many characters elicits a beep.

Once an input mode has been entered:

  • clicking the left button when the pointer is within the input field moves the text cursor position to the pointer position, and makes the mode insertion;

  • clicking the middle button when the pointer is within the input field moves the text cursor position to the pointer position, changing to overwriting mode if the mode was insertion;

  • clicking the right button when the pointer is within the input field moves the text cursor position to the pointer position, changing to insertion mode if the mode was overwriting;

  • pressing the Insert key toggles between overwriting and insertion modes without moving the text cursor position;

  • typing Control-e moves the text cursor to the end of the cell and Control-a moves it to the beginning;

  • pressing Shift-middle-mouse-button pastes the primary selection contents at the pointer position;

  • pressing the left and right arrow keys or Control-b and Control-f moves the text cursor within the field;

  • pressing the Enter key ends input, meaning that the present contents of the edit area become the contents of the cell;

  • pressing any of the following keys ends input and selects a new cell as indicated: the Tab key (usually) selects the cell to the right if one is there; the Shift-Tab the cell to the left; and the up or down arrow key the cell above or below, respectively, if there is no appropriate line in the present cell;

  • pressing the Esc key ends input mode and returns the contents of the cell to what it was before, but does not select another cell.

For the command and text classes, the cursor attribute describes the text cursor position, as the number of characters from the left. It is 0 when the object is not in input mode. Its vector value for the page display class is described in "
Page Objects".

An attempt to enter erroneous input (by pressing Enter, Tab, etc. with an illicit entry in the cell) elicits an error message; the input mode and the cell remain as they were, to permit the entry to be corrected.

   Clipping Text

A+ provides facilities that allow application programmers to permit users to employ the primary selection buffer. If so enabled, a user can insert Emacs or XTerm text in a displayed object, and can also clip text from a displayed object and insert it in an Emacs or XTerm window. If an application uses these facilities, its documentation should describe the procedure for copying or cutting and pasting text.

   Selection and Traversal using the Meta-Tab Keys

The visible sign that an object has been selected is a highlight line around it, usually yellow. When the currently selected window was first selected, some object within the window may or may not have been selected. Pressing Meta-Tab or, on an IBM keyboard, Alt-Tab will select a new object if one has been selected, or the first selectable object if not. The selection order is determined by the application, and repeatedly pressing Meta-Tab selects the objects in that order. To select the previous object in that order, press Shift-Meta-Tab or, on an IBM keyboard, Shift-Alt-Tab. Note that the pointer is not moved to reflect the Meta-Tab selections.

Not all selectable areas can be selected with Meta-Tab or, on IBM, Alt-Tab, nor can you always know beforehand the ones that can. For example, in the figure, pressing Meta-Tab repeatedly will (most likely):

  • select all the action items along the top row in some order;

  • at some point select any of the arrays of cells entitled "Array of Cells", "Table of Cells", or "Matrix of Cells". When one of these arrays is selected, a raised cell within it has keyboard focus, meaning that any character key presses will be directed at it;

  • at some point select just one of the labelled cells in the array entitled "Array of Labelled Cells", or, depending on how the application was designed, select them all, one by one.

   Selection and Traversal using the Tab, Arrow and Page Keys

Once an array of cells like those in the figure has been selected using Meta-Tab and Shift-Meta-Tab (Alt, not Meta, on IBM keyboards), a cell within it is selected with the Tab, Shift-Tab, and arrow keys. Arrays of labelled cells like the one entitled "Array of Labelled Cells" in the figure, however, are an exception. If the application is designed so that Meta-Tab traverses all the labelled cells, then the Tab, Shift-Tab, and arrow keys have no effect here. However, if Meta-Tab selects only one labelled cell, then when that cell is selected, the Tab, Shift-Tab, and arrow keys can be used to select one of the other labelled cells.

When keys are used to select a cell, any required scrolling is done automatically, and if no movement is possible in a given direction, the action of the corresponding key is null.

The PgDn, PgUp, End, and Home keys can be used in the usual ways to move the view window over a partially visible array of cells.

When a horizontal menu has focus, the left and right arrow keys move you across the menu. For a vertical menu, and therefore all submenus, the up and down arrow keys move you up and down from one item to another. Movement into an item with a submenu causes the submenu to appear; there is no need for a further down arrow or right arrow. For a set of choices like the one labeled "Directory" in the figure, the down arrow leads to the menu of choices. Press the Enter key when the selected item is an action item to have that action taken; any visible submenus will disappear.

Items on a menu or submenu can also be selected by pressing the keys for the underlined characters. If the item is an action item, the action will be taken and any visible submenus will disappear; if the item has a submenu, it will appear. If two or more items in the same menu or submenu have the same first letter or underlined letter, pressing the key for that letter references the topmost, or leftmost, item. The other items with the same first or underlined letter cannot be referenced in this way. This method can be intermixed with the use of arrow keys.

   Deleting and Inserting Rows

If the action is enabled, Meta-Delete or, on IBM keyboards, Alt-Delete deletes the selected row from an array of cells.

If the action is enabled, Shift-Meta-Insert or, on IBM keyboards, Shift-Alt-Insert inserts a new row above the selected row. If the action is enabled, Meta-Insert (or Alt-Insert) inserts a new row below the selected one.

The row attribute is unchanged if possible. When a row is deleted, the next row becomes the selected row, except that if the last row is deleted the new last row becomes the selected row. A row inserted above the selected row becomes the selected row.

   Interactions Peculiar To Individual Display Classes

Table Objects

If the application permits, a user can change the width of a column in a table. When the pointer is over a column separator it changes to a two-headed horizontal arrow. Pressing the left mouse button causes a green outline to appear around the column to the left. As the pointer is moved, the right side of the outline moves and becomes white whenever it is not at the current separator position. When the button is released, the column fills the outline and columns to the right of the one whose size was changed are moved accordingly.

If the application permits, a user can move columns within a table. When the pointer is over a tableField or its title area, pressing Meta-left-mouse-button (Alt-left-mouse-button on IBM keyboards) causes the pointer to change to a two-headed horizontal arrow and the column to be covered by an image of the column and title area, with a yellow outline. As the pointer is moved, the image moves horizontally. When the button is released, the column is moved past any columns between the image and its original location, and the table variable is respecified accordingly. If the new location is the same as the old, no respecification of the table variable takes place. (Actually, you can use any mouse button for this operation and you can press Control at the same time if you are so inclined; indeed, you can press several mouse buttons simultaneously and the drop will take place when the last button is released.)

Password Objects

These objects provide password protection to applications. They look like the labelled cells in the figure. Input is started only by selecting the object and pressing a key (insertion, although there is no initial text), and it is completed by pressing Enter. Input characters are masked, usually by *'s, and the pointer is positioned to the right of the last * unless you move it.

Hscale and Vscale Objects

A user can change the settings of hscale or vscale objects using the mouse buttons and the Home, End, Page Up, Page Down, and arrow keys.

When the pointer is anywhere in the object:

  • Pressing Home moves the slider to the left or top and sets the value to min or max; pressing End moves the slider to the right or bottom and sets the value to max or min. (Because of the conflict between text conventions and axis and scale conventions, the same key changes the variable value oppositely in the horizontal and vertical cases.)

  • Pressing Page Up increases the value by an amount that is controlled by the application; the default is ten. Pressing Page Down decreases it by the same amount.

  • Pressing up-arrow or right-arrow increases the value by an amount that is controlled by the application; the default is one. (Either key works for both classes, horizontal and vertical.) Pressing down-arrow or left-arrow decreases it by the same amount. Holding an arrow key down causes its action to be rapidly repeated, after a slight initial delay.
When the pointer is in the slider slot but not on the slider:
  • Pressing the middle mouse button moves the slider to the pointer location.

  • Pressing the left button when the pointer is on the high side of the slider has the same effect as pressing up-arrow or right-arrow, and when on the low side as pressing down-arrow or left-arrow.
When the pointer is on the slider:
  • Pressing the left mouse button and moving the pointer drags the slider along in the slot.
When the pointer is on the value label:
  • Pressing the middle or right mouse button initiates editing, in overwriting and insertion mode, respectively.

Scalar Objects

Editing has two peculiarities in this class, both involving the left mouse button. Clicking on the value area causes editing to begin, in insertion mode. Clicking twice on the value area causes editing to begin if it was not under way, the value area to be shown in reverse video (double-clicking again will not undo reverse video), and insertion mode to be entered: the next keystroke (if not Esc) will delete the entire present contents.

Text Objects

These objects provide a general means for text entry; they can be used whenever a note pad is needed in applications. To enable input, you need only select the object and begin typing. The only input mode is insertion.

The arrow keys move the text cursor, and it can be placed anywhere in the text by moving the pointer to the desired location and pressing any mouse button. Text can be expunged using the Delete and Backspace keys. Press Enter or Linefeed to create new lines during text entry, which are reflected in the underlying character vector by newline characters.

The workspace value of the vector is not automatically modified as you edit the display. Unless the action is inhibited by the application program, pressing Control-s causes the vector to be updated to match the text that appears on the screen - or can be made to appear with the scrollbars.

Page Objects

These objects provide formatting of page-based and record-based real-time market data. An application program can provide text entry and editing for these objects in any form. When you click any mouse button anywhere on the page, the position of the mouse pointer is recorded in the cursor attribute, as number of rows from the top and number of characters from the left.

You can create a rectangular outline of a page segment of particular interest, which is transmitted to the application for whatever use it may make of it. Press the left mouse button to establish one corner and move the pointer and release the button to establish the opposite corner. The original corner will start at the top left of the nearest character (which may be blank). During the operation the box that will be transmitted if you release the button is continuously shown.

Tree Objects

Hierarchical data can sometimes be conveniently displayed in a tree object. For example, the items in the cascade menus in the figure are shown as a tree in the next figure. One of the items in the display has been selected, as indicated by the reversed yellow and red. An item is selected by clicking on it with the left button. Once an item is selected, the arrow keys can be used to navigate through the items, changing the selected item as you go. To inform the application of your choice (by triggering a callback): double-click on a selected item or press Enter when an item is selected.

A Tree Object:

Notebook Objects

Clicking the left mouse button on a tab causes the associated page of the notebook to be shown and the current one to be hidden. If not all tabs are shown, the list of tabs can be scrolled up by clicking or pressing the left mouse button on the arrow above the list and down by clicking or pressing on the arrow below the list.

Graph Objects

There are a variety of interactions with graphs to customize the display, edit and manipulate trace data, perform detailed examination of traces, and navigate through graphs that are only partially displayed.

The graph in the next figure shows a smooth trace, a data point on that trace that has been modified by the user (the one for May), a line trace that has been added by the user (above the smooth trace for Jul-Sep to Jan), and a text annotation that has also been added by the user. Note that the dashed, curved line above the modified data point for May does not ordinarily appear after a data point is modified.

A Graph Object:

   Text Traces

The labels on graphs may be text traces that can be manipulated by users, if allowed by the application:

  • Select a text trace:
      Place the pointer on the text trace and double-click the left button; the trace will appear in reverse video (the color will change) and nodes will be shown, and the pointer will become cross hairs.
  • "Deselect" a text trace:
      Double-click the left button anywhere on the graph background.
  • Reposition a text trace:
      Drag the selected text trace with the left button to the new position and release the button.
  • Copy a text trace:
      Press and hold the Shift key before dragging the selected text trace to the new position. Release the Shift key after releasing the mouse button.
  • Delete a text trace:
      Press Meta-Delete or, on IBM keyboards, Alt-Delete to delete the selected text trace.
  • Create a text trace:
      Press and hold the Meta key (Alt on IBM keyboards) and then click the middle button. A text area appears with its lower left corner located at the pointer. All normal text-editor keys (arrow keys, Backspace, Delete, etc.) are available. If the length of the entered text exceeds the editor width, the text is scrolled to the left. Press the Enter key to define the text trace. The trace will be positioned at the same lower left corner as during editing of the text. Press the Esc key to discard the entered text and the new text trace.
  • Edit a text trace:
      With the pointer positioned anywhere on a text trace, press and hold the Meta key (Alt on IBM keyboards) and then press the middle button. The text editor is invoked with the pointer located at the position of the pointer. The procedure is the same as for creating a text trace. Press the Enter key to replace the original text. Press the Esc key to discard the modifications and close the editor.

   Legend Placement

The graph legend can be moved:

  • Select the legend:
      Position the pointer on the legend and double-click the left button. It will appear in reverse video.
  • Move the legend:
      Drag the selected legend with the left button to the new position and release the button. The legend may be outside the axis area and its movement may be constrained to be either horizontal or vertical only.
  • Release the legend:
      Position the pointer in the graph, but not on the legend, and double-click the left button.

   Line Traces

The line segments on graphs may be numeric traces that can be manipulated by users, if allowed by the application:

   Data-Point Move

For line, scatter, linescatter, and bar graphs, the data points of a (not necessarily selected) trace can be interactively repositioned, if allowed by the application. A data point is moved by pressing the right button while the pointer is positioned on or near a trace-data point. If it is near enough, cross hairs appear (for line style traces, line segments appear between adjacent points), with a box to indicate the x- and y-coordinates. Moving the pointer, while continuing to depress the right button, repositions the data point at the location where the button is released. Depending on the application, the movement of the data point may be constrained to the vertical or horizontal direction.

   Scan X

The scan-x feature enables detailed analysis of the trace data by displaying the numeric value of each trace point as the pointer is swept horizontally across the graph. Pressing the middle button draws a vertical line at the pointer location, and displays a y-value for each trace in the legend window and an x-value in a box which appears at the other end of the pointer. For high-low style traces, the legend window is further expanded to show component values. The xy-values appear in the same format as the corresponding axis labels.

As the line is moved across the screen, the displayed values change. When the line intersects the traces, the x-value and y-values are updated in a discrete fashion; for each trace, a y-value is shown for the data point directly to the left of the line; the x-value that is displayed is the one that corresponds to the displayed y-values for the last trace set in the definition of the graph variable. When the data for a trace gives values for x in an order that is not increasing, however, the trace is considered by s to be overlapping, and then the y-values are not shown and if it is the only trace the x-values vary continuously; even if the values for x for the trace are respecified, it continues to be considered overlapping.

When the pointer is in an area outside the range of the x-values, the displayed x-values vary continuously and y-values are not shown. If the legend is not shown when the middle mouse button is pressed, the scan-x box will be empty: it will not display x coordinates.

   Scan XY

The scan-xy feature is a variation of scan-x. Pressing the Control key and then pressing the middle button draws cross hairs intersecting at the pointer location and shows the x, y values in a new box near the intersection of the cross hairs. The Control key can be released once the cross hairs appear. The displayed x- and y-coordinates vary continuously as the pointer moves.

   Zoom

The zoom feature allows the user to focus on a particular region of the plot area by pressing the left button to outline a region of interest. A rectangle is drawn with the origin at the point where the button was initially pressed and the diagonally opposite corner at the pointer's present location. Upon the release of the button, the graph is redrawn to include just axis values falling within the rectangle coordinates.

If, when the button is released, the pointer is outside the graph object or very near the point where the button was initially pressed, zooming does not take place.

Further zooming is possible, in order to further refine the view.

When a graph is "zoomed," the user can scroll the unseen parts of the graph into view with the arrow keys.

Zooming is undone by double-clicking the left button on the background of the graph.


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_51.html0000444000265000001440000002324110737165245013647 A+ Reference: Invoking A+

Invoking A+


Invocation From the Shell; Environment

   From Within an Emacs Session

If you start an Emacs session by selecting Emacs/A+ from the main menu, A+ can be invoked within it (with the resulting buffer in a-mode) by pressing the function key F4. When in Emacs, you can modify the effect of the F4 key by entering Control-c a.
        Concurrent Sessions
You can run several Emacs A+ sessions concurrently. You can run A+ in several concurrent Emacs sessions. Moreover, to run concurrent A+ sessions within a single Emacs session, after starting one A+ session, you can rename it by pressing Escape x and entering M-x rename-buffer newname,  then perhaps change to another release using Control-c a, then start another session by pressing F4, then perhaps rename that session and start another one, and so on.

   From a Shell Command Line

A+ can also be invoked from a shell command line, by a+ [options] [script [args]],  where the meaning of the parameters is as follows. The PWD (environment name) environment variable is set on startup.

If you want to suppress all error reports (messages to stderr) for the session, you can put 2>/dev/null at the end of the shell command line.

        Examples
/usr/local/bin/a+
Invoke A+ using all of the defaults (the default workspace size is 1 MB, or 220 bytes.)
/usr/local/bin/a+ -w 100
Invoke A+ with a 100MB virtual workspace.
/usr/local/bin/a+ -d workstation-name:0.0 graphit expertlevel
Invoke A+ with the environment variable DISPLAY set to workstation-name:0.0, and load the script named graphit with the parameter expertlevel. The value of _argv in the A+ session will be ("graphit";"expertlevel").

A+ uses the search rules described for $load to find the application script graphit. The rules are based on the environment variable APATH. The default setting of APATH is:

.:/usr/local/aplus-fsf-n.nn/lib

APATH is automatically set by A+ on startup and its value is derived from another automatically set A+ environment variable, ATREE. If either if these environment variables exist prior to starting A+ the existing values are used.

It is very important for these variables to be set correctly and it is recommended that A+ set them. If set incorrectly, the wrong versions of s and adap will be loaded.

If customization of APATH is required, it is recommended that it is done after A+ has started:

sys.setenv{"APATH=/look/here/first:",sys.readenv "APATH"}
Correct commands:
sys.system{"unset APATH ATREE;/usr/local/bin/a+"}
$(unset APATH ATREE;/usr/local/bin/a+)

Note: When an A+ process initiates a second A+ process, the second process inherits the value of ATREE and APATH from the first, even if the process is detached. To avoid this, do, e.g.,
sys.system{"unset ATREE APATH;/usr/local/bin/a+"}
or
$(unset ATREE APATH;/usr/local/bin/a+)

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_52.html0000444000265000001440000002543410737165245013656 A+ Reference: The Emacs Programming Environment

The Emacs Programming Environment


This chapter gives the standard A+ key settings and a brief summary of some Emacs functions. See an Emacs manual for more advanced Emacs functions. "The Window Manager", in "User Interactions with Displays" is also relevant to Emacs, and so is "Invoking A+".

Key Press Notation

C-x
Hold down Control, then press x.

C-x C-b
Hold down Control, then press and release x, then press b.

C-x k
Hold down Control, then press x, then release both, then press k.

Emacs Key Functions

Key SequenceFunction
BackspaceDelete the previous character.
C-/  or  UndoUndo. Used immediately after entry of an A+ expression, removes its output.
C-aMove the cursor to the beginning of the line.
C-dDelete character. Also see Delete.
C-eMove the cursor to the end of the line.
C-gCancel the partial entry in the minibuffer.
C-hHelp.
C-kKill line: delete line or part thereof and put it in the kill ring. See C-y.
C-rIncremental search backward.
C-sIncremental search forward.
C-x  C-bList information about all current buffers.
C-x  C-fGoto file: get the file (named in minibuffer) in a new buffer.
C-x  C-sSave the buffer in the file named on the status line (usually where it originally came from).
C-x  C-wSave the buffer in the file whose name is entered in the minibuffer (command line).
C-x  kKill (delete) the buffer.
C-yYank: insert the last entry of the kill ring. See C-k.
DeleteThe default is to delete the previous character (sigh), but it can be set to the command delete-char using global-set-key.
R1  or  F5Show one window in the screen.
R2  or  F6Show two windows in screen; if there are two, move the cursor to the other window.
R3(No function set.)
R4  or  F7Next buffer (cycle through buffers).
R5  or  F8Previous buffer (toggle buffers).
R6Go to (enter line number in minibuffer).
R7Top: the first line of the buffer to the top of the window.
R8  or  F11Move the cursor up one line.
R9Scroll up to earlier lines, with a two-line overlap.
R10Move the cursor backward one character.
R11Center the line with the cursor in the window.
R12Move the cursor forward one character.
R13End: move the cursor to the end of the buffer.
R14  or  F12Move the cursor down one line.
R15Scroll down to later lines, with a two-line overlap.

Emacs A+ Mode Key Functions

Key SequenceFunction
C-c  C-bLoad buffer. Like loading a script file, but without the need to save the buffer.
C-c  C-cInterrupt the A+ process. (From a shell, not Emacs, A+ is interrupted by a single C-c.)
C-c  C-kKill (terminate) the A+ process. If this doesn't work, try kill -9 pid in an XTerm.
C-c  C-m  or  C-c  EnterGet the previous input line.
C-c  C-oKill (flush) the last output, and append " output flushed " to the input that elicited it.
C-c  C-pGo to the last input line.
C-c  C-qQuit the A+ process.
C-c  C-sMove the beginning of the last output to the top of the buffer and place the cursor there.
EnterIf the cursor is on the bottom line, execute that line;  otherwise, send the current line to the bottom, for possible editing and execution.
Ignore leading asterisks and any blanks following them, presuming that they indicate suspension or unbalanced punctuation, and the prompt; not exponentiation, or asterisks and blanks within a quoted character string.
F1Help.
F2Load and execute line (in the A+ log, like Enter Enter).
In the log, but not in a script, ignore leading asterisks and any blanks following them, presuming that they indicate suspension or unbalanced punctuation, and the prompt; not exponentiation, or asterisks and blanks within a quoted character string.
F3Load the program (function or operator) in which the cursor appears, in a script or the log.   Caution: The program is read exactly as it appears, including any asterisks indicating continuation in an A+ session log, which will not be interpreted as such.

For F3, the buffer must be in a-mode. To set it, enter   Esc-x  a-major-mode.

F4Go to the buffer named "*a*" if it exists, or create one, and start up A+ if that buffer has no process. The release can be set in Emacs by Control-c a, as described at the beginning of "Invoking A+".
F5Show one window in the screen, the one the cursor is currently in.
F6Move to the other window in the screen, creating it if it doesn't already exist.
F7Next buffer (cycle through buffers).
F8Previous buffer (toggle buffers).
F9Enlarge the window.
F10Shrink the window.
F11Scroll down to later lines, with a two-line overlap.
F12Scroll up to earlier lines, with a two-line overlap.

The Meaning and Default Values of Emacs Lisp Variables

VariableMeaningDefault Value
a-hostThe name of the host machine on which to run A+. nil
a-logThe name of the log file for A+ sessions. "~/.emacs_a"
a-mbytesThe starting workspace size in megabytes.4
a-mbytes- thresholdThe largest a-mbytes value to be honored without a question.16
a-plus-rest Additional argv elements, to go after the -w parameter.  
a-prog The name of the A+ program (release) to run; see "Invoking A+", regarding the form that A+ release names take. "/usr/local/bin/a+"

To see or set the A+ mode (a-mode) Emacs variables, press Esc x when in Emacs, and enter a-options in the minibuffer following the M-x prompt. A new buffer will appear, containing a three-line paragraph for each variable and empty comment lines (two semicolons, followed by blanks) in between. "Key Definitions in a-Options Buffer" shows special key definitions in this buffer. When done, the buffer need not be saved; simply press Control-x k.

Key Definitions in a-Options Buffer

KeyDefinition
or  spaceMove to the next variable definition.
pMove to the previous variable definition.
sWhen the active line contains a variable value, move the active line to the command line (minibuffer) and prompt for a new value. Note that the quotes must be included in character values.
xToggle the value of the variable between the boolean values t and nil.
1Set the variable to boolean value t.
0Set the variable to nil.


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_53.html0000444000265000001440000004530410737165245013655 A+ Reference: Workspaces and Scripts

Workspaces and Scripts


Parsing Rules for A+ Script Files

A+ script files are parsed from top to bottom when loaded, and all unresolved names are assumed to be variables. For example, suppose the following two lines appear in a script, in this order:
f{x}:g  x
g{y}:y,' '
When this script is loaded, the definition of the function f is parsed before that of g, and therefore g is assumed to be a (global) variable in the definition of f, and the symbol is taken to be the dyadic primitive. Then the definition of g is parsed and it is determined that g is a function. When f is evaluated, a type error results because the dyadic primitive is passed a function as a left argument.
     f`abc
 : type
*     x         Inquire about x
 `sym            It's a symbol.
*     {g}
 `func           But g is a function.
*     
This problem could have avoided by defining g before f. In general, however, and certainly in large applications, it is not reasonable (and sometimes not possible) to maintain scripts so that functions are always defined before they used. The problem could also be avoided by using the alternate function-call syntax; in the above example:
     f{x}:g{ x}
Now the A+ process can tell from the syntax that g is a monadic function, whether or not it has been defined. This syntax is unambiguous, whereas that of f in the original definition is ambiguous.

Workspaces

   Expression Continuation in Entry and Function Definition

When an expression, expression group, or function definition is entered on several lines in an A+ session, A+ supplies stars at the left of each line to indicate the depth of punctuation. In general, these stars are used to indicate the total number of open quotation marks (at most one), braces, and parentheses, and an expression or function definition remains open until they are closed. Brackets are not treated in this way, however, and in the absence of an open quote, brace, or parenthesis a line or series of lines with an open bracket elicits an error message. Pressing the Enter key while inside a quotation mark inserts a newline character in the quoted string, but pressing Linefeed causes A+ to ignore all entries on the current line that follow the open quote (including the Linefeed itself).

If any brackets, braces, or parentheses are open when a function definition is closed, a token error is reported and the definition does not take effect. At the time when such punctuation becomes isolated (e.g., after the closing parenthesis for the bracket in (3 4;bd[1;3)),  a message "Mismatched parentheses" (no matter what the punctuation - brackets, braces, or parentheses!) appears at the bottom of the screen in Emacs.

The expressions case(target) and if(condition) and while(condition) are each followed by an expression or expression group in actual usage, but they are considered by the parser to be complete (with a Null as the following expression) when they are followed by the Enter, so don't break a line there unless you have something else holding the expression open, and don't immediately follow an if(condition) with an else with the intention of returning and filling in the if action unless you are very sure you won't forget.

Function definition has one continuation peculiar to itself: if the Enter key is pressed immediately after the colon following the function header, the function definition remains open, for just one more line (unless that line produces a continuation). If anything, however, even just a space, is entered after the colon, then there is no implied continuation. In particular, if only spaces are entered after the colon, a parse error is reported and the opening of the definition has no effect.

   Expression Groups for Immediate Execution

In immediate execution, when there is no pending punctuation or function definition, several expressions can be entered on one line, separated by semicolons. They will be treated as an expression group. The next section discusses the implications of this treatment for display.

One useful aspect of this treatment is that one can bring into the workspace for immediate execution a script line which is only part of an expression group. Putting it another way, an expression group or part thereof can be brought in and executed immediately as long as its punctuation is matching - as long as it contains either both or neither of the group's enclosing braces.

An expression in braces, with no semicolon, also constitutes an expression group.

   Immediate Execution Display

When an expression or expression group is entered for execution, by pressing the Enter key, an error message may be displayed. If it is not, then the result is displayed, except that it is not displayed for an expression whose last operation is Assign.

The display of the Null is indistinguishable from no display, so in effect the displaying of the result can be suppressed for an expression or expression group by appending a semicolon to it, making the expression a courtesy expression group. Likewise, display can be forced for an expression alone on a line, even when it ends with Assign, by preceding the expression with a semicolon. (Preceding such an assignment in immediate execution by a , thus applying Print to it, causes it to be displayed twice, once by Print and once as the default display of an expression whose last function is not Assign.)

For function and dependency definitions, there is no additional display: the entered definitions, together with the A+ prompts indicating depth of punctuation, are the entire displayed response.

   Default Display of Arrays

Arrays are listed in ravel order. Simple character arrays start at the left margin. Simple numeric arrays are indented one space. Numbers that are in columns in the display are aligned. Simple vectors are displayed horizontally. Simple arrays of higher rank are displayed with vertical columns, horizontal rows, one skipped line between cells of rank 2, an extra skipped line between cells of rank 3, and so on. For example:
     2 2 2 6
  0  1  2  3  4  5
  6  7  8  9 10 11

 12 13 14 15 16 17
 18 19 20 21 22 23


 24 25 26 27 28 29
 30 31 32 33 34 35

 36 37 38 39 40 41
 42 43 44 45 46 47
A < is used for a function scalar, since it must always be shown as an enclosed function expression. Furthermore, vectors of function scalars are displayed vertically. For example:
     <{+},<{-},<{=}
<  +          Vector displayed vertically, with < showing enclosure of the
<  -          function expressions, to make simple, depth-0 function scalars.
<  =

Each nested component of a nested array begins on a new line. A < character is used to indicate the beginning of an enclosed object. It is also used sometimes to indicate a symbol, as shown above, but it is not so used in this manual except for that example. For instance:

     (1 2 3; 2 225; (3 4;2 3;<<100))
<  1 2 3
<  25 25
   25 25
< <  3 4
  <  0 1 2
     3 4 5
  < < <  100

   Resuming Execution

When execution of a expression or function has been suspended because of an error or an interruption, expressions can be entered for immediate execution. (The expressions may include calls of other functions and may lead to suspensions of their own.) Values, shapes, types, etc. of both global variables and ones local to the suspended function may be examined and changed. The arguments on the stack (&0 &1 ...) can also be examined and changed. (Changing variables which were arguments to the suspended function has no effect on the stacked arguments.)

To resume execution of the suspended function, with the workspace size increased if necessary, enter
     
alone on a line.

To abandon execution, and execution of any pendent function that is waiting on this suspended function, enter either
     
or
     $
alone on a line.

To abandon execution of the last n suspended functions, enter
     $reset n
and to abandon execution of all suspended functions, enter just
     $reset
See the
Reset command.

   The Form of Error and Other Messages

Error reports are prefixed by a comment symbol and the type of report in brackets, to make it more explicit and also to prevent it from spoiling a part of a log that would otherwise be usable as a script:
     3+05-5
[error]  : domain
[error]  segv
and
 PKG: 1: Storing .two      See the package example.
There are, however, some error messages that are not in this form, none of them strictly A+ error messages. Among them are
filename: No such file or directory
not an `a object
and a great many messages from adap.

   Contexts

To help in avoiding name conflicts, A+ provides contexts. A context provides a level of qualification for global names. The fully qualified form of any global name is c.x, where x is the unqualified name of the object and c is the context for that name. Every name is accessible from every context by the use of its fully qualified form.

The workspace always has one current context. Initially, at the beginning of an A+ session, it is the root context, whose name is the empty string. So .y is the form that a fully qualified name takes in this context. Such a name always refers to the root context. The current context can be changed by  $cx cxt  as discussed for the Context command; by convention, $cx .  is used to change the current context to the root context - i.e., the context name is given as a period. In an expression entered for immediate execution, any unqualified name, no matter what its use - reference, specification, call, definition -, is understood to be implicitly qualified by the current context. Thus unqualified names can be used for objects whose full names are qualified by the current context.

A function also has a context. If a fully qualified name was used for it in its definition, then the context is the one referred to in that name; otherwise, the function's context is the one that was current when it was defined (and indeed, its fully qualified name includes the name of that current context). All unqualified global names within a function are implicitly qualified by the function's context; the context in which the function is executed is irrelevant to their interpretation. When a function is suspended, the context for immediate execution is the function's context. If the context is changed while a function is suspended, resumption of execution will automatically change the context back. Completion of execution returns the context to what it was when the function was called.

   Local and Global Names

To avoid clutter in the workspace and to reduce the possibility of name conflict, a name can be local - i.e., have meaning only in the function in which it occurs and disappear when execution of that function is complete. Such a name must be unqualified, and it is made local by an Assignment within the function in which only the name appears to the left of the arrow. All qualified names are global. See "Scope of Names".

A function can see only global names and its own local names. A user can see only global names and the local names of the latest suspended function (and not pendent ones).

   Visible Use of a Name

A visible use of a name occurs when the name appears in A+ code directly, and not in a character string or a symbol. A use that is not visible is an implicit reference, which occurs through the employment of Execute () or Value (%). This distinction is important for dependencies, which are invalidated only by visible uses of names (cf. "Dependencies", especially "Evaluation" and "Dependencies Defined").

   Listing Names

System commands and system functions are provided for listing names of various kinds in the workspace:

   Reporting the Environment in the Active Workspace

A number of system functions and commands are available for inquiring about the active workspace:


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_54.html0000444000265000001440000016662310737165246013667 A+ Reference: Interprocess Communication: adap

Interprocess Communication: adap


The adap context is native to A+; there is no need to load adap. "idap.+" is loaded automatically when the interpreter is started. idap.+ installs backward-compatible behavior on top of the automatically loaded i context, which uses the MSIPC class of MStk.

DAP (Distributed Analytics Platform), a set of tools supporting interprocess communication, has been used extensively in non-A+ applications. The functions in the adap context are a layer on top of DAP, providing application writers with the means to:

Both asynchronous and synchronous interactions are supported. In asynchronous interactions using the A protocol (cf. "Protocols for Sending and Receiving Data", and especially "The A Protocol"), both single and burst modes are supported. These tools are in the adap context, which is always available in an A+ session.

Interprocess Communication

Communication based on adap is carried out between two processes - A+ processes or not - , but not directly among more than two. The mode of communication can be either synchronous or asynchronous. In synchronous communication, one partner sends a block of information to the other and is blocked from further action until it receives a response. In asynchronous communication, one partner sends information to the other and then simply goes about other business; if there is a response to what was sent, it is processed whenever it arrives. Thus one partner might send several independent requests, each requiring a response, before the response to any one of them is received. When one process is communicating asynchronously with several others and receives messages from more than one of the them, there is no guarantee that they are received in the same order they were sent. Only this is certain regarding the order of events in asynchronous communication: if a process sends more than one message to one particular partner, the messages will be received in the order in which they are sent.

At first thought, synchronous communication may appear to be somewhat easier to manage than asynchronous, but in general it is not, and it is of less general use. Synchronous communication can be used most effectively when one partner has nothing else to do but wait for the response from the other. Likewise, asynchronous communication may appear to be more complicated because messages are processed whenever they arrive, and there is no way to know when the arrivals will occur, or - when there is more than one source of messages - in what order. However, adap's way of managing asynchronous communication, namely events and callback functions, is quite straightforward.

The rules for interprocess communication are strictly up to the partners. It can be agreed that one partner always processes requests from the other; that either partner can initiate a request of the other; that either partner can send a message at any time; that not all requests require a response; and so on.

Establishing a communication channel is not a symmetric procedure; one partner is designated to listen for the other, while the other attempts to connect to the listener. The listener initiates its end of the communication channel by executing adap.Listen. The other partner executes adap.Connect. For convenience they will be called the listening partner and connecting partner, respectively. In principle, it doesn't matter which partner happens to go first1. If the listening partner goes first, the effect of executing adap.Listen is to continually listen for connecting partners; if the connecting partner goes first, the effect of executing adap.Connect is to continually attempt a connection until the listening partner starts listening. Once both partners have attempted to establish communication, the communication channel is formed.

Even though the listening partner continues to listen and the connecting partner continually attempts to connect to its partner until successful, both adap.Listen and adap.Connect return immediately after being executed, for otherwise the partners would not be free to do other work. The status of the underlying listen and connection attempt are monitored with callback functions on adap events.

The asymmetry in establishing communication is also reflected in the fact that the connecting process can link up with only one partner for each execution of adap.Connect, while the listening process can link up with many partners with just one execution of adap.Listen. Executing adap.Listen causes a listening port to be established, which remains open to receive connecting partners until the listening partner shuts it down. Executing adap.Connect causes a connecting port to be established, over which the connecting partner continually tries to connect to one and only partner, until either it is successful or the connecting partner shuts it down.

   Client-Server Communication

Client-server communication is an important, commonly used mode of communication. It is the mode by which one partner, the client, typically takes the lead in communication with a server, by specifying the services to be performed; the server is the passive partner, waiting for requests from clients before taking action.

The server may provide a common service for many clients, such as real time data access, or a dedicated service, such as data base access and analytic computations. In the former case the server is the listening partner because of the one to many nature of its service; it is probably started automatically by some means of the operating system, and is always available. In the latter case, the client-server model may be used simply for load balancing; the server may actually be started by the client, and may be the connecting partner.

   Callback Functions and Events

An event is an asynchronous change in the state of an application which can trigger an action by the application. There are two classes of events that are of concern in adap applications, interprocess communication events and timer events. Interprocess communication events mark significant changes in the communication state between processes, while timer events mark time interval expirations. The means by which an application program takes action is a callback function, which is automatically called when the event takes place.

For example, when a client requests a connection to a server, a callback function in the server application is automatically invoked so that the server can register the client. When a message from the client to the server is ready to be received, a callback function is automatically called so that the request can be processed. Similarly, when the message sent back to the client is ready to be received, a callback function in the client application is automatically called. In this manner a server can process random, or asynchronous, requests from clients, and a client can continue with other tasks, but still process responses from servers as they arrive.

Interprocess communication events fall into several categories, called event types. For example, the receipt of a message from a partner is an event of type `read. The callback function for the receiving partner's service handle (which identifies the connection) is called with arguments identifying the event type and the partner that the message is from. There is a small, fixed set of event types in adap (see the table "adap Asynchronous Interprocess Communication Event Types"); typically a callback function consists of a single case statement with a case for each type.

Callback functions are established for the partners when they call adap.Connect and adap.Listen. All adap callback functions have three arguments, and their meanings are always the same:

  CallBackFunction{service_handle;event_type;call_data}
In interprocess communication, service_handle, which is a scalar integer, is the means by which communicating partners identify one another (see "Service Handles"); event_type indicates the general class of the action that caused the callback to occur (see table below); and call_data holds data associated with the action (see table below). In the case of event type `read, the associated message is call_data.

adap Asynchronous Interprocess Communication Event Types
(Callback Function CBF{service_handle;event_type;call_data})
Event TypeDescription And Action To Be Taken
`choose A choose event occurs when only `name is specified in a service descriptor argument to adap, and more than one service has a matching service name. In this case call_data is a vector containing a complete service descriptor for each matching service. The result of the callback function should be one of these service descriptors. Note: it is not always useful for a callback function to produce a result, but in this case it is.
`connected A connected event indicates to both the listening and connecting partners that a connection has been made. For example, a server would typically add the client identified by service_handle to a list of clients and perhaps perform some initialization, while a client would start off the client-server communication by sending a message to the server.
`error An error event indicates that something has gone wrong from which adap cannot recover. Unlike the reset event (see below), it is left to the application to recover from an error event: to call adap.Close on the handle and then either to restart if possible or to terminate gracefully. No attempt is made to qualify the type of error that occurred.
`read A read event indicates that a complete message has arrived from the partner identified by service_handle, i.e., the entire message sent by the partner with one call to adap.Send has arrived. The data, i.e., the contents of the message, are in call_data. In burst mode (in the A protocol), all pending complete messages from the same service handle are included in call_data, each as an enclosed element; see rEventMode.
`reset A reset event indicates to either partner that the connection between the pair has been broken, either by the partner closing his end of the connection, or by a recoverable system error. For example, a server would typically remove the client indicated by service_handle from the list of clients it is processing and close that service handle. A client would either explicitly close its service handle or, by doing nothing, allow the system to try to reconnect by automatically recalling adap.Connect. (The listening partner cannot maintain the old connection handle and wait for the connecting partner to reconnect, because the new service handle of the connecting partner will be different.)
`sent A sent event indicates that one or more pending messages have been sent to the partner identified by service_handle. Messages are not necessarily sent immediately by adap.Send; some may remain pending and will be sent by adap at a later time. Messages that are sent immediately do not cause sent events. Rather, sent events occur when pending messages are actually sent. call_data is the number of pending messages sent. The total of the call_data values for all sent events plus the total of all results of adap.Send equals the number of messages sent to the partner.

Timers work a bit differently. Expiration is really the only event type for a timer. Consequently, if callback arguments for timers were the same as callback arguments for interprocess communication, the second argument for calls to timer callback functions would always have the same value, and so be useless. Therefore, timer event types have been defined to be the names of timers; a name is given when a timer is established (see adap.SetTimer). This means that timer event types are not a fixed set as in interprocess communication, but are determined by the application writers. In practice, of course, they are a fixed set within each application.

That the only true timer event type is expiration means that the callback function of a timer is called only when the timer expires.

The service_handle argument of a timer callback function is of use when the timer is to be closed or modified before it expires. The call_data argument is the time duration with which the timer was established (see adap.SetTimer), thus permitting the callback function to reset the timer with a related duration.

Each timer is established by calling adap.SetTimer, and its callback function is identified in that call. Consequently, each timer could have a separate callback function, but it is common practice to use one callback function consisting of a single case statement, where the cases are the names of the timers (see adap.SetTimer).

The adap Data Structures

   Service Descriptors for Interprocess Connections

A service descriptor is a nested vector describing the connection a connecting partner is attempting to establish with the listening partner, and the connections the listener is willing to accept. The partners agree beforehand on the contents of this vector. The elements of the vector are arranged in attribute-value pairs; i.e., the vector is an association list. The first element of an attribute-value pair is the service attribute, and is one of `host, `port, `protocol, or `name. The second element of a pair is an appropriate value for the service attribute. These attributes can be set on a listener, and their values will then be given to any connection it establishes. (The `retry attribute is explicitly turned off and `listener is reference only.) See the "Service Descriptor Attributes" table.

For example, the following service descriptor uses the sample values in that table:
(`host;`s5; `port;9004; `protocol;`A; `name;`ThisService)

The order in which the attribute-value pairs appear is immaterial, although each attribute symbol must be followed immediately by its value. For example, the above service description is equivalent to:
(`name;`ThisService; `host;`bilbo; `protocol;`A; `port;9004)

If the name of the listening partner is registered in the operating system, it is only necessary to specify the name in the service descriptor; e.g. (`name;`idn_apc).

Service Descriptor Attributes
Service AttributeDescriptionSample Value, Default
`host The name, as a symbol scalar, of the host machine on which the listening partner runs. If both partners run on the same machine, then `localhost can be used. For adap.Listen, `host must be the local host; it can be given as its name, `localhost, or null. `bilbo (not necessarily a real host name).
Default when anything other than `name is specified: `localhost.
`listener Reference only. This attribute is valid for connections. For those created by listeners, the value is the handle of the listener which created the connection. For "client" connections created through direct calls to i.connect* functions, the value of the `listener attribute is 0.  
`name The name, as a symbol scalar, of the service. Some services are listed in the system yellow pages, and for them only their names need be given in service descriptors (see the `choose event type in the table "adap Asynchronous Interprocess Communication Event Types"). For others a complete service descriptor must be given, and the name serves only as an abstract identifier of the connection. `ThisService
`port The port on which the communication takes place. Port numbers are controlled by the system administrators. 0 means that adap should pick any available port; the number of the port chosen by adap will be the first element of adap.getPort{servicehandle}, and it is the application's responsibility to notify potential partners of it. 9004.
Default when anything other than `name is specified: 0.
`protocol The name of the format, as a symbol scalar, in which data is sent and received by the partners. See "Protocols for Sending and Receiving Data". `A, for sending and receiving A+ arrays.
Default when anything other than `name is specified: `A.
`retry If 1, adap attempts to re-establish the Listen connection if the first try fails. If 0, it does not, perhaps the more reasonable course. 0

   Protocols for Sending and Receiving Data

A+ applications can use adap to communicate with other A+ applications and with non-A+ processes, in particular real-time data sources. There are different formats of the A+ data, or protocols, for the different types of partners: the A and simple protocols are used when both partners are A+ applications. In addition, there are the raw and string (as well as simple) protocols for sending or receiving unformatted character strings, and the ipc protocol for communicating with certain non-A+ processes that expect that protocol. The ipc protocol is not documented here.

The first contact with arriving real-time data is made by the line-reader processes, which format the input streams into discrete messages.

The raw protocol can be used to communicate with the lowest level of these processes, the line readers. Most A+ applications deal with the higher level protocols, but, as you can see, it is possible to establish communication at any level of the real-time data management scheme.

        The A Protocol
The A protocol is for sending and receiving A+ arrays between A+ applications; it is specified in the protocol portion of the service descriptor as `A. These arrays cannot contain function expressions. The array is actually transmitted in CDR format (see Import an A+ Array, sys.import).
        The simple Protocol
simple is designed as a fast, simple A+ protocol; it is specified in the protocol portion of the service descriptor as `simple. It is similar to the A protocol but does not accept nested, symbolic, or functional data. That is, it takes only simple integer, float, or character arrays, ones that can be mapped. The simple protocol does not use import or export (no CDR format), so an A+ object sent can be easily reconstituted in a C process. It does include a four-byte header containing the length of the A object in bytes.
        The raw Protocol
The raw protocol is to communicate with non-A+ processes that send and receive character strings; it is specified in the protocol portion of the service descriptor as `raw or `RAW.
        The string Protocol
string has more general appeal for communication between A+ and C processes than simple does. It is similar to raw, except that it includes a four-byte header with the length of the message, and ensures that only complete messages are delivered. (This differs from raw, in which a single send may come out as several reads, or vice versa.) It accepts (and delivers) only character vectors. It is specified in the protocol portion of the service descriptor as `string.

   Service Handles

Whenever a listening partner initializes a service by executing adap.Listen, it receives as a result of that function an identifying integer known as a service handle. From the point of view of the application, this integer is simply an abstract identifier. In the case of adap.Listen, the service handle identifies the listening partner to itself.

When the listening partner accepts a request to connect from a connecting partner, a service handle identifying that partner is generated. Similarly, when a connecting partner requests a connection with a listening partner, a service handle identifying the listener is generated. These service handles should be saved because they are means by which partners are identified.

There are four types of service handles, including the three just mentioned:

Every service handle, including those for timers, should be saved for the purpose of closing the connection later.

Timeouts in Synchronous Communication

When a process sends a message to its partner synchronously, if no provision had been provided to interrupt the sending function, it will not return until the message is sent. If time is crucial, the wait may be unacceptable; it might be better to interrupt the sending function and try again later. The function that adap provides for sending messages synchronously, adap.Syncsend, has a timeout argument. If the timeout expires before the message is completely sent, the underlying message-sending mechanism is interrupted and adap.Syncsend returns. There is a timeout argument to the function for synchronously reading messages as well.

If a timeout occurs then all that is known about the message is that it has been partially sent or partially received, but the exact state is unknown. The only way to clear the pending message fragments is to force a reset.

A timeout argument indicates the duration of time during which attempts will be made to complete a synchronous operation. The form of a timeout is either a numeric scalar or one-element vector, or a two-element integer vector. In the case of a numeric scalar or one-element vector, the value represents seconds, and any fractional part of the number represents fractions of seconds. In the case of a two-element integer vector, the first element represents seconds and the second element represents microseconds. For example, 2, 2.5, and 2 500000 are all valid timeouts.

An alternative timeout form is to specify the clock time by which a synchronous operation must be completed, or else abandoned. This form is a three-element integer array, where the first element represents seconds since the Epoch (see sys.secs_in_Epoch), the second element represents microseconds, and the third element is 1.

The two forms of timeouts are called duration timeouts and clock timeouts.

Communication Errors

In asynchronous operations, an unrecoverable system error results in a callback with event type `error, while a recoverable system error results in a callback with event type `reset. For synchronous operations, however, no analogous default actions are taken. This means that the application writer is responsible for examining the error and determining if a `reset needs to be sent to the partner (see adap.Reset).

The errors that the synchronous functions can report (as indicated by the second element of an error return) are listed in the next table.

Errors in Synchronous Communication
Error NameDescription And Action To Be Taken
`buffread Call adap.Reset.
`buffwrite Call adap.Reset.
`fdsisset Call adap.Reset.
`nochan Call adap.Reset.
`select Call adap.Reset.
`readImport This error indicates that adap.Syncread received a bad A+ object. It may or may not require a reset. More likely, it indicates a bug in the partner. (A bad A+ object is one that does not conform to the A protocol, which must be used in synchronous communication; see "Protocols for Sending and Receiving Data".)
`export This error indicates that the argument to adap.Syncsend is an invalid A+ object (perhaps one with function pointers). Reset is not necessary.
`interrupt This indicates that a system interrupt occurred while the operation was in progress. A reset need not be called, but you should continue execution so that the interrupt can be processed. (Note that processing the interrupt may well cause a reset or even termination of the program.)
`timeout This indicates that the function did not finish before the timeout was reached. Whether or not a reset is necessary is up to the application.

Definitions of adap Functions and External Functions

Asynchronous Send adap.Send{h;x}

   Arguments and Result
h is a service handle, as described in "Service Handles". x is any array. The result is a scalar integer.
   Definition
This function is used by either communicating partner to send a message to the other one. The message is the array x. If possible, the message is sent immediately. If not, the message is considered pending, and will be sent at some later time. adap.Send sends only one packet (2K, perhaps) synchronously (i.e., before it returns); the rest is transmitted during later calls to this function or when the process returns to the mainloop. If the message is sent immediately, any pending messages will also have been sent. The contents of the message x depend on the protocol being used (see "Protocols for Sending and Receiving Data").

The result is the number of messages sent. The number is 0 if the current message x is not immediately sent, and it may be greater than 1 if this message and pending ones are immediately sent. Any messages immediately sent by this function will not cause a `sent event; see "Protocols for Sending and Receiving Data". Note that a result of 0 can also arise if the function fails, which can happen, for example, if the arguments are invalid.

A cumulative total of the results of this function and the call_data arguments to `sent callbacks equals the total number of messages sent to the partner.

Close Handle adap.Close{h}

   Argument and Result
h is a service handle, as described in "Service Handles". The result is a scalar integer.
   Definition
This function closes the service handle h. All system resources associated with this service handle are deleted. In the case the service handle h was established through adap.Listen, previously established connections for the listening partner are maintained, but no new ones will be established. If the listening partner wishes to terminate service completely, in addition to closing its service handle h, it must explicitly close all accept handles it has previously received for h; the listening partner is responsible for maintaining a list of accept handles.

Service handles for timers can be closed with adap.Close before their set times expire; they are automatically closed when their set times expire, and therefore, the timers can be said to expire.

The result of this function is 1 if the connection is successfully closed, i.e. if the service associated with it is found and closed, and 0 otherwise.

The requirement to explicitly close connections when they are no longer needed is the main reason for saving the service handles produced by adap.Connect, adap.Listen, and adap.SetTimer.

Connect adap.Connect{s;f}

   Arguments and Result
s is a service descriptor, as described in "Service Descriptors for Interprocess Connections". f is a callback function, as described in "Callback Functions and Events". The result is a service handle, as described in "Service Handles".
   Definition
This function is used by a connecting partner to establish communication with a listening partner. See "Interprocess Communication". The result is -1 if the function fails, which can happen, for example, if either argument is invalid.

Debug Flag adap.Debug{f}

   Argument
The argument is a scalar integer.
   Definition
Immediately after execution of adap.Debug{1}, adap displays trace messages in the A+ session as it is executed. Immediately after execution of adap.Debug{0}, most adap messages are suppressed; some error and warning messages are still issued. A "zero-length message" warning indicates a real problem with a socket, and, even though the message may be suppressed, the condition may cause the process to burn CPU cycles.

When a problem occurs with adap, you can help the adap developers resolve it if you can repeat the error after executing adap.Debug{1} and send them the resulting A+ session log.

Export Data adap.Export{x}

This function has been superseded by sys.exp.

Get Attribute Value adap.Of{h;s}

   Arguments and Result
The left argument h is a service handle, as described in "Service Handles". The right argument s is a symbol. The result is an array.
   Definition
The result is the value of the attribute named in the right argument s for the service handle h. See adap.Has.

Get Client Data adap.GetClientData{h}

   Argument and Result
The argument is a service handle, as described in "Service Handles". The result is an array.
   Definition
The result of this function is the client data previously associated with h by adap.SetClientData. If no client data has previously been set or if h is not a currently active service handle, the value is Null.

Get Port and Workstation Information adap.GetPort{h}

   Argument and Result
The argument is a service handle, as described in "Service Handles". The result is a five-element integer vector.
   Definition
The first element of the result is the port number for the service handle, and the last four elements are the conventional Unix network id for the current host machine.

Get Timeout adap.GetTimeout{t}

   Arguments and Results
The argument t is a duration timeout, as described in "Timeouts in Synchronous Communication". The result is a clock timeout.
   Definition
The argument t represents a number of seconds, possibly fractional. The result is the clock time t seconds after the function is called. For example, adap.GetTimeout{10.5} is the clock time 10.5 seconds from the time the function was called.

This function is useful when several synchronous operations are to be performed in a row, and all must finish within a certain time. Since the operations are performed sequentially, the same duration timeout cannot be used for all calls, but the same clock timeout can. This function converts a duration timeout to the (nearly) equivalent clock timeout, if the first of the synchronous operations is called immediately after the conversion is done.

Import Data adap.Import{x}

This function has been superseded by sys.imp.

Listen adap.Listen{s;f}

   Arguments and Result
s is a service descriptor, as described in "Service Descriptors for Interprocess Connections". f is a callback function, as described in "Callback Functions and Events". The result is a service handle, as described in "Service Handles".
   Definition
This function is used to initialize listening partners, i.e., to set up the mechanism by which processes listen for partners attempting to establish connections. See "Interprocess Communication". The result is -1 if the function fails, which can happen, for example, if either argument is invalid. See "Service Descriptor Attributes regarding retries.

The listening partner can set the port number to 0 in the argument s, in which case adap generates a valid port number. The listening partner can then get the assigned port number by executing adap.GetPort, but must broadcast this number to all potential partners.

   Example
(ListenHandle)adap.Listen{
                           (`name;`Test;
                            `host;`localhost;
                            `port;0;
                            `protocol;`A;
                            `retry;0);
                           CallBackFunc};

Modify Timer adap.ModifyTimer{h;s;d}

   Arguments and Result
h is the service handle of the timer, as described in "Service Handles". s is a symbol scalar, the name of the timer. d is a numeric scalar, the duration of the timer. The result is an integer scalar.
   Definition
This function changes the name (s) or the duration (d) of the timer with service handle h. The new duration is from the time when adap.ModifyTimer was called. The result is 1 if the timer is found and successfully modified, and 0 otherwise.

Reset adap.Reset{h}

   Argument and Result
h is a service handle, as described in "Service Handles". The result is a scalar integer.
   Definition
If h is the service handle of an interprocess connection, this function closes the connection. This is a user-generated reset. It differs from a normal reset, in that a reset event is not generated. However, if this function is called by a connecting partner, the underlying system will then continually try to reconnect to the partner, just as it would for a normal reset. This function, which in practice would rarely be executed by the listening partner, has the same effect as adap.Close for that partner.

If h is a timer, the timer event is reset to its original time duration, and no callback is generated.

The result of this function is 1 if the service is successfully reset, i.e. if the service associated with it is found and reset, and 0 otherwise.

Set Attribute Value adap.Has{h;x}

   Arguments
The left argument h is a service handle, as described in "Service Handles". The right argument is a nested vector.
   Definition
The right argument is an association list, i.e., a nested vector consisting of symbol, value pairs. The symbols are the names of service handle attributes. The effect of this function is to set these attributes, for the service handle h, to the values in the symbol, value pairs. The attributes applicable to h depend on the protocol for sending and receiving data with which h was established. A description of all the attributes follows.

Set Client Data adap.SetClientData{h;x}

   Arguments and Result
h is a service handle, as described in "Service Handles". x is any array that satisfies the conditions of the A protocol (see "Protocols for Sending and Receiving Data"). The result is 0.
   Definition
This function associates the array x with the service handle h. The array can be retrieved using adap.GetClientData. The client data x will no longer be accessible once the connection is closed.

Client data is a convenient way to store auxiliary information about the communication handle. For example, if a client has several communication paths open to the same server, the client data could hold "instance" information.

Set Timer adap.SetTimer{h;f;d}

   Arguments and Result
h is a symbol scalar, which is the name of the timer and of the event type in the callback. f is a callback function, as described in "Callback Functions and Events". d is a numeric scalar that represents the duration of the timer, in seconds; d can be fractional. The result is a service handle, as described in "Service Handles".
   Definition
This function sets the timer named by h to the duration specified by d. See "Interprocess Communication". The result is 0 if the function fails to establish a timer, which can happen, for example, if any of the arguments are invalid.

Status of the Read Queue adap.ReadQueueStatus{h}

   Arguments and Result
The argument h is a service handle, as described in "Service Handles". The result is a two-element integer vector.
   Definition
The first element of the result is 1 if there is a message waiting to be read, and 0 otherwise. The second element is 1 if there is a message in the process of being read.

Status of the Write Queue adap.WriteQueueStatus{h}

   Arguments and Result
The argument h is a service handle, as described in "Service Handles". The result is a two-element integer vector.
   Definition
The first element of the result contains the number of pending messages on the write queue. The second element is 1 if there is a message in the process of being sent, and 0 otherwise.

If the write queue is empty (no pending messages), the result is 0 0. A result of 2 0 indicates two pending messages, while 1 1 indicates one pending message which has been partially sent.

This function can be used in simple communication arrangements to keep track of the number of messages sent, rather than counting results of adap.Send and the callback data for sent events (see adap.Send, and the event types table).

Synchronous Exchange adap.SyncXch{h;x;t}

   Arguments and Result
The argument h is a service handle, as described in "Service Handles". The argument x is the array to be the sent to the partner, which must satisfy the conditions of the A protocol (see "Protocols for Sending and Receiving Data"). The argument t is a timeout (see "Timeouts in Synchronous Communication"). The result is a nested vector.
   Definition
adap.SyncXch is an A+ cover function for synchronous communication in which the message x is sent with adap.Syncsend and, in response, a message is received using adap.Syncread. This is useful when only one message will be received for each message sent. If more than one message will be received for each message sent, then adap.Syncsend should be used, followed by a series of calls to adap.Syncread. The latter occurs, for example, when a server performing a long computation sends a series of status reports to the client.

If adap.SyncXch fails due to a timeout in adap.Syncread, then the message was successfully sent, but the response was not received in the allotted time. If this function is subsequently called again for the same message, the message will be sent again.

The first element of the result is either `error or `OK. If `OK, the second element contains the message from the partner. If it is `error, the first three elements are the result from either adap.Syncsend or adap.Syncread, and the fourth element is either `send or `read, to indicate which function it is.

Synchronous Read adap.Syncread{h;t}

   Arguments and Results
The argument h is a service handle, as described in "Service Handles". The argument t is a timeout (see "Timeouts in Synchronous Communication"). The result is a three-element nested vector, or the Null.
   Definition
This functions waits for a message, i.e. array, to be received from the partner. The partner may send this array synchronously or asynchronously; if it was sent asynchronously, it must have been sent using the A protocol (see "Protocols for Sending and Receiving Data").

If h is bad (not a valid service) the result is null. Otherwise, the result is a three-element enclosed vector. The first element is either `error or `OK, indicating success or failure. In case of an error, the second element is a symbol categorizing the error, and the third element is a system-generated character vector describing the error in more detail. Otherwise, the second element is the received message, and the third element is the Null.

Synchronous Send adap.Syncsend{h;x;t}

   Arguments and Result
The argument h is a service handle, as described in "Service Handles". The argument x is the array to be the sent to the partner, which must satisfy the conditions of the A protocol (see "Protocols for Sending and Receiving Data"). The argument t is a timeout (see "Timeouts in Synchronous Communication"). The result is a three-element nested vector, or the Null.
   Definition
This function is for sending arrays to partners synchronously. This means that the message x, and any that are pending, are sent before the function terminates.

If h is bad (not a valid service) the result is null. Otherwise,the result is a three-element nested vector. The first element is either `error or `OK, indicating success or failure. In case of an error, the second element is a symbol categorizing the error, and the third element is a system-generated character vector describing the error in more detail. In case of success, the second argument is the numbers of messages actually sent, and the third argument is the status of the write queue (see adap.WriteQueueStatus). Note that if there were previously sent messages in the write queue when adap.Syncsend was called, then the following are possible:

  • the number of messages sent can be greater than 1;

  • if the timeout expires then the number of messages sent can be greater than 0, although the current message x was not sent.

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_55.html0000444000265000001440000005440110737165246013656 A+ Reference: The b Context

The b Context


The b context is native to A+. It is not to be loaded.

Sorted Arguments to the b-Context Functions

The definitions of the b context functions refer to sorted arrays, or to permutation vectors that will reorder arrays in sorted order. If the array is simple, i.e., of depth 0, then sorted order means that the items are in nondescending, lexicographic order, which is described in the definition of Grade up. A permutation vector that puts a simple array in sorted order is therefore one that rearranges the items into nondescending, lexicographic order.

Nested scalars and vectors of depth 1 can also be in sorted order. In the case of a scalar a, this means that >a is in sorted order, while for a one-element vector a, it means that 0a is in sorted order. A nested vector a with two or more elements is said to be in sorted order if it is ordered like a dictionary with the items of 0a corresponding to the first letter of words, the items of 1a corresponding to the second letter, and so on. That is, the items of 0a are in sorted order; if i is any simple integer vector in increasing order for which the items of i#0a are identical, then i#1a is in sorted order; and so on.

For example, if

     c3 5'blue blue green'
     n10 20 5
then c is sorted, n is not sorted, but the nested pair (c;n) is sorted.

Uniform Frames and Comparable Cells

Two simple arrays a and b are said to have comparable n-cells if their n-cells have the same shape, i.e.,
(-n)a equals (-n)b. If a has rank k then the items of a are (k-1)-cells. The array b is said to have cells comparable to the items of a if a and b have comparable (k-1) cells. For example, the right argument of the primitive function Find has cells comparable to the items of the left argument.

If a and b are nested scalars of depth 1 then they are said to have comparable n-cells if >a and >b have comparable n-cells, and analogously, b is said to have cells comparable to the items of a if this is true of >a and >b. If a and b are nested vectors of depth 1, then they are said to have comparable n-cells if for every valid scalar index i of both a and b, the simple arrays ia and ib have comparable n-cells, and analogously for b having cells comparable to the items of a. In particular, a and b do not have to be of the same length.

Suppose a and b are nested vectors and b has cells comparable to the items of a. Then for every valid scalar index i, if r is the rank of ia, then the (r-1)-cells of ib have the same shape as the items of ia. Note that r may vary with i. The complementary frame of b has shape (-r-1)b. If all the complementary frames for all i are equal, b is said to have uniform complementary frames. Similarly, if all the counts #ia are the same for all i, then a is said to have uniform counts.

For example, if

     c3 5'blue greengreen'
     n10 20 15
     d2 2 5'greenblue red  green'
     m2 25 10 25 15
then the nested pair (d;m) has cells comparable to the items of the nested pair (c;n) and uniform complementary frames (the 2-frames of d and m), while (c;n) has uniform counts.

Definitions of b-Context Functions

Binary End b.e{y;x}

   Arguments and Result
See Binary Iota, b.i{y;x}.
   Dependency
Comparison Tolerance.
   Definition
b.e differs from b.i in only one way: the elements of the result are last occurrences instead of first. That is, each element n in the result corresponds to a cell or cross section of x, and the value n is the largest index for which the nth item or cross section of y is identical to the corresponding cell or cross section of x. If there is no such item or cross section of y, then n is the number of items (#y) or cross sections (#0,y) of y.

Binary End, with Permutation b.pe{y;p;x}

   Arguments and Result
See Binary Iota, with Permutation, b.p{y;p;x}.
   Dependency
Comparison Tolerance.
   Definition
b.pe{y;p;x} is to b.e{y;x} as b.p{y;p;x} is to b.i{y;x}. See Binary End; Binary Iota, with Permutation; and Binary Iota.

Binary Greater than or Equal to b.ge{y;x}

   Arguments and Result
See Binary Iota, b.i{y;x}.
   Dependency
Comparison Tolerance.
   Definition
The definition of b.i{y;x} is based on comparing whether or not subarrays or cross sections of x and y are identical, depending on whether x and y are simple or nested arrays. The definition of b.ge{y;x} is exactly the same, except that the comparison function is not "identical to", but "greater than or equal to". That is, in comparing two simple subarrays b and a of y and x, respectively, a is said to be greater than or equal to b if a does not come before b in lexicographic order. In the case where a and b are cross sections of the nested arrays x and y, respectively, a is said to be greater than or equal to b if for every valid scalar index j, the simple array j,a is greater than or equal to the simple array j,b (the ravels of a and b are used to include the case where they are scalars).

Note that when x and y are simple, the definition of b.ge{y;x} is identical to the definition of the primitive Bins function, yx, except that for b.ge, comparison tolerance is used when x and y are floating-point arrays.

Binary Greater than or Equal to, with Permutation b.pge{y;p;x}

   Arguments and Result
See Binary Iota, with Permutation, b.p{y;p;x}.
   Dependency
Comparison Tolerance.
   Definition
b.pge{y;p;x} is to b.ge{y;x} as b.p{y;p;x} is to b.i{y;x}. See Binary Greater than or Equal to; Binary Iota, with Permutation; and Binary Iota.

Binary Iota b.i{y;x}

   Arguments and Result
Both arguments x and y must be of the same type, one of character, integer, floating point, and boxed. The result is an integer array. If both are nested, then they must be scalars or vectors of depth 1.

In addition, x must have cells comparable to the items of y. If x and y are nested then x must have uniform complementary frames, y must be of uniform count (see "Uniform Frames and Comparable Cells"), and y must be sorted (see "Sorted Arguments to the b-Context Functions"). The shape of the result is the common value of the shapes of the complementary frames of x.

   Dependency
Comparison Tolerance.
   Definition
When x and y are simple arrays, the definition of b.i{y;x} is identical to the definition of Find, yx, except that in the case of b.i, the items of the left argument y must be in nondescending lexicographic order.

When y is a nested array, its contents are best viewed as fields in a database. Let j be any valid index of both ,x and ,y. From the database viewpoint, the disclosed element j,y is a field and its items (j,y)[k] are records in that field. Cross sections of records k#,y can be formed for scalar indices k. Since all fields j,y have the same number of items, every record is in some cross section.

According to the requirements on nested x and y, the cells in j,x of rank 0(j,y)-1 can also be viewed as records in the field j,y. The corresponding frames for all j,x have the same shape, and so cross sections of records (<l)#,x can also be formed for x.

For every cross section (<l)#,x there is a corresponding element n of the result, which is the smallest index for which that cross section is identical to the cross section (#x)n#,y. If there is no such index, then n is the number of cross sections in y, i.e., 0,y.

   Example
     c3 5'blue greengreen'
     n15 10 20
     y(c;n)
     d2 2 5'greenblue red  green'
     m2 25 10 25 15
     x(d;m)
     b.i{c;d}
 1 0
 3 1
     b.i{n;m}
 3 3
 2 1
In the last evaluation the left argument n is not sorted, and the result is not what we expect. The permutation 1 0 2 will put n in sort order. We can evaluate b.i{1 0 2#n;m}, or equivalently b.p{n;1 0 2;m}:
     b.p{n;1 0 2;m}
 3 1
 2 0
Even though n is not sorted, (c;n) is:
     b.i{y;x}
 3 0
 3 1

Binary Iota, with Permutation b.p{y;p;x}

   Arguments and Result
The arguments y and x, and the result, are as described for Binary Iota, b.i. The argument p is a vector of nonnegative, nonrepeating integers.
   Dependency
Comparison Tolerance.
   Definition
The purpose of this function is to provide the advantages of b.i in the cases when a potential left argument to b.i is too large to reorder into nondescending order, as is the case with many mapped files.

If x and y are simple arrays, then the argument p is a vector of indices of the items of y such that the elements of p#y are in nondecreasing, lexicographic order. The number of elements in p is not necessarily equal to the number of items of y. The expression b.p{y;p;x} is formally equivalent to b.i{p#y;x}, but the permuted array p#y is never actually formed.

If x and y are nested arrays then for every valid index j of ,x and ,y, the argument w is a vector of indices of the items of j,y such that the elements of w#j,y are in nondecreasing, lexicographic order. b.p{y;p;x;} is formally equivalent to b.i{z;x}, where

     zy
     z[#x](<p)#z[#x]
but z is never actually formed.

Binary Less than or Equal to b.le{y;x}

   Arguments and Result
See Binary Iota, b.i{y;x}.
   Dependency
Comparison Tolerance.
   Definition
b.le differs from b.ge in only two ways: the comparisons are made with "less than or equal to" instead of "greater than or equal to", and the elements of the result are last occurrences instead of first.

That is, in comparing two simple subarrays b and a of y and x, respectively, a is said to be less than or equal to b if a does not come after b in lexicographic order. In the case where a and b are cross sections of the nested arrays x and y, respectively, a is said to be less than or equal to b if for each valid index j, the simple array j,a is less than or equal to the simple array j,b (the ravels of a and b are used to include the case where they are scalars).

Secondly, each element n in the result is the largest index for which the nth item or cross section of y is less than or equal to the corresponding cell or cross section of x. If there is no such item or cross section of y, then n is the number of items (i.e., #y) or cross sections of y.

Binary Less than or Equal to, with Permutation b.ple{y;p;x}

   Arguments and Result
See Binary Iota, with Permutation, b.p{y;p;x}.
   Dependency
Comparison Tolerance.
   Definition
b.ple{y;p;x} is to b.p{y;p;x} as b.le{y;x} is to b.i{y;x}. See Binary Iota, with Permutation; Binary Less than or Equal to; and Binary Iota.

Binary Range b.r{y;x}

   Arguments and Result
See Binary Iota, b.i{y;x}. The result is an integer array whose shape is 2,b.i{y;x}.
   Dependency
Comparison Tolerance.
   Definition
0#b.r{y;x} is identical to b.i{y;x}, and the elements of 1#b.r{y;x} are the number of occurrences of the cells or cross sections of x in y.

Binary Range, with Permutation b.pr{y;p;x}

   Arguments and Result
See Binary Iota, with Permutation, b.p{y;p;x}. The result is an integer array whose shape is 2,b.p{y;x}.
   Dependency
Comparison Tolerance.
   Definition
b.pr{y;p;x} is to b.p{y;p;x} as b.r{y;x} is to b.i{y;x}. See Binary Iota, with Permutation; Binary Range; and Binary Iota.

Binary Unique b.u{y;x}

   Arguments and Result
The arguments are simple and the items of y are assumed to be unique. Otherwise, the arguments and result follow the rules for b.i{y;x} in the simple case.
   Dependency
Comparison Tolerance.
   Definition
The result is identical to Binary Iota, b.i{y;x}. Since, however, unique items in y are assumed, the algorithm is slightly faster. The use of this function is discouraged, as it may be removed.


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_56.html0000444000265000001440000007307710737165247013672 A+ Reference: The c Context

The c Context


The c context is native to A+. It is not to be loaded.

The c context provides utilities for creating, manipulating, and examining C-language structures and pointers to data. Pointers are represented as scalar integers in A+. The representation of structures is more complicated, and is discussed below in "The Representation of C-Language Structures in A+". The definitions of the c-context functions for structures follow that section.

The Representation of C-Language Structures in A+

A C-language structure is represented in A+ by three vectors: a vector of symbols for member names that the user can choose; a vector of integers defining the length of each member; and a vector of symbols describing the storage type of each member. The symbols for specifying storage types are given in the table "A+ Symbols for Specifying C Data Types". The storage types `struct1, `struct2, `struct3, `struct4 are for members that are structures, and in these cases the corresponding element of the length vector is the length of the structure, in bytes. In all other cases the element of the length vector is the number of elements in the member; if the length is greater than 1, then the member is assumed to be an array, whereas if the length is 1 the element is assumed to be a scalar.

A C-language structure created from these vectors can be passed to C programs that have been dynamically loaded to the A+ session. Each C datatype is properly aligned in the structure for the machine on which A+ is running.
A+ Symbols for Specifying C Data Types
A+ SymbolC Data Type   A+ SymbolC Data Type
`charchar `struct1char aligned on one-byte boundary
`u_charunsigned char `struct2char aligned on two-byte boundary
`shortshort `struct4char aligned on four-byte boundary
`u_shortunsigned short `struct8char aligned on eight-byte boundary
`intint `pointervoid*
`u_intunsigned int `floatfloat
`longlong `doubledouble
`u_longunsigned long  

Functions that Modify Arguments

Functions in this chapter, e.g., c.structset, may modify one of their arguments. In such cases, the argument should have a name and the name should be used in the argument position, for then you can see the changes after the function has completed execution. In addition, you must be sure that other objects are not modified as well. The reason is that A+ manages reference counts on objects, meaning that at any point in an execution two or more names can actually share the same array value; sharing stops when the value of one of the objects changes in a normal A+ way. However, the modification of an array value by a function like c.structset is not a normal A+ value change, and all names that had previously shared the value will now shared the modified value, unless prevented. The remedy is to replace the named argument a with something like a0(a)a.

   Example

A simple example will serve to illustrate most of the functions in this chapter. Consider the C-language structures
     struct s1 {
       int        fieldA;
       short      fieldB[4];
     };

     struct s2 {
       int        field1;
       struct s1  field2;
       struct s1  *field3;
     };
The s1 structure is represented in A+ as:
     s1_members`fieldA`fieldB
     s1_lengths1 4
     s1_types`int`short
The function c.structdef produces another A+ representation that includes various information about the structure, such as offsets, and which is used to create the actual structures, insert values, and extract values:
     s1c.structdef{s1_members;s1_lengths;s1_types}
The second structure can now be represented:
     s2_members`field1`field2`field3
     s2_lengths1,(c.structsize s1),1
     s2_types`int,(c.structtype s1),`pointer
Structures with these definitions can now be realized:
     s1_datac.structcreate s1
     s2c.structdef{s2_members;s2_lengths;s2_types}
     s2_datac.structcreate s2
When you put data in the realized structures, the value returned by c.structset is the updated structure:
     c.structset{s1;s1_data;`fieldA`fieldB;(3;6 7 8 9)}
 3 393223 524297 0
     s1_data
 3 393223 524297 0
     c.structset{s2;s2_data;`field1;345}
 345 0 0 0 0 0
     c.structset{s2;s2_data;`field2`field3;
               (s1_data;c.pointer{s1;s1_data})}
 345 3 393223 524297 67120480 0
You use c.structget to retrieve the data:
     c.structget{s1;s1_data;`fieldB}
 6 7 8 9
     mc.structget{s2;s2_data;`field2}
     c.structget{s1;m;`fieldB}
c.structget{s1;m;`fieldB}
     pc.structget{s2;s2_data;`field3}
     nc.struct_pointed_to_by{s1;p}
     c.structget{s1;n;`fieldB}
c.structget{s1;m;`fieldB}
Display the contents of the structures:
      c.structprint{s1;s1_data}
fieldA:(int): 3
fieldB:(short): 6 7 8 9
     c.structprint{s2;s2_data}
field1:(int): 345
field2:(struct4): ----
field3:(pointer): 67120480

Definitions of c-Context Functions

A+ Array to Character Vector Representation c.stuff{a}

   Argument and Result
The argument is an A+ array. The result is a character vector.
   Definition
The result is a character vector representation of the of the A+ array a.

Note: The functions sys.exp and sys.imp should be used in place of c.stuff and c.unstuff.

A+ Array Header c.AHeader{a}

   Argument and Result
The argument is any A+ array. The result is a five-element nested vector.
   Definition
The result contains all the information in the internal header of an A+ array. The meaning of the elements of the result are in the tables "The Result of the Function c.AHeader" and "A+ Types vs. the Type Specification in c.AHeader Result".
The Result of the Function c.AHeader
Element IndexDescription
0An enclosed integer scalar holding the reference count of the array.
1An enclosed character vector representing the type of the array (see next table).
2An enclosed integer scalar holding the rank of the array.
3An enclosed integer scalar holding the element count of the array.
4An enclosed integer vector holding the shape of the array.
A+ Types vs. the Type Specification in c.AHeader Result
A+ Typec.AHeader Value   A+ Typec.AHeader Value
integer"It" derived function"Xt"
floating point"Ft" user defined function"Xt+1"
character"Ct" monadic operator"Xt+2"
nested, symbol, or function array"Et" dyadic operator"Xt+3"

Character Value at Pointer Location c.char_pointed_to_by{i}

   Argument and Result
The argument is a one-element integer array. The result is a character scalar.
   Definition
The integer i is a pointer to a C-language char value. The result is that value as an A+ scalar of type `char.

Character Vector at Pointer Location c.string_pointed_to_by{i}

   Argument and Result
The argument is a one-element integer array. The result is a character vector.
   Definition
The integer i is a pointer to a C-language char string. The result is that value as an A+ character vector.

Character Vector Representation to A+ Array c.unstuff{a}

   Argument and Result
The argument is an A+ character vector. The result is an A+ array.
   Definition
c.unstuff is a left inverse of c.stuff:

     c.unstuff c.stuff x
is identical to x for any A+ array x.

Note: The functions sys.exp and sys.imp should be used in place of c.stuff and c.unstuff.

Define a Structure c.structdef{f;l;t}

   Arguments and Result
The arguments f and t are vectors of symbols, while l is a vector of integers. All three vectors have the same length. The result is a general array of the form (g;m;u;o;c), where g is identical to the argument f, m is identical to the argument l, u is identical to the argument t, and o and c are integer vectors of length one more than the length of the argument vectors.
   Definition
The arguments f, t, and l represent a C-language structure (see "The Representation of C-Language Structures in A+"). For each integer i that is a valid index of the argument vectors f, l, and t, the triple f[i], l[i], and t[i] represents a member of the structure. The integer o[i] is the offset in bytes from the beginning of the structure to the beginning of this member. The integer c[i] is a type code representing the storage type of the member. If n is the number of elements in the argument vectors then o[n] and c[n] are both defined; o[n] is the size of the structure in bytes, and c[n] is the alignment factor for the structure.

The contents of o will be different for different computer architectures, so it is best not to store results of c.structdef in A+ script files.

Display the Contents of a Structure c.structprint{s;a}

   Arguments
The left argument s is a five-element nested vector and the right argument a is an integer vector.
   Definition
The argument s is a structure definition, i.e., a result of c.structdef. The argument a is a structure specified by s; at one point it was a result of c.structcreate, and most likely c.structset. The effect of this function is to display the contents of the structure a. Members that are structures are noted, but their values are not displayed.

Floating-Point Value at Pointer Location c.float_pointed_to_by{i}

   Argument and Result
The argument is a one-element integer array. The result is a floating-point scalar.
   Definition
The integer i is a pointer to a C-language float value. The result is that value as an A+ scalar of type `float.

Form c.form

   Definition
This function used to be in the d context; d is a relational data base toolkit in A, the predecessor of A+. The function is provided in A+ for migration purposes.

Get Values from a Structure c.structget{s;a;f}

   Arguments and Result
The argument s is a five-element nested vector and a is an integer vector. The argument f is either a one-element symbol array or a vector of symbols. If f has one element then the result is either a simple scalar or a simple vector with two or more elements; if f has more than one element, the result is a nested vector with the same number of elements as f, and each element of the result is either a simple scalar or a simple vector with two or more elements.
   Definition
The argument s is a structure definition, i.e., a result of c.structdef. The argument a is a structure specified by s; at one point it was a result of c.structcreate, and most likely c.structset. The result holds the values in the structure a for the members specified by f.

Integer Value at Pointer Location c.int_pointed_to_by{i}

   Argument and Result
The argument is a one-element integer array. The result is an integer scalar.
   Definition
The integer i is a pointer to a C-language int value. The result is that value as an A+ scalar of type `int.

Pointer to an A+ Array Value c.ptr{a}

   Argument and Result
The argument is any A+ array. The result is a scalar integer.
   Definition
The result is a pointer to the data area of the A+ array a.

Pointer to a Structure Value c.pointer{s;a}

   Arguments and Result
The left argument s is a five-element nested vector and the right argument a is an integer vector. The result is a scalar integer.
   Definition
The argument s is a structure definition, i.e., a result of c.structdef. The argument a is a structure specified by s; at one point it was a result of c.structcreate, and most likely c.structset. The result is a pointer to the beginning of the actual data of the structure (in the data area of a).

Realize a Structure c.structcreate{s}

   Argument and Result
The argument s is a five-element nested vector. The result is an integer vector.
   Definition
The argument s is a structure definition, i.e., a result of c.structdef. The result is an integer vector large enough to hold a structure defined by s, and initialized to 0. The result is called a structure initialization.

Set Values in a Structure c.structset{s;a;f;v}

   Arguments and Result
The argument s is a five-element nested vector and a is an integer vector. The argument f is either a one- element symbol array or a vector of symbols. If f has one element, then the argument v is a simple array. If f has more than one element, then v is a nested array of depth 1 with the same number of elements as f. This function directly modifies the value of the argument a (see "Functions that Modify Arguments"). The result is an integer vector.
   Definition
The argument s is a structure definition, i.e., a result of c.structdef. The argument a is a structure specified by s; at one point it was a result of c.structcreate. The argument f specifies members of the structure a, and v specifies values for those members. The effect of this function is to assign these values to those members of a. A value in v can have a different number of elements than is defined for that member. If it has more elements, only as many as needed are inserted in a. If it has fewer, then the contents of the member beyond the values supplied by v may be unpredictable.

All values in v that correspond to integer or floating-point members in the structure should be of A+ type `int or `float, respectively. Values in v that correspond to structure members should be results of c.structset for those structures. The result of this function is the modified argument a.

Size of a Structure c.structsize{s}

   Argument and Result
The argument s is a five-element nested vector. The result is an integer scalar.
   Definition
The argument s is a structure definition, i.e., a result of c.structdef. The result is the size, in bytes, of the structure defined by s.

Similarly to c.structdef, the result of c.structsize will be different for different computer architectures, so it is best not to store these results in A+ script files.

Store a Character Value c.place_chars_at{a;i}

   Arguments
The left argument a is a character array. The right argument i is a scalar integer.
   Definition
The integer i is a pointer to a list of C-language char values. The effect of this function is put the elements of a in that list (in ,a order).

Store a Floating-Point Value c.place_floats_at{a;i}

   Arguments
The left argument a is a floating-point array. The right argument i is a scalar integer.
   Definition
The integer i is a pointer to a list of C-language double values. The effect of this function is put the elements of a in that list (in ,a order).

Store an Integer Value c.place_ints_at{a;i}

   Arguments
The left argument a is an integer array. The right argument i is a scalar integer.
   Definition
The integer i is a pointer to a list of C-language int values. The effect of this function is put the elements of a in that list (in ,a order).

Structure Value at Pointer Location c.struct_pointed_to_by{s;i}

   Arguments and Result
The left argument s is a five-element nested vector. The right argument i is a one-element integer array. The result is an integer vector.
   Definition
The argument s is a structure definition, i.e., a result of c.structdef. The integer i is a pointer to a C-language structure that is equivalent to one defined by s. The result is an integer vector holding a copy of that structure.

Type Double Value at Pointer Location c.double_pointed_to_by{i}

   Argument and Result
The argument is a one-element integer array. The result is a floating-point scalar.
   Definition
The integer i is a pointer to a C-language double value. The result is that value as an A+ scalar of type `float.

Type Short Value at Pointer Location c.short_pointed_to_by{i}

   Argument and Result
The argument is a one-element integer array. The result is a integer scalar.
   Definition
The integer i is a pointer to a C-language short value. The result is that value as an A+ scalar of type `int.

Type of a Structure c.structtype{s}

   Arguments and Result
The argument s is a five-element nested vector. The result is a symbol scalar or the integer 0.
   Definition
The argument s is a structure definition, i.e., a result of c.structdef. The result is the type of the structure, i.e., one of `struct1, `struct2, `struct4, or `struct8, depending on whether the structure definition contains at most one-byte members, two-byte, four-byte, or eight-byte, respectively. Otherwise the result is 0, which would most likely indicate a damaged structure definition.

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_56p.html0000444000265000001440000003401710737165247014041 A+ Reference: The p Context

The p Context


Overview of Packages

The p context provides functions to support A+ package storage.

A package is a single structure containing A+ functions, variables, and dependencies. When a package is stored in a file, it is called a packfile. A packstring is a package in the form of a character array in an A+ workspace. A package can be used for storing a miscellaneous collection of A+ objects in a file, loading an application - it is usually faster than a script -, sending A+ objects through an adap connection, and performing lexical analysis (by a very knowledgeable person).

Packages are manipulated by external functions stored in the p context, which does not need to be loaded. The functions come in pairs: those whose unqualified names begin with s work on packstrings and those whose names begin with f work on packfiles. Package storage is optimized for fast retrieval, at the expense of space where necessary.

A package consists of a number of items, each of which is an object of one of these kinds:

  • an A+ data object (possibly an enclosed primitive function or operator);

  • a dependency - whose definition is included but not value, so that the dependency will be evaluated afresh when needed after retrieval;

  • a defined function or operator;

  • a definition of a mapped file - viz., the name of the file and an integer indicating the type of mapping: the data itself is not included in the package.
Nothing else can be included in a package. In particular, an item cannot be an s attribute on a variable, the state of a variable's display, an attribute set with _set, a set or preset callback, an external function (i.e., a function loaded using _dyld), or an external state, such as an adap connection.

The only operations performed during retrieval from a package are:

  • specification of global variables;

  • definition of dependencies;

  • definition of functions and operators;

  • Mapping (beaming) in of files, using - note that a file's beamed value may be different from its value when it was put into the package and that there will be a value error if the file was removed in the interim.
If some other operation is required in order to restore some information, then you must provide a mechanism supplemental to package retrieval. For example, you could include in a package an initialization routine that sets attributes on variables.

Some of the restrictions, such as the one on dynamically loaded external functions, are due to an inability to retrieve the information needed to adequately store the object; they may possibly be lifted in the course of further development of the interpreter. Some objects, such as adap connections, are so complex that full retrieval of them may never be possible.

Other restrictions reflect a need for experience with packages and further thought. Callbacks, for instance, are not included because it is not clear whether during retrieval of a package variables should be specified and then callbacks set (so that no callbacks fire), callbacks should be set and then variables specified (so that all callbacks fire), or objects should be established in their order in the package definition (so that their order determines which callbacks fire).

Creation and Modification of Packages

To create a packstring or packfile, enter the appropriate one of these statements:
     psp.snew{obj}

     p.fnew{filenm; obj}
The result of p.fnew is null and that of p.snew, ps, is of course a packstring, which is a simple character string.

To add items to a package or replace them (where the names coincide), enter the appropriate one of these statements:

     newpsp.sadd{ps; obj}

     p.fadd{filenm; obj}
where the argument names have the same significance as in the previous pair of statements, except that ps can take the form of a nested vector (p;opts), in which p is a packstring and opts is a character string selecting options, the same as the options for the corresponding form of filenm. The result of p.fadd is null, and newps, the result of p.sadd, is a packstring, which can be the one being modified, ps.

Retrieval of Objects and Information from Packages

To establish (fix) objects in the workspace from data and definitions in a package, enter the appropriate one of these statements:
     p.sfix{ps; sel}

     p.ffix{filenm; sel}
where ps and filenm are as in the previous pair of statements and sel is one of:

  • Null - i.e., p.sfix{ps;()} or p.sfix{ps;} or similarly for p.ffix -, meaning that everything in the package is to be established in the workspace.

  • A list of names to be fixed in the workspace, given as a scalar or vector of symbols.

  • A two-element nested vector of the form (pkgnames;wsnames), where the two elements are symbol scalars or vectors of the same length. The objects to be retrieved are listed in pkgnames and the names they are to be given in the workspace are listed in the corresponding positions in wsnames.
The explicit result of both functions is the Null.

The following two functions return data from a package in the form of a slotfiller, without establishing any global objects:

     sfp.sslot{ps; sel}

     sfp.fslot{filenm; sel}
where the arguments are as described above, except that sel is only null or a list of names, not a two-element nested vector. In the result, sf, the first element lists the names of the objects and the second gives their values; in other words, sf is in one of the allowable forms for the right argument in the creation and modification functions.

A function retrieved in this way is returned as a function scalar. Since there is no analogous form for a dependency, it cannot really be retrieved by these functions, and it has a null value in sf.

   Inquiry and Options

A list of the items in a packstring or packfile can be obtained by entering the appropriate one of
     p.scatalog{psname}

     p.fcatalog{filenm}
They both produce symbol vectors.

An option string, which is a character vector, contains any of the following characters, with the indicated meanings:

d - debug: messages are to be generated by the package functions. Primarily for debugging.

h - hash table: the ...new and ...add functions are to make a hash table, for greater speed when only some items, not all, are being retrieved. Tables are retained in packages regardless of later settings of h. Primarily for packages used as component file systems.

p - pieces: ...fix, ...slot, and ...catalog, instead of operating normally, are to return the various parts of a package as a nested array. This option is primarily for debugging, but it also enables lexical analysis.

r - result: has the same effect as p except that ...fix is also to make assignments to global objects in the usual way.

s - stats: ...new and ...add are to issue messages containing statistics for the package just created.

v - verbose: the functions are to issue messages regarding objects handled, hash table creation, etc.

As indicated above, an option string can be included with an argument that names a file or string. When an option string is not so included, package functions use the default option string, whose initial value is ''.

This default string can be changed by entering the statement

     p.opts{optstring}
where optstring is the new default string.

Example

     b10+c27                Set up variables b and c
     f{x;y}:(|x)|y            and a function f
     d:f{b;c}                  and a dependency d, and
     sp.snew `b`c`d`f         put them in a packstring s
     'test.m''abcdefghijklmnop'
     mf1mf1'test.m'        Create mapped file mf
     b38; c1000;            Change values of b and c
     sp.sadd{s;`b`mf}         and change the b value in s
                               and put mapped file mf in s
     _ex `b`c`d`f`mf
 0 0 0 0 0
     mf1[0 1 2]'ABC'         Change contents of file, using mf1

     _ex `mf1
 0
     p.sfix{s;}               Establish the objects in s
     d                        Recall that we didn't
38                             change c in s
     mf                       mf has the latest value of the file.
ABCdefghijklmnop
     p.sslot{s;}              Retrieve s as a slotfiller.
<  `.b `.c `.d `.f `.mf
< <  38
  <  27
  <                           Null for the dependency.
  < .f                        A function scalar for a function.
  < ABCdefghijklmnop          The contents of the file.
      p.sslot{s;`b`c}         Selective retrieval, as a
<  `.b `.c                     slotfiller for visibility.
< <  38
  <  27

 Now demonstrate a packfile, an option string,  and a slotfiller argument.

     p.fnew{('test.m';"vh");(`one`two`three;(3;2;1))}
 PKG: 0: Storing .one        The v elicits messages.
 PKG: 1: Storing .two
 PKG: 2: Storing .three
 PKG: Storing hash table.    The h creates a hash table.
     p.fslot{'test.m';`two`three}
<  `.two `.three              Retrieved from the file.
< <  2
  <  1

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_57.html0000444000265000001440000025063610737165247013671 s A+ Reference: The s Context

The s Context

For a listing, with links, of s-context functions and variables alphabetized by their A+ names, click here.


Although the external functions of the s context are present when A+ is started, a $load s must be performed to bring in the rest of the s context. This command retrieves a packfile. (The script corresponding to the packfile is in s.raw.+.)

Many of the functions in the s context have to do with creating and managing display classes and their attributes. For examples, see "Display Classes".

Specification of attribute values can usually be given in one of two ways: as a slotfiller or an association list. In the case of a slotfiller sf, each of its symbolic indices holds an attribute name, and the value of the attribute attr is accessible as attrsfal.  An association list al is a vector with an even number of elements. The elements at the even index positions, 0, 2, 4, etc., are symbols holding attribute names. The elements at the odd index positions are the attribute values. For example, if i is even then (i+1)al is the value of the attribute ial.

Definitions of s-Context Functions

Array to Character Vector s.box{a}

     Argument and Result
The argument is any A+ array. The result is a character vector.

     Dependency
Printing Precision, `pp.

     Definition
The result is a character vector that, with one exception, produces an A+ array identical to the argument a when executed. The exception is that the decimal parts of floating-point numbers may not be represented with sufficient precision to reproduce the original value.

This function is used to produce output representations for objects in the array and slot display classes.

Attribute Settings s.domainOf{c;a}

     Arguments and Result
The left argument c is a one-element symbol array, and the right argument a is a symbol scalar or vector. The result is a nested vector of depth 1 whose count equals the count of a.

     Definition
The symbol c names a display class, such as `graph. The right argument is a list of attribute names for that class. The i-th element of the result is an enclosed vector of the possible values of the i-th attribute in the right argument, for the display class specified in c. For attributes whose values are not simply chosen from a list, like `yx, the corresponding elements in the result are enclosed Nulls. Examples of attributes whose values are chosen from a list are `fg and `editspace.

Attribute Sources s.derivedFrom{c;a}

     Arguments and Result
The left argument is a one-element symbol array and the right argument, a, is a symbol scalar or vector. The result is a vector of symbols whose count equals the length of a.

     Definition
The left argument, c, names a display class and the right argument one or more attributes. The result is a vector of class names indicating from what real or virtual class c inherits its definition of each attribute.

Bind Several s.are{v;c}

     Arguments and Result
The arguments are lists of symbols, each argument a vector or scalar. The result is a vector of symbols whose length equals the count of v.

     Definition
The left argument, v, names variables and the right argument names display classes. The explicit result is a vector of the names in v. Bind Several binds the variables listed in v to the classes listed in c. It is like is but looks ahead in c to avoid the rebinding that a top down approach can involve. The variables in v should be listed in a top down order, to avoid the reparenting that a bottom up approach would entail. If c is not the same length as v, it is used cyclically or partially - i.e., (v)c is used as the list of classes.

Here is a comparison of four different ways of binding three objects:

     ab30 40; l`a`b;

     `a `b `l is `matrix `matrix `layout;
    .a: variable bound to matrix
    .b: variable bound to matrix
    .l: variable bound to layout     Because of the bottom up
    .a: variable reparented to .l    order, a and b must be
    .l: variable reparented to top level window
    .l: workspace will be created    reparented and, since
    .b: variable reparented to .l    a was top-level,
     free `l;                         l must also be reparented.

     `l `a `b is `layout `matrix `matrix;
    .l: variable bound to layout
    .a: S will bind variable to array
    .a: variable bound to array      Part of binding of l
    .b: S will bind variable to array
    .b: variable bound to array      Because of the use of is
    .a: variable bound to matrix     and top down order, both
    .b: variable bound to matrix     children must be re-bound.
     free `l;
                                       Now the s.are ways.
     `a `b `l s.are `matrix `matrix `layout;
    .a: variable bound to matrix
    .b: variable bound to matrix
    .l: variable bound to layout
    .a: variable reparented to .l  No lookahead for reparenting:
    .l: variable reparented to top level window  all three
    .l: workspace will be created    objects must be reparented,
    .b: variable reparented to .l    just as they were by is
     free `l;

     `l `a `b s.are `layout `matrix `matrix;
    .l: variable bound to layout    Arguments are in top down
    .a: S will bind variable to matrix order, so no reparenting
    .a: variable bound to matrix     is required, and s.are
    .b: S will bind variable to matrix  looks ahead to avoid
    .b: variable bound to matrix        rebinding.

Call Default Callback Function s.call{x;a}

     Arguments and Result
The left argument x is a one-element symbol array, and the right argument a is a symbol scalar. The result is null.

     Definition
The symbol x names a displayed object, and a is an attribute name for that object; a must have a default action for objects of the class to which x is bound. The effect is to invoke that default action.

This function would typically be used within a user's callback function for the attribute a; it enables selective invocation of default behavior, as well as providing a way to add other function to the default behavior

The attributes currently supported are:

addtexttrace
addtrace
copytexttrace
copytrace
cornerselect
delete
exit
insertabove
insertbelow
rband
refer
save
selectcol
selectrow
textactivate

Capture the Screen Configuration s.script{}

     Result
The result is a character vector.

     Definition
The result contains A+ expressions to recreate the binding of objects currently bound when this function is executed, to set their attributes, and to set the global variables of these objects to their current values. In effect, the current screen management state of an application can be captured for future reproduction. Which objects actually appear in the script is controlled globally by the switch s.AUTOSCRIPT, and locally by the save and script attributes.

CDE Window Manager s.CDE

     Result
Scalar 1 or 0.

     Definition
s.CDE is a dependency. Its value is 1 if the window manager is a CDE one and 0 otherwise. It is evaluated the first time it is referenced; thereafter, the stored value is used. The value does not change within a process.

Character Vector to Array s.execute{c}

     Argument and Result
The argument c is a character vector. The result is an A+ array.

     Definition
The argument c represents an A+ array, in the same sense that results of the function s.box represent A+ arrays. The result is the A+ array represented by the argument c.

Class Can Have Attributes s.canHave{c;a}

     Arguments and Result
The left argument is a symbol naming a class and the right argument is a symbol vector listing attributes. The result is a boolean scalar.

     Definition
The result is 1 if all the attributes named in a can be set for an object of class c, and 0 otherwise.

Classes with Attributes s.classesHaving{a}

     Argument and Result
The argument a is a symbol scalar or vector. The result is a symbol vector.

     Definition
The result is a list of classes having the attributes listed in the argument a.

     Example
     s.classesHaving{`at`geometry}

Closest Named Color s.closest{r}

     Argument and Result
The argument is a three-element integer vector. The result is a symbol.

     Definition
The result holds the name of the color whose rgb value is closest to that represented by the argument.

Color Name to Pixel Conversion s.color{x}

     Argument and Result
If the argument is a character vector or symbol, the result is an integer scalar; if the argument is an integer, the result is a symbol.

     Definition
This function converts from color names to pixel representations of colors, and from pixel representations to names. The pixel representation is the most efficient way to specify colors in s. Consequently, for applications that set colors often, it may be best to compute their pixel values once and for all during application initialization, and use those values in color specifications. Do not store the pixel values in your A+ scripts, however, because they change from one session to another.

Color Shades s.shade{b;c}

     Arguments and Result
The left argument is an integer between 2 and 19, and the right argument is a two-element vector of symbols. The result is a character matrix with b rows and seven columns.

     Definition
The result r is such that r is a vector of hex representations of colors that vary from the color named in 0c to that in 1c.

Color to Hex s.ch{c}

     Argument and Result
The argument is a character vector. The result is a symbol of the form `#rrggbb.

     Definition
This function is the inverse of hc.

Color to RGB s.cc3{p}

     Argument and Result
The argument is a symbol scalar. The result is a three-element integer vector.

     Definition
The argument is a color name, the result its rgb representation. See s.hc3 for a discussions of the rgb color representation.

Copy Attributes s.copy{x;v}

     Arguments and Result
x is a symbol scalar and v is a list of symbols. The result is a vector of symbols.
     Definition
Copy Attributes attempts to bind the variables named (in symbol form) in the vector or scalar v to the same class as that of the variable named in x. The other attributes of each one successfully bound are then given values copied from x. The result lists the variables which were successfully bound.  Warning:  x should have only one item; if you give a list for x, the first item is used for all the variables in v and the other items are ignored, without any message or error report.

If x names a table (or graph) and a variable named in v could be a tableField (or graphTrace) but not a table (or graph), then a parent variable is generated for it and bound to table (or graph), but the attribute values of x are nevertheless copied, where appropriate, to the variable named in v, not to the generated variable.

Attribute values are copied except as dictated by the variables, as in the following example, where a blank space appears in t1 at the right because of the cols limitation:

     abcdef10
     t`a`b`c`d
     t1`e`f
     `t has (`class;`table; `cols;4; `show;1)
     `t s.copy `t1
 `.t1
     >>`space of `a`b`c`d`e`f
 5 5 5 5 5 5
     (<`yxs`cols) of `t`t1
< <  191 279
  <  4
< <  191 279      Same size as the four-column t
  <  2            Only two columns because t1 is 2.

Define Attributes s.classHas{c;a}

     Arguments and Result
The left argument c is a symbol. The right argument is a two-element nested vector, in which the first element holds a symbol and the second either holds a two-element function array or is the Null. The value is a symbol.

     Definition
The effect of this function is to define a new attribute for the class named in c, or delete a defined attribute. If the right argument is of the form (s;(g_f;s_f)), then the attribute named in the symbol s will be defined. If the right argument is of the form (s;), then the defined attribute named in s is deleted.

The syntax of the function g_f is g_f{o}; if the symbol o is an object of class c, then the result of g_f{o} is the value of the attribute s for that object. The value of the attribute should be obtained in the same way as for primitive attributes, namely as the result of o has s. The function has uses g_f to get the value.

The syntax of the function s_f is s_f{o;a}; if the symbol o is an object of class c, then the effect of s_f{o;a} is to set the value of the attribute s to a for that object.

     Example
See "Display Classes".

Desktop Geometry s.desktop{}

     Result
The result is a two-element vector.

     Definition
The result is the number of rows and number of columns in the virtual desktop.

Electrified Attributes s.used{x}

     Argument and Result
The argument is a singleton symbol and the result is a vector of symbols.

     Definition
The result is a list of the attributes of the object named by x that are explicitly electrified. In addition to attributes connected to variables and functions, however, the result includes attributes connected to dependencies.

See the example for the next function, s.usedBy, especially concerning "explicitly".

Electrifying Objects s.usedBy{y;x}

     Arguments and Result
The argument y is a scalar or vector of symbols; x is a singleton symbol; the result is a vector of enclosed symbols or Nulls.

     Definition
The argument y lists attributes and x names an object. For each attribute, the result names the variable, function, or dependency which explicitly (see the example) supplies its value for the object. For an attribute using none of these, a Null appears in the result instead.

     Example
     show `a  a8 10
     s.BLACK`blue          The fg color in the display of a
     s.used `a              immediately turns blue, but s.BLACK
     `fg s.usedBy `a        is a default, not explicitly set,
<                           so neither s.used nor s.usedBy
                            shows the electrification.
     `a has (`fg;`s.BLACK)  Explicitly connect the fg color to
     s.used `a              s.BLACK.  Now both s.used and
`fg                         s.usedBy show the connection of
     `fg s.usedBy `a        `fg for `a with s.BLACK
<  `s.BLACK

Establish Screen Management Functions s.functions{}

     Result
Null.

     Definition
Establish the six root-context screen-management functions - free, has, hide, is, of, show - in the current context.

Font Name to Internal Form Conversion s.font{x}

     Argument and Result
If the argument is a character vector or symbol, the result is the internal form, an integer scalar. If the argument is an integer, the result is a symbol.

     Definition
Just as the pixel representation of colors is an efficient, internal form, there is an internal representation for fonts (see s.color). This function converts font names to the internal form, and also the internal form to font names. For applications that set fonts often, it may be best to compute their internal values once and for all during application initialization, and use those values in font specifications. Do not store the internal values in your A+ scripts, however, because they change from one session to another.

Free All Objects s.reset{}

     Definition
The effect is to free all objects that would be named by s.windows{}. The result is a vector of symbols naming all the objects that were freed.

Get Attribute Defaults for a Class s.defaultOf{a;c}

     Arguments and Result
The left argument a is a symbol scalar or vector. The right argument c is a one-element symbol array. The result is a boxed array of the same shape as the left argument a.

     Definition
The i-th element of the result is the enclosed default value of the i-th attribute in a for the class c.

     Example
     s.defaultOf{`bg`fg;`array}

Get Attribute Default Variables or Values s.Of{a;c}

     Arguments and Result
The left argument is a scalar symbol or vector of symbols. The right argument is a symbol. The result is a nested vector with the same number of elements as the left argument.

     Definition
The i-th element of the result is an enclosed name or value corresponding to the i-th attribute listed in a for the class c: the name of the attribute default variable if a dot was placed at the beginning of the attribute name in a, else the default value of the attribute. (See "Attribute Default Variables"). Cf. s.Has.

     Examples
     `bg s.Of `array
<  `grey
     `.bg s.Of `array
<  `s.GREY

Get Attribute Values for Parent s.ofParent{a;o}

     Arguments and Result
The left argument is a scalar symbol or vector of symbols. The right argument is a symbol. The result is a nested vector with the same number of elements as the left argument.

     Definition
The i-th element of the result is the enclosed value of the i-th attribute listed in a for the parent of the object o.

Hex to Color s.hc{h}

     Argument and Result
The argument is a symbol of the form `#rrggbb. The result is a character vector.

     Definition
The argument is a hex representation of a color, and the result is the color name. See s.color for a discussion of the pixel color representation.

Hex to RGB s.hc3{h}

     Argument and Result
The argument is a symbol of the form `#rrggbb. The result is a three-element integer vector.

     Definition
Each pair of characters rr, gg, bb in the argument represents a two-digit hex, or base 16, integer. The base 10 representations of the pairs of hex integers are integers between 0 and 255. The result is of the form (n1, n2, n3), where n1 is the base 10 representation of rr, n2 is the base 10 representation of gg, and n3 is the base 10 representation of bb. The result is an rgb color representation. Both the argument and result are interpreted as the relative intensity of red, green, and blue for a screen color.

List of All Bound Objects s.objects{}

     Result
The result is a nested array of symbols.

     Definition
The result is a list of all objects currently bound to some display class.

List of All Objects Bound to a Class s.boundTo{c}

     Argument and Result
The argument is a symbol scalar. The result is a vector of symbols.

     Definition
The result is a list of the objects bound to the class c.

List of Attributes s.attributes{c}

     Argument and Result
The argument c is a symbol. The result is a vector of symbols.

     Definition
The result is a list of the attributes for the class named in the argument c. In addition, if c is `variable, then the result is a list of the persistent attributes.

List of CDE Workspaces s.wslist{}

     Result
A nested vector of character vectors.

     Definition
The result is a list of the workspace names or, if the window manager is not a CDE one, null.

List of Classes s.classes{}

     Result
The result is a vector of symbols.

     Definition
The result is a list of symbols holding the names of all current classes.

List of metaClasses s.metaClasses{}

     Result
The result is a vector of symbols.

     Definition
The result is a list of symbols holding the names of the display classes that are not virtual and cannot be directly instantiated. In effect, these classes have no visual representations.

     Example
See "Display Classes".

List of Popups s.popups{}

     Result
The result is a vector of symbols.

     Definition
The result is a list of all displayed objects that are popups - not contained in another object and not top level.

List of Real Classes s.realClasses{}

     Result
The result is a vector of symbols.

     Definition
The result is a list of symbols holding the names of the display classes that can be directly instantiated, such as array and table.

     Example
See "Display Classes".

List of Shells s.shells{}

     Result
The result is a vector of symbols.

     Definition
The result is a list of all displayed objects that have window manager decorations, both top-level windows and popups.

List of Subclasses of a Class s.subClasses{c}

     Argument and Result
The argument is a symbol scalar. The result is a nested array of symbols.

     Definition
The result is a nested array of symbols whose values are the names of the subclasses of the class specified in the argument c. A class b is a subclass of the class c if the attribute set of b contains the attribute set of c. The structure of the result indicates the hierarchical structure of the subclasses, based on set membership of their attribute sets.

List of Superclasses of a Class s.superClasses{c}

     Argument and Result
The argument is a symbol scalar. The result is a nested array of symbols.

     Definition
The result is a nested array of symbols whose values are the names of the superclasses of the class specified in the argument c. A class b is a superclass of the class c if the attribute set of b is contained in the attribute set of c. The structure of the result indicates the hierarchical structure of the superclasses, based on set membership of their attribute sets.

     Example
See "Display Classes".

List of Top-level Windows s.toplevels{}

     Result
The result is a vector of symbols.

     Definition
The result is a list of all top-level windows - those not contained in another object, with `iconic equal to 1.

List of Virtual Classes s.virtualClasses{}

     Result
The result is a vector of symbols.

     Definition
The result is a list of symbols holding the names of the display classes that cannot be directly instantiated, but nonetheless have visual representations, namely tableField and graphTrace.

     Example
See "Display Classes".

Move Mouse Pointer s.warpPointer{w}

  Releases 2.44 and 4.09 on.

     Argument

The argument is a scalar symbol naming a workspace.

     Definition
This function moves the mouse pointer to the window associated with the symbol w. This is useful after a window has been given focus and you want keyboard input to go immediately to that window.  Example:
     (a;b)  (10; 3 3)
     s.show `a `b
     `b s.has (`focus;1)
     s.warpPointer `b

Nested Association List s.ral{x}

     Argument and Result
The argument is a nested, i.e. recursive, slotfiller and the result is a nested association list.

     Definition
This function converts a nested slotfiller to the equivalent nested association list.

No Longer Use Variables s.doesNotUse{o;a}

     Arguments
Each argument is a one-element symbol array or a vector of symbols.

     Definition
If ,o and ,a have the same number of elements, then for every valid index i, the attribute i#,a of the object i#,o will no longer use any variable it may have been using (see s.uses). Otherwise, one of them has only one element, and it is paired with every element of the other argument.

Objects with Specific Attribute Values s.which{a}

     Argument and Result
The argument is either a slotfiller or an association list. The result is a symbol vector.

     Definition
The argument represents a list of attributes and their values (see above). The result is a list of the objects which currently have those settings for those attributes.

Object with Keyboard Focus s.this{}

     Result
The result is a symbol scalar, or the Null.

     Definition
The result is the object on the screen that currently has keyboard focus, or the Null if there is none.

Primitive Attributes s.primitiveTo{c}

     Argument and Result
The argument is a one-element symbol array and the result is a vector of symbols.

     Definition
The result is a list of the attributes for the given class whose definitions it does not inherit, i.e., whose definitions are primitive to the class.

Recursive Association List to Nested Slotfiller s.rsf{a}

     Argument and Result
The argument a is a recursive association list, i.e., an association list in which some of the values may themselves be association lists.

     Definition
The result is a nested slotfiller equivalent to the argument a. That is, any value in a can be reached by a sequence of associations `x, `y, `z, ... ; that same value can be reached in the result by the primitive function Pick with a left argument of `x`y`z ... . The individual changes are made using _alsf.

Refresh All Objects s.refresh{}

     Definition
The effect of this function is to refresh the visual appearance of all objects to reflect recent settings of display-related attributes such as fg and out.

Restore the Captured Screen Configuration s.load{f}

     Argument and Result
The argument is a character vector. The result is a two-element nested array, with each element a simple vector of symbols.

     Definition
The effect is the same as _load{f}, except for the explicit result. The result is of the form (b;f), where b is a vector of symbols listing the objects that are bound to a display class as a result of loading this file, and f is a vector of symbols listing the objects freed. Cf. Save the Captured Screen Configuration, s.save, below.

RGB to Color s.c3c{r}

     Argument and Result
The argument is a three-element integer vector. The result is a symbol scalar.

     Definition
This function is the inverse of Color to RGB, s.cc3.

RGB to Hex s.c3h{r}

     Argument and Result
The argument is a three-element integer vector. The result is a symbol of the form `#rrggbb.

     Definition
This function is the inverse of Hex to RGB, s.hc3.

Save the Captured Screen Configuration s.save{f}

     Argument
The argument is a character vector.

     Definition
The effect of this function is to save the same result as that of the function s.script{} in the Unix file named in f. Cf. Restore the Captured Screen Configuration, s.load, above.

Screen Management Documentation s.doc{f}

     Argument and Result
The argument is a character vector naming a Unix file.

     Definition
The effect of this function is to write summary documentation for the screen management system to the file named by the argument f.

Scroll Together Horizontally s.hScroll, Vertically s.vScroll

     Definition
Scroll Together Vertically and Scroll Together Horizontally are callback functions that manage scroll groups. When they are used, a group is represented by a symbol vector and the appropriate one of these functions is established as a preset callback function for this vector. They can add and delete members, setting appropriate values for new and deleted members' vscrollwith, setcol, setfirstcol, and hscrollwith, setrow, setfirstrow attributes. Note:
  • The scroll group vector should be empty when the preset callback function is set on it, so that each object is handled in a callback when it is placed in the group.

  • Any objects placed in a group should already be bound, since attributes will be set for them.
For example:
     `a`b`c`d`e`f is `array  abcdef20 20
     XY()
     _spcb{`X;(s.hScroll;)}; _spcb{`Y;(s.vScroll;)};
     X`a`b`c
Now these three objects will scroll horizontally together.

     show `a`b`c`d`e`f
     Y`a`b`e`f
Now these objects will scroll vertically together, a and b both ways.

Make d scroll horizontally with the others (Append Assignment okay).
     X[,]`d

Make c scroll with a, b, and e, and make f not scroll with any object.
     Y[3]`c

Sector of Desktop s.beHere{o}

     Argument
The argument is a symbol scalar.
     Definition
The top-level object o is displayed in the currently active sector of the virtual desktop. This is a cover function for `a has `atsector `here.

Set Attribute Default Variables or Values s.Has{c;s}

     Arguments and Result
The left argument is a symbol, the right argument a slotfiller or association list, and the result a symbol.

     Definition
This function sets the default values or attribute default variables for those attributes for the class named by c. See Set Attribute Values for Parent regarding slotfillers and association lists. The right argument represents a list of associations between attributes and either default values or, for any attribute names that have been preceded by a dot, attribute default variables (see "Attribute Default Variables"). Cf. s.Of.

     Example
     `array s.Has `bg `grey
<  `array
     `array s.Has `.bg s.GREY
<  `array

Set Attribute Defaults for a Class s.hasDefault{c;s}

     Arguments and Result
The argument c is a symbol scalar. The argument s is a slotfiller or association list. The result is identical to c.

     Definition
Either form of argument, slotfiller or association list, associates a list of attributes with a set of values in the manner described above. The effect of this function is make these values the default values of their attributes. After s.hasDefaults{c;s} is executed, all objects subsequently bound to the class specified by c will have default values as specified in s.

Note the following relation between this function and persistent attributes: suppose this function is used to set the default value of a persistent attribute for a class c, and that an object bound to another class has had the value of this attribute set explicitly. If that object is then rebound to the class c, the value of the persistent attribute will be the one that had been explicitly set, not the default that was set with this function.

     Examples
After the following is executed:
     `array s.hasDefault (`bg`fg;(`blue;`red))
all objects bound to class `array will have as defaults a blue background and red foreground color. For examples using derived classes, see "Display Classes".

Set Attribute Values for Parent s.parentHas{o;s}

     Arguments and Result
The left argument is a symbol, and the right argument is either a slotfiller or an association list. The result is a symbol.

     Definition
If s is a slotfiller, then each of its symbolic indices holds an attribute name attr and each `attrs is a value. If s is an association list, each element at an even index i is a symbol holding an attribute name, and the corresponding element at index i+1 is a value. In either case, the right argument represents a list of associations between attributes and values. This function sets those attributes to those values for the parent of the object named by o. An object p is the parent of an object o if `o explicitly appears in the value of the global variable p.

Set Current CDE Workspace s.setcurrentws{n}

     Argument and Result
The argument is a character string and the result is null.

     Definition
The workspace named n is made the current workspace (i.e., displayed) if the window manager is a CDE one. Otherwise, no action is taken. [Future use]

Tree Dependency s.wstree{s}

     Argument
The argument s is a scalar symbol naming a global variable.

     Definition
The value of the global variable named in the argument becomes a nested array representing the workspace-tree dependency. (The first top-level object created in an A+ session becomes the so-called screen workspace for that session; if that object is subsequently put in a container, that container becomes the screen workspace. Any other top-level objects do not appear in the result.)

Use Variables s.uses{o;s}

     Arguments
The argument o is a one-element symbol array or a vector of symbols. The argument s is either a slotfiller or an association list.

     Definition
In the simplest case o has one element naming an object, and s contains a pair of symbols a,v where a is an attribute and v names a global variable. The effect of this function is to identify the value of the attribute for the object named by o with the value of the global variable, so that whenever the value of the variable changes, the attribute (for the object named by o) automatically changes to the same new value.

In general, if s is a slotfiller, each of its symbolic indices names an attribute attr and each value `attrs is a symbol naming a global variable. If s is an association list, each element at an even index i is a symbol naming an attribute and the corresponding element at index i+1 is a symbol naming a global variable. In either case, the right argument represents a list of associations between attributes and global variables.

There are three possible relations between the number of such pairs, or associations, and the number of objects named in o. If o has one element, then every attribute of the object named by o is identified with its global-variable partner in the manner described above. If o is a list with the same number of object names as there are attribute, global-variable pairs on the right, then the ith attribute of the ith object is identified with the ith variable for every valid i. Finally, if there is only one attribute, global-variable pair on the right, then that attribute is identified with that variable for every object named in o.

Subsumed by s.has.

Users of a Variable s.using{v}

     Argument and Result
The argument is a symbol naming a global variable. The result is a nested pair of symbol vectors.

     Definition
The result is of the form (o;a), where o and a are vectors of symbols, and for every valid index i, the attribute a[i] of the object o[i] currently uses the variable named in v (see s.uses, above).

Values of Attributes for a Class s.ofClass{a;c}

     Arguments and Result
The left argument is a scalar symbol or vector of symbols. The right argument is a symbol. The result is a nested vector with the same number of elements as the left argument.

     Definition
The i-th element of the result is the enclosed value of the i-th attribute listed in a for the class c.

     Example
See "Display Classes".

Variable Can Be of Class s.canBe{v;c}

     Arguments and Result
The left argument is a symbol naming a variable and the right argument a symbol naming a display class. The result is a boolean scalar.

     Definition
If v can be bound to c, the result is 1; otherwise the result is 0.

s-Context Global Variables

The s_context global variables are classified as switches, parameters, system attribute default variables, and data variables. See the tables "s-Context Switches (Global Variables)", "s-Context Parameters (Global Variables)", "s-Context System Attribute Default Variables", and "s-Context Data Variables". When the value of an attribute is Null and there is a corresponding s.AUTO... variable, the value of that variable is used for the attribute.

s-Context Switches (Global Variables)
s-Context VariableDescriptionDefault
s.AUTOBUILD If 1, layouts defined by simple vectors of symbols invoke the autobuilder when the objects for the layout are on the screen. Then the objects appear in the layout in the same relative positions they occupied on the screen before the layout was built. 0
s.AUTOCOPY If 1, when a row is inserted values are copied from the row above or below which the new row is inserted.0
s.AUTOEDITSPACE If 1, the size of the edit buffer is the value of s.EDITSPACE. 1
s.AUTOEVALUATE If 0, variables are not to be evaluated in order to determine appropriate attributes for display; they will be set by the programmer. Use with great caution. The evaluate attribute gives finer discrimination.1
s.AUTOEXECUTE If 1, input expressions are executed to obtain a value; if 0, they are not.1
s.AUTOHAS If 1, whenever an attribute value is changed, report the new setting in the A+ session log, as a comment.0
s.AUTONEWSHOW For an existing container: if 1, a reparented child (see s.AUTOREPARENT) is reshown and an unbound variable is shown; if 0, a reparented child is reshown only if mapped and an unbound variable is not shown.0
s.AUTOPOSITION In layouts defined by simple vectors of symbols:  if s.AUTOBUILD is 1, layout objects already on the screen keep their relative positions and all others have at values of 0 0 1 1;  otherwise, all objects are stacked vertically if s.AUTOPOSITION is 1, and all have at of 0 0 1 1 if it is 0. 1
s.AUTOPRINTABLE Default value for printable attribute. See /common/s/opt.doc. 1
s.AUTOREPARENT If 1, an orphaned child (such as an object removed from a layout) is reparented to be a top-level object. If 0, an orphaned child is freed.1
s.AUTORESHOW If 1, a reparented child (see s.AUTOREPARENT) is reshown if it was shown in its former parent; if 0, it is not shown. 0
s.AUTORESPACE If 1, the space attribute is increased when exceeded by the result of the default out function.0
s.AUTOSCRIPT If 0, no object definitions appear in the result of s.script{}; if 1, the definitions appear for all objects that have their script attributes set to 1.1
s.AUTOWS When s.WS is null and an object is (initially) shown whose ws attribute is null, s.AUTOWS controls whether the object becomes the screen workspace (and hence top-level; cf. s.SHELL): if 1, yes, if 0, no.1
s.MENUDEFAULT MNEMONIC If 1, when a menu is bound, the default accelerator for each button is the first letter of its symbolic index. If 0, the default is no accelerators. Cf. the mnemonics attribute.0

s-Context Parameters (Global Variables)
VariableDescriptionDefault
s.ABORT Controls whether severe errors (and perhaps also moderate ones - see s.ERROR) cause s functions to abort execution (when s.ABORT is 1) or to suspend it (when 0). Cf. s.QUIET. 1 (abort)
s.AUTOBLANK The default value used for the display of a NA - e.g., where a row or cell has been inserted - in an object for which the blank attribute has not been set. Cf. s.NA. Null
s.AUTODOC Default for doc attribute, for documentation. ''
s.BACKING STORE Set to 0, turns off the use of backing store for any windows created thereafter, which radically reduces XServer memory consumption but impairs refreshing.
If 1, backing store is used (as normal) for any windows created thereafter. Thus some windows can use backing store while others do not.
1
s.BEEP Specify (any value) to cause the display to beep. 0
s.BUSY Whenever s.BUSY is set to 1, an internal "busy count" is incremented.
Whenever s.BUSY is set to 0, this count is decremented by 1 (but not below 0).
When the count is greater than 0, the pointer is busy: it appears as a little clock or stopwatch whenever it is in an s window. This behavior is independent of the setting of s.CLOCK.
0
s.CLOCK If 1, the pointer is busy - it appears as a little clock or stopwatch whenever it is in an s window - during callbacks for displayed objects and during assignments to variables being displayed on the screen, independent of s.BUSY.
If 0, it is not, except as required by s.BUSY.
s.CLOCK is set to 0 in applications requiring fast update rates, e.g., certain real-time updates.
1
s.CONNECTED A slotfiller. The symbolic indices identify displays. An item of the second element is set to zero if the server for the display identified by its symbolic index fails. If the user has not set a callback on s.CONNECTED, then s calls _exit{1} in the event of a failure. Items of the second element are all nonzero.
s.DATASPACE The default for the space attribute. 9
s.DISCONNECT When server disconnects, do _exit{s.DISCONNECT}. 0
s.DOUBLE CLICK INTERVAL The maximum interval, in milliseconds, between two consecutive clicks for them to be considered a double click. 250
s.EDITSPACE Default size of the edit buffer; see the editspace and space attributes. 256
s.ERROR If 0, s functions proceed upon encountering a moderate error (but see s.QUIET); if 1, they act as dictated by s.ABORT. 0 (proceed)
s.EXIT If s.EXIT is a scalar integer, then when the exit attribute is set to 1 the A+ session ends with _exit{s.EXIT}. Null
s.FILLCOLORS This symbol vector provides the default values for the fillcolor attribute of the graph display class. See "fillcolor". The vector `red `green `deepskyblue `violetred `yellow `cyan `pink `white
s.LINECOLORS This symbol vector provides the default values for the linecolor attribute of the graph display class. See "linecolor". The vector `red `green `deepskyblue `violetred `yellow `cyan `pink `white
s.LINESTYLES This vector provides the default values for the linestyle attribute of the graph display class. See "linestyle". The vector `solid `dash `dotdash `dot
s.MSG If s.MSG is `x or `c.x or `c`x, s messages are put in `x or `c.x, and if it is a suitable displayed object, they appear in the display. If s.MSG is null, the messages are displayed in the session log. Null
s.NA The default values used in the workspace for NA - e.g., in rows or cells created by insertabove and insertbelow -, arranged in a slotfiller.
The value used is based on the type of the variable being expanded and is used if the
na attribute is Null (e.g., has not been set). Cf. s.AUTOBLANK.
(`int `float `char `sym `box `func `null; (999999999; 999999999.0; ' '; `; <(); ; ()))
s.QUIET Controls the display of messages in the A+ session:
if -1, none;
if 2, only for severe errors (indicated by  !!! in the message);
if 1, also for moderate errors (indicated by  !!);
if 0, also for warnings (indicated by  !) and information (indicated by  ). See
s.ABORT and s.ERROR.
0 (all)
s.SCREEN A dependency giving the height and width in pixels of the current screen.  
s.SHELL Determines the default window type. All windows that are created when it is 0 are top-level by default. All windows created when it is -1 are popups by default, with one possible exception: if s.WS is the Null, then the next window that is created for a variable whose ws attribute is 1 or, if s.AUTOWS is 1, null is top-level and becomes the screen workspace. But see "Reversing the Effect of the s.SHELL Setting". Also see s.WS in this table and s.AUTOWS. 1
s.TRACE SYMBOLS This vector provides the default values for the symbol attribute of the graph display class. See "symbol". The vector `cross `circle `circlefilled `triangle `trianglefilled `square `squarefilled `diamond `diamondfilled `xsym `star
s.VERIFY Most display classes require a variable to satisfy certain rank and type restrictions. If 0, verification takes place in the A+ interpreter, and when a variable bound to a display class is assigned a value inappropriate to that class, an
: invalid
message is issued and execution is suspended. If 1, verification takes place within the s-context functions and a more meaningful message is issued.
0
s.WP When an object with default formatting is bound, s.WP is used in calculating a tentative value for the object's space attribute:
   if s.WP is 0, the result is the value of s.DATASPACE;
   if it is -1, the result is the minimum width required for any cell in the entire object;
   otherwise, the result is the minimum width required for any cell in just the first s.WP rows or (for a vector) cells, to save computation of widths.
The space attribute is then set to the greatest of its existing value, the value just calculated, and, if the object is a vector, the width of its title.
100
s.WS The screen workspace: the first object bound in a session, and thereafter any container that becomes the parent of the current workspace.
If s.WS is set to the Null, the next object bound becomes the screen workspace; see s.SHELL.
When s.WS is given a valid nonnull setting, then, no matter what form is given in the setting, its value is a two-element symbol vector `contextname `unqualifiedvarname.
Null (when no object has been bound)
s.WSNAME The default value of the shelltitle attribute for the object named in s.WS. 01_argv, or 'A+' if _argv is the Null.

Reversing the Effect of the s.SHELL Setting

The effect of the setting of s.SHELL can be reversed in individual cases by prefixing an underscore (_) to the name of the class to which a top-level object is to be bound.

For example, if the object's name is table1 and it is bound as follows:

     `table1 is `_table
and if table1 is not the screen workspace (see the description of
s.WS), then:

  • if s.SHELL is -1, `table1 is a top-level window;

  • if s.SHELL is 0, `table1 is a popup.

Attribute Default Variables

An attribute default variable for an attribute and a class is a variable that contains the default value for that attribute for that class. Several attributes may share such a variable, and so may several classes. A system attribute default variable for an attribute and a class is a variable that by default contains the default value for that attribute for that class. For example, s.GREY is the system attribute default variable for bg for all classes, editfg for all classes, and so on. Each system attribute default variable has a default value; for s.GREY, as its name might imply, that value is grey.

With three exceptions, when the value of an attribute default variable is changed, the value of each attribute for each class member for which that variable supplies the default is immediately changed: the attribute is "electrically connected" to the variable. For example, if the value of s.GREY is changed to rosybrown, then the backgrounds of all objects being displayed will change to rosybrown and objects subsequently shown will have rosybrown backgrounds.

There are, as said, three exceptions to this electrical connection. When the value of a system attribute default variable is changed, the value for a given attribute for a given object will not be changed under any of these circumstances:

There are several ways to find the attribute default variable, if any, for an attribute for a class, such as:
     `.bg s.Of `array
`s.GREY
An attribute default variable can be removed for an attribute and class, as in:
     `array s.Has (`bg;)
The attribute default variable can be reset to the system attribute default variable in the same way it would be set to any other variable, e.g.:
     `array s.Has `.bg `s.GREY
There are ten system attribute default variables, as shown in the following
table.
s-Context System Attribute Default Variables
VariableDefault ValueApplication
s.BLACKblack editbg, fg, labelfg, titlefg
s.BLUElightsteelblue3 rowbg
s.GREENmediumaquamarine colindexbg, cornerindexbg, rowindexbg
s.GREYgrey bg, editfg, selectbg
s.REDlightsteelblue3 indexbg
s.YELLOWgold hl
s.FONTkaplgallant font, labelfont, titlefont (all classes except graph)

s-Context Data Variables
s-Context VariableDescription
s.COLOR_NAMES1A symbol vector holding color names. See "Colors" in the chapter on attributes.
s.COLOR_NUMBERS1A three-column integer matrix holding rgb values for colors.
s.FONT_NAMESFont names, returned as a character matrix.
 1. For every index i, s.COLOR_NAMES[i] and s.COLOR_NUMBERS[i] refer to the same color.

Load s into your A+ session to see the values of these variables. A simple way to view s.COLOR_NAMES is

     show s.COLOR_NAMES
You can also view s.COLOR_NUMBERS in this way, but it is better to show colors with s.COLOR_NAMES.

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_58.html0000444000265000001440000024323510737165250013661 A+ Reference: The sys Context

The sys Context


Introduction

The sys context is native to A+. It is not to be loaded.

Many of the sys-context functions are equivalent to Unix system calls or C-library routines. These system calls and library routines are not described here, but only their relationships to the sys-context functions. See the system manual pages for documentation. For example, the documentation on the chmod() system call can be viewed by executing man 2 chmod in an XTerm session, while the documentation on the times() library routine can be viewed by executing man 3 times.

Functions that Modify Arguments

Some functions in this chapter, e.g., sys.fcntl, modify some of their arguments. In such cases, the argument should have a name and the name should be used in the argument position, for then you can see the changes after the function has completed execution. In addition, you must be sure that other objects are not modified as well. The reason is that A+ manages reference counts on objects, meaning that at any point in an execution two or more names can actually share the same array value; sharing stops when the value of one of the objects changes in a normal A+ way. However, when functions like sys.fcntl modify an array value, that is not a normal A+ value change, and all names that had previously shared the value will now share the modified value. The remedy is to replace the named argument a with something like a0(a)a.

Path Names

Path names to files and directories are represented by character vectors. Since Unix file names can contain blanks, blanks in the character vectors are considered significant. In particular, trailing blanks are considered significant, and therefore should be removed from the character vector representations unless they are necessary. Both sys.astat and sys.alstat, however, do remove trailing blanks.

File Permissions Mode

When a Unix file is created, its access permission characteristics are set, specifying who can read, write, and execute the file. The access permission characteristics are represented numerically as 4 for read, 2 for write, and 1 for execute. In addition, any additive combination of these three is allowed. For example, a file that is both readable and executable has file access 4+1, or 5, while a file opened for both reading and writing is opened with access permission 4+2, or 6. All possible access permissions are represented by the integers 1 through 7.

Files have access characteristics for three independent classes of users: owner of the access, group access, and general access. If the access permissions are o for the owner, g for the group, and u for general users, then the access permissions of the file is the octal representation 8 8 8o,g,u.

Manifest Constants

Many of the sys-context functions are equivalent to Unix system calls. These system calls often have parameters which are specified by so-called manifest constants. For example, to open a file (in a C-language program) for reading only, one of the parameters to the open system call would be O_RDONLY.  These constants can be specified in two ways in A+, either as symbols or integers. The symbol form is the most direct since it uses the names of the constants unchanged, and the names of these constants can be found in the "man page" documentation for the system calls. For example, in the case of the opening a file for reading only, the A+ function sys.open would be called with the second argument `O_RDONLY. The integer values of the constants can also be used, and can be found in the appropriate include files, although you are urged to use the symbols.

Warning! The integer values may differ for Sun, IBM, and other systems.

When more than one constant is to be specified, simply call the A+ function with the appropriate symbol vector. To use an integer argument in this case, OR the integer values of the individual constants together bitwise.

Definitions of sys-Context Functions

Export an Array sys.export{a;t;f}

   Arguments and Result
The argument a is any A+ array that does not contain a function expression, t is a character vector of length 256 or 0 (or the Null), and f is an integer scalar. The result is a one- or two-element nested vector.
   Definition
This function maps the object a to CDR (Common Data Representation) format for transferring among workstations or to APL systems. The argument t is a translation table. For example, if the object is to be sent to an APL2 system, then character (sub)arrays should be translated to EBCDIC character encoding. If the length of t is 0 then no translation occurs. The argument f is a boolean flag. If 1, symbols are not modified; if 0, which should be used when transferring A+ arrays to APL systems, symbols are converted to character vectors and the character translation defined by t is applied. If the mapping of a to CDR format is successful, the result is a two-element nested vector of the form (0;v), where v is the CDR formatted object. If the mapping fails, the result is of the form 1<n, where the integer n is related to the length of the mapped portion of a at the time the error occurred.

The function sys.exp should be used in place of this function.

Import an A+ Array sys.import{v;t}

   Arguments and Result
Both the left argument v and the right argument t are character vectors; the right argument can also be the Null. The length of the right argument is either 0 or 256. The result is a one- or two-element nested vector.
   Definition
This function maps the CDR (Common Data Representation) formatted array v to an A+ object. The left argument v is the CDR formatted array. The right argument t is a translation table. For example, if the left argument v comes from an APL2 system, then character (sub)arrays must be translated from EBCDIC character encoding. If the length of t is 0 then no translation occurs. If v is successfully mapped to an A+ object then the result is a two-element nested vector of the form (0;a), where a is the decoded A+ object. If v cannot be mapped then the result is 1<1.

The CDR format allows for a richer set of data types than that used by A+. These are listed in the table "CDR-to-A+ Type Conversion", along with the A+ data types to which they are mapped. The mapping fails if v contains elements of data types that are rejected.

The function sys.imp should be used in place of this function.

CDR-to-A+ Type Conversion
CDR TypeA+ Type
B1, B4 and B8 (1-bit, 4-bit, and 1-byte boolean)`int
I2 and I4 (2-byte and 4-byte integer)`int
C1 (1-byte character)`char
E4 and E8 (4-byte and 8-byte floating point)
(assumed to be in IEEE floating-point format)
`float
G0 (general array)`box
S1 (A+ extension to the CDR format for symbols)`sym
E16 (16-byte floating point)rejected
J8, J16 and J32 are rejected
(8-byte, 16-byte, and 32-byte complex numbers)
rejected
C4 (4-byte character)rejected
A8 (integer progression)rejected
Pn (packed decimal format)rejected
Zn (zoned decimal format)rejected
X0 (filler - the data in the object is meaningless)rejected

Simplified Export sys.exp{a}

   Argument and Result
The argument a is any A+ object that does not contain function expressions. The result is a character vector.
   Definition
This function is a simplified version of sys.export for transferring A+ objects among workstations. That is, sys.exp{a} is essentially equivalent to 1sys.export{a;();1). The result is the CDR format of a. If the translation fails, a domain error is signalled in the usual A+ manner. A lengthy call can be interrupted by a SIGINT (Ctl-c Ctl-c from an Emacs session). This capability allows one to rescue machines that are frozen because of a large sys.exp or adap.Send call.

Handles little-endian files and 64-bit platforms.

Simplified Import sys.imp{v}

   Argument and Result
The argument v is a character vector. The result is an A+ array.
   Definition
This function is a simplified version of sys.import for transferring A+ objects among workstations. That is, sys.imp{a} is essentially equivalent to 1sys.import{a;()}. The result is the A+ array represented by v. If the translation fails, a domain error is signalled in the usual A+ manner.

Handles little-endian files and 64-bit platforms.

Synchronize a Mapped File sys.amsync{a;i}

   Arguments and Result
The left argument a is a mapped file, and the right argument i is an integer scalar or vector. The result is an integer scalar.
   Definition
This function uses the msync() system call to synchronize the virtual memory pages of the mapped file with the file on disk. The value of the function is the value of that system call.

File to Character Matrix sys.readmat{f}

   Arguments and Result
The argument f is a character vector. The result is a character matrix, or 0, or the Null.
   Definition
The argument f holds a path name of a file (see "Path Names"). The result is a character matrix holding the contents of that file; blanks are appended to rows to make them the same length as the longest line in the file. If the function fails, the result is 0 or the Null.

exit sys.exit{n}

   Argument and Result
Both the argument and result are integer scalars.
   Definition
This function is equivalent to the exit() system call, for exiting from the process. The result of the function is the result of the system call. The A+ system function _exit should be used in place of this function.

kill sys.kill{n;s}

   Arguments
The first argument is a scalar integer, the second a scalar symbol.
   Definition
This function is equivalent to the kill(pid, sig) system call, for sending a signal (the second argument) to a process (the first argument). The signals are:
`SIGABRT`SIGALRM`SIGBUS`SIGCHLD
`SIGCONT`SIGEMT`SIGFPE`SIGHUP
`SIGILL`SIGINT`SIGIO`SIGIOT
`SIGKILL`SIGPIPE`SIGPROF`SIGQUIT
`SIGSEGV`SIGSTOP`SIGSYS`SIGTERM
`SIGTRAP`SIGTSTP`SIGTTIN`SIGTTOU
`SIGURG `SIGUSR1`SIGUSR2`SIGVTALRM
`SIGWINCH`SIGXCPU`SIGXFSZ

Flush Standard Out sys.fflush_stdout{}

   Definition
This function is equivalent to the fflush(stdout) C-library call. The result is the Null.

getenv sys.readenv{x}

   Argument and Result
The argument x is a character vector. The result is either a character vector or the Null.
   Definition
This function is equivalent to the getenv() system call, which returns the value of the environment variable named in x. The result of the function is the result of the system call if the system call is successful, and the Null otherwise.

putenv sys.setenv{x}

   Argument and Result
The argument x is a character vector. The result is an integer scalar.
   Definition
This function is equivalent to the putenv() system call; the value of the argument x is of the form "NAME=VALUE", and environment variable named in NAME is given the value specified by VALUE. The result of the function is the result of the system call.

sleep sys.sleep{s}

   Argument and Result
The argument s is a numeric scalar and the result is a scalar integer.
   Definition
This function suspends execution for s seconds. If s is an integer, negative (treated as 0), or floating-point and greater than 2147 (converted to the nearest integer), the sleep() system call is used. Otherwise, s is converted to the nearest microsecond (multiplied by one million and rounded to an integer) and the usleep() system call is used. The result of the function is the result of the system call.

system sys.system{v}

   Argument and Result
The argument is a character vector. The result is a scalar integer.
   Definition
This function is equivalent to the system() system call, for executing character strings as if they were commands typed at a terminal. The result of the function is the result of the system call. This result depends upon the particular system - sys.system is highly nonportable. If you need advice about the use of this function, you should usually ask someone who knows a lot about Unix, and not necessarily someone who knows a lot about A+.

Note that sh is invoked by default, not ksh, csh, or whatever; in particular, this means that ~ in path names is not treated as a "magic" character. If you need this or some other property of one of these shells, invoke that shell explicitly.

access sys.access{f;m}

   Arguments and Result
The left argument f is a character vector and the right argument m is a symbol scalar or vector, or integer scalar. The result is an integer scalar.
   Definition
This function is equivalent to the access() system call, for determining the accessibility of a file. The left argument f holds a path name of a file (see "Path Names"), and the right argument m holds manifest constants (see "Manifest Constants"). The result of the function is the result of the system call.

File Stats sys.astat{c}

   Argument and Result
The argument c is a character array. The result is an integer array of shape (1c),13.
   Definition
The value of this function contains a variety of information produced by the stat() system call. If the argument c is a scalar or vector, it contains a path name of a file, and the result contains 13 entries for that file. If the argument has rank greater than 2, each cell of rank 1, i.e., each vector along the last axis, is a path name of a file, and the corresponding cell of rank 1 in the result contains 13 entries for that file. Trailing blanks are removed from the path names in both cases (see "Path Names"). The meanings of these entries in terms of the structure of the stat result are given in the table "sys.astat and sys.alstat Results in Terms of stat System Call Result". If the stat() system call fails for a path name, the corresponding entries in the result are all zero.

sys.astat and sys.alstat Results in Terms of stat System Call Result
A+ Indexstat Entry
0st_dev
1st_ino
2st_mode
3st_nlink
4st_uid
A+ Indexstat Entry
5st_gid
6st_rdev
7st_size
8st_atime
A+ Indexstat Entry
9st_mtime
10st_ctime
11st_blksize
12st_blocks

close sys.close{f}

   Argument and Result
The argument f and the result are scalar integers.
   Definition
This function is equivalent to the close() system call, for deleting the file descriptor f. The result of the function is the result of the system call.

create sys.creat{f;m}

   Arguments and Result
The left argument f is a character vector, and both the right argument m and result are scalar integers.
   Definition
This function is equivalent to the creat() system call, for creating a new file or rewriting an existing one. The left argument f is the path name of a file (see "Path Names"), and the right argument m is the permissions mode (see "File Permissions Mode"). The result of the function is the result of the system call.

File Size sys.filesize{f}

   Argument and Result
The argument f is a character vector. The result is an integer scalar.
   Definition
The result is the size in bytes of the open file whose path name is in the argument f (see "Path Names"). This function uses the fstat() system call, which provides a variety of information about (possibly) open files.

flock sys.flock{f;o}

   Arguments and Result
The left argument f is a file descriptor, and the right argument o is a symbol scalar or vector, or integer scalar. The result is an integer scalar.
   Definition
This function is equivalent to the flock() system call, for applying or removing advisory locks on a file. The left argument f holds the descriptor of a file. The right argument o holds manifest constants (see "Manifest Constants") for the second argument of flock. The result of the function is the result of the system call. For some releases and some architectures, the file must be opened for writing in order for this function to succeed.

fsync sys.fsync{f}

   Argument and Result
Both the argument and result are integer scalars.
   Definition
This function is equivalent to the fsync() system call, for synchronizing the incore copy of a file with the copy on disk. The argument f is a file descriptor. The result of the function is the result of the system call.

getdtablesize sys.getdtablesize{}

   Arguments and Result
The result is an integer scalar.
   Definition
This function is equivalent to the getdtablesize() system call, which returns the maximum number of file descriptors. The result of the function is the result of the system call.

lseek sys.lseek{f;o;w}

   Arguments and Result
All arguments and the result are integer scalars.
   Definition
This function is equivalent to the lseek() system call, for setting the pointer in the open file pointed to by the file descriptor f. The arguments of the function are in the same order as they will be in the call to lseek(). The result of the function is the result of the system call.

For the argument w, use 0 for SEEK_SET, 1 for SEEK_CUR, and 2 for SEEK_END.

open sys.open{f;l;m}

   Arguments and Result
The argument f is a character vector or symbol. The argument l is a symbol vector or scalar, or an integer scalar. The argument m and the result are integer scalars.
   Definition
This function is equivalent to the open() system call, which opens a file for reading, or writing, or both. The argument f holds the path name of a file (see "Path Names"), the argument l holds the manifest constants flags for the call to open() (see "Manifest Constants"), and the argument m is the permissions mode (see "File Permissions Mode"), perhaps modified by the process's umask value - see the open() man page. The result of the function is the result of the system call.

pathfind sys.pathfind{v;p;f;m}

   Arguments and Result
The arguments v, p, and f are character vectors. The argument m is an integer scalar. The result is either a character vector or the Null.
   Definition
This function searches for the file named in the argument f, and returns its full path name if it is found and if it can be opened with the permissions specified by the argument m (see "File Permissions Mode"). Otherwise, it returns the Null. If the argument v holds an environment variable name, then the value of that variable specifies the search path. Otherwise, the argument p specifies the search path.

File to Character Vector sys.read{f;a;n}

   Arguments and Result
The arguments f and n, and the result, are integer scalars. The argument a is a character vector.
   Definition
This function is nearly equivalent to the read() system call, for reading from the object specified by a file descriptor. The argument f is a file descriptor, n is the number of bytes to be read, and a is an A+ character vector of length at least n. The effect is to read at most n bytes from the file pointed to by f and place them in the value of a. The result is the actual number of bytes read.

Warning!  In most uses of sys.read, the argument a is a variable, and this variable exhibits the same behavior under ordinary assignment as mapped files. Consider the sequence:

     x100' '
     yx
     sys.read{fd;x;#x}
At this point the value of y also has the same 100 characters that were read from the file into x; that is, yx both before and after the sys.read evaluation.

rename sys.rename{f;g}

   Arguments and Result
The arguments f and g are character vectors. The result is an integer scalar.
   Definition
This function is equivalent to the rename() system call, for renaming links. The arguments of the function are in the same order as they will be in the call to rename(). The result of the function is the result of the system call.

truncate sys.truncate{f;n}

   Arguments and Result
The left argument f is a character vector. The right argument n and the result are scalar integers.
   Definition
This function is equivalent to the truncate() system call, for specifying the size of a file in bytes. The left argument f holds the path name of a file and the right argument n is the file size, in bytes. The result of the function is the result of the system call.

ftruncate sys.ftruncate{f;n}

   Arguments and Result
Both arguments and the result are integer scalars.
   Definition
This function is equivalent to the ftruncate() system call, for specifying the size of a file in bytes. The left argument f is a file descriptor and the right argument n is the file size, in bytes. The result of the function is the result of the system call.

umask sys.umask{m}

   Argument and Result
Both the argument and result are integer scalars.
   Definition
This function is equivalent to the umask() system call, for changing the session default file creation mask. The result of the function is the current setting, so later restoration is possible - including an immediate restoration when the aim is only to check the value. The new setting is the exclusive OR of m and 666 (octal) for a file or 777 for a directory. Thus an argument of 002 gives complete access to the group and read (and directory search) access to others.

Execute
     sys.umask sys.umask 0;
to display the current setting while leaving it unchanged.

File Update Time sys.updtime{f}

   Argument and Result
The argument is a character vector. The result is a one-element integer vector.
   Definition
The argument f holds the path name of a file (see "Path Names"). The result is the time of the latest update of the file, measured in seconds since 00:00:00 GMT, January 1, 1970. This function uses the fstat() system call, which provides a variety of information about (possibly) open files.

write sys.write{f;a;n}

   Arguments and Result
The arguments f and n, and the result, are integer scalars. The argument a is a character vector.
   Definition
This function is nearly equivalent to the write() system call, for writing in a file. The argument f is a file descriptor , n is the number of bytes to be written, and a is an A+ character vector of length at least n. The effect is to write at most n bytes from a in the file pointed to by f. The result is the actual number of bytes written.

For example, sys.write{1;'hey';#'hey'}; will write 'hey' to stdout, and sys.write{2;'ho';#'ho'}; will write 'ho' to stderr, both without a newline. The file descriptors 1 and 2 are already opened when you start A+;  there is no need to call sys.open.

closelog sys.closelog{}

   Result
The result is the Null.
   Definition
This function is equivalent to the closelog() system call, for closing the system log.

openlog sys.openlog{c;l;f}

   Arguments and Result
The argument c is a character vector. The arguments l and f are symbol vectors or scalars, or integer scalars. The result is the Null.
   Definition
This function is equivalent to the openlog() system call, for initializing the system log file. The arguments of the function are in the same order as they will be in the call to openlog().  The arguments l and f hold manifest constants (see "Manifest Constants").

syslog sys.syslog{a;m}

   Arguments and Result
The left argument a is a symbol scalar or vector, or an integer scalar. The right argument m is a character vector.
   Definition
This function is equivalent to the syslog() system call, for logging messages. The arguments of the function are in the same order as they will be in the call to syslog().  The argument m holds manifest constants (see "Manifest Constants").

errno sys.errno{}

   Result
The result is a scalar integer.
   Definition
The result is identical to the global errno in the Unix system, which is set by the last system call. About obtaining error descriptions, see sys.errsym, below.

Error Symbol sys.errsym{n}

   Argument and Result
The argument n is a scalar integer. The result is a scalar symbol.
   Definition
The argument is an error number, as produced by sys.errno (above). The result is text describing the error.

perror sys.perror{v}

   Argument and Result
The argument v is a character vector. The result is the Null.
   Definition
This function is equivalent to the perror() system call, which writes a short error message to standard error describing the error whose number is in errno (see sys.errno, above).

Readlink sys.areadlink{f}

   Argument and Result
The argument is a character vector. The result is either a character vector or the scalar integer -1.
   Definition
The argument holds a path name of a file (see "Path Names"). If the file is a symbolic link, the result is a character vector holding the name of the file it references. If the file named in the argument is not a symbolic link, the result is -1.

Linked File Stats sys.alstat{c}

   Argument and Result
The argument c is a character array. The result is an integer array of shape (1c),13.
   Definition
This function is the same as sys.astat, except that it uses the lstat() system call instead of stat().

link sys.link{a;b}

   Arguments and Result
The arguments a and b are character vectors. The result is an integer scalar.
   Definition
This function is equivalent to the link() system call, for establishing file links. The arguments, which are path names (see "Path Names") of the function are in the same order as they will be in the call to link().

The result of the function is the result of the system call.

symlink sys.symlink{a;b}

   Arguments and Result
The arguments a and b are character vectors. The result is an integer scalar.
   Definition
This function is equivalent to the symlink() system call, for creating symbolic links. The arguments of the function are in the same order as they will be in the call to symlink().  The result of the function is the result of the system call.

unlink sys.unlink{f}

   Argument and Result
The argument f is a character vector. The result is an integer scalar.
   Definition
This function is equivalent to the unlink() system call, for removing the directory entry named by the path name f (see "Path Names") and decrementing the link count on the file named by f. The result of the function is the result of the system call.

Domain Name sys.getdomainname{}

   Result
The result is a character vector.
   Definition
The result is the name of the domain of the current network domain.

getgid sys.getgid{}

   Result
The result is an integer scalar.
   Definition
This function is equivalent to the getgid() system call, which returns the (real) group ID of the current process. The result of the function is the result of the system call.

Host Name sys.gethostname{}

   Result
The result is a character vector.
   Definition
The result is the name of the current host machine.

getpid sys.getpid{}

   Result
The result is an integer scalar.
   Definition
This function is equivalent to the getpid() system call, which returns the process ID of the current process. The result of the function is the result of the system call.

getppid sys.getppid{}

   Result
The result is an integer scalar.
   Definition
This function is equivalent to the getppid() system call, which returns the process ID of the parent of the current process. The result of the function is the result of the system call.

geteuid sys.geteuid{}

   Result
The result is an integer scalar.
   Definition
This function returns the effective user id, corresponding to the name returned by $whoami. See getuid, User Name, and User Name from ID, below.

getuid sys.getuid{}

   Result
The result is an integer scalar.
   Definition
This function is equivalent to the getuid() system call, which returns the real user id of the current process. The result of the function is the result of the system call.

User Name sys.getusername{}

   Result
The result is a character vector, or the null.
   Definition
The result is the name of the logged-in user: the "real" user name, in contrast to the "effective" user name, which is returned by $whoami. These two names can differ when su or a setuid script is used. sys.getusername{} calls the c library function pwd=getpwuid(getuid()) and returns the pwd->pw_name member of pwd.  Null is returned if the requested entry is not found, or on an error or EOF; if null is returned, you can retry in a few seconds and see whether the problem (perhaps an updating) is gone.

User Name from ID sys.username{i}

   Result
The result is a character vector.
   Definition
This function returns the user name corresponding to the user id i. See geteuid, getuid, and User Name, above.

Directory Entries sys.agetdents{f}

   Argument and Result
The argument f is a character vector. The result is a character matrix.
   Definition
The argument f holds a path name to a directory (see "Path Names"). The rows of the result are the names of the files in that directory. The special files named . and .. are removed from the list.

chdir sys.chdir{s}

   Argument and Result
The argument s is a character vector. The result is an integer scalar.
   Definition
This function is equivalent to the chdir() system call, for changing the process's working directory. The argument s holds the path name of a directory (see "Path Names"). The result of the function is the result of the system call. The PWD environment variable is set.

The A+ system function _cd should be used in place of this function.

mkdir sys.mkdir{f;m}

   Arguments and Result
The left argument f is a character vector, and the right argument m is an integer scalar.
   Definition
This function is equivalent to the mkdir() system call, for creating directories. The left argument f holds the path name of a file (see "Path Names"), and the right argument m is the permissions mode (see "File Permissions Mode"). The result of the function is the result of the system call.

rmdir sys.rmdir{f}

   Argument and Result
The argument f is a character vector. The result is an integer scalar.
   Definition
This function is equivalent to the rmdir() system call, for removing directories. The argument f holds a path name of a file (see "Path Names"). The result of the function is the result of the system call.

chmod sys.chmod{s;m}

   Arguments and Result
The left argument s is a character vector. The right argument m and the result are integer scalars.
   Definition
This function is equivalent to the chmod() system call, for changing permissions mode of a file. The left argument s holds the path name of a file (see "Path Names"), and the right argument m holds the permissions mode (see "File Permissions Mode"). The result of the function is the result of the system call.

fchmod sys.fchmod{f;m}

   Arguments and Result
The left argument f, the right argument m, and the result are all integer scalars.
   Definition
This function is equivalent to the fchmod() system call, for changing permissions mode of a file. The left argument f is a file descriptor, and the right argument m holds the file permissions mode (see "File Permissions Mode"). The result of the function is the result of the system call.

chown sys.chown{s;m;n}

   Arguments and Result
The argument s is a character vector. The arguments m and n, and the result, are integer scalars.
   Definition
This function is equivalent to the chown() system call, for changing owner and group of a file. The argument s holds the path name of a file (see "Path Names"), and the arguments m and n are the specifications for the owner and group, respectively. The result of the function is the result of the system call.

Only a superuser can change the owner of a file. An owner can change the group of a file to one of which he is a member.

fchown sys.fchown{f;m;n}

   Arguments and Result
The arguments f, m, and n, and the result, are all integer scalars.
   Definition
This function is equivalent to the fchown() system call, for changing the owner and group of a file. The argument f is a file descriptor, and the arguments m and n are the specifications for the owner and group, respectively. The result of the function is the result of the system call.

Only a superuser can change the owner of a file. An owner can change the group of a file to one of which he is a member.

CPU Time sys.cpu{}

   Result
The result is a four-element integer vector.
   Definition
This function uses the times() C-library routine to produce a four-element vector whose elements are (in order): user time of the current process; system time of the current process; user time for the children of the current process; system time for the children.

Current GMT sys.tsgmt{}

   Result
The result is a seven-element integer vector.
   Definition
The result is the current Greenwich mean time, GMT, represented as: year, month, day, hour, minute, second, millisecond.

Current Local Time sys.ts{}

   Result
The result is a seven-element integer vector.
   Definition
The result is the current local time, represented as: year, month, day, hour, minute, second, millisecond.

Time of Day sys.gettod{x}

   Argument and Result
The argument x is an integer vector. The result is a two-element integer vector.
   Definition
This function uses the gettimeofday() system call. If the argument x has two elements then the first element represents minutes west of Greenwich and the second element is the Daylight Savings flag. If x does not have two elements, gettimeofday() is called with the NULL pointer as its second argument. The result of the function is the result of the system call.

GMT sys.ts1gmt{c}

   Argument and Result
The argument is an integer scalar. The result is a seven-element integer vector.
   Definition
The argument represents some number of seconds since 00:00:00 GMT, January 1, 1970. The result is the equivalent GMT, represented as: year, month, day, hour, minute, second, 0.

Local Time sys.ts1{c}

   Argument and Result
The argument is an integer scalar. The result is a seven-element integer vector.
   Definition
The argument represents some number of seconds since 00:00:00 GMT, January 1, 1970. The result is the equivalent local time, represented as: year, month, day, hour, minute, second, 0.

Time in Seconds sys.mkts1{x}

   Argument and Result
The argument is an integer vector of length 7. The result is a scalar integer.
   Definition
The argument should be a local time in the form years, months, days, hours, minutes, seconds, microseconds. The argument is changed to 7٢1x - i.e., the given time with the microseconds ignored.

The result is this time converted to the number of seconds since 00:00:00 GMT, Jan. 1, 1970. If the conversion cannot be made (1930 ... or 2094 ... , for example), the result is -1.

For an argument x that is in the appropriate range, sys.mkts1 sys.ts1 x is x.

Seconds in Epoch sys.secs_in_epoch{}

   Result
The result is an integer scalar.
   Definition
The result is the current time measured in seconds since 00:00:00 GMT, January 1, 1970.

Note that the result, which is identical to 0#sys.gettod{0}, can be used as an argument to sys.ts1 or sys.ts1gmt.

Reset Time Zone sys.tzset{}

   Definition
Resets the time zone to the current local time zone. The result is Null.

dup sys.dup{f}

   Argument and Result
The argument f and the result are integer scalars.
   Definition
This function is equivalent to the dup() system call, for duplicating the file descriptor f. The result of the function is the result of the system call.

dup2 sys.dup2{f;g}

   Arguments and Result
Both the left argument f and the right argument g are integer scalars.
   Definition
This function is equivalent to the dup2() system call, for duplicating the file descriptor f and specifying its value to be that of the file descriptor g. The result of the function is the result of the system call.

Read from a Socket sys.aread{f;w}

   Arguments and Result
The left argument f and the right argument w are integer scalars. The result is a simple character, integer, or floating-point array.
   Definition
The left argument f is the file descriptor of an internet stream socket. The effect of this function is to read the simple character, integer, or floating-point array from the connected process. If the right argument w is 0 then the system call select() is used with the zero timer to determine whether the file descriptor is ready to read. If not, execution ends and the result of this function is the Null. Otherwise, or if the value of w is not 0, the read() system call is invoked as often as necessary to build the array. If the function succeeds, the result is that array. If it fails for any reason, the result is the Null.

Read from a Socket and Return the Status sys.areadstat{f;w;s}

   Arguments and Result
The arguments f, w and s are integer scalars. The argument s may be modified directly by this function (see "Functions that Modify Arguments"). The result is a simple character, integer, or floating-point array.
   Definition
This function is the same as sys.aread{f;w}, except that if the read fails the value of the argument s is set to -2 for an EWOULDBLOCK error, and -1 for all other errors.

Read from a Socket within a Time Interval sys.areadwait{f;s;u}

   Arguments and Result
The arguments f, s, and u are integer scalars. The result is a simple character, integer, or floating-point array.
   Definition
This function is the same as sys.aread{f;0}, except that it uses the select() system call with the timer set to s seconds and u microseconds, instead of 0.

getsockopt sys.getsockopt{s,l,on,ov,ol}

   Arguments and Result
The arguments s, l, and on, and the result, are integer scalars. The arguments ov and ol are integer vectors. Both these arguments can be modified directly by the function (see "Functions that Modify Arguments").
   Definition
This function is equivalent to the getsockopt() system call, for manipulating options associated with a socket. The arguments of the function are in the same order as they will be in the call to getsockopt().  The result of the function is the result of the system call.

setsockopt sys.setsockopt{s,l,on,ov,ol}

   Arguments and Result
The arguments s, l, on, and ol, and the result, are integer scalars. The argument ov is an integer vector that can be modified directly by the function (see "Functions that Modify Arguments").
   Definition
This function is equivalent to the setsockopt() system call, which manipulates options associated with a socket. The arguments of the function are in the same order as they will be in the call to setsockopt().  The result of the function is the result of the system call.

Socket Accept sys.sockaccept{f;w}

   Arguments and Result
Both arguments f and w, and the result are scalar integers.
   Definition
The argument f is the file descriptor of an internet stream socket. This is a server function whose effect is to accept connections from clients. The argument w is a wait flag. If w is 1 then the function blocks, i.e., does not return, until a connection is made. Otherwise, it returns immediately. If a connection is made, the result is the file descriptor of the connected socket. The result is -1 in case of an error, or -2 if w is 0 and no connection is made. This function uses the following system calls: accept(), select(), and setsockopt() (setting SO_KEEPALIVE).

Socket Block sys.sockblock{f;b}

   Arguments and Result
Both arguments f and b are scalar integers. The result is the Null.
   Definition
The argument f is a file descriptor of an internet stream socket. The effect of this function is to set blocking on the socket if the blocking flag b is 1, and to set no blocking if b is 0. If blocking is set to 1 then sys.awrite does not return until the A+ array is entirely written, even though this may require the system to break the array into pieces and send them separately. This function uses the system call ioctl().

Socket Connect sys.sockconnect{h;p}

   Arguments and Result
The left argument h is a character vector. The right argument p is an integer scalar. The result is an integer scalar.
   Definition
The left argument h holds the name of a host machine, and the right argument p is an internet TCP port. This is a client function whose effect is to connect to an internet stream socket on that port and host; a listening server is expected to be present. The result is the file descriptor of the connected socket if the connection is successful, and -1 otherwise. This function uses the following system calls: connect(), setsockopt() (setting SO_KEEPALIVE), and socket().

Socket Listen sys.socklisten{p}

   Argument and Result
The argument p and the result are scalar integers.
   Definition
This is a server function whose effect is to create an internet stream socket for listening, and bind it to the internet TCP port specified by the argument p. The result is the file descriptor of the listening socket, or -1 if an error occurs. This function uses the following system calls: bind(), listen(), setsockopt() (setting SO_REUSEADDR), and socket().

Socket ForkExec sys.sfe{v;a}

   Arguments and Result
The left argument v is a character vector and the right argument a is a simple integer vector.
   Definition
This function opens a bidirectional pipe, forks a new process, and makes the system call execvp().

The arguments v and a hold valid first and second parameters to execvp(), respectively. In particular, the right argument is a vector of pointers to character strings, and its last element is 0 (if x is an A+ character vector, then c.ptr x is the pointer to the character string value of x). The result is the file descriptor for stdin and stdout of the forked process.

Delete Defunct Children sys.zombiekiller{}

   Result
This function returns a count of how many processes it reaped, for lack of anything more useful.
   Definition
This function deletes any defunct child processes of the current A+ session.

Write to a Socket sys.awrite{f;a}

   Arguments and Result
The left argument f is a scalar integer, and the right argument a is any simple character, integer, or floating-point array. The result is a scalar integer.
   Definition
The left argument f is the file descriptor of an internet stream socket. The effect of this function is to send the A+ array a to the connected process. The result is 0 if the function is successful. The result is -2 if an EWOULDBLOCK error occurs; all other errors produce a result of -1. This function uses the write() system call.

Note that if a blocking error occurs, then an initial segment of the array a was sent.

Select sys.aselect{r;w;x;t}

   Arguments and Result
The arguments are all integer scalars or vectors, with t of length 0, 1, or 2. The result is a five-element nested vector.
   Definition
This function calls the select() system call with the arguments r, w, and x as the read, write, and exceptional condition file descriptors, respectively, to determine which are ready. If the argument t is empty then select is called with the zero timer. Otherwise, the first element of t is seconds and the second element, if present, is microseconds. The width parameter of the select() call is computed to be one plus the largest value among the file descriptors in r, w, and x.

The first element of the result is the return code from select().  The second element is the value of errno if that return code is negative, and 0 otherwise. The last three elements are the modified r, w, and x lists produced by select().

fcntl sys.fcntl{f;c;a}

   Arguments and Result
The arguments f and a, and the result, are integer scalars. The argument c is a symbol scalar or integer scalar. The argument a may be modified directly by this function (see "Manifest Constants").
   Definition
This function is equivalent to the fcntl() system call, for performing a variety of functions on file descriptors. The argument f is a file descriptor, and the argument c is a manifest constant (see "Functions that Modify Arguments") designating the function for the system call. The argument a contains additional information, or is modified with new information, depending on c. The result of the function is the result of the system call.

ioctl sys.ioctl{f;c;a}

   Arguments and Result
The arguments f and a, and the result, are integer scalars. The argument c is a symbol scalar or integer scalar. The argument a may be modified directly by this function (see "Functions that Modify Arguments").
   Definition
This function is equivalent to the ioctl() system call, for performing special functions on an object with the open file descriptor f. The argument c is a manifest constant (see "Manifest Constants") designating the function for the system call. The argument a contains additional information, or is modified with new information, depending on c. The result of the function is the result of the system call.

read sys.readinto{f;b;n}

   Arguments and Result
The arguments f, b , and n, and the result, are integer scalars.
   Definition
This function is equivalent to the read() system call, for reading from a file. The argument f is a file descriptor, n is the number of bytes to be read, and b is a pointer to a character string of length at least n. The effect is to read at most n bytes from the file pointed to by f and place them in the character string pointed to by b. The result is the actual number of bytes read.

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_59.html0000444000265000001440000044332110737165251013661 A+ Reference: The t Context

The t Context


Introduction

In order to establish the t context, it is necessary to perform a $load t.

Just as the screen management system, the s context, provides the support for displaying tables on screens, the t context provides support for creating and manipulating tables in ways conforming to database queries. Like tables in the table display class (s-tables), t-tables are composed of column, or field, variables. However, t-tables are more complex. Each t-table is represented by an A+ context with the same name as the table, containing the column variables of the table as well as a set of variables and dependencies describing various characteristics of the table and its relationships to other tables; this set is described in the table "t-Created Variables, Dependencies Common to All Table Contexts". For example, the variable _T is a list of the names of the column variables as symbols, and appears in every t-table context. Programmers can define their own variables and dependencies in terms of this set, thereby integrating t-tables into their applications and synchronizing changes in data. The t-generated objects in the table contexts are called table variables and table dependencies. They, and column variables, are referred to here by their unqualified names unless it is necessary to do otherwise.

With regard to database maintenance and manipulation, t is the manipulation component, i.e., the computational engine that implements query languages. It can be helpful to think of the t functions in terms of relational operations, which are conceptually simple and have proven to be an effective, complete set for implementing database queries. Even though there is not an exact fit between t functions and relational operations, they are comparable. See "The Relational Set Operations: Union, Intersection, and Difference" for examples of defining relational operations in terms of t.

   t-Tables: Base Tables and Views

Every t-table is an A+ context; the name of the table is the name of the context. As the last sentence illustrates, t-tables will be referred to simply as tables where the context permits. The function t.open is the means of creating and initializing t-tables from mapped files, text files, and ordinary variables and dependencies. Tables created by t.open are called base tables. Other tables, called views or derived tables, are created from base tables and other views. In the process of creating a view, the view is called the target, and the table(s) from which it is created the source(s). A view of the table X, for example, can be created as the result of applying a selection function such as t.only to X, or the summarization function t.group (for which t.break is a synonym). At the time of creation the view has no columns; it is populated by sending it some or all of the columns of X with the function t.send. The selection functions can also operate on views in place, i.e., without creating a second view to hold the selection; they cannot be applied to base tables in place. The function t.define is used to append new fields to existing tables. The function t.link is the means for relating one table to another; it includes a variation of t.group, and is the most distinctive feature of t.

Not all t-tables are valid s-tables. The definition of t.open gives the full range of possibilities for t-tables. See t.table for extracting the subset of a t-table that can be displayed on the screen.

   Table and Column Names

Names of tables and table columns always appear as symbols in A+ expressions, but elsewhere in this chapter they often appear in ordinary font.

Tables are contexts, and while it is common to refer to objects in contexts by their fully qualified names, this is not the case for table columns. Unqualified column names should always be used in the arguments of the t functions except for columns outside the table context; the table will be determined from context.

Column names cannot begin with an underbar (_).

   Table Row and Column Domains

A table column is an A+ array whose length is its item count. If all columns of a table have the same length, one can speak of the length of the table as the common length of its columns. Like s-tables, t-tables need not have columns whose lengths are all the same, although that is most generally useful. It is assumed in all examples in this chapter that all columns of a table have the same length. When that assumption is true, the length of the table is maintained in the table variable _N. Otherwise, _N is the number of items in the column named by 0#_T, where _T is the table variable holding a list of all column names.

If c1, c2, ... , cn are columns in a table then the list (i#`c1;i#`c2;...;i#`cn) is called their ith row, and if these are all the columns, then the list is called the ith row of the table.

The domain of a table column consists of the shape of its items and its general type; two table columns are in the same domain if they are a valid left argument, right argument pair for the Catenate primitive. More generally, two sets of table columns c1, c2, ... , cn and d1, d2, ... , dn are said to be in the same domain if every pair ci and di are in the same domain.

See "Row and Column Selection", below, for more on the relationship between base tables and views.

It is generally assumed throughout this chapter, unless something is said to the contrary, that tables have distinct rows. This assumption is not restrictive in practice: when tables are constructed, intermediate results may have duplicate rows, but otherwise it is very rare for duplicate rows to be of use.

   About the Examples

The tables and A+ expressions for creating the examples can be found online. The mapped files for these tables are created by the A+ script /usr/local/aplus-fsf-4.18/doc/tutorials/t.tutorial/files.+ and the t tables are loaded by the A+ script model.+ in the same directory. To create your own copies of the mapped files and experiment with variations of the t tables, make copies of these scripts and change their directory variables. There is also a script that recreates the examples in the text. See the README file in that directory for more information.

Only the tables named employees and departments are actually used in this document (see the base tables figure). They are created using the t function t.open, as follows:

   $load t
   directory"/usr/local/aplus-fsf-4.18/doc/tutorials/t.tutorial/files/"
   (`departments;directory) t.open (
                            `dept_no;"0dept.dept_no";
                            `dept_name;"1dept.dept_name";
                            `mgr;"0dept.mgr";
                            `supdept;"0dept.supdept")
   (`employees;directory) t.open (
                            `emp_no;"0emp.emp_no";
                            `emp_name;"1emp.emp_name";
                            `dept_no;"0emp.dept_no";
                            `hire_date;"0emp.hire_date";
                            `sex;"0emp.sex";
                            `salary;"0emp.salary";
                            `commission;"0emp.commission")
   employees.emp_name¡employees.emp_name
     The Base Tables:

Row and Column Selection

Row and column selection in t is done using t.only and t.send. For example, the employees table in the figure can be restricted to departments D11, D21, and D31 as follows:
   `employees `r_view t.only 'dept_no3 3"D11D21D31"'
   `employees `r_view t.send ()
Selection of the rows is done by t.only and is similar to the A+ primitive function called Replicate. The left argument specifies the source table on which the selection is made and the target, in which the selection is realized. The right argument is a character vector holding a boolean-valued expression that specifies the rows to be selected. The view can already exist or not; if it already exists then its current definition is closed (see t.close) and replaced with the new one.

Once t.only is executed, the table r_view has been created but has no columns. To complete the row selection, send the columns of the source to the target. The right argument () to t.send indicates that all columns are to be sent. See the selection figure for the result of this selection.

As for column selection, columns emp_no, emp_name, and dept_no of the employees table can be selected as follows:

   `employees `p_view t.only ()
   `employees `p_view t.send `emp_no `emp_name `salary
The right argument () to t.only indicates that all rows are selected, and the right argument to t.send specifies the columns to send to the selection table, p_view. See the figure.

Row and column selection can be combined. For example, a view of the emp_no, emp_name, and salary columns for all employees in departments D11, D21, and D31 is:

   `employees `rp_view t.only 'dept_no3 3"D11D21D31"'
   `employees `rp_view t.send `emp_no `emp_name `salary
There is a utility function in t named t.in that allows a more English like specification of a set of values in a selection, in this case
"D11,D21,D31" in place of
3 3"D11D21D31". See "Selectors" for more on this topic.

There are several other points to be made about row selection. First of all, it is not necessary to do the row selection all at once. For example, after making the department selections above, department E01 can be added to the selection as follows:

   `employees `rp_view t.also 'dept_no1 3"E01"'
When both the source and target are specified in the left argument to t.also, the selection is evaluated on the source table. However, if only the target is specified in that left argument, the selection is evaluated on the complement of the target (those rows that are not currently selected), and the result is appended to the target. In the latter case, any columns named in the selection must have been sent to the target before the selection is made.

For example, the selection using t.also above can be rephrased as:

   `employees `rp_view t.send `dept_no
   `rp_view t.also 'dept_no1 3"E01"'
Note that this formulation tends to be more efficient than the one above, which refers to all rows of the source table.

Applications of t.also have the effect of ORing the selection specified in its right argument with any previous selections made with this function. If a subsequent selection is done with t.only, it will replace the existing one.

By default, selections ultimately refer to the entire source table of a view, or to the entire complement of a view in its source table. For example, if the following selection is now executed:

   `employees `rp_view t.send `emp_no
   `rp_view t.also 'emp_no60 90'
then one more row will appear in rp_view, the one for the employee with employee number 90, because that employee's department is not one of D11, D21, D31, and E01. If, however, the view had been fixed before the employee number selection was made, as in:
   `rp_view t.fix 1
then the employee number selection would have applied only to the rows in the view table at the time that t.fix is executed, and consequently, no new rows would appear. The logical effect of executing t.fix with a right argument of 1 is to And the selections made before its execution with those that follow, and a practical effect is to make subsequent selections more efficient by limiting their scope.

   How t Manages Row and Column Selection

Every view table created by t.only has a table variable _V, which is a vector of row indices in the source table of the view that reflects any row selections done on the source; the ith item of any column sent to the view will be the _V[i]th item of the source column. The value of _V is kept current with all selections and reordering of the rows in the view.

When a column col is sent from a source table src to a target table tar, the target column is, in the default case, defined by the following dependency in the tar context:

     col:_V#src.col
Actually, the dependency is somewhat more complicated, and more like:
     col:_index{_V;src.col;NA}
where NA denotes the appropriate NA value to be used when indices in _V are out of range; see the definition of t.index, and the `na attribute in the definition of t.open. This default dependency definition can be modified when the source column is sent; see "
Dependency Frames" and the definition of t.send.

The dependencies provide mappings from source columns to view columns. There are also mapping provided by t in the other direction, from view columns to source columns. These are accomplished by putting callbacks on the view columns which make the appropriate updates to source columns whenever they are called.

Column selections are similarly maintained in the table variable _T.

      Row and Column Selection:

Group Fields and Group Functions

The purpose of group fields is to partition, or categorize, or group the rows of a table by equal values in a selected column or equal sets of values in a set of columns, or by values within specified intervals in a column or set of columns. For example, consider the dept_no and sex columns in the employees table in the base table figure.

The two columns on the left in the partitioning table show the distinct entries in the dept_no column and the row indices for the employees in each department. For instance, the employees in department D11 are in rows 4, 10, 11, and 12 of the employees table. Thus the second column represents the partitioning when the column dept_no is the group field.

The two columns on the right in this table represent the partitioning when the columns dept_no and sex are the set of group fields. When dept_no alone is the group field there are eight groups in the partition because there are eight department numbers. When dept_no and sex are the set of group fields there are sixteen groups, consisting of the females in each of the eight departments, and the males in each department.

Partitioning of the employees Table Based on One and Two Group Fields
dept_noOne Group Field: dept_no Two Group Fields: dept_no and sex
dept_no row indicesdept_no and femaledept_no and male
A000, 707
B011 1
C012, 8, 92, 8, 9 
E013 3
D114, 10, 11, 12 4, 10, 11, 12
D215, 13, 14513, 14
E1166 
D3115, 16, 171715, 16

The function t.group is used to establish views based on group fields. In the example of dept_no as a group field for the employees table, a view could be formed as follows:

     `employees `bd_view t.group `dept_no
As with t.also, the effect of t.group is to create the view called bd_view, but the view must still be populated using t.send. If the salary column is sent from the employees table to bd_view, it is not unreasonable to expect that the items of the target column would be salaries grouped by department. Typically, however, it is not these groups that one wants, but the result of some function applied to the groups. For instance, one might want the largest value in each group, the smallest, or the average. A function applied to the groups is called a group function, or summarization function. For instance, to get the largest salary in each group, the group function would be specified as follows:
     `employees `bd_view t.send (`salary;/)
Different columns can be sent with different group functions. For instance, if the emp_no field is sent to bd_view and its items are grouped by departments, then its group function might simply collect all the employee numbers in each group. This group function would be specified as follows:
     `employees `bd_view t.send (`emp_no;<)
For more on group functions, see "
How Group Functions are Specified and How t Applies Them".

   How t Manages Group Fields

Exactly how are group fields maintained? Executing t.group establishes a mapping from the row indices of the source table to the row indices of the target table, which in this example is from the employees table to the bd_view table, and is:
     (<@1 (D employees.dept_no) OE employees.dept_no
      )/<#employees.dept_no
<  0 7
<  1
<  2 8 9
<  3
<  4 10 11 12
<  5 13 14
<  6
<  15 16 17
The function D{x}:((xx)=#x)/x is the usual one that produces the distinct items of the dept_no column. The function OE{x;y}:x@1 1 0 y generalizes the outer product a.=b to apply to items of matrices instead of items of vectors. The result of the above expression is a vector of enclosed index vectors that reflects the grouping defined by the group field; compare this result with the
table.

For example, when the salary column is sent to the bd_view table, the fifth element of the mapped column, bd_view.salary[4], is computed from elements 4, 10, 11, and 12 of the source column, and is /employees.salary[4 10 11 12], or 36250. The group function / was specified when the salary column was sent to departments. Different functions can be specified for different columns.

This mapping is maintained by t in the table dependency bd_view._J. When the salary column is sent from employees to bd_view with the group function /, the new column is a dependency on the source column whose definition is essentially:

     bd_view.salary:>/bd_view._J#<employees.salary
(but see the use of _index in the definition of col in "How t Manages Row and Column Selection").

There are two parts to this dependency:

  1. bd_view._J is a partition of the row indices of the employees table with one element for each row in the bd_view table. When a column is sent from employees to departments, say salary, that column is first partitioned according to this variable, essentially as:
    partition_of_salarybd_view._J#<employees.salary

  2. The partitioned column is a vector of subcolumns, with no item of the column appearing in more than one subcolumn. The group function is applied to each of these subcolumns to produce the target column in the departments table:
    /partition_of_salary

   Grouping by Intervals

So far in this chapter, items in group fields have been grouped by equality. An important variation of this practice, particularly for numeric group fields, is to group items according to intervals of minimum and maximum values, i.e., to group them in ranges. For example, in the employees table in the base table figure, it is generally more useful to group employees by salary ranges than by identical salaries. For instance, the question as to how many salaries fall within each $5000 increment can be answered as follows. First, make a view of the employees table with a few representative fields including salary, and in that view form two new columns representing the lower limit and upper limit of the salary interval for each salary. These new columns will calibrate the group field.
   `employees `e_view t.only ()
   `employees `e_view t.send `emp_no `emp_name `salary
   `e_view t.define (`min_range;
                     '1+5000employees.salary5000')
   `e_view t.define (`max_range;
                     '5000employees.salary5000')
Now form a second view based on salary as a group field with intervals of $5000:
   `e_view `i_view t.group (`salary;500012)
Finally, send salary to the second view with the A+ primitive # as its group function, and send both min_range and max_range with the default group function ("first item"):
   `e_view `i_view t.send (`min_range;;
                           `max_range;;
                           `salary_count;(`salary;#))
Both views are shown in the grouping figure. The reason for creating the min_range and max_range columns in the e_view table and sending them to i_view should now be apparent: in i_view, they serve to calibrate the salary_count table. In a real application, they would most likely not appear in e_view.

Furthermore, in a real application the last row of the i_view table, which is due to the missing salary for Smith, would be filtered out.

     Grouping By Intervals On the Salary Column Of e-view:

   Static Grouping

There are useful variations of the group fields called direct and indirect static group fields, which have these characteristics:

  • The map from the source table to the target table can be computed once and stored. This is useful for large, relatively fixed files for which these computations are expensive.

  • The map is represented as a triple of simple integers instead of a nested vector of integer vectors, which is better for large files and easy to save in mapped files for later use.
To illustrate the indirect static link, suppose that the group view above had been formed with t.group_i instead of t.group:
     `employees `bd_view t.group_i `dept_no
Let x be the mapping bd_view._J defined above for the t.group case. Then the mapping bd_view._J in the t.group_i case is simply a vector of counts of the items of the x, namely #x:
     bd_view._J
 2 1 3 0 1 4 3 3 1 0
In addition, t.group_i generates a permutation vector named employees._H_bd_view that sorts the group field dept_no into nondecreasing order, and also a vector named bd_view._K of first occurrences of the unique elements of the group field in the sorted group field:
     employees._H_bd_view
 0 7 1 2 8 9 4 10 11 12 5 13 14 15 16 17 3 6
     bd_view._K
 0 2 3 18 16 6 10 13 17 18
Then for any n, the n-th item of the mapping x defined above can be obtained from these three vectors:
     employees._H_bd_view[bd_view._K[n]+bd_view._J[n]
Consequently, the group mappings for t.group and t.group_i are functionally equivalent.

Once these variables have been created, they can be saved in mapped files, and in such a way that they will be retrieved automatically by t when needed. Suppose all the columns of the employees table are kept in a directory named source, and nothing else is kept there. Save employees._H_bd_view in that same directory, and with the file name the same as the variable name:

     'source/_H_bd_view.m'employees._H_bd_view
The target table is a view and therefore its columns did not come directly from mapped files. So, choose a directory that will only hold the saved variables bd_view._J and bd_view._K, say target:
     'target/_J.m'bd_view._J
     'target/_K.m'bd_view._K
In a later session, the two tables are opened as follows:
     (`employees;'source') t.open ()
     (`bd_view;'target') t.open ()
- yes, even the view is explicitly opened, in order to retrieve the saved table variables - and bd_view is made a view of employees:
     `employees `bd_view t.only ()
Send the grouping fields:
     `employees `bd_view t.send (`dept_no;)
The state is now the same as that after the original evaluation of t.group_i. For example, send the salary field to the view, as in the t.group example (note that this can be combined with sending the grouping fields):
     `employees `bd_view t.send (`salary;/)
In addition to the indirect static group, there is a direct static group denoted by t.group_d. The difference is that the permutation is not computed, i.e., in the above example, employees._H_bd_view. It is still needed, however, and must be supplied by the user, similarly to t.break_b. For example, after the following is executed:
     `employees `bd_view t.break_d `dept_no
the permutation vector must be defined before any fields are sent to the view.

   Successive Multiple Group Fields

The partitioning table illustrates grouping on multiple fields, in particular:
     `employees `view t.group `dept_no `sex
As that table indicates, rows of employees are grouped together based on equal rows of the column pair dept_no and sex. An interesting variant of grouping on multiple fields is provided by t.report. If the following is executed:
     `employees `view t.report `dept_no `sex
the result is as if an intermediate table were formed that grouped the employees table according to the first column named in the right argument, namely dept_no, and then view were formed from that intermediate table by further classifying the members of each department by sex, i.e. the second column named in the right argument. In fact, that intermediate table is actually formed. If more columns had been named in the right argument then this successive refinement method would have continued for every named column, in the order of the names in the list, and an intermediate table for every step except the last would be created.

A special first column named view._ is automatically generated, providing row labels for the successive refinements. If the screen management system called s is present, then the following provides a display of a representative examples of t.report:

     `employees `view t.send (`salary;/)
     show t.table `view

Linking Tables

Linking is the basic operation for relating the contents of two tables. In the simplest cases the two tables must have a common field, called the link field; more general cases with several link fields will come up later. That is, there is a column in one table with the same name as a column in the other, and these two columns are in the same domain (see "Table Row and Column Domains"). In most practical cases, the two columns have some matching items but are not identical. Linking is not a symmetric operation. One table is selected as the partition side of the link, largely because its link field has distinct items, and the other then becomes the replication side. The link field on the partition side is also called the index field, and the one on the replication side the grouping field, or group field.

A link is a relationship between two tables, based on identical items in their common link field. The relationship is expressed in terms of a correspondence between the row indices of the partition side and the row indices of the link side. The correspondence is illustrated in the next table for the two tables in the base table figure and the common field dept_no. For example, department number C01 appears in row 2 of the departments table and rows 2, 8, and 9 of the employees table. The asymmetry of the link is a reflection of the asymmetry of this correspondence, which is one to many in one direction (and many to one in the other).

Once a link is established, columns can be sent, or mapped, from either side of the link to the other based on the correspondence between the row indices of the two tables. For example, suppose the dept_name column is mapped from the departments table to the employees table to form a new dept_name column. Then item 2 of the dept_name column in departments, "Information Center", will appear in rows 2, 8, and 9 of the new dept_name column. Or, if the salary column in the employees table is mapped to the departments table to form a new salary column there, then the salaries of the employees Pulaski, Jefferson, and Marino (i.e., rows 5, 13, and 14 of the employees table) will all appear in row 6 of the new salary column.

Note that the mapping from the replication side of the link to the partition side is essentially the same as the one from a source table to a view created by t.group, up to a permutation of target table.

Row Index Correspondence of departments and employees based on dept_no
Row Index
in departments
dept_no items Row Index
in employees
0A000, 7
1B011
2C012, 8, 9
3D01 
5D114, 10, 11, 12
6D215, 13, 14
7D3115, 16, 17
4E013
8E116
9E21 

Example

The most common situation in linking two tables occurs when the items of one of the link fields are distinct, while those of the other may or may not be distinct. In this case the table whose link field is known to have distinct items should be selected as the partition side of the link, and the other becomes the replication side. As an example, consider once again the two tables in the base table figure.

These tables have a common field called dept_no. If they are linked on that field (as in the table above), tables corresponding to the results of the following queries (among many) can then be built:

  • Query 1: what are the department names for all employees?

  • Query 2: what is the maximum salary in each department?
Since department numbers uniquely identify departments, the departments table is chosen to be the partition side of the link. The link is established as follows:
     `departments `employees t.link `dept_no
The left argument of t.link is always a two-element symbolic vector whose first element identifies the partition side of the link, and whose second element identifies the replication side. The right argument is (a list of) the link field(s). Once the link is established, any number of columns can be sent from one table to the other in order to answer a variety of queries. To answer the first query, send the dept_name column from the departments table to the employees table, as follows:
     `departments `employees t.send `dept_name
The answer is then contained in the columns emp_name and dept_name of the augmented employees table. These columns cannot be displayed separately because the column emp_name already appears in the display of employees (see the base table figure) and the screen management system does not allow an object to appear on the screen more than once. Therefore, for display purposes, create and populate a new table, query1, as follows:
     `employees `query1 t.only ()
     `employees `query1 t.send `emp_name `dept_name
See the query tables figure for the display of this table.

As for the second query, send the salary field in the employees table to the departments table, as follows:

     `employees `departments t.send (`salary;/)
(the group function / implements the "maximum salary" part of the query). Create a query table as follows (see the query tables figure):
     `departments `query2 t.only ()
     `departments `query2 t.send `dept_name `salary
     Sample Query Tables Created Via t.link:

   How t Manages Table Links

Exactly how are table links accomplished? Executing t.link establishes two mappings between the two sides of the link, represented in the above table as correspondences between the row indices in column 1 and the row indices in column 3. One is a mapping from the rows of the departments table to the rows of the employees table, and in general from the partition side to the replication side, which is:
     departments.dept_noemployees.dept_no
 0 1 2 4 5 6 8 0 2 2 5 5 5 6 6 7 7 7
E.g., where the dept_name column is sent to the employees table, item employees.dept_name[6] in the mapped column equals item departments.dept_name[8] in the source.

This mapping is maintained by t in the table dependency employees._I_departments. When the column dept_name is sent from departments to employees, the new column is a dependency on the source column whose definition is essentially:

employees.dept_no:{
          employees._I_departments#departments.dept_no}
(but see the use of _index in the definition of col in "How t Manages Row and Column Selection").

A second mapping in the other direction is also established, i.e., from the replication side to the partition side, which is similar to the mapping associated with group fields (see "How t Manages Group Fields"). In this example the mapping is from the employees table to the departments table, and is:

     (<@1 departments.dept_no OE employees.dept_no
      )/<#employees.dept_no
<  0 7
<  1
<  2 8 9
<
<  3
<  4 10 11 12
<  5 13 14
<  15 16 17
<  6
<
The function OE is defined in "How t Manages Group Fields". Compare this result with the correspondence table, and the group field mapping in "How t Manages Group Fields".

For example, when the salary column is sent to the departments table, the sixth element of the mapped column, departments.salary[5], is computed from elements 4, 10, 11, and 12 of the source column, and is /employees.salary[4 10 11 12], or 36250. The group function / was specified when the salary column was sent to departments. Different functions can be specified for different columns.

This mapping is maintained by t in the table dependency departments._J_employees. When the column salary is sent from employees to departments with the group function /, the new column is a dependency on the source column whose definition is essentially:

departments.salary:{
       >/departments._J_employees#<employees.salary}
(but see the use of _index in the definition of col in "How t Manages Row and Column Selection").

It is worth noting that the name of each map from one partner in a link to the other contains the name of the partner. This suggests that a table can participate in more than one link, since there would be no name conflicts in the table dependencies by which the multiple links would be managed. This is in fact true. Moreover, a table participating in several links can serve as the partition side in some and the replication side in others.

   Multiple Group Fields

How can effective links be done if no column can be guaranteed to have distinct items? The answer is that link fields are not restricted to a single column; any set of columns will do, as long as columns with these names appear in both tables, and the two sets of columns are in the same domain (see "Table Row and Column Domains"). The partition side of the link is then the table in which the rows have distinct sets of entries in the set of link fields. The mapping from the partition side of the link to the replication side resembles the b context function b.p more than dyadic , but is more general, and the mapping in the other direction is comparably general. Several examples of linking on more than one column appear in the "The Relational Set Operations: Union, Intersection, and Difference".

   Duplicate Items in a Link Field on the Partition Side

Even if the items of a link field or the rows of link fields are not distinct on the partition side of a link, the link can still be made; how effective it will be depends on the application. The effect of partition side duplicates can be seen from the mappings between the two sides of the link. When there is one link field, the mapping from the partition side to the replication side is of the form:
     part.link_field  repl.link_field
If the ith and jth items of the column partition.link_field are identical and i is less than j, then j does not appear in this mapping, i.e., j is not in the result of the above expression. Consequently the jth item of any column sent to the replication side of the link does not appear in that table. As for the mapping in the other direction, which in its simplest form is
     (<@1 part.link_field .= repl.link_field
      )/<#repl.link_field ,
the ith and jth elements created by this mapping are identical, and so the ith and jth items of any column sent to the partition side are identical.

   Static Links

Analogous to t.group, there is an indirect static link function t.link_i and a direct static link function t.link_d. They produce variations of the map from the replication side to the partition side which are the same as the variations produced by t.group_i and t.group_d. In particular, t.link_d does not produce the required permutation vector on the replication side; this vector must be defined by the user before any columns are sent across the link.

There is one difference between static links and static groups. After the link is established and saved, and after the two linked tables are opened in a later A+ session, link pointers must be manually set. For example, if the static link had been originally established as:

     `departments `employees t.link_i `dept_no
then the following establishes the link pointers in a later session:
     employees._L[,]`departments
     departments.!R[,]`employees

The Relational Set Operations: Union, Intersection, and Difference

The relational set operations provide examples of linking across multiple fields. They apply to pairs of tables with the same number of columns, where for every column index i, the i-th columns of the two tables are in the same domain (see "Table Row and Column Domains"). In other words, it is possible to link the two tables across the full set of columns. To reiterate the point made earlier in the chapter, it is assumed that the tables have distinct rows (which is one of the criteria in the definition of relational tables).
     Tables For the Relational Set Operation Examples:

Suppose that instead of the employees table, there are two other base tables, a salary table for all employees who receive a salary, and a commission table for all employees who receive a commission. For the purpose of illustration, the salary table can be built from the employees table as follows:

   `employees `salary t.only 'salary`intt.NA'
   `employees `salary t.send ()
(Note that there is now a salary table and a salary column.) There is one employee who receives no salary. The missing salary information for that employee is represented in the salary column by an NA value. That value was chosen to be the default numeric NA value, `intt.NA, when the mapped files for the base tables were built. Consequently the selection expression in the right argument of t.only above selects all employees who receive a salary. The resulting salary table will the same as the employees table, except that the row with emp_no equal to 300 is missing (see the base tables
figure, and the operations figure). The commission table is formed in the same way, and contains the last three rows of the employees table.
   `employees `commission t.only 'commission`intt.NA'
   `employees `commission t.send ()
See the operations figure.

Link these tables on the full set of columns; since the rows of either table are distinct, either table can be used on the partition side of the link:

   `salary `commission t.link salary._T

   Intersection

If a row of the commission table occurs in the salary table, then the corresponding element of the mapping
     commission._I_salary
must be a valid row index of the salary table, and therefore not equal to the t-created variable salary._N, whose value is the number of rows in salary. By definition, the set of rows of the commission table that also appear in the salary table is the intersection of the two tables, and therefore the intersection table can be defined as:
     t.only{`commission `intersection;
            'commission._I_salarysalary._N'}
     `commission `intersection t.send ()
     Examples of The Set Operations:

   Set Difference

The set difference "commission minus salary" is the set of rows of the commission table that are not in the salary table, i.e., the complement of the intersection relative to commission. The difference can be formed simply by changing to = in the right argument of t.only above, or by using the same right argument in the complementary t function called t.not:
     t.not{`commission `comm_minus_sal;
           'commission._I_salarysalary._N'}
     `commission `comm_minus_sal t.send ()
See the examples
figure.

The other set difference, "salary minus commission", which is the set of rows of salary that are not in commission, can be obtained from the partition map salary._J_commission; it consists of all rows j of salary for which the jth partition is empty, i.e.,

     t.only{`salary `sal_minus_comm;
            '~>#salary._J_commission'}
     `salary `sal_minus_comm t.send ()
See the examples figure.

   Union

The union of the salary and commission tables is the catenation of salary and the set difference table comm_minus_sal formed above, rows on rows:
     `salary `comm_minus_sal `union t.cat ()
     `salary `comm_minus_sal `union t.send ()
See the examples
figure. The resulting table, named union, is the same as employees, except that the row for emp_no equal to 300 is in a different position. To make union the same as employees, sort it on the emp_no column:
     `union t.sort `emp_no

   Outer Union

The set operations are too restrictive to be generally useful because they only apply to pairs of tables that can be linked on their entire set of columns, a situation that does not arise naturally in applications very often. For example, the salary and commission tables in the previous example would most likely not occur in a real application; instead, the salary table would not have the commission column and the commission table would not have the salary column. The outer union is the relational operation that produces the employees table from the more realistic salary and commission tables, which are defined below as salary1 and commission1:
     `employees `salary1 t.only 'salary`intt.NA'
     `employees `salary1 t.send (
        employees._T`commission)/employees._T
     `employees `commission1 t.only (
        'commission`intt.NA')
     `employees `commission1 t.send (
        employees._T`salary)/employees._T
This example is reduced to the previous one - and in general outer union is reduced to union - by constructing the salary and commission tables from salary1 and commission1. To do that, link salary1 and commission1 on all columns except salary and commission:
     `salary1 `commission1 t.link (
        `salary1._T`salary)/salary1._T
and send each one the missing column from the other:
     `salary1 `commission1 t.send `salary
     `commission1 `salary1 t.send (`commission;)
The function to be applied to partitions when generating the commission column in salary1 is "first element", as indicated by the right argument to t.send in the last expression (see "
How Group Functions are Specified and How t Applies Them"). Since each partition happens to consist of a single element in this case (the collections of link fields in the two tables are identical), "first element" simply selects that element. The resulting salary1 and commission1 tables are identical to salary and commission.

Definitions of t-Context Functions

   Selectors

In every example above of t.only and t.also, the right argument defining the selection, when not the Null, is a character vector containing a valid A+ expression. One example in "Row and Column Selection", suggests the use of t.in to permit special syntax, namely a right argument of the form "a,b,c" in place of the typical right argument to Member of () of the form 3 1"abc".  It is possible to extend this technique with application-specific functions that play the same role as t.in. It is also possible to permit more English like selections on specific columns by connecting application-supplied selection evaluation functions to the t selection functions. These selection evaluation functions are called selectors.

For example, it is possible to permit selections on date fields of the form '1/1/93 to 10/1/93' if there is an application-supplied selector function that can parse this expression and apply it to table columns. A selector function must satisfy the following conditions:

  • the syntax of a selector function is the same as callback functions, namely:
    selector{s;d;i;p;c;v}
    (the index argument i holds the selection criteria, such as '1/1/93 to 10/1/93', the context argument c holds the table name, the variable argument v holds the column name, and the data argument d holds the value of the column variable);

  • the result of a selector function is a boolean vector of the same length as the table column named by the arguments c and v, with 1 indicating that the corresponding item of the column is selected.1
For instance, if date ranges are given as '1/1/93 to 10/1/93', the selector function might be:
     date_selection{s;d;i;p;c;v}:{
          i' ',i;
          b' '=i;
          (f;t)0 2#(b)i;
          (df)^(ft)
     }
A selector function can be connected to the column of a table in one of two ways. It may be specified when a table is opened with t.open, or the t.selector attribute is specified for the column with the selector function as its value, as in:
     `prices.date_col _set (`t.selector;date_selection)
where prices is the table containing date_col. Once connected, whenever a selection of the following form is made on the date_col column of the table named prices:
     (`date_col;'1/1/93 to 10/1/93')
the selector function is called. This type of selection can be made with any of the t selection functions, t.only, t.also, and t.not.

A selector can also be specified by a pair (fcn;static_data), as in

     `prices.date_col _set (`t.selector;
                           (date_selection;date_style))
where the data has the same significance as in the right argument of _scb.

Several column selections can be made at once, as in:

     (`date_col;'1/1/93 to 10/1/93';
      `time_col;'9:00 A.M. to 4:30 P.M.')
Each of the two selector functions will create a boolean vector. The two vectors can be combined into a single selection result in one of two ways, either by ORing or ANDing them together (although in this particular example only AND seems to make sense). The function to be used, or ^, is the contents of the t-variable t.CONNECT.

A column in a target table that is the image of one in a source table will use the selector of its source column if one of its own has not been specified.

Selectors are specified in the right arguments of t.open and t.define.

   Dependency Frames

A dependency frame is a character vector whose contents are an A+ expression preceded by a colon.

When a column is sent from one table to another, by default the target column is defined to be a dependency on the source column, basically of the following form, where f is defined by t:

     target.col:f{source.col}
A dependency frame is the means of modifying this definition (see t.send). In this example, wherever the column name col appears in the dependency frame, it is replaced by f{source.col}, and the resulting expression becomes the definition of the dependency target.col. For example, if the dependency frame is ":col", the target column dependency will be:
     target.col:f{source.col}
Dependencies are specified in the right argument of t.send.

   How Group Functions are Specified and How t Applies Them

There are four ways that t applies group functions to a partitioned column, and the method chosen in most cases depends on how the group function is denoted in the right argument to t.send. There are various ways to attach a group function to a column, the simplest being as a column-function pair such as (salary;f); see the definition of t.send for the others. No matter how the attachment is done, the ways in which group functions themselves are denoted are always the same.

Using the partitioned column partition_of_salary defined in "How t Manages Group Fields", the ways t applies group functions are:

  1. if the group function is specified by <, it is, in effect, not applied. The new salary column in the bd_view table is:
         partition_of_salary

  2. if the group function is specified by the Null then it is taken to be the first item function
         fe{v}:if (0=#v) _N else 0#v
    which is formally applied in the standard way (see 3) below):
         >fepartition_of_salary
    However, t maintains the t-created variable bd_view._K that is defined to be the vector of first items of the partition subcolumns:
         bd_view._K>fe bd_view._J
    and consequently the new salary column in the departments table is:
         bd_view._K#employees.salary

  3. if the group function is specified by any valid function expression f, e.g. + or +/, it is applied as follows:
         >fpartition_of_salary

  4. if the group function is specified as a character vector containing any valid function expression, as in "f", it is applied as follows:
         fpartition_of_salary
Similar definitions apply to group functions for linked tables.

Business Days t.calendar{s}

   Argument and Result
The argument s is a character vector, and the result is an integer vector.
   Definition
The argument s specifies the beginning date, ending date of a time series in the form:
     'begin-date  end-date'
where both beginning date and ending date are of the form mm/dd/yyyy. The result is an integer vector of all business days between beginning date and ending date. Each integer in the result is of the form
     0 100 100 year,month,day
where year is a four-digit integer, as in 1993, and month and day are at most two-digit integers.

Note that the script dio.+ must be loaded before this function is used.

Calendar Indices t.series{w;x}

   Arguments and Result
The left argument w is a symbol scalar holding the name of a global variable, the right argument x is a character vector, and the result is an integer vector.
   Definition
It is assumed that the variable named in the left argument has had its `t.calendar attribute set, either indirectly with t.open or directly with _set. If so, this function produces indices into the value of that attribute, as follows (where calendar is w _get `t.calendar):
     w t.series 'begin_date  end_date'
           for begin_date to end_date

     w t.series '            end_date'
           for 0 to end_date

     w t.series 'begin_date          '
           for begin_date to (#calendar)-1

     w t.series '                    '
           for #calendar
The extra spaces in the right arguments are only for readability. Both begin_date and end_date are in the same format as the right argument to t.calendar, basically dd/mm/yyyy.

Catenation t.cat{w;}

   Argument and Result
The argument w is a symbol vector which must have at least three elements to be meaningful. The result equals w.
   Definition
Suppose that w is `s0 `s1 ... `sn `v.  The effect of this function is to initialize the view `v as the catenation of the tables `s0 through `sn. Every element `si is the name of an existing table, either a base table or a view. The names of the columns in any `si must be the same as in any other `sj. In addition, any pair of columns from `si and `sj with the same name must be in the same domain (see "Table Row and Column Domains").

When t.send is subsequently executed to populate the view `v with columns, its left argument need not equal w, even though w as the right argument of t.send is by far the most useful case. Only columns of those tables specified in the left argument to t.send will appear in `v, and in the same order (top to bottom) as table names appear in that left argument (left to right).

   Example
See the set union example in "The Relational Set Operations: Union, Intersection, and Difference".

Close Columns of a Table t.close{w;f}

   Arguments and Result
The left argument w is a symbol scalar, while the right argument f and the result are symbol vectors. The right argument f can also be the Null.
   Definition
The left argument w is the name of a t-table. If the right argument f is nonempty, then its elements are the names of columns of the t-table w. In this case the following is done:

  • the columns named in f are removed from the table w, i.e., from w%`_T;

  • if the table w is a view, the objects that define the columns named in f are removed from the table context, but not if w is a base table;

  • the columns in any other t-tables that were sent from any columns of w named in f are removed from those tables, and the objects that define them are removed from those table contexts; in addition, those table contexts are removed for views that now have no columns;

  • any links to other t-tables are removed in which a column named in f is a link field.
If f is the Null then all columns of the table are treated in this manner. In addition, all table variables are removed, and in the case of a view, the table context itself is removed.

The result is a list of names of all t-tables whose table variables _T are modified by this evaluation.

Note that if the right argument is the Null and the table is bound to a display class when closed, it is unbound.

Complement t.not{w;e}

   Arguments and Result
The left argument w is either a two-element symbol vector, a one-element symbol vector, or a symbol scalar. The right argument e is either a character or integral vector or scalar, or the Null. The result is an integer scalar.
   Definition
This function is the complement of t.only; it behaves exactly like t.only, except that it selects those rows that would not be selected if t.only were executed with the same arguments. If both the source and target are named in the left argument, then complement refers to the source table, while if only the target is named, complement refers to current view. In particular, if the right argument is the Null and both the source and target are named in the left argument, the resulting view has no rows, while if only the target is named, the resulting view has all rows in the source that are not in the current view.
   Example
See the example in "Set Difference", as well as the example under t.only for a numeric right argument. Also:
     tab.a100
     `tab t.open `a
     `tab `view t.only 'a<90'
 90
     `tab `view t.send `a
     `view t.only 'a<40'
 40
     `view t.not 'a<10'       The complement in the view.
 30
     `tab `view t.not 'a<10'  The complement in the source.
 90
     `view t.not ()    The complement of the current view in the source.
 10
     `tab `view t.not ()      The empty view.
 0

Create and Initialize a Base Table t.open{w;x}

   Arguments and Result
The left argument w is either a symbol scalar, a character vector, a two-element nested vector consisting of a symbol scalar and a character vector in either order, or the Null. The right argument x is a symbol vector, an association list, a nested association list, a slotfiller, or a nested slotfiller. The result is a symbol scalar.
   Definition
This function creates and initializes t-tables. The meaning of the left argument is:

  1. A symbol scalar left argument is the name of the table to be opened. Any mapped files designated to be opened by the right argument are assumed to be in the current directory (./, i.e., the directory displayed when $pwd is executed in the A+ session).

  2. A character vector left argument is the name of the directory location of the mapped files in the table. The empty character vector designates the current directory (see the first case). The name of the table is taken to be that of the current context.

  3. The meanings of the symbol scalar and character vector in the two-element nested vector form of the left argument are the same as 1 and 2.

  4. The Null left argument means that the name of the table is taken to be that of the current context, and the directory is the root directory (./).
The meaning of the right argument is:

Note that once an attribute is given a value in t.open, that value can be retrieved with _get. Attributes can also be given values directly with _set, as well as with t.open.

The result of the function is the name of the opened table.

   Examples
  1. From the root context, open the table x whose columns are the existing variables x.y and x.z:
    `x t.open `y `z

  2. From the x context, open the table x whose columns are all existing variables (in the x context):
    `x t.open ()

  3. Open the table x whose column y is to be defined as 100:
    `x t.open (`y;'100')
    Note that when a column with an unqualified name is defined, the variable is created in the context of the table (x in this case).

  4. Open the table x whose column y is to be defined as 100 and column z is to be defined by the dependency definition w.z*2:
    `x t.open (`y;'100';`z;':w.z*2')
    or
    `x t.open (`y`z;('100';':w.z*2'))

  5. Open the table x whose column y is to be defined as 100 with the NA value -1234:
    `x t.open (`y;(`;'100';`na;1234)
    or
    `x t.open (`y;(` `na;('100';1234)))

  6. Open the table x whose column y is to be defined as 100 with the application-defined attribute fill whose value is '*':
    `x t.open (`y;(`;'100';`fill;'*'))
    or
    `x t.open (`y;(` `fill;('100';'*')))

  7. Open the table x whose column z is to be defined by the itemwise dependency definition [i]:w.z[i]*2:
    `x t.open (`z;'[i]:w.z[i]*2')

  8. Open the table x whose column z is to be defined as the mapped file /usr/local/lib/data.m, opened for reading only:
    (`x;'/usr/local/lib/') t.open (`z;'0data')

  9. From the x context, open the table x whose column z is to be defined as the mapped file /usr/local/lib/data.m, opened for updating:
    $cx x
    () t.open (`z;'1/usr/local/lib/data')

  10. The current directory is the one displayed when $pwd is executed in the A+ session. Assuming that the current directory is /usr/local/lib/ and the current context is x, open the table x whose column z is to be defined as the mapped file /usr/local/lib/data.m, opened for local updating:
    '' t.open (`z;'2data')

  11. Open the table x whose column z is to be defined as the sys.imp of the contents of the mapped file /usr/local/lib/data.m:
    (`x;'/usr/local/lib/') t.open (`z;'1data')

  12. Open the table x whose column z is to be defined as the of the contents of the mapped file /usr/local/lib/data.m:
    (`x;'/usr/local/lib/') t.open (`z;'2data')

  13. Everything is the same as the previous example, except the column is also named data:
    (`x;'/usr/local/lib/') t.open (`data;2)

  14. Open the table x whose column z is to be defined as the mapped file /usr/local/lib/data.m, opened for reading only, to which is appended the mapped file /usr/local/lib/data2.m:
    (`x;'/usr/local/lib/') t.open (`z;'0data,data2')
t.load is a synonym for t.open.

Define a Column t.define{w;x}

   Arguments and Result
The left argument w is either a symbol scalar, a character vector, a two-element nested vector consisting of a symbol scalar and a character vector in either order, or the Null. The right argument x is a symbol vector, an association list, a nested association list, a slotfiller, or a nested slotfiller. The result is a symbol scalar.
   Definition
This function is like t.open except that only one column can be created; if the table already exists, this column is appended to it, and otherwise the table is created with this column as its only column. The left argument w is the same as t.open. The right argument x is also the same as t.open, except that it specifies just one column. The result is a symbol scalar holding the fully qualified name of the defined column.
   Example
See "Grouping by Intervals".

Detach a Column from its Sources t.detach{w;x}

   Arguments and Result
The left argument w is a nonempty symbol vector. The right argument x is any array.
   Definition
The left argument w holds a list of table names. The table named in the last element of w is where the execution of this function has effect, and is called the target table in this definition. Any table named as one of the other elements of w is called a source table in this definition. The target table was either created from the source table(s) by a selection function such as t.only, or is the partition side of a link to the source table. If z is any column in the target table that is defined by t as a dependency on a column in one of the source tables, then the effect of this function is to make z an ordinary variable with its value equal to the current value of the dependency.

The right argument is currently not used. The result equals the left argument when source tables are specified, and otherwise is the same as the result would have been had all source tables been specified.

This function is useful when the columns in source tables are large and no longer of direct interest once links and views have been formed. These columns can be detached from their targets, leaving the current values of the targets intact, and then expunged.

Direct Static Link t.link_d{w;f}

   Arguments and Result
The left argument w is a two-element symbol vector and the right argument f is a symbol vector, a two-element nested vector whose items are symbol vectors of the same length, or the Null.
   Definition
The definition is analogous to that of t.link, and the differences are discussed in "Static Grouping" and "Static Links".
   Example
See "Static Grouping" and "Static Links".

Direct Static Summary t.group_d{w;f}

   Arguments and Result
The left argument w is a two-element symbol vector, and the right argument is a symbol vector or scalar, or the Null.
   Definition
The definition is analogous to that of t.group, and the differences are discussed in "Static Grouping".
   Example
See "Static Grouping".

Disperse t.disperse{w;s}

   Arguments and Result
The left argument w is a two-element symbol vector, and the right argument s is a symbol scalar or one-element symbol vector. The result is a symbol scalar or symbol vector.
   Definition
This function is a utility function in t. It is t-like in its function, but not directly related to t-tables.

The first element of the left argument w is a source context, and the second element is a target context. The right argument s holds the name of a slotfiller or nested slotfiller in the source context, i.e., the slotfiller is w[0]%s.

In the case of a slotfiller, this function creates a dependency in the target context for every symbolic index y, whose name is the name held by y, and whose definition is yw[0]%s. An assignment callback is defined on this dependency so that whenever the dependency is assigned a value, the slotfiller element yw[0]%s is also assigned this value. In this way data organized in a slotfiller is dispersed to global variables, where it can serve as columns in t-tables or screen objects.

The result in the slotfiller case is w[1].

In the nested slotfiller case, contexts whose names are prefixed by the name in w[1] are created for every level of the slotfiller, dependencies are created in these contexts, and assignment callbacks are defined, all analogous to the slotfiller case above. The result in this case is a list of names, as symbols, of the created contexts corresponding to the ordinary slotfillers at the bottom of the nested slotfiller.

   Example
     x.b10x.a3
     x.slot(`k`m;(x.a;x.b))
     `x `y t.disperse `slot

     _def `y.m
m:`mx.slot
     y.m-y.m
     `mx.slot
 0 10 20

Dynamic Derived Table t.always{w;e}

   Arguments and Result
The left argument w is either a a one- or two-element symbol vector, or a symbol scalar. The right argument e is a character vector or scalar, or the Null. The result is an integer scalar.
   Definition
If the right argument e is a nonempty character vector or character scalar, this function has the same effect as t.only, except that the selection defined by e remains active. That is, if any column in the source table whose name appears in e changes, the selection is recalculated. If the right argument is the Null then this function has the same effect as t.only, and in addition any active connection is broken.

The result is the number of selected rows.

Dynamic Sorted Derived Table t.sorted{w;x}

   Arguments and Result
The left argument w is either a one- or two-element symbol vector, or a symbol scalar, or the Null. The right argument is either a nonempty symbol vector or an association list. The result is an integer scalar.
   Definition
This function is to t.sort as t.always is to t.only: a table is sorted just as it is by t.sort, but it is also sorted again whenever one of the columns named in x changes.

The result is the number of rows in the sorted table.

Find t.in{a;b}

   Arguments and Result
The left argument a is a character matrix and the right argument b is a character vector or scalar. The result is a boolean vector of size #a.
   Definition
This function is a utility function in t. The right argument holds a list of character strings, each of length 1#a, separated by commas. If a matrix c is formed with these character strings as rows, then t.in{a;b} equals ac.

This function can be used to form selections in the right argument of selection functions such as t.only.

   Example
The selection 'dept_no3 3"D11D21D31"' in "Row and Column Selection" can be phrased in the more English like 'dept_no in "D11,D21,D31"'. See "Selectors" for more on English like selections.

Fix a View t.fix{d;b}

   Arguments and Result
The left argument d is a one-element symbol vector or a symbol scalar. The right argument b is a one-element integral vector or an integral scalar. The result is an integer scalar.
   Definition
The table named by the left argument d should be a view in which row selections are done, e.g., with t.also. When t.fix{d;1} is executed the current view d is fixed; any further selections done in the view2 will refer to no rows in the source of d other than those present at the time t.fix{d;1} was executed. A subsequent execution of t.fix{d;0} releases the fixed view, i.e., returns to the default setting.
   Example
     src.a100
     `src t.only 'a<90'
 90             The number of rows in view
     `view t.fix 1
     `src `view t.only '20<a'
 20
     `src `view t.also '80>a'
 29             Only 9 rows are appended, rows 81 through 89 of src
     `view t.fix 0
     `src `view t.also '80>a'
 39             Now rows 90 through 99 of src appear in view

Index t.index{i;x}

   Arguments and Result
The left argument i is an integer vector and the right argument x is a symbol scalar holding the name of a t-table column. If f is the table column named by x, i.e., f%x, then the result has shape (i),(1f) and type f.
   Definition
This function is a utility function in t. It is used in the definitions of columns sent to views, which are defined formally as i#x, but are actually t.index{i;x}. It is like the system function _index, except that the NA value is not specified. Instead, the NA value is t.na{x}.

A+ applications can use t.index wherever _index would otherwise be used but defaulting to this definition of NA values makes sense.

   Example
See "How t Manages Row and Column Selection".

Indirect Static Link t.link_i{w;f}

   Arguments and Result
The left argument w is a two-element symbol vector and the right argument f is a symbol vector, a two-element nested vector whose items are symbol vectors of the same length, or the Null.
   Definition
The definition is analogous to that of t.link, and the differences are discussed in "Static Grouping" and "Static Links".
   Example
See "Static Grouping" and "Static Links".

Indirect Static Summary t.group_i{w;f}

   Arguments and Result
The left argument w is a two-element symbol vector, and the right argument is a symbol vector or scalar, or the Null.
   Definition
The definition is analogous to that of t.group, and the differences are discussed in "Static Grouping".
   Example
See "Static Grouping".

Lightweight Column Definition t.let{d;f}

   Arguments and Result
The left argument d is a symbol scalar or one-element vector, and the right argument f is a symbol scalar or nonempty symbol vector. The result is a symbol scalar or symbol vector with the same number of items as the right argument f.
   Definition
The left argument d is the name of a table, and each symbol in the right argument f is the name of an existing global variable or dependency. These names can be qualified or unqualified, and if unqualified, the object is assumed to be in the table context of d. The effect of this function is to append the objects named in f to the table d as new columns; note that the definitions of these columns are independent of t, unlike columns specified in t.open or t.define. The result is a symbol scalar or vector holding the fully qualified name of every defined column.

Link and Send t.relate{s;d;f;g;h}

   Arguments
The arguments s and d are symbol scalars. The argument f is a valid right argument of t.link when the left argument is s,d. The arguments g and h are valid right arguments for t.send when the left arguments are s,d and d,s, respectively.
   Definition
t.relate{s;d;f;g;h} is equivalent to executing the following expressions:
     (s,d) t.link f
     (s,d) t.send g
     (d,s) t.send h

Link Two Tables t.link{w;f}

   Arguments
The left argument w is a two-element symbol vector and the right argument f is a symbol vector, or a two-element nested vector whose items are symbol vectors of the same length, or the Null.
   Definition
The symbols in the left argument are the names of tables, either base or view. The symbols in a symbol vector right argument are the names of columns called link fields that appear in both tables named in the left argument. The effect of this function is to link the two tables on the specified link fields, which means that mappings are established between the two tables that govern the way columns are sent from one to the other.

If the right argument is a two-element nested vector, then the symbols in the first item identify the link fields in the table named in the first element of the left argument, and the symbols in the second element identify the corresponding link fields in the other table. A Null right argument breaks any existing links between the two tables named in the left argument.

See "Linking Tables" for details.

   Example
See the examples that follow "Linking Tables".

Link, with Permutation t.link_b{w;f}

   Arguments and Result
The left argument w is a two-element symbol vector and the right argument f is a symbol scalar, or a one-element symbol vector, or a two-element nested vector whose items are symbol scalars or a one-element symbol vectors.
   Definition
This function, like t.link, establishes a link between the two tables named in the left argument. As with t.link, the first element of the left argument names the partition side of the link and the second element names the replication side, and the right argument names the link field(s). The differences in the two functions are that there can only be one link field here, and the mappings between the two tables are computed differently: this function should be used for tables wherever b.p should be used instead of dyadic .

Let table l be the partition side and table r the replication side. Unlike t.link, this function requires that a sort vector for the link field(s) on the replication side be known, and that sort vector is the user-defined table variable r._H_l. Specifically, this vector must have the following meaning. Say the link field on the partition side is p and on the replication side is r. Then r._H_l must be a permutation vector so that the items of r._H_l#r%p are in nondecreasing order (see "Sorted Arguments to the b-Context Functions", for the definition of nondecreasing order). The t-defined table dependency l._G_r is defined by the expression:

     b.pr{r_f;r._H_l;r%p}
The partition side mapping l._J_r is derived directly from l._G_r and r._H_l, and the replication side mapping r._I_l is then derived directly from l._J_r. See, for example, "Static Grouping".

NA Value t.na{x}

   Arguments and Result
The argument x is a symbol scalar holding the name of a t-table column. The result is an array.
   Definition
This function is a utility function in t. It is used to produce a substitute value for a column item when that column is indexed by t with an out of range value, which can occur when columns in tables are of different sizes. The substitute value is determined as follows:

  • if the `na attribute of the column x has been set, use that value;

  • otherwise, if the `t.sent attribute has been set and its value is the symbol s (see t.open) , and sy is the name of the source column of x, and if the A+ types of x and sy are identical , i.e., if %x equals s%y, use the NA value for sy, as determined by these same rules;

  • otherwise, use (%x)t.NA.

Populate a View Table t.send{w;f}

   Arguments and Result
The left argument w is a symbol vector with at least two elements, or an array complying with the left argument specification of t.open. The right argument f is a symbol vector, or an association list, a nested slotfiller, or an array complying with the right argument specification of t.open. The result is a two-column symbol matrix.
   Definition
This function is used to populate a view created by a selection function such as t.only, or t.group, or to send columns from one side of a link to the other. This is accomplished by specifying three things: the names of the columns in the source table(s), the names of the corresponding columns in the target table, and the definitions of the target table columns in terms of the source table columns.

The meaning of the left argument is:

  • A two-element symbol vector left argument specifies the source table from which columns are sent (0w) and the target table that receives columns (1w).

  • A symbol vector left argument with more than two elements is a special case related to t.cat, and the execution of t.send should have been preceded by an execution of t.cat. When t.send is used to populate the target of t.cat, not all the source tables of the target need be used, and the source tables can be given in any order. Only columns from the source tables appearing in this left argument are catenated, in the order in which they appear.

  • Any other left argument, taken together with the right argument, must form a valid left argument, right argument pair for t.open, and the meaning of this function in that case is exactly the same as for t.open.
When the left argument is a symbol vector with at least two elements, the meaning of the right argument is:
A set callback is placed on each field that is sent. It can be removed by executing fld _scb (;).
   Examples
See the examples earlier in this chapter for various uses of t.send. Other cases when t.send is not equivalent to t.open are:

  1. Send a column csrc from the source table src to the target table ctar and name it csrc in the target table:
    `src `tar t.send (`ctar;`csrc)
    or
    `src `tar t.send (`ctar;<`csrc)
    or
    `src `tar t.send (`ctar;(`_from;`csrc))

  2. Adding to example 1, suppose that the target table was established by t.group and the group function bf is to be sent as well:
    `src `tar t.send (`ctar;(`csrc;bf))
    or
    `src `tar t.send (`ctar;(`_func`_from;(bf;`csrc)))

Random Sample t.sample{w;n}

   Arguments and Result
The left argument w is either a symbol scalar or a one-element or two-element symbol vector. The right argument n is an integer or the Null. The result is also an integer.
   Definition
If the left argument has two elements, the first element holds the name of an existing table, base or view, and the second element holds the name of a table to be created by this function. If the right argument is an integer, then the created table is a random sample of n rows of the existing table, and the result equals n. If the right argument is the Null, then the created table is a rowwise permutation of the existing table, and the result is the number of rows in either one.

A one-element left argument holds the name of an existing view. If the right argument is an integer, the effect is to restrict the view to a random sample of n rows, and the result equals n. If the right argument is the Null, the effect is permute the rows of the view, and the result equals the number of rows in the view.

Reset t.reset{}

   Result
The result is a symbol vector.
   Definition
Close all t-tables, i.e., execute s t.close () for all existing t-tables s. The result is a list of names, as symbols, of the closed tables.

Restrict a Table t.only{w;e}

   Arguments and Result
The left argument w is either a two-element symbol vector, a one-element symbol vector, or a symbol scalar. The right argument e is either a character or integral vector or scalar, or the Null. The result is an integer scalar.
   Definition
The right argument e denotes a row selection in a source table that is realized in a target table. The source and target tables are specified in the left argument. The result is the number of rows selected.

The symbols in the left argument are the names of tables, either base or view. If the left argument has two elements, then the first one denotes the source table of the selection and the second one the target table; if it has one element, it denotes the target table. When the left argument has two elements and the target table does not exist, it is created; when the argument has one element, it is assumed to be an existing table.

The target table cannot be a base table, i.e., it cannot be one created by t.open. A view table can serve as either the source and target table.

In the case of a two-element left argument, the right argument defines a selection of the rows in the source table that will make up the target table. If the right argument is an integer vector or scalar it is assumed to hold the indices of those rows in the source table. If the right argument is a character vector or scalar it is assumed to hold an A+ integer-valued expression; calling the value of this expression v, the target table will consist of the source table rows with row indices v/#v.

In the case of a one-element left argument, the right argument defines a selection of rows in the existing target table. If the right argument is an integer vector or scalar, it is assumed to hold the indices of rows in the source table that are currently in the target table, while if the right argument is a character vector or scalar it defines a selection of rows from the current target table.

When the right argument is the Null, the resulting view contains all rows of the source, no matter whether the left argument has one or two elements.

When the right argument is an integer vector or scalar it is most likely the result of an A+ expression, and when it is a character vector or scalar it contains an A+ expression. The difference between the two forms of right argument is due to the way t evaluates a character right argument. For example, suppose a selection is to choose all rows for which the value of the column named col is greater than 10. Then a character right argument should be 'col>10' or an equivalent statement, and should not refer directly to the source table. See the utility function t.in for another example.

Note that t.only simply defines view tables; it does not populate them with columns. For that purpose, see t.send.

   Example
See "Row and Column Selection". Note that:
     `employees `p_employees t.only '181 0'
has the effect of creating the view p_employees with rows from the employees table with indices (181 0)/18. The equivalent selection can be made with the latter expression as the numeric right argument to t.only, as in:
     `employees `p_employees t.only (181 0)/18

Screen Table t.table{w}

   Arguments and Result
The argument w is either a one- or two-element symbol vector. The result is a symbol scalar.
   Definition
If the argument w has one element then it is either a qualified or unqualified name; if unqualified, it is the name of a t-table, whereas if qualified, it is the name of a variable in the context of a t-table. An unqualified name is treated as if it were the qualified name w_T_. A two-element argument w is treated as if it were the qualified name w[0]w[1]. The result is this qualified name. An object with this name is created that contains the same value as that described for _T_ in the table "t-Created Variables, Dependencies Common to All Table Contexts". And, finally, this object is bound to the table display class (in particular, this function assumes that the s context has been loaded).
   Example
See "Successive Multiple Group Fields".

Sort t.sort{w;x}

   Arguments and Result
The left argument w is either a one- or two-element symbol vector, or a symbol scalar, or the Null. The right argument is either a nonempty symbol vector or association list or the Null. The result is an integer scalar.
   Definition
The symbols in the left argument are the names of tables, either base or view. If the left argument has two elements then the first one denotes the source table of the selection and the second one the target table; if it has one element, it denotes the target table. When the left argument has two elements and the target table does not exist, it is created; when it has one element, it is assumed to be an existing table.

The target table cannot be a base table, i.e., it cannot be one created by t.open. A view table can serve as either the source and target table.

If the left argument w has one element and the right argument x is a nonempty symbol vector or symbol scalar, the effect of this function is to sort the table named by w, as follows. The A+ primitive Grade Up is applied to the column named by the last element in x, and the resulting permutation vector is applied to all columns of the table. Grade Up is then applied to the column named by the next to last element in x, and the resulting permutation vector is applied to all columns of the table. This process continues until Grade Up has been applied to all columns named in x, in their right to left order of appearance.

If instead the right argument x is an association list, then the symbol in each symbol, value pair is the name of a column, and the value is either 0 or 1. The sorting process described above is modified so that Grade Up is applied to a column only when its associated value is 1, and otherwise Grade Down is applied.

When the left argument has two elements, the first element names a source table and the second element a view of that source. The effect of this function is apply the sorting process to the source table to obtain a permutation vector, although that table is left unchanged; the permutation vector is applied to the rows of the view table instead.

If the right argument is the Null then a table is returned to its unsorted order.

Successive Grouping t.report{w;f}

   Arguments and Result
The left argument w is a two-element symbol vector. The right argument f is a symbol scalar or nonempty symbol vector.
   Definition
The symbols in the left argument hold the names of tables. As in t.group, the first element names an existing base or view table, called the source table, and the second element names a view table to be created by this function, called the target table. The symbols in the right argument hold the names of columns in the source table. Unlike t.group, where grouping is done on the rows of the collection of columns named in the right argument, here the grouping is done successively on the individual columns, starting with the first one named in right argument. That is, all rows with common values in the first column named in the right argument are grouped, just as in t.group with only one column named in the right argument. Then within each such group, all rows with common values in the second column named in the right argument are grouped, and so on. The effect of this function is to form a series of intermediate tables between the source and target tables, one for each column named in the right argument.

As with other t functions, the view created by t.report must be populated with columns from the source table, using t.send. In this case, however, t contributes a column of row headings indicating the successive grouping. This column is named _ and is the first name in _T.

   Example
See "Successive Multiple Group Fields".

Summarize a Table t.group{w;f} or t.break{w;f}

   Arguments and Result
The left argument w is a two-element symbol vector, and the right argument is a symbol vector or scalar, or the Null, or a slotfiller.
   Definition
The left argument holds the names of the source table and destination table.

The symbols in the left argument are the names of tables. The first element names an existing base or view table, called the source table, and the second element names a view table to be created by this function, called the target table. The symbols in the right argument, including the case of the symbolic indices in a slotfiller, are the names of columns called group fields that appear in the source table; all fields are group fields if the right argument is the Null. The effect of this function is to establish a onesided link from the source table to the target table on the specified group fields, with the source table acting as the partition side of the link, which means that mappings are established between the two tables that govern the way columns are sent from one to the other. See "Group Fields and Group Functions" for details. In the case of a slotfiller right argument, every value `af is an integer vector specifying the group-by-interval values for the field a.

t.break is a synonym for t.group.

Summarize and Send t.partition{s;d;f;g}

   Arguments
The arguments s and d are symbol scalars. The argument f is a valid right argument of t.group when the left argument is s,d. The argument g is a valid right argument for t.send when the left argument is s,d .
   Definition
t.partition{s;d;f;g} is equivalent to executing the following expressions:
     (s,d) t.group f
     (s,d) t.send g

Union t.also{w;e}

   Arguments and Result
The left argument w is either a one- or two-element symbol vector or a symbol scalar. The right argument e is either a character or integral vector or scalar, or the Null. The result is an integer scalar.
   Definition
The right argument e denotes a row selection in a source table that is appended to a target table. The source and target tables are specified in the left argument. The result is the number of rows selected.

The symbols in the left argument are the names of tables, either base or view. If the left argument has two elements, then the first one denotes the source table of the selection and the second one the target table; if it has one element, it denotes the target table. When the left argument has two elements and the target table does not exist, it is created; when the argument has one element, it is assumed to be an existing table.

The target table cannot be a base table, i.e., it cannot be one created by t.open. A view table can serve as either the source and target table.

In the case of a two-element left argument, the right argument defines a selection of the rows in the source table that will be appended to the target table. If the right argument is an integer vector or scalar, it is assumed to hold the indices of those rows in the source table. If the right argument is a character vector or scalar, it is assumed to hold an A+ integer-valued expression; calling the value of this expression v, the source table rows to be appended to the target table are those in v/#v not already in the target table.

In the case of a one-element left argument, the right argument defines a selection of rows in the complement of the current target table, i.e., rows in the source table that are not in the target table. If the right argument is an integer vector or scalar, it is assumed to hold the indices of rows in the source table that are currently in the complement of target table, whereas if the right argument is a character vector or scalar, it defines a selection of rows in the complement of the current target table. The rows selected from the complement are appended to the current target table.

In the case of a two-element left argument, any unqualified table column names in the right argument refer to the source table, whereas for a one-element left argument, they refer to the target table. In the latter case, the columns so named must have already been sent to the target table.

When the right argument is the Null, the resulting view contains all rows of the source, no matter whether the left argument has one or two elements.

When the right argument is an integer vector or scalar, it is most likely the result of an A+ expression, and when it is a character vector or scalar it contains an A+ expression. The difference between the two forms of right arguments are due to the way t evaluates a character right argument. For example, suppose a selection is to choose all rows for which the value of the column named col is greater than 10. Then a character right argument should be 'col>10' or an equivalent statement, and should not refer directly to the source table. See t.in for another example.

Note that t.also simply defines view tables; it does not populate them with columns. For that purpose, see t.send.

   Example
See "Row and Column Selection".

View and Send t.view{s;d;f}

   Arguments
The arguments s and d are symbol scalars. The argument f is a valid right argument of t.send for the left argument s,d.
   Definition
t.view{s;d;f} is equivalent to executing the following expressions:
     (s,d) t.only ()
     (s,d) t.send f

Table Variables and Dependencies

t-Context Global Objects
NameDescription
t.CONNECT This function is either or ^; see "Selectors" for its use.
t.NAThis variable is a slotfiller holding the default NA values. It is: (`int `float `char `sym `box `func `null; (999999999; 999999999.; ' '; `; <(); <{}; <()))
t.TABLESThis variable holds a list of names, as symbols, of all the t-tables created in this A+ session.

The variables described in the following table appear in every table context created by t. They are referred to by fully qualified names only when necessary.

t-Created Variables, Dependencies Common to All Table Contexts
NameDescription
_A This variable holds the value 1<V in the specification of the following (see "Grouping by Intervals"):
`src `this_table t.group (`group_field;V)
In general, this variable is a nested vector of integer vectors whose items are grouping by intervals specifications corresponding to the columns in _T.
_D This variable holds a list of names, as symbols, of the target tables for which this table is a source.
_D_ This dependency is a nested slotfiller of the items in _D; the top level is the name of this table; the next level holds the names of the views created directly from this table; the next level holds the names of the views created directly from those views; and so on.
Display this dependency as a tree object for a convenient representation.
_F When t.fix is executed with the right argument 1 for this table, this variable is assigned the current value of _V. Initially, and when t.fix is executed with the right argument 0 for this table, this variable is set to the Null.
_G_r This dependency is defined by t when this table is on the partition side of a link made with t.link_b. Let l denote this table and let r denote the table on the replication of the link. This dependency is computed from b.pr and the sort vector r._H_l, and is the first step in the efficient computation of the mappings between the two sides on the link. See t.link_b.
_H_l This dependency is user defined for t.link_b, t.link_d, and t.group_d, but defined by t for t.link_i and t.group_i. Its value is a permutation vector used in the definition of the map from the source (this table) to the view in the case of grouping, and in the case of links, from the replication side (this table) to the partition side. The view or partition side is table l.
_I_l This dependency defines the mapping from the partition side of a link (the table l) to the replication side (this table). See "How t Manages Table Links".
Note that the name of this mapping is specific to these two tables, so any table can be linked to several others at the same time.
_J When this table is created by t.group, this dependency defines the mapping from the source table to this table. See "How t Manages Group Fields".
_J_r This dependency defines the mapping from the replication side of a link (the table r) to the partition side (this table). See "How t Manages Table Links".
Note that the name of this mapping is specific to these two tables, so any table can be linked to several others at the same time.
_K When this table is created by t.group, the value of this dependency is the first element of every item of _J. This dependency is used to implement the default group function for a column sent to this table.
_K_r This value of this dependency is the first element of every item of _J_r. When this table is serving as the partition side of a link, this dependency is used to implement the default group function for a column sent to this table.
_L The value of this dependency is a list of names, as symbols, of those tables on the partition side of a link with this table.
_L_ The value of this dependency is a two-column symbol matrix whose rows hold the names, as symbols, of partition side, replication side tables in table links. All links with this table as the partition side appear in this matrix; for all tables on the replication side of a link with this table, all links with those tables as the partition side also appear in this matrix; and so on (until the transitive closure is complete).
_M The value of this dependency is the depth (monadic ) of the column named by 0#_T; it is the depth of this table if all columns have the same depth.
_N The value of this dependency is the number of items in the column named by 0#_T; it is the number of rows in this table if all columns have the same number of items.
_O This variable is a two-element nested vector that is set for this table if it is created with t.open; the first element holds the directory specified in the left argument of t.open (or the default), and the second element holds the field specifications in the right argument.
_R The value of this dependency is a list of names, as symbols, of those tables on the replication side of a link with this table.
_R_ The value of this dependency is a two-column symbol matrix whose rows hold the names, as symbols, of replication side, partition side tables in table links. All links with this table as the replication side appear in this matrix; for all tables on the partition side of a link with this table, all links with those tables as the replication side also appear in this matrix; and so on (until the transitive closure is complete).
_S This variable holds a list of names, as symbols, of the source tables for which this table is a target; see t.group, t.cat, and t.only. If _S is identical to the Null, then this table is a base table. (More than one source table can occur with table catenation.)
_S_ The value of this dependency is a list of names, as symbols, of the base tables that are the ultimate sources of this table, i.e. from which the creation of this table can be traced through a series of applications of t.group, t.cat, and t.only.
_T This variable holds a list of names, as symbols, of the column variables in this table.
_T_ t.table should be executed to set this variable, in which case if _U is the Null, this variable is set to a list of names, as symbols, of the column variables in this table that conform to the screen management definition of tableField. If _U is not the Null, then t.table sets this variable to equal _U.
_U This variable holds a list of names, as symbols, of the column variables in this table that are to appear on the screen, as determined by the application. It is set by the user.
_V This variable is the mapping from a source table to this view table. See "How t Manages Row and Column Selection".
_V_ When this view table has one source table, the value of this dependency represents the complementary view, in that every row of the source table is selected by _V or _V_.


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_6.html0000444000265000001440000003340110737165251013563 A+ Reference: Monadic Scalar Functions

Monadic Scalar Functions

As stated in the introduction, the term integer is used in this manual to indicate not only a domain of values but also a particular internal representation. To refer to the same domain of values when both integer and floating-point representations are allowed, the term restricted whole number is used. These floating-point representations need only be tolerably equal to the integers.

Classification of Monadic Scalar Functions

Although they are listed alphabetically in this chapter, for convenient reference, the A+ monadic scalar primitive functions can be grouped - among other ways, to be sure - in four categories:

  • the most common arithmetical functions: Reciprocal, Negate, Identity;
  • other arithmetical functions: Exponential, Natural log, Pi times, Roll;
  • extractive functions: Sign, Absolute value, Floor, Ceiling;
  • logical function: Not.

Application and Result Shape

All monadic scalar functions produce scalars from scalars, and apply element by element to their arguments: they are applied to each element independently of the others. Consequently, the shape of the result is the same as the shape of the argument. This behavior is assumed in the following descriptions.

Error Reports

Multiple errors elicit but a single report. With only one exception, the error reports for monadic primitive scalar functions are common to all such functions. There are six reports, including interrupt, and each error report on the following list is issued only if none of the preceding ones apply:

  • parse: this error class includes valence errors, which must result from three or more arguments in braces, since every symbol for a monadic scalar primitive function is also used for a dyadic function;
  • value: the argument has no value;
  • nondata: the argument is a function or some other nondata object;
  • type: the argument is not a simple numeric array - for Not, of restricted whole numbers, and, for Natural Log, of nonnegative numbers -; the Identity function, however, cannot cause this error report;
  • wsfull: the workspace is currently not large enough for execution of the function; a bare left arrow (), which dictates resumption of execution, causes the workspace to be enlarged if possible;
  • interrupt (not an error): the user pressed c twice (once if A+ was started from a shell) while holding the Control key down.
An inadvertent left argument results not in a valence error, but in the invocation of a dyadic function that shares the function symbol.

Function Definitions

Absolute value |x

   Argument and Result
The argument and result are simple numeric arrays. The result for an integer argument is integer if possible.

   Definition
The absolute value of x. In other words, |x is equivalent to x times Sign of x.

   Example
     |12.3 3
 12.3 3

Ceiling x

   Argument and Result
The argument and result are simple numeric arrays. The result consists of nonfractional numbers, and is integer if all its elements can be represented that way (including if empty). If some element of the result has too great a magnitude to be represented as an integer, the result is floating point.

   Dependency
Comparison tolerance, for most floating-point numbers (see "Comparison Tolerance").

   Definition
The smallest nonfractional number greater than x or tolerably equal to x, except that x is 0 when x exceeds zero but is equal to or less than 1e-13 (intolerantly).

   Example
     10 10.2 10.5 10.98 9 9.2 9.5 9.98, 10+1e-13
 10 11 11 11 9 9 9 9 10

Exponential *x

   Argument and Result
The argument and result are simple numeric arrays. The result is always floating point.

   Definition
e (2.71828...) to the power x.

   Example
     *1 0 1 2 710
 .3678794412 1 2.718281828 7.389056099 Inf

Floor x

   Argument and Result
The argument and result are simple numeric arrays. The result consists of nonfractional numbers, and is integer if all its elements can be represented that way (including if empty), else floating point.

   Dependency
Comparison tolerance, for most floating-point numbers (see "Comparison Tolerance").

   Definition
The largest nonfractional number less than x or tolerably equal to x, except that x is 0 when x is less than zero but is equal to or greater than 1e-13 (intolerantly).

   Example
     10 10.2 10.5 10.98 9 9.2 9.5 9.98, 10-1e-13
 10 10 10 10 9 10 10 10 10

Identity +x

   Argument and Result
The argument, which is also the result, can be any array. (A type error cannot occur.)

   Definition
The result is identical to x.

   Example
     +'abc'
abc

Natural log x

   Argument and Result
The argument and result are simple numeric arrays. The elements of the argument must be nonnegative. The result is always floating point.

   Definition
The natural logarithm of x, i.e., the logarithm of x to the base e (2.71828...).

   Example
      1 10 100 0
0 2.302585093 4.605170186 Inf

Negate -x

   Argument and Result
The argument and result are simple numeric arrays. The result for an integer argument is integer if possible.

   Definition
0-x.

   Example
     -23 2 45 0 1 .5
23 2 45 0 1 0.5

Not ~x

   Argument and Result
The argument is a simple array of restricted whole numbers. The result is always of integer type.

   Definition
The value is 1 if |x is almost 0, viz., less than 1e-13 (intolerantly), and 0 otherwise.

   Examples
     ~0 1
 1 0
     ~1 0 1 2 3
 0 1 0 0 0

Pi times x

   Argument and Result
The argument and result are simple numeric arrays. The result is always floating point.

   Definition
Pi (3.14159...) times x. The result is Inf or Inf if it cannot be represented otherwise.

   Example
     1 2 .5 1e308
 3.141592654 6.283185307 1.570796327 Inf

Reciprocal x

   Argument and Result
The argument and result are simple numeric arrays. The type of the result is always floating point.

   Definition
1x. The result is Inf or Inf for elements that cannot be represented otherwise; in particular, the result is Inf for 0.

   Example
     .5 1.5 2 100 0 1e-309
 2 0.6666666667 0.5 0.01 Inf Inf

Roll ?x

   Argument and Result
The argument and result are simple arrays of restricted whole numbers. The result is always integer.

   Dependency
The value of the Random Link system variable, `rl, which is changed each time a random number is chosen.

   Definition
x is an array of positive restricted whole numbers, and the value is an array of integers with the same shape as x. Each element of the result is a random integer chosen from e, where e is the corresponding element of x. The result is dependent on the random link, `rl, which is set when the Random Link system command, $rl, is executed and each time a random integer is chosen.

   Example
     ?2010
 3 4 7 2 1 5 0 1 7 0 7 9 9 6 9 3 9 0 0 6
     ?2010
 2 9 2 4 5 1 3 5 8 3 0 3 7 8 6 9 5 8 0 4

Sign x

   Argument and Result
The argument and result are simple numeric arrays. The type of the result is always integer.

   Definition
Signum x. The value of x is -1 for negative elements, 0 for zero, and 1 for positive elements.

   Example
     100 2.5 0 5 Inf
1 1 0 1 1


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_60.html0000444000265000001440000013431110737165252013646 A+ Reference: Calling C Subroutines from A+

Calling C Subroutines from A+


This chapter describes how to write C programs to be called from within A+, and what you have to do within A+ to call those functions.

How to Compile C Functions to Be Called by A+

Writing functions to be called from A+ is straightforward. You must:

  1. Write the C function normally, with #includes for the .h files described below. Several functions may be included in the file. The file should not have a main() function in it!

    It is a good idea to make all functions "static" (by putting the keyword static before the function name) unless they are directly called from A+. That is, all subroutines should be made static. This prevents their names from cluttering up the A+ namespace, which might cause a problem if another dynamic load contains a subroutine with the same name. All nonlocal variables must be static.

  2. Compile the C source code into an object file (not an executable file). This is done with the -c argument to cc. E.g.,
         cc -c -o foo.o foo.c
    compiles the C source file foo.c into foo.o.

    You may compile your code into several object files. If you do this, remember that static functions can be called only from another function in the same object file. But see "Another Way To Call C Routines From A+: Static Link".

How to Use C Functions When You Are in A+; Dynamic Loading

Once the functions are written, you must either dynamically load or statically link them into A+ before you can call them. In order to dynamically load them, you must know the names and paths of the object files, and the names of the C functions you want to call (known as the "entry points"). An object file can have several entry points, but you need to know only the names of the entry points you are loading. Static functions cannot be entry points.

Warning! If the A+ name used in _dyld (in its right argument) begins with an underscore, then the function will be installed in the root context, no matter what the current context, and it will be listed by $sfs but not by $xfs.

The procedures you must follow depend upon the system you are going to use.

   Dynamic Loading on Sun Machines

When a C program gets compiled, the compiler puts an underscore (_) in front of the name of each function. So if you write a routine called look(), the entry point will be '_look'.

Programs are dynamically loaded using the system function _dyld, which takes two arguments. The first (or left) is the name(s) of the object file(s) as a character string. Multiple object files are separated by spaces. All of the subroutines referenced by the entry points must be in one of the object files, or part of A+. You cannot refer to subroutines or entry points already dynamically loaded.

The second (right) argument is a nested array in the form
     (entry; name; args)
or, to load more than one function from the same file(s),

     (entry1; name1; args1;
      entry2; name2; args2;
      ...               ;
      entryN; nameN; argsN)
where entryI is the entry point name, as a character string, nameI is what you want to call the function in your workspace (the A+ name, also as a character string), and argsI is a numeric vector describing the types of the arguments. (This vector is described below.)

For example:

     'test.o' _dyld ('_look'; 'lookat'; 9 0)
     $xfs
lookat

   Dynamic Loading under AIX

The mechanism provided by IBM to support dynamic loading of object code into a running process dictates that three files be provided.

  1. A file listing the symbols in the A+ interpreter which are to be accessed by the code to be loaded in. This file is provided for you and can be found in
    /usr/local/bin/a+x.xx/lib/liba.exp
    where x.xx is the A+ version and release, e.g.,
    /usr/local/lib/liba.exp.

    For the current default release, you can use
    /usr/local/lib/liba.exp.

  2. A file listing the symbols in the code to be loaded that the A+ interpreter needs to know about. You must create this file with an editor.

  3. A single object file containing the modules that you wish to load in. This file is produced by the linker as described below and will be referred to as the "shareable object" file. By convention these files should have a .so suffix.

This is best illustrated by an example.

Below is the file ref.c, which returns the reference count of the A+ object passed into it.

/* begin ref.c */
#include <a/arthur.h>
I ref(a)   A a; {
   return a->c;
}
/* end ref.c */

Let's say you want to dynamically load in this function and also the function dswap() from the BLAS library. The following procedure should be followed.

  1. Create the exports file, which enumerates all symbols that you want A+ to know about. The first line of this file contains the full pathname of the .so (shareable object) file which will be dynamically loaded. Subsequent lines enumerate symbols to be exported to A+, one per line. In this case we can create the file named xmpl-exports:
         #!/u/foobar/src/hodedo/xmpl.so
         ref
         dswap
  2. Compile all of your C and FORTRAN sources. In this case we only need to compile ref.c to produce ref.o .
         cc -c ref.c
  3. Link together all the object (.o) files and libraries that contain modules which you want to load into A+. The link command must specify an entry point (with the -e option) for the linked result because the default entry point is crt0, which is already the A+ interpreter's entry point. For the entry point, use any function name you wish that is in the code to be loaded. The link command must also specify the two files describing the symbols to be imported or exported. In this case we need to link ref.o and libblas.a:

    cc -e ref -bI:/usr/local/lib/liba.exp -bE:xmpl-exports
        ref.o -o xmpl.so -lblas

  4. Dynamically load the code into the A+ session. This should occur almost instantaneously.
       "xmpl.so" _dyld ("ref";"ref";0 9;
                        "dswap";"dswap";V_,4,FP,4,FP,4)

Notes:

  • Do not dynamically load the same .so more than once into the same A+ session. This can cause A+ to crash - and sometimes the machine.

  • The left argument to _dyld must be a single .so file name.

  • You do not need to put a leading '_' on C symbol names.

  • If you are running a version of the A+ interpreter other than
    /usr/local/bin/a
    then you will need to use an export file other than
    /usr/local/lib/a-exports
    because the first line of the file has to have the path hardcoded. The file
    /usr/local/lib/aX-exports
    has been provided for aX users.

   Another Way To Call C Routines From A+: Static Link

A hook that was added allows you to create a new A+ executable file with your C or C++ code linked in. The main use for this is in debugging code that will later be dynamically loaded.

The hook is an empty function called uextInstall(). It is invoked in /u/aplus/3prod/src/main/aplus_uext.c. To use this facility to load your functions into A+, you need to add install() calls to uextInstall().

Then you compile and link, to create an A+ executable file. If you compile with the debug flag, you can run the new A+ executable file under a debugger and have access to your own code.

The Basic A+ Data Types

The include file a/arthur.h defines the basic data types which A+ employs. These are: I - long; F - double; C - char. When dealing with A+ objects, these typedefs should be used to refer to integers, floating-point numbers, and characters, respectively.

An A+ object (a variable in an A+ "workspace") has the following typedef:
typedef struct a{ I c, t, r, n, d[MAXR], i, p[1];};

c - reference count.

How many pointers to this object exist? This helps determine whether an object can be modified in place, or whether a copy of the object must be created. If this number is 0, the object is a mapped file, and cannot be written to directly. ("Mapped Files" tells how to write to mapped files.)

An A+ object should be modified only if c is 1.

t - type.

What are the elements of the object? They should be one of the following values, which are #defined in a/arthur.hIt, Ft, Ct, Et, or Xt. It, Ft, and Ct refer to integers, floating-point numbers, and characters (I, F, C). Nested arrays and symbols are type Et. Xt is used for "executable types" - functions and operators. These are beyond the scope of this chapter.

r - rank.

The number of dimensions of the object.

n - number of elements.

The number of elements in the data array (p). With the type (t), it determines the size of the A+ object.

d[] - dimensions.

An array of the dimensions (...) of the object. MAXR is the largest rank allowed (currently 9).

i - items.

The number of items in the object. It is the number reported by _items.

p[] - data array.

It is defined as having one element of type I, but that is just to fool the compiler. In fact, its actual length is determined by n, and the actual type is determined by t. It is worth noting here that, for objects of type Ct, p[] is always a null-terminated string, and has n+1 elements. For all other types, p[] has n elements.

Since A+ objects are almost always allocated from dynamic memory, variables are more often than not pointers to A+ structures rather than the structures themselves. The type A is defined to be a pointer to an A+ object.

Nested arrays are A+ objects of type Et. For such objects, p[] is an array of pointers to the A+ objects which compose the array. Symbols are also represented as objects with type Et. For symbols, p[]is an array of pointers to another struct (the s struct). Symbols are somewhat more complicated than other A+ objects.

   Reference Counts - a Closer Look

The reference count field is used to save memory and time by eliminating identical copies of variables. When a variable is assigned the value of another variable, that variable is normally not copied. Instead, the new variable name is set to point at the same A+ object, and the reference count of that object is incremented.

Objects with reference counts greater than one are pointed to by more than one variable and should not be changed. You must duplicate the object instead (and decrement the reference count for the original object).

When you "dereference" an object - by expunging a variable, or dropping elements from a linked list - the reference count is decremented. If it becomes zero when decremented, it is destroyed, and the associated memory is freed.

The function ic(aobj) is used to increment a reference count, and dc(aobj) is used to decrement it (and possibly erase the object). They work recursively on nested objects.

dc() is rarely used in C subroutines. ic() is used primarily when modifying or returning arguments passed to the function. (See below.)

The Argument Vector

In A+, all functions must have a fixed number of arguments (a number not exceeding 9). This is also true for C functions called by A+. (This fixed number for a C function to be called from A+ cannot exceed 8.) In addition, C functions often expect only certain kinds of arguments - integers, for example - and behave badly if they receive an argument they do not expect.

The argument vector describes the number and types of the arguments to the C function, and the result which it returns. Also, A+ provides several different ways to pass data from A+ to C, which simplifies the C programs you must write. The argument vector allows you to select among these ways.

   Theory

The argument vector is composed of numbers between 0 and 15. The first number describes the result of the function, if any. If there is no result, use code 8, as described below. Otherwise use codes 0, 7, or 9.

The remaining numbers describe the arguments to the function. The length of the vector determines how many arguments there are. The maximum number of arguments allowed is eight.

The sixteen codes are shown in the table "C-Function Argument Types".

C-Function Argument Types
CodeMeaning (an asterisk means acceptable for a result)
0any A+ object *
1A+ object consisting of integers
2A+ object consisting of floating-point numbers
3A+ object consisting of characters
4data array of any A+ object
5data array of A+ object consisting of integers
6 data array of A+ object consisting of floating-point numbers
7data array of A+ object consisting of characters *
8 First element of data array (use only for void result) *
9single integer *
10single floating-point number (don't use)
11single character (don't use)
12unique copy of any A+ object
13unique copy of A+ object consisting of integers
14 unique copy of A+ object consisting of floating-point numbers
15unique copy of A+ object consisting of characters

*   The result must be one of the codes marked with an asterisk.

Codes 0-3 pass a pointer to the A+ structure. Codes 4-7 pass a pointer to the data array within the A structure (aobj->p). Codes 8-11 pass the value of the first element of the data array of the A+ object (*aobj->p). This does not work correctly for characters and floating-point numbers, which have a different size. Codes 12-15 pass an A+ object whose reference count is guaranteed to be 1. This means that you can modify the object without causing adverse side effects.

   Practice

Although all 16 codes are defined, not all of them are useful. In fact, if you need information about the rank and type of your argument, only types 0 and 12 should be used.

If you need to know anything about the shape of the argument, the entire A+ object must be passed. This limits you to types 0-3, or 12-15, which are used only in special circumstances (see below). Using types 1-3 causes the interface to return a type error if you are passed the wrong kind of data. It also coerces floating-point numbers to integer (provided that 1|data is 0). You must do any checking for rank or length yourself.

Since argument types 4-7 and 8-11 do not pass you the entire A+ object, you cannot check rank or the number of elements of the object.

Argument types 4-6 are problematic. They pass you a pointer to the data array, but you have no way of knowing the size or dimensions of the array. Type 7 (character) is useful, and will pass you a character string, which is null-terminated. You will, however, lose all shape information, so a vector of length 15 will appear identical to a 3 by 5 matrix.

Argument types 8-11 are designed for single-element arrays. (Anything else generates a rank or length error.) This is currently defined only for integers, so types 10 and 11 should not be used. When passing or returning a scalar integer, use type 9. When a function does not return a result, use type 8.

Types 12-15 are used when you want to make an internal modification to the A+ structure passed, and then return the result. An argument passed this way can be safely modified.

Returning a Result from a C Function

Most C functions called by A+ return a result. The argument type for the result must be 0 (an arbitrary A+ object), 7 (a character string), or 9 (an integer scalar). If your function does not return a result, it should be declared as "void", and the return type should be 8.

To return a scalar integer (type 9), just use the return command, e.g., return(7).

To return a character string, also use the return command. Be sure to declare your function as returning a char*. E.g., char *hw() { return("Hello, world!"); }.

Note that A+ takes a copy of the string you return, so you are responsible for freeing any strings you create with malloc(), ma(), or strdup(). In general, you can free the string just before returning it, and this will work fine. ma() performs atmp memory allocation, where the argument specifies the number of words, and returns I*.

If you are returning an argument as the result, you must use ic(). See "Modifying and Returning Arguments".

If you are returning an A+ object (arg type 0 and not an argument to the function), you must create the appropriate object. The next section describes how to do this. Declare your function as returning an "A" type - a pointer to an A+ object. For example,
A foo(x,y)

If you are returning an A+ object, return(0) causes a null to be returned. Returning 0 can also be used to indicate an error condition.

   Creating A+ Objects

A+ provides several functions to create A+ objects. You must know the size and type of an A+ object before you create it. There are several functions to make it easier to create common A+ objects, such as vectors, or integer scalars.
     Initialized object
A gi(i) I i;            /* make a scalar integer */
A gf(f) F f;            /* make a scalar float */
A gsv(x,s) I x; C *s;   /* make a string; x is 0 (raw), 1 (apl), or 2 (c) */
A gc(t,r,n,d,p)I t,r,n,*d,*p;   /* make an A+ object,
                                   copying data from p */
     Uninitialized object
Creating A+ Objects
ExpressionEffect
A gs(t) I t;make a scalar
A gv(t,n) I t, n; make a vector
A gm(t,d1,d2) I t,d1,d2; make a matrix (2-dimensional array)
A ga(t,r,n,d) I t,r,n,*d; make an array (r dimensions)
A gd(t,a) I t; A a; make an object taking r,n,d from a.
gd(t,a) <=> ga(t,a->r,a->n,a->d)

The argument names, in all cases, conform to the A+ structure described above. t is type, r is rank, n is the number of elements, d is the array of dimensions. New A+ objects always have reference counts of one.

Because creating A+ objects involves memory allocation, whenever you create an A+ object you must later either destroy it with dc() (see below), or return it, either alone or as part of a nested array.

   Memory Allocation - What to Do and What Not to Do

A+ includes its own memory allocation functions for atmp: ma(), mab(), and mf(). They work pretty much like malloc() and free(), except that ma() takes a number of words as an argument rather than a number of bytes (1 word = 4 bytes) and that ma() and mab() use atmp and malloc() uses the heap, and therefore should probably be limited to small allocations, under 1K, say.

For portability, use mab() or malloc(), and cover your allocation and deallocation routines, checking for errors such as no more space. If you do use ma(), be careful! Remember it takes an argument in words, not bytes.

Anything you allocate with ma() or mab() you must free with mf(). Anything that you allocate with malloc() or strdup() must be freed with free(). Don't mix them up. (This is another good reason to stick with mab().)

To "erase" an A+ object, call dc(aobj), not mf(aobj). This should be rare, since you should not erase arguments to your function, so the only A+ objects you erase should be ones that you created earlier in the function. This shouldn't come up too often.

Modifying and Returning Arguments

In general, C routines called from A+ are expected to behave like A+ routines - all arguments are call by value. This means that the arguments should not be modified, since that would cause unexpected side effects in the A+ workspace.

However, if you use argument types 12-15, you can safely modify the arguments to the function. These types guarantee that the argument has a reference count of 1.

When you create your own A+ object, using ga() for example, you can simply return the created object when your program exits. This is not true for modified arguments, or arguments returned as part of a nested array. To return a modified argument, or incorporate an argument as part of a nested array, you must run ic() on the object.

The reason is that the function dc() is run on all arguments after your program exits. This function causes the arguments to be erased unless you increase the reference count with ic(). If you forget to do this, values of variables in the A+ workspace will be changed randomly.

Since ic() is defined as returning an integer, you will often want to cast the result to type A. If you don't do this, you will get the compiler warning "illegal combination of pointer and integer".

   Examples of Modifying and Returning Arguments

Example 1: join

Let's say we want to write a function, join(), that takes two A+ objects and returns a nested array containing the two elements. That is, join{a;b} is the same as (a;b).

In C, we would write:

A join(obj1, obj2)
  A obj1, obj2;
  {
   A result=gv(Et, 2);      /* create nested vector of length 2 */
   result->p[0]=ic(obj1);   /* load result vector with objs,
                               incrementing reference count */
   result->p[1]=ic(obj2);
return(result);             /* return result, not incremented
                               because we created it in this function */
}
After compiling the function into join.o, we would then enter in A+:
     'join.o' _dyld ('_join';'join';0 0 0)
We can now use join as a function in the workspace:
     7 join 'abc'
<  7
< abc
Example 2: clone

Now we want to write a function that takes an arbitrary A+ object (aobj), and an integer (n), and returns a nested array containing n copies of aobj. That is, clone(aobj, n) is equivalent to n <aobj. Notice that we increment the reference count each time we insert aobj into the nested array.

In C we would write:

A clone(aobj, n)
  A aobj;
  I n;
{
    I i;
    A result=gv(Et, n);
    for(i=0;i<n;++i) result->p[i]=ic(aobj);
    return(result);
}
We would load in A+ by entering:
     'clone.o' _dyld ('_clone';'clone';0 0 9)
     'abc' clone 2
< abc
< abc
Example 3: ravel

Now let's write a function that modifies its argument. We will replicate the Ravel function (monadic comma). Whatever we get, we will turn into a vector. We could do this by copying the aobj into a vector:

A ravel1(aobj)
  A aobj;
{
    A result;
    /* make new a object */
    result=gc(aobj->t, 1, aobj->n, &aobj->n, aobj->p);
    return(result);
}
To load in A+:
     'ravel1.o' _dyld ('_ravel1';'ravel';0 0)
We can get a somewhat neater and faster function if we modify the argument in place. Thus:
A ravel2(aobj)
  A aobj;
{
    aobj->r = 1;         /* change argument in place */
    aobj->d[0]=aobj->n;
    return(ic(aobj));    /* increment rc of modified argument */
}

     'ravel2.o' _dyld ('_ravel2';'ravel';0 12)
Note that we must now use argument type 12, and increment the reference count on the result (because it will automatically be decremented upon this function's return). Note also that, since the argument that is being modified is of type 12, it may be either the argument that appears in the A+ expression calling the function or a copy of that object. It will be a copy unless the reference count is 1 for the object.

Signalling Errors

If you detect an infelicity in your function, you may want to cause the A+ process to suspend execution and indicate, for example, a length error. This is done using two external variables: I q; C *qs;

To report an error, set the value of q (and possibly qs), and return(0). If your program returns 0, the A+ process will check the value of q. A nonzero value indicates an error condition.

Positive numbers represent different predefined error codes, as shown in the following table.

Error Codes
CodeMeaning
1interrupt
2wsfull
3stack
4value
5valence
6type
7rank
8length
9domain
CodeMeaning
10index
11mismatch
12nonce
13maxrank
14nonfunction
15parse
16maxitems
17invalid
18nondata (for an argument of any type other than 0, A+ will check for nondata; you must detect and handle wrongly nondata type 0 arguments)

If q is -1, the A+ process will report the error in the qs string.

The file a/firca.h contains #defines for these codes, as well as macros for reporting error conditions. For example:

if (a != b) ERROUT(ERR_LENGTH);       /* reports a length error */

if (positive(a)) ERRMSG("polarity"); /* reports a polarity error */

Note that these macros exit the function, so be sure to clean up first!

Executing A+ Expressions from Dynamically Loaded C Programs

Your C programs that have been dynamically loaded into A+ can execute A+ expressions. This allows you to switch between A+ and C as needed. Note that you must start with an A+ process, however, to execute these dynamically loaded programs.

The entry points pex() and ex()allow you to do this. pex() takes one argument, a pointer to a string containing the A+ expression you wish to execute. ex() takes two arguments. The first is a context. The second is the string to execute in that context. The prototypes for these functions are:

I pex(I a);
I ex(CX c, C *s);

The longs returned by both functions are pointers to A+ objects.

Mapped Files

Mapped Files look very much like other A+ variables, from the C perspective, and have headers as described in "The Basic A+ Data Types". They have reference counts of 0 to distinguish them, however. That is, (0==aobj->c) means the object is a mapped file.

There is an entry point called wr() which will return 1 for a writable mapped file, and 0 otherwise. So a writable mapped file is indicated by (0==aobj->c && wr(aobj)).

If you write to an aobj where (0==aobj->c && !wr(aobj)) you will cause a segv.

wr() references a variable called wt, which is a list of writable addresses. This code is in y.c, in the a source directory.

Memory Allocation in A+ - a Closer Look

A+ uses the function ma() to allocate memory. This function is specified to return memory locations that begin on 8-byte boundaries, freeing the last three bits for encoding purposes, which is how they are used.

A+ consists of several types of entities, all represented as integer-size objects. The last three bits of the object indicate the type of object.

The most common case (for our purposes) is for those three bits to be 000, which indicates a pointer to an A+ object. In this case, the pointer can be used as is.

Other codes require some manipulation. For example, if the code is 010, the object is a pointer to a symbol, and the last three bits must be cleared before the pointer is used. (As stated above, all pointers in A+ point to 8-byte boundaries, as allocated by ma(), so the last three bits must be 000, and it is this fact that allows A+ to use the last three bits for type encoding.)

Several macros are provided ina/arthur.h to query the type of an object. The next table gives a list of the macros, and the types of objects they represent.

Macros for Querying Object Type
CodeMacroObject Type
0QA(a)pointer to A+ object (struct a)
1QV(a)global variable (struct v)
2QS(a)pointer to symbol (struct s)
3QE(a)pointer to expression (struct e)
4QN(a)flow-control/operator
5QL(a)local variable
6QP(a)primitive
7QX(a)dynamically loaded function

Also defined are macros which clear the last three bits for those entities which serve as pointers. They are:

XS(a) retrieve pointer to struct s
XV(a)
retrieve pointer to struct v
XE(a)
retrieve pointer to struct e

These three macros work by zeroing out the last three bits and casting the result to the appropriate pointer type. Notice that there are no macros for A+ objects, although you will occasionally have to cast them.

Finally, there are macros to add the proper code into the last three bits. They are:

MV(a) global variable (struct v)
MS(a) pointer to symbol (struct s)
ME(a) pointer to expression (struct e)
MN(a) flow-control structure or operator
ML(a) local variable
MP(a) primitive function
MX(a) dynamically loaded function

The Symbol Structure

The structure of symbols is defined ina/arthur.h as:
typedef struct s{struct s *s; C n[4];} *S;

s   the next symbols. This field is included because all symbols created by A+ are stored in linked lists.

n   a character string with the name of the symbol.

   Symbols in Variables

Symbols are always contained in A+ objects of type Et (nested). In normal nested objects, the elements of p[] point to A+ objects (struct a). With symbols, they point to symbols (struct s).

   Using Symbols in Functions

        Recognizing symbols.
Whenever you encounter an object of type Et, the nested elements may be any type of A+ entity, or several types mixed together. You should always check the contents of p[] individually, using the Q_() macros described above, when using objects of type Et.

To check if an element of an Et object is a symbol, use the QS() macro.

        Getting the name of a symbol.
To get the character string associated with the symbol (its "name"), you must turn the symbol into a pointer to an s-struct using the XS() macro, and access the n field within that structure.

Example 1: Recognizing a symbol and getting its name.

The following C function examines an A+ object and prints out the symbols it contains.

void printsymbols( aobj)
  A aobj;
{
  int i;
  S sym;
  if (Et != aobj->t ) {
    printf("object not nested\n");
    return;
  }
  for (i=0 ; i<aobj->n ; ++i ) {
    if (QS(aobj->p[i]) {
      sym = XS(aobj->p[i]);
      printf ("Symbol:%s\n", sym->n);
    } else printf("Not a symbol\n");
  }
}
        Creating a symbol
It is an essential property of symbols that, if two symbols have the same name, they are the same symbol (point to the same memory location).

For this reason, you must always create symbols by using the si() function. This function takes a character string as an argument, and returns a pointer to an s-struct. If the symbol already exists, you get the current memory location. Otherwise, a new symbol is created and stored in A+, and the address of the new symbol is returned.

If you intend to insert a symbol into an A+ object, you must encode the last three bits as 010, which is best done with the MS() macro. Then load the symbol into the p[] field of an A+ object of type Et.

Example 2: Returning a symbol

The following function takes a string and returns a symbol with the string as the name.

A makesymbol(str)
  char *str;
{
  A res=gs(Et);
  res->p[0] = MS(si(str));
  return(res);
}
        Comparing symbols
Because symbols with the same name are always in the same memory location, you don't need to use string comparisons to check symbols for identity. The result of si() will match for any symbol that you use. Just make sure that the symbols you are comparing either both have the 010 in their last three bits, or both have not.

Example 3: Comparing symbols.

The following function checks whether the A+ object contains the symbol `qwerty. If so, it returns 1, else 0.

queryqwerty( aobj)
  A aobj;
{
  int i;
  S qwerty = MS(si("qwerty"));    /* get symbol and set 010 code */
  if (Et != aobj->t ) return(0);
  for (i=0 ; i<aobj->n; ++i) {
      if (qwerty == (S) aobj->p[i]) return(1);
    }
  return(0);
}

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_61.html0000444000265000001440000004637010737165252013656 A+ Reference: Display Classes

Display Classes


Objects and Classes

A+ applications are constructed from variables, bound and free. A bound variable, or object, is a global variable which has been tied to a display class through the is{} function:
     a10
`a is `array
The display class specifies the general form of how the variable looks on the screen. Some of these characteristics, or attributes, can be changed through use of the has{} function:
     `a has (`rows;10;`fg;`blue)
But even prior to binding, a variable has attributes. These include both the primitive A+ attributes of shape, type, and depth, which are properties of the data, and certain further attributes, such as foreground color, font, and callback on assignment. Together, these variable attributes are termed persistent, since they are attached to variables and survive re-binding to different display classes. By contrast, the attributes of any particular display class come and go with binding and freeing of global variables.

   Subclasses

There are several kinds of hierarchical relation in A+:

  • container and child;

  • leader and follower;

  • class and subclass.
The first two relations have been described in "
Containers" and "Leaders and Followers". The topic of the present chapter is how to use the subclass relation.

A class is, minimally, a set of attributes. An object which is an instance of a particular class has those attributes. For example, a variable which "is" a table, "has" a certain number of fixed fields. The class `table includes the fixedfields attribute.

The attributes which belong exclusively to a class are called the proper attributes of that class. In general, a variable which has been bound to a class has many more attributes than are proper to that class, because the attributes of a class consist of the attributes proper to that class as well as the attributes of its superclasses, which it is said to inherit.

For example, a variable which has been bound to the `table class also has a background color `bg, which is not a proper attribute of `table. It acquires `bg by inheriting it from one of its superclasses, `real.

The class hierarchy of `table is shown in the figure; compare this display with the result of the function s.superClasses{`table}.

A variable bound to `table has all the attributes of every class in this tree, since `table inherits all the attributes of its superclasses.

A Class Hierarchy:

   Metaclasses

None of the superclasses of `table can be instantiated. That is, one cannot say:
     a10
     `a is `real
The `real class is simply a convenient place to put certain attributes which many subclasses can access though inheritance. Classes such as this, which cannot be instantiated, are called metaclasses, and in A+ they significantly outnumber the classes which can be instantiated. The set of metaclasses of A+ is enumerated by the niladic function s.metaClasses:
     s.metaClasses{}
 `object `virtual `print ...

   Virtual Classes

Not all of the instantiable classes in A+ can be directly instantiated. For example, one cannot say:
     a10
     `a is `tableField
But one can say:
     t`a
     `t is `table
     `class of `a
< `tableField
Classes such as `tableField can only be instantiated by binding a variable to some other class, in this case `table; that variable's children are then implicitly bound to the class in question. The `tableField class is called virtual, and A+ contains two such classes:
     s.virtualClasses{}
 `tableField `graphTrace
whose virtual parents are `table and `graph, respectively.

   Real Classes

A class which can be directly instantiated is called "real". The set of real classes of A+ is enumerated by the niladic function s.realClasses:
     s.realClasses{}
 `slot `check `radio ...

   Simple Subclassing

Suppose one has an application in which there are two kinds of arrays: A-arrays and B-arrays. And suppose that the application creates multiple instances of both kinds of array.

A-arrays should always have the following characteristics:
bg: green
fg: black
font: helvetica-bold-18

and B-arrays:
bg: black
fg: cyan
font: courier-bold-14

Define two subclasses of array, thus:

     `aArray s.isClass `array
     `bArray s.isClass `array
and set the appropriate class defaults:
     `aArray s.hasDefault (
          `bg;     `green;
          `fg;     `black;
          `font;   'helvetica-bold-18'
          )
and
     `bArray s.hasDefault (
          `bg;     `black;
          `fg;     `cyan;
          `font;   'courier-bold-14'
          )
So that:
     a10
     `a is `aArray
     b3 4
     `b is `bArray
     `class of `a
 < `aArray
     `class of `b
 < `bArray
In this case, subclassing allows the application to dispense with attribute bookkeeping.

Gadgets

   As One of a Kind Objects

Consider the following "gadget":
     file{s;c;v}:
       {
       (c%`FILE)(t' ')/tDir,'/',(0`row of c,v)#c%v
       }
     files{dir}:
       {
       t@1 matsys.agetdents{dir};
       t((t=' ')@10)@0 1 t;
       (t[;2]@1 'm.')/mat
       }
     Dir''
     Files:files{Dir}
     Filepick(`Dir;`Files)
     `Files is `array
     `Dir is `scalar
     `Filepick is `layout
     `Files has (`protect;1; `refer;file)
     show `Filepick
Entering a directory name displays the .m files in that directory. Referring to an item in the display list stores that item in the global FILE. By setting the appropriate callback on FILE, we can use this gadget as a tool for displaying, printing, editing, or otherwise using the referenced file.

   As Generator Functions

The single most important reason for recoding such a structure as a class is that we wish to be able to create multiple instances of it. Our first step in this direction should therefore be to define a function which generates such structures. Continuing the above example:
     filepicker{cx}:
       {
       (cx%`Dir)'';
       (cx%`Files)'';
       (cx,`Files) has (`def;'.files{',(cx),'.Dir}');
       (cx%`Filepick)(`Dir;`Files);
       (cx,`Files) is `array;
       (cx,`Dir) is `scalar;
       (cx,`Filepick) is `layout;
       (cx,`Files) has (`protect;1; `refer;file);
       cx,`Filepick
       }
Note that filepicker{} returns the symbol of the generated gadget, so that
     show filepicker{`my}
instantiates a filepicker in context `my.

   As Composite Classes

Here is an example of how the filepicker could be defined as a composite class, and then used as the control panel for a simple file editor. Continuing from above:

Filepicker instantiation function:

     newFp{s;c;v}:
       {
       (d;f)c%v;
       (c,f) has (`def;'.files{',(c),'.',(d),'}');
       (c%d)'';
       (c,f) has (`protect;1);
       }
Composite class has layout structure and new function:
     `fp s.isClass (`scalar;`array);
     `fp s.hasDefault (`new;newFp);
Reference function for file list:
     fileEdit{s;c;v}:
            {
            dir(dir' ')/dirc%0%0`parent of c,v;
            fil(fil' ')/fil(0`row of c,v)#c%v;
            (c%`Edit)1nam(if (0<#dir) dir,'/'),fil;
            (c,`Edit) has (`title;nam);
            show c,`Edit
            }

     Edit''
     `Edit is `array
     DirectoryFiles''
     EditFile(`Directory;`Files)
     `EditFile is `fp
     `Files has (`refer;fileEdit)
     show `EditFile
The right argument to isClass{} is a schema which obeys the semantics of (nested) layouts. The symbols in the schema are class names. So `fp will be a `layout, with a `scalar above and an `array below.

The `new function newFp{} is called when a new instance of `fp is created. newFp{} retrieves the symbols of the children of the new `fp, redefines the file list in terms of the directory variable, which it initializes, and sets protection and reference functions on the file list.

Rudimentary structural error checking is performed:

     uvw''
     z(`u `v;`w)
     show `z is `fp
 !! .z: variable cannot be bound to fp

Extending the Class Hierarchy

The decision to use A+ subclasses rather than write functional gadget generators rests entirely with the programmer. Subclasses hide detail and guarantee uniformity of approach across applications, but can be tricky to design. Gadget generators fit more comfortably into the experienced A+ programmer's bag of tricks, but cannot exploit the inheritance and attribute-management mechanisms which subclasses provide. As an example, consider how the file editor application of the `fp class in the above example can itself be reconstructed as a subclass:

File editor instantiation function:

     newEfp{s;c;v}:
       {
       (d;f)c%v;
       (c,f) has (`def;'.files{',(c),'.',(d),'}');
       (c%d)'';
       (c,f) has (`protect;1; `refer;fileEdit);
       (c%`Edit)'';
       (c,`Edit) is `array;
       }
File editor subclass and (overriding) new function:
     `efp s.isClass `fp
     `efp s.hasDefault (`new;newEfp)
     DirectoryFiles''
     EditFile(`Directory;`Files)
     `EditFile is `efp
     show `EditFile;

   Synthetic Attributes

Making composite objects through the use of subclasses hides detail. In particular, we may wish to refer to attributes of the components through new synthetic attributes of the composite object. For example, in the composite layout of three arrays `array3, we may wish to be able to set the background colors of the components without specifically addressing them through has{}:
     `array3 s.isClass (`array;`array;`array)
     g_bg{var}:`bg of(cx,cx%var)  (cx;var)var
     s_bg{var;x}:{
           (cx,cx%var) has(`bg,x)  (cx;var)var}
     `array3 s.classHas (`bg3;(g_bg;s_bg))

     abc3
     d(`a;`b;`c)
     show `d is `array3

     `d has (`bg3;`red `blue `green)

     `bg3 of `d
< `red `blue `green

     `bg3 s.ofClass `array3
< < g_bg
  < s_bg
To eliminate a synthetic attribute:
     `d has (`bg3;)

   Subclassing from Virtual Containers

The children of `table and `graph are virtual objects, viz., `tableField and `graphTrace. Consider the case:
     `xTable s.isClass `table
     a10
     b`a
     `b is `xTable
     `class of `b
< `xTable
     `class of `a
< `tableField
Since `xTable is a subclass of `table, its children are of class `tableField. Suppose, however, that we wish to define a new kind of table, whose children are themselves a subclass of `tableField:
     `yTableField s.isClass `tableField
     `yTable `yTableField s.isClass `table
     a10
     b`a
     `b is `yTable
     `class of `b
< `yTable
     `class of `a
< `yTableField
The left argument to isClass{} can be a simple vector of count 2, in which case the second symbol specifies the class of virtual children.

   Metaclasses and Multiple Inheritance

A metaclass is a class defined strictly for the purpose of naming a set of attributes. Metaclasses cannot be instantiated.

For example, consider the case where one wishes to define subclasses `subtable, `subslot, `subarray, `subscalar of `table, `slot, `array, and `scalar (the input objects of A+) all of which make use of some set of attributes on input `r1, `r2, and `r3. Suppose, moreover, that `s1 and `s2 are strictly attributes of `subtable and `subslot, `t1 and `t2 of `subtable and `subarray, and `u1 and `u2 of `subarray and `subscalar:

r1r2r3s1s2t1t2 u1u2
subtable+++++++   
subslot+++++     
subarray+++  + +++
subscalar+++     ++

Let us then define the metaclass `r as a subclass of `object, the most general metaclass in A+:

     `r s.isClass `object
and add to `r the attributes `r1, `r2, and `r3:
     `r s.classHas (
           `r1;(g_r1;s_r1);
           `r2;(g_r2;s_r2);
           `r3;(g_r3;s_r3)
           )
Similarly, the metaclasses `s, `t, and `u to name their respective sets of attributes:
     `s s.isClass `object
     `s s.classHas (
           `s1;(g_s1;s_s1);
           `s2;(g_s2;s_s2);
           )
     `t s.isClass `object
     `t s.classHas (
           `t1;(g_t1;s_t1);
           `t2;(g_t2;s_t2);
           )
     `u s.isClass `object
     `u s.classHas (
           `u1;(g_u1;s_u1);
           `u2;(g_u2;s_u2);
           )
Finally, the subclass definitions:
     (`subtable;`r `s `t) s.isClass `table
     (`subslot;`r `s) s.isClass `slot
     (`subarray;`r `t `u) s.isClass `array
     (`subscalar;`r `u) s.isClass `scalar
If the left argument of isClass{} is nested, then the second item is a vector of metaclasses.

Also note that if v is a vector of metaclasses mentioned in the left argument, and `a is an attribute of several classes which appear in v, then the g_ and s_ functions which actually attach to the subclass being defined are the ones which attach to the class which appears earliest in the vector. More generally, if `a appears as an attribute in the class from which subclasses are being derived, then the g_ and s_ functions of the superclass override those of `a in the specified metaclass vector (if any).


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_62.html0000444000265000001440000001275710737165253013662 A+ Reference: Appendix: Some A+ and APL Differences

Appendix: Some A+ and APL Differences

For the most part, A+ is very similar to other dialects of APL, but there are some significant differences that are important to know about.

This is not meant to be an exhaustive list of differences, but rather, a starting point for an APL programmer, to help to prevent confusion about A+ conventions. This list does not, for instance, include references to the many extensions over most of the other APL implementations.
 


    Object Names, System Commands, Reserved Names

  1. A+ has upper- and lowercase alphabetic characters, but no underscored characters. Both cases can be used in names.

  2. There are no quad-names. System function names begin with _ and are not distinguished names, and system variable names begin with `.   System variables are set and referenced only through system functions or system commands.

  3. There are no local lists in function headers; names are automatically localized. All unparenthesized explicitly-assigned unqualified names are strictly local within a function. Global names can be assigned by (global)expression or .globalexpression or cxt.globalexpression or the like. There are no semi-globals: all variables are lexically scoped and are either local or global.

  4. System commands begin with "$" instead of ")".

  5. $load does not initially clear the active workspace, acting instead like )copy.

  6. $si shows the state indicator with the suspended function at the bottom.

  7. The following words are reserved: if, else, do, while, case, time, Inf, and those names reported by the $sfs system command.


    Environmental

  8. Comparison tolerance is always 1e-13.

  9. There is no del-editor; use XEmacs in an A+ session log. In other files, use XEmacs and copy into an A+ session, or use the F2 key to execute a line or the F3 key to load a program into A+. Use $load in an A+ session to load a script, executing it in the process.

  10. All expressions yield a result. Where a result is absent in APL it is often the Null in A+.

  11. A+ provides an unambiguous function call syntax f{...;...;...} in addition to infix notation.


    Language

  12. Index origin is always 0.

  13. 00 produces a domain error.

  14. n0 does not produce an error when n is nonzero: it produces Inf when n is positive and Inf when n is negative.

  15. Leading axis default in Reduce, Scan, Catenate, Take, Drop, Reverse, Rotate, Compress, Replicate, Expand.

  16. Nor, Nand, Factorial, and Binomial are not implemented.

  17. Reduce and Scan are restricted to the functions: +ө^.     /0 produces Inf and /0 produces Inf.

  18. Inner Product is restricted to the following cases: +., .+, and .+.

  19. Outer Product is restricted to the following functions: +-*<=>|.

  20. Take and Drop are restricted to a single-element left argument.

  21. Member (LR) does not ignore the rank of its right argument: it searches the items of the right argument for cells of the left argument that are the same shape as the items of the right argument. To get the traditional APL effect, ravel the right argument.

  22. Find (LR) does not ignore the rank of its left argument: it searches the items of the left argument for cells of the right argument that are the same shape as the items of the left argument. To get the traditional APL effect, ravel the left argument.

  23. The arguments to dyadic and must be the same type or both numeric.

  24. Reshape uses fill elements for LR when L does not contain zeros and R is empty.

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_63.html0000444000265000001440000015636310737165253013665 A+ Reference: Appendix: Quick Reference

Appendix: Quick Reference


List of Primitive Functions and Operators, with References

The symbols are ordered here by type of function (arithmetic, structuring, etc.) and are followed by the dyadic and monadic names:

SymbolDyadic FunctionMonadic Function
+AddIdentity
-SubtractNegate
MultiplySign
DivideReciprocal
*PowerExponential
LogNatural log
|ResidueAbsolute value
DecodePack
EncodeUnpack
?DealRoll
Circle (sin, cos, ...)Pi times
SolveMatrix Inverse
MaxCeiling
MinFloor
<Less thanEnclose
Less than or Equal to(no monadic)
=Equal to(no monadic)
>Greater thanDisclose
Greater than or Equal to(no monadic)
Not equal to(no monadic)
BinsGrade up
(no dyadic)Grade down
MatchDepth
FindInterval
MemberRake
^AndStop
Or or CastType
FormatDefault Format
Execute in Context
or Protected Execute
Execute
%Value in ContextValue
Map (see "Files in A+")Map In (see "Files in A+")
Assignment
or Selective Assignment
Result
PickRaze
#ChooseCount
[;]Bracket Indexing (varying number of arguments)
TakeSignal
DropPrint
RotateReverse
Transpose AxesTranspose
!RestructureItem Ravel
PartitionPartition Count
ReshapeShape
LeftNull
(no dyadic)Right
Combine SymbolsSeparate Symbols
,CatenateRavel
~LaminateNot
/ReplicateReduce (+ ^ )
\ExpandScan (+ ^ )
. Inner Product
(+.   .+   .+)
(no monadic)
.Outer Product
(+ - | < = > )
(no monadic)
@Rank(no monadic)
(no dyadic)Each or Apply
(no dyadic)Bitwise


Lists of System Functions, Variables, and Commands, with References

System Function Names and References
_alldepAll Dependent Object Names
_alsfAssociation List to Slotfiller
_attsAll Attributes
_cdChange Directory
_cfiComma Fix Input
_dbgDebug
_defDependency Definition
_depDependent Object Names
_dyldDynamic Load
_exExpunge
_excxtExpunge Context
_exitExit
_fiFix Input
_flatFlatten
_fmtFormat
_gcbGet Callback
_gcdGet Client Data
_getGet Attribute
_gfmtsymGet Format Symbols
_gpcbGet Preset Callback
_gsrGeneral Search and Replace
_gsvGet System Variable
_hashstatHash Table Statistics
_indexPermissive Indexing
_index_ofIndex of
_issfIs a Slotfiller
_itemsItems of a Mapped File
_loadLoad
_loadrmLoad and Remove
_localsLocals
_nameName
_nanfindNaN Find
_ncName Class
_nlName List
_nsName Search
_nsrName Search and Replace
_scbSet Callback
_scdSet Client Data
_scfiScalar Comma Fix Input
_setSet Attribute
_sfiScalar Fix Input
_sfmtScreen Format
_spcbSet Preset Callback
_ssString Search
_ssrString Search and Replace
_ssvSet System Variable
_undefRemove Dependency Definition
_valenceValence
_waWork Area

System Variable Names and References
`busexitBus Error Flag
`corelimCore File Size Limit
`cxContext
`DfDependency Flag
`dymeDynamic Environment
`EfExecution Suspension Flag
`GfProtected Execute Flag
`languageLanguage Level
`loadfileFile Being Loaded
`majorReleaseMajor Release Number
`minorReleaseMinor Release Number
`modeInput Mode
`phaseOfReleasePhase of the Release
`ppPrinting Precision
`releaseCodeRelease Code
`rlRandom Link
`segvexitSegv Error Flag
`SfCallback Flag
`siK Stack
`stdinStandard Input
`stopStop
`TfTerminal Flag
`versVersion
`XfX Events Flag

System Command Names and References
$| Pipe
$< Pipe In
$> Pipe Out
$>> Pipe Out Append
$cdChange Directory
$cmdsCommands
$cxContext
$cxsContexts
$dbgDebugging State
$defDependency Definition
$depDependent Object Names
$depsDependencies
$DfDependency Flag
$EfExecution Suspension Flag
$exExpunge
$excxtExpunge Context
$fnsFunctions
$GfProtected Execute Flag
$globsGlobal Objects
$loadLoad
$loadrmLoad and Remove
$modeInput Mode
$offOff
$opsOperators
$ppPrinting Precision
$resetReset
$rlRandom Link
$SfCallback Flag
$sfsSystem Functions
$siState Indicator
$stopStop
$TfTerminal Flag
$undefRemove Dependency Definition
$varsVariables
$versVersion
$waWorkspace Available
$XfX Events Flag
$xfsExternal Functions


Two Tables of Examples of Operators

Examples of Operators
ExpressionDescriptionExample
fn@nRank: fn applied to all rank-n subarrays @1 vect +@1 mat
fn Each: for each scalar s: < fn >s i + ɡ n
fdApply enclosed function fd f(+;-); x f[0] y

Examples of Operators
OperatorExpressionRemarks
Rank,@0 v?49Ravel applied to scalars
Rankv ,@0 m?3 49 Catenate applied scalar by scalar
Rankm +@1 0  v?39 vector-scalar (also m +@1 v)
Rankm +.@1 1 0 m vector-vector (all other axes are all versus all)
Inner Productx f.g y: f/x(g@0 1 1)y
Outer Product x .g y: x (g@0 0 0) y


Data Types

Table of Data Types
Data TypeA+ SymbolExamples
character`char 'per cent' and '' and "net"
integer`int 0 and 4 14 59 86 and 0
floating point (IEEE double precision)`float 3.26 1e5 3.1e-2 and 0 02.
box (enclosed object) and nested array with first item of type box`box (3 4;5) and (`ns;1;+) and <7.
empty array other than character, integer, and floating point, including the Null `null () and 0 0 (2;3 4;5) and 0`a`b and 0(+;-;;;`s)
symbol, and nested array with first item simple symbol`sym `pp and `rl `stop and `ns,(1;+)
function expression, function scalar, and nested array with first item function scalar`func + and <{+} and (+;-;;) and (<{+}),`sand (;2 3;'a')


Examples of Primitive and Defined Functions

Examples of Primitive Functions
SymDescriptionMonadic ExampleDyadic Example
#Tally and Choose #8 and #2 3 1#8 and 1#2 3
Partition Count and Partition 1 0 1 0 02 35
Raze and Pick(2 3; 4 5 6) 1(2 3; 4 5 6)
!Item Ravel and Restructure!2 3 2!8 and 2!8
~Not and Laminate ~1 0 14~9
Type and Cast `ibm`char256
Pack and Decode 'ibm'24 60 602 5 59
Unpack and Encode `ibm24 60 607559
Map In and Map `f`f  9 and 1`f (open-write)
Grade Up and Bins?1000100 1 0 1  .3 1 5

Example of a Defined Function:
Signal () Display () Stop&Trace (^) Return () and Line Numbers
Function Definition Function Line Indicator
$si
Meaning
n foo t:{
 
  if(n)  `rank;
 
 
 
  if (~n)  `stop;
 
  if (n<0)  n;
 
  (mn) do{
 
 
 
    ^m;
 
    tt,t[m]};
 
  t}
 
 
foo[1]
 
 
 
foo[2]
 
foo[3]
 
foo[4]
 
 
 
foo[4 do 1]
 
foo[4 do 2]
 
foo[5]
 
 
signal rank error 
(for if and while, 
only zero is false) 
 
signal stop 
 
display and return n
 
repeat n times
(m runs from
0 through n-1)
 
stop, or trace m
 
use m as index
 
return t (last expression)


Errors
and Stops

When there is an error the function and error type is shown. For example,
+: length
or
.foo: rank
This is preceded by
[error]
When there is a stop the function and message are shown; names are shown fully qualified. At this point you can take one of the actions shown in the following
table.

Error and Stop Actions
User ActionA+ Expression
reset (abort)$ or
show state$si
signal up an error`length
return x x
resume execution,
with an enlarged workspace
when the error was wsfull
inspect the stack&0 (for entry 0)
change entries on the stack &1  2 3 4 (entry 1)

A leading * is displayed for every level of resetting required to get clear. The state indicator shows a line for every function call.

The & symbol by itself represents self-reference; for example:

   fact n: if (n>0) n & n-1 else 1

is the standard recursive factorial definition.


Files

File Names
Form of NameUseExample
*.   or
*.+  or
*.a
function and data definitionsutil.+
*.mmappable simple arraysprice.m

Printing Files
CommandMeaningFile Type
$| var lpr Pipe the file named var to lpr command. reports or variables

Getting Around
 
Command Meaning Example
$cd change Unix directory $cd /u/a
$cx change A+ context $cx stat
Name Use
All files (.a .+ .m .c etc.) are in the Unix hierarchical file system, and can always be referred to by their full pathnames.
All A+ global variables are in either the root context or other contexts, and can be referred to by context.name .


System and Unix Command Syntax and Meaning

Examples of System Command Syntax and Meaning
CommandMeaning
$cd [d] current [change to d] directory
$load fns load fns. or fns.+ or fns.a
$cx [x]current [change to x] context
$vars [x] list variables (in current [or x] context)
$fns [x] list functions (in current [or x] context)
$ops [x] list operators (in current [or x] context)
$xfs [x] list external functions (in current [or x] context)
$ex name[s] expunge name[s] in current context
$cxslist all contexts
$sfslist system functions
$wa [m] workspace available [add m megabytes].
(When a wsfull error is encountered, alone on a line causes execution to be resumed with an enlarged workspace.)
$pp [n] current [change to n] printing precision
$rl nset random link
$sistate indicator stack
$stop [0 | 1 | 2] stops [off or on or trace]
$cmdslist the commands
$offsign off

Examples of Unix Command Syntax and Meaning
CommandMeaning
$ls *.alist all .a files
$rm t.mremove t.m
$mv f gmove f to g
$cp f gcopy f to g
$df /s/atmpdisk free for workspace
$mkdir dmake a new directory d
$rmdir dremove directory d
$datedisplay the date
Any non-A+ system commandremove $ and pass to Unix


Atomic Vector and Graphic Characters

Graphic Characters for Atomic Vector
(`char16 16) (HEX row and column labels)
  
0123 4567 89AB CDEF
  
00
10
20
30
40
50
60
70
80
90
A0
B0
C0
D0
E0
F0
                
                
 !"#$%&'()*+,-./
0123456789:;<=>?
@ABCDEFGHIJKLMNO
PQRSTUVWXYZ[\]^_
`abcdefghijklmno
pqrstuvwxyz{|}~?
                
                
     
     
   |
    
    
        
0F
1F
2F
3F
4F
5F
6F
7F
8F
9F
AF
BF
CF
DF
EF
FF
  
0123 4567 89AB CDEF
  


System Limits

Parse-Time System Limits
EntityLimit
locals999
items in a list notation999
items in a vector notation9999
nested parentheses depth999
input strings9999
number of function arguments 9
number of dyld'd function arguments8

Run-Time System Limits
EntityLimit
addressability4 billion bytes
array rank9
array dimensions2 billion
array depth approximately 87,0001
symbol length2 billion
simultaneously mapped files (else a maplim error occurs) 2,000 default, but can be increased or decreased by $maplim and `maplim.
open file descriptors Depends on system; for Solaris, the default soft limit (as shown by ulimit -a) is 256 and the hard limit (ulimit -Ha) is 1024. The limit includes adap connections, but not mapped files, which are closed after they are mapped.
A+ recursive stack2,000
, recursive stack10,000
integerroughly -2 billion to 2 billion (32 bits)
float16 decimal digits of precision (IEEE 64 bit); results beyond the 16th digit are not valid

  1. Depends on the depth of the C stack, and so on the machine architecture.  [Back to table cell]


A+ Keyboard

Click here to go to the interactive keyboard layout.



Click here for a keyboard diagram which will print much more clearly on a black-and-white laser printer.

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_65.html0000444000265000001440000000522310737165253013653 A+ Reference: Appendix: Miscellany

Appendix: Miscellany

Importing and exporting data: sys.exp is monadic and takes any A+ data object as its argument, returning an encoded character vector. sys.imp is also monadic and takes any result of sys.exp as its argument and returns the decoded data object as its result. Results of sys.exp are convenient for writing data to files or sending it to another Unix process.

Bus error: The A+ interpreter attempted to read from an address outside your area, or an attempt was made to read or write without regard to address alignment. If a [error] : bus (or a  : bus)  error occurs, the application should be restarted. If the error can be recreated, please contact us to look into it. See `busexit.

Segv error: The A+ interpreter attempted to write in an address outside your area. If a [error] : segv (or a  : segv) error occurs, the application should also be restarted, just as for a bus error, and the error reported to the A+ development group, email id aplusdev. See `busexit.

Process `a' illegal instruction: This message is most commonly caused by a bus or segv error, and indicates that you continued your session after a bus or segv error occurred. The application should be restarted and, if you didn't continue after a bus or segv error, please contact us so that we can look into it.

If an error is signalled by a program, as opposed to occurring in a primitive function or operator, the stack variables are not likely to be helpful. In particular, if an error is signalled from within adap, the stack variables will be meaningless, since there is no point in adap to suspend at.

The system context function, sys.getdomainname{}, if successfully executed, returns a character vector containing the NIS domain name of the current host; otherwise, it returns Null.


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_66.html0000444000265000001440000000570710737165254013664 A+ Reference: Index

Index to the A+ Reference Manual:  Introduction

The section linked to by "
All" is the entire index in one file.  It is slow to load, but it lets you use Find over the whole index in one operation.  Use the individual sections for any other purpose.

Instead of page numbers, which are meaningless online, arrows are used for references. When there is more than one reference for an entry, commas separate the references. If there are several references and one is principal, that one has an asterisk after its arrow.

For long sections, where a range of pages is shown in the printed version, a link to the end of the section is shown with "end" following the arrow. Links following see or see also or also see lead to other index entries; if there are several, they are separated by and, or, or a comma.

Common alternate names for primitive functions and operators are listed with the preferred name in parenthesis and a link to the page on which it is defined. The parenthesized name constitutes a see reference but you have a direct path to the principal reference. Certain other terms are also listed in this form.

The special APL symbols are included here (in the "Symbols" section), as are the English names of the functions and operators that they represent. The symbols are listed in the order of the English names; when there are several names corresponding to a symbol, it is listed under each, with subentries for the others. The symbols can also be found (with links) in the table at the beginning of Appendix B, "Quick Reference", as can complete tables of the system functions, variables, and commands. The latter are listed here in the index under the headings "system functions", "system variables", and "system commands", as well as separately.

The "Display Attributes" table lists all attributes alphabetically and summarizes certain of their properties. It includes references to further information about individual attributes (marked "more", or "cb" or "fn", for callback or functional information).

A list of the display classes is given in this index under "display classes"; also, the contents frame at left lists all display classes.


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_67.html0000444000265000001440000004141710737165254013663 A+ Reference: Index - Symbols

Index - Symbols

Links within this section:
< = > ^ \ / % | ! [] + - ~ # * @ ? , . .



$  Abandon execution  -> 
$...   -> , -> 
also see system commands
~  in Unix commands, $unxcmd ...~...  -> 
&...   -> 
_...   -> 
also see  system functions
_argv variable  -> ,   -> 
`...   -> 
also see  system variables
  Resume execution  -> 
  Abandon execution  -> 
|  Absolute value  -> 
Residue  -> 
+  Add  -> 
Identity  -> 
^  And  -> 
Stop  -> 
  Apply  -> 
Each  -> 
  Assignment  -> 
Result  -> 
Selective Assignment  -> 
  Bins  -> 
Grade up  -> 
Ʈ  Bitwise Cast derived function  -> 
Ʈ  Bitwise operator  -> 
[] Bracket Indexing  -> 
  Cast  -> 
Or  -> 
Type  -> 
,  Catenate  -> 
Ravel  -> 
  Ceiling  -> 
Max  -> 
#  Choose  -> 
Count  -> 
  Circle  -> 
Pi times  -> 
  Combine Symbols  -> 
Separate Symbols  -> 
/  Compress  -> 
Reduce  -> 
Replicate  -> 
#  Count  -> 
Choose  -> 
?  Deal  -> 
Roll  -> 
  Decode  -> 
Pack  -> 
  Default Format  -> 
Format  -> 
  Depth  -> 
Match  -> 
>  Disclose  -> 
Greater than  -> 
  Divide  -> 
Reciprocal  -> 
  Drop  -> 
Print  -> 
  Each  -> 
Apply  -> 
<  Enclose  -> 
Less than  -> 
  Encode  -> 
Unpack  -> 
=  Equal to  -> 
  Execute  -> 
Execute in Context  -> 
\  Expand  -> 
Scan  -> 
*  Exponential  -> 
Power  -> 
  Find  -> 
Interval  -> 
  Floor  -> 
Min  -> 
  Format  -> 
Default Format  -> 
  Grade down  -> 
  Grade up  -> 
Bins  -> 
>  Greater than  -> 
Disclose  -> 
  Greater than or Equal to  -> 
  High minus  -> 
+  Identity  -> 
Add  -> 
.  Inner Product  -> 
  Interval  -> 
Find  -> 
!  Item Ravel  -> 
Restructure  -> 
~  Laminate  -> 
Not  -> 
  Left  -> 
Null  -> 
<  Less than  -> 
Enclose  -> 
  Less than or Equal to  -> 
  Log  -> 
Natural log  -> 
  Map  -> 
Map In  -> 
  Match  -> 
Depth  -> 
  Matrix Inverse  -> 
Solve  -> 
  Max  -> 
Ceiling  -> 
  Member  -> 
Rake  -> 
  Min  -> 
Floor  -> 
  Multiply  -> 
Sign  -> 
  Natural log  -> 
Log  -> 
-  Negate  -> 
Subtract  -> 
~  Not  -> 
Laminate  -> 
  Not equal to  -> 
  Null  -> 
Left  -> 
  Or  -> 
Cast  -> 
Type  -> 
. Outer Product  -> 
  Pack  -> 
Decode  -> 
  Partition  -> 
Partition Count  -> 
  Pi times  -> 
Circle  -> 
  Pick  -> 
Raze  -> 
*  Power  -> 
Exponential  -> 
  Print  -> 
Drop  -> 
  Rake  -> 
Member  -> 
@  Rank  -> 
,  Ravel  -> 
Catenate  -> 
  Raze  -> 
Pick  -> 
  Reciprocal  -> 
Divide  -> 
/  Reduce  -> 
Compress  -> 
Replicate  -> 
/  Replicate  -> 
Compress  -> 
Reduce  -> 
  Reshape  -> 
Shape  -> 
|  Residue  -> 
Absolute value  -> 
!  Restructure  -> 
Item Ravel  -> 
  Result  -> 
Assignment  -> 
Selective Assignment  -> 
  Reverse  -> 
Rotate  -> 
  Right  -> 
?  Roll  -> 
Deal  -> 
  Rotate  -> 
Reverse  -> 
\  Scan  -> 
Expand  -> 
  Selective Assignment  -> 
Assignment  -> 
Result  -> 
  Separate Symbols  -> 
Combine Symbols  -> 
  Shape  -> 
Reshape  -> 
  Sign  -> 
Multiply  -> 
  Signal  -> 
Take  -> 
  Solve  -> 
Matrix Inverse  -> 
^  Stop  -> 
And  -> 
-  Subtract  -> 
Negate  -> 
  Take  -> 
Signal  -> 
  Transpose  -> 
Transpose Axes  -> 
  Type  -> 
Cast  -> 
Or  -> 
  Unpack  -> 
Encode  -> 
%  Value  -> 
Value in Context  -> 

About the Index

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_68.html0000444000265000001440000000216710737165255013664 A+ Reference: Index - Numerics

Index - Numerics

2down attribute  -> 
        callbacks for   -> 
2up attribute   -> 
        callbacks for   -> 

3down attribute   -> 
        callbacks for   -> 
3up attribute   -> 
        callbacks for   -> 

About the Index

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_69.html0000444000265000001440000004664610737165255013677 A+ Reference: Index - A

Index - A

A protocol (adap)  -> 
A+
        Emacs A+ mode variables  -> 
        font (APL font)  -> 
                for printing (PostScript)  -> 
        functions, calling from C  -> 
        home page  -> 
        invocation
                argument for  -> 
                controlling atmp memory mapping by -m  -> 
                from a shell  -> 
                from Emacs  -> ,   -> 
        overview  -> 
a-mode in Emacs  -> ,  ->* 
Abort Loading of Script function  -> 
_abortload system function  -> 
Absolute value function  -> 
accelerator key mnemonics, menu  -> 
accept handle (adap)  -> 
acceptfocus attribute  -> 
access permission characteristics  -> 
action display class  -> 
        arguments to attribute functions  -> 
active attribute  -> 
acyclic dependencies  -> 
adap  -> 
        see also adap. ...
        attribute
                for listeners  -> 
                host  -> 
                list  -> 
                listener  -> 
                name  -> 
                port  -> 
                protocol  -> 
                rBufsize  -> 
                retry  -> 
                rPause  -> 
                rPriority  -> 
                rQueueStatus  -> 
                service descriptor  -> 
                wBufsize  -> 
                wNodelay  -> 
                wPause  -> 
                wPriority  -> 
                wQueueStatus  -> 
        data structures  -> 
        debugging  -> 
        errors
                buffread  -> 
                buffwrite  -> 
                export  -> 
                fdsisset  -> 
                in synchronous communication  -> 
                interrupt  -> 
                nochan  -> 
                readImport  -> 
                select  -> 
                timeout  -> 
        events
                choose  -> 
                connected  -> 
                error  -> 
                read  -> 
                reset  -> 
                sent  -> 
        line reader  -> 
        loading into A+  -> 
        messages  -> 
        mode
                burst mode (read)  -> ,   -> 
                read event mode  -> 
                single mode (read)  -> ,   -> 
        protocols
                A  -> 
                delta  -> 
                ipc  -> 
                raw  -> 
                simple  -> 
                stream  -> 
                string  -> 
                tick  -> 
        service handles
                accept  -> 
                connection  -> 
                listen  -> 
                timer  -> 
        timeouts  -> 
        zero-length message  -> 
adap.Close function  -> 
adap.Connect function  -> ,   -> 
adap.Debug function  -> 
adap.Export function  -> 
adap.GetClientData function  -> 
adap.GetPort function  -> 
adap.GetTimeout function  -> 
adap.Has function  -> 
adap.Import function  -> 
adap.Listen function  -> ,   -> 
adap.ModifyTimer function  -> 
adap.Of function  -> 
adap.ReadQueueStatus function  -> 
adap.Reset function  -> 
adap.Send function  -> 
adap.SetClientData function  -> 
adap.SetTimer function  -> 
adap.Syncread function  -> 
adap.Syncsend function  -> 
adap.SyncXch function  -> 
adap.WriteQueueStatus function  -> 
Add function  -> 
add... attributes  -> 
        callbacks for addtexttrace  -> 
        callbacks for addtrace  -> 
alignment of data in tableField  -> 
All Attributes function  -> 
All Dependent Object Names function  -> ,   -> 
_alldep system function  -> ,   -> 
_alsf system function  -> 
Alt key  -> 
ambi-valence  -> 
& (ampersand)  -> 
ancestors attribute  -> 
And function  -> 
        argument checking  -> 
APATH  -> ,   -> 
APL
        character set  -> 
        font  -> 
        mode (input)  -> 
        symbols, see Symbols section of index or Table B-1(a)
aplus e-mail group  -> 
APLUS_ATMP environment variable  -> 
Append Selective Assignment  -> ,   -> 
        itemwise invalidation of dependency  -> 
appending to files: Pipe Out Append system command  -> 
applications  -> 
Apply operator  -> ,   -> ,   -> 

arcsin, arccos, etc.  -> 
area trace style  -> 
argument  -> 
        A+ invocation  -> 
        left  -> 
        right  -> 
        vector (for C)  -> 
argv  -> 
arithmetic of Inf   -> 
arrangement of children in a layout  -> 
array  -> 
        disclosed  -> 
                empty array  -> 
        display class  -> ,   -> 
        display of  -> ,   -> ,   -> 
                arguments to attribute functions  -> 
                example of  -> 
        empty  -> 
        enclosed  -> 
        indexing  -> 
        inquiring about  -> 
        nested  -> 
        simple  -> 
        specifying a constant  -> 
        visualization  -> 
arrow... attributes  -> 
ASCII mode (input)  -> 
ASCII strings for APL graphics  -> 
ASQLA  -> 
Assignment function  -> 
        see also Selective Assignment function
        in a program  -> 
        object bound to display class  -> 
        strand  -> ,   -> 
                syntax  -> 
        syntax of  -> 
        Value in Context on left  -> ,   -> 
        Value on left  -> ,   -> 
association list  -> 
        for specifying attributes  -> 
        from nested slotfiller  -> 
        to nested slotfiller  -> 
Association List to Slotfiller function  -> 
asterisks indicating depth  -> 
asynchronous communication (adap)  -> 
asynchronous model of the A+ process  -> 
Asynchronous Send (adap)  -> 
at... attributes  -> 
atmp space  -> 
        allocating  -> 
        controlling memory mapping characteristics  -> 
ATREE  -> 
attribute  -> ,   -> 
        see also attributes
        $globs system command  -> 
        _atts system function  -> 
        _get system function  -> 
        _set system function  -> 
        a list of every adap  -> 
        a table listing every s  ->  -   ->end
                a listing by category  -> 
        assigning  -> 
        characteristics  -> 
        color names, list of all available  -> 
        current values  -> 
        fonts, list of all available  -> 
        function  -> 
                arguments to  -> 
        modifying  -> 
        of classes  -> 
        of variables  -> 
        out format samples  -> 
        preferred font names  -> 
        removing  -> 
        value of  -> 
        variable, default  -> 
Attribute Sources function  -> 
Attribute Value, Get (adap)  -> 
Attribute Value, Set (adap)  -> 
attributes  -> 
        see also attribute

        a list of all adap  -> 
        a table listing all s  ->  -   ->end
                a listing by category  -> 
        adap service descriptor  -> 
        button press  -> 
        callbacks associated with  -> ,   -> 
        classes with, s.classesHaving  -> 
        copying  -> 
        default variables  -> 
        define, s.classHas  -> 
        functional  -> 
        get class defaults, s.defaultOf  -> 
        get defaults for a class, s.Of  -> 
        get values for parent, s.ofParent  -> 
        having callbacks  -> 
        key press  -> 
        list of for a class, s.attributes  -> 
                primitive to a class, s.primitiveTo  -> 
        nonpersistent  -> 
        objects with specific, s.which  -> 
        permitted for a class  -> 
        persistent  -> 
        possible values, s.domainOf  -> 
        set class defaults, s.hasDefault  -> 
        set defaults for a class, s.Has  -> 
        set values for parent, s.parentHas  -> 
        values for a class, s.ofClass  -> 
        variables, default  -> 
        with callbacks  -> 
_atts system function  -> 
axis  -> 
        attribute (s)  -> 
        leading  -> ,   -> 
        length  -> 
                also see dimension
        trailing  -> ,   -> 
        zero (of graph)  -> 

About the Index

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_7.html0000444000265000001440000007531510737165255013602 A+ Reference: Dyadic Scalar Functions

Dyadic Scalar Functions


As stated in the introduction, the term integer is used in this manual to indicate not only a domain of values but also a particular internal representation. To refer to the same domain of values when both integer and floating-point representations are allowed, the term restricted whole number is used. These floating-point representations need only be tolerably equal to the integers.

Classification of Dyadic Scalar Functions

Although they are listed alphabetically in this chapter, for convenient reference, the A+ dyadic scalar primitive functions can be grouped in five categories:

  • the most common arithmetical functions: Add, Subtract, Multiply, Divide, Power;
  • other computational functions: Residue, Log, Circle, Combine Symbols;
  • selection functions: Max (greater of), Min (lesser of);
  • comparison functions: Equal to, Not equal to, Less than, Less than or Equal to, Greater than, Greater than or Equal to;
  • logical functions: And, Or.

Application, Conformability, and Result Shape

All dyadic scalar functions produce scalars from scalars, and apply element by element to their arguments: they are applied to each pair of elements - one from each argument - independently of the others. There are three conformable cases for dyadic scalar functions:

  1. The arguments have identical shapes. In this case, corresponding elements from the two arguments are paired. The shape of the result equals the common shape of the arguments.

  2. One argument has exactly one element and the other does not. Then the single element (a "singleton") from the one argument is paired independently with each element of the other. The shape of the result equals the shape of the one with either more or fewer than one element. This case is called scalar extension.

    then:

  3. Each argument has one element. Then the result has a single element also. The rank of the result equals the larger of the two argument ranks.

    
         2+,2       Shapes are conformable
    4
    
         2+2       Scalar plus scalar
    (empty)
    
         2+,2      Scalar plus one-element vector
    1
    
    
The element-by-element application of the functions and the above conformability rules for their arguments are assumed in the following descriptions.

Common Error Reports

Multiple errors elicit but one report. Eight reports, including interrupt, are common to all dyadic primitive scalar functions, and each of these reports is issued only if none of the preceding ones apply:

  • parse: this error class includes valence errors that result from three or more arguments in braces;
  • value: an argument has no value;
  • nondata: an argument is a function or some other nondata object;
  • type: an argument is of an illicit type;
  • rank: conformability rules are not satisfied and the ranks of the arguments differ;
  • length: conformability rules are not satisfied because of a mismatch in a dimension of the arguments;
  • wsfull: the workspace is currently not large enough for execution of the function; a bare left arrow (), which dictates resumption of execution, causes the workspace to be enlarged if possible;
  • interrupt (not an error): the user pressed c twice (once if A+ was started from a shell) while holding the Control key down.
Except where noted, the omission of the left argument results not in a valence error report, but in the invocation of a monadic function or an operator that shares the function symbol.

Function Definitions

Add y+x

   Arguments and Result
The arguments and result are simple numeric arrays. For two nonempty arguments, the result is integer if both arguments are integer and all result elements lie inside the range of integer representation, and floating point otherwise. If exactly one argument is empty, the result is floating point if that argument is floating point, and otherwise its type is the type of the nonempty argument. If both are empty, then if one is floating point and the other integer the result is floating point, and otherwise its type is the type of the right argument.

   Definition
y plus x. The result may include Inf or Inf.

   Example
     1 0 1 1e308+10 20 30 1e308
 9 20 31 Inf

And y^x

   Arguments and Result
The arguments are simple arrays of restricted whole numbers. The result is an integer array.

   Definition
If x and y have boolean values (0 and 1) then y^x is the Logical And of y and x. That is:

   Additional Error Report Condition
If none of the common error conditions are reported (including an illicit, i.e., not simple numeric, type) then:

  • a type error is reported if an argument is not a restricted whole number.
   Examples
     0 0 1 1^0 1 0 1
 0 0 0 1
     43^14
 1

Circle yx

   Arguments and Result
The arguments and result are simple numeric arrays. Additionally, the left argument can also be symbolic. The result is always in floating point.

   Definition
Strictly, the elements of a numeric left argument y must be restricted whole numbers from -7 to 7; however, all floating-point numbers greater than -8 and less than 8 are accepted and, in effect, rounded toward zero to produce integers. Each element of y indicates the trigonometric, hyperbolic, or algebraic function to be applied to the corresponding element of the right argument x. All angles are in radians. See the table for details.

Notation for the Circle Functions
A+ ExpressionMeaning A+ ExpressionMeaning
`sinarccos x or 0x(1-x*2)*0.5  

`sin x or 1xsin x `arcsin x or 1xarcsin x
`cos x or 2xcos x `arccos x or 2xarccos x
`tan x or 3xtan x `arctan x or 3xarctan x
`secarctan x or 4x(1+x*2)*0.5 `tanarcsec x or 4x(1+x*2)*0.5
`sinh x or 5xsinh x `arcsinh x or 5xarcsinh x
`cosh x or 6xcosh x `arccosh x or 6xarccosh x
`tanh x or 7xtanh x `arctanh x or 7xarctanh x

When both arguments are scalar, using the symbolic form adds about 40% to the processing time; the symbolic form adds less, of course, when the right argument is non-scalar. Symbolic form is heartily encouraged for all but the most time-critical applications.

   Additional Error Report
If none of the common errors listed above are reported, then:

  • a domain error is reported if the absolute value of an element of the left argument is equal to or greater than 8, and also if the absolute value of the right argument is less than 1 for left argument -4 or greater than 1 for left arguments of 0, -1, -2, and -7.
   Example
   1 1 3 3  2 4 2 0   sin(pi/2), sin(pi/4), tan(pi/2), arctan(Inf)
 1 0.7071067812 1.633177873e+16 1.570796327

Combine Symbols yx

   Arguments and Result
The arguments and result are simple arrays of symbols.

   Definition
This function takes context names and unqualified names and produces qualified names. More generally, for each scalar pair y,x: if, as displayed, x has a dot (period) in it, then the value of yx is x, and y is ignored; otherwise, the result is the symbol that is displayed as y, followed by a dot, followed by x without its backquote.

   Examples
     `c  `x `d.y `.z
 `c.x `d.y `.z
     `b.c `a  `x `y
 `b.c.x `a.y

Divide yx

   Arguments and Result
The arguments and result are simple numeric arrays. The result is always floating point.

   Definition
y divided by x. Division of a positive number by zero yields Inf, a unique scalar, and division of a negative number by zero yields Inf.

   Additional Error Report
If none of the errors listed in "Common Error Reports" are reported, then:

  • a domain error is reported for 00.
   Example
     0 1 2 3 4 52 2 2 2 0 0
 0 0.5 1 1.5 Inf Inf

Equal to y=x

   Arguments and Result
The arguments can be of any type. The result is boolean (integer type with values 0 and 1).

   Dependency
Comparison tolerance, if an argument is in floating point (see "Comparison Tolerance").

   Definition
The value is 1 if y tolerably equals x, and 0 if not.

   Additional Error Report
If there is no parse or value error (see "Common Error Reports"), then:

  • a valence error is reported if the left argument is missing.
   Examples
     ' '='this is it'
 0 0 0 0 1 0 0 1 0 0
     (<2 3, 4+1e-13)=(2 3 4;'abcde';5 6)
 1 0 0
     1 2 3 = '123'
 0 0 0

Greater than y>x

   Arguments and Result
The arguments are simple numeric, character, or symbol arrays. The result is boolean (integer type with values 0 and 1).

   Dependency
Comparison tolerance, if an argument is in floating point (see "Comparison Tolerance").

   Definition
The value is 1 if y is greater than x and not tolerably equal to x, and 0 otherwise. Characters are compared using their ASCII codes and symbols using the usual lexical ordering based on the ASCII codes of their component letters.

   Examples
     (200 0 90 100 101 200,(100+1e-12),100+1e-11)>100
 0 0 0 0 1 1 0 1
     'b' > 'abc'
 1 0 0
     'B' > 'abc'       ASCII, not English, order.
 0 0 0
     `b > `a`b`c
 1 0 0
     `B > `a`b`c       Likewise.
 0 0 0
     `pint > `cup `pints `pound `quart `snootful `gallon
 1 0 0 0 0 1

Greater than or Equal to yx

   Arguments and Result
The arguments are simple numeric, character, or symbol arrays. The result is boolean (integer type with values 0 and 1).

   Dependency
Comparison tolerance, if an argument is in floating point (see "Comparison Tolerance").

   Definition
The value is 1 if y is greater than x or tolerably equal to x, and 0 otherwise. Characters are compared using their ASCII codes and symbols using the usual lexical ordering based on the ASCII codes of their component letters.

   Additional Error Report
If there is no parse or value error (see "Common Error Reports"), then:

  • a valence error is reported if the left argument is missing.
   Example
     200 0 90 100 101 200100
 0 0 0 1 1 1

Less than y<x

   Arguments and Result
The arguments are simple numeric, character, or symbol arrays. The result is boolean (integer type with values 0 and 1).

   Dependency
Comparison tolerance, if an argument is in floating point (see "Comparison Tolerance").

   Definition
The value is 1 if y is less than x and not tolerably equal to x, and 0 otherwise. Characters are compared using their ASCII codes and symbols using the usual lexical ordering based on the ASCII codes of their component letters.

   Example
     200 0 90 100 101 200<100
 1 1 1 0 0 0

Less than or Equal to yx

   Arguments and Result
The arguments are simple numeric, character, or symbol arrays. The result is boolean (integer type with values 0 and 1).

   Dependency
Comparison tolerance, if an argument is in floating point (see "Comparison Tolerance").

   Definition
The value is 1 if y is less than x or tolerably equal to x, and 0 otherwise. Characters are compared using their ASCII codes and symbols using the usual lexical ordering based on the ASCII codes of their component letters.

   Additional Error Report
If there is no parse or value error (see "Common Error Reports"), then:

  • a valence error is reported if the left argument is missing.
   Example
     200 0 90 100 101 200100
 1 1 1 1 0 0

Log yx

   Arguments and Result
The arguments and result are simple numeric arrays. The result is always in floating point.

   Definition
The logarithm of x to the base y.

   Example
     10.1 1 10 100 1000 1234.5 0
 1 0 1 2 3 3.091491094 Inf
   Additional Error Report
If none of the reports cited in "Common Error Reports" is issued, then:

  • a domain error is reported if an element of either argument is negative or if corresponding elements of the two arguments are both 1.

Max yx

   Arguments and Result
The arguments and result are simple numeric arrays. For two nonempty arguments, the result is integer if both arguments are integer, and floating point otherwise. If exactly one argument is empty, the result is floating point if that argument is floating point, and otherwise its type is the type of the nonempty argument. If both are empty, then if one is floating point and the other integer the result is floating point, and otherwise its type is the type of the right argument.

   Definition
The greater of y and x. When this function is used in Reduction (/), the name Max is appropriate.

   Example
     0  3 .5 1 5 .1
 3 .5 0 5 0

Min yx

   Arguments and Result
The arguments and result are simple numeric arrays. For two nonempty arguments, the result is integer if both arguments are integer, and floating point otherwise. If exactly one argument is empty, the result is floating point if that argument is floating point, and otherwise its type is the type of the nonempty argument. If both are empty, then if one is floating point and the other integer the result is floating point, and otherwise its type is the type of the right argument.

   Definition
The lesser of y and x. When this function is used in Reduction (/), the name Min is appropriate.

   Example
     99.5 100 91.1 112 99  100
 99.5 100 91.1 100 99

Multiply yx

   Arguments and Result
The arguments and result are simple numeric arrays. For two nonempty arguments, the result is integer if both arguments are integer and all result elements lie inside the range of integer representation, and floating point otherwise. If exactly one argument is empty, the result is floating point if that argument is floating point, and otherwise its type is the type of the nonempty argument. If both are empty, then if one is floating point and the other integer the result is floating point, and otherwise its type is the type of the right argument.

   Definition
y times x.

   Example
     100 1 2 3 1e308
 0 10 20 30 Inf

Not equal to yx

   Arguments and Result
The arguments can be of any type. The result is boolean (integer type with values 0 and 1).

   Dependency
Comparison tolerance, if an argument is in floating point (see "Comparison Tolerance").

   Definition
The value is 1 if y is not tolerably equal to x, and 0 if it is.

   Additional Error Report
If there is no parse or value error (see "Common Error Reports"), then:

  • a valence error is reported if the left argument is missing.
   Examples
     ' ''this is it'
 1 1 1 1 0 1 1 0 1 1
     (<2 3, 4+1e-13)(2 3 4;'abcde';5 6)
 0 1 1
     1 2 3  '123'
 1 1 1

Or yx

   Arguments and Result
The arguments are simple numeric arrays of restricted whole numbers. The result is an integer array.

   Definition
If x and y have boolean values (0 or 1) then yx is the Logical Or of x and y. That is:

11 equals 10 equals 01 equals 1;
00 equals 0.

Or is strictly boolean, never bitwise. All nonzero restricted whole numbers are treated as if they were 1.

To get bitwise behavior, use the Bitwise operator.

   Additional Error Reports
If none of the common error conditions is reported, then, with a domain report preempting a type report:

  • a domain error is reported (by Cast, actually) if the left argument is Null;
  • a type error is reported if an argument is not a restricted whole number, unless the arguments are suitable for Cast.
   Examples
     0 0 1 10 1 0 1
 0 1 1 1
     4314
 1

Power y*x

   Arguments and Result
The arguments and result are simple numeric arrays. The result is always floating point.

   Definition
y to the power x10*2 is exactly equal to 1e2 but in general there is a very slight (tolerable) difference between 10*N and 1eN, because logarithms are used except in this special case, whereas 1eN is exact.

   Example
     2*0 .5 1 2 3 4 5 6 7 8 1025
 1 1.414213562 2 4 8 16 32 64 128 256 Inf

Residue y|x

   Arguments and Result
The arguments and result are simple numeric arrays. For two nonempty arguments, the result is integer if both arguments are integer, and floating point otherwise. If exactly one argument is empty, the result is floating point if that argument is floating point, and otherwise its type is the type of the nonempty argument. If both are empty, then if one is floating point and the other integer the result is floating point, and otherwise its type is the type of the right argument.

   Dependency
Comparison tolerance, if an argument is in floating point (see "Comparison Tolerance").

   Definition
y|x is the remainder when x is divided by y. 0|x equals x. If y is nonzero, then y|x is x-yxy, in accordance with the mathematical definition of modular arithmetic, except as follows. If x is tolerably equal to ny, where n is a whole number not necessarily representable by type `int, then the result is 0. (So Inf|x and Inf|x are always 0.)

   Examples
     100 | 1930 1941 1952 1978, 100+1e-12
 30 41 52 78 0
     1.4 1.4 1.4 1.4 | 3.7 3.7 3.7 3.7
 0.9 0.5 0.5 0.9

Subtract y-x

   Arguments and Result
The arguments and result are simple numeric arrays. For two nonempty arguments, the result is integer if both arguments are integer and all result elements lie inside the range of integer representation, and floating point otherwise. If exactly one argument is empty, the result is floating point if that argument is floating point, and otherwise its type is the type of the nonempty argument. If both are empty, then if one is floating point and the other integer the result is floating point, and otherwise its type is the type of the right argument.

   Definition
y minus x.

   Example
     1 0 99.5 1e308 - .5 1 .5 1e308
 1.5 1 99 Inf

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_70.html0000444000265000001440000001723410737165256013657 A+ Reference: Index - B

Index - B

b attribute  -> 
b context  -> 
b.e function (reverse primitive Iota extension)  -> 
b.ge function (> or = primitive Iota extension)  -> 
b.i function (primitive Iota extension)  -> 
b.le function (< or = primitive Iota extension)  -> 
b.p function (primitive Iota extension, with permutation)  -> 
b.pe function (reverse primitive Iota extension, with permutation)  -> 
b.pge function (> or = primitive Iota extension, with permutation)  -> 
b.ple function (< or = primitive Iota extension, with permutation)  -> 
b.pr function (range, like Bins, with permutation)  -> 
b.r function (range, like Bins)  -> 
b.u function (faster primitive Iota extension for unique items)  -> 
back, window (lower)  -> 

backing store, inhibiting use  -> 
backpage... attributes  -> 
backslash, in character string  -> 
backspace character  -> 
Bang, dyadic (Restructure function)  -> 
Bang, monadic (Item Ravel function)  -> 
banner attribute, reports  -> 
banner, suppressing on A+ invocation  -> 

bar trace style  -> 
bar, scroll  -> 
barwidth attribute  -> 
base table (t)  -> 
Base value (Decode function)  -> 
be attribute  -> 
Beam  -> 
        also see Map
bg... attributes  -> 
        bg  -> 
Binary ... functions, see b. ...
Bind Several function, s.are   -> 
binding of notebook - showbinding attribute  -> 
bindingwidth attribute  -> 
Bins function  -> 
        see also b context
Bitwise Cast derived function  -> 
Bitwise operator  -> 
blank attribute  -> 
blink... attributes  -> 
        arguments to blink attribute function  -> 
block  -> 
        see also expression group
body, window  -> 
bold attribute  -> 
        arguments to attribute function  -> 
boolean And and Or arguments, checking for  -> 
border
        around object (shadowthickness attribute)  -> 
                for graphs  -> 
        when object has focus
                color of (hl attribute)  -> 
                thickness of (hlthickness attribute)  -> 
border... attributes  -> 
bottom... attributes  -> 
bound attribute  -> 
bound object, Assignment to  -> 
bound objects, list of all, s.objects  -> 
Bound To function, s.boundTo  -> 
Box (Enclose function)  -> 
box, see border
box type  -> 
box... attributes  -> 
brace  -> 
Brace Assignment function (Selective Assignment)  -> 
bracket  -> 
Bracket Indexing function  -> ,   -> 
        in itemwise dependencies  -> 
        itemwise invalidation of dependency  -> 
        syntax of  -> 
break fields (group fields, t)  -> 
break... attributes  -> 
browsing source code  -> 
buffer
        attribute  -> 
        primary selection  -> 
        size (adap)  -> ,   -> 
buffread error, adap  -> 
buffwrite error, adap  -> 
build attribute  -> 
burst mode (adap read)  -> ,   -> 
bus error  -> ,   -> ,   -> 
Bus Error Flag variable  -> 
`busexit system variable  -> 
Business Days function (t)  -> 
button
        clicking  -> 
        display class  -> 
                arguments to attribute functions  -> 
        mouse  -> 
                middle button  -> 
        pressing  -> 

About the Index

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_71.html0000444000265000001440000005156210757556052013662 A+ Reference: Index - C

Index - C

C
        attribute  -> 
        calling A+ functions from  -> 
        escape sequence  -> 
        subroutines
                calling from A+  -> 
                include file of defines and macros  -> 
                writing for call from A+  -> 
c context  -> 
c.AHeader function  -> 
c.char_pointed_to_by function  -> 
c.double_pointed_to_by function  -> 
c.float_pointed_to_by function  -> 
c.form function  -> 
c.int_pointed_to_by function  -> 
c.place_chars_at function  -> 
c.place_floats_at function  -> 
c.place_ints_at function  -> 
c.pointer function  -> 
c.ptr function  -> 
c.short_pointed_to_by function  -> 
c.string_pointed_to_by function  -> 
c.struct_pointed_to_by function  -> 
c.structcreate function  -> 
c.structdef function  -> 
c.structget function  -> 
c.structprint function  -> 
c.structset function  -> 
c.structsize function  -> 
c.structtype function  -> 
c.stuff function  -> 
c.unstuff function  -> 
cache (and files)  -> 
Calendar Indices function (t)  -> 
Call Default Callback Function  -> 
call expression
        function  -> 
        operator  -> 
callback  -> 
        see also callback function
        adap  -> 
        associated with attribute  -> ,   -> 
        avoiding  -> ,   -> 
        caused by Selective Assignment  -> 
        causing  -> 
        disabling  -> 
        during dependency evaluation  -> 
        enabling  -> 
        invoking default action for attribute  -> 
        preset  -> 
        removing  -> ,   -> 
        setting  -> ,   -> 
        static data  -> 
        tracing  -> 
        when it occurs  -> 
        X Events Flag command  -> 
Callback Flag command  -> 
Callback Flag variable  -> 
callback function  -> ,   -> 
        see also callback
        and adap  -> 
        arguments  -> 
        associated variable  -> 
        associated with
                attribute  -> 
                dependency  -> 
                event  -> 
                mapped file  -> 
                variable  -> 
        event  -> 
        execution  -> ,   -> 
                after variable change  -> 
                before variable change  -> 
        number of arguments  -> ,   -> ,   -> 
        result  -> 
        static data  -> 
        syntax  -> 
        variable  -> 
        when called  -> 
calling A+ functions from C  -> 
calling C subroutines from A+  -> 
cancel attribute  -> 
candlestick trace style  -> 
Capture the Screen Configuration function  -> 
carriage return character  -> 
case statement  -> ,   -> 
        syntax of  -> 
Cast function  -> 
        Bitwise Cast  -> 
categorization within t tables  -> 
Catenate function  -> 
Catenation function (t)  -> 
`CCID system variable  -> 
$cd system command  -> 
_cd system function  -> 
CDR (Common Data Representation)  -> 
Ceiling function  -> 
cell  -> ,   -> ,   -> 
_cfi system function  -> 
Change Directory command  -> 
Change Directory function  -> 
character
        constant, syntax of  -> 
        sequences (quasi-operators)  -> 
        type  -> 
charts, pie  -> 
check display class  -> 
        arguments to attribute functions  -> 
children  -> 
        attribute  -> 
        child objects  -> 
        independent displays  -> 
choice display class  -> 
        arguments to attribute functions  -> 
choose event (adap)  -> 
Choose function  -> 
        itemwise invalidation of dependency  -> 
choosing, in window  -> 
Circle function  -> 
Circle, monadic (Pi times function)  -> 
C-language structure  -> 
class
        see also display class
        attribute  -> ,   -> 
        binding  -> ,   -> 
        binding function, is  -> 
        display  -> 
        list of every, s.classes   -> 
        list of meta, s.metaClasses   -> 
        list of real, s.realClasses   -> 
        list of virtual, s.virtualClasses   -> 
        permitted for a variable  -> 
        syntactic  -> 
Class Can Have Attributes function  -> 
Classes with Attributes function  -> 
clear attribute  -> ,   -> 
        callbacks for  -> 
C-library routines  -> 
clicking  -> 
client  -> 
Client Data, Get (adap)  -> 
Client Data, Set (adap)  -> 
client-server  -> 
clipping text  -> 
close
        file: sys.close   -> 
        trace style  -> 
        window  -> 
Close Columns of a Table function (t)  -> 
Close Handle (adap)  -> 
$cmds system command  -> 
col... attributes  -> 
color

        arguments to attribute function  -> 
        attribute  -> 
        closest named, s.closest   -> 
        convert
                hex to name, s.hc   -> 
                hex to rgb, s.hc3   -> 
        cycling colors  -> 
        list of every named  -> 
                name to hex, s.ch   -> 
                name to pixel, s.color   -> 
                name to rgb, s.cc3   -> 
                rgb to hex, s.c3h   -> 
                rgb to name, s.c3c   -> 
        name of each  -> 
        names and numbers  -> 
        varying shade, s.shade   -> 
color... attributes  -> 
                arguments to color attribute function  -> 
                arguments to colors attribute function  -> 
colormap, window manager  -> 
colorprofile trace style  -> 
cols... attributes  -> 
        arguments to colspace attribute function  -> 
column  -> 
        definition in t  -> 
        moving and resizing by dragging, in table display class  ->* ,   -> ,   -> 
        variable in t  -> 
column... attributes  -> 
Combine Symbols function  -> 
Comma Fix Input function  -> 
Comma, dyadic (Catenate function)  -> 
Comma, monadic (Ravel function)  -> 
command  -> 
        see also system command
        Unix  -> 
command display class  -> 
        arguments to attribute functions  -> 
command-line argument  -> 
Commands command  -> 
comment  -> 
        syntax of  -> 
comments about the manual  -> 
communication, interprocess  -> 
comp... attributes  -> 
comparable cells  -> 
comparison tolerance  -> 
Complement function (t)  -> 
Compress (Replicate function)  -> 
Concatenate (Catenate function)  -> 
concepts, data  -> 
concurrently mapped file, writing and reading  -> 
conformability (of arguments)  -> 
Connect (adap)  -> 
connected event (adap)  -> 
connection handle (adap)  -> 
constant
        character, syntax of  -> 
        numeric, syntax of  -> 
        specifying an array  -> 
        symbol, syntax of  -> 
constraints attribute  -> 
context  -> ,   -> 
        adap  -> 
        b  -> 
        c  -> 
        changing  -> 
        current  -> 
        during function suspension  -> 
        name
                Combine Symbols function  -> 
                for Value function  -> 
                for Value in Context  -> 
                Separate Symbols function  -> 
                syntax  -> 
        p  -> 
        root  -> ,   -> 
        s  -> 
        sys  -> 
        t  -> 
        tracing (debugging)  -> 
        within a function  -> ,   -> 
Context command  -> 
Context variable  -> 
Contexts command  -> 

contourstyle attribute  -> 
control characters  -> 
control statement  -> 
        definition of every  ->  -    ->end
        error reports (common)  -> 
        syntax of  -> 
conventions used in this manual  -> 
coordinate  -> 
        see also index
Coordinate attribute  -> 
coordinate attribute  -> 
coordinated scrolling  -> 
Copy Attributes function, s.copy   -> 
copy, avoiding during assignment  -> 
copy... attributes  -> 
        callbacks for copytexttrace  -> 
        callbacks for copytrace  -> 
Core File Size Limit variable  -> 
`corelim system variable  -> 
corner, resize  -> 
cornerindex... attributes  -> 
cosh  -> 
cosine  -> 
Count function  -> 
Cover (Enclose function)  -> 
cpu time
        process, sys.cpu  -> 
        time function  -> 
creating
        array  -> 
        dependency  -> ,   -> 
        file, sys.creat   -> 
Cup, dyadic (Combine Symbols function)  -> 
Cup, monadic (Separate Symbols function)  -> 
current context  -> 
current... attributes  -> 
cursor attribute  -> 
$cx system command  -> 
`cx system variable  -> 
$cxs system command  -> 
cycle... attributes  -> 
cyclical dependencies
        detection  -> ,   -> 
        order of evaluation  -> 
        recursive references  -> 

About the Index

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_72.html0000444000265000001440000005072210737165257013661 A+ Reference: Index - D

Index - D

DAP  -> 
data
        operand  -> 
        structure  -> 
                adap  -> 
        visualization  -> 
database (t)  -> 
data-point move, graph  -> 
date, format  -> 
dc()   -> ,   -> 
$dbg system command  ->* ,   -> 
_dbg system function  -> 
Deal function  -> 
Debug Flag (adap)  -> 
Debug function, _dbg   -> 
debugging  -> 
        & (ampersand)  -> 
        adap trace messages  -> 
        bus errors  ->* ,   -> 
        Callback Flag command  -> 
        Callback Flag variable  -> 
        callback functions (for tracing variables)  -> 
        Debug function, _dbg   -> 
        Debugging State command  -> 
        Dependency Flag command  -> 
        Dependency Flag variable  -> 
        documentation, additional  -> 
        execution stack references  -> 
        execution stack representation  -> 
        frozen workstation  -> 
        NaN location  -> 
        Protected Execute Flag command  -> 
        Protected Execute variable  -> 
        segv errors  -> ,   ->* ,   -> 
        Signal function  -> 
        State indicator command  -> 
        Stop command  -> 
        Stop function  -> 
        Stop variable  -> 
        X Events Flag command  -> 
        X Events Flag variable  -> 
Debugging State command  -> ,   -> 
Decode function  -> 
decorators for Format system function  -> 
decrement attribute  -> 
$def system command  -> ,   -> 
_def system function  -> ,   -> 
default
        display class  -> 
        title  -> 
Default Format function  -> 
Define a Column function (t)  -> 
defined function  -> 
        Assignment function in  -> 
        converting to text  -> 
        entry of  -> ,   -> 
                tips  -> 
        fully qualified name in  -> 
        header  -> ,   -> 
        in Selective Assignment expressions  -> 
        result  -> 
        syntax of  -> ,   -> 
defined operator  -> ,   -> 
        Assignment function in  -> 
        data operand  -> 
        entry of  -> 
        header  -> 
        result  -> 
        syntax of  -> ,   -> 
definition
        dependency  -> 
        function  -> 
        operator  -> 
deiconized attribute  -> ,   -> 
delay, no (adap)  -> 
delete
        attribute  -> 
                callbacks for  -> 
        dependency  -> 
        row of displayed object  -> 
delimiter attribute  -> 
delta protocol (adap)  -> 
$dep system command  -> ,   -> 
$deps system command  -> ,   -> 
Dependencies command  -> ,   -> 
dependency  -> ,   -> ,   -> 
        see also itemwise dependency and  cyclical dependencies
        Assignment to  -> 
        callback during evaluation  -> ,   -> 
        callback functions on  -> 
        context  -> 
        creation of  -> ,   -> 
        definition  -> 
                entry  -> 
                in context  -> 
                removal  -> 
                tracing  -> 
        efficiency  -> 
        evaluation  -> ,   -> 
                tracing  -> 
        frames (t)  -> 
        global variable in  -> 
        invalidation  -> ,   -> ,   -> ,   -> 
        itemwise  -> 
        mapped file in  -> 
        recognition of itemwise dependence  -> 
        referencing  -> 
        restoration of saved value  -> 
        result of  -> 
        saved value  -> ,   -> 
        suspension upon failure  -> 
        syntax of  -> 
        system commands for  -> 
        system functions for  -> 
        testing for cyclic  -> 
        tracing  -> 
        variables whose use is not visible  -> 
        visibly referenced objects in definition  -> 
        when bound to display class  -> 
Dependency Definition command  -> ,   -> 
Dependency Definition function  -> ,   -> 
Dependency Flag command  -> 
Dependency Flag variable  -> 
Dependent Object Names command  -> ,   -> 
Dependent Object Names function  -> ,   -> 
$dep system command  -> ,   -> 
_dep system function  -> ,   -> 
$deps system command  -> ,   -> 
depth
        nesting  -> 
        punctuation  -> 
        tracing  -> 
Depth function  -> ,   ->* 
derived
        function  ->* 
                quasi-operator  -> 
        table (t)  -> 
                dynamic  -> 
descendents attribute  -> 
desktop
        geometry, s.desktop   -> 
        sector of, s.beHere   -> 
Detach a Column from its Sources function (t)  -> 
detaching a column (t)  -> 
$Df system command  -> 
`Df system variable  -> 
difference, set (t tables)  -> 
dimension  -> 
Direct Static Link function (t)  -> 
Direct Static Summary function (t)  -> 
directory
        change: sys.chdir   -> 
        list entries: sys.agetdents   -> 
        make: sys.mkdir   -> 
disclaimer... attributes  -> 
Disclose function  -> 
dismiss, window  -> 
disorientation attribute  -> 
Disperse (data) function (t)  -> 
display  -> ,   -> ,   -> 
        attribute (s)  -> 
        default  -> 
        format of variables  -> 
        function definition  -> 
        interactions  -> 
        of arrays  -> 
                empty  -> 
        refreshing
                and dependencies  -> 
                and done attribute  -> 
Display (Print function)  -> 
display class  -> 
        see also display classes
        a table listing all attributes  ->  -   ->end
        Assignment to bound object  -> 
        attributes  -> 
        creating  -> 
        managing  -> 
        user interaction with  -> 
display classes  -> 
        see also display class
        action  -> 
        array  -> ,   -> 
        button  -> 
        check  -> 
        choice  -> 
        command  -> 
        compound objects  -> 
        container object  -> 
        graph  -> ,   -> 
        graphTrace  -> 
        hgauge  -> 
        hgrid  -> 
        hmenu  -> 
        hpane  -> 
        hscale  -> ,   ->* 
        label  -> 
        layout  -> ,   -> 
        matrix  -> 
        notebook  -> 
        page  -> 
        password  -> 
        radio  -> 
        report  -> 
        scalar  -> 
        slot  -> 
        table  -> 
        tableField  -> 
        text  -> 
        tree  -> 
        vgauge  ->* ,   -> 
        vgrid  ->* ,   -> 
        view  -> 
        vmenu  -> ,   -> 
        vpane  -> ,   -> 
        vscale  -> ,   ->* ,   -> 
        window  -> 
DISPLAY environment variable
        and A+ invocation  -> 
        and s  -> 
display... attributes, see label... attributes
distributed analytics platform  -> 
Divide function  -> 
Divide, monadic (Reciprocal function)  -> 
divider, movable, in hpane  -> 
divider, window  -> 
do statement
        dyadic (iterative)  -> 
        monadic (protected execution)  -> 
                tracing  -> 
        syntax of  -> 
doc attribute  -> 
documentation
        miscellaneous  -> 
        screen management: s.doc   -> 
$doErrorStack system command  -> 
_doErrorStack system function  -> 
`doErrorStack system variable  -> 
Domain Name function: sys.getdomainname   -> 
Domino, dyadic (Solve function)  -> 
Domino, monadic (Matrix Inverse function)  -> 
done attribute  -> 
        callbacks for  -> 
double click, s.DOUBLECLICKINTERVAL   -> 
downto attribute  -> 
dragdrop attribute  -> 
dragging, window  -> 
Drop function  -> 
duplicate items in a link field (t)  -> 
dyadic function  -> ,   -> 
dyadic scalar function  -> 
        application of  -> 
        classification of every  -> 
        conformability of arguments  -> 
        definition of every  ->  -   ->end
        error reports (common)  -> 
        shape of result  -> 
        similarity of Rank operator  -> 
_dyld system function  -> 
`dyme system variable  -> 
dynamic attribute  -> 
Dynamic Derived Table function (t)  -> 
Dynamic Environment variable  -> 
Dynamic Load function  -> 
dynamic loading  -> ,   -> ,   -> 
        AIX  -> 
        Sun  -> 
        tracking of  -> 
Dynamic Sorted Derived Table function (t)  -> 

About the Index

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_73.html0000444000265000001440000002644610737165257013670 A+ Reference: Index - E

Index - E

Each operator  -> ,   -> 
edit... attributes  -> 
editing  -> 
        see also search
        data on the screen  -> ,   -> 
                callbacks for beginning and ending  -> 
$Ef system command  -> 
`Ef system variable  -> 
elapsed time  -> 
electrified attributes
        attribute default variables  -> 
        has  -> 
        s.doesNotUse   -> 
        s.Has   -> 
        s.used   -> 
        s.usedBy   -> 
        s.uses   -> 
        s.using   -> 
element (of array)  -> 
Emacs  -> 
        A+ mode variables  -> 
        invoking A+ from  -> 
        programming environment  -> 
empty array  -> 
        display of  -> 
        type of  -> 
Encapsulated PostScript (eps)  -> 
Enclose function  -> ,   -> ,   -> 
Encode function  -> 
End functions, b.e and b.pe  -> 
e-notation  -> 
Enter key  -> 
entering data on the screen  -> ,   -> ,   -> 
environment
        dynamic  -> 
        get: sys.readenv   -> 
        in the workspace  -> 
        put: sys.setenv   -> 
        variable
                APATH  -> 
                ATREE  -> 
epsilon, dyadic (Member function)  -> 
Equal to function  -> 
equal, tolerably  -> ,   -> 
Equivalent (Match function)  -> 
error
        bus  -> ,   -> ,   -> 
        code  -> 
        event (adap)  -> 
        omitted report  -> ,   -> 
        report  -> 
                control statements  -> 
                dyadic primitive operators (common)  -> 
                dyadic scalar functions (common)  -> 
                form  ->* ,   -> 
                from dynamically loaded code  -> 
                monadic primitive operators (common)  -> 
                monadic scalar functions (common)  -> 
                non-scalar primitive functions (common)  -> 
                omitted  -> ,   -> 
                suppressing
                        adap  -> 
                        all (from XTerm or script)  -> 
                        debug  -> 
                        s  -> ,   ->* 
                        SIGPFE  -> 
                system functions (common)  -> 
        segv  -> ,   -> ,   -> 
        stale NFS handle  -> 
        system call
                message: sys.perror   -> 
                number: sys.errno   -> 
                symbol: sys.errsym   -> 
escape sequence  -> 
Establish Screen Management Functions function  -> 
eval... attributes  -> 
evaluation order  -> 
        see also execution order
event callback function  -> 
event loop (main loop)  -> 
event, adap  -> 
        see also adap: events
$ex system command  -> 
_ex system function  -> 
Exchange, Synchronous (adap)  -> 
$excxt system command  -> 
_excxt system function  -> 
execute attribute  -> 
Execute function  -> 
        execution of system command  -> ,   -> 
        tracing  -> 
Execute in Context function  -> 
Execute, dyadic (Execute in Context and Protected Execute functions)  -> 
execute, s.execute function  -> 
execution
        see also immediate execution
        abandonment  -> 
        completion  -> 
        counts  -> 
        order of  -> ,   -> 
                in sequences of expressions  -> 
        resumption  -> ,   -> ,   -> 
        stack
                references  -> 
                representation (K Stack, `si)  -> 
        suspension  -> ,   -> 
Execution Profile function  -> 
Execution Suspension Flag command  -> 
Execution Suspension Flag variable  -> 
exit
        attribute  -> 
                callbacks for  -> 
        function: sys.exit   -> 
Exit function  -> 
_exit system function  -> 
Expand function  -> 
exponential format  -> 
Exponential function  -> 
Export an Array: sys.export   -> 
Export Data (adap)  -> 
export error, adap  -> 
export, simplified: sys.exp   -> 
exporting data, adap.Export and sys.exp   -> 
expression  -> 
        block  -> 
        entry of  -> 
        function  -> ,   -> 
        function call  -> ,   -> 
        group  -> 
                result  -> 
        operator call  -> 
        result  -> 
        strand  -> 
        target  -> 
        well-formed  -> 
Expunge command  -> 
Expunge Context command  -> 
Expunge Context function  -> 
Expunge function  -> 
extension, scalar  -> 
extent... attributes  -> 
external function, tracing of  -> 
External Functions command  -> 
external routines, suppressing floating point exception reports  -> 

About the Index

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_74.html0000444000265000001440000003620110737165257013657 A+ Reference: Index - F

Index - F

f1 through f12 attributes  -> 
familytree attribute  -> 
fdsisset error, adap  -> 
fg... attributes  -> 
        arguments to fg attribute function  -> 
_fi system function  -> 
field variable  -> 
field... attributes  -> 
fields
        of a table display object  -> 
        order on screen  -> 
file  -> 
        see also mapped file and script: file
        accessibility: sys.access   -> 
        append: Pipe Out Append command  -> 
        attribute (s: output file for reports)  -> 
        close: sys.close   -> 
        create: sys.creat   -> 
        creation mask: sys.umask   -> 
        descriptor
                duplicate: sys.dup   -> 
                duplicate and specify: sys.dup2   -> 
                functions: sys.fcntl   -> 
                max number of descriptors: sys.getdtablesize   -> 
                select ready: sys.aselect   -> 
        directory
                change  -> 
                entries  -> 
                make  -> 
        find: sys.pathfind   -> 
        length  -> 
        link
                establish symbolic: sys.symlink   -> 
                establish: sys.link   -> 
                read: sys.areadlink   -> 
        list of currently mapped  -> 
        loading: File Being Loaded system variable  -> 
        lock: sys.flock   -> 
        mapped  -> 
                callbacks on  -> 
        open file descriptor special functions: sys.ioctl   -> 
        open: sys.open   -> 
        operations  -> ,   -> ,   -> ,   -> ,   -> 
        owner
                sys.chown   -> 
                sys.fchown   -> 
        permissions mode  -> 
                sys.chmod   -> 
                sys.fchmod   -> 
        pointer: sys.lseek   -> 
        read
                Pipe In command  -> 
                sys.read   -> 
                sys.readinto   -> 
                sys.readmat   -> 
        rename: sys.rename   -> 
        script  -> 
        search order  -> 
        size: sys.filesize   -> 
        statistics
                sys.alstat   -> 
                sys.astat   -> 
        synchronization: sys.fsynch   -> 
        synchronize a mapped file: sys.amsynch   -> 
        text  -> 
        tracking  -> 
        truncate
                sys.ftruncate   -> 
                sys.truncate   -> 
        Unix text  -> 
        unlink: sys.unlink   -> 
        update time: sys.updtime   -> 
        write
                Pipe Out Append command  -> 
                Pipe Out command  -> 
                sys.write   -> 
fill element (Take, Expand)  -> 
fill trace style  -> 
fill... attributes  -> 
        fillcolor attribute   -> 
                arguments to attribute function  -> 
Find function  -> 
        see also b context
Find function (t)  -> 
first  -> 
First (Interval function)  -> 
first... attributes  -> 
Fix a View function (t)  -> 
Fix Input function  -> 
fixedfields attribute  -> 
fixedreportcolumns attribute  -> 
fkeys attribute  -> 
Flag
        Callback  -> ,   -> 
        Debug (adap)  -> 
        Dependency  -> ,   -> 
        Execution Suspension  -> ,   -> 
        Floating Point Exception  -> 
        Protected Execute  -> ,   -> 
        Terminal  -> ,   -> 
        X Events  -> ,   -> 
_flat system function  -> 
Flatten function  -> 
floating-point exceptions, external, suppressing reports  -> 
floating-point type  -> 
Floor function  -> 
Flush Standard Out: sys.fflush_stdout   -> 
_fmt system function  -> 
$fns system command  -> 
focus  -> 
        attribute  -> 
        keyboard  -> 
                moving  -> 
        object with keyboard, s.this   -> 
follower, window  -> 
follower... attributes  -> 
font  -> ,   -> 
        APL  -> 
                for printing (PostScript)  -> 
        attribute  -> 
                arguments to attribute function  -> 
                preferred font names  -> 
        conventions in this manual  -> 
        Font Name to Internal Form Conversion function  -> 
        Kanji  -> 
        lists of fonts  -> ,   -> ,   -> 
foot... attributes  -> 
footer, window  -> 

fork exec, socket: sys.sfe   -> 
formal operator  -> 
format
        for screen output  -> ,   -> ,   -> ,   -> 
        Format function  -> 
        Format system function  -> 
                format phrases for  -> 
                messages, off switch  -> 
        Format, monadic (Default Format function)  -> 
        Get Format Symbols  -> 
        s.box function  -> 
        Screen Format function  -> 
formatbreakfunc attribute  -> 
formfeed character  -> 
frame  -> ,   -> ,   -> 
        subframe  -> 
        window  -> 
frame... attributes  -> 
Free All Objects function  -> 
free function  -> ,   -> 
free object  -> 
free()   -> 
freeze attribute  -> 
FROM_HEAP setting for APLUS_ATMP environment variable  -> 
front, window (raise)  -> 
frozen workstation, debugging  -> 
fullscreen attribute  -> 
function
        see also primitive function, system function,
                        defined function, callback function,
                        dependency, operator
        call expression  -> ,   -> 
                in scripts, recommended form  -> 
                locating in scripts  -> 
        context  -> 
                also see context, within a function
        definition
                converting to text  -> 
                entry of  -> 
                locating (script) source  -> 
                tips  -> 
                tracing  -> 
                use of tabs  -> 
        dyadic  -> ,   -> 
        expression  -> ,   -> 
                scope rules in  -> 
        header  -> 
        key attribute, callbacks for  -> 
        monadic  -> ,   -> 
        niladic  -> 
        scalar  -> 
        syntax  -> 
        tracing of  -> 
        type  -> 
        valence  -> 
function key attributes  -> 
functional attributes  -> 
Functions command  -> 
functions that modify arguments  -> ,   -> 

About the Index

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_75.html0000444000265000001440000002504110737165260013652 A+ Reference: Index - G

Index - G

_gcb system function  -> 
_gcd system function  -> 
General Search and Replace function  -> 
general type  -> ,   -> 
_get system function  -> 
geometry attribute  -> 
        arguments to attribute function  -> 
get
        see also file, mapped file, attributes, read
        Get Attribute Default Variables or Values function  -> 
        Get Attribute Defaults for a Class function  -> 
        Get Attribute function  -> 
        Get Attribute Value (adap)  -> 
        Get Attribute Values for Parent function  -> 
        Get Callback function  -> 
        Get Client Data (adap)  -> 
        Get Client Data system function  -> 
        Get Format Symbols function  -> 
        Get Preset Callback function  -> 
        Get System Variable function  -> 
        Get Timeout (adap)  -> 
Gets (Assignment function)  -> 
$Gf system command  -> 
`Gf system variable  -> 
_gfmtsym system function  -> 
gif files (printoutputmode attribute)  -> 
Global Objects command  -> 
global variable  -> 
$globs system command  -> 
GMT from seconds in epoch  -> 
GMT, current  -> 
_gpcb system function  -> 
Grade down function  -> 
Grade up function  -> 
gradient attribute  -> ,   -> 
        arguments to attribute function  -> 
graph display class  -> ,   -> 
        addtrace, addtexttrace attributes  -> 
        arguments to attribute functions  -> 
        attributes for margins (xleft, etc.)  -> 
        axes, attributes for  -> 
        axis  -> 
        axis title  -> 
        barwidth attribute  -> ,   -> ,   -> 
        bg, fg attributes  -> 
        bottom, top, left, right attributes  -> 
        coordinate attribute  -> 
        copytrace, copytexttrace attributes  -> 
        date format  -> 
        debug attribute  -> 
        extent attributes  -> 
        footnote  -> 
        footnotefg  -> 
        footnotefont  -> 
        footnotejustify  -> 
        format  -> 
        grid  -> ,   -> 
        gridfg  -> 
        gridstyle  -> 
        gridwidth  -> 
        inc attributes  -> 
        label attributes  -> ,   -> 
        labelfont attributes  -> 
        labelheight attributes  -> 
        labeljustify and sublabeljustify attributes  -> 
        labelout and sublabelout attributes  -> 
        labelwidth attributes  -> 
        legend  -> 
        legendbg  -> 
        legendfg  -> 
        legendfont  -> 
        legendhlthickness  -> 
        legendshadowthickness  -> 
        legendstyle  -> 
        majorticksize, minorticksize, minorticks  -> 
        out attribute  -> 
        refer, referpoint attributes  -> 
        rule  -> ,   -> 
        rulewidth  -> 
        selectable, selected attributes  -> 
        selectdistance attribute  -> 
        shadowthickness attribute  -> 
        subtitle  -> 
        subtitlefg  -> 
        subtitlefont  -> 
        subtitlejustify  -> 
        textactivate attribute  -> 
        tick mark  -> 
        tickstyle attributes  -> 
        title  -> ,   -> 
        titlefg  -> ,   -> 
        titlefont  -> ,   -> 
        titlejustify  -> ,   -> 
        titlestyle  -> 
        trace set  -> 
                attributes  -> 
                data  -> 
                order in which drawn  -> 
        user interaction with  -> ,   -> 
        Xfg  -> 
        xfg  -> 
        Xlabel  -> 
        xlabel  -> 
        xlegend  -> 
        xmin and xmax  -> 
        xs, ys attributes  -> 
        Yfg  -> 
        yfg  -> 
        Ylabel  -> 
        ylabel  -> 
        ylegend  -> 
        ymin and ymax  -> 
        zero axes  -> 
        zerofg  -> 
        zerostyle  -> 
        zerowidth  -> 

graphTrace display class  -> 
        arguments to attribute functions  -> 
        user interaction with  -> ,   -> 
Greater of (Max function)  -> 
Greater than function  -> 
Greater than or Equal to function  -> 
greatest representable integer  -> 
grid display classes  -> 
grid... attributes  -> 
group (t)  -> 
        fields  -> ,   -> 
                multiple  -> 
        functions  -> 
_gsr system function  -> 
_gsv system function  -> 

About the Index

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_76.html0000444000265000001440000000657710737165260013670 A+ Reference: Index - H

Index - H

H attribute  -> 
h attribute  -> 
Handle, Close (adap)  -> 
has attribute  -> 
has function  -> ,   ->* 
Hash Table Statistics function  -> 
_hashstat system function  -> 
head... attributes  -> 
header
        A structure  -> 
                mapped file  -> 
        attribute (s: in reports)  -> 
        c.AHeader   -> 
        defined function  -> ,   ->* 
        defined operator  -> 
        window  -> 
heap space  -> 
        allocating  -> 
hgauge display class  -> 
hgrid display class  -> 
        arguments to attribute functions  -> 
hide attribute  -> 
hide function  -> ,   -> ,   ->* 
high minus  -> 
high-low trace style  -> 
high-low-close trace style  -> 
hl... attributes  -> 
hmenu display class  -> 
        arguments to attribute functions  -> 
home page, A+  -> 
horizontalspace attribute  -> 
host (adap service descriptor attribute)  -> 
host name  -> 
Host Name function: sys.gethostname   -> 
hpane display class  -> 
        arguments to attribute functions  -> 
hscale display class  -> ,   -> 
        user interaction with  -> 
hyperbolic sine, cosine, tangent  -> 

About the Index

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/AcharsRB.gif0000444000265000001440000000302207215453021012657 GIF89affff3̙3f3333̙f3f3!,'dihlp,tmxnG,Ȥrl:g CdNt>x\L`%ڧ(p4^KY"b+ ,flnp'X(w)^I  6:+ <9d qoo5Y+H9)66&$'ݮ5fg+岇(( , &4():;Ǝ!;ʆf5&6ڲpŕ`#Gs%(c8ń .ב@D+#qKDz4ЇB%)]`B'@DXj`B T] d@: PDn0!\ 6v$AI\L"eXffɹ+^LA)f tSHG,Q"Zl(WbE10Ed0H; [4K. BDZQ+LlYe)i֙g$p6A):Z  m+@mSx"pRP(Uur,4ǜX4X\uWW+#c{}i^zPA`'^}G B=$ZSPڃFOm Ӌ g&"SO()gs4L{Fg"E\3P]xvᘣE%7Dz )}Hڇ M%v Рi%䪫 4Vˬ$8el1PDƏ iO# 'zg t 8矁Z5֘y]<'Ώ>6 FP_` BРXj%- zBhB ˞0pYBIB)euZmysv6L +FCb:q’R"dـz` .UiMʴF-zP <`q0%* ĩ"W-|2*dܲt|[$;W]~ƣGmjaJ.(ª3j&5 jlO:f+[%q@2k͸CTMD+'=HLr80{ܧGi0ځ:^Mk\YnK>/cj g(ЮmU9ruN-{ oՠ"2QD}DqR .xLm,r2l*Bס)~Q e(msVC#m:h9+NT ew> dz&7B` Ph!}}X(WJl,EF.|'sO0)W4%Oh;aplus-fsf-4.22/src/html/APlusRefV2_77.html0000444000265000001440000002154210737165260013656 A+ Reference: Index - I

Index - I

i context  -> 
icon  -> 
icon... attributes  -> 
id
        current process id: sys.getpid  -> 
        effective user id of current process: sys.geteuid  -> 
        parent id of current process: sys.getppid  -> 
        real group id of process: sys.getgid  -> 
        real user id of current process: sys.getuid  -> 
idap  -> 
Identity function  -> 
identity scalars for Reduction  -> 
IEEE symmetric rounding rules  -> 
if statement  -> ,   -> 
        syntax of  -> 
if-else statement  -> 
        syntax of  -> 
illegal instruction error message  -> 
immediate execution
        display  -> 
        expression groups  -> 
Import an A+ Array: sys.import  -> 
Import Data (adap)  -> 
import, simplified: sys.imp  -> 
importing data, adap.Import and sys.imp  -> 
in attribute  -> 
        arguments to attribute function  -> 
in-place assignment  -> 
in: converting screen input  -> 
inc attribute  -> 
increment attribute  -> 
incurrentworkspace attribute  -> 
index
        attribute (s)  -> 
        field (t)  -> 
        group  -> 
        of an array  -> 
        origin  -> 
_index system function  -> 
_index_of system function  -> 
Index of (Find function)  -> 
        see also b context
Index of system function  -> 
Indexing (Bracket Indexing function)  -> 
Indexing, Permissive (system function)  -> 
Inf  -> ,   -> 
infinity (constructive)  -> 
infix notation  -> 
informational message  -> ,   -> 
Inner Product operator  -> ,   -> 
inode  -> 
input
        functions
                Comma Fix Input  -> 
                Fix Input  -> 
                Scalar Comma Fix Input  -> 
                Scalar Fix Input  -> 
        Input Mode command  -> 
        Input Mode variable  -> 
        mode, screen
                insertion  -> 
                overwriting  -> 
                replacement  -> 
        screen  -> 
                converting  -> 
inquiry functions  -> 
insert... attributes  -> 
        callbacks for insertabove  -> 
        callbacks for insertbelow  -> 
inserting row in displayed object  -> 
install function (for static link)  -> 
integer  -> 
        type  -> 
interaction with screen display  -> 

interface to SYBASE  -> 
interprocess communication  -> 
        events (adap)  -> 
interrupt A+  ->* ,   -> ,   -> 
interrupt error, adap  -> 
interrupted system call (error message)  -> 
intersection (t tables)  -> 
Interval function  -> ,   -> 
intervals, grouping by (t)  -> 
invalid screen input  -> 
invalidation
        dependency  -> ,   -> 
        itemwise  -> 
inverse trigonometric functions  -> 
invoking A+
        controlling atmp memory mapping by -m  -> 
        environment variables  -> ,   -> 
        from a shell  -> 
        from Emacs  -> ,   -> 
Iota, dyadic (Find function)  -> 
        see also b context
Iota, monadic (Interval function)  -> 
ipc protocol (adap)  -> 
is attribute  -> 
        callbacks for  -> 
is function  -> ,   -> ,   -> 
_issf system function  -> 
item  -> ,   -> ,   -> 
Item Ravel function  -> 
Items of a Mapped File function  -> 
_items system function  -> 
itemwise dependency  -> 
        see also dependency
        invalidation  -> ,   -> 
        non-itemwise invalidation  -> 
        recognition of  -> 
        syntax of  -> 
        total evaluation of  -> 

About the Index

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_78.html0000444000265000001440000000337210737165261013661 A+ Reference: Index - J-K

Index - J-K

jot  -> 
justification of data in tableField  -> 
justify attribute  -> 
K Stack variable  -> 
Kanji font  -> 
Kerberos authentication  -> 
key... attributes  -> 
        callbacks for key attribute  -> 
keyboard
        accelerator mnemonics  -> 
        APL Union  -> 
        focus  -> ,   -> 
                moving  -> 
                object with, s.this  -> 
keys, Alt and meta  -> 
kill
        A+ process  -> 
        sys.kill function  -> 
        to interrupt  -> 

About the Index

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_79.html0000444000265000001440000001714310737165261013663 A+ Reference: Index - L

Index - L

l attribute  -> 
label
        area
                in the action display class  -> 
                in the choice display class  -> 
                in the slot display class  -> 
        display class  -> 
                arguments to attribute functions  -> 
                example of  -> 
label... attributes  -> 
        arguments to label attribute function  -> 
        arguments to labelfg attribute function  -> 
        arguments to labelfont attribute function  -> 
Laminate function  -> 
lamp (for comment)  -> 
Language Level variable  -> 
`language system variable  -> 
layout
        attribute  -> 
        display class  -> ,   -> 
                and the grid display classes  -> 
                arguments to attribute functions  -> 
                modifying an existing layout  -> 
                resizing a layout  -> 
leader attribute  -> 
leader, window  -> 
leading attribute  -> 
leading axis  -> ,   -> 
leading dimension  -> 
left argument  -> 
left arrow
        Assignment function  -> 
        monadic (Result function)  -> 
Left function  -> 
left... attributes  -> 
legend of graph, placement  -> 

legend... attributes  -> 
        legend  -> 
                arguments to  -> 
length  -> 
Length (Shape function)  -> 
Less than function  -> 
Less than or Equal to function  -> 
Lesser of (Min function)  -> 
levels of tracing  -> 
lexical scope  -> 
Lightweight Column Definition function (t)  -> 
line reader (adap)  -> 

line trace style  -> 
line... attributes  -> 
        linecolor  -> 
                arguments to  -> 
        linestyle  -> 
                arguments to  -> 
        linewidth  -> ,   -> 
                arguments to  -> 
linefeed character  -> 
linescatter trace style  -> 
link file  -> 
link, direct static (t)  -> 
link, static, to C or C++ function  -> 
linking tables (t)  -> 
list  -> 
List of All Objects Bound to a Class, s.boundTo  -> 
List of CDE Workspaces function  -> 
Listen (adap)  -> 
listen handle (adap)  -> 
listener attribute (adap)  -> 
listeners, attributes on (adap)  -> 
listing names  -> 
literal attribute  -> 
$load system command  -> 
_load system function  -> 
`loadfile system variable  -> 
loading  -> ,   -> 
        Abort Loading of Script function  -> 
        Load and Remove command  -> 
        Load and Remove function  -> 
        Load command  -> 
        Load function  -> 
        monitoring  -> 
        packfile  -> 
        tracking of  -> 
$loadrm system command  -> 
_loadrm system function  -> 
local time  -> 
        from seconds in epoch  -> 
local variable  -> 
local-write file (mapped file)  -> 
_locals system function  -> 
lock... attributes  -> 
log
        close: sys.closelog  -> 
        message: sys.syslog  -> 
        open: sys.openlog  -> 
Log function  -> 
Log, monadic (Natural log function)  -> 
lower attribute  -> 
lowered, window  -> 
lpr (print file)  -> 

About the Index

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_8.html0000444000265000001440000051441610737165262013601 A+ Reference: Nonscalar Primitive Functions

Nonscalar Primitive Functions


As noted earlier, the term integer indicates here a domain of values and a particular internal representation. The term restricted whole number refers to the same domain of values when both integer and floating-point representations are allowed. The floating-point representations need only be tolerably equal to integers.

Classification of Nonscalar Primitive Functions

Although (except for Beam and Time) they are listed alphabetically in this chapter, for convenient reference, the A+ nonscalar primitive functions can be grouped, among many other ways, in these eight categories:

  • informational functions: Shape, Count, Depth, Type;
  • structural functions: Reshape, Interval, Restructure, Reverse, Rotate, Transpose, Transpose Axes, Ravel, Item Ravel, Enclose, Disclose, Rake, Raze, Partition, Take, Drop, Replicate, Expand, Catenate, Laminate;
  • selection functions: Pick, Choose, Bracket Indexing, Right, Left, Null, Separate Symbols;
  • computational functions: Matrix Inverse, Solve, Deal, Pack, Unpack, Encode, Decode;
  • comparison functions: Match, Member, Find, Bins, Grade up, Grade down, Partition Count;
  • format and representation functions: Format, Default Format, Cast;
  • specificational functions: Assignment, Append, Bracket Indexing Selective Assignment, Replace All, Selective Assignment;  Beam;
  • evaluative, display, and control functions: Execute, Execute in Context, Protected Execute, Value, Value in Context, Result, Signal, Print, Stop;  Time.

Common Error Reports

Multiple errors elicit but one report. If an error report in the following list is issued, then the ones preceding it do not apply. Five reports are common to all nonscalar primitive functions:

  • parse: this error class includes valence errors that result from three or more arguments in braces;
  • value: an argument has no value;
  • nondata: an argument is a function or some other nondata object;
  • wsfull: the workspace is currently not large enough to execute the function in; a bare left arrow (), which dictates resumption of execution, causes the workspace to be enlarged if possible;
  • interrupt (not an error): the user pressed c twice (once if A+ was started from a shell) while holding the Control key down.
Except where noted, inappropriate omission or inclusion of a left argument results not in a valence error report but in the invocation of the function or operator that shares the function symbol.

Function Definitions

Assignment xa and (x)a

   Arguments and Result
The right argument a is any array or function expression (see "Function Expressions"). The left argument is the target of the assignment. x represents a valid user name. The explicit result is equal to a; it is not displayed in an Emacs session, unlike other explicit results, unless it is the result of an expression group.

   Definition
The explicit result is the value a if a is an array, and otherwise a function expression identical to a. The side effect is to assign the value or function expression a to the object x. For a function expression, note that it is the function that is assigned to the target, not the name of the function. See also "Selective Assignment".

The two forms of Assignment are equivalent when used outside function and operator definitions, but have different meanings inside if x is an unqualified name. Inside a function or operator definition, any appearance of xa means that x will be a local variable, while, in the absence of that form, the form (x)a can be used to assign a value to the global variable x, whose context will be the context in which the function was defined.

Assignment, in any form, cannot be the operand of an operator.

   Strand Assignment

Several ordinary assignments can be incorporated into one by means of strand assignment. For example:

     (a;c.b;f;d;d)('ABC';10+3 4;+.;2;5)
Each item of the right argument is disclosed and assigned to the corresponding name on the left. Note that f becomes a function scalar in this example, not a function, and that d ends up with the value 5. After all the individual assignments have been made, the saved values for any dependencies among the targets are marked valid. Strand assignment is important when working with dependencies. See the discussion of commit and cancel for sets of dependencies in "
Cyclic Dependencies". Strands are not permitted as targets of Selective Assignments.

The left argument must appear in strand notation. The right argument, therefore, must be a vector (of the same length as the left argument) or a scalar, but, since it is its value that is used, it can appear in any form, and, since Disclose accepts a simple argument, it can be a simple vector.

This example demonstrates that the righthand side is evaluated right to left and then the assignments are made left to right:

     a1; b2;
     f{s;d;i;p;c;v}:v
     (a;b)(b  `a`b _scb <(f;); a3)
 `a
 `b
Strand Assignment does not trigger a screen update until the interpreter has made the assignments for all the variables involved. This is done in order to avoid problems which could occur when several columns of a displayed table object, including the first, are being updated, with changed lengths.

   Value and Value in Context Assignment

Both Value and Value in Context can be used in targets, viz., (c%x)a and (%x)a, where c and x are any expressions producing simple scalar symbols. The form (k%y)a can also be used; it has the same effect as Strand Assignment, but is more flexible, since the statement does not involve a fixed number of variables with fixed names. The latter form cannot be combined with Selective Assignment in any way. See the Strand Assignment discussion regarding the timing of screen updates.

The context for the object of a Value Assignment is always the current context, so if the Assignment is in a function, the context is the one in which the function was called or the one which the function set before executing the Value Assignment. The use of these functions in assignment is important for working with callback functions; see the "Callback Functions" chapter.

   Assignment of Objects Bound to Display Classes

The assignment primitive xa is affected by display class bindings. If a is bound but x is not, x does not inherit the class of a or any of its attributes. If x is bound then a must be in the domain of the class of x, i.e., it must be possible to bind a to the class of x. This rule applies to Selective Assignment as well.

   Additional Error Report
The following report is issued only if there is no parse or value error (see "Common Error Reports"):

  • an invalid error is reported if x is bound to a display class and the value it is to be given is not valid for objects bound to that display class - see s.VERIFY in the "s-Context Parameters (Global Variables)" table regarding the message that is issued.
   Example
The following illustrates successful and rejected assignments for objects bound to display classes:
     $load s
     a"Spec test"
     `a is `label
     b"any character vector"    A valid label value.
     ab                         Okay.
     b2 3                      An invalid label value.
     ab                         Specification fails.
 : invalid
*     

Bins yx

   Arguments and Result
The left argument is a simple numeric or character array; its items must be in ascending order (no duplicates) for a meaningful result. (Ascending order has the Grade-up meaning: items compared lexicographically, i.e., leading elements in their ravels compared first, without comparison tolerance, and following elements compared only in the case of ties; and alphabetic characters sorted in accordance with their ASCII codes, which are shown in "Graphic Characters for Atomic Vector".) The right argument, x, is of the same general type as y, and its 1+y trailing axes must have length 1y. The result is an array of integers whose shape is defined by the A+ expression (-0(y)-1)x.

   Definition
The idea is to partition x into cells of the same shape as the items of y and then to find where each cell falls among those items. Specifically, partition x in the same way as for Find: viz., into cells of rank 0(y)-1. For each such cell, the result has one element, whose value is the number of items of y which the cell is greater than, in the sense described in the "Arguments and Result" subsection.

For a numeric vector y, each element of the result indicates the subinterval of y into which the corresponding element of x falls, without using comparison tolerance. That is, if i#r is an element of the result r, its value can be determined from the "Bins for Numeric Vectors" table.
Bins for Numeric Vectors
Value of i#rCondition (comparisons without tolerance)
0(i#x)y[0]
j, where 0<j and j<#y y[j-1]<i#x and (i#x)y[j]
#yy[(#y)-1]<i#x

One use for Bins is preparing data for a bar graph.

   Additional Error Reports
Each of the following reports is issued only if there is no parse or value error (see "Common Error Reports") and none of the reports preceding it on this list applies:

  • a type error is reported if an argument is not simple or if the arguments are not of the same general type;
  • a rank error is reported if the rank of x is less than that of the items of y, so the partitioning fails;
  • a length error is reported if the items of y and the cells into which x is partitioned have different shapes.
   Examples
     1 0 1  0.3 0.3 2 .1 1 5
 2 1 0 2 2 3

     v?50001000      sample set of random numbers
 Put in cells; count how many in each cell, showing distribution of the random numbers:
     +/((1001+10)v).=10
 494 480 477 533 506 472 521 512 524 481
 An equivalent but slightly faster way; shows distribution of the set:
     +/(<(1001+10)v)=10
 494 480 477 533 506 472 521 512 524 481

Bracket Indexing x[a;b;...;c]

   Arguments and Result
x is any array, and a, b, ... , c are simple arrays of restricted whole numbers, or absent or the Null. The number of semicolons must be less than the rank of x, or zero. Roughly speaking, the shape of the result is the shape of x with the shapes of a, b, ... , c substituted for the corresponding dimensions.

More precisely: If x is a scalar, the form is x[], and the result is x. Otherwise, the shape of the result is determined as follows. Let Ra be a, Rb be b, etc., except that if the ith one, d, is absent or the Null, let Rd be i#x. If there are k-1 semicolons, the shape of the result is Ra,Rb, ... ,Rc,kx.

   Definition
Bracket Indexing is a way of selecting elements from an array. Semicolons separate indices for different axes. The result has the shape described above. For each axis, a corresponding argument can give an array of indices. For an axis for which no argument or a Null argument is given, the vector 0,1, ... ,n-1 is used, where n is the length of that axis. Elements are selected by taking one index from each index array. The order of selection is determined by running through the index arrays in odometer fashion: all of the rightmost for the first combination of the rest, then all of the rightmost for the second combination of the rest, and so on. Duplicate selections are permitted.

   Additional Error Reports
Each of the following reports is issued only if there is no parse or value error (see "Common Error Reports") and none of the reports preceding it on this list applies:

  • rank: the number of unenclosed semicolons within the brackets is equal to or greater than the rank of x and x is nonscalar, or x is a scalar and there is something (anything) between the brackets;
  • type: a member of the index group (a, b, ... , or c) is not a simple array of restricted whole numbers;
  • maxrank: the rank of the result would be greater than nine;
  • index: a number in the index group is negative or not less than the length of the axis it indexes.
   Examples
     (2 3 4)[1;2;3]
 23
     'adrv'[2 30 0 2 3 0 2]
aar
var
     (5 5 5)[0;2;3]
 0 1 2
 5 6 7
     (5 5 5)[0;2 50 1;0]
 0 5 0 5 0
 5 0 5 0 5
     (`a `b;5 1 9;<{+})[1]
<  5 1 9
     (2 3 4)[0;'';()]
 0 0 4

Cast yx

   Arguments and Result
y is a scalar symbol and x is any simple character or numeric array or the Null.
The result has the type indicated by y. (Since the Null is already an empty symbol vector, if x is the Null then `symx is `null.)
The shape of the result is:
x if x and the result are neither or both symbolic; else
1x if y is `sym; and otherwise
(x),n, where n is the number of characters (excluding `) in the representation of the "longest" symbol in x.

   Definition
The value of y is one of the symbols `char `int `float or `sym (but see the last paragraph of the additional error reports section, below). The result is x with each element converted to the type specified by y.

Any character, integer, floating-point, or simple symbol array can be converted to any of these four types.

In the case of floating point to integer, the elements of x are rounded. For integer to character, 256|x is used. The conversion is based, of course, on the character codes used in the implementation, namely ASCII.

Related functions: Pack and Unpack convert between symbol and character. Format and Default Format convert numbers to characters and employ IEEE rounding; they also convert symbols, and Default Format handles function scalars. Floor and Ceiling round in specific directions to whole numbers and may perform type conversions. Fix Input and its variants and Execute convert characters to numbers. Bitwise Cast leaves the data part of the variable unchanged but changes the type indicator and (usually) shape.

   Additional Error Reports
The following reports are issued only if there is no parse or value error (see "Common Error Reports"), and a type error is reported only if a domain error is not:

  • a domain error is reported if either argument is nested or y is Null or contains more than one element;
  • a type error is reported if the arguments specify an impermissible conversion (but see note below) or y is not a symbol, unless the arguments are suitable for the function Or.

   Examples
     `char97      Return character.
a
     `int3.4 4.5 5.6
 3 5 6
     `sym'abcd'
 `abcd

Catenate y,x

   Arguments and Result
The arguments x and y are any arrays of the same general type, conforming in shape as described here:

  • If x is a scalar then y can be any shape, and the shape of the result is (1+#y),1y. Similarly if y is a scalar.
  • If the rank of x is one less than the rank of y, then the shape of x must equal the shape of the items of y, and the shape of the result is (1+#y),x. Similarly if the rank of y is one less than the rank of x.
  • If the rank of x is equal to the rank of y, then the items of x and y must have the same shape, and so do the items of the result: 1x is equal to 1y and the shape of result is ((#x)+#y),1x.
The result has the same type as:

  • the floating-point argument, if the other one is integer; else
  • the left argument, if neither argument is empty; else
  • the nonempty argument, if exactly one argument is empty; else
  • the right argument.
   Definition
If x and y are the same rank, the items of y and the items of x are joined in the result. That is, item i of y equals item i of the result and item j of x equals item j+#y of the result.

If the arguments differ in rank by one, the argument of lower rank is treated as though it had an additional leading axis of length one. If one argument is a scalar, it is treated as though it had been reshaped to have the shape of the items of the other argument with an additional leading axis of length one.

   Additional Error Reports
Each of the following reports is issued only if there is no parse or value error (see "Common Error Reports") and none of the reports preceding it on this list applies:

  • a type error is reported if the arguments are not of the same general type;
  • a rank error is reported if neither argument is a scalar and their ranks differ by more than 1;
  • a length error is reported if either their ranks are equal and the shapes of their items are not the same or their ranks differ by 1 and the argument of lesser rank is not the same shape as the items of the other.
   Examples
     (2 3),(100+4 3)        Same rank.
   0   1   2
   3   4   5
 100 101 102
 103 104 105
 106 107 108
 109 110 111
     'Treasury ','note'       Same rank.
'Treasury note'

(3),(100+4 3) Ranks differ by 1. 0 1 2 100 101 102 103 104 105 106 107 108 109 110 111

3,2 3 4 A scalar argument is extended to the size of an item 3 3 3 3 3 3 3 3 3 3 3 3 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23

Choose y#x

   Arguments and Result
y is either a simple array of restricted whole numbers, or a nested scalar or vector whose elements are enclosed, simple arrays of restricted whole numbers, or the Null. x is any array. If y is nested then y is less than or equal to x. The result has the same type as x if x is numeric or character, and otherwise the same general type.

   Definition
If x is scalar, y must be the Null, and the result is x. Assume x is nonscalar for the rest of the definition.

If y is simple the result is

     x[y;;...;]
In particular, if y is Null the result equals x. If y is not Null the shape of the result is (y),1x.

If y is nested, the result is

     x[0y;1y;...;(1+#y)y]
If iy is Null then it is treated as if it were (x)[i]. Bracket Indexing treats any omitted trailing axes in a similar fashion, so the result can also be written as
     x[0y;...;(1+#y)y;(x)[#y];...;(x)[1+x]]
If no element of y is Null, the shape of the result is (ҡy),(y)x.

   Additional Error Reports
Each of the following reports is issued only if there is no parse or value error (see "Common Error Reports") and none of the reports preceding it on this list applies:

  • a rank error is reported if (1) the left argument is nested and of length greater than the rank of the right argument, or (2) the right argument is a scalar and the left argument is other than a simple Null;
  • a type error is reported if the left argument (1) is not a simple array or a nested scalar or vector of enclosed, simple arrays, or (2) contains a simple scalar which is not a restricted whole number;
  • a maxrank error is reported if the rank of the result would be greater than nine;
  • an index error is reported if an element of the left argument is not an appropriate index for the corresponding axis of the right argument, i.e., it is negative or equal to or greater than the length of that axis.
   Examples
     2 0 # 3 3'abcdefghi'       Row 2 and row 0.
ghi
abc
     (0;0 2) # 3 3'abcdefghi'   Row 0, columns 0 2.
ac
     (;0) # 3 3'abcdefghi'      All rows, column 0.
adg
     (1;0) # 2 3 4              Plane 1, row 0, all columns.
 12 13 14 15

Count #x

   Argument and Result
The argument is any array. The result is a scalar integer.

   Definition
The result is the number of items of x. If x is a scalar the result is 1, while if x is a nonscalar the result is the length of the leading axis, i.e., (x)[0] (see "Shape").

   Examples
     #5000
 5000
     #168 3 40
 168
     #,12
 1
     #12
 1

Deal y?x

   Arguments and Result
Both x and y are simple one-element numeric arrays of nonnegative restricted whole numbers, with yx. The result is a vector of integers of length y.

   Dependency
The value of the Random Link system variable, `rl, which is changed each time a random integer is chosen.

   Definition
The result is a vector of integers of length y, chosen at random from x without duplication, or, in mathematical terms, without replacement. The result is dependent upon the random link, `rl, which is set when the system command $rl is executed and each time a random integer is chosen.

   Additional Error Reports
Each of the following reports is issued only if there is no parse or value error (see "Common Error Reports"), and a domain error report is issued only if a type error report is not:

  • a type error is reported if an argument is nested or has an element that is not a restricted whole number;
  • a domain error is reported if either argument has a negative element or has more than one element, or if the left argument exceeds the right argument.
   Example
     10?10
 3 1 5 4 2 0 8 6 9 7
     10?10
 7 6 3 8 9 2 4 5 0 1

Decode yx

   Arguments and Result
y is a simple numeric scalar or vector, and x is any simple numeric array. If y has more than one element, then #y must equal #x. The result is a simple numeric array whose shape equals 1x and whose type is integer if the arguments are of type integer and every element of the result can be faithfully represented that way and otherwise floating point.

   Definition
If x and y are vectors with the same number of elements, the result is the evaluation of x in the number base system with radices y[0],y[1], ... , y[1+#y]. If y has one element it is treated as if it were (#x)y. If x is a matrix, each element i#r of the result r is the evaluation of the column x[;i] in the number base system represented by y. More generally, if x has rank greater than 2, each element of the result is the evaluation of the corresponding vector along the first axis of x, in the number system represented by y.

   Additional Error Reports
Each of the following reports is issued only if there is no parse or value error (see "Common Error Reports") and none of the reports preceding it on this list applies:

  • a type error is reported if either argument is not a simple numeric array;
  • a rank error is reported if the left argument is not a scalar or vector;
  • a length error is reported if #y is not equal to either 1 or #x.
   Examples
      Convert 2 hours, 5 minutes, and 59 seconds to seconds.
     24 60 602 5 59
 7559
      Present value (price) from interest rate and cash flows.
     cf0 100 100 100 100 1000
     7.2 pv  (1+i)  cf  i.05
1138.12
      Present value at various interest rates.
     8.2 pv  (1.03+.015) @0 1 cf
 1234.32 1184.92 1138.12 1093.77 1051.71

Default Format x

   Argument and Result
x is a simple numeric or a simple character array, a simple symbol scalar, a function scalar, or a simple symbol array. The result is a simple character array of rank less than or equal to 2.

   Dependency
For numeric x, the value of Printing Precision, `pp.

   Definition
If x is numeric or character, the result is an array containing x in default format. That is, if the expression x is entered in an A+ session, a display of the value of x appears; this primitive function captures that display in its result. In particular, if x is a character array of rank less than or equal to 2, the result equals x. If x is numeric, the number of digits shown and the format (fixed or exponential) used are dependent on the printing precision system variable `pp. A nonscalar symbol array displays the symbols as described in the next paragraph, and for arrays of rank 2 or greater, are padded with blanks on the right to match the length of the longest (unpadded) symbol involved.

If x is a scalar symbol, the result is a character vector, giving the display of that symbol, with a blank preceding the backquote.

When x is a function scalar, the result is a character vector. If x is primitive, the result is its symbol. If x is a defined function, the result is its definition. If the definition has more than one line, the lines are separated by newlines in the result. If the function is derived (e.g., ɡ), then the result is the string *derived*. (Note that Default Format shows that expressions such as +. are not derived functions strictly speaking.)

   Additional Error Reports
If there is no parse or value error (see "Common Error Reports"),

  • a rank error is reported if the argument is enclosed (nested or function scalar) and is not a scalar; and otherwise
  • a type error is reported if the argument is not a simple character or numeric array, a simple symbol scalar, or a function scalar.
   Examples
     _gsv `pp
 10
      The Printing Precision is now 10. Digits after an e don't count. If there would
      be too many digits in ordinary notation, e-notation is used in a display.
     '(',(1),')',12345.678912e24 1234567891 12345678912
( 3.141592654) 1.234567891e+28 1234567891 1.234567891e+10
      A function definition, to be shown by Default Format.
     cube x:x*3
     'cube fn  ',<{cube}
cube fn  cube x:x*3
      Indentation of first line of definition is always ignored by Default Format.

Depth x

   Argument and Result
The argument is any array; if it is a function expression it must be in braces. The result is a scalar integer.

   Definition
The result is the maximum depth of nesting in the argument. All simple arrays (and so all empty arrays) are depth 0, except for function expressions, whose depth is -1. (The Enclose of a function expression, which is called a function scalar, is simple and depth 0.) The depth of a nested scalar is 1 plus the depth of the disclosed scalar (see Disclose, below). The depth of a nonscalar nested array is the greatest of the depths of its elements.

   Examples
     'abc'
 0
     {+}            The parser needs the braces as a hint
 1                  when two functions are juxtaposed.
     (2;3;<(4;5))   Three enclosings: strand, Enclose, strand.
 3

Disclose >x

   Argument and Result
The argument x is a simple array, a nested scalar, or a uniform nested array (see Definition, Case 3, for the meaning of uniform). Letting s and t be the shape and type of the first element of x with that element's top level of nesting (if any) removed, the shape of the result is (x),s and its type is floating point if some element of x is a nonempty floating-point array after its top level of nesting (if any) is removed, else its type is t.

   Definition
Case 1. Simple Array x

If x is a simple array, perhaps a simple scalar, then the result is x. Note that function scalars are simple arrays; to turn a function scalar fnsc into the corresponding function you can use fnsc or %_name{fnsc}.

Case 2. Nested Scalar x

If x is a nested scalar, then its depth is at least one. The result is x with the top level of nesting removed, and it may or may not be a scalar.

Case 3. Nested Vector x

The elements of x must all be nested - i.e., each element of x must have a depth of at least one (remember that function scalars have depth zero) -, and the Discloses of all these elements must have the same shape and the same general type. Arrays with this property are called uniform in this definition.

Disclose of a nested vector x is defined in terms of Disclose of a nested scalar, as follows. The array >x has depth one less than the depth of x. The number of items of >x equals the number of elements of x, i.e., #x. For each index i of x, the ith item of >x equals the Disclose of the nested scalar i#x, i.e., >i#x.

Case 4. Nested Array x

Disclose of a nested array x is defined in terms of Disclose of a nested vector, as follows. As in the vector case, x must be uniform. Let s denote the common shape of all the Discloses of the scalar elements of x. Then >x is ((x),s)>,x. That is, ravel x, apply Disclose to this vector, and reshape the disclosed vector to have x's shape for its leading axes and the shape of a disclosed element for its trailing axes.

   Additional Error Reports
Each of the following reports is issued only if there is no parse or value error (see "Common Error Reports") and none of the reports preceding it on this list applies:

  • a maxrank error is reported if the result would have more than nine dimensions;
  • a domain error is reported if x contains both nested and nonnested elements other than symbols and function scalars;
  • a rank error is reported if the Discloses of the elements of x have different ranks;
  • a mismatch error is reported if the Discloses of the elements of x have different shapes;
  • a type error is reported if the Discloses of the elements of x have different general types.
   Example
     >(3;103)
 0  1  2
 0 10 20

Drop yx

   Arguments and Result
The argument y is a simple one-element array whose value is a restricted whole number, and x is any array. The shape of the result equals the shape of the right argument x along all but the first axis, while the length of the first axis is the larger of #x minus the absolute value of y and 0, i.e., 0(#x)-|y.

   Definition
The result is x without its first y items if y is nonnegative, or its last -y items if y is negative. If |y is greater than #x then the number of items in the result is 0.

   Additional Error Reports
Each of the following reports is issued only if there is no parse or value error (see "Common Error Reports"), and nonce only if there is no type error:

  • a type error is reported if the left argument is not simple or has an element that is not a restricted whole number;
  • a nonce error is reported if the left argument has more than one element.
   Examples
     35 2
 6 7
 8 9
 4'15 January'
15 Jan

Enclose <x

   Argument and Result
The argument is any array; if it is a function expression, it must be enclosed in braces, to aid the parser. The result is a nested scalar unless the argument is a function expression, in which case it is a simple scalar.

   Definition
The result is a scalar that contains the argument x. The depth of the result is the depth of the argument plus one. If f is a function expression, <{f} is a function scalar. Note that strand notation is equivalent to the concatenation of the Enclose of each of its components.

   Examples
     2<3
<  0 1 2
<  0 1 2
           Functional notation required for + .
     (`sym),{+},('abc'),(2 3 4),(5.5),()
 0 1 0 0 0 0
           Strand encloses each element.
     @0(`sym;+;'abc';2 3 4;5.5;)
 1 0 1 1 1 1
           Depths increased by Enclose.
     @0(<`sym;<{+};<'abc';<2 3 4;<5.5;<())
 2 1 2 2 2 2

Encode yx

   Arguments and Result
y is a simple numeric vector or scalar and x is any simple numeric array. The result has shape (y),x.

   Definition
For positive elements of x, the result is the representation of that element, as far as is possible, in the number base system with radices y[0],y[1], ... ,y[1+#y]. That is, yx contains the #y low-order "digits" of its representation in this number base for each positive element of x. For a negative element n, the result is the representation, in the same way, of (/y)|n. No matter what the signs of the elements of x are, yyx equals (/y)|x. Thus Decode is the left inverse of Encode for any element p for which (/y)|p is equal to p.

   Additional Error Reports
The following reports are issued only if there is no parse or value error (see "Common Error Reports"), and a rank error report is issued only if a type error report is not:

  • a type error is reported if either argument is not a simple numeric array;
  • a rank error is reported if the left argument is not a vector or scalar.
   Examples
     24 60 60  7559
 2 5 59
     100  12345
 45

Execute x

   Argument and Result
x is a character vector or scalar. The result is the explicit result of the A+ expression in x, except that it is the Null when the last function executed in x is a Specification (ordinary or selective), and when the argument is a system command or a definition of a function, operator, or dependency.

   Definition
This function evaluates x as an A+ expression. It cannot be used to establish the target of an Assignment. See also "Execute in Context or Protected Execute", "Value", and "Value in Context". It can be used to execute a system command. It can be traced by $dbg xeq.

   Additional Error Reports
Each of the following reports is issued only if there is no parse or value error (see "Common Error Reports") and none of the reports preceding it on this list applies:

  • a type error is reported if the argument is not simple or is not of character type;
  • a rank error is reported if the rank of the argument exceeds 1;
  • any error from the execution of the argument is reported (and execution is suspended); entering produces a domain error for Execute and a second suspension. See example.
   Examples
     100'1 1.23 4.567'
 100 123 456.7
     'a14 23 34'
           Result is Null. ('a')14 23 34 not allowed.
     a
 14 23 34
     "(10)0"
[error] : maxrank
*     
[error] : domain

Execute in Context or Protected Execute yx

   Arguments and Result
y is a symbol or an integer or Null and x is a character vector or scalar. The result is the explicit result of the A+ expression in x under circumstances controlled by y, except that it is null when the last function executed is any Specification, and when x is a system command or a definition of a function, operator, or dependency.

   Definition
If y is a symbol, then this function is Execute in Context and evaluates x as an A+ expression in the context y. If c is the context when the function is invoked, it is equivalent to {_cx y;x;_cx c}, except that the explicit result is that of x rather than _cx c. Note: an unqualified name z in x remains unqualified; it is not treated as a qualified name; x is just executed in the context y. In particular, the name of a local variable z in x remains unqualified. See "Execute", "Value", and "Value in Context".

Execute in Context is useful when one wants to create multiple instances of a dependency or dependencies, distinguished by contexts. You can create a dependency by, for instance,

     `cxt'a:b+c'
and if you have a list c of contexts, then, for example,
     c<'a:b+c'
creates a whole set of dependencies in different contexts.

If the left argument is an integer or Null, the function is Protected Execute, in the current context (cf. "Do - Monadic (Protected Execution)"). If the execution fails, the result is the error code, as listed in the table "Error codes for Protected Execution", as a simple integer. There is no suspension - i.e., execution proceeds as if no error has occurred. (Actually, there are a few cases, such as an attempt to give a bound variable an impermissible value, that do result in a suspension, with a stop error message.)

If the execution is successful, the result is Enclose applied to the result of Execute for x, viz., <x. Enclose is used to enable you to distinguish between the two cases.

If the Protected Execute Flag, `Gf, is 0, however, a suspension will occur if Protected Execute encounters an error in its right argument; entering clears the suspension and produces the error code as the result. (This behavior is different from that of an ordinary Execute: clearing a suspension in the execution of its argument causes a second suspension, on the Execute itself, and clearing that yields a null result.) See `Gf and $Gf. It can be traced by $dbg xeq.

Messages that are not strictly A+ error messages will still appear in the log, e.g.
filename: No such file or directory
not an `a object
and many Adap messages.

The treatment of input errors while stopped in protected execution is described under monadic do.

Warning!  Within a Protected Execute - as in a protected do - Result exits from Protected Execute only, with a 0 return code and the Result argument as result;  it does not exit from the function containing the Protected Execute.

   Additional Error Reports
Each of the following reports is issued only if there is no parse or value error (see "Common Error Reports") and none of the reports preceding it on this list applies:

  • a type error is reported if the left argument is not a simple symbol or integer or Null, or if the right argument is not a simple character array;
  • a rank error is reported if the rank of the right argument exceeds one;
  • if the left argument is a symbol or if the protected execute flag, `Gf, is zero, any error from the execution of the argument is reported (and execution is suspended).
   Example
     try.x3
     'x10'        try.x has a value, but x does not.
 .x: value
*      
 : domain          Error gets passed on to Execute.
*      
     0'x10'       Protected execute (`Gf is 1).
 4                  Numeric code for the value error.
     `try'x10'    Execute in Context okay; uses try.x.
 0 0.1 0.2
                    Protected execute using the var that has a value:
     0'try.x10'
<  0 0.1 0.2        Success shown by an enclosed result.

Expand y\x

   Arguments and Result
y is a simple scalar or vector of restricted whole numbers whose elements are all 0 or 1, and x is any array.

   Definition
The number of ones in y equals the number of items in x, i.e., +/y equals #x, or x is a scalar. If the ith item of y is 1, then the ith item of the result is the (+/(i+1)y)th item of x, or x if it is a scalar. If the ith item of y is 0, then the ith item of the result is composed entirely of fill scalars. The table "Fill Elements" shows the fill scalars.

   Additional Error Reports
Each of the following reports is issued only if none of the reports preceding it on this list applies and there is no parse or value error (see "Common Error Reports") - except that token precedes value:

  • a token error (like a parse error) is reported if there is a primitive function or operator symbol to the immediate left of \ that is not one of +^;
and, unless there is one of +^ to the immediate left of \ (that is, unless you are thrown into Scan, a monadic operator):

  • a valence error is reported if there is no argument to the immediate left of \;
  • a type error is reported if the left argument is nested or does not consist of restricted whole numbers;
  • a domain error is reported if any element of the left argument is not 0 or 1;
  • a rank error is reported if the left argument is not a scalar or vector;
  • a length error is reported if the number of ones in the left argument is unequal to the number of items in the right argument, unless the right argument is a one-element array.
   Examples
     1 0 1 1\3 4
  0  1  2  3
  0  0  0  0
  4  5  6  7
  8  9 10 11
     1 0 1\'a'
a a

Find yx

   Arguments and Result
The arguments are any arrays (including scalars) of the same general type. The rank of the items of y must not exceed the rank of x, and the 1+y trailing axes of x must have length 1y. The result is an array of integers whose shape is defined by the A+ expression (-0(y)-1)x - i.e., the shape of x with the last s dimensions omitted, where s is the rank of the items of y.

   Dependency
Comparison tolerance, if an argument is in floating point.

   Definition
Partition x into cells of rank 0(y)-1. The result has one element for each such cell. The value of that element is the index of the first item of y to which the cell is identical - in the sense of Match, i.e., at all levels the cell and the item are the same shape and type (except that integer and floating point match here) and all their simple scalar components, at whatever level, are tolerably equal. If the cell is not found among the items of y, the resulting element is #y. A scalar y is treated as a one-element vector.

   Additional Error Reports
Each of the following reports is issued only if there is no parse or value error (see "Common Error Reports") and none of the reports preceding it on this list applies:

  • a type error is reported if the arguments are not of the same general type;
  • a rank error is reported if the rank of x is less than that of the items of y, so the partitioning fails;
  • a length error is reported if the items of y and the cells into which x is partitioned have different shapes.
   Examples
     (4 3'fatbatcathat')(2 3'catpat')
 2 4
     (+;-;;)<{}
 2    Strand makes function expression a function scalar.

Format yx

   Arguments and Result
y is a simple numeric scalar or vector, and x is a simple numeric or symbol array. If #y is greater than 1 then it must equal 1x - i.e., #x if x is a vector, and the number of columns if the rank of x is greater than 1. The result is a simple character array of rank less than or equal to 2.

   Definition
The result is an array containing x in formatted form, with the format controlled by y. Negative numbers are formatted with an ordinary minus sign (-). Elements of y specify the appearance of certain elements in x:

  • if #y equals 1, then the element of y applies to all elements of x;

  • if #y is greater than 1, then element i#y applies to element i#x if x is a vector, to column x[;i] if x is a matrix, and to columns x[...;i] otherwise.
The format of every element of x is controlled by an element of y, which is of the form [-]width[.digits], where the digits specification is expected to be a single digit and any digits following it are ignored. The total number of characters in the format is width. If digits is present, it specifies the number of digits to appear to the right of the decimal point; if it is 0 or absent, the element is shown as an integer. If the minus sign is present, the format is in exponential format (e-notation).

   Understanding how rounding works

Because Format is often used as a means of rounding numbers to some desired precision —and because that rounding often creates questions about the accuracy of the rounding— this seems to be a good place to discuss how rounding works, and why it is that we sometimes see some unexpected results.

There is nothing within A+ that imposes any special rules on the rounding of numbers. Rounding is done entirely using IEEE symmetric rounding rules. That is, if a number lies halfway between two other numbers to which it can legitimately be equally rounded either way, it is rounded to the one ending in an even digit. Therefore, a value of 22.5, for instance, could logically be rounded to either 22 or 23; the IEEE rules tell us that it should be rounded to 22, because that is the number which ends with an even digit. As further examples, if we are starting with values which are exactly halfway between two integers, and rounding them to integers:

  • 0.5 should round down to an integer value of 0 (not to 1, because 1 is an odd number);
  • 1.5 should round up to an even integer value of 2;
  • 2.5 should round down to an even integer value of 2;
  • 3.5 should round up to an even integer value of 4; and
  • 4.5 should round down to an even integer value of 4.

In A+ terms, this would be shown as follows:


     4.5 1.5 2.5 3.5 4.5     This example shows IEEE rounding.
   0   2   2   4   4

In actual practice, however, machine approximation of decimal numbers and machine rounding may obscure the regular IEEE rules.

For example, given the following vector:


     v1.055 1.155 1.255 1.355 1.455 1.555 1.655 1.755 1.855 1.955
IEEE rules dictate that rounding it to two decimal positions should cause the "n.n55" values to round to "n.n6" (and if we had "n.n45" values, they should round to "n.n4"). However, that's not necessarily what happens. Let's explore what happens, and why.

      Original      
Value
IEEE
    Rounding    
6.2v
    Rounding    
Actual Internal
Value
1.0551.061.05    1.05499999999999994...    
1.1551.161.161.15500000000000003...
1.2551.261.251.25499999999999989...
1.3551.361.351.35499999999999998...
1.4551.461.461.45500000000000007...
1.5551.561.551.55499999999999994...
1.6551.661.661.65500000000000003...
1.7551.761.751.75499999999999989...
1.8551.861.851.85499999999999998...
1.9551.961.961.95500000000000007...

Notice that using 6.2v will round the values in v to two decimal places... but it doesn't necessarily give us what we expect from the IEEE rounding rules. Some of the results look okay, but realize that the internal values are imprecise for all of our values, and some of them just happen to round the way that we want them to.)

The reason for this is that we are doing decimal operations on a hexadecimal machine, so there will always be some errors in the internal representation of many of the numbers that we deal with every day. It is simply not possible to represent these values exactly on a digital machine.

In the same way that we simply cannot represent exactly one-third as a decimal number, we also cannot represent many other decimal numbers in hexadecimal and be able to convert them back to exactly the number that we started with. Therefore, a value of "1.055" actually gets represented within the machine as "1.05499999999999994...", so that value is correctly rounded down to "1.05", while a value of "1.155" is actually seen by the machine as "1.15500000000000003...", so that value is correctly rounded up to "1.16". Although the first value is rounded to "1.05" instead of the desired IEEE rounding value of "1.06", realize that the rounding is correct based upon the internal value that is seen by the hardware. These internal values are incorrect, but they are as close an approximation of the exact values as we can get on this hardware.

So why don't we see this imprecision at every step of our calculations? ...Simply because the printing precision normally masks this error, and over the course of normal work, these errors tend to cancel out.

Before you get too concerned about this imprecision, realize that the Comparison Tolerance in A+ (the amount by which two values may differ and still be considered to be equal) is set to 1e-13 (or 0.0000000000001); that is a tolerance of one part (of error) in ten trillion. To put this into perspective, if our measurements were to represent distance, a measurement of 250,000 miles (approximately the distance from the earth to the moon) could be carried out within an error of no more than one-third of the thickness of a piece of copier paper. For most operations, this is deemed to be "close enough."

Also realize that rounding of values through the use of the Format function is typically done just for display of final output (where 16 digits of precision would be inappropriate anyway). Calculations prior to that final rounding step are done at full precision.

Finally, we just want to emphasize again that none of the rounding that you see through A+ is any different than it would be in other environments. A point that may make it seem different is the ease with which you can adjust the precision and look at alternate views of the same values. This is a general hardware numeric conversion issue, not an A+ issue.

   Creating the left argument to Format:

When a number has been formatted in the specified form the result is fitted in the specified width in one of two ways:

  • exponential format: the result for a positive number is padded on the left with two blanks and for a negative with one, and this padded result is left justified within the width, after being truncated on the right if it is too long;

  • otherwise: the result is right justified within the width, after being truncated on the right if it is too long.
Because these rules effectively handle inconsistent left arguments like 6.6, no error message is given for them. It is up to you to see that the widths you specify are sufficient, allowing for the padding in exponential format and for any blanks you want between adjacent numbers not in exponential format.

If the right argument consists of symbols, they are formatted in their displayed form with backquotes removed. Each of them is right justified in the specified width, after being truncated if it is too long. Any digits or exponential-format specification is ignored.

   Additional Error Reports
The following reports are issued only if there is no parse or value error (see "Common Error Reports"), and a length error is reported only if a type error is not:

  • a type error is reported if the left argument is not simple and numeric, or if the right argument is not simple and either numeric or symbol;
  • a length error is reported if the number of elements in the left argument is neither 1 nor equal to 1x.
   Examples

     2 10.4 12.22 31 3.14159 123456 2 123.7 55
 1   -3.1416  1.23e+05
 2  123.7000 -5.50e+01

     4.5 1.5 2.5 3.5 4.5    This example shows IEEE rounding.
   0   2   2   4   4

     16.121.123456789012    16.12 on the left is equivalent to
             1.1             16.1: the 2 is ignored.

     _gsv `pp
 10                          Printing Precision is 10

     12345.678912            See that ordinary display obeys Printing Precision:
 12345.67891                 5 digits before the decimal point, so 5 (10-5) digits after.

     14.7  12345.678912
 12345.6789120               Format ignores Printing Precision and obeys the left argument.

Grade down x

   Argument and Result
The argument x is either a simple numeric array or a simple character array or a simple symbol array. The result is a vector of integers of length #x, i.e., of length equal to the number of items in x.

   Definition
The result r is a permutation of the vector #x such that the items of r#x are in nonascending, lexicographic order. To determine whether or not one item is greater than or equal to another in the lexicographic sense, leading elements in their ravels are compared first, and only in the case of ties are the elements that follow compared. Alphabetic characters are sorted in accordance with their ASCII codes, which are shown in "Graphic Characters for Atomic Vector". The indices of equal items are in ascending order in r. That is, if i is less than j and r[i]#x is identical to r[j]#x, then r[i] is less than r[j]. Comparison tolerance is not used. If x is a symbol array, the result is the same as it would be for x.

   Additional Error Reports
Each of the following reports is issued only if there is no parse or value error (see "Common Error Reports"), and a type error is reported only if a valence error is not:

  • a valence error is reported if there is a left argument;
  • a type error is reported if the argument is not a simple numeric or character array.
   Examples
      10.2 6 999 0 6
 2 0 1 4 3
     (a)#a`apl `a `apple
apple
apl
a

Grade up x

   Argument and Result
The argument x is either a simple numeric array or a simple character array or a simple symbol array. The result is a vector of integers of length #x, i.e., of length equal to the number of items in x.

   Definition
The result r is a permutation of the vector #x such that the items of r#x are in nondescending, lexicographic order. To determine whether or not one item is less than or equal to another in the lexicographic sense, leading elements in their ravels are compared first, and only in the case of ties are the elements that follow compared. Alphabetic characters are sorted in accordance with their ASCII codes, which are shown in "Graphic Characters for Atomic Vector". The indices of equal items are in ascending order in r. That is, if i is less than j and r[i]#x is identical to r[j]#x, then r[i] is less than r[j]. Comparison tolerance is not used. If x is a symbol array, the result is the same as it would be for x.

   Additional Error Report
The following report is issued only if there is no parse or value error (see "Common Error Reports"):

  • a type error is reported if the argument is not a simple numeric or character array.
   Examples
      10.2 6 999 0 6
 3 1 4 0 2
     (a)#a`apl `a `apple
a
apl
apple

Interval x

   Argument and Result
The argument is a simple scalar or vector of nonnegative restricted whole numbers. The result is an array of integers whose shape is x if x is a vector, or ,x if x is a scalar.

   Definition
If the argument x is a scalar or one-element vector, the result is the vector of integers from 0 to x-1. If the argument x is a vector with 2 or more elements, the result is the vector of integers from 0 to (/x)-1, reshaped to shape x: viz., xɫ/x (see "Reshape").

   Additional Error Reports
Each of the following reports is issued only if there is no parse or value error (see "Common Error Reports") and none of the reports preceding it on this list applies:

  • a type error is reported if the argument is not simple or an element of it is not a restricted whole number;
  • a rank error is reported if the argument is not a scalar or a vector;
  • a domain error is reported if the argument has a negative element;
  • a maxrank error is reported if the argument has more than nine elements.
   Examples
     5
 0 1 2 3 4
     2 3
 0 1 2
 3 4 5

Item Ravel !x

   Argument and Result
The argument x is any array of rank at least 2. The result has shape (/2x),2x and the same type as the argument.

   Definition
The result is ((/2x),2x)x, i.e., the ravel of the first two axes of x becomes the first axis of the result.

   Additional Error Report
The following report is issued only if there is no parse or value error (see "Common Error Reports"):

  • a rank error is reported if the argument is a scalar or vector.
   Example
     !2 2 4
  0  1  2  3
  4  5  6  7
  8  9 10 11
 12 13 14 15

Laminate y~x

   Arguments and Result
Either x and y have equal shapes, or one is a scalar. They also must have the same general type. If x is nonscalar, the shape of the result is 2,x; otherwise, the shape of the result is 2,y.

   Definition
The result r always has two items. If x and y have equal shapes then item r[0] equals y and item r[1] equals x. If x is nonscalar and y is a scalar then item r[0] equals (x)y and item r[1] equals x. If x is scalar and y is a nonscalar then item r[0] equals y and item r[1] equals (y)x.

The result has the same type as:

  • the floating-point argument, if the other one is integer; else
  • the left argument, if neither argument is empty; else
  • the nonempty argument, if exactly one argument is empty; else
  • the right argument.
   Additional Error Reports
Each of the following reports is issued only if there is no parse or value error (see "Common Error Reports") and none of the reports preceding it on this list applies:

  • a type error is reported if the arguments are not of the same general type;
  • a rank error is reported if neither argument is a scalar and their ranks differ;
  • a length error is reported if neither argument is a scalar and their shapes differ;
  • a maxrank error is reported if the rank of either argument is 9.
   Example
     1 2 3~10 20 30
  1  2  3
 10 20 30

Left yx

   Arguments and Result
y and x are any arrays. The result is the same shape and type as y.

   Definition
The result is identical to the left argument. Left can be used to execute two expressions when you would only discard the explicit result of the first one anyway.

   Examples
     2 3'abc'
 2 3
 Evaluate a dependency to keep its last value, then remove its definition:
     _undef{`x}  %`x
     a[a]  a0 2 4 5 1 3 7 6
 0 1 2 3 4 5 6 7
     ((aa)=a)/a  a'keep only the unique characters'
keponlythuiqcars

Match yx

   Arguments and Result
The arguments can be any arrays, including function arrays. The result is an integer, either 1 or 0.

   Dependency
Comparison tolerance, if an argument is in floating point.

   Definition
The result is 1 if at all levels y and x are the same shape and type (except that integer and floating point match here), and all their simple scalar components, at whatever level, are tolerably equal. The result is 0 otherwise.

   Examples
     'abc''a','b','c'
 1
     ''0
 0
     (2 4)'no match'
 0               Unlike Equal to, never an error; always 0 or 1.

Matrix Inverse x

   Argument and Result
x is a simple numeric array of rank less than or equal to 2 - if 2, then at least as many rows as columns. The result has shape x.

   Definition
If x is a nonsingular matrix with the same number of rows as columns, then the result is its matrix inverse. If x is a matrix with more rows than columns, and if the columns are linearly independent, the result is the unique left matrix inverse of x. That is, (x)+.x equals an identity matrix, but x+.x may not. If x is a vector the result is ,((x),1)x. If x is a scalar the result is x.

   Additional Error Reports
The following reports are issued only if there is no parse or value error (see "Common Error Reports"):

  • a rank error is reported if the rank of the argument exceeds 2;
  • a domain error is reported if (1) the argument is not a simple numeric array, (2) the argument is a matrix with more columns than rows, or (3) the argument is singular or very ill-conditioned.
   Example
      2 2 1 2 3 4
 2    1
  1.5 0.5

Member yx

   Arguments and Result
The arguments are any arrays of the same general type. The rank of the items of x must not exceed the rank of y, and the trailing 1+x trailing axes of y must have length 1x. The result is an array of integers whose shape is defined by the A+ expression (-0(x)-1)y.

   Dependency
Comparison tolerance, if an argument is in floating point.

   Definition
Partition y into cells of rank 0(x)-1. The result has one element for each such cell. The value of that element is 1 if at all levels the cell and at least one of the items of x are the same shape and type (except that integer and floating point match here) and all their simple scalar components, at whatever level, are tolerably equal - i.e., if Match yields 1 for the cell and some item of x. The result is 0 otherwise.

   Additional Error Reports
Each of the following reports is issued only if there is no parse or value error (see "Common Error Reports") and none of the reports preceding it on this list applies:

  • a type error is reported if the arguments are not of the same general type;
  • a rank error is reported if the rank of y is less than that of the items of x, so the partitioning fails;
  • a length error is reported if the items of x and the cells into which y is partitioned have different shapes.
   Examples
     (123+1e-10 1e-11)123,1950+50
 0 1
     1992 1991 1870 1992 2001123,1950+50
 1 1 0 1 0
     (2 3'catpat')(4 3'fatbatcathat')
 1 0

Null x

   Argument and Result
x is any array.

   Definition
The result is Null, i.e., (), the empty symbol vector, whose type is `null.

   Examples
     'junk'
     ()9 10
 1

Pack x

   Argument and Result
x is a simple character array. The result is an array of symbols with shape 1x.

   Definition
If i#r is an element of the result r then i#x is a character vector along the last axis of x. Item i#r is the symbol that, when displayed, looks exactly like the character vector i#x except for the leading `. Trailing blanks in i#x are ignored, but included blanks are allowed. The null character, `char0, is used by the interpreter to delimit symbols, so never try to include it in a symbol: it will exclude any characters following it from the symbol.

   Additional Error Report
The following report is issued only if there is no parse or value error (see "Common Error Reports"):

  • a type error is reported if the argument is not a simple character array.
   Example
     2 3'a  abc'
 `a `abc

Partition yx

   Arguments and Result
y is a simple array of restricted whole numbers, and x is any array. The result is a nested vector whose length is (#x)y if y consists of one element and that element is not zero, and otherwise a nested array of the same shape as y.

   Definition
The elements of y are nonnegative. If y has one element and that element is not zero, then the first element of the result is Enclose of the first y items of x, the second element is Enclose of the next y items of x, and so on, until there are fewer than y items of x remaining. If there are no remaining elements, then the result is complete, and otherwise the last element of the result is Enclose of the remaining items of x.

If y has more than one element or is 0, then the result has the same shape as y, and the first element of the ravel of the result is Enclose of the first (,y)[0] items of x, the second element is Enclose of the next (,y)[1] items of x, and so on until y is exhausted. If for some element of the result there are fewer items remaining in x than y specifies for that element, then those remaining items of x are enclosed to form that element, and any remaining elements of the result are empty. On the other hand, not all items of x need appear in the result.

   Additional Error Reports
The following reports are issued only if there is no parse or value error (see "Common Error Reports"), and a domain error is reported only if a type error is not:

  • a type error is reported if the left argument is nested or does not consist of restricted whole numbers;
  • a domain error is reported if the left argument contains a negative number.
   Examples
     3 2 2 16 3
<  0 1 2
   3 4 5
   6 7 8
<   9 10 11
   12 13 14
<  15 16 17
<
     35
<  0 1 2
<  3 4
     (' '=x)x' this is'      See Partition Count.
<  this
<  is

Partition Count x

   Argument and Result
x is a simple vector or scalar of restricted whole numbers. The result is a numeric vector of integers.

   Definition
In general, x is a vector or scalar of restricted whole numbers, but in the usual case it is a vector composed of zeros and ones. All nonzero numbers are treated alike, and the description assumes ones for simplicity.

The first element of x must be 1. The length of the result is the number of ones in x, i.e., +/x, and each element of the result corresponds to a 1 in x. The value of an element is the length of the subvector consisting of the 1 it corresponds to and all the zeros preceding the next 1. Put another way, the elements of the result are the lengths of the contiguous sequences of zeros starting at each 1 in x, plus 1.

   Additional Error Reports
Each of the following reports is issued only if there is no parse or value error (see "Common Error Reports"), and none of the reports preceding it on this list applies:

  • a type error is reported if the argument is nested or does not consist of restricted whole numbers;
  • a rank error is reported if the argument is not a scalar or vector;
  • a domain error is reported if the argument begins with a zero.
   Examples
     1 0 0 0 1 0
 4 2
     1 0 0 0 1 1 0 1
 4 1 2 1

Pick yx

   Arguments and Result
The left argument y is the Null, or a simple scalar or vector of integers or symbols, or a nested scalar or vector whose items are simple scalars or vectors of integers. The right argument x is any array.

   Definition
All permitted combinations of arguments are considered by turns.

Any valid right argument and empty left argument (0 or the Null)

An empty vector y picks all of x. (Warning! A possible point of confusion: although Pick acts like Choose and Bracket Indexing for the Null, selecting all, for 0 it differs from those two functions, picking all whereas they select none.)

Scalar right argument

The result is the same as if the right argument were a one-element vector; if the left argument is not empty, it must be 0.

Slotfiller right argument and simple symbol left argument

A symbol is used to pick from a slotfiller, an array of the form (s;v), where s is a scalar or vector of symbols and v is any nested scalar or vector of the same length as s (see "Subtypes and Supertypes"). If y has one element and is identical to the ith element of s, i.e., i#s, (and not to any previous element - Pick does not check that the elements of s are distinct) then y(s;v) is defined and equals >i#v. If x is a slotfiller composed of a pair of scalars, (`sym;<array) for example, and y equals 0x, then yx is defined and equals >1x.

If x is a nested slotfiller and y a simple vector of symbols (a path vector), the result is y[1+#y]...y[1]y[0]x where the scalar Picks are as just defined. Note that the order of the elements in the left argument corresponds to the depth of the selection from the right argument: element 0 in the left argument refers to the top level, element 1 refers to the second level, and so on.

Simple right argument and simple numeric left argument of length 1

A simple array can be picked from only when y is 0 or Null or a scalar or one-element vector. That is, there must be only one step to the Pick, and either a single item or all of x must be picked. An empty vector picks all of x, as stated above, and for a scalar or one-element vector and a simple right argument, Pick is the same as Choose:

     yx  y#x.
If y is a scalar or one-element vector, then the rank of x must not exceed 1. For example,
  ()1    1
  ()1 2   (0)1 2 1 2
  11 2 3 2
  02 3
is a rank error.

Nested vector right argument and simple left argument

If y has a single element, x is a vector and the result is the Disclose of the (scalar) yth element of x, i.e.,

     >y#x.
A vector y is called a path vector, and yx (for a simple y) reaches into x with a series of Picks that select scalars and Disclose them, using one element of y at each step:
     y[1+#y]...y[1]y[0]x.
The order of the elements in the left argument corresponds to the depth of the selection from the right argument: element 0 in the left argument refers to the top level, element 1 refers to the second level, and so on. The argument x and the result of each but the last scalar Pick must be a vector, since the left argument of each step of Pick is a scalar. Picking from a simple array is not allowed as a continuation step: a simple array can be produced only as the final step; 1 0(1;2 3;4) is an error.

Nested right argument and nested left argument

If y is nested, its items are used in a way similar to the previous case and must each select a scalar, but the rank of x and any of its components can exceed 1. If y is scalar and x is of rank 2 or greater (to distinguish this case from the previous one), y must contain a full set of indices for x, as an enclosed simple vector. The result is the Disclose of a single element chosen from x, viz.,

     >(<@0>y)#x
(A small complexity in this expression arises from the fact that Pick, in general picking a single element during each of several steps, requires all its indices for each depth to be in one box, whereas Choose, in general choosing several elements or cross sections but only at the top level, requires the indices for each axis to be in one box.) If y is a vector, then yx reaches into x with a series of scalar Picks of the same form as just shown for the simple case, but now each element of y is an enclosed simple vector and the corresponding component of x, from which y selects, need not be a vector.

Picking from a simple array is not allowed as a continuation step: a simple array can be produced only as the final step; (1;0)(1;2 3;4) is an error.

By the way, ((j;i)a)b is a valid Selective Assignment, although (ija)b is not.

   Additional Error Reports
The following reports are issued only if there is no parse or value error (see "Common Error Reports"):

  • a type error is reported if y is not composed of symbols or integers (not just restricted whole numbers);
  • a rank error is reported if (1) y or anything it contains is not a vector or a scalar, or (2) one of its items has a length unequal to the rank of the array to which it is applied;
  • a domain error is reported if (1) y is symbolic and x is not (more or less) a slotfiller array, or (2) during the execution of Pick and not as its last step, an array is picked that is not nested;
  • an index error is reported if an element of y is not in the range 0 to n-1, where n is the length of the axis it is applied to, or if y is a symbol and is not a member of the vector of symbols s in x.
   Examples
     1('ab';(2 2'cdef';10 20))
< cd
  ef
<  10 20
     01('ab';(2 2'cdef';10 20))
cd
ef
     1 0('ab';(2 2'cdef';10 20))
cd
ef
     (1;0;0 1)('ab';(2 2('c';'d';'e';'f');10 20))
d
     `was(`this `was `that;(10;20;30))
 20
     `this `was `that `was
 1
     1(10;20;30)
 20
     `is(`this `was `that;(10;20;30))
 : index
*    
     `a(`a;<10)
 10

Print x

   Argument and Result
x is any array and its value is also the result.

   Definition
The result is x, but additionally the value of x is displayed in the A+ session.

   Example
     2+3
 3
 5

Rake x

   Argument and Result
x is any array. The result is a nested vector whose depth is one, or a function scalar or the Null.

   Definition
If x is the Null, so is the result. If x is simple and not the Null, the result is ,<x. Otherwise, the result is a vector composed of the simple components of x, except that Nulls are discarded. The simple components of x are all those simple objects obtainable by repeated selection and disclosure. Each of these components is enclosed in the result, except that scalars of type symbol and function that were at depth zero remain so.

   Examples
     `a `b
<  `a `b    A vector whose only element is of
            depth 1 and, when disclosed, length 2.
     `a`b,(+;'ac';1 2;(3 4;(5;<(););6);7 8)
<  `a
<  `b       Despite the display,
<  +        the first three elements are simple: `a `b <{+}
<  ac       This and all the rest of the elements are each at depth 1.
<  1 2
<  3 4
<  5        Notice that two Nulls were discarded following this element.
<  6
<  7 8

Ravel ,x

   Argument and Result
The argument x is any array. The result is a vector of shape /x.

   Definition
The result is the vector of the elements in x, taken in row-major, or odometer, order. For a scalar, it is a one element vector.

   Example
     a
 101   2
   3 45
  34  21.5
     ,a
 101 2 3 45 34 21.5

Raze x

   Argument and Result
The argument is either a simple array or a nested scalar or vector. If it is a nested vector, then the Discloses of its elements must all be conformable: they must be of the same general type and, treating scalars as one-element vectors, their ranks and the shapes of their items must be same.

The type of the result depends upon the Discloses of the elements of x. If one of them is a nonempty floating-point array, the result type is floating point. Otherwise, if any of them are nonempty, the result type is that of the first nonempty one; else it is the type of the first one.

The result shape is x if x is simple, >x if x is a nested scalar, >''x if x is a nested one-element vector, and otherwise (+/>@0#x),s, where s is the common shape of the items of the disclosed elements of x.

   Definition
If x is simple, then the result equals x. If x is a nested scalar, the result is >x. If x is a one-element nested vector, then if that one element is an enclosed scalar, the result is ,>x, and otherwise the result is >x. If x is a nested vector with more than one element, the result is the catenation of the Discloses of all elements of x, i.e.,
(>0#x),(>1#x),...,>(1+#x)#x
Note in the latter case that x is in the domain of Raze only if (1) this series of catenations can be formed and (2) the Discloses of all the elements are either all the same rank or a mixture of scalars and vectors.

   Additional Error Reports
Each of the following reports is issued only if there is no parse or value error (see "Common Error Reports") and none of the reports preceding it on this list applies:

  • a domain error is reported if some elements of x are simple and some elements are nested;
  • a rank error is reported if the Discloses of the elements of x have different ranks, unless they are all either vectors or scalars;
  • a mismatch error is reported if the items of the Discloses of the elements of x have different shapes;
  • a type error is reported if the Discloses of the elements of x have different general types.
   Examples
     ('ab';'cde';'f')
 abcdef
     (2 3;102 3)
  0  1  2
  3  4  5
 10 11 12
 13 14 15

Replicate y/x

   Arguments and Result
y is a simple vector or one-element array of nonnegative restricted whole numbers, and x is any array. If y is a vector of length unequal to one, then its length equals the number of items of x, i.e., #x, or x can be a scalar. The items of the result are items of x.

   Definition
The items of the result are taken from the items of x. Each item i#x (or x itself if it is a scalar) is replicated y[i] times in the result. A scalar or other one-element array y is treated like (#x)y, i.e., each item of x is replicated y times in the result. The number of items in the result is +/(#x)y. When every element of y is 0 or 1, this function is called Compress.

   Additional Error Reports
Each of the following reports is issued only if there is no parse or value error (see "Common Error Reports"), except token precedes value, and none of the reports preceding it on this list applies:

  • a token error (like a parse error) is reported if there is a primitive function or operator symbol to the immediate left of / that is not one of +^;
and, unless one of +^ is to the immediate left of /, throwing you into Reduce, a monadic operator:

  • a valence error is reported if there is no left argument to the immediate left of /;
  • a type error is reported if the left argument is nested or does not consist of restricted whole numbers;
  • a domain error is reported if the left argument contains a negative number;
  • a rank error is reported if the left argument is not a vector or a one-element array;
  • a length error is reported if the number of elements in the left argument equals neither one nor the number of items in the right argument, unless the right argument is a scalar.
   Examples
     3 0 1/3 2'abcdef'
ab
ab
ab
ef
     (a0)/a4 1 3 0 8 5      Compress.
 4 3 0 8
     2 0 3 0/'a'
aaaaa

Reshape yx

   Arguments and Result
The argument y is any simple array of nonnegative restricted whole numbers, and x is any array. The result is an array whose shape is ,y and whose type is that of x except in certain cases when the result is empty (see the definition, below).

   Definition
The value is an array whose elements come from ,x (see "Ravel") in ascending index order. The number of elements of x needed for the result is /,y. If x has at least /,y elements, any excess is ignored. If x is nonempty but has fewer than /,y elements, the elements of x are used cyclically. If x is empty, the resultant array is filled with zeros if x is numeric, blanks if x is character, or enclosed Nulls if x is nested, as shown in the table "Fill Elements".

If y is all zeros, the result is of course empty, and its type is the type of x if x is character, integer, floating point, or null, but its type is null if x is box, symbol, or function.

   Additional Error Reports
Each of the following reports is issued only if there is no parse or value error (see "Common Error Reports") and none of the reports preceding it on this list applies:

  • a type error is reported if y is not simple or has an element that is not a restricted whole number;
  • a domain error is reported if y has a negative element, or if /,y is too large to be represented as an integer - i.e., is not a restricted whole number;
  • a maxrank error is reported if y has more than nine elements.
   Examples
     2 3'abcdefgh'
abc
def
     10'abcdefgh'
abcdefghab

Restructure y!x

   Arguments and Result
The left argument y is a simple one-element array whose value is a restricted whole number, and the right argument x is any array, except that it must be nonscalar unless y is 1. The result has rank 1 greater than the rank of x. Except for the first two axes of the result and the first axis of x, the shapes of the result and x are equal. There are two quite different cases.

  • If y is positive, it must evenly divide #x, and the result has shape ((#x),y),(,y),1x.

  • If y is negative or zero, the result has shape ((,y)+1+#x),(-,y),1x.
   Definition
In both cases of this function the result is obtained by arranging the items of x in ways that replace the first axis of x with two new axes. In the case where y is positive it must evenly divide #x, and then the result is simply a reshape of the leading axis of the x into two axes, the first of length (#x)y, and the second of length y. See the first example.

In the case where y is negative or zero, the elements of x are used repeatedly. The result r can be thought of in terms of clipping sections of the first axis of x using a window of length -y. That is, if w-,y then 0#r is w#x, 1#r is (w+1)#x, and in general i#r is (w+i)#x. See the second example. This form of the function is useful for producing moving averages.

   Additional Error Reports
Each of the following reports is issued only if there is no parse or value error (see "Common Error Reports") and none of the reports preceding it on this list applies:

  • a type error is reported if the left argument is not simple or has an element that is not a restricted whole number;
  • a nonce error is reported if the left argument has more than one element;
  • a rank error is reported if the right argument is scalar and the left argument is not 1;
  • a maxrank error is reported if the right argument is of rank 9;
  • a length error is reported if the left argument is positive and does not evenly divide the number of items in the right argument, or if it is negative and more than one greater in absolute value than the number of items in the right argument (for negative y, if |y equals #x the result has one item, and if it equals 1+#x the result has zero items).
   Examples
     3!'abcABC'
abc
ABC
     3!0 1 2 3 4 5 6
 0 1 2
 1 2 3
 2 3 4
 3 4 5
 4 5 6
     +/@1ۢ3!0 1 2 3 4 5 6
 3 6 9 12 15
     (+/@1ۢ3!0 1 2 3 4 5 6)3  Moving average of length 3
 1 2 3 4 5

Result x

   Argument and Result
x is any array and its value is also the result.

   Definition
The effect of Result is to exit from the current function or immediate execution code and return x as the result. (In immediate execution, this value will not be displayed if what the A+ display mechanism believes was the last function executed is thought by it to be an Assignment - i.e., the display mechanism may not recognize the exit or it may take the Result arrow to be an Assignment arrow.) The niladic use of this symbol, a bare left arrow (), is meaningful only outside function definitions, where its effect is to cause resumption of the most recently suspended function execution, with the workspace size increased if necessary; within a function definition it is ignored. Thus, within a function, () causes an exit and the return of a Null result, whereas alone has no effect at all.

Warning!  Within protected execution, whether do or Execute, Result exits from that function only, with a 0 return code and the Result argument as result;  it does not exit from the function containing the protected execution text.

   Example
     fact n: {if (n=0) 1; nfact n-1}
     fact 5
 120
     fact 0
 1

Reverse x

   Argument and Result
x is any array. The shape of the result equals the shape of x.

   Definition
The result is x with the items reversed. (x)[i] is x[(1+#x)-i].

   Examples
     5
 4 3 2 1 0
     2 5
 5 6 7 8 9
 0 1 2 3 4

Right x

   Argument and Result
x is any array. The result is the same shape and type as x.

   Definition
The result is the value of the argument. This primitive is useful in separating the right operand from the right argument in an expression, and also in getting just the value of a mapped file.

   Additional Error Report
If there is no parse or value error (see "Common Error Reports"),

  • a valence error is reported if there is a left argument.
   Examples

     a3     Continuation beyond Assignment, so the result is displayed.
 0 1 2
               Separate right argument from data operand using  :
     2 4 8,@0.5 .25 .125
 2 0.5         Items of the result are the scalar cells
 4 0.25        of the arguments joined by Catenate.
 8 0.125

Rotate yx

   Arguments and Result
x is any array. y is a simple array of restricted whole numbers whose shape equals 1x unless y consists of a single element (and is then of any rank). The shape and, for simple x, the type of the result equal the shape and type of x.

   Definition
Suppose x is a matrix and y is a vector with y equal to 1x. Then the result is x with each column vector x[;i] rotated by the number of elements indicated in y[i]. If y[i] is positive, then x[;i] is rotated towards the origin, while if y[i] is negative, x[;i] is rotated away from the origin. If y[i] equals 0, there is no rotation.

If x is a vector and y is a scalar (or other one-element array), then the result is x rotated by the amount y, as described above. If x is a matrix and y has one element, then the result is x with each column vector x[;i] rotated by y. The case for x of higher rank is defined by reshaping x into a matrix with all but the first axis combined into one. Formally, the result is:

     (x)(,y)((1x),/1x)x
   Additional Error Reports
Each of the following reports is issued only if there is no parse or value error (see "Common Error Reports") and none of the reports preceding it on this list applies:

  • a type error is reported if y is nested or does not consist of restricted whole numbers;
  • a rank error is reported if y has more than one element and its rank is not 1 less than that of x;
  • a length error is reported if y has more than one element and y is unequal to 1x.
   Example
     0 2 15 3
  0 10  5
  3 13  8
  6  1 11
  9  4 14
 12  7  2

Selective Assignment targeta

   Arguments and Result
The right argument a is any array. The left argument is the target of the assignment, and takes one of the forms in the table "Targets of Selective Assignment". The compatibility requirements for the two arguments are discussed in the definition. The explicit result is a, except that its type will be that of the selected subarray (see Definition) if they are both numeric but one is integer and the other floating point.

   Definition
See also Assignment. Like it, Selective Assignment, in any form, cannot be the operand of an operator.

Each of the various forms of the left argument (see the table "Targets of Selective Assignment"), if executed separately from Selective Assignment, produces a subarray of some target array that appears in the left argument. Executed in Selective Assignment, it selects a subarray of locations in the target array. The effect of Selective Assignment is to replace the values of the target array at the locations specified in the selected subarray by the values in a.

The conformability rule for Selective Assignment is that the shape of the selected subarray must be identical to the shape of the right argument a unless a has only one element.

The type rule is that the selected subarray and a must be of the same general type, with one additional requirement: if the type of the selected subarray is integer and a is floating point, then a must consist entirely of restricted whole numbers, so that it can be coerced to integers before insertion in the selected subarray.

If the same location appears repeatedly in the selected subarray, then in general several distinct values in a will thereby be specified for that one location. The element of a that is actually chosen as the new value for that location is the one with the highest index in ,a. See the examples.

A description of each basic form of Selective Assignment follows.

Performance Note: Assignment In Place

Choose Assignment, (...#x)y, and the corresponding Bracket Assignments, x[...]y, are the only assignments guaranteed to be done in place - i.e., without copying x to a new location while revising it. Append Assignment, x[,]y, is performed in place if there is enough space. All other Selective Assignments, like ordinary Assignment to an existing variable, involve copying the target variable while revising it.

   Bracket Indexing Selective Assignment

Bracket Indexing can be used to select subarrays as values. It can also be used, in the same form, on the left side of the Assignment arrow to select subarrays of locations for assignment of new values.

   Replace All (x[]a)

This is a special form of Bracket Indexing Selective Assignment; it would be just a particular case except that it applies to scalars also. It replaces all the elements in the variable named on the left of the assignment arrow. It is the most efficient way to replace all elements of a mapped file; see "Mapped Files".

   Append (x[,]a)

This is a special form of Bracket Indexing Selective Assignment for appending items to an array. x must not be a scalar, else a rank error is reported. The conformability rule is that the shape of the items of x must be identical to the shape of either a or its items, except that a can be a scalar for any x (and, as with any scalar extension, a scalar a can "disappear" - be extended to empty - if the items of x are empty).

Execution of x[,]a can be more efficient than xx,a because if there is enough unused space following x in the storage area allocated to x, the result is formed simply by copying a into that space. Because storage is allocated roughly in powers of two, an array has between exactly and twice the space it needs. In particular, this form of assignment is the only efficient way to extend a mapped file; see "Mapped Files".

Append can cause an itemwise invalidation of an itemwise dependency. See "Recognition of Itemwise Changes".

Additional Error Report for Append

  • A length error is reported if there is a preset callback on an Append Assignment and the callback function changes the shape of the data to be appended, so that it no longer agrees with the indices that were passed to the callback function as an argument.
Targets of Selective Assignment
Target Type Target Form (see below regarding f and see below regarding , (Ravel))
monadic(f x)(,x) (f px)(,px)
dyadic(y f x)(y#,x) (y f px)(y#,px)
generalf{...;x}#{y;,x} f{...;px}#{y;,px}
index expressionx[a;...;c](,x)[a] (px)[a;...;d](,px)[a]
choose((a;...;c)#x)(a#,x) ((a;...;d)#px)(a#,px)
append x[,]
replace allx[]

Warning! The forms (f,x), (f,px), (y f,x), (y f,px), f{...;,x}, and f{...;,px} are accepted, but unless f is Choose (#) the Ravel (,) is ignored!

In this table, f denotes either a primitive or a defined function, appropriate to the particular form - or f can be omitted. x, the target array, denotes a variable name or %y or c%y, where c and y are any expressions producing simple scalar symbols, but x cannot denote %v or c%v. The variable named by x is the one that is modified.

   Primitive Functions in Selective Assignment Expressions

Some A+ primitive functions can be used in expressions on the left of the assignment arrow. They are:
Take, Drop,
Replicate, Expand,
Ravel, Item Ravel, Reshape,
Rotate, Reverse,
Transpose, Transpose Axes.
(By the way, ((j;i)a)b is a valid Selective Assignment, although (ija)b is not.)

For a monadic primitive function f in the above list, the form of the specification is, in the simplest case:

     (f x)a
The definition is as follows: first evaluate
      if x
where x represents a variable name, and then do the Bracket Indexing Selective Assignment:
     (,x)[i]a
This definition is based on the following facts:

  • the elements of x are exactly all the indices of ,x;
  • for each monadic primitive f listed above, ^/(,f x),x has the value 1. That is, all elements of f x are valid indices of ,x.
The definition for a dyadic primitive function is similar. In this case the right argument x of the primitive function, which must represent a variable name, is the target of the assignment and the left argument y is any array for which y f x is valid. Then
     (y  f  x)a
is defined by
     iy f x
     (,x)[i]a

   Defined Functions in Selective Assignment Expressions

Defined functions can also be used on the left side of the assignment arrow. The definition is the same as the one above for primitive functions, only now it is up to the programmer to see that the function, when applied to arrays whose values are in n, produces results whose elements are all members of n.

   Brace Assignment ({w;y;...;z;x}a)

The general form f{w;y;...;z;x}a has a syntactic special case, where the function name is not present:
{w;y;...;z;x}a
is permitted and is equivalent to x[]a. In particular, {x}a is equivalent to x[]a.

   Selective Assignment of Objects Bound to Display Classes

See "Assignment of Objects Bound to Display Classes".

   Additional Error Reports
Each of the following reports is issued only if there is no parse or value error (see "Common Error Reports") and none of the reports preceding it on this list applies:

  • an error is reported if one of the functions selecting the subarray encounters an error; this includes any defined function, so the report may come from a primitive function within a defined function;
  • a type error is reported if the general type of the target differs from the general type of a or if the target is integer but a is floating point and not composed entirely of restricted whole numbers;
  • a rank error is reported if the rank of the selected subarray differs from the rank of a and a is not a one-element array;
  • a length error is reported if corresponding dimensions of a and the selected subarray differ and a is not a one-element array;
  • a maxitems error is reported if an attempt is made to append an item to a mapped file beyond its maximum size as specified by _items (see "Items of a Mapped File");
  • an invalid error is reported if the target array is bound to a display class and the value it is to be given is not a valid value for (the selected part of) objects bound to that display class;
  • an index error is reported if an index not in x is generated; the error may not be detected before partial replacement of values has occurred - see the examples.
   Examples
     v10
     v[2 2 2]5 9 1   Repeated indices
     v
 0 1 1 3 4 5 6 7 8 9

     m4 4
     0 0m             Diagonal
 0 5 10 15


     (0 0m)1 2 3 4   Primitive function selection: diagonal.
     m
  1  1  2  3
  4  2  6  7
  8  9  3 11
 12 13 14  4


           Display argument, then return last element (to show how
           defined functions are called during Selective Assignment):
     last x: 1,x
     a3 2'abcdef'
     last a
ab
cd
ef
f


     (last a)'F'   User-defined function selection.
 0 1                 Argument it was given: a, i.e., 3 2
 2 3
 4 5                It returns 5.


     a
ab
cd
eF                  The new value 'F' was placed at (,a)[5].


     x(10;20;(2 3;'abc'))
     (1;1)#2 0x    Pick-Choose selection
 4                  Present value of selected component


     ((1;1)#2 0x)99    Pick-Choose selection for
     x                   Selective Assignment, new value 99
 <  10
 <  20
 < <  0  1  2
      3 99  5       New value is at the selected location.
   < abc


     f x:x+5        User function to manipulate indices
     v10          Variable for Selective Assignment
     (f v)100+10  Make erroneous Selective Assignment:
 : index           error detected.
*       
      v             In time?
 0 1 2 3 4 100 101 102 103 104
 Not quite. Indices up to first incorrect one were used.

Separate Symbols x

   Argument and Result
The argument and result are simple arrays of symbols. The shape of the result is the same as that of the argument except that a last axis of length 2 has been added; i.e., the result shape is (x),2.

   Definition
Each element of the argument is separated into two symbols, the first coming from whatever precedes the rightmost dot, and the second from whatever follows it; if there is no dot, a leading one is assumed. Unqualified names and root-context names cannot be distinguished in the result of this function.

   Example
     `x `.y `c.z `a.b.d
yields
 `    `x
 `    `y
 `c   `z
 `a.b `d
   Additional Error Report
If there is no parse or value error (see "Common Error Reports"),

  • a maxrank error is reported if the rank of the argument is nine.

Shape x

   Argument and Result
The argument is any array. The result is a vector of integers with an element for each axis of the argument.

   Definition
The shape of a scalar is 0 because a scalar has no axes. For a nonscalar the ith element of the result is the ith dimension of the argument. That is, if the result is r then r[i]-1 is a valid index of the ith axis of x, but r[i] is not.

   Examples
      3 40
 3 4
      10 20 30 40
 4
      'The Cat in the Hat'
 18
      42
               This is the display of the empty integer vector.
      5
 5

Signal x

   Argument and Result
x is a simple symbol or character array.

   Definition
The effect during function execution is to signal an error in the current function, display the text of the first symbol of x or the ravel of the character array x as an error message, and cause a suspension at the statement where the current function was called. In protected execution, it returns error code -1. Outside function execution and protected execution, it simply aborts execution of the expression, without any message.

   Additional Error Report
The following report is issued only if there is no parse or value error (see "Common Error Reports"):

  • a domain error is reported if the argument is not a simple symbol or character array.
   Example
     f1 a:1+f2{a}
     f2 x:if (x=0) `zero else 2x
     f1 2
 5
     f1 0
 f2: zero
*     $si
f1 0
.f1: 1+f2{a}
*     a
 0
*     

Solve yx

   Arguments and Result
x and y are numeric arrays whose ranks are less than or equal to 2, with #y equal to #x. The result has shape (1x),1y.

   Definition
yx equals (x)+.y. If x is a nonsingular matrix with the same number or rows as columns, the result is the solution a to the linear system of equations y equals x+.a. If x is a matrix with more rows than columns, and if the columns are linearly independent, the result is the least squares solution a to that linear system of equations. That is, a is the array for which +/(y-x+.a)*2 has the smallest possible value for each element.

   Additional Error Reports
The following reports are issued only if there is no parse or value error (see "Common Error Reports"):

  • a rank error is reported if the rank of either argument exceeds 2;
  • a domain error is reported if (1) an argument is not a simple numeric array, or (2) an argument is a matrix with more columns than rows, or (3) the right argument is singular or very ill-conditioned.
   Example
Given the following linear system of equations:
  10 = 3x + 5y -  z
  -3 = 7x - 2y + 4z
   5 =  x +  y + 2z
the solution vector (x,y,z) can be determined as follows:
     10 3 5  3 33 5 1 7 2 4 1 1 2
 .5180722892 2.602409639 1.457831325

Stop ^x

   Argument and Result
x is any array, and its value is the explicit result.

   Dependency
The value of the system variable `stop, which is set by the Stop command ($stop) and the Set System Variable function (_ssv).

   Definition
The effect of this function depends on the setting of `stop. Either the function has no effect (when `stop is 0), or it causes execution to halt (when `stop is 1), or it causes x to be displayed (when `stop is 2). A Stop halt is the same as an error halt, except that it can occur within protected execution ( or do).

See "Example of a Defined Function" and, immediately following it, "Errors and Stops" in the appendix.

   Example
     sum{x}:{
      z0;
      (ix) do ^zz+i+1   Call Stop function after each "z".
      z }
     $stop 0              No effect.
     sum 3
 6
     $stop 1              Actual stop each iteration.
     sum 3
: stop
*     i,z                 Check i and z.
 0 1
*     
: stop
*     zz+10              Give z a little boost.
*     
: stop
*     &0                  Check the top of the stack.
 16
*     
 16                       The doctored result.
     $stop 2              Display the value each iteration.
     sum 3
 1
 3
 6
 6                        The result of sum 3.

Take yx

   Arguments and Result
The argument y is a simple one-element array whose value is a restricted whole number, and x is any array. A scalar x is treated as a one-element vector. The shape of the result equals the shape of the right argument x for all but the first axis, while the first dimension is the absolute value of y.

   Definition
There are four cases for Take, depending on whether or not y is nonnegative, and whether or not |y is less than or equal to #x. The result always has |y items. The two cases when |y is less than or equal to #x are the most straightforward: the result consists of the first y items of x if y is nonnegative, and the last -y items if y is negative. See the first two examples.

In the two cases where |y is greater than #x, the difference (|y)-#x represents the number of excess items in the result . These excess items consist entirely of fill elements (see the "Fill Elements" table). Let F be the array of excess items. The shape of F equals the shape of x along all but the first axis, while the length of the first axis is (|y)-#x. The result is the catenation x,F if y is nonnegative, and F,x if y is negative. See the last two examples.

Fill Elements
General type of right argumentFill element
numeric0
characterblank
symbolthe empty symbol
nestedenclosed Null

   Additional Error Reports
Each of the following reports is issued only if there is no parse or value error (see "Common Error Reports"), and nonce only if there is no type error:

  • a type error is reported if the left argument is nested or is not all restricted whole numbers;
  • a nonce error is reported if the left argument has more than one element.
   Examples
     35 2
 0 1
 2 3
 4 5
     35 2
 4 5
 6 7
 8 9
     510 20 30
 10 20 30 0 0
     510 20 30
 0 0 10 20 30
     5`a`b`c
 `a `b `c ` `

Transpose x

   Argument and Result
x is any array. The shape of the result is the reverse of the shape of x, i.e., x.

   Definition
The result is x with its axes reversed. In particular, if x is a matrix then its rows become the columns of the result, and its columns become the rows. More generally, for any x and any nested vector of simple vectors y for which y#x is valid
y#x  (y)#x
If y selects a scalar, then the equivalence is simply y#x (y)#x.

   Example
     2 3
 0 3
 1 4
 2 5

Transpose Axes yx

   Arguments and Result
x is any array. y is a simple vector of restricted whole numbers whose length equals the rank of x, i.e., y equals x (unless y is a scalar, which is treated as a one-element vector, yielding the uninteresting case 0x x for vector x). The rank of the result is equal to the number of distinct elements in y, so it is equal to or less than the rank of x.

   Definition
The result is x with its axes permuted and coalesced according to y. The elements of y must all be in r, where r denotes the result, and no element of r can be missing from y. The elements of y specify where in the result the corresponding axes of x appear. For instance, if x has three axes and y[1] equals 2, then axis 1 of x becomes axis 2 in the result. See the first example. If y contains duplicates, then, for each set of duplicates, the corresponding axes in x are coalesced into one axis in the result, and the length of the resulting axis is the least of the lengths of the coalesced axes. In particular, if x is a matrix then 0 0x is the diagonal of x. See the second and third examples.

In terms of indices, if i is a vector of indices which selects an element of x, then there are two possibilities. (1) For some set of coalesced axes, the corresponding elements of i are different. Then the indexed element of x is not in yx. (2) The element is in yx and its indices there are i[yyx] (using, for each set of coalesced axes, the index for the first axis in the set, as an arbitrary choice).

   Additional Error Reports
Each of the following reports is issued only if there is no parse or value error (see "Common Error Reports") and none of the reports preceding it on this list applies:

  • a type error is reported if the left argument is nested or does not consist of restricted whole numbers;
  • a rank error is reported if the left argument is not a scalar or vector, or if its length is unequal to the rank of the right argument;
  • a domain error is reported if the left argument contains a negative number or does not contain all the restricted whole numbers between zero and its largest element, inclusive, possibly with duplications.
   Examples
     0 2 12 3 4
  0  4  8
  1  5  9
  2  6 10
  3  7 11

 12 16 20
 13 17 21
 14 18 22
 15 19 23
     0 02 3
 0 4
     1 0 02 3 4
  0 12
  5 17
 10 22

Type x

   Argument and Result
The argument is any array; if the argument is a function expression it must be in braces. The result is a symbol scalar.

   Definition
The result is the type of the first item of the argument, represented as a symbol. The types are:

character, integer, floating point, null, symbol, function, and box
(`char, `int, `float, `null, `sym, `func, and `box, respectively).

Symbol, function, and box items can be mixed in a single array. See the last three examples in the set that follows. There is also a type included to provide for possible weird cases; its symbol is `unknown.

   Examples
     'a'
 `char
     42
 `int
     4.2
 `float
     `a
 `sym
     {+}  The parser needs the braces as a hint when a function is an argument.
 `func
     <{+}
 `func     Function scalar and function expression are both type `func.
     ()
 `null
     <'a'
 `box
     `a,(<1251),<{+}
 `sym
     (<1251),(<{+}),`a
 `box
     (<{+}),`a,<1251
 `func

Unpack x

   Argument and Result
x is a simple array composed entirely of symbols. The result r is a simple character array whose shape along all axes except the last is x. I.e., 1r is x.

   Definition
Pack is the left inverse of Unpack. That is, for any array x composed entirely of symbols, x equals x. The result has one more axis than x, the last. Each character vector along the last axis of the result consists of the characters - except for the leading backquote - in the display of the corresponding symbol of x, perhaps padded with blanks on the end. The last dimension of the result is the largest number of characters in any of these vectors, before padding.

   Additional Error Reports
The following reports are issued only if there is no parse or value error (see "Common Error Reports"):

  • a maxrank error is reported if the rank of the result would be greater than nine;
  • a type error is reported if the argument is not a simple array of symbols.
   Example
     `a `abc
a
abc

Value %x

   Argument and Result
x is a scalar symbol that contains a user global name (see "User Names" and "Symbols and Symbol Constants"). The result is an array or a function.

   Definition
If the name in the symbol x is not qualified by a context name, then the current context is assumed. If it is so qualified, the designated context is assumed. For example, `v.a refers to a in the context v, `.a refers to a in the root context, and `a refers to a in the current context. See the example with the function f below.

There are two cases. If the thing named by the symbol x is a global variable, the result is the value of that variable. If the thing is a defined function (not a primitive function, because a primitive function does not have a user name), then the result is that function: if %x occurs bare, the function definition will be displayed; if it occurs with argument(s) the function will be executed, provided general function form is used, with those arguments in braces.

Unlike Execute, Value can be used on the left of Assignment to set the value of a global variable.

   Additional Error Reports
The following reports are issued only if there is no parse error (see "Common Error Reports"). A value error report (another of the common error reports) can happen here because either x is not a user name or it lacks a global value. A value error will be reported only if there is no type or rank error.

  • A type error is reported if the type of x is not symbol.
  • A rank error is reported if x is not a scalar.
  • If x names a defined function, any further errors will be reported for that function.
   Examples
     sq x:x*2
     f`sq
     x11 12 13
     a`x
     %f
sq x:x*2
     (%f){%a}
 121 144 169
     a4
     %`a
 0 1 2 3
     (%`a)'new'    Value can be used on the left of Assignment.
     a
new
     %`q            q has no value.
 .q: value
*      
     f x:{
       ax;         Set local a
       a;          Display local a
       %`a;        Display global a, current context.
       %`.a; }     Display global a, root context.
     a1 2 3
     f 5
 5
 1 2 3              The current context is the root context.
 1 2 3
     $cx cc         Set a new context.
     a4 5 6        Set a in the new context, cc.a
     f 5
 5                  The local a
 4 5 6              The value in the current context, cc
 1 2 3              The value in the root context.

Value in Context y%x

   Arguments and Result
x and y are scalar symbols such that yx is a symbol containing a user global name (see "User Names" and "Symbols and Symbol Constants"). The result is an array or a function.

   Definition
Value in Context generates the name it uses in one of two ways:

The root context is represented by ` (the blank or empty symbol: just backquote alone).

There are two cases. If the thing named by y and x is a global variable, the result is the value of that variable. If the thing is a defined function (not a primitive function, because a primitive function does not have a user name), then the result is that function: if y%x occurs bare, the function definition will be displayed; if it occurs with argument(s) the function will be executed, provided general function form is used, with those arguments in braces.

Unlike Execute, Value in Context can be used on the left of assignment to specify the value of a global variable in a context. And unlike Execute in Context, Value in Context in effect constructs a qualified name and then evaluates it. Within a defined function or operator, `cxt%`x always refers to the global variable cxt.x, whereas `cxt'x' refers to the local variable x if there is one, and only if there is no such local variable does it refer to cxt.x.

   Additional Error Reports
The following reports are issued only if there is no parse error (see "Common Error Reports"). A value error report (another of the common error reports) can happen here because either x and y do not define a user name or the name they produce lacks a global value. A value error will be reported only if there is no type or rank error. An error report for x is preferred to an error report for y.

  • A type error report indicates that the type of x or y is not symbol.
  • A rank error report indicates that x or y is not a scalar.
  • If a defined function is named by y and x, any further errors will be reported for that function.
   Examples
     my.a4
     cx`my
     v`a
     cx%v                  Value of a in the context my
 0 1 2 3
     `anything%`my.a       `anything is ignored.
 0 1 2 3
     x30 40
     $cx your
     `%`x                  Value of x in the context.
 30 40
     cx%`x                 The value of cx is my
 my.x: value
*     
     my.a4
     (cx%v)'new'
     my.a
new


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_80.html0000444000265000001440000002266310737165262013657 A+ Reference: Index - M

Index - M

mab() and ma()  -> 
Magnitude (Absolute value function)  -> 
mailing list: aplus e-mail group  -> 
main loop (event loop)  -> 
Major Release Number variable  -> 
`majorRelease system variable  -> 
majorticksize attribute  -> 
malloc()  -> 
manifest constant  -> 
manual
        how to use this  -> 
        notation used in this  -> 
        organization of this  -> 
        terms used in this  -> 
Map function  -> 
Map In function  -> 
MAP_PRIVATE and MAP_NORESERVE settings, APLUS_ATMP environment variable  -> 
maplim error  -> 
$maplim system command  -> 
`maplim system variable  -> 
mapped attribute  -> 
mapped file  -> ,   -> ,   -> 
        assignment to  -> 
        C, using in  -> 
        callbacks on  -> 
        concurrent use  -> 
        copying (making an unmapped copy of)  -> 
        header  -> 
        in dependency  -> 
        information from Debug  -> 
        length  -> 
        limit on number of simultaneously mapped files  -> 
        list  -> 
        local write  -> 
        Map function  -> 
        on different machines  -> 
        on remote machine  -> 
        read-only  -> 
        read-write  -> 
        search order  -> 
        seeing updates  -> 
        Selective Assignment to  -> 
        simultaneous use  -> 
        synchronize: sys.amsync  -> 
Mapped Files Limit
        command  -> 
        variable  -> 
mapping, tracing of  -> 
margin... attributes  -> 

margins of graphs (xleft, etc., attributes)  -> 
marketprofile trace style  -> 
Match function  -> 
matrix  -> 
        display class  -> 
                arguments to attribute functions  -> 
Matrix Inverse function  -> 
Matrix product (Inner Product operator)  -> 
Max function  -> 
max... attributes  -> 
maxrank error  -> 
Member function  -> 
memory allocation  -> ,   -> 
menu
        accelerator key mnemonics  -> 
        button  -> 
        display classes  -> ,   -> 
        keyboard accelerator mnemonics attribute  -> 
        pop-up for notebook: showpopup attribute  -> 

messages
        adap, suppressing  -> 
        debug, suppressing  -> 
        error, form of  -> 
        Format, off switch  -> 
        s, suppressing  -> ,   -> 
        SIGPFE, suppressing  -> 
meta key  -> 
metaclasses, list of, s.metaClasses  -> 
mf()  -> 
middle mouse button  -> 
Min function  -> 
min... attributes  -> 
Minor Release Number variable  -> 
`minorRelease system variable  -> 
minus sign, high  -> 
Minus, dyadic (Subtract function)  -> 
Minus, monadic (Negate function)  -> 
mnemonics attribute  -> 
Mod (Residue function)  -> 
mode attribute  -> ,   -> 
$mode system command  -> 
`mode system variable  -> 
Modify Timer (adap)  -> 
modifying and returning arguments  -> 
Monadic Do  -> 
        tracing  -> 
monadic function  -> ,   -> 
monadic scalar function  -> 
        application of  -> 
        classification of every  -> 
        definition of every  ->  -   ->end
        error reports  -> 
        shape of result  -> 
Motif  -> 
mouse  -> 
        button  -> 
                middle  -> 
        clicking  -> 
        pointer  -> 
                moving  -> 
        pressing  -> 
movable divider  -> 
        in hpane  -> 
Move Mouse Pointer function  -> 
movelimit attribute  -> ,   -> 
        arguments to attribute function  -> 
moving average (Restructure function)  -> 
moving columns by dragging  -> ,   ->* 
moving data-points of graphs  -> 
multiple A+ sessions  -> 
multiple display screens, and s  -> 
multiple group fields (t)  -> 
Multiply function  -> 

About the Index

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_81.html0000444000265000001440000001371010757556020013647 A+ Reference: Index - N

Index - N

Na, see NaN and Nan Find function
na attribute  -> 
name
        adap service descriptor attribute  -> 
        argument for system functions  -> 
        classes  -> 
        global  -> 
        listing names  -> 
        local  -> 
        qualified  -> ,   -> 
        syntax of  -> 
        system function, syntax of  -> 
        system variable, syntax of  -> 
        system, syntax of  -> 
        unqualified  -> ,   -> 
        user, see user name
        value predicate  -> 
Name Class function  -> 
Name function  -> 
Name List function  -> ,   -> 
Name Search and Replace function  -> 
Name Search function  -> 
_name system function  -> 
names, use of this verb  -> 
NaN  -> ,   -> ,   -> 
NaN Find function  -> 
_nanfind system function  -> 
Natural log function  -> 
naturalsize attribute  -> 
_nc system function  -> 
Negate function, also called Negative  -> 
nested array  -> ,   -> 
Nested Association List function  -> 
newline character  -> ,   -> 
news group: aplus e-mail group  -> 
newshow attribute  -> 
newspapercolumn attribute  -> 
NFS  -> 
        stale file handle report  -> 
niladic function  -> 
NIS domain name  -> 
_nl system function  -> ,   -> 
No Longer Use Variables function  -> 
nochan error, adap  -> 
node... attributes  -> 
non-boolean And and Or arguments, checking for  -> 
non-scalar primitive function  -> 
        classification of every  -> 
        definition of every  ->  -   ->end
        error reports (common)  -> 
none trace style  -> 
nonpersistent attributes  -> 
not an `a object (error message)  -> 
Not equal to function  -> 
Not function  -> 
notation used in this manual  -> 
notation, infix  -> 
notebook display class  -> 
        arguments to attribute functions  -> 
        user interaction with  -> 
notify attribute  -> ,   -> 
        callbacks for  -> 
_ns system function  -> 
_nsr system function  -> 
Null function  -> 
null type  -> 
Null, the  -> ,   -> 
        display of  -> 
        for invalid screen input  -> 
        in itemwise dependencies  -> 
numbers, representation of  -> 
numeric (general type)  -> 
numeric constant, syntax of  -> 

About the Index

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_82.html0000444000265000001440000001040710737165263013653 A+ Reference: Index - O

Index - O

object  -> 
        and Assignment  -> 
        binding to a class  -> 
        bound to display class, Assignment to  -> 
        compound  -> 
        container  -> 
Object with Keyboard Focus function  -> 
objects bound to a class, s.boundTo  -> 
Objects with Specific Attribute Value function  -> 
octal (in character string)  -> 
Of (Bracket Indexing function)  -> 
Of (Member function)  -> 
of function  -> ,   -> 
Off command  -> 
$off system command  -> 
Open (Disclose function)  -> 
open punctuation  -> 
open, window  -> 
open-high-low-close trace style  -> 
Openlook  -> 
Operation would block (error message)  -> 
operator  -> 
        see also primitive operator, defined operator
        call expression  -> 
        formal  -> 
        tracing of  -> 
Operators command  -> 
$ops system command  -> 
Or function  -> 
        argument checking  -> 
order
        in which graph traces are drawn  -> 
        of evaluation  -> ,   -> 
        of traversal, window  -> 
organization of this manual  -> 
orientation attribute  -> 
origin, index  -> 
out: formatting screen output  -> 
out... attributes  -> 
        arguments to out attribute function  -> 
        format samples for out  -> 
Outer Product operator  -> ,   -> 
        similarity of Rank operator  -> 
outer union (t tables)  -> 
outline trace style  -> 
outofcurrentworkspace attribute  -> 
output representation (s.box)  -> 
output, formatting screen  -> 
output... attributes  -> 
Over (Divide function)  -> 
Over (Reduce operator)  -> 
overview of A+  -> 

About the Index

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_83.html0000444000265000001440000003235510737165263013662 A+ Reference: Index - P

Index - P

p context (packages)  -> 
p.fadd function  -> 
p.fcatalog function  -> 
p.ffix function  -> 
p.fnew function  -> 
p.sadd function  -> 
p.scatalog function  -> 
p.sfix function  -> 
p.snew function  -> 
Pack function  -> 
package  -> 
        creation  -> 
        debugging, options  -> 
        documentation, additional  -> 
        information  -> 
        inquiry  -> 
        modification  -> 
        options  -> 
        packfile  -> 
        packstring  -> 
        retrieval  -> 
page display class  -> 
        arguments to attribute functions  -> 
        user interaction with  -> 
page... attributes  -> 
pane display classes  -> ,   -> 
parent  -> 
        attribute  -> 
parenthesis  -> 
parsing scripts  -> 
partial products (Scan operator, with Multiply)  -> 
partial sums (Scan operator, with Add)  -> 
partition  -> 
        of a t table  -> 
        side of a link (t)  -> 
Partition Count function  -> 
Partition function  -> 
password display class  -> 
        arguments to attribute functions  -> 
        user interaction with  -> 
pasting text  -> ,   -> 
path name to file  -> 
pathfind function: sys.pathfind  -> 
pause attribute (adap)  -> ,   -> 
pendent function  -> 
Percent, dyadic (Value in Context function)  -> 
Percent, monadic (Value function)  -> 
Permissive Indexing  -> 
persistent attributes  -> 
Phase of the Release variable  -> 
`phaseOfRelease system variable  -> 
Pi times function  -> 
Pick function  -> 
pictorial representation of data  -> 
pie chart trace style  -> 
pie charts  -> 
pie... attributes  -> ,   -> 
pin attribute  -> 
pin, window  -> 
Pipe command  -> 
Pipe In command  -> 
Pipe Out Append command  -> 
Pipe Out command  -> 
Place (c.place...)  -> 
placement of graph legend  -> 
Plus, dyadic (Add function)  -> 
Plus, monadic (Identity function)  -> 
pointer
        c  -> 
        mouse  -> 
                moving  -> 
Populate a View Table function (t)  -> 
pop-up menu for notebook: showpopup attribute  -> 
pop-up window  -> 
        default creation (s.SHELL)  -> 
popups, list of: s.popups  -> 
port (adap service descriptor attribute)  -> 
Port and Workstation Information (adap)  -> 
portable pixmap (ppm)  -> 
position attribute  -> 
PostScript (outputmode ps)  -> 
PostScript files (printfile)  -> 
Pound, dyadic (Choose function)  -> 
Pound, monadic (Count function)  -> 
Power function  -> 
Power, monadic (Exponential function)  -> 
$pp system command  -> 
`pp system variable  -> 
ppm files (printoutputmode attribute)  -> 
precedence  -> 
preset
        attribute  -> 
        callback  -> 
                see also callback
        setting callback  -> 
pressing button  -> 
previewing a PostScript file (printfile)  -> 
primary attribute  -> ,   -> 
primary selection buffer  -> ,   -> 
primaryslice... attributes  -> ,   -> 
Primitive Attributes function  -> 
primitive function
        see also monadic scalar function, dyadic scalar function,
                   non-scalar primitive function, primitive functions
        ambi-valence  -> 
        dyadic scalar functions  -> 
        execution counts  -> 
        file functions  -> 
        in Selective Assignment expressions  -> 
        monadic scalar functions  -> 
        non-scalar primitive functions  -> 
        screen management  -> 
        syntax of  -> 
primitive functions
        see also monadic scalar function, dyadic scalar function,
                   non-scalar primitive function, primitive function
        free  -> ,   -> 
        has  -> ,   -> 
        hide  -> ,   -> 
        is  -> ,   -> ,   -> 
        Map  -> 
        Map In  -> 
        of  -> ,   -> 
        show  -> ,   -> 
primitive operator
        definition of every dyadic  ->  -   ->end
        definition of every monadic  ->  -   ->end
        error reports for dyadic (common)  -> 
        error reports for monadic (common)  -> 
principal
        function  -> 
        subexpression  -> 

print file (using lpr)  -> 
        previewing  -> 
Print function  -> 
print... attributes  -> 
        printfile: previewing the file  -> 
Printing Precision command  -> 
Printing Precision variable  -> 
printoutputmode attribute (and gif files)  -> 
priority attribute (adap)  -> ,   -> 
process 'a' illegal instruction error message  -> 
processes, delete defunct child  -> 
_profile system function  -> 
program development  -> 
program, see defined function, defined operator, script
programming environment, Emacs  -> 
progress indicators  -> 

protect... attributes  -> 
        arguments to protect attribute function  -> 
Protected Do, see Monadic Do
protected execution
        do  -> 
        error codes  -> 
        Execute function  -> 
        omitted error reports when stopped within  -> 
        Protected Execute Flag
                effect on protected execution  -> 
                system command  -> 
                system variable  -> 
        tracing  -> ,   -> 
protocol (adap service descriptor attribute)  -> 
protocols, adap  -> 
PWD environment variable  -> ,   -> ,   -> ,   -> ,   ->

About the Index

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_84.html0000444000265000001440000000254410737165264013661 A+ Reference: Index - Q

Index - Q

Quad-divide, dyadic (Solve function)  -> 
Quad-divide, monadic (Matrix Inverse function)  -> 
qualifiers for Format system function  -> 
query language, database  -> 
questions  -> 
queue status (adap)  -> 
Queue, Status of Read (adap)  -> 
Queue, Status of Write (adap)  -> 
queuing of event messages  -> 
quit, window  -> 
quotation mark  -> 
        multiple lines within  -> 

About the Index

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_85.html0000444000265000001440000002465610737165264013672 A+ Reference: Index - R

Index - R

R attribute  -> 
r attribute  -> 
radio display class  -> 
        arguments to attribute functions  -> 
raise attribute  -> 
raised, window  -> 
Rake function  -> 
Random integers (Roll function)  -> 
        without replacement (Deal function)  -> 
Random Link command  -> 
Random Link variable  -> 
Range, see Bins, b.r and b.pr
ranges, grouping by (t)  -> 
rank  -> ,   -> 
        maxrank error  -> 
Rank operator  -> ,   -> ,   -> ,   -> 
        deriving dyadic  -> 
        deriving monadic  -> 
        similarity to dyadic scalar function  -> 
        similarity to Outer Product operator  -> 
Ravel function  -> 
raw protocol (adap)  -> 
Raze function  -> 
rband... attributes  -> 
        callbacks for rband  -> 
rBufsize (adap)  -> 
read
        see also file, mapped file, attributes, get
        event (adap)  -> 
        files  ->  -   ->end
                Pipe In command  -> 
                read-only file (mapped file)  -> 
                read-write file (mapped file)  -> 
        primary selection buffer  -> 
        Read Queue Status (adap)  -> 
        Read, Synchronous (adap)  -> 
        readImport error, adap  -> 
real classes, list of, s.realClasses   -> 
realize attribute  -> 
reapportioning, windows  -> 
Reciprocal function  -> 
recognition
        of itemwise changes  -> 
        of itemwise dependence  -> 
Recursive Association List to Nested Slotfiller function  -> 
recursively attribute  -> 
Reduce operator  -> ,   -> 
Reduction (Reduce operator)  -> 
refer... attributes  -> 
        callbacks for refer  -> ,   -> 
        callbacks for referpoint  -> 
reference count  -> ,   -> ,   -> 
        file  -> 
reference display class  -> 
Refresh all Objects function  -> 
refresh attribute  -> 
refreshing of screen
        and dependencies  -> 
        and done attribute  -> 
relational database and t  -> 
relational set operations (t)  -> 
Release Code variable  -> 
`releaseCode system variable  -> 
release notes  -> 
remote use of mapped file  -> 
Remove Dependency Definition command  -> 
Remove Dependency Definition function  -> 
removing columns from a t table  -> 
reparent attribute  -> 
Replace All function  -> 
replace, see search
Replicate function  -> 
replication side of a link (t)  -> 
report display class  -> 
report, error, form of  -> 
report... attributes  -> 
representation
        of C-language structures in A+  -> 
        of numbers  -> 
        of variables  -> ,   -> 
        Representation (Encode function)  -> 
request attribute  -> ,   -> 
Reset (adap)  -> 
reset event (adap)  -> 
Reset system command  -> 
$reset system command  -> 
Reshape function  -> ,   -> 
reshow attribute  -> 
Residue function  -> 
resize
        attribute (s)  -> 
        corner  -> 
        window  -> 
resizeable attribute  -> 
resizing columns by dragging  -> ,   ->* 
respace attribute  -> 
Restore the Captured Screen Configuration function  -> 
restricted whole number  -> ,   -> 
Restructure function  -> 
result
        defined function  -> 
        defined operator  -> 
        dependency  -> 
        execution  -> 
        expression  -> 
        expression group  -> 
        shape for dyadic scalar function  -> 
        shape for monadic scalar function  -> 
Result function  -> 
retrieving clipped text  -> 
retry (adap service descriptor attribute)  -> 
Return key  -> 
rEventMode attribute (adap)  -> 
Reverse function  -> 
Rho, dyadic (Reshape function)  -> 
Rho, monadic (Shape function)  -> 
right argument  -> 
Right function  -> 
right... attributes  -> 
$rl system command  -> 
`rl system variable  -> 
Roll function  -> 
root context  -> ,   -> 
root object  -> 
Rotate function  -> 
rounding  -> ,   -> 
        in Cast  -> 
        rules, IEEE  -> 
row  -> 
        row and column selection (t)  -> 
row... attributes  -> 
rPause (adap)  -> 
rPriority (adap)  -> 
rQueueStatus (adap)  -> 
rule... attributes  -> 
running products (Scan operator, with Multiply)  -> 
running sums (Scan operator, with Add)  -> 

About the Index

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_86.html0000444000265000001440000011004210737165265013655 A+ Reference: Index - S

Index - S

s context  -> 
        functions  -> 
                see also primitive functions
                load  -> 
                save  -> 
        loading into A+  -> 
        variables  -> ,   -> 
s. ... (subindex of s context functions and variables)
sash, window, movable  -> ,   -> 
save attribute  -> 
        callbacks for  -> 
Save the Captured Screen Configuration function  -> 
scalar  -> ,   -> 
        display class  -> 
                arguments to attribute functions  -> 
                user interaction with  -> 
        extension  -> 
Scalar Comma Fix Input function  -> 
Scalar Fix Input function  -> 
Scan operator  -> ,   -> 
scanning, graph  -> 
scatter trace style  -> 
_scb system function  -> ,   -> ,   -> 
_scd system function  -> 
_scfi system function  -> 
scope
        function  -> 
        name  -> 
        operator  -> ,   -> 
screen  -> 
        configuration
                capture, s.script  -> 
                restore, s.load  -> 
                save, s.save  -> 
        editing  -> 
        entry of data  -> 
        input  -> 
        interactions  -> 
        invalid input  -> 
        management  -> 
                establish functions  -> 
                functions  -> 
        refreshing
                and dependencies  -> 
                and done attribute  -> 
        size  -> 
Screen Format function  -> 
screens (multiple), choosing one for s  -> 
script  -> ,   -> 
        attribute  -> 
        capturing screen, s.script  -> 
        file  -> 
                Abort Loading of Script function  -> 
                search order  -> 
        parsing  -> 
        tracking  -> 
        variables vs. functions, recognition  -> 
scroll bar  -> 
Scroll Together Horizontally, s.hscroll, Vertically, s.vscroll  -> 
scroll... attributes  -> 
scrolling, window  -> 
        synchronized  -> ,   -> ,   -> 
search
        Find  -> 
        General Search and Replace  -> 
        Name Search  -> 
        Name Search and Replace  -> 
        String Search  -> 
        String Search and Replace  -> 
search order
        mapped file  -> 
        script file  -> 
seconds in epoch from local time  -> 
Seconds in Epoch function  -> 
sector, see desktop
segment trace style  -> 
segv error  -> ,   -> ,   -> 
Segv Error Flag variable  -> 
`segvexit system variable  -> 
select error, adap  -> 
select... attributes  -> 
        arguments to selectable attribute function  -> 
        callbacks for
                select  -> 
                selectcol  -> 
                selectcorner  -> 
                selectfield  -> 
                selectrow  -> 
selection
        primary selection buffer  -> 
        row and column (t)  -> 
        window  -> 
Selective Assignment function  -> 
        see also Assignment function
        and dependencies  -> 
        Append  -> 
        assignment in place (performance)  -> 
        Brace Assignment  -> 
        causes callbacks  -> 
        defined functions in  -> 
        primitive functions in  -> 
        Replace All  -> 
        target of  -> 
        Value in Context on left  -> ,   -> 
        Value on left  -> ,   -> 
Selective specification (Selective Assignment function)  -> 
semantics of A+  -> 
Send, Asynchronous (adap)  -> 
Send, Synchronous (adap)  -> 
sensitive attribute  -> 
sent event (adap)  -> 
Separate Symbols function  -> 
server  -> 
        disconnect  -> 
service descriptor (adap)  -> 
service handle (adap)  -> 
set
        see also file, mapped file, attributes, write
        attribute  -> 
        difference (t tables)  -> 
        operations (t)  -> 
        Set Attribute Default Variables or Values function  -> 
        Set Attribute function  -> 
        Set Attribute Value (adap)  -> 
        Set Callback function  -> ,   -> 
        Set Client Data (adap)  -> 
        Set Client Data function  -> 
        Set Current CDE Workspace function  -> 
        Set Preset Callback function  -> ,   -> ,   -> 
        Set System Variable function  -> 
        Set Timer (adap)  -> 
_set system function  -> 
set... attributes  -> 
$Sf system command  -> 
`Sf system variable  -> 
_sfi system function  -> 
_sfmt system function  -> 
$sfs system command  -> 

shadowthickness attribute  -> 
shape  -> ,   -> 
        Shape function  -> ,   ->* 
shared libraries  -> 
shell  -> 
        invoking A+ from  -> 
shell... attributes  -> 
shells, list of: s.shells  -> 
show function  -> ,   -> 
show... attributes  -> 
$si system command  -> 
`si system variable  -> 
Sign function  -> 
Signal function  -> 
signalling errors from dynamically loaded code  -> 
simple array  -> ,   -> 
simple protocol (adap)  -> 
simultaneously mapped file, writing and reading  -> 
sine  -> 
single mode (adap read)  -> ,   -> 
singleton (scalar) extension  -> 
sinh  -> 
Size (Shape function)  -> 
size attribute  -> 
sleep: sys.sleep  -> 
slider display classes
        hgauge  -> 
        hscale  -> 
        vgauge  -> 
        vscale  -> 
slider... attributes  -> 
slot
        area  -> 
                index of  -> 
        display class  -> 
                arguments to attribute functions  -> 
slotfiller  -> 
        action display class  -> 
        determination  -> 
        for specifying attributes  -> 
        from association list  -> 
        slot display class  -> 
        to nested association list  -> 
        validation  -> 
        with boolean value  -> 
socket
        accept: sys.sockaccept  -> 
        block: sys.sockblock  -> 
        connect: sys.sockconnect  -> 
        fork exec: sys.sfe  -> 
        listen: sys.socklisten  -> 
        options, get: sys.getsockopt  -> 
        options, set: sys.setsockopt  -> 
        read
                and return status: sys.areadstat  -> 
                sys.aread  -> 
                timed: sys.areadwait  -> 
        write: sys.awrite  -> 

Solve function  -> 
Sort, see Grade down function, Grade up function, Bins function
sorted arguments for b-context functions  -> 
sorted derived table, dynamic (t)  -> 
source code, browsing  -> 
source for view (t)  -> 
space  -> 
space attribute  -> 
spacing in program definitions  -> 
_spcb system function  -> ,   -> ,   -> 
special character sequence  -> 
Specification (Assignment function)  -> 
spreadsheet  -> 
        also see dependency
SQL  -> 
_ss system function  -> 
_ssr system function  -> 
_ssv system function  -> 
stack references  -> 
        also see execution stack
stack trace style  -> 
Stale NFS file handle error report  -> 
Standard Input variable  -> 
stars attribute  -> 
stars indicating depth  -> 
starting A+
        from a shell  -> 
        from Emacs  -> ,   -> 
starting ws size  -> 
State Indicator command  -> 
state... attributes  -> 
statement, entry of  -> 
static data (for callback)  -> ,   -> 
static link, direct (t)  -> 
static linking of C and C++ routines  -> 
static scope  -> 
static summary, direct (t)  -> 
status indicators  -> 
Status of Read Queue (adap)  -> 
Status of Write Queue (adap)  -> 
stdin  -> 
`stdin system variable  -> 
step trace style  -> 
stepscatter trace style  -> 
sticky contained object, resizing  -> 
sticky fields (fixedfields attribute)  -> 
Stop
        primitive function  -> 
        system command  -> 
        system variable  -> 
        within protected execution  -> 
$stop system command  -> 
`stop system variable  -> 
storage  -> 
        backing, inhibiting use  -> 
Store (c.place...)  -> 
strand  -> 
        Assignment  -> ,   -> 
        syntax of  -> 
strdup()  -> 
stream protocol (adap)  -> 
string  -> 
string protocol (adap)  -> 
string search
        also see search
        String Search and Replace function  -> 
        String Search function  -> 
structure
        attribute (s)  -> 
        c  -> 
                also see c context
        of data  -> 
style attribute  -> ,   -> 
        arguments to attribute function  -> 
Sub (Bracket Indexing function)  -> 
subclasses, list of: s.subClasses  -> 
subframe  -> 
subtitle... attributes  -> 
Subtract function  -> 
subtypes  -> 
Successive Grouping function (t)  -> 
summarization function (t)  -> 
summary, direct static (t)  -> 
Summation (Reduce operator, with Add)  -> 
superclasses, list of: s.superClasses  -> 
supertypes  -> 
suppressduplicate attribute  -> 

suspended function  -> 
        abandoning execution  -> 
        clearing  -> 
        resuming execution  -> 
symbol  -> 
        attribute  -> ,   -> 
                arguments to attribute function  -> 
        constant, syntax of  -> 
        set  -> 
        type  -> 
symbolic link, create  -> 
symbols
        APL, see Symbols section of index or Table B-1(a)
        in c  -> 
symbolsize attribute  -> ,   -> 
        arguments to attribute function  -> 
Synchronize a Mapped File: sys.amsync  -> 
synchronized scrolling  -> ,   -> ,   -> 
synchronous communication (adap)  -> 
Synchronous Exchange (adap)  -> 
Synchronous Read (adap)  -> 
Synchronous Send (adap)  -> 
syncshow attribute  -> 
syntactic class  -> 
syntax of A+  -> 
sys context  -> 
sys. ... (subindex of sys context functions)
system
        attribute default variable  -> 
        call: sys.system  -> 
        command  -> 
                see also system commands
                classification of every  -> 
                definition of every  ->  -   ->end
                for dependencies  -> 
                syntax of  -> 
                through Execute  -> 
        commands, see separate entry
        function  -> 
                see also system functions
                classification of every  -> 
                definition of every  ->  -   ->end
                error reports (common)  -> 
                for dependencies  -> 
                name argument for  -> 
                querying syntax  -> 
                tracing of  -> 
        functions, see separate entry
        name, syntax of  -> 
        time  -> 
        variable  -> 
                see also system variables
                classification of every  -> 
                definition of every  ->  -   ->end
                name domain  -> 
                referencing  -> 
                setting  -> 
                values of several  -> 
        variables, see separate entry
system commands
        see also system command
        $| (Pipe)  -> 
        $< (Pipe In)  -> 
        $> (Pipe Out)  -> 
        $>> (Pipe Out Append)  -> 
        $cd  -> 
        $cmds  -> 
        $cx  -> 
        $cxs  -> 
        $dbg  ->* ,   -> 
        $def  -> ,   -> 
        $dep  -> ,   -> 
        $deps  -> ,   -> 
        $Df  -> 
        $Ef  -> 
        $ex  -> 
        $excxt  -> 
        $fns  -> 
        $Gf  -> 
        $globs  -> 
        $load  -> 
        $loadrm  -> 
        $maplim  -> 
        $mode  -> 
        $off  -> 
        $ops  -> 
        $pp  -> 
        $reset  -> 
        $rl  -> 
        $Sf  -> 
        $sfs  -> 
        $si  -> 
        $stop  -> 
        $Tf  -> 
        $undef  -> 
        $vars  -> 
        $vers  -> 
        $wa  -> 
        $Xf  -> 
        $xfs  -> 
system functions
        see also system function
        _abortload  -> 
        _alldep  -> ,   -> 
        _alsf  -> 
        _atts  -> 
        _cd  -> 
        _cfi  -> 
        _dbg  -> 
        _def  -> ,   -> 
        _dep  -> ,   -> 
        _dyld  -> 
        _ex  -> 
        _excxt  -> 
        _exit  -> 
        _fi  -> 
        _flat  -> 
        _fmt  -> 
        _gcb  -> 
        _gcd  -> 
        _get  -> 
        _gfmtsym  -> 
        _gpcb  -> 
        _gsr  -> 
        _gsv  -> 
        _hashstat  -> 
        _index  -> 
        _index_of  -> 
        _issf  -> 
        _items  -> 
        _load  -> 
        _loadrm  -> 
        _locals  -> 
        _name  -> 
        _nanfind  -> 
        _nc  -> 
        _nl  -> ,   -> 
        _ns  -> 
        _nsr  -> 
        _profile  -> 
        _scb  -> ,   -> ,   -> 
        _scd  -> 
        _scfi  -> 
        _set  -> 
        _sfi  -> 
        _sfmt  -> 
        _spcb  -> ,   -> ,   -> 
        _ss  -> 
        _ssr  -> 
        _ssv  -> 
        _undef  -> 
        _valence  -> 
        _wa  -> 
System Functions command  -> 
system variables
        see also system variable
        `busexit  -> 
        `corelim  -> 
        `cx  -> 
        `Df  -> 
        `dyme  -> 
        `Ef  -> 
        `Gf  -> 
        `language  -> 
        `loadfile  -> 
        `majorRelease  -> 
        `maplim  -> 
        `minorRelease  -> 
        `mode  -> 
        `phaseOfRelease  -> 
        `pp  -> 
        `releaseCode  -> 
        `rl  -> 
        `segvexit  -> 
        `Sf  -> 
        `si  -> 
        `stdin  -> 
        `stop  -> 
        `Tf  -> 
        `vers  -> 
        `Xf  -> 
        `Xfpef  -> 

About the Index

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_86s.html0000444000265000001440000002603210737165265014045 A+ Reference: Index - s Context Functions, Variables

Index - s. ... (s Context Functions and Variables)

s.ABORT parameter  -> 
s.are function  -> 
s.attributes function  -> 
s.AUTOBLANK parameter  -> 
s.AUTOBUILD variable  -> ,   -> 
s.AUTODOC variable  -> 
s.AUTOEDITSPACE switch  -> 
s.AUTOEVALUATE switch  -> 
s.AUTOEXECUTE switch  -> 
s.AUTOHAS switch  -> 
s.AUTONEWSHOW switch  -> 
s.AUTOPOSITION switch  -> 
s.AUTOPRINTABLE switch  -> 
s.AUTOREPARENT switch  -> 
s.AUTOREPARENT switch  -> 
s.AUTORESHOW switch  -> ,   -> 
s.AUTORESPACE switch  -> 
s.AUTOSCRIPT switch  -> 
s.AUTOWS switch  -> 
s.BACKINGSTORE switch  -> 
s.BEEP parameter  -> 
s.beHere function  -> 
s.BLACK system attribute default variable  -> 
s.BLUE system attribute default variable  -> 
s.boundTo function  -> 
s.box function  -> 
s.BUSY parameter  -> 
s.c3c function  -> 
s.c3h function  -> 
s.call function  -> 
s.canBe function  -> 
s.canHave function  -> 
s.cc3 function  -> 
s.CDE dependency  -> 
s.ch function  -> 
s.classes function  -> 
s.classesHaving function  -> 
s.classHas function  -> 
s.CLOCK parameter  -> 
s.closest function  -> 
s.color function  -> 
s.COLOR_NAMES variable  -> 
s.COLOR_NUMBERS variable  -> 
s.CONNECTED parameter  -> 
s.copy function  -> 
s.DATASPACE parameter  -> 
s.defaultOf function  -> 
s.derivedFrom function  -> 
s.desktop function  -> 
s.DISCONNECT parameter  -> 
s.doc function  -> 
s.doesNotUse function  -> 
s.domainOf function  -> 
s.DOUBLECLICKINTERVAL parameter  -> 
s.EDITSPACE parameter  -> 
s.ERROR parameter  -> 
s.execute function  -> 
s.EXIT parameter  -> 
s.FILLCOLORS parameter  -> 
s.font function  -> 
s.FONT system attribute default variable  -> 
s.FONT_NAMES variable  -> 
s.functions function  -> 
s.GREEN system attribute default variable  -> 
s.GREY system attribute default variable  -> 
s.Has function  -> 
s.hasDefault function  -> 
s.hc function  -> 
s.hc3 function  -> 
s.hscroll function  -> 
s.LINECOLORS parameter  -> 
s.LINESTYLES parameter  -> 
s.load function  -> 
s.MENUDEFAULTMNEMONIC switch  -> 
s.metaClasses function  -> 
s.MSG parameter  -> 
s.NA parameter  -> 
s.objects function  -> 
s.Of function  -> 
s.ofClass function  -> 
s.ofParent function  -> 
s.parentHas function  -> 
s.popups function  -> 
s.primitiveTo function  -> 
s.QUIET parameter  -> 
s.ral function  -> 
s.realClasses function  -> 
s.RED system attribute default variable  -> 
s.refresh function  -> 
s.reset function  -> 
s.rsf function  -> 
s.save function  -> 
s.SCREEN parameter  -> 
s.script function  -> 
s.setcurrentws function  -> 
s.shade function  -> 
s.SHELL parameter  -> 
        reversing the effect  -> 
s.shells function  -> 
s.subClasses function  -> 
s.superClasses function  -> 
s.this function  -> 
s.toplevels function  -> 
s.TRACESYMBOLS parameter  -> 
s.used function  -> 
s.usedBy function  -> 
s.uses function  -> 
s.using function  -> 
s.VERIFY parameter  -> 
s.virtualClasses function  -> 
s.vscroll function  -> 
s.warpPointer function  -> 
s.which function  -> 
s.WP parameter  -> 
s.WS parameter  -> 
s.wslist function  -> 
s.WSNAME parameter  -> 
s.wstree function  -> 
s.YELLOW system attribute default variable  -> 

About the Index

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_86sys.html0000444000265000001440000002042510737165265014421 A+ Reference: Index - sys Context Functions

Index - sys. ... (sys Context Functions)

sys.access function (file)  -> 
sys.agetdents function  -> 
sys.alstat function (file)  -> 
sys.amsync function (file)  -> 
sys.aread function  -> 
sys.areadlink function  -> 
sys.areadstat function  -> 
sys.areadwait function  -> 
sys.aselect function  -> 
sys.astat function (file stats)  -> 
sys.awrite function  -> 
sys.chdir function  -> 
sys.chmod function  -> 
sys.chown function  -> 
sys.close function (close file)  -> 
sys.closelog function  -> 
sys.cpu function  -> 
sys.creat function (create file)  -> 
sys.dup function (file descriptor)  -> 
sys.dup2 function (file descriptor)  -> 
sys.errno function  -> 
sys.errsym function  -> 
sys.exit function  -> 
sys.exp function  -> 
sys.export function  -> 
sys.fchmod function  -> 
sys.fchown function  -> 
sys.fcntl function  -> 
sys.fflush_stdout function  -> 
sys.filesize function  -> 
sys.flock function (file lock)  -> 
sys.fsync function (file synch)  -> 
sys.ftruncate function (file)  -> 
sys.getdomainname function  -> ,   -> 
sys.getdtablesize function (file descriptors)  -> 
sys.geteuid function  -> 
sys.getgid function  -> 
sys.gethostname function  -> 
sys.getpid function  -> 
sys.getppid function  -> 
sys.getsockopt function  -> 
sys.gettod function  -> 
sys.getuid function  -> 
sys.getusername function  -> 
sys.imp function  -> 
sys.import function  -> 
sys.ioctl function  -> 
sys.kill function  -> 
sys.link function  -> 
sys.lseek function (file pointer)  -> 
sys.mkdir function  -> 
sys.mkts1 function  -> 
sys.open function (file)  -> 
sys.openlog function  -> 
sys.pathfind function (file)  -> 
sys.perror function  -> 
sys.read function (file)  -> 
sys.readenv function  -> 
sys.readinto function  -> 
sys.readmat function  -> 
sys.rename function (file)  -> 
sys.rmdir function  -> 
sys.secs_in_epoch function  -> 
sys.setenv function  -> 
sys.setsockopt function  -> 
sys.sfe function  -> 
sys.sleep function  -> 
sys.sockaccept function  -> 
sys.sockblock function  -> 
sys.sockconnect function  -> 
sys.socklisten function  -> 
sys.symlink function  -> 
sys.syslog function  -> 
sys.system function  -> 
sys.truncate function (file)  -> 
sys.ts function  -> 
sys.ts1 function  -> 
sys.ts1gmt function  -> 
sys.tsgmt function  -> 
sys.tzset function  -> 
sys.umask function (file)  -> 
sys.unlink function  -> 
sys.updtime function (file)  -> 
sys.username function  -> 
sys.write function (file)  -> 
sys.zombiekiller function  -> 

About the Index

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_87.html0000444000265000001440000003614510737165266013672 A+ Reference: Index - T

Index - T

t attribute (s)  -> 
t context  -> 
        _A  -> 
        _D  -> 
        _D_  -> 
        _F  -> 
        _G_r  -> 
        _H_l  -> 
        _I_l  -> 
        _J  -> 
        _J_r  -> 
        _K  -> 
        _K_r  -> 
        _L  -> 
        _L_  -> 
        _M  -> 
        _N  -> 
        _O  -> 
        _R  -> 
        _R_  -> 
        _S  -> 
        _S_  -> 
        _T  -> 
        _T_  -> 
        _U  -> 
        _V  -> 
        _V_  -> 
        selector functions  -> 
        t-created variables and dependencies  -> 
        variables  -> 
t.also function  -> 
t.always function  -> 
t.break function  -> 
t.calendar function  -> 
t.cat function  -> 
t.close function  -> 
t.CONNECT variable  -> 
t.define function  -> 
t.detach function  -> 
t.disperse function  -> 
t.fix function  -> 
t.group function  -> 
t.group_d function  -> 
t.group_i function  -> 
t.in function  -> 
t.index function  -> 
t.let function  -> 
t.link function  -> 
t.link_b function  -> 
t.link_d function  -> 
t.link_i function  -> 
t.na function  -> 
t.NA variable  -> 
t.not function  -> 
t.only function  -> 
t.open function  -> 
t.partition function  -> 
t.relate function  -> 
t.report function  -> 
t.reset function  -> 
t.sample function  -> 
t.send function  -> 
t.series function  -> 
t.sort function  -> 
t.sorted function  -> 
t.table function  -> 
t.TABLES variable  -> 
t.view function  -> 
tab character  -> 
tab... attributes  -> 
table
        see also matrix
        dependency (t)  -> 
        display class  -> 
                arguments to attribute functions  -> 
                moving about in  -> 
                moving columns by dragging  -> ,  ->* 
                resizing columns by dragging  -> ,   ->* 
                user interaction with  -> 
        in t  -> 
                linked tables  -> 
        matrix  -> 
        variable (t)  -> 
tableField display class
        arguments to attribute functions  -> 
        child of display class table  -> 
tabs of notebook: showtabs attribute  -> 
tabs, used in function definition  -> 
Take function  -> ,   -> 
        fill elements  -> 
Tally (Count function)  -> 
tangent  -> 
tanh  -> 
target
        Assignment  -> ,   -> 
        for view (t)  -> 
        Selective Assignment  -> 
Terminal Flag command  -> 
Terminal Flag variable  -> 
terms used in this manual  -> 
terms, data  -> 
text
        areas of a graph  -> 
        clipping  -> ,   -> 
        display class  -> 
                arguments to attribute functions  -> 
                user interaction with  -> 
        trace (of graph)  -> 
                manipulation  -> 
                style  -> 
textactivate attribute  -> 
        callbacks for  -> 
$Tf system command  -> 
`Tf system variable  -> 

3down attribute  -> 
        callbacks for  -> 
3up attribute  -> 
        callbacks for  -> 
time
        cpu (process)  -> 
        elapsed  -> 
        format  -> 
        GMT  -> 
        GMT, from seconds in epoch  -> 
        local  -> 
        local, from seconds in epoch  -> 
        of day  -> 
        Reset Time Zone  -> 
        seconds in epoch  -> 
        seconds in epoch from local  -> 
        system  -> 
        Time function  -> 
        Time in Seconds function  -> 
        time series (t)  -> 
        user  -> 
timeout, adap  -> 
        error  -> 
        Get Timeout  -> 
timer  -> 
        events (adap)  -> 
        handle (adap)  -> 
        Modify Timer (adap)  -> 
        Set Timer (adap)  -> 
Times (Multiply function)  -> 
timing functions and expressions  -> 
        primitive function execution counts  -> 
title... attributes  -> 
        title  -> ,   -> 
                default setting  -> 
        titles (pagetitle)  -> 
tolerably equal  -> ,   -> 
tolerance, comparison  -> 
top... attributes  -> 
top-level window  -> 
        default creation (s.SHELL)  -> 
        list of every: s.toplevels  -> 
trace (set), graph  -> 
tracing  -> 
        see also debugging
        dependencies  -> 
        depth of  -> 
        of Execute (Protected or not)  -> 
        of Monadic Do  -> 
tracking files  -> 
trailing axis (dimension)  -> ,   -> 
transcendental function  -> 
Transpose Axes function  -> 
Transpose function  -> 
Transpose, dyadic (Transpose Axes function)  -> 
traversal
        window  -> 
        within a display object  -> 
        within a layout  -> 
Tree Dependency function  -> 
tree display class  -> 
        arguments to attribute functions  -> 
        user interaction with  -> 
trigonometric functions  -> 

tutorial scripts
        A+ (general)  -> 

        t (database)  -> 
2down attribute  -> 
        callbacks for  -> 
2up attribute  -> 
        callbacks for  -> 
type  -> ,   -> 
        change
                Bitwise Cast derived function  -> 
                Cast function  -> 
                Ceiling function  -> 
                Default Format function  -> 
                fix input functions  -> ,   -> ,   -> ,   -> 
                Floor function  -> 
                Format function  -> 
                Pack function  -> 
                Unpack function  -> 
        general  -> 
Type function  -> ,   -> 

About the Index

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_88.html0000444000265000001440000000626610737165266013674 A+ Reference: Index - U

Index - U

uextInstall function (for static link)  -> 
Uncover (Disclose function)  -> 
$undef system command  -> 
_undef system function  -> 
underline attribute  -> 
        arguments to attribute function  -> 
undo  -> 
Unequal (Not equal to function)  -> 
UNI mode (input)  -> 
uniform
        complementary frames  -> 
        counts  -> 
        frames  -> 
uniformscaling attribute  -> 
union (t tables)  -> 
Unix  -> 
        commands  -> 
        file name  -> 
        reading file from cache page  -> 
        running A+ from  -> 
        system call  -> ,   -> 
        text files  -> 
unknown type  -> 
unlink file  -> 
unmapping of files, tracing  -> 
Unpack function  -> 
upto attribute  -> 
Use Variables function (s)  -> 
user interactions with displays  -> 

user name
        qualified  -> 
        syntax of  -> 
        unqualified  -> 
User Name from ID function: sys.username  -> 
User Name function: sys.getusername  -> 
user time  -> 
Users of a Variable function  -> 

About the Index

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_89.html0000444000265000001440000001420210737165266013662 A+ Reference: Index - V

Index - V

valence  -> 
        derived function  -> 
Valence function  -> 
_valence system function  -> 
valid... attributes  -> 
        callbacks for validate  -> 
value
        area
                in the choice display class  -> 
                in the command display class  -> 
        of a name  -> 
        of an attribute  -> 
        Value function  -> 
                Assignment  -> 
        Value in Context function  -> 
                Assignment  -> 
        Values of Attributes for a Class function (s)  -> 
value... attributes  -> 
variable  -> 
        attribute  -> 
        callback function for  -> 
        display format  -> 
        Emacs A+ mode variables  -> 
        for attribute
                get, s.Of  -> 
                no longer use, s.doesNotUse  -> 
                set, s.Has  -> 
                system default  -> 
                use, s.uses  -> 
                users of, s.using  -> 
        global  -> 
        local  -> 
        name, removing from a display  -> 
        value in workspace  -> 
        value on screen  -> 
        Variable Can Be of Class function  -> 
        Variables command  -> 
        visual representation  -> ,   -> 
$vars system command  -> 
vcol... attributes  -> 
vector  -> 
verify attribute  -> 
$vers system command  -> 
`vers system variable  -> 
Version command  -> 
Version variable  -> 
verticalspace attribute  -> 
vgauge display class  ->* ,  -> 
vgrid display class  ->* ,  -> 
        arguments to attribute functions  -> 
view
        display class  -> 
                arguments to attribute functions  -> 
        fixing (t)  -> 
        populate a t table  -> 
        t  -> 
viewing a PostScript file (printfile)  -> 
virtual
        classes, list of: s.virtualClasses  -> 
        column  -> ,   -> ,   -> 
        desktop, see just desktop
        row  -> ,   -> ,   -> 
visibility
        popup (pin attribute)  -> 
        toplevel (exit attribute)  -> 
visible use of name  -> ,   -> 
visual class, see display class
visualization of data  -> 
vmenu display class  -> ,   -> 
        arguments to attribute functions  -> 
vpane display class  -> ,   -> 
        arguments to attribute functions  -> 
vrow... attributes  -> 
vscale display class  -> ,  -> ,  -> 
        user interaction with  -> 
vscroll... attributes  -> 

About the Index

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_9.html0000444000265000001440000002201610737165267013575 A+ Reference: Representation of Numbers

Representation of Numbers


The machines on which A+ is run represent numbers in binary (base 2), for efficient storage and computation. A+ (via C) represents integers in 32 bits (binary digits) and floating-point numbers in 64. The largest integer representable in this way is (2*31)-1 and the smallest is 2*31 (-2147483648); the greatest magnitude representable as a floating-point number is approximately 1.7977e+308.

In display and print, of course, A+ represents numbers in decimal. People tend to think in decimal and their input is usually decimal. Numbers like .1 and .01 seem exactly representable intrinsically (as they are in decimal), but, in fact, these numbers cannot be exactly represented in binary, and decimal to binary and binary to decimal conversions are one source of imprecision.

Another source of imprecision is the necessarily limited number of digits that can be used to represent a number. One effect of this limitation is inexactitude, which can be seen in simple examples:

     123456789123456789 - 123456789123456788
 0
     12345678912345679 - 12345678912345678
 2
     .123456789123456789 - .123456789123456788
 0

and yet:

.000000000000000001 1e-18

Another effect of this limitation is, of course, that there are numbers that are simply too large to be numerically represented in A+ at all, such as 10*1234.

Results can only be meaningfully displayed out to a maximum of 16 digits. Any digits shown beyond the 16th digit are invalid. For example, the actual value of pi begins with 3.141592653589793238; but if we set $pp to 20 (a value that is beyond the meaningful range), o1 will return 3.141592653589793116. Only the first 16 digits are correct.

To allow for slight imprecisions in the representation of numbers by considering numbers to be equal when they are very close to equal, the concept of a comparison tolerance is used. To allow computations to continue when some of the numbers involved have become too large to be represented, a special representation, Inf, has been introduced, together with its negative, Inf.

Comparison Tolerance

Comparison tolerance cannot be set; it is fixed at 1e-13.

It is used in both conversion of floating-point numbers to integers and explicit comparisons, as in Equal to, Match, and Find.

The fundamental notion is to put a band around one of the comparands and see whether the other comparand falls within that band. Consider x=y, for instance. Roughly speaking, the equality holds if x is within (without tolerance, of course) the interval from y1-1e-13 to y1+1e-13. More precisely, the difference between the comparands must be less (without tolerance) than the tolerance times the smaller of them in absolute value: |x-y must be less than 1e-13(|x)|y. Because multiplication is involved, only zero is equal to zero within the comparison tolerance.

Comparison tolerance applies only to floating-point comparisons. The largest magnitude that can be represented in A+ in integer type is 2*31, which is |2*31. That times the tolerance, i.e., 1e-132*31, is only about 0.0002. Thus the tolerance could not have any effect on comparisons between two integers.

When examining the effect, or apparent effect, of comparison tolerance, you must take into account the printing precision (which may make two unequal numbers look equal) and the fact that the Equal to function itself uses comparison tolerance. As an intolerant check for equality of a and b, you can use 0=a-b.

Consider numbers shown in an example above, where their difference was approximated as 2:

     12345678912345679 = 12345678912345678
1
Clearly, Equal to uses comparison tolerance to arrive at the result: A+ disregards the insignificant (and in fact inexact) difference it finds between them. But doesn't comparison tolerance apply only to floating-point numbers? Yes, but there are several ways to enter numbers for representation in floating point: e.g., with a decimal point (99. or 3.14, for instance), in exponential notation (6.023e-23), and with too many digits for it to be represented internally as an integer (12345678912345679). Each number entered is converted to its internal representation before anything else is done with it.

Comparison tolerance is used in:

  • Ceiling, Floor, and Residue;
  • Equal to, Greater than, Greater than or Equal to, Less than, Less than or Equal to, and Not equal to;
  • Find, Match, and Member;
and no other functions.

When two floating-point numbers are equal within the comparison tolerance, they are called tolerably equal. This term is also used in a more general way, to mean equal within the tolerance for floating-point numbers and strictly equal where no floating-point number is involved.

Note that the term restricted whole number, as discussed above and in "Restricted Whole Numbers", involves even more toleration, since it includes numbers whose absolute value is less than 1e-13, whereas zero is not tolerably equal to any nonzero number.

Arithmetic of Inf

A+ uses Inf to denote positive numbers too large for it to represent, and Inf for negative numbers whose magnitude is too great to be represented. Inf is tantamount to infinity. You can enter these notations directly; also, if you enter, say, 1e309, it will be shown and stored as Inf.

Instead of a domain error, division by zero of a positive number yields Inf, and of a negative number, Inf. The Min reduction of an empty vector yields Inf, and the Max reduction yields Inf. And so on.

When either of these values is an argument to a function, most of what you might expect happens: -Inf is Inf, and Inf is 1, and 4Inf is 4.

Any operation which heightens Inf or Inf produces it as its result: 10Inf is Inf, and Inf-100 is Inf, and Inf+Inf is Inf, and so forth. Operations involving representable numbers that tend to lessen Inf or Inf are also accepted, however, so that, for example, Inf-1e99 is Inf. (Indeed, although they are unlikely to occur, 1e3091e308 is Inf and 1e3081e309 is 0, because 1e309 is converted to Inf upon input, before the division, and 1e308 is representable.)

Domain errors result from indeterminate expressions like Inf-Inf and 0Inf, as well as 00.

NaN

A+ does not handle NaN (Not a Number) but it provides tools that let you detect NaN's. See the _nanfind system function and the $dbg command, especially the table "$dbg Subcommands (Arguments)".

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_90.html0000444000265000001440000000663310737165267013664 A+ Reference: Index - W

Index - W

W attribute  -> 
w attribute  -> 
$wa system command  -> 
_wa system function  -> 
warning message  -> ,   -> 
        C  -> 
wBufsize (adap)  -> 
well-formed expression  -> 
while statement  -> ,   -> 
        syntax of  -> 
whole number, restricted  -> ,   -> 
widget  -> 
window  -> 
        body  -> 
        display class  -> 
                arguments to attribute functions  -> 
wNodelay (adap)  -> 
workspace  -> 
        screen workspace  -> ,   -> ,   -> 
        tracing Work Area and Workspace Available  -> 
        Work Area function  -> 
        Workspace Available command  -> 
Workstation and Port Information (adap)  -> 
wPause (adap)  -> 
wPriority (adap)  -> 
wQueueStatus (adap)  -> 
write
        see also file, mapped file, attributes, set
        file  ->  -   ->end
                Pipe Out Append command  -> 
                Pipe Out command  -> 
        primary selection buffer  -> 
        Write Queue Status (adap)  -> 
ws attribute  -> 
wsfull error  -> 
        atmp  -> 
        error code  -> 
        resumption with increased workspace  -> 

About the Index

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_91.html0000444000265000001440000000564410737165267013666 A+ Reference: Index - X

Index - X

X attribute  -> 
x attribute  -> 
x context (unavailable in A+)  -> 
X event  -> 
        disabling  -> 
        enabling  -> 
        X Events Flag command  -> 
        X Events Flag variable  -> 
xaxis attribute  -> ,   -> 
        arguments to attribute function  -> 
xextent attribute  -> 
$Xf system command  -> 
`Xf system variable  -> 
xfg attribute  -> 
`Xfpef system variable  -> 
$xfs system command  -> 
xinc attribute  -> 
xlabel... attributes  -> 
        arguments to xlabel attribute function  -> 
        arguments to xlabelout attribute function  -> 
xleft attribute  -> 
xlegend attribute  -> 
xlsfonts  -> 
xmajorticksize attribute  -> 
xmax attribute  -> 
xmin attribute  -> 
xminortick... attributes  -> 
xright attribute  -> 
xs attribute  -> 
xsublabel... attributes  -> 
        arguments to xsublabel attribute function  -> 
        arguments to xsublabelout attribute function  -> 
XTerm  -> 
xtitle... attributes  -> 

About the Index

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_92.html0000444000265000001440000000520510737165270013652 A+ Reference: Index - Y-Z

Index - Y-Z

Y attribute  -> 
y attribute  -> 
yaxis attribute  -> ,   -> 
        arguments to attribute function  -> 
ybottom attribute  -> 
ylabel... attributes  -> 
        arguments to ylabel attribute function  -> 
        arguments to ylabelout attribute function  -> 
ylegend attribute  -> 
ymode attribute  -> ,   -> 
ys attribute  -> 
ytitlestyle attribute  -> 
ytop attribute  -> 
YX attribute  -> 
yx attribute  -> 
yxs attribute  -> 

zero attribute  -> 
zero axes of graphs  -> 
zero length message, adap  -> 
zerofg attribute  -> 
zerostyle attribute  -> 
zerowidth attribute  -> 

zooming  -> 

        graph  -> ,   -> 
                detecting  -> 
                undoing programmatically  -> 

About the Index

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_92sc.html0000444000265000001440000001040310737165270014174 A+ Reference: Index - $ (System Commands)

Index - $ (System Commands)


$| (Pipe) system command  -> 
$< (Pipe In) system command  -> 
$> (Pipe Out) system command  -> 
$>> (Pipe Out Append) system command  -> 
$cd system command  -> 
$cmds system command  -> 
$cx system command  -> 
$cxs system command  -> 
$dbg system command  ->* ,   -> 
$def system command  -> ,   -> 
$dep system command  -> ,   -> 
$deps system command  -> ,   -> 
$Df system command  -> 
$doErrorStack system command  -> 
$Ef system command  -> 
$ex system command  -> 
$excxt system command  -> 
$fns system command  -> 
$Gf system command  -> 
$globs system command  -> 
$load system command  -> 
$loadrm system command  -> 
$maplim system command  -> 
$mode system command  -> 
$off system command  -> 
$ops system command  -> 
$pp system command  -> 
$reset system command  -> 
$rl system command  -> 
$Sf system command  -> 
$sfs system command  -> 
$si system command  -> 
$stop system command  -> 
$Tf system command  -> 
$undef system command  -> 
$vars system command  -> 
$vers system command  -> 
$wa system command  -> 
$Xf system command  -> 
$xfs system command  -> 

About the Index

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_92sf.html0000444000265000001440000001311410737165270014201 A+ Reference: Index - _ (System Functions)

Index - _ (System Functions)


System Functions command  -> 

_abortload system function  -> 
_alldep system function  -> ,   -> 
_alsf system function  -> 
_atts system function  -> 
_cd system function  -> 
_cfi system function  -> 
_dbg system function  -> 
_def system function  -> ,   -> 
_dep system function  -> ,   -> 
_doErrorStack system function  -> 
_dyld system function  -> 
_ex system function  -> 
_excxt system function  -> 
_exit system function  -> 
_fi system function  -> 
_flat system function  -> 
_fmt system function  -> 
_gcb system function  -> 
_gcd system function  -> 
_get system function  -> 
_gfmtsym system function  -> 
_gpcb system function  -> 
_gsr system function  -> 
_gsv system function  -> 
_hashstat system function  -> 
_index system function  -> 
_index_of system function  -> 
_issf system function  -> 
_items system function  -> 
_load system function  -> 
_loadrm system function  -> 
_locals system function  -> 
_name system function  -> 
_nanfind system function  -> 
_nc system function  -> 
_nl system function  -> ,   -> 
_ns system function  -> 
_nsr system function  -> 
_profile system function  -> 
_scb system function  -> ,   -> ,   -> 
_scd system function  -> 
_scfi system function  -> 
_set system function  -> 
_sfi system function  -> 
_sfmt system function  -> 
_spcb system function  -> ,   -> ,   -> 
_ss system function  -> 
_ssr system function  -> 
_ssv system function  -> 
_undef system function  -> 
_valence system function  -> 
_wa system function  -> 

About the Index

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_92sv.html0000444000265000001440000000611210737165271014222 A+ Reference: Index - ` (System Variables)

Index - ` (System Variables)


`busexit system variable  -> 
`CCID system variable  -> 
`corelim system variable  -> 
`cx system variable  -> 
`Df system variable  -> 
`doErrorStack system variable  -> 
`dyme system variable  -> 
`Ef system variable  -> 
`Gf system variable  -> 
`language system variable  -> 
`loadfile system variable  -> 
`majorRelease system variable  -> 
`maplim system variable  -> 
`minorRelease system variable  -> 
`mode system variable  -> 
`phaseOfRelease system variable  -> 
`pp system variable  -> 
`releaseCode system variable  -> 
`rl system variable  -> 
`segvexit system variable  -> 
`Sf system variable  -> 
`si system variable  -> 
`stdin system variable  -> 
`stop system variable  -> 
`Tf system variable  -> 
`vers system variable  -> 
`Xf system variable  -> 
`Xfpef system variable  -> 

About the Index

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_93.html0000444000265000001440000102432310757555365013670 A+ Reference: Entire Index

Entire Index to the A+ Reference Manual

This file is intended to allow you to use the browser's Find popup to locate a term whose initial letters you are not sure of. It is simply the concatenation of all the separate sections of the index.

Instead of page numbers, which are meaningless online, arrows are used for references. When there is more than one reference for an entry, commas separate the references. If there are several references and one is principal, that one has an asterisk after its arrow.

For long sections, where a range of pages is shown in the printed version, a link to the end of the section is shown with "end" following the arrow. Links following see or see also or also see lead to other index entries; if there are several, they are separated by and, or, or a comma.

Common alternate names for primitive functions and operators are listed with the preferred name in parenthesis and a link to the page on which it is defined. The parenthesized name constitutes a see reference but you have a direct path to the principal reference. Certain other terms are also listed in this form.

The special APL symbols are included here, as are the English names of the functions and operators that they represent. The symbols are listed in the order of the English names; when there are several names corresponding to a symbol, it is listed under each, with subentries for the others. The symbols can also be found (with links) in the table at the beginning of Appendix B, "Quick Reference", as can complete tables of the system functions, variables, and commands. The latter are listed here in the index under the headings "system functions", "system variables", and "system commands", as well as separately.

The "Display Attributes" table lists all attributes alphabetically and summarizes certain of their properties. It includes references to further information about individual attributes (marked "more", or "cb" or "fn", for callback or functional information).

A list of the display classes is given in this index under "display classes"; also, the contents frame at left lists all display classes.


Index - Symbols

Links within this section:
< = > ^ \ / % | ! [] + - ~ # * @ ? , . .

$...   -> , -> 
also see system commands
~  in Unix commands, $unxcmd ...~...  -> 
&...   -> 
_...   -> 
also see  system functions
_argv variable  -> ,   -> 
`...   -> 
also see  system variables
  Abandon execution  -> 
|  Absolute value  -> 
Residue  -> 
+  Add  -> 
Identity  -> 
^  And  -> 
Stop  -> 
  Apply  -> 
Each  -> 
  Assignment  -> 
Result  -> 
Selective Assignment  -> 
  Bins  -> 
Grade up  -> 
[] Bracket Indexing  -> 
  Cast  -> 
Or  -> 
Type  -> 
,  Catenate  -> 
Ravel  -> 
  Ceiling  -> 
Max  -> 
#  Choose  -> 
Count  -> 
  Circle  -> 
Pi times  -> 
  Combine Symbols  -> 
Separate Symbols  -> 
/  Compress  -> 
Reduce  -> 
Replicate  -> 
#  Count  -> 
Choose  -> 
?  Deal  -> 
Roll  -> 
  Decode  -> 
Pack  -> 
  Default Format  -> 
Format  -> 
  Depth  -> 
Match  -> 
>  Disclose  -> 
Greater than  -> 
  Divide  -> 
Reciprocal  -> 
  Drop  -> 
Print  -> 
  Each  -> 
Apply  -> 
<  Enclose  -> 
Less than  -> 
  Encode  -> 
Unpack  -> 
=  Equal to  -> 
  Execute  -> 
Execute in Context  -> 
\  Expand  -> 
Scan  -> 
*  Exponential  -> 
Power  -> 
  Find  -> 
Interval  -> 
  Floor  -> 
Min  -> 
  Format  -> 
Default Format  -> 
  Grade down  -> 
  Grade up  -> 
Bins  -> 
>  Greater than  -> 
Disclose  -> 
  Greater than or Equal to  -> 
  High minus  -> 
+  Identity  -> 
Add  -> 
.  Inner Product  -> 
  Interval  -> 
Find  -> 
!  Item Ravel  -> 
Restructure  -> 
~  Laminate  -> 
Not  -> 
  Left  -> 
Null  -> 
<  Less than  -> 
Enclose  -> 
  Less than or Equal to  -> 
  Log  -> 
Natural log  -> 
  Map  -> 
Map In  -> 
  Match  -> 
Depth  -> 
  Matrix Inverse  -> 
Solve  -> 
  Max  -> 
Ceiling  -> 
  Member  -> 
Rake  -> 
  Min  -> 
Floor  -> 
  Multiply  -> 
Sign  -> 
  Natural log  -> 
Log  -> 
-  Negate  -> 
Subtract  -> 
~  Not  -> 
Laminate  -> 
  Not equal to  -> 
  Null  -> 
Left  -> 
  Or  -> 
Cast  -> 
Type  -> 
. Outer Product  -> 
  Pack  -> 
Decode  -> 
  Partition  -> 
Partition Count  -> 
  Pi times  -> 
Circle  -> 
  Pick  -> 
Raze  -> 
*  Power  -> 
Exponential  -> 
  Print  -> 
Drop  -> 
  Rake  -> 
Member  -> 
@  Rank  -> 
,  Ravel  -> 
Catenate  -> 
  Raze  -> 
Pick  -> 
  Reciprocal  -> 
Divide  -> 
/  Reduce  -> 
Compress  -> 
Replicate  -> 
/  Replicate  -> 
Compress  -> 
Reduce  -> 
  Reshape  -> 
Shape  -> 
|  Residue  -> 
Absolute value  -> 
!  Restructure  -> 
Item Ravel  -> 
  Result  -> 
Assignment  -> 
Selective Assignment  -> 
  Reverse  -> 
Rotate  -> 
  Right  -> 
?  Roll  -> 
Deal  -> 
  Rotate  -> 
Reverse  -> 
\  Scan  -> 
Expand  -> 
  Selective Assignment  -> 
Assignment  -> 
Result  -> 
  Separate Symbols  -> 
Combine Symbols  -> 
  Shape  -> 
Reshape  -> 
  Sign  -> 
Multiply  -> 
  Signal  -> 
Take  -> 
  Solve  -> 
Matrix Inverse  -> 
^  Stop  -> 
And  -> 
-  Subtract  -> 
Negate  -> 
  Take  -> 
Signal  -> 
  Transpose  -> 
Transpose Axes  -> 
  Type  -> 
Cast  -> 
Or  -> 
  Unpack  -> 
Encode  -> 
%  Value  -> 
Value in Context  -> 

Index - Numerics

2down attribute  -> 
        callbacks for   -> 
2up attribute   -> 
        callbacks for   -> 

3down attribute   -> 
        callbacks for   -> 
3up attribute   -> 
        callbacks for   -> 

Index - A

A protocol (adap)  -> 
A+
        Emacs A+ mode variables  -> 
        font (APL font)  -> 
                for printing (PostScript)  -> 
        functions, calling from C  -> 
        home page  -> 
        invocation
                argument for  -> 
                controlling atmp memory mapping by -m  -> 
                from a shell  -> 
                from Emacs  -> ,   -> 
        overview  -> 
a-mode in Emacs  -> ,  ->* 
Abort Loading of Script function  -> 
_abortload system function  -> 
Absolute value function  -> 
accelerator key mnemonics, menu  -> 
accept handle (adap)  -> 
acceptfocus attribute  -> 
access permission characteristics  -> 
action display class  -> 
        arguments to attribute functions  -> 
active attribute  -> 
acyclic dependencies  -> 
adap  -> 
        see also adap. ...
        attribute
                for listeners  -> 
                host  -> 
                list  -> 
                listener  -> 
                name  -> 
                port  -> 
                protocol  -> 
                rBufsize  -> 
                retry  -> 
                rPause  -> 
                rPriority  -> 
                rQueueStatus  -> 
                service descriptor  -> 
                wBufsize  -> 
                wNodelay  -> 
                wPause  -> 
                wPriority  -> 
                wQueueStatus  -> 
        data structures  -> 
        debugging  -> 
        errors
                buffread  -> 
                buffwrite  -> 
                export  -> 
                fdsisset  -> 
                in synchronous communication  -> 
                interrupt  -> 
                nochan  -> 
                readImport  -> 
                select  -> 
                timeout  -> 
        events
                choose  -> 
                connected  -> 
                error  -> 
                read  -> 
                reset  -> 
                sent  -> 
        line reader  -> 
        loading into A+  -> 
        messages  -> 
        mode
                burst mode (read)  -> ,   -> 
                read event mode  -> 
                single mode (read)  -> ,   -> 
        protocols
                A  -> 
                delta  -> 
                ipc  -> 
                raw  -> 
                simple  -> 
                stream  -> 
                string  -> 
                tick  -> 
        service handles
                accept  -> 
                connection  -> 
                listen  -> 
                timer  -> 
        timeouts  -> 
        zero-length message  -> 
adap.Close function  -> 
adap.Connect function  -> ,   -> 
adap.Debug function  -> 
adap.Export function  -> 
adap.GetClientData function  -> 
adap.GetPort function  -> 
adap.GetTimeout function  -> 
adap.Has function  -> 
adap.Import function  -> 
adap.Listen function  -> ,   -> 
adap.ModifyTimer function  -> 
adap.Of function  -> 
adap.ReadQueueStatus function  -> 
adap.Reset function  -> 
adap.Send function  -> 
adap.SetClientData function  -> 
adap.SetTimer function  -> 
adap.Syncread function  -> 
adap.Syncsend function  -> 
adap.SyncXch function  -> 
adap.WriteQueueStatus function  -> 
Add function  -> 
add... attributes  -> 
        callbacks for addtexttrace  -> 
        callbacks for addtrace  -> 
alignment of data in tableField  -> 
All Attributes function  -> 
All Dependent Object Names function  -> ,   -> 
_alldep system function  -> ,   -> 
_alsf system function  -> 
Alt key  -> 
ambi-valence  -> 
& (ampersand)  -> 
ancestors attribute  -> 
And function  -> 
        argument checking  -> 
APATH  -> ,   -> 
APL
        character set  -> 
        font  -> 
        mode (input)  -> 
        symbols, see Symbols section of index or Table B-1(a)
aplus e-mail group  -> 
APLUS_ATMP environment variable  -> 
Append Selective Assignment  -> ,   -> 
        itemwise invalidation of dependency  -> 
appending to files: Pipe Out Append system command  -> 
applications  -> 
Apply operator  -> ,   -> ,   -> 

arcsin, arccos, etc.  -> 
area trace style  -> 
argument  -> 
        A+ invocation  -> 
        left  -> 
        right  -> 
        vector (for C)  -> 
argv  -> 
arithmetic of Inf   -> 
arrangement of children in a layout  -> 
array  -> 
        disclosed  -> 
                empty array  -> 
        display class  -> ,   -> 
        display of  -> ,   -> ,   -> 
                arguments to attribute functions  -> 
                example of  -> 
        empty  -> 
        enclosed  -> 
        indexing  -> 
        inquiring about  -> 
        nested  -> 
        simple  -> 
        specifying a constant  -> 
        visualization  -> 
arrow... attributes  -> 
ASCII mode (input)  -> 
ASCII strings for APL graphics  -> 
ASQLA  -> 
Assignment function  -> 
        see also Selective Assignment function
        in a program  -> 
        object bound to display class  -> 
        strand  -> ,   -> 
                syntax  -> 
        syntax of  -> 
        Value in Context on left  -> ,   -> 
        Value on left  -> ,   -> 
association list  -> 
        for specifying attributes  -> 
        from nested slotfiller  -> 
        to nested slotfiller  -> 
Association List to Slotfiller function  -> 
asterisks indicating depth  -> 
asynchronous communication (adap)  -> 
asynchronous model of the A+ process  -> 
Asynchronous Send (adap)  -> 
at... attributes  -> 
atmp space  -> 
        allocating  -> 
        controlling memory mapping characteristics  -> 
ATREE  -> 
attribute  -> ,   -> 
        see also attributes
        $globs system command  -> 
        _atts system function  -> 
        _get system function  -> 
        _set system function  -> 
        a list of every adap  -> 
        a table listing every s  ->  -   ->end
                a listing by category  -> 
        assigning  -> 
        characteristics  -> 
        color names, list of all available  -> 
        current values  -> 
        fonts, list of all available  -> 
        function  -> 
                arguments to  -> 
        modifying  -> 
        of classes  -> 
        of variables  -> 
        out format samples  -> 
        preferred font names  -> 
        removing  -> 
        value of  -> 
        variable, default  -> 
Attribute Sources function  -> 
Attribute Value, Get (adap)  -> 
Attribute Value, Set (adap)  -> 
attributes  -> 
        see also attribute

        a list of all adap  -> 
        a table listing all s  ->  -   ->end
                a listing by category  -> 
        adap service descriptor  -> 
        button press  -> 
        callbacks associated with  -> ,   -> 
        classes with, s.classesHaving  -> 
        copying  -> 
        default variables  -> 
        define, s.classHas  -> 
        functional  -> 
        get class defaults, s.defaultOf  -> 
        get defaults for a class, s.Of  -> 
        get values for parent, s.ofParent  -> 
        having callbacks  -> 
        key press  -> 
        list of for a class, s.attributes  -> 
                primitive to a class, s.primitiveTo  -> 
        nonpersistent  -> 
        objects with specific, s.which  -> 
        permitted for a class  -> 
        persistent  -> 
        possible values, s.domainOf  -> 
        set class defaults, s.hasDefault  -> 
        set defaults for a class, s.Has  -> 
        set values for parent, s.parentHas  -> 
        values for a class, s.ofClass  -> 
        variables, default  -> 
        with callbacks  -> 
_atts system function  -> 
axis  -> 
        attribute (s)  -> 
        leading  -> ,   -> 
        length  -> 
                also see dimension
        trailing  -> ,   -> 
        zero (of graph)  -> 

Index - B

b attribute  -> 
b context  -> 
b.e function (reverse primitive Iota extension)  -> 
b.ge function (> or = primitive Iota extension)  -> 
b.i function (primitive Iota extension)  -> 
b.le function (< or = primitive Iota extension)  -> 
b.p function (primitive Iota extension, with permutation)  -> 
b.pe function (reverse primitive Iota extension, with permutation)  -> 
b.pge function (> or = primitive Iota extension, with permutation)  -> 
b.ple function (< or = primitive Iota extension, with permutation)  -> 
b.pr function (range, like Bins, with permutation)  -> 
b.r function (range, like Bins)  -> 
b.u function (faster primitive Iota extension for unique items)  -> 
back, window (lower)  -> 

backing store, inhibiting use  -> 
backpage... attributes  -> 
backslash, in character string  -> 
backspace character  -> 
Bang, dyadic (Restructure function)  -> 
Bang, monadic (Item Ravel function)  -> 
banner attribute, reports  -> 
banner, suppressing on A+ invocation  -> 

bar trace style  -> 
bar, scroll  -> 
barwidth attribute  -> 
base table (t)  -> 
Base value (Decode function)  -> 
be attribute  -> 
Beam  -> 
        also see Map
bg... attributes  -> 
        bg  -> 
Binary ... functions, see b. ...
Bind Several function, s.are   -> 
binding of notebook - showbinding attribute  -> 
bindingwidth attribute  -> 
Bins function  -> 
        see also b context
Bitwise Cast derived function  -> 
Bitwise operator  -> 
blank attribute  -> 
blink... attributes  -> 
        arguments to blink attribute function  -> 
block  -> 
        see also expression group
body, window  -> 
bold attribute  -> 
        arguments to attribute function  -> 
boolean And and Or arguments, checking for  -> 
border
        around object (shadowthickness attribute)  -> 
                for graphs  -> 
        when object has focus
                color of (hl attribute)  -> 
                thickness of (hlthickness attribute)  -> 
border... attributes  -> 
bottom... attributes  -> 
bound attribute  -> 
bound object, Assignment to  -> 
bound objects, list of all, s.objects  -> 
Bound To function, s.boundTo  -> 
Box (Enclose function)  -> 
box, see border
box type  -> 
box... attributes  -> 
brace  -> 
Brace Assignment function (Selective Assignment)  -> 
bracket  -> 
Bracket Indexing function  -> ,   -> 
        in itemwise dependencies  -> 
        itemwise invalidation of dependency  -> 
        syntax of  -> 
break fields (group fields, t)  -> 
break... attributes  -> 
browsing source code  -> 
buffer
        attribute  -> 
        primary selection  -> 
        size (adap)  -> ,   -> 
buffread error, adap  -> 
buffwrite error, adap  -> 
build attribute  -> 
burst mode (adap read)  -> ,   -> 
bus error  -> ,   -> ,   -> 
Bus Error Flag variable  -> 
`busexit system variable  -> 
Business Days function (t)  -> 
button
        clicking  -> 
        display class  -> 
                arguments to attribute functions  -> 
        mouse  -> 
                middle button  -> 
        pressing  -> 

Index - C

C
        attribute  -> 
        calling A+ functions from  -> 
        escape sequence  -> 
        subroutines
                calling from A+  -> 
                include file of defines and macros  -> 
                writing for call from A+  -> 
c context  -> 
c.AHeader function  -> 
c.char_pointed_to_by function  -> 
c.double_pointed_to_by function  -> 
c.float_pointed_to_by function  -> 
c.form function  -> 
c.int_pointed_to_by function  -> 
c.place_chars_at function  -> 
c.place_floats_at function  -> 
c.place_ints_at function  -> 
c.pointer function  -> 
c.ptr function  -> 
c.short_pointed_to_by function  -> 
c.string_pointed_to_by function  -> 
c.struct_pointed_to_by function  -> 
c.structcreate function  -> 
c.structdef function  -> 
c.structget function  -> 
c.structprint function  -> 
c.structset function  -> 
c.structsize function  -> 
c.structtype function  -> 
c.stuff function  -> 
c.unstuff function  -> 
cache (and files)  -> 
Calendar Indices function (t)  -> 
Call Default Callback Function  -> 
call expression
        function  -> 
        operator  -> 
callback  -> 
        see also callback function
        adap  -> 
        associated with attribute  -> ,   -> 
        avoiding  -> ,   -> 
        caused by Selective Assignment  -> 
        causing  -> 
        disabling  -> 
        during dependency evaluation  -> 
        enabling  -> 
        invoking default action for attribute  -> 
        preset  -> 
        removing  -> ,   -> 
        setting  -> ,   -> 
        static data  -> 
        tracing  -> 
        when it occurs  -> 
        X Events Flag command  -> 
Callback Flag command  -> 
Callback Flag variable  -> 
callback function  -> ,   -> 
        see also callback
        and adap  -> 
        arguments  -> 
        associated variable  -> 
        associated with
                attribute  -> 
                dependency  -> 
                event  -> 
                mapped file  -> 
                variable  -> 
        event  -> 
        execution  -> ,   -> 
                after variable change  -> 
                before variable change  -> 
        number of arguments  -> ,   -> ,   -> 
        result  -> 
        static data  -> 
        syntax  -> 
        variable  -> 
        when called  -> 
calling A+ functions from C  -> 
calling C subroutines from A+  -> 
cancel attribute  -> 
candlestick trace style  -> 
Capture the Screen Configuration function  -> 
carriage return character  -> 
case statement  -> ,   -> 
        syntax of  -> 
Cast function  -> 
        Bitwise Cast  -> 
categorization within t tables  -> 
Catenate function  -> 
Catenation function (t)  -> 
`CCID system variable  -> 
$cd system command  -> 
_cd system function  -> 
CDR (Common Data Representation)  -> 
Ceiling function  -> 
cell  -> ,   -> ,   -> 
_cfi system function  -> 
Change Directory command  -> 
Change Directory function  -> 
character
        constant, syntax of  -> 
        sequences (quasi-operators)  -> 
        type  -> 
charts, pie  -> 
check display class  -> 
        arguments to attribute functions  -> 
children  -> 
        attribute  -> 
        child objects  -> 
        independent displays  -> 
choice display class  -> 
        arguments to attribute functions  -> 
choose event (adap)  -> 
Choose function  -> 
        itemwise invalidation of dependency  -> 
choosing, in window  -> 
Circle function  -> 
Circle, monadic (Pi times function)  -> 
C-language structure  -> 
class
        see also display class
        attribute  -> ,   -> 
        binding  -> ,   -> 
        binding function, is  -> 
        display  -> 
        list of every, s.classes   -> 
        list of meta, s.metaClasses   -> 
        list of real, s.realClasses   -> 
        list of virtual, s.virtualClasses   -> 
        permitted for a variable  -> 
        syntactic  -> 
Class Can Have Attributes function  -> 
Classes with Attributes function  -> 
clear attribute  -> ,   -> 
        callbacks for  -> 
C-library routines  -> 
clicking  -> 
client  -> 
Client Data, Get (adap)  -> 
Client Data, Set (adap)  -> 
client-server  -> 
clipping text  -> 
close
        file: sys.close   -> 
        trace style  -> 
        window  -> 
Close Columns of a Table function (t)  -> 
Close Handle (adap)  -> 
$cmds system command  -> 
col... attributes  -> 
color

        arguments to attribute function  -> 
        attribute  -> 
        closest named, s.closest   -> 
        convert
                hex to name, s.hc   -> 
                hex to rgb, s.hc3   -> 
        cycling colors  -> 
        list of every named  -> 
                name to hex, s.ch   -> 
                name to pixel, s.color   -> 
                name to rgb, s.cc3   -> 
                rgb to hex, s.c3h   -> 
                rgb to name, s.c3c   -> 
        name of each  -> 
        names and numbers  -> 
        varying shade, s.shade   -> 
color... attributes  -> 
                arguments to color attribute function  -> 
                arguments to colors attribute function  -> 
colormap, window manager  -> 
colorprofile trace style  -> 
cols... attributes  -> 
        arguments to colspace attribute function  -> 
column  -> 
        definition in t  -> 
        moving and resizing by dragging, in table display class  ->* ,   -> ,   -> 
        variable in t  -> 
column... attributes  -> 
Combine Symbols function  -> 
Comma Fix Input function  -> 
Comma, dyadic (Catenate function)  -> 
Comma, monadic (Ravel function)  -> 
command  -> 
        see also system command
        Unix  -> 
command display class  -> 
        arguments to attribute functions  -> 
command-line argument  -> 
Commands command  -> 
comment  -> 
        syntax of  -> 
comments about the manual  -> 
communication, interprocess  -> 
comp... attributes  -> 
comparable cells  -> 
comparison tolerance  -> 
Complement function (t)  -> 
Compress (Replicate function)  -> 
Concatenate (Catenate function)  -> 
concepts, data  -> 
concurrently mapped file, writing and reading  -> 
conformability (of arguments)  -> 
Connect (adap)  -> 
connected event (adap)  -> 
connection handle (adap)  -> 
constant
        character, syntax of  -> 
        numeric, syntax of  -> 
        specifying an array  -> 
        symbol, syntax of  -> 
constraints attribute  -> 
context  -> ,   -> 
        adap  -> 
        b  -> 
        c  -> 
        changing  -> 
        current  -> 
        during function suspension  -> 
        name
                Combine Symbols function  -> 
                for Value function  -> 
                for Value in Context  -> 
                Separate Symbols function  -> 
                syntax  -> 
        p  -> 
        root  -> ,   -> 
        s  -> 
        sys  -> 
        t  -> 
        tracing (debugging)  -> 
        within a function  -> ,   -> 
Context command  -> 
Context variable  -> 
Contexts command  -> 

contourstyle attribute  -> 
control characters  -> 
control statement  -> 
        definition of every  ->  -    ->end
        error reports (common)  -> 
        syntax of  -> 
conventions used in this manual  -> 
coordinate  -> 
        see also index
Coordinate attribute  -> 
coordinate attribute  -> 
coordinated scrolling  -> 
Copy Attributes function, s.copy   -> 
copy, avoiding during assignment  -> 
copy... attributes  -> 
        callbacks for copytexttrace  -> 
        callbacks for copytrace  -> 
Core File Size Limit variable  -> 
`corelim system variable  -> 
corner, resize  -> 
cornerindex... attributes  -> 
cosh  -> 
cosine  -> 
Count function  -> 
Cover (Enclose function)  -> 
cpu time
        process, sys.cpu  -> 
        time function  -> 
creating
        array  -> 
        dependency  -> ,   -> 
        file, sys.creat   -> 
Cup, dyadic (Combine Symbols function)  -> 
Cup, monadic (Separate Symbols function)  -> 
current context  -> 
current... attributes  -> 
cursor attribute  -> 
$cx system command  -> 
`cx system variable  -> 
$cxs system command  -> 
cycle... attributes  -> 
cyclical dependencies
        detection  -> ,   -> 
        order of evaluation  -> 
        recursive references  -> 

Index - D

DAP  -> 
data
        operand  -> 
        structure  -> 
                adap  -> 
        visualization  -> 
database (t)  -> 
data-point move, graph  -> 
date, format  -> 
dc()   -> ,   -> 
$dbg system command  ->* ,   -> 
_dbg system function  -> 
Deal function  -> 
Debug Flag (adap)  -> 
Debug function, _dbg   -> 
debugging  -> 
        & (ampersand)  -> 
        adap trace messages  -> 
        bus errors  ->* ,   -> 
        Callback Flag command  -> 
        Callback Flag variable  -> 
        callback functions (for tracing variables)  -> 
        Debug function, _dbg   -> 
        Debugging State command  -> 
        Dependency Flag command  -> 
        Dependency Flag variable  -> 
        documentation, additional  -> 
        execution stack references  -> 
        execution stack representation  -> 
        frozen workstation  -> 
        NaN location  -> 
        Protected Execute Flag command  -> 
        Protected Execute variable  -> 
        segv errors  -> ,   ->* ,   -> 
        Signal function  -> 
        State indicator command  -> 
        Stop command  -> 
        Stop function  -> 
        Stop variable  -> 
        X Events Flag command  -> 
        X Events Flag variable  -> 
Debugging State command  -> ,   -> 
Decode function  -> 
decorators for Format system function  -> 
decrement attribute  -> 
$def system command  -> ,   -> 
_def system function  -> ,   -> 
default
        display class  -> 
        title  -> 
Default Format function  -> 
Define a Column function (t)  -> 
defined function  -> 
        Assignment function in  -> 
        entry of  -> ,   -> 
        fully qualified name in  -> 
        header  -> ,   -> 
        in Selective Assignment expressions  -> 
        result  -> 
        syntax of  -> ,   -> 
defined operator  -> ,   -> 
        Assignment function in  -> 
        data operand  -> 
        entry of  -> 
        header  -> 
        result  -> 
        syntax of  -> ,   -> 
definition
        dependency  -> 
        function  -> 
        operator  -> 
deiconized attribute  -> ,   -> 
delay, no (adap)  -> 
delete
        attribute  -> 
                callbacks for  -> 
        dependency  -> 
        row of displayed object  -> 
delimiter attribute  -> 
delta protocol (adap)  -> 
$dep system command  -> ,   -> 
$deps system command  -> ,   -> 
Dependencies command  -> ,   -> 
dependency  -> ,   -> ,   -> 
        see also itemwise dependency and  cyclical dependencies
        Assignment to  -> 
        callback during evaluation  -> ,   -> 
        callback functions on  -> 
        context  -> 
        creation of  -> ,   -> 
        definition  -> 
                entry  -> 
                in context  -> 
                removal  -> 
                tracing  -> 
        efficiency  -> 
        evaluation  -> ,   -> 
                tracing  -> 
        frames (t)  -> 
        global variable in  -> 
        invalidation  -> ,   -> ,   -> ,   -> 
        itemwise  -> 
        mapped file in  -> 
        recognition of itemwise dependence  -> 
        referencing  -> 
        restoration of saved value  -> 
        result of  -> 
        saved value  -> ,   -> 
        suspension upon failure  -> 
        syntax of  -> 
        system commands for  -> 
        system functions for  -> 
        testing for cyclic  -> 
        tracing  -> 
        variables whose use is not visible  -> 
        visibly referenced objects in definition  -> 
        when bound to display class  -> 
Dependency Definition command  -> ,   -> 
Dependency Definition function  -> ,   -> 
Dependency Flag command  -> 
Dependency Flag variable  -> 
Dependent Object Names command  -> ,   -> 
Dependent Object Names function  -> ,   -> 
$dep system command  -> ,   -> 
_dep system function  -> ,   -> 
$deps system command  -> ,   -> 
depth
        nesting  -> 
        punctuation  -> 
        tracing  -> 
Depth function  -> ,   ->* 
derived function  ->* 
                quasi-operator  -> 
        table (t)  -> 
                dynamic  -> 
descendents attribute  -> 
desktop
        geometry, s.desktop   -> 
        sector of, s.beHere   -> 
Detach a Column from its Sources function (t)  -> 
detaching a column (t)  -> 
$Df system command  -> 
`Df system variable  -> 
difference, set (t tables)  -> 
dimension  -> 
Direct Static Link function (t)  -> 
Direct Static Summary function (t)  -> 
directory
        change: sys.chdir   -> 
        list entries: sys.agetdents   -> 
        make: sys.mkdir   -> 
disclaimer... attributes  -> 
Disclose function  -> 
dismiss, window  -> 
disorientation attribute  -> 
Disperse (data) function (t)  -> 
display  -> ,   -> ,   -> 
        attribute (s)  -> 
        default  -> 
        format of variables  -> 
        function definition  -> 
        interactions  -> 
        of arrays  -> 
                empty  -> 
        refreshing
                and dependencies  -> 
                and done attribute  -> 
Display (Print function)  -> 
display class  -> 
        see also display classes
        a table listing all attributes  ->  -   ->end
        Assignment to bound object  -> 
        attributes  -> 
        creating  -> 
        managing  -> 
        user interaction with  -> 
display classes  -> 
        see also display class
        action  -> 
        array  -> ,   -> 
        button  -> 
        check  -> 
        choice  -> 
        command  -> 
        compound objects  -> 
        container object  -> 
        graph  -> ,   -> 
        graphTrace  -> 
        hgauge  -> 
        hgrid  -> 
        hmenu  -> 
        hpane  -> 
        hscale  -> ,   ->* 
        label  -> 
        layout  -> ,   -> 
        matrix  -> 
        notebook  -> 
        page  -> 
        password  -> 
        radio  -> 
        report  -> 
        scalar  -> 
        slot  -> 
        table  -> 
        tableField  -> 
        text  -> 
        tree  -> 
        vgauge  ->* ,   -> 
        vgrid  ->* ,   -> 
        view  -> 
        vmenu  -> ,   -> 
        vpane  -> ,   -> 
        vscale  -> ,   ->* ,   -> 
        window  -> 
DISPLAY environment variable
        and A+ invocation  -> 
        and s  -> 
display... attributes, see label... attributes
distributed analytics platform  -> 
Divide function  -> 
Divide, monadic (Reciprocal function)  -> 
divider, movable, in hpane  -> 
divider, window  -> 
do statement
        dyadic (iterative)  -> 
        monadic (protected execution)  -> 
                tracing  -> 
        syntax of  -> 
doc attribute  -> 
documentation
        miscellaneous  -> 
        screen management: s.doc   -> 
$doErrorStack system command  -> 
_doErrorStack system function  -> 
`doErrorStack system variable  -> 
Domain Name function: sys.getdomainname   -> 
Domino, dyadic (Solve function)  -> 
Domino, monadic (Matrix Inverse function)  -> 
done attribute  -> 
        callbacks for  -> 
double click, s.DOUBLECLICKINTERVAL   -> 
downto attribute  -> 
dragdrop attribute  -> 
dragging, window  -> 
Drop function  -> 
duplicate items in a link field (t)  -> 
dyadic function  -> ,   -> 
dyadic scalar function  -> 
        application of  -> 
        classification of every  -> 
        conformability of arguments  -> 
        definition of every  ->  -   ->end
        error reports (common)  -> 
        shape of result  -> 
        similarity of Rank operator  -> 
_dyld system function  -> 
`dyme system variable  -> 
dynamic attribute  -> 
Dynamic Derived Table function (t)  -> 
Dynamic Environment variable  -> 
Dynamic Load function  -> 
dynamic loading  -> ,   -> ,   -> 
        AIX  -> 
        Sun  -> 
        tracking of  -> 
Dynamic Sorted Derived Table function (t)  -> 

Index - E

Each operator  -> ,   -> 
edit... attributes  -> 
editing  -> 
        see also search
        data on the screen  -> ,   -> 
                callbacks for beginning and ending  -> 
$Ef system command  -> 
`Ef system variable  -> 
elapsed time  -> 
electrified attributes
        attribute default variables  -> 
        has  -> 
        s.doesNotUse   -> 
        s.Has   -> 
        s.used   -> 
        s.usedBy   -> 
        s.uses   -> 
        s.using   -> 
element (of array)  -> 
Emacs  -> 
        A+ mode variables  -> 
        invoking A+ from  -> 
        programming environment  -> 
empty array  -> 
        display of  -> 
        type of  -> 
Encapsulated PostScript (eps)  -> 
Enclose function  -> ,   -> ,   -> 
Encode function  -> 
End functions, b.e and b.pe  -> 
e-notation  -> 
Enter key  -> 
entering data on the screen  -> ,   -> ,   -> 
environment
        dynamic  -> 
        get: sys.readenv   -> 
        in the workspace  -> 
        put: sys.setenv   -> 
        variable
                APATH  -> 
                ATREE  -> 
epsilon, dyadic (Member function)  -> 
Equal to function  -> 
equal, tolerably  -> ,   -> 
Equivalent (Match function)  -> 
error
        bus  -> ,   -> ,   -> 
        code  -> 
        event (adap)  -> 
        omitted report  -> ,   -> 
        report  -> 
                control statements  -> 
                dyadic primitive operators (common)  -> 
                dyadic scalar functions (common)  -> 
                form  ->* ,   -> 
                from dynamically loaded code  -> 
                monadic primitive operators (common)  -> 
                monadic scalar functions (common)  -> 
                non-scalar primitive functions (common)  -> 
                omitted  -> ,   -> 
                suppressing
                        adap  -> 
                        all (from XTerm or script)  -> 
                        debug  -> 
                        s  -> ,   ->* 
                        SIGPFE  -> 
                system functions (common)  -> 
        segv  -> ,   -> ,   -> 
        stale NFS handle  -> 
        system call
                message: sys.perror   -> 
                number: sys.errno   -> 
                symbol: sys.errsym   -> 
escape sequence  -> 
Establish Screen Management Functions function  -> 
eval... attributes  -> 
evaluation order  -> 
        see also execution order
event callback function  -> 
event loop (main loop)  -> 
event, adap  -> 
        see also adap: events
$ex system command  -> 
_ex system function  -> 
Exchange, Synchronous (adap)  -> 
$excxt system command  -> 
_excxt system function  -> 
execute attribute  -> 
Execute function  -> 
        execution of system command  -> ,   -> 
        tracing  -> 
Execute in Context function  -> 
Execute, dyadic (Execute in Context and Protected Execute functions)  -> 
execute, s.execute function  -> 
execution
        see also immediate execution
        abandonment  -> 
        completion  -> 
        counts  -> 
        order of  -> ,   -> 
                in sequences of expressions  -> 
        resumption  -> ,   -> ,   -> 
        stack
                references  -> 
                representation (K Stack, `si)  -> 
        suspension  -> ,   -> 
Execution Profile function  -> 
Execution Suspension Flag command  -> 
Execution Suspension Flag variable  -> 
exit
        attribute  -> 
                callbacks for  -> 
        function: sys.exit   -> 
Exit function  -> 
_exit system function  -> 
Expand function  -> 
exponential format  -> 
Exponential function  -> 
Export an Array: sys.export   -> 
Export Data (adap)  -> 
export error, adap  -> 
export, simplified: sys.exp   -> 
exporting data, adap.Export and sys.exp   -> 
expression  -> 
        block  -> 
        entry of  -> 
        function  -> ,   -> 
        function call  -> ,   -> 
        group  -> 
                result  -> 
        operator call  -> 
        result  -> 
        strand  -> 
        target  -> 
        well-formed  -> 
Expunge command  -> 
Expunge Context command  -> 
Expunge Context function  -> 
Expunge function  -> 
extension, scalar  -> 
extent... attributes  -> 
external function, tracing of  -> 
External Functions command  -> 
external routines, suppressing floating point exception reports  -> 

Index - F

f1 through f12 attributes  -> 
familytree attribute  -> 
fdsisset error, adap  -> 
fg... attributes  -> 
        arguments to fg attribute function  -> 
_fi system function  -> 
field variable  -> 
field... attributes  -> 
fields
        of a table display object  -> 
        order on screen  -> 
file  -> 
        see also mapped file and script: file
        accessibility: sys.access   -> 
        append: Pipe Out Append command  -> 
        attribute (s: output file for reports)  -> 
        close: sys.close   -> 
        create: sys.creat   -> 
        creation mask: sys.umask   -> 
        descriptor
                duplicate: sys.dup   -> 
                duplicate and specify: sys.dup2   -> 
                functions: sys.fcntl   -> 
                max number of descriptors: sys.getdtablesize   -> 
                select ready: sys.aselect   -> 
        directory
                change  -> 
                entries  -> 
                make  -> 
        find: sys.pathfind   -> 
        length  -> 
        link
                establish symbolic: sys.symlink   -> 
                establish: sys.link   -> 
                read: sys.areadlink   -> 
        list of currently mapped  -> 
        loading: File Being Loaded system variable  -> 
        lock: sys.flock   -> 
        mapped  -> 
                callbacks on  -> 
        open file descriptor special functions: sys.ioctl   -> 
        open: sys.open   -> 
        operations  -> ,   -> ,   -> ,   -> ,   -> 
        owner
                sys.chown   -> 
                sys.fchown   -> 
        permissions mode  -> 
                sys.chmod   -> 
                sys.fchmod   -> 
        pointer: sys.lseek   -> 
        read
                Pipe In command  -> 
                sys.read   -> 
                sys.readinto   -> 
                sys.readmat   -> 
        rename: sys.rename   -> 
        script  -> 
        search order  -> 
        size: sys.filesize   -> 
        statistics
                sys.alstat   -> 
                sys.astat   -> 
        synchronization: sys.fsynch   -> 
        synchronize a mapped file: sys.amsynch   -> 
        text  -> 
        tracking  -> 
        truncate
                sys.ftruncate   -> 
                sys.truncate   -> 
        Unix text  -> 
        unlink: sys.unlink   -> 
        update time: sys.updtime   -> 
        write
                Pipe Out Append command  -> 
                Pipe Out command  -> 
                sys.write   -> 
fill element (Take, Expand)  -> 
fill trace style  -> 
fill... attributes  -> 
        fillcolor attribute   -> 
                arguments to attribute function  -> 
Find function  -> 
        see also b context
Find function (t)  -> 
first  -> 
First (Interval function)  -> 
first... attributes  -> 
Fix a View function (t)  -> 
Fix Input function  -> 
fixedfields attribute  -> 
fixedreportcolumns attribute  -> 
fkeys attribute  -> 
Flag
        Callback  -> ,   -> 
        Debug (adap)  -> 
        Dependency  -> ,   -> 
        Execution Suspension  -> ,   -> 
        Floating Point Exception  -> 
        Protected Execute  -> ,   -> 
        Terminal  -> ,   -> 
        X Events  -> ,   -> 
_flat system function  -> 
Flatten function  -> 
floating-point exceptions, external, suppressing reports  -> 
floating-point type  -> 
Floor function  -> 
Flush Standard Out: sys.fflush_stdout   -> 
_fmt system function  -> 
$fns system command  -> 
focus  -> 
        attribute  -> 
        keyboard  -> 
                moving  -> 
        object with keyboard, s.this   -> 
follower, window  -> 
follower... attributes  -> 
font  -> ,   -> 
        APL  -> 
                for printing (PostScript)  -> 
        attribute  -> 
                arguments to attribute function  -> 
                preferred font names  -> 
        conventions in this manual  -> 
        Font Name to Internal Form Conversion function  -> 
        Kanji  -> 
        lists of fonts  -> ,   -> ,   -> 
foot... attributes  -> 
footer, window  -> 

fork exec, socket: sys.sfe   -> 
formal operator  -> 
format
        for screen output  -> ,   -> ,   -> ,   -> 
        Format function  -> 
        Format system function  -> 
                format phrases for  -> 
                messages, off switch  -> 
        Format, monadic (Default Format function)  -> 
        Get Format Symbols  -> 
        s.box function  -> 
        Screen Format function  -> 
formatbreakfunc attribute  -> 
formfeed character  -> 
frame  -> ,   -> ,   -> 
        subframe  -> 
        window  -> 
frame... attributes  -> 
Free All Objects function  -> 
free function  -> ,   -> 
free object  -> 
free()   -> 
freeze attribute  -> 
FROM_HEAP setting for APLUS_ATMP environment variable  -> 
front, window (raise)  -> 
frozen workstation, debugging  -> 
fullscreen attribute  -> 
function
        see also primitive function, system function,
                        defined function, callback function,
                        dependency, operator
        call expression  -> ,   -> 
                in scripts, recommended form  -> 
                locating in scripts  -> 
        context  -> 
                also see context, within a function
        definition
                entry of  -> 
                locating (script) source  -> 
                tracing  -> 
                use of tabs  -> 
        dyadic  -> ,   -> 
        expression  -> ,   -> 
                scope rules in  -> 
        header  -> 
        key attribute, callbacks for  -> 
        monadic  -> ,   -> 
        niladic  -> 
        scalar  -> 
        syntax  -> 
        tracing of  -> 
        type  -> 
        valence  -> 
function key attributes  -> 
functional attributes  -> 
Functions command  -> 
functions that modify arguments  -> ,   -> 

Index - G

_gcb system function
-> _gcd system function ->
General Search and Replace function  -> 
general type  -> ,   -> 
_get system function  -> 
geometry attribute  -> 
        arguments to attribute function  -> 
get
        see also file, mapped file, attributes, read
        Get Attribute Default Variables or Values function  -> 
        Get Attribute Defaults for a Class function  -> 
        Get Attribute function  -> 
        Get Attribute Value (adap)  -> 
        Get Attribute Values for Parent function  -> 
        Get Callback function  -> 
        Get Client Data (adap)  -> 
        Get Client Data system function  -> 
        Get Format Symbols function  -> 
        Get Preset Callback function  -> 
        Get System Variable function  -> 
        Get Timeout (adap)  -> 
Gets (Assignment function)  -> 
$Gf system command  -> 
`Gf system variable  -> 
_gfmtsym system function  -> 
gif files (printoutputmode attribute)  -> 
Global Objects command  -> 
global variable  -> 
$globs system command  -> 
GMT from seconds in epoch  -> 
GMT, current  -> 
_gpcb system function  -> 
Grade down function  -> 
Grade up function  -> 
gradient attribute  -> ,   -> 
        arguments to attribute function  -> 
graph display class  -> ,   -> 
        addtrace, addtexttrace attributes  -> 
        arguments to attribute functions  -> 
        attributes for margins (xleft, etc.)  -> 
        axes, attributes for  -> 
        axis  -> 
        axis title  -> 
        barwidth attribute  -> ,   -> ,   -> 
        bg, fg attributes  -> 
        bottom, top, left, right attributes  -> 
        coordinate attribute  -> 
        copytrace, copytexttrace attributes  -> 
        date format  -> 
        debug attribute  -> 
        extent attributes  -> 
        footnote  -> 
        footnotefg  -> 
        footnotefont  -> 
        footnotejustify  -> 
        format  -> 
        grid  -> ,   -> 
        gridfg  -> 
        gridstyle  -> 
        gridwidth  -> 
        inc attributes  -> 
        label attributes  -> ,   -> 
        labelfont attributes  -> 
        labelheight attributes  -> 
        labeljustify and sublabeljustify attributes  -> 
        labelout and sublabelout attributes  -> 
        labelwidth attributes  -> 
        legend  -> 
        legendbg  -> 
        legendfg  -> 
        legendfont  -> 
        legendhlthickness  -> 
        legendshadowthickness  -> 
        legendstyle  -> 
        majorticksize, minorticksize, minorticks  -> 
        out attribute  -> 
        refer, referpoint attributes  -> 
        rule  -> ,   -> 
        rulewidth  -> 
        selectable, selected attributes  -> 
        selectdistance attribute  -> 
        shadowthickness attribute  -> 
        subtitle  -> 
        subtitlefg  -> 
        subtitlefont  -> 
        subtitlejustify  -> 
        textactivate attribute  -> 
        tick mark  -> 
        tickstyle attributes  -> 
        title  -> ,   -> 
        titlefg  -> ,   -> 
        titlefont  -> ,   -> 
        titlejustify  -> ,   -> 
        titlestyle  -> 
        trace set  -> 
                attributes  -> 
                data  -> 
                order in which drawn  -> 
        user interaction with  -> ,   -> 
        Xfg  -> 
        xfg  -> 
        Xlabel  -> 
        xlabel  -> 
        xlegend  -> 
        xmin and xmax  -> 
        xs, ys attributes  -> 
        Yfg  -> 
        yfg  -> 
        Ylabel  -> 
        ylabel  -> 
        ylegend  -> 
        ymin and ymax  -> 
        zero axes  -> 
        zerofg  -> 
        zerostyle  -> 
        zerowidth  -> 

graphTrace display class  -> 
        arguments to attribute functions  -> 
        user interaction with  -> ,   -> 
Greater of (Max function)  -> 
Greater than function  -> 
Greater than or Equal to function  -> 
greatest representable integer  -> 
grid display classes  -> 
grid... attributes  -> 
group (t)  -> 
        fields  -> ,   -> 
                multiple  -> 
        functions  -> 
_gsr system function  -> 
_gsv system function  -> 

Index - H

H attribute  -> 
h attribute  -> 
Handle, Close (adap)  -> 
has attribute  -> 
has function  -> ,   ->* 
Hash Table Statistics function  -> 
_hashstat system function  -> 
head... attributes  -> 
header
        A structure  -> 
                mapped file  -> 
        attribute (s: in reports)  -> 
        c.AHeader   -> 
        defined function  -> ,   ->* 
        defined operator  -> 
        window  -> 
heap space  -> 
        allocating  -> 
hgauge display class  -> 
hgrid display class  -> 
        arguments to attribute functions  -> 
hide attribute  -> 
hide function  -> ,   -> ,   ->* 
high minus  -> 
high-low trace style  -> 
high-low-close trace style  -> 
hl... attributes  -> 
hmenu display class  -> 
        arguments to attribute functions  -> 
home page, A+  -> 
horizontalspace attribute  -> 
host (adap service descriptor attribute)  -> 
host name  -> 
Host Name function: sys.gethostname   -> 
hpane display class  -> 
        arguments to attribute functions  -> 
hscale display class  -> ,   -> 
        user interaction with  -> 
hyperbolic sine, cosine, tangent  -> 

Index - I

i context  -> 
icon  -> 
icon... attributes  -> 
id
        current process id: sys.getpid  -> 
        effective user id of current process: sys.geteuid  -> 
        parent id of current process: sys.getppid  -> 
        real group id of process: sys.getgid  -> 
        real user id of current process: sys.getuid  -> 
idap  -> 
Identity function  -> 
identity scalars for Reduction  -> 
IEEE symmetric rounding rules  -> 
if statement  -> ,   -> 
        syntax of  -> 
if-else statement  -> 
        syntax of  -> 
illegal instruction error message  -> 
immediate execution
        display  -> 
        expression groups  -> 
Import an A+ Array: sys.import  -> 
Import Data (adap)  -> 
import, simplified: sys.imp  -> 
importing data, adap.Import and sys.imp  -> 
in attribute  -> 
        arguments to attribute function  -> 
in-place assignment  -> 
in: converting screen input  -> 
inc attribute  -> 
increment attribute  -> 
incurrentworkspace attribute  -> 
index
        attribute (s)  -> 
        field (t)  -> 
        group  -> 
        of an array  -> 
        origin  -> 
_index system function  -> 
_index_of system function  -> 
Index of (Find function)  -> 
        see also b context
Index of system function  -> 
Indexing (Bracket Indexing function)  -> 
Indexing, Permissive (system function)  -> 
Inf  -> ,   -> 
infinity (constructive)  -> 
infix notation  -> 
informational message  -> ,   -> 
Inner Product operator  -> ,   -> 
inode  -> 
input
        functions
                Comma Fix Input  -> 
                Fix Input  -> 
                Scalar Comma Fix Input  -> 
                Scalar Fix Input  -> 
        Input Mode command  -> 
        Input Mode variable  -> 
        mode, screen
                insertion  -> 
                overwriting  -> 
                replacement  -> 
        screen  -> 
                converting  -> 
inquiry functions  -> 
insert... attributes  -> 
        callbacks for insertabove  -> 
        callbacks for insertbelow  -> 
inserting row in displayed object  -> 
install function (for static link)  -> 
integer  -> 
        type  -> 
interaction with screen display  -> 

interface to SYBASE  -> 
interprocess communication  -> 
        events (adap)  -> 
interrupt A+  ->* ,   -> ,   -> 
interrupt error, adap  -> 
interrupted system call (error message)  -> 
intersection (t tables)  -> 
Interval function  -> ,   -> 
intervals, grouping by (t)  -> 
invalid screen input  -> 
invalidation
        dependency  -> ,   -> 
        itemwise  -> 
inverse trigonometric functions  -> 
invoking A+
        controlling atmp memory mapping by -m  -> 
        environment variables  -> ,   -> 
        from a shell  -> 
        from Emacs  -> ,   -> 
Iota, dyadic (Find function)  -> 
        see also b context
Iota, monadic (Interval function)  -> 
ipc protocol (adap)  -> 
is attribute  -> 
        callbacks for  -> 
is function  -> ,   -> ,   -> 
_issf system function  -> 
item  -> ,   -> ,   -> 
Item Ravel function  -> 
Items of a Mapped File function  -> 
_items system function  -> 
itemwise dependency  -> 
        see also dependency
        invalidation  -> ,   -> 
        non-itemwise invalidation  -> 
        recognition of  -> 
        syntax of  -> 
        total evaluation of  -> 

Index - J-K

jot  -> 
justification of data in tableField  -> 
justify attribute  -> 
K Stack variable  -> 
Kanji font  -> 
Kerberos authentication  -> 
key... attributes  -> 
        callbacks for key attribute  -> 
keyboard
        accelerator mnemonics  -> 
        APL Union  -> 
        focus  -> ,   -> 
                moving  -> 
                object with, s.this  -> 
keys, Alt and meta  -> 
kill
        A+ process  -> 
        sys.kill function  -> 
        to interrupt  -> 

Index - L

l attribute  -> 
label
        area
                in the action display class  -> 
                in the choice display class  -> 
                in the slot display class  -> 
        display class  -> 
                arguments to attribute functions  -> 
                example of  -> 
label... attributes  -> 
        arguments to label attribute function  -> 
        arguments to labelfg attribute function  -> 
        arguments to labelfont attribute function  -> 
Laminate function  -> 
lamp (for comment)  -> 
Language Level variable  -> 
`language system variable  -> 
layout
        attribute  -> 
        display class  -> ,   -> 
                and the grid display classes  -> 
                arguments to attribute functions  -> 
                modifying an existing layout  -> 
                resizing a layout  -> 
leader attribute  -> 
leader, window  -> 
leading attribute  -> 
leading axis  -> ,   -> 
leading dimension  -> 
left argument  -> 
left arrow
        Assignment function  -> 
        monadic (Result function)  -> 
Left function  -> 
left... attributes  -> 
legend of graph, placement  -> 

legend... attributes  -> 
        legend  -> 
                arguments to  -> 
length  -> 
Length (Shape function)  -> 
Less than function  -> 
Less than or Equal to function  -> 
Lesser of (Min function)  -> 
levels of tracing  -> 
lexical scope  -> 
Lightweight Column Definition function (t)  -> 
line reader (adap)  -> 

line trace style  -> 
line... attributes  -> 
        linecolor  -> 
                arguments to  -> 
        linestyle  -> 
                arguments to  -> 
        linewidth  -> ,   -> 
                arguments to  -> 
linefeed character  -> 
linescatter trace style  -> 
link file  -> 
link, direct static (t)  -> 
link, static, to C or C++ function  -> 
linking tables (t)  -> 
list  -> 
List of All Objects Bound to a Class, s.boundTo  -> 
List of CDE Workspaces function  -> 
Listen (adap)  -> 
listen handle (adap)  -> 
listener attribute (adap)  -> 
listeners, attributes on (adap)  -> 
listing names  -> 
literal attribute  -> 
$load system command  -> 
_load system function  -> 
`loadfile system variable  -> 
loading  -> ,   -> 
        Abort Loading of Script function  -> 
        Load and Remove command  -> 
        Load and Remove function  -> 
        Load command  -> 
        Load function  -> 
        monitoring  -> 
        packfile  -> 
        tracking of  -> 
$loadrm system command  -> 
_loadrm system function  -> 
local time  -> 
        from seconds in epoch  -> 
local variable  -> 
local-write file (mapped file)  -> 
_locals system function  -> 
lock... attributes  -> 
log
        close: sys.closelog  -> 
        message: sys.syslog  -> 
        open: sys.openlog  -> 
Log function  -> 
Log, monadic (Natural log function)  -> 
lower attribute  -> 
lowered, window  -> 
lpr (print file)  -> 

Index - M

mab() and ma()  -> 
Magnitude (Absolute value function)  -> 
mailing list: aplus e-mail group  -> 
main loop (event loop)  -> 
Major Release Number variable  -> 
`majorRelease system variable  -> 
majorticksize attribute  -> 
malloc()  -> 
manifest constant  -> 
manual
        how to use this  -> 
        notation used in this  -> 
        organization of this  -> 
        terms used in this  -> 
Map function  -> 
Map In function  -> 
MAP_PRIVATE and MAP_NORESERVE settings, APLUS_ATMP environment variable  -> 
maplim error  -> 
$maplim system command  -> 
`maplim system variable  -> 
mapped attribute  -> 
mapped file  -> ,   -> ,   -> 
        assignment to  -> 
        C, using in  -> 
        callbacks on  -> 
        concurrent use  -> 
        copying (making an unmapped copy of)  -> 
        header  -> 
        in dependency  -> 
        information from Debug  -> 
        length  -> 
        limit on number of simultaneously mapped files  -> 
        list  -> 
        local write  -> 
        Map function  -> 
        on different machines  -> 
        on remote machine  -> 
        read-only  -> 
        read-write  -> 
        search order  -> 
        seeing updates  -> 
        Selective Assignment to  -> 
        simultaneous use  -> 
        synchronize: sys.amsync  -> 
Mapped Files Limit
        command  -> 
        variable  -> 
mapping, tracing of  -> 
margin... attributes  -> 

margins of graphs (xleft, etc., attributes)  -> 
marketprofile trace style  -> 
Match function  -> 
matrix  -> 
        display class  -> 
                arguments to attribute functions  -> 
Matrix Inverse function  -> 
Matrix product (Inner Product operator)  -> 
Max function  -> 
max... attributes  -> 
maxrank error  -> 
Member function  -> 
memory allocation  -> ,   -> 
menu
        accelerator key mnemonics  -> 
        button  -> 
        display classes  -> ,   -> 
        keyboard accelerator mnemonics attribute  -> 
        pop-up for notebook: showpopup attribute  -> 

messages
        adap, suppressing  -> 
        debug, suppressing  -> 
        error, form of  -> 
        Format, off switch  -> 
        s, suppressing  -> ,   -> 
        SIGPFE, suppressing  -> 
meta key  -> 
metaclasses, list of, s.metaClasses  -> 
mf()  -> 
middle mouse button  -> 
Min function  -> 
min... attributes  -> 
Minor Release Number variable  -> 
`minorRelease system variable  -> 
minus sign, high  -> 
Minus, dyadic (Subtract function)  -> 
Minus, monadic (Negate function)  -> 
mnemonics attribute  -> 
Mod (Residue function)  -> 
mode attribute  -> ,   -> 
$mode system command  -> 
`mode system variable  -> 
Modify Timer (adap)  -> 
modifying and returning arguments  -> 
Monadic Do  -> 
        tracing  -> 
monadic function  -> ,   -> 
monadic scalar function  -> 
        application of  -> 
        classification of every  -> 
        definition of every  ->  -   ->end
        error reports  -> 
        shape of result  -> 
Motif  -> 
mouse  -> 
        button  -> 
                middle  -> 
        clicking  -> 
        pointer  -> 
                moving  -> 
        pressing  -> 
movable divider  -> 
        in hpane  -> 
Move Mouse Pointer function  -> 
movelimit attribute  -> ,   -> 
        arguments to attribute function  -> 
moving average (Restructure function)  -> 
moving columns by dragging  -> ,   ->* 
moving data-points of graphs  -> 
multiple A+ sessions  -> 
multiple display screens, and s  -> 
multiple group fields (t)  -> 
Multiply function  -> 

Index - N

Na, see NaN and Nan Find function
na attribute  -> 
name
        adap service descriptor attribute  -> 
        argument for system functions  -> 
        classes  -> 
        global  -> 
        listing names  -> 
        local  -> 
        qualified  -> ,   -> 
        syntax of  -> 
        system function, syntax of  -> 
        system variable, syntax of  -> 
        system, syntax of  -> 
        unqualified  -> ,   -> 
        user, see user name
        value predicate  -> 
Name Class function  -> 
Name function  -> 
Name List function  -> ,   -> 
Name Search and Replace function  -> 
Name Search function  -> 
_name system function  -> 
names, use of this verb  -> 
NaN  -> ,   -> ,   -> 
NaN Find function  -> 
_nanfind system function  -> 
Natural log function  -> 
naturalsize attribute  -> 
_nc system function  -> 
Negate function, also called Negative  -> 
nested array  -> ,   -> 
Nested Association List function  -> 
newline character  -> ,   -> 
news group: aplus e-mail group  -> 
newshow attribute  -> 
newspapercolumn attribute  -> 
NFS  -> 
        stale file handle report  -> 
niladic function  -> 
NIS domain name  -> 
_nl system function  -> ,   -> 
No Longer Use Variables function  -> 
nochan error, adap  -> 
node... attributes  -> 
non-boolean And and Or arguments, checking for  -> 
non-scalar primitive function  -> 
        classification of every  -> 
        definition of every  ->  -   ->end
        error reports (common)  -> 
none trace style  -> 
nonpersistent attributes  -> 
not an `a object (error message)  -> 
Not equal to function  -> 
Not function  -> 
notation used in this manual  -> 
notation, infix  -> 
notebook display class  -> 
        arguments to attribute functions  -> 
        user interaction with  -> 
notify attribute  -> ,   -> 
        callbacks for  -> 
_ns system function  -> 
_nsr system function  -> 
Null function  -> 
null type  -> 
Null, the  -> ,   -> 
        display of  -> 
        for invalid screen input  -> 
        in itemwise dependencies  -> 
numbers, representation of  -> 
numeric (general type)  -> 
numeric constant, syntax of  -> 

Index - O

object  -> 
        and Assignment  -> 
        binding to a class  -> 
        bound to display class, Assignment to  -> 
        compound  -> 
        container  -> 
Object with Keyboard Focus function  -> 
objects bound to a class, s.boundTo  -> 
Objects with Specific Attribute Value function  -> 
octal (in character string)  -> 
Of (Bracket Indexing function)  -> 
Of (Member function)  -> 
of function  -> ,   -> 
Off command  -> 
$off system command  -> 
Open (Disclose function)  -> 
open punctuation  -> 
open, window  -> 
open-high-low-close trace style  -> 
Openlook  -> 
Operation would block (error message)  -> 
operator  -> 
        see also primitive operator, defined operator
        call expression  -> 
        formal  -> 
        tracing of  -> 
Operators command  -> 
$ops system command  -> 
Or function  -> 
        argument checking  -> 
order
        in which graph traces are drawn  -> 
        of evaluation  -> ,   -> 
        of traversal, window  -> 
organization of this manual  -> 
orientation attribute  -> 
origin, index  -> 
out: formatting screen output  -> 
out... attributes  -> 
        arguments to out attribute function  -> 
        format samples for out  -> 
Outer Product operator  -> ,   -> 
        similarity of Rank operator  -> 
outer union (t tables)  -> 
outline trace style  -> 
outofcurrentworkspace attribute  -> 
output representation (s.box)  -> 
output, formatting screen  -> 
output... attributes  -> 
Over (Divide function)  -> 
Over (Reduce operator)  -> 
overview of A+  -> 

Index - P

p context (packages)  -> 
p.fadd function  -> 
p.fcatalog function  -> 
p.ffix function  -> 
p.fnew function  -> 
p.sadd function  -> 
p.scatalog function  -> 
p.sfix function  -> 
p.snew function  -> 
Pack function  -> 
package  -> 
        creation  -> 
        debugging, options  -> 
        documentation, additional  -> 
        information  -> 
        inquiry  -> 
        modification  -> 
        options  -> 
        packfile  -> 
        packstring  -> 
        retrieval  -> 
page display class  -> 
        arguments to attribute functions  -> 
        user interaction with  -> 
page... attributes  -> 
pane display classes  -> ,   -> 
parent  -> 
        attribute  -> 
parenthesis  -> 
parsing scripts  -> 
partial products (Scan operator, with Multiply)  -> 
partial sums (Scan operator, with Add)  -> 
partition  -> 
        of a t table  -> 
        side of a link (t)  -> 
Partition Count function  -> 
Partition function  -> 
password display class  -> 
        arguments to attribute functions  -> 
        user interaction with  -> 
pasting text  -> ,   -> 
path name to file  -> 
pathfind function: sys.pathfind  -> 
pause attribute (adap)  -> ,   -> 
pendent function  -> 
Percent, dyadic (Value in Context function)  -> 
Percent, monadic (Value function)  -> 
Permissive Indexing  -> 
persistent attributes  -> 
Phase of the Release variable  -> 
`phaseOfRelease system variable  -> 
Pi times function  -> 
Pick function  -> 
pictorial representation of data  -> 
pie chart trace style  -> 
pie charts  -> 
pie... attributes  -> ,   -> 
pin attribute  -> 
pin, window  -> 
Pipe command  -> 
Pipe In command  -> 
Pipe Out Append command  -> 
Pipe Out command  -> 
Place (c.place...)  -> 
placement of graph legend  -> 
Plus, dyadic (Add function)  -> 
Plus, monadic (Identity function)  -> 
pointer
        c  -> 
        mouse  -> 
                moving  -> 
Populate a View Table function (t)  -> 
pop-up menu for notebook: showpopup attribute  -> 
pop-up window  -> 
        default creation (s.SHELL)  -> 
popups, list of: s.popups  -> 
port (adap service descriptor attribute)  -> 
Port and Workstation Information (adap)  -> 
portable pixmap (ppm)  -> 
position attribute  -> 
PostScript (outputmode ps)  -> 
PostScript files (printfile)  -> 
Pound, dyadic (Choose function)  -> 
Pound, monadic (Count function)  -> 
Power function  -> 
Power, monadic (Exponential function)  -> 
$pp system command  -> 
`pp system variable  -> 
ppm files (printoutputmode attribute)  -> 
precedence  -> 
preset
        attribute  -> 
        callback  -> 
                see also callback
        setting callback  -> 
pressing button  -> 
previewing a PostScript file (printfile)  -> 
primary attribute  -> ,   -> 
primary selection buffer  -> ,   -> 
primaryslice... attributes  -> ,   -> 
Primitive Attributes function  -> 
primitive function
        see also monadic scalar function, dyadic scalar function,
                   non-scalar primitive function, primitive functions
        ambi-valence  -> 
        dyadic scalar functions  -> 
        execution counts  -> 
        file functions  -> 
        in Selective Assignment expressions  -> 
        monadic scalar functions  -> 
        non-scalar primitive functions  -> 
        screen management  -> 
        syntax of  -> 
primitive functions
        see also monadic scalar function, dyadic scalar function,
                   non-scalar primitive function, primitive function
        free  -> ,   -> 
        has  -> ,   -> 
        hide  -> ,   -> 
        is  -> ,   -> ,   -> 
        Map  -> 
        Map In  -> 
        of  -> ,   -> 
        show  -> ,   -> 
primitive operator
        definition of every dyadic  ->  -   ->end
        definition of every monadic  ->  -   ->end
        error reports for dyadic (common)  -> 
        error reports for monadic (common)  -> 
principal
        function  -> 
        subexpression  -> 

print file (using lpr)  -> 
        previewing  -> 
Print function  -> 
print... attributes  -> 
        printfile: previewing the file  -> 
Printing Precision command  -> 
Printing Precision variable  -> 
printoutputmode attribute (and gif files)  -> 
priority attribute (adap)  -> ,   -> 
process 'a' illegal instruction error message  -> 
processes, delete defunct child  -> 
_profile system function  -> 
program development  -> 
program, see defined function, defined operator, script
programming environment, Emacs  -> 
progress indicators  -> 

protect... attributes  -> 
        arguments to protect attribute function  -> 
Protected Do, see Monadic Do
protected execution
        do  -> 
        error codes  -> 
        Execute function  -> 
        omitted error reports when stopped within  -> 
        Protected Execute Flag
                effect on protected execution  -> 
                system command  -> 
                system variable  -> 
        tracing  -> ,   -> 
protocol (adap service descriptor attribute)  -> 
protocols, adap  -> 
PWD environment variable  -> ,   -> ,   -> ,   -> ,   -> 

Index - Q

Quad-divide, dyadic (Solve function)  -> 
Quad-divide, monadic (Matrix Inverse function)  -> 
qualifiers for Format system function  -> 
query language, database  -> 
questions  -> 
queue status (adap)  -> 
Queue, Status of Read (adap)  -> 
Queue, Status of Write (adap)  -> 
queuing of event messages  -> 
quit, window  -> 
quotation mark  -> 
        multiple lines within  -> 

Index - R

R attribute  -> 
r attribute  -> 
radio display class  -> 
        arguments to attribute functions  -> 
raise attribute  -> 
raised, window  -> 
Rake function  -> 
Random integers (Roll function)  -> 
        without replacement (Deal function)  -> 
Random Link command  -> 
Random Link variable  -> 
Range, see Bins, b.r and b.pr
ranges, grouping by (t)  -> 
rank  -> ,   -> 
        maxrank error  -> 
Rank operator  -> ,   -> ,   -> ,   -> 
        deriving dyadic  -> 
        deriving monadic  -> 
        similarity to dyadic scalar function  -> 
        similarity to Outer Product operator  -> 
Ravel function  -> 
raw protocol (adap)  -> 
Raze function  -> 
rband... attributes  -> 
        callbacks for rband  -> 
rBufsize (adap)  -> 
read
        see also file, mapped file, attributes, get
        event (adap)  -> 
        files  ->  -   ->end
                Pipe In command  -> 
                read-only file (mapped file)  -> 
                read-write file (mapped file)  -> 
        primary selection buffer  -> 
        Read Queue Status (adap)  -> 
        Read, Synchronous (adap)  -> 
        readImport error, adap  -> 
real classes, list of, s.realClasses   -> 
realize attribute  -> 
reapportioning, windows  -> 
Reciprocal function  -> 
recognition
        of itemwise changes  -> 
        of itemwise dependence  -> 
Recursive Association List to Nested Slotfiller function  -> 
recursively attribute  -> 
Reduce operator  -> ,   -> 
Reduction (Reduce operator)  -> 
refer... attributes  -> 
        callbacks for refer  -> ,   -> 
        callbacks for referpoint  -> 
reference count  -> ,   -> ,   -> 
        file  -> 
reference display class  -> 
Refresh all Objects function  -> 
refresh attribute  -> 
refreshing of screen
        and dependencies  -> 
        and done attribute  -> 
relational database and t  -> 
relational set operations (t)  -> 
Release Code variable  -> 
`releaseCode system variable  -> 
release notes  -> 
remote use of mapped file  -> 
Remove Dependency Definition command  -> 
Remove Dependency Definition function  -> 
removing columns from a t table  -> 
reparent attribute  -> 
Replace All function  -> 
replace, see search
Replicate function  -> 
replication side of a link (t)  -> 
report display class  -> 
report, error, form of  -> 
report... attributes  -> 
representation
        of C-language structures in A+  -> 
        of numbers  -> 
        of variables  -> ,   -> 
        Representation (Encode function)  -> 
request attribute  -> ,   -> 
Reset (adap)  -> 
reset event (adap)  -> 
Reset system command  -> 
$reset system command  -> 
Reshape function  -> ,   -> 
reshow attribute  -> 
Residue function  -> 
resize
        attribute (s)  -> 
        corner  -> 
        window  -> 
resizeable attribute  -> 
resizing columns by dragging  -> ,   ->* 
respace attribute  -> 
Restore the Captured Screen Configuration function  -> 
restricted whole number  -> ,   -> 
Restructure function  -> 
result
        defined function  -> 
        defined operator  -> 
        dependency  -> 
        execution  -> 
        expression  -> 
        expression group  -> 
        shape for dyadic scalar function  -> 
        shape for monadic scalar function  -> 
Result function  -> 
retrieving clipped text  -> 
retry (adap service descriptor attribute)  -> 
Return key  -> 
rEventMode attribute (adap)  -> 
Reverse function  -> 
Rho, dyadic (Reshape function)  -> 
Rho, monadic (Shape function)  -> 
right argument  -> 
Right function  -> 
right... attributes  -> 
$rl system command  -> 
`rl system variable  -> 
Roll function  -> 
root context  -> ,   -> 
root object  -> 
Rotate function  -> 
rounding  -> ,   -> 
        in Cast  -> 
        rules, IEEE  -> 
row  -> 
        row and column selection (t)  -> 
row... attributes  -> 
rPause (adap)  -> 
rPriority (adap)  -> 
rQueueStatus (adap)  -> 
rule... attributes  -> 
running products (Scan operator, with Multiply)  -> 
running sums (Scan operator, with Add)  -> 

Index - S

s context  -> 
        functions  -> 
                see also primitive functions
                load  -> 
                save  -> 
        loading into A+  -> 
        variables  -> ,   -> 
s.ABORT parameter  -> 
s.are function  -> 
s.attributes function  -> 
s.AUTOBLANK parameter  -> 
s.AUTOBUILD variable  -> ,   -> 
s.AUTODOC variable  -> 
s.AUTOEDITSPACE switch  -> 
s.AUTOEVALUATE switch  -> 
s.AUTOEXECUTE switch  -> 
s.AUTOHAS switch  -> 
s.AUTONEWSHOW switch  -> 
s.AUTOPOSITION switch  -> 
s.AUTOPRINTABLE switch  -> 
s.AUTOREPARENT switch  -> 
s.AUTOREPARENT switch  -> 
s.AUTORESHOW switch  -> ,   -> 
s.AUTORESPACE switch  -> 
s.AUTOSCRIPT switch  -> 
s.AUTOWS switch  -> 
s.BACKINGSTORE switch  -> 
s.BEEP parameter  -> 
s.beHere function  -> 
s.BLACK system attribute default variable  -> 
s.BLUE system attribute default variable  -> 
s.boundTo function  -> 
s.box function  -> 
s.BUSY parameter  -> 
s.c3c function  -> 
s.c3h function  -> 
s.call function  -> 
s.canBe function  -> 
s.canHave function  -> 
s.cc3 function  -> 
s.CDE dependency  -> 
s.ch function  -> 
s.classes function  -> 
s.classesHaving function  -> 
s.classHas function  -> 
s.CLOCK parameter  -> 
s.closest function  -> 
s.color function  -> 
s.COLOR_NAMES variable  -> 
s.COLOR_NUMBERS variable  -> 
s.CONNECTED parameter  -> 
s.copy function  -> 
s.DATASPACE parameter  -> 
s.defaultOf function  -> 
s.derivedFrom function  -> 
s.desktop function  -> 
s.DISCONNECT parameter  -> 
s.doc function  -> 
s.doesNotUse function  -> 
s.domainOf function  -> 
s.DOUBLECLICKINTERVAL parameter  -> 
s.EDITSPACE parameter  -> 
s.ERROR parameter  -> 
s.execute function  -> 
s.EXIT parameter  -> 
s.FILLCOLORS parameter  -> 
s.font function  -> 
s.FONT system attribute default variable  -> 
s.FONT_NAMES variable  -> 
s.functions function  -> 
s.GREEN system attribute default variable  -> 
s.GREY system attribute default variable  -> 
s.Has function  -> 
s.hasDefault function  -> 
s.hc function  -> 
s.hc3 function  -> 
s.hscroll function  -> 
s.LINECOLORS parameter  -> 
s.LINESTYLES parameter  -> 
s.load function  -> 
s.MENUDEFAULTMNEMONIC switch  -> 
s.metaClasses function  -> 
s.MSG parameter  -> 
s.NA parameter  -> 
s.objects function  -> 
s.Of function  -> 
s.ofClass function  -> 
s.ofParent function  -> 
s.parentHas function  -> 
s.popups function  -> 
s.primitiveTo function  -> 
s.QUIET parameter  -> 
s.ral function  -> 
s.realClasses function  -> 
s.RED system attribute default variable  -> 
s.refresh function  -> 
s.reset function  -> 
s.rsf function  -> 
s.save function  -> 
s.SCREEN parameter  -> 
s.script function  -> 
s.setcurrentws function  -> 
s.shade function  -> 
s.SHELL parameter  -> 
        reversing the effect  -> 
s.shells function  -> 
s.subClasses function  -> 
s.superClasses function  -> 
s.this function  -> 
s.toplevels function  -> 
s.TRACESYMBOLS parameter  -> 
s.used function  -> 
s.usedBy function  -> 
s.uses function  -> 
s.using function  -> 
s.VERIFY parameter  -> 
s.virtualClasses function  -> 
s.vscroll function  -> 
s.warpPointer function  -> 
s.which function  -> 
s.WP parameter  -> 
s.WS parameter  -> 
s.wslist function  -> 
s.WSNAME parameter  -> 
s.wstree function  -> 
s.YELLOW system attribute default variable  -> 
sash, window, movable  -> ,   -> 
save attribute  -> 
        callbacks for  -> 
Save the Captured Screen Configuration function  -> 
scalar  -> ,   -> 
        display class  -> 
                arguments to attribute functions  -> 
                user interaction with  -> 
        extension  -> 
Scalar Comma Fix Input function  -> 
Scalar Fix Input function  -> 
Scan operator  -> ,   -> 
scanning, graph  -> 
scatter trace style  -> 
_scb system function  -> ,   -> ,   -> 
_scd system function  -> 
_scfi system function  -> 
scope
        function  -> 
        name  -> 
        operator  -> ,   -> 
screen  -> 
        configuration
                capture, s.script  -> 
                restore, s.load  -> 
                save, s.save  -> 
        editing  -> 
        entry of data  -> 
        input  -> 
        interactions  -> 
        invalid input  -> 
        management  -> 
                establish functions  -> 
                functions  -> 
        refreshing
                and dependencies  -> 
                and done attribute  -> 
        size  -> 
Screen Format function  -> 
screens (multiple), choosing one for s  -> 
script  -> ,   -> 
        attribute  -> 
        capturing screen, s.script  -> 
        file  -> 
                Abort Loading of Script function  -> 
                search order  -> 
        parsing  -> 
        tracking  -> 
        variables vs. functions, recognition  -> 
scroll bar  -> 
Scroll Together Horizontally, s.hscroll, Vertically, s.vscroll  -> 
scroll... attributes  -> 
scrolling, window  -> 
        synchronized  -> ,   -> ,   -> 
search
        Find  -> 
        General Search and Replace  -> 
        Name Search  -> 
        Name Search and Replace  -> 
        String Search  -> 
        String Search and Replace  -> 
search order
        mapped file  -> 
        script file  -> 
seconds in epoch from local time  -> 
Seconds in Epoch function  -> 
sector, see desktop
segment trace style  -> 
segv error  -> ,   -> ,   -> 
Segv Error Flag variable  -> 
`segvexit system variable  -> 
select error, adap  -> 
select... attributes  -> 
        arguments to selectable attribute function  -> 
        callbacks for
                select  -> 
                selectcol  -> 
                selectcorner  -> 
                selectfield  -> 
                selectrow  -> 
selection
        primary selection buffer  -> 
        row and column (t)  -> 
        window  -> 
Selective Assignment function  -> 
        see also Assignment function
        and dependencies  -> 
        Append  -> 
        assignment in place (performance)  -> 
        Brace Assignment  -> 
        causes callbacks  -> 
        defined functions in  -> 
        primitive functions in  -> 
        Replace All  -> 
        target of  -> 
        Value in Context on left  -> ,   -> 
        Value on left  -> ,   -> 
Selective specification (Selective Assignment function)  -> 
semantics of A+  -> 
Send, Asynchronous (adap)  -> 
Send, Synchronous (adap)  -> 
sensitive attribute  -> 
sent event (adap)  -> 
Separate Symbols function  -> 
server  -> 
        disconnect  -> 
service descriptor (adap)  -> 
service handle (adap)  -> 
set
        see also file, mapped file, attributes, write
        attribute  -> 
        difference (t tables)  -> 
        operations (t)  -> 
        Set Attribute Default Variables or Values function  -> 
        Set Attribute function  -> 
        Set Attribute Value (adap)  -> 
        Set Callback function  -> ,   -> 
        Set Client Data (adap)  -> 
        Set Client Data function  -> 
        Set Current CDE Workspace function  -> 
        Set Preset Callback function  -> ,   -> ,   -> 
        Set System Variable function  -> 
        Set Timer (adap)  -> 
_set system function  -> 
set... attributes  -> 
$Sf system command  -> 
`Sf system variable  -> 
_sfi system function  -> 
_sfmt system function  -> 
$sfs system command  -> 

shadowthickness attribute  -> 
shape  -> ,   -> 
        Shape function  -> ,   ->* 
shared libraries  -> 
shell  -> 
        invoking A+ from  -> 
shell... attributes  -> 
shells, list of: s.shells  -> 
show function  -> ,   -> 
show... attributes  -> 
$si system command  -> 
`si system variable  -> 
Sign function  -> 
Signal function  -> 
signalling errors from dynamically loaded code  -> 
simple array  -> ,   -> 
simple protocol (adap)  -> 
simultaneously mapped file, writing and reading  -> 
sine  -> 
single mode (adap read)  -> ,   -> 
singleton (scalar) extension  -> 
sinh  -> 
Size (Shape function)  -> 
size attribute  -> 
sleep: sys.sleep  -> 
slider display classes
        hgauge  -> 
        hscale  -> 
        vgauge  -> 
        vscale  -> 
slider... attributes  -> 
slot
        area  -> 
                index of  -> 
        display class  -> 
                arguments to attribute functions  -> 
slotfiller  -> 
        action display class  -> 
        determination  -> 
        for specifying attributes  -> 
        from association list  -> 
        slot display class  -> 
        to nested association list  -> 
        validation  -> 
        with boolean value  -> 
socket
        accept: sys.sockaccept  -> 
        block: sys.sockblock  -> 
        connect: sys.sockconnect  -> 
        fork exec: sys.sfe  -> 
        listen: sys.socklisten  -> 
        options, get: sys.getsockopt  -> 
        options, set: sys.setsockopt  -> 
        read
                and return status: sys.areadstat  -> 
                sys.aread  -> 
                timed: sys.areadwait  -> 
        write: sys.awrite  -> 

Solve function  -> 
Sort, see Grade down function, Grade up function, Bins function
sorted arguments for b-context functions  -> 
sorted derived table, dynamic (t)  -> 
source code, browsing  -> 
source for view (t)  -> 
space  -> 
space attribute  -> 
spacing in program definitions  -> 
_spcb system function  -> ,   -> ,   -> 
special character sequence  -> 
Specification (Assignment function)  -> 
spreadsheet  -> 
        also see dependency
SQL  -> 
_ss system function  -> 
_ssr system function  -> 
_ssv system function  -> 
stack references  -> 
        also see execution stack
stack trace style  -> 
Stale NFS file handle error report  -> 
Standard Input variable  -> 
stars attribute  -> 
stars indicating depth  -> 
starting A+
        from a shell  -> 
        from Emacs  -> ,   -> 
starting ws size  -> 
State Indicator command  -> 
state... attributes  -> 
statement, entry of  -> 
static data (for callback)  -> ,   -> 
static link, direct (t)  -> 
static linking of C and C++ routines  -> 
static scope  -> 
static summary, direct (t)  -> 
status indicators  -> 
Status of Read Queue (adap)  -> 
Status of Write Queue (adap)  -> 
stdin  -> 
`stdin system variable  -> 
step trace style  -> 
stepscatter trace style  -> 
sticky contained object, resizing  -> 
sticky fields (fixedfields attribute)  -> 
Stop
        primitive function  -> 
        system command  -> 
        system variable  -> 
        within protected execution  -> 
$stop system command  -> 
`stop system variable  -> 
storage  -> 
        backing, inhibiting use  -> 
Store (c.place...)  -> 
strand  -> 
        Assignment  -> ,   -> 
        syntax of  -> 
strdup()  -> 
stream protocol (adap)  -> 
string  -> 
string protocol (adap)  -> 
string search
        also see search
        String Search and Replace function  -> 
        String Search function  -> 
structure
        attribute (s)  -> 
        c  -> 
                also see c context
        of data  -> 
style attribute  -> ,   -> 
        arguments to attribute function  -> 
Sub (Bracket Indexing function)  -> 
subclasses, list of: s.subClasses  -> 
subframe  -> 
subtitle... attributes  -> 
Subtract function  -> 
subtypes  -> 
Successive Grouping function (t)  -> 
summarization function (t)  -> 
summary, direct static (t)  -> 
Summation (Reduce operator, with Add)  -> 
superclasses, list of: s.superClasses  -> 
supertypes  -> 
suppressduplicate attribute  -> 

suspended function  -> 
        abandoning execution  -> 
        clearing  -> 
        resuming execution  -> 
symbol  -> 
        attribute  -> ,   -> 
                arguments to attribute function  -> 
        constant, syntax of  -> 
        set  -> 
        type  -> 
symbolic link, create  -> 
symbols
        APL, see Symbols section of index or Table B-1(a)
        in c  -> 
symbolsize attribute  -> ,   -> 
        arguments to attribute function  -> 
Synchronize a Mapped File: sys.amsync  -> 
synchronized scrolling  -> ,   -> ,   -> 
synchronous communication (adap)  -> 
Synchronous Exchange (adap)  -> 
Synchronous Read (adap)  -> 
Synchronous Send (adap)  -> 
syncshow attribute  -> 
syntactic class  -> 
syntax of A+  -> 
sys context  -> 
sys.access function (file)  -> 
sys.agetdents function  -> 
sys.alstat function (file)  -> 
sys.amsync function (file)  -> 
sys.aread function  -> 
sys.areadlink function  -> 
sys.areadstat function  -> 
sys.areadwait function  -> 
sys.aselect function  -> 
sys.astat function (file stats)  -> 
sys.awrite function  -> 
sys.chdir function  -> 
sys.chmod function  -> 
sys.chown function  -> 
sys.close function (close file)  -> 
sys.closelog function  -> 
sys.cpu function  -> 
sys.creat function (create file)  -> 
sys.dup function (file descriptor)  -> 
sys.dup2 function (file descriptor)  -> 
sys.errno function  -> 
sys.errsym function  -> 
sys.exit function  -> 
sys.exp function  -> 
sys.export function  -> 
sys.fchmod function  -> 
sys.fchown function  -> 
sys.fcntl function  -> 
sys.fflush_stdout function  -> 
sys.filesize function  -> 
sys.flock function (file lock)  -> 
sys.fsync function (file synch)  -> 
sys.ftruncate function (file)  -> 
sys.getdomainname function  -> ,   -> 
sys.getdtablesize function (file descriptors)  -> 
sys.geteuid function  -> 
sys.getgid function  -> 
sys.gethostname function  -> 
sys.getpid function  -> 
sys.getppid function  -> 
sys.getsockopt function  -> 
sys.gettod function  -> 
sys.getuid function  -> 
sys.getusername function  -> 
sys.imp function  -> 
sys.import function  -> 
sys.ioctl function  -> 
sys.kill function  -> 
sys.link function  -> 
sys.lseek function (file pointer)  -> 
sys.mkdir function  -> 
sys.mkts1 function  -> 
sys.open function (file)  -> 
sys.openlog function  -> 
sys.pathfind function (file)  -> 
sys.perror function  -> 
sys.read function (file)  -> 
sys.readenv function  -> 
sys.readinto function  -> 
sys.readmat function  -> 
sys.rename function (file)  -> 
sys.rmdir function  -> 
sys.secs_in_epoch function  -> 
sys.setenv function  -> 
sys.setsockopt function  -> 
sys.sfe function  -> 
sys.sleep function  -> 
sys.sockaccept function  -> 
sys.sockblock function  -> 
sys.sockconnect function  -> 
sys.socklisten function  -> 
sys.symlink function  -> 
sys.syslog function  -> 
sys.system function  -> 
sys.truncate function (file)  -> 
sys.ts function  -> 
sys.ts1 function  -> 
sys.ts1gmt function  -> 
sys.tsgmt function  -> 
sys.tzset function  -> 
sys.umask function (file)  -> 
sys.unlink function  -> 
sys.updtime function (file)  -> 
sys.username function  -> 
sys.write function (file)  -> 
sys.zombiekiller function  -> 
system
        attribute default variable  -> 
        call: sys.system  -> 
        command  -> 
                see also system commands
                classification of every  -> 
                definition of every  ->  -   ->end
                for dependencies  -> 
                syntax of  -> 
                through Execute  -> 
        commands, see separate entry
        function  -> 
                see also system functions
                classification of every  -> 
                definition of every  ->  -   ->end
                error reports (common)  -> 
                for dependencies  -> 
                name argument for  -> 
                querying syntax  -> 
                tracing of  -> 
        functions, see separate entry
        name, syntax of  -> 
        time  -> 
        variable  -> 
                see also system variables
                classification of every  -> 
                definition of every  ->  -   ->end
                name domain  -> 
                referencing  -> 
                setting  -> 
                values of several  -> 
        variables, see separate entry
system commands
        see also system command
        $| (Pipe)  -> 
        $< (Pipe In)  -> 
        $> (Pipe Out)  -> 
        $>> (Pipe Out Append)  -> 
        $cd  -> 
        $cmds  -> 
        $cx  -> 
        $cxs  -> 
        $dbg  ->* ,   -> 
        $def  -> ,   -> 
        $dep  -> ,   -> 
        $deps  -> ,   -> 
        $Df  -> 
        $Ef  -> 
        $ex  -> 
        $excxt  -> 
        $fns  -> 
        $Gf  -> 
        $globs  -> 
        $load  -> 
        $loadrm  -> 
        $maplim  -> 
        $mode  -> 
        $off  -> 
        $ops  -> 
        $pp  -> 
        $reset  -> 
        $rl  -> 
        $Sf  -> 
        $sfs  -> 
        $si  -> 
        $stop  -> 
        $Tf  -> 
        $undef  -> 
        $vars  -> 
        $vers  -> 
        $wa  -> 
        $Xf  -> 
        $xfs  -> 
system functions
        see also system function
        _abortload  -> 
        _alldep  -> ,   -> 
        _alsf  -> 
        _atts  -> 
        _cd  -> 
        _cfi  -> 
        _dbg  -> 
        _def  -> ,   -> 
        _dep  -> ,   -> 
        _dyld  -> 
        _ex  -> 
        _excxt  -> 
        _exit  -> 
        _fi  -> 
        _flat  -> 
        _fmt  -> 
        _gcb  -> 
        _gcd  -> 
        _get  -> 
        _gfmtsym  -> 
        _gpcb  -> 
        _gsr  -> 
        _gsv  -> 
        _hashstat  -> 
        _index  -> 
        _index_of  -> 
        _issf  -> 
        _items  -> 
        _load  -> 
        _loadrm  -> 
        _locals  -> 
        _name  -> 
        _nanfind  -> 
        _nc  -> 
        _nl  -> ,   -> 
        _ns  -> 
        _nsr  -> 
        _profile  -> 
        _scb  -> ,   -> ,   -> 
        _scd  -> 
        _scfi  -> 
        _set  -> 
        _sfi  -> 
        _sfmt  -> 
        _spcb  -> ,   -> ,   -> 
        _ss  -> 
        _ssr  -> 
        _ssv  -> 
        _undef  -> 
        _valence  -> 
        _wa  -> 
System Functions command  -> 
system variables
        see also system variable
        `busexit  -> 
        `corelim  -> 
        `cx  -> 
        `Df  -> 
        `dyme  -> 
        `Ef  -> 
        `Gf  -> 
        `language  -> 
        `loadfile  -> 
        `majorRelease  -> 
        `maplim  -> 
        `minorRelease  -> 
        `mode  -> 
        `phaseOfRelease  -> 
        `pp  -> 
        `releaseCode  -> 
        `rl  -> 
        `segvexit  -> 
        `Sf  -> 
        `si  -> 
        `stdin  -> 
        `stop  -> 
        `Tf  -> 
        `vers  -> 
        `Xf  -> 
        `Xfpef  -> 

Index - T

t attribute (s)  -> 
t context  -> 
        _A  -> 
        _D  -> 
        _D_  -> 
        _F  -> 
        _G_r  -> 
        _H_l  -> 
        _I_l  -> 
        _J  -> 
        _J_r  -> 
        _K  -> 
        _K_r  -> 
        _L  -> 
        _L_  -> 
        _M  -> 
        _N  -> 
        _O  -> 
        _R  -> 
        _R_  -> 
        _S  -> 
        _S_  -> 
        _T  -> 
        _T_  -> 
        _U  -> 
        _V  -> 
        _V_  -> 
        selector functions  -> 
        t-created variables and dependencies  -> 
        variables  -> 
t.also function  -> 
t.always function  -> 
t.break function  -> 
t.calendar function  -> 
t.cat function  -> 
t.close function  -> 
t.CONNECT variable  -> 
t.define function  -> 
t.detach function  -> 
t.disperse function  -> 
t.fix function  -> 
t.group function  -> 
t.group_d function  -> 
t.group_i function  -> 
t.in function  -> 
t.index function  -> 
t.let function  -> 
t.link function  -> 
t.link_b function  -> 
t.link_d function  -> 
t.link_i function  -> 
t.na function  -> 
t.NA variable  -> 
t.not function  -> 
t.only function  -> 
t.open function  -> 
t.partition function  -> 
t.relate function  -> 
t.report function  -> 
t.reset function  -> 
t.sample function  -> 
t.send function  -> 
t.series function  -> 
t.sort function  -> 
t.sorted function  -> 
t.table function  -> 
t.TABLES variable  -> 
t.view function  -> 
tab character  -> 
tab... attributes  -> 
table
        see also matrix
        dependency (t)  -> 
        display class  -> 
                arguments to attribute functions  -> 
                moving about in  -> 
                moving columns by dragging  -> ,  ->* 
                resizing columns by dragging  -> ,   ->* 
                user interaction with  -> 
        in t  -> 
                linked tables  -> 
        matrix  -> 
        variable (t)  -> 
tableField display class
        arguments to attribute functions  -> 
        child of display class table  -> 
tabs of notebook: showtabs attribute  -> 
tabs, used in function definition  -> 
Take function  -> ,   -> 
        fill elements  -> 
Tally (Count function)  -> 
tangent  -> 
tanh  -> 
target
        Assignment  -> ,   -> 
        for view (t)  -> 
        Selective Assignment  -> 
Terminal Flag command  -> 
Terminal Flag variable  -> 
terms used in this manual  -> 
terms, data  -> 
text
        areas of a graph  -> 
        clipping  -> ,   -> 
        display class  -> 
                arguments to attribute functions  -> 
                user interaction with  -> 
        trace (of graph)  -> 
                manipulation  -> 
                style  -> 
textactivate attribute  -> 
        callbacks for  -> 
$Tf system command  -> 
`Tf system variable  -> 

3down attribute  -> 
        callbacks for  -> 
3up attribute  -> 
        callbacks for  -> 
time
        cpu (process)  -> 
        elapsed  -> 
        format  -> 
        GMT  -> 
        GMT, from seconds in epoch  -> 
        local  -> 
        local, from seconds in epoch  -> 
        of day  -> 
        Reset Time Zone  -> 
        seconds in epoch  -> 
        seconds in epoch from local  -> 
        system  -> 
        Time function  -> 
        Time in Seconds function  -> 
        time series (t)  -> 
        user  -> 
timeout, adap  -> 
        error  -> 
        Get Timeout  -> 
timer  -> 
        events (adap)  -> 
        handle (adap)  -> 
        Modify Timer (adap)  -> 
        Set Timer (adap)  -> 
Times (Multiply function)  -> 
timing functions and expressions  -> 
        primitive function execution counts  -> 
title... attributes  -> 
        title  -> ,   -> 
                default setting  -> 
        titles (pagetitle)  -> 
tolerably equal  -> ,   -> 
tolerance, comparison  -> 
top... attributes  -> 
top-level window  -> 
        default creation (s.SHELL)  -> 
        list of every: s.toplevels  -> 
trace (set), graph  -> 
tracing  -> 
        see also debugging
        dependencies  -> 
        depth of  -> 
        of Execute (Protected or not)  -> 
        of Monadic Do  -> 
tracking files  -> 
trailing axis (dimension)  -> ,   -> 
transcendental function  -> 
Transpose Axes function  -> 
Transpose function  -> 
Transpose, dyadic (Transpose Axes function)  -> 
traversal
        window  -> 
        within a display object  -> 
        within a layout  -> 
Tree Dependency function  -> 
tree display class  -> 
        arguments to attribute functions  -> 
        user interaction with  -> 
trigonometric functions  -> 

tutorial scripts
        A+ (general)  -> 
        s (screen management)  -> 
        t (database)  -> 
2down attribute  -> 
        callbacks for  -> 
2up attribute  -> 
        callbacks for  -> 
type  -> ,   -> 
        change
                Bitwise Cast derived function  -> 
                Cast function  -> 
                Ceiling function  -> 
                Default Format function  -> 
                fix input functions  -> ,   -> ,   -> ,   -> 
                Floor function  -> 
                Format function  -> 
                Pack function  -> 
                Unpack function  -> 
        general  -> 
Type function  -> ,   -> 

Index - U

uextInstall function (for static link)  -> 
Uncover (Disclose function)  -> 
$undef system command  -> 
_undef system function  -> 
underline attribute  -> 
        arguments to attribute function  -> 
undo  -> 
Unequal (Not equal to function)  -> 
UNI mode (input)  -> 
uniform
        complementary frames  -> 
        counts  -> 
        frames  -> 
uniformscaling attribute  -> 

union (t tables)  -> 
Unix  -> 
        commands  -> 
        file name  -> 
        reading file from cache page  -> 
        running A+ from  -> 
        system call  -> ,   -> 
        text files  -> 
unknown type  -> 
unlink file  -> 
unmapping of files, tracing  -> 
Unpack function  -> 
upto attribute  -> 
Use Variables function (s)  -> 
user interactions with displays  -> 

user name
        qualified  -> 
        syntax of  -> 
        unqualified  -> 
User Name from ID function: sys.username  -> 
User Name function: sys.getusername  -> 
user time  -> 
Users of a Variable function  -> 

Index - V

valence  -> 
        derived function  -> 
Valence function  -> 
_valence system function  -> 
valid... attributes  -> 
        callbacks for validate  -> 
value
        area
                in the choice display class  -> 
                in the command display class  -> 
        of a name  -> 
        of an attribute  -> 
        Value function  -> 
                Assignment  -> 
        Value in Context function  -> 
                Assignment  -> 
        Values of Attributes for a Class function (s)  -> 
value... attributes  -> 
variable  -> 
        attribute  -> 
        callback function for  -> 
        display format  -> 
        Emacs A+ mode variables  -> 
        for attribute
                get, s.Of  -> 
                no longer use, s.doesNotUse  -> 
                set, s.Has  -> 
                system default  -> 
                use, s.uses  -> 
                users of, s.using  -> 
        global  -> 
        local  -> 
        name, removing from a display  -> 
        value in workspace  -> 
        value on screen  -> 
        Variable Can Be of Class function  -> 
        Variables command  -> 
        visual representation  -> ,   -> 
$vars system command  -> 
vcol... attributes  -> 
vector  -> 
verify attribute  -> 
$vers system command  -> 
`vers system variable  -> 
Version command  -> 
Version variable  -> 
verticalspace attribute  -> 
vgauge display class  ->* ,  -> 
vgrid display class  ->* ,  -> 
        arguments to attribute functions  -> 
view
        display class  -> 
                arguments to attribute functions  -> 
        fixing (t)  -> 
        populate a t table  -> 
        t  -> 
viewing a PostScript file (printfile)  -> 
virtual
        classes, list of: s.virtualClasses  -> 
        column  -> ,   -> ,   -> 
        desktop, see just desktop
        row  -> ,   -> ,   -> 
visibility
        popup (pin attribute)  -> 
        toplevel (exit attribute)  -> 
visible use of name  -> ,   -> 
visual class, see display class
visualization of data  -> 
vmenu display class  -> ,   -> 
        arguments to attribute functions  -> 
vpane display class  -> ,   -> 
        arguments to attribute functions  -> 
vrow... attributes  -> 
vscale display class  -> ,  -> ,  -> 
        user interaction with  -> 
vscroll... attributes  -> 

Index - W

W attribute  -> 
w attribute  -> 
$wa system command  -> 
_wa system function  -> 
warning message  -> ,   -> 
        C  -> 
wBufsize (adap)  -> 
well-formed expression  -> 
while statement  -> ,   -> 
        syntax of  -> 
whole number, restricted  -> ,   -> 
widget  -> 
window  -> 
        body  -> 
        display class  -> 
                arguments to attribute functions  -> 
wNodelay (adap)  -> 
workspace  -> 
        screen workspace  -> ,   -> ,   -> 
        tracing Work Area and Workspace Available  -> 
        Work Area function  -> 
        Workspace Available command  -> 
Workstation and Port Information (adap)  -> 
wPause (adap)  -> 
wPriority (adap)  -> 
wQueueStatus (adap)  -> 
write
        see also file, mapped file, attributes, set
        file  ->  -   ->end
                Pipe Out Append command  -> 
                Pipe Out command  -> 
        primary selection buffer  -> 
        Write Queue Status (adap)  -> 
ws attribute  -> 
wsfull error  -> 
        atmp  -> 
        error code  -> 
        resumption with increased workspace  -> 

Index - X

X attribute  -> 
x attribute  -> 
x context (unavailable in A+)  -> 
X event  -> 
        disabling  -> 
        enabling  -> 
        X Events Flag command  -> 
        X Events Flag variable  -> 
xaxis attribute  -> ,   -> 
        arguments to attribute function  -> 
xextent attribute  -> 
$Xf system command  -> 
`Xf system variable  -> 
xfg attribute  -> 
`Xfpef system variable  -> 
$xfs system command  -> 
xinc attribute  -> 
xlabel... attributes  -> 
        arguments to xlabel attribute function  -> 
        arguments to xlabelout attribute function  -> 
xleft attribute  -> 
xlegend attribute  -> 
xlsfonts  -> 
xmajorticksize attribute  -> 
xmax attribute  -> 
xmin attribute  -> 
xminortick... attributes  -> 
xright attribute  -> 
xs attribute  -> 
xsublabel... attributes  -> 
        arguments to xsublabel attribute function  -> 
        arguments to xsublabelout attribute function  -> 
XTerm  -> 
xtitle... attributes  -> 

Index - Y-Z

Y attribute  -> 
y attribute  -> 
yaxis attribute  -> ,   -> 
        arguments to attribute function  -> 
ybottom attribute  -> 
ylabel... attributes  -> 
        arguments to ylabel attribute function  -> 
        arguments to ylabelout attribute function  -> 
ylegend attribute  -> 
ymode attribute  -> ,   -> 
ys attribute  -> 
ytitlestyle attribute  -> 
ytop attribute  -> 
YX attribute  -> 
yx attribute  -> 
yxs attribute  -> 

zero attribute  -> 
zero axes of graphs  -> 
zero length message, adap  -> 
zerofg attribute  -> 
zerostyle attribute  -> 
zerowidth attribute  -> 

zooming  -> 

        graph  -> ,   -> 
                detecting  -> 
                undoing programmatically  -> 

About the Index

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_94.html0000444000265000001440000004624710737165272013671 A+ Reference: Appendix: GNU Free Documentation License

Appendix: GNU Free Documentation License

GNU Free Documentation License

Table of Contents


GNU Free Documentation License

Version 1.1, March 2000

Copyright (C) 2000  Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.

0. PREAMBLE

The purpose of this License is to make a manual, textbook, or other written document "free" in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others.

This License is a kind of "copyleft", which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software.

We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference.

1. APPLICABILITY AND DEFINITIONS

This License applies to any manual or other work that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. The "Document", below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as "you".

A "Modified Version" of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language.

A "Secondary Section" is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (For example, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them.

The "Invariant Sections" are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License.

The "Cover Texts" are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License.

A "Transparent" copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, whose contents can be viewed and edited directly and straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup has been designed to thwart or discourage subsequent modification by readers is not Transparent. A copy that is not "Transparent" is called "Opaque".

Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML designed for human modification. Opaque formats include PostScript, PDF, proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML produced by some word processors for output purposes only.

The "Title Page" means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, "Title Page" means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text.

2. VERBATIM COPYING

You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3.

You may also lend copies, under the same conditions stated above, and you may publicly display copies.

3. COPYING IN QUANTITY

If you publish printed copies of the Document numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects.

If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages.

If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a publicly-accessible computer-network location containing a complete Transparent copy of the Document, free of added material, which the general network-using public has access to download anonymously at no charge using public-standard network protocols. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public.

It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document.

4. MODIFICATIONS

You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version:

  • A. Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission.
  • B. List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has less than five).
  • C. State on the Title page the name of the publisher of the Modified Version, as the publisher.
  • D. Preserve all the copyright notices of the Document.
  • E. Add an appropriate copyright notice for your modifications adjacent to the other copyright notices.
  • F. Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below.
  • G. Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice.
  • H. Include an unaltered copy of this License.
  • I. Preserve the section entitled "History", and its title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section entitled "History" in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence.
  • J. Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the "History" section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission.
  • K. In any section entitled "Acknowledgements" or "Dedications", preserve the section's title, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein.
  • L. Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles.
  • M. Delete any section entitled "Endorsements". Such a section may not be included in the Modified Version.
  • N. Do not retitle any existing section as "Endorsements" or to conflict in title with any Invariant Section.

If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version's license notice. These titles must be distinct from any other section titles.

You may add a section entitled "Endorsements", provided it contains nothing but endorsements of your Modified Version by various parties--for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard.

You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one.

The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version.

5. COMBINING DOCUMENTS

You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice.

The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work.

In the combination, you must combine any sections entitled "History" in the various original documents, forming one section entitled "History"; likewise combine any sections entitled "Acknowledgements", and any sections entitled "Dedications". You must delete all sections entitled "Endorsements."

6. COLLECTIONS OF DOCUMENTS

You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects.

You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document.

7. AGGREGATION WITH INDEPENDENT WORKS

A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, does not as a whole count as a Modified Version of the Document, provided no compilation copyright is claimed for the compilation. Such a compilation is called an "aggregate", and this License does not apply to the other self-contained works thus compiled with the Document, on account of their being thus compiled, if they are not themselves derivative works of the Document.

If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one quarter of the entire aggregate, the Document's Cover Texts may be placed on covers that surround only the Document within the aggregate. Otherwise they must appear on covers around the whole aggregate.

8. TRANSLATION

Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License provided that you also include the original English version of this License. In case of a disagreement between the translation and the original English version of this License, the original English version will prevail.

9. TERMINATION

You may not copy, modify, sublicense, or distribute the Document except as expressly provided for under this License. Any other attempt to copy, modify, sublicense or distribute the Document 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.

10. FUTURE REVISIONS OF THIS LICENSE

The Free Software Foundation may publish new, revised versions of the GNU Free Documentation 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. See http://www.gnu.org/copyleft/.

Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License "or any later version" applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation.

How to use this License for your documents

To use this License in a document you have written, include a copy of the License in the document and put the following copyright and license notices just after the title page:

      Copyright (c)  YEAR  YOUR NAME.
      Permission is granted to copy, distribute and/or modify this document
      under the terms of the GNU Free Documentation License, Version 1.1
      or any later version published by the Free Software Foundation;
      with the Invariant Sections being LIST THEIR TITLES, with the
      Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
      A copy of the license is included in the section entitled "GNU
      Free Documentation License".

If you have no Invariant Sections, write "with no Invariant Sections" instead of saying which ones are invariant. If you have no Front-Cover Texts, write "no Front-Cover Texts" instead of "Front-Cover Texts being LIST"; likewise for Back-Cover Texts.

If your document contains nontrivial examples of program code, we recommend releasing these examples in parallel under your choice of free software license, such as the GNU General Public License, to permit their use in free software.


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/APlusRefV2_AFrame_1.gif0000444000265000001440000002446707215453015014601 GIF87a,0I8ͻ`(dihlp,tmx|pH,Ȥrl:ШtJZجv ް hR9n<:~ z} ; 1ʲ0&ҷ۸ ^V<rc6QŋDŽ =I2Ċj}\i1^AbdIsÒ8Dd͟d΄ (9$DP1cHjeŔ⿧W&ڱسn][kth#+0lq;ːݿ+ë ^̸1D#=Y˘y IdMΨJְcz۸ͻ4 NJȓ+r|sKNسkνËO{~F˟OoES(hAt` =[ dfHBu (P!ib0(nga$-@)t5jwc`wL6xn=BiXfIdHᘢ$Sj)dZ)uTNrflf}`Jixη&uiƙ矀9&#& Z"j.*X6bI馜yf{v*!ݑB: Tꬴgj^b 檵k'z6z[ zk$աeU !yq-+(l-1r+¿dl)p?Y$VL&ǟ.* (2,b\B«쳛4,}8WA/ .OW-dVgݵhN`ud^+\mt=uur {3'~/]}[My؏ܗw~gч?Zӣ{9w{7>| _S|::+>}Z}z0=~ߚ39c;~κ;濯 Pt< <VmA%ng@  lSq#60?! G2"~[T(CN0d^ k X GF\T)I.1C"uH0K&- ]WtE."vg|#&E92vl;Ʊ#)0<RLe whD62|$&%I@G5)ʁʓֱJ9JбrR tTW)eH72ebIob0]s%3eiΈ#٬jrFLe4/n.sf6GtJdR8sx˛<+9Ui~R,'BNqjs e>#jluh Q5EfGё|h(MрT(-JRX"(4gJNJj>5N{Ӡ& FP1ΤҥNRUN޴jH:r5=Z?z'H1);yV6SJ+Q Wz Zׁ޵3zP2\^+5_e '.kXОPWC,jXIiŶhm*[mj{+\䶩jk{&Eū$(unS]*E+Zs.wk^w {K"U,}O I+D{XVn~5{ط]/y< ~+ 5 -%^fqJ,Zk*0={ x1ӌ7bߘ9&\cA co8ɟqe'CRll+/.ˎ2a)异d2\Ǔ+dnk_8wWm>siӌgڸbC;nh:}^LJ^tiD~oM +ϫN:},c<9E~ߕ;Y9Il18r-q|!xr\/:N]W'u֟ᨷMiM_' l.&,}d~jFQxW1FCg#.D{ $8&8"%'./؂082X,x146>HH:;u0 ,.S{=?RȃTUX8VYxZFh| x(D#hHIDž_^8pH]Xxxz(11^{g؁w!/ՇB;&2}P~H]{E38Kx5'} ؊&e˷wH]Hc|ʆ((5x4ȋ|:SGxs׋jȉHwk{ kͱэ(kXqXj6`(1Y2XXi*02yjЏ>iB!iIY$()'hq9i.=ɓ1i) "9 FYT&.7I@G;Xٕ[ɕWL6InSUYcy? Erٔ[Y`)&&АkyGIByx9ucvْC91-]Y-IoIfIg+YisH9rnF9)|lC!  k9LyDH4ٜ9)ecЩɝKA x虞깞y xI1Y\ўٟ )Yz ڠ:Zzڡ ":$Z&z(*,ڢ.02:4Z6z8:Rɣ?@>:Yw( FH`٤M\ڥ^Qjqha`cZeqvz!%Ԧa uzߠDn 1z zȠ! ziȊb}y߈:zOZTLaoZz*X"ᨼ zƪ]~К^: J ZǪq'ȧ0bJJ`zZxhL؆ӰZ*FB`` ZRrQAǰ { xr;uJZ KtLL'0{~/[I ~m9opm@[ 铮~Kpnn*ꨞꪎ*/4^~븞뺾>^~Ȟʾ>^~؞ھ>^~>^~ԇ_{@ (7m8Qc.^$ ND,b'O+)E*!__68//A.9wm1}" *jZEmYQX?5A2($UϷ-b[oJ;fIdWzb/kTm[wPig]_/rUTdoH]oqO[|}ObOsOGX_Vvp/hx2Z_c?_o?L_%oU/ofׯ|'$$koM?00. ŅdiB9kp,ťR/H< H1l,EųIuLXayun_pfs2.7$|l={.b4dRx|M~$J\}TP(wwknt@h^dZ<ŷǙ~:ɰϻ=FV˳!ѫvc-퓇;BRR09 % ua)82Vn'?22R\KPiQD~N=7T%iiH\SEѩOiGMҏKٳhӪ]6-pʝ-ݻx˷]~ ea+ x1פ^yLY)ʘ3 gΞCW-(¤Mzk15o4iԫC wLYRsgUfjnĪ|𗨇&[M3߁BʒH5|UrO$zs_YmogPh zQ{x }GlRs(aJ ч=Yx0T"ՠ!GxҌ=YvNƢ5 "y "Cّ22PPXژbe#.z$$>"eb&ds%g^H$g]e.ogx騖v(z&j6:YeQrsfZ|^Z**:6Hni*{*? ]$m-n[$JH ~8dۤJ= *5Wc\\h.X ?LpĆ9(fw pqȥL2eѝ *lLh7ל6s ]Sbz+NkIϲ[au6ҚRM24ZOLd^OQٵr=h` 3H~/6|mxz䌗+iۈzce_=yޟ)9rzJz-ᾘoҳ9좯mצ0szN컣k3zN*aF80.aCN6 ''L<[E$FT_D 6Q:!b~viIW7HlacG𱏇# ҰA L "2έh$!I~̒%Iu3d#cx"LX1*f|# M> VǍal,Kt*ۘs&]BqD2:<{&1A1^qfRbϙL8!Ktӈs\fM' `4&+r;ug9H 6+#JQ|ґ'A:MuT*fj'mfAqObFR6EQ iGW³{)NtTb b/g-Rі1aA,BX< `6Hvj#?p|ۂ569cM`4's~e3\<>ܣO|s^o}NJ}|cvp}?xkf7qHy]\LCݜ_=7_GZG~sˇx}~'|g~yiy{{wL'{Wķp{ |ϗfv{g2X qǁ"hm`'28-(zާh]1w귄S\Puu}j GHcHegis!rc(pXGp4G/Iyx4}8sXWP?chsvXrfDŽ_Q؅Qz ~vMEH7}`xD慶7JGmCz<􉠨8FȈȉw'?+/醉VGj({ǀ=vQX7ALjZG\[Í7(Ȍ7?HC؍Ө,'h&Xy`RH i(HxSHH:9Y (*hɋ:+ɒوwHgr8I$9BYCEyh(pX-Pihۈ'I(:P{;pyk)y`كp|F39}xɏ)aKlӏ{y2 f0~w" Ɨ~^i<9YW}bqҵVy59 2R37}I529m$hdY֐ٝ 1,yG9깞^?Ӟ$ 7cy5! )9 0K:۰  z ڠZ& סT.z) $ :{2+6<?zi  0O ZTZX G:GA N"]VY g S N0p@K Fh 0/jnZreu|zz x ~ڨ`*b{ZSDXh =mB@ z): Zz{ *ƚźZڬʩKLQZ_zڭѺz[ʦ|zZ:J @檯庯Z+ yt:Qm S*;*{*ɜ#d! zjY*{K-2.[/*Z=ze03[HG:k2Efa˧!zW;Mj>ke!Sk'+X芤*A;Dg;r[; U$qktw[Զy+{*Eji++ڸV 'Pq {S{%w[zk~K{jKK7yல;kǸ굢 8+k+˥ #ۤ;lG{EøUKHd򛿽秿b;˿KKpR  X$\%5½չ';j.|Pi,60|:S: XãAF|H0L|PR,"8)%_ΜУNֳk/}Oyҫ_Ͼ˟OϿ(Ȟ+g 6F(Vh BP`X`a}~(ℎu~(!h^ax,(8>9֎~F1h_GeF7%~IRdzBg#+dH^I$fHxef|-zp vƙ%cf|hf} lr9斑fOרZX" bZ*>)jzF jOxx䮡 vު9蟨)N2Jz.{y:k] eQԪf~짯 V ir M={(읦2/Ϫ0J/!6{^[2wG;+{iɣ/M(nNZqM=37]8}jݮrnk7<z{s_>r?z>X03~ڳ'%&|w# ۤ&^ }z[V:͌ygi {X qpdb}88qc^G o|H 2 c9EF|$ 0Nz_8R򔨬&_V,*]pg̥.w^2]P!_L2S,1)jZ̦.g2wJ!ưIDgvֱiSޒtkKV^5bn\>ᒠ|' ԇxǻPR7>l2ݖnk*EyϫQJSg ę:v]b~KKa[k9B{~"lơ>Nb7 gLӶaǕkD:A(8!K{*[N~0A e `L2hN6pL: y- ܠ/πMBb(!ܫӪvϏ%>zYk.F|4Y u/=rGminwӭ]Oz?:}dW'ɞ/xp?J˽ˢy.x{ʻ5^A 0ݽ>x_=JX\On*ܓ|Q'_e&"M38P7IOZ|5' ۷Zww=i|fk_~,O@B8DXFxHJL؄NPR8TXVxXZ\؅^`b8dXfxhjl؆npr8tXvxxz|؇~8Xx؈N;aplus-fsf-4.22/src/html/APlusRefV2_AFrame_119.gif0000444000265000001440000001200607215453015014735 GIF87aJ,Jڋ޼H扦ʶ L ĢL*̦ JԪjܮ N (8HXhx)9IYiy :J*`J*{YJ!*kہ{0JP, {j q =+mm,L >zn]>]]lN_|?H LSĻ ÈMwЉ$8kW#[b)Z`kBq0l,Lu 3 gL~]wʔQhEi!y4gP؜JQ I$:3+duT)S)Ŏ}VVM}MnV>!Y(JOn61Ùa%8\ú /ɇ#SF3hɟY:΋殧\xsȡ9ώ쯏\-tlAY=lu=ܣ{[:XhLCmQ{^zɵC7\~~Ƕ3/ǎ_CN#=4Ynr.mw_xWT YyM}gN.8! X8`$mbx˜]Ĝ&9Ƞr9cgH2bU 1Ş7UMIǁSaEI׀MUFʙTvt-dfKfǕ]`E^PфfJZYר1i]2:z(jTq1j֥\=jשZYbݤl Jv3l[߱.k>=8+mZn5ܺ 4 8n/nKGso 2& LpE&< ?%,0,W%^1!p,2&$!垬r-W,"4|s .5A/E<+t@7-4Ԟ04RaWkQ{MIH vd}v\tv 7Mwvߍwzw~ xNxxϭx?7x7_yoy~堏NےMy襯z뮿{N۝λ|O|;ܹ P$O}_oo =݌߮wܟ~Ϯ?om~7ȿOnOq_ >Ep#`(ޅv$MAx%_ c.wsB v_-$x!+D%Jqu_C8E1QuN wI`@z1ZQe趈Pwv@zzD*riT! HJvvIjr,\%Pvr,>iTrC%+_ X͕-II[r%/ 72,&id*\3ɽfvcFlvN޼YMkjs4Mād#uʉgxn=Ywrh`)> >7 N@pԔ輩φj{eD jы$FPM곢MiӓueDGjV O9`bTiF_Ӥ+%ZԖ~ӤIURSԥQ(WVWbV9ԃ5_+R*Ӳ*diHA8ҝv+@:Du,KڮDb{8б)HZvì"5*ϳhOkI Ҵmm@;Rʶq kg^p]oqkB>X+HoZ]eW\>P $nFxJ7]`n/UGkhZЄjUNy]veVEu/$kp]mp hP$'NNحp['W8V_ca G[uEa$Fi+~c?|@|jUsL1\鐩dpwe%kM)׃}3ۋ#K6cl>cZBKW#9ы>YLiF:y94-XL{GiPVԨ-uiξo_[x!߽੿kcW.g M<;}c费m2hfX5N= yJ GwW g$&8t~PXkP?Ԇp"'Qކg~y(_,yɊwI|)zؔg"9LI'&ɗƂ܅yctɉlŖWU44vCE@ט؀(YZlVJX7ɍgd HyiIy`u5)GoB4yXh9]ف5rQXɜI7UŝੜŚu@j QyEixY}S)pxoXي;Z]O煺mi:Cꖥ މl)VHIBzv8ާs* :wy(&ɢ7$J7_f:ȁ th?ʕXeoy8S%D^K59zXM9h?t9y*n`yuڹs9PIcxqɴ_ɸؙ'Wq ZK:yVMZCGH~cZ(L6LXJHǛhzwEW\GPʐ38JD-eX(Gډ+pczُ:tMŸzcyZ}ҚQLyxRD3z |MHRdhjLA&ѩ6 (* F[9+i9e:Cx/:rbyykuɮZ#gfw9{ɩOkSgj?h-+]/)G{VinpN֯F_j ƵfJiS[:l˓|JZO뵟G˟p#ijBvD~ ؅-6q+嶟(: *x+;tKYZ% ʹk聠&z3nƬ5Ȥb٬]lp]zuH:w OXjrFps˯p¨H\jUX&fŪE,f]ϨKY:׻uKkjzxFkedۭzFi2Ŕ9I~;҈濣cLN7* \& ;aplus-fsf-4.22/src/html/APlusRefV2_AFrame_120.gif0000444000265000001440000001344307215453015014733 GIF87aD??,D0I8ͻ`(dihlp,tmx|pH,Ȥrl:ШtJZجvzxL.zn|N~̼>߸ϵ=<*\ȰÇԑ03jDi%KAǓ(mHɲBZ˛S#z6}t~:йtѧ~ (2HX1mtk֯ բ`zT[ts#x+$޿06.^M̘3h`c\ ]$啤jO2ӾzE:2[kk۸yˤlӹ k7 ȓ+gf|Уj.Cשν;r0 36BjٷOQ,ߏ sh& 6 /F(:8kfaval$N<j-0(4h8H@)$;^ӊHL6$ETVcB\2`>)r%2hɷ.L1uE'=30g G%SwĥGgś<(i ڴAl$H3#eOX6Zi,w* utT U?`0񩢋)pY5jYUtd;eXæ5g)j1)oEBN̩j*2a@0uk`w!*e FX0]Y&O m3W>uFլk!6ڿJִ+w[BffZ- obl=ej}v[|^r[ۆK; v">5\';_˛.nQz#9frx٧b\5m$Y΅_iwS&ӥQmp)Q=mǣa~XmIGWˆZ U票[ň[z|ԦreV\LFׅVM|M>g)nrLyd, Se|NYiE vtnX֙FW&6?m2݋^eq-8i RJ*oχH[59m,Jﶯ%`3qQ)O9DQ~-xiBKb_9իgح\f];;GkK7:(bǽNFyw?|^K1r(Wћ۹ ];wL/P]cΘՋ`8w0?ѾS;؀C|[u+lퟧwZFZn_T<$~ia?V~OsKZ{GidpV>f@8GDskiL5%d>1Eh4Ehzs1\Y(S4J')c ~1OK)4ZI/8i&8 \|aqOr<8fd3h6r``Mg:qlrkz@=8]Hr}4^Z`ւ*ff+r_oa8f0dݴ,UK[I3As(>N|~hbOP|HNgPpHV.Vsw9ܷ{TޤrvZf^PEf3$zhNȄ`[$BgSS87e;=tggÈ9('\ErKg}isK#{;$fi&>i88?TFZo# %q!tb$80}6Tr>"yh`jk28n,?>xSi ؗtN4.i AaC$g .v9dF5fVٔؕāvmeJ)o2 _5sbIlTf5pYazlAcXVVVɕ(YY/ w]~L3'Ulioٖx{)YO6`IR#SygGx=e)5H8HY~٘?yLM W&\7KL9Z&Bٞ% Yiwc^CwehW{Ay'F) ,S؆&֊ˆYhrشMJMV.h6všiHyʰPڠɢxK46*A|E0s @\D J8e{QVa* XRw7C:8-ɀ`ְ )R)="xSs5;t[#hk)x)8LcxNֈG~*``JXqشY1PKY ۣtksflRp_]ۋjgkfm˂?#͘vIHcX7Zyi*X$鶧ho:19Pl *۷wHTJ`zegl TrʻOuBZ;eɩf/YL Rsgvv$#wxyڣw)xzf j +oR<ۂ 7[>Pګ0K'H:ۯk j. Vpey{'VtٴIEjr"\FYŭ- A v1L3L%o'YTT3˷$8Dݫ8LI#]_$43F]JRɼ*y#FC_\aq yn[*3)kRV5:,L둄īxwvZTW ٸY̽ɒl&s Ix+ȝ̠;Xʨ{y!\עɵSFɻ, |_u ŜseU̾Aydl_^vl+{܇<\!FMv,wS_Kdπ1cNеI MԲ5^U;RlJR9~5t*_٧t6, G@$ʇN=xP-*R}M!VY[jM<.\aMc=׌'gTk-mo-qM`Z <=|>Jҫr=U힎m4[(yn]w7x[*!Mo -A D8a}]p=ɭOa=ѭ]ڲ5œ؝ܾQJվC-]PQyԭޅ]o*]-} &'QlLhnB 9t;(ᓧ}܊]*\ߕ̆ k79ہ-$n,L)C~En̶IyK޸ROQn2i ߉[]~f)j\bxɦgi-Ӄc yx);اN^pvΝŚxƲR儾 ~,ؒ>ýǘ QN\ !~^^ ^^ޡn>Q-N}>v>Ďt]Xq~%׎پ"Nݻk2G_>gNʾSus1-z^Ö)ԃ`^ߤ  o:i^f_pWri ON9xRX) "W4#Λ@p)~)>b3`3D 9 bn)A cf\O^9}UWsog'ikz>p.(r 0<Ók˿Χsރlx+O7QI-_?ԋkO? )_ۉqȻ CPAЏD/RAIڿU_}OԪm,·o00I8ͻ`(diHp,t]x|pH,Ȥrl:ШtJ&@vzxL.zn|N~u ;aplus-fsf-4.22/src/html/APlusRefV2_AFrame_13.gif0000444000265000001440000000437007215453015014653 GIF87auooofff緷,uI8ͻ`(dihlNG,tmx|pH,ȤrlJШtJZجzxL.znJ4|NCml򂜨!-/C2 |1\sUgJ}9 Ͱ63Sܵ̀qWcj/v{-o3oфKÝ~9>.4(ۭ2,y7\y',v\) Ӟ'3r?Vhޅh:~;4qS<3_Wo"]~sV< ~N'+;/x_ s֋==~`fM{䛝>&ZNV'~ G/`Ƹq^ϼ@-q`w9֐Q`tu~Z6B0u{Ca#[5#!ҀvpQA ۧQ`~JDgV'bwd\86bр`h;␇W$}ŤO#އD 6dbg(;C,S8-qDd'A ʰQDW Gqid,I^b2'G/,/B^̗RdbT"җqtfW<=*$07=T]Lh:q6ۙ1lNk<ݷK$I 9zr 7JsY=yCvl%Fh3sm红7鲗|cB!:L3#WL-1)FѕԤtMѩHZShLE*K#KmP~2%/G fӦ$1+M0jZ1fVqv -"Y:J"$Z'z1u9'SVLf}c{scS p.ECjWLֺWh7linw{l þp6hCru:% @MsԺ=mv]|9+6%]׹π 0QNt$اF; x'-HSҘ63NӠ56-RwԦN5QV7ծu6`-ZCֶu2p^׾v.-bÂNv*fΎ&-jSv#n-rNP4MC ~N ;aplus-fsf-4.22/src/html/APlusRefV2_AFrame_133.gif0000444000265000001440000004011407215453015014732 GIF87a,ڋ޼H扦ʶ L ĢL*̦ JԪjܮ N 1((gQ8v HYiyi$ y0ɠ *:JZjz +;K[k{{йYl|s( -=M]m}= <חko}ĚXy6 V`t gn!}~gte_X"|e QXb&B!r _F\!}'4.JǓ}!z0YaQ8Rf6W8cVcr^a3NH!8?fg >'vF'ɱ昉)l g!iyJ([^$v(Aއ)j:WtBeFLF+z*)頇{, )kl6~hO<鶘YϺl醛l++ֻՖdui\鯛a9B F;-R|olkpŽ6nq+Vlqlٲ1SZ/Hb>x ,-AE2[.-|׎Xm|#G6U {27oUe]3u1QW)T_WpG.٦A+-y_#RE}ڕ/*2Rp7f>zd+tDjѰ[*SaGy=c3-ofyz:߬{=.Ts_夯~?(={'utʫ8= }w-hl'vY ~e~> m櫟p Z `&!MmTX!F:O|$L q[b-eᱞvĥ:!uaWATyϋSY8jЏ"<<(,(;eVD\Nj%+r֞D3<11"1*WƮUJ w^a|_GsS+&4gLRC&`*9QHstQNuI"vYTsѧ:t Y>~ƞm8PBhD%̓ZGPv1̤ |l9=WO'}eAvhliSZEi6g0,n[۞Fv}GoY*wr5C֜åmqm.w>p]7u+ ^w4ͽ+tϲ j&yy]׮wS+,U2dz&[s̖JnK` їa+ ﶽ08cH]@ڗ&IgQg~5ش.lq)Yr0Ip+bO8D +IcI,9rw Y*C~ HLdHX炕|ޕoLf,,Pz0>_9Ѧ0/'ݘc?s84%O<%ߓߋ%sdñwMͤ9)|f/|?:"AZC5`N$fHJߣ4ߡn:$R$xYEhīn5{~zM$GzԼN"˒~ة˃lz3PfƶL{լNm[#w\c)"`Ć`yc vڀ6.Un4 yQءy8n3\IF-ͨ*SU-Maּ̩LCj˗ x:k ~ yU|ԗX ]CјA5#g3P92MzN>:`܂y\l,ZnR{9& VDȓOxWD߿Edn~6fp_ڙ߲yc/4gmIJc&n5`{k#Ln^-+'E/9<-]z"7rIv'nz~zb<{#AJ`j'=>l4HҴuA`CaRwpzlr}+ugCFGo6bMG+N@B8|"؄$X~:~|$eYSc4f ׀ϣ}t?5X56c&9ٖ*6Ũ):g{XG~_^WIM_c9]Wgr)E"%HV@yR֙h6wrV`'i'J?)\29r &t0gvW1z)Ey%jɜb1|cAPU)F FyM!sٙvPNٝ,Vy}מ9<(}2Vc7hI2Jfh7 .zOy9~YGcuA*e ijIo=|hQ8D.Z5K'3q۔1O\:^*B,:n8jfzxE9TJ}ir:S5vJ!xzcYf^}BU:Zu*2pnǧ ȩ}ڜigZ2 ?uwg#zRqTejyj?>JccЫݶ/Ȕɺj2i]Jg-B< *b>Hjv⊘iNzu#:KK1hheq6ʚڤ5xDjEhÔaf\OCdqPZQdúrP`ر^QU* ;);I_z:89mӳYQ3ˏCW28StYx:6[mKh;%p [Ysg^VOyt˷]wyG&orǨ[N[ c"ɤ}*'zq6l ے`k-ʹ(NW :)kJP+r/;m~&gwQ˕+\yԪ&l{2 [xt4c/fpJZW˸Zn[Go#c pq,L9^ɼ*ػdOƺ9q4dydb`oyY!,R+f[II~TXXdtHIRh(2@9kZQz²Ɛe{(+F}9!+d+Kwrkalu,kFƻۧ+;wJ}"<;0ėYb%EEG~{0 ܀rkria p^ѣ-Y}XiWfnzQVu-Jl\-KKjY.l٭敾^!YξSd~⨞kɩrr_$z^JH^^D{&nLꊌ|ժn[~O >&>[M~hP+z>Y [+W ΋6^nYnO?o `S !/0')+.#1/w 79;PD9A/C%IFJOLPOURV[oX__\^OؖөN};R9OqA9sovqo|RuP%)?PONîyoR< E@Rw#mYq~gcᓿƢEd%O>GWKIPwN0u6\Y~9Mݛ-.^wo <긏Ǿ3q1$~tNg~=vtgn޹G_>ڽND#44aD0<4?\މi <06^\PْۅA:N#E!,oZt.O{S?pa2LRbL="m(Y,{J/wA!5Q6+rK0E7d3?'DΒ伎L ;3QEqD4a:}D8P O?ГSQ4UF5$=+_ݴVWԜ8c1BrYWcU e`YdCuILVVLEtUVVm5V<=Tsur-\ZەRZv[\ ͗_m7Kh%` 5+؛,,+X= 䐥DKX~ev׺gtP#+QWtg`:2`TW u0s] j lE;m b¶:n:]9۽ow߁_6[ǁnǴ7kV>#,;hNFʓD xͩi՜?Hw&n[#-z xCƓ9hC%Ppu%jC)Ϫtl (IKIG2&u[Ә2)MW`Ӝ4y֖`UU8OS@T"keaJЭR=N6ZG*օR^}A|TP-g W6m#`Tӵdo,"]eqtP>ԱcU{XE^@Mr16v!.nֲutO]/W}nUTi6״-{^7 ]Y{Ca6`/BɥyL O1a ouji%6Qb-acϘ5% =\C36E6GÿIve R򕱜Q9f,Y#^ќf}P$$fpvg6]:$эvCh&ҕKoӝ4}wiQ=tKjUZsnsYkY$Ӱq=f1׽ukM_؊5>le_9v|lBImm/"P !s[v{uW$@7"R oo_7`&,:p^((( #ox_ #ȸN."X(}wɹriA9\J047s[Ag8M. 7Jw+tF"9,qd<]`E9~uz.쇳c(}';?(O:4n[&-~/~6ACBuuNyW7_W9|^w8=* tX}#^/ؓѠ= QC_V$) b=U[?G|F{=Oo-_Wo/yp O!p%N) Vl9=A0 MMQ0UpO' 6p,epimB0MvP|pL /poB @h }+2kN %o a MO̰ w P 0  a=A,*-Ρn !o,q2q!q@- q.Qˎ`1+}Q:1 h1`c 3@OQ alQ"Q\NkVQQݘ pN"] "# P R0! RѱN#k(o!=r$#*!$Q K2X##'!b #{2% &m%2@_&Fq"/R'q(e(/`(0$$r R*r,q& P2,R,  +s--Qݱ$R92 2/$b* EMmrf/5Q214E&钹.A)N/Q.ݒ!,%6cS0qf30 r182벣2JXa9a h7s7!7a::}o%R-3>p&S?? S1Tq%3ո%#sB1*y0C=%6B}CI4B4.DUN0XEa4FetFi+E?FutGyG}4oo+$Kk<˸ʫiiKIsIsF4D˛K'kTk45Q+T5 r:ԂtJהMH4LMNpOTII4$!3NsgN׫N RPKN9O5MH HTQ/KS4OGS+R U+K>$M4LeIϋSjWwjV X_ tu ]TOQT(s#Y UZTZs [K5DUP۔ WOjV5XT4[]^u^TT\U][Y^u5Q_6R'VbúPV5n:A_5dtd eb^M!Vee;5agvUSQvUub3v6BPh6gh[{XT,FjS kŸVVl= iVm왈Im6momy nmݶlZ#e]Woi6+ftf?nǵj\ru\#rT`cUiq'`r;\/ggAwtO7Tai1WYfjq{pyvodS9wvw=Vv5`]VddRax xyIuozuwe7ef÷enC7Z-uE}%7tWu{T{iyzV2W}|6Jf[wR'WDw~5~s6uS{M{dxvp?q~u 7t؁vSM;؃kxoz77exsu5pVfqxu։wqK7B-8!`؀+VXzWWkW7zI8v}xטX89W~x'xZWkƖŶvMg)4lniLnF+#ghxzߘ?vyz?/]וwTcGCYXa9mK8w嵀mY^_eKzbٙcx똘AE؜SW؏8ṂWy[Y?\yٟYxחٞ߷#z%-ա؆O| oGX=y79q7W!ڧ{UZIZzZYl9Ke:yUY)Z3ZizAz:uxث:dڍazzڔښyWsz{ۛ]؋G%{)-bi9=A;i쫿 (/Q;U{IQTa;e{iµcnEu;,p}z҂{ъ[В{@{̺{L̻{L̼{{Lk½{-C;#"; |2G=0=!E0i]<t]`]EI]l]~\) ]4}~\,}qUGڶ]a>e:SqZx WB>eaإ%>A非A^ { b5{C[> ^p-꧒E!]?>~9S3S~4 ݱ/#5$A__Yڡ\S~~N ܲnO}D B$J%0ΊE,Ը{M@~&ڋRd~Gd:8.X >LtR(XZF4LP+.tCB5)ƗxK"UjVamٍ'%b-ܸrҭkjD e nۦ.l0'(Kl2̗Kh֡O").m4u8G'Ȫm6ܺYCpr‡/n8ʗ3o9ҧSn:ڷs;flvkQƳo=ӯo>w>ϗ'dUBV&"69MRehކv[B C=8dH!"袂02ak(FXℳTh=+bHZ@)䂹i$!bJ> Uiەee8ᘞCC?ejhile"ba,(#Sy&H)'tjcHxnhj&p%!B 1)I)fj)S9=h&Z&keJf뭨媚C&M*ꔸ"fl6Kfگ'A"XfƩobXRz۪.a춫k $ꦩ-5;'iv.` ]G0Zp!!<ا19(Ƕ&7\0%X'+u:饛~:}:3;h;;ォ':+7ZfϪ|7YcM|Bƃvԃ=z)Xe6^}CJZi|bxֹ8HqM Ff| ^ą@Z `77 QPp$ʢ?eg H@ }[uB~<^7b,| w;4UFApY;5mAj) P^ZG dq[!"s&b25JQ#F1gpȽ^:j+N4?2&-5␒SEE2v@-=ި#BrlchIr]wL" J>rL^j\N2ä L_Ĵ3mSβT(J0є2[sMTS*T-ߕR2E<O=g{s h(`zA)2u }( щ:=%;sjDf.*CSIL&GP m.EIuRj·\+[·ytj&i雎P, G!-8XL5\6T"]5y?%!#ʆ|r,V}%̈!JXjLTpZ)Y:jj@ZpMNهݕy^C:ҦXz,J4Z B,TKؒ6$ifZl[-TZ ¬:1-mjٷ*Up[;\4Fy8?\|=WEtYֆvxTe4EJprlӮ}cF_ ׽k<>VxeFin{F 8 l^[Ut1L j]﮼ VeJy$¿Ki^\ ƁWuq<2%[L~3Ӭ5͕L:9ӹv3=h-ARpE3:o]#-ISMm3Mszq^qC-Q+&5Sjȫ~5c]c*cZֶ5Fk28׾5]*>vK]kd3ΞĥyiS*PmsjV-ncc{>7]n~yӻtoF7o{38#|ڭ33sxjTp}lyc.sܽ*9sG\璑/VD.qC+Vs <אt#%ƭ'~Mӝul+8Fnzm0;.rkhn7 ]vޭn\/au[Goq98|gBF{qKޠ,(ywO; ;/p?]P _qO>\+_yo Wy}#ՁIw;9N#o3}L_O>UBuAW?Um%_9޴$ y ğ-`R'#FKX8 jP L5 ~ .ڭ 2  E  >X``W` i^"U55Xn iR_ja!yM~^ -a Xj ?X ?H ~a$J&"!!.b_2#n!Q"Zm(^ӕ!=E)]&VLvE1d1٠4_4޸ۀ_ 7J76###:: ;[罣ţ"M=>~8@$AA$BE^치=$DFDN$EBN`?fF?ޟ>n$H\GGIHZT$KZd$Lr$MjG0zWB$ZP'$PTdP%ܤQe"RdSfS2JvJ̘%OpeyPe:BAJaYZRYF=Ydͥ25ƥ\UeVe^Fe*bReaNU#9yZbe[b%bbj& e2d.&h6ef7iW&&hjlg*汭 2f&q[ncP$g&N,Elv'sڀsv^rZuofml'w.T<zZw%UgAgRg'x&{ a~^ȧ{gtt]u£zg6y~h}F*ڃrm[bѧyR'g*(Dاy.(Rfh gWnpچ>i( dfC苮hD  i|h/#Qc_f蠕J)4fii2i>)Rr`ffi~朊i李(Tii)i VxiJzGFL*)~*(VBZvꥆSbX^埒$A:2A7jj*Yiٲjjj"ٳJjٶvjiC TBkDLkI֫LޫeK+ Ll,lVR«A2lA:Bl&ZP@jqz(9 e|l**4h*j*Iz)?a*f]Dˊ*]Xͬլ*,VB*.hDnZ f.Ta)R\m6-Zl>( ٖ-h~ߘ-JRŲ3-mS䭤m,mn5f ].ڬ>1@FZF:(&J."$׎U^. (i)Vn֔n nx. .k:К"o:n)vnfdmk. fFozN(z.[n١mZ? -nү6oY}'Fz-֒J!Ϯ1:,lzo-Q:m oR>#> ? 7j ;/ lƂR}0pڰ _+C/l-SYc+ctdgB|,71/11+$[2:tq!$"'":ec\[j$$wl%[#fr{򝁲'1 Gq"E C 2*_,/jښ61W*)2ci1o/-[2?zvZ)-Q0?q*/n57+0g"v/kyb87%3/7w5p쒳9o8߭-lt?*:cʄ:߉0_9O?4otD'}tP` [;]F3DCn,;oP HACG{BK3k]P,*ӴIW-;46qfL<+jKsK_SmEcM_"4R453O\pZPs62Fa#VBu"u\4_KԝA^wf"vd%uO+TU> endobj xref 91 14 0000000016 00000 n 0000000645 00000 n 0000000700 00000 n 0000001214 00000 n 0000001369 00000 n 0000001507 00000 n 0000001613 00000 n 0000001720 00000 n 0000001935 00000 n 0000002027 00000 n 0000004609 00000 n 0000004717 00000 n 0000000839 00000 n 0000001192 00000 n trailer << /Size 105 /Info 90 0 R /Encrypt 93 0 R /Root 92 0 R /Prev 150933 /ID[<8e8a4d93f2a6af98b8a80019086499c4><8e8a4d93f2a6af98b8a80019086499c4>] >> startxref 0 %%EOF 92 0 obj << /Type /Catalog /Pages 87 0 R >> endobj 93 0 obj << /Filter /Standard /R 2 /O ( UV.`Dz-#_m_}g) /U (ƙkh11nMsU>b7D) /P -44 /V 1 >> endobj 103 0 obj << /S 335 /Filter /FlateDecode /Length 104 0 R >> stream djNpR?!5J=as~)'ҽ $OCia[@>vs̕Ӊw~‘%6nM< OsDZ-@lYVOvrm;+]&wݥ]jR`Q~q櫱 Rt9'Ų|-b> %ńnFGޗSEg!7\4P},N73m,P Eܳw]EE endstream endobj 104 0 obj 266 endobj 94 0 obj << /Type /Page /Parent 86 0 R /Resources 95 0 R /Contents 100 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 95 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 97 0 R /F2 96 0 R /F3 99 0 R /F4 101 0 R >> /ExtGState << /GS1 102 0 R >> >> endobj 96 0 obj << /Type /Font /Subtype /Type1 /Encoding /MacRomanEncoding /BaseFont /Times-Bold >> endobj 97 0 obj << /Type /Font /Subtype /Type1 /Encoding /MacRomanEncoding /BaseFont /Times-Roman >> endobj 98 0 obj << /Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences [ 17 /Zcaron /zcaron /Lslash /lslash /minus /fraction /breve /caron /dotlessi /dotaccent /hungarumlaut /ogonek /ring /fi /fl ] >> endobj 99 0 obj << /Type /Font /Subtype /Type1 /Encoding 98 0 R /BaseFont /Courier >> endobj 100 0 obj << /Length 2505 /Filter /FlateDecode >> stream $'FtNS;=VуR}[XVPzVhAo^ݠ{h!K.)zܟ?Ն3h{ƪ nd;S4kz,H/#2/_A컕<^@_G J$4u*r*U ;O9Wo2yqTZ{;4᪏Ԣ4 t emnsl\3n3ٟHR%.uƆ ";9)es.<`/r.z2pYo(;; lrMH`i}kpr370-V%͵'|=lɯ,'0@,I򙔺eRLJH#/9G۾'|+<ݪgqt |R#o^m=RyO{vQ5HBʻ+f{{-rVմ2S1gFg=]|cڗp H57|&WE9|*H%2NV [ɻpm}dHL> agE J6ِse9zwf/¹S|dj7}[ӢolwR|ynAKYu [( FK֋41ȼƱgsXG7* M{ hN[@_r_.y1ButԹx=Z_N թoS 2!weN=ʎ<B}c^BbqW倏u¬g~FlYϫeJ#uO,iL?Mgt{wٺV\!i B2Uy@4kOL͙ƥwp=ZXMd5QN5C≬iUx+5],S3?>_k:.ƨщ7yNOy]TQW@ E#Ajm~Ȇ ʄap8G}BZLv32U3U]iM9:M-T@[<.%_nh^%6Eg7c]w-O@O^9M6A3|U<PÐ>ӔiBog:B BUG?)u{G|6k"]-epKʩ#ٳdP-s5@yO] |w_1@~r}soKq˂vx|%z dT?;j S}PcgLOW$'_Kq$P҄3qָ57%ql4vѽkýsqq̻ݽw2OUΠd3V#?Uw5B]6^j<»*-`*d1@˄B J sǭRY}'3uZ#RANwc' endstream endobj 101 0 obj << /Type /Font /Subtype /Type1 /Encoding /WinAnsiEncoding /BaseFont /Times-Italic >> endobj 102 0 obj << /Type /ExtGState /SA false /SM 0.02 /HT /Default /TR /Identity >> endobj 1 0 obj << /Type /Page /Parent 86 0 R /Resources 2 0 R /Contents 3 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 2 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 97 0 R /F2 96 0 R /F3 99 0 R /F4 101 0 R >> /ExtGState << /GS1 102 0 R >> >> endobj 3 0 obj << /Length 2748 /Filter /FlateDecode >> stream l3؛qQ#p ^ Ϣ$ّdbпl8Qh݄S,ua?{qRy`OU-)քJĝ>vY [IQaгdK5;}6*h-`^FD7fmb)T,J{}lcjydaH3BMx1wQܝνQ:j m>}8@+#&ty-&k2,7nbNN0kЕոt,XBr*)yݙ-u)߽`vJ۫gC`j|엃fYh aF}V`TZ<16:.hU`d>ۘ0Mc ~1/#7yxA֘W H-iP2QH_[ǂ,Z3e\tօi&gIKjgC2g6s-BRtJG|fMW+]*Fa5rL?@fTȐEt+~Q6! 찁^C:VnMoqqGɵ&0hEn~㾧u/l4OB"kco.j\uՖ|/&TKiԲ&PIVERdA`/M-Qq%[ds^tE S1%2okkxP+)Fni]i]삻.mjuocVͶ bܳyyotG4)u噂6": 5_@lYP\vPJ4֫Qq vb4n^k] ݗJ& G.e;E)^VuXt-:KhGd2GNNQY3alh'@v]!& JxXS۪UEV`ѹ~xj^?okLPhSC}{M/v;;Q#jc"(ϩOR;8o-vHZꁛbHcKA.qsJSyŘ_P[okT]>=b)aTcqq-[wb֔mCZͿz pGi2p($XHyj5 pygopOEޠorYȌ6U Cm§"鋓7={!\~ߣgR'vj]iz"'s[oToOy'4y.ţ &s_V@>޷@L5-/^дI*3}w3-;kR/>+/LB2MVV>FRHxW,= VOԑ3Y 7Ew#`ʙ?,5}JPIߝ\σ(R32"~z.(?9pږD8/ƛM To@1>z-GtL;\RD:zd@r3B8I ~X#nG}h#K5$gT 6zg/҈t#mcf-"6u ͍L:bJY]/ZE7돑[:郾ֺvŪr-^,œ*g λ3.1 C endstream endobj 4 0 obj << /Type /Page /Parent 86 0 R /Resources 5 0 R /Contents 6 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 5 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 97 0 R /F2 96 0 R /F3 99 0 R /F4 101 0 R >> /ExtGState << /GS1 102 0 R >> >> endobj 6 0 obj << /Length 2385 /Filter /FlateDecode >> stream ~b?֣ 1[\q ߔ#m,ŗ5 oѡll6*̈xTe ~gk Q8 }5@x\8|؊G4y~6_l$ȇfQOpݬaWdۣb9w*T~ҧ.aE-臧`@:hfiX9% Wp0&ޘ,sPFN /Dذ;X>^%BL?JZGAbe$r{DqYXx^ܫQC p:ي+Mq6x{()l]s[V NzԢϋ}%"-n^LNE)9`1Y1/EI=E] ][;Vi b0I{[4xN_&X|V[: (pQUO"115[R$"y;;զQ_K9X.v GM0;W?6LNj˃} rT mZ]y|= LCHj1);g%<Ң!xP5Lg)W'q z=8rq 'kH"fvҐAnP7d{Zf5M|nej\̦T5̊$=Hނ985D9t-}ʭV11B2WؕN|%L&V eVQ\nҡ m졋vz\*{ځ[{_eF Fki(A$o u.?pjI@K3ԌG{) H7BkMfU_˪7<x@>!ŽGo<|P&cOG`:2Ȋ nv{sj1cJ,g_n\fqKgUsf&uLYtkHJjOΝGn۴P\{+D>u;+I~ +LgV&M&Y&%}[S}I&ES <^Z뭯_/ endstream endobj 7 0 obj << /Type /Page /Parent 86 0 R /Resources 8 0 R /Contents 9 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 8 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 97 0 R /F2 96 0 R /F4 101 0 R >> /ExtGState << /GS1 102 0 R >> >> endobj 9 0 obj << /Length 1999 /Filter /FlateDecode >> stream Gv̏J2+ۨCZ7ՐU(/L*Q>HR'Fh,[ p3롨V#756hnH֑-j DT%:QQ> b؃|M*1gC= nw*;1^9sIQ9.#D`s~M+PH6c.Z:7M]&58x*ʣ@Dd7q³oܵn.QάVT΄W[-n׍3\ CkN"6S̜l?֕^pKpgi?n~)/7nr062 KI~q2⦡Il76,Qr弁X@%L.# _C!#ךYb0%2z6EظWAŗGM8eHtfm?36 :܁GtQ}ss z:W,rxb]Zzoҍcg Ø݇DYC*'_aL)ϊx㰼 'D 4TuV>N3a#O}5Ւڭ| &N] a 9?Jkj},C1b`"l= yYU0Z>{9ȡU m)\27* O%_Tv$`Lu\V*0MfL(rYؔf&lx_Y)4vǓGSia{NG K} 69(&B o`+_R_ u`pwY5|*" f2[.0С7 =s.R{8NfQڊʗ3u(ޜxTT.Xb\9$#?(]4/`i5ЩsA@$}0ç>9⥃_3,m]9 }0яts-s,ї"MbZDaiI7>:p(JS/%z ji- jDP506_9\>Z^>4Rms-Lr4=Tcu,xp'PYq?T5h&/SD/"0O 8rX`sh#Wk\WPH(]⁘CbtF =8 nịӏ3FE<[Nj )IqwdgdxH̷+"H LoGh"`M%uD݋#ׁ%x~kg0̯7?>'ёnczxtit8`hP}{]zx n V+U 4JؠL+]8LK*N*DF9@F:,g8|]?Z>wP CL_GX>ogit R Jѣ_V.TuFbTėU8jZ=" 2|" yݷ[=PV endstream endobj 10 0 obj << /Type /Page /Parent 86 0 R /Resources 11 0 R /Contents 12 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 11 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 97 0 R /F2 96 0 R /F3 99 0 R /F4 101 0 R >> /ExtGState << /GS1 102 0 R >> >> endobj 12 0 obj << /Length 2280 /Filter /FlateDecode >> stream ̊B"4Ͻ @*r6'/Cٵx>Ԁ_{^MS Zxn4p'5/cN*е$w/{(j5mۂ=Kmm\mʘ6lڲqx,;2N;,>sCm5R %h8T|?.MJx67,D{{a&{㾙bwMC 0ބ &YbG*߈9g-5@J3̇i)>o Xb.I+.$?R}1@na)y5EV]3/α$yv&њ] 7xx<&;pT;X)q؎"X:Z`n ;gFjO0Э=-N\hg[zhCǙ9023Uέ)S*Wė#2>yNdLL頠sPj1X}cI 貍i\ ӽ 8i-ƨSq05ȡf7Z[$' 2q_I:b'"/ٵ> `cHYB:珧4i\Y{}6p~tA{muQrA@HI3$ w$_F\.ӫ1'U/qu?Fn"Z%J5^G1o*q4֛]I} .Xؒǜ?h/W9E=玙(q;7]3.)wdI=Ai.$rqj0QMVvOq5.z1ӠSx P%p&· A;u2)Zn8GHU 0[(K/Bx2ΰ9Z ~/w1M$}N\d2NJ00$\@XwsDU,w]#G-TwA?@{@T\LqPxX Ӝ^SF_0EݾBp2a~x(=J ` x\/ZYU0Z\?=ҋ&g| bG;$*g3=߀BB װ˥+?q頯*Wd(Jb)8{=1I>'^2@=-r {G"1vyq#f. _a\2ڑ.z!jEqjKSlw쏤J 9ރjB"Zq &)vʤeK%k#]\@v>(1!)Wm endstream endobj 13 0 obj << /Type /Page /Parent 86 0 R /Resources 14 0 R /Contents 15 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 14 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 97 0 R /F2 96 0 R /F4 101 0 R >> /ExtGState << /GS1 102 0 R >> >> endobj 15 0 obj << /Length 2393 /Filter /FlateDecode >> stream Ne(I&#@?i:]~{yAU˔ɸjݡ'5HEKv6x.zx8eد|#L=!(|Z+6twIcOO8tkPD ;HH مRI@r[ۼ0xL0TE[v J$,E"<enDhgJ"(-w/WI./{j(R8.&9I@8KC*ќmi_lMGk}ABdTƀ(*'&1uYQ!}."v>C/F QlPl%n%;C13˕+#ikkxRKN\${m- lE:p=#N/MzSurGwy$I)Oœ1ilb*5(IK=2r:SMZ+n]Y9 v)liM[L!cMo-ǀ2KpCLjL%,{R?T۽o7cחk.%:ffLQ)K20Nh=6H[,}u5tӇ(m`&S?=2Hզ-  6P@֥Y&6H#oX<8qa%cB hj_4 SxBC:_x1&ud5ܽ.ERюK3amgw:KX"LCJ۠rw=bcr54evLS\"эt[>5DFqkw^B}@ wOnCQ=hLZSB%2;NW$WRWZC%B5X񨫑*MQ$q ryN"$u,#ou %Q PiÍ\.$8P7:ި{ndh.P9߁Wh^w$aF9 4KMl ]/@MA΢%ʿGPnir b%ۻzI%玈r07kWCW6@(t/#YuQSsTIdv:XdZz5 ?&TU8Nd;^?|!zyOR9CoVHTt̵͠o+UjkEZWc}/{e@Y9{1ל->Bs䢯 $)qEL"'luFn!|]/V$ur{deY1еIW*?E߮'׎p~icx)a^WĪC\$Q endstream endobj 16 0 obj << /Type /Page /Parent 86 0 R /Resources 17 0 R /Contents 18 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 17 0 obj << /ProcSet [ /PDF /Text /ImageB ] /Font << /F1 97 0 R /F2 96 0 R /F3 99 0 R >> /XObject << /Im1 19 0 R >> /ExtGState << /GS1 102 0 R >> >> endobj 18 0 obj << /Length 1135 /Filter /FlateDecode >> stream ѷOGLuivrghyeNDk&CObS%R-YCS!O؊˚D' WKEQ\2VEo-@'#MͪYw~q<ڛ5Rv#E,LǂXQX6{_R972= vT`?q> h q_( ~ioaR[1Nyq!Qa)|GAI\O.ؔk_u"6a~4/ӯ$ EK)Pdwh;.MR!+Vo[ *]ohEtsKˢNT5af2 i ؘ6ț.P? 7}8_7j=\3 v~҅P%Ķv7_JxݘO`>V }{tl ?f)p.m扨Ru95bR;ڷʹI z$DK0͢5Ch[c5,>sjyy B\a0gCD߅ Ȥ&,BBn7{/Qt\~]@8/ۜ*4hm#uxP3q LORarIknlRx> stream n+ 5tt %bppŲ :dxM1'Ӧ; ZlpJⒷg"fV ɘ6ѡ('acĬofR8YE?0LSɦA βAiK$a%x`mY4atep@dbTl[uCu-$\+xviPe1ҁ:+?HnAe7ݚ>6u'3!4u'm]Y &(x"zpo ?.HF-Iz4 qF@+7!h@Nv)7c"{[/-.LxgP^n}rC!R簠cx:؂p 4)D[',+YKuIORM74$zgK; תwu@TZ=)(L.CKы̸nkW38ڱyU pkM%4vaח ^Mv| Y6ؖU1%(£Cwɕ`jA 籝&Pp &XxrHڈ[Ύj3#Ѻ9ͯŌ:`'8fJɠA[(X> ̇q4QR910g8z`BKZD?$ɢ[ɪzJ#mR] 2hORA]CO1δ3&D}NiU(,QgF@:qy<* HvQma tѮc?} ́΂pS<|/un(Ş @ ys "!Ez+ˎ rKH%-|(IC:{B]0&wik-^}FVXe6_=m4"L︆_QyIt<YSF݆g7+w0cPa诚sB:(pQBJi 5y[m&1$m? <&;]+vjgDs(`ޝ<%a3ϙ' Vo }W+$0JFLI2^ :vl nWSfSJ6xzqUK-l~v!Ixzy."L,Nl可}ƨ ERei:ܧy)U}T EQގoL;F z,N?!9F>̕dx#.<)8^Dn(ӝ5|Wxדm;J^B|4D= 3)I wjGՙ (Jݳj: {JJ%F7 yn} t'k N=" BImieH~q'5,{K:9~Fhl^N/@1 L,O61B0mXc,Z`냖Lt>g +VM #?{ Nh LbO?ϣa +=q֢ @swﳷx_?2Hg6כ7 "l;Pk禰7柬kcy#Uf-^8"\JփK7,"' -`cK1#>ekh,8u5,%DV$F%DAMO=0Ӷag=dk]Midpx`X츟w9_ljM> m;4K@t)zGצެ_/)؍}l tWY~jM3JvogbS/OvJ~=3UuM q})q:蟹hW `nvGBkblg&J[U-`;A /̒L Ѵ.F+Rbrc}>ɗ!,ohmg$݅"1—ggjfFvUnM-8"c݅ zE&A\wNHF&~ haϴOd0'(aEUb38.4j^j$" DE8G_)(:ȉ?TDZ &oG d i nE9 꾹 ثfH܋e8ۭHn-继R~ |B@bGVO'l\ŗKrhb%y{G>7~P֮}}ٕ~l~ƫ_UgA7'saP|@P&H 0IZW7a'w;h_# 160uͧm "A98<߿OC4$UX\mr(&v w9]GಝQXYrT]A`k t6LJzLayL4Ddx<ݽ4L™xlf @ $d* o2zۉ&XJw~qM#ڔxUMmB6?"÷_ i/ٷ g.V7:>Vr2ɍJ*y02B.2 r_G,~JQEۿ%e%Dսk[8 4ܞhUתZ'U)(z+#$ׇeR'8j!" hUHt*:ھE5KӆPEd x& e**glApcDlh";-R'[J 閹If*˧OuZ]qL6*"| x=Z~:pj@֑U:y xMٿw(qhJCZK!u*-*oy !@0+W~¦;/W[y9s:sO ˆ!Cp4ß _3IAt!i0)s-ݨؼ|v_}?oDf;~1p4Ż2bZ6]aˠ Μڟb_/8ȳzNN{R0\˶ʴ½*4҇,)V$q,hR^oI 1N<}{@z^شB_r;i޼KeyD<6ЪTJX|Ų:I,Ԝ#k}qdVC$I@*;֪A\pi#xgF@71Mr0$cNU!TgR1\cPVt!:@G&e9[R׺qBpraߖܴI Xr& endstream endobj 20 0 obj << /Type /Page /Parent 86 0 R /Resources 21 0 R /Contents 22 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 21 0 obj << /ProcSet [ /PDF /Text /ImageB ] /Font << /F1 97 0 R /F2 96 0 R >> /XObject << /Im2 23 0 R /Im3 24 0 R >> /ExtGState << /GS1 102 0 R >> >> endobj 22 0 obj << /Length 379 /Filter /FlateDecode >> stream 1 D~#%M!/FIe.S>F eCq =5YkY3B1JwG0rn=S4&xƑ>C3^j{Ia6V7(@:ei{]J7| Lmw]_jd56a>MUݏpO|EMle5:s!t+Q+EU9Sd$Ey(C0/&}btxT㱳P%rKw=M]  J/6L)->_vc22YR@[&In­{@T=:tk䲋 ok endstream endobj 23 0 obj << /Type /XObject /Subtype /Image /Width 288 /Height 463 /BitsPerComponent 8 /ColorSpace /DeviceGray /Length 37084 /Filter /DCTDecode >> stream /qߡOjω.0GWm@vm8LnO< ׉|̪bQ>9 V&X;KipBQ@#:RcK&Ok-8BlQln&1CT`/0 o K˯)D òT8䏸A1v,=iNF s+Z voy9eTʣ*6c55 ZR%ފ. u~jyw*?|h!&#/2$=gV|1<(S:=,W'4xe"8B =x~.WJcD;f2<l4F1ZKvs.u#aF._Ң ,fb ?+SOɲs m_6dA6VO&$s-蓫eOP^լa5+ŗToX֭_)F95<`8k*ʷF3M ډőKf@U} Nw8M˄tqI[&\eY.bLa }y7snESjR_?aM ԵMo'8"R <gw)R Z&$,|oc3m?0MD,MiXK3KJ6쒮cqh%4vکjI*GoRV7/1Pi8EzH:]}gepqXEqN"#ZXooϑ(lSl~4VL,COXxJT8!IwS5Vs{yiPcM4P#؂|Qf`ӿ94'^IYRNB * 7ς,ta.z$H>NvO;"OjT/Rl*ج2fƸ ARΞV4 o`2^b8iRq_7bG76QYGY1ڬvBdL/ХaA_XrB@b~Ppm/gYu9(:D+f>vY&d,S6$BO (!y߶oXQK=Iו"|X&ؓ%BAVRN"trs^U߈*L.Gя +SU"X0ZV wNCWuPrHwʕ~̔-Sw/ap;9lN](NZ 'c<qK<|h^Z n##5Jw(AHt4dWw;h X6''W7az[N) cQx9@ UT4xuk^zʻX~eF\'l0n'| IRvϓzzd_9RPIKQ8=  ;vVUXKge$D,Kz"DlOS4N<q!6i( Ѕ#)O5p|gG۹M1sR1 ~:PK< vTCx2Wڵ 8*# ri)&%k*0o0F EguٛXΌpq~)T fQ;| h ۹(nKYH{.d&H)m:(4lɍ;C8S:ʸM _Jo -o2Y͸n=#ŗp[[P8 *byNc|FNGYq2_QO]%e AS栧l3.+\VVvRyQp7U]5^jNlI3Ig=IiUĥݼ}ƺ?8G#`0E#xO UןR]ǸrĽSPTҲ'Xc3M'99δC*@ Y 㕫GtcngL֢ŔŞMCP1.R F"o>&+ivf໌ep aOxkz.V[bZfq F&O*DR _@表ǝtYOa{Ȇl#5J5%tD←Pܦ RTnJ9&+(r ́'2ЗZKƄ::@ESeq}#4ߏr*։ֻS)<[DԀ.  @sF@Zճaj9F{JzR yw"Kn2& cUm i,iѻehE6No@]o_L6_DJ/9-#Ez׳IMm`AV,ۗ+\Xfj_UìFFd=x!q[4*M[98s&)9aa6p$"Ii 8aj1M@)+A: O!(4w${gRszZ~a P[6f8l#O{ȨžE?Gwu''t Y׋y(o $r| ^%/Xs=Embx[ws5_( = 2^rt /7w2Q W{*_tqѳ,o}U2\bA*zBQ2'9]˵%h?hO?(Ԣ|+fQmG SN:mN]nO}ߑ@;2f X 渉𽨇h QhƝ::$)r[!&F&<]C&Qkvm5}uθiA )ơ>F$T8x0D}v׈$00u,4cAPo,kHSHW<4 #S?7}#v`BcOe]P;5|u1d.Qxk6ɗ I8-b)@I.BB.=|s?#.e'.}AG5y5QA]qGobg~ͼj'|ȕ(]7OfM_h, OS#6c׫edS+* }5{>=S4:RpCy(#\z- g?:&I|m5NCcq8$Klh?6!8Hlܫ"RB;0}+D9f,Lwǚy ȋ)ߒ{?}:uxe`}b]VuUؼ L]qBm`m@z$Fpgekv)Qk3ZL)P5U;¿}ڈ)F(Hism: ;p"mqMgu]֓)dj8@)J0H87,YۦnmHZo #,$# mz}by"?HޑrmkSKԟbw)d'$OֺܑQяcv8EunI]ݱR*M=Y% "2:gXmC͇`{wO/SUgg,?ٖ#Np#.e̫SoӲ VH~jLkfǕji0/&ZT0xd$yt1 1GK٧kYlU_ӏ13?a? aK¦D7Rډb@9KuTӻB=Up@m&a/~u?|ͰR=q7RVe\ϸ['fd0CD&36Hd8T!_q hjԡ{ߕ1tAZ_BYԆh;Kj:*ODxS%Rh,)tfnj8͇αy/l[)w.|eL8%XH܅`~?yĸF6kͯʜτ$R$ƭ^oY[o2Sp͋0LY'epـo]:,kbRz-|9 `yw?.^P 5C m.' */w/{@ڥw(̚'Gր@t;qXviALNIw̏Z؄ڼ9lBVBvyjRborX?δvJ0+ ȁR t~]xq%[&9H]$7rxUqG=w$511u>=ˎX6?O3*hW; ,.3Χl'TnZ_΃'w TD>?2Q>j&B;ԭ [FH0{ $j9W!ڰXLՖ$xucV8ݲUjIQ|rRz˭7΢ um?Sv{iIR?JY_vgҊExSF pY"na'DmQ2%7yWs>\8a.u:;Ÿ{<3`X>Ǥǫ.d"f։1PU!sCK͍ɔգqo@ ϡo0q@n`SzP^$Ї$`ӕgvFSl"Oh 5!P/K,kD&g [ $Yܽ[_S,O?Ze^ N@L=L<.!zj< CzEosN&QZoU49.ULg :u h<3_DrOH_gEY50ZD8C*FU|; 2fAq SV8FK(r(kEC&rWDĝ##O_$j84K+ba}g 6&M?%M jCWصjy2-J#\tUXwS?rgBљR? J }EAZZ% g!qf Yۥ$7P,}K 8WU!aTS n t8%W ÅI1xHDe'Jn 'o &Hl$K;-sdd벦>)S[^AӿuW*H=.= Tb%qӏlxyV4ng2j ^} me*0' H-icco)X]Kn?G%;;VM[4Ͽ`nU3PaKGhKuۘ%zEE U 7$\^/ado' J#W YA1hor tdZ֐f1f#a|uKOȏBf/1ZHK|$?LH)HtڧcC䵰dPwFyL A4&,gb?BthyF޾KKU˸Y/jsw= A&K,AsFvlTu+,bQ_Ŕ;Ҡc hBxtGD"gձe8A߽[ Ng된sGb}SxGعڻ\Ѧ(zNqYlQ cG ĵDyJꧨHH8[E~ ܈z׆`F}4vaV9H#Q+.~|>fU:7g !bo2 Js5[Ƀr]LqX!ՐW' _(t =qSmP(C H k` e"N7לG5#__V^Z 7U|KrW}]o5w eۥ`(3h3uK-*j$UOQf٭W!(6 X=(%7E%z`I^}t.I ?>\_<-&(qm㍡O>sTPwkJk<̏Ћ`'h3QAҴFIٗA>b6aUlocnǺH|^RqlVde8}S1dR!e ;SY$I*;<);{Bث)uuG.l ۚu!ʣ5+…,ɹ<>]Vr{ޒ* :m vTsq:ڗB?n.0#4;t[2UP{t笯?Qb_'Y 0/!4n䄍4q+9u Ԥ &L+gǩ^**q*Yeua(?x .{_"R L{L))R<t,t+MF T V"*؀Z= WeJ)Sʡ hT(B"ɯ~ @$r `6ܫeq܍}~L Gΰ @4\D(x:ڢY sKG_F2&';&3gpISԍ3*ݟG,p/qro PJE74</Wq $EPDǶ[51wh+#nkأgd@g c{0/Ad7_vxȻroIHAd3c ZlC>qfޜ#e"v(`,w-֯]y8[$ uwXdȼl‰cW3Y0}59)cbe|*/xSдWs(G~nƍdZTw|E'IyVUHFfP9Ҧmsoc:JF9c 3 ?T,;nD1U0\`C(umo@^~@p}A7.J]`ot/8Z=ǾU# :>(蜙瞞j/nezB~ly{ /ca_`|(B}kwPHge(;RwP !P]ZW %7jq %HZ`x 2AMSk})%h0ؑI4AtI3[LM\O2(yXq53ECu!,vv|(Zٯ̆1K{SƑBs<6gk̭8ǂw-N%t)k~c%.}%c Hhh6KQb pGh`bbmO2-:-BEYK{3vCWP0DY_b ꝕK/FW[62t5Av4|6.9ՅK0(*v>,GKV^(>@d8SG.fPvfĵ~UMwʦCy[8ShMA22ȝz? H9|vܡ5`! Cw))o-]<ƣ qV ?^c`ZLja@Gb=J č\N@94k{lY`ưhUM֭H$K@,QM7tN9cLڎ^r5AU5\LF4)e.PUGbC3StⷋSDzUo֠ol,1Lk,S%jC-%j|-ɻjJQU{羞r_mųBPᣴ:Y55 C}#w ڑVNɋؘgG9 #Y245WHCl=Сbai~cs*NhJt^F3EYDĚPVkic'j:͡$AXԲ6񙦱q/DT8[\_P84r#BKmEʁ73zȝ]O:d|mB7{%.h-ҋ@ţ>L2fEg(ŒǠ͂:/z8AEUC-p7|sM ./vϙ,q `5UR9Zɀ>)*&E1ڙnȃ5+_ygU !/@!DR59xg*; 𖾻傇_l|:\zR­oEIa߂Tdw;^~'s0/6Qͭ`5ñr*fdl1'gp]ȕ s4xvO_ooR|sLVٴN~\q{(ɴ]T/T,=@C;? Lj="hv7gX{$ Q@_8+ҍhC`Ե(P_::WսlPWnp${Q֋jR |B^᯿揀3 JdZ< Aon| lq"fdXveaS={h6> .nEIɌe(rT L"E 9tgrҨvOE?@ݵ @} HQ (7l:(|@RɸrG2V"٠*%^!ev"ïVVcűSiM$"|Gp0vi8MP+mpqhy7 ajtÉ0 +à8X>M)_M ˰p7 f"s  <R5{R9@OxX|e}݀uǘbA'5*x*ǙoD\,sF}5sWJ{p> TfVEA|!w-E~ݙZIi* |UhqZ/9i1?]׳<Ol:2k@nČTCQ*<6fnq#tQ 9VII)U] :3B~GGA!#;1j[ Sn}@3TkrkoHQ>̫s4/g6W總CWHgjKe;w0^j΢ukW{nV@^9l p\Wg"LnFOebBRnu_myjCn*m߹X@-)(x&rݓBm b^cz}aCB:k@#0RncX,Dgo2¥nNcTW_(&uB39$V"-@ɩ Jd8?/zDXKDz. ֻH,ntz*/zH9h;O+Ɂu> .2- RX )V7$}Si^:/7Vfk-(BG| L^w|h Oo(4;ZH~^dlZX @MZY|*Eԃ q*~ ᣀdh0W:tؽ҇ kk 1r1K uɴeu!#fB"]sFWJjF)Fo")KSutG0˻  j؇zrP}P!g$ĝwo-ärfgh)dI?<5v)6,O*_o}XuIM=,Ո5\McFutY^Ļ+λ<4\ IJK~酲 &=odr*@5 UVڗ,cof(?<^?O.5\6?LrZ;s R֙^ܠiFKBuRӚ!m96n' m}ݰ*Kt028 ًѺ&%g@ظj,x?_[S]^n!l?0Due*G1< x䙆F5Jrk娋@fG0[1 ROnV6O~НQL xpR$q-Vf!sX['J{RAl:uv@xi뜾D"k9M'cFmI{kZ8Bk'xAd) { M=}W>f0ۇ//jTR<'Ӯ 0H83R"oJw 8f<$mNh0 K# 2Mnf*>k6>凞省v^63(,)t^ɹsr=D4{r ѩU5`^EN9^j.z KF߽=6(e1R放[ Cˤ(pŪ*;kʧiP 6ef-SNE/r}y춌1fu-^egE:WKӟǤ uQ{j!RzhjZYIk՝|BX^ \-5:ME=iCb"4`{Yt(rZ[Mve-·z<s^,u;RZ&\Jb\!"0P6-3t"Tٜ"—Ā v.jkTsꤟ\gOQxfNF`cDF*d>ltz~ztlZPIṈg6.35} q,Nu՜F֋ݙ:"ovGzj]YrLUŢ׵sowMĎgs%0Aِs&^H+m9|uL96>k=9镐K#Wu d LL:uI߁-O 7o-9pi4[}y^ :m#WЁ.Cb;3l2vBQw= )|켳Pތפ#fk/jMa W&ʎë**8 rhXjLj.R4!)Sfm.Q, ;qcdPz'ȹ2=7"ti$e̒SIb\_dN*A2 Il(1Ӗm7e!)O3"/ =Գt$s@t!"Y$Fm/b4VI|ߢ--I O,b: n:8qbW9*#AlСLSO5 9 .azwi棕XP2v5.H8o1v;eS 0[D:6A'}/\")F5{9j'ڠ(J^UB;4zqOjq߀?ׅTѐAREa D5-m&,WYSZl5NS@*ӏELpd Ϣn㈫:fލޣ˫n%[NQyȏ9Tanܧm.+ eҕ1!B-E۾4?̱|˨ЇzO! ^(T¡ &]װ0pt ;(d{Ib+-J%7xV'^̶M6FUוCP퍟+jjWQć}򟇚> FU>qu1<:F{.y?m#)-vty>|}DeQ}h XƝ*nV~P9TIPkFJF_$HSz[W0 m{=0"Rٟg4!u ğM,]׼@Q*_y>))tYӹ}(ITò6]yOBRۆe+6]TOG#Zd)LE؏l[=8D>8u溩|Hߑ(+?0;„J".ua5m&OzXPpTuZմӿjWmē}ÔQ a5-YL?c*+w6 !DuN0|%lVjgMɻzg!% n1 _$-r1eurU1N_䆟eE:Mw>\7WkU͙9F~wQ7)$+# 5SPGB\T0GRTFx) & D}ɔGy;v?sm4I0W-Y+CA>bt/soW'Vf7Uxy\:| 꾾xǀیv)/*37(j7ԫ$: TTA]{fvu+̑2J>Ӈ\aY-I N/{WU||RƬܡap&u\e+Lq$sINp8~I{׹y`6ZX)^7|)oƐGbh ))A^wevNeUJv"gDgdgVurC-h%)#= 9Ў&59^CYL3ψ.o^7 |8A,&w9+kb_G<x U].Ӡ v^es5O*f%ŚٻRS祶!YwvtOx ƬF.tŰJFCa!QW쓫'{#)<6saZU=^p1)G "Kیd]ZUyZϞq\ %'*͈^9EA12Da 逸cK% ^K_D7.(TESm4 GL݈4s~>{u Ca$5l!Ym ^q<,uQcVe7r^+ |1δ'xr{%w CqKpx?1 PueK*nbzׅV\NUսgggQɂpYUj@Tik`GB ڪ֡~qq8$舷dЋO'bQ1LS9"uv}ļ 4}$w_|Ɯ>Xg|. uCYd_16TW?(lc_DX'd7Eq*!ȌTHxbi|`m{ڠ2.fr/OAԪtq$>z~M3Jk[C'FTUyBE.rs?PY!>m-CNaF/wR a. i=d[ST}J#N cGH~ T22½ b\I5ؠf<3Ė I{WW-2jQCc#Y|h;{,EDsx\N9KC90k2UwU Lp_`ӵڎa(ߐT֟`2UdUAø k\zgb{ݰHWLej1.E 7! Ŝk;5,,7$];lkn55X)NΛQDS=J4ޖ6:k0ǜ0x]Üpn|+=5Q~\/1)q64.6m=IRM@V^ {[ɑnN2%2=#Z8:WPPP8JGSY& !*P2O{ǜ9$P"1Z`x5p^|f?:88ݑ&vP<8G+n0%u^7o ꣷA溭 -ubĚ Z??_xTGi,,_ypq+}qdЀߴVHN)78Ϧr1܄Q4U]nݏ#iw&n[qUrՑw;G%P)\%9!OD4:O?Ks`|roϭU82pV萣 F|M(QÖ.~cd^vQj%m)n unf'%z7&p1ȴ 1KL)Ց= ϰʘDqV[O&.9V3l[!ndo曻tW&•e>e{Y=Xacv A-4@{5 Qv5 iI#HKXУ52pyQxYtM.OnF;IY-#0ܞ4gpno?^Z5m3j)tx|Q`*<ӹYZ{-M"EtVE6k0'u : OFak"ETU$zb%'3|>^`ƨrO hOZI xOF Rz,B!؁JJ!bhhvKSLW]@𴯺}ZԿ*Oqz=+hl;Pl|+_wl%S #&WTH~ݡoNeg.d"͛?uYL*G&p ]a$e80  |BP]Xc#vbSBh (TQOBxM9MGvlhʥm 0 SY vY[d p6u'k}e[0UpHbs?q?1[OF MS_dr9U/8aGaˬ П͇XJEPכNs;ޡ]LIgF%K jւ[]e BV+jW8;U TŇ*>nhqW|3e+^񭤄q v-{b^*-旼àR?T/w[>XeysV8zðO;O 3W@ȟI`M_*$Οl,=A:: KB81V&H|cͶG5hjm2*B\Mq˩dZbQ=4l## Ty}sKб_?Tgp bh,"skkmJdJ!D2ooCLwd[#k6(.蜝$c/A洫l5\ACiWIq9oxA>7g%Skip~e 5Bt5MWd\j96op.8;P*Vumr@Pr!eWq۝=B'/|nD^-FXʼ81Ȗ I9:RHjʰt$y G:$iqw _c@6qlbt;e-Գf/W3.(_?*?[pa{ݱyY(E w.+WN Pُxi>U}ؼe|@!'^U4ܗTHYMkV~ Rup}S>c*9&7}ϱ|RuU|1A5Al]PK[LN"~˜#zmT@V/͓wF7ߒcz yTԎRw=3D$L&Z?smz^Xc=gt(-^n^햢cp;H`y~$2$q~ŹalL^.@]bB4Ŗ# ;SM+d/?{3D9+nr{(R @,IU!czsi`qckyĩu|`!R|.]=˹q2sٻYTA9Sh!dgGKܲNP; w2ZMTku kV[X2mB#`uD/\kyXAJSh|9wCd|o)ͺ3bn BD@O&PܦuFXB "ۣ"%!D'qG2mpš#aNGC@:_\BB kL8ʭ5WvSac/Lf ֱ mDa 2zHȦ]Z,E9DX>0?i< )Ou jz -t>oH/P"A:zD)j[ au,Ɔt9z@6+ ZLvigU~JMMҧYc fpՂjъOrրA-yc8Kܫo2FT%1}Qy ґg{ "Yu_Ju$R?Kx5僕zCq˭qr?9rvZ=!ލ+&A%b@Rc.^T=B(|To+)Jb/&}S.Sq }ga. kWt[.B+}$c#:@:Rz^ !Q'Q ' U0HoOGƘzQI62#*h}]rw_r 5W1/zĄf:" 1AxQ21(X % %_DX5n ^pQ@&N1>Ig^y۰%v:%(C:-G]/_ P*yX'͋xczZeLѷ9e5۹*9xfJ DžX\g8`n}ӧ&x)Í `A hYK: -c*ȂFFZ2Qrћ8 *DxRu'7n9Y 8Xwz5CrMB'yFt>ߏ~xA+'ܸ{BHeZzӡ;?8" (c k^;>TfNBB} v Yh|S$T|`@ap/ZY+;;e!KL?/IǴP,!Pxʲ+60A of3c/sY`kI5r"[ج/"8`Nʌ5] N >5k XV]§_Wdq}e [KGM\8t!y?W 9 .x)k7\D1ryxJ3NhIT0l"ߔ.FfUb䣇eS-FDab$bB`=^zNQ^~:3f @P{5֏/z0o!7 N'+q^(r1=&'hP1&Y#, M<:jZͷ4L9o.O6{\ 94e[کY 3\3}Av>[W!~"ܣsQg?#?>x6Pyl-(&8窜 TGa/2^]BD_ŎdfJeWSʦSW.r5_ 'n\ExR I^Z 8g,7ULCPXE/s!/eg6T=Fk%SҮiY%缰m$kVJjp.`|'`䔈ysq ~P@{8sa&@jF4ܵ5>jJKNqzEmw (vZjp_E e'UVl 2yO"=D)+% UJ,S&,"*VO_PvC7-{\ Q\D7̘tibW0c#e$;)*J\70%$릂e5-C_ P:xsuI4.]Kw8Z{8f<1Ք5oTP C5'mL2qPu3Bw˹|1yPb}VO$G*_JG f8,oqv&ȨX@N[ZjlVZ@b_,ߧ,dNFɯ׼S5 :c7HmwƑtQdqI(aܲ3+U)BެBsk1%DžPuFKuUJɏ{G>1i^z0qZed +hYOGInv!2lg+B-Êq?d 'qC>v ,.|M3P&Tcgټ9,[1=1j3m=hL-n L`)ơt Pckm 6d@@lbB M LQ_š[PNٓJ+ercҾ{F)I18g!xiy`$F!$~$b:*w5td8jczM8،mn  \zLL4@smGJ1@2u=8o2MD B$ `lu1^z}!!V--B,aBׂRG9F8jL0*Xõ~! fBȳ,%P>s &,%>[g+],hFbd1I 5F]O ~,l"gӌ@Uu:ZDV DY1c]!'h dz1atgq1R=bV5wou0$R𞻲lMR7tq1,]IҎ}XG!aBBu1)YųF&tB^+oF).\b.Z)vW|#?P~J' ѵŏSO\Ē4eбlS? a75#*n_ >#LQ y;?{HS?-mPnV,ƞYI)k2PEvV˾My.Cp9XPO1;?U≬5Nuf\}{C/j̽>,[}W $ _nby<-k &4m jܻ0%J\rp@·R~~e"gE#[Z/ݣ)6f*-:bjzh{Y{rWzHW8dy[L:?p 7Ioy  >bMO Cp8`:Lh̬J~Shr-U=BFtVYQWөq=Xo߬U-d߯I%"O!hwTsڷuʿfZ]/BInR&yWf X*%$dN?Ӥq\!RD=.@GւIsO/`>YJ֧+Ĉ=4[{K~yJG Y @?U"Kow\昐CWń;AQӾMN,Ɣwƥe/WZ Ŗ )\_9询6ZCn.9`C~5uI[zyl ,ᑻ䎹5Ds}x?VX;xy X&ڨǢs!2 _[;ZAfoD]:šm&9.b…F&a2Y ;v3L hco#%*_|+k)* [$\m> Ahh*C n*1gǃ#q|0,Wc#VnX Ĭ9WXpZĻdeU^0~R;7#{J~ܪqĊ<C@U{q**asU_Z(bi|eTcc6I[ɜJEa;cx3А H:?v3iW˂oOA)c2;mƀ"iy[*r"ǘ2fX^ ,t,+. sR0ٓC tP٘>0^J=y`4WdO lx3y8]O$%R0 ~ D$jWX8G>P Pك"0gaF+ y#Ycry1@Q Bj 8[u'ASWnW(:njqЩf.!8 L),B* >-JWuCK;Nƹ.G#j:PHa2 }&eR4)G60^]ebsM&h0Z*oKdhŗV]vab87H]޳ڝF,FazپE Tot -2OG㰄,Ԏ{Gɴ^TT@PdQ h$dp7BӋXQd*(R,^}DUv& 4ˣ&; odȚ1&kd/2^2Pbe{.'3}1 zkDߛck,%pҨti4'|rrĖ4ŧLb< h&>*Ϝ9oB҄I5oؔټv6wZNj'ҔQ`poz: ma{œ`A+~z?(f=N{1ch*hLۯ~V J= hρD :\LT-dGڪ А3/:"E*RMƽ-Km,kѶS]c4QAbܕM鎢mB,Rt\):B =Y u͇&jPp4J! @*v8L!_!^~ #3qF Ep/F,PaymHwxt~~qPѴ}FJdT2b+CbNC%"RezpS 6byUAtNԦffXB%6<s(m,Vd^J:i^Ձ֖т-cb#JF# ?CauһX_N팩%:1Oѳ8S>?b7J`.E%*:5X/V[tQzw?Qf?rwf'{8sSHU]+mQ'0rIMpP*5?PTdmBl%@b*Qև>a:A+r#TH~?7 ɗl{2ʺ@&^I]AO5rSg4Pb TEH֭U"u\4$rN9$LtZOd5В=J֌Ω툪2KM,.`0">]B.>e{BY%܌*强>YbI6BJR9X]kBqo8جr'`GNwV%0qyՎE,[85F?;$ 2C1`7#@$i_ ;h5f('s< ` !1." Aܩ$)ZO?*?ӟSK٩ bdE*vɃS >:$b$JfWd(ˊkzS\ +)tr}݉2P0PW> v ϥ-7xT473o"HFݓSw h >|݂H U%ܳ?PƪU1mf_gNXq/=¢ au^uWn2+3cv TgAΤ;6u+)%(]OGz?#>DK]gاB&O1gsy1T_@lis=\n'Jg(! =J=JgL?Eu$Y1;ۻm4to,RapbuCgv?/7RFfcyv09kkU"*8Gٌ)ו(B}9}lO mvõ=-pYO1:0/V3EAT6)dY*sUBjO* ='8i@:dȹ[:?>|[*OiDU~j䎻>o?fQIPgG6DD:5Dw艞^flv=@<*JoR9yeTNj-TǯWR1(lg4C^um}IM_0B$yJc"n5!]KT: Vrog,z7؁^Xn"}V+U5qfԹ@_ג&_((|n}w#z3QPiS'ךkW2<_Rj1xҭ#bBkmd?Uꄯ;8 ieK0=M>áIs@ɱ_}[^F!_ R9{8sZeD'iu{WqaVaDO?oSڂJo~Fwv_sk ?\;gc4#4{kRԚ|Rne}B 8ZBp-HfDszRsX012"D]48XGҔS6N&ΝTY%BB8kjҗL?|H9'4_5Mp?70{SUZ+3H2fY^wh"y*_ޡܘAOj h*.dAp}2ak1_ҧ"BU!Vj}}a\?üD; 0qu@IR+H s-[~Xk=n1DO1L9sJwN5~㝢ӄ ]iIj@ (>5U,ITΤ&p|Cw%zW4GVG8pv(AZ,2|ɎOZx<05W50g!45&*)R)A `]Ep6:NJЗ{HM5T3< $>f{*ұo&*;hƊVu~#޸Q|AuP1.xwג~ǓK;p+pՕ+>rP`HNF-2"F?CѨQD"!g!!nx[%J۠+^ce- jDq sG`hwlѺkNH) v 6~eq/3g=BTJ1hxֈI]TxD'8 QZjcIWԍ,%RRK3\Yw"^)>?N䪽_tV{"y+7㫚>~cWiX'3(qw&%965V4[L{^ͨ魇в瞻ԭֲSoTڣM"Z1{ (VQ4PE c0TE7%NeAϲ!RRtNzyoޝÒ||x;]l/MH)SO81̈́RKMt[Ӏ4_!yKCb5O6pׂfq=O$()$﮽aR[+;zA~."L1l\^e%w?KYN"/l(|)S[rNg81\HڏV]?ƻ^r!>DM9QL%,2B={Zb~ LHmvtyKug9}տf*jGN?"[m M^`_[KtZƻO&翓ET:%`bL! ^bŘ?!1bM\v$?(RfO 5OnB3Ka >Je50m65a]}b54u7puSNDc_&"b~e͜c[b=[nZp xt}52u_? /תťXt=<`2Φ]gEqjMk|GDh1fLK ʽθrl?peβC/?gaȋwEg%ڽzbākd aA۝𭃭 {tv޽_)=3T ++ykU=Z: mShI~}K8锼KkVە0贸O0MQ5to&~׵m?~=.{Zbl4=B{|-q ֠T<-<]EU׉a4dPYcOצ֝C("[5K"$aHK8et(h|͓ =cőxÕ~5Ò5u+q"8$ᰬnŁyϏm)˿Ֆ_JL9K;$5}赧Z]z<ҭټE8ҦV-5| {QaȪ;gƲ[}VjJ[kr;UVV^)d?IF] 6r۴ yNI4࣢iR $GYR82jN7xǡzenYW{å*  g".@ qbURcZE bB'L?^!(7n6k5QCV??ΞvU9k~u3-9.rfibSo‘>]F~mt/K$KE/F{Lc;ʹBs]j ?jH|f;yk\чx.+M{=wۻwʓH >řhsF+e~PW$iU$PmK˼cᲪ&6_)~NZO"p1A檽IM&6AF): Y$8 ZxLvS~ո}X~l`*Z~zD=궙Kܝӊ,JTޒRXz"e9Hx>'ބ++GF;iS0~Fڬ,¬*I|P/}-a[E^M&|ӀHqr(1; P`:"sۥp:܎͒ ]  ~UQ,o[q}8Y5N]t[,bK L9-&x" zDb rH픕pz9}:ec~~WUVnOu!%0nFG[O=\ I?"vam߶ b'$D m.Ln۽$R*Ryt ;VtA3^#R)1yg; 3 LNwښ;rNgC'{IM'>IfVpx1P=1,]&^uSY<Kc[D#HlA\f:TcWyIAa%#Ce) ɦ4MRjvܟ-'kDXmVTfx<̅ܒ~kTpJXs/_QQo'pVm1k.2xbD>eh\}GH FcbL.iK 7ivЁesLYV!fgV(הR]Sh-$Sq>'ub{`VI{*a{vٌj0_C)oS'兊01~~Ufaw sh^U#>"k^QO_G@OF`5J\h\K W72٘5 kwN|t]V4d7䟐-,NވQ+˜nn?t, %c2[8:m<@B_3oXF@n endstream endobj 24 0 obj << /Type /XObject /Subtype /Image /Width 288 /Height 463 /BitsPerComponent 8 /ColorSpace /DeviceGray /Length 34997 /Filter /DCTDecode >> stream S3u[!qD3;РӚ=w,8MXJOt%’Qd8tM˦y5iDaWV};P F:Tsϫb [Fs:^7(ś> ǰ(N0B o᠂:pVXA'LBuPt5u 5G4nָb HFlc<4Ė4$~ C}"p(m(,bڶ85G~We,IH3h3oMu Lre;w:j\_7C8 0h٫gnJ0mej̵G 󬂫ךvT[VqV mEV2h}c S|ڕu[Âoh hayY 6=YxxQ8GySt>t&֮5\1I*^v7L=}ܩ/u$@Ta%2D/Q5SSwvUfnUn] QضqظyJB5~83?YA= 3/E*txNa4.f(pEC,xi!hA@lQ j*+@)⌳} bDJQDkb|n&aK `?zt8;4 I~GC)BG-HxX @k <,Jա*P+6A}fDVnArb`3!Wtk i׭DUm:SmPW4x;58#oPƻF,ج,ps6H)ʟ#CYF6vb'[8G\:;{ Yozkj#8vOT ?2j9}ѱk.ZћQ:*BeT|E%r sT=hW.bR:+{ܱw.|+q6|P\ hw/MnB$?QFFWsw"7Ņș\39SuvF`.<;FqìPXi5xo'h9dX߭X$^oyٞi`,Tm[NXTJHԌt3#;,I0!%04ogsAܵmNlu0A3m0%@%T:NS(2Z$ 5qq -x('dwTze'6'7@,<g^T1$ &K. ʒԼm5p(^#4-=ʋl aC^fF[bwY 0v!d=^WUx|jZA-:+C# ZXsSr9_>jx k&c4hJre+nA⤼`mӾ KT W`.TXD^>ս{*:ls y7mv)@jluA@`e+**4%kM$A)B CAR5 @R]4=jqu@BKg$w2GCNM܈݇#wZt9DVA(6&(&n$ |^G6 eN3ڝd%j/ׯU63Ѕsܪe!tgKbǐ(H)Yʢ<"?h9z<UZ<`/}3MN8K]kfF$jj?Mӗdh/R|zL˄D2b=' Nړ=Zv=h.T;'Q#3rA>9}[@wh<6%]f_5h@ftyDۊL3W(]ev 4d7e5Q/"WmuKQX 4YVʱ2A#^|5_cӺm4y7F] 6ErKů9ˉSWUpfQl '2!;c*U%馠&)*^1:n#wVAݼeȐ64 dzdXB@'E*A=]\j&$M#E*EAnaJ^68MP`fq#[RRYNS Q3m}Ec^Xr Ci?|U-ϛv\>P F6N2v$4\Ryu T,DzZV þ8KϴV ܽKF"{O: 7ƚ3JQaP`4W߻ҝ4Jߧي\B2ٕr(LjĕusAۃg'0b1}zDDyaD &{.{Q:qZds L`-lёna]F40KB7(N*? r ('$""ߓïU 78D!#80;~l1gEƋ{UU֛ \tPqHXC6h9e-g$"a<_j0\ԙ!kx7XIh.ͫ :hl;9 9PbP&-ȏ Qf ܈'*g[[Zdɗا1eQ 4qH )/ASzsiHӑP3DϤ| zS_?:I+(<76K`4dEibz"u첉ֿaw[AU_\Xx7"?O{՚\zw 1n7&IGu1\u2Q]qoֹB8w(nՀI݋Í'#&@%R f7r: Idϻfq:KQܬy.%lP1X! ( *>e_sU{ܰ\@e.38}áBjn\Wy+WK e$i|!2L?Di9l˩ zCutPdogp.HXYCfNwRxi cҬ\J'+Au+߄(- H ) ;aEOv#l2SK޸Yj;%msθpE*{N t?QH1G&|>|N>zJ-UQDz.*Itޮiuovcn8qEE lVꆶ ܆fⓛBS@b6nE3& #jL_AZ5:GW]sʮo Ue|n.h\1D+|i 8L x*L  Ґ^ELO!m~2;8ב;ۼ" ˸N%,Si!<6 Q@ϣL?c`ešmbaL.k_c}Orp6r} 2ߒt1wS ^`E3aF]6;La#RY{{5|prY)_|MQD\cLsDu7 av&!d@ROؓ ;*uJ +QVڄd`C7~]*,$o7ك(ˡ @wj `>q@N xb2.QBu|2`ԧƾI#iY>6z>Ǣ`Aݖ8|$ (h)HN %*a$e2)yƳ'@n,cfy2]51ן:} 0<\[t.c9%v˴WV͗Ѥxw&/JRn9},5<ڟ(k]iŸM|YZD`B։y{<Ӎ_20Dʊ =.pH*d҄3\{`6K8d/*y1=ΜuFۛ+5m~X)2p]B%muу` Jk uI5Hu}jFPZ\BL3-?"|OG`&p&f!gV#F0BQa9t_T)Xh[WRT.sLZMib@S1W<̓giT|k7$Дh 䗄cX -ˁnyO)@EV%-$ "1f?) J1'Ofn8v0T8%9ډcJũMSHy"b|M2㌜яy)C^ן+.CLjVb̻\"˒)ߚOnbХvN&O3;GA~~|ORIW?'Pp#Xf}نo ` = ۢ΋M|DT[%|~j-:o]fGKgm; t1v#_ HjD QgwhXQ}ku,G )zN{Ao&-ݷσ4l*Y^(U"PLee:QPv $n/(}$5O_/ܓC%L#]Hw2f ug +:E̼XŲFsuuw p NY r ѢOoc)ζh^]< ҕxfh|ZQD.v]Z깶Ԛ5'Ƶ(֎{{@3)dݛ%*7rbx†;>zP\/vF@e!q&(4O|$(yY Z@[{ӹNsY+\=ZVՄb[ Ak#6.6d*Hm5%ۖгv-Qe'MZ`9ߨvBe 9Ƹ*dAqTwn0ZAf>W;y!13*zU:P,1F&ea*E35IHE~,|͕y^%!lm{{N c/jo dv Ji_=F،8*`y,X;v>%y*F4zk U2y2zrk +cBS GiAd!6*c+ZGŁ*sIpv ';Xmi8a6om2`a`# 86Kr38W{\F P;4(~-&rëss  |WI #@0IGxIULc;3}KNa-p MA1{&pbQJ}(FʮDlyj{O'J҉ԍ.]Ti,cw)17w1w% Oԯ4-~ocx)RwTlhhl},SACKKYپVF|lpC' MՑq._`2"#aˎܾĻxbk7D̝֕]#{mxeUyog ՊZjfdG;?2 k~@ <%'ws'I"ᢱ/c rհp_DAgb*KS۸XۢµƿnS"?L{ !^ஏUVYv"! l JbB̲8\RڠZU~93HͲֳLcāj1o S+.q^Ke Y^fR3Fy+P!%3&^6|!a}$ c{i\3kVw")w3Aj%eȼ_|øVR孕أ჆ԍӻX'b6Ÿw VkΦDk|FХV'gEAmRZl__).y\ulEȞBw&sZU{߱QqY {̐#fvS^p{Du{ \$4扼B@@徰)OjTYM?@NC/]; ]*F(;Tn?Ǟ3+bv#;ɘlgZ eO$KN(,zpuֽŲ^+a5E{qk|/Ͷ` *o1G,O$,x۸̮lx a`nOn<I Ѳ ![+zMEDuM>ⱙ7iD/g^(sit#ſLP([)t\0;']qzpeZFM|!#*9 Z儏^~/.®1!(r^&>ȅ(@=v.繦a,RRm7x?#@??wp 'xw~f1|]M;#~&לHv9']O_c)2JR<;eeѩ[_X12>T͐F(㱧(^IeEV0`v6YnrD]:~=b;9I~¡``4FgfaKkv&]SNUt;1*i>Z`&}^7GQ4ή2 6Z)1ӽK01# ^8d1w-c^vnK6x 8џKey m"0f=K) 5O9Saw {BCÐj $9pS)xk&M0!+8wzE˞Ty (p_Bܥni:2qaW~fBMERiyVq!sztl}[z岝jg3{9WDwפ~1:{yVy8^lTd.B^?&0r3V}x]g Ý=|TUɐu n+KԵM]ͣ*cȢSR'W-+RBȝkmz [-8j\Il2ȯU!R2|ky]euܢ?r1G.`<-*'dBZ{ iT-.`ާ$U%jQsVAR&8j e%Ahjy~fVwRJ_qޖe ,Y]8>݅$b+8HZ%эHA/ل`AR@}>=9,MS/X l&[ls9dV/5?ߢȈwoϚ1] ς0)xߊlƝBf8'.x TP<)1nۦyAGHĨ h%(YV5Ɛ|'4o-ڣ#IFiJ]8sp=c$元` S*]Zi3Q@\}C3/k(g^C25BUXiB7327 \7M$4nqBq坝Z,@d#X~=>Kf]_мcssxR-y+zcm,U+)3+U`QMx (/tSGŜIϨ~.s!?[0 igՅgt; 6t:}g Psyښڳ`ah\g5< 4KM_f(|sJE[KZ^EU|o{4$&NB -_2ӫo<12}XDg=a3kDE <7{`OuXwu0¨ Pi%̷n/Zd^eTkH7xJ)QK3(F[tuA?1:lg޴m5vUupzS)Sl[x/Z-&Q M}Aܕ6l<Ųp\"7(¥r!GE>Y} VxEGzg"uW09['.)S3R6G-Cսc J zz X~Kc~ap*n X1%vڡ(Td6sї㕘w@[]< 1@ֵdGFVέyJ $R% NM^?vļ4EaM,J@kw Q!LI,hxt=J,,X)F![B6"C I=HAyyI{Uea>St7A Ny[UyVCcMH7$dE1yroն+#j/on>)EukgD?y^IBh PsKv]|izISWiviIMᴯmiqڎu(4ndL ֱ'.w6'E3;LNzoOQHx>x ųLaDV~XXI$]F1$@wNp.O,ۨ(`h}gnGdwX0;.r͜(12W-;EJae]ɘ{PJ*g"b=FxZ%Jpċ8F͛/\_L?VډI vSmn^S2Vzce%`K Rn3 ^@zc ?Aj} qo2 60HA@.v7O5'N3cv5Oe?vH|HJgs*(3ֵ 6)DGRefsn 3Q8i# TLIז)6n%f ]Sn%H U%A&Jbf,3}6jVPFb.@KɖPUA3LґpɱKd8U:K@Ybz }~Y-b1Vr9yOt32 H,k8\jy抠'+M!e` ؎Ҽeħnٳ4?":3gJJ7P`ս췇]T``B[j$(}jwJڋWi?XW <.3\up~dKqV7m\˃+!)I:>M}cYm-Bsm4 2h#Fr( ~?h KKU=F4lȺ^Fcߺh9}Ƨl|Csʥ $2j+rH & /]҃(JK,jGD]tܩ3˲MOwAH"9V` XN&J-+߂W׳pn)%Hy}QĄ:)rq†? MJӔ-"'`l63L[e f(HN am' ^=Q D5.R61y| :5eT|y͊pHӡ 4 <#E+]bR$1ArFk)C0ȷrז*?r t d(ϼSxQBJ<=wАRȼoﴪ- `mgO<:1@J jJҠ@/:">Mi"lĺC'Ekk4f.^]ɞ)t,(D=*Csi|f2 +P:v0MQ衩?E>}Uw\ @=c+ReԌp?TEXn7}p[%9VhZ?m׃+\t`M9_{7Y`>{*AJCԲJ'y, rf<<} SÝ|HE$m^v%4GCA:{ V{)t]4{eٍEA&ۣ=@\`ǔmBXi?]9c@nzZFLrc5iMf3N \;)t@yVafz!^/vӽ̎5,ּJ¦>ܠ˝C.)^u T[߻#hBDNc 7~Kt\55B/=8#r!e*1-J>)^[(M43 + pPrGE{q!̅7[b}Ko*AAaY, UN'< '~#B @|cu_ {~?`41fj1E aFw&oc/dlkBRr m[.56ZX'8 2QÁUy3U?ML`& G&ܝ;+ r/Uك .o&(aQ HצS7QKbx|2y:z/ӒI_6SVkg^&HK~Sꂘ.y_dRvb5P !?- *՜vbI'X-aF)m{7y^&(ęFjn9EF$Ύo5Q/ܽ#3.ͥEVH2.(ۋ@4JB==`H٩t>u"d1}b_p[j'$"7tv8d42|Kr]>5cC*QgYu[G6>[A8:X;dP ;DYTF>2[;SWņ~ ;t_.!!ʄ@ݼpL鸿ֱd;-o<3;#Ad\ȳjr˩=3T*Ndz~Z*j(.Rck'R X降Ų s2ST_ '*.6R%Tg5sXI˥%[KDžJ,И!$A̞\1? /C E)n!2-)Eupq \[Z8Z^ b!HˡkԂ&kBi_l׿&o]&3pD~@r)t-Vɳq9 1ku|~/z2cM!.Ѷ~ޜtߒ3ZB VNׂ+73NˇPOWLСj [Rxv9M{{?c삃ࡅ?|$5E] iYU3[mU$- B'B- L .:.uw`[\ԣX_72rJ7p $F)N/FE#pIpsTq12`߶ osɕS69SP{&Vp+v1Y "'Ai_V``N19;#|TBjL-WGٜ7A%g[Ű C WF^JFr((~YǒE͡% ފQz)S<̌KدR^/FrE(L`;"+倬L*qY(u!}/ތdz]ڷ7᫂^?rFR o? y'궻LSXrN)H~-7l[ļuXo.xVZ'}bHs`U8 Zc6}"n1(kNZ@PߵHp05+IqMKP9 ]rK&k6*n59EPE;,N XCT7r6?M@N:vEݪN C z*` inL]~PUVN6(vpmq4eKq|U0J#1tfT=<@I\V߹tF]UNjp#wn?LFL(} گ2napGΘށR+J.R=/"LcEq0)a/t֘&)ﰆÅ>1v\ze}3ECZA;IgF-:Նt]*8%hOT f>5?G&+ IQ[qvY]޵uf/f'"3HF&~a NSͯ ~S*웊q|ڃl~HjLv=gL6PDbskSU1? xOT+.6S1: xWD,{ߏ7-Š0T ilqE.yjЛ/I;D$u l zA\8 {xJ4y@hkqm{S[[@[VoraS?:@UU#bd㡸#nlKw0:޺*]qIQ:1c4mOY0EH?# 7L:}_v5tq5i 9jN #Cr%3b!E<:/_bK*)[ ok[ưn%~jZlJ\ℊQ6?#D#; VWة!TVp;M aZ$9U+@E|!QQVToSwrcb0SkJ^ky7Z2+"i 8fšuӬɐ 5#>Zb%9! u1p_0P&5EiKcwD? 5ދn?ALA(U?eMDb ~=sI-/%u] FEt1TeROzqdAw@FnQGl2'Vv>Zhj+5Դыΐ3׎!ϧ'I`K fH#"m ,!@rA o~ 쯂|kJS?mPM)DF#D(aA|tQq-@n'.^My_VB=_vg͏/=' ̛U hF2{LΆ .:yX+ 8 kɥ>cíhӪVJw5g7DOxajZd|zu)ao6y=ϝfmG'J=8-w-ŏEߵPd1znB|L˷r7x]`HD(o/v4\iR`yAi <7 -w'q?ȋ(0SjUa$^S[>py[hO3AAjGpEM0!G"1 WI wՍma 2;C#^Βɭ^-;Z ww'PVD30,ۉ#'L˧\.#O/>_ZT_uC+9K6l&sHZ¥ \\H\E럆ȩ8 W^L;vU2=6_V-]:R7%mLcT:2t*-,B\O[I'^ȴG+}>W#tװq0 C}\hJ Q7wŻ=V*TԻ"&qm"WOs 0 ѼjP{Qe3ԅl>n44FϗurNQ-=[oaD;aSCnnZ4Io{;>%\/^MX 夋;v%_»c)ƟZzL\Grܧ2uh-eSw0 _#"o~Pra tds >,.3Zh'1}оXfn  G>QmA4GSwKov̓ܡ꙼?+Gݐ0rՋ$7SpcE.^M^kNI=I^1q^4a霢Q%\ƗLc.Ŕv`jkYd%%R/g,[98&ۅ5\##zq Fo'hrr#5sTrpm~,`H:٣:qVf0xлb?8B~}41Z]Q(zyȩsw2`>(tmEBqm[?Iy|9lAgMLHI:>{%vASv@ƑFZcqxňgK\XjXE%_kڄ2-~gel2nMpK]^6H2]Kɥ̺s3Fv'r& ӑL 3:+i7+#ͺʨN=*l) VSk.ؑ<W20$gȤ0EsiE&B+ՅnȎGqNڣa#cͥj]w:(q^]a4hI R#,D^! 'v_o5B:܆D1o+- @pzVw|GЏ˵t^v枍%tp6> խZI?ݥ,:Ƀ9aw-D_ 7|ݲ){kv!(T8r; 4m^ťҹ>Dշ3 z&YxrV[쳚ܠh&Cxlؓcԧ$4, NYY6p(q򬳆D)i4?w|O.XF]L{' !f6afr=b0/>L+wU٪V]%<y,9eGc&vI=>I9+Z#wl2.u=yϖ;"yցU ҃H VLs*?  0<7oN;1[ηדƳ| | ɥ|Vz 4hVb* M:TC`aY o>y)Z-e!+n)ej?+`K!ϔl*Jw63)S6iሹ% ] .yxeL)wn~ t u$¥zts^;W '% aY@f^jyX)TZ}e?VU=.z$=x|/MwڕKQ@ ͟*#*|חYb >:-ӥ:/Ә@$FwtXL]Oɛ5`ɷܡ Hj~CZ7!Yv2bM銇Sܐ-XSnJ/+߿=F7!~-ҁo}U՗b'KҞc~5UXQ=IqkJ3˾ V d~82qi1<ކN8(:jqbSe* 9 c鬘Ix^7W1W CZTa5`LV* Pό2"}zICqhS7?{ -O,f›trc۝ jLHfҚd\eYX?Tq.#%W<(cs4(Gr`İ-EN4#]4id% N$/G$ǾɈtjŁ'F zT\jn; _E(Ɓѡ(v n s,aæq&Hr/a@~74TNLhu2$N&@p9{!5=7@r5M3%dܘ/.Y$>/\Dv_Ǽn{r4NBeF|~ꋛIY}-ĠtȐ qVX5HhD ^#wvL SzN$nFSshaa|O*OWA,]CC/@v5:ZN-d-.)ۄU2!ۊceF\IwESSNS1'*)88tѹ ${5Xb-5;|V8:%FKQ1SCDb ¼.:6h{Ftx]YH)Acy{F" HQPWO [˴;~{K/Bzi(bۭR[Is_5]i&fCibQXJ+ Wo+0wd}4:=!uJBBuyI=ήcvTE :*SdV8?Af&juj՛[sj c=Ow#rT7nv'* ͇"ӱe T>5DKQ;)Z/a~d-w\F?j[V<[($rn:N6gAW s]RR=M3փ~wg+WT~R"pxISzJ805 &xh_R#V&=()gӸWb.A`1E7L@~u: S&ǽ= ʖ9A\e|^qa<`2Z,Apr@- cIPh^tyR~tmY"E\]zD4v k kG`aCT2164$%&rSd"ysIN7U+._OZ)^8HFx_ՄuWR+r+jxzøiV{Q qgz>c]V46LQg [y@x0Q2fSNHy#NwZultlXMO үBC^k"w}ī+"4 "Q{Y}פ!֨7-{23wkICcK8R!f͘uZVv(Ѹ {봰>avM  }u+%XsT2U#'Y5WM-J2]"q)jI  zGTppxU3Fĥ~L(7j?X`JG3X̳wL3D6>(6niv8tLsjuA]qֱ>z5eTۙXsTo),zuw38FaLxϊT1~|2yžBK%}]dޛM#]' W~䷮D)E w V inB[o^\Ђ|4z;`%'Ots6a`.бmNqX[u< .p?%7ezyᄪ_,~C`^>lD`+4a5Td)ӭ"U+[>jĊD:`2Tb=[uKrp.bЭ[ͷGN*ҷQ[ΥS7 Km8+#k:[!^"UH1EW|jל?iVꋈ`!K͈+AAVTxN3_iX]-&]UXGr4c;. 2ͣ*Io%I•w%K2-yq?S nEM`۔ 4FXpIO C9iEl|2$  l)1!ݻ5sǛ|qQ>STnrH:w*?p܇ZL5n+(=͙Cd8(>β-ņʸS$_[G?~aAwWZcB.FlɥǀCBYm9u ^olӿ:.!]Y:[XeA/=7I^nP྘A6}d].`0/5򌛆JWGZbWBxqU.l0U[ {:)r[TĖ7 g3= 2 PfJy z17$2o}0VqҨ 3pߣg^ ԒW_~ԥ&&Lħh\2`8`7`0R{S=R9"JF= hm& *FϘO0aS˘ZM+܌!{s=`řw0ˋy wJd2KX 7lyW݊"Є ,QPN(^tSs:8Tv7C,|Π@ MYDKih0LpU' '-hN~!<< GqwĤ p#k,Vh喹vC=],t!!W~Fa V܂(LjcL 6NBNܻ,"'`2h立lF08q8lOt&1e#g">Cw}+pʥ.s>+ BuLxFS C.;6<̥E\S슞Ͻz98J-ey0A=eنov04JX|`JM. brtguA lֿ< t]y:6BCmfIMZwV]8Gʁڈe"l?:<N!*y͈ȟfDP Ȗ{"mTiqI@DTX{坾E]VN  G#ަvNo;Jp;djR-w8ҬK3Ax`9k23m|_ mg~';F/1#~:z 3"ujg{~&m^(:MIUDS@6G+gsTn Ls|eUEz n쩼BA}z=3bI8Ǟ} 3.;JDZHvhw 7@nVɝ\Jf1J%kl`B/!jY ݶ7^`}!! \e\Yrbymu/R<;BѕN8o,`9;Z:w/Bp 6dMO>]c UJzkީc6a@'T0+Rp5e6VܤfeL"xCfAKS ى{@'qUбr٠S,6/5D&n2ػPd;yb\ԫW0c[z-CK$Z8HBW"+IR?&nօx *X ~]yp^,_$6Yh͘R8jiג2x|dlbG!|!tW~ZR".[<(>Sɍ /V0LP+idGX.[VbgěC#'I4A)pg0+٬sV <>ܠY_JlZ:MWfm:҄LUL7*߈#/rf.^Ჟ=MC\>ε_MȢ7HZ5y Yu?s܉,[la"s~ǿGºi |+P)VÇ`4آ`b3'ldB*ƅ"D|O~D=ҒƽѼ|_)Y>sMeېw&kOs@w ڄ6|y$uQY3qUZ4o!#IL c +P5v9ccN (͵sX|HFwƷeGIŽ;7=k2[B͌.\bPʨdGp(}'OAR)UTxErd=З3Q 4vT ]sqt <9;&m_Oǜu1W?&m9.C|_y?.wG$g3rƒԡhVOf|?\c52JFfA۬%irm ǹ$Zҩ"'tm(>aj{砯DQt;/5,y8Ac `,}8pY} ~mk4ixx]Q. vN+#drWKxp2p\\zȉ㮵e&2i¡kDvX9Õ3|Vp3gڋptD.biHGmB\%,9HMD(d'rSZ*@yPi^c:Ji|㶾Cb(UfN]LΣ?{ "Ï1)$-Ϊ7xhy2XfW`ޙ?GIV= Gm;El 6ҽS' f`&YVK J(zdNFG'wKzt㲮i%& Ar.՘@Y9/Qo3밧ގM:f s*~zR䞞3Eo Fm6MbE0&ʩ"y+ S`ɧFxO|9>|HB 5 Oyq#o](-_ :~.""t/ߑCNk?3W-:ܘuK]#)|7#gEg|MJ 'n*F74: vcn5w qnTb,3!*n/2S A='۠?D^7-ޥcJ׵?R]I޴w+e*|$jk5\ Հ `h=pNH">뻄ݯ fN|W4#fY'D)4X$6\^Jaͽ޾NOVmʉ|G\Jro}$m .)Y_OX`7Y+Pi> w !ͭ!䦘u`ւ5fg23, TNڲA-RbG5ʸ~m0g'i[ E#X7{mwDeLy=/t\ prNi,JW:v]I/<8+iJ j .qS\ɸz?eHQy4Y׌j?fJ\{5= *y7_]յ~ Ih yv=[1~g"%F@oe[ބ5 {J2h1nʇǶٲ,vZ/+r=tLk^ztN9)8B]6iNvULW?iK=6`2DqQ%sj.o ^Ir0.L1do٠1&?f:2eۏD5 '>Zٱ@2&v}qJg6xSM۟=bH4$/՛Fgn˓Zl_@:K^dͥ7K74 {r\^1(Jh:]JGaǑ31 +̱U_Jܖn|>-QiYA3#}" 7X``=Ž-Ѩs`NѧM3IOo9y X$6wRNJH xkRhAW 5{fDeQ=p&xe)241ӣxNt5Ԡ14w0zScnZo 3ifʜ[:ɽ؛e@&CiMS4veg HjakBT !/q&4uٷf)/w;~w@P)1ˣ[>@m7AB{:u IE)s/SV+&O.ľStkʺ'9FP_)Yc;7m<)օ޳^t/s *$s$rO<| o۴& {~ťrSM_MP6x+d$`w2>?Uc*ɣ{yQ-\IQO&ZQzN< T9ͬ} NT'BPUg wT9"og^g 7V5W~_F7+j R a'YǢE\K$Y &AAdblghZcKB瘔X*OP\zf̸|OcsK':(w؄6AR+6ܠP%q=٣o7 ѫLD`Yjͷb*3/^.>A*7wJwU-'`[Q!Ia8'>kC@;)P؏Ɛ>rtM*@8 Axm_6T~%#.VsbC9 ܘ~_TQ: ;1EN"EwS`}*<4KCbhqovݑb=?y0[V7HmyH]mNaGw:t}C Lnl껩##'\rVE1.e>G$o"󔁰&kb<4M(EzҤM4Ww),b&z`HySI"^ CsGvUp#>y%"([gSlxG؀w"bsE[YvYSLH_MXQ;Ay~#>A[_z,a͍׏.:Ǔ"+t Cb8c6S${mt* hBZ켼u;uDw *a[bTMM; v=x>Fpu@vzw 컦DrcY => endobj 26 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 97 0 R /F2 96 0 R /F3 99 0 R /F4 101 0 R >> /ExtGState << /GS1 102 0 R >> >> endobj 27 0 obj << /Length 2841 /Filter /FlateDecode >> stream tƐrhl:pD/Cy,Mо;i0)hL&q:$u-g ڨǺ~nE. 8V}1oXK*[ CgA CZMaAVBE%ԄW;;nC@beƠnɃ@&AgyM$ bsH.[Bg(;IP[^iQZV+eBx#ٵ+b "r $m( aOƺXPYeR~wr(#[_DH9Q,drr2̇N׵KIr(L{=&ގ >uvV5/?iE魯>M.)>Ѧu[+!_U(U{J7j5;V~b!;=&G?92XLzgytWZCf\v nF/2y2)e:4V|É:( 5/w|]|#3(@Di&0 I6ZhsPbQQ1飀n[[ӊnY yADOq>9Hy7Z#FЂ9;?iUu` ~F0'MkpgS19ȏv s~U`׽$M[3:UM}xX9+!F TB5M 䢕*4MާY2N1ti?PX쀩&ڥgHkO{>/ mFA>p#]tKXa暑FUsCΨ,| yK +cVt*Cmp.@sQ#Ïe9GyS7ij*OPetqf%з xK`$q$scW r;NwҊIۈ@ K"dŞgV๔ endstream endobj 28 0 obj << /Type /Page /Parent 86 0 R /Resources 29 0 R /Contents 30 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 29 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 97 0 R /F2 96 0 R /F3 99 0 R /F4 101 0 R >> /ExtGState << /GS1 102 0 R >> >> endobj 30 0 obj << /Length 2719 /Filter /FlateDecode >> stream iv6EK^ LBhAׁ^kWQ]Ꝩ8|$6t7 oq̕t2C~qB60/L" LySˊtiLhݵg`a!x PL@O4 G-?#m# 몚+f/杵q;!K[2"SAO zv(2 ?j <0<rcY/pشln{p@41C֛.Ez2Euz`d.l~5ޏ(Z|lUX礐&UFBaDZ*S~ O?t o(; Y3gOgu6te$$'4j™6\eaB/&;\{@@)a$.O۴bVxEUΡ-Hyt#|oBFyȚޥ.S}WP]#L|c[3և 욋ِb?r-HpLr:lsVL 06o)qF+ zz_V;VxIߑkMBȈ‰a9cjx -ݠnζ 6^}\VU{ im̟“NY2qU{'|d:):c(aEg_"mHCf:]ݾQy#u҂@ϺMu!_lJn}ZG:^Ib5vsP.8i,»a-GJ5/yJLjznqqSh$$fkȳkJzJ :i޶"x1]?7J2Pnl4sM9]VEn$Qe;5qoڤs0h>(яes{qPW̧m`y4C\՜yWAD{bp=ST$מ'ZU@ES'j_c!Lm2Z4Fso qkº ,ejVI-ZKp`&Q|Q6vWP̾ 7 5s3ϯh 9]C@ïBh9z3߈ ,MkOoaXq$]NBxi!-Ք,c1UM!j^dYKQ{`inIBN"@r{,ןwJ.rj0,b@Qჺ;,F|z~  |ԇdI_+΅F~k]+C `i nqŴQ"?HCt9 ~SII02o#B'c Cn[蜗0p,rl{vk+HŒ` A301$0Sbs dAGW=deKsۤ3@XҾC*?dX]Z3rMx"˶hFwY)AJ|{(zD`IoМ,c|;K0 endstream endobj 31 0 obj << /Type /Page /Parent 88 0 R /Resources 32 0 R /Contents 33 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 32 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 97 0 R /F2 96 0 R /F3 99 0 R /F4 101 0 R >> /ExtGState << /GS1 102 0 R >> >> endobj 33 0 obj << /Length 2387 /Filter /FlateDecode >> stream }>0iU{870r& Z!Vja-C/t1kC|BA6ELϕ…fgKJ[MS$9~#L:6@)>eYyC>?0'~(pKAwu9EcoNȭynei{襥OQ&j(oU~մC)=ݞ 3k}͍$bNJ-6Anb#]^)$ Zk4] S- I/=1MpGZf9+HC s`;Z(yiH@j9>M79U/ŗڑOI81 lF%Xa,d>HaUtD#d/<}ǝ5]P i2ŭ gғYaJ"2sLJfQu|N鲦#qqPH49|Ac4o vy.r/u~_R%.!ӤmԈrً qrR0|+9M˚_5 2k(w8=;ɫ%@Va3o߄I$#/45.|#ȼS=y74xYWvz& =g0 KSQq=#(=EQ:k!Sin=ϔw L֔QK:U=qm" |FPR1S]Y"Gq,7Jo@ˍKD2$c=2p:KDG\ӾaJ);R'+=qau5 !XdGDUNMj舔k] p.{@i2U`ݟ \!GU++RO72s%򰑷ͽx0U[HV\F <]N~3%+PeQo--6CzB$On?]tyXd8_Q}M|_?vJow(mLG:G1ۏL> Cj1RC'X 9bw5~,5ʼ뫼dkZ[?5nPj4lXt V׻NV eP{NP9@ҧ mAcMoi4G-X_ʩvdX2RL蕓6jEtY+O&î5wO5I d3BQ`zick' k2WGSZɦ#3J)IzA{ Ѻ [( .Hs%q(=PWL$i]YiP̄41Apu)=j`|"".}tRfەr{,Dɬ' Dfbs'RBo@IBJI`XޙR5MmwYv[FՍq_)Oo3CO6,jG,d]s[`=E=  4J;u^_'J'Ֆg2B8Kv&^pE~D^ojd35oL+~jv"S8k:zTCqMI4.USסѪdjlnaHc@d#u1<BSFb 6q5ke1QP8;ȨvO=,n<-!+{,BJ'76C^pJjE 0=,&P& 6=žb-ht3/nQ’zjnf1ѶGݢ(㲜7=Q$9;'M@~ X`7Ύ ]3.?O^Z# ʊIca_+Fj\-‚9CN:MZoGP,'qOs_r+ 52gZ_RS6CZ)sp{kLFly/*|feCG9,YAM&FJ S4bzclə?*,+bapʒ[c$rew`gq$DD#gwZ`EzٺudD.u endstream endobj 34 0 obj << /Type /Page /Parent 88 0 R /Resources 35 0 R /Contents 36 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 35 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 97 0 R /F2 96 0 R /F3 99 0 R >> /ExtGState << /GS1 102 0 R >> >> endobj 36 0 obj << /Length 2215 /Filter /FlateDecode >> stream EͲd)D3`ۀ.T2&/CL )UmxnKɓ@IB hu#eG] 2T|KP#oGiP{ (QbA*f99-uf~u3qKOzͣ?0!xԦx;i %G>_wOCYO:tfN1;wl* &5-<B!;&_nՂڙiy;ԣ5{;~{x>ב!\t'B!yg1 pG?:N4$:zk%oy WxFrp]N BG ' :R+*@3R4)O6QϚM\ 1^]I0sɷ7"Lv?IJ"W__mGt3] WkܛwDe"-6AMտN](,|8IdPvŔ&Vl>HH T0놖Ȍ|Nkw(=YҸd]srcw0~ч&$p"2ga NEy/^b}vcAj6 vhA[3o'|\*1”0 MZ}8ozrY,۾^KIX`}mz4e#A픂Tڧ]eQjZv~]K;"̋]fc/˫ݬ;E,9p P7K~@Q:t;|>mk*3h GB>"j=) wE×n> ˳&Ca->x*B3|<  WK_P.YfN_Dx=taӽi?Ѹ<,wW\Q|!H=Z:³];'`3@)4 _+ohi6lk "$Mfgoid'o%jB3F%ʰ;+X5]9WWOӣm ߇yfp݀!y'80/V> VDWx5yzc }z{k^kI)rX3i:gvcμZ"VUڎ6&/iD! ^GիN=QUܻvYSyu-G$aoȜ3uZnZXb[c/qiq2ʤVۋ =|efog0[_JKņT`hpٌ.MjSz(%WϏ_EjDDF> /NYM#˳ kC3>YِlDKHB;U:6.B'jr{^Ö\QnRZA0]3JL5+\>5tbruEݵX:b'r# Fl% Ei%8]!Z׷.Y?Bc88z{-Rg'*Zq ȸ1KN3ByD&簡 4)\B =hhy \f8>O/ROǻSHM%y\gsO덲 LO”vȖ)7@xsk'C QA~O}@GFgM5X!," tRRR]*72_]?3P*w`Qq^I#jSZ:쾕k3mf.Ss$qQ6Z M6+ %.A TqG#"=u^2eqE/oEbӑ0I>'+h@P䭌dHH&tɻYE\<[|Tn`^?ZTS'L[*gM N` jB p0ߐ)eܧ"ttX쨂b(?V ŋ*-ZkE'VEn{֕,R[Ago> endobj 38 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 97 0 R /F2 96 0 R /F3 99 0 R >> /ExtGState << /GS1 102 0 R >> >> endobj 39 0 obj << /Length 2141 /Filter /FlateDecode >> stream Y(NˮIe '9r2iB,Q-fID}4Or72~AtK u94Lz4H0 3#U׏u@)ӑ &:{S)5Xb < S V$/pA 1 ?[!v  #MR jW{8𕻑Z8~mL,rA oY35[ +6@Hl4mvQ{$I A9ۢշ)9Q[cl* /0p˦ 1" spɹpi¬7%^;Jm/'㨗[aCfi6I>BdW{#JŌ ^p,*ne:8J<t86qH ]]PNmђbD :哰:l֑=y]Za! yR]A:ɀ4ˍ2XҲ&*>d`E)Z[T^L߇#5 \kGl!8V] 0GbI־Bwwu\GYp^5]iVN6vE5\.' ЁHtkO*0x)z]Z.4b)T=pʭǑPrdޚ|w٠Ej -vǢ|^𱕝%@k l-|ȴ{J2n+fV@z-@>".{Hu;H<^OOka )2/n=eK"u >h m^Yա:P;UQƷ_v(^}\h,.)|?9d4ͣBsPj]uMZ;s~DF'fUP*0;ODָ.o>]ҮP -^4_ET1xsU`X^W3ё_h"._"1SN\!(VN DJkߌ^e1UE$N.#UgmJw :::K҇C~xzV˹S씀:VyR ǙPnnLN6>q/MhfKߤ@|\(*!v|cj']wsv DB@ByOT\1 ;/OS5}뒨t{Br!gs?>tnj hfCU_&] t c;xOQ, eG/0l~"򘑞?0iaLN)ixm7m Օm4\!VM%Ju~U:$ǞAn~%0wώx,*њDjs $[bkii7A#F]Uڶ^^L<qw}p 2@ACt\r 0yz]Kɒ?sHNZo^ȈP_ׯX?w٣.6@Dh"xB%c G4 (* iڕ M/% 2pC.ܞn{uiN kPgؕ :n=u7ݾ袙~J)o?*cNa,/4Z C-{Oڿs(1bk#67bV- Q: 5{bWz~x g~(j*Ս)?||}D% #~ʉO'rzڽ#XFOHk5/^ѕ;=\Xc+d u endstream endobj 40 0 obj << /Type /Page /Parent 88 0 R /Resources 41 0 R /Contents 42 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 41 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 97 0 R /F2 96 0 R /F3 99 0 R /F4 101 0 R >> /ExtGState << /GS1 102 0 R >> >> endobj 42 0 obj << /Length 1444 /Filter /FlateDecode >> stream Hi1^S\J^a{">`W.䰽/gۙ,.RB ͉ݴd0 .R둥`}pEK_v9׿u V-FR1d3|S?5XS`C9v>][më{'PG}g"%WmTe7LNl{}} >5G[x^Jfn&3뭢$>M ÉA2>2&:K[F1u#mXV_ZU'MÊF@R}5Dv|u7nlƇHrӓLnQoHsŘŐ"|\Ey({1s]@XEyQ}cP YѯvLAEX؁YQ~%8Dѓ LPM8܇< JTɭ@*2-=Ix EVעzmiSl>tZdS$` 7^5.t ɖ.\k;h+ʂ[e}$ueuE)A @)]ܕ%]7R#d̃I@{=_@x}`#T:p;C&NxV٠#!"rlO&\Lm$c;>̴LK !uY?T$/%q񮧱g9c_Z? FFh2[7 aGǎ?5'}=y҇8#ub> FM?7zfO^Lc6>.&|wkGcr DR 2xW'CN ߾>&ԡR;; Kʽ4*{UiC ; ^OT) PEB_Q2W1%',_(t,xbӋd3>OH0ҽvOGU!]&!Nqm|JSƢ.4̊.ri ii΀X ȋR/VD9M:&̘:*TUˉMDޒZ<0F?[W̰Pr:Y?P5S/7R޲4 vxqQ獱@q+HI$o(xj2+Ør+>iZnu endstream endobj 43 0 obj << /Type /Page /Parent 88 0 R /Resources 44 0 R /Contents 45 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 44 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 97 0 R /F2 96 0 R /F3 99 0 R /F4 101 0 R >> /ExtGState << /GS1 102 0 R >> >> endobj 45 0 obj << /Length 1886 /Filter /FlateDecode >> stream b J)ԧCڬ!$?(k72i.U9pSYrRx1f~HY b֘0=+ '­5ԝQo/imw\2-9a!_vϢi2zǭza؟UTtRۈUeVҪ/ K4N5NЯ9:V/]m뗪ݲ4>ēeQ{ccG!I3M=O] Kťk5y@jҧ(; f"xe+K7o0tw~ty%w q.()wG l%h썮,&Cj^ĩ'pq T@zQK( ?)]hvX:ݼSGO=d4c୨eP]zwN ^1Xٜdn,p V'Է!E5[­gab[͖j=ktvJ}66'Y $xzb@\&gFo*ٝ']X,S }!oyH^YͯtA/y 2/@i,ÌU8K !.:ӊԉPRURbA4HΧ?/jB[*xFz{8\.}ӏw$fէM4L+tT{%v3oadt\ǘJg3OV_$#r!7=|jV`>#=J`9kQ3W@8#A\"8,>Y` !w1'VGkJQ&駧{!`1^&ݚ[YohzlZyԛHWQw$rP6Ej0ɞzW}]t~B+>xA:G@lD83NnNqA[V1XC|^[al;Bf9@lwOC_")$_p UH`f5K߷\nnlJ!gSta`i-MtJb,w4`IjxApǂۅ4نD鯑>>-[<>d;0fS -v}n!5V,|䨨Hev0. uh$bV\&A`t]) *V9 ;OHKo#@R剒*hUt:aJ/#׸T=QTrǕ֧,yfg< Iop{]-F7ip3O  ?x\QG]q h%.oX{t "Es~*y'Ccyꃊ26Ƀe(i@?M|}KZHD.߽/qu?$[ݲP%M{w*^䒬hbջ-q/h.:s-I .~z6U)Zvsex鳞8y) >$bZBQ/6 ߍ-IHXTU (1?X ^O( sGC "PX5Q,7$=鴽ygԡL?x}κHk֘):=ɽWyB+G>@  \p Շ S8h }أiHVX Ț*d*؈:ʴ _>~ej/?9>҄sO[a]DliFms x|YV,Gk9ϛ3~' endstream endobj 46 0 obj << /Type /Page /Parent 88 0 R /Resources 47 0 R /Contents 48 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 47 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 97 0 R /F2 96 0 R /F3 99 0 R >> /ExtGState << /GS1 102 0 R >> >> endobj 48 0 obj << /Length 1580 /Filter /FlateDecode >> stream >h-i҄HcHq"ʗo}I_T3aqf-ԵtHǯ"fDQ>kLz'jibIJ/G^wKX?JuÔ eF"[tU1V1P ^ op5uk'15pwT N֝ZS9YK̳Wq 2l4όrN`lFZm,&^r[N8ݓSDZx/wI֨`iޚX#Пo,Xo9JY%bZKtppylWu;;~O#7+}ʦnmB9S YWS_էygd/!>?/,Y c4YKؕ*g<9*먮&y;yUw OVQ6*O뻇l+ v|YpAg=8&$"Gh`i*1v@ˌxxU$_67wԹT|y V,\b'%O\e ="H|&Z4 LQ슐h.Ү΄26}ER[lPnݩI+*L-oT+ z۽zSqhM8DA)S ?l?,:%BQ!ZxvZ5âc '$7Uj=v!5HZDArk ֝2ՌL8 1DMhvPl#~d@ǨxDLmB?iQe-+ƍFJlzB^-&S'4Yeg2%UòTZabW)J `x&@YZnow_MTO+6 6?žгyXU?/T%4+l8dvY?S YIAr9t³"ݹX)S]QG|52KhÀ̉z,yz|\ *e[ȇf[oӼ5 Bơa;[(}pmZ ] (}RvHg'nG{A#M0Of0z?Hi'~ ȵmFQ!֞/ x VX(BFgISAc YX܌%OOF_+Kc6 ը@V/g3*4$i,˪C0wjb*P¿{-u endstream endobj 49 0 obj << /Type /Page /Parent 88 0 R /Resources 50 0 R /Contents 51 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 50 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 97 0 R /F2 96 0 R /F3 99 0 R /F4 101 0 R >> /ExtGState << /GS1 102 0 R >> >> endobj 51 0 obj << /Length 2754 /Filter /FlateDecode >> stream )h 8bԚ1dǹy-:1-` zY5>Kv4]MvtѬZIqO< PxyBS3: lb?Ԉ5/J+GIi]?tYp0=ÄeMЖJW,W_SH \ڛSC^jK] ?.!46&q,,[1D&[]`0)πHtWȉ$:遼n307~#XLt}JLpdٯX@rM&jwmitús|\F{SaQ7C6-{ߴpP[*w}cBX?șpg>>H6 ]T2O_Jܮ^SG0ړ{r *:YbNS)-Qu*U8Nmju8^3;?; ̴9)>CPGi'q>α?okG9= DMl*Hۦv0Wl `D%~$7"[8:"}AЛ"KGofucF;pvh6`'Ģ _p #,r\c44E% PXgkSvm|ѼeRn=O=~ h '(8Qܨ3G GzMj6̍y$ydv-cgiOQX9T4/ikp}OƤg#9Z٪@6@&0a|Tgx[\޳Of"hF?;^cuJ[¦C]p!'XT!e/#a+9h*ډЫ@= ͓Ӏ`m&ԗ[7;C%÷.lQقRx0٣X%bfz~U@!v4"6v{ W,kPw(-V jٌc yS-" `Fg'M&ԣP޵A`(exN Ć6a}}v*svmKo=s8oG> EZ\ef:/2Oy][O-˺%S?;# 9ӓ Nـ1 r`Lh!,0K? [scgɅ'Pj@ٗX(v%[}͹㱓CKCFQ6%(}S"SP<ʠT}#|y4q3QJpT={#donGBfߧB8g->:xH´neCHiݬ;eziޔ?~xȨVAU7r"XrHePt&!74m Շmη7db{ocY Ѽ,w-JH BbqR" AZ~uأhzT44W? %',sRCTkJc5Ʋe hZ]* ^ˆ5-60<qe"8Mxy\ݴ6eax::Woxp70oAxsi".pIMm1~. g}#'j#@Y ra4C'>񩨺e DK⻢˵gtDg b).< yp)bA-:Q#\‡ݢIhnaƟ1"RCB |DNtx\1yʼg7FeqgqsHs?6/[A$$pp,ޔvޡ4iV$ AN4I}HLr6,7THbʚg%^v endstream endobj 52 0 obj << /Type /Page /Parent 88 0 R /Resources 53 0 R /Contents 54 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 53 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 97 0 R /F2 96 0 R /F3 99 0 R /F4 101 0 R >> /ExtGState << /GS1 102 0 R >> >> endobj 54 0 obj << /Length 2406 /Filter /FlateDecode >> stream `$Q 괠{!PN_/l[R +NmϞq6c*N}oEҺF[+FE=aDI)y$Y9 )с37D6roqhc%oOsOPlZ4M.5{l h٧v9Qq]ԉU2 [f2U:&hgxfcKkqbT~uPl(w =m6؈#Xqaʎ(kSa& ,!dWz!J 1,4n4ljʚrk:Cgy@C}z;.ޒ~E Y ` ͫǨH GD%j 0znSv\}>^b "OALE]~FXm^z &nttfw*Dm&Bw]FELF0 Ӵim82` /BԜNc Y *"dd j;3kY86wLzQY~:D^+]$) Z0w|9*-z֬S Qrqv"i?#ޒjR͡`LEg7ݭ5MebV3@Է9=YjLPlL |v9оaH+ 7A\%vx 4r-bfک6D#e %6=JmOt)>C<|0xHGzj'TPP=ym%1&F^XS`Odw8M_Mjc(:w6˗KN>t[g>?B`:n.(Չߗ|5/\:*c0b1y LNIYVυ@n_LȼMHl&XL/mhR[ƙd-$<ϟ YܛH}0T MoZ( /)mIġzQ- qou wGVtJ7zz2%.DX"ʸIriD͐63%'1*wHDjg~ }ّu, ⛸?o=(k ⿎ >%6iDߺ5F 2ô-E--Ư 1">?&$F+#S E-mmA<an8Va>WGG Z6M/2 _G4u&(r5pZR<<ݴ~Yo0YPQ >B`4|REUS~w0=蹷~/;k]VTj\:lx<6.Ff08-,Hj RkƎ%?r2l3L(۱5&4s.O?dl.IAx }i~Gac"R7l"jҰSo"k98"%rŽjhy}PKDK9X_ lS/ 3g`}q_P,/ e`ԧW8=?Y>J/ MC@o6_l'J0Aѩ5xXhkonOH0pr}̐vXg4 ڐ ]O{! -fI %,X6Ye0}$:H:3 %7S;5Kt"fu@YSy4]]+beKxU03tqE[t<@,q(93~Qȶ4)QQa=5(GiU@uE8|r[w |Lu5\!+yD#si'A Va+0hu_.^aJŏߋ,t WA:WyZxL2 h,f9I4oFHrۈJMюO]X ֌aZ㬵*m1?h1$n%YJ4It^D[eTNśR FATbrh^qeBقX\G5'Yy* |K|\#o:NNcP9ė6H6Y 1(PMmGT;BY;u endstream endobj 55 0 obj << /Type /Page /Parent 88 0 R /Resources 56 0 R /Contents 57 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 56 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 97 0 R /F2 96 0 R /F3 99 0 R /F4 101 0 R >> /ExtGState << /GS1 102 0 R >> >> endobj 57 0 obj << /Length 2461 /Filter /FlateDecode >> stream O#Ds h wX›С^OTRig8߹^>w2C8|Ybcha Gewfmo˜YPZxOhs 0݅[A$ 3}qE:&e L{J-&V/ fq/ I`)<5n./|K&G҂,O$~ FoadBˡx 9>K 64-` @i߁͸pzz"wAs{>v]~;*$SrPw(x HhBnL."4q;(x[LF4T$U6; vlcw:$'i-ә e ?ʄ߫RwT:s G>I Nz(*N%l>0ZP߂/k+F >kύ8QxmHD=>f[sU(SKZR+%٨'G P_V!V˃bMu%K ]kR5FW"7f| !hs[FaLoM[}@4?/{J_ :E S$G}iLS&_/ց׬:JxOര ]'9OT 2R]ޖթwSKS;׬v`Ҿ y#q/\yqq@rr)]vAQӑD1[ / b9,UY lz#Av_8(7pi.J/jK\&jF*AMmu?Bl1lzz\GRg9n^} ^[* @9dp .B0.*hn5SKh5 n$ie[Pz,(b$iIjiBK*mg׻}ͻ6cxPr ;x9)NJ'$Ր5iͦx; c\p;8gL;ֺVgbeU21ݡA@g߬y/' 9DdDꬾN_d v>F5V!˯;R-3k,gmY<tzgCai "<ծoԮT8>] zQHsMϩ"l(:)L|ϻ+'AlB  MTIOCԣ 0Ï^X#]ɛh~\b{A,7]* p82,Ҭʼ[śأئ6ՂqZhIe IeJ.q1$'/]89kf K_\w~}PoU#ޤ,ӻs$@4x'@WVa{X\R~ !2a PLIJOoڮaJu#P}Z^"GJ1~won/?rvnڬKn Ȯ!q0>&2MNNċ5[e2AP̩qb2ccs-ⵘ9?٥9:b祴I- kcEnԂ23j]\ȗB:{_> NЃE@j+| 1[>PU+fmal!>o>Lo+u-{6sVI1?\ۤ"j >&ܨr%˷k>%tiųLr:9aMgw\{ <=b1j){cP~O '9})i&u%jVrXv;f :VMgv'78J(Htp̲2 endstream endobj 58 0 obj << /Type /Page /Parent 88 0 R /Resources 59 0 R /Contents 60 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 59 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 97 0 R /F2 96 0 R /F3 99 0 R /F4 101 0 R >> /ExtGState << /GS1 102 0 R >> >> endobj 60 0 obj << /Length 2963 /Filter /FlateDecode >> stream Y5A3πY%oX6*S{LIޛfOD0Op!ۺaj @v6SֿQ]jѕ$G§,(M~(pf6ZF&Y9M[]'K_F*ڿfƯ8;˒wa/F~pp. ܁vT%8bx'v`)U ^99فK/ax|2B}+;![p@z݀v}֌7e8EX"RѦ tx3"Bk4p8`,W3iLE8ӈ)Ȣҫ,VØuHR^dҾјF)C,'n$MLkƮjo"Vx+Ү/@Wi&+uS]&u*TW3Հr㯎)G /Käu%کZE]UܧN#q:@?hZ^L\cQcH5v%GLTiVAd I,j,6D#ڦ䩖^d7hweJ+(Hac R*2(nnZp/Xt RӰ39Dg@F*Frش 9K]➃uڻ8h,ս|u3mҭ Zpj*AWanl(boCfg9ѠG H ?#9S+ DZ])*VĒ}\L%ws`2M4,jsJWՄOc%߂ t~n8QWLP x sM~fav)BeE~9"7^$gZw\D^%0eubo0yOEs}1)P-dnGnݽYqoF+qvifd #5_^Aч~KR:[ _0B05cWmiRElgzmQb( ED˅d-X-}lz![4lID-^3EʞutϰU7Dj^Y|ڃVH'2'yԄ 'ItaLN*x?cfJ3I5IZuy6x$I(,qsAGڻ$؅E8ϷP_ ǟ*BӧWӘ4픆cH%ӒU Ps)qNA5I0#H󣖋-\~߹T]+2Ip4|7XɑG V6J"vȱ^Qxa\>T[dt)xI'm0`c%?NTo%?M]I"K~!b˟=Uy/'u4+@ENsGD n0[Àܴ~(\֡b<[bT@ <fcW]"|W?5 5|4*/M/Wn2)(yiLأg{Ҏ"eUs]wKU!zK 9S"^ܣ5tݨ.p7G 4T#ː>.\T}5؛Lk6p_ezj @9f2>N̹bkFO .H"~ mi/Hi\T3R?_83s&(5̘%NcvL,a.Y{)f^!'|H @U[&FfUVܝnRZ$h`%u!G R⥲#C|.OjZD;V[eIȈBU?벉9X܉g#aսٸ_Y{̏IU&m!pw&a%^+&?G%ip?7\L&}3z%n.wXxd ڸA3 _9eolvx3tVxl.a endstream endobj 61 0 obj << /Type /Page /Parent 89 0 R /Resources 62 0 R /Contents 63 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 62 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 97 0 R /F2 96 0 R /F3 99 0 R /F4 101 0 R >> /ExtGState << /GS1 102 0 R >> >> endobj 63 0 obj << /Length 2445 /Filter /FlateDecode >> stream )Xr AGc#ۇ$z׵^LjsV6MٿB(1#8kc_uUrm}ZXMЈحi_!VYlfc$N.WrCת4Նݒkub%ᡉ]Dr̥9=id R9zM5t^'FeWg27I=zΔ̨nh1xt84.tq[|U]U#SZ¬*u5+Fu|A3j[W pF"0PT q}оL/0ƪuA _/E}r >&0D\[Kf7Wn@!1_fR)d0u bՎ\~Hw:Gjh@DQk 5uo,$Esa:jrfXk.x9`[mf'gIJMMc%Na,|#[kf6~Z;nDO 1N>6WsAP ʄ;&HZI |Bai¶~' d^ǽe%Zf PsS!raؑss2mN*VPpNx[tܙr0 [2Qpr/aS!+SagЃTAZeo\]r}r={)u-9 eI_Tɩhjۅ t. ,kLAJ |goT\KFGk TF?9Ao!GHy,a SBΘ"7DsJWeͱO4$qg͜ByEB[NJ5dk Ʒ0@lLp,ĩrK5! -_d"ٞ9{7>fJЛ WS ,: =e5 mZT1FtE+QeƩ:r@{?bjm6n&ZG\l| KKwN.&:5 kY)8gR}ŊrQk0{P\A2Ѩt endstream endobj 64 0 obj << /Type /Page /Parent 89 0 R /Resources 65 0 R /Contents 66 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 65 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 97 0 R /F2 96 0 R /F3 99 0 R /F4 101 0 R >> /ExtGState << /GS1 102 0 R >> >> endobj 66 0 obj << /Length 2302 /Filter /FlateDecode >> stream Oٯ̱I0_ф*l?T~ŷio{w,z:nM7ggmF,fσlL@\Js\L0 ҟ')N%Cp tG/fA"t2&w[Nvx~~3|{R'7:\`r{Ͳ_)JM|=m}S{^j;^2”lzQR0\~f 3hx *@]3:6A{{ duaB_ݱNedKFo4ł'2T NX&%`M$>7 ]GlSDXQj#kn-}M2 &g;ilC GmUX0~Q&jFQ}Iͬ,TldD_*8[9OO?kMpDw{mBG*V N?q*=Rsk%+]:J2"v*EKo{y%IZ63ǥ*7jrqX((0JoUObQN4Զ{hɲ{{+4HK0.?e\p>- B6n뽉;ePg~fh \Vl*@%(ғ0cVf]tNyk1K[]=|g$CZcp\3(|c!C;Ŧӿruk6Yiſ\]<<4wKkM6`qZ 5@hNXI;XEay>8eJlEzj2Ŕ܆)iS-u?+3c _R4gØ3;=z)”I#ywP[+{pN o$f0)o繑D vwwjn0RYxp8kjC5]>7 LF[Re=4WvPxpvs%jGmw9`>AaRLNAa'D&}TJ`-WC02Gzp .IȺķ~KJXyki c깏tF8@$qY p\%/e"KA=е,:yeWNmC*j|{|x.-&3v#Ė3Q\e&xt[#KYGYC+9~ |Sg]z[r :ʾ7\ Ot[ud,dҮxf :nf.Hu(Vv6YаO@e%tJ<1=Ad%֍a }-ET&Zm"yX'7r i HKl#ȞJә`Q/ѱ0I5kb#{0;W: iC݆HIhmìEj3lmvΉo+"GԔ2Tΐ>26 ~ފUߥ%hF+")ESS|~0Oզ_-]\:3)V #*5xLeK> endobj 68 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 97 0 R /F2 96 0 R /F3 99 0 R /F4 101 0 R >> /ExtGState << /GS1 102 0 R >> >> endobj 69 0 obj << /Length 1991 /Filter /FlateDecode >> stream )yr`pn&*5Zw9$2-O,YN Ը:1ܗ q̥5krzDf1w!o+3(z4P r7¦CKv9;XCGD '禶&H,_%Gxcl;Ѿv(@.`QtŲO.8/KLL]gڂJZ+XTD߸Bwq\i6@wvPtgn񌀰 )Ym8r]-)淏V4Ak7۴no֖#ȐԺS3c (Lr]rP\.a104ڃ"mDZx*,(_G^a?-CnГѺ\W"וTV+Mj XԈ$%wiHp}啬u0^a>QS˞e G~?P‚ . Xa w~-ԗ|"bN=á'&^)PckQ[SؖS[;\0:LL]ߤl^f;ePgtrՂ!0ĥ/r,*Z>PW\a Vit gт pgr- &G;}"6EĊmkGFذL8Y$k/>)F웬OalǘM<#}w}{(Jj PjAƎ`\9=G$j+`w,⿚61䉌%2W۾F}L%PxL6T[-^5[WM  !_ގU7Gd$sHÔ:lQj#IddZ !E[%Dڟ<D8ʿ-aiāuqK6Q$·kFn^Br endstream endobj 70 0 obj << /Type /Page /Parent 89 0 R /Resources 71 0 R /Contents 72 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 71 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 97 0 R /F2 96 0 R /F3 99 0 R >> /ExtGState << /GS1 102 0 R >> >> endobj 72 0 obj << /Length 2442 /Filter /FlateDecode >> stream 2/P #Y +@12 zp\d4M%8ZXTHe"MRR3s+=8Um6Ƞjaɬ;q-@ʒoWz}]@]DdA1/D Dׇ[ِ8B*aIW}(#_+j߻4&C#E'"p,d4;ݔM Ɨ6xX<ў֌@G i4K׫] ZZC̠l 8%.SO Fˑǻ(? QhM0k8(GCK-IʄuVfX%2昴z\G\ JeyD/Op: E0pZ7D< Ot|y.wvq(wRRv@jV\M1򿆨8-G1Sj{()2S9oP:?(UxWQ|_/ewf᝾ J=t"ӻrub@^ohA5IPP-|A;  onLkQ{Gξz |c*|L lm@ " fCw9p4mX'1rR\p uGu:VY| fC!,*4Pefو$ݠʑ+2ku*Mx&>7C"41Br͘t)r;wPM !.l5V7__I;@^O SIxmBD%"mj38ˀe-Q6ZkPҀ(eܤ%zS)ҟ&O),#J/v-Ru=g gVՈwdcط%*mT'SY[ED.fǑDY:QBu< At )e+dtuňƳYC^й=u.p x},!Z(`f׌:晅D/ AB9Adh(1Q XR9p(#/@휳@G6@0?}ꅞ7"v!Cۄ};Y'*'Bxr\7ew\' O8+Ԏs m@Cc)2:.@@U1^oq Ui/h|^ƕdzAT0*i 6jW+1UJ"Lvt \XCGK@xT;2!U{c/_(<D'Dz)/*quLģ3a|A} KUo\I R3j8}אKw5l|1,6?~5y WLNtK?g$a6_T!S_~A S~.{ 0apq7 z2byLrD`!SCPʨ9bIh%5FZCa/v $ac-%uYN#] y#^D K;NTCn{KJ㷝9M%zfu $ꑕ8a9^>g"XYOziAa1ݠzvx書%9`}^)݊l + J|?jQ&w z5(ajVR|ḿ]Kd1ƪn懝6dTk@q^hŝC>ݗ)#.r"fNV2.b}Ix8)AdY:ӐSZ_iiPHRE#v;D1Ġ1||E6X/glInV{%z{O=+nl&e}ħ\|cbw>9MvM0䠞lkP ^sǁ^Оfht۽US8 >)e2e2̘cf`/:Gƴcf (-f' o" o K_g nQ51`? z&x: <7Cn@@,R` NT!jøF+۰C@q!k]p'1<o*> yzk.R] ~p_GJ aHbђJ:pv2_ NF?||#p]B{ /$]GByzX2&SuڜteQ>vdW<#+rK"`.- W7՝iK> endobj 74 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 97 0 R /F2 96 0 R /F3 99 0 R >> /ExtGState << /GS1 102 0 R >> >> endobj 75 0 obj << /Length 2320 /Filter /FlateDecode >> stream \?rUSf2Q:N6tCf8s?ѢQ pz \oP/PUf[m/{L]X60W^^zϖ柈!nD3:CկmMG2PAQjZ$Ƨ cPUZ!}w꘵ ]ef-N8A$K@hwcxf0#\@Qq`sPkĝ QQz޶ώAUJ2;32̃X, =o~d?D"I_<p3{yEF{ v##@g%[bNk(VWb>/%}%K'8Tu{z4+ԩOK~D.w0rE:ˮ̘,^M\!95~\j+r8WD ?`soH02(LJ?Q33_CJW6[[bqf}bW%e8'QI#-%$AV2Ҳg?qsfľ]UFw)̹rFWo8GA>TW^/صeESYY8r?Ӆܧ;^+8n/qrs Wt3{bvH&VBD(~bU\\ 8nwoٽB`o 8 n^a \r5<,Y/(h'$nM؝_L77@jڽ+W7 XY9@ i:RM!Jk ͂rKsu#2D-%`K ?tP :~s6PB)Vݜ COwښMp<Ϧon0 Ԑe< [_LY_ծy$.ĘOn涠 C³mM112U0ٌKvwU8p"hhEsw듖A)U &9CFTuTTm@"F>d4 )yW4~\v}LlɎCWWwdʖPhg> endobj 77 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 97 0 R /F2 96 0 R /F3 99 0 R >> /ExtGState << /GS1 102 0 R >> >> endobj 78 0 obj << /Length 1761 /Filter /FlateDecode >> stream U&M*"nX.X\R'? l[ej%)vڀw ؼ:|2'v3b8&~㚵yUDD(VZ ;b-+Mxw&# B#oU7[ʰ7.;.N Icba㔐vr՗`29M\Wqa,U2^޺e6;愩ʇF.ғŐ%?fs?jBH}&xFdJPR$ŁB&iH% +n0Cxprfl|a1FJk0Eޑ_̤@]u][fHsu~QZC3*3÷gzGk/=Bzz_)қ{@ԻiZ8 =Κ\X˟&/NGTɯO>]T̆$F>#U?ŝv.É嫥m'KcS۽zǩpW#*#QKl} 0`X断WR|5X?M t[!).&]KZ+ʥѶEPgo ݥ/k$"/W"_La=k [݀6]ěl|ZEj1ȥ/ce`VvI 'p]]eJIְ%u{>-jzf .Aof:U5kPLb?@sA"&MKTTj^TMQci3iROfx; XMI%1}c`䘆6Oq>ffc2{7}J3 ,9&%.<45MDQ;ZmUN .jMAMVGs~o"eHx۰|؀B GE?=|L{ n,Gks|Ç:cqϤ*nE_MIᖬkiJ'gDt>*>Yz.xYJgI4z0w]5_ LYMY$@tq>mbKSYZr6Dx6T.}4j|)DfeCSِ1V8g [ZIgu Ҫ&`qOВuEq|a8WUSje[ǣ[p`OǦq9 '!{4#ƧN jj@4s- )<[i})FFw#Lt7&GRjm=q- endstream endobj 79 0 obj << /Type /Page /Parent 89 0 R /Resources 80 0 R /Contents 81 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 80 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 97 0 R /F2 96 0 R /F3 99 0 R >> /ExtGState << /GS1 102 0 R >> >> endobj 81 0 obj << /Length 1730 /Filter /FlateDecode >> stream F N]]޵15Wplϙ'QI3UUa,&-W<I.i)Uk7i18HF 1m€2·:&i;g>8h$#(Z^hag!:GDgu;#AXMȩ 4N-Ҥ$~C2fjOTHn"?mWd FilHܹwH~T4$~8I9U3(7 |,gAҷ,jә /W|C$U[۫ĽfmIBN=Zb[ݽB簧ds~iv,xNދk>RNÌPSͩf{hr]eU݄7%k1M|K6 ЭzN3\T}iQZW0u&t3m{+p 5M]V/wkVz>P0 ;zR/9z3{Q@4#bè3`<+I^_uY I4U+ۗ,} 7I\|%N["!K>XeBN4 |fُ7qO?ɻ-*u՗1(O0J" ! EAtuUVZ-VNbD endstream endobj 82 0 obj << /Type /Page /Parent 89 0 R /Resources 83 0 R /Contents 84 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 83 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 97 0 R /F2 96 0 R /F3 99 0 R /F4 101 0 R /F5 85 0 R >> /ExtGState << /GS1 102 0 R >> >> endobj 84 0 obj << /Length 2286 /Filter /FlateDecode >> stream {#ʌ|DGO1%@p#;zKF͐ժ|S?P84݈ "BZZV2ɂ=|aPZkLg-A_o#n}do]T>U+׸8ǃb^pm;,N_fizHB@_u*hU 973uOnW^"1-+[v eR I^HGUW^z*xyt)J3>|nTRa~i=A{) lvfb4DuaqCP^$~GtM$:8T'Y R$)LKv5ZCNE0/0|cBV6>9I:!ty/bhّ&^05o}6-d*Fr9eyTy7(8~d p!Z# 2A@Ǫ`5Vcа6_ͷhU'ӄ NJ;qUoF“38XyBںm͞9U29>2Z .x.Z5uĘQ:)N("q23)|+.hG! swcS/ᩕd5R.l{qθ|2Z<$ooD"EFyyWE-AG3H&磒98Pي2o߂7wM"w頌uXc%EJB GUsA0As .#|=:3hOqmܦ><\w "\{Zi;KMW_P{QɌ#c\pH"ǩ %:Dž(j#%Oq_#lwMC0yɬ`3ӯ)ȅbsS-Ȉ2qFA5}P^h>4.^iv7:[>"oT)WZ/M 5L]+PdwAP5>4|O[rlvhiM!s5@& s݉ {>[ ?1??לmR;h7"+Jh7]/8GNY$=8?x/鮱5Mǻȯu{ uaPڹ0 bjuVf4rceBDnuGORa.$w.4W=tɿUM`K(c: 9:[Cx~Ru!Jf\eE"A@(k&5 kJG4T PM7WOBQJ]rx7*]v.MVFm z,bksj}jNwJx{l9P"l5RΧf<_2勍fFޓȴs([`}LZҠ]Yy{$;ձpUtFL0>$ĵ{hiB#ِoL2@۸Z*i˷< P Tq#apϏ1.)=,,pDr1I|0a)d=F'2;8DiMVK7Ay'7va^0$J4>@~p$(a$`i :j;.2[b 频vIOol<~;HD5Q.Cd]\`09ڣG[z 7CzR6fPS2苠hҳ[?v Ȅ%M}n> endobj 86 0 obj << /Type /Pages /Kids [ 94 0 R 1 0 R 4 0 R 7 0 R 10 0 R 13 0 R 16 0 R 20 0 R 25 0 R 28 0 R ] /Count 10 /Parent 87 0 R >> endobj 87 0 obj << /Type /Pages /Kids [ 86 0 R 88 0 R 89 0 R ] /Count 28 >> endobj 88 0 obj << /Type /Pages /Kids [ 31 0 R 34 0 R 37 0 R 40 0 R 43 0 R 46 0 R 49 0 R 52 0 R 55 0 R 58 0 R ] /Count 10 /Parent 87 0 R >> endobj 89 0 obj << /Type /Pages /Kids [ 61 0 R 64 0 R 67 0 R 70 0 R 73 0 R 76 0 R 79 0 R 82 0 R ] /Count 8 /Parent 87 0 R >> endobj 90 0 obj << /CreationDate (f0T,uC@) /Producer (̈_9bEp4Iޣ[X^{:) /ModDate (f0T,uCIŃަ) >> endobj xref 0 91 0000000000 65535 f 0000004810 00000 n 0000004961 00000 n 0000005098 00000 n 0000007921 00000 n 0000008072 00000 n 0000008209 00000 n 0000010669 00000 n 0000010820 00000 n 0000010946 00000 n 0000013020 00000 n 0000013174 00000 n 0000013312 00000 n 0000015668 00000 n 0000015822 00000 n 0000015949 00000 n 0000018418 00000 n 0000018572 00000 n 0000018734 00000 n 0000019945 00000 n 0000024619 00000 n 0000024773 00000 n 0000024936 00000 n 0000025390 00000 n 0000062648 00000 n 0000097819 00000 n 0000097973 00000 n 0000098111 00000 n 0000101028 00000 n 0000101182 00000 n 0000101320 00000 n 0000104115 00000 n 0000104269 00000 n 0000104407 00000 n 0000106870 00000 n 0000107024 00000 n 0000107150 00000 n 0000109441 00000 n 0000109595 00000 n 0000109721 00000 n 0000111938 00000 n 0000112092 00000 n 0000112230 00000 n 0000113750 00000 n 0000113904 00000 n 0000114042 00000 n 0000116004 00000 n 0000116158 00000 n 0000116284 00000 n 0000117940 00000 n 0000118094 00000 n 0000118232 00000 n 0000121062 00000 n 0000121216 00000 n 0000121354 00000 n 0000123836 00000 n 0000123990 00000 n 0000124128 00000 n 0000126665 00000 n 0000126819 00000 n 0000126957 00000 n 0000129996 00000 n 0000130150 00000 n 0000130288 00000 n 0000132809 00000 n 0000132963 00000 n 0000133101 00000 n 0000135479 00000 n 0000135633 00000 n 0000135771 00000 n 0000137838 00000 n 0000137992 00000 n 0000138118 00000 n 0000140636 00000 n 0000140790 00000 n 0000140916 00000 n 0000143312 00000 n 0000143466 00000 n 0000143592 00000 n 0000145429 00000 n 0000145583 00000 n 0000145709 00000 n 0000147515 00000 n 0000147669 00000 n 0000147818 00000 n 0000150180 00000 n 0000150291 00000 n 0000150435 00000 n 0000150516 00000 n 0000150663 00000 n 0000150794 00000 n trailer << /Size 91 /ID[<8e8a4d93f2a6af98b8a80019086499c4><8e8a4d93f2a6af98b8a80019086499c4>] >> startxref 173 %%EOF aplus-fsf-4.22/src/html/APlusRefV2_AFrame_135.gif0000444000265000001440000001142307215453015014735 GIF87ao??,o0I8ͻ`(dihlp,tmx|pH,Ȥrl:ШtJZجvzxL.zn|N~A6zuעtȣphgw*\VJ$#!3j,H⪈C~\(S\ɲ˗:OM-f^<ϟ)c ͣY; SBzj>3*VMT$Oh[zv%eiMKZm5ܺhJͻp*X)aÐy N|62gvΝ1o+ȨoL67hϯ?.0z4栥K͛kmOid?=WLwumV~(0h-vqш$x1jba~ݧu!4F 8xPɊw]vBrhڃ5&)-$K1B?6Zzae~EBţcH*)fL>iJQ"*S͸B2։ :iOn g(Tf.ɏ*i9Q|ꤡʠ%szBJ@Ze`uڂ3ۀ*ꭿXnbЫE9e,J>RMئ KO(췷$R2F&jv(+ ނ+o,ώ{*KKdªByι RoH&Wom0~9, ,$k'4zSY kN\[%&à l*&M53e9o|t9Cp֮( [b<$i̵9YǷZ Mwj׫Z5ݢl/4uq169mpkʝUǝi{} V㋳uGn:萃n2V~鋯/ _K~ՍS:/vc!7lunݑz--)߀J\…M(IB(UA@`X@2;$5~I__+ q4Vo;a: LJrhKb t@ 3Pk\X uq{ a5 TQW {LG<HFўD&w`Bm 4G;uHR[%Y,$vaFs7‰z!(x$*V:0A";Ǯ4iR=,|I櫗%;8rm =Ё3 K=fZ1q̗t%_L3 090c 2l!zr<xOY`O9Ks:7ōeCAQ,>QMJ3̔& )RfQY@o7$0jB M>TJ\<-@>As~cR MՊT>驔k]iOEA TXJ'0laZJ%M7^4,2CѮ# HW:Kp])9/ y/Ȋ`wK+[qӷvu<+hG2`h2 b/mw^NP,6~zìE֡ZbkBK,ժ5d"6.Po[QϺ ZIqԲlޅm-[~Rm"O9k]/zw!YN}oأNwݪfۛmM-g*䥀Yjwou{ p |5㷠5[`jDxr(%NƺEr Y$>"߷3/!UwiC|2vs|`#n/-^$l4ܬ9dQRM u*,۹DO>'/&\]BB`x'V'-뱑lqoO62Chr(, œ;iNLBWgb%gJV43:U7v-zb!@hǃr{ٻ zTg04j^QuUUZV&nv^MecDzS:1>Qi~Nu x͈@.z5^!|3ڲVls;u#D܆\MWWd?jǟ X#<%F ͧ< &εT\a>thۈKG9Ȓz2%ʙ3w_8)cr*Mv-g}EɄ?('w:B:vQ_7U;/DĿb 8Gx?<]wկo&.w6%>.};c?DZВ5(֬5~E+܇jBQ6<'؏a_wԿ>k_Xh0Pyr6?>gg1G`Fo }_}hfjvzzW{ `1ceegq i"0qv cVvt=B{g/肂c+xi,h0 8fxSurSnvowho\pYmdrXV(}rHKX;ׅhS}w6AvXVa7GXEEZAI,?hgx(L\؇ϥw{_'6 EU EvVwhT:vl(XĈ/eؘvxVj\0 Wphjꄎi$y9fchn1nnGUdsh,YfU5vK7c8HMJQHuZ'萑H0&'fb|uSLT8%ǘ' 蒸:z{www|< ( 2H*@(Byy;jis#9;8V,Im3Ɖ+T~ iFT! KG%vxiX~|ɔ>ykjMk oJu՘WR7ry}yD<·ԇc9r_[tlx?Dy"<~~q+CWow")3bzYx(O te)p:f[⛿ù.{Rx˙ x36dF3({ZF;^؍oIpz^_7@gCX(a9Y{IOXp] S!vO)f=88 xxgSxjB8ibmԩ=$'ze.@>N#x9z:z/`\:Cy]ToBR+9/Z]9vtӝWh<2 ˷yc!M |ā,hC -e{&(*bZ,ʀQ .? ." Jlͷ; ˥MNZyF8jS[A,Z<(,˜.,qTպme{4+.oW˙d!Z{H߲krPQUhuWә}q=Z'+[خp{=E;sVl w)\۟ | (d|N;:d кӂF%mkj _aKb:Bt z2H񈽖*O;*W5J;hKt1+lj{暿ZFۿ +I?̚-Rܬ|)};l?n+E! N# %~k';x?|Nbce{;CXBZAWqaK|Mq{#XSW&-Œœ17y.i1j}0 \tg;hqG덁,eA2Lrr5|UgELɃc'Ȋl~ɥlʕʦ~c{ƵlXaɩܚ <8N^n~|/?O_oێR+ @} <0…(߉Z +Z1I4Aȑ$Kkn[]Ͼm+>u oo->K>O}۫6]. H`` . =a2^~6an8`~̄!T .,Q*`YNȐ2"@bи9HD> ͍0PnP鍕`\xy- AfI1 .y`[lnf|p(f΢`2w}V#&:蓇'Gfh?FX(=j]j%x7BVjm1i|\VGj\(ϥd:M2!xeݬx!;0+~z-{xkшk..I{˽ na[4V /4j: (lLA,lJ+1_co*h e\2Ga>07#5tamR mA<=28) mМQ<5|h yu:ڒچ:$mkq}o)qvw+>{#CCwv#z/nh?~L Ln'Y^y0n o((;7,SL^;,OO ^L+/ Cr/}Fg?{#>/bE/~ԗg}}Y"OnF_#+5*r{k$2kN) S&xA{$01^zAyoV#BKeBKa"y,!EbBD~CJ!A"zЈђb/+0# B`n&˜hF pD^Ӷ7ċ@<4$tE,IkQ7 1s,&FLn!a$$$8r,L_$͸QƑS~(JU0r)K=K \qmhCa%̽0E<`Yic.' a3~nt<Ny fjxs.b3˹84s,8zʯJ %bY"Œ_=6}(e ҍeo%m:GΈFj7l)d>jO4Ѵ6)1dLn=O,cpJ FtO_A3GTUORCWWU 2W V3[N@uZ^5jn+Zбt>a/XŠ,}W"䳲Q1i6\W0[lִA-[sW$Bldm[ڕsmZV_.G-.{~lis]IׯñuZ榱%Nx׼v&5drKΗV_rx7jf4Xp%ޗwkV[G3aі'&EQ7^l,[̜Bsangg5bMX+Ar[ @#4L!/S-5{woӹ>0~+VyBh:p[6R=ku ;\]7y XVT8<\;6XT]VU%8rʜ5զxxxsط0Ƴ8d:00EZi-ϫE7vydr et_ެ,ͯx_an_;iP>9Xyk{wS5<)A.9SNߌOpa{3n«?Iσ^+?XM,ӡl{)g~vU?(׽ﳉϩ>t_}$޽;3o|3淭y9zwWq~x_~r~GQx}E4EhaH'a~2/yvW} s׀<~3~*1hxxAFx*p<ăA'=Hw<5|scli8}K}(gNc9''gvt?\tu`Gb1RDžC>Qu5gi؅ӆg(h[dA$ sL3x<58pygsuWu8r׃|YzRgyEw]|!6icz4UDxGYtvC=|\ ͨDψ21H$Ԩ~ȇ('DqhFhHB8騎\n idJ&EǏr Fi@x>h XGyI()EDxfgiI~$mxt-'bGb(tNȒ9)(;C8:`$JzHc=9?Y\ƃcgLL$S&UҧsZH\ɇTؔt֕ugIiEV(ڥiuYpLH~w^y"Y$m9YG'<wIlvXyD踚$ Gl4J / Azض:6JVZFt^uwZ7@EB_JhXEqVJ:Tci(~Sd'{~礤wguzoDQ{ 5EA}g/z*E"htGD*q`q0dѨ`שgZ0b7PJtZ kjyZf1 PګDū:3ʬaJIʨZ*Bzg `b*V[׺h !Hx|Dh:FY?膰(H*aaL +0 b! Nf1c R;!+#K%k')+˲-NѱVA5YjkYg>;˳4AkS4mbFQqҮeWL[RN[K+E)[˵]_ a+cK82aik˶mo q+sKukwy{˷} +Kk˸븏 +Kk˹빟 +Kk˺뺯 ;aplus-fsf-4.22/src/html/APlusRefV2_AFrame_16.gif0000444000265000001440000002075307215453015014661 GIF87aiSooo?,iS0I8ͻ`(dihlp,tmx|pH,Ȥrl:ШtJZجvxL.zn|N~z^CdӺަ^& /*\0yj$lHE1Ǐ Cd02Fǐ(8RJ /_lIʚSbNwʟ>z(8rD4N S{v$jWLyĮA&4Z4lUpaXan 7Rz֪֢Y^KXճ($cvcQb+aB[ƨCi `7VA3-aRAp %cZBtم04 #ϭ;2ˏ,W[sSitGmwPeH&x w8I`}a =0"p'HabLn0a(4 N[<9d(ًŘ 7vER5iOx_LUdieb6R Tit}RaIyY"m.yfo(0.zBqPO{ud~9Z'>6^_ff(f2j( _͗iY[,¸ꭉAxJCPgRqv-em5[rq::Ym픯kfJBpKL8^{lK, (t[P˂6åY!ANR|W WV ̅ ѻm *M9a&K}Dȯq-_Wdcv+tc6CoI6ߦ 0I*/ n)GxJ+8r":>9H|μ98k՟|fҥީ燷wўB n^7n?v+?v{z- ~;^<;~Qgu˟eUg0=,z ZGYRzS$tlJhBP*l Zx HCP:uaC"\;"քiMЄ|t?B4k*_^=E[6VQQ48$N%Ԗh;jFyԦHS$&_䨉:yҳ@hH;:7I %È)Hk k*@q\c&o%R$x;ҁS9>jl;z8c#{M"I5A̝,z-9uZgRIɲrzN˞>iGn? Iq}BJڕf՜\9ъzT ^D?JR.#-JSpThk`JS(t?5)n)p@ PJԢHMRԦ:P-ꌦJ0V*ʺ!pu{Dj:v̌.Ϋh kZ U%7L׺Uu+^icVuX+k3+N 5mld%1]Fppq&4[Ip6hh1+b´@TkξI̬gg֊Nw;,pێWhd(Nqll.[ɓ󍢘uRޫX< xmU`XͮyW-Vz;I(0.HI/" t\,XU]/uݒqB#Uk2SAnAXKL 2%~4ŽB÷~,Bk[rKF;ѐVWCJ[Ҙδ7N{ӛv MQ֢NqjU ~:"MZָε`YPMb׀~Ce;{h~i[N׵}[uG= ]4fv }`PM̷.W =o[ ˁ!,1Zj]~(>Tobݤ@e1xt;h 73wI*[Rot<75TRNS)1ǏvU?yI+ū"+Ouwp/ S mZ)cXXo"_gp6E{xt}wk622,Ge^m4J/Kg.7L  w58]hv.0u_D r%xZ%zVO۲}gyU/8rLTg?ZA؂RX:T[W{C>]Hv[[e}gHcXjkzvg r0mMㅈ u te(hwxuG Wv}oHjvJTfVJKXVwPn?؉Z@$P#~l8?芩hM&$l>%ӊ%Q (|Ռ"]Ah7g3Hcֈ|3z;xV4}MX荂hx{q?A|± Y!+.y'SHz9HB$i$fuo;1ّH_`X_ XhG4H>3I+vrGbwݑJyEfr=c{wW fa*‚XFtc d)XLjWnjGG*QbɐwnJ&'{ٗWvxɖQדF(vR+V1Z虏y1u%{|Y92zPy})I|ɀ9)Y͉8~);Yti@ڹSQ9Yy虞깞LYX>I9YUW)YXYuɔ :XWJY ʠ( i tgW  E[jw +Z[.:'@Y'l8zBZQDZ eؕvɇgK f)jiR}sm):!b&I%q@%_L~Eh uO䗥'l`Sdɵ*B_*a:פ?eeeGNif#c2`$֩z*cgk fWXi1j+/cZdq~ijrgJ pKz&ŦAvw EffTzf gʤ2w\кggbJzH:_Zh:Zzr0i8گ go ;k{Gʰ [H";&+mݙ,:.\讛1k7OV_ɰ;g`pu6P9!8t6lLۣI׳cF6 [`N5Ɗ|6; |֩iIѱp"`+W۬A'?itRözyf6t0vUu]z0TH"Gf[UP &ʆPUIH{9PifZ( |Pi}|q{y2{[nƋhzS+k;ܻ/˜;WI(![bkFbځ93Җ)HۀJ\N2H"H a l r*Ѹ )+:Sh231dkV;{{h? ۜ,Dͤ,RJf|(ΪΈt̖xL ]υϮj\.i{0iRж8y^'^sQZ~\)z^A+U *7+?f[s0MDl@xn`# YҬFIJ}L}|PmG<{M]{Sg)λ,,zǼlbpC:wy͌r7]Cf-ӈ=)Rm"؜\ٖjפٽsUԢ}t1ΪIڋy۸ۺۼ۾d=ɣM; ȍ \]ԫZ=}mߝX-ҝ}-܄Me5N:߄]6*[4]R%0;>?J@K_Z9d"]$P df/nòڵ1>7kZr[]qf*-~hpRL- E~б/S>de Ś~JY+KQyC}\b.~Gei~ 7xSbcn=eZT^:vѪ~ZޭwFsf3~9ȴ^~*PS [<Rk^~؞N8^>-[DmJ..b*gﮍ,i -&ٶe +HKd(.8:Dy^+F./(pq҂҄鞶n§fs( ~CSL3k;u)utn({cB?=WׅMa7-B,=~mġ!ҩL"]*GFR*YFuW6XyrJ"ٳ`˪%*Z9fs˗I]{}e18a!bv1|cʘuq! ͙m΁@\λk{2Pc3=q ?ͻfXU>tku5_ =ur}g9=Pψ=T+U3H~2h |@vTWhEw шG[o9he`*s#O]Pc] ՙjFe>w&p&(]EhnLQ٧r"d.*BzءzNi?2Y(otzJܘ:ꬭВ^JUj+ k:,D6V8+mN9fv+k覫ׂ1yZ:Ǡ'=/[T[p{/oYmp,|F!|S0ep{Ul܎ rkP,%/ݼOK\|ϯ 4C;SJ\ut1O5WI (f=Zw(^]%اףr c~,wfNh79x_X+}F~Xxw/x$>p-/M981._Nު=7W y{:>(~Gw+ajٴOϼ{||ܿm:xRmxoy,>qH- w@6Oy <EQ;T2݊!F 3$'IJZ̤&7N^ (GIRL*WVƑ}%_`)ZVp^.90L (L0͌&Fyǚ.6W# ms_INU(:qr3Lp'?,5g3 lB>Jn~0D>(sKNp%Gc>4J`E+*̋*qG5UeD:>\@ H/51P%, 6)r@J+POKQ9T!LTŪVխzQCXm@ԚtN.XiSmT4h*ZR!9+^WguJ5 '~7@,7ZzPUkkO\jt+BZ 䵳-(ekSD}.wכ]PI<խ-X6e*ZWW_bˀr *l6B&7 ߥd+Z] 8aDWt@xGZޅ bz"jm6{AoH 5kf5̖;N543̲vNElxY aĆ/;oZ;^s= ǃ@cW$Bp$d 7MS!BU˚2pH`0Bm i哉mkV7gmq+58Yΐ,qO,-mp|$s< 'GOY洣T7+ԢF4/Ta]8գ\1^IU^5s;i]j;G.ҽm;~`y{OOrO;񐏼%Jn']i~,kYՔ뽃}z֟T?O=`C/µ.p~̨ǽko ^~Ċ'S8>iBT9兽}HS?H/_ ?ysZ(_xOt#!<=BGx EpMn@n3 c ?7O1 T9(g@=mO XA&B'X$.ӂ6 h,h4:CrC0PL@"O8C=p&ENt>#Ԅc(X;i?ٕ@D@Pqӄ5?88!$XOKXsX#fh9h8'P2d:ӗ Z6o8Lj(:X/4Cc~g7DDD؊kUx؋kvelxȘʸ،ΨD8XxؘD؍8Xx蘎긎؎8Xx؏9Yy ِy ;aplus-fsf-4.22/src/html/APlusRefV2_AFrame_17.gif0000444000265000001440000001024607215453015014656 GIF87at,t0I8ͻ`(dihlp,tmx|pH,Ȥrl:ШtJZجvzxL.zn|N~; MHb-߾C \Ȱ7 "/:q-R8 SFP"ɗ5L;mM-ay&84o @蹜;3QpD} ҫ+>tJ[ToS ހQlQr ەٻ!2S;@n~ƥӏ*aoߪS +w˗\̹Cck5o]vQ`mcO+.= 5I.OF{_K5`S-SK1Jp//络 zpU?5z B?m zc{Um{JSg'WR8o*- f)Ґ T2c@niCԤBwݯ{Ihy\4x'R+I$P!O5JxW*%1m` bEٽUD -v-~aH 8B`>nX TIqs+3gLuy<Nsc@0ui@(p*xf8*J ٹ9xh$!<=d2]BJ&Ԥ$@8]3S/ICeH]iu3N[WVJ 5tbf9CT|91/(/z"Qz*u3Jege56)GҥoBv^=UYIHrf-L!ӣ)3hJ(DX:dniiL+Ρxr HnrO%@26wB5YKr%\P[՛qݗ]AgЊ}| ZpUoKmX7A y[gvwa\Cg 8^%'y gGe{`e=7EzFoS8k}^TaF}:V'E<8T3DېTd-Xr Lq17|O[0熽xI}1Gs7nV j80zQH{y;udg)bťdՎ#8K1y9Z-v᷒ԺqndN~⭠>|"yt5ғ7q DV69tUTrO:^+h6~7i$oׯzw_snX|xT{*3i3|wSWc=|L@N^1}}2~GzgP~=W]zmVy}hp8̄mxB(ERD~T$Wz!kPgb7~$}$P̣uƂ#|`b2@d!gX^Ck0^PY1]X!_HgX%MgFhXQwytQ>Hm?e#/x,$4oVh(z]Qh b6*'VN7d ~Hh&4@?~E ju^(; Tr$FXhsN)GeȋآBsf=h(J$)gDk药{"iu$#wFEG_dEyodYsjdql݁W VB׎U]eG,g}\GD )02hzOw(g_wQ ~{nÌ׈ 3r: b{iy"|ȀRF|urwcCl3? O43x`!3eʈ|@ !S {Ug:S5 3HDQDD-bngf6ufKcu376xX'0sɑuY%L7֘HXh%-X8E ) 9g ɆQy͖yia rMxMׁЇVoE>iv9qiwXRVTq*Gz眄WK8riɩp)Yׁu(ŜSepȹc97ٞ9}ȞQoODWY^iKVŞٟuĄZfHT8(m *l1i L)xùC i,~pww^4anRW㢋9Z!YMWw9XN;\D9yxyYfx`(Ǎgp ơyMihM7hS+ț JrʬuZ׊ٺڭ"z芭jzɭZFخ3Z˂ ~=+;2&ƺq ZL{H_ة(yKg*(p*D ݚJ~s(Bo 24/@!Ԑ J8I9usE+?~2Ǘ!}5 JxMJz:+jy#tVHu4%W7p;rkt˵ q;+&'KՐ;SxL](MuT1˹' UwIT{yə7QV}D)v˻pPvkHkƋ=Xҫ[;q ڻ$ѽKk{Ko;[ۿ<\| <\| "<$\&|(*,.02<4\6|8:<>@  ;aplus-fsf-4.22/src/html/APlusRefV2_AFrame_171.gif0000444000265000001440000000570207215453015014740 GIF87a , ڋ޼H扦ʶ L ĢL*̦ JԪjܮ N (8HXhx)9IYiy *:JZjzZ+;P q;+[J;l` |`@=!ma] }!k_r( gą(Et˱#49R ٱY(KԔ#ro|h͜x&phQKd1SS*KOnR_XfOפ<Cl-'j6kؔ]uZĊJef6%T*2eV?>2fM 5v9!n]p$?Ϗe0k w5D,iغ*g0jVmq+\VNguV'ۻ#8Z.ؤ ~~KeaeP&/:1N$`5-8 WTOYK.`O5K) B5x#8# 3HÏ@RaߐA i$H&YBLv8)%QVXzq喾teZdZ1晸)[&xq9pfPy z9$~'+ơ(hkjj)L^覔Di8JrjtijJkkj'kÊ"l Ȳ&lb*^vmfŴڮ3&"NnnonC~ kILp$p p_qĮ!#@k< r"Lr<@{K s2|2*>,r<ΜfJ/ tNt;g\ђr2<5; ]ՈrBs>g-b7J=rkO}n=hM7N=Ȅk7|Gv:ی+g!mٓ\ye @Ԝ/^3~=zS=1z0DZ<Ƕό{j{n8އ/sƓ'܅;-ĵKFgT?7?}7s׬'䣭vT~t E^'moeC?AnL h13A2(ġ p@ُub:tp@ B4''N2;powBi>dx*m>atF(Dt6)°,&fM*8 c-qs|CHHDuA ŸUAr @ Ri^-h4$jgEсd#IHr.ٌL`|`!AQ)Q 0D+a)4rl-q UZ'B`vB[\1vd*s41Fϔ掾Lohγ/M#lOLgΟE3L$8'ƭpTg8?Oemg?tioAqЙ EC!v%/s%G? Ґ"3pg@6 :43hQ47%Lu e?j*:ը`X)MU UTIiNTv+*:VԬguf" ְk\K!Ikgu]]V5rvWb뻾2 `JXR6yX3;jb*.V#&LRrZnvUlaS ҶqI SڦE-nGXi](p\jЭr\%EYqJ]Zyͅo] /&[ڎ˾R֙-Eg:wy~![v^ :`ՅX P)lZRXaYc$wĩXrF-v|QDō%:܂bIW[ȆQ5OwC ڵ/y{rnOXM ,oy2Y55"ݱ1SS0^^Aa@| 0Hz-!*@XXW#Ca![vF&N {C5.;uȷ'6LwnDHõFir&pY͔ƌІ "tW8sO_˷wGDe"}9cD30ph˽"yl r>O|1?>AX92q!T-m`$<=. >ܿtweE~&FIǀCp[~V;6lѶQ&x]_\U&(p+q] (FrYւ8<؃S'6]Vr)GHInBxko f gUXaOfLcZrcrăiE 5nF|r5[oA|hjqh]1jT^ bZ`bbVH\:_"V}H5&GbXZuZP8(~ԋ8x|h^lꆌ˘F.㌗ҸֈHۈ2H}$騎Ȏ(Hhȏ)Ii:P;aplus-fsf-4.22/src/html/APlusRefV2_AFrame_177.gif0000444000265000001440000000632407215453015014747 GIF87a,ڋ޼H扦ʶ L ĢL*̦ JԪjܮ N (8HXhx)9IYiy *:JZjz +;K[k{ ,J8uNJ)y 9)r%)* +àH _21 M<"C+Àr.g,C̖ < М.ѐ ҽ*[8 ӕH}* V_}s/l}G{uN]s]͂؅܄- ݂݀wo㝷k{(>g,Z^*8~{[~9rh9䕃~t럛:%zn3{Nl_f;[:c3;3ϯ2@[/o_}~O~柏~꯯O߻o/)| l@BpL( |?p$K 'ʐ* wp!8Aps>WL>1TD $~o+`FN1ܓ#x4Z{, E5cH@;P|8/rc qx,_#EHJ}Ԡ!z'ywtExIelٽST}9 QL"-GNsc/ ih˜#@% 2L2i=pɄls4$˙Fpr$㯑v}R޶,n]ڑ6i]l\COn_U8}J|s/O=>oy{ێ KRZ~tW> x۾D= =߀fw_]߹ԱnD/~=/Itqci.v+XKNܑ?gozx]u9= m'zm}}|f6~}W{@ft7|^%|bC˗{hz'KnwĖyfJS~*Hw{{6؂al}x#g7guWdwdmtKit*lftXiԄPHpHkOhw,slU0ihh6~j(j^xtaHnW( AhVaOzL|V~MkDW8MZJeLL(XhmhObPHXXHY芳ahZH_]^ň¸hx`ȨȌ_Θ(^88^tE_H%bÍȎu[8LTEhȏ)Ii ɐ Niiɑ !) ؎']4 -Y =H5iW]ÈA6ɓuE=)7 @R GIKɔMO 8T%ZUiWY[ɕ]_ a)cIeigikɖmo q)sIuiwy{ɗ} )Iiɘ阏 )Iiə陟 )Iiɚ隯 )IiɛP;aplus-fsf-4.22/src/html/APlusRefV2_AFrame_18.gif0000444000265000001440000001174207215453015014661 GIF87a}=,}=0I8ͻ`(dihlp,tmx|pH,Ȥrl:ШtJZجvzxL.zn|N~[, W'ąȁҩΥȣ޴ 騽'Ġm;[nAD(ݹ7uwŎ1ħ'%\9q1U|1?67EȈc?tdQH r)RE_JYpjO\_K.gfsgʳӤM0bt+We56؆2J MuѬT\/WKduMGo=; 16emG+}w:>u_o?KqjY6T{{[xhIR~G }-sDPvU|Qeٖj4c׹fYk9s[x#8hHޑ%&Ld(OVyF`I$ZjE3h噍朂+)tYZQ񉂠Cih%`Uft(0h" w &nH%*g^~UIpݞ*]yj#.i*Nl"-PΒiqEr-(Ej?1e<&"Byn^@\08ucqx;S1f_1'Kmf%L҂ c*kj=4=j2:ʴOw|7&.D, S c(2q!5F2fy88R* E9α ` #H:Nv< =^ 9ʰ+$  1m2#15CR19FdL`,yY)dwKWR 'f[ln* 9M sD1@5әq6^F59Amӌ,IJuND YmF/mGzP$>L-&?Ũǂ`L^Q`)^I%F rLgMɑ2\`!KJ14+= mzxU@LCzT9u"RIUkZUNU4bYEV5kk;ͷ5ytb^ei׻o-l"9Mb: d'KZfa@X3[ͪ m?EFԴ cmk=ZضRxk 6BnE6+ n|U[ׂ;L$|9Kׁ%,PVR eIGɠzf7ձGZ乇PoP0fp6eވP@o~G`OsR _rT/+泐p9Pw"8T{7XmlcUdH $}_=ˆ¸~11):13z,3}L$_sdGKy-1͚e-cNX+N0s+W Rln3I=ahFXs|gy-L>tL"H44 =&7|/DGc8Ò.A:!ͿRHdr-`M b?0Ɉor٩ibz٥>vSKYm\k?2QpރRĖoq[a>Ahms׉,ۉ/mp> p|Rsu .F20ཅ8$GAcخ1>i"p”$M18ey]ܱyz+|*|9 wqq 7*ַNϕyxcd̳H\^!Y=Y[aNujoߗw&Ν!;>Dt ix"כgWēE b>໗^_vێOA ־1D;HObhrw{%Ƨ}#3ؖ-0V[W'~=}p;|F_;ɽk/볟4W1}8}wzONȗ~L` gy| v#8D7B ցF&X (S -/Q35E*:9 ;xh?XP'$8%Ttx#}‡\0)Adm]"P(`0LHVx=Yh7ą=aaVz9t 6e@4A_^Q"fiH ,wmnoaB]x%wagĢq6D(vV(vtu2=v>#"6a3d啃ky&ci-+ы1"He6TC6x8"9}C&`WEOj؄kH";؇损{u~bBXf$6#F;[⇗zX^צ^ƌ&,Mĉ~ J9hrgqxCȑZ'֢4 [hN q[J7 O9NpTD)%F9fHybmŔMeQdxa6Е^YbF {B1~#Pefe#6];bSIV_huZ/4~ZTLJx!'FtB sy1kb&ևUAi93a}T#pyɘdقXiio"}8ɚ g%$ȉc՚<9&g"a֖ ڙnT٘pmEy98kT-Hn)کqZ'e۷ `kf:g)W {* 0 e8KM!/rV`,n r-z,x:wЩF =_*xzw<|>S*ʫ2\i&(@j:~iU8+PzZ=:qZ iUD˪;Y7GjSGmi®}ve:l؍Y)C$o}հ:Vj1&V|E6I 9{ Kt$:pVl܉/+Ʋ:H7K;#K?k+˙GkʱJH_EJzP iSkdB]_"&eۭ큶Gk˨ᶗq{lfkwK@e"}K9E䵃x귈洕׸+|{#:K;k`kBF{Gۻû{;#Ƌ>ț۳<;ԛ#1[L½>`e{x8^|%XѽDV\R+3 )y3~["v5[HaFs;4EÎ qE:⠒Ÿ < e):-{6}#C,8a2*r Vc0-,1+{685l:X*)Q O/FرiqÀIJr4L?vԙ37+il'_L!v=\s58SLI_A#ŐK-c\9W*7;6gDl1h3\۷[Y772mCc;AkLf#叶`( J';̿`Ɯʼ7t{[1Ɏl.i|m,lz57oR>(4̋` LKʯl .|,*$EB0l!:,<,u"Bλ#gn#\re{Sgb*kҿ˲8\h|,ڲSr2-" EѦُ PR=T]V}XZ\ݔ@ >Pׂ®Ki ƔYҙG3)e]@JMj9%/!p?i\emI!c6#+Y>bmBuq-є 0ԜNA"-Ӎ,AQ(z$j")-֨-ƚm!- "]^,=m<Aš-,2o׍s.4\|]* <\œ]ѿ9]-]}8@"{J ڝیɎFq ɲB.-br6-)ȫ.$;fUܫZF zǿ/ =-=7՟]A0;F~HJLNPR>T^V~XZ\^`b>d^f ;aplus-fsf-4.22/src/html/APlusRefV2_AFrame_182.gif0000444000265000001440000000740107215453015014740 GIF87as,sڋ޼H扦ʶ L ĢL*̦ JԪjܮ N (8HXhx)9IYiy *:JZjz +;K[k{ A\c<&l`m! -Mrݑ>N2/Q_r5// <0…O`&x09cWΣ+f&i%;DI2C4kڼSÂ#␇@Zif(QK;24dӣJMF *5Tz}23رds$ӧ I;'b]ΥS+A՚(J' e;~<bň`k7oU'6lR/h#7E6p߆W1 k>x6 k8篾oӫ?#GNus4훾ϮFʃG;o{'rm`swD{ׁ^ FB=` ҂ f%sA)䟀 hN8LJYnXbsc98@n,(4_6 ?(ȣd"6_|eZne^vcHd(ݙ6nTiBE9?G8NCG DXԂ '#rGgiyȦcXԄTc]Η"FP> v{)}!4'b;aq+&)BhE0SWIu+6haH6OB>-k)Ky}UpV]<_htlR 3`}yk+U^ ş3~l0"x5<cmr 66tڿ*WDZv93=ôƤ5~tM&)A[/]DQKv6d],wM=D-x/^ _8HFЈy6hx蔑y-Wgz.Nc붧ޕNAdw/÷;?߁c޴_MSϴO&/fӤ[@iǼ/.Hs0^8w)L_ R2,LɊabiˉϧBuђ&j9RPF$4ֵVMfi*LrTRQP^Y$tXIDq&u BY$,iFb+ћel&CLp>sLCHŃqSj80mtQ~AdvMhZ҅9`=cH`|lN.r]]>/~^ ?Ґr]} i <Z-Q4bb5**Pq HblQDcRZTh J8v4Y& LpbJg4!WO@@ M Ȧ~}J!8h:9zy#hJ"8K4Ro ;3#Z lE0tkӋEv+妛hf8+quݹj}j.}}6&˛5̃iD[r.jN9gAmu~Yvụ.7ᇳn8lܷw]n6 d`tyw6,7Za r着`QW`ZM!EUZxp%S !2` ,Wb7">fٙxU8%D#b\~a&灙fd&f"9vzγ~j矂砆衊JS袎r裒S^Ln:fr *J}Zj͘j - BCk0J'RkZe*Ͱg걡DBJRDTmid Xy[Rjϸh{WFVf>@V0 /lԲg!6Jë͗uf*# ;KXo'5q k,i93̲>Bʹ;zt2<]t v"RFYjw@́j msWp{\p-M xV7i+}*r8n6{nRdn7o+w@٥K ;#@s[+9 #M/,`st#9?`<K?GQz9г}KX\_s[/F:[fZiSI5iW^DXF6j{H2Q;4x 4 ^4+4U}UW GfLU |1`ÌZK"0dhz Kbe##:OvY؞(-P3P@d>0Eʈ^v|g(2tcY_sEWU5C0\#A@o,Ljr~?iIP,`njKnK$!]i:XIb( )W̔X;4 S"H&db{D\1˰1|3wi?Κ4y:4m}ЙL9L %)*ҞlD #Ez7ё:eEPeӄ]BuhCGQJ2p[FQCH9:?7WZtmPi¨NԦCLFRNo9J*tlHhcS6v>fJk:ՠ>pQejV: }~ kW6_U5WMcZ[;o8ZJhAJOo;eKX†,Z6SZGcʠ x=BKS'g)Ȃ6M $;ֺ=lۿVw%cgڹueyZաu-Tۺδ:&t˘;xIQv[ݗ6VĶ*EwpÕydolKw]lRrK;WjF WVSz`O'J0Vni`X#kۛuf~5R7; rZMȌ%25YGƦWLe=ذEce<.W٢I1L]6^QxhXWZ2=Y8cg,e.K|!4su L"ڿ0Eh9\}\,iD{R~,CY:tJ6:|=jգvHT]j< kd5ۖVpD| 5`2y{VUGGb?o'fkmXv''UMY0wl/A>t䍩t&퟊p?3+ mJPӵ%ny!Ha>xȘ<<+\_zyX76rn vN!j cK SYh|nkј2^/]O$:JX.޽ahl`ow+3p_ي}֐PCDzhUAJ(RȁKAz uwh#H!X&w') xCBy-M~(+1#k=8lO|*EȃAH80x4'O-MHN2x=ӆRȄ>_Ȃ\H:d^]`j\dȆm+g Szbts}X7r{l8C臁:03҈QH؉x{bȈy(X舠xH؋;ff:Gx|v(vČT88׈(T(gcØX}lCوǍ긎dPh؎ۨF8'%.1c HuY R{ 8=s}AUY.f~qԑi4?I!?ɐY||'yD#7H059\DkDU4Iy6z8yu(#PHyJ?9)7Lɔ>YD 4@BY9eْkpeIdPQɓ2Zٖqyg1TQ>ieنv5=)T6(sia)91 1Z^əliy7WI`)rW$׏iO)Iʼnɩ4 )4D׉٩ rwSwIvŜɞ ) +Ýa !I$ vd Z % v&}2qZb e,Z@S(Vi}[:,t]pLfsޓ$G%zo2z_-;1"MZ-HZJ*&JّV%Y,죥[Mʕ0rK%%b$Fho:c*$vh" yu(uRtq#ئS"7*r%1btЦ!ѥ#j$`ک#zJp7$Tj@x:uؑ4ڨ& |/ҫڧ0lG\E?*RE̚#VH""*H*|H."}{$ZPm&JzʨtjnDEn*Gm&yKJwW]K'kP ۔-[@y3 i2kua:=@V?K!q*#{dKbNkQWR[`fR;稵Ȳs%TZ*e;PGg-5jK;l۶Kr[M{r`wyȷkTkue  D'[JZ0ո낚K|{ 3T9'pKkk㸿WXu}$<3KXKFdϻu;5 F +[I˺+X HCB"N7Ɠ[ JOyB~F?{8ۿEƃM[X, ,TK4Ċ8TTrc#GZcdC9z+&A(>d!¯8<$fk 9|CT4‚1Di%p+S̥Taⶃ+_X4C^o}pch|U戸ӱbc(1SFI1IaAۻaqx#pq\{~;%nqKȃ:r3\iٝe2OfLBo"Ek=@:N>(PVF*FN?`>d>o~SɂNb~r~cߘ {|N '{>v9^횞-^2,UN)}x>u.W8U N6ynk ? Q駷LOE0V u:S@.$SYMY3Hm ._j6(M7,H/a~I"o&Ze8}VE*[]k^/cO[ζѯhuK=Nɝ!saeGL]CGCuRԎɾu6}ӶL4vQ#GV0h1^D}63RDNr\(>Ź/OVi.(PdU,Р1~0bqzVVXHQ44]co_/Dzuױg׾?|yWxș}{k;9~}'3?~ P@ LP!P }& P 9PI,D$o)-K+s  ᥖ11"eQ#t@HŎ %-I-"B#ŭ8LLM+ 1ߜrIOLώ@MluL>Y1-6h2;v."iLjRMqɔR7KctOU*Vs1EE\+]MjQ9̣._AօbdYP-? 4[R- M_mЕS`2f,kW=uUn,\0YT36keEiݵV[mAu]w߇lپFtq^v46_%ZM2emW8-Xea-ybi^Lq5[`6x| ߩ]3mݧ ӵsnOG/3[Al[o-o[ЖjñC(\R1@o9|7i@'}Ut[鞇Ag`m*_.^@DyY_y~Ki^{Gi2|'jq_mC7_a?Ao@s& g[ں@pb}Mǂ8A5t r7&B9?0 8аTatְ7_#CDgI$ 8@$&bX*>хJ4D+nEDgtC2zGj"0RъC;€1c+QqB!E&KSaHQ$ +=[ 3hr2 ׺RJS21 + W eJ/Y<6W6j"  COE(vc%njJ3Jjr YL5|84c'Mkn#Py|Z ̼;pFg-t U0%٣|$%ttx$\Gz(=QЕB'C&SU'cSƫ) =*T8bdt1s*RRi8UqϫOŪ ,O6jM$XBY+y/"p׾bcV3XUUbowz}QdeIZ6Hج`4ٶuKhMK*!Sa̮ &a+MFP0Uo)V[]ZU|#{UY=.s]zֺEw n--;ɺVOvuٛƷz+{5T{Xuo}&`2x}hӰ` *(anXLFW6v? b-C^Fpҗk`q3qb5Dv3 wqpLLU8=Q1 @n0OL辇nVem]=Ed gА32X1!}gI:*fn;a<7Ԛ3Km4Z2:ȧ~5;jrNq͚׽lnӓnl:ѝK.=8/Y8mmݮ=_r2Ռ8Iܵ36}ma4jݞU=ngpxKj{gĿ*m:.5)nqv|g>ո s+f)ʁͣ8~ 7|0j9"N2}G?׏?4t٤ zI $G̗:_]3_Q;}^zlt}y>ynv̻ud?]wiwT<{auC5w%w1cev-Rq}%vr~9oF~F3v>"A'ҞMg!/w{=E/ދ|; ;Kԗ=`%/?3\[~?5d{o~DSw]OȮO- RϒA6 "p9=A0EpIM9yPpY]a0_jn{ pXLz00 }0ݜ֮9mĢ 1O P . p wi *  up PP P0 Q+00 0)̶3Q#ɰqQGT19[! 7QO1iq{Qcq5QHqM1GdI̿oQԤ1)qNViёױُQّ  >!U!r.o" ,R2#7o%v$$"m/l@r%NX."$Aᆴ )(|2'B(R$*br1.vV+o(#knN'9!Tb*Kj|]r &+B+/b+J$#(&„,62QҚܒ))}b..#a=H'1(&%B01'%31 03)B"-U$2dN`-2O+".%2!hr,S63#.q3$k7E(}" 38M7S8QDZs99A3P:s:5,G3;s;;;;3:s=ٳ==3>y >>3?s?k#??t@C;aplus-fsf-4.22/src/html/APlusRefV2_AFrame_199.gif0000444000265000001440000002761507215453015014761 GIF87at,tڋ޼H扦ʶ L ĢL*̦ JԪjܮ N (8HXhx)9IYiy *:JZjz:*+ ;k{k[ <˻Z|L-\,|}ܝ]ݜS n}ͼ^,>?l`Ue+m…$͝wQt xPⷌF0!Ǖ,|/@vQfrd˝<ZС(JI4F#4] 5TsתZ5֭\z 6رd˚=6ڵlۺ} Vܹtڽ7޽|Uϩ=qbTk4^ #[TYFfNt0a$zi+򖒞z6 x'^ʏD(#eֵ&w>\>^ c)W. T.?7`~3iӭ`7*1h3Ӄ xE۩zd`~wath\#bw^`}&L(1(a/lfЌF? Y(GL蚍Kc6UN]5yMd#M<#m IL]vtte&Q: )(SIGCRQRyc{鎢V*Tw ᶩN4xouԢ7?fɧ.YZ,tJbDJ bް yJNi;IԂ)Xދoo oLppY) Ç!vrZQdh!'g2[-z,ob&o|IMKE#^A_Lp.jSB}$nɏaɛR_|HjeM1#,͚`sMY'sމG۔7brݬ ] >pCu,3Ƌ=.Ibzy׸fީӖhW`Ď{Գ47j =n?^{Π>cP6@ˏ9ܺ[Oq0O+fay铴O1qv뒣1KZ}˄ccovNl&ҕ|MCA:'_FсN Ps(5nydf%t.\FZLi9;"kMT ِqMt(Țrgh-8+:{N <]$*OjJS} U1!paaYSj\hR=#UyӀOyFg% ft_9Wq{La4>T:VAn )aTLRx$jGN YV8˔U'vmlϪd>i],;Zp3:Re)QQVMEⱭenKL(>HYk*}@dժE 9;f ?ߦ9@l\|<=XuN!xoryZ6J eǰ)+5˥$iǹat?L2}UNR*ǯd+Pro,j'{;Z3Vz-p3[ ,ղ1hb;l:}+kr . bvv-4n hvM1莲GGok=qGOYlkIM$^և&8]МS[3L|b*%M"^m6/II*),-;g m,;[4nHHE鈇(]_suSώ9FS) >%pHbQ.5aY%ITIk=/mPr_vUƉV5ɥ-^2; lm9R;);OCے6œ*.kȦe)vN,g{չs'K=?e=쑦KW8\7vmx/y?tНw&CoN>yTmt|aDVk^_v+̲:Gw3Ksfw{{\P#[øOr.ۤ}|ʥa'95~S7~Wzp=|fE>rW{_q|rs5q9m$s%ҶOVq/xlwcGe~8AJhk7sքgf'8XvG8Qpg`Gf~jhyvXX7.PH.*wswoqwf1w( Gif(xcʎ6zILJH|&z'JXꕗ ٥cIex_ YYA1pIwziC{)amqvt2Dצib^zpjD0pnxq Gj(X{BFx@LR蚳 nهrDjsS hl)>Mj Ɍ):8cʙ`*LZa9x|K@ **j}HEK@ةJFJ6Թ:x"/),8m5ZzG#rJ˰ r*n9q:ylK©)Jj B9xR)";ӕ$z[H}DR6L6 ;N){c@Hs{QɊjuCɩꉧZZHڨ)x*u?f,ħ{qZ}꧀w+q˖Ϊ~nڮꬄ۸k8g (Ie۹e+jڪ.oۋFW/q4g-xM)JثgâS5GGUl{٪˲ˬHH|}LIysBykO$k9,ÐcL7\GWFGV%:Ɍ<*,5'),)Fqj׊}ɛko&8Zl54zJ7̕ ث͹!l_I Ж%+f̺j]d|Tk,RĠ)]&}L;ZYXe,|Ս],qjs&xqVz\vmwd|RȊƌ}̥hMƚaz~ɢmӄ}c|ZӊV=ˆ}j]}Amj5YXի S#rқ{7+[أ,E:gܾh܃|\.؊. X Ճ];N|Mʍk7+L?s}ۙu P* ?kʌ4jL(<N( O{ç ͼ!٣ B"cE\ZGC8Y.p^N>mH2藗杭ڦSJůG K!~jM̯.ay"hK]{}Snٲ.&In֟q.,nj>tTGNN Ztj~صPdҲ-'j7Oq9$H?>Oŝ4׎ғnbFNƍdL߯ƞ~FPikBj+KÿwOBB~MMPE:07CmM߶/%UWM1aγ~'b?oN@0aS6ւ I\T-YJA;EJH7SO{Vq\YOacECi+f?soWxy|Q wmИ紻ȧץ_M `bC8IB^bW0bAEY?2&GU A&,d2e -L;l\SMjH>(+YlUciRh置,Ɠ:ZF :lHNJ/q{SڮoyhUO3KQZN5Sic7GyQdΈO&cC S& Pen3ն<ڛoZ]֋*7t^.#{zk_:};߲~xѾ΃pOξ4?-POۉ3vh-؄0=03 R\rp?k=qȫ'/MDNq+IzjNl4oHұEY*Ŵ3/q6 ru-l/,J W\dqzp5vp~]HP^ l-Mv\:8^JahLC:lBB8RFZ#+`0{BحR&'C9;0!W ;:ݞh#цIJ|F !g\ӥXHvw%$^Mַ[.bVݝץK.Dž-KmC'[Im^[Ee5ufi@ngxGWvN֣Mf]=xڗEOBD'fo'wx؏+yaQxeonK=B]yٷ5|ZCzg78crr< e!}l:ɴh !? [AR ^j9;\jay%8fikK[a%R5|z5xZҏa_BF1p$3S팉_9HkDU)g8EO<߶JK%) B-I9};IZTL^0öJ(CŒkoIŋѼ( Br IDX dM )t.Dd943W!y?w$R c̀n~+()i(4Q*"hIM>pjj0BЋZ%O(!o-p)&nRwu(wM+5QQS%TZ:ţLᵓlSn0*4 #G1+TL/eSu;#y7vȇbB͢^2#>EWNk;C9ts0ǒ3Jν 5_+*ŶBgwuZεsZ>ғXl ў,Gb{ْ򚞭.5ݾ8,+JQ6\4ݴն!oE{PLnpOnͼuxsGftNEm`q9u08Ig< rMlz ;i y\F5%ȉ$#vIJ>z<9DwCVJe2+%O(Vayjc`uq[X-ΩdFyYTvdCy.xZWv\_[(hY}zg"Ϋi4.߆W%eݩ3ECW-iEV55 |n1+*կR0guՑ +\YOf`d)\8,5Zd,=/hb`yes`]Wp#;^*uYe=iLjJdw)˽7ۻ7qŶ&̕oLiskv]?>luvT據S2矯p|ѳ.u:`8S,evY6@sGi^vQ5bh5v!mww qVwSwxsxZ'`x/'!yO1yoAzя7Qzկwa{Ϟq{|7|/w}Oշ}o~7џ~wϟ0GI pi%LB0I L[,$e:$60P@GHpOJ< CjDL G`& }0P;ht|p (1<#)hP0Ž80Gk&`0 W0N s - wpMppq . 1qP1 1}0O-&Q4qEA:q2nH$R^q<8+Bj.Ixp% eP&B*}fqFCk>ٔQ(aqBAqQqk/dm.mF H fmdqxJC fgHeH !۰7!M 1ch'0\ВFQ~( a1nSARB$I!Zr=v)q (ݬxn&Y~ҥ1*r*R@*2+r++P'/m&P,-2o- -2 3mub.ʶ)U X,m_R԰.-1l7qZDƕh Y $3Q0E12rd04K֨rHbB36?RX+2gs#%lcnsl)*ɊS%_1]s, J+:'7&ͨ9a2cV0ϲ= :es(K=K?ۓ+n<-S戀& #Rݣ %+ХNϢ;(<{ˀyD')"?_}vQEWAad[FG.,4H?Fwt1_I,EF3G됩OJ3.44t,IDIpLDMM’mBMܔ6nB,pLO;GA?3˳2//^rIG@COа "iOWt{յSFbd._k1i 2yf9h&WvZk"nvx[7ncYi6ꔍYwX_UQ-?ב(R/rSm;;-ffS_ ֢CX% %=9l#\9/m9v}jnTe v!\5hPrras$ӊ wT7Q/8u 3sLtcYv'cwDw (_/qicȎt`7IW`MpAlb5dQDtzevaqWWgSyW_7|c{{S4wwZ3aW{S6o'uKjwLR xm57.NTLhlC򼖉2Nj`5TB Q6,n=q6i7lOo?v_|G瞝u;[CFlހi3[무emҦc/ׯᙢv+z]n,YK fGn`n0>cθW>yxXs0 ~هre]!བX w΀}V|$p(ba6hH^3 <(P[H_4$rQ`%aiԖ"%z?9&ey&i&m%Et'u3'gn'}' ? z(*(ZJ:)Zz顐j)z):*z***:+z+++ ;,{,*,:,J;-Z{-j-z-;.{.骻..;/{/+F;aplus-fsf-4.22/src/html/APlusRefV2_AFrame_201.gif0000444000265000001440000002764607215453015014745 GIF87a{,{ڋ޼H扦ʶ L ĢL*̦ JԪjܮ N (8HXhx)9IYiy *:JZJ`j +;K[ʐ 뻛;lk|\ l |+L]}Lܬl.=>^MPMl^t<`FC0ĉ+jRWТ;zƑ$K<2ʕ,[| 3̙4kڼ3Ν<{3СD=4ҥL2j5NJ*Xױh mdEe#.Fzk-7zf,*$04 dJ|0D+:ZYݵY:ۼKìzeG};HˑO99'oh啹M0bǏGf9`7M=M7uPu ]wC,C~Qאu曁u'ۂ^=!TH kMVZ5| Y}ux㚄7]\@𘘢"hbBfa~z!H!&I{f!3%Fi-y8Q[F8%)`2Nk(>!#JY6HtH6hu%ߢDv|sr7[(mj=H\MgK&&놏JkZ*!Bk Jl T.l> m%m^mnLPQ܁\*[+;ڸ)+a F+J!kn> #+Kp*:+Dz009ꮿFX_$*n)g'˜ %'%/.Kv#,s9$@:=lb3gAeJ?qϱF|"UX;k8 A^ǵXt#,lS'Kش i8wt0,3>*z_w_W5͂:癣|/-pٽb]D}v>;ڠ{*ܳ}<-&-pқI6a7xĨ˧s̽Z6je",<+~(L&?_}5O% EЊQ@DI U/U8zl`h+aXXPH=Ə ?u#4|X & a{h(tƲgMa$; ( ,$d-kU c~3IR<1A]B鍐QzGOm-Xc=Gqzʀ7JKMU%4@~K} k#$D3dEᵍlwaј>[kBx[D4oʳ!ɶ`ҩb)./i,2U!<-ш<I*>Sc.fT$p}q| Q퐣EA>2lWC@ Tˢ4;eJRb*>Ua4%(I-UMSL"(K; rp<*/GՒZdT4OSX2#GZ]jptRЈk7iwjTYȖDj9mӻ6E{.5aSh왦+\*NեjiwV&_Wf&RCt4)i3ݭݺ)^u}( V)fknDO5e'ulWwU^%6}{DiPߑ$) Uڵ̥$, xcl/m+~kXUqG^I~5XHVMkMհXs5?bPPb೘|S(D= |.!|k RU9ʐ*HZVJ5Tm!c1xeޫ7㓂;G6*X?bD37K *g1n]bA,&FdKٓΙ4daT1j1\c}UU.tAQ>7Pe`Ksq8n7e8ZηQ34%ZEH-gjFjsN:UHsU!2,FwX}rЌ:fnw}fl(L7aw|}J3%XP'{tV?V~bBwb1|9|dӍur|Hk>sY'H]u`9mUD`#IDg|2e7։P$XfWBz3XF89QdlVX$(\Eg[qfhftwV@XRҗOEy{gH(yxwȖkfoa釅)Tؕj-yJsy8'Ymigv?tt Sh IjE[vxIy6IPiKW&hT yw8>]QYv4g_1JJ!tBi n 9pکY*Xɧcywʀy)ښu9{Z(VE$>hPI/1oiZz&ʙy mX{=ӭ7gktcZ!HKtd.أV_"$J;q%9/Z;!sE1\y(i˥^kH$O ^'+J꧟zi9z ۪uq 0S,:-B+A˫9˩ik9aȻ zʌ@}XsO|Jay@˄" `dhrk嚝kti =0XjqbJ~e}M9Dh[V^H{}җhU\hڿ lb5IoAyLk%>ө4pۛJ{<*h.]X+TFf " 9)/R'Y&KK,PĬD)ihxѴzJ0,˜6{kɻ<ȩ̪i8jS,d n|ˤȉȑ3̘ڬ\,k|B(c_}¿ضjt{gPJSYEC0G)Im,ׁd틿z=>?^-Xr_ۙ__R+nL_A(?ro/ϟS/AOoo̅qSjOٻ_ڲ'ǵy>&O"L1ua, R4T5n *uޗ1< 3Z4*QZe$֟^gA~r:Mnd)&g/pn [g~('9{FIԸ2OGS Tac/P"+_c<4UOq6]svk߰oHMEο܈#[_-+t}7í\wm[Lax$#ڸuI"7,D$hU4k-}DLw.^L79B =0mL:w.P(xI|%S]\)u"YKi;쉶Ŋ~2n]wo_*ɡF4apH!kRtSlt$ Бƣ;P1,H"ֈrsAa`J KQAhv $\ɔ X@-9wRgQ UM=QCe[OVmk]jjrVMA-sVl7n97^Fnx/1K9>Y4Z&dnGdJ"we&Fe}9}>ҸәW#6~:o3:Ԕ!VZ3E WeIh2{0aö^uyO[ή혔9zLloH};\ë%mbʼnm5kttn`L 9} ~=X!WqfR$ N}8#vlHgy]`MEgwCYV9Ai}G'o8<[#N? ~m0|u[Tp;q9FRţVJBA-a,iמ/_̈́$2>$L]C?E`t7C;VU5*er}=[_ƥ=f>O]q*Ttc&,d_ʿb$_rRLAyշn9 .fR_.ecb1MuUWvj68W2\ j"&11Qk(tdXWoͲD/&NMJr&.s"3o аkw6zt!atgzݺf̽<'To%uVYMgWOt(G]!z[`ݳ<`^I/?}&?Z 9Y^gK4oo|o[ya# Q-O.RY?#ާ *1+P0NR2f%$zF6E6+C)F+0e0/{Po~";s&(Fs&ptSEInY.Q۲++k@ -) G">s G<MB3 z.֌w,?jL!# !2"0mC?k z* |h;O{6o,49AB,C5s~p?OAI4P>eJ,N Bdl*4hxMSHJ?%3UO5D**EJ2,;4@Oo7D sFET&/F12t^,o0u;/E=Ci4-Kr,PPR LOs 2%9SRZs v4OiAXM%mI(mU+gJO)Y5M%u6v q0 R/EA'(w~,%ªtsUD!qA58j61|y3sō!NWv67.4g|*GgctX>7-W#1N 04^r_7\Sk}UXgugq/E1mZel>UbX>l%\Wgp y͉Z|-hvbI],&O-(]OP$Sؐ,uTׄ.t{vGU0t uSEްX($6ei 9y0צ`}5ku0|TOiy[`+0mSASɹ+a[5&4 ;>3C^G ޶OS~'>[ ^H|{gF ]N}+rM֘ݙׁ5G9`#)ˈʝӧƯXյh5y&uqsQ|.!HYVKX{mclڬvSwYf] +}5e򱾽1]![CA$#?AcÞq>n[SrRٝ}SO@?[ٵHhl%wg_ %i8 Ɓ^[rjKC~zY㗊c^r3]-g;?0(FzArGY.TuX33L75+3:^3cv^ O]aa"c㣅 $da"&ggR(i)*S*kի,m-g.gp/.1r$0f4uu#45w8Mc70Ѵzy#z{=~~o<㼶>po_W‡'QA5 #JBIÂ(,& +-̊)O $&Μtb0"d)\`5s Ё#u2mJA.t@'ҜRX+X (̺e٨0ַr)ZD;4=_1/>s;͘(z 3ixbS{a䷓+s&h3躡GE42wnM1 }dvˈh7#Mv`7ŇC.ĘWt°7%RųSwKGc6rFM~o Xh vF",T|^gQm]ހ֟~SPdU8"!Fx7jbEPut4-*kV'iXx!0(@:J;}4eVZZ]ތ]leh0]e7^ʙw9's9!>Ae{y(RLz D*(A6)Zz))H<):*z**:+z+++ ;,{,*,:,J;-Z{-j-z-;.{.骻..;/{/// <0|0 +0 ;H;aplus-fsf-4.22/src/html/APlusRefV2_AFrame_203.gif0000444000265000001440000002231207215453015014730 GIF87ac,cڋ޼H扦ʶ L ĢL*̦ JԪjܮ N (8HXhx)9IYiy *:JZjz +;K[k{  l|lElG, 0]m-]lPݽ ͽM}>-.p^nO.?_|.{lV.)[x0e#XE}AT-Ft$;<2~*[| 3Sjڼ3Ν<{ 4СD=4ҥL"4ԩTZ5֭\K83zȊ=,ha ۹AֱK7/s~58p9q,c!OHQ e2낥56q-w:l.ݻNe6=\I?9ͮdNjr]V~5O?_3?i^i_d 8&{ͦtq=s ~`[2h^! 򗟇I#(\c}f]A6٣VGkwmcXِFxM]Nv?ưi:#aqͰ&u#G<}zV(omp*(}UNJi^iJAi~ j)6Fũꪋj '$GѥZk!Şqc F>*+%Yۀ~"PDR8Ƴ>,"| aK"S2i^AJ;^>:[VF Bbjp[xO,d-W%rɷq14.1ޜqjY6,2ctj +&5`A>JX^]6musZP[vW>V+B)nj󴐯2N kkz1 {k詗>fZ:謟LjMn;ޮW.iwni;Mw^J SH2&t+ϵ??s=}~Y<_`"іd8!Ihr2oSʚ n üF6n^WwUM4YBM<`}0WJ5p`> B)8kdKXRCijUlZ3adz1g:čHD` pf9KFiElhcU @Њnt%;"E,oL! gMZOH~\UJ9q'?jQ@=2_ -moe◺\Θ^-hwҬyMA /)L]z|29rca& Mԩ|*Q'ܙOxޅR?!0\)f?m!4_GGs&;# !5%%/, x!5@(IQNOȵ}Ԃ5%]F<rM7}zk1dG!AZB_zUN h 1wHp2} LF֋jӘL2VAbpmT{G5ԦaFAn^s5rfi3zAM Չ aŊ~N)/?Ҏ nI);.6m_\t&5b+ݮT )劀^:):wet&^sgzAX HcFpj{(\cPzv (޷H Ʒ e8jZb>(ZKxiOTWDž+3:c0/xDJˢLj7&)U9c'eMv*[aPxK-;ҕzdQy02v1 Yy2rNE( s*??g1kDІh/Wv0Yan9Մܼ\ sU-qùZU '|~d3,i׻ߝ6k/S9;lf2"ws>qd= )a@\@xV+wMMK-2)K-UIfqzO* |**H["comXң&a@n=̪5 OgKBAH"/boP-F&uzӧY0|ζ3m1+DC?hu]r.3>vl#O7GEj1sJuRygcs; jsᜯ qU _3~ կp}s};I mkK[>ev=5୬ӥ>ey+Kw?Pp=-?o׻Ο~'WsCx 1|}gjbC{fR*%elWrx^G&U0g? X!3h vU%bwrds,t{,b &ttUx炏zt3{18(J6hUghyfIw0xA5qgNx5Cx (2<zJZbFwXpud8z!XINo7CŕgQd3edžZI657DN5tT>3DEWyFЁ(zSpTt[h,o9퇂kɕ@"zGgb]Ƈ;|E|hB_zRyzep~6YHg=nX`&uwKv#ZvU 8W_ yrjLJ_"wX!ucZH>NV:HefPWxq.2\(_FUXRO"'hdt7ljHb7JOwnTZ@:Ï7)gpaGJ?WFxv(_ZԔ9%ysׄ8vggؑHB28Vu# u7(e9q8ujTM8elHy}wpai踎(}8ӌȘl)+H r9nI,҄"iF +y~B8Wx-{nO5G)hxv7c4xgQtid2ٙBɉp"@@ՓE)z6} lOBtwc@ PVd0cCjԗK≂t9A6='s)N)EQ&U Iwʖ*j:*yѕ9J(ʟ$Z)WkXn591h"oeOHG꒔&F9KLIY]HA ڎmz8amrCRsNLj{Ɉ_\Yy_xmɚ=z :!t6yl~{C('Azڊ|{ʌ:~$EXטZGyɧfJ&~d* ^RȮݮtVuL~.u6~&;>sX ꙏqcZzIԼY\Y,0WD`޺?FK,N`hV{qKχP.zKtb6ZAsSo4* 5}ٖkM:ym4]n.8Piud ڔrd~7`d~>u=/)85Hc?=.Y*͖+<z= ;SPAK8 2.,ԫŽ HVdQ*drP 4,JbrǮE-r,Tm402ML791;<9 #0Q2+MEc4Dl,AG4* SKU=N$5QqSVMrSMAՖVWUVWԱHXZdUZPFTR3X5%DcM 1Xa QQ\FBu XCRYd]tMrlwgU5e7=vLuWF1W MvD{0(u'uWŘ 쉶UxޑTeouMOކ.3?%Y"Z=ZfQЍ]"fzϨ֨骱Wk0'lMBLizni[Jw^f{?#zUn8޶ \ѻ pZqGI΋߫<g[zm^8Vyv,B he/)s N~`C$c3!M4[yR}M/^BT ̃yˠ{>= {0x_%w|AvM/**o~'?\@(w뜸0þyM?Y KU] QՆq#|>[<U@Q'5Gܥr+5S!oSm>F`cfEwdmtG91O"dzwtHAc!HE.!IIN$1IMn'AJQ4)QJUt+aKYΒ-qK]/La41Le.t3MiNմ5Mmn7Nq49љNut;OyΓ=O}?P5AP. uCi 7>BcD+Q$FTX-"FFIE2ϑtj$Q0#,=KE*S5i?vǝ&=]s".Um8*FfaRNNuRn]-&PVe}%њVɬD\[WUHtuT!*T ^ SyC [X[A+ӱyE~WIVj&K 8i+ 4<72TmN],۪[-mM6na-7ri~5*TC/zϦwEfOQm㞟:çC0{-V7l]'ݥn#^/gQtAG;҅f0?w~kBX?uijMJ$zhooL+8$ ! )j[ΌRM[e-Yu0Ϯ CَNOn.h/Ѿ6b.~j SJкp/D ; ۏGPM>jlko} _9Ga.pQX.21@O6u2JقBqA!D܌UKsi1OOàQ<&)m QP K Զ 1' 1P 5Mp +1 {nPpr HѰ+r.N4TQ W c|ЬFRq$a1e'cYQ1 q(0' *)5)s*s&)e'+,*I'%(-LR,sB*28r  ͒BR/p". Ц p/ɻ /D P1(JRno2 P3 (1p&&Q7y+F+4'O(OrJ2s^*-s.d28}+%2;:˲:.5@]3\11 #O /2NDnOVr6 7ar7IKOP&CKMPPWtC 5r4Ls8R7N#:nP5 妳LɪQUgIR3T4OU]59IUbK?U^VqJ/WyWWVolXXX5YuYYY5ZuZZZ5[u[[[5\u\ɵ\\5]u]ٵ]]5^u^^^5_u___V ;aplus-fsf-4.22/src/html/APlusRefV2_AFrame_205.gif0000444000265000001440000001772707215453016014751 GIF87au,uڋ޼H扦ʶ L ĢL*̦ JԪjܮ N (8HXhxXH96Y% p鉵)"Yj0::[Rz*z` ګJ+lb{y;Q{J 1= mn-k;~.>Z^oXk; wQk0bB Al͠b -]ucƕ%[7[9[>{ s-XBП#t|IKͧJ5g5B֫\z!رd˚=6ڵlۺ} 7ܹt a7޽| 8G >8~2~ 9Ɂk4ʜ;{ z+˘jFtRv)A|XsMmsڍwRp C'7|s%|3k. +^dIÔRd2C0x9 6@ %x '`0xw`_F#Ѵ~GP *|*FY2*OMxOjDRr`2HgB(iX&(Bx5fwB&z㝙y!A{銪c#zo5,ЈlŠGmn~ nZ&n枋.Zneٲ1{KoKBJAB;, ŠN9V'0|!Em7BUfNJޡp h,g=\ N/̩6 s$򑮕[1z9JʩCu%׵RS vmQM߫rWGĀ7[o<_ZIݠ_V.ۃ(b0ظw\7{Ku+ar8e?.ld4gK31c;8i8 ъu;WE\g6{bx/?iu.HxWڮiOןݙNd^ |K ]}0ƿsAs74A.~4^RG|b3>孄"< @?'{8؛w& +2:~R%f]@5oW< :8e1!cU4n[h ZLa#8 1nf,Nj,43RẻY,rǡ/GX @I= l"pR6lP7KA)Er Z UCEk"/)> &)yYИҗ/ n1S$ Oűjr氮I/қ(y=:QP֙CtSd;Y n#{6WCٯ>ʵ(bҹ,gCċ8G1*_E g=y3+ͱQ#0D 7᨟eͧHcԲm3c5¦Ք;~ :gg}V=EФvלPHک@*VYM]}yFU֖uio3a- F预%c6׹ H4ϫg7.!9P;yE2E'nRZ=؍YQ_,.2F52=rd9;gV|(%ZOl>WB!z'ھ.s.ܭͷJ4B7RhQ[ŜHOrhfje̕(5ZTqL &/6=.), TKFVtiHn="M"m&̇>֜3 ױ±E}~_UC_<䟄0uLrx,o~[ޖw8A9Ic];Z2?j{e>v1'*]5*:ʧA ?*[ALqYBNة`i#|h{j׭&7uFmAܝ__)ZL,pd5Z3Y"슝wU<SF=D}ϫVMT1.|6dzuz.%_ĥ-soۅ.VOgǻy^]79V"ڂyeAZOO/+A꿼D<=EAinhwq'TPv A[skĀsoO#~{u{ttNwN8C[jO^EE]sUfXUvЖt_ tۅZtdGsxG@HTPCsO=dauNwwW8r_"SJgփ}/WXw:wlctq:swmmU8%xk|6FcTUwoHzrG:JvmÇ5`;4@|G dnAvt+%<3&g֦?DCN2*Q^t7S6cxB7bUGi8j}}1VcfJDf9DAAo*L߅qWz6X* dVuQՉWHA2|#zԍAx=8loZr4DH;E{kpWx@XGSC[kvm*867rٓy,Q gEy"HnlSiuh6RxGkhz&`8EU*ǗUY\1gl@YpYPLHTuO{d8GWÈu67Hwa( 6'gxBlDQe%uY3~xHtm't7g㴗9uYLeYynZ<#eҖ樈Ճpl-ՌY>X!W7z ADv?Q5G#sgY}Djq))3 2XWIYqpڰu=݅LZAje86fj*lztvIz,J%OuK:\Ǚ<$jt( oT\eꀛ:YEZehAڧ5G:}E} p|%fU~J=JSZhh3BwZ'wmvkٶ(f"Y5=ʠԨ~0?ji AieS Z w$61d|ڰI$ٮD c8jʗڼ曾)/ {!׽kʭ[ +zL 3+hi7^!@C/#iK@K{FkU4Ri&(P*C+UsB >12˅Y E;)iwۧ˿fg܋Mw;n\knL)@?ˡWnH8WFݧ==kˈfI6lṵIF6ƉZ:}g~6[k9DAܳh*.*;/+ }#ͳWՀ8vM*†׋$qY 78tISͿمQ.prKt?][䭚A>:zd[ֱyh}H$ϼQ0\1u+#b 񀪬Cuc蟄VЌ㼽Ƈ{S띬RoNhQ&٭ʇG2.qoG<qν~Mnh}^Ώmv[`c P~nxƑ{aݢͧDJ|h֍-X>.+V}*ӀN ߙNn[ݙN6a Q7ShYqnj xH)}ʕ6~ݚjm~  qs^8ϑv^^fuXY.TZ$J`SNDϮ[c_rV$jl( &buo:|sɍ3\o[\d5/څ-΂wr> k*m$ºK_l+Fn )9}[SyO}/II$"VL2x} pFNj+0Oj2_ ܼĖ' Of˶C^PevG1uaV@ЖwPO$Z^ ~aivq9;3ye#M #% '-/13-!5?*AGIK9SQIJcƻ$24(,REIuo"s3̲F&_tPB@_Ma MTic6jݓm1RVq-\mM'V}W( n^'W_w]t vg NxzTxKgE`BÌf'_IV㐑xCx!M&êT RUo hi odYa%=Tj+3Қ:2kW+ƒR\{7O/lG0EUheVF;`1^Njni CK@Oc,p3jO{hN܎1d2Wf7͆g䔗8aӜITgv2<)zF#%wK*X2?l:CMEV:FG6A>ɥ N*I3SnZȔ h?%nBQ%""i&5e#2TXn4i8Z$=<^5]Pc"!eOCZTŠLRh"nRlk]ks+uS|Z:Q4U*P㨻 nR*f,U~S)X\րSG 3YpG8iZӬg3W; kbGmq .Ɩ?k}[Qv~TpJܩ.1\G!;E6qw]֞e~ݩT5&mqŻ i_O "ae|{ '\RP bG҅8 M LGOlx+\Q*mdHMF{3r8Y lܗ4gnς;Op%>W?jj`+?:aF*4=@BKepp.{Τ,{9T:uA!=/(=6e!]M=+Wp-ModZ୳bEəR3 3`UقuT [ؠ)4/<ÚރZ+Duq>>4Q dS7C# K+cTYZtG8n(R8hG'x)9IGY)8J9 jiz ZZ[z L Kj̜,i[-l;+|M{)=~>.n= ߞj+dw޾ g8Myh;z2ȑ$5F;2ʕ,[| 3̙4kڼ3Ν<{ 䎠D=4ҥL:m:ԩTZ5V:ԕ 6WcÚ='^hۺMP۷tƅ3ޯw]7_ rp `mviae,O(tfAjgIL%C5cO̪yW1l,m!;EyQ7p.9= t"4U鳇^=7s;1/ f姞mVm (рAWާ R%X%kZh1 uV z'4t#v%V%z'!ky ڵ< "o*8]Fňg6S^&)/9Ds&Amh(}\)[nx,~ٕA{m )oIdݠi]i"r6W餪s[ kJk@Eekkf5FplZF,iW@{l p- ݖg~ֆ-ώ÷JzOѲ;/VцENbb0z]~b/!ذ á\ $_xiiBrru1.#fOo+ $Y-/-LTc=} %p6>މ tXoPXuaG8%m0DQ9G Zvo"%kP<3z *N\|pc2id8f]lm[t77p˅[ s͵_<1E mcTĊ'iz=,s++|;lwTĞ˕R n[ڸٱ^33/6ԡ]qZ#9FV߷fvʤ٤DZIfRRA&=d 7I<%qB)I0a5<#8G}t{]k:ZVL .i‘O! ZpcՄ!L0yژ6yNSgZG3eB+tVEynE_%Ԡa {^E/Ѡ*G?эt$-Iєt,mK_ Әt4MoӜtsQ)"RٸL1&'}p[xeݤmb\ϞO KteuI.tHBL4ufjgKcs$q?‡yTy1OGǁpEG84g-(s U+0828Pr+/7ǃ=GQ$Tt?hG41sIȄMȄBQ(SHUhWY[ȅ]_a(cHehgikȆmoq(sHuhwy{ȇ}(HhS%8ZL5*UY|a3%\$Zʼn*B.Y gGh\Nȋ(7=hǘrۣ ttkA*Ѩt3"#z&1J|C(hMth Ȋ~(TawohIxrs|GY%wcT "dhx(BeV@we"6 ~tmk~H)yj$^xulV{y5Iz\W4)*S8鑘n|35ba2Y4K9m)nv&qJt2k& ^jRq\ |B@e76z^3,DՔ3y^)X7З~YH؈ UIQ{y/tydÎD@Ǚ!F(s"wmCJ.)ކbAzRGkzYxi0Ixd4'U/(mJ|ٚgf 6fhk)HQIzvgkCx;i`@s;IMJ钋+8KwIqD;'nԷ2)udEfhy ؜I)B/DX3$Zm|s2ڙc& Jyiy D:YAJrSZR * ¹≥5 i::68z ʤxIGZ(_zaj.7ڥ9 `ڣzpF皖qj~[Gاuia"5d$Nt:⥵QjZT0Oٖpʉ6AAiFj kvl:eeu}M֡fwt|Z hH3 jʶZj-ړz0JʩjB::,u7CäU Xvuf*Jh) kAPOVS'ڧmʱ˚:;x~ʦ4۳-ٸvgG}|7۰4c橩7j +5ɒY s٨w?G"h%OO $ CƢ>ۯc;gXײhˬ汀7Y ;-JKV@۶ʵc}Ɖ*Ki[. ݹ*kxi(ogrU;CD꧷`ٝekN0;,;kFl{kUkW l%+sPjP$ Rr+[k˽2:kX t*9 ̳{ SU-zlz#}Dڋ,|N19&|e l_)j,p-LLΖ= ̬\KM̞ԇou,8"<,}۸رja~Fix ܛ, 7ZךE[*iF=^B׸s!TL3ƭ dXt$Gt)]L-4!lMݭz;n{LElk ߖ{ߡJ4*ZkMM ^Mܦ 4ןڅzڜ]g=RS׶`=NQ]+'f~i*nؘH LFP~یU.%֢m]N{πi*ɭ4CjNݑ~$=Mf׫;1砋ÙZ^2ZNc5h]a+؄nr-W3w-b3Zr>~Vf<>![h>7^(Ʀ G+ BEF菕n*1&7F͝[r1tvhi߬gE-⵪k_ `oP ʾ.Ugz+D,)黁s7l|0IZD M]vF~<Kqȴq 30פ*,)3%ltn5/O1o+? k81tz_oܯ[?#I_NoOּ/O1ua xePD$,U}a6 uRx bk){g=UIvIc_XF\ ΌvےsXa:ɰR| pB( 6"w01H]P-WL:%joqaQR/-fhL{OkF)|mUG8=ߦwt[7 QEEi'Kߟ Ǖ xK8 <9NIM鶱J!|BkʆARBa%q`o% q%J N aW6WMI>0OEiSOF%jUQ]j5V_UlYgUvʞG/"HPˠu=s%܎zRk࿆%p]7 e:J>NW5s?~n92߷6Isjî^0L֍EO33KɝT89i'MT32qk[v!u>x*_Sp8-xk/yb>i"Ǟ{O:t\>vc$Nq('H .0OKLP@npȰS~ /!QZ"40l¢ð1`PHR@ZAD'6'qE;-6 Ӡ7NASC/@t?DP$Mت4-K1% S44SK;TԲBԶGQjc"53֡R cntW._Y5\iu'@+UeqMbs1Fe6Zk hXjŶ[qv42@/"ݫV^yuM"v%d 6FbQѦn`a܆٨"t!"s<8\ (RȎrɝn͍ 1Ԩ90{ZOd;eGVHT{$7!"+=2Er#;?ЧJ$c)U7x9Ty#eIo9 k A+(_ɲrꕪ b˪E=KQMZ>}5c$aOGԦ9cZgjJ;qS}-j;4zYw( {$He{;;X=^>b~V%Qg.nNR\bF[!)t=cʘ2NiWg$ZVL. j-ZSsjm[nvQF: d[hաL5l)k+;n5we}q4l ~y,][3>9-p':۔RƓ<.XM>UvYWyͰd*+7nήk.D[.ִ_qnlL҂gq|XN93żM~.?gk.z̕64iAоO3tս( yh: v#uNej-M-+̪j+>˺[QW/m%]ғF=ÆNtSo?P$X_w>* .5g`_yg_3xm#zEs\gޜ}J~|+¿T0ٰWzϏe+V>Ҥô,g -DG%[S!]RqoGp[>[i5aIҼsnA3zVv^?tϭu2s:wFH8)t=쾭w;B6R;%~fVDXj%ZN^=~PFCЬV[M#G=5cn}mU끇)MDx辽w쁯3F>ٺs^\{pëj$Z(ʥ'HPhdp4/l0 koK톈.ndԺn1،PTTT:PNZv/&Pj0&N}.*0OL<f0涎PNHO ]OaƤ`- .t^m~&o %_b JȋG ~/!g Kx8L :ոMpޯQժo7qOF k P `P)scU/ˏ2'L@D,6(JDt/2]l*OE 30̪=0qnOaS %" #?ku ǐO Y:$7 C K $KO o#'Q&0\a0y 䒃mnYɮx1x̏,QG1xӜ2 ,*Hc~or%ć'--IL:|tD ͮ(QƫL>>9=s???4@t@ @ @4AtAAA!4B%tB)B-B14C5tC9C=CA4DEtDIDMDQ4EUtEYE]Ea4FetFiFmFq4GutGyG}G4HtHHH4ItIII4JtJJJ4KtKKK4LtLɴLLi&M4:M4VdMNY+-ÍN4K҅#+`P ƪE`P!\ UQ@ 9t*+)Ib?T5ȡ2uSe UGL35^NQmPT^VcPluJNzXYYR䠵ZA3[u[U#[5\u\O\5]uvZ~]u^OA^5D+)1R'# 8!)PNE`):RMa 84xu%D1HVac.{se3K.VsJ);ɪTbbx:>.H/ĬN6IZa.VCl_sX5MbV0iT[VrQlcֶ}MC4~l͋e^ϭ_~gбgöev nsPT4aIѯo¶kS!I51gaAgOjIcevN[ou5wG!׵w}w[wxxSx7ywy=+ps =9v8˓vw$t3&Q{\wZWzJW9{I~wR.9 (}4'EbXcŠv7)k3z3S bnP9P= |re Ql^nw+H 2~qpqׅrD@j3s<~t8/Pssw; r x?n` VLr/cy7z:pبԷVzC+0жWWsTSO3=E]m{xP| kDw:7%/{t'X܇y=}u<'};^ܩ3kbO ynG<݇;*CF󕤛[^p>;3Skn]'k֌)Gm W.iSe^r5cG>1g?7^_#^g[Y<c|OS^Cs_{?ߍXq_~?~~A |Qן? Z ?.Q?)֑'VcR%v(M5se<.W ƣ\>bד䘚)V]-tRc{Ӊ0=JKVT!a#L#ΚԌaO٥(͏X (dk,1S)Fph.X*oO/dqt2qezMs9 kR}v_z&O^ "&SiرcD?#YQC'Ӥ4R嬉d%49pŧ.-j(ҤJ[)TMR:*֬Pwi5ʵ+XWÒ-k2y%Vۛ@%ĝD̑BtkǿCSNoM%*1Ɓ _ɡDay0KͣO3Cu҉Y(y5e Y~2-v@ z2Ja{|s(> q w9{_&:ys=7}Wz@ %h'^抄T oS`A&ȌxI+|,ڋŀMWc:B%"%8¸؏䄜(neφtKrd\ ِBM7υiBC>I1UȞbsvwv&QVg~ufF[٧Qc1hf娤JwW2J.]6( zq>gt]zװz㩳Y+)뫹ꪯ;K!GmKaW*2h9[!r{f kt߼|$kI>12y%z+.o9,[nLH!r7.x_orVfz$/`k2̶9\:v 鐫dqZXGuUw+䙷έ~JP&z~G{K=;=G+>e>;ۓ~K.Λ:? / WkyمIL{2T2*{Q 7PFwqc=/G mi q0(42l >y[n3?PØWգk4!g /ZP(D;KO'q!4;~YahF5BDWӈ6тm3QjVC$pcrcStǗ15 RPG0d[t n yo|iԟD*YJ~כ ɛ2 圤<~>/mLo[)iL(sœMjI1oLc/iJSZU~SteayJ5RgHxfOrfZitŝ d|sT:/QiTD„D3bR +5:R&@!7EFicٿ%ikOIɐB@zTQJL-LK#1!P #eу"oFUVulZ40<.DiUV%$V0*Ej \W盥N%OkƦnaٚvy' 5-kH]6XΔoH x͔qj 0%ʙ3.ZG[?mYV-z,RT4FT$/wa+_W:a|܋^L}!8:Q,,ɸ*V]4=G\[PN,hf ի=0;ƖЉ!.Qgx^YyGTEX #D/u9X"yW@C\#T6m O^-^C mbQ9j=&SL&1 \f t莤^mrZ F otߋ΃7n}CMwJV-s,R.nU;ֿu.\2*귵1ƵKt=w4V_oW6v?M@vkT:u6v;dAwb_ts X Џ&&|o(-m>-姊F-s FY]#CyEE*#%j$UvS5Дn3>>'ncf++g` aX\eg>ӝgw8y_6p+P8̗C:pc1٥nDcu~[fwz~ALض)x-pwyadBj֖}wxːOMi=<=kG$|QomێǻuP1/^ol}N^>ܦǟI`F%l|_XoWgQa,YRΘ ;++4Iw4! W}Uܛy1[d!^əGN ܅ Lfp[ iUFR]]_1qч٠:I] *ZI =MVG[ ѝ] `E1U_9㹞>^Ş]m!lnJZ2S U\)"f[~" #Z !$*ibT"9#.be)^)(FMԁᖤUFݝ$906NhUbHN1.yH>t|-A# " #$Ee vcAZ1U`8T x8±cOӔmQ!nbى}aEa ?\YLqIc12@BV!!"* \#mA dt[QHHNOM"!v!'_(`bQf,Jb$N'+**).+ʘ PiW&E X~%rP6%QbrO>e"DA0c%?%e\e_bb eQVecH\$VU- _^c,FRv1K^aD.[eP)kl9e46\F~#Mlz#$Z. G![YA UI S#?e.B9!-]Ѥf ps wfJڙ$\md5 Ɲ&-'fZgJc:!'r>y&N⋠P[ݥJ]MT^[=&b(f&bZeeddnYɭheXZY(1 :(2!() )&^6>)~N)V^)fn)ev~)))))Ʃ)֩)橞))**&.*6>*FN*V^*fn*vj;aplus-fsf-4.22/src/html/APlusRefV2_AFrame_210.gif0000444000265000001440000002236007215453016014732 GIF87au,uڋ޼H扦ʶ L ĢL*̦ JԪjܮ N (8HXhx)9@c JZi: zz9jj{Z k+ۋk| ;L\̌YwU{Z^h]fxq٭h'̙FniEM iG- ritҲN12hyw峇c'V"3*!Vak!^nl 芄=c aP ~"W|ӟw8ψ-"hu r{4]T |ʡ&@ݎ } w.ѰxA(bHw8Y%5yXd}=RYg%n?hZ@lww$$jG`?B%L2aܩ~e)tY}بCy̗r EkފkʫPD lKlQK\j֩ 1 RV Z ^<۶ݾC7ʩK}[Kj;nm,p;,V4ǿ*\f^m~ {kbmܴ6d.g0y- 2" ݴs =/U-oB⺟gs%S=1GsSq3lo%h6tO\5*8%Ej=^c'c@ Wn u YΜiFJaJ iv-sK8|Ʀr 9q~'9f>x24~/_tɟ[/V >_,Fvl~H}+AoY;C=ʟOlrGY}S`4^~R>H R; i8(*wlh?i0Z+L˧ރY+0*lD,xmXMLB [O& v ] ³INHҷCPyBV,UHu=`Ib g6b(uȸ8ŏxk9}1R"q-m7tnԸHQ;S#6}YDUQc7!~-!DMVbD Qt%YΑcd)/)HTD{ 6x3%n&v2K㺈˷nј 0ml@W~SciDa`;OA! c3 ZNbIPDf@&pgZ #|ПkGy, 0Oba-i: XST))?qSlv*aN)G4MKI7t\di.\Ȉ!Y L?JfvKy vX ۺiM@Z:ÅՓMMgÜi^ZT-G f,JюrŤ:pn݄eA$W#r휓kvGȂLlXѾՑc)'L$5Ȳ.9Sqx͋ܭS;0AU\9ᴘMV&bFk-/)9?5_;}U@ /DݥL@p1CI$^ɃHQq3I(YgDiCP y It)hCR ⹞zI =ي@9 :X "$YwB)bǒ+zs *pJoM6kavى|5ȊL y]::if5uDy; xF uWR|kzX)|ŶvW\5j2R&&yp*y]emٗj?iFv':(ڦ Өf%PwxDIe ]u{ÈzǛAi~B:3g6&!\J<6x卶 5G [ؙ<13ʢ٠ "$I(Y>7Q91b P) >z+)uBJ8'z~,[iƀψ74x5mG7\o귚|+y+{|C#%Zƚr,^wqHklnkOʙԲʦlwԐ0+}FY[m,G8]\e^^Pls\ڈG  L!M[ ]!v11ݽR݃"qꜯ>Mjʬ ܝmNQܽտm=·?1ȳ -m my-ޡTثLu'.ܝZI;jyh,ҷ==jJDUVˤvk! n߳_n`ܰ ͼ-' hIMݰ^߭܅{)}~ؾ-]=.>N>H^Ո4CdV>P y# T4μ ?mJ(lJ׋޵t&0gyު&jn©D.Cƕ7:E?UU-9oQ 2V o\i-l!q$r^cGE/0M?rXOaS˂9>6֤ o/mvRd$zl5U꙾d,5Ύ+~kQ륏 m3ѝ. ~.A)(o M ^^ߤc>/ ?^oϳ__ގ!ĆOp0aV{}sP?i랎\51_J#ر!ڎhQIe21\>3>ED@GF #Fy [tivISC> *6~:<1+͸MWaeghhV%nccBzv3ZfSf\|{gw5?/_oތǗ#)G%G7K=y!Iqn~B!̗=F5PɑHcA2*3+RR\/ p&nYb;ig MMhP~1^d㠇?-ݞ伩rzFSg9e@ߜw[%_uW 3P.>"n1X4 I ^VGA8JCK(pro w`lH+‡d KHD fHArѴ$pFn ȢHC|MDeLC'I5屒B:jLz60tS2*;- rl9bQLNl V ) A9%iS ѱx5VwtLa괤J]+q} ZcWlTY"-K_svXOLo2 qܼ=WlvߍWŪ)ڡZD, )qWLGE-gjܛm~ nMĄQE9u>(9ټ1UAN<\V0ji>^L ǽ;Tf7YWGFCU7v-kv.yr-wMj@3a&{ }+6yo75PlzAl֗'ȔߖQ_g;j0u.[p3i` gS5*Fb Ekǖjpiʼ.pxIW a qH*σN#B p&#2}$"8x$F?}0ȃEjqQ-4 ]&#c$ ,_䇿.LAȌ?ڱz̓H#",@lY߈@l_[K1\\$D?M}^dAr8i*Ʋ FQ:^0'w$eݮiy왢>%Iw^nYf pj[BiI͗&foZ Y(Luis;'(!KFb=o&xSۙqI\ȕ:F]/)']PKE/HSrhyGmNi7%'Q"|[Z :V5:&Ԝ ɭrI YiY#d H 16Y {Hjgj,aW8V5&W=bBCs\ Ӯ5.{_yJ5XuX.rYNe1BdgAZҵ5iQZծuka[Ζmq[o\5q\.us]Nյu]nw^񎗼5yћ^u{_Η}_`6`/ v!a O1a oAb(Ub-v1k* 7kuPfNSS (%װm@yazdoXUPdMu㱒 ( AwrǷ(Gef¤Xe") )|e3re"$r[ah&эv!iIO1iMoJAjQԣtQjU1laMĚzuq}A8(5R/:U׶ 6ȿ][͚(A0fC̯b!H߶ o#<wMoJd [>.nz7P5N2lYd&x'\޼j jLuu!pӜyJ;Ɲ?jxLٚ5Z|Qp6GEc yt"w˹ƻ\#vY'©'(a¹&MjH\*U^m^PR#6:9yjfEQ/) l\`oIJj A{AQu/' FmJّ9ݹ)OoEw6?kƗu8>zEq\yޱZV}O{m|/(V-uzJ>Mh/aS˪b{k*j?␉O&6`~oR$hl vPǎ4CB kd*Ib8e/ P־ns`H8)AUǙ tLrhXR$O~֡#Q%E}~pnNNFetz0l䒐L0/j)P|02Sk }0i PH.**jd @oXnq{60 1V0p)r*FvJ{I P*Hhnk ;S# rGG<39;H> ( >m`As3p*nR) 6i",t.7= Az&uAEy%>42p" ?s(%n2tH 1iwzIi}9n9z зQ'``&8^1HT% e`8ghxuG@E hhU^癊 #:B}͘8-fc2Ghh:S#% Kj YM^$1@^yxiiΒ"ؤ1D$EP"E( ) :\&fakfeRi!Ui"ji"'*^Z ;YKZNF(V}%ZSabQ':z @u'A,g"*[+&NQV-^jۗVȫ+>Km>kf{ߖnu8,l+ i/^;o'k뾹nw*H". p/ iNo /J2By>07|s퐽_ܳaH']4]f6MV1IO]\z*$aSr&\Dž4"7`K#.cm|(G 5O^ٕ߭'o{"N> B>v7 hy&"+t_Gvp+7)zLZǿ&7oUC?%=rӨ}8f.^ֳix/>i_JVE F jJqȕz GH(,P W0d!Y@O1̡wfH(a çmYmVFWLBPˎ32=M,SFFd= ШNWVu&B.Mk  !-+IX醡Qǵ׉2kl C46c-Ć;oRҖL"bGpڲ>dm m7q}،;Q7l#}.-]t0NVwW<_9ئm$9lNӔnH.`>5[!:r]gWbn7V9wm[].1; tjzV7'veoSrznӧۻNeSsåDwUmgZԲkW=N>ͯO{?_[AOC3Od?ʛO[< } (BKր8X WD"hv!8('.(+(84X6B䷃<؃>@B8DXFxHJL؄NPR8TXVxXZ\؅^`b8dXfxhjl؆npr8tXvxxz|؇~8Xx؈e;aplus-fsf-4.22/src/html/APlusRefV2_AFrame_38.gif0000444000265000001440000001524007215453016014661 GIF87avooo,v0I8ͻ`(dihlp,tmx|pH,Ȥrl:ШtJZجvzxL.znހ3#͇zm6|->{BsAt{$vq2'8%D"5yw rʱͪ}̄nqn~}wƚzٗM;vP+cM녭c 3"gBRDruȑF^xɐh}Dn+0o:2gz6}n$Ӟ’\˹O#I1^l[B~r]ܦRK?Y4Rt&M_ }Jt-9B@*#TKJTDdEhV[eb<)6_Ul9䢓@\i(g#qBL1+,W%ݹu w! nW4+˴x뿳U~MgQ㲮%=Ee?=ߩN@|.[%!0Mh]y愃zbe:H2+"Qآ33r$#)7S 9EJCXEk 1yi@ɂ$R$V(pJd٤萉bvdkov٦qC_i~noXj(>(-.6>e1ZfPjppJjBqꙫnI몹*'ګ8쨖Kl*˲F f)nnk覫Kn+k,Kù#pG,BLgZ1 P@Cݲ \2Yۦ,˵,s'CP ?{D\3F3t KsI\MP]sfq!^^GԛNqu g+*CY)Mץ37p6)(?t}EԑdU^dhXgh!YO9wZS^{"y[oZ^w 9k^{߲뽓ά?R }y~ H3{{%V+H/sㆋS¼֫~uz>/E--Gh~ܞ'8;/'A}*&Lv&ҷ-zc7N@ S`?l3WC0l)B\@D!跼vt qس\qEJh13"7 X,^C[1FPb 8'# YHO Y*S#$YGϒ %I:bPiR0DeeJQ,ԄWT#+1Kg)!%rɠ]Z01p K_"!X}F$BP~&yQv_JyvlY ؓ65ʢ2eQ*-]@heY`@%1>}*k[ԪE\lۦV=mi;;ܧ@VrM.wRBݔV~ue]d-nRDEB~E^niUA%*DBTzsZ_-;Prg5q]F 0h:\`@*!,np~fCRd;"\9@xĹ)1/|_%b{& zLޯc N9jeFPHLboI 9SDYnLNB9KR9UiITYYM2y:yD$nؕCk9nWv)zFxfShI w}:'m =I(sI ɘ`PY)I!@Hə=pb7'`a9y}9ؚ闁wp)i%)ɛ#_00wyy)PfPɊىiC& `piН3qWJi۹ t 5DȉI؉ZyiXkJ#ڡF`` 6' )ZhGtXg'l@yփG<ڣɠ {6 f8Dz8IjYzy u1j_cKgiʤ]O2\Is oky*{Je U [y}/ڜe dyA9"|ڨjmJ*PԂ5`@8چ:1pz)ZPʆv .@ Š_)ƫ8dzO *5xx䊤i!F)Gs(ɭ%z`j;#Z4;ؤJr`(`xzx˱![+r'uh6{HD94;]IJ9ۮЎ-K BF{*ۛ*O8۴ZRʵxY(Y_Wˌ;g9:[^9) |U&iwy Uiio+p7̚焄@{;;mTΪ׹*\])3Ej@PcK- mITۙ{wa{TIˆ<^#Ż˼`bz۽'ҩ:֛x8 ˇdk[k'y\ ;&S@}-2{ {(';opZd5] /ٮ mB궂â6tx tX9|@t+D\$=¾{V`r&5 PZLk[\Z̎řhznL ]en,zb,R|!r!2Ȅ fǿkt<\\ɐ̠+wɜ~]|/p Y!ʰ˝l|Bgཬ$r;˂iy$ȼǼfˁoJ+l|uLjPu|߬~Lq"V ύs\J\ l & tXh  ڌ#̔=M&Up'#}!+Ҹhx3 %5=Tݨu )!=goYԴ< }is#1=? R=GpdLhF7fte}jl{S!]Y=I=\t90$xm| z H~<сYs8 ؀u?א]]myԀ\H-uўM ډXHm\G}lpf۪"tGJ9Ejܨ]z}CϭLA Sݽ !ڔ96-JޜiMӄў1>a G4M_b<"߄ "MPcNI :A"NVD84-u%>RD-*~)S.N"cI,ִtn]F~HJ>O)tSdWn&-[N&=_%"c+Kg.5bk.+yo\s3n%w${>3>OA~7u?<.N%ewcT ~IN_>n ^:T>.FNs.쿾nǎNӮ\ʎufV.~׎>r}%.~V/O~ 뇞oe'R=G/$B ҍE'^5^$_f$?7?7fo/_3)ԊԜ7'EBOhrMA>wn^W?MqGLn/MOThҚgNEa]ym&MӿG -?icqV_Gg?G՞=G*lA_bfndYy,hoczMy?L60 wiw'z__r49$tL]Y/'lVeP/Zr/]seD=oci>Āme0B8ͻ`(dihglx|@֋WȤgl:h;UUp/~gFYf1k1+^%Vpier`v i/fQyoCt.;}q]cdu:jruP{Rñw-U7hۈNMH)g?AȎ⧰Ç0Hh"h3jxB" 0 Iɓ(S\ɲ˗0c"͛8sɳϟ@ -`hɃ<(]ʴӧPJJիX6 ׯ`ÊKٳhӪ}umSpIxK.ܹv_x[(ᆁ&ǐ8 dʘ3븬Yce;"4i^zG>+Mg-^ 9f洇KcWνv%w{fYȫ7rpxqm_]3`s],8xQAh!i:\v8چQ n fFb)(cc=8jh#/0vc7@JCCx3a d$E%D\nis{JʷEEAnHYa馗Fv0<ޙfq %0R$@4jqQH*%f=N9~zG*2: 9i&Tι& 밾kzc,je.̮ 'p> H3跕f#8+fm. skL)@Ko3evsp;Z I{ݨ oWK0glN7ۦ2V"s1?:/ e+i꛵&\u:k{֑~=o\꧲"m̑6{rO*>*)MĨ⪧jCݷg L#|> >b˪F.褗n騧ꬷ.n/o'7G/Wog$;aplus-fsf-4.22/src/html/APlusRefV2_AFrame_4.gif0000444000265000001440000002253607215453016014600 GIF87ax,xڋ޼H扦ʶ L ĢL*̦ JԪjܮ N (8HXhx)PiyYӉZ1:aʩj` :)'۩*;Y d KzXˋ܀ @\K!+6-uPbFF-PXR!GAh$B,m?|9Xz7KLHg<|*iբ e3_8eY6ӕ#j42Kq}Zqy%W}6+3_iE !bF>1p Zk;{eֲ(ɉ0e'Vk̰͜ݩvNnhfS0 OMeu~^`v|N=pBCrM ֥b6tMQJih 4 x_: "x!mas x7K$bkb.c2Hc6ވc:c>dB8K(IL6oō#!< e?]Rx}pnqe_ja7&bI%i:֦H晟/8H8Hd-([29(e<' -%wQE^ډ?7[q}igڈi/l<.WXHzmr BRoP@eJ}j0wWnج-ЊY27Nah݆[9i {#5bIKZuòS+ EQjVLv<2L*vh6l:,B<|@-DH/ L?P!vZ]"o>/L2 :.ctdo[mTa՟_M$Z4~}=@LC@c8|2=Ae;xf}$y{܏7r[ o;:E:^k{{Vn+ OJ|/k|?|$/O>3p ?GD]@~9?}~OQbgo[ܘB?g./:ͫp<[Hkb׭Ht:] Y֍z}YU_׾+tcl08 ?^60J{wf' v͗:|kދ˳5r2 ?8Q_ 6x<ƞ>inezMb?%8hKd8lvx9FXGH,s,: RsixjXu;(UT(H3rAtETnx!2D4s֨8s>h @P;utu#2@]HYڀ(z}I %27ʞ]H٥=xUu_"1)tHAZP J ]'c1r5J-=0xv?}hIzy~8ʘGjzz'#2B`빘F"n *pk Yt*,Z&l9*.z)ߊ) "ڭ+j wʬ;` c W*XP7 `[ 0U/ٯL8$I'۱4׃b 1{q*5L6QE9;˳403)<CiL[NKP[k(mg[P( {ۢڨ.Zˉ4D+0[)kl W2p(1Xcjqz\J?ķ}hF0Qʞ X $X[tڶz.xj~w:ʻz;^隷Zf!.3-~ SzzBrJƉj{IҼ⌞۫ȪʥKlw1}0Zۻ:ZhWN&tWq2!vI٦{a\ػk_mXP\*֦jkZjc E*l+\R 0O4|MfyÌc?!v7¥„`ĝV Zc x [ɗZ#F3\®I lIܪy{B\yhxLJA|oqUTIֻ]|!.M8WfhnIjNJƥ94n㑉Ӟϖ4~̺l+̈́Qy&\ޗVbtǾ@n祭V> HN\-jpM߈]_׍]& ĬiӃd{ٻTwܪ #e*^dyy-N}Ľ,_rQ]7%a6b<`Gf>PSmL>kw_݊Ov(~o݈o~zH/??ր?OI`v_̏xF(~fُO1uG azlʎwjCF([Y&lxy5O\AX4M"MQg**O^˅ڐEi]oK Қ0!%9/a"-;7?L1/:n ]_ac_SkUmqYPsyi{ŀcvYd}S?W9ZsڝAM_?>x|h5-:K†A:tdI'QTeK$9fM1mԹs%N?(ʂ !CFjjUPfՉUkי\ QiSguB[Zdmʂ\ aw `Pwoc} |dOUֆqzS4i]HGxZ4RXKpzFsG{ 2IRʨI\&ůB>:g7fe^Cf*cvjkNvaϿD48k& 㮉2 !Tߨh0MD [P0 'R> aLB Ht`CT:4HD4Tq,Ã,GYO>MIDS4R8,SmMRSVSV"UWhsF1$ 6S7CuO-Bs4M0Ut+]6VZm 81sokԤcTҢhٸ(IRd_U{1jA2e00[׎m5;>,fctۭgpB);qr<ɝ\%9>]c?g)R nϽ%tsxwٙRKcdF)iL/{Ǯ{p1W} s5^[Ov @QG5VkY5:Y- ,,P.u mW684i?[k`W1/]s!'.,UΔu^1|j!KB3s Z~OTC+:M1) 2Ԟ!R򠆋3 Jgό]MU4Uz bJmڋ|Q#:]=Trg@bբQT$W"'9}>p.?8~"(>vΓho{oW;>`nnw]Mӡ.po!-Scuo/ O%5|;y[_>/=Y?wO;G|*OV=+nkWw}9/G#?|:zk~BxK'kEs>~^:Mx$Xw3/ooB4NR0`k{.<aApQ<9@8p>FDB@SotnW``NYPhM x  Xb0 mulpP Kŋ Pp&*` o YG ٰ' p֐ m e0  )Pa 1w =nQ@<mB@^m91LqY$Dūa(~'m;r-xy @k}q1rqw])1-qćqwQ]1qQTqBqq71 1 22.!%q/"r"1"Q/.2#=!:#ICRF$Ur+R$W%$c!%a&P& &mr''A'y2(Q'((5%()r#)R2r*p*+o/$+*,*U -2-Ͳ-rr...2/R,`-}*2s)(u01112A21/S1,]00v3y02d1 3's435`3Is5T3l50C5S6ς6%6u7'u8)160S;/11;@N3S-s;Ss#;<3>3<ѳ">=qM=3>S8;s=?3$StQtGۓHTK905GGoMt-MNOQ5NoUYtFQUKKGMRtV%5WuB/5SUISWXD]PCEW=SKUVAUOt[W?\[4F5\t@ouUsM?:@ ^=S>4_SV5_]B_'U?5Ua4^avU KSu0X3co9cEVW\1)sdQ6eUveYe]ea6fevfifmfq6guvgyg}g6hvhhh6iviii6jvjjj6kvkkV/ ;aplus-fsf-4.22/src/html/APlusRefV2_AFrame_45.gif0000444000265000001440000005415707215453016014671 GIF87a]gooo?,]gI8ͻ`(dihlp,tmx|@Z`H,Ȥrl:ШtJZجvzx|zn|N~jgAfg&´ׂhZ'Ag_‡w0ŋ?j7Ǐ7&Id V4ɲ]ʜ3#B'K+} i!`J@EUI:娯jK\;#@h xժmd3pk@ [ iܿ+̦={w+F\.q~4ŘGlᷙCX@g yVsiѰ &,mLͱsw Ȫ.jkǻ-·qѼ_ nNgAËp]qtS[Z>v䧆|{M?f}|kUUTw~Az%Y h[WVhڹ+Uj^HjHkN)ڬhȪNQP=;kҹgmuʆܽهAa㺋Ʋ촍kpg;{nȩbZ0ŃVWq|c[ړ{v[_ҼZxiy20OcV:Zo]ȗ\/1Ox>U(6˞ǿ|W$2j"~+9m|A%OTݶGF_X>Xp<ռҷRioywra8-OfB>xZ;N#Az0xȏ> 6r>F8H^--BȋjK4F騍*AMO60j: kf2ʱtdY5cL6%],vL$$ Q1\Gr#bdz-yF.IsI >uHKdj6ED"IL#צYsfP:NH:"dL f #L6Q9 sŲ^6HnO>Gs.Й4 _4MhZP=TGr / JJQjKF7jNITlTHkJ2Ԣ&=?Rtt =iL7Sԏ7%L=wP|ԧ Ba4SEwӧYM[oN6-ZAȝѫ.KfԬFE+RZҴԔNk\¡SU"&Wԯu,;&U$*)[rglW9{L'i;V_j,UW[Zh+>[y{): L-bW߾mzkT2v ``9=^tM]eݿQ7]+t'[VŬ2ӫN\+`Jw5-_he5\wksD0-J WZ8 >o0C1}-pQLb{suzػx9FK?թCnX.c.o7L%{ny-V}юY~9`rOfyV]nɬ:@.l|cMdIeBY#cofWhN3>e"]AJĨ6ϙh#zʛeޚ:tЅԿaMdW1v:@C>aNԹƵ;gf;9k~-j+>ޓ>w==ePYܨnѽo9~KT a'?ZHn^Qr;w4w(];_ _MCX鎸΃M'8ﯝo;|m:)+2| y=*7"Wծ^HFYj|Í{;v-"]pґיr;a>mӉFB>峫[o^c[~_c>sZg$lz_cwzh_olޝG|z;}wVoG$=<~V~uۿy+ww7z~u5w!Vw|}Rx}8c p(($^g/"ׁGp~&} }*z.XpFG=qC8q8}) ؂ǂ/Xtjp7T'&8~÷׃yP|S"gh;8{\~MOXUz~&sJLX{Na~GDhFHx׆^z0eHL9H}ȁoq]Jy|azaw>p؊G@fWw#䊬腕?Hɘ_hxyԇXxTvx#XGg(|$8聃XlLژ9X8׈8(؍V،ʸl77(٧'}vh} ɑ{y>xnlgXŽ&Yxm#5YFTiw9nfpӑHwgx=Lwi\50=ؐ3IhvzMɓ_|fHBIBi)ZyxC9w((%Dd渗Ep NIr5R8shɘG}y|@xmA$HO-Y٘ yIH⅊ 0pQubٓ*R8ixɗac9əJI.cHțЩ:މ>1Di  ٟݙ9CAY)蟩Ji=ў9ͩyjmf g8" 9I٢+z>*uiGJ)~ ?TDh Iפʣ9DWfqY:H OZ*zgUKymʌ6z#KaWq:  7ȋ bA{ZniƉCʝpZaQnfڅ,JxDazɥZɤŨ٨PZr:[Zڬj"Z*V:zgZ%q*4ڠꓚʃj J7j0)zmI$aqh*; zǚ˪ڥ9 '{)۲ z1Z2˜/v;?;aDZpZKZ8ة  YHRy];\ k: ,S㤰 j3+HkP1 |*[f+m;q_KkZt K[~k+yq>۰kIKZgԒXط˧0`G˹y+yKAs+) Kss+K嫤5>ݛ;7ZsJ䛸{"i=:˽L klܼ,+µ{ cgvg;l2ة$$LnuihkIk15[kOx##V\XW\g ĈGLN )/M4TYqL뜋h\HiO~\ȁ;uo<,+@\u zܕ<Ȗւ}lqʹ8L{M ؘ͍~m؀kمٜ=r-`MΥ]x-zM|١Ӄ=ۘMV]ۃͯ:Ϭ dc}ȯm۲ ,-L ִ =ޱ=]}v-/]aM]u;]ݫ}͖mٛKmۭb n)N>+NgK#^>U-^mA'=&KnԝQ?E>B Z>㰪$R^hY^.ZJ[Ta~=K uTF~ ]~zv}PNN (V>1~o^\Tt>n^z^|.1H&Mk^@>^>Gތ%;MK,ޕM"ĮNʾʫiӾ׾N՞sN~.~~^~.>H.n_O%>O(o#%O* ?l'_P,=?*sD?= _UAn"?@M@BS/n{>]9q%DaX8`4P_%AxO, %?>O?}oF_#O'_5P/Ar6soqE:`>%?G\ H?N?'(LH_?]Ï"/o??nB_"eAԿYrOj{D@^VGҫJ4Sup}0[ ɦO7 WT.M'bWM=@tw|܄ox\>Smz^紝4BCDC;FG@5KLEBMOPI;STUVWXYZ[\ڴ]_`abc4J fghijklmnopqoqstuvkyz{KeR}O A .dAAlMXEzeGI)CnTKM9utljOAe7 N.U‰SfʳU NnjhĪ]::,ӯ5Ϯ%1)[R%/a8Eׯ"p#+Ñ'H8]$ovx嬏p&YAv.bƩE/q]FkL%nۜ=+Nwj{8]0D[ΧG@ٹ[W>xy7ɳ?.=xۃE3/[O@`ӯܬ;θ%+@3B 0A iۀo1/铨?NDqF6̏ /cE18CdOŸԫpH.DI(ԯ(G-D +I$s3.RKJ'~w+XxySYXY߮tvwZYPp1cxp_T~,Q㓶gPZ@y'xIU 'g%< - ,_].V $B$Q,Rت ]FCʁoavtɁnX͚B\8kPM3 !8,AMDV /W} rׇ/VLA#׺E9flSQwlH5b2i,L^Ғ]X+ZMvVOc90ɽ$8@ .#e0YL<3h 9n+-7kQ^`@Dl_Jd:}ʋ '$+M[f-cW9 \_-ꮨ8pf"ե@XMrn. 鬀6j0k[zɍO~L~cpS o].lNo .tإnt[3ר.bپze.0oՋIg`T-qzd?3 k 'WʿfXTX@ЍYD?[ +.#8/)}e"y6cڦ<3vPȍ5([H9k`4yӅ& jEc2׽s|Wwk+5m4GއKGRr 1[kلO7M5yCi־)bGdH݅s.}`LCB*zA˿!ks?ߞYN [>v!}6Aj4N.Fu߼2SQM?4z4{𜓐N7rg// yeX@u#<Owt }07f^*co:^h3!2ۯNA8Baf[G9U{^lN³kރ7+~:l9/_{<ȩ7 }7?paqS Ӟyr><mz:Mc ۺZ?>ܡ3vK2 ,;ÿ?˜@;)>r(Y' 2@#<2 D=̻4A#A h< )#:lBCC@Bs@5R{=S[:5|A$ @%;5Q{8IL87| (CuvdAl7m;|+ldžQFՓ'!("qx%C{DƑɒd6 Q:cI7>얎|>dH6?4.}l8G0ƣTɉ$ǚLo\G\>Gȧ:s Ȫ BIG,lzʞd̙{Fs8t|CSǝEv\4m+LaKJJ$GdMNKK/RLdA$SAI<4μ `mU _\_߯-a PyPYE۝$O%5` s^6[%P~ /8_e_"V_!~]/N`"YjT8BMX.Y6t[Fae Ynb&F6R [ ɍ4E60=nq^C15Z)vd 78vHPc_ f!.aZ6O+PfQTEU~9,LeN^Q,$4ndbF.fSa\Lf9akд儥eh.`i&].ffEn+mbH޿r`i^g)~g~g_foaFfcf` s~^*0[hyF?5f|V[He>h&ix>CCFtb`'>R o~i@]c-eQ 35ѼWLdTc띚a$p\_.~dQ]+vm>k\ l}aҦg6gIl.MU3Vlږ2iwmfne=>CmpV^e.nMxӜ⺶'ަn%&7nR>_;h٦nF\a̮p>onp6FGUpf;m-lM|]0^_nzNo6|mިm8$b?n2Mbz#'mFnF&GUiHi+q*o<` i?MPrj4WofD.lllGB:kJp pDNg["!M{ 5cDT%EyV5OG_pSK\ssyf_u9nf/EosvcFws9pO^aaj?t-M>P,FbEKvrVWwq$wtw&Ih|巾tto>uW`{_fcZsu&gYqέD1=r+|ln=j/aQwyN>M~QOrzotYwkge"waq ín]?Ddm!:x裮vgDs"qn1!y`#Ny/vqoyrsuRM<2yOy5x{?ݮ(ⸯkAz-PX6qDsVgx'B8z{{Xgw|¢wf?ks{ +/wzO/s7Ft7xWhz}Æq[w|J|ROBGmzWo?f^gMo|h.Ρ(x[TWxHU/!{yl~s@')!uA_iZ%V -N%"zӟNûaڶU,vkDxE\Z\ܜS@RS`X !bۘe`(*@Zj&*l)$cfXe\2+a^q_@3iWe6tmɵ8L.7499N#p@/p~=1Y@P AN vK`_OX&s*)ʣLSɓT莥ZZxG$*>l"t6dQz>j@"U!%UqF 2-J1ĈiJWrw$s-*M^+b;:O=2ySl:ٳdZjYhInUYRϰwOZ>n%P+ظU_nB^RݚZ$6*kآP#նcUP6[.۞1:áea i%c1d"VXNYca:N$gRM"{XJz-hcYi-Bc[f63J^,mGq K.םt!e*QwX6N6V$ى(*SݨV<elX_,4za{8nC~D Q% q_ 2'b`FF_Q訤vb*aYx w~t՟/Y'o‰0  xhOd`Pz1MV!8a稓VaWJe=;)LZ'*;" 5뫸Żֈ#c& "Hۂ^贋j%]UINy+W9muZ g(?䯐q0u^NGÖ2n:A3M ͹;lbL> 5,M @4᾽8b4ڒvk_r󻶌̻y_$ʝF,x ~tUW|}wǵе {wjQL[~ӷ1g$ǴG. yT]) 8~ޝB}XG`tFB$a0b D}G鈇&ٰ{Cl2wxb:d#|1-[Wh<%-}$rpBqg Y2ˑ^K ߃F±U$ֽPk_7CJ1WPʳ/lb̤ Fzҋ$&+~ H4`C)^є d~J̓`tGiMZ{ 25쒑sc](רәTU3YӊQ_9_Jr3,JKuL\ Yw:fl'/4>(s b Ȃ|Ht6g0'[Z4"7Jjˤ=@*%GO䝴2,P&С:%E8Q- 5OؗVejGMRNFьjUzUt`L9:^ӄCԦM1S.~1c,xk>1bq n&=y̔ Rbe"ayZF\e${[&V\yx_s>Ҭ9ylf} f-jj,h:yhs\!itCG:Zin4) E/ZjzFg(ӵ6lkW^4Yk^ʓ.C"ؽN6s@F(Kc[[F q/&ϹA[f`綷]j}9͞uQpc;v!.8.;Yq{ծCuoہwt?|w$<[!O{RŬx}/swا~ޤo;mr3y^vy~7}ϝxy~w냦3}{%Szf[T_7h~+ї~I^!^_ N% 6MF*]M^A n u `U Ơ ֠   ! $.!6>!FN!V^!fn!vj!|!!Na艠!ơR͡!ڜ]! b!""&"!.#>"$F$aN%^"&f%6&v'~"(` b-)j*)V+,+~-"ұ.b¢/0#!1&#)c,4 23& ص\5"44)rZ75f##9c-~c8B;9 T::[=;+c>,"c[Qd+2$#Hdidds!dF)rdJVIZJL"KG_<>d)dKj Pzc4cOL&%a$NJe aeRVcJzejwc3eY:"e\%]%Ceʩ% eU[%-A($&fc@a:f) e!dUN&av&!iq&igdb@ea&*mv`k2n~iR6$cRcpE$~e&g gfgGA'&-:'v&mn}j[&lB^U^x.xr%7'աk%e@g (5'Jit&u4'~rdsf\'gN\hi@3yuObN(OZ']hgh"hȇh,$2֑͐("SJ$HFGH#ShWTfMnh'hS^H$.vߙr^28)$fExVVurM ܃~i R)䚲ک)DViRj)~*ҧ%֨ )(j\.QiyH*i|Ω~D靚̧gn"]wَ䮚_{J{R™&.Rrkj^%+zmk]e' Z5kf+۽&\k:AK@Jrb>,ll$$]* ^@rȶ>橒j,B@^<칵,@|X+Fɚk쬡,z)S<ڇj@4vm6ē7ٖf@b@4@JjF4Z ՆDFIP7RjoD嘵^@ȭmf* *~-֎䔎."BiiH(9AnjF-jJ,RmUvh\jB^n)ibɺ-@Hn.nnwrmo-l~ 0r_.ou,joq/z/eNs@mF.BJ/V `*m~Np)/S;ou0:0 0#Lnn}K)^-;~ְpp<0 g ;+:jCB"1 _߰so&DgC.(u2ʰ*1%Lqű1qR^o2,V&1qg@ jkdkAJ1#G%,%3'+b2j'C!)# L$ÅWr,. }/c鞲^"{$1,+39s #1x3M)# s6732.3j:@Ǡ:D'.1z.-O-;A.S((sCWCkڰE_+Gt1Ho&z4>dsI4%Dh#KJ+39sLg4'tNkFMs'rZޮ^@PM4u"5D3R=SG$P뫽US/Vg0;Ku~uTJ;4?n5St!4=1uQpG]^CZoKn<+F,?T5 ۵- Cv87twpa'fRjSolbh3XSPbPK i_GFsm6G36o7okLzl׊T߶sLtt7[3&Pcq4&7z/wZrfCCNwb#4j.Tj{@|o+w۶}9n^ʺ$w$8s1{1Ҳ~G1gxz3uyvvgBwO۷ &CnfH7N;qZӷsExZ[kW70m_x@8H8z+47569.7i-9#wOW8Z9nx׸߸V8UK4koqQ_y4h $yu7vxCso55kntevU+:Sb8:7s6\z96xc3k8:QCYy&8Wtx5:T+z+y'{08fso;Y4eg34r8۴{pt7|:t{X:SoC| {%{#zSþn;>XoK:O]sS4&v|0į{d{fƷyǃ<|R|=hZЯk<%P0y#4NSϰ|~:5w7>}kK=w+?{C?1Ϻ[濾:t? J>f;,M.8Օml: tWbQQ sZRy^ WkU3蕌n2n`_5 n 3 `hHF&34ΥdTi^B ae"p2ir8tQ̚K< <*(Pu f)3UsϢ%E[(ԥkfJqj &~=q $~\Gf V/})X"ne`A(ϗr%3r I@e W3g`_ipTupMdіx0 Q;~]S~ALTZ\ 9Iyylw0d9_>4:kPHA;([ \3xM­ j7~;m>XOSAQȫ@F  15 XB7 C9z2,`N&hHbFď^L$>-bpFNɸ&w/;68;X& XM\M-L@Yqyk.P<iBPC@J4S K4"sULsLT$VX[..,bvAO;",AOKl)x=PqCYCFYKv}YWIk^Rpne9O*AMd3;SЊfJ:LSY[>h%N0Nɓ* 9 *#{>0W3Z 7jЄo4#=B3l:E 7( L*+b+ Mh}jJd,eLoKLJBU;8U(m=zLSռ&>mJ&sY >Y(iDq دnV}E9)T&(ZlZ(вk{- K(j$咟<5^WOXr?}APyXͼRQ aʎ +nSȕ22hsbfɜ?w6')l*3,[P6/j4ؿv ++ {tF>=.PypеVμ5Û 5Lq 8qz}M_6tK.rӱh{BwaTyU\Pk|2|Py;/S Wc)wb=LCзnzK:\w|úP ^uoMh]î9%,ec4l*J.pgwU:y&/c͗+]#9WC{&NWפrE Fxd^_^$v(^\<41 sYrkhZݾ)[iL`~Mek$2VӔ)Z bf[e&G8GJŬ7Dfs͍m{٥dymi67,86]ʨI+JYywOT P~,>  8C&wJpF7SSf­ոLjy_j5 pdxΊ[E~8T %ޔڴǑNtXs;I@Md^Տߚ0z]˼[y1 m/ٹK ,иۑzxPU.g-dy fzר Nk"!}Dޮ֤Zyt2E^z'b((C lg/9\9c{o>KC-HZGyS;-ynͅr̮<.jZjOJL}$P7~Ď*JJ.xn.l ' $Ӏ)r3 %0X#:L/҄"h涪*HpL|Xlo%no0Fmr.$aWct J9mA~ 8 [J MmPClpp RPdpP0~oPnm  -L ޜ+rOڐ̬uTQ%-NQwqvQ%Lߚ-(60CZ`j&Pq뒐ڬ h I D zhoZ/KMj0!OU@1 `N 7Ǯ&m4^!O[@$K6o '72mt& } Sr񔌿a%3i'$- 2 Y.W#*E)D*ግe+=yP4p10su-Q."o1" i/]QϢ)@r*MQ2+oP&ò+W 3p&RZQR A31OFi/"Syv)Y0# p6*+0gR%)"3]$'qr,7s&3f/:'R#" 5/K5q0h3*I-P= s~s(rr,,+r Mѹ&O:7q 73tr@#J<T0[( Mk2WrS_ tK}oF3.'6s"+` SM)4Bcps(oM/3qgFۜ_ 9 PڲPU FTbP'H4I!T.S=NB15 I3o K=B3 5(զ233M@DT58%3>M BqRQKt?mR{Q FHotSMNN;"?^0YS1K?uJs+5]YUsa-+[TU+xGI`ANE__Bu$~Du8v,9 q6LOqFp7meRUY;fG"Kuh̳i i*H-T W[c]4Vb{vbRUWՖK%뎖Sa'jTjk#o%e5QfoSIssXa']w8-69{u2RMcqr'qA" Y7uH;GY7vHSZU6$q3GtǖnIϖVvgw4rɵ\V2&;0rA%d'1;e[C5{tp#QHqb)6%^ =5hշ7^QLTw(qu<_TU0aT`weatf8jSvwKm}g0jm5Yrl}WUtwToOvjd |LpYA]xz|[gFkE;wEׂL7hk.9c1bpv[zo7fu}ц%bq XOxx#mws '?Js:vaXYY`!ZX{Wـ_8Yu'879mxXgorWdOvXU7x5 YT 6l+Ws5Y>xͶA6DQj7}y[#yz7NHo!Cj=Qs'W58c!sOx=2Mg#؜ Y- wuy[9Kum7)xI9&9n!vn5wIWo{eYYq9pycفk=cXY7K1Pgg9z}w~WCW^gzk#xWk3uX  C@ ZoI`1Z/:ںEz+}䚮mB9c:C 7cczή@JqM .T;Y%zqogl*v{Y[}AKh ;oۻe`I{;盾U9ዼ{;;[I|L廾+ܾ)<)x3<\/|wҳ!AK=\][fUY|ceҍ}?)]|`~y>g^黵i]]]>w;)~Mƞ^מ^^_?_ _#_'?7 |3_7;?C_GKOS_W[?7c_gkos_{)r_jt__qj_*;aplus-fsf-4.22/src/html/APlusRefV2_AFrame_47.gif0000444000265000001440000004761507215453016014674 GIF87ai+ooo?,i+I8ͻ`(dihlp,tmx|pH,Ȥrl:ШtJZجvzxL.z|N~p"o!om&ˈ怒¹kf `!; 9tHqŠ@V,bC@䆋.L\ @%>a%M  peK%%$ɁMF a≤Gm@p*AhTظ# _C)Q]' U9wnZaK4ShVYxp Rp¼crW:LlVƖ/ɫw4Aojn~3+NHG>]2ո;ewK ?ܷ2_ɕg;} 7_u 4Ct+?kZw=T]1lԽ< *X_]P 6Ht䱗„ׅeI6(b6Uy3R(Rv-bS1>)xHo=A.7_E6#((d9# (ekTVs7B ~iybfFܕ)[]֧EӘՅgmڏ{j'w>Ցr 駠)xg"Cu %| ꫟DU `q-+>*k$v"lVuXBЩcƱ鵠fjRl^jgQvq*Rkh1☙"x,ګm͊.jaZ@c* ߾kF<@R>n{n[FL5;h˴}Q.ϦmV+ ;LeHR=rF0״/OB|V;XYkM}Ḵ Թ(o a J׽mwM5onߧ" ΋d W82䑳5ڷ i ,fTK~bWBK`.-Wo C޻s.:}^?:W< rMO=aoÙ|;{q MC1IxP3WmhG#bWl/Ӡ,0յN鱾-y [ዂ3ݢ|wpxwBPh1 ؕz^h!^Ra! EJ{;䞡w>+)T!7BѥPt[" 8E-NcѼ(vy$Ҙ$бk6X9=Π|( ̂]hGjɑ2d$6~Ir6DvqLe TI ^wRV^d2ad Zяt 6^җRb=xD$uGy&4M&MX́&d%M<)UlZP8r W|JЂtckLm^PdJQ0 >W%^! `5'Zъ&kyH$gpI(2ڄ^S-Ԁc')=r|O J22KM]yvturHjPEdie8e5ߔ W-J-,@5 (GQl@Y917 E-}TN=1 NugSQ)"ֲS\7GռTx"E؏Xt).ZlbYk֝!HB֣5i'ٹK$jJ"D%q-n;GbE(2 QK xKz3Ciu]& r\[9eeH{Qf-+b| #`yPx3J|EZwrۍ.=OlKxyJ3i&6H;ݩdfu EY~VaedɸIU ciX*2%EĊU1fQ<D8{igl;p0kFqIֲWx*_7]e{s)G7ӓvr". Ydp:R-bPf ql5te@t7; 7li:=\dzY;-bcP6aFJZi?<g fpz۫&M^|Cܶ&a=n(ݽ\;mm=m*W;+m bgiocLMeavy oћ5xȧR)4 kG1yde8]ʵsH E7:l 遢6v`kG0Τsǽs';twSobsBxqO'VMyE\hb9yX>ByKי$$w{'iY_{yOU$hjݾV|o0Z{W^=WJ! |w3?vK|K}-W{W)ywuE|x#7WZ0|HBG-vާnH|wHXvgsglt~v_"Hf'*(z_h`4t6xCa-o.X'CHE{Gwzǃց18DxxlwH(W;&DŽjerL'4 vY؄[~DžGw|'sXw7Cݷ|?7x8dw0xy؆燫ネgAXw(ȇxwŁXy$!wAX-(|ㆅ9;hy^8vhGn7[9g镊Eq<|XUjZbx;tx(HRȋȉtAqRH2'#맊xObx6-WEx؏)Gl+w8i+q#nZ+hzԳ rxLIƑdW9pi8dϴPhI{Ǐ=~)؋&x,ْiBJ&rhz89oQ$SIcVi_lJI'a9|cI,BLvȖ^o?艏ؓtYohkm-GA>IGvei ɕs&`}bi?@@ihi))q闞))YRYx}9[8z&(y<|VbY]茾#~3i[ii(4Ys$xٙ(Hzci rTh|ə}(ʙ/y;ic5t)I)M)ImKd`:)Bw})湠Iy ;iȀԢɢ(Zi&D'i1A.0ʠ9Ԟɜ7n^܉/ꡏHc[IʘOj)y©t.ZUTd#9#)<)'SiE:uXHz؛O Vʠ~H9%Yb* ZU٩ ܈FqjuMfJ;EĪyMz:.Ôp M$T :ICXZZzL%J8I-®:v[()TRt[꺔IJ1x"u+%fח#oȮ1*HD@Ei᰸*g…PVE^ʚI;/ˣg(miI)tڨ-;\/k[[ W聲ƹZfGkX-*J3˱JBzjׁC[{UIKlۓګe-k?b ]{`[9]ڞfs:1nEK;q02~ v;k[;';`\ڕe;Պ+;몀q;r+;v+JYhdJ޻_{{ j[+=Zs;먝dz[سJ[9{K} LŸ踐3]:{RٹJ {fwWk)YM{) ( ۔뾁:g{+¬6J*뻔[ھQK}J|z;|+D 1d)8|6 y4md@~Ll:~|ƘŴ[ BC0<лl0ln|?u $`+|_HKMO ˛̍|ꭉw*D.̺a ̙ܽ!"\:z\fyL6p΄ ;̔eٰ|˥|ͩ_<\"]|6̬8h ʊ<,Ϳ|\Ɯ]Q΋x_r\=h+Ϛڪ{ ̠|ܑݑ 9 ]yte'ݚ)]Ϭ8 -RԂ]R]Ɔx:ϨZ/H#0$6Ӵ[p1973[к@BEx3  \U]<ƚ JǾ,,DeZ _ِ˖AMeMBzXȁK,[ؿ-pڀ%G+lٰM,^}ehL[[r=MMn~v]cDv}M=F؜|Ր\mamc=M/8yͧ>-Ǯ]M7lQM&μ-x߬!ғ=ౝC=ݛʹM^H<;ޢ,L <ߋMuSlʽaf%Cm㴍Ĭd?x,Ds}uM֓{OM\NML=݌c|3.F=6snӖ~Õĵ MG:XT^{å吖q=m#ޅɾ).|,=竮LM~Y*孱NQ-H6Sԋd(蒶ƍڨBΚyȢ؜:f\oSY( ǎ#H;iV_ʎё+.?cl"$6RT f>WO;֙lG?׺vN] N{n Zՙ#aȾ4VUq:0zlՐ5^9;; s(EpLXHO\̦?F__Н}꧿ڞ#}fdj}jnNns.d]5Ɯ! 3ϐ+OZ8go 8/ͮ' @e3I!(ZxV(i#o8gw|^o~@AA2A?$B+MN%Ã-P-XRڬ1Y4KOOcPT=e\RhikiEFk݌pn ayM d{{*STHsK]BUЬigL=4D!MAP>ҒPAˌ9IA[E!XN _ a6eGsUGVƢ%d۳Ȫۖ/ bj[^W`: 5>MEgƸ:Ղc, F=#<| [ze(L](]֊\hpB\5d#1k$EDnCsHnLPA 8!Ь&F9%kl%.*Kqns^Y$.lq㍻Q8K Z0[$$[YL ~r4J,E\6O<,\썆&{Q> ) g p,_yI!GR 5|BM-s@%e4QEmPB Ɉ]RIP\2m4NCtN1l[ۼwb}Xq rO1\sٕH]vd'[NjcOY.m-/9g6mg4 Ց\uufH@[YwO0綞j ew+n\/-fM N>$)%EݨIFyYnd\Iޓ` h>i@K"R\`)H˜Γg%L:3Nːe&~Sj\v&b6>}.B( FϝgL 3ϡa+dLL)J!IԤ(Qc:Q.%obtTd^UUHzdKhI[`r'-P'fi@لM]'cPB"p?1 K2Ye!bD̞maô9֌XB&B' )woVԮBe%Pk3+SRmls[;wUxf5n)pbOy5b,Y^$ ]qµ2QrsCgKQANEvl_H3P'%.鸔Lե, 9)N}wzZYuF5oYK޼Ҕ-6%κpk3÷V0Y֐>4쪀zO%NJuߺ?ؕ/G\zKkakR[Kݢ,],"kRgL&{ǦUa` v%n ? gS]qXWItI)Iv:|=U؃#dIJKzjGRK+y3L8ڪ=*2ylC/1La;ߡ,L=%;qyu?\z${ɇ`OwtiLZڮWQ)}]ٌWnd( ~xK´s2hGl[@Y'AaK-#7Z 샾%S;j~)< \*s{ .~۽7=L 8T6o :>=93(3=/;A>[@㝞Cܻ+񧚂 |4)T<B=2C(UC=+¹[:c%)ϊ?]D]J923 #TS95c9I.?LDQB$5A)|aU(:T"8CC=YF>d7 H&Dzs,DBDؽ AJǻ49 P05ċ0W+,@[8#LmL¾{8it#:tτˏ$JV3J=<0JH%1 ˹J+AAK~ ȱ|}N 5$9͇tHѼAK;쇋GWȻKC s"(R1/̆jaI-*PCLP Clƍc= H#K4K QJINϴҵtP5='"PM;OH-SV xmV|VR Dq,F:&RV-DR,+eL:F%]V2W?L(ȈBM@U7eUwWNrLnTDSYrV"HJ-._ N4 faU F浭U UT Cލ=}F%C^@.JV]eZL Yb\Qfu_Ǣy-"NfV_WӾ,b-cF~KJN+ =!M5.fW]:"97> )EFgch[bŭ-f VbZnPofJCf\_\Pg$'>-QN}^&mi@~in_nZξHKdNeGhaFHwfVfL[M`Nd6X b[h5ji-4q.r`EtH^/* V!_PO&קfNbӪ&en3ҕ^(mmmmmnn~k (Nn^nnn~nŒ⮾6;eNbn6fw[$o6oCon.+fANon.oaonop?voiEo/ p>qp&q pGgqwqqOa/^4+ r"%̈#w=Y fpnr+$'rsr,)qr0(6471/2Ws7s8_n<7<(^mh*tC?-?tE_tF,*otI ItJtL9mpX;1sQ@tuk"uLqW7uAt2rY_]o[s6'_^/cǘasAoQBdW&Wu^ǜb?`o/j7X߇mG!_ugdv]_+`ueWq=wb7o7hWzroe|_lc{vowsa7x_OWYov~xwo_|wH'Px^7wtoWAuy?O왿y yyĆzz/z?zOz_zozzzzzzzzz{t8{O{_{o{{{{{{{{{||/|?|yo||@|ʯ|˿|]L|||Id}/}?}{O}o}}z'85H|ۿ}}} }~~¯yvO~+yo~1~xqS~~|/MwOG_W'vF~HO芙wxrj/z?#I1@R1,kv;?0Xs^BAb٘mR+6xJZVl3:^bbB~vSR6?`ƖT Sb#dIR\\"Gc(i`h! *kiN @&'k+ -q$ a Xkލqt%.]k38yթr]m:-n.Rao=p> ~U,ckJ$'D!m4"`$ʔ*Wl%̘278">%eIޥqa##`)TbA Qr}98 ̩[;a{6m-1PkrK\CrZ0aRbU7i֍ 90ccmHz3]>⃦%G}罶Yn.]qƝfF5ev.cķq~:cU'oʭ'#wX77K igqC=]F$][ipp!5ȠGΗwQވ$eb1(rY aFᘆ)_v."%Y d4Ec*>eSz93p`0XiH&eL$l=e<4CΙa9qψ xR䉦 jW-ߝU2 q7z)%"z`""H}7#&ʛ7tا!zhz.^@:!ܞ(z%kkHq1ڭx*}߰fkn(+noAX -h1 `,B +Ö*#!S51j7|1i1.l&-Xύ1~<[ v #cf*~2όimyG?wyC\ձ [5#e:|EHmѸ~63 ~G(0ݣ[5"I׶45tdm*#U3vjjl+j襚YʟꛦC^x w 9ވ NnP0/&,· ,o-a;)3?wͺ:u/x=a{|_!vu;<8apdlx X) "m ] F9Mp8Nstt\V-_0G&n!rȯ+l6!*`Ea2C%ZFH}C nQ[8; %E&|1R*xEuSE~| aT]Dh29J"8ofd6J<%*K Rd %.s]򲗾%>(PM MT2󔫔E!gёJX`c~mrW'=IPVPL!e3#qN`i1Y:w9dYݱc2L;Il[5vM)ؓ#ᔙ>J!"o%{@g+ Lvg>)ciT&$#)S&Ϥf8#:F2( S)u^'i4*])?O.Q94 <11#},TRUD^vԪJ:H|u6RYD8iC&DՌ.j,ޔ VzbVmkϸb{LYX!6>@(67;l&S -Fd,f3hV<r{(7̝]u$ UV^/IϗekpݪY=rӋB|ȫ''y]e7\w]1WmQK5s?-!!q/B譯/w ,mܝ0$Au}4閤pM4aVQv!ߪvAwm}y_X :1];EDU|ˆli[PηSFkpe{qؿ[E:Q|PM6e⹂ޝiZ 4!cry ;d5)Gɹ4Y)]i͙x? ʯL|j]+[C.WkMʝyymùra5zЧݐg7ԑ.إ3N?'֭+uR]?]{s&z.c\Hřv[r(Ois_?zށbo>Բ̏_U-^1o%?Ɩ]CdKxwE?zV-'Wֻݎ#r<↿uqO K/K_ʨ/|7D=i?DhC5yM}/|W?ǵ7۵yޜ֞\QB nvH Z^ ҉^ `ցaX 2ʚ!` "aeYa^_ Jzaoՠ bava![T$Y}VTayiua}a\:hL.` 6 |'!aΠIaFp}N~Y&*"QX((j!ݘU(Z!"~ 1b.N,(q02.% WUX0"-.b/.W4b.n#Z!"R!7֡3Ҏ-*T9Ru ,b罝;""ю/~*5#%d3/j`;>#?j RdZ$#cUbG~GdHB$rc7ru"BvR:d6.#F9.dP $*aQQ4ңO^CFLMd*^e)5Q`$L~e?ݺ!eNbA2eu%Pd\ ^EZ^& [%_Rj"/چ]ZnSdT.fXjDd=l7"OՎ^e 1f`]Qf&kRc`pbLVfVFb*fn?c#szm T'1^%2!¹oޤlJgm.qfyf\g']RxV+&y}J" gUksBd.zr$h(ߙ_]2cl%8fOg}'z:~ng'"E]NhSmver[jhcr6#zhfOzfhN(4]BN8Enčbf&rNiڱgwbLfi X%ikȜ$2菆aURx)n*FOB6' ߙ~'8$Ul)n*0B]dF((X@>**1^joUsihZh(k6?*w&Y&a+M?t(tԷBRh"ZƒfD:RZN$"*ZgɊi' &)ΪR>Oլ BN~lxάCE)Ҷj~"E-ǰ hqҲkcZ-'~&,me!JyiTa*^+'5hnҫb,n'..Jr)e$٦-چD@nΑn2 n_lr.tj +,œBTbBfFnN.%#&.t*ldJ=RU*2/B*:S:lY~Top5/}/R-BhEأmM8 0mDgn">B ^XYp>i/nvʯեBŽ0(8&J߾pp=od BpJ>;000\z/!|&0[o k츢l|wl31>ZghbO #?3V-#qWR\h5"?@c~V6)*en /0(34-22!`1*cC0GzSrR1~;/20( ,'sq/ #v]5R25q^&߭Њ03π(?ք):Ϥ;s'|7c7V*Oy u7I| C#)'x;97PF{*-K㭇?u8oqw2~ѻ<u~+x=>w¼)Axs };=ej,!:2rM GC ~>B@u섑,Mm噮S\@ŢB1.ōQlHO)zf`rmOm&\9Τs~i/ MΈHBɣB#JEr23Ss'hHiL it 1䔃j$U 66*PMw8E#xYCQʳ<\Bq iQw6pՖzuV ^>09P,AA&0Z7i9)ƋkApo\F9vTNݩt9i7JT*K/`5,h1sBɋ!Ÿ|5!6uTHK,iqۖZX:+^ Ah  Oе iT)ApRE:[_}8ȶuexjv44\:?r4`իY3%jd#+Yn(||KB~MhsE\t^ٺZW~kN6ȶ_5#3kK˦wP6k4֤mnf3I+o%K2,Ph>Z>Kn<E 4̔Mt*F2z>xOphq ԮJ(W[ ]-[q+.g#F좮 *sL6D$J "DJ|ROPŲTKGf 80-"gݐNGPS垳';b7U +.BW !=z;4Eg2s4 =S }dK/N1t{@(RKe97K6eU_][7|[4rDu~vtwYAr%xjQH+ XNI=^ #5Mex ecyrF+L{'E)~V2OÖ}ŕWVMjuiNbh=m _Un]:郑iWN^Ctר꼋pHB!&-;&RzƝqZj=o'oP7"1;)\ uH;wXZ76eL$6NL!3bkjh3yҲ @-wA(0pOn![2@CX*F*9F2h_SǁGd iBG^w:^*wbb>9Q= b_琖cyJS0s,( 3L#]|(J-#Pά[7 \^#:iΡW0 qr"c"U"ҘZH"R Qɉm2=cs~ wKq:"j(1J9LvhRтAVxSZ %7vOKIO.1l+Z0T)GuuX(=pRխ.=$B+*hR!UO&>V/])MiS.qgyNbRj @[1mKK WʎqQū{g5fs[ʠ7H6rkMU[׫v{}gsV߅W\u˂:to+ԢmhZg=26Ū22j}q( !55-z7ቮ6wcf-&aRkaر-]97ɷŀm&>1D٪B5?T~\v7R|d˜۝qy\M-Dr coj7Zf3w/IyW,pڽTѳ0uJfKٳ.I$v07ndkQv6g6t BaF0Qa{7E0Gznt5&ۯֆAmOSnfmRzgrϛ|Ļhz;M%(aIpycӅ69y>s(9qsI\FwOͰO_}ik<͂:Yu{] <7C+2=jo{.n7m\=` wJ;x| >yG2YZ#y?oOsE|Nyk~KL&6G;=*no{{{>ÏPX}b|Gk_?ǏOoڎBK/po+.3P-S.Ī~KPNF P7dc. PW0)m* ?p-Y  aϲ PJv  f Ӑ +P j&pXpuf ;LQ8! k!pT- 5q1P.IEq{SW]5@ yP%G'!OoFk pfqp 91wq nqQM q{񟤑P{1/+0%/q Q ݱfjqq"ב Q&o"ӱ9##1$GR$@! ߐ%[%a_R&g&DpkR'w -'(0%A/'("c))pRR***+R+++,R,ǒ,+,R-ג--.*oR+/R///0S00 01S112#S2'2+2/3ӡ);3?4C44O5SS5W5[5_6cS6۲> 3o7sS7w7{78S82E89S999:S:::;S;;;S>>>?S???@T@e2;aplus-fsf-4.22/src/html/APlusRefV2_AFrame_49.gif0000444000265000001440000001055007215453016014662 GIF87aD],D]0I8ͻ`(dihlp,tmx|pH,Ȥrl:ШtJZجvzxL.zn|N~xWŹ`h Q o{[qXK@CMZ/mҘAERdD6 C4IBe4WMKcXQYTL=*IӦK"hRUKV9w^%E5;fR-PBPעv¦ &J-ܓL=yW`d'\{0V31UxaJ6tН&rB6O<;l2٦jhoӲ5[Q`u~==hxǦUż^2`n{p'q-8m'pUO@͔N뵣`7ˀDZ= 蠀 &?Ix`9aIJ& EaO~X8*^"(*݋4R3-$c㏵AH䑬䒧䓩(E-:)P2b% ^[eX2ތed #w&_JJby c}R_b7Μwݗ==r΁$vzJiwiT rb_tcJ*WN6Z|ڧQk%JWwmZa((!guw@PhEL;k%ˮ[o ΋o 0A?o" ?Oq8qeJ\\q C2Lkr2,blh43s;| C @H'L7PG-TOKX >cJdmh;@RtZlmx}uL}4T'nފ]E7nKv} -9T[x{y$.;ћN4ث7Uͻ;2ЗM</FSB?k}z/_{O[?Cg5w_͸S[¹zK`9~f$Mv v@0ps !7ŨPEVq W E-bPbD;#&6+!<=i  R $H,Lc%N^rW( JNp,eP) _9Y~-wI\Bh0IbL2f:Ќ4IMcj͗Of5nz 8yMl6]#@9͹tL!;N'rgΡ 'N~~<г-l/\CHPyM ;f<^DAVt=?*#h@(R⭤gAS:* .MZLҐ7hlʴTB'T Ն3)ժUbΫHsS1ҩ`ZQvU֭_M+:֞5TH#mQlk Gǚ.cͪR˧ώcu0sc:KKX5FwZ9Ms_"aӲ0B8LNr  O2mC>_CS+](ÒUh2mPeyzj`uiScQ40ɣM*w{z_ӧ4Z "d=U7^`:(qᰉQ޲=;g?.6!hk ›Qmo@fM|C7-KzIdYwC; Np@WP4y'NqzS OAP{ ťo\bWr/hx0Ӎ|8Ϲ2 s-h\@I%>&#+=>ۘ'ISьX?Aҷ.ɮ{}`{ tp_CLuwN]Aߑê]'W @ ?;q<]Hͣ˼qd&mQSi%SkglDMzFCXpfhl%XhBXp舟hWh%㉫$G؉x~ܶ(Cxx?xu|Zvj&jȌxz5X'hÅhr yiӥTI8hyX(\XX8g8aDU8(gj~ЏB&dSHp`e'~Ɛ|u^ gcH~ Im~ꅂ}^ 5ix(yl04xtzБ1gf:@0ɐOgwJZ4DyMCDvƔ_X)ZiBVl]_AaIlc e Ag)PiikK\(Yja4xmyOoɌ_}F5}}Ky~fN,8y]6\{RT}5 Vc&H(ltv%?g\S{Ǚəpyqikmdi$ٚYՍ6euHwlI AIs)ɂ!CSm\وI)7;ؙHfHIxy)_ 1H Ŷ@ k&jѣxƇ ![iڔw wx;2:sPKYJ;ʣ#.JEZF~,eqM ,4IehW*@J8$dZK,ꖗ5iZfzwS~٦tKvJ US|Gxu <ٝ稆Z*26kʚu(Eݸ&YOΙ]je詟JO{渞Vי퇦J\Y[ɞ [X%JV ٝ:5:PڨکB0:^ Iתc%)azeH hʁ")1լv*JDj9H( e::s`ʰZqw3@KW_l۳P/g\T_sG%†MMYb']4 Ԭi:2dF;݇K݀g`ż_j7s%AO.'e"g#wHѮ'g@O:cÉw< $_~5} ~fX~F~wm7]Q>8^:1bF%zs"ޤ] H@NH"Lpgߋ}މDrY# QCL䑄ب$U걧Q>Q)V y#6J9X >9yx4 B)<ʥ eE咊Yd!"gzGv)d1>~rHvԟXJ(#9zjee X^Š,&h%hBJhK:Auy+jfz:-:l@͹mlA&X-bzklxe9#r+00Oy,n{jkҋª>i~쮳*lOK([fb G6 q&2Y͂._3\:!XFɬ](DnjLadw8 !6gcdƤv/p&wuwsjyD޺ .x,mW?y/xyvoyW~L* Lx]NI^4#8y{{HDd{<俋9b nrACH gg?vٓ}y YpN_-?'q`)%1kfITST.@.dL&@ӗլӿJ^6W^ j0 ӵ8R]pW(̔EfXp`(͐V -U@OSL%ELڛZr=pLX'\1}YH/Q b#hF'1LX#7"!r4H;Qz#Ǿ#Ԧ5imB$d!2FI3 1G@AZBHdRܓ^5&\$nv|Ml+C0T;[2gTR?[ \؅LKrjY$?M{_ʤf q̬ ;"ֈ/ĒÐuU"{oQ5138YA9_F62GSM<Ťשhrۼ٢O]ߴţƃ4NM r#wPxͣf @P]Pa ܗP@ۑĔԹ$̍ gYs$;(SɮQM/4+(N~T2j:'"ϣ`Fk=fC˰mƀ΅I췏Dk/ipL`0^8-7Ldȕ3krϠyWP^Yaְcc]CZ®վ;lnνIę_89݅BUT#f̟9wiPU7Ş]v=~"%B/^̮sOnŢSq^]VxDV%%JyudSwLVWePSHaĖBݐւh#|A*suxcV 4#NxX :x~ZҴVwE`sd6&xfKkGoFtWjwZgw{'usZZ ghh0("Miz&襭efrzIʴ&*rZs b {"6(FkfqQ:Ӆ:쯷~9\%\Tm$E^P[bֶ"emu".^kUy 1Z#k-E—R5I/RH\nY:$ js.]gs@砇.褗n騧窷g>Aǎo'/|G/L@`۠}/o?n}O<]{=ï{'я%( g< T#H SH !7A 0%#Gٱg,">Z# WJNdHDxl6^z`&MRw ;(Ĝ !0q){Ќ3+eKh,%2ɛ)TSZSTX-Tazҭ. XձSgZWVui[\%Թ5^WW ;\)^et/_rR~17/>{>}czӡg~+zfW6isy \|ʝn4wyGՂGï#D'NcgvldVx{ U~zXXgjOրc(e Hu~*2(cW.e|3;8Hx&.J !荡h#Џ(Wّ%pcXJ9B"I w}Y6 Bi -C8ɏGyLٔX&&0[B1b'+_f(F.(N5 "Ysbs|gfbIYK~Ilg_r'zy hYyɗyYulY_\vwxŘ2)by9!)7qy|9y 9dٛx7ooin'G]9̹H ix ^Y1} x9ٌ IPgdƩ]ytf٘y9諾I^v]Ytyιi2x ~*dzI]Ǜ&:9BZV6| ?RWFٗ 'ڣ/r1BТI}וi{HZ6 J;j>:Oَ9 13v1Dc~Ɍդ7.Jټ{(>w+f1ktIeb?V,;{>|{n^&w xMXZYmk鷗>8]}xgDe1.>$m7~]|U]_η^ ȥhDtlNcFLŖgƝpnN}g~,{!ǒ,Tx~9|7:ī{>NרT%@޺ބnNWWz'ls6峎x׼nn#=7wRI{{ .nNم>̜IH!Ƨ.+ޙM4yFH/և=O/Q$]X]%8'f.EOk/&]coa?`x߳pJO`tؕM+i|] O]/]Z=Zߨ 9w/O9*uotm/:N_\Ŀqk,=֯ட}_]菆@$1I\c 3O4UWu_8s#w`P8$w61 M:V5;^_pX<>ZB7Q>d/Z5 @?BCDE=;HI:$%*AOPQƩTՃJKRN-Z[XS)TV_9W]8Nde1b&h lmnopptuvwxy|ּ}V=#XA < :XE!5xD"ĉE$YҤ*$A9K.S\#dL9u6Sd7y%ZԨ?=<ӝI;] UNe5WamH5Piծ-B6وlΥ1g?uUW|Wk/.XY%O6iXkWǔ5o>hr̜E"⸤Ufb$YϦmkеusbԼG*&pɕr}f:]!=ϯ_"w/W'~ͳ#0@,1aG?"9CmB̐ZP8p` <)(>\dpFk|,L? 0{m4=PL;~AB..`[2#k0tPADL7,;Z-tӺ6ߔ38s:ԓt@5BUTDuF4H'*43tSN;SPCuTRK5TTSUuUV[uUXc4;aplus-fsf-4.22/src/html/APlusRefV2_AFrame_97.gif0000444000265000001440000001140607215453016014666 GIF87a ooofff緷, I8ͻ`(dihl p,tmx|pH,Ȥr0ШtJZ,ѩzxLrznq|N8~fz]?xcP=™Nj4L3C H[=".(ŋ3jȱǏ CIɓit$)I͛8sܙSeFJ\ƀyQ&ϣH*]ʴI1 <իFjʵׯaZUjK|B۷pE)mSӖ n߿T 4PfTQZ'@Y{tL3OɞC{L7Hb;rz&ְ+Ljٛc.zAњΌ15۾g6pl.rccj,6+&fhۆK쳗ʃK->Dvc>kob+/Z@ľ:KWlgw ,$l(,O\YV4l8<,˔DmH'4@{KG-TWm5M-Ww`shl[L M5mc,Axwmo_w?Uӝ7wnx{w 1X<n_xxˑWyޣ_n:ѥSSN詯]鸣.ի \;{<|Խ +˫]}؟|}| |b ot~:_x_ NH~ x;`wS_kƾrn;ȿ L[9H0# (Bxd 789PLȲ }_F;N}+x ?8>9LBP;L`UC}]pc 6l0a81RtɎ[a]8;Z1Cb(0 D3$+YSXGm 9rҕ4$3񕰜buI@BET#!?9JjObc J5%/˒Re,[e,=GP氚ۄf2:z i>ATJ~g= J̓ ](EM:Px>s4ͩDS̃#⠞գ$KKR(KDԥΔDqzPz=iP0ThMZzVs^e\OjL^ @WҟVU~MkzOk1MdP:1DkPU%% M=Bv%eiu"6c"ɷj[W,Y&u8ךFKg:A{26feۚ?h+=N}VN6.U]';*-*YvweŨc9ٟMQ+;Zj3ժw\Z2ؿqԾ LV΁/cVԗ̔a@qqV5qm&aa9+ekw50}-H+0rLeelMn>)W`fs8hNsjXjY\L)_kdvږ:wZbψ7ˇN'mFor74KE4GMy KVCNuEZd~|^b]}Wb:kd{O̎v>hKڤkl{ rNvQ'n3rh~8E{f 'k?NhC,3|sO9}2BGj-%a> YqV;JG/SV[t3y`^g'uͨf7vŷFlm˯[]Az*z^U{c+gzM}}b }&ۓ֮;/|pw܏JUǃ<&>*uU߯h^̝>G$XKk\2GteӇ7|}x5yjZpP#~> 8^ t({g6T%7X|X1gp6z~Ƃk0h~747WH~guyUǀD耠u6l8X4z1tgW2TJVQU25x&xvKZ_1aHEQxseg|f|Jb_ 8y2 9ۗ}Zxr'vtD1%Xzr8qcs0։Hx|Jxr>uFfTfxiiHugi(vxj7vjk(mehS`XeHdž؋hU78eZx؏V!4 8 ِِ)hsّXy)&i4~[x,3))[8/ؒ4jXḌXד>@ }8s'JLٔFfNYVyUɇQ y1D`bpZdXY56HmI4oYm+(u6wmq)5CX3kr}6)nyt _6ioIzTS^3x{6Is9jɁ96SBnȉ?wIy&K$wISR;|sX'G#v9ɘ֥{'t֙ɃVDNs)2);YVy yYeG%3\9`U`LCkbiPipiYy.H NEJ3])^aqU:ʙU^U^XY}:?JOu`"q$(iIFCقb8Ex~j^ǡx1 D:2zYb0*!ZW<^5MJZy3Jrj^1'XׂqHgwקo|ׁZFjw%=s7i2I颕6Jn٪iFZzqJi#y*ʫhĸĊ7 úzy$*jʈ̨ں6͚蚮꺮VZiخZz6z8g =i,Yk ۰XKcٱF} {(ŭѨ3Ɏ*2,.+g9xexW9;cމt @{7FۊE*WW.ʧuڴ\`[4GXex9Ϫh>xJ {j zutcJJ>{4~k{JyPSCe]+c~ w+گIXN>_{ʳ'JWZ^hW++z: R;`ǫ빽/j>)PZFKK {S{t^k˷<@Ş}zB;`k29Hc{z{[~HZtK"ijk;T ls<\|Wtt+MF et_TKuzwXv:ązF+N橻)\D\$sB^ܛ9[FlƐXzY]ChjSWDž~lWL \5 >K<#Ȑܾ3Də3m'  >ejʬrѲlr8ʑʸ˺lW8>v˻\|̣˿/ʽl ʶYll3\n?A*<윲̶\|hL4 ϱQ ܭl M#9++ `Q/-!"]ʒ*,.02=4]6}8%9@B=D]F}5ӿ9HNPR=F]*mȐZ^j`=db]hRpjn-ors]vl}z]y~}ׂ]ց=؆Յ}؊} ؎ ؒ 86ٖ }ٚ ٞ ٢ =ڦ= }ڪڮ]ڲ=۶}}ۺ-.۾=]});aplus-fsf-4.22/src/html/APlusRefV2_FootNote_950.html0000444000265000001440000000035310242637216015544 Dyadic Operators - Footnote

Footnote

Outer Product is treated here as a dyadic operator because of its syntax. aplus-fsf-4.22/src/html/APlusRefV2_FootNote_952.html0000444000265000001440000000122110242637217015542 System Commands - Footnote

Footnote

On the RS6000, the workspace size cannot be increased when a mapped file exists for an A+ process, because A+ requires that the entire workspace be contiguous and AIX requires that all space be taken from one end of the address space; thus, the mapped file blocks enlargement of the workspace. Space must be made available before any file is mapped; use either the -w A+ command line parameter (see
"Invocation and Environment") or $wa. aplus-fsf-4.22/src/html/APlusRefV2_FootNote_955.html0000444000265000001440000000074310242637217015555 Files in A+ - Footnote

Footnote

Prior to Release 2.27, this was only partly true: the space was just sufficient, but the old _items{1;} value was carried over, an inconsistency that could lead to errors--see "Items of a Mapped File".
aplus-fsf-4.22/src/html/APlusRefV2_FootNote_956.html0000444000265000001440000000103210242637217015546 Introduction to Screen Management - Footnote

Footnote

The value of the object is examined to determine its default display class. In particular, if the object is a dependency marked for evaluation it will be evaluated. Consequently it must be possible to properly evaluate dependencies when they are used with is, has, or show. aplus-fsf-4.22/src/html/APlusRefV2_FootNote_957.html0000444000265000001440000000100610242637217015550 Display Attributes - Footnote

Footnote

Regarding the distinction between top-level objects, narrowly defined, and pop-up objects, see "Windows" and "Quit, and Open and Close" in "User Interactions with Displays".
aplus-fsf-4.22/src/html/APlusRefV2_FootNote_958.html0000444000265000001440000000062010242637217015552 The Scalar Display Class - Footnote

Footnote

This is not quite true for floating-point values; the number of decimal digits appearing in the formatted display of a floating-point value from the workspace may not be enough to exactly reproduce the source value when executed. aplus-fsf-4.22/src/html/APlusRefV2_FootNote_960.html0000444000265000001440000000141310242637220015536 Interprocess Communication: adap - Footnote

Footnote

In practice, however, it is best for the listener to go first, for then the communication channel will be established immediately upon the connecting partner's execution of adap.Connect. If the connecting partner goes first, then by design the time intervals between the attempts to connect get longer and longer, so that when the listening partner finally calls adap.Listen, there may be a long latency period before the communication channel is established.
aplus-fsf-4.22/src/html/AcroCh3.pdf0000444000265000001440000005423707215453022012477 %PDF-1.2 % 24 0 obj << /Linearized 1 /O 27 /H [ 838 179 ] /L 22687 /E 5093 /N 8 /T 22089 >> endobj xref 24 14 0000000016 00000 n 0000000644 00000 n 0000000699 00000 n 0000001017 00000 n 0000001171 00000 n 0000001307 00000 n 0000001412 00000 n 0000001519 00000 n 0000001626 00000 n 0000004543 00000 n 0000004635 00000 n 0000004850 00000 n 0000000838 00000 n 0000000997 00000 n trailer << /Size 38 /Info 23 0 R /Encrypt 26 0 R /Root 25 0 R /Prev 22079 /ID[] >> startxref 0 %%EOF 25 0 obj << /Type /Catalog /Pages 22 0 R >> endobj 26 0 obj << /Filter /Standard /R 2 /O ( UV.`Dz-#_m_}g) /U (JՉ;ZdqL<Lj> endobj 36 0 obj << /S 64 /Filter /FlateDecode /Length 37 0 R >> stream %+A>8ƫ#U+bCJ+É0'댢Lx9B:dWqiHx(K endstream endobj 37 0 obj 75 endobj 27 0 obj << /Type /Page /Parent 22 0 R /Resources 28 0 R /Contents 32 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 28 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 30 0 R /F2 29 0 R /F3 31 0 R /F4 33 0 R >> /ExtGState << /GS1 35 0 R >> >> endobj 29 0 obj << /Type /Font /Subtype /Type1 /Encoding /WinAnsiEncoding /BaseFont /Times-Bold >> endobj 30 0 obj << /Type /Font /Subtype /Type1 /Encoding /MacRomanEncoding /BaseFont /Times-Roman >> endobj 31 0 obj << /Type /Font /Subtype /Type1 /Encoding /WinAnsiEncoding /BaseFont /Times-Italic >> endobj 32 0 obj << /Length 2841 /Filter /FlateDecode >> stream  ؊4=Uόb1aEc*nBN~ӹA?lD(t1.߽{(+# n,2l^?Et@]GK݀jQYG5zxtpD]-InQLkK:J!s_!aNi ~ܜ;ܽS,Ք.۞`/4wdi*ZyO.,J=%(@"a%/-u۴~* w?ˑL:VgD\j^%"C)>GT\<Qbպr'و<[ '@ɇDV_~"an*jik9yk/ O>yJve?c{x'q }:`37Me ^G:Qa&g8S= }H-ObfU \Z3?*#WGJECu`,#o)@}/̤x0Z\V-!p(c=*,X[.4/{WT͑Ytg$|3^5[BD':$` ](7)4%uy"![&&VH \X$Qf@*7`GʟKOdz|B>y'c!Jd{p\g^ʎ֏TdS!Q9e_ZPYldXp/;J+yV*_m<79n=u#_ڎdNcW˱te\g^g'|je>*+x8C[,wf!^#{Q0r/OWP9w~tL&@n*j(YkH84o/prgNO>N&_upei}_% 9UCP?'TNΧc4)t)O/XN= v~SILpUZlJ¡-ZV`gS1 NA%,\1EW]w; 'BOH jy[0⭞Pnm\s]`h>n L gh ﺡJ^xԞ/!JEMgahZF*~u48mb H~f33}|Z?rSJ\vZ3|-p[7 PS P! hq3꩑@)b|gv(1פx~(wVڂ fS/5wmZug!v)<)9֎Vr`G\WaՃil ׺xa:F,B}@ &]·ol1$U"6;Z rՁ&pqӥWʰz3@HIq?6ִb՘l>IH$J`ހ`}XqނS^[V6Ēܩ4Hr"@[{vr{ϡ\L@O\#fh xV)Yw3ޤNCf4sǥb#~ڨZQn—a C-q< Wl {"˺j+0]xrP=C.@,@n7 !y[}7 Ҝ{JDHᲕ4$<-F˜XRn%A)D"Ox$oD4P kk-nܯMHXQM<]${$hCԖIdfJ95F#Df&Xɛɯ|9L ZP]-Lsȷ!Q_I x yFrd&i9Bzv;J;NmSniB"~*AY ӿΐx{p>ezLaldtI;wf&G.|yN&*;pd)- pĹϡPj^ݷvZDŽIq!X9J*j[ }t+.Dʃ2r⢁FX6VDX)^].6/ 8 9J-,xcfC&y~u(XHA_;Ƥb(~"TS邴(@QL49DUs-CỴqUID]p%;KA@u`񱶓FGqÅ0n]sf!eã %1j/VopcM^D_f,jg0I i=nX tA}%\1Bp)f, % ru*P;ߒJ\Z/d+}NG[ M͖I XVo9?ljEgTgW* ^ڧWړmp8Y){\K}F}s| ? endstream endobj 33 0 obj << /Type /Font /Subtype /Type1 /Encoding 34 0 R /BaseFont /Courier >> endobj 34 0 obj << /Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences [ 17 /Zcaron /zcaron /Lslash /lslash /minus /fraction /breve /caron /dotlessi /dotaccent /hungarumlaut /ogonek /ring /fi /fl ] >> endobj 35 0 obj << /Type /ExtGState /SA false /SM 0.02 /HT /Default /TR /Identity >> endobj 1 0 obj << /Type /Page /Parent 22 0 R /Resources 2 0 R /Contents 3 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 2 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 30 0 R /F2 29 0 R /F3 31 0 R /F4 33 0 R >> /ExtGState << /GS1 35 0 R >> >> endobj 3 0 obj << /Length 2719 /Filter /FlateDecode >> stream puT,#us7*v8YcM?/,tgӯq+^HOk5 *a4g TO^\ɦJPVãҊ򢨳ktW Sr:I|et+H!LL~[G;߉Kuf)0{OV? C1x~F}ߪjϸp̒m kCiTE=%<ـA-#@F}PkL,0IRS5]^s ļT(3)uɽCd_ ZU’C3%}XK9>qt*RDp o3&6?BN̬A?2aEP.2u H^6\N4EAn4bbA]cGPnJ|^~ϯc'r_5{g\ 9|w/㿵?+noM,#.`(JnMj%.Yb,LW;wE^_ˇ |0իƤ Vw26 MVL!AݢWW I@UsX`5&0pOR67LI7jC%Xi!g=.TF|Ѱ<hh:JSo`W5.[â&.QB9i+cLef. 4 lc=iA#,-/K:&C@fTfSrI D Ž.G~ ޢ_[ 4מc qPGьI.u [LWcsFZ(`u_vHoxaD3 ~ٚN^+Fɧ/xRA1AsubNedCa@qs=IKftP?zf{8fތŒ{qVjʂGB dӴ.&)'a%mJw;OS qֺKꛬjX|\:)S@׿ JX,09{7+b7*퍿,Trl-Cрl0e1|o(\S5WZݰ:MߓM))},-1Ц彞G?@ I-}A2+nJkF`n3Ye4?ωg}БC/ Ȫ 9A'=q9$j V*vҷg`qbӿUO$55o{o1rZm%\ӃssuIG 8R)v\@CCgN`6]/pblV"p!wqOerBMa WΏ[vB0A25-/=a#n'<v$ۅ'*#~DΙ)g[_uF%QԮo,[eM⾶k`GƞGv,2 C t.WH+I n+Iüyn@`46yZ{, e?JfM;lշax[X̊=ёEԪvء pAenPBS-t20hAKjvZ{&ELf,s ۥyˮ?Yʓztsw\v^n3v|tx_%S rqIu_. {XЬֹx$Vy^JH\LWS=q-6Tod'8Q\/ƭJC변Z۝PCaO#z:|VkppNMN1+T-~R -ͪFXa6v62 eLtF+0h1ZNE— endstream endobj 4 0 obj << /Type /Page /Parent 22 0 R /Resources 5 0 R /Contents 6 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 5 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 30 0 R /F2 29 0 R /F3 31 0 R /F4 33 0 R >> /ExtGState << /GS1 35 0 R >> >> endobj 6 0 obj << /Length 2387 /Filter /FlateDecode >> stream R?ɯο; Z餷`^HN\O vظ*qE#,ɵGw?b-*TDO;M[`(.d_ 3d+=ؽԢbu}ëN#f(Sp"jJ KL"oX#uS \Sx}dȘT@0AD +k/Q9-(gƨ,61Ԭ@{1? #GZye4E!N646a5- 2+ P}SV*Et:z#쬈#DwԅM0UwI@AF` KõW3mtb5kKgQ[ߕ!UeoEpgo]+[sw294rlxdzӌƾ H $>йcʋtC'zmIV"qø-LSbp\D},&a +X ( -kчx?ugHJOQ~  hHD]r ͵DfWoԛR5| OL_)xL_:iG)W5ȢAEyo2mB݌ϻԛUrZk(q&QGfcv3 .דdQ }I,$(p &7?!~F 4c^3E[RJ(p&+t-qJGYW:kmimHcEV;PJY5c;E׌(\1V$(0B9^՛S^t‡8fj.X 0'Buq"Nj^݇OXW É['bu|$kfIDc ati-5𲢄`NQKZCė.-=p'wT'B 9akP>װi ;J8>%';f-M\aKuFߏ4l1 endstream endobj 7 0 obj << /Type /Page /Parent 22 0 R /Resources 8 0 R /Contents 9 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 8 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 30 0 R /F2 29 0 R /F4 33 0 R >> /ExtGState << /GS1 35 0 R >> >> endobj 9 0 obj << /Length 2215 /Filter /FlateDecode >> stream #3A.Ła }{@AU?YCUKT|'PaGyegu\P-E^b2M;S1sIԏkEWl8U'..Q /A&M]EclI\ ~lÚ4WV&uO5{F~qoX|E&4 vvw1 'r=p=Ҙ.'yǍڶ`N%Z.܌hٯfAh~lDbLO8G$W6L|5bѶm79"N =U-gM@Ea<+.&E*/-|`525 PF@mQa{\91{aIzBqIߌʋJlؙfYO^Zg\%7hQ ,>Ao56˽V)ٛ&*څ]1 $WP>o8,m'U04؇rXԜzlVPBx <t<6Lu,gŚO"* qIdm.:S?J=01[kV]asEv5]ziw*Em/7D(,=L{ AГ;-X3`329LmcA\]BBDq'/ϒyNUwEh AByeѳ3*Оj.ՙ x}-͜%AW~xؕ?S)L5BTNDhy TiQ4* ]7^%9yjțkhRB׀m;';B:- endstream endobj 10 0 obj << /Type /Page /Parent 22 0 R /Resources 11 0 R /Contents 12 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 11 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 30 0 R /F2 29 0 R /F4 33 0 R >> /ExtGState << /GS1 35 0 R >> >> endobj 12 0 obj << /Length 2141 /Filter /FlateDecode >> stream ;ߍW=Rhim6kH6,@Yx"۫k!D79 2d3[<~S4P(b+M0ZĴ9K" Iv(ӘY LMdQOƶTg#1ɓTxmڳG;~wչa*$ hDb7[clNew] `Q{ms׺WHE/nuf2y5-Pnɯ<穕:Gi``IwYsf;PwioUt}@&hWvSw=u3ž7T`4DJ7z)y>м >٨5/ǤrJ3,P akc,M9jJhW3wbn?ͺ,x+w 8WŒ*^jskhߝ4NGcyI{&f"Aj"H"9Dg?(.wܽn^ (ѴΟw>ax#7 GѡoF#VbkMj/'NB81g̎$F7[1Ү1 @Jqved>}=GȥLz?@AgBj KteXh Mؠd†jLFXx46x.HMᄔU,.7Y|DH_.d)h5]tU7K'*ޓ鱼zѻkE߹'udg=JYhfYEc"*Z&FbUJ7*;7ڬ4 ^Q2˂&!A Nzj$HLi^yRmOZ -љa;xQ~0͌u#H!3 _W*.LٻEcƇ{{CAhNԶ(;&K`S淏x 97>-Qf#a4x5΄b#$kIҕܢG)iu>}r۴EQL^?V.[RmUL2ۖ>˺Z]"=/oe3ga:W:oSs=ٖ6^^*/ ;g%0w̷Vd-/W7`K_wp:qoW)|r49a?mF4RG:4^؛qۛ)7b-zfN𒒐7j(w+Úb gv56hJ ;CiQ6MyVF4.~k񦑵;ULJW;A Y306G2i{מ b.ybZ+7@Ɲ߿>u'fQ/46Д% {ʷO`ΙFs|mq~` oa>xZS])}Nt#Jq !(Zȧ]tHZૄo`1iqf OGp6g}?9)syq}Jjqlc>DXOWVc!\W =|(rɹ wZ%}'-ku2g@Q#YiUҾ} C%;wlHAq>jOB6d+׿+-C{( endstream endobj 13 0 obj << /Type /Page /Parent 22 0 R /Resources 14 0 R /Contents 15 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 14 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 30 0 R /F2 29 0 R /F3 31 0 R /F4 33 0 R >> /ExtGState << /GS1 35 0 R >> >> endobj 15 0 obj << /Length 1444 /Filter /FlateDecode >> stream @=y6iC8;VKD>Y-] tDJ]4fz 9!a AR>ۮcNx+R]H|ba.|b粺%ڲ逽N@w՞+eg)0XsV~͚GO'80yqZB(4SF y|W_8PyoA_(8Է]W][Up곌uYXV}ϴdh#[xPif \>HS;M(fƷq`_nAkT3Uam5Y`E7/skwޛ!~ћ@۵]5`0F'fʪ҄8pLɶtL-D ܙ+=Δ $'TL0 TF.<9x\Q"|g?a4_ueYo5%ܯ{ dC;j^5OЋu=k}8\* gΙɰ:cm#Ǫ׏&cÎ8,d-8COpFȚE7=l%7O;BSpusEhf},u(RS'#BB^vRabOUMnޙ` @!G5 =?NmSMU'FY "LlF0(+ܖZ= tKdbYykTX4jHoU[۫qvrW$g>n^P[Y/Hl+ :0. wd=p_Qu@"ܷWVI !fw2r4n3ZFIDЁm(rIQ4|fh7]"§inK˃Pn5tMLbSz9%#yyƔqƵn% ̞Iv P{J?4V{6 rNE›w26T\YNz!+|*2fhm>ļfUa ݤ)r~ޥΓ'Kf]ݺlgڟo,ΎVb cɾ4>*2E}n%4L_& זdmy߇LUQMJ>7(@c?Qfri*gIhNlstsx-<.s Dyk۵ -LM?L4#_H1\15wŃܙa(md8AA#s/U :aƷhDC_+脌0Z_6d(,9KN}Khl a7W*;@ W9~qp+^ ]{ f, IB.f&8>weEb endstream endobj 16 0 obj << /Type /Page /Parent 22 0 R /Resources 17 0 R /Contents 18 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 17 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 30 0 R /F2 29 0 R /F3 31 0 R /F4 33 0 R >> /ExtGState << /GS1 35 0 R >> >> endobj 18 0 obj << /Length 1886 /Filter /FlateDecode >> stream |ey{1*pnYM *>ZJl2'u*ūD|`CiU/U\@ P 84;Ì)jR;dž q 66fsxlPFE0_;0PZ UҷuQqATTq@ܢ2?P w~9 Zr i?htZFik*5KPׂ 90GW~NfG.]MY \95⤺ Wb|R6ęTI= `ddf=;s.:^š)<>JDqUCˆJX7 J3Y,)Ř--\uߢ쁦mqu̦ H8ZW*\mdl4Z@1 ^)4zbϝ>y!L<G[e@8/osxfP!|tYX(k8Q|,4|2^dU"|1#wg憮}F'" ~Pɝ}֘m3VD_^448=LBww| Ձ%Zf~:l!f{|CbdW;TZ>Bk&9JC98 ͥ35?^?WQx{zTHGw>ViaCr-yGNn xs6@#ϹAA -05M#(IT!`$tϬв=3X2->_G/ӖBҭuu7 8WcG$x3IĪXRIs}])BQo0I\H^Bmp#蛻N\/l1١]Z0q|EIkȗN2*nRMB_dWVh͹[@n2=$a%P^d(I=t1WkuzK).PM |ͮ8+6u87mxJ- OjKp\h~"no6}H`-Ev x ![Ϙi=zfDe0 Nt.E2>sSEޚjqylŔf urE\|Ɏ] z$晃Q3- $~pJ< pLO[ 3T1Zxeknw/\*u~rgUֆRy&f_~z{#iwf=ƼVtlV,DR/XZ R5LqI`c%\ekl65@ue+b3 ǎ8fظO ?\9 [)qCA> endobj 20 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 30 0 R /F2 29 0 R /F4 33 0 R >> /ExtGState << /GS1 35 0 R >> >> endobj 21 0 obj << /Length 1579 /Filter /FlateDecode >> stream -l4)$=C 4Yτwu.ljD)g P[hc{\23b{{Wd¨䀐'Qf&wvvMET{1R9n"jZXj _[<Eh;P6:(rpRhD%[VrH5ެBnG2>JtVqIJg2>cQLU$$A*q\-5xp=Tn:L CH=!UngsyVԀeW4UK9NZqTt$PLD;jwz{YIE-r#}TҼy|A7=ATٱG΄M#5:c;(J3C:G Ykk>)U=+VŦ! } 1V[%.pB]rw43Vϩ) G@Oi"M `\< lhf,CwXC&T[ U+}z8gWJnD#s@KMqo#4'D|&v̼w*7 `vK |jw]pl^> .aHIvTFrԔ zТZwc8Q#q QL\{iMf!W^ RAEMBIЃu(`N#pxkpp$Bgs՟k?^{/hbtWi&U-*ob_^'WSB^K KTnXg7c0~S(꿆4B ˗tvu_&[L~l{Qlq Z2Rc}*ZʽPark — Q0ؓa=$XhEb+"N%*sBYû#jGsdc!#$?\{uڔ'  1 ̿}rPщ=$ώuc_YRv]vR i *ia"2ZsX'qwᦹѤ+| Yh`#%8Y6|YGHS_6dVtqz6/Wg-S `lPl? gYm%.lᑍ97nq[W#VX_W endstream endobj 22 0 obj << /Type /Pages /Kids [ 27 0 R 1 0 R 4 0 R 7 0 R 10 0 R 13 0 R 16 0 R 19 0 R ] /Count 8 >> endobj 23 0 obj << /CreationDate (zPQtcfn) /Producer (%EA$\("Q;1Yy~>Ok H9 ) /ModDate (zPQtcfn i>J) >> endobj xref 0 24 0000000000 65535 f 0000004942 00000 n 0000005093 00000 n 0000005228 00000 n 0000008022 00000 n 0000008173 00000 n 0000008308 00000 n 0000010770 00000 n 0000010921 00000 n 0000011045 00000 n 0000013335 00000 n 0000013489 00000 n 0000013614 00000 n 0000015831 00000 n 0000015985 00000 n 0000016121 00000 n 0000017641 00000 n 0000017795 00000 n 0000017931 00000 n 0000019893 00000 n 0000020047 00000 n 0000020172 00000 n 0000021827 00000 n 0000021939 00000 n trailer << /Size 24 /ID[] >> startxref 173 %%EOF aplus-fsf-4.22/src/html/APlusRefV2_FootNote_963.html0000444000265000001440000000105210242637220015540 The t Context - Footnote

Footnote

Actually, because columns in a table can be of different lengths, the result of a selector function must have length equal to the value of _N in the context of the table, i.e. c%`_N, where c is the context argument of the function.
aplus-fsf-4.22/src/html/APlusRefV2_FootNote_964.html0000444000265000001440000000057410242637220015551 The t Context - Footnote

Footnote

That is, selections done with functions such as t.also where only the view is specified in the left argument.
aplus-fsf-4.22/src/html/APlusRef_3D_1.gif0000444000265000001440000003471507215453017013503 GIF87a||ooo,I8ͻ`(dihlp,t(8N|pH,Ȥrl:ШtJZجv+$wܰxL.zno^$M~gAs~x=B<ſ HGL`*\=} ~ذŋApL3I$/|Pa^f͛6FRC/8 %ˣDt)˖4JJA! fhկ`DjSb* ˶-Fyέݻ 1eԵk ܞ^̘GʄL/Ƙ3KnĚCve+x\ ka3ۡWNi~a^M1+_ޛ1̣/>>{m15w=臆S˟_sϿ(zȁ& 6F(Vhfv ($h(0(4h8<@)DiH&L64TViXf\v`(edihln)tix g|矀*h{j衈&袌XhF*餔V䣖f馜v(*ꨤꪬ#*무N ks+lk&c62 Vfb++k覫+k,l',F ;oK7܃ofJ"Cٱ+r5F->l.θSN8~ 3Nܔ89ܭ]zz{8{)'{޹Cn:<Ň=8D6ojG_}Ё{=jcr_||O<'>۟Կ\oTT@\PT \Z=0TTAZ]SR>FYowB n@ {4?;B>)m5fزGF8#Jʉ0st(+rʇ_:)NMIAb(D.Έ⦰nI5:j1TaBX:{Њ!oLJ: °]$8F}F)HO:R HQ2dl]FMgD%')J=VyC/C^rԓ!2`|f*w4MCљ&6_YH:l1IGqX![.}tB6gl<O{ -WYc]UY+z3u[#;cQ"ZzJmv|\M-8J&WPRjy!-[*u-.Xw b}]sW.`nŻzd|J`.cg]O1$S`ϻAu߀iIt ڸR{d7IWף= [8ݔZUR [u56Z,UZM?6Ս'uQVVG^SKdI-vO64eRU9Rl̲=cNπMBЈN)ѐ'MJ[ҘδMd5{Ӕr3GMj/ԨN5NVI~gXָRs^O־-bN6fΎ-jkn-rWN7ЭvKw-zCηl$NOx`k)'N[t08#LWJ$]NsHEywKH:COz+!g8Ήt[}NL~#Y,-.=E_%d|mK/{/5};cpu$|y$- +#~,mm-?Hz{a;Lϫ@ OvGyYGi޿F#ryDwu#q4EFt # Hjh4X'V#i7|{JD3zPDRb+zk&q(w{}Pc$ǃ#Xl3Xr5Xn?\>xx27vDQJ K1jNXyPlW`W$U}w]:x#gp$Gz涅ׅYxPrԂDքih#kn%SVF42v[cwt7C ~֦3ˆ;{wY-g2W|'B.X#Xs=hz]`;1"FUexkSG{vhoHwaB&0BFT&(l"Ȉj͸f2.fx&n"i܈DlR0c&jȎN''(h`6BŇt7`峋3j{Mt\q{$}XjXjEHH82xʥ )# cU' J:)@)fsd')i#;zC/dRSB:Vd;fؒnTrcEiUh(D12BOՕW3giBnX #Zٖ(jiEkl)k)yws"u闁%)֗)c96jR9r\S9`_HÙ&dC 9*(cH cšEeY-C&Ɍ,y,X9{؛",Z+ɕ, ,|eb2yLx$9'҉xi>cbdӢه+Gȟyֲ ɜ b3+:BO#}􉢫B,):@,e,0Z8Zx|,@*gt5#,7z'IZ23:-,KڑD;ڋb2(饓¥&-d*b`'kJm(ijozsb2'ʧZ2~ڧ'+zJ)ʦeWj}1Z)ʨs9Rx~H=F, .JMU*ɩF{.H6\ҊIarhҔwO4::(JFS_ٔ*C(ʌzD%*z٭='Mw"7%xdq( V~ڬɪ@L)fWJO"K4@Zx j k2vc*DJBƙerzM+W8JX ˯5i=,$:['8'DDV2ӎĊ!wJ'+ٕA S;=[U&NUta¥ $a ]#GkC9{5XBF 骂C[7zc;\LKw(KQw$ZIB OYH {R;HiA닜fڻ)}7;[ˤ3kE۩ۙ/Y^*>{8e|4[ ~ZJ6KۦIqK+H˿e cK)[˯& ~yL#9kY*ˣ$̄\7,{,){ ;KˮZ59¨K0yL:Cl۱L̓NXj*9yZ9*E6]l$ Y;`kQm\$oLqO ܓjaDǽiz, {; i)@;lv,,2[_||ڇ|~[\,S|<%tʝ:kG*~kܓmR">-L zLs\.J KٙR|]mݚӢR=6\6EKQ=Q]f;݇>%.3H^\V\kҮ LN`DXx &+yyuޓ܇]h<alNFBd]nnX=QD oN῞ΚݿxniN< n]:jg_}Nvvޣ`Й`4ɾ MΞ[ԼM#.fX<]`.:`<Ϡ>m8oH2uƀ<1VʒI([oPYN3]ũ6_؜ ogK>{^>^Z1Qi__Q[^ͺp=sDݍc|ǝ_t|Ҿ܎`Vkp\ Fl,qU3Fo((>FA?#5:!:/Kʱ j4%_ʼnMƆ)B*B) f.sde͛F`pٔ%$6Nsd"\.*!n[:QϤn"/hZʮx2cnfں0"z\ހ[n4m,O/tTKM-Yx i \dLoY#}MpWb ޢтSQk.ݻoBBxӻ3Zݕmy+dȜZ~W xtQ;`ܵCVJuvcnrnχ8/?gAAkǘنڇq= @W80DXn¯0ES-.;jQlD-81HIN3d 3bPڨƌTKDC%r"8K"S+)cQ25=9r|EД:?Yqf b-">%ܰ<|{$OwS2}83T',+g'/ÂfzT#JUTYWF͡NvJs% 9fei5ikۤXmx RXXnLKyu"16-}mqw Et.\L;} VWc !`8cA-e$#sYuҌtSy^jU _D9>gwp mu3v&KRZ'8쵇k6넴 +QNVf7RRwU5eܴ{Ý]fEpAæ JmYVrQG0&rQo1Yğ5^zw{:ƹ(~nD s6>Yh^:OMZ{ ccR8曗}c[l8as:GC"Q?@yu6]\?xtC br5 , R˖Ca=l̓tQ0E6gOLKUMZD ; tZFe- aby8]r爅+6eN&bF XqXҸ1h T`#12wϲ`\F :]}[Y%Ɣ2ˠ@YQ}\ɁGBRRY2.>@1 [!zyUŃ(#yc܃ltfʁ{ZKS(fWj Щm٪T8Y< QcXM/t"׏q"y- FIޥ[#i1W2a'BNm\Ci]d[AmǣN2feDۜ(b0RO#n.[)/V毣IW˖fPr**h,9fRElj,⚘F3f 4KUk\CՀSl@,תP+,?v/XN5uV./vKedw_킯h T=UГ|K._144@5P3X*ʢkJb6~өn] ΡW~0 E+{%7urg?]!wME ׮հC4:Y gDgf/y*M/E}_){9!3,95DԢ}ebaW(0Q~|V^h\ЙNnZd3uT_K m9KT8B>%::@.o-B@|S&&wtք6T [ {,HMgz8-R+KCoyRtY8 ;J}ZJ'3vc&Kqן5glֈsꭶ[3%ef(حt?벳xoQvc\zR+L:׉'m٨iv wyms JnkDN ^zm/o{9ߗwfP*ٴ7O;-,ԬZ1l^A:b#=Nվm"uVWW3-4qGKU7GgSnn~@8dkI {k-;PS!8ی̋$2B(V駥) 0D,#?2?ӹ}; {*STC4A$ ?!|C# B۝*,1L?><JA41ZS2$6J3Kcc*=˻aB!$B4&[=#\!)!2ļĺp+kjZӺ4<1=Jʾjj O P#Q{;c&=Xk{7Ӵ>Ľ[t\ER<LYN;SZEC DDAE\Di4=C)jp̊fDg)SBsI ܸ6g Mй82?>%;:i+ ]AM_9d4 [Q=ʍW:\"Q2\627#ݮ͡~ 2%3=3^\?D'bH,C 1e#C,,N UkCNPBQ K)BTE l9CMɛ;, ʽ)/J=>?@5+KS2ˌ2P]& @UK]% 0ykl:3eEkFPHڣHaCzU{-=O H:uuāʜ?-ƹ} }SChVEYQMX*ʼHyT.]Ͽ;8JqNآF$wzrBNyRR{3w"TP<СUCXvDU~NsX Yǹm.Gĺ;-X; U(Yf-"x%Uuͣ#ڀ*ֳŇM۠~53iePmY#Rz^Փ˼ZXROTPUN[[Y[LÍ;L UvB:oZQ݇}-DS,Ou4@YMtӭZנIQ/loUmŤs"XuLWʪڞmUZ}ŕҢ}T+'T:\hTu]UUEY0V[ٸ+tc a_e$Se>/X_LB&M <|_ m3,1=j`W\M߬qU#a^XXX#HzU)z/>f=_Ӑޗm-R4,Śbf_%t#i0(ڍeӘb*V_  x Xu9V[Y@_48T`SKF }ܹ[L#cPKEcJ&?<1{}IKNjksKa?NR@d^N-]5æ\C-M|WNc5gY`/6/g$C_lfU?.g-vMU.*f띶7ZUhUUW"ƷuhO78ݴHf8&i2|dN^^4&>C<[]j 瞜N֧ yhAkWֶhsW ^jͺe>LM*X^vOf6[lμ&Y|M\XjͼPCEgk֫t3IbXm`kXT_:V.QjjH݅n?~m3h>^vfn=&o:톨o>BX\UY toa^.E#a3F]12Ra /D48j7seq+y@.2oRlc\rvU͙'j>cao>x^)G[FrP7VS-f-g~⎢,Y5 $0:]l |+nsys5fnemf%"sOFa@,ϢNts_y[YR OUl{-)h t.u\{RKAY8Yt7F5ڲdKctpi.[Z+PiuTω`O5W8b~--sXQ.{O7DMCWaܠUn'IdNf.w u9m6HoOz]=2tnwG_aoW)DF}Ʉ$A:P'ݒC?7[t\׻dwYS[d~wv?{kD]:h!Fu$ueZuH* bdwݞ/vkIE oN0K|?g^=yp-|BWDtpoEMhuvxyβWr|渇?El9SZgTWW{MȊp|Fl_5wЫ 7uGHVN]Odܷ0~/D_p{4xs9kkG_>{0jw=#Y߇Ui /3]۷q&wA #2|N ԄN]}N krQD4<.5 IJa`ۏ[$`IT%(jjMcқl-i a薋Xp0@$2-,&n33o62$vjU'u8{78|>Z9jSt4j w B'p;+!#aa db]53jȇǐ9v8rN$Y b.]SI <?cG˟lN!=&i3\bզOkD15,Jt4iͤvG7FYg~KpۿsIx#wwg佱7qR&۪ %=zMd5HㆤhTifhl`l7K 4J9 4{uU\.ݖX'B QTP{g}-'~ NWzz+HLV4Xƒ1D"約ZEC_Ȉb #P" '_w*"~GWac7C0Y u r%N#_ZJR:iiDHh&#N~%OR9yif8o cDɹg%a0f e"D,̊e>nw$(%8it"rUJhBVH*r* *wOꄗ[$kxJ )gd<&;k"$mtZ>j :#D nFT犐*F/DV`o̾wƵzepvI.I1BK@0s ` # o (f2cjd"i??\#'=oKòC,53slunb:mWπ޶i- d7g$-_j}wݘĝth}K`1T>l(B#QC y}bC%xtcnxo ^'ĀGyG^9aϦ9Yj=;ڒ^8o ^wm{[>J3^}EO׮_$<}Q_G@*2.z^!o~$AT0 >O|Ki` q3̠ M7#"I ePQR"aEx+Ů2rH&:qR 4 bqqC`ďlqx:P<[t$N@k# )6mԢH8ұ|BR8""2"/X,E !d&QIldJQJL= ]$E*,PJV얭3.wQT~e'LaRD M AŬ1)-ӕ,6nz$&N^ሜlٸ.ȝD"9Ors2y/u},9Vb,YKyB44L+vN|Z!_PPrtw B bhC8)J=vRcHtKS. !RqԨNΤ(U'V3*WiAe(3jZGjGj}"|}ɥz` Uw`,* Ulj;;Lax%hn.#=8ȗVKse %q*݊4Xeo oU1q$/`erfTbؿ7y&[52fW Q4S%%H݁LnFfa2ϼvM7t e7&DlhЧ.䮄Eʹ ytM㪺s Xõrͳg!Դ6^Jxڟnn,UBع浌gcg_ !}T2m$F[,w $h'l&߸cww_j/Lm= I54_O" 85KSL5+q]ܹT$9k򅦼ecޕwT61MzATgHgYg`'m'twxx''wg驧'{v{ hgu"~~''((&.(6>(FN(}'Pn(v~((~f((ƨ(֨J@;aplus-fsf-4.22/src/html/APlusRef_3D_2.gif0000444000265000001440000003416607215453017013504 GIF87a||ooo,H0I8ͻ`(dihl뾌2x|pH\"Gl:ШtJ `]ZxL.6P|N~z4Zl [ΫۨFmÓƔ֔ř HZ4'jBj c#HZtgN@ Cd0I%D2D#cʌˑX̟@E6μjKNzѭkνstOӫ_Ͼ˟OϿh&X,F(R`fvÅ($!&,(4h8<@)DiH&L6PF)8HXf\v`)dhehlp rix|Ig*蠄jh袌6裐ʘhVj饘f 多v駠(jꩨ:'0 ꫰*kj뭸zikkY6l>+mfnZ-k覫+knf 0@:}#/K2Z.=}Qs2}3gcs4Mz}2պ]41mvv3=8z7~{;3܇SȋO~ܔG^ g.v-jO˨g֬~2l^׳ |O>Ώ{ƾ;{'r>c,#߲ hRB\41eTAuoeX:")},\ᝊ'zJB$0pa~5 jSO3RTi=WQQ Fj\"dMԇ~Їzaϊ֔VKm}[o״N}$L'Npw i]"2CԬ`/HТv-=YgMV=Z+a6ͺrLIepeEZȽh2ڱ:WMRrXYʮvK=f/Ի%3/;٦ u/ŠG 0Ʉ_,ٷh:{, <0k8TM|'߉A "ujeXRb*9RsUݪZIE4wfjb%_Id*R<f"_|>Om5 =ySCfi#3ⴱܲiN5E,]Pzyk<&EZ9X ʥ l>=(5=?˓+CؽSr^lbk:\'i>;6[YȟtӣkgivOvuQ S3X,VUh3׬>f(Y͸~k6ۺpF*"R^;rVSjoKkJ[5 miXFUq:gp;u W)f+{xU W ?h2Unچ'ӫ^1wZ*)=s9}rSm˙6k:>GկybH&ўU*ES[XWkDe6}1Zz^*ǘq6m=vR;+9L¿G_}]uju97prEa3/P^\m>T߷OAz3t=Ajol޴#xjrk^s[O=%|"+~}c_VT6OϿ8W?)@ ؀8gW~u؁r"8r$x(&&,؂].2%086xGR8<-!؃@kBX=HF6J؄-ȄN$RXHVއZ؅Ņ^bX>Cfs n(p8F8>sxz|؇~؇Lbx؈|#!|tx]#;b$S[艢1H6B~Rl*KŠLB0򊖨%c‹ĨBkaq(S#Tskhub{ohmHF[g|y$f{wј#ӘSJWgWk#JNrVtxc880X]9#'fi1H i` eoI%yyh OőD)8zM#spdBBɒ z[sUX#膄D&U}Ijb1؜U)0rrz)꧈:3ʦ:9UƵ2HJ,Gj\=``ک78%*2Z*Ě1 Z;z*-j:j*­E3%Ix9Ojrnzvt)B{*Jƚ+I֊z5'E+qD C:¯z2ۋ 18ɱ8j,+Zⲁ2J|ॳӜ6K(Ckm2@U_Ҳ K"{3e +YƳbRh 's\*b(`)f 2hk8k[*oKiT9uo6P\2qUʰ{)w۷fsQx Th< سJ[Zk yۧy:1m; [i-[)')zO|Zt *2g)˶gF &۪N*DB)Njid˸jb>,ƛf),ˮۻ [Eh˩ً[ZZ@_EK,KXP4;۵ڻrپڼeۺY)L&ù**Agpr #\]+0+^iw?F+z4꽱ôKv5JIJ25$KV&0TJJ{˞P<a̕KT)B+k &H\Fċ웂.\2oq * ifU\ǽr\ǔB{% pûɽŜ,텭bl\#z,,˥bܬ:Bus̃|L^+C][ɯV(JF,Ƚ,|ʼ fk\RQ[] r ԍE +D[h^DҭMr2؎~?N ލ֭ ~'-r]mcu\ُ3DC|Vc&ʷi\7] N^Ӛࡍ-Lki.Ai7Zhl冎&ܸzm LZ%]9TΙ}BN ,{>ZZ%N;>CP>ں6̶Yո(m{ъx^\^~G~^Fk^촵Bnuꕞ˞>zt>j&*ny[a.~!y5~~,X(ʮn,$/2J𝾥( oͮ#%:oG,l\= X߁N@j5^'~s*.E>+:}9o*s,E^ͪ?NO vK<ڄ_ [ҞϺJKyC3/d^n֛6OUoݪ?Zð J.RNOLLi?@̍/o@'s_+SG }F+o; y`^I8ͻh~hjp@ā8nQB0t$*Ҙ,*جv6*"f1"n̅:`c>yiOvzv~A;eCg4j9:upRo(}?$=X(;iCkoRLqzw̔s:0WF٫|[ O'65tܓPAuܲOKQ6tޒ\3 9?L[8ZͲ&(q|u븟(װhA\w^Auj݅ {@B}BE3Hز`V4_NNyoR,qƳzN^;ùyvwiwS?vH6^exaUB]SQm 5W%GS8!% HZhHA$x{^GT@6t#).Fj0rјBy69"(QYA AVr(K}扎eZя6ˊ@KѸNH]U"1Z頠I Ih9)7${0F (y.բXbe\vQN(bʥiK2r*^J n&Q:Ժ= Nv*{"![0kjy a@m{ enڮ-`RnJf8Ӛ`9л+h܋A6|%IBOvbW@CP\xs#X?o\@ 0XlCPN<<} @?JAC.miTůC+$/}}3.A˰䁯b P@zN|Lox!SG:Xp K4agp '*aJFD1䅙YwCC(iZ"ʐr),:.RC(L Z>UqA5QO@B0ruH9Yc654RQccB,,nd| s$I,p^W&۷5NI OI!̻V^FÕe,KD]Ȅ(I͗L(g*.2GsNL7O&O\Jɳn/a^3Q3Ni:#;6Z^#@\o& '#Ai  4^;[!`_>TZiϵ8@FҖGrVBjCJ1/$Pj5v8VhB0sjEAp #O; J2L4Dj$0J&SbsY/*=ը@pS 5]}kzA&[FӺҪsW*6},i6o 5ʎz`vr_uBcR(_{ ̆{؈Q8)%hSZMt}OVRRm̶vmGQE.l%mQm#NgȜjm.;63vsOFj{U꭯. -$~O:|ǹ eDݕ3,pa^v=z]3Æf[)`n}TI#OpNkikWg.ݱ[^*I)]޻mWG>BhIl1||yOr|}~&R1o;tL0z={(Vk_'=~2Uw$J'xʰY3'?'w01tIEez~^iN'FWNtn;T?HVд'qc%nQqUq딃h*U_tT Ce(zH%>!ȀwlfGh~} ^tyft8r1wo";oA؈[Gv6l-qo 7Љd~wwlTpU'~wЂ{fO|MȊ1tCAċrz.sCO;h7(WyWQƌ(r?Vap @1gDZef#GhsML%"Vg  wq붌+6sRhQKPfq-'U7wrfh/8nreh2 Vi/vִv;fSՁz&V|ג 'er#:娒9g\U;ync7yV(`QF]uŽ 4e uSyu{VuMK_Z6aTcYeɇuw؇fEqbPi]cE3`G7AYQ w)7m~yvs?9 p&hBYgɑ4hn9W@hi:iq}XIDAvFfĈxE)SuɒTg9bPx@Ia XiY8 A)`_@ԕàxȔtX38E%]Ijb$9(iey^g -ޘH}2-G^*F=Ǣ("!ܠtGr:b!8'VSi=:TyYc(CXvJ#䲛13ڟl Y>gQ.K1WAzAj˷Gz7!ZS[KEײtr;cI]5EWDzع֔g?7O%YکJRil|{\[k g;v)t!+uywNzw櫸=˶TkX)UJ{x:k+D4u[k:}zJw+H˻ENѪns ux;';*ZniX 9bڸ'wkp9f;'zk};j /{븵J!dk˨c5l۝­k$-ܮ?XQwE1"roh׸ ꔘ2PiI̚ݫPj , {7PJ>3 12T,se`x2[>6lDo5^;.^{LzUi&gU|4Irsքk\gBKC!>֊N>Z+enN~E vN{^60y5Tm84 M5KM꛾҃]Q׬RꝎж?؞].x>=mx-ӷVP~wUrsw$j$5c~ob~#(Xd I]s^Yћw>ߑ^ ܷ,LrK:j^z8t2֢ ܮԼLäQJx^=yU㖹 x)3<<^Ŵqt{R-\'nآ&o)Ǘ=>' |/R79Fn_<3|2p)YOo1΃?b_UXOXoP0I8ͩ1Atip,_ T8U+}[WP7sȆ1l:d"VЬv;2ܐϦp`ڑok|.ਧ+?=~be_;mHJAmvS$U#z@f_cMD2xV3Xq;Yýt1{LՓ -0(3 a)/  _|k \d" aedh6v%<G\O$' +al崈-&eӝ{]dJ鈨p'҅SêS) ZЧ'R {dvFcHfYM]e\;x}16wy͵Wb0EȱBf+ ϡԌy [\.\Z`nMi S_ٟ-Mv!v; w5_8Sg;M}oomvk]1_gճ.ova*F_i_=Q n6 (\!k Fu݅I8AJ~cEdvbnC:؛F:LF*H>ģ8EdB^@dqB+$QϓDi^ӈ^[fhliYn-BVĕX"VgGp: 'tX)rf@60 s=!|`L_ό6L@Κbj920*O"KښEAvIB,qzz F@Mɳ-%XۨjKꎻ[jx(6`k9T~hooW ?0]Ҽ籛껯g\K .1dLnc-D*,1m2WxG7AGMPttvٰV0u\UZRܕ̄ fZnlGws0veH=z,8[>GЖ˱@n4fLM܂mݦQCۺ.;;T\mݡj.ck.zߞy`? e.IjddǛIP1%6Va$ช8j!V<"0L @Wa(z>!j03wݧJ\i@B"/c+>RIb’1{L4 3`+ 9E6dAOV:wr2>ΏCd f8l@ IIE1d$9&JBh d&+Nɓ|hh$*4⎂[$9X5Q8< _cK`.с"#[1s3'i "5)'mҦ7Iq~e"i0 s8߉# |YOПUa@GI&|ːY4IA{(vR|+O HIQ(y(b' ȩNux @-P-q( U 3o TRp?>M[R,fZ pumEo^ֱJ#kScU`E8Uh]ޕpl8ő\jHEc#Ğo)zz֒}D#-ZֳcRպValY Z6UmhSvՒ"vUVPffۣ$ ^=^[O^W}N֖ cw7XXŝԔWVi}AږoYcݻ_3 00(}_}5&f?'eвGĬ01WL ܰEaLc &=v@L"HN&;PL*[Xβ,l`L2hN׼. 193<=3 Aй04 E3ђp4'ISa47 MsI4GmBԨ愨Sj噚5V-Z3նεh^׹uUW@bNf;{6TMj[.=+mvt~p}TL#}ZDsĶ3{w-~8oz{᭠,Kn7C̻ ᙅ%i2xc(&yx3n1ޢzqn4前yLETX~y};@QJ67g9[W9%[oVW"֞v]QAZvfo9nC zF~񍥼¡kq?uE _xټjQfmD o{*%M%nzGhC- ؋U }̝SX {XWGR'~b?=WWS]`{ޠL?3T_'U ??RPU=ُ 'Y_? |r|E[ztb}|S{s't|xEc8nWAwTNAXq#GUjY+\&؁A5n.WetsbTǂu5gw@B9DYFyHJLٔNPR9TYVyXZٓ ;aplus-fsf-4.22/src/html/APlusRef_3D_3.gif0000444000265000001440000003722507215453017013504 GIF87a||oooiii,098ͻ`(dihlp,tmOfipH,Ȥrt̨tJZجpoK.z]%{N~]_q`ӰrȘ˙ۙytm!\i{ 3jܨߜHX-J.-^x͚PjςFJԤĕ)aeҢPo):B3-)pIfǰӧ_ӪFu S>*[K3*;;l_#i51Qq^ޣJu˘,(7a4LCz3\ץc\pfġ7ͻ7ZS{ MvOϟw_.ṭGmLسcO/f̧ӫ_Ͼ˟OϿ(W& 6 c<(Vhvav Ć"h(!*08h8<@)DiH&L6PF)TVi<\v`)dih)jp)tilީ|矀hj衈&裐F*餔Vzf馜vi~*ꨤjꤡꪬ*mꬴjD뮼k*g&~lF+kJfvr +k, 7G,`{yۘql2lږ d'UV$ٳ?l16l8*#<: BLF,5P8VfAt`(6dOkvl<]{sqK;}רچ4mp~18u3>BS^8wgn9y+zԧ雃<4!n^nz^^.zX:“KƓ<7N=͏я;}?+ⴃ='۽:c޲n5Kmh$y  83 S '#v Ē 7x# n bw'=}*<- K>4;$1m\Sw+b˅‚! +C#I\(3)Ij&|"|x- JCȶ-*JL ĨMсpE-qH<T91?c&EEjYWl (z| )?m~;!#ƷH.#kS^2Daפ8z{dQ_|$9X>#fIL]i*%N #&P|&JC..iMcrPMazP2]1S#Ojr9Es'6_)P~*͚D#ԘwzD}-',˂n4(:gҤuZ'ډ+i#L8>b4}MsKԕ;P{G/Y,Ki Q{ڰ: MZ6{<5(" -JMGeVRmԉvqg-iTӜrU5zUZ4哝@̬Ua ZӘ< ׿3,NiflVzPh^-'^9O1 VYaXMv~,m%a ?M&Eljճwdni[H~iYf` ztWE'YXuvkzWcKQ* oOE7J%|YEv{wuzr9_}󸨯VM~E`UAKnb&s0>̥X܋O8W&Y$MO٢tv5g(+Ѭ# Dq/)mW>jH2r=FZ7 X^eO;.7ҟ"լ ϼYbs~0J@ '[Tж!m\û̀lc'9R͚s7dxx87u6-m[3L,,.Uv ߚ:axjEV$ퟻLZڬfT\:|j[c΢N]fsFu=Fm;U4-]tA+Mt[Չ|V]ox_EMSZ s3ߘ8٘2nlFeZk.᠞ޥ1mQnGK6н2tDHfG_hyk/ڍ<.G,ϊ㎞uYB]s9ey%tRO1īVq'r3[*[ʘi9mÕރ[bq'%SY0 +ċJbvk,UP82)%&癄z)I,)̫REEZeŲ=eG*D~"ݕv@:xofz)]~4k<5 ~_CIg>~I,?^u%}p6r rw~F|}g4xx;(+h'e^ib|P#~2|5WVJEDeLvei5w{{vj|7eăuh>惖c98e%Rw6bb43If~jK6ROY`gSK>sSXVnYhgiufxO^7U("BXWp9O}Sh޶UsrD/ׇ~t|oYUFg27HXk|ikhV3Glf55J4Sؤ‰BHfHZ腀(A\VSteĊ8ngG(Y֘wG*h)8#W{(s8yfkeXyXFwK߸*X)on 'gZ$,'GilxmX4*H) ]oP{rs$se4wt^u(5t8IO}D~Xcz{MlDVu̖t UMgrlH__w(uTґ.Ȃ:h؍wWMy'qȌւ8T@@\vWAnUƗcdYi啦R|H& x`BbR|yf6Y6&鷙c"Bbc"InG#wՙtț,)*(19Yyؙڹٝ9Yy9 rٞ9YɝiɹIvٟҜZ$z  ( Zjڟڡ ʛ$z`#Z(]',:A+ڢ0?/4:53Z8Zw9ڣ>#7B:p:FAzJGNzIR\M#sXZ\ڥ^`bڥP=czhjlڦnp@Z8Sz"XfjxڧӢtz#v꧄*)ZM2r;ʧ:⨴$J (O!J$=O'<ʫ&Șh~%j#FjC@⫐$ 7:۴x %zs%D鮲$*܄/՘jCʯGHĎ@eڬ5R8*iptp:|6D[$z4ʱ׺4jbIwKb-} v2;GF7#,$.@z*=$??${v'zHmsPIHȚ5*T{$V;@cORrWZ`+CcAG ր:ak$q;Ag{ߺ4E*'bҁjۢK$˟E[u8Crx~cBrh*J*AB4`+9Rڊ!z+ $] #[sB˨#@ xǼ=J;ȁֻ#{[z½;2KGX겱o#z']kK^)鴪'IF -\,]~+y+,|`o|H&޲k[(&<® #[1(3×*^({s{(A ~G%ıWP<%WVR̾ɒoQT,BƵKJg.)blGMܟf\ﻸU~"ġǞ^l.y̡{<]!Ȍ\^\#5U zǚ*\;n|{4|*|—2L7uʋ8XʡCYe+.˻s׾~|F*3ʿ+g͞'Sj|ͽ"ʀ ,6}â@ V,\p_2]7%,?,{<=rSǗ(ekP*m)2T ])Fʩ zً;5 9dȽ՘ܛ.* Âح܆ݷa`BL8ym ]j1͙*ӽƈM(R’}ߧ V-#M-H :dB~-+ Jr=M".\\C6^nl0NDn4.Q{,L+S^2>snuT |Zؽ5T~9谪"]lb艮L+wB}l萾dn)xӻ秮觽ߕ)]FMנ~%>b6B>q~N%`3NN{ڟr؞墙An>ZHMU>¯FM[Lbx`.Cn?n.~ޮuþO$xNgb*;Y)G(_كm*?˯Ȣ"2u,P^pKo#G4@Wu_8g[Poo ŀP@(.}VOOZoCetZ.Ol8 DOf|˽E:3=0CB?FGAIJ%2ʙ9:$M'*?Q.E/ 7T[UJFSޚN;v{"9i>h#B"E l:2(>  'na%F :̤,yo!30O3m%ɜ,ά\DLE?h:3-GШKEMTKT Bc0D/!`t,xaHS. IE\ ~ Ó-Cf3j㾚f%ӵ]ƞu$uZ_xRĘf?HSCJ+CS]JAEՒ'vZ`wZ!iffۄ[؛ȃS%Ri ;.)BqfXQr5#l\ZsD\OG}Ql*gr8>QtƄѵؕ.4߁"W@N5>q/ư3  uˡGD9:t%mp'>SqFɢ>LEQ>杆MWoi*f4HBA7)Ҧ u)UIjō? P[ tf.TQ2Ne(ִCV[ZU4yiHXӦU9+`-+ΪF'{%jѪ26|-XGT>寗,acGU&q[M(~Q/Eګd'B>ֲs,~7jQ'U 戀=m]QRmk'،֭Z,FZuLWEޢʳE킳}ۜ$ђz\VU0ڦ$Myi/+)Lp:aD2 ll>~_@V,b] 9C !C֘S0ux*]0T#jv^hť3a>7! cZ17 Y\6q+(J&YFife90sxQk` %M>w?,Gщ 8HVI/Icc8r<+7۲UbRZƎ42mY:Eov $CcCErzڄuO=JrFZospz}9gZϞvMGB4=Jf;_wU6όdW%>qW,yvk޻u1rt<ߩvpLўm*< Eq3~mdFRqeΥ_BG\}Zu~`|:6[=\ /:1;nݼ]/6ŝCddiPVhӣ^~ݫvw/<\l϶rIN:ahsGu7/OvUL%-ﻱccGv*k{+ʩz|;VE3_Fۛm a_7\<}◱t? cij>4Ⱦ@y>;y9ҋ0=6T+c5c |Y +0bCcӛ6 hc=d%a56GSd!̼! \(s8%[kB*a[8BSrC25лZ*3!?DYC+ÌCyĩôB/)6*= <\3\D[5À?€ Xh:@ܵy{BBN ]Ħ@EX۠b104K?YZ|F0D FF)@NLlBa2쳳3dZ3f=2:Pǖ`]D4$E3~YERd{ =qwE)B4dR nGo/JG4G=Ab1HEr>d .$A m"8€~ԯ=D ɞFDۜK,˜JXjZ(d޼K45 !EP/!%5Ї@h(^8R6h$D@TEOFJ;44{ӈ" U˞y]?rQ3eD<*дRBлRA"EIC;=U!tфTTA6=ZTϲ#MJLJdU~MeeC89jԿT7dQxo% HB$GLlV[];uV<|8Q/͔8;zp\U 4@9bBW;RWLb^Ll Vu!WSZ5ݮ+ub::Q3h(A=U=X4rm-HMWR3,䲒]UScMC9$GX,˧|3U 4ybTͻ͌X\'(֛]jb4%$Tb-X̃[]5Ch I :[Z=)C6仰[[ƍG+Ƶ1$ŗݤuD]3}\uDdQ`lH&iE lZNJe*ǚTB-Xռ%"]5 m\R54;^eŧޅ<^\W3cBͽ=^͹5[X;{QR]\d"_D,Y͒ HI{ c$DF6haITFF"_2vƝ6CekjŒJ9v }LɗUk%[K1Stk҆lW3Hwj7Ӻ UmV GrHk64PSmԊˇ9z -ԷmF(Tve nl,B*ȕNa:i.ܵ ` D߷^iS>Sv oNŖZم<&jc^Vi+igVm+;~v^؆\dgLODVn";,hBUq wq hE{D]pH * OcoDSՖ%/S'/Nr*`NrE B#bq3>L/r³6We1g;olV5)R7Y(0ON<>>+erX΍rǍ/3x 74}G >+\W"AwKDd=o*Xޅy!)rɹ|jiH|1}3fm%WG>%!ᣞzoދ_0XCSj#-)9'ȉ"IpQl"{EUp% Y©#pc!N3giTW&`- Bw6$' t`6ܙZ89( LMJU% H*J`P,i(SY\T'-ۗ>mJԥNQS&kA G f3. FKCgna`iT񹭷:⇉$6n-z. lz!IeO/I :`0ԬOς,s{1q˰fŞ/U%l;ذ*;Eo+#-9ͫSŊ֠#,tAu|9 I' iߖ4UM lWGL vk"scx3,%b2OL#+%qk!Y^ h^@ -r%0%ߨ8E/ aA-xȰmи"gr|[5y{ ; 2PbEZRcD"0HEI|r۶erXyqB"-1!CX#}%~{7`op3@:Ec8F[ɺ|Hs5, &ЍG!,]4xo\!vH $ exf5nTY#r(% fiZ^Ȕaz#؟F9<󍝔'MniAdo 2ig\ :a3;)o'8@g3ME-:ʾr̈́Tk(()*{SʻKE0*Ng(?$ o,EAmdP,!d&9M OkS+N=M<8ZT` u)KԢ\W/"r@ u!lꤞֶ+aD}"uxkJRj&f1˚="RBc-aǑ{l@{S^TvfD+bvj kmMX8k;m--n;Y"o?\'1_%As 9Vrngض Nӕ)V(PiDw"o$_PU߹a90W[#`  +F+m1m@];-W|Zug\o`%$Y)!1od 9S84I~1l*gTC>ez1sH*' "fDb&mf;q©%~LˍҞ{ דd]I]p`[iy`'kMcW^rs2lӃkE7͏s0<99a=tv(gʗꢯgHo)YNF|C^gzЭ|/cb1zc赃뇦X ;`wg˻׷@_8nrR'\{M=K< 0R" ޠ'}6)/hۯ?{嬟=B,=x[4}=gÞxc,3ݝsn_#mjՋRbUm )Rlk1R*^ eRO _Em =ߊ^=U`3]`鞸^9  ֠*\@`-, !(!cdŁ!IPa }Arqf eaP >_BJaB[nVP!a""5@Rm%"-"a"Xbjq"z煠*@ "&bZ}N+")Ƒ)Z`-bs╽"xb"" "c!3֝234^1 eU2]c7~c c9ؠc:<:9#'Iy#`=>Ef^Oe2%ERޣض5esK RTWde8N!9reQXzUFeYjeyVe١\SnZe*֊^fY[_SV[ aJX%]&e^2&d_\eude%d&gRޮOc"&i~Mjev]k]bl>iF^>-71Zp>c@ 12gpSm#sJn҄#Zpb'trb~xxޫ'5'My&yfM_4"T;gFaiRig&FnQL)~!x)ica)1) )Щi'ԉ)**&.*6>*FN*V^*fn*v*y***z*ꩬNI<ΪFުErDCCB.B>iNE^ؙnC~aB빦+뷾+n֫N+kY,,&.X.,FN,,8rr%,j2aWfffeJHǒdžfuJVfJ}gqx̮,glo Rflf,dlS>AEƑi2R:-fٝN@.-VF!h.դ/2&ז.#&9"*-߶dFnF.R]2nbmPBn.Z.ڦ-)$ڭ^.钮fFYl.m /n_=.:nЖ똶FvvQfmm:.cll&&fnZG&e^j:r,M_)ή=n^ffp]:p9pt % {#ɰ L70ץ с9}fp6PYp-ˮ /1_>q$+'CYA{R\bqni %O#JjAbfoi0Ø)α3B˖0v/.!)"#cˆ%F&&e';'q(kXH)e%(#*e++?O)?l*s-r.k,0)32s+37343G354Ws526o6o3v7'8x39C9q:f <@;csS>k?343@33AAt&t:Գ=DO4EWE_4FgFo4GwG4HH4II4JJ4KK4LǴ @tD?DsLN4OO4PP5QuQDtY5S7S?5TGTO5UWO#M[R[5WwW5XX5Wcu D;aplus-fsf-4.22/src/html/APlusRef_3D_4.gif0000444000265000001440000006305107215453017013501 GIF87a||tttiiiWM b ,!dihlp,tmx|pH Hd!l:ШtJZجvzxL.z4@ M~GqNpokMGsJɸ"J#̗I*<޺v.HŋT+@h?bII|%FS9ɗ0cԶo%"4pϟ@aJl8(4x)JC h;AJ&S{Jׯ:K@,Se:}۷nEhZ ˗RbӮVmྈKUL!$aˠCcdr^ͺ^Uzܙv۸9n ̀r _gMsK΋T&iknt%ۇh'=.I+NMs7󧏾' wy߀&% 6>MVhL*Et ($h(b 0(4xS8<7(DixL6F* TVi啋\v`)dihlp)tix|)f)蠄j衈&袌6h 餔Vj饘f馜2*i*ꨤjꩧ~ꪬ꫰Zj뭸]+k&zlF+zfvކ+ n覫+ok鵁\ol /D,Wlgw ,$l(r p+,4l8 ïF DmH'L7PG-TWmXgZ7гϳ\mhl6^6?I@,x筷D߀#*ف'Ҝqv4;WC䔟=8᡾ *wxDKF4J7}9j)R4o*;nټ?|U'w؇v_J֋>ˏ|o_CkǽǽOuȧ?JSSHVy (A1z"AQ0uGDh)z'] WqNj E7$ w"BhX)>wJ`?'EEJY"HG@_D8FCqRgcBw|cGѱ#XFfωc9Cñ̤&a8IJ&8&GI'ғ}R0YVvD,*V\\,e'U:ʖ!Q.yy'_6 g;q)M0 e2Nd4`T^ ә;a <]ڼ9sQD8jdC>ng"i|Ml? NM[gP22Ts(9$m:E>bsmlH]JӍkdÔeIL FmaI£(αW(x}.+ASN3F*Q*knTm\Ú~]":X@upWUB< ةu}[Ҩ 6t,Xך&,_GN(izVմ=5+ ko}TU]_KvT [=>{jp[vȥ.tѡѶiB,r[Œ{,J/{ZSeoA5TݢprTVq[=xeWekZZָNn` I7|$l1 fXj2-P _X*L'{O\㗉vmsCl d[q /J-Ӌ EZٚ[\c>VR_!̑(+X4پ~Z(G9LS&TnVԝYq\f r&Sl d;hH;z=FqvE?wΦ󝿔AxB1' >.x0SFʺ"5s>.twu=nnnO{F5yr~tjǷmui{r'Nq|ד+y_SļF(OW0gN8Ϲw;|&zNHOҗv 9ԧNuLIX'{]WWho=n+YDlxv~ a?A^;[^{ћl?ջ`EϽwOO;ЏƃiϾ{ǯ{TzOϿ8Xx `~cT{ 8XxJu'ǁ$X&x(** h}_2,84X6x8R:@B8DH<8D>XJL؄NG(CITXVxXQz0%2`b8L 4djlXf?h؆r8tXv|؇tң~8XUׅ]؈?#Xx(C؉ÉXx'rC؊z%x>Ê؋h2Xd 3ƸH0،8B7[RԸ֨0؍8nȀ=与Hx0؎8X0׏(G Ȑcy/yɍ/ّ"ٌI{9(%/!H.i+/-98戄'1:>IXrJi2~I~GM~QȔZiU98(R)fȕjU9&8qoil)/nyFIu<|y/{YvI kR8i) 'gx\~qri IiyHY)9xYI 9I.ٜ9 ).yIٝ9?8XrH:))ȝٞY#.fG'ȟ¹) . W* :p؛۸a# ٙ0.j2z.pY6z$i/jHRJKJڣ9ȓR VJ.Xff QzajczDJPI)\~YY 饇ɞdZ_J[zئt(}9y:{ڡ*:ٯF+W|شBKZ;HK\K-^Igz)b#Kcr{)`j4ZJڥZ:CҶh;: :~ʸJ;Y;- )۹jtkK+k}˫ڻvZk;{);Kpʫۭ ʽ\K+-:ЋSzek)+/ɽsؾΙkiȫ׻ٛIP9< [[ +pGjؽEXL \A8(/J±bb>h!)jBD6L6< -l[ 8lc,lƦ[iKo,q,ulw| m<}ܢT,[g޺_,a܇ȋKyyиȰȚ \|F$ɧsL,܆;˞i|˒[+רn(ʐĜ\,z5jʵm1ݼLUӎM=v\,Y]O C ΐ2dl}P-jL׏"yv}i}k]~0&9س\X{=oMh՝Zגx]]-,}̔3ΥG ːի-UٳЅh۷ۡ]zelJý۹-ӇX[,=]ܮֺ Y(M@mԬ=ν&M]ݠ}}+M-AM ʍ ,Ԍ խ N|Ҧ+OkK }ӝ g!+>KΪ`z޴^@IiP fѼC~%n;b>1j2^҆SlQMAĭG&c:sx5͊RmnjnW֭wSqԶCZ8.onUrB >qtnhNn>녾 N>Քq~jaKFޓYX65IOnAD-#chFibʯ_vP-o+ #Y'A*c;M;pP0#rX'4*R,6r/f>l;>S~JV bVVcKe%C掀 h Kͩj(OPҥ-گoܜ˅obߟa3uaX.el9)*jh)h+OPl|Rm?#ao:2dMڠnb(b^qt2_sFtR͐7{ }Q"FD (,MB qT! @X>tS6q%R('\) +UE- N`=DlYPm݆9h0 U^k]Ū+duĺ;y#>2PaK\3UwUO#z۶~xcq kMg%LzhbqMjsjcʖmE: nqǽݿDspe䇒e'C 'ht"ڲ!bS]=)Z2%Sۇ}aX^uIVh™%,K,f/tX%OB#>D1D y 4L&Ԇ{NKf%$Γ% [\J.(&r_ jh6Cgj0wݑY[$TǪqZ0:E(4nitkޚ Ap@8jIG& mbZh[E*B &A,gƎۄeZvТkv"^P/^zȪ{%Z.qZHǞ2 ͒;^yTfm0SM"1]3euYn,$iŜ6 pJ$`^V73'<\ig|Xu\\G'J{2z~LI*3,e{+ٛ}@B:&7YGWK0M˅{G7Vl,h-x]:x,y|uJO.گlџ[?}JQO}*୼2ó{OۧZs/cc|fe]6o>Fk}: I]bw r>/3)yPny9=_?ՍntC xU.Ds$%.MwA3($Ļ\PS>N()_ZSURR0^ ևA AC$ĕzSMK(0㣄׺j]lH0NpHAf2B.#Xա[,¸Y&a#cCI"|O<%CRAἑ]SO (>Pd)) 2$,giE2al7>&1qR܁3M|5O+7r.TdBŞ]~;;1SETA2gIO.qXw/jORb)Sl U9psQgEx5Np>5Kjy`cEIuRy.Ҭ[җ25A]ît:hN3TeFr(DbLޓ@P\u,Wլ(bzZN޲ ]Z)@՝E-\I`^FdUMmUş4xSrdiYS5Y%KˉFrB%\?Ўv5-e6h`uݪ /Ԡ, aY[nF4!7ёs )Krr9|caxk]&V#-۬׽o%򒾝}+*5mj[-Z+SmTU7;OU8;EoqvUD '@0a`~NҊ ` [SffvanD:gPV3YbDZqƌ]VƏ3:;^i;_6Cqu~|:_-Zv[T0Բ\@4}ڱFh/zMI׾XiyZ͇@Բ%56 ݂Y}JLYe Q :LՊkzvd{L؀.U Xn)w-V)@5zg.+;bs;jnSQnXy\#:>ū%ɩ(mb-rkY3Wk_$]\~vIuJry,uOIEV8?' n7v-x{kn/u+` iL]Xn%ի.Veɬp7̘}K;fD\@g]"NH76]\;,;W}R]\< nWaO{ẋGqgWw#Iag3o=ާysm>0V;Y~/ױJ?>)(mOwI٘ݘˡ ])^Zn\ ݗI]3]gLj a5bU* .!O-qϡt p`x K@ .܈ yE_ `a ՝:=jD MQlVY?D*4Pakq:`Pȕe"`naCo))b)ZΣZ$$Ʊ !.".Z !vO["""^Bܛ =c zU@q#}"))b*v#8ROZ2-aݢ.;" #1]#_ Ib"Y#e#qc77F7VdD*e5;\Ԣ:I⺼/VQ>.HAA`4b&>bB**d#7ERJ$ER~Qrd#*C.-I~%I=*>.MaM.[j"P$N⠗٥N) C~]D=S>%F>%*FeS *FG^J:dEWXVDJ  J 7cd&M]e^ޤ\4 z`Rf8T"7]%aeV&pH X&X0ƤZҋg%tO"22\ajn'B``pD&o2zZdz Yc"ZZU$g$ss t6LVq[djƦ&hռ3r'!a`"zznf( !} :'oggK߀)Ɓdx&l<F %Qyڇ6zn(Eac|㤑h}vd@Jj enI~! iE"{'nbJ)c:ZT)G\ dn)dti}io< vYw%י:h\[9-zhi^ˆh,Z^ *JbSDt_$ZJ'|0>(v>jJhY#Q%` 2ҝo)~jJG'GM .^\Uja!"ꌮjJ*+w^[zީ>BSv(FV%]eJ rzrRI!Eܼن.w$ROR*&)),&j"zž!~*dIl#Rlł!bl B#˩eDA%Dn&*Xqak,mbmgV pp/ƝiE--UTP /.-VVVmFF/{^ʜv1{p2P/h­h'qy'*oBg @/2#lԸq*am1oКiܾebjEj(ORSo5r!koJl"@#2#1l& ?pk2iF*q^ɒp*>4@Xsd36g6s5{5lb2b 22;d$${31aVf"1 &\F& x6o38?48;4*۩uvϪs;wJjf4=_.>3ok&s2[62$C215'fBCDwO4P+4n^4,c˦/G{tGj2BpCE"ź/' kb"m^k(kTuPGYO54Z§. S7SoĦTqU2MWhn +'h4}3wdY8Z 577e3[w[F#]R5.5_Cu=[=gr` z"v@1`6C8^Ouf5ZSoG4Q#vb6;vIu5TUk%a'c'3cXbpfv{[[v:%9s:7@wiKHP7uJg7lq7VwV06).1D4DW| 7q{Qз|rsw#2Qr U38cwO#x jx)GxNog8Kte{u5861Hǟs%Gu v_u#Tmϯ*l8fwtqpo86 g2̦/Vby`øck65&k(z(֮y76W,C#]/Gu08kk27/zGzc8ۺl(9Ec8ek_;׷\g1- eTS0xu9M;6Pg߹0^[;c;k s{_ady`{;zK<38ylbk';}OޫP$>H扞M <=. ĢL Fj*.w%/z]i]t$|D (HpX8ȘH)d9Tjzz" " `Wk{K1 0  F7~ΖVNVW[''Y8OψhJ:e;8 B)71"UxJ+F\:# E c"<XQх4R&1&DR@.9c.vdx7Ÿ!Ij`> o 4e=E%6h2^%LJhjc< @!"U3'7t} TϤzQz5ց;hpX(Wkjdp"L۷_o{ x7' gstX\1tDD81 uqelR<|a"InN2H٬2׊Ty*`'zss ڧg5$C m_: fU}ne͵Gsq4<Ƞ.H#ituHtv:7!݇o@ xW3MB:*FH &XѶlN]qyɉ]a|2k˽J;#PҹF#v1Yc"P֣2c{ė|ҋ֩}pydUFaxmP*| p~җB0 ds `Ax{sX!p6$4To'-bFCɰ]qXȧbgӲlMڒ *VQQtX"_DwEF[tF$2qLG?\Wz 2xXw*Տr H_YDO˳ibf% YSu AuO->ֵڗJ2Om|L`#A/xSd,z@Q)s\u>2Mʎz~ztS@g%fEkʠ-AIWҲ8 nz[lC5Yخ.HUn?gCv?# &+1IL[bNd3OuioԤs*y|`m2ܩz#R Oش0u-|.y@]bk9 ^ߘtv]*b ua6vx{ up]ڕQ^o ^?{EMnſJ̮Mk_؀W7N tW5t+] G Z?=䶆eG[2+X2omkao«ʡkU>Or!}, H}<'j߭VD -ջ&mu+?1_7@yQYFQهduj7zjw7y߷q#@~8~ǁw!q%(k ~uC`E%U|bEIˇp)sdt`ǀmk+t!GDOH~ׁPX~fOVxOC8w^) +HA-f[sT3 Wpljsl}Ʌ}F}tmwjEa;ODP8('r'[ FiiI#ꚱ~8Z )ʏ6xWB6yzp[pn7S'-%Ө  !)#|h&y岯: NW*6j}z{:IP:'xS(xB$ڱ괾5 H4yDxKZgYj>: XI*E7 #~=Nm몽hhSF [jPZڷ 1S j'䬧踣 _k`6KyIG@~{A FoU恵ۺL [-Jszfݛpʯ W;-۝d[n4[:,K/dbmfM+|ۢ+khhkϹ[]4 g:+K)^;kFZ*+iJ2e5i F)*ЉrjԊͫ;>d]߹鳢Zna[6$W{ć9 Ri4땵;\]*%#8LN:JiEID;vL+;lz^||{y$K wʸl^v,LcKti{,lFp붉8tk!|ʹY~옴˃5vH&N0^ˑ+*wjև7 !tl, d  +%+Ő1m[ `cҷ ϼmqlX=  х(͚EѓL̕Fn9o?AӲ#a-֌ȲlNr"LB ]FGԓ 7zҚ5mɲк(1ժe0֓-e[aӷӵ?Mm=st-{-wب:k+V} M Pt ւ-aӃ<%kx ?ٿgz=|(Ҧ;ofSF_ ߂P/6MgМ,4֘.w ɤ]؀h o\ނ8BxeDl}b T7fn) .le\wlgI̝KT]k̭mMFDN Phݟ *2F>Ur'1n0F̝UH ͇ɅJI{ M~w|ᤨZ;ܰ[m-GԪj3_;SMn=nXtp2!f*Uw+"̶?~, g(=Vplz+̯]9O=.>^Mqpu>N%ŧ8h ԊȃxaNsJg.9k^͋>[aWyҀYԸq]mB7{7:gML#~(߽~-_[,j OO6W܀c׆.30+n$P# |Ǝ南}U\# U&a_XjmlM( MqOݠڽ\wϹU/ *M&_ Zo,EUkEe>ku^=:+,}N!(lɁG@F88= 008 &*.2:DJNF&X^bfjnrRz~LR644".., =%#/'+7;3+d,mkwhǠ#S蘠lqgI ao~!L[i"ʼn@H/zREd*y+–.4HP3i6ᄦj'|h nވڰ1n!L.i7NƈǥzZ o@jє#˶n5T"v^H}A\'g*̊ƎĔ gX͜xv3*ZV K o-Z^}϶>AYZ8]Sw[lG{8r\o9wn\ӳkؖ1in[s)3ne[WhIVAAr5W tfb]) &]dvucxryY3RP%|QE7~<ێ}WWahnn[pgQd .W!(cYWu *J&~{נcYO R=Qh:ibaۓ2)e?b,-pxp٪ u~HIXR̉ȉjydX }z6^hAD I$D(i ')~dM5:py l'[or JګubT,M/&{l$"ZqŧrLD=;m#n=KE@vqp+ԛ3ںmeݿ,3%3 x9cR[Wikh+GHE6<;UajW)  -qʌc5t$:>&?ouB,(z/t}4e +W}5:i0pN_IX\|n;Y[Z q|$#3?-E;NI.9 y.N O=79{>_5đOV$tg_(!ƋDǼyޜ?^+Z$#aPsF7Hk4 1tM;j'CYw?:ĜBDbX"c (h ^&3>ì3! F׺ҠO)U6PhDYmx0C lzYa Qp\"Ij\$,ϋUvmÚö+ ׋8 !<,=W#'I/T!GHF~o=י^l``l\sYQB'6e82VX2Ƶ0.R Q hMJL6 $<'=%SUZꫤ2S=6(=MZ*HŎF/T_!%HoΓ/i+mX")8lMc}^| ]e*UeT +=- \˫BaId7L`ZXW#‡>r3?`TjP4ĵ{+. ,sKs؊Ue*뽗wԧ>V麵emq2YX`WE"Ի^ED/J2`ZU}hSl" > @-j+:K֋಴Kb4L^~l)>LVrbSl2~-_W#p\13`a"~o;#CM ç`EW[ɢeE0-3R J#-/j#(iILj9AAf@/h&Xovde1 X|_8ǖһ q"5D-7لV+&joÔ[jch69}IwCs;gb.UUi^f3뙜u ;\P z+59|`wSWI^B"9 צ5щ\&qa2Y9Ek6zc B%n&y_w#z8!58h=#6l#r6t"x;ܩ 6Ry8rktz]:Lv=@="T|emۯ]zWvU'OE-ɟy9;IqܺR5DG> < 孧g\W\ wsiCvvY̭6 #L#z1jXƭTQciTۏ^?INf5g6{݅= ! U^eDYuIQQQ_V 9A]^YY A5XiV ]N]ʹBn_]mA\MXBT{`6 `> NΟYnJ-SabzҞ]ؓ16`ƒJ)MyAQ La1~N YU R_mW})9#J$N%Vdݽ[,8}ey_1a` 6҈ b2-b!ab$"[|-I_9V_D5cR_Dcs11!I_=*VzPM=9L::›/_/Z"JJ$y#%M@G}"7bL\`=>v$Z$FKaFN`,H~(JͥJ< % qS"PP##;#-%Y"SjZKM% .Y]\Q*&3F`]eYRd$ZΛ9q$Geb$=5]rJR%"h%\q%M!b &f>Ycu) LHHWqfF'vp)ĐJ=؞[(R1&;&#h}&@YUTǗbh)- i$Zn]]0 h#.Wؿe4_֥zΤ"K8$6*@*JL*^*:mv}*gjJ*gr :2n(*/>jr c괆]>݋fhz'*U"$jj >k8Y)%R*֫R]'F'.~Ϊ:+f7^NOF)gZ,(ƕfMTN{"Y*'zDi޽Qjlry6bg!,dYӖBifPgAƫJd,mȎ,-]!잒@slȘ˜p]-j֊K ʩbrVьBh ni_6m̺& jmWv$vUZ-m:!멦+Q`l^B)V.=vdN+~W]e찞kBaj=#JVnjAIw<(aZ_ /o/~ 2/nNдN/Vff[n n!d>U2َ8ڮIⵥHu./9DoMr+A&\yi ;o͊֯j`l.&&iZ&A:K5kF6Ybmb0n'|1/ks̉.61ET̈́B ԶO1YVq^ψ¶p;p+ _i!h1 W0F]0WTQ0b_f  BrBqf?9A$lW wt'꿆NKp1nj]5+ VSY$ߖX[z+ Gsp n4/2j3?򪖞Xb5oj3\1s (2e3MS?<ӳ& DSr:J@t^iê+_ysY,Ϯݿ~K~'YJnzE;E3b=f־. >O/7w7xmokH+(*/"|2EynKNiWgegkGtw'"+|æʛfclҦq}ߺ܂)4MOͣJCh%p`o[Ȑ1y#JBh 3O 5R\Y y\򒻉0cƬ(ZKVݴ2p& 4g8Pӧh4#0:4G$ɯ-2jf36ʶ&6ۧCƭ=, vrpÈJx"ᷯx}E^1L_&MZM@pQCq]"3,;UmTpnOkJ[cА',۱V%;k]LTe3b=wuص˗=p ݜ e_: n2܇;(fP&b9;ScvN^:9u*h;8kśC_fnՇt[|}yFkVg#W?럢~w8)) l ZeA n {Q¼p0) *pmx! ӻ }8dW WHM; Hҥ$L%F[N)Rq=|ijXodd +PI{ȫ51Ea(peo|̓ 7_Ad{b9H{$b"yI/$ɷ1.$HИJ|id+Vβ7%[dyK(\^K/R ^Le"s),&L\ -9hJS 4,6N34$M8's~kte.S.s'1M|Y?q}s&@ PJCs-gAΌ^= q$ BAZ*v)e\4RPiM }tA'N(Ήq@Mj WS*PRXm SYԬz5n[iWJ֛c-ZuօupTǢNH^+8W^]` XjomdXzFvMeyz,fg?KږV-jb2#GZjgۘ3-|ZLV%mu7w]}:&ÅeqK]6_nuT*`-wQVw/y׋RܫI4/(/QpWTS  &LaZX[ְs@Gw-1!Ob,nq_4oSq< v;,Id*yɞm eJTd,k\<0}NH6pL:xγ>πMh>w8+F;ѐ'MJu%0s1N{GM̅ԨNtUհcMZzwkDan5R+Ўv-j[۵ԾbsMrKwNuݫ6MoV7~qv>tx@[ϸ7{8Nn(O-;8fN8Ϲw\ hGMpHOҗ0_љN[=NWر.twߞ:`oϹۛ^vcV;k>7ҳnG]zW|OOz͟.xϧ^eד~m}E_{| ڮ=xog<CO}~Ϳ|۾ӯ{_ysWW~G7s~з}xs Ȁ|y8{g~&sȁC!8gzsw%h}w-\%'G7G|Ex|7{g@VBhtDxZTXu][8~ׅ^Y`vbHlvfxymXt (Gv؇?xxnwT.v~tR(v'sJH_WLjV8xUk8H'hwM׉x|~WXc~T牣i'r2zQKgK犸HdywNUGwhv8XXĕ1׍I'(_xZ֨ȋsJyxƨbF&؃Zx=0ȃ)Xv9S?yOu*Ʉ#9c.y8"lHBYs<ٓ^C9Ei2˦KIM&SyUiu#ɇ[]镤Ǧciei @)kهmtFqA|ٗ~9Yi:Ii٘ɗc9)Zy^9yg֙!G隰9by/(( 0ƹPIsMcTМ KyTˉܙDYT#wu虞깞ٞ9Yyٟ:Zj9yp:ZzyR":$Z&z(*02:4Z6z6ڢvU<ڣ>@B:DZFzHJLڤNPR:TZVzXZ\ڥ^@!;aplus-fsf-4.22/src/html/APlusRef_3D_4.ras0000444000265000001440000244122407215453020013517 Yj)> B,H̷f'שtiS~Ӷ^̷f'שtiS~Ӷ^̷f'שtiS~Ӷ^                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        aplus-fsf-4.22/src/html/APlusRef_ScrnMgmt_1-1a.gif0000444000265000001440000000764007215453020015255 GIF87aq1澾nnn,q1H̷'Q0zB,kp,t*6l9`%Tql2(t*R 4uLN0x\:@bq 5^܃j[Fiwkv32rt1-.AyhKiEAum^4@^äKzfuǶ1YS9nݨέCBʼno׾o -~[t>V93W? sk EKWdܨlArt(S\ɲ˗0cʌi̛8sܙ @ УHLӝE^5c* E|˘3ky@WB-:r`(I^ͺׯA/PIAS^BeGݛZ{hx3wnWO,c ^ޜwx?Ov?V:T'>՟ ؔH$ R~gރ-G^vRi\8!P ;XvȢ\Q&H^ͥ"Qc[%qhSj$oCc~R~EDBIޒMmn59V(fHN%<)9':ɉgnWx7 PvJ٢6hf4ZY * ۥfj1j`i`oިZ6): kFGiT#J[ޚ㤑Tlt[J2, kJb.*vinɎ[Y"J_ޢyfkN8/ΊY0뒺k><ك 6ilĭqЦ|ʝc˯B\(;a7,,{"2N:L5I3 sۂV>pWeojxK*z-Lot`*k(x˨4 1w9y؝7ѓ7٥sŌ;8scuNK>5$yԨ.;^ծh=y}4ޱǷ  /RgKK_qi|3:ȶQws!z#Vgۜ(%TbQXfQW/qoac32cZF7 j\\~9OiΟ Q4whBQԤV3Wꃩ[oZ̵}nӽ6z)] Cio?\E$4v-+jNLzW{Y"e9$5:QԪ&q3k[60*5$mEL]*kw>Uֲ‰bno[ZNvNgRV 年yGkR;ZUws"7~R2$¶[ݢp7ǝyc/ړ:-#z:⤱kP_߳v*{\vٷp.fWi LUgr|ivU4걛]}psHgxgxBoOxҟJ|J:?uѫV `E71wovǾuJ#ȅ7awԎ}Hesk~emW?Oڨ4{}Z%[@{c* ed;[{FNB'|o߰Y{^7?_?I7<#t_ؗc5YjZwk6~9|;v~fGwj{tsJ~tv}ǁ|-hGƧI"҂GYrPC€ xR0hez'=~(eF~KXHygXiv(vwTywuIIəKzb}YOBihoGUF)^P7z7ɗxؒ7z}lU6rurb蜌9xiٛq蕝H{u)w9iꦙԩsٝdيr홇 8䉙 IIfR銩R5Utx:eYN \CөsW)z!ʠ+%w/,he9*4W8{;j fGi,{ؔd n77*kxcإt i x;^av^NJىfeJ7YIjXؙɧ$O~s _Yvz&3zRXu5ɉنZWɢT*c3wꧡ:٩{juJ=G`b|k]mJoKq:tgڪŚYګS9J&VZ0Ѭ^*zYn؊ګI*P:x~Vt>v);ʣZWF[skxrZ.b*ZvJ,[ZUɨlԸ-3 _(S|HIC B >ؓɴ< 9M U<ɵ f6|]8P=۶db0rs !q;; ;aplus-fsf-4.22/src/html/APlusRef_ScrnMgmt_1-1b.gif0000444000265000001440000001505707215453020015257 GIF87a1澾nnn,1H̷'0ej˾n,ix|pH,rf!˨tJZKmev0x,.4zn8mR:ex>uNJDWBAv6PBA@?F?I[MFK=w7EWZ氠u~,ƞ+K-2.-֊!̊['Jo („z )xpWNL0;' 0Y${&˗¥4~9<\ 4RL-,ʹ74xNд<ѾMm&ry Kg-U ]ta=f6h?䮝RM߇[ ݉nݩ}ggUnk{+.sBogϭ~Y^矷Kζn+z٘κ{굫Y߁?z_?/G'նo;Gq_{|^߲\S=}HUn^ջmm[m KJp t4JP#DP 1?H)p~] /zaZz@r+` '(qC uDF13]VD-Ed">f3(`,jl#cȵeSݛ?d)o_dHG@hB[&UVCoY'g!I TRB%FH rnd$-Yqo$ L; bTunȵt1d/V'Bj&aMV,{f)&k agMHlgHp OJπѳF%OmS3̜%)ԜlYB_>r7#QL6Mԣ%]:DPlѤLBfOVg0mh9ͅ4z(G1ȉnxk).):ԈUT#TF77k(P'&Vf| "NjKҐ]K%iR}Zki׳Si^[Usr]F*ػ@ ds&ԗMq^Y vg [Ć/Z+^ VâE Gҗ(j~Td-Y˭Uy.Bz֖R5厲|VMULc{\ƞT%luW4x]LWA%.SF7;ׯ~?m~w,pES.},3 aսu+hAex[[uFb_Ea"s{(hhs)qqKc GO!,6rOcلumpLSz7[fU͕Ȑe-ff "`.s>=~4h$ ?iҘOm\ yT)hHlrolg2凭hPsX]b.֫3[7wnAlK8@Oo!s y0`szb.wZւ`-j͆uŐmY:S5,y=ϯլ}0*=M~ 34V̻#N0eίMjl@{/ m{;xbR텞Kfc:~yJSqɳpsb^S 슏/7lӭms}>?ʁr`M[Vc=ձ׃QӝHd?e՗L҅׮Km_w&&x9Ζ!/N'qzz$=%sklݍ{/э{gΰSU]+=!usv.ȇ׫Y@2PjRHgWI|Gz>]7ug%yMd9ŐjTytD8}Gjytׁn 9k}rلti0I9"5;7i;5s94חRI0ȓ4>'f>QIri[Awv>ux!7tyhy;E`ycBbq#aMtQٙ~vכˇ'0RIB)#HLJt -_B?ttÝ)xhmYl9 WYVXYDŽ͙W_LE{-XW5we_ł=hA(_PIhgvi$_`{9u] JeM) [ʁڠeo)z4Xm-G%g:L]C WOt嵙ãsq]SƕXyɥ7 ]If£H?] |fhUcئdVz0*@Z =bu}Z'Hwj|UuZg~ʢvn'-Z)*:_Z~VٚLjLjzFzʡºI%#J">S'DMC}ӵx;zӸ8-l1)IɌZ']"=ݍ.лF%] Հh-XN<#~q| {],,v c g֐Mr=G{זMمu՜]=<2yK7YqA/аBаMZLm5,77_"|NWL >;%o8^䨌n H*k}>Vߎ~|~ur I.~_y>cphNY2:no ˚y2{~ uǖnC7%.]mF\ *q-枰*v~FH1?O=.'dU̫ej.@[Tb]{s,&^oNcqOs/"ooǼ@Y͕< /,a!LL›oq *l /ەG쎼}_OdzlA}sNƑ_3޲>ozKk$̰O|,auo_Lt-Lο/Pt١REJż3PӣO;eyLVQj^njZIyјƢn%߼o,'+<ʶ3Fxq X<\JlT%̙tυ!лw늺U7EV0[ݑGw=తJh'ya]Ɲ8Ctxtp5˽@-B2Լrx 'i_A#j>HPG=" A uw(yR"~W׆k-8Vac"'zBL_nδc06d/ְbx$k,GdrTUW#8 ^hKz =2qCfɠZ 3ϛpƹʚiD'HD*0|$衈&DXEYxF*iƤ Ezfj~B P0% } 0XeklHXݱ&3l6+-,::ߴSf-Px+Fm+$:٣ q.oF;z#G,턫, fwqܫ$lr(r,r0,s4l1@-DmH &}GPG-TWLBL[w͵1^dmvhvlvpC]tw|w߀v;aplus-fsf-4.22/src/html/APlusRef_ScrnMgmt_1-1c.gif0000444000265000001440000001703307215453021015255 GIF87a71澾nnn,71H̷'h試+lqp |@pH,Ȥrl:ШtS@ugzxL>=Zn8|.<~~z oB'ݻr7{oo{}OJOY<cs_'rmtcYHY Q@1ɐka =$iqY$9LKLR)2H&>j0wҕs%d97zd. dma?^fD#̓S2!]f32Z SL 2rT7Uz5&89N@[aXIS=EC_&zٙӄ]g-!=扡fMz54[Y3UjagֳRݘiZrb_d MV:L ]kGDJMw%KW[m8pb^6v~ XuKL1KW...gu寽+3x8^ڲX]pRǘIJLe(GբO+2O3Wf5C8lȬM3{1Vnφ=9|Fli#݌'O`# p*=K)5kSۙEez#:}.eUΆ{u7OK.6m):̭q#;^2IkVX"/ XxiZWwWd}|o|7r&@(vUPD\$tۻ+  t-NmO!dϕ#'9Mܡ>2rdru+w>:]CwtSWpե9ֻj;ڒR٥4}}=_że`}rO5m6:_LU{ox3Q?|*hg;zv?]wK֏f~jC3WǥDVҷ5^磟=צ'ߘϡ΅_?̯SgY_ѷQU}'&̇=yۿЗyʄW: G6i^HiȩUngjʩI6{ԒZfxZs)陠\,#:AebJ:RkXXʫkRcYfJoƬn9hȥv媦ZݚU8jVҖ:M9ުizJvʰ'j zڦ&;{vj꺱}0k*$1{[Jnj-{Z˳3D˲7>c& &q[FsA{Ua۠[ +^B[E@`72`#)Urdkk˗;G뮁(ٶ+I[+ [lq,6`Kq+\KѴf/[GJ*Z몦{e|;{+[ s)͛ʪfk%۹g9Y]p˧˶JjTtk#kk{[[ˉ+HOWߋ訽;$ʼ{B{[s;| ;KT8(JvL)zz ', =ԩDC}SdJ /7$P}O='VTUM|0*ү!I$BջKf-nMֲ5!m~jטfa b2^׶`ىMاfح!b .M}-ո2ױ1ڎ}ד;ك2ږ}̮;H\ק-wYF=UCԝs(̍~jA-J J8HND.&JLېBP.wnENR~>Mܜ⩊GPscLebnSTq㺇K<.BSL ̈Nx.q"mF>Al靎鴝ܧs^Ś|CHr>_~$EDSr0!>$cYt.\≎F.l۪nKn῎N;JNӎݪެ~eyN>.1;__c \!?^?_h_R`:oIIͻ`(.4`U0\^D[ D,Ȥr\jL(*ӬZXx;N]'|NOoowQenyg9ji@m{p5zfxTRh?<qC),3Q8-k;ĺDZ6־ɚ*l(MǏEꜱ6ƼkK D1e?{&!ePʔtB*Vfĕˆ(LeKp 'I%H;1\pYN>'wVYR6D)衈pT$(&gj=i_.镓%tv錌r7ZSsC\!M:e>ͮ9ZSXG:f66Kd!xذ %kxW7>꒖[nѢ{ٶL5g]vK.<OkG񺎊z)쿬nZ› "FR 9oA ]lc \زHnwN#.M4Tkmuc)hI;^>3,[91{<)}7_Hkrیj,_;8J\u #ה_˷gԁ[[z覻:Ԩoͺs7| w:ӷozԶ>gv|w4x;o6;I=#1t䋐ߵYUIHx/zӴB_ǿ*S۟ bc X-ݥzu"h`,|pIGnK(E X b\صɤl+I@XȦť-ɋ. dI$S<-xeVHR{1L3͜K7~M3Մ5/>qbfOSz̲-x+>Pps)Cg.@Qo>G6ZTf4(>ţ% ;Hui`.tb^vM< S M?/E ժ*USU*U*@X)d]Y*Դ*%#VZWN[fY)WU tx ҆BO;|" cZ6dżf7refCK򂖔2jW:-<+ڶncZuKMajutQZJv34z xMz55L/|+/~ 0,N0|w;x'L [ΰ7{ qyu"NW0p9܎*6r>2,"FN2&3N2|KT2.s^3Ǽ;aplus-fsf-4.22/src/html/APlusRef_ScrnMgmt_1-2.gif0000444000265000001440000001023207215453021015105 GIF87a澾nnn,H̷'0ej˾n,ix|pH,rf!˨tJZKmev0x,.4zn8mR:ex>uNJDWBAv6PBA@?F?I[MFK=w7EWZ氠u~,ƞ+K-2.-֊!̊['Jo („z )xpWNL0;' 0Y${&˗¥4~9<\ 4RL-,ʹ74xNд<ѾMm&ry Kg-U ]ta=f6h?䮝RM߇[ ݉nݩ}ggUnk{+.sBogϭ~Y^矷Kζn+z٘κ{굫Y߁?z_?/G'նo;Gq_{|^߲\S=}HUn^ջmm[m KJp t4JP#DP 1?H)p~] /zaZz@r+` '(qC uDF13]VD-Ed">f3(`,jl#cȵeSݛ?d)o_dHG@hB[&UVCoY'g!I TRB%FH rnd$-Yqo$ L; bTunȵt1d/V'Bj&aMV,{f)&k agMHlgHp OJπѳF%OmS3̜%)ԜlYB_>r7#QL6Mԣ%]:DPlѤLBfOVg0mh9ͅ4z(G1ȉnxk).):ԈUT#TF77k(P'&Vf| "NjKҐ]K%iR}Zki׳Si^[Usr]F*ػ@ ds&ԗMq^Y vg [Ć/Z+^ VâE Gҗ(j~Td-Y˭Uy.Bz֖R5厲|VMULc{\ƞT%luW4x]LWA%.SF7;ׯ~?m~w,pES.},3 aսu+hAex[[uFb_Ea"s{(hhs)qqKc GO!,6rOcلumpLSz7[fU͕Ȑe-ff "`.s>=~4h$ ?iҘOm\ yT)hHlrolg2凭hPsX]b.֫3[7wnAlK8@Oo!s y0`szb.wZւ`-j͆uŐmY:S5,y=ϯլ}0*=M~ 34V̻#N0eίMjl@{/ m{;xbR텞Kfc:~yJSqɳpsb^S 슏/7lӭms}>?ʁr`M[Vc=ձ׃QӝHd?e՗L҅׮Km_w&&x9Ζ!/N'qzz$=%sklݍ{/э{gΰSU]+=!usv.ȇ׫4te^sx:d ) ِÐ9'wh[ȄJBJe()zjn'%S>gJb%ggcj%PDXr:H#(V4i>X!HHDrҕh&#aIeyMyȕs, xAHds Ԕy:urr mm9udN[~9A(_G%פXQE #yXyZY Idv cPxBsibL)MH{SyNVɜ[RjY^6tYCzz繜uk))is>6ɟN۩[ -W_L% 97DT8Yi) Fi  3 JIJٚ dO9'4 zp_)AEɡr#[#yKqGL]yM*wiI>Z\YkrQp1CQj٧~|ZZ5zT%Ivvʨf*yiilu zJڑʞv٩*j7 窘xWq:k瞇(J7UB%mGjw٪p I*jW%zoJl|XI#'uvhj?ڦvѠ;IߕuQJ} zJLƙ- j}ڢ@ =hN J:Yʛ#}z8K()ʺ-{GOGc:DZCjI+)ʔĺ;hZE噔({ ~ʩd4;ۯ+*Ly<t۵d ؗ* ėROu˦b y`KS[CvڳJiku*(xP c˷v;yCi۫5d/Ick:43n趬D,J&YY R;++ tܛ?⻰ZcwỾnI{7{gۿ;ś bK}0P|DAQpT$ Qab,.0/<1\4|6 ;aplus-fsf-4.22/src/html/APlusRef_ScrnMgmt_1-3a.gif0000444000265000001440000001650607215453021015261 GIF87a澾nnn,H̷'h試+Ǵ̎|߾pH,Ȥrl:F&mVجvzOF4zn8|.<~m :b:589iJ@_HWGQcEFHGICBUAȕK;өᙵE>ڑ=A{ۥgEL (0FH7˸ɓIƛ8DgPGSfoyO 2 QJӜ ӫXWURĬ`sRhe2]g4MH@pȍKwݺxeO_:}LÈ+^̸ǐ#KLˍ-̹ϠC}ҨS^ͺu\˞MȦͻoѰ NƓ+_:8У.+눝G{wËG|2xЏ_߾}%V 6ؠagVhfv ([*B8ߋ(4h8<@I# "x(h$|"Y}wTv\]dRieWc`5Fkiߙnx2ibwg׵T& :OBjpN襜&/v**kVꨨ雕jpꫴb*!֪dꮄr u+dGjW¦v>g*RZmj}^枋^img^bGoMKl%_;jz.̙rQ ȫ_{b_;3?n߰N}_;:pr,DPt9ePw$N]zRÇ0{/T`'P$ajh_ N+b0bKO,-:^\]T0/@ FpUQ\s좸(1tFQđa݂Gq+ h2|#ȲOSN%'DlҒɿuR6&!i? %dy5*'RFo,-b.h4f199Ed3iZӗ4U&_E!S%X/}S.q}iɻ@2sfx?Ӎu٬rў#"2j#?(E(AV-ije0>ZGHFLv+cAѹ&T&I+g"c*Ԗ)o ԉjP.}(9iԅ6eiMQ鳪өEqjxROU8P5W}R8SF5gX”n XrM, 40NRa gUOK̮ӳfRKϚ69[ζӜ2Y=migV,+rں޲{,m:=|RknayZz5M'٢QLuRt{b{2ec0T2/r/Wz7\O;4`4*o>"-<{VQZrTEa3#[qq c+r}l|D$3y*e3:lmb cɈr[Ɏ̽O-!yjۆYyMB5`9ux_;yv^L__emd"tni 8oKgV49-u`aYˍ3$r[]xn܎7kkᶸǶg=`?3.8S/qvN߲Hk1ai肻nd]scPvnץ򮎪Mfm{䫷 =Ur;ʃ ۵om+Wv/Kpf=G>gM%_۝rnǼ-˼rܵ_9sOCϑ]su&ŷpgm;>Lj?<=]v{vӋ-w%漢;Y_pʟ>็I?n?} _rO~Eou⓼K߼E[c?߾%WYʓ~vᇝ xoLoWo}_Vrflnn'@Ά8~tG>zs@m}hEHGgzgj3d;GUbHuU[XXHらȋMhhVhez{G茠Xi(x%X ID8zhtHw\X4ؐ|v(ȑ^<'&ĤH(~-izaŒ% (p/d(g6{#i葭xiWi Y5}FYXNI^iPFg99iD{=ZVw= jy՗ÓȈHh'-AnٖݨGߘji4Yyxa95iHUc9tYyybT(28ٌV)zɎHiZ$]ƛ鍀Kȕ_9UY*ɔO r)Y c&}M9jщIIpYdIiw ᩓ;6DE4韕9Hf[iuiy }9i9^Iih JZs٢G q)֣G] 4Z6z鎐)"kf9CKB">J٤s3`b:!rt凥Cj:8lڦBҚn6٤s5msaS?W~j-j ,zbZ+ڨ¨*:":*)⩢ )ZB('y'zqb&ګ|'3ꩄylb]z/&*ʧҩ$zSڬ$ԊZ( zpZjzjO}Knk&f ["r*opk#v}aZ]zhjO(Swڧ{:۰7' s4ZHOx[!#ۇ85 C䳠䴾)zH.˴Ahh~N1'IkTP<{Tۊzd۱*uF;Z;9gk|%~Ez`KҶ)i鷍k: !y w9 jG7c{s" ɉ ˭H*Z~CW9Kqke륭'S؟^ 룲MJk;Z{ j{؛?F*抏{qIKkg.Z1xʼ ˽`˾{P;ګ}I[|I˹82Kŧ[+t\%"\ ^Y[+Kï+曬¥l~N +\;ULɛPŒ۵ldTlڽGܲ<Û(I,ǂrֿJ\˳{LAR,/|UƋ^xtL?jÏ|?= {16ҨڻM*2mO1]+D8>7F>A=]%\ШGԘIȧL[ Ա+Ĉo }TVͻj,l|y@]3r8՜4ԏǵMȜ

O.ʘ٠}ƅf>=|a>L.N6]c͗9&Q^Ɓb>,~E9^Gzۊ+ N ʍЕNMgdg٣Gf^p*~mon<^[ζFD S J.#.@{NJ>Ƅ>͞AZNV>D&澘nC -G^d<߭> $ fN _~/,"Sz/*oт.$_0(J/I{n EJl28?5B6XN_PWD__&]Jn7V^tkOi`}|Mt,~|T~݀/Nj_?칮옮ݟNc-׫ߝ={y=r^m]^/enX.n-/ϾgROڟqx?R?t~ y/?~@A0)ˠ8ͳ%Bln,o=v{Wg$ +DK2.'EЬט-,,x֒Ln7p˯7CjJH۵Nrg~oh(jC\u4yc z}JHL!Um7|W;?k6t[Š2w{G0͛Eߝ #]^5U׎_[%$?sh"4-ZTM\8˗0cʜIM#IbʙɖH-, JѣH*]tT}S^iY㟖\i΀)]GhV<x$xd|f}I&Wޟro)vRi`i{v:Yz*jSr:<l!SavtZz1:`"k`*{fm!쭠 -M˚zꗭWVKY|jpɦKN,dDۊۨEcSK.wpĔBL_+{9,$a#,2֦ .cȎBK44ShR`OfE3orɅ8Ws2?| V ub}]u*yp6CLcuktCJvv6q5A=Ԁ/~7p:+rLI9C~Gyڗ;޶攛΃7炩: :G38G^N̾^z&'Sb.GoTֱ s׿O5^5Vݟ!?|q:6cZo[frKSt= 0;cwFl-X5pI/`_J(oqǹp1Éqa7 x2 EC=ٰFD!%y)Ė(OyX!iH3陱%aƅCсd|# Xt6EaEd-sLxER{DDrLic}6| oB%r'#i:H-r 'h4PVCXPl-Mql/L%"9LqoGM -¨=Ӗ:h$IW^D$]5(?_mB2sJFӜ*2`_T^%;MIЂ4DbІ:Hï:``'&E#$s@Z(N<)J6Q).mIcz&TL3)l-崧U)Pӡ2IF]RQ?PT:2>XͪV25y`XJֱh=Zֵp}\J׹ڵxU ׾ `KMb:VXXZͬf7YճBDG+ҒM0-jWֲ-lg+-nַpK=r;aplus-fsf-4.22/src/html/APlusRef_ScrnMgmt_1-3b.gif0000444000265000001440000002562407215453021015263 GIF87a澾nnn,H̷'h試+l ȤRY\:ШtJZجvzx,Ulfmn|NZ4~zGzGAC!WxvpkTSiVgXTxSXQPIQ pIʒ!LpC6 >ȫh܇_ DT0-F2Xl#S-O s㻛%gt-F]hr] Iϗe\6u@h%ӫHj~ъخ;Ev2T!7%Z,6g3L\U*$W㢁ű˘Cr&̠Cˋ2eQANzְ_ˎM{L`qwʭG Nȓ+_μУKNسknËO+D˟OuϿwh&(~ 6FHhf v Ga$hq\b/(47s,c5穸b:#H&$u7:wD.)T'rPe\v $)c elp)tix|矀9` `衈j&g裐F*餔Vj饘f馜v駠*ꨤ i`$z(J͝y$!dZ1*(iZ̞+(:(H[;@݆+.곇㦫|Ϛ{+oyf]ܫ;WoBlL7|0*g/Ҫ۫ ,7k1+,q$Ϭs,21,5w9EI/-5[QWbKo5[I)_vͶvGg[-sv7w=Z46Mxuq+8U3xƗ+hx%sn~ߊ:aς;}5x[My>פ|{y\^;˨||8};Kvw/~ۏop?zGLk HRK@.pTK_35p) M6XBG@E-vA!H(Pq`A  f~!b}L!m>ls%-2Chj]4A*NJ¢sg_<BiKw1ƐGvEr $}Ƹ2 RKPEҏuIeb#HIF"&H4#d)(L" W칲w=)CHR#*KKVvd#-˲2|3VMPdE4RBӘT*YDdl&Lpgb9vbx(aΰ)O 9SNA *k*T>\ -ra[n/ln2J7U.֡.oXD9ɻ[vkiiIzt׍(xPB^vRN+k`W/f_pe 3 +3\= [s#se;WѾ40bmnW"n crx'0ئL96j٪Wּ |J] Àm2>Y<'/8ƮQQ|f#c.aXWU=ɳ3 ݶz*VF9`.P6f;Ϲ40])]g@?gʱit{+9rz95$CciAt Zrirޯ}MNe5ZZw6镹e侯 nl[Ƹ,NCo, TMcV7]γZM.ܣwW| nCN2}q<Ƿ\Q.sf6cfs>5,!'%gr@oQuB~:{o^xO׻~lLW-ܧةUhs-פrG9w/wA@ NݻTxNͩ CuO'Y~gO^~=qHاck߃>;{UW?{[|[ Agw}(o A7<~ 'qC^?7}r!`s}!l cG (!TxH>(Ht w% '{w d-X^hz5-7؃ m*,H(@s#vL?8MGxf`wn2U:{KH-P=7VFt5bHX^hY-rH#tp~{Qܲ3ׅ҇a*+j˶ڴu7Zw[TGo˲I+m) +ۭ蚶8Z;T멑OU;4ʵ_kn[֪&W$8( Ҙj+&l4cR&ۼ(;;8k4+8拶{>۾Ӿw5 mzgMƹ%-kBn6>HJO.^׃K!T^<`Ro.q_^X^p{0^nrNN>>}E.N<<盎n$M.VײCt `]Yw>} l}f>M 1Ѿ.kѭ'hɭM-]"x} +-@K޼ ]]~gۺ| /n oK>5u"]P~3,*m^tnD6N ;$6El]W,N]'(G؍?4?fTVo]e7vn[zkt N/qBRWx駮{]Hw?_pս@ڊ_K|?@PoΖv*JtO7.}lIY:ȿ6i.˟떎o`jM_L۸ Oo?[/+ŏd@\I^҅dibBleEmx|#G,Tvl:IN,6zx6(zn{N]~ǣjZyKba_d~[J*VDq_.$ u0)%(ȴʚ^.©Bϱ旉`u @*\. `E/j ՘l-jy1ƓV{rdF{!_60&ʛ:Ȑ$EmI5eS)ƘDөBW&*tGmu9VdFUX*ڻE[rٯeK ܔq)퇔Yr1#sĖk&wΨ1r18`h֗_VY+uq⿓ qhƹVN}jv.=zn )CdoMW_v؝y-A:VtW _ͧOiN_E^QwBX`!2s'8(g"cq'߱'䍄]cf=Ƙbunx"4R$ 6"h%4KZ$-XYpa.Dz^;Un!&޽ ‐B s+S[ŏi[>Lp/#3P@ܫab벺 j '[+Wt,Y7 mB#NlaH8W{k 슜P Usll[[7zvE|tI~Oz]8\Swl8{;K޹fnE1mFSTܰ];m~/w_yü6؜rN<ԡ-ȯyOOy0;f>KZ |sUτ҆Lp&7i盟g?i;hܡc\Q=)0 \_ oU3-&υ'RAsdt,5ca Ú Sׂ7A0x8D |hoD"!\,Ʒ )> uKDI0lE!QBcC?J1zhj%X9JP|Wt H$*K\1IV"Ҋ?b)mIXn:e8Eg,$&2WSjͼiQ&*71*)NAqH,FFSD4IK-j>с+=ݙ5'@K1gFi~7/ŎFk3Zõ]ns,C%Qj&i@ YGEiO!z16-Fef(>$[7*UZ'RJեW*;xʓϬZjǩ9YfNz*ThTռR)VCʑU5(3˰'!eXPιD}EAQ7yΕvl4k #.ծ\i+صbϲmCTVSamW)+Ymn Y.ծ.hYJ>nz▨|m+[Ά74+ԋ>ou%WŴd]bފ7 0<;{=ks{`7=\ ouT쭯{M $Zb=A5^D;3 \?ҪT4XNw4=MjiГqWBP79If5qPͳu]-dNy} bYfr$n%3vvk#X>vIdms\@2AUآw {ݷ"\?p&ݚ3m<2|mOf=~{ª,/v7`py%V)|܋:ASGrJF>/u[dǛ)wp>t3$ CLW}Z8x3:#gG{г${HG5s=pn/2LI8ߴy~xY7~XCg8GGf{LCN{}'o!xcgwvz7adG~}_"7GM8L;6~S2: ؂"z~U}Xz751x0ӃxxUK_&([7h_@eLXzPH|4380@6~8y x3mMW\ǂˇrbAG8M^v8a4pvrtu|x<@w_iWF2H8wWQY{}9(Hf(gh*h~~uhz8O(NJSumfXvUi0}TOgm7~|ࠎ}@5uH(FZ\(3R8G]7h(T&^5XhV+H XƏ[m؉ ȍ}R+4N-007 [,y.IH$+|DLNAsq5xbexd=0^ `b):cF<T~d. tYekYц|tgrU >H:I{ox+~Rif)>`X%!wGiԘ8~UٚMQg9H9i()|Ithq4{Yih})NBMpui眾zv@Inj 隑iəi_鞒ـJ#i$&mڈȜכy!%$Wsi\;`'ryxEe99-SxzفY!0n* j )i FJKڟ+z-j)K@9TZ w8,zYfډ֖Z8Rx1:# sGz*{M:!#2IY:z{yXzgZ* JǙzpYeڨCG~C`H~va/ڭjlDZeOjj|嬂j `JXũ}vB*Y⪩ٜiE  Eɚ#f:,ت$Ko3.˧SJPZ|@; ;0=;GK({xO[6{qVS^V۵)Ut[Ikbʴo| jᦉ۷%JbB 4M _ѶC;<&+IDkT ybɸ[w{ t+8{xHkkkҺs{K+󺨻 )l'˺|{by˵N[;QK<(I):~:[髞˼Fa^E:hʶы[{[ڋRڭ ⷕ<`e ~\̖i L+ߚ-Zr똕$$<2<5Z9|[r ̰eûĞ:jU J]Vt*[̅e<CЃ }k/  }W}?)]pֿ0];LCy'=a1AH : X,ҝJ~|]'JMemw[̜3>EXhŞ):նS@m:lYF|M}tqiK~Հ*+Ii-kʆ-[`m%ݍҬV-XҢlkL/rg]ZlِƤM<ՅA\mu-aV ۨڞM(lM;-ܭɡjA?=ݻ݂=ߝڴήݧ}==M8)) Wݔ9݃{H|]N]Iϗm#=]םI ޘ^ _ύnMp]=-ہn1N3^y,ԯ +ܜm}#}F.>PM۶|O\^؁?[Ϭzڃ`Nj>ev砝zNfMrtVkp舞/*t), ]NT,+N93Nbswꮾv겞y 5붞~~+.A®J>7~žξ4ҮN>^~ԁw^~x>^~?_ ? "?$_&(*,b !/4_68:<'o#>@F_HJLNPRT?V_XZ\^`bd^h?jlnprt?v_x ;aplus-fsf-4.22/src/html/APlusRef_ScrnMgmt_1-4a.gif0000444000265000001440000002023507215453021015254 GIF87a澾nnn,H̷'h試+l ȤRY\:ШtJZجvzx,Ulfmn|NZ4~zGzGAC!WxvpkTSiVgXTxSXQPIQ pIʒ!LpC6 >ȫh܇_ DT0-F2Xl#S-O s㻛%gt-F]hr] Iϗe\6u@h%ӫHj~ъخ;Ev2T!7%Z,6g3L\U*$W㢁ű˘Cr&̠Cˋ2eQANzְ_ˎM{L`qwʭG Nȓ+_μУKNسknËO+D˟OuϿwh&(~ 6FHhf v Ga$hq\b/(47s,c5穸b:#H&$u7:wD.)T'rPe\v $)c elp)tix|矀9` `衈j&g裐F*餔Vj饘f馜v駠*ꨤ i`$z(J͝y$!dZ1*(iZ̞+(:(H[;@݆+.곇㦫|Ϛ{+oyf]ܫ;WoBlL7|0*g/Ҫ۫ ,7k1+,q$Ϭs,21,5w9EI/-5[QWbKo5[I)_vͶvGg[-sv7w=Z46Mxuq+8U3xƗ+hx%sn~ߊ:aς;}5x[My>פ|{y\^;˨||8};Kvw/~ۏop?zGLk HRK@.pTK_35p) M6XBG@E-vA!H(Pq`A  f~!b}L!m>ls%-2Chj]4A*NJ¢sg_<BiKw1ƐGvEr $}Ƹ2 RKPEҏuIeb#HIF"&H4#d)(L" W칲w=)CHR#*KKVvd#-˲2|3VMPdE4RBӘT*YDdl&Lpgb9vbx(aΰ)O 9SNA *k*T>\ -ra[n/ln2J7U.֡.oXD9ɻ[vkiiIzt׍(xPB^vRN+k`W/f_pe 3 +3\= [s#se;WѾ40bmnW"n crx'0ئL96j٪Wּ |J] Àm2>Y<'/8ƮQQ|f#c.aXWU=ɳ3 ݶz*VF9`.P6f;Ϲ40])]g@?gʱit{+9rz95$CciAt Zrirޯ}MNe5ZZw6镹e侯 nl[Ƹ,NCo, TMcV7]γZM.ܣwW| nCN2}q<Ƿ\Q.sf6cfs>5,!'%gr@oQuB~:{o^xO׻~lLW-ܧةUhs-פrG9w/wA@ NݻTxNͩ CuO'Y~gO^~=qHاck߃>;{UW?{[|[ Agw}(o A7<~ 'qC^?7}r!`s}!l cG (!TxH>(Ht w% '{w d-X^hz5-7؃ m*,H(@s#vL?8MGxf`wn2U:{KH-P=7VFt5bHX^hY-rH#tp~{Qܲ3ׅ҇a*+j˶ڴu7Zw[TGo˲I+m) +ۭ蚶8Z;T멑OU;4ʵ_kn[֪&W$8( Ҙj+&l4cR&ۼ(;;8k4+8拶{>۾Ӿw5 F=<5cH $J<9>IJRtQ|=B7܌\{%d,>c|h,jl|iƋepG{T 9Xg~)ʸшR(mw݋vWC{~,\Z^̽$Y9FzydYl\ɜ^ ʓmAʛ˦p;'LKʚb,4+{{Ȫˤ+'{ uV LNl ͎L[{ͣɧl܌L̔LL+öL̸L\{ Cg %݁4 @Λv щl"3H hރe컢\ψɒ<ҧ͹!F =\$2}.LA=Z?=4g{,:lU9T\R_ a7 e=Vi]Z 1:kfsuFԊ\ҡ΀}P]-}ԄL ԅ̣, -o WY cs%їؒYj=}z՝tɪt t-֥̈́I~؏J")+ܝ~ }mBv ͆=ݻ}N'ݶO-M-F˭<ΪÚ Ґޚ=mMځ֍+=l4mNx|6,)]]v)0.u<;c6~3-*<5B4]H>A{DN>3GT}UZO;C`~VM>efe!#ln5jk*t.vsAx~}>QW$舎>]twƒ^G~i>~J1nIׁꝥ갞}^뺂㺞_>>(n]g.?/-^X)!Ѓ [׽ߙm8d B҇]|.$nmخl?˷m-Nbll.el^ ~߇o>Q' >~@?n|,2?튍 A\eFOUӋٺG KMp0MZOi PmTO<6 -86qsLq}y?r>v=o OEl?[?E=go_<IS[̜M \_f߱_n׶_ [?]Ν@028K7 B(v^lp,(s[T\r#G/ Cx?*pES;8lȋU7;iƫ”5u֩ąߠӄsT^bkG띿x  JeMDdX8#BIɓ(SD D0I͛8sܹ`FS8HѣH*]ʴiS4JXjʵׯ` ȷѪٳhD-F5۷ogI ݻ_rVK4^x^jmK\KŔ3kf761͠CWOӿ:_k_M;cs~#._^x̣3^;NY_zi7gWus< H`q|4`uMN]Ϝs r~l8az!d&he")q {)l:ZЊX_B&G^1^ P9dRCBcϒ`y2.$VfCN)tTD&`矀UKgj '?(ExǗy⤹t+6%G6;+k)3έL2?4F{09G95U u^ =-WO.Tz |+"Kr1*+`t᰻}-]3kosmNx f=6ٌDr3eg.zK0K~t}:겻L;>zo{@۳ m7OxG 欬'H|u^(տ ~3O~Ҿa>պp϶XwHF@OrˋPQִڄE,} ?NTd4Nm a$FxujTa ńKde@{yI #jDsSg+^qxߓ)E)sZ#hqzj346.r|ʆ!gz4 FrR$X;>u|$]j̛YI2{T)v bp%)I1eHXJRƒ &M68RL2e 4I>O4벹 yqSC)N!':suGO;ixs='x䳟'@ρFGNAz29 }hp*QDvbl<8T!Zh.4}UNԤ,Mv": \OO= t`UJgSAESWrUY)ZuCѵnL[u:<]o2 HR .nRMbAe%G"R'CT,cVa$ĝr\UMKHϯ* O?cB_.U1?VV5d}{LvVõZlV_clXvdy\փ}k⏲j,+KR$p^<&ؿ~3,K{[p^+auj*q=M͞ŭ.eVzmkw`ͨqU,HG%e=ESJda g;Jev^Y&v)PQjwCut)v}}[sٮ6q.fzKE!>mO|n.w Pp7v{ Ӝtm݊csXWK:NTomMCҗ'cDs|oՋc!{ϿO.=;^v¤ua;EvK~=.;^.C;rLJL'O[ 7{={#sO=Wֳ=g/=w>/|0ЏO[Ͼ{OARO_ 8Xx ؀8Xxx! ؁"$8&X(x*,.؂0 ;aplus-fsf-4.22/src/html/APlusRef_ScrnMgmt_1-4b.gif0000444000265000001440000002176707215453021015270 GIF87a澾nnn,H̷'h試+l ȤRY\:ШtJZجvzx,Ulfmn|NZ4~zGzGAC!WxvpkTSiVgXTxSXQPIQ pIʒ!LpC6 >ȫh܇_ DT0-F2Xl#S-O s㻛%gt-F]hr] Iϗe\6u@h%ӫHj~ъخ;Ev2T!7%Z,6g3L\U*$W㢁ű˘Cr&̠Cˋ2eQANzְ_ˎM{L`qwʭG Nȓ+_μУKNسknËO+D˟OuϿwh&(~ 6FHhf v Ga$hq\b/(47s,c5穸b:#H&$u7:wD.)T'rPe\v $)c elp)tix|矀9` `衈j&g裐F*餔Vj饘f馜v駠*ꨤ i`$z(J͝y$!dZ1*(iZ̞+(:(H[;@݆+.곇㦫|Ϛ{+oyf]ܫ;WoBlL7|0*g/Ҫ۫ ,7k1+,q$Ϭs,21,5w9EI/-5[QWbKo5[I)_vͶvGg[-sv7w=Z46Mxuq+8U3xƗ+hx%sn~ߊ:aς;}5x[My>פ|{y\^;˨||8};Kvw/~ۏop?zGLk HRK@.pTK_35p) M6XBG@E-vA!H(Pq`A  f~!b}L!m>ls%-2Chj]4A*NJ¢sg_<BiKw1ƐGvEr $}Ƹ2 RKPEҏuIeb#HIF"&H4#d)(L" W칲w=)CHR#*KKVvd#-˲2|3VMPdE4RBӘT*YDdl&Lpgb9vbx(aΰ)O 9SNA *k*T>\ -ra[n/ln2J7U.֡.oXD9ɻ[vkiiIzt׍(xPB^vRN+k`W/f_pe 3 +3\= [s#se;WѾ40bmnW"n crx'0ئL96j٪Wּ |J] Àm2>Y<'/8ƮQQ|f#c.aXWU=ɳ3 ݶz*VF9`.P6f;Ϲ40])]g@?gʱit{+9rz95$CciAt Zrirޯ}MNe5ZZw6镹e侯 nl[Ƹ,NCo, TMcV7]γZM.ܣwW| nCN2}q<Ƿ\Q.sf6cfs>5,!'%gr@oQuB~:{o^xO׻~lLW-ܧةUhs-פrG9w/wA@ NݻTxNͩ CuO'Y~gO^~=qHاck߃>;{UW?{[|[ Agw}(o A7<~ 'qC^?7}r!`s}!l cG (!TxH>(Ht w% '{w d-X^hz5-7؃ m*,H(@s#vL?8MGxf`wn2U:{KH-P=7VFt5bHX^hY-rH#tp~{Qܲ3ׅ҇a*+j˶ڴu7Zw[TGo˲I+m) +ۭ蚶8Z;T멑OU;4ʵ_kn[֪&W$8( Ҙj+&l4cR&ۼ(;;8k4+8拶{>۾Ӿw5 ļ#ž#hW~DI:lN wqmYT&ԁ0/kNE%Ň.%d< CMē}k+L`^tO'3cm~i-kRoK" g>܎Em 6ٝn㺮1{@x6ғ gjXtMd.'N@\M^,5 >Ί~^( ? /-߯ %~#!o'</oj U*N&*H lXR'Ɂx !zNځWDӥ5/tG_iݲcIAil3 $UOaiBaO%Y_j$8/lm_OOo=)@nd),C=itլ'/x9uF죞ǥ˻L㏞n,P._?oͼ:^,_Ll@Е857 B(vlp,/D0: x$E:Шtbz ,z9* <2ߴz͖uhm-AөoqT"ly@Z;nvEJe'*Vv:+`d}#`- c|Jw {HKBUŐ܍~蚢Ӗ֑Ⱥ7 mB*\ȰÇ GnǏ CIR;fE宍N=8W2ds MU;h4cnӣ $OdX>JhD &^\Ӷ /ڻ^KFڄ8hy$zՕM K~V߮VSɠ{pymffMJ:=sY]뎺!bE:y6ȣ-K< P ]w`H|,ۃ[-]O_o]*ٝ~`p%NxɁD9Y{w kJ7>͝"!cSqxF.B"h<`((8_qV#Df$y%MHTvyFewxEƁieTr՗\~a^i+dahHaZאzhJ(DvB H#NbhRg V%m*O^1'kNZ떇u뮶&gĢX,*ZcB lˎflriVc؎[~HdXf~֛.3;>u!,sp KpBKK>9(= v21:e0, zV+;<@-RFo {4O:q +M5@M|57^+Vn]Pvd3(=ĺ7w-w72uގY5ݸww!^)9'ݕӀ_CtZ^~.ʦ9n^z.yδKw.S<ּϥzGf;} \Oʎ7\}ݥ?] iu;GդO;^NF˯FL+j E+)m˕xp G.WUpU&8 r-`[]@BA˄c AU' >< $! gsh(EJA qCqx5A+B1IR MV4"rHb\{I| +bs& NRT%7J70d[*˒V@:Rς)GhL. [2-3L)DSz /9IJfRH<󮉻iVY;s2 /m&m 3idRg:6ڳvq8iZ4$8OhSL,w{na !y側 SGь" #CEtw+,ǞL>u:g6c_t~"Ljƚjt(UHTLjVfwXIO.R-GJZ7ѽTM!:3@djRQWد,\*>Bk@)J^6]@Uڱώ2HjZM6whU%f Q2^Osn O'&",n-ۗ"z].0\˦SXؑўەpȎWw$n9Z삎=}yYz7s!;wt|zK/ެn-ƅs{`TUcN (mm',1Ja 8`EÊc`WB0Fqf_'^hU <4GdYJ^2= ݖ,&r^;Yaֵ-l;I3qU7\~2|\8eVpwAW t VΓvgh:kQ6SGFڲPհ~QyqchָG=Nc1F+hzd4 &g ]%k+nR[cFC4uB76o;ܐw}{mhgzo ;6%{|{'=S̏M?7 L>HmwN`yP~P2Ss!®'L+=BڜK7ч^\¯{} ^E7п.ρ~±xxDpv7)ڹ[&9YAxw>'OyR9}O4tҀtk]ۜG &xMiu^T?YI]e<]5;\d2=ʿkqz|sK|c}ӛ/~)N?qĭtY%?Y{Z}@|5w]l'^pN'HHwWGwX xwz6cv|b'#G]8X~ցux1cx\e|}Ry>{H\%xUW~ y~#f@d2ggWb9ՃizPw|ܧɷ]_އ}P󒂅weE^&Bh{Dy?&sI yVzyhb׆gS8n8~?hHaׄdEM]$ai(0'yxۇTh!efxB{,2.8.F 436HGlj8ڴhgI؇zyڨX˸6e狹UI!6v>}*Fe脲^}hg^jXUJUx6` وɆᗉR{$Yf{-d7$Tg8k8q晴Xɋ Ik?ٍC֖xz0|Y3tYy#,٘V$"]>c}8+!Й߃nL7ɀywz5 w隲^YI9;㶛if}^y&,ٜ9yؙڹ%9Yy晞蹞ٞ9YyٟٞqZJ ڠ:ZzڡڠJ@?A!&z(*,ڢ.ZY`8z:<>ڣ@BD:FZHzJLNڤPRT:V!PZz\^ڥ`bd:fZhzj* ;aplus-fsf-4.22/src/html/APlusRef_ScrnMgmt_1-5a.gif0000444000265000001440000000373207215453021015260 GIF87ae澾nnn,eH̷b'hp,zﳿE* ȣ2\:ЧtmzlY1Nn#3<\akm/{J>tbbh:.9Y`f|m)=z+v`~4 z@wu;7 Vǧ2Bmѯ>j䕺cynбl0.e'gS"VH ĉT*>tǏ CIɓ(SZ˗0_͛*ɳ'Ι(lIf1 -4%I6zhMT|*R`F+X\([,S0~gڱ! ^_jÇ^ǐ#K<ਁ3kάX͠CMe+e˩e逗[;krNNkxyrƙ p;ԫ&v׷yN{䛆_>}Q9ڻ<᣸f7~''og %(]pBHUha~bax܇  bۉ(]=ExGV_͘x[HakrX8^FX#{J6$4>הA>i_LdV^o-VbO-瑻o/d?[!jp*knz6$*Ak{X2k:s$o4C+3Gr/4B7쳛R4VZ`I:dMYv@,K`=MtP_SR]m  i7)iz4a>x,aڃyPi)u8>x* >%qc+2b#ݺZQ'b~jWϾ(n(C7q~F4S(Il,"?N)p"!ym\!C 2{~,d)Œ&t8MN gs/#vKNRYKR0@,"#QVi\"3~ (-GSQ,*ю31!.ӗ:f9#H8єN|,'YuzҫKy/ ]h1MZ^ldfA8sh KRT3:RZT?uY.iMw0*@TO(E򨐊I9:FSjKZw.Tf/I*5TZm<:P4SլVEkN'\L l&'c*MnXJV|\i:If_V{N|biEYT巂Ζ4\`ZIV1`o5VLCCfQ)_JҬҌs0mv©xZd;*G޸5`}~ YJ7%J/J_䷿tl9\$=pb09;ŽM#;W օ&Nl?\|;#RFp8#=,d$;aplus-fsf-4.22/src/html/APlusRef_ScrnMgmt_1-5b.gif0000444000265000001440000000464007215453021015260 GIF87ae0澾nnn,e0H̷b'hp,zﳿE* ȣ2\:ЧtmzlY1Nn#3<\akm/{J>tbbh:.9Y`f|m)=z+v`~4 z@wu;7 Vǧ2Bmѯ>j䕺cynбl0.e'gS"VH ĉT*>tǏ CIɓ(SZ˗0_͛*ɳ'Ι(lIf1 -4%I6zhMT|*R`F+X\([,S0~gڱ! ^_jÇ^ǐ#KL3kάX͠CMe+e˩e逗[;kr^Nkxyrƙ p;ԫ&v׷yN{䛆_>}Q9ڻ<᣸f7~''og%(]pBHUha~bax܇  bۉ(]=ExGV_͘x[HakrX8^FX#{J6$4>הA>i_LdV^o-VbO-瑻o/d?[!jp*knz6$*Ak{X2k:s$o4C+3Gr/4B7쳛R4VZ`I:dMYv@,K`=MtP_SR]m  i7)iz4a>x,aڃyPi)u8>xK>%3~ h+Fķs!C {/{N84DxD0~# ؾ>:1}]H? .l$T"J&P,$#B@fo`b28, ~+7>E1MKR6)1;&tSP'&tilRHlg0Dk NkzB9]Iiӗ].ҝa9}/5AaɆJ*zD!Pid1ߙhMSPl%楔ffKI!d.J!8%Ti,*?F*G-h9N7qu}L<7{oMnzcXcE_YSW}||`mNdp[˚|tbbh:.9Y`f|m)=z+v`~4 z@wu;7 Vǧ2Bmѯ>j䕺cynбl0.e'gS"VH ĉT*>tǏ CIɓ(SZ˗0_͛*ɳ'Ι(lIf1 -4%I6zhMT|*R`F+X\([,S0~gڱ! ^_jÇ^ǐ#KL3kάX͠CMe+e˩e逗[;kr^Nkxyrƙ p;ԫ&v׷yN{䛆_>}Q9ڻ<᣸f7~''og%(]pBHUha~bax܇  Xӑb)҉h.x5X#= IJ¨`MHdwPFVd?v(^Yn^b9j.9ygFf"Iegv9d~s:䃆zThҹ(oƷ:Z~ yxOš8v8Mfެ YŪ[:\Ėk{ &Z׵V-VelSȆ \&+'>+dナ/^V\e&!D1O +cĘ w>pa2!lȭ\'3ȩLkմmlsȊ~rC_4-=k0L[]5]wb?\Ǭ=2[O=Ð]tykGuń۝sR ,rk'i}qgdI7^\${/uv~hp؂5s7z={ Z|gVWM{X#{^WOe띾sߴp4w?r |g:yn~@}/S\W>a0xAAƄiF@5Ѐ+@>v/{GCNЅ="pڊ(:EK Z,N:b}(&Z:d/p}fBUHGä,G͸cFUQġA[%1*|H)uB4^x\#rSCq2:d)qI@$<)HX{% ;IH-e҈-&1g'8j\B s&5FK$~f5%Q> 8W:oF*Ά33SyFSmjDf?YN}pf>0ڤ>9:Zz1>z4{3(KxtFp5dBoYP٩$8OzhOdK%g"N1T<٩[E)!uH 'lJ^tYUPZsxZݪ?wҥ”N%JRjSQ65,*=D [.gղZNJTޅnv%DSruRW x}*ҿJ6|wŪf'YzbMmՔ5fE:Ҳy-i.EWZ,X1g :aԪu-IX4I]h"tCdx4NevNQSVL)- [r\/1SU6]9kYv٬)5Π,+= ]s\g9a6]fEiv!&yq)]hMӉAhQ?ԑHX|Y J(zif୷k^㯟ld[ʛFuql[ٟ.g5N݅ns+AB66!!2HMyۻvB;aplus-fsf-4.22/src/html/APlusRef_ScrnMgmt_1-5d.gif0000444000265000001440000000674307215453021015270 GIF87a2澾nnn,2H̷'6cfjF"tm|pH䊳 D:ШT$hqr0x,.4zn<>\S?@Xr4U?S=<~~VP>=JDL5C>7;[qCTůĸXʏ6Ԡ$8ػs⷗ڦ}; b]`YzOQd=CtnA4J\nZ S^<FpT,"rYI,g-r6w %)o(MtӦPJ=#իXjʵׯ`ÊK٬ $9˶۷pICݻxEp޿ JwÈWǐÌ\ΠCmӨEN髩WLmigۺl6;q (_Μy]KNسk}O~_˫_Ͼ˟O_~|CGng`tj`VeDxV},AMlmabY+([ք)#V46c>ǐD5H&/褒 fHCSeXf(zTc( n~l&IXBI bNNI+)KRĜ.4W&Ӛ0eY*zT_VNJUnkģsr\w- (|F9FZЛlKfΙL4ј:44|f- 8#RS:IX>- B=*ƽǓ;EscIEĶT0ݜp`S!MYhKH3=)STS y|ьT5zP_fqcjR=ձjU^'XZTnϖf #Z ӹ5Z͵͝1m+YWt_*kWʓ]Na/:Qծhʩ@GǦ5RgYrU&(qZ2r]icٖԱ#9AJRְ7Vɶn+[r=*FN=n_e3]>sU;^gaKBfK\U$SzDv*ޔVakJ pdiBZnHgb.6Vm[ No]kmWTC=AbF3pMZX%uc660^oc?8Hꔩ(w5`czdǘ97;Kl0/;<[ +_~1vMKfe ksÒp-8Pn]KKYI&+ۻ%ʟ~f%;:2L6Wt3g̊U}uMyʒLijMJ6\P)Ys[T'm>qҏiy-]lǟ̷f!PkоUqE l 'O}톃t.Ռ ء̽+Єqpsלnuy@=MwsN>rR1nf=)mڤ9='7:6T yCYS[oZc63$^\?س~sgV<ݽs?K.#ObE?x]^g: !=sY5?ʻk2׎:yL~ƧsAjNbo.-]X?y_em䩷M?կgyr{Q|'goc}WFaX~i7 (~dxfz gvuPGVvr~8+ŁH~tru|G}1Xw7twkD(|FH]A6xyXxwa#3|6|AhqJȃ^H*8RtG1 lircH*x3VKXf:B ؅t0V}ԇCHNk'uQgƆR'·zrv%Q XMb"nV88vW7]PG7NZ,"Lw4؉ˆ S{H((LZ)lHy؊K(+ho(Ć+8qXcv9S}x8HpugKHH2&Z1^G|Mh5ؑT$x8f^T FTҐv=ObԎ8C1ymDǒ(U)lF3ה(6)#G<"|I)-Ȏ:XCʢwy=inQa9c ^2iF|1ɗ*nx\ĖI{sوɕ9V)C鎗ٙ'iH&٘ɍoəeyrqO/W9ha458YG(%$k8>Y?XhC'DHdi.4ΩG9.S81ؕ钤9+ٸAso2F0iCO{Yk#$ {qOY2m_ ZʖЩ76u ,ydjڡ¡ *:#&Z,%',c+22Z'D<ڣ̡|B:1{HzJL ;R(1RH41X SѥQ^`:SAf*hzjN;aplus-fsf-4.22/src/html/APlusRef_ScrnMgmt_1-6a.gif0000444000265000001440000001225107215453021015255 GIF87ae_澾nnn,e_H̷b'hp,zﳿE* ȣ2\:ЧtmzlY1Nn#3<\akm/{J>tbbh:.9Y`f|m)=z+v`~4 z@wu;7 Vǧ2Bmѯ>j䕺cynбl0.e'gS"VH ĉT*>tǏ CIɓ(SZ˗0_͛*ɳ'Ι(|z @ђ$ӏ@O%jSZ5U@֭NdZ*Xm-@Q1]gךtʭk˼sjÇC΋ǐ#K&˘3cV7ϠC=2a0T-ئʨS-uK-e:MnËJr傏7z]w[?+[oj6;&zs=yG?MS߀1xāFi GYp FR haO 8aX!%u8bOd`+N8icxb]mE'cv;nśV(]7xAV$\O=ٚT:5$J9݉8՛[Xȡei&JefK'#guw )٠jhaQ裐BjY u&jrJ@Vg^ ]z٦^V*8v+lzZc}oKlbq㤬j\5-2!&)!Z.Z*6ZW>[o-+ V/K֨S"۱c#nl^b ݮ sD`=Pcrd_/7hu m4mmA|4vy 4:7u8\u= {{ͯŖv˒S}{/8#-{tGdz9o ;>8о~kn*s 9sFKm{_|ٮ3yxO}pCbŕNC/7y4#~߽۹~~ob ?TkK5?=~< <szsl;΁LΓ|# f0PgX$B_@ =C OQ|?.wJtzGëb~[^)DXR;,Qzx1{@FQz!呈7˜?>:gD'DfmCl'6GnL`$i FhtZ"ر8{$ICiMNS#|F:|ьl!Kl%0iGaR;Qɔd& yWePԄ%IYCp/!gWPdY҄df{b.LE tf@GW6S &7KQ򢔒-EɎF꘽FCIQ"s<ɃM0ubK9s.uIC,uf[UTCjUݦ>oTt7E芺=vep*dFs;8K6u5*DQ>bq/=; y>TW\?iW75$F0bѣ% H*RnkAղ$XjYdu((GشZ3YmVE;ZҦVFd2X5fE_꧰L-ټfA;eܬkOχFgAۄ0lo{ɓ^w%ntYM5lfn]y~7kt;f$Upk[Ȧun571.vwaƒIi</va2CKx6n1+:h{X8DŽQ(ZhȆ(hwxv`26CXw$r*7w:',sFpba;Cts-V_&''mrg+ZxVv㈜lfw.uˆr4'p<2wȉt16'$p#3K{Ȇ$%2)E!g)bFio8sDLYɸkͦ{2h`ŘmGr@g,jchi{b|*ǘ#is8uE'){.Ihɔ Ś uwi)TQHrF'vqd~ 5ɛՓ% bnoęu7ٛҹs%hV @y0\ f8E]|ܴtƜ뉆?YZY[ 6vIIZXI6zEy]ԒJ9yף!zg*֞I,j(x5ڕ٩PzvheKʓ:?`OuN*Oh SxIJuyH.w vܩlyev}*}twI9xtxtYx h&TJ" 5thv(H\H|jzJ聯jʀʁ^㩵*Ū "J`j*JՊJQ٪5z>J`H*JJXJQ^z>HH*;JXZE^1H;*;Z/[E.1+3 ; ;* kKk~R [/[W!.#:%˂~'7)T/{?%82/⌥)'$޹)?kDU^3!ˋft6$1R3-~W*+k~U[WB(♩J)iR &3ڨ^5jZkj|{vRYʧH{*٦{ ;p5jHmϙs긁xKj_iؘMZkՕF8xt[NeG tyXjۖX)Dėk3gztuyqj;^ik˽ F9q۽;Xzd[[6kK{oc[;,hR%û[\ oDik4iѫh\:>fO$1 zVɿCl<eK , Lai ŹlĻM>_"|(̋6&|T\-,,vR0\À]Ń 18RdT]_.: l@aIp!~. ;aplus-fsf-4.22/src/html/APlusRef_ScrnMgmt_1-6b.gif0000444000265000001440000001226507215453021015263 GIF87ae`澾nnn,e`H̷b'hp,zﳿE* ȣ2\:ЧtmzlY1Nn#3<\akm/{J>tbbh:.9Y`f|m)=z+v`~4 z@wu;7 Vǧ2Bmѯ>j䕺cynбl0.e'gS"VH ĉT*>tǏ CIɓ(SZ˗0_͛*ɳ'Ι(|z @ђ$ӏ@O%jSZ5U@֭NdZ*Xm-@Q1]gךtʭk˼sjÇC΋ǐ#K&˘3cV7ϠC=2a0T-ئʨS-uK-e:MnËJr傏7z]w[?+[oj6;&zs=yG?MS߀1xāFi GYp FR haO 8aX!%u8bOd`+N8icxb]mE'cv;nśV(]7xAV$\O=ٚT:5$J9݉8՛[Xȡei&JefK'#guw )٠jhaQ裐BjY u&jrJ@Vg^ ]z٦^V*8v+lzZc}oKlbq㤬j\5-2!&)!Z.Z*6ZW>[o-+ V/K֨S"۱c#nl^b ݮ sD`=Pcrd_/7hu m4mmA|4vy 4:7u8\u= {{ͯŖv˒S}{/8#-{tGdz9o ;>8о~kn*s 9sFKm{_|ٮ3yxO}pCbŕNC/7y4#~߽۹~~ob ?TkK5?=~< <szsl;΁LΓ|# f0PgX$B_@ =C OQ|?.wJtzGëb~[^)DXR;,Qzx1{@FQz!呈7˜?>:gD'DfmCl'6GnL`$i FhtZ"ر8{$ICiMNS#|F:|ьl!Kl%0iGaR;Qɔd& yWePԄ%IYCp/!gWPdY҄df{b.LE tf@GW6S &7KQ򢔒-EɎF꘽FCIQ"s<ɃM0ubK9s.uIC,uf[UTCjUݦ>oTt7E芺=vep*dFs;8K6u5*DQ>bq/=; y>TW\?iW75$F0bѣ% H*RnkAղ$XjYdu((GشZ3YmVE;ZҦVFd2X5fE_꧰*.{Ф}&wvowGmb+ujGS\g:FJrvVg1oO) sRT5;0}*GpIM؃+Ho8BUxArlP"3gUf(g*hrl8Wqh&x[vfSCPu(ilkzƀk%5gl8k6Nixr$eL7eևwd#HGw'1f{gh~]ƊP!hVKF7h~O8WH[H'xkaFtfiLLJHȉĈ刎jheՈhB( WS}x^ڨ~_W؄xHYXk+r؍hWxِpl]riW_Xs.cDžmhV!hXz'cw2kBg4oy8P9XX1ɓm(ד;)r3iw&)o@9kwTMi``A8[ԥ5~G ' \/(LY;#iQ))zuy8?ɋ>8q \d47GXx8( yB8x鍡iMEi!vsəxɘYߴqvɕ2zj9jeHPٍpex7f)y%iZivѩә?<hy: %E7N)IEhuר0tbI_c7\f9؂@ȟksd!rIw#x {Ya({Hy/*1y3j5Zy79*y;=x?*AxCjExGI (KM'O*Q'SjUJ{'臀gY&W] e gJiJkmoʣqʣs u wJyJ{}ʤʤ JJJg{[*a&cʩʩ꩝j&JJjJ"ʪʪꪭ55JJ`j_jJ`*J*JJQJQz>z>HHJXJX^^׊HيH*;*;ZEZE11;;Z/Z/..*3|{TTRR[W[W:: 7 7 {?{?33~{8}{{~!{#;;~})!jwU"fԮ-q::kJf+~% cft林5[(l ^*B`-$j2) )0ZnȗiBd{g))J#K ,(wIu[Z([wnB(WtVY8_06_K@E{ߙkoig8ӖkXٲtxt[َ)(h٠HY[Iu]6kkkA6kȁ뎬ۺj{Kkϻ{ ˷;;HsH됾;{ۻ{ j6;tk LlkS%V9-/,k. ü[_Jˤ- ,L=ܿĖ7\i褞[lj1g_yP<˻l@ULgsTm Qθ Xmok~,uY9K^iȁ4{*V wđİjVL,PKÎlĠj1lhgvȈ (Z[ɦưƾLk˿'\|8u|(hy("i,̽L,[O•jR(3 MөqJ_=\̏ųb)Б|C+3X+~幂wyBv *" ~Q+]H) ){Td.JWKf:*jJhjnS5`1´IprJtjvx΀C_P]pA pA^ {n ;aplus-fsf-4.22/src/html/APlusRef_ScrnMgmt_1-7a.gif0000444000265000001440000000367007215453021015263 GIF87ap澾nnn,pH̷'h試+lwz p(,[`l:tJZجvzxL. e+o|N~ϯƹILQkKnLGFolZ}RXWKW|~\VUԯVYTo24'\CP;*k% 3&kƏ<: ŁN\H0s)Y$-sOI̿ "fѧsV jS":SVÊCVY us Sagv)R][ʶݿS-?REǐ#;m %^TuJrfNٹ黎k潙װ~-z۶sޭ7߾.8R(_μУKNسkνËO 9Ͼ˟OY3Ͽ(.gz& 6|Tf{`!$h(' *7b0(zދ4܂?M܈W`j1PKAF9:[n}M棿d}b> ?.NS`{;+.n901w_3Ox˟k}j۱5j+6.U(Vċ¾~7jJlL࿤&-K`|F"^9q&, S07sEL(>S;aplus-fsf-4.22/src/html/APlusRef_ScrnMgmt_1-7b.gif0000444000265000001440000000365207215453021015264 GIF87ap澾nnn,pH̷'h試+lwz p(,[`l:tJZجvzxL. e+o|N~ϯƹILQkKnLGFolZ}RXWKW|~\VUԯVYTo24'\CP;*k% 3&kƏ<: ŁN\H0s)Y$-sOI̿ "fѧsV jS":SVÊCVY us Sagv)R][ʶݿS-?REǐ#;m %^TuJrfNٹ黎k潙װ~-z۶sޭ7߾.8R(_μУKNسkνËO 9Ͼ˟OY3Ͽ(.gz& 6|Tf{`!$h(' *7b0(zދ4mw/^MF1,sK(GZ:j#g9ɪϭ̇E[O7͹x:~;
APLUSDEV
  Index: Intro, Symbols, Nbrs, A, B, C, D, E, F, G, H,  I, JK, L, M, N, O, P, Q, R, S, s., sys., T, U, V, W, X, YZ$sys-cmds_sys-fns`sys-varsAll
aplus-fsf-4.22/src/html/AcroCh4.pdf0000444000265000001440000010523307215453022012471 %PDF-1.2 % 39 0 obj << /Linearized 1 /O 42 /H [ 839 252 ] /L 35483 /E 5081 /N 12 /T 34585 >> endobj xref 39 14 0000000016 00000 n 0000000644 00000 n 0000000699 00000 n 0000001091 00000 n 0000001245 00000 n 0000001381 00000 n 0000001487 00000 n 0000001594 00000 n 0000001701 00000 n 0000004531 00000 n 0000004623 00000 n 0000004838 00000 n 0000000839 00000 n 0000001070 00000 n trailer << /Size 53 /Info 38 0 R /Encrypt 41 0 R /Root 40 0 R /Prev 34575 /ID[] >> startxref 0 %%EOF 40 0 obj << /Type /Catalog /Pages 36 0 R >> endobj 41 0 obj << /Filter /Standard /R 2 /O ( UV.`Dz-#_m_}g) /U (B^-$dzv.<\(_EA Ԭ̞) /P -44 /V 1 >> endobj 51 0 obj << /S 151 /Filter /FlateDecode /Length 52 0 R >> stream KZIL%@Q(_QQ=*H[؈+^^':W]\7VEќ;Tyk͑K\?Pĸe3dbĸi}Plif?eu=guWo{rrO1+:/˘BA endstream endobj 52 0 obj 146 endobj 42 0 obj << /Type /Page /Parent 35 0 R /Resources 43 0 R /Contents 47 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 43 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 45 0 R /F2 44 0 R /F3 46 0 R /F4 48 0 R >> /ExtGState << /GS1 50 0 R >> >> endobj 44 0 obj << /Type /Font /Subtype /Type1 /Encoding /MacRomanEncoding /BaseFont /Times-Bold >> endobj 45 0 obj << /Type /Font /Subtype /Type1 /Encoding /MacRomanEncoding /BaseFont /Times-Roman >> endobj 46 0 obj << /Type /Font /Subtype /Type1 /Encoding /WinAnsiEncoding /BaseFont /Times-Italic >> endobj 47 0 obj << /Length 2754 /Filter /FlateDecode >> stream dht TYz w3"&g3$iyɓ=ٕ$m@Nb+-*s!]T`䛛7.6sϛXfV;t%xX[z*,[]{Qi/(L$!?ߜtEn^ FFWQY\YdU? BPnM-,A,5UVVH0?*׫rMA4S ~c[=rIt<:֬ n]9غ m0gא$Q1 )hI?x?zb~xp8jktThla6)5?pgvAEՖjO+ yB:ģ1%K~(a7&/1VREh츘="U<><%G$GS2 |FD̏ 'LFe6a35qxN]eR:JAJL0h8b,|=ՀiI8a¢'1eAFӽZ~AǠ1q =_v7jN&2L+oV8~-m4p,4/S5}ڪ7N)sPOf (rGIjek4Sw>^Dۆg3v; -^ >T%۝W:O4OaR#kǕ*daD~m3Ufegv +N2k1=YJSd:O}\qZYj!8a2r޳Af)} '8DWCA=-&vi$/vAIPzÊ&-Z:Xɘ'ˑA4Su ̶ylR7o=] gwrUVvKu8N2ό DN(_V%Fm0rqSwj]QK{ nKssI(m|,XSk,+3ա~=26C~|.E:t݅ʲB}IC2.C J6Rt-BXBE $Jpj9c vt5Xh/bMp5tԬE~|7W䓎=6UDjXks\-@CkLoԤ7F ;tۜ V‰@unFJpR L4O/Z^Yg5S,S\Uu*#{҂fH gݷʼNo~= 1j$tO%{gو#>Vx6񅲞dZXY!q6җ2I6WkgU up~ &~^ 2c ]f 8f,PbŽU>Z/᫶o3ɷg(n~)"R[s~P;w+DJtK4 uDQ:Ϯ.\%rP<%Pyi?BHtbƜ(K蠶 !܄fajJ3W >Vx ۮv|ٱF(t@{w"*$t2z=_g&'R?p1WF^z;ZWx5~y`TVZ„34,N-{g*l({@Қc}0l>g2# }j7|qOuXlL) D'v:}*#Ps#22V#PB?=q6h"Cʗ*_\l j)+YuQ>EgP+"sa y0 ncq?7H(%k~wuj-jZao\mVo\Hu&,!6t?Bȥ( jKĆ<7}nO'76ٌd ~W]m!mѷ p.ۦC׃Rj:cܞFٓz-b!Z!@.e> ]ؼý)6򉜇׃9$%S^k~ KL=&|Zՠ!/퀎H<g9&uV ѕ\=XuU 9uԼ_dkӪwHaᘝm 6Ih{ LA?-WdH2b^"|@8fxiV 1\l|/A_B}V\dtxnrZSr, +a^6Doe0<eޑ1f?_e .e QRg2 EO=AAw\sǒ$^<32Vp0;1kXx 1Ȗ3&,3Q7K@ s9aĒ/3%!Ƕ9 <Ӏ@5,Sf]vMm=N3m^P={GfNw~d1m! ϵDt:.\a-EӯMop7hSb'&Xe<6a)x^o4-RkQ(nB.ak6tݪ%]Nb8 ~X]x!a!{ 23Dg/?IEdW$ye+X;Bs=ف\U˶LASiaƖfdi5=tLFMrAi (V%;(WN[B# endstream endobj 48 0 obj << /Type /Font /Subtype /Type1 /Encoding 49 0 R /BaseFont /Courier >> endobj 49 0 obj << /Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences [ 17 /Zcaron /zcaron /Lslash /lslash /minus /fraction /breve /caron /dotlessi /dotaccent /hungarumlaut /ogonek /ring /fi /fl ] >> endobj 50 0 obj << /Type /ExtGState /SA false /SM 0.02 /HT /Default /TR /Identity >> endobj 1 0 obj << /Type /Page /Parent 35 0 R /Resources 2 0 R /Contents 3 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 2 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 45 0 R /F2 44 0 R /F3 46 0 R /F4 48 0 R >> /ExtGState << /GS1 50 0 R >> >> endobj 3 0 obj << /Length 2406 /Filter /FlateDecode >> stream p/[O*{{ġ)rdZ\@xUB}i$|o{m[{}9ZX.+K XD-BNv9q_!+\p&) 9v; aPpdҶSѩFO #YEV7K)̱0_sHTA&7 e\ɵ 4y%*B B 8k%,>?i.qvXE%Wh tuk7=ƓoҖRFj9A^YZ|+"!m13³ݛ1(Cin2>O`G-8MU"X_cz^kXo]6SKPBcיERf#o7I{;077p#);xVwN&h/  LHװ Z3>K5BQ̓CkV*?q0΄; w xLJd⛋ExϷ"q;Ujqs80aOz,Щvv0CxDޚHHАTzr[D\O3,y=;(oHD\G-mD3t˭뙂xeԹ_NV Alv[芬[\$Km MӋ6sܙ }dgg"gEө xhjGUljjRӏcCЀlFLO)2qr@{-Oٲ2)/#`jt7F0vɡ#jI48Z,}H{I?}IœQbY6 G [Z'5Td,<4;rf J>yQu1tݍ-kNXr><۵|6!x{;tss a# zȧ ey#:R$?cO6M#&BN.eUi3-!꜐N1@ar"chBLxSΤ?5c QJcFdj{?,8\/"B 2G=]]`N,vRܰć'U5Ip^EYo@V진++] sX-@u{;@Ҫs۞ 449*w!& ;߳zLKviac b$$:rƻ#> endobj 5 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 45 0 R /F2 44 0 R /F3 46 0 R /F4 48 0 R >> /ExtGState << /GS1 50 0 R >> >> endobj 6 0 obj << /Length 2461 /Filter /FlateDecode >> stream =.v=fr3hv5.F?: Xk0}#[ ][)Һ湗a-߰;sT:');o!O/?oy3{lAeJL?!\pbD=+=JO|}Lңԧq3Wvjo]>ݰc_cOƑݭ KOa~) vI;aɬHuݗկ ZQ) w`BGN}AO{>i' _3~%j^!Mrh1عcc{pft9}fu_,ˢ! "fLKcM8mDqpR{b8E}l)ٹBb\I$异hЩ?I3{&bl<~H.Knlk 0zkP㲗,2茷%#KŪBkpys) ,nWBπwCA/ؾK \^ocoaG=,)Cf}"(${װVмH:c!X8F{z$`keTOpsJB0Ce!ׄ!…_^~,G$9F\~ŁbNxըDތt6y O>.\~dKuv~NkIsQ/&`n+^Pp5;߸7j _-iOW1 U3aʵxp!1L+ p.9m~& &Lc"*Z^ qknфgH(#A\z.\# `Z_6g~-;8tyebP$W]ؚcp%|/O`݇*H1W#$Rgmkg% 4>]#&hr.v_9' JSE آxVF1.pns&bi41L.$0g]OF}geQJ秵veTiM7#G}"O9e mv"C%wygiC.doj.uq;.d~ćA~*S IlpOO*B%鬉AArؕK1yV&%{xiuWj9 ֥tE,AL{}`Ij#i%w MB? :!"]w2@|U hNܘ/n;Yn9_̲-ƻVL#l='M.z w+n AHO=r6=ۼQ_IYĺ }ڭdRu$h= iN-qUhtz6{?)ݹ׸12U*FISY̕1T5Ɂ[_>]ƼpL"PX9/CdW3#v| 0_u0֨Hʢȋ!pWe)d63*Խ,P)phYY oA|um}aTR*A=aݭPGV?AZuK[caMavd jW81ø3^*Mx ܮ=*n&T9Pw!KwEXb]A$iJQOD¿q o r;tmuW=N5#36cˆ'>$|h'g#$A5n+Ƅ 4 -ۛe _hsmv~LQ$߈&N] XI@VN)k)lu⎆1c-]w:.@Hd7r=+p aV)H|*kZ͠衋4ʪxs8뭂;|=W Ut h;Jٔ 1`i~ ok]S ,4=+./cEջPh ~fkt2} p''jjxEQ(+e :~p"c{yR)q h|iʇRHu&ٹ s?A#أ Z|R>Rι+;\eė?a0kIojCBb'1}$7d HYԋsTθx̿T!(Wa! W`UR endstream endobj 7 0 obj << /Type /Page /Parent 35 0 R /Resources 8 0 R /Contents 9 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 8 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 45 0 R /F2 44 0 R /F3 46 0 R /F4 48 0 R >> /ExtGState << /GS1 50 0 R >> >> endobj 9 0 obj << /Length 2963 /Filter /FlateDecode >> stream ^es%7y3'w. րaG ;8?aػ՚kXJϪQ+Ϟ?,^u}u[zd~[{vS;>4dcu6+ԉ>5MIld#C!?!H9̵x.&5?EvsMӧxALiTȃ#6dKn؏c1d؋8V$Zͺr1Q mE0*U2SBtጘh5}e9BKǰ&@Jn#<9CL:7Bb {M!>քW 7BC^|sVmSAn,fhm:ݲ'tlb[%?^Iu(r>A g~\i]5o|e@ +p }}c—s .k\!"dT6)?F0@fjevZ6y.UMgMa5H_H$L' Uڳ΀-͡6Fnnփc?") z} s h"Ԉ bwDPt$׍f.|8JհxQ0E?^3OfL?څdt=]]0)/֥trmw! )^(Rf[.0+o茁 t+ktx([p|㰤5OӬq#!.qIMfྋ x>C-E/ U(5g^m.)d)2GUu[֮kr(^&]$/{eɗk"Wc xanc.P\ \}URY2<{!w< FwRi{aQ~u[*&ڎۡr jtFL\'(qIX9Ux!>ex,cCvQM!9C3ka+ P}sR]q炬eC;u5v ̨/ hۦAGuTS1#KIW~Wd(sU39M~'"UlNqAHL+FJD%l|XGS(+K"aB^e>!we''LDxIbF"vN)&j#^0sEkmu/}5:kq)[@qƆ.Q`\rB~G6&5+VZٕZl@HBmH:Df̸yi)Xg 㷁Jg# mß1nKi{pk 2A*!Yq~$4apV>sduå vdO [*!14z`JP-.N׶ng'uVA4FuQ{:rzDͻҝkɀ-3K 5F[|Sn\ ^0ۘusG:3켕Qҁ8?$9u`þ3<C0L!B:QsĢ#G/Բ#0>l7haBS^٭IUe.W/Ќ55iU`!A-YZIHa2i7xwxm 7y &yP|N=g͠76d4qn@Iq Ok D;o'OG_].DNϵs %[&fM22/GLx̓u!H!#i]Ai7+M Px$YP.)9tyB|,)}y=_lzkebdFߒ>'Ḇy&I[a>ޘB˸0/N4$mԊU^˂9?^@~PUn֌ FRTC[耣9 9 "%FJ^ ! o O#W+pg΅^,8./ۧmyg'!ŔmU 2 wAwmNYiY6>[,Q<5\o"Z"2.JbX+E|2Q]1WwSLc7:,SIhB9F$t˕cMf&e՞h\b}VA g ") endstream endobj 10 0 obj << /Type /Page /Parent 35 0 R /Resources 11 0 R /Contents 12 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 11 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 45 0 R /F2 44 0 R /F3 46 0 R /F4 48 0 R >> /ExtGState << /GS1 50 0 R >> >> endobj 12 0 obj << /Length 2445 /Filter /FlateDecode >> stream &h# W7CSGP%`@.>@{F_$up5Fe\06!.I(|Ȍ``RXcW"S.Ml x\Sw?ოvJx>j3"Фtvppv 1/؀Ӏs\gۘɄyL{@yHJPV"ުgcl-g,t4JX+G Ixeҷ7%c~,添V)tԂ}da'Ѹ]}_uyWmsr/;O%KDǕZ\QRYFʖHȉ!e#c- ?xRgR|5qEL ;9_VZOcA[,flZ?Wl}=% Xo1${"̓߿Xfaƍ<.k9c'Cf5>M[ QQ{B`'1B:Yڱ32 #kODsrot1jh `49.<*']),pQ{m`vd+W?BV-5q=CM&-?h[%} MɉkBqoc>!}`::M~` |[/WZm8 մC`fW ݩR\Eb]G(_:1XZБ̫p۪cHiC4Ռ7-­u&ގ;̱'C: -$cXc xc.ɁJJGz9GL 8.1 $~h<[Ůn /=pԐgO$/+vWq,;&uwu 9~ш۩U0Sn-_lt[ X_Fv8<_FYowI_l8'ew+Ch0v~tΗ[enx-?^I}i`2IPB%ܮpDͅ4g MQLEnb&.< \UlDٮ?ljm>Bh5md@[{'A8t#ܫ ¿u3fW"]5M#o;vCԸfa-I[8D lu-{;[6(.U4X҄c[N{!2-ϫՀ7Z]ErOX65 /}z˜煬ND 4ێt9#E|>y8YǕΧ}*M9Ly,zY]PwlϘo:ge\YRr1]>nk.4vИm\5 k4F8bV^))gљICPɲt0-c z{.Bu.;G*'05XJ :>ǘcz l?KfTdx0ApM {#`m'@aıH8U=7tBMرȖ }&c1tWh:Խԓ+hP' ;{vy8/ǁGIt6P8ouTGû.ol҆+9efml%lAQ _Łsޝ^ڧK`_}3l)o[4uv-UxY8 d^¾i#Txkm3_Hu,Bd .x@-=ɴt/#Eh$NJP95ZZſx G 1vJ]m׶K!ռ݋VEL 1$jۀ(لNۢKսIm^OA%L,ʄ #æV(?vǡm>'8 15~`ypuOg,H>/u[d$x ׅ)&l#q=mQ TDBpp؝՗_h%D \Ay_e;}8 |#؋h1*fM!mbވnd g(f& N!w(༮OuL7$0D Ά<5Α\5:Envw 3mrulb7= Jk9@&KHCx䔩Z LIHPX Ib-X#(&SRn?eOu l:+{ 'ljDIF$N~RGbN^-I 3Z}![X%&o< (cl|@SªPd8L[BQ)$ϻ s/5BP!V endstream endobj 13 0 obj << /Type /Page /Parent 35 0 R /Resources 14 0 R /Contents 15 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 14 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 45 0 R /F2 44 0 R /F3 46 0 R /F4 48 0 R >> /ExtGState << /GS1 50 0 R >> >> endobj 15 0 obj << /Length 2302 /Filter /FlateDecode >> stream GD X[S3bZTJr ~wlD6xwA^-s $I &8HTma!-4WlO T`[SQpqDvY=AEgj> %q;s5m&=iX*kO'`iI6aO<ęƪ%qk7NIY7CxםZJrAɃ8$u%@vMٔpS9kC[ƻJ9Bz*`X -w7Vͱm(3"Ժe&~N6 q6>̵KT΢tG\Lw$(_DZLA{t(?#}I zoYzl _G(jJD#Fqqq?NO>SJNh+AȿiQ \>TrzȻy5L<;!#8]{#U1)2N볋v(W~`vx%%E2NNBIL][ſSf, &s<%i`-/۱)+ C:*PMR;~ *UL4rmӎ9\HR;DV՛4[+s|NY(B |Jpb28M1\|ā-q҂ۏHvbrNbDoӋ9Qp==]|nsJ9&l#S^,`/4AٯMGBs-i%溮 ?%e-R;NYRxVHs\"SʝȢhl ŧafP> K>`S_-p?^Ԯ˛݅h´!l.>КH2L3tm+ O9띑wo5t\}"):&;EiBg8 8_@l Qۿt!r_K:5y/Cj>ZH<(UӎKոsnt zӿD &6 q0Kh>Nkr;ZV i&cYm{] #>&IhҎW,QF 5!lОqOլI#OfPh`C1XZ;P8f},Ť֊.,Q ُ]L Gm N"VJq{yoNO'5ށ-+1RubI簬y(/sw&Q*2XN aaƊJ*X&ۚ{{"6 2.*31G!نV'f <Ʋf'R A93q&`EMbJ'0&/Q83`:쵮WIDJoJ|xGՎq.V9&&? A 5Q6R(uym:9p}/2nyfKԻ.Uy!}o!E> S_2;J )@L%W3Ze (ݕtBZPfɅ[z_lpSFʩ3 <(k%UK|qJw7 Zsr9⸧~]Eig0Џ> endobj 17 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 45 0 R /F2 44 0 R /F3 46 0 R /F4 48 0 R >> /ExtGState << /GS1 50 0 R >> >> endobj 18 0 obj << /Length 1991 /Filter /FlateDecode >> stream (eɸ,p] iY^Y1mPܼ>v74ښ˸-t" rPF#J]QQ`AGc+22+լNCY-Ir?8₷ONoB ?w tLTk⥡m{6qg9oƣ[ie&;nPģ3 D(ʊ{FLάh+*zsW8K~BctYt!3Jgeۋ̑;W&'$u<5 Un%8t'JGBLʙ9(fcu3]1xv2g`?^cX@d}vB9@j| `YPu Ώ<".2^n.!GdK^%hn'oߞBԙ)1WEZ BeuRzXE,M z$guL A੹݁bbGnpx1*tlv[O,S%qFzsSjeK7^YQsglёk?v]#&U,htW͝`i$";U.| OԷ0}%'`nX4XLοRmEԜKaK/{G6mzR͸g զ vdC6/,2]+,!n9L}$8hk[mRv0 \ܕC3Y\;TQku N?F{ Xmރ.KdՈ[J[ua? 9ƟzQ<,qLO&ϭ k>sʼ˸)fv3O9x>vNCw=2 z.g4N4<4n)g9 ?%P^aQ:Q SYSfl,ʓ,3|m[ 2uٮcީNMS5fJIoB撔?Q psf[z-pyߦD"T1GRyZʢ$]X6GbS?/9_u}7X6tZR*"!R?S%BY}cQeL:.M#sh(zf__["YѤCfҥ ]Ր:e#ewr.]#kFF$Y'p|A݁}F_M^.ԃcO0ewDlPh`fe/B غ(J endstream endobj 19 0 obj << /Type /Page /Parent 35 0 R /Resources 20 0 R /Contents 21 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 20 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 45 0 R /F2 44 0 R /F4 48 0 R >> /ExtGState << /GS1 50 0 R >> >> endobj 21 0 obj << /Length 2442 /Filter /FlateDecode >> stream HiG:(76IlPԋ҅]ޱI?pł L0_,6k@>ve!PUBvo\ mr@W;bȼę N~[4KL9Ԫsi۠sXuk:w;q Gp(?m܆HTv͉GbJOyB f ɡe%x^rm!<1i9_`C8kP8eávGu!mI)^rwS W+IGBƍxԕ#tNg^ yz{(R)Pq+4ZQ[)T6AHPch)3`k-=BOd6tA^@ab Dٻv;(e yGդhK[5:Vh[ qyլrpjh 9E\hXf)}*]_ֲ0m.(zMP7Z!'նe?(MA<&Dy5ѷwgaS8@BE }{xyZQ/=4/hUIrm]F+~Q$OY}zژ9Y Cd[T˜_Lb%FtI<#ZPb1nNPCMZ㸙:Tzt4[ʫ䛛<>Va}#PK,mh:/\ƘX{ѤQs{@K1+8%}Ў[he'9Ur(Hdh񙸻_@#RODq&7"R e/}wޫ҈T=cK e4zxRSN}c=.5s'3xL޴Yqx:A\d"(n(}~yETqy&9aq1jx*fӔ<y'Í$Ձ+ay8D fӌK8zab-u lU& V;ĕdO#jfF*N~Y>b^kbQz(lQ0JbMSm:ZWU2 BMp?PP!}DThgw ]1qƜoy~&hƝ'qS;p_~m6LrJ2%8 ^+ł߯L)ěJH$n{3X12ay]暑[ƌlX?iB en k2=lE~rQ_6ιIR. u`H'_e!#-:>br1P!*ע76)F(źR0 hNq*V0RiA1$fH’7D&d SS: -mݰ_eZSmzd+=dzwow{n)L a`N8/S 6n>#\m2D /XWQOZx;cῒCgj.(r#FwzELzYu"){MJn^8w4bfSK#lEJ-Ў!Y5쒻v` Td@@ X9Q?4cPq endstream endobj 22 0 obj << /Type /Page /Parent 35 0 R /Resources 23 0 R /Contents 24 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 23 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 45 0 R /F2 44 0 R /F4 48 0 R >> /ExtGState << /GS1 50 0 R >> >> endobj 24 0 obj << /Length 2320 /Filter /FlateDecode >> stream Ipq3лe.αAV.o9?i̳ ʐ, +ŵ$=ע*윭溧)ya4Ds(5j@xg "h\W#1 OE<ix&zjd?nnVY~qIU.^g3#e z9'_5qoDb{t "Ɠۜ,ՠP`,1D},AE,!KưH\B#̷~>HϷ\K_= |kT]WA@Uﱓ ?MBy_ hBr]mvW y8CHfT/L'0=?ݢ^S pOemq/}:r׽dJ_+a#lj #eB\As$?BDI\iy]=wыZ.h. W4FcRyC9J8p njgHKE|%(45mq3MSk_h&;I(BePo{r}"b֣Ogڌh\% rs;OHщ45ndG^r_>_J̔7(]yOxoclǫ뗦]犈X6O4q2?驃 w`oR{MK[s-?oˮV'(0B1,Fwr6(c`wGr\ }NډIk(݉ҧ3MwZqq  /ŷ}"rwZ/jUcƒdǺ+scIvLr9XM]Oz6[J&b/IGRSUff/]D'mG8n`1߃qLf6A1HOADr}m%ޡ;Pφ[ BGr)+"4TdxL/TVe&LGk7wh8Om.6'HO }QmJ-$]Um;=A?RZ}eTCH=y)Eu0ε9#8IAۚ%3Eb܆xQQy>.oq Ϲc-/[t ܑl#ӅnLÇ-MI]b]sSfK"4EKXz'd]T9x$xozd(~9g0cIȀӥmI~.br*M't:!-bK7;`n≬+{zX4Ą ;k dXUMQcw }N?bK9wmg{"ĭ'.c0A^34yhrMd,~zܾf@?'*s]5W?.bUY'CM XBt(e\8Pj+z›!4vNX!AZdd(d]*qbYb8L0y&!l!F/lYbGvNpou6cGi6E|.IK֓9DpR h G]F8*ㆪ]Il+# t\-=҆,k;_pMo>=:Oב&a:HHMbԍ6U ;̷`O7F aCóJzۼ8L& y&M\H Ѽ~sIxF#d9;WэSgio)(dB`ƃ4yu!1Tu#`T<ûwAB3w &On Ozid[qK0uՉ)j{Kr??TozYh"4(j|%g\uBhdB!9ukULtjf\m26҅pd}kQo]^A׫FhMUQ.m"4@pq%L^1jS_~P%gM%4=''il6\ɳa8Pi=2WZGSp޽"ԗgc ubV/\,nHv=+t|WΩ endstream endobj 25 0 obj << /Type /Page /Parent 35 0 R /Resources 26 0 R /Contents 27 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 26 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 45 0 R /F2 44 0 R /F4 48 0 R >> /ExtGState << /GS1 50 0 R >> >> endobj 27 0 obj << /Length 1761 /Filter /FlateDecode >> stream V^嚿^u9:i Sn`3jI$S8gt Dn u_i$dhϟz9_[B CBk Ѳ2*0H6O,*b, nòӉCm\ mQ]?TT2,h' F-[S)\Vݰ gs(iD^!B`sCyݥDUS_-~i2KظVSl<*t4Exڳ3uFfZF+ge}uuP&+JCV{,D6k+5{TK'J"CF6"YM&.DG眷#m=r&\XQi5u~g\؞@A,5 uTrow_r< qޱeIjDIލ3IUi@€|$w"+l*6 ׽Xa/(K2(8 Ao~9;򎤃< F(~ x\IQ|u^W X`rV-Xc'u7C՚ BDѮ<@w3Ո+JK4ñ%'[gZ?4y hKˆLCEuq*veY~Rc Q&{A>1+xw#n21.NyGzL4?\;17 贌-̸+TGF-iM,S.="%z pY+R{#E^Ur)IqGk1Y pf27΋Eo[Wq&##§-T: Ve6(A=z¡qM#/~x>ń !%~p5H^zT'҈Ɨ cwXX}.$]q يf|O*UL259t}Iļ)H\DbٞNc9Jw,ׅ"UՖ6xUGB@ ';>agE7nXPLDңJnL4/m'1ezVH69hN`&E*zI5W1.EZ+>Ыz '-dwH6D꒵(k ;;El,=gY tQl6]x?լ" U\. J?)^)ZkIbEִs8֎}&fP6mcuD-N:!-^k.̃xK6nW,D!bfXJ=Ɂ:AMY*SeMAc.$OLgA9ZU4e"KL54g<̭D!AT$ !\4R̉ ~3>AOVr$蕪Ѻb12(㐅)W%0qK[4Qj3OV o+ӯsi3![H.M>\ks۷ע"UluuiL-ؔV䏽KWn^:؆:?Z7h@B1 &p 9z'ֲ2.I> endobj 29 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 45 0 R /F2 44 0 R /F4 48 0 R >> /ExtGState << /GS1 50 0 R >> >> endobj 30 0 obj << /Length 1730 /Filter /FlateDecode >> stream ySܟ|-fЙx%"mSlK ͻLS35w jU, !(}(03= 2<؞,(:ݺq.n̍{tD b%uwx!l3Lf( Lt# c0Ua:؍ kn]/sxYsj~E.u(k8EafWkqg56ڹH7)htL_-`C^H T+f?l9JEޙ1bB bde* ޾uyA9 (u/+שP90b!In wI uDGEgfո$b  fyi>!ΑM0Ћ_vP烴m\CLJu6=ԛa,R|Fr4H8Й"ݫg3d˳ Xަ%\Yfų ~՟{,9 agNzU KlUiڸ&ڜ^({,dS<Ɵ!WF>^o̓31ZH'N,'qge{~n"pDy$;͂[R4rً 64P_/t/Cȱ8Ζ#8Ț*Is@׿k:3jYx(pb oKUoi2!:|x-` C~t&F7,u_ts]`3b60r` .]p&l #yojsMQ,n;Wd5!dKԄpRb-t~ntBiLI]8.gDߊnı p+\e`-p&k2gWܟ U>0`E&qFɥ]Ye9/Cng ;%/}huhGQ(}LP44> endobj 32 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 45 0 R /F2 44 0 R /F3 46 0 R /F4 48 0 R /F5 34 0 R >> /ExtGState << /GS1 50 0 R >> >> endobj 33 0 obj << /Length 2286 /Filter /FlateDecode >> stream d,(9\qimB⼬ztc%@7P[ 4d3 ?nVd s;T}"pz)9Xӽr0| [qV*/G͋Uo+]F9 f[;qmSr} &6mBKHm~}h] ?|*[<ҥ3.6_r}ߧ,=9fLM@6[ :fȭrYѤgUfs WWj? 9jVW~;T7qU~yup ޙ7Tp\9ݏm3 Tt9'ЂWcv,&hxͻ`-_kvSax[جwnm5G^xZ*+lX@̲{ 7 'j9]~CEĽt5zko eF0~R{X B\0>>K!}]0:=@Զ;1ظۮGص,3o+l ̟\Pכ+k2]+NJBԇ4GxE/&>C@Hq1J ҸCOHU 3LX{ V/A/8ݧkR *sśI(i|: GE\/WH{$WT﹥V OZqaEdAեFL>^yK=ZV`AU)e+Ԑ5[o"$'ܱ-O[) q̆zʜ"\6Nj ߎ#p[v:ceYG= 7_h^oPDAd/H1KD)!L m{}H>Ku.1.c- ڧa ]G7{)^רā9 Ȓ*O Y MD-Di%齫᎗i딹/j/ ʽd{,| z 6_|NOv~ 4O3-8j6`ģLN E2q؅ę xvfwX[/*~֣`b@HXݝ/f'Upkî&=݄Ԋ0iR%#H' $K9Af^n@݃aUQewMfV+* \+AN[ZcM4 䆤 Y |JXN񨘗XOjS5rМg>з;_jN#" 3wR> W'<ՁEdf۶JIqY 9g+I]sO'[.u(`0YpFnD@3mFRGj?z'Ud0{zWmKIwIp^¬D1i|${e}%v:(=.4;=?)i>E9ލ|W<҄+iNAP~2E xzwD'U4oQ?͵UO]B܂Qu3}Xާl_>[ tm< xtTNE&ϖ3oM#po0&"ԡ!WoqvENrteyk;K˄![M/I#23Ǧ9f\9QA(Ř pذvTZ6 |7" XrZ~a+lC҈eV*,Oȣ"\ĕFbCk(Mٲ W%H:a;*!]Fxh@y8 yWjU4:?e6O * Nbss uh%o1U$rxc}=SaGqKϪBI$E h?;E m&>Qدwb}bQ0EǸզ ## cZ5up endstream endobj 34 0 obj << /Type /Font /Subtype /Type1 /Encoding /WinAnsiEncoding /BaseFont /Times-BoldItalic >> endobj 35 0 obj << /Type /Pages /Kids [ 42 0 R 1 0 R 4 0 R 7 0 R 10 0 R 13 0 R 16 0 R 19 0 R 22 0 R 25 0 R ] /Count 10 /Parent 36 0 R >> endobj 36 0 obj << /Type /Pages /Kids [ 35 0 R 37 0 R ] /Count 12 >> endobj 37 0 obj << /Type /Pages /Kids [ 28 0 R 31 0 R ] /Count 2 /Parent 36 0 R >> endobj 38 0 obj << /CreationDate (?Kx,4վ-i) /Producer (:F\)YhIu9\rw\("'Uk) /ModDate (?Kx,4վ,oRg!") >> endobj xref 0 39 0000000000 65535 f 0000004930 00000 n 0000005081 00000 n 0000005216 00000 n 0000007697 00000 n 0000007848 00000 n 0000007983 00000 n 0000010519 00000 n 0000010670 00000 n 0000010805 00000 n 0000013843 00000 n 0000013997 00000 n 0000014133 00000 n 0000016654 00000 n 0000016808 00000 n 0000016944 00000 n 0000019322 00000 n 0000019476 00000 n 0000019612 00000 n 0000021679 00000 n 0000021833 00000 n 0000021958 00000 n 0000024476 00000 n 0000024630 00000 n 0000024755 00000 n 0000027151 00000 n 0000027305 00000 n 0000027430 00000 n 0000029267 00000 n 0000029421 00000 n 0000029546 00000 n 0000031352 00000 n 0000031506 00000 n 0000031653 00000 n 0000034015 00000 n 0000034126 00000 n 0000034270 00000 n 0000034344 00000 n 0000034433 00000 n trailer << /Size 39 /ID[] >> startxref 173 %%EOF aplus-fsf-4.22/src/html/AcroCh5.pdf0000444000265000001440000002552107215453022012473 %PDF-1.2 % 15 0 obj << /Linearized 1 /O 18 /H [ 840 176 ] /L 11089 /E 4592 /N 5 /T 10671 >> endobj xref 15 14 0000000016 00000 n 0000000644 00000 n 0000000699 00000 n 0000001016 00000 n 0000001170 00000 n 0000001306 00000 n 0000001412 00000 n 0000001519 00000 n 0000001626 00000 n 0000004042 00000 n 0000004134 00000 n 0000004349 00000 n 0000000840 00000 n 0000000996 00000 n trailer << /Size 29 /Info 14 0 R /Encrypt 17 0 R /Root 16 0 R /Prev 10661 /ID[<9e848d1edc30387842175e27cb057b21><9e848d1edc30387842175e27cb057b21>] >> startxref 0 %%EOF 16 0 obj << /Type /Catalog /Pages 13 0 R >> endobj 17 0 obj << /Filter /Standard /R 2 /O ( UV.`Dz-#_m_}g) /U (;\rН e4o\(K0+.bG) /P -44 /V 1 >> endobj 27 0 obj << /S 55 /Filter /FlateDecode /Length 28 0 R >> stream \/5̂p_~l+>S0s{DlTA9Ȓ*ֻ>cK' endstream endobj 28 0 obj 72 endobj 18 0 obj << /Type /Page /Parent 13 0 R /Resources 19 0 R /Contents 23 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 19 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 21 0 R /F2 20 0 R /F3 22 0 R /F4 24 0 R >> /ExtGState << /GS1 26 0 R >> >> endobj 20 0 obj << /Type /Font /Subtype /Type1 /Encoding /MacRomanEncoding /BaseFont /Times-Bold >> endobj 21 0 obj << /Type /Font /Subtype /Type1 /Encoding /MacRomanEncoding /BaseFont /Times-Roman >> endobj 22 0 obj << /Type /Font /Subtype /Type1 /Encoding /WinAnsiEncoding /BaseFont /Times-Italic >> endobj 23 0 obj << /Length 2340 /Filter /FlateDecode >> stream (ܪ1RJY! _'@Knpsxf&DktT7`|rQKwQ\bn"ez]o[70ʠ *NLJ! Ag̰ĖHcgx`y^5G&Ye"#/5NW,-$%'GNxՖ#wI`Әm.(7aJ`/l= gIP FyMͫ9Rt V"6qqzđ>S鯣$DسI/S 3,vgј YKb,((4 ^5c'vN'G%Ϝgy smvs58EiLa ;EEPؒ{۞O\5A~5BB4/P,X0asb~3t8;J=KpCΎq>`,-/*pb,W.MESv~ߡ ܸʌ'ʣ/YI|R1]3JzA|#T@Ӌ7J kfʆwEo|VQɬU@L+c;ybpS{Y/Qf.S۸w@h lG!2,^IrV1@иS]N=,;si3R*@uz$~2e3Y7qeè58ȢF _H;c T0j0GNB-u4e/ :qg32}ƶgn/M3Z+yGWK')NӧK`DZ"xO+ԝBeց_mb.3Z37N1jo6{OZҾѲi 4)8~= xvSfe,?;ޙwCI\a? Iq.^r2t/px=6֓u$ZKNғ;*W?4oMU˨'+K-LDeUQ&V~!Q+qtDúb &zyln(G(˯īy|H7_ۤ`[1Q/9&cI28#ZNuRON8H|į5' +@<"v@>EÞsveS FStJ-DX._O {#R?rl/+'Xqs^j6EǙ .'vJ !,bVc(>?J-wF$e\=9}Z%0 -? 7䕹vj\ӌq@ˎkGo],NoO 9@# Z#oWnznȬ^\:LYM;_>o%3"mp⮆f[><~v=Qa$ 3)rsE,:bmstjr tSlah 3N 0^Gn增#7 2"Vp@CNa)z=1rPUnۜNRw.u|a\F3샚>6ĥJ7RtEae]泯7.O,!K:\^>hЕtՐ @뢵.R7kY687tx5_Lz_dvf?w"T| {W &{`RYG):?dPR)]1zت߷hڐޟf,``(,]7m? ENKe)`3ʟRI> endobj 25 0 obj << /Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences [ 17 /Zcaron /zcaron /Lslash /lslash /minus /fraction /breve /caron /dotlessi /dotaccent /hungarumlaut /ogonek /ring /fi /fl ] >> endobj 26 0 obj << /Type /ExtGState /SA false /SM 0.02 /HT /Default /TR /Identity >> endobj 1 0 obj << /Type /Page /Parent 13 0 R /Resources 2 0 R /Contents 3 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 2 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 21 0 R /F2 20 0 R /F3 22 0 R /F4 24 0 R >> /ExtGState << /GS1 26 0 R >> >> endobj 3 0 obj << /Length 1268 /Filter /FlateDecode >> stream [dd[m<$<<\*a5KhRO/㼥!FTMƴYiŧv>}d Rq̝J_w[%cwb0ׂ#w[pNno지*((Z |(YVRd u#piATfXC&.X zR0}Vnv'xV)}]`s1SMEd A'=\+䐝񆹐{UMѿ#g'tYA8*2rmym0Ձ#j}PWzRUBT,L<3zD+^W.#E >sC7M[ Wx,>},І1YHH6;i=-ZVY\E(8y]ZK6+* H. PYCو e'T"u̡hMQ ` ҇mo &]v,ea(ft`#S0TRC;2*;p V^nܡof3pP97u=f.n lnpm!c>M?MiËPUCN ͹s;m=oy::[a7T:Q3++3>AaDŠL mVck !qi5I>-,[p#n:X_X=}U9W˵Ӽat"YRumrd.ֈ~Qʞe ԎT"rn` X9f ! e)F endstream endobj 4 0 obj << /Type /Page /Parent 13 0 R /Resources 5 0 R /Contents 6 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 5 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 21 0 R /F2 20 0 R /F3 22 0 R /F4 24 0 R >> /ExtGState << /GS1 26 0 R >> >> endobj 6 0 obj << /Length 1099 /Filter /FlateDecode >> stream \U)NQ&R3b"[rEQEk,B7,P %U9 uI*^1$*V|_ xc=MB?rq6fC9'+H)PطN4LHL(NIr{p71hFm]SDIB>Ol1R ^)L;H~R< "yO̥%B9Y0S&:FЯNA*W4l}gGLEoyR_,+oS:D7T,Μ 2zuBF={PY):CR_t`jntTj A#TӦgq;(E5e,&]2QXʮ) 9\ߦZh%*5:DPb7cAm5$s^ -29{4eBSGN VU5Naf@MXS52E۰R>+o,пE<&zy`j0M#xSֿ5hBԇi| 'b Ek J 3bt|l0ԅȤ7VӖp%'d)`B&6[' \i:'Va}]~&3ԢtșpSdslr`˵;e1@ٺשir`ր2E&7$8j [K&9*ywja l>RڨRIYޓmRY :*ڞ?xVF8+*yLI s~H1 %lj` }aթv/0||R V+dR#/j~ײサzIx7q:TsCjpNHVQ90UOO,YqD2)[YYJ4^ LV0a-l`{_!۪enn-%G3k _ TDLZilg|84ß~Y= Wܡe ,:vɟamRdۇXt6Fzݙ;P[\uq endstream endobj 7 0 obj << /Type /Page /Parent 13 0 R /Resources 8 0 R /Contents 9 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 8 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 21 0 R /F2 20 0 R /F3 22 0 R /F4 24 0 R >> /ExtGState << /GS1 26 0 R >> >> endobj 9 0 obj << /Length 974 /Filter /FlateDecode >> stream ި\T^7K"sHK Z~.sihTQ\.2IUhs/I|R<.a9ݩf, za7%&z 6!JIG̚{NUQ"ig8񅓪Ɏ9Aɣ{ީJ@yn 10 SO I Xƍ!$[P$rØb*Q@7 bB6賗ǫh]g+i 5kvm_ 5ݬo .?þM,%E[oާeX@ibsN \:p'9՗r jlQ"NSK;l D4x[+6v)EwcW<|-Nd2dFq86'"d~Iez024Kule$o<_-r/zo[/WUAwLNGV&l&BC{Ȥ׬Ggd%/K='#z}z3D籱 3` ~=a˲P)&Ғ߽hܽ1뢪?RJodFA\B)"ob!t`",,"׬OJR;`m(=E>^ԑ YK]3<TT(XSpKpډ kh/W+Wö:QLyر]k}2@_u6A;2פ"#ʇuH/r/3*44sX V=WP\}Ԗ^c>:΀ endstream endobj 10 0 obj << /Type /Page /Parent 13 0 R /Resources 11 0 R /Contents 12 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 11 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 21 0 R /F2 20 0 R /F4 24 0 R >> /ExtGState << /GS1 26 0 R >> >> endobj 12 0 obj << /Length 1211 /Filter /FlateDecode >> stream = 竉"BZ4&Zq5;_?ڍRڞM-}{Xk=`M/'ΎT.ώ4~Uvxklح# dҀ~8P6iS2 5p03V}c"1(0͖nMКXޠ<~VOx\eˆmZ6Պ+ źXhηM3K01gi_:br`?)q9x2+:یl|OO6lr|D[VN3P ;ps}?li4`?u4ۈ;CeY;DOQ XP~ON #5ͭyIhn9.: & fy= y+H|gbXd? Dq(>lr"]5Ѝ+L<,; @ICq7OV{KZHGᗆc?_@ᥥHI@'0 ih^h z/#}#lc&B (/jAA;du`'WNyF Vtq៶] sXp;lΕˌNDw!pNi)5oT +P҈9t^iq)cUѱz;C1k ISyEj,  Q*Ik=F1ϱ =Vy|[ىޤc} /A+0׭Kw?U~k?,vr#I{9hUCŞSpP*3".].(\)0xE]w_ 0_JCY$V ]S#Q6Z;y=ެV1QɒՅ01Dv•M+2Ŕ Ai`P~-f$)C!fݘH(F%:yQ45)rAeM|IfAR9):=әԂ~R_ 'F"p.Ҙ7M~Z#Ur}QgAᚴs6TR]Hct-fPnPX>nو=* A>|jURP/i\0sH8'ӄRŭkgΉXWP|{Ha# endstream endobj 13 0 obj << /Type /Pages /Kids [ 18 0 R 1 0 R 4 0 R 7 0 R 10 0 R ] /Count 5 >> endobj 14 0 obj << /CreationDate (-mANޕP) /Producer (tޭ\(4H {FRė|ԡ@) /ModDate (-mANޕPȦzC) >> endobj xref 0 15 0000000000 65535 f 0000004441 00000 n 0000004592 00000 n 0000004727 00000 n 0000006070 00000 n 0000006221 00000 n 0000006356 00000 n 0000007530 00000 n 0000007681 00000 n 0000007816 00000 n 0000008864 00000 n 0000009018 00000 n 0000009143 00000 n 0000010430 00000 n 0000010521 00000 n trailer << /Size 15 /ID[<9e848d1edc30387842175e27cb057b21><9e848d1edc30387842175e27cb057b21>] >> startxref 173 %%EOF aplus-fsf-4.22/src/html/AcroTest.pdf0000444000265000001440000046730707215453023013010 %PDF-1.2 % 101 0 obj << /Linearized 1 /O 104 /H [ 845 393 ] /L 159431 /E 5006 /N 31 /T 157292 >> endobj xref 101 14 0000000016 00000 n 0000000649 00000 n 0000000705 00000 n 0000001238 00000 n 0000001395 00000 n 0000001537 00000 n 0000001644 00000 n 0000001752 00000 n 0000001968 00000 n 0000002062 00000 n 0000004654 00000 n 0000004762 00000 n 0000000845 00000 n 0000001216 00000 n trailer << /Size 115 /Info 100 0 R /Encrypt 103 0 R /Root 102 0 R /Prev 157281 /ID[] >> startxref 0 %%EOF 102 0 obj << /Type /Catalog /Pages 96 0 R >> endobj 103 0 obj << /Filter /Standard /R 2 /O ( UV.`Dz-#_m_}g) /U (E~?%G?"ETuT^=) /P -44 /V 1 >> endobj 113 0 obj << /S 368 /Filter /FlateDecode /Length 114 0 R >> stream H5HCZ.M<k9&u#rR3ؘ"ڧLݰnIb jb=7ɏMO|JvF&EG}/,IsjE 鏑ⒾBQ8[]V \dc|?0K5E ; 32 ISy=smsUdÚm{i4QF5'ÁBnu1=X$L,{O( 9?MޑOK6B8nArI endstream endobj 114 0 obj 284 endobj 104 0 obj << /Type /Page /Parent 95 0 R /Resources 105 0 R /Contents 110 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 105 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 107 0 R /F2 106 0 R /F3 109 0 R /F4 111 0 R >> /ExtGState << /GS1 112 0 R >> >> endobj 106 0 obj << /Type /Font /Subtype /Type1 /Encoding /MacRomanEncoding /BaseFont /Times-Bold >> endobj 107 0 obj << /Type /Font /Subtype /Type1 /Encoding /MacRomanEncoding /BaseFont /Times-Roman >> endobj 108 0 obj << /Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences [ 17 /Zcaron /zcaron /Lslash /lslash /minus /fraction /breve /caron /dotlessi /dotaccent /hungarumlaut /ogonek /ring /fi /fl ] >> endobj 109 0 obj << /Type /Font /Subtype /Type1 /Encoding 108 0 R /BaseFont /Courier >> endobj 110 0 obj << /Length 2515 /Filter /FlateDecode >> stream %]918+j:/]ՙZi|QHO͋\ RpCtdUE Fо^]]H_x c.L~Mhginz.*T.Lq@*fS:Pzh\+&Jn'/GNdWXa:޷A#ۄxǬye>k^ ͽx3uJRtD?V+W Žfd00"]V^æ9셕~/T-~\Kqb 6X?q){?8ZlUhO Y  I|#cS˔/crw2։&jHXz'0H[5_P:tA5L``8V\G5x=Ym_HOݎZYímDx’ET}CkDGA%{R$θ#4K/V sRx =!)o8QBKU_CkF \6g01Q>ަT7x*Qu#TF=X[lֿ5ѕ$+҅Ϧ{JF$8I޵^8$#YL׾!^8^U ^ Q'wH4tn_YZݩZ}!zH'9Oc$nwhU _H{N3͇HfO\Po_VѰy*;>oX@_yBΠ'ux}*B'~ < pBh+j&QIkմ7ŒB !dB") nrܨ!=.CA;_'hSɰ{y2׵^<)|A}T4)aZc[og, HF -vXW^ősܻK-}Mhfa3a϶uYF+ݠ8YbRi)2qID` *+0iUȒF1͋lZw!Bp4Jb*FDkWqim#uu %yV؜*C)Z Y8J.UXS~O8@tcEQ2oC@Y& ? #euGl۴@?ތ ,w[Dޜd.x&HbPKk)l%n)ʟvIL\uM~OdO5E8z.t!~!"~|b9ޗ{*g07jLxc(s0yݠНDþ_+@:=wk~L ^k%g҈P'%-`~غZ.%s u]BZ^raNI,"Htʃ\OI:'x'//8X@nDkyLwOţzN]-1iVX" É..`V .Gb AA㷊0~hݚ v/+6ÑlQX?axag}(tFaGfFÔ޳34{+N/IVNB#miki /$ qs4&8 *z;ã,1"E^v56oi $9ۨHjJHޗù>բ}-M Jc KfrnZnLYA4t:4`x((RHqИIv_mfx߶ehiQ|_ C nRJzؙ9133QrG > &!6c+9NeYTt^#.J|361ϖo+Z{?5-_0?#|Pwݝzݨ/Nh )'Z`IK]0Ye?Ǐ3Pc=@jvr 6>vMuoO!ʊ_,M c(*ćellχ{ZkvV$Eص>YHV~]\Sc?ݹ;; B55pP"Sx\BmJȥ4٩\k]EH&]i!Dn؟\' m> endobj 112 0 obj << /Type /ExtGState /SA false /SM 0.02 /HT /Default /TR /Identity >> endobj 1 0 obj << /Type /Page /Parent 95 0 R /Resources 2 0 R /Contents 3 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 2 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 107 0 R /F2 106 0 R /F3 109 0 R /F4 111 0 R >> /ExtGState << /GS1 112 0 R >> >> endobj 3 0 obj << /Length 2748 /Filter /FlateDecode >> stream qOv4+[II+ w>xu.G<ռ .kw^"h=aR_akaޞqËkL E DLEx#2׷mph=X&9~}bA:|6<ɦZ] rf.4ߑ>X1֞ޢxWvp#;Ww-`^;b)YߟsNu-d(cRNKHy84ө3"8H0OrZ6DQH ԀӖ]y=~eFu]֊ܲs&Opc8P+>wA[(UWE 4 /MĿ fʓ:_HuXAuT(dM .D7p4d޸TB zpk rѥPI†9!Nl jk ښȅ;D&[ ]ϸ.Q2!oErmOުLjhNӎΞl۪=%fI5 '=TRhS;E:[o]YmQi:;ʒ@t|fhdmSa){=WhtuATПƤ O c]%c!џp DqeUʓ3m{~'O!j\@D4:xu\Bs%eHQڙC ApӼ^ ETk&*{xIdfOjDc,'%1Ny/G@E#5mhM2,D&6>(l3 j-T2K._@EZfDaBW.:^&0*$UT'3z`'rd3Sɟe"iV3fT-ZIH4n\|hH o^c1b6=<J AWbdod--#!)L('d "hLrNAׯ WET'q`=_^MM)#-Is'|n zk;%Lv ֛H?Ps3qq P%Kh'4_ȝ`9"۫b%zӰ."Zwx3XQ}\H2Z绔~^q]iwpCf*~z2Զ[jޮ&:^=uF|Q8-9y`c0.мt`cf^8s@y`+yPs1Lg0 > kN bҊ\`<2A6QǙj ;X5PwrEgW2H@82 ],歸'0mO,2b?Γ&N1]K걛l[ק/Ie $ELȥ,3vē<,Vp!w 9y,.9a*BHf>O-5?s8U9ڛ ns ܻ;T3;nHaiՊ%%pqS&n|Mr48?[Qr3ܕc%CU$Ye9u b_)&SJ;ii y =? Q 4L+E p^(>-ؐY2@T} ^?AH'fM)%$nN6UBR@"? Mcc|?4Ol۵Cjs3G'ru[IfI,swߥalp;Yjɴ(YPNP2鐍n ܜ;"PT›;=vqa`& 5G/WIawxTH#Ahq\ _n=X)%OjxIRD\ֆ,J ,RĈzmtߑ2iL)4ihQw/ɓ>`o>6IV6{,g{ky YT5Y-Lxt :qCa*GES= 4q endstream endobj 4 0 obj << /Type /Page /Parent 95 0 R /Resources 5 0 R /Contents 6 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 5 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 107 0 R /F2 106 0 R /F3 109 0 R /F4 111 0 R >> /ExtGState << /GS1 112 0 R >> >> endobj 6 0 obj << /Length 2398 /Filter /FlateDecode >> stream !% U nKkaI[h/374x(2'Tdc<p( =hk͈)$1#n=2#Ta#ipAK>`>zf@ 1@a@Zee*Z2GrPEO2+F 65a#NlĶ1B%cPkOm"BFm;6IEZ2[gSϥ ( ́rEAzF:n+rPJ@P})2joFșMbBXa`#uUAgیpa E;҇֯{ ƼAi=AsW#7Y=s5JPT`OJN]FCB']k$vn-;LS%)z=)qmEO+KepSːiMfԵBg c*WsaCsHT+ ށ7-m)1Sn3T<Q塄1avmjYgU3~ŒDfr7Q⑀sPwcI C},1V +󱸈wxY #IUK#n1ꂙYۑxHD٘(i`XdTsSlJk0Qg %d/$١@fv<ݽiC;$xU|q314۳ʿ2L(ZsE ^lA7tp mB/Uʽf{H6JVZǠAsQfcS Utݲmu‡?G4 ?Ƙǁ7WIeBfV\GDɩY}tE/21SLVؘ$(3asL*5#Hӻ̛3c~[vݵ؎T"tq/X8`mV'j~T~c:f9J{n4 xs«c 决@úZWm#Em[^$QNX"(F/_r5Sk N`m̃}XNaɢ2R$HFJ?(Kdl'M9 fWt=v e\")h\Oq 9|6;!5I;+F&h*67Q}`.;U}|ecZՊP-8,$.k  Hvb;V*i0 =hJVH^<S.bb7Z!*C ":tFƺ$k[i(L6-[B<jfl;U{: Mÿ/= )=ݒ迢Qlq2ټfCQA-e8!lsyD&/R mп<\`Y*ḶDԖ9zAxiT#7鐂XOG)~,)1*7%1/Ωgilx~ӹOSFxFۻq]K~bE18l2B~{:Z 8Bf;&7p3s> endobj 8 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 107 0 R /F2 106 0 R /F4 111 0 R >> /ExtGState << /GS1 112 0 R >> >> endobj 9 0 obj << /Length 1999 /Filter /FlateDecode >> stream o<[ՃkR_"T$y>,ϵY~#8J)Jmq4'˭Z k=V 5$J3=&ACHg8\sv~..HvaӁ@$*7K:+{~w`݄˩N푯J߄dss'L:)NXw1K#G@a9~h/ـ̭5FJfcc*o+ꆓ(C,55dpӷȤz$.ӉIc0. ok%]WP+z|B]ݠE|Jpk4LM)ˑh{{kz@ԋYb/KsQ•!JQ7-8JPFzI]q᮳gX2H|)zr^k++FըdHwR.wb;1; ޴v@Z{7;4Kw&4@SpK~܋`{wbx@];#?p{pE(difmR|ꔻvcTdT ؚ TsA`p EDz/gWLa5io*UHT={Sܘ<}^kwb46Xo:eNJbMptu 'EZЃ3]RK&~+?nFU_7$D,g7bnqﴄ׉wB_0 ѓ,,myMبC2H b*R{ir,6 BLSf,q]ưN%QLZ20ݥQ1vXY㹫ҥŢDiYok# +uBcPs_t! i qXt4둢/ףƸeOO1KG;tAP%QJ-rP} $ k пo+7S',hRU!Ƥd'r^s8 Ur*I:3PP1T`V_hȧ#Mm yx !^?Asj?ev[9:Cgџ@PZF=jlr?9Ute4~8j]bQ*TpVE&yuAXGk'O"Q m;*-k}p >Pz|\+ި׬![ jhOlB N{ V*:[.8LqyKr1 3}G@8t}-]e-ᴇ!)SN.F`Tyܶ#(mt/}>k8q<sARtA-'ۦ[,}y^ $|y Tb9eF.<½IR]zFf6wJVTpU6?-gjK VRkƂV0q%'f@tmw(@a;pEh+]`yȬEYLH7;:]LeF5Y6'N endstream endobj 10 0 obj << /Type /Page /Parent 95 0 R /Resources 11 0 R /Contents 12 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 11 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 107 0 R /F2 106 0 R /F3 109 0 R /F4 111 0 R >> /ExtGState << /GS1 112 0 R >> >> endobj 12 0 obj << /Length 2298 /Filter /FlateDecode >> stream .^L\s&Tjdc*Zk ]၆<-6(u5A sYG94;[rpo*F:ERvUƤu-,eY4& ~cVn Zh"fB$3o$A~\ytj_DѓGS6A9A^|}n{ 鏗TW9KgC ;K&Mc>?ǵ}?ő(7̉M;;mpp꾼X4?^tٸ "oť.#zn3UlTP̕L+5D$Ho 9(,M8A* V49T=4rU?E鬦js=^ qF V!F dy9)%8&bA#SS#e/@s v'rsYVm)xWεM6!؊9@M7H Fb8őN* q(]GM wqpՖv ˔"kidx0)Wp :۬UNҕOqǂic~`wx{Y$>(20שҚWlq &xgbEEVn Y J߉u_Av>=PB^GmbĿG$B*`B =s\Fm) O+F.<ФcZ\. HpNI\P(V›DcяJ"RvтWsAR)%[(+414m?g )17Kf @h.B{G$jciEo6z*;-ILLO׉|ȢN_4ٜ,l4PLb#" sdOGCX{ G[t{kYͧ-( 8hw&dM5pe\faeG,᥌X؇Wm DuD3.\OxuO-5ᦉ7Igz6-^um*8rJ;-^!̇|0eg?J sJZ6^ Y!} b Ci*uk`C{]hlѸ09wS/EXR̻ tCt4N J|<1 ̀]UW*+Y) ,B=e[&e3;łmHsƂH] CG4WrcnwqN Nl bZi/j{I*D.ҵ^dh4% }dc@՚w|9o#Puu/,aJ~졔T~WØ_u3r]{۵mv1vK%[ftEx ˬڣAfk0s&MM0KSMTTYNK?0R#At}Mt磺ҿ\ Άf?/r3JJS=-q V.k֙}V^(`mcהP[JPʽPn9ν#(Bo(õgT@ƜL`Pz^ym_ħ h2 #z m㶨zQYcV8ntvν,Eގ.M "ȶC,u] greZ2YV0E-dx7kDOJvk8ʫ `s/ɂڹ +dJd&p ٳz\3H$VV߄前XAFӯ?M  Ƨ)DIaўI!&T/sJ2w8ol뎺5mt_ՔwT=b[5Xgt硏OPsn> endobj 14 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 107 0 R /F2 106 0 R /F4 111 0 R >> /ExtGState << /GS1 112 0 R >> >> endobj 15 0 obj << /Length 2393 /Filter /FlateDecode >> stream =ݻH.t\ (Ubh9}#S)`0eBl*;ywB_WcTzRݢar-},g2>L<(: Z߄T Ɵ2DzoIĈ5 j{'k[:z~a'P|/2\?T>QE0T#(SH$nk84 8Q!,v{{AĽ]0$%.;0vWRN{QWn' 53坽T1;XcAyVBЩ袆Aˀ7ʢnV+f4tT2z`ww Z;~n^OΓùA D;\/9Dz'^+nr*ٷDa`!F.T,Sp{ UgN}c t7eaEvFGKGu(V~'XZ- ^:7+m WŜٲ/Ẵ( dlNQ̱`뙉ŚET]1b+rA{XcW6J G>PNJ< M‹v`7}>.qq^m*k35@T_4k?.̊,bO@*KR! `Sʯ m zA(w'[ `7Mlr ǟ֯zDޫ?=E܄lX^b-x' !vj^1)b֙3Ƣi<ь oR.@Uvk{wW @vLЫ=b:Qp=oU>9 = S(C*_[.vC#0x2(p<,64Znh~;_q G[R+j) ujXXMpD f-ܸ(XN#PziXND 6FW[930*Y(N3-VNGI!&@K~ >F>l.7%QNg r.vY \u3TyXb5G4x) PϜj5; z })iDs*\ݿ l"N4*5`D0y_!k7n2b:Q|(d%C V\L)kol! D$֪C^'nNG%-u>)u# /Ej­wWN-<8ݧ"o8j ٔsB yTϩ^GާAn~ (!aJSb6Aj6y7/~ !$Z*Y&9ԜYH} bK]"nZ i,!/bW"/} ~`W&{jPFӣ >Fq)oY6\(̿&*+G#wV%_֢ko#ؼN-xIdl6^"+xc/ڮmkv{40):v Is-h9J`@v3(:Pʔa =}Wڮ)itfnt.6gVw|0 - Zdmz 9ETJm|*A ^ =u)|)Ӆ_xa+\r@X ^rT&I0aqi}2v6X7,tᢽŪ¤[{#W8HqLtQU8ZMH6> `IθG]?\NV>uSfyx+[=|6%~j:ܟGe>r9m0pur_͞B#(Y~כu̖%![|#ZVwu8q3.Yɉ{@LȢ*@?C?}vrcrHV;ÊLLnΩ[W)1Q#]=q 6w$_R: D}^ %Ԋi OU]fg[ ~8D흑L_SF$o{{Dgr:6!scS!\,9#|=P1yg4pK:xn+(^'fj.D˨V_s% f8 ! YF ce9QT2^*! Dû`q[hǡ/q >g/袲zG#.> endobj 17 0 obj << /ProcSet [ /PDF /Text /ImageB ] /Font << /F1 107 0 R /F2 106 0 R /F3 109 0 R >> /XObject << /Im1 19 0 R >> /ExtGState << /GS1 112 0 R >> >> endobj 18 0 obj << /Length 1155 /Filter /FlateDecode >> stream 4U@1q#ۤg&xPgNyn|9|,AEKQEr>S;PZd{^mT#Xn(eAu 0n; 0oZ@s$_& V- \Vqܸ:nb5I0H?u-=BE2J<ߖ3bwQ=/sBD˶fXQ_%##e}/uv!; Pc6+X8'[Y? ?ю^~[ݔD{ld]`uܶҪ//,vf2Ay &Q%_ tW%ހ=+=N(GŅ&YW´6-Noo,+-&Ҝܱ鼹wI#%6M_BAJM۶7˝ 3[-8aoL7;z^%N W8Z rFJI,78 aAպ IۯSGw֬*YY v2k ϊI5T͛?)E ՘^]ˠM"S=R9 i53%x@74պlĭp3w^^/8lW_Yd4{jgC"b[ňP}8[D۪kbp zxhY|mE_mzYI{c@J"d a{]?JFꎴ .M;Mo]4I^JHgğH^e*)t֬+ER]M*uZQ93xC_"J%ԤGH^u׭õʥ$ &{/j2pny Ut&+q6 tG4Y!*ҥi{S)9N*u\` 57%mCeLՋ*yQ-`o|_Ae_0b~چl9oiCrupZQRt]_w#*vPF(Z)PؚC9*%+tӀpBæ;䍓I]:һuq~f*ӹʼEQUSt\H}}w])\ endstream endobj 19 0 obj << /Type /XObject /Subtype /Image /Width 227 /Height 74 /BitsPerComponent 8 /ColorSpace /DeviceGray /Length 4502 /Filter /DCTDecode >> stream }Ee?{hMqW :'m}֭Gg3 ra=2lW#h-ŕ[pCbAvr<ϳӐAs yM\Aٸ0ۗ=eTahW6N0IM&TW¦3heIO fp.VKWRt͠Iow;#5ָ^b8f\ˏvc/1pBf4R4pbC"ԍWև] hM=JƔ`a 3e 0~G#_}Si䤩벑f%zyy}/uZ_ޚNir-nD,)<+5E\I\/Xߛ ̔M|RgKm ~[A#Fp[B, ?Td"4rʉS_t~7U7@+ZJd 2z4|o In} Ox:-"v1'&ԺҌ1qsi6h?S2|hUjbD/Po oѷy |4GwZ42辦>֤K=Ǻ?\5 #D_mz$;ΌpW`=t ApoD򷃺+TO:#+ @lֵKƲ9A@vfd`@䟅&;.݋d J@3*7Q\PijK܌ ۅ ٧)맃 m n)U/PDL)xAXۖhQ| ,뜸:ƀe:;j2dQbT!vu |Y$O?Vp~${ΤzgmkшhO;ʹ<#TTC4"?gLE^ݛOTgdK}Tj3egM4礣 IƣPF Еc箭C-~@Xe^MGUELR&@5TW4yc d E׿Z5 -W'_+htBwIh7BE[5'0*Z9%~mAKOC2$c=kL,Lァ0xC&̚@I,?8s62n58dPUE%ֳIy}r\!(ktTD]! . ^), ai>p6eCcӎB'`Nlڨ6C|WGrGb-Ƿio|j[ S[`& 7nM@DB鉮Zb9h9BV?E}k:fzL>8[օz|iСr2C#R"mA/>SVQ2 QsxCw=Un(vs/mRe@,FM)508;NP13=>.K[H3ɖic,YrB:b5 $&>o~34΢g ]!hc |Wf]_YsΫ*HO p&bqFud6M=}%̈́aw??ȏ>Bpu7+鄱66՞)<@'%P:Ow؇C ܁$V.Zf"-_rd6YY˝ҧ7e)>xE/6F}o|OΟsܳFow!2(b\kVrIyTp.)mV>3z@͍\_g@kKP '~BqMs%#i–RFݰѡrwWBb Ʊ9CjLv{:~ H u=8I;_ܖE KUlw4~##-MԠiswUl_({ioL?0_؎kۢ . 7=/)6v ^ $z`00k W`\ٸ+ĩn6,Ղ--]kfdor*P}1l!z\.fu/ p2GwS1>I5wGg:] 0+fBQ^? C}lP v8fo@bذʉ2wGfu!)"Ki#yg0icYih? =(`]t1RFVIR)~9ߜDγm$d<\Urͥcٞđ`QɛXFKmxКJ|ON?aI=JbkջM:BSMYPV VE}CJGv,eoϤXx1vΒҲtYsn[ OQ`3(m7HL,AO .| [ܿ@4Z9hE+; ^%4ÒEg:2&瓆m%|*&G=<.]+0Áp.YhcB'|VMe}J,)yX)62!*ʙ8(7ôj$UEJ$ʺaɲ{# :ƲCMg5k-9wjqʳr9$;C%zeChif[3ZV0j iƞA0Nk,v}դC54M )X72a[[ KrXnB;D0*σyI+KG\X늮ADɑpg Uk-g&~;t!R]?.ϔVPQ3Z?[MIm3jTj8Q@cb Y>0> ENkHݼ\kl ^Ցw|,E ??l[@"7嗚GfϪrդ\@!Ѹ_n?T_[bR $ э}&{1qXY<wJˡ+X^XcrMXh9;[xk{duOaZ#"UA݂)r|pC6^i˰voy Ķ2+`9έg uەZŪ0g#ͦ A endstream endobj 20 0 obj << /Type /Page /Parent 95 0 R /Resources 21 0 R /Contents 22 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 21 0 obj << /ProcSet [ /PDF /Text /ImageB ] /Font << /F1 107 0 R /F2 106 0 R >> /XObject << /Im2 23 0 R /Im3 24 0 R >> /ExtGState << /GS1 112 0 R >> >> endobj 22 0 obj << /Length 379 /Filter /FlateDecode >> stream 67aCq:JaMZ^MQ}n=%EWCuma~:ereՓGI*1rVr^d#SPXqspV_d!@(_ :E$^uP o,LEi)-J{:“B  s+OCbN$A|wQo .R&Y~;Ѳ9H*k`<֯}?蓓f;Ԫ]1 )> stream tc$*Ӳ jg;5uVi}190юyO`yjGpP(F[;oʩLg0Lw8,IvoK(6w'Җ@2C_ScF*5Sx]da0'#j<H?H!!%ETmZ;E-NT s+kgS[]I(*]/W|>6!H<[e̺2}R(9'vkj~$̌$g/)B}I)S0ݸIPE=9KB WHe@p?$+Ϫ,iiaRf1HUAFfYvso[_3i o2Cw%1}C>'P}Ij/Dca<8I#._ zQ\dGoBdž& $\E\m|R'dO P8 K}m$m[Stw 1g#%)zcH>H=Pۃ|!oOX-JKuHox(,R(QWM{m 1\5 &'Zdl7|6,*Yb+Bm[J!q&ZN7}Ɏ;>f 9C7nk).);-Ĥì6b81qy?)n&~VpD3"wBX@\Ta;p}JGa bJ[f A6ݠ.s&SGe/ sjs$R]Ԃ(8^M͡/mʻY}xY}y imfBe9_艴 ٣-Nwvu- T0jPj+kծBB8H0r(ȇ=-oSda~gp[V+85ҵs 7ߗĿ)͵;1 e\tCb{l1*%9Ѧ_o֩`ܺ kΠ%#3"Lg 7}Jy2ݶC6ަN?;y-C*hLh<m;H}3B!eRMM$a3S~E6D8%[䱫 Bs9@]2ZxgoK2Гa;X!qR'5I"4Hlbl+>|h%٫K/\_҃?'4ќ16D#Uv ӭ!u4Tom*^wMKTuƟh "xWnCJ'ၴ7W:.8*i zbCc;´,gUj ay /; %ǮIׁ͑l Kxs'0Ȟ@E\tYYiS+!l0<;ŃֈYcXN^yQB$JƌQGxɄ{ik88+1N6Y`79UvfM[jp=ЮAj1)`KlEEqƄa!ce1˲Q=eR6P'&!BKlX.QÙR 6skҴ[܆Ӧdxex+ڶfTfl+!:cL g17,5ek:i[҇#>rpLe6±_S?? ŧn*3BQۡTa2(iF[ӷpGp6 u ݥ.I\ӈ2J04Eym7'ՃV~(@{䞤d@;ks !(y:A$T@v+.}e!Xi8YdӅӗ%O 2o*Sbl-L<3lnJ&a ;S^X< 1y'z,GW6`CcҮP)ǫ^XDzTrg废+mƟUW|F" hY/ &]àIJkX~9*Lkã[l: &Ι4`\Ai<>Q|9k'~LL݁2`wU4i>箬stGم+M\]{F0>HZ:)m B.분m$ay1tS ލpՓٻuL&!ap ..\F<0w{}'Ch'Hbr@2x1zCuSmL nL%HC;?H?ɰi:flb>R2-0e3/6BfL[iQu.F|C f B8~Mu_jZƒDyxWBMSWX8B/lO\动&GqDPR.- DWE5Vt5bkRi˩AY0@ ),,-Neve P"𭅷sɤ vR>/ʼn| =}YSEo,ZPtheh\*A%>>ّ#D5v"T6:b7)3\&k+̧RniufHrAt4,j戝rN9"S~Sߐ8xDbeS˚PXiBۏ̨@h1YkRm#c >vdקfb_d&sOolC]pi!J{jjU&qјmpcIsHjDspF$+Pj]VPR ީ =d}/47 $\Z?55NҎ ՌP]bW_Bh^cخ7uohvK+*&rD P&+e@J2A(^eB=#)*T/gVTsS_<#vQ K-rzD2*g*ζHNy\S.kD4 G}Iq]SiM,DΑ;}H_ǹFrofѢ*$in"c'|Z14m YQWyABGtFJQ~Rz"jd?U:P=vݵZ%6$XG/P?ћڣR0}Sk_*,NgxrL$S<:>׬ǘb$cLwQ}{:XYhv `6)': XzpY/c iPL,:h&@L&^/] iem DP4(\Ha;O4j~{¡01s sđv.KeQb|)2\^/.a-hZTŨnޣ6R#g4?aK,ޛܕc$tik%t|ZBdX2EuB^#͜.^TvVIg+.*ReD]r94GU]|W #F|Ve#&trX^]}K$'zlrNe{.ǧtp$bOHݝZ>E;T5 }>5DOK]cA~OLm<ѧ`K"^߈X@( r) h }RMB|W}0Б!-$.W@P m?koW:T\=.#IlB*Ins: 且GS؅_Iݩgi`mϙ'pֳ14?OFzC^*'6VUȈzAYv]cw@Γv"?to70j{Л4ED@e9OQ>b[#Kֆ~Ř6r>k0lN&.)>Jv4$Fx9` QDs i ͪX?GލkpIWI֤LnQĜ,BD fU  a5IcNa9aO x[ JRJ;ﰣ歨z"p޴xSڡ**>Qߦt _1 )9Z?ȇVd9fʄ+'3I/2t/0^~6˪_rIN/ 2#HW ;7YLb;Qi2Fn"12h]-aE9kHv5Vk{T 2주-g8W[>rC\g&$茶62 ]H7 225@t.⮠8FS7Z{* {@sXT~Rj]urqHKVҌ'$~@SwZyCuD&O i濵~jKgi&H$,J*2 qKĹwZS;t{npNN/iŨhP*eF~UB8egpe*A˞v(l>L]D!ihlSlc0zYuEw׿!*ImIw5 l_nʢPB5kH1&Eқ{\_$|sB|C;p2hPuo 4C4b695'FtI?DEx`'?NRS|9ׄN؈ 0,%5cAՒb%|/ cl߾[U豑 d;OSV'7c7DIHf4Oi@2i%=d9HrE [vNS ڒoxdo,037CA:0ĎV$4+)(BTLat}‡@wsO%Rh뵇fu*f\jhNd!oM<:K5b7LqW  zIBƻ($ 8PAQP𣵷 HjD7UÝVu)N_ŏ>\SL8fBgC$]w8)4gQ\>ѱT k ,q<9ӡUDA{_mmb[Rx9Ѽ32e)/H,fdLߺ~{ޮZ_(6SS2C*@&HnV#p6Q+N2U) Ca;}3@Xռ<'2uԩoWoj6q)* q'#>Kmω~y^~YxR A0$rKjfi%O,F V]nT>PzHNwYJzȷ ;l$wAhrBg] FuSLc;+|X4N'  U`vEf m=]Q|r*?ҩ~rzMK=c=~%jd7b` SL@ }A+!4 Zjb:=\0B eoK&dH}CK\8LIϽ$ua.[?av9 EA_$L@{OqGʹV\g;#6fcF܎UDchl-q hPAf Ӕ7~HWCoSJP3W6Y+mV=Ff1iZEqs㑒ϬZӱ}}& JO0M2o2zG&g.HteCaw|KA|OZPYUɸ YGۢrI7k$)lUA Jf9]D *\ƚ̡R0&mA{659`Kc@o\EP`&`ʐUb|9TM7TcPpYpΆ02lRm& z"[ G:LٗDF9 s}~Yoe#ݪyeF*?7W90,(UEt e>J60'$q$#^!chtɭ:֧fZkj/⁥'C%ڈ]tS?T*$nQH`7:؛%;:+))jvE܀󣼣BRUX$58baaY: Jyߙ[ <>ȲoYdv _GS-K&aRWG>W ֥!!*YV[߱I&Rͺ7M^S{e?=/nna>7*y)dJVYAJQ^V eO;-g ̿ڭəa@\k7R H5=Gք GEzd@U1Y1˱j\) L"V myן<bc,4`} JeC΢B4lSb~NV➓k[aրh`6b`y_yp4ܧɕ&KxL(M5?>ldz:w-|^K":C}:y> h1F~kb6NK<{(í) !3W$߂+?+2hBbW; "}8gݟ[ HWMq\K/Tg^xWm c[ y>S'b#,'Yh~iPN|GSiH'&a}/H PQvK݅ +;uWe0@ Dy Uƴ5XԔGiqwUA&Yвq;~h@zCddU/>팀s\ pRy,f}/x2 dlV[쏐L돝2bw`7 GC^ӴaG81YHp@Jr6ܡi3 Zխ"Au{$µbU7m'tQwiNKWrX;bQF֮4TW|=h`6'Z&G'@fXZa2L @uje.Z=3r4C(lKĂuBhln\q̆L_V-E IѽˤJam`Qs#1B QtW>5h0JN30%0{|+_UN>;fİI!si:ΪA@_'a6aINvӨ7nj -x#iowW;G.. WTJSy)*e:i3r)FF(אڢ[- UP:lfs֙>W,.c bC5rګ~2}Ay &r֚tO':C`lF-\\wK`YnHf+4ݎSh wQ^en,ԡFΈsmL( b29s_mFVq/y!Z*/ ~SUs6x^d,V•/( : ߜ`_ - j寫FXqTڋ <15> o nۺ2lʽ/ۖ>}zmGks xMC/?'Vr@POMi<'m^]NmßQg>_اH MxU[w80oF/>"l7$qg(6;0{#Dh3<,DwY̡'s6hX4UV> M&PiyHİ l{bĨa6+b9X6.CԳ8{?H惨HnGKEM8_~>A6 ]ҙHJ5> fiq %(ǖ#}H *ؐDx!gߋ5[1@3mzCUO97〰\d2cdz;ڠ[>j[ }|Fi̠&WSE9 ;^ٞ7ϥ6t`uN<~K[ɾc_ڼLu`Lli_ndKEL 32,t u<*:X5vD`fw**e&G=fe].ңw4$mXG—hED C'p ,4Q֜D4vwGڲ@;*?͙I)"Y+[D굺1DBXE &#~?Rm/#Ht/)oEzrpQYC:Vmp``vt+P8('J[yET1ypɏ{#j@xh3l*+vxK$D"8o):"g6z4k|M^ܖfru0@/{>{w̆t+7t$xG\d|`S#=OM#^3dJj݇8cɭcRVK' ^8v(=XXzw2 ߦBʱF%Ҋ#&Sis>xUnh`瑔fݩ4k˔&$_kN0g'W҆@eBļpR cӳ]Aq5ay yl*rgy2?D $VǨMbm[C Dԏu^y пc)*YOUo@#ʋzS6`/訰anN'tW,Up\΁DZx9_ȹ% A'nW]' h$= $BAO[{#Ki!RjfVvPy4%з0:N-'?KU\a0%e"FK}4eRw񍡫M)UN?S 6 9U#Zf{eΡg8)ZnT-C{Q-Hϟkpt"Y@f`dzhSpH2u|hא y&9 ;@ hY4頲_"8[+|pWG}Ospr-E! :o\ӥHR ΊjHJ!CƴO]hk"*m@<] ERߪ*F/$)vQBE!6@;GQ2:#}1_HW˂MVPc~4GpTvI <P exl R̸u͑|C%Su2ժ=|b7weoE񣋭87. "g< U3RazjGŰ8-W-P/m 67 mO@+Dzs|Rxq!T G'`rUB,xxcPKAFT !蒄wiXChlH'y=9"(6rbY(7ͻYmcF ecfznM8-AŅC0uI~@X砞{3If*} UMZ]rN`d\(3o6$mjl;*'ďz˒ L\]!mh$iI0&vV"10{}OVVahz ҍ_4$'Z Z)skE"z]~!*_umr^z_EUb{}Mj+ @<uV&ƹV%q _mmz^6rou!jϫg錰[˽[G@ xۇvНo3W m0AzzExtbm q\*2 nGpy%uH\62!3K=K4GqdTD}Yy]=HwWi02-//nW*;*D%w ɵ$c]ۤI-:1HBVckhΑj*0xJo/7y-R yƇe[](atV֚j4)RAhABS+aN..햬Oz%[PZĵڤmon(<.=?0(y[Ba[hu_.]9< #9 CEZyҵZ^|~ގE[_gS91{ B?#6-$FiDi.+hR(ͦi9gx4=kYˍ :k ?h<ϝŐ+ݶce͊6x^=F:\|*X!Ɯ8_@qx4=Z;O9,$,|cʂ gN?6]y0 "qu+U $NU@5.5+/s@gB`Dw YD g 7c4{HABʜ0Iɰ,G.Y aψ@ +Gߣ57Sc&nt~ sf" _ѦX9Ę%y/!L8eTrzL(/gmÁ5;%[ 9ja"oXpK< fP)6'>B(e7Pc?9iPieW{m(l,ՅX?]egmч솎=2D3#z<̎ 'MJ1&O*љK3Gc ,YH7vr\%R[|4g*7Ra^ZgVW@MsN^ELiMw$)|nEUռKd/{ 'A) LLf:8 i{9a|ω㼙f宲zI9pVha9FbZ~zh7mrpO:y|bҤpJ *!>U7^WROP89MRL.#RX`=ZCEzmTne̵DzkP},Ό]H$u?x'GAsE &^;! !5);{]=_mxNdfmoSH2(#-'sŴy3oQK\e7q Gk<~gxWeObĘil=46W,@+\&Ɯ)&p \ĨҪ7 9 mLr46oG5Z:ZGHbvtKGE)V{#`žoP-rC,cB xzNKp^uD|j3Su|+<@K=:`5(^͌C5FPՕ?Y5kE!P|!JSEz},^`ҳu4]T;ʖ8acL3%nBF(0XJ9+Ûy8 [5xl.'[v|1>OVJ-l:0h}%($C7|Lv6Wmf:e p) !)+$KzeFD*c= "T50>G : 7.fxl-&HK:aSr3ÝWK+OSc͚E$N-(S"{ BNڻ1)eӁ fY\zBEI=*}§΋/oI/+zRmfs S,9xdlb5ti K/]1bq|?-&-?m'܎a}]]4X궘W鬳i[-HOa(;<_Oenr}]n IG o0ro9Dq E9~+iAtwJ_ I; T?/"iԮAGP#ޯ@&x -J=rFs ]4P1 ; F]`_ .NDL UؖEYy:&ђTX./Er]H!Yì @X#Dp_cf󉮩%DK|a%^G[%YMu(J5CIz?:RV4MLe/w4'1x?t}B5zЏ|o͵y"\fşlcӛqR> ۮ-nz9SKפ|4FOEbN k>.>^-/_*YǑ9C  ~;B!>c*$.K4 GSr*qp%MFZ>Bt%]"@;NMOb^WJKQ>lNy>{V^ JNd,{$ Q5=0WO_#kK f";# )j9=:u~ */#&y`Sc_4se$>P6qPA:I3NHqv:wd: :/t?+0 wu-1U:pcGFWQvĤc(Sq,&NsqĚ);KUH7鮁p ?gRO߯@<Թ] SGVAda(˾ #%!9jIxn?"rfF1@w̒ ӋӔlWH6 >O,Y&s;ʚ4X~[T$jQhJR,ħտ (f`b !r qJʝo2GHzL@^kwYAOLca# )b@o7JP4]5`gNb;\tv3ނYɠZ 4+#nh7m^&%)̓m_B2jbWNPh4rdيLa3lu*&G uSDlUO1N7Hi ʨd T$Q»m5 9_%뭚uEZ䢈oXwNV#g9^5@o}ٲuԜ,=ƎKFv9qW;p6aׯy2 | Fm+ݽt TwicT?{*S6VPb~K)\D=Sd `b_I_ӦL+㎔4V7z!攖[tLх-9Zi1 Dy;|c@V}!xPLLi}-haMAc,V3?I_~oJߺg fjM[/&* M")&a4z)C{45+ƎJef{AǨ^)~L:8 f}. 6@¶VP&{ܻ,tw%G/UQ@d>@a վ0L/Eej' _X{Jn #{ 5I_ M8 s&oxO30ɽ)Zϔ.b<9Z%'C.C:$ / 0*$#Voc#:d2I@;uˬWQe'omBf[XCZv۷jLc>ڥQ; rn:Vi++ڢRAͰҊm|زWQMGwEϙ⠐:.y|ʫ:P9ha}i rB*Zm #ٙ{୍9AejXWA#Xc"{);S4".# %L)ɔNvԆx11·^ xuȞ)ڣlTn,? тB7KO ')E,S;2P0-W2*(.&&pV2Ayz6KJqYuUU,v ,ʧZ((#YU[!6&v{dWL~ @syNw6$*%aJ*kI_ib(tK =E].KGf~պӥ'кM5kVg>%l3j^:~^Ξ~G^U)|*4QX9Y1P"/$e; biP3TF%-␆/ҘM,ܩAL.~ҡ Xyt}?m]ϧJ1v~քfMh"*dGȯGw뉝Y6i:z ['>o}Kx\S#AҀ}`Hu23b2۱s6+r@ R|.; xk;" dBbqʑ܉aȇD..O;r|ܭפPl(3L5Pr ʌv0Dʀo0 b(7.vċk'}X,`jJPM=(`qbˊ=*}cg;۹]i\K(Kh$%L;F}+VbEu)bt o!Ted%X&젇3?~;JӼnRgPQ›[Sr˃贈ViMY kG[G0=\\r$D)x0ސ#ůjk˜@/FdBZ|Pg? xٻ\]N`'xJAK,?o!ƹ4'8lY(;YD ]^z.IU7&TiZ8+'g*pKy˓Q<ޕ^Ɯ*_z/%个ηQ ܁<߮bΎ LLi(QEC5[0Lj'=ˑEv#>K/2RE 돪4!w9rKzv)' X]BUQc/ߛ܏gsh( .U p$̸}WXDY7tt˻c)<>G2h}Y4v6Lc]sSB)_c.w1ٕfd_;-_ND*<"oq!p8݋fX룙L8tfm_kbHHu,CAi0Llyz+Ь>gC4̷n0i C*~k> EElR==A%*Ơ~8HlDuFH:Z^_a ͮӑs Hr-`^k젡6?68cEc6h~v*ɈyX?Kwe $ "&`,-$8FHߍ S# B, |昫9㤹ҖR7s]1JךĞ=fTN)ktCep̪ןRC4O`.V.2'm9DJHc=d^pP# &0 0Oq4 bo7J$u@ S;\J-4YZV(ش ou]>5pv0c~ _r~*;XDF QS $鋴B|C;"sHy(#u9#npFdn.;mmA"ӥ ˨a`]%Lr -v1yxX5e- h0ܮ+?Lw(nOGt!P:Ѫ7 u>^ y r|}|#o)y"k527*[C6u9~-?L"LW[ty9!Onj{Uxk 5Մȼ̒*S5WUx `V着<3NOŐҸ[ QEjk[#\g)vs=fR%IdzAW1/Y iR5L9Ӽ˥,ѿZHK^ ckjnۑi|ֻi"x;H8S52-I4 ͊L2<{3ppŤkX4]m ۛՙ_ٛ|+`ZI^ 2̉>Bޝ2щ]#ܿhBƲv0Ί"L>з#Z0(?Pگ))ZqU/#.{鳑 4<`q[˪y=;*Y,4W:A}H:J9{B.{st]z͒zJo*(4oC& Dz38Ϲp-0ǀY$xήTyw sY{2OlNJlͅDd寝EY.|?lys.By,ȹ-(0wiaRi1S $]UgBeSr~*8[WG˗1( 21FT頥p,Lşr AfR  ^#PUR\tOAxLtǁ<oД02e>Vr9}B'n|^q6KХ"Tv` ڰP*$RƸUwrŻDLbpޜi{OM͚x%^!0wPˇ U#>i-`>#&Zl129$%_ B_~Ku$+AnՕ dlٹo[p=kthN;xV0tt^0)2eCz\`on+ås8z?r) [̌k4g$!m YӾ&dϳ{j68IE*OOQطXYLUbZΣkb[ͦdr)s;.*āzکPy0){!8#78o?"8 v;9T\Fvwxw845R ?''r] }A!͜f>/ukqb.aRBRV5 K?k1G(!&$VyoDzaCS`fPi jc<኷HCw8 r hx9bi\N+;ݕ~Ú1 OĄ` /?&/XF-y"+a#:aXl<omNtIFu@RxQM=Ң*J}X?XhI$Id[C;Ud1<)*%NvwU7L>T qɪtO8b+2^C َ2st(g+6fOPttatEc胜c g^?A `t;"նE[w3[_ i׀ گ[#Z$IF^ 7?YO!# WWwB:Z&ppi!Щ%覷NI>^RH!Jvhn@^VnpflD~rJd[{?|03hco%y"lc!)vM/YJ=+rzABy`7xkU!Gs7{ ~Eѥ$_y’e 4,/V?Lgg !7ILnW{IzzeTEB&\.'MN)+4X` -Djg \\aJqr'-$>%$OrAr;ʀgOBQ? >0.: Y矒~=A6 =# F2R𐈦)>Z PAYĆ(. b@3a2}!>'&LϹ!,1^]#@JoԹG`Nv]=$ ׹u_QI 2sJ@O(/bm[ -DSg_2>/u.ܨa śW<¬` 51 ӘE(blH$aqnm'ф]&E 9u06Θ:J jfLPcnAzEpnv I42 CG5Ze9[EWQq!8=J,ai>7&^̊6>^=uNTy\ 딴<4Od>" w3r{4H)Zde,Pf4,-fO:3_Ӑ @Qs`pdkb8s(rzF:6&:<=;Cb7e[·޷'j<袟s-64E0 -\ n&5-kNKM(:ӦiI})C1<5΄3͕}-Q.vZ׆*՗ߏ:PcBhW7XK~oYp}])\"NKC1{a6?}Z+Y̚ƛy6^8LG_W0hMeGڨ{ beձY~BtOa@n|ۈ'#MSHAZ8\dYpXw[h!lX85.nTo2`>8w2LqZm1Mb%ti!3'7gV5hMD^΍E6ުʆB⏻{"WAb{6Fj*H4CJX.$},cPD16wlnmCN}*o]׽iph TFQGDHP&=}[]I\BNyZ3F77KXEzHØ&| îX4raDk $vW`Cn& <2i[wH} jF0PkKͲؙ%ap $. Ӵo)4֒`te0+]znbg~'aٌyf|XT 'CyffL% D~|{Z68U_41zh)}5n@k»RY]҆:PK.n}E*?csA\v۽ܣˍxeUdVFqfElv/)w 7([!dFwn^'=:SJj ^eR:{ljqՙmiߘM9s}nM7* J,/\qZV,i6¬-ѳI7ixKI@8BltKaeCƥU$[(R2ts#[?F)OMyZ@` zc,1/:84CVq/37nFZU[2ɱ{vTGwvjOR}q/Y**0Q\Hqp^l?wg,'6Lہ+ˮ*@ҊREi|)r.:y'uEL9 |Jn#I4Bf Um"ɹNPQn~UGu%uVfz~'ho1aobH-^>)@D gAKj#[ӳ7A=\r~:77 3_C0>v@K^kjd6pڸz[)y7#R ]Nq4EdA֜=axz{G=K0Ҁ "T!*fͦo V;!WW[C"-Ò3!u;&Jq)ۅb-撀\ ej+JDo9K (@I E8LIGM HI^4)u8߶ho|ږk9$%~-+x`p\Ϟ<"j aJ_^^*G;=Z #i0[MAGz/K1"rm:RkXCƚx /BV4jb9p3Ho{u -I;(G )ZXR/QS$آl5: wbmE'1odm-!|Ȗba$]edI_n%CԷO!浆1U~4h:+3(Yѿ&O: @h7 S FsE_ !;H2l"-NDI"R#SmMV7z%a"40| 9N8.oS@%fR7e7ZtQəJ 裷~DـRMr~u_==2wX o``yf0߈gnzTwocH'H1iJj}al$@/ZvpQZfNXu)L5"5Csf\/[0h3؆ްpj" V(fA֫rvc~Wֳ/3hwb'0M03ȫP1@[{ruliC{;P=s0p%N짚뫮g*Ƴk I,,f6 zr`uRs:|"W|R5qQY0OM}8#Ȕ}J8{G4 uFIs"͓^Hk>8xqHDf3Fej+ӂY3! 'jCʘÛNt>>ZsuaY^2I}ZMI?%K}`wbNݙޢV|\>cQ9n9X->&t߿ ׭ f@oZ,|GNj^N%;CN@TQΠdnudjkXK f43g+A.rk8;u+;݀b$3MțYK JcRf:E6_ua/%~ g:tJFmoԓ֢S}'"غs]Lk.4?+7ìFl:YY߃{m08dAm&)zEzDVf_R6JSm8e탫7?45C>v޽26bs(Lbc-gG0dZ?Kn7kްM~pp/ ne>x)pE/0,>,-Ky`L G|ӛmW ʅh8չH /#^$w'6$`!T"9nٱ)WhS ʍC$Ӵ59P̈́k_i@tkN"u?a~M׀+ͥDbx-D!IKpx`-}7#wJ#cRL_XXCZ$+$TP=>#fre.wo^$&I8Eajid۔qoɆM3NF͝]s v5ϽO.b|V7LJQC90H ZS|4r$} >N$%G;ftQYyƬ~}RZɕqgmZ)n{<'rGqț*( ! e 6==Pҩ<(4f19k?Avvoa4/R;,Q"6W6aRLSAlmNпEaمO  YV u}L6rfӓ(|"$w_Ԑ1~ooht5y *9WgWSřЫ4 .UsANxMZ[? x&`n4 3Ac96z97ez,7+jԄ/-4@*MܴF5lr9xͩY,5d.1E?v'kzgU')EL|\'KWKp=մ)DSSS qLIF %p|Q'4ڧl@`T8Xoz2IQ0 m/ z 9/afll8iJ+p$tu쬋;s M\ϛG?]>CޱV9%'J'_ɍ/!؃ŧܠPQmtH>L=nc5}Be~*7MrR5Og%P! 00whqL7oy~́=qJMtVN-(8/0Xyt/ePߑO 'D 47MGyX\ŦQz1Z"#~ك@oB)At Qs{qR$@3T_B$-MY!N5p=EMC2GL?>\Q y6%Yi_9ߨ!ڷj[ cx @ ;$hՋD ii4hjqJe)xI 3!'c̊4WLή4Pe^c|eXjΰ}􉻇>zgЕN.`~Ÿ@~}(w`;Qa[]Ɠ${ޡ P@ |u5RMbX߅ c#UD!=G񴢚kK"G"_.P{ֹ} ,N2z4QnP.}ڡNJ#~HLyVZ( ESs" R"kPXnuCg+khORN_Diαd=0e/v_[ =p.OBRspE_dmm܃T.} 1ljU-HLں"h16O&? E!q-@xom.]0e{}b{%ٶio'sٮ!- )+b&/DԺNH4URqzž bW֕[Hr'PveQan<(%eN+݀o} hOhSՄܻ愞}t]+swB_zu5,]a3CH_G%tkI٥iٌ _@?(5f2t#Eǧؿ{͎8j|e;![ٲ,">%#QinyhX Ft~S7 *_<3ȂaI [4;Xr&j7 ts #~g%3|;T 6î ֚g OMŝס;M' M*ܪ"Q endstream endobj 24 0 obj << /Type /XObject /Subtype /Image /Width 288 /Height 463 /BitsPerComponent 8 /ColorSpace /DeviceGray /Length 34997 /Filter /DCTDecode >> stream (3c,q OH6R0S@_ E@m*>&! #A5w _pW}WuEX)oIEg5*i(<1܏=V=Jh@{6K+gL=:KYl O{o$r{ǣS/7БܬnQ-{] }8zϱꇛٵ9YAḘP$wm[CrRQL"I5 XB.?Za3ZV+Ë^'x  dJ} 2*q?.}NA 4ǧ@.w"\Hg, ijgivQtFgFZB4˴?oUEFq*>L(!q=U|w:\6N\87,J-p?jSب;A{o%"Z`$R;;|_^ރ%+XwJTXn0$$ oeuu4ͯHi?lHȚ7]/1k8%F0UY'wQ08;Df>yv" zxTJ_41h#V][=oo\ !߯nd6Fƾ:+TR/ޭ ZU9έ^ȹZF?{\ǁZJ;&Y灖:DKn)Fjt7`bWX5 rˊD9ߧJGTRNFػ.gM+T|n\S00J"t0Buwy[I;Df#W֑٧hbLOzrQː~!0_nA=z3 ;pnնz+0Р&;`a^QTzx+IL^p;i8 Q`bD,r[3 "D U :hjE42>ibQ6Gah67)R;(ޟ?i0׆{AVwub#{YȮXo Tڜ֦|mj 1mIRcM銚S 3$R21v|)nVp*R\Ӭ̴T_m0* (x >7C>MKON`*88_f[c3&?L{ sON|zMR̯-JXŽp?_қ`TAWg{(zq񅪐3X#'g[LfI}Y}K`D63-s[.MBiE>V@ZBd={`0k!cj082iA{u@y6kܟa>5`< d3sI]~ALot۸M&εCM/I.$(&ɱX{j8?h; ;- 7L_{8@0'@hpc;:!=³陶[oãxK4 !O54yko6Ԥ7ck_G"؇,~= [ɒ,!o7%9Ś5}KraE=w|Qhw&fցܒ,Bt6jgPBVǩC̈́sƫU ؿa;<`B;d I#1Hh!y 'SRi$ %OAٺ^f؛gxJvWP.Sܫ n K_Is y!,N1U檃Ⱥ3ƺt(М]ҀҮI+MuwrS'ѕ3_(Oٺmi˲.8o#?*ʴ+c+}\F ._DLvɽ Z1C&E"2=D?GGouowkDD2'Py(نIQ%yb٢p2P niڪ'M_ޮ?fPe 2I}h M-;Ǘ-T7a = y\Dlg(4 KW􎋉I vŪ=,ĕB#+5< 0QEp vk?zҒ=@xB|/ie[t.:$eҬT,,ѳ.qIYKRUHBiP,sj.G"SGs5m '{w;e8?ArO^)=kǂY3rT]G¡#r{cاO3GljAM"]pיtAC²*e 5݊~^x(reCz2e?wD?UF a.~{DΧ*YYmxN:0!:'ީξЋ8.gγ4?/a\Th@K97rNd쇟.^%"kғ-[4>k'N;GK4.:[} t`qط?L89la  ;3hי.E{q<šZ/Gq^ VT8u_^d%V P QϰDY%8U]QQ89u,SzvRr g\xDL 7K;"/Z=Tb=0QJi*ŪJNwĬ̅6lGz{38ҮIdQ78]Cڴ !gi<;|}~7KAau8pd>f"9)my$'Ai/g~ZeNB ,?xdŵ2Dzrx)K8eނ}i8/Z eƿWHRЦm0!kӷ|g(hUͥ/ʊ׭?TLs $rH|f5#y€0y}YߠK!`{d3N]؈PxK *CJWoMLy;>h,'ٔOS_c<ɲ*Bޔ{I= TsQ~ehA)@z̒zAbmkQN@Ot_4oCzh.ͱ8$Thfwpu L'i?2˥CT(3ǵdc51_J2,|hP`m1B0+oSk&'I \; ӂNӯ GU#^W=#FNnъLZnZC7YlH8?ĝ3GCLɛ҃K`ؽryrTokR,`Ko?.MU}e,;,A nH@_Ӏf_ 2=+@9܄Я̡@ Ӛ$#LLlPXĎJMic͍FgSaWVl 9]"iٿ, "^#=SM;'!׃’čxE-c{)08(_}Gl8n֑|Y~#Mu}z=4`^N^౅ )' :x7lid)ObvMI|.H+{'>/V.Hm? .@&EfgFh]M2Kdk?7mB&׾uJ ,K_3v*FeԥEwRE%+&ȯ+{H[XrPAd~y26u;D'Fi9!ri۪L@xBR9 s>Nvףx>-r5VKgq+G[dkj A,2gW7 *D p=Iޮu# ¢H<{:*0`/՜nzZVH޺F!%sP* pQk7Ңv rn}+}yΊ,t=6x&ʠEFF T\ul `=x|헴GYQH,jLhEހEi-]I5@Hg [}KD3Iu&TB ޠ dh4 ͥ_kG" &صLtUr%D rW0>4oy̧:FS$c_!_:ׄ}`d=,,V5zWFm'I"O,B`fyDghT`-D;Jȹ2S?0˰z)B\#%8(ՈsR$v)EhG ##,VA'M3,lN)j]/ DvZkkx{~xRM|U>=>}X ̀2~=gyhB#/,=$Qιퟻ?-(5u)+ؽcV!)IvLsCxV+.i^k43wvc`E+47Pɦnd-\-g}e]xNgZߦ3mt1@qKv/0mq2_<}{:\~ %gѷc̆v.I .d3<=m^l*!Dz+/Y͎-9EtU8 LF$;9xO$_=vGꅦAuD;U$q]U&b?{ ![;#~-:<`Ѥlo.y>FƉTtƧMކeuǎ^O./ 2q :N]G݄ 1,w`3YGƆ\@3ZoMަчyW$m.zN4w9,Hb}!lm@<f'_8XZ~kOo0lم<Y-rv>1J>gt߁4mH%.ǠCԖie0UKg<Ta,Xi2[Oh5ӑ.&OrGU0HsTOZoғ{euVrO5;`U /qJoC]Bw)z2Z\fB}+|H5QB 5"{ЃWO]LU[RNVhBf`}R.(c J*{̻Wr%f͑Nu:Eh*İ"[{Une(DcFon-*zYKOZb6,cúl:]VќAFEiS1u[Ѓe+S,0܁&PDl'z 'GG$Ese{ld*u ebV5\&j}gɝ:O DTJ])C4/;L_bfc&䑴ߪ .*zZi+N )s htʭ6V.yNJ x4zƾ54xS]n&KWS9 nsbr) b 􌌢\sXЅ O|v+ZZ!wCz+TG.5Æu-rk?HVO' SWxܾi~1cQgL潹T#֕ T'i7YYLp[qPet |nFi7TQ>3i!UEl#|8~hq1[]eO/o(ȥDp.Rh+ۥ%cݨp GxuI, Gcg6ZN$VZx`{2F0X G4 @T\cÌSWW0dwh`|DVSpl\aa,}{t_'{̞h}GeVI϶s܀[9\Ζ==c46kDr 9 9F}֮:ǑЄD{K:{'~BKav}n TuYɊXdF{vW(X*k-u`ZvMSFP_e](үG0<#WAvS==xS e}_0]V:m/o'^Pc_Ԡ`g=M!jn&NxGVĠ]-2UFplVBӠ\8b&Q#P3$(kJeأpMΞHVE O:hp:>N|x NWFZP%f @~)ci2W$}QQTGTo=ď˗U*,GeBfհ!y@n8J8i6qc>.]JhJ΄G2T5z\VP+;VO?NJ x:!Ƒ=E`'{K,V,]}/pB%XXvf= h߹fO8aUyո*q"좆0X8sA*2 (UsAq[hU{1,{D)j!;iz\kmU=zjך+ϵug5as `BG_4V5W^m.B,w%QB G3;uo%6Ţ{ _% $JWZN#—:TLWUFpFgtMOuL &qCN[)!"ڠB.AE[<y!y66  )h݅+ZYh+2WtQڌmY+5D"),D|-jrܯF㒰]^\Yo@ɬMqOp !):= 钋쾿Taa[DISjVЧ~a[HMMyG, ms#Riu4t}N1V0圡P0NdI?baҚKY;Lp11JÔ,ضwōY@ ]Z-TF).>Q2$$Mq Wht! bJ  p.RIW>x̸ zz=0i[ AtReԏ29ch6`ፉ5u^r ɨK􇈝bU=R-n~wޝ[~`Ƿb)/}l-n`5gxx;EXchZ d7y;Į e!FNqQm \0p&Oa/|F*լ@ċ{&I`4\BUwHмt/nf/XƩGfNGNCdmBU ¾ިs.p3aՑw^ ""Jg0R!VSsB';{!-r$K<( ~+&^XopNJ<#y^[! ,%ci/~P|v,Aj9@pW{-I26\ ߵ砥dKj߭3+);t S4z KG ڒ#z9l](U[Amټe|væ d,P)Saݒ(?.RU}\Uc 7R[QؿTM YPIPd hmex"Gt'!A>i#Bh} `Ԏ߼Gqׂnb4ޔG B rƣxgr1lKu>aMܲ?ˀKJM#=zv&Z4{?VnYƱoUZ("1#޵әnl@W388y3&Ua;Q08[/BČ[=ngb㒎؞RqᗩD Qrj_zp6*Ֆcˌ)o{3^9йQ X|avo6]OGgn?'ɡR?XΪ~itpqyߩE,FT0j㻷ȠC;RA3y)*_Sf`龺=`znu>7-?U믭m; nYN p>n )GcB^FqBQ(XUm|ػW$pɺx>P:'Ă˄+A5Uy^)]"Ų SyF>0L|Y#\Kъ q?8,Mh;PM0  ܛ*TgL,&hƕO~يȡA̾%p~mqZ6?<$_kP9dx>20Χc*d'f^NBV~Ez(, \40pbO=>|iGѱ0zߞKx'}niA^u=ތ$2.b kSJ'`K8 dSZjԿX~,]xT.Q㿺s#DiL_9I>ew&ݨԯ Iݖzp;Z+68ϻuwC-"qhZ״e"JUZ~iQ%Ś^oj.XKAFvdIXD4ߵoE|&z 7J送n:!F \2=wvSJx 꼿KߦI ]j9s/| KU mGUC0j.o;!ihP,bA*ŝs&PpRFa(Jy>3%NdD?$%:G2ۚloSTy83 J8A@=n7XW}Qƫ7=_Ah)(!g  [7ܫaT'/3|TzRxC.i k=gol3"UuMḱ} 䆲ZDR]mgKqv*<_`{_ŊHLk|COI Ѷt}qZڗmAayMJ& } dKAFigT5O}C])Cs´3wAso[uz=(*W <91:Ϋ2M.L=,[:{CԒ:Fm'ↀc Ik*<ǡVRg b"[cgB> >n$fd:SWoW易:+f悑-D1U;B!1}>bEؿk5 =y+y\kf^tMr$ɲ\JN֪vpP%տ 8+D rUTS:]T#Uy|Qœ|X{cc.6X9mF*{ob՜_"X<,Oܗ/AoD!A8N!V8lMψځ?ú\ɋaųبO mgz+8 xTm=F=BM"eFd;OYX^+?H:"vJ#雳7dV M+]'rkEu]maڻGڋDH)iPQi|[LT1j+(4b!d@VƦ|l#7Cii8qmi3 bkE вцVKq0,8{uEХ+gvF [u 绩&.S`` BQ=@LNz(9WR3b`K=on_>~]qnYK7NP*ZXI#K^YʵכC4Ԑj įdYZ'Tz5'L" }DiObRr+ĎK5܂$)x0@tAK$*SS%_t8 /Xyu%)-`ZqUxQ50;|l 5Z3Z8Z_+i9fA}k~޼(CA'|͏Iu;P $~FK63nKqӥ E#'? ֱ^vs4bȤ l} FXY̜Q HĺANb:>]wTͯwa^dEsl%+ƈv2aq J1OU; zgx0It,Ǥ BW&(!)f[S*{ rN%[j+<؋߃s8Wbp˾=Bؘw, 5:/'[y!>d:A_~3U^Rwul7TB}qUUXV\_)oo,<<03 @jw;h,%u5kV-Jsrێe2LxY umHVpDAКә*+\l~`,#'TN;-Qӊj_V/m]Ls>Hҏ|zF'wX2$Vv X7*+U$Mz w*#gvIN h""gS*o 2\d\["+NDIcBE!O8Ί>&!v)H|"<ӏ7\V#G"8 ax/ |7þX=xjC̲`]M:`XYS?^+( Qs/S'v5[8]m7 >| /޲~U1J\ ^{;#XJC8tp4} ( AqA?t('L\~-*UyH~GEy [sW$85pA0Vg ~?[qvۧA_!*Qu&4 ELfP, zȸ;}MCυbFv@]@*)`m!`+11D-1^;BlO$WUC$$O7XuIt9} Ce6_@Y []|Q\!ƶkckNgP0nIN19}ykJOI(ZFg}bs5-#([C*xwb^<&horɠ>#XG8#n&0*lZE~ ^f(1?-E6π<ր;?Y_ m|0 f|)JU /IvPԜ\X(4,~9[k5h`$`b*lFl^Lg$4(](1lDž_ %h$4:`ESzIg'[z`Z~<2vFw杈:w2 q=,awH]8$1 A1 -i^&w}+"FF<Y0hR: lS(sqM >!f[q-MvNz-23`~P KGW)A(O6zVy eQ{7:^^.Bk?)09"@9b6T<VE0nv ò'ET|t3RNxJYP)-{T N[ppK1B_ !%VbO'[|-_W<띫ir~i*NJ㍀IenKh@76_֌‹L2:R?^:sf~}k_{e Gޏxز'ݣq/y_u|HV4櫡>{}QݦQ_4tyY*Y"MFX7d*eD3 A4e;/uNvP'='q(lv mfZ~AiUFRաu^4#g='pw*lXV?]IG[F}y=H\i&>ƒQi찷l3j@TmڜLwd-16a#$o*ܖNNbsV@-ͽs O=Yb] h_CK ?d4i|;Su@='!4.]v1p`2Np5$|mzxΊ  sTdԺڅR&MD#,RuO>$ar<+fyYF)lP?n=f kX+%\վӞmnutfЅSQAiV!ӧI!0@܉{-4Y$.%apDNsrmi3M735UwQt>^CN8z];no])4Մ*<|M_sb>DbY ]1Vt XLvJpƭ)'Qޜ4yMS:V&g~J Yk_ʉ 0f(^> J)q9/ 䩢҃T,Z>ʬ|Ɖ-z/ƕp,`-;PBw1IwkF&տQbi Vz{S?Cf?LP8 *mB'~\Byi<:Rx[Ko\Ig+m:w̏.հǓ@K|o* 4b " :K_ ~# Nx)@f9hFE@;LKNG,dDA0L:ZBj~`&Di FRabb&QMsO(BWy~ϱ$R t:Dр].ԌZE׍A&&ͬe' Z zn=ov@JlLO!߃+ţVY σw@;lL/%S kM*6-;<|R}mA8ogSRy'f0ar6&¹%0QOX~%TvdssG"tr#UK( `O1%&;k D*דRowP-nIJ{Vүa‰ʾAU`y)^kmAµd鈢:0N&?]1aG!$-^^͡^I e8k|l|7FT[/~$+>ԺbЃ9=42|#Vf} _>y$aN9heׯAZYM"Y-2v@ IXKet3C|yL U_l({!Qh=#Qҹآt)_cbe N> W YKjwӒo 2S+8A39mwLCesEr6di \zuN'W8j~Ay0D3p$z#Tܥpݝ3Vla$W|q&ZnpX&>?)ALbzdVmMMt͑q;J_Se,b$tbfje(afݡk@@с6_6p bR(#Lii3?EOLrOKJAK>|)t25,a?$ WtAM6} ~C'#-J@z .3Usa>j-QO1_JSxf4gRZX>Q tKq$f%+k>ؑ9 k'CPc.~7F V/BR.ܼ?'<[kiH/Km{K: z-R&Gg16,;2 8}eIlr١?.oFtWψ,9jo} W:%wJe\t$\.$/{! 'ul.Q'<)7!T?}O* (fGکW2jN;z5 P]fU'_%l3P(7EKQ-1ٵTr; n( V<?ќ]#]r3b\C2O'q+3~ Bt1#nP~\@H h->Ј'^ufHH7bFב3Z:-[\g\9S: G9\+4ub) &&9s ԊuN -Ls40/팢9*EG&@3նmX. (vb_L0[EPH{|X[be<ҮE x):LhVW>X$녁1S" a daYpmӶ٬7 c9YG1~&q ZzOmGxKr. 0h0/tQNO5{H VVr^3+G(5`y;=y'yےF}wR:@~2  F]X峯2/"D vjوgWs{rJ,kC[N +5 Q=SZ٢mF<<3nivB_[_n[V:Ö+K7?`5#5 NL#E~U!͹YvLt >@M\ [ ߇pa-$1 Ur ^k}p"]֙<ɯ 0?Wo(~O"'*9V'2e$G&!'T l+S3YndBSNyg֍n= N $[?RƈÝ$hST/1;* 9*s|xȞ=BW.{;-A`Cuıؓ_"*R 9~p&10\GN#؍ώV6?i5(!T8rDT}GA8% 0ٙdN͉Ub &mch@zTծ`XM FԨ :C8 bQ-h$|NN6v1峆%_MzqLw4.&Y^ }QY!|5RMLП~k7尳Rg+\O)PǯOXZ\Ȅ^+:b`|IصCk)4V.HGhV2zI(K@:ZZlaUXzٕ{Y5ΑL'"Xۜ?YArL@=svYlrt᛾kEy*VhgZ5&4$(*7]` /+13;`LciM/q%E,oK6)S+@'rbIbk}hnx)o&} Qgk-}|3pTRDǗ21NޣZG]9Ht#0s==7ZlqE)4|Xm!>. }\זo*J` :BhbZpɮ^ψ0DGĥ6icP! /Im,ʐkb~|I$zZ̛((h,y`{0o5حR(8祔EӔש z6Z8A {Hyz}{XO?wS3AىgvQ4iAlj3k4K }L R[9K&QUd),$~8wgB}=1"S27匃ml$\q޸|0nmJ1M-Wmhx1L)B={5r')L8iq7_SnXH\pNxq^0?tINkJ؛i~4} Ep AU#V4Cwۅʔhq;B]!屓'qh'L=S&ڀVr9K*]kf`&UMLvI\K#WLy+R2Dף-Khmm !"a dZQi w58U 2}{MGL /C^DwhŒ_-w 嬒e\+UϤ[RbghnCvr kY_ȕ,e 196@Ȓy>G l[-ɹ)΀kMX筗2'>O4tI*0xL ݾV9 $pkou҈bc)#(y{HEKF\ݕկvS&=cj;`} v-F5m鿬 Uu)x/eO^2VIfbIMui6M&%hhk'u4 a QBAG8n~) G>COQ=\Ĥ])[XvLE >!~u7ra+/eΡk6owa# Xl/֩WS+B{g$=ČzLsg_CĶk+XO[k=ծvFq11Y%k:(8+iDU"čo}4Oۋmٻn8cS^OW;Լqp^J$&ft=`1@p ݪ k͝Z X]:癿b!H1-98 ^AU6/SG3PQYYܴDZl?UnG'Z((=?8"tƣ%.I ^#M_P6`]}W˙mRW1@gEI&Ws=7 B`͜L 2' -F%o|J ^Xnej$DԯOyZA&I=eXH$_3D77ɎQ4;|6'WB1y7#@"  5 Tnv\hLsp[Cb=BXA3SZznѸխSL7Uqf0g2YV*3Y&G,F6V<#;aa\_oFa$*B !6>\ۗf 8l}EX3H0@VQCW2%N-^]Kʮ(^f6 b3U诇!V4g~þW@լPc~,w"+:> UXtQfE~Vv3M{yla;D4 xH &qQ=V0l,rhnܤC%;,*{?zvcJ')le.ABsa8Xz$zt-i@w,jk9EU2M=+`5C-)(g ' [*8h?Ioy3K֗Kz'^lfS[6kDï/'/q 7$3iˋ0>ą&kERP$XG=#݃/m,ǨpK]\yhi2}!|( eM.;~tU&=ր6y2 o83c^XxI`r,4mXʓĕ:B\9$߿-ch@+a925t$@IsdXE2Ǥf g-TkS.a\"ܢqC[wUBu z)Aq5o-70ӘLʴ8¡fjK8ZO)UZ%L 9RW>md XFTVtb\BSgJ`ۀ4 W5{>C+C"\p&`V%wՈա0KhfOc >$fY.滼,cjYԼG| Tڝ (ufCf0D8>N+1C" dQ7{.L^8 m|~+U$T$T NaϓaQuwl[AEMw4]衦qfkϞ~O{$e.1ކ{:23_'ZV̵]$28 푉 U$kA:Ўspd1f`7 bI `SvwtK60]ȝ7. 8؊i^K($pdEYBo:%80d u@'Y`ZE|XtIԼMu 5 $S\=*w$Bqܚ ݪeE|čM'폖 &]b^%ZmБYO-ߨ=EQ=+娎 8D#§.퉈u 5gGGqr#KV"z`wWLp@9ܽlUJ"ܘ*JS`Di-7B=(Ɖk/(h yeic m%078 *c:[p Yض^y4ߢ W\U6M"C"6Tˆ98g63_CbAX 1Gcؽ+>)Kc;h&$ÒQI,5iZ V][*R+ 7ʶmTpO =tq;hд,/N{+`wSKz_8h-ĂZb+{8[TvWuBbq2V:< s |N+gC%lge)uq [ T[U`m"G,& [7 ՈKt.Zb.7^TZr! 4%s_Fz.؁ǮVyY\Uf5K$;*>|h 0]Vv"[y'3j7Uf.^HЦ`]6ջ#Ӕ@ _ C^dևBU!㤣=ވ($/KjD=@`E]!NKe!Eˊ/uB dgAQGC`CԶNWc3=OԖ^׾Q4#i8xєo-w5lxC }jҙWGߪŬ9ST=7$CgY?e2Ӵ)\3=ϰ}H/g[lovAh%OzwZYm5#bQG7Bq\e /QgD2k8 L PN#jm}؈n.{'Q#@TVQk7 %>E1_8*[X% oDžz~]m [°Ue C~Refx3lx+cJ|@3ƸͺWV#96&X[4512FRܐҮQ>Mk쟷3"k!n;BAX@ nXg 4t-v>m>iyٺl(z{'#(C~¨-1Lü4F')bt3zh(QDRmʼnHRshʡ191Z+s,zSFzա?!䨬Թ$@5QGģk*w]5Lu62X;~a߿TwRxjȸ#Zm~^;nbzb!>UGޭ|@c}7Q4*5 u9 REyG}¬L NHDvU gߠ !Byؙ~X9Qz6Q]T N+ן΁Tui{!orm} -p!عX$wf#bdj ͐#zsFT8*qԧsN.H /T j/)2v il!#erհ1vt4%|yms~z<:z+f;wWh7ykƤ ԺkNVMTđ\<9eUZŌ'b:A]R&Z:ROwsGALoiNbpੇVr!D^n\6r[|?>(ka+e z<$`ONL]{c%;!H6 (GFTUo̧'󵟘W+>; PGv#0aliѾ)p|Hqfs- i̅f hJR3eՒժا;%(ZE7º X#|ӯb}6c,WJh_Գ'A\UvٲQHi; "[C!BGO7 kH' ; w܍\nf^wCu2/||O) o|@bB8^ Tp<*H}RXZ7W"p r%3T\ye ;T(Ѥz}!NNxȔ!#yD/RoI]#Wb{!6UjڅuW$=~qm)j 2'=bgTY^hV'hOxW<,$R4Mh4.87K2HL(UyV5%muC/vN@HNPZҋ=/c!Ut00˘V܂;*" rSa:u@&;߉_tu*vNZ9p"˼vCT*܇pBiC򱏥J.1I}h *LHMF I,fy-Tv|*MYt[ ;cU^D\4h)xik=`M/-=j$d+wx*&*fk1 z:LYb]V@ԃ};aGi"6FQݘϟ|%.`Hėa91/B/ 룚 S6A3(BPޟʍ^B,d#+jjZ&9Ӹc U X颡\߯0Cc3C=n@ng q v*b:a]kjv ")[h߭Pr蕑}Dorِ9]-9$ +871lg҅4SҥnUh,u(Uz\ py9h(=YqxwhOU&b]¤3oe&RIfq2c sdևxڕ,6xѝ$F':nl~iVU$ǨK X*k^h(!fcqHa Їi:4Oҙ"598_+Ct$;1Xu[ +N%Mvԓ@rt遯:AdƭslU{&+I0(""=Y(S륟rW H:6k%"ϓ/Ex5׼P"RK)b׆bײi/[gֱ4ӷ;~''x. (AQq_Bi)#g#N^[Wfg-ǻufWyZuoޮwG1G8COgs*_ѝV(D`:ݸ:U A IK`Uݙaޒo 5ac4Fv[ՑtfD(yi CX)~,P򍘚}j#ӛANoL=-m^wusgK%GU'&&X%j$ҩB{p\r>$dcPW8}ɚO2{98/EU+?ܢ2 Al!_z7Z˸Xe0"3\蜒{dxv3cvװV}G=FeR&*U_LCr.aj Hwhz{nށ _Vm%3w⟋N,vRXKm|VDNBOTɆq=D~1꩹$?G:[Cl4DShfJ" b2UjT9~jinu _:Xd}R~Jj-<'յd3D}7Is 8{`eB(-2h"_MFNPxC^1{SN~MMJ DrrK!\W kWVްӼP {J@IC 7T{v&`38hR#G>O̴B?NXph_P3k{߶? 8y/}$I3(ZpazDDl &i..%UEJ?m^4|Hm ON%KO:pIrID|Ooyify-D})7"3"fݽQ?oHeجL$\1(u?sDp:[5" ;uVx@B!t~}@G BA`R/5mndEj=PGq%ckI\neE>klQC3tmX[\"k V܍Zp|x.^"-IyƎWѷv7?R3_:umQ–6Y3-OUlk;x͙Λô˰* Stq5whˊ2ShZ;([׹~94UQBxusu@0Aɘ`HJv @q@r!KLQu0oϲ=9ɦl/-;2d PFrp$ӯ+Fm ;L_䙟ߊu(&ƥıG*:JLV6{(Y4!G{˖Rz2*4->%2kY Һ =.n]O{sSD/tج:V$bw|v@C#@۴5] B9D \n5vY bDTYr8C 2%eu**as w=ӥs-+fYnnU{ՠ_hN%$\'R6 )Qn/nj^kv TX_5i\;uu GXK0 -WuFA,:v hPj ~~7KSB~5{Ӵ-Kl2WQa*k`IQ<bhitpECvXx%\ ɉmF^[h$l#OS[Sf ^g[{y!='[6-:~0`/~ Wk)qLs#CCw@{!ڌ/ rkJmV\P?̞S\3Cds,v޾8x1S[߃5w\-"re`p:n V oRNv.v}o {DyΫ6L x,ގe!0qؐ!95G&l?0]vś^/woQ 2dk2>W=B -*zWL_E)bQF NiSNmIns3 w7 fr쪵d4x'n\o˶*$ѹi4i@E$9,c?/}޴-"&9ihd[ǣ4PM[IJoo2KI= $'MN)7k@? qꞈF]Izxb/},A9p}e쥞OH!r"ny)k˩(r.o&#'M= ^d^ z " Ev0.O )Xb-vS tC `Q%1yTrXd!4Xbv,5rݞ!tUFH0{ȉb\X?yNJlp } G' 5Yn2'n,^50~N6}Jbs{XC| \աN吘86~:^H^po6Ὼ2{~j׼j !n=0rv9 gz endstream endobj 25 0 obj << /Type /Page /Parent 95 0 R /Resources 26 0 R /Contents 27 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 26 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 107 0 R /F2 106 0 R /F3 109 0 R /F4 111 0 R >> /ExtGState << /GS1 112 0 R >> >> endobj 27 0 obj << /Length 2864 /Filter /FlateDecode >> stream v4 pR:Qh(C=痐MUt s:'d蟽sr5Xǃ(`4h4`W !ʓw #4x'>B #;]ƛ(; n`i,8D[0J=*Ẳ3޷32sk-+g m>w7J9냽[?R̕8oawQ7OQ'|T|=e!a0`X76L>S@*L!#$od 6jDU]fv&|Zij0ULJ'p 2>D!}_Z N/jyB"[a5flctyucy1I2eAxԩA_ zjڤ=qT-tO"]a"-c>i70byX`,P0Xċcwc:wdI$\ӓ.@%xeIvPވI^4g UEr:9$f+%{^(o!?Ue :Iڜx{CN*s> A$>;s=JU)E+N+>V( RѰu49gT[DB%ݾ@}V0ST9s8_8$1IiV$2{Pn㰬x$ت9nPA pyp+h +(9 _>l5ѡQu:,!sQlerHF5KYD<4;xNɄ7XΥB̼?R~F:޹Z^-J"CJ?K; 3л[ԃ.<y =# ͜614#\`#hiuLt6z]~}tiEXVSY*މZ~輏L*@31 #ia*V7lz21olPX^|,S^nxV; Ni.S4ȁf\\ö^hVpF #coY4>FSH(v$x}Bjr:/̱XvlBhb-T|!a ?$ʻi#]J$0Y *̨Uw"VB0n1;<Š ;݁3ȉrkXg^5By-t vYo{dZJG~9{-D1F/[a;UNu tc$"+h$BcF<']vܨUfBxʂ 8;L: @r<1M;(f7Pu*9"E^sn8nI1[s? rƬ POUΒ؍n q䛹H: 3Řr&t"1RQ?IZ phMi .L\᧊ăBip)#kU/1"Ӈ'?kW oH4GY:ngdGʒ'MS7[[b)} k8x#óK9-utsMd\lqtq`(8H_ M%.2ߍcSMOzk:\CWrG?J _n0 $BE,%y-v/_,#{m 7pKmhlGZ'bGS`nⵎ?ԀY: iuŴeN4uAM^"$ ؒHLŮV2AC)B0hO^x$(' l+Tn?}+c ђ.߭Pjr?e(&y'5(ܾLT:gnL } @x7p"e-zMɺbm|CWc#>iCJ0Fk6זho F7 v(-l :`-+})t:uG\W!֬6a,-e{)9T+tQl/Knn]+#=l]H> te9d)0E\im9.5h[1B<ߺ) X֏~e&R{~pđ5ˉ:J=u@BwwKw=5U!*RHxDcx/%=D' caAսJ_}->@ GM@3U@$O7eB{xp3|0DٕRW*1hIanTu3#KW,Sc9 fDٔGq#RIR,yaV&5q-eLk$hCSig;?)mUW]uѤ& endstream endobj 28 0 obj << /Type /Page /Parent 95 0 R /Resources 29 0 R /Contents 30 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 29 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 107 0 R /F2 106 0 R /F3 109 0 R /F4 111 0 R >> /ExtGState << /GS1 112 0 R >> >> endobj 30 0 obj << /Length 2719 /Filter /FlateDecode >> stream ]\]m*Z=0ɟY8>"qmh@bluէ:9r0DN!ulc%pLoH_g=UsXX xa8s{ݸB3^:eEØ=;g-acKx-R3 i3-ַm5Φנ6x  iL% ըzu:9tj.TI)uҫb+P\{l_~!P5w7ɜ.ظT ЋFh'̓gLu]nj1`>r"RZdN#<%Zvs1iSSڭ'@4"H=_QRIWSe7nR.F ;# U;CiN <-!ѣ~F³EԲ(lV?YgOVmW뢉uHVkN#m dQ HMCPo:-|;ŲU[cݴfW)I+-%YGκvrFAQR1tRdVvœ֚_f@O|9Ű;Z:}c(nIlG+H;ژL-r3RHm*Qa*: GPHEYzXC>,pq:)hgם zwn,{<,ŅXͿ5mA2ˁT>r',8uK/"%f I(vBLn~-yVV+U&o'Zۢz"U!,kրz/gW#ô2n*3m#s^|o׿dkqR 8gXebplpHf~A ʥr uk0pWjƮ6l ٭)jf֙"]8jv_NH>V]9aNzZNTNZ|*9^w 9$f!۞(m[ZЛ%>Stj9Mu_޿zn{9|c w}s80$2yD׸C1]mS"5XΨ v,mHi>V3is\dl0>5x̻$fܤJ7J0xoWލ<>UVQ>j/ytҳF=A&eɐ~YNcZTi_gEYQRZ 6u~D- 2ʎ'W:/}Qb=I{$8P?rkF*YZCm &̋!֚m1Sb#k9~[Ml~s'+DK]cBn`F@ҕTK:-/=/(2ΖZB2^r@~|8t%D鄸q!؍ruEZdCPȽgIoJ(|d < =zlCn+p&mi[3R,K}hIGYz˂b&zJӁ\){|z y?[PbO a aQ><325pCbVPq,TŃ;`ʕw FN?MQrUB7\V}"3Փ8^>օL_ 1lVW8X@_" k) Ƌf "h b& @| `-4\f7@#L(FPAoW+ߚMJ.GzjTc85Py%ЭT I;wxSeĩ>U!԰7 s p#>,ʥ9W5 ! pU}u膳J =k͝_n AŸw"E21JQI\Gxrϭ(`?$Nطw %] ,fx?@`-4bx&6&Oб+.f+|) 6wEx7_ GE܃$ Ɓ!ʯ{mՑ9T2@+ TK[E+ \/bV0'\<p!Uo~/7 g՜ɓ]_5tMMAչ0'@P> endobj 32 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 107 0 R /F2 106 0 R /F3 109 0 R /F4 111 0 R >> /ExtGState << /GS1 112 0 R >> >> endobj 33 0 obj << /Length 2403 /Filter /FlateDecode >> stream W|oO'l,#cQޢqQ(0Y\$H6Ɵ*(ʤX79Dvz o^|7 jXĿDl>N==tYZt>$+ ,xrY;V"jA&wHo7u$m|:W9j |5Bz ̡ˣPR|~ӛCO ]s]z9c(uSHxiKrz0J#k p6ʍ?|osT FId?el ufх2 yk q`q^9p\Yf-kmw2 ff~R'c^R,VS[YA̝ڼ!kٰU/ >^ TzhyVDU4b#dW-/щ- .>X?[Gg:Ohg\_[E*lelxbsӻ'߀+_6yuF>CR<.T+Y/ia Y\f6b؜콴.[^:hOjࣣmQQ̛x&evY.%mzs!fp2x8̶zV=_O hjO&}LW1ʄv)GL'm ̥90 0}xQk`ǖow/5mv货b>Ll Teb]fUop[ ~O%PRN> ͦ,(C4 -jr.,{xP~ں~y\&f!>RCF{16uo"4gI$z(v- ݬWj.iᘗ&_T7x"88 [@Q_Y"> endobj 35 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 107 0 R /F2 106 0 R /F3 109 0 R >> /ExtGState << /GS1 112 0 R >> >> endobj 36 0 obj << /Length 2215 /Filter /FlateDecode >> stream FHĤ iHKx;c08]%GNkE9($SzfjۧUek݈Ekǐ -KqW6DvAOs8cjú@N8sR@Y(Tj x嘖&Eɉ/~ }Sx yjί*G%qB99 7ͬYx`wΏ?\J#c`\9|@E/R5'X`O-Ŷ2խ#()qc֓j5}+PKRaݓC,⇝RcY7gO5y}A>T kDT?iSc ,b`LmF7/Is8N6%$(Bkv.Aq- ȝ:j>H./48b7'C8?V-٫yW6'8ݺܹCw8wy+L0aNL!$n<YszZ|MTeNjiv8Bۯ fa'lj2<,PRd0ӡ" ܆:˽ };1A%-P? /"vERGq@XzEBc FTqy@9a&B+{wV q9qtрFuP?xmPm6y=ד@ώ)8_2؂20BA*z8}몠wQ$}u˛nel?yC+dDHJc+0=@S3%i=RǕAH"pX ZRnCMg6T`CG"^ƓN#Э++-ž%#8CqJBh2=I$wbԞ9$Hν] kB+%=Am2Fpjkl+Pȹ+ZZ"a̧h^R9Cg򭍱ˎ&K䣃htӳ>a`ߪdg(_.n} wYc.=;r[mhr RUgq K-~CV6e Cv&E& Ney9=A]8r LT<%64_>ht_H-,2&(3%+ܯi0B^\?_T5tAfZS)U ۙ;YN6]w+~`RR ܊%T$NGI׮:<*@ycM^v3m܀X $4F. ZM EjPT[n'D\= a@ȁչ߼sdD[{ .6٦FE@67Y)|Q ~31up[ddj,Jw[^gSZKyޗeX/ZpdpZ(Y@`]yޢKk$ Z /a #6A +*j~30rV.%!)k_i=J[l:E_p;<|!2P7ASRr}nč'DZ睸!QYگUM}HK/-k/~&]ٞi/:Z*f֧@)wjsxa+cvRgaz?H4պS˓+֎䩺`|T`lxĴ;S{]6dV@h;92)9 h㺪"y%h e i -ԅ.ȦbLWi$O|\2n㗉^ 5iD"ޛ櫽A-|Qf< H/k4=>+zJVvzV;"s<\R!Έ&SUˊɊ endstream endobj 37 0 obj << /Type /Page /Parent 97 0 R /Resources 38 0 R /Contents 39 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 38 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 107 0 R /F2 106 0 R /F3 109 0 R >> /ExtGState << /GS1 112 0 R >> >> endobj 39 0 obj << /Length 2164 /Filter /FlateDecode >> stream |Fi:^3h\$kT@\SOˎ8?sGy*&^@ȐB7ACY)cU6~X]Tod )1eV5e!ܥHՒGn!Ite[+%kzx2Z b{5[efQ`qy 4Iq\- QI_* ;-,ZNE C9T9pǭRx8;4XDonr^T#a7(aؠ+Qgu@_m T HGojt!uk܇,Q۽ ҕTǙVo꤇O vL'sAӰuZ(-7Wuz  d^-fj4LqMoI|=Q]@dzQgYy*u12/s-/rs+֜O1W{Ӳs4-="ix2.)pĎ?0̂ALi$ZXaƮҁy5$IԬnx=$͹{9쑎B6bVR3h6o#: )TW5,gm5_nvw紐64/GB9T 9gGnq~f' $E~e3Z~2Pq$QHd^-Ŕ>D}y [qjcW_YѣzgJ{0tm|_J3l b8!DK1U\cm(#LE$eZ@JJ`cfn<#Q!@Nk\N PKo*ꩮh. eR$txc 9ݖ}ݍ5r=-aj $ǐj%tѐh3&MૡlM\7Ԇ'JVjpq@u‡RqӠmB@`A~z"iJ24ޠ%5d՞F;V@!jɟ;qaDZXOꥻq maYDɑܝaҙqkjchj&Ҧк:^"@_zN kZ鴕ͣ`*J:}p A.ީu6<,EnifQ6̠y"4M=nR_Ar8Yb݌$JTr5U᫋6q!#N  B>Rj(pOL PrCj3~i{ě0-;S6 ܦv`<{FQkk9魬{)p^ ]Eh-wy'E>AFV]ySpU^WW{G'2B|(n%>;r-J,dē,fY w#ʩϜIzץ5A,eb$;^\ifވr⯊\[cdNW:ImzN^!dfRwx)5%wsv%@MiCis iWJDdsAϔE-牜s&=S?hŇd-HLf gB 4]|lj!s|\Lr>dsO%8cY?Db ^_HAVayV#.LzAԮj'zDŽ XXO52(ephJ^Ҁʼn٩I iF5 I nѱA|C -ōҀ;6J`TTzmToK r7U˄ޥo]ktȹHsжpJap; ,)q`D0^)KV.j9D?( XV44BZ?f145-D?C}o|٦Ҕ~@\m" ӎ"M  .ADF@\'ɶ[|f9%IoLav6R/}[Qv+ԓ8ٔԧA|R,-y endstream endobj 40 0 obj << /Type /Page /Parent 97 0 R /Resources 41 0 R /Contents 42 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 41 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 107 0 R /F2 106 0 R /F3 109 0 R /F4 111 0 R >> /ExtGState << /GS1 112 0 R >> >> endobj 42 0 obj << /Length 1444 /Filter /FlateDecode >> stream Z0@ehu8SzAWD* avt$ItY'zw4"y~f?0G4(yƱPa9Ay0e?~A*r&CB:uqU\U+*n"7&lNf]|To }ST垙4 0cVUt:ZQ4[r%حܲ %l@.1wOK.1'KC\dϞfb^5fr}rK ;ѭ׾{؊gFRN OBN1%@זYFy; 0 m.9z\h\/Pfu2\$pl7.'_]RSzE5SKظIZ9*eP݃zLDsqk1ȍ"!3=GU['6WsX/ˬMCN ꞉A[@shHMGK`'pU@,5p ">Yp.eDGlIV$8.B߹ ]wΙz864.iNH{ѳ (5;-g>Z{b%rȊHTcXhͤ%?޳{{;%sLt ;򙅁7TRIpiS4|?BeƮPAX.*I6eSTm?U Xš3.&/"*ys۝PN8~JcSmӻe qJWkjWZWm{J!#+M,2:l}r1˅!~x`A/mU]9BGK&am~N asd|pz&%Ŭ nTҌPP _$=D&}jY(˝#Ã+G]&M> p#x( ʙ$ZIGIz6j0ś, JK+Q*\> 4Y$BčsI"Tf`GyI$wRzĔYj5&L̖=v߇%zߞG튷MpW$GTUp}+Xm cUO\(CsDFeSl<*!p9P᱙g6Nb{sz;7c> endobj 44 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 107 0 R /F2 106 0 R /F3 109 0 R /F4 111 0 R >> /ExtGState << /GS1 112 0 R >> >> endobj 45 0 obj << /Length 1907 /Filter /FlateDecode >> stream OB>*hR@q"DGlSFl&íP%#y]<5ɰ0ԯtpߚ =U!i.c0 }_H~l,OV ~Xg4[5 b_[щ$^=+$ӥ qG;SrJ` 럗#f?BH%@SX9-J=染Q$x2\ί'8+qfYa(ѷ(巋E뿔HeI\KƔ4p^ɨ0\ (;r8R(Y=[8ITOp]kCMdj=Q6\i=$鴛 b`1^! iЀ׫ H!f=E8GPh";p]~z &%Tz l*xkC0xTodrKP P?$gFW I2 ۹B`SXIvY-Uۢ 6@;;P 1Fi:.рOoXKPAf&t-? #Ԁ1 E0";&Z@1%B1`cR0hn2Yb%҃&z4H͌gLW{4 2ˠ{ںR*Ի^} tw\_o.hZ7I%Q{?>e┨CdFmn|̝f !n8V:D(ibT`JAD4 R9r~KʗH||4!=f'p"dܵuK(*s-nű, Pz7kv6CH'kqm ">{yEt"f[d*N2P1*`l !zH (L0M(Ua迻Kjd̅I~x3?Mc>򞌝IиMp-4| /mr-M\Q c6d>xQ1 TS?\QcZ\}z\򺷅_Gj?{2~yfU7{m 36NL*GЮTWpE'o]--)tYfҦ+6 :o: ?W8u;~ceu4/T`_;Q/^]d|ov6;ggO[bk{!5^F5">&(B ;<[G7o^a',qbfh&5]O7pAF(!߫Y2|Fǟi+|w0V/nlƻU+ [b0םdEt0<ٽx~C{dGG1f0jd.1e5sRkTJiNin7(^ : Bhtjd'Mbcbߦ𿃈TXi]Tmhp8W6Ta£':(BS%9T$Zz-F endstream endobj 46 0 obj << /Type /Page /Parent 97 0 R /Resources 47 0 R /Contents 48 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 47 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 107 0 R /F2 106 0 R /F3 109 0 R >> /ExtGState << /GS1 112 0 R >> >> endobj 48 0 obj << /Length 1580 /Filter /FlateDecode >> stream bL0HX|uv Lz-(]<'9$d3U~^ )=k _6̘X^ iUҁVqO]߇|dL#HjBv!fnnr^6Э1|8WҍtѮ?4gKR al9;[xI Oq:uX?T6@ެk-OL̼Ê]kǝaW9~{2?Ŀ^ض.ttE;%eNnS9ӡJ=s"{,L&J_^M$85-%1/s[NGZJ L=Dd -zt L\ c<]tڡZ>MoMS %`ߘWqeUQ(YZ[ O* *FA!UǂD״cIIœu?j#{nDnUim/YO-"H{]GhCߴ%鐀ik<l ?x(SMڬl q܄stj2c@P+ Tc( vw݌ߠ)nR;oV+}~",dѽm{5.T.O*)2?.`gl+۲dsQ;d)LMWRhĎ|ıPWɷ(V hQiK_ MMZ}6Qd-^n9 .^SO7nFB(sHăI<#C\c-̬N& 2/KMMu L?Y|4Og Sa@AkGh9p~mD;eY9K+r?)dBAˇ}m"S/:c9hT(1M: ɨjk$ ٦({ W"WGS| tbpR#)4[M)Hm%9?t\<1%!n)8,0}In.eK=a"=ٽ3<9u}SR4}f$=98xz',燦$fK<Ѫ%q|LhhZ{ك`h"<!FK*-`@H|q1 81 "eȞm3$7I endstream endobj 49 0 obj << /Type /Page /Parent 97 0 R /Resources 50 0 R /Contents 51 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 50 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 107 0 R /F2 106 0 R /F3 109 0 R /F4 111 0 R >> /ExtGState << /GS1 112 0 R >> >> endobj 51 0 obj << /Length 2780 /Filter /FlateDecode >> stream *o}DP\L3H?44MҖS jFܚ!wlsقfٯcDsbj;"@aDud6._>Fh{+nB۸470&fB :n-B&uv1CR T3U]c{Қ d҃틀J5Ʈ vDj<X=<3|<{b0.Ed= W|]@vگ%&8TZizj~A G3o֦tz<*v>|2!+6&'W@R >/O]7/3 .T4~o!7yT𷟭8hXd[QxGFsm 8Zk]2O BGY5q&2<'RדH׈g4&8 G&#_В{FK7Fx.6,Rke `@PIJ C!ŋ{rGV$| &NXڽH(),6DnfWAAp^v~ԘJ^)%#S|<Ygv`assZj_9Fwp|0v#XfO?S-V>CZg7)_V!)pr⣤MqMBP n&/SDoMɏz9Mt f18>s{Z zr]s )Uf]d{VV1EHV9],uM@ΣfI ~4 >2 "\1mfd7ɿf3 U$#/ze)f&r<L25P\\Nd[˚-=5TpYBCzbM8?h㲭~ l/%;U)I*=D- LÒKݽ9QfBkD!r rxŹs@ Y.]ւ( jGQ[ݾd\*S&"aOM \fل>C-YS/2BJ"o L9E"yԎ=nF:ݤq v v ZvbAOx*Py 1MtpV?`dO*cO9 %–9-bߴ9j,5+9Aos%SE#$@[2pɡkqi-GFY .9ф6q ._<>!n']fFoj=68/?z̢jZOCR5P%wXdՉ-79Ft 'nj0W՞A()1K- U0t 'nJ}i!gRTϿ*1 }GU-/C‘FzNy*9._*|ꘅ!B>4}^!Ah]b 0rJք9dr3d6}g,f+-V}<ť/Z$Bk/_qZ`kNӆ#Lّz_׏tޱEJjN c}G[#J K?Pw֡-Z4`utkwQ`-5eƴRqWGXZ6h}SCOښy2wC١霭=eDz[? E(dpj>$X,{R= jc@=l;<)XX g[j+({{hy\ !GX%X ~ Z^1kHɚR)xBI|dhY˓ F*>{xNeAEL82[)/J=ąW/U(#0i,`yIQOIkT.ciG:8 }|?IQ i(YK9ӥmD :󾜓b@DX6_ endstream endobj 52 0 obj << /Type /Page /Parent 97 0 R /Resources 53 0 R /Contents 54 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 53 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 107 0 R /F2 106 0 R /F3 109 0 R /F4 111 0 R >> /ExtGState << /GS1 112 0 R >> >> endobj 54 0 obj << /Length 2406 /Filter /FlateDecode >> stream :J\7 ӸBO!wd?TnFR;%0+n-ϾD9Ѥ1Wԫqz߯Z>D'pŢy4D ˔փD],(2)?-OJPj!?h< 7*.7kqPƟ!Pl!<@zT*?zsbd,sqC2hq.c!ZL9bb5p3W3Z BzbtY:@,pAY/r'IVWmMܒ5l:m'vz Hb IQD!|sYh?u4#54x#6[)k`9T(TBc9dED`s $$ {b?XMՃ!{NOop33GnA+4mf,x:TKCM_Ix& _Qp`Qcg.3KB51mP۞>>8d7HOL|"H_eV#S쥍.5b}$|' n$A܎x|lB4Wɺitrx|Un<6֝"cBaN?V9L %+WiY(j.6znģ%-얖I*°mWrL~"k3Q\Ռf)(0Le ;$=y|q1U<|# {?_Oz57GV%]2RY r>دLFfZJR&A/*C#u6o(/g)B*Uۋ5JJJy?gxKO* <6YޭmJą'&,jS//}+o1CRs0}/TbAo~,AKTtǾ hBQ):[t?t7`%U=Sv}?yӔ u:0.D:uj4֤#ϩ4TI|'ic2 6TIP}YVȑcX|U~q=Dr Z l޲0 &T}ǐ@ F79#c^ݽd1/|8Moǣ/,sUZdI9UV-Yv |)[AJLqT ̟O{C\?0xž?Y + i OnӁwmDR.CTp@a??JhÀE$7'E~يɀIIsdqIUD)VO)3Gj74vY7F\ؿuT6ݾ0J}hhClz CNp\wji~Z_*u~ oAZ ۔iCDHmBXD!%[H·$vg.Wraqxa3G`%Q-=;u;̄}CS^^?6 JsPN~U?&[ܩ%*zԅo U.ttҧ:*, KzfǃRE+J F 0,7_*gX[QXdke/&I}-2d&1yS%5bBV)Һ:H ,Fn F*T endstream endobj 55 0 obj << /Type /Page /Parent 97 0 R /Resources 56 0 R /Contents 57 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 56 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 107 0 R /F2 106 0 R /F3 109 0 R /F4 111 0 R >> /ExtGState << /GS1 112 0 R >> >> endobj 57 0 obj << /Length 2480 /Filter /FlateDecode >> stream jBPuw9!^)T(/тKǘzOIbe`q|fgCY!,!պ<hb S(G*Mk8K4F>E0: נgxb Yfn#/2;  ցnzӞo* oPf_G4/k)*HHbn$ 1Oh]E~cO$2;ѸI0DVGM><7N^e˿8-EskI]_FpyəءI@X9X3܃Lnd{?]{c08Wǟ~ .[+4}56֎jw 8uYmm o2-ZbnyT/ ޻ 뿝t3OzłyjZ7<o7@&ǁ4 +h$} T~Gf|fu\ЃLbe.h]796w"TϬ8u)$ZA/뒿\d,`ߴt1]ef!67gf(NjLP3G@Yz&L gk}j iPaAX7~Gm12 33ޅϷU&K=PFj1  HLMPRU/p2PC'#04XNұZ EWC2:W\0M~6JfL4+8Bnq[¿g-o6A~{*)<-1`)B4d̃K?^s3~B ]V=%ϱ9] ; 0J8Ll,/#Zx:VCB`YkePS<$i{fga9K+ʔg wT|4UIw MJKY]ZVUs+zcv~haFϟuL !'B3c]|ZR I :UTx__ 5s])MPTV7ՂzH7GV6C zxXlݒ B4I 5O!)3S r‚U8-]IX?Ԝ iBxI,>t[@5bj꜊^#4fڐ?%f|ݦYEӢoxg&a+50bz_և{% N\fq^kWr^ꗙB2_2 9hd3(&5 =zU-8*ƻ[0խpfl.Ec,%X;N6@PMx*ግBRiZ.R'f(kɘ9~+ڔ!%a#RwNG) 9`}9.p_Q_D'ALzxc߿ 6O\N@Vc$bPiE( fqe4WL?k&mpܠr+gaY}l%]UBW⾏}5Iq|T2MJ$`'?Wl0 x +Ƶm =V?3I մkh \ۈP' qUѮ 5J %NKD16<1 $b;;FբX 4)li\CDDdv䆅Ī&4v%`_~HJiTתNle:mNc ^j3VLմmտCc*˿%8OѦ>!c@ە\(z~4[(`d'La^&~olW|l"5bi85YMvW b6 piùu w+o5`61z ]v l_F-}ް]%j5.p(}.[*<_+ $7frS'𫙇pJb5<Ȝ\>4gU* _@[#צa6ޝ]dCp m˦G_yPm]ήT+xۙ3 oF` t&?ROF&h1IrL6@JCyzphGEC 004 endstream endobj 58 0 obj << /Type /Page /Parent 97 0 R /Resources 59 0 R /Contents 60 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 59 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 107 0 R /F2 106 0 R /F3 109 0 R /F4 111 0 R >> /ExtGState << /GS1 112 0 R >> >> endobj 60 0 obj << /Length 2963 /Filter /FlateDecode >> stream Dv4lčv `~4]by3_C ۃ5}̀Ht:jlbvMVdߐQgޝsvLW(קVe;<[.הTUpM͐:y ˢitZ wUmWJ"\| ̎}; n5#de9rRYQ|iM-`Q]d"#ǧ]p6߾Smzϒv۴%m?ueLGٯ<wi;/*)oV摳O7ъxsD-AZCà'%iu فˁ,]8֜׼$kGC$֌x4N_ӜB9Zy`ِ[l$lAS(7v F\[CZ!;/ 36q2:.WτW5gq7 xJ@Nx{GlD[KꁍU|ED9Rkptz {u2Y㕳˳)%+eDݑ޷!H|z=z#F*4GFdG4aD,0^էˬVC3! %u {Y*GMb嚍tĠjyx' 7bk v@kFhR 9LҀ9LN2OR0M\<{띳!&w!LL`\@2t( SML=:ij[--p.:z $8m35ndnN0ɮ2 7TŁ蹱W/7ILȤNlp~/4|˝SwM3#d#}8%/UMhgMQ}z-"h>_OUN|*tM\}c&g02vw%t!M [1&hԅ6tQȃ^PY dHҮhpy_*a)**'.v!'jL.7Hsc Ѳ1&pDG)^ %j|Nω& {̈́~ikg`e=JX0"'lu}QϋVF83? =~v0m}?J̕Vj$_gH=*R벜!_Ѭ${1cF\N"Ⱥ ' "i9f9QvXF1iާ"# pC#[ދ\%p/Vʭj^=a>Bf9 c +3: ;ZT~pA`="e!- @hd}ٰ\41A؃]/~ S|nla5$r:b%œo-d398/no=p!n`dmbY1bܑ*F`!_Gu8wpN\ngr!ZZ_Mg7Q}J *E$U< M)m9cwry ID޹KB?#I)1/ TA7,w2#U՚ k@I&}[kygj/^,vp95˷f*Ehqe=1<[KO1_{˺qSz<@uqn{Ŀ(>{@Yoλ)LGopAOHyl6pDg4KN3o# G7ЦLДԇhF B_(Wy<&;nR\BȠZl{7[ZՆ[ܻG INQKkV|n{X;x7@/Kk<Z˕["Ӂ!4i))U+X@Ղ!3D9C-e b^QEo-WeZ)iZuEMmp&L%d5u~4E'r@j: Gbb\ԭ6\(}bR=5]> endobj 62 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 107 0 R /F2 106 0 R /F3 109 0 R /F4 111 0 R >> /ExtGState << /GS1 112 0 R >> >> endobj 63 0 obj << /Length 2465 /Filter /FlateDecode >> stream _~+ZKᇵWosG C>)8OMG|2"+6L,""5%8⫱㾺K])Xp! j)P p5xbCnq2fC?좵ZQ}f&-ttF0CI;4B>e&[dtvy\1̍/Q 6r_c-O5u}\ZAq_(έUs_>g= '7@rVRNN;]7E^iYF]Emt^3w*ߏev !&^>SAͳG;*r)#AW' {U NsQaK~lJ ɨR {ukUEVR͜= H;rlk މȋs&Fg \&=jxo+ׄZ~F<]g Q\ۧn`H=)a}E MmU2 ւȿ]g3Ej7b#=\ĥqm7Xhh43Í__=O΅h}57G~̟dJPCLgMS$( ]l1&ɕNxٺyH^":F!';p Wd.;ޑ8qL$zS1!L9G }R Fۧ 0=@*?gXG**zo"ny'ug\JCKT15m|ߪ6  ^eP)FhQKQ(}bΙ6eReĈv5tٴh_O6~`^_ƞ:{21֘wD6s.y/]??Q;Cf+4@apey0ObqdJ$<| cCaUk~aᚃb[۫j "'԰{:46?FIL^(-H] v[DˬJͅ ]?5k" _Ć3)l Jzᔧ3bopmr-8`L@+,GצlIؚzC9-+-to!)l`t8V1a)WT9*WU[rVL*1coh0ЁԚ U4Dn1ODJG6>gR¼7WgvT=FG_ضeYxa.JIYqf"oŒl ]$c ~afߌ[O/tUHzĪ6.K4vD8NPUdQ,9B0oŽD,Er\2Xr !S?K(!&' A؞6i9 D)m|IS{~+2CCW1N鷽ڳ|۹Gfriu/AzNs-3qw42溈-Us]/w-t/X-'̐s9A#Q >(ӈaJCzf:?{7P|"ACG(+a [aff81e=?G$nb.[dwȥ>v,'g2 aOQ g, u g{5$tMZs9ꑔmmui'NWhT*65 'F{4GNP~VE'53Ql󒭝nW4&|v=P9,eC7Pc/Uzn,+,&Y RI= '2Hbv.ϱ+wT %3ܴk,> endobj 65 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 107 0 R /F2 106 0 R /F3 109 0 R /F4 111 0 R >> /ExtGState << /GS1 112 0 R >> >> endobj 66 0 obj << /Length 2302 /Filter /FlateDecode >> stream WEm>mWdr%%H\~3wƲ ^Ba⤽csUȽJqkRd鑰T8_q]EQB{H[6:Pc|ih|qnOf|4$6^!yLg.]9ݴC u*;|lPmcy~ObV"ekO(GϢ=ݻ5)Jg:ڛ1?a'tDxz/d=yd,su%-Z : ߿;0kQ=6v:?gZTvܖ<[kfzs!/ٺAK1+2 S۰AY$\( YLos犥'?[2A%k4IHV}h¿-OmbVh\P#tjo4=C%[`/2- 46Q2\!f6x1aʭF8¢>y)Fj8B9IJj ؅pXlok7ϨG1z)+$L1;:V9BTš}\oU,[%dgA ʧn*k4Du?N]EqL]{|ME 9pyNXգ8qj.onlD`c~gǐa[++ %%mtGvI虲~Wz@0rvK5g)ܽѱ&N#̰ 5&\ۏPV$LFcn,V`wPML-:AC/ 701+xբ*)lX:|ZAVڞ{EC'A k~ GGEH/HVi*oS5b0j?ܠ^wy YOdt|+ܘVLV7E I+mC9su4k3~ ħ0N!cz}*-gކeOSŗmXV5˸k1;"V^c'Y07e])ew`sbgF [ɜO DR*CQA=7k4߅/a]G0c> Pwh,#8݃ϴǢ7-1jh & f} :9R襃-(8$O$))gЋg3B*)|Lh$,K3j_ uE^-ṵ`M;T:t~!rHZΜ.| esX^ٽGx]csYnFaY' 䔰a_f+[nқ 4+M9*ێ̂CMһCagJq*޿;Pf5 !&W5.lؘiT o~}'͞Gƨƕ=7*f` $$4ċ{`ԗ͌k9_oQ|X_'s[2|'m-4g9:kEi? f-vhYꤋB'djlWgR -vRsٓo ]jOfqbr.8SޔnV I}^`'!PѺ-}%ɥI)@IJfi`f܈ endstream endobj 67 0 obj << /Type /Page /Parent 98 0 R /Resources 68 0 R /Contents 69 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 68 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 107 0 R /F2 106 0 R /F3 109 0 R /F4 111 0 R >> /ExtGState << /GS1 112 0 R >> >> endobj 69 0 obj << /Length 2011 /Filter /FlateDecode >> stream ~AR2Nvy(6÷])AqQ]0ZSt'kM>*θ~(7 z[ YGE6zBK$Zӽ>:W}5|;zW90[&ZvU4kRVOy$SXIv1[˧zZk+vhx"JKY|^PM:q(-U[W:BBc+AvwS4>yɔTh*lUS G 軡3)IO@<{~1 qBUZaWuy>J~g^ :yrUͱ0sIc7= JO{M%;iӡ~\Qܻ)L8&p'ּ7Rpm "a`|ڳ *MhN2T;8 A#!fK Sfu|tʀ}L䕺R*3 ~3j3SmuKm qENI7]T#-0r#4+C}^#BA:iy _FWv {0z|X95z]nn<ǧhsݰ F]xXbN*|ߒ[kgˍY$rm $`hL'iqCԣX@>v .Kj&1VxybAԙglTM&ɢ&۝ݟj=}0@ 4NyT ]v "kznCx!h ZL-c& \v}r8wa|*JLS>,DUVL.Mw[ c[7kާ}. 2 &H/uPRjۄ%7&g5Uzm?]+!ĥi!3Lu?&O|hD4w٢L r_';>1J!kN.BV!hd==W#T^=+^ZEEvgpxCp'WP ~z]m<!^6C- vn%"0$W^4Bs/%y0H%hzoPYEjJ<\] TWiZ&;O9Rؗ)L ;y0=3snCM` sz@xOO.Y0G endstream endobj 70 0 obj << /Type /Page /Parent 98 0 R /Resources 71 0 R /Contents 72 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 71 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 107 0 R /F2 106 0 R /F3 109 0 R >> /ExtGState << /GS1 112 0 R >> >> endobj 72 0 obj << /Length 2442 /Filter /FlateDecode >> stream `e`gJR0uo3/X> G!9Bј5< Қu3=wQep\#Z'6kxy>@z :!=KRO۲\(L6i{ۺCEa}co+I38 ҥoA`P3n7;K^2\]Giިׁjii,a<;ڗ<>+!o1P#>b|nN]|8\Hp/gy- &!T7Rd7@Hc- 3j+PA[ G/̱]%%owǗ:?̮$(ߪvNinZ2pZ_&V.6ntޚvodžy./& џ 7 BR\nt04<ZZYAw$UdJCXxÀճe/U^eiKhfT U %u2ﱆwa7fU:s̛CwL%]:fKM*؉q,#/ƴEl ď%eXJC\gK۳`m6xڭI7L\*~5c SMܢ(k+)Rr1 n=NjE@ȍC.vTR Fp*x_H CFg*D.2hw+L͌\8ݼ΂:njC jUCNJC6;jp@trޣ3# ZDI!o*ڧwۃQB>'!9d[$EҒvA'zu& AJRzڡf0kN_ڧO6K<$7tRpW+T)4A0 x$TywS5pNl}M--H\LEfQVΕQa94̗Sa,Vèz\HH^FJڠG\`,b ˸>׹L fD!PG +[&\6$U:!-VqL^[~M 9RHw~sL 6>^28Oc9jK3a+$H#ʚ{',"+6^HmQ)3kޚ׹ޞ2sY~~*1TgyȞd G(m٩qV~?s_P| )/h"2~[F[''lu z-'`O5l} b¯ݲdnXѺ'bxj+xtoQ !L@? J%[Y9nt׃,!j|߶TySru)td;FɄ;1:|wl]} ѬgߖA] MAYT'mf)o!1rJoDsW}27Mt CäD#3MtfΨ-|!Npxg"KhسMkw.qt+)ɛiH4S30pY+D5%Vp[{ӸvHg&!")xhEݴoԍ rɜMreꌚnM^2p6>;OqgWW ~>&(%2$ ƒDKњu%RRqv#wi9QֿtE"@c,F|Z:Ȋo]'Ѵ5#)j\<1M@_3HCyG+5 k :Ngc؉6r,Yf;?Ti D;h#{pbLX{ m=ڊ0 - 9ka|d:_Ps U}]/52f*5/s0e[tUц `! ,B(kȕ僎!^OOit)g(F&^/P;N@}k8c*.1[sTJ%h&nj7 Gsya-lȌA뀲k?#,܋A +z ¤fkMPIUI_ wzyJp=~U]*:'%v5|7*7j PkIFkx|d][ {3hm]§^& -Qd>Je`Y ŠȇNGc'mdL¡&K5kB^!^mZ~k?(mlknCEAJ u]rr̷#E{PnDAH +rŝmuFs |J s<GzGO+KO$7ciCب5te%uxIVޏTJ 'ExLr;H Je#`ϔf#~jR(ǿ CI1\sc4U0mk"UY(szYŞ>S+1̒bMy;?kW1O,^gBXkwqoluIfLn'T;㕀7'ff7^KwkZ6A-ML3uۃMB>qn/cѳnn=6>d'm ZVn Dwou$A/[UpF$xxH1ٱ1إ endstream endobj 76 0 obj << /Type /Page /Parent 98 0 R /Resources 77 0 R /Contents 78 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 77 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 107 0 R /F2 106 0 R /F3 109 0 R >> /ExtGState << /GS1 112 0 R >> >> endobj 78 0 obj << /Length 1761 /Filter /FlateDecode >> stream ~db3?*Q+ۭ9dm\&hIZbYy(V0¸lW"]G~7scL\ԱژrFyZ{ZGAQ;#f4פ2,G,3  e`+c˘/e%O;bQH@ӘxZGB2;VЃҔP>*;6o$<;F;Hȩ 6lb۾v)9@|VZuiLbP +V^U0 &Q0J""xi3S^=b&5B 5d3QqD݆y~j:,D符rtޚFDr<7KAܰzAęw]I81s>+{t3T+sǟJnCc-aUSmg >) t?9{`OXİds ;@ךTU~ۆݪ5ߡ0L &ͧܜBq ^*#S_?Pd'댛2n-G_m*;cռD %xvw1Gˀ͝I[qF'6ExڷO@\Q@I Qc1_ Сa`'%M=%p,;Z;pid&-O(],>&y_T#b^r-!ac#Mkho^ŶZf揠 a^9U`ɡpvKk]#xLFt'^ iam(:w O򧜼ūK:}']ir7QMg/) EjotpO`՞qA@0-&!kg.郒eS+_#u} ׋))?T1,-jVy0~dpf %h~n$Zy*0yP!Xs`' 녝Y&}UebmM}&r>7O+n{peމéaa^ro_|P0@aFxݪU0 7 !KrJE >X? nAgTIxUk04?aԣ%YAGe֣ZQ~ba-U[4TqTww[U.J|^j䃔ZǩMvG쓝pnZf%f#6 fbP_ZЃ+8b ><̳suO_K\/K-`IZDٷ#I f2Z)fT]}+XRKd01~& &"6xw? #“ B5>Ń9i4Z0[/bU4h"T r1o'5|^ovnf $Zw*,޼u7a~U7#eTÞRA}j%?] n>&KN5x@M.go f:v\7?1vUj}.MÐmi͇"Z|o]2$ gtWJ5fec\VGKs9nF-u)͜Xw1~m$_u!yMȏ,B=KUXəݑƚ塻)RCIqwmXX# b\M?ef-SzΨw?f[Qj[(U#b?C=n.]՝cpz θPPDǦ[\ endstream endobj 79 0 obj << /Type /Page /Parent 98 0 R /Resources 80 0 R /Contents 81 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 80 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 107 0 R /F2 106 0 R /F3 109 0 R >> /ExtGState << /GS1 112 0 R >> >> endobj 81 0 obj << /Length 1753 /Filter /FlateDecode >> stream -ΝQN+ PK 1Dh?*Lcڇ$) CٶARe4H&GpAx? UGͿݑK:ewGx! BĠNn-ɚqJ`z73/' }& 2tmz']dZկM/";t[MlnRk ;r&.+ q=CZ9Il,{KݎՌ}h`miͽx(0%7q&nAbo5oRDaCwZ]IIoZԦ]NN~7Z:󱄀rjRB2qQ8-PanL3,/ZmToQB9LfƮ0;]G`ǂoLDe$YK @pv`EO/ ȉ%TlE^ɘ6nz޵Xv_F64+ wH0=$7est-.GmIO8HnSLq}l 3" `ӑ黭onB<Yh$N4P^<dzaTŧDR[:kbTM5ZWײTUeO?3W҆UOdVzkz0Ad_ >(}dYSq)-7<·9EI]@P8"aw.,V$ y.ƸyR{5n2Zᶄs}yɸ^a/dz{O ,L =aY5#!lOxS.ASP l6؝D>xVѿ? *8`MԔ\` o u"Z 8Rcc$BɢfV[aÎ*Cs\,E[JC(C<ŅTmiTFmTEuBՍ籺@+*"w&խNе"QgɔvFlt]!&i.&x BL{8nөBqBH֎{Ǝ-f-,*CajqRxE ;o$beM#/qQtĖ x8t3;dfTFH `.a^ oH O7h]v,H, Y:XU9c-G4i8,% d C?u8u/p+>b){5x=*qO4y>~ O;A֎t"[~o_W>r*j/0l>o]*{v4 tsv95 _9{5,u@9mސwP zӂk`_wfIma [jC &쥠ȇQ^> T=NjCL5jY#: iZ GJ/r=.5lk ,'KN!}UNi`ĵ)@6҄QjGԹ&%Ҵ]\`42rJl\GfFPju([꿧9ż7X1۴@H*54JucITO Rja,A-YHSga endstream endobj 82 0 obj << /Type /Page /Parent 98 0 R /Resources 83 0 R /Contents 84 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 83 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 107 0 R /F2 106 0 R /F3 109 0 R /F4 111 0 R /F5 94 0 R >> /ExtGState << /GS1 112 0 R >> >> endobj 84 0 obj << /Length 2286 /Filter /FlateDecode >> stream I^f9_!K2sn=Nh-'Җק[t|?qi5C:'jK-씠bJ,( "~Q/BlDǪ|:dN-hak^᷉p Z },r }<ޤ vI68tKU7-HNa]c w7} } ne(ǯ@-8~9cv _ٌi+kE:A9O&dɯz Żlyr}beSOI Y&φjrx \gCJ OE$(B6y!"#rfXTph\?vs3\^<&ŕc Q(g q0>o,.Xj6*ds"\ h~\'M< +<]Xza 9w$2kvzgHXl>د/ridՊfo46R n\,2>>RhpQ٧1Tbd1sA>g#`zTQ1BPC]k-.yrGnb!a٭G:Pcyq Q]ȕngﳚsiuچX)iR`Y6f~UB+$ΦAJC6$g岭ۚEԆmSkɄXL/\eF0oI~p{Z05 D+Whp!LQvtp?[XPÌVm NctcCv'0+Aqt:b vH] 'z)Rx$u] 1uWbTc-?E!Jx 8c U+" eNBhQKadN`,Ġli rx L\/zבY{X uŦ[{߬z("VЊ]P), i&lic"ELO ͇Ob?w&sז"ӧh.?4t ^U &3Ëyy |1Rq4 'msY<9UUXС&s: >Ʀܑ4>¤\6vHEY훍kd9 n%(+ByN#Yt&J9rI+W:!%|ƭBWy^NYR0ݜ%W@{29#M]:*A8< #pN U)",X׳:7+e/O!|c'A0o(%4 kS.d8~anʤߚ ^?wnhA5cN@^ D"YN4(vNfZ;ƹNv+.-Z~r@G)> f_=UV!t6Y|q6N6QGS{͸rGupewj7uBnUo7LЗ<y2"ow֓AztOK[oGOI8?] endstream endobj 85 0 obj << /Type /Page /Parent 98 0 R /Resources 86 0 R /Contents 87 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 86 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 107 0 R /F2 106 0 R /F3 109 0 R /F4 111 0 R >> /ExtGState << /GS1 112 0 R >> >> endobj 87 0 obj << /Length 2358 /Filter /FlateDecode >> stream oz5M}G–-5 ƪaև:V7fE7gc LRfk0l=.C%nڟ DK=t{Z*Wu '(_{۠ߥJ]H漾XT-8heAh0yn,򩕌poO=,LNferp$; r*n\!|&#$k!] uo#!yfu?-.N2A9Q!hL] 3,رHlHM[1z}<'qQ8$xVh9,z{،߬RSg(L9/(\؇*;p$!e˃b¾3 E!mE]$4Az1w;3QdW`j%_430?ŻDH0ZiVmD{]S%^6bi5AbjZBZ4^( !vi8o14ԮI# υ qhF+!#L#.à58)[ [[S{Fw[|yLuo76_?fjyy2}ط z6F\lyҴx98t7F7nVT qs*bZ7.aЈnKXr f\Պ ,:B>>DN?~%|KZA.:Vӆ#ƋzN׆yQ= {L+nSiğ|mˏBhHkU]7sy3 p-BP㝷M%CP:!|*:s3;qs$ߋN~Qz';d y!_r#X4KCVtT種@"~b@yf_W}66)8ybPn{)oZvG޷ctx4vv.GG`֬xJh-IUu K!sTDPFn&r|8lP2uoƤp݌R4(.hQ >ͽjOHWXA> 9 ᮑO|Ej,lph:%9#b V6`}Qx,XV|[-]ђ@],꘸t7̺JܟB7 -ZdzWtV%j?ә| rɝxsYf:7OʛL֌bJ ˜sl,L[hDS29> vI, !/:J >?q7 'YmdqvˋpQM|9%RrU¥WZ yg[X`ȢҸ<'svC{L"$x\qjyI9|)h6VSgqa141ܰ'_ƿrt2mHNjKr5 S,#W\wĪIcFs2@%%yrQH:H:D("pW  OcK0植GV)#g=@Zn%mt*a$ Caja7R=3^{7I4F `Sf:H݁lY0A?SQJܶ|:*e)#5OޞwD4 q1;^]&ޣ Ӄy( t 2^Dh?,+CƌFy[Iٵ-!C:Y1~GыѳЦVCy,U2bfso9!(8_svh_c{3]KV쀲}fX?cBj9vm A<o=ʨn5ȣ!g쮙_Z;+e?Q@2496.B)3!Zȗ1Ԧu^YVRq_q-Vl|9Cd%8ˇur]g2okD endstream endobj 88 0 obj << /Type /Page /Parent 98 0 R /Resources 89 0 R /Contents 90 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 89 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 107 0 R /F2 106 0 R /F3 109 0 R /F4 111 0 R >> /ExtGState << /GS1 112 0 R >> >> endobj 90 0 obj << /Length 1268 /Filter /FlateDecode >> stream /&]r$K~~S=:0NDmR2,SHXTMaM 7^1l2IpMV䊼> J*>N+z3inB2$cM#ovD#=mf\X5[Py>k ;!uSfQ.B}%vk<>I$=2s|K:PPd縒[Vӎ0rgAږT-|'6Y;ۘC[> w٠k+w>fB&թ׋BV:VtBH~ꤠ(!:+|זl i(t4ƫ9djeT k]0rdu;i>BkӠ r3h i'cnZja~:3#/ulm->K+`ټ|evTųXhbc0 bs$)HS)P0Y,s !N^,# ΅uV(`|L Ӱ_v7S]ShQ daHSAMrzsEE^?:TXgb5=%.aUoя֕ M8aX:l|ڪTRK%N2CⷯYqWC%, \Hw90~SfLEXgK@q t9TQ+rlZ5a\X#?Mmy1jHgmQv{R6',9> endobj 92 0 obj << /ProcSet [ /PDF /Text ] /Font << /F1 107 0 R /F2 106 0 R /F3 109 0 R /F4 111 0 R >> /ExtGState << /GS1 112 0 R >> >> endobj 93 0 obj << /Length 1118 /Filter /FlateDecode >> stream m]a&6AzthnɀrE!Fa`͙hm@(+^SCҬGQ[< n8ty;-1(hT+9mn鼳}_my :b3Q(\$h&[ϨR{wd{&.B;˚k:L<>+ɖwd&NλD?nqIq:7o:Aߓ"#6*C P-˕󧚿8K0ؼ}BvA5 [>:Ƣֹ'?h&k,jFd+ƨ&%#.3e$J-S΂fXS4Myyi`aO8Mk ?RΆx\ZVJg(3 \+O5`&&8+ j/B>^MQ Zf)ԉ}@LपVO7}~),XM( pq`ʞW̭@s`&rE.ch3' HQ/ uZ c~XL+ i\F&ʾƚ4vmTQ2W,x0v230-u\ hݻIDT&,αm" x8Y{mSỽyIS;gkl9b=; 2vvBNsˢd3UCegWjS ew,.ѷ@ E bz_xu(T: {ճT㤐Q@fҶ+VW){sajCqϤɔ%Kw2Y!yWY%wy'`("- e8a?WM56tj(?܉2lSrxץnSu(Qt-w7p`4|zxFgqNXeU1/`BC YhEJbkm&=yu*0Xk,hQݜa2CѲKn蘱NޟPcr~B?Xv8dM рqEkUpP"<:2ihway[ endstream endobj 94 0 obj << /Type /Font /Subtype /Type1 /Encoding /WinAnsiEncoding /BaseFont /Times-BoldItalic >> endobj 95 0 obj << /Type /Pages /Kids [ 104 0 R 1 0 R 4 0 R 7 0 R 10 0 R 13 0 R 16 0 R 20 0 R 25 0 R 28 0 R ] /Count 10 /Parent 96 0 R >> endobj 96 0 obj << /Type /Pages /Kids [ 95 0 R 97 0 R 98 0 R 99 0 R ] /Count 31 >> endobj 97 0 obj << /Type /Pages /Kids [ 31 0 R 34 0 R 37 0 R 40 0 R 43 0 R 46 0 R 49 0 R 52 0 R 55 0 R 58 0 R ] /Count 10 /Parent 96 0 R >> endobj 98 0 obj << /Type /Pages /Kids [ 61 0 R 64 0 R 67 0 R 70 0 R 73 0 R 76 0 R 79 0 R 82 0 R 85 0 R 88 0 R ] /Count 10 /Parent 96 0 R >> endobj 99 0 obj << /Type /Pages /Kids [ 91 0 R ] /Count 1 /Parent 96 0 R >> endobj 100 0 obj << /CreationDate (*5K@!|2\)) /Producer (jj`;otN;wE%t\(}c=?) /ModDate (*5K@!|2$+vL%) >> endobj xref 0 101 0000000000 65535 f 0000004855 00000 n 0000005006 00000 n 0000005146 00000 n 0000007969 00000 n 0000008120 00000 n 0000008260 00000 n 0000010733 00000 n 0000010884 00000 n 0000011012 00000 n 0000013086 00000 n 0000013240 00000 n 0000013381 00000 n 0000015755 00000 n 0000015909 00000 n 0000016038 00000 n 0000018507 00000 n 0000018661 00000 n 0000018826 00000 n 0000020057 00000 n 0000024731 00000 n 0000024885 00000 n 0000025050 00000 n 0000025504 00000 n 0000062762 00000 n 0000097933 00000 n 0000098087 00000 n 0000098228 00000 n 0000101168 00000 n 0000101322 00000 n 0000101463 00000 n 0000104258 00000 n 0000104412 00000 n 0000104553 00000 n 0000107032 00000 n 0000107186 00000 n 0000107315 00000 n 0000109606 00000 n 0000109760 00000 n 0000109889 00000 n 0000112129 00000 n 0000112283 00000 n 0000112424 00000 n 0000113944 00000 n 0000114098 00000 n 0000114239 00000 n 0000116222 00000 n 0000116376 00000 n 0000116505 00000 n 0000118161 00000 n 0000118315 00000 n 0000118456 00000 n 0000121312 00000 n 0000121466 00000 n 0000121607 00000 n 0000124089 00000 n 0000124243 00000 n 0000124384 00000 n 0000126940 00000 n 0000127094 00000 n 0000127235 00000 n 0000130274 00000 n 0000130428 00000 n 0000130569 00000 n 0000133110 00000 n 0000133264 00000 n 0000133405 00000 n 0000135783 00000 n 0000135937 00000 n 0000136078 00000 n 0000138165 00000 n 0000138319 00000 n 0000138448 00000 n 0000140966 00000 n 0000141120 00000 n 0000141249 00000 n 0000143662 00000 n 0000143816 00000 n 0000143945 00000 n 0000145782 00000 n 0000145936 00000 n 0000146065 00000 n 0000147894 00000 n 0000148048 00000 n 0000148200 00000 n 0000150562 00000 n 0000150716 00000 n 0000150857 00000 n 0000153291 00000 n 0000153445 00000 n 0000153586 00000 n 0000154930 00000 n 0000155084 00000 n 0000155225 00000 n 0000156419 00000 n 0000156530 00000 n 0000156675 00000 n 0000156763 00000 n 0000156910 00000 n 0000157057 00000 n 0000157139 00000 n trailer << /Size 101 /ID[] >> startxref 173 %%EOF aplus-fsf-4.22/src/html/Att-3.gif0000444000265000001440000000014507215453024012130 GIF89a̙fff333!,*hSeE$Ą(y"`sFBpa 0;aplus-fsf-4.22/src/html/Att-A.gif0000444000265000001440000000014207215453024012143 GIF89a ̙fff333!, 'X@0h E[1ʺp(L;aplus-fsf-4.22/src/html/Att-CNFT.gif0000444000265000001440000000027607215453024012525 GIF89a(̙fff333!,(hj0ʩD!~d)eZp֩ "CrUQF'ϠpŏF2v,,$6^YxUwaa!K)u9+>P/`E ]8 ;aplus-fsf-4.22/src/html/Att-CNT.gif0000444000265000001440000000025107215453024012410 GIF89a̙fff333!,nhj0JQ)# L!A |.(73X#L-OQs6C T_{TPL g @@bSrz W ;aplus-fsf-4.22/src/html/Att-D.gif0000444000265000001440000000014007215453024012144 GIF89a ̙333!, %H+C%WZA)HptP43xz;aplus-fsf-4.22/src/html/Att-E.gif0000444000265000001440000000013007215453024012144 GIF89a̙333!,H*0 d8Уjp ';aplus-fsf-4.22/src/html/Att-G.gif0000444000265000001440000000015407215453024012154 GIF89a ̙fff333!, 1XZЫ`H"$aaxK$ Ő=RA%P";aplus-fsf-4.22/src/html/Att-GS.gif0000444000265000001440000000023007215453024012272 GIF89a̙fff333!,]h @jb d>hT)S@P d?ŠRF[f8BoX3 Z&GƂz9kDg~H;aplus-fsf-4.22/src/html/Att-I.gif0000444000265000001440000000007407215453024012157 GIF89a333!, *ߘpO;aplus-fsf-4.22/src/html/Att-K.gif0000444000265000001440000000011707215453024012157 GIF89a̙!, o;Z*q&.lpQQJJN P;aplus-fsf-4.22/src/html/Att-L.gif0000444000265000001440000000010307215453024012153 GIF89a!,/sGVjl)x1;aplus-fsf-4.22/src/html/Att-M.gif0000444000265000001440000000015207215453024012160 GIF89a ̙fff333!, /XLL (&-,h\Xz{cH,;aplus-fsf-4.22/src/html/Att-N.gif0000444000265000001440000000011607215453024012161 GIF89a333!,oppH} |C&b9r" F;aplus-fsf-4.22/src/html/Att-NFT.gif0000444000265000001440000000021507215453024012413 GIF89a̙333!,RHC00ָX e"ZIĠ>l Z)ni3.<` ɜp3WQgc)[xĆbzn;aplus-fsf-4.22/src/html/Att-O.gif0000444000265000001440000000014507215453024012164 GIF89a ̙333!, *HJлA!Z@4C)qMAA@Ys";aplus-fsf-4.22/src/html/Att-P.gif0000444000265000001440000000013307215453024012162 GIF89afff333!, H*/WB}UǨ TL,;aplus-fsf-4.22/src/html/Att-Q.gif0000444000265000001440000000016007215453024012163 GIF89a ̙fff333!, 5hjѻB,Z!SQiAZ\0ܬ MBj: ;aplus-fsf-4.22/src/html/Att-R.gif0000444000265000001440000000014207215453024012164 GIF89a ̙333!, 'H+O"APLFUA9Xi"V | ;aplus-fsf-4.22/src/html/Att-Rp.gif0000444000265000001440000000020607215453024012345 GIF89a̙fff333!,KX:$Fa1dTtŊ 0`& "IܬZD]Lʊ8xİT]z[f;aplus-fsf-4.22/src/html/Att-gT.gif0000444000265000001440000000017307215453025012342 GIF89a̙fff333!,@X΀)_ ͋ķD^! .˦+Q^GgکӳSS!2RST;aplus-fsf-4.22/src/html/Att-hG.gif0000444000265000001440000000021407215453025012322 GIF89a̙fff333!,Qhl(f51 BP 0|m 9c ~D1l b)\ѫ7`mQ(8 :n ;aplus-fsf-4.22/src/html/Att-hM.gif0000444000265000001440000000020507215453025012330 GIF89a̙fff333!,JXK" 89A6dU{}=\fq: 0p ӞSHExL. ;aplus-fsf-4.22/src/html/Att-hP.gif0000444000265000001440000000017207215453025012336 GIF89a̙fff333!,?XJBPĆAm D B*3M/C-&c^ITKMAZl5;aplus-fsf-4.22/src/html/Att-hR.gif0000444000265000001440000000016707215453025012344 GIF89a̙333!,N;aplus-fsf-4.22/src/html/Att-lcr.gif0000444000265000001440000000007607215453025012552 GIF89a!, LbJj+M<;aplus-fsf-4.22/src/html/Att-lcs.gif0000444000265000001440000000013107215453025012543 GIF89a̙333!,Hܮ!.!%`L+X5܇UT# ;aplus-fsf-4.22/src/html/Att-lcx.gif0000444000265000001440000000013307215453025012552 GIF89a̙fff333!, X`A@B60)P(xEt;aplus-fsf-4.22/src/html/Att-lcy.gif0000444000265000001440000000013307215453025012553 GIF89a̙fff!, H`A!a(0%~gZ"JF$;aplus-fsf-4.22/src/html/Att-more.gif0000444000265000001440000000027107215453026012732 GIF89a"ff33!,"~h0I+ @`4_ئRðpl+ h m8f Q! ZiV2p-k;V<ÞwiYOXndDkb'L_Bk ;aplus-fsf-4.22/src/html/Att-tF.gif0000444000265000001440000000015307215453026012340 GIF89a ̙fff333!, 0X ICȦ[#FpW& ,`̯zra*E;aplus-fsf-4.22/src/html/Att-vG.gif0000444000265000001440000000021307215453026012340 GIF89a̙fff333!,PhI% !eIKPe< xðic DR9*}Z PPy@1HzV$;aplus-fsf-4.22/src/html/Att-vM.gif0000444000265000001440000000021207215453026012345 GIF89a̙fff333!,OhFJx&ڥW40Xðd$L k YlV)[md06A8Q,aw;^ ji8m7E4LbzN;aplus-fsf-4.22/src/html/Att-vP.gif0000444000265000001440000000016707215453026012361 GIF89a̙fff333!,8IM䧵YG滃ߦ=WZhWdF,_bP/7m u}u]HܪK2״ aIoUY>`O㟮ܒ$c²:k×’G+Ev{!KVV,PFm5$ eѿ+R+aIFX$ lGUnw[CiA0l 8RI £G #wLn+2lcfT: u$K()Flé¦CxPSa!K bXѨGSIP03.^Zaϣ`IPC'捶6lqbjr;Fw@&k]AD5,|l F(d2uVyq>Z6y_S-۱9II2M] !Q(:b1⟛O +_qZv]a f `϶)9}b:@6İ Hf5Nv ![Y^HDL3rpa`ʲ]p)=^#^G5 XW zFcm˺ Z|qHf;}܉m/t($l3@i#[KóB9 6G)/Kz^(N唊u>9+G Cƪ6)h|FrǨ>U{=J۾;'=`Թț)`H4c\nqU?W#񨜻66&`I1>A+a0`H`0 & wl8CL+ep`B CʱÈ^dR RL0Cj#ڣxтV3fB֝ZFOh7k ǭ*U{2NW{|F^'qod!ͰིY&QW!3=7zCUSkڊHB_T>:; zVbWsXjVs8 '椉V (CI:c>Ű#du8ƚzu#ȚT__+ 7Fj XFfۨ,٨ff9o]`O],UK1h;fO u`Wgղ%13DsZ1tHŝF=>kƽq =xH ? $bs/嵵0ԝ#$paplus-fsf-4.22/src/html/BN3Xemail.gif0000444000265000001440000000131207215453026012761 GIF89ay̙̙fffff3f333f333!,yp% ITG(dihe/&WEM̽y p(,F!nQL2j톬 f@`> HdneyE{vsq0?5RKp{^$ " {{<;9:jh588k = lƺ|v`<l@kĽtk- u Pj h lw #{F"p`A` e,o 8R "w~iȰ'Zi4 wo&M|@xVa9_P.\@BE3@ꞠQ3 ijod!' `Q@ р؞ uE5ݜ4h@$h2 :\_9HN5PKNX:w-4A|# *N8PQqO08 1ZaUIH wX dx@%87D|@ &9ӸP@oaׅs14 Cȋr1wG p(di6D4t@NdX,X 2 :$%*a4;eWןHĈrk91>SkQ59rq32-KaV30Xf?88vp[M8gsr،TdRK" 1:ZAW /gUъYA9*clbu4/7(o)#9[#r:)C|HkäFA5Rׯ9+ء+9 '!Xc)'Ɂ:t y^ʹzș^,&\9v el2 xSUa2쇘ex<@F DSX7sr،B2K*c,e > ܶ#2K*c,buVXPTNel*l!el\w^wb}Q&U9;HQ }%N1iÛhY }Ӏ$:'BqlNk+\ni5VO6O؋G}2Ld%DU1"Z S4!Y[&`C A<5{-W-T 02CFJwu30zEǍbWkl$@a[Bi%P"'T_NNl]֕ia,;g:OplEYΡ=1c,ZYTQ]iZ񬉑/qP:nk`ZA 0X*UHYzyۚQ],i%ɵR˧>Rl^|J 9KTde$U݇.DTRO#ة`*|~Wb:6}c !_miݹKѲ^ + t)Y".zG^J\Wos}<o|~mU~Q=y,w3.owrn;ztcN`f]={ ̳~4 Be$+ʛ246$M]T#eh xKY-) KHUUZeꒃ)|1[Y,1Ȇ2B M8.3f,s3Zh:J׮롩1]]~n5S"c.r{e8˃զ\|-|sk*fLI՚6"VTe@6ӁYm\UJ,5p\)zAe06rWSlzʮ>[ESu!6߉f &6wDvU9U3dCL+#.l\rLZKxE4X-o8~4vu62d.Ƕ }(-틳AGͶmEbQOQj2xk+yrR^Hm/,cTWMhT]{׵ Ԥm暬-e9c9`1qi,.iYb@?H}AG2cHZKX_d~Zh{|;>卶ظ2O#Zj}~D6sNKmF޶EVvp = 8G=zȪ&IpRkCiLsKg'(]YɰF~$j$ׯǷD=+|ڶ3R}9? /$wv,L4TNxSi6'cQgVܻ rK)'*H@[["S#lfy/BKbCXeӤ"I: @aՖ};o@|Ű]a*y@ 5jhF1Guk.}SlMK.K"R,Em;[FH˶um"X_oAղ}{#Ō؋W `*zN ݾy2.7} 7s9bNlyUFD0tJ4/8ܬi)=Xhd\[\W2> gU!!NZ2|\EC1Z<lk5@f2-Iy+HN~ÉąʋjX0e7+_GD24M'ꌄ7l,`u&BHg$ ˇ;Y,(  j"fDLY8=e*W8i);xPQG[p`Fh!{393_ [wr_G+O5gFSKC 0Ӵjs{SHY* Ђ@ *DAÊ#&Utec9O?j1K ˥^ ˧Z>Gs)~@(ղ ZKj!L8a6-Ij9S*Dje\/W֛ NdET+롎,r2)A. 2?cωٿ·r.@)*^<uH#'bȳ KU2TF_{MBwܭ2FMTlpQg2-r`*M{?ioT #qkx-RL9vjRMY>$ %dIH0i[p;.ČuU~W8lQ ̓MN@C Qom F@2,Yw93/đ`-V3qoȶ\N"G\lTEJENȦm"+kB/nՓ8GI I 5_&V50I o@SӬddOS Z[z֯(8ER˂4+! P<{T i䬮,dYԔP dA0YM gͬ8m84d̼ˢ4N6n"PxpA" $0 A^W=06 DB]MBĺiM^!cNk:&&wdZX%TlV{= 10F-n5 pE@r5@L{t4 YNB]PǸnLHF:HύxWS_CuY%brrSneiʵ aE*_o *~7V$5QOYk J!b 嗷g9FU8:!+*gh*8 (jܥ<*ܗ'^'_ʷd*FJKJ|w>K[c63",1Wm`:t_ܹ&YT`@w^8qXVYiq 6ѸM%nޞݾ(򆣝I NEh_f;cm2KͿ&vR,[~n>uŷe9~Fy!ǝycaT 샊2{|p~HDԗ= -l'fI*Xc I$@~=$ -l'fI }>E9g J<-_l M aKZ#B{n?|>8)?޿vX{zmu߯M߿meg]gxʋ*Sl`LeF6԰BPW6u2m6FjN)[q,6`$ O "&& ox춛shA~"Lۀ(%gw95GU:\$FexJ0pąZ7DnziU$W_2BI,6{`FH3k܊ҳ7BIKfr=@4yLr9,ZC*ưp)4l3Ć" N*3l-dF@{DFīpɲ5)c D\F@{־5݇!WgYVOˮ2W:Ըnέ &: = He!&!^ kXF*7r#8݋+euѐk638,V0a=O ĪCV1Uy>Dֻ?qzn/` =6@:X^˙m,l6ȧWSYu8M)u&5aplus-fsf-4.22/src/html/BN3Xlicen.jpg0000444000265000001440000000626007215453026013006 JFIFddDuckyPAdobed      y "!#1A!1"AaQ2Bb#qR3rC4 ?&gG-{v25!=7%Hk[qo"kg3BAchFڊc{xbQԣmESbШg}vY݆6JV` .לBT'Fbf}b8)Cj},P㟨 '߅67iu ?_~!d|W=ї_V]46ʖ^۳5&F|^S{՟7 n Kg,}N_ٻޡ% ,kgH,~o66>8:s3%VRb4UU,#{xz'1>9ݴjV~Ef$*j4 %b#7!-B &@]T1cSƷsGoCqT 캞8Sx}((YV3:F{rrc@ n$gWI+v,q1Մq'88=FJǝ͙IZqGYt"p)5‰|7rer[8E C?*יمţcGvU 9B5 r-" `?0|?Yi$:{_.lM佐G#enzJ- °YzJ,`Q,A6UZfDeFZ>ZYt-/Εўٛw+⻾K&=&eϸj?ܱ h%`vƴ"g.XLsts<0ϐ,_"ݺuo.f<( #5VcK4|V)c0\Ej̆8K.ĨU$ Xv8JX3[*bU^n^*v99]KB֌r(]As\Z SQ-YI1k8LX(L qv&b2udfTolΫgSV}Ս}SNS6bAA7 9d/cЗ5ըẽfjk` Y# U&zj(+)UȦFq :$^w4Qnuu1G-Ío~ڔPl Q >W\In Ĭ.- 1&Lv[(RunV$BԐLnW=.whbѲO#f<-R /$)Wv~Ʋk( dp6h%$GS/> O*F@rڹ"^|tEfg_c}dTDv9Rk)[}c)if.@2&?r1PAH_p զѱbv%b$E rd30Ř%*Ł #0}u z+ #0}`}W•'G o_7鮖Pث_+DܰsGi{슥jy?/lrY_5i9!< STcy YV18q_|=|UCczK֮v-*u+5?J% _g[w]Z-IRu'W3V׏wWqek@HN,}NL*2sGMu+\fh9BN"dG]z,SMuf˙%C" ӔSokRFFNKd3~Ӕcy^7Iomn9m-dk:uHt}kYtN6?5lvQ`6VԞu*zBh#{_۶fjW 2 Yet t3)TYjG3Be&i!MzRֲEߤOʷN+^f$$pd56Se$i&g$!z콁WfL[W0o5%kc$X>w5C pxogkU=q-Ń=C'豾=9j{ԃ>͑njҿ4Y TK$!\>M}ݗ. f,3 $˜c(-(Wou`N@NDI:e穘_}өvZ-39Y`]9^lC> oշr'-\Z@XEW{?@nrpp%`PL*U8v?|7qڷt߿T*~U|ګrYDċB9!( ^;`BVkauee`C74eAL̥BT}J)(h:Vw sKC^eb[}ՌԱڈ>\ ŭq;q zB:qi0!V0&?,qo?t=4ByiI׈Y0wg<8A貮[UI8Kی^g2DHďDs/r % bzՏ%@;wʷ6gX̒F*N~ȁ(>\U?s梵uVFSŊLLIA)j #Br2Sq4A Q9ej~N,y4B΍)ֶ)aNpZUsE X1}ɉ<IIlyUFD0tJ4/8ܬIkA4 8Vl) =|>;#U"PpZ2x\`\7Zj~NY5<mL}|-y+le%OaC,Ct&cpp87oۆqK?Gs<شȿ*?6J2 Pbh0{-v5 ?yda?7kLQz(I_,(KL[2ƌ X;3K ~9$`,+YwdȽjX\BÛlJԗA(V=1 $ dW\)ckoaQ|/ozVCQNЏWYٛ3U*^[ȏ[$;aplus-fsf-4.22/src/html/BN3Xnews.jpg0000444000265000001440000000344707215453026012674 JFIFddDuckyPAdobed      y !1Q"#&!1"A2#QaqCs ?D_T e6 k4ݳ9O IJїVu3n,#A'f &ʦ'V@kP!DĘסʸfܔOicq'և>sX&S#I?ȓ{qsv)jB 'A8u>F ଅS, C%jONWnц0f ,4o <mp>#Һ"\vߊP11p/Wwp11r^IO:34ӭS QXv"Lh:H6KŹTuj{5P?EHfW@#eYcU vtwsՆ@=u\˻7өbW|FZNk.'~-ԁ K KtJܳ/#|T9@X((L(О;}$Oq2Ꞻc *|ŕuzzS6 Gxr1Ej+).Xڠ f`YN L'qWɘAg-e6lXnLvz#nhb$+$Ej7VRAtIV2lTă# q:BZNdFKJSq i:n9q-)MM_shې`cMɬRMzf5v1pV3:b(d3^n@Nauk%T"C <C>0TRq4)PQðؠԁ0@jIRޒzv&@*cwVp?Hy ͉1r j+iuW?- H0PĀʠOQ^Uvֲ*͊Z(@eƤ0N|M%}6Eib,Ak2*jHYTiFDؿevzAArETDM5>w|kMlĘVP`way:]O0mdd2eA:K53.himIڣbѮ1Rq\;?/q8R, &:uע% R\i ?O~Ю_SnHMf*aa"Hbt 1Y~C2u(ȹ!-m[AkJ:[}KjQ.`Fm[AkJ2[}KAWOJcz?-9_>2vGk*zHJHoX0YlMJԗyL=#?afٝwو N_#nO.C]mh1Ƨ_|nwWƁ7{ ]]yF[&䪺o{uU݋jdΪ>;Z &EfuTspšRpNSJSYm9?aplus-fsf-4.22/src/html/BN3Xonlin.gif0000444000265000001440000000124307215453026013014 GIF89ay̙fff3f333f333!,y0$HmP7(dihe/&WEM̽y p(,F!nQL2j톬 f@dh 66IX{YqxKR45g n=8Y`^ u*Wciohm>Xum@{C-tzuŶ|tхPP h7-m͛Y  >`` w9pU<|^H'EP%(B&u]P q!zr|jt^DKX䙜TĽ:GyǶOiF:,@`41BbN+i{ڧT(F_?vhl)k6Ys`=xe 1 D 2 m!ugmϼ4rA y,H4Ǐcwm_g P A V7Q$VQ‘54 +Q`(%( P"d29C a&qb@ %;aplus-fsf-4.22/src/html/BN3Xonlin.jpg0000444000265000001440000000646707215453026013044 JFIFddDuckyPAdobed      y !"#1A2$!"1AQ2#aB ?ivv"%Q6E3Skq R\x'Sk:gƺj2 ȃ . we;p/JUaFm,fLxX3Ř*iy#O}磻Nk|!'9c29cXs%0ētV!m:7]Z[,#d{U#V5]Wx"j ɬOk"4οo;8h*&w \LƊm-Xgj)+(]0nq&*W9eA5֍2Oۓ]n<&. Zj'E4ۼm%'U(r+GVT#cm1q?MH^"gdSd7lH  -k 2\x=_YWɅݙDL7e\V}-hm:>7nn,"WUrj;4:ټ칉TθX1c>FXUhͫK@a`5#4&X~7(ֶ @3R3@hab`-{*n౩<ͦ?_" aDɚNm#x2;Xb) UO>ȵv -d 0 cɲ!J}U< "Q4 Aɝ5*A]-?CPl"͚] $O) { ?Vgd|C+$2BE30uWb:6[AW2C(mCh{,:iKL!.-T_e$Oʼn,E"wRz.b#Q^+U/RY`teFE33)v42A]o`teFE33)v`t"g'm_<9-D귗6ItY(uW|_ax+ɔXakR/bFlc ܬ_)EP{6-VDo%kSndl,YlE6DYY2 keG,3}J׍pj'FRqRCYX!!Cc/"x98$*LX%)C ߴLjlvI{xHyYgAik0M&)ᑮGj*ܭ+-m~:"ARcقARqE  `dve6K_hZ ̽_G&7X'5ǪykS*/8d`AN~^X!R?2;7<[=踳F ҰhƂm 9%d zJW}>-Nz-CX \cQg7+eʓΧcYLQxLB#\8~ߑ]NU C+ɥ lN2k- c3ndi:MS7a4XWWM9YÂ#SǏǶs+= l,;&gz%>׏gU˭݃)%ƒHL׬5l-=~WuY%sLg5tUs' {Y]d/%v鳰OǢPԥd/%votcJW=okKmZnj֏D`_oozqw6Ue~*&e˟==Ԫȳ І"DVXQ>I{P *VS ٝ2O-\Z(c?YL3fde)}3q/i{q{ȠZŘ'835Wj ،c|^{èaͳ.8@HP @$%XO}_:ʪضgIH :; 7Go#i{36Ͳβ&R{+}2IMI]vr_QKVEK3̢ B $6U 4iMDTI 1(Ⴈ@iF{,=ńI"]< <^;=}G(YÆ+f/ WoK,>d`A,f-nӥbii~KuPlD~达ID?*!P1{i|?%/<2Cnv?^ғQ"ʦLhWGNz!{DYY ^k^5zyg=/[H+/,Ş# $dV~~H:|AX^Y[ BLRD7:tYy6dh4T嫬W X@#nj8j Ps\BjܥJh]Lڳ0y'hmPCO%mRFb(ȟȜfhMi_"i΍:s,Ip G$(dwӗ˭Ah!d:VGtkw>f4 JWN]U׫jd,?1?^'ޯq3=[w0mA͛˼.G\AB*'lA7mIx\*'3aplus-fsf-4.22/src/html/BN3Xrefmn.gif0000444000265000001440000000111207215453026012777 GIF89ay̙ff3f33333!,yxv(YL-ͻ`(neE'6,Jqvz>lyUFD0tJ4/8L24 ŀ^NJ- IYefie"elfU"mc72\`\7ZXsr;1fof(lOYN-+?%%fϒeԌsՙlP&.FaD&f(ed58IzT:6 `Gԑccrsm삵(U:G\2.Q +=3`h3ސ4 UV6('T .@_.VUcDg("Tl@޳j+\˳600)0YmgϢa="i\JK;4~E5:]7jpKci@biN^@ jh+eTۨA;xAX;{ Gos20$t1_#Ag }$J;aplus-fsf-4.22/src/html/BN3Xrefmn.jpg0000444000265000001440000000522007215453026013016 JFIFddDuckyPAdobed      y !"2#$!"1Aa2B#QRq ?E[ҠuOV߰5VT YzmݺeNB(1HR( qj<'H[u &NNAIԙ 2, er2~{' &Ȍ>Y F&iQUB\Qmnӫ^z:J+]!Zz $=_"kԫԖ4Zխskm Ϻv5[ QZ1ڨ2g(21;K;Q:h8ykxzSG\dY:őV4M[-] zo^H:l^@j">'* j [+cf%Vf T|O]Ujj,u,(%Y:ק>KW1kKuHo4qffϙ-qیqJb*_fVĆTꊧűHb`wѧ{f*\ꊧű3urA$QOL #W0B"VԑHL|]q0$*$d? ZP`a[/0$MwmU0&4֗bj6Ln=izl23uM5ҥ6+b~_rb,E\<<ԹH_F/ZK*K)T#X^ᆏmQUK]Ph-ORaY r#bHS$EBAEmJX0uU@iH$HԮȵ \[d!HO1eO=kyVuҵ~svTqi4Yl+mՠ ,XϕC `A[UaaK-6IϑC qy,wY^YiH݅t1#xMَbTXXr<*;6I'=pK|ڢFc'IbbI,=sg-(.Zh_lE z+" !󂊪(}E v`teSRCqE (?Q |MǬDtq/SoP#yztO܇cOk=XH{lb? i{ݫ_a;U_.%]B\ iC*\]f ,ѵŃ*#%+&H~HdЂP*fnC;CbgaIHu:,?iIxՁor8a(9'6bE`$ Ee]j赡qic\,9caq6f&5_.6mC(0ߒ 1\5SH*${?`jBԸ'&LrvQ S$9 X krhȹɡADz#zDlDFb׬[lT.IrkNXE:"MpL #b^U~AҶՌƖ>9gzd@\ On𴭭u{Ɩ>9gr䀀1 HٽOY)(fLvM6}ADϒy_>P/S_5{Jؖ">~?kt`?Gߤ|we벛ѳ6g04oȴ7N-xDŽD9&+.ۗR HUN:wɿeo.w.Zd@X.] )!;ϑ_Aj[c$~|@2C\8/0s%.̘jGdmϘ [/av>dRG:CWT:Wl̯)p: gݏ)$8bj& қ+&cq!wb H" )k!0Bm'c:)̓ivh[Vil\~T:r^mTոϺO 8١E*Zo{+,XUljBgP V6"X\zڟ+J{+,>.tz=GϜ}(흍3c"QuI>~"X2  ~DSiQ=SzO]uaplus-fsf-4.22/src/html/BN3copyr.jpg0000444000265000001440000000620107215453026012713 JFIFddDuckyPAdobed      y !2#3$%& !1A"Qaq2B#b3C ?ZC]M)VQRu>@_U$>r#41uL}}7ǝ%q31X$~Tbȱ#z/<>;2 rycG #}y/o;ȟ F̋]̓X ICmM6Z JVW+JZS] Ɉ[ cG,ފ <Ƌiv@汱s"v}3撈UmR1D0P1&3 EitXn~_橿GB;8!up=d8H;k.A2OGߦ>`c!_#JDr kHVa>vv9J9fIx%'F{z Z(!Ba9=Oòc$ƈā]]?r] FLې-KAgu1~Տjr9V >V@.5w_X ;w9/#@ 𯎗>녲D[B7NUgE d[B3(eepPjy=~̆"@Tfmq}ȗ ,Ɉ2yd@"i&F7w8+*K)Q=S'\pَKu1rO{9owa>##FW&|(@\PbdoEZHFM a_UO,-Uމ~XHnJEF4M\WÍY5]'hôŗ;# )2$K()sG>X<`1xC_ӆ9S^[Q؎6a B{N{_k HI"(+b\τa?U oF2X™`J^b;=PgEz\fdyVa> FNɐ DW "L "Ke *K ,pu)A4y5Ӯuegǡ7,ӳ1t-'wм 1ڙDb& ޛiuV,g* a<+x@00L>򼭣[sם^^~A_SnpbQ,ϑj`"  :Oݣ)HtfNoBω,ۍ SŇ B U"i_Avg9/ͰwYU|mSf{/,(H \Y`y}=z~?!̕BLa?>.=}} .5: 튬F:H* 3r^2'd^{w#}gvӘ}ß&|lUtr ЫB e 5ثJP̩%1B2A1zD"` >ٟ'2#1p225!55Xk0 O5!t4;|DS֠-]bѤeA<(1wdA ncI#y5Zq/lx'3ybKBfSY6 i|| ײmN-sUgiP^vD0ԂRωK"QA#6P*_[*tX3ê\F,Y: 9Zm e5X"L D/;yi2خ$= e>8ȬZUVEW-`X?6|FPXc,m[nqsXLH3t+ޫlr0 ҄ڐYMT'n_Ñ.U; t3_!_͂Յ.] m+c Z Ua،žA5"Qpa'@}ﻳ? βz`q0 l{t(62 M2]꩒.;c_}޶{?]'?Isd=aѫĕXOs23$`fkŮMi|MtW81Td]?UM[_LĉxQ!c4{&XA7q||NP!H"gm62ˋm2m$(F΀z C|4Z:N0}V/31 d6:R79PUȊapyc (7]e '<2y`Y54#S3I8z:NS%GN<2My<'ݡwg,Z=N2Pw`nQͱ=2gFksϾkeM*LVk̔ANbݑ\1"ȬHwNx}4/<`\>iBepƤZ5q|g+gca DJaZ%!H`̤Hr쾩uܚےy$ǒ۫!D3n3,N֕5eﵗ`d0U$_UQ3*) Ied,? }6\hy@bRz$RSKkaplus-fsf-4.22/src/html/BN3email.gif0000444000265000001440000000033707215453026012637 GIF89ayf!,yڋ޼ vb)*7Wqm;%.q`#Y|6MUeE&]n8 9 gȮgteGHGWE4cVxiViW(7ٰCژ*z7y::$Yc )+q -=MQ;aplus-fsf-4.22/src/html/BN3email.jpg0000444000265000001440000000643407215453026012656 JFIFddDuckyPAdobed      y "!2#3$B4%5!1"A23a#QqBRr ?qvB4nD[ 47pEēfKufv!8Cts%yOqǯ!˗2%v )u\Q+e=B"~JZ>/ZI.[$xhyYeO292yAJ+2dfFK=6Ij =vV>f:` m*?hAow4˄G?] Yz<1t|$+xm%>إMFWۓ!B;j>z^-m匫fsR66 | 8rvԩ8 j0"ʄULx'rR@* 1nP!ǞȮTeܪHjW, C(!7!~l2%m&Z-8._o$a,&Q/)~ #.DDc+ >&hK/N q2#XY;̘MAnKo,eXUC3uYcYÓnOLܭ;QT"$KAIPL$ź XM@{'"Pr LY(!\- k?;[B+:"a#ܒݱ\8EaBi!fǓ BIn6=N9d++1Gbl}Лb2Xz&Z~$*UkLhCwS#.2᫗L!`mJ ȽT,B\8 p3 = Mz jW{8;aEWS,-!la6m]SWfp`2֦NpL%8O2W<>>a&BK(rGJ^;ŗr#!#Y9vİ4B:G%c*]I +yjWr÷#@ $YRJѓVY@Wi%%K-=|2E*x 1`I*P2Vn'x[2fRUlP.CwO Ӛ=8_ѪjNV} $W?bVVVpʭHj)Zsf^۫]\v$2B™qidn^G鵻u:.j~Ww./ntrvΟ2²Bw*~ (qcSoRՙ"ԋQV\j!U*̰MYHj/juNP^Wb ['c`"~:}O@VbB |ȸ[P]`Vۤ(727یՙ`V*e`OXך5ֿ߫RsS܈+iN~洩*B\g֖^ŕf`U2Mz:͍f\' MzUm7q*̎]ck&p‚ @\#Su{M;brd}g䶚 -ty?̝\5ݺm΂: 7btW9g I8Tlξ e%:)/P(D0@AI$[iP`S@Zf%Z)<6ZaWl[Z֞7v, #`#P嬎v_j4noد,И(RI$|0+Uٗ( .m:OZi0͓2 0 .B$o֚}hJ[wK)dn3vIJ2rj"ȩ5c9“a8gsܮV'Ę#(Vf,z*DYע9raL8QU0rK]zIGxd+؎u Qߦ^󯎏WTl&+PY֠-%H){0$u0~$%ԧk|47 ɜr.MŃrV6ڵЖ` k˛"eYr ΁"mM vqh4$&% ePm]̂%H9tcž*9 J`orƃWoaVByӓ*122Ƶ*;׈Q?JN㿻ܸT"Z2䣪x-'VV`NV( 9L X1;}-_uV %L,IyoZ&h`,J9z\d' m-wvyH>agB"<: 2֢̜y‘!@VaRGp-0:qewU"BʰVu0U TboD@PT:L fiRLC :]acp IHTܩ\&wu䉺lX06W/''~?vGȻ,]u% AHju6nK-R LZ&%*."Ds-U \!"F.y^Mn P-fŠ(R#uMەUaơ (*̢7Xn6=eaplus-fsf-4.22/src/html/BN3home.gif0000444000265000001440000000026307215453027012477 GIF89ayf!,yڋ޼y$il:'bf1!8l1%rh"~bҘ&{CvZ6N[ovyӧFP'ǥwFH!) 6jz*Q;aplus-fsf-4.22/src/html/BN3home.jpg0000444000265000001440000000462307215453027012516 JFIFddDuckyPAdobed      y "#!13$24%!1"AaQ2RBb#qr3S ?zsGFFJo]WH""0fJ=\  GNw`m2#Ƕ BAj̍$h>IQO[acfAVlmHRJ 7h WtL{}<@GT.f0X,uۜ %X SJnͶZ.F*cڄkڞ1*\mWŧ GĽ['H#^y1Ӈ )C& 9>ٚ80*c!P=#V;/{qSa!.5 \"Q\lWeI]DIkX].V{r<^2Y*HcZc4?in".f \lk7я3Ճa}-^9Wk"ptֻ2M1+q-)nC;O~г%Ǯ0/O7hqo-cȤ* ,(9gF٭Sϰ&>g.]dv~$Mܡ#YؔN2_Nֆ!SS?… uw%Ұ) iu hoK|ٗj[QG<<)YDk3QL9:3@ ^eRO$$;L|HBݐ cc[0 X75qϝ{"HD@"X8&Mhn(I-]X{ ʕeDJ.-FҶ}$2^{y3Fh'aɆ*aw ّ2[DrggeT">)"4IB*tH"@*L?z7v6|^WiNvKlM䙇, w/Ŝ7s©0R1ѢBH>n>0le$*0ƒTB " kqڅ&RSŴOY[lյd]H<=fdFϘgd\8<]Vwf *  KnC3dTRł3jϧA@: iB׀+xd?*K+82,#T՚I 69xc!ٜ^3l{Q.M-zOgMb6P] |OKehxcfko\nyz1R⺢=#fD"doD_\p 8P{ ۲x"d75JL U 3Y"0rD*L[?,DǺG_|kn~Æאx{gǐ^e:S^)\6|ruҟ^wmVz*jlB\(U"/2!5c6w|M"!c;~pU@XPɼ˕h>"A|ELLL @@ &lDunR>g߶2={.?ûyKnVjPS^w}f,f>Bϵpѣѣ_aplus-fsf-4.22/src/html/BN3licen.jpg0000444000265000001440000000565307215453027012664 JFIFddDuckyPAdobed      y "!#3$!1AQa"q2Bb#3ђ ?11VYݭmR$5 $g9/e_XZ \t/Bɕ uć,;Az0jv]%0:j(gn0F`zV5m[V, a+6Y1 23׮aXzlOvjw%U{\ )Kݙ^n@^n*׆5+ ̆1gQ"y; ~ѠDDq2}1Wŷf*Z&l`RL`&}rc֊k* U&, Y(0 _ՀrN g.eEe KU !MFtuKVͻl\Z*,)ljZɔTQɐ,^p4%1Q1@N[ 38ot564 {EJ, RK_ZzV5XQmzU j %ʆr/)LQxՑ匊]pB.͋RHF5půe"7m,qH h4hes6oukQ+`+d+櫓 Eh2[4P a f)1 sؕ #<$9FI%Q`3!w4,UU,`79ON7ѭpuk^W#2v0.ZIb+Lg!,#'#h#XD௵%Db8 L*Qp`붻A=iHf ]S--8u2#z cdld%CDM3<ĵYurYSR#p, Q 6.,/gqIx⾰7 =,etB%Z(.~ăO2qCw XxWZIoN}B+ Kw.@N~Tk|v_XײZՅ~ 2WgPpSfP2Y]˄ġ̖PXgHr˙ooܻepo-v DYIPD; hנ5S3-2aYi,S3s,\~:g)5 Q0z )U;蘆춹B Vdc,ǜGeA:+@  `j\Ӵ~^jXQnK(d#qȒqil9n\d#FQ57^wyzfWZMHNAA!LGiQE2vx׈KEk`八j7.rMP)S Ж3# g=3X|c> ܵ $I̜ڐg5=oCwMy5% ~uKJ\"=Uj NJx̦\wQuO}Cw{ej2խڡCD6Sڶ+a~+mx Ah1x'2Y]c楂l $I16Q^ڳH @̳nإmr.8GU aVFTsW.4hpC?ܷ1/9 ӝG-e0i$͋a;zr>X\R`׬lt,Ŕy7?a&<-ZT@$gA4{/;bե oRZ: ao8gEةtkl_m8xBWF5h)q@AL/, WrYn9γ?-umyśnZbp@QPŋAh$\Ajnv:[cPӡl xc\!Y22x0a0c Yݨ5 @GB$ p1U}qnzLWSV.& , (Jbp{6Ҷ P@N',$b d!HC^qMZ󻍣!HCoVZ#+YYrA}k5Bzcu2O~zKE|Qe=sչFIjOHݣ9ƨIni ;=1H&lfAx?x|]O[jiO2?P#>:V\9QS/o݆N__ VfóUgiuyt a#>ADf&qx^;;}݅ӯ^9|x/`\bj~\xf/eY. Li15yk"bdvvzYWLS5Eɽ`KO$/rd F]YɋVո-m6[^,GD)[uzb w ݒ_aj6lge %ˀ"ٯ'"0,*L(n4Rά#X((ːi Kiًs\M#]I<4,9*K%9IKլ+̻RAy3( =5xJuqcfPA,{@0 ^W= z6K/bLḳ q2̄sBx$1q 1S hAB4?Ңȅ4 fsœRRRRRRRRCZ$올e"s.Rv ģ [^x10*\sZ 6&@*nsO!Ƞ+-%Z[M wƢ^7۟\ڗfޫUffL>4Cn~M'otŜ9Y{ $ @:W#>_w#< !D>N)N)N)N)_aplus-fsf-4.22/src/html/BN3onlin.gif0000444000265000001440000000032507215453027012665 GIF89ayf!,yڋ޼ V~j:bI䲎RCJ(Rޓګ81D~ٲ!4!WVcrq|얃U Oeeϐk 8)/s 8Xq$Vm j;46,GTUb/>!:oau|dc!I9Fɔd1Nݵй޶khcefdYGE~SB'ȈO&uw!٬)%ƒ6Gf~={ 90|w`A왟WzZH:mDy qd8ϋ .C;j~ʹgA&Ly|t~dqJ/%Ǜ I{ݧ҆pH/O-e[+tG6Lw0A;9z8}c-+lz4J mRV뮚׃hꬸ xԕzۮmIǤEq.',`GCW׾=XMc mj"7,H`H?ȬtX3?r>E,8 15̋L~e_4{|d9ǯ`@ R'p!J5$v/\ nBr̓Y &'@eڵ=> !&@MNډ'W[kv5v_XJru*9c46CchRUƄ ʡ* 0ڛ \x.,dc[f ʣP6]Iսji9-=f=uoFur"^I2X]}yCZ22QeWs0S@@*f-K|+; +CK22lV+҄/nQNm丼NųZ|,O*kNm: .v &>3MLg+2dǡmNGH˺o"4q't)64QC/{Өx>ݸ0 i*hokTAp @0xjA$YX1M#e683j#T׼K*2$XFF G5✅kTr}̹bbOrm$4@ I$mPBRCWʮ_W=y:4 -Fy!G]U|zy^ ]Fs?AnlHw $ NF%$%u!yk*J:{"Hngh{kuz##$G*qfzĶJΐ#'{H'PIs&('dl4/@5/T$343d=C6HACӋ Ă P8E2qE Ix&r&BQ4jA"w'Q0bvDX)>ׯGz M ]DY̐#50pG8 8(&+ ^5]' XrN920kA25򍶭 M&S0U . uQϋ?uQY%50 R0-V'r0.'w|a|/n"E{pÆja 47Z]>h7``3YMC[\ 07HdcZ`U2v9/BẌX-ШEK.줓#ޱUzGY O(A;aplus-fsf-4.22/src/html/BN3refmn.gif0000444000265000001440000000027607215453027012662 GIF89ayf!,yڋ޼@%rA^)hЪܒk״(XFQу8mmF4xN:YIUk{)*BHpFbieRUK-vVYĕ"1 (X%-.0y:PYB^ech7HO,[f / &o9~D<+aF!WX 5g]}L a:  0 U-ݫdȈ-S&ZYmfɑZ&:YSmеVY]XǸҋO-АZKl+i4PW{ *ߑZMbUf4mA*OfUi;TaTf4&.:ctzƥ>$>I <0r.Q `㽁+"g14VH+1W?#irp - ~LR|jիWV:/?욵.^JXb3/^ǔ5}BY[ *b]ir=$%XC$T2ʕ9^F+!~e Dpe q-eݓh;kC8YzH˫)nfc.^MK˛hBױ\l`0c[]lj&Nq:hF%--,}fC|qX յeXYXj^\ǽw[]쓠:>BCPĈh fIg kB) hbK0cE y/7TRjnh(&>RHAwCsic3}Eh*Fz"^=qgdc],1@QmTn۹eaE~g9FFV̂GkK_z\X@Xjy1Zu:,$]T3% ~'9N>]C7'@J1~ȏᬮ~vO]2j_ոG- ܬ=׶ ~e啝FΗ2Zz#")v҆;|HU>[+B1L[r1pUWkR?Zgd~Ec6VPn|˜b4DIa`kG%v9Ӕ(! r}eIȀer?G(@U(c@bj E׉lowY·mӫd1Tlyq.+$F4rNE}Bb+G!w@j h)41Ø$0St H2'~Vضj{6{KѰ:ǵ[:D5a>#NPa=FS-f,_<ݰ˒+G -jXxl#eGߵdT] /?T)y uޚJOSWߕ$=x1@@h"Xɗh v\d%&]n5W> YZ|kaplus-fsf-4.22/src/html/BNtop.gif0000444000265000001440000000147007215453027012267 GIF89aZ& 3ffffff3333! ,Z&IkQͻ`h1 &hRIk,-$o6W3!+A8J*%G"8N+Qb`sRfnp %s_gr`.i|J~ nx r _u  Q\#%.N0& :Q yZT~vъ ҲQrӝ6W Հx.֠zQ,u$h @EAMm ȧO.&̦\DPN3(" rYٶ[hiŬUq|Z+V!8i,FRUk%C:4UCn Yk_ ـ, w1: ,.-2ؙ?c)s>xG>>#^ͺu$R}d<?y~6 5L񹠹$ ^"-yjr+Ӻ 2{z;һ 'VgtfMN,ڗU3`JmYesvY0!n~wgIFVf..vriM8+MM.Hם 4}Y=ei+2{a=bv]E3f6WX9#h˗UTt5 l -ݜ\]j厩3[3ʁ~)HIN̞~ٲƣԴr߆U}%'Wݴ9@vZim iajhheeddafo@P+wW:NW9dZ0T?~tݩf.gfOQ΄̞7tfsΤՋz&$ݻCRKDGRZM,,-+*\ ̗~OCsv;na_ܮ) q->J344M-<U Vj rkr7f|:r;W[6~} &W%ee=8XYS0pjþ3S0:TuO˟\?+m3s&i 9jkyr}ͱ+TN:ܴ͌ r/Ծsb-Y*.9J{V ʊ&WVLmI.E m} n`u]|qb));"Ydz?=z1;(ϙXj~OފN`:ɍӀ5h]֜WEÍ[bb  }ogOv}&UN̛\l6W; J6+s&VN@JfulX:hFQp,T,ȋ1 1j˥@`i[21H,v{K2~UnE4P-`6.ݻ^4 }u '=Zҧՙ%J, "X`{bm=+MTґ8|fk.ܾjƬޢm05^=?^oCk"̞=%3w&~scC;@A{M q.()edM(+X<ء.شtnڲtefl㨨;8/@[fuv L.UqFV`vw&{z7/)Y_99ؘw̖ۧS1jc# =3=EEM}s#C` d߆"7+}=g]w/0 VN_wp+hc-z-P}r502z 'h:|.uzir}L&Kmg]_j=x| m^W\.{\{?RǍnW:ozor 7zL?=3ύ49 G@Jr6FںnζTZQ:XMi# P4m_9eUL6"&dvvw`'8-/=ZӺJRʀ=` `Jc`MZ4hz3h6ffk٬ٝCVXg즮hinha`chf |h~UFѴiM^h:M>c· l4{>?dz 0hۖN~C fdt䵳 5)`7,>R^`<~nE@Y}$ [w۽g,`kh]uܕinɬeSt/pZU9}߿TT*kN XY3M-SCks w` P|x҄m =g{ES lۺztؗmmn= ̞c})kkˢ,OH`spzhؑV6|.S:ln{Ղ {qRyo~<232́e͛WfݸyY_\SXY8{o TV>Nf('z Y 1"H43?-ϛPBpCW!QO 0[P/03-0;u3[WMo(Les: g45,T6|^wՂœ5>\2-m}-M#-]c}}{Y[;:ƦF&66ގvv>v^D%gSQ©4)g{~R{aJ{vZgП`a`ҙWw!/޽r`w*4,Z͙TY>g_8/hF[w|ncL]0)d m%%umMC5U}%MCS;S[耦-\m l,܀N`O!% >A1~N~\'^ͭۑ+A+#*[ ©Y%S*{P4ʖ*&cPBf]h콟?~ZZYh[Tjg L:V~SkshFz@!0QrLm,$~r%ԚO_LX5ǯa֥ xվ Ye?zAӅ@ prU0{eoɞ7zʩium'd&Wm%: NoqjOe9(2k+Oyyuu-#Mm3 ws wK+#S'`u dB' {{‡SE8'TTF'{vLztZ-R`|N.ܾW9hJ[N/ZĶ䎼,PU`͛X |ĊI9K7L)X:lVKѴf`_44|MJ9#BEM؍ѵ@{[}C[u-m]s++/'€1if钜@H%M1&dדmB`۪" 4^V>):8T[fNHlz,oB 4,c8`XNHʛTY84:hZC P֍@*]j N:d.Os\Zutbr?ph&35Y8YkqtzS6'N59nw=tTV펗/v^yD+O=Wk#0-ߴt-,lL@PyycNh~ >ܕc`[J{:ZfFfFcc}7aZojm +][3ycY 1+ 6&jmSߔ#EaOZJՎ;TwBx5{se,؝%vXawܒ(78 MXjjhkE?M-@޳p6/@@nLVjLv[y Ocm]K5`OJJM Xs‡{u~>5h_ҾA۪v4Fl6bG]jM"'>hk߱MQG{Nto8~azӓwǜxqFYW]^TpeQŹ\_tmE͍U5@+C/M>!ڤB.\;tB]>:v\}l&3ΧN9xb-ܯuy~7|6]nzoߙtkb!7'ߞtfG<ykf{L\_93@(>2#=9hzkጎ%ӛ4WOj)v@VTsJv_e̮)5Y=E2{ ҺJR:R`3,-? "`4ڴ_?ΝX93&4N zXmiejg衦``ꄽR ^Z[85^S\O-%ht,DV&@gɣI5~h h)4KWߒ]VTʌ ;88pऑOm(ZR dLk* ڔ]aA*>v0QzlavV..Vvf*5gFyv7fO:4_MUNAO)(b{SځI78"-ȝ[G5h Y Y8 {uy`Z0 hiڼi-SZfSe{ʍ0C==Đk,-K>tRnyt?bBYӚsoR-0 s'U#0<7 = > &Akd4V7,[;A[jAl>l(\ n-^:lv{=U2_.Z%~XmI{yObSKίnL;+ I%ZC˙X+\ylǒ^Oʀ>`JM~\MW!xҢK&hf_h,6oj}ɛRW4lNWռުy:'lXX> oLߜh ϊ\u`zUkb޾{ P)Aq-eQ5Iu@g*`޲¼e]%fQ̞_xOЀŻM( Z6v^gƻlyucΗjq) eF쮋:2آS ?iZ;KBar;(hZoMr'Wo8 JA+S;S As WOowڲ-߿9{½gɻۏS˦7,?y<[44f4*]9w[Nӱܑ Pd3Q!aѱM)g(\@Њ\Ni N\k5P*wT`t} (ϟ]O`Xwh+ha4<~4'țRS1s'Mv/ǷeS}b#s~^(U4=~{BDxL]Uګ 8 l`Z}\,66œ'{jZV^x:{;jmL+uҥm`zkߓѕi+-\ޙ ƶ̔\tEE@R`f O`9Z3Of/hl5BɊ9RX뮜S2rЇr~ITмgoccs/_A][) |Z[Z1:kByh h,02$ ,6[*`.y؂+@m@@*^I*2߽3qX-T1|noݢ Y%?%5]OLISOEYKSׯ/FVڦ6^6ƦNA>ǎ \, ` T}){`Ԯ<`*&?۲2 @s93 M1%m֨|lW?V﬜1w•K4m~3xܰxJMKY`=S]]3yyU=%U]}+%e%U}KSgCc/#Gs '{;_'G{; ‡gwT cɽ@@y.›ngt[>[c/=Ht&w=~(Ek{ϗ_7Û#WNϨX{.ѼaJjg:s'uY6S_BWTGDEEW]@A^.,$XG\][kokk/{`4ԇmK5/6؋əP*'T~exxhsE_kg{VLYhK+g4iRS*sš9Kn>spÑY5ql]R4~uitVk񌦒-M*f-lh*6m TQUU34703ӳ434h41u006uvvtF[(@!7zHǯ/?}oٽVuɊk<ٓ`E&`revoQjr`.o(@'TLK(ٖ7:jV=T-:fv+,k_S9WUMGGTKLSDSDM@UHUM1HKAS\^NI] ؁1671wơSS8qu  'f8_ 9@6,Vew=+9:003ؘ&]` TBJ`F͟lyP?:' 0`RMZ?*̟VW8r~WѬ6`lu-EKYLm3#GUWC L< 0z[[yZZy**jY9֙88‡Uag6ls@{@׀ `m ``B *ELKR [3Z2uCB[n0P@uc h͉U'4orU?U, lM zguZ-/*͏ <{mn:rai cgmfbkccoh''dS(>&י3‡v$VTe[ NAЙ@Ggv'f fImv`uA@K+rܲ>`X{5n/ٲخ5nK-~$¨7+QzG+ʫkZYXXz9˫8vD+ G?~‡fG't6fk)M#E hb(2[h$"`a,H9`ܙIP[r:,vEj6'NV:`Q`X:{ѫgsfwY>ú狒@_s01uƛVNA.N JlHM, πֶ9<-4`$obyiM&uM@v(}53nʆ*g7xP+`3 &[3ڀ큲V=[Sj=occ -SM-s}};gs К(SsW%%M 7`70`&tpu;Z 2@? &7Ƌ@z`B+Rޑ>2D`SXTj jM/02ql=hc'ߝ7]>(L&T7\C/pcpY oohe ڤ$L5l@EK{{?=}fJBIw''ugMSxEobEo_Q]֙m)8::kۺhjm͜V`+JO\=Lq5}E=?jWҙ-U@KMf{3ZKA5J=qyzYi/Ðx3 - +`&&N`UuL\Qll ‡Z%ǵ{ 3O6GO`_5pj+0.-z>"hyїo_)9ӜѸ2ip 6 oreޤ⼩51ZP?tf+0>5>^xc2L̜U=cfld3q :m >,Ի09]f``uվ K>aۖwߗl~j{d7g-4='9`_o/-R?"rut``Ju `__38 ӛK@k?,Kx0t_d&Zjh#MOZII3qvpps "W; R1htF{A珂)~E']k©`juhX%uQzoi

I2Q4 A_ MV`vT {j^ސ*I묞n`MZ_ TPޑU0A-Op̝V9 U2wb -EU,Z>o3 g&ԒYRQ.rawg½`]50qZNP4UQ609 p῿&F6d79靅gW'g@ACU]E[W!0;.+X6 X Oo@ )ES@ES@qVߧ( )i=3OL;x1"]= umS]}K#Sk`{MCBOGXz++OH* Dة 6*KW(hlωKOKkIk =ڞܒښ C:wN_Y1ؘ`'R-j耦nʁ5Jͬ6` (f4/.`;DKguVjmdm؟pB ܇812vvUWo?V{s{[+7` q;^UN+3iܦ-l[y¶Y+O=c֩s',蜵bԅg/蝱dVi˧w/޷dΜ&^0kN[`}4̟2mkW,_4ełZl]4fNܾkgO[rļ)]s&Uϛ}yJ|akghc`lgoon7Eom,<9K `gety絉^ucՉ>纽\u?qB3m.gڜN7ٜms>xT:gm5Yiu>VpLFc5'O6ڟj;pLs.@/x\}>{.{ݘ{cIW'9ۈXeco`o l[ގaԝ1.sSW{o`a .iY1Z0|J}hke`d3giZdnfah RYЇ>@_˒z&^}m.Ʀ.:zVTx;P@_yYxXrFvC~t1j~?@\6?= AfgU*RU3PQ:6F&N&n@YVn6 @!|ehSy454WDilH=Up #**P?QopJL*#ڻ =/7[z_|#* ,=Zy@}o*#Z Tsb6sg'^u>bV..y][<`j[ih蚛Y=fniinaiZ}a dڥ8WlA"7츰 Y$88UFSBUX[ <ͭY$,, oV&v>fj=fbjf I`4Z()f_߿.JF?Tm0ɑoDiiVFfn>3,N,ͭE;$v߷ϋhrjY]fVTjlZk曀qhL!Û_c__5N탫("FvƦ:zzV|,T-AG2zI+k];<)`aA͌&7`T[ t>+l ʊz=`3N+qd`$~APרgilZmhdbdl[ `>[%T@IQz 6M,B ɾ'MEX^RM1 M >\4!@ʡ;uĥNW--p[ӐoNݚ|4YpKKXjgNM\J: iJo;_eeWAܺ3& @8lnuS7cj"%rgQojR#̪ [ȇ)rPc[ӰJ=|9%0JNNnIeEhٝ a*%qbJsD{df-%%%u-Mfn)7}0@1,oHJS>~JtlԦo)9K @ ^tq'E`횵蕙ihDGcǖproI B[LTo֌p%"P;hJWlѩ%9wSR-ස:GS_YjfR~󟹠tS3g$\#xO -Ev i$SLy/q;d׈ps$+blGpQ\ !İt d_mK WLx*ʘLflF< ΌLvRxؤ+U]VVraqrj^unQz̬7n j-a~M;۹ۿ'I'1~~r;Wi 0."@0e4 M6ٝIf‡"3Ry7'=]=^~`@a~l AUU|ޔy<< 8̑"#%@s(YtUup}n z'pFJ+_.J/-U)&OЂ*Цykm%^`Ptȑj'#t(=h*P,V䁏-݆TJ$`ܔQjiq-Y=| ʂ͠lPmJ/ d h)vN% yS'րݩ-ژ7 9h z * ]_-5u@9 `Z 078fżueZJ,[ɰSk(;yەpi]곂] 3,u\M̵m \nݸFX+ {"3lV{)9s- 0PZ -O^4pJMb'`E X_^G,AsIބj`j2!;һrA9;($wBMѴ֌qyb<yi3(A*s5%treMz9jkAeä( WV@ԍ {N`l}U} fwK`;WNl]=yZVU;,sms}y뛳<}OxuUK K ; KG Sg/b5 p7gjN ~8&XTkb`=1zվe3[ @tt^`W: TM(+4ڃ?~6v@-LPeVbRMr{]lkrf+]}0|&_]>_}/ۖL,2}Z48X5K/m)^6W>|V;WNsٜyݿ^StvkW/\hBе5y\H<` Z*rrt;t$z6F{nJW {/_z}; ̮N |0*dFK&S^ڒ_ܑ-5s g6(17ge~nutetul0LDZ+N߸P4hJu̦?<}bj=t`C|2~Eusڀ6+c`7o:\zW\~jMo9e {"0kLH+^9,>Z8uptWɬ[.={jܮOT.詜:xўuNZS ZPzA∽@A^Z_\CUubw>21{j[<~ϯ יؘۛY[X' -,-݀Qho[1 X^{$.lVdsz\ U7014m|`"X  X~^wT^`5#/3|z}y%S@cĵ^?oB:sL#庙-%r&wA[2A |^誟 evrUIAe3Aknls@[sJffAo,y5 zU͇3b弾-e*L?/f]%߿PU03P50t[o߸tʩ9anh垉=0"|]b(8|wxN.KM59,U z>Q^XT=1X6clZ]vC nv1:h/#w4w6JABeMtl't^= 5b̖us./,Y͟})Q1 ؜ :wNK7ySM%LK0mw/ X3{歲)Htl->S9@K[][tV}3*@m龮As, ,Q@Aݖ"ß i.)<`}b t6 :=?I?"z o?% qڙ !E|DSso]m]رxQ )sыM/dwZmS@2N*m9;gY :Vdqw}pCo^\sh+ whQ^ռxfM^>[N d_m+VnX21٢ý4 , utMU 5M䕁 ?=}kc3?@}3]=sC`[ۛ:WúXYyXsC5heC 0w:;9w6kĎ>BœԘ#.\Q{cn̓ meZA'"rYm ןrʈW]Ο~0fte>w%`# ~޿*g4kTm]ճZ_9W֚9N!.=%jo_n:rv×OMvZ5ql`i5~^̦VnDzK/ܽro}ߔn.jrdq>hOmQN`[ra_¾eSzW RPT747712,Ttut͵u4 4Ttt'/Djfkmmem x` 9;ΏuƠs55AV;9YY{989s$Rtt K ,pqnIdks,J-5g@SW{7BvYO NY n'W]#lRiyěow+^н@]8Z3`R`_vڙl>cO+&hܭˀIp%]Y8|zm6xxXZfNA~J5]M*6ĄAWl*ј= .Ģ=&o2jהʍ]ϟUP7s:21&Z&jjj**jj*:&.:*FF&ZFJz&FF֠ټf:Z&@A7Pspvq]bd@XpI֔l.g^QU8 tZwIdv {KՕO{ ӉKL`XenAй @7mCo@SC}^?^,W~Š[ o/d_,0s!k2a7Jk9* @n@Q5dFSI9winl˛ZU>dv{nQ?]󺻛J痧T?9-tgGʲ@Š)0|ut̴t@ |{ @W9kPK\Fz:~ &z(]vB;+k;9fMUt stH@(\kgw׫SW+?`iYJW!LGHt qR{h3rnYD`(t2F ltf@LP?? | #lvu烺rA%vAij}J@Ǥ`ٱ4InfM As3p5ʲAq`+H]0hxt0;N-%[ f4j- G TN^gy5S=X;Yj*~?4p v[ߊxh;_kU #Ey u c=}+M`nf2{33SsW`< L; M399ysw#'sW[[3v)0&;9>u D͚pۧ+͉$pjC$@sFMuuI NX9h(%)/)t !`WJRځYt4H֒vPl%gud+7̎ӵһA>C*(F ܮ哀-6>) j*{Ժ?9sdz==.Wpڹ=gN0?kByGv\es:;i V뫘[5t]:|NWFww?a%݈~>њf*f&նd` < V~}aiekoi :8::; dp.32r6K.H֬p [*b[5N͝ mi@D)js@^ tmRyk]Nf'&㖣;'3((e&9X}r[Ns.V̨ZA;_}p3%X0+,UQ˧J* #Z>|^1БS*O\=6`E۰͋`錆7eL]K'J@#pzr߽ݹzʹqpe>~ͼ]]/Wߝrg~rxKNN X蚀3c: XY*)iE``))5ص@Xpiv-w=] :54*P0(ȟ\ճ@UYy*Jf4'Х0 Aeǒ/}Q0?@M OjZI.k,Kk7wRE2h4u_ASh}^ceZwۗ+zVL[wh ή틛o?y tJIUʹ[p}@5N6T)Ou`&`ѽp҆U `Gtv[vAS A!&\Y|MŞ*O⊿Oz{Fzki[&:4s s Ю:H` ش1pUU3PE70w98sx% 'Fi=_uoIEi]@gOwl5V=TZj#xZs]bT*`̥'cgmZw7iL(+`N-N WLv?%-ܱ̍ {Y8r80MOCC8cgo^^2sA=)*аmoa΄bN%NŽgg4bgo^ش|rZ 'V__4hFcьtj/V]gΤZ`L'[xEnb$l\+X;J Z:#0w6>7̝M]}ky SP : sm\B]iC| s5^Ϲ4ْmES&Ή˟:ԢqagǷ9[脊S޼8q̒)c_>NorFԎ>i.ٵ t d:`p65+f6|t`54 tX l}L~? 9^33@bhlZ}6Pg4W^Qt[M&t:^TPT)Nī6yJgt_4GZ]:!J1@; `+V/f,NAnFjf-kAmŠA~dq0:fLj~({s,Ԯ9B L;+7-s=`,j#RRW~hMP8+B'`̑nN΁A)@3 ..pѸ;/ػ3cZ A '3ߔzW+fh]{mۂ,`ýoʣBI%?h E.1?nc9:qA#K K(y=ݜ;L3A١٤,@QסRJGWᄌ}x~s'o>rGN޾pC<{|֋_ܾ96̿eK.o{`ɤz.=IGtǗڹv]+;|?w#wbkǧ޷޵W6,uѽK^v{⛛]_5;~ޭ oluy'^^3چiOv}W]ZwqYWSwaAé7_|iig旜]|vaUWrr^Ǧ䝘wtrfuxr΁IYV4_2↉W6N]PIxUxH_-9FW ttmk(Ჶ|yYV5,={`Ajm l} De)[c!8~\s8;?~ߵ뀪!kh :PNG 44a e/+SA,lA4vj lxX ^`@Xp{tyv][w\;4ԪE)WgDQSS3C#;uM#`^YMO^I[QI[IMOIMWIUOEX4omcm$́4bn ,<,=-=5" 7'fb]9Xм}RӮ{yco[xy딣 ϯ%\:ۧiG״^rmce97wx~eu6v_[Qqs[ύ-7_?_X^sвko뿱u mV6^Z}~fŅGzD|/doȩ6'`Sp:Ǎk -Wo [cu}>0 11YWJKLt(``/I^ t+5pth| t+Os+W[kh. (\y *~amP!*nxB'GQlfhieF[BCDYM_UFҳ6MM͜@g;b t$af,AsnC,!wy_m詻 nMQ@tӚe=܍^8H- M l ,u-Դ U5t@r;4W,FSA+|yt%@3KwK+7SS6n’ *LB"Ɩ)944&m4t̀ũ0qKQs+fcdf̠& . ,Q!QnV$1wwN£&4,sVnFvU mú!imcej,'t̪30"Ǻ@QKg`^7i @Q 3#T~J+O/0#|oK Oԣ76q51U42&Vh/("MAF hA5e>7KPq46z}S܂x_? /6{td5%*8#{c;#S{m}`OTM@MLւ P=tF<e;Wp t鑵5!F~#CeOu!Q@r_!GMP߿|];hjXc؜9M̝,́-R`ko Eoq5IKȄ @Qo4vXtoϯ;ayfq3եm_ߙ#^B.2_ifF2%n9 ]BdOEAu)7uoZczɶ>ǣ Уpo[Ij*ߦ%%peMڎigVYmZ9~۫]O T;)lfO#L5X=T_^AfkC(%&eX$dGll?zߜ]3+jį PXNR^iP#t2J7,BEJe\mZeE$c2m@'Gfۦx9ue-]ӐkRy> h}aehCYJOvJҙ2 Uu> I 6fZjJrrJʊr``QUԭ}ۻrwΨҒWP;( ;Œ6;gk&4VDL+ξ) dpR]}]5 59W58aMcKO-ľ wwpv&3̑ij"q*G۟`QҘ SrJRjj`pffKaɴm S2@8sf7VV716423Uu.5z[IsDRitKM4*.oA NJphj Y*-̭-:):p~/x x}p!WS(;y dS+YE,؅DIM= 5.iI OZrh7ef>ibZf7Z!E STݲZ:ӸT 2AecSQ.fkA;aEhZ! \hxm|kc&6{Ɨ.qf+;1KȹR]u?eGNLjܧAF'"ixƔUq}P)o{*c\r +"eJ@*?ZGf)A0 ÷S3iՌJ`V Nυh 01>l;ϼg,ι|ύZ@.kSrS9kc! q%.@0`k)4G.A\ ?g|n+ 5id-CCF8qkHeGJ ښr^BU_;B j4sc XMXr|TgG2"EiD %Ғ0K"L)lƒQj|*Eb.bJU)(]9QqDa<@y*5ShB!*+PJOtf2cOcg-a̚MTKoEw[KXtϗܲ{>lfǿJz``ccm'ͭ6 [J&a Gq!(.PVE"F/M6Lf2LdRq#ƕ = [{߯ow):DvJ eP-ye1KEBӈo#!"s oW0Jv2j@#SKrwU霨Y%xD%Y?~ȰU&#dhq2Sy :N5Af bHcɮV/tPyكșpEZ#j Yܷ_Z M,|>O>~^ej;AT^CV}pwk{ct@> "R|h) :'jc >ҙESA,Z:^o е&Vns:$ wbmrGA6e3:Jf4M*R_Q>7oBE^oin_iܾ9œ2AB3vetv'.p " 080tPNEJG~FgPW.$&yjs'N˟\W&wbp"Q#JrkRỏ25}rattŝ;7 pDჽzC.L +MY2hzKɌi7pjCޤ +E ArʲzJAGW.m΄n뭬ן:? |o8Aa :/:t^䪔v9Q@5u2t'C.fΥ$Q*`II tYPi6躚) ;!oim=t&03;g,ўW R*?۳bAdXۿ=9%DT\[K[BH\J7b(|{{ 'G'7 0Mޭ*wB5(Á.'J*ZЮ\mM˷@{z@[&Tsm ] :K R *֜ !\ 7;d_0΀q^'H^,}”܄Ԯ`t&wrJb0`<Li|NE3 No)\2LA9Mk*b?|n0 `tqPŭf|Ȱz"0}-L59OKGt &^ڰ|J̶|yMyS@W<[X@[A$#mF2+S; AOm͟ݞ,x+5dtCSܾ XǷe'eVf|]WtS0nr˳AgM/`c)B, @4/j( gZwn#tPt+̴B)-U2 r0"3#,͈1+ DuBByY_WZؔl_H'g#]%S]-- uE;[]C@c,@ȅ7|eZtZcеwt0DUMc7fqBf8`t2h[ {@ |L $,hNF7z] T\)5'-2A53  [@@D +(4t{If` rL0Okݜ`ZsJ-бNEȫϟZ ǭSg+`fMI 46#-?D̷үI _^or 3R/Tlfhc`olajgho/Q{~Ҕ’ìOo? t$Љ|9 |`mߢV' |!0{@R3@y\X0t((Aj2@9|^)V `(oY &5O*s3t@mP:+Xۣz*@6T:o20/փSA tOK 蚿|p>u51Xl͙Tʣ8nVAff'ܜJ"PO_UO_4!4+mFU%WΙQnUeckdoacd}) &]Xpz#>8=[k'ւ @`N(- f,r\Mցu՝Cf+A;;Aw I/$Q]ʲk*@G_fzW?6oBmVh">@$ l#;XVY@'Ղ.\Ĩz |\I+8R)iM 70y4{RUw%0(tu1ҔwO ͎ lHg]}Guo(1p3tt031HOy2 -;^fV[!I`AZ?;wU@>RP^U[8FuE\P=W .KAno]^8X)c7tX< #nz-`W!/%Xnf|`;>*2 eo1В4à@It!0Ԃh=7| p,?Y0 t'`= T,l_T8ttהzЍ\i+МROz{fQmz}UK#͜i%Q>3,h;jӯm~nAޮ7o"X‘ l0!XeS@ށγ]|T|O6?y/ N; AWN([[c؁n7VtCСOSS &4dUeoL̩ݠO:nU>sU`gTe/|WJ=S Bk*tAm΢iV[  Y@ԂPފU1БgvgAYq/%2 mm UlFMM5M;}j|ڦkg_0PKGj@a7Q8#.)ƱjQWTAU#`0EI:FL  &tj_*8 |zs:,v-`u>:tJ`&:>AMՅ;W' ̯ Tՠ'A& 80 ӛ\<Ѱx;dvŊyz+@>uW]ShB5 'V.ә?d^wBIW~0Ȱ...02R\۴<2cfIls}׼;nl{ryGG/-\ol29(SA3[#F)W>",oV̋9{aW:9 @N] |&P5舵\йX/_Yᠻ4& &؂)Q[jۨӾATN:ٛhC-|p&U 0t( Ѕ?b &NSa٬ݕ{fuN\?lV{%8Fw;ʅ{tO6s̮L:=YDF!(yzXmj+ΊW./# [.rdQRw_>= _pyJ蕩i1+gU0YeSkAWSV y-5|6,5/+R @ށ/+a N(U9j3'U80O( J @vNU2e; ?xʽ zzЭd:7PXN-ޚ;.g2 v]:Q9h:Qp]+g4s~W(zGn/4LnΌ?"?hO>=}cjqBSҤ-݅[fe߁;>|I}v8Ҁk.M29(%λi唢1R` v+<4:yr-Z{uf?Qs6|Y9IUЋ:  my_7m5y兠>F +EA|en]֙U_ tOxJ)7M LCk||W:80sA'<׮>u斥ܑy f~߷+lk_1̭˕:AWNk]:96sݡ/O') /;''asM9W7:iԲM=@K]16*/ޕknʼn'f&,j/7⤠KSR kN]/:M(*[O|yĪ{L0ea7t]74؋5_{A%s&^#Ol8{;˗Y;mӀ ,6@mz#)#l[`J`|N[Y[ujn?~ܢkؼd20|zV`Z͋5sL]_=dVcbEIo/o#>򀵠nfB̢ɞV] ޳By?zɓ>}Rf>s[33; K'K+WkkW`D::塯 Q˓.N pY[81tULh(0Ӏu? 'WĵACV]3n>tg!1ҳl]<lg!z־eQ8hhJ0@OEa? p̕IaWᣗO6Z19XV1@TMj޵widEEk77 oXW1zAMv94oj`;Ǯn:a1jl_9|n{Y_xr]E07钴K?=8IdZi+ٵv깡*3'Ƹ^~珟=y㊩ عY|n,@a§]x~bHt}~` tt]0qF`k˷гbOҼ˞yޱdfqAQ ҼK3/[o=wIkfpR{7_=})u{@Sby4SS| :p/m߽ԮL`9*6M=(?2v] kgC wm|?oNZ=ȕ3svS5g%'c͂>`wˁ_Q׭[ggldda|w.o_?=ʥ7)`y>BNNXxZZ8蘚;9x3=@أ9&\Ptb:PtG,6Օ{ `I s-ɉ?ia\EIл-R᠛C;~^z~lyV_4s|A3]`BIF܌!e?\>Qieyߺu3m}΍Ғ ++'#} m] %%-=+Ѝ[HLll]\B,@أɑ& + |IO;jzVL}m0Aci%>BmtYky Mkfggu䂯v- |sI>h`BhTߠ \! 1ȲHlyhR@ OsUzA6N,|)e$M/ L'ٮlnGV`\m+Q1ln{<`urT/`E8pF!\fWM C]MuCK99_>xps+z᥯oajbklhmjhh`ahdmkmkcb,?!!)1ޝ@{>:<4k?94:ܩraSf{W`U;xќE|6hT%LKjEEYJ.V.]fs*%f# 4R`V7Rh ԐIO(Rfн蠞 X;t>j{P+<;Xhݿl( ӊCACų[څU{ OZ׺l,Z ,oOpz Dw:uVSMOWT_BECWN^뗷߻}]j:ROI_>tm}Sꥠf&_rczhxV|_T٠E>;  ! eo4\Ki̚yA#5X&# 4S6-,Me* VNJ=C !Kсu^gYM3J׈./ ʑ3Kg5l. Q,+U> y([na_)u&5%sNsy$xWķػ߾.흨oo$u5 u,^fc=3';?[[/#c{al& T'@G=K}&U/E2&Z>4}1 xlZ3/}ܬh,P:|1Zݫosu^w(;v/k]>yD`ǿe,ϊ8~+.)61QWSWVUVQU101w7627r ?wvil(kc뭡mN.qqwq hlkce  У'&WHb`1xJcА?:tdlΔ&r[aRG(RK lB.Nj6s0^S-.`~`UZG$_ڲ++tGz?J`F,{V6Y w&~~>ȝSkIv`7rfƾ K5` ,fn\prPS9tӱHY;y餺œMoZ6GCZug[~fnnk?m-EeM%U]` |535Fvvv~vzz6~:V-3ʂm< (oލ) JN &òm3Zr'5Ъ2@bU&h4U imvk X`f(NkTpK1bNlFncS2;AW[ڷ{m{+!w1,B+fv`jM̺쉠ustfo u Ѓw> Xusno93n{+ܿa󲩫m;t4Ѳ|JI'4-ڱf)W} lo͉k*203yڦ JZF: jZ:X41shrqqӷ64547tv!LܬМx!7V*Agv&|e;Bm[n٩Kt%/YNi{zt6j;E֦O>0&Vt.p<ʶRp4yztZ} 7Z9bv -3c“޿_;/woΚkb.}xܼtk瀽7m8g5 Ml]6eٴO0{2/ysW 0>ttMHIU[YU TL^ClfںfzZf&s0w6Dgboemabb]'k`|0]@qZ7 (<{!+l\smZXXw)4]5}Â-^]f_Q XC>Wmtyݧ U)\ s*♩k礂&rqל ~;;sNF-0||X6.yj߼KY GYMuz:{˒ޗh<|do7,n\4yיFIռL߼ԍ Ǯ6Gg4hZsdQn93z~5 kMh^:sլ+{q1V&F&bT]@YY[UMr **:RCFSsfZK g?33g] k[_%eSsg`t;l[4= ۳<.O?u3"#c\^N૛}ńճ&V-8iL-E37.<|x Uj>|ؔ53}%~X3߿w}@`Od0kCwu)wBI `^,Z{>~4޳O_?{mބ/Lm> h]Nn[:|FS37/ch%37߽b9˷Z-٫l?kamS_<Ѷrh ;oZ6yvcM C# =3 '54 tMMutL4 44 tUT̋**Z&NZ&zZږZf0 KЉ^[Э< m|-,= R? `l:{= 2@GaGIAG\^yeFtpKӲIa.hhV( ă-ڱp2h!ဍL`HǵM@"'߿˧pZ=V8dv[ՂU35{/2y˴Ӻ7\e|06S467wrt񌱲fA{{e`4(X;FNFF(f8`B[TQ544v65g|,\CB`|#w.H= m}}FHYfEV/͛R3*8gB;;bΕ Fޓ>}ܼXޑ.\ k`g t6B{m]w `gt"{!kv(5%hƄr`XW/m M*\ Y[;9@fJddEьF`gF$(fL-^W< 2] nZ6cryꦬ574/.K?g0 jOsM` ̋j挆1lR:Ė|FFv60Ut >&oSSg=`XY+Essj6>N(v'`C`. @Qxj3ʜύ )(̩jAwf`-^[\9h*0b@n$@L`+?5<V <`XgO ؅.,v` r{_ y +Phiq:`^̟TKA&VvL_D9 4_- `1#n*(rIdby8R %[g0K:KM(^?7;dh^E mkx88C96<Ա3AzM=-3cS+%e}`#EIAKWt2&O;?`Y Y3PVnV6~#(ũYB“[Y`pwiAv : 6@Vz)Z0J=μPo4 jt+mY3K~*x  |rh_u0w&{YIi \`'8F4 .-) '.y̙T* LlK{u!PcF_IFtG\hԻ٠IXZW04 ڢV<XEg `{~~/ڛa^YZf&F&斎Fvy16׵Ѳ36KWs312օ.\{Xx[8;g04_,F.:j7ۋ,S0yU6\E%0s~b(ob)h5xh<2+gܢ<^Pf@q l$dv%dFP{A])y xτL( X IY+ZmЬ,)XVelW06b֩A׀VM`D-_oCv`nԞY4wV+Jgwkk.O:3ܜ7`? x5ղVrODxhXcI-Q4um]{NhFtt T; G7iZdeEdNPX@`hTp6N*v@-0" zB0̮œJPwwK`` 4%@5ɝyI9\$`6KF!F,ɝP,`Ae٠E ^0NfG`lrdhMM솂i5ٓ؅hz`G&+hY:/@܅3guV hf[݉-t7:%kB~>=+ ϟdj ajj:"4̀u5aWB66&"jj`hdH`[4 "p t@aHO2+?ػ ݼ-WO+@WYMϛރ/!+C o5X#%VFOq0ā: #704jsywQBh54] .N]uǷ=@t5zxt@R;s%(/?9mrSg5O+V62vAh* ZY3s{jf62 ÖF?'+rywb-44t4L m @W5;{m=?K MsE%]}C+c'c3'3s7`!5) X8: = lsnJ s,v,ڇ3ڒR _йؚmc)\Rڠ n@Neߪt ;0R 4? ''(z Ԟ Cc:rzJ@k;AqJL vZ@N]ˀV`=]ڝ444\_i;yꃛ@3e߾{u @kw>d?*:!T;vT뭚7]nT`D,ensMA}sřSg\͌Hyy mШ&B C`/4u偹,]6jrGnE`FOb[fRG-KWM`^4kB`_3'?t穽&~%f*OFyoqEsBٳ/WN֠7?rdޔ?5,9qWc^=}EٜOs-n\*fyuBlvG.`D4~֜٩7f}Wy-D<(k X8B`DpƙH%eohc`F;@ ]7䄐 Kըt. 0PMAA{&7@v:,( #V~¶wIkfdZeia40vA.Lݧܻ.4W]?34Y_3؉,Zwp}끉)hKvB@+hA}P :$,reʿͨl)5\i1-o _8/xɷOFalqes:M-^=;g$?_S5lru ձ޴a0 BK=};`355u11sŖ9᪤gll[..~=hwBs[ӝxoy݅NųZ&׃*BtESA55mB6hCq `?Q%޸7vv's@5e 3V̍ gMKK+q7/mKЦp?pՇ._}kgo93 4!U,36M.T^>1؏6m*9p<&5y+=`PעhivFo_oܻ-޳j^7h6 'm)0 ]ξ:3ce}uo\lI;VU(*iKQ3m&.Fhjbm E`m gidlm;9GhPrT0@GuSpc~.&^Q |ж e3[߾ \5[v,РW_7<^\8[eaOr &V0hvO=s|Z`u-ԮO/߻8=rF㧯Лn= lI/v`c5:Z?rǯp@}į߿]{p{9mmh-sP.`[xf(n-Zuw>rr#S2=pzc6?/; o9?'5 77_g@SSg}`WAZZfZzV6.9h!-`D^@)EemM ];`5qusq!= \ط#l_IOVغlɝR0 XNkx*P{@G'T;dL,pj 0ۥ=p.f{3h:;n8 sAei_^ ІJrQۖ# G3zJZ:[79qt:h( 0-W+WN_j`‚)?-9 Z]2 X)زrhhLi~`otVG%{bTF\A\Q,HL],]4M54M_lPНwnK}͝hgb ѻ:Y:;9;NGO!z>vxSsĉ|8PKzQNK`a[]>nɮySja M:ʙ- {|)4LS\*l` }vNx@Bxwp˨r5zJg~J`}XqZMi0*7K@dρm4VyT`(,жlJl`xh}0Lo7k̚T?bAѻ'Cve[o:_SnV^fC]ML4u̬ 4_fTF]@Qxk+3"vuD]dEqټ\,S"@wvMkt5s^{<)]"lZOwIn/T[=drǮFd ͟<  4R> 4 u`樛vٵ,ڱyQ/ׂ72;Ž(Pq>hJ*-VɈF,(VTY2 뀱ݫ)O*,Hl&C&AjKь6 3XV7يU~k61q6SV3B` /41uE3 7c`3UAQKYU4So3`w0`AnglzyE6tB N)'{}uEnzTY, 2{æu/W~zk~-+]]PUP]HC2Sh -\}<MN-]o=`'z9SZ /z=B';nр:֓?i,`-޹2L  #ɠan F|kfBkV\Khp+/oJ-PQmr%3W3X6TA$ `Spj-x(f`W22e1Wfh֢rnw 0€u! =R1]'/[vܙ, k׃"-4U T t̀Qڵpu 6gAMK5uCy#c'KK/P,}{8Ե B'W <1%s-􁞄Ó>Fpj] p|z]>GQje{>:qlܶ5`ɻO͟\͛T=u×NspW<`Rւ 0dc+(XQS;Ab[2b3Z{AR;[J |IJ"Ɇ}`2h6H3mzQm&03ti/:  XJܰlrٟ. ~8/Xp߮}!Z&ں:zF6> h:X(()i83]+h;x @G-m[ߚ{sn^‰y几 ,BuCٌY_NopüI5?~fy[z sJ9,|$`D`Vƹ٥3[Sj%0A#a*+ 'g$h*``Jm`3$ 8-r+յ[șTxFx(Scl"0ViSꀱU:x:G_[FVN!Q lT,l3" ) 5 'ޙj}#>S}D?hk/ms5 C`Amoehhjجl g`Xec,أutps Ɵ+$z^]] O6v)̂S A'OoY13 :)mU&~YxUYyv,BAM|[ 9ܝL;s@'d73ȑ`q:$h|:h"4W r/)v0fzSf{{3ZKg͠@y}e͠s:NE!ڒ8j^)6ly4ɦA ~*Bc;}В{g`MXYI[$ Zh[ZZvB p}Dߜ`ng?6Q?`RM&`>,t~]Rh>4^8ygUV&4C-@AGZUsz@'@vz#,J=lފt>d)[ԜҖQ] ]Y͖S >|h,Xp! *AJ@sL13.Zf/PvS6 )ԐVĊe3e;h70.A5̶g:F$0fu;f*Y@Y)u +&VZS/M{2mwks`ȅA~J&rRCLWRؗw rihd/' ̛:FffV^(tsuq 98y?jFAD=ᗦޜk`ں] :ݥn@WI0t䧵夵妴ugvعy1 Yuɍ 8(,^̗i@7N `) 4.W`71!cK@@ZT۱I@뺋4`Ot0[M(J17SuT( .TA 6'Y: |VPdOk-_PW9'ʔw2FY5@Qoi Zohgdll֨Y[XX++k,+L՘*}EAܦ≹@vw^:@G-U&yi=xqV䆬2Б.RY8lrm)L]*QՑ̘ڴ؆tЭ--Yy%(+ȒN`祶fHWkNJ{N&(fu僎 1к ]ƒ+gb%vo&27UE<2"`,KTSKVVhR4 .ճZZMh^ lf: fnw1hvX փS!VСwܔ2l/oа4SSk5u}==5Mm}K}s`Ajldnjgک?3sW}+%qMM,zKjе"*RmE)TfOz-ihnɦdw33;;'E /~RzxwEC9뭾J_kv*]rNGmLukc\IؾǮCTw&" - i48 }3`2-}n~@`AD;񦡛t,Bc6\ک~&O%I:#p m|dTX9<@L$gZq2.N&9(O%{'ilN0"DA %mĄx&.Izmo $h-i" ,g"okDq %2rФC>˭-efĖ=ǃ{S -80K^ѠZR-V|d]R㋒K Moj oG\hZS){UHυ@)UZ!!rc!5zN t+Em>]4n=<"`|FŤ 7F-i"FaB')$m9'4qϩ1۟Kko#u]eY[X9ֻ程_K;H5E33~PnGX.d< *9@C!cVOkkI=-2 DeHirʹ彨 3K\97]E=c?89_|el=~So{{y, QL_4!_*Oݝf#i\ }>[:\FEzټiQxMƨK¨@g`ĊZ 4^o+7w-a}v1^;_KA{s3KhA i&aۘt=3vC HB̡:Y"tc¢"y2jl&EPnMDv-etOşm>ce\!iY@hSSp+u2ɯJ:b KL}- IYYy Hkʚ6YBHb侀O.'> +ĖȰ#0HWc&F&W{8O{bvhald,9uA1gdX R|% LMl-l-Ac|lA&ZY{UZ߿h@alvnOg:ͽ>\h;=v~nf.&z6z6X6N@lY8Zf-Ai ʋ>OA (<ҟvqOg> ==x+V߿.z֦Ʀ(V_g`' `m5;A`5Y!zZX [3+Kk[= OL[c9v~޿w/}sۮy`'LTjwAWJUPYMOI@^IGQIGE@QA[MXEHU]_C\\C\S\S\G&殖iB/ +7Kk`t{%|ȅ}{kVe|ro~7`Y׏?A0070703 K p+ g r0r?p)훫[5mSM`PXYEOIUsZƺzc``ʲ^0́Xx#]C pz|n'5o?Xk}`5Wn7^h|wz܏6 ⳩e[.zvij "3#bC\ݢ|ýn7aË,c/o~pϬh>kgW;׎>4{[PS*o69vMSW_]U{s[onlƎW8wLڦK/K87bO9;%XOةS~:6Pde{ '}8PBR]DCUՍ4t̍M U31\-]l}0 6Y;VVg_@m,4or8gOC%6mD+MZ)hMD@5M}s$i [+S8^r\xR%ʵT/9\}BpJzgOכm1=b~Lhαj]uA ji(Q;Z*wPjt}y{wgJ-S=\rLp: T(*8TqT@ց"ս{ԏT)9Z@pIZ{N7Y밻0bn{/OvTfzq^s=Η:^tB3Ͷ/tڞmaT҄F[\K\MDMHIEOEHM ,Ԑm/N4BO`[[X{ɥKzUe*.U@{k Ld!uL ]}msumceU`Եm?ݍ@[,iej-KP_f@)S rkC \ʦ/ނ&QX wL9Z:f0o[{;Y8Ygh@%'h!h߅+(;>z8|hO;?+_ȹ*]`n3sA;.Aj e Y/^օѩl[S <nt\.΁9hcU AY[:j>Ww A-`SFuspvz.JHha^?r(27`=`$.56@G[YB-]3=+3H-=B/`jm ,8(rrV= o/lͅDwL RW_yo L`Q#JOZ/63s3h@;@C0h>!fiJ_s@Qr{uh.$ ܻ|Oe{>Xؘ:x֎PR_JSt̾%j|15s 1 N +0)8RA] (\nȴ|4_<9!D`5挞+ 503m]kL5u@FA X_zBؑAtZi = '6N֡p`KҶ͙7oZـ& mM]}K`[v'55J KpU d0̭\\CF]Xh5Ǡ`4X!Ԟ߾}˽fLkj[CPw]'3K fc ^oabmfmab栦]>*[smFs!Q95Nr{ Hq_~w]WB[4mld88Y[ݽ5QfۮN3 M# l⮼+_C.8XRdfܐޝ54~CGƮ]?BnoUizziS{7gQbS<sb֤m_uR+.,_h"7εn:=Gac%|$%?>ۼ=?--tUcIE[QmZ1~[6O RQxt %!`bbD酔 tOȵ9gTY{Fپ%]J̤^n@|(E* EOJĐ߿~Y%t&N͋]{fYU;f]>vB«'];)TGF (rbWQ *DMNz <2,Zo^95%~w=>#ujAD?͑UZ"d;nX8d:*]8IZnyoXK 3ؖo͊XRsZ95fWVNP;@DŭDy7*GKa ~"/RUPg+7?cdx _4/d7Ɣթ;^gzŖ ەgU-ͷ饜iVe%"M. ̤ ,,eg'ZGi>VIn&V遫2L3zԲMYJnk[d(O=+2ӓič CŶ)FKvN);<]9B9Tc Zps)5˷QZD WO-prNp1S+U*iCWW](''BD]޾$iD0J+,3=~{m+"\,4Tܙ6euc],303չq&k:Wͨjpwg#ܼu+SNDjZyΘx񽓫}TLdH<0=s#׶dm._3owgVA! @Q%sJ 0Z]Zk^y$+c$MxTJOGU[]QSKUCK]@_QEA^^^EYeI]ʺe[&VybvU@X @ /^ߜ([o/WEmw"=Tm An]ĥÇ+/֔/9K*7vn3l2K;{GG{[Ow??ÄD r%mSDMT"<|xo„Mi+S7T|za}vLnjB[{1RbIP?ož ?+7SW|UW&AjhlMssw11,s64trT Đe?q 0y%`id jk[E$&zxژ"~AK}iDYMQSW]@S_STH@[]GTv.iQ~vmUl6U7mc6IPQzY%!` . <@UuѯOѬf1wNk'3 Ԥtan6A'㵲SThA_\&eS^h`qn5fў[r2 2pdOB2*DB k*C51K"Ϫe- 똫1PeUFૌЮLZ6c!uQw{x/qZ|P$HG| S(mжH^V'*/IԆ+⾘ꄯ 02_ t+Ez&jo1>!n=샨 6ԙY7{s : 2ķu7]V]/lxgq\\W 2+`+00 Q1"q5*ߟ';(w1(ޏ+N<,x4˫Qet/<8HYbdp_?.m0ݷ|vn6xz#-4A (TqƎ4^Cg@jcDZ4ISq뺨/C vC)/@eEd Bѿ9Ҭݫn2[̰rpw}0Ɨ6;jVTΟ@̅B++ ߧԨ5r.ƒ۠{Y/7jfv*A5ʭS^v wjiFtRpSRIJZ"/9C[>CL2?_³c7_V_1+w/RQBG|ZlUبQlW&R<:|>nhPwm*@ki2tԽP )FX 6Npg[@̺R)11%M(GZBI[",~ݖ Gf<} [\~L}F7̆ 07qAPq 2(O o(xJyTjzZ9 &yW"-Ft7hmpi JoMvaWIH z![/& -amv$G# ]x#)(̺ţnEPgG96XJ@1!*kJ{C('R:j4Zu4 =ҵNYԸhڗ,A0.HWK̯^椛 n}Y|jq6N[^^x8^L$xra҃˩ձXl,vm||;S T̃%`\v',(U(JJD,@(c߯8v i:'v+Pn`X VY#>{fYg<{ݞpㅾ|}^vOR:>_+O*WL C4:q<B>8!CBXUm4Vrq_C(˾J:Z /uS iOBl6B4Hǒz9LZPEmQ~}1 Ɋ^Tl TXgy5%F& THk2k@Q QlۗPT K-2 PX8t9(푧R:l@*ACi**Xh4ByޒFj^k8EbjQ(ih8i8NG K>őF2l! iC0K`O\u]%30$Kbкy`6*+w1qҒ/OH) @(mU`k_I\Tx!hTeF# j1O E#І|}їs>81t9(zϣ@8549=nxl&Fɑ\}}?X;48?+cc"Db^P&BjLkQ#\+ ^Ȁv`Lܙ>@Wu=_Db|afs lw{/ϧdZ¼fwyL+]FHuf$uw=Z`˘cov^Y-8 WW&~/ϷKKqſI-B02.j]i:2qfX5h|D3ĘHظ`k]hHu sn{0s$?5\zo}}a9/CYY ~kͨ.ƌmez-#6AGx ZD>pC F9w17m0C)bv& rX,~#Pe#<I\Ya_imHhJ[kp8:Ql$ zc"Ckz M5:4&%bE # k|,M\C1!pKݰePS3@%]zf} !L0I$aA??c_s\ ^+v01`֘nϛͫ BHy}۫vǧ/w6zJeV PrcNг$ j{…h2cO58sbOVұfIw, oXQ 'D83qRKZg$P9ėՊqJ1FIqݰ JLܖ>pF0ץxJ" ha ;tޥ*)7a-o6BUdlwV''o,a 0/;JChal65A䨁 ~X"Ԅ!^J6S$^IuuuPZsn֛II^}uS^\Ǚ `M ^dpwuuezaGNEÁ:*V +3*so@tWGoINPd/Ij- @K9 >hSX@,qj+n|41-7<-~ =Z-jNtCثpL.J2AX*rse_ֲ. zcYkPYU,"ὀa%iA\NjMTf6fbXw暽%[z]IRa1:FQ=/ /}KvR~ ñx7uY:z;~7vP5';J_y7 er>7#KP_<*wO]xm}|[)~ܰvwo&#wDuy?X8Y 0dЍ3p9ΑHs#Ƕv @/̊"DQ N R Tw{w˶<.@x~ nWFa۰[EzqY*p- Pp8`xTlQG@K= ,Iq51 ,TbѢ$XUXv"C汕!9*T4fĉH@Z@K68OJB 0b_D{ʅpXlL.a7۹@'%ӽ3e.9z] Ki&mhfrQ{| a?Ì 'cӅn𣙜,ܴEҴ@ &A8? 3Ct^*hÆ٣Ltb1=:ER1ӗ@p\zd!=2!d`K0, bϽ&{kߴۻ-'PPQג8jerh#2+ZtuȖ]ިKIyw^wRT(lU[εK;[; G'zq'VTGlsDFnmmZe CHHWM6LZ\)iڴч;{>>wyo xi 3pT5G9Ϫ@3K[Qn#GSdS&w߿[e7FjwodCAkku~&q݌4dvΦ5 1||\g45ڎ&)k]jN(c <SQ|zg4'iY".ʬm@;?]Ƥ hwӟWҘ).~M}Io*>?RlS|2s1itu#gr~ЋbdRMDƐ}%}?ޟ'柾{ (v?jgvv?ptoUߎ B@nk= KK Хpm\scz8Sca#IJR;A"*I~¥-,s 0o䃖z !yqJsozzΕnpƅ7ܼ{2Ps!hx:Q^o^y;V2 Jޛgw۾Oݫng'P^53Aeԃ}%y͋ K&VA 4f<Ш xva<p.R6Ϳ:'۲+2Oz4ioٍ$CRgutuU55 zzjR\#\<*"ݺlNmuv>{ӧϞ#1.VME,,--mlsB#M%_؇*xX]sw=X^Z[,ȓj ȩ!UKvCI(1v9UXN:im[qرh4BVϰP?d0  [)^)v4 X}< ]inc~5:W]>D@CX5Y2dLW'&'^T; [AI5(ϳXYdu\~Ik=2(OeT@4Ub9t66t` P޹\{!:J`oHY;@K_XyH?s#jFrt7o>4'위͆˫(-o7w7O}lf5Lܬ@ʓ%^}9s-Ύ:CX:݋BF (jUmEoU K)BH 3Rll,>CkfUFjQrdr5,;OyRޖ4nY`"($x/džd~w5:FzFwtRdxFBL'.?>Mz'oy\,޶5TW2ȏaaQ]<^aD!J"_ăC}CBa&Rt,1-Hl{ԐKS/Ly8:.9z`s I M )4w 4p|徍%[@Gl{|l-ڹ4[ֿroN\=s囏L0/rU:hzhCmwaf_IzOQ*g؞]ڞa`{q 9}3_}yMEg-[sEӂiKYETr:`;}|1C˧'.ˆ6q{Jv:e92~R`cXOTEEt92e˱]y@Z<^ZzO7#)NrFoI΄rҢIkfM]7wU;n]PX92gR%dPMi zZpԺ-K&.ڽvˉ=-+\: X-蝱y}Yۺt",lVeY [hhkkhꙘhkڽyz_nܸz w^Tٟ=!JǺT99U ==]cSKo_߈h#C3C}K`Y]Á:l+ t307kɄӐ I*k8ޜkr./ f2 (\AZ[n*cìh힝<=g@xʋOѫf=wƵ[^#=5YYzF ,m/!lNHID6y#ql%ݰ&GϦߙ :ډav>*[+;p6:\DZ;qg\0LlܒےSLif8n_X՛S"H~ZB [-R\*QVRR,mo~*|\ ^y0W"(JMUi%bTɔ0@ mjj9qR"S@}4}Cكo*_{Z@*jʐ֨zժ+J{^{VuYFqc ^2EcԒPV v`43?byNאlGQ6S;DYDE(F6dE]tS]F9s<~<?6 Of^)9TΏzhUbs`Q8/0_" 'hkWc-r{3!oc "{y|9&agW\ńҒו{R(aM%S8$ +bL!0p+s\Ұ}\1-,~ן45H4C $z[̕lP]iRJζp5t,Rơt"xcW >: N8yZ1H Kco>+]쫕Pd`09%E`q1XXS(R/c.ʭǁ²SJj h%3[Ɇ -%ױt oA 'Eyd+)A:ӭTQ*=(c޼!jyfz{魼4f_n}fgTz(B0FhT2ڨӟ6 F;_wGo,^qmg4Z'Lyj>s``9 jz1MD>:#.ZMk(:PF`mnܹ3uѐ`bkb2txσ?`LnKff;stx9XhWǿ7''ǽ\jnyaaAtce33ie/2 ;t+1Z4 6 S` #zAYQ=OD >52c~1JGQ%"|JDoJL Pmsi^\\jh5ۮn>{|htwWrOS<~8`B7dp'8fᝧܿ~8<篺f\XmE(xܓ "ҠW)]J/1fnWJ58 )ņ0uyr`>\5 ڜS[ 騖l͔. ADE j]y/]11<܄y,ХtRZURI8L Pۛj\̽ mfc%۪MFwgj7sҟ/}69yylh>txRuV֦Ӄ4j(Z]294:d{mZLvI:fBjZݨӌtZ`r9:ɣgdhT(O&N < cQ=5~_`P>}xHPruIa?vtyt~3}0lX3[;;9cpZEDt]u1 bM.b0F]~7={ϋ+p ^֮__\'ch"dOmJIf`HErNвNAdt"u0Ï41x(@1 F"mk~GA Czn]qD,P!ySj>_O"j J@ҫx%涊KۏVfs}u~|𤒮`.~ԇn~9h fGG>[N7VǷ2kcZeX^acu]"$?u7?퍍ҴLFD&uzjL,csv!j;/v׉b tY{>lB].IZ{,^ t/i6RJd^xD!'$"A.2"K/-ݘiQm 0/CcpxnFehE Q cb1(09dI1htX0[l&LAdʝ4m&k<,FBy*IR$nL ,]9&ȭ8"w-IrZlNn'*N8FlIvp0a;;t7 DI0,k5sxEqь0-6LF$C[i- -fŦ, @OaXem;Eڡ RX$HLY 塭eRCW*а5 %Dhą'FHD&>*$;$>drν|;7}Fž2 ޅ+^ʷNW)jfvX\NcM}N&d`:9CAz̑[:\|qaC".P{FRց ͎zoLZѣ(E *PZn]aT9Z_ =RF{]T;h-@iOvhE3=-wb9UO ~%ϨwǷīb0\/Ȥ0*e͍_R0n}ijUx@f;p3&XDdŒ}V΢lވ%+N.߿뿻q7]3=okZ\ ͯcfGS@cA'~L&>}L=g=EmQ_k׉0쌇!u;nDJxjzms tJ0iƝgCF%IfI'"yB0i)\PZZFVz + X@G *y|iZQ%T ]^qX-,V*pE|R@*"*PBP$.JY$J~V>dpEP29\qJ O@B@J%ErT<Tb,b@%,=Vk @$aOPA@j沶ZtB1-EMrRH $HKs2fFit~(Sժi~>mv"|9ŮO:  u±"_uzّ9{br;웡-ct+m!h;Ӓ]6;Fjl*2&];mDT w HCp}hv@{R(%OMU*@5;,]M£l>' y-j|kv3K;-_{pK?Xn>n>Y\ )׺ >@f+Ty,;g@se_m3/Bar7=Bw}->ǫ|qnxaky`%duy<t<^x74?^]?q>苩=\ @Q\hș6L{Mޑ{KAnU_ϻ7\Wk]彶>G^Z:Z-bomݚ)L)XHeD$IjF+"VFm2QQâHa,A SeĤ[L*u0hE2SxH')F`)hb0N[ʕdejMR9MCǁ2E nRؠ^DKt*MLcT*] j`zgbR&Y`Q$C]rV*ivr>-0??9ן0'p9 MȜfJ /9j"YȐP0,n*Kgml ,Kf-״zƋW#oH7kf^Zֽ9k;ymIVH$/A両׉:6Ϳ`5jӦ+hAGNվ"4ElP!>,-.BU{]B$TdQ FKy!ʁWQ eau9lGf' z4dH%M~|?K+jjCGQn>2R[(S=SS̰wCѥ`8T[׍]*R_7?LG W@ѸbG{eN;3t6y%p ,ľ+s}SCZw^s}jW5 (kt.6sT@cnc] pqy3<<;yl<8AmC@sLZXVESδO.7vNVdJϕ(:nzVotY]vӀn{2j%@)"!8qL,XKIb 9\`sVH1yt:8ZBOc]oL`00Q"%$qDTp11#If pW'1.pT rAJIH^C^jZv*yC" PAۀy2%`|L,p3WYewdWn^JeCI  ׹4q?I!eݎT(!D JeɖNwflsm#&a^JP qMtaYj$% 2?}8g9sy <9 y;U/2B +谵Ai"–(-˻b4u;k}V0-5I7Ds7~w dӂDpFGÃ??][*+ wta!I,Yplq}DlRi{?[͕/KiP"!<]l]gZOthc ΀%`Si\z٦;-']8Q܊mlP[ >4* "kxh=&ڱW0A NѮ~s&ڠG0Lds}+׾y7_㪃·_0\o߾Y_%rIj(|#tw?fpiYg僢6L:Gs+K:b4Fm ;n4vUM,R3Zp$&fuISDvc_xA"S(P'K%i$J BwP@A`;@JC iIB}6Y=;MAM &Iಲxɩ F)ehF%TP-C  @D(aH|&bX@,dҋL!v"Ԭ lL/c @]F%OJXSTYL`#{%99%Y@@y "C+pIl>bqV?ڗ&8y֍1(3 {a0utH]| Tt#HoˈB!RDL꛾߳qv>sa“㹡*joAQ&ۉלBiuEvWO&@3 )!f! PlGg'k4a+/a?O0*xO¿46'T7QwlloQM'/-{4G`0GG;{?(_ y3V-6la;DQAOW۫~`+_%GNvBˋ6G-P.PzDa%NWHG|"x~CqAK\ZLUraL)vl[ `OD3{~Ѝ: ,VW.WG4Ox,֣C6¹^maA/gأ;B~SQˏ zP sf``7Y}7z}up~ F f,f:F ,eԚL 42 (W蕄N)AI3LBL(s2 g5VFNe2;]M4kU*5CsZt$X)ڙI;fvlYH}&z)ʡ5Mb`zl\xLA!:Ahv%8X90/be@ ʲ0ב:ez<7`k"Z tݗqfgm]%EA (ԙ4_Vwg][i}e[5M ͷ2B ꢄؠ袥nK2y 3W~`fMsCWrI׈b'1Ʒ5uIi6$hggؙ'OF\8>?BFO2zeG J4J b`"$zAu«8%%z>Åڸ su!̯IJt00?3[.ϗ~ɥQ63XikVb0:%Tz+O[ihhPJWꌕsiJϰłth2ZhۦWTT@Von\Ar,N+B;PdqQB2>ǰuX-(f5id}kݰZ $"t5] InP j{ _iNDE$DZsZoS7VM98y#A B k3mVJFk`h{`{\幞pcvg,ug/;M/Uw]K'N:.fbQ,?p1 |iYv|O"$|fj~7Lv |g;:{] ? LDui 2ټM9AneqCv/#QK_UlTS1oO\\*85R LFc(wfЏOE)HXC9wg Ǧ$v૗B\C89a@eW2NQ,peRV 1ωp-G1Q蓐&TZ wI>j ri!5$D/oBLN+LtX<$ ai3I'xfrO9s殩;h ZI!;'A HTfB hBޤًphDߦn8DwVhv֞Z7:,Km67mwZ#ѳ(t٣'2: qԈ܌vZ؀C;via{BbMzU,fLh2$Ti H%!9z؄(ErpHqcG#@xpOΦ78DTJJeB*7-jk1^L *(DRi* VHSO؃C`ɫO<͓8l$G$ܭCZp5w?U/hLysʙ'T.o,TLqh&[|ثw~;ͯ-x$pޣ 1r#IT(4 /ĎE {ۤtͻeFU8{ YZ.V1e+U`dD&hD9MOpzI%b pH<_0@E,T[(GP@jr~;\\ x ,8 9&e:G) 45Pg qRI]i^Tx~ttR^߾7_ٺ5Q~g19.Zk/׋v{&~P$,(&A1LJ5l0ZI)~3ẐC<"D`\X=xԻ/DEt awROhtf ^sƠ (R I!Wl62i8BF}nj$6c22fQ@J$) BP9>4Enj={kb"14q K @4 ?e"hpQ֭ZC"ԈFd Ceu0HLd5'x0^<*^G;[|4}{O? ͙yS~f?|9ݼS}j&'Ž' 6Ce)fVBe$#KeVyeܵ=1])(sLmQ`d aDzA%jLi @,5lzTrU5"Q5J%'<2[_(fEda4qimJ,&db"8IdP^e5r0{"VGJ2mEKU;Uo0mM})r`<e)dYR"*KU  \-2ߧpFC:z]_ww뽃bo6}~KcؕɨI+!NaI$faEĀR|uA[|&yȨ-owǶ5FTr4<-WR>V}3x bS+6bjz(n 4(nTau7DaNXט4&P#7SU+ӑjTtpP:&qrG CGKvZ&Ef'gq Zz?)D 'sƁ֦04(2 Sjh})"&m nM&FWlRW.J&,Hd2;qιk/]2;,}$]V<cIHyI B%DD-\A Ӑ`bR%Vy@4i@BL" T0L I#oSh%0s˚X 47SrmB7U/|(0Bs=} E̤2;jQL7 Mi*"1(lO[樖Cq!=lOg$0A?8یqMtˑzFJJi|{3G"Xf*'Na=j0= kzӭӽzox@^(04wZgu=qN|Sy90*f?X)rydE(KBnd|p3k8&ɰ,&l^7bLVi6^znMQy] *) QR0p*.͠jѤqg!@D'a*VLEoCX8cl00əɨr'$]~q+ZZڈ?($ D$H(nĠƄI܉HhcqjIXhEvenڅK.Dl]ohE9;߽ )N~|ڒh*S'bدf)yDwO(y?Uj;X&9؋>O|ytzdX׏} y+<~WƟPםVj"t흃.͇#Pm@ xi뽩ix 3DvpzQ<<7<^pW#<B"H)[ZnwoGή58 )ֲD.*j+jE+lzٰ[t:mWE]Dt]"A󞺏s9}~\fI_ΑwOۻl֕$mkˆeWQg Cw,dLqω4 9D c$+ Pl1(f׆x$3EE,dϙPmP$WTKJI"H"BLXޓPxZcS|T#jz $Дq TZZMu4r(cTW T 4KÅ=ϰ :(P4duy-cXZFzǰHFn/OOX7\rZ:UKK1pU4LO.$'A#<ș}ՇRSfpKK+1YfǥPƴLF̖ѵ(_HUjr15W/|wJG!uyط="|voWӱy> ұްy&SyKTVSAOo 7퀅5Dyțvӌg6XM&3f 9Q >.~` Q<,=Y4hOL _-gWT\ج\jYhaBl84OvJͤl]lnFfQ(bT8}}8ꋈyǿ7{KR˫sySquW җm`j*Nf[V@L ŗB&犍\g-dp1U2¢r2"'085:ı.ؙo10 G VR cIº2RxGP<rbc H1z&Y$߰'(0)V` |M1#50v|=,#[zn אp^9@yEpj< C!8&O_Ps`0Fʹ} ޴Q cyC`0]ɗʯI/7|~άm\ᒡbIiᳵHnZ^D!GijWQ7,$PN(hs*U*AdeoPVE0If ySNOx԰~V %|S/h`?Z.J[oyگ[VN'5ܧ9P;lDk(7 QAӃ 9a눱h7Si:u$Z=2CzVۤ4ݣzXRzXDΛ6Nb5#a oEѽÖLxa)ڗfD5oi*b*|4>)(x`gr Iݠc,@܂*}Z`)b2`,>t9Y5``Aܝ444CvN-mA neYP nfIijOrINNKnJl t8wNUVz 9@&׷dv@6"'tq {AٲdsfK'jfff!KK^ 00=i=!6{ᚃJ5eǯWA6srO}qy[O^?Ζh͋w=xW <~vф9OsG+E3ۛN]_<z+Vzsz~_P|n_ O0~65aq\^-x:dd£OzGyy[Vv*jJZ ʠ54:Y ܠh.x? jjDfV^v~Ξ=mcM=L%`&SUV20q4tj/ f-P9X99H& oΎ~..Az۷8 gTG έͽk"ŕ, ݩ۵2[ZbuAD&IXA*(CԤZf0J`w=85H$U<>5mDŮ>*vt$\QF[0`qG.6nUp"h Y[;aN<}M'Ѱa:{h^ALK`!Km(;QfȐO.H juTe͢UGX[-%׿np7N_ĥ'ˉ46ԃEs7c)=TLq"u B5bOS;I"{C~|>;}!gwHһx:蹎TR~9p+=;6Hf~f/\!Bk ?ȃ,}Of?Bxq!pa":o(bG Rēg/VЬ=)a&^zǽ stNO[VtJD^.)VKOJ]@LcnyR:4ZVQ/'i'hfpMz#XDݶUUx˦"d^첛VdX8y]{ԬY'Ęކ=rڅf"d[=}~ @4_SܘmZbJws\ KZ>,W(J> X- Q4-bJn}/w}<'L_c}{xB켚ȑ61v Pf{IezG)" \q~ b&Zv4XvD{<Vnf)g\6J <Ź6'ӗFC]A:b2IPb Lt &ݑ Tk]Cx2(FV ,D4j tEZMlD>xf&{\ ;P i|-~72$CAqxa7q(ոc?Nݦs 0N^xWT>NVbF[pO͙ͭXBVuŵ'og3iΧ/Kpzy#^{w^QVH-kn^wY c܂жFڵǫS]b>Ei^*5ivK** `4T4In1&ę~{p‹ƠU-˄;4/Q}0hVD1}cAf딧k ՇO PrKƒ5yyEY B( E{K< _ɧj@R )9BV^UbRr(#QBqX%2")A읒5HOVJr{3]u|t4@$FMUHH?fܚ2-^"ByChKDknE0UfsZB|S 6. \y]۸VzQİ3  nBG˕q69H a5A/+ښJ?* >fnLNo$v/țB#&Jt'<`̄e݇xFA~LYF`WKygaӃ5FV|2W.!yހ ']&z  b ě w{ŞA^'ƥpfLj[? (Ȅ7l @=]iVLoZNǤ^_PnbC<}5N]A,$\vgmfyΈ{"~&$} ^/crs8Yx|wvǴH>zuĽ[ <[}qQ7A7BΞ,tL7^'u)6?;pԸ܍5%. \XXbͭ-  BJrB">tX.<(T][!#G ] !l&!%mM:S S`ߠ*-KJe}J#k T{\YUm 9ͺsM'uu!Tb0g(J LGʮ'8 +92HY|Xm vǺ I1a~#Q Z5-jIh2ͱr^hcnTy~r]놽We99yοAcvV/^_$-b2(Ԓ&S~| N?֕`<෇EoGt3,?#Vch>0_ 2C({RR:" /C6nءP)27Aè%χKkX`#0M "-D<0|h`ݵ|Rϊ) wAg~nuلU3#:yc@SWo?Nu R*>]P?srud1&Iz|Yms]e.-a>PF/0yzנ۝OZo=(ۙ! >4{ ~_/xwܗ w IE s&dB.,B37/f?Y1X ,۳H"`uSk Ɲg~ye3@gxV5-ݝ6 |-!=A%3pz0g25 M+:r~oFOi6V_ymjiIK+ẻ{2]$@`!XSdmgcmlhj᢯o lkꚩwې栭V&& &펷t!46slӂ:fNܫ  15w[Y{:9N/ rl@ḡ:Z6;wG@ʮ'0 'l J4,j8 ƚ4B389B"`ՠD@XEa.s.lk-h].9gg眽>CfR mn}_=}?b^X%p$ctIJ>Lx卟?7Y θGC]`4]$x32}|/sXba#A!y^=SA@ܩ'y(n~"=sgpq|6KݽƠ*0ZP%҆e5qT#^nKIވ?+B?z/P#r&p,t/{:ÑS@;SF*dzyb2NXyJZ.JuOH=:E;.0ց1?]|L'LRz#R8}혛K4Dڸdmn*m Uhx|t# 9`Rwɀ#:Z=:}վi5W?gٖۿN֨LF` g/0>mD.Jv)XSbZ,0V(U SâZJ. ]Q&)c啢2T^Z[ih<44jF}9N_b^c7:jj7]kRqCz)QȮ)̲fkmirݜbN]N]f0Q9Z?"ZQJɢZswk/… 9q[+ V].x9u`WL%S<>Bo)_AcL@RMoo#SLrQ{V#i7Y%2GoS#[`P>m AQx"$OHhʅ;q|a _XWKC+Hs)H֞89=6ҞEcw&u1 Z{WAs_x6q>Y?dȖMx F-@ U}<^`W'.斀 B?H~5ҟ=-`RLVbm&U51d?d7j8`4 Al0֬RQDXQf>PK˫.ۻ=[%VM hu;YEqNgA&[: d;T*g3o(8t3BAgc8?۲fY\;D.aJ ]RD`M c\yy Jqd3lUkھ:wnz=|7&,r< 8.hCD  !ƄM3Iṵ$kx :!ʶ'7d~|j ncXC}+׏G{U†~E{/YiP<- ]09_C M+ ~~gr 2oTܣ0ϋ5wlUqDR_^OA&qZDqF.~8Zhd"#-U2#xCbd$b6W) Pt GuvC\܂U}RbjF>Lĉr U:o $vy Q^Xzm@67",*73F2f6~XB t.^YxuY Z>ܴΤ &{[gnk=uXIQ:<#FT0W :JX .K%^Z^x$4qKA!$eINno,6O2P/%V)721]Ma ]˅F~T4P \L9b' NL$҄koM0Y?: 6,AG܃檀9" OKmԒ)'wWX64k?cɄ[~rbV{(+\ǎ_=kb`i *+u Pۗ'N%ܾ[%s"@ޕӀV@n=2KrXy dbv703L(k_=qʙa!k՛)vcOcP͒۲R;rڳA@wt m9@Fkfb[v<(zqAWJ{f$hD h f!enNx2\]24 .J\@&%;{S!V2Ν\Mf"4AO [ Jf(Z: 4@\9rNk M&,R:3 E,*gg.4uA]yZ}->.} /[ΎZSoxgF^/ bhѹZhk똪kP k=m =;SЕf.V6>[u@F1Möm5մLԍTT }BkCcGS'3sw+ ^v6;GGNO_Xhw](ߤ(L 2ɐ1͈c4 F7 h7fK #S*m 'u̓/&;=4s3ijS\=٭.G?Cɐjuf5Nj&@Kq;}F Lw@NӮHf#ڎ9^k\~x zh׏0`'4. =~+//[`jzp!)X#3%#P%QJ05S"mRa&.TDFM4 .Vѵ&ݻ=w?>"$:וVp{z{Ќ1 C^'pK7ZlsezA5LqIx!v\MOwFHh$MSx*D^I2>EA,KQ3Ɋ\iUAaeU uxhsTu&.˜@julo3'q3 A8B a[ʵ;AԹ-Ş#D?'_H; kI~1)Rs- ~=&r4+9Nb4GS8 -͂nݱwj66fAV 鼝yce^XYȑ2s%혩yFN#lzǼT#'=[ѵ{n=h_͞um>[-`cgaoԳua`Svz=n*EV0vETfnNPgHݠ \"U@w9zu7JDe}0wp@պ8(1R"~ԑPo|61[uEΝv%iMpnD@ҐL D ~:O5-4P42` |rOP$e2c>_OD:5#jVi7cu1Nm>3zAƵ{DX-n!M"pl4V"`^،enzYZs+:JMzHk9A zz}V,`Яh:cIPT~pgzp}rr;wSӁ]w2: q!RPk{%md4q4P&><0P]d/ؒ{Iڵxݷ 5=[SgEqѧxEP 0RӰ hOy ax_L9Pftx O җjy1ʔ JEF.y#ijIkꊩ6,Nz4D-HV%1[L4B*Eg$l]v PE콗^Rapx84J&( Atw dž)z<28B9*/U2Q:LB6##-DlXLt{uW{i**̉.-47vm-͋+63er g1wNNnuwE^uA^eQby7OCws㵱_וLzKU3yUtt) Ci bG`Z.YV4L(3 ɍ[&nn|c/v:4tlEQ?uLxaGf1X;j|Q!G=`Eo]~Z%p2 \1jņ>O襮vvk"tT zhMIԡbs{(}1 7]~dF 8n%0IJ޻P.WΥ78ߤZRat&mR`x aQ4юh'0{w76iIugG;.ܕ̂ ;Sggz`[:6o/WN>T-EnА1TW#hv>V[yoc %^Oͬ);nQcn+۪edk1v>ZKGk):1ZWJMv4y&4*erE1dfhmѹ.T佧TAE 9ύĮLG?+ ӝ \UTm"̽*)RkJLc$msݼu65sxSUٳwWr}*anTtU^US8TH6 RA!\*&V_HĨ;-hwNRi#4ŁѬH$4:Dbu2 0y4Ҭ~]dV?^eNW~>}ْKoSSOx`܌~d5V YƧ\ cb!fc[xxG HV @91re9c~ *oݖfȌ&睜 ƀN_ƕzT/>{"Wʮ7i0 (1,d350~,lcЖJ[(t|m¾03^yďīwJcbb9/?ihҼyys/&s(}X><Tہ?{:aH>j- dI}"14mUčFւypj:QmYZ2V"U~*T2PbJ"}'Y(KnDKUj !E,U0 0 %Km@y&xpҠ; pt0 1h'M`AU.CQd $P$GG'w!-A`@>"iX(z/`wZCxzxGb17^G/~=o܍w^ `kw(f=hfQmk %j.@5`#P+0Ti3%-lY@ej1 , y%̹³2W#|Kd]aX%GƒpD fF⅛b⥕Tuh)"$٤G#J4lV5:yL H2ݢ鮕-w.K[ZdPA恑8J[i$d%(_y%?7?Y\|$?C!j }xӃC _G''fkRO e ^{BbH%W[^y B#TltFpı⊿K'F#FoCص&E_F&־4E[MKmbJVAR a(JA[_IԅѺpSB]\.sѽdr'3o~yyKtZr|Ȏe'k)1ͩ}>[L7#f>d"1<')t*d7dښg$&LYeYL/x[zIaJ˳k,O:ry%23 eO0@6奧=I]q/?;~n6HS ^.3ennYؙ[,9P&IgFҽ9Φfnޞ+2>JX_O@ ltzڷE7Nu/O]8ݳVȡ4}O t,:TW-v e_WB?'_|96[zݩ*B?sxXݨ5VS94j)WSe*gXjzt٫SfmJi+(%3))ӖSݚH 4Tޭ]VxRMb^M$QCUPcP*qzԏ  51Pg$Yi$&j JUf]GԄ$= §[Hb.OGC#3$!ltuve}| e 'l,c'^vMyTv&7ړ=])bQIU:3kqsE<]q\C.o?)#p ].j@.ԇ o;&( pE6J@ (\`FeT*a"K \xibCWv"x5̗I\=gf}zX\3_(b@{ ʣV MwB;;}1MPHԆ0V(,jGTNSʰMaRs(i"LbM8eM1L8"$88 Ǭ2^853.4L 2Ci }'rI6qDlhwRqcoLx)黇c4k',<ŒfNzfj1=IZ8q>3Mo%Jqs.~:)$dH;4)ɸWXLIs3 K뜚b.ʋXa󯠂pҚbUy&@WT vL}EVl罆-Z N_銋%VOUCeEw|7V Ci ,ǡZ L})q-Sy_ vWB?ֺj#쫭uh{a*Acut9x9p=sgl `9p=t5X  K u LVϘYؙV[9t26aoh:3p35s63w41m14r֢F@ E' ij:t>hh9`/pv2w=s"̯33Rf(ﭰ\r/(DF (cgjbgem*碯`750?;!x4{Z;qF˫FMN)‚''?}}kScc`O[LC4@)T5 TTHYYOQI[QUOI@Y@UHK^S}c{CG#cG`6mִPv̷&m0,\4$cjZyY[;9xv?IEQo)' bre.[:_Ht_bOn2i#j jå` !Hx/ڹhCٹg/{Ϲ?sk }[_1W?W?U>U3wi^ϛ~j6?f4m*xm\A̠ukvhsk~q`}]>BXiX 2tFp֍_֌A盽Ũg^xUk'==Jk -خ`D#M~ ĭlhkzj[om_ׯT]:խ74/k4DA( fiLuc`9gcPu2*#݅,bĠ1`g*}@(sA*#U^a(dI\lg~qp(RtS™ 9's<:)%B[f$Q_*|9vvŽDnfԋ'#S/viyo?xju_m%DQ.ʔbIeQHz '(J/>.*;)HH \|g#&$  3<)Rܵj)4aGƸ1W<3ژW);o&'.~9'9!q+X9d"x3f`ţc A$!%Q)MI$"21 1D8GZdP- ZL1g˷^\5:> 4c(fkEznapwbҒ](/PvkJK}7͞>ஶVں譛SnMbowo@桗l; {Nc-q U S#NyQa\̐J!bE^CUrW_/}XҖ!O6@(\lP q c1r #ˠ&h. VzAU2ӄik3NT!SL_3i1gIamn=tvavXp3J[YXpJ[.!EkskBymRnBȎF.nإ/^mԲ33Raxѽm϶͉^q,?|NLP%h)i:N2^t1+XNgۮԗ鯏\ߞ\t[?ڙF9j2P>ssf4Y !q9i\4:tPc 8թ_FOJJ9*z"MaC1gE/ SUӔnbHȦ@EӎaہIZQRҦ9Ni m/#gWD(B ˫o> ,e)PPv֖2ݠZ xј܇9.g+/n5m!B*kx!Wlqq$ Ǣ:/a`IX<_ bv?l.rtOQB,A#궇A}YED̟Ʉv3P8`g̻7:ڢ@u1h[u@u!+}W⇊^e*r3+|L?Ÿ1L?>F0ohvKr s2LOA2B'#2jq8Kbvem\KŭF!>܆Զ!5󽨪gg }NN#q 7|XAN3NuQAv0R0bJfMz5SuyU];Pu/u}THhZ-0 #G{-2;{D@h  CbwMIL˓ygTq1ķu bad9eb+q*-zǚ7ÎQ-$Y!͊Nb.;n Rzi?jM:_Z:ۯB:@F%-]*<*m @2!1b{2蝗15 0##F(](|s3! 6fNֶLhl``gEOJR[R]E4QRWTQU7T2VZ3@)\-@5=m7SsU: XAI-=Y|3xF x y}hh2pxCc{#`uA,uU:coc` :kyL\AUݮ .u4Jkp?t% ޗT jZBq25~"8:䔄ir;JͦlmMB Q0 wMq_e~BͻD`{ XZZ96A3 IBm+"R`>oRQ7P06DմA- LA ZY{*RgH9~jT4YCzpFu!M4l. $͝._B9 3Syg`MupPgkwI|54y<2(04#gjdb~vƶ3 A{T U5!dLWthnM=C gcm th.hn֙Ng > t( Wp}d 16Ϟx"@gd&d7Վ.[2}}CRg2۳5N"Ϝׯ߆%;+@Z3KWc3{CH>470M9IC`eemna#257rdU7Ul73sȈx|0Q-23w!Wʘr ;ӳ:} ̡I ,f˭k4`>IlC;'g(:۟ƦNPػ v: Z[b R`PU@MLtg(h,<A|(htp 337 p5Ý3D0ՁjXL8Dx``OĶT%s&$z< Fo'(bysdGdTwii'6&A^tph97ItH.x9%0[[ZL5/f'YT[Ρxt mR5+7SP[XzEt%hf ʊVF{@v<@Ȅ~}W-]as8f?NQ_?Msiuޚgv߿젠8#c[kТj`-R}#[ o5kikkZkCS'cs'jOO`4^ 6 Z8zZr)h0@5A @sh<tۑ@D4G[o.1:+^7bO @սfYA9_| K Iu@kЌPPNBCЩں:emΡlR`5f]3stn :4346v4c"*Zڦƶfz`ku{_ghi[ٙf'̄!9j'V#YQJ| 64=} =C+sнiȉg5hK9 S3G]O3GK<xP4cZbd;8^DL<-%֋S m|̈́j΅ 59+9y+66'l܍5=5;cS-` TZs#nmkgoh lZ VzиhFAmKKb4jv K> m_Y.>$t*0ՓNNA -Es<@΄RMwf(m5cq sGj7X,sgSh#1h#& r2_ji&3 ijSjks h$< Z@H@5xk(YdF9thiZ@c ^) W E...!l@s9@eiL-ˍ|T'w6tuo=P<?;]QQncilbo`hi`domlyf*h hS"Q-sm5CcSGzQPN7)M@@>)p+\ ͊(h60+nGv42vpsEIƻ27eLm?Z;JU,4ٓ>|UW766d+nnfZFvBSKhtxTCA"eN u֓FFnN>E7nk" }歼=UucAL艝`f3r[ ~~gxZ'8G88YZ[9[Z9YYE-,-\ml\ܽýB"kҢjNC޼~훷~ d_?.qZ#"u8b {߮^7Srk~_\-=L tm| sZӃ"f,L\ۜhߌC,?8l焂s&W*(?zlL^-gk!oXi#!od߿GGGG:>yJDD||R⡹%;ZCZMSo]QRQQ\kaf$Ԕՙ>%?rQE²ꄕu)R״fm)=dҝOͭ]L{#yF˼]ۃ$[ܕlE}T?~)101R3jq$~K x'O6m4mںʚPpw(wHW c{S-ME90O\Ҕ;(~~EՍi36olԝ`[Iŋ[\\TT5 tzW&sl ϯ6-ZR忤=߰\S^1UQWYK; G-?nD!jRj[ī(W桪9I/#ٱa\Ȟ4:CpYRH89oNK~6񞜎6nt+cy۸t!E4~턊 V2(mlz֐ѫ*iw-l0m+%RkD6u}^ٙo :}+j}=u#p{u7ن_zaםyi>VbaFYfވqpRE-=|f1`hM}ơwAEx ʅI[AL{3.yaǑX;VieAIK^n_X8F8xx_fdnWP(vy"dw>ۆ霡ZiC]V`wf(c`飢bi6`y"]N^j_Ncnb+tBf͚چ:Ztθ{ȷK!mg&gï9KXZ .' K4TLgw "b$*'r 0,4l8<@-DmH'L1MG-TWmXg\wQx-dmh1K 5p-tm@Q#߀.n7'G8/%'-w@޲礗n8袧.n{/λ|y |G/g{wXxڗo>M~__]7@mhЀ@v? ʎ B( B}Ѕ$ gn~܋aCІ٫ Q"=c'D ޮa6)/)찈A, 9E0n 8EϋaԟE1юc,ƺL!? ѐb!ÖeXt+2,#N摑#%V$v$ UIC ⱎ\#PƖMrHHHBT$0n"PT~\$E"1--YR7Pq+eOMpQz$5YLG^/Nyclg9 π'ڒie Ԡ38Obў'$x HGJҒ(MJWЌCc:s*Tm!;V=Qj7uCZ@E7sRu'yըFTh̦mT쟻.9QS5rÝs5tW z2b'Y3]bR?ZV ]UuU9Bj,kdqvEѳO}V&t[kD'k̭ns [Yk{ɒW4m Bj r^u av͸.ygS/emަe]ou[_7-o˺)7c^O vg;8x{aeXCCvƻ(NW .^L1@@2u HV1&/P^G([lk.{YlSL2WMT6l ͭ3,gΤ gπ>M eaNߘL9 wx~mpьf%`J_mӜ=Lgo^ײIVgS[á~) VO[(uFuKloV+a=j1<6lT2ں(h ;umǭu\V~~k6}p_}އ8O}KjMr''G$qEEsxDun2%|dGW36g6`YߗWpuXrc2JSZN@UGs Woubs}en\\|ur҇9\5o=aDA8wgy7K?~H؈xjhȆXXFdA6h3򗆥(4%z vI{ }yn 9nrjuGL͔um WuU~'c~XwGs'g6Tu'yF'ylGo'XgIy?iN: gi7gPNx0e|4Qr熿 {ۉϷAvj҉6k|ٙZYxzQ*ŠGt'f97!a頖\LiTTj/f eעujHV)9V8엥9JIAJfC'{Wzۧ|e蛠XcuT3=H3]I9py]ez6)1(k%بYyτ1E-xpIx 6(d]6V `%}l.*Ωue5O٪\*Jj@aJd4j4 &9JOG^7 bͪ4E m*E*yB: ۺ`J*ӚiᓫZX3 #:3nI֮\ =*[23ïԭ?cCb {c${iߥGñg%00 L ]3 ;u7ò<[_7Be9;3D[ YK 3M vw6 PVKdP7揉CުFyV?j[h5 7m;8@3Swfiqȷ3a y*i;_lU=ӗf3YSU-DùljjD2NA6; @U8o^驮;0E;{S>9vS[ڣCg}7[mkMgY8sKK@Yjly3ak7vYUoVmO"K7"Z6hMxY Z6KUt4VxF{pZ +I1uHUJ6U9g ܜ w3ܸosjq=5_uv+s)3Lؼ1(lMX>$^&~3UT跏2Nge(:9N<>s1^FF^:w-PRE+乤ܚ-`lyN>f~S^?J+^nٷeMj~婫cnn\_Nm-`(8z.|P:KVECNܾs<[.w i&Ȗ>ۚe>2m>C{H撮IziǧA&쵪_ĂmnV-g+>נ>n~u} EN8D~S?4ŷ!RST)?XA NYW)ZA[DcZݬGI!kl#psQua8xyzFqvZfs-j.d|XU#]"xGC)Qz|4s3Τv%ut+k\P=W ֤̃JsFns+Ra8 G[b2Ԫq^]ST WDqEqFE kE{TEyqHrܢ $TrI&tI( 禴J,$0='" I#K24SJZ;sM6L SCL0r#rӳݴmO\FP&O@mMt%APD3-GQ$Bt2ܖ4A SMcdSeNA,Y'`U`sQP25,\k PRa%$ӝBKGTYeQc1ayk BC<|Ikz Xvx͚hz`<ifqm]uZn觐vo_.k'iI(R.h7co׹-tG/}W~yoG[xr}4=so^OD3|tcmcͥM~[taLbZ[`]ׯPT=$_Vl37F'7;w-.y4fG$_"Ʒyߨ+-,; rJK̴ AK^FBfJ+/04"W/}b!=oj?9" s*cf=~HKfJD$#˲ɳғ&TҘIMdWQƊW,*3W6tc!gF,ڲNP1Y*Ж"S s̤f5S%kfZ(e.)MpsEf-yNt^f:Ng=Yuhrܻg?YyPQhSA ZDTk)Y}tb齊fJm сldBERpUxh9&Uҥ͒ߌgz2'}]Mg0CAOGz/7֭@$(HYTɉXAGzp쩙UZ.5NY8U:K\ ַ.TRLwÒT ʡc Bilmzq"-mhĚY `jJ|]6-4Pġ2P)1x:ΖܬaZ7fwTB>FD r!;Aςwzd ;]gⱒvћ 淵╠K/w7陕FuwdN*qw-ָa]# g^fl^3{KuDUxQ>%Pps^}c YCB@JU1`s4֯nwKb$ظ;# ,7~\.S's^*7N 8/SvTge1[_,U]zs(ޛeXgBSr5]@2l.J!pz췰vk` `ըgF纒6~]{H0i]WI[5mif_5n:v?Uڎ ph-нRuKDp@9nڦ7R+SϦI9Z] r33)gEf43'/Lܟ9uzdzKϤЇSFI8zՕdt?VzMu{}N'gI{?^Z=b_ܧ]t?.8ݳX*io%ΪQlXt{?HgjJo9:M>yom,xN2y/|9&x '{_ۡf]w60F}/Ó7} ]1{m_qBp^.MY?G_+ cсy l!_ӹk?|Ù{: 3Q6!"-H3 c?q? 1W2 ԥ)3 33| ,@q $.{"A B!>ɲL ܃9Z)Hc@2&#D@<@F=<Ƀ25Α33ܴ:3z!̓@KCPkg2YL/ ,17\P80$k0?̵\85]TҿZCysf y$C}b#O=?;T<MM͉iEӲNc! Ct5)˲:A #.M@li:9RZV/NYw$ P",JPJq{1E*E"pWw%j3WEFSG='|al;PJsWqBdWUF̓Eq|Ƀ̃ؒ2 tuՇX;ؚ2Otَ=YKE)='%+HYjVCYٕeبI=Z S]Z=mZ%4ZmZ5ZUȫZTԲ=[M[][m[}[[[[[[[[[ \\-\=\M\]\Uܷyȍ\ɝɭ\˽\\\\\ ]]-]=]M]]]m]}]H]J]]۽]]]]] ^ץϽN=^A^M^U}^^^O^^^^^^ __-_=_M_]_m_}_u________ ``.`;aplus-fsf-4.22/src/html/ColorSamples.html0000444000265000001440000007227610242637221014055 A+ Reference: Samples of colors in the s Context

Samples of supported colors in the s Context

   aquamarine   
   (+ 1–4)
 (7fffd4)
`aquamarine
 
 (7fffd4)
`aquamarine1
 
 (76eec6)
`aquamarine2
 
 (66cdaa)
`aquamarine3
 
 (458b74)
`aquamarine4
 
   azure   
   (+ 1–4)
 (f0ffff)
`azure
 
 (f0ffff)
`azure1
 
 (e0eeee)
`azure2
 
 (c1cdcd)
`azure3
 
 (838b8b)
`azure4
 
   beige     (f5f5dc)
`beige
 
 
   bisque   
   (+ 1–4)
 (ffe4c4)
`bisque
 
 (ffe4c4)
`bisque1
 
 (eed5b7)
`bisque2
 
 (cdb79e)
`bisque3
 
 (8b7d6b)
`bisque4
 
   black     (000000)
`black
 
 
   blue   
   (+ 1–4)
 (0000ff)
`blue
 
 (0000ff)
`blue1
 
 (0000ee)
`blue2
 
 (0000cd)
`blue3
 
 (00008b)
`blue4
 
   brown   
   (+ 1–4)
 (a52a2a)
`brown
 
 (ff4040)
`brown1
 
 (ee3b3b)
`brown2
 
 (cd3333)
`brown3
 
 (8b2323)
`brown4
 
   burlywood   
   (+ 1–4)
 (deb887)
`burlywood
 
 (ffd39b)
`burlywood1
 
 (eec591)
`burlywood2
 
 (cdaa7d)
`burlywood3
 
 (8b7355)
`burlywood4
 
   chartreuse   
   (+ 1–4)
 (7fff00)
`chartreuse
 
 (7fff00)
`chartreuse1
 
 (76ee00)
`chartreuse2
 
 (66cd00)
`chartreuse3
 
 (458b00)
`chartreuse4
 
   chocolate   
   (+ 1–4)
 (d2691e)
`chocolate
 
 (ff7f24)
`chocolate1
 
 (ee7621)
`chocolate2
 
 (cd661d)
`chocolate3
 
 (8b4513)
`chocolate4
 
   coral   
   (+ 1–4)
 (ff7f50)
`coral
 
 (ff7256)
`coral1
 
 (ee6a50)
`coral2
 
 (cd5b45)
`coral3
 
 (8b3e2f)
`coral4
 
   cornsilk   
   (+ 1–4)
 (fff8dc)
`cornsilk
 
 (fff8dc)
`cornsilk1
 
 (eee8cd)
`cornsilk2
 
 (cdc8b1)
`cornsilk3
 
 (8b8878)
`cornsilk4
 
   cyan   
   (+ 1–4)
 (00ffff)
`cyan
 
 (00ffff)
`cyan1
 
 (00eeee)
`cyan2
 
 (00cdcd)
`cyan3
 
 (008b8b)
`cyan4
 
   firebrick   
   (+ 1–4)
 (b22222)
`firebrick
 
 (ff3030)
`firebrick1
 
 (ee2c2c)
`firebrick2
 
 (cd2626)
`firebrick3
 
 (8b1a1a)
`firebrick4
 
   gainsboro     (dcdcdc)
`gainsboro
 
 
   gold   
   (+ 1–4)
 (ffd700)
`gold
 
 (ffd700)
`gold1
 
 (eec900)
`gold2
 
 (cdad00)
`gold3
 
 (8b7500)
`gold4
 
   goldenrod   
   (+ 1–4)
 (daa520)
`goldenrod
 
 (ffc125)
`goldenrod1
 
 (eeb422)
`goldenrod2
 
 (cd9b1d)
`goldenrod3
 
 (8b6914)
`goldenrod4
 
   green   
   (+ 1–4)
 (00ff00)
`green
 
 (00ff00)
`green1
 
 (00ee00)
`green2
 
 (00cd00)
`green3
 
 (008b00)
`green4
 
   grey   
   (+ 0–100)
 (bebebe)
`grey
 
 (000000)
`grey0
 
 ...through...  (ffffff)
`grey100
 
 
   honeydew   
   (+ 1–4)
 (f0fff0)
`honeydew
 
 (f0fff0)
`honeydew1
 
 (e0eee0)
`honeydew2
 
 (c1cdc1)
`honeydew3
 
 (838b83)
`honeydew4
 
   ivory   
   (+ 1–4)
 (fffff0)
`ivory
 
 (fffff0)
`ivory1
 
 (eeeee0)
`ivory2
 
 (cdcdc1)
`ivory3
 
 (8b8b83)
`ivory4
 
   khaki   
   (+ 1–4)
 (f0e68c)
`khaki
 
 (fff68f)
`khaki1
 
 (eee685)
`khaki2
 
 (cdc673)
`khaki3
 
 (8b864e)
`khaki4
 
   lavender     (e6e6fa)
`lavender
 
 
   linen     (faf0e6)
`linen
 
 
   magenta   
   (+ 1–4)
 (ff00ff)
`magenta
 
 (ff00ff)
`magenta1
 
 (ee00ee)
`magenta2
 
 (cd00cd)
`magenta3
 
 (8b008b)
`magenta4
 
   maroon   
   (+ 1–4)
 (b03060)
`maroon
 
 (ff34b3)
`maroon1
 
 (ee30a7)
`maroon2
 
 (cd2990)
`maroon3
 
 (8b1c62)
`maroon4
 
   moccasin     (ffe4b5)
`moccasin
 
 
   navy     (000080)
`navy
 
 
   orange   
   (+ 1–4)
 (ffa500)
`orange
 
 (ffa500)
`orange1
 
 (ee9a00)
`orange2
 
 (cd8500)
`orange3
 
 (8b5a00)
`orange4
 
   orchid   
   (+ 1–4)
 (da70d6)
`orchid
 
 (ff83fa)
`orchid1
 
 (ee7ae9)
`orchid2
 
 (cd69c9)
`orchid3
 
 (8b4789)
`orchid4
 
   peru     (cd853f)
`peru
 
 
   pink   
   (+ 1–4)
 (ffc0cb)
`pink
 
 (ffb5c5)
`pink1
 
 (eea9b8)
`pink2
 
 (cd919e)
`pink3
 
 (8b636c)
`pink4
 
   plum   
   (+ 1–4)
 (dda0dd)
`plum
 
 (ffbbff)
`plum1
 
 (eeaeee)
`plum2
 
 (cd96cd)
`plum3
 
 (8b668b)
`plum4
 
   purple   
   (+ 1–4)
 (a020f0)
`purple
 
 (9b30ff)
`purple1
 
 (912cee)
`purple2
 
 (7d26cd)
`purple3
 
 (551a8b)
`purple4
 
   red   
   (+ 1–4)
 (ff0000)
`red
 
 (ff0000)
`red1
 
 (ee0000)
`red2
 
 (cd0000)
`red3
 
 (8b0000)
`red4
 
   salmon   
   (+ 1–4)
 (fa8072)
`salmon
 
 (ff8c69)
`salmon1
 
 (ee8262)
`salmon2
 
 (cd7054)
`salmon3
 
 (8b4c39)
`salmon4
 
   seashell   
   (+ 1–4)
 (fff5ee)
`seashell
 
 (fff5ee)
`seashell1
 
 (eee5de)
`seashell2
 
 (cdc5bf)
`seashell3
 
 (8b8682)
`seashell4
 
   sienna   
   (+ 1–4)
 (a0522d)
`sienna
 
 (ff8247)
`sienna1
 
 (ee7942)
`sienna2
 
 (cd6839)
`sienna3
 
 (8b4726)
`sienna4
 
   snow   
   (+ 1–4)
 (fffafa)
`snow
 
 (fffafa)
`snow1
 
 (eee9e9)
`snow2
 
 (cdc9c9)
`snow3
 
 (8b8989)
`snow4
 
   tan   
   (+ 1–4)
 (d2b48c)
`tan
 
 (ffa54f)
`tan1
 
 (ee9a49)
`tan2
 
 (cd853f)
`tan3
 
 (8b5a2b)
`tan4
 
   thistle   
   (+ 1–4)
 (d8bfd8)
`thistle
 
 (ffe1ff)
`thistle1
 
 (eed2ee)
`thistle2
 
 (cdb5cd)
`thistle3
 
 (8b7b8b)
`thistle4
 
   tomato   
   (+ 1–4)
 (ff6347)
`tomato
 
 (ff6347)
`tomato1
 
 (ee5c42)
`tomato2
 
 (cd4f39)
`tomato3
 
 (8b3626)
`tomato4
 
   turquoise   
   (+ 1–4)
 (40e0d0)
`turquoise
 
 (00f5ff)
`turquoise1
 
 (00e5ee)
`turquoise2
 
 (00c5cd)
`turquoise3
 
 (00868b)
`turquoise4
 
   violet     (ee82ee)
`violet
 
 
   wheat   
   (+ 1–4)
 (f5deb3)
`wheat
 
 (ffe7ba)
`wheat1
 
 (eed8ae)
`wheat2
 
 (cdba96)
`wheat3
 
 (8b7e66)
`wheat4
 
   white     (ffffff)
`white
 
 
   yellow   
   (+ 1–4)
 (ffff00)
`yellow
 
 (ffff00)
`yellow1
 
 (eeee00)
`yellow2
 
 (cdcd00)
`yellow3
 
 (8b8b00)
`yellow4
 
aplus-fsf-4.22/src/html/DefnLM01.gif0000444000265000001440000005326507215453030012516 GIF89a@  !!!"""###$$$%%%&&&'''((()))***+++,,,---...///000111222333444555666777888999:::;;;<<<===>>>???@@@AAABBBCCCDDDEEEFFFGGGHHHIIIJJJKKKLLLMMMNNNOOOPPPQQQRRRSSSTTTUUUVVVWWWXXXYYYZZZ[[[\\\]]]^^^___```aaabbbcccdddeeefffggghhhiiijjjkkklllmmmnnnooopppqqqrrrssstttuuuvvvwwwxxxyyyzzz{{{|||}}}~~~,@ H*\ȰÇ#JHŋ3jȱǏ CIɓ(S\ɲ˗0cʜI͛8sɳϟ@ JѣH*]ʴӧPJJիXjʵׯ`Úc+D$6}m ]&Vyxҥ/&1v:BuZ u?RSk  5Vt4FZ<򤓫6niM*P6bt!@ȴ( (N:0 1] 7 R#Ea#i71`d |ZJ@x&NLFP0@-H 6Q+E! xP?TDյB"X(70GDH@3 qDd\DpAFV߁&qAB;X`?@=(2-5!җA CH#Ђ7OYR" ##7$b-%S#LCys#BH#z 4 D$"mf@')&MA #R \@6h)0b@!Ԍ!dsMc&$˫ 0 90A GWO,l% dO B=ӈԓ"\/$3B&r.'Ռna=dk6c, 1 -@,!P7@R :D!Vt !P;1L `|I pA`BiOA?,; B <m@,BWHPAp{AC> Dp/y?`pb !P(Tn@i7A?8\s@ xA(@ XP`)\xo`h?q $/ x5E$(!)C>ޑߌczt< !\Aݴ@&2:ux}#1|1HA|86E;@@i[І8Cj!P\$Ҏ {B P b )H' "ոC i;"Hz xE҂/S&JpGЍ`  ph@`r$ DQA[ @W;6~`x8J6`C x|mxpG:!xc xh`="c 8p#X.ab O RjU L 8 rP($k` krM8V=`w8e !"2 ] X r ?ҡ@lZ( p>  A!GLS% =QP|T@Ay}(H$ ;<0Cq|l) 0JxGZ5cD)tp@*!GBSGcAfaa+7%H#vq`!EpIny-ljp<` R@AySv 'POH`A*Z0>jn X @4 a x"!M:0PBP!D p?|@j@QP0uYd8Dn C&AЇ'd@V |@ H #kF>8P#[Gׅ )>2z Y`g E1 l`C1@Ġƃ"r=1 Ia !0  A  ?q.X&{8:") @ A27a<XqD IP,0vd5A;xpf BBh-?H%)] UqH$ D Žhtp0| m$`;} 0:X+`|v7 x"vyH@ڎA!( p>]#H:(,#Ljs;2僄!BAڱ@@i$0?|76Q] 'M`ƠhP|}70 ۡ!R10? yQFv8!@;@fG2,ND!&F!7ŠKYp[p=jjp`s0-4P,w Ps } 0st F{OdP5o& v=Js A~bG{ #SP pF`gݰ0f$P-@j  :p`o `P!KCrj# $ nD (dpzwc w0`HcpeAz00O p0? 0`qy-+}f0`89q` 1f@ wz7 t|Xw `0 8Pi`P P'T +K0DI2pp vP   p\p{0)q K @ %"`*:c@ G0?`` IP4 J<4.'a,`(YMk0/QP9 O`*`x A pB #@ dph!.1Z'0{p R0  g iA;9 ~P;Il0KVy /PZpP]Fq006J*Υ''0P J.0':@C!jd%`qPJ&Н 0:Vxu, b1 :Q2$GmJ0ZGJ(+q rI*ze:;*iZ`@C`% C$q0jG@xTfD J 6 P0@~: 8Wa \011 А` dgǭ']گ;[{ ۰;[{۱ ";$[&{(*,۲.02;4[6{8:<۳>@B;D[F{HJL۴NPR;T[V{XZ\۵^`b;d[f{hjl۶npr;t[v{xz|۷~;[{۸X0 !l @ k4  й1C@˶`P0/P9 20{OdnмY @JR iC0 rF ɰ Ƞ pp q ˶ 3yr [Y!`HpW  CQ@Z n P&{aQ 'P@Ypy 0P ?` ! a UL8cȑ%O\e̙5oٳgI& xh7Пa` m5AI ~81_ 0 @XL y}`6pM_FzxpF tGp@JDž ]"#`Qh #=. ȃ(N 9, 'k$rqG{G ,aGh!ȊIi _bIkI#hfQcqa 1!e)gR$GG(ʄc@Q „`t00#Y%!i&(bq sb&ፌءbIR꧆(Gf<A?P쌄Ǜ=[pw\r3$ca)!IB) &Y;2^Ra1nxjC{ezX@d @pq!Q؁qIaYf$>$("(c ~`a, &En\Bƀ"Tݪb kuYh&8؆ 6jg p$Wr|p '!h,t-H7L$1=ș " &8Y4B(~uA5ppG:~$€"C,>K`h$#_PFT>G=4{2G=1@2zԃ%H?T긄c8">**?R{X@=џ~4@"hc,=Tzѝt2Oig}}YC2g 5!|H}PoH7HcZ@DX! nmb gE99HYXE YC3<##X5J|w l<40\!A+РM =!-C׊) JH<`|63(\ #)\Y5R1E@*RqB#]b0F ΃,,6xa ІߘClȂy _(&{b6Sg! r`,09d(-Z[. &ep\!  ޡW6pe-8Wph1(eX7O !Ph  UȀ $@ڀm  XxX $XN(ViX 6`0L UXp! lHq-@Pbu8 k54t Xȍ `sP@Ȁ9h=X(& dX`zA  XP P20|`7rAY( X t쉄o8^? W%X PXP P(;8 a w  `Dp@Zȸ78    gɀFQf GB Ho0#Cp g@(Fp&ɇ;H`L@ ̈OЀԃ{ AqlzlNrl8H0K`{xt{0TpЇ. FYu8!x{d8()]@ دC0}ȇ(VXأ p(dX[ }=wIth- @s&\|P !hR8t ن'0FLj-(^8-ȈNx~88v04)~H SSj> |p BP͜N`%8N?0X@ =xsHz}ȈGHKk Map/Y~ Ri<@H_ sP@`qIb8CHX0M%Gtpt0wX1{ hhX``WX80|(}p@h&]ȀMLpwsh;ի~؜H{󖐈 (ؐM,+{DDz:w1Z!H#8;1`@87?Yhnc5PFA SklHD $xhhVBP6' @@XX#58HSDȃxh0zH;B.KesH| \8`x!P,%@p?gH$0ZYC WOF=KUC=iB(B0(FPl?x*<b ؔ P\RPBCXfh-Ȱx~SzlU'_V!shTP ! bXGH])wP r O"p1EQ ;ӱ88x#Ȉ;VPy @4O f0vh8 PȆ ]ZHQ `y2. & 0p(tvo(ʈuP߄xh Ȁ́؆ȳnA jȳ6{`GH 9%T2` H h"obhNGЀz\ EP8'1Ѕ o͈}֑UȂ)HЀ΀5p?Q 9 1r 0 8]Ѓ W"%Ȅ9ؓ`Xm^8IЇvhzx!U(I oxah)%m6Шt*whyr8pPoVT| RXv+qv{8{5B1 85`r{ @eTsS 8H_(syXp9]"g(sUT7e 6THLNgH LM(Vp݁zʁhiXK  `PX ul?f8mJ \&=xdvx{HدuZ8Kh~6ف+n)넠!%.IPEuq Xk0678R !8#R<;(GHR>J؃ %MQf#ج{ ];y؇THR0M~m {]@o؁SuA{<;`J 0IDt 1 PFh2B~ngiH .oH,SPMKS;Ev0%(7ǰI(`](ͳr jh6hHojS&X#{*cP5r6(P;X ghrsH%6X0klPLBx@@CCHwP?$FsȁƁG82a0Up 0>.xCHMnTp H*H ‟<9 H1:mHН@n Ё*@2pp[`(lp @ ߆5x1t(x m8 hP`s2"/2d:xg1 -0p„ n`1@! 5r;.x21r1@~r 6q@ 0% Pi3`@žG#C=a+>sfč 8R/h`-a7V<# 4Xpq3E&bѳb 5I- WÀi;P @HHB9tHƷڵr-!6 ߾UVe!E &=3l1%5e?T5%D"lgO;(;豏B!}CpF.vA7`lL(AA,6aÆeX/L  3`6YDŀ!S|1Y,h @\D8NBq"AKBD'w5Q`Q]c EM ? ?L?۝V't, G8Qw(4!@8I\!DSdyC':z+LJa0=IOB =8*9(]CCJ$9Bb$t4E: HU䒊=x1`,(&D$q3(""G1.3?0<`BġBRbr_BCP-Na/!t"G4I4{5a=6e}6i6m6q=7u}7y7}7 >8~8+8;8K>9[~9k9{9衋>:饛~:ꩫ:뭻:ۑ vCO;8't9NwN:?O:rRN|18;_Ï;hC04BTЊ>@{ G05xNb2D!=9[҉ kԀ0i'p`B8{T(4¦B! Jp&LmAq#vaPX/BP`GAj$8 )ZҬ&0`f!5&.x#Hpc7B \>1٣{ 9QLG=r1n!(?5܃" v B=P{ Oc!8P㒵)wz"8 N ܃EPޣv y:a7&T) 6pʈ67k$r4ذ L`c$8 J^(DA Ȑ !X lpń\b1؄Hd (3T< -c&8h `HZu*BkwH 0M krC03`X"*N"*('21,#(&h \q*Bц H:6`rԣRH/L`%B@] DD@ 5X,pC 4? hB8?@B);Tm>nI/l)4 AB9@$%` P%@-!-C=Pm$(6h@:W3M3D(,)vH\@$Dc4TBhp[:L%;8%A!.t!$E!״BBB=@%D?|`0$" D8"hB,7H@`78# H@YA'iBLBl'm )@,,.,rXQA ,a= = -A)0fGE @*C'(2,X(?$>,?(DxZB4B=M\x;]E!b"0" B;B:8 @'C8|!4A@&oA8`C,93\8hL>Dc(C:pL Lv 9C0<A47h rЌ8C<؀ʌ8\1,;|: 7>t6h?9C4|x:B8C!0)7CH(0% 0:4Vh L@dQUQS8 ? d=48 C9Tl@Q%Ai0(Dq=XH@09C4<S@ x*B`@AE$gJ@@`@|$@!"$6X}9A3@hb5@_8\4"L@Հ Y@;D@) #0i8$3J#O)( 30B)IH,8$!0"!"BT D/p[? pB:C!m, %lC,": !B#$ 4N?؂`BI .h@.M;pM pB),B$ :-NC,P!ڰ8no9h7c렃6L8p7p7/0'/07?0GO0W_0go0wC;|3L!9L2Bx3ñ)D?:C ;(LRڜ4C ?L.4p;3Dن6/[\  >@=Cf3D~ U.i| @,.>4!ЁhB O4 ,A0MM9ݥ ?\ ( <%&lٜdn(%C24~9DC5Dm5L6tQp'%T؀l<6(?B5\︃4`>X,{BOtX{Ő?Ԁ%&d$C ęɃ3O@ a- N-%H|Qȃ cDi4 X{ *HT"D41Ȃ~=Dؕ 5/f>A `4@ĺ e+8fD;'OƂ:IF qg R³`H7ZT04UфdwNw50_`ʃ rY`DfLuA1! ,r߿i 呫Oyb_zSO< _ip#ڿ|'!οy G7}ƽx_> PTp?fnz |GAG:LJK7as4yɠM<9cƭ Gdbf# bB#( ΐδ)\qgZsr&B%Uk-وk TaB (  A%ch"U) hD^,()&=b$h9| @"GH ! ,X@mdzDO  >!@`;@P fX6A~tAbgJP"bk"Dd'%kד8qM $q"#:yxdMC k$:vB@/D!]O4 ($kF!( G$X c$P` s~l]7H:E&.*b 7}p`[G"a&i`q!&tQ^<R3F KA M 1@*1m0E! 0aEtxÇ;HЄ#W(x#8Ap6tɸG>| FcMh@ NX 6 #\xE,( 1 [P ԁ+zQ H0p\sp\,`BV@ Qj!X4ڰKq/418(p`$@($ N8 ŰE26@C 8 FiУ@qF /5 ,t!y]"f JBJ=` .T8 ߝ<P0b ;d  !}c$.p$Gb<0(`.!@G*L e@>W#418ī)Г Q#՘0@Xω k2K0F<|$@j{@`a1`K`)f01 !#%`68(5 P FBvXpaH5@~+\na<` Xb,$D:4p d&.FΨ 4/H9]5Aq#-(H &@!W j([8-s` 2/ r d6ь_412_c*i2xq ~Lg6x ap8k @ PW heh8Mf 4z0&D%+ kHor$!%`Ra@J h!r \p AV4J!` + *A2&d?xA(h?` ,@mA`4 @ r m$P`b ̬  hG&`'[ I& , `n@0s H"N#A(A&*/i"AA@  .A`=>?l A -6h"J_ Z$H5T!<  ؀vs*_@   3&A`rGy af!A| D<`1:ē ZAs a* ! G @ B$/6BM!`! BuzT&@ ` `DAy *abܠ|@Veu, :ylAd= A 7An|Az`V}OAibb6AeB| b!]/r3-! A  4p\`V\@i `RZ`] ȡD4`^Ԧ aHaVzbbB`db@. hа]w 0aebtr= Gc"{ K?aJ!Ӣ%!@``_7  Ii"!&L#gց6A2~, B<2`Y_ 0( "36f4O DDZc rbo[S:a\bc$ &!4o kʁx͡ȁ~ t?}H0`#J5!usI-]{lx! Ʈ 3A!&{w w'?X؁#X'+؂/3X7;|5/ @x. 3փ_dp"aIef?oOX|Fhz a7:v$]͡p ˆ2\X&b @a d鼡V'e4rK:4~e ]&5&aR&uõ`M 6Aʡ K \a=`th 8W39-ad#@;6s 9AA+ bp@0ޠ AҀ @j!bU @AР eYYO @  X?JJ { TZJp n 'H# t` *ygZS vP b΁x: r9Vm&!-B5Y&!< PH,bRZ>@" iϦ "&8_a "  !n c a&acªc @P J@*h! &@"@g; a  b Y O Ȁ !u=F{-u02 6[&"a a`b~ µ h϶  H@Jo2|d[&"Zc `l2 dċ M۸C\ Num>w/}si2-c.`DlD\ȁȈ` ?cց tR` ^ׇ@ p  ȑ@dn}O@ |Z   ց v<h N :q 9a4өOTm`l !]?C^GKOS^W[_c^gg: ;aplus-fsf-4.22/src/html/DefnLM02.gif0000444000265000001440000001705507215453030012514 GIF89a@ffff333f3!,@I8ͻ`(dihlp,tmx|pH,Ȥrl:P#pJZج)zxL.m𸼴>@9{fwS]}'v,- 8~9)ִ=gݩ  *$!1 "&bW s)Ìo zH a޹(;xׇahGZ A8^"΄N$0@`hю{ `ix&Z#UbHSB3t K`nQHUM*ܸuv(gu_ \oVY=PLշhu[3Pe`(")$Hf/͍Tڳέ۶hҒIĴ`3urK0F@cV][:kɎyzuėWf ͉K;=6 azXUM0e6a@,j\g k= l مi,XYhlERy]9tP}Qw5m1sWh;lɃb iL6^YQPՌR\:.MvayPqw0h}^C=sRtEL`ހF|faYN9lń]LyUݘ7ڙW s҉M9pcNWacxsasT+\ܰbGBf}ʀ.0h٬QTQ!gdhǡNLPD=is+ J,yP0{l@7UP_WËKOM7X>*k]5ng]l%hc\TSYF-~ 9XBOqYeW ӼZWJ4*_[/ V w~ פA)Egj_()RZzзP״bz;Sx2s]Miw0Xa MOJ7\ӍO:"sec= *F)~1si8=62Ż"}.c01}%Sq%k/)G5\V9tMK5u`4t?X8YעfƞAAG/CȒ) R`ԽG<!4PиǢa qAʋ| b;Lꖻ`wh) qt̏VElӌX42'd'yxȰ:Ǝ"k<GAv Ehc9ΑJ0ɝ΃o~'}rDA8F*0(=`, '%'.N %IKIdg gbcҥ=JeDĂdCgZ@4)lz8=rSyL$vnĒ'K+k<4YxZsvڳDqcnc<9,aSqiE¥ Z2}],纪Vu6>y9πsЯ¶%?FKRjX@K%Opi$0R^vC+L󐅶oIt:fHKF#`exn)%Gg!(S;Pxm\nId*Jen1S,mЈF'Vf][)Dcډ';6fݵ'/X䩰vij,yE1+6%lɳ~DJaW&Gp[6 -e_Zk :/yK<2̜D^v }Hʒ# a0`k㭚"f^ ?% j9UұN0N:%6PW" zP,w/FZZ?<< n;1 U)1s/-7< wUTˆWjs E,~ s;Jn2[x#nxl!pL?jpBK:iˀLZ]K hiL)Y֒ƔTb#)+_⒵>i%*ӓBI~{Ѹ=YT#6R)n%M9ƃYty %ő`ɆVtKiV]iT&pfvӶr}v]熽tpsG "vKnXk8HҰ9I$ 67kv/KptzI!C g֘l*pYi Gy8Y |iYsY7CutJ6m7UzȁȩrC1'Z&] At0I 9+#':aѐ`1s5%=R;9xu2yKI4Ic)+ $iA  VW1'XuY(5)$^(8v88V*F 16ӟ䩇@z vMu&z8r7~B797jh1#/07ꙏ}{)K** 8)jikryM  j Rr$Zk@J`6%@}/*FXs=aKS5 $zqB+4x}#'E=7zUR_ cxW/)X|J7=A(} `$w譡@U;ٚBBJS2<*)#;,jwG~RͲ7* y{t7+7'k/;b&ҭ-c:'v5'{/ Rb1^ʭz0}mz{$ópm3{3a&+Jsk}B%A @js6^ =x/?G-+$%t7DRdC(i7S3@p;m%,: i4(46j zeVGAtґJ˭,2t6*&l;'hqQCWCHkAX 9wP2֡%eAY[i1'G,щVF dj,YB):VBqח,tUD؛vR !ih+"DmvcdH;!@/+¿0!Bs|;JSW6+96 +AǓP:|gwȗ6;2hAsXt +̾+!q1jf$cBd;`7_6YRufH4t3I*z,D P f6~p!p7aDhCq6b]6vGEL 3#PÊǵ5Ȃ<Ȅ\Ȇ|ȈȊȌ,i7 X͋`z銤x<6N1c#- (t:b11<ͲΜD%`}cDU#oY+TLKzX*Šk*aāDiy l7D&(FgĨp󂜓C@ёnA#{HuEU{l;=ښ lXjLeנԭu1Qd@};/j 1ь uz i:G^-L~h rYs16wq~9>w6=|S#(|+ +qbXyëud}xa:WI̢L-Gurh94|Je_c> aH20az7Z?a:s%FB6aD날:cq۰z;}w>1icZyqE 1kss0#j;ål{3GxBрarYH׆?b$NȃA*=@;E8'`{*1X{;G >[҄+&yZZ|$`:mw5F!'`dEp3hpP~kRyAj{⡪ ¼[+Xn%R[Z*nn?G=jxr'\9Fni*oEF ԍ~K6>K mk{lm)gѵ}qV`\?`ɤ4S&N>NPq>vz.)Q Z./( ,VLǛh7sj1!^L,kɪlkޑ޹nLsv<ծ*1hY 쭳`R7,v5dglcclLACAJ6+R?d&m@/H*/]?םRF@h;mi|,o![H }'5y=,tIYLtwOOpK  NJ$+COȊ:dC}{/J3@(24LrlFi%iĵ,[85K)PT@\kPd+y {1"B1r[yzU#ͰRj({ú5Z݈jBfb!F[Sۣ y<$ѐ>L kw\O5h:~ː*@8D קZqo4Wk%t 3&}BL%md_s9\x2ѠBW-3F!!=PuWO:YtCCk2-I}U.%ǣ(98~BXz6 , /i$8 + 0Jy*V%`3ͥ20_L-rR M)i~ÙiG{)ʴ\ȼWM[2Xh߾MyW޹̘zS I,?.$`..Oo2`32,?6:P^̖١ˁ>5 ?;,AVc8'Bj<'321\3HH&a0 qG A8Lч-N(h,ד͌O D!?3` -ܳ lTDnJ't4*HDs|b _UYuV_$AzBXaWX/IvdmVe=!QUjYfv`k]Usa ЪK\w߅7^y祷^{\v_8`&`F8afa8b'b/8c7c?9dG&dOFSf- u@߅7rgeLLcfV-*Ǥ8R6Rjd )g!?z]~Ȳ&1jv..Rv9{a(tnZu+ +o'YM mmCaɣN\\]VH~t+<(QU] ,rIIog'›)&NMKq1w:H9bfOnzMX3:l; 8'=/NБY L7:-+A$X5r`*q0/hW50]hCGB)P b(<U! !kDh1[( #rµgI 2׋#=9_ҐQ#*$eh1agq*E|=ϻNDqGR/+f JچFBMarjG%o( -c`Ceq*d(VFhK*EEE>ete.?t2s:tX0gxKf.fxq)/kx&MnvsTg89NrӜDg:չNvӝg<9Ozn0_g>ɉ-dW jD&R.n> 7JNC'DkT .ԣyB/to,VHer9 hL551%⬘ AhR d^"'SzLydETS$^ 6z)=J6լi|i􍑬KF: ۠GcO%cHpa[A?6kd'r@&ldPEZ#Sc|u1e (i+Y!XOV;bŢk[1C}ekk0(WVB8ޅhpk0b忪+lk!1`ي:&4Wm13}r7B iw=#ڷ~q^%{0/U)\eɴi^-OhUцTr{Jxs*2٭u\ TM\X~8Wef 2U xq^* GH(ǭ\-}#b1Hkd'LywU4ّ.Fb`(nV;$Y(䑶(Р;L$Gbt*R6Eer3ۓÐ|yzi"CgZAB)\#48TaEwEz]vnb3ufO1eO[!N+xbTJ HU 0J͊BeHӆ{-G@u _5U+4bP8rF[F-\]0>Ưk)t Ulk dE<0eUjoR~ :fx}n3Ø~x.dju>T"{QZ 7N^L38BU}z}(EWp.|jltSϵ6tJx_[WDsp|m8B7nJe(v.:H*8 jkG!8}^wM9#6(OADs;0y @~*D` ~om㟏'hS !=_|pd|3<ˢsd(VgZϽ&7X) XS(O тI0`jk=9!B7AV}?.B G;UjB; +%#aG!Ft(mw$P܆3!'" *2r`,Պ1S4I- R;D;XM+qu`|zҋ{䬎K+Ŀ<af2. ATxDkbIM&7aFH`,ap( @@f1H[B- z.Y:s h bC{ͤ!E,D7ǹpR4 3tS;9p6ā9;~Z` OӞ4Bs.C'j(IYZ4 hGG*(=JMJR+mLgJӚ8ͩNwӞ@ PJԢHMRԦ:PTJժZXͪVծz` XJֲhMZֶp\J׺xͫ^׾ `KMb:d'KZͬf7z hGKZbj FjQֲke &mODw[:< eEo[^$rbc%GY{F7n7t՘x1vMUv`]>L_dd-خrMo%"Pt֘1w{FK˕gH)0y`ͺ2fHWS8֢I;]O;.$]cֺvglJ9Kl7{ۚv n>Nv{x0TAMxc4 T1MdffZaC"sPc#K<) ?P(b~!Ad˘8DM@AZRvӰW8kN2 tlB >M+taq sPFޠbBGl@uP2ă@awQHY`L#_JJEɥ7/ B(;oh?7r%HA(t3_4C!`HbvL$-vvDg1Ẽ&x; Š+(Awozt!A6_B!lD2EG?C)Dm#('tGB(' *v5bU6r=IUQ{ ِ9YIa3sT>%)'h)qPw&ޣqi88 c83G? x?Io6"HpXp(Jd b+}40 @4Fj;p~Xs! s Jrq87g3>Sג(py0)V'=NǑ<#oQxe }AіԖW{qO3RٗOo0c`f $m9G`x(:#ùMT$}PyQD&HdTyـƳ;Q)a =aEax6E (E-sx56/;ԗmx/&-20 tm׉qHuԃFf((y!(Xs#Q%eU:H&󹋡9?y!j.wkyL(o1eM9`eAc耧PsQ!`a|Ƞew6raj,oFh1u?|( {}AGdZ{!p{ʃօ$3)ywRyjqFBɑGe6) d%ZWTEExeH$8Z}8HBR~lj"(i89{ւfڇȩru FR {(0 Y.w2p!?itHzcoFOixSDD,hwE-7P؅:$?TYzFU6Q jE1)8<=ZY.]9b>ɁѓQdh!E8zL&Q$Qdih%R1<i#Sm,GIW!Xzk7:Gmӷ^[FB5Q"7A ֣y7r#ҶmvQ+8w_aZܷ!ꞏB:O4)/E78Z"~crZ)]Bp-P[ٮ"V'1l8B\8,=2 罡㫔;wWVc0y 2LXx7`#y~zM z 0 yj )p*r[x2<' hNi8ǿ'7j s46?.i T(vWxd,D ?J0GK2k7;Bc1 4f,o$@,>$eZV 7wl27*! bzch5(|s8C(gƌk1(v&Ljf,4~`Tbɼ7pǐFL|9;|sʄŊʼ<\͖oȕsc {,rI7e _ViOq{Hkޚ)r©H28;>[KyH2mQ6 3uL;Ui=Π82 |#*όv59`Tj1&\X(|(/}i"WCdҿ@LmTx1kc(']5rHJ9q[-v%,T-B!ۨ3NIh瘧t#.?K$ݡ(Mf@SJk a+˞aIJrQc-3Bm:w[OtNъ헂 ӲI+H;R$Q&S/uS-/؞2sI2c/!{Bʝ83LMB hbBrsCb(;6n2:ɱwC;IΕZ&w:C M P: oۙ%ԃ|m^}7`8;4fh4AzzlJjOl]+vy FGBD7EˁZ E /"nnST-E$ࣧk]8rB$Œ^CiGjBTu %mJt. p_2!uKT:p lᏒplcjUwUNu]QFH'˾y ay'^ϗ/p_THiQ ҝj<  "?Xɚ TusWX!j":B _aЀ u7?jmQ!o BSo(N7Ooo?}&9o ZoJ,rJ(~)g20Re[t$-~n=Ipk )۱>TFူ 䠯A~4cI@JF8@V0dł^qr$G)m"`0lB ZNMR.d҇+#; M:JQ 82;eOk!@ƪ";S\U'*,:=L<#% G&e%DC儊b ]Ѯ U_eXv9 hUc-(]},]T!~RrGQ)Ѕ!8ł'^`1ؚߖ"aΘ7N%yI +qFME9LhF:ifj^ޛj:kk;l&lF;mfm߆;n离n;oo| '%G:7V r+fEne6js]8'уu+;R2)'#6G {xqKGǖl,H֚ox% W<{j܍ g!ٽ eU$FFԀ ``ԋuxdà¡%kR^i-i%'I׌RqJ܌2Q@JC>Qt.E8eЈx{[" N'7-Mx!ƙPo5cR#n( A4raIKC(_*SϑMH0&!~cHAHA@rB7vljUP(B:@"Y4 ҎE|(+ɔUXK=9L!wɪQ_ԓE(@*+2"OŁ'6IA3ђh F ?euꕾ]jN~h;wizB40E:,f?%i~0B^e4fpg4g9:QqҰN*rh?K:S4q-iNuSԧ?jP:TըGEjRT6nѥS:Uidp2J! I N : FE`WuعdXbhxO0JC5K5.ۙvEl<în!=1iSEZh s:DӛJ;ڹ- ja ؽE,*h 2`[n #]@)څRq4ӤkSVk"&wG:ѱHs%i쀘((B3@uՋOq! y25K*\j!Ŋg8l A`D8^x[eT%k`.؀K D/å a[.#ҋ5%N݊*?*8E؂5)#@qƳ=?wt'zhF:Њ41=7yΏtHItI# U>RSZ3W=k˵ў6@iٚѦ&y=ЦuWȵ=m96M7kvm?wFn?;mg nu-yԠwo:[G87|k /t>qAxƏfq?c\q\H"3M$/ye>7y5;aplus-fsf-4.22/src/html/DefnLM04.gif0000444000265000001440000001522207215453030012510 GIF89a@fffff33333f3!,@I8ͻ`(dihlp,tmx|pH,ȤrlnШtJZجvzxL )|N~wk8m'}x yg@lsw vڣ|⬺N% '$iA59 % ~볰Ӏy$N 1NC=\TN; SB ʂ *SaڒpHQA:!yDOGK?S7MBs +KV*1@JM`HSe2% 愛P6 ޼0uHac6*y*ʻpItuFT5fF6I*b;".K~΄ľp9_ʖ)`?8͸(j]=NrIȵ{> ZD_x95} 'N|jCT,@xwFXz GH2ӏȴѣre2Ǭv}@!ByX}HF-%Ƃ1݆T͆QUe yNE*gYc!Yg,3JلZ['C!I ]lpȆ`u4z-Eۦd>vUqY7DQjL G#:D!g@x;WP=ͩ"cXb誗%ȶSs|'ZqZLgtfM;\~]w@^qi-۩gvoVh˯ $ bv*}TEqKp=$Cjsi85DrJ?Q"qAN;sMt̴&&ʏ͡C5T_ޑkn%E w߱ߘ6"[B[>E:5%]qS'A.SY(o2AH)5KR6 y膁Of@#gh3XȪ=' è zvA8T[rp(DO †Q(y  >S$!F IJZ&Ţ@ld&7IJ[t2L%0FYV"b7,gIZ̥.w^ 0IL\2ΕL2f:Ќ4IjZ̦6nz 8IrL:v~ @JЂMBІ:D'JъZͨF7юz HGJҒ(MJWҖ0LgJӚ8ͩNwӞ@ PJԢHMRԦ:PTJժZdzTALNXz쬑KUNnHDQ;4Ze@.}AP x-_ Ԇ9kG26(;I.01BYs4kv<ZR"Eujep2Ƀdo;2zgVL-T+(vbiMTmqu{Tm8auLdsjX(k>eL.nWCČ̳2nԌUKvvuLWr%ȯEdFT_t`XL6Yrgn &lFL(NW0e,@U8αw @<HN #N_|טfrzU40kGJt<|{ (eO+ stqpI7RR"uWoj?|Rx ^t%KSnCVx? 1yi+<*} G3s/߭x~}ܑ׸~{F|'|.ެ %e}"ۏ~}!)!!Yr} gN4T iL|rfIX$XCV{P"@eW*gp.1H2X6x}Ђ8<؃s@>BX@8Fx~HLx{E؄ж$POhiA(WCYC&b'F)HFhefihm /og7 tI_U)ekQettp~iu X8zAHnWtw7 dn2@ؗk&kl').7~nmj頊hkjz&@^Bmn|Qs)QF؅wk‍svtu6gpASgr |7HA׊o(\mďA#AX%GgkWG%8Fw<fr78EjxX4*Ctp$}8 wut"3xI48#3K s[7|s DlRk3l'`c)I)Ʀ2%<Q79u>I8[$yrI1/p) tlwqxwXᒓ&:ÐkA'qu oVs6ؐu2d3h48r9 i turlG|p06xCxّɚa=.)8zu(ɘP-Ȇ :)svwiHTa ;!vSge%I R87t7 7DA$Dߩ y3kLɔ vRB~iO tqk A ;v֜w8rF8(f&d(7 qS)*ZG9<8l~j.Zf=J)UoLi2*뢙09θA)n?ӆ/$g܂Wʣ+7朡hQQy &Y33g:}rȡg|46:&Z&Xpzu܀m| CA{z diq1n9%JA~S})u0*qQ{)u )]~Zڢؚi")0EB(Sدh;<{d ۰ :{x+ ۱ ǯ0G@$bdR c&+$8 z~pBJIVc'<+D'jJ*kqXf/CwJ J׫ ^Ѳ(>B@KRmK}Ϊ)~r8$O7\Alk iʋ7˜|۷~ع3 jJ\+s{ иʉzlEi ElWsIOQ){zXz˖&ijZ|8=zhJ0l7 z0k(Y{z熵+~{r6/ZKx{Af幡(4l:ko,*wzw, +~:{d".ck!Yx܉.Ķu4a/~2<øgj"m3pط fAܠ:y7͖@%A;j.v|/%`kx|W8 jp6zǸx4Bh7)e|Fʫ<=ֻ㺮O ~ykɁPAZk-̗riܣgpʥ*踪% HywÍ^ˡPɄ4Fadefsί@Dgo;dZ{I0_̾W;d]q:ֽ|I| ݄ =sђpJ2JCb8fdȹ,qc*mz 7HYJmηjy$= E&ѭ')~ZQԮYK՘ɼ=W쫘'jh *:{4sD~\l%WCkt&%Dײ,8cmKz Ęowtvq&R`q]4ڹuvܝrʈԐ´tKn Q̐p7ڷ+vQF ׯwMm{M"H}x ȸ%+j\kԨ|M&|j޹k=i =[)t֒p۲Қy9*9  70|s'M4[*ڬh4 hZ0=7/'_]{٭5M;Sng\ՅckHE8i#_:p t ,ߨla$ٺ^4? =E=pI֏)UkO.ceή)iչ˓fad)gJrNGCTٻr\i\9w/ޘ2csCj=%?zG!sv g1* sqaۼY)8V1E^<p^Al :> _r@Jˆɘ)᳊pM93 Ԭ| g8j4]מPAC(Gs# RH^79$1f\[)/vi*3]QACq̕x@?t0y~XZ\?f|jenmrm?veuv@zeZLNkk-D}/ m^* `׏wz?o {@#ﺓgtbcqόagH BJ [s່lJf$,߽If9+7*Q?Ho8\2(z;BH[ΧnFוy!(Z{4p #O+%$LD6oxC&KfFSpbՑ0vYPPwTwˎWp0[osa)HS1れ|KFNڪ\jM3cMV9"{ =+ExV^gowaM6e*.&S=~\R ><,:i[(w->bcxRJ-WR଒?&u#I.|Ls pJM>-KXVt6<~ Eb͞m(ZmJY\u⦼}n\ F8aō?yTɕ-_q˛Vi}9hҎ)b.N^Kƭ,t^658+'`nnt4Oћt㢫;~L"zHX;Nm0|KNB>+:DC@K@~OKX.p,ydq'&A'c-8\9)Ù>ʷ$+϶)b)4!%ȇ8YC!qL0e~dAa524`7b4 ׉ NB:! Aoh%Uj{s@U-`$Ӣ+٣PBpBbtjW ZoJ5H AAI6RF[]UK:|Z%ҳP֪qڞ=zSɣ )D 95 L`\@~2=ak cK]ضnYO8Z`+07ߪQgX/<|̀$4 'UX)']{#RAHS1(\m&cQmY'" 4`1I!gLPYL4}Ҁ4I3,_gut($_>w"Lu4Ĉ€/`'$f v- Wq"&T"ZvA_pNYr'DSZsSRe瞧O1ha}#j`sM˞qC)Knvzxwֺ_Z)h@!JGlɒhQDfs肭3>U͟񹏺% nQb%ե̰.fL8 =zR=g+/.()a`Dh(R̯jAq"J@[H{iHkKb*.h? D1 ;y ECQc](Ed_LE>~\2(FB`4"H: $'!R̤&79Gb (M=LeIVte UIZ̥.w^ 0IbL2f:Ќ4IjZ̦6nz 8IrL:v~ @JЂMBІ:D'JъZͨF7юz HGJҒ(MJoXr0Ӛ`cNw0m)PDM zSQeӶZul U+!Wǁ5 }`W-Z$ch* HUlb"BX: :ajo 3:L5(HKz: Hc-*1v;sƷ)k6*t=X lqH`H\ ,*4{hn/L-wS|*zu,\Tjx!lg{,FDP,;r|Bt rPN8$+@% p_W lWu?nR%eprXeXãAa5Bbx -NPcl[Kֵ1hqc"O wck#T|Ւ@٩а2?rGɔx^UOmF2w**Y;X3խΚzOƆ!08YF8b4CbK;π,O~b1+^_؎t%|qf#3 TxGߠ?Gs8+c-Qg-+l&zClvka2o Ācmb- (=00bBڣF:0q@na(>Mv~ @X#PR8TXVxXZvgZ; 0 q-8MQ;4F9n/&kE^qU3hזw}4h4dj7 A)e]X@Vv vn&pth&mߦdDPRq7a1#HQ!zVI vd P!phX;''އ H8HK|tn$Ld SlՍ:،C5cwgЎ/(=(PӘjXc"e`8Szȍh[U[_9 cQo#ZdfgmX;Al؁IxE{C.gm 1tiE,)ꡓtwQ0iF#1mCVcnۗ.K)%T 7@DXeQa>&y-Ƒ~9ssW)~nn4TV4 ?;sx\+!a"&':2B WYV&W +n k _غ ڽՂ +̊b3HH눸;3 <\LEQY5.hh 闼 anjM'X ؗLd g-Ȫ:9y7mCV}vpfaA ?Hw|ԦsWG\R+-Dz~BkGOuE.+c]%.t۪DC{T'DaGg; h33<ء(-SI:(H`*B;4Kx,+n1V˥(·;5w'{'4 ?'y#sғ2,Rؘ3l $ 8Y"~r3 4SC 3h@m!6 ig!*dl Q[Aݩ!grAr -[Ju m&G YplԼjҚwӧΥZB,w.{Y tV-l2{'s5n=h/-|m4 "8T#'_f[|w3٬xs.(RwC}!5allţCp;K2B%!w?D6Z\^`bIUD*jHVDv,Q$TUtx#x}氳1k@NGB?xH& /@f#rnYI^=u8tFFQ. M`Tb떋]&`VsdxEӦvEa eЎ\aLMZ}?`zGNvez{HkyܥʨLCW}Rm~4!Iarm9(ؓ}y9ʵwÈBV/q:p5 K@DaH }Ra!a(F7䑪cUC[N"%9=}Y<Ȭ*įL7^O Hd:a2D,kOQgmN?prBm!O[b:iyy LA. 2L.wQ4 , М)%"}B ۞͠AV3Piqw 2/ =_j"\UKŬ-=ءDa2 ͅJ$OP-HYi3J~!%48ĈiQE%$Ӕ[ZRˮ|2.զ]a -Js "7]-rb\'BT 5o7Bh\'[jqB 57fZ@z'AĢּ{aj,£_r!F~^ ~<|,|B +pt"~̯˯ߨ!Bo odfA'` L/C$KC9P W|1Ez4dE/G`*x1H!$H#D2I%yo&'zrI)J+2K-K/3L1$L3D3M5dM7߄3N9礳N;3O=O?*@%4Y¹#rFD7k?͙k_\UivycIxokcX`Bjwƶl;@hE񇓦[dν.[rGfQ WcCձW+()F}#[ĵGћItD)Zܒ3[Ψ}ԟQF:*:"gU?bg>}1uq4EPdBgl}J;H&1|;H#݁"0^4hꁝx83p GRIІtbT88& GR !ЈGD D&6щOb8E*VъWbE.vы_V"B0?y1!npp1юxsd$ QEgB fVCX52'HNZScz5}AhdEW*SuA;sa׵%)Kn9gp hy .$c.)&P>brp5Łs^K5tl37]uNMF7`xSgdg@͉SlBc^$R*2*)1F@5꥓Ql9ʝEE A!6o/5IyCV$q L?S7 LB5!š-G(P8$.Q-V)DFxTcEk'Tխok\:Wծwk^Wկ,;X\SXR񬍅YNl˚Y2,-7ZҎE-&Z[>Ͱm[ַnp;\׸Enr\6׹υnt+;aplus-fsf-4.22/src/html/DefnLM06.gif0000444000265000001440000001261707215453030012517 GIF89a@f3fffff3333f3!,@I8ͻ`(dihlp,tmx|@_`H,Ȥl:ШtJ-z-znqM|3H|//F |  -F yƟF {a Er@Я;p .U 0$w%p82jՄbƁܼ_{ W\ñ͛@{+Ȑm+Ί\5 ΧPC(qFRɡH\:Yl%ٳ֚T˒jD H'TIڿ ( RJvN0]n0pkKJgF&?1f):$-[@WA" Y۸skdvm4 ĀI+_n9MУgtTܨν{)e_ӻ1Ya_O,0@~k]U d5B9jNFAh!bT+(jH*$@kƈ-`Ec΋SIk,Ո$0ZАU&9@hH%BXvDXYxd* H)9MB![(,&Yeɠ,Q3qʛPc'Xg -:AWFiMz;[NΧrΡᔣSA^j,&G6*Ybehe?vx%%w[i$(o풐q^^u0RISY,~tji+ dkضb\jRBruo',^0&U hikr ֽ̥4NA+仜drmLqW4Z0񮗂Q3Yg&0dy@窨:s1qMZ@UIY3Bh䲯Yum2J%r٫y kawF4zBՑ\P o:Cg[iVBT,6},ˍYKTAz羙x-.2 J&~ݚ2^(9&J_*w-ê: Aկ4*\2W xҚtk Ak*AC+AL+l=G_R>5SGJB'|Vi^x=O+? iQ GI# I{`qYkelV@oYҘD aQ3~iPH< ɸq$:&dk)*ZX̢.z` H2hLn=(M:XPrD ̻f)9#9К)@>ِIR[jV%2T,v &u:ڶ7p~#^zCV5Umm%s*L%OJcJM)kTN1cQYHG'!J:c\2(Q8rU_kJ=`I^NV/ rUƼiL3#iRd5vd[pqqO7(V/j[/wS(+qޖh`9\=]׏vtZ%xBsV4Ox29yɈTrCqkR 5x?!6v*&dDTB7URzVԣi62>Zlcl "MWC Hz*z-. Kf"8rY:4PY3nH>%"0:rOC;󬑹As,k)oVZP ?ap(E$+PC] ojSjl1S(Ք{@B:2b#aXðꧣg`X" :"24'7O9 -`Q:GԍRtV#;ZťbrQ;<*!+֊S%R"UYʡR@), %w%AH CO@y<uHPMo+)s6BMGpN(4[2p_ wNaHJb $yKs qZru4m=zۨrH5#&]IWLP1 /pSnxu䙇#I؜)#ck5yTrvpo6C.K [H"C3AY)5/\54^iIw(5<Ĥ;FG9<51k#=yͿ!vN=ٕi5l5 m u3ڒ=ϑNJYME9!!nչWבc=:(R4&u8l~L\Vh^)w\-++09כauCBP حtaֿ-iJ<nnP-Ql0p]A$̱ ">$^&~S(޼7΋G+bZPR:7vqMEM%"k+ )1dpuQ|p9j"|hnR4BN^k҈4`-r+:8I\]h/2Ж Қ?6)bl} |_"M]~7r]1 X3T`>|s~ 15Cpهip"$ͮ>E݃ԋo$@ێ.~n~N_#( `>Ep"X?"F ip&h`2$Cp8D3 B?F$_1CNnhoP5و'Xz8qA`is84RKOBdpn ﰭ(4ya wdbl7dWqi yT6ޙAΜ@_}!_H̱{,\Q=hP7Y`IZ٧J/\Cuqhp] 6nm7-O<#_DIXie%%R 2Y >"]_#`lI!z`"e}%CX0u ΙSA1T^s"VhRL~`7"v% 58-i=(9D(H)"(e)C'Or>Sxަ/ O%^ʌ2"ʤ\sJ`]N:2+e4#>Z]ϐlI?k#Xwj8I )"V\AnʉEiL '_uXO0)v䍁!‡I>k_Yhh4%z>hyڌ-hIŜӍ޼ r:6/RЩMO 'W䷇6!Ծ*U#:RS S 2 W +K#Y$$'ԥyvkЎDͩv- @QrbgSeI\ ҟ5 =irm"!s}OKygHZ/9=Q0' L`dxbJMH΃vҙE#XA}vC!L-VqI-4J~;~_1nđ4MzL:`։S0!Kz$̠7 z G@,3! W(!q! gHv 2U]*C*وk1"6tr @KˀD/%:PƐ$=Bk( ࠮1]obU>ΠEdy|i2 q#mj%F  No_6_X~Btʴ&Q% SP3e=i +(7,o?Dx +AhWSDy(A-^ު{#I\eTw'D#*MO:޶0bz8# )G.@#g9#rS3@RHd`h턑FkD)я8F$*YSF ਇ UD&:bN{d\:BL@:wo5cP's2>T FOWŸj2v>JZf-F 8|ua&BрbHv[`}=~G 3ض✭htVs(fƋ, K5M8Y<}cEY*B 4 g[9Onm: bSB+ \GS$5nۆUub"RK6qWm $h$['-<5yDG[ZKW~VW+NV+a&P%Sb4]-(A 1zU#aL qQ+Yw3&}Y@2֡7[N5nsm'6B%>+[ZUF1-Msd&D56㝀)GrZQDj!f fbo4! uns묧2Zfᒪ֋oY (gp`f=[:Z~YZe_qNoLη&a+F:^&A1Sٓ_^2l!z1ogh_kdSI#Q ȫܑ=uԏ|4?f/OXf`XtA ؀i)@{Wcefl3H4tJUd+ }%u2 RU9)Gh4F!vbkp@/؅F!%yh2LLni=?tr3D􉁸)KraUrv / Q8JƂU C"*P5{0I4nd3U(O"h_@e5[u$d?k {6i8rQP,GvY S&g'];2%y"1/v2nrL0/c2cxqF*#ffa&ND6O6+.lq*9@&H3(F]vsX`f-0xi=0-yDV"Xp)es#"xVl$ٍsacؒ#lahDy4QI(Z}ЏF߸7j޷hW NB4u4P]EUؒZyo&}u]7+REikӐuq>,4)Z!s" $QWA[V=W`Xj[$/&v5$Y'XbV>N;bXs|u<fj\g^EJp2dT4w>as\%W /{`'5(R2+w0Y6|i|ߴL'imNj/Y}pIxDy+) 1+ ʟ 鉀(`kGeGp:wiEI@]tVVrã>p?6.3F"GfJʤPNQZ^0aZX[UХ^ 9 djb$:jc8 nD$Dhij')!;3p8q8D:;7h&J Áff8b>}v$T?D+0bCpֈQfE[,pM0 h55JVN-ℏ#Xv "mʈ2u'ƈԜsuFf\'l zBFe%v16xxiF;b'@rHڧp#ƫɂ tpe^_1j -:k\4&i K"62 syr2Lp>:5>xV0vh$I4@ bʮߦ֕mrXɇiZ0A2cSЬEeZc@ӸmeCu։NͰn؜BG]e17hd6%֏m)9ew+0 lpwY3Uxڹǀ#ZQ%qn9#JRzWL@ O6&!t۶;G{sֶ[>҆ZE&c6 YPBhViiP.bQ-l!PܑܪhcE]s.6kb˓"HRX8d1ź[ Ox"C[G3T$&#m󵫖&k-Z@ƭ(HKh!fpZ+G PhYv?@1ű mпXw֔FG=',,j-qz)ԉe@\H=8Vqb\A8h ڡ]οR6ȳ4>7gm3D:پ1=ONϋ r rE]5 BEvZ`@>ڜ8kQlpEKHMTL{w#^ m@~.\XL3j_ "Q^6Ç |釐zKf/깫,j,٬5kBZ~Gr'RlMɿ g61ۡ^+v3& .0Vյu3} +N[iہ.19kTP56Lc66S5 /RRG56QR?0t %¼.0U:46K:ob\'g*OQ*HcK_}O/QoS~LZ_l]/a߅J_;MiC>poXqn[A@**rBvP"!LYr&ys(bO~^7.Y-_۫:ʙh39H @+0~ ;Oo:/R%ll4mQS 6ŐʺCHDTیHyҸ1񨜣d+NrZ]B_ GA:m6աH֞zxܦu#/`8ۅ"Lgx".܍9oG]!WrIH@DIIz̮ӛ 5VC*VEɷjmqsf!'6w2DZz"@o觯/od27B;8BM`7H]xf KUf2gCu> c-Hx,.\ #5 7\D7bG3(vc=WrcqZ]TC:h>袡@)HU4; slC$2iS.gIo!6D* cj=lyQ[?4- "c-$D 9,4Tv Ηrܚ*:MiLmA.U$AÈUሉn:0,Q JdIX5$ 4kqzN =nG S"3ʑ3@ {jmVa'$j"[f705b5!fͧUVdٴKۀG8ͳgDYH?!XfGt`4 L-^Yk>KSDIAl!.v.^ap_zdaUڞxmU6aVO2Ki4tFMe /T sndv79.j(y(iԲrTii8KXAl-.s/ժ"696qj_վ4v)K(XۛLW!7Q1w ،I&h‰u&-9ҫ T"V2[ݝJzxbr-IU;)l<9Ueb\Y*e, EҎDŮl[Ttɹr8p0.9'g89JɠNE"Y]$8 +ZF(VodPˋ'ĦuO&u~ؠC88D{l@wy-*$9q`TN My61R Bqrtqdb\}Rk&9vO'1He! 50Hy2-ga2@Hs5h]hw"B,)iDhֈ\&\^dv$T`` ElS#x(]%%1":bQl3B(pDqif.R0d6lAKT)`.SVb'W}Hrߔ#&9aJi:?XQbNuiRStZvCS6/٥C,gEGХRڦʈ~k\S}v)nUlfڠ5"NMQUCt{Bd4;7Z$BJ zjb2U)'GD7XAOe(N&Z!&=:##RomC2(pD[iz[2vF5X1q29Yݸu)y ozCK;Fƴ\~L"_J6 >sC@& ӕ%=*d\0\nUk:`{Ů0 1xO@A͠%,I qrDRiZ.R;RHkTMF~f_ Cb90ObD;R##`;vjr8irxtZ@ H# ?Yڢ1ZȎL<IɏlɎ# #J@`ʤl_ʮsl2lpD@E H\gS- GeLBA</̼˛l+|q%Ta\@PY%|(Q|͸y!A (4tI@ũg;BL\^~ ʻXfR vUnɘgRq/x ! Ә$꠳KiS|ݐRji$EY.r2Pi.vKwD/!Yaр`k8=GC< NMư(EWWYWzR;g`ѻ>jd5R .Q\o G% Kԓ a f35a8DMF)IDG CTl ޺Wv;fb#( '.@D{ĺm@aMX"jYHU !/W̷,Ⱥ F->|9s z|ޣ; G!Q]Mq00e~ ^^- >$^'^y ⺷6zL8A= q=\ӛWg5Dm8hzJAMz۰gS&g}[u8Bm@HЇoNLm aКgn*e@7/y\qy!Bל< SaD޽*4U>ْKWߺpB错ވm#h lQWYwV)1 ` #F^ MJ.3_f bq>eW.ש`ݾ ߺ`~L?_ _? 7#z{/I"?}_x(?}Ľ,./{)48:<>@B?D_F;aplus-fsf-4.22/src/html/DefnLM09.gif0000444000265000001440000001256407215453031012524 GIF89a@fff333f3̙f!,@I8ͻ`(dihlp,tmx|pH,Ȥrl:ШtJZجvzxL.S0|+v5t"o3ycTԩ{oAד̯ΐQc;GeCpֵ]]XǏ$\B1!XցI&bIrŲZA (#e-]ƚH&|x'Sy^BUuGA?K2@Lׯ09(6KSjʝKWQuہ߿ LÈ+^̸ǐ#KL˘3k2s\'E ?X˺YVN݊m V̖hC#4,@ۊЕ1p!n򐬠Myn]`z!aClլZ='XhA{Cd~-W*hsj w)Ǡ%uȷ^~?ǝLR|)S%Ĺ VXVueH:4w(@RHEd:P@%8%CuX0nM)sXqn[A@**rBvP"!LYr&ys(bO~^7.Y-_۫:ʙh39H @+0~ ;Oo:/R%ll4mQS 6ŐʺCHDTیHyҸ1񨜣d+NrZ]B_ GA:m6աH֞zxܦu#/`8ۅ"Lgx".܍9oG]!WrIH@DIIz̮ӛ 5VC*VEɷjmqsf!'6w2DZz"@o觯/od27B;8bM`7H]xf KUf2gCu> c-Hx,.\ #5 7\D7bG3(vc=WrcqZ]TC:h>袡@)HU4; slC$2iS.gIo!6D* cj=lyQ[?4- "c-$D 9,4Tv Ηrܚ*:MiLmA.U$AÈUሉn:0,Q JdIX5$ 4kqzN =nG S"3ʑ3@ {jmVa'$j"[f705b5!fͧUVdٴKۀG8ͳgDYH?!XfGt`4 L-^Yk>KSDIAl!.v.^ap_zdaUڞxmU6aVO2Ki4tFMe /T sndv79.j(y(iԲrTii8KXAl-.s/ժ"696qj_վ4v)K(XۛLW!7Q1w ،I&h‰u&-9ҫ T"V2[ݝJzxbr-IU;)l<9Ueb\Y*e, EҎDŮl[Ttɹr8p0.9'g89JɠNE"Y]$8 +ZF(VodPˋ'ĦuO&u~ؠC88D{l@wy-*$9q`TN My61R Bqrtqdb\}Rk&9vO'1He! 50Hy2-ga2@Hs5h]hw"B,)iDhֈ\&\^dv$T`` ElS#x(]%%1":bQl3B(pDqif.R0d6lAKT)`.SVb'W}Hrߔ#&9aJi:?XQbNuiRStZvCS6/٥RXomC22z3@] PA UR6[x_ݸuK[ c[=7:j1Ju` kjԡj0K`yV@$ֳee8 >sC@ e䋬d\\n;`{ŭְuT!5rO@A͠%<8Mu=eI {FK*eV 1ʿ p'0"a)R;RHkDvT_ CF짦ڰڪj8^f#oy'wMRwd:: F@{P(zǂ<r: :Ȉ +,<ɕ|ɐɆ ʠ<\L}1l$ dy{I𽉤@k1B˺l3A?MB=/)}9{[\\!(fi7;V4Sc4`؆,քJL:M̦}JגF/n6&͇t<إJ DD;d@Xo"_I0mǽZ8?з)@RY{VCpUP $3݁\@pi!E17# ~(=\#!@pOߪ M N^ᑑI~!bP^Q0E$^]ǭ\*.,7ıH k@aDқW 5fІ ߰JqF㚬z!c\ݣj#} Z``w(Y^tC 5 1$s:tb< S+|>NK `%^LP5y۸~qq%ñpBД)zm#h M Qy+*PYߌ!#8s >*gL4~! R^X`ABQZ4,䡌F װ<dl0 !hˏ\o{?Wz雷Or9'?bpq*;0O?y6;Xx(B/_H!%NPR?T_VXZ\^o;aplus-fsf-4.22/src/html/DefnLM10.gif0000444000265000001440000001145607215453031012513 GIF89a@fffff33333f3!,@I8ͻ`(dihlp,tmx|pH,Ȥrl:ШtJZجvzxL.C0|#킉v5 t"o3 y  c Tԩ{oAד̯ΐQc;GeCpֵ]]XǏ$\B1!XցI&bIrŲZA (#e-]ƚH&|x'SPy^BUuGA?K2@Lׯ09(6KSjʝKWQuہ߿LÈ+^̸ǐ#KL˒kϠCMJ^ͺמQ˾۸s[{ gݻȓ+_\Уn>[yF'`2_s?ywQ7>Xlǘ"hp#x{Ŗi%PW^}`~>v!Z^Web jXX#%v}c-f-XF:ٝFI!YHx*C!bb#c68_6&OISb(㞈io9@m :Z'L.Ɉݡ9Xx i x&#ވg5|W(~zjbjdaJ*l&|"z"{nfJ:H݆ د(nwnz9hf)byjz ~jp%FP@x/ ouQ"L(.z[q[f0_Ҫ|X7~l {Ihq.mKC/}>*u'5?4˳~pΫiƝݘr')#tLvu3x)iۏH 73^^ y?7x9A1'1 {iDֺ>`庇b\'7p&15hɂ\( RtRHtdVLnL]#*4\cO .ɓI%e@h2iV$3y_C [g.ܩYke_D'[is !FC_|M"kq ?Sm2ZcٸƑӀƨWVZծg}>Xָεl^5MboNa3ЎVQ,j[ڶC6ijs0kzh"wX d?_vX^ BoH"Fk$TKVh>F]qʸ4p]Z'OznP -[X&}A,/''(Ok:gR>" :uʃ,(j_wFZ^]q][y:u#W֣,q?fGEmbnPeoR#1˞5iܘi1gK<_ #?wcdlH4h??\3k*)un/P 8Nfmthsɯʞ&W.iWye1, Kv3 {?md>Da>pw嫤ڙ':~5s8y4x_W5vvZ Osyd$y ~z_G4>@XId+PrGOwCn0+XJd$Dx_r,Wfӄ]gI0n'5qsVB83k(@8?>s;sFpݶ|lև X>xޓkXՓ>g˃D8cgcC3ƆKxO Y`@!E6zB"vXpeц?b#q$qQ@!7`C%@-x H|q@(s%Awz#d7m۰ @`1 Jyf~Tw#hKwPsDǴM(dMwErWftE$xMMsEYmppP *!V#`g[-H&h[|f*-bCL-+!%;ɂ1S*RangP$%qĐ\Bg#ȑJ BɁ8`"Q l (ُk0m xhv5f^RuWFEG*3!`@&'T&7QxT] À"A}a y x@ya.jx4Ɨ3[~Ie2"9r|t!8XpPm%w+Hj~5S"ׂ[DcK2#&//21A'~rIYI5c7i p6 iwa{/ `dwd_6YtMyp%WZm%H~wr 8 jQ68P2D;`X(TNu}4 3*C8ndZyyŧF2RUp]_Y?4ڝ8.`>+4cZcbVe|$K y"|d[iedH 6L$M٨H@g9Mrk.`jb33%6Cc3:44nJ,񪜚]Ε:C1 J꫉:ƬJ '!-٣&ƭzފfZ1"`Ѯ *q0 @ jŭkי7}֛jͬnmm̲ͨ'lƈy` Ca@l-uL!̡AӛɷRPԗƗO F!ʿA]e ZmbaJP@m{b֋lkz}ɠLׄ]؆}؈؊،؎ؐ ֒]8–G` ٞM$٢ԡ=ڦ|}ڪ=ڮ-ڲ=۶M̥}ۺϹ۾]Ɲʽ=]}؝ڽ<;aplus-fsf-4.22/src/html/DefnLM11.gif0000444000265000001440000001302507215453031012506 GIF89a@3fffff3333f3,@I8ͻ`(dihlp,tmx|pH,Ȥrl:ШtJZجvzxL.C0|#킉v5 t"o3 y  c Tԩ{oAד̯ΐQc;GeCpֵ]]XǏ$\B1!XցI&bIrŲZA (#e-]ƚH&|x'SPy^BUuGA?K2@Lׯ09(6KSjʝKWQuہ߿ L+V|ch#?LSŕ3ksϠtN-^ CN^hmPo5Cj֓-VS¸DkaEwVD~ .Y#t U\ډ>CU!'4GYRKOX2M`P7Y rJ/\Ûuoݍh p] 6n~m& O<'=)S% VXQȖz H:LV(@RHEd%:P@%%CX0r)wNSp/ O%>gb 2i*^}@Jt:b~AQhIZ-3]mLȖSW0$v,J-(ȯKvz~Ribb1o5" 'ļs8+%)gq`7e#&@-{39@ĮqBj3H @_|0KOq:3/RЧI[.m.A&2T ZHM)HK"L$\2dAD-6L'ݥ hI^˲} CI6H ''i@iTNT.JXfb嘃J0l~σK:;pHZ/yD>_ zEN7̘!lDHVLəʼn*/@"p[epX &&*JLlB̐WU/9^C'Z;Db@]PCB(p ! Ϡ.4agb0 6ar°b! !4E$ղ3%@TR `nm:qH.I$AѮ/1 2h+*Kt`!c-Hpt> !(9u\(@"ȕۤAڢii>Z<E,0u8=\bϋ ).bsTɸ1d-*b~qcdxz#}mA8 3f_,Q3c`شef.] >ht#{\1KRw O4Zm8Gv}FZ٧XI>o\w!@~@oc?59bHAQ>CS\% 3@qRHcp]6Ң8L>jNc@!Na!Y@cnjD-CI'wqBٵ+2a>uc<9mnp,5[WұE mItDD3Dn tIŁ1"hk ^&T2x)6Ay'Q1]LV+ K P;LuH0SYvN_P(vpuP>FIa6'*پ֝v&~boH)E?}X-..4p/.uL=dI2ihaZ5XÕ"$l h-הiH QX u G!&ix֣/(`)JP*VjSr-bDDv_(eC'Ïox.ԒI1RP(_Y` 8DK27-ŵ@7B3˺2%5V[hS3%)V r0duYkqY6+YB-Q-&j4Qiϖ{FeV3}Zf ?Ztuݦ5I bElه]9+SON ؘs8/0&/<گA?K긭>"Io[UuDS Axuj:%F-: h;]#9I|O ? O͜D*d܊zZ<K}^KN@P<^c&l-R9z"0.Z>`%tQLJg:/"äH{w0J釗jOx@{lRM*X a8G\8z48mrۅ/8oP# H#*rhNE: v#^(JF\/lLQ<8]IPv;I/-a(Q}7)at{l?@Kꓟ\D|ųG}§|psGta|UY D`Qy Hh8#5%(A!XC)B+Ȁ'A-X/38(587x9;؁dЃI >JR2(@)|#8+ Cf)\Vp-uDA *Af؄8Yj.t 3&JcotD[Vr&c@$YZƖ@S,R1?X/iwDfu,P1\6)p'mt'f ( Ini8=]əѲP64Q(r7C 47m o$+6s`D ]3kj(ו_\52]o&;:a!;^RM%N2s|ѝm_.@&5eU=áK^ݰA3wv4{stu!Hpa8 0%jKTeXW"Xt- jr*j{&8]~QVZ@i\*hR6r b:&^*pPJltjfä褥^KkzpZ!^ꦇJcMGh@ T)@~#&P"B9a@vx_AIDZzúNJ JD*Jj׊ J* zjZʅኪ9p*BPqt7,:v!NqRN(/TK)!Ћ5@8 АQf4%sk8Mҟ'PgɯŖb*(6F$@q)cӺRHpFY Qʳ, $ٳID,k4pM=01O`#08SW#p4d ktLEifs9U.s9g&K1KwBĂ{Y0ySzKhHX1Quy2"=T4\TٹKD[D +WW&iBo@tYUhO&W O#3vؘQ_ZB f{ytW{RwsO; v<׃(v0Rf9 ukYj=wpw2>iuFM7FU`Q(B+-50ؓ1"E\LRSD$ @B +v1U=5Y `plJO/҂1Z,CPFo_ rJ eN0H,h-+G;9 Slrb1s42b?3Ux5v7E6mײR {( 'p$#0#udZ̴ kMkZ2Wt|EPƄ,UF`{ŸB.\ 5\)ĸ4vLF2Imp)Fp $$EK& ɂk8gH cKٙԒ7Eo4!Ȫ|6ip@co[U$jB\`ٱ  |>=XJM9I= 6̬p$-@Z1wo;U?`{VG~V௝&.m&(mY1N=0i~lNNJ?x?]?pq ?ہ~ܰMG^~x =韠-!62F 7>^~븞뺾Adx=V^ ٿ5T V} ,Y= ;l>(SDXŭ/IPm@+H"Qu^a%Ŗ.&_Hmp6}=2OP\h"2t y~dA\ 'I&&.(!4m1@Lf˅*s%0 NQ!\u=2]0F_Vp<۔WI&=Od%O65ce.NY傖q8.!hh?!t/E"*_q騟뤿G"W?_ȟʿ_;aplus-fsf-4.22/src/html/DefnLM12.gif0000444000265000001440000001245107215453031012511 GIF89a@fffff3333f3̙!,@I8ͻ`(dihlp,tmx|pH,Ȥrl:ШtJZجvzxL.C(|#킉v5t"o3ycTԩ{oAד̯ΐQc;GeCpֵ]]XǏ$\B1!XցI&bIrŲZA (#e-]ƚH&|x'SPy^BUuGA?K2@Lׯ09(6KSjʝKWQuہ߿ LÈ+^̸ǐ#KL˘3k"s\'E ?X˺YVN݊m V̖hC#4,@ۊЕ1p!n򐬠Myn]`z!aClլZ='XhA{Cd~-W*hsj w)Ǡ%uȷ^~?ǝLR|)S%Ĺ VXVueH:4w(@RHEd:P@%8%CuX0nM)sXqn[A@**rBvP"!LYr&ys(bO~^7.Y-_۫:ʙh39H @+0~ ;Oo:/R%ll4mQS 6ŐʺCHDTیHyҸ1񨜣d+NrZ]B_ GA:m6աH֞zxܦu#/`8ۅ"Lgx".܍9oG]!WrIH@DIIz̮ӛ 5VC*VEɷjmqsf!'6w2DZz"@o觯/od27B;8RM`7H]xf KUf2gCu> c-Hx,.\ #5 7\D7bG3(vc=WrcqZ]TC:h>袡@)HU4; slC$2iS.gIo!6D* cj=lyQ[?4- "c-$D 9,4Tv Ηrܚ*:MiLmA.U$AÈUሉn:0,Q JdIX5$ 4kqzN =nG S"3ʑ3@ {jmVa'$j"[f705b5!fͧUVdٴKۀG8ͳgDYH?!XfGt`4 L-^Yk>KSDIAl!.v.^ap_zdaUڞxmU6aVO2Ki4tFMe /T sndv79.j(y(iԲrTii8KXAl-.s/ժ"696qj_վ4v)K(XۛLW!7Q1w ،I&h‰u&-9ҫ T"V2[ݝJzxbr-IU;)l<9Ueb\Y*e, EҎDŮl[Ttɹr8p0.9'g89JɠNE"Y]$8 +ZF(VodPˋ'ĦuO&u~ؠC88D{l@wy-*$9q`TN My61R Bqrtqdb\}Rk&9vO'1He! 50Hy2-ga2@Hs5h]hw"B,)iDhֈ\&\^dv$T`` ElS#x(]%%1":bQl3B(pDqif.R0d6lAKT)`.SVb'W}Hrߔ#&9aJi:?XQbNuiRStZvCS6/٥R>~>XՍH2(pDgj˶˟zegֻ'QkHTzR:澦\&D]ƳvƴVg~LnYJ6@j` YBe7XV._YZ {V2|T^JSrO@A͠%Bg-$rg;Bwױ'`Y6exjg&JIɘgRq/ t+8 6i$ tuYB 6|9\Q42*=btyI@5YqhcTjTT}%#B"ʈ=%)d b[!j$u'eY^C-yC{l5@u%%18ٽ~}GզUkI-jp}g5S 2`oaѝM* Bg}6_9*mM]*6ӻ˪ D`zCef]0 ]N=@,<% WV{ޠ7`,2!a]|RDD0~ ^>^~z =O!nsɣ#C3y+>m8hz]ܪA9>*-IګަK#}H%~#)Eb@7R#T%[^xtS!D㽉*>6f.;lͥ7{M'1,-Ϭh_W#h NlQWY #8s ?w#&_V4`MJ@ACBVbN.a%'e.3bp3=z]>Ӈ ~{\ /^ {7/{~ "?$_&(*,;aplus-fsf-4.22/src/html/DefnLM13.gif0000444000265000001440000001252407215453031012513 GIF89a@̙fffff3333f3!,@I8ͻ`(dihlptmxpH,$l:qʨtJZlxL.޴nxTMw~w|D7)lM45v' L4 L( "M  Lގ < RH` '$xZf rըLȁXNrNIu"6[0C\XQ`r/ɟ@A`^Jf,җD@BNʵWLܥetY[n%S~pݻ_jEn*AU JLy(vJyb@̗ض VF뮖{EnaXzA1A fe+˟CuucX'OA̫_ OrGϿt'A-@&ę5A@a!,,aH "JadҠcGB5&K M%:-D]6~DՐ 9zd%i\If0i&4RfUIK+[ @\8"4rTU!jcNU8\&UA@ \6hpMURf&LYIE:YEeD=cVV Fc,:*k*z$Ȫ6eUkcJ`jFĠh>V\(ku+8X>bv\‰g >V42G o[&5ުMTV(G*_pUU!08ori;g ̾*.H•-V9밊J,^*-#R'fYZLg#}%NL2OY-lhdZJu|.Glz'XSRa5IsO+#jO,:9G R᪑coԻt IBPGEaPyԞ<'8߈0lM1> f).Ͳ$@IY(KDfQ(w^ZRV-~/rȬS*hIXf/9YBNlEaU>#S'YżTA IU?zE/.KVš'%J `щPl!Lc̴XE(ЗrK猼6oKS't'QړP?Y8 Pog7OV\.<A$`S ?8J c1iOm_"$->* $ ZE )kd4,&lhējMqjAT„M!iUXU)@sRbJuTMk;F"'xAR2_T=hڡeց5 yLqYʱ6ݢ|Dҡ@,97!Oʓ#&er"K7:j$heEۼ䈚ig'ٲJ~6׵;vjP`c 'otz_a65R:lvf*! j˲TPa{q8b*ݼCLm׺ ֊OS^j]E Oq&do!%}{ӽe>9 g+N/;)Eb d1%ڛ#]V齖{%/gՠ7fcrk8MIu~ 7Za%dTs.awBgm>yvIpO=BS.id uP'MD1Ĕ鈮7-+|HE|SDlCk$^WI|( dtlj/U.hԟ# FŭhY>ys=?tUmfLdk,vk0j}+膶^օN};oi3AMyh}'<6,UЉ< G;AJ#H[}[x`+|nq;ifKȫDݿU9[~~LHNmuvinbو0VCy5.2ɋ]HVx_!߯ҔsJpǹw6|lR8rfwN/B贤8bcX!JB1R /R }KEuQ%j`[?N^rEf^'7+FX;):c4;D7)w~p~cB2"b!)/'U9QA:!fe'Uԃ>@B8DXFxHJL؄NPR8m4l,`DCqn$T!)"qBvT(زD@oO"*㥅2@m2KTtNC*lMih%:Q2^BGuaW!"dOpp%e~S>UHuǶeE3ւ|qTnU3ta OZ1c+s+4r,WpV0?xW,S!7] A0b5*<&E0e>A._F;vLn #(OVRS;*fyeC&cRƢzv54ިE%D7n 'pCvt7zd[7_dhb=G'l_2Wu1ӥi=wv^^0o2W7w6WWx"tXjO\2}K(i8g:yRFv25u4gs&iƨ20#w)0q qf\ veflեd9,-︐J]W9,R;*5W!єcT3v9f,mh7ys_w7]B.JLHTH[c#4VxU!$8eqς x$i&XV"kGQxZv "~Iozw!7P^ 2Z51߀*4-1,9ʣ; 2*`;jp#F5Ք>ZM>*hOZ#ER'7:+jVxx) m0kz&PiG0({em ~Zzڨ 2?B)5 5JȦs ';0p1L$ԩƫan{8"}vJr{M嫦jCJhpdV w`cXFv-Pل,Q-@`$D8f@.$j{$$_J|!ɯ*nf{v8VJp'atZKw?)tŸ{xXU"֢x2$b|IRSp\+JBJ㓬?jPo_wI$؛:e#zm2'!6&:Őacvm8 I)JUVr5wD 7D{ߔJ&\E_s@JYE{;LS %rwwA; i C+nU:ɛ:elybeޚ<\|+\:;w+Δv9LF +Bחb=pT M%&e,"^\y2#ėf+(M;'V4*õ̾ܛyys+뙠+j!C G@ER8H0p2@#?d2+_c9c]:VFbUՈ.eTSck$brY‚pm tJ\0zm9zxy%F[ ZE \1kzӧBM% ϙ<&N҃(t d-PTTY\ &aH;JrϹKfRU*G{ޙzVH@mA$|݉M+e䫌 `.'̥Q{}zH؜DSlGF}d݉VY.FP)]#ۚ",.02>4^6^zㅴϰc/73J!FtME~a3iDV)C#Y-2M7kSe{lEM$]IR=ˀuW?R0',1zB7kMݳ[unL*Rc RFf'r{J_t!AᄐL _ O SX-ߨW$߄ T*/h0o?+J6:<>@B?D_FHp;aplus-fsf-4.22/src/html/DefnLM14.gif0000444000265000001440000001236307215453031012515 GIF89a@̙fffff3333f3!,@I8ͻ`(dihlp,tmx|pH,Ȥrl:ШtJZجvzxL.S0|+킉v5 t"o3 y  c Tԩ{oAד̯ΐQc;GeCpֵ]]XǏ$\B1!XցI&bIrŲZA (#e-]ƚH&|x'Sy^BUuGA?K2@Lׯ09(6KSjʝKWQuہ߿ LÈ+^̸ǐ#KL˘3k"s\'E ?X˺YVN݊m V̖hC#4,@ۊЕ1p!n򐬠Myn]`z!aClլZ='XhA{Cd~-W*hsj w)Ǡ%uȷ^~?ǝLR|)S%Ĺ VXVueH:4w(@RHEd:P@%8%CuX0nM)sXqn[A@**rBvP"!LYr&ys(bO~^7.Y-_۫:ʙh39H @+0~ ;Oo:/R%ll4mQS 6ŐʺCHDTیHyҸ1񨜣d+NrZ]B_ GA:m6աH֞zxܦu#/`8ۅ"Lgx".܍9oG]!WrIH@DIIz̮ӛ 5VC*VEɷjmqsf!'6w2DZz"@o觯/od27B;8bM`7H]xf KUf2gCu> c-Hx,.\ #5 7\D7bG3(vc=WrcqZ]TC:h>袡@)HU4; slC$2iS.gIo!6D* cj=lyQ[?4- "c-$D 9,4Tv Ηrܚ*:MiLmA.U$AÈUሉn:0,Q JdIX5$ 4kqzN =nG S"3ʑ3@ {jmVa'$j"[f705b5!fͧUVdٴKۀG8ͳgDYH?!XfGt`4 L-^Yk>KSDIAl!.v.^ap_zdaUڞxmU6aVO2Ki4tFMe /T sndv79.j(y(iԲrTii8KXAl-.s/ժ"696qj_վ4v)K(XۛLW!7Q1w ،I&h‰u&-9ҫ T"V2[ݝJzxbr-IU;)l<9Ueb\Y*e, EҎDŮl[Ttɹr8p0.9'g89JɠNE"Y]$8 +ZF(VodPˋ'ĦuO&u~ؠC88D{l@wy-*$9q`TN My61R Bqrtqdb\}Rk&9vO'1He! 50Hy2-ga2@Hs5h]hw"B,)iDhֈ\&\^dv$T`` ElS#x(]%%1":bQl3B(pDqif.R0d6lAKT)`.SVb'W}Hrߔ#&9aJi:?XQbNuiRStZvCS6/٥҄HPo 1Ƕ5.Ȭ-)aV7Y!FhUY'oR:QmC2"*pDGXkY%hgEۍ[::zCfD]FFFVg~Ln;37d2;0\_kXVWzkJQGRq-,T) ZB^0/Ȱۄ) YSԀ=ik(P6`k*'0W"a)R;RHkmvT_^ C :UNo:՟#t,Wxr-n@:H6\;m-a:BɦNfrWylAWcL,(EWWYWzB g;_[++d3m0>,Vf( $$+`E02=٥u0pٽB` !&E^b1昝jR(f, N0۲-ڶ&ګ]4 'Mg땎뾧 'N칧!n9{H؞{gގy{~ӗ{qz79?_;aplus-fsf-4.22/src/html/DefnMode.html0000444000265000001440000002013610737165276013136 A+ Function Definition Mode Tips

A+ Function Definition Mode Tips:  "Do"s and "Don't"s

Here is a sample showing a couple of small defined functions, with some discussion regarding their respective anatomies:

  1. A unit of code that may be called a "program" or a "subroutine" in other languages is called a "function" in A+. (This term betrays some of the mathematical origins of the A+ language.) A function takes in data (in the form of its one or more arguments), processes it (with the code within its definition), and returns new data (in the form of its one or more results).

    Here are two small sample functions, named "Trail" and "DMB".

    A function may be defined entirely on one line (as shown with the "Trail" function), or on multiple lines (as shown with the "DMB" function).

    Although functions can be created within the A+ environment, they cannot be edited or saved from within the A+ environment; it is therefore most common to enter functions from within the Emacs or XEmacs editor.



  2. This is the "header line" of the function definition. It establishes the name of the function, and the number of arguments that the function may use. See "Types of Headers."



  3. An opening brace ("{") begins the definition of a multi-line function. Braces are optional for a function that is defined entirely on one line.

    You may type the definition in on the same line as the header, or you may press the Enter key and put the code that defines the function on successive lines under the heading. The definition is ended when you enter a closing brace ("}") which is paired with the opening brace.



  4. Everything between the outermost braces constitutes the "body" of the function. (The braces are optional for a function defined on one line.)



  5. A colon separates the header line from the body of the function. Spaces may optionally be placed before and after the colon, but are not required.

    In general, spaces may be inserted between names and symbols in a function in order to aid visual clarity. These spaces have no effect on the operation of the code.



  6. By convention (only), it is common to have the heading and opening brace on a line by itself, and the closing brace also on a separate line.



  7. The indentation of the lines must be entered manually; lines are not automatically indented. The system, however, will retain the indentation that you provide. It may be desirable to use indentation for clarity. How much each line is indented is up to you. You can enhance the readability of your functions through the judicious use of indentation, and in particular, by being consistent with your indentation style.



  8. Extra blanks may optionally be used between A+ symbols. This may be desirable for clarity (although it has no effect at all on the execution of the code). Blanks may help to visually separate blocks of code within a line.



  9. A semicolon must be used at the end of each line - except for the last line of code in the function: the last line must not end with a semicolon. (Comment lines do not need semicolons; see below.)

    If semicolons are not used properly, a common symptom is that the function might execute with no error reports, but may not return a result to you.



  10. Any line which begins with a lamp symbol ("") is a comment line. Nothing else on a comment line is evaluated or executed (...a lamp is used for illumination only...).

    It is very desirable to include comments with your code. Many people commonly start a function definition with one or more comment lines which explain the overall purpose of this particular unit of code and describe its arguments and result.

    Comments may appear anywhere within the body of a function. Everything to the right of a comment symbol, up to the end of the line, is considered to be part of the comment. Therefore, whether a comment line ends with a semicolon or not is immaterial; if a semicolon character is present at the end of a comment line, it is just part of the comment.

    You cannot put an ending brace on a comment line, because the brace will just be considered to be part of the comment.



  11. If there is a semicolon character within the comment, it is simply part of the comment. A semicolon to the right of a comment symbol does not end the comment; a comment may only be ended by the end of the line (i.e., by pressing the Enter key).



  12. A comment which appears to the right of a line of code must follow that line's ending semicolon.



  13. The header of a function does not indicate an assignment of a result (as it does in other APL implementations), because all A+ functions return results.



  14. An assignment of a result variable is also not needed within the body of a function. The result of the function is simply the result of the last operation, whether that was an assignment to a variable (of any arbitrary name) or the result of an operation with no assignment.



doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/DisplayClasses.html0000444000265000001440000001354010737165276014401 A+ Reference: Display Classes

An Overview of the Display Classes

Display Class

Description

Action A set of buttons that allow certain actions to be invoked.
Array A simple display of a scalar, vector, or matrix, with scrollbars as needed.
Button A single button, with which a function is associated, being called when the button is pressed.
Check Displays a slotfiller as a set of buttons, some on, some off, which can be toggled.
Choice A pulldown menu to allow selection of one from a set of alternatives.
Command For entry of a command; the keystrokes can be monitored as they are entered.
Graph, ...Trace Graphs of many kinds; line, scatter, barchart, piechart, and so on.
Hguage Shows a scalar in graphical and (optionally) digital form.
Hgrid A container: a simple horizontal arrangement of child objects.
Hmenu Represents a slotfiller as a horizontal cascade menu; submenus are vertical.
Hpane A container: a layout of child objects in which a viewer can move vertical dividers between children.
Hscale Shows a scalar in graphical and (optionally) digital form and allows the user to alter it.
Label A simple widget to show text; it never has scrollbars.
Layout A container: an arrangement of child objects, with many options.
Matrix Displays a matrix (that is not a simple character matrix), with row, column, and corner labels.
Notebook A container looking like a notebook; its children have tabs for selecting the one to be shown.
Page Character matrices for data services info; no editing, scrolling, but individual character color, keystrokes, boxes.
Password For password entry and authentication (includes Kerberos support).
Radio For slotfillers; displays buttons to choose 1 of n; automatically invalidates previous choice.
Report Prints all of object or objects (continuation pages as needed); breaks, subtotals, much else.
Scalar For any A+ global variable; shows it as an A+ expression whose value is that of the variable.
Slot For slotfillers; displays slot areas: label (symbolic index by default), value (editable); no scrolling.
Table, tableField Table (symbol vector) contains labelled columns (fields) displaying (vector or character matrix) tableFields.
Text For character vectors; general means for text entry; can be used as note pad.
Tree Shows nested slotfillers as trees.
Vgauge Shows a scalar in graphical and (optionally) digital form.
Vgrid A container: a simple vertical arrangement of child objects.
View For simple character matrices larger than labels; can be scrolled.
Vmenu Represents a slotfiller as a vertical cascade menu.
Vpane A container: a layout of child objects in which a viewer can move horizontal dividers between children.
Vscale Shows a scalar in graphical and (optionally) digital form and allows the user to alter it.
Window For putting scrollbars on a single object.


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/EbyE1c.gif0000444000265000001440000002006107215453031012305 GIF89a Hv"a7!]G UO  !#%'.057>@BBGHPQVX_`klz{~~ww-3kGIcg=o3 ++     4)b[ !&.!=15,D9I>PEZOof~v׈ܗࠬ⧧٢ '2n+i{S>tsNJ*# N=|o}  ))((66DDRR]]jjwwmm||Ȗš{{{ssskkkeee^^^YYYSSSOOOKKKHHHCCC<<<666333111...***### , H*\ȰÇ#JHŋ3jȱǏ C$جȓ(S\ɲ˗!Oݲ ͛8ssVrJѣHO4ӧPJԫXj S;fLخ\ҦͥkW[x +̸˷fd+ .ƌr&lVVPILUhl .ǔ5K騧b=^-yU9eחa[j֭RD-;M^Z<*Uus &[ìV\VkWd˟O_ba˜I֫W 0 c1L2PB0g-S/HVSAEbK  .-03dVPU`) ޢd12&$R,-B.cG8R#ULL0"d22 ,.W,d1/t%GT&ØB('H 4R#)13-M6.2tJa=jgu3BvAuHI"(H_|1ŕF| %6;rM(~ng ~Gh_`.YD.P\!/X\avn_HyQI>$e2L9M身qXx1rЁ|܇(%TR$paW7{!} r@ϧ0Py.udbP#lDEvB#  'lrA"cXQG~0jpxu/C)O!g1!Q!Z1 Y 8HyF<i4Dެ_L0K;Ph,}N,GBUa }1GpcEr#÷}Qt(H%䗯Fwa[)3*LAd| zBcPT)B ^0ILbZȬ%UЂ`4 4~!AhA8#*tqhoB ѓ `)Bt1 \xB =:ÃHV2J+ 4զdhQ"rC"AA8ً"vwepE !KB&p.8-Ba'CPD'@JS{#Ɛ*|`L!pV A X0mJ2 vP!QRf8D1(aBjZa1ʈQx# #xb,EªIp@d\ MYWDBҳfqXa݁!FgH}!6h0] )Mg0m #0Ni<~!OY ]]9y _w[zpl)S3 Lӈ kϐsk؀>$ Ia @qՇ=u%0-xv؀8@W *r ny>S,P) 6au{5S6Cۥat1 \4Iɖ:wV!Oʡ1 V,apx:$`}SQ ]XtZ*A  8a0ZQxаh` 24'1y%s.v0Pp!AћQ 2k)b  [v !|$p<AХ* 1 ._no`X*&I%O2N=g{e!F*`,2cv`u{1+0$I"P"QԪlඤQC(aU?PcIѹKQ;oC.:LKLm qD[9ٺL0H+r07X:~+!Qz߻^X ZK`fvfJ0fa+`< Ӧ)m^(cE+GQA Il Ff.;`A*pe*˼+,l ÔQgཤ;S{:Ⱥ-, ,X v0,(UOQ4aL_IӋQ,K Inٺ<- jZO; ˟)Zq K5ikE PaH,G7a[QIxs+K ̀FcAinAa;1(x/!|滮W1dzsYWy3PQܿ {1n;cg'Nq;;z7^5fˍ,ǔq 0Qp0cPL*0I^@;E`v5v ´0Ϭ+*yǨ\$Q01 xж+jx?,8qL(* ϶p"q~ t(/m1d Ē!02LkfX@J8Qll5z0r^c[A [{@a(ЍLD tf&RQ~,}<ɾ+zp+&b R:{Œ+- -)`P-e 2,, SJ͍ @0Q:`|r->^~ ~ ݰ@۰ p@ q 0ٰ@װ -` P! @ "` z PV0Vn ڀ@ @pHA R@ ] # `d.  e!Q>A.` j  kNpA ڰ 8Q錞c k# V.~Pp^^>PmP0q@QSpᰊ@  ۀM #а ʞ>>?`^5/7`  k * 0nP/?p@1S?P 1n ߰`P@p @q _VЀP a nbP`pBjcO  ΐ k^OA#q0to\! =?a N3_$XРl;An{XѢmxQo$XI)UdY0Ć43_>j- [Ao$9άmgʑz?v\jJb҃٘D+hhΥ[W٘3߾jrZoN̦Nk uJh&V'^ }A[mPfw7s&fgg5KmsA蕓xl)K>9u>IG{^ *Gq99^sJ[O hZ 'dpKpa'|6˛Ûz$O$hƹ){{6qc^&|gknGvנlɧ}䡭gQ'~qGcއ-~M ~,H4 P d`@FP`-xA fP`=AP#$a MxBP+da ]BP3a mxCP;a}C QC$bxD$&QKdbD(FQSbxE,fQ[bE0Qc$cxF4QkdcF8QscxG'Bc긇DMC+w٣=*9ppHR>zgp,(g-u3&}#28؃)p[jg]G+q-4}/%AG9 eH7M{G9a~69ABF/ 4Uc]3 cǴz*o L BC.sH4OŴ%Ո=$0,Ԁ=4:&}.G=ՇSMEzԕDcrw i\36b\{H׎6qsCuNRCIA cxu!{frҞ85%1<*b:b棱iZ")حA4$t$V%ͥD o+Z \|rIg9L鏉Q}v h%^A_C"JmH4Ʊªu{Ξ S m h̓ <&,`!n 8r`Pn7VÏX)ZơH>V&_1@A(HZ_L!=y`ADT$؆`!:p&fC頳FAtPǜ}Y=I9$ҏvϫǒэKt7C=Ao|B-Um J9~8ZCrJҤ Ҁ5ijfv!o8[Ƕ9lyYfv=Rwc>Ww?1"ѠwMo|AVnG}JQ"m8! 6qayG\9 ;aplus-fsf-4.22/src/html/EbyE2c.gif0000444000265000001440000000614707215453031012317 GIF89a vu|{υ̑ǡ  $&*,.02478@AKLVW``hhoo %% 66+**# feLqpWec?vtK͉Տ`^?ךrǓi{yZON<_^KXWFKI.SpmH*)XĿx21"YW>ϖljQA@1À~bGF7ת<;0ѭ0.:8$ݨ10'ͯȰ¿͓w~sUUC8'&  , H*\ȰÇ#JHŋ3jȱǏ CIɓ(S\ɲ˗0cʜI͛8sɳϟ@ JѣH*]ʴSkO(YʰT6jNyhӪ}Vi\•,׹rb,1WTKX^D! ϕ@Y%P䃗eh@W :0hߩ^V3i{ЖTF؁NnM;'6A⸅oE!n04{;?y˧hJR8H%c,gtC A (j'!lvQu\ riE|I'}4@}iҚIYNAP_AR#%=9{e$ QQ&)6^V^jFeSƝBzxˑ[:Ҫl 74&AϾ:g$ź?4j9DQU OTLeVD?u Ģ|s6$O=N+6aF^ME9H-W?sꙐ Og\A,DVTO'-Fp#IL0pS1CiS;,9x|߀.n'7G.Wngw砇.褗n騧ꬷ.5'ea{zߖN|?|I//NC/|mՏ=C{ =蛟R ~_Px_~?_3^@y}yA׾l37 2~ `G H9B !2 vy#AP<!" 5χ7! (*ZqC AhD,Q_1ʏ~"" m(B(тjOla[B2} רo "I< w"#BzA d#Gvq#h1B>YKN}d(UC)ܤ'D Q\+1iyDYpY[ql0hs2d:QҜ:KtӒ5l6Ĉ<#+xFfZ3%8GKyL@My-w{CZϊR4A\b|\g}LRmT(!ѝ,m$=Nn#;(N9B5h/< ]G@*tD AqBt'*AV_ŧK)UgǴ%5VuQ&u [NF hTcV𵯀k`SMl'ؿ2V}xQZͬf7z hGKҚMjWֺlgKͭnw I$T]EG~Lj!Bʔ(L t@ݝ /FK=-#% WՔ4g.+ࢂMVa/'"`ӹS$G,Qje|@ጱ-Cx%ljEl:(!XV?*+'T1zdL`8އ"c8,fH4,t " >Av| RZ%hR#D:WY[ydQG|!1 Ydˋ9$Uoܾp|!NӼURY@vK 6Bxw   BmJ|A2M :O%Xf#d]xXh@+d[ wiحQ7w v sN"L"['ޓ-{IK# 5r#sjLqiwk• ؀8;aplus-fsf-4.22/src/html/EbyE3c.gif0000444000265000001440000001411207215453031012307 GIF89a+ZP`AV:' jedcf !$/2^`mo{}?BNQ'1䇓8P) ? n]6c̪, ,4]b\      " *5'>1E8MAYMsj᥸eYM~G{ٌݙ8l;dnʑOС}T[15I0,u &&00<I'!k.Iӣ6I&Xl~MτL9MA*+6̠ !h܉!M(r0E!Vq-].X{ 6V]7L 0 6ׄcK!!ZَYtU5(xvDpD: g߽&1( 6܁P eKhuD>cDt1]D΀ɬ)D*:7@C~d[NP00&|% H]"a@%K NxRH!@S^w$~pa&p2)O|!I3ùI"/y @Jjn'gPM,i%4̑\8!< ^")!7" S;VT&xԣ F:iBdgQ0+r0+%""Mz^58iA)J`8@{e%$[G]@{KXi!<]sďכI@l(X:Q ngrU0rҁwH #6Dr0Ąmo.%$62ɶZAg)9y&PiJnD7EX\#bKj@R2 rdgE2`)V\//WȺ ="iw~~!+O^ʚ ]]B# LM`%uѤˊiw`j!^+f@E_= NP@PFYaU  #d'~e %$xx 'DEf5d6Dh(l\p#'u`54Q''xTtYQPGgpK=ZV>8~TU#5'pZYdwDwaQ8PF8Q4"sP= g(':pY5&@(V!|z4 F$*` U#rA<% !41kDC`x[jX= 7B~r83[~o=gsmx  $Q }d~0 rs'Bcf ̠ WB PpA:,7Ck()s$qwyT:+-}kE0}p%g,T,(t<8HbHB<e3@b81MÅ%jUG%Ffad/wbVE0SӃ% #q|"(qlFIA aDxR`ad*V|2()ÃHY~RxRr%'+\oTxM;^[ɕ{(Rij+pʓIv'uߥ<=v[Idw2b_J񏈣x'X.<43ew'} ,ᓹ`p1e:{.0-aL9uxcQm#IuiY'XY#/T۳Aq *IprP2AԜKKHf% :2Bg,Qq_8s!taG*g!~Gf% ql /!Vay R4"q7s1H-Ny)pXe0]J P2qZAu "]]*C!: y t;ץkdd2tzV79*@њ \Ci*؊*ުx:Z 9P P {A>P d*>kz< ; C۳ a@Hб*j7˳ 갯 1Z*AzPA`A a*Aւ 3; J{9;  Pqk` ѻۏQ^T[`Q`;мƛ U[9`Q ʿ1ZѾˠ d5{:*< ;z/QRB!M,%O PL8[,VM =ݠPػa^J,LL<kpg_: Ph;L_mRLAL1k p@!ZL&;QʤLy(lnQn[#+*k{˯|Qc޼dž;{P,#QR`ѵ۳blKAdK\@QGڠ:qslЮ$ q:j0܀@ԯS*[ApC>+K>=9AjS ŽWeim-]<{mS@ػu黯S0 m*xKQ|ˀjg0?]X|ံ;L}\젱]^Md [8P> \lfl|^~ >^~ ">$^&~(*,.02>4^6~8:<>@4N*1~+ސ,K¿,xKf\U*΂R|={m-'!'|_>0 l{|~x,ׅ-|vn{L!:栞mmr~љ.Sé|m}"{ a` ܔ>NR#dzPNk~A1 k^ h-%Y^湫Ql¸ QF 0,oS:Ҝ3O^=]N_$1{Q]O#a Au^@ q[ QMaPqSЎQaO vM 1 ^P2/xlם0 = O,^ na ?oY8KngnkƏY <ې[p/1ڿ*``)`;aplus-fsf-4.22/src/html/FigAction.gif0000444000265000001440000001213007215453031013076 GIF87ax>XYXnnn,x>0I8ͻ`(dihlp,tmx|pH,Ȥrl:ШtJVجvzxL.zn-'N~k~[cpZȴɥ̠׾кYϞX'^]z+h Ç#JH@vKm CFNH\ɲ"ް4i 8s*vf-ibCɳfQH*Ms'b@ 9XӥX*r|0ZӪMgVWQfPHٶE`﬷qnǺUeoa 8XN^YN? gRNxqSɲe~uuǥ]g]A5Y&יi[.K[9*렓^7V޳oO+IN|@mr1rn=5&O|'Hz9} feV]QX arwr 8oy*XO~=8a|̗(yGbvv݅'+"!أ==WzE!$2֒"Dhd"$bB(ν$QRur]l"~Y&c!o`f'jٞьw}L@塆V馮gpa ٠)!XZ>@j* i@9hhZWL^R"[^&Gv,-({ʴ82nya;*G{P.-Vɏ(7*Be!F.[kp5J"$w*1Ɯƞ1[r K֢p,7sƽo]p9󣲲;!Ձ -RLqCtbmvzuJmSam3sHEr}xjzxU=pΩִ*z/7+^#N?x̾?o}y׫Gf u>DBD gD:򑐌dIFJ$")Y>Kje>IJ$'RZ񔮌eP)L"-wJ^Ne,yIZiD$oIVvDa "5͸G2Sԥ1oPjsD)Dv氜:N$vӑߜɨLxM:xПǜ ZDnҀ$$?щd* EY͍>|DYQ4:]GvԐy/Iz,T=-dL!0ӑg)CVѩ;*365;wyDi޳[**Ŋ͠2*OjVJ3TuU9ֳ4oը5ʹգlUS[&\!ZI^՘{jA{W&VdR^6nE)W>1 +NURMke+jumnUFQҕg]vʽd+VVN{D.=jruֶ:.`\#ִngًD*[dx]*/zK0oh_WekqKN ~ LoU/|p]װeYs6lKO8,Vk8{?<Øel'b*[Xβq+Ẓwn2PID-U>x !8yk`a #Lp>Έ3'g9;ѐ4fJD27f& LGMF/&'nXNn]PZ63]UrHQm95^/^q=\Xik).mlڗ]vMiڸ|i8f[yDjg~J .m!(R[nFݖٽgs#[p葧K[.z&oy_~3 2{2qʑؿ(9ĕns|7.bas*<1Ƴ2N=D]ջXh?è:=u6ŵt'=yߙ^dYb#xGм?~SyCONvGSN=]/?<}e߽{>d4OCg~= }]O_G;*v\~ZmmW HX\؀o'o7G]k "8$X&x(*,؂*xCx_4X6x8::plg~wC\lյйۿMЂχ}/Z Aܡ+0܆΍ʭ yMv]]ؖ-m- ͜me:䋝=^O  ňg߮WzMK6">Y !N*cln0ܫ2^6^Ƚ:<%B>D>0@ {p T>SR?Uk哲f`bC3$C.prlNBu>z|By.2>^~~芾*d9>^~阞难>^~ꨞꪾ>봮 ;aplus-fsf-4.22/src/html/FigArray.gif0000444000265000001440000002226707215453031012753 GIF87aXYXnnn,I8ͻ`(dihlp,tmx|pH,Ȥrl:ШtJZجvzxL.zn|N~ 2ŏٱ1픽#ԯٿ*\Ȱ.Cѡŋ3jL弑땼Y@C!^7Өu&]㠠2$vX[oo[qwӭq1"Ќ3c?5t#\dfT;^@zxn`{ZkAS[9~736v!x!rS JcZxuF] ih8A4'w8(MENK9F!`5P:!F"_АHd`r\J^äN¨bU'[UyY~efz(r8&"zh&it-N y'`頀G-cmӠ^莿 㧧QqN~cx^.ʚs ((#]<{K-:nʫ jk|/v2ѳ h ]v3R?汫H@8If9lx7`o*[HA z D2:IhWBuMau+R-76^}C[gCq1,af p/I<CpIٖ?x` ŝQ'etr1p-*%l9D> IBL"F:򑐌$'IF&)XD%7Nz (GIP^DZ)WV򕰌, iB̥.wKV0Ibsduf:Td2m%hZ&2hKmz '%Ij9NDszjg3)zړDaτR2@YPԢ5BS>T~D(9RVĨGLrDiIeG T"ufNaM,Ӝ=Kӳ^[b3O^&fi{R6; ߿^}4dG}]@W*oy> {g;U\Wg~u~|'Nux}7K|gxV Q'xHg'OPxTg͵hptfw}geVW}e{'ZgSiIQ#PeQaW\X~RSHpw~[ufh'|hu'kp5TX[&juxfk{p؄|(AVCn1(~B#b6sXXxOtH|XYXNMxL8TZxXL؋(KU[XKw8Xxؘڸ؍8X8}Ԍ8Xx؎]9Yy ِ9Yy)瘎xB$Y&y(*,ْ8i _ i"9Ÿ˸<@DifG:M0ٓXBT GIIYkؓ/9TpYl8^薽(1yedYiYpI](ЈvIxHĈ}09uyDiɗ{q8Y舂铗0k9`mXXi?YYx kciXi9eɗVy9yYWnنVșLIٜJ2hky)}}y oƟ|ߩ)cifqɠi@6ZniGᩋ'Z%ZȢG/J*jLF.J0jI8:* >*NFΕ8HE:fɍKԞVxJ_`zQdZf13j:]oY0ɘA ֧^c gJik yq:bjsy zڨŨmf:Mr](觿elzI ZJ*ZzZ+n 9:=جV*(Ze\}ȥ7 ʣjLN;un5R ۚᚫjڮnH|JZʫzak誩ݺڰW:+jĺ*wꏍ$&Ʈİ. +++o8kH: a#MG;8T۴LNKHP*ZX{B*k9 c˶l_)oK-gGIk?kn[p+Hr+w[xg ڢ۷\Hu HKuʺe;< D[țːẼ;Z {)ټػKĻRT;a9K6kmkja;k]۹NɿH뾔5+s3{#{el˲\鳝zT)jم {件vi U~Xb|}/k68%EګE=L;8gLĞu& ̾V6YK̭_xj0QCgh}!$,,kY={8ڛ<)JM m>^=F;'-L^ߤ-]TNPR]ٽc .}ݝw]`},[nkfu ^e~<|m 痕]A>M pXnţڜUVXnHWo7 -8}n ʞ~1Ldnͳ%Nǚ"ծDMMa+=sή ӾW| Cm-M]<܀n|k^/)f$e "$r<,&(=FŶ=?^ nY/zO.Q`XLN4R<u?wO*U Gt|_A? ͬ/HƣN9o-R3O`GşbŎ^`.m?BwX=-.U-<\/Pʻ?f?ig̿oС\6RVu_G$‚p`P8$GdC(OhT:M2Nih*6&f5IeoxwURh.2ò5G'GJK M@/E”RD4FJVW;WY)M O?PAS`L:cdfܬ]Q_`.eYh,-Al3FMrcz|Is\ vm-K.O ؑ87y{lG!E$YI5dK1Qj\" uRh`d%ZњG.et#M7#5gO2?UWaŎ%[YiՆe[qUP*;a]&aĉs{jzfX0(Cwf ݼN6pΩVzgG&e׹ݻ웲>U*޾a\7pftr o~vX|x 4m귑Abo~L3(yO0loB}ԫɱnjyo/$!CT, 6|Fr@31,/ CƆ*\hH$ IϺd2(rK!,051DJL Բ?0ӜB3sH=R*MP\2O#@XO:t2R1@{^bQUqȶ\mZ{ȧ |Dzb;t^Znr7zuxos9]k7w/uߚvf IT^Tz Qxr'ZL5yͺhf7_b24e[yNtƜdg;bi[XO|UyO|5j?j2ע , k;-#QsSHqKV:i XJw%nyc WD"5wwBuϫ'RU{#[7R/q4(P"XyE^cӻ\JZTG#|'U6Y뇃1wcB h,P+bjH2q΋ɫ`ԅ95pcذ?^h;:9/LV.rφsmsesp _*4vv SfzGүΘfKaAҕ+= n ͰUU{VȞ&5Zuѳ&g]mf>oNѲiNSK4bUqX2yj Aljy4^MQwڶ/eӓڦ7ѠMd&޷V]A@5ƴxIKƒ;l\fIоdw&ܽd=΀k&f=Nb6NQm !]9dc/$1o\7^sݎ7QJCsd=h?_ҝ>6:s9λ(.}rَqDY=>%2  gS :<yyW07y[߲;Mz[kgWfU(ln}[N羝?E^L! ||۲&K':ӧ~oїh"F݇_'7qux׹g_Z{e>;<@L@@0T@@ T3t@ @K d2ۢC 9ALA\AlA|p-8S2(AAA B! 8|̻)X!|B(B) "83+; 'B1C2,.d@ KZ/d04C:C;CDÿ97B{)'CCCQ R"-R#=R$MR%]R&mR'}R(R)RR*=R"R-R/R0 S1S2ER.-ҬCS6mS7}S8S9%:SfS@ TATB-TC=TDMTE]TFmTG}THTITJTKTLTMTNTOTP UQUR-US=UTMUU]UVmUW}UXUYUZU[U\U]U^U_U` VaVb-Vc=VdMVe]VfmVg}VhViVjVkVlVmVnVoP;aplus-fsf-4.22/src/html/FigButton.gif0000444000265000001440000000644107215453031013144 GIF87aXYXnnn,0I8ͻ`(dihlp,tmx|pH,Ȥrl:ШtJZجvzxL.zn|N~&˼ԭ%뷯*\(cHŋ):1hBIr(S\ɲ˗0cʜI͛8s#i͙cfV'P)&hHaq9权VIjmFtKiq@)z٧W&v9d ho2c 5ت@*h ljSu,HZڦ3:$H캏 2W*6L6,bd +r k ,I*Ű6l*L/fXf/8Jlibp/3*20Ō+7̳+c:C\(ӷr6μ-Y[XuNJcKJݷ6)m'^6pSC.u~_2qϙ\G:p/ݵcF׬GnWv!^3h)|5>X紹=ϼ"/A2_iҶpkwKM"*78ݏL`E"EImY ZP"4`U4u5GH nZ"Ԡ <ȁ0% =B]`B@}Pp7 ?",H\ {xB&ZQCbT'}(_H2; R¨gb;TQ؈:x#K>čR, IBL"F:򑐌$'IJZ̤&7IKz(GIRL*WJG~RNfIZ̥.w^ 0IbL2fS"HdjZ̦6nz󛺄&YpL:v gj̧>vSQe+yVMBІ.,@4$:ͨF7фB4@ `ю(MJMQΏ\LgJӚ- <):r@]eJ@DWQPQ ɩRUJ),CԂr` XzUUg=iZ˪Ҭ=WJW5kd^9׻vԭ@Ⱦ Ұ~U]9VդbJԕ#-!"t,&;Pі-G/[=},ceم6+i E5"cٹvMoܲ6Wr\.򴞰,mqݮw{JҼ . 7 Ww;*|_{_մUd][W*-l.طt;^Xp7X;{)L}OX1Eib%ya5r{,_&vdz]1 f7-pZg ZwY`r}S[,1n98Gfd~[)/hk\c69R6rCX=3WIK"eN3]TǙ8vǬfFɄ+MYчuA-WYʛ5jV7[ŭk\R/[h.u/MfiӦ2D]OsX_;N+XS{ގ}2|kuW{ר#T7Emod/݊7ao]GIg<]t33h4凖m-o}~m roqZ;0gsWZ_vc;93"CyE7y짧ܨ7gu|YOwe^YUpg]I7=Qo;w/~|/qT]|v[F.w{~9W;!xʫ'z5`:}AO|?w.y;L:Qon|]ݬWu!=ս!p;{{Cg>׮[SzwzQt|otqc}'p7WJ!~{d{h6c,kW`\7\B7|GvvTWstHsG`^% UpGOy烻gmfveGJebUf%8mpd]\(u &x=Ha)`7tZieYdleoWhWԖn&N.ɀk9Eoyx71Xq l.|`y9ѓcGz4Yy)!Iq )GiF4yFٚ9Y|pٛ9Yyșʹٜ9Yyؙڹٝ9Yy虞ɜ ;aplus-fsf-4.22/src/html/FigCheck.gif0000444000265000001440000001322507215453031012704 GIF87aXYXnnn,0I8ͻ`(dihlp,tmx|pH,Ȥrl:ШtJZجvzxL.zn|N~}.|}Υ-|ۦܼܽ{G#Jgŋ3jǏ C)"ɋﺱ$F.cʜI͛$aLoe J# 2ʴӧ*:jN\:1:N׫g]vخVωGjYso{0/5 3`]x!brUYÉcX"Clr?/͌g>ÖF:\} 6\Yob~6seYHVXsej60Iߦ>=Zc>ywoM _O|=~h̀e1խG i n 0hmȌ)\fHL)Vn'ȡg^ #ŁWp4bGc`a5NB  F!zDؤ0(9$_U|2|2Zp*B5KzifhIzc I4&vɝ_qj9]RG0]ZML*:bYAz'莟:ɨBZڤ@UyY8 rr*쩾 ˌ_2>b/ªZ4j -$*칪BK>yxn*n2 K%l›dw[nr뛴$ >ѽ[̥ +.\;*#+C|tz0cϘf\Bob;0.meCQvpK$mp*lmW֚eb4m5O&tw(t}Zy>v/g7s{t_>˒]]: 欧ɦ;ɚN<;-yCkݺUo=8ݑ^6Z_/{F =ԏ6_>xIz~b h7-\ kg@jM._'ؖ0{1HO9`>bHL{@:./lr>8̡gć DqHL#d4b/P*ZX̢.z` H2hLF/{#DH:x̣x7e IBIR ͂V*ՒXD,X\1%.ILb ,a/F`23,3˘Lf4(iڲ c5xWj"8ud9QNuӊ|9Oxle=|<yrZt=%Ї&WdiJr3(F9Qj4(E*t|i?O*ֶ{=,Vk ۶nVmr[T]?oֵ ltE{لs*75k4 w mqWw%UZXvmi]8F5IK)cskVBX .w%g 0qL K` Xqw cL"pd&81}]&@`6&hN׬f=+QrsK<,̀býNtfre>yz֬ۨN`dLFC.q{3zYõ屁1]JP&'M}i98_ XIw 297ҦGr&cFe]G;EwgYڳqZ9]tֽ~wƴyAxj1zܹ޷Jצzc'Rr(Oy'5q<*!x+w=on{N Yn;]H#M[[̓c`:&],}Y{r^Unw={HNݿW]?(nx'\ x[742޼=Oz[/cy~Ge۞:GW2[:}O|ٓzC_}?76>!Zkz~o~4o?_^KXY$eF Xoo4oqMHFVhjfiK!8#E&h(j+xgs'}[bEl57tɇwEHFԂ^fib?hmNCtExaDbWY(LPRE`HKnӖcIul]XgiEkhFV(o$aVp{6^&gx;xa؆riQaknHȈlhit(ikXE{XF}&ljnWV XԊd􊏈m"fXExE8FiqExjȘ˨hEubXcHڸR{ȇHeoЍUaXnHc薌XXFXp[|)h)Ԉ Yؑn5k%||GȊ* ,h39&9ȑ9鐎HV%9NxI; K M$iG8W=]I[8`bz_8ŖD9|q:tgVrrZ 'eF:9]dxW(Y טFv wiadiHVdId} wj~ؚNV1W癠隃GYKy7wԜΉGLYvtyLɝt)L)Di]u鞱|Yw{ן9wyz Jz ڠ:W {Zwxסw t7$v&zf*vxڢǢ'AHgv]tfŹȣ7xq禣LY&:) ɕlԞPjd8@ygX0}ٖhf)/F"Ih ajM IsiLuzє]*aǦJiJLJ| Wq&yE.֨Z^٥pWYf:*zZ-檯 z*wf Hqz9ZAj\*F+(JqJPzJ{rI,*͊:;Dx҉: Jzfk گʎ:˰:oeJʅjpʮB۱먑c)J#[%[ k)Iɪ1;J$ ,\Ԫ>k+e ȭNjF }Uɫ/[ q)[|T{V 3g+D*^۲I۳Z@ʘIc(tyaٷkڵvaulƹdX +P*اjzkW!ԪPR=--WY}~[ #_aMc}e6nTR[ǩgkiN~9]?{m}y^`>twWٛ "p*n{68.%9䊮9Dȳ>^Ln~嫮| |]ZKw'vXڤ\~γ!hh)-Mx9QQށ{pfvn'^z~g,O mW=Fڃ&Aٝ&t.O+-6I0Z<35>DI>RzJ?#NyGoD?OS^`b?d_]lrflnp,#g}xz|~{M_#_+i>P?R_o`A*4!r~O?,1__?r=o!oIDLtȟoPP?/_j^ڿޯ?x_I?_0I8ͻ`(dihlp,tmx|pH,Ȥrl:ШtJZجvzxL.t-;aplus-fsf-4.22/src/html/FigChoice.gif0000444000265000001440000000645407215453031013067 GIF87aXYXnnn,0I8ͻ`(dihlp,tmx|pH,Ȥrl:ШtJZجvzxL.zn|N~(zȸ'{y& HǏؽ #JHh5T C gɓ(S\ɲ˗0cʜI͛8Q c-sѣH*]ʴӚEW⟱`jʵIS Mٳh ؠ2^K݃rpo%{ÈX!?X[Ę3k{[k}щxͨSZj#WLt׫1ȝM̸* K+V|C?<#Ξ\<< c "eG't 95S24|u%_[Iȗ[2 2#g݌ ~'}.Z_va;s X= ﱸQ93rWdȌu5x*!FfyD`$F@ E~$QȤ>"Z)݁i)cI= |piۜ q# c"&[y&Z )or9ZV9vNH४h:&)~zGʫvƬ2ū-~;lⒺsɂ ^cRB+gˠ2J-l,eJn㚋M Ǵkݽ[띸Lmlr<${n#_0k;㼲՛N1!3> ʐ2l޵\ŤŜ0qs V MI_20c*NJm3"W1Zmp}f0_Lcrg=w7^r`Z(։~K_޴!1hF.mΒ;sџ pjkCe's_-<txĵ[O̅fCOҟ_~_o~ Qg?W[K$SGFm*`[`2Aw;p>ˆs)LOH:\І@ rpX6s/aA!:+\hC3|# R2hLBF&Rb`8x̣h7ďPHSBL"F:򑐌$'IJZ̤&7NzdC݅L*WV򕰌e(GFYv^ 0IbL2f:ә jZ|6nz 2)H<L5vg1 `rniRR> Ky @IO{^LBC˅:-$= ZiͨFЍzh=+ZΊ(hGSҖvRB]JSt8i#aJ{.:&қ:EMQrESS{'mPծBjTwNBҫ`EU}BjիpjZi֏ukWԵtx\W~h]YXF5LKձ[ucCXJU]f!RގV4%a3{*teg ڽꕴIhLO;SDvu*ϖնomNMK-|JmB J:txkrYja[ӺDBTbݥRWqn^;k߸!;^r*u_~ _D2^ȄVnXpD񁍋NG7>dabSY6"EbYȮaX >c<6Vɬ=m&rǨj?aw66rI,-s%|Crme<9^wb6Le577hItLe?/:&|]gR`-+CsZϣ&]W?:֬>deM'H&H6c6d);7 ضޤ-^XڴNckPvowɎ)}BڴvgMjH:ؿ^u$ n-i[P$e=$כ/pg\81>rpD%p2Ux拧wmit3yINZ;(ϥʽn;w"$miT[+뎷{ȋ.tf%׼;n{[\7wJw9܍T#}#1]I'|q^4-\E|^'hrs{c'u6{{'IζHԇXgkKLp8YXx wzAgog@6T$8l8xȁx"(xOVυc#s|Fb7|384mWgL&Wc{f[yS\vK1XWqUimhva|^a&DH~e~{Zz׃x/(u؈JX8倖dr&cPsTf`bxISGXV(KxFaujJ8X}ŘJ،nj[xHhxsxbRѸ`lS8:ͅh츍ahh8VPÈQ9Yy[ِY&y(* & ,Y6y87ħ'G:9DYFiM퐫׺sXưg}[;4oϽB,ؖ7_|8'G'}8vſ?846s?~~ouß{ GX3kXPy (_r(Me `H b>(\,JVrg ԧ( #"'' ڊ`18#Sg7ba.Hd-Y{Obf`4Fw^Ny \A&fiVp y $x"g#Zn'*jjVnȦZd%rz%v?}7*o6u*X%x뜹 nr`f,y˂CK9-Ӳʮjr羾ۯh"*i62)H[^*K ݛeiך6p,x5%Kn~o8c|5\in66 D_0ks419kL8-m#\'Cn(8\N/ogg1wG}4$5v5-6/zvNm7S,.t͸2=.kӘZ۩V8ܓ.s:rWf(ʀ( tଉN٦~ucm|#/yn4? :?{:=^I19R_g޵}=n=~v~[@Z[>Xܯԛ7Nm s,,$q(BW0/SHvЄ<: B!|ЉDCgDCE*;28.FqU?zhCUmL.81{>n叀, IBL"F:򑐌$'IJ>*Z ַ1 N,IRL*UI72 6,gIZ̥.w^ 0obL&2pa2ot4IjZ،2nz&-L:vZҚ8JwӞ4.m&LSѷ4HMREȥ:P OQ4EeBծzMXթ*Q=ѭpiXJ׺Ԭh})GjT\KPXΙհt=a ZU^Z-,e?KZb֡*_ O}hNʓ?-HOԮmmkC[6Eq:eo+Sx6UgvJ\vdn]tǘU9kyE]&|xWN7nxozWKaN5BݬdJXi` _}~cMx#hZb w@^gc6Y=ϒ!C7ejݻf=;>ۙF73z/X,kXw f6J&sC*5kj=Lc9w̲Q i=_V+u0o!Ft3?ٸQPJ#un՞fTI"]:֭fqB?5m9}Tg5_K;4+g/mL[>}ols=6۩nJRzuw&YWxm:h{[F'h\hNyw] |:IdxƦ6r c,s~W:xWrw9bG~;p??wr3>7'{hE{|7i_#~lo:#]L {^}C?K{W~xwCہOZG[Dt8~W|twqVdtxy|^GO'yF'| E~zwj#ŀ&~},5HwVSXsxsVvHh秀w|Go!|~AQ7`VVx{ywDփɷo'Xz~'v vy--{ׄR85HWxue~~Kic}d烆zwxmȂOlHvgY{#loC~dXh\gql7Ɔ~vN$bXX}Wehmy`X B؋jkOJ_hkyqs6yxufzh(oEHjȍ\N—fXgk&HVFvȋU(TbH{xuUx750VȐO5:w[ظ} xO+2Fv}hJT.Ia(i\w3T0yO2U7X@iR?%Ds#LT_P9*ȃY RQM$F{fI=XٖŅ烙Ŗr\qEv+)ȗY~p"YYeyؘؕ`)eYXyיHxٚDօ X)ٛyiHʹٜiSivuHYyйԝDHX条Y2&ٞTHi^'ai 9O)P*YП[(aGt})Py0JZuIxġzY:.z(z*.: pI@5j)P =IALCJi4BMZV HOPTut`T͸\*4jdڈyk:@Ц#)RE|vzpʑԧڃ:*]uJ*pgzJbZj37GxsS{ZzxeHo(k('Sz*d:JJd ȌҚqj⨧ٺ*ZalL*&UڮZjjȬKeTگ ^n*w(QHʰ각xw*jA( T :;+,k쪲 % %K2{3{S'kڊ<[~/+5Kj۲rHzR{T 7Jbx;TCgN!fgl[uI o[?˵gSk:Cb+M1{{W^ʸ x; kLwrʹ}˴h[!t[m*o諼*ڸMGz Ht:wSmfjX|۵ * Ukk˾jT+@{ܻuu P[ܾkp% %,R L$LVlu0),<.Ž1, LQ73âj=? ğCEl5~LlBtQSLr`W o]Y acLelm i|ylLh5qlnLw;\zH[<ȪolDŽ,;lȋ | r6*ɓlU|ɛ\"y)ʣ:ǫlʦx@ʳ||zyUq+@V<LAkːQ0̈́ WqR(匯 ,,+ PL\ im kZ M Mq(( m-:;Dͳ w(-*M3 1] HMйL9-<.]B=LP԰kЇK.L; [zFzFU[ <`ֈzjЛ9X57Է>^ \D>ݔ`eMV{K-wKWY.Y;P >pmh=1^-!ղKӺv56^~@})N ;~׆O"%M6kXiׅ錨.n J < y*QM.t++ծNnz;>#g.Jy CM~Ȯ޳yI.ʮ.Fdۓ^>(eG^үNpǍXz޾-^.z,![;x{Y.J5zݾ. ˜lގ%Pɾ+s^hN}X? .Gf~] ,i:]ryzߖf}/SnJL~؈,?p—/왏ޞoܤŝOml ۫?ﯶf*m[PD -|Ho+J;- Jm ^knp^0G4OCVp_8f9dJTLVqV[My͎m_W(:auMto_<;Kaę5{P/pcW}LZ-k E.tZyuK [@es^7jhMz\㪏Cw~{^ɼ?uG;k޾/]gdmJ> ʛ!g=M/rM@\) A_п ‰uKC>> qF"I^\<ć qQlDqClDopC#`KrL@L4L62M86L9Ӏ57tP$tQ,eDQ4et R$tӡ, 4t_<T D%uELEUUY"G_5@gյZo5\w^56`Ubu6eeYgVZlcZn]![pp[? 7qɭ 3u]xw^z^|w_~U\vx` 6`va#8ⅹmxb3xc+cCydK6dSVye[vecyfkfsyg{gzh6h&9;aplus-fsf-4.22/src/html/Fig_12-6.gif0000444000265000001440000001543607215453031012421 GIF87ad pnnn,d I̷'h試+l@o,$rl2(t*vvްxL.zn|N~Ym|kX[`×Z[VTKƁ~iېwgfZfdc&H+LwKH!-jnb@!$ɓyyDɲ%Ò/QJ8sVr3ϖ=#,3RHF*UKХP.lʥᗙhj4W} az %Z) ;g"$ ܻԊZOaˆ+tmp%`ʘtwhWC!;a>;9)c˞tUMy)ȓ۳}UC6KNݑp4#i'}࿋O~ϫOޖ˟OϿ(h& 6W%Dhfv (3(,0(4h8<@)DiH|pbPF)TViXf\v`)dihlp"%nx|矀*'arg&袌6JQ& )f馜vꩀ6y觤jꩨuj1*무jNZ:gJ` _kl~Rj6|{k6ZF܆kYUz 뮧b֛ګE+m hʬ  GgC+!"<$lke,+H-ܠق,8`-HGs6't}FTS2YwXwbmMOkl-g x-w7^-i 8G.+pKn:^9w(B{.j:騧'誷.);ڎo|'|/|?/Oo=_o=/>ݏo៯>/o?߯sjpL  ( F `(Nxb;x}zP`?A4= P& d(D ЉP_E3?r~<*#)JwҕO._Kcj>{3l崧)PӡNOF]^Q<2x ARwKjUe*XgձN ܚZJUFUSm"[5xͫ^:ר=ӑ$պūZ5ed'ؗa*!Kz{l 9݌Vގ7\#;y1~ݐo'[yAF|+{YݔOV/YaܖeV39iܘ97پqܚ;Iܜ%V?yVܞC;w!WG[ZߒIK{Z4OۢVS5LR 7m][VؽvV/c#ٴUfb؎z];>UMm};NyMtuw۷붸}o~W68_w/µ ?l൮8b'NԢx9n]r x |j(W^s 䤵8v~HΙU-9s6̑ IW\uNr##Ǜcv\w};^w:蕬j҆G;^v]U?57.N<~etsV%Ǯ(;R|Mq߰cx{O9-oy?n쳭[jס*?5&^.onKczsGo/7t=[^] [yo1+xp&%SPrr e [F3x'hR 8 (}!m2h\NB2((&|]081؀h58[ÃNȃ>.,DX/6I~ZlM`4t8#VGȆ$a8N2j ׅ燻tXOhႁ|؈kx-L,xau~c㈞h|nH|腖8B@؉iVG(u4xuhjèZHH-)x(e(]xBH48(8xexZ؍X,x/Xd騄hh-HdXg i,)hIǘłx&8؏ @4y6Y)ɒyǑ0(BR7y8I`<ْ PB+ !9FZ*W Q9Ai2D!bYlɕ4MHtɍSiC3.kٖ~閄G}`OYwI+g!{ } ^xi"SҘ]&Y!-3ٚȆxsi99yo难 #LYYx㒚 uiyIP_,؜yY乌 +I๞Yi~Dk,왟0H y:W1I2Ww)h 5<30R.  J*&*ɛӕ ڢ-  |sy@QMiSK*OQڑ}74;#l]ukbAf.TSWmdޮq.sN☽l.5{}<?>[~R^a~w6ts}阞f錮ߎ>=Գ> :̍:ÞN:<ɮC=n޼:-wF7ھߦ~Mn S 6]4Ѭ.C], r9NsO<ܜ#ON o;^!%C>a2_ 㢓\P:D_F?H/oL^`6/]Oo.[O;_i/Wf^Sk;WZ91Q4 Yq[sO:ϹssV[vϫ7=۹1?b߾/e>?̹;Cr뾈 9^/g[[3oO>ݯA}p5Ơ2O4UWu_8gEIɭ6$GdRDO(v UWvߘۑfo8_q|^x =BCė:ƍDH 1KIMΙFGORLV=P(XۢJ?̴A_Y(4a3UVh_YGci2?hmklqlvwx63^5y|}tg v$XKdCZE KG!EH)UJ1eTrⳊ3u厓=%jH⺗E.e癠MN*(ŤUnRǮaR3Xie>EsV[ t݆l۷_T7z[p<9/fmƑ%J\we̝+ٳʄ?&MhҩUw /Eæ]Fk۹uL0^8Hggxs{ú<ϱo>$g%k_l#W/z_,|*~$k\N@0AAaZ0B %$p+0 7?ѡG41  [Dc'DktFsYWgSV[57q]=Wa X0EvcRYgl6Z)i]Zm̶["oQ\ss,7]eWuߍ]y[w{%jk X#` |aM\8~'P_)8c1?Nc IFٿWOek9`Yyg{gzh6hVzivizjj:k{l6lV{mvm{nn{o:(WJpxgq#|r+r3|s;sC}tK'tSG}u[guc}vk\r}wxw~x7xW~ywy裗~z꫷H:{|7|W|O`~~` x@& T`@F`)xA f =A~P!$MXBP)d ]h;aplus-fsf-4.22/src/html/FlashCardsLs.gif0000444000265000001440000000116507215453032013553 GIF89a<7̙fff333f3̙f3!,<7I؂ `(f[G'0lUhL|m r,jn8#!16 x#RZ5N-8+a7M` 7-JV{c=\~j!KO'fvb1Y`9KXeh=(d'puiiW8s~03M\Y'PqFO}q(]8MXtԓO}Y܄IxcșwQi7la? n7" قclj#To;'Mb A+ Fonts with Microsoft Windows  
[Home page]

 

[Reference manual]

A+ Fonts with Microsoft® Windows® (e.g., for Exceed)

Installing the Fonts Locally

 The first step is to locate the APL font source files (*.bdf) in distribution (Most likely .../fonts/X11/bdf)  and copy these to C:\TEMP (you can use any destination location; just make the correct substitutions in the procedures that follow).

To install an APL font for reading the on-line documentation with Microsoft Windows:

In order to properly view the on-line documentation, you will need to install an APL font in your PC's local font directory. You can get a TrueType font from .../fonts/TrueType/KAPL.TTF  in the A+ distribution.
  1. Use ftp to download this font to a temporary folder on your desktop.

  2. ...Alternatively, Shift+left-click
    here to download the Kapl font to your PC desktop.
  3. Double click on the "My Computer" folder on your Microsoft Windows desktop.
  4. Double click on the "Control Panel" folder.
  5. Double click on the "Fonts" folder.
  6. Drag and drop the font folder from your desktop into the Fonts folder.
  7. Close the open folders.

To install APL fonts under eXceed:

  1. From the eXceed menu select:

  2.    Xconfig
  3. Select:

  4.    Font
  5. Select:

  6.    Compile Fonts...
  7. Under Directories

  8.    Select:
          C:\
          Select:
             TEMP
  9. Output Font Directory

  10.    Change:
          c:\win32app\exceed\font\misc
  11. Select the bdf fonts to be compiled

  12.    Use the Ctrl key and right mouse button for multiple selections
  13. Select:

  14.    Compile
  15. Select:

  16.    Done
  17. Select:

  18.    Close
  19. If you want to use both the left and right Alt keys for A+, select from Programs

  20.    Exceed
          Xconfig
          Input
             Alt Key: To X (make this selection)
  21. If Exceed is already running, you will need to reload the database for configuration changes to work in the current session.

  22.    Click Exceed on the task bar with the right mouse button
          File
             Reload Database
               Font
               Keyboard
[Home page]

 

[Reference manual]
aplus-fsf-4.22/src/html/GraphObject.gif0000444000265000001440000001025707215453032013434 GIF89axffff!,xH̷'h試+lmy p(,$rl2E`JZvzxL.zn|NcYYjS|eQTYSy|NO|ybՊp`_T`^]d _\-JG EnPE#~C/ȓ( ܲ#0ǘLIWfYSgG_w9H}P4G~t*_ ?g`R9r, `5?O|/aB V /6CyP! ˆLR/{U?6nU^@e~_sU܀ ]wOp._Q.fS`Z\%.?a2E)+U tafk<-ow;^u`dztAUr9\ d"nd7=Vq,d.1یWe3wm޴f7wQ[^l{> ?/XgC).P%I;,<=]`>|OC Ѣ.ٚZS׌3~UIz_5l}뇅ZzT({\KXc5cˮRGtAhk~$5"w H۠R ibY 0K]8n%\C|8eG`,muTzRޅ:9?kf1Uj~`^E\b:o}( B?zWT'ۨp$̓>gסGN/,i? #n7Ȩ:P:کȱt%Nw'}X]^?qc nXs-*C~c.,yz| 31uqJOuƯv,Wtrzm2/aY">+hG?''G}}WtJnde;5'؀ۂ{sC^8SU+{v}gS3R¦sfZxVȁը|VCR=vv?8t(gW׎<(OgW?Ir8rSVyU?"W78v:Y-hI0N4)l3@2uc;'TACYEGYoa}7~gPxwؐE’ qɐlIhpXNc3 8O[)hz~Y+9f9X9әIq附ZMuE֧yUٚ\ 8yi]MXٌʩZ)YfiY*Ya٩bxTƹPipIFљ"qiy%;̉*UMy ST݈u^Q:]VSHE~]j7ȃwJ&hVmS-[(Z3J5ڟ/r1jss|I٣L* n5Kj54zť:*.}gٝfTdjtkz)ِ4tZvzxz|ڧ~} mZfR*x zY*5dF*FKN:izLթڨjܩc3O::}*ZʫګUʬʩ*  *:j h⊭JZomJvuǯ`ړltnzz)Bo_~ ۊ@*X9vBI4ٍH={(yhKsHHXA1*>4mvSɳSď([&Vht;D;~ٖ {$+,k|U[⸰h;_}S+kiK1Z5)z:;y' `Z{U-sˏv ظFȆ27 7+qU+/X)E۶}   [Nk+N[t)=˸; TZ,yV+-ѫtȋo`Lڻ۽;[#5껾۾;[t%zNm <\| Cee<~w$<&\(|*,.0 "l 368|:<>@ߑ;aplus-fsf-4.22/src/html/InfoSign.gif0000444000265000001440000000275107215453032012760 GIF89a11ƵƭƭΥΜΔΔ֌ք{{sskkccccZZRRJJJJBB9911))))!!!,11 H*\(4dЀ 3*lСǏ)$H_(SvPPRI0AhYPJf,B 4rA (iXM%vD@  5Ў b,c *4RhP-b ֻLrHUT &TM 7x<[ ,y#h/R>XZ`m ؔWι=J( :5z0+tQA%x T 3D#`,@<$鎜gtҭ| Ap$(`a1J1_yAFWuWC*ǐvqs RK`BiHuu@OEGPZG!d JE @^  PCVcHYT k\%3PfP)A}XP vA\v`AxDVL e`0gnq$[}`hGIК&tXB$@ם9h =cyDۭ NA kȂ,B$ҳ9DY#j;g@b%{*EY*c^Ѐt*A KijBi5@GwHZ `W:UX9Q|_ Oa@H)5L5լN2dp6 kβv3I8CMTEF7t@;aplus-fsf-4.22/src/html/KeyXp1.gif0000444000265000001440000001030107215453032012353 GIF89aZf3̙f3f3ffffff3f3333f333f3f3̙f3̙̙̙̙f̙3̙ffffff3f3333f333f3̙f3̙̙f3̙f3ff̙ffff3f33̙33f333̙f3ffffff3ffff̙fff3fffffff3ffffffffffff3fff3f3f3f3ff33f3ffffff3f3333f333333̙3f3333333f3333f3f3f3ff3f33f33333333f333333333f333f3̙f3f3ffffff3f3333f333f3,ZH*\ȰÇ#JHŋh@+2 (ɓDJ4i2Kʩ>g *pMM`p'QVX%Ui%Ab}ufkW$pi֮U͉JNKe#ΎK +ɘEK8e]b U ΍jsrqn^cZ ceM:qRqWL["мJjspMG̦\lk3U† gfҩk(PAdzx s'e4u5xrFS|ل[KdރVH[P{jۍp%&Dny݋%2em8Yu(jHy7nn1ס~@Ǔp'Pf~‘IT~mcz4.B1idh[@eL>9x9Qgzџ*蠄j衈'Z%zhoF*VjWv^馜vꩧ8*ꨣ~j\-uͪ꫰ꬴW뮼^W^ $6l_%V&Ǜv^!k[~f[J+زk/+l[ܮk w}&  J<1z[1ժ@*P@*l+,T!2n<6D8  D=4HBAt~1HSҠP`uTPB l"0BrmSP"TUQXmB(NAtk+P º.ҍw+HXB֟-l<6-&A֡fAIE+%: n9۶E! n/!}j<ÑGs\%W[nnH+*ہKCժV5K⷟{q c$fO C|,Fܵ &!GЁ"+8\G9I-N3wJ81sU.|O)inl8l"0س*3Y:iͲ:&r9Kr^m&MClϋEDKh6eiL{!>?MjiztW]PzԬ5qNMTy"Qu4l[,Y#*jUcdjPKqyİY &'>!ڎnZW[X\&=nddߵ!2M{C7g2HQz0wDx5ݛA=7db%2 %u3efko~NL[V1}|cB*c8k=!ȍcVbS7n꤫Wt e~ּ8(8־k4z"wc%V-h2ReQ[ڥP]i??*E%?@6>mZU_,fqC2(N "~3 ~G;aFB~BF%=H duw$TruvDm<ׂ$}zs}`w:w)r{7WZRC@&x)d9+(UvX38Jd YU\P`bn ,Bt|p4x5H6w'$da&da0FS2F8UbD!xaFxDaw'4yACcb8VMc8I\S}9v2iDHhy82,1eV&uP?;8ʓOu5v5)D93ub"by>zY񗘉dMHu998@WOs|'U[>^cT6V#2Zc_vS6IDfWzؗfi+ 1ٞO)*,p%S)dQOe}4XOGG##-Qi$S2S#>AsR6U&Q1&N =Kn^Ѡ(R%2f$uumIqQT(A'%-g,j<S@ آqɢ 1X2YoG2soe8Pz%3џXz8ֈ26'#&9-f5fc("xz٘#G3GjeB<d﷪Vx'#V 8)"Sji!jLZ"Qěd)_.I# ?p(íYZ(#YZT>_g*JI;aplus-fsf-4.22/src/html/KeyboardInt.gif0000444000265000001440000025234107216230124013455 GIF89a̙ffff333̙̙ff33f̙fffffffffffff33f333333f33333333!,@@pH,Ȥrl:ШtJZجvzxLznI^x{%)u$~||z$)${y)u%|)(Ûv}қʾݖxՐvzD1ЯB BjY~hE8Q tb*vIɓ(S\ڜ0cCR !2 u,C()j*z"UU/ @W( Ka zZXx{a^xkSP3 `-\B8^ SF/<`[wtDq@>jO{tp~1`@awRRqpdښ 2CoC<۵S-umK <0򎪕r TIywO-K{(`g`h`I=&ӃFEPvVUruNOE%OxZj~,8\TDXftwmHWEAl`d Ple#{k܅ pHR rUXL yWHbFq!h( (Ч% [PxHa  p`g!HXM9MY&ZJe@]nzyrY*g5T0PeVWC&``"U}Vo Rs h&Gl`ׇ 8ꨇ萫KxHH$;`kR.@&Iyx*n_҈|wŤppM:m"yÌ;Q變 JHfGC"eCXB?@΂tH2M)m>Lc#"Zӥ1q3qXonל1g'y7PqM[-sӸMLp?sU3-%9כ0I.I73lS3uuDzTo#~kՉRܖӼCݰțtRƩ4=U۴T<9q"x^41~0(:} *Kupم7f4{3 E>E$5 Z?C7 *S*$ $&x Q 8@Fq&TXJ@Į"F3< F𨆿AX( R(?3b;mL|RYb8!uOLt*C&o;Xbt:y~R+QC ۀ_7֥yH1m8)`m 2c$qe,ay x@*%-KJ &<(3+&l` p!GBi쁓۱ID>W{[aG`\ 8+JN w:}#C^pvyGVc9Qs[ys> wt>w8MNuA'Ѝ.ٰ7_?#_vsR':Iw%2.xcoܽu>ݐwXD[1{Gϛ8uS>G]z`D?{ݛIpr}_yE=Y&ߎ|Z7/{>uoț?vG @DIC)(H="11Ƨ 1>%21bgY)>9 JE @T"1`oEBj*:!/~*Y#N";`ՓN 兀ocb%01 9aX$0&R8"Vꡀ`@K r~fHW~jhaAP6-ԳA*` RR %Qd8 T `9TP\G5*x!%A%H8r#`8spXE~`$ ˔$@\ySltS; n1@pJ`08`6$ÒGs3xS-@r 13-+Q)8Àe'HC\6DbEpE_ggk8mH#aG p*|E^(yERFh>p3fQ00ʘ2c0Q'0X?C|x3Ot(f3ƐӉ?#xb`F②rT }h;8 df>"UF"P`@{P6:7i FB*Љ %"`1y`}EM}?H:͠5S UF8qďcdjxI0~d} #&KkY f0\i~0HM;E,xWc1؈>U4&iOsT`Hb-q ~2U 9|6ȘA٢- 4bV '/vPIQ(Jk"_5yH5Y>*B=@ypjx9eF:8С+y_ʘRʞVfSFBCIG=PZa&UC?,ꢐ 0 e"|<  3d7U[p #E3zX@*zz#_z\1F;u5hF9޹oTS .]H;%#MbbXD?<? :֙XD 1^D&+6Y9fp92"!ʠVS \~#Lj𨑚p0 g.) Vuy T1)*rE(%yP$C$ t*aiBh!F.} 1Ӑ&Qď!`ب!"1Kp% "هF O^zbv_n)9 ť 0 kP# h6<oCzE!.T5U5Kt|p3 "yaU``x넀 l _iK "QSJ橣#؂uaZ 5ZӡsKNʫI9

ҫ𡾐zXY k@@_ {õoq;ɂ؜G zG}p񣁋\ib{WFh!*Qk ̧8D?0@棦#)t1d$*B*90@RR 6 (=JDC9Eʾ;ĆU@]ŚfTģƝ\,IUhI5p2FPψ(l'DgJCgT2|ɚ,hEɁ&<|ɨLy,ɭL˷,i˖ ˷7ɮI6HJ]@MӆHjN,]]*78}oRmGMPV8\^ W87F-8upaMpJ WMu-u={]ؓՇ[=G}4e b"|M #/7b=#&2xMRڨ ڬڞ=y $ٱqM۸  1,6x=ڣq=pM#۫=x]ɺqٽܸ}ܬ],b-ҽܼ ݹڱa 7==m ]۰/]ީ]dݠݦۮ-۬`mN޿/ ?1cݱܬ&nઉ ] ۟ }분K>H.F>*>y1n]ߣ=H~m3NCڧỽ՝>xl h  З.&}|ʞL!Ѓң1GldyԇWg@}:\eꩾꭞ겎`۰^JꯞGn^.~V>굞`e`~͎&=V~^.CfNmn pQ!~>lU .>@BeV|Fe65] KW4/+\3!0 "<֘I t4 [F0qi,OQpHQ<1ZfH+I) Wz< xd$ IxL̄ v c:M s Ǩ$#=S_x F]@"/ zUlVov XE8ac~P(pzP,&!FZ oU!y" z+X# Y}3+[  :ITk q:9CA2)dT6(c9T*S('E6E1v*ncSk[p17(4ӄ>ږ:864(H*4<* <z}DIRxRȃS0|ѻz1I~݁QE-b"+"NHcp*jrJNth' Il8h.la j$Qb%S@D ̘}6N$p &Qy#\Peᅙ(H䩂$e `Sl4LFlO5u9Cq$1sP@T,BcClRJݑ~&͉ >B#+-m<)ѿ~qk8߿>xqjV.^i5jU3 pff a~_ "]Ə5MW[fctħvTp->/@$/C"NK j(̡)F0t$F̩(*P.ĵLrv 0g{)Ry⹧1N)+AN9 <`0甑@\5f,(c:5H\OR3CVnϽ?qo=kڤ/0C5mZ,  F}PR@D?C845GaS5oVK4]w{&|aíL,Vmr7e}"u$I(er`+&2W\J^ĸ%hxI5 08sB3 f3D\L\4$3E" 4 =!Q fO(*w D^Q3ʀ;lИL hAS< #D2g:USӏ2 0S:f\r(=1ϼou"A_gsx,':e0}苞9q gMjCR++3Xŭ$! 8KvDPWdbY!R B7ٓz͸x`&?^M^gM$U!Đ6WQlCl_sB<8!Hb*gocU`w]PP9G}J kr5F9 & yrzԥ8"kcQ W*kX806ijb΅adŪ"h*āuE(Dh-`cBW*J W8c^Ne,ǣ}d@xIt @ t=f iJ/:e jJ7ZӢ޴p )\5j#Җu JzV_,jwxԲ1kVךԱ1SLeGŦvfmmkKcqFlP$(R`)*dҔݹ%tGY-Lݕc\N .X{a8l$IJeQw~<|cJKnDGǦ$Q Q]9=EttO>7.`%L v7LTQUb,f)q#~=e! \E"딥km߲2"cx-5L[_'BBN*0V{Bç `ގ+!, A,0az|B`YgmP@"8Mx %֧ OKMW,|w~?jh0!dA6gIHTBWϕ UkA3qa8A$ QL;@!XlP%خf;Nd O Ry*/CP, _FXD`F`M&"/#Ǝ F^P{pMCn@() R07Dl + r"sTtaY,4f* XhA.0UElPoX@pfafN`ZΐxDѰNbCcNe{No3be9%  kȜ8 K%Z㦈+ξm }1EY0dцC,dP/Se<0o4SH1C>bNQ 0ҭ.F0@Qޮ:.i(($N/qq=G\<BrDp0*HZRl̉&a2dz!` np XR(0+}d UnH -`,g*/cRfgҁ$d!@oF9*@޸bbx0R!P""/i 1Q!UmRD2a䍉.rQ JAcί \a̐6%~17}M6!3./B$T4^8B7zR@8 TzG;{NMVaULj6-֤Hhm~Wڨ~d7~XW~O 8xk8~aр87=X֜~-86㷂MGH8-XGx~AX=8:*sy؄9؆E87iXSXmmI_Xx{x~Xum{zV<{/!!DSSMFՏX{׸׎̰d~g u)ʲӶK tIYU}UXa:~MLmUjXg; 3LaٕQ=~ymsNٔU9m󷗕E{9DkٖoEZ~yOٚ7aYE،Xaع[9gٷ:yٜ~'!YڜyYWx8zyO>mfOzY!}8 Wg$E,Smzy}8v68UڏAy{T{A{=饏j>l7@} Z:ꚮ5=y@}ZURIr&` j74MQ;U'ԭ#粻d೻&5(oPSVʖO{HlXVsK&dB.zNDymL nrf;*8fkۆ;U;n( \XEyXXӓ#<շ} {{ė[zWa ݾ9 >ڱ䱤9\l<>TY>]]KT~mUy~oG`W}_Țoň觾[Sx^[끾}/ب9P荞챞^uw뭞^{~a>~>푾~>_^>þ%a^>>~{ W_ '? ?/1}>~/GW>Y>۾gY{~oޞL_s,@D@@@B@8<"%|Ţ9@kv9u .K>;1S4~ge Cg "uZ48$JNRV%9lMaJ} y"*͢br*ꪎ&ymڦ`l>G?:[rwORU0cUE{ S { (p "LM^  "Ŋ/b̨q#% ȒH y$I(0$Jȅ)TҤ˜<_̀LX6U)rN<3|Lt&չT)Ғ^= % ]C?< k֟ZIBU=튷HQ^ju^0|“ze IAt = 2"E3T]E8Y"ڈ2H&#JI鎲 XZ%88q.Z"KJ3 iQwԒ)(qd!Nl./;>/;(EуUb4 ~rY)ì0"{ T2!QnI|H.'L5ɿ(]U鶑 y])voʕ43ނ^YbN&} &Er> BfkLJsoWcuIؕAeS%Qoҹ>>DR[Ud0GC@ZLex=)U\ug!+(2avqLDU1/ %*(*˿_*<-1S f-<([/d2^``=I.yЦRyH*t{7RD'KƅSRŌ^kUi%T%mve oڕzӮ6}*_-T[0!roubTbY'WY(jNASϊ&]F/(@Ntn|:DKhIjJԞhWO%ou8>ME lkǧH8Imf*v;N!x0 q7۟u7?z 7n<<v~!ŭ5X؛xy3gaƽp/|1s3—܅W{ʜ{ƹS*Իw=HmA7xF8ҕsqW]ohzķ>l}#Vݵx݃kCz{rw{.~;>/ލ<s#=򛷻Kzw^IOyW񯷼kn[>}1ov=?<Ҿ_z^gGo3?ÿ=}Kge}zs?֎;-rBe'M]Qlw8F5؉Ȁm ԙ\B`jBjb ] *` ɄQx`ِ ` `  maC a Z `J`v` .nabcHrFCC?!6DajG~G @ޡa "C6!g:b? $b 2#b"'j&jb'$F "a&.*T4B#a.aXtb*#zs,AGhb&G/6F%%"$6b##5*%b3 c$f$j9"'b=x#`a6b-!5*20c4?c dEX )yllAWAC( ` DCڂ5l\#8RB ɗD̙\$DX}TSJ @Ed| lT0SHH2IWMd^(HTWxGxlyt0@%AVВVRP `A]yP܅TEْT@2)$L4}A&A$B*fd `m gI|S|E:&JN @W`@f@NgҌ$PxMzEQ9;䔈l:[WH&Ox T]T)OCX"gcGqxPҦȐ,EPxofdΉImpq&Ju[&]2_qFj$4 INXʰhh[yZ9Dgx I8ah@$b.~gJɈOH( )f pIPJ@fzftv(u&EVn(itbIpP(3qVb'~p؋^S4Qr>tՈh Pkǰn)NqOKNP'IMF٧Q'$'zfPSHPiʰQܦO6RĊ=a\h^nf:MteÀށh@MzC݉ X* M K|DBVte0OYjR3j^=@{O)eAQ^:d V6LUHl(BhEnI^=Nki ikOx)I,le†T!JLӻ!H+zTCsA akzi%)GC!l+HϲӪES:ZODHujrl+FD&ԮZE,Fs+.Q~"m)lR-4 łmv_>j."䬋Ri,R`엩"EZѪR "EZRe*䄫(PS׮]YmJ˾*JXGn,R$UVYhmHhr,ۂW IJZaJHѡ)]u[ ea6ǽr69yݛ[zyj W93I:+zߵ,GzWY{lϹ#k9zw:Ƶ{:+:ǹ:zaK;yszS/{/'t$rsa )iveugM6uv❘{{6w6ᕻݍ;;;gwOcCo_=7:Nvv/7T!xLVj7$dR\'}D\7Uʛfj"ݓGpq5ă5RȎy]~gO4XȬAdtˮhuO<~CN6lgj9o&=t>_hʹ}@BW>Z_toSLPEJÔj'o>x}t9 gj*' c<7 H*)ucr|Fk sz~{~ #I`J9d0d$ `$An6Ss]TJub=Jϗ.ߦf7X \JO f=7BL*̳l3gFoÐ^ƴA@o9&ޛ.N8;p;FPI+9 ɆHˢr3#J3j1c90,ϗJN8t2a3DEe,:KsFQpR4C§clE 06cTdlC"5\eѶ_p5W]w< `u1.LɊtJSR6Ekѧk3%SYTEZDE$oCK%I.[4*4׊ (0ke&j=2BJqO%Q %Hk^- f *٭ֻDztOoKfhcbs*l G\s-6H Q2B:kQo5l&_!ZāUxrciQB'6x+|L#@ E\F-e)] nom8L.'Qٻode+ 'S jXO @2,Wc*wR\@Nx'ω-;Q/! >~!jtp.<ó"Bc8@lD`v66G@ˆ:V`P$0 [(Ŕ M-s`r@Z1oGsĄpgOCU qXaMB :T)dA I6(*\!5N:b x AE,@DY w'}G| N}V0g6CӐe`Ng%# )ВdfP5IN"50Dn"d(pD8);,tՔ9o reͲ@/)P/#d`gH1 A(Rta2`̫:Erc75l^bm'?*'hjxtMPžkdBӰdҡ(t$ Gx ^gPs5K0(Gg\"F3RڲͨJEj vtJ,)h*Ŭ 9U(rE2!5H:RԀjm\KjM+ P-U@iVi* hAuUg RPLu RcUŧP*VEVJh^m>kQlkQ+֦XldRBMh4kZ Ze/nʹlWJVm-bWֶ%bqY΂6}kgF,`oYJ67}Zn [.w !^z6-o˅w畭c;Y7-z]+"w}͋Z7Enu{]z5km?K %( 0\DAiaWB1aՌXSbOup6OK f,1}O"t4/u0*5b"w"6qU-˘vVa.V1b3WF5oa~1ItvMeelc;xtn2_e:YvƳMa?8Esb'{1\b ^^]4G=2iZƻoN3]*2iZ7×15waF7"nvm>Uh}t8h#NDU4qX=prQ7; @IpF,ܔǡsږFW[)/O-=Cx+;aܦ.#$Gt"U¸^o.<(qqFWw"Bnw}3 z_#0")p < G$ ܮ=$y.#I #B܀wg-*ð7$TBjxnP#W9Py?39Cx^{;zK:?|gK  L<(?)'Ÿ//4G?e>~ה\Ii9n7v]"|ۍc CI%i+J,9<D3-u 'P+x+H)X~:XI$FpOC qo+%l,9Xږt{҃@A,a&Y» Z$pH 9yBe492R⫅F̞ @Ky!%BlINyIy$)lUq[|8JNC>83:=xAȱ,9lHt@d KY ܏+pJ4FXaXB̩5c%JLEd$tE2& y1mI$CX1Lؠr6`ӧݩsg;"0ԁ=A= y@X`;h8؃9@pBdX 46Zs9D2][ZŪ9-۞HD훧}R4ۨA5V}$K Myx؆8 YYh:؈w8 }U6<6dCT(3G`YٚٚU:Y5Uuٝ^0U88$H%*P^4޳,$?} = P=?^m e9$]_%t -K_u?D`]T_6`$u?EQ[C& K00:VfV0^afaa)!CVa#F^dj(!%na)=6b&Ndzb)-)>b&~b-~a b2b3~1 5c-0.b7~c?`ԅ؇UXhW]8XuԍXЭY@@\WX"OXWmpHΗ=ٚY0)N[ZYG\feYX`eceb.Ze^egxf\fe擣OU_eafife]f^9GY>f^&gegvWph6gjj~\eF#k]ffa^f^fw69.8g]^igqVhkhCT2Sgyfhw[^fvfsgebg_d&gw~hX9|YghNf٨txꄎHxhNhvjwFiigNz:NHfe6i^ejk>iYnv^bgZNfN==k=έ c Eע8}l]ܝTY.V^+T Im&W6^Npm֞fhBVյWVm6m^m_mm.4:cL~nmݶn>ݞѮFmo~mN>mn.nn>^~oզnNoommFpJ܃o6WoonNMpopM\?X\ yqMdr?ѕdAÏ,?GP(?=GDWEgt@삹2 Q sFht;,e^z̀P'uBl(;푀0Jttz^N~nNn../>.o"r˷ LPv"CGxpIv ^KWjl<"=.r'=|0lY^Ώ*=aԚNQ2e82 ͨυT V.+dž5"WHC| 8 >8Ō;~ 9ɔ+[9@4pAD < .t^}jP|!{(mlċ͕īVnQ9[x`X: 8@\${+5upUӡYh<Œ 1ZxU4S]y̐s Hz BqFFAPl@%.3b2mZR߂9G]vBIdF)ia2ܱ H-R"Vzw]e r.hiN0e-'=fvF' #Hb8h>|QB R饚Z$sHZJw)r* 9 %:*ziTd |$d*knJ+x~j'J,)0,4 2:$4 r4-j*^ԞmҒZ|ΌlsJEV+ﯝLJ뫪 w(",Yn"+2`ܕ@r/L5]2߼3F,2\Z.K45\:|=Oda=O sTg]5L-@R6V4Ec4P@JW-lǍ{wjS @PG o= 4pC.5٘?MV䉟]A8o^uϣm`]{rݝHKѕ3]7)<}OO}УrSCE+}_׎c>4ֈ>w~ۨnz<VΎ<ƁDKҒ< W'cRq*~ۄaz .sJ|B~ĈO0тd,ėB/T4)` mC8~2f@%M (3n _! 1>/0Dv(J/Je4MS9npi,$"iQͰ ) άY2)@ȵLM([Sy3!ox66 f LI=!i4!%btK`q\(QUÒ⮅T @O/GRf  6Pq5Ӽ,5EUmZ[8u+B鲙  H޴j!GB`(1|0F|*R6:̫k pThHvkVnMA~m̞Qe2pY[hD/K367g=H! U[ۀz@V>oFTӠR' !$%@[TxYM6RM<>l[x6 B~\.W9@Qv`@i`@(sMy(_{%뾗e ZxwzM8fX(YV<* W0аQLmrK)1iǵr_(2 [@t_hNr`jID=ԎSoZT5)"Cu)=mf[CT4 '+le-0mQ^7p@%ʷYX1Mļ5[hfewi<"5e .[B1pA7g o]L˞`atԛGn" ef lr$xƬ7\uۭ^$гJ]e,.t.^߯:>xs ѼHVfhS yfȃ_[h*)yfUbԿ-t,q{"̨,K[)FWyV/kkOr2mY.4[U#tz\+:~g sSB;rpvvYOCgݺ Pz}u7WUct\S= ( %"'jwC&=sWwX$#UTKOvV7>4It^yhBPpH3TJ1JgB23dք[3{Vdc ILUWnFYc{#83ؖV脂>3&VyFC}'׃r5x$4eFD3y7s؅0}Ӈ]OQCgGakꄁ䈏8=ȁ!yW2GwbxqQ;3hN3i6^xN?Lją;ه<~'k;yJmKFUl8NNBNV3Z{cELjb'8xM㌻r 2|X?Hl9IJd<QeVՈ((hqrndDhNӤRvBZ󖄖'_Þ(b|Wzhoae;3FciHJu)3* =Pwe* "4 @[GQ\ Ƌo_|}xZ9iw JT.S^M؊7I4:!z93j8yZ^DhsL#XAպAE-9CI!n-S` {VŻDYX{MpExrx‹g"CaFSʚQhI4[*4l+C171)5CGaHXD[X'o;fI=ʛxhkqw#TK.əXDS /{VGt󇇝s4>ū&{}j0K/J2Y#Z8$>8Y?B;4Os:5iܛtm%L 3:~W^Gus2[ Yx .w&!-T"~727}CDAn*~L^?/!=^8N>GnM~.rV>`cTIw+ցdA&A6m'1z$燎ɦ* Fqn!~>N隞lb,t 餎GAV1^.NNlqxA@@Qή7QPNƮu'#@TT=l/nw3r QP ^ /Ƅ n opnw ' N.3/)l\ 4!o$_+#1/U^N_'*!/_)Wp.o/k/ACET ^/O./]_oZ=n8?#3~%opW?#ObOoE`-=sRoTJ33z Ko|{;*Td uN_2xI$BL(ZOGq&kLm(@ÀHǣJU+*yM&LxdS5:C/2H5 #CKl ̱ OM+%#qkOhrJA*뫮1in2-o, IO/ U*ՌwM6lh-T}>^~?C`@ 48C? IKQ9dt`yF6[!?rozX0E0V* !KI"3})zhOt"Q0.B8`g,0Zal*W$Sը3bW]Ij/* eʙQUꮬlmBuYvo_(thѣI6AիYN&Kc<BmV!Xm;ă"_mHCqYQvxua QnXpO'K>ߦpN` T!4XA΍`;m$ ᢠL  { :.b` xY` ( 5W >  "<)c ,e:8ßOp]$p$11t 5x=:!ܓ>Ӕ[֢:K+q$:E0f<ҁ8!f:0/2S 8}a%!}PAE;ˀ J+1"+c3`մP܄ӉP!bձ&"uKU g͋MN̊6<1(FW0 aGZ%tJ8dK0[ QfOE¾;@ju2FOp݉+Qs МuޙQ+*t:BPN@"8<־ 3 xSV#k_L͹7u6݂jšիȮ3@p&tI{Se*Fka$N3J&Ypp7/b` \: .S;ّ[& q@o3%H^P?1QIW{Ecؽ!"[R|ɳ_z~~_>Ϩ:}x"AVncO(y^Č t'a@Ҙ,p]7S-3WОwsZ R!d#0 6x@(#܏ T1$ATvAS*jS)ۚSZ _C(›2F 3rTȄ,@ v"a( @4 s5S"*ebd ="\V4)t@s’'7"t AP9KX@JВz-E$o/bJg .Lox6!p`  wx5rAFfpىp,TaNӘ#"ZD%8/>p>e lr)`M3Mg`P 3[e4)g+.ݜlLiZS iINS4h8!ƹ?)Kۢq̚Rx]V'BW⳩RXםeO S3Sĉ5|Sn8O`5n5[x .,XCE!PpY _E T]9W ^GLĈʪ@`ջ li[w/ 䛮?bU7 x@)1&9)C;;/2_3ؐ5"nQYP c ĊN:h[g6G1.Κ/dcyqG`ITZbhE]ʌYVg2j] `ݷFD *O1%޻\<XM#BD8d,*zu5YAnd'/x.CQɐK=5*m%Amc< H KbC/#Y<@r(`yHaID)aFcFww9*T&c64~*N @hMm,`߄S0]'ByE "W rEY+@ougPCOq 6*`(g"&G/$ ^hlM0yj(/\Mب7, #/TjE|OW^PЃL XnȀ-Ϊ2zoLSn 6 `f)Uf 5  h@&O؈hoERb>M( ,)5ʹڤ)`H 6iGΠHN"χPH6vX o/D@(fDf1t fý4~6Βh`?䌿Jq*#Y\ o~|>8e;0c eʂ9:dm pBGݰv"g'`SxH8zy|l3Q@HilL|rPh&l qCer Di!CA !Ւ9 OOhc& 63X<"Jiz)wC@80x8 YL:ϐ=,]঑,' $, h,|xMB^&$@ނ,)bDӒ6n ]X&M@./0.$CkrEj7d$pԾk,0ho/oNL vL1Gn"3CZBe`l&&9R~67' -1،ϒl .kɚ ɮ0y-l g21ը0KK rΨrHZn*rn#^svl<э⮨S: H D?6JE9WTӤcK(k1Ɛ # MzY ʳ==J8H`F%c%쌳ET!m^nr5BFE fGH%+CLATJ< X)сGu!KL<} L .TL/ 6PC=הM+JQO+n"!nXODUOO$P VcUVg5VO VmVgpuVcRbWsUXVI`R >XY=@8TJ5XZaYHBZZ>`0WOFYZG`+Y] \Z?ZOoҕ^5[Oou^XJ:P Z`u_WGb`vXU]bY"v! !cY/_/LLWQZbVWUځUTCfEufffMpVgg nhdohi Ɔviwi6Nhv-Jd6hAhifvf-aaŶggi\lBUYnnR~.5n Wo ƒoCp6_UoWpna wq!rIJGHO7  U9ώ @>E&-{?>}sKSy>݋^5z cZi+:C"2FD(&FGʇ;oMܲ^.@ eBFT̖t|4޿Ⱦ/ܺ>>`F}9Bվ~~@ ">>;! BE^gOFjf\n` GXŔaVK *Wœh?onMSktUn .0ʲj?k /NcM0ןUX%N@0#e84 GLlũ.HupT"k p 1wQF5-Ё⣗ PHMFجw)2>av(:AaMïbF\Re8UL ;gOHoeWĚ5`HC F@!%UWO U0JZFdФ]ȍd0ƫ`k^fӮm6ܺ0.\m<ז·rڪy⬯QɼD!AD@ pFUp5P`S4dIM50 %P(&(ZB1RIU%HP{"6>hpXD aF3gK `Ff&a Va l lz(*08'r)q6, RPOUW݅՗i4U=p_eXU=_1d?d"^jeF1 X{-'LtwDU9AS"Rcz( !bvmu%SU %8ލc<Ѿ3Q} #Ci |-(q?i|XFP YIYHd vڙxA } 0z4I+4fqU5kF݆oTuJъٯ!tq݌q׎\;ăid\gW]u^!hY͟iu])<+GpW-^~M"ݝ윳$9;"x7? ^U%asdBDV7F bj+!fx}tC~L>/,W,Օ:]`L{Ğ0(dv]D}{P"1o<2(<f4 A'Ɋf @=NKc%YJoAj![ 0XΆ=\ Q> :cC-<((1"~^lGS%P؅Hf:051VFG،XGfy-#9R2;kN Qu.mCCBI]?i A-jL*g<kZЉrv?jFo͡8n>-$Y`TFa6ʍt d%aʁE URm9=fSՃʪE8`* ! >_?*Xst $SH4l_!'O)`(=G,NS *j`i*nJa*txNv/]ZݫXBlC05 r#YLr{  (p|he* %(p Mp10y&$A,li +*I >B-K,Zzf!Vzwٛ{I% /B')k6ql+ZӖ@-pD%jCȭPG&K15 |3R/UY&j%I IDLyezW3/.0 ť[d3!,=CZUca| 5w޵ԓi/Ã.^E ;Uq 9c&%Al2&"Uh+P؄ZJKKXr%36/ms3m S h&`FS)!TȻ)r>Z9 N%Kv_ ?FlHOX8-yD["A,//tn< b&!歕hp8q:dw1+A5# wt%HnY(C, B9 qlP: R.-խuD'<1>wnύi JǙܑ  ݰ;<@=tY!^asa&#.v#! ]֠ N!a<9#bj ԃP5*z!^[!/lb0֬s`!TC c/];9lD6d@Q?QPJ2 sdB) IVK3"c-b2ʇ8cuA xڸwPh99N#{yA T(@B-B5`cB@ƣ9ͣYdd66:?ag @F:c2%] \F^楨$,<@bf[2U&`NWc[efed2Pe.fb&_eaRJh&gf hb}f0fie`B&l^&n%r&hgj &k6Zks&ok"'mno&^&w`jyҥxTafnZfh*fYc4a'hFb*("&("^(&hlFӀVhz(nh("&~gVC]Ězlў-׊B-->-Ⱥl˂NlBmَmb,,+v~.膮.閮b6hjk.Z*kk#C^|@Gz/>dBC6#", o."Vo//C/V/b/񪯜+04 f1:FA.#0o N04MVoZo/o0p>/o0lp0 _0ү0# Ϭ?d k+ުz+.bz+~1X1lSA H}VETb`13a+q!1?760gt#GوB Ԣ -* EiU>r(:F)""T2.1.wf1/JrdH\ RPJ*)c=3 )303/ub-j2s&Fea6754Ss{ausis1 5Wse1AoLs 5zb#Y9g2]B)#P0rl2Dwq44LV2sFH1#%E3WNEhtg!JJHWÛ=@Ȅlι܄d6ɚ#`N_I[L2KXAH׳Q0MW5DScNžΓIPFd ~T hs̹$\@_U5ƈ\O$WV$E XF`CCu.f=P.0rcoղ})\@c!8yg3Ȗnʀw0/K=ΤSpA'g:$B :PV.1u(i $ (8 JQg@(By ' B3@H`lD$)Kd Cp1C)\,N(p8/sME:\RI*̮BdmNs*MEk3tUX \ҵ\o5p_vؓ $z%X`YAbvZ*M䂹u@t!C kM(v.J K9?DKmO@DО{C`4YRC|\AXY '<{ $52DQpX COٮ?:LjQZ!`7LjtGSfϘ'EmG*6?ZÞhVb6栦j0bmζn({oj+}-YJoX0لtRݩܳ8}9~7H!JY pr dۄ!9CNAٲ]$Zl[D $nbtNꘔ#^uǜ`餫i sk"ןZ_ϖ %A$'BpG bA ^i9 X2BPY,ؚYKgUO I $8n]Ƌ>MBS>č㢂 D;(ApEAcx M`@=rTX|X-zǝLKx O| X$,#XDh8OT Y@*p8a(K&RK,˛L3_cDԏёJ<85hj,ܭ0iZCJָ,QPYA \P{P KP`OsgqAΛLh?&zg(`L9MH%Be@!PF&KǁJ*$q[ }[J`E0r*0.5GÆ^ҡ[J@DC隻?D<`h b"XI'k.C|XR'qj8$Xucjqs~ʬAWFCKP$vouY&VGKfEfA[(W}+IZz  A0!>4E b[;B:^uc"# Z \ QuXPw%~oT!7hhu |`'X fpAp}$ WXb03 _xE*88ibbx%,qe,*16?*0|jKfr` l@c+D x@`Q,&s,A@ `kkfl6͵3|I+fa.nK)A+ф"h/S)0mѝ40CsZ9u@$ӦtQ_!gvuFUIFo}BU;|ѵF5= mZ~vI eJY&IĈwP [ޥ7)-Tzwo~ 5-pBqo;/)X{'Kފ4y9w|#wpl?qW\3o[+ ߸ G_q{\/aK{sC//9ū>tO*.{? >ۣko}<ø˓3?۾kL?KHPO򈹘2"8,Kd/Bxa3c#dq,y*A B!B",B#"!\*|M،MٜX1\B܉SO&(3 NzK=@AC6>%63=39S!=Zڳ<"xR&8|"*PT+)ق'RLTMTQ4 QHIUMͻ(TBQ"jA0; / `CRIaT#T]}UhViTDՓAօfV!FS43U<(\]vkJ |EMt*Џ{O%VpS RWq_VXEs]+ (*Q1TXpqH@q$vٔ/[EU/[rUxXR]rWQ}Z/ `<539pM1Yigڊ[-[-i֓ LMTY+ګ Y5 Q"L!]\/ݥ,[\*\\AbQיU/[ukhKغMmێURJT=]ԥNՈ<($դ)gBMY۸ۼ]ޭ܌Tؽ p]+p"*/ׅ P+M^ p^Befcqljf`~ +u`&5] fnfaefuVf_>fwNb^_gu^fjge4ajBWKvjO4VkN^4F65F4vk&kn<Ek6k_˶ŶcjpjӞLċs9:S;{;7rf;{m[m>(eֺ;߾mv;׾㸠mm;m;nFnnN;oN9fSm; ;z7o96n7&>m_(c@d@S@ӿϿ_[{p?,B=<@#=_@ g >KSqOGqk oqS&pqs35rs BKr ?=@!?sq@srLs rG4Ds+0sAOB)7tDOtE_tFotGt",fHOt;JSK=T2\ ;h)uc\.P?su50$LgxN~uWw[D]'k YhZ7UiF^uUuU'cwvai'*~ue?ul'TZvhvkumhgfpnRFf^7tkov8V?wd&x]dv)t!_z_wwbwhcn`txxyX /_y7$=$ JJ2IZC`P9x&XE/XԲ7mz4I{YМ{b0Xz(z'M ؤPyI"J{1zP{7`'|Z4}` kMXSÊ3Gtݴ}.Ο%bA}I|w(ؘ(r_O܂gC?Oy"zSA/z82(\:EH5JSGSVMSNk٘\kS$s HOWtoX_FR$OlkvGvsNW$RZUz~҉  %)R%(%(K4S^>) G@}mIx$U+| 10~0Ca(4.872$ˆYFGE ! 8< `ёaC&I>g:  9q$Ԙ$CzhOS KI7Ujkϥ=ts'M] QJQ)nX~Y:/ĐbOKgŵSO25`"[bܩO34mWڥKϋׄΜxk堞O>|ţ|OW?߽yݷ/~Pz{饇8uzч`} zqD= ǟ *(ag!{W$tL zh_GaxSudO|=G…h#gv8!8ax jFπMB",Z`OZ~H&u9 J8ߔJ:矀*蠄j衃Ƹݢ2F X$BN^S;v G+^nJDaj)d1)`e ^B*&*JZiQB *m$<뛓zjac<0ԂY_9yr+[(lFvZ_J. |:gq /¯F9A  .hG# zfp̅ps{-VFğb,4MzH?|']:j4 ,|38Һ2sDt2_y}Z!2KnSnɓkc騧'!z֛jϖ{tC4FJbAwzIl϶ yA0͠|r^2<χ{/H{K F=Ghuc #7ȸ.t=Z|ȣW!0J>㽏NSTu a |XxWBlkFˀ #\=aÁ8r  &x&,\@*k#؜ǮMH5hA,L_4 ٪Ndڤ=O=MּF;6&яdFuƒ\>`:ԁPdhHw%t' e6mm#CpO,0M`{;fy/H& tKHd jQX+*yNTm<" D""zdBv>c0.d7pXZ{ₓXLR"JT/DʙZ-$ œ͚* dbf,.&ᒙT*<)Pu;b<؈|g2 )PKL|^y`$* P+)ҜKY|"O 0XꦄR,0@̺%q$횀u,0BY]2+%,Hh̑av {j(8S""`OC=TOM$">yck.fDh WxA3ΦFGCDv!::T PM`Kc[W@tM,bO)swD^5hx/Ra O`ቦ_YX.l[ ,P{d-bCR.z=2\8Ԫ@a퇥誀m萷ey@u䩄v4/uUxϖQ0PaǗ.:bUUD/+K27qӳJ$Tfe/LbXrD=Lr`rM`dwa=:asXL#CP`OPqgnsLgy=Ym,CͪozdZ\9P JhWܮy^W`;z1h?Ye㙯˺1&!£ꇎkyk>)` U ~667#'?Gް 1/`d‘6@ ;-9m@Yi l:Bsz;@wU \WC6US}1EBB"i]6׋;!Z^'bSŘW2yo*zePh! P^/`NE^73(8dADeRoy!Z|y$)uZ{φ4ڔ/ژCm'B9ƇYY ՟pE4\ȧj[epcCE_ SC_kWlπ`4)9)\5nSVSp7X!rug5QSUӴ8;ory$U>QqXMXP:cG}nHZ5Re ve&7]" oZ_YHv!&m,#N"[~&t?sUTJ%oih f0=){뢝 Wxp Ȋ*(IڬWLz`yGJFuT@.z dD)尖]ҭ)/*db+.OE.o4*Y#8klB$gH 1V\ڸ)۩U5/F07īGsq S庈k,\?豩ժ;V ^b, 0m[0k7I6=J?%FXzƿ JTѳC *;.mǗPg<Ƹl+犪\X4tBRQ f;z$?w9O6xG!?6DJb * $9GwB!$UΒ$[NŔj,ҹSg(08VMH1(%3S;Ry @W_;lYgѦUm[oᢅՑWXC8Ba(im2:Y& :M~G4(-hn*)wJB(!0FD֋:p2# &upLYH;fg$U6 JG1F1PR>Jɡo?ULEp J":a`"g* )"|V.oX, CŸ٣xPWh\ʖj<*0Ʃ)QK%l'D20 ,;+*M 3"S.wKl`G!As$+m34#"_:6T7|,,D/@DhT h;S J,NoA0Q .O+U::9fa50>Y ڱSžfyip0V4t0+ i0D˾V7^Gn#_|"~w_"*ei`.X+1Xc~u֥@tSW9XTцNhQiUteu.݄`nv8考BxT]<&0r&ޒpgҺ_XDQ~DKXqNv&9l|Y ~B0o2(9p؆L 猗#"K<-O(O< lJz] x49#VLD VolpWKãp:r+Ge8 $F]O "ا: Nilxk?>Jd!(},SՊK- ,܊v˜Le.Ӌ%afMdC(8"hfox#aFHhlahSj$@("Yi <'6XT%i ]!gjH8mNAGi5473mgy 5eSI$(A ѳ% |WB( zKsA=" P,5 w]d6%*t(YK3I F01Y:?+PDŽB1 >Y OSa0~֊J3TVJA 0YJ@8 uC,75 ̦$=KP@oe~j81Z ) q*ɗMA+2EWN&8Qr[!(푑}UHMv!*Ok-)=<)IF>|_s6aUI<7G)l&*Ws\+O\摟MIr ɈИ.#x#O͠mQd.Mq5"elA'YYyk䝬a_ .u]laCodZIھ1qaVȴj$bu;& VmldŎN]t[f1:mwMK'&1po־^1~m\/y.7NUr?CN^M<(7[ܭ&޹NP랗|Aw>pǎyo"PypY mPO0 b| &p0 pp}K! ЯOE`0 pO'ۯɰ'd % Qq=1Y1İmc *fPuq&b|1q-ygˎ}Q1qQ    qQx, "21 53+R!-ME/ 1TR"9m2$!#n1(p`1)( (`ʑ*_&++*)w(M*R!-51*! q+͒`"-ٲ/p+R0R)2-=P0+"r.112R+90.!#sk"/2)+K5 SݱС!4k2'*ѱ!r)qS#3}8I+I(S)93:(,:4d.;S;s),M:3<<0::3>9ؖ3=.9<#:@@>ó@;4;AB/tA9S@SB?B!@E;S=3@E>f9GbfFo9FFeF)bґF_GGF`G941]<ՄF41FJI4JuGTGb9gJLTHTItLi4KbIGtIIݴIqG<BJtINL4 U@MqIMFtH4K5tILTPNKK+IHU%uRNTSH-OJQ9QUI V PtVeU )EUGI)*ZMRtRfQKN)#ON1VLtNuN?Δ\T^^(a_C*> [Q3[',64:kaqZ3bsbB`!I>Ab:>1ba}dM#a4'"`a?Vba⩶f!&g+`o6>VF6`NchUv` C[vde}bDgjUuCi(vk:mN(vnnna̢DoVo"o֨pq!pnn^V,br9n/F3wc!s;r,6trrBrt֨8Furpcwtyv-wpyu,duwsWswrnixPwm*@uww|Gm7}w}ٷ}}7~=>F뼠,Ϻ(BwI-|sw(uk6!G-4X"7vw$끡 ,‚XH>jd؅1톟GlX4a-< XFX,`JLH|7<.++^j @!f N(Լ Ԑ볔<&)4Jꍿ!T\JIMGȍW$y݊lob6) ƞ)kFYI@D¾9qhkR@ɏ fxd.y2\ҘEɎz@ QcԸ'r04%Iኔ73?)IyAJ$I)wB EK#k(`Jo?섔_ $ (L9"T>&iCr#:#w!(:sC14*z^:ĬuI;&ˏYvɈF )≚~ Y3ʠA6= E::Zi( I! B礮ښÖCy*: t}C摒X FKsQ;.٧ǯP:*GQ&) m:h:jv;Q,`"/#gvxh.hN)\@JTe{% [D⹙h幛;s@d/ Ffd {ʼ{f;Q% !6[{Wkj\N` [Bnۺ@e,\gzTBOܩ#\Y}lYFHC6B…:iSj 8!"|E{*~SX{qBeEXAƿ~95ځ\Ń{\?"$ H {:5hEہ;3AOa 2:D"!32M>d/4 ),>"6f#A ^. 4ݐdSGĜ [K*i35#/(`#c)!D %<[Ve \B`kVc̫$kH}*`٫y<բ:4ؠV2 F/ ;|h<VCS<Ù<< @*u#) ԗ] 6<J8c=i\=l NfN@Xź<4a8)/ ԝfn>  ;9IJ _$޺!V8CuJ5ԟm~b xܺM ed=\BI|!E[[F4D塀;=~;?!NjH|=8׀>ܿBb)Y"C#2ǹZ1ϹA %`d% >) Ȁs(SD2( eDHҰS^2nA+D<>%],!uE͹mlP$a2!yxƒy8 7% \T*:(ܶěUOJOd|g|:0d;~+G7{kƁ#HKK^ai%F%z4ҦON݊ױ֮_hϤIppW& ;6@N*tjvPL TyܗhY{:fI7CE ` : MbY!A:sg0 P \r&yW%׍;{i>ee2Ѡpx03cO(cn-Eˬ mhX$>3O,U#ؘTvbƕ>[e;?ytfv}Z\ցUu=Ycڸ'aV7/V5HaJk:֜cgADorap5XMN DZXi"V_BL}ȭ X rЧzdK.-E@GjhBAu2B~D$:yg–z'4KQC%X<#Ald0#|9Rt(jJڨcE݁ I6JmՁ,Ȧ_pIzgh)(L}b$/͓ ŭ.A^Z\%K]Φw Yt$yb?=^p֊`́D+0VȒ@ ؟Y1 |\i)l $A$H^pervpx@o<DXBAİ"[D0h #Jbñ hD(ċ*AQz @`6%|%U^ePat Z32K&YX  mя"V$R`NP-Th|hɾ:VE:ٕE9,$ԯEV~`ؔkln " dWͤ"H&^Mt}DO (QEY"|jj(%)d]Fם1ڑ15 [݇aJՄ,@ S0l)]Y!q5٫mRtqZ/Aa*U:E&jeغѝ\5ʱTÄ.dҾ!ntYs]!)␖9a|52ԑ)o *#4 [+7%Ȃ0Ц\!a-Uٓntzs]ޔ5 tMHԚb%!Urg1U97OW-aڬ(U/bմcSO^E3lfFR%YN#0ze]V%i3o=Ւ)u9@08dTHZM#R@Tt]7E!&p9z$-ݺ)6$]֞LBrd[sm\'`Wram"®^-X*uo5-m8c,dYpx)N2@ m_cg]˩e;Z>[pˤyMYqVAzaw"V-I~-( r?J/I)w.3"gS|_^v(|oS<_VT `d Mz/"<@ [~@1 <@<<hRAvz8{8d Ŕ"(T}‚Ayܸ5K @NI_A 9 \mDT#5xW}/#yaJI9#yU;̷mkPz,eHZ<@x&'["B d"j/ ӣCمes۸u⟪鶨SDQ9\:~@18Rdkz{s:U?Gŭ;5íкV9: 7@庌H;S<7{ 2z+^)I8,S0w ,V:l ӆX)2=o֋Gӽ~η<˾̛[<[M;?S}F?)F',|j,|/@p0!uk?8CHJa$4:hdb[cڭNe oqՍ;3*ZۺKȫ[BkBCT[{$ dd,l4H!hu}ruUj-Ҋݝ 6je^}&V~vv^nH&ꜧkG̯lͿNiDFHb`JnPDHf!ƊXH@fbH?X@+x:gab^魖0*H)=KӖ̚=h)X~ڏ\.L?5e`k_&h18W}:iN8誗~z騧f7kVi^l>`;hnjɖv۳njV{ͮjm;n<ޚWG::GWZrfucygywӮ6sꫧh=׾ws7}|ڭ}~gӷ|>կ}3 .x P|_ /y a# ҧ nt/׫/=p[[a0¤O)C[h?ov&WbB=0xSuы_c8gx+9"5эol#8ֱ# 5юo䨒|ѐHCя!$CBD$77ȟmԤ%O2Rt,% @Qvǂ" ;q$-IIYvR@ƛ=3P=d&Va?`s\#6ߨjnFlϚ9y'5yMܴZ07}NUg=O E(BjHn 䔨?٩PvbB1jG|z,=PLft~{h ͍Н '6KʇKIӏs=h9;jR$Ĕ:UhCzTU4l)ETAnh3-1 ^̜ +~L0/@L~\3KU \*WP PȻ.'?e#5(])T=.X\$,_'^[{,bLfsbkVm$%;*VԬ9Vb&(1qB1RAbTO4 H*΋-r֧/ p_r6(+fWMP`c" PPH%<L] 6`"e밅+21}q|ؿ&_8 pb\yI,Yg W8_cȩ0ib"-N1;- 675+ߵAVsb?tX2Qcy>&q-l cpezX0Ga tٜߦ:ޡoMєd>WV#gUb,Žd⼱ū9Ew=nrFwսnv^2s1hgeUYbcԊyq %O1a W7x%>q;x#.vTUo5-q-y0*<?st\onS;Y }>?'zi ' 7zL |?Gٲwf~g14ʼne1 ]w;w{ w&ȝ{w7h;7w?q;3W~Myţ^t}6}‚=sFz /JWT>KxayW؟:}g~ࡿ|Zd*6Do Lf6R(X؉iC 8Z\ [#ً>[\P?[{=ZAc?ѳ=#x[s+=#>kB?eACA#B(Ak;*> >!d>"ļ%>&$Cc?׻B;C-DA:6 | PB="N) k+E灆S#EVDW N&Vp8\Cƫ?6ĻGEBJ4CԼE ?aE=܌[t@C7LA."$C7KĿC#0B=-q Fa\cԼqr\&<ģ>t `\i\sFq%Jo'LG9D4?cGKND"xȏqAk TG0 Cś6]8ɝ?sBl #ĄGb;&<t?sJG?K^KJIcǁlD3F|T^kI+|EƁDˡDSI8$LZ$Itɑ\̶3/dĦ+$JãM3LJDD>k$HL׫K GoKL>x4J4PԼڤfʀt<8+?KL؀ ; FDM@˻{I}CK{M'$LĽMN̶kLL7ɤɬEBp},LHxPp1;Ԁ K#>V6uQċԻzT[ۛM="u<d&m Li2<uKM;B}M!c Qts  RcQS*ž+gdE, SU`JHolԦvu,RSK]EӼ{IOOX 6s8VmUZA! lQA-R- ;}L[fppfO-LQtp  xx$NIKPͻP%U/5'cpQ;nH#&Mk2tFsu;OӨ$7=X ŃSGuX,JD5 d n `h-KdMUW\UHYU۵%&Zs,4(- ̈́T$+倐%<42] nEI8ѣŻB#|L;Is$[rTջ P$ջ0ECYDH\A<B]/;EMTH%];U=œ:H< X`}L|M1X,Y7Yڿ#Z^MIl\̻}Z&LJ4}PˋVZ;=[H[vYC[e8V<%c []u^o}^Ol-$>]L;lI?S_E_ZNM`YsZd\йu `[S 9NcYe ,-BU^VOӻS`ݻ~baJ;;8g]=pCLT PuQB|C8P+_M-6-)˽3DM DXʻRحWF]8^2==tfYQKؽ3\]_޺K$ژeʴFDJ!;s>˽ K X]D};a k5F؝PI-NX-ֵJZRN잵T7K}STunmudƩ*-uGsxNŶ;)"/EXf 콣?UEHcЖ-R Jnc;pvn~NiE6JhZN;e C餀IWhe"_SVw[ڞDkZv_-{3Gs^_ۍȄ㬬3 c8 H6 n>i|CzuR$ ξ?xU\iZ -RvDnHv ]kkKߛIn\M27.ל%R5B¢O3Xno-<&_@K|cb ? (Y|Hԁj%mN] (GfE"Ĕddyi45yD$E劉ę+5Zy<,k{yD`tM,jEbj)d [EZ:m=IL;̚n5b.>#1AGi&ʵK.ܱ6pݓ$(=2c `yH0NF"MK,#3Ν<{yPLHD -h(n)DV0-y赃gPX0:5;aP#hYYm]*ZY}CQa ݈Sڒ[),ײbЪzM%Fʠ'9t2|*!^U0`vLBdDxHD7:=r D=vZ,MXY}tsD~8gRD=Q{Ќ*zn$UݙWŖ\XUfz@MZ5|-(^)i[5JU1WnX(7rĕ4q܅R"PdN> %BmGe(̈́yN]aǠDW^儘ԞzdcdVlFTBn%Lxn"DHQkM`mX{˥]^U{o86bRY#_k嘛4elmXl*-Jj5.Ezw*yxzZ᜷ЙVd޼n>"%`,jTWlV kar` p1kֽ-'TgvF">$M_fP ݨWތsOvq$)7sd1j 'f6~;_>ua*}:*"bؼs4)c_͏cv5#s`cʩ OX6# 5I9k\ɱE+;\rT $`˴kήNeZZaV“+&8+@N`f]JqH"9J恖8IiJfhdngIAl3c7;"*V9 [3a'wZHL0 uo(B'/=%{_ڡn@yI$P7H/f> Ē>i < "|q]:F.cCy vx@MG 1 80].PpPOTZ2Bdj\`yl;mUF@ip :[M-Lk@p)$ Gף \jXk%YT i5ȷ4O[71~C0lziUVG镑pDŽAbe#,Sk/O۵F DB}kgg{U0*Vb kKLR;BlnLdӦ*R{'W1L娢 `= [="tGz|Iu+>#)$Q-"媮)@AKH"3)b|xzjѺ  _~]B. a,ywqir]c0H}*b[dBS,KL0ޢ8fTKH+j%X~_2-=+\jb)yQһT+H!y֎.0i~u4Q(/B rGŢD[ ZW H2L쑃nK0 U`[dlюAGNt#u2G#k& f>|GV"0Pm6/܇x ?Mn \# 5VInzD Gdu Q}mDh=L%b Q9l ?,%DVIFoqcqPPЄVFl@"tkt'[ mf(xH)JfEP?BvH-'D\N'L Mp4R@ T[E%Qvna J!&TpOd1/XrwK{|OtWlC zG '.\"zm7{@h&iCcE1?s(bmrSV 60L =ԃS/2nLpC07EP~  3?3=H]mwkR@HR P? &ӘH۸SD7 aPb֏(=}sHБyw N6t2bWIC6&9TWh5%SiEx0ԔzR 7L5uE6'I)!5ŰuЖjl7 \A>#~[~y..`8jLJyQ)yxlIvfySH#X $rQ)K/lS_ZI=xI_D`A EPlqY)`@sR4oi<.VaB֜Q[\I|qHz 1X[H'r8vN%B2UiuYÕ'>.Fab=R5')D&I2;WDIX%*U6D2)A7ŠK "Y""=A]s$fKf&pK"/K2W 5 Z9W0O@By$bnyӢ};Jv⣿X uY g*`,ZsL]i ri%`{f5¥8`$KaXK.APBEySu5@%(.\ E*MQ27'xҩ|8P fPЪ bVyZ%CCZc:J6ZzjZʮ&Q%$ʯ˯ѯ;S.@ s[+pVrVK{K:8 J  zK+E*3+.+!˯ {$Zk&[-k5̀5g;H2C9iVk0>9EUgJTk3 `C59_[U[=kYO EIg^s[ꚸ󪸏 躮K@[Yj*oDipB=X.S;`6 x k)1>^[0{%98ۻB1WBkD;"D 6;w k@˹ۑ;T =#{蹪;`[+ěثK3ɭTr;UkDVK}ނ =7GۈM-ؐa==>.}]ߒ -m|~ѭ] ^ >+m0a޲->&N,N]n!>26.=KR/NFϽH%7'PH^@MnWZ嘺u)ZF|b>#!sn`iz-~~=~ N~$I掾衮E~Pq>n~@n0A.j~Vnn6쯾~~n3n>nFnv9A ޮM>;o6~^VP$~t > ? _^(o/O /%/1_W-Eӛ#OO0/ -X A/./E7iOu;|.I0!>$?$qp(_np0zo?!َ_oor+^.$o~$?$ODM>ā|n`v0CBOo_Mc[_ow0Q_@CR,Lx,NU*ɣln=RlLe\o]%%MOnenoӻ|/oMp1MC0Rr3Ss4Tt5Uu6Vv77 8LLk)`PyKq [0h${:踼7\ ]{y<ޝ<ߟH. z3 6tbD)VH,]oH|@Ǐ@ IRȐ*K$A !H2%Ζ-Y4S9LzY%R,&])(O4YeU8EJZԕIɵI[ljE ԩʳ;U% t.ɓjQ괬Ki<rѮTs._P#ə8չV>cYv:bтivnݻaTHV=ژ%Rx.7n0a 5$⺺+&#ʂJ :=԰K5!,S J <>sOPKxVTZV]]HI?'5 яH‹HLYdSX3m ^SXTL=Lf {W"rHB{D+vl,\7cQ4QYvR;%( )dҲhlfz@BՈ%7-~1)DDϸ$]Dc q5-X=}`WY uGKڏtOzwm2~M?Wޓ} ϥSuy؎9Sez6f$:nũ/[GBHS]+ ?Ϊ`Lt*E:Cݜid.BPx= @x@@*ګrSϑp}:jη$ <+@׵v**J#)$&xeٷ̔c-yg8@B=!tu##]9* r9~`?/%.@UKna,qO{ °$\ w@&oH<`.@91t;[$B] l\~o, I»n=`\VS}C>F30%mw"5Tu0 Rr" /Qx :*@v:XKX0e%6hK_~% 0 ?"=L 2LAh%KB*FORpw(qL@NjOvR@"˹䇾SYh>mZF|d 9g16K2C]Q4I G&$lGItC`0jhr" !H ǁ/h 0O2*8 OȐ'T|/Z .Ԛ!dbhdx7Vd$3mϏl*|>8w62|2)L*2$7*a@ ^$7<$LjYBQ$,I^'TD6Lm-F):tJVn/i.j+44i% AORҍe̱"7&H淚Ō$ 5QMjZݦRW C=2R +L'''&^l+(b=67ipI$zxK II:%}5j #[5zB Nu: ;Pf!\*JC+NزW; Iq |å_,8=E7uAFnMo<:1dЀCb5!l d2L?%(01/I$ᆤ'O}䱏c#c5˴irNmHg=zJT}:|Tqt&K`= RcmF!y^"a ^kAr+GbUUBRwG\V )!5h6BG0P[Ng<B^! *\'񯑾蒜v6E X&i2dibםm_e뾢k|Jp?2D5VWJydqՇ Wm_NQOյ[M=<汛*3XlޝiY4hxLm^1:c(H lMݱ%z ϱQ E$B4hҽ3N8)AB^: *6ðǯX3*wg(q|8=BL*9_ͶuwGidLb"Q;nPgD 9c3Q1 ynD7\g aaW=ԽCNWD6%wJ+8 C˸?xFubp(Hq$/+Gg,p-QH4>%L:.XZI棛jdx"b` `J @"P F ^c` V``a!*vƽoN PeΞD'v\b/$%$pP68LZːp٨efDbZoQV8L9k~'P8d~Sj' w# b =Y#ր#E E"/!| O!j <Qf17 #D.,O&MC }>J(e$.@(:+Zv92`e$ZaF$`Lj2%90~i$ ,BdE!N!0$#U_o"$P h ~Y%-OID(;N+Pȶ"f{}ɶŨ%6#SbޒEKUĂc0l) f)4)%*;Vp=̃" 2@o[l;cQ qqU\&#d sr10p!ް3QYdnJs29NdN\)M(q 0%Dg8(DKL*kpjY!gcR%+#ת7wE4Ð!<37S2^2%>W2+b=Q'=3ͳ==?s?/nZ.r~~(ًP#,)W厞LX#nhKtEscO~Δ8,rZ+AHpsN4/N2"a浘Hy T<1#4II?U>E@8S!HJ/U++hq,TV *5hnB^PC%t,ks-14\*V>f[Z:O˒*,_u{,-5ǜF T= D_[5?UMSG #> `"P ~p>%cW >` j',LӪF%G,RF2EfE"F3]foGids%LKHUhّ.eT]eC/T]OjJ gG[< 1Js= ;PP%2 PWPd)N慜gA>Ov+t뒆slE4{8@}dt WE;ͼ1rn7c p0xE#V# wUaq`<y.6$YVp<8y>vdRY]QrJr,/R9RZpP.¬Fد%#xIO>+ZNפX$p,faƊgsw: (/Ћխxe[wNuO\*C,,S]K-A?|Nj$ ?S-9W Y`'N!T Zv~x2b<@'y  ;S:K.N)7q //L"Y1{c”|`$2Nf%v'$ćFKɱBYw ~šY4qV;w(qy9-m['{XilXf"^w'Jvm_u}a{^OT0 0Oĭ.ĭ@6nwcު{8q eϑ.̋+Q&$+l9G#܄ęt;8z׻d)]Ǒu$K4^\Ǝ +xXN76%knۜ-GG @"eAI3L/4iHUHyOC*'is*J P #]' 2`?UI}T i+ @O6^= p{e%Wz y)ݢBzR"wz \Wn0tƂrD :oNw#LEofؒY+GDe鱯d%GqC:Gu')q) *fӵP× "P '0s^G-yzG"rJ,y\ǁr}:>u> h'W\)L Qd*r2jOǛ]||g+>>);8@X>sB d\J7-mvU6|+$lx](G`е2CsJRӢ07ܓ"^IGHG/9SJkt0hE\E}WEB>5$BCQiB_ zw" v~8ΔB塥{޼K"vgC }?540kTBZSX&'j,LYϓ)[ݺ;[B!#2\2Τ'EP+6r/8 2|63;>K??`\ Úٛڢ[[b"ۈ@J Yd&\ڣed"hj)&$-f&*l+[-G 0&0#ci4rxI:"Æ23ujrj4FFn5;uB :no1d"ƌQ鸥AB`,$l0B$Βh!/2$mIU(He@R`ˁQ bǒmO2ODO.;@ zAx386~KGQ{,}4;;KōA:9_{z rn;ɳ%N +/knz^0C{n~㮾.|%.⤻~~O$R y{p<'v@>nyD@S̏ػ~WَӠ5±.^6bkRWC:IgTЀ&/g? D!UDvD*LQbBVe6* A"V͋dUƭhW| B*U)Eh9QxhG?z,Y"HCG@摐z:唫;+h:6D66m>)zVf#K4dgkXrDBk[NerU:%-qT>q-X6ɥ-tsZ^V-@c'>^״zNTlhE#L>tAh_k >~L!LOM"tEcrӑ?CwF5m k#24a':u> }fiM!T>Ra;Qֶ]mn#*=KRVT-xF6ߍr[wo=˛|vny'|Qlp*Z@;.cMSyYn7ENnQNrc Ӽ![qw{=n[;-y#>\Iw>s/+;^GS{;ķz~/U=>zې#`xЀ 8G&OIl5$>:#@Q$RHA]4`E @PZ6 Q`Az4 ^q`@` lPi G ~`b  _ $: 6 ^R6! >!! v``CU!pTqqzA 8STAp &dEށhb'&~q")n'')n߈b)"Ҍ*+-b+xb*",-v,!( բ-'(.1)~#D#2"'+a/'c.Vc`c:*c0£8;rc9#5#(c5~;z"930z9#:B#2#02#>c;Zc4J/E6$A\Kwp@LiJxTLHL݉Gu#*Wu:8]IL")ѧ0ʨLceA9Ep%vJ; aWvG RT$ XcAVAYa`X bYWb]֥yZe[y\QyP^V}M$%%W %^F& %Q&]>%E~׉"_" !` gXL:! @!qJZ|)fטGMx"<R th4'"=ЇXUSrz'{{y(`v§}U}}h~g{'|grgg}&zZI!zENhs.('&^v(^(§tp^LwKjTtoޤld 9@̄PtAIx"<@#udQ n)v~))i}_H YId:DJ)|N䛪KŨIf#R)ߞI% LVuAUVA88͗hv*{zfz*~ ͨ**燚fj`!jHHBsѕu,ffE]QVZڳV^+fWyHkYnE%cOkt ڗ4 ?PF>k}卹fDV,W BF+,AkAV`kA)xDH 'JKd6 @J)ulB *Ƃ,HčԊTy:%,S,`C:+AܪqGod$mI$nTq 'mRIU,8]8APۦ-­8fWTRJќ4aT5-Ħ,ԊDś\GN.嚫ITE՛B ČIKKRHI_l-IN,~>U8Y/Uy*NQ*S dPASઑ"o\/DnbBRǢDj@LGEoƯo@E@@LVԺFJĠdHN4hARQPIQWhŭ0HR R0R(Q/߂V\,tH&F L />1Gدxʔ҇tx:/LfA!KXA|G1KT~\ĉgGJ MWR֊MP NAQP @"sKnKAYD@CT'U2*N2E@o'1/(cD%nG_ A_ G@~)[k X\,ȲfK8sWò{2;`qErU4/73,63>#S+A%+nFr\q 'w180q)/49wG ҞX@4@,W53Yeճ(E@ILwrd@bM[$?|M)nVд.O3\V2F+~Vo5^G+sTTXtVtcDQR35u tP 8X]ۭXi)T0x/$+u4 h-f@\ K[uJsrUNPs5gwvUgjLYJf_[<$Mb[b+a7\ϵn.`AooAm+p4P&04uZc,S6reg2iS787p{6ww7xv7dAdW7WeZ 0>)wVDc6~cEʦ,PFlR8/0J RQZVBaVqR;e|A}Bk;t@D ox{7Fg5,{S߯7v|SGw~yVx\ErE  q/̀xhxsAACWut6/'-naj;yRN0ܰyʐ/g/|֛˷gEtyow -:bCA>y~nU|QlUкJpS KESA:Kc;{i#UIgIՋAA`fskB/@<5F@(Od,Uϲ}'3 ĸǹWUR~І}/GtSo&&wt}B;2>>׾k&=pA1$*"0"C"QD78( :R)ݦw|^oǤHq@ABCDEFGHE=Lͯ8 .0306)Z.[4./?KNfghijk? :.!܉!Z*./Y.3_a$/$:OrHd#i$ .dCǖ';Qj#: 4j@bE)UdKcYnp:K 81DDI.eT61@[ԂLWa u4(1,JGΥ[׮ݸ\2;'C2;bf/f<8z zgH!QtӤI{jױeNm6JÈ7[nx۳Ǎ>̌"UӮݶwڹvʓŻ>7ۙ;{[=C/|C0HݣdO>Ͳ!Jmp P?"D4c =xיh@g[a!hVzSv~ٞ㪷k{_ Vw|qvr̃<ƥ7\utQϜ'WuYMUw:vQw? avmxu Llڏuއp꫿+_A=+/_1?|㗟{_q1?%uW>+._'@0`{` ]Є ! 29p|4$a ?A:Py S/-"g=(F"+jϊ},Ћw_r"-E220.bhF0x̢Gюu#!ۨD6QfdBt$"5w$HJr&D2vd,9Jц~X*txLHPG*i_\_+;,QfB$M\^d%9yNt|2YNss'8=9N{nqL[a9[S'@ʁ-:ЀRsħA+ZO2(CIST-@0-Ј2rqF Q.t(JS6b %G!ZT."J&SԧzoqpQzB2PjT~HժStiYjSVus+[VUQ+_ NZWw]k P`ElVӚVU5,ЏN)7)aiZNv4;@ϾV0-K)b$ockSj+qc\f2?\>-EfZrY@4Х.O QqQm D4z )wmKo2pn|`2V0W%C88p9a?薀 <8 N0]a^1|b .1ol˘(qc 8/np b g!l% N KaYkfsf8y! s|g<~b!.3b633h@4Dg.`O4DpA, (q;LNӀ0B ;=UWZ͗"!_ [ %>;VY6B}BN  h Ft&-mp;Eh@` 85 FM7`tk"A;{Ӧ:psVzCg7|{8G^ή8-`ьv5mFS ґ1m~[95{kn Cnj a T liX"8>t` {ُ 6C@لFvQR3oL,{ bN `"xcjP F Qlk贼|UVx!^΂{.:7.Q~by|9TAPS8Eu}S_ħ"D||-ԴS(ygU]u>s;k?$xt3܋レ;>@;;@>ûh 0l˻[<6@$lj6IHu5<#,n7x2,';B,BC@8?=[Qd@?Aۓ+@LB5$C?Ӟ{C49 l:sDKDLDȍ@CA3 S/cK@ >=DA80DƣϢS8ϚSD6 h\JtFkFlȐlFp Gqn4$2Ft\Dž;aplus-fsf-4.22/src/html/KeyboardTent.gif0000444000265000001440000003400507215453032013634 GIF89ar!!!)))999BBBJJJRRRZZZccckkksss{{{ƵεƭΥΜ֜ޜ֔֌{{sskkccZZJJBB111))!ތZJJ99)sZkRƥksZs{{ƭ{s{skΥƌΔ֜Δޥޜ{cޥƭﭽޭޥ֜ޜνƽ{{ssskkkcƵZZRccZޜ֔εsƭ{{ksscƥֵkkZέΔ{ƽs罄k|{ƜssZޭ֥kΜƔ{ޥs֜kΔ{ޜޥΔオ{ƌsƄss{cΜ{εﵜs{ckZcΔkss{JRRk{{Ɣ{ks޵ƌkks{{ֽRRZ罽ֵε֭Υ!!)֥Υ֜֔{{΄քss{{cckkkkZZJJBB11{s{!,r H *T #HEtYCOǏ9@t\ɲK+`Z9M+lJi?yѣHbpSӦ_HJիXjʵׯ`zJ aӪ]˶[ۻx ܲ`Ki&%;A̅Ð#K֪b]TJLZҟўFA5 H+6lbh b@ %PT+Lإ6 CWO^ %Pjr. S}PHTXu0!ŀIl l`A*("!vXhҡ)ցM%HL))ƨhc,!A$Ĉ *v@D<J6@Pň{MATU%\v o`e"x%c HHoI"Q#hII{"h92ʥ"d9$le$0awz10XTGPeA#j+% &[ʥ$X;wpRK-`")tX'<̐B  6@!"CO0 aNPJRFSpB>PRK.lr8 3 +. '2 VzH; 3dq5 0#@DPI-MTIM9p%:NOD(=1 0pO+U%rDRF>PrD 9  cl: 3a n r +xP#ࡷ@{'ʱ8U8(NȂH!9!~@DA#̀I2*(!dPJ;;pcA@$l SA k=^#A{D%}3"^ [ @P~@2(hG, NoJx ):N(&2J2ﴕ'w)N=}'<VH0!7˞ CH 4Z̟Kj!hF P@DGLC(̰~(1Sf8lP:Lj FLqtQM: MJ3JxB a)Am[BqLD]ÿʁ.9V8AKItc x@,` b5K bh2Ipşp>@czaIPB@QzL O0"tM ń<*Pz X<8q),͍Ъ`b h4z%LAӰG9QND!Gz &8FTIЏf( S+YbA;a)}!XG9nevp Z %p$X `p~cܦ`Ho 9؂j@&G`N @9a1BW8jpG!* PK+W6fc ͌ 5X"@\vy"(vpcH |ls@\``Z+ƃ,m_ 3X(Gn.?4%PmH!p#$HB:2{>OF3@]y$07cY"Di*׭jE KVe :M&ao TDQE AxD9 K5 XZ)WP ':Ňy~h.,XR"Eb "D4 ،T0V^hv+}m`3EڜsPj@'{"N'>O` @#*yQxĮ0yLDD',A{KQV18 H&p4 h668 8yHAP/&x+:1L?0& h(&"A QHa&PXs0 ؀ `l0K  sȁ 2J` Xu |p ]` ;pf* L L؄GblT `'p50H P` 0 @ @  m8f Ӱ{H[Pׁ 5  pq a ! *א p))$#KMY5y*ݰZLp X$VA'*ְQU)܀(*x!xʨ$a a  Ca@ |η|ې|gi |o  Q8Qɐ }Rq芡& Q(|p|i p Њ Vq8 0,y݀%i /`.B lГ=i ]p>iFpi PiviXQ0%TȎ P%yF9 l c?YJ1g`Rp8YQ PYP: @@+Qyא݀ʀ c pC%J)bb o~0Q `PcR! w pRsI:VI Pqgj&}+.3hWha Wr '~joP ^v`} jP!P!0%+bs0@{0 v@~G{  ` oPT(Ӵ({)*}ݐ\P UT$  X#נ ` @~F }u Vy# l`  %xkR@Pp7 CvA'Sq 0d'~F @ 4T2=o rvQpjRDp}:hG ե ڔ&p`O~`i{PP8@@]"~ >@ 3p,}@t h-6{P %>҂SPO0 D Rjz 0㔺XPPA ؀`R(Vpe ` 5_qc(C fA p+Q(I o  ~P 0B  .F<J R  \ Z@}嘜'bqC{0 9 @ py d g A`* 63 3P,σ )'ϐ;b 0 /P   fckSp  .*(TR|s P* o`@Ap&†-k`4prm Sxpr =t3CIp` O"D03BJg'wOmEty +u`x|U,HpA*@*6㸃Dp@Et+:\j2L ;E ԥW'7G v$Tuv'wU(=e@ 4JP)@ RJЅmvUHT !e+oTu<5ɆvSVpw&%0_ gvD3~dc\lOv U_we(>'Ns2| "Ęi a\"=n? TbƠr˙Pn(ռM#kD m;`os3StPAD IShx0dp ՛&tp|7\Iױ  Vk?4T&)Mإ/Yٶ/ M8|' FG@Jĸ` e@ >N~p X=|w\IB <3 4 0d4O  # &Q}Pǜ*Pqz dA  7e`;u `qH=P  SEprJ|b6Jkl MP@v@ J\HF_- ̽%uCVi2 j {_ T!><*HF FPm0 K q]?S`.2;3 H p^ {4)`$N@I(9d0=p=K3Bk(u&,r KP RaR N 3ns,+<`H0бl d [Y\bPBsS@ %`%TlH@b&r+ 0' lS -Z01@T0L>* }@/-l' `To"Lc|0&%bytyy bJ{pvtRPq{ Пu pj K DZPBæ@sDbAl+ P p ~  P P p Pu0s T_05x nI]Ћ}-%KCjU4( `X{@KiAj`lЄȷِEze8 7 v80  ($ZUHϗɹTa1KwTo|T(q WHeha@x ҋ`J艜$p~|l d`ۻ' 1)g l~g DU>|p)`l2NR+ $`7H_~,8p 4&0 A`BP<F8B"*RpE *<Yg,SQ U40AV 4KQAi"0sC bܘ@ ,J HX Jfa@@Ja8k l80a7lؼsa+?Zg@ A%4غTPXխj \'xY' 7ɑ(Bf1YvO U` [mvuF@±1c% AA"C DH;,$L,b0dL6MTN(dNئ)qG)x 9 y@0H. Ϣs"*1޸@`AAԸ`AAD != QN`O>dQ8:`1y +9YCQWFYf قZna%t`YkG J "B$u@)*aܬ@7 ؀CHP)`CUpF;cqI xRN8I6ʠ)(cJ(YXaEDiwdHiX]v U(7]pyuxi]nenZy|+7z %sY7 @߰uyHhNdSB8 Hߐ‘o7i)hgU_I"hQhv JZBOq]7aZX$L %\j 1f[pE3$ bePuI(ǚq)Y%Jڱ Yr@ vqB'-~ȁO-!$H Ff8iaV\ IaRjKn@<@TA @us| H\ID?fW2H$4 8%A ";A1Y,(:5"my0pbNxF;A#@ юsCa$:䱎6퀇d! UX G+ Ws$4 % @- :K`,> x~S\@jōFTh0 E-QW񸃣C,F?0WV W0hExQ!mPⰊQ=O bXb 4tiH&=G@rG"`8ZbY}AsDrc!<@Go=A $YeC{21V]:ݩ BRdi7i x#V)d0%:qL|a-DD.цxHÍnU;h&P>xò blS2@!@ { L ?e;6+'TqP(bn8L7@\E9Dj0I\,TB8a?8bdS ~VUZuu7.i<p1j$l@ =(Jb =TKʜgk D p!h) Nl`һ%r0NB<`N<> Y;%pB~ SV+{ݭ|-`Xfp  HGub|dA @1,A2@*͡Pr`@"D!H!(^HC,w#0ux'L k^̍=8vbꠇ#wU+$6uV pef?BϪ! sV;qOd&A!V@ăG2P AgohXI _ZӥS*GHdȄ'0qtLxX@0I, #pav?@f,dYap"D,-8Kɜ@ fs O0oУ'^s DBXj5Vё 2" 1`D09lP賣K^MIB RA $ @13FӦ`wJ C䧐%-j 30P&"Q@BRD$p;`=[I+4/ؽޘk@pikߐ=CKHp^? t:ّ٪->CH)K3(ȂO<ENR38A@I@TH?PpH56؀.0@k8 @l jI!mh:P kX1 $8^1Cc᐀k*@EIxD؀:``eP*rK @P\C6Ƞ CA`?XXȉ0 ` n AK3A`,GJ> : ~C @JE6H ߋkfz eÏHƸ8 `  I dx! @ ^!8`Ats6Y ^@sܨp(d)d S8I~0MOX]AhK2EP4H2Z&x;#yB@h#`4|`VQPHɁ+?p|ӣD`3̠X/HPDM%.LPխKj{q6h?z{S!G,lPTN@h8"Ex0%@xs'(3{*Kj\ )_;H90CFh3b Fs @,! 0Oí4[QWm i"NZwZ`Ȃsp!H/p6 PYX;!$)9JX;)Bx,!:[.JȞ.,Ɏ'0EK}b GOG. HIy\2oG`Q+0N(|&BlxP(1j}hp:8QAXt(7KyV8A„^=-B [^L0qK =ԙy5[ڡLGa\Yh;G CXsU9N8LH/BhWr Cйޙ=(uZ#))uA1#)?Jpv=H`ŴMp ` .!P/T@*[72g8^=?@8\ryz?#f1@*L~.W@qQJخ+x.6)YJXJf8[A8O0y%1YG$JQR1@ßγ炑7*d6,N`O 2&{ ;p;?Es'~K[8FGO UjeQkG g~̊,h{K%)45,:4CBx*GNÓg8AJFpvh$UhŇGEP_ kbFkl >+y j ҥ 6v(Ј0 l@;)xQLp,Bx ?-((0PhF(\SP8uf4EЄ\LMJh@#JSKv%Dę0 ዊj~UWȪ ˴ZPuXGw59|r$ȁ#0WwJ3M;1G#%;yLP0O8m/XH8x8uЗVExţ੕RU0W}&I:h`, .Hq[ !`` T0A,,(@ @u0JXvT+Vj>:;^ѹϩ-P`) Ilݡ|5 TyLc4DS0MKV t$@G2 .PB9zP%xU(`v(ZQz8& cq д%B L G, h;4=B\5`( 2%6 ,YFJp/D@%bq@ h1faFHKI&Z,hQrDW9ұuB=f z/I@T VdU&x%!Ȇ(]t~zGIPf"Iu `AeRq) )}jm"](RR!`G@K@*s5N k4%lddG<tZZ ЀF d uî@aRt 4,PX 8& /3 HW#%)?Ls-s3̀e,.," 8Hܙ;jn8$%0x;' `MI/00xr iu7JgEz0w:8T  yG$&U\%Q.bE@ 0\%Oq2  & `m@!x\xC,bɎ7p5ALY)\z"DO[KL tj#̀I 0-\h2@˷@t319*z5 EF{0tb)Fmx%ԅ i@Y" @ ̀ d4!yeZ= E K(@dԓovixIR3 hAMb `0DLY̷54=qP/ \"0vӭn20Qi+ f31u 8!u5H7l r7lɯ/:{%?9ʷ=ha _C"Fa p0fjX_;WXy\:X3 Vߐ! yFF5wśV7 W"`C\7}C?1?=+^; hO3n P%/Y=Oߥ~γ OC@ϼy/_/7}6Ƽb{{S `Qχ'??3;v47F Pӿ/Rk GxEkI]LIET`iݟ_5@d !@ChQEll\T |?WUST8H8C;: ^t]i}5!V{ Z"hC?H8]!6a$0lhj!A7(K""Π \@":y^"&f7 U""]aЁMA$N&Ƣ,"-"(d).bd8bR@-&2.#3fbA/`*B"#Tra3~#8c3;aplus-fsf-4.22/src/html/KeyboardTentL.gif0000444000265000001440000003400507215453032013750 GIF89ar!!!)))999BBBJJJRRRZZZccckkksss{{{ƵεƭΥΜ֜ޜ֔֌{{sskkccZZJJBB111))!ތZJJ99)sZkRƥksZs{{ƭ{s{skΥƌΔ֜Δޥޜ{cޥƭﭽޭޥ֜ޜνƽ{{ssskkkcƵZZRccZޜ֔εsƭ{{ksscƥֵkkZέΔ{ƽs罄k|{ƜssZޭ֥kΜƔ{ޥs֜kΔ{ޜޥΔオ{ƌsƄss{cΜ{εﵜs{ckZcΔkss{JRRk{{Ɣ{ks޵ƌkks{{ֽRRZ罽ֵε֭Υ!!)֥Υ֜֔{{΄քss{{cckkkkZZJJBB11{s{!,r H *T #HEtYCOǏ9@t\ɲK+`Z9M+lJi?yѣHbpSӦ_HJիXjʵׯ`zJ aӪ]˶[ۻx ܲ`Ki&%;A̅Ð#K֪b]TJLZҟўFA5 H+6lbh b@ %PT+Lإ6 CWO^ %Pjr. S}PHTXu0!ŀIl l`A*("!vXhҡ)ցM%HL))ƨhc,!A$Ĉ *v@D<J6@Pň{MATU%\v o`e"x%c HHoI"Q#hII{"h92ʥ"d9$le$0awz10XTGPeA#j+% &[ʥ$X;wpRK-`")tX'<̐B  6@!"CO0 aNPJRFSpB>PRK.lr8 3 +. '2 VzH; 3dq5 0#@DPI-MTIM9p%:NOD(=1 0pO+U%rDRF>PrD 9  cl: 3a n r +xP#ࡷ@{'ʱ8U8(NȂH!9!~@DA#̀I2*(!dPJ;;pcA@$l SA k=^#A{D%}3"^ [ @P~@2(hG, NoJx ):N(&2J2ﴕ'w)N=}'<VH0!7˞ CH 4Z̟Kj!hF P@DGLC(̰~(1Sf8lP:Lj FLqtQM: MJ3JxB a)Am[BqLD]ÿʁ.9V8AKItc x@,` b5K bh2Ipşp>@czaIPB@QzL O0"tM ń<*Pz X<8q),͍Ъ`b h4z%LAӰG9QND!Gz &8FTIЏf( S+YbA;a)}!XG9nevp Z %p$X `p~cܦ`Ho 9؂j@&G`N @9a1BW8jpG!* PK+W6fc ͌ 5X"@\vy"(vpcH |ls@\``Z+ƃ,m_ 3X(Gn.?4%PmH!p#$HB:2{>OF3@]y$07cY"Di*׭jE KVe :M&ao TDQE AxD9 K5 XZ)WP ':Ňy~h.,XR"Eb "D4 ،T0V^hv+}m`3EڜsPj@'{"N'>O` @#*yQxĮ0yLDD',A{KQV18 H&p4 h668 8yHAP/&x+:1L?0& h(&"A QHa&PXs0 ؀ `l0K  sȁ 2J` Xu |p ]` ;pf* L L؄GblT `'p50H P` 0 @ @  m8f Ӱ{H[Pׁ 5  pq a ! *א p))$#KMY5y*ݰZLp X$VA'*ְQU)܀(*x!xʨ$a a  Ca@ |η|ې|gi |o  Q8Qɐ }Rq芡& Q(|p|i p Њ Vq8 0,y݀%i /`.B lГ=i ]p>iFpi PiviXQ0%TȎ P%yF9 l c?YJ1g`Rp8YQ PYP: @@+Qyא݀ʀ c pC%J)bb o~0Q `PcR! w pRsI:VI Pqgj&}+.3hWha Wr '~joP ^v`} jP!P!0%+bs0@{0 v@~G{  ` oPT(Ӵ({)*}ݐ\P UT$  X#נ ` @~F }u Vy# l`  %xkR@Pp7 CvA'Sq 0d'~F @ 4T2=o rvQpjRDp}:hG ե ڔ&p`O~`i{PP8@@]"~ >@ 3p,}@t h-6{P %>҂SPO0 D Rjz 0㔺XPPA ؀`R(Vpe ` 5_qc(C fA p+Q(I o  ~P 0B  .F<J R  \ Z@}嘜'bqC{0 9 @ py d g A`* 63 3P,σ )'ϐ;b 0 /P   fckSp  .*(TR|s P* o`@Ap&†-k`4prm Sxpr =t3CIp` O"D03BJg'wOmEty +u`x|U,HpA*@*6㸃Dp@Et+:\j2L ;E ԥW'7G v$Tuv'wU(=e@ 4JP)@ RJЅmvUHT !e+oTu<5ɆvSVpw&%0_ gvD3~dc\lOv U_we(>'Ns2| "Ęi a\"=n? TbƠr˙Pn(ռM#kD m;`os3StPAD IShx0dp ՛&tp|7\Iױ  Vk?4T&)Mإ/Yٶ/ M8|' FG@Jĸ` e@ >N~p X=|w\IB <3 4 0d4O  # &Q}Pǜ*Pqz dA  7e`;u `qH=P  SEprJ|b6Jkl MP@v@ J\HF_- ̽%uCVi2 j {_ T!><*HF FPm0 K q]?S`.2;3 H p^ {4)`$N@I(9d0=p=K3Bk(u&,r KP RaR N 3ns,+<`H0бl d [Y\bPBsS@ %`%TlH@b&r+ 0' lS -Z01@T0L>* }@/-l' `To"Lc|0&%bytyy bJ{pvtRPq{ Пu pj K DZPBæ@sDbAl+ P p ~  P P p Pu0s T_05x nI]Ћ}-%KCjU4( `X{@KiAj`lЄȷِEze8 7 v80  ($ZUHϗɹTa1KwTo|T(q WHeha@x ҋ`J艜$p~|l d`ۻ' 1)g l~g DU>|p)`l2NR+ $`7H_~,8p 4&0 A`BP<F8B"*RpE *<Yg,SQ U40AV 4KQAi"0sC bܘ@ ,J HX Jfa@@Ja8k l80a7lؼsa+?Zg@ A%4غTPXխj \'xY' 7ɑ(Bf1YvO U` [mvuF@±1c% AA"C DH;,$L,b0dL6MTN(dNئ)qG)x 9 y@0H. Ϣs"*1޸@`AAԸ`AAD != QN`O>dQ8:`1y +9YCQWFYf قZna%t`YkG J "B$u@)*aܬ@7 ؀CHP)`CUpF;cqI xRN8I6ʠ)(cJ(YXaEDiwdHiX]v U(7]pyuxi]nenZy|+7z %sY7 @߰uyHhNdSB8 Hߐ‘o7i)hgU_I"hQhv JZBOq]7aZX$L %\j 1f[pE3$ bePuI(ǚq)Y%Jڱ Yr@ vqB'-~ȁO-!$H Ff8iaV\ IaRjKn@<@TA @us| H\ID?fW2H$4 8%A ";A1Y,(:5"my0pbNxF;A#@ юsCa$:䱎6퀇d! UX G+ Ws$4 % @- :K`,> x~S\@jōFTh0 E-QW񸃣C,F?0WV W0hExQ!mPⰊQ=O bXb 4tiH&=G@rG"`8ZbY}AsDrc!<@Go=A $YeC{21V]:ݩ BRdi7i x#V)d0%:qL|a-DD.цxHÍnU;h&P>xò blS2@!@ { L ?e;6+'TqP(bn8L7@\E9Dj0I\,TB8a?8bdS ~VUZuu7.i<p1j$l@ =(Jb =TKʜgk D p!h) Nl`һ%r0NB<`N<> Y;%pB~ SV+{ݭ|-`Xfp  HGub|dA @1,A2@*͡Pr`@"D!H!(^HC,w#0ux'L k^̍=8vbꠇ#wU+$6uV pef?BϪ! sV;qOd&A!V@ăG2P AgohXI _ZӥS*GHdȄ'0qtLxX@0I, #pav?@f,dYap"D,-8Kɜ@ fs O0oУ'^s DBXj5Vё 2" 1`D09lP賣K^MIB RA $ @13FӦ`wJ C䧐%-j 30P&"Q@BRD$p;`=[I+4/ؽޘk@pikߐ=CKHp^? t:ّ٪->CH)K3(ȂO<ENR38A@I@TH?PpH56؀.0@k8 @l jI!mh:P kX1 $8^1Cc᐀k*@EIxD؀:``eP*rK @P\C6Ƞ CA`?XXȉ0 ` n AK3A`,GJ> : ~C @JE6H ߋkfz eÏHƸ8 `  I dx! @ ^!8`Ats6Y ^@sܨp(d)d S8I~0MOX]AhK2EP4H2Z&x;#yB@h#`4|`VQPHɁ+?p|ӣD`3̠X/HPDM%.LPխKj{q6h?z{S!G,lPTN@h8"Ex0%@xs'(3{*Kj\ )_;H90CFh3b Fs @,! 0Oí4[QWm i"NZwZ`Ȃsp!H/p6 PYX;!$)9JX;)Bx,!:[.JȞ.,Ɏ'0EK}b GOG. HIy\2oG`Q+0N(|&BlxP(1j}hp:8QAXt(7KyV8A„^=-B [^L0qK =ԙy5[ڡLGa\Yh;G CXsU9N8LH/BhWr Cйޙ=(uZ#))uA1#)?Jpv=H`ŴMp ` .!P/T@*[72g8^=?@8\ryz?#f1@*L~.W@qQJخ+x.6)YJXJf8[A8O0y%1YG$JQR1@ßγ炑7*d6,N`O 2&{ ;p;?Es'~K[8FGO UjeQkG g~̊,h{K%)45,:4CBx*GNÓg8AJFpvh$UhŇGEP_ kbFkl >+y j ҥ 6v(Ј0 l@;)xQLp,Bx ?-((0PhF(\SP8uf4EЄ\LMJh@#JSKv%Dę0 ዊj~UWȪ ˴ZPuXGw59|r$ȁ#0WwJ3M;1G#%;yLP0O8m/XH8x8uЗVExţ੕RU0W}&I:h`, .Hq[ !`` T0A,,(@ @u0JXvT+Vj>:;^ѹϩ-P`) Ilݡ|5 TyLc4DS0MKV t$@G2 .PB9zP%xU(`v(ZQz8& cq д%B L G, h;4=B\5`( 2%6 ,YFJp/D@%bq@ h1faFHKI&Z,hQrDW9ұuB=f z/I@T VdU&x%!Ȇ(]t~zGIPf"Iu `AeRq) )}jm"](RR!`G@K@*s5N k4%lddG<tZZ ЀF d uî@aRt 4,PX 8& /3 HW#%)?Ls-s3̀e,.," 8Hܙ;jn8$%0x;' `MI/00xr iu7JgEz0w:8T  yG$&U\%Q.bE@ 0\%Oq2  & `m@!x\xC,bɎ7p5ALY)\z"DO[KL tj#̀I 0-\h2@˷@t319*z5 EF{0tb)Fmx%ԅ i@Y" @ ̀ d4!yeZ= E K(@dԓovixIR3 hAMb `0DLY̷54=qP/ \"0vӭn20Qi+ f31u 8!u5H7l r7lɯ/:{%?9ʷ=ha _C"Fa p0fjX_;WXy\:X3 Vߐ! yFF5wśV7 W"`C\7}C?1?=+^; hO3n P%/Y=Oߥ~γ OC@ϼy/_/7}6Ƽb{{S `Qχ'??3;v47F Pӿ/Rk GxEkI]LIET`iݟ_5@d !@ChQEll\T |?WUST8H8C;: ^t]i}5!V{ Z"hC?H8]!6a$0lhj!A7(K""Π \@":y^"&f7 U""]aЁMA$N&Ƣ,"-"(d).bd8bR@-&2.#3fbA/`*B"#Tra3~#8c3;aplus-fsf-4.22/src/html/LicenseAgreement.html0000444000265000001440000002043310737165302014655 A+ License Agreement


A+ License Agreement

This License Agreement states the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications.

Definitions:

    "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification.

    "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder as specified below.

    "Copyright Holder" is whoever is named in the copyright or copyrights for the package.

    "You" is you, if you're thinking about copying or distributing this Package.

    "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.)

    "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it.

  1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers.

  2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version.

  3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following:

    1. place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as uunet.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package.

    2. use the modified Package only within your corporation or organization.

    3. rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version.

    4. make other distribution arrangements with the Copyright Holder.

  4. You may distribute the programs of this Package in object code or.executable form, provided that you do at least ONE of the following:

    1. distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version.

    2. accompany the distribution with the machine-readable source of the Package with your modifications.

    3. give non-standard executables non-standard names, and clearly document the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version.

    4. make other distribution arrangements with the Copyright Holder.

  5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. You may embed this Package's interpreter within an executable of yours (by linking); this shall be construed as a mere form of aggregation, provided that the complete Standard Version of the interpreter is so embedded.

  6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whoever generated them, and may be sold commercially, and may be aggregated with this Package. If such scripts or library files are aggregated with this Package via the so-called "undump" or "unexec" methods of producing a binary executable image, then distribution of such an image shall neither be construed as a distribution of this Package nor shall it fall under the restrictions of Paragraphs 3 and 4, provided that you do not represent such an executable image as a Standard Version of this Package.

  7. C subroutines (or comparably compiled subroutines in other languages) supplied by you and linked into this Package in order to emulate subroutines and variables of the language defined by this Package shall not be considered part of this Package, but are the equivalent of input as in Paragraph 6, provided these subroutines donot change the language in any way that would cause it to fail the regression tests for the language.

  8. Aggregation of this Package with a commercial distribution is always permitted provided that the use of this Package is embedded; that is, when no overt attempt is made to make this Package's interfaces visible to the end user of the commercial distribution. Such use shall not be construed as a distribution of this Package.

  9. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission.

  10. THIS PACKAGE IS PROVIDED ON AN "AS IS" BASIS. NO REPRESENTATION OR WARRANTY OF ANY KIND IS MADE, EITHER EXPRESS OR IMPLIED, WITH RESPECT TO THE PACKAGE (OR THE RESULTS TO BE OBTAINED BY THE USE THEREOF), INCLUDING, BUT NOT LIMITED TO, ANY AND ALL IMPLIED WARRANTIES OF ORIGINALITY, ACCURACY, COMPLETENESS, MERCHANTABILITY AND FITNESS FOR ANY PARTICULAR PURPOSE. YOU ASSUME THE ENTIRE RISK OF ANY USE YOU MAY MAKE OF THE PACKAGE. IN NO EVENT SHALL MORGAN STANLEY OR ANY OTHER PARTY, BE LIABLE TO YOU OR ANY OTHER PARTY FOR ANY DIRECT OR INDIRECT DAMAGES, INCLUDING, WITHOUT LIMITATION, ANY LOST PROFITS, LOST SAVINGS OR OTHER INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT OR YOUR INABILITY TO USE THE PACKAGE, REGARDLESS OF THE FORM OF ACTION, EVEN IF MORGAN STANLEY HAS BEEN ADVISED OF OR OTHERWISE MIGHT HAVE ANTICIPATED THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OF CERTAIN WARRANTIES OR LIABILITIES. IN SUCH EVENT, MORGAN STANLEY'S MAXIMUM LIABILITY SHALL BE LIMITED TO $10 (TEN DOLLARS).

THE END
 
 


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/ManualCy2.gif0000444000265000001440000003112207215453032013031 GIF89aD ̙ff̙̙̙̙ffff3̙fffff333fffffff3f3333f3333f333f333ffffff3f3333f333f3f3f3̙̙3̙ffff3333f333f3̙f3̙f3̙3ff̙f33̙33f3̙f3ffffff3ffff̙! ,D  ǰטıўʱCL4N* q-0 Q )%JEё \z 'RvP $UʴG ݂'tvbŒ5Wu3B8PKw.r3x0ԷGhAznIZ3دGNX0`׋$ 77B;cR 6NvRVPp@G1`K#)7V7ȻM`%3w0 nITθĊ/%cTcq9DbCI032se1G˙ :!J6 U$Eł)Q?F4&`G_r%qȪDEeLh^ls.L81$&w}QԦ4ϔ`%SE7d4Ev5H*N#;m}Fw?j3qߕ -qh#uHysӶ!2umݳwQo ]VAFf8= ##pnU K/SO . \& Eܝ ? 1e1%MGݴT443-dsygJsMS^Һ;on0,*mơ۱ܦ4~0QphGnEO*յ27kE=]"JyN^dLwIs; 0|[ir2`ǐ @n#,ER> i%M#Q7}o&=ыwZM${Fc1 i%.PWp6}I5mRe8P2ΒV48Qw`[6WI0A7_'tf&,%X0g:>V|K-H8!@BQCٓGWG0G0ZFSs7u%P} $%0>a+HJ} gbogSM9δ6[xB8,̣fĄ/s,0W:X&,@r"Rek4G]?C 5WR$?"!\.HKAC(Cm|ۓ+UHr.Xf8ƈۑ%f1""8G{x,p{C.RP%'N )EA3&1?B. 0r$|AFq H\sX2YR>7@BfRi#\@{0XsGPbgË3#,[W(h(d$-"$Q۷?7GQ4HYgG{8tN""?9]{0X[PS5섑vtW` 2Hs{Db;2}-[B10yj9,fUUwQXhi?wCg\2V!0B{6 x Pr"%|BY6^WXP0sld.Q&:qd蛳uX(X]ͥ*8A=Ay97Gqw|keRqc̀Ica&ҙvOx܉H{yHi1ҙ3`&+ ]@9u 9 P`f㸑xc4W!IQB{+ >ky6[ÊYi:,6@ ЛWP{ +!%˕ :vˊ 's\g jQv˴a!4 hduZJ .ܪ+)m{Ȼ{ ѡM!}m}lͰ| 9k '#BH~ 0 +j? 39>vge :C>^Jd-Iݭc=ݤlj3n\mzȊ!nYL̚  +(>Ю=ggN{K\cԴ>~.[>E@=K\2 @|5{̫ky M]T,,g@ UEdޤĮňϋ}  d~^^TBH$LO j{>]>U %&lҠ,gQT,> Ң耽Ɵ G @8I|zɨݍ  B÷e%BI.JNxK\˾^ h~a͏/@Ƞ f<M]?ܨ {p@oȥ*#|ًT+䨆~ͦn [fǃ}+; Pc * p?| }³ -5RG϶5B롌]ͤmSxet; @2fۨݭ~;łS  f ՔݭܦЈ $#ENԵM]]bP3Y%C1%AiQF=I_0ٶRThb&ahZKQH R@A @H]-$dx%$\RBdf||,+\pʼnctU^vgzڕ;s;9X&=j)hzf%j{inVnĬpʉ봃e(țJ+G2nt&'u Ah-Nӯ*P X0&5puZc](!:LMW]쯝Pn`AV_o:Ns,f*ΰBy%`i/uf:Ku.~jBGl,,g ?,(*uh)pq* 2y @:u],Pd0+:#b(; vFbf >hH7HcϹ`{VQ3uYkޔ-1'ڄ-) 4Gl;nȶ%fg~\g!ǷSm+{_& qtaӅ&w<-# >E'5 7ԵP Ő f cB '*h{L ĢUap%: =H=qv2ࡼ+R&!hbQ ޖAk^: 8%.]$!GqE! h4@;Im@l.OEFta2Ḭ}x24gP>)5&zL-:b5H*E (ЀYr%G6 |KLP/4yZdIɸ@4@. @@ĀD;AE1TH$* 0ci (K^ kXX!N*G8 )b \8 MIV@J-03),6  ?@\ֶ󮕡kfLx,0L`5lh; S L aP(`=)6jgBn”LlM$p葃'F ״,PLxXpKQ7Mm+20T;݋ׄ)a36mQ>O{tRo(0n՗^گq8yғ 0n|. 4b{Ԗ 8m0@ar/*;YRTL8@s)*.hDYOb C~jq-UŽ*R"BP̸:%>bd1߼ؙzb'`Qp4ܕÁDkhjf@lvS 3-k22h&sEp[x3`Xɍ,%Orµ%V:wBKc+KՃixϭʠC,`[ɳ*G9O~-LOf5{3,1u,- َ*U0@s`F+~ةbN`ZmcRGI+} Բ =f6mugYM'{քu@FOOL+O64ȧnh䙶(4\n/y|p炧i$DQi:Ե Le|!BKb_JVK3cY }<מu15N @)ˡ+`Hҳv85_鍲H|Zƒ]z.?om};>OQ)K'!-K:e+zQܯ𸗳/\C&uD|~t)5PtCz'ar;& uޗi*t2ӽwʽo.Ox\+e#~cWUfWSpVSt`}A~OeY5FHAma%aO'u|>AK aew| otMy>iRBr\0zDž7vgf=b8LX M[wKKfx%Zc`__:?1Oiqf{HdO8U{R99%EXMjgKz8w3wZ$`bd-\C_?QRa}ewMk2G8V_9LbG޲D!Vw7[8mvi3lL8%6K3'yB@r'RQEX0KOۇLA2b)pBGUwR3}ĉI& _4QzѴOe!%R!*ZdQWx @UkDi8><5Ԍz(>Q g"6XX/S5)TU]S!,|64(Wf")[cO8Sj1x "aU QwfiBoiDcgrpwqTEa|N::-g')`)qXK*BJ7r051c@bX1v4w Q q?1x3F_dۗ^dqHr)IEf8ƒ, E;[Qó'\c 9 ՞K9a,(qfh+q#2,s=9KqGI ga&n$Uv6PG JJ9 :*/:D&"4D89hw vA:UUP%)Zuff槏f@;:z2eIsqe9IEA>8Ǖf6Wd1Q4T&RHJqGi6 c`: lu2BiL ;7_ 66ei[kGT:?a:(b7椧C2g4%E27&y% :p@J:*Ux':^(?1;pr,R8`aMJ@8sz1 `p` r12h.+>l U@U6?n٨ mqH땚JW3KG BCT6&J.e[{ hC'SUNQBe `Ad/K2"BIt YU2X c6a<#ꌪ+Ǫ fpWV{ 7%K t_ z6yq4J@aK"79R#S#Vk*yyd R+rع(=/ 1YY[M0ks_^`׹2M۬UVy\Aq٫i-e039=ăs$<Ӻ}-E _( j:<'{1vFۼ`Ň@|X# U1GqK *-xD1;Ԙ)#dhJHhE?B+ T$|c > 0>8#DS*gq5&Hxrl p6;@K _,z1j Ntʜʲ<˳ʮ˸ ʲXLQ ڤ;yo > Rm o|MlukK#<݌ص]s?eC;%f5ʘ7 Sb1B&JѴPR¬TIUX%İ8;!= <$Zρ %#=.̱[B D|? 6}K,`˧Ic^|+?4ӳJ]} ??:jB0c Z{< M ]̫tEӺ@٥$s-<ʣ =Г]ߠK QDϡw VcM&cc_>.<$qEfMϤ sε). .j^}[a_O>gt"Nʭ3d_]:]N|[NmP;@ͮ DJ<ݻk[Uq ף,鵭@hڍ?:Β@ծN͢!zP]T  pN}]/ln sMdO>J-?]cinfn^#%T1Cϧ^)%>vЏLEw=mc|~^e7?Q 2*h=b>,G_o# 5#ߐ=ߌ^&X`ldŷ-{=o4~ վ%yu}^Ty.3o*n{/ʓܝT]^Mi]rȨ+鸿2ҝțTd~ek\㪱rГgKEz5s_gER] # ]n}  Ć!  ߮ڴقŹ D.3 7pv@C[GoDb.!C;v(@!BxQ( !PH&*.@de{%08ƣr( !P@o11:ӦW l 3Nv@bm5jKW &! Qӡ" fADdz9{XpㄩlQ+)\b"l5+˕Hw.d9Ÿ!n퉹t\ tʞm/~<^ƽOy2AZNvlӍߟF[>ݝMRm1t%ru'mc|I`!&!*衇a2a_@aaX`N}(3ֈ٢V Y(3G!;ӓ1)唋Q: Vv饕W4^plhd昅1d?fm4'^14N8N{'-A!~*fNOJhMvB(樔0斎*{ 㨳 孴Bࢳy铣~*  hb[>fd+k:↲zjJlfkNkb槉-*m NXV2i/,r{@G`&,4[3;lݔ9|lHks-C2Ig͞,Ta `6a 6^w7K2Ȳ-+i=B 3^B'vۋ[xەtڠk饧t38MeS{ډ6f-Db; H|G/ȷg/ <0y_嗯 | P>o[^̖=xsؾAv|PgB|x_"v3%ƯS0A+a oh;-~6$_ u(5# XC111 âH2hLlqv(x̣Xq@HL$먼.F~p$} JZ,N. %C*9G7>d$\GIX`3|Z2t؏c#gIIҘ$rY\R-O@;aplus-fsf-4.22/src/html/Manuals.gif0000444000265000001440000000341207215453032012637 GIF89an}̙ffff3ff3̙!,n}I=hqtf*tmu9X;\zȤr$~AtJ9=c!f꒪01 ⴺF@ܯ GxY.p|>rcfh_}NnZ%J?:v+3oC!/3q4lϪF1%YW g.ao{ih0]JJ('& fpEAhz&]d)[ND)YHf."}arneYl8ha Z!\v&V0Kv:kA\p4|Jpӫ![}ZĞQ+S[[NoEwQ[4Ku蒭-tPx8CYc,; a%*% {"-%w2jwD6>"!Պ)VmDb0G*4CNDWC0_N]Hijd%7}yn/}EjNx&P?=02 ymTKX اvAoUj9֦P(d"dJmr@t<< >͠ $<'O/$}rz`LM-SƟL"|]D @ gxaBGjR fW,0S K@ x!/ B@-dd `?$1!@H=mwAaS4Üֈ_}R"(P@)bd>a^!QF0 B%P̓==Y/R$˙Γ.]4J'H(Q??#[=4bwV)0نwڥ)o[_\g NmdLmOytK`! d!F7ZFPtܣFJҒV(% >JjĤ0Ho ta>݋)KCStI0n'Ԧ^GizZ +UT3zU/:EUlzazRfֶ/IJ׶@Fթ^ik{ 샸s0SMXٰ,_Oq&ZAӻlS#;aplus-fsf-4.22/src/html/MapFigDropDown.html0000444000265000001440000000516710737165303014273 A+ Reference: Drop Down Menu

The Drop Down Menu

Presence

The menu appears when the user presses Enter while the widget has keyboard focus or presses any mouse button while the pointer is on the value area.  It disappears when a choice is made or choosing is aborted, as described under "Function".

Function

For menu invocation, selection, choosing, and aborting, mouse and keyboard actions can be used interchangeably.  At any point, either can be used, regardless of how the present state was arrived at.

The current choice initially appears selected (raised) on the menu.  The selection can be changed either by pressing the Up Arrow and Down Arrow keys or by moving the mouse pointer over the menu while any mouse button is pressed.

The current selection can be chosen either by pressing the Enter key or by releasing any mouse button while the pointer is on the menu.  Any item can be chosen by clicking on it with any mouse button - including some other button while one is being held down.

Choosing can be aborted either by pressing the Escape key or by releasing any mouse button while the mouse is off the menu - including some other button while one is being held down.

Position

As far as allowed by the position of the widget on the screen, the left edge of the menu is aligned with the left edge of the value area and the top edge of the initially raised area (containing the currently chosen item) is aligned with the top edge of the value area.

Size

The menu is sized to contain the labels in their specified font (subject, of course, to the limitation of screen size).

Color

The color is determined by the `bg attribute.  It is grey by default (more precisely, the value of s.GREY).


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/MapFigFrame.html0000444000265000001440000000354510737165303013567 A+ Reference: Window Manager Frame

The Window Manager Frame

Presence

The frame appears when the object is top level or a popup;  its presence is not otherwise controllable.

Function

If the `resizeable attribute is 1 (the default), when the pointer is on the frame a bar and an arrow appear.  If the left or middle mouse button is then pressed and the pointer moved, that edge of the widget is moved, expanding or contracting the window.
When `resizeable is 1, there are breaks in the frame delineating
resize corners, which can be used to change the size of the widget in both dimensions simultaneously.

The resizing function can be performed programmatically:  see the "Size, position, etc. on screen or in parent" page.

Pressing the right mouse button with the pointer on the frame displays the window manager menu.

Size

Frame thickness is controlled by the window manager; there is no A+ interface for it.

Color

The frame color is controlled by the window manager; there is no A+ interface for it.


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/MapFigHighlight.html0000444000265000001440000000313710737165304014442 A+ Reference: Keyboard Focus Highlight

The Keyboard Focus Highlight

Presence

It is shown when `hlthickness, whose default value is 1, is not 0.

Contents

The highlight is a border `hlthickness thick around the body.

Color

When the object has keyboard focus, the color of the highlight is `hl, whose default is `yellow (more precisely, the value of s.YELLOW), and at other times the color of the highlight is `bg, whose default is `black (more precisely, the value of s.BLACK).  The object may have focus because the mouse pointer was moved into it, its `focus attribute was set, or the focus was moved using the Tab key, for instance.


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/MapFigLabel-ValueAreas.html0000444000265000001440000000364310737165304015602 A+ Reference: Values and Labels Area

The Values and Labels Area

Presence

This area is present unless the widget has been made too small to display both it and the other areas.

Contents

It contains the buttons and the labels (if any).  If there is not enough space for both, the labels are truncated or not shown.

Arrangement

By default, the button-label pairs are arranged vertically, but the arrangement can be specified by the `geometry attribute.
Each button-label area corresponds to either
  • a symbolic index of the underlying slotfiller variable or
  • a blank area as specified in the `geometry attribute.  Rows containing only blank areas are not shown (i.e., have depth 0) unless `R is 1, and columns containing only blank areas are not shown (i.e., have width 0) unless `C is 1, and even then trailing rows and columns with only blank areas are not shown.

Color

The color is determined by the `bg attribute.  It is grey by default (more precisely, the value of s.GREY).


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/PxPurple.gif0000444000265000001440000000005507215453033013017 GIF89af!, ;aplus-fsf-4.22/src/html/MapFigLabelAreas.html0000444000265000001440000000624710737165304014533 A+ Reference: Label Areas

The Label Areas

Presence

The label areas are shown if there is depth beyond what is needed for the window manager areas and the title area.  The space is divided up among the label areas, and each may be only partially shown.  Specifying the `naturalsize attribute causes all the label areas to be completely shown, of course (assuming the external constraints, like screen size, allow.)

Function

If a callback function has been set on the object, then when the left mouse button is pressed and released while the pointer is on a label area corresponding to a symbolic index, the function is called.  The path argument is that symbolic index and the data argument is the value picked from the underlying slotfiller by that index.

Arrangement

By default, the labels are arranged vertically, but the arrangement can be specified by the `geometry attribute.
Each label area corresponds to either
  • a symbolic index of the underlying slotfiller variable or
  • a blank area as specified in the `geometry attribute.  Rows containing only blank areas are not shown (i.e., have depth 0) unless `R is 1, and columns containing only blank areas are not shown (i.e., have width 0) unless `C is 1, and even then trailing columns with only blank areas are not shown.

Size

If there are no blank areas or horizontal repetitions specified by `geometry,
  • if `C is 0, all label areas in a column are the same width, which is by default determined by the longest label in the column;  but
  • if `C is 1, all columns have the same width, which is by default determined by the longest label in the object.

Because each label appears on a single line and all are in the same font, the virtual rows tend to be the same height, even when not forced to be by `R.

The size can be set using the attributes affecting overall size listed in the "Size, position, etc. on screen or in parent" page.

Color

The color is determined by the `bg attribute.  It is grey by default (more precisely, the value of s.GREY).


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/MapFigLabels.html0000444000265000001440000000415310737165305013735 A+ Reference: Label

The Label

Presence

A label is shown whenever its label area is present, unless resizing has made the area too small for the label.  (If blank, the label may appear to be absent.)

Content

Determined by `label.  If this attribute is null, the symbolic indices of the underlying slotfiller are used, as characters, without the backquotes;  a symbolic index is likewise used for an individual label that is null in `label.

The Ravels of the values are used;  if perchance a nested array is specified, the specifying A+ expression is shown.

Position

Font

The label font is `labelfont if that is non-null, else `font if that is non-null, else kaplgallant (more precisely, the value of s.FONT).

Color

The label color is `labelfg if that is non-null, else `fg if that is non-null, else black (more precisely, the value of s.BLACK).


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/MapFigMaxButton.html0000444000265000001440000000324210737165305014452 A+ Reference: The Maximize Button

The Maximize Button

Presence

The Maximize button appears when the `resizeable attribute is 1 (the default) and
  • the object is top level, or
  • the object is a popup whose `head attribute is 1 (the default).

Its presence is not otherwise controllable.

Function

When the left mouse button is pressed on it, the widget is enlarged to occupy the entire screen.  (It is contracted to its previous size when the Restore menu button is pressed.)

When the right mouse button is pressed on it, the window manager menu appears (see the menu button).

Size

The size of the Maximize button is controlled by the window manager; there is no A+ interface for it.

Color

The color of the Maximize button is controlled by the window manager; there is no A+ interface for it.


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/MapFigMenuButton.html0000444000265000001440000000471110737165305014633 A+ Reference: Menu Button

The Menu Button

Presence

The menu button appears when
  • the object is top level, or
  • it is a popup whose `head attribute is 1 (the default);
its presence is not otherwise controllable.

Function

Pressing the left or right mouse button on the menu button displays the window manager menu, which allows the user to restore the widget's size from full screen, move the widget, resize it, make it an icon, make it fill the entire screen, or lower, raise, or close it.

If Move is selected, the mouse pointer is shown as double-pointed crossed arrows in the center of the widget and the widget moves with the pointer;  the move is completed when a (pressed) mouse button is released.

Size appears on the menu only if the `resizeable attribute is 1 (the default).  When it is selected, the mouse pointer is shown as double-pointed crossed arrows in the center of the widget.  If they are moved to touch a frame segment or, in particular, a resize corner, they are converted to an arrow and either a bar or a right angle, and moving the mouse moves the corresponding edge or edges.  The resizing is finished when a (pressed) mouse button is released.

If Close is selected, the variable is freed unless the `exit attribute has been set to either 0, making close a no-op, or a callback function that will handle the request.

Size

Menu button size is controlled by the window manager; there is no A+ interface for it.

Color

Menu button color is controlled by the window manager; there is no A+ interface for it.


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/MapFigMenuLabels.html0000444000265000001440000000414010737165306014557 A+ Reference: Menu Labels

The Menu Labels

Presence

Each label is shown whenever the drop down menu is displayed (provided, of course, that the screen size permits it).

Content

Determined by `label.  If this attribute is null, the symbolic indices of the underlying slotfiller are used, as characters, without the backquotes;  a symbolic index is likewise used for an individual label that is null in `label.

If a value is a character matrix, its ravel is used;  if perchance a nested array is specified, the specifying A+ expression is shown.

Position

Labels are always left justified.  Since the choice shown in the value area is always centered, this item in the menu may not be horizontally aligned with it.

Font

The label font is `labelfont if that is non-null, else kaplgallant (more precisely, the value of s.FONT).  It does not follow `font.

Color

The label color is `labelfg if that is non-null, else black (more precisely, the value of s.BLACK).  It does not follow `fg.


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/MapFigMinButton.html0000444000265000001440000000253010737165306014450 A+ Reference: Minimize Button

The Minimize Button

Presence

The Minimize button appears when the object is top level.

Its presence is not otherwise controllable.

Function

When the left mouse button is pressed on it, the widget is iconized and any followers it has disappear.

When the right mouse button is pressed on it, the window manager menu appears (see the menu button).

Size

The size of the Minimize button is controlled by the window manager; there is no A+ interface for it.

Color

The color of the Minimize button is controlled by the window manager; there is no A+ interface for it.


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/MapFigOverall.html0000444000265000001440000000565110737165306014144 A+ Reference: Size, Position, etc. in Screen or Parent

Size, Position, etc. in Screen or Parent

Some of these attributes are of its parent, not of the widget itself.
Presence

Showing: `exit `hide `lower `mapped `pageselection `pin `raise `realize `reshow `show `syncshow `ws.

Iconization: `deiconized `exit `icon `iconic `iconized `icontitle.

Window manager workspaces: `atsector `incurrentworkspace `outofcurrentworkspace `presence.

Ancestry, children

`ancestors `followers `followertree `leader `parent `shell.

Position

Relative to the screen:`X `x `Y `y `YX `yx.

In or relative to a parent: `at `b `l `lockposition `r `t `vcol `vrow `x `y `yx.

Size

Own sizing: `extent `fullscreen `naturalsize `vcols `vrows `xs `ys `yxs.

Own resizing: `dynamic `H `resizeable `W.

Resizing constraints from self or sibling: `h `resize `w.

Sizing by parent: `C `extents `naturalsize `R.

Updating and evaluation

`active `done `evaluate `freeze `refresh `verify.

Traversal and focus

`arrowdown `arrowkeys `arrowleft `arrowlist `arrowright `arrowup `downto `hl `hlthickness `leftto `pageselection `pagetitle `rightto `tabfrom `tablist `tabto `upto

Function

`f1-`f12 `fkeys `focus `preset `protect `protected `sensitive `set.


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/MapFigResizeCorners.html0000444000265000001440000000343610737165307015335 A+ Reference: Resize Corners

Resize Corners

Presence

The corners appear when the object is top level or a popup, and its `resizeable attribute is 1 (the default);  their presence is not otherwise controllable.

Function

When the pointer is on a resize corner, a right angle and an arrow appear.  If the left or middle mouse button is then pressed and the pointer moved, that corner is moved, expanding or contracting the window.  (To restrict the change in size to only one dimension, the frame segments between the resize corners can be used.)

The resizing function can be performed programmatically:  see the "Size, position, etc. on screen or in parent" page.

Pressing the right mouse button with the pointer on a resize corner displays the window manager menu.

Size

Resize corner size is controlled by the window manager; there is no A+ interface for it.

Color

The resize corner color is controlled by the window manager; there is no A+ interface for it.


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/MapFigScrollBars.html0000444000265000001440000000701110737165307014577 A+ Reference: Scroll Bars

The Scroll Bars

Presence

The vertical scroll bar is shown whenever the value of `rows is less than the number of rows in the array, and the horizontal scroll bar whenever `cols is less than the number of columns in the array.

Function

Each scrollbar performs several functions.  The display is moved one row or column by clicking the left mouse button on an arrowhead at an end.  The display is scrolled, with an overlap of one row or column, by clicking the left mouse button in the channel but not on the elevator.  It snaps to a new position when the middle mouse button is pressed anywhere in the scrollbar.  It is dragged by pressing the middle mouse button anywhere on the scrollbar or the left button anywhere except on the arrow heads, and then moving the pointer.

When the right mouse button is pressed on a scrollbar a menu appears, with the choices Openlook, Motif (the default of these two, of course), Home, and End, all for that bar only, naturally.

Size

The depth of the horizontal scroll bar is `hscrollsize and the width of the vertical `vscrollsize (the default for each is 15).  The `scrollsize attribute controls them both, and can be a scalar or one or two element vector;  when its length is two, it is equal to `vscrollsize,`hscrollsize.

Color

The background of both scrollbars is the value of `scrollbg, or if it is null, the value of `bg, or if it is null, grey and dark grey.  The darkening of the channel is not maintained when the scrollbar background is set, but if the user changes the scrollbar to Openlook and back to Motif, using the scrollbar menu, the darkening of the channel reappears.  At present, if `bg is set to a new color after `scrollbg is set, the latter is reset to the new background color.

The foreground is controlled by the window manager.

When both scroll bars are present, there is a rectangle at the bottom right where they would overlap if extended.  This area is not really part of the scrollbars and is unaffected by the setting of `scrollbg.


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/MapFigShadowBar.html0000444000265000001440000000317110737165307014406 A+ Reference: Shadow

The Shadow

Presence

The shadow is present if the `shadowthickness attribute is not 0. 

Size

The shadow Its thickness is controlled by the `shadowthickness attribute.

Color

The shadow color is a shaded version of the `bg color.


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/MapFigShellTitle.html0000444000265000001440000000412010737165310014572 A+ Reference: Shell Title

The Shell Title

Presence

The shell title appears when
  • the object is top level, or
  • it is a popup whose `head attribute is 1 (the default);
its presence is not otherwise controllable.

Content

Its content is the value of `shelltitle if that attribute is non-empty.
Otherwise,
  • for the first top-level object shown or the object specified in s.WS, it is
    • 0_argv if _argv is not empty or else
    • the value of s.WSNAME, whose default is "A+";
    and
  • for all other objects, it is the name of the underlying variable.
Resetting the attribute to null causes the content to be selected as just described, but resetting it to the empty character vector is ignored.

The content can be all blank to give the appearance of no shell title.

The content must be a simple array.  If it is not a vector, its Ravel is displayed.  The content is not necessarily all shown, since the width of the shell title area is determined without reference to the shell title.

Font

The shell title font is controlled by the window manager; there is no A+ interface for it.

Color

The shell title color is controlled by the window manager; there is no A+ interface for it.


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/MapFigShellTitleArea.html0000444000265000001440000000421310737165310015366 A+ Reference: Shell Title Area

The Shell Title Area

Presence

The shell title area appears when
  • the object is top level, or
  • it is a popup whose `head attribute is 1 (the default);
its presence is not otherwise controllable.

Function

Besides providing an area in which the shell title is displayed, the shell title area acts as a button:
When the left or middle mouse button is pressed on it, it appears depressed;  if the mouse is then moved, double-pointed crossed arrows appear, centered at the spot in the shell title area that was pointed to, and the widget moves with the pointer, stopping when the button is released.

When the right mouse button is pressed on it the window manager menu appears, just as for the menu button.

Size

The shell title area's depth is controlled by the window manager, and is the same as that of the menu button.

Its width is always at least as great as the menu button width, is not affected by the length of the shell title, and is determined by

  • the width of the body,
  • the attributes affecting overall size (see the "Size, position, etc. on screen or in parent" page), and
  • user resizing if `resizeable is 1.

Color

The color of the shell title area is controlled by the window manager; there is no A+ interface for it.


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/MapFigTitle.html0000444000265000001440000000746110737165310013615 A+ Reference: Title

The Title

Presence

Content

The content is the value of `title when that attribute is non-null.  Otherwise, it is the default, the name of the underlying variable.

Although changing the title value or setting the `naturalsize attribute forces it to be entirely shown, it may, as a result of resizing, be shown only partially. 

Position

There is no A+ interface for otherwise controlling these alignments.

Font

The font is determined by the `titlefont attribute if that is non-null, else it is kaplgallant (more precisely, the value of s.FONT).  It is unaffected by `font.

Color

The title color is `titlefg if that is non-null, else `fg if that is non-null, else black (more precisely, the value of s.BLACK).


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/MapFigTitleArea.html0000444000265000001440000000554710737165311014412 A+ Reference: Title Area

The Title Area

Presence

Content

It contains (at most) the title and the shadow.

Size

Beyond a minimum size (to accommodate the frame, corners, and window manger buttons):

The depth of the title area is determined by

    and
  • user vertical resizing, if `resizeable is 1.

Its width is determined by

  • the title width (again, affected by `titlefont and either `title or the name of the underlying variable),
  • the attributes affecting overall size (see the "Size, position, etc. on screen or in parent" page), and
  • user horizontal resizing, if `resizeable is 1.

Color

The area color is `bg if that is non-null, else grey (more precisely, the value of s.GREY).


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/MapFigValueArea.html0000444000265000001440000000720310737165311014374 A+ Reference: Value Area

The Value Area

Presence

The value area is shown if there is space beyond what is needed for the window manager areas and the title area.

Size and Contents

Color


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/MapFigValueButton.html0000444000265000001440000000431210737165311014775 A+ Reference: Value Button

The Value Button

Presence

Values are shown in the form of raised or depressed buttons if there is space (beyond what is needed for the window manager areas and the title area).  Buttons are shown in preference to labels if the latter are present and there isn't enough room for both.

Arrangement

The button-label pairs are arranged as described in the label-value area page.

Appearance

The button is shown depressed if the corresponding element of the underlying variable is 1, and raised if the element is 0.

Function

When a user clicks on the button, its state is toggled - it is raised if depressed and depressed if raised -, and the corresponding element of the underlying variable is changed.  This action can be prevented for all buttons by setting the `protect attribute to 1, and selectively prevented by setting `protect to a vector of ones and zeros.

Color

If depressed, the button is shown in `fg, whose default value is `black (or more precisely, the value of s.BLACK).  If raised, the button is show in `bg, whose default is `grey (more precisely, the value of s.GREY), and it is this color that is used in the shadow of the button, raised or depressed.


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/MapFigValueCell.html0000444000265000001440000000435110737165312014405 A+ Reference: Values

The Value

Presence

The value is shown if there is space beyond what is needed for the window manager areas and the title area.

Contents

The ravel of the underlying array is shown, if it is simple, padded by trailing blanks, for a minimum of twenty characters and a maximum of one more character than there is in the array.

Function

The value can be edited, as described in the input section of the user interaction chapter, (attributes affecting editing: `edit `editbegincb `editendcb `editspace `protect `protected). If `key has been given an (event) callback function, it is called after every keystroke. Although the underlying variable is not changed until editing is complete, `buffer has the latest contents of the value field, including the character for the key that caused the callback.

Font

The value is shown in `font, whose default value is `kaplgallant (or more precisely, the value of s.FONT).

Color

The color of the value, the foreground, is `editfg (whose default value is `white) when it is being edited, and otherwise `fg (whose default value is `black, or, more precisely, the value of s.BLACK).


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/MapFigValueCells.html0000444000265000001440000000734110737165312014572 A+ Reference: Values

The Values

Presence

Values are shown if there is space (beyond what is needed for the window manager areas and the title area) for cells that are shown are fully shown, as described in the value area page.

Contents

The items of the array are shown in the corresponding cells, the cells that are shown being determined by `firstrow and `firstcol.  There are four cases:
  • if a cell is not fully shown, its contents are not shown;
  • if `respace is 0 and the text as determined by the next two cases cannot be fully shown in the number of characters indicated by `space, then stars are shown (the default) or the text is truncated (when `stars is 0);
  • if a variable item has the value of `na (or, if `na is null, of the item of s.NA corresponding to its type), then the value of `blank is shown (or, if `blank is not set, the value of s.AUTOBLANK);
  • otherwise, the variable item is shown, formatted as specified by `out and `literal.

Function

A cell can be edited, as described in the input section of the user interaction chapter, (attributes affecting editing: `edit `editbegincb `editendcb `editspace `protect `protected),
selected or referred, as described in the selection and choosing sections of that chapter, (attributes affecting these operations: `index `refer `select `selected `selectionmode),
and clipped, as described in the primary selection buffer section, (attributes affecting clipping: `clear `notify `primary `request).

Font

The values are shown in `font, whose default value is `kaplgallant (or more precisely, the value of s.FONT).

Color

The color of the values, the foreground, is
  • for a value being edited, `editfg, whose default value is `white;
  • for a cell just updated by indexed specification (including the completion of editing), the colors in `colors by turn, each one for the number of milliseconds specified in the corresponding element of `cycle;  and
  • for all others,`fg, whose default value is `black (or more precisely, the value of s.BLACK).


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/MapFigValueChoice.html0000444000265000001440000000235510737165312014722 A+ Reference: Choice Value

The Choice Value

Presence

The value is always shown, or as much of it as there is space for in the value area.

Contents

The name of the chosen item, the label on the drop down menu for which the corresponding value in the underlying slotfiller is 1.

Color

The color of the value is `fg, whose default is `black (more precisely, the value of s.BLACK).


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/MapFigValueChoiceArea.html0000444000265000001440000000431210357276741015515 A+ Reference: Value Area

The Value Area

Presence

The value area is shown if there is space beyond what is needed for the window manager areas and the title area.  The raised rectangle in it encroaches on the title area if the value area is squeezed out of existence.

Function

The user can display the drop down menu by pressing any mouse button while the pointer is on the value area or by pressing Enter when the widget has keyboard focus.

Size and Contents

The depth is calculated to contain one line, in `font, or, if the title is shown and its font is larger, `titlefont.

The width is affected by:

  • the longest of the choices, as displayed in `font, plus the raised rectangle and an area around it (to be precise, the longest of the choices that can fit in the screen),

  • the attributes affecting overall width listed in the "Size, position, etc. on screen or in parent" page, and

  • user resizing of the width, if `resizeable is 1.

The current choice is shown and, to its right, a raised rectangle which has no function.

Color

The color of the value area, the background, is `bg, whose default is `grey (more precisely, the value of s.GREY).


doc@aplusdev.org© Copyright 1995–2006 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/StarburstNew.gif0000444000265000001440000000066407215453034013712 GIF89a$f3f3fffff3ff!,$@I)cvW5Ic6Gl0DaHD 2a hC#,K@X8T c*0-j#8+T^WbC99aF ( X" P \&   !Wg(.*eh\-EuEt.Cs*I )?-C,^ QJ;FJ7  a)d 5ΉWT9  :ׁ6YM] Ti ;3hܓ@b]H . `AA!avAUQCHL;Db/Vz! B(p88&~B-5o|D4(io$|1ȢZG)"B①+HBbڵ)Qap$T,;aplus-fsf-4.22/src/html/TreeObject.gif0000444000265000001440000000715707215453034013301 GIF87a6pẕ,6I̷'h試+Wsvz`* d2l:ШtJZجvZp1;zn;WI<~~_Fc@B_c`UnjSRbGpRPOqȖ–ɲQPUo׶hHQM!sVTEesgM0j&馄*Ä W;D1Q|PYȖ,tGJYK}V>w2&eE”"S<ʒȝ:6 7Bo4'E SW`*gۛ#{,m]n;ٻݗoĮ{6gU2W߹5OV uXD+OD,fƽhf|XreXO-cqׂVu{nN\87ѮdfË_cIң_=ß/?Ͽ(h& 6`Vhf4~ ($h(,0(4h%7@)D"~L61& TViXb %9~[)Ffih&`'"i`)t(%x|駞Yg]F'a&(w}袘fdvکjG)Kjj>r~:(rꬴ*jF+ltZ 6lƮ윽zҪx-|~ n~KL+1r*.[yko : n{;I.3[/ۭáLk\.[lk4[8;2/˫ȆzmD39{s)EXd ~2'dV;UטlS\w}qJwQW gBBN*;/,7c%A N8x8◳y2Mwn,nι3УM3κkNܷ?:OMսw;h{;)9۸| gɯN}7hG߷j+@{~!,8 @u!}#懧1i|ßnſ f_[\KDL`(L S0EP(֞Е7nLiwC0D T H".r}`"yPl3TA 2qDϻapIь\t>lу8FB%qYKEu,ohߨE9Qa|;@Bf ۘE7n1#H5D)IВ#;&Jz$uAZV1a9;EB^l0׶M2E\ I{5N,;~ g:N&Sj8xr"!8غbޱ]݌%#W%Nf5O>vI Ϯe){X\.`YIؚ%5%) Pǒ/eguZkaH@ͭnw56;Lvi3I;׈6DtK] $vٵrk<v+KzHTVϸymVJ\uQDi>@|iDu7Z/;ܢ&<_u⪫' sɴ<"1 _k_R&^]x^1dB&U|忙=pO}]`/)-;KOg}IV@WUb'V] ؀صG7UuSCTlbgzEYYj6C4φv75X%6W~`~nǂ0hJeC_F""S8?tCilJZe9˥lqJJU:Uxڵ5Sw%F>([6=ZMcN^so5v_Xp5|CC%{Fal2?UXZH5Q5cvtkw۷YKXiU7 |Xa x%zaQXTxb>f=ljFMDx=me~ce(F!gXthTweThG]XZshv%DvFjEu);H~8Lm4׈JqGjKhx4税F.w3PGDwvI`gpBrElU1qr!35Z{4:TMjaڍ׆[s5n.}yxg܉&ݛҋo;j7v͕WB=T먩GOS߳y'L,y%j:sqP͂1x=ŘvmȡiJ7c1Q([ (ߡ(4] yUV@)dV(yX8L6Z)7BTlX2!)ϗ bIfjf;qtix|矀*蠄j衈&袌6ꨣ_УVj饔馜v駠*ꨤjꩨꪬa鬴j띮뮼:v̭&Kk4)F+Vkfv+ +i'0kkͪp Z;l6G,+%w.n'q/$l([, h|(̉8笳9ޜ.pS'E )-»Rl_tU3lI+uH+hufk5zlwfk~5kܴ7?NbUk$D*Ό+@Oneި92#v,x) y,1v else if (~xi+(jv[1]-iv[0])nx) y,1v else y,(if (i=0) '' else (1i),'+'),(if (j=1) '' else (1j),''),'',1n } E.g.: 3 +3-+ |3| +i-+ 3. Variables. BOX if 1, box diagram SAME if 1, do sub-array matching HOR if 1, center display on horizontal axis VER if 1, center display on vertical axis IOTA if 1, search for iota-form LINE if 1, use graphical line drawing characters TREE if 1, diagram is a tree with centered connectors if 2, diagram is a tree without centered connectors INT optional _fmt{} for integers FLOAT optional _fmt{} for floats aplus-fsf-4.22/src/html/fdl.html0000444000265000001440000006602410737165452012224 A+: GNU General Public License
A+: a programming language for people who live to program
Reference Manual

Terms Of Use

About A+
History of A+
Who Wrote A+?
Screenshots
Programs Written in A+

Getting A+
Download
Other Software
Installation
Documentation

A+ Community
FAQ
Mail Contacts
Other Resources
The Reviews

A+ Web Site

GNU Free Documentation License

Table of Contents


GNU Free Documentation License

Version 1.1, March 2000

Copyright (C) 2000  Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.

0. PREAMBLE

The purpose of this License is to make a manual, textbook, or other written document "free" in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others.

This License is a kind of "copyleft", which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software.

We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference.

1. APPLICABILITY AND DEFINITIONS

This License applies to any manual or other work that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. The "Document", below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as "you".

A "Modified Version" of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language.

A "Secondary Section" is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (For example, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them.

The "Invariant Sections" are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License.

The "Cover Texts" are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License.

A "Transparent" copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, whose contents can be viewed and edited directly and straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup has been designed to thwart or discourage subsequent modification by readers is not Transparent. A copy that is not "Transparent" is called "Opaque".

Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML designed for human modification. Opaque formats include PostScript, PDF, proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML produced by some word processors for output purposes only.

The "Title Page" means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, "Title Page" means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text.

2. VERBATIM COPYING

You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3.

You may also lend copies, under the same conditions stated above, and you may publicly display copies.

3. COPYING IN QUANTITY

If you publish printed copies of the Document numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects.

If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages.

If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a publicly-accessible computer-network location containing a complete Transparent copy of the Document, free of added material, which the general network-using public has access to download anonymously at no charge using public-standard network protocols. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public.

It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document.

4. MODIFICATIONS

You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version:

  • A. Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission.
  • B. List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has less than five).
  • C. State on the Title page the name of the publisher of the Modified Version, as the publisher.
  • D. Preserve all the copyright notices of the Document.
  • E. Add an appropriate copyright notice for your modifications adjacent to the other copyright notices.
  • F. Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below.
  • G. Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice.
  • H. Include an unaltered copy of this License.
  • I. Preserve the section entitled "History", and its title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section entitled "History" in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence.
  • J. Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the "History" section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission.
  • K. In any section entitled "Acknowledgements" or "Dedications", preserve the section's title, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein.
  • L. Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles.
  • M. Delete any section entitled "Endorsements". Such a section may not be included in the Modified Version.
  • N. Do not retitle any existing section as "Endorsements" or to conflict in title with any Invariant Section.

If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version's license notice. These titles must be distinct from any other section titles.

You may add a section entitled "Endorsements", provided it contains nothing but endorsements of your Modified Version by various parties--for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard.

You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one.

The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version.

5. COMBINING DOCUMENTS

You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice.

The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work.

In the combination, you must combine any sections entitled "History" in the various original documents, forming one section entitled "History"; likewise combine any sections entitled "Acknowledgements", and any sections entitled "Dedications". You must delete all sections entitled "Endorsements."

6. COLLECTIONS OF DOCUMENTS

You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects.

You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document.

7. AGGREGATION WITH INDEPENDENT WORKS

A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, does not as a whole count as a Modified Version of the Document, provided no compilation copyright is claimed for the compilation. Such a compilation is called an "aggregate", and this License does not apply to the other self-contained works thus compiled with the Document, on account of their being thus compiled, if they are not themselves derivative works of the Document.

If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one quarter of the entire aggregate, the Document's Cover Texts may be placed on covers that surround only the Document within the aggregate. Otherwise they must appear on covers around the whole aggregate.

8. TRANSLATION

Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License provided that you also include the original English version of this License. In case of a disagreement between the translation and the original English version of this License, the original English version will prevail.

9. TERMINATION

You may not copy, modify, sublicense, or distribute the Document except as expressly provided for under this License. Any other attempt to copy, modify, sublicense or distribute the Document 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.

10. FUTURE REVISIONS OF THIS LICENSE

The Free Software Foundation may publish new, revised versions of the GNU Free Documentation 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. See http://www.gnu.org/copyleft/.

Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License "or any later version" applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation.

How to use this License for your documents

To use this License in a document you have written, include a copy of the License in the document and put the following copyright and license notices just after the title page:

      Copyright (c)  YEAR  YOUR NAME.
      Permission is granted to copy, distribute and/or modify this document
      under the terms of the GNU Free Documentation License, Version 1.1
      or any later version published by the Free Software Foundation;
      with the Invariant Sections being LIST THEIR TITLES, with the
      Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
      A copy of the license is included in the section entitled "GNU
      Free Documentation License".

If you have no Invariant Sections, write "with no Invariant Sections" instead of saying which ones are invariant. If you have no Front-Cover Texts, write "no Front-Cover Texts" instead of "Front-Cover Texts being LIST"; likewise for Back-Cover Texts.

If your document contains nontrivial examples of program code, we recommend releasing these examples in parallel under your choice of free software license, such as the GNU General Public License, to permit their use in free software.

Thanks to the designers
of www.xemacs.org for
their inspirational look
and feel.
This page is part of the A+ website <http://www.aplusdev.org/>
Maintained by webmaster@aplusdev.org
Hosted by Morgan Stanley Logo
This page last modified Fri Apr 4 10:41:29 EST 2003
© 1992-2008 Morgan Stanley Dean Witter & Co.  All rights reserved.
aplus-fsf-4.22/src/html/getacro.gif0000444000265000001440000000323407215453035012670 GIF89aX˦ѪVh~f4j~/u@6PJ/ihšPF'!赅s;e|{ZcdW2l 8\ahf]`fAQdt\b|f/Kwt_ɩȻfyˊm8”᥻L!,XpH$:ql:(Xجv`Cs!aVA|AO BN#+hlmorsuvzw!{}|$$#c#6gopy! 2c .#ijt&ǣ Ї.7O 2i1cM QwHPP@ʵ juIN+q℈-I@ 2 ʀ'%0h -ӷ&aTX`D l0k >ȊVk$S6㈋& T %H]עHwNhD` 0Bh$I4!uQF@|@5W[wB [¸yY1|"+ i*i4 EHU/K'*,O9SO q73! +?wu4 `VpR3=CWzb5WQv-I#E7x8IhA `( DRw^@duS ]LqvZoay98 pDD`İ`~ *4߀S|h p[ڃB Džm@qʨ&_C 34%!h (p@`+H@46|HK`>۸IPc*@t`$ :@P&֨v.|0'-1 eD(:N+QN߂x(83 94{8m*LUNH@ H)vD!PN XE h}TzuC {PMFK ā1ˢsJl[܂e,ý.qdb!x`%2 '85@rԉv$iz̧>1;aplus-fsf-4.22/src/html/gpl.html0000444000265000001440000006653010737165452012243 A+: GNU General Public License
A+: a programming language for programmers
Reference Manual

Terms Of Use

About A+
History of A+
Who Wrote A+?
Screenshots
Programs Written in A+

Getting A+
Download
Other Software
Installation
Documentation

A+ Community
FAQ
Mail Contacts
Other Resources
The Reviews

A+ Web Site

GNU General Public License

Table of Contents


GNU GENERAL PUBLIC LICENSE

Version 2, June 1991

Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place - Suite 330, Boston, MA  02111-1307, 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 Library 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.

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.

one line to give the program's name and an idea of what it does.
Copyright (C) yyyy  name of author

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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, 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.

signature of Ty Coon, 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 Library General Public License instead of this License.

Thanks to the designers
of www.xemacs.org for
their inspirational look
and feel.
This page is part of the A+ website <http://www.aplusdev.org/>
Maintained by webmaster@aplusdev.org
Hosted by Morgan Stanley Logo
This page last modified Fri Apr 4 14:10:59 EST 2003
© 1992-2008 Morgan Stanley Dean Witter & Co.  All rights reserved.
aplus-fsf-4.22/src/html/hgauge.gif0000444000265000001440000002624007215453035012506 GIF87agpjjj,g0I8ͻ`(dihlp,tmx|pH,Ȥrl:ШtJZjr0WLtVm/|ΦE |~VzzxpwkjeokƐā}̙ԀҍW H%BJH"ň ~Sc C9#l*yq;21g:+˒LB_\ۈwlm\Mq;)_"u q-6^;/P]0kݟ=Dss-3ߍ^;1"uޘሳ,F/ -=x{# 9WUUSZiu:UU:QQUZǕ;]{Z_br#?3 \`gw/oփA}/jЯo~ {BoG#:{H "07 z GHa0C});XL'TBЀoz wCN= [B-E$D0%i-Op[*#6"ǸB1dLc5O~h6q.L1|G|TQ% H=c$Fv1)"vR$IP"HCnҖ4% uiH].mhFq*w9^:s3`ꏍ1A)i5KXҏM`-NHdg;.2KE@/99k_?iHM1(D˄fe U("b+DM3M(I|e)E[iIrRҢ!E :΍2+Quef)iE*ԓMf@Ԁv-"(dUҧ0}SBUh:5ĥ4:eR]>xФV,6C[Jx;ư0ͳXFd uJ&_Wߧar8XU(,> s\ ls.;&ybƳdEyj򞭇ef;Ĉ.Έ ϯMeq\H#s5W{Ϯ>M]jЪtF3pi:o#Ǽ&3k-`|^IBX3;δFi"4~vtMm @-bgI-n%;~xW0G6,Y kWp5r\á+DlO>8H|Jne+xУ\eppgo6+āmV"˥q<<0=!߂1sm}ᗩUcwB>;j{ՃX"W]#,wq?}Xhm0n:q]CcǻJR89l#T%yȳDx+)]Ɇ]ݳ}(Ot_>\c/ٓGN⶚~OߤI%}MǞ RSu7@&y뾸/ݛ~A_xazݝIm~63j'LGhizz=Gw}ؗ}Gx}n}~VzX~whwnՀL%>8nwGY{Y7rgay~ד6bY/NFd("_qn6J!Weu+J8[PxR(lwRl}nmHGXe*؄nAi(g#{dXc䂆EbsS>h=|~(oa9?(4d>np]H`hYIhsї=pFF$H>8SJh'zO =X[*Z@،0W_px7Xxh#X>x䓊Ў[i%u&xVgpvUGw=88E ِ AH C% t~{T^3YRd#(>Q僑0Nuh>f!XvSa3e9Lt? 1I6R:u(A tJ=Y)[ɕa>P@c9ZSWcYlǏr"i@{؁GT vgmv=VXnz8Ki 3:CV;W>u =Ĕ=7Y|sْmAXyIMO4kkIMLX)B٘ #IF*,)YsSǛ52=wuq^Iei=7i@)E eٔ)x( ?r ٟfD ^@ xBZFzHJ*+ Z<G셗%JFSjpjHJKb:dZ2z5PtR٩czՆ7pQ`9 [4?FlnzcV c@uԥ}٧ Bsf &mZupgXcZڤIiRO?y[JlF$ ?ZR:?:D*:h>j Tګ*ʬ~Z*◢uvz{gJ3i:EԪd zQ[dvc䣳YK7J|ZC*ʯz<$J|JF+}yC@jTo;?X{>E(D +!k:ՙw&+SAԲLԱ;]8TIE%[>+;EPZnXK[W>q ǃ=8PKz׳r۩^vZa zF4aEuMkeeUWo?טfG4fsF_c$J}˘=4붋_s%ȸz`8N3#l*Z7C\K{ߴwwhNc+'Q;>CkCB[YV#՚ 7HiIs嗭ۣ[kʚuYiAgK>S WktͻSiK=+4 Aily%9@V<ė{mkkKS;)ng{yzAۀG׋O#=l7fJ*{5p.|؊޳7G7q 'eN^KĖe{`>,O ʼnm(ٶ?up[|(燅dR}j\ʜHǃHAc,elأ666VLjDŽkʲ\vlzɂ,=\*;yb8 xʗdEʰm}ŸW(@|#%D'5w2KZ7ˍZ%%G+ |Ƹ=Ψ#EӬ]8Ӫ ]F_E,C;#k-/o}q=smmMwU\}eGЉ3 [emy=Xa:uy0YV6A~>JHŅd͊/ux7F.J+LLBb=ԥLMarPڮX?? FLˀg=]W75ܤyۈJ(]{(ޤXpMݻ TDmiMDW]"V-޶CltuAcJլRgyحݼzvkH-VSQ. ߖ)L۽6gV yHIk*^ Dr^xÊ#^amͶG[2 Am(.A]kja~iwXNBz@R+iU`mN_t`ʤ9sw}>V >I>.ݍYaYlju>T.,TBΜ+Dz-ܒ~N.oNDEYSA^z.c~90]5AM5@w͢.y>xn㎥L %e nAUdNޮ7:[7p2C/6j+t9O#~-B2ϲF_Îz>SOLoW/6ou d_1PT{ڋ.k]vgzY`s?-E{̏8SPp!+HlO@!GU|O^ ??)tKk??(h/Nw9TsI,aes/?PEL8ͅ? rl)3'XpH,CH@rl">NW62g{'~ i刻ξ{B7 7y[^?øb;e ǏPArɑJ4rK'_d9& 6aDJh QSQW8qD/]7 r,j&.!J3W+e5Yh%UVmq(]{EZ+\;Uǐ#K~m[-(9Ad0,5Ty.N|r۸sag %b =4+TMciwe~Z|Gp wں:/4M:wrZ6[gDpz &t5 /@uE "wESwH(B` 2mp_Era<^Ԉw/ a,H Ga2ƌlhbv"ҏCfBaVD}4 *0dPyk[#(`$"95j:)15܈7ZU|8(Jdg^&g樛-) b*yK2zjdK,X`ܠl*:ô,@k`z*r(֤f6)kW`&k4JT>go]̶$]+3% 掇nh/Hlı@nls#%G2j2|d˲ P31WPoױs?[UKۼQ}ۮC,@7)^gv(Mb;ԷO8M>#^?VM p }70X2R.:*s_LNWeMu32x-utḾ{OJ40h <OG <2JvˮS]_{~<}m/2C_=ׂů( t=m{_0os擠`lP_%xo0! GANCAEy{aN C؈i!{ ` LR eհv( ul_F<)P%J'6,wM#yA@-ȁ H2bD==Vk"%H\C ;a @nt&AǪG/z4PFF6x$)Sr\^te2D^@hA;`xMrSe7/s,g@i<13#! 2jjӚmU2Qszm `2HIIS33L;s.ym<5J$0xD}"c[pЇ4)M͌囿uq*3?WzC50)uR?)T,T? v^SPm3$g5է5πbqb){L".p+]wVľx礬fU]C_j`M}+8*Z4V$-Lw=eih UnFpۆ6vi!v XZkds*۬hͩuכƜ).uwe hnjKSuw(mG M7ENx;Qҩf}!뾓mfq;Eox9V %n$5Ix4Ik 1L2nsZR㶪g6c mD'LspfpZҜT-0$Aӱ洧+h7.nlQ-c1"]bc^"k]GCxV,%K/eArI,YEw6Rcf/zy}U`O7-:nK5jљM^&*A6[)K[wo;.Oc<5xrIY\x=P!9Gega2bxw8>{'L}ُGI6Y-y 9 Ɨgry)ʙvgkIoI&ZV՛Iy|?q4hhiف= 陘Vvy깞+9sInd$\%6yv&"(g2uD/SVGgrj" :|řHg]{T>J a`Hzz`'sS:f~b1w)^ZC#d^XY.dOEV=t r*@N'D$oWwRiZDjuj z+@*nV!p,ɆȍIɗɏI|ybPx+%lʖoʇ |ɹăr*ûǵ5ԉL?`ɻʧ#@ͣ(̴|YЌpݜ{<<\θLJ^ls\|NL)l2I= \\ćy!Π] 8+Ȉ )ūp!=Ҹ k4=8L"G&]2] J}mվ<9-ikQ S\d׼Gf-ȫ 4i]kl/3}w}<2y ͍5}uָBPj}TM]Ɇ)և։o{׮ ģM!F=ӛ*aM֩}kٙlV-ՃlX HMt}VԸڭܱ(? Xpڟ=Ҍ=ޔJ ]HL m]Ǔժ܋=ۼL֚ܽ=Mmנ mй Xm ^ "]Ⲩ6m/}$^źEn>0Bں=g8nTMRmM`]`iC'o.m R綼ߣ .>߁NY 1gF~nO l` x+ޟKLꎎliWxZNŒ.ɜ׵Hި.}~쑮EmN_nꤼ;a^m h nW.jgNGۻ%~x~ N~FY^f~v=8-KE Tj~ 4ҝ݄>/Z ڧ+?cIKV5N-_T?2//4U^4,?->G?_).?:B9mJo׎N檿;Cf>g.]OcdMoo'> _oם$?ڿ~??#O`.oNN??/pnI8ͻ`(dihlp,tmx|pH,Ȥrl:ШtJZجvzw ;aplus-fsf-4.22/src/html/hgrid.gif0000444000265000001440000005540007215453035012343 GIF87a*nnn~~~p,*p)I̷'h試"Pvz p(,$rl2(t*R,vr^E4znfm>Huc stǩ5r֝Ϟs9Ǯ3 ( "\!}J/jqǎ ? Irɒ(OLr˖0_ʌIs͚8os1Q1ȍQ8H*MtS'v+DPիVbݪ+ׯ^m&Ҫ]˶(Nh1h*U;[w˷߿ EqLl]̸cK/EOok̹Ϡѵ{ަS^} %וN:Wиs{ナ4jxƓc*N鰈Fe-'˅NMߎwaƃpG3M}#g׭}oU\=7\z[AwqHuuVh!*^r=\ >%ډ]=Q uhcwNu㎿ \Q˥؏ dc̭"eQI](eoB9啂}X{xbs<(9 ^]囝eh%t :'nM6KV!7bhRu6Ws:*)9ZEk))m \]HFMj:1z &cr +Ⰶߋ CC ЇD4{?10{PZW)"OKEAuHƟa<gO~$0{NSMBІ:D'JQ~?yJ(ZAyI;tJ)0LgJӚ5@4 @F! ZPԦ:PTJժZ?7)ӨE}1 :Ь<$̓UJŪ\J׺xͫ^Z՞+eJN5ܛ_eX? JRlZ֡n֍|JEĚn=iO+ҳkeMj!J-f}[mՊ4F?Jv'KmKݺ.:[nYiDMNnb!ALVkmPvu+9WxiD5XCŝ}[E$aKX$޵íǶf07]W(U@3.{-` 0Xm.1$Ll9n`uLd8g[ʡj]qK5*7&1iʢd1ˎqtZYkC{dk^U<8x;b[LBw!7^ƋgOڄ-/N I޴>zԨN5*%Et_MZ v^MbNf;ټ. j#̳n{[mnNvMzwktE5 <Ҏ2 D_G7z{3N:xPi7ўws vl.w/v׾v eݖ;B!묓^O} ]Yw@^w~ur;^(:_K}M|[~9/ჟ|:׏}?w}kotpQ'n5Fn~ HuΗ[6|y7}'{uVC6"r]V{ ~ꗀ0'865mׁ4g}1'r X:48lWZ淁~=Thp8ayQȁSx8S,؂2HF~9vRz ~&rl6b3׆zg؇`(bsfHG?I8lWc>:_x{qzk]؀8(lueXh}?h}a艕Xhx?^_8؊lQiJ϶(T8\يG rgH7`IlSYÖHs|ٗ~9Yy٘q )JgW9nyb&YdUr9sdO皙IUșv(e`wqșʹk ҩlɓVxٝY9o׍ \'7kؙH))@ 9 sr uUh8ZƟ;wtdX'%(lzr#jrIȞp LZi5 1gh{ ڡUX%ẅ+JK- 7ڟiYz=O'wz(qHNxNؤjI7W9jc,}8)֧y W琁~{ z 8i&}~7'UJfSȆGxH'` y*}18i񈣭wjXK|`u :8ʄ xhlhڪئ:jL2Ǫ7ixJZEhڭyFj#xm ܺh (MjXZ hڇَ:-ħ l xZJZ;(jt8,L۴ZZk[ :<>{^'@ojGKΪlʯ' vYz::fзaK@c;sgWzʟ{ɭz:Vw{*yʰp[sjj:n,t /W皇̆KˁyZ[ʆ(>ˡ꺦'i+II5Ûz wtv k}cXϛJ+kD{Vm:wsۓ{;ݷzH {K\rK GyKz;̿,8wdJX?+\϶ Jt4HEh˶',|>\x+X,t7\[$˫m< N_j{Mvm~ɆN؈݊/ imK뒠p_~l8N 㰎Ȳ^~NΛ.n>|>NĆKT[tmngDF^-ƌx/\P_??ꇯwpJ{cOnլO}-_p4؃z}ֳ? VӓNa/yڅ ߩb/mׯku~ǜO;[^0G4O; Y`o?SRe$XР4j՛j[[lTS$3B} ^I\(*81AYM<Mu>ѣ+ÇB)In7 f r%[,Q%yim%uҧbFv~ on]Q.xcȑ1Gx03[7&۲]Em+J u]ӣfͭ\),0 oR|:rVcm@Wd3{'_~'9c7mo/6b<TP+?k/9T6.B^0**;ζ*\pEWD9`3\(FESQaQ7ZTrIxC)EP#U-?첞kiI1I&T2'{2B)YGѪ-tS((Ȱ4P gQFuQH#mI+RLQNOJ17,@D3eBQXcȌjV\sյVvW`SN=ET4SfuVgRJZHې[pQZr5\kGS2̒`w^z^|o7_~Sp>$W5Vwavzu YҸuTRc0GtAm36dEwe[v"9 /8ƛq잏bu@JFyh)PeVRǏ7teTzXTn[I~.hÖ@խ b^im^ۉcw9,њ"Y` 'O=;m-m#O(p( b);-f^o?Uc5|u.rqk|p: ==Ӳ+7d}p]OJeGv۫R~n$'@qcX~^1zo%wh],٭AyRvw]#}K ѷenw]W%oy{d| -&K F6׸֪rf p |`' Vp`Gp)|a gp9a}8m)VQi,rTd"k|c;qycCr*6m}Zn.FSr|e,gY[re0Yc&s|f4Y(tJ9Nwfu7yjbG[ӦveYNaFSBv}nt6#; '97Yˮ}o|[Uv o[$~2?}p'\fxo;ގ.0~qg\㱖5·csM~r 'um~s9{NG9'zэoN,AP|EOU@[dTBMĸE`D@QE;Ecl\B\^t`|SAFjt>3h˶jFo4mk3SIIIIII JJɚ6tI,;$|JJJʠtJťJ3b K,˱4K7X6+aM^Zbb)f6cazٛ`Sc0Χ#f_cp4` cCf667bW)4b~9=c#?b#I6dDNdAPa nW Fe2:Od%_:VBw&ՁT#Gf;.Jec!X_~Q!9._ckfcdh [seS_fR֧/dgb<g`v iV2n'/V`Uqm^`y(;e+^eY~△>w`vhV;eWVogQ;J6(h^hhf8-A~h!B;j?^6P fqjv.buayތ*a'f>b6jàr(FǓNjv)&nJ\huʶoIVs|nil68mԎ׆6E&O.۾mDm$^^.D؎6nCiFnim|˶nVn.=^og\v4&o6l,ok>6ndNo>mprY|`ijN^mko#:AVNG G$; Y-~öBILqlp]qnKHc*fk%o8pV& i&-MbWf]~r&'q 28Lƫr)^'ߍ1=g..5>?guNp8OXQ "6/'ssi508qLW@^;_AtQgtektPWMnDtHc 9͛kކSg.eksg%b~tzvCn0uZ%k uXt"h V3OVG6nwiWi\wwh'BosjFtn`9:Æop;p@~iwwkÞvzf/FbGU*6>xgF_xXDg.lw^ixf{Gq^w^wlx6yaFSy]Fɑej7y'zPWmW?yt2Զty YM^6~ex#uF4?WOcGq*xqNyWv|ͿL|@x{l~?jog|Cxч+:LJkutzu@vjMg7o}pR=}_ObkWktft[GUwRW~l:DŽ/y'^g!1 gN )z?#]% q;+;?0(#2\2grHl,+45Y/X3Odh*,y+9>5ی L !b"cc]Wef'XBY  KeEklK!/p0,rfr2hƳn.+Uewr7uAq:{rM.[6ȫ[dEj!Dz"ΙH1=hUss"Ȑ"Qt l%0GȜ"OXʀ͠B%ʕ@v1\КNgͥ+֎bKGQC.Ɉk.޼zWo.7T`4 (Ȓ4>R rn9۶ ?s[ԪWn5حOˮm6nX7!dYL yS{3]82 ǓPYRhSw%Y/ ;،|oE\}pǡz p;7Wkɠ%8{-o'd6"#.rX&AO =c.pn#9;ҝۓ>MDn+?zAt,09fS}l:ֳd6%d.vffOM/Ϋ:܃1ӽv_M[#+6{,/pvoWy Na>g  @C H?'wjrck?]Ņݽ/|F2n5W'[%g+=>o?5Z58dGϘV0vkOd鳿Կ~-_bh7ݪ#CM^ SiDbY[>ٗ^Y!GWF Rx}eĞ@i~ǝ` F[j`q%_^مNDi ΍UԤYYM! n!1!`2iO a`埞_.a ҙa\9*߽Tzb*)6)-$%^zaY' =#4j"d(U5"]"3JE8#n$!6b n7&^9EX1Zbc;j"N]<"%TFTN%UVU^eT#+dѤ;*#%YY%ZZ%[[%\\%]Υ]%^ޥ^%__%``&aa&Z6=&!c$ԀdN&ee^&fffn&gvg~&hh&ii&jj&kk & #c֦cX:hko&pp'qq're&a"@='tt>B!Lvv"w~gwx'yy'zz'{{'||'}Χ}'~ާ~''w:UFG坁>#>_>BF(NV(^f(nv(6V6Lj?BfB((ƨ(֨(樎((Mh& .)6>)FN)V)N>6m6Z)))(̭㉭ȥ$)֩)橞)_ju۞*&N{ 6VM2I-^*fnW(!r**i#Bd'4h*檮*j6X1 ꤂\+&".;**&&^+fN:+"#~鶖+hkzkvj+kv+c+++&뺎j>%6>,D*Yio@,vi7բYqE~,˶rĎZ !,W+[-Һ(-О׿&Nm,Ik\R~. .+ئګiWh(X-mXut-7aF.^%hG-(⾓ Nn^.Bg׽R~..&hʂ.N f.nM#wj ..ڭX\걀.&/Zn$]_>k_R.jroB/ƤNo/N`$*o2oTB)]o/V"6/j/0,?0(2p%0bN`j0(.>.apsup]o0 Y"p C`! k p p(E c-p?"/6$?1( +'qA"B(1/*U0V1J1bO/bzqp1 9:1X '"b!?2@C% Mr%w2&BK(2))kdnz*.`+2,Dz,Q*2b&//2003pp".h.gr63?sp2g2Wі&oB6o37f63Z8lv(::3;98ζ3==3>sx3??3@@4AA4B'B/4C7C?4DGDO4EWE_4FgFo4G041H4I4HTII4KK4LL4MI4NtNN254PtPP5QQ'\z`nv3TGTg71&8OVo5WwW5Xc4{fs.sX5ZXwO+shuZǵ\5]׵VW4S^>>_u|r55avaa'6b/b7y|*r*5e#eW6`:2p\6gcvgg6hvR #^ki۵jfU;LVl6m׶memYd oq7rokU'os˦ BsGu5V_vGunv/SOw&pqyzfvzo.7x6|s&3{˷Vw}p.'~fwf}}wԹ+8k&G897[BK}g7waYjhNK8wg>v5[wy/f븏S&Swk yx8e58exwvry3>xxZy3x8Yxw#yXVxy{CݹoϹCE>G8Ϸ:7OgBvO:gwzjcfkv':l/:6_w5:\c:cߺC::;{G-'/;7PC[O;W_;goTp;L ;;3XND@&Ck=9{E;"`@;7,;&1 O>LĠՠH8*<+#|#ꧾ|ܸNHP~{Oh8ߌb˽tNf9N@ HlPy^k)2@MՕm ᙮mU7 1I(L$n]e ~h;i>؞EOPB1Jo0QERP(ϩ&TT$s4ga u'2I7P8XxXk5(j6/wvqOqT:qr[wE%ɛ:|\}[=u~_UeFɈ ^6t5X^MNdšg ΞgƭQ#;\i 1EHCE C3uzH*VzUQ!Y0pSo!&G)̥<0bٛ@љK]6,a^( WiY9,zsp" ͆ (ݖ[8Mr\qx>|h+F"²fө1+哚 6w;tξdNꚂۍ0q{ygK*[A12#BP{ ˧um) ŰDCc?~FJNZ ,<IvDƇ?0"6' i="r5.7M'[O%ܒ6Mh%3+PL<8D=)MNS9PRQڱɤ1PD}2t#V2LMp^I`e"LaqyXuX}:0TA`k1Xap @;Z\]hg}[V[/ǽJ{ݗc,sGIu=UGHy~=-U-\'!wt`\U^eexmyfAyQiYYq[>餕&.cU7.juEieޚ橫l5:ذgԵNi[ޛk%P& ?_%O@r=m=Om?&U_]ve噯}s-06=z. ~? H~yklS a_ظg X!_jRfK}{ #;Qql^9A S2J(!}TH4? AC yC4N*!{`t*T3(:@$5B}IqP*!A#'3^R5@ {F0QbD@K&<-bPzMC(C D-<|FK^ tM2юIPX-":9 H]G0QHr#R&amb8Ȋ1yJ]7I>Dk*Zr`q!TD;aRYNŌ&(gLB)% eLiҁg:iHmKENI"kʳڠ9?tPT#L徐APhBF,i4Q} ']H6{('=%тc"ES<(WT3E7!˨R2?[cLj̦2URfTcVDHTR޴>H- ݤ/8T=nUjKh޳ TFhNrTAbY×fW~bř$y"KJx[8)惩 )ڤn2blBp.<wbbEv:+7SNuYq{1b.FLUakc( p)![B[`geCDr)EZy5kݢߴY1Xu=RKQT\ 8I)^9aɘ4F˹ɚ0v}d1~mj4ɺKZJJ:̘A\f3#ygV!wx˲хWA] ρ4Le?a3߶ex4ϑ~+2-ۢ優Β@)yMk^u$ Q><,ӫ]s_X=s]jI$n崛ݮhZ?iFuv29uAq^Js4twնr_~ۦui.ȷ8kUv;G݄Ky;vȱcRY5 %mW N<ߕ9Ϥcyg6w{usC3ߏYj|iKyj~G}:}W} /1Ҵ.Ry=v~Eġ{zN\}졯hp9Ғ^:{nv$~ǺJwk_5mwg=BI6 *k;eLۑW1(^e>x݊|8{tw-@gGF5?~ګo~lzN. olR$-nz+0f,pBf #m_`P_D0nAVPlЂ0vMuBЫZN4f  i's/|"o`P ǐ 'AA9>A%0-S@3>1 /<3Z0 _ aTFu?t!t=30ItdBMBE H'HTvj@pFpLJDGs,WoHapL4L%h 3RIxTI߳BNtAo14vMO4 /RB;ԢNKmALUQ_*(u4yt0Q4H PKS;  2 @k&o.!3(Ogu VoW aQsT)]US1GViO5WWix5E݀2(8QuXU!YuN5`5,*n[U]%PZkZ12G#=#i;U>՜ȵkh&]U`ϱ]^20%Q([!U_/ bA5:u`;4_OWr^O,2C+KWl2ce`::M e6e#VE[e{gJ Vw|vf4i[`d[a'QvPCNv\_5v8vi6>w_i_}_{__G___߫_?__џ_}?ڋ޼H扦Z.`L ĢH\JԪjɌ!N};o(8HWxi& *:JZj'ùZtxJ[k{KB9` k|ܘ* 4l}-B .~ =/?~fώ ?0 0bM<0f:l5͉‰+ZOÍ :լ[~ ;ٴI#;7-{ <]?-;rC9<:ҫSn=;ڻs=<˓>tzx1y?ۿ?`7 `^Ā>aNH (nht!b&*.2H6ֈ$ >9)dDidH.dD eRNIeV^eZ;aplus-fsf-4.22/src/html/hmenu.gif0000444000265000001440000000443607215453035012365 GIF89affff!,H̷'7ej˾nJ`xzpH,$/X֒OtJZvy8L:^O8]yEH :ѳ͡]W9D8`>沙՛p|ɼ% IhMFSXbČ<‰CBB8P ʥM\V`p7jDFr ]JEΤI%Ք\vk^Â+,ٳ[˶۷pʝKݻx}޿ Lpxǐ#KL˘3k̹3~Z카ӨS^t= &ͺ۪A{6 nٵ7ŌmQ&3ANu{2<^׭<܈NN< \uyY{WYioI`fzhZzq']]dZdQوUarHϩ(5&8!\x9Wc8xDBơ% |8F"d%$OG"&~yԉn5c_%uY'7 ydd~އ_i޸ߢMؔN;^zߦwjZ6iIe ߜP>P&)ީY*d(c&۫V,Rz+bKvG=`l}";툳fz+jr1+Xn/ю%Kp*h駈g.X/{6yp; , /"2Is-]J)& NLHa''-NG}tЫ6-/_5q{Yo-mT3\ؘp]W/hp-tmq7..gx.vmjm\oue3x`Ƿ-ًye.褗n:砛~k09:2˰8.WBS-|ūRU?fhUoWφKك/~q9HΌ2ߕa{)Z?^R{; G3@:Ѐ,^Q*TIsU *W;U,b%y.-JAjZrC <}\ ΘV(jCqahm"d#Rf7YtNbHņ%4ڋ{iZ}d:(3{ coRfv5f}q%{+PM #qVM_JA8]bSPŴ۟A`nUP"v]gֹѶek& ٗsҋLǰeeb3ZCPPUYQ՟&ؚ.VVκoַ /4; g؜+<9,M hݘ^Җ$ޱpy^u X8M1fb^]ّqUfrt1e}yk] ZԼ;Oπ<Є}h2u' ΢Ж3vӞ,+QԦ]J'Xm**| eegܔOf)M=(;aplus-fsf-4.22/src/html/hpane.gif0000444000265000001440000001726607215453035012351 GIF87a pjjj, 0I8ͻ`(dihlp,to#T6;ttN8,*.S.lC?YUBxT^ds|Y{z}p}n:Eү %I 9ȰPCDYH>e Ǐ CSI-^5Sˑ0cʜIfp挤P'm ΡHʹiʞ 45UT :]^z쯪b 5OPMv-1. ݙ ܿvH-^,iˊ]w/K1ۍ̸s{5,d~SKCSZoþ1IZ䋻͈mţ=)8҃}Gߞ\[?-w䝻09G1W/?mLZ~]^n`RU7^q`h c j aO]^YAEyudZ'8fd8Wlw-j(Wmu%{7n,>0DO}l EB/r.-+̨P6m.YWj߽b5e7w1C>?砃r`;~wƞm6;.no;}L$ʏxtM/^2w/o觯샏tNmGn* ૐW<o~Ctv?nRߵpF ~%H kbKV7ouk 3%mc+̠ g)(`w]mPK{H"QT6$1#:P!' EXb3D41` H FbL3akFB ṣE{ G(yL"UG?r#1Wh2#"H3zp &yJvLeP)N쎪Z dL ]5XEm`] XHR\,{79by1gF3&n\n1be9?3L'Ӗ%O|]o|Mya a@-1^fFL2̧Pڋq @1t-%(ЂI(Il=O7Цaixs( Gںt(=SzTyQ%gZC:/pjM.5oO|*ՔԢ.M=O ӭ2'XY=k0.mf;Q7ՠiU'JJξ-l KUFLe+GwC\^5aפvmlgڴ33Ŭ0:VM5na$6E;n}hN6p^Zcٺ6T+2wL y]q]JVڮ60?rЊ3y{;X5vÍ?`RN،bzژt$]V"B7;zתj(\j.֮{Lcv6O=TzSv䀍*0s \6hSwrk6\. $s;܋6f[X8u5-cw֫ilٲ%]S5J [28lٍ^8WKɑ Ƕz 3pV:lwF[F]C?6+|~[#]s;:em=_jhYk"}^&o[7u{RO5~gԭT5gK<)iy=9ٶ]Us; f-_vk/(xU䟿DT?}ۿ^[ k3'N)'Ƨ}Oڱ 糕~|T^?_E-Yt?|rf tXH:e\fGwuXz('cw xyWpW~3Xx_,trcy ~ Q6m3M_wQqSgI(ylCcHgD8b*eF9;ץnUDBC;86+ȓ Z\xfLdgB0W9^uOX4#x*HFoTg62} hwt2Ȋ؊ULrKXZtZCāԂbxXJ"Ȍ85.k،(LFfK&+63yݘ,`hxVVt"^ĎkCX⨏wXH·TZ9w Y]h.*Ʌ,.i4ŏhCahc_ڂr>=YA hڸIlHWyh㗁DGsoTߗLw\i/ҏSu5^:ٕ5d iKy)~I2:bsssdvp;Y}wmH)9L :]iDYywKTrm-Ii" 1 ޕeR皮ɜGIyctț!H\IsgyI )v)xFT͙iypNɑ=3 60EX x,,ٞbQm@]{Uqɓ蟆(iԡًh) I:3Z8::ZL 2P@c:JXy];NPZfyTVz5*Zz]q֧6 rQY=tY4JaoZYm:Zi^ʞ)] )yf}Zo曦hڪ냨JuJfiS zFq:q*"8Cz x76_YxH©ȭzJ㺩窃ڌ *V^V(-dRxšں:c*zhBwyڰ +j>*٘WJ6:尺rkWʲ9x/ VO::eW)ZD:?K);K)}q>ԴZW++KK{lytZiZRqi[ٶUpԷ7).K0k&+;:ʲ> @[;gag7fkx{V{5NYG^75e+˹3x kvg+cG;{J: ~J{+U {:/˜޻OK)Rzw4 X([园٣^J;7Pz ˮtZ*{{;i뵧h)߫;.K%l`'L5[*g;\ 3\,hT++!us5\xX^SLWY܈|znl>r=:v=<붝K/Jܸ&\C|78%zĞ8£;l>Ekd(|=ƥ)v=% in5؝i ѫv *cףՋu}d|"َ LF)U7y=ZKJ K M|)Dۗل#˘(ʰϮ 1|84\њ ]}MFܪڈ aL;Dز\D F|s{\2̬L֯Q-ـL' 5V{:+j *Xy|ݽn<^&`.={[=-PϪk9wNosR]!;գu>od^A\v\٘B~ޓFѣ|&MSeLaL2}[zn m ]i $xswn{y RP5R}ߨI'wj}T^=m=ζύ mC^^̾֞zK=M։R\봛nxg.>f{+G^tR/ۺN>+qY?A~oSb~ 񔮫,΃wΨ\*YEƾ>&ݔ60+߽3?V~^|۱F}%V`).4#VmIoxozM^ݻ8 >+|O|^s>}Ψ,P;`R*;;f١' eFTfzEv+G覫FI&(9H`l@ sgKBLęY w ,$ ` {TO"K8<\,5#k\>m3,>7P,',S/FaH0%7%dmh6 xf=o`|߀]%Yd,Tk^w~:7{ngNw;Bxm39Ek받{: .>ַ 6[N]ŭ3J6Pg=`&'n7.{?-۷>~E/GgGʎ0bljO? R3 ) 5:Bo m0t>x#@u{ Oh2M$zZ QH#z>KVF*Z;AӗndH2qdN<&&:P縋,uU:|#$H>S"G'$#jL"F:R\#xdEz挘̤&7N+ r$)W=l%,Y)ZrZ.q^җ.YKaҘD&-yKe`t)JfRqz n 8IrL:v2ȹ]w[ݴn׻r+첷-{K_#e,~%֨Wn~;`T.^Y(0{[ W7 x^ oxDžqG_ w%0xM +oeLb=֋b'~]b!*2knŻ1d'Qvpp F d-?O1|< XVƲ[\#i~3' K.sp0'' K.sp '
 
' K.sp0'
 
' K.spX'' FixBlank {v}:{ if (^/v=' ') v' ' else vv } VV {v}:{ Turns the argument (v) into a Vector of Vectors v1ա(v=1v)v } Kn{v}:{ K.lng+/v=1v; (K.Color;K.Symbol;K.Type;K.SName;K.MName;K.DName;K.Loc)DMBFixBlank7vVV v,10(1v),' '; K.lng+/^\~(<' ')v(K.Color;K.Symbol;K.Type;K.SName;K.MName;K.DName); Indent '   '; IndentX'••'; MDescIndent,case (1K.Type) { 'f';'MONADIC FUNCTION:'; 'o';'MONADIC OPERATOR:'; 'a';'MONADIC FUNCTION OR OPERATOR:'; ambiguous symbol 'n';'OPERATION:'; 'p';'PURPOSE:'; 'u';'PURPOSE:'; 'E';'PURPOSE'; 'x';''; '&';'====TABLE ERROR====' }; DDescIndent,case (1K.Type) { 'f';'DYADIC FUNCTION:'; 'o';'DYADIC OPERATOR:'; 'a';'DYADIC FUNCTION OR OPERATOR:'; ambiguous symbol 'n';'OPERATION:'; 'p';'PURPOSE:'; 'u';'PURPOSE:'; 'E';'PURPOSE'; 'x';''; '&';'====TABLE ERROR====' }; if ('E'=1K.Type) { p((K.Type='/')/K.Type),K.Type; MDescIndentX,1K.Type[p[0]+p[1]-p[0]]; DDescIndentX,1K.Type[p[1]+p[2]-p[1]] }; AN (1K.Symbol'ABCDEFGHIJKLMNOPQRSTUVWXYZ')/'ALPHABETIC
CAPITAL

'; ANAN,(1K.Symbol'abcdefghijklmnopqrstuvwxyz')/'ALPHABETIC
LOWERCASE

'; ANAN,(1K.Symbol'0123456789')/'NUMERIC

'; Z''; K.SK.Symbol; if (K.S'<') K.S'<'; if (K.S'>') K.S'>'; if (K.S'\\') K.S'\'; if (K.S'\''') K.S''''; if (K.S'"') K.S'"'; posD,`intK.S; Decimal posH,'0123456789ABCDEF'[0 16posD]; Hex posO,'0123456789'[0 8 8posD]; Octal posTK.smallfont,'>[ Dec = ',(posD),',  Hex = ',posH,',  Octal = ',posO,' ]'; Text if (1'; ZZ,K.Symbol,'

'; ZZ,(2',K.smallfont,'>',Indent,'SYMBOL NAME:
',K.SName; ZZ,(2=K.lng)/'
',K.smallfont,'>
',AN,'STANDARD USAGE
 '; ZZ,((2',K.smallfont,'>',MDesc,'
',K.MName,''; ZZ,(~(K.DName' ')0=K.DName)/K.sp,'
',K.smallfont,'>',DDesc,'
',K.DName,''; if (K.Loc'std') K.Loc'Standard U. S. keyboard layout'; if (K.Loc'arb') K.Loc'Arbitrary placement'; if (K.Loc'reltr') K.Loc'Relational symbols are grouped together
in a partially-symmetrical series along
the top row of the keyboard:
< = > ^'; if (K.Loc'arith') K.Loc'Grouped with the arithmetic symbols
"+" and "-", which are placed
at the top-right corner of the
standard U. S. keyboard layout'; ZZ,(~(K.Loc' ')0=K.Loc)/K.sp,'
',K.smallfont,'>',Indent,'REMEMBERING THE KEYBOARD LOCATION:
',K.Loc,''; ZZ,K.sp,'
',((2K.lng)/K.smallfont,'>',Indent,''),((2=K.lng)/'
'),posT ZZ,K.sp0 } --------------------------------------------------------------------------------------- First character is field delimiter 1 2 3 4 5 6 7 LENGTH: K.lng `red ``f`Divide`Reciprocal`Divide`Grouped with other arithmetics (+) 0 1 2 3 4 5 6 POSITION | | | | | | | K.Color | | | K.MName K.DName K.Loc | | | K.Symbol | K.SName | K.Type --------------|----------------------------------------------------------------------- | K.Type: f = fn o = op a = ambiguous symbol (/) n = operation p = punctuation u = unspecified purpose x = unused e = explain -------------------------------------------------------------------------------------- K.debug{}:{ Debug ' K.lng = ',K.lng; n10١('K.Color';'K.Symbol';'K.Type';'K.SName';'K.MName';'K.DName';'K.Loc'); (7),':',' ',' ',n,' ',(K.Color;K.Symbol;K.Type;K.SName;K.MName;K.DName;K.Loc); } K1{v}:{ Z' href="#top" onmouseover="this._tip='''; ZZ,''; ZZ,'
 ',K.smallfont,' color=white>N O R M A L',K.smallfont,' color=white>M E T A     ( A L T )
',K.smallfont,' color=white>  S  
H
I
F
T
E
D
'; K.ZZ,Kn v } K2{v}:{ K.ZK.Z,Kn v } K3{v}:{ K.ZK.Z,'
',K.smallfont,' color=white>U
N
S
H
I
F
T
E
D
'; K.ZK.Z,Kn v } K4{v}:{ ZK.Z,Kn v; K.ZZ,'
''">',"\n"; K.WK.W1K.Z; K.ZK.WK.Z; K.KeysK.W@1 K.Keys; K.KeysK.Keys,K.Z } Kx{Color;v}:{ Used for special keys, such as backspace/shift/enter/space and for special markings, such as author's name Z' href="#top" onmouseover="this._tip='''; W150+200~FnKey^/' '=Color; H100+200~FnKey; if FnKey Color'silver'; ZZ,'
 
'; ZZ,'
',K.FnKeyfont,'>',v,''; K.ZZ,'
''">',"\n"; K.WK.W1K.Z; K.ZK.WK.Z; K.KeysK.W@1 K.Keys; K.KeysK.Keys,K.Z } KB{}: { Measures the placement of the buttons on the keyboard chart OFFSET241 0; X,Y positions of offset from top left corner of image KEY45 71; BS79 71; TAB64 71; CAPSLOCK86 71; ENTER87 71; SHIFT_L109 71; SHIFT_R116 71; CTRL_L86 49; META_L85 49; SPACE376 49; META_R86 49; CTRL_R85 49; NAME62 13; LAYOUT247 21; UNUSED96 21; VGAP27; VGAP_B24; HGAP6; -------------------------------------------------- ROW014 40; Initialize ROW0: tilde 1 2 3 4 5 6 7 8 9 0 ROW0[;0]+\4,1345+6; X, top left ROW0[;1]4; Y, top left ROW0[;2]ROW0[;0]+(1345),78; X, bottom right ROW0[;3]ROW0[;1]+71; Y, bottom right ROW114 40; Initialize ROW1: TAB Q W E R T Y ROW1[;0]+\4,(64+6),1245+6; X, top left ROW1[;1]+/4 71 27; Y, top left ROW1[;2]ROW1[;0]+64,(1245),59; X, bottom right ROW1[;3]ROW1[;1]+71; Y, bottom right ROW213 40; Initialize ROW2: CAPS_LOCK A S D F ROW2[;0]+\4,(86+6),1145+6; X, top left ROW2[;1]+/4 71 27 71 27; Y, top left ROW2[;2]ROW2[;0]+86,(1145),87; X, bottom right ROW2[;3]ROW2[;1]+71; Y, bottom right ROW312 40; Initialize ROW3: SHIFT Z X C V ROW3[;0]+\4,(109+6),1045+6; X, top left ROW3[;1]+/4 71 27 71 27 71 27; Y, top left ROW3[;2]ROW3[;0]+109,(1045),116; X, bottom right ROW3[;3]ROW3[;1]+71; Y, bottom right ROW4 5 40; Initialize ROW4: CTRL META SPACE ROW4[;0]+\4,(86+6),(85+6),(376+6),86+6; X, top left ROW4[;1]+/4 71 27 71 27 71 27 71 27; Y, top left ROW4[;2]ROW4[;0]+86 85 376 86 85; X, bottom right ROW4[;3]ROW4[;1]+49; Y, bottom right ROW5 3 40; Initialize ROW5: NAME LAYOUT UNUSED ROW5[;0]+\4,(62+188),(247+155); X, top left ROW5[;1]+/4 71 27 71 27 71 27 71 27 49 24; Y, top left ROW5[;2]ROW5[;0]+62 247 96; X, bottom right ROW5[;3]ROW5[;1]+13 21 21; Y, bottom right ALLROW0,ROW1,ROW2,ROW3,ROW4,ROW5; Positions of all keys ALL[;0 2]ALL[;0 2]+OFFSET[0]; OFFSET permits keyboard to be other than ALL[;1 3]ALL[;1 3]+OFFSET[1]; top left corner of image H(0)ALL; -------------------------------------------------- M21@1 (5 5 5 5)ALL; M[;0]'"'; M[;5 10 15]','; M[;20]'"'; K.W0; K.Keys0 0''; Sample: KEY '`red ``f`rho`shape`reshape' Usage: f=fn o=op n=operation p=punctuation x=unused K1 '`blue `~`f`Tilde`Not``std'; K2 '`red `~`f`Tilde`Not``std'; K3 '|blue |`|u|Back-quote
Accent Grave|
used to create symbols||std'; K4 '`green ``x`Diamond```arb'; K1 '`blue `!`f`Shriek
(Exclamation Point)
(Bang)`Item Ravel`Restructure`std'; K2 '`red ``f`I-beam`Map In`Map`arb'; K3 '`blue `1'; K4 '`red ``E/MONADIC OPERATOR:/`Dieresis
(Diæresis)
(Umlaut)`Each
Apply

',K.smallfont,'>With either of these operators,
the derived function may be Monadic or Dyadic``arb'; K1 '`blue `@`E//DYADIC OPERATOR`At symbol
(Commercial At)``Rank

',K.smallfont,'>The derived function may be Monadic or Dyadic`std'; K2 '`green ``x`Del Tilde
Protection Del```arb'; K3 '`blue `2'; K4 '`red ``p`High-bar`denotes negative numbers``arb'; Some names are from the Punctuation Liberation Front K1 '`blue `#`f`Number-sign
Pound-sign
(Crosshatch / Hash mark / Octothorpe)`Count`Choose`std'; Octathorpe is from Bell System: orinally octalthorpe K2 '`red ``f`Del Stile`Grade Down``arb'; K3 '`blue `3'; K4 '`red `<`f`Left Angle-Bracket
(Less-than symbol)`Less than`Box
or Enclose`reltr'; K1 '`blue `$`E/PURPOSE/PURPOSE`Dollar sign`- delimiter for system commands
- abandon current function execution
   
(used as a synonym for )``std'; K2 '`red ``f`Delta Stile`Grade Up`Bins`arb'; K3 '`blue `4'; K4 '`red ``f`Less than or equal to``Less than or equal to`reltr'; K1 '`blue `%`f`Percent sign`Value`Value in Context`std'; K2 '`red ``f`Circle Stile`Reverse`Rotate`Arbitrary placement; but notice that
four circle-symbols are grouped together'; K3 '`blue `5'; K4 '`red `=`f`Equal sign``Equal to`reltr'; K1 '`blue `^`f`Caret
Circumflex`Stop`And`std'; K2 '`red ``f`Circle Backslash`Transpose`Transpose Axes`Arbitrary placement; but notice that
four circle-symbols are grouped together'; K3 '`blue `6'; K4 '`red ``f`Greater than or equal to``Greater than or equal to`reltr'; K1 '`blue `&`E/PURPOSE/PURPOSE`Ampersand`Execution stack references``std'; K2 '`green ``x`Circle Bar
(Aspirin)```Arbitrary placement; but notice that
four circle-symbols are grouped together'; K3 '`blue `7'; K4 '`red `>`f`Right Angle-Bracket
(Greater-than symbol)`Unbox
or Disclose`Greater than`reltr'; K1 '`blue `*`f`Star
Asterisk`Exponential`Power`std'; K2 '`red ``f`Circle Star
Log Symbol`Natural Log`Log`Grouped with *'; K3 '`blue `8'; K4 '`red ``f`Not equal``Not equal to`reltr'; K1 '`blue `(`p`Left Paren
Open Parenthesis```std'; K2 '`green ``x`Nor```Grouped with ""'; K3 '`blue `9'; K4 '`red ``f`Down Caret`Type`Or
  ',K.smallfont,'>(with Boolean arguments)
Cast   ',K.smallfont,'>(with a symbol as the left argument)`reltr'; K1 '`blue `)`p`Right Paren
Close Parenthesis```std'; K2 '`green ``x`Nand```Grouped with "^"'; K3 '`blue `0'; K4 '`red `^`f`Caret`Stop`And`reltr'; K1 '`blue `_`E/PURPOSE/PURPOSE`Underbar
Underscore`used as a separator in names``std'; K2 '`red `!`f`Shriek
(Exclamation Point)
(Bang)`Item Ravel`Restructure`arb'; K3 '`blue `-`f`Mid-bar`Negate`Minus`std'; K4 '`red ``f`St. Andrews Cross`Sign`Times`arith'; K1 '`blue `+`f`Plus sign`Identity`Add`std'; K2 '`red ``f`Domino`Matrix Inverse`Solve`Grouped with ""'; K3 '`blue `=`f`Equals``Equals`std'; K4 '`red ``f`Divide`Reciprocal`Divide`arith'; ''Kx 'Backspace Key'; ''Kx ' 

Tab Key',K.smallfont,'>
(tab character)
 

[ Dec = 9, Hex = 09, Octal = 11 ]'; K1 '`blue `Q'; K2 '`green ``x`Spanish Open Query```Grouped with "?"'; K3 '`blue `q'; K4 '`red `?`f`Query`Roll`Deal`On the Q key, for "Query"'; K1 '`blue `W'; K2 ''; K3 '`blue `w'; K4 '`green ``x`Omega```On the W key, because
it looks like a W'; K1 '`blue `E'; K2 '`green ``x`Epsilon Underbar```Grouped with '; K3 '`blue `e'; K4 '`red ``f`Epsilon`Rake`Member`On the E key, for "Epsilon"'; K1 '`blue `R'; K2 ''; K3 '`blue `r'; K4 '`red ``f`Rho`Shape`Reshape`On the R key, for "Rho"'; K1 '`blue `T'; K2 ''; K3 '`blue `t'; K4 '`red `~`f`Tilde`Not``On the T key, for "Tilde"'; K1 '`blue `Y'; K2 '`green ``x`Yen```On the Y key, for "Yen".
Also, it looks like a Y'; K3 '`blue `y'; K4 '`red ``f`Up Arrow`Signal`Take`Arbitrary placement;
Grouped beside the symbol'; K1 '`blue `U'; K2 ''; K3 '`blue `u'; K4 '`red ``f`Down Arrow`Print`Drop`Arbitrary placement;
To remember which arrow is on
which key, picture the arrow
pointing down into the U.'; K1 '`blue `I'; K2 '`green ``x`Iota Underbar```Grouped with '; K3 '`blue `i'; K4 '`red ``f`Iota`Interval`Find
(Index of)`On the I key, for "Iota"'; K1 '`blue `O'; K2 '`green ``x`Hoof```Grouped with Circle ()'; K3 '`blue `o'; K4 '`red ``f`Circle`Pi times`Circle`On the O key, because
it looks like an O'; K1 '`blue `P'; K2 '`green ``x`Pound Sterling```On the P key, for "Pound"'; K3 '`blue `p'; K4 '`red `*`f`Star
Asterisk`Exponential`Power`On the P key, for "Power".',K.sp,'Also, picture a "star" as
representing ultimate power'; K1 '`blue `{`p`Left Brace```std'; K2 '`red ``f`Left Tack',K.sp0,K.smallfont,'>Can\''t remember which is which?
Left tack (like a thumbtack) points toward the left,
just as a left arrow points toward the left.`Null`Left`Arbitrary placement;
Grouped beside '; K3 '`blue `[`p`Left Bracket```std'; K4 '`red ``E/PURPOSE/PURPOSE`Left Arrow`Resume execution`Assignment`Arbitrary placement;
Grouped beside '; K1 '`blue `}`p`Right Brace```std'; K2 '`red ``f`Right Tack',K.sp0,K.smallfont,'>Can\''t remember which is which?
Right tack (like a thumbtack) points toward the right,
just as a right arrow points toward the right.`Right``Arbitrary placement;
Grouped beside '; K3 '`blue `]`p`Right Bracket```std'; K4 '`red ``E/PURPOSE/PURPOSE`Right Arrow`- abandon current function execution
- clear most-recent suspension``Arbitrary placement;
Grouped beside '; K1 '`blue `|`f`Vertical Bar
Stile`Absolute Value`Residue
(Modulo / Modulus)`std'; K2 '`green ``x`Delta Underbar
(Delta Underscored)```arb'; K3 '`blue `\\`E/DYADIC FUNCTION/MONADIC OPERATOR, DERIVING A DYADIC FUNCTION`Backslash`Expand`Scan`std'; K4 '`green ``x`Backslash Bar```Grouped with \\'; ''Kx 'Caps Lock Key'; K1 '`blue `A'; K2 ''; K3 '`blue `a'; K4 '`green ``x`Alpha```On the A key, for "Alpha"'; K1 '`blue `S'; K2 '`green ``x`Squad
Squish Quad'; K3 '`blue `s'; K4 '`red ``f`Up Stile`Ceiling`Max`On the S key, for "Seeling" (sic)'; K1 '`blue `D'; K2 ''; K3 '`blue `d'; K4 '`red ``f`Down Stile`Floor`Min`On the D key, for "Down Stile"'; K1 '`blue `F'; K2 '`red ``f`Equal Underbar
(Tri-bar)`Depth`Match`Grouped with the underbar'; K3 '`blue `f'; K4 '`red `_`E/PURPOSE/PURPOSE`Underbar
Underscore`used as a separator in names``arb'; K1 '`blue `G'; K2 '`red ``f`Del Stile`Grade Down``Grouped with '; K3 '`blue `g'; K4 '`green ``x`Del```Arbitrary placement;
Grouped beside the '; K1 '`blue `H'; K2 '`red ``f`Delta Stile`Grade Up`Bins`Grouped with '; K3 '`blue `h'; K4 '`green ``x`Delta```Arbitrary placement;
Grouped beside the '; K1 '`blue `J'; K2 '`green ``x`Paw```Grouped with Jot ()'; K3 '`blue `j'; K4 '`red ``E//PLACEHOLDER FOR DYADIC OPERATOR`Jot``
used with Dot (.) for Outer Product

',K.smallfont,'>The derived function is Dyadic`On the J key, for "Jot"'; K1 '`blue `K'; K2 ''; K3 '`blue `k'; K4 '`red `\''`p`Quote
Single Quote
Apostrophe```On the K key, for "Kwote"'; K1 '`blue `L'; K2 '`green ``x`Quote Quad
(Quad Prime)```Arbitrary placement, but
grouped beside the other -symbols'; K3 '`blue `l'; K4 '`green ``x`Quad```Arbitrary placement, but
grouped with the other -symbols'; K1 '`blue `:`E/PURPOSE/PURPOSE`Colon`- used to create Defined Functions
- used to create Dependencies``std'; K2 '`green ``x`Quad Backslash```Arbitrary placement, but
grouped beside the other -symbols'; K3 '`blue `;`E/PURPOSE/PURPOSE`Semicolon`Statement Separator:
- used to separate multiple statements on one line
- used to end statements in defined functions
- used to separate elements for nested arrays
- used to separate dimensions within bracket indexing``std'; K4 '`red ``f`Right Tack',K.sp0,K.smallfont,'>Can\''t remember which is which?
Right tack (like a thumbtack) points toward the right,
just as a right arrow points toward the right.`Right``Arbitrary placement;
Grouped beside '; K1 '`blue `"`p`Double Quote'; K2 '`green ``x`Quad Jot
(Camera)```Arbitrary placement, but
grouped beside the other -symbols'; K3 '`blue `\''`p`Quote'; K4 '`red ``f`Left Tack',K.sp0,K.smallfont,'>Can\''t remember which is which?
Left tack (like a thumbtack) points toward the left,
just as a left arrow points toward the left.`Null`Left`Arbitrary placement;
Grouped beside '; ''Kx ' 

Enter Key',K.smallfont,'>
(newline character)
 

[ Dec = 10, Hex = 10, Octal = 12 ]'; ''Kx 'Shift Key'; K1 '`blue `Z'; K2 '`green ``x`Cent```On the same key as
because it resembles it'; K3 '`blue `z'; K4 '`red ``f`Left Shoe`Partition Count`Partition`Arbitrary placement, but the four
set symbols (, , , and ) are
grouped together at the bottom-left corner.',K.sp,'Also, the left shoe is to the left
of the right shoe.'; K1 '`blue `X'; K2 ''; K3 '`blue `x'; K4 '`red ``f`Right Shoe`Raze`Pick`Arbitrary placement, but the four
set symbols (, , , and ) are
grouped together at the bottom-left corner.',K.sp,'Also, the right shoe is to the right
of the left shoe.'; K1 '`blue `C'; K2 '`red ``E/PURPOSE/PURPOSE`Lamp`used for comments
',K.smallfont,,'>       (A lamp is intended to provide illumination)``On the C key, for "Comment";
Grouped with Cap ()'; K3 '`blue `c'; K4 '`green ``x`Cap
Up Shoe```On the C key, for "Cap";
The four set symbols (, , , and ) are
grouped together at the bottom-left corner'; K1 '`blue `V'; K2 ''; K3 '`blue `v'; K4 '`red ``f`Cup
Down Shoe`Separate Symbols`Combine Symbols`Arbitrary placement, but the four
set symbols (, , , and ) are
grouped together at the bottom-left corner.',K.sp,'Remember also that this symbol is
turned in the same direction as the V.'; K1 '`blue `B'; K2 '`red ``f`Hydrant
(Base Jot)`Execute`Protected Execute`Grouped with Base ()'; K3 '`blue `b'; K4 '`red ``f`Base
Up Tack',K.sp,K.smallfont,'>(The point is facing up)`Pack`Decode
(Base)`On the B key, for "Base"'; K1 '`blue `N'; K2 '`red ``f`Thorn
(Top Jot)`Default Format`Format`Grouped with Top ()'; K3 '`blue `n'; K4 '`red ``f`Top
Down Tack',K.sp,K.smallfont,'>(The point is facing down)`Unpack`Encode
(Representation)`On the N key, for "ENcode"'; K1 '`blue `M'; K2 '`green ``x`Vertical Bar (decorator only)`',K.smallfont,'>Note: Even though this symbol looks likethe A+
Stile symbol, it cannot be used as an A+ function.``Grouped with the A+ Stile character ()'; K3 '`blue `m'; K4 '`red `|`f`Stile
(Vertical Bar)`Absolute Value`Residue
(Modulo / Modulus)`On the M key, for "Modulus"'; K1 '`blue `<`f`Left Angle-Bracket
(Less-than symbol)`Less than`Box or Enclose`std'; K2 '`red `<`f`Left Angle-Bracket
(Less-than symbol)`Less than`Box
or Enclose`std'; K3 '`blue `,`f`Comma`Ravel`Catenate`std'; K4 '`green ``x`Comma Bar```Grouped with Comma (,)'; K1 '`blue `>`f`Right Angle-Bracket
(Greater-than symbol)`Unbox
or Disclose`Greater than`std'; K2 '`red ``E/MONADIC OPERATOR/`Dotted Del
(Dieresis Dot)`Bitwise

',K.smallfont,'>The derived function may be Monadic or Dyadic``Arbitrary placement, but
grouped with Dot (.),
because this is Dieresis Dot'; K3 '`blue `.`E//DYADIC OPERATOR`Dot
(Period)``used for Inner Product
',K.smallfont,'>The derived function is Dyadic`std'; K4 '`green ``x`Backslash Bar```Grouped beside the symbol'; K1 '`blue `?`f`Query`Roll`Deal`std'; K2 '`red `?`f`Query`Roll`Deal`std'; K3 '`blue `/`E/DYADIC FUNCTION/MONADIC OPERATOR, DERIVING A DYADIC FUNCTION`Slash
(Virgule)
(Solidus)
(Diagonal)`Compress`Reduce`std'; K4 '`green ``x`Slash Bar```Grouped with /'; ''Kx 'Shift Key'; ''Kx 'Ctrl (Control) Key'; ''Kx ' 

On Sun workstations,
this is the
Meta Key

On PCs,
this is the
Alt
(Alternate) Key

 '; ''Kx ' 

Space Bar',K.smallfont,'>
(space or blank character)
 

[ Dec = 32, Hex = 20, Octal = 40 ]'; ''Kx ' 

On Sun workstations,
this is the
Meta Key

On PCs,
this is the
Alt (Alternate) Key

 '; ''Kx 'Ctrl (Control) Key'; 'ivory' Kx 'For more information, contact:

Jon McGrew:
Jon.McGrew@MSDW.com'; 'ivory' Kx 'This chart is also available in printed form, as
The A+ Keyboard Reference Chart Tentcard.

If you are not yet familiar with
all of the special A+ keyboard positions,
this might be a handy reference chart
to keep beside your workstation.

',(30'_'),'
 

Contact Jon McGrew:
Jon.McGrew@MSDW.com'; 'ivory' Kx 'These characters are
available in the APL font,
and are used on
some other APL systems.

All of the standard characters
in the APL font
can be entered
from the keyboard.

The characters shown
in green, however,
have no assigned purpose
within the A+ language.'; ------------------------------------------------------------------------------- T'')/1K.Bottom; if (1=L) K.Bottom[1+(0)L;]K.W'
'; MK.Top,M,K.Bottom; file.write {DIR,'keyboard.html';M} } aplus-fsf-4.22/src/html/keybPers.gif0000444000265000001440000017607107215453036013043 GIF89a!!!)))111999BBBJJJRRRZZZccckkksss{{{ﭥƵεƥΜƌޔ֌{{cc{{sskkRRJJ99)))!ZBJ1kJcBsRkZ޵c{kscޥ{{tƔ{ƭ޵֜Δέ{֔ޜν֥Μﭭ{ޭZZRRRJֽƭ{{kBB9991޽kkZccR{ZZJsRRB{{cƜ{ƜssZs֥kkRcccJƔ{ޥs{{Z֜kssR{ޜsRR9֔籠ZZRRR)ޥΜƔ޽sޔƔ{kƄքޜsc{{{scޔss{ZssR{csZkRkRcJZJRBRB9)RJB9)!)!!{{!)εsƔss{cckkk{֭Ό֥{{ss{{ƌΌ֌ބkk{{ss{{ssssZZccccZZRRBBBB11!!kckƥ!, H*\ȰCk }2>ȱǏ C䘏|ExЀ ,VI͛8GCɬ .0O +d4ӧP60'+ T* HWZNh`nlۥRʝۑ3  `B ]qkh=Ƙt3k_la()H`K OV2BUI2Lx DCY(`0ɡLb)U |!Cy#L9dqQFO%1D0 3<@ 5T#AI `SP 6_DE !> LPA[=>!B4\bR 4`#3XpRI+elaԖs:U7\q'l!`LS0ğw6!!2e"K1s2UR> SL=GsJX/qJ,$18@GHehp 4[_@KDWX M $Ѐaz%3.Ap'JR4B.[5o, |(q| (pl!RḱI4H {<\`,P4)H K"+Ӽ3Pf_Rt1љ!B1@ :!p,{@~1 ?BFxGT[H k8 0sЌ1 Φ)A hjU%R1G[e&rQ"IE8N1M  @wA ` 5zC,hAVuzȁP$EeRU*p|D@hRQ²<@^x188_ U0Q 7A xxC4>mP6kX`A ^!?]P7SJQ$hC N \bY zX!19Ox 7mpm K9iqG$w9qOMЁ 0/ټ,ȗ-G5hΧ(!L  @@=Y ,l~L-Z4ْ0?f$(#:t2D@( B," Ҹr!6%VB'o`cJp0e =8+RO"}3$@|CH} eP0k &14Hd D@xPߪyCQ7HBePrH#P6 ( `C~Ȃ=ZPyvqъQ\vJJcG؃_)H o8!\@N< -Ea@~P[)!zM"D D\٠;1a sH9@'sgbp3<60pPFPXV Դ^=kamnQ&>SO0mHs 'R\pU7 [oag1lP9Ia5Wm")d2+@RPb:' @ ~@~Imb{í@7Sq & 5t 06rb9t 0Y@l  D&O ,wrReTJF-3?^M(eBSB #'~ 0Q*DJ3r3xASVgGЩ3LG֤b h0W5s gq`RƲz" QYpN&_W0;DSCvYTyV8j mٗ_T4IN5*rWVV[p@{2<[Sk>U0;a 0o>e sjp's QyG|[BVHtVH0Y@k095y'4mR~ X,3epP @MM` 22Մf ` ޶ 4x^ SfBV$hІN!-m[4^P#,`0dȑGZ HYDeF -"%l(P@_XAD8PCmX1̚A G5 ",(.arxʕ G1*C`(*t#b=XJ05* y(Dm?,8~ (d 8`PA,p?cR@.p9 H0 7# .A= yea'B  0P" 1C?o, ,`Fh 64) `@;EQ7C 1Cwҁƛ@jb  hNi/8 Cp +@ l 7kF?6H 6F/D"h򑠒0CFf!g*(8g0=4@89R qhSOM;ʢsg,< 8V`΀FW"b(Ff&8(ElC.hc 05p :d20# -(œvCL8,5I-xbVao):ʐ,0* Go((gXF@?)((KUnp",cxftf8 jH}$*j$Pfx-4a f> DHؤ2 c2c QIs)}rˮœ ɯ ( D@B 3G1DC! )@ Dѭ88`@1[N"=$9 m!G.0ua׳4$0 gD&1m! PBʲm/6P I(aT6,x!f8}h*0@Xwb"B"/oae p<@@5W"q=9㡧(> f@a 3$!lS2AG` Ƙ6aM! xȃr#Pyc1$:1m2s UW& !1XS 9E }t / upІ6 4Om:0 PH{hB ` ahQp7d1!.atD 6TI* *d# (ET B<hT IXF>*>pZ‘L!< - < U 645ң 6IJv"9^DY da!G:!RF4/+$ި4&Si40i ac:ChzIg~ C07`a ^QgV!q.Pb{\0$1a,5]Lߝ '\Z0$`vI O-[эpBhA1*P} q@H8A&=D28syӄD DJ8DʬZ+ ce m2Hb-T@HaA'p,0{@D̼ hY0IHBΡx8Q-eY+IPI#M8Wu(H7(/ xH@QQPOPChR,x{.;Ї65?xY dX:B7Ђ3؄ /* }Y9jQ6H0`>+t %L* h=wwt*x4x剀Y˗ ehYUOH!YAPM@(A^Z_C" ?ȯCɤY.0%;Ȃb7( iqBlt؆@ Y. 9890#:0'`$|0Y6I1Ih2ؒ>@D{*ixACЃk .,p*}Y=l44G 99z0JUIJ8 `x9H)89yWU8;(0P BQh\E-0*8AC? }<+0@xI/iH)xy)=*3<P x |@,h@gLX zq P0h:<2hy$M99@_]]-?Fp.+X<'2N9pD04U,0P IZא.D벽!M*xv.o`RVCA0Ph.xn8w[yUa0nl04@EZ0\P;*/X?Ї/t25jR< LSIHE+-PɺyH h.ȆuȂyA )0PЅV000pOP|9;tO"ba# )? .X:3IOń hL Pă<3%0Mx1(Hh18%V1A.h2uHi5lx h >a55(o8m&ҹEFSj28ɓkf\rR ؇!xCp)zQ|1wR$(;51 &9;E(ka GȂ7؆.d6Q З蘆 t xSB *6(j3' % [yG| G I{y D:N04ȑ @pGHH8u*@0H93y|xjiȥA]*ixXhx3Ȃك)؄x|08tm - "EH+B!" `K0=@# =9!@|gВiQ3xAx1كCF` +|!xAE0sKA "}vj88vuHe -IIFz=rJ׸I:`bS4g)4H?Q@%8E9H`Gx"|Q-ՃF'=0ϢцnȂor?>5@ݛL |L i:h|4YB 2(C_xV؃PJ8A X-A\1@ H9 P.< E,0Iɇp8\ȀBBІzB 5*vL.Rz!":̃Fp*ӤhjE胐Po+`UUOJH8#64pp1ә@@=0(dDNC8=κj؂5@(슺85_4xzIhjePJZX @.|:8&PY7P ȸ8ø%KHF TC$}((Ȯw8d>fai`RT(PR֍r WԌO):4mj2G@Я8FDy #jW3H HQ+5!9!i؄:)vio  3@d}h]@@0>ts;>BfH&USp@$%I҈XiX~^d_XƲ=N.@DY*Zq ƼgfbHL 2@pE3P%@`h08BpM:$- zx^/|L7b G9X4u^D=%1'׳j^(A_xP$0A\ZzX 0gȆ" Hc}) `o B;@J1@0nT6Mo651s-{et1AȐ|bG.u5hQ؅=ڈ|FPZ؅W@V²yFʔ|9f0 xoM+pqJ%kۉ;99B,Ѥ9`<8P,3u8 y YB{uO2 @?r@p @XpnN 8 6j 7 PXh eqe- c j54;6yqck@fy"Р] AqY]O86e @P!qHbUXQ8 @5Vh4B8W@39lX̰$ M|QH H;_CAoaUA pH- )&` (#0yq25XDV3K2x43mApQ(=]PPw‰T3JT0 !5Pubf`#;c[\aB%@ aH tQ6ij'92z|n1@ &p fN Bv49& @L gDhYTA3+FjRݣ>H4i4,ICM(,%0[>4 ,`@ BcAh@sX*![|C6,T 0@5 %2'2 \B 'pqX  UЄNJ~  0,pD0+5 OC:1IV0@]%2Hю4`MH#|AHTC:x IIL*[ D* `?IgđFGШCxᅤAǒs6( ׈@xens2"UlR kJԺ # d *t ><<`hcbx}Px {` ؂c&3(4L@L@ۚ͏)(;HL|=A Tr4f;*Gq@+}`8,y!D,R5!-(@B!EB ȇT+1@ Kn,P>& ,: (Ը|k UQR2 :@5`:1pb@Y@]b\I$&>aF=Pr da 3#$@" J@t)O0R*@<Ո&Nftc\[]  *>1Q1OHYɜ@@f: ;t YIv8)i j#6]nDW8{p=NP@`;r2 QÖҴk Db#t ( h 3t/3KC-=zȥY ^JtfWrT Ħtd-@f|n+L[l4 (rO ` X\pmB:/)Lrs唱#Ev#J]q+lj %\`RH,_l_WP }>Y G*PHT"Y`Q3WJj$ߓ|, +D,PAN6@iy#98[d33L<_$YICr^OS H]w" >qMCq@@EߣP0m%@@[C>(Ҙ@QŜ`SE(ݔ4!#T~8O V,JVHmx|̙ J[2ň,͓@dLNUaHe>@ U'A3 !t- N1C̈́^ZO>@]YOJI9@1؝>U2}c@H1CR EC1,1jG3mOd|!k^<2AU`ܙņNC,@8@b.@DP%>8`ř=ʰK#QHu\ M\@L4YMMY6Gί˱$@a?|1 ~ϡr! @&PCVH>əHNJР(D&SQQ՚e.-ac#!BT EMU$QdS 4h@Q"Q0h) %C4C1:DJ>؍8R[V&qu^' :Mԇ$@)9%Ca星3duOOes~uN"> )Ü!ET49gP4XTA 1wʚDŶa) [mֵ݀- .Ĺ |ORUL4PZ@e86H9yl?@(5 "Zb8$K4RUbf#U R]1h2G>T8)UCeD*iP*ejו^Dhi5TAC2)͔/KL0CWah 5䖇)hːxb:dgʎE)9DqbZU[LEC$jn8F'aJJhR]@x,@׉R檒^ Ţl W(HYSmG * ^4F3$2Q:(^Z͕NT}]$@6X`Ĵ%NL1${>HV?YqT,YA4+p,]u6bA)n#pRDTʨ@MQQ,% cM@5 0@qk# \ Jb`%@j@ŲKC?噚|VP g1 6ǾNȅ0CzBZ [ @0@oN].'-+R+|H>>LQ<2ŀmCL&mH`w$nZ4$A&eqrSfR/M:ԗ] Cϱ%^<ќ T&3 Y@i7Frs23?Ū'=0T}[CU a2I. []k3sJ"'!6MA)cs$:E(mld@@z[iӊسF;EĐT(U]ien\@_ Voʹ62CDQ2YNp5GCFsmM^O[Ԣb']eX]N$#ybat|4Xs4F-#"2uK4[ՋBMǤ崳LpXStGǂ.]Cgi> [PC[tZWv!,eqM2_w3_.44L?tl 1DR@@$)ۄgzn7Ů~iw(96#ü@-k1YYnW_/DEbv,;A *麍 `&5@5uS^p Qpd۞ %rB@7LVܫwoHHHC'F:_wmCq(/ڢ& 7.\2K.vʆ<ݮ*8ӏ?c OD0RqEGyHDU&15sy\xIt5ղv׺J]X~qVoVyƆ':s7?;GGrܗw _C> araS~M;GwNQ @iLsC{_n1]8& :_>Q ?qOҾ#E=}Ks8[ʬCTe@C4@d4KƦ?  0fV[v2 , *h >K,A _*@a&(FWiU s9wL,9 ,vlـnpU-0avpù B FĩWβB>fU0`_7ّ[s߀;((`L$q* <ݺ` 0#11b2hr̸-BP` X@9,P wB~)h R8aC 70E Ѡ%H=&Hi @bI h+ jL,Θ 9c x @ =D HDW!A@L =8Dأ;c % [H` h Gh 8#`*`'kyn86 NOF x@`}&+' $N3 )^; 3"J X*4p=cЋ) 4xU 7TC )t3*F3% IC1~HA !X2) C.x@ju2<; Q T>ĒRy<Í8Ɓ$@, LS`97N2ɥm[ * ·[=MO" 4@`wgH2C! 5Xt@"+!k!!3!qP _| x0 ĐBi`0 ؃߶P5a eȶ^%$` 1/ TpD-[ 7jHH!3s]H%\`dBdE:$aQ ` ]>QDGh7h!5f-ky#pG ~@2nР-T PG!5$3j%& v('@g?gPhbJȢD%2G@mA X j` p|Ӏ@p A=p "- 3 8&lE UĢr11(p DJ 0qb 6YY8P C`D2X1x p2"hum,A րCH iB"!hl 3B uЂ:t݀FtP]I p8n@Cg,@~`r(RfI:@  4b5A'dT  i/( $ \4^ǀ5J  # B cp(FL@K0-s"@쐉! Aw#Q6p!10t#+С =d9%<#*`x68S4`! Ih@Y@FTOdB^ E%  + u. ҠBP٤! bHDT@EP& t(®]a t';"<xG=i!5`B>3F:p'>31b`$(A614Jx4Ai*`-m>@W29]hV!2xm`yJU`8x`Hf5(Ѝct!C@ $I;.%p 8H9i! Yh Ђ"JP r( KAGAoex ( 70 ~X^8D|%l EiX@ rXŘ2@WԩN )P y0y* '%i V1cnp3@ Bh@CШ4ܨفe҉T=.a \X`#` SPfD@x- đdXТ d(B0@xAV.LS8c!A @P lH G!HA   aeHFnqE. @ EhAZd@`:\`0b#p0Q" EDZ Ρ 8C t9` & @tV ܠFjmC XhJ`bfv&D` %N_d/"D ֠M ^ Ġ\ i@!   耋@ P !L"  .i5 0**poʉO @F A Q h   (`)   4-ѨA?a ` ¡!&\f34BN~L !!a 1tdL`Ό h `(e@JR Y0 Ѐfh Vd,jFK)N(!C"KƇS0&@R%`Lb[`%% E&K" _Hb `Ҋ0?t/E <ݡ@,HF&rO Vc,P ?21`jv"CgtB ~ Ԡ؉PcT 1&MAfD: ൦a `B _n, " ֋ ` zQ` ` h'AF"qQ `p v"4r`'+[ZDwu. @nA `XO `N 73TE8 $JL +a^.H H` aa4hF;ϡHCJ(T+]G )?B*oa(C 6P|JS J nү?aJ V$^ '"kFG yW H$J1JR`&Ѭ @lc,pj$0"5 0 @*f0 ` *@ w3 É=^,0`f Iaڡ8Z`A;l^w:Y$0fJ @"jJP r@ lb`@F `"8 $q}cUN""`+/%+ Pv0A 98N؁ǾʲW vd bLk C@ - heKaPAdapz`0Hܠ7` am -_J,!֫meDn`^x  ` BADʩ#V 5,  !x ܀* r%+ 7Е+&_ `T`%}cc $OHa~,   8 # Z4 !& O[# C *HRO_[f`r5D (,ĕ N`jpt`TT\@r`>A0 0( D A) zD x\`Zb`6` HM` Ԁ `jE!<^qhN L2 8mxcG 2R zNZ !  a. ` ٠O -sX5 `R4$d ز cSjh U`fw& ^ZGU | fChbޡ$ Q,1 `! :$$]?9pCli AV(0fGaR,b za DLjրKȄE J.@ xuKebRH  W !n#p>c`n!ҷM*r\EOd!7T2vd@d`j d p)r@ z}u @ k l%lP # ;  S/ (D٨E#Q `I@2B. mA `Fc~C28k5" $Y` 0m6p(b G8ppl㇘P R>VPU9UKJ;@ 0@[PjKpsf!XS<ӏģFEVG.B\ MlfO>X?N;QvtW 7 2jA  ز(PX$1xÛ8C'ؠ8fFK@0 <?%1hzi%E!RQsp!Q, Xs QDH`G+p)SDr7G ;В:aH`m%р2" Z(zp5Dv"lC.@@ B!tpx#\!+ 0 !:` @G )(" u:h~cku=Id.8 l::B԰,8B'ݐi\@pC' 6.=% EL"c!@ 2` b|֝ D@Ұ TCγ4's1C۔WK3=8a%2 aòlҚb `  ܱ:6=Qc @䐄+8ax 3l` d4,5$;؏vaacR}VPh^v>P@dL+`h^0ShyB 4rv`WnTpg#rxaCRufP"5Pl`{3x=I=š@'OѢ@3 IgC@J09OKIEPP 2:u`P0 3X@X#>z \[h`z U ~f@Hc&鰑~*L#W p_ '&ah$x&&$:@@qC G` 2:`k`F hiq6)-P:P;KK E  Ӛ?n= #u-T)?i57pdv&1R3!VfPjw."N M30 2q0.MDmvAAZ !c0rh_Agpm ҀJQj@o-agpXGY*KJI!  @Ѐ^f5Fnb#ɨ}*{N({$=I'R SaUxhl#HH S0^Sd:W%Po T$60  vL``` `  F$MmP`0i4 оPsN |L7aY"o0{\=L 2OBeq>RZ#`΀ [jxf`@ 3L&Xp #p&P^*0D`= P.Ïk#P*5X]| PP0(xO@P` 9S琨6ii6yL, `6d@yDw ` J;1c8k[0 G60 pӠ {ECQݸeZGoPs3[@F| q PF*f/tP>kq  r`s*էa!b,$c @ |GI`2kRaa ô@gpmKEpQ@dPNAns_f6pbC  ɀπ+,Lɔ xס `! he i+?0t6!Vl"n`E 5= t]_pr@[7ȣ~  ps\THrip@h%f@چbP q$X[e.Q  <wIhkX0QsEm(G8ɟ  xig3+[s&0P.fpd+B(ZF!܊`ʓ0` %` $P!0?̠lKU@PHe)XB7:FG-X0bM1 fL- @Ӡ iHr -]R0B &@ A֠EX0b 8J0~b1ZĴp6U)!F"V@ $`p` $p+vѣ%]=rbEy"Ǐ|AQ 0'AmKhKY<~נ;]8c'֬bǷI!&=Ai\00` ƌ( !q0aI0Ab j1 P`P %B /0C 7pCb#3B1Ze_,B x] )N13pdp@h,\I&)cʖtiʙ(ς h@Hf"XŸm0Z끐Z` fΗ* q@ > K;Y 3Ҭ (ag|I1-((I31  .88#/胡6 yQG X~䱇(h!1 0{njbN@; ` _~9MN FQ a*(x3$|E'ظa?0[xҜ60pz.70Ƴ3a@3( i@L*a,@b0Ւ&%% ` @Bad"x΀ IIgKPMJ-4 $$T67&@@nK4T=1^%01>S ,@oX D":A h@\'Lv`E }WЋ}(`%+Q~`#@g<r=1Mx! O  h*aL @0La oHxqKe:Vf0Uiti(LI9C TO5ˏzJH dO@PۣXϒ&M Xf^/?*ɯl`]l ItNC@;e ,h f`0Vq&yKh@ JP>E PJT%}T)4@Xz!&U 0Q%(!GT$>Fɷ8Cx&vĤ?`k4DRԢʥ/?_bPCkl*H @&Kbb$C@ӽ qn@0HnQWIH'Fpў)X~4 zˀ$E"hU-p pW@&6G%a-|P>Zx& 76'b|:5@3$W@pkHQ80 ` &3C$TPǝ ?4zV֯xzپ\:X5 U%+ PBy!>d2ȸ4+@4<'^&&ƎK|B HbYň `F t<րTu[V960Z$J0ڭK@sj^Cv `E)^lŗf/Q)Q΢sfi-5 nY΀ o8Գ[ː> ĺs!< j ){ J=u KZEl! G `Ms(CuӶ!g"@s(®7% MrD8춫R@bNK/@8it{d:@ @ |CՐN309 Lzv-8MXm/)Z$PI'([cv;/0Bbx#BA( (ɽsR> H%€usr "K8 $Jj 2c#X"\CxQ xiR$>9[ZA2 qR4a6ghf#x)2&Ћ%ȴ:{Sc1aWqH"@ gPΪís!01Ԁ% pY+ʀgphЀX(j W\,*h#ۧ+6pE)*3ڼn$"*(0ʉ ! fZȀj@$6 H٬ J Æ̘bn%(0(ȃ&I+Ө%!+ 2[rt6&~3F9sq=I8'8ȽApAh˸ B (<486#K *?IjC pZx);+5Z3CLikG ?bqd̜@.즼 332r12(w*MpMR#8Ƒ#xLJ(Z!T-b"1s` @c$͑sJT*2t'H4Đ:3J mI̓L[(1$ B0yLqCoF,93P=#5P4S;%`#DaZκ;p'\.M&t2$Dx3J/C%eҍ1Z,c1;:61psa<ɛ ť;)am` h.2Ф h*Z?ф4V!],EP#}@Z, Am># j#] H4&YsP+-  @{ihHՒ,Xр")%H t-X3z9zɹ jt;jJQkmO^ێG ]!]Q} 8Cսt%ՅeX曢%'AP+=І$؆$-pLd-!sm hHtm„Phh*$mTX!7 x~) [ 2[ ɚN $9Zihد[CMTh fUIeHk ƳzePR4{WKtW׵ZՒ bMZABk%HYMe֝U 0 Xi@$q68[%UBIRTћ71m5*#ؤ%8*cŁCM QSYBu_uU!b# bK&I #O xArQ76]!E:yZiHСK<6 X$βNP_("G%Q  X6V Yjݷ Еh>3#)*(AھAܲ cCɞJJ'-A"!xrL?@Z IY"|=6bE&0X"h"@Rp \TDYh'#ӻJR]A^՚M 4p @4 /d%ɓ[PCIa `7Ӭv"$(h:_xg "Z ( [hDGPaux%Gr[І(Hp}-N0Jtn]#}yFVi ZmPW)詻'lԓP/R8"X/hRP)W ˫}4n6e~< "%9$<نEVtC5Ni~rܻHFľ?fPPk z92hm!G(ɒXmжjO**7!v׆ 9;#5V:> Zi'Aٲ(piBN(~hBG! k%=4i$^nvoрBmzw{mҳpc`& "3hI|J 7nC>&2y# Gȟ5Rmh1#Gr  8bٚa(2$,_iCH],+Yj"b3H-w7a'-!%iщ;왅䩣/g@')p i8gF?<P[6K h֌f%Z 't@ 0B86X-H;؋X; bxgGu,gȈ ( H4iXh"$~D&a *cҪhЂJKxOhOPG9 iC0X%^wIhgZ  q ~[x 皀3P!-hGEXWxW w10LhHR(JG(-f 99)%XՋ0$ "pGXh}h @F*.B 4j=h/xxpp x,P+ȊIp@0˧z-|XLlh'. 18p-H-0-PPmh!Іftxzf0 (5BpCP '`'p8u0h Hd?:_g wո/HX1hA/h /`0M[$t ^h)F9GԲȚ2nx0h၆ DÄ&ܜ&lP@NFmNpM B &T 80@@(hP*۶n+w.ݺvͫw/߾~VFK6pTpg^88 ;lXZla˚$40P?hCD͎=RHbqC:W@)Mg( 6n `fOE'dР5&w9uI~ #,p@ XnU`p@K<舡F]HcS?P`o<-OKAz<цpmeؚ9 L ,5@I`W}@@@u 8`ϰS@\]yWA [Q?gu"u9bbt!]ah$EElQ$L!&i@@ ,q5DA4AGmp!9VS: FccQ<&D:E-Py% hE Ac^0 U4k`Pt߽$ _E44cd\ iQ:<ֆ$CB|QnF,@ $PP!:PA0`р!HNdZ1MUGBd4 CW@UXq7\ \ p^AP@wD"3IK9QgYA01lm1NXt pȷ(;:<;&F 2p 0԰B?t1E$#X֠idV0 =, q^\Q!|IlфHx9"?(Ȃp!Ei @b\v1FP0О.Q K3;ogHvOIK& L& , t'B1.M,d)0OLJFtQ028` rS4 7B W4Fm#-xZ8\#^ap p l! xB7!k# G7<38Vȁ39 pTYC#`GLP"W( fC+U+Id%E*DB$ y[ `@kK 3 #>2η@؂؆G(B" 35!bȃ4a SXP4!@$X`7g"a9$@TC!$2b0C7*|x'Z*I`Rަ G?A fT"(@GO4TM @1C$aqc Dc[] з4 *A/ H -HPB#l5Xp& FlȊIXZ q:| ;8b r@H aX XpU0%r 036P" q/ W&|#P"?ې2hh^\[nw& Yְ12Bʮ)hp@e|C4@=UGUb׬*>a _|ZBp6Tm  jGb5b,a4hC \`|'&`9j}@~:14D؈B y kJPL8E'+! aAt{3C0N `F;эqwqJh k{P'ȣP?nlH1]$4h W)"A%LFec {@X\$ @ @ T& x^D5,x"URT  3L3C3@3@C184emD0)Ă%QBB$(hhpAA4 ,Ѹp4(PA x9@hC 8BK_8d9xA;T@ @ Ѐ @H IANW؁JplQa# <8"TG-5A$*,$̂'X#+c(o@\!_I5$@ @4AJ<hA`-@?(AAC7- T@14-ÁA89`?=lA0 ?=ER,hKɞ1p@ \ad!Q$h BL$nf tdHx1΃DT8Q@g\<HC/%,65|(\@2v`MTH ̀]݆*xB]0~QX$4CA!c&F! A H@%PA<61D(5@$hRN@2pt@JC\C E4Bh xT"PAL5lA la-D(@\HA!x77ă9m]#z K$AXf<O;CPHh&TB(hB%#Ă. AVaA 4#Q€%W%A{UU @n15Q`!]`@A: @ X`u@.$6hhA8\C;|&A8B14,G)3AlH<&b^<ԃ\XAK @1QCtdxI~&hB(XB/%<#\uW8@ Gi#4@`@L@ (O 0xD0s[Hf@ Ȇ8O95@JBO[<0H$A!tخM A4QD@iCa @Aؘ?8BA)̙XT`?ÚA z%^$ADH;XiNc @ @ @ ܀ˌoU+%5`i_Ն9Z 8Ab!6PCґPO`jF*y3|$A0@@!\P۔HAߠD}l7m~2_B3- A!A6D ]l\aΌ\C<;h0qlJ6yA8\C5L9'ХOALٹz4lT`C;%ra Ȁ \H89J@ @ X0k$450\.p6^]B&xA\-D:x'x}XKdm 0XbK!hc~y ,L*i: M/`*z:C F@LJP j nQ $iiq<˂ZB̸ƞ 8vq:HbpvL ,q@FxJ33-L' 08 8Àʩ `8.ĕI<3c6PC(#=N&`Ž0P u"ˌ ("`XB H"@0ԠC 5(dgK"4* *M 'ky`@,wĦ@`*"R*{Gx -̈w9'6'x6~C0 P@N`$G/(̨MjaZJA#x#ȉ$:@`TITy1dIa*Ypb). Noc h3%E3ȳ,=5`b Ym # 5 #H@TԠ@lfrU ]@)hCIBYo]_g9` $%h@(b/0d7"}ƁÌsvȊ'P1 @0@DH~kH=1vp"&0| &`T37@= pS `6XSHDN h"2! OP7?ѴA f0CP7laoKH30@o#B!  9yn)5`w9q(:1ga@-TL Z" 7 THMq@ q@5bp J, ۘ `XƐ5m ;3 :Dx3-?ȡA6$8e7э I YLvVsLzpeV0HdDh@h0-xA n @(,?unT@#VB b   AN 7"Aᶖs4N7tNP*  4 `Π€ 4T.6 ܁t> {BC !j aD}J}kM $,~&&cd#̠ 0MjTЄ$D!^ DD& PF`E&P . @VZd@3B `U @` ' ΀:]L)*OA*BHd4`Iu `xD t |*` @* ]`B a X` !z!&@=Z"`A6 #! aXZ2 aA$ RV!x9` Oabb @N08`0l@ <#ƛ` BO$0"(Pt J8ƀI&(V $֨H A ܠ a E `  ʠ"f|80 VlX րԞ !|D)&` A !N^j5cb aZ( *I.[$`|L ݊  ԁ! YI Jd`b։$ 4N2 fC!#ob + Rh$:9ٴFa "k3~QU` @&hk A T@{"R;nYA>b#5fxỲ)[p#g$@mA  8@`jg(8(6Dc2_$l! 3PPۼw׭@ (L%p.90搞B^<,߽~Bø cy޵kǎb8PaBhI,8J00Zc˞-Xt@Nȓ+_μMƌf"vceQX"D!1jXqbF-p*i% p`Z^:ٱ ؁>CV0 1qVXFXGQ X1`S^0Eă 7pTjTQF0?E$1kXa\4@gl=@ lc5D` {ȑ\0ag,P63a$;3ޓXymlMgDȤA$0\LpV饴eZ[|HZl9PEݩ%qF?U#O789ǘ |4 qAq01cFc [ 1 <¶aE<4Ap@ [d!4Ђ-p %oC]gE!ZчHx@ g4MK@;! Y^h ES?_]55X`_̅4?tviJZջ9)`mx_ADA@Y1bGTdO"H9X8k8DD g @Q$fP9xO=P0 %0 3lr0Ph |؀-s,,c7`& '102[C(j"A(3  Äjb(")B i0P96_xpT>-3@ lȆ)mJ-Ԗ}+wCDSX!p#|!d0ݢZk3has\1G>A vpD7q3!T1nte,Wpp ?atT ?C$ F? aLuărE\?XO / _3Q)5 $8B\Jdl /j\DL 6A 'jB@&P!(#p \,ôP0D4S0)ى P`~EH`CAfUHG>Q Șp MS+ d!IB̅K;=Q̩:&yp`hA TXBg6)7I WVfXE1 4@+P VqAl XEI;B360@& ȟzv9 & LP`AJ5 sЀF;h MІ$(Q K70$$?`.)@jq\fP1n#O[C%PtmqCOJk`(@p^8ܱSdB.Xb4⥘aNXC BN.P<:G?Ӹ>l3#ak18!'pX0$@ t~) @XcqI@h?&!L-bJ KA VxAtP5h \HP&6` p䶚& -pB9! . $a JCAbx<8ajXc la(+#TԂڐ'r1'lcKBk$ͰN3jQG)'|W:fRAh:ʐ xXܱ X# rc 8R0F.{`S`?ȁ~'CЂ 'ȇha'h8f\P|,h`&8C Da 'dGdbZpPxpZ`89t @7h#ͥY<{HBq _D! `RT?1ѕ>X^ȃI6 M*ia nxchQ dwpv\#@ЪbkNF-1@݌[n&@PSvS[ CXX|? ]EE`u8$9! P   ` 0 (V V`]wq`vT: kh kF6d r23.WCtqP'0`voPFjJA0V1Sjw&: `pa{Llw,"@sX8P`SX%`(2@}Bi|B0C cZhחrPvU;@JJsU 7;U %p2BhJ  P -'/3fm`2@'E_Q@ 0 p1a%bUĉ7Eic]g Qv j_`&yPp2o`uTX_IxgQ`Hn쀉4pAB)50g@bćOP`5$c6¡8`xuP8Q b0Cc.7eV(`=ۀkp`0VZ`@ wLZ@<6@&<sH.bj?@7}2)peyU;1Qja9Pgg/c ["[5Ut#y _'PS0y-Ofo!B PBLd ל.Y kns?#̐P{5`F4f ` ` {P` ~0SlwmK)(qr`PPFQӆj6@7`.Z6f4Ђ2ڠ`KB  Y~؍j~%n@04b ` ?p+P<%c+`3prfPgnAvKQggQ5Yb G],ه.T2Y%rY,J7۹! pynk E@ ; NPreTW'FQ盄0m.yk4IgdnpGsB&qZ [TBK??5 = b  0PIa3.4p "+Ԑoc 5KA gD(4P<'4'b0: $/a֡trKD` GwE>&g`doڒ|{Tb&P| *C{t&Kc^Py _shJ @0@3qw:Ґ[l9 0,Ԗ>( V@bQ%YRs/0 %GLiaf4W,Z-p'WbP#?$ꑭhF@+50!D( ` @ bҖjK[XWdr|ל,ٱͧ,W v;xXk-x,p` oA!`]&`S@R3jP\`pM'ig Ѡ 0c&ei08F OR8rE,`d`*,Zm&&@ g= [B+C  RPF1Z+@-@@` G 2>~`!# #Wa NP!f ^@ SR6p  yh0{}ϐdz ]@ [ p>"CXuickJ` ` ?Cq\1Ldrp_bx  J:WAsXp`0eȻNE%|z TdgfUU3!U`_&mY8sBy< ~U P=ZI (jyr4e-t YP6@qFS @ԓ` ,0sr&9svPq&E 0Ads蘌gEh qFpe Pl1>Z`¦ hpj$qѧA7K%|p BK Q0c]  bppPú;a_:%p:`xq `A"@cAtLX!3Rt"p@ )k(`)+)/ǜAPؘEZ ). ⲎaUD;{.1RT#XLU?wV [ ZM<5{|9UjEY|N0)/{>|k\ UX♶QT@gVo0YgP` hP[ht45ix;'S!`06#=p(WiPaPpL-RQ`⧠^`F`Kha 4~܍ǮQһQޝ%7x} @yCP6иm~2)U KEx2{F,JZLCVkD mMb* 5.?qBp@;{Hi  S`\CkX"])Tnp H0 QPo@u3 1Z,fGr !԰5`{v.=`72IWTpN d p " nc qpm 6纔D8[Ydb @ V$5S4ҐP>/sQ:k@@ `я}/Z'tfgL)G`iA0cԨvZrPP nTw`\ap G#DHl V x?d0.MNa ǻJpY 3C i 5V f0PEԜĔiE0$ zX2|usSA¯w栘CHGh!E'_MM,x0@ $@P4QH*W&aꓬ*(f+Qk@1cR1A Tp* `1! Δk4 @Z5i 8CEH5I 6A lp K<݆$nЀ3 '8Se5K4J 0 XNk4'$YAű.dao8D` @1pa HD*pN B` KUɚh20@BbxBЌx 5#0pC7jc@KȪ ` `@$Ib$B!tXT +a [Њۈ0lAgh@3DeL VB9S`+5 @#x{6.u(H{0( --2LQ?h $P,:"s*~5q.,$QvN4wV /k4 p+*:?؂X<1h1`)(LI/p*0˂46@-;0C"(1 /;ؼh'v1 uhV[&/0Col89ÍLRBZ&z<6IHcm1*30‚?c>AA;h 1 i+7h/DPpEqc; '8hs#"6jp)YsR6@G+2pR=9ʳ+#!6/K0  a!0 9(i+9-MD1X1 ІZ; m(;%`Bp-0@"2)pӆx2 3p  iآ_TQB"/mpg#+6xSlQ*2nȥׂ8kȂ6H)KzImXc@P12O|s@460ȁ*Dh` (P[@mȎ3z; 8xL JPYTE8 `- A9NȣQ-.‹O P@m鶊C,8.2H&`Php4P<0@)p (L~ X1SaHp yTJ 5 9L {=e PmmPi9T$.H@ЙЉ(~hp0}pZsp9H(&>`(2990~Fm' 0y4Q- 0Ge !كi۲P$uE ( Q;AEN0_`Sp*ɓLPsU#(9<J0^`YHl=V!.;+%8}m@}DNx% P9i q$bK*w ،XYA| н7/<6P!*Ѐ򇔁0@ȃF✇//,t4TCE5a>I^.<@wkT2 >7 u,H<;088d!PZ5IēA3&Y>٘E@VD`azzѭ#P4:9PA*-^P.p8P!>LTor ؁Ȗ)/@KԆi\3" 8bP Ѐ p:[ ]xp ]+c/  5p!yQ5P.?(#Cx*XC61+c'H/Ъhptpٱ=;8/;0.pt%fA{|q܇1x 0/+$PmA; @{PviuE Vs]W'كh '0Q 8``YYU7q((y,%YQV7aNSp(@ N:7 X0/8ȗZ¦f@6#X?hE7N7; ((@ΦdX|n`{, '([/8c8臐0؃ ixDB05 ~B5\҂pp[ Oކ(9 mp 1 @_3kB 2%8az$:9I7;!0nbIq3Bξ"(&H(H b Ptyk ] ŗ*k$ (9(*H;3osؐln[#䤻!y =LԕRo1XAAup`}A ! з8%{V @7xqhkXk'}sMu8=tx00RKZk3@#z‹[f{/d0f@@c0kchkcd`B 0QNhOZ Y縀m(<6QHSau,1Ѕ_H]O$@ӠXЌ„ FH,LpApPڞa0eϚ4i EK8mifc&#h  Lx@ pĀgYs`(ECu)'\YB_,3G'1V,@!D,ٶ@Opv&=tk(?({fK ߺvXh'Dx@K (߄ p '8D =0:&L!b*dxߴ Lข?Mrܔ &(;NH*̂ #@ 0tŃ:Y&)P\HyR ؒPB@FXX#X@H@l`0gLDL!K<nD$ 0 8g$0Fe3E  jQla5OM>갓?Y&k PF@$3)@@Ij̑9AfO?T!Bk>eFhI0Qq!0? `PI1ƀB HAJDǀ0 (t1ɠBBE0% l5 l#*010e냵E`?0/% /dAȑD1pR0@ # ,`5x#7firPP:iff1q*p6qJUs@t2PjA  3@,D$A, dwhQ5KZpdO?;pTN?,~i~q@ cҍtB ו`B2 A( ٍnr Pt80?P?K4?q Ck*S&& d a._=D1j2RoXȵtVbZ| G ) `WbVdJ%ܚ XƤ3G 0tB _؂D|fH dP3.tHHPRራzm;|QM~1 4k$8C9Ѝi,LCD @M5DQ$<^f5@A \@ m,`wQ] `}uE /@t ?}ʗ =qTS4}!Ň5XPEāVʥA4@1 9H\,5@C FDrYy CHT٥`Dh` M4MlC%ݗAwm,l? #Pz4vM@x)9>&dޘa4GR%8;jdq%ȣEY5X6bH@@q%zĘXȣ"i4GA8@@U=m{}D,BPl%nS,l_XIY`N)!@^5G1XV@1OuQ|B (T3}DD&f=HC  Dt( d"8!dJ0r1 _' fy%@3xGPũW{"E*,Q,AA k C*VqgS1𭯑(*lC+&@bNf@[m_'3%Ah@pf +3@)z83H@3ٰs(kЂa\@ DB$|20@\h>osi-tRآ;؂V qr?${TA #IA*]]YCeD-Hd&t9߈3 $A0@QvT1h"K(]Ez@ C3I, ?/@@4-"\hsH=X`tTYU@0A#Hg(^$B!IC?P6$EH$Nc<^?RDT$LhV,g؁$AM@VGCa}Ou$RV@pM%L>QuFSVk/QGC])֜vB`DYD2%z3jdE@8Bi-l]D}Jq;`EM(@84PGЏ\jKMac@n[TQ:mv&IE7$Ԑ IL%`@ DXQv1d4R"rME%xAJP8H;Ƌv?Cf?s"Dƒ㌙),"b2T(B[J79/s`C;WFRJԼ`tʩ搋rr_ܥfhx %#1ȕ2E(05"vJ N d; ޑ4i8ItٰCG3qw{HU}0 ? l334@nI N Q.vQwUXT)EQ3'g4vTPpaB +PxA -X0`fB  P  k D)€4e1&0`0(0QSl-*f rY`=!# i$XfZi0@ae-,h3(̲bS-T R)0V-К4& )WN2(Is6ֻţ, ۢF]% x;5l8 S^٫ mHfy41kI ̥<[M\ s$m 6/808Pf:h؆1Xij}k{@hGi-IE`P@x Lf# w,@%>@(S]Ҁ,#YXG]Igh`&+4@׉^ igLS4 $$  "?":^J%P',a+i,@^ 5@Am W JR K4"#v6-6 XeQ]h  J$჌dU6֩jHDjLȄNJ<Yi=yQD(`1Vihf֚?`5;P.gCQ*@QBϲ1n I)Rahɀ \B"OyIn$ p*4;X(+. ,~fn` (`*2(l|;XF]+1`)f :Yn"Z(C)44`` fh/ =)qTK8@1%rK@0jWQb4@1*$!0Va@X^b(cjDZ`jYv0W ޕ"6l:0e*QZ{F3e#Y3 櫔 P}4U`@&̼IFYw|@]U"T @Ѩ<ĺHZHi.. ٦hAi<PHj IW 0l8M2$'@)({kmclBX@X0 Vl@8 r3k؏Ӑr _=fv-~cNcRNp(H@E0[eCoἚ$ee Ih4X)^2Ԥ4Ez k\AS+AT>E`= vJS%X# ИaO8D l*uLj+ս3@t@Rԕ{)ifR(? BI`\ZdMQK@ _!ڠnZF$Qss 4r])o(zɌ f rBhaXH} 65%@ Ni#Dp\JV~jT߹ds ƨxW19]Oa{hϳzAUMrIJ\TDŽg%FօQީ"Pϻ6gCjuHY`zBVm- JKM` &@%0PuZ `P H `'+ $ J`URPf`pd KfU) Ar*n遖P, $<F/kȋ WhYcu<Ni A4|x֊DLJ$[`%C q@.D` NN+J6F9 'Ħ*,#^&N )j$ c1 f'*&@b -‘b@3"M䤹V %^nH&fּQ"',+&tRp1 Ig>r74ka/ `  b->#RK%tH}Z*"(&|aБ !~ռDe/:85&g$ i(PLeMnR.(Sovǘj/V*#&vxS'=nc) CoHWUYGt/V"&8^!kYuYh< Gd" [U]#V. ;SOء76JZ Ou] VP A 8!N!UK{#q7`G`%VV@@2R%JWuBz7ȋAHg :AZ!faTc72@*>szj+O2"`f@l$&*j䆤>O1W0_@B`9nmMf? AnOS{0nwݰ!-Iv@u_{#ΣAqC`A%Q>HkuJ8up_9FDv ̡6PD-W/0wpcv7֤!ϔ&AlhUuF{M:aፀwk71W}-!:݄EB"@7s߁Rח-!D顋a~|eׁa e3aa}gy7pZCήaxA&3/4J CoEE_;ZfB~G21j؈K(&3xcNꈯx7A4,X٢P_c 8/ LA Ŧxݮ* ![I4d0$;aplus-fsf-4.22/src/html/keybUsers3.gif0000444000265000001440000005123507215453036013310 GIF89af3̙f3f3ffffff3f3333f333f3f3̙f3̙̙̙̙f̙3̙ffffff3f3333f333f3̙f3̙̙f3̙f3ff̙ffff3f33̙33f333̙f3ffffff3ffff̙fff3fffffff3ffffffffffff3fff3f3f3f3ff33f3ffffff3f3333f333333̙3f3333333f3333f3f3f3ff3f33f33333333f333333333f333f3̙f3f3ffffff3f3333f333f3!, H*\ȰÇ#JHŋ3jȱǏ CIɓ(S\ɲ˗0cʜI͛8sɳϟ@ JѣH*]ʴӧPJz+XreTÊ*WBjV4YZYݻx'Z=m Ddb-hjEݼ#G>v0]uˇ/DWRZ;xq渭EX3σ|EͻѳjEk7k֮Ee-Z֢9MNV ̹8+hZu^Y|lqξ˳Y6٭<+ڢ!E hHVbgl%x5W^b^&`ivEE qG}-Vg` " }h Euky Yp "2҈PbJaqrFrY"k1IZh~ lf|=\7k%g)({gi'b&rB&2 raa\* xwrʒla*H5vj]YzϽṜ|lb22^QЦV)ffFh>v칫:^[vٮh,++^ sJ_toizZDL S6 w*-YV/YDelWYXx!3br00taE>-Q"7uAbx'+ rLX ģƂ .y$L$̨x?Rx;]Ф5˘MI #׻ (v9z$/)Jz!ӥ&%ݑI\fig^31L x]2u69$/ذ4 `: Lx2qJu$YK/2gPAc*V.BT,ݞ+5 Ҁ11Ќ3\WR`!/iKjBP *2ng+3ꏔOtf֑X@^pth.+FQ:rBWfy"cA> Ҳet}GqY4ejӦ>)=Ȝٽ_TZd8Z %g|8D]ev[!}u:+6S7aT ,u> xavxVoK[, y2y!ݘUV[VX7ܲt ᑚ gc4T8_lxTsy 5 ?=,xa;ߙM'wla]M^1@:Z zeO]c` 6CQbђ>]hOOۂuZΞ"yb܋ٕ=M6PϡkKLa2ޫr%~'ȀG-נslEkK2nyz|?5gs4qxdC0watu~|Yޣ9J5-=Su4jCkh+KM٤\{cg8@J,V72Ill+h++P{<Q]?GzPV17'*04@yEb2|C((XupSl9z7-v'?gQQBhUkJW`DSz8BYcvx#U7?W!:!$džV&K$1%wט$Gf߈9B7!JvrCGKX#7dwAW[Ie[Ô>7$'B*BS|Gt88TX;5pg1$<7uAJf}j!j2}aA3-w>tz7eHSq92O3XFG'(!bB4 VR2vD#IuP֒ :"](lIUdX"b-|Cr' `ٙr*tS'j \!b,0F:c&vgp%^,}Ĺyi9P˹Y)y2hIu1#j$?XMS&gI^,ٓ9Y`ɉ i&u]!pi<2/^+&WXk -|}%2=Y+/P`OU@^5*:Y$p27zՉ~6+܄/) C,LeC6I9(8)jeI^EJ9Z= ĩ*u 6ꠄbW`TyVCQW@#H3LS7EOJW$z$D:3Zs!m5jY>z0ړ*jCJ֩ZySI:Jas}ѱ]HV@٣jg*~j ZyXqs*j} }!(Y!VpH{S8$;0bDw,uqZ(9Y,ٓ?ujt_;%CK=9-:` *:C{>&Ȯ+Эej K7}չD J9)K\K+0+#S ]0oKUe _p;=)zI:; 4*6ZunJE \k2p U3m{0;8dY7bʳjPsqۻk˵;$V˵ȫK1]_۶!0i\p\Z&H=<> |۷:[ZEV{g{{VpkYΛSһ<Wi1;B{;Z3Z<%Cܹqu:k*ʰ)۶Y6|85GAl쪩{)Z^!bʢ<lʥ|ʡʣ`j̳i62ė<*Ԣܻ;c'$J\X y 7jokQyܾI jǹķĞWн2KY\L2+)™&{[͸|ο[}k,Y{̻ T\+ 8TK꫓$`y;h:b2=jl%pGz)ЋJD a:ܩ+|i1 \-M;T\ۭ}шȈܻ,OOLCfƵF( *=I^s1/mͻ;tr&ۓz^9HAKTq;P2sAY[{)~3Z,J0dP^- ?py_^\{|k1MѮٚ֨ +6>zF;O;nHZL*9ΰ\o, %0,PEo${`zLY]1=FQkYmbܛ޳nSX}3j^.P@Y _^Rx[PRAM2}*h+J[]랷K+o% Ek0 1y?ټ zV8+X(C%NXE5ѣ}$iJI)Q2d{ '@Xb"AWfQG&dڔJ5i0B]Xb`2EBCpVB54 ̥B]w]$)Ê߅2 ӆI/f!|%ONңWY@'sV`5k XA;(2.۴l>[v۽ E߶B ປB&{Jy0;j敛I=I'AdAR뻵ژ +xK9R(nСb|L@;(PL(tr">cC="4ɦ@zi'A`'Ӕȶ ̤ +P(,N9'":Xl UTQ\HA^hA;n BZAMR!lr+ J8q%JIA/dT^1C *LB<+; Cdx/B ce!fn.,**7 C:<^ml>T{u+=Ѷ @@3[ Ad4!3C*ݘԤ@D< =3 16n]v.B{*⣁d(2Ba/$sQ)U{?ꏥ=ĩ&.RYD\9v0dD`J*߮ˬ+,,5E -o]KwCSXĩ6S0h{ Z3sB3}B%4+U <5Mcq!"+i]!]6*!C)l|U݌VθVWejU}wiXyƒ_x}6ö"ku7YP>A G< 45LU)laX·vl2ྨԑUłVLjQ,s=AZ(}+\¢,g58["Owɞrq*Yt _Xa$D%lOVLN&KD {XxFU6/@dJvhx[̿hE?PH1gS +nB)dz|I@ʪ{. NHب"BdBԬ!kDC"( K 7`)(’~b2w$yV#(<**S%'Yq4$:x) U{̹4.tqԙ8vgZA[dB!kV)H~B B%rjY=X7fhb= LڣU5GP׈2#]mW!&ќLHLbbe_u~g)P![̐D) 5*I)UIiAk 7CC~UӂAuVhtLSv F1LANeSĒOfRU>CEIO zGZ#&?H|_-WNf,%I5!$~V.M=QZsz R [2@1Y9Y5Mx|ĨT$+i,n!"RtUI/kS Jo>(ӘF+Ħd8rQչ_%&A_Jjo\ȒTjx]JJskr"rw"#I Rt$f,mhFEIiղiZ^g6i` /)M`˾gccoes>E.a`X09rGՉ>IdH) ldlzE)w@_uЌGKӞ`Y@u 9%̩rL_kP ( wK{pjMr"Nm]Y$7%uirމ8کt#JVA6 div%HRQ8np 8_]lڹ:v8SB҅FOĻV"FߐnbPk/FDeE;z&K4hr$!.ZV*d%1]rMqlx$4.KҐJI ֑Bs|k[6:-+7+mU3 R[Ga$@VU:cE&srݓ`awmhTf֫p 7)?2;IL 3|s`:]4j w9W/\g`4yӟ>Ϯ± ySҪGV)L L7 |VjP*ziuTrns+@|.#r㴶/>cT1 K-ɜk =y ڰ@3>A ~i>` XA"öG&mJ ǹ+ў{5!ùr7˵ykع.P@ ²+@/ ̨@ȗY8Ï?v[̪˰@@x=3B@+z跧pJP[A>GT YI:Ą+C. <)aY\G@2/.I>,.Ǣ|<$8DBBV050.ਿr=xG⪤?.j۳}*#QU7 +CG?!Y=z!Z{P,xE(,DⲌ$\WӉUS? GjvK?ai2#瘖袘ERwd5E{ ${QB(DoHҶ5 , Lϸ"Pp-l "/2 Gr$RFVʞ0Ƅ G"I@`~!lIXu;[I+" .i,%p$= V j)|$@-R#?W뢉JGꉌܜ0khkM Mlh $["{0Qi s@B=KQ=xD¢q|d|> q%AZĤ4J£ Ѩѱ\*,gt`L@hhk ͂&POL' 5$4Dؙ͖ LϐŁ+˲C>#R H * A1Q\="e, 4zL.5%kh0O@X J`5{@ 0n 3, gT?FOҼE?=OkQ= FPY$;!%#ϒ2-OR h*7KԏAU+4= \SAVdTɜG/):|CHJS8?SAhiVMs&3 EtzTRa ġp;AiɍQ=JAiYS5UqWlh51n+PmWN 10| TMh@VeZdgSTAЉY 9 RuPd1kYB`s<7sYVm W-ok(Sĥ<7C0Y мYTk`XQSB@j ]zMT5|; Q! °֍/Pĉ\VUkxOGl΀S.A_iZTɵDed M\ 2\!6hْ`ՍxC R*pYrqXZ TMVɝZDb) O¿U 8q+qP*)U~9D( +^,I8GD-)&`D-M@u,AO6=95>`!+ ;2 ]'hءE!X-(ۢ SzGDXq,.yF4T-`\AUX4cGX> v #@QL+[ Y0)_a>vC7xf"6=\@(JQG.# 0tR/fQ%iſ\%Hes4Q~rɍ߿`ٔԴ`# \>8KJ+!SdODcQxfQ6AZ !Caـ SYPjRߗ9ےp4ʝY k $ɤ1/sgVQ-v0K9bBm1: d9_`_avQU;6GW|넋 \F9|֙ 8mʪxi磑QUN땶]iOP 0F`{F9 4(2QnY&YF!VoS踢)9g,Eͥj5VmeWf&o H0s̺7ٲ ɯ Q:K$ g4]jeL$(UK| Hqti^Uk.~(b~ `q$:y1+ǜxy̯(EDFը.kܯ s+A,:$oob=2/e\&5O3+е8Yu8xʜp?sc A7ju+X-Ĩl[( M+k"oW~b-KHHgˍo? T~R'qs"&yJXۧ'!&@~2J+vrCbʘp-0˽\v w2os):E&럖C2QǭPt-4j/<3;sӿkX@\`orW %!5 +Re{+m7bTt BK*D@8%GzvUKmz{H `)8:Gtp5zɤN= <.a"\x{Ř3NB|8#Dp 0d&sT#w(眱!փ(_oNBnp톅Wudq&|O, }}ޗ@ v/QA5+@zO=Vb%„ &@+u( Ȑ!+VF^mH*WiEƓfҬi&Μ:w`eOdҤVXbS,$&d5$VVXWA%8 ,VvEOB (ΦXd.V8"PP)A d8=4y`=\0 3e#E*%aEu(Of]| i2wwj٪Vm 6밒uk%ѢInѪiwS6ː %V!U]`eő&Aj%IА5%\}!A@O5|RB EdVIP{xgZ+U I[nu O@\͑_"J) `xaTY A{TA5(QiYeb Xʕ+$@P05%B ,0⊅zhs˵$[leސུkz t)SQb@r} Mjkni`B~A]h&PAdXn)`"9kWrh'Yŝz4˭`mrK-%-[7nxZv9U gYOO./NUvX dPݖ*!\(K4PXlv^JٔłpǨ UrI}T  Od" ]]Yi ձIt?4w 9X ,&BV7 YRiHJt^] KJZm/TZԷ/_tTZ"[2Ƞ`mkY6 !cr=OdReXeGK}+Fi[rT_ZGkƘIۓMbi;X+DLR68VZnZ.4j=S$ X!\QPB&/Ԙ.ke6BE.Vl,_NnwkJA%7G3Z/hZ)lRS{~HGip/p`̋+c!03=W%1." fT %nS=amLu>5eHyyS@4oL<xpW?Qbo2~KG:1IHZM!!S%u` dEt+ͦd%Q]2*߲#qAO^ F7 \ygd$4Ҩ?›ArЅL)JXS:VPmV ShT@w!E3۩~ ՠf]bu0PCEjUJ檹5lXñ` ]bCp=^D nMI/5o4.  A ™"Msp/tl}B wGJ)O/)2*e4SRdRR=b~х/>Snr{4̙v 3@dNW;)ǫC<:YRn\aC&"fSd#3],k_zvߕU#gjIsO4c\Z(“l%=9iYR謔\"_"i)&HtranGܺ)X񄗻v$M [O)ve݋Hi{e0m)UP8ЃV+@Saa|IW=3".| C)!Cօn qh'wGܸx\aD^<.epXWo|,ꓵܞJiM륃٧c"O%u9dsRU#KJrs/rQT&W|9rM8u\4.=JVHey{v/ :d L^7R%eܺ!u7u 1يu?M+M/H[|\ʅ{ỵY]ޟ*njQOܻ,QU]AYjK̘4i J˔^@ש\RPBLdV]'}Ę0Ĕd VdLǯEKESTA\0Jۤp@UMTx0IqX`܅ Y`B+̂I!ڵ m-a\%DDS!ۂ|_˱HNj߾ D_ ^aa{^UWrUHO|ސSA$$Α ªN׫]c}zdx Fl"B ]}lD)SHFCU`Aڋe]=$Dљ\[X^<+ 0]W0$D@׹ S Ydc6 9ɀe}e#ڭڪS Ί`R! LFjJ¨N+E5)6aHm ĴąT [Xvxe]3B&cyTePN]H`^H! V$G!H` tLS (&R,{$e e9@dM֫ї7:G"H$#;WfPUYߑՀ uQ,abKCt*&M0eL+LsOvx\+TSNfUd [%BY Y$kQ_bcR!B}IQ} e%J>pħdݝI+4H•ABe$}"xK}e4 aЮVZHIGjɩkl[ުa5A잗ǼfUV 7ea Q9JQCXMAhAʞvՌhDi ~Ԛ]5*L?!Ļ ޣ+MZqD_piwX`lЉnv^吺GyT&dWPL,rRJ ` fj ETb B,)!B"j klW.D?) d@IL @HƈX(jUP ^F*p% rGT`J@|Q`R_`ʭ b+-PbY"Vj&JM52grV!:V}`9Zw$"4&>ΛNkiIYihAmHFDR D}Bt%Ǚ+admB Khn8NOHO P]`#,t6HO[` job*odx TL.LO PTH]Hhf!("kjdtIAxZpN ht@͙Xe ,eEh``H)A让pɄ@g0%p(ALZ FjI jH" *+'1%uq$Ljm],~é%N  J]x"Aq w$?fXf0_BԚp Fr\O>% hYh]ذZeha2+$ޮ, $1"Dt,;t'z.z WrX]}mLU^ G8E\a9RwxFd]67X@~4D+ ,]B1̥3CBD>Q 0rX-6" @e $Kr2U"B\8&iþ'ESt+OF4EKCU 8q|a{ O Pϡ4ZXFx^z o}/7So P%Y FD ?5*Fh~HRnĺ״DPpC]\$K( s>/Ys$WvE1s *CE]v{rF{b4zڐ8142v.n,puظXU8%36]s粒wp,ưㅙ {(j  VlI(S&bHe5aWr 45XA ฎ[>W xpwYD|(3\W &F[F?9_ozvmEThh9.M#k8Yk 87W'Zg\3ߍ*A=NI"5S9ƄD,Yu.~FL]ZSAύu=K O&5 ]TǑ(ֲ0uR<豢d tr恳 GԶb4|ƁTxY|FEHs1OWOhtXʮ)EW"D_Z-pJD#ZH>Kyt:Yf>{X83 d Q{`O9d6YI3N Z2ya|џg{ANkŎOCf@T JZ W4j&j0;s!|[=YxԻOXt &?[hOB]hۻU\2Kac'wycˇ]|ƿY8ZaN϶D[i66#_Dcp{XIS沱4մҌI#)F'70(:PJ)(V ],7C K .Ul hfLZiEA/jeVvԖ;DLKz"1-Vh⊿`{.-~;:".7ͻ^E Ё$hP %;hQJQH9-rTu7=Ne2mf7 ?{B%ZpI^N>K\sz(7 Xo+xنu*'XAuiĶc%F`QxLg ï974O&C(dcE40'(9 VG<6]rt}Tؑ viVe ?qX -+ǫӫhz{3( gKD^P/'%@4tXw '%K\u03y(ݔ#S@8  Qr$`Nȹ谐"F(19XuPPAvh P"aC*eB?J]Qhe@Vbc6%-%mi_D<ZRvMv%//@ BȵAMW"#=I#{)]h!I)Ńr!|E.1O:G9(YAekDXKƮv@20q$~IҪ@ L T M,TuFR0>%/' 2ʩr*3~?% @>ZbT+RDtXu(8WI2zB%\p_$[QOu*#!z|N/ @gKY2+hl;vInrʩ#B8,-E#>׉E K! QrLN*9WuNܯ̯jii8i:ԕYD<jQQ'Q[%+pe|H$il"4V@rώZNt#~&R; rJ. {uAЏ:3JY0/9yرjk~K9X'/m5D*N %4fP4FJ`.H)R?łӢJA nE![Cj}77U12hdDUhZ4v>5.}~=}_{|<`7g㺲 Qpn:=4\!T{tJZRzYDtאž-2cGxԦ49-}\.ʦkTO1b~" NmXn^Nl02 $,%DӶ5m@b.d(CDON#CtP,j"LA"Xak6"D b ?mdCj /T:ڐbf#{E\kDhfzg0"^'*Ю0Y^4NH+Lй.>ʒc.M" LONO< &Q/&^ Hr#8T qfaTje-vqM،)h/?MИT Ӓ c7IhK odzgͦ5P&#l@xD0- Jvhb8hJ F`x촣C! %eNJNtZZLC h&Rcj )?\&dh,ǔ KJNn|eK { ?(Ί$x,5(^lORP%Jnʪc:dPi<J"Gs>(zH+X >TI [.npƚ@bdBjD,$P'T30+XRΜ.CG,nuPGlQVrLLi6![Lk& pSrL3Hbn ]}bd.iF({Nq|L,D(S,*×rv$fJ"ja/bcIX!f-r3 `>@h:g$(44HN%IAsCvJIhN("',3gl2GiJ̑;iO3=PA'ڞK2n6o u3p\2#*XJ -ħl1TL^ \ZN6g?-E9%:+P T"6΅K t`M!Y_.K`0tv0 iZeD@psnH-Ѱ@==g*-T3C٢T ZDAy,'.!+bd!0BtP--Ǖ*BbP,nx(TUHOH輦.O:x"# Ri.H9UȭS(;l@n(&2D'pHX._s?t⌇ 7F`dž Rkޒa .$F<ʻnUQ>q1c5aXц_@?n24 |i6ΗqS\g=aN4HNF@zhtDDBnKFwKOsCŅkfuD":%;aplus-fsf-4.22/src/html/keybUsers5.gif0000444000265000001440000011213307215453036013305 GIF89a:f3̙f3f3ffffff3f3333f333f3f3̙f3̙̙̙̙f̙3̙ffffff3f3333f333f3̙f3̙̙f3̙f3ff̙ffff3f33̙33f333̙f3ffffff3ffff̙fff3fffffff3ffffffffffff3fff3f3f3f3ff33f3ffffff3f3333f333333̙3f3333333f3333f3f3f3ff3f33f33333333f333333333f333f3̙f3f3ffffff3f3333f333f3!,: H*\ȰÇ#Jċ3jȱǏ CIɑ` e0cHy͛8sɳO.ĄyK A! 芌JJիX:ty ]*eҥ]hR۷pʝ5( +VX9ҤI(- t+^̸/a` l0R}LӨ7VTWGYfgg_ы8/Nblռ,YI13mzEKسknὀyfe;`e;>{˟OЧ+2TR̕`Ba_V|5 T d gae B,j%JT4fF^z&`M'DYӋ0t5y)!WfeFƂFvGSLhVlP_mR9rxQ؁%Z%x橧}/e$vX78taם{F*i,[ f9GrIR"oY|4iM-eS[ ִfbKoS7{\`/&wh 8ob6pׂ^@W}_wdG&n7pr[`c ! hKY^@wjAcwl[FFPFxstxw'Ca1xxy2uw|hx Wwcqxq`X/]!|}Fq0ru\"&m]Bh[u{W)66ph؆\7-X`/e d}s5%|G!,"bH8 %p p 䁌f%>_]1{)AȈ"hXk.cmocr]r騃:yr ƊB8hhcˁ^JP$!Yh P 0  h0 `W~ȁ·mwRg8{grWxPA{&rjxkhnGnx=wxce<؏>)yA'fB ِؔ M h^]efe{o(rgbCa`Ar7xn Y ^'X7fb(.ȔP נ P `^OOl@/~M`yWgڸW舰T`]1r(ehrqyosz?@Vu LpՔ ٔu(zkm7MWePqxYw"G_+肹d7;I~闪™~as!ܗ ٘Yi I)'B3u^u—3a)Z~3k)!(7fsu(^;zs vf1b#W T ؐ*HؔY\Ȝ7r3 {Eh$h$hHe驅s䞑3V2s=|dVc9`<:='чWQȜ}ը:LLjŔә39]*!#ghZj]]uZ{fʢ1!.䖽YfF(}|ڃ 릝#R  O HIO)jX(W A(ovjzg,_)/jwc5Y9(}76ɧ_|zXr?zG @ISװͺP(&urH!>(gswrIqH z%^#J.1}ՐP ڊjy ~zA,jڥXxwlh8x*;3p:`}{zC`(ʑW H[ڊN˴yPI* T#C_(&#˙dJ(/`b2Ѐwi6J~}ڗ<^%ҵW:9Ъ  L i^!J]mə;u&u^4HJX;W4I/W{68%zzB!P+XY\["J;q{b |7Lsm+fFs립#[ClI yKJ{#쏞/ ;tWD1LvK:;)jgȣqĴῲ3âI1`Hl^h^ʴX*r0<ܡ\ߋ),tao3(Yו {)n8 5Ip^`yx3揀˹ɊǼI{*1+댜fk+p)xNUL+-!+{;[[s,ϳxfJ!,;i˜( (,#KHq}j ^P ⻾_-a"^@Mm؊ZbBK=;ŁR׾N(-(S޻ sp34!-SKm{nl9G#n;r;羷zn4uv^ЌeGR\|?)\/jpNF9^|ɗ ̋N䷵6Yb_QY, M)ԎmnG(su{C,5X8B$+M|#r&^'^=ޕn J?[Jz6qɬ7 eq{( k6&j#MUeiʥ_OY|C ]$~"&X`8]aF`֫ȓ.)9pND WdX.\^HD%D0+V+I)UdK1a18o֔EPYdAMh^!J$(V*+RbUKI.*H iծe۷ȝ]y+_{ ЅBƊ@XdJ+@DFDLZ+A|nn[iԧv%nbd% (Ve/|TZ^= o3-ѥK*` + Bȓ+ZTbvd!Vf(p (HACdk%* ) Q*D;Ex12(=+;̿b2x+A !QTr$]́h0Cvk7~C**80r~3k$t ƺ;`F:[ြCc*-2+( BtѴʩ J62v[4 Քp,KlRX9.OZ*ZY,aFXQ XxBW?uYH'֮@dHV)*,q+󩱔(Ce]T\1W;[AcAPwa5 P^iR.&K"-J:N++3a;WH."sƀNȡQ:in!\[ur/#rQUSDOF^/|90l]q-LX.zFQFVkQs5)N&xT,N̐l*ëP]t=%++;Vcl6óFX/>qXuh`pJ/2 Q rˍSW] L0vcUsP{DbG^nl\~}5s}w.<"*Tޤb~CD8[eԕpMu샓^<=-2 "gRHJhWPw R)/m8[J"tk O^/}V\cg7FnG4?ȆJq@,f୪A rP##B0&J5b#{3H"+Ȱ@u4r\e  xo8l7RK*\hGTE$*"جDY-=Iڃ:腽Pp@ )S,h2CFTgPѲ5nFoKOv@g_Y;,4vh_TE;&'[e\.oMq0CK:U.+]‚@ B <7u dVi\iA#ץkס P@t!; ]7֬ӫ 5GͬȐa"Vm;>s,#q-Bc5aN!>~yTQdúAvC~a9j#۴3+#SnR՚"܀[+ZvCw w` 9 *$M&S<_ňޫL~ZyiLrk֬jtՍq썙{\8n:⦤bd,GҀJADneAMn'-X]k9:.O+ &HW~"~c#\GXg "H DL$Oqj jAVmfc:%uFDѡypsCZ=nh5Fqq\^4崭Frk]g]fl*{{Y7Vo%io!'V|^^Sj>LQhF/>ZѾճ!b_kY +`C b[ 8!rsNZ),$k;y;˜)2j(5l`ѱ=Y@Y0@QȺĜC/ӯ(rR,~2+4&˻Z P$@=HB+p:(BH!ᣖiDԪ);Hd8sY붚-)?u83:7= Y8? V6#|C'AAs+>3" 4,,Q7 {7%VpV\_yZ ,*4^Et!ZJFh2Ϩ#$P/˦RD#u1肣HEV @IHC+G&ѥÒ;h _5QAb<k#" PHNiL%;SHc o4?sƵHH Hc\ǒB,.ʒq,0lɖtGB 3ω\E`kHX"PrE  LL 'Ɂ9ˁʏd2^EJ N"'VY| c1 M̥DIz! ¨$\i؛)H􈍼l W+JHИSYhIzlhN΀.эI :5,H ҙ7S#V@ *x ")=P,+\4,ȑ`1 \T m\NH Дp k+:P 8$$>G93QCRt6dQ@ӗ ,TdIOMLAq+'" d$  8F% ̼NzIKXsP!!.COR 563+P2ˉӒ1#al QˉDD#MLչP@Ĕ.i%"ٻkNF+oKA0ã4eOS͋]WE tB PUF=Ҵ"ү<R/80xkӋuV,X)qےhI>R"$ V K 23٤T1M )3 "S2Q-.I"ZOV dFyI4'˩2 =`*`u5[\%+ YJN$GΠ,(!6YCًY:6̕QE%َ? TV,Z-V, Rcݱ+;v <-[!m=spEƱ"۸ ?"B 8EMc1Kw9,< L,~ITP:ۙ%S%8d  F<- P$Γ ֑  ً؂KWٜu5! x Dh;%*WOע,`AX؈(-%ɧZǃPHF*C!`^`ѭ4E[|+WAPG ڤQk Nz̵P}4U]n  Q$=-% ?A-_(,Pݬ͑)f#]2f'XZErdceV@LkΆ et=442Ms}mC~׹ 2߀%#KI%L$M DœxiI(;)NCeZF5en:1)q̸Ll5.,ӊ/A5rmNTlvxb iK6t6JTG)]kѽ3`iA XFqKFXݴ=]hY}tr,LYNJ̞  F,(=M:nc; (IiKZek)9@jUj֩2F÷\X~L`::SkDoQyvn+]C ._%TBr%L {ҍ|N@9j(3No\']N۰59-I@~P"lIl N1p٪0Ek*<0&ӼnIf>.V%Y=KKV (֜yb WV.ˎa[8gC˒ێ@zRRB .;W덱(OY  | 9Pk(Y;uKoi|"/@XPX.o˦*d=<'ȃ@`PԂ4^amvdC 聣#ȷ9%]\Tk;@ى\ξntE- Ic"%8l?춹Ln F=wrσ*s9pvowv׃#{ ˬGwL= F MU9׹&Ȼf8ו=y%̿޴=& vRR;S L\ry=ȃ<@'pwy]V56()K&V*hR5m FyQMHijxM : ǣ^G.4~MőqC%q$Aߋ=(=*xy_wv'+8|vσŽ$0 0Prw)*E^ 9 u;SWkY=l Ý6?g'D-_v/("yuGW|w+jyǛ0 2P7$栠>zACs߳6-t ` „ ,!Ĉ'.\@EHBkf5UY2`k +Wt DS.4I : 2Q/J(U D)b =Nr*9UX)[v挴jg: ^+:\Hت%8T4A]1Dd-]ӣ^"ȣ}wq&qlSv m6|Z+/9tz6N2_% +,=;3aD"-)se Pì!,]@P@v=Hfw,4;jl}lfHC#V aUQ  HpZf21I"sdVbg)j"-][V(c/k\𲂃<#0{"y8H*a|֢Si?,\U&"ҷE{˗.H%fV&͓2I RdsK|7(2*U`+$ ̚b$- dp ZيKN`˻RW褻tM $$|&fBOXdaXІȧD&I\%# {m8+@ړUe bO4xVe o7\Ĵ#S- ^7յk̅8Ik2YBd oK+yFav19[[,r/QA! &SNsr̖^>C ͺz0^d1S蚣+VZ! wmrV ugAMOrƠzW .<9tO\(dqT2PנDX\j>DTm? a[A:?}WQje4/d/( ݛ`JnsΛv vPX%nK!!wH:!' L {[f-%XhoY[Qܾ+}r~egDlՔL[+YB]H ^^[I \aE!GUZQ_\> B4I9wHvRT^s͟od\n)Ȭ&qVsۢ ZM^Aֺx  E !_`!]nN͌l, kƍF)! @FM*OD\Q $Uh N( ]XA!*_u1^BYB |] Vߐ 6> D#݋x$Z-  "aΩFY'faSF@@}ֱJ\!J0QRXNr0#(c   z<]c  Gį莳 FX?֍T;SƎSc(!17 ݖdArcŗפFD'<0@.3>X- " @FKJ$Lb@!bM|7 G08" I݅bE IF1^cݣ} Fe Į0cBąUV]sm *p`$9L]P$ յeT]/¥ 8]@ ^švSa _ x`](HKR-5&4tc1 ؊QT׽܂I $K i $6 _џ8GPeVrf ~|Y!j#i0ހ]TUgG[:)@%%Gr ! a@4f &z"J Z A|Rty߯qlG=STUaSc&!T)LT%lA/bfDv4z&Vi,VAZD,`EV=hGbh!U Ruؑ"\e֛a#]K)" My\< SX pA)"e Q>""O8b Zq`) 8b$jJA)꟰AGL`0.@ ,@$@ RUdrE@1hD G6f@lX xNgdtAшh&Bi"$Dc B뱢h-5ky#"؝ <ls[X]4YilrB4B @պu .fY<3EM r䅌OvlV}=dNp3y<0& !ZA)@U6nAc^!,]J5m edU }JdX6& lV`TqA $mQrҩ- At#c>hˈ H1k> Na$>xF)&6u7` 6 UE i]sg[L|*-톜tA  0S͍ |uwtMF'FClM ƭϓ8TJεF߇h")Js)@.Z7cɸCvnWnY8C',-.p[/Dod_`g'_ > 䒙dV)Ұki 88J˔L[ \폍|R$o!S>3J {Ap8G$d(bd.e!Mg7X/bnh (E p- ! ZA |DU5&ڶbW(15ګznt#F 0''5Opy:rVMLiʲ*?m@GmnC,]}$jr +\Fp Dpun-]*w~ &/ Nl7 "Ck", XТ!m>MbMkjy♮)*24+,9!6@2Xd}$S/2?AĀ#nn͛t@ ]RnEKFuKlTt3oheCtiaHY#X$Lnmt/W#ƩȖWĠ3+iR᜾rn2@PҍnN{ܘtPGZB3wht31 |tǾZIDU}KiU;T>,րOp^kzD 'g y}ȧpP?&ZUtXO2iZ B[̋5`ʱtouFA4Gu _UdrOHC FB=a?Nb 4TpkF^3cYH_ZW\ى{\CLWaE@8npb>EOdE8< N'u!d>aJFֲ&ġvňM4وJl GZS=c)scwewO&qdqI3ܹF Knz"<4eK&Bdf`;{4ʔ <@+BO  0h:5\0IP/C.*+Ȣp\aI1ܠ*ړ .[GӣFdK+-ΜL(mb-.l  *- @n<޲n #hj +! (#= AXEVNj%LrTR2AV L5DqCP各uï\""# Izpqf D"$("{Ԗʰۊ=0+*\rJ/T.FX*T=K  Ȣ1G4I`Ax˹(<h"kx]B<80iz/DXI=X/ȗfl"UUbTN -\\e(-+M4:*oTnŔŖl'RA`Y;t Dкo])].fˋvL Zh4`;(."X*#$C tٹ.@I2$OJ2Hn .rv0Loĕ~e*K',$VDrI5I+Xnu6lT_LO8G5dhBs'MJtidD%ݸ4m&7"\4*&q;M M&ޕAZH vaLɢ ].0 ^ 3GC2sc0 !Sena!ݚd5"bE lMso 9 !">ٓ;)I(k;hftTHJVs`#_ռ P$#)ݽWi"P@tJo+zO cn9_B:d?I4[mW)!hBPƣrZo$-qDoznNROgd琩a%)vo[NC`dl<@dƭЇ})Zrh +¢J\,]-@"iЯͲf g@Nq:;8-8ajqC++$M8(#6₢#Q i:k0mT=>4pwźb䫞-k蚂8<Ĩ+ffHv͘Q"C2K K.@bXpT "65or` h`&/ JD@fqjlO P\bi`r P490d\"8gd?CDdzw'X)Pe+kaȈ*HqDO, 1GGΚԍLh q 'W5*  u`)iQLj+1=s,<*GNrD:PڂtP!m0s0EeZ)?'1kʺXAd:΅RVḐ7Cd0$EOZ>fV5 %͎*a/B6E(L onb9Ty4 *2;d:B U=Ƥ^tHGƴf)jJ!8QҤSĦ1W%b`0"TzjZUbM@MI"Hڼ)T|8"N34Eq.EhpVTbB,4*S 4absSK4={Si89FrFFUworLErJ4LFnOLT\J{FK"pc$4Bk/yh[}-JAsUy5m4@('vLp~5&?BW̌%(eQ(R1uZ$XS0el,԰Lt^OS?nCzj &cc st92GЕR(e"&"/fB(vab&Ąl u֥YI%PdDt+pQdE16t`GgDŽȢj0+W\cxɴwQ, pC[iP;XJ_VzRVB%"K,ⵄ1B&d)`DEEk0PvSi~΅(V^: C4 ,&Bd,XtK %O5g::GdсsЉ:_G .0.;sb;bLHfw[o4ٓgP#jzd (T_ᖝ{UbA zW>Ro5QkZs=­)'7LDO9PA*#s`euvzZ΂3t [zLb *CaXt$AũW)Jj#:*Rpy* *lxK%{ (#fZnmfrjEa?D#e3FldhgJ=&8 Nմ}- Kx93;DkCqfo'0),)ȴ.R ;5y!Sj%2S"]%_Rj~aM?GH/'t. qK < +:\@+Z\h@E5H@ +JhxrɏY|ӡ@V Vj>dEPxg@W:@ZVT\<} T*e5ڵlۺemVlee%ꬸvmkѰb*3hVY~$c͜ 2Ѣ4OvJ2H*@c:\scH$N.8Q7E8I|1K1taa*tͽ7*+b8R)MOeHVWYH)V[O 4)bYr]ZM^V+Јh^} 4{bP\@8R\>jƔdO,&lJ]UuqdkGC=ȥ@J&rQt%p 9Dt)If @Mg)iXœ U8%=EX^ pTR4VY%HbxרuE"V؉ѰVč$Heņ萫!R5 ,jd Hm[+DnkܗzBf{bzh]@g 6}Oط~=~{^%zxX[e`ZJq *\U]yeׇjثm*Íte.GvThf+V >KhO-}RG3IfL~֙K[C+T1}52d%j,au!fC+|UVL8+~ U^Ȃ0sY%"kl$_# V0NM "ż-ju1ˆ+S(ѡB>*\Zч-Py"Oby4 5 M9KQB@k) D 0aQ ,oX!qdZD Q\-DwҊ%h=n.-Q$.ZoAz@~ >,'ʢ t(CQ;LX ʅVZ](/WڀemR*Si B-nqUᏘDI!A`:ǟf&Syv 4ҿ4kZYldӤ۠r$L5097$hVpG((_%z &;يȕ6u2eḶ}1[cY,$! BtXXTT#L_Y(iś\Xy"s+][D"I;d7)d7a QAmW*GOLxxE89jֶuyדrKACE*\Ja:UUTҊ+UĈ1ehb`BVY]Rb5g(epv4gjTzWXN"$Ū̖FUC&(,gY9':ie+d$2 ,gio6;|[2DqlbDV Zd zhf q#eyIToǛ-)3Er؆5;%toKW+xUٛlrG&z N}Ȝ#JRR8kSC]LFTD;i5a )+-p8g.qA b:dL9[m5Y(&x@dNp*Z0%Cv" z۟]X4VylJʳE e64QV[4oSn}l&Bp"gunJ>VX/ veqX!|-{߯B{1$m1x# H7$_2?$hŸ; AbpșvK}+BT=q<&"ZJX$(yT,yl2INƆr6q",qR2l-O|%\g\2~r9GoQv 0@0A۷ WeC_aUUb,8 D R'JgC꙰w̶%!{[S_b2ۈ&C߹=;C <ޭ0Z͓^!)pz~.-19Z C@̳ZO܉tC$鬞ERiٽsh'] h`Q4 X;+͐8ߛ_5| PbϢTwLREi41>-y xw'3 Hqyyy#ufrVCP6G7MG4^5S&<>Y&L` a"ʄ*PXKV@: E|6 9_"\]793~fSD].Т;~A;~$YUUA!-jU1\s%q-=w 8J88Hg.%74r%CzWIJZo&С(X>heg֐%u$9vE]n*ʄ-%Sb@0"XFqZbRew"$^\˲޴o_X$&AQ *-ysb娍H[KBUqbBWPp3 hw=6I7!/"c=XRJ21=e#'Pi"3Ng( g"RħXj6H8}@}fr#2hgaSo7^%;Niwz(oh8UR:Bt)66$'p,FEyyxZc>1yPwy&1./U0\tO)&A6AusI!!4| a*I1b}{"cu"8)0v9WQw6e;De:S%R;IPxPEV$%>MRPp(jZ2MQ,PPUc?u4rajsA dj )96Ȓ1u-X;yi*H#myLꃟ*Tx@Qw{'ˢ33ADiTWI,8rb16-pI-c x', e"#]ga=/H(YB=}l9uni3 "ƄX#;|oA*yvB m0od T;KE$(,{@[I i2yFUV[iiHy:H/!V/rw Xy<A1&ID&&L̆%6uicֱF1{ViZ^Ƒ ӟ-Ec&8 Sart:9moR"F88h1Fo4Z%F\#Wp~6Sh%HsjXyة [U@q%+ GZPE&PPzq,9`5Q+5mNHwӄeu8ux6X FfS82V0~zo7@C[tǣf35 aԁ6qlZ>S/uǂd|h|C{Rkg1&S6yV0Pj3b^RGf$ȥq/&O<19، cPQa\yP39a'dbdyW+3:]08m]ҳ畀D Xұ]1W t&a.K7DEnbXDGkR%/8C]40 Q^̂Ocg_%/.@P9M]iH?#^y=c>9#&yr 2QDB&>޽jUsYC+@]c]1.T7|ۂAZt|Ydgfg\FY׭V}̄;I9;YMMa!H@Dd*B Y1-k-^j=8p+Dq +VX`%4[ެI/[B 9u@Q/M>} +P|ɢJ͖Wx\FV[2 fǢ=PbeϹ&羬2VBeO%Y\Xt1)Yg a`X+vb(^kumV֮zP6+S'6޽}hlSÍG|x쇲2_8;rYfv{W 2P= o+D [5谕PgLɣHI$d#ǸɦlI&d"j /4Aҡ '* ,`k%",V.k򊡧bjd D(d ڲGj,y",D;ӢY\hq-5IE3Δ@Z*;4P@c{m:kdS6YE ?'('->yc>ASP=UYUceVfFTHT\q% oCj=/ ꁢtx Z/< krE F@/#1K υBb`IlI8+0 @3qъ+,AJ(I-HRV8@ #k|k꜓"VXEYN@PRVeAWFUhe;/9.%.r!<Eljs•jB*o䵥.X-,)ޕ (J.Vʼ2<[)͆K# \{֊RcMb.Hd{hLe{Y銇b٠qP^;㇘tg- zR +jh5iDD:!Z dkH/%,jQED€3[z!hu rS֔\ ҥJ@V2%=]+qVxŤ.{ڈb6B%&id.#9]hN319?k$k&O{μ;*űEgzyB#Mm4gRZy8"(^'>z,_|ַ>WJ5\YmWP$ Z Sr6 %S: +F]7r\'&\,rb B`i#I^ 3tAl"EᚇYuI(ORAUg>X"u<0:k^FִBd#w=KyşWB@*яTP?>eZ:̅@jdH&=VY( :iI~ ZIP e 'B#%N/BZ@'S>իQ&c@4P*""o&Fc^ |WEV/«S;lq6k4OR,X`/ZcD#53S(*A 1hreV']'9ktCm6AjJVrI,p̸6C4lp[B5n|UG X҂d\\nU5U$bnHx14>Ѓ1O)[F87+~$RL/c/_a[ʬ{[d-npB!+ IZՊ샘AغPL.ɦMm[R"$P:#mo  $61%6FqI!.#.4VYNHΔAQ f٬o h}g׍lpΧ[Z BvŽ4\}8lxŗ IdA*ΒupzS3r6(]E^YdQI}1f026S+&6bK}8f6܅&Zċifp"nZhn6(7q\D]Ǯdd5] ;W"ؔcTʬEB |Qd'6"y o-)/`aY^eA ʼnQM* m"4k5QX09-EK  `b]x iLG]ض>Kta4X':11>,r3o*i[5ϒ|*ʱqtIvx!s|˶Z=ڌ\tqzKH`=ζuΝ筜7![ܘi֠X";Ga!<@PqS =@Ax* øHk="0 `wQK@AXp)d (>Be[Z&їȝ80ŸH5ٲ CԠ@xlʈ/?3/aXY3"#>+4֐Hz;y,ЃR5SB TEc:­=ҳ+@+ؓAJk `ě۩!$ 1B0 ) \ ) -1@ ]rÝJ /)B~([ 169;%z69Q62a# ?pFĎG0B-zD٘K݈3q}1, QN| \:5(/@$Ź@}_@UA3#A;`z3 )S ВXz%vY:m dzPJNK Y$3!0Kjhp?"93?2)4TD1qHLl7ǛIaDc,@Z;ʣN죕Eq Њ `_( ďV#$ea|3CaZ {ŠB YbAZ XΙ2(;9 28&z&b"!6rٸh,3س@pDh>bLq3+? D TŏKk ,#$@D 1XBۛ{0$ʦ98Ғ *ȭXN.T.ƜEH>Fm38G4 mi% =KݱHUxTp˻'G\O)P8b I<k8H!M2)=٘s `MXS!$BJ0 a‘!l ` N{Rj2ϩ4oSlD#h \)\6&=X K ;Ӊ; ۿ<\< <1j)Z-0 \1kQ]EPU8rZAc@.N?V(%5-U(MD95$B9h ɁXE%^~!]䳉wA(~*@*YCfݶsp-+׉VذX̘XbL-H㘙(4C)i;Yy8 A1۲ CYCŐ-%؃ATXl (cCď0,dVET-8Ax!xJ%tōƃ: ?+Zy$Oy#RmڭrߑDX)۱BLAyWJ֐7h &YRˊX[%]|b\hT[ ;UmKc1s(P<]/`1` 6Jȑ{KEWข0.l׏{=Zy +9y5عe 3^D۠ V˱{ӻ)4zr vkmE_n()A8M[8܎FH + ,5ق ;k XA K6հ!tBlU=* p5?J-%`9jCY0@'l+DP)ftii>44Čl W>_s٩~Ug ۥ# U` ZA,  dO)QhcE&ԑSj۱!=A,'WX&8 "`UKC^. $¦jBh-7\x|+DZ/tͷ"_D44Ӷ %8㛜(( kma[ޒNN]g:ۂUԑbUAG =*-XAVŇ<^8†5#f #th} (GˍIE\l4B87Ym;&z$hR^(PX8/;Gy>S n`39?E%X56R\w E--$ %4 [1#{k~ 4^Yg=Ŗ NVI,eokOo+0r@Şs2@HY9;n˨McX9Vw6r}A%-KozUɌ,*(yFUT؜kVXo솊C˸5oc#/D=Xrm >scBGk<|?>vHwiiҸ \~ڠ֮Rt Lv E@[ěau3F똎pri W2l㕿^Uŵ&OXw܊sF]PyN]`v_`3WmwkρvN‚0e1XH J<X/% YASBO>ajفyJi#t褔(1BftwW #G"97ƪ@VZ@k`(q"Ŋ8Wt#ȒXB.eȀ"Ê+3ؼf+>r.^TiQ/X*}KZ`- v,Y+M{ ]uڅ-۵Wbt*4kt^:|r5g /cά=X9tҦK_A}tVy65Y iέ[wݴg|ao߸A34 ˛2uȔhAή}vܳC[| +h &˼ţomY_yD[W`V(DJȂJ,RL3]AN@D!PŅRKmW\rIURW]E `yu `UYieT`K\lFTJASWF_pѐX4RK:PEfNWجZvhkVqȘBpl @s'nyy~`+ʕVJi}yByANJz} 441|]Zqt`IrK4A1C,Dd]5ԆR8&UWYUWX/ˆ]>\p%SB( MU]%6d/-XPFIe^Th^Fg`toy^3oE35D1U؛Y 5Z2ڽ^iAp{^cd Hd)-ɂFtS<=,;RLe쳂XV,t/U6d}PSzh6QJ6:kNPS;^ _,V0i{,)'fMolۛ"\Zc¡aɏfޣx"$ꤙ^β@]~A,7GZ1*!= (*t^}uTP{WF{(hhU \ҵk?+n9[Fh|cyW*iwqyi '. cgrbNÆ7rMXsR ₫ؗzȝˍnROy;;f 6xn yϖ'4Y$EI*=XP1JU&i|)L[p4.},Ē)hmPR{X (V bL&S@)@;ܿg4fL` Δ8(Mq]D1(NMtS APGd>,YB2'<&B؞Vx*bupA 2H e0iAPY24&,$5BKRB@t%(sc̆b‹OCf:/R˱,i.f:!v`ǝA&hr Z!k/ax+#j^j,2tI8@@R Tq 2d c\Ƨ+iRUjo[F(x3(aN﮶bdx4hE'8Ji! Z9@Ly+Kʛg?zD M¨< !"lCS>*EăMА:E lZPZSͬj+$Aj,fsA1Q྘mXn 7.g-fk{׶cŵ s+)ɚ?풗@]m df3ŠeCapA'ebkXә05mnB$>MHk1w; g~>֥~ .w#ߕ'!OQ]);QmBn [ &N]oJ#dW@QIZl567D=k\+c5% RBOMIT K ǫ-pP / 1i5!i"1<rd 9 +4SGuABfkdY)'ǘQj#S72jguE]5hoD鴷MWhY Q{u#đD40A5( .䡇M&esz-Y$c K[PXiׄx` bǶnwzG[faYi;"r<eoj<Φb&e q {IA!YJŦwW*PLηlQT[5D&7qYGA`E#\hHAx/a2m'HڀsOlEC7:fi2{jOSo2fg mǺʫt Yl7*Anjk8.97F7¥W*G S6a(d>$X ]K`^"B&5:SDTP^5B<[iT wLhs|TEzpޤ}XY +=qb9مTY[Q͎ {aHیթhdA!# _DN,% hIeΩaB@ tĚX ֖Nɔ ے4z4@"B]qYID &FόDlH[[n|ՙ; |AIa25 `an,ifF ŭNHLE pyF$Zhؖ^ĸb!ndH}q :MM` >QŲ['<ң͢-ߝbCʄdbm!YҦFHqAl1FkR^Q.v$Vif蚗ЯN\@)SPXX)O ;Y8hb'uA͎d%B2H^!a@Ib߂ DB!@FfktPth=-HXJRo͂!Iqai㪩G 0Rauf J-%@llN% L$yW8ˌx@[^IM|&!'4R'>'< ZEe^f!bMiⵆ`z jhiii&KPLZ4[6~!$JvDJ}!iIS8ˆ ð.j >]S :]#Ąf%Ơ}ȇlQL _ XSxOqK4E%eDH9EME.m'KTFf֘V⩉fY}I$5JVhfQd"OBQLL2DkR! NїU`I(Hx-OH$_^IT_ Ui"peYKy@Ν[Dv­"U2F_BEYW0vE~xm؞eQj 0Dp!/lgLpNjz$"fh5E]U$JTi_ưD TŜX9%(%ܫ;`=c)j߱*KPciƒHh&X}G"s|m+t gjHǁA .ʕAn\jnZUb--WXvdTP[Y[P ōT : ܤ |\&R]BZDixi.-FiRgV+ 4 KFm)vpM5n6{ԩr0m{jj(slه69* )2ӋOFqHW\U E\R,C-TŲo)JPN؟fŁi E!&iI)w` nlm&E蚁*^^`(}X2B$>umZIBj: VQ8:}"rSYUX)fjdo ӔWM.i*5@sVhO,G`2j0 iOPenqYbБFFnN0SxTz Tve[U$j-Xk$ie~{ڂ"0lP` aޒ/ª&]%\ƪXu urZbj{pQZznl@<۴r2Z|s<[rгL5wݕs#^]L AE(4t7Q݄HQCCSE/tEotG/Ae*]s?4J?KtV*eLӴ;M4M_\N4OȈPW'<usisDw ٖZu tD!`u0st`W03.yXX33"o)tȵ)Xo!B 5[NɵW M]uuW_^KG5^ h5^^C6a3`/^g]\uuy6egcsv^;v[ud_uTUcTǩ.]uuPou8qq oOU[5vvv`X`2ucwvkvsww{wwxxwyoB@;aplus-fsf-4.22/src/html/keybd90b.gif0000444000265000001440000037442707215453036012675 GIF89a~~~}}}|||{{{zzzyyyxxxwwwvvvuuutttsssrrrqqqpppooonnnmmmlllkkkjjjiiihhhgggfffeeedddcccaaa```___^^^]]]\\\[[[ZZZYYYXXXWWWUUUTTTSSSRRRQQQPPPOOONNNMMMLLLKKKIIIGGGFFFEEEDDDCCCBBBAAA@@@???>>><<<;;;:::999888777666555444333222111000///...---,,,+++***)))((('''%%%$$$###"""!!!  ,H*\ȰÇ#JHŋ3jȱǏ CIɓ(S\ɲ˗0c)`r0ӡ@TܩA͞H*]ʴiƚJի;'`ݺPaŏ4zhƶ۷pʝKڴXA.Zihplٳ~*^̸_zy6` }ΊD'AvC 9e*Hb.e<[⇘!z`R̦`y; R$@!lHznVޗ_/$iMxʓsCb_ذ:zz?@:[H@E~MjP^뮐 -T̆{ h}+L0Utx|.=Fu&Äw!*sn ?S૾SОe)Zrǂky(;٘Y^Nn U:wʬC)4~ڜZy_Yj "08%Jӑiws #f(**}KM{0 tjR'؛5E:HJxנ9Y]:Řh4dJ7ס!YJ=~ ?sZYPʰn7ZQJ.MnKԱ"TZ zO亥z#{cUGǘ%i3ې2ԳFK(jtTL;Q;`בLzF x$ àj H,S'Aӳat` 0 jG{6|"p_qO:a F&bw?~hj ^l`I cyxYh׸S@Nڨ FkC ۟a˹)iPO\Ъj!"(\85gLE嵙T*z5R!쟑d.Ǹ飥 V;'K Ijj0 \y p+n0  }6D 5Ä< m9*0ۛ:ls{K(I~yS 65#lƮ`ldᢥy5׊0MsKlfÄ͗ãVɞɽ\mͻ, X*ݥih]\_|z$7+y&7Z{4߈Ṋ̆{/`L1Ŵ. 1  "͆E.Q ⱃ`]LI{2 Fy ꌮx1W̽G^aYa:p^G?-to%^4I8\΍@ 8irBKs٬=/8|;,Q-ZmLNyyho$_y˧,dž}ܣËs}t~f׽=zW: Wb?i0Doի.t>՞=Q- ~ڔ+;A9)<x{,-Ι&*sO`}^nz [CXs݃?ϾG,b/mY4/=o‡ ]Z+-?D >(r3mShQ$K:BE%5n2mF )YdI)QڲH//ZTYM9S5vA҄ʖ0h#J8h#(WT![G]ӂ [ `1̍]t!#N =fΞ@bJՌY\dLjPKz,FɓO%i:=ڸ'7oA~)XQNAUbLdMsMӨ1.2tĪCjC^,cZ7疞DBnA8 X# 6 /<-"kCr "qEzP8(![l*0ԎA˦mZ )x`t(0*oJ2#Hsa< X"9/h9B6tgYh+MB2#ȊP(q>)4BᏤގ@B&7HC/% @ӊE"0Z /rP[$l&cKrGoŒQBUΞRdJMsa.jСK&P5(vqA7@9ks( CO93:t_A @`33r[ XbSI`BNU8kDS1bҡXVj]SښX آgvcCUeOXe6Y2j<#SnN+ws<s&v3y|wcf`^ ӌUrK2Ɲc㚁mTW{yՌI[m2;\R,9.קs[A7ܘm|?l]Ei}4ULqRb>-yÞ7?7i3[g`&q^{SǥCl2=f2V t{NtяG{[oDw)=ʃ Jly١1<ߐ|H},u^ mp7SÞ8~#bU-YQcLl.xQv|tƕ@h})xe%N=sC26J?1A1'h](Ǽl5F!n%%톋dd^豗X 58CB *qUIoX4$$^r~albؒsZRH1΋NS{3Fz.a1"/=<p`P+c>GYl@1q͚hHtZ/6R^zΉg0`J`q ~`,#W<LamKݚ5 ` F5$-)6AZ# B-TsS[ =Y=SEzr`jW{&,eIKM[EZ2H+9T|&4`73h`HqE HrL©S JtUM%|OOsy=. VS$]˖G[CP2V(W4#6(s @qx7lc[CcyWp+jwSJ0%ls]ERnRz'zV dt9qJ0=9[1uP02q j"Ae c;Q)/ManXTݛa:ݬ`{a=Af*LQ]KY9k"}i%*hHU~+ax{D/n  Fٱ_& P7=$V.F',E6PN(%g.ԨsE/p8ii-+ޘ[pPc8$@bq(p-!}u4|t0G4&f-UzؒhN'P `ٵ}U1g,Kvղ6$]O5Zh6| W ("AOZ6Ijo.h8vv UhЭ͙m1hH܁2y}/3ghnQ oD;N\1[]_|nCE613AљU?K'1²t$}mTwV7ۙ1`PH®!^f{wOf{LGعZ-J=8N z_ݴ~g^ۚʣiI\zJnLAϣܧW/ (&ܢ  1WԚ`+^n%2KWchTet:^>ҞU Z5&&x<) c˾7|;8s ?5\j xcvR:?¸:*!4  `/Z3Y:hc7*db3@@52o;qP@P=y~j:<;8DzAd..2.ы%ܬ[E "BDZ4cBҀ8呸iiwI#dSBB. T3 Uk `8;|w9C:Xd?q?A9\Taq9-)92;S=<;)%[>ٯSTy7`M,FX1F 7!^BÎټ< 70ŘFbAEIfۜg[*[/,[ ?G㐠%cj,B+ EQ-z&@Cd H,JB1=3A`$C'b\CBYOʝ+>q9?H{L$ š̷q/tMB\C(j <<ѫ)8͠ ,HUSԳGf3O+QK#l950JD[ě' ɢO;ɴ!sMN]7نP"mR@H۪b?]TKA,2mLdT%4EQARPmP(<͵ա;9+ pHA=U@DF\SG u "4(!%LMk# 0ЍTN8L!DFTߘq/վfP̬76Nt.x{=+yB ̳(ӱChyRV۳S"V2aUSߨXj9A5Z0YdМBiEBZP[#z2Z'y= s`nN v80;*Ţlh0Xڪ-UW3rC9YMC_=l1bM ۜ0[(4#UErc[}֓[B=8UeO,NZzh\t^q--}E/0ƶ6 rZӴ]ݔVݸmRg(bIA-ˉ{60K:OPbhz^¢v(핼J !&5B:1 Ͼ UU]-I-sXKϹ[ʼnSݴ(GuIޛ97$^`=%ܲwaB%(at z=D`lds0{Q!GH1X3qK͉`YLXslbOQ`ȹI .&עŜ,de3|"#`m:K]$QO؆݁ m^u[ۆVSt M&TOŹj$eHWӈ@hoX3xh,Y;HHFx9b;z1cmVpb,m*f>։ۆsUf/B#'(dwF ǒUÜch xnn~jjjjvqq`ejkkk(kklXklPovz8avZQski;l\DBy?2_J-GfůMgtdi]Vg +@ 1xylm.6[wG>2 kI!MJlU,ȸ;lm'fKb n $n #xhxm~mjsph@IXPf#H;F^Q}^Mċ,*"R(9X&nX^`T $JiFY`pn5sxWoqqqqq q?8``@C>5%$ 8Ml/2Uk[K!ߐ&#xnF9i&滘;d wށDPVm=gFRLs>su)ݹ,%75S^aGBf#=L$,=̐i&Bؼl[ވ0TO`Hs@讫tH)|=+i`vb/fh`h0vfi/Ѐo&][9\'WppmTi@Il [Pgi>1 8 0V9uW+q6\.-6^9ٮmy1mvwdϦg)b5Dӥ]möatF섑“MgY  UhMξ1q%gxu0jlpljO{ow0mvgjmw`krvlOmW=+huw^ d@,Ht,yD27wzzjnlX{Lq1qgpt~~/~?~O~'hT0y(~_!@'H':@hP7:qcn7ʳ=^+HZڽ#Liz(h „ 2l@ .\Ĩ%Pps͜<)T)S'PR>Ьi^$àB2<'َ/*8i)тI(Ǝ GT =9(,y81Эk.޼z/Rh؅;l X=c!*4޻cxsMڠѠ?OJ&TivlYL)k 3w>7iRXQ"K`BFM;}H>:+/?:0j#HE7 3]:yFdH9jpƻG,% y+aUWh1ȚrF=\ݻQs/}R?#cłK5,S,HFmi(a7%K>y v|aLjZװsNaeϩ+hVG;L-$Gm)ݸYx\9;8.\eŞbԦ;(-_ wgG =q ŚJ,m`8mZo!?^0n1 t@`k?U.7RP@=zD.s!M2YU <|{!$*Cm&1OZm}KҊw]7:)F,:JqL%.k඘E GIs"٧33Z:LQWw 1QE p>&&/b >%]{H;DUw8刨,$@> -q*V(9ah"Z}`/}"uǒk<&B8_ҋH -:xUsb`-:b1MI+1FR;>Q}i[>Tӥjڤ(8F7 99RFp="W-̦ɲM3s@/_~8sl$2RȠ)VOw69*Kc$0,| *LIh*Y{Z؀HFmol9g9)5CdgTX¹LU e0^~c7y/ H6t@ P6c,5эѓ?=Sճ^6e=s{u|c=C}-}u~D^MsN{'ePh6b }g[f#??#@2!cĈct :C`lxU-Yc G6Ot"II !$cqe.`ܯ7tV@J!4LP%L444h@!) 0#jэ5$3@;yDF%¡4X(O[At$=$L#J wxC5lJٟU%L$B.^FV`Z<h M%_@&j@Aj&U#BқXoeTN Xc3"IC! j82<:TP^:JPo倬$)&K&Ž dfu^8`3dCa}7~9l8<844P5TC5@6x;0` ӑ^ԂGU2l:' :$$oKБ fm$+ D]HUIJJ\Y@g7-agB{f̅H:@B*EDN)V^)fR\ A*< $c"@:DE&!nU4.CǀC faE ZYcͰ8A$g8ɖ\ 1\p`8 uH$ [\T`atRPe`f0JŞU`e=QYPw"BX;簞)Zg=R F̖\ᥙh !dgA!,)=C:,D ,,&陮`D@hAā!Щ:]~H<%Ž ֬[V ڡHz,H &ڢ(܎+pzj9 Ƚ@C8d}~gg(6:,Opجʬ Vl8jJҬV%- FKikwYφe;NY2$3|۲XF6LB0GFm=dR:ґfRz&hv CpbO{/epV7έ0\][(A$Ý2.Oݡtr]KdO(%RRFS>eTK `Y~՛h.h!DޓJUq^~^ 0 P^00-oV]n) "a@"O'% &=51}aE뺄"֮orfb /a*1+".b{%IaU Ņ(f!?>aUZ!1(L~ah^Ӱ/fgJ'W2!&N^n&R2Tr115W55b "-+ӫ^+_V\qeҮ-L[ Cp/NԑBQmx%2K=Dv 4B'i7{o/JMv҃灞虰 pރ"p<aʵLVt^-[t|Χm~"@qDƯE&Kl -b$8-!(̺m\=jCjj7h"lv:i^l7xt闆NlVijs?pE uSsV{Sx"zgjyy6]z0v04l|$FA[ꎳ ƵΆ~ʨ!exҮ89L D`"^v5w=zG2o{8 P(&`@@Aa #`vZxxwX70"lҮkNմ߽Jt_؈V !f z֙<۳L߹hɺ[Սߴ3.EJ {-kW}[zR'Idk移;#dw$IhKJ *NM4 1l`̈% 2Ԁ>l<0X0CN,ն["` l+dHrŷK*B/x0 -@?=o.-).ӫ:;ߛp,d4l͸F}RFB;"OC=,/!EUnE `EfF)9P{ƤP0ɍ~R*R\&rʺ68IȺ/1 /& AsRH-X[*R U4?ͷ]]Le15Ff3陼x WzzmEXKrIezYިڪE[ 3)Lo=F>$B?8QxɄ4! d$]$ SL*3*OLwFs\F;O@ͶPb}Ft_>5^y15@Z0&knk%#s5(ۢDh~ꭥ,C#!;ܣ[/ooC6*4⳵nOIrӓI׼d/MdÆ̆(ѕKT*,x jep$v]^`%FxLrPyYyC|BGC&@f>A|wC#=P(2B!t#E1J< Ї8Dj!߳UxӁE2c]e.) _Pw;p9LB [Blf#'-y8vCSN{9 aLLp[j LWjK}SW`l;dN \ɟU4=o)xR?#>DSkVU9M@X[@$hL%&cqyrȃtZi)*TG?l1=0hF v: ;3`9ġ1#0"F#)9o)r%g#t4\LW'#a "e@"SN~T5axXC(DЗ.xJ $P&MhqQрܸ A_!@Ķ0 RDqV 9S4 paO5a _9STFi'ihƃU5`vVe:9Z_ lD[Qsb!⼽*q/O0˶izvAH g+MBԗjN)g2M#1ئNy}A%Yzس^xX4nYmSJdm 3I|a/X#TCOPuxڽ+* ﷸX퍳8;%dRJoc+Nfb"H(ח! miOmՎ`Ņe‹İmչIaftT! R CDp+l831Ƙ&yQ(Y']&d9@S;_] G%!e쀽 Z0ǔQ4UMSyikz~Ýs2vTE,=BPF(Ѓ8EGMpY"!GRMu;78'@DA49|@ x̺l72=yD2><1`MlyԶO s2= 1f;HOs^BL< B@@ ~oy\?xj/ub;`FXMVmc܈7QxWx38d `@F48 iHcӠ5Q kh>8µZ4^[WC,AyX:k׿o[Z 8.#f.G#LODJԤsp" o܌IsbƝlVp36ɪ# :/~@  ĮiBo,Dx&sN8 A sp0Ah@bdqڰqd*onͺ-C21V*ܔ.ƃVVg/h B06Az韼Ϯ jNe"0}'-PJ\~C@v{Q&KRQ.F%.PVm)  "m H\$22ʠ@衳/+kb00> \5 g6 .p&rz &"/#3ْqqR~́ rA`|xCLQ ` Lb5K6h)0E zN\OR8 !'--/'- /'@ AAN(H*fѰj,X $kΝ^taːPvE N6*6"r+\Qzr+R戀18/o8a/ 3ί 1Nx,aM 2&a$a5g$ٔ3Cź)# 5Ax"eS+hsklhlĩ$ά!83T'C;a!BD\:R>,@(;STt`>MީF`Z0K/!B5SO`(=5 +R+&B @3I"~rtG+1 0 OPUPP P. aa"URW>n@lX "\8RF*N&~" .gVk5&V!V^oT?s/ZD@`PFoZa 26 r,yaϔTDOTMn*8a :TM HxM - av >72:t84a8P- ߭vqH`aDjxiF46є'>uzĵ0UNe ; "L` BbPl~܋ `ov:i$j, a>0 p / vdtAc}0:xJ6@ۦr(`.\+07{FMjR$`kn)ܯChDʤpUs13Ws7wssq1xtI̎p@QV!1M1L*7 rM!ň@w\?Ƽp~qQ#w8@{wkǏut! ڗ @ܗ~۷`?Dd5qLnaLe6-pTB'b5yMɣ@ f+.UL- -o8-'jS.qB.M//VXbr& XW6/ k/Z腪uxk6 XvҀFACNcg{^Y\™RX[vi;o7aVI#b3k93XMqBGh/[x/@V<0[uuxvω(Gq4y芲GAd(ʈ6yknWfۘU'B/8C;CATDIDZEJ̏wBX!9ЯvDŽFp6#6&B:XwrOx)(atOٞ9uQQ'5R+# 3p,I=TATY0sp"4I/N9iǎj"vH3&e+PfYgBუ\"!:ɛ)z9얜6 'lf_-ֵ]y:u^i+tI-yUgzO6ʦ3F$rèY?x&bԩ"ga xFnh:0IȬd cs3fA4xrre!JS-yI㹙Cp᫷pۡ(IZ2$#2S!:tr#kؘwb;$  AF wr w!$xy\IjP0c[+).{&ۑiW=wȪ]yw|:(0fO5+yY;c^LbH #0z 9z" 7&F<qX+)+Xl9z+ҲM) H|v ɧã!eT|K=O&"4U a2Ŵ/+lgC837OMEeWUAq!  nv"(d-,[Eh2\{|&v'0 ȡpȑ| nHu1R]i|]&rmz<K؎y[k{,9=7+\H6PNWYFGޛؚ+{AF]>$VP.IŽg2^ WH/4A,-ޤ IB5V8U^e'޿ށ ڣM`AEgݖju$>q|?\9sclƍN@G61ĉ'C##!jʈЛ@NF!Q"@\QC"JX"L9yRR&*\4ҥLpM4TZ5֬p۪5"I44mH/lۺm1۹tҭE kݺpB@8% 7tBH .DvD{'u$16]a1qL%zaHT焟~=\ qSqdg4GzvU"DP_IOK/CJDa91GO,%CRxM]R |b"Hb&bLbp\\)g9U9:ck9b;DnbLVeapi݈e ImG4dYMIk&(W5ȥ[ dF[L1!E_Fvp]%fy-hD3(}t~g”L5%N.DMaj kTvcUA2eb5dbҡL(xivkm>ENc{hG-+Ua5DIGu !@bhpmh4_F,#ߢ)6S~a1LOڌ%@R4h [J%WyQ"|NlĘOk wR~R8"BtT 1MC-x=1Ht )C\hDbx1DvKdUDJ 3_M+LcP5< c2zCkZtbI(dL4?Z*"#ВD Oˀ6x?2^PSb 6xTy/<UB@(:\f(9FQBe^k) U|lx6,&i:.}^3^޽V8b+@HzE{6f-~Mh@r+@-rT =Nw[ekNB` oS|` $t|P$V)1gZ˯ >mEWJ/PS/چk%!eîx`J,dD0ѳ092T@ 1b \ ,4Po/acBZXC2G54k5<GH=1(XG6! = tт"H$crhSҹ5K=Lꬶ60@B ~!ݑH\`B4az<] ZVwcG@IaHGSs/,`jk)=7 nl,oAq`C^]0C#<ϧaE,V8!zQ߶KAG~lFӸ[OF/G.%_6b 4 ZUs OSlأ8.>|]Zr9T~_ybAf1-%@$DD1liDLDP$ETAE[E_FuٕY[WySa7u_0|[ g0BIw61C;!j2 +K_y T5HkWi؉^ne@^9rI1lMȦd4NtNN/ $1COOe}+{2]hߙ8b$x&x񡞍2юuwIY'tz#$n5Y)>UG,'YH_UaaVhfCs!WsUWwNSi[vxh/X/oi|C/E:UiL?L`zh0nIl,ŚZgzf"[z4:eIXnų`!!j,`_ :_kuVbu`hjuSǨ p|oEc0(z/ `Z,#I6JFJZ5l:dXjGd5H ʊNY%kvhX@y{rI8*b/}rX;4#T.g{aF^Sdiȯ*CvQFAHAH':y5%FjVu(vkzJ/7oA*iÃ7x0ȤMzoa .Q:*U~ ֕ ah&y #ƀ hR#J{ѴWƛ[ GgkH_e7=ZHHf 3~yuGDRix7 W@=p j?QgnI%딤贉4_=A˻lXAz[+XVQ\X}wkGx^xnk*i%D'UwFw1{r1uz,<JX QpGD+WQJy~NÿvQ~XSج lt u՘$;A);@ G0΋JLfT*xt&F=I`np?@5,nFĮ=%IH@Y+ܥa uJ/Sp888WKjCK:dekA1zǸP9 umQGHˠ˽˽\Af3^Z^ FkXPlhP 2,W7ĂpWL4cv7*^,`b< `ʛCRQ*lW'3KwǢ,5S 3LX(,Dů|3:5\xhHٛl!w y{v1??=Ӣ&m&¯;scJzR(z \wc\1'G-\IimEU\)m]xB$ZLӢ}-<[[lb)`bKKin[o#D=m2!]-3C3}}\d;Ǫ|~6lr M[k0r |=[ۻۺ{A.Vb3-͑6lǁ+mlak,op$}&kiSsM?R~dn6e )[mY*^p}aR`?.A'Wݶrgң̿MX㡿=[mFQM@y?F.]Jګ]$iCZ|R|%0u TX5znp t+4[}V;o!/d2so<.qA.g'I(ѭ . dՇ}n_p ,۞E --Lo-[Z еvGxe66<0|=L1Bgn, ؐ헷Ĝ0C\Z],L^Yy쾹 ]ڠuRо6*0h6UϾrC F8-ΗE  ؽ7 *ZQ^']Ȱ'TAΞ@Q ᪟DAhܺX`… Fl؝8l[ dТ]y4jԪUv۸vataR@\"U n1 n[u=#l#eTG[Ae0R6tgfxvMHN,e"K`RF ;}$ԦH$'rc<0)$zLB~h +bB 9'H :ȧ"V.ōRd*߀j8z"1byAH#D2I%ǜ[lqgI< :`03L1ҍa=✠{+G|c!6 3*Z<)zA=`oEĹIzDzdK=:AcA .890BD]V5 jc@y+;"* x#P6ێm9Ih^[2]uaӆ$ޅ7ۆEi8̂5Y=98nn;#e)0٨*aSFo 8oRʦ04ԉ>sP"S1\MpqWm*`_*XeN&J@k;l& FDZ7t{bX°q:g!DF; gX6SQ)8&c'K cȍs}fAw9BUmXkEVh]N\7Ee4VhN/jZw駧>(ǾM*wk+xxX@yZ5izO&G; ᕯʠ9>pD 1"GE@bA֕$84.+pCI7%wg ^F,58O[B V4"ш9P4X#@4sg_ZvHP,br:z,`E$pI; ^E9/͢pʄOpB,Y/lQ /5:^< ҐZJVzdHNT9ZJAuEG0qF1w8c ҙ /D0Bj :J3c~4 %lr$VU瀖;JjJK$4N/N*,e!6ҢHFF5sl옇3$xІ7AӤ|fL26hC*1r] fp ,7<hc![?ִ̂ T](R(w^D׸XLc43ր.t1]lTPhJR\,_0PIxJKLOUc]3P6d9nS 1Cf{E85cTo@D!1r1)M?T=Q*YzQcOҷdJzɈG6f,B zRrH/w i7TXFzjB`N,`D^ b>Oޥ}m7h=eT*5.uQ;+!zGPZ5<{\ ogȼ$Xzط|E ̣xJV?7fV-e muq}6]Mmls:##ÞHy3 paʿFYsɖR+yD3ܪ9z ӕI(cn?DJyD+kthHG *lL*e)jqn4~ǨQ: ȸ 3a{(s@#+A_[W#34"&3S bt,,9ˁ X*;`-ע p<>1@K/BJsԋ/{K#8C=c0pýۛR?#("¡e}/z0(s3 HBHF8B( A9AO{CS$yGMT+KA C;&p L2;z*P@x†kM[C5 _"+5 &sXd(k7U1n;ď-#t&8708A8 .8>^DI;9BZ *T(pp @$HEbE,WDBoG.59JpCM#H4Fl&:}v8CsxсR80GTYsHAo!>7dr3k+G!t7x[GGpG ȁ|85}.Iȶ+|; J 7Qt̉ͱ#<ttXg˼˽˾˽2`, tI(-1=ChmKOb/85L| GXʦPB @>A, YGTaZ|+ëŬjLG,4N\,@/!FÏ#}"->3()p>t]Gd 677sDXe2vTRPMvt t81E NA7޼ 4c`  U;jՊл/se᭯D܎JEHJBe XGGLp1ðHԧ; 9HI4Uy . WuXM.ǀ ɨɸ ̐ 00xuPxT7mHJ@14r0tћ4-`ԅ@Ԏ`YzpqYmB!y%R dRhث^[ᵰ_C؄uҶK1Y: %xEMt5٥3 ټ, ΘS_A%Q ڟU]] 4pޠ+GōQy]zMJRp姠Pjq#3V3rA[ם؍؝]9m1x[ר }h́2zhUͭTݨ`z8 ŀQm Pܣ\=j$ И٦58RRW- =mC<5U]` U%װGHYF_ Mͫ=@zEM_(2HWQ ΍B(^y`% z}&.ە) `uS {MP?s,aa\3^وS=HM@8_Q:W5@\ Dɑ;_ GCd6+<9p AeUUVMO6 X%'Zbc؈V `bظIͽxO z#16"B#?\rYsט @DKm"5ߌU!.CFdRxK2j!ԙj>5mR`#»;嫈0gU V8`I.l#R8N; Q$ELWaզ%3#pa'׹FZg=.O">(iox$)@VPYZ.{@e)yhGį3G@GuV]i9(hizF_A? hHx#XVQg?pD˔| ͆@ ,ô@!8-L:@ʄjp՛amk ˳ <7ve7;_ߐv `juߍb,"Xl` A|x~ 0nCS0?7F Iގ0moܚ[/mLP̻͎ n@V=͂liۡn6#Y<tF IC9Ѳi^qI1ԭ4iNLrģee9^:.xp%f{@f<jiEMhHgA"e7NҌkDZSnN&b&SrZv4UV`AfHj_~ _H9옖3.ˆVIQ+B,ګ¡Ѫ V>uis-ʠ8NUb*ráb=VLC;h@c pt:)cʡn!N_X!HSu~uHk"'&yU#寠j`XPF#Z≭X،}jYgDgEO#@wMHl#|U] w1wz@/ޙCwqyWѶu NDԭls 1z>j7g`rեT kkH,?OyY'0_+Zawwx]fE_5S b_Ed\w7x]6[zݖ:khigv|F7Ɛ{({?tcΑ o]ih/ٖ2VaU^e~~"it_B-~/ȜI];yN9{cV/ʉQ}z| l"4 7Hax]aTcvW}t%L@ZE%B(q"Ŋ/b̨qcFJ ()r; !r%KJ 6#.\Ĩ㇑%R|!Ν>A (U H/ʎ^ +v,ٲco,3hD@E̙6s)L@]V:{@0,9$jHIO6v9mQA :,ȥ;g;w0f 5@Ri=VPD!f{a޿/~<Ӌ y!Eّ>0i%2ÅRf=(V-G ,^i)KJjDkBȡBыFMV(ARBdS&YLN!ݭfڛnXX v[ޞTP\d[݅hSRB(õFmP:JE) 0B&|ԥ]|&/ˁҌJJɆ:B.zԂ==˷C@oX|I,XWF@b!o譁YС(9\q*YC=E҉u#]c jmjfz_iޜ0&~6ʷRn_Kּ<HzOl >$ Б,tWc /G[!YCOTCLQfVsaRt{u\2-Lp]4M- wt,myF^_r#gJ1v2Xg|]3:SVjfu;&΢ d;٢$FZЁ+^= @jCOR r8:~UN3F%~FjG1K,אϒZmMcAӺա :ߎ8]ҡ5W׌FDeH?n PN>S$-kfKԵYz$jܔopHgݒg< :эrmMI(7}Z vv 7a /!p 8ͅKMs&IxN z0I<ߣy~u* w`bnq$ -Gjh`{襝c~':;c$$w6پm+ wׇWYM&ZWlq07As:-ж7K0aOᷣZ| hHb:fF=GyN6y?o$3'm6BzP^(Ů)%W ͕^!H_9F _\hp9T9MDFUJ(N\uVIĄDb@Ii`ڄ>^Zn|e vR hCŌ*)+^]EnJ`ɠQǕe`pQ"|\}Jtٗ)SdUKd8 ML̟鑄G (14ZuFYiXRDYAO ua=IR[ =Xnvу59_Ä#J"ud4$@ F}Y TPT [%+\HE%.jqم_je$KBkV5SM DnVBL@KK|,8dK$2 UoKd¤_YĂ'%&I| "Saaa_؀bq} )e^nȈ)[jW*iN.=,D;x >@ A/m#5EA@B2\*Ҁ%_Ҥd8ʨbՔHхjRDMa&Th')͞űyy(O"#A!C |7D7G븒+x8`8H24뻺k4D44LLT57C;C|LFFꄗ"(*tL_С醚^ 'u(R`tl"rᱺʉ],yFAzJqb9EA,ɡI JIǐ ݠ!*:B-*39l$QY: #톅N4J!=(,BLɲRXR^XhFs 0A"~,lDD:59_!#|C*,worв-z8azB64z5TF n5`aNHh[Y6hzs;+( 8  6LC7Bt~fx{ a{p-m-Г;dKpcDŀ .>4I!a@{pEZ{:GDOu}QulN,^-AUG߹?s Mbkr.Mlēc8N9:gT/еգ +we fo "ddA(:!NQh1P# !jO)$;sDKHT{>q{Bt}`aQ4SЦfB`?HăE/& @xAPm=)y5ak7%H~WH"7 Wq6h~Z){Xr˱G:DWߏ-I82O{$ Euԁ{_jVrwWo`9k.`/xѮB=jRYϣcj:H:H΃ K Әt&C, #Ctкn:z.uZ%3@vKAPMSӝ9;yt*n,eiؗXƒ,Lr23̖O߰amp4nV;~jNt1&Os֔m<7{u)2X"! 0Zef3f Ej hj`U+INX^\Հ<ǹB_TjI'!n$.p 0 . aa(Wfz`_"A(X<@LmbnS0v,10'"c(RSS| "ZU^6%<ܮ>Jl$(+xJ(Lm+"0Bϔ,EFN."yƠlj ܡz@@ E!ƁzćlrN86T 3^!v$ .Y>hЀ0$E@_VL9T!EB( ^nj cC`F Ghe Kk S qG^WB֠FjVjVGx_|/j|`I0&) )i61SF&=*2-lKOn gOJB&>˓b԰g櫾J$y!oe?\ZbǾ%\r1 Yrt䱑2Jqy''uDzzQ&%a'|GwKrpSO\\f/"qK,zZh##nհ fJf4Po(E ɑ_hqUp|*.tH"/BH%ȉ& +NhLPQ/t#"@K&J@,#ђV1$c*XLINSddR(`j9fs8?,~] )"t|ؼ;s院ɚI ĉTB/NL!K<@4<6,U nsVϾ,hDN.o:5EeQ"Ha9#vpB3e'ϱ/"vR`^NdԜJ&/۞4I_TFjAhOЀ fX8m2H?`I4@(u Q= ""!FDs0  }:²0KbNG DJL>10ZZcD 9I6WmsI5Dwz J!$\HMg2rTMer=K#l$Vq5Wq5tU(0lUS"ĈB0T4eu46ϒRC~l77x:>'HCFp?E҄$L`L1GUON^5_g[YիvV&H%Yh-A1ʌ_}҅~NT5:-{(RP0v: 5ZdMAQU b/tUQуɖ` pN@ `+5auwt[%(jjDcST~R*A5GH6ȍve%M\Owf48kjN0PcU `P6K VjQIZ;հ79ukk1۸TSP#?H%mrSla0lKT/9b Owp/4<JN/ Pw0%2*2U&rjxXN{W$" یš7aܸێFΝ$?\xH)uL:f[z:/!SA_j {Q!]=ʑY7#jwA⸂|?ؕIk}sx!ݩ\]QK0*@{+-])#6ſOZJ=SģP}{c 0nѽ$຤콸}y ;qD0XAB9P⬚ 1=rXhć-.ۿ tU:Bt1!Cgٮ=(gL MnϐN xGs9֙+\w&0.-ڏ% Lhy|ϛ]Q΅X>%4\?X9鷥z}aٓgy) }"#n8}>jr;awV#YQD/>K6~?0~sSȵGN:L4ʫϠX9G/]zLq,Ne8|%l6-;<]R/2L??L@iùy[)iD ՅǵOm d)XQAU (UQR(;BIɓ(SQ 1hQD +\Ĝi3'B YRƍ*]ʔGzQHJիXjʵicG#Np s=9"UG99ǎ׫&60WI W.2AJN4n$k΅4Ө36V;wРdTAFsܹ8Yīw2 gN:V¬, ı"v1Q߳r6qPD^ST%iYH4Qleod"]yp@8!$v%DFȌEYhM%sqjYKSvʤ!+%=h\"+XY&TA${kyx|5Urw,'zx;_;L/sȨ+"% 17sZ"&gg[Q 9"1dl6(b ՞,}E|E f Ӵ鴝:PS8O@Eb&ջ5#uؐOXouR'Q; °:>v xmiƇx@蜰TWY L*e{KUg44K1&f;N5=;ٮ)u !4 %̀ {nw' a(oP߾t%I`q԰C57nHL&:Mt8!-ȢhHӘ5QjXG;Ac)ɓ g> zR" tA:4Xa:ـ A֙JHXd$&N9A9'x- G9:,\-)C,AyCq 0IL;I_ hJ ]٩~FBcȑ7d IjHH #/Pw4ՉuJb$2Nz!%~ƛxB *WiaI JkyLg(EGxC4юzTq9>ڣh B4IMD9tl+U- $(DK˜sSC\|q? Ҽѫ!|(ʈ\7w~۸R@fRqHmӎDxUzT!g0ș &} qD>pW+[+~;?x o e{GDʰ|DWEpE[E]E`netFF]a\Ŝ{Ll Ht{<6[$!8]QVdfh]&܊j-T[-&<=iM1?UhǙLL'ht~9<ц< s/XALPmA{r]8d!M%Cd:Jl4b9ϝ냇xŦpU-Q $3f)blM1T k+o0UÖj+P\\ ֵR Wf,]4iRg LedDcTPɠdBdJYp|p5qWyٚmxzE\ pڨ@m=? ۿ 竨/=9hpFD拭FBL՗^AN9]IR>If XVM!$=M(g_mխ=2!VSvl֣=R1ܾ#rGz8Ǎe͸}LAYQIA|R,VMLa"%w)b-&^ކҰ缴) A& 5\eu[AxMxƨ,24ZCU4L /b >(NiN]A$uv^n^-ޅȨ1iot*)ƙz*g37:IVUO\eXʙmGdnVnncTF톚n).^?aסʨx%/~ O[KV8}ϖ~0}ٞW1>YUwuY]78B@|PkGqi%rcgKYN{(&p #2^Kds#>1po̧1s`ATؕ~yn/$O*S*{M7|aZ0*.Kw{-(q(:#ítyMK0k]?N̆aۆT=49Aӗ^@]ey]0TJ0=R ܩ* s?"")Rh˙{{ֻ;6.\*;MhXO/TFw@J )ASQvCfM@0K5p!RL(RzQv̥[]y{5r .cдO!E,umRSʸi+0O s7U~ ]84m91h(a&;F)Sɕ+JٵwnS0oF Dzqƭyկg{݉&e-ifjkfvF*Щ枋"/P#Q-b/c1F̅ u0(B HR& b zbI ظJ,Cf!:p;=MEH z㸸t eۨL0Qq;0#`Xgy3PDUtQFuŬ6PkR OV[|eMVYT6`'S;#& £2EOM(U&ni73rWw0Lv(z~{X!A ;<Uݺ/ ~FsC> c4txDI^@ RL| Bı} Ez?,h~ۑ$!AFX^0`Ƹ< ';bjA1UC<&B]N.<E _P d' IUG-ư) PZ"`*(/d*jx˾ee;3ҍ63cR A5@ ,BhP ȓtk`ȥR\RH'@x"$1#pF6I|r;̱ pc8֣dj@CpG3J 0VD saAxE\.[2t*h~0 ͌98Oyn*秇 6M>c$_H8ꔜ Nq Vl.RRubJE t@"@[VUsk] \mH9QV+x n! h"G(ꩊ2O L4EZS%i{t?T2,$ftv.%&=L)=;$SVN; \TI:B-=/5^i$:>C.{%8L&.rjKQ݊_0#N{.yLhPBhV$FT2mۻvՏa{rgX1DTsp$=.kb}*@+XK Al{q!9hlі*sɆtQ9;1;hE.c>+Cʓ"ɹ˕d| 3 Xփ.t) j<ָ&DDĉny8# Bd,<>DS:˼"\ ۮ94Fq>"1SA IC̙Б_!rdZ{hAE)izʷKC-/LGVF>M:TT PDxIÓ{x\C;G[4u/d@fk+ H(C0^D`ҟk-x)͠QPi79FuDD.pGGuEǥS G E Ƨʃ Jrd87,PTG)'J<]BDO:8tkdM8'O L ͦQT kT(3[iCC匕;)춒sbe9LηKBb8̒ ‰8OԔ5 XO P"[ 9İ|?ٱ%U #}kL &E䤶 8Iсà## gO5CO7 |!R7я8mt2IsA* !4r(QuׄuN+5!Cu 8R/-rά(#SK MSa/z8ADQD $#W@! LU7R4H4pktDUϧPtKWV1M)@:]|XUiC9Si hؔM@5OV Š}{/oƺ39z@Hu zOQ,* <(Jw4UxHGyADlMeӬɳHY:C^]8`dB6&dÌc1:qpۼ U]S*" t5Xݑ`5Ҵ`ErZЕ\vʝS͂7)A T Z%3Ha]E]KaEX-9P)Ac4d]*w׉82zpysh'*yADX,8܀S\ 7q\Τ Ϝ![eC).: C3M )󁶭_(օο@3(͈(6=aU r b_z2Q]IeJ= Y,Z%VQcQQËMR, 1Uae1=3]E$Um+a:d5yUT%d22+`ӈ D` 6; >>( z,,& sE׏puvDrT`4WDZUTުE 6ZMHN%< ȏi9YyIKM! U0UeђE@fZO,^XQD ӘHKM#^g߉%`z{L̾ >J? Aq|jjI|MYѩ,ގR!%ev$}+M m nNie|>| ?󃹌b25?џ$KʤmqWPQ*R:%Vm c BvS8@c5N\ӘZA`:֯U~sLbO( :5JseOۃhq-LelgFy{w~ *(G9Q(r(hdz!fNlXxufE? 0 hxZ73aEji<Pgb9g}.+G+:|O|ŏګ:riNJ {]?UrmO (JO}Gطڷk}l}luh)z<{g6=1*[N :|464k7Q\Q"w2/TNj%/5fx?zO$UjjMEyݲ„ 2D812P(;6r#Ȑ"GP 1jQD +\Ġi3B Y %,1k@#( Rj*,wj)t+XfzaYV ;)]Ȩ#'Uf֤'"G0JPݙp1Ȓ!wCdn6歲%L߿c*a(P>WNɲgӶ ܔ26:{ aEpMҧSntja $_Hm&*Bl8}zm0 \u}.( 24eAk[TC@9< DA;<1QQy}z}7K~AD% ޢBؐ Up: s@󋴮3D"8"#=^<75iWD#;$$H,߉KeG#!6Y>D7(wc`<ac;t<"Iǒ/&\CM 0}jH`aUTx3 (+@e` 2P\X/ES!"bYТZ 9°T)t nNVSpIXL: D|%,c)YҲ.`6( )pݥL`;uH4ԁt@~V"6u}|V@_Ę ~iB(s2ЁL$H+w@;Iހ!;za+c*|QEi,ub2X#3 ^)MpGT4Gj'U L@8<H - bD"-hXlgD#m2; imX0p:R} LL9 `4Q:۫BRɉ&eX5NQ; YL1UCj:Dp' DըH˜?Bym9% Ķ.ʯXHV$LZ=u\[al,ФGz+WTw-rB.S"DĀ[ tF7 \ppp<@"5ղ?zVէ,g}Ǻ~$ anr {?3*o$:;p<}fC~5Uxiw-j}Ꮾ=Րc,BB͵ )V*!-*F@.R/0*]@A V"D4USA(c󭝅[d\Y5ɑiS\*UxyUAt vըr\A)dhЀV˵VTGf ڜGHdJJIV˭d # B!, k`,6#R$F ZI,U ZFZQ"vZϸbG|gdc<뻆Or7S"~^ .?"цb,ǂc]Do` X6ƚ71kb߉lfѦ~*&u,Ǖm>VmtNrɷm*A bVEa^r9ލd  rPn* h2#cʬ; ߖbjj{ R_RDw,nc#[aFHzXlߓ& 0 ``2`: JRbr)2Iarv.*kckdoY?v%acĕX^vmFp.G~!V)_GBD[鬭u%JJges9":1uN~l2'BwQsKD[ X4R[V,e bZަB&-s׀ ulۨlҍsW"L; ?PnY;~dG64 uJ5U@R'6d64VoF_{BdcHVZgk.'XaƲj_0!BF]ƇfsHyޗg_sfҫ`ϽK,BE@XX4LSd3^lGU[G)K(x2"|vUZH:ϐ6^i!aZ`)Bfg4pwQҧ8Yr˅a;u LEQ88ءt7t`SK8Uw Y`Z4Vg^w&IuW*7*/0j0 મ:YA*Ͷ3߾ԗoYA'ASG>7tQtWW@78W^URf/8FbG!&B&\G-hx^WSܜT& ;Pѩ`N5lOy^A4_n57.E T*8U5Ā\H] d|xL4U vƤS)t\צ1i9[nwԒ, iVzU72o`OW?U{qEwK *Y<;LU`n"L(Vl\8:7{웛vCnT.].et玮pCygZrJˆ+@c˅X[4`:IK]vϠ{ggZ`Wr]TGrn 'J*+U WD7OFO}K[{FfupW5 zm$A &iEa`S6Nv0WkOZe]d-_{/}<A?d@E{UD@x̴e9tݐ{. f\WELӰwt^WC;8=zo$0 .(֝,&VxcFvÅ5v1d /dgG0qJ@JҋhPC5zG%Pp͜< -T)S'Pt4{@k " 1Ar)}a_&Ȑ2H9ʖn7WmC{:c-wN#VBT59{ É']!avĶ3m*L7(K#taxz"N4~"Z6vjCI&R\LEh鹧\D* 9jH,ٌ,zvb -84+@*KT!:#bp* NAͿ4D0zZD iLfѪ:L%-€5/O@jt"=;@rCQL0CÆ4Jj$)T*%;$6o4N DPt+lCC>,W[``YOl5"2{))s䒉M~ b*?VK 7|XbY '+F L"v86e7(<$u1˱1!kknbMe|sgK0݊*0hG%,ZZ6 'Lzx4& _L>d́ԩeR$ kvg&lmxZlX{:άKo"6oʛA Uco{^_Sf &8t-%E(E3T wr9ʉRV6S3rN6ӘIH5xrJi3*\ƕ>8@C3CSyQ7P > \QuJWBp pDfQòmTSn8A lȈ'; o@ /঱̈q:A|f dY3JɅ*@)zֶ1o wr\ QeK9#GV{&+]B*jתLp(RKM{ɍYLfn;,sP5d&Ѯy;vmS,dv4|3; Elp'" B.LzOc2)"ݹ:u&tP a҅y'遳8mp7ʿ}"\fA `0ᒋ7H8ዼ(y^iT^ڦ˦!U1E- l7ۋ„KO]V2:.zyo?>^3Z!Z-hJ h=xOĚ;EVHH61"F3ze9BH!cTf2ƽCc E. KW%c`!碬iv쐘ިSUUdu1 8,mlz*&GlPx!%0{klWHm|k&3A<wjU ;`/CP6`a"h:hR8]%(U[x^W?ddײI04~hwxx@;fJu$ yuvb09yْ"64xÂ&7:Ŵ`W6鞇^ "Գ#d"Js=ߕJ^;Uf!}ş?tH;1c/zBϭ>Hq\!lPKno8*@nK.TRo|kkjOϼy8j]m~*?(c/J)TL+dfnbҋ`&WvN,@ P  AAn֐ 0PaơN J<}F̩J$Pp:*@J8pa$Hhn2"cA&h@ @a]ue$i ", Ol-hF0N -` b!aA1<nB Cil@84~:L G A4!Hrx G#@DQ"%/&abQMƮJ(nv,dxơ !q8("o8t`I~m "( &kr&$C OLD"ЌF 4 c "ShPվb/5)5)/#zăŒ`1-Ṁn-==>S((K+,m؊mހӢQ aͪ+֪aڪ9S`L o*i+ >SxE:B@Ԣ0 2a LT6G29Ybt0dTKr:2u8D#|)G % ~&;SQ9uja QsIl+~j@66 k@'`//MTLQ8-RP&&A"OIO "v4D4{-"OE(,!5VӯP !SrA_a,A0[oI0Nn "ƯLRb5B>b>T@5ZdeZipB2[YOaPAtt!aaSZg@jC]+B0g}q!!Hhi2iV][׼jqua :pHdhs2" $/wWtR-{/jI_WAui\7CD"bggo,  uOqlRT!U\3 O7V&!L|LNX?x`O8Y-^2&g~XpR'k'}( (Rvav٢ԫ# u>5@|7/TJ#X@{҄ĖתS@DAP|H\mc=p{28qqYqWԒSjmv C$R#Q7 sx5"$zbg%2SrK޸8S$5q#dm9sP3eكT 9c"24sy-2 2).O9)2qv% “A b/L(e\R# Նи.B.j4l9Lo| *]YGyGr3ZOI3!I)rxD>< 75B,!9]}8hdgc]1kvYD.~ѱEf|Η?W;#TڧEy s[3pS^YQC8=̑3,E,4^Oމy֒{-t7E#D+ ?1 LȏE=H]-D}y/^CR;Q\٩,+&*4-c].(z]MwKX}MO{ ZN#^FgۍC;p`\c,V+4=ji!:%b89ɡ"~{xZjgO^s< %L@ZE%(% ĉKBQEM$1Ȍ6V)rPF2lrI-bθG" "T0R6tg\:} 5T,e13 ?0 5pQLAmCzQvؽ7޽|{#5t($.="Hk ^Jf+,z946լ[S|N/xȵۅ֛9DSO;x %DEFYt 8+`uj{8&=YmL:z!r4̟xu;w8JNNxPMH8[Oṉ{Dɇ\Ila(H@xe}VQRaCEc6=VC?b\cxAdrR1Dw =X7DM7^~ fbIffY;`#;, 4r M4vJ4PCM5Xs7#=ǀ Z}"C IA M*٭v4y ɞP.Yd &aZ-բ&dazymOYH!%aQASPXW_e!v%pbN2wcޘHPX1zE6%l1QGAfK<3Ϧ? q3l-#w COtr|T`Y-. s̵^L%S;5zN}G Evw,%ҳ՜6zD:{?JDmKc;UWDv[֊ؖ͸nz.aʻJ+Z,Rp @oDq_5g " P 2Eӵ`-2mgQg+nP~pwdZڬ5ԯmW#j;ޞʆ>#][؈oY,."u~}7W YGe6CAq(sf0  lJp)0 j8 VQ"Ît" fe !f,dz |e%C-&%ryA1!jJy3ƃ-hg9ȕûp*Iw y{cHeI[e 1JnZ_ha+DX¼prC$fD*rl#Je-JhCȓjW w?#&q=6gUGȮ|ﴆWD>r mJmP(dYBl ˺s _̫z)l(YA9ܤ{xEa~\8D!4sI` $H`4kcaSACBA+(Q@F%cm_ SN78>QEWU{oHcLHRll8#`jw!81gLb{S5 oaBr*…Q@j_:; ⴘbpvpöp*`#,yv"K\m;JE ^[T ZMb%)۩ҧJ Yj /nhHw-H,ky\ f-?6hC*1r`l^ dp aA Nh#!ɹ'mD^ha8Sb  Ah| !!ȍfh+&\HH8bvNZ%yUih qx㒡M!sAӐBCX`81$z#)CkڱDB85#I8"Egll5b<@ ;S$G;m)"85[ apb ZY1W*o#C5@x5Uy]d!5&~E]у`Q= (W9"Taq=T7}wrE/+W~xCsaQav33{#"&bXC2JRCÔuUr% %[%a(j&n't2'v x" z'~(B(WrSq 6pӦU`-(ntMO5W6~{xՃRB AEZ Z4t V*X E%UomU$LJ%0 C_ߥVV1wL2FTM[Kwr?ES{\8Gf?5]M6V3H8m06,gJ_S("u<5Ą捏9y99l93:hOE_t b̤x>^1lDko$rhNx 秀0?HLGg3uQ,ȄtEQ'+fXit`5NFEiG8.:Ia}([L\qđcx(8tk(J6F+5KR`F*k}swCBjކ$$AHI# H|LyiVjP>>&GXGY>DHHG)SȄhb. a/hC>#q;0ԓG$WNbO݁OOO5P NiaI(kckR#~Sd2)liI#(hP ,`9i1YuX;7I 3ə`VhӋqe9sUWwgt6&%`&է"2-!G7܇> G\Uyr$ P] h@T D& Dh@T|Oy>)jכ uBANYuj7b8;Z]]_*^U^^0'%_u(uHiIFh[ԙ46.7=ʃ? y,I)FCD݁ZBRUZ`T; g:a<*uy;긏CQ6ePf *0fevfifl3p< H|gzgw Ĺ.}vq@V.g/VxH@ C| R8F4^ǖxZ;@[x3\`uFlmҶbmئmGT`&nfnȝ+6:^q"B\4h8k/ZHgC@SqLJDwbaD*X\6DRI -{V; ƏĶu]DzstVQiWrto:< ME".H"\kq޴Hă08s0 ( o)56I44;J4ce+a{6:cWcijyβy249L .6Iki\#IŕUӍv0;*OXz]sS֚ưKF&hR{Q;;G2';} hKFq [rGH~UL~ @ +%+B 2)|J6{yB)_k,4Z =3 #C8a!Ga!;Nbŭ)фc\it."[ڒ;P&q6FS5'8IHZkǵ u*N!YDODT8A)zoȉiԓZPȲ6PQjDMZWs(wx[e$=ڮw}vi F2@+UṶIEbhК`.wg{H;hb7z+׎HwK4`$N|<\3ԢzT3kˀ鳄{HiՀZ"{xhqͪ|AJY )+Ufw 1v5k<s"(J(Y*F=:L !Tg6w"M[VŽ(N9T @@ +B~᩷r6OsSaAl;X 6MՠURqu9جB}kL[ 1=QILMz`iE!Ac ]+%L6FT./yօU5]%z8`f(Q6p&`HϤ*ۭBed4^]yخDFbI)LTTJPcHma&@hBQњӝ c'-eө4v[!1 \󕿝u?l p-%(Q 6p-4ˮDNҚɽzЛh" ڵiaAV\AJ+2PԿk \FzKQQYΜO:^К6' ɅM&og 0vZe ڱ͛ 1GݖߟA5PgyT i`~qi#*Wm "==PC=EDd>R[nۊ{r!"\S]085G열J+3ΊǺ\Jhc>pGʲjȄ21p29`K;hW*|<( QT =J/hM15$ɮÝH愚A[0 1E, p3X$,V= =L9|S4o|:"('&la^4?B-L!̢T4K;Z\l081'QB B %>(}`iKR]gh3_\_ӘV2*`ꕩ=0?G.\b4=^ޖɂnxԘ[ig;9 0~~/;^`iRH-^\NζpYb'vƗԏO4Q^L"6, Æ EH8wRRN@G2FRH%MD䍌B\QC"JX"L9yREP2n4)MP#( ^ŚUV]~j?^acG#Nl =9"UG9X… NҴT-\4n:W/(K8jZNMFa 1x "Gk@gmp sNݻycئI6Ϛ8ɽ*1r02ki^;~T_|,鹄)G͛]ȝdr/@ : '+tCp #,B) zxESl iGЊ̷C0QCHK-I%3Z0ڰh.x쭸,.2Dދ4l :LʘꎌȩR2H ,S#ID".S4>)l?Lo|F'Q~^dU.2o.q3@ 1Ua 3r꜌1& G5KdBQJ4J[[Ӛ$ɯ"0aJ*-λޚ0~ sW535;3#ثऎ[&"&|I bb , CDr4R7&ij"l"'|*dBT_agnքslBKUxKTcޡ/(9iŊ_yq|ܘgIQFw2! 0;84cP; 6t+E/$Of&yB@O[lW:wlvwp1t2jǛAֽy^)<8.#Hbƽ+7Bmd xЛ*6K/ǕJt'zTI8Lø;(`1b3hN6͍g!p%LbDR8dr]W8LUYE'F6dEKffD|xcH`:չn;t x4MaX@o@[v CE&!,VFYJH 4WlE2F^AF^0a^>(Oby0SRDXJ 6|&49`Pk:tKqʑPo<:tR kFI@s064LET`1K:V5UaLWr$a >r8 C#,!Ll`6 :ijCSdD2T춪ۍE&۬v2)W.{ܼU G<6׹υntk׬&J;hkjU5Ue5XF0r\һУW9W =>Zk*[*%pR B,ն-!CY!N@RU졗̪D$@q) ]7W/[#/.VLcH-&P8 XK8GP"j{2VfԎB`5$5d__V ;UD4K&-'Ib^ߖuW@s%uݚn@߇T,dE`{C!l8#TDxڕ 81gL#qnc5 oy#(^ME8۷$'xS^ *Iz䰞[K:^Ƨ󝓹kPCz)79 :? 31k w+24cC(R)$?I /D'r2S3T''{2k.CA 8ˎQk02з#cZ5-tnXW (l}oESBVL BZ1Cc(p艡#oCí v ʠĊ4>Y"d[4ȈS`nƁ^7{Z_,M݋R[Mߞ(E :UQT_c5 jNt5> .DTZDv[P ˩P7;0 y+H ˬHD5$X!v%}%]E}P}-{ڔw%9cX&ly]9,d۠`zhYٝwa+Kc8DLH1 $/w[YK\] 99v:]_z>cXMS4ddY[ʛB<=zȿ&~ (X]ஸ S۫:pF:UYh~-x!@j?蔯"Ф芞" #z324R#6»8#&տՎw&ia$kSݜUVPƌ\e@S{ g 3u'kO.1ŸA4Zi_J.b3`M9U팀EER,P *Z뷾^Rx,rp:@% niˬ`^z)"E}FBvi޲Mf>!ɖ6*j_m+$}4VVdoDHdH˾mIQK~ Gm=4I `*sLow'0+̅EYj<}6 9)Bʩq+RZwPbNpݽ Pt LQBALJ:gF¸(ʢ>^γcB6nj'f>6}9jG4I9444P~g.\Se@EMr \W<gVm@ʕ:.z/m1ksflۼUo3QOCXnYV%op{78դq{9 9vwAnXLX +WtQl-Gjpa>hڏ~ejuKH%HpX7O=)R{7SҌ0ioLt6k )q^ P5ϽH۵vFDqr"upS__A>ݠoZEqBFu>JUTK?3?M]`?C'(>STyrSg "p]I]^ \.!6 0;WajAxjWG6 QF@*XK^y$r8lk,ٶF u9}5$udǯ_d?^, sT׏]4]h3whl b-KDNtY4{G ^ԇf"&G'EW%җVWkP p p" @0K5qQL@RuF١r%˖._Œ)捃BƨG%Pp͜< -㥑%B-cԸ~DX;z< +v,ٲfϢ%(a^;A H*[œqCGO D(aT^;bj%-Ǝ5 r8E̙6{: *O{G _Î-/zk9̛#I{wċeCNZg%'\H&R|x1"H?4|&פwS{D|Z™h?)hMCRVR`Is AaYBLn]V]}HhbA0gJ@閡fa hfS'sP; b?@ tj-n%^{q$c$:'D[9qAD߅w1"^%w|9}Q\Tgr$KB3 !+(U  ;\ p5'b*c,*v䌘WڜQpA 7pӍ"2۬68؈2@Dӭ4N3 5TS5|3N;s Yi*&f*vF,&aDți`x"0Kz⤓}>]_gE$6 Al[rY0eKjșsZ` Ar*faВkFECzHPf! b".2dfbZ@ A+糔 hXS @QaMm%BҖ]t(qFAIgXUB 5-YRa@US9*] +vMF~8%躰 㯬=MxpFBB$`/45Z׾FΣc(TaϡߡE80a4%hG.?C4a C3cjC~utԦhX5*Yv6E4b71;ӡlYկl8#+q"81g6k"W5 ojz&V 5"DUB^xE'Q32cKLAȁ́$HQf UmhUEu;ˣhӬ@tn6;ۜT>8PQt@ kl8:1{|\mH9Q 9+p n!OC uJw2qtzQrf|o|IǾ+S2J03* ! PcyAPY e+]Jƣ$gp7fkfNjM |$b_?bvI@Fl`qq|efMZ_5NԌq$` ,HɢsQoaiU4 :"! BPPnfуDjG*S[|~YTScf_x|7< 1~uNM3K͉xD~>yBgK?,T=tm98ӤTEpJyVn ҩe=lۥe*=T!N-AxQ0~ՌqYX4 ۜ=TdA}P]SY 9TI@ ݂AePEa]Ȍ BЃ((}z =܌НTӕ!_`yM]°ٟ\I8B8 :9^N[j%^ makeT@aU!ϑύ nhJ瀎, zN6Bɯ`tKCJ"c?^ Vz ̜Dz dM}@<Y&fAĖU" PUhgp6F$Yr\ B"XM2VS`k*ge^֍RLD~ܛZ~u|4hd=#䯀M _Hӏk<&N 9` \M>)%5;Q[c hjr΂Pb QdZ)1B "PqEZìҰy(\#Jz'=у"&Ԅ2AQ]ڦRM B `B)#FU%ơno>d;&6ƻAj'Zݘٝ4vQ uh*} fQf V(CjD昅 !pY`b4LZ/96Uʋf lfka V DxF㱝6{0[dUk7dhyrksRުBD"Nz!CbL/Ҍ@`Y)*(6]Ujŝ®r^ʛ2hvG4ߡLVlȗ(,Y+&}춆2|SVRmlJ5ɀ^2fbP骄&qr 9t \埖 3 1nu-%fpFJnYܢmŢCnc) } ߦ߾"A[J `𢟢@.a*_FlnGR vqN#qfhW/ZLaŅ+a&ަl"dʧ^V/*Ja)D_iئpR2TI7FqnUM2: Cۨ0hW㙵Xנu@+/N2+/m1v[ P6ʳ$l!uRb:S{T3F1@#&$Bt)K5`B;ת lVY6X45:KJ585i;1BpI ܚ)6fZh9m\h2+e6fbP4u˙odKvZ`@ 4 @ruBC"P w~w~~I1u\['ނ4H`V5\3v2nT7R0iwwkh XcbPf{0nx x޶%v Ar] C!\\Y. #pb+@v6 !'٫9ؗX /BAy+me<=IEz D?U@A=*$x+7#{݊&^9IX0=,AndO=s"?2ngnS"7]z'AnDSBoH*}?VuYvOZUZU:v1Ƶ+ C"\M 0C#bJN n:Y:@H$@4f/#mn1A4Vp ;;r%r5s!Մtu]Wv|7'|l튕22q3ɑhP5W =hYǻo(Ywŗ D58_M:{K9ssX}؋G %9bTٕe6#1[:ywK4z dtõK⋴505\cCcC6IocDvq} x8&X -zNC5۸u;iڵګ2*"Zن#=8>wCX{UYS|S TR3l7dxeԸ t!ZQ鿖szQ8@(8`A&T`7z(Q@8% 7tBRBQƔ9fMXqGURHJ8!%OpMWfպkW_>\XI!*K;n]wՋC!cᣈ(V9fN?AKMf-L&=V*&ղj6BtS# ztR+CcusJND4wC$׎/ctιE)=@((LPl)  6l 9þ˅t% s H&26Qb;l#HGxH5nm6R #!D SLxdDJ=n?K 瀕pdHZ;0O( M:I)K1R =ADN-dBH0R 1lBqWc,y,H;!G0Bà1[>s XH{!6=zۈ;ވ.֒=6\R7MlRR `xgO\ 7[Y* e t&KNyĕ 3E!r~jgju\{ 4 ׯ"rY۷E$tZX@';Q$˾AH2Azac0}uM7أG% pq&%@f4;̱ pcΘ1nx1@ +pܨJ2+5/HWsCtd _E6AVj>*Qe^Vr=MoY}6==D6hX*g>L @fL6E-NSpwc0 Rt#0A X;ap"Qzw:%ѻPDBPBE@2B `5z`-&hUMx$ *-5JY^qFE{+ J'2$ABo&.QRMD&SOQ&Af'jӰ(Bs%P}0,x k0EJv.$s>Blik&&Djʴ>[%Ms]ABlpR5FϜ)۴U 65@D}A8jı9ʡsN;D鴣h>/A w%h" B<%y kShf&2T3xlSmCQoU'E7ߝhko6ӇًĬChkw YPH@])`A##EI>Q7 nl7q`C\0}G?ѐ1 jPհ91v4w˃˄y+$,خC,+.?%n ElƲ˟z@ bsf0)ثttR)` bp(gLqǯp 0GzV JجMQgoU,aW+4ބ ̢H"@b x  pJH/px| {$p(OX".դ*Ǣ,N-Ԃ-2gM4Bvj0/j:1+,ofJ" ? 0'>D eq` IJ,m ! /%DmF>qRp4 iXKˇ~nグL`2+DĨpHEm~P&|$ChP* NҜǺ.)QqCYFL'<D@A" #55EA @jd7#X0AXT bv%Q+ 0GX2|1+L&GLoB$ !n+a%W:b [@<*+"r1ǼK$#Ӏ!EE0Kb8 "/`Fa.9F+0Fco+<dDpb//j7Q~)=D) l k|"Q:Bmzia+<.>" k ƄYҤnt,  ,ͲYjlԺf؋fxgp ǂp8[prr.0ADqpۦǖiܸe2F;_k,sN rjq)$*y5 c,!I6=%BG-s}!asA€((,,dlt+iP -;^m(R)HӦQA66%Lb =&JOZb??Ű0@poÎKK4䈎L_`n #$Iɑ|m&=:(VKŲ~kH4l~NlV@n$Ƥ =ߓiR\3,Iԃsl֋JWeI=0NCP%iT$ a40e5%ː칊::nu7l- "+mFQLH_뭌 SJX 'FCPF'6U0gV՞9j֢gZ %jXnuU v!.0L*2`BGGlL4Sǵd ]jTVT[vCҫe4Pft3j6SZ̾& 5֙rQh6LL3ZV"KǮ nڎnZi*N7V)B=$*s@dD"+>VV]eK5h.ۋf#2gR4riFjM F9M[0zw% .7{7FoOooʯC?,B=F Ksd_n8U t5-m2v rv'v+D0-wsz7VsyeܘпS? <ׁp!qa"G08tGs\3&S+):L *r+S۶]BkJnXSEi*PlN4{p1!#7Q**H"Qbd 9jQ)XsuCvx^cn1E$X^m䎋MilC܏ &f'@&A9AYBDyA*B2Q'>fXgʇmelst8Sy&0[͸xLTNdX lHa58wo 9/r9g1P40r~qӕms.fO^ooUy! Ͱ">02& Uvl rn(03yS1zY.faw/3.cB959u6x'jKE`lYј=n >veFQ熧b]6$LODGQ2Y7IP88„Ypq(g,'ϯMZTS󸥙a.U lJAJ " XѠ9>to%i5Sx9!q+NA&_":%Z@Hȁ̢BC5!8tzDG T e"^aVM[Y4H6&>G6` % ά'/Yg6֬{:EO(Kh"L黾tLLd`MޔQia6בdwLPnٮwT 8JmUZ ;(9RboGbZV1Il`K ɬ$IzV`ښVV<WukC387RsSր-A<ٹ@Wt5l|>OhCU )W "֬:Hʺ b\yKQW{Y _nysۑF9o`5sg Pp;sRs!9|ѼUUH )y&I> \a)zG݉+R[~y]mw3~ wљ( yK = ;}ʷ/Ga,qW敛G *N! `8 tk%#EcR].ȑ+49Fs۬u_\‚ ʘN<ȧjdI/awaeEg1^9 l"oLn A(Pѣ%QvHHŋ3jxC.b჈(VAfN?E" % ɳgχ(JѢSȔ"D0=Jj;L:*  icG#Ml ÒAQT* 4 UY <4kj$@B_ÎQbδ'!Gs "ӨS& X1*V=$¼ g!gե<+6jSt:~a"%˗2j3H#.tw1d >(rEm<~4PA6Ӂr6`B\V܁c,gYRIefFYnF^V1eLbY@UB~Abe؎ j֍[eYgUo9P>䇲5Al[,bpaTbwA eQhh*$`SPqkq$Ih$D%h|'~AqEF!2UA7;9cR͹՚CP`\=FdىIu"׆BT<l:e#JfmUSjfmh^Q`XCc"WM5ծr۝@l|ayWF WEJSvdfcay;[Xg)Z{.:. !&h@ureBwR͎@j'#fy۸{(FmϊH"Z2ݥO/) ateTQBPN:#+IE]l&3}HH( v|% KgU)i.Vͯ4YPH#zps t"-`3zN$JؾOI+Dm0xԦ\w05{7Q`fyp7u;nw| :j 6 I Jz VwN ^Оx&ynҞH rd-2"1t'}i-۽e<@8Tٴr?C$adEp|aV-K($0iVRkevK7´M!b^-.cr K=I|6u !rcVhLZPUZ_)7bJ,E\6"^݃Ȣl€ݡWl=}`XYZFouA5#"g9~PH;1Z5zw*ˇ;(6:N`eWCπ>c야 ڵ/3JlLǔ,l^`^=L˛f:z֩<Ŧ*?ז6mR*` ! @PR8TXVxXZH^xppU&Q2h.pP'Vd$Ӈ}hnV Toe}r7B(vExU|*0)Ur R|}7h/e]ZA]&.gk{7XfX4"MsGR[[%VTd'a0@\xÂ#!JCwuJXggNc#I '5@XEaPD2Ul(;A!`~ <"rr< q<" 8,IwPb稄``$FKVGI7CAb큌U88jϗZaȑXh<BGbF xB9gy'yA90'tMZ<gvz(fdFfflN^v ̀gz摜dKVe5UUx^dLKLQiA2F;ǕEex<q ٠qCY6 `00 Fs6W Р sAWm\yAr;yk\F96lFǦdw&mp0$JOU)w1CWcAVU~` 깞ٞ9`m 0+3p< G|P 暻#i bq 1qwq $gr( 7w'j *j Тؐ s=ǚN)TF ǝ^1&֗J:}}YCȊ]2HH`cJ@ fo"[-0l֖֥2hI`:y<  PFduC6PrnM=Zb Uka5VPVVmEe^eX|I*r pJ+~UzPk:<%gEAZUA66ݥXW QtVYA Q5 Qn --`%R$WT* Q 8s1{aa9GZ;b'Ȏ#!;bLJU(QNC룵ұ6,qRu$:&[q2b},l]IxKT{gJ;UD^a#`A a 7BHͳSa`szb<@ھ7HxJɔka_>* *V p^:/hbhAt)CePEpGkvlD%mths uDVq˂ K{7"# R[q˧陠) @w"t)+^ '!DqzM~-fK/6"l""Xb9sb@A` `Y\GiOb&V T'JvhvfIyɘɚɟCb+i NU|Vw-ԗ2bd5FySJrv*\k 1l rSSDz9c"6l!dVw~nD¯l#=#/XD!i:eE̲P9Ϝ{X0SG $ v8]esۥjuq2:#~q<ϼ6-DˁS3"o n WEp~&r?ilR:[rExL􊋺XrG{دƘVIVۂs {mxV5tk=gx@l6ˬuˑBy]/ӳ[9YN‘n3dc&LjX!4[GzHovv\C}W(ڨK8rjZDqٲ≂EWtF=D ʽ:bbY+D=[݄}=C [6OX N/^Rb};ꂤ%Dm&L+֑*n>v$:~l#׃D⋄XQ՝zǛG<=fq}'Um֊=XgV^)j?PgwgTf^9~檑$;\˘sG %/ ^@h|E,E!̻g ($lg18ɸkuۛflFͦѶ^>zݫV[hB<ǩ*M$MiCHucjC%]=gq{(q#zrr-r/s0s5ws9G>: kC "/} 9D.҂5VQul]%4qnױN'|6YGX=ST饈toz'Me4gn1GInGB"~"k2`+"m+ž^k(X[h3I Xx|7iOI.1Ed31z u ׬?˜@@BS 56Y`fGZbkT6]D!LN؟U`l:S?Vϖ>qgjcw:D% .daC PE5nG @<@(K0+%M 6]%ΘAa^FcС pQ5A8% 6tB&N@2P%K0޹SQx3,xkIR^4ңZUV\9Ξ@bm•Z%]PEyUtzqc5t(D /egPG8Uɕ/gsџ0(ĪlE@E X9yZɒ@Sg{ϧn4k8PSh2'N IN1Hצʅڪ *,ꌭ4]2!Z/AyJ1 B',8CBE"|)j;˴׮ڦ‹2Ԉ߀B<. 4L3: k";ژCB > ?YDUtQFuQH!]-Vդ xHH< si&8 #@(c(( + :/DLHA 娡NLQV$t!W.G=|P-KD!U/"g)q@ҢlS*m-K޺ .atKH4 6M5ٌA6ڶ»3B;o ?4%z'FK6dcٜ[lq'eD1pT '00r VTmIET@{]x,+$$*:DK-z 6֍DjZ(q2Jr1ˆX,6@wlJ qhcܴ Y:r̛K7nG[dOs@8(xƙlyvQv1gpؙǙiPjmqgdz!Ks@睫BUhm1 W:DoX8n~IVxMpX Pn˔nj;ɯobM\5#^@0r B(̅sW>;<|˜zP H$P;a}C Q<|lІTcXA=0a|" i8Pф ѢiGQM\WC_B B~% cBP˄jAqk*z4 )dqpo!GDXu3)bw$Xh:Џx=1hR)C,FSI1=q L*b@e Jaejԣb

!"TSg?R3Nq6S.;,q.Y>+:Y,d eY %Y ̣T53yI*|v|LC%r 8zDB4/3uvD;ȂƼ?(٪:%'ӭb:dHig"EJ(m&oE0Ӡ YnH:64!{FFPB KlI4`n,B$|GrԵ+s2@3B;FSXHj JkcJ̫]RD :,Z$#M B*Mذ1#@N[;/z("0lp!3>V<Kr>̜B$$M!ʢ#udDv\ $qMۄ̗X̬$-ħ1NJGb-1 4W1P ,`(HXK(HL6?(FtlA뜲|;E@|P3q] R?$zm/]C=,`APʾ9PC_Թ2)N3Y+zxd"L!ٓA`z=D'm$GL2R0_F: E(u)S֜L+^w!΢\T)_e[gY r\ &LХ6;N$PKZ1V U^`^p$H~\a0]-JKQSTT;Pg~ @`E40=B>KVg A͂1 u G[s[5$?<w\" h8")U*,UB9Խ MOb{]G^b⼖gfArU9eR^DZi,~Q EMSe_+I \4&. ڢ](grfԥ|ÓD@89Z^eSXID!+u>_:];кpn XtFoF99*IeWTlp9$wY(MKm-QrH&6 l$fe3dJN3PJ)+v+SMľ0RtX~θn`i5[r6'qCNSuwWdYDTgT~˄@@{v$LVnl9qd_" S)lgI?Ef=c)jU& I8NBtOrξ߭6ă|!t;>/ROOn K?`rr`Wkθ!^GAp7G_GwӸߑWx}Mְ>[vya\Vڴ[V֠/<ücRJz,ܲ_di(@w.QV0 ` 㰥1 71ZD{qq*gYfG>c]{֫Nu2<Ԗ52X2Yʥ: Ya|$6{nO]<3z3@A+XLEkGc ,H( 2lĈ'R"ƅ7r$; d ;qBeK3m %L@ZHН0Qh<&mz)F8:e.[5t)DJ/egPG2qjCk.޼zWU(iADI+\Ġi3'ϟB Yʴ3܂7sL`B7zԪW+ I$J@ZVy =ԶĊGo<ʗ3oynrdcdtiY/5l)wnRKL{v PoI 1F捆HIU`S0 Bl\_|%4 Bo|P~x"'ZvW,xDH$JpwNrw$iуMIĒKᦇMƓOyGueyrbE$4YNyyPƶU2& 7d_q;Ђ-uI9,$V@Ld١aZkٗ aHO)膫HOՐaYх2=d ^xfu&18Q5Dy$6)c &hoGѰ$ ^hC~8!EP ϻ 81qI9BeL.dAl-`BBDkL ,][Vc) E9UFͩZ$lڔl"7)Tg _9V"TM^G-ُnkrMz rcv@ ~Aw$sRC)3c uzuRBmj+K |e#Dؑ o;4!dHXchC)B)91P\mEt j],x¨||9vx4AjT;C14og13G)dpcyt  Ā[ȳeZ<ɀ(:Nԝ !Dƀ0]* U.Oef[j4w2"=K` l$遉|bXM ̨dL$r^*X*ֱի ڐ ṣ+x+\WܠB@Ŷ=:ґSe6*DpTNʙhN܈7ڧrs8!>.<-;Z^x-6o@[¾Bi.SIW f}NcVҝ^i^|\_l’B^3;@²_ &<R®F"-~9ҢB~%)&M m^DxB+R<YQ-5.ʥ10i1i^|,މ6b~YE6Eɯ'`^PA҃+l>ʲj^XU&,C9DDl @{,_AxHbiR c:Lt^x6D]ى\~ablz:bBXNm2-gX* ƨBŞIE. 1do/l,. _cD&n2^ +[0[2ZDpQDWA $a 4F`/].C1߉@nDw*Qr50:gCG r%XFՎpHg,#2_``4D/9H:S54C+A #% tmo cFX %Nq; co)%ߤ߰yGBow]|/ ^=dDfST~WΞ5$"#h!!Κ МċƝڶґ4tFwFTXF4@ E8Ie#g +LRP:P-H ߅g?P"g\|j 9I7!dd.66|6ؿ}SdkaSt븆nRTHF0@ 7I+w3y \'y[v_y]lP P_WSԧ̓ӡ5ٚ, g<;DV<Ύe SD|/\+Eֶod^{-n ]d}l ގ1uI Ĉrcoρ(K;%Q4tbD)Vxc(Ǝ HP":{!zD S'PV tyd"cPC>AAs*c 6qsscAz9իYVĈ8D@E 6s!(L2QMztaα{v )H$LIGOC`ryݹ0n?޾~R-\=A=Lܣ9@8F4x&n - 5ܐC qޡg`9EhYQjƚsy92K(P r!EDa"DSD/n ""/@y1@L6wmB3Fs<3۠!x1#B@i.M$ `L)j *_@Hz> ## 4;>0hc% 4H#`XgyD[f}hVd͹wVc - p$SD#' G40կ /\,2=9,2>M4̞a<CdOr%EsR5'}YHA猌D@"*gX@'õ<]י,:V)ޞ-R (5*\Mp%a67V\Yh(!n- xp ;5$K;7*ݴR4@4T7 CNm5+"Pwk PA{dD iL9†e/B RLk9jZoPUAko`7_i" cX(DÊ#pXV((8V`A]E8Rwm#NH<*IBBD/kelք+5׫U ED XV5@Qk[C1ӣƃe1: guT' hsBΒ q r x=C&Ac` q cH \T), '$APֳ౎PO3Mop& 9fR v|9I&̨ͫ%I32]@e9Nkjj^Dj (a8[,A3Q^7vamp4#U;F#3!.r#)WBZ8B-sCY@BY+!ÖT,HhS5NS1ɥ"l ׶u JMDS5&PϹb AܑH\e+_Y ؠ 0<ʱ3y. z $p;+ jI#Qq8-Oo/4TƌёDe.im#("Mw_.L?akʕ-ۆ90ΆkLQUTz-VF& جxeAubUk,k? (ܬuBъ)c EMҷ7*zk;!>ta 6AtYԨ/r%8Dq9*/ 8,(Ғ1|etWka+yCbP9<&G;#D@5``_?7|YX( e] IR[sCR$Ŵ r?Ѹ41nsؠZ4 GeO zm !KƇTX,i m*P70  ਯP@&'4A)e ,tMhPK`N^ tPF6x t!e| T7F&v^ :kPPE<H$JňFXL쐶YV?NajA bP떮ԤRR8<#h`TX0jqq*ߖK- `M+O J_T ;.* ]`q xvvQpmOsm'B bǖ. n))Q!dfQ;<,.gVd`diiF{tNh;E ɾ&"q:ڀF;8A^6L: (xxJ#O'Q@!yVR4{1  \`֜Q$a1D!("*o*k#*⠪VD#I8.(Mq`|A~NP(t O"Kl1rfNzN|2R4R0yƗ4"<)pq2"H9I!@oТ3#{C2ɢpsYVS 5bq0 NS"1kR4(oCgP/T@Lj,X 2""I5Q[ ?ӣ(/ ٖ:K< 14"ṣ2;G=ݥ\!*."`FIzIɐG@s5!p>MP(66%ᾀC FcJ!5+E )-pC0rH{f֪s& 5!@ 6Xp?EI=!bHbtTc2=XL %N "FŋtY`vq oNX,O9D - 599q&܅/QӪ ;S;IPmDkPLUG%5Up -T\'QJ#jjA3W!yL@@X*rr&jB BAbN365z[VbJ_J(zt:9F1?UJR:Fx@Q_-SJ#csG]4% }L@m*>,ƤQLd &ab&Oa@*`ljU0R48Ck(B6`Z"E&k&0b몱aQ<F?6pa }Lo]z{?X{MY׮4 &N2 aaXnv08pgg=gV/oc"0@qtWUq7 6I)5wtr=c>6UYXbX\(V!;j !|&`rOmu(Ϝ "\T@;rI2qXzwM J\S t+zAMU|khYOXae% *RAL` ~@*w㔐8K8Լ5iZl{q8<ղ!"կuUc ƴ!pza:}_~Hh\jՆ՚5>"~oY?Z^Yѯ3 p,M Mi"L ʋ QVP?D@Jsj7_;AdfoVLϓϦۡ"KvX0&aOМ[6Ğ.^ 4x$ (ThLQ jѫ;;z4hÑ e)hǂp3A8% 6tBhN@RH ҥJ GIݪZ5֭\vJ/+h^ȋLRR8pܹtu E |^ƜYIg#J8=J/P ݙ :)\EH򥌚8w JDrɎćOb,6)=;p8Y#"JX"L9yRR&}?>힢G 9*F&dCd))~I$Bsf 2 vD>e{K<3Os.c26Ǣ9ΌSb-c}q HdFRjҔᆍd]VR~^Ppd^vD/HjњYĶ$0#;=Q'ny$"3(g|ZGiGP|xyQ"J{j|B)aX`@} C "4C9$\*M9dHmpC3\cM־c6338 5TS 4xN{~ ozm^E,.u: ɋ`@G/ׂ.ȤFlpxI2sB[h*,NvQyij jjJKFEY,(йv_Z >4a&SP˩<+pg@rAvjvn \`C3O9+ .pCBįG@B$ W’wIĽf c?M5f_+p 7ezc8؈2K;~5c;6٨8ȳnr+2v:ݤx`zUs@%JPss0T]Xj21!9%9\)KC&@x!$f9{-F #QqNyR?(Hh'a Xkb"Mk4Vnd 8̓jG]/S^=|O."FӾ)#[hb+AU_'Kgq%P$6BD'e tpԕ"F|1~\  Ѩ%/"j"$A C,eJ^p=BLgPb"W xH-2*\ (FzJ+kJTHr)STH( ozJabiٖhE¤1yCѐG28$^x٦Bs%! _g#[$z#(H̘a>lDm$3x,@G6z`?@Z; j 7G< p/O6CӰ3HW}ᶹK B sAƜnmu[F6.u E[UIF"{K'?QJv; :hXߪAd Nh-7gfά׌0.Z_?Ktm`BJd; ĝږ=D 4t0"Ɂ |/pep7QbK;tk= q9hTB*Ubcw)gNsh7jbXe?H*s6L>c[r+zW3jA| ؾT8bxC&֘ c ċw mP&6mшCvjE)F0`WJ,Sgc¡@BBꞋa|ELG}+bk#6!h/]EhdC;y{~}ܮ:N4a DA7mu`Y>+Fe-i f /{[tbL[[/~1 &t_{RNeeUg,\G:dTtDKQ6eanm;`Oh}4Mm/H}?(D9M~&kRm&? Ny+s -GD=,JRdWGpTTa+TtUU|/XY`SGoӧ?Xa$|&&W f̔vE &`|tLhObgObHyDDgaK0xI1!?P ZU|ATN$v!<"0tZFyX${un$Q )8 `TYS`d8%<ǰ[e9Sj&ȊE xCr5t{^7RvX&soG%wGPvuÒ ~R"P@--W UlLDBOhTq|(+1Հ_=5nG$XK qh},f&!zee2v&&d o{2iI&wJ)3cyB6_sG[BF&c@#FI{ P'v @}a|!`]n6gGv֊[K9>%X[T{H{_Rs_`':f1g~(g'9+h >a5x"}81(4Z&_pE~s'#YH'RcP3`zB1Tc:c9cCQ<w犨6U)۔un&pza JS|,֢Y0zF9]^;r/R*IDي)KV%Q{˷}˷ EQQI+*pJ6KVf eTZʌeH]+Db 8 :Y{T}9_k3mC;}IO~9%Rsj%j_ tqtp6Z6htP kGȪ 1WϰU^&+cj]"ͺc-c?"]"FʇKȹGz^bz&99J{ x{u)BDljB~H̐>JˉwG '^Й >PձtKtK,b^V-آ--".b.v9Neث^$K_wŸ٤MeԐa)@X%\vјA7U',`x!- <-x&|45"}7MPJfr3MDwd8ޤ1(ڭ)ދ(_Y00sl2#CѰR<6lR=zl%MWB y)ΐ=s|Aav!DOީ -k|se]] ; ;c:eiC< /w.J&n~=:l0 Y͏^z0u rRJZ>~R[G u4ʫN`Ccwֵ; {xЄxBb @f:hI7N_S]E]z7e0<8/d" a$AO@d@BIaPƎ GPL:z!zD S'PV @L n=TPET;slQ>{b<@̜II`e͞EVZmݾ[ mb,_ʬcϠD*eb L3 4eUHʑp7niBVX9 jA ItkBw'|K(tiEvLjE5l"*;Tk6 ZkLֵNœ`]$)O%Z 6Z)> f$Q =:K܁dYv7 $kqKlSL[:7_t!ͤio-ًꁷjbI8ЏDT rfz|x6tEf7 mq# eOmLB-$};ePj @α9*.,x2շ(t$sC2EJYk# 15)(X}cDP[J*(vZ셐pvzgq16QE!vli8-_xA8m|4} nq%ʒ_4m T]ųyv5?ؽC햛Q@<3`S. qDZgl'WD~sMӓ^ 0yKHe+,d][̙>ӦleMN 6ێ]Idv.5|efHHéyJ瞸7?׆N[Z&lʗﵕN~:޷ua2Kp/kL@ODc,69cL0*=;2E@ݲ35  BH(۾gs!o4IV.s@l! +KɺYC,3dB4K;=X;DC)nho&j``p0>)tkx%|IG 81)Bʺ$ MqLb{̴ oh wlUY`Phijjsqhy1MÑCm`d8|dJ0[I\N'rmNr<}P82=h:JLJe +HtF89X ʘ) θ)c (sK m N17;ǛNhv":,*BN?ѣeLY"8eR!5#5.Y*PGLR 87*O jch@I)ۄx<Ӡ@?5U kzʹ#נòx<Ε2[uc]X nIb)]"ֽdT;̘Cb*f,#A>^ [Ǔ۷a,| ؄[Yt=XF8cAedX޲ȴi7dF[HJF_Ee`ΑM@{a`DV3ԂHۅ)@Y ->[-èirƑa+z@x -=0흕סnaNtA5qNM%Bh/z޺)6S`n&jګD6$ڱVi|-"02N|"q3uBIf tUJVI%Cߜ:g">ĖV߯aN"[]V } |Tmcd.M9j1g!,\,#B"})0݁.e\~u@ݹNt$vݗ.ʬk]Oh O` "*– LmՆ4TXqP P0gs\.sGmmPkY*%顔X χ3Y`6Bȶ l-s ]3Ϻ׸a#mnFm;g֖voťGImU+/0s|S b9]%r\͆EVV#kx\>܃M/7P{o㩥4S?ogIu=R̀ԲV뽴ecPޕipl>X0M'ZIXPpRo>ѵNwpON\C+%u|]XBoV3`yFdv@z`r;Y7Ko ,ow&ZZO7Bw~ g8<=0݀`xq'4o[{ñd$3ew+&if5B*lxB0l([v`n 4)(Iv3oz D68xUWbzy] yB7e#mU&W-PQ痳$jlzOFf { UBacRru"Gzuw)V]NF#mlnEN{ qrw +̴@o f|*߁[gvX v{E=6X%0v܇9̮yW I1~~G2lr -bи'!G0qJ@JPdɒ&O %$ r&͚6mH` A4iMYĨUǏ!鍼)uj=[u%ծ's ³ƎEH⥌8w JRNI5)+M[+ vg9*b3mSh$vq3Ξ?8p=r^((Hz5֮_Î-{vk ;Tp;~L=JL޻c8?]x:8u>hD"qcާQNJK7+Xա#'vݾ pѡQI fg__9xXbf@d Txxe^^([ :@DbWtcB%u)hC Ԏ7@OBj@G/o<ĝCx@ Yt/v+nc$-y@P& r^PQwJйǞupޡagB 8Tq^*ZMG7tX V_p%Rٟwb t$ca:`cd$ZEBǬ7DM7rۭ߂+;`#iH34PSM5֜8C1 x&7Q{I1O q1\qY$y6{Dhx^04 wrB Di9|$#3IHc|Ub(2un+$&, 4ڨc8&Q֬ђc=3ols--aǐAgzxɚ#BYa@" ~Ƅes\+mMH >HZa#J իo;yHQ ^Y.)LBa@''RR$H5*a12 wՉhz0wMeS3y7 _m*Q6ݭzBG-ෂ+9LÁKQJ (&u^5ǜF>Xp }#1O +Hc[QVĔXd Q5B0 r@2HNZ3ѭbvj,gamp4v|U;&0)m,M2UR@%ҙ Cy/~uM8]NCe03vHkq*׍b."?Z60$ <@ܑH45/80 ؠ 0<ʱCx. z $PoR<+Y&&'_n~i#p0d-\?y U%VG*t MhRN"J *=΃4f !o"Gy!9)9rn Hl)bZWF s#[()|K1f%Bi\=آ´0?ft0#dV(;l5`%x(V r'dr&-Gm˲a ZKVfC x^#s6 (aK P IPW%B/C] AK1T0 [Sőn됭n1kY2iUZAm;QӚ5vzżXpv@ q2l$0vB\zj$`@mՏw )f/wxip7qߩ;z0U{C28d:V8k@;& ȇWư`Sژ;sA, hnïFAoҠ@AD>X@mʮVu/o}3vmG{/{U=NF%},v(ټ0@< voAokaUQvu>oxj OWHe[Ai3YN'بA\A@A@}@@q^aEWtMEȄI:Hm_˸XEAu* ѕY&waPJ!QP!Nm\%)4O$d: :dC9])%a$` _ZraM IЃU&Mq!hLoeLB\[(`(vEq&0! <\4SD9dA^.%*NMe!\8,JJ0N9}^^.=u}J&9#E)SwyUMXb_ɥP&0 d0@$eJ3@ 8A#=H#ac_i6:Z7ZԼ5Q9mD/uԜ*DxP41dТ@Vw18VݠMPzTg)G~d #J$JV@@Ky"śA(E"ZZL bPJWDD@u6LԸ$h;mG ^b.x+qΌLA&]ɚb3`*m!y! [bg(ѥHV]&8u`dfx,5fKaM7$e *I^PǾ";N7 s%eId*ZWf XLEF+<#%a@ : \'u@KB w2<-! ze΢cYCRzijL&8RP%9-j~%*F&όzd-Bg V@ \g Di_`>FLF() i]{NR:McľQTzyہL=>MbDşmKuДԑ)¦ML}UM|A}!I V޵%%sHN )y@ i4wY j| vL.j NI(- )MQLexDIX) 25YoKl_F]b$Gš+D- ^Nkkp liHڶ{&u-dE04ZuÒfjrsѣ#|(V%ەN;fi1MV-$JlާKەbqZi4vlUC^)ԀWlld Mn*x./ựj^AaѢ-8X>%-Zظ>Ԃ틴V(ծ$v9(UjD1Si q&OnFr }%I^ʆ%pZ {̚>jPj^]lnT (ܪxћ։n-v`iIт2UބV|IZn"O\MaY$GG\cH]Yujllp_v0l.ց\/QcI#2TojWS.ۘT@o)Ӛ0VlQn 0MTDbb8'*#T0Ղ@(uku)N-d֤xT%I %a,mM8l[sL+8n%m:AA\xi¢DmRd3V$A& /@!kq_(mi-Qc6fd gFNVwr 7J-J-kbNm2'wZD -u奸nY3ML(3r6L y2d.#sΥ$-k}pvE$O(FH30/A%'F%( wa~dG!gJ7GA(@ D( b/Kg_4 50$h2@&A~ȭD_Utaʲd11;I'jZnQqщy'>'Tp²Mp$"gVnXᰨЕ)'TsMD'F,q\G0g&51q1=%e_ؗLe4A*IVpG&hKք+`bs%k)WڥHntx6DvVkh_""z8{lli s^t_J[ޱˮg0^$8:aC7MHO!oUvg>SO_VlyFYmiW+G|k&h3enu@33c-ݳ_7WIT"b'-[O'gxu,u"xr=K3L?3ǔfunn*Tp6O89 -YĨwOh<`c%棗D"n2i7R[ai+ZxSG$3剣U'b YG 8J*nKI3< M:\NW5wnMxvoz3RJf?M1jyh?,gB3[&TpYz0okU'HW@y3:xyoz(ļb{kbeeE'z}q{#%}{[.xpp<3yTԍx{xWHL," ңknzū9n*Gq< }W_k+;NƖ OF·7Ѻ|3ÿX5N.#P'>"V!9Wjtn{kC}Ǟ^g GtAcɓPb=)<+ Y7۳sjkJa^=^&P*DȏLSf7uNc}G .^5R.$V8"]+d d*̫~+_]H~NaU;O7vcfH6?NZe3A@QL@"E%(1lbE1fԸF pE@E 6s!%M@bCv09hш(PiSOF:jU9Ǝ GP == 'U;]ґ.] ջGz!E*[œiCgk۪ Q"GXռ޹A 6q"6q=hQ:PgøEֽ m4D /eıg"H&\h2%-IPT,'f!qIT#E=jT׿_VzZK0c1sk2ۈ!dA@4#, KH2ꎺβ=VPŊ &Kl-Anny-0b )98k)DwlP"+c<<0Lқ(2"㯩ZB7\?pϪq-A% EPj0p1IBb`a([&" P ƶpNOY GJ#c $s=ݤ!R"K]I+4xHqL҄3Јp0Xs@4P( PU-F3AIs\:4Ԁ(L, Tv^NVZ枛M^u|X`sJ{)"5UR)# %*[8+oy*\5dwRw?y+z5AWU}Z|Oㆳ~8bN9J9&.۲`u.Z2K,iveH2hf3gz0~:27OwyT:Bj`\R4nk(+=f $.El~o׋nU*Ye[̡t pC[ "qhE ً5,Muwu=ڏF*wR݁9V7@ +})Lԁ H,Nw0zqݨ4#h9Zߊ7@k5\hWJU{Q՘`Oz[*NHS(Rn, EZ$xn-aL6ط((Ёs889eEt#W>>հ:7TQ?@zҘ՞ERQ;!J2J&6"I5;>NxFLzH&4q)ZىQ2ԗ/yFc1 tQ RWE 5{IP ^qRƈ۪1Nw8'V#فHqU+ݷ6M0k6K XE N` \C]R'REGK.XyQ`YNiFJ+#VIzYҺa d lޔLeD& 槎0Q+I٨upwK3:m"Qvhtwdb)d-@HxQF&˒q-82N}S}SER\aJxW9h :Q6HJ:-iRpJ,Y|W8pE^-G5pJ`oȎur=Lvԓ%|#{ߍ6Ѕ,yZ+tm'fx-X{ҞU"D6qoa{n7XlB~Y1K<99:p@>9Xehm>G~gJCnHb$sNq==:ΩW}Jvli'-)l70 At`:^1s885sʳ гs` ӴN ;A>;5 ?<٠?2q^`;k& @( .!XE]Ea4FetFiFga'GaHHaaA@ZHDQVFKK]GuG!LLaMtItJL!NLtOtGGMTJJKNtKQ5FLN uNNNQ4R&P/` b!as\UaPXn!V5U pN5UWUquXUifVoXuW}UUU5Z3VuY{f~YuZZVUYYY[qZuXUCH A]WAZ$@^5_s__v``5a)P_V` ^'b=A.a3b GbcM$da56p`(fq6guvgyg}g6h)`h`nifkhij6j{hviifvk6jkqjVklVglk6mvmmcnn6ovooo7pwp p p7qwqqq!7r%wr)r-p;aplus-fsf-4.22/src/html/keybdBW.html0000444000265000001440000000025310242637227012771 A+ Keyboard diagram for black-and-white laser printers

aplus-fsf-4.22/src/html/keyboard.gif0000444000265000001440000030433607215453037013055 GIF89aqrȦb^`fbfnjnʪjfkzv{RNTZV\B@FVUZ^]bfej'' 33??PPbbuu܉β""&226bbfjjnvvznnrʦΙѾfjl ^bcϺ׾VZZjnnnrrκVZVbfb^b^jnjnrn fjevzuɶ02. MNIxPQ>٘ JJ3{{V񪷷::)riEE5??1۾RRNnnjjjfzzvrrn²ȐkjPvtTZYE-+!$#[ZUꦪۚĊv\ rnmVDù/%Βınjjjffzvv¾~~~zzzvvvrrrnnnjjjfffbbb\\\TTTNNNIIIBBB>>>777222...(((""" ,!$*\Р2Hŋ3jQcĎ?(C#SɕQ"(fH6sYϟ@:F(ג*]ʴRZؒR{V3jGi9ZTب9H3NHv]*'uųشҝ۞/^Uuo׾bRq aK-*WC#qBCBEW=[)c>onV{-hߙ^>ڰ'd~$ {߅{1Ml&ޅ$Oߟ}$R!3tW@!H߁`^+PvV„w L`_N ^7"ރN3,!7#}e,'e%}(aw6cvWc 6]u ݏ7$z*Ğq^`3'a N X%r(ᕨ] (:ϣ餔Vj饘fJ *V$ <|$j꫰GnHSCh믾N2k :'**lP4n(쵰>O<,$.Ϧ=}B㒋ȳ AZ.B;x . @ګ͖+Ic/jղqP"lɶ~?܃ 4l8<<3>)<{ w܁M?-TWm5w2+"$$2d=uZ3Ia#tb7-wft}-3OQmف>fD>$\ =w-5`-8䃣=$$DKҚyt{~x%ewCߕߊ;[:^gxu r_5z c<Յλ˭=6N6֤_5/٬# A?E"hCpLR 0>qhDA %X4dX`" .p#d4\bA)ts8F4XpT!  `AB$p+ fV C R 5рebx0vЁ"rB)jЎ T(fjd ^6O"EJ"L {lc쳟*WVO۸Xt C &u;D-YqŒ40$ l4DH2oYG#rsf!Ndh†<<ߨo &iyNT?֑LO쓙?K^A2݉x.Dg?Puf.wЅsDLCԤLit[6&8CL);N(O i}sTTMA!4Eܔ, lkX8vu=J@Ԁe_T(0hk#$HKCfQ_֭$E\XBck0{׹";ӱ*PgM+ie VAU])ٟŭ"[@}&bY?m.IZ6NzkjHCfE7׍2aC<ֱqj]5j4w TC7/Ј;oa`nؾ%@upW4N pCYir6j4026bnTf=w¿I|W~;8Ugu\=/#K%_|b3aerRQzGl?AߴiKeD/ф6b/ ׭=:Vӂ%BUsڍe- Agz(Ah.8@J}цx ؈YךwQۚgmAkL_л4hL=B`4+KC۳g5}k*4F,Ĉ+nA#py_!>i>=,ۍX?䁌/8c09W՛/U+y/iөrMǑd9=!7"A^7:t@2Qvg}??Ǔr˼w9^v0u9=btMZَ6jS:M{AUӁJ/v+a˭kxwm*;Wvvo8y zI':=DU _W]^bg)dSt.M^Ű'l;xȧ|-}[~7?'qyQz ^gz!sww37`am|QpdG]G (X~ K0kK0  w.|V pvfCWRu']F7Fi?SLW^oPׁ}wef&`QȅLaaSrD4gXulvwpw> @ T% ȁwhchxcURuOdr7ddT BH7YX,H+p==p.Z@ V~t& po ` 0ulĄ]|Љƌ0 gDc]+ -fyrzhRߘGoF%P.M׆odXp%yPXwx|V5IwDtBSiq밀S @ Бɑw&D pp@ "9?G~̆$p 8MxS fZy}6qpHJE w#% @ (G Е`P_I uQ槊 b ~.9% &רerًw05@a ,ĎjWEd8wW(Vi(Lxt+;~UԓW@^Y[jI`^Y ttf`@^0 (퀑Ԓu8wff~`iRtl?Ki##)|̆V@VpI_W7@o9LP'P@~* :J HJk?hD~ Q vK4[,xi*R͵mF)kW  F ؚFH2ٝw͕޸8Lp#@`\Ze@ v(Pt ]R:P ?(ꠈ RS% q1l4^i| 䁿d5(Jh|ơ i4*#p*b_@::hXtPz Z@Р=ZYJ@ʁEz%#( +bi&v| ^G+=PeK6X8*>*x@`ͅu, Цtsځ P(@ FZDce {`ELǖy0F{Z~W"~TEnZv(׊y-J|Xt̶ z] rPdysj I?}(prΩJUJpzzrwlf%%XX0[uۥ1{LrKr;QhhjkY((Р'~ i/RkڋЌȘYg(.j'x X< 0h=sOj V]嶊wj@8`t [ KUF=Р3:&p 6c ik_h$~4벏EEtfxP Xi}kK*'plz@adG{0|ؤE |P`m +^c5 Ќ [ P[J ` rU鑐0 9`وW?\qzZ'^k8tJsm r+&`.@ ). *A 9v( $ &Р3K(⵻KQ925h@ e*V]Ί( Ff yXn"% d7<P7'ntu 9`̱o&p ѤUr/,2n6phuȇ|5@,ǹtC98@jx{>K )K J0ߐ ]lU TXg ŋ*Ə}qP%)mJrK/x'` 6:{А[؆* -m9Җ8 Qi|КFdlY@); zx zed̋ʦm Vl{-؜ٹuۥ *rЬTfKpW ^e˾üzKР#nT **iktôX9D%m}6 ,u[D }d+ҽ 8@sB,?D(p D0!I (`аP ), ?TևJ\ dr wkkpףB hMT -ÅR9{iiyP]mt|j`k QxlKsn`墼a_ʫڞ QWʋ <}kzsUhvʕ C7@mHŵtэlKq jDlHtoK΍<@U^5\C) ف,p% 5)h k}jn k$ɩnmC닞3` x(Jl)Ԁ~ )P9) C-?C_0iq./`Z5N sl s>K >|XgN㫆r-% ' =p pyǟ j~YJtz2 Bz+T@ (РP ^f=̮6؂o2l4Uj ԣCFX~jb?AP3 ?LC"k7*XMlh(>E!Ckf D~%9Yv `I":x?.PZpD$KU}FλUp =NS",B nD)$CӬ :8@ďaK:_bB 2C!$BJD` 4@I%gc㽾6NCF<H:^p S0$HDQ2aSҐ7B6+N<ac? 9#*$H:AFbR *DM9e ^ۋ1,<LhujP"K0qOPh#c[BCIį5[k,X O6$ȋ% [ T[@/,C"S̐ } !\H8tFzx(Q"SAh̄VChكST1Om1"9L;?AXȕ3fbC YF,̖Yw'ƒqlӐ[ 1rOcש1v)efD,5^q]J,*“ڣmH>!Y!aV!Gf2^v ;MҠDekИV^J^5*ud[Ȳ=8돪Ү@`i 踰djikxhhr8hعkkk0XӠ렧!C ي9 A(!/jȸ'S@$j ֐HǸ n?I8< b#PBzIUW{%,ҢaZ| UQɎj?$Z40%=4޺*80  "9D# (ێf;H0Rxɐ #łpjY(DaMyJ)B[ƈR&HX !4× Rh7' @OQ ~DP$ՂA"@%|!\1|0sX~itXj`1#xxhй1X:kx)f-g4sd2{bLjx队ɲ, `,s @C @U8򰦪ѮD`ۍXD S9J8$08Cp ar֓n; 1-bB!ZpJ^XGԏ?BGӊ71K &-A814@zl-ύ(&]i [ G(`$)^S*<E`eǐN#;DV"PQ R\U9$cI;=C`tGFa`eTN]T92#Fep3V1(e?;Sj :&fd1Q ∬f]j jh;V0ZpZ}g\*iU1?jXmHe%$q̑PhOe7VOaxTfkT^}:Hxl.Ped3#8V6jbu^kiuj36Ou VshUB䚡Y/!V g\)J) Md0b9NMdNǻk~%8 gEB2kNafQi6FxH`ojdn} jOjFFo~ag'QFA!˵cRjo0zgy8Yɤn0:<_o:Sfp+LMeNo\m %iΦ8>f.jg &c^~q rsqޡiP=<ug"3Tٞ61߽%Th5de4q,lNN|m/)3o qcUtxrfTOu1.,jQFi%d[xfirrF Շ^h 綦)jtkT؞1_e(BE`ض7"[OuPhzj;U{ǠBmfXNqu*AO[tF?sEpѶ&lenmgOwjNNe9ᅇ2wnxphe"wB/w?jW hK7c_&Rdt*b@/Ŷx 鞤t4xq"~czuy7wT>Lyyy/wtoX/sqi%$QOv`e{e֎ kxT>uM${/w`Bfjw??H>b|rUÖ?5u~tp@'Cq xo),& nU|ԡv–y f{?U}m_h.k}.}QC,8Ѩ@%&XѠDj뢡D:J2 B蒠ɐ&5JD͊v&JC&O|ifʟ,%i0ѨC"<(եFIW +XcD%Jl 2}붪Ҳuv wVH"Edm7o#N}R4k7sٚϢG.sϩEKkgMC<$僊Ύgߐ~煪H_}: @jQnGxelpJ.ՄWB:Xhj|r&MxFWo{wFB'SV7!_IYDu(`ډ)i*UŗmM}  &YHK- 7$.m}(XGI'QFiKL&aD~7bF9BXMaeNecmHt 7`] 8rɧlVXHW_o~ )jՄƢ(v ڦqYkɨDZƈ$@ȁ"nuK5${.C@Lܛi eH#H9-qThҬeA*#ޢEfUhn F|`a锇 j'E=dmGK:|.=%KiTN V%f6Z5H#4Ԝ6.̲˪Q3 -+Of=lZ16#m"I t0$z5v\zf`XPK / D! .t! %|'ErR06JC x0BQaVw,d}"N^>TȽ{mB.yTIץ1'BX@aLm^To>{'X܈% ;$oo]Tʃ$R  {P P4ݿ'4Wmr=Пݸחu [kr?*Х>CkxC66qc 8±ie 1C֐78P4jl#7RFF6)BW=-dN!}@*(#F4M^I*HAݡ*ipDgN1ֱ%B8,D 8mnu&vn9QRޫ #PPB-H, ^ED2)Y;j)Gm Wبa^I8KU>6r'@BP0CҦxl2׬"2):YgA~8nV~G?QG?|!25a|Cp5qS!8SEV~j !E*āVPJHvds _E)Lw 5t+A 4+H'.\L'1@w.HS +`{;PExHXi',UJ$//:`d$*LQdlsݾ(?i"+!O`F(" -2ao3ήcޣL"bQ}*fC&pȊDlƐbq|=BL#'~Ł/~jf)~YP5 V-Aܹa[tmXHr+(#ʳ{)> +Թ-+FD+ " J\-% "9!..x!etuU!%(yI \C ! M3 0,yqBK^A3Ǣ0i :=dXmBp5E~̜MgḂ)ȣ(1iD>p<>:OsX?4C?fmZ;<Äf6pFcqqj[bMA@ H/^͆v\VSD]( Q!vr,5X=)!~F\Dbj )(RI@!~^i ('yggh[=uU-Q7Q\`#)ݛ*obqg*'AUB"1OrPRͥdz P$ގ`J]5ɸVNAEK2|n_l rGDآ-ޢl݆y^p\VDme!1vƃm: 766=T8D?7X5n^C7^7HCjP%cC8-8ClƧcP`D SXAH$yHGpDQFG0٢Uy EࡘvdAl#z)mYd&ED0OlkUzͱVfj X $ӌ \P}YTkbk[TF/ )vqW"n+l fTw +U É UL85)dqd^&2Վ 5Qj@B /,"aPBO\9{A獚 NDmm!Eܕ_B#IE*4DA ".adF, f&˽ 398cQ(;,Aޓh% [5:?98@=8o7?9PC6?ȃ:9<| 2gnhѩ@D{B|+ dY! I', 8wUO)UCO_RoPoև/.%.|`X(MfI e.Z"P%DNܭjm؜HmlnGtA+'NR5L{!^RnY 5\))lİ D@dSbT)ދ ̻ ,f]5_,b(fv&a+}ڎl6?C?nj?5`S?tԤ_@;8(] tE@JgaxIw$1[*.!L$E]UcvRI2t8rj^aDdž![%Vwom؎/W.MVBR|Ͻ4$=^F!fa%Lͧ4r'O&ΜN|ґ6\6}Е'EBeʬ΍E\9@\v!,Dpgx=D}%;W:CДÿ=`99HI>y@ytwiXHH!wK栝 OqE^$Z?HIhپ)ڽx}k[; r@,ĂO{,ĞDa {`Fފdhfz*J8z/Mِ\V)0yق_W 36W_H*pԅoèރVw,MLٴh[4f5^Q:ڷND6RiϹ6C.[9/0jf8C;C9̐g&6xУ7C;FC;D}l6::C֐5|:חC70B,wR`M 4")W|Š!x Į:} 1Azy/3!'pGZkXύ]VHX #0V+{ wFط{賍^O1}'AE&_ۨpfGD|X'90jjOz@L'%1;^~ t!Ao,'Z/)~hDmChq2z5JtP 240CuV"C(j|h?Kf ejӤF J{R˔)Iͥj*ԩg˜0D)HdSIL(kV[ Yī j @D&ޞ("B{Jd QP<@zވϦC(JxBZ)~l U5RL0Q9E!ÇpJG NÉzb#H "6=ȣI 2DF8c 5^c=h|59h> 9a8kFJTlDH ?H J@(qмX̱ kJd#4R(oGȯZk_|% [.ƄPas.#$ $vjPOSB]ѝa2d<"5<2yC U.$Y 2K[y(HTc@ D5x V YR[\lAEFU笢hHIP[4Uf'2qX>X][[&mJp-;6j~4vMvvOYG?+ܔ5U5S_rw%BH/TfI56)e\,\j G־uiP@%>{(i**5аqe4<؛o>[S|xL7AIPj;HF  Rşf{C$)5p|{Cѡa#`INr6kL>fBOjcTL7AdlkM_Їy`}~(%Qy6,5 @Jd5P:D6f"~Ph$Ba "騪,QdkOˢw!!-e# !d)t<uS$t(d֨,y#St _^P/e JRoQ"R:\lG F-H(VE7^a%C#~f\ GXhX\|E&*-Kw~ȍ1G%FQOM?2FtdXG/ręR+Tl$2suZSjĐ+iSk[12LM!I;Bd L rҫyNӨ:'t͈D/v=ƨ;BZ* $0qy(Z4UwR~bH#$VҲ7/ VU0%(Yґ>c+ NڝT9pSX+[-ܩl, rcI'>U%G=j1񨥾PJ.FEJY@ܬuZ4K;<,y-$W) WX867E;ؐCC(#fg^c4icUɧOXUbRO4PRXH#J£ey"]0J4NZ=V.uc;% ʤk2Yla!C¦/fFh?0YY*2T"$r̈2s4-{e5ӗ$|e'!uXo֢ҭµpG*5;3Υ1D|hdH q${-lvu^1j҂ %+@X:G,gO̭hS"PF!)ӈ ;Ҝ #h;< Ru`#}WX۴,6ְ}82qIdJq]KP4p2ϩÍx{hI_-BW6"]7S^ CqM۞vx7[i/ry,Gzo}'P0=9ZQ|G7J=ٻ}6QqC$hE E#&G/ rBAT/7@,] $!rY*382:a2S/S<8>63R&e AA`^@ @@ `@sRN?!A0!@TC5A;?7`@aTtqB BC[EAcA!EBaE]tC@aF*.aBS` :tC7G4HA!4?!d G?TGI9AT f4BIHGGE5TDc@JjT?TO@tFOt$ pB!ItOtAMqN>mT pQ؁4tFtNO54M1U.AFFAT_GGL$2!?Pa`S4V4F?U!?AMYWUYAIAj)iJ![U[[ZahTB[]4%s5]^5\MA^[ڵFZa[ 2C^ a'6?Uu__)_c Woac9^s`ǵ%dZ/R\Uvecu% Q^Gvffkt^evgyV`Z+?y^6 L$~Via=J g!'8@)lVl[(e3laalVlmRh?k%ml6naUCUkˠ 6nVqpNVV`anVlas3sVs3%pFTmqbq's7wlky%>vZs(&rKsoIu6'Nw3swvsWk'6qw}%(x/yi7lYmi9%{7\4Pv7yWl{n}Vv[wm]jW~mCku6YXy8y y!mW؁wX_ X7($Nk79XaYu- x ؄c(Zxn63^Vw8wk7vyZXnAr#5ay]W;8a%rsq_b8Q8Qhua ; _}x!U8_VO4jY~!:Q7)1C=$@YOIy L[T3ٕ[gYaquYy9!*>y}٘yKyyٙ5YA37 !YǙQ"EO0۹QiY%*4ٝ9 eٞŸ:Yq-ْաCZGKڤIʹ$>[ڥ]:_kbZgڦwڤq:Ot:cJ=ZzUڨ}mکW:zw:aZOzZUzӺ~Z皮ڮrگZ ۰ZO:g'r&21?CI{M{Q۰U;Y9[_۵kMh{ےA۸[;r5{[${͛9绸{ 䛾[󛸻<۾ۼ ߻[ |/+G!ܒ݁VY\c<_\iok<ǹ R\gƇŋȏ<ǃ|WGea\ɧʧ!* œ\ǍūŹ\ȥʳ$ʋˑʿ[9 ȗ|ɥ̕\͇|̱ɹ!՜˿ɵУs\k~}=|qν!==/=\5śk|o ~)~ݹ91]}۽!/ ] >p~sAU^#Sq~ߑ>>]A|1^u>!^i>ݫ跾䛞衞y>^_>Kڥa~a^>rk~ >k@>$?7??GC)??A_;_kAr ,9?i3)vM?k~ ,?MIơ_pڿ j'/"SM>N;ni~ 貐=Pj)jS꩕^Nڪ;d* 쪯+:+>)ʚ:BP{:",~{lܪJnL֦^ n[:nzoٮ{Vs;G 7pCL; [p ?x/l2;p23ۼw<qB1LO0++Gg|;{s:Ot;\t3221gua} 3Pq=vrݵ}}1;3RnvD5O{7)G+ӎ-V˝tњ[nׇy}k0kLnqӓ Lӎޱ?y;3/&͗ }'c XvG~+ϼoNⓏ W=?e/~c_׾ p3` y"?Q(u{aw_B,\ e7fx<<.`>#9gĀSP"DD=BZuFNyNKE+n"86fG)vF!ю\D$>rU!Hd򤒡e yF1(7f g9XαkS&so|By^fs+9af;7eff: zzsMb.8Ђqlh'aKgYble,CZ]2==hQÙH4MGzu5,`K2d+{n hK{Vv g<݌OwmjGֆkAs3;޶7kny/n72l{v=)Wv X å {< xmNvNr#_7nt;q<7ތbc=򁏤+}Loӛ3=[u5j rȣ,`ӽ./Ú]JzvfO92^|Oܥ^ukqY>OWlڹV(pwثn6'wo?8w閗N k=u^GA_}hy?u]vǻwמ xs>y|Ho.IܣO @r6Gis<>EUPL,0:@LH=% ؀ݴʹ Tq$ KL!SR1U{ Ԁ KTA81@ 8'Hg>-M ؃>`؃,LGHbhLN(?= VxYA kr@(qtNxA Ȁm؁DȈM2L#XVȂ.3LLh87rTe(M||`|{x2   ڐ Hh׈ ȍָڰԨ @KtۀL}0  (H8u tǣ ȴX)x8)0 8?p ɐ i@4 miؑ$ՏiY$@yW鸐/ 1y iЎ;ɓ""EG -ِL Ny<R9GI W ȤX0DE9@= 0 P ր@ yɗ}ɗpwv vt/ @0 Iiy0 ˄B gə iI9 }YYp"ٛ9 y'ΩIy@ٙY YY雧IY)ҹhјI٩IhYY@ yIy ٝ韢  !ʜ Ix<1 / 1` h#Ax"Z= )GAO7 0j AEp!ڣH*ɤA T En `LJېWpi_J qIe{ZF k:zKڤ8*T!ڥEJ P@0ɡLZۀxj{Jnj DZɪ ˠ<:rzXʪNwlЊsjy`ڡ~z`q ]t$ :bNw <ʡJq* N ~jG +*g7IТ2J%[ՠa=0MB:ѪHzv0ˀ в=ʡ ;3׊  ;ۊ<Kk4zyG,{3*$ VCzDک zj\*]Ze=kКoJ>~v@ $XHJ g ,.Kp{Z _U۳ڨUڮ G-q P˵{:;j;^]8ڼ40\[ 3o0 &˾w9 # P ~J|JVzojD@Ypꮁj$oy$ CZښD ? ƪk lۮ_zkI:05»zۧYL , \T̿{}:ʡ@i?̩D:kP,ZKyKzȺX K^0랍L~0A*lkz$/!  u 5̨s  ˼<Ω1 ȑZ ˳)άV<`[2=\p蜥k\{Iߜ$˨: }@ ]nʼ,s۷m̩Ƞ<ņ†Nly zqP~ Ӽ1ϧYsoܼ\ q[u+ kZ<=z]ɼrrL{|τ@l$V0+0&; 0q1 ~SM3۷` ! C؞Z~ M]ـpQmڧk ]Mٴ ֟MM/|ڧ]mڧm|M۫)ܪmtωϩMԩ=ܴmؠ YY ߉ ]}kؔ]kq'Pp-}چ ߥlBkqPl_ ځ / 'Q̜)ޜ #"P<p=po:=/갾}2@ºZ.'2]L2} ' rz+0ro8kMMyns~ .-Gq~tZ'!*>& _&{+rn*0p_ ຎ룚 n>{ynr@%kj $ݏ~0ϗAKc^(^qT_ hT`lІ@8Ԏ*=p ZlVVฎ!.$z*>P]Mpkj.q0lsP]n-P !^ Y~9  * )P^9ڛ(* S< 븚^FY?eP靫X8oRoh ?Y*sVɰKM*~~p%P'ЩhNT] o&`(_h! }~_-kŀ n+0q tz_Eڥ~(:Oo ɏD)^.O]ߨ ` -Ojz(⋟ p}'! QD2*T4LtȏC :CEEQ"cpDe8j>jTy:gsFXH3h =%&#$JUX'9l|h˚FqPtJ5 02Q~)z@l!]vҡ WRԫ ʱ/ 1.ˬ IАk 쾈c.+IP ?B p5ְ :JPI ,`s _j .J(? )6jU%*D"$TO?&jt:*(JpH2͈z EU;9D 9+)ij"g{FH FN전CeJ,+K*8 cM/HA^%1, tMz89RR,[թR v7CYad4 VѠ} '3!HÆ,Ka9UҒ7=)0!6ƻ]sXqQPe~FBN0aa,=(A8Q4mΩH4i/2|(U1C~ix!1)Et.c?y%Mz_̎(h:|3 -שz4ڬd3BHB J'k&%0dzUk2DI-T^TNA+"O!4D5bomKM-aJ&>Bqn{Z`mYXQLt)d| ZAžD$,WKfUS8 &ipz*Qaz7cT OR@A@Ud{&Vztr"b/j;)QlE3 _TVr(aHYJy0!bB!VC)Uyyjp !aEu,5(JE@`)֪J1P<;h  w2[@;"YN> š)4ȿNF(cbU:fMHChp*Vj84!k#F@ud^W&ʯK !V>Kq[83 Mӝ!+)-4-Mz T_ M* ۜ] b0"qxŒZOVb5~k2fQXr*Oz2-Q+Ex l΅38ā#30_V(Vc;qزOL)xYXm>d0 f0YI)HP$9 92BboYE,=oz"nWE/֙Rc1.=pylDŽ(,kC[ʶ∴ڌI$L;[cDLk1hȃj;&4bK/>ѹP7/@(t¢ĘJ@೿0堪.2 10,'Ѵ (2*%" duZ<yOD ?Ϛ`F/݁1p2n2`8! O)" B+B4 c;t5#s#@>C[ɐܛ#-P[I\(CDxz92+E ?Fjǘ;T!1hz=~GCC8)/+q8PC:w#8(|ϣa  8{<T7ϠD<(l_7k>(Fqo u h4Gc,=Xã R&rl٪O!q -2(:a$j)W1I8py:F(0KN {CDI0FdA$#JOB-S5C&+8TO({Z䠄,r*"!=j؈eK(Vk5TC5ID" '$yأ4 1mJAׂJtҧwr3!H#Xł8M&* ?#RJx.iMl6b-p¸3fF i&z,P,jG* ܝ*1#4qK" H+FLHĒ$&O(?|'Qe'ٝ JLb@\i<:XR&7O99* Ui U<jhB0 *!|0/X:";gˈ`kzh51|@ɉr)M^I}=2ʒ8q] Ԃb! xeh2\A2TC`QӡY)43(eF>0YÆQ@/6@43bis P g~9Vh.]zS :p\ݐS @л,U)=^  ?t3j5.:0 a9`0^h hm,EUlbϐ8}}^C4h6XZUpiTkYX`C\@ eeαe@je ݪ F8- b#z϶z(ӏ@XM9k- $R2ĵkϬ3t]_- J0a0\sV$Kk69Ȟ<vNA6N%c}6a)юqR:i:!XRN֎ i.IЎV%"i=EC0Q9S4>6ΖzYnZoPgS&*G q_  S¢;^q֤p)) Δ9ߢLIH eb{b I: k&R%q)D-[ 9Ӥn9HUZ;ad쳽:@Zӭ O1@0C@#F*@E -XmpGtGk節tȇo D3 8K]6;sWXh~i"=EpEX_^b."8gC~D"j?g};I3*ńCbl7jHÙG1R(wwDni||w|y UQwNF8} hkV Р6Xvc .c/ibynF; 6koy]C -y^w(SP)LFpCX?HMe͜g i77{jBxo P#߻LY")# >wpH]wfb7kzeߌ>v-dOkbn>oRO^,Kɑ(z|yo {~0 x7{q$˵JD*wP:]Fgɧcxbc6~6_yO__|ʯw?Dy뷔#6(Gv /2~JPa&H)Ld@ Yq#Ǎl ?xN"O4k֪U{ouc_?qlrImӨ͔Frg8iDƌ9siJ! AP u-D*ײF4$"͋wnPՋ7_ c$ߺpCXkȖKqŠ?34t)?\TC^~mx龕K+Zkܖ'b޹3U8mw'# 7ќ ]džH1F_[ND$J,F SZE::wޥ&_ઙ%h#L3IeUXCYH@dH`Ywg]Erh5guŖu)NtQmx1[8֙4q: &*N~ؗpb)t$ᵡDI(&[^J7J)Us*x?d#S5d#O;/INOCMt.mh]PYZ¡–ZURqAeL WZ`ƅ9׌i#!^HkB]i$E&!*Д \0iș&^nua롛IӴwgBa?:𷓢 ։U ee;HYGҴ6г=ƭBpr:l޺ڰa F\m","[ "_z$[s W ]{ؙwYy4hyre(53N7۠sN,hR;C9vOJF0Zs<:j:Z%qT:6݊7BggEVqakMRt 6 4O5@್^%9h6X1kIux ,ZJ#ǂYTisǘڏdi0ZnK;r~*BK*oAγ A.8P ܋)b8FcJl#"|ƦǬ`|=X 4FC$#rGUN0Z="ؕ0/Eơ(-zюKd4\R 6WޜP`.  uE,R6J$EL ED XZ) d1k0maKR$M#׆@qB\)4/ˋ,#7uE,R *P$B㩔zc$.UԼ qU` <I+`h@&2Q{e F.w"Ʊ#?q PK<4Drt\jǽI,erSuV!:3.|1 E֦@/~QFt;,#DЁhubj!9Y *r$I|2( nlŸ T8(h Ul]fr DH_1(?(jҐA,lQZ_02c5GZ9ƫH!  `..Bkӕ*R`nSuuTNp;p `( 'b[d"V6|ay+W~=? (AC':bޏ+.j.BTM0lTy|k&TP,q,菥miI9fuw.tE [h5{Rio7l D$"6XV"tms`#G2oRN"m - -AUًᲢ% (Ct1_)T0לB^ޏ~E"ޔ 5s$ Dreھ!Xۚ1 Mh  p-gU$eY46X )e sbS E$!+b ) k9q[~U@@$Ȗ}vG2'ΥRF$RΦ5!붐]Bt^PAZfSN Th2Qi6]I!jۢ`Wti!Q>( D0׹> "b G8 o垈7 o(p86boh7RndC,&|?0B`D!A2/LZV͏~=@,7AHDAuV|BYlG OBw^H9=ح OBDЬ9 =9xL)$dJv`*\B)DA JxdɌB#05Y,\`V[Ɗ,!ʽZM YaЏˉ*p]y[gTrY U\d tujpEgvh`x Q̉,M(ZC(G)PPaY1e$(@Y @BD//Buru Q rZK 4|vuX՛eu * (5Tq$BBv  R ؖ r-a!D |Rŕ 5ѽ ĭT$r95.~B̙//t[B@3 #̞p@ `2* I"݆]@ # $t#<߇t SX  Uu@ & b-%-bx(HX%B * y"xH=}AfdN&u\5ؖ2*ppI,€ QnX1F1$. ԤMPgvmvdv!TA try O`́UYrfeEm- @l ԕE,!BAЬH2.#DNU1kcmp(hB)]#B- & PZApd#Uz I w)أ2*S"*fc@!ThHzzQ>(8BZgH\*iubq]EQ y@tPfb7uB1fdR)UlcB敮1 )Jdd]y2W@ hDA\Hh#|*^L@@C)0%.¦;BWBޖr=$XfOY/hjit'@ح~ DEpKgBpB[`Pu @nA [(5"ZH¨P k> H4^JrQFTMuŜql4,1k(Ul⢸ ȁٍbʽDDHZ  B@-Z,/`\ )}L!r$(vYA )OPӈev\)bY1o0$` $AB*svȁ2t@Zb5:(FDvmL8k@`Xf, >Ag~ aRXHgJiBE ɱ@»1%*)lHB-l*QqɥBAEn$sIB>e۽8FXgiyJ9u- (ER%\]$<"PpoV)epmM# cݖk!צIW-pgۭԑe bv_0&q}laتv.@䁜*fA#dz!|d s-)tkάj_b%HD2j-W @Š-MZYz[\1Jw 8IrW-l8!SE/GfD #2]D!eB-tUj_FƭLz$5Bp\"byqӆr @+ (rK[QlzmBtHq*Jh8͈e-$.,h*Wx膮醏 6t 32K ky>Em)qutWsL.k%ԅ7~ V']QD=܀5x$IrIfxTI,%..AG3^pP}k@BzE ))B!|s\q^3Z^{[ph^ 8-$;y7Šp9Ѵ&Duhh& BL,,3K  7ZpQs!F#8}oY‡/ty'D\W(Khr/',೫jʄ,7 p@j1QV3]Q8v ~ހ" }8Nu1`EX%/&"R]§F#_Z8806Ytr5q@Id!B-/TD,tp"PEC :@CPŋT#'5 6xя U T` >%jWQ\PŲU*|DahяS*(}hС zҧKb jVD;U~hlA/4T ?QԲH `Ú¬3PWUx-tߏ2 Z-D !AA g_ x9x?QUVz,N*V"RclqL Y@gٲ[ъ *E3Z_f>XϰC@@,KJ +8d-LAEdGiqQy1im@D>Df)ʨ?P@$H.,@KXCD4/0LĬ"o2J8A I$9^lEQEk"|OJA=(ӬҺj(+䅳_lC-M(:=TQ&Uh]9l-4B82H-+0P[A NS0R\4BXNA$T K9,LH#( =J^WHV":jYÒUP PYxWKDWA_휰->֠ 4+[|1}Z}r~ʦ>/ҐyCʒ%K\H\x,aCD+vo4=T )Q$uTCO$] 1&% W=Jڬn_-fl8U,PC K[ 96σ'kPP#M"N:\?HiTZ.&(J<6nrWP Bz>tCQT,}ɀg2m& N3M֣!t#>R(%L{dD#퐇Qx)V'e8vq*طvZ)A< ;}DMFd4+ )GV0y&PAגXt@?I} XیA!mQEue(Q}`=Wkա.\/ȭ@',j8 Y:0l9қ!b ]WuGP0*QtXRj '!!:9IKVB8&@?͠@>#AF:UƦmy`Dͽ(:LRBL{Sr5b u谇hQG%PA4F,xl(s2& PZh h@WKc:M;U*XB 4 )u,b܄#’CV¡'|!˓`o$2Qu(+=وp1N=p.$Z(вX! Kl,r9hƍK\׃u11+#2"*82<7ŋJPIٮ'5/դ@,] j[hDQ'u,Ҫd,eAnQT+rtݻэ(- cP;[O"u$ݢEsY͉#Kx@Nt@!*Ϩ;Ofx[;&㿦0pkd/iH TinEzd͉Hřƨ5fY`xe4zjӘ?ʑG'pDJpjp=ihGr(eZ6뿮49}"|Pi bMT}4dVAЪԡA11yEQ0X5k͡ .^ǯvzMPHÈ96~}n^# LP}`NQMnCH"=9E^L*pw"!hB\Gհg \F }T>Eaz oH| ''5](Ii'%5|lٚ+Þ:xNTRW`̉ÆdIolA۞?!mֲ:5wL}G@P|͡a5QQ *Jo]X1HI"[1x%tD+Yt&8Tt/!MR="mnƷy՗nh՞/<1~f'HA;ԀsRv'e@-ye[.xdByrV .Kn@' Ŭגd o@E4 `'teդC9"jFLHLPMteaӢ6JBp/ԧ,{4cnL2œn׾K'ȠюŖﮊ-.VLd0p& V)BpnXhp3p4tLrVKSDK|nN Eg ek(wN :"K-!FЎcxi'nj w(o3ȺMh@> O+I/V ʡ*%:n*BĞ:'2ɠ>iDC"r.H e"V ^o4P.*n4Z"An$-2A9}g4FK"(RJht0 #$a/Q<$!r&r%[R,HєB "%2$p'TrP%gr,@mP)Q(S"O/ C$e, A)P+'W&#(Cl &-0Ţ+/O^6Ḝ9Pn$JnB!2m$FAD'Z23 l#?4a@!3u2(5E4ْ?@  51S6z$/Pd3(ASPSA x 6j'`3a6uS34SHLsU (uBI5S!;SCRUEEs@Uou`Tύc,cUEZTcPT(BUnUY"u>WaB5S9V)UKSM5\SuTK[ DXuZHEVqUW>UuK `6ae>a 50ABpA5GaS(Lk/ X7.HvLŢS7A!.`!HrMQVdaCI f)G!lvhfadDdbgI$hagIVff$eIQiURvhI dGdiUe]Vje܌rl!gggK3h6Ɍn2Ūioja!as=a5c0@,!u]ua7vewviWv!a$ bD Axx7yDa@zR@@y7{y`dwaj`HW{W{Ar`|w}Wy7ķЄ7 {E}w!}7za x AW}z~7xG{'8؅{{~[؆}7~~xyEdZ`6LNܠt]$F!F.@8x/`a!,!F`09,X!x0u!9ly$%%6HUyH97AA ym $ 0yw!=m-̀nW٘_9 ʠ9 zx9JwYY 3ٜ99EyMAQy)ٕə*Ȁtyt޸ ۘGtqAa4z9=A3ZAK! NZmq:uOZa[Zwahz:mڤTZjczpYwZ+ޡ:"ϚY:ob`a庬کm`sZ49AuZm:7a'Z!-{ڮzG[Z:ɦzZګa[w:!C;顲[ aaa;;WZ {a^Z㛻;ϻl  {a* \<`a+|![9;^;C[y}7+msk{Ń|IWȗܿg ~߃ajw9=ᴻ!>7>{M~esY>[[e>iaWCyiw>?>秺荾>闾䛾^䕞i7[^Yi82ּ011V!3G~ȾFQ^w^2^A3vwkU\F^aOO)1 9ӻE_sD סaimgtyuo@d?{_akam??a?xk__wտ nY?]†#JHa&ȱą]$jSR|(qdƓ*c2EaΜrL]ѣئSdիXjʵlڬ#yPUhZkm Ⱙ-Yq 6ؗf W۵oMX,Ad2mYɓzs^yl:hr[ 쮯 vՎvٸ)_μУKwmMΝ:iٻ^qǫ^eǞ>~ ow 88]*Hu97tO pM=;xc(,袊DuN3S8"7l:#>xHH$9?&.$TzC9ɘdOv#Z:e^ϖc )i"b̄)goy_eN{RRހ袌6裐F*X?|3馜:MT`bhnZtΨ>6z*Z+b) +[9j,벮",ڌRKj۩(m0p;+/kN8֛ jp  %pϻo[^Ll:sf)"{0:!L.K2280/kR *}ONEe8t`u9bm#?C6h}6]qrwpӝ6&bm79 NㅃxĂ#h}~x[96柗d/8רG^zfO8랛]{ު_}z6Þ<តc5C9gs9c=w~ܟN9{T/~~X?׿ُ}^Wo|3̗@寁" q90.!\7> #0=v  5ĎrO4!Bo;G3!0A< >(L X>apFI?C N6*S?2Fk=Zqr㑐$'IJZ,F1v e& de*AI\,) R*x$:f9]C4?Pb>R 0Kcʒ'J_2&/yijsf0;oR0iNPֲl%eS4G"PrCX@JЂMB uc@ڑZ ]> *T ]hCщ~4(5hC7ZRU;HQ+Io St]GӍvkMiT#ڛ^vEm.gnGע}ikܣnOߺ;=klݐjb{񞷞f]:V7;7pƖBhhCRunG3CW]cPwc2߲7ls<;;@Ԥ/=N ԥ>Ф9g0}zFvMyP=p'{֝nOۙwGtucsʍP8C?ū+{ٵ>@~ykG\];{PcOy;bȏ O;`>α WCn>}G1v1~7G/__}}~~~f[v}'}wHW}ȁ~X"H((gh0| x7}w W pJL؄NPN5ΐ ^ThCeZȅ_xO0Ȑ[؅hJ,k8nhPr؄lp؇gHve8UxX|xxHQH'iXW(RHoX8rȊz芔,@Ђl_ XxȘʸ 3808 P@h8 XN8 Xڨ؍ Ȇ8xH戍Hhȏ؏(Hy긎89ȐXَШi 7䘑 *I Y'3ɒ؏!)B9+ HJ9ɠ ORiqKM Z`WYP)Z_i#Sd_ɆYId9]Il9ni\ {ɗ#7锁)OTIU RIYɔs}陙 Ր 0К9ɚi)i (@ IɆPřɜ9yɚՙ0Iɛٜ iyש񉝽9c8G`ɛY也 eٞ䙡y詞: IY 9QyɠɡIj!7nċMM3^H]R\ `(O# [P k]\ln9  g~ڸoy>- u>E|nt޷\N3p c,OhN 1one;\p鵛h^_ؤL.{nln}$̠>N=n]`>_m PN;.r:}3ߘ~иe Eƒ ].ꈝ)@n N~c|¿ā@ +mlq`lP(8\ |̅<o N2_Wop8OnӐ.]{+; д_ _,҆P a췞꽽|w.OݬOh`VEkۿ=PƖv@1/}N d %XD% $0@ 6 _sBLԐ`@s 54Tǁ*Kq޴j9uOA)MݿyȔ"O4kQNV-UWn͚S*VaR"F0 Ӗ-B"qfʹsW6l˘ nDgpCkVwlݶ ^ ;~i[('I61f2t7bܒ `[~@ȹW2JiG|XU+R\,c|?L;*᩠YY_J٢=w3߽r,)F)0@0 S.{ +p9d [i!3[$RT1p"Fs(Z) if"2R,lr,:+ƒPazPo@\{-FNYAU=X?`  DKct58 ϊ8N465 ]'*U1th&j}#y\s<߀O,/ #`6FKхA0DB @ y5)E2oqe[.ꨤj)*HkQyYǜm"R"h* }I:zjLqaFa:߃D>X!ghD1'߇aj;`lIPJ^:VQKѹ&6b$CHQa>ADYu3kQhɇ@(!o@!\)$%R@'-ať.4F:L +CCF|G8%lmhS?VZq m&$ d+Ÿ嶺iN J&5xA !{LOGe.#a q$ v#?j&jPC?lxCxThHʔdHci@Ut XOyKP꾅"Iw V@4m촱Dbf4CL{9|6 M9If$&aCj%z`t, Gkfi;kd6эm`Rƿq~wC c--6 a騁Q K'?$$3c|vv .dpǽJfM?0j5Tq9BKg/x} Q0+m╸PKdy+ ׁN쁱Z^%(0"l=/cҡ;} {@9jB~D*Of+xj1zZ v*Zve_L 4ntw"AB>Ht E<咑 nh vớb#R;蘊8lmL{G6NnX6=1P|\ =U`4NC\✳yk*;"CH 1 HhIX"U8jҤgkRHϰ,sD^Br4bC? $85ѝ"t 1:hD؅D-J*b(>!5.k"I 1D(#[# ?(8=8޺⯆ (@ =%ʯ(oAqc/̩Z:ġXvkB?cm?ytz"YyS$EV&!RCɣB<+8g[`H@!/@0k㎇@JCMt @@xhY\xGxGxDЃ9% @$tb,@f0AA뿨FWym'@+] o/\_ 󙦻#l܋r D6dI_I%(8xXEs/A_G'cxI HFh( !ˣF4 A úI Pe;gHMh &.66Cl#$BCHJo/ K P$Kw3Kku!v@qQiKjktۆk$l)يńY<c|Й貼+F|ӶS ǽ+K+S75?H T(!.eFxEu(H _8n D;9GD)BX^SGa=IO=C;T;Ou ir`KyKy1jr|wjU((֏@<$I0z4DFHFpL3?AX) 3#Աذ9dv|Y<.:LCHZqY$Ώ3׃NHQ֟:X9y_j_'Z"^bD'+"DP/U3!J%{ pu$M#[xUC8nI1?h0DS..L76r%Q9 ]N8̞/cDPг#<ׯQ ŤuZz vi(ZhH{+GC&Ɍ}܊@I (i,MjED|B34<<ʔ@:AD[:GrCkJRD(F3!ڷaA ޜ 4D( Hmsڠוf2m4TTJ\11Z:ى'PYÙ,BC4  YHq#>MPl qPm'9{⭊Mިjhw L1ebơ\K~D${L2 M $͒6M@p2 MA YȐѱd1 k:_4F00:22NJD"Vf!.$;AHa&I]S +@R M9Iw"5CXn OPX. JXߴm[JRV??uc bSIsVVr wFCH$076W-K1mX?r jpmⵆthi8B#yXX+mXqs & LOJPG[;ǻ]A^Uk뼾j4T9l4~iK14KoeʔBJn.˞ӄ_Z$4 №G^65 Hqrnm %l˜%"jS䘘_H3CmtI('Q؉ɳj}Ch*q9ܹf; -Cqmyv($hJzBߵa ap{rUR{'1 ] yl(Z 96jUX3J]az0SQgvGԶ4( _`H e[(Yj A޾!u C,(QDkPia/q L4>d͛V#Ȑ"Hɓ*K,yeHk)c )?xv"O4Bvkꔝ5j9'?{ԪsjMBm+sZ8I޼B!*,\oF3:0 "()!لC~VX)meM‰Xy0_úwW\DBid.љD~jys^ =5~ (!Ĉ+$G_bW훜C%8g&h/ЩtZF18F] pe"BgXڂB}x_) ^ ]X&|8l&!a=Au!8W]VH୐#!ߋEf8PedT䣏)5-RIxD'J0LgޔO=[E$5ِN<8D7G8֐#ϥp5:LcT7#<|3ԡa88fFٕ!6vg"Ǯ9P![;P*CbH!%c^aF%R:V]g܈MVHz"-hlݎ)!%kEGtko.> /a8"ȂȖS`UɢǁL+ l{Q;[gR!)Ff4=qt5K|:XK#y-ҟ:P*TQM#4vRö5vJ5oUSDVlvsKW#>+2bt J,EauG2knLLyr/kkB6fIK/ql\F1|VbLA湞S3, 1vey,/NQ)|BJ4 rA tď3E9ʄi=ԟ)+t)DN7́IMӪ5jcI1}dNy6?l;Am+ӧҎ~P61﵏h:_> fWl!o~BNG]{yENu+C2ֿ#2ۙOgRnML_uIL`k̜ad :#Yv$=&fa޵1ҮIjʌC?+ˮwȡ$eJD;av:gR,9bkgcZ 90..pp%ԪAwSIn3GX 6¶3&Y)5ѣBֿ 1#cXǁ{DTc۝_c$O]jTDi/zɩ.p ^Q.ˎ2͹haN~+:YFχL8%]c9cN?'s" ?Nfh [/u-l{N%NhP-!G:эjl±~4%+H rؐ6ґr|DFyA] YhXY)b"IȚk5MS/1RbMSgQѩ,f!Sn6hc[[SLMm[T7VfM&,GSA|4IAttSzc+>,a5 l3F7 ]wZm{[9B{& ug'2rQRgL&WrԬg7+Z"o#(ڈ/7iأ)SaN ӸayoA]l[(w/i Ƕ⯄ikeV,[]GK:/vp/B([nfy!(j)=roleȮ>ұo@7ܬ`Cq ɞ4Vlry]u¬`Ғ[)-L5Z­uh^9)6sxTìߨ|4ƥ!ht 8KMӆݦ x_S, v=ZV^u leXz޷*r;Ng,".?}Әt?L%r<=]`:jHdr:5C9?u bK^}G<Ŷ-gc/'lHJN^jCNi4g%EC~~>~sx` Q\LMtI@AL@MTOhpقM QJE"} $ #(^O)el@gY\9T6MI}6p?7 7CS6@C4!̊ 4 zvyʒ}a ^ ZmQadATh0RN-WBLGmJ tQ$QODr+ba(4 e`2&f ̸x] Ƴ"bC݌R-c%"D4?=ԃ:=x44Y}54[8L<8 :=ÏZz}\S|P^{)!VYVjV,yAl0yS9_Nyff`*)9 G)0IOQl ADX)B$n0!H% ؈\ IB0S^ 5pa cya䵔Q]ce,8H7_݅E:L6cZCެJ bB6[?`{-"MMYQĠE#ˀ| ' x*tΊ/B-- @nuL*4r.'s2Jf @ H6r4BrH) ):!@|R"N%t|-fr"X,*kBH n0gr6r~f%SA LR8;.]< S?C5$;Cv?\  "BEN!JWu#QȍgvF^I!=!怨.BJe$R#|F Ɗt.(f HD)|NqM"Lh|))PctK #"6 )# 쀧=)@BQİ'FMv:m&.|$3W )|i~Q5Y\EXk SK\|:*68୚CJhí7|.[\i898pI[yAYa"?d|4`Cm58YÉq6PDLk|%$$bY̏NnPaSئ-̂0))^x@\ib O|žzK n̖DtCD]먀u", T0e9eQ˜~ G(@ t£:l"€Bb_|GyaBD(K *B,] @*pD(L3-߱-392JH$/-Ic蓥P:[mW:\R5=ءvIfv4t me[|ΊK"1] ptɚ* )nЩ%% HB(*^j4DCvp.l"CX>Ҭ *K0b]ORNi[)(z"A 2qHo,j`H~rm*)|OUV2DM ^m쉞^ jj+ nTtb:=jT`CRx :_OiGUqa-Ԧ-'VR#udq .ZW&ēvŞP*<*+Cg ȸnq0{7pMA20K mz7"RL?܃<@?ăPՃ<@;(?X8dh0% |Gx/.s#O!)Z p xǒjoHe$ .R;,7UrySRIb,#bp \ ^| O$D 4ANԕ t@Z8@ P0N!~XNR6U ,yLO/).PVlQ@-|DS /!ouHª@1 KS%߫ DXQn4B&51@J\N a)\5]ckr!5lY7@?4|8|HxC0FA z@RB@igw30BHkxT3s'{jdtjNsOVFP7z wpGiKVAТ H# d*xw$GbtZaдy *tS7.7ӎ@ jPjj"Swl@|AU7VWv*oJyzhykN ȁegBUpk–@|AKW7 uv& k6 X L~s~ur,Xr1Twhɜ"Tg}h0rn`5- y#Ÿ*Hq#ACj!K=׃&_y k7/Onȁ6)xV"€8uC$8 AdV3u:*g;O!@†Kdb&/ܬ8w!& ZrPC8dXЍh[y0dL*H-ilāK[C,uP{@*cmyI P1N9`X3?kRH l|Ъ>Yx0/n[p${&+Hft-*oH{T( &B6Du;KK"$@DL{H/Bql6 yhԊ:޺ߚ [k`gkv{7I;૧G['ض{_+86\MJ7a0frXXn _!0L6HH)4v |A.VWz-$PCU'!` 4&%aK!0~/ynaK K8 AB҄v#4*/uЮ ȠzWD**VJ$ DrhѠg'C2 C ;z|֯_ת'%xcCC&:a- 4i0_fj(EM.!*k qͩI)nZfDo_:DC }#PÆErޜ7Zf͛9wthѣ=Kk2S'ZlٳiϞV?~٨ac6j֨;^xF6|vvJM8c ?P(Q5lo*he! x0E {L$UBJD D'-u8BZҩUYR @(Z\KIRʨ-CZ$;0B+?)WV LZ̠UO'V OxY5S^kH*CC (W RlC2/*,Bn*SPAO"Zq](?A$Y# }Oɒ 3h?ΤMm^7_ܸFp޴ɇ99saSq0D< A1s"-@@D IY`P`CA%B/7`x*<AV6 a3D)VTp \c6Bà`XIdR5mjV +gxa ,"PI2<%PXI ItݹvH@  ؜N 61<~I@ZbFd]p`&IOB%ϖ۠79sÜ}c80hIklk7āWjk_0ԃGP=bU"J4'G @%uZ) D¡"É`- 0:^$~ኲIҢGx9dr~d@H@L9.B$qhFg\`DM&]U!>:h޳21DA-Sɡ8;&-ڒNDGLcwD@:ϗo=JF,Jb&JJ 1]H]nj "e$UD^iYb:+s٨G=aLke6>nQ7Ji$S*RUH@"L)H64bbf1Yj9,Rn '(zL~L\c$C!!~CϐKQ̌*idp(XZx BUM f8~-j`*YR="Ns¡e*WD@IRV )#HvL@ݰ=+$ȀΕ`29BZኢaxeG/ONL4_ՅkP̳D.E ^ZeTy5A vCls#qel;A/yF<,pt}(FC0=!a7 k(6)GjF\PЃ U8SEN@ACqGe܇D %f&T@,p'8@'XP?y9,dc!:҉ jUX"whV)ވvب`$htS, QR@:a twouT#z^M) !.*[NjimF+< wMl4K/ܙ}|,rS4G5X 蔎e鸬lpa׊bLl(-۬>`$*=JՐK0PU%dpDz%.Dpt0Z`dH /`hj$bc!NDP@dL$քaF0KpB%+QFH!U0ZL=<$tɞ w#Z Qfow$> "+6m R/SPafq @Pq+Vmmx E!~n)0;!1]iA}-<P ALM@o (٠#`H !$A<1cvF =q2lmڨ1 L 2i!ҠGbmThw&L^ v!.N"'JaAM"a 1q!Gd$&o& 20Tˍ$4 rc4QJ!9%2 䩀n 'R8ly0l/ǜ\QExnQ.GCnr/[,P-aaôڨ!Rj+# ¤dhu V(2oR u;CTH)1Q49G\FE&C 0!"_@AA &F}e#Otg=KRHPê$6N $kOC4 0B't.+/lC5TT1CCRIt"6ԭ.M-x\urP3%P=( LE.E)b$P!WR-L7/-R` ]L2U%>A\LZ?"F{ȻR,-JOpU[ FG*VHE{RW^YIuj4!P3rBWc9>uT7vcQ."d%\O1&H]-1ljxhEd>RW13FV#Z*w~vFdα@es $MP۲2cedV@JȁF Jhjdv!`.evoAuf&D6 6b%vbG{N5fICc/z/#iDVB9wTˎfT!p-'"D/o:n_ubaIGatvO?]_wtgW(AWv+Nxw-S#6y9`H RbǀisK6tsUDԪ^{!~ƨv>'w2q 5ctQE s+ؕq؁alp/Dawp>J'pDZ@ HB)jlT΁jX=U EAa?Uh4m0BR H@Pxw_ oxoO9KXS\S#8̡ <DHLIEx^X5mrb䇃x"9x.#62ÂCFz"a۪ؐ+b TQ^PApYr9C PYYٕ+ɶdw9ᖧ٫ADdkٕ'Q9ϡs16Wu@ay۶ș9*^wm٘IJ֑ey9y6dٝU!`Òxq1ka@/EacHBA7{ڧ>/$|v:7! d7ӳjauS^#2(B]Z#Ds2=A_Lz7z|X!{:fº:.X7KD BA_#>8_ڪsz71F16KbV"ڱ]^/Ě;!&0*baCZ7衱[ۺ&b94aT7@Ŗ!U^("L[mBY5XAoI aܲj׆!yy!!R$OE۽5I|b ͻ{­YJHăPǿGƁ|9[˻555aP|֜\Z A҂M=a5pmB]$1= =]VlK]Wwd{M }}= p`t]ٯa= ̠WL]ر]=2@-ԩAA}"t]!]*Qߕ]aM]~c}k4=/3^\Z#&7%A[_c^gkW!!@&t>^闞|^Cu|{[ A럾ao"^/@A>>-^~~ե^Ѿ&!+>7_=~-0!s_w]>A!ƅ__V5ߥ_?aDnǟ??ÿ?"4hC8Ō;NLc<+WlղfðOha:o'F~}VrHiakӟf:9:tgX#A$s֮>ޚhM8:xɻW<͵.}BٷF]lP{og{!yRQ֟{}s!`h ovYK|=}17ׅ5y?@SXxyXFN5J"I-'4xO]Nn%EsjBEdwQVaJV^ZXj '59DO9`%5R*ђkH'Snn:l>xQQ4 f H⹥ ӤSU#zBJSMފkk467 +,l҄lGųVjn+ma JmB뭺K̊ ^熘.ή9\3C2|jJ4N?}1-4!cq{.k+<3OwWsDف 7|~M6哟?޻~ǟ 6k3?˟\>~$`fٰ ( | x8o}#`#< ?XaZ?a}a S=QxDdԡ38"}KG-@0 T_ ()WEщg`- $"8B$Bb\cGa;D*rl# HJr9fDF"=IP>>1ypRd)qMr|)SJZғ܆)Q5nR,? Ĵ%0Vzҙ,N*rք$6MQNӔf8EMz0y)08|s? ЀG3Cot= z̏$(D̉Vt(2PhB4:RBˀ JSZQo )LcZR)MOjS. PЁxQ-ӏ6ըO*LyW ְud-Yϊְ#d*=puh:hPʕ|%]Tub-K[ Yq.ld،Z6{_rz=e;;ڲlj9[ػC}\I*ֶ7)OYC(q*wms\q%.t{]qM.v\ry;uwmqӻ^WliS+'/97pvخNנՍ0v' z8,5ƃ(Ox,n_rŠ asXX?b{cDv19|؄cEnr{ %;y&2d*;ʔG=n&CB󖑜;r"632n=@_ rn HKzғ^4/hsPބlitӤ9O+Ԭq|˯nEXYk׿f9d@knv,fzѹ޴U-b?ώ&vmjZamOܥ"r{nt:ʁh ]2Vo |/p' OpK; Cx#~p\7$5q|Gao\*Wx[+&Y<9>ȸucBxɍt{?NJę>vToy׭l<]W N\ 9OerG}#o{W]I{>8  <;y{~oOzѓ~o[/س#81|cW؃WGoݯ=Qǽy|k?Wlo}G/}ɟ:zů4tώuۇI~w}G~gG{7{{~WzXzW~׀h|x}wX|'z!1z XzK$@6?A(CHEhG>TzS M@]HK^H@1[xeXgk(nHprȅtvZ8zH|؅yHIhcȄh؈G8$~! hȊ芫x  LxG؆xx~ qȌ8xȍ(hԨh8਎Ȏ؎Xӈ (؈x؏Hʘx Lؐxi㘍ވHɒ( ۰&7y;ɓ=`x 򠉑KɔM?ɉ0@R$Иs}[zQ9QGZɕg_)Difq9uj)liI)y9`idIwzɕ9Gac門ٗWٕfTiHrb9Xyp9g |)tZyٖoٓɚq K@Q q,雿 )Ip$7i)y ٝIֹ IљI94)I y)ߩ~)ө ʝ :i j I*١Zi#ʢz@8XY;ʣ=? A*CǴRȐL@OZ-ŤN YZFJ5Z S: U:W*YʥgZːMcZ]ZK*sJHaAʧvJxJRjh`BڦI>:zEZnZVJΐ G @ p E ī$AT*BQԫjBS @& @ҺC@dI @F ۊ ZΐКT C⊬S$GŠoTB:Fdy'@zGڬΚİZT@K*>  !+#K%k')+˲-/ 1+3K5k79) 2řI? h C v T[0N`@b@ nS[ە@ae{0дj cO t{o9o 萶з@[ F cpKL)pbP|WipI봇R Tk ey]nKO)9ސŠ PNjkj V }@[0ۏP{K0[ н (W[⫽}K˾kˣ}ޛ;$ $+ ً鋾 !,p k-/ 1,3$G77 `p0 0 ElGIG, v >|T BYI<R $PL[lZlW V B\g,FĹ`9C<}\NU@qf, ƂĆ|[P :Xg\ǁ|~!ƍȗMQW[WɠialZ9,7lól˴|˸7䐯4Vͱ N"#lnjɬLϼp p,L,·0 $͇L|΅V @{l͉` $о x]WxP!M| -!M  }Wς9 sP,?,E]15LNm·&W abM dM ܀҂QP umwy{t }}/r= p я ّ؎x1D]Βُْؖ نڟړڢ؏|pګڬm Vڶ}Mى1|P٨Ԩ؛ ں} V;۵ ݜfȐ =]ݝپސݝފ-0ׁ N{=.N@9Xhu}NnM@ `P,@ Vm΁ҭZ0%nVM(~6.$T3~СHp!~х2Ѝ;⍐c^L~ /́P&.Pi$@*, .N1^pgn0Z~ᗎ陮׵b0 #Ë `P>ᚮt- π @ ͐>Ҩ $-|.N~:ډ  îʮ P 볮1nɾ,5#0DEM.5sn>ns І ~AC뾾]cZოꬾo  @'0/ 1 Ph"۶w N>%bEy.w0 $D?%J>;a` !N)ߎgM~"=^ 5o }~VT~oo;=A?N_>䨭 v_~҄p 7 ]Ro޵v|ZOMn޸?ाOѹMMOʐ?a?_ԩ\O4>υڍ 䫏|naH@߿P$H"AR *ȐFC}|8PH2t1ʂ+f q;RQEJxh:W:,YsaC5rrȟ9f}fMXe͞EVZmݢ*$]pJDZL=dLl#f[8ݒ[{+$#|Ku?L&Hӏ]`0UdA DjDhI=buCBJ" -fJX.Kux}`&VcIt UTUm9 +Kac5H"rJzD吃@8mOQ3\0$$J8ЃPIeZfE߉ y;nICpa9%J=D5:CpJ4O CD%ad $xU`'FmI4ZEZ|gqS mUO__'/zSzSgYU {LT#6=TayhB75q%AAXU"6pEx!68x7a!ahG$GCqv~DGp0@-@7,'\@BM,p_($RqhM*')BJm39ذ7@ H56#TGXd@,#La C hc(E9J^KX#qG~>)AGP=8~kP TJMnAFx!DɁT 6H,xF^6(i`_Lp VjE3Fy4! ]8Oym.aQϵLG/5N"^>C ] Ĉ4~AM@*V(K<y9J7( k4Q~,F TYAs(=̧\Z}~Sd F1$ &zdiV UƧU*CA ~p!oџ't ѐfIęr P/j\e+N &*( kB!t>ٶH>YҞş!rGX`+ l,l1>iL5)‰*%Xiuj!z*p #,)nKNl+P O*J`)(ح7D^]o 3@*H+b {pU׆(ZöX)/:Zh JOaeJ@_<$Tʛ!0~2Gf%>!`EHYE`mAXQq $l((a&j5B1:I8ZCc3iO +V A„+H) //h`}7bOdma/n\@衢 !(V8eϽ)0\kkP8x#]ꚞ`a4xd6zp*;@@iyAٺh55mv ̙1b<r4"/VѪy/v+`#%"u8$HV {,NVߤd RHѕgU.+?o}iU|HHj >ć`gY '5/N1 5-Cyy~Q2@4CZ=r#DMQ}xAE,G|h$PR6Ӛ)u{Kqn}#<{Kԍ`2깄{ t*X }~LY{RtR(suZa" %H@Q5@+R~%[hB^˨8t) aP:<'B;r6U9P*8=̰A.8a̐ڳ+K! XhӼa.#K,3? DzB?JX[@Ȩi `66@5x9t ;BJ`d*y3; N@X0,@ зǠȼ9/@SSXYFzü &*@(A<isjwAJnr"?#(zB5BbCoخz:۪Z.2$.% 3*j9@#eXPc :6_H>*}tCj|72]U!NX3e$BhDz )x;I=YXSPAFD*w jS}Sߛ 0sTCq5``z/`k`(8a%aYΈAK ޫ H8D4Л/?4 (G<$`_7'(3r\r6J؍ 9_<(ӎй$&Pǡ'aA#`H8#| /js #-UZ+*REG̤%= >_C*@)F[ > U D@ ?|3 M .e,;N&i05a&i\bfd^ވGU ?H4J,:.:4\ bJ u9V=1NgrZ:[ ) +~ܧ&%`Uxõ >GeǑ[fejeBbfֆo`kllmm`niƕ>A0Rn`V| 9x4rsܥ[K/he{äU(觅k*h`~Hg#͟ ڃr.y〺l(061߶l@CPU0"`5=P>`m[L舷Q4B.|kOC_\VKCoWkO6vBCY@urT >kid=fiXk,\q@u@qjh(}\jЇqkkm 0qpk 1-ppܲFHKgP&*?CJAaCOfL*軒/<w_ ض;;*E0VYH!Č9@*VVrZ@=Bf@1Ve)I[ADd@j1FAY1TBvTω2dZR`hfkHuXrxs@n_oa Gu`0~sp:3p Igl lhk 1>U@ʐ !ٳE28UDrփ8HU8F[C=i< 4w"#9O\ ;s(W];'Z:|CҤ{awzLHވ-̑FE`b V rꡰ.Xy0 \jspy#@ml`zhp]w0zvq?ju w9 x ,ppF!lg}(xzHI8I|8TNwO4VJ֗&)4Iy@Kg=)0Oׅm# J}ֿ}HpTY~?GG~weWPO( b}H &A閙}Z!]ȐD$H_eJd0B'H1aCf՚Upƅ F$H$H0UV"u0Bfm(ѢF6Z:}BŇmZ UZէ vpaF͚Vn"Q6)P!T"8Qc5_1X(QnL.l@<< 159=;̌4IGɽﯡh𔱯X^EO$2cRP ~$OwL&]DXKsdNQ\GDA^w9!4R_"hȆ ~P$}2I@5\CYXY?OV[\QOOXRTVكn u3>W^jEc#^*~説=߈>Jϝꫪ*,z[A]58?By|!D) K<,HQ0qopBYpG:YJ SbOT(g8Z2ӜlQ*E2FbU_Y2_RiUTITSI*A4^ F;sP%=i= TƄ2E']iCE1H\PUϹ2]!PH `3h*"A;u!:(TF8h 뫭FS$IsVYԘK Py^ځhN}Mi~0F[o],JQS{"^BӿmmU5,K\]ˢn1)c:;Y9q*s!iUpheݕ"20g`ٔ.-t^c Cb@EA\c*1s 6.tJ@(GM2ɨ)byΫ^[Xy{{.%}CH!g>\ʹ=X p ^&S;f9vӈ?t/ N`P:˳kqi$-lݬO^5 @V&.@Pp+&~ 'jc!͇:c|!z`LO uWU0 .P0``9isi@` !-e5*XX$*.ԂiB-BaJ t@X`Uu`jl%D,/,f!B#DF tPBR Q2m8;:45­Z@"%trwDGT˸zB*+l!_hIkKaOy)zX?è%fFV@@*HzcsYV-2^C򮜵.`qc6JĈ*{D@Cٍ{հ;4MD2A&]V!@{K$0ƦJl!@B#@+1s֫!ˆo98>q ҥ4r=0z*"zǓה[0% xa)/~hJ!Ѯf9Ϟւ-ܾ %Ke*VB FA3[n 5wE¦B)4B)KpVC;.yKg& iJx(@|OD !!J/\"f$/2~B5Ja@D c9<(F1#zP1 (f4#+OHʨ!O Q Zc :djCP%*Ht&"*ǫ? dU*[*T4RM6re˗1gּsgϟ3Gk2S' tkׯaǶ6M]GГ :+D^'Wn1U@ S~ ~!D+V1yPJތ1R$ I|cqV9F ËzN0 ^ʻ~l[/(N$tϐ..R J'd|: JijLB1Rʹ dHȒ A8)K&4,{ZoACJѮSrVHS"YPjo(1Qȃˊ.0tHTdR?8렘 X)) /: RJ/TZGz@(P LnN=%4TclQڐS}22YjEm""p}:w`Jke5͕ 'I:$ ܬtj 5WFũY^p)=-_F;y=X+fɡ׹`YGah$v]FpLF3,Cb1nh a=āwICȮdhKbB)=#X^p] lKAn/# vC{߀ĺMc(U"vA-+MF9+j%jb ݤalD*%ጱkN0y8[d/Xw.SRȌPFGPHXZ,.>1A ( WЃ'05Y/mQ2 $fiEH"UZ[L%/ 1=x%%IE0]4QRIÅa!&$b mB搓3G(D$MP᎒$Hd(?Z+XI me*)%pP?aľF5,s&srH~ 4c D5Mh.' ceԴg"j\D sߌujYʨm* Bֲuj1T Mz\D}J5AAIUB-Ѥ 1j( +ڲR)`DJF04J)hDW%IS0mk]Zʘ*lqΦOGxU'||"&\TU-]y0邏XAswZ׌T-(DU;4 jU>x1Oۥs: \J\4y8L[pUDж"/*n{"cS[RM,w!nsbVm8u-گ7L,]'ww,XETcuOrGhvku +X/׋\JJz2z d#}ScH>(ZL >i Z䋞rvs|mO`/ki,.oA!4O8. P2$pݡZa @@ LR簯q^AN0a ِ-^vhP0ZptDg }o. a Aq o Ipd6[p P} 0 PͰzcQ {Ow<|cp0 !p*Ao^jʁ>3^0mr#AH d8.Ac a!@a1*; |gC^1'H 6|qhn!_@*/HZ#@{Q٦!` vQ`fK"熀qQ1`8DKðk/؄'OnaDT A((2)r))(2*)!U. @r,HX6A{_,R. aXX@++?"./,r/0/-,h1S0I +9G12咎n,1"3,=0 -r+1Q,SS,r0 226h62 -!+;7rX6>B*92:9S:::SA0RTL#5a؁==3>s>>=>s?=Ad㼁rFaAA!4B%AA H15R=atBIDMrAC T{ATDGaAeDiDMT45d!DBkFtAMr#@A=GatFIC5t}EYHJQt6t+@ G4FLKTJdItKkBH J}M4HG!E?4OIHPԁ?QQ!U>=3RSaA!a`LTQ5UUuUYUU\5Ve5Va<@`JuVU'VuEw |YHZT=vUY&n5WYA[VuVn \U[IZU] W3# ^YHTa@\6V!ZZ5[+aU 6b[b1R bc{YA6``_~5eiUfU=TaēoaavhviiiiijVĕ_V!Vll6mhAkkkgajVmhmv\6o l6 vckVjq WonhrrEWm@4}rA7ir' No5ԣuWrVvi8 ss> 6BiCwr6vtSswnvtWlwxSWsqh|PoUw|7~V~n|oxV~o!x 8xX{s0)q[9)66w%~)-!/%>u=~ TI>YU~Á_M}h/^!uy~⃞w6?^>k0'QA~빾>~ɾ^9!^~+׾ǡ@پލ>g_}ߞ^ ^_7E50AaY]a?eimARa9 G=A?__agX?W__5_!?Ses#m 1O8r*\ȰÇ#JHѡ8x!ۈ޿x̉Iɓ(S\ɲKsC׌ r/s,ܲ~n*I|JHJtO&RՊRtaեS<;VmNLݾVn˯5 Iݿ͑8#2yͥCn1Ə#KLeȋ_rt1[v!9ɚ5C|fr=r#=?7;=԰^=۷=~ǟ_rF<笳:VhfN8! ? ?!/2H!:':&s,#a:N6" c0I$;F(ޘDHRVy;x$"~ΗMeH(9p&9B^"|fzvI!jhk>:vO=駠*jꩨj;X= ΃j* O:*+&iJk,F+m>:jkjrkmJ{쯡.V;o:-x+:k +a?Q3+ƣ;WlgwhM?GȘ,|0oD)ۼr;7L222L1> 4Cvn󟼤f>*~ZDCIъZdE3J~C`a׭(MJWҖp.L]J~{ L:Ӟ7)2tS8 Qoiԣ."]jS2SuMjfuHWӰFu0%+MAg՜Uee+W9{/}\72V4~uTa*iUG9:d'K„bjv#84KZrֳm6F[֖,2BZג=,mm[Z&#mc wFnRms- Nmpj׸ xKʐz|Kͯ~L;' olu6pL1?im|w<hj^׆ 6Aml[GEC֠4A(OW|"6Am:#F5R> .˃[C8cعЧN[XϺַ{RnjXcvUz:A?:Qn07w]I_AxXcf⣾;񐏼'O'~X`&#F|yW'? k?rjQw>O7{7ˏ_|Kͷ>?+6AxTGQO+^4±1@ 7WXzbAr8y &8Hx$8 G"(y281X3|5X6x{7Dx *$;CHgw{р0$Ƞ %@RJ8R jHe.!؃>$HzN`{ux{8)G4brx؈"8 r~@H}h {{PW0z8l +H爆~D:ȊRH c 2!-wzgEx G w h8Xx/x CH8hyhz77z0 `WЂfPHDrzuF xF@i>p8ȉ' "9$Y&鑈HِDg`w> xxW X;xI yx) ,ix #x@ Z {FxAYI9xБ YNYvyxIҠ#@[ hYPlxPRU}LْYyԀ $ W F du eIx VyqɔșʹǙYYg F`v )k i ]Y Gi  yٙK yigixDGa 5ɖ 8 MɟYz8Hg@ >YvK ixؠIN霆yhPF0- x uE LZ0 )=}b:( *ꐆ9ٝ^ }EY g @cib avWyT ɠ֐  y &J xfph d:!I J- xYI؛Kzp"j KxY U8zZMiw(F @ A h-g@ ګ  >J k]*fg yK0 : H: , \+!+c 6 H`ʥiGz⺚i溨 zPZ,+ `:{xy:\ Pʮ"R ع$} S[:%؃7AHk !C+N- J#jL:Y鶽 c9 *ac>0IZ ɹ ɤz˺K1ۓ+ ]Zڸ&s+~԰ ᐚh*y +y>P 0cyFPKSZFɼxۻh맫ȫ9I  D૗ ;LEx)23rz!gZGrPG  'rzBЏWK|XGʲ  p zU;t Œx)eIiul\ Z 07y.Jē`F!G Y0^ 'ƌzxehlhvӀ *h PR\z#Lk t|{; ,ljڐzȗYHɐ PZ: jDHúxxذx\+̉̾̇+;L|ݐH/ 'M ZY\+[ΖO=۴mQxC xjv+\jڦ=bM Y<U;& A)c؈] }R sV\yl3FeGx +UX `[ӌgz=W DP1LN EPC ^կ ڋK޵]&n;-9j| ڥ~D`vb g0O܇E8@zF&2n ..ͷ{Җx`Q d ZF*l5 ;섥*e|]\*+B` G :@B &/~ . x]3\ N=lW񊝋ۊ<^~ԓ,Ez;jYv뺰8lMG (_,R/0xR7oX؆+@[ Bp /YI׻Йxٙܲ{pH }`PC ]no")`{hPW{QGȣ {ǎ)[,Y]oo (59y_@8 y M4qfC%:4ka_!E D#DTxhIkScJ#';vJ"FPڐDQNZUYnWaŎ*M?z,sc_$Ջ^ֈ:U-j4Þ>%6ÇϻֲMg ڿ~غNPCO ai ӭf")l LGaѪ>%4~x1cl;Wd]N|yr \GI{ϧ_}Qe]+GF F tîY0k s,0#.ˬ<-S{!:Epjs*jQJlqMj#9# Rb&/B+2-j')sL24L4q!\eI^bΉCl1Ӛ%tB"Zb1ӌo*ŅS.~l+kc=Agi7kmjLu'9lv:$*ɦ=ZP(cK.1MhvZjjIsaed/b"؉l*J2C"> աQy2) ȧ$ 2ҲQuly$,wW50Ǿ{S.^¨(` %~E;ȣ9`ZLg5hVz>lHɹM\!#fv_껆y=Y*ߣWBlCR*<*d}Xoa41u 7 2sw|_x,!}=(+júj=j_" Hzʇd~hE-;&4td\Ř҃'q @W$z0+r&5Rm[9t&ƇqӜgGw+kUPDӰQ[3I՞:V@LV,'cI4ē0gx^G\gwMh_3 O/xQ!~F I!rzPvhB]NDWDzFD}݉Tz/b2Hגhj]\Hmj ^QڋIDHx`$+DY XFWlc:uI%@K,z5"&^{V%Mيig_kK֡T(HyeD0DʹԜnTW>ItCZDa/P.27" Wg8_h~2T 5Ұ VD0˚9&ruQ&Jꌄ,i K*Ge~]G}/`Z']C;ʓW/Y#Z}1ԯ eIÔ']E ^NEdg搚79.Aufcm΋Y!T Ѓui:aq2l8ô{|/U>cHͦ4YjIB%EZ][_Wˎawrmop as' lqQYroI3SrZҰQZ`.D&D(`^B4L/IϦ6m_~M_d%q- v̳;]'˧dg 2kxA0Opn[xj|y&t#Y,P6qgH٭eA&ְv(l_{l%2$/szqv t2(sXƸ=>~g >? yz!r@H @!{=qI,qy@{A+5A lH`MHo```aa.oX[pna~aamX :aaaaa b!b"bT2KІ"^bpo`a&>|o-b.b/b0c1c2okT3}o(c7~c8/(b9c=c>c?c@dAdB.AspbCnd8q RMۇphcGd2FdͽcpOdPeQeR.eS>eTp .sMpHeYeZQD Kd[e_e`fafb.fc>fdNfc\fwdefZ^e"WeifTfM~'rfpgqgr.gs>gtNorr ҌЇr`gvngug|g}fq J]}hh.h>hNh^hngzghtvgx޴ygsMr0.i>iNi^ini6r8s(rxiii&f ij.j>ꗾi^jnj~jirh` xjsFشjvrjux(tXknk~kkksps0ko6)dt@o~t8~f`nfn ŇfOp_poppp OsHcyt`uppqOj@Gqoqqq_p `q_qqqn|n@jv qq qt=x`{sr-uH0I$u`v8s4Os5_s6os7s8vPчi j~xus?s@4pI.sA_tFo7wGtI_XJtLtHtN_M5Xd ćuUtuxR fMwzxCL(xwbzS|{]SBc:0 =Ȍ2ҼB#2ҡÎ@!IH2۠MbSOM/14 ]؎au yOwUy'ax"yЊɵX74,#Ϛ/}_|3D̑:8<(ԃߚj nFIXfj|_B'LWP7icơ* h_, V1BXE2$: ;N}8Dn)2ߘKd4D :t,j孇{忈ɃңJ+ue'#t:Vf6/!J' wa /T#B" (.m#h8Mj/= -SOg,/<(>D>%w^ϯ:_a]"ciX' L*O0' 6*ϬUuSf2C]}رIo`"o{۝ߠ1dI9Հ"&AY:6  C8AG۞g?r'5C>t땫*ٻŐ):;N9_W :ʶX'a0Xaq)iaHEwרP ɕ`%3&a!l!-&PoJb #;^#[!rk2vtN_~DL!ʔM1dP"0;2%`d1csb&\gZa[p9V)syU/!$_ )/m&iL*kX#WqOÉ)A-MO"ÝU֗OơS\a=u\.PQɈ(i"6uDh2Ґ3ҥ"Uҟ$bȐɲjO3vgMk D&QW9SHXjbq~Ln8f;x[BXD1y|cxzPG"3u<;wB]i&s!qQ׾(ԟvJMroi9JWiSPhTA~lrv󅙦' }) Z9e,kj^K1%5z}/n^E 6NJW&aΫHϭҟƪ>x˗G!4tjW/E*+1c֒u)|mSe2 #6\(O|b8mn1Y6ᔯXK+B_KB.dmd:hRT-L<LWn7:fL8 i)#𖊴5\bjկK19e01["#7 3Җ>,u#L +ai<}t"pGa8^u_ss fą^o,ԙj!]z6Anȃ}"D;6s}: [[p[[ =N`eKnutK=OBqvzA_c̶}/t;x!YxA4 p/æ?ɟTcFeyg{ODa467g7ۂJ9e|ΚQXȴ@Ƅ/҅NSV:Uճg]1[:q;aplus-fsf-4.22/src/html/keyboard.html0000444000265000001440000051313710737165453013262 The A+ Interactive Keyboard Chart
Click here for HELP text. Click here for a keyboard diagram which will print more clearly on a black-and-white laser printer.
  Questions? Comments? Suggestions? Contact “doc@aplusdev.org”.

© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.


aplus-fsf-4.22/src/html/keyboard_BOTTOM0000444000265000001440000001324207430476700013367
Click here for HELP text. Click here for a keyboard diagram which will print more clearly on a black-and-white laser printer.
  Questions? Comments? Suggestions? Contact “doc@aplusdev.org”.

aplus-fsf-4.22/src/html/keyboard_TOP0000444000265000001440000000373507215467545013043 The A+ Interactive Keyboard Chart aplus-fsf-4.22/src/html/keyboard_help.html0000444000265000001440000003011010737165454014254 The A+ Interactive Keyboard Chart: Help text

The A+ Interactive Keyboard Chart

A+, as a dialect of APL, uses symbols for its programming operations, rather than keywords, as most languages use.  This gives great productivity to seasoned A+ programmers, as each operation is just a keystroke.  This use of symbols also means that a tremendous amount of code can be displayed on one page, giving an experienced A+ programmer the ability to see an overview that other languages may not provide.

These same symbols, however, may give you fits if you are a new A+ programmer. You may find yourself struggling to locate each of the symbols on the keyboard, to remember their positions for the next time, to know which symbols are important and which ones aren’t even being used, and to even know what to call the symbols.  The A+ Interactive Keyboard Chart attempts to give you a hand with these training problems.

This facility displays an image showing the placement of each of the A+ symbols and the regular ASCII characters. To use the interactive features, point your mouse cursor to the image of one of the keys — but do not press the mouse buttons.  As you point to a key, a table will be brought up on the screen showing information about the symbols on that key.

In addition to seeing which symbols are on which keys, here is other information that the interactive facility provides:

  • The proper name of the symbol — that is, just the name of the glyph itself, separate from how it is used. (For instance, “” is “Delta Stile.”)  If there is more than one name in common usage, multiple names may be shown.  When there is more than one, the most commonly-accepted name (based upon APL and A+ usage) will be shown first.  Names which have limited acceptance are shown in parentheses.
  • Indication (by background color) about whether the symbol is used within A+ or not.  Some of the symbols that are in the A+ font aren’t used for any A+ operations. (For instance, “” is commonly used, while “” has no assigned purpose in A+.)
  • The class of the operation represented by the symbol: function, operator, punctuation, etc. (For instance, “+” is a function, “” is an operator, and “/” can be either, depending upon context.)
  • The name of the monadic function, operator, or operation.  (For instance, monadic “” is “Grade Up.”)
  • The name of the dyadic function, operator, or operation.  (For instance, dyadic “” is “Bins.”)
  • Some tips regarding memory aids about how to remember where the symbol appears on the keyboard, and about why some of the symbols are on the keys that they are on. (For instance, why is the “*” symbol on the “P” key?  ...Why are “” and “” on the “B” and “N” keys?  ...How can I remember where the “” and “” symbols are on the keyboard?  Once you understand why symbols were put where they are, those keys become easy to remember.)
  • Instructions on how to enter the symbol (Alt or Meta, shift, etc.).
  • The position of the character in the ASCII collating sequence, in both decimal and hex.

Color-coding may help you to recognize some of the usage:

  • APL characters which represent A+ operations are shown in RED.
      Their explanations are shown on a bright yellow background, indicating that they are of primary interest.
  • ASCII characters which are on the standard U. S. keyboard are shown in BLUE. They may or may not represent A+ operations.
      Their explanations are shown on a medium yellow background, indicating that they are probably of secondary interest.
  • APL characters which have no assigned purpose in A+ GREEN.
      Their explanations are shown on a light yellow background, indicating that they are probably of little interest, but are included for completeness. The shade of green is somewhat hard to see, and the background is subdued. Both of these were purposely done, to downplay the attention commanded by the characters that are not used by A+.

S A M P L E    D I S P L A Y

An indication of which keys to press is shown.
  N O R M A L M E T A  
The bright yellow background is a flag that this symbol is used by A+, but because it is neither a function nor an operator, its usage is marked as “purpose”.
  S  
H
I
F
T
E
D
 

&
   SYMBOL NAME:
Ampersand
   PURPOSE:
Execution stack references
   REMEMBERING THE KEYBOARD LOCATION:
Standard U. S. keyboard layout
   [ DEC = 38, HEX = 26 ]
 

   SYMBOL NAME:
Circle Bar
(Aspirin)

[Unused in A+]

   REMEMBERING THE KEYBOARD LOCATION:
Arbitrary placement; but notice that
four circle-symbols are grouped together
   [ DEC = 225, HEX = E1 ]
The faint yellow background is a flag that this symbol is not used by A+. This is a character that is in the APL font, but it doesn’t represent any A+ operation. Even for unused symbols, though, the name is given.
The medium yellow background is a flag that this symbol is used by A+, but is simply a standard alphanumeric character — nothing special for A+ (secondary interest).
U
N
S
H
I
F
T
E
D
 

7
   NUMERIC   

   STANDARD USAGE   

 
   [ DEC = 55, HEX = 37 ]   
 

>
   SYMBOL NAME:
Greater than
(Right Angle-Bracket)
   MONADIC FUNCTION:
Unbox or Disclose
   DYADIC FUNCTION:
Greater than
   REMEMBERING THE KEYBOARD LOCATION:
Relational symbols are grouped together
in a partially-symmetrical series along
the top row of the keyboard:
< = > ^
   [ DEC = 62, HEX = 3E ]
The bright yellow background is a flag that this symbol is used by A+.

In addition to the name of the symbol itself, the names of both the monadic and dyadic functions that it represents are given.

A memory aid is given.

The position of the symbol in the ASCII collating sequence is shown, in both decimal and hex.

If you are a newcomer to A+, you may find that some time spent exploring this chart could help you to understand the symbols and the primitive functions a little bit better.  Rather than just trying to remember where the symbols are by rote memorization, this facility tries to show you how to make associations that will help you to more easily remember where the symbols are located.

Your questions, comments, corrections, and suggestions are welcome.
We always want feedback.  Please e-mail your thoughts to us at “
doc@aplusdev.org”.
— A+ Development

doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.
aplus-fsf-4.22/src/html/label.gif0000444000265000001440000000603007215453037012322 GIF87azp,z0I8ͻ`(dihlp,tmx|pH,Ȥrl:ШtJZجv!SF<4X%k|~s^zvKm1cab}l~yǟ͓cdµÿP g 0NlZ6lݼ7D}e\G|]7]u !Kd43"8ssϟ@ JѣH*]ʴNLR4 Ԇ͘V7-봬ٳhӪ]klҔZݪwmɊJTErˆ$^|1NǐG2eƘ'[Όf3vcS{`N]6ٯoSoBeK/Й6سEꖨwG\ז, OϿh 7%xG߃r=fXp_wCav@u RQg&G5⎊5܏/LJ9Xd'UM&^褕H^u<2$dfA$u%v7eEiXj 'UH_węi)rI]ZH9>SdVi2Ds  dH,u͵*rpze:]xk\\sY*髈 .F9t+k覫 ljVm,Sr_صob;Ag`x; oz'o,k, l$;s-?s3'm3N\4SM5)Ǭ.nQ cC]nHsv L}v/]wc[ܴ47'9W x:|ޅ-.78rLފ[og{?>E)nJnxݐ >nzOrN;uj. qonء{`ͳC۞oO9̘o~;꟫6+|'.}~~_w(r\Dg7zs4ؾˁà'ni (@> otؓ X.obpRHD ({ ! 7.t!QC%zsbxX!71ys/C쉎nZ>?2^P~-=cU={l9QPD#:Do `GqD\طY.c"$GYJЕ5$eKS Dd%նNh 0e7LaЗDc1U2`DjL1@ef%87Mni:uk<΋g1YO/T=ljO\,0ZrT:0´:̅'ͧF6Rsa4%C;*|3Mh`:St7WJO˦ߺOPМU IQrFTPzԟޚLݥO51X{V\S֣XCME.U&=h\u׳[I*Ufu&ږW]+WZS>r\ͪN(3#UVsl[^ݬY k5~V[|PHӚj)YQ:L~t3yKZ-pZ^i VۘWEmf1 vnZhއ!m,ZSW:,Yֱwݪ_J>Q9 Yv4%`xν0`938e"kͱ;DW_5[ edzպ&[Y1r8 цsWs0wepy5<)e9s6Mvn 6wsgϨ3AeAy.ρh)Dt~׍W:\f0C Qn:{43.T\#BzV9I`=gHJzģuT_([ƶͮC?[v@˨NH[ݫGt9ۢ]=![{Ui{ޤ~ߴ^#{됾q57>'Y8/$5ecEl]1lE>'GyK)HP[u1XӼ^(W?jny[]F:~M`ӵaO{Nv.Hy̱ oK)NwBUQrϴ{upH'Mn&&$ k,^/>o2,hOW A?:eՔ|h$S0}A{ 3'o"ofKϐ\8O}E Dl p8ɟ{?_?yϟ  z1~ ~!h 6~ Tg3~~&~]q-0xHs! p-bE=^2rG`ftz:ql+[jw{kwmiFv* LOySQHYC@WUdjH?y©;ӗرqVܴݦzhW hnXS* TG{t[(;=,oZ.[Y *H5BڳȓgJLBݹ1\|IUrPHt8|*BOVzE=hn3RT}%ru{ ˩."ǴRvetapF㴏H%bL ȧQyEӺ3} ^ݹ(8njt+q9Rvd7"lG/N9s~,6سνKXOs_ϾßOl'``_-!kNh!y^hQvؠ9!h&RX2ָZ6b5zGN9g8>.m@n6m3ŊNNc绸o.b[$!Tu[G` lo~I~- N6^jQWcu Z>5^'ˉ/Bpҿ~6}X@>=]K`ֈ'Bd$|ڄV? b/+ÁF[rw+B2w>,27i HQ X.J[>+~0]Ӣ`AĄM dlդ@W<HGh#<4>joo r9ɓ;񑐬bFBa #IQs{u9?9vc)'YIQd#eW2YBdp9K]撗e/1a +s8Ќ4IMP̦6nz 8IrnQ|%̩MkyYiV]+"C1']Hbj d'KZͬf7zZy!LmOP^3a`%(;PvmZfշM;e29b-\Zܛ{QI <=qק5xpf:ʼ$t?3|w _]K`^Dr\H7l[8ϵA9LbVV 1 F\(sH_ۘq+@L"7Nr9acI-7CY)+qY xT^,2o[Č1)W}ѸbErM٥ @P hys6]g;C8EsxS `<>̃MA;롥 iz(9S=QVGԦz&&ъ#YO_A Mp5{5ý-4ض8m\5zpnb49˓l7\N_z4ѽ$( %(\z ksz3w?kW`]puq~nK]M7ߕ>tCTӠeD1f'|]w_V_uMU<;yzKu.I]B e.a{o<xst "]whq)KI㟈~lF*yk_m/ nӉ?A}jWz'}ug{U~F,oW6~voQlmz}p'w WXzWz 8`&q!'$gHWf7{FfWvoW1x4wz|wOTg]w|4pkOy/ |UvF|9zwtxh|CvggH_d}fw4jEp}xq/(6|Xt ppVopzDSw{_f$s9fօu*hD85ȂU苳yjvǨMJHN8pP\#py8dxf&(bxdxed[,YP(6 9P( YO} 99O ^9㕃|v~ 9>5F,iN-Yf6y29;+i>y!,Hi8FOD)b"w}XUOiЗ/ٕ'@,ɕdY=h)c'0T _HWyc+(Ҥr7mC(r  AXii::b9ylٙxSB~0ɆxV?)a !)CŐ;֚9|)KG4$E u!C|&qt uiEI?srRĞP^ٖ闲!1u{ @9\`D' gɜJuWH@8׃Pva*,ڢ.0ʢS9&F+I5e\%aG[WA XE]ȣtiu/g 0'*Sfr5UT EΤZʤ4#ag*+u:UG*fjkZo[ʦ[:=*QZfJ{UEh(E3]j]P(UF%㈥J6ew9(Z_8W}~vQ_^zEy{jhc~:Lڥhz*0Ҫj֕JƪU)XJy \ŪTyDA9rαSG]ʭgŬ*ʫEYɟItu~5Q[OL^ŰJTJMMjik3AKxٞ-kǮe\XN]ZڤUCH{MN2bP**%xzC{ኣ\\Jcu5˱Key;VڵYVӤX:a1u6ys;?;|څ+N)۷Gk[uk7[փ $XyVc{ɷٹZ'Ê:SwSdjzRI+uSKo;ukTҔ頳&6xt˻皩l a:;>[ċɫ-˼k Y>1Z{ $!b!; | {Ykb` e [ª_*v!T*\Pj:'܋=dzK܌qVKĜ9L*v:U{J(~;)lsĖÑqթ`|R!4)tz|sf},P L@|} O-ܹA㹊JilJMe ے#h IO ْaxV}bnJ,Llmw)+6}hZ1>ԯ;+?NFI瘻輵i^fL~+j$w~dD`vM¨>(}aqMvnN豾> :ԣxL ]Ƀ}>CjuWƾ^U;|፼cNɚ>ለU)>NZsk EM,Uoz'X`V.3ms߮]/k>^ =?_UΛMC^.d ]f^h:di|=K*$̓⫝z,M!n&^`m߮VoXoIb_]ofj?lnDׇzҞTqsyaį{Hߦ/P8&DJ1a_._dORbBKPN.׭B#Ͽ4bcgo?_/J)I{l_VG___*G0 `(dial+ϴAn*[fpH,Ȥr(Υt ~HPzAQKi?\k^0Q~ϧ@}G?ogkm(r[)oj:%t>VXP`ji!]'q;WMvYβЗϔ^&zh\l҈3%sw Hpu#/f!R"# H CJG!>nMD #5X7SʬɳDTBDy¤8eQϞNFsV$t=GҤ=zVPl#&26<|8Jx Ш AsVŷ'W* î/J<X6hb,iE鵯R12^~Lt x';:rkW8kSj* %o' mYϏ,HV(?h$nz9XvyU)Wn)Yx)b̑ CMo>y݋uH5Nc&ˡJ0d^F+Hl&d6!lq+kޫtGkIp3l%J#MWl]C8,AZ-L{tT_V]\{g.uic}Ԃkm]vh\x/{gw{-8؁Kg+7f^&ŋ7nbSS;W9?!&vΡ蚃V® P; J_|3<89T'}oo|_s/~c>>򻻔}_w=w<@w@P#> 20^>z <CH(D WЅ Ta Y8ae=a egPx@L&І2^8NOͳ`|ҳޗBCIZR`&7D2Q>"0a!zLf&τwɑMġ0Ihқ,!7 m( չR`%:shNtS?Dэ Wv,L׸ĮD+ r_TovJ`%0P%`7UC*GÖ1 A,#wSGqKBָ3colcX]L"HN&;PV \PN2|p`L2~n6Yf,9gvγg(35 aM"yu.h"ѐlV@+d͓tDOӐ~GMj; tWePcӟuEZʕFA0}^3tf%Mk_ֵ֧AT}f/zO6j`;ڊεAl{^r]k|܃N+BtcJ,e/{vìuu׆7=opƷ%nćLiN7>~gxMqZ!?ÔK|6ˍr{ Fk=/twnDwЅ~q/]CO:qlKO3_]F:ҿy\/hlolGs{y'9ewHp/i]d;y_3^~||xK'~|yٯ.HM_إg=z"QuȒ4 `O;ЏO+Ͼ|pJOTNOϿOXx+q 7e'|W{Gj{r8efwGtn)p$d(؂Xl-g&8oWrxM,'=H@8h2d!a#'IPv>hV/mRgVxPeTlEgGd/1Ȅih]dR(th`8qV_HiBXr?(xhcpW{tuvwfop]pk~؇UqXhde`։V&mֈZX(&nҶ8HeoxdxdIwLgU8^rIk鎼d*%$b*d%陗CI7b-2I r:穞iىd_zٟ*u雄HJɹוZh~zڡ z'}*!*,ڢ.0ڡ# }ڠוWǣJ#JB*0DJ1{u>tOJtngVZzm);iImIj2xȦ7A:W%j8=ǜ&n7 Yfh UzZ6]]Z)qi:iGri$(oJרr&ʥKmv 遼8ߘrOrp:d JH#שւ:֎Jjj'ڪw&I̪6׫XJxSȧ&=9j:JjdUIWxC`I,WyʛخzJ8e+:)sz:ǰ qJ'ަK2khzj.kkF:[H۳m@KF;mjhʲ6WխX{m7:)n mfevI) mGkj8pR Hf|8˭Z)mI:1Y[" j+dꑣۧh۹q+X bHwMڣwQs DyZyËwK#c;rV罠ˤ q v⛻5ۻ{14ʿkK۰g ̻<,| L|"<$\&|(*,Pdպ۫<>@ y42廼9<& A">һ1mT.HN@.QX^b~[J޸M]S  p>ht~gxO~5s'K0芾>~阞难n~iANM;z>봞^븞>n΂3R"ɺ\|lƷ-ɮ^,鷎Ӯ^褾jɯ· vھPȎ*~0N®Xؾo.>?뷞n^T_ЮN/2_>68< "?hܽCO~COToUn],\&[/:wO`/}NـM6?"{+~{oof[D!n;S?G?IldqD͕/o..|sxOn?.eIX̶]yX_1@@ !A >QD-> 0` |Y@@J-]SL5męSN [<E 2aѥG>UԦ"36|p֋]~ CˆE6ح uVܯ7v<:$P<X`0^6yo6 p71PɟOW:?:+#;CA K/%48>1DC))D1E"s: _DBgHFoHCt۱D2H!"TD2I EF(rJul,$<K/t TYI+rtE,yD04R,34R34ADeo:-OI'D 4uPF<+CFG9GJWeU0#)VYgV[o5W]cMh\5Xa%XY;26Ye-Yf6Z6mC-wSUmi1  \q%\sE7]umn]wHSy3=q^{^}Q OP-Kn&W]fx݄V7}'._/b7߻zl &[oC]_~t%^R8PٹgYgҔJf1E`Í\dVeѥ+ZgLoFl>ߣA6U;{Փݼjq\7뵗2wf)G2_*$={n|O&jS/_+Ow*29zoYg{lx/}tձ֚]E{=kǞd{ps鄕OjԝO}p鹦fc߿|1M pN# t0)(샠>,jw?9.3a-{"H|\"8<2 rpzrB-i2 @}J C#Њʬ?at<|e~P8'*1|f $OWģol- obz(ƈA S3M-2`#ȧ,iCVIdQj HFBk:(9Tiܔ_":n.`wd.yO)KiJ)(Lc!:l&ZbRne6uɬқ8 ILW:RSGgnrC'5?&<%F /r]-x$3|+4YDsS$մ5O„`Ѐ 4|\<;U1m eC-9kriK9LqvauhsZHtDS8)GmzӏtNn ELѥS]$Xu*V(V)zQմ2*Y)45էV|juk\}JW֮j&׵ZVd,Vֲre5Ypֳm)2M26Y$PI[8XmmbcRsY!%YKV-Zkף2\[g8%WL\!JI;$Jw+l9\m͝$WkHRFTgP&1 .i]NV*b~WYwRRn|yC[ױQ~טJXܝ,ūZ4~$v:Ѿ5:A쿯&+WY -P4K (|;V0{LX|2,SX3r k)8m9_9(f,Bw2lgqKNpDܡTDLdYU^ ]hK _krpڳPQ~a;:ͣjZ7 4vx5 RE8ƽ뵯(T/7W5[.@{fBsά19mLu?ל6[@Ϥk+Xvwn)<7|GVwS<`JWںwr hWg.ͷr&47nUqN pUߛ/e|9cAۚL+>G>9ЇbsK2w+VsCN\t<;Utr}QW%$@_:Xӵ=~n^2{ʞO+=|Ju(RM^NqxPŞx,>'gy#?cYM70/oǚ"_Lܦw ;{LdA+?F7Uzx^,uKVg${S<Oׂ|̯O]xxg/&BD\sD('۱Cp>W>s? ?; A+@8r K?^ss?  >p@[0P?@A=#8㸜"488AAθ(SQ3l .܉B$0$ٻ1#ܘ$DÆbrBЊ(C:CAB6 2T 퐉 K@D, ěE,ĚBB"k?Hl}IB&N?osKT4tωXDLO j*ňT>,Pq,|uD QP" q`umiQM !%"j1$U%-QBQm h;bzh R u'ɘKV 9R{(0:#Ou+=5AŰ/s2TC56MTC83VT9%RGEByk'{UXOu) SEг.;EK< V/cE7jB]U44lubUd!Zm]%RKVSg=\V̤֟41S:6:m6puwA~t}hmWDDsV9>YXzUv4Zعb5UD-8$7Feؑ55b%ESӶ3uTXT|.8'Tu4-e3Y6gYYؘpNY8%zHK٬uaK1| T[MZ[ZJg &+X\T>S=Wړm'TYEئZLl[mJ%!3W"[\=[=Qe*83\[,[\%25\$],XG 5mUbs3ӊT]Z8>5ȅV-Λ\M֋iM;Z#U7^՗ [}REN ٥=+SKӮK߯^BۧI}S=_[_J:BZuߞ0^,bT_)=ژ^-C0&EXLںE٭kߙeױX e"4k`Յ `-c>R b!F!6b߁ dFD n*m9.W{/uA؍)b.PU,V4c9)^e4[%--F!_F2W;X]?ܥfuB\~K2_̹PVdT)6@fcY5G>$Ř:C\5^EƣJ{ N!iF#e\6$Avf"1ܝf7W^H`DE`FUJ`Vvqfhm٠v\BV_ IVҌ8F7k.zi=ȾA5dp$l>&YdݕLް2Sm4s\<Ə&kC&Ն4=بjfEy n6ZM:3VNcz3^4A՜}fdoR(ɾZߵ[{OKI++,~m^qBpXpM1V:4pE ?\qngNdcq r&d"_#kzr-$6r+8m#F4W.5wm7sNr]s,1=9@A'B7n\#15"IJK{{w܉6{'Go=.>wgo]{dGx7`}t} : JRlw݅ yhW!d7!)"U '~X2G z6#A 9ou("7WM4DZy%Y:^y]^eaey (eF =%q9m%zvVljfYhَ I'*(:(J:)Zz)j);aplus-fsf-4.22/src/html/notebook.gif0000444000265000001440000003207607215453040013066 GIF89aZfffffff3!,ZI8ͻ`(dihlp,tmx|pH41#|)K",J+ J ¦șnsܼv"S=lP{!wyI|ntU}s*U.~xzWt,iƯv"NbL\Xrشfܔ؀f~[q֬J鎌o2×;[|;<ubx뛻:ރ8dGd NK%ئAK.GC,D26-$N3_yd>H*$&8DlL BZh39ʵΑΒnykZp7ҍK߆Jޚ2+fG$ԣ).پ9vm=ʶzlxgȢUۅ=^v̭+kH~.uifeSE9hΤ?#Ak3]UwNk * <ʢ?)wSH%_!P\G^x z {]5:CCݼÉzC$cC:inI""4FcExݨ6 "ȑ<8#V#VPF)唊X#-\v(VZOffgl9%r@gx'wC~*UF h,(.F:R^)Bì*j"ژtY*YkiJCk1k@ +}lF[FҮ@mV)mk~m[ҺnC+oޛ/H gn pé0^>L15_\kϛqN<"lɄt2s K)<>KzsL=)K7NGʹTCmWg]5[k}u`3D]{Mf-ej-RݶZ5UQnu ޴h#Ng'yNC+.\S9KNw.xkcCy謯n8礻.y6Jdz>:k/]'7&/~ IH!|ϑcd!чIZr|&7I>r^(Ey@;6(SyII"s#ey˱$iHRt%.÷a/Pt/X2΋"2`nϖfNYLE~f;eMyjӐ $InO섢5ټxR39xo&$g|ϝ _8a3Mk"6PQm%:d*x}F7MZ MAYbR{0%'8&NϦ[:Cрgvz^4P9Ԟ*U -jpJSTT9jҧrkTB5D=ԳB3[Kx5k.YJHJw'Hz<5EYZԝ֔ZVМڕkM>:eseS ٢n}V+ՖkS=[h6mK?Ԁ5mlq:]侒U-ϡ[+O4x#kޱ%hkO+PҳůfkGd^k˨w9`,pCZQ&'ѼW/&< v԰h/|I.:.;>8fq!s!Ƞ|)Lk՞<)Sz ]_.,"(D&y mhf2m,g&ιIsk!ZFԅN|F.PR~яC#0Rg6ͥ_>[H%OXT4OiIwԺ kz욌j;\NRZk˰S[S`^!lnh2-fS=Z>n"MF%IKwE4EL/Ҳ{+ySa". ƺ]ma+9GtAx7zRIH0O@qC 68.\Ji@+gy@ |K :gzǞ_gNW:0;z}^#{ GP.58D9rl Fwt>.wYн$/'OygL߻h@H7Џkio9 {_) %OOϿC|XP0vd"v~~e' @vW}Gzuxsx+Q#|7ǀ0Rt}v xv9qGWs'}1%hjRBwO#Ex$Dhsam~i"g$&1"q!P2ww@B0a"h@>_&ch0mHxĆnkko/yK'gB|. Zxx)∶⇤A|([!ȉsA2u&=(%Hm؊Fhr@6i H#Hi_8bh>(`@|]@Ϩb ØHȎ HhGx؏9Yy ِ9)C!gZ50 "9 P&y(*Ȑ,029hupII@9DYFyHJLٔNPR9TYVyQX\ٕ^`b6'؍Ɉ~AC9pr9tYIvz|ٗDiDg%hHxז"~ x9yɗ)ah<Řǘ阙ٚ]Y9YK Lq P )HS0$jzWڙɣuGa - }2z)eW gʨ*ZY )\J)gʢj: }P*'Z騪psHWʞZɩx:8[**Jz٭ފgs^^*$ Zٺj ~ ykӓ ;nZ)۱y8:<{ г?A۳D[F{F + kJR;+TK+j7@KC;`[f{ !ky~O[ʵ*Zʯy~t+;{+ .z)|t.{~;~k[K"+ ;۲۹ kěۺ묻k|k+)7{]Ɋk皬ʻ˼-@ jŇ⻿h~˿;[˾k`Zbj|N 䛾K{G`#L|  L(%*J̵\8,}L ,'̸# ND!I9Q"\tCEk^:{K<|:KS{jVX,!lZʼn*/ g<Ƃ<Ή+$<[%#۴}-Z5Z@y&8ԓgѥ ύїӭNqLݽ [~ùz˘޻~}8<^hmmM~BM#> "*~,=0KFz Iz--:.Jo }}l\z]Q>SM,)\^E.=m߅>y'vMnݍ~xny%"2mce~ޜq=.nn>ګ'禽u~y{!i x_ѮܞKk~~逭|]κ^ɢ|lΠbӾ{iio E}-龾.?I)#Nڮ߾~B >lľ/ϗmnz~޻ێ^nϝ~NЍ\^`d_fhj+\ nI&~sOv v4цbocٵCJ,j$xVl0 6p-CPu D5jRT6_Nu*SjT^!,f!Nvjf ԧRQYSE t|k?Ϲbּk-WN(z0j`ASSd5Zg@"5e]!YN6U3PX4$-gV3*⠚jYQsƇp5]%,J;Qh[0Gٺs7c{]v9qeuㅿ]7Ic\(@5Fz՛^׽o|;_׾-bMf>eJ\멎 /w1YM0{X\u d5ymx'Fq[İjǴ|8 ]©|LZ^wq\xUMpN`ق.)c6`Q3WX;c}ڪ<ӟu 8*sYj^v/ dUn^Չ xC=lbb}MOCJշn5L$6Z=^s LVCZק08Fw uw]wv72]V=-v"M5Q?+9vR\6J`ts=zЅ>t/vTE.l]p<*0 y=Nկ)I{=E/Ѿv]Gx&hQ'^1kI&rt#w,qAnϜjw|%s'݈E'vJVzVS8o|]aTR^{}a+=qy >uh*B?lKk4G?#ik ::@ T?cPd[ 0G,"A-TD_\ 7 E G@47;TtqFFLķ,SG0wlHrHH^H_YZ@+=NjE}$ȸkSvAzy$ŖKC=rUɏ(CKH<$$yJ@,?Ӯ>|.r0c伍H\DDȜJɞ9X4ǂ$|#4}38ZK1">`_5?`GTEodq$I'DLUȌL9`K;w,JS4Kb5V{MdM)MS$FF HGr K˄B̟3:DHVœ$jJc4ΔÓ,SDƄG*@cκB8Y=΃CijJJD<M$\l #=a=Kk M5@"?UWuE)S*Jx%jkQj1WԤ=XAW$ ZSs]٭ڮگuY$-dbǸ\ɗĘGe#U5ѡ[ttK 2=WQGU[Q֬ǹ崻U=MI϶][%\-ө56=U U}˵\ɭՕI]<&;/<ٝ][4U]erM3%^[w]]ib-p罂ޡ3^0(PZ-[Kw&&& 'M%ŽlDmvCAҾ۴ =4]_`L|OH>Pz5]V&NN^J -ҽ<}ZTXr]ڽ1$LTw``=5$/1E Dԥ0ӞJ-ܰ\y¼8=M.,a 4Tt`V56 Na?kEݑ #ؔ."ZxAPr%yfi]$vh domgMS6eY~b=6iS.hz荖|1t!NhCKSN<>h?#i|>^È>ϣӰ>٢^@0ҩ\fc nic$iqh%#L9^He6k8;2;MJM4PlVbN"k[U=NmldWa.~!׆mgaf~ avJٻmnmn@J*oᭃNbٶ`NrIvl3nd{Vo} /ڶoo>pDwm`ofo4"o6W= oO&qvcLeaG/ %Kcq5xb˖ )jUhr1rjr,/G0s# s&X'_f8$Ln"q p"$WPׅwsڍTe9b2gFwGHw^[}xp8tW=&Q7RGSWTgUwVWXYZ[\]^_`'[6&oL]q XqrjklK]f'tp. NaWbguwvwbgz{|}~2\TvwBgl&h6yxoRov`4wy7Xɂ y{7n5yeo8ogzzop/S(zqABo7[xWgW]^zzz7o:;B?s/"{ʟWW1VqC}xo3WɿFgg`͇w!}w眦 ,{2o7חW~ƬMoB-[}f 4mowe7H?qHq|ZqԿ=i$jcjizyY'+ۺ/)7 Q(0H29$'@&ą"ֺ7 9^;?` aa HL$ee ͍@Q΍P @CjԔU[ެl-m.n//0p00-ᢣe3hMfΎ@(i))ա9z:{;|<}=_rc>d4 N'2yJj7 m+{'Rh"ƌ7bپ"G:ALز!`j Ri&Μ:w'РB-j(ҤJ2m6j5F@M;dY⥷&fj,ڴjײm-\>z.&qXcNfĊ3n1TΝ(/fYZ+آ G#l4ԪWgeg_ݫO/0‡/n8ʗ3o9ҧSn:ڷs_Π;R/./rVMYlZ=ӯo>onjyFc[5K 8 J8!Zx!j!z!!8"%xb⅖h \ "=#A 9$E&RMJI$͂(q%Yj%]z%a9&ey&i&m&q٦lN)I6$쵀d :(z血"Tw:Œ(q 袙j)z$N裥 n|` *+J+ZB$ ~5'{,*,:+Ei ֺ-I-B~)ke[b[nn/0xت K<1[|1j< |2m&2m O*1\3O7|4|Yo; =39}tH+9lQKUWi5֗| 5:6c-tӞy6,ݶo-&=7ʝ7{=r Λ~8+8;8K>S~9k9KX9衋>:[) p:뭻^>;<~;^>;><|+CWc{wO~Cß}_e,`>v2| #( R 3 " C(.0$ QNBt)OyTrX KͲ-SKOۀY6a3,fUL].t& ͻHs|5lޒܦ7+pj9et\;GsK=O's Є AЂlt7U#_U9MCn9\kj}wҿ}~ϫV~l/>&8 6F VXJvȡ$h'X"+xb0b,h48\!7$"-hHdOQB9eWRs,%U_~ h p)tixm矀zb\{(袌6| 餔hgbmv駚z**:꩛ꩨ 鬪ڪڪ*a b8e2^in*f{m`*ꝒV*c.벋!*oknYx"vOzn i0Ch pWw\Ȯgl)r(34S f/-s=$ h"@pt[!dX/l"L  ]B"&8^DqM!H֋"ⰋCF)~o XFq|c ?:ffcE цc"䈽*1FEEBd 'IC:2v,%HNѐDc xO#5"?"IF8"񐱴.;Q+9LpwIf{+1HF~Ϛ,,5Yj K%>󀢬")LWf-x,>B|`t%@dG'l'[KUpl* q^;kZ4 @C<p ݦ3 Qwg͎곞iFhJr~B#LjN,U'/zTJrT1OW6՜&\)ozUc=KddYaZSm-`P3Tul(RHvhKOvf,O#lj2WN lR PS)S-2T54[Kv^<\}?#%U7zz .W͕mu'h܃j* xGu-z֣z ]"wͯ~+]Pw!X_wN[=wWxΰw q+ 8=a|xŪ}0gÒ^4-w̿!1?{2OJflcbiQ<=}7Y޲|7^a|6ߵ i^`p靳 c3[4qud7˘y^YQ}ȴ7iNӠGMRԨNWVհ4Pm̏*=Sl%YX`]fwlFGfhh|vېxs ƨ2Q_YLO7"꘶t=P~6 x7T.ooR7om@G n۹]_GWԩ"p#.̼:֦(v=mYFsnŹe7Y VHe?<*O_:|RS(5ߪsJ6lυib5ueq6N td}t}UcS{G{!tEX^syYgΠo|0$AoߓW7uU*xZGu'm%8{zR؂UXQZ%?0H> 6@`> wluqZ'}hzWpGq|'q|h=[8>2Hj8@=8i?>]hl>8H?=ysÊXƆlmv8=h>Havhx>x@և(ՌC3}q+Ћ#䇾&Bc?(h>EiAo4V~ 8P3hcܦf7[,gX}ΘquqK5Np5K%l{F`9/b:pfy%v)T4[RWv,}ZJ5}WTaHB$FǑXhQqHY2Xdt]Cw}x#Per0|wڰ6aw4(&m7qteM%StzP_G'pQ8y9yAw7By=vŖthMS&}ǑaXYrIp Ys 1p㓘H({W LeL/yZvazl|Gd)G_Rkn _uvZ9gԙ~8TÚ6Q`(gsGw)O OuW)h}'`Ww)ȀjYNJٜHf Y1}.OGؑŝXU8r)o0Q z% 9t[瑸)o>FB#ԱJN؟BʏE}َN4eVʉM um ]aKvk)Zs haZ"oUd*THv:Zz6 kpdK zAN:Ps**}j_fک|ĩhJ`j`{֪"*iZ?⨹*hYYk *f*f*3֬Ud꬘c6ުe@ ZXFcɮ vܚ<&DFᚥ:dZfvcC_ 7 a q' KdRf a{v3Q-$%ڢ,&-ϲ%, "#"-ZB{R<ϳ<:+3)<;]<#$*K[*)M˴O{+Q S++UKW*Y#]۵Z[W!f3j۶.n)r[`xyH@|K~;[6P{۸ ;[v+n۶[f{k!Һ  2k {ۻ;Qț뱼̫[q؋ڻѽ 1{蛾껾۾;[{8 v %1PbRa L"LדL (r<x`wP),w`ia(±4 g9aY P~ ;Blg?  \~@~YL&3 Ii^ vd0\7!<!\0|d|=([ ~LL7 lr os^;F|N\!1:LYq~`|G|@\ŀMƉʟl Ml` !n tܗ(J8PlBw~\;m [l]ͫXOyLN|փ~|Γ\ƽ8I:(" )[ /V":6~>@B>D ;aplus-fsf-4.22/src/html/password.gif0000444000265000001440000000601407215453040013101 GIF87apLLLjjj,0I8ͻ`(dihlp,tmx|pH,Ȥrl:ШtJZجvzx|+g@f|)+Ův}wt|x~Zm IdyjcelvǜĂң~dg܏߸b}˱p虳lAp5֯C*Æn]L G Il8;i,݂\$sɳϟ@ Jѣ*]J'ӧPEJUӪXv)\KٳM¢]ֆڶpx+]t݋!/߿ LˆN̸Ɛ>Lʘ^Π~MZҨ{Nͺiךaˆzmio붺wܾN<'ȿORCE:Lc~D;BC<8̣_?C=.ßB>$A?hh `@ 6؞Ґ`NH!^_a}"|"^&b"x.]2bGc݈#t:\>&d IpF[Jd= YPVfYj%WdehXVfIrVIwʙ'{IGt Z ʦu"zVh闓nYi}gv駟 ꨤJꩨꪬrjjJj뭸zꫴZ+k&k+! fjm~+.ڒk[b*ۮ+okofʩVJ0 _+Lo-1~\j»q")ڲ%ܩ< ی;pЬ l>kr.MtNqKXO}1M#@֩ *АΜ4U_j shKvsTuGu'j&<,KNmӭ2~xn]SE^t֕{z9ܙ3j^[pچoΣqw־CnGrs 4q#nm3+}?ДG*J3p6ٳWY{]}zrt.Nz =y0In} p8YxUZ7- N{{@o%/yAm|z^(?6' C%@kExu)`AO[>7)Ǝ̋jE/NraXFUu,1Fq)XG~lYGԊWHt_W$Q ժd%puZd$G%KL*WV򕰌,gIZrdn^ rX SH2f:Ќ4Ij:ScJx 8IrL:ljR5Iz,09'Fxrs @JPq`i)O0eIL,4$1rT HGJҒ8hE`x&30,'9j%FGҏ@ PMҚ^KeԦ+eJRю?V*ԢF -UCJV4?ujUfu\\KZTԟ (*9RT.'TiQ᧩+HW.\';Yj^ٽ&6 hyVwZ|j2kj;*Yږu5]wXַFA;MTU.6EeU9VuͮV-\fp]w6Q^}-m[bWEAPlV=pzZ Xmb\ l{x,Gʳ>gU0AMj}np1LkĦx?lǫLn 溷nۚ&;y5;d5~wu0 PS{dWhnnիFF53\`!CS%s<4yTN${- 8oYt6 }_*ͅ}\; e'Mj"ʘ{iNvѹSo9RZks:k[Ձ4ZCS'k.+7bNvcfЎS6Z[4>Mzηoz9MN2;c~[ϸULUx#?mqOowS"Dӯ?׿{7Rah} uW !x!X!!#(% ') +X|qт"+@"6xpƒ&/la#f00XNȁBTXPxiaZkK%Ѕd(RсaI*j8цpHk(ox{؆p%0 @(~ n䉳 -qG q~Q 8 ؊H 񋍘z}x PH Hш h8ؘ(1A6Q~荌pÈxȌ hՑ臁q'n h(1ᨍ+ዌ)A~(9pܐ*,ْ.02 ;aplus-fsf-4.22/src/html/pixel.gif0000444000265000001440000000006107215453040012354 GIF89a!,T;aplus-fsf-4.22/src/html/radio.gif0000444000265000001440000000665507215453040012350 GIF87a pjjj, 0I8ͻ`(dihlp,tmx|R(O\6 pJZXYtwٴznf<+{OtxvrOQ>RH_GFe^zMpRwnrwzhvdCHϷŽ2ñˈгu#cgxJ'eMԱ#+5J9Qe cǎ$;Gē(S\ɲ˗0cʜIMnɓPΞ@ 6Q*]'ӧP%J5Vjm4uׯ}KJײhgʝۂ-ݻxA˷/!w+pa%]Ď#e,2ZȖ3osVΞCC,QЦS %5R֮cτ-KԶs7(!N<ȯ OH`~MY$;& 2BdSRY_J^!OryG:?.eeKBX)g_gףQ.cW&u&m2`%Hgh9狒y*6()馨Z:cuzg" N}(j쒽&MI}),6[ۨR."lXm駊fݾ*okk߾q[/谇G1(N0êU'w ,$lralڋ'0ʢ8l24Ʋ'sg6=J7њtBO=P[WuOg_w]@9c-vd[\5f 50cR|t߬ݢ^x|os޲݄'"7⎟E3CVF7.VPF;ic,ǖՑ7H`q, z y>C@AK%MvK!(=EDcě(EfI PnLJiKA䅔.0Ȑ4df4!),ɐ1/{GL,"cc(KBR f>7T.뱑l0C@+ӡGzҞ&IQq,N@v%Oѡ(㎷Җ~? m蒓);C*cP1ձ}i"Q5uBM"!`Qc9uGMD]:?CЀiF6ӏtBJPD,*XGYԥc=\L, ʫ^:LƂ웋 KK3IbK@ǂ.dG~>Uq/UveImrϲe ^@׵v]-ln1jf(f*-r[,nɄvZP,v pVzW*lɮx׷&#@x;߁软9qq6h|z \8xYpD_mn5 +q0N1 V1agb;Bq%UlX~Zvת?)ʮs[n8%Sp_%@~[5YTc V:ٯQfqpf,s+DnOd*о\6lrc,3>٨Tϋ܁\h:E4><HJ[:Nj{3)6x3 PR'PM"c *RM}Vn/BG.(aeKK,RTkhbY;M6N{-{]$N|GRX~HF]||G~)JMOoC?S~pK-fU=J9 DŽEL}LlrK7qD|iXM7L'h# Z~QLDIIӀ Dq7YwqOe>;!jVvS"HR4IXP8ZԄ#IաXe8Zo|>2kF$HW SL e U.8WsM/v8XYYnhwhZuNhЁRQFU:Չ7%@>5fhUZ#Y5V|cuUH"qUl؋D8UƐ<5E `J|Z~Յ؊CD(W\`-uȈF WV0[倽\XgTx9؇3FNQ (8evdWX}]k8|H[}Ph1KK1F0aV iDxS92+7hٔs)`L9](1`&^&/qwtpg`ty`1p"NN6z֗1چy9 OIEU::ٚ:NpKIၐ؉gvu!3YyșB:DZFz-;aplus-fsf-4.22/src/html/refman.html0000444000265000001440000000053510755044742012720 A+ Reference Manual aplus-fsf-4.22/src/html/scalar.gif0000444000265000001440000000617707215453040012516 GIF87apjjj,0I8ͻ`(dihl0Xt=7 pH,do+8 SSvzKVL:n8 ##/[t6V45kczO=@]tUzuPyihNd|&i6TVļöjUwªžɦY_㯤뒆[_m*\BێTz"&35/ CIɓ(S\RK0cr͛8ɳg> jѣH$]t)ЦP|*UTjJ/+ׯ`y KLfӪ=@cʝݻ:+$.߿5 LÈg1_Ǝ#ۅ,[ʖ3ŬWΞC[-tSҦSEuP֮c-LڶsĭwI-BƓC3Σۂ.'ֳ ®{û/=OƟ_=*_B?2(Oh` 6 B(V:anbX@N$b3nX.x9;X'H ɣH6d TViVf\v`)d%fl&dix橧3矀nYgM9 h裍FꨤBZ饖BvڨN騡z(2s>>ɫNl7+#cVf-\rۭN9(jkRmYn+nFk￉+k"ki+%/l^qUr\q4jlr 7^J/~tR鲖+/%D <4.}s,|Ngsau@<4ִF)uFj'6Ϊs\\VzD%HWYx/@[_$wǯ2 nG/Gt鬷n֞ΰa-k G:+S|3S{_v /o觯/ovNj HL:'HA @pܛ*z GHB@6X>}. C}3_ q/6 }!1}F$o'L Ǿ;a&1]_w/ ``4c+|[xE"Q|P*`|wD"H@;!B22EE\d CF>1#gELҒd*٨II&rl%+>&ҎL$-(Gғ#= |t&2tbQ,qj:SC*Da((c{3_2S򛯜>JFSܥ2)"v/YrT<0UXL锢^ U15$3(RlZ, Ҧt|Aȧ~t}M'=Qh<ѭTUϓҭFUjVwK!ZW22+7VVe}+ Js”}l!ԅN "NIźOˠQ62WNUUd)ǎMmjSzΝ=-PK83@T-RgetWK3V]GW輮0+ ~]UTMkuիRS}M]{\Ǽ2 #qvF]U֯9sX]X#x?IJM_a;[wŞ⋳^d=_YKH֪.&;y|\KJ-Ų%3y`Nd 9FFϻfpiqS?9ws\᫞,~yT~/'l<->$E~q<3w]hi[`J'/cÐzx @7O?g?3^? t;'o]x9Wp0 0OwQ@}Pr{&( }ܷ {Px` "8g琂p@1=XQ(}W~ 0pD(F* _hЁG f:Pq؅J/8%gSȇzKWx ,68 E}xA} `H|x xpaЀW7{Q X؆@H:~H>8Ҹ8Xx|Gv"'~ȅOHsyEA~{(h8R@w3R؄'cя|ʨQ!|7*y~W0p5YXГ-w鰈isGJLوgHA{y !bȖVٖIhhz|ٗ~I ;aplus-fsf-4.22/src/html/slot1.gif0000444000265000001440000001134207215453040012301 GIF87a|pLLLjjj,|I8ͻ`(dihlp,tmx|pH,Ȥrl:ШtJZجvzxL.tn&EV('uhpz~Gqa#A$sV}B)Moxmο͒ƨ~nܟr{ዚ7=a~תxFo+f qN3ebv(%,|eW#Z„#S,4fT1lce۶&O&ʣp!۸eAmڈL1wWgd֑|œMӨS^ͺװc);ʵڸYΝ)߫wzyg0N]4+cN:wUſO}|+2}}3ϟ'.9t߁ 6K rkf&$i# ' 0ѢR/h3>T<ێ=yFI(h$LMFfA),$\_ b hkYe)gn։xiafɧ{vy#s '`©v2&rJJTJ饛jh*ꨤ g꫰*무 hZ+'g⚫kKk jpFV -Zv+nrknzr +ک )Kbޫ|z*^;ʲ qWlk:s,*ܱ~ 㰘pai' s̾Z͢pJS/|M4)TէqGϬ4/FsHqEʳrN:A2תi9W/7W `Sl+[6O /'fo5_T3wceF2f@#ײmW@sΪ稪 nA"TyIeZXE]Kn17qӦG={.uuDQ6aI3%ʪ/z+7/z&^wE=66t1xdzPW:*uXZe/hX=hen@` CdA4W5[›aYxV*σH"eDhBخpp;&?X*6վ!J`62b90Fd(Gq!|9e\G: Nl@yFF6mTDp.&ҁ$IJөT[&;A!$qAYœ "RtT_'MJ1+"WnNtj:P=YQ{"Zb85aMWf!c9hэ]OtI& @JЂ MBІ:Dx^1lTOgH Б(MJO:="1}!^hſZDKӞ@%81WҘ<ֱgiPөZXMiK떡_ HŚղ @tcg<" Cdk^W[ zh,+5V C!ʦ>UkaKP3;^'[؁b6eWKUՎ42Og9YM~|NzZkEYf'nڙrM5 9+uD+5ߝlx[3cPWE/B!KY}p Tv9Fi>E-13KH 5.oު旤|jشpE㷼/?| WY]`T!{<`[uP hWcgXK0;eO>AILa`>!_=`i=uOМ?Ȁ=c FgW]soY\5蟿lFh]"u#ufgȘ6wi1[W?3">;VdLΫ}ceX׭&6kP$o=O|Vm"Ñ!ϩv1:k`zʬv iBѲsaL3De J?wܧ*"[T|j&M0WNh}_VEZfV8Hۃ _eY^8=h{dbj3W.k' MmǼĎ%t?:?" s3`[oK ί{룻ލv[mw@S;zpOx {y؃<|W+^ Y x{+-ACn^WAAݬ_߃߁|w{V@uNg`OQ)ݑ@B8DXFxHB@ !/}-B'BrLzJ؅^`bx*h8]w #Xo#Ru]0TkvXqy|؇~8eONh5P P҆59Hz臹Ƈ0Gw~(f}i<ˆ5 8whPGՊ8XHf4b"Gfb{_hfe8(g؂~렊(h5긎{8GqsK0H?.OrxRͨeGvth}(px{XX᧍1Rҏ~tbdxv]h 9莹(H99*’hkZ&saƑ iY%F> .L/xbxt}h8yH8?A>0$CzqHIZHuMrOSitUWIwty]A0Icy${7W7gږt6YPmsY&ɕĦFIqU@~rjwrw O7#q}SRebGtdx v CIib~Kɏ喻Pw 0֩؄'Yٚ`)m"9xf9Yow9Y{ٞY[9yHu8)G|yYi*sy{:Yz9TV89 Jʡ𠒧2:4Z6z8:<ڣ>7ʄs(86eY@ڤNPRڣLHaiKE*A%u^`b:dZɲJd}gȋj:Z{|ڧ~:ZzOuj]lg)yz*OswzC:qzUZyyVŪMY% % tCtZ:f S E !in*etSJuSPJZڊ#wFͪq(pjhQZٺHݚdkIt%Lw#u*Ek^t"h R!KZvBbr<G+銬&{7@a-dOjz>5:; qwh/ktYŴuQ2)rN]VKXp+fʵ? `(h"hV'Њ+A嵷:c+agreԷFWk{^i4B$v+d*Fk2iw;S& k"J؂=*}}j4:،KrL./"٩dBآٙ"٦}ڨڪڬڮL;aplus-fsf-4.22/src/html/slot2.gif0000444000265000001440000000555107215453040012307 GIF87aDpLLLjjj,DI8ͻ`(dihlp,tmx|pH6d1\^:B7+L+,/H\Kf29i=&#v{MV}#v~Tbk}tLy~wu]FS{PijyuU^WYm…R͒ȥ߲ܽgv|ıϬnIOZeY,SzOC}ͻ۽s,*s׳G##X2%?DF3X i 3ʺx>AnI/]tN04IJATjʵׯ`ÊKٳhӪ]˶۷pʝKݻx˷߿ @Æ#^XcƐ GXreʌ/kyΝ=0zri͢S|:֗agxfڈmS7gߵq[8i-_μKNسkνkaū_ϾoOzH X\g`- FRXbjhqWbq''\(G,8bay<#}!.GuGL6dA57Xf Y_qi{&zڑT*gkvya ]-QډpZ'bBfeY(s`:㧀'ꔘ袥rVRiz(yj*] ☍a֙$>\J*kj:(gJ~gتjk>kikvɧ lHƫ!Kl(Bz#9?y暳Ggգww馟yp-ބވ=ͷn^܊;ݗ{\.j.=5. Gs'o>î}Gz3?,@۝|׋漭N| ; :.|۠w@p` pP}=޵O'K W>9W<6Ј.dCUp94GBV"T /+n*tYĮl\O3f1d$FqxcXF a4qӣ9>f1p aGuT'3ݰ4ґE4byWCQJ{bhTpyTvt`zP&mll4FiM6Im8s8NaDZ5I5p9\'ϳճ h)Ђ4iSr3C Җ0LgJӚڔ*vӞ@ PJԢ@ҕxBj*%Rrڵ(R5( c).dbdܴ֫yՀ`YΩn+ڽ VtFyz3cӽyV6ŬTR5[JqBv'eSgYnQclcYo[kW9 Oím\\n@er֚_>҅ƕU\W'Ν$Yٽ麱6;ѧ=ЊlaxIVzm m!1}>fwJ"~w8kLRx|t:B,dMEqL0lH^ oV0%_w,mZV6.~/d\gXnmgumhUEF϶g!@ש!6 9DJNp'š֎$i5_G9+x{&% ڗ|% AϘƊ54eLgy&X9`M;Ӯ;Z Њz rccxQsoCT%LGbYgG{ͼ,fmNڷv߼m[mImuN|cwn;lYqoTRZϸ7{v֒(OW0G';8Ϲ?.r @ЇNtھH;P͙bQvXCԮ{`N=3,axpS<yM,v}\p%0{_^N{YƟg^EoYBg\ͮÁ*W~2u=F|:/~bvudfwp~g'k*PӵWGW{x`gRnt_vG:}Ӟ9{k37~ Jt:y8{Ig?gg|!I _6z${}"DxmEN4uʳhԂ$f3gGZ'WuwW}v;ȃX*fV@((HHyDhueMqwyKEZ\؅^`rWuaxhjlr)xwh4r78v:pIwׄ #2"0")#Ha-R"'" #18{RRs(2),C/.#2-22؊1Xx8;aplus-fsf-4.22/src/html/slot3.gif0000444000265000001440000000551007215453040012303 GIF87adpLLLjjj,dI8ͻ`(dihlp,tmx|pH,Ȥrl:ШtJZlJޮvƭ}Zoη OB{ [~'$rzrg)9&w!*^~i}#w|eqa‹tm`жƒ(֝pɿǣo΁s籽ߑ҇+k&"1n<˵8m@LpQh0y OYܸobʜӈD;!X"brlRUJ0;xOdT4bNNlRUSo(! :򹐖:[͂|2XX1,S>$wK"EKeMo`5dml<˄EMolt 4h5ͺuuCTMf"kͻ Nȓ+_μУKNسkνËOP~ǟzן{ X )(o 7~aj!~܁(0(4h8<(dDiH&$.((eTNiWfY\p饖.%bIfJ&XYbfy} &g{'ib!b \86䤔Vj)H䏜*j)J:Fh7ꬴz0⚫ɤZB,+**yZk#.IA*+乯 ᒪ:{+d[${j-k0 l,kx'Z;Jk2$56<{2"+[3 qǘ+lL7/uz):wHCuX-pͿbZ+]qyyo=`-V%_=Q]QS7G.Wngw3hn騧ꬷn9nS-/<^:t83?;ş"O=yb}KO9WGO|82q L"@ ft^%ȿ=wKϏg}`!04 ؿ]ˡbp! '/ cX$pL!86PRghBz1MOB3bz9%1yV|#)F.1yC5$WFڜщ[B'9ZҎs,e!0q;4+J Ҍ_(ICf2~"*uiC2,gN擫%kYL.b/<4 [z2mL*gH6vύ'9lQ%6GIrl*x@~r 5A:␚D'PcW H]9T+JUJOz5QZLEҒ:NWӑ51ݩPѝ9R:<}wԧ&uXjj`\Uzհ{ֶqc%@׺xͫ^׾ `VqUD@:d'KZb "\PIbt`jWza-g+5utj]Qַl'wU-M[|֢tSg֓;;p-tK;MkH8N %&Z׼Eoz%W[56J p K_Wůy}>G}Y`O v\_-ĩ&. tAb=x^fIN36LX %f=9_@nsc<9ŵmbi8N}*[95&I(*Lu_2SEsenyp^C;'è3%y9 %6撩XEU{h6z}&񟣛Q q}MZNwNڥո5bmP#yԶg^wPj3nby6^ڻf[ƞ-l γ{kHְMvMov{ۮB[~r:M;n\͈[}H/:x GN(OG.5{gN!/@2άsx I:g)O-n@SVu O&g$TG{YnzV qZ\׽>Mp2s)UÏnڛ߮7Kun(=l7eLfƽ>*PMc\gg?I .;]L5'I!v۰yy|bb߾㺟IPN)ͿOKLW~7QcFuigGBuus|G|V>(CZR2'chVGÁ{#H&02t:<؃>@B8DX=T7:9hNPRȃwkKS{Pp{ZSU`XÅO1(†'moX(#2~$kM3@3;‡z6(&sa8}È%8UB'؉h;aplus-fsf-4.22/src/html/style.css0000444000265000001440000000504607226575752012447 <-- DIV.std {color: orange } a,blockquote,body,br,button,caption,center,code,col,dd,del,div,dl,dt,em,embed,form,frame,frameset,h1,h2,h3,head,hr,html,iframe,img,input,ins,kbd,label,layer,legend,li,link,map,marquee,meta,nobr,noframes,noscript,object,ol,optgroup,option,p,pre,q,s,samp,script,select,small,span,strike,strong,style,sub,sup,table,tbody,td,th,textarea,tfoot,thead,title,tr,tt,u,ul,wbr {font-family: sans-serif } body {font-size: 12pt; font-family: sans-serif } center.bullet {font-size: 24pt; font-family: "Kapl"; color: red } font.Courier {font-size: 12pt; font-family: "courier", "monospace" } font.pt6 {font-size: 6pt; font-family: sans-serif } font.pt7 {font-size: 7pt; font-family: sans-serif } font.pt8 {font-size: 8pt; font-family: sans-serif } font.pt10 {font-size: 10pt; font-family: sans-serif } font.pt11 {font-size: 11pt; font-family: sans-serif } font.pt12 {font-size: 12pt; font-family: sans-serif } font.pt14 {font-size: 14pt; font-family: sans-serif } font.pt18 {font-size: 18pt; font-family: sans-serif } font.pt24 {font-size: 24pt; font-family: sans-serif } font.NewsHL {font-size: 18pt; font-weight: bold; font-style: italic; color: red; font-family: sans-serif } b {font-weight: bold} h1xx {font-size: 18pt; font-weight: bold; font-family: sans-serif; color: #ffffc6; line-height: 200% } h1 {font-size: 18pt; font-weight: bold; font-family: sans-serif; color: #ffefcf } h2 {font-size: 14pt; font-weight: bold; font-family: sans-serif; color: white } h3 {font-size: 14pt; font-weight: bold; font-family: sans-serif; color: red } tablexx {font-size: 12pt; font-weight: normal; font-family: sans-serif } td.left {font-size: 12pt; font-family: sans-serif; color: white; text-align: right; vertical-align: top; width: 200 } td.leftclick {font-size: 12pt; font-family: sans-serif; text-align: right; vertical-align: top; width: 200 } td.right {font-size: 12pt; font-family: sans-serif; color: black; text-align: left; width: 415 } td.date {font-size: 12pt; font-family: sans-serif; color: black; text-align: right; vertical-align: top; width: 200 } td.NewsHL {font-size: 12pt; font-family: sans-serif; color: red; text-align: left; width: 415 } tr {font-size: 12pt; font-family: sans-serif; text-align: left } li.a {list-style: disk; margin: 0 1 0 0; text-indent: -24pt } li.b {list-style: circle; text-align: left; margin: 0 1 0 0; text-indent: 0pt } --> aplus-fsf-4.22/src/html/table.gif0000444000265000001440000001532007215453040012326 GIF87apjjj,0I8ͻ`(dihlp,tm߭ nH,-# BzS,`hݮuL.-H,IOyBG|Ovozy^w| aPmk{AbIYR<[XxT=hT z;pxO`*qʚrϦӨi$j|>\pԉKĊ=&=j '0:H p) `6#ZX1O;2 wBf%crFxq?{~,Φ!NF֟IÞ}5زoz7޾?;7qcN氙C_.}h뷟c]}`}/<L5W>~~g_F>GnW_Ux.h`/@Hy ^ЄJa("P#^a~b'h.0h(8jX#<(Dx䒙$4ܓP dtWV)QYRu%hؙhՔj$)q'_i|Id槄?e4}(pUț, h|_E"ꨢJꩥ*ꫫ*j@+k;**"2;W#hb+j۫-r+  ,;%7|!,0l' {kG,@gJlO߬Ti6 (|*.,sK|9)5U3*tD =E'mL#CC-u#mWg\<Rw]vcs6ڣ] S/c쮼wӚwK:xۺ~ރ{70-J/F7p3w9֟s褗n/1 RTGGQnƺ˛C\suUVh0GNێ+" sw.~{,Яo)O["1 4-0 6 a\~C+.;a  P qG“3 ćC /;s>F #W{xs!ۖ4p3C,BpA †~^,bƞ6Z1|S!c@Pun+lHӟ(=H-hEԦ:ե-2%5aiVX$>`ŨLJֲu9_]J$<,xX׾4zWJX.5MlaU=^:Z6R:v> mR#UVmNv4 \K[ղ(ic -pQFh< r*:=nQֵֶqY)Eɕ`]nt[8 7p^Hd5BHU0ޘWmLȿ7 6owX$"Hp%0g3z5.A&gL 17a[ŪY-Dأ-,〭$ю3Wr.1L54ݫdP~iLg![)5 RT-s_71M\BO9Teҗ#klSB9\S1cE[ԨNWV`gMZָεw^׮.DE zlymvXjU%}Mz-Llp'8nCnڝ%wG=QzGTބvp;&b% }/tŎ=T hq&Fo6(+}q_,*kڌé+ܱ-V…'Z]MBei]ls3Jyz6}:sO[߹稡;֕/ Nt[ ;ܭw1G^]+_Zqv޼G3Oz]t7kO[Rx Hh(*~;{yWZ9ڋ~ʌ KyVPڭ7yV۬ )l`xgvZS ,pHX'y K_u@uIK䙵)KFAA?JIkXڴ] ie:%\tkv᧵yճj Q븆{u۱N%kVRؑkul˴{[X/Jȅה6WQ;y\ z۹*⇀WK!뼉X{gQu۾ SɛСRV{z)v7ȨhJ {{gk{Pyڷ \|%_\[ " ۫_&\< '#),  SR$,4*H4un܌FTIAPش( P ̌]砝̢+h8٠m+ 廊ԡ]ҙإ~ާ͠{g=5 [UKP>~G;RW?(k.MH5Ѳ~Qh[Z8~a-פl뜾hJb٭>QsގޥV~Eܮ0h|dSMj蝾ޢP癩^ H !Л .h{ݴ2?̍mw!o,n_cȷMneUwG.=~ҽPo9L>e~Xlg-Tn~BfYhjήR>h߈l6Ok_m)] t‘_K ~4 K+XoGpOul;OgDNulcOy_JMz0j0Ik,d~y`hh*XQp, D6A|pH,Ȥ2IcIdZ,=[*.%|^-,k6)rKHm twP6$dqsj^T!^g y.|}6NMMY_V#v"ɩі̑{0~;m['sœVbl%dx91R&"53j0 \܀ 5(qg)c3ݽuo(gbɴ7]O^d@rU*DV[cr}8kXDy}4۶N5rWW5VYAծ9PsvL+:Jlj*餔 z`zv)ɚK^cw@(I"+sj뭸뮼zjlJ6F+Vhñ2+npuk82Wݹ.[Or뒽{l+0"Cl*9Df-K:Sɻ%$w2.d9yҐiJyqf-s幛lJP:sV&W>1=*Pfu(?]BͪRLGc}k"PVW߸}o^v+^̸ǐ#KL˘3YΗs .̢O>z5jװ|=5Ef>m{oNxq⽏6wuC|d֕?Ϟ;ۿ.{ɣ~}&׷>}K_< 8&8 >(VaIqXxh"#>,Ԣ\)(c(㍟wߊ8? DK6NFɤTBiWfY%[jye`>e\fidfcZYc"!'wJI'y⹧盁fƠb"*hQi@ZYi&ii>:hNinƢL 무j뭸뮺+zD&:%>Vk2kg+nkNnnkkg+0 0{ K7lpR|K,/kn/-*򨥚,J8}|/wʌ͡ΌsyfF;DӪmH+mL7,B5ɇ>+uW;Bo5K-F垛fGtrMvְ7`wz-q׽tgڵ*m/n9-u{[sNZ]5麊g39ᘳϔgoݯnk'/"<+ZCس[ク_izݫ/?Ym|K?KUn{;zWɝ/w\Zpy_tZ,0(4WG>-U/LF(~/vFuEE\5P[:QVg4Fy,j#(G5udc=ʱ^LJH-[H"F:򑐌$'IJZ$%Nz (GIR4]ߞ򕰌,gIZ̥.w^2F0IbL2LW HtZIjZ̦6nz 8IrL:vuwk[ϴN gE"H򕮀%W RN55Z%iWbT]KYH+Y^5}l#'s< \MZTHlVIڊjAVk~xdi^Sa\LbKGօv+M {vܰ.*ݮcI\M|jVotc߾ (o~m[|v֮^; u[d { g ͫ\(NcR0톩(R8.3+U@f댁ZfHN&;PebjFXβ.{˯$Ԉ2ȮA]*D7e3w I9sg>~빢3Qz7 8 k<[e[i9zt5Q4>=[5͑m4љ3|+YI,MPZ̢44cC¾ [;wZ gXކokIc[$\-jV=J"f-jߠ|0o]*vw+ImDȪ~voNn}ﺻ&:t1}`[{,5't?Xom`ݻzLu9]q*Wso-sE>{U;c^ ]p=ZXJOjxbY;GrO[{N|e%o[n8i=ѓwM/`^[]_֓>xS/P—Vϣ^ׯ{叞`zwˎkȫǿgmgugZgKll7tz{~~hGwzwztiGkh(8~6ey wtWXxgmzWzt~(s{ww7qǁ~v@v/yQ'Z18n(7P6xgtVv\`{on|MńTOF~,hor|qphHv ׇHkkq.W}(~{mqdc;wVefhZĄ4cVf(IH8he-qxTXԊvfeh¸HHxyj'ȃ8Hy(XsB×'6ؕwr8h8hxbA،;16Ha.؎ɐH>g@8yb)oHf!x')i .0 b*Ya%ƌ;ɓ2i49,XEc=?AHOirYhؔY)Qa G)"ii*8@Vch9jٕ(~Ix݈oc_XueU՗OPcIX2HYI{oxXrii;5Js@xRi'ex- IwG冢w6u9ŚnI~0wv%`y{ֈ%$rSwqzp8{fyW'rY|IIɘ}wWX}Mwz zsDXsrvzxuj](rq7Qɋ I{zZwwIn/ʡ\zYv9Yu1xZVx9Hxz}'ɘUٟ9ʢJ(HrY8:gfH=W[pXioL 3xXZP'J5[(qڃ3  cJs( ڧݩn'WV eF}xzm7\Itz~f$ڦ7rQwɧ`娮}pZⶐJ꣎V8hB nJ^jkɍ+vȧحf|Wg#tXHuT7*V:˚EyhJ`yoǠP* 5j:Mnܺ+_W%P\ɩxm}X g˞9})٪0K>۳Z)0knYx G۳h( 椕9J+Kbf9`IW\۵D^UŶfI_yS1oT͹yc[Zv{@95OT+),eiV@Ti5w{ۋjS۫kZk{-[U;BK W)Bۨ( K[Yǟ %i:1j82I-:Ȼj+uqzL;xKɛ4ə,陳ۤ G}:d/fME1 3y<ž;<~iξCE=\Ƅ$Sl-_솂wYbR{yg}]pM ͥM^Mz7L[{3v>L< $%ӾEHiӻJ*ԭvh!ѼR'ӼLsN*%5T xo.]T^ Lbݖ,MgjSJ'ny],=u={ D=z:1، x o|BM}NFpٜٚٞ٠=ڤNMVVV߄Nڰ۲=ۢ=۶r؄7m`L`_]Jv N R}\،ؚ,U1 ψ|22f'393%(m%g&:3ߗ53q휿E^d[D =В\- >*ߘFy/~px4t$$~GG(~%~F|4H$A#6 57 _^YI1W^f^hmf$w^vN8zy~"b"菱^##$ 4>Ab~!Nn&ꮮ- ~S. K~QnVnJ!"߾ *^q&#[N \"Dn e(A? i]Q,!^ #` !Osqi p*wPk11`$?)QZ_a41FA M#AFQ QO" R `` vP4+qQe_>n8qj_^T!D]_ ذVosX/0_zk`lq#waʮ[$mOQdoO !#!ȏ_1ޟُޏ N0c?Y_ 'A@ G8ͻ`(g8r6ԪEnuqo 9'ZLHfНR&M&͢p.p䶽k[ܝ~oQaqeKROpCgvtiS-{}~O#?chvĽHǺ H0Z@ X8WÇ҈TcŋNk|F, tHZ d!s5HSIˈ"P$jtի7m9*e+_KˊK0 Գk?}Ry¶Oӫ_ϾsN;aplus-fsf-4.22/src/html/tou.html0000444000265000001440000004035210737165454012264 A+: Terms Of Use
A+: a programming language for people who want to program
Reference Manual

Terms Of Use

About A+
History of A+
Who Wrote A+?
Screenshots
Programs Written in A+

Getting A+
Download
Other Software
Installation
Documentation

A+ Community
FAQ
Mail Contacts
Other Resources
The Reviews

A+ Web Site

Terms Of Use

  1. Use Of This Website Is Subject To This TOU And Applicable Law. By using or accessing any of the information, products and services that comprise this website (collectively, this "Website"), you agree with Morgan Stanley & Co. Incorporated ("Morgan Stanley") to the terms and conditions set forth in this Terms of Use ("TOU"). The term "you" as used in this TOU refers to each user of this Website personally and any entity on whose behalf each such user may be acting. If you do not wish to be bound by this TOU, or you breach this TOU, you may not use this Website. Morgan Stanley may update, modify or terminate this TOU or Website, including any of its contents, without prior notice to you. You may view the most current version of this TOU at http://www.aplusdev.org/tou.html. If you elect to download software available on this Website, your use of the software will be governed by the GNU General Public License. Your copying or use of the Reference Manual and any documentation available from this Website will be governed by the GNU Free Documentation License.

    You will not (i) use or access this Website in violation of any law, rule or regulation of any U.S. or non-U.S. local, state, federal or other government, government agency or other government body; (ii) use any device, software or routine, including but not limited to viruses, trojan horses, worms, time bombs, and cancelbots, which damage or hinder, or are intended to damage or hinder, the proper working of the Website, or to unlawfully intercept or expropriate any software, data or other information from the Website; or, (iii) take any action that imposes an unreasonable or disproportionate load on Morgan Stanley's infrastructure, including but not limited to "spam" or denial of service attacks.

  2. Proprietary Rights. The A+ programming language, software and documentation and all other news, material or content made available on this Website (collectively, the "Content") is protected by copyright and other intellectual property laws of the United States and other applicable jurisdictions. You acknowledge that this Website, including the Content, and any associated intellectual property rights (including but not limited to any copyrights, trademarks, and patents) are valid and owned by Morgan Stanley or its licensors. All rights not expressly granted to you by Morgan Stanley in this TOU are reserved. You will not remove any copyright, trademark or other intellectual property or proprietary notice contained in the Website or Content. You acknowledge that "A+" and "MStk" are valid and enforceable service marks owned exclusively by Morgan Stanley.

  3. Notice of any claims that any material on the Website infringes the copyright or other intellectual property rights of a third party should be sent to Morgan Stanley's Designated Agent by e-mailing webmaster@aplusdev.com. Other questions or comments concerning this Website, its Content or this TOU should be sent to the same e-mail address.

  4. Privacy; Customer Data. Morgan Stanley will not require you to provide any personally-identifiable information, such as your name or physical or e-mail address ("Personal Information") to Morgan Stanley as a condition of your use of this Website or your downloading the A+ software and documentation. If you elect to voluntarily supply Personal Information to Morgan Stanley to become part of a mailing list or otherwise, Morgan Stanley may use such Personal Information in connection with this Website or the A+ language, and will not disclose your Personal Information to any unaffiliated third party without your permission. Notwithstanding, Morgan Stanley may use and disclose your Personal Information as necessary to enforce this TOU. By voluntarily supplying such Personal Information to Morgan Stanley, you consent to such use. You may remove yourself from any mailing list or other services at your discretion by e-mailing webmaster@aplusdev.com.

  5. Warranty Disclaimer; Limitation Of Liability And Indemnity. THIS WEBSITE AND ALL CONTENT HEREIN, INCLUDING BUT NOT LIMITED TO THE A+ PROGRAMMING LANGUAGE AND DOCUMENTATION, IS PROVIDED AS IS. MORGAN STANLEY, ITS AFFILIATES AND ANY OTHER PARTY INVOLVED IN THE CREATION OF THE WEBSITE OR CONTENT DISCLAIM ALL POTENTIALLY APPLICABLE WARRANTIES, INCLUDING BUT NOT LIMITED TO ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NONINFRINGEMENT. IN ADDITION, MORGAN STANLEY MAKES NO REPRESENTATION OR WARRANTY (i) THAT YOU WILL BE ABLE TO USE OR ACCESS THE WEBSITE OR CONTENT, OR THAT YOUR USE OR ACCESS WILL NOT BE INTERRUPTED OR IMPAIRED, OR (ii) THAT THE WEBSITE, CONTENT OR THE TOU ARE LAWFUL IN ANY JURISDICTIONS, INCLUDING THOSE OUTSIDE THE UNITED STATES. IN NO EVENT SHALL MORGAN STANLEY, ITS AFFILIATES OR ANY OTHER PARTY INVOLVED IN THE CREATION OF THIS WEBSITE OR ANY OF ITS CONTENTS BE LIABLE FOR ANY DIRECT, INDIRECT, PUNITIVE, INCIDENTAL, SPECIAL, CONSEQUENTIAL OR OTHER DAMAGES ARISING OUT OF, OR IN ANY WAY CONNECTED WITH THIS TOU OR THE SUBJECT MATTER HEREOF, INCLUDING BUT NOT LIMITED TO THE CONTENT, WHETHER BASED ON CONTRACT, TORT, STRICT LIABILITY OR OTHERWISE, EVEN IF MORGAN STANLEY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. THE ENTIRETY OF THIS DISCLAIMER AND LIMITATION OF LIABILITY EXTENDS TO ANY THIRD-PARTY PRODUCTS MENTIONED ON THIS WEBSITE OR THE CONTENTS OF ANY THIRD-PARTY WEBSITE LINKED TO ON THIS WEBSITE, NEITHER OF WHICH ARE ENDORSED IN ANY WAY BY MORGAN STANLEY.

    YOU AGREE TO REIMBURSE MORGAN STANLEY FOR ANY COSTS OR EXPENSES MORGAN STANLEY INCURS ARISING FROM YOUR MISUSE OF THIS WEBSITE OR ITS CONTENT, OR FROM A BREACH BY YOU OF THIS TOU.

  6. Choice Of Law; Venue And Jury Waiver. This Agreement will be governed by New York law without regard to its choice of law rules. The parties hereby consent to the exclusive jurisdiction of, and venue in, any federal or state court of competent jurisdiction located in the Borough of Manhattan, New York City for the purposes of adjudicating any matter arising from or in connection with this Agreement. YOU AND MORGAN STANLEY HEREBY UNCONDITIONALLY WAIVE THEIR RESPECTIVE RIGHTS TO A JURY TRIAL OF ANY CLAIM OR CAUSE OF ACTION BASED UPON OR ARISING OUT OF, DIRECTLY OR INDIRECTLY, THIS TOU, ANY OF THE RELATED DOCUMENTS, AND/OR USE OF THIS WEBSITE OR ITS CONTENTS.

  7. Other Matters. This TOU, along with any further clickwrap license(s) on this Website that you further elect to enter into, constitutes the entire agreement between you and Morgan Stanley with respect to your use of this Website and its Contents and may not be modified except by a writing signed by both parties. To the extent that this TOU may be inconsistent with any other clickwrap license on this Website to which you may agree, the terms of such clickwrap license will govern. This Agreement may not be assigned by you.

    No failure or delay by Morgan Stanley to exercise any right or remedy specified herein shall be construed as a waiver of such remedy or right. Sections 2 through 7 of this Agreement will survive the termination of this Agreement. No agency, partnership, joint venture or employment relationship is intended or created between you and Morgan Stanley as a result of this TOU or your use of the Contents. Neither party is authorized to create or enter into any obligation, express or implied, on behalf of the other party.

    If any provision of these TOU is held to be invalid or unenforceable, that provision will be struck and the remaining provisions will be enforced. The headings above are provided for reference purposes only.

     

Thanks to the designers
of www.xemacs.org for
their inspirational look
and feel.
This page is part of the A+ website <http://www.aplusdev.org/>
Maintained by webmaster@aplusdev.org
Hosted by Morgan Stanley Logo
This page last modified Fri Apr 4 10:41:29 EST 2003
© 1992-2008 Morgan Stanley Dean Witter & Co.  All rights reserved.
aplus-fsf-4.22/src/html/tree.gif0000444000265000001440000002036007215453040012176 GIF87aFGpjjj?,FGI8ͻ`(dihlp,tmx|pH,Ȥrl:ШtJZجvzFxL4@=a HD>S {Ft|`Yjp%smq)s!iko"I(RnŢqw*{ƠмLex܊}hdorxf~^3l&.?\GDMxQ-dĒ=NTQG c\0ռPVsy`M:5v乳.߆LO"73$5ԉq K59QŶk5RlJKrջxe]kܔ__%3,}kIIS-ڲo˘EVwa"#h>TM- gN!Kzueҙs*i >o{>},g"Йc)7ׁwz?Oӫ_Ͼ˟Y< )8}&.6'afޅvn~(UH(cb,Ŋ.(c0hKԈ<c@yÏBid Du PdTVɔVf%=[vp_Ieb#Klfpqֹx)A|ީgm)h|'**(B:vJ'i韔)*jZꛧ:A*'zhfjgv)k暬Fk@Vkfv+k Ҋȭ +kk8;0pWSSsL'+l-3;\F%9<1Ͱ0S@屮2,O;M,SK걳Z)jt_6cC(w;mlpptmw +m߀܂n8{kMxWθz;w[w䠗nz.m㦷KG{{{mšcn|旪~#[mߞ IB`F:򑐌$'IJZ^:ٹ~.'@o3MBy΅r'@%:P tF7Q:^%$DyQACҖj.Hי҈t5fFcӞ)g͜ENԦN#Qijj6U4` '+JUIfJzՂZFRJ׺Bv]TYUXh\O*ׯ#YX}}+[)؛洰ͬfu}ud-жrݬjWŲjEj`QKZ"enw4jm[[VMj]ڑqK;ئVmlokUwKXךsͮzvsKU,~ש{+JsMpO۫F'ӽ-7M S/ ^8a s0WP7&FkX+c<@cHN&;NcXβ){IaY2Y"33C *tlW<3XlBЈ%H>8' 3vS{ڝ?ƴh+CNC=VQM4UMk^ոnmSSG֟j4׾>*okUO>cYuٶ~ihB3mSY=AWkeVɚ6mnbl ȊުvueZJ\ gՀS{܁S63Md{&.h;rۜ(O9k?9q ݠ).:̏>tEͫ屢L}w{W (̯{]Mwial=_ִ%e v>=;9,;x` ^.|O%{g4CfB'|胬y=rWtc+hwOcr}y~ʣhO;? XϾ9]ꓞ%OQ_⯿3`JGXX8Kd0u ixF׀XƗG|VkIyygɵvGs(x#HrFWu-M*(4u&_/˵kD'Ht-x[z:F1f\m'p资B[w1Wn7g4`b(x`^Dxaw$[ŊVet HXrTׇ8tBGW蘎ڴQZy"g9`(Fr_6X7{(RFXerTWᴑFI؁"yIq4X م][)rlȆA ȑ?vFGFyh:Ȓ-uIg1T3_hxv.yXUȏ[8veTvɖ8Shɐj鐟{% wX5hɗ8qiGxrwQpvuS)pY__ypQFژqo)̉m FyșSM3 9≋fin#I)))Tٝ)c;IM脱UaŞSrޘ)l**栰ST_ey#fmi pRY)1SlJvԢmԔ/ zŨ69TYɂRO*VP'\ڥU* JWN(VzƁHtǜlsդNJ}ݗJzdsJYi^:"S }X֩zzRwXPʩz\;SQ+YD#gkuu5xϖG~w frZH ڬ*`o9fê[[vXlk٭ު\wjZTi6m)z8۪S|Xmj*yltL(lNR* ۦjS L r \ُو*zXƧs:(Z&KW"HFFRdZ ̊juw5iby]<ّ^)+ KUrp{+t% 9;od蜌uK}wyNFXXʶ%v՚EwYUS?f"9˱@kX,{b[)U܈Rj߻k[NjﶼHLp+*Vd:x:›eCS79\EßPļs %*S\wB@,9:t6*ƻeZQ'\ /fc=U-.|EǢvlY%K VZũpN؉kT&nQ;dD?Ȳ̲iR~ Tˬ,}~E%9[)˚R)OL$Lʜ[eYZ!dzN镶}V)z꽧< l\U̘\Hn̽yQ,4WmW޵+\:klFnmѨ&?l)345\ ײ- }GlltL5]68=k=˿ֈ;:\l"2n):PW-`F}ԛ^`jHBM` i^k58|fv+ٮ €tʉryG*@}}E҈G%͔pݱi4ّ#2MEfIyJ-$;R-Fδ]yJ`۝u;Y\ͪ9ؖv{.]udYCmZ ZXb݌37jȬ݊ge})–VUl6"iqsݧ`myNGK)lvgֹݯFK<>@B>D^FNT(=*=*.n/^+̾ }I"XG>d^fn ]*дә -23wKpl]2O b<ޚ^~舞WiGΚ[vNsz{Z]n\6>fI긹옑~ݲύ~@bN꾞yU7*=ͥÈ <{~ΏNa^.TrQ.QL;K(Oî,7FnX͋fG/ {<^X|H9>vU~7j_+^k9ܣJjdm>J2޼ˈlw==__G>ڞթOT/}ad`N@o_} v KIbuܞ4MVQo_Zٓ{[]z:o&?? 8ux}_ޡl7Ʀ}M`Ĥ^pR4O4UWeKgoOJO(`CI|}d0YF1>ZfՇL@n0BCAEFGE,KL/*OPQO<_r`dvweg8UVp|}}0 $(: -d$hQcM?1!Er†)xBU;Τc}i`V(Ur.fpC;t Q19p;CsOA# qFXFs|D8kD\ID,h+*EQ2(0ER>$H5I,یn++rs)˙+;J8\a@Aq+Ѕ4M `QLkI!H(2Tv IuU@BT3ӲW |VYgJK%uX\LEް -unXdAKUT(i@j}v;f5 ŔqVMXpwmLIИۜ2eb !zf"Jtnu(=naY8*rRg\FN&yP?9$=9Psä-jLl@:ME{^EwQ%Vzꔸ&N"5Ȕ9!_ZdQ,38F=&e`saiSҞ.]$uU ugn:Ja9UjHiFjYnjЅ Je$z2 RVδưxYİU,!^&IT령?pIY0R%mV#Ho:C`f8̢l) SK{ӚAK%85-v!No{VVe+[q#Um{-Vu_K/+.Xv]Dk$@f:Pu-Ҫ7c-_յq.g9N+Sc[l$`r!%aaa N/b-pMO Kr՟T/ zR Zc@НX$e:d4GFrka9b';ޓY=Wmrw</ɥh>ל6m ΢Yi|)Tկ߭8^X? YГN"lh=1m4$29&5y6V.fn!t۵Գ3;jF^BMLZ[94+YNNGjqm+lh_X=4=kev`.'lV~*n}ܽ]+qov-VV/ݳ ?[MPZp) LX1xq<qMq:{ʯ hOrn|%cJscCբ(ssXYV7Ѝn1PZFt--](+ġ~uq['Wic~v7k s_~wLw'|%^x;;>w+'~<7o#}GOW[$ΖFmT^}}{_'~|'_g~|G_~Ŝ~}_'Ϳ|ߤg{w @c+C@4T@c@t@@@i@A<@?k@{HA\AlA|AAAAAAAAA B!B",B#  
                                      Assignment

Summary                                                               

1. Introduction                                                       

2. Ordinary Assignment: ax and (a)x                                 

3. Strand Assignment: (a;b)(x;y)                                     

4. Value and Value in Context Assignment                              

4a. Value: %`var                                                      

4b. Value in Context: `ctx%`var                                       

4c. Value and Value in Context Assignment: (%`var)x and (`ctx%`var)x

5. Bracket Index Selective Assignment: a[i;j;;k]x                   

5a. Repeated Indices                                                  

5b. Replace All: a[]b                                                

5c. Append: a[,]b                                                    

6. Choose-Pick Selective Assignment: (i#pa)x                        

7. Primitive Functions in Selective Assignment Expressions            


1. Introduction                                                       

The purpose of this tutorial is to familiarize the reader with the A+ 
primitive function called assignment, or specification. This primitive
is the one to use for initializing and modifying the values of        
variables. Ordinary assignment is of the form ab, where the term     
ordinary refers to the simple form of the construct to the left of the
arrow. Selective assignment allows for more complicated constructs on 
the left, whereby subarrays of the values of variables are replaced.  

It is possible to create functions with ordinary assignment when there
is a function expression to the right of the assignment arrow.        
Function assignment is not a topic for this tutorial, however; see the
A+ Reference Manual. In addition, ordinary assignment has a special   
side effect when used in the left argument of a dyadic do statement.  

This tutorial is made up of textual descriptions and A+ examples. You 
should set up your emacs environment to have two visible buffers, one 
holding the tutorial and the other an A+ session. If you are currently
reading this in emacs, simply press F4.                               

To bring individual expressions from the tutorial into the A+ session,
place the cursor on the expression and press F2; for function         
definitions place the cursor anywhere in the definition and press F3. 
It is assumed that the expressions and functions are brought into the 
A+ session when you first encounter them, unless there are explicit   
directions to the contrary.                                           

If you need more help on running emacs and A+, see the Getting Started
tutorial.                                                             


2. Ordinary Assignment                                                

Ordinary assignment associates a value, i.e. an array, with a variable
name. For example:                                                    

	a2 3                                                               
and                                                                   
	c.b'abcdef'                                                         

In the latter case the assignment is to the variable b in the context 
named c:                                                              

	$cx c      		 Enter the context named c  
	$vars                                                                
 b				 b is in the context c 
 	$cx .			 Return to the root context
 	$vars                                                               
 a				 a is in the root context

Ordinary assignment can also be expressed in the form (a)b. When used
inside a function definition, any appearance of ab means that a will 
be a local variable, while the form (a)b can be used to assign a     
value to the global variable a.                                       


3. Strand Assignment                                                  

Several ordinary assignments can be incorporated into one by way of   
strand assignment. For example:                                       

	(a;c.b)('ABC';10+3 4)                                              

Strand assignment is important when working with dependencies. See the
discussion of commit and cancel for sets of dependencies in the       
section on Cyclic Dependencies in the A to A+ document.               


4. Value and Value in Context Assignment                              

Symbols are convenient form for managing names in A+ applications, and
there is a primitive function that evaluates symbols holding the names
of global variables.                                                  


4a. Value                                                             

Value is the monadic primitive function denoted by % that takes a     
symbol holding a global variable name as its argument and produces the
value of the global variable. For example, your A+ session should now 
be in the root context, and we can then continue the above example as 
follows:                                                              

	%`a                                                                  
ABC			                                                                
	%`c.b                                                                
 10 11 12 13			                                                       
 14 15 16 17			                                                       
 18 19 20 21			                                                       


 4b. Value in Context                                                 

Value in Context is the dyadic primitive denoted by %, which permits a
symbol on the left representing the context of the variable on the    
right.                                                                

	`%`a	 	 The empty symbol ` denotes the root context                   
ABC			                                                                
	`c%`b                                                                
 10 11 12 13			                                                       
 14 15 16 17			                                                       
 18 19 20 21			                                                       


4c. Value and Value in Context Assignment                             

Both Value and Value in Context can be used on the left side of       
assignment.                                                           

	(%`a)a                                                             
	a                                                                    
CBA			                                                                
	(`c%`b)10%`c.b                                                     
	c.b                                                                  
 100 110 120 130	
 140 150 160 170
 180 190 200 210

Both Value and Value in Context assignment are important when working 
with callback functions. See the A to A+ document for discussions of  
callback functions.                                                   


5. Bracket Index Selective Assignment                                 

Just as bracket indexing can be used to select subarrays, it can also 
be used on the left side of the assignment arrow to specify subarrays.
Here are a series of examples applying bracket index selective        
assignment to a variable x.  The examples have been chosen to make it 
fairly easy to look at x after each assignment to verify that you     
understand the change that took place.                                

 	x3 5 6                                                            
	x[0;0;0]50		 Specify the element at coordinates (0,0,0)   
	x[0;1]100+6		 Specify the rank one cell at coordinates (0,1)        
	x[0;1;]200+6		 Specify the same rank one cell in a different way    
	x[2]1000+x[2]		 Specify the second item                              
 	x[2;;]1000+x[2]	 Specify the same item in a different way          

Any bracket index expression that can be used to select a subarray can
be used to replace that subarray. The replacement array must have the 
same shape as the indexed subarray, or it must have one element. In   
the latter case, the one element in the replacement array replaces    
every element of the indexed subarray.                                

	x3 5 6		 Restart     
	x[1 2;;2+2 2]                                                      
 2 5 2 2                                                              
	x[1 2;;2+2 2]100+x[1 2;;2+2 2]                                    
	x[1 2;;2+2 2]1000 	                                                


5a. Repeated Indices                                                  

What about repeated elements in the bracket index expression? Let's   
look at a simple example:                                             

	y10                                                                
	y[2 2 2] 30 40 50	                                                  

The question is: element y[2] is associated with three distinct       
elements for replacement: 30, 40, and 50. What is the value of y[2]   
after the above assignment? The answer is: the one with the highest   
index in the ravel of the right argument.                             

	y[2]                                                                 
  50 				               

Another example:                                                      

	y[2 23 3 3 3 ]2 2 100 200 300 400                                 
 	y[3]                                                                
 400		 		            

Finally, note that Value, Value in Context, and Ravel can be used with
bracket indexed selective assignment.                                 

	z5 6                                                               
	(,%`z)[4 5 6]100 200 300	                                           


5b. Replace All: a[]b                                                

This is a special form of bracket index selective assignment for      
replacing all the elements in the variable named on the left of the   
assignment arrow. Either the shape of the array on the right must be  
identical to the shape of the value of the variable on the left, or   
the array on the right must have one element. In the latter case,     
every element of the array on the left is replaced with the single    
element on the right. For example:                                    

	a3 4                                                               
	a[]?3 4100                                                         
or                                                                    
	a[]5                                                                
	a                                                                   
 3 4	

The differences between ab and a[]b are:                            

	ab copies b into a new (replacement) copy of a, but a[]b copies b   
	into the existing a;                                                  

	ab enforces no (prior) compatibility restraints on a and b, but a[]b
	is valid only if a and b have compatible types, and either identical  
	shapes or b has one element.                                          

However, a[]b is the most efficient way to replace an entire mapped  
file.                                                                 


5c. Append: a[,]b                                                    

This is another special form of bracket index selective assignment for
appending items onto the end of an array. For example:                

	a2 5                                                               
	a[,]10 20 30 40 50                                                  
	a                                                                    
  0  1  2  3  4			                                                    
  5  6  7  8  9			                                                    
 10 20 30 40 50			                                                    

Execution of a[,]b can be more efficient then aa,b because if there 
is enough unused space in the storage area allocated to a, then b can 
simply be copied into the area at the end of a. This form of          
specification is the most efficient way to update a mapped file.  


6. Choose-Pick Selective Assignment                                   

The basic rule for bracket index selective assignment applies to      
Choose-Pick selective assignment as well: if the arrays i and p are   
such that i#px selects a subarray from x, then:                      

	(i#px)a                                                           

will replace that subarray. Since # denotes the primitive Choose      
function and  denotes the primitive Pick function, this is called    
Choose-Pick selective assignment.                                     

Value, Value in Context, and Ravel can be used with Choose-Pick       
assignment, as in:  	                                                 

	(i#,p`c%`x)a                                                      

Examples:                                                             

	x(1 2 3;5 6;'abced')  A three element boxed vector                 
	1 2#2x bc		                                 
	(1 2#2x)'XY'                       
	(1 2;3 4 5)#1x        
  9 10 1
 15 16 17			                
	((1 2;3 4 5)#1x)100+?2 310                                        

Examine x to see the changes. Another example:                        

	(1 6 17 25#,1x)1000 2000 3000 4000                                 

Examine x now and you will see that the last selective assignment did 
not replace a rectangle subarray of 1x, but instead modified elements
scattered throughout x. This type of scattered assignment is most     
efficiently done to the ravel of the target array; if the array is not
raveled, then Choose can only address these elements one at a time, as
in:                                                                   

     	((0;1);(1;0);(2;5);(4;1))#<1x                                 
<  1000                                                               
<  2000                                                               
<  3000                                                               
<  4000                                                               

Note the <1x is just 1#x, but the former construct was used to make  
the comparison with the earlier examples easier.                      

It is left to you to make examples using Value and Value in Context.  


7. Primitive Functions in Selective Assignment Expressions            

Some A+ primitive functions can be used in expressions on the left of 
the assignment arrow. They are: Take, Drop, Replicate, Expand, Ravel  
and Item Ravel, Reshape, Rotate and Reverse, and Transpose (monadic   
and dyadic.) Defined functions can also be used, but in the same ways 
as these primitives, and therefore are not discussed here. See the A+ 
Reference Manual.                                                     

For example:                                                          

	a4 5'abcdefghijklmnopqrst'                                         
	(2a)2 5'ABCDEFGHIJ'                                               
 	a                                                                   
ABCDE			                                                              
FGHIJ	 		                                                             
klmno   	 		               
pqrst			                                                              
	(5a)5 5'abcdefghijKLMNOPQRSTUVWXY'                                
	a                                                                    
Ybcde			                                                              
fghij			                                                              
KLMNO			                                                              
PQRST			 	        

The last result gives us a clue to the definition of this form of     
selective assignment. Let                                             

	(f a)b                                                              

represent the selective assignment for the monadic primitive functions
listed above, where a represents a variable name. Then the definition 
of the assignment is as follows: first evaluate                       

 	if a                                                             

to get an array i, and then do the bracket index selective assignment 

	(,a)[i]b                                                            

Why does this work? The reasons are these:                            

    the elements of a are exactly all indices of ,a;                

    ^/(,f a),a has the value 1.                                  

Make sure you understand these reasons.                               

Applying the definition to the last example above, evaluate 5a to  
get the index array i:                                                

	i5a                                                              
	i                                                                    
  0  1  2  3  4			                                                    
  5  6  7  8  9			                                                    
 10 11 12 13 14			                                                    
 15 16 17 18 19			                                                    
  0  0  0  0  0			                                                    

Then evaluate                                                         

	(,a)[i]5 5'abcdefghijKLMNOPQRSTUVWXY'                              

to get the result in the example. The fact that a[0;0] is 'Y' is      
explained by the rule for repeated elements in i (see Repeated        
Indices.)                                                             

The definition for the dyadic primitives is similar. In this case the 
right argument a, which must be a name, is the target of the          
assignment and the left argument x is any conformable array for which 
x f a is valid. Then                                                  

	(x f a)b                                                            

is evaluated by                                                       

	ix f a                                                            

	(,a)[i]b                                                            

Note that the primitive functions listed above all have the property  
that the elements of the intermediate index array i are always a      
subset of a, which means that (,a)[i]b can never fail because of an
index error (see reasons 1) and 2) above.)                            

Value, Value in Context, Pick and Ravel can all be used with this form
of selective assignment. See the A+ Reference Manual.                 
aplus-fsf-4.22/src/html/tutorials/GettingStarted.html0000444000265000001440000006044310774505305016430  
                                Getting Started

Summary

1.  Introduction

1a.  Key Press Notation

2.  Starting Up

3.  Documentation

3a.  Written Documentation

3a1.  Unix
3a2.  Emacs
3a3.  A+

3b.  Online Documentation

3b1.  Unix
3b2.  Emacs
3b3.  A+

4.  Exiting

4a.  Ending a Workstation Session

4b.  Ending an A+ Process

4c.  Ending an Emacs Session

4d.  Ending an Xterm Session

5.  The Emacs/A+ Interactive Environment

5a.  A+ Tutorials

5b.  A+ Scripts

5c.  A+ Sessions, Workspaces, and Log Files

5d.  The A+ Buffer in Emacs

5d1.  Setting the A+ Version
5d2.  Setting the A+ Host Machine
5d3.  Setting All Emacs Variables for A+ Mode

5e.  A Sample A+ Session


1.  Introduction

Xterm and Emacs entries, as well as section titles, are enclosed in
double quote marks when it helps to distinguish them from the
surrounding text.  The font in which the these tutorials appear on the
screen is in fact an APL font (kaplgallant); the distinction between
ordinary text and A+ expressions is usually clear from the context and
the use of special symbols.

It is possible that at some point, as you work through this tutorial,
you will find yourself out of step with the text.  Most likely, you
will be in an Emacs session at the time.  If that happens, exit from
the Emacs session and go back to a point in the tutorial where you can
start over.  The tutorial is not so long that this will be burdensome,
and it is definitely worthwhile to complete it successfully.


1a.  Key Press Notation

We will often use the notation Ctrl-, which means press and hold
the Control key and, while holding, press the key specified by .
For example, Ctrl-x means press and hold the Control key, and then
press the x key.  Similarly, Meta- means to press and hold the
Meta key, which is marked with a diamond, or "Left", or "Right." If
you are using an IBM keyboard, use Alt for Meta.

If the dash is omitted, as in Esc x, press and release the first key
(here Escape), and then press the other key (here x).

For the mouse, to "click" a button means to depress it and release it
quickly.  To "press" a button means to depress it and hold it until
you are told to release it. To "double-click" is to click twice in
quick succession.


2.  Starting Up

The purpose of this tutorial is to help people unfamiliar with the A+
system get up and running.

We are interested in two application windows in this tutorial.  One is
an Xterm.  This is an interactive window for executing Unix commands.
If you see an "Xterm" icon on the lower left, double-click on it and
an Xterm window will open.  Or, move the mouse pointer to the
background area, and then press and hold the right mouse-button to see
the main menu of applications.  Move the pointer to Xterm and release
the button, and an Xterm window will open.

You can start an A+ session in an Xterm session by entering:

/usr/local/bin/a+

Even though A+ started in an Xterm can be used interactively, the
preferred use is to run applications.  Interactive use of A+ is best
done in Emacs.

The Emacs editor window is the other application window of interest
here.  Once again, bring up the main menu of applications as you did
for Xterm.  Only now, move the pointer to Emacs/A+ and release the
button.  You can also start an A+ session within Emacs.  See "5. The
Emacs/A+ Interactive Environment".

If you now have both an Xterm and Emacs window on your screen then
most likely one overlaps the other.  


3.  Documentation

3a.  Written Documentation

3a1.  Unix

Unix is the operating system in which we work, and as an A+ programmer
you will most likely have to know the rudiments of the system.  The
following reference is recommended:

	The UNIX Programming Environment, by Kernighan and Pike

 	Prentice-Hall Software Series

It is also possible to display online documentation for Unix; see
"3b.Online Documentation".


3a2.  Emacs

The Emacs editor, which serves as the A+ application development
environment, is described in: 	

 	GNU Emacs Manual, by Richard Stallman

	Free Software Foundation

or

 	Learning GNU Emacs, by Cameron and Rosenblatt

 	O'Reilly and Associates, Inc.

3a3.  A+

3b.  Online Documentation

3b1.  Unix

There is substantial online documentation for Unix.  To view the
documentation on a particular topic from within an Xterm, enter the
command:

man topic

(man stands for manual pages).  For example, information on the Unix
command cp (for copying files) can be viewed as follows:

man cp

A formatted description of the topic will be displayed in the Xterm
window.  Press Ctrl-c to quit the display.  To learn more about manual
page command, enter:

man man

Another way to view manual pages is in a separate window, that can be
initialized from an Xterm by entering

xman &

(See the command Emacs & in "6c. More on Xterm" for the meaning of &.)
The effect of this command is to display a new window.  Click on the
"Manual Page" button in that window and a manual-page display will
appear, with help information in it.  Press and hold down the
"Options" button, drag the mouse pointer to search, and release.
Enter the topic whose manual pages you want to see, and press the
Enter key.

This display can also be obtained by pressing the right mouse-button
while the pointer is on the background area, moving the pointer to
"Tools" and then to the right and then down the submenu that appears
to "Manual Pages", and releasing the button.

If for some reason you want a print out of the online documentation,
e.g.  on the Unix command cp, enter the command:

man -t cp

The output should automatically be printed on the default local
printer in your area (see "6c. More on Xterm" regarding setting the
printer name).


3b2.  Emacs

Emacs has an online tutorial and online help.  Press Esc x, which will
move the keyboard cursor to the so-called minibuffer (the last line in
the Emacs window) with the prompt M-x.  Enter help- and press the
space bar.  That is, at the point where you should press the space
bar, the minibuffer should look like:

M-x help-

After you press the space bar you will see displayed the full names of
both the tutorial and online help.  Complete the name of the one you
want and press the Enter key.


3b4.  The Window Manager

The windows on your display are under the control of a program known
as a window manager.  T

4.  Exiting

4a.  Ending a Workstation Session

You can either log off the workstation, so that the next time you will
have to log on again and start from scratch, or you can lock the
workstation, which means that next time you simply unlock it and start
where you left off.


4b.  Ending an A+ Process

To end an A+ process without ending the Xterm or Emacs session in
which it is running, enter:

     $off

The next time you start an A+ process, the same log file (see "4c. A+
Sessions, Workspaces, and Log Files") will be active.  If you are also
going to end the Xterm or Emacs session, you may want to save the log
before you end the A+ process.


4c.  Ending an Emacs session

To end an Emacs session, press Ctrl-x followed by Ctrl-c.  You will be
prompted in the minibuffer to save any files that have been modified
since they were last saved.  In particular, if you have run A+ in this
session you will most likely be asked whether or not your A+ session
log should be saved:

Do you want to save .emacs_a? (Y/N)

You may want to answer Y to keep this log, at least for a while.  If
you answer N to any of these prompts, you will then be prompted as
follows:

Modified buffers exist, do you really want to exit? (yes or no)

Answer yes.  If you did not end your A+ session (see "4b. Ending an A+
Process"), you will then be prompted with:

Active processes exist; kill them and exit anyway? (yes or no)

Answer yes, and the Emacs window will disappear.

For a fast exit with no prompting, put the mouse pointer on the title
bar at top of the Emacs window and hold down the right mouse-button.
Move the pointer to "Quit" and release.


4d.  Ending an Xterm session

To end an Xterm session, move the mouse pointer to that window, and
press Ctrl-d.  Or, as with Emacs, put the mouse pointer on the title
bar at the top of the Xterm window and hold down the right mouse-
button.  Move the pointer to Quit and release.


5.  The Emacs/A+ Interactive Environment

The Emacs editor serves as the application development environment for
A+.  Bring up a new Emacs window, as described in the introduction.
The line next to the bottom line contains "Emacs: *scratch*".  The
area above this line is called a buffer.  The title of this buffer is
"*scratch*".  The bottom line of the window is called the minibuffer.

Press the function key F4.  The Emacs window should split into two
buffers.  The top buffer is now the scratch buffer, while the bottom
one is an A+ session with the buffer title "*a*".

The keyboard cursor is the solid, character-sized rectangle that
indicates where the next typed character will go.  The buffer
containing this cursor is called the "selected" buffer.  Pressing the
F6 key (see "5b. More on Emacs for information on the F5, F6 and F7
keys") repeatedly will toggle back and forth between the two buffers,
first selecting one and then the other.  Moving the mouse pointer into
a buffer and pressing the left mouse-button will also select that
buffer.

After you have pressed F4, the bottom buffer holds an interactive A+
session.  Select this buffer and you can enter A+ expressions for
evaluation.  If you were developing an A+ application then typically
you would select the top buffer and open an A+ script file for
editing.  Or, you might select an A+ tutorial instead.

To open a file in the selected buffer, press Ctrl-x followed by
Ctrl-f.  The minibuffer will automatically be selected and will
contain the prefix "Find file: ~/".  To open a file from your HOME
directory, simply enter its name and press the Enter key.  To open a
file in a subdirectory of your HOME directory, say the script
"filetest.+" in the directory "versiontests", enter
"versiontests/filetest.+".  To open a file in any other directory,
enter its full path and name, starting with /.  The initial / causes
Emacs not to include in the path the directory it identified in its
prompt.  For example, to open this tutorial, enter

(Install_Directory)/doc/tutorials/GettingStarted

If the file you name is found, it will be opened and displayed in the
top buffer.  Otherwise, the top buffer will appear to display an empty
file and, in addition, the message "(New File) "will be displayed in
the minibuffer.  In the latter case, the file will not be created at
this point; it will be created if and when you save it for the first
time.

Use the Home, PgUp, PgDn, arrow, and End keys to scroll through an
open file.

It is also possible to open a directory, in order to see the names of
the files it contains.  Once again, press Ctrl-x followed by Ctrl-f,
but in response to the prompt Find file: ~/, enter the directory name.
For example, to open the tutorial directory, enter

(Install_Directory)/doc/tutorials

You should then see a list of file names in the current buffer.  Any
file in the directory can now be opened simply by moving the keyboard
cursor onto the file name and pressing the f key.

Both A+ scripts and the tutorials contain executable A+ expressions
and function definitions.  An A+ expression that stands alone on a
line can be brought into the A+ buffer and executed simply by placing
the keyboard cursor on the expression and pressing F2.  (Once the top
buffer is selected, the keyboard cursor can be moved to the line
holding the expression with the arrow keys; or you can put the mouse
pointer on the expression and press the left mouse button.)  Note that
pressing F2 also causes the keyboard cursor to advance one line,
leaving you in position to bring the next line into the A+ session
with F2.

To bring an entire function definition into the A+ session, place the
keyboard cursor anywhere on the definition and press F3.  (If the
definition has only one line then F2 will do as well as F3.)
Unbalanced punctuation anywhere in the buffer above the function
definition, however, will prevent the function's being brought in.


5a.  A+ Tutorials

The A+ tutorials are located in
(Install_Directory)/doc/tutorials, where, for instance, you
will find the online version of this tutorial:

By default the Install_Directory is /usr/local/aplus-fsf-x.xx 
(where x.xx is version.release)

i.e. /usr/local/aplus-fsf-4.xx/doc/tutorials/GettingStarted

Open the file for this tutorial in the top buffer and use the
down-arrow key to scroll down to this point in the file.  You can then
bring the following examples into your A+ session using F2.

	a3 5
	a
	g{x}:x*2
	g a

You will notice that when the first, second, or fourth lines are
executed, the result is displayed immediately below (not shown here).
The third line holds a function definition, and there is no result to
display when the line is executed.  It is sometimes convenient to
display the result of an execution in the tutorial; you shouldn't
execute these lines.  In general, the A+ expressions that should be
executed are indented like those above.


5b.  A+ Scripts

A+ scripts define applications, toolkits, and utilities.  They consist
of global variable and function definitions, as well as expressions
for initialization.

Scripts are loaded into A+ sessions using the $load system command or
the _load system function.  For example, once an A+ session is begun,
if you plan to use the screen management facilities, then load them as
follows:

	$load s

Once a script is loaded, all the functions and global variables
defined in it are available, and all the executable statements it
contains have been executed.  Scripts can themselves include $load
commands and _load statements, so that applications can load the
toolkits and utilities they depend on, and need not incorporate them
directly in their scripts.

The effect of $load is by and large the same as if the script file
were opened in a buffer, the keyboard cursor were placed on the top
line, and F2 were held down until every line was brought into the A+
session.  (See the A+ Reference Manual for the differences.) In
particular, script files are processed line-by-line, starting at the
top.

When developing and maintaining an application you will usually open
its A+ script in the top buffer and selectively bring parts of it into
the A+ session using the F2 and F3 keys.  F2 can also be used to bring
a multi-line function definition into the A+ session, but line by
line.  This is particularly useful during debugging.  Start with the
keyboard cursor on the first line of a function definition and press
F2 for each line.  (Or, simply hold F2 down and it will automatically
go from one line to the next.) As each line is brought in, its display
in the A+ session has a prefix of *'s on the left, one for each level
of unbalanced, nested parentheses, braces, or quotation marks (but not
brackets).

For example, consider the function definition

	penny x:{
	  m0.01;
	  i1;
	  while (m



aplus-fsf-4.22/src/html/tutorials/Introduction.html0000444000265000001440000000534710774505331016162 


   
   


 

                                   Introduction 

All the tutorials are contained in:

    (Install_Directory)/doc/tutorials

By default the Install_Directory is /usr/local/aplus-fsf-x.xx 
(where x.xx is version.release)

i.e. /usr/local/aplus-fsf-4.xx/doc/tutorials/GettingStarted

This set of tutorials deals primarily with the A+ language. However,
the first one, GettingStarted, is designed to do just what its name
says, to introduce you to the A+ application development system in
which you will work.

If you are relatively new to programming in A+ or APL, or if you are
rusty, go on to ScalarFunctions. If you are familiar with APL,
however, go on to SimpleArrays instead and look for the differences
between A+ and the APL dialects you know.

A+ uses the special APL character set, which requires special key
sequences for entry; see the keyboard layout diagrams in Chapter 2
and Appendix B of the A+ Reference Manual.

                                                                         
                          A+ Language Tutorials                         
---------------------------------------------------------------------
| File           |Summary of Topics                                 |
|================|==================================================|
|GettingStarted  |Emacs and A+                                      |
|ScalarFunctions |Elementary A+                                     |
|Syntax          |Well-Formed A+ Expressions                        |
|SimpleArrays    |The Primitive Functions for Simple, Flat Data     |
|Assignment      |The Various Forms of Assignment, or Specification |
|NestedArrays    |The Primitive Functions for Composite Data        |
---------------------------------------------------------------------
                                                                         
In addition to these tutorials, there are two subdirectories:

- one containing tutorials for screen management and some material
  for examples, treating all classes except graphs (s.tutorials);
  start with s.tutorials/introduction;
- one containing a tutorial on the graph display class and a file of
  data for examples (graphs);

aplus-fsf-4.22/src/html/tutorials/Makefile0000644000265000001440000002635210774512506014256 # Makefile.in generated by automake 1.6.3 from Makefile.am. # src/html/tutorials/Makefile. Generated from Makefile.in by configure. # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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. ############################################################################### ############################################################################### SHELL = /bin/sh srcdir = . top_srcdir = ../../.. prefix = /usr/local exec_prefix = ${prefix} bindir = ${exec_prefix}/bin sbindir = ${exec_prefix}/sbin libexecdir = ${exec_prefix}/libexec datadir = ${prefix}/share sysconfdir = ${prefix}/etc sharedstatedir = ${prefix}/com localstatedir = ${prefix}/var libdir = ${exec_prefix}/lib infodir = ${prefix}/info mandir = ${prefix}/man includedir = ${prefix}/include oldincludedir = /usr/include pkgdatadir = $(datadir)/aplus-fsf pkglibdir = $(libdir)/aplus-fsf pkgincludedir = $(includedir)/aplus-fsf top_builddir = ../../.. ACLOCAL = aclocal-1.6 AUTOCONF = autoconf AUTOMAKE = automake-1.6 AUTOHEADER = autoheader am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = /usr/bin/install -c INSTALL_PROGRAM = ${INSTALL} INSTALL_DATA = ${INSTALL} -m 644 install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = ${INSTALL} INSTALL_HEADER = $(INSTALL_DATA) transform = s,x,x, NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = host_triplet = i686-pc-linux-gnu EXEEXT = OBJEXT = o PATH_SEPARATOR = : AMTAR = tar AS = @AS@ AWK = gawk CC = gcc CXX = g++ DEPDIR = .deps DLLTOOL = @DLLTOOL@ ECHO = echo INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s LIBTOOL = $(SHELL) $(top_builddir)/libtool LIBTOOL_DEPS = config/ltmain.sh LN_S = ln -s MAINT = # OBJDUMP = @OBJDUMP@ PACKAGE = aplus-fsf RANLIB = ranlib STRIP = strip VERSION = 4.22 X_INCLUDES = -I/usr/X11R6/include X_LIBS = -L/usr/X11R6/lib -lX11 am__include = include am__quote = install_sh = /ms/dev/aplus/aplus/fsf/src/aplus-fsf-4.22/config/install-sh SUBDIRS = graphs s.tutorials tutorialsdir = $(prefix)/doc/html/tutorials tutorials_DATA = \ Assignment.html \ GettingStarted.html \ Introduction.html \ NestedArrays.html \ ScalarFunctions.html \ SimpleArrays.html \ Syntax.html EXTRA_DIST = \ Assignment.html \ GettingStarted.html \ Introduction.html \ NestedArrays.html \ ScalarFunctions.html \ SimpleArrays.html \ Syntax.html subdir = src/html/tutorials mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_CLEAN_FILES = DIST_SOURCES = DATA = $(tutorials_DATA) RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ uninstall-info-recursive all-recursive install-data-recursive \ install-exec-recursive installdirs-recursive install-recursive \ uninstall-recursive check-recursive installcheck-recursive DIST_COMMON = Makefile.am Makefile.in DIST_SUBDIRS = $(SUBDIRS) all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: # Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/html/tutorials/Makefile Makefile: # $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: tutorialsDATA_INSTALL = $(INSTALL_DATA) install-tutorialsDATA: $(tutorials_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(tutorialsdir) @list='$(tutorials_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(tutorialsDATA_INSTALL) $$d$$p $(DESTDIR)$(tutorialsdir)/$$f"; \ $(tutorialsDATA_INSTALL) $$d$$p $(DESTDIR)$(tutorialsdir)/$$f; \ done uninstall-tutorialsDATA: @$(NORMAL_UNINSTALL) @list='$(tutorials_DATA)'; for p in $$list; do \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " rm -f $(DESTDIR)$(tutorialsdir)/$$f"; \ rm -f $(DESTDIR)$(tutorialsdir)/$$f; \ done # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ETAGS = etags ETAGSFLAGS = tags: TAGS 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; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ fi; \ done; \ 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; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = ../../.. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d $(distdir)/$$subdir \ || mkdir $(distdir)/$$subdir \ || exit 1; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" \ distdir=../$(distdir)/$$subdir \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(DATA) installdirs: installdirs-recursive installdirs-am: $(mkinstalldirs) $(DESTDIR)$(tutorialsdir) install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_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-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: info: info-recursive info-am: install-data-am: install-tutorialsDATA install-exec-am: install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool uninstall-am: uninstall-info-am uninstall-tutorialsDATA uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \ clean-generic clean-libtool clean-recursive distclean \ distclean-generic distclean-libtool distclean-recursive \ distclean-tags distdir dvi dvi-am dvi-recursive info info-am \ info-recursive install install-am install-data install-data-am \ install-data-recursive install-exec install-exec-am \ install-exec-recursive install-info install-info-am \ install-info-recursive install-man install-recursive \ install-strip install-tutorialsDATA installcheck \ installcheck-am installdirs installdirs-am \ installdirs-recursive maintainer-clean maintainer-clean-generic \ maintainer-clean-recursive mostlyclean mostlyclean-generic \ mostlyclean-libtool mostlyclean-recursive tags tags-recursive \ uninstall uninstall-am uninstall-info-am \ uninstall-info-recursive uninstall-recursive \ uninstall-tutorialsDATA # 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: aplus-fsf-4.22/src/html/tutorials/Makefile.am0000664000265000001440000000177007232100114014630 ## Process this file with automake to produce Makefile.in ############################################################################### ## ## ## Copyright (c) 2001 Morgan Stanley Dean Witter and Co. ## ## See ..../src/LICENSE for terms of distribution. ## ## ## ## ## ############################################################################### SUBDIRS = graphs s.tutorials tutorialsdir = $(prefix)/doc/html/tutorials tutorials_DATA = \ Assignment.html \ GettingStarted.html \ Introduction.html \ NestedArrays.html \ ScalarFunctions.html \ SimpleArrays.html \ Syntax.html EXTRA_DIST = \ Assignment.html \ GettingStarted.html \ Introduction.html \ NestedArrays.html \ ScalarFunctions.html \ SimpleArrays.html \ Syntax.html aplus-fsf-4.22/src/html/tutorials/Makefile.in0000644000265000001440000002631010774512523014654 # Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ ############################################################################### ############################################################################### SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../.. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CXX = @CXX@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ STRIP = @STRIP@ VERSION = @VERSION@ X_INCLUDES = @X_INCLUDES@ X_LIBS = @X_LIBS@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ SUBDIRS = graphs s.tutorials tutorialsdir = $(prefix)/doc/html/tutorials tutorials_DATA = \ Assignment.html \ GettingStarted.html \ Introduction.html \ NestedArrays.html \ ScalarFunctions.html \ SimpleArrays.html \ Syntax.html EXTRA_DIST = \ Assignment.html \ GettingStarted.html \ Introduction.html \ NestedArrays.html \ ScalarFunctions.html \ SimpleArrays.html \ Syntax.html subdir = src/html/tutorials mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_CLEAN_FILES = DIST_SOURCES = DATA = $(tutorials_DATA) RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ uninstall-info-recursive all-recursive install-data-recursive \ install-exec-recursive installdirs-recursive install-recursive \ uninstall-recursive check-recursive installcheck-recursive DIST_COMMON = Makefile.am Makefile.in DIST_SUBDIRS = $(SUBDIRS) all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/html/tutorials/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: tutorialsDATA_INSTALL = $(INSTALL_DATA) install-tutorialsDATA: $(tutorials_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(tutorialsdir) @list='$(tutorials_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(tutorialsDATA_INSTALL) $$d$$p $(DESTDIR)$(tutorialsdir)/$$f"; \ $(tutorialsDATA_INSTALL) $$d$$p $(DESTDIR)$(tutorialsdir)/$$f; \ done uninstall-tutorialsDATA: @$(NORMAL_UNINSTALL) @list='$(tutorials_DATA)'; for p in $$list; do \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " rm -f $(DESTDIR)$(tutorialsdir)/$$f"; \ rm -f $(DESTDIR)$(tutorialsdir)/$$f; \ done # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ETAGS = etags ETAGSFLAGS = tags: TAGS 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; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ fi; \ done; \ 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; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = ../../.. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d $(distdir)/$$subdir \ || mkdir $(distdir)/$$subdir \ || exit 1; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" \ distdir=../$(distdir)/$$subdir \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(DATA) installdirs: installdirs-recursive installdirs-am: $(mkinstalldirs) $(DESTDIR)$(tutorialsdir) install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_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-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: info: info-recursive info-am: install-data-am: install-tutorialsDATA install-exec-am: install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool uninstall-am: uninstall-info-am uninstall-tutorialsDATA uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \ clean-generic clean-libtool clean-recursive distclean \ distclean-generic distclean-libtool distclean-recursive \ distclean-tags distdir dvi dvi-am dvi-recursive info info-am \ info-recursive install install-am install-data install-data-am \ install-data-recursive install-exec install-exec-am \ install-exec-recursive install-info install-info-am \ install-info-recursive install-man install-recursive \ install-strip install-tutorialsDATA installcheck \ installcheck-am installdirs installdirs-am \ installdirs-recursive maintainer-clean maintainer-clean-generic \ maintainer-clean-recursive mostlyclean mostlyclean-generic \ mostlyclean-libtool mostlyclean-recursive tags tags-recursive \ uninstall uninstall-am uninstall-info-am \ uninstall-info-recursive uninstall-recursive \ uninstall-tutorialsDATA # 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: aplus-fsf-4.22/src/html/tutorials/NestedArrays.html0000444000265000001440000010343310750123450016070  
                            Nested Arrays   

Summary                                                               

1.  Introduction                                                      

2.  Creating Test Data                                                

The primitive functions and operators illustrated in this section are:
	Enclose: Monadic <                    
	Each: Monadic operator denoted by  that applies to monadic and
	dyadic functions 

In addition, some syntax specific to the formation of nested arrays   
appears, called strand notation.                                      

3.  Characteristics of Nested Arrays                                  

The primitive functions illustrated in this section are:              

	Shape: Monadic     
	Indexing: [;;]      
	Count and Choose: Monadic and Dyadic #      
	Type: Monadic              
	Depth: Monadic           
	Apply: Monadic operator denoted by  that applies to function 
	scalars

3a.  Nested Arrays, Function Arrays and Symbol Arrays                 

3a1.  Type                                                            

3a2.  Depth                                                           

3b.  General Purpose Primitive Functions and Nested Arrays            

4.  Constructing Nested Elements and Extracting their Contents        

4a.  Slot-Filler Arrays                                               

5.  Primitive Functions and Operators Specifically for Nested Arrays  

5a.  Partition, Partition Count, and the Each Operator                

5b.  Raze and Rake                                                    


1.  Introduction                                                      

In the Simple Arrays tutorial we concentrated on homogeneous arrays   
whose elements were integers, floating-point numbers, characters, or  
symbols.  The emphasis was on the items of an array, and how the      
concept of items, and more generally those of frames and cells,       
provide a unifying view of simple arrays for understanding the        
behavior of many primitive functions.  In this chapter - which builds 
on the Simple Arrays tutorial - we turn to nested, heterogeneous       
arrays, i.e.  arrays whose elements are other arrays or even function 
expressions.The primitive functions discussed in the Simple Arrays    
tutorial that select or rearrange their arguments apply to nested     
arrays as well as simple arrays; examples will be given.  In addition,
their are primitive functions, and one primitive operator, that are   
most meaningful when applied to nested arrays.  The more complex data 
structures that are possible with nested arrays provide alternative   
ways to approach many programming problems.                           

Experimentation is still the best way to learn, and so we begin again 
with methods of creating test data.                                   


2.  Creating Test Arrays                                              

The primitive functions and operators illustrated in this section are:
	Enclose: Monadic < 
	Each: Monadic operator denoted by  that applies to monadic and
	dyadic functions                       

In addition, some syntax specific to the formation of nested arrays   
appears, called strand notation.                                      

As with simple arrays, it is helpful to know how to produce test data 
for heterogeneous, nested arrays.                                     

Examples                                                              

Execute each of the following:                                        

	<3 5		 A scalar holding the integer matrix 3 5, 
			   or what is called the enclose of 3 5.

The Enclose primitive applies to any array and produces a nested      
scalar holding that array.                                            

	(10 32;'abc')	 Strand notation for a 2-element vector whose 
			 elements hold the vectors 10 32 and 'abc'.

Note the symbol < to the left of both 10 32 and 'abc' in the display  
of the result of this expression.  This symbol indicates that the     
array to the right of the symbol is enclosed within some other array. 

	((10 32;'abc');2 2'ABCD')	 Strand notation for a 2-element 
					 vector whose first element holds 
					 the nested vector (10 32;'abc'), 
					 and whose second element holds 
					 2 2'ABCD'.         

	2 2(10.5 113.58;'abc';`xft3;2 4) 	 A 2x2 matrix consisting of a   
						 floating-point vector, a 
						 character vector, a symbol 
						 scalar, and an integer matrix. 

All the vectors in these examples are created by strand notation.  In 
general, a strand is simply a list of expressions separated by        
semicolons, with the entire list surrounded by parentheses.           

Note that the display of the result of the last expression does not   
reflect its shape; the elements are simply listed one above the other 
in row major order.  A more effective display is produced the function
disp.lay in the script disp.a.  Execute the following to see these    
displays.                                                             

	$load disp                                                           
	disp.lay (10 32;'abc')                                               
	disp.lay 2 2(10.5 113.58;'abc';`xft3;2 4)                          

The tutorial will not explicitly refer to this display function again,
but you should feel free to use it to clarify results.                

	(?1050;?1532)			 A 2-element vector consisting of 
					 a vector of 10 random numbers 
					 between 0 and 49,and a vector of 
					 15 random numbers between 0 and 31. 

	?(1050;1532)			 The same result as above.  In this 
					 case the each operator, denoted by 
					 the dieresis, is applied to the 
					 function ? and the vector (1050;1532).
					 The effect of the operator is to apply
					 the function to the contents of each 
					 element of the vector.        

	ɡ3 5 10 6		 A 4-element vector whose elements hold, in 
				 order, the vector 3, the vector 5,  
				 the vector 10, and the vector 6. 

	10?15 20 25		 A 3-element vector whose elements hold 10?15, 
				 10?20, and 10?25. 

	10 15?15 20		 A 2-element vector whose elements hold 10?15 
				 and 15?20. 

	10 15?25		 A 2-element vector whose elements hold 10?25 
				 and 15?25.    

	<@1 5 7		 A 5-element vector whose elements hold the 
				 7-element vectors that make up the rows of 5 7.


3.  Characteristics of Nested Arrays                                  

The primitive functions and operators illustrated in this section are:
	Shape: Monadic                                                      
	Indexing: [;;]                                                      
	Count and Choose: Monadic and Dyadic #                               
	Type: Monadic                                                       
	Depth: Monadic                                                      
	Apply: Monadic operator denoted by  that applies to function scalars

The purpose of this section, as in the Simple Arrays tutorial, is to  
illustrate the A+ primitives that deal with these most basic          
properties of arrays:                                                 

    shape, e.g.  the number of rows and columns of a matrix;          

    reshaping an array to a specified shape;                          

    count, e.g.  the number of rows of a matrix;                      

    type,  that is, whether the elements are characters, integers, etc.;  

    depth, that is, the levels of nesting;                            

    selection of elements and subarrays.                              

Nesting adds a new aspect to arrays, namely, that elements of arrays  
do not have to be individual values, but can hold other arrays.       
Whether or not an array is nested has no effect on the basic functions
for determining count and shape, for reshaping, and for selecting     
elements or subarrays, because the definitions of these functions do  
not depend on the contents of elements.  For example, the vector      

	v('abc';5 2;`as_de;12 34 891)                                      

has four elements and so its count is the scalar 4 and its shape is   
the one-element vector 14, just as the count of the four-element     
vector 3 14 21 5 is the scalar 4 and its shape is the one-element    
vector 14:                                                           

	#v                                                                   
 4                                                                    
	v                                                                   
 4                                                                    

Analogously, elements of nested arrays can be rearranged with Reshape 
and selected with Indexing and Choose, just like the elements of      
simple arrays:                                                        

	a2 2v                                                              

For example, both a[0;1] and (0;1)#a equal the element at the         
intersection of the first row and second column, regardless of whether
that element is nested or not.  As in the simple array case, this     
element is a scalar; Indexing and Choose have not selected the array  
inside the element, namely 5 2, but the element that holds that      
array:                                                                

	a[0;1]                                                               
< 0 1 2 3 4 			 The leading < indicates nesting. 
  5 6 7 8 9                                                           
	(0;1)#a                                                              
< 0 1 2 3 4                                                           
  5 6 7 8 9                                                           
	(0;1)#a                                                             
			 Only a new line occurs, indicating an empty result. 

The Type primitive, denoted by monadic , applies to nested arrays and
returns `box as their type, as in:                                    

	a                                                                   
 `box                                                                 
	(0;1)#a		 The selected element is also boxed.
 `box                                                                 

However, the situation is more complicated than this example          
indicates, and is discussed in the section that follows (3a1.  Type). 

The new primitive introduced in this section is Depth, denoted by     
monadic .  The purpose of this primitive is to serve an analogous    
role to the Shape primitive, measuring the level of nesting in an     
array instead of the lengths of axes.  In particular, the depth of any
simple array of type `int, `float, or `char, is 0.  For example:      

	1 2 3 4                                    
 0                                                                    
	'abcdef'                                   
 0                                                                    
	a		 At least one nested element 1 level down.  
 1                                                                    

As with the Type primitive, we will return to the Depth primitive in  
the next section (3a2.  Depth).                                       


3a.  Nested Arrays, Function Arrays and Symbol Arrays                 

A symbol is a string of alphabetic characters, underscores (_), and   
dots (.) that is represented as a single scalar, just as an integer is
a single scalar representing a string of digits.  A symbol constant   
consists of a backquote (`) followed by a string of characters.  For  
example, just as 1 2.34 12e3 is a list of three numbers, `a.s `12 `w_3
is a list of three symbols.                                           

A function scalar is a scalar array holding a function (not the name  
of the function, but the function itself).  A constant symbol scalar  
consists of the symbols <{, followed by a function, followed by the   
symbol }.  For example, <{+/} is a function scalar holding +          
Reduction.  The sole purpose of the Apply operator is to evaluate     
function scalars.  For example:                                       

	(<{+/})3 4 5 6 7                                                    

Symbol arrays and function arrays are arrays whose elements are all   
symbols or all function scalars, respectively.                        


3a1.  Type                                                            

Function arrays, symbol arrays, and nested arrays are actually all    
variations of the same internal representation, and thereby can be    
combined freely to form other arrays.  For example, the following     
expressions are valid:                                                

	`abc,<5 2  
	(<2 3'abcdef'),<{+}                 
	(<{/}),`times_reduction                  

On the other hand, the primitive function Type distinguishes between  
symbol, function, and nested arrays, as in the following examples:    

	`abc                                         
	<{/}                                    
	<'abc'                             

Consequently, one might say that arrays whose elements hold objects of
more than one type are of mixed type, as in the case of the three     
examples above.  Le's see what the type function returns when applied
to them:                                                              

	`abc,<5 2  
	(2 3'abcdef';+)                        
	(/;`times_reduction)                           
As you can see, there is no array type called `mixed.  Instead, the   
type rule is as follows:                                              

	The type of a non-empty array is the type of the first element of its
	ravel.                                                                

For example, reverse each of the arrays in the above examples to get a
new first element and apply the Type primitive again:                 

	`abc,<5 2                                                         
	(2 3'abcdef'),<{+}                                                
	(<{/},`times_reduction                                            

There is a fourth player among the mixed arrays, the Null, which is   
denoted by ().  The Null is the only empty vector to which any        
elements of type `box, `func, or `sym can be concatenated.  It has its
own type, which is `null.  For example:                               

	()                                                                  
	(),`abc                                                             
	(),<{ ,}                                                           
	(),<10                                                             
	(;10)                                                              

All empty nested arrays are of type `null.  For example:              

	aɡ2 25 15 10 20 	 A four-element vector of integer vectors.   
	0 0/a	                                                              
 0 2                                                                  
	0 0/a                                                               
 `null                                                                
	2@1 a                                                              
 2 0                                                                  
	2@1 a                                                              
 `null                                                                

Ex 1 What is the difference, if any, between `abc,<3 4 and (`abc;3 4)?


3a2.  Depth                                                           

In the previous section we saw that arrays of four different types can
be combined to form other arrays.  Depth reflects the level of nesting
in arrays, and as such does not have the same value for scalars of    
these four types.  For example:                                       

	`abc                                                                
	<{+.}                                                              
	<10 4                                                              
	<<10 4                                                             
	()                                                                  

Ex 2 Here are the rules for the Depth primitive:                      

    the depth of a scalar of type other than `box is 0;               
    the depth of an empty array of type other than `null is 0;        
    every level of enclosure in a scalar increases the depth of the scalar
      by 1;                                                                 
    the depth of an array is the maximum depth of its (scalar) elements.  

Write a defined function that is equivalent to the Depth primitive.   

Ex 3 We tend to use the terms symbol array for those arrays whose     
elements are all symbols, and function array for those arrays whose   
elements all hold function expressions, much in the same way as we use
integer array, floating-point array, or character array.  The latter  
three are easily defined, namely, as arrays of type `int, `float,     
`char, respectively.  However, even if the type of an array is `sym,  
the array is not necessarily a symbol array; e.g., (`a;3).  And       
similarly for function arrays.  Each of the following expressions     
attempts to test whether or not an array is a symbol array, or a      
function array.  Which are successful, and for any that are not, why  
not?                                                                  

	a is a symbol array if (`sym=a)^0=a                                 
	x is a function array if ~0`func=@0 x                              
	xy is a symbol array if 0=0do xy                                   
	z is a function array if ~0(<`func)=z                             


3b.  General Purpose Primitive Functions and Nested Arrays            

Among the primitive functions discussed in the Simple Arrays tutorial 
are those that select and rearrange items and elements of their       
arguments.  These functions generally apply to simple arrays of any   
type.  It turns out that they apply to nested arrays as well, and in  
the expected manner; the definitions of these functions for selecting 
and rearranging items and elements do not depend in any way on the    
contents of those elements and items.  We have already examples of    
this above, namely, Indexing and Choose.                              

For example, the Take primitive applies to nested right arguments as  
well as simple ones:                                                  

	2`xyz,('abcd';4 2),<{+}                                            
<  xyz                                                                
< abcd                                                                


4.  Constructing Nested Elements and Extracting their Contents        

The primitive functions illustrated in this section are:              
	Enclose: Monadic <                                                   
	Disclose: Monadic >                                                  
	Pick: Monadic                                                       

The basic building block for nested arrays is the Enclose primitive,   
denoted by monadic <.  The Enclose primitive applies to any array and 
produces a scalar holding that array; the depth of the scalar result  
is 1 plus the depth of the argument, and the type of the result is    
always `box.                                                          

	<'abcde'                                                             
< abcde                                                               
	<'abcde'                                                            
			 Only a new line occurs, indicating an empty result. 
	'abcde'                                                             
 0                                                                    
	<'abcde'                                                            
 1                                                                    
	<<'abcde'                                                           
 2                                                                    

The Disclose primitive, denoted by monadic >, is a left inverse of    
Enclose, in that the Disclose of the Enclose of any array equals that 
array, unless that array was a function: the depth of a function is   
-1, and the minimum depth of the result of Disclose is 0.             

	><'abcde'                                                            
 abcde                                                                
	'abcde'><'abcde'                                                    
 1                                                                    

Disclose is also permissive, in that applies to scalars of depth 0,   
i.e.  scalars that are not a result of Enclose.                       

	>3                                                                   
 3                                                                    
	3=>3                                                                 
 1                                                                    

Disclose also applies to arrays with more than one element, as long   
the all the disclosed elements have the same shape:                   

	>(1 2 3 4; 60 70 80 90)                                              
  1  2  3  4                                                          
 60 70 80 90                                                          

In its simplest form, the Pick primitive, denoted by dyadic , is     
Choose followed by Disclose:                                          

	1('xcty';`xy_w;5 7)                                                
 `xy_w                                                                
	>1#('xcty';`xy_w;5 7)                                               
 `xy_w                                                                
	`xy_w1('xcty';`xy_w;5 7)                                          
 1                                                                    
	2('abc';5 2;`as_de;12 34 891)                                      
 `as_de                                                               
	>2#('abc';5 2;`as_de;12 34 891)                                     
 `as_de                                                               

The left argument to Pick can also be a path vector that reaches as   
deep into the right argument as its length.  For example:             

	0 1(('abcd';3 4 1);`xyz)                                            
 3 4 1                                                                

Ex 4 In the above examples the left arguments to Pick are composed of 
index expressions for the various levels of the corresponding right   
arguments.  Note the order of these index expressions in the left     
arguments.  Namely, if the left argument x is a vector with more than 
one element, and is a valid path vector for the right argument w, then
xs equals (1x)(1x)w.                                             

    Test this relation for the appropriate examples above;            

What are the conditions on x and the scalar n so that xw equals      
(nx)(nx)w.                                                        


4a.  Slot-Filler Arrays                                               

Slot-filler arrays are two-element nested vectors that satisfy certain
requirements and that, in return, are treated specially by the Pick   
primitive and screen display functions.  Specifically, an array s is a
slot-filler array if the following conditions are met:                

    s is a two-element vector;                                        

both 0s and 1s are vectors or both are scalars, and they have the   
same number of elements;                                              

    all the elements of 0s are symbols;                              
    the depth of 1s is at least 1.                                   

For example, the following are slot-filler arrays:                    

	(`a`b`c;(10;20;30))                                                  
	(`w`xx`yyy`zzzz;(;5 3;'abcdef';(`astd;3 4 5 1)))                    
	(`qw;<10?20)                                                         

The following are not:                                                

	(`a`b;(10;30;30))                                                    
	(`x`y`zz;2 3 4)                                                      

Ex 5 Define a monadic function that returns 1 if its argument is a    
slot-filler array and 0 otherwise.  Test your function on a variety of
examples, and compare the results with those of the system function   
_issf.                                                                

From the viewpoint of the Pick primitive, slot-filler arrays are      
key-value pairs.  That is, if s denotes a slot-filler array, a symbol 
in 0s can be used as the left argument to Pick, with s the right     
argument, and the result is the contents of the corresponding element 
of 1s.  For example:                                                 

	`a(`a`b`c;(10;20;30))                                               
 10                                                                   
	`b(`a`b`c;(10;20;30))                                               
 20                                                                   

Ex 6 If s is a slot-filler array and x is a symbol that appears in    
0s, then xs equals ((0s)x)1s.  Is this definition of xs        
correct? If not, correct it.                                          

A nested slot-filler array is one whose values in the key-value pairs 
may be also slot-filler arrays themselves, or even nested slot-filler 
arrays.  For example, the following is a nested slot-filler array:   

	s(`a`b`c;(10;(`x`y;(100;200));(`e`f;((`g`h;(1000;2000));'A+'))))    

when the right argument to Pick is a nested slot-filler array, the    
right argument can be a vector of symbols reaching into the right     
argument to extract a value.  For example, evaluate each of the       
following:                                                            

	`as                                                                 
	`b`xs                                                               
	`bs		 There is no need to Pick all the way to the bottom.
	`c`fs                                                               
	`c`e`gs                                                             

The symbol scalar or vector on the left of Pick is called a path to   
the slot-filler array on the right.                                   

Ex 7 Repeat Ex 4 for nested slot-fillers.  Note the order of the      
symbols in the left argument to Pick in the above examples.  Namely,  
if the left argument v is a vector with more than one element, and is 
a valid path vector to the nested slot-filler array s, then vs equals
(1v)(1v)s.                                                        

    Test this relation for the appropriate examples above;            

What are the conditions on v and the scalar n so that vs equals      
(nv)(nv)s.                                                        


5.  Primitive Functions and Operators Specifically for Nested Arrays  

Some of the primitive functions discussed in the Simple Arrays        
tutorial apply to nested arrays, while others are restricted to simple
arrays - in particular, those that are further restricted to numeric  
arrays.  There are also primitives that are specific to nested arrays,
in that their arguments, or results, or both, must be nested arrays.  
It is these primitives that are discussed in this section.            


5a.  Partition, Partition Count, and the Each Operator                

The primitives illustrated in this section are useful for partitioning
arrays into sections.  For example, suppose we want to break the      
following sentence into words:                                        

	s"Partition Count is a dyadic function, while Partition is monadic." 

 We begin by identifying the word breaks, namely the blanks:          

	bs=' '                                                              
	b                                                                    
 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 
 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0           

The Partition Count primitive applies to b and returns a vector whose 
length is the number of 1s in b, i.e.  +/b, and whose ith item is 1  
plus the length of the sequence of contiguous 0's following the ith 1.
The argument to Partition Count must start with a non-zero element.   
Since the sentence s does not have a leading blank, b does not have a 
leading 1, so we'll prefix a 1 to b:                                  

	1,b                                                                 
 10 6 3 2 7 10 6 10 3 9                                               

Be sure to compare this result to the lengths of sequences of 0's in  
b.  The Partition function will break the sentence s up into parts    
(words, hopefully) based on the last result.                          

 	(1,b)s                                                            
< Partition                                                           
< Count                                                               
< is                                                                  
< a                                                                   
< dyadic                                                              
< function,                                                           
< while                                                               
< Partition                                                           
< is                                                                  
< monadic.                                                            

As you can see, we have a nested vector of character vectors, which   
are (almost) words.  Nested arrays are very useful here, because the  
character vectors are of different lengths.  Let's check the lengths  
of words by applying the Count primitive to each element of the result
(by way of the Each operator):                                        

	w(1,b)s                                                           
	>#w                                                                 
 10 6 3 2 7 10 6 10 3 8                                               

Note that these values agree with the elements in 1,b (there is no   
trailing blank on the last item).  Each character vector has at least 
one unwanted character.  For example, the first character vector holds
the word "Partition", but the vector has 10 characters and the word   
has only 9.  We can check that the extraneous characters are not on   
the front of the words by looking at the first character of each one: 

	1١w                                                                 
< P                                                                   
< C                                                                   
< i                                                                   
< a                                                                   
< d                                                                   
< f                                                                   
< w                                                                   
< P                                                                   
< i                                                                   
< m                                                                   

So, the extraneous characters are on the ends of the words.  We will  
continue this example in the exercises.                               

Ex 8 Use the Drop primitive and the Each operator to remove one       
character from the end of each word.  Which of the resulting character
vectors still contain extraneous characters? Suggest ways to get rid  
of all extraneous characters at once.                                 

Ex 9 Insert an extra space between two words in the sentence s, and   
call the new sentence s0.  For example:                               

	s0"Partition Count  is a dyadic function, while Partition is monadic."

Partition s0:                                                         

	w0(1,s0=' ')s0                                                    

Examine w0, and explain how the extra blank in s is manifested in w0. 
How would you remove it from the w0?                                  

Ex 10 Partition the vector s0 of Ex 9 as follows:                     

	w1(1,s0' ,.')s0                                                  

Examine w1, and explain how the punctuation characters, as well as the
extra blank, are manifested in w1.  How would you remove these        
characters from w1?                                                   

Ex 11 Suppose the leading character is a blank, i.e.  form            

	s1' ',s                                                             

Describe the result of                                                

	w2(1,s1' ,.')s1                                                  

Ex 12 How would you define a function to partition a sentence into    
words, when the punctuation characters can be commas, periods, and    
semicolons, and when there can be multiple blanks between words, and  
zero or mare blanks at the beginning and end of the sentence?         


5b.  Raze and Rake                                                    

The primitives Raze and Rake apply to nested arrays and bring all     
elements up level 0 and 1, respectively.                              

aplus-fsf-4.22/src/html/tutorials/RCS/0000777000265000001440000000000010774505345013324 5aplus-fsf-4.22/src/html/tutorials/RCS/Introduction.html,v0000444000265000001440000000613210774505344017050 head 1.2; access; symbols; locks; strict; comment @# @; 1.2 date 2008.04.01.19.20.02; author jmiz; state Exp; branches; next 1.1; 1.1 date 2008.04.01.19.18.25; author jmiz; state Exp; branches; next ; desc @@ 1.2 log @*** empty log message *** @ text @  
                                   Introduction 

All the tutorials are contained in:

    (Install_Directory)/doc/tutorials

By default the Install_Directory is /usr/local/aplus-fsf-x.xx 
(where x.xx is version.release)

i.e. /usr/local/aplus-fsf-4.xx/doc/tutorials/GettingStarted

This set of tutorials deals primarily with the A+ language. However,
the first one, GettingStarted, is designed to do just what its name
says, to introduce you to the A+ application development system in
which you will work.

If you are relatively new to programming in A+ or APL, or if you are
rusty, go on to ScalarFunctions. If you are familiar with APL,
however, go on to SimpleArrays instead and look for the differences
between A+ and the APL dialects you know.

A+ uses the special APL character set, which requires special key
sequences for entry; see the keyboard layout diagrams in Chapter 2
and Appendix B of the A+ Reference Manual.

                                                                         
                          A+ Language Tutorials                         
---------------------------------------------------------------------
| File           |Summary of Topics                                 |
|================|==================================================|
|GettingStarted  |Emacs and A+                                      |
|ScalarFunctions |Elementary A+                                     |
|Syntax          |Well-Formed A+ Expressions                        |
|SimpleArrays    |The Primitive Functions for Simple, Flat Data     |
|Assignment      |The Various Forms of Assignment, or Specification |
|NestedArrays    |The Primitive Functions for Composite Data        |
---------------------------------------------------------------------
                                                                         
In addition to these tutorials, there are two subdirectories:

- one containing tutorials for screen management and some material
  for examples, treating all classes except graphs (s.tutorials);
  start with s.tutorials/introduction;
- one containing a tutorial on the graph display class and a file of
  data for examples (graphs);

@ 1.1 log @Initial revision @ text @d20 1 a20 1 i.e. /usr/local/aplus-fsf-4.18/doc/tutorials/GettingStarted @ aplus-fsf-4.22/src/html/tutorials/RCS/GettingStarted.html,v0000444000265000001440000006123010774505342017315 head 1.2; access; symbols; locks; strict; comment @# @; 1.2 date 2008.04.01.19.20.02; author jmiz; state Exp; branches; next 1.1; 1.1 date 2008.04.01.19.18.57; author jmiz; state Exp; branches; next ; desc @@ 1.2 log @*** empty log message *** @ text @  
                                Getting Started

Summary

1.  Introduction

1a.  Key Press Notation

2.  Starting Up

3.  Documentation

3a.  Written Documentation

3a1.  Unix
3a2.  Emacs
3a3.  A+

3b.  Online Documentation

3b1.  Unix
3b2.  Emacs
3b3.  A+

4.  Exiting

4a.  Ending a Workstation Session

4b.  Ending an A+ Process

4c.  Ending an Emacs Session

4d.  Ending an Xterm Session

5.  The Emacs/A+ Interactive Environment

5a.  A+ Tutorials

5b.  A+ Scripts

5c.  A+ Sessions, Workspaces, and Log Files

5d.  The A+ Buffer in Emacs

5d1.  Setting the A+ Version
5d2.  Setting the A+ Host Machine
5d3.  Setting All Emacs Variables for A+ Mode

5e.  A Sample A+ Session


1.  Introduction

Xterm and Emacs entries, as well as section titles, are enclosed in
double quote marks when it helps to distinguish them from the
surrounding text.  The font in which the these tutorials appear on the
screen is in fact an APL font (kaplgallant); the distinction between
ordinary text and A+ expressions is usually clear from the context and
the use of special symbols.

It is possible that at some point, as you work through this tutorial,
you will find yourself out of step with the text.  Most likely, you
will be in an Emacs session at the time.  If that happens, exit from
the Emacs session and go back to a point in the tutorial where you can
start over.  The tutorial is not so long that this will be burdensome,
and it is definitely worthwhile to complete it successfully.


1a.  Key Press Notation

We will often use the notation Ctrl-, which means press and hold
the Control key and, while holding, press the key specified by .
For example, Ctrl-x means press and hold the Control key, and then
press the x key.  Similarly, Meta- means to press and hold the
Meta key, which is marked with a diamond, or "Left", or "Right." If
you are using an IBM keyboard, use Alt for Meta.

If the dash is omitted, as in Esc x, press and release the first key
(here Escape), and then press the other key (here x).

For the mouse, to "click" a button means to depress it and release it
quickly.  To "press" a button means to depress it and hold it until
you are told to release it. To "double-click" is to click twice in
quick succession.


2.  Starting Up

The purpose of this tutorial is to help people unfamiliar with the A+
system get up and running.

We are interested in two application windows in this tutorial.  One is
an Xterm.  This is an interactive window for executing Unix commands.
If you see an "Xterm" icon on the lower left, double-click on it and
an Xterm window will open.  Or, move the mouse pointer to the
background area, and then press and hold the right mouse-button to see
the main menu of applications.  Move the pointer to Xterm and release
the button, and an Xterm window will open.

You can start an A+ session in an Xterm session by entering:

/usr/local/bin/a+

Even though A+ started in an Xterm can be used interactively, the
preferred use is to run applications.  Interactive use of A+ is best
done in Emacs.

The Emacs editor window is the other application window of interest
here.  Once again, bring up the main menu of applications as you did
for Xterm.  Only now, move the pointer to Emacs/A+ and release the
button.  You can also start an A+ session within Emacs.  See "5. The
Emacs/A+ Interactive Environment".

If you now have both an Xterm and Emacs window on your screen then
most likely one overlaps the other.  


3.  Documentation

3a.  Written Documentation

3a1.  Unix

Unix is the operating system in which we work, and as an A+ programmer
you will most likely have to know the rudiments of the system.  The
following reference is recommended:

	The UNIX Programming Environment, by Kernighan and Pike

 	Prentice-Hall Software Series

It is also possible to display online documentation for Unix; see
"3b.Online Documentation".


3a2.  Emacs

The Emacs editor, which serves as the A+ application development
environment, is described in: 	

 	GNU Emacs Manual, by Richard Stallman

	Free Software Foundation

or

 	Learning GNU Emacs, by Cameron and Rosenblatt

 	O'Reilly and Associates, Inc.

3a3.  A+

3b.  Online Documentation

3b1.  Unix

There is substantial online documentation for Unix.  To view the
documentation on a particular topic from within an Xterm, enter the
command:

man topic

(man stands for manual pages).  For example, information on the Unix
command cp (for copying files) can be viewed as follows:

man cp

A formatted description of the topic will be displayed in the Xterm
window.  Press Ctrl-c to quit the display.  To learn more about manual
page command, enter:

man man

Another way to view manual pages is in a separate window, that can be
initialized from an Xterm by entering

xman &

(See the command Emacs & in "6c. More on Xterm" for the meaning of &.)
The effect of this command is to display a new window.  Click on the
"Manual Page" button in that window and a manual-page display will
appear, with help information in it.  Press and hold down the
"Options" button, drag the mouse pointer to search, and release.
Enter the topic whose manual pages you want to see, and press the
Enter key.

This display can also be obtained by pressing the right mouse-button
while the pointer is on the background area, moving the pointer to
"Tools" and then to the right and then down the submenu that appears
to "Manual Pages", and releasing the button.

If for some reason you want a print out of the online documentation,
e.g.  on the Unix command cp, enter the command:

man -t cp

The output should automatically be printed on the default local
printer in your area (see "6c. More on Xterm" regarding setting the
printer name).


3b2.  Emacs

Emacs has an online tutorial and online help.  Press Esc x, which will
move the keyboard cursor to the so-called minibuffer (the last line in
the Emacs window) with the prompt M-x.  Enter help- and press the
space bar.  That is, at the point where you should press the space
bar, the minibuffer should look like:

M-x help-

After you press the space bar you will see displayed the full names of
both the tutorial and online help.  Complete the name of the one you
want and press the Enter key.


3b4.  The Window Manager

The windows on your display are under the control of a program known
as a window manager.  T

4.  Exiting

4a.  Ending a Workstation Session

You can either log off the workstation, so that the next time you will
have to log on again and start from scratch, or you can lock the
workstation, which means that next time you simply unlock it and start
where you left off.


4b.  Ending an A+ Process

To end an A+ process without ending the Xterm or Emacs session in
which it is running, enter:

     $off

The next time you start an A+ process, the same log file (see "4c. A+
Sessions, Workspaces, and Log Files") will be active.  If you are also
going to end the Xterm or Emacs session, you may want to save the log
before you end the A+ process.


4c.  Ending an Emacs session

To end an Emacs session, press Ctrl-x followed by Ctrl-c.  You will be
prompted in the minibuffer to save any files that have been modified
since they were last saved.  In particular, if you have run A+ in this
session you will most likely be asked whether or not your A+ session
log should be saved:

Do you want to save .emacs_a? (Y/N)

You may want to answer Y to keep this log, at least for a while.  If
you answer N to any of these prompts, you will then be prompted as
follows:

Modified buffers exist, do you really want to exit? (yes or no)

Answer yes.  If you did not end your A+ session (see "4b. Ending an A+
Process"), you will then be prompted with:

Active processes exist; kill them and exit anyway? (yes or no)

Answer yes, and the Emacs window will disappear.

For a fast exit with no prompting, put the mouse pointer on the title
bar at top of the Emacs window and hold down the right mouse-button.
Move the pointer to "Quit" and release.


4d.  Ending an Xterm session

To end an Xterm session, move the mouse pointer to that window, and
press Ctrl-d.  Or, as with Emacs, put the mouse pointer on the title
bar at the top of the Xterm window and hold down the right mouse-
button.  Move the pointer to Quit and release.


5.  The Emacs/A+ Interactive Environment

The Emacs editor serves as the application development environment for
A+.  Bring up a new Emacs window, as described in the introduction.
The line next to the bottom line contains "Emacs: *scratch*".  The
area above this line is called a buffer.  The title of this buffer is
"*scratch*".  The bottom line of the window is called the minibuffer.

Press the function key F4.  The Emacs window should split into two
buffers.  The top buffer is now the scratch buffer, while the bottom
one is an A+ session with the buffer title "*a*".

The keyboard cursor is the solid, character-sized rectangle that
indicates where the next typed character will go.  The buffer
containing this cursor is called the "selected" buffer.  Pressing the
F6 key (see "5b. More on Emacs for information on the F5, F6 and F7
keys") repeatedly will toggle back and forth between the two buffers,
first selecting one and then the other.  Moving the mouse pointer into
a buffer and pressing the left mouse-button will also select that
buffer.

After you have pressed F4, the bottom buffer holds an interactive A+
session.  Select this buffer and you can enter A+ expressions for
evaluation.  If you were developing an A+ application then typically
you would select the top buffer and open an A+ script file for
editing.  Or, you might select an A+ tutorial instead.

To open a file in the selected buffer, press Ctrl-x followed by
Ctrl-f.  The minibuffer will automatically be selected and will
contain the prefix "Find file: ~/".  To open a file from your HOME
directory, simply enter its name and press the Enter key.  To open a
file in a subdirectory of your HOME directory, say the script
"filetest.+" in the directory "versiontests", enter
"versiontests/filetest.+".  To open a file in any other directory,
enter its full path and name, starting with /.  The initial / causes
Emacs not to include in the path the directory it identified in its
prompt.  For example, to open this tutorial, enter

(Install_Directory)/doc/tutorials/GettingStarted

If the file you name is found, it will be opened and displayed in the
top buffer.  Otherwise, the top buffer will appear to display an empty
file and, in addition, the message "(New File) "will be displayed in
the minibuffer.  In the latter case, the file will not be created at
this point; it will be created if and when you save it for the first
time.

Use the Home, PgUp, PgDn, arrow, and End keys to scroll through an
open file.

It is also possible to open a directory, in order to see the names of
the files it contains.  Once again, press Ctrl-x followed by Ctrl-f,
but in response to the prompt Find file: ~/, enter the directory name.
For example, to open the tutorial directory, enter

(Install_Directory)/doc/tutorials

You should then see a list of file names in the current buffer.  Any
file in the directory can now be opened simply by moving the keyboard
cursor onto the file name and pressing the f key.

Both A+ scripts and the tutorials contain executable A+ expressions
and function definitions.  An A+ expression that stands alone on a
line can be brought into the A+ buffer and executed simply by placing
the keyboard cursor on the expression and pressing F2.  (Once the top
buffer is selected, the keyboard cursor can be moved to the line
holding the expression with the arrow keys; or you can put the mouse
pointer on the expression and press the left mouse button.)  Note that
pressing F2 also causes the keyboard cursor to advance one line,
leaving you in position to bring the next line into the A+ session
with F2.

To bring an entire function definition into the A+ session, place the
keyboard cursor anywhere on the definition and press F3.  (If the
definition has only one line then F2 will do as well as F3.)
Unbalanced punctuation anywhere in the buffer above the function
definition, however, will prevent the function's being brought in.


5a.  A+ Tutorials

The A+ tutorials are located in
(Install_Directory)/doc/tutorials, where, for instance, you
will find the online version of this tutorial:

By default the Install_Directory is /usr/local/aplus-fsf-x.xx 
(where x.xx is version.release)

i.e. /usr/local/aplus-fsf-4.xx/doc/tutorials/GettingStarted

Open the file for this tutorial in the top buffer and use the
down-arrow key to scroll down to this point in the file.  You can then
bring the following examples into your A+ session using F2.

	a3 5
	a
	g{x}:x*2
	g a

You will notice that when the first, second, or fourth lines are
executed, the result is displayed immediately below (not shown here).
The third line holds a function definition, and there is no result to
display when the line is executed.  It is sometimes convenient to
display the result of an execution in the tutorial; you shouldn't
execute these lines.  In general, the A+ expressions that should be
executed are indented like those above.


5b.  A+ Scripts

A+ scripts define applications, toolkits, and utilities.  They consist
of global variable and function definitions, as well as expressions
for initialization.

Scripts are loaded into A+ sessions using the $load system command or
the _load system function.  For example, once an A+ session is begun,
if you plan to use the screen management facilities, then load them as
follows:

	$load s

Once a script is loaded, all the functions and global variables
defined in it are available, and all the executable statements it
contains have been executed.  Scripts can themselves include $load
commands and _load statements, so that applications can load the
toolkits and utilities they depend on, and need not incorporate them
directly in their scripts.

The effect of $load is by and large the same as if the script file
were opened in a buffer, the keyboard cursor were placed on the top
line, and F2 were held down until every line was brought into the A+
session.  (See the A+ Reference Manual for the differences.) In
particular, script files are processed line-by-line, starting at the
top.

When developing and maintaining an application you will usually open
its A+ script in the top buffer and selectively bring parts of it into
the A+ session using the F2 and F3 keys.  F2 can also be used to bring
a multi-line function definition into the A+ session, but line by
line.  This is particularly useful during debugging.  Start with the
keyboard cursor on the first line of a function definition and press
F2 for each line.  (Or, simply hold F2 down and it will automatically
go from one line to the next.) As each line is brought in, its display
in the A+ session has a prefix of *'s on the left, one for each level
of unbalanced, nested parentheses, braces, or quotation marks (but not
brackets).

For example, consider the function definition

	penny x:{
	  m0.01;
	  i1;
	  while (m



@


1.1
log
@Initial revision
@
text
@d379 1
a379 1
i.e. /usr/local/aplus-fsf-4.18/doc/tutorials/GettingStarted
@
aplus-fsf-4.22/src/html/tutorials/ScalarFunctions.html0000444000265000001440000010607310750123133016563 


   
   


 

                                    Scalar Functions
Summary

1.  Introduction

2.  Constants

2a.  Numeric Constants

2b.  Character Constants

2c.  Symbol Constants

2d.  Nested Constants

3.  Scalar Functions

4.  Arithmetic Scalar Functions

5.  Operators

5a.  Reduction

5b.  Outer Product

5c.  Scan

5d.  Inner Product

6.  Selection and Assignment

7.  Relational Scalar Functions

8.  Logical Scalar Functions

8a.  Reduction Revisited

8b.  Scan Revisited

9.  Elementary Algebraic and Transcendental Scalar Functions

10.  Miscellaneous Scalar Functions

10a.  Absolute Value and Residue

10b.  Signum

10c.  Floor and Minimum

10d.  Ceiling and Maximum

10e.  Roll

11.  Tables

Table 1.  Scalar Functions

Table 2.  Operators on Scalar Functions


1.  Introduction

This tutorial is for the reader who has little or no experience with
programming in APL-like programming languages.  The scalar functions
exhibit many of the qualities that make A+ an effective programming
language, while at the same time being generally familiar, so this is
a good place to start.

As you will learn, many program fragments in A+ can be stated in a few
expressions that do not include explicit control statements.  This
expressiveness sometimes depends on using A+ primitive functions in
ways that are not apparent from their definitions.  So, don't expect
to see all or even most uses of the A+ primitive functions in these
tutorials.  The tutorials are meant to introduce you to the language
and some of its uses, but when you're done many surprises will still
lie ahead.  Who would want it otherwise?

This tutorial is made up of textual descriptions and A+ examples.  To
execute the examples conveniently you should set up your Emacs
environment to have two visible buffers, one holding the tutorial and
the other an A+ session.  If you are currently reading this in Emacs,
simply press F4.

The examples consist of indented A+ expressions and their values.
Sometimes the text refers to the values, and it is helpful to have
them handy, but the main reason they are displayed is to help you
become familiar with A+ in the Emacs environment.  In the later
tutorials the values usually do not appear in the text.  You should
evaluate the indented expressions, and compare the results in the A+
session with those in the text.

For example, when you see a display of the form

	1 2+3 4
 4 6

the indented expression 1 2+3 4 is the one to bring into the A+
session for evaluation.  The second expression, 4 6, is the result of
executing the indented expression and should not be brought into the
A+ session for evaluation.

To bring individual expressions from the tutorial into the A+ session,
place the cursor on the expression and press F2.  When an expression
is brought into A+ in this way, it is automatically evaluated, and its
value is displayed.  The displayed value should be identical to the
display in the tutorial.

If you need more help on running Emacs and A+, see the "Getting
Started" tutorial.  If you want to try your hand at devising your own
A+ expressions, see the keyboard layout diagrams in Chapter 2 and
Appendix B of the A+ Reference Manual.

2.  Constants

2a.  Numeric Constants

There are several preliminary things to discuss.  First of all, a list
of numeric constants can be entered on a line by separating the
individual numbers with blanks, as in

	3 4.5 7
 3 4.5 7

This is a list of the three numbers, 3, 4.5 and 7.  Secondly, negative
numbers are denoted by a raised minus sign.  For example:

	5+2
 3

Exponential notation can be used for fractional, or floating-point,
numbers, as in

	1.23e5
 123000

which is 1.23 times 10 to the 5, or 123000.  Negative exponents are
denoted with the usual minus sign, not the raised minus sign, so that

	2000e-2
 20

is negative 2000 times 10 to the negative 2, or negative 20.

2b.  Character Constants

A single character is entered surrounded by quotation marks, and a
list of characters is entered in exactly the same way.  For example:

	'axcdert'
 axcdert

Either single quotes or double quotes can be used, but they must both
be the same.  For example:

	"axcdert"
axcdert

It is interesting to see how a quotation mark can be included in a
list of characters.  If a single quotation mark is to be included,
surround the list with double quotes; if a double quote mark is to be
included, surround the list single quotes.  For example:

	'He said, "Oh no!"'
He said, "Oh no!"

	"I can't go."
I can't go.

The question then becomes, how are both quotation marks included in
the list?  The answer is that the one that is identical to the quotes
surrounding the list must be doubled.  For example:

	'"I can''t go either," he said.'
"I can't go either," he said.

2c. Symbol Constants

A symbol constant is of the form backquote,characters.  An example is
`ThisIsASymbol.  It provides a form that enables rapid comparison and
is convenient for aggregation.  A vector of symbols can be written
simply by juxtaposing them, with or without blanks between them:

	`s1 `s2`s3   `s4 `s5`s6
 `s1 `s2 `s3 `s4 `s5 `s6

2d.  Nested Constants

In addition to numeric, character, and symbolic data, A+ has nested,
or boxed, data.  Nested data comes in lists, like numeric, character,
and symbolic data, except that the elements are not restricted to
individual numbers, characters, or symbols; they can be anything.  For
example:

	(2 3.5 7;'dfgtyuh')
<  2 3.5 7
< dfgtyuh

This constant has two elements.  The < in the display indicates that
what follows is a boxed element.  An easy way of producing nested
arrays is to use strand notation, as in the example.  It is of the
form (...;...;...) and its value is a list, or vector.  The successive
elements of this list are the enclosures, or boxed forms, of the
successive expressions between semicolons or between a semicolon and a
left or right parenthesis.


3.  Scalar Functions

For convenience, the scalar functions have been divided into
categories that may be familiar to you.  The arithmetic functions are
Plus, Minus, Times and Divide.  The relational functions are Equal to,
Not equal to, Less than, Less than or Equal to, Greater than, and
Greater Than or Equal to.  The logical functions are And, Or, and Not.
The elementary functions are Power, Log, and certain trigonometric and
algebraic functions.  Finally, there is a miscellaneous set.  The
names and symbols of the scalar functions are summarized in Table 1,
at the end of the tutorial.

The expressive power of the scalar functions in A+ is largely due to
useful variations provided by operators.  "5. Operators" introduces
Reduction, Scan, Outer Product and Inner Product.  Table 2, at the
end of the tutorial, tells which of these operators apply to which
scalar functions.


4.  Arithmetic Scalar Functions

The common arithmetic operations are examples of scalar functions in
A+.  They are Plus (+), Minus (-), Times (), and Divide ().  They
apply to individual numbers, as in:

	3+4
 7

and they apply to lists in an element-by-element fashion.  For
example:

     	2 5 7 + 10
 12 15 3

In this example the three numbers, 2, 5, and  7, are added to 10.
The result is a list of three numbers.  The spaces around the symbol +
are meant as an aid to readability and are not necessary.

A list of numbers can appear on the right of the operation symbol as
well as the left, as in the following subtraction example:

      200 - 27 34.56 1.521e2 129
 173 234.56 47.9 71

and there can be lists on both sides of the symbol:

      2 7 9  10 3 4
 20 21 36

When there are two lists, i.e., more than one element on each side,
the number of elements must be the same on each side.

The operation of negation is denoted by - in mathematics, and in A+ as
well.  For example:

      - 3 6.7 12 102 1e-3 3.4e3
 3 6.7 12 102 0.001 3400

The use of one symbol to denote two operations, such as the - symbol
for subtraction and negation, is carried over in A+ to almost all its
primitive operations.  For example,  denotes both division and the
taking of reciprocals, as in:

      2 3 10  5 6 5
 0.4 0.5 2

and

 	 5 10 12
 0.2 0.1 0.08333333333

The number or list of numbers that appears to the left of a symbol is
called the left argument of the operation.  That which appears to the
right is called the right argument.  The two together are referred to
as the arguments of the operation.

When there are two arguments, the operation is said to be dyadic.
When an operation has only argument, when nothing appears to the left
of its symbol that could serve as the left argument, it is said to be
monadic.  Symbols, such as -, that have both a monadic and dyadic use
are called ambivalent.  Most primitive function symbols in A+ are
ambivalent.

It is time to adopt some conventional A+ terminology.  The common
mathematical term for +, -,  and  is operation.  Operations are
examples of the general mathematical notion of function, but the term
operation is quite commonly used in mathematics when the symbol for
the dyadic function appears between the arguments.  However, in A+ we
tend to use the more general term "function", even for the arithmetic
operations.  This may be due to the fact that A+ also has operators,
another common mathematical concept, and the use of two closely
related terms can be confusing.  Whatever the reason, we will adopt
the A+ convention, and from now on we will refer to the arithmetic
operations as functions, and in particular as scalar functions.

Ex 1.  A mistake that is often made concerning numeric constant lists
such as

	1 5 12 21

is to attach functional significance to the spaces between items.  Now
that we have seen how scalar functions are evaluated, we can examine
this common pitfall.  For example, one might expect to be able to form
the list consisting of 5 plus 23, 24 minus 13, and 10 times 6 simply
by putting these expressions on a line separated by blanks, as in:

	5+23 24-13 106

To understand how this expression is evaluated you need to know the
following (see the Syntax tutorial for a general discussion):

    the first thing done in evaluating this expression is to form
       the constant 13 10;
    the next thing done is to form the constant 23 24;
    next, the function  is evaluated;
    then -;
    and finally +.

Use these rules and your knowledge of scalar functions to evaluate
this expression by hand.  Check your answer by bringing this
expression into the A+ session for evaluation with F2.

The next common expectation is to be able to put each of the
expressions 5 plus 23, 24 minus 13, and 10 times 6 in parentheses, and
then put these three parenthesized expressions on a single line
separated by blanks, as in:

	(5+23) (24-13) (106)

But this is an invalid expression, and an attempt to evaluate it will
result in an error message:

PARSE +...  : var?

or, in Version 3,

[parse] +... : var?

To put the results of individual expressions like these three together
in a list, you must use the function designed for that purpose, which
is called Catenate and is denoted by the comma.  Use F2 to evaluate
the following expression:

	(5+23),(24-13),(106)

Ex 2.  Write two expressions for a 5-element list whose first two
elements are those of the list 14+4 8 and whose last three elements
are those of the list 4 9 12-3 10 7.


5.  Operators

In mathematics, operators are objects that act on functions to produce
new functions.  A+ has several operators that act on scalar functions.
We will introduce them here for the arithmetic functions, and return
to them later as more scalar functions are introduced.


5a.  Reduction

The slash (/) denotes an A+ operator called reduction.  For example,
+/ denotes + reduction, and / denotes  reduction.  The function
symbol always appears to the left of the slash.  The functions +/ and
/ are called derived functions because they are derived from other
functions, namely + and .  A hint at how these derived functions are
defined is that +/ is also called summation.

	+/3 5 8 12
 28
	3+5+8+12
 28
	+/1 2 3 4 5 6 7 8 9 10
 55
	1+2+3+4+5+6+7+8+9+10
 55

That is, +/ takes the sum of all elements in a list.  The reduction
operator applies uniformly to all functions whose symbols are
permitted to the left of the  slash (see Table 2), so you should
suspect that  reduction takes the product of all elements in a list.

	/3 5 8 12
 1440
	35812
 1440
 	/1 2 3 4 5 6 7 8 9 10
 3628800
 	12345678910
 3628800


5b.  Outer Product

The symbols .  denote the operator called outer product.  .+ is
called the outer product of + and . is called the outer product of
.  The outer product operator is sometimes called the table maker,
and here is an example:

	1 6 2 3.+4 10 3
  5 11  4
 10 16  9
  2  8  1
  7 13  6

When you execute the above outer product expression you will see the
four separate lines displayed below the expression.  These four lines
are the rows of a table.  You will note that the numbers in these rows
line up vertically.  The aligned vertical lists are the columns of the
table.  This table contains all combinations of sums of elements from
the list on the left with elements from the list on the right.  For
example, the number at the third row, second column of the table is 8.
By definition, it is the sum of the third element of the list on the
left, 2, and the second element of the list on the right, 10.
Pictorially:

	 +   4 10  3
	------------
	 1   5 11  4
	 6  10 16  9
	2   2  8  1
	 3   7 13  6

Like reduction, the outer product operator applies uniformly to all
functions whose symbols are allowed to the right of the .  (see Table
2).  For example, the tables produced by . contain all
combinations of products, as in:

	1 6 2 3.4 10 3
   4  10   3
  24  60  18
  8 20  6
  12  30   9


5c.  Scan

The backslash (\) denotes the A+ operator called scan.  Scan is a
companion of reduction: for example, while + reduction gives the sum
of a list of numbers, + scan gives the running, or partial, sums:

	+\1 3 5 2 6
 1 4 1 1 7
	+/1
 1
	+/1 3
 4
	+/1 3 5
 1
	+/1 3 5 2
 1
	+/1 3 5 2 6
 7

Note that something new about reduction has come up.  Namely, +
reduction of a single number is that number.  In fact, this is true
for any reduction.  This is a separate definition from the one for
lists with at least two elements, because there aren't enough elements
to put the function symbol between.


5d.  Inner Product

The fourth and last operator to be introduced here is inner product,
denoted by the dot (.).  Unlike the other operators, inner product
applies to a pair of scalar functions.  For example, the inner product
of + and  is denoted by +..  The function +. is dyadic, and when
applied to lists, as in a+.b, is equivalent to +/ab.  For example:

	34 1 5 12+.3 14 10 5
 78

and
	34 1 5 123 14 10 5
 102 14 50 60
 	+/ 102 14 50 60
 78

Inner products also apply to tables, and when +. is applied to tables
it is equivalent to the ordinary matrix product in linear algebra.


6.  Selection and Assignment

Variables can be assigned values by placing their names to the left of
the assignment arrow and the values to the right.  For example:

	a12 23.921 83214       No value is displayed for assignment.

Enter the name alone on a line, press the Return key, and the value
will be displayed:

	a
 12 23.921 83214

Once a variable has a value individual elements can be replaced.  For
example:

	a[1]1024.7              No value is displayed for indexed assignment.

 	a

 12 1024.7 83214

Individual elements can be selected as well:

	a[1]

 1024.7

 	a[2 1]

 83214 1024.7		 Elements can be selected in any order.

Note that for the purposes of selection and assignment, the first
element is element number 0, the second element is element number 1,
and so on.  These numbers are called the indices of the elements.  For
example, in the above list a:

   12 is the element at index 0
   1024.7 is the element at index 1, and
   83214 is the element at index 2.

Note that not only can elements be replaced, but the entire value can
also be replaced:

	a'x'                     No value is displayed for assignment.
 	a
x


7.  Relational Scalar Functions

The mathematical relations (=, , <, , >, ) are ordinary scalar
functions in A+.  They apply to lists of numbers in the same way as
the arithmetic functions.  They return boolean results, i.e.,  the
numbers 0 and 1, where 1 indicates that the relation holds, and 0 that
it does not.  For example:

	3 10<7 4
 1 0

The value 1 0 expresses the fact that 3 is less than 7 but 10 is not
less than 4.  Equal to and Not equal to apply to lists of characters
and nested lists as well as lists of numbers.  For example:

	'a'='xcade'
 0 0 1 0 0
	'a''xcade'
 1 1 0 1 1
	(1 2 3;'abcdef')=(1 2 3;'fed')
 1 0

The advantage of the relations' being functions is that they can then
be used in ordinary, mathematical-like expressions.  For example, to
evaluate the sum of the positive numbers in a list named w:

	w1 2 4 12 0 7 14 2 3
	+/(w>0)w
 31

Here is how it works.  The subexpression w>0 produces a list of 1's
and 0's; the 1's appear wherever the elements of w are positive.  Then
since 1 times any number is that number and 0 times any number is 0,
an element of (w>0)w is equal to the corresponding element of w when
the latter is positive, and 0 when it is 0 or negative.  Since 0's do
not contribute to a sum, +/(w>0)w is the sum of the positive elements
of w.

	w>0
 1 1 0 1 0 0 1 1 0
	(w>0)w
 1 2 0 12 0 0 14 2 0
 	+/(w>0)w
 31

Note that the last expression is equivalent to the following inner
product:

	(w>0)+.w
 31

The outer product operator also applies to relational functions as
well as the arithmetic ones.  For example, we can answer the following
question: how many times does each character in a list occur in that
list? The answer for:

	x'ancahac'

is 3 1 2 3 1 3 2.  That is, reading the list of characters from left
to right, there are three a's, one n, two c's, three a's again, one h,
three a's again, and two c's again.  (The matter of removing
repetitions from the list of character counts is discussed in the
"Simple Arrays" tutorial).

We can use the outer product of = to compare every character of x to
every other character.

	x.=x
 1 0 0 1 0 1 0
 0 1 0 0 0 0 0
 0 0 1 0 0 0 1
 1 0 0 1 0 1 0
 0 0 0 0 1 0 0
 1 0 0 1 0 1 0
 0 0 1 0 0 0 1

The following display shows how the elements of x are related to the
elements of the outer product result.

	=  a n c a h a c
	-- --------------
	a  1 0 0 1 0 1 0
	n  0 1 0 0 0 0 0
	c  0 0 1 0 0 0 1
	a  1 0 0 1 0 1 0
	h  0 0 0 0 1 0 0
	a  1 0 0 1 0 1 0
	c  0 0 1 0 0 0 1

If we look down any column of the outer product table, we see 1's
whenever a character in the list x matches the character at the head
of the column.  If we sum the 1's in that column, we get the number
characters in x that match the character at the head of the column.
Of course the sum of the 1's in a column is simply the sum of the
column because the other elements are 0.  Therefore, + reduction of
the columns gives us the answer:

	+/x.=x
 3 1 2 3 1 3 2

You may have noticed that the table is symmetric.  That is, we could
just as well have summed the rows of the table to get the result.
However, reduction applies to the columns by default.  We will see how
to apply reduction to the rows of a table in the "Simple Arrays"
tutorial.


8.  Logical Scalar Functions

The logical functions are And and Or, and are denoted by ^ and .
They apply to boolean values and produce boolean values.  They are
defined as follows:

	0^0 equals 0			00 equals 0
	0^1 equals 1^0 equals 0		01 equals 10 equals 1
	1^1 equals 1			11 equals 1


We say that the result of ^ is "true" (i.e., 1) if both its arguments
are true; the result is "false" if at least one argument is false.
Similarly, the result of  is true if at least one argument is true;
the result is false if both arguments are false.

The logical functions are often used to form compound relational
expressions.  For example, the following expression tests whether or
not one of the two numbers c and b is greater than 10 (first giving c
and b values so that the test can be evaluated):

	c5
 	b11
	(c>10)(b>10)
 1

If you wanted to know whether or not both c and b are greater than 10,
the test expression would be:

	(c>10)^(b>10)
 0

Note: the way to read A+ expressions is from left to right.  For
example, the above expressions is "c greater than 10 and b greater
than 10."

If either c or b (or both) are lists the situation is more complicated
because the value of the expression will be a list of boolean values
stating whether the individual elements of c and b satisfy the test.
For example:

	c5 21 7 50
	b2 10 20 17
	(c>10)(b>10)
 0 1 1 1
	(c>10)^(b>10)
 0 0 0 1

Consequently, depending on the problem at hand, you will usually want
to know if all the individual relations hold , or if at least one
does.  However, many other conditions can arise, such as knowing that
at least two of the individual relations hold.  Using only what we
know now about A+, we can determine the number of individual relations
that hold by summing the boolean lists (the sum of a boolean list is
the number of 1's in the list, which is the number of individual
relations that hold).

To sum the individual relations in the above expressions:

	+/(c>10)(b>10)
 3
	+/(c>10)^(b>10)
 1

To test whether or not at least one of the individual relations holds:

	1+/(c>10)(b>10)
 1
	1+/(c>10)^(b>10)
 1

(Reading the last expression from left to right: "1 less than or equal
to the sum of the relation: c greater than 10 and b greater than 10.")

To test whether or not at least two of the individual relations hold:

	2+/(c>10)(b>10)
 1
	2+/(c>10)^(b>10)
 0

Testing whether or not all the individual relations hold can be done
in the same general way as above, but it's a little trickier.
Besides, it's time to introduce another way to do all these tests (see
"8a. Reduction Revisited".)

Before continuing with the reduction examples, there is a third
logical scalar function to be introduced here, which is the monadic
function called Not, or logical negation, and denoted by ~.  The value
of ~0 is 1 and that of ~x for any nonzero integer x is 0.  Both ^ and
 also apply to all integers, not just 0 and 1, but the extended
definitions are different in Versions 2 and 3.  For Version 3 they are
analogous to Not.  For Version 2 see the March 1994 A+ Reference
Manual.


8a.  Reduction Revisited

The reduction operator applies to both ^ and .  Like plus and times,
^ reduction can be defined by putting ^ between the consecutive
elements of a list, as in:

	^/1 1 0 1
 0
 	1^1^0^1
 0

 reduction is similar:

	/1 1 0 1
 1
	1101
 1

In order to understand ^ and  reduction, consider evaluating +
reduction by placing the + symbol between all pairs of consecutive
elements of a list, as follows:

	a+b+c+d+e+f+g

Compute the sum any pair of consecutive elements, and then replace the
+ symbol and the two summands with the result.  (Any pairs can be used
because all the functions that are permitted in reductions are
associative.)  For example, let h be d+e, so the above expression
becomes:

	a+b+c+h+f+g

We now have a list of the same form as the original, but with one fewer
element and one fewer + symbol.  If the process is repeated, the same
thing happens, and eventually all that is left is a single element and
no + symbols.  That single element is the result of the + reduction.

The same procedure works for evaluating ^ reduction and  reduction.
Using it, we can verify the following rule:

	The result of ^ reduction is 1 when all the elements in the list
	are 1, and only then.

To verify this rule, consider:

	1^1^1^1^1^1^1^1
 1

Evaluate any one of the ^'s and you get a 1.  Replace the 1^1 you
evaluated with that result and you will have the same expression as
before, only with one less element and one less ^.  Continue
evaluating and eventually you will get to 1.

Now put a 0 anywhere in the original list:

	1^1^1^1^0^1^1^1
 0

No matter what order you evaluate the individual ^'s, eventually you
must come to either 1^0 or 0^1.  Either one evaluates to 0, and the 0
replaces either 1^0 or 0^1.  Either way, there is still a 0 in the
list, and eventually you will get to a result of 0.

As an exercise, use this line of argument to verify the following
rule:

	The result of  reduction is 0 when all the elements in the list
	are 0, and only then.

Using these rules, we can see how two of the above tests can be
rewritten.  Namely, the rule for  reduction says that the result of 
reduction is 1 if any elements in the list are 1.  Consequently, a
test of whether or not at least one of the individual relations holds
is:

	/(c>10)(b>10)
 1

Analogously, a test of whether or not all the individual relations
hold is:

	^/(c>10)(b>10)
 0


8b.  Scan Revisited

Now that we understand ^ reduction and  reduction, let's look at ^
scan and  scan.  Starting with ^ scan, consider the following
example:

	^\1 1 1 0 1 1 0 1
 1 1 1 0 0 0 0 0

To understand this result, look at the individual ^ reductions that
make it up:

	^/1
 1
	^/1 1
 1
	^/1 1 1
 1
	^/1 1 1 0
 0
	^/1 1 1 0 1
 0
	^/1 1 1 0 1 1
 0
	^/1 1 1 0 1 1 0
 0
	^/1 1 1 0 1 1 0 1
 0

Reading the elements of the scan result from the left, all the
corresponding elements of the ^ scan are 1 until the first 0 in the
argument is encountered.  Once the first 0 is encountered in the
argument list, all elements in the scan will be 0 from that point on,
no matter what else occurs.

As an example of the use of ^ scan, and based on the above
interpretation, if x is a boolean list, then +/^\x is the index of the
first 0.  For example:

	x1 1 1 0 1 1 0 1
	+/^\x
 3
	x[0 1 2 3]
 1 1 1 0

Consequently, if x represents a list of relations, then +/^\x is the
index of the first relation (reading the list from the left) that
fails to hold.  For example:

     	m5 21 7 50 8
     	p2 10 20 17 12
	p     |Greater  |        |
      |      |       |         |            |      |       |than     |        |
      | E    |      |Log      |Natural Log | R    |      |Greater  |        |
      |      |       |         |            |      |       |than or  |        |
      |      |       |         |            |      |       |Equal to |        |
      | E    |      |Circle   |Pi tImes    | L    | ^     |And      |        |
      |      |       |fns      |            |      |       |         |        |
      | M    |      |Max      |Ceiling     | L    |      |Or       |        |
      | M    |      |Min      |Floor       | L    | ~     |         |Not     |
      | M    |      |Residue  |Absolute    |      |       |         |        |
      |      |       |         |value       |      |       |         |        |
      | M    | ?     |         |Roll        |      |       |         |        |
      | M    |      |Combine  |            |      |       |         |        |
      |      |       |Symbols  |            |      |       |         |        |
      -------------------------------------------------------------------------



          Table 2: Operators on Scalar Functions
-----------------------------------------------------------
|Operator       |Forms                                    |
|===============|=========================================|
|Reduction      |  +/   /   ^/   /   /   /            |
|Scan           |  +\   \   ^\   \   \   \            |
|Outer Product  |  .+   .-   .   .   .   .   .|
|               |  .=   .  .<   .   .>   .       |
|Inner Product  |  +.   .+   .+                        |
-----------------------------------------------------------
aplus-fsf-4.22/src/html/tutorials/SimpleArrays.html0000444000265000001440000012050407232115441016077  
                                      Simple Arrays  

Outline                                                               

1. Introduction                                                       

2. Creating Test Arrays                                               

The primitive functions illustrated in this section are:              
	Reshape: Dyadic                                                      
	Interval: Monadic                                                    
	Roll and Deal: Monadic and Dyadic ?                                   
	Assignment: Dyadic                                                   

3. Characteristics of Arrays                                          

The primitive functions illustrated in this section are:              
	Shape: Monadic                                                      
	Indexing: [;;]                                                       
	Count and Choose: Monadic and Dyadic #                                
	Type: Monadic                                                        

4. Scalar Functions                                                   

5. Structural Functions and the Items of Arrays                       

The primitive functions illustrated in this section are:              
	Take and Drop: Dyadic  and                                          
	Replicate and Expand: Dyadic / and \                                  
	Reverse and Rotate:Monadic and Dyadic                                
	Catenate: Dyadic ,                                                    
	Laminate: Dyadic ~                                                    

6. Reduction and Scan                                                 

7. Frames and Cells                                                   

7a. The Primitive Functions Member Of and Index Of                    

7b. The Rank Operator                                                 

8. Idioms and Phrases                                                 

8a. A To B                                                            

8b. Bar Graph                                                         

8c. Remove Duplicate Items                                            

8d. Append                                                            

8e. Eliminate Leading Blanks from a Vector                            

8f. Eliminate Trailing Blanks from a Vector                           

8g. Eliminate Multiple Blanks from a Vector                           

8h. Left Justify a Character Vector                                   

8i. Left Justify the Rows of a Character Matrix (preparation)         

8j. Left Justify the Rows of a Character Matrix Using the Rank        
    Operator                                                              


1. Introduction                                                       

These tutorials are designed not only to familiarize you with the A+  
language, but to help you adopt the attitude that much can be learned 
about A+ from experimentation. As you work on your programming        
assignments you will undoubtedly encounter A+ expressions, indeed     
entire functions, where you have no clue as to how they work. Often it
is not necessary to know how they work, since you will only have to   
use them as is. And often you will be too busy to figure them out at  
the moment. Even so, you should get in the habit of reserving time to 
work your way through such functions. What you will learn are new ways
to say things succinctly, new ways to say things in computationally   
efficient ways, and - this is rare, of course - some things not to do.
In that spirit, this tutorial begins with a section on creating test  
data. The test data created here is fairly simple, because we aren't  
looking at very specific things. In order to understand real          
applications, it's worthwhile to generate realistic test data,        
although it may be difficult, and you may learn something new while   
doing it.                                                             

Following the section on test data, there are several illustrating    
various things about various A+ primitives. The last section presents 
a series of basic A+ phrases, some sample test data, and some         
exercises to work through as you figure out what the expressions do   
and how they do it. Feel free to create your own test data and explore
the boundaries - shape, type, and values - of where the expressions   
work and where they don't work.                                       

With one exception, the A+ primitives discussed in this chapter       
correspond to APL\360, which is the common part of all commercial APL 
systems. Thus, if you have an APL background, this chapter will show  
you where A+ differs from what you already know about APL\360,        
although most times the comparisons are left to you to make. If you do
not have an APL background, the material in this chapter is a good    
place to start.                                                       

The exception referred above is the rank operator, which replaces the 
axis operator in APL\360, but is much more general in its application 
and much more effective.                                              

This tutorial is not meant to be self-contained. You may have to look 
things up in the A+ Reference Manual, particularly in the later       
sections. Also, while many of the test expressions can be executed    
using F2, as described in the Getting Started tutorial, others must be
typed in directly. Moreover, you must type in any test expressions of 
your own design, and any expressions that create your own test data.  
Consequently, you should have a printout of the A+ keyboard showing   
how to type the special graphic characters (see Chapter 2 and Appendix
B of the A+ Reference Manual).                                        


2. Creating Test Arrays                                               

The primitive functions illustrated in this section are:              
	Reshape: Dyadic                                                     
	Interval: Monadic                                                   
	Roll and Deal: Monadic and Dyadic ?                                  
	Specification: Dyadic                                               

In order to experiment with expressions in A+ it is very helpful to   
know how to produce test data, and the primitive functions illustrated
in this section are the basic tools for doing it.                     

Examples                                                              

Execute each of the following:                                        

	10 20 3 2		 A 4-element vector of 10, 20, 3, and minus 2.
	2 210 20 3 2		 10, 20, 3, minus 2 arranged 2-by-2. 
 	1025			 A vector of 10 copies of 25.
	?1025			 10 random numbers between 0 and 24.
	5 12			 The integers 0 through 59 arranged 5-by-12.
 	3 9100 		 A 3-by-9 matrix of 27 copies of 100.  
	?3 9100        	 27 random numbers between 0 and 99 arranged 
				   3-by-9.
 	20?100			 20 distinct random numbers between 0 and 99. 
 	100+52 3      	 100, 105, ..., 125 arranged 2-by-3.   
 	3 510 2 31 107 	 A 3-by-5 matrix filled with 10, 2, 31, and 
				   107, repeated as necessary. 
	'abcdefgh'    		 A vector of 8 characters. 
	4 2'abcef'     	 A 4-by-2 matrix filled with a, b, c, e, and 
				 f, repeated as necessary.
 	12.012 10e5   		 A vector of two floating point numbers. 
	5 7 3			 The integers 0 through 104 arranged
				   5-by-7-by-3. 
	a5 12			 The variable a now has the array value of 
				   the expression on the right of the arrow. 
	a               	 Enter the name alone and its value is 
				 displayed.   


3. Characteristics of Arrays                                          

The primitive functions illustrated in this section are:              
	Shape: Monadic                                                      
	Indexing: [;;]                                                      
	Count and Choose: Monadic and Dyadic #                               
	Type: Monadic                                                       

Some A+ Primitives deal with the most basic properties of arrays.     
Arrays have:                                                          

    shape, e.g. the number of rows and columns of a matrix;           
    count, e.g. the number of rows of a matrix;                       
    type,  this is, whether the elements are characters, integers, etc.

Not only can the shape of arrays be determined, arrays can reshaped   
into any shape (see the examples of dyadic  in the preceding         
section.) And, finally, their elements can be extracted, either one at
a time, or in contiguous blocks called subarrays.                     

Examples                                                              

Execute each of the following:                                        

	?1025                                                              
	?1025                                                              
	5 12                                                               
	5 12                                                               
	'abcdefgh'                                                          
	'abcdefgh'                                                          
	12.012 10e5                                                        
	12.012 10e5                                                        
	c'abcdefgh'		 Make a character vector c. 
	c[0]			 The first element in c. 
	0#c                                                                  
	c[7]			 The last element in c.   
	7#c                                                                  
	c[0 7 2 1]  		 4 elements of c in a 4-element vector.    
	0 7 2 1#c                                                            
	c[2 3 7 2 3 3 1 5]	 6 elements of c arranged 2-by-3, with 
				   element 3 repeated. 
	#c                                                                   
	(2 3 7 2 3 3 1 5)#c	                                                
	xy?4 675		 Make an integer matrix xy.  
	xy[2;3]			 The element at row 2, column 3.   
	(2;3)#xy                                                             
	xy[2;3 0 4]		 The elements at row 2, columns 3, 0 and 4.  
	(2;3 0 4)#xy                                                         
	xy[1 2 0;3]		 The elements at rows 1, 2 and 0, column 3. 
	(1 2 0;3)#xy                                                         
	xy[0 2;0 2 1]		 The cross-section of rows 0 and 2 and 
				   columns 0, 2 and 1.
	(0 2;0 2 1)#xy                                                       
	xy[0 2 0;]		 Rows 0, 2 and 0 again. 
	(0 2 0;)#xy                                      
	xy[;4 1]		 Columns 4 and 1.  
	(;4 1)#xy                          
	xy[0 2 1]		 Rows 0, 2 and 1.
	0 2 1#xy                                                             

The shape of an array x, as evaluated by x, is a vector. It therefore
has a shape of its own, which is x. x is called the rank of x. The
rank of x is the number of axes of x. Execute each of the following:  

	xy                                                                 
	4 5                                                               
	'abcdeftg'                                                         
	1 2 6 10                                                          
	4                                                                  

The last example illustrates an array of rank 0, which is called a    
scalar. A scalar has no axes, and therefore can't be indexed with     
bracket indexing. The shape of a scalar is an empty vector. For       
example, execute:                                                     

	4                                                                   

and nothing prints out in your A+ session (there is a "new line",     
however, which puts the next prompt two lines down instead of one.)  	


4. Scalar Functions                                                   

This tutorial assumes that you are familiar with the idea of scalar   
functions and how they apply to arrays (see the A+ Reference Manual or
the Scalar Functions tutorial).                                       


5. Structural Functions and the Items of Arrays                       

The primitive functions illustrated in this section are:              
	Take and Drop:  and                                                 
	Replicate and Expand: / and \                                         
	Reverse and Rotate:                                                  
	Catenate: ,                                                           
	Laminate: ~                                                           

The complementary notions of leading axis and items are important in  
understanding how many of the structural functions in A+ work (a      
structural function is one that rearranges the elements of arrays, but
does not change their values. For example, 10x is not a structural   
function because it multiplies the values of the elements of x by 10.)

The leading axis of an array in the first one indexed. For example, in
a[i;j;k] the leading axis is the one indexed by i; in b[n;m] it is the
one indexed by n; in c[v] it is the only axis. The items of an array  
are the subarrays obtained by indexing the array with an index        
expression having the following properties:                           

    the leading axis is indexed with a single, scalar value;          
    all other axes are indexed with null.                             

For example, all the following index expressions produce items.       
Execute them:                                                         

	m3 5                                                               
	m[0;]                                                                
	m[2;]                                                                
	a5 2 7                                                             
 	a[3;;]                                                              
	a[1;;]                                                               
	v10                                                                
	v[1]                                                                 
	v[8]                                                                 

In fact, items are such an important idea in A+ that there is a       
special, bracket notation for producing them, no matter what their    
rank. Repeating the above examples:                                   

	m[0]                                                                 
	m[2]                                                                 
	a[3]                                                                 
	a[1]                                                                 
	v[1]                                                                 
	v[8]                                                                 

Most A+ structural primitive functions apply along the leading axes of
their right arguments and rearrange the items of that argument. The   
following are good test values to see how items are rearranged by     
these primitive functions. Bring them into the A+ session with F2.    

Examples                                                              

	v10                                                                
	m10 10                                                             

Ex 1.  denotes the dyadic primitive function called take. For a      
positive left argument n, the result is the first n items of the right
argument. For example, execute:                                       

	3v                                                                  

Since  is defined in terms of the items of the right argument, what  
do  expect 3m to be? Confirm your guess by evaluating the expression.

Ex 2. Experiment with nv and nm when n is greater than 10. Describe 
what you see in terms of items. Will this be true for character arrays
too? What is true for character arrays?                               

Ex 3. When n is negative, na is the last -n items of a.  For example,
try                                                                   

	4v                                                                 

 What do you expect 4m to be?                                       

Ex 4. Repeat Ex 2 when n is negative and less that 10.               

Ex 5. 0a is an empty array, and consequently you cannot learn much by
looking  at it. Still, 0a is consistent with na for nonzero n,      
relative to its type  and shape. Use the above test data and create   
some of your own to compare 0a and a, as well as 0a and a.      
Describe what you see, and in  particular describe 0a in terms of   
the shape of the items of a.                                          

Ex 6.  denotes the dyadic primitive function called drop. For a      
positive left argument n, the result is all but first n items of the  
right argument.  Both its symbol and definition suggest that it is a  
complementary function  to take. Rephrase Ex 1 - Ex 4 for drop and    
then do them.                                                         

Ex 7. Ex 5 deals with 0a. Without testing it, describe what you think
0a is. Now test it. Fill in the indicated expression below:          

	0a equals ( )a                                                     
                    ^                                                  
                    What goes here?                                    

Ex 8. More generally, for n0 fill in the indicated expression:       

	na equals ( )a                                                     
                    ^                                                  
                    What goes here?                                    

Ex 9. Fill in the expression in Ex 8 so that it works for both        
negative integers n as well.                                          

Ex 10. Look up the definitions of replicate and expand, rotate and    
reverse. Be sure you understand how they apply to the items of their  
right arguments  (or, in the case of reverse, to its only argument.)  

Ex 11. Repeat Ex 10 for catenate. Note that catenate has an           
interesting special case when one argument has rank one less than that
of the other one: the argument of lesser rank must have the same shape
as the items of the other argument. For example, suppose that the     
argument of smaller rank is a. Then the definitions of both a,b and   
b,a are reduced to the equal rank case by  replacing a with (1,a)a. 

Ex 12. The primitive function called laminate, which is denoted by ~, 
is an  interesting variation in the way it uses the concept of items. 
Namely, it  is dyadic and applies to arrays with the same shape. It   
produces an array with two items, which are identical to the two      
arguments. For example:                                               

	1 2 3 ~ 4 5 6                                                        

When one of the arguments is a scalar, that argument is reshaped to   
the shape of the other. For example:                                  

	1 2 3 ~ 4                                                            
and                                                                   
	3 ~ 4 5 6                                                            

Test this primitive with other arrays. Try to answer the following    
little  puzzle: for which arrays x and y are the results x,y and x~y  
identical?  When you find the answer, you will have found the case    
where the general  definition of catenate based on items breaks down. 
It is a useful special  case, but one you must watch out for in       
expressions that apply catenate to arrays of varying rank.            


6. Reduction and Scan                                                 

Reduction is an example of a mathematical entity called an operator,  
and  it is called an operator in A+ as well. The operator is denoted  
by /, and  it applies to certain scalar functions to produce a new    
function, called  a derived function. For example, +/ is the derived  
function for + and is  called + reduction, or summation. If v is a    
numeric vector then +/v sums the items of v. E.g., +/3 5 7 is 15. That
is:                                                                   

	+/v equals v[0]+v[1]++v[1+#v]                                      

This definition holds for v of any rank because v[i] denotes the ith  
item of v, no matter what the rank.                                   

Scan is also an operator. For example, +\ is the derived function for 
+ and is called partial sums. If v is a numeric vector then +\v is the
partial sums of the items of v. E.g., +/3 5 7 is 3 8 15.              

See the Scalar Functions tutorial for an introduction to these        
operators.                                                            

Ex 13. Make sure you understand that reduction and scan apply to the  
items of  arrays. Test your understanding with matrices and arrays of 
rank two and three  (e.g., 3 5 and 3 5 2.)                          


7. Frames and Cells                                                   

Frames and cells are a more general way of partitioning arrays than   
leading axis and items. For example, consider:                        

	a3 8 4                                                             

The array a has three axes. In an index expression of the form        

	a[i;j;k] 	 This expression is not executable unless 
			   i, j, and k are given values.       

The axis indexed by i is called the leading axis. If i is a scalar,   
the subarrays a[i;;], or equivalently a[i], are the items of a. In    
terms of frames and cells, the leading axis is the frame of rank 1 and
the items are the cells of rank 2.                                    

Similarly, the first two axes are the frame of rank 2. If both i and j
are scalars then the subarrays a[i;j;], or equivalently a[i;j], are   
the cells of rank 1.                                                  

To complete the picture:                                              

	the three axes of a are the frame of rank 3 and the scalar 
	elements are the cells of rank 0;

	the empty set of axes is the frame of rank 0 and the array
	a itself is the cell of rank 3.

The rank of the frame plus the rank of the cells within that frame    
equals the rank of the array. Instead of always referring explicitly  
to the rank of the frame and the rank of the cells, it is sometimes   
convenient to refer to "the frame for the cells of rank n", or the    
"the cells within the frame of rank k."                               

The concepts of frame and cells are useful in explaining several A+   
primitives. We will look at these primitives before the main topic of 
this section, which is the rank operator.                             


7a. The Primitive Functions Called Member Of and Index Of             

In its simplest form, where the arguments are scalars or vectors, the 
result of Member Of is a boolean vector where 1's mark the elements of
the left argument that appear in the right. For example:              

	1 5 4 10 9  9 7 5                                                 
 0 1 0 0 1                                                            

More generally, the definition of the function yx is this: let N     
denote the rank of the items of the right argument x, and let S denote
their shape. Then the left argument y must have rank at least N, and  
the N cells of y must have shape S. If so, yx is defined and is a    
boolean array; its shape equals the shape of the frame for the cells  
of rank N; and an element of the result is 1 if the corresponding cell
is identical to at least one item of the right argument x, and 0      
otherwise.                                                            

Ex 14. Let's see if we understand the definition of Member Of. Define 

	x3 4                                                               
	y6 4  1 10 5 2 8 9 10 11 17 0 1 9 5 4 6 7 0 1 2 3 7 9 1 0       

and look at these arrays by executing the following:                  

	x                                                                    
	y                                                                    

Since the rank of y equals the rank of x, the cells of y that are     
relevant to yx are just the items of y. Before evaluating yx, can   
you predict the rank of the result? The shape? The value? Evaluate yx
to check your answer.                                                 

Ex 15. Replace y in the Ex 13 as follows:                             

	y3 2 4y                                                            

Now, what is the rank of the cells of y that are relevant to yx. What
is rank of the frame that holds these cells? What is the shape of the 
frame? What is the rank and shape of the result yx? What is the      
value? Evaluate yx to check your answer.                             

Ex 16. Replace y in the Ex 14 as follows:                             

	y8 9 10 11                                                          

Repeat Ex 14.                                                         

Ex 17. Index of is similar to Member Of. It is denoted yx. There are 
two basic differences in the definitions. One, the roles of the left  
argument and right argument are interchanged from those of Member Of. 
That is, in Member Of, cells of the left argument are compared to     
items of the right. In Index Of, however, cells of the right argument 
are compared to items of the left. The second difference is that the  
value of Index Of is an array of integers: if a cell of the right     
argument is identical to an item of the left argument, the            
corresponding element of the result is the index of that item; if it  
matches more than one item, the element is the smallest index among   
those it matches; if there is no match, the element is the number of  
items in the left argument.                                           

Here's a simple example:                                              

	'mxaz'  'O1zAx'                                                     
 4 4 3 4 1                                                            

Make sure you understand this result.                                 

Ex 18.  Form x and y as in Ex 13. Describe the result of xy in terms 
of the items of x and the appropriate cells of y.                     

Ex 19. Form y as in Ex 14, and then describe the result of xy in     
terms of the items of x and the appropriate cells of y.               

Ex 20. Form y as in Ex 15, and then describe the result of xy in     
terms of the items of x and the appropriate cells of y.               


7b. The Rank Operator                                                 

By now you should appreciate the uniformity with which many of the A+ 
primitive functions apply to the items of their arguments. You may    
also be wondering whether or not this is too restrictive. For example,
what does one do to catenate one matrix to another row-by-row, instead
of itemwise? Well, the answer to this question lies in another        
operator, called the rank operator and denoted by @.                  

The definition of the rank operator is based on the concepts of frames
and cells, which were just introduced. In effect, the rank operator   
specifies the rank of the cells to which a monadic function is to be  
applied, or the ranks in the case of a dyadic function.               

Ex 21. One of the easiest ways to see how the rank operator applies is
with  reduction. For example, execute:                                

	+/3 5 8                                                            

The result shows that the leading axis disappears; it is the axis over
which  the reduction took place. Now execute:                         

	(+/@ 1)3 5 8                                                       

The expression +/@ 1 means that reduction will be applied to cells of 
rank 1 of the array 3 5 8. (The parentheses around +/@ 1 in the above
expression are not necessary, but have been included for emphasis.)   
The cells of rank 1 are vectors along the  last axis. The last result 
shows that the last axis is the one over which the  reduction took    
place.                                                                

Now here is the challenge: execute the following and explain what you 
what see:                                                             

	(+/@ 2)3 5 8                                                       

Hint: Answer the following questions. What are cells of 3 5 8 to     
which the reduction is applied? What is the result when ordinary      
reduction is  applied to those cells?                                 

Here are two more challenges: compare 3 5 8 and (+/@ 0)3 5 8 and    
explain what you see; compare +/3 5 8 and (+/@ 3)3 5 8 and explain  
what you see.                                                         

Ex 22. In the rank operator we specify the function to be applied and 
the  rank(s) of the cells to which it applies. For example:           

	a3 4'abcdefghujkl'                                                 
	b3'ABC' 	                                                          

The expression                                                        

	a(,@1 0) b                                                           

expresses the catenation of the rank 1 cells of a to the rank 0 cells 
of b.  That is, each row of a is catenated to the corresponding       
element of b.  Evaluate this expression and make sure that you        
understand what you see.                                              

The rule of frames is:                                                

	When the Rank operator is applied dyadically, the shape of the       
	corresponding frames must be equal,                                   

	if they are of the same rank, and otherwise the shape of the 
	frame of lower rank, say r, must equal the last r dimensions 
	of the shape of the other frame.               

Define                                                               

	c'zyxwvut'                                                          

Evaluate a(,@1 1)c and explain what you see in terms of the rule of   
frames.                                                               

Ex 23. For each of the following expressions explain what you think   
the result should be. Test your understanding by evaluating the       
expressions:                                                          

	a(@,2 2) b                                                           
	a(@,0 0) b                                                           
	a(,@1 0)'MNO'                                                        
	a(,@0 1)'MNO'                                                        
	a(,@2 0)'MNO'                                                        

Consult the A+ Reference Manual regarding 3-element data operands and 
negative elements of data operands.                                   


8. Idioms and Phrases                                                 

The purpose of this section is to illustrate the expressiveness of A+ 
and to help you get in the habit of experimenting with the A+         
expressions you come across in order to understand them. Most topics  
begin with one or more A+ expressions, followed by test data in a     
subsection called Example(s). Use F2 to first bring in the test data, 
and then go back to the expressions themselves and apply F2 to them to
see what they do.                                                     


8a. A To B  Make a vector of integers from a to b, where a is less    
than or equal b.                                                      

	a+1+b-a                                                             

Example                                                               

	a10                                                                 
	b17                                                                 

Ex 24. Modify this expression using max () and min () to work       
whether a is less or equal b, or vice versa.                          

Ex 25. Repeat using absolute value (monadic ) and signum (monadic ) 
in place  of  and .                                                 


8b. Bar Graph                                                         

This example uses the outer product operator (denoted by .). For     
example, .+ is the outer product of +. It is a dyadic function. x.+y
forms an array consisting of the sums of all pairs of elements        
consisting of one from x and one from y. See the Scalar Functions     
tutorial for an introduction to the outer product operator.           

Here is a use of another outer product:                               

	' '[v./v]                                                       
or                                                                    
	' '[(/v).v]                                                     

Example                                                               

	v?2020                                                             

Ex 26. Execute the above expressions for the test data and explain    
what you see. In particular, what role does /v play?                


8c. Remove Duplicate Items                                            

	((vv)=#v)/v                                                        

Example                                                               

 	v?3010                                                            

Ex 27. The sample data is guaranteed to have duplicates. Why?         

Ex 28. The key here is the expression (vv)=#v. To understand what's 
going on, execute vv and #v separately so that their elements line  
up. Explain how duplicates can be identified by examining these two   
rows. (If the elements do not line up, execute                        

	(vv)~#v                                                            

Why does this work)?                                                  

Ex 29. Try the above expression on matrices:                          

	v(3 5'abcdefghijklmno')[?83]                                      

Explain what you see.                                                 


8d. Append                                                            

	d(1#a)#b                                                          

	(d(@0 1)a),db                                                      

Example                                                               

	a'abcdfgeh'[?4 58]                                                 
	b'ABCDEFGHIJK'                                                      

Ex 30. Experiment with da vs. d(@0 1)a. Describe the differences.   
The symbol @ denotes the Rank operator. The notation @0 1 signifies  
"the rank of  applied to scalar (rank 0) items on the left and vector
(rank 1) items on  the right."                                        

Ex 31. Modify the expressions in this section to apply to a matrix b? 


8e. Eliminate Leading Blanks from a Vector                            

	((v' ')1)v                                                        
or                                                                    
	(\v' ')/v                                                          
or                                                                    
	(+/^\v=' ')v                                                        

Example                                                               

	v'   abc de f'                                                      

Ex 32. Experiment with the expression (v' ')1 and describe its      
behavior.                                                             

Ex 33. Experiment with the boolean expression \v' ' and describe its
behavior.                                                             

Ex 34. Experiment with the boolean expression ^\v=' ' and describe its
behavior.                                                             


8f. Eliminate Trailing Blanks from a Vector                           

You will write the expressions in this exercise.                      

Example                                                               

	v'std sqz  dabc  '                                                  

Ex 35. Use rotate (monadic ) to modify the expression (\v' ')/v so 
that trailing blanks are removed.                                     

Ex 36. Use rotate (monadic ) and anything else to modify the         
expression (\v' ')/v so that trailing blanks are removed.           

Ex 37. Repeat the last exercise for (+/^\v=' ')v.                    


8g. Eliminate Multiple Blanks from a Vector                           

	((1z)1z1,' 'w)/w                                               

Example                                                               

	w'   srt  5cp   qrsx  '                                             

Ex 38. Examine the boolean expression (1z)1z by first evaluating  
1z and  then 1z. Their elements should line up in the display, so  
that you can compare them quite easily. Explain how this expression   
removes duplicate blanks.                                             

Ex 39. What is role is played by the catenation by 1 in 1,' 'w? 
Suppose the 1 is replaced with 0. How does this change things?     


8h. Left Justify a Character Vector                                   

	((v' ')1)v                                                        
or                                                                    
	(+/^\v=' ')v                                                        

Example                                                               

  	v'   abc de f'                                                    

Ex 40. Compare these expressions to the ones used for eliminating     
leading blanks. Explain the difference between the effect of          
eliminating leading blanks and left justifying. Hint: in left         
justification, where do the blanks go?                                


8i. Left Justify the Rows of a Character Matrix (preparation)         

	(m' ')1                                                            
or                                                                    
	+/^\m=' '                                                            

Example                                                               

	m3 5'  abcd e f ghij'                                              

	m                         Display m for reference below.             
  abc                                                                 
d e f                                                                 
 ghij                                                                 

Ex 41. Test these expressions for the sample data. If the expression  
executes successfully, explain whether it applies to the rows or      
columns of m.                                                         

Ex 42. If an expression applies to the columns of m, modify the       
expression using monadic transpose () (see the A+ Reference Manual)  
so that it applies to the rows.                                       


8j. Left Justify the Rows of a Character Matrix Using the Rank        
Operator                                                              

	f{x}:((x' ')1)x                                                   
	(f@1) m                                                              

Example                                                               

	m3 5'  abcd e f ghij'                                              

Ex 43. Explain (f@1) m.                                               

Ex 44. Use the rank operator in the same way to extend the other      
expression for left justifying vectors to one that applies to         
matrices.                                                             

Ex 45. Here is a challenge for using the rank operator. Instead of    
defining the function f above and applying the rank operator to it,   
figure out how to apply the rank operator to the primitive functions  
in the expression  ((m' ')1)m, so that the result justifies the    
rows of a matrix.                                                     

aplus-fsf-4.22/src/html/tutorials/Syntax.html0000444000265000001440000012454710737166267015005  
                                  The Syntax of A+    

Summary                                                               

1.  Introduction                                                      

2.  Names and Symbols                                                 

2a.  Primitive Functions                                              

2b.  User Names                                                       

2c.  System Names                                                     

2d.  System Commands                                                  

2e.  Comments                                                         

3.  Infix Notation and Ambivalence                                    

4.  Syntactic Classes                                                 

4a.  Numeric Constants                                                

4b.  Character Constants                                              

4c.  Symbol Constants                                                 

4d.  The Null                                                         

4e.  Variables                                                        

4f.  Functions                                                        

4g.  Operators and Derived Functions                                  

5.  Defined Functions                                                 

6.  Dependencies                                                      

7.  Bracket Indexing                                                  

8.  Strands                                                           

9.  Precedence Rules                                                  

10.  Right-to-Left Order of Execution                                 

11.  Control Statements                                               

11a.  Case Statement                                                  

11b.  Do Statement                                                    

11c.  If Statement                                                    

11d.  If-Else Statement                                               

11e.  While Statement                                                 

12.  Execution Stack References                                       

13.  Well-Formed Expressions                                          


1.  Introduction                                                     

The purpose of this tutorial is to describe the syntax of A+ through a
series of examples, rather than in a formal way.  Some commonly       
understood terms are used without being formally defined.  In         
particular, the phrase A+ expression, or simply expression, is taken  
to have the same general meaning it does in mathematics, namely, a    
well-formed sentence that produces a value.  A brief discussion of    
well-formed expressions is presented at the end, after all the rules  
for the components of expressions have been presented.                

Not all aspects of A+ syntax are discussed here; see the chapter on   
syntax in the A+ Reference Manual, and the Assignment tutorial.       

Although this tutorial is primarily concerned with syntax, examples   
require some knowledge of their meaning.  Each example will be fully  
explained, but comprehensive treatments of topics other than syntax   
are left to the other language tutorials.                             

The tutorial is made up of textual descriptions and A+ examples.  You 
should set up your Emacs environment to have two visible buffers, one 
holding the tutorial and the other an A+ session.  If you are         
currently reading this in Emacs, simply press F4.                     

To bring individual expressions from the tutorial into the A+ session,
place the cursor on the expression and press F2; for function         
definitions place the cursor anywhere in the definition and press F3. 
It is assumed that the expressions and functions are brought into the 
A+ session when you first encounter them, unless there are explicit   
directions to the contrary.                                           

If you need more help on running emacs and A+, see Getting Started.   
If you want to try your hand at writing your own A+ expressions, see  
the keyboard layout diagrams in Appendix B of the A+ Language Manual. 

If you need more help on running Emacs and A+, see the Getting Started
tutorial.                                                             


2.  Names and Symbols                                                 

One of the most basic things to know is how things are named.  There  
are no exercises in this section, just information you will need      
later.                                                                


2a.  Primitive Functions                                              

A+ uses a mathematical symbol set to denote the functions that are    
native to the language, which are called primitive functions.  This   
symbol set, which is the APL character set, consists of common        
mathematical symbols such as + and , commonly used punctuation       
symbols, and specialized symbols such as  and .  In some cases it   
takes more than one symbol to represent a primitive function, as in   
+/, but the meaning can be deduced from the individual symbols.       


2b.  User Names                                                       

User names fall into two categories, unqualified and qualified.  A    
valid, unqualified name is made up of alphanumeric (alphabetic or     
numeric) characters and underbars (_).  The first character must be   
alphabetic.  For example, a, a1c, and a_1c are valid unqualified      
names, but 3xy and _xy are not.                                       

A valid qualified user name is either an unqualified user name        
preceded by a dot (.), or a pair of unqualified user names separated  
by a dot.  In either case there are no intervening blanks.  For       
example, .xw1 and w_2.r2_a are valid qualified user names.            


2c.  System Names                                                     

System names are unqualified names preceded by an underbar, with no   
intervening spaces.  For example, _argv is a valid system name.  The  
use of system names is reserved by A+.                                


2d.  System Commands                                                  

System commands begin with a dollar sign, followed immediately by an  
unqualified name, which is the name of the command.  The name is      
followed by a space, and then possibly by a sequence of characters    
whose meaning is specific to the command.  For example $fns is a valid
system command.                                                       


2e.  Comments                                                         

Comments can appear on a line by themselves or to the right of any    
expression.  They are indicated by the  symbol, and everything to the
right of this symbol is the comment.  For example:                    

	23	 This is the A+ notation for multiplication.                    


3.  Infix Notation and Ambivalence                                    

A+ is a mathematical notation, and as such uses infix notation for    
functions with two arguments.  That is, the symbol or user name for a 
function with two arguments appears between them.  For example, a+b   
denotes addition, a-b subtraction, ab multiplication, and ab        
division.  In mathematics, the symbol - can also be used with one     
argument, as in -b, in which case it denotes negation.  This is true  
in A+ as well.  Because the symbol denotes two functions, one with one
argument and the other with two, it is called ambivalent.             

A+ has extended the idea of ambivalence to most of its primitive      
functions.  For example, just as -b denotes the negative of b, b     
denotes the reciprocal of b.                                          

User defined functions cannot be ambivalent.                          

Functions with one argument are called monadic, and functions with two
arguments are called dyadic.  For a primitive function symbol, one    
often refers to its monadic use or dyadic use.                        

Ex 1.  Execute each of the following using F2.  After each one is     
executed, you will see the result displayed immediately below.        

	52                                                                  

	2                                                                   

A more interesting example, perhaps, is the primitive function denoted
by the down arrow (meta-u on the keyboard).  The dyadic form is      
called Drop because it has the effect of dropping a specified number  
of elements from a list.  For example, if x is the name of a variable 
containing the list of five characters a, b, c, d, and e, then 2x    
drops the first two characters from the list, leaving a list of the   
three characters c, d, and e.  The monadic form of  is called Print  
because its effect is to display its argument in the A+ session log.  
For example, execute the following:                                   

	5(2)                                                               

and you will see 2 displayed, followed by the result of the           
expression.  The print primitive, like all primitives, produces a     
result, and that result is used in further execution.  Unlike most    
primitives, it also has a side effect, which is the display of its    
argument in the session log.                                          

Ex 2.  What do you think the result of x is? Describe it in terms of 
x.                                                                    


4.  Syntactic Classes                                                 

4a.  Numeric Constants                                                

Individual numbers can be expressed in the usual integer, decimal, and
exponential formats, with one exception: negative number constants    
begin with a "high minus" sign () instead of the more conventional   
minus sign (-).  Negative exponents in the exponential format are     
denoted by the conventional minus sign.                               

It is also possible to express a list of numbers as a constant, simply
by separating the individual numbers by one or more blank spaces.  For
example:                                                              

	1.23 7 45 3e-5                                                      

is a numeric constant with four numbers: 1.23, negative 7, 45, and    
0.00003.                                                              

Ex 2.  Most likely you are familiar with numeric formats, and by the  
end of this tutorial you should be experimenting with expressions of  
your own creation, so we will use numeric constants to illustrate how 
to deal with ill-formed expressions.                                  

The high minus sign is not used for exponents.  Execute the following 
to see a parse error message:                                         

	1e2                                                                 

Ex 3.  Constants can have more than one element, as illustrated above.
As a single number, 1.2.3 is ill-formed, but A+ parses this sequence  
as if it were a list of numbers.  Execute the following and explain   
what you see:                                                         

	1.2.3                                                                

Ex 4.  Constants can be put inside parentheses, which does not effect 
their value, but gives us a way to illustrate syntax errors.  Execute 
the following:                                                        

	2.109)                                                               

You will see a syntax error message saying that the right parenthesis 
has no matching left.  Now execute                                    

	(2.109                                                               

You will now see a *.  The display of a * by the A+ in circumstances  
like these indicates suspended execution.  The reason that this       
expression results in suspended execution instead of a syntax error is
that it is viewed by the A+ process as incomplete.  More characters   
could have been appended on its right side to form a complete         
expression, which is not true of the first expression, 2.109).  Select
the A+ buffer, and the keyboard cursor should then be positioned to   
the right of the *.  Enter the closing right parenthesis and press the
Return key.  You will see 2.109 displayed, just as if you had entered 
the syntactically correct expression (2.109) all on one line.         

Select the tutorial buffer to continue.                               

The A+ language processor accepts expressions that occupy more than   
one line.  However, expressions cannot be broken in the middle of     
names, or numeric constants, or primitive functions that require more 
than one character, and their must be a reason for A+ to expect a     
continuation, such as open punctuation.                               

Ex 6.  This exercise is a variation of the last one.  Execute the     
expression:                                                           

	(2.109                                                               

Once again you will see a *.  Select the A+ buffer and enter ( instead
of ).  Press the Return key.  You will now see two *'s.  There are two
points to be made here.  First, the number of *'s indicates the level 
of suspension.  It now takes two actions to clear the suspended       
execution, e.g.  two closing parentheses.  Second, suppose entering   
the second ( was a mistake, and you simply want to clean things up and
start over.  To do this you should enter a right pointing arrow       
(meta-] on the keyboard) next to the two *'s, and press the Return    
key.  Do that, and then select the tutorial buffer to continue.       


4b.  Character Constants                                              

A character constant is expressed as a list of characters surrounded  
by a pair of single quote marks or a pair of double quote marks.  In  
order to include the surrounding quote mark in the list of characters,
it must be doubled.  For example, both 'abc''d' and "abc'd" are       
constant expressions for the list of characters abc'd.                

Ex 5.  Execute each of the following to see how ' and " are handled:  

	'Aed"ss'                                                             

	"Aed'ss"                                                             

The following will cause errors:                                      

	'Aed'ss'                                                             

	'Aed' 'ss'                                                           

Explain the error reports.  Clear any suspended executions, and return
to the tutorial buffer.                                               

Ex 6.  What do you think happens if you break an A+ expression in the 
middle of a character constant?.  Execute the expression:             

	'abcd                                                                

and you will see the suspension indicator.  To the right of it enter: 

*	2345'                                                               

The result will now be displayed.  Explain what you see.  For that    
purpose, note that the symbol # applied monadically to a list of      
characters yields the number of characters in the list.  For example: 

	#'sdTvw'                                                             

 5                                                                    

Repeat the above example using # as follows:                          

 	#'abcd                                                              

*	2345'                                                               

 9                                                                    

Explain the result.                                                   


4c.  Symbol Constants                                                 

A symbol is a backquote (`) followed immediately by a character string
made up of the alphabetic characters, underscores (_), and dots (.).  
A symbol constant can be thought of as a character-based counterpart  
to numeric constants.  Just as 1 2.34 12e3 is a list of three numbers,
`a.s `12 `w_3 is a list of three symbols.                             


4d.  The Null                                                         

The Null is a special constant formed as follows: ().  It is neither  
numeric nor character, but has a special type reserved for it alone.  


4e.  Variables                                                        

Variables are named data objects.  They receive their values through  
assignment, or specification, which is denoted by the left-pointing   
arrow ().  For example, the expression                               

	abc1 2 3                                                            

assigns the three-element list consisting of 1, 2, and 3 to the       
variable named abc.  Any valid user name can serve as a variable name.

For more on assignment, see the Assignment tutorial.                  


4f.  Functions                                                        

Functions take zero or more arguments and return results.  A sequence 
of characters that constitutes a valid reference to a function will be
called a function call expression.  That is, a function call          
expression includes a function symbol or name together with all its   
arguments and all necessary punctuation.  In general, the arguments of
a function are data objects, which may appear in function call        
expressions as variable names, constants, or expressions that require 
evaluation.  In addition, for the various forms of function call      
expressions using braces, arguments can also be functions.            

A function with no parameters - which must be a user defined function 
- is said to be niladic.  The valid function call expression for a    
niladic function f is f{}.                                            

Functions with one argument can be either primitive or user defined.  
The valid function call expressions for a function f with one argument
a are f a and f{a}.  In the form f a, the space is required if, when  
it is omitted, the result would be a valid name, as plus 2.3.         

Functions with two arguments can also be either primitive or user     
defined.  The valid function call expressions for a function g with   
two arguments a and b are a g b and g{a;b}.  a is called the left     
argument and b is called the right argument.  The rule for required   
spaces in the dyadic form a g b is the same as for the monadic form f 
a.                                                                    

Functions with more than two arguments must be user defined.  The     
valid function call expression for a function of more than two        
arguments a, b, ..., c is f{a;b;;c}.                                 

For function call expressions that use braces and contain at least two
arguments, any of the positions between neighboring semicolons, or    
between the left brace and the first semicolon, or between the last   
semicolon and the right brace, can be left blank.  For example, each  
of the following is a valid function call expression: f{a;}, f{;b},   
f{;a;b}, f{;;b}, etc.  However, if f is monadic then f{} is not valid,
because f{} is a niladic function call expression.  When an argument  
position is legitimately left blank, A+ assumes that the argument is  
the Null.                                                             

The number of arguments of a function is called its valence.  The     
valence of a user defined function is fixed by the form of its        
definition.                                                           

Ex 7.  Use F2 to define the following dyadic function:                

	a f b:a-b                                                            

and then evaluate the following function call expressions:            

	2 f 5                                                                

	f{2;5}                                                               

(Function definitions are discussed in Defined Functions.) Explain the
meaning of                                                            

	-{2;5}                                                               

and then execute it for verification.                                 

Ex 8.  Define the following function:                                 

	g{a;b;c}:(a;b;c)                                                     

As will be explained later, the result of this function is a data     
aggregate with three elements, which are the arguments to the         
function.  For example, execute:                                      

	g{1;2;3}                                                             

and you will see displayed three lines, with <  1, <  2, and <  3.    
The symbol < indicates that the data being displayed is part of an    
aggregate.  Now execute:                                              

	g{;2;3}                                                              
	g{1;;3}                                                              

and you will see that wherever an argument is omitted, the            
corresponding output line is < followed by blanks.  This indicates    
that the omitted arguments are taken to be the Null (however, the same
display line could represent other things as well, such as a blank    
list of characters.)                                                  


4g.  Operators and Derived Functions                                  

There are two formal, primitive operators in A+, known as Rank and    
Each.  By a formal operator we mean an operator in the mathematical   
sense, i.e.  a function that takes a function as an operand, or       
produces a function as a result, or both.  The resulting function is  
called a derived function.                                            

The Each operator is denoted by the dieresis, .  For a given function
f, the function derived from the Each operator is denoted by f.  The 
function f can be either monadic or dyadic, in which case so is f.   

The Rank operator is denoted by the at symbol, @.  Unlike the Each    
operator, the Rank operator has both a function argument and a data   
argument.  For a given function f and data value a, the function      
derived from the Rank operator is denoted by f@a.  f can be either    
monadic or dyadic, in which case so is f@a.                           

Ex 9.  The Rank and Each operators modify their function argument to  
produce some variant of that function.  For example, use F2 to        
execute:                                                              

	(2;3)+4                                                              

You should see the error message +: type, which in this case means    
that + does not apply to data aggregates.  Following the message is a 
line with a *, indicating suspended execution.  Clear the suspension  
and return to the tutorial.  Now use F2 to execute:                   

	(2;3)+4                                                             

Explain the result you see.  What do you think the following          
expressions produce? Evaluate them to confirm your guesses.           

	(2;3)+4 5                                                           
	(2;3)+(4;5)                                                         

Reduction, Scan, Outer Product, and Inner Product are not operators,  
strictly speaking: they do not accept all functions as operands.  The 
ones they do accept are shown in Table 2-2.  Because these character  
sequences look so much like derived functions, however, we will use  
the term operator to include these four as well as the primitive Each 
and Rank operators and user defined operators.                        

Ex 10.  Many of the symbols in should be familiar, but some may not   
be.  For example,  (meta-d on the keyboard) and  (meta-s) denote the
Minimum and Maximum functions, respectively, when used dyadically.    
Execute the following expressions:                                    

	35                                                                  
	35                                                                  
	/1 2 3 4 5                                                          
	/1 2 3 4 5                                                          
	+/1 2 3 4 5                                                          

Explain how the functions /, /, and +/ are variants of the functions
, , and +.  Feel free to experiment with other arguments.  Remember,
if you make error and execution is suspended, enter the right arrow   
(meta-]) to get out of it.                                            


5.  Defined Functions                                                 

A function definition consists of a function header, followed by a    
colon, followed by either an expression, or an expression block, which
is a series of expressions separated by semicolons and enclosed in    
braces and represents a sequence of statements to be executed.        

Function headers take the same forms as function call expressions (see
Functions above), except that no argument may be omitted.  A function 
header has the monadic form, dyadic form, or general form.  The       
monadic form is the function name followed by the argument name, with 
the two names separated by at least one space.  For example, if the   
function name is correlate then                                       

	correlate a:{...}                                                      

is a function definition with the monadic form of the header.         

The dyadic form of function header is the function name with one      
argument name on each side, with the names separated by at least one  
blank.  For example:                                                  

	a correlate b:{...}                                                    

is a function definition with the dyadic form of the header.          

The third form of function header is the general form, which is the   
function followed by a left brace, followed by a list of argument     
names separated by semicolons, and terminated with a left brace.  For 
example:                                                              

	correlate{a;b;c}:{...}                                                 

is a function definition with the general form of the header.  In this
example the function has three arguments.                             

A function with one argument can be defined with either the monadic   
form of function header, or the general form, and analogously,        
functions with two arguments can be defined with either the dyadic    
form or general for.  Regardless of which way they are defined, they  
can be called either way.                                             

Ex 8 provides an example of a defined function.  The result of that   
function is the value of the (a;b;c).                                 


6.  Dependencies                                                      

A dependency definition consists of a name (the name of the           
dependency), followed by a colon, followed by either an A+ expression,
or an expression block.                                               


7.  Bracket Indexing                                                  

A+ data objects are arrays, and bracket indexing is a way to select   
subarrays.  Bracket indexing uses special syntax, whose form is       

	x[a;b;;c]                                                           

where x represents a variable name and a, b,,c denote expressions.   
The space between the left bracket and the first semicolon, between   
successive semicolons, and between the last semicolon and the right   
bracket, can be empty.                                                

Ex 16.  This exercise takes us into the subject matter of the other   
language tutorials, but it is interesting to see what it means to     
leave the spaces in the bracket index expression empty.  Execute the  
following:                                                            

	3 4                                                                 

and you will see a matrix with three rows and four columns, populated 
by the numbers 0 through 11.  Execute each of the following and       
explain what you see:                                                 

	(3 4)[0;0]                                                          
	(3 4)[2;3]                                                          
	(3 4)[1;1 3]                                                        
	(3 4)[1;3 1]                                                        
	(3 4)[1;]                                                           
	(3 4)[;2]                                                           
	(3 4)[;]                                                            


8.  Strands                                                           

Aggregate data objects can be formed by separating the individual data
objects with semicolons and surrounding the collection of data objects
and semicolons with a pair of parentheses.  For example:              

	(a;b;...;c)                                                            

where a,b,...,c denote expressions.  Any of these expressions can be  
function expressions.                                                 

See Ex 8.                                                             


9.  Precedence Rules                                                  

The precedence rules in A+ are simple:                                

	all functions have equal precedence, whether primitive, defined, 
	or derived                                                               

   	all operators have equal precedence                                

   	operators have higher precedence than functions                    

	the formation of numeric constants has higher precedence than         
	operators.                                                            

Ex 11.  Execute the following:                                        

	1 2+3 4                                                              

The result indicates that the constant with the two numbers 1 and 2,  
and the constant with the two numbers 3 and 4, are formed before + is 
applied.  Do you see how this is related to the above rules?          


10.  Right-to-Left Order of Execution                                 

The way to read A+ expressions is from left to right, like English.   
For the most part we also read mathematical notation from left to     
right, although not strictly because the notation is two-dimensional. 
To illustrate reading A+ expressions from left to right, consider the 
following examples.                                                   

	a+b+c                                                                

Read as: "a plus the result of b plus c."                             

	x-y                                                                 

Read as: "x minus the reciprocal of y."                               

As you can see, reading from left to right in the suggested style     
implies that execution takes place right to left.  In the first       
example, to say "a plus the result of b plus c" means that b+c must be
formed first, and then added to a.  And in the second example, to say 
"x minus the reciprocal of y" means that y must be formed before it  
is subtracted from x.                                                 

Of course, reading from left to right is not necessarily associated   
with execution from right to left.  For example, the expression ab+c 
is read left to right in conventional mathematical notation as well as
A+, but the order of evaluation is different in the two; in           
mathematics a divided by b is formed and added to c, while in A+, a is
divided by b+c.  The order of execution is controlled by the relative 
precedence of the functions, or operations.  In mathematics, divide   
has higher precedence than plus, which means that in ab+c, divide is 
evaluated before plus.                                                

Another way to say that A+ expressions execute from right to left is  
that A+ has long right scope and short left scope.  For example,      
consider:                                                             

	a+b-cef                                                            

The arguments of the minus function are b on the left (short scope)   
and cef on the right (long scope.) The left argument is found by    
starting at the - symbol and moving to the left until the smallest    
possible complete subexpression is found.  In this example it is simply
the name b.  If the first non-blank character to the left of the      
symbol had been a right parenthesis, then the left argument would have
included everything to the left of the right parenthesis, up to the   
matching left parenthesis.  For example, the left argument of minus in
a+(xb)-cef is xb.                                                 

The right argument is found by starting at the - symbol and moving to 
the right, all the way to the end of the expression, or until a       
semicolon is encountered, or until a right parenthesis, brace, or     
bracket is encountered whose matching left partner is to the left of  
the symbol.  In the above example the right argument of minus is      
everything to the right.  If the case of a+b-(ce)f, the right       
argument is also everything to the right.  However, for a+(b-ce)f,  
the right argument is ce.                                            


11.  Control Statements                                               

11a.  Case Statement                                                  

The form of a case statement is the word case, followed by an         
expression in parentheses, followed by one of two special expression  
sequences.  The placement of semicolons must be as illustrated below. 
The point of the specification in the examples is that A+ control     
statements are actually compound expressions with results.            

	xcase (a) {0;"The case is 0";           
		1;"The case is 1";               
		"The default case"               
		}                                

	xcase (a) {0;"The case is 0";         
		1;"The case is 1";             
	 	}                              

These expression blocks are of the form                               

		{case-expression0; value-expression0; 
		 case-expression1; value-expression1; 
	 	.                                     
		.                                     
		.                                     
		}                                   

In both of the above instances, the case statement is evaluated by    
first evaluating the expression in parentheses.  The value of that    
expression is compared to the value of case-expression0.  If they     
match, value-expression0 is evaluated and its value is the result of  
the case statement.  If they do not match, the value of the expression
in parentheses is compared to the value of case-expression1.  If they 
match, value-expression1 is evaluated and its value is the result of  
the case statement.  This pattern continues until the case-expression,
value-expression pairs are exhausted.  At that point the case         
statement either has one remaining expression (the first example      
above) or none.  If there is one, it is evaluated and its value is the
result of the case statement.  If there is none, the result of the    
case statement is the Null.                                           


11b.  Do Statement                                                    

The monadic form of the do statement is the word do, followed by an   
expression or expression block.                                       

The dyadic form is like the monadic form, except that a valid left    
argument expression appears to the left of the word do.  There are two
special forms recognized for the left argument.  For example, evaluate
each of the following:                                                

	n10                                                                 
	xn do n                                                            
	n                                                                    

The specification of n is simply to get the example going.  The point 
is that when the do statement is evaluated, n already has a value.    
The do statement prints the value of n each time it is evaluated.  You
might have expected to see a series of 10's, but you saw 0 through 9. 
The rule is that when the left argument is simply a variable name with
an integer value, say k, that variable is successively given the      
values 0, 1,,k-1 for the successive evaluations of the expression on 
the right.  Finally, evaluating the last statement in the above       
sequence shows that n once again has its value (10) from before       
evaluation of the do statement.                                       

Basically the same behavior occurs when the left side of the do       
statement is a simple specification.  For example:                    

	x(n10) do n                                                       
	n                                                                    

No other form of the left argument has this effect.  For example:     

	n20                                                                 
	x(n-15) do n                                                       


11c.  If Statement                                                    

The form of an if statement is the word if, followed by an expression 
in parentheses, followed by another expression or an expression block.


11d.  If-Else Statement                                               

The form of an if-else statement is the word if, followed by an       
expression in parentheses1, followed by another expression or         
expression block, followed by the word else, followed by another      
expression or an expression block.                                    


11e.  While Statement                                                 

The form of a while statement is the word while, followed by an       
expression in parentheses1, followed by another expression or an      
expression block.                                                     


12.  Execution Stack References                                       

Execution stack references are &, &0, &1, etc.  The symbol & can be   
used in a function definition to refer to that function.  For example,
a factorial function can be recursively defined in either of the two  
following ways:                                                       

	fact{n}: if (n>0) nfact{n-1} else 1                                 

	fact{n}: if (n>0) n&{n-1} else 1                                    

When execution is suspended the objects on the execution stack can be 
referenced by &0 (top of stack), &1, etc.  See the Dealing with Errors
tutorial.                                                             


13.  Well-Formed Expressions                                          

Basically, a well-formed expression is one that takes one of the forms
described above, and in which all of the constituents are well-formed.
The potential for complicated expressions is due to the fact that     
every one of these basic forms produces a result and can therefore be 
used as a constituent in other forms.  In this regard A+ is very much 
like mathematical notation.                                           

The concept of the principal subexpression of an expression is useful 
for analysis.  As execution of an expression proceeds in the manner   
described in Right-to-left Order of Execution, one can imagine that   
parts of the expression are executed and replaced with their results, 
and then some remaining parts are executed using these results, and   
are replaced with their results, and so on.  Ultimately the execution 
comes to the last expression to be executed, which is called the      
principal subexpression.  Once executed, its value is the value of the
expression.  If the principal subexpression is a function call        
expression or operator call expression, the function or derived       
function is called the principal function.                            

For example, the principal subexpression of (a+bc-d)*10n is x*y,    
where x is the result of a+bc-d and y is the result of 10n.  The    
power function * is the principal function.  As a second example, the 
principal expression of (x+y;x-y) is (w;z), where w is the result x+y 
and z is the result of x-y.  In this case we do not refer to a        
principal function.                                                   

Knowing the principal subexpression often reveals the thrust of a     
complicated expression.  Mathematical notation gives visual clues that
usually point the reader directly to the principal subexpression.     
There are clues in A+ as well, but they are based largely on          
experience.                                                           

Ex 12.  In each row of Table 3-1, an expression is given together with
its principal function or expression.  Make sure you understand each  
case.                                                                 

                                                                      

                                                               
               Table 3-1: Well-Formed Expressions              
---------------------------------------------------------------
|Expression     |Principal Function or Principal Expression   |
|===============|=============================================|
|a+b-cd        |+                                            |
|(a+b)-cd      |-                                            |
|f߫w           |                                            |
|(x-y)[a*2]     |w[z]                                         |
|(+/w-a)/z    |/                                            |
|+/w-a        |                                            |
|+/w-a         |+/                                          |
| (a+.b)a.+b |                                            |
| a.+b         |.+                                          |
|f{a;ga;x-y*2} |f{a;t;s}                                     |
---------------------------------------------------------------
                                                               
aplus-fsf-4.22/src/html/tutorials/graphs/0000777000265000001440000000000010774512523014155 5aplus-fsf-4.22/src/html/tutorials/graphs/Makefile0000644000265000001440000001524710774512506015543 # Makefile.in generated by automake 1.6.3 from Makefile.am. # src/html/tutorials/graphs/Makefile. Generated from Makefile.in by configure. # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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. ############################################################################### ############################################################################### SHELL = /bin/sh srcdir = . top_srcdir = ../../../.. prefix = /usr/local exec_prefix = ${prefix} bindir = ${exec_prefix}/bin sbindir = ${exec_prefix}/sbin libexecdir = ${exec_prefix}/libexec datadir = ${prefix}/share sysconfdir = ${prefix}/etc sharedstatedir = ${prefix}/com localstatedir = ${prefix}/var libdir = ${exec_prefix}/lib infodir = ${prefix}/info mandir = ${prefix}/man includedir = ${prefix}/include oldincludedir = /usr/include pkgdatadir = $(datadir)/aplus-fsf pkglibdir = $(libdir)/aplus-fsf pkgincludedir = $(includedir)/aplus-fsf top_builddir = ../../../.. ACLOCAL = aclocal-1.6 AUTOCONF = autoconf AUTOMAKE = automake-1.6 AUTOHEADER = autoheader am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = /usr/bin/install -c INSTALL_PROGRAM = ${INSTALL} INSTALL_DATA = ${INSTALL} -m 644 install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = ${INSTALL} INSTALL_HEADER = $(INSTALL_DATA) transform = s,x,x, NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = host_triplet = i686-pc-linux-gnu EXEEXT = OBJEXT = o PATH_SEPARATOR = : AMTAR = tar AS = @AS@ AWK = gawk CC = gcc CXX = g++ DEPDIR = .deps DLLTOOL = @DLLTOOL@ ECHO = echo INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s LIBTOOL = $(SHELL) $(top_builddir)/libtool LIBTOOL_DEPS = config/ltmain.sh LN_S = ln -s MAINT = # OBJDUMP = @OBJDUMP@ PACKAGE = aplus-fsf RANLIB = ranlib STRIP = strip VERSION = 4.22 X_INCLUDES = -I/usr/X11R6/include X_LIBS = -L/usr/X11R6/lib -lX11 am__include = include am__quote = install_sh = /ms/dev/aplus/aplus/fsf/src/aplus-fsf-4.22/config/install-sh graphsdir = $(prefix)/doc/html/tutorials/graphs graphs_DATA = \ graph_tutorial.html EXTRA_DIST = \ graph_tutorial.html subdir = src/html/tutorials/graphs mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_CLEAN_FILES = DIST_SOURCES = DATA = $(graphs_DATA) DIST_COMMON = Makefile.am Makefile.in all: all-am .SUFFIXES: $(srcdir)/Makefile.in: # Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/html/tutorials/graphs/Makefile Makefile: # $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: graphsDATA_INSTALL = $(INSTALL_DATA) install-graphsDATA: $(graphs_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(graphsdir) @list='$(graphs_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(graphsDATA_INSTALL) $$d$$p $(DESTDIR)$(graphsdir)/$$f"; \ $(graphsDATA_INSTALL) $$d$$p $(DESTDIR)$(graphsdir)/$$f; \ done uninstall-graphsDATA: @$(NORMAL_UNINSTALL) @list='$(graphs_DATA)'; for p in $$list; do \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " rm -f $(DESTDIR)$(graphsdir)/$$f"; \ rm -f $(DESTDIR)$(graphsdir)/$$f; \ done tags: TAGS TAGS: DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = ../../../.. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: $(mkinstalldirs) $(DESTDIR)$(graphsdir) 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_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_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-generic clean-libtool mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-graphsDATA install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool uninstall-am: uninstall-graphsDATA uninstall-info-am .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-graphsDATA \ install-info install-info-am install-man install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool uninstall uninstall-am uninstall-graphsDATA \ uninstall-info-am # 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: aplus-fsf-4.22/src/html/tutorials/graphs/Makefile.in0000644000265000001440000001517310774512523016145 # Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ ############################################################################### ############################################################################### SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../../.. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CXX = @CXX@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ STRIP = @STRIP@ VERSION = @VERSION@ X_INCLUDES = @X_INCLUDES@ X_LIBS = @X_LIBS@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ graphsdir = $(prefix)/doc/html/tutorials/graphs graphs_DATA = \ graph_tutorial.html EXTRA_DIST = \ graph_tutorial.html subdir = src/html/tutorials/graphs mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_CLEAN_FILES = DIST_SOURCES = DATA = $(graphs_DATA) DIST_COMMON = Makefile.am Makefile.in all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/html/tutorials/graphs/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: graphsDATA_INSTALL = $(INSTALL_DATA) install-graphsDATA: $(graphs_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(graphsdir) @list='$(graphs_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(graphsDATA_INSTALL) $$d$$p $(DESTDIR)$(graphsdir)/$$f"; \ $(graphsDATA_INSTALL) $$d$$p $(DESTDIR)$(graphsdir)/$$f; \ done uninstall-graphsDATA: @$(NORMAL_UNINSTALL) @list='$(graphs_DATA)'; for p in $$list; do \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " rm -f $(DESTDIR)$(graphsdir)/$$f"; \ rm -f $(DESTDIR)$(graphsdir)/$$f; \ done tags: TAGS TAGS: DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = ../../../.. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: $(mkinstalldirs) $(DESTDIR)$(graphsdir) 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_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_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-generic clean-libtool mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-graphsDATA install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool uninstall-am: uninstall-graphsDATA uninstall-info-am .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-graphsDATA \ install-info install-info-am install-man install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool uninstall uninstall-am uninstall-graphsDATA \ uninstall-info-am # 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: aplus-fsf-4.22/src/html/tutorials/graphs/Makefile.am0000644000265000001440000000135007232100012016101 ## Process this file with automake to produce Makefile.in ############################################################################### ## ## ## Copyright (c) 2001 Morgan Stanley Dean Witter and Co. ## ## See ..../src/LICENSE for terms of distribution. ## ## ## ## ## ############################################################################### graphsdir = $(prefix)/doc/html/tutorials/graphs graphs_DATA = \ graph_tutorial.html EXTRA_DIST = \ graph_tutorial.html aplus-fsf-4.22/src/html/tutorials/graphs/RCS/0000777000265000001440000000000010774505501014602 5aplus-fsf-4.22/src/html/tutorials/graphs/RCS/graph_tutorial.html,v0000444000265000001440000023015010774505500020670 head 1.2; access; symbols; locks; strict; comment @# @; 1.2 date 2008.04.01.19.21.36; author jmiz; state Exp; branches; next 1.1; 1.1 date 2008.04.01.19.20.55; author jmiz; state Exp; branches; next ; desc @@ 1.2 log @*** empty log message *** @ text @  
                              Graph Tutorial

1. Introduction
2. The Components of a Graph
	Attributes:	xs
			ys
2a. Traces and Trace Sets
	Attributes:	linecolor (*)
			linestyle (*)
			linewidth (*)
2b. Title
	Attributes:	title
			titlefg
			titlefont
			titlejustify
2c. Subtitle
	Attributes:	subtitle
			subtitlefg
			subtitlefont
			subtitlejustify
2d. Footnote
	Attributes:	footnote
			footnotefg
			footnotefont
			footnotejustify
2e. Legend
	Attributes:	legend		
			legend (*)	
			legendbg
			legendfg
			legendfont
			legendstyle
			xlegend
			ylegend
			legendhlthickness
			legendshadowthickness
2f. x-Axis and y-Axis Titles
	Attributes:	x/X/y/Ytitle (**)	
			x/X/y/Ytitlefg (**)	
			x/X/y/Ytitlefont (**)
			x/X/y/Ytitlejustify (**)
			y/Ytitlestyle (**)	
2g. Axes
	Attributes:	axis
			x/X/y/Yfg (**)
			grid		
			gridfg		
			gridstyle	
			gridwidth	
			rule
			rulewidth
                        y/Ymode (**)
2g1. Axis Ticks
	Attributes:	x/X/y/Yinc (**)
			x/X/y/Ymajorticksize (**)
			x/X/y/Yminorticks (**)
			x/X/y/Yminorticksize (**)	
			x/X/y/Ytickstyle (**)
2g2. Axis Labels
	Attributes:	x/X/y/Ylabelfont (**)
			x/X/y/Ylabeljustify (**)
			x/X/y/Ylabelout (**)
			x/Xsublabel (**)
			x/Xsublabeljustify (**)
2g3. Controlling Tick Mark Location and Label Formatting
	Attributes:	x/X/y/Ylabel (**)  	
			x/y/X/Yextent (**)
			x/y/X/Ylabelheight (**)
			x/X/y/Ylabelwidth (**)
			x/Xsublabelout (**)
2h. Alternate Axes
	Attributes:	axis
			x/yaxis (*,**)
2i. Zero Axes
	Attributes:	zero
			zerofg
			zerostyle
			zerowidth
3. Trace Styles	
	Attributes:	barwidth
			fillcolor (*)
			font 
			gradient (*)
			style (*)
			symbol (*)
			symbolsize (*)
3a. Text Traces
	Attributes:	title (*)			
			titlefg (*)			
			titlefont (*)			
4. Graph Attributes
	Attributes:	bg
			bottom			
			fg			
			left			
			refer
			right			
			top			
			y/Ybottom (**)
			y/Ytop (**)
			x/Xleft	(**)
			x/Xright (**)
			x/Xmin (**)
			x/Xmax (**)
			y/Ymin (**)
			y/Ymax (**)
5. User Interactions
5a. Zooming
5b. Vertical Cursor and Cross Hairs
	Attributes:	legendstyle
5c. Referencing a Graph, Line Trace, or Trace Point
	Attributes:	coordinate/Coordinate	
			refer
			referpoint
			selectable	
			selected
5d. Selecting the Legend or a Text Trace
5e. Repositioning the Legend and Traces
5f. Copying and Deleting Traces
	Attributes:	delete	
5g. Editing and Creating Text Traces 
	Attributes:	addtexttrace
		        copytextrace
			delete (as callback function)
                        mode
			textactivate
5h. Modifying and Creating Numeric Traces
	Attributes:	addtrace
			copytrace
			movelimit (*)
			selected (*)
			selectdistance
6. Monitoring Performance
        Variable:       s.QUIET

(*) Trace set attributes, or trace attributes for short. All the others
are graph attributes.

(**) An attribute with x/X/y/Y prefixed to its name is one that is
separately defined for all four axes. The four axes are: the normal
x-axis at the bottom of the graph, referred to as "x"; the normal y-axis
at the left of the graph, referred to as "y"; the alternate x-axis at
the top of the graph, referred to as "X"; and the alternate y-axis at
the right of the graph, referred to as "Y". For example, x/X/y/Ytitle
means there are four attributes: xtitle, Xtitle, ytitle, and Ytitle, one
for each of the axes; x/yaxis means there are two attributes, xaxis and
yaxis.


1. Introduction


The purpose of this tutorial is to familiarize the reader with the graph
display class in the A+ screen management system. In general, only those
aspects of screen management specific to graphs are discussed here. See
the general screen management tutorial to learn how the more widely
applicable functions apply to graphs.

The tutorial is made up of descriptions and A+ examples. You should set
up your Emacs environment to have two visible buffers, one holding the
tutorial and the other an A+ session. If you are currently reading this
in Emacs, simply press F4.

To bring individual expressions from the tutorial into the A+ session,
place the cursor on the expression and press F2. It is assumed that the
expressions and functions are brought into the A+ session when you first
encounter them.

If you need more help on running Emacs and A+ see the "Getting Started"
tutorial.

Once you have an active A+ session, load the screen management system by
entering

	$load s 

That is, place the cursor on the above expression and press F2.

At various points in the exercises, you will refresh the A+ session by
exiting with $off, pressing F4 to start A+ again, and then loading the
screen management system. Session refreshings will be indicated as
follows:
	
	$off  Exit from A+ 

Press F4 to start A+ again, then move the cursor back to the tutorial
buffer, on the next line.

	$load s

You may make mistakes when running the tutorial and it may become
difficult to get back to a place where you can continue. At that point
you should simply go back to the latest session refresh sequence and
start over from there.

Two more things before we start. First of all, by default graphs appear
in the upper left corner of the screen. To avoid having the graphs
overlay the tutorial, move the Emacs screen to the lower right, or put
the tutorial in the bottom Emacs buffer and the A+ session in the top
(you can do this by pressing F5 and then F6; you may have to do it more
than once.)

Secondly, even though the default sizes of the examples may be quite
small, don't resize them unless told to do so, because the resizing may
change the details of the graphs.

In the examples we usually display the graphs first and then set their
attributes so that you can see the effects. In practice, however, you
set the attributes before displaying the graph.


2. The Components of a Graph


A graph is a layout composed of one or more trace sets. The simplest
trace set is a vector v, whose elements are plotted as the y-coordinates
with x-coordinates #v. That is, the points (i,v[i]) are plotted for all
i from 0 to (#v)-1.

	v 53 14 27 2 31 85 30 11 67 50
	g`v
	show `g is `graph

At this point you should see a window with "A+" in the grey title bar,
and a gray graph area below it. The graph area has a title area with "g"
in it, an x-axis and a y-axis, a legend, and a trace. This is the
default appearance of the graph. Each of these components can be
modified by setting the appropriate attributes, and there are other
components that do not appear in the default. And, of course, there can
be more than one trace on a graph. We will look at all of these
components in this section.

There are two attributes that allow us to control the size of the graph.
We will use these attributes for resizing to ensure that the assumptions
about the appearance of the graphs are correct.

	`g has (`xs`ys;(300;200))      This may have no effect, i.e.,
				       this may be the default size.

2a. Traces and Trace Sets 

The present graph g has only one trace set, i.e., one component variable
v.  However, like any container, it can have more than one. For example,

	w(#v)*2
	gg,`w

You should now see two traces on the graph, and an updated legend.

The more general form of a trace set is a matrix rather then a vector,
because then the x-coordinates as well as the y-coordinates can be
specified.  The individual coordinates are arranged as rows of the
matrix, with the x-coordinates along the first column and y-coordinates
along the second.  For example,

	x4 28 10 4 24 1 5 6 60
	x  
  8 10        	
  4 24		
  1  5        	
  6 60        	
 	gg,`x

You should now see three traces on the graph, and an updated legend.
Note that the new trace is indicated in the legend by "x:0", instead of
simply "x".  The reason for this is that matrix trace sets can provide
more than one trace on the graph. For example, if we catenate a new
column onto x as follows:

	xx(,@@1 0) 40 20 50 80

you will see a fourth trace and a new row in the legend, indicated by
"x:1".  The 3-column matrix x provides two traces to the graph, both
with the same x-coordinates. One trace is defined by columns 0 and 1 of
x (the one indicated by "x:0" in the legend), and the other is defined
by columns 0 and 2 (and indicated by "x:1" in the legend). All traces in
a trace set share the same x-coordinates, which are in column 0 of the
matrix.

Note that in the default case, the traces in a trace set share the same
color, but are distinguished by their line styles. Both line color and
line style are trace set attributes that can be set. For example:

	`w has (`linecolor;`yellow)
	`w has (`linestyle;`dot)
 	
A full list of colors can be found in the A+ reference manual.  The line
styles are `solid, `dash (e.g., the trace indicated by "x:1" in the
legend), `dot and `dotdash. For example:

	`w has (`linestyle;`dotdash)

(Toggle back and forth between the last two expressions to see the
difference in the two line styles.) Also, `dot1 through `dot5 give
various intervals between dots, with `dot1 the smallest, `dot5 the
largest, and `dot3 the same as `dot.

	`w has (`linestyle;`dot1)
	`w has (`linestyle;`dot2)
	`w has (`linestyle;`dot3)
	`w has (`linestyle;`dot4)
	`w has (`linestyle;`dot5)

Analogously, there are `dash1 through `dash5 (different length dashes)
and `dotdash1 through `dotdash5.

The line colors and line styles can be set individually for all traces
in a trace set by specifying these attributes to have vectors of values.

	`x has (`linecolor;`white `dodgerblue)
	`x has (`linestyle;`dot `solid)

The last attribute affecting the appearance of line graphs allows the
line width to specified, which is useful for emphasis:

	`v has (`linewidth;2)

Note that the width of the corresponding line segment in the legend also
changed. The units of line width are pixels.

The last thing to be illustrated in this section is that a trace set
with multiple visible traces behaves differently in a graph with a
single trace set and in a graph with multiple visible trace sets. We
will use a separate graph and locate it 350 pixels to the right, for
simultaneous viewing. First, return the original graph to its default
values:

        `x has (`linecolor;; `linestyle;); `v has (`linewidth;);
	xx4 28 10 4 24 1 5 6 60
	gg`xx
	show `gg is `graph; `gg has (`x;350);
     	xxxx(,@@1 0) 40 20 50 80
     
The two traces contributed by x to the graph g, which is a graph with
multiple trace sets, have the same color, but different line styles;
color is used to differentiate among trace sets. On the other hand, the
two traces contributed by xx to the graph gg, which has only one trace
set, have different colors, but the same line style.

	free `gg

Most of the attributes set so far have been on the trace sets, but three
(the size parameters `xs and `ys and the horizontal position parameter
`x) have been on the graph itself. This distinction is sometimes made
explicit by our referring to attributes as "trace attributes" or "graph
attributes."

There are other visual forms a trace can take besides these various line
styles; see "3. Trace Styles."
 

2b. Title

The "g" that appears at the top of the gray plot area in our current
example is the title of the graph.  A more meaningful title can be
specified using the `title attribute:

	`g has (`title;"Graph Tutorial Example")

Both color and the font can also be set, and the title can be justified.
There may be a delay in changing the font. Wait for the change before
proceeding. (A list of recommended fonts can be found in the A+
Reference Manual.)

	`g has (`titlefg;`yellow)
	`g has (`titlefont;"helvetica-bold-20")
	`g has (`titlejustify;`left)                  or `right
	`g has (`titlejustify;`center)

The title can have more than one line:

	`g has (`title;("Graph Tutorial Example";"Components of a Graph"))

Note that the plot area composed of the axes and traces was
automatically resized to accommodate the two rows of the title.

The title can be removed by setting it to the empty vector:

	`g has (`title;"")


2c. Subtitle

One graph component that does not appear in the default form of a graph
is the subtitle. The subtitle appears between the title and the plot
area. Since it has color and font settings separate from those for the
title, it can be used for more effective title presentations. For
example, put the first row of the title back:

	`g has (`title;"Graph Tutorial Example")

and put the second row back as the subtitle:

	`g has (`subtitle;"Components of a Graph")
	`g has (`subtitlefg;`blue)
	`g has (`subtitlefont;"Times-Roman-15")
	`g has (`subtitlejustify;`left)               or `right
	`g has (`subtitlejustify;`center)

Subtitles, like titles, can have more than one row, and are removed by
setting their value to "".


2d. Footnote

The footnote is another component that does not appear in the default 
form of a graph. 

	`g has (`footnote;"Morgan Stanley Co.")
	`g has (`footnotefg;`yellow)
        `g has (`footnotefont;"Times-BoldItalic-15")
	`g has (`footnotejustify;`center)                  or `right
	`g has (`footnotejustify;`left)

Footnotes are removed by setting their value to "".


2e. Legend

The text in the legend can be set for each trace set:

	`v has (`legend;"solid red")
        `w has (`legend;"broken yellow")
	`x has (`legend;("solid blue";"broken blue"))

Note that if the text for a legend entry is the empty character vector,
that entry is removed.

	`v has (`legend;"")
	`v has (`legend;"solid red")

At this point you may want to resize the graph window, since otherwise
the legend will now take up a large portion of the plot area.

	`g has (`xs`ys;(600;500))   

The legend box can also be repositioned within the plot area.

	`g has (`legend;`br)          Bottom right	
	`g has (`legend;`tc)          top center
	`g has (`legend;`tl)          top left (where we started)

Other settings are `tr, `bl, and `bc. (Note that we just set the `legend
attribute for the graph g, while just above are settings of the `legend
attribute for trace sets.) In addition, you can specify the position of
the upper left corner of the legend box, as percentages of the
horizontal and vertical lengths of the graph window. They take effect
when `legend has the value `xy:
	
	`g has (`xlegend `ylegend;(25;75))   the (x,y) percentages
  	`g has (`legend;`xy)		    

Now that the `legend attribute has been set to `xy, settings of `xlegend
and `ylegend take effect immediately:

	`g has (`xlegend;50)

Note that the legend cannot be partially hidden by the choice of
`xlegend and `ylegend. For example, if these coordinates are set to
(95,95) one might expect that only the upper left corner of the legend
would be visible. However, this is not the case:

	`g has (`xlegend `ylegend;(95;95))   the (x,y) percentages

The specified position is respected as far as possible, consistent with
keeping the legend completely visible.

The values of `xlegend and `ylegend are integers between 0 and 100 or,
alternatively, fractions between 0 and 1.

The legend can also be strung out horizontally:

	`g has (`legend;`tl) 		 
	`g has (`legendstyle;`hor)

The original configuration is:

	`g has (`legendstyle;`ver)

Other attributes control the colors and font of the legend.
Specifically, the background color of the legend:

	`g has (`legendbg;`white)

the foreground color, or color of the text in the legend:

	`g has (`legendfg;`blue)

the font of the text in the legend:

	`g has (`legendfont;"Times-Roman-15")
	
and, finally, even the pixel width of the legend's highlight and shadow
thicknesses (the defaults are 1):

	`g has (`legendshadowthickness;3)
	`g has (`legendhlthickness;2)

The legend can be made to blend into the graph:

	`g has (`legendbg;0`bg of `g)
	`g has (`legendshadowthickness;0)
	`g has (`legendhlthickness;0)
    
The legend can be removed by setting the legend position to `none:

	`g has (`legend;`none)


2f. x-Axis and y-Axis Titles

Titles for axes are two other components that do not appear in the 
default form of a graph.     

	`g has (`xtitle;"0 to 9")      	    
	`g has (`ytitle;"0 to 81")	   

Let's make them big enough to be easily seen:

	`g has (`xtitlefont;"Times-Roman-25")    
	`g has (`ytitlefont;"Times-Roman-25")    

Note that the x-axis title is positioned below the x-axis and the y-axis
title is above the y-axis. The y-axis title can be repositioned
vertically along the y-axis as follows:

	`g has (`ytitlestyle;`ver)	    

The axis titles can be justified:

	`g has (`xtitlejustify;`left)
	`g has (`xtitlejustify;`right)
	`g has (`xtitlejustify;`center)
	`g has (`ytitlejustify;`top)
	`g has (`ytitlejustify;`bottom)
	`g has (`ytitlejustify;`center)

Return to the original position with:

	`g has (`ytitlestyle;`hor)	   

The y-axis title can now be justified right and left:

	`g has (`ytitlejustify;`left)
	`g has (`ytitlejustify;`right)
	`g has (`ytitlejustify;`center)

Notice that there seems to be no difference in right and center
justification of the y-axis title. We can set the left margin so you can
see the difference:

	`g has (`left;20)
	`g has (`ytitlejustify;`left)
	`g has (`ytitlejustify;`right)
	`g has (`ytitlejustify;`center)
	`g has (`left;0)

We'll have more to say about margins later. The colors of the axis
titles can be set separately:

	`g has (`xtitlefg;`red)
	`g has (`ytitlefg;`yellow)

	
2g. Axes

Most of the settable attributes in good graphics packages deal with
axes, and this one is no different. There are four parts to an axis: the
rule which extends the length of the axis; the tick marks; the labels on
the tick marks; and the grid lines of the graph associated with the tick
marks. Each of these parts can be controlled with the appropriate
attributes. In addition, there are a few attributes that affect the
overall appearance of the axes.

First of all, we can control the color of the axes:

	`g has (`xfg;`yellow)    		 
	`g has (`yfg;`red)    		 

We can also control the thickness of the axis rules:

	`g has (`rulewidth;2)  	

As you can see, the thickness of both axes rules and tick marks are affected.
The units of the axis thickness are pixels.

A rule width of 0 has special meaning. Although it looks no different
from 1 on the screen, it has the effect of drawing the rules more
efficiently, and more importantly, perhaps, there is a noticeable
difference when a graph is printed.

	`g has (`rulewidth;0)  	

More interesting, perhaps, is the control one has over the style of the
axes. We will go through all the possibilities. For example, we can have
an x-axis only or a y-axis only.
 
	`g has (`axis;`x)		
	`g has (`axis;`y)		
	`g has (`axis;`xy)		

Vertical grid lines can be placed at the major x-axis tick marks.

	`g has (`grid;`x)	
      
Likewise, horizontal grid lines can be placed at the major y-axis tick
marks.

	`g has (`grid;`y)

Both horizontal and vertical grid lines are also possible:
    
	`g has (`grid;`xy)     

Both the widths (in pixels) and colors of the gridlines can be set:

	`g has (`gridwidth;2)
	`g has (`gridfg;`green)

A grid width of 0 has the same effects as a rule width of 0:

	`g has (`gridwidth;0)

There is a `rule attribute whose default value is `axis, meaning that
any axes that appear have rules. This attribute can also be set to
values like those for `grid, indicating which axes have rules. For
example, we can have a graph with an ordinary y-axis and just the x-axis
rule:
 
	`g has (`axis;`y)
	`g has (`rule;`xy)

An interesting effect is obtained by removing the rule from the y-axis:

	`g has (`rule;`x)

The graph can have ascending values or descending values:

	`g has (`ymode;`descend)
	`g has (`ymode;`ascend)


2g1. Axis Tick Marks

We will use an uncluttered graph to illustrate the details of tick-mark
and label attributes.

	$off                  Exit from A+

Press F4 to start A+ again, then move the cursor back to the tutorial
buffer, on the next line.

	$load s

	v 53 14 27 2 31 85 30 11 67 50
	g`v
	show `g is `graph
	`g has (`xs`ys;(300;200))      This may have no effect, i.e.,
				       this may be the default size.

The lengths of both the major and minor tick marks can be set. The unit
of length is pixels. Let's first look at the default values to get a
sense of their scale.

	`xmajorticksize of `g		
<  10					 A+ output
	`xminorticksize of `g		
<  6					 A+ output

The tick marks can be made smaller, leaving a larger plot area. For
example:

	`g has (`xminorticksize;2)	
	`g has (`xmajorticksize;5)	

The number of minor tick marks that appear between major tick marks can
be specified, for the x-axis and y-axis separately. In the present
example, 4 minor tick marks between major tick marks on the y-axis would
put a mark at every increment of 5:
	
	`g has (`yminorticks;4)

It often improves the appearance of a graph to remove the minor tick
marks, which can be done by setting their number to 0. For example:

	`g has (`xminorticks;0)

The number of major tick marks can also be specified, if somewhat
indirectly, by specifying the increment between major tick marks. For
example:

	`g has (`yinc;40)
	`g has (`xinc;2)

And, finally, we can control the style of the tick marks: pointing away
from the plot area, into the plot area, or straddling the axis:

	`g has (`ytickstyle;`in)      The tick marks point inwards
	`g has (`xtickstyle;`inout)   The tick marks straddle the axis
	`g has (`xtickstyle;`out)     The tick marks point outwards 
	
The latter is the default. Graphs with tick style `in are effective
because the plot area is larger, and the inward pointing ticks rarely
decrease the usable plot area.


2g2. Axis Labels

We have control over two aspects of the axis labels: the font in which
they are set and their format.

At this point it is useful to switch to an example with realistic data.

	$off                  Exit from A+

Press F4 to start A+ again, then move the cursor back to the tutorial
buffer, on the next line.

	$load s
	x0 "/usr/local/aplus-fsf-4.22/doc/tutorials/graphs/graph_data.m";

This data is high, low, open, close information taken at, roughly, 
5-minute intervals over a 5-day period in Tokyo. The market day is
partitioned into 5-minute increments and x contains one row for each
period. A timestamp, which is in column 0, is the time of the last
reading for the 5-minute period in which it falls. The timestamps are
Unix timestamps.

The data in columns 1 through 4 of a given row are associated with the 
5-minute time period in which the timestamp in column 0 lies. They
represent, starting with column 1, the high value of all readings taken
during the 5-minute period, the low value, the open, and the close.
  
At this point we need only one of the traces:

	yx[;0 1]
	g`y
	show `g is `graph
	`g has (`xs`ys;(300;200))      This may have no effect, i.e.,
				       this may be the default size.

You will notice that the data on the graph appears clustered in several
areas, and these clusters are connected by relatively long line
segments.  The clusters represent periods of market activity, while the
long line segments represent periods during which the market is closed.
In applications, these long segments would be factored out to give the
graph a uniform appearance, but that is not a concern here.

Let's look at the timestamp format on the x-axis labels first. Since
this is daily data, we start with the seven-day format, which uses
abbreviated names for the days:

	`g has (`xlabelout;`day7_u)

Note that the major tick marks indicate the beginning of every other
day, and the minor tick marks therefore mark the remaining days.

Let's look at days of the month or days of the year, which are integers
indicating the number of days since the beginning of the month or year:
 
	`g has (`xlabelout;`day31_u)

The minor tick marks now represent half days.
  
	`g has (`xlabelout;`day365_u)

Once again, the minor tick marks represent days.

The time span between major tick marks, and therefore the meaning of the
minor tick marks, depends to a large extent on the sizes of the labels,
because these sizes determine the number of labels the graph can
accommodate.  We have some indirect control over the number of labels
that appear and their format, because we can specify the font for the
labels. (More direct control is described below in "2g3. Controlling Tick
Mark Location and Label Formatting".) For example:

	`g has (`xlabelout;`day7_u)

Check the default label font, and then set it to a smaller pixel size.

	`xlabelfont of `g			
	`g has (`xlabelfont;"Helvetica-Bold-7") 

You should now see a major tick for each weekday. Of course the labels
are very hard to read. Another possibility is to simply choose the size
of the graph appropriately. First reset the axis font:

	`g has (`xlabelfont;"Helvetica-Bold-12")

and then resize the graph:

	`g has (`xs`ys;(800;300))

There are two month-only formats, one that uses names and the other the
numbers 1 through 12, and there are two year-only formats using 2 digits
and 4 digits. These formats are not particularly interesting for data
which is all from the same month, but for completeness here they are:

	`g has (`xlabelout;`m_u)
	`g has (`xlabelout;`m12_u)
	`g has (`xlabelout;`y2_u)
	`g has (`xlabelout;`y4_u)

The next format gives a text form of day, month and year, while the four
that follow give various abbreviated forms:

	`g has (`xlabelout;`mdy_u)
	`g has (`xlabelout;`mdy2_u)
	`g has (`xlabelout;`mdy4_u)
	`g has (`xlabelout;`dmy2_u)
	`g has (`xlabelout;`dmy4_u)

The remaining time formats are hours, minutes, and seconds, so to get
major tick marks with these units, restrict the data to a single day, as
follows:

	y50y 

The market hours are 9:30 to 11:00 and 1:30 to 3:30. Test the following 
formats:

	`g has (`xlabelout;`hrmin)
	`g has (`xlabelout;`hrmin24)
	`g has (`xlabelout;`hr)
	`g has (`xlabelout;`hr24)

To get major tick mark labels in minutes, further restrict the data as
follows:

  	y12y

This data is not fine enough to exhibit variations in seconds, but here are
the remaining time formats:

	`g has (`xlabelout;`min)
	`g has (`xlabelout;`sec)
	`g has (`xlabelout;`minsec)
	`g has (`xlabelout;`hrminsec)
	`g has (`xlabelout;`hrminsec24)

Finally, you can remove the labels altogether:

	`g has (`xlabelout;`)

In addition to the primary x-axis labels, there are sublabels that
provide a second level of text. Sublabels are useful when all the label
text does not fit conveniently on one line, and we will see examples of
this in the next section. For now, go back to the original graph of this
section:

	yx[;0 1]
	`g has (`xs`ys;(300;200))  
	`g has (`xlabelout;`day31_u)
	`g has (`xsublabelout;`m_u)       The sublabels automatically appear. 

One last point on x-axis formatting. The labels and sublabels can be
justified relative to the tick marks:

	`g has (`xlabeljustify;`right)
	`g has (`xlabeljustify;`left)
	`g has (`xlabeljustify;`center)

	`g has (`xsublabeljustify;`right)
	`g has (`xsublabeljustify;`left)
	`g has (`xsublabeljustify;`center)

The sublabels are removed in the same way as labels:

	`g has (`xsublabelout;`)

Turning now to the y-axis, which in this example represents bond prices,
there are the following formats:

	`g has (`ylabelout;`32nd)
	`g has (`ylabelout;`64th)
	`g has (`ylabelout;`128th)
	`g has (`ylabelout;`320th)
	`g has (`ylabelout;`328th)

y-axis labels can also be justified:

	`g has (`ylabeljustify;`top)
	`g has (`ylabeljustify;`bottom)
	`g has (`ylabeljustify;`center)

Finally, we have three generally applicable label formats. For
convenience we will use the present example for illustration, even
though these formats are not appropriate for the data. The first of the
three displays the decimal part of the number as a fraction:

	`g has (`ylabelout;`frac)

The last two provide conventional floating point and fixed point
formats:
	
	`g has (`ylabelout;`float)
	`g has (`ylabelout;`fixed)

The number of decimal digits that appear can be specified for the fixed
format:

	`g has (`ylabelout;(`fixed;2))

The default label format is `float.


2g3. Controlling Tick Mark Location and Label Formatting

In addition to the variety of label formats illustrated above, you can
also specify your own format, much as you specify the format of any data
that appears on the screen. Furthermore, you have complete control over
the tick mark locations and the text of the labels for those tick marks.
Let's start with a clean slate.

	$off                  Exit from A+

Press F4 to start A+ again, then move the cursor back to the tutorial
buffer, on the next line.

	$load s

The screen management system provides ways for programmers to control
the formatting of tabular data on the screen. Each array on the screen
can be controlled separately. The control mechanisms for data on the
screen are:

	 a formatting parameter for the dyadic primitive format 
	  function  can be specified for an array, and will be applied
	  to every displayed element;
	
	 a formatting parameter for the system function _fmt can be 
	  specified, and will be applied to every displayed element;
	 
	 a function can be specified that will be called for every
	  displayed element.

The same rules apply to labels on tick marks, only now the data elements
being formatted are tick values. For example:

	y98+0.01+?20100
	g`y
	show `g is `graph
	`g has (`ylabelout;6.3)    	 A valid format parameter of 

A second example:

	`g has (`ylabelout;"f10.4")	 A valid format parameter of _fmt

`ylabelout can also be specified as a function. See the discussion of
the of the `out attribute in the A+ Reference Manual.

Complete control over ticks and tick labels is provided by the `ylabel
attribute. We'll begin by adjusting the window of the current graph
slightly, just to make sure the bottom and top ticks that are created
below will appear.

	`g has (`ymin `ymax;(97.9;99.1))

The value of the `ylabel attribute is a four-element nested vector of
the form

	(ticks;labels;sizes;widths)

where 
- ticks is a numeric vector representing the tick values, or locations
on the axis where the tick marks occur;
- labels is either a nested vector of character vectors, where ilabels
is the label for the tick value i#ticks, or a character matrix, where
i#labels is the label for the tick value i#ticks;
- sizes is a vector of numbers between 0 and 1, where the length of the
i-th tick mark is i#ticks times the current size of the major ticks
(that size is controlled by the `majorticksize attribute);
- widths is a vector of integers, where i#widths is the width, in
pixels, of the grid line at the ith tick mark.
  
Continuing the previous example:

 	ticks98+.26
	labels("one";"two";"three";"four";"five";"six")
     	size0 .2 .4 .6 .8 1
     	width0 1 2 3 4 5
     	`g has (`ylabel;(ticks;labels;size;width))

You should see tick marks at locations 98, 98.2,...,99 with labels "one"
through "six". The tick marks lengths are 0, 2,...,10 pixels (10 is the
value of the `majorticksize attribute). And, finally, there are grid
lines of width 0, 1,...,5 pixels. As you can see, the possibilities are
boundless for creating major and minor tick marks with various label and
grid line strategies.

In this example all four quantities have the same length, but that is
not required. If more labels are given than there are tick marks, the
extras are ignored. If fewer are given, the missing ones are considered
to be blank.  In particular, tick marks without labels are obtained by
specifying one label, and making that one all blank.

     	`g has (`ylabel;(ticks;" ";size;width))

If either size or width has fewer elements than ticks, those elements
are used cyclically, in the manner of the A+ Reshape primitive.

     	`g has (`ylabel;(ticks;labels;size[1 3 5];width[2 4]))

It is not necessary to specify all four components; only ticks must be
present. If labels is missing, the default format is used, or the
setting of the labelout attribute if there is one.

     	`g has (`ylabel;(ticks;size[1 3 5];width[2 4]))

If only one of size and width is present, which it is can (almost)
always be determined by the values: widths must be whole numbers, while
sizes are 0, 1, or fractions in between. The one ambiguous case is a
vector of 0's and 1's, and that is taken to be a width specification.

     	`g has (`ylabel;(ticks;0 1))
	
Like `ylabelout, `ylabel can be assigned a function that will be called
whenever tick marks and labels are needed for a graph, e.g., each time a
graph is zoomed (see "5a. Zooming"). When called, the function must
produce a four-element vector like the one described above.

There are interesting interactions between xlabel settings and
sublabels.  Suppose the x-axis in the present example represents dates
and define:

     `g has (`xlabel;(210;10 3"JanAprJulOct"))

Each group of labels "Jan through "Oct" represents a year, and we can
use the sublabel attribute to put year designations under the groups:

     `g has (`xsublabel;(3 11 19;3 4"199219931994"))

When a graph is zoomed, a section of the view is blown up to fill the
entire plot area. If `ylabel is assigned a fixed value, as in the above
example, then these are the only tick marks that can be used for the
zoomed view. Some of them may fall in the range of the zoomed view, but
some may not. If the area of the original graph chosen for zooming
contained none of these tick values, no tick marks would appear. But if
`ylabel is assigned a function, that function will be called to
determine new tick locations and labels for the zoomed view.
  
There are several graph attributes that can be referenced in the `ylabel
function that produce information helpful in determining tick values and
labels.

	`yextent of `g

is a three-element vector containing the minimum value along the y-axis,
the maximum value, and a scale factor. As a result of the last
expression you should see:

<  97.9 99.1 107.5

although the third element might be different. 97.9 is the minimum value
and 99.1 the maximum value along the y axis, which we set above. The
scale factor is such that

	(99.1-97.9)107.5

is the length of the y-axis in pixels. Resize the graph, evaluate

	`yextent of `g

again, and you should see a new scale factor.

It should be easy to understand that the minimum and maximum values are
necessary for determining tick values. But what is the point of the
scale?  Well, you don't want so many tick values that the labels overrun
each other.  Since you know the length of the y-axis in pixels, once you
determine the number of tick marks, you know the distance between tick
marks in pixels.  The labelheight attributes tell you the height in
pixels of all labels, and therefore you can determine whether or not
they overlap. For example:

	`xlabelheight of `g

Analogously, xlabelwidth attributes tell you the width of labels in
pixels, which can be used, for example, to see that x-axis labels don't
overrun one another. However, the situation is more complicated for
x-axis labels, since both the label texts and font characters can have
different widths.  Therefore, to determine the width of a proposed
label, the text of the label is part of the query:

	(`xlabelwidth;"testlabel") of `g

It is also possible to determine the widths of several labels at once,
either as the rows of a character matrix or as the elements of a nested
vector of character vectors:

	(`xlabelwidth;3 5"one  two  three") of `g
or
	(`xlabelwidth;("one";"two";"three")) of `g

Now that we have specified the y-axis labels and can determine their
widths, we can easily create a nice effect for these labels:

	`g has (`ylabeljustify;`top)
	`g has (`ymajorticksize;/0(`ylabelwidth;labels) of `g)
	`g has (`ylabeljustify;`bottom)


2h. Alternate Axes

The last two graph components have to do with arranging traces with
different scales on the same graph. Neither of these components appear
in the default form of a graph. The components are the alternate x-axis
and the alternate y-axis. We begin by demonstrating how these components
can be made to appear and disappear.

The default axis configuration consisting of an x-axis on the bottom and
a y-axis on the left can be specified as follows:

	`g has (`axis;`std)

It is also possible to have a alternate x-axis at the top of the graph
and an alternate y-axis to the right. In fact, any or all of these four
can be used, or none. For example:
	
	`g has (`axis;`box)           All four axes
	`g has (`axis;`xYy)           Three axes; the alternate x-axis is
				        missing. 

Instead of `xYy, as in the last example, any of `xyY, `Yxy, `xy, `YX,
etc. can be used, and the axis designators (x, y, X, Y) can appear
in any order.
	
	`g has (`axis;`)              No axes.

There are also interesting effects when just the rules for certain axes
are used. For example:

	`g has (`axis;`std)           Standard x-axis and y-axis.
	`g has (`rule;`XY)	      Include rules on the top and right.
or
	`g has (`axis;`)              No axes.
	`g has (`rule;`box)	      Enclosing box made up of axis rules.

In these examples the alternate axes have the same scales as the
corresponding default axes, but in practice they are most useful when
they have different scales. This is because it is often useful for
traces with values in different scales to appear on the same graph: for
example, two traces of bond prices and another of their spreads, where
the prices are plotted on the y-axis and the spreads on the alternate
y-axis.

	$off                  Exit from A+

Press F4 to start A+ again, then move the cursor back to the tutorial
buffer, on the next line.

	$load s

	p198.8 99.6 101.3 99.1 100.7   
	p2101.8 101.2 99.9 100.5 99.6
	sp1-p2
	g`p1 `p2 `s
	show `g is `graph
	`p2 has (`linecolor;`yellow)
	`g has (`xs`ys;(300;200))      This may have no effect, i.e.,
				       this may be the default size.

You can see that the two price traces are clustered around 100 and the
spread is clustered around 0, which is to be expected. When they are all
plotted on the same scale, the graph has very poor resolution. Even
worse, it does not make sense to plot them on the same scale.

The spread should be plotted on a separate graph, or on a separate scale
on the same graph.  The alternate y-axis can be used for this purpose,
as follows:

	`s has (`yaxis;`Y)   

Setting the `yaxis attribute for a trace set to be the alternate y-axis
modifies the graph so that the trace set is plotted on a second,
independent y-axis appearing on the right of the plot area. Note that
removing the spread trace set from those to be plotted on the left
y-axis enabled that axis to be rescaled.
  
The default value for the `yaxis attribute is `y, which causes the trace
set to be plotted on the original left y-axis.

	`s has (`yaxis;`y)
	`s has (`yaxis;`Y)

Note that specifying `yaxis to be the alternate y-axis caused that axis
to appear. The automatic appearance of the alternate y-axis is due to
the setting of the `axis attribute for g, which is `std, the default.
For any other setting, the traces will be rescaled but alternate axes
will not appear automatically.

	`s has (`yaxis;`y)   
	`g has (`axis;`xy)     The graph looks the same as the `std setting.
	`s has (`yaxis;`Y)     Rescale the traces, but no alternate y-axis.

	`s has (`yaxis;`y)   
	`g has (`axis;`std)
	`s has (`yaxis;`Y)     Rescale the traces,and get alternate y-axis.

The `std value for the axis attribute can be said to be passive,
however. Setting axis to `std does not cause the graph to be redrawn:

	`g has (`axis;`xy)     Active: removes the alternate y-axis.
        `s has (`yaxis;`y) 
	`s has (`yaxis;`Y)     Rescale the traces, but no alternate y-axis. 
	`g has (`axis;`std)    Passive: still no alternate y-axis.
	`p2 has (`linecolor;`yellow)   Forced redrawing shows the axis.

Grid lines can drawn for either the y-axis or the alternate y-axis, but
not both:

	`g has (`grid;`y)
	`g has (`grid;`Y)
	`g has (`grid;`Yy)
	`g has (`grid;`yY)
	
All attributes for the alternate y-axis are the counterparts of y-axis
attributes, and therefore are not illustrated here. They are all listed
at the beginning of the tutorial.

The x-axis can be controlled in the same was as the y-axis. Again, we
content ourselves with the listing of the attributes at the beginning of
the tutorial, except to note these combined forms:

	`g has (`grid;`xy)
	`g has (`grid;`xY)
	`g has (`grid;`Xy)     Accepted, but no vertical grid lines at
	`g has (`grid;`XY)       this time, because no alternate x-axis.
	`g has (`grid;`none)


2h. Zero Axes

An additional one or two axes can be included on a graph, each passing
through 0 on the appropriate axis. The values of the zero attribute are
`none, `x, `X, `y, `Y, `xy, `xY, `Xy, and `XY:

	`g has (`zero;`xY)

The width, color, and style of these axes can be controlled:

	`g has (`zerowidth;5)
	`g has (`zerofg;`seagreen)
	`g has (`zerostyle;`dash3)

The values for width are 0 through 10. Those for style are `dot1 through
`dot5, `dotdash1 through `dotdash5, `dash1 through `dash5, and `solid.

	`g has (`zero;`none)


3. Trace Styles


So far we have dealt only with graphs composed of line segments. In this
section the other graph styles available will be illustrated. We will
use the same data as earlier on.

	$off                  Exit from A+

Press F4 to start A+ again, then move the cursor back to the tutorial
buffer, on the next line.

	$load s

	x0 "/usr/local/aplus-fsf-4.22/doc/tutorials/graphs/graph_data.m";

We can restrict our attention to a single day.

	x50x
	yx[;0 1]
	g`y
	show `g is `graph
	`g has (`xs`ys;(800;300))
     	`g has (`xlabelout;`hrmin24)
	`g has (`ylabelout;`32nd)

The default graph style is `line. The first set of variations in style
are scatter, line-scatter, and bar chart:
  
	`y has (`style;`scatter)       
	`y has (`style;`linescatter)     `ls for short is accepted
	`y has (`style;`step)
	`y has (`style;`stepscatter)     `ss for short is accepted
	`y has (`style;`bar)

Just as you saw for `line, if the trace set has more than two columns
then more than one trace is drawn. For example:

	yx[;0 1 2]

There are now two visible bar graphs, colored the same as if they were
line or scatter plots.

	`y has (`style;`line)
	`y has (`style;`bar)

However, in the case of bar graphs, these colors are default fill
colors, not default line colors. We can set the fill colors:
 
	`y has (`fillcolor;`yellow `pink)

Note that the legend samples for the two traces appear to be quite
different from the traces themselves, in that fairly prominent red and
green borders appear in the legend, whereas the borders in the traces,
if they appear at all, may be narrow and faint. We can bring out the
borders in the traces by limiting the graph to fewer points.

	y5y

The borders should be visible now. They have the same line color
characteristic that line graphs have:

	`y has (`fillcolor;`red `green)
	`y has (`linecolor;`yellow `pink)

Neither of these settings may be easy to see except in the legend, but
they still hold if we change the style of the graph:
	
	`y has (`style;`scatter)

Note that the fillcolor setting is used for the symbols in a scatter
plot; in a linescatter plot, the linecolor settings apply to the line
segments and the fillcolor settings apply to the symbols.

	`y has (`style;`linescatter)

The symbols that appear in scatter and linescatter traces can be any of
the values shown in the following statements:

	`y has (`symbol;`square `squarefilled)
	`y has (`symbol;`circle `circlefilled)
	`y has (`symbol;`diamond `diamondfilled)
	`y has (`symbol;`cross `xsym)
	`y has (`symbol;`triangle `trianglefilled)
	`y has (`symbol;`star)           If too few, used cyclically.

The size of the symbols (in pixels) can be specified:

	`y has (`symbolsize;50)
	`y has (`symbolsize;10)

The symbol can also be set to any character vector or symbol:

	`y has (`symbol;"Vertex")
        `y has (`symbol;`Open`High)

This is where the font attribute of the trace set comes into play.

	`y has (`font;"Courier50")        This may take a moment to do.
	`y has (`symbol;`cross`circle)
		
Let's return to the bar graphs:

	`y has (`style;`bar)

The border in a bar graph is only 1 pixel thick, and the thickness
cannot be changed. In a graph with many bars, the border may even be
eliminated:

	yx[;0 1]     No borders
	y5y         Borders present

One last point about these trace styles. The bars and their borders in a
bar chart can be individually colored using the `gradient attribute,
which cycles through the specified colors, and if none were specified
(i.e., a null specification) then through the colors in s.FILLCOLORS and
s.LINECOLORS:

	`y has (`gradient;1)
	`y has (`fillcolor;)
	`y has (`linecolor;)

(The borders do not show now because the default values of s.FILLCOLORS
and s.LINECOLORS are the same.)

The gradient attribute applies to scatter plots as well:

	`y has (`style;`scatter)

(Of course, bars and symbols can be colored individually by making the
fillcolor and linecolor attributes of the trace set functional; then the
colors can be related to the data values. See "Functional Attributes" in
the A+ Reference Manual).
 
The remaining graph styles to be illustrated with this data take
advantage of the full range of high, low, open, and close information in
the data.  We will stay with the bar chart for the moment:
	
	`y has (`style;`bar)
	`y has (`gradient;0)
	y5x
	`y has (`fillcolor;`red `blue `white `green)

You should see four bar chart traces. The first, in red and appearing on
the left in each group, is the open for time period. The second is the
high and is in blue, the third is the low and is in white, and the
fourth is the close and is in green. These four traces can be combined
in one high-low-open-close chart:

	`y has (`linestyle;`solid)	
	`y has (`linecolor;`red)
	`y has (`style;`ohlc) 
	
Each line extends from the low to the high and has ticks pointing left
at the opening and right at the close. This style often looks better
with wider lines:

	`y has (`linewidth;3)

Note that the line width also applies to the length of the open and
close tick marks on the vertical line segments.

The other style that uses the complete high, low, open, and close data
is candlestick.

	`y has (`style;`candle)

Again, each one extends from low to high, but the range between open and
close is indicated by a box, the candle (the rest being the wick). Since
there is only one line color, if the close exceeds the open, the candle
is hollow; otherwise it is filled.  The fill color can be specified, but
using the `linecolor attribute instead of `fillcolor:

	`y has (`linecolor;`red `pink `white `green)

As you can see, the first color, red, is the color of the fill when the
open exceeds the close, the second is the color of the vertical line
segments (the wicks), the third is the border color of the filled areas,
and the fourth is the color of the fill when the open is less than the
close. Because the line color attribute is responsible for all color
variations, it is easy to switch meaningfully among graph types.

	`y has (`style;`ohlc)    
	`y has (`style;`scatter `line `linescatter `bar)

When the value of `style has more than one element, it must be
restricted to styles that require only one y-coordinate, i.e., one
column of the trace-set matrix.

If fewer than four values are supplied for these attributes, they are
used cyclically. If we then set two styles on the current graph:

	`y has (`style;`line `bar)

we see that the first and third traces are line graphs, while the second
and fourth are bar graphs.

Finally, we have high-low, high-low-close, and close graphs. High-low
graphs naturally use three-column matrices, high-low-close four-column,
and close graphs two-column. These styles can be applied to the current
five-column y, however:  the high-low graph will use columns 0, 2, and
3; the high-low-close graph will use columns 0, 2, 3, and 4; and the
close graph will use columns 0 and 4.

	`y has (`style;`highlow)        `hl is accepted for short
	`y has (`style;`highlowc)       `hlc is accepted for short
	`y has (`style;`close)          `c is accepted for short

In the case of a high-low graph, the data y can also have four columns,
in which case the first three are used as the x-coordinates, highs, and
lows.  For close graphs the data can also have three or four columns,
and the first and last column are used in each case.

It is often useful in complicated graphs to be able to remove some
traces at certain points in an application, and then later put them
back.  This can accomplished by setting their style to `none, or simply
` for short.
 
	`y has (`style;`scatter `line `linescatter `bar)
	`y has (`style;`scatter `line `none `bar)
	`y has (`style;`scatter `line `linescatter `)

Finally, there is a style for drawing arbitrary line segments, and two
other styles related to filling in areas, and for those we will use
different traces.

	$off                  Exit from A+

Press F4 to start A+ again, then move the cursor back to the tutorial
buffer, on the next line.

	$load s

There are times when you want a trace made of disconnected line
segments.  This can be done when the number of line segments is small by
using separate traces, but even then the set of lines cannot be moved or
copied as a group. The segment style solves this problem. The argument
must be a two-column matrix of coordinate points. The points are grouped
in pairs to form line segments: the first two rows form the first
segment, the second two rows the next segment, and so on. For example:

	x10 20 0 1 1 0 1 1 2 0 2 1 3 0 3 1 4 0 4 1 5
        x
        5 2 2x               Show the segments even better.
	g`x
	show `g is `graph

In this view `x is an ordinary line trace. But:
	
	`x has (`style;`segment)

Moving on to the styles that fill in areas:

	x(10)*2
	`x has (`style;`fill)

The fill style connects the first and last points of a trace and then
fills in the resulting closed polygon with the fillcolor.

	`x has (`fillcolor;`blue)

You should now be able to distinguish the fillcolor from the linecolor
border, but even so, for this example we will set:

	`x has (`linecolor;`white)

There is a complement to this graph, obtained by filling in underneath
the curve:

	`x has (`style;`area)

Both areas can be put on one graph.

	`x has (`style;`line)
	x(#x),x~x
	`x has (`style;`fill `area)
	`x has (`fillcolor;`red `blue)

Now give both traces the `fill style:

	`x has (`style;`fill)

Since both traces have the same values, only one shows in the graph.
This is not true, however, if they are both `area graphs:

	`x has (`style;`area)

Area graphs are cumulative; the top of the red graph actually represents
the trace x[;1] plus the trace x[;2]. We can see this by making a third
trace which is this sum, and displaying it as a `line graph by default.
It will lie along the top of the red area:

	yx[;0],@@0 x[;1]+x[;2]
	gg,`y

If we made this separate trace set an area graph, it would be cumulative
also:

     	`y has (`style;`area)
     	`y has (`style;`line)

A variation of the area graph is the stack graph, which is a stacked bar
chart:

	`x has (`style;`stack)


3a. Text Traces

Some of the traces on a graph can be textual, and thereby used to
annotate various aspects of a graph.

	$off                  Exit from A+

Press F4 to start A+ again, then move the cursor back to the tutorial
buffer, on the next line.

	$load s

	x0 "/usr/local/aplus-fsf-4.22/doc/tutorials/graphs/graph_data.m";

	yx[;0 1]
	g`y
	show `g is `graph
	`g has (`xs`ys;(800;300))
     	`g has (`xlabelout;`day7) 
	`g has (`ylabelout;`32nd)

All trace sets have titles, but only those titles associated with
certain trace sets are visible: namely, trace sets whose style is `text
and which have only one coordinate point. (Actually, although it would
normally be pointless, the trace set can contain more than one trace and
points can be added -- and ignored by A+ -- after the title is
displayed.) For example:

	z1 2719900000 107.3
	gg,`z
	`z has (`style;`text)

Note that a text trace does not appear in the legend. The default title
of a trace set is its name, and you should now see "z" on the graph. We
can set the title to the name of the contract with the data y:

	`z has (`title;`Contract_JYU2)
	`z has (`title;"Contract: JYU2")

The appearance of titles can be modified by specifying their font and
color:

	`z has (`titlefont;"Helvetica-Bold-20")
	`z has (`titlefg;`yellow)

The value of z, which is the coordinate of the title, marks the lower
left corner of the text.


4. Graph Attributes


The attributes illustrated here are the background color of a graph, the
coordinate window, and margins. We continue with the current example.

The color midnight blue is commonly used for the background color in
graphics packages:

	`g has (`bg;`midnightblue)

Now, however, the axes and legend must be recolored in order to be
visible. The foreground color fg applies to all axes, axis labels,
legend titles, and legend border whose colors have not been explicitly
set.

	`g has (`fg;`white)

Another interesting background color is:

	`g has (`bg;`green4)
	`g has (`fg;`black)

The color name green, and many others (see the A+ Reference Manual) can
be modified with the digits 1 through 4, indicating the degree of
grayness in the color. green4 is the most gray of the four, and muted
colors are best for graph backgrounds.

	`g has (`bg;`green3)
	`g has (`bg;`green2)
	`g has (`bg;`green1)
	`g has (`bg;`green4)
	`g has (`fg;`white)

The margins of the area consisting of the plot area, axes and labels,
and axis titles can be controlled; their values are in percentages,
i.e., integers between 0 and 100, or nonnegative fractions less than 1.
First put axis titles on the graph:
	
	`g has (`xtitle;"x-axis title")
	`g has (`ytitle;"y-axis title")
	`g has (`ytitlestyle;`ver)

	`g has (`left;20)
	`g has (`left;0)
	`g has (`right;0.2)
	`g has (`right;0)
	`g has (`bottom;20)
	`g has (`bottom;0)
	`g has (`top;0.2)
	`g has (`top;0)

By default, the extreme values of traces touch the boundaries of plot
areas; however, there is a margin around the plot area that can be
specified, in percentages or fractions. For example:

	`g has (`xleft;5)
	`g has (`xright;0.05)
	`g has (`ybottom;5)
	`g has (`ytop;0.05)

Note that the plot area for traces whose scales are the alternate axes
can be specified separately using `Xleft, `Xright, `Ybottom, and `Ytop.

The coordinate window can also be specified. This is particularly useful
when

    lining up traces on the alternate y-axis with those on the y-axis;

    having more direct control, in terms of data, over the margins to 
     accommodate new data.

The lower left corner has coordinates (`xmin,`ymin) and the upper right 
corner has coordinates (`xmax,`ymax).

	(/y),/y                     xmin, ymin, xmax, ymax.
 719746439 106.59 720372715 107.54    The output is reproduced here 
                                        for convenience.

These values define the default coordinate window. If we set the window
to these values, the trace will once again fit tightly in the window.

	`g has (`rule;`box)
	`g has (`xmin `ymin `xmax `ymax;(719746439;106.59;720372715;107.54))

Now, move the mouse pointer to the graph and press any one of the arrow
keys.  As you see, the graph window moves over the graph. (If you click
the key too quickly and the window keeps moving, just press any key to
stop it.) This is particularly useful for time-series data. The window
can be set to show only the most important part of the series, while the
user can still see the rest by using the arrow keys.

If only `xmin and `xmax have been set, then only horizontal motion is
possible, and if only `ymin and `ymax have been set, then only vertical
motion is possible.


5. User Interactions


A+ graphics provides a rich set of user interactions for customizing the
display, editing the traces (and thereby the data), and examining the
details of the traces.

	$off                  Exit from A+

Press F4 to start A+ again, then move the cursor back to the tutorial
buffer, on the next line.

	$load s

	x0 "/usr/local/aplus-fsf-4.22/doc/tutorials/graphs/graph_data.m";

	yx
	g`y
	`g is `graph
	`g has (`xs`ys;(800;300))
     	`g has (`xlabelout;`hrminsec)
        `g has (`xsublabelout;`mdy_u)
	`g has (`ylabelout;`32nd)
	z1 2719900000 107.3
	gg,`z
	`z has (`title;"Contract: JYU2")
	`z has (`style;`text)
	show `g


5a. Zooming

In the current example, the useful data is in clusters which take up a
very small total area. We can use zooming to look at the details of one
of these clusters. Pick one and imagine a box around it. Move the
pointer to a corner of that imaginary box and press and hold the left
button. As you move the pointer a zoom box will appear, anchored to the
spot where the pointer was when the button was pressed, and attached to
the moving pointer. Move the pointer to a spot where the zoom box
encloses a cluster of data (or almost does) and release the mouse
button. The graph will be redrawn for the data within the zoom box only.
In this example there is no need to zoom further because the detail of
the cluster you enlarged should be apparent. When there are many points,
however, you may have to zoom several times to see all the details. Or
you may simply zoom again to neaten up the view, perhaps for printing.

While in the zoomed state you may want to look at the details of another
data cluster. One way to do this is to "unzoom" and then zoom again on
the new cluster. Another way is provided, however. While zoomed, the
graph window acts like a view window that can be moved over the original
graph using the arrow keys. Try it.
 
To "unzoom," i.e., to get back to the original graph, put the pointer on
the graph and double-click the left button.

If you start the zooming process and change your mind while manipulating
the zoom box, simply move the pointer near the anchor point or outside
the graph object entirely and release the button.


5b. Vertical Cursor and Cross Hairs

Zooming is only one way to examine the finer structure in a graph. There
are also vertical line and cross hair scans. Put the pointer on the
graph, and then press and hold the middle button. You will see three new
things: a vertical line running through the pointer; a modified legend
box that now displays y-coordinate values, in addition to trace
identifiers and trace segments; and a new box (next to the pointer) that
displays the x-coordinate.

As the pointer moves and the vertical line sweeps across the graph, the
line passes over x-coordinates for which there are data values.  As this
happens the values in the boxes change to the corresponding x-coordinate
and y-coordinate values. When the pointer is in an area outside the
range of the x-values, the displayed x-values vary continuously and
y-values are not shown.

You can display this variant of the legend even when you are not in the
vertical cursor mode. The displayed values in the legend will be those
in the last elements or rows of all the trace sets.

	`g has (`legendstyle;`lastvalue)

If you press the Control key and then press and hold the middle button,
you will see a somewhat different display: there are cross hairs instead
of a vertical line cursor; the legend is unmodified; both the x- and
y-coordinates are displayed in a new box, near the intersection of the
cross hairs. As the pointer moves, the intersection point of the
cross-hairs cursor moves with it and the changing coordinates are
displayed in the box. Both coordinates vary continuously in the
appropriate scale units as the cursor moves.

You can release the Control key once the cross hairs appear.

If there are alternate axes in use, then at any time that the vertical
or cross-hairs cursor is active, press the right button (in addition to
the middle) to see the alternate coordinates displayed in the moving box
as the cursor moves.
 

5c. Referencing a Graph, Line Trace, or Trace Point

Both a graph and its traces have refer events that can have active
callback functions. For example, define the following generic callback
function, which simply prints out the value of its static data argument,
the trace set (if any) associated with the event, and the (x-axis,
y-axis) coordinates of the pointer when certain events happen:

	gcbf{s;c;v}:(s;`selected of c,v;`coordinate of `g)	

(Use "`Coordinate of `g" when it is appropriate to query the coordinate
values of the alternate axes.) Set the refer attribute on the graph as
follows:

	`g has (`refer;(gcbf;`refer))

Now put the mouse pointer anywhere within the window border of the graph
and press the left mouse button. You will see `refer displayed in your
A+ session, showing that the refer event callback function was called,
together with the coordinates of the pointer position when the refer
attribute happened. In practice, the callback function would be defined
to do something meaningful.

A refer event can occur on a trace if
  its style is line,
  the trace is the only one in its trace set,
  the trace set has two columns, meaning that the x-coordinates are
    explicitly specified, and
  when the mouse pointer is on a line segment connecting two data 
   points, you double-click the left mouse button.
But first the trace must be selectable:

	yx[;0 1]
	`y has (`selectable;1)  
	`y has (`refer;(gcbf;`refertrace))

Now put the mouse pointer anywhere on a line segment and double-click
the left mouse button. You will see `refertrace displayed in your A+
session when you have successfully selected the trace; you will also see
that the pointer is now a red arrow when it is near the selected trace
and cross hairs away from it. Note that a new `refer appears just above
the `refertrace in your A+ session, because a refer event was caused by
the first click of the double click.

To revert to the unselected state, move the pointer onto the graph but
outside that object, and double-click the left button.

Finally, a referpoint event occurs when the mouse pointer is on a trace
point and the left mouse button is pressed:

	yx
	`y has (`referpoint;(gcbf;`referpoint))

The selected attribute of the trace will hold the (row index, column
index) of the referenced point.

Put the mouse pointer on a trace point and press the left mouse button.

Unlike refer events on traces, referpoint events occur no matter how
many traces there are in a trace set, and no matter what the trace
style. For example, set:

	`y has (`style;`ohlc)

and zoom the graph until you see distinct vertical segments. Put the
mouse pointer on one of the segments and press the left mouse button
to get a referpoint event.

To get back to where we were, move the mouse pointer off the traces and
double-click the left mouse button to undo the zooming. Then

	yx[;0 1]
	`y has (`style;`line)


5d. Selecting the Legend or a Text Trace.

Before a text trace can be selected, it must be made selectable:

	`z has (`selectable;1)

To select either the legend or a text trace, move the pointer onto it
and double-click the left button. The legend or text trace will then be
displayed with its background and foreground (i.e., text) colors
reversed.

To revert to the unselected state, move the pointer onto the graph but
outside that object, and double-click the left button.

A refer event does not occur when the legend is selected.

Try selecting the legend and text trace and reverting to the unselected
state.


5e. Repositioning the Legend and Traces

It is often useful to be able to reposition a legend or text annotation
that is covering an important part of a graph. There are also important
instances of repositioning numeric traces, such as trendlines.

To reposition an object, first select it and, with the pointer on the
object, press the left button and hold it. As you move the pointer,
either the object or an outline of it moves with the pointer. When you
release the left button, the object will stay in its last position.

Note that for any trace to be moved, it must be selectable; that is, its
selectable attribute must have the value 1. For numeric traces, only a
line trace that is the only trace in its trace set can be selected, and
therefore only such a numeric trace can be moved.

	yx[;0 1]

Try repositioning the legend and the traces. Note that when a trace is
moved, the value of the corresponding variable changes accordingly.


5f. Copying and Deleting Trace Sets

To copy a trace set, first select it, then put the pointer on it, and
press and hold the Shift key and then the left mouse button. Move the
pointer in order to position the copy; either the trace or an outline of
it will move with the pointer. When the left button is released, a copy
of the trace will appear at the last position of the pointer. (You can
then release the Shift key.) If you look at the graph variable g, you
will see that it now has a new element, in addition to `y and `z and
any elements from previous trace copies.  Execute the following to see
the new element:

	g

A+ has created a new trace set variable to accommodate the copied text
trace, and chosen its name to be the first one available from a list
that begins `a, `b, `c, ... .  The new element of g is the symbol form
of that name.

To delete a trace, first activate the default delete behavior as
follows:

	`g has (`delete;1)

Now select a trace and press the Meta-Delete key (on an IBM keyboard,
Alt-Delete). The trace will disappear.  It has been deleted and its
variable removed from g.

As with repositioning, a trace must be selectable to copy or delete it.


5g. Editing and Creating Text Traces

Before we begin this section, restore the graph as follows:

	yx[;0 1]
	g`y`z

You can edit a text trace on the screen. Simply move the pointer onto
the text, hold down the Meta (diamond) key (Alt on IBM keyboards), and
press the middle mouse button. An edit window will appear around the
text and you can now delete and insert characters. Press the Return key
when editing is complete. If you then examine the title of the text
trace you will see the modified text.

Try editing the text trace in the current example and then check:

	`title of `z

We can monitor the editing of text traces:

	`z has (`textactivate;(gcbf;`text_activate))

Edit the text again; when you press Return at the end of the editing
process the callback function is executed.

If the pointer is on the graph but not on the text of a text trace when
the Meta key and middle button are pressed, an empty edit box will
appear.  The text entered in this box will be the title of a new text
trace; the data of the new trace will be a matrix with shape 1 2 holding
the user coordinates of the pointer location when the edit box was
initialized.

If you change your mind at any time while editing or creating a text
trace, simply press the Esc key to abort the editing and restore the
previous status.

Try bringing up the edit box for a new text trace and entering some
text. Press the Return key when entry is done. Then enter

	g

Just as when copying text traces, you will find a new name (symbol) appended
to g.  Examine the title and data of the new text trace.

Text traces created in this way are automatically selectable, and therefore
can be moved, copied, and deleted.

You can use the mode attribute to initiate the creation of a text trace
at the point indicated by the coordinate attribute:

        `g has (`coordinate;719974911 107.45)
        `g has (`mode;`addtexttrace)

Now enter some text in the new trace, but don't press Return.

        `g has (`mode;`normal)

This setting of mode terminates interactive entry. The third setting is
`addtrace, which begins interactive entry of a line trace. A user can
terminate an interaction begun by a setting of mode, and an entry
initiated by the user can be terminated by a setting of mode.

You also have control over the behavior when users add, copy, and delete
text traces. For example, using the generic callback function defined
above we can monitor the adding and copying of text traces:

	`g has (`addtexttrace;(gcbf;`add_text_trace))
	`g has (`copytexttrace;(gcbf;`copy_text_trace))

Now attempt to copy the text trace on the graph (see "5f. Copying and
Deleting Trace Sets"). When the copy sequence is completed, you will
see `copy_text_trace appear in your A+ session, indicating that the
function gcbf was called, and the coordinates of the pointer at the time
the copy event occurred. The copy will not be made, naturally, since the
default meaning of the copy sequence has been superseded by the call to
gcbf.  Of course, you can redefine gcbf to put a copy of the text trace
z at the coordinates given by `coordinate of `g.

The same behavior occurs when you complete the procedure for creating a
new text trace, as described earlier in this section.

The default behavior can be restored as follows:

	`g has (`addtexttrace;)

The control of trace deletion is similar, as in: 

	`g has (`delete;(gcbf;`delete))

Now select the text trace and press Meta-Delete.

 
5h. Modifying and Creating Numeric Traces

It is also possible to modify numeric traces. To do this you must place
the pointer near a data point, so first zoom in on one of the clusters.
Place the pointer on a data point (i.e., a vertex of the graph) and
press and hold the right button. Small cross hairs under the pointer and
a box containing the x- and y-coordinates of the point should appear and
the connecting line segments should change color. As you move the
pointer the cross hairs will move up and down vertically, remaining
parallel with pointer. Release the button and the graph will be modified
to show the data point moved to the location of the cross hairs when the
button was released. The value of the trace set variable will have
changed accordingly.  The `selected attribute of the trace will hold the
(row index, column index) pair of the moved point.

Try modifying various points of the graph and examine the changed values
of the trace set variable.

There are two attributes associated with modifying numeric traces on the
screen. As you may have noticed, it is not necessary to place the
pointer exactly on the data point to be moved. It is only necessary to
get close to the data point, and the required closeness can be
specified:

	`g has (`selectdistance;50)

The default value for this attribute is 10, and 50 is a bit large, but
you can now see quite easily the general behavior of the data point
selection algorithm. In effect, an imaginary region based on the value
of this attribute is placed around the data point, and if the pointer
falls in that region, the data point is selected. Experiment with
selecting data points with this large value of the selectdistance
attribute.

Secondly, the constraint that only the y-coordinate is modified, which is
useful for avoiding small, unwanted changes is the x-coordinates, is an
attribute value:

	`movelimit of `y
<  `x                     This is the default

If this attribute is set to `y, then only the x-coordinate can be
modified, and if it is set to `none then both coordinates can be
modified. The default is `x. Note that this attribute is effective for
two-column trace sets only; in all other trace sets, only the
y-coordinate can be modified, because either there are no explicit
x-coordinates to be modified or each x-coordinate is paired with several
y-coordinates and moving it would affect several points.

Line traces can created on the screen. Place the mouse pointer on the
graph, press and hold the Control key, and then press and hold the left
mouse button. As you move the mouse pointer a line will appear with one
end anchored at the spot where you first pressed the left mouse button,
and the other attached to the pointer. Release the mouse button and the
line segment will become fixed, with small knobs at the two ends.

You can rotate the line segment and change its length by putting the
mouse pointer on either knob, pressing and holding the left mouse
button, and moving the knob.  You can reposition it in a parallel
fashion by putting the pointer on the line away from the knobs, pressing
and holding the left mouse button, and moving the line.

You can make more line segments by putting the mouse pointer on the knob
at either end, pressing and holding the Shift key and then the left
mouse button, and then moving the pointer.  Release the mouse button to
get a new line segment. (Once the line segment connected to the pointer
appears, the Shift key can be released.)
 
Double-click the left mouse button to fix the line segments as a new
trace.

If at any time you change your mind about creating a new line trace,
press the Esc key. Or, if you change your mind about adding a new line
segment to a trace you are creating, but are already in the process of
doing so, move the pointer so the ends of that line segment are close
together, and release the button.

Line traces created in this way are automatically selectable, and
therefore can be moved, copied, and deleted.

As with text traces, the programmer has control over how users add,
copy, and delete line traces. For example, using the generic callback
function defined above, we can monitor the adding and copying of line
traces:

	`g has (`addtrace;(gcbf;`add_line_trace))
	`g has (`copytrace;(gcbf;`copy_line_trace))

Deleting traces is the same as for text traces. As with text traces, in
practice the callback function would be defined to carry out some action
reasonable for the application at hand.


6. Monitoring Performance

It may be necessary to improve the performance of your application by
improving its interface to graphics. Many actions cause a graph to be
completely redrawn, and some of those redrawings may be unnecessary. A
different sequence of actions may reduce the amount of redrawing, Also,
if the last point in a trace is modified only that modification should
take place on the graph, i.e., there should not be a complete redrawing.

The s.QUIET variable is a tool for monitoring performance. If it is set
to 0 (the default), then whenever the graph is redrawn, updated, or
printed, an A+ comment to that effect appears in the A+ session log.

s.QUIET can have any of four values and four corresponding sets of
messages are displayed by the screen management system:

  -1: None.

   2: Severe errors.

   1: Moderate and severe errors.

   0: Information, warnings, and moderate and severe errors.

Restricting the messages to the ones you need under the particular
execution circumstances can greatly reduce clutter in the A+ session
log.

You have seen the information messages that are displayed. We will now
show the error messages. We start fresh.

	$off  Exit from A+

Press F4 to start A+ again, then move the cursor back to the tutorial
buffer, on the next line.

	$load s

	y98+0.01+?20100
	g`y
	`g is `slot

Since g is not a slotfiller, this attempted binding is a severe error,
whose level is recognizable by the two exclamation points.

	`g is `graph
        `g has (`unknownattribute;0)

Since there is no such attribute, this attempted setting is a moderate
error, whose level is recognizable by the single exclamation point.

Back to performance.

Now we will show the graph and then set some attributes and adjust a
data point. After each action, you should see an information message,
redraw:

        show `g
	`g has (`ylabelout;`float)
	`y has (`style;`scatter)
        y[1+#y]y[1+#y]+0.01

One way to reduce the number of redrawings is to set attributes before
showing the graph. For example:

	free `g
	
Now define g to be a graph, but do not show it:

	`g is `graph

Set the two attributes that were set above and adjust a data point
again:

	`g has (`ylabelout;`float) 
	`y has (`style;`scatter)
        y[1+#y]y[1+#y]+0.01

Now show the graph:

	show `g

In this sequence the graph is drawn only once, while in the first
sequence it was drawn four times. This is better style as well, since
the graph will not appear to go through a series of incremental changes
to get to its final state.

Now let's leave some room to append points to y and accordingly make the
width of the graph (attribute xs) 50% larger, to accommodate the longer
axis:

	`g has (`xmax;30;  `xs;1.5  >`xs of `g)

When there is room for additional points and the append form of
assignment is used, then adding points does not cause the entire graph
to be redrawn, but only a portion, in an append operation. We will time
the first two actions, to show the efficiency of appending over
redrawing, even in a simple one-trace graph:

        time yy,98.3            Not an append assignment; redraw.
        time y[,]98.4           An append assignment; no redraw.
        y[,]98.6 98.5 98.8      Likewise.
        y[,]1298.9 98.8        Run out of space; redraw.
@ 1.1 log @Initial revision @ text @d730 1 a730 1 x0 "/usr/local/aplus-fsf-4.18/doc/tutorials/graphs/graph_data.m"; d1275 1 a1275 1 x0 "/usr/local/aplus-fsf-4.18/doc/tutorials/graphs/graph_data.m"; d1580 1 a1580 1 x0 "/usr/local/aplus-fsf-4.18/doc/tutorials/graphs/graph_data.m"; d1728 1 a1728 1 x0 "/usr/local/aplus-fsf-4.18/doc/tutorials/graphs/graph_data.m"; @ aplus-fsf-4.22/src/html/tutorials/graphs/graph_tutorial.html0000444000265000001440000022675010774505464020023  
                              Graph Tutorial

1. Introduction
2. The Components of a Graph
	Attributes:	xs
			ys
2a. Traces and Trace Sets
	Attributes:	linecolor (*)
			linestyle (*)
			linewidth (*)
2b. Title
	Attributes:	title
			titlefg
			titlefont
			titlejustify
2c. Subtitle
	Attributes:	subtitle
			subtitlefg
			subtitlefont
			subtitlejustify
2d. Footnote
	Attributes:	footnote
			footnotefg
			footnotefont
			footnotejustify
2e. Legend
	Attributes:	legend		
			legend (*)	
			legendbg
			legendfg
			legendfont
			legendstyle
			xlegend
			ylegend
			legendhlthickness
			legendshadowthickness
2f. x-Axis and y-Axis Titles
	Attributes:	x/X/y/Ytitle (**)	
			x/X/y/Ytitlefg (**)	
			x/X/y/Ytitlefont (**)
			x/X/y/Ytitlejustify (**)
			y/Ytitlestyle (**)	
2g. Axes
	Attributes:	axis
			x/X/y/Yfg (**)
			grid		
			gridfg		
			gridstyle	
			gridwidth	
			rule
			rulewidth
                        y/Ymode (**)
2g1. Axis Ticks
	Attributes:	x/X/y/Yinc (**)
			x/X/y/Ymajorticksize (**)
			x/X/y/Yminorticks (**)
			x/X/y/Yminorticksize (**)	
			x/X/y/Ytickstyle (**)
2g2. Axis Labels
	Attributes:	x/X/y/Ylabelfont (**)
			x/X/y/Ylabeljustify (**)
			x/X/y/Ylabelout (**)
			x/Xsublabel (**)
			x/Xsublabeljustify (**)
2g3. Controlling Tick Mark Location and Label Formatting
	Attributes:	x/X/y/Ylabel (**)  	
			x/y/X/Yextent (**)
			x/y/X/Ylabelheight (**)
			x/X/y/Ylabelwidth (**)
			x/Xsublabelout (**)
2h. Alternate Axes
	Attributes:	axis
			x/yaxis (*,**)
2i. Zero Axes
	Attributes:	zero
			zerofg
			zerostyle
			zerowidth
3. Trace Styles	
	Attributes:	barwidth
			fillcolor (*)
			font 
			gradient (*)
			style (*)
			symbol (*)
			symbolsize (*)
3a. Text Traces
	Attributes:	title (*)			
			titlefg (*)			
			titlefont (*)			
4. Graph Attributes
	Attributes:	bg
			bottom			
			fg			
			left			
			refer
			right			
			top			
			y/Ybottom (**)
			y/Ytop (**)
			x/Xleft	(**)
			x/Xright (**)
			x/Xmin (**)
			x/Xmax (**)
			y/Ymin (**)
			y/Ymax (**)
5. User Interactions
5a. Zooming
5b. Vertical Cursor and Cross Hairs
	Attributes:	legendstyle
5c. Referencing a Graph, Line Trace, or Trace Point
	Attributes:	coordinate/Coordinate	
			refer
			referpoint
			selectable	
			selected
5d. Selecting the Legend or a Text Trace
5e. Repositioning the Legend and Traces
5f. Copying and Deleting Traces
	Attributes:	delete	
5g. Editing and Creating Text Traces 
	Attributes:	addtexttrace
		        copytextrace
			delete (as callback function)
                        mode
			textactivate
5h. Modifying and Creating Numeric Traces
	Attributes:	addtrace
			copytrace
			movelimit (*)
			selected (*)
			selectdistance
6. Monitoring Performance
        Variable:       s.QUIET

(*) Trace set attributes, or trace attributes for short. All the others
are graph attributes.

(**) An attribute with x/X/y/Y prefixed to its name is one that is
separately defined for all four axes. The four axes are: the normal
x-axis at the bottom of the graph, referred to as "x"; the normal y-axis
at the left of the graph, referred to as "y"; the alternate x-axis at
the top of the graph, referred to as "X"; and the alternate y-axis at
the right of the graph, referred to as "Y". For example, x/X/y/Ytitle
means there are four attributes: xtitle, Xtitle, ytitle, and Ytitle, one
for each of the axes; x/yaxis means there are two attributes, xaxis and
yaxis.


1. Introduction


The purpose of this tutorial is to familiarize the reader with the graph
display class in the A+ screen management system. In general, only those
aspects of screen management specific to graphs are discussed here. See
the general screen management tutorial to learn how the more widely
applicable functions apply to graphs.

The tutorial is made up of descriptions and A+ examples. You should set
up your Emacs environment to have two visible buffers, one holding the
tutorial and the other an A+ session. If you are currently reading this
in Emacs, simply press F4.

To bring individual expressions from the tutorial into the A+ session,
place the cursor on the expression and press F2. It is assumed that the
expressions and functions are brought into the A+ session when you first
encounter them.

If you need more help on running Emacs and A+ see the "Getting Started"
tutorial.

Once you have an active A+ session, load the screen management system by
entering

	$load s 

That is, place the cursor on the above expression and press F2.

At various points in the exercises, you will refresh the A+ session by
exiting with $off, pressing F4 to start A+ again, and then loading the
screen management system. Session refreshings will be indicated as
follows:
	
	$off  Exit from A+ 

Press F4 to start A+ again, then move the cursor back to the tutorial
buffer, on the next line.

	$load s

You may make mistakes when running the tutorial and it may become
difficult to get back to a place where you can continue. At that point
you should simply go back to the latest session refresh sequence and
start over from there.

Two more things before we start. First of all, by default graphs appear
in the upper left corner of the screen. To avoid having the graphs
overlay the tutorial, move the Emacs screen to the lower right, or put
the tutorial in the bottom Emacs buffer and the A+ session in the top
(you can do this by pressing F5 and then F6; you may have to do it more
than once.)

Secondly, even though the default sizes of the examples may be quite
small, don't resize them unless told to do so, because the resizing may
change the details of the graphs.

In the examples we usually display the graphs first and then set their
attributes so that you can see the effects. In practice, however, you
set the attributes before displaying the graph.


2. The Components of a Graph


A graph is a layout composed of one or more trace sets. The simplest
trace set is a vector v, whose elements are plotted as the y-coordinates
with x-coordinates #v. That is, the points (i,v[i]) are plotted for all
i from 0 to (#v)-1.

	v 53 14 27 2 31 85 30 11 67 50
	g`v
	show `g is `graph

At this point you should see a window with "A+" in the grey title bar,
and a gray graph area below it. The graph area has a title area with "g"
in it, an x-axis and a y-axis, a legend, and a trace. This is the
default appearance of the graph. Each of these components can be
modified by setting the appropriate attributes, and there are other
components that do not appear in the default. And, of course, there can
be more than one trace on a graph. We will look at all of these
components in this section.

There are two attributes that allow us to control the size of the graph.
We will use these attributes for resizing to ensure that the assumptions
about the appearance of the graphs are correct.

	`g has (`xs`ys;(300;200))      This may have no effect, i.e.,
				       this may be the default size.

2a. Traces and Trace Sets 

The present graph g has only one trace set, i.e., one component variable
v.  However, like any container, it can have more than one. For example,

	w(#v)*2
	gg,`w

You should now see two traces on the graph, and an updated legend.

The more general form of a trace set is a matrix rather then a vector,
because then the x-coordinates as well as the y-coordinates can be
specified.  The individual coordinates are arranged as rows of the
matrix, with the x-coordinates along the first column and y-coordinates
along the second.  For example,

	x4 28 10 4 24 1 5 6 60
	x  
  8 10        	
  4 24		
  1  5        	
  6 60        	
 	gg,`x

You should now see three traces on the graph, and an updated legend.
Note that the new trace is indicated in the legend by "x:0", instead of
simply "x".  The reason for this is that matrix trace sets can provide
more than one trace on the graph. For example, if we catenate a new
column onto x as follows:

	xx(,@1 0) 40 20 50 80

you will see a fourth trace and a new row in the legend, indicated by
"x:1".  The 3-column matrix x provides two traces to the graph, both
with the same x-coordinates. One trace is defined by columns 0 and 1 of
x (the one indicated by "x:0" in the legend), and the other is defined
by columns 0 and 2 (and indicated by "x:1" in the legend). All traces in
a trace set share the same x-coordinates, which are in column 0 of the
matrix.

Note that in the default case, the traces in a trace set share the same
color, but are distinguished by their line styles. Both line color and
line style are trace set attributes that can be set. For example:

	`w has (`linecolor;`yellow)
	`w has (`linestyle;`dot)
 	
A full list of colors can be found in the A+ reference manual.  The line
styles are `solid, `dash (e.g., the trace indicated by "x:1" in the
legend), `dot and `dotdash. For example:

	`w has (`linestyle;`dotdash)

(Toggle back and forth between the last two expressions to see the
difference in the two line styles.) Also, `dot1 through `dot5 give
various intervals between dots, with `dot1 the smallest, `dot5 the
largest, and `dot3 the same as `dot.

	`w has (`linestyle;`dot1)
	`w has (`linestyle;`dot2)
	`w has (`linestyle;`dot3)
	`w has (`linestyle;`dot4)
	`w has (`linestyle;`dot5)

Analogously, there are `dash1 through `dash5 (different length dashes)
and `dotdash1 through `dotdash5.

The line colors and line styles can be set individually for all traces
in a trace set by specifying these attributes to have vectors of values.

	`x has (`linecolor;`white `dodgerblue)
	`x has (`linestyle;`dot `solid)

The last attribute affecting the appearance of line graphs allows the
line width to specified, which is useful for emphasis:

	`v has (`linewidth;2)

Note that the width of the corresponding line segment in the legend also
changed. The units of line width are pixels.

The last thing to be illustrated in this section is that a trace set
with multiple visible traces behaves differently in a graph with a
single trace set and in a graph with multiple visible trace sets. We
will use a separate graph and locate it 350 pixels to the right, for
simultaneous viewing. First, return the original graph to its default
values:

        `x has (`linecolor;; `linestyle;); `v has (`linewidth;);
	xx4 28 10 4 24 1 5 6 60
	gg`xx
	show `gg is `graph; `gg has (`x;350);
     	xxxx(,@1 0) 40 20 50 80
     
The two traces contributed by x to the graph g, which is a graph with
multiple trace sets, have the same color, but different line styles;
color is used to differentiate among trace sets. On the other hand, the
two traces contributed by xx to the graph gg, which has only one trace
set, have different colors, but the same line style.

	free `gg

Most of the attributes set so far have been on the trace sets, but three
(the size parameters `xs and `ys and the horizontal position parameter
`x) have been on the graph itself. This distinction is sometimes made
explicit by our referring to attributes as "trace attributes" or "graph
attributes."

There are other visual forms a trace can take besides these various line
styles; see "3. Trace Styles."
 

2b. Title

The "g" that appears at the top of the gray plot area in our current
example is the title of the graph.  A more meaningful title can be
specified using the `title attribute:

	`g has (`title;"Graph Tutorial Example")

Both color and the font can also be set, and the title can be justified.
There may be a delay in changing the font. Wait for the change before
proceeding. (A list of recommended fonts can be found in the A+
Reference Manual.)

	`g has (`titlefg;`yellow)
	`g has (`titlefont;"helvetica-bold-20")
	`g has (`titlejustify;`left)                  or `right
	`g has (`titlejustify;`center)

The title can have more than one line:

	`g has (`title;("Graph Tutorial Example";"Components of a Graph"))

Note that the plot area composed of the axes and traces was
automatically resized to accommodate the two rows of the title.

The title can be removed by setting it to the empty vector:

	`g has (`title;"")


2c. Subtitle

One graph component that does not appear in the default form of a graph
is the subtitle. The subtitle appears between the title and the plot
area. Since it has color and font settings separate from those for the
title, it can be used for more effective title presentations. For
example, put the first row of the title back:

	`g has (`title;"Graph Tutorial Example")

and put the second row back as the subtitle:

	`g has (`subtitle;"Components of a Graph")
	`g has (`subtitlefg;`blue)
	`g has (`subtitlefont;"Times-Roman-15")
	`g has (`subtitlejustify;`left)               or `right
	`g has (`subtitlejustify;`center)

Subtitles, like titles, can have more than one row, and are removed by
setting their value to "".


2d. Footnote

The footnote is another component that does not appear in the default 
form of a graph. 

	`g has (`footnote;"Morgan Stanley Co.")
	`g has (`footnotefg;`yellow)
        `g has (`footnotefont;"Times-BoldItalic-15")
	`g has (`footnotejustify;`center)                  or `right
	`g has (`footnotejustify;`left)

Footnotes are removed by setting their value to "".


2e. Legend

The text in the legend can be set for each trace set:

	`v has (`legend;"solid red")
        `w has (`legend;"broken yellow")
	`x has (`legend;("solid blue";"broken blue"))

Note that if the text for a legend entry is the empty character vector,
that entry is removed.

	`v has (`legend;"")
	`v has (`legend;"solid red")

At this point you may want to resize the graph window, since otherwise
the legend will now take up a large portion of the plot area.

	`g has (`xs`ys;(600;500))   

The legend box can also be repositioned within the plot area.

	`g has (`legend;`br)          Bottom right	
	`g has (`legend;`tc)          top center
	`g has (`legend;`tl)          top left (where we started)

Other settings are `tr, `bl, and `bc. (Note that we just set the `legend
attribute for the graph g, while just above are settings of the `legend
attribute for trace sets.) In addition, you can specify the position of
the upper left corner of the legend box, as percentages of the
horizontal and vertical lengths of the graph window. They take effect
when `legend has the value `xy:
	
	`g has (`xlegend `ylegend;(25;75))   the (x,y) percentages
  	`g has (`legend;`xy)		    

Now that the `legend attribute has been set to `xy, settings of `xlegend
and `ylegend take effect immediately:

	`g has (`xlegend;50)

Note that the legend cannot be partially hidden by the choice of
`xlegend and `ylegend. For example, if these coordinates are set to
(95,95) one might expect that only the upper left corner of the legend
would be visible. However, this is not the case:

	`g has (`xlegend `ylegend;(95;95))   the (x,y) percentages

The specified position is respected as far as possible, consistent with
keeping the legend completely visible.

The values of `xlegend and `ylegend are integers between 0 and 100 or,
alternatively, fractions between 0 and 1.

The legend can also be strung out horizontally:

	`g has (`legend;`tl) 		 
	`g has (`legendstyle;`hor)

The original configuration is:

	`g has (`legendstyle;`ver)

Other attributes control the colors and font of the legend.
Specifically, the background color of the legend:

	`g has (`legendbg;`white)

the foreground color, or color of the text in the legend:

	`g has (`legendfg;`blue)

the font of the text in the legend:

	`g has (`legendfont;"Times-Roman-15")
	
and, finally, even the pixel width of the legend's highlight and shadow
thicknesses (the defaults are 1):

	`g has (`legendshadowthickness;3)
	`g has (`legendhlthickness;2)

The legend can be made to blend into the graph:

	`g has (`legendbg;0`bg of `g)
	`g has (`legendshadowthickness;0)
	`g has (`legendhlthickness;0)
    
The legend can be removed by setting the legend position to `none:

	`g has (`legend;`none)


2f. x-Axis and y-Axis Titles

Titles for axes are two other components that do not appear in the 
default form of a graph.     

	`g has (`xtitle;"0 to 9")      	    
	`g has (`ytitle;"0 to 81")	   

Let's make them big enough to be easily seen:

	`g has (`xtitlefont;"Times-Roman-25")    
	`g has (`ytitlefont;"Times-Roman-25")    

Note that the x-axis title is positioned below the x-axis and the y-axis
title is above the y-axis. The y-axis title can be repositioned
vertically along the y-axis as follows:

	`g has (`ytitlestyle;`ver)	    

The axis titles can be justified:

	`g has (`xtitlejustify;`left)
	`g has (`xtitlejustify;`right)
	`g has (`xtitlejustify;`center)
	`g has (`ytitlejustify;`top)
	`g has (`ytitlejustify;`bottom)
	`g has (`ytitlejustify;`center)

Return to the original position with:

	`g has (`ytitlestyle;`hor)	   

The y-axis title can now be justified right and left:

	`g has (`ytitlejustify;`left)
	`g has (`ytitlejustify;`right)
	`g has (`ytitlejustify;`center)

Notice that there seems to be no difference in right and center
justification of the y-axis title. We can set the left margin so you can
see the difference:

	`g has (`left;20)
	`g has (`ytitlejustify;`left)
	`g has (`ytitlejustify;`right)
	`g has (`ytitlejustify;`center)
	`g has (`left;0)

We'll have more to say about margins later. The colors of the axis
titles can be set separately:

	`g has (`xtitlefg;`red)
	`g has (`ytitlefg;`yellow)

	
2g. Axes

Most of the settable attributes in good graphics packages deal with
axes, and this one is no different. There are four parts to an axis: the
rule which extends the length of the axis; the tick marks; the labels on
the tick marks; and the grid lines of the graph associated with the tick
marks. Each of these parts can be controlled with the appropriate
attributes. In addition, there are a few attributes that affect the
overall appearance of the axes.

First of all, we can control the color of the axes:

	`g has (`xfg;`yellow)    		 
	`g has (`yfg;`red)    		 

We can also control the thickness of the axis rules:

	`g has (`rulewidth;2)  	

As you can see, the thickness of both axes rules and tick marks are affected.
The units of the axis thickness are pixels.

A rule width of 0 has special meaning. Although it looks no different
from 1 on the screen, it has the effect of drawing the rules more
efficiently, and more importantly, perhaps, there is a noticeable
difference when a graph is printed.

	`g has (`rulewidth;0)  	

More interesting, perhaps, is the control one has over the style of the
axes. We will go through all the possibilities. For example, we can have
an x-axis only or a y-axis only.
 
	`g has (`axis;`x)		
	`g has (`axis;`y)		
	`g has (`axis;`xy)		

Vertical grid lines can be placed at the major x-axis tick marks.

	`g has (`grid;`x)	
      
Likewise, horizontal grid lines can be placed at the major y-axis tick
marks.

	`g has (`grid;`y)

Both horizontal and vertical grid lines are also possible:
    
	`g has (`grid;`xy)     

Both the widths (in pixels) and colors of the gridlines can be set:

	`g has (`gridwidth;2)
	`g has (`gridfg;`green)

A grid width of 0 has the same effects as a rule width of 0:

	`g has (`gridwidth;0)

There is a `rule attribute whose default value is `axis, meaning that
any axes that appear have rules. This attribute can also be set to
values like those for `grid, indicating which axes have rules. For
example, we can have a graph with an ordinary y-axis and just the x-axis
rule:
 
	`g has (`axis;`y)
	`g has (`rule;`xy)

An interesting effect is obtained by removing the rule from the y-axis:

	`g has (`rule;`x)

The graph can have ascending values or descending values:

	`g has (`ymode;`descend)
	`g has (`ymode;`ascend)


2g1. Axis Tick Marks

We will use an uncluttered graph to illustrate the details of tick-mark
and label attributes.

	$off                  Exit from A+

Press F4 to start A+ again, then move the cursor back to the tutorial
buffer, on the next line.

	$load s

	v 53 14 27 2 31 85 30 11 67 50
	g`v
	show `g is `graph
	`g has (`xs`ys;(300;200))      This may have no effect, i.e.,
				       this may be the default size.

The lengths of both the major and minor tick marks can be set. The unit
of length is pixels. Let's first look at the default values to get a
sense of their scale.

	`xmajorticksize of `g		
<  10					 A+ output
	`xminorticksize of `g		
<  6					 A+ output

The tick marks can be made smaller, leaving a larger plot area. For
example:

	`g has (`xminorticksize;2)	
	`g has (`xmajorticksize;5)	

The number of minor tick marks that appear between major tick marks can
be specified, for the x-axis and y-axis separately. In the present
example, 4 minor tick marks between major tick marks on the y-axis would
put a mark at every increment of 5:
	
	`g has (`yminorticks;4)

It often improves the appearance of a graph to remove the minor tick
marks, which can be done by setting their number to 0. For example:

	`g has (`xminorticks;0)

The number of major tick marks can also be specified, if somewhat
indirectly, by specifying the increment between major tick marks. For
example:

	`g has (`yinc;40)
	`g has (`xinc;2)

And, finally, we can control the style of the tick marks: pointing away
from the plot area, into the plot area, or straddling the axis:

	`g has (`ytickstyle;`in)      The tick marks point inwards
	`g has (`xtickstyle;`inout)   The tick marks straddle the axis
	`g has (`xtickstyle;`out)     The tick marks point outwards 
	
The latter is the default. Graphs with tick style `in are effective
because the plot area is larger, and the inward pointing ticks rarely
decrease the usable plot area.


2g2. Axis Labels

We have control over two aspects of the axis labels: the font in which
they are set and their format.

At this point it is useful to switch to an example with realistic data.

	$off                  Exit from A+

Press F4 to start A+ again, then move the cursor back to the tutorial
buffer, on the next line.

	$load s
	x0 "/usr/local/aplus-fsf-4.22/doc/tutorials/graphs/graph_data.m";

This data is high, low, open, close information taken at, roughly, 
5-minute intervals over a 5-day period in Tokyo. The market day is
partitioned into 5-minute increments and x contains one row for each
period. A timestamp, which is in column 0, is the time of the last
reading for the 5-minute period in which it falls. The timestamps are
Unix timestamps.

The data in columns 1 through 4 of a given row are associated with the 
5-minute time period in which the timestamp in column 0 lies. They
represent, starting with column 1, the high value of all readings taken
during the 5-minute period, the low value, the open, and the close.
  
At this point we need only one of the traces:

	yx[;0 1]
	g`y
	show `g is `graph
	`g has (`xs`ys;(300;200))      This may have no effect, i.e.,
				       this may be the default size.

You will notice that the data on the graph appears clustered in several
areas, and these clusters are connected by relatively long line
segments.  The clusters represent periods of market activity, while the
long line segments represent periods during which the market is closed.
In applications, these long segments would be factored out to give the
graph a uniform appearance, but that is not a concern here.

Let's look at the timestamp format on the x-axis labels first. Since
this is daily data, we start with the seven-day format, which uses
abbreviated names for the days:

	`g has (`xlabelout;`day7_u)

Note that the major tick marks indicate the beginning of every other
day, and the minor tick marks therefore mark the remaining days.

Let's look at days of the month or days of the year, which are integers
indicating the number of days since the beginning of the month or year:
 
	`g has (`xlabelout;`day31_u)

The minor tick marks now represent half days.
  
	`g has (`xlabelout;`day365_u)

Once again, the minor tick marks represent days.

The time span between major tick marks, and therefore the meaning of the
minor tick marks, depends to a large extent on the sizes of the labels,
because these sizes determine the number of labels the graph can
accommodate.  We have some indirect control over the number of labels
that appear and their format, because we can specify the font for the
labels. (More direct control is described below in "2g3. Controlling Tick
Mark Location and Label Formatting".) For example:

	`g has (`xlabelout;`day7_u)

Check the default label font, and then set it to a smaller pixel size.

	`xlabelfont of `g			
	`g has (`xlabelfont;"Helvetica-Bold-7") 

You should now see a major tick for each weekday. Of course the labels
are very hard to read. Another possibility is to simply choose the size
of the graph appropriately. First reset the axis font:

	`g has (`xlabelfont;"Helvetica-Bold-12")

and then resize the graph:

	`g has (`xs`ys;(800;300))

There are two month-only formats, one that uses names and the other the
numbers 1 through 12, and there are two year-only formats using 2 digits
and 4 digits. These formats are not particularly interesting for data
which is all from the same month, but for completeness here they are:

	`g has (`xlabelout;`m_u)
	`g has (`xlabelout;`m12_u)
	`g has (`xlabelout;`y2_u)
	`g has (`xlabelout;`y4_u)

The next format gives a text form of day, month and year, while the four
that follow give various abbreviated forms:

	`g has (`xlabelout;`mdy_u)
	`g has (`xlabelout;`mdy2_u)
	`g has (`xlabelout;`mdy4_u)
	`g has (`xlabelout;`dmy2_u)
	`g has (`xlabelout;`dmy4_u)

The remaining time formats are hours, minutes, and seconds, so to get
major tick marks with these units, restrict the data to a single day, as
follows:

	y50y 

The market hours are 9:30 to 11:00 and 1:30 to 3:30. Test the following 
formats:

	`g has (`xlabelout;`hrmin)
	`g has (`xlabelout;`hrmin24)
	`g has (`xlabelout;`hr)
	`g has (`xlabelout;`hr24)

To get major tick mark labels in minutes, further restrict the data as
follows:

  	y12y

This data is not fine enough to exhibit variations in seconds, but here are
the remaining time formats:

	`g has (`xlabelout;`min)
	`g has (`xlabelout;`sec)
	`g has (`xlabelout;`minsec)
	`g has (`xlabelout;`hrminsec)
	`g has (`xlabelout;`hrminsec24)

Finally, you can remove the labels altogether:

	`g has (`xlabelout;`)

In addition to the primary x-axis labels, there are sublabels that
provide a second level of text. Sublabels are useful when all the label
text does not fit conveniently on one line, and we will see examples of
this in the next section. For now, go back to the original graph of this
section:

	yx[;0 1]
	`g has (`xs`ys;(300;200))  
	`g has (`xlabelout;`day31_u)
	`g has (`xsublabelout;`m_u)       The sublabels automatically appear. 

One last point on x-axis formatting. The labels and sublabels can be
justified relative to the tick marks:

	`g has (`xlabeljustify;`right)
	`g has (`xlabeljustify;`left)
	`g has (`xlabeljustify;`center)

	`g has (`xsublabeljustify;`right)
	`g has (`xsublabeljustify;`left)
	`g has (`xsublabeljustify;`center)

The sublabels are removed in the same way as labels:

	`g has (`xsublabelout;`)

Turning now to the y-axis, which in this example represents bond prices,
there are the following formats:

	`g has (`ylabelout;`32nd)
	`g has (`ylabelout;`64th)
	`g has (`ylabelout;`128th)
	`g has (`ylabelout;`320th)
	`g has (`ylabelout;`328th)

y-axis labels can also be justified:

	`g has (`ylabeljustify;`top)
	`g has (`ylabeljustify;`bottom)
	`g has (`ylabeljustify;`center)

Finally, we have three generally applicable label formats. For
convenience we will use the present example for illustration, even
though these formats are not appropriate for the data. The first of the
three displays the decimal part of the number as a fraction:

	`g has (`ylabelout;`frac)

The last two provide conventional floating point and fixed point
formats:
	
	`g has (`ylabelout;`float)
	`g has (`ylabelout;`fixed)

The number of decimal digits that appear can be specified for the fixed
format:

	`g has (`ylabelout;(`fixed;2))

The default label format is `float.


2g3. Controlling Tick Mark Location and Label Formatting

In addition to the variety of label formats illustrated above, you can
also specify your own format, much as you specify the format of any data
that appears on the screen. Furthermore, you have complete control over
the tick mark locations and the text of the labels for those tick marks.
Let's start with a clean slate.

	$off                  Exit from A+

Press F4 to start A+ again, then move the cursor back to the tutorial
buffer, on the next line.

	$load s

The screen management system provides ways for programmers to control
the formatting of tabular data on the screen. Each array on the screen
can be controlled separately. The control mechanisms for data on the
screen are:

	 a formatting parameter for the dyadic primitive format 
	  function  can be specified for an array, and will be applied
	  to every displayed element;
	
	 a formatting parameter for the system function _fmt can be 
	  specified, and will be applied to every displayed element;
	 
	 a function can be specified that will be called for every
	  displayed element.

The same rules apply to labels on tick marks, only now the data elements
being formatted are tick values. For example:

	y98+0.01+?20100
	g`y
	show `g is `graph
	`g has (`ylabelout;6.3)    	 A valid format parameter of 

A second example:

	`g has (`ylabelout;"f10.4")	 A valid format parameter of _fmt

`ylabelout can also be specified as a function. See the discussion of
the of the `out attribute in the A+ Reference Manual.

Complete control over ticks and tick labels is provided by the `ylabel
attribute. We'll begin by adjusting the window of the current graph
slightly, just to make sure the bottom and top ticks that are created
below will appear.

	`g has (`ymin `ymax;(97.9;99.1))

The value of the `ylabel attribute is a four-element nested vector of
the form

	(ticks;labels;sizes;widths)

where 
- ticks is a numeric vector representing the tick values, or locations
on the axis where the tick marks occur;
- labels is either a nested vector of character vectors, where ilabels
is the label for the tick value i#ticks, or a character matrix, where
i#labels is the label for the tick value i#ticks;
- sizes is a vector of numbers between 0 and 1, where the length of the
i-th tick mark is i#ticks times the current size of the major ticks
(that size is controlled by the `majorticksize attribute);
- widths is a vector of integers, where i#widths is the width, in
pixels, of the grid line at the ith tick mark.
  
Continuing the previous example:

 	ticks98+.26
	labels("one";"two";"three";"four";"five";"six")
     	size0 .2 .4 .6 .8 1
     	width0 1 2 3 4 5
     	`g has (`ylabel;(ticks;labels;size;width))

You should see tick marks at locations 98, 98.2,...,99 with labels "one"
through "six". The tick marks lengths are 0, 2,...,10 pixels (10 is the
value of the `majorticksize attribute). And, finally, there are grid
lines of width 0, 1,...,5 pixels. As you can see, the possibilities are
boundless for creating major and minor tick marks with various label and
grid line strategies.

In this example all four quantities have the same length, but that is
not required. If more labels are given than there are tick marks, the
extras are ignored. If fewer are given, the missing ones are considered
to be blank.  In particular, tick marks without labels are obtained by
specifying one label, and making that one all blank.

     	`g has (`ylabel;(ticks;" ";size;width))

If either size or width has fewer elements than ticks, those elements
are used cyclically, in the manner of the A+ Reshape primitive.

     	`g has (`ylabel;(ticks;labels;size[1 3 5];width[2 4]))

It is not necessary to specify all four components; only ticks must be
present. If labels is missing, the default format is used, or the
setting of the labelout attribute if there is one.

     	`g has (`ylabel;(ticks;size[1 3 5];width[2 4]))

If only one of size and width is present, which it is can (almost)
always be determined by the values: widths must be whole numbers, while
sizes are 0, 1, or fractions in between. The one ambiguous case is a
vector of 0's and 1's, and that is taken to be a width specification.

     	`g has (`ylabel;(ticks;0 1))
	
Like `ylabelout, `ylabel can be assigned a function that will be called
whenever tick marks and labels are needed for a graph, e.g., each time a
graph is zoomed (see "5a. Zooming"). When called, the function must
produce a four-element vector like the one described above.

There are interesting interactions between xlabel settings and
sublabels.  Suppose the x-axis in the present example represents dates
and define:

     `g has (`xlabel;(210;10 3"JanAprJulOct"))

Each group of labels "Jan through "Oct" represents a year, and we can
use the sublabel attribute to put year designations under the groups:

     `g has (`xsublabel;(3 11 19;3 4"199219931994"))

When a graph is zoomed, a section of the view is blown up to fill the
entire plot area. If `ylabel is assigned a fixed value, as in the above
example, then these are the only tick marks that can be used for the
zoomed view. Some of them may fall in the range of the zoomed view, but
some may not. If the area of the original graph chosen for zooming
contained none of these tick values, no tick marks would appear. But if
`ylabel is assigned a function, that function will be called to
determine new tick locations and labels for the zoomed view.
  
There are several graph attributes that can be referenced in the `ylabel
function that produce information helpful in determining tick values and
labels.

	`yextent of `g

is a three-element vector containing the minimum value along the y-axis,
the maximum value, and a scale factor. As a result of the last
expression you should see:

<  97.9 99.1 107.5

although the third element might be different. 97.9 is the minimum value
and 99.1 the maximum value along the y axis, which we set above. The
scale factor is such that

	(99.1-97.9)107.5

is the length of the y-axis in pixels. Resize the graph, evaluate

	`yextent of `g

again, and you should see a new scale factor.

It should be easy to understand that the minimum and maximum values are
necessary for determining tick values. But what is the point of the
scale?  Well, you don't want so many tick values that the labels overrun
each other.  Since you know the length of the y-axis in pixels, once you
determine the number of tick marks, you know the distance between tick
marks in pixels.  The labelheight attributes tell you the height in
pixels of all labels, and therefore you can determine whether or not
they overlap. For example:

	`xlabelheight of `g

Analogously, xlabelwidth attributes tell you the width of labels in
pixels, which can be used, for example, to see that x-axis labels don't
overrun one another. However, the situation is more complicated for
x-axis labels, since both the label texts and font characters can have
different widths.  Therefore, to determine the width of a proposed
label, the text of the label is part of the query:

	(`xlabelwidth;"testlabel") of `g

It is also possible to determine the widths of several labels at once,
either as the rows of a character matrix or as the elements of a nested
vector of character vectors:

	(`xlabelwidth;3 5"one  two  three") of `g
or
	(`xlabelwidth;("one";"two";"three")) of `g

Now that we have specified the y-axis labels and can determine their
widths, we can easily create a nice effect for these labels:

	`g has (`ylabeljustify;`top)
	`g has (`ymajorticksize;/0(`ylabelwidth;labels) of `g)
	`g has (`ylabeljustify;`bottom)


2h. Alternate Axes

The last two graph components have to do with arranging traces with
different scales on the same graph. Neither of these components appear
in the default form of a graph. The components are the alternate x-axis
and the alternate y-axis. We begin by demonstrating how these components
can be made to appear and disappear.

The default axis configuration consisting of an x-axis on the bottom and
a y-axis on the left can be specified as follows:

	`g has (`axis;`std)

It is also possible to have a alternate x-axis at the top of the graph
and an alternate y-axis to the right. In fact, any or all of these four
can be used, or none. For example:
	
	`g has (`axis;`box)           All four axes
	`g has (`axis;`xYy)           Three axes; the alternate x-axis is
				        missing. 

Instead of `xYy, as in the last example, any of `xyY, `Yxy, `xy, `YX,
etc. can be used, and the axis designators (x, y, X, Y) can appear
in any order.
	
	`g has (`axis;`)              No axes.

There are also interesting effects when just the rules for certain axes
are used. For example:

	`g has (`axis;`std)           Standard x-axis and y-axis.
	`g has (`rule;`XY)	      Include rules on the top and right.
or
	`g has (`axis;`)              No axes.
	`g has (`rule;`box)	      Enclosing box made up of axis rules.

In these examples the alternate axes have the same scales as the
corresponding default axes, but in practice they are most useful when
they have different scales. This is because it is often useful for
traces with values in different scales to appear on the same graph: for
example, two traces of bond prices and another of their spreads, where
the prices are plotted on the y-axis and the spreads on the alternate
y-axis.

	$off                  Exit from A+

Press F4 to start A+ again, then move the cursor back to the tutorial
buffer, on the next line.

	$load s

	p198.8 99.6 101.3 99.1 100.7   
	p2101.8 101.2 99.9 100.5 99.6
	sp1-p2
	g`p1 `p2 `s
	show `g is `graph
	`p2 has (`linecolor;`yellow)
	`g has (`xs`ys;(300;200))      This may have no effect, i.e.,
				       this may be the default size.

You can see that the two price traces are clustered around 100 and the
spread is clustered around 0, which is to be expected. When they are all
plotted on the same scale, the graph has very poor resolution. Even
worse, it does not make sense to plot them on the same scale.

The spread should be plotted on a separate graph, or on a separate scale
on the same graph.  The alternate y-axis can be used for this purpose,
as follows:

	`s has (`yaxis;`Y)   

Setting the `yaxis attribute for a trace set to be the alternate y-axis
modifies the graph so that the trace set is plotted on a second,
independent y-axis appearing on the right of the plot area. Note that
removing the spread trace set from those to be plotted on the left
y-axis enabled that axis to be rescaled.
  
The default value for the `yaxis attribute is `y, which causes the trace
set to be plotted on the original left y-axis.

	`s has (`yaxis;`y)
	`s has (`yaxis;`Y)

Note that specifying `yaxis to be the alternate y-axis caused that axis
to appear. The automatic appearance of the alternate y-axis is due to
the setting of the `axis attribute for g, which is `std, the default.
For any other setting, the traces will be rescaled but alternate axes
will not appear automatically.

	`s has (`yaxis;`y)   
	`g has (`axis;`xy)     The graph looks the same as the `std setting.
	`s has (`yaxis;`Y)     Rescale the traces, but no alternate y-axis.

	`s has (`yaxis;`y)   
	`g has (`axis;`std)
	`s has (`yaxis;`Y)     Rescale the traces,and get alternate y-axis.

The `std value for the axis attribute can be said to be passive,
however. Setting axis to `std does not cause the graph to be redrawn:

	`g has (`axis;`xy)     Active: removes the alternate y-axis.
        `s has (`yaxis;`y) 
	`s has (`yaxis;`Y)     Rescale the traces, but no alternate y-axis. 
	`g has (`axis;`std)    Passive: still no alternate y-axis.
	`p2 has (`linecolor;`yellow)   Forced redrawing shows the axis.

Grid lines can drawn for either the y-axis or the alternate y-axis, but
not both:

	`g has (`grid;`y)
	`g has (`grid;`Y)
	`g has (`grid;`Yy)
	`g has (`grid;`yY)
	
All attributes for the alternate y-axis are the counterparts of y-axis
attributes, and therefore are not illustrated here. They are all listed
at the beginning of the tutorial.

The x-axis can be controlled in the same was as the y-axis. Again, we
content ourselves with the listing of the attributes at the beginning of
the tutorial, except to note these combined forms:

	`g has (`grid;`xy)
	`g has (`grid;`xY)
	`g has (`grid;`Xy)     Accepted, but no vertical grid lines at
	`g has (`grid;`XY)       this time, because no alternate x-axis.
	`g has (`grid;`none)


2h. Zero Axes

An additional one or two axes can be included on a graph, each passing
through 0 on the appropriate axis. The values of the zero attribute are
`none, `x, `X, `y, `Y, `xy, `xY, `Xy, and `XY:

	`g has (`zero;`xY)

The width, color, and style of these axes can be controlled:

	`g has (`zerowidth;5)
	`g has (`zerofg;`seagreen)
	`g has (`zerostyle;`dash3)

The values for width are 0 through 10. Those for style are `dot1 through
`dot5, `dotdash1 through `dotdash5, `dash1 through `dash5, and `solid.

	`g has (`zero;`none)


3. Trace Styles


So far we have dealt only with graphs composed of line segments. In this
section the other graph styles available will be illustrated. We will
use the same data as earlier on.

	$off                  Exit from A+

Press F4 to start A+ again, then move the cursor back to the tutorial
buffer, on the next line.

	$load s

	x0 "/usr/local/aplus-fsf-4.22/doc/tutorials/graphs/graph_data.m";

We can restrict our attention to a single day.

	x50x
	yx[;0 1]
	g`y
	show `g is `graph
	`g has (`xs`ys;(800;300))
     	`g has (`xlabelout;`hrmin24)
	`g has (`ylabelout;`32nd)

The default graph style is `line. The first set of variations in style
are scatter, line-scatter, and bar chart:
  
	`y has (`style;`scatter)       
	`y has (`style;`linescatter)     `ls for short is accepted
	`y has (`style;`step)
	`y has (`style;`stepscatter)     `ss for short is accepted
	`y has (`style;`bar)

Just as you saw for `line, if the trace set has more than two columns
then more than one trace is drawn. For example:

	yx[;0 1 2]

There are now two visible bar graphs, colored the same as if they were
line or scatter plots.

	`y has (`style;`line)
	`y has (`style;`bar)

However, in the case of bar graphs, these colors are default fill
colors, not default line colors. We can set the fill colors:
 
	`y has (`fillcolor;`yellow `pink)

Note that the legend samples for the two traces appear to be quite
different from the traces themselves, in that fairly prominent red and
green borders appear in the legend, whereas the borders in the traces,
if they appear at all, may be narrow and faint. We can bring out the
borders in the traces by limiting the graph to fewer points.

	y5y

The borders should be visible now. They have the same line color
characteristic that line graphs have:

	`y has (`fillcolor;`red `green)
	`y has (`linecolor;`yellow `pink)

Neither of these settings may be easy to see except in the legend, but
they still hold if we change the style of the graph:
	
	`y has (`style;`scatter)

Note that the fillcolor setting is used for the symbols in a scatter
plot; in a linescatter plot, the linecolor settings apply to the line
segments and the fillcolor settings apply to the symbols.

	`y has (`style;`linescatter)

The symbols that appear in scatter and linescatter traces can be any of
the values shown in the following statements:

	`y has (`symbol;`square `squarefilled)
	`y has (`symbol;`circle `circlefilled)
	`y has (`symbol;`diamond `diamondfilled)
	`y has (`symbol;`cross `xsym)
	`y has (`symbol;`triangle `trianglefilled)
	`y has (`symbol;`star)           If too few, used cyclically.

The size of the symbols (in pixels) can be specified:

	`y has (`symbolsize;50)
	`y has (`symbolsize;10)

The symbol can also be set to any character vector or symbol:

	`y has (`symbol;"Vertex")
        `y has (`symbol;`Open`High)

This is where the font attribute of the trace set comes into play.

	`y has (`font;"Courier50")        This may take a moment to do.
	`y has (`symbol;`cross`circle)
		
Let's return to the bar graphs:

	`y has (`style;`bar)

The border in a bar graph is only 1 pixel thick, and the thickness
cannot be changed. In a graph with many bars, the border may even be
eliminated:

	yx[;0 1]     No borders
	y5y         Borders present

One last point about these trace styles. The bars and their borders in a
bar chart can be individually colored using the `gradient attribute,
which cycles through the specified colors, and if none were specified
(i.e., a null specification) then through the colors in s.FILLCOLORS and
s.LINECOLORS:

	`y has (`gradient;1)
	`y has (`fillcolor;)
	`y has (`linecolor;)

(The borders do not show now because the default values of s.FILLCOLORS
and s.LINECOLORS are the same.)

The gradient attribute applies to scatter plots as well:

	`y has (`style;`scatter)

(Of course, bars and symbols can be colored individually by making the
fillcolor and linecolor attributes of the trace set functional; then the
colors can be related to the data values. See "Functional Attributes" in
the A+ Reference Manual).
 
The remaining graph styles to be illustrated with this data take
advantage of the full range of high, low, open, and close information in
the data.  We will stay with the bar chart for the moment:
	
	`y has (`style;`bar)
	`y has (`gradient;0)
	y5x
	`y has (`fillcolor;`red `blue `white `green)

You should see four bar chart traces. The first, in red and appearing on
the left in each group, is the open for time period. The second is the
high and is in blue, the third is the low and is in white, and the
fourth is the close and is in green. These four traces can be combined
in one high-low-open-close chart:

	`y has (`linestyle;`solid)	
	`y has (`linecolor;`red)
	`y has (`style;`ohlc) 
	
Each line extends from the low to the high and has ticks pointing left
at the opening and right at the close. This style often looks better
with wider lines:

	`y has (`linewidth;3)

Note that the line width also applies to the length of the open and
close tick marks on the vertical line segments.

The other style that uses the complete high, low, open, and close data
is candlestick.

	`y has (`style;`candle)

Again, each one extends from low to high, but the range between open and
close is indicated by a box, the candle (the rest being the wick). Since
there is only one line color, if the close exceeds the open, the candle
is hollow; otherwise it is filled.  The fill color can be specified, but
using the `linecolor attribute instead of `fillcolor:

	`y has (`linecolor;`red `pink `white `green)

As you can see, the first color, red, is the color of the fill when the
open exceeds the close, the second is the color of the vertical line
segments (the wicks), the third is the border color of the filled areas,
and the fourth is the color of the fill when the open is less than the
close. Because the line color attribute is responsible for all color
variations, it is easy to switch meaningfully among graph types.

	`y has (`style;`ohlc)    
	`y has (`style;`scatter `line `linescatter `bar)

When the value of `style has more than one element, it must be
restricted to styles that require only one y-coordinate, i.e., one
column of the trace-set matrix.

If fewer than four values are supplied for these attributes, they are
used cyclically. If we then set two styles on the current graph:

	`y has (`style;`line `bar)

we see that the first and third traces are line graphs, while the second
and fourth are bar graphs.

Finally, we have high-low, high-low-close, and close graphs. High-low
graphs naturally use three-column matrices, high-low-close four-column,
and close graphs two-column. These styles can be applied to the current
five-column y, however:  the high-low graph will use columns 0, 2, and
3; the high-low-close graph will use columns 0, 2, 3, and 4; and the
close graph will use columns 0 and 4.

	`y has (`style;`highlow)        `hl is accepted for short
	`y has (`style;`highlowc)       `hlc is accepted for short
	`y has (`style;`close)          `c is accepted for short

In the case of a high-low graph, the data y can also have four columns,
in which case the first three are used as the x-coordinates, highs, and
lows.  For close graphs the data can also have three or four columns,
and the first and last column are used in each case.

It is often useful in complicated graphs to be able to remove some
traces at certain points in an application, and then later put them
back.  This can accomplished by setting their style to `none, or simply
` for short.
 
	`y has (`style;`scatter `line `linescatter `bar)
	`y has (`style;`scatter `line `none `bar)
	`y has (`style;`scatter `line `linescatter `)

Finally, there is a style for drawing arbitrary line segments, and two
other styles related to filling in areas, and for those we will use
different traces.

	$off                  Exit from A+

Press F4 to start A+ again, then move the cursor back to the tutorial
buffer, on the next line.

	$load s

There are times when you want a trace made of disconnected line
segments.  This can be done when the number of line segments is small by
using separate traces, but even then the set of lines cannot be moved or
copied as a group. The segment style solves this problem. The argument
must be a two-column matrix of coordinate points. The points are grouped
in pairs to form line segments: the first two rows form the first
segment, the second two rows the next segment, and so on. For example:

	x10 20 0 1 1 0 1 1 2 0 2 1 3 0 3 1 4 0 4 1 5
        x
        5 2 2x               Show the segments even better.
	g`x
	show `g is `graph

In this view `x is an ordinary line trace. But:
	
	`x has (`style;`segment)

Moving on to the styles that fill in areas:

	x(10)*2
	`x has (`style;`fill)

The fill style connects the first and last points of a trace and then
fills in the resulting closed polygon with the fillcolor.

	`x has (`fillcolor;`blue)

You should now be able to distinguish the fillcolor from the linecolor
border, but even so, for this example we will set:

	`x has (`linecolor;`white)

There is a complement to this graph, obtained by filling in underneath
the curve:

	`x has (`style;`area)

Both areas can be put on one graph.

	`x has (`style;`line)
	x(#x),x~x
	`x has (`style;`fill `area)
	`x has (`fillcolor;`red `blue)

Now give both traces the `fill style:

	`x has (`style;`fill)

Since both traces have the same values, only one shows in the graph.
This is not true, however, if they are both `area graphs:

	`x has (`style;`area)

Area graphs are cumulative; the top of the red graph actually represents
the trace x[;1] plus the trace x[;2]. We can see this by making a third
trace which is this sum, and displaying it as a `line graph by default.
It will lie along the top of the red area:

	yx[;0],@0 x[;1]+x[;2]
	gg,`y

If we made this separate trace set an area graph, it would be cumulative
also:

     	`y has (`style;`area)
     	`y has (`style;`line)

A variation of the area graph is the stack graph, which is a stacked bar
chart:

	`x has (`style;`stack)


3a. Text Traces

Some of the traces on a graph can be textual, and thereby used to
annotate various aspects of a graph.

	$off                  Exit from A+

Press F4 to start A+ again, then move the cursor back to the tutorial
buffer, on the next line.

	$load s

	x0 "/usr/local/aplus-fsf-4.22/doc/tutorials/graphs/graph_data.m";

	yx[;0 1]
	g`y
	show `g is `graph
	`g has (`xs`ys;(800;300))
     	`g has (`xlabelout;`day7) 
	`g has (`ylabelout;`32nd)

All trace sets have titles, but only those titles associated with
certain trace sets are visible: namely, trace sets whose style is `text
and which have only one coordinate point. (Actually, although it would
normally be pointless, the trace set can contain more than one trace and
points can be added -- and ignored by A+ -- after the title is
displayed.) For example:

	z1 2719900000 107.3
	gg,`z
	`z has (`style;`text)

Note that a text trace does not appear in the legend. The default title
of a trace set is its name, and you should now see "z" on the graph. We
can set the title to the name of the contract with the data y:

	`z has (`title;`Contract_JYU2)
	`z has (`title;"Contract: JYU2")

The appearance of titles can be modified by specifying their font and
color:

	`z has (`titlefont;"Helvetica-Bold-20")
	`z has (`titlefg;`yellow)

The value of z, which is the coordinate of the title, marks the lower
left corner of the text.


4. Graph Attributes


The attributes illustrated here are the background color of a graph, the
coordinate window, and margins. We continue with the current example.

The color midnight blue is commonly used for the background color in
graphics packages:

	`g has (`bg;`midnightblue)

Now, however, the axes and legend must be recolored in order to be
visible. The foreground color fg applies to all axes, axis labels,
legend titles, and legend border whose colors have not been explicitly
set.

	`g has (`fg;`white)

Another interesting background color is:

	`g has (`bg;`green4)
	`g has (`fg;`black)

The color name green, and many others (see the A+ Reference Manual) can
be modified with the digits 1 through 4, indicating the degree of
grayness in the color. green4 is the most gray of the four, and muted
colors are best for graph backgrounds.

	`g has (`bg;`green3)
	`g has (`bg;`green2)
	`g has (`bg;`green1)
	`g has (`bg;`green4)
	`g has (`fg;`white)

The margins of the area consisting of the plot area, axes and labels,
and axis titles can be controlled; their values are in percentages,
i.e., integers between 0 and 100, or nonnegative fractions less than 1.
First put axis titles on the graph:
	
	`g has (`xtitle;"x-axis title")
	`g has (`ytitle;"y-axis title")
	`g has (`ytitlestyle;`ver)

	`g has (`left;20)
	`g has (`left;0)
	`g has (`right;0.2)
	`g has (`right;0)
	`g has (`bottom;20)
	`g has (`bottom;0)
	`g has (`top;0.2)
	`g has (`top;0)

By default, the extreme values of traces touch the boundaries of plot
areas; however, there is a margin around the plot area that can be
specified, in percentages or fractions. For example:

	`g has (`xleft;5)
	`g has (`xright;0.05)
	`g has (`ybottom;5)
	`g has (`ytop;0.05)

Note that the plot area for traces whose scales are the alternate axes
can be specified separately using `Xleft, `Xright, `Ybottom, and `Ytop.

The coordinate window can also be specified. This is particularly useful
when

    lining up traces on the alternate y-axis with those on the y-axis;

    having more direct control, in terms of data, over the margins to 
     accommodate new data.

The lower left corner has coordinates (`xmin,`ymin) and the upper right 
corner has coordinates (`xmax,`ymax).

	(/y),/y                     xmin, ymin, xmax, ymax.
 719746439 106.59 720372715 107.54    The output is reproduced here 
                                        for convenience.

These values define the default coordinate window. If we set the window
to these values, the trace will once again fit tightly in the window.

	`g has (`rule;`box)
	`g has (`xmin `ymin `xmax `ymax;(719746439;106.59;720372715;107.54))

Now, move the mouse pointer to the graph and press any one of the arrow
keys.  As you see, the graph window moves over the graph. (If you click
the key too quickly and the window keeps moving, just press any key to
stop it.) This is particularly useful for time-series data. The window
can be set to show only the most important part of the series, while the
user can still see the rest by using the arrow keys.

If only `xmin and `xmax have been set, then only horizontal motion is
possible, and if only `ymin and `ymax have been set, then only vertical
motion is possible.


5. User Interactions


A+ graphics provides a rich set of user interactions for customizing the
display, editing the traces (and thereby the data), and examining the
details of the traces.

	$off                  Exit from A+

Press F4 to start A+ again, then move the cursor back to the tutorial
buffer, on the next line.

	$load s

	x0 "/usr/local/aplus-fsf-4.22/doc/tutorials/graphs/graph_data.m";

	yx
	g`y
	`g is `graph
	`g has (`xs`ys;(800;300))
     	`g has (`xlabelout;`hrminsec)
        `g has (`xsublabelout;`mdy_u)
	`g has (`ylabelout;`32nd)
	z1 2719900000 107.3
	gg,`z
	`z has (`title;"Contract: JYU2")
	`z has (`style;`text)
	show `g


5a. Zooming

In the current example, the useful data is in clusters which take up a
very small total area. We can use zooming to look at the details of one
of these clusters. Pick one and imagine a box around it. Move the
pointer to a corner of that imaginary box and press and hold the left
button. As you move the pointer a zoom box will appear, anchored to the
spot where the pointer was when the button was pressed, and attached to
the moving pointer. Move the pointer to a spot where the zoom box
encloses a cluster of data (or almost does) and release the mouse
button. The graph will be redrawn for the data within the zoom box only.
In this example there is no need to zoom further because the detail of
the cluster you enlarged should be apparent. When there are many points,
however, you may have to zoom several times to see all the details. Or
you may simply zoom again to neaten up the view, perhaps for printing.

While in the zoomed state you may want to look at the details of another
data cluster. One way to do this is to "unzoom" and then zoom again on
the new cluster. Another way is provided, however. While zoomed, the
graph window acts like a view window that can be moved over the original
graph using the arrow keys. Try it.
 
To "unzoom," i.e., to get back to the original graph, put the pointer on
the graph and double-click the left button.

If you start the zooming process and change your mind while manipulating
the zoom box, simply move the pointer near the anchor point or outside
the graph object entirely and release the button.


5b. Vertical Cursor and Cross Hairs

Zooming is only one way to examine the finer structure in a graph. There
are also vertical line and cross hair scans. Put the pointer on the
graph, and then press and hold the middle button. You will see three new
things: a vertical line running through the pointer; a modified legend
box that now displays y-coordinate values, in addition to trace
identifiers and trace segments; and a new box (next to the pointer) that
displays the x-coordinate.

As the pointer moves and the vertical line sweeps across the graph, the
line passes over x-coordinates for which there are data values.  As this
happens the values in the boxes change to the corresponding x-coordinate
and y-coordinate values. When the pointer is in an area outside the
range of the x-values, the displayed x-values vary continuously and
y-values are not shown.

You can display this variant of the legend even when you are not in the
vertical cursor mode. The displayed values in the legend will be those
in the last elements or rows of all the trace sets.

	`g has (`legendstyle;`lastvalue)

If you press the Control key and then press and hold the middle button,
you will see a somewhat different display: there are cross hairs instead
of a vertical line cursor; the legend is unmodified; both the x- and
y-coordinates are displayed in a new box, near the intersection of the
cross hairs. As the pointer moves, the intersection point of the
cross-hairs cursor moves with it and the changing coordinates are
displayed in the box. Both coordinates vary continuously in the
appropriate scale units as the cursor moves.

You can release the Control key once the cross hairs appear.

If there are alternate axes in use, then at any time that the vertical
or cross-hairs cursor is active, press the right button (in addition to
the middle) to see the alternate coordinates displayed in the moving box
as the cursor moves.
 

5c. Referencing a Graph, Line Trace, or Trace Point

Both a graph and its traces have refer events that can have active
callback functions. For example, define the following generic callback
function, which simply prints out the value of its static data argument,
the trace set (if any) associated with the event, and the (x-axis,
y-axis) coordinates of the pointer when certain events happen:

	gcbf{s;c;v}:(s;`selected of c,v;`coordinate of `g)	

(Use "`Coordinate of `g" when it is appropriate to query the coordinate
values of the alternate axes.) Set the refer attribute on the graph as
follows:

	`g has (`refer;(gcbf;`refer))

Now put the mouse pointer anywhere within the window border of the graph
and press the left mouse button. You will see `refer displayed in your
A+ session, showing that the refer event callback function was called,
together with the coordinates of the pointer position when the refer
attribute happened. In practice, the callback function would be defined
to do something meaningful.

A refer event can occur on a trace if
  its style is line,
  the trace is the only one in its trace set,
  the trace set has two columns, meaning that the x-coordinates are
    explicitly specified, and
  when the mouse pointer is on a line segment connecting two data 
   points, you double-click the left mouse button.
But first the trace must be selectable:

	yx[;0 1]
	`y has (`selectable;1)  
	`y has (`refer;(gcbf;`refertrace))

Now put the mouse pointer anywhere on a line segment and double-click
the left mouse button. You will see `refertrace displayed in your A+
session when you have successfully selected the trace; you will also see
that the pointer is now a red arrow when it is near the selected trace
and cross hairs away from it. Note that a new `refer appears just above
the `refertrace in your A+ session, because a refer event was caused by
the first click of the double click.

To revert to the unselected state, move the pointer onto the graph but
outside that object, and double-click the left button.

Finally, a referpoint event occurs when the mouse pointer is on a trace
point and the left mouse button is pressed:

	yx
	`y has (`referpoint;(gcbf;`referpoint))

The selected attribute of the trace will hold the (row index, column
index) of the referenced point.

Put the mouse pointer on a trace point and press the left mouse button.

Unlike refer events on traces, referpoint events occur no matter how
many traces there are in a trace set, and no matter what the trace
style. For example, set:

	`y has (`style;`ohlc)

and zoom the graph until you see distinct vertical segments. Put the
mouse pointer on one of the segments and press the left mouse button
to get a referpoint event.

To get back to where we were, move the mouse pointer off the traces and
double-click the left mouse button to undo the zooming. Then

	yx[;0 1]
	`y has (`style;`line)


5d. Selecting the Legend or a Text Trace.

Before a text trace can be selected, it must be made selectable:

	`z has (`selectable;1)

To select either the legend or a text trace, move the pointer onto it
and double-click the left button. The legend or text trace will then be
displayed with its background and foreground (i.e., text) colors
reversed.

To revert to the unselected state, move the pointer onto the graph but
outside that object, and double-click the left button.

A refer event does not occur when the legend is selected.

Try selecting the legend and text trace and reverting to the unselected
state.


5e. Repositioning the Legend and Traces

It is often useful to be able to reposition a legend or text annotation
that is covering an important part of a graph. There are also important
instances of repositioning numeric traces, such as trendlines.

To reposition an object, first select it and, with the pointer on the
object, press the left button and hold it. As you move the pointer,
either the object or an outline of it moves with the pointer. When you
release the left button, the object will stay in its last position.

Note that for any trace to be moved, it must be selectable; that is, its
selectable attribute must have the value 1. For numeric traces, only a
line trace that is the only trace in its trace set can be selected, and
therefore only such a numeric trace can be moved.

	yx[;0 1]

Try repositioning the legend and the traces. Note that when a trace is
moved, the value of the corresponding variable changes accordingly.


5f. Copying and Deleting Trace Sets

To copy a trace set, first select it, then put the pointer on it, and
press and hold the Shift key and then the left mouse button. Move the
pointer in order to position the copy; either the trace or an outline of
it will move with the pointer. When the left button is released, a copy
of the trace will appear at the last position of the pointer. (You can
then release the Shift key.) If you look at the graph variable g, you
will see that it now has a new element, in addition to `y and `z and
any elements from previous trace copies.  Execute the following to see
the new element:

	g

A+ has created a new trace set variable to accommodate the copied text
trace, and chosen its name to be the first one available from a list
that begins `a, `b, `c, ... .  The new element of g is the symbol form
of that name.

To delete a trace, first activate the default delete behavior as
follows:

	`g has (`delete;1)

Now select a trace and press the Meta-Delete key (on an IBM keyboard,
Alt-Delete). The trace will disappear.  It has been deleted and its
variable removed from g.

As with repositioning, a trace must be selectable to copy or delete it.


5g. Editing and Creating Text Traces

Before we begin this section, restore the graph as follows:

	yx[;0 1]
	g`y`z

You can edit a text trace on the screen. Simply move the pointer onto
the text, hold down the Meta (diamond) key (Alt on IBM keyboards), and
press the middle mouse button. An edit window will appear around the
text and you can now delete and insert characters. Press the Return key
when editing is complete. If you then examine the title of the text
trace you will see the modified text.

Try editing the text trace in the current example and then check:

	`title of `z

We can monitor the editing of text traces:

	`z has (`textactivate;(gcbf;`text_activate))

Edit the text again; when you press Return at the end of the editing
process the callback function is executed.

If the pointer is on the graph but not on the text of a text trace when
the Meta key and middle button are pressed, an empty edit box will
appear.  The text entered in this box will be the title of a new text
trace; the data of the new trace will be a matrix with shape 1 2 holding
the user coordinates of the pointer location when the edit box was
initialized.

If you change your mind at any time while editing or creating a text
trace, simply press the Esc key to abort the editing and restore the
previous status.

Try bringing up the edit box for a new text trace and entering some
text. Press the Return key when entry is done. Then enter

	g

Just as when copying text traces, you will find a new name (symbol) appended
to g.  Examine the title and data of the new text trace.

Text traces created in this way are automatically selectable, and therefore
can be moved, copied, and deleted.

You can use the mode attribute to initiate the creation of a text trace
at the point indicated by the coordinate attribute:

        `g has (`coordinate;719974911 107.45)
        `g has (`mode;`addtexttrace)

Now enter some text in the new trace, but don't press Return.

        `g has (`mode;`normal)

This setting of mode terminates interactive entry. The third setting is
`addtrace, which begins interactive entry of a line trace. A user can
terminate an interaction begun by a setting of mode, and an entry
initiated by the user can be terminated by a setting of mode.

You also have control over the behavior when users add, copy, and delete
text traces. For example, using the generic callback function defined
above we can monitor the adding and copying of text traces:

	`g has (`addtexttrace;(gcbf;`add_text_trace))
	`g has (`copytexttrace;(gcbf;`copy_text_trace))

Now attempt to copy the text trace on the graph (see "5f. Copying and
Deleting Trace Sets"). When the copy sequence is completed, you will
see `copy_text_trace appear in your A+ session, indicating that the
function gcbf was called, and the coordinates of the pointer at the time
the copy event occurred. The copy will not be made, naturally, since the
default meaning of the copy sequence has been superseded by the call to
gcbf.  Of course, you can redefine gcbf to put a copy of the text trace
z at the coordinates given by `coordinate of `g.

The same behavior occurs when you complete the procedure for creating a
new text trace, as described earlier in this section.

The default behavior can be restored as follows:

	`g has (`addtexttrace;)

The control of trace deletion is similar, as in: 

	`g has (`delete;(gcbf;`delete))

Now select the text trace and press Meta-Delete.

 
5h. Modifying and Creating Numeric Traces

It is also possible to modify numeric traces. To do this you must place
the pointer near a data point, so first zoom in on one of the clusters.
Place the pointer on a data point (i.e., a vertex of the graph) and
press and hold the right button. Small cross hairs under the pointer and
a box containing the x- and y-coordinates of the point should appear and
the connecting line segments should change color. As you move the
pointer the cross hairs will move up and down vertically, remaining
parallel with pointer. Release the button and the graph will be modified
to show the data point moved to the location of the cross hairs when the
button was released. The value of the trace set variable will have
changed accordingly.  The `selected attribute of the trace will hold the
(row index, column index) pair of the moved point.

Try modifying various points of the graph and examine the changed values
of the trace set variable.

There are two attributes associated with modifying numeric traces on the
screen. As you may have noticed, it is not necessary to place the
pointer exactly on the data point to be moved. It is only necessary to
get close to the data point, and the required closeness can be
specified:

	`g has (`selectdistance;50)

The default value for this attribute is 10, and 50 is a bit large, but
you can now see quite easily the general behavior of the data point
selection algorithm. In effect, an imaginary region based on the value
of this attribute is placed around the data point, and if the pointer
falls in that region, the data point is selected. Experiment with
selecting data points with this large value of the selectdistance
attribute.

Secondly, the constraint that only the y-coordinate is modified, which is
useful for avoiding small, unwanted changes is the x-coordinates, is an
attribute value:

	`movelimit of `y
<  `x                     This is the default

If this attribute is set to `y, then only the x-coordinate can be
modified, and if it is set to `none then both coordinates can be
modified. The default is `x. Note that this attribute is effective for
two-column trace sets only; in all other trace sets, only the
y-coordinate can be modified, because either there are no explicit
x-coordinates to be modified or each x-coordinate is paired with several
y-coordinates and moving it would affect several points.

Line traces can created on the screen. Place the mouse pointer on the
graph, press and hold the Control key, and then press and hold the left
mouse button. As you move the mouse pointer a line will appear with one
end anchored at the spot where you first pressed the left mouse button,
and the other attached to the pointer. Release the mouse button and the
line segment will become fixed, with small knobs at the two ends.

You can rotate the line segment and change its length by putting the
mouse pointer on either knob, pressing and holding the left mouse
button, and moving the knob.  You can reposition it in a parallel
fashion by putting the pointer on the line away from the knobs, pressing
and holding the left mouse button, and moving the line.

You can make more line segments by putting the mouse pointer on the knob
at either end, pressing and holding the Shift key and then the left
mouse button, and then moving the pointer.  Release the mouse button to
get a new line segment. (Once the line segment connected to the pointer
appears, the Shift key can be released.)
 
Double-click the left mouse button to fix the line segments as a new
trace.

If at any time you change your mind about creating a new line trace,
press the Esc key. Or, if you change your mind about adding a new line
segment to a trace you are creating, but are already in the process of
doing so, move the pointer so the ends of that line segment are close
together, and release the button.

Line traces created in this way are automatically selectable, and
therefore can be moved, copied, and deleted.

As with text traces, the programmer has control over how users add,
copy, and delete line traces. For example, using the generic callback
function defined above, we can monitor the adding and copying of line
traces:

	`g has (`addtrace;(gcbf;`add_line_trace))
	`g has (`copytrace;(gcbf;`copy_line_trace))

Deleting traces is the same as for text traces. As with text traces, in
practice the callback function would be defined to carry out some action
reasonable for the application at hand.


6. Monitoring Performance

It may be necessary to improve the performance of your application by
improving its interface to graphics. Many actions cause a graph to be
completely redrawn, and some of those redrawings may be unnecessary. A
different sequence of actions may reduce the amount of redrawing, Also,
if the last point in a trace is modified only that modification should
take place on the graph, i.e., there should not be a complete redrawing.

The s.QUIET variable is a tool for monitoring performance. If it is set
to 0 (the default), then whenever the graph is redrawn, updated, or
printed, an A+ comment to that effect appears in the A+ session log.

s.QUIET can have any of four values and four corresponding sets of
messages are displayed by the screen management system:

  -1: None.

   2: Severe errors.

   1: Moderate and severe errors.

   0: Information, warnings, and moderate and severe errors.

Restricting the messages to the ones you need under the particular
execution circumstances can greatly reduce clutter in the A+ session
log.

You have seen the information messages that are displayed. We will now
show the error messages. We start fresh.

	$off  Exit from A+

Press F4 to start A+ again, then move the cursor back to the tutorial
buffer, on the next line.

	$load s

	y98+0.01+?20100
	g`y
	`g is `slot

Since g is not a slotfiller, this attempted binding is a severe error,
whose level is recognizable by the two exclamation points.

	`g is `graph
        `g has (`unknownattribute;0)

Since there is no such attribute, this attempted setting is a moderate
error, whose level is recognizable by the single exclamation point.

Back to performance.

Now we will show the graph and then set some attributes and adjust a
data point. After each action, you should see an information message,
redraw:

        show `g
	`g has (`ylabelout;`float)
	`y has (`style;`scatter)
        y[1+#y]y[1+#y]+0.01

One way to reduce the number of redrawings is to set attributes before
showing the graph. For example:

	free `g
	
Now define g to be a graph, but do not show it:

	`g is `graph

Set the two attributes that were set above and adjust a data point
again:

	`g has (`ylabelout;`float) 
	`y has (`style;`scatter)
        y[1+#y]y[1+#y]+0.01

Now show the graph:

	show `g

In this sequence the graph is drawn only once, while in the first
sequence it was drawn four times. This is better style as well, since
the graph will not appear to go through a series of incremental changes
to get to its final state.

Now let's leave some room to append points to y and accordingly make the
width of the graph (attribute xs) 50% larger, to accommodate the longer
axis:

	`g has (`xmax;30;  `xs;1.5  >`xs of `g)

When there is room for additional points and the append form of
assignment is used, then adding points does not cause the entire graph
to be redrawn, but only a portion, in an append operation. We will time
the first two actions, to show the efficiency of appending over
redrawing, even in a simple one-trace graph:

        time yy,98.3            Not an append assignment; redraw.
        time y[,]98.4           An append assignment; no redraw.
        y[,]98.6 98.5 98.8      Likewise.
        y[,]1298.9 98.8        Run out of space; redraw.
aplus-fsf-4.22/src/html/tutorials/s.tutorials/0000777000265000001440000000000010774512523015160 5aplus-fsf-4.22/src/html/tutorials/s.tutorials/Makefile0000644000265000001440000001602210774512506016536 # Makefile.in generated by automake 1.6.3 from Makefile.am. # src/html/tutorials/s.tutorials/Makefile. Generated from Makefile.in by configure. # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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. ############################################################################### ############################################################################### SHELL = /bin/sh srcdir = . top_srcdir = ../../../.. prefix = /usr/local exec_prefix = ${prefix} bindir = ${exec_prefix}/bin sbindir = ${exec_prefix}/sbin libexecdir = ${exec_prefix}/libexec datadir = ${prefix}/share sysconfdir = ${prefix}/etc sharedstatedir = ${prefix}/com localstatedir = ${prefix}/var libdir = ${exec_prefix}/lib infodir = ${prefix}/info mandir = ${prefix}/man includedir = ${prefix}/include oldincludedir = /usr/include pkgdatadir = $(datadir)/aplus-fsf pkglibdir = $(libdir)/aplus-fsf pkgincludedir = $(includedir)/aplus-fsf top_builddir = ../../../.. ACLOCAL = aclocal-1.6 AUTOCONF = autoconf AUTOMAKE = automake-1.6 AUTOHEADER = autoheader am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = /usr/bin/install -c INSTALL_PROGRAM = ${INSTALL} INSTALL_DATA = ${INSTALL} -m 644 install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = ${INSTALL} INSTALL_HEADER = $(INSTALL_DATA) transform = s,x,x, NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = host_triplet = i686-pc-linux-gnu EXEEXT = OBJEXT = o PATH_SEPARATOR = : AMTAR = tar AS = @AS@ AWK = gawk CC = gcc CXX = g++ DEPDIR = .deps DLLTOOL = @DLLTOOL@ ECHO = echo INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s LIBTOOL = $(SHELL) $(top_builddir)/libtool LIBTOOL_DEPS = config/ltmain.sh LN_S = ln -s MAINT = # OBJDUMP = @OBJDUMP@ PACKAGE = aplus-fsf RANLIB = ranlib STRIP = strip VERSION = 4.22 X_INCLUDES = -I/usr/X11R6/include X_LIBS = -L/usr/X11R6/lib -lX11 am__include = include am__quote = install_sh = /ms/dev/aplus/aplus/fsf/src/aplus-fsf-4.22/config/install-sh s_tutorialsdir = $(prefix)/doc/html/tutorials/s.tutorials s_tutorials_DATA = \ buttons.html \ containers.html \ data.html \ introduction.html \ menus.html \ printing.html \ s_context_vars.html \ special_io.html EXTRA_DIST = \ buttons.html \ containers.html \ data.html \ introduction.html \ menus.html \ printing.html \ s_context_vars.html \ special_io.html subdir = src/html/tutorials/s.tutorials mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_CLEAN_FILES = DIST_SOURCES = DATA = $(s_tutorials_DATA) DIST_COMMON = Makefile.am Makefile.in all: all-am .SUFFIXES: $(srcdir)/Makefile.in: # Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/html/tutorials/s.tutorials/Makefile Makefile: # $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: s_tutorialsDATA_INSTALL = $(INSTALL_DATA) install-s_tutorialsDATA: $(s_tutorials_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(s_tutorialsdir) @list='$(s_tutorials_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(s_tutorialsDATA_INSTALL) $$d$$p $(DESTDIR)$(s_tutorialsdir)/$$f"; \ $(s_tutorialsDATA_INSTALL) $$d$$p $(DESTDIR)$(s_tutorialsdir)/$$f; \ done uninstall-s_tutorialsDATA: @$(NORMAL_UNINSTALL) @list='$(s_tutorials_DATA)'; for p in $$list; do \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " rm -f $(DESTDIR)$(s_tutorialsdir)/$$f"; \ rm -f $(DESTDIR)$(s_tutorialsdir)/$$f; \ done tags: TAGS TAGS: DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = ../../../.. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: $(mkinstalldirs) $(DESTDIR)$(s_tutorialsdir) 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_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_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-generic clean-libtool mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-s_tutorialsDATA install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool uninstall-am: uninstall-info-am uninstall-s_tutorialsDATA .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-s_tutorialsDATA \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool uninstall uninstall-am \ uninstall-info-am uninstall-s_tutorialsDATA # 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: aplus-fsf-4.22/src/html/tutorials/s.tutorials/buttons.html0000444000265000001440000012160610774505662017472  
                         Display Classes for Buttons
                         

1. The Action Display Class

	1a. Actions

		1a(i). Callbacks; Screen Position

			Attributes:	atsector
					preset
					set
					x
					y
					yx

		1a(ii). Other Actions

			Attributes:	f1, ..., f12
					fkeys
					selected

	1b. Appearance

		1b(i). Arrangement of the Buttons

			Attributes:	geometry
					verify

		1b(ii). Size

			Attributes:	C
					R
				       	xs
					ys
					yxs

		1b(iii). Displayed Characters

			Attributes:	justify
					label
					labelfont
					shelltitle
					title
					titlefont

		1b(iv). Color

			Attributes:	bg
					fg
					labelfg
					titlefg

	1c. Additional Windows

		1c(i). Kinds of Windows

			Attributes:  	iconic
					ws
			Variable:	s.WS

		1c(ii). Visibility

			Attributes:	followers
					followertree
					hide
					icon
					icontitle
					lower
					raise
					show

		1c(iii). Selection

			Mouse Pointer
			Keys:		Arrow keys
					Ctl-Shift-Tab
					Ctl-Tab
					Enter
					Shift-Tab
					Tab

	1d. More about Appearance

		1d(i). Changes in Appearance

			Attributes:	hl
					hlthickness
					shadowthickness

		1d(ii). Other Features

			Attributes:	exit
					foot
					head
					is
					leftfoot
					pin
                                        resizeable
					rightfoot

	1e. Status and its Preservation

		1e(i). Status

			Attributes:	bound
					class
					stateself
					settings

		1e(ii). Saving

			Attribute:	script
			Variable	s.WM_SAVE_YOURSELF

2. The Button Display Class

			Attributes:	margins
					naturalsize

3. The Check Display Class

4. The Radio Display Class

---------------------------------------------------


1. The Action Display Class


An object of the action display class is shown as a set of buttons.  Each
button can trigger some action when it is pressed -- i.e., when the left mouse
button is clicked while the pointer is on the button.  Only slotfiller
variables can be bound to this class.  The display has one button for each of
the slotfiller's symbolic indices, and these indices are used to label the
buttons by default.  The slotfiller's values do not appear in the display.

A simple example with an immediately obvious action is an object that moves
around the screen when its buttons are pressed.  First, label the buttons and
specify movements by creating the slotfiller:

     ac(`up `down `left `right;(100 0;100 0;0 100;0 100))

The numbers will be used as increments, in pixels, to the vertical and
horizontal positions.  Now, after loading the s context, use the is function

to bind ac to the action display class and then the show function to display
the object on the screen.  The is function is dyadic.  It takes the variable
name, in symbol form, as left argument, and the display class name, which is
always in symbol form, as right argument.  The show functions is monadic,
taking a variable name, in symbol form, as argument; it returns Null.  Since
is, in addition to displaying some messages, returns its left argument as an
explicit result, you can combine these two operations:

     $load s
     scrs.SCREEN-34 12
     br{w;m}:{w has (`yx;scr-m+`yxs of w);}
     show `ac is `action; br{`ac;0}

You should see an action object on the screen.  Click the left mouse button
while the pointer is on the object's "up" button.  You get a pretty animation
but no action, because no callback has been set on ac.


1a. Actions

1a(i). Callbacks; Screen Position

	Attributes:	atsector
			preset
			set
			x
			y
			yx

Suppose v is the unqualified name of a slotfiller variable bound to the action
display class and c is its context, both in symbol form.  Then whenever a
button is pressed, s makes the reassignment (pc%v)pc%v, where p is the
symbolic index corresponding to the button that was pressed.  These
assignments, since they involve the slotfiller's values, enable those values
to be used to select actions.

You write a function of the form f{s;d;i;p;c;v} that incorporates the actions
you want, and you set the callback f on cv in order to have them triggered.
In the callback, s is the static data (if any) you specified when you set the
callback and d (the data) is the value to which p is the path; you can use any
of them to determine an action.  The index i is null.

Since we will move ac around the screen as an example of the actions that can
be triggered by an object of this class, we first discuss attributes used to
position objects.

The "x" and "y" attributes specify the horizontal and vertical distances in
pixels between the top left corner of an object and the top left corner of
either the object that contains it (a layout, for example) or, for top-level
objects, the screen.  For a top-level object, the default value for each is
zero.

The of function is used to query attributes.  It takes a scalar or vector left
argument of attributes, which are always in symbol form, and a variable name,
in symbol form, as right argument.  In its result, it encloses the value for
each element of the left argument:

     `y`x of `ac

The value of the "yx" attribute is simply the vector composed of the y and x
attribute values.  The has function sets attributes.  It takes a variable
name, in symbol form, as left argument, and as right argument an association
list or slotfiller containing attribute names and values.  It returns its left
argument as explicit result.  Change x and see the new position and the new
attribute value:

     `ac has (`y;0; `x;300)
     `yx of `ac

As stated above, a value selected from ac by a button press is available to a
callback function, as its second argument.  The of function encloses attribute
values in its result, so Disclose or Raze must be used to obtain the attribute
values themselves.  Define a callback function to adjust the yx attribute by
the value selected from ac by the button press, limiting the movement so as to
stay well on any screen.  Then set the callback on ac:

     acbfn{s;d;i;p;c;v}:cv has (`yx;0600(`yx of cv)+d)
     `ac _scb (acbfn;'Just to illustrate')

Two alternative methods of setting the callback use the "set" attribute:

     `ac has (`set;acbfn)
     `ac has (`set;(acbfn;'Just to illustrate'))

If the former is used, the Null will be passed to acbfn as its first
argument; if the latter, 'Just to illustrate' will be passed.

No matter how the callback is imposed, by set or _scb, the value of the set
attribute is the name of the function and the static data (the Null, if no
static data was specified):

     `set of `ac

Having entered these statements in an A+ session, you can move the action
object around the screen, within the prescribed limits, by pressing its
buttons.  Try it.

There is a "preset" attribute that is similar to set.  It can be used to set
and query preset callbacks, functions that are called just before a value is
changed, rather than just after.  Execute

     pc{s;d;i;p;c;v}:{"Jump!";d}
     `ac has (`preset;pc)

Now move the object around the screen.  "Jump!" should appear in the session
log, showing that pc is being called.

To get rid of this preset callback, use a null function specification.  (Null
for set would likewise eliminate an ordinary callback.)  Enter

     `ac has (`preset;)

Since we have been discussing positioning, we might as well consider the
"atsector" attribute now.  It is used to move objects around the virtual
desktop and to determine where they are.  A position on the desktop is
specified by a vector of two indices.  The following three lines should move
ac to sector 1 1 and back.  (If you are already in sector 1 1, change the 1 1
to 0 0 in the second statement.).  Suppose you are in sector 1 0 (the
semicolon in the first line causes the result to be displayed -- see immediate
execution display of expression groups in the A+ Reference Manual):

     ;sector`atsector of `ac
     `ac has (`atsector;1 1)
     `ac has (`atsector;sector)

If your virtual-desktop window is visible, you can watch ac move around on it
as you change the value of the atsector attribute.

1a(ii). Other Actions

	Attributes:	f1, ..., f12
			fkeys
			selected

Whenever a button is pressed, the "selected" attribute is set to the symbolic
index corresponding to that button.  Press the "down" button; then:

     `selected of `ac

You can also set selected to any of the symbolic indices using an A+
statement.  Setting it does not cause a callback and an assignment of an
illicit value is simply ignored.  The domain of the selected attribute depends
upon the display class: for an object bound to the array class, for instance,
its value is an integer vector consisting of a row and a column index,
initially 1 1 to indicate no selection.

For any object, you can associate an action with a function key.  As an
example, define an action similar to the ones we have associated with the
buttons of ac:

     diag{x}:x has (`yx;600(|@0)100+`yx of x)

For any one of the twelve function keys, the key can be connected with a
function and an argument by a statement such as the following, which uses an
association list to specify several attributes at once.  A slotfiller can be
used instead of an association list, as you will see later.

     `ac has (`f1;(diag;`ac);`yx;0 0)

Now press the F1 key while the mouse pointer is in the ac display and you will
see the display move diagonally, with jumps to avoid getting too far.

These twelve connections are listed in the "fkeys" attribute, which is for
reference only; it cannot be set.  Its value is a slotfiller such that the
first two of the following three expressions give the same result for each of
f1, f2, ... f12.  (Recall that we must Disclose or Raze the of result to
obtain the attribute value.)

     `f1 of `ac
     `f1`fkeys of `ac
     `fkeys of `ac

You may have to move to the Emacs A+ area to page up and see all of the result
of the last statement.  Then press End and move to the tutorial area.


1b. Appearance

1b(i). Arrangement of the Buttons

	Attributes:	geometry
			verify

The default arrangement of the buttons on the screen is vertical, but you can
use the "geometry" attribute to alter it.  Try these arrangements:

     `ac has (`geometry;2);          br{`ac;0}
     `ac has (`geometry;1);          br{`ac;0}
     `ac has (`geometry;`horizontal); br{`ac;0}
     `ac has (`geometry;`vertical);   br{`ac;0}
     `ac has (`geometry;2 2);         br{`ac;0}
     `ac has (`geometry;1 1 1 1);     br{`ac;0}
     `ac has (`geometry;2);           br{`ac;0}
     `ac has (`geometry;1 1 2);       br{`ac;0}

-2 is a conventional value for horizontal arrangement, and -1 for vertical.
Non-negative numbers indicate how many buttons there are to be in each row and
are used repeatedly if necessary.

Fancier arrangements are possible using a matrix value for geometry.  The
matrix partitions the action display.  Symbolic indices of the slotfiller
indicate the arrangement, with a null symbol signifying an empty section.
Alternatively, integers can be used: they must be indices of the symbolic
indices in the slotfiller, or -1 signifying an empty section.  The order of
the buttons need not correspond to the order in the slotfiller variable.
Omissions and repetitions are allowed, but the repetitions for any given
symbolic or numeric index must form a submatrix.  In the following examples,
commas and parentheses are used only to make the examples immediately
obvious.  The first statement avoids all overlap of vertical and
horizontal buttons, the second one omits the "right" button, and the
third one provides partial overlap:

     `ac has (`geometry;3 3(` `up `),(` `down `),(`left ` `right)); br{`ac;0}
     `ac has (`geometry;3 3(` `up `),(` `down `),(`left ` `)); br{`ac;0}
     `ac has (`geometry;3 4(1 0 0 1),(1 1 1 1),(2 2 3 3)); br{`ac;0}

The geometry attribute, like set and unlike f1, is persistent.  The  free
function takes a variable name, in symbol form, as its only argument and,
besides displaying a message, returns its argument as an explicit result:

     free `ac
     show `ac is `action; br{`ac;0}

The buttons are arranged as they were before and they still function as they
did, but if you put the pointer in the ac display and press the F1 function
key nothing happens.

You can also change the order of the buttons by respecifying the underlying
variable, unless geometry contains symbolic indices.  When you respecify the
value of a variable that is bound to a display class, you might inadvertently
try to change it to a value that is not allowed for that class.  The
assignment is refused, either tersely by the interpreter, when the "verify"
attribute is 0:

     `verify of `ac
     `ac has (`verify;0)
     ac'No good!'

or with an explanation by s, when the verify attribute is 1, the default:

     
     `ac has (`verify;1)
     ac'No good!'

(The "a action" in the response is presumably for faster execution.)  Be sure
to clear the suspension:

     

1b(ii). Size

	Attributes:	C
			R
			xs
			ys
			yxs

Corresponding to the position attributes there are size attributes: "ys" is
the vertical size of the object, in pixels, and "xs" is the horizontal size.
The value of "yxs" is the concatenation of the values of ys and xs.  Try these
statements:

     `ys`xs of `ac
     ;size`yxs of `ac
     `ac has (`yxs;2size); br{`ac;0}
     `ac has (`yxs;size);   br{`ac;0}

You may have noticed the asymmetry of the ac display, caused by the unequal
lengths of the labels.  When the "C" attribute is 1, the columns are required
to be of equal width; the default for C is 0.  Watch the display of ac become
symmetric when you change C to 1:

     `C of `ac
     `ac has (`C;1); br{`ac;0}

There is a similar attribute "R", also with default 0, that requires the rows
to be of equal height when it is 1.  Here is an example showing its use.
First, load some auxiliary variables that are in a separate file to avoid
cluttering the tutorial; they will all have the prefix ld_ so you will know
where they came from.

     _load{'/usr/local/aplus-fsf-4.22/doc/tutorials/s.tutorials/aux_vars.+'};
     a(`a`b`c`d`e`f`g`h`i`j`k`l`m;(;;;;;;;;;;;;))
     lb('Exit';'Refresh';'Corporate Axes'),ld_nlb
     `a has (`class`shelltitle`title`label;(`action;'nexus';'';lb));

Note the use of a slotfiller to specify several attributes at once.  The
shelltitle, title, and label attributes are discussed in the next section, and
class in a later section.

     g` ` `a`a `b`b ` ` ` `,(20`),5ҡ`c`d`e`f`g`h`i`j`k`l`m`
     `a has (`C;1; `geometry;9 10g; `show;1; `xs;600); br{`a;0}

The two empty rows take no space now.  Setting R to 1 provides the vertical
separation implied by the geometry:

     `a has (`R;1; `xs;600); br{`a;0}

     _ex `sector `size `lb `g, free `a

1b(iii). Displayed Characters

	Attributes:	justify
			label
			labelfont
			shelltitle
			title
			titlefont

The "A+" appearing at the top of the ac display is the default value for the
"shelltitle" attribute for a top-level object.  To change it, change the value
of the shelltitle attribute:

     `ac has (`shelltitle;'Move')

The "ac" below the shelltitle is the default value of the "title" attribute.
To change it:

     `ac has (`title;'')
     `ac has (`title;' ')
     `ac has (`title;'Direction')

Notice that an empty vector means no title area at all.

The symbolic index names appearing on the buttons are, again, the default.
They appear when the "label" attribute is null.  The label attribute governs
what is shown in the label areas.  (When there are also value areas, as in the
slot class, it has no effect on them.)  If its value is a character vector or
a single symbol, the same label appears on all buttons:

     `ac has (`label;'Push')
     `ac has (`label;'')

The buttons can be separately labeled using either a vector of symbols or a
nested vector of scalars or vectors:

     `ac has (`label;`u`d`l`r)
     `ac has (`label;('';'';'';''))

The label attribute is functional, the function being called once for each
button with the path as an argument:

     f{s;d;i;p;c;v}:p(`left`right`up`down;('l';'r';'u';'d'))
     `ac has (`label;f)

The fonts need not be the default, kaplgallant-19.  Try the "titlefont" and
"labelfont" attributes:

     `ac has (`titlefont;'times-19'); br{`ac;0}
     `ac has (`labelfont;'helvetica-boldoblique-19')

The labels are centered in both directions within the buttons, by default.
The "justify" attribute is used to modify their positions.  Essentially, its
argument is one of 'l' 'r' 't' 'b' 'lt' 'lb' 'rt' 'rb' `left `right `top
`bottom, and it is cumulative (the first statement below produces no visible
effect, since there is no extra vertical space):

     `ac has (`justify;`bottom)
     `ac has (`justify;`left)
     `justify of `ac
     `ac has (`justify;'r')
     `justify of `ac

In the character form, a period at the beginning of the argument makes it
non-cumulative:

     `ac has (`justify;'.rt')
     `justify of `ac

A .t or .b argument centers the labels horizontally, .r or .l vertically.  To
restore the positions to centered both ways, set justify to null:

     `ac has (`justify;)

1b(iv). Color

	Attributes:	bg
			fg
			labelfg
			titlefg

There are four attributes that govern the colors in the display.  The default
values are:

     `titlefg `labelfg `fg `bg of `ac

The foreground attributes, "...fg", refer to text and the "bg" to background.
In our example there is no text corresponding to the "fg" attribute.  In a
member of the array display class it would be the array values (see the Data
tutorial); in the slot class it would be the contents of the value areas; and
so on.  These attributes can be set to whatever colors you want, as in:

     `ac has (`titlefg;`blue);
     `ac has (`labelfg;`green);

Vectors of colors can also be used for the labels.  The colors are used
cyclically:

     `ac has (`labelfg;`blue`brown`green`red);
     `ac has (`labelfg;`blue `red);
     `ac has (`fg;`pink);
     `ac has (`bg;`yellow);

The default colors can be restored by giving null values:

     `ac has (`titlefg `labelfg `fg `bg;(;;;));


1c. Additional Windows

1c(i). Kinds of Windows

	Attributes: 	iconic
			ws
	Variable:	s.WS

A+ can, of course, display more than one window at a time.  Produce
three more windows, without stopping to make their buttons work.
Notice that they all appear originally in the top left corner, the
default position:

     b(`run `stop `cancel;(;;))
     c(`yes `no `more;(;;))
     d(`load `save;(;))
     show `b`c`d is `action
     br{`b;0 600}; br{`c;0 400}; br{`d;0 200}

You might want each of them to be sized according to its labels, the
default.  Suppose, however, that you want them to be all the same
size.  Enlarge the smaller ones:

     `c`d has <(`yxs;>`yxs of `b);br{`d;0 200}

Incidentally, the vertical justification that you took on faith can now be
demonstrated:

     `d has (`justify;`bottom);
     `d has (`justify;);

The new windows are popups, as can be seen by their having pins rather than
buttons at the top left.  (See the s-Context Variables tutorial for a way of
changing this default.)  It is possible to change them from popups and back
again, using the "iconic" attribute, which controls this property:

     `d has (`iconic;1);
     `d has (`iconic;0);

The s-context variable s.WS contains the name of the "screen workspace", which
is always a top-level object, not a popup.  (The significance of the screen
workspace is discussed in the next section.)  The default value of s.WS,
before any objects are shown, is the Null.  When an object is initially shown
and s.WS is null, that object becomes the screen workspace unless you prevent
it.

When an object is first shown, it is prevented from becoming the screen
workspace if the value of its "ws" attribute is 1, and not prevented if ws is
0.

If you change the value of s.WS, you name a new screen workspace and you
"demote" the old one to a popup:

     `d has (`shelltitle;`Popup);
     s.WS`d
     s.WS`ac
     `ac has (`shelltitle;`Move);

Notice that the value of the shelltitle is treated as related to the screen
workspace: when the screen workspace was changed, the ac display was given its
variable name as a shelltitle and d was given "A+", the default shelltitle,
and the reverse happened when the screen workspace was changed back.  The
shelltitles that had been set were lost in the process.

1c(ii). Visibility

	Attributes:	followers
			followertree
			hide
			icon
			icontitle
			lower
			raise
			show

The "hide" attribute for a pop-up window, when specified by any value other
than 0, removes it entirely from the screen.  The "show" attribute, when
specified by any value other than 0, restores the display of the window.  It
can also create the original display of a window sometimes, i.e., be used in
place of the show function, as we will soon see.  When queried, one of these
attributes is always 1 and the other 0, corresponding to the visibility of the
window:

     `d has (`hide;);
     `hide`show of `d
     `d has (`show;);
     `hide`show of `d

The hide attribute for a top-level window, when specified by any value other
than 0, changes it to an icon, generally at a different location.  Change d to
top-level and hide it, then change it to be non-iconic and see the icon
disappear:

     `d has (`iconic;1);
     `d has (`hide;);
     `d has (`iconic;0);
     `d has `show;

Note the last form: a value need not be given for an action attribute: the
value is assumed to be 1 or, what is equivalent, null.  Now keep an eye on all
the objects:

     `ac has `hide;
     `ac has `show;

Notice that when ac was changed to an icon, the other three windows vanished.
The reason is that they are "followers" of the screen workspace, as indicated
by the attribute of that name:

     `followers of `ac

Suppose that you use the followers attribute to make d a follower of c.  The
new arrangement is reflected in the reference-only attribute "followertree",
whose value is a recursive slotfiller.  Then when c is hidden, d will be
hidden also.  Although d is no longer a follower of ac, it will still follow
it into hiding because it is a follower of a follower of ac:

     `c has (`followers;`d);
     `followertree of `ac
     `c has `hide;
     `hide of `d
     `c has `show;
     `ac has `hide;

You can change the icon image and title, using the "icon" and "icontitle"
attributes.  The value for the icon attribute must be an m by n bit matrix,
with m and n each at most 64:

     `ac has (`icontitle;'Buttons');
     `ac has (`icon;64 641 0 0 0 0);
     `ac has `show;

The other way to change visibility is to put one window in front or in back of
another, i.e., have one window obscure another.  To put one in front, set its
"raise" attribute to anything; to put it in back, set its "lower" attribute to
anything.  Note that lowering a window places it in back of everything,
including the emacs session window, and that the followers attribute is for
hiding, not lowering or freeing:

     `d has (`lower;);
     `d has `raise;
     `ac has `lower;
     `ac has (`raise;0);
     `raise of `ac

Unlike hide and show, raise and lower are pure action attributes: even setting
them to 0 causes their normal actions, and no value can be shown for them; the
of function disavows them.  Now make d a follower of ac again:

     `d has (`leader;`ac);

1c(iii). Selection

	Mouse Pointer
	Keys:		Arrows
			Ctl-Shift-Tab
			Ctl-Tab
			Enter
		       	Shift-Tab
			Tab

You have already seen that when the f1 attribute is given a non-null value for
some object, the mouse pointer must be in the object's window in order for the
F1 function key to trigger the specified action.  This property of the keys'
applying to a particular window is called "keyboard focus".  It is signalled
by a brightening of the window's border.  You can give keyboard focus to any
window that is at least partially visible just by moving the pointer into any
visible part of it.

When one s window has focus, you can move the focus to another by pressing
Control-Tab or Control-Shift-Tab.  Move the mouse pointer into one of the s
windows and press Control-Tab four times.  You will see keyboard focus and the
pointer move from one window to another.  Press Control-Shift-Tab and you will
see the keyboard focus traverse the windows in the opposite order.

Within a window, you can move the selection from one field to another by
pressing Tab or, to go in the opposite order, Shift-Tab.  Move the pointer to
the ac window and press Tab four times and then Shift-Tab four times.  The
visible sign of selection is a gold border around the selected button.

One significance of selection is that you can press the selected button by
pressing the Enter key.  (Because the buttons move the ac window, you may have
to move the pointer to maintain focus after pressing Enter.)  Now move the
pointer onto a button of another object, press and hold the left mouse button,
then release it and press and hold the Enter key.  Do you see a significant
difference between the two ways of pressing the displayed button?

When you use the left mouse button, the displayed button stays depressed for
as long as you hold the mouse button down: the displayed button acts as if it
were the mouse button.  When you press and hold Enter, however, the usual
typamatic action takes place: the displayed button is pressed and released
once, and then, after a slight pause, it is rapidly pressed repeatedly until
the Enter key is released.

Moving selection within a row or column can also be done with the arrow keys.
Movement appropriate to the key occurs in a cyclic fashion.  Try the up and
down arrow keys in the various windows after selecting a button.  Notice that
two buttons are isolated from the other two in ac as far as these arrow keys
are concerned.  Then try the left and right arrow keys in the various buttons
of ac.


1d. More about Appearance

1d(i). Changes in Appearance

	Attributes:	hl
			hlthickness
			shadowthickness

Three appearance attributes are related to selection and pressing of buttons.
The "hs" attribute controls the color of the selection border; its default
value is gold.  Execute

     `d has (`hl;`mediumseagreen)

and move the pointer to give focus to d, so that you can see the green border.

The "hlthickness" attribute controls the width of the border; its default
value is 0, which means the thinnest.  Execute

     `c has (`hlthickness;5); br{`c;0 400}

and see how the object is enlarged, to allow for the wider border.  Now give
focus to c, so that you can see this border.

When an action is taken to press a displayed button, the button appears to be
physically pressed.  The button is darkened; its bottom and right edges are
highlighted, instead of its top and left; and its top and left edges are
shadowed, instead of its bottom and right.  Thickening the edges of the
buttons increases their apparent height and emphasizes this apparent action.
The thickness is controlled by the value of the "shadowthickness" attribute,
which has a default value of 2.  Execute

     `b has (`shadowthickness;6); br{`b;0 600}

and see how the object is enlarged, to allow for the thicker edges.  Now press
one of b's buttons, and notice how the shadow is switched.

When an object is placed in a container, giving it a shadowthickness of zero
is sometimes useful, so that its buttons do not seem separate from other
objects in the container:

     `b has (`shadowthickness;0)

1d(ii). Other Features

	Attributes:	exit
		       	foot
			head
			is
			leftfoot
			pin
                        resizeable
			rightfoot

In popups, the pin can be used for communication between the viewer and the
programmer.  For example, the viewer can push the pin in to say that he wants
to have the window remain visible or pull it out to indicate that he would
like to have the window removed.  Likewise, the programmer can show the pin in
or out to state his intentions.  The viewer changes the pin position by
clicking on it with the left mouse button.  In an A+ statement, the "pin"
attribute is used to set the position.  This attribute always reflects the pin
position, 1 for in and 0 for out.  Try this sequence:

     `pin of `b`c
     `b has (`pin;1)

Place the mouse pointer on the pin of c and press and release the left mouse
button.

     `pin of `b`c
     `b has (`pin;0)

Click on the pin of c again.  The c window vanished, didn't it?  The "exit"
attribute determines what happens when a viewer attempts to remove an object
from the screen.  Its default value is 1, which means hide the object.  By
changing this value to 0, say, you can have nothing happen when the pin is
pulled:

     `d has (`exit;0)
     `d has (`pin;1)

Now click on the pin of d.  The pin moves, but nothing else happens.  You can
push and pull the pin as much as you like and nothing happens.

Exit is functional: its value can be a function.  It can be set for top-level
windows as well as popups.  For example:

     no{x}:"Don't do that to the ",x," window,",sys.getusername{},"!"
     `b has (`exit;(no;`title of `b))
     `ac has (`exit;(no;`title of `ac))

Now push and pull the pin of b.  Place the tip of the mouse pointer in the
window-manager button of the ac window, press and hold the right mouse button,
move the pointer down to "Quit", and release the button.  In both instances,
the no function is called and the usual behavior does not occur, an admonition
appearing instead.  If, however, you click on the window-manager button of the
ac window or choose "Close" from its menu, the window will be hidden; then
double-clicking on its icon will bring it back.

Three otherwise unrelated attributes pass along window-manager facilities, and
cannot be changed for a window after it has been shown.  They are "head",
"foot", and "resizeable".  None applies to objects that are not top-level or
popups, since they relate to window-manager features.  The head attribute
determines whether a window has a window-manager area at the top; since that
area is not removable for top-level objects, head applies only to popups.  The
foot attribute determines whether there is an area at the bottom for
footnotes.  The resizeable attribute determines whether the window has resize
corners; that is, whether a viewer can resize the window by dragging.

These attributes are set between binding and mapping, so this is a good time
to mention the "is" attribute.  It can contain a function (and, optionally, an
argument) that is called immediately after the variable is bound.  Its default
is null.

     ed
     f{x}:(x),' is bound to ',,`class of x
     `e has (`is;(f;`e))
     `e is `action
     `e has (`resizeable `head `foot;(0;0;1))   
     show `e; br{`e;0 200}

Note that the e display has no panel at the top, so no pin or shelltitle
appears; it has a panel at the bottom that becomes lighter when the window has
focus (and that can be used for moving with the mouse); and it should have no
resize corners -- although it probably does have them, because of a window
manager bug, an interaction between resizeable and head that causes only the
one that is set later to be obeyed when they are both set to 0.

Two footnotes can appear; they are the values of the "leftfoot" and
"rightfoot" attributes.  Space is not made for them automatically, and they
are truncated if there is not enough room:

     `e has (`leftfoot;'Morgan Stanley')
     `e has (`xs;150)
     `e has (`rightfoot;'March 1994')
     `e has (`xs;250)


1e. Status and its Preservation

1e(i). Status

	Attributes:	bound
			class
			stateself
			settings

There are attributes which give you information about objects.  Some, like the
"bound" and "class" attributes, apply meaningfully to objects that are not
bound.  The class attribute for an unbound variable, for instance, is its
default display class.  You cannot set bound directly; it is a reference-only
attribute.

     prometheus'fire'
     `bound of `e `prometheus
     `class of `e `prometheus
     `prometheus has (`class;`command)
     `bound`class of `prometheus

The bound attribute is set to 1 by the is and show functions and by a non-null
specification of the class attribute; it is set to 0 by the free function and
null specification of class.  The class attribute is set by the is function to
its right argument; it is set to a default class by the free function, in
effect, and, if bound was 0, by show.

The "settings" attribute, which is for reference only, can be used to obtain a
slotfiller holding, generally speaking, the attributes that have non-default
values (except the class attribute) and the values of those attributes.

     `settings of `e

The xs attribute was not included, because its value was not known to be
non-default.  The attributes can be restricted or extended to certain ones by
naming them.  The statement above is equivalent to (`settings;) of `e.

     (`settings;`leftfoot `xs `title) of `e

The title attribute is omitted, because its value is the default.  Since a
specific request was made for xs and its value is not known to be the default,
it is included.

The "stateself" attribute, which is also for reference only, gives the same
information as `settings of, plus the value of the class attribute.  The value
of stateself will create the object when executed in the presence of the
underlying variable with a suitable value.  It is an s definition of the
object in association-list form:

     `stateself of `e

1e(ii). Saving

	Attribute:	script
	Variable:	s.WM_SAVE_YOURSELF
	Function:	s.script{}

The s.WM_SAVE_YOURSELF variable can hold the name of a function and,
optionally, an argument.  Its default value is null.  When "Save Workspace" or
"owplaces" is selected from the OLVWM Utilities Menu, the function named in
s.WM_SAVE_YOURSELF, if any, is called, allowing any vital information to be
saved or necessary actions to be taken.

The s-context niladic function s.script produces a script that will recreate
the current screen layout, given the presence of the necessary variables with
appropriate values.  There may be no need to preserve information about some
of the objects.  The default value of 1 for the "script" attribute dictates
that the s definition of the object appear in that script and a value of 0
dictates that it not appear.  Try, for example,

     `d has (`script;0)
     s.script{}

Now clean up for the next display class:

     _ex `acbfn `pc `diag `f `no, free `ac `b `c `d `e `prometheus



2. The Button Display Class

	Attributes:	margin
			naturalsize


An object of the button class looks rather like an object of the action class
with only one button and no title area.  The variable that is bound to it does
not contain symbolic indices and values, however, but rather a function array
and perhaps data.  The function must be monadic or niladic.

Specifically, let fn be a monadic function and define b as (fn;data).  Then b
can be bound to the button class, and whenever the button is pressed, fn{data}
will be executed.  A second form for defining a button is <{fn}, which is
equivalent to (fn;) for monadic functions; when the button is pressed, the
expression fn{()} or, for a niladic function, fn{} is executed.

Notice that for the button class no callback need be set; the function that is
bound is called automatically.

As an example, define a button that, when pressed, moves across the screen and
jumps back, but don't press it until after you have made the comparison set up
below:

     bf{v}:v has (`x;600|100+`x of v)
     bu(bf;`bu)
     show `bu is `button; br{`bu;0}

Just for a comparison of their appearances:

     ac(,`bu;,<1)
     `ac has (`class;`action; `title;''; `show;1); br{`ac;0 50}

     _ex free `ac

Now you can press the button.

There is no title area like the one an action object can have; the title
attribute applies to the text on the button (unlike for an action object,
which employs the label attribute for text on its buttons).  When there are no
blanks or other impermissible characters in it, a title or label can be given
as a symbol, instead of a character string.  The object is not automatically
resized for a new title:

     `bu has (`title;`Move)

The "naturalsize" attribute is an action attribute; it cannot be queried.  It
resizes an object to show it afresh, as if it, with its current text, values,
and features, were being initially displayed --

     `bu has (`naturalsize;); br{`bu;0}

-- except that in an array or matrix or suchlike the same rows and columns
might not be shown as originally, as demonstrated in the discussion of
naturalsize in the array section of the Data tutorial.

The "margin" attribute governs the minimum margin around the title on the
button; its default value is 2.  It does not affect the button size:

     `margin of `bu
     `bu has (`margin;10);
     `bu has `naturalsize; br{`bu;0}
     `bu has (`margin;200);
     `bu has `naturalsize; br{`bu;0}
     `bu has (`margin;2);
     `bu has `naturalsize; br{`bu;0}

The margin attribute also applies to the margin around the text in an object
of the label class.

     _ex free `bu



3. The Check Display Class


An object of the check class is a slotfiller variable with boolean values that
are represented by buttons.  A button is "on" if the corresponding value is 1
and "off" if it is 0.  When a button is on it has a sunken appearance and is
the color specified by the fg attribute, and when off it has a raised
appearance and is the color specified by the bg attribute.

Clicking the left mouse button on a check button toggles it between on and
off, and at the same time the corresponding value in the A+ variable is
toggled between 1 and 0.  Therefore, if a callback function is defined for the
slotfiller variable, mouse clicks cause the callback function to be executed,
the path argument p being the symbolic index of the changed value.

The slot areas that appear in the display and their arrangement can be
controlled by the setting of the geometry attribute.

This first example is a two-button moving display, in which pressing a button
moves the display to the position indicated by its buttons:

     c(`bottom`right;(0;1))
     `c is `check
     cbf{}:`c has (`yx;5001c)
     `c has (`show;1;`set;cbf;`yx;0 500)
     `c has (`fg;`mediumseagreen;`bg;`rosybrown)

Try the various button combinations.

In the second example, we show one way to set up a check display to allow one
or more categories of data to be selected.  Actually, the function we define
here for the button just lists the selected categories in the session log when
it is pressed:

     ck(`cb`ci`co`ib`i`s`sb`wb`w;(0;0;0;0;0;0;0;0;0))
     lb(`cmo_bid;`cmo_inventory;`cmo_oddlot),ld_clb
     ckfn{}:>(1ck)/`label of `ck
     `ck has (`class;`check; `set;ckfn; `geometry;9);
     `ck has (`shelltitle;`CMOView; `title;'CMO Inventory Viewer');
     `ck has (`labelfont`titlefont;2<'newcenturyschlbk-roman-16');
     `ck has (`label;lb; `show;1; `xs;1140); br{`ck;0}

Press some category buttons, adding to and deleting from the set of requests.
Observe the list that appears in the A+ session log each time.

     _ex `lb `cbf `ckfn `bf, free `c `ck



4. The Radio Display Class


The radio class is like the check class, except that
(1) it has the additional stipulation that one and only one of the values of 
the boolean-valued slotfiller is 1, 
(2) its buttons are diamond-shaped, and 
(3) pressing a button that is off turns it on and causes the button that had 
been on to be turned off (pressing a button that is on has no effect).

When a button that is off is pressed, the value of the underlying variable is
changed accordingly.  Therefore, if a callback function is defined for that
variable, it is called, the path argument p being equal to the symbolic index
of the selected button.  Note that even though there are two value changes, a
callback function associated with the variable of a radio button is called
only once, and the path argument of the callback function refers to the value
that changed from 0 to 1.

The slot areas that appear in the display and their arrangement can be
controlled by the setting of the geometry attribute.

In our first example, we make the usual moving buttons.  Execute the following
statements and press various buttons:

     r(`tl`t`tr`l``r`bl`b`br;(1;0;0;0;0;0;0;0;0))
     cbf{}:`r has (`yx;0 250 500[3 3(1r)1])
     `r has (`class;`radio; `set;cbf; `geometry;3 3 3; `show;1);

In more realistic examples, the radio object might offer a choice among four
differently formatted security definition tables and also function as a
heading for that table, or it might present a choice of security types for
listing portfolio holdings.  In our examples, the callback function merely
gives (in the session log) a waiter's response:

     _ex free `r
     rd(`ms`ba`na`bl;(0;1;0;0))
     `rd has (`class;`radio; `geometry;2; `shelltitle;'MBS'; `title;'');
     `rd has (`label;('BASIC MBS/STRIP';'BASIC ARM'),ld_rlb);
     cbf{s;d;i;p;c;v}:(>(`label of `rd)[(0rd)p]),'. Good choice.'
     show `rd has (`set;cbf); br{`rd;0}

Now the second example:
     
     `rd has (`hide;1;`shelltitle;`PH;`fg;`white;`labelfg;`white;`bg;`black);
     `rd has (`label;('Corporate';'Municipal'),ld_r1lb);
     show `rd  rd(`co`mu`mo`cm`us`ab;(1;0;0;0;0;0)); br{`rd;0}

Notice that you can click on the label or the diamond to press the button.

     _ex `cbf, free `rd
aplus-fsf-4.22/src/html/tutorials/s.tutorials/containers.html0000444000265000001440000013051410774505674020142  
                         The Container Display Classes
                         

1. General

2. The Window Display Class

3. The Table Display Class

	3a. The Headings for the Fields

			Attribute:	titledefine

	3b. Interactions between Settings for Fields and Table

			Attributes:	font
					protected

	3c. Controlling What is Shown

			Attributes:	fields
					firstfield
					fixedfields

	3d. User Interactions

			Attributes:	field
					selectedfield
					selectfield

	3e. A Case when Refresh is Needed

4. The Graph Display Class

5. The Layout Display Class

	5a. Relations among Objects

			Attributes:	ancestors
					children
					descendents
					familytree
					leader
					parent
					shell
					state

	5b. Binding and Showing of Objects

			Attributes:	mapped
					newshow
					reparent
					reshow

	5c. Arrangement of the Children

			Attributes:	at
					build
					lockposition
					position
					structure
					vcol
					vcols
					vrow
					vrows
					X
					Y
					YX

	5d. Size of the Children

			Attributes:	b
					h
					H
					l
					locksize
					r
					resize
					t
					w
					W

	5e. Navigation and Interaction

			Attributes:	acceptfocus
					focus
					freeze
					sensitive
					tabfrom
					tablist
					tabto

6. The Hpane and Vpane Display Classes

---------------------------------------------------


1. General


As the name implies, objects of a container display class are used to contain
other objects, either to group several of them or to provide features that are
not available in the contained object's class.  The objects that are contained
in a container are called its children.

For a variable to be bound to a container class, its value must be an array of
symbols and each symbol must be either the symbolic form of the name of a
variable or null.


2. The Window Display Class


A window contains only one object.  The value of a variable that is bound to
the window class is the name of a single variable, in symbolic form.  An
object in a window can be of any display class.

Placing an object in a window has the effect of putting scrollbars on the
display of that object.  You should be sure that you really need at least one
scrollbar, because they always appear.  If the object is completely shown or
has its own scrollbars, the window's scrollbars are inoperative; try them
after these statements:

     $load s
     scrs.SCREEN-34 12
     br{w;m}:{w has (`yx;scr-m+`yxs of w);}
     a12 2
     w1`a1
     show `w1 is `window  show `a1; br{`w1;0}

Try the various scrollbars after each of these statements:

     a150 2
     a1a250 50

It makes no difference whether the scrollbars are needed at the time the
window is mapped:

     w2`a2
     show `w2 is `window; br{`w2;0}

The window display class is useful in displaying large objects belonging to
the non-container classes that never have scrollbars, namely, action, check,
label, page, radio, and slot -- and, of no interest in this regard, button.
Here is an artificial example, for the most likely class, slot:

     s(,`char97+(426)773500;`xs of `s; `shelltitle;'window');
      br{`w3;0}; free`w1`w2;}

Having the horizontal scroll bar, one might be inclined to make it useful:

     `s has (`geometry;10; `title;'slot');

Can you find the title?  The title appears at the middle of the top of the
slot and is scrolled with the rest of the slot.  Contrast its immobility when
both the title and the scrollbars are part of the same object.  Notice that
the shelltitle comes from the window object and the title from the slot.  A
title is never displayed for an object of the window display class, nor,
naturally, a shelltitle for an object contained in any container class.

     _ex `a1`a2`w1`w2, free `w3`s;


3. The Table Display Class


A table is different from other containers, in that all the objects contained
in it (its children) are of the tableField class; they are called fields of
the table.  The fields of the table can be vectors or simple character
matrices.  An object can be bound to the tableField class only by A+ and only
as a child of a table object.  The children of a table object, like all
objects shown on the screen, must be unique.

The display of a table consists of a title area and a value area.  The value
area has a title bar on top that holds the names of the fields, and the area
below the field titles consists of delineated cells, one column for each
field.  The fields appear on the screen in the same left-to-right order as
their symbols appear in the variable that is bound to the table class.  The
number of elements in the first field completely controls the rows that can be
displayed.  Examine the following example:

     var_010 4'blah'
     var_11+10
     var_2150+.01?10100000
     var_3:var_2var_1
     tb`var_0 `var_1 `var_2 `var_3
     `tb is `table;
     `tb has (`shelltitle;'shelltitle'; `title;'title'; `cols;4);
     `var_2 `var_3 has <(`out;7.2);
     show `tb; br{`tb;0}


3a. The Headings for the Fields

	Attribute:	titledefine

The title bar text for a field can be changed by using the field's title
attribute.  For a dependency, there is another alternative.  The "titledefine"
attribute provides a means of displaying the definition, rather than the name,
of the dependency.  Its effect becomes visible only when the title attribute
is set to null.  To see the immediate effect of titledefine, watch the fourth
field.  Because the last column is too wide to be shown in its entirety and s
doesn't like to display partial columns, the fourth column gets blanked out.
(Under some circumstances you can see a truncated definition.)  We force a
redrawing after setting titledefine and title:

     `var_0 has (`title;'Text');
     `var_3 has (`titledefine;1; `title;);
     `tb has (`firstcol;0; `cols;4); br{`tb;0}

The next two statements demonstrate that titledefine does not set the title,
but rather that it is consulted when the title is set to null:

     `var_3 has (`titledefine;0);
     `var_3 has (`title;);
     `var_0 has (`title;);


3b. Interactions between Settings for Fields and Table

	Attributes:	font
			protected

The "font" attribute specifies the font in which the value area appears.  In
the table display class, it can be set for both the fields and the entire
table.  The setting for the table applies to any fields for which font has not
been explicitly set.

Notice two things in the following statements.  First, when the font is
changed for the first field, the space allotted to the field is narrowed,
resulting in the truncation of the title; watch out for this if you change a
font after showing a table.  Second, the font for the table does not affect
the first field, whose font has already been specified.

     `var_0 has (`font;'courier-bold-19');
     `tb has (`font;'palatino-19');
     `tb has (`firstcol;0; `cols;4;); br{`tb;0}

The font attribute is functional.  Set it for the third field, overriding the
table setting but leaving the other fields alone (you will probably need to
scroll down to see a negative value in boldface):

     f{s;d;i;p;c;v}:if (d<0) 'helvetica-bold-19' else 'helvetica-19'
     `var_2 has (`font;f);

Try to trim the column widths:

     `var_0`var_1`var_2`var_3 has <(`space;12);
     `var_0`var_1`var_2`var_3 has <(`font;`kaplgallant; `space;12);
     `tb has `naturalsize; br{`tb;0}

Because the characters are not of fixed width, the results of the space
specifications were not what we wanted; after the font change, space was set
as intended, and the table could be trimmed to fit.

The "protected" attribute tells whether protection is on; it is for reference
only.  It is useful because protect for a table overrides protect for its
fields:

     `var_1 has (`protect;1);
     `protected of `var_1 `var_2
<  1
<  0
     `tb has (`protect;1);
     `protected of `var_2
 1
     `var_1 has (`protect;0);
     `protected of `var_1
 1


3c. Controlling What is Shown

	Attributes:	fields
			firstfield
			fixedfields

One important feature of tables is the ability to retain certain fields in
view while scrolling among others.  In a table of bond information, for
instance, you might want to have issuer, coupon, and maturity always shown, no
matter what other fields were or were not visible.  The value of the
"fixedfields" attribute is the number of fields on the left that do not
participate in horizontal scrolling:

     `tb has (`fixedfields;1);
     `tb has (`cols;2; `firstfield;`var_2);

Notice the gap; the second field is not shown.  Try some horizontal scrolling.

The "fields" attribute always has the same value as the cols attribute:
setting one for a table sets the other:

     `fields of `tb
     `tb has (`fields;3);
     `cols of `tb

The firstcol attribute is affected by fixedfields for tables.  It is the first
visible field on the left disregarding the fixed fields.  The "firstfield"
attribute differs in taking the name of a field, in symbol form, rather than a
number, but is otherwise the same as firstcol, and setting one for a table
sets the other:

     `firstfield `firstcol of `tb
     `tb has (`fixedfields;0; `fields;2; `firstfield;`var_1);
     `firstcol of `tb
     `tb has (`firstcol;0);
     `firstfield of `tb


3d. User Interactions
	Attributes:	field
			selectedfield
			selectfield

In addition to selecting a cell by clicking the left mouse button with the
pointer in it, you can select a column by clicking the button with the pointer
on a title.  When a field title is selected, the selected cell is at the
intersection of that field and the currently selected row; if no row is
currently selected, the first row (row 0) is used.  The value of the
"selectedfield" attribute is the identity of the selected cell, as row index
and, in symbolic form, field name.  This attribute identifies the same cell as
does the selected attribute, whose value is its row and column indices.
Similarly, the "field" attribute gives the (symbolic) field name of the
selected column, which is always the same column that is identified by index
number in the col attribute and that is referred to in the selectedfield and
selected attributes.

Make some selections by clicking on the titles and in the cells, executing the
following statement after each selection:

     `field `selectedfield of `tb

A callback is associated with selection of a field, and a function is
specified for it using the "selectfield" attribute.  Here we use a function
that just shows its arguments and the value of the selectedfield attribute:

     cb{s;c;v}:(s;c;v;`selectedfield of `tb)
     `tb has (`selectfield;(cb;'field selection'));

Select a field or two and see the arguments and the value of selectedfield.
Also select a cell or two directly and see that this function is not called.


3e. A Case when Refresh is Needed

The "refresh" attribute was introduced in the array section of the data
display tutorial.  Here is another example of its use.  To minimize backing
store space requirements, when a substantial amount of data is only
potentially displayed it is not always calculated in advance.  If its display
is requested through the window manager and not A+, it may be necessary to
request that A+ refresh the object:

     albl1000+100; tl`al`bl;
     show `tl is `table;
     `tl has (`ys;1750;`x;scr[1]-`xs of `tl);

Now use the scrollbar to drag the later part of the table into view. It should
be blank.  Specifying refresh causes the numbers to be calculated and shown:

     `tl has `refresh;

     _ex `cb`f,  free `tb`var_0`var_1`var_2`var_3`tl`al`bl;


4. The Graph Display Class


The graph display class resembles the table class in that its children are all
of one class, graphTrace, and only A+ can bind a variable to that class.
Because of its complexity, it is treated in a separate tutorial.

As an aside, we might mention that because all the graph features are
optional, it is possible to produce pictures using an object of the graph
class, as in this simple example:

     j100+200
     t1j(,@0)100
     t2j(,@0)975+(1000000-j*2)*.5
     t31 220 75
     g`t1`t2`t3
     `g is `graph;
     `g has (`title `legend `axis `zero;('';`none;`none;`none));
     `g has (`xmin;100;`xmax;100; `ymin;0;`ymax;100);
     `t1 `t2 has <(`style;`area);
     `t3 has (`style;`scatter; `symbol;`circlefilled; `symbolsize;50);
     `t1 has (`linecolor `fillcolor; 2<`cyan2);
     `t2 has (`linecolor `fillcolor; 2<`cornflowerblue);
     `t3 has (`linecolor `fillcolor; 2<`yellow);
     show `g; br{`g;0}

The area style fills in down to the axis.  Only the order of drawing prevented
the cyan from obliterating the blue.  The fill style allows fuller control of
the area covered, as in this example of three rectangular planes:

     p14 2 90 10  90 70  0 70  0 10
     p3(4 230 10)+ p2(4 230 10)+p1
     g`p1`p2`p3;  free `t1`t2`t3;
     `p1`p2`p3 has <(`style;`fill);

Reversing the order of the symbols in the definition of g reverses the order
of drawing and thereby the obscuration and apparent depth of the planes:

     g`p3 `p2 `p1;

     _ex `j`t1`t2`t3, free `g`p1`p2`p3;


5. The Layout Display Class


A layout is a container whose children can be of any classes.  Almost all of
what is said in this section applies also to the hpane and vpane classes,
which are essentially just layouts with slider bars.

When a child is placed in a layout, the context of its name is assumed to be
that of the layout's.  There is no need to qualify the child's name unless its
context differs from the layout's.


5a. Relations among Objects

	Attributes:	ancestors
			children
			descendents
			familytree
			leader
			parent
			shell
			state

The first seven attributes listed above give information about containment and
subordination of objects.  All but two are for reference only.  Knowing that
an object is called the child of its container, you can guess the meanings of
most of these attributes.  Here is a simple example illustrating their use:

     abcden3
     show `a; br{`a;0 200}
     l1`b`c; l2`d`e; l`l1`l2;
     `l`l1`l2 is `layout;
     show `l; br{`l;0}
     `children of `l
     `children of `l2

The "children" attribute is actually not just for reference:

     `l has (`children;`l1`l2`n);
     `children of `l
     l

So the children attribute of l changed value and, as had better be the case,
the value of l changed.  The display, however, did not change.  When an object
that is not being shown is added to an existing layout, the default is not to
show it there automatically.  One way to make it appear is to apply the show
function to it, before or after it is added to the layout (you will see several
other ways later on):

     show `n; br{`l;0}
     `descendents of `l
     `parent of `d
     `ancestors of `d

The "familytree" attribute applies only to containers, since it shows only the
object's descendents and not its ancestors:

     `familytree of `l
     `familytree of `l2
     `familytree of `d

The "shell" attribute contains the name of the top-level object that contains
the object in question.  The "leader" attribute, for top-level objects only,
tells what object will be followed into hiding; its default value is the
screen workspace.  A top-level object can be made its own leader; the
canonical value for the leader attribute in this situation is the Null:

     `shell of `d
     `leader of `l
     `l has (`leader;`l)
     `leader of `l

You have already seen the stateself attribute, in the Buttons tutorial.  The
"state" attribute is similar to it, but recursive.  That is, for a container
the stateself attribute gives only the definition of the container itself,
whereas the state attribute includes the value of the state attribute for each
child.  When a child appears in a layout definition more than once (to
establish the desired geometry), the state for it is given only once, for
economy.  For tableFields and graphTraces, the class does not appear in the
result, to keep it executable.

     `stateself of `l
     `state of `l
     _ex free `l`l1`l2`a`b`c`d`e`n;


5b. Binding and Showing of Objects

	Attributes:	mapped
			newshow
			reparent
			reshow

When a layout is first shown, all its children are shown.  When children are
added to it, however, they are not automatically shown in it unless they were
already shown somewhere.  A simple example:

     a'original'; b'show fn'; c'show attribute'; d'mapped'; e'newshow';
     `a`b`c`d`e is `label;
     show `b;
     l`a; show `l is `layout; br{`l;96 72}
     l`a`b`c`d

Although l has four children, only two are shown: a because it was a child
when the layout was first shown and b because it was already shown when it was
added to the layout.  If you set the show attribute of a child to 1, it will
be shown:

     `c has (`show;1);

In fact, it is enough to set the "mapped" attribute to 1:

     `d has (`mapped;1);

Setting the mapped attribute for a top-level object to 0 when it is shown
(unmapping it) has the effect of making its contents blank.This effect can be
useful when you are making several changes in a layout and do not want the
flashing that would otherwise occur:

     `c has (`mapped;0);
     `l has (`mapped;0);
     `c has (`mapped;1);
     `l has (`mapped;1);

When the "newshow" attribute is 1 for a layout, any child that is added to
that layout is shown:

     `newshow of `l
<  0
     `l has (`newshow;1;);
     l`a`b`c`d `e

Similarly, you can control what happens when a child is removed from a parent
(orphaned).  By default, the child becomes a top-level object (it is made its
own parent) and it is shown independently.  If, however, you set the "reshow"
attribute to 0, then an orphaned object still becomes top-level but is not
shown.  Furthermore, if you set the "reparent" attribute to 0, it is not made
its own parent but rather is freed, and of course is therefore not shown:

     `reshow `reparent of `l
 1 1
     l`a`b`c`d
     .e: variable reparented to popup window
     `l has (`reshow;0);
     l`a`b`c
     .d: variable reparented to popup window
     `show of `d
<  0
     `l has (`reparent;0);
     l`a`b
     .c: freed

     _ex `c, free `l`b`c`d`e;


5c. Arrangement of the Children

	Attributes:	at
			build
			lockposition
			position
			structure
			vcol
			vcols
			vrow
			vrows
			X
			Y
			YX

Starting with a null layout allows you to set attributes:

     a1a2a3a4a5a6a7a8a9a1010 12
     l()
     `l has (`class;`layout);

When a variable is to be bound to the layout class, the arrangement of the
symbols in it usually determines the geometry of the display.  (Compare the
geometry attribute, with symbolic indices, for an action display.)  A+
arranges the display when the variable is a vector:

     l`a1`a2`a3`a4`a5`a6
     show `l; br{`l;0}; `l has (`y;0);

Each item of a nested vector is taken to represent a row:

     l(`a1`a2`a3; `a4`a5`a6); br{`l;0}
     l(`a1; `a2`a3; `a4`a5`a6); br{`l;0}

As you are probably about to see (or saw), the history of a layout affects its
display when its geometry is changed.  Setting naturalsize provides the
arrangement that would appear if the layout were new:

     l(`a1`a2`a3; `a4`a5`a6)
     l(`a1; `a2`a3; `a4`a5`a6)
     `l has `naturalsize;

A matrix form for the layout variable establishes the virtual rows and columns
of the display, with the empty symbol is used to indicate a blank area.  You
will notice a lot of drawing, giving a jumpy effect; this could be avoided by
hiding or unmapping the object, making the changes, and then showing the
variable again:

     l3 2`a1`a2 `a3`a4 `a5`a6; `l has `naturalsize; br{`l;0}
     l4 3`a1`a1`a2 `a1`a1`a3 ``a4` `a5``a6; `l has `naturalsize; br{`l;0}
     {l4 5`a1`a1`a2`a2`a2 `a1`a1`a3`a3`a3 ``a4`a4`a4` `a5`a5``a6`a6;
      `l has `naturalsize; br{`l;0}}

The layout variable can be a matrix of matrices, each submatrix indicating the
arrangement within its area of the matrix:

     {`l has (`newshow;1);
      l2 2(2 1`a1`a2;1 2`a3`a4;;4 1`a5`a6`a7`a8);
      `l has (`ys;800); br{`l;0}}
     l[1;0]<1 2`a9 `a10; br{`l;0}

     free `l;

The "build" attribute for a layout allows you to arrange objects on the screen
and have the relative arrangement of those objects maintained in the layout
display.  You could get the size and position you wanted for the objects by
dragging them, but we will set their yx and yxs attributes instead in this
simple example:

     show `a1; `a1 has (`yx;350 300);
     show `a2; `a2 has (`yx;350 550);
     show `a3; `a3 has (`yx;580 300; `yxs;170 440);
     show `a4; `a4 has (`yx;350 770;`yxs;390 200);
     l(); `l is `layout; `build of `l
     `l has (`build;1);
     l`a1`a2`a3`a4; show `l;
     br{`l;0}

It would clearly be simpler to use a non-vector value for l to obtain this
particular layout, but in complicated cases build might provide the easiest
means of specification, or you might want to let a viewer decide the
arrangement.

Implied in all of these methods and explicit in the method we are about to
explore is the idea of virtual rows and columns, whose edges are established
by edges of the children and which may be spanned by children.

The "at" attribute is a four-element integer vector representing the position
and extent of an object in a layout in terms of these divisions:
    (starting virtual row, starting virtual column,
     number of virtual rows spanned, number of virtual columns spanned).
Conceptually, a layout can be placed over an imaginary grid so that the border
of each object in the layout lies on grid lines.  The position and size of
each object can then be described by the row index and column index of the
grid block containing the upper left corner of the object, and the number of
grid rows and columns that the object overlaps.  If the grid is the minimal
one, i.e., the one with the fewest possible grid lines, then these four
numbers are the value of the at attribute.  The origin for the grid
coordinates is the upper left corner of the layout.

The complexity of building a layout from screen positions may lead to
unexpected at values, but when the layout is specified by, say, a matrix
value, then at is what you would expect:

     >`at of `a1`a2`a3`a4
  0  0  7  8
  0 10  7  8
  9  0  7 18
  0 19 16  8
     l2 3 `a1`a2`a4 `a3`a3`a4
     >`at of `a1`a2`a3`a4
 0 0 1 1
 0 1 1 1
 1 0 1 2
 0 2 2 1

The "structure" attribute of a layout, which is for reference only, gives you
a slotfiller containing the values of at for all of its children:

     `structure of `l
< <  `.a1 `.a2 `.a4 `.a3
  < <  0 0 1 1
    <  0 1 1 1
    <  0 2 2 1
    <  1 0 1 2

The four elements of the at attribute value are synonymous with the attributes
"vrow", "vcol", "vrows", and "vcols"; they can be set individually to
rearrange a layout, as in the first line below.  You can specify the entire
arrangement of a layout by setting the at attribute on each of its children,
as in the four-line statement group below:

     `a3 has (`vcol;1;`vcols;1);`a1 has (`vrows;2);`l has `naturalsize
     {free `l;  l`a1`a2`a3`a4;  `l is `layout;
      `a1 has (`at;0 0 1 2);  `a2 has (`at;1 0 1 1);
      `a3 has (`at;1 1 1 1);  `a4 has (`at;2 0 1 2);
      show `l; br{`l;0 200}}

The R and C attributes that you saw in the Buttons tutorial can be used to
constrain the virtual rows or columns of a layout to be all the same size:

     l(`a1``a2;```;`a3``a4); `l has `naturalsize;
     `l has (`C`R;(1;1));

The "YX", "Y", and "X" attributes are related to the yx, y, and x attributes,
respectively.  The latter three can be set or referenced and they pertain to
the position of an object (in pixels) within its parent or, for top-level
objects, within the screen.  The former are for reference only and always
pertain to the position of the object (in pixels) within the screen:

     `YX `yx of `l
<  327 538
<  327 538
     `YX `yx of `a1
<  357 540
<  30 2

Several objects can occupy a layout in such a way that only one is visible at
a time, taking up the entire area of the layout, and any other one can be
brought into view simply by setting the value of its raise attribute to 1.
Since the objects within the layout can themselves be layouts, or other
complex objects, this provides a simple, efficient, and general way of
displaying multiple objects when only one must be visible at a time.

You use the "position" attribute to accomplish this.  This attribute must be
set before the layout is built, so start with a null layout and set position
and then give the layout its correct value:

     free `l; l();
     `l is `layout;
     `l has (`position;0)
     l`a1`a2`a3`a4`a5`a6`a7
     show `l; br{`l;0}
     `a4 has (`raise;1)

When you remove children from a layout by freeing or unmapping them, the
remaining objects may or may not retain their positions.  The "lockposition"
attribute forces them to remain in the same positions.  Consider this example
of two layouts that are identical except for the values of lockposition (and
the locations of the layouts themselves, so you can see them both at once):

     free `l;
     a1'one'; a2'two'; a3'three';a4'four'; a5'five'; a6'six';
     a7'one'; a8'two'; a9'three';a10'four'; a11'five'; a12'six';
     `a1`a2`a3`a4`a5`a6`a7`a8`a9`a10`a11`a12 is `label;
     l3 2 `a1`a2`a3`a4`a5`a6;  ll3 2`a7 `a8`a9`a10`a11`a12;
     show `l `ll is `layout; br{`l;0 130}; br{`ll;0}
     `ll has (`lockposition;1; `reparent;0);
     `l has (`reparent;0);
     free `a3 `a9;
     `a2 `a8 has <(`mapped;0);
     `a4`a6 `a10`a12 has <(`mapped;0);

The layout on the left should now have only one column, while the one on the
right, for which lockposition is 1, still has two columns, with the two
remaining labels still in their original positions.  The effect can be perhaps
even more pronounced when the layout geometry is a single column:

     free `l`ll;
     `a1`a2`a3`a4`a5`a6`a7`a8`a9`a10`a11`a12 is `label;
     l`a1`a2`a3`a4`a5`a6;  ll`a7`a8`a9`a10`a11`a12;
     show `l `ll is `layout; br{`l;0 78}; br{`ll;0}
     `ll has (`lockposition;1;`reparent;0);
     `l has (`reparent;0);
     free `a2 `a8;
     `a5 `a11 has <(`mapped;0);

     _ex `a2`a8,free `l`ll`a1`a2`a3`a4`a5`a6`a7`a8`a9`a10`a11`a12;


5d. Size of the Children

	Attributes:	b
			h
			H
			l
			locksize
			r
			resize
			t
			w
			W

If the "locksize" attribute of a layout is 1, the removal of a child should
not cause any remaining child to change size.  In Release 2.21, however, if
the "locksize" attribute of a layout is 1, the removal of a child cannot cause
the layout to change size, although remaining children may change size.  The
latter behavior is expected to be replaced by the former if there is another
release of version 2.  Here is an example of the behavior of two layouts that
are essentially the same except for this attribute; you can tell from this
example which way the release you are using behaves:

     abcdefghij14 17
     l(`a`b;`c`d;`e); ll(`f`g;`h`i;`j);
     show `l `ll is `layout; br{`l;0 412}; br{`ll;0}
     `ll has (`locksize;1; `reparent;0);
     `l has (`reparent;0);
     `ys of `l `ll
<  539
<  539
     `b`c`d `g`h`i has <(`mapped;0);
     `ys of `l `ll
<  370
<  539
     free `l`ll;

The way a child behaves when a layout is resized depends in part on its
display class.  Call a child sticky if its class is action, button, scalar,
label, slot, check, or radio and call all others non-sticky.  If a layout has
at least one row with only non-sticky children, then any row containing a
sticky child retains its vertical size when the layout is resized.  See how
all the extra vertical space is allotted to the bottom row when you execute
the next to last of these lines:

     `r is `radio  r(`w`j`z;(1;0;0));
     `ac is `action  ac(`a`c`t;(;;));
     l(`r`a;`ac`b;`c`d); show `l is `layout; br{`l;108 81}
     `l has (`yxs;1.2`yxs of `l);
     free `l;

The size of an object in a layout, which is normally affected by other objects
in its row and column or by resizing the layout, can be controlled by setting
the "H" and "W" attributes to 1.  These settings prevent resizing of an
object's height and width, respectively.  There are even stronger resize
restrictions, which apply to the entire row and column in which the object is
positioned: setting the "h" and "w" attributes to 1 means retain the height of
the row and the width of the column, respectively.  The constraints can be
seen after the layout enlargements in this example:

     l3 2`a`b`c`d`e`f; show `l is `layout; br{`l;162 121}
     sz`yxs of `l
     `a`b`c`d`e`f has <(`resize;'');
     `c has (`W;1);
     `f has (`H;1);
     `l has (`yxs;1.3sz);
     `l has (`yxs;sz);
     `c has (`w;1);
     `f has (`h;1);
     `l has (`yxs;1.3sz);
     `l has (`yxs;sz);

Setting these constraints to 0 does not remove them.  They are actually just a
way of inserting constraints in the "resize" attribute, whose value can be a
character vector containing any of 'WHwhtblr' (we will deal with the last four
in the next paragraph).  Settings of resize are cumulative unless there is a
period in the value being given for it or that value is empty.  Resize
settings of both '.' and '' remove all constraints.

If the newly allotted space for the object within the layout is larger than
the object, its position within that space is controlled by setting the "t",
"b", "l", and "r" attributes to 1.  They stand for top, bottom, left, and
right and have the obvious effect.  Now we remove all constraints and then
constrain the heights and widths of two children, enlarge the layout, and move
the constrained children within their spaces:

     `a`b`c`d`e`f has <(`resize;'');
     `c`f has <(`W`H;(1;1));
     `l has (`yxs;1.3sz);
     `c has (`t;1);
     `c has (`l;1)
     `f has (`b;1)
     `f has (`r;1)
     `resize of `c
< ltWH

In real life, of course, you would set the constraints before enlarging the
layout, so that the desired result would appear all at once, but when learning
it is better to see the steps and not just the outcome.  Before leaving this
layout, let's look at the dominance of left and top -- the nullity of b and r
in the presence of t and l -- and the change when a size constraint is
removed:

     `c has (`resize;'br');
     `c has (`resize;'WHb.r');
     `c has (`resize;'.');
     `f has (`resize;'');
     free `l;

These attributes can be used in the initial display of a layout, when they
apply to the relation between the natural size of the object and the space
allotted to it in the layout.  Consider this example:

     d'and ',c'still ',b'another ',a'array'
     `a`b`c`d is `label;
     `a has (`resize;'tr'); `b has (`resize;'Wtr'); `d has (`b;1);
     j10+k10+m10+n14 17
     l4 2`a`j `b`k `c`m `d`n
     show `l is `layout; br{`l;0}

The default label position, centered both ways, is shown by c.  Why is b at
the right but not a?  Because the latter is as wide as its space in the
layout, whereas b was not made wider than its natural size: we had set W for
it, and so it had room to move.  But then why did all the vertical movements
succeed?  Because for any object bound to the label class resize has the
default value 'hH' and we simply added to that value.  Therefore each label
has its natural height and has room to move vertically in its space in the
layout.


5e. Navigation and Interaction

	Attributes:	acceptfocus
 			focus
			freeze
			sensitive
			tabfrom
			tablist
			tabto

First, a note about function keys, which were discussed in the Buttons
tutorial.  When Fj is pressed, if it was set on the object that has focus,
then its function is executed. If it was not set on that object, then the
object's container is checked and the function executed if the key was set on
that object, and so on up to the shell, the top-level object.

The "sensitive" attribute can be set to 0 to block all user interactions with
an object and all its descendents.  Try to select from, edit, or scroll j
(with the pointer in l!)  after executing the second statement, and try to
select from, edit, or scroll any of the arrays after the third statement.  The
fourth statement shows that the display is still sensitive to changes made by
program; only the user side is blocked, all viewer input being ignored:

     `j`k has <(`selected;0 0);
     `j has (`sensitive;0);
     `l has (`sensitive;0);
     jj+1
     `l`j has <(`sensitive;1);

When the "freeze" attribute is 1, the display of the object and all its
descendents will not be updated as a result of specifying values for it or
setting attributes on it (although for the object itself some blanking may
occur).  When freeze is set to 0, the object is redrawn.  You can use freeze
to make several changes to an object without having its intermediate states
flash on the screen.  If you try editing, scrolling, and selecting after the
fifth statement in this example, you will find all these actions work,
although scrolling may just propagate the last line previously shown in the
scrolled direction.  Only the program side is blocked, the display of all
changes by the program being deferred until freeze is set to 0:

     `a has (`resize;'');
     `b has (`freeze;1);
     `b has (`resize;'');
     `b has (`freeze;0);
     `l has (`freeze;1);
     `d has (`resize;'');
     nn+1
     `l has (`freeze;0);

The remaining attributes in this set have to do with keyboard focus within a
container.  It can be given directly to any child with which the viewer can
interact (not a label, e.g.) by setting the "focus" attribute for the child to
any value.  Move the pointer into l after executing this statement to see its
effect:

     `m has `focus

To move the focus from child to child, press Meta-Tab (Alt-Tab on IBM
keyboards) or Shift-Meta-Tab (Shift-Alt-Tab on IBM keyboards) while the
pointer is in the container.  Objects of the various button and menu classes
can be excluded from this traversal by setting the "acceptfocus" attribute to
0 or included by setting it to 1.  Try traversing l before and after the
statement excluding a from the traversal, but don't have the focus on a when
you exclude it:

     free `a; a(`j`k`m`n;(1;0;0;0));
     `a has (`class;`radio; `resize;'.WH'; `mapped;1);
     l4 2`a`j `b`k `c`m `d`n
     `a has (`acceptfocus;0);

The order of traversal is given in the "tablist" attribute and can be changed
by giving a new value to tablist.  All children are listed in the default
value of tablist regardless of any ineligibility to accept focus, contingent
(as for a) or absolute (as for the labels).  The effective order of traversal
is the order of the eligible children in tablist.  When you specify tablist,
you can omit any children you want and you can include children for which
acceptfocus is 0 -- they will not actually be included in the traversal until
you change the setting of acceptfocus.  Try traversing the layout before and
after the third statement below, setting acceptfocus for a to 1:

     `tablist of `l
     `l has (`tablist;`j`m`k`n`a);
     `a has (`acceptfocus;1);

The tablist attribute (and the order of traversal) can be altered using the
"tabfrom" and "tabto" attributes, whose values are the prior and following
entries in tablist.  These two attributes can also be queried, although if
there are ineligible children listed in tablist the values of tabfrom and
tabto may not be helpful for some children;

     `tabfrom of `a
     `a has (`tabfrom;`m);
     `j has (`tabto;`k);
     `tablist of `l
<  `.j `.k `.m `.a `.n
     free `l;

Here is an example of a layout within a layout.  Start by preparing the first
two rows of the outer layout, the second row being itself a layout.  A width
is specified for the action buttons to make them a little more spacious:

     chc(`Off`On;(1;0))
     `chc has (`class;`choice;`title;'Feed is');
     hmn(`Font;,<(`font1`font2`font3;(;;)))
     `hmn is `hmenu;
     act(`Save`Sort`Add`Print`Fields`Help`Drop`Quit;(;;;;;;;))
     `act has(`class;`action; `title;''; `geometry;8; `realize;1; `xs;670);
     l1 2`hmn`act
     `l has (`class;`layout; `title;'';`h;1);

Now define a table and place it and the previous material in a layout:

     ca1 9'912827L2 '; cb17.625; cc120221115; cd1123.0314;
     ce15.933; cf112.81; cg116.23;
     tbl`ca`cb`cc`cd`ce`cf`cg
     `tbl has (`class;`table; `title;''; `cols;7);
     `ca`cb`cc`cd has (<`title), <@0 `Cusip`Coupon`Maturity`Price;
     `ce`cf`cg has (<`title),<(`Yield;'M Dur';'$ Dur');
     `cb`cc`cd`ce`cf`cg has(<<`out),<(6.3;`mdy2;`328th;6.3;6.2;6.2);
     `ca`cb`cc`cd`ce`cf`cg has(<<`space),<(9;7;10;7;7;7;7);
     lay(`chc`l`tbl); `lay is `layout;
     `lay has (`shelltitle;'qs'; `title;''; `realize;1; `ys;300);
     show `lay; br{`lay;0}
     free `lay

Here is another example of a layout, with color attributes used to accentuate
its various parts:

     a19930000+401 505 609 714 818 922 1027 1201
     db2+.75 .6 .7 .6 .75 .9 .7 .75
     c7+1.073 .904 1.123 .904 .754 .923 .804 .474
     ef80
     t`a`b`c`d`e`f
     show `t is `table; br{`t;72 188}

Showing t is premature on several counts, as is the next statement, but doing
things in this order allows their effects to be shown better.

     `t has (`cols;4; `rows;8);
     `a has (`out;`mdy4; `space;10); `b`c`d has <(`out;8.3);
     `t has (`cols;4);
     `a`b`c`d has (<`title),`Auction`AucRate`YCR_R`ARR_R;
     `t has (`title;'MTA 5.50 2013');
     `t has (`titlefg;`white; `fg;`white; `bg;`black; `scrollbg;`grey);
     act(`tg`ex`pr;(;;))
     `act has (`class;`action; `geometry;3; `title;''; `bg;`white);
     `act has (`label;('Toggle Daycount';'Exit';'Print'));
     lbl'ActAct rates looking forward'
     `lbl has (`class;`label; `fg;`white; `bg;`black);
     l`t`act`lbl
     `l has (`class;`layout; `shelltitle;'RATE HISTORY'; `title;'');
     show `l; br{`l;0}
     _ex free `l;


6. The Hpane and Vpane Display Classes


The hpane and vpane display classes are container classes that are like
layouts except that they have movable dividers, or sashes, between their
children.  The viewer can control the proportion of the layout that children
occupy simply by moving the dividers.  Various attributes that constrain the
arrangement of children, such as position and build, are disregarded.  An
hpane object has vertical dividers and its children should be arranged
horizontally.  A vpane object has horizontal dividers and its children should
be arranged vertically.

To move a divider, simply place the mouse pointer on it, press and hold the
left mouse button, and then slide the divider left or right, or up or down.
The old and new divider lines are shown continuously and the new arrangement
is shown when you release the mouse button.  A small button is provided on one
end of each divider as a convenient place to locate the pointer.

In the following vpane example, a viewer can adjust the number of headlines
shown, with a corresponding adjustment in the space available for any selected
story.  We use some data from aux_vars.+ that there is no point in cluttering
this tutorial with.  The selected headline appears as the title of the story
section:

     _load{'/usr/local/aplus-fsf-4.22/doc/tutorials/s.tutorials/aux_vars.+'};
     `ld_vph has (`class;`view; `title;''; `bg;`white; `rows;10; `cols;74);
     t76' BT 10/01 13:14 Nortek Filing -2- Proceeds to Redeem Debt >NTK'
     `ld_vps has (`class;`view; `title;t; `bg;`white; `rows;9; `cols;76);
     vp`ld_vph `ld_vps
     `vp has (`class;`vpane; `title;''; `shelltitle;'DJ NEWS -- MS FID');
     show `vp; br{`vp;0}

Move the sash up and down.  Notice that scrollbars appear and disappear for
the two sections as needed and that you can eliminate either section from view
completely if you want.

     _ex `t,free `vp;

In the following hpane example, a viewer can adjust the number of fields shown
in two tables.  The first four lines set up the table fields, the next four
the tables, the next two the tableFields, and the last three the hpane:

     csps100
     `cs`ps has <(`title;'strikes'; `out;'f7.2');
     CBIDCASKCLSTCBvolCAvolCLvolCLDelta10Ң999999999
     PBIDPASKPLSTPBvolPAvolPLvolPLDelta10Ң999999999
     tc`cs`CBID`CASK`CLST`CBvol`CAvol`CLvol`CLDelta
     tp`ps`PBID`PASK`PLST`PBvol`PAvol`PLvol`PLDelta
     `tc has (`class;`table; `title;'Calls'; `cols;5; `rows;10);
     `tp has (`class;`table; `title;'Puts'; `cols;5);
     `cs`CBID`CASK`CLST`CBvol`CAvol`CLvol`CLDelta has<(`blank;' '; `space;7);
     `ps`PBID`PASK`PLST`PBvol`PAvol`PLvol`PLDelta has<(`blank;' '; `space;7);
     hp1 2`tc`tp
     `hp has (`class;`hpane; `shelltitle;'Ivy'; `title;'');
     show `hp; br{`hp;0}

Try moving the sash from side to side.  You can show just one table, two
columns of one and all of the other, or other combinations.

     _ex free `hp;

The dividers of an hpane layout always extend from the top to the bottom of
the layout, so care must be taken when using hpane layouts with more than one
row.  Consider

     (a;b)100+?2<5 3 100; c100+?5 4100;
     h(`a`b;`c); show `h is `hpane; br{`h;0}

The divider between objects a and b cuts through object c.  Similarly, care
must be taken when using vpane layouts with more than one column:

     _ex free `h;
     (a;b)100+?2<9 2 100; c100+?12 2100;
     v(`a`c;`b`c); show `v is `vpane; br{`v;0}

If several objects line up on a divider boundary, then movement of the divider
controls the display sizes of these objects.  Thus movement of a divider can
control the display sizes of an entire row or column of objects.  Moreover,
there can be several dividers.  Scrutinize this example and move its dividers:

     _ex free `v;
     (a;b;c;d;e;f;g)100+?7<5 9100;
     h(`a`b`c;`d`e`f;`g)
     show `h is `hpane; br{`h;0}

Where do dividers appear?  In section 5c, on the arrangement of objects in a
layout, we spoke of virtual rows and columns and the at attribute, whose value
is defined in terms of them.  Dividers appear between each adjacent pair of
virtual columns for an hpane and of virtual rows for a vpane.  Respecify h to
be an unpleasant hpane whose arrangement of objects requires that they all
span virtual columns:

     h(`a`b`c;`d`e;`g); free `f;
     >`at of `a`d`g
 0 0 1 2
 1 0 1 3
 2 0 1 6

Notice that there is no object boundary between the first and second virtual
columns or between the fifth and sixth, although there are dividers there.

     free `h;

Clearly, if we want dividers for each of the first and second rows, this is
not the way to do it.  The dividers need to be limited in length.  The right
way for this particular arrangement is to handle the virtual rows separately,
to put two hpanes and g inside a layout:

     h11 3`a`b`c; `h1 is `hpane;
     h21 2`d`e; `h2 is `hpane;
     l`h1`h2`g; `l is `layout;
     show `l; br{`l;0}
     free `l;

Likewise, dividers may need to be limited in number, and a way to do that is
to put layouts inside hpanes.  Suppose we want to allow the viewer to divide
the available space between two arrays and also to switch the variable that
appears in the lower array, with the same columns shown as for the variable
previously shown.  We want a vpane containing array, radio, array.  If we
specified the vpane in that simple manner, then there would be two dividers
and they would both have to be moved to take space from one array and give it
to the other (while the radio would be alternately stretched and squashed).
The solution is obvious: put the radio and the array it refers to inside a
layout:

     e10d10c10b10a10 8
     r(`b`c`d`e;(1;0;0;0)); `r is `radio;
     l`r`b; `l is `layout;
     v`a`l; `v is `vpane;
     cbf{s;d;i;p;c;v}:{`v has (`freeze;1);
         po1#.l; fc`firstcol of po;
         .l`r,p; free po; show p; p has (`firstcol;fc);
         `v has (`freeze;0);}
     `r has (`set;cbf; `geometry;4);
     `v`l`r`b`c`d`e has <(`title;'');
     show `v; `v has (`xs;291); br{`v;0}

Now move the divider, use the scroll bars, and press the radio buttons.

There is no direct way for a program to determine exactly where a user has
positioned a divider in an hpane or vpane layout.  Sometimes there are
indirect ways to approximate the position, such as checking the values of the
rows and cols attributes of an object to determine how many rows and columns
are currently shown.  Execute these two statements before and after moving the
divider:

     >`rows `ys of `a
     >`rows `ys of 1#l

     _ex `cbf`r`b`c`d`e`f`g, free `v;
aplus-fsf-4.22/src/html/tutorials/s.tutorials/data.html0000444000265000001440000015301110774505714016676  
                          Display Classes for Data
                          

1. The Array Display Class

	1a. Preparing to Show an Object

			Attribute:	realize

	1b. Controlling What is Shown

		1b(i). What Rows and Columns are Shown

			Attributes:	cols
					firstcol
					firstrow
					naturalsize
					rows
					size

		1b(ii). Selected and Referred Rows

			Attributes:	col
					index
					refer
					row
					select

	1c. Changing the Value

		1c(i). Editing

			Attributes:	edit
					protect

		1c(ii). Insertion and Deletion

			Attributes:	delete
	       				insertabove
					insertbelow

		1c(iii). Representing Missing Values and Characters

			Attributes	blank
	       				copy
					na
					stars

		1c(iv). Evaluation

			Attributes:	active
					def
					done
					evaluate
					execute
					in
					out

	1d. Appearance

		1d(i). Separators

			Attributes:	colsep
					rowsep

		1d(ii). Size

			Attributes:	dynamic
					editspace
					hscrollsize
					respace
					space
					scrollsize
					vscrollsize

		1d(iii). Color

			Attributes:	colors
					cycle
					editbg
					editfg
					hscrollbg
					indexbg
					refresh
					rowbg
					scrollbg
					selectbg
					vscrollbg

	1e. Documentation

			Attribute:	doc

2. The Label Display Class

3. The View Display Class

	3a. Accessing the Primary Selection Buffer

			Attributes:	clear
					notify
					primary
					request

4. The Page Display Class

			Attributes:	blink
					blinkrate
					bold
					box
					boxcolor
					color
					colormap
					line
					underline

	4a. User Input

			Attributes:	cursor
					key
					keysym
					rband
					rbandbox
					3down
					3up
					2down
					2up

5. The Matrix Display Class

			Attributes:	collabelrows
					colspace

	5a. Selection

			Attributes:	colindex
					cornerindex
					rowindex
					selectcol
					selectcorner
					selectrow

	5b. Colors

			Attributes:	colindexbg
					cornerindexbg
					rowindexbg

6. The Slot Display Class

---------------------------------------------------


1. The Array Display Class


Any A+ scalar, vector, or matrix can be displayed as an object of class array.
For character arrays, each vector or row of a matrix is put in one cell.  For
all other arrays, each element is put in its own cell.  Examine these six
examples to see how various data types are displayed and check the action of
the scrollbars.  It is a bug, scheduled to be fixed in Version 3, that s has
to be jogged by naturalsize into obeying respace:

     $load s
     scrs.SCREEN-34 12
     br{w;m}:{w has (`yx;scr-m+`yxs of w);}
     ar10 10; `ar has (`class;`array; `respace;1; `show;1); br{`ar;0}
     ar1.0+10
     ar2.718+10
     ar(1 2;3 4 5;6;'abc';`def;7 8;9 10)
     ar6 5'Row 1Row 2Row 3Row 4Row 5Row 6'
     ar'This is a character vector'
     `ar has `naturalsize; br{`ar;0}
     ar2 2("Perhaps";"not";"what's";"wanted")
     `ar has (`space;12;`cols;2); br{`ar;0}
     _ex free `ar


1a. Preparing to Show an Object

	Attribute:	realize

Sometimes, when there are lengthy computations or file accesses, objects may
be placed on the screen in a halting, ragged way unless you take steps to make
the presentation smoother.  Try this contrived example, where sys.sleep is a
stand-in for a meaningful lengthy operation and b and c are specified
initially to speed the start-up:

     ar14 17
     b:{sys.sleep 5;ar}
     c:{sys.sleep 5;ar}
     cbar
     show `ar is `array; br{`ar;0}
     `b has (`class;`array; `show;1); br{`b;0 250}
     `c has (`class;`array; `show;1); br{`c;0 500}
     hide `ar

Now give ar a "new" value to mark the b and c values invalid.  When they are
shown again the display is set up in a halting, ragged way:

     ar14 17
     show `ar

Now we will hide these objects and respecify ar.  But this time we will use
the "realize" attribute before showing the objects.  Setting realize to 1
causes the objects to be calculated for showing but does not actually show
them.  Thus the delay and unevenness is not displayed on the screen, and when
the show function is executed the objects jump right up:

     hide `ar
     ar14 17
     `ar`b`c has `realize; show `ar;

Get rid of the other objects:

     _ex free `b`c


1b. Controlling What is Shown

There are a number of attributes that control what elements of an array object
are shown.  Some determine the set directly; others single out individual
elements for inclusion somewhere in the set.

1b(i). What Rows and Columns are Shown

	Attributes:	cols
			firstcol
			firstrow
			naturalsize
			rows
			size

The "rows" and "cols" attributes control how many rows and columns are shown.
The default has been used for ar, but you can change how much is shown:

     >`rows`cols of `ar
     `ar has (`rows`cols;(8;4)); br{`ar;0}

The "firstrow" and "firstcol" attributes are the indices of the first row and
first column that are shown, and thus control what portion of the array
appears on the screen:

     `ar has (`firstrow`firstcol;(6;13))

The bottom right portion of the array is shown.  Now press twice on the up
button of the vertical scrollbar, moving up two rows, and once on the left
band of the horizontal scrollbar, moving left three columns (the four that are
shown minus one for overlap).  The new position is 4, 10:

     `firstrow`firstcol of `ar
     `ar has (`firstrow`firstcol;(13;16))
     >`firstrow`firstcol of `ar

The specification was taken as a suggestion (without comment) and honored as
far as possible while still showing the same number of cells.

The "naturalsize" attribute was introduced in the button section of the
Buttons tutorial.  It is an action attribute; it cannot be queried.  Setting
naturalsize returns the array to the number of rows and columns it had when
mapped, taking into account the current text and data values and feature
attributes, but setting firstrow and firstcol to 0:

     `ar has `naturalsize

Fractional rows may be shown when the viewer changes the size of an object --
try dragging the bottom right corner down and to the right when you have a
target for a pointer -- or when a size is assigned to the object in an A+
statement.  These fractional rows show no data and are of no use.  The "size"
attributes trims them off.  When you have a 200 by 300 pixel space available
and want to use as much as possible of it, but want a good-looking display,
you can use the size attribute.  You should see 6+ rows and 3+ columns and
then an even 6 by 3 when you execute these statements:

     `ar has (`yxs;200 300)
     `ar has `size

You can combine these statements, if you list the attributes in the correct
(left to right) order.  The first line below specifies size too early; the
second is OK:

     `ar has (`naturalsize`size`yxs;(;;200 300))
     `ar has (`naturalsize`yxs`size;(;200 300;)); br{`ar;0}

1b(ii). Selecting and Choosing Rows

	Attributes:	col
			index
			refer
			row
			select

A cell can be selected in an array object.  Selecting and choosing are
discussed here because a cell is normally shown when it is selected, and so
they are another way of determining what portion of an array is shown.  The
"row" and "col" attributes contain the row and column indices of the selected
cell.  They are -1 if no cell is selected.  The "selected" attribute,
discussed in the Buttons tutorial, is just the concatenation of the row and
col attributes.  Execute these statements:

     `ar has (`firstrow`firstcol;(6;13))
     >`row`col of `ar
     `ar has (`row`col;(0;0))
     `ar has (`row`col;(0;1))
     `ar has (`row`col;(2;2))
     `ar has (`row`col;(;))
     >`row`col of `ar

Notice that Null is accepted in place of -1.  As you have just seen, a
selected cell is shown raised, and a selected row (except for the selected
cell) is shown in a different color.  Now place the mouse pointer in any cell
of ar and click the left mouse button.  That cell becomes selected.

With the pointer in the array display, the selection can be moved using the
arrow keys, Tab, Shift-Tab, Page Down, Page Up, End, and Home.  Each key is
effective until its limit is reached.  When no cell is selected, Right Arrow,
Down Arrow, Tab, and Home select cell 0 0, Page Down selects the first cell of
the last row shown and makes it the top row shown, and End selects the first
cell of the last row.  Try them.

Whenever a cell is selected, a select event occurs.  The "select" attribute
allows you to specify a function that will be called at each select event, and
optionally to specify an argument for that function.  The default selection
action still occurs.  For example, execute:

     f{s;c;v}:{acv; a has (`firstrow `firstcol;
               ġ(`row `col of a)-s1+`rows`cols of a);}
     `ar has (`select `cols;((f;.5);3))

Now use the mouse and the keyboard to select various cells in ar and see how
the select callback function f causes the selected cell to appear in the
middle of the display -- or, when it is near the edges, to appear as close to
the middle as possible.  Notice that if you scroll the display leaving the
selected cell in view and click on that cell, no select event occurs, as
evidenced by the fact that the cell does not move.  Now execute

     f{s;c;v}:>`row`col of cv
     `ar has (`select;f)
     `ar has (`row`col;(0;0))
     `ar has (`row`col;(2;3))
     `ar has (`row`col;(3;4))
     `ar has (`row`col;(4;4))
     `ar has (`selected;<1 2)
     `ar has (`selected;<1 1)

and notice that:
 
(1) When selection takes place by an A+ statement, using row and col
attributes, a select event can occur for each of them, in the order shown by
those attributes.

(2) The "selected" attribute is implemented as if the col and row attributes
had been specified, in that order.

(3) No select event occurs when the row or column selected is the same as the
one that was selected or is -1.  The automatic setting to 0 mentioned in the
second paragraph after this one does not trigger a select event, so setting
both attributes from -1 to 0 triggers only one event.

Now use the mouse and the keyboard to select cells and notice that at most one
select event occurs each time.

The row and col attributes are independent, except that (1) if one is set to
-1, the other is automatically set to -1 also and (2) if they are each -1 and
one is set to something else, the other is set to 0:

     `ar has (`firstcol`firstrow`selected;(0;0;))
     `ar has (`col;1)
     `row of `ar
     `ar has (`selected;)
     `ar has (`row;1)
     `col of `ar
     `ar has (`row;)
     `selected of `ar
     `ar has (`select;)

The "refer" attribute allows the viewer to choose a set of rows. When it is
zero, no choosing can take place. When it is nonzero, however, clicking the
left mouse button with the pointer on a cell that is selected but not chosen
causes its row to be chosen, and then clicking on it again causes the row to
be no longer chosen. Since clicking on an unselected cell causes it to be
selected, clicking twice on any unselected cell causes the chosen status of
its row to be toggled.  Pressing Enter while the pointer is in the window and
there is a selected cell has the same effect as clicking on the selected cell.

The default for refer is 0.

     `refer of `ar
     `ar has (`refer;1)
     `index of `ar

The "index" attribute is a sorted list of the indices of the chosen rows.
Choose some rows, using the left button and the Enter key; notice the change
in the color of these rows.  Remove the choice from some of them, again using
both button and key, but leaving several chosen.

     `index of `ar

If there are chosen rows and refer is set to zero, then they are remain chosen
rows and you cannot remove the choice from them:

     `ar has (`refer;0)

Now try pressing Enter with the pointer in the array window or clicking on the
selected cell.  And now remove the choice from all the chosen lines:

     `ar has (`index;)

Like a number of other attributes, refer can have one of three values: 0 for
no choosing; 1 for choosing with the default action; or a function, and,
optionally, an argument, for a callback.  If a callback function is specified,
s does nothing but call that function when a refer event occurs and
appropriately color the rows listed in index after the callback.  It is up to
the callback function to update and sort the index attribute.  Define a
function that mimics the default action and displays its argument and the new
value of index, and set refer to it and a static-data argument:

     f{s;c;v}:{acv; (r;i)`row`index of a;
               i((ir)/i;
               a has (`index;i);(s;c;v;i);}
     `ar has (`refer;(f;'stat data'))

Now choose some rows and remove the choice from some of the chosen ones,
leaving others.

     `index of `ar
     `ar has (`refer`index;(0;))


1c. Changing the Value

Aside from reassignment to the underlying variable, there are several ways the
value shown on the screen can be changed.

1c(i). Editing

	Attributes:	edit
			protect

The value in an individual cell can be edited.  To prepare for editing, a cell
must be selected, in one of the ways just demonstrated.  There are two modes
and several ways to enter them, one of which involves deletion of the entire
previous contents.  Try them, pressing Escape after each:

Replacement:

   With the pointer in the cell, click the middle mouse button.  The
replacement text cursor will appear on the character the tip of the pointer is
nearest to.

Insertion:

   With the pointer in the cell, click the right mouse button.  The insertion
text cursor will appear between characters, as near as possible to the tip of
the mouse pointer.
   With the pointer in the window, press the Insert key.  The insertion text
cursor will appear at the end of the original contents.
   With the pointer in the window, press Backspace or any character key.  The
entire cell contents will be deleted and the character will appear, unless you
pressed Backspace, followed by the insertion text cursor.

The mode, insertion or replacement, can be toggled by pressing the Insert key
or reset by using the middle or right mouse button.  The cursor can be moved
with the left and right arrow keys or by clicking at a new location in the
cell: the left button leaves the mode unchanged, the middle button forces
replacement mode, and the right button forces insertion mode.  The editor is
Emacs style.

To abort the editing of a cell and return to its original contents, press the
Escape key.  To end the editing of a cell and cause the edited contents to be
inserted in the underlying variable, press Enter or select another cell using
Tab, the up or down arrow keys, etc., or, with the pointer in another cell, a
mouse button.

Since the edited contents of a cell are inserted in the underlying variable
using Selective Specification, you must avoid illicit values, such as 34.5
when the array is integer or 34 5 when the array is simple.  When you press
Enter or try to select another cell with an illicit value in the current cell,
a message appears in the session log and editing of the cell remains open.
Remember, you can escape from an error situation by pressing the Escape key.

Try editing the ar display.

Editing can also be begun and ended from A+ code.  Assigning any nonzero value
to the "edit" attribute is like pressing the Insert key.  (If no cell is
selected, neither of these actions causes edit mode to be entered.)  Assigning
a zero value to the edit attribute is like pressing Enter in edit mode.

     `ar has (`selected `edit;(1 1;))

Now edit the cell, but leave it in input mode.  The edited contents are
accepted (assuming the value is permitted) by this statement:

     `ar has (`edit;0)

You can restrict editing to certain cells, using the "protect" attribute.  A 1
prevents editing in a column and a 0 allows it.  You can give an array
argument that will be used repetitively, in the manner of Reshape, or a
function.  The first statement allows editing of only the first and third
columns; try editing ar after you have executed it:

     `ar has (`protect;0 1 0,141)
     `protect of `ar
     f{s;d;i;p;c;v}:{(s;d;i;p;c;v);0=2|d}
     `ar has (`protect;(f;'attempt to edit'))

Now only odd values can be edited; try it.  You will see in the A+ session log
the arguments that are passed to f.

     `ar has (`protect;0)

1c(ii). Insertion and Deletion

	Attributes:	delete
			insertabove
			insertbelow

Insertion and deletion can be controlled in a manner like editing and
choosing.  You can allow a viewer to insert or delete rows in an array,
prevent a viewer from doing so, or provide functions to handle insertion or
deletion requests.  These requests are made by selecting a row and pressing a
key combination; the combinations and the corresponding attributes are
Meta-Delete ("delete"), Meta-Insert ("insertbelow"), and Meta-Shift-Insert
("insertabove").  On IBM keyboards, the corresponding key combinations are
Alt-Delete, Alt-Insert, and Alt-Shift-Insert.  The pointer must be in the
window when the keys are pressed.

Setting any of these attributes to 0 causes requests for its action to be
ignored.  Setting it to 1 causes the default action, deletion or insertion, to
be taken upon request.  Setting it to a function, or a function and an
argument, causes that function to be called when the request is made and
causes s to omit the default action.  Consider deletion first.  Try to delete
a row after each of the first two statements:

     `ar has (`delete;1)
     `ar has (`delete;0)
     f{s;c;v}:{if ((c%s)=r`row of cv){(c%s)1;(c%v)(rc%v),(r+1)c%v}
               else (c%s)r;}
     arr1
     `ar has (`delete;(f;`arr))

Now in order to delete a row you must press Meta-Delete (or, on an IBM
keyboard, Alt-Delete) twice on a selected row.  Try selecting various rows and
pressing once on each and then twice consecutively on the last.

Now consider insertion.  After the second and third statements, try each kind
of insertion at the first line:

     ar14 17; `ar has (`firstrow`firstcol `row`col;(0;0;0;0))
     `ar has (`insertabove`insertbelow;(0;1))
     `ar has (`insertabove`insertbelow;(1;0))
     f{s;c;v}:(c%v)((1+#c%v)s+>`row of cv)\c%v
     `ar has (`insertabove`insertbelow;((f;0);(f;1)))

Now insert a row below and one above the current third line.  The next section
explains the difference between the insertions performed by f and the default
ones.

     `ar has (`delete`insertabove`insertbelow;(;;)); br{`ar;0}

1c(iii). Representing Missing Values or Characters

	Attributes	blank
			copy
			na
			stars

To insert a row, the function f in the last section employed Expand, which
uses zero as the fill character for a numeric array.  Insertion by s, however,
is more flexible than by Expand.  The fill character is the value of the "na"
attribute.

     `na of `ar

This number is the default for both integer and floating-point arrays.  It is
intended to represent an improbable, if not preposterous, value.  You can set
na to any value you want.  You should generally choose a value that does not
occur in actual data, so that it will always mean missing or unavailable, and
one that will be as simple as possible to handle in your computations.  Just
to see it in action, change na to -1 and go back to the default insertion:

     `ar has (`na;1;`insertabove;1;`insertbelow;1)

Now insert a row below the second one.

You don't have to use a fill character when inserting rows.  A copy of a row
is the most convenient insertion for a viewer when only a few fields need to
be changed in the new row, most fields being the same in both rows.  To insert
a copy of the selected row rather than a row of fill elements, change the
"copy" attribute from its default value of 0 to 1:

     `ar has (`copy;1)

Now insert a row above or below the second row.

You can control how na values appear in displays.  The display for any element
that is equal to the (current) value of na is determined by the "blank"
attribute.  The default value of the blank attribute is Null:

     ()`blank of `ar  br{`ar;0}

meaning show the actual value that is in the array.  The blank attribute can
be set to any character value; watch the display of ar change when you change
it:

     `ar has (`blank;'N/A')
     `ar has (`blank;' ')
     `ar has (`blank;'missing')
     `ar has (`blank;'Fill in')

When you change na, the display of ar will also change, but only when the
displays of the relevant cells must be recalculated, for example by a
specifying of refresh:

     ar[;0]
     `ar has (`na;0; `refresh;)

You saw stars displayed in the first rows you entered.  You know that the
value of those elements in the underlying variable was -999999999, the then na
value.  What were the stars doing there?

When there is not enough room to display a formatted value in a cell, either
the cell is filled with stars or the value is shown truncated.  The latter
alternative might be preferable for a character string or a number which would
lose only digits following the decimal point.  This choice is governed by the
"stars" attribute:

     `stars of `ar
     `ar has (`blank;; `na;999999999; `space;7);
     `ar has (`stars;0)

Now let's freshen ar up a little:

     `ar has (`stars`blank`naturalsize;(;;))  ar14 17; br{`ar;0}

1c(iv). Evaluation

	Attributes:	active
			def
			done
       			evaluate
			execute
			in
			out

This section is concerned with conversions between displayed values and the
value of the underlying variable, and the timing of these conversions and
associated computations.

There is an attribute in s that corresponds to the dependency definition
function and command, _def and $def, namely "def".  It is a persistent
attribute, and a variable need never have been bound to have a value for that
attribute:

     j:ar+1
     `def of `j

When a dependency is being displayed, the dependency is evaluated and the
display updated whenever the dependency is marked invalid.  If it is not being
displayed, there is no need to evaluate it.  (It is not being displayed if the
show attribute is 0 for it or for some object in which it is contained.)  The
"active" attribute, which is for reference only, tells you whether the object
will be updated automatically or not:

     `active of `ar
     hide `ar
     `active of `ar
     show `ar

The "evaluate" attribute says whether the underlying variable (dependency or
not) is to be evaluated in order to determine the proper attribute values for
displaying it.  If you set evaluate to zero, it is up to you to set the
attributes for a proper display of the variable.  Use it with great caution.
Like def, it is persistent.

     `evaluate of `ar
     `evaluate of `j
     `evaluate of `no_such_variable

The "execute" attribute controls whether or not input will be executed to
obtain a value:

     `execute of `ar

Edit a cell, enter an A+ expression with a singleton result, such as +/10,
and see the result.

     `ar has (`execute;0);

Again edit a cell; enter an A+ expression such as +/10 or 7 and you should
get an error message like "ar: domain - edit value" in the A+ session log.
Try expressions like 7, 1e2, -7, and +7 and you should find that they are
accepted.  (Although the latter two look like functions applied to numbers,
actually the minus sign is converted to high minus and the plus sign is
dropped, so the input is just formatted, not executed.)

The "in" attribute is used to parse values as they are entered on the screen,
which is always as character vectors.  The default is in{x}:x if the type of
the underlying variable is character, and in{x}:x otherwise.  You can specify
a function to be used instead of this default, like one that will accept
commas as thousands separators or one that will accept a comma as a decimal
point.  Try entering some appropriate expressions after each of the following
specifications of in.  _scfi accepts commas as thousands separators and
parentheses as minus; e.g., _scfi"(1,234)" is -1234.  With the arguments given
here, g changes a comma to a period -- e.g., 34,5 to 34.5 -- to convert
decimal points from the European system.

     f{s;d}:_scfi d
     `ar has (`in;f);
     g{s;d}:d  ((d=s[0])/d)s[1]
     `ar has (`in;(g;',.'))  ar1.014 17;

You can specify a character matrix for the in attribute, to encode input.
Then when a character vector is entered, it is padded with trailing blanks as
necessary and then sought as a row of the matrix.  If a match is found, the
row index in the matrix is entered in the variable.  If the vector is not
found there, the value of the na attribute is entered instead:

     `ar has (`in;2 3'no yes');

Now enter "no", "yes", and "maybe" in different cells; 0, 1, and stars (for
-999999999) should be shown for them.

The "out" attribute specifies the format in which data appears in the display.
The defaults are 1x for numeric, x for character, and s.box{x} for other
data.

You can specify a character matrix for the out attribute, just as you can for
the in attribute, so that the variable will contain numbers while words or
phrases appear on the screen:

     `ar has (`out;2 3'no yes');

When the out format is changed, the display is immediately updated.  Notice
the blank cells.  When out is a character matrix, all invalid indices are
treated as na's, and the default blank attribute is the one for character
arrays, namely a vector consisting of a single blank.

     `ar has (`blank;'N/A');
     `ar has (`blank;);
     `ar has (`in;);

You can specify a function for the out attribute -- for example, a conversion
from radians to degrees:

     f{s;d}:8.2sd
     `ar has (`out;(f;3602));

Other possible values for the out attribute are valid left arguments to dyadic
Format or _sfmt, or one of the formats listed in Table 22-3 of the A+
Reference Manual:

     `ar has (`out;5.1);
     `ar has (`out;'e 7.2');
     `ar has (`out;`minsec);
     `ar has (`out;);

If you are trying to coordinate several things, you may need to perform some
action when the screen entry and refresh cycle has been completed.  The "done"
attribute allows you to specify a callback function for that purpose:

     `done of `ar
     f{s;d;i;p;c;v}:(s;d;i;p;c;v)
     `ar has (`done;(f;'done'));

Edit some cells and observe the session log.  Now clean up and prepare for the
next section:

     `ar has (`done`naturalsize`col`space`cols;(;;;7;3))  ar14 17; br{`ar;0}


1d. Appearance

1d(i). Separators

	Attributes:	colsep
			rowsep

In the display of ar, there are lines separating the rows and the columns.
These lines are controlled by the "colsep" and "rowsep" attributes, whose
default values are 1.  The value 0 means no separators:

     `ar has (`colsep`rowsep;(0;0));
     `ar has (`colsep`rowsep;(2;3));
     `ar has (`colsep`rowsep;(1;1));

1d(ii). Size

	Attributes:	dynamic
			editspace
			hscrollsize
			respace
			space
			scrollsize
			vscrollsize

The "space" attribute determines the width of the cells:

     `space of `ar
     `ar has (`space;3);
     `ar has (`space;);

The "respace" attribute controls the automatic increasing of the space
attribute.  The space attribute is increased if necessary to accommodate the
formatted values in all cells when either (1) the respace attribute is 1 and
the value of the variable is changed or (2a) respace is reset to 1 or (2b) the
out attribute is respecified.  The respecification of ar after the
illustration of case (2a) is required to fix a known bug in the updating of
the display:

     `ar has (`respace;1;`space;5);
     ar[0;0]123456789
     `ar has (`respace;0);
     ar[0;0]0
     `ar has (`space;5);
     ar[0;0]123456789
     `ar has (`respace;1); arar;
     `ar has (`respace;0);
     ar[0;0]0
     `ar has (`space;5);
     ar[0;0]123456789
     `ar has (`out;);

Now clean up.

     `ar has (`space;7)  ar[0;0]0; br{`ar;0}

If you change font or text you may want either to keep the display the same
size or to keep the same cells displayed.  The "dynamic" attribute lets you
make this choice.  If it is 1, a font change may cause a change in the size of
the display, whereas if it is 0, the display will remain the same size:

     `dynamic of `ar
     `ar has (`font;'times-24');
     `ar has (`font;'kaplgallant-19');
     `ar has (`dynamic;1);
     `ar has (`font;'times-24'); br{`ar;0}
     `ar has (`font;'kaplgallant-19'); br{`ar;0}

When the "editspace" attribute is 0, the space available for editing a cell is
the cell itself.  When editspace is 1, the space available is determined by
s.EDITSPACE, which has a default value of 256; scrolling in this space is
provided automatically.  After the first of the following statements, enter
enough characters to overflow the cell and then press Escape.  Do the same
after the second statement, but before pressing Escape use the left and right
arrow keys to see the scrolling.

     `ar has (`editspace;0);
     `ar has (`editspace;1);

The width of the scrollbars can be controlled by three attributes;
"vscrollsize" determines the width of the vertical scrollbar and "hscrollsize"
the width (height) of the horizontal.  The "scrollsize" attribute is
vscrollsize, hscrollsize:

     `scrollsize of `ar
     `ar has (`scrollsize;5 6);
     `ar has (`vscrollsize `hscrollsize;(25;28));
     `ar has (`scrollsize;15 17);

1d(iii). Color

	Attributes:	colors
			cycle
			editbg
			editfg
			hscrollbg
			indexbg
			refresh
			rowbg
			scrollbg
			selectbg
			vscrollbg

You have already encountered some color controls in the Buttons tutorial.
Here are some more.  For the background of the scrollbars, there are the
"vscrollbg", "hscrollbg", and "scrollbg" (vscrollbg, hscrollbg) attributes.
The Null indicates that the value of an s global variable is to be used, as
discussed later in the S Global Variables tutorial:

     `ar has (`vscrollbg `hscrollbg;(`cyan;`yellow));
     `ar has (`scrollbg;`lightsteelblue);
     `ar has (`scrollbg;);

The backgrounds of the selected cell, the other cells in the selected row, and
the cells in the chosen rows (the rows listed in index) are controlled by the
"selectbg", "rowbg", and "indexbg" attributes, respectively:

     `ar has (`firstrow`firstcol`row`col`index;(0;0;0;0;1 2 3));
     `ar has (`selectbg;`mediumseagreen; `rowbg;`rosybrown; `indexbg;`tan);
     `ar has (`selectbg;`red; `rowbg;`cyan; `indexbg;`bisque);
     `ar has (`row;1);
     `ar has (`selectbg`rowbg`indexbg`index;(;;;));

Notice the combinations of colors when the selected row is one of the chosen
rows.

The "editbg" and "editfg" attributes control the colors in the cell that is
being edited:

     `ar has (`editbg`editfg`edit;(`white;`purple;1));
     `ar has (`editbg`editfg;(;));
     `ar has (`edit;0;`row;;`index;);

The "colors" and "cycle" attribute are used to signal a new value.  When an
indexed specification is made to the variable, the new value appears
successively in the colors indicated by the colors attribute.  Each of these
colors is shown for the number of milliseconds required by the cycle
attribute, a scalar.  (Changing a value on the screen by editing causes an
indexed specification.)

The colors attribute can be functional, in which case it is called once for
each changed cell, with the usual arguments: static data, value, index, path,
context, unqualified variable name.  For example, colors could be determined
by the sign of the new value and could be repeated, for a flashing effect, or
they could depend upon the column.

      `ar has (`colors;`red);
     ar[1;0 1]ar[1;0 1]
     `ar has (`colors;`red1 `red2 `red3 `red4);
     ar[1;0 1]ar[1;0 1]
     f{s;d}:{if (d<0) `red `yellow `red `yellow `red `yellow,4`red
            else `cyan `blue `cyan `blue `cyan `blue,4`cyan}
     `ar has (`colors;f);
     ar[1;0 1]ar[1;0],-ar[1;1]
     `cycle of `ar
     `ar has (`cycle;400);
     ar[1;0 1]ar[1;0 1]
     `ar has (`cycle;1000);
     f{s;d;i}:if (2|1i) `red `yellow `cyan `blue else `black
     `ar has (`colors;f);
     ar[1;](1 1,151)ar[1;]

Suppose an attribute uses a function to provide its value and that function
references a global variable.  Then a respecification of the global variable
will not cause a recalculation, although as elements are changed they will
reflect its new value.  If you want the entire array to reflect the new value,
you must force a recalculation, by means of the "refresh" attribute:

     FG`blue
     fgfn{s;d;i;p;c;v}:.FG
     `ar has (`fg;fgfn);
     FG`red
     ar[;1]ar[;1]
     `ar has `refresh;

This characteristic can be useful.  If ar were being continually updated from
a real-time feed, the first four lines above would initiate the color-coding
of updated numbers.  Whenever a viewer requests it, a new cycle could be begun
by color-coding all numbers as "old" and then setting FG to code updated
numbers as "new" again:

     FG`blue; `ar has `refresh; FG`red;
     ar[1;1]ar[1;1]

See the table section of the Containers tutorial for another example of the
use of refresh.

Incidentally, a functional value for fg can be used to color-code cells by
value, as in the first two statements below:

     fgfn{s;d}:s[1+d]
     `ar has (`fg;(fgfn;`red`black`blue));
     ar(1+?14 173)?14 17200
     `ar has (`colors `fg `refresh;(;;))  ar14 17;


1e. Documentation

	Attribute:	doc

This attribute, which has no assigned meaning and no restrictions in s,
provides a way of documenting objects (but not functions):

     `ar has (`doc;("Data tutorial: example";`class of `ar;ar;ar;ar));
     `doc of `ar
     `fgfn has (`doc;"Data tutorial: functional fg; use of refresh shown");
     `doc of `fgfn

The default value for doc is the value of s.AUTODOC, which is discussed in the
s-Context Variables tutorial.

     _ex `FG `prim_buf `clear_fn `f `fgfn `read_fn `j `arr `g;


2. The Label Display Class


The label class is for displaying text that is either a simple character
scalar, vector, or matrix or else a nested scalar or vector whose items are
simple character scalars or vectors.  Labels cannot be edited and never have
titles or scrollbars.  They typically appear inside containers, where they
have no corners or frames, and so blend in.  They can be used to give
information or instructions, label arrays and windows, display character
graphics (dingbats), and so on.

     lb('s tutorial';'data display classes')
     `lb has (`class;`label; `dynamic;1; `head;0);
     show `lb; _ex free `ar; br{`lb;0}

Here are two examples of the use of labels in layouts.  (Layouts are covered
in the Containers tutorial, but you don't really need to know anything about
them here; the details are almost all concealed in the auxiliary variables
file.)

     _load{'/usr/local/aplus-fsf-4.22/doc/tutorials/s.tutorials/aux_vars.+'};
     lb'Select Trigger Issue(s)'
     `lb has (`class;`label;`bg;`white);
     `ld_lo has (`class;`layout;`title;'';`shelltitle;'bsprdaddact._ACT');
     show `ld_lo; br{`ld_lo;0}

Incidentally, you probably observed that when ld_lo was bound to the layout
class lb vanished, since it is contained in ld_lo (by the value of ld_lo,
which we have not displayed) and ld_lo was not yet shown.

     free `ld_lo;
     lb1,'4'
     `lb1 has (`class;`label;`font;'zapfdingbats-60';`bg;`gray90;`fg;`green3);
     t1' Average Life  ...'; t2'   . . .'; t3' Price variance  ...';
     lb2(20'FFIEC Tests';30'-';t1;t1;t1;t2;t3;t3;t3;t2)
     `lb2 has (`class;`label;`justify;'l';`bg;`gray90;`fg;`black,9`gray70);
     lo1 2`lb1`lb2
     `lo has (`class;`layout;`shelltitle;'FFIEC';`title;'';`bg;`gray90);
     show `lo; br{`lo;0}

Notice the fg attribute for lb2.  For a label, its value can be a vector,
which is used cyclically, with one element applying to each row.

     _ex `t1 `t2 `t3 `lb `lb1 `lb2, >free `lo;


3. The View Display Class


The view class is for simple character matrices that need scrollbars and so
are unsuitable for labels.  Only fixed-width, or monospace, fonts should be
used for horizontal scrolling.  View displays have problems with matrices
containing tabs, backspaces, linefeeds, etc.; these problems will not be fixed
soon, so avoid ASCII control-type characters in any array to be bound to the
view class.  Views cannot be edited.  Here is an example of an output area
with initial filler:

     v20 61'CMOPort '
     `v is `view;
     `v has (`shelltitle;'cmoPortfolioMgr'; `title;'Output area');
     show `v; `v has (`xs;766); br{`v;0}

     _ex free `v;


3a. Accessing the Primary Selection Buffer

	Attributes:	clear
			notify
			primary
			request

Text clipped from an Emacs or XTerm window is written in the "primary
selection buffer", and text pasted in these windows is retrieved from this
buffer.  You can use this buffer from A+.

To write to the primary selection buffer, you give the "primary" attribute a
character value. (Other types of data are quietly ignored; the value of
primary remains unchanged.) Since there is only the one buffer, the value of
the attribute changes for all objects.

To read the buffer, you specify the "request" attribute for a bound object.
If primary has been given a proper value, a "notify" event occurs and the
buffer can be read by referencing the primary attribute.

If the buffer is overwritten by another process (not by an object in this A+
process), the A+ object, if any, whose specification of the primary
attribute was overwritten will undergo a clear event. Dragging the pointer
over text in an Emacs, Xterm, or FrameMaker window, for example, will cause
a clear event. The text that is highlighted can then be retrieved through
primary, but text that Emacs demarcated by bouncing the cursor back and
forth cannot -- but can, however, after you press the "copy 0 to PRIMARY"
button in an xcutsel window.

Adapting an example from Larry Rohrs, we first define a set of functions to
set primary and request and respond to notify and clear:

     SetPrimary{s}:{
       s .has (`primary;(`row .of s)#%s);
       'Copy pressed; set `primary'}
     SetRequest{s}:{
       s .has `request;
       'Paste pressed; set `request'}
     GetPrimary{s;c;v}:{
       row0`row .of cv;
       if (1=row) 'Nowhere to paste'
       else{
         (row#c%v)(1c%v)0`primary .of cv;
         '`notify event; got `primary'}}
     Clear{s}:'`clear event for ',s

Now define a function to set up a layout with a view and two buttons and to
set callbacks:

     Define{sym}:{
       sym .is `view;
       sym .has (`notify;GetPrimary);
       sym .has (`clear;(Clear;sym));
       (sym%`Layout)((sym`CopyBtn),sym`PasteBtn;`sym);
       (sym`CopyBtn)  .is `button  (sym%`CopyBtn) (SetPrimary;sym);
       (sym`PasteBtn) .is `button  (sym%`PasteBtn)(SetRequest;sym);
       (sym`Layout)   .is `layout;
       show sym`Layout;}

Specify two variables and have Define set them up and display them:

     Define `sample1  sample15 5
     Define `sample2  sample2105 5
     br{`sample2.Layout;0}; br{`sample1.Layout;0,10+>`xs of `sample2.Layout};

Click on a line in sample1 and press its Copy button.  Then click on a line
in sample2 and press its Paste button.  Click on another line in sample2,
press its Paste button, and see the same text entered on that line.  Select
some text in an Xterm or an Emacs session and notice that a clear event took
place for sample1.  Press either Paste button; if the selected text is
highlighted, it is put in the selected row; otherwise, request is set but
there is no notify event.  Try some other experiments with these objects and
see the results on the screen and in the A+ session log.

     _ex free `sample1.Layout `sample2.Layout;
     _ex `SetPrimary`SetRequest`GetPrimary`Clear`Define;

4. The Page Display Class

	Attributes:	blink
			blinkrate
			bold
			box
			boxcolor
			color
			colormap
			line
			underline


Character matrices can be bound to the page display class, which is designed
for displaying page-based information from data services.  There are no
scrollbars, and the firstrow, firstcol, rows, and cols attributes do not apply
to page objects.

First, here is a small sample page with the default display:

     ld_pg
     show `ld_pg is `page; br{`ld_pg;0}

The "underline" attribute takes a boolean mask showing which characters are to
be underscored.  It is functional.  For page, a nonfunctional setting of any
functional attribute is treated as if it were reshaped to the shape of the
underlying character matrix.  A functional setting should always be a value
with the same shape as the underlying character matrix.

First, we define a function to produce a mask from a set of row index, column
index, extent triplets (the static data).  By making it mask out blanks, we
can underline the title by underlining the whole first row, so that no change
is needed in the attribute when we change the title:

     msk{s;d;i;p;c;v}:{u(c%v)0;
             (,u)[((u)[1]0#s)+(1#s)+ɡ2#s]1; u^(c%v)' '}
     `ld_pg has (`underline;(msk;,<0 0 58));
     ld_pg[0;]58'     Mergers and Acquisitions'

The "line" attribute allows vertical and horizontal lines to be drawn.  The
vertical lines can be used, among other things, as column dividers, with or
without a box around them.  The line attribute takes an n by 4 integer matrix.
Each row contains index of first row, index of first column, number of rows,
number of columns.  For a horizontal line the third of these is zero and for a
vertical line the fourth is zero.  Settings are not cumulative; they erase
previous settings.  The commas here are of course not necessary; they just
make the expression easier to read:

     `ld_pg has (`line;4 4 6 20 0 18,12 17 2 0,12 29 2 0,12 41 2 0);

The "colormap" attribute takes a two-column matrix of color symbols.  Each row
represents a foreground, background pair.

The "color" attribute, which is functional, allows you to color each character
on the page individually.  It can be a matrix of indices into the colormap
value.

The foreground and background colors are never set directly.  If color has not
been set, then the first pair of colors in colormap are used throughout the
page:

     `colormap of `ld_pg
     `ld_pg has (`colormap;2 2`blue`white `brown`green);
     `ld_pg has (`colormap;2 2`black`gray `red`white; `color;(msk;,<3 0 6));

The "blink" attribute also takes a mask and is functional.  The "blinkrate"
attribute is a scalar integer that tells in milliseconds the rate at which the
designated characters are to blink:

     `ld_pg has (`blink;(msk;,<3 0 6));
     `blinkrate of `ld_pg
     `ld_pg has (`blinkrate;750);

Another attribute that is functional and uses a mask is "bold"; it governs
which characters appear in boldface:

     `ld_pg has (`bold;(msk;(3 7 7;3 38 14;8 4 14;9 4 17)));

Finally, you can draw a set of boxes on the page display using the "box"
attribute, whose value is an n by 4 matrix with rows containing row index,
column index, row extent, column extent.  You can choose the colors for these
boxes by means of the "boxcolor" attribute.  Its value is a vector; if there
are fewer elements in boxcolor than there are boxes, the colors of the excess
boxes remain unchanged.  Thus the second and third statements below are
equivalent:

     `ld_pg has (`box;2 4 8 0 3 58, 12 4 2 50);
     `ld_pg has (`boxcolor;<,`green);
     `ld_pg has (`boxcolor;<`green`black);


4a. User Input

	Attributes:	cursor
			key
			keysym
			rband
			rbandbox
			3down
			3up
			2down
			2up

Page objects cannot be edited directly.  No cursor is shown for them, but
there is a "cursor" attribute, which is set to the row and column of the
pointer on the page when any mouse button is pressed.  Press various buttons
with the pointer at various locations on the page; after each button press,
press F2 with the cursor on the following statement, and see the values in the
A+ session log:

     `cursor of `ld_pg

You can simulate a cursor by means of the blink attribute.  It is up to you to
move this "cursor" based on the key press and mouse button events.  You can
use the "key" attribute to set a callback on key presses.

The "keysym" attribute is for reference only.  Its value is of the form (k;s),
where k is the ASCII code of the last character pressed, and s is a boolean
vector of eight integers indicating which modifier keys were pressed when the
key press event occurred.  The modifiers are:

  Shift, Caps Lock, Control, mod1, mod2, mod3, mod4, mod5

where mod1 is Meta, mod2 is NumLock and mod4 is Alt.

Set the key attribute, then press various key combinations (with the pointer
in the page window) and see the value of keysym in the A+ session log:

     f{}:`keysym of `ld_pg
     `ld_pg has (`key;f);

There are four attributes with callback for mouse-button presses: "3down",
"3up", "2down", and "2up".  Set the callbacks and then press and release the
middle and right mouse buttons (again, with the pointer on the page) and see
the callbacks recorded in the A+ session log:

     m{s}:s
     `ld_pg has (`2up`2down`3up`3down;((m;`2up);(m;`2dn);(m;`3up);(m;`3dn)));

You can draw a rubber-band box by placing the pointer anywhere in the page,
pressing and holding the left mouse button, moving the pointer anywhere in the
page that you want (even not moving it), and releasing the button.  A box is
shown continuously during this process, starting at the upper lefthand corner
of the character space on which you pressed the button.  When you release the
button, the row and column indices of the upper lefthand corner of the box and
the row and column extents are placed in the "rbandbox" attribute, displacing
any box specification that might have been there.  If you release it anywhere
in the same character row or column, the extent will be zero.  Try drawing
several boxes, pressing the F2 key on the following statement after each:

     `rbandbox of `ld_pg

What else happens depends when a box is drawn depends upon the "rband"
attribute, which has a default value, 0, and a default callback, specified by
the Null.  Execute the next two statements.  Then draw some more boxes, some
of them with zero area, executing the third statement after each box is drawn:

     `rband of `ld_pg
     `ld_pg has (`rband;);
     `rbandbox `box of `ld_pg

Notice that each box specification is placed in rbandbox and that the ones
that have non-zero extents in both directions are also appended to the box
attribute, reflecting the fact that these boxes remain on the page.  You can
define your own callback function for rband.  If you do so, the latest box
specification is still placed in rbandbox, but box is not automatically
changed (so the box does not remain automatically on the screen when the mouse
button is released).  As you have probably observed, there is a strong
similarity in this regard between the rband/box behavior and the refer/index
behavior.

Let's define a callback function for rband to color the delineated area
differently.  First get rid of all but the original boxes, add a color pair to
colormap, and change the value of color from a function and its static data to
a boolean mask:

     `ld_pg has (`box;2`box of `ld_pg);
     `ld_pg has (`colormap;(`colormap of `ld_pg),`blue`lightgrey);
     `ld_pg has (`color;msk{<3 0 6;;;;`;`ld_pg});

Execute these statements to specify a callback function for rband:

     rb{}:{(b1;b2;b3;b4)`rbandbox of `ld_pg;(i1;i2)ɡld_pg;
           m((i1b1)^i18)/g)`; g8 8g;
     'abcdefgh '[`a`b`c`d`e`f`g`h` g]
     `sl has (`geometry;g);
     show `sl; br{`sl;0, 10+>`xs of `s}

Now clean up:

     _ex ld_names,`f`g`mreal`rlbl`clbl,s.reset{}; _ex `ld_names;
aplus-fsf-4.22/src/html/tutorials/s.tutorials/menus.html0000444000265000001440000002033007232115777017112  
                            The Menu Display Classes
                            

1. The Choice Display Class

2. The Hmenu and Vmenu Display Classes

---------------------------------------------------


1. The Choice Display Class


The choice class, like the radio class, is for boolean-valued slotfiller
variables whose value part contains one and only one 1.  The radio display may
perhaps be more appropriate when the choices are few or choosing is done
often, the choice display when there are many choices or choosing is seldom
done.

The choice representation has three parts, a title area on the left, a button
in the middle invoking a pulldown menu, and a value area on the right.  The
pulldown menu consists of label areas, which hold either the value of the
label attribute or, if that is null, the symbolic indices of the slotfiller.
The value area holds the label or symbolic index for the only slotfiller value
that is 1.

In the following example, notice that:
   when the label attribute is null, the symbolic index is used;
   when the label attribute is given a non-null value, neither the size of the
window nor the display in the value area changes;
   when the value part of c is respecified, the display in the value area is
changed but the size of the window remains unchanged;
   when naturalsize is specified, the value area is enlarged and all of the
label is shown.

     $load s
     scrs.SCREEN-34 12
     br{w;m}:{w has (`yx;scr-m+`yxs of w);}
     c(`fut `opt `ind;(1;0;0))
     `c has (`class;`choice; `shelltitle;'QList Products'; `title;'Type');
     show `c; br{`c;100}
     `label of `c
     `c has (`label;(`Future;`Option;`Index));
     (1c)(1;0;0)
     `c has `naturalsize; br{`c;100}

If instead of respecifying the value part of c you had made a choice from the
menu, the effect would have been the same.  The instant you pressed the left
mouse button with the pointer on the choice button, the display in the value
area, but not its size, would have changed.

Starting fresh and reversing the order of the last two statements, you see
that specifying naturalsize increases the window size but does not change the
display in the value area; that display is changed by a respecification of the
underlying variable (and could have been done by a choice from the menu):

     _ex free `c;
     c(`fut `opt `ind;(1;0;0))
     `c has (`class;`choice; `shelltitle;'QList Products'; `title;'Type');
     show `c; br{`c;100}
     `c has (`label;(`Future;`Option;`Index));
     `c has `naturalsize; br{`c;100}
     (1c)(1;0;0)

What these two examples really demonstrate, of course, is that you want to set
the label attribute before realizing or showing the object.

Now make a selection in two different ways.  For the first selection, place
the pointer on the choice button, press the left mouse button, move the
pointer down the menu that appears, and release the button when the pointer is
on Option or Index.  For the second, again place the pointer on the choice
button, then click the left mouse button, use the up and down arrow keys to
move around the menu, stop at Future, and press Enter.

So far we have been dealing only with appearances.  To provide a response to
any menu selection, you must set a callback function.

Selecting an item in the menu amounts to selecting a symbolic index of the
slotfiller and causes a value change in the underlying variable.  When an item
is selected, if the value at that symbolic index is 0, then it becomes 1 and
the value that was 1 becomes 0.  In addition, the menu disappears and the
selected symbolic index or label is displayed in the value area.

Because of this value change, any callback function defined for the variable
is called whenever a new item is selected; the path argument p is the symbolic
index to the changed value.  Although there are actually two value changes,
the callback function is called only once, and its path argument refers to the
value that changed from 0 to 1.

Set a callback function that just displays the arguments that are passed
to it:

     f{s;d;i;p;c;v}:{'-----------';(s;d;i;p;c;v)}
     `c has (`set;(f;'choice'));

Make some choices and watch the responses that appear in the A+ session log.

If you choose a menu item that already has the value 1, no callback occurs.
On the other hand, a callback always occurs for a change made by an A+
statement, and all respecified values are included in it.  Furthermore, the
index and path arguments reflect the statement executed, so they are different
for the third and fourth statements below although the actions called for by
these statements are identical:

     c(`fut `opt `ind;(0;1;0))
     (1c)[0 1](0;1)
     (1c)[1]<1
     (`optc)1
     _ex free `c;


2. The Hmenu and Vmenu Display Classes


The hmenu and vmenu display classes are designed to represent nested
slotfillers as cascaded menus.  A nested slotfiller is a slotfiller some of
whose values are also slotfillers, perhaps nested slotfillers.  There is no
limit to the level of nesting.

In contrast to a choice display, the top-level menu is continuously shown,
laid out horizontally in hmenu and vertically in vmenu, but without any
indication of the last selection.  All submenus are pulldown and are arranged
vertically in both classes.  The items shown in the top-level menu are the
symbolic indices of the slotfiller.  If a value is also a slotfiller, then its
symbolic indices are shown in the corresponding submenu.

If a callback function is set on the nested slotfiller, a callback occurs
whenever a menu or submenu item is selected.  When the function is called,
only pd is given in the second argument (data), where d is the underlying
slotfiller.

Incidentally, these classes can be used with non-nested slotfillers to provide
buttons that have no outlines unless pressed:

     c(`fut `opt `ind;(0;1;0))
     `c has (`set;(f;'hmenu'));
     show `c is `hmenu; br{`c;100}

Click on the symbolic indices in the hmenu window.  Shadowed outlines will
appear around them and callback output will appear in the session log.  Do the
same for this vmenu:

     `c has (`set;(f;'vmenu'));
     show `c is `vmenu; br{`c;100}

Here is a more complicated example, with irregular levels of nesting:

     _ex free `c;
     c(`file`edit`charformat;(
          (`new`open`close`save;(;;;
               (`save`save_as`save_all;(;;))));
          (`copy`cut`paste`undo;(;;;));
          (`font`size`style;(
               (`kaplgallant`courier`times`palatino`helvetica;(;;;;));
               (`10`12`14`17`24;(;;;;));
               (`regular`italic`bold;(;;))))))
     show `c is `hmenu; br{`c;150 100}

When you click on an item that has an arrowhead, its submenu appears.  When
you click on an item without an arrowhead, a selection takes place and any
displayed submenus vanish.  You can also drag the pointer, holding the mouse
button down.  In a horizontal menu, a submenu appears whenever you are in an
item that has one; in a vertical menu, a submenu appears whenever the pointer
is on an arrowhead.

If you place the pointer in the hmenu window, the left and right arrow keys
move you from item to item in the top-level menu and the down arrow key moves
you to a submenu when you are on an item that has one.  In the submenus, the
up and down arrow keys move you among items, the left arrow key moves you back
to the parent menu, and the right arrow key moves you to a submenu when you
are on an item that has one.  The Escape key aborts the operation.  The Enter
key makes a selection if you are on an item with no submenu, and otherwise
aborts the operation.

Try these keys.  Then set the callback function and see the results of your
selections.

     `c has (`set;(f;'hmenu'));

A vmenu is handled in the same way, except that the keys act the same for the
top-level menu as for the submenus, since it is also vertical.  Execute the
next two statements and then try some selections.

     show `c is `vmenu; br{`c;150 100}
     `c has (`set;(f;'vmenu'));

     _ex free `c;
aplus-fsf-4.22/src/html/tutorials/s.tutorials/printing.html0000444000265000001440000002645607232116014017615  
Printing Display Objects

1. Generating a Print File

			Attributes: 	print
					printdisstyle
					printdisfile
					printfile

2. Size and Position

	2a. Paper Size

			Attribute:	printsize

	2b. Margins

		2b(i). For the Object

			Attributes:	printbottom
					printleft
					printright
					printtop

		2b(ii). For the Disclaimer

			Attributes:	printdisbottommargin
					printdisleftmargin
					printdisrightmargin
					printdistopmargin

	2c. Justification and Size of the Object

			Attribute:	printlayout

	2d. Disclaimer Rules

			Attribute:	printdisrulewidth

3. Orientation

			Attributes:	printdisorientation
					printorientation

4. Color and fonts

	4a. Color

			Attribute:	printmode

	4b. Fonts

			Attributes:	printdisfont
					printfont


---------------------------------------------------


1. Generating a Print File

	Attributes:	print
			printdisfile
			printdisstyle
			printfile


There are provisions in s for printing an object that is displayed on the
screen.  On request, s generates a PostScript file, which you can send to a
printer.  Although room is left for them, scrollbars are not shown, since they
would have no use.

First, load s, define a positioning function, and construct and show a layout
to be used as an example throughout this tutorial:

     $load s
     scrs.SCREEN-34 12
     br{w;m}:{w has (`yx;scr-m+`yxs of w);}
     p((2)99)100
     tttp,55 >1 2 3ϡ

(d;-d)+`printdisrulewidth of `l `l has (`printdisrulewidth;10; `printlayout;`center; `print;1); `l has (`printdisrulewidth;0); 3. Orientation Attributes: printdisorientation printorientation The "printorientation" and "printdisorientation" attributes pertain to the orientation, landscape or portrait, of the object and the disclaimer, respectively. If printdisorientation is `none or if printdisstyle is `append, the disclaimer orientation is the same as the object orientation. `printorientation `printdisorientation of `l `l has (`printdisorientation;`portrait; `print;1); `l has (`printorientation;`portrait; `print;1); 4. Color and fonts 4a. Color Attribute: printmode The "printmode" attribute allows you to choose the color characteristics of the object, and only the object, in the PostScript file, although of course the actual color will depend upon the printer used. Since we specified the color option for ghostview, you will see full color here when it is specified. The possible values are `mono (black and white, the default), `reverse (black and white reversed), `colorfg (the colors specified by fg attributes, with a white background), and `color. You obtain grayscale by specifying color and printing the PostScript file on a non-color printer. `printmode of `l `l has (`printmode;`reverse; `print;1); `l has (`printmode;`colorfg; `print;1); `l has (`printmode;`color; `print;1); 4b. Fonts Attributes: printdisfont printfont The "printdisfont" attribute specifies the font used for the disclaimer: `printdisfont of `l `l has (`printdisfont;'times-roman-12'; `print;1); The "printfont" attribute specifies the printer font to be used for any display font that is unavailable on the printer, such as manfnt.85: `printfont of `l `t has (`font;'manfnt.85'); `l has `print; `l has (`printfont;'palatino-roman'; `print;1); _ex `p`s`d,free `l; To dismiss ghostview, press q with the pointer in its window.

aplus-fsf-4.22/src/html/tutorials/s.tutorials/s_context_vars.html0000444000265000001440000010204407232116025021012  
                               s-Context Variables
                               

1. Introduction

2. Switches

	2a. General Display

		Variables:	s.AUTOEVALUATE
				s.AUTORESPACE
				s.AUTOTITLEDEFINE

	2b. Input

		Variables:	s.AUTOCOPY
				s.AUTOEDITSPACE
				s.AUTOEXECUTE

	2c. Containers

		Variables:	s.AUTOBUILD
				s.AUTONEWSHOW
				s.AUTOPOSITION

	2d. Multiple Windows

		Variables	s.AUTOREPARENT
				s.AUTORESHOW
				s.AUTOWS

	2e. Saving

		Variable:	s.AUTOSCRIPT

3. Parameters

	3a. General Display

		Variables:	s.AUTOBLANK
				s.BEEP
				s.DATASPACE
				s.WP
				s.WSNAME

	3b. Input

		Variables:	s.EDITSPACE
				s.NA

	3c. Graphs

		Variables:	s.FILLCOLORS
				s.LINECOLORS
				s.LINESTYLES
				s.TRACESYMBOLS

	3d. Multiple Windows

		Variables:	s.SHELL
				s.WS

	3e. System Response

		Variables:	s.ABORT
				s.BUSY
				s.CLOCK
				s.CONNECTED
				s.ERROR
				s.EXIT
				s.GRAY
				s.MSG
				s.QUIET
				s.VERIFY

	3f. Miscellaneous

		Variables:	s.AUTODOC
				s.SCREEN

4. Attribute Default Variables

		Variables:	s.BLACK
				s.BLUE
				s.GREEN
				s.GRAY
				s.ORANGE
				s.PURPLE
				s.RED
				s.WHITE
				s.YELLOW
				s.FONT

5. Data Variables

		Variables:	s.COLOR_NAMES
				s.COLOR_NUMBERS
				s.FONT_NAMES

---------------------------------------------------


1. Introduction


There are some fifty global variables that are defined in the s context to
provide defaults, parameters, system control, and so on.  They fall into four
categories: boolean switches, general parameters, system attribute default
variables, and informational data variables.


2. Switches


The s-context boolean switches correspond to attributes in a way that is
obvious from their names: the name of the corresponding attribute is the
string following s.AUTO, changed to lower case.  Thus s.AUTORESPACE
corresponds to respace.  These switches provide defaults for their attributes.

When an attribute that has a corresponding global switch is set to Null for an
object or has an initial default value of Null, the value of that attribute
for the object is set to the value of the corresponding switch.  That value
will be shown and used as the value of the attribute, but the fact that the
attribute was Null is remembered, and if the switch is changed later the
attribute value will be changed likewise.

The switches are grouped here by function to help you survey what is
available.  The meaning of each of them is briefly described; more details can
be found by looking up the corresponding attribute in an earlier tutorial or
the reference manual.  The examples given here not only show the operation of
the switches but also reinforce the discussions of the attributes in the other
tutorials.


2a. General Display

		Variables:	s.AUTOEVALUATE
				s.AUTORESPACE
				s.AUTOTITLEDEFINE

These switches are the defaults for attributes that dictate whether:

 -  a variable is evaluated in order to determine appropriate attributes for
    its display (evaluate is effectively 1) or is not evaluated (evaluate is 0);

 -  an object's space attribute is increased when exceeded by the result of
    the default out function (respace is 1) or is not (respace is 0);

 -  a dependent object's default title (to be used when the title is set to
    Null) is its definition (titledefine is 1) or its name (titledefine is 0).

The default for s.AUTOEVALUATE is 1; for the other two, the default is 0.  As
for the attributes, the default for evaluate, respace, and titledefine is
Null.  Thus they all take their values from the corresponding s-context
variables.

Let's take the last one as an easily visible example.  (The shelltitle changes
also, although you might not expect it to.  The titledefine attribute is to be
eliminated in Version 3.)

     $load s
     scrs.SCREEN-34 12
     br{w;m}:{w has (`yx;scr-m+`yxs of w);}
     a4 4; b1+a;
     c:ab
     show `c; br{`c;0};
     s.AUTOTITLEDEFINE
     `titledefine `title of `c

Because titledefine has the default value Null, s sets it to the value of
s.AUTOTITLEDEFINE.  If we change that value, then s remembers that titledefine
was Null, and changes its value accordingly, as shown by the result of setting
the title attribute to Null and by the result of the of function for
`titledefine:

     s.AUTOTITLEDEFINE1
     `c has (`title;);
     `titledefine `title of `c


2b. Input

		Variables:	s.AUTOCOPY
				s.AUTOEDITSPACE
				s.AUTOEXECUTE

These switches give the defaults for attributes that specify whether:

 -  when a row is inserted above or below an existing row the values in the
    new row are na's (copy is effectively 0) or are copies of the values in 
    the existing row (copy is 1);

 -  the space for editing in a cell is the value of s.AUTOEDITSPACE (editspace
    is 1) or the value of the space attribute (editspace is 0);

 -  input expression are executed (as A+ expressions) to obtain a value
    (execute is 1) or not (editspace is 0).

The default for s.AUTOCOPY is 0; for the other two, the default is 1.  As for
the attributes, the default for copy and execute is Null and for editspace 1.
Thus, for a given variable, editspace has to be set to Null for s.AUTOEDIT-
SPACE to be effective, whereas s.AUTOCOPY and s.AUTOEXECUTE are effective by 
default.

To reinforce the point about the distinction between the value of an
attribute, which you can see, and the source of the value, which you can't
necessarily see, consider the following sequence.  Recall that the execute
attribute governs whether an entry in a cell is executed or not, that is,
whether it can be an A+ expression, as opposed to, say, just a number.

     _ex >free `c;
     show `a`b; br{`a;0,10+>`xs of `b}; br{`b;0};
     > `execute of `a`b
     s.AUTOEXECUTE0
     > `execute of `a`b
     `a has (`execute;1); s.AUTOEXECUTE1;
     > `execute of `a`b                  Same value,
     s.AUTOEXECUTE0                       but not same source,
     > `execute of `a`b                  as you can see.

When an attribute name is preceded by a period in a "has" statement, what is
associated with the attribute is not the present value of the variable that is
named but the variable itself.

The function s.usedBy reports such explicit "electrical" connections: it lists
the variables (if any) that were specified for the attributes named in its
left argument and the object named in its right argument.  As shown in the
following statements, it does not report any variables whose use was initiated
implicitly by setting the attribute to Null (because that information is in
the toolkit and is not available to the s processor).

The first line below connects the execute attribute for both a and b to the
variable s.AUTOEXECUTE, but in different ways:

     `a has (`execute;); `b has (`.execute;`s.AUTOEXECUTE);
     `execute s.usedBy `a`b
     _ex free `a`b;


2c. Containers

		Variables:	s.AUTOBUILD
				s.AUTONEWSHOW
				s.AUTOPOSITION

These switches provide the default values for attributes that control whether:

 -  in a layout defined by a simple vector of symbols, the objects are placed:

     -  in a single column (build is 0), or

     -  in the relative positions in which they are already shown, any objects
        that are not on the screen being put in a pile at the top left (build 
        is 1);

 -  when an object is newly placed in a container, it is shown:

     -  always (newshow is 1), or

     -  only if the object was already shown elsewhere (newshow is 0);

 -  in a layout whose build attribute is 0 (perhaps from s.AUTOBUILD) and which
    is defined by a simple vector of symbols, the objects are placed:

     -  vertically, in a column (position is 1), or

     -  on top of each other (position is 0).

The default value for s.AUTOBUILD is 0, for s.AUTONEWSHOW 0, and for
s.AUTOPOSITION 1.  The default value for the build attribute is Null, for
newshow 0, and for position 1.  Therefore, of the three, only build will take
its value from the s-context variable by default; the others must be set to
Null to make the switch effective.

To illustrate:

     abcde6 8
     l`a`b`c`d`e
     show `l is `layout; br{`l;0}
     free `l;
     s.AUTOBUILD1         Reflected in build, because default for build is Null.
     show `a`b`c; br{`a;40+`yxs of `c}; br{`b;(40+`ys of `c),0}; br{`c;0}  
     show `l is `layout; br{`l;0}
     `a has (`raise;1);    a is under d and e; raise it (title changes from e to a).

     s.AUTOBUILD0; free `l; _ex `l;
     l`a`b`c; `l is `layout;
     `l has (`newshow;);    Needed to make newshow reflect s.AUTONEWSHOW.
     show `l; `l br 0
     l`a`b`c`d`e; `l br 0  d and e were not shown, so they are not shown in l.
     s.AUTONEWSHOW1; `l br 0
     l`a`b`c
     l`a`b`c`d`e; `l br 0  Now d and e are shown, since newshow is 1 for l.

     free `l; _ex `l;
     l`a`b`c; `l is `layout;
     `l has (`position;);   Make s.AUTOPOSITION effective.
     show `l; `l br 0       Vertically aligned.
     s.AUTOPOSITION0
     l()          Notice that a, b, and c are reparented and become top-level.
     l`a`b`c; `l br 0   Make the three arrays be placed in the layout afresh.
     `a has (`raise;1);  a is at the bottom. b is under there, too; you can check.


2d. Multiple windows

		Variables:	s.AUTOREPARENT
				s.AUTORESHOW
				s.AUTOWS

These switches provide the default values for attributes that determine
whether:

 -  an orphaned child is reparented to be a top-level object (reparent is 1)
    or freed (reparent is 0);

 -  a reparented child is shown if it was shown in its former parent (reshow
    is 1) or not shown (reshow is 0); and

 -  an object being shown initially can be the screen workspace (ws is 1) or
    not (ws is 0).

The default for all three variables is 1 and for all three attributes is Null.
See the effect of setting them to 0, being sure to read what appears in the A+
session log after each respecification of l:

     s.AUTOPOSITION1; free `l;
     show `l is `layout; `l br 0
     s.AUTORESHOW0
     l`b`c; `l br 0   a is reparented but not reshown: top-level but hidden.
     show `a;          And here is a.
     s.AUTOREPARENT0
     l`c; `l br 0     b is freed, not reparented.
     s.AUTOWS0
     free `l`a; show `l is `layout; `l br 0

Notice that this time, unlike previous times,l was created as a popup, as you
can see from its pin.


2e. Saving

		Variable:	s.AUTOSCRIPT

This switch provides the default for the attribute that governs whether a
definition appears for the object in the result of s.script{} (1) or not (0).

The default is 1 and the default for the script attribute is Null.  See the
Buttons tutorial.


3. Parameters


The s-context parameters are global variables that give default values for
attributes, control certain aspects of system behavior, and so on.


3a. General Display

		Variables:	s.AUTOBLANK
				s.BEEP
				s.DATASPACE
				s.WP
				s.WSNAME

s.AUTOBLANK contains the default value to be displayed for a na -- i.e., a
conventional value being used to indicate a missing value -- in an object for
which the value of the blank attribute is the Null.

The default value of s.AUTOBLANK is the Null, which causes na's to be
displayed as is.  The default value of the blank attribute is 1 0(), which
also causes na values to be displayed as is and causes s.AUTOBLANK to be
ignored.  To have the current value of s.AUTOBLANK be used by an object, set
its blank attribute to Null.

     s.AUTOWSs.AUTORESHOWs.AUTOREPARENT1
     free `l; show `c; `c br 0
     `c has ( `insertbelow;1; `space;10; `row;0);

Now move the mouse pointer into the display of c, press Meta-Insert
(Alt-Insert on IBM keyboards), and move the pointer back into the Emacs
window.  The first statement demonstrates that the default values of the
attribute and the default variable have the same effect on the display.  The
remaining statements of this set show that s.AUTOBLANK is not electrically
connected.

     `c has (`blank;);
     s.AUTOBLANK' '
     `c has (`blank;);
     s.AUTOBLANK'Fill in'
     `c has (`blank;);
     s.AUTOBLANK()

Setting s.BEEP to any value causes the display to beep.  Don't think of it as
a free variable to keep a value in, however:

     s.BEEP1
     10 do s.BEEP100
     s.BEEP

s.DATASPACE provides the default value for the space attribute, used when the
value of space is the Null.

     s.DATASPACE

When a variable for which default formatting is in effect is bound, s.WP is
used to calculate a tentative value for its space attribute:

 -  if s.WP is 0, the result is the value of s.DATASPACE;

 -  if it is -1, the result is the minimum width required for any cell in the
    entire object;

 -  otherwise, the result is the minimum width required for any cell in just
    the first s.WP rows or (for a vector) cells, to save computation.

The value of the space attribute is then set to the maximum of its existing
value, the value just calculated, and, if the object is a vector, the width of
its title.

Because space is a persistent attribute, we expunge the variable before each
redisplay in this example:

     s.WP
     s.WP1
     _ex free `c; c6 8; c[2]81234567890; show `c is `array; `c br 0
     s.WP0
     _ex free `c; c6 8; c[2]81234567890; show `c is `array; `c br 0
     s.WP1
     _ex free `c; c6 8; c[2]81234567890; show `c is `array; `c br 0

s.WSNAME holds the default value of the shelltitle attribute for the object
named in s.WS.  The default value for s.WSNAME itself is 01_argv if _argv is
not the Null, and 'A+' otherwise.  Clearly, an application name is a good
value for this variable.  Its value is used when the object's shelltitle
attribute is set to Null or the object is first shown (with a shelltitle
attribute of Null):

     s.WSNAME'A+ Tutorial'      No visible effect.
     `c has (`shelltitle;);      Aha!
     s.WSNAME'A+ s Tutorial'    No visible effect.
     free `c; show `c; `c br 0   Yes!
     s.WSNAME'A+'; _ex free `c;


3b. Input

		Variables:	s.EDITSPACE
				s.NA

The space available for editing in a cell is given by one of two values: the
space attribute or, when the editspace attribute is effectively 1,
s.EDITSPACE, whose default value is 256.  If the editing space exceeds the
value of the space attribute, scrolling is performed automatically.

The na attribute gives a conventional value to be used to indicate missing
data.  When a row is inserted and the copy attribute is not effectively 1, the
na value is used for each inserted element of the variable.

If na is Null (its default value), its value comes from s.NA, which is a
slotfiller whose symbolic indices are the type symbols.  The na value used for
a variable x with null na is (x)s.NA.  The na values can be seen in the
following example because the blank attribute and s.AUTOBLANK are null until
the last statement, when the current na values are shown as "Fill in":

     s.NA
     c6 5; `c is `array;
     `c has (`insertbelow;1; `space;10; `cols;2);
     show `c; `c br 0
      Click on the first row of c and press Meta-Insert (Alt-Insert on
        IBM keyboards). Inserted elements have the value 999999999.
     (`ints.NA)888888
      Move pointer into c; press Meta-Insert. Inserted values: 888888.
     `c has (`na;0);
      Insert another row. Inserted values: 0.
     (`ints.NA)777
      Insert another row. Inserted values: still 0.
     `c has (`na;);
      Insert another row. Now inserted values are 777.
     `c has (`blank;'Fill in');

We could have specified `c has (`na;50).  For numeric matrices, scalar and
vector na specifications have the same effect on the variable and the display.
For character matrices, the situation is somewhat different.  Scalar and
vector na attributes have the same effect on the variable, but for the blank
attribute the contents of each cell is checked against the value of the na
attribute.  Each cell contains an entire row of the variable, so only the
vector form will be found:

     c`character`matrix
     `c has (`na;'-'; `blank;' ');
      Move the pointer into c and press Meta-Insert.
      Notice that the na's are not found and replaced in the display.
     `c has (`na;9'-'); `c has `refresh;

Now the cells with na's have been found and the replacement made.  The blank
attribute can have a vector value, which is given to the entire cell.  In
fact, the na attribute can be given a vector value, and the elements of that
value will be assigned to the elements of the row of the matrix:

     `c has (`blank;'New text:');
     `c has (`na;'Insertion');

Insert another row. Its value is "insertion", its display is "New text:", and
the previously inserted row no longer is na.

     c[1;1+7]
     _ex free `c;

Notice that the blank attribute is used in the display of only those elements
of the variable that are equal to the current value of the na attribute.


3c. Graphs

		Variables:	s.FILLCOLORS
				s.LINECOLORS
				s.LINESTYLES
				s.TRACESYMBOLS

These variables provide the default values for the fillcolor, linecolor,
linestyle, and symbol attributes.

     s.FILLCOLORS
     s.LINECOLORS
     s.LINESTYLES
     s.TRACESYMBOLS

The default for style is line.  With one trace set, the default is to
distinguish the traces by color and to use the same line style for all of
them.  You can, of course, change the default line colors, with a refresh to
make the change effective:

     t12 41 1.25 1.5 1.75 2 2.25 2.5 2.75
     g`t1; `g is `graph;
     show `g; `g has (`legend;`xy; `xlegend;53); `g br 0
     s.LINECOLORS`deepskyblue `yellow;
     `g has `refresh;
     s.LINECOLORSs.FILLCOLORS; `g has `refresh;

You can also detach the attributes from the default variables by giving them
non-null values.  For example, you can distinguish traces within a trace set
by line style instead of color:

     `t1 has (`linecolor;`black);
     `t1 has (`linestyle;`dotdash`dot`solid);

For a single trace set in the scatter style, the default is to distinguish the
traces by both fill color and symbol:

     `t1 has (`style;`scatter);

The fillcolor and symbol attributes can be set directly, and their default
values can be changed:

     `t1 has (`fillcolor;`yellow);
     `t1 has (`symbol;`xsym);
     `t1 has (`symbol;`diamond`xsym`diamondfilled);
     s.TRACESYMBOLSs.TRACESYMBOLS
     `t1 has (`symbol;);

When there is more than one trace set, color is used to distinguish among the
sets and line style and symbol are used to distinguish among the traces within
each set.  Start by restoring the defaults and adding a second trace set; try
reversing the default order of the line style:

     `t1 has (`linecolor`linestyle`fillcolor;3());
     t2t1; t2[;0]3 4;
     g`t1`t2; `t1 has (`style;`line);
     s.LINESTYLESs.LINESTYLES; `g has `refresh;

When there are several trace sets and the scatter style is used, both fill
color and symbol are used to distinguish among sets.  If you want to
differentiate traces presently within the same set, either change their
attributes directly, as in the following example, or put them in different
trace sets.

     `t1 has (`style;`scatter);
     `t2 has (`style;`scatter);
     `t1 has (`fillcolor;`blue`yellow`orange);
     s.FILLCOLORS,>`fillcolor of `t1; `t1 has (`fillcolor;);

     _ex free `g;


3d. Multiple Windows

		Variables:	s.SHELL
				s.WS

s.SHELL specifies whether the default window type is pop-up (-1) or top-level
(0).  That is, when an object is created and its window type is not specified
in some other manner, it will be determined by s.SHELL:

     s.SHELL
     s.SHELL0
     abcde6 8
     show `a`b`c`d; `a`b`c`d br (90 0;60 0;30 0;0);

Because we changed s.SHELL from its default value of -1 to 0, all four objects
were created as top-level windows.  There is a way to reverse this effect for
individual variables.  If an underscore is inserted immediately following the
backquote in the name of the class to which the object is being bound, then
the window type will be the opposite of the default established by s.SHELL:

     free `d;
     show `d is `_array; `d br 0

Now we will repeat the process with the opposite default.  Notice that one
exception occurs:

     free `a`b`c`d;
     s.SHELL1
     show `a`b`c`d; `a`b`c`d br (90 0;60 0;30 0;0);
     free `d;
     show `d is `_array; `d br 0

Why is  a  top-level despite the default window type of pop-up?  When it was
created, there was no screen workspace, and so it was made the workspace,
which requires that it be top-level.  s.WS names the screen workspace and its
value verifies the fact that  a  is it.  Setting s.WS to Null makes the
current screen workspace no longer the workspace; the next object created
will become the screen workspace.  The object that is no longer the screen
workspace is given the default window type.  Both it and the next object
created are raised above the other windows, being newer, so we have to raise
the existing windows each time in this example to maintain visibility:

     s.WS
     s.WS(); `b`c`d has `raise;
     show `e; `e br 120 0; `a`b`c`d has `raise;
     s.WS

     _ex free `a`b`c`d`e;


3e. System response

		Variables:	s.ABORT
				s.BUSY
				s.CLOCK
				s.CONNECTED
				s.ERROR
				s.EXIT
				s.GRAY
				s.MSG
				s.QUIET
				s.VERIFY

Five of these variables have to do with error responses and messages: s.ABORT,
s.ERROR, s.MSG, s.QUIET, and s.VERIFY.

Errors are classified by s as either moderate or severe.  When an s function
encounters a severe error, s.ABORT controls what happens: if it is 1 (the
default), execution of the s function and the functions in its calling chain
is aborted, whereas if it is 0, execution of the function is suspended.

When an s function encounters a moderate error, s.ERROR controls what happens:
if it is 1, whatever action s.ABORT dictates is taken, whereas if it is 0 (the
default), execution is continued despite the error.  First we make sure the
defaults are in effect:

     s.ABORT1; s.ERRORs.QUIET0;
     show `a  a6 8; `a br 0
     f{}:`a is `layout
     f{}
     $si
     s.ABORT0
     f{}
     $si
     
     f{}:{`a has (`xlegend;3); '*** Continued ***'}
     f{}
     s.ERROR1
     f{}
     $si
     
     s.ABORT1
     f{}
     $si
     s.ERROR0

There are three categories of s messages: for severe errors, for moderate
errors, and as warnings or information.  As you have just seen, exclamation
points -- two, one, or none -- indicate the category of a message, which is
syntactically in the form of a comment.  s.QUIET controls which messages are
displayed: all (0), errors only (1), severe errors only (2), or none (-1).
Try the following example and see the messages gradually disappear:

      s.QUIET is 0
     free `a; show `a; `a br 0; `a has (`xlegend;3); `a is `layout;
     s.QUIET1
     free `a; show `a; `a br 0; `a has (`xlegend;3); `a is `layout;
     s.QUIET2
     free `a; show `a; `a br 0; `a has (`xlegend;3); `a is `layout;
     s.QUIET1
     free `a; show `a; `a br 0; `a has (`xlegend;3); `a is `layout;
     s.QUIET0

The messages from s do not have to be routed to the session log.  They can be
routed to a variable instead, in which case the comment symbol and space at
the beginning will be omitted.  The messages are overwritten; the variable
will contain only the last message.  If the variable is a displayed object,
the last message will be shown in its display.  Explicit results and messages
that are not from s will continue to be shown in the A+ session log.

You specify the destination for the messages from s in the variable s.MSG, by
giving a name in symbol form or else the Null.  The name must be a valid name
for a variable, but the variable need not exist.  The Null is used to specify
the session log:

     ()s.MSG
     a3 50' '; `a is `label; `a has `naturalsize; `a br 0
     s.MSG`a
     `a has (`xlegend;3); `a is `layout;
     `a has (`xlegend;3);
     `a has (`bg;white)    Non-s error messages appear in the A+ session log.
     
     `a has (`bg;`white)   Explicit results always go to the log, also.
     s.MSG`m              No such variable yet.
     `a has (`xlegend;3); `a is `layout;
     m
     m
     _ex >free `a;
     m
     m
     s.MSG()
     a6 8; show `a; `a br 0; `a has (`xlegend;3); `a is `layout;

A variable must satisfy certain type and rank restrictions in order to be
bound to a given display class.  When its verify attribute is effectively 0
(the default value), verification takes place in the A+ interpreter; when it
is 1, verification takes place within the s-context functions and a more
meaningful message is emitted.  The default value for verify is actually Null,
which means that the value of s.VERIFY is to be used.  (s.AUTOVERIFY might be
a name more consistent with the conventions for naming s-context variables.)
The default value of s.VERIFY is 0.

The following example shows the two verifications and, in the latter case, by
directing the message from s away from the session log, shows where the parts
of the message come from (as you would expect from their form):

     a2 3 4 51
     
     s.VERIFY1; `verify of `a    The effective value is shown, not the actual.
     a2 3 4 51
     
     s.MSG`m
     a2 3 4 51
     
     m
     s.MSG(); s.VERIFY0; _ex `m;

Three of the variables discussed in this section have to do with indications
that the system is busy: s.BUSY, s.CLOCK, and s.GRAY.

We will say that the pointer is "busy" -- or that the busy pointer is on --
during periods in which it is required to appear as a small clock whenever it
is in an s window.

The first of these variables provides a semi-automatic control for the busy
pointer.  It allows a function to turn the busy pointer on and, so far as that
function is concerned, off.  Specifically, when s.BUSY is set to 1, an
internal "busy count" is incremented by 1, and when it is set to 0 the count
is decremented by 1 (but not below 0).  Whenever the count is non-zero, the
pointer appears busy:

     f{}:{s.BUSY1; g{}; sys.sleep 5; s.BUSY0}
     g{}:{s.BUSY1; sys.sleep 5; s.BUSY0}
     b6 8; show `b; `b br 0,10+>`xs of `a
     $dbg func 1
     $dbg +cxt .

Now press F2 on the following statement and move the pointer into the display
of  a  or  b  during its execution:

     f{}
     $dbg func 0

s.CLOCK provides an independent automatic control for the busy pointer.  If
s.CLOCK is 1, the pointer appears busy whenever it is in any s window during
callbacks for displayed objects and during assignments to variables being
displayed on the screen.  If it is 0, such events do not cause the pointer to
appear busy, thus avoiding flicker in, e.g., applications with fast real-time
update rates.

After executing the first three statements, move the pointer in the display of
a  and press F1; you will see the pointer go busy for two seconds.  Then move
the pointer back into the Emacs window, press F2 on the statement executing
f{}, and move the pointer into the display of  a  or  b.  After three seconds,
you will see it flash to busy and back.  Notice that the shelltitle area is
"grayed" each time the pointer is busy:

     g{}:{sys.sleep 2; 'g done'}
     `a has (`f1;(g;));
     f{}:{sys.sleep 3; .a.a; 'f done'}
     f{}

s.GRAY, which has a default value of 1, controls whether the shelltitle
areas of the s windows are grayed whenever the pointer is busy.  It is thus
dependent upon s.BUSY and s.CLOCK.  Press F1 in the display of  a  after
executing each of the following two statements.  You will see the busy pointer
without graying and then neither a busy pointer nor graying:

     s.GRAY0
     s.CLOCK0; s.GRAY1;

     s.CLOCK1


3f. Miscellaneous

		Variables:	s.AUTODOC
				s.SCREEN

The doc attribute allows you to provide documentation for objects.  The
default value for doc is s.AUTODOC.  By setting it to the name of the
application and perhaps your name, for example, you can provide minimal
generic documentation for those objects for which you don't want to provide
specific documentation.

s.SCREEN is a dependency that gives the height and width of the current
screens in pixels.  You may have noticed that we used it for the br function,
to find out where the bottom right corner was in the screen you are using to
run this tutorial.

     s.SCREEN


4. Attribute Default Variables

		Variables:	s.BLACK
				s.BLUE
				s.GREEN
				s.GREY
				s.ORANGE
				s.PURPLE
				s.RED
				s.WHITE
				s.YELLOW
				s.FONT

An attribute default variable can supply an attribute value for all s objects,
for objects bound to a certain class or classes, or for an individual object
or objects.  We will consider attribute default variables for the bg
attribute, in the order of comprehensiveness just given.

The s-context system attribute default variables each provide defaults for
certain attributes for objects bound to all classes, except that s.FONT does
not apply to the graph class.  The attributes they apply to are listed in
Table 56-3 of the A+ Reference Manual.

Although the value of the bg attribute for the object  a  is given below by
the  of  function as `grey, it is in fact Null.  It gets its effective value
from the system attribute default variable s.GREY, as its responsiveness to
changes in that variable shows.  The object  b, also of the array class, sheds
further light on the effect of the default variables:

     `bg of `a
     s.GREY
     s.GREY`purple
     s.GREY`grey

What if we set the value of bg of  a  ourselves?  Then we have temporarily
disconnected it from s.GREY -- broken the electrical connection.  Changing the
variable does not in general change the background color.  If, however, we
make them coincide again, by changing the value of either bg or s.GREY, then 
we reconnect them, and when we change the variable the background changes:

     `a has `bg `rosybrown
     s.GREY`purple
     s.GREY`rosybrown
     s.GREY`grey

We can change the default variable for bg for the entire array class.  When we
establish the new default variable in the example below, nothing happens,
because its value is not the same as the bg value for  a.  Just as for the
system default, we can establish the connection by making the values coincide.
Changing s.GREY now has no effect on the bg of  a, because s.GREY has been
displaced by arrayGREY for bg for array objects.  (We could, to be sure, make
arrayGREY also be the default variable for other attributes and for other
classes.)

     arrayGREY`mediumseagreen
     `array s.Has `.bg `arrayGREY
     arrayGREY`grey
     arrayGREY`mediumseagreen
     s.GREY`mediumseagreen
     s.GREY`grey

We can specify a bg variable just for a.  As soon as  has  is executed, the
new variable  clr is used for the background color, because we are no longer
in a situation where there may be many objects and some of them may be
exceptions to the general rule embodied in the default variable.  Response is
immediate not only to direct settings of bg but also to settings of  clr:

     clr`rosybrown
     `a has `.bg `clr;
     clrs.BLUE
     `a has `bg `grey;
     clr`cyan

So here are the present values of the attribute for  a, the default variable
for it for  a, the default variable for it for this class, and the default
variable for all other classes, typified by table, namely the system default
variable:

     `bg of `a
     `.bg of `a
     `.bg s.Of `array
     `.bg s.Of `table

We can remove the default variable for bg for this object by specifying it to
be the Null.  We thereby remove the shadow from the default variable for the
array class and it acts as it did before:

     `a has (`.bg;);
     arrayGREY`cyan
     arrayGREY`rosybrown

Removing the default variable for bg for the entire array class does not have
a similar effect, because it displaced, not shadowed, the system default
variable:

     `array s.Has (`.bg;);
     arrayGREY`grey
     s.GREY`rosybrown
     s.GREY`grey
     `.bg s.Of `array

Explicitly setting the default variable for bg for array restores its effect.
We must, of course, make the default variable for the class agree with the
actual value of the attribute of the object to restore the connection.  If 
this doesn't work now, it will work soon, in another release:

     `array s.Has (`.bg;`s.GREY);
     s.GREY`rosybrown
     s.GREY`grey
     `.bg s.Of `array

The default for the font, labelfont, and titlefont attributes for all classes
except graph is obtained from s.FONT, whose default value is "kaplgallant".
(The dynamic attribute governs whether the window is resized when the font is
changed.)  Watch the fonts change in a when you execute these statements:

     s.FONT'helvetica'
     s.FONT'helvetica-14'
     s.FONT'kaplgallant'


5. Data Variables

		Variables:	s.COLOR_NAMES
				s.COLOR_NUMBERS
				s.FONT_NAMES

These variables give information about the colors and fonts that are
available.  The values of the two names variables are long lists of symbols;
using Unpack and show is a good way to display them:

     _ex`a`b,free`a`b;  show s.FONT_NAMES; `a br 0

The color variables can be shown together:

     (cn1;cn2;cn3)<@1s.COLOR_NUMBERS
     cnmss.COLOR_NAMES
     t`cn1`cn2`cn3`cnms
     `t has (`class;`table; `cols;4; `title;'Color numbers and names');
     `cn1`cn2`cn3`cnms has (<`title),<(`R;`G;`B;'Color names');
     `cn1`cn2`cn3 has <(`space;4);
     show `t; `t br 0

     _ex`f`g`l`arrayGREY`clr,s.reset{};
aplus-fsf-4.22/src/html/tutorials/s.tutorials/special_io.html0000444000265000001440000002472010751662537020102  
                       Special Input and Display Classes
                       

1. Special Input

	1.a The Text Display Class

		Attributes:	buffer
				save

	1.b The Command Display Class

	1.c The Password Display Class

		Attributes:	fill
				valid
				validate

2. Special Display

	2a. The Scalar Display Class

	2b. The Tree Display Class

---------------------------------------------------


1. Special Input


Input to the classes described in the Data tutorial is performed by entering an
Emacs-type editor in a cell and later exiting from it.  Input to the three
classes described below is performed or handled in a special way.


1a. The Text Display Class

		Attributes:	buffer
				save

The text display class provides a note pad, a general means for text entry.
The underlying variable for an object bound to this class is a character
vector.  A text object is always in edit mode; there are no user actions that
begin or end edit mode.  Keystrokes constitute text input to it whenever it
has focus.

New lines are created during text entry by pressing the Enter key, which
appears in the character vector as the character `char10 (newline); this is
the only control character that should be used in the text.  APL characters
can be entered.

     $load s
     scrs.SCREEN-34 12
     br{w;m}:{w has (`yx;scr-m+`yxs of w);}
     t'Notes, 6/15/94:   '
     `t has (`class;`text; `shelltitle;'Shelltitle'; `title;'Title');
     show `t; br{`t;0}

Observe that the cursor is at the beginning of the text.  It can be moved to
the end by using either the Right Arrow key or the End key.  Enter some text.

     t

The text you entered should not appear in the value of  t.  Since there is
never a signal that editing is complete, when text is entered the underlying
character vector is not automatically updated.  The text currently on the
screen can always be obtained, however, as the value of the "buffer"
attribute, which is a one-row matrix:

     >`buffer of `t
     >`buffer of `t

To update the underlying variable, the viewer enters Ctl-s (when the text
object has focus).  If the "save" attribute has the value 0, the Ctl-s entry
has no effect, but if save is 1 (the default value), then the underlying
variable is set to the value of the buffer attribute.  Enter Ctl-s in the text
object after save is set to 0 and again after it is set to 1, and notice the
behavior of the cursor each time:

     `t has (`save;0);
     t
     `t has (`save;1);
     t
     t
     >`buffer of `t

The visible sign that the text has been saved in the variable is the movement
of the cursor to the beginning of the text.  That movement may require that
End be pressed every time after Ctl-s.  If, however, you want a series of
notes in inverse chronological order, then you can just start entering text
where you are left after each Ctl-s.  In that case, you would probably not
want to have any initial text, but rather put the identification -- date or
other tag -- in either the title or the shelltitle.

After respecification as a result of a Ctl-s, the underlying variable is still
a vector and the value of the buffer attribute is still a matrix with one row,
but their ravels are equal.  The buffer is ready to accept additional text, in
contrast to a buffer for an object of the command display class, which we turn
to next.

     _ex >free `t;


1b. The Command Display Class

The command display class is for monitoring the character-by-character input
of a command line.  A command display has two parts, a title area on the left
and a value area on the right.  Text can be entered in the value area, and the
entry can be monitored one character at a time, using a callback function
specified in the key attribute.

The contents of the value area is initially, of course, the value of the
underlying variable.  It could be blank, as here, or an initial, common
segment of the command, to aid the viewer.  The value of the underlying
variable does not change until the editing is complete, that is, until Enter
is pressed.  Just as for a text object, the current contents of the value area
are available in the buffer attribute and the position of the cursor can be
queried:

     c20' '
     f{x}:(,>`buffer of x;>`cursor of x)
     `c has (`class;`command; `key;(f;`c); `title;'Enter command:');
     show `c; br{`c;0}
     `cursor of `c
     >`buffer of `c

The buffer is empty because edit mode has not yet been entered.  Now begin
editing; press a few keys and notice that there is a callback for each of
them, including the arrow and shift keys, so that to determine whether a new
character has been entered or one has been deleted you need to know the buffer
contents, or at least its shape, at the previous callback:

     >`buffer of `c
     >`buffer of `c
     c
     c
     `c has (`key;);

Now press some more keys, and end with Enter:

     >`buffer of `c
     c
     c

The buffer is empty, since you are no longer in edit mode, but the contents of
the value area are now reflected in the underlying variable.

     _ex `f, >free `c;


1c. The Password Display Class
	
		Attributes:	fill
				valid
				validate

The password display class provides password protection for applications.  The
password display has two parts, a title area on the left and a value area on
the right.  The underlying variable holds a user name.  Text can be entered in
the value area and compared to the login password of that user.  You can
control the size of the value area by means of the space attribute.  The value
area is empty initially and is cleared each time input is completed.  For the
underlying variable in the example, we'll use your login id, so that you'll
know the correct password:

     pwsys.getusername{}
     `pw has (`class;`password; `title;'Enter password:'; `space;10);
     show `pw; br{`pw;0}

The "validate" attribute holds the definition of a function that is to be
called when input is completed, i.e., when Enter is pressed.  The "valid"
attribute, which is for reference only, is initially 0.  It is set to 1 when
input is completed if the entry in the value area is the login password for
the user name in the underlying variable.  It is set to 0 whenever input mode
is entered.  Assign to the validate attribute a callback function that
displays the value of valid:

     f{s;c;v}:`valid of cv
     `pw has (`validate;f);

Each character that is entered in the value area is displayed as an asterisk,
which is the default value of the "fill" attribute.  You can change fill to
any character you want (including blank).  Enter your password and observe
that 1 appears in the A+ session log, then execute the following statement to
change the fill character, enter text that is not your password, and see 0 in
the log:

     `pw has (`fill;'-');

     _ex `f, >free `pw;


2. Special Display


There are two classes that display variables in special ways: the scalar and
tree display classes.


2a. The Scalar Display Class

Any A+ global variable can be bound to the scalar class.  The display has two
parts side by side, a title area on the left and a value area on the right.
The value area contains an A+ expression that represents the value of the
variable, in the sense that the evaluation of the expression is identical to
the value of the variable.  (This is not quite true for floating-point values;
the number of decimal digits appearing in the formatted display of a floating-
point value from the workspace may not be enough to exactly reproduce the
source value when executed.)

     s1 2 3 4 5 6
     show `s is `scalar; br{`s;0}

There are the usual possibilities for the title area, whose default value is
the variable name:

     `s has (`title;'');
     `s has (`title;' ');
     `s has (`title;'An A+ expression:');
     `s has `naturalsize; br{`s;0}

Edit the A+ expression in the value area, inserting a 0 after the 1.  When the
size is increased, all the extra room goes to the value area.  Linear
expressions are recognized:

     s
     `s has (`xs;1.3>`xs of `s); br{`s;0}
     s(3 4;'abcdef'; 5.3 1.4 2.7 0.863)
     `s has (`space;37; `naturalsize;); br{`s;0}
     s2 4 6 8 10 12
     s(10 8 6 4 2;2.2 4.4 6.6 8.8)
     s(1 2 4 7 11; 2 4 8 16 32 64)
     s4 30 4 8 1 5 9 2 6 10 3 7 11

     _ex free `s;


2b. The Tree Display Class

The tree display class is for displaying nested slotfillers as trees.

A layout can be represented as a nested slotfiller; in fact, the value of the
familytree attribute is such a representation.  Consider this layout, for
example:

     label'Just an example'
     f{}:sys.ts{}
     button1button2button3<{f}
     vpane`hpane1 `hpane2
      hpane11 2`array1 `array2
       array1array210 8
      hpane21 2`table1 `table2
       table1`array3 `array4
       table2`array5 `array6
        array3array4array5array6100000010
     s.QUIET1
     {`label `vpane `hpane1 `hpane2 `table1 `table2 is
      `label `vpane `hpane  `hpane  `table  `table;}
     `table1 has (`cols;2); `table2 has (`cols;1);
     `array3 `array4 `array5 `array6 has <(`space;8);
     layout(`label;`button1 `button2 `button3;`vpane)
     show `layout is `layout; br{`layout;0}

Now obtain the nested slotfiller representation from the familytree attribute
and show it as a tree, alongside the layout:

     t0`familytree of `layout
     t
     show `t is `tree; br{`t;0,10+>`xs of `layout}

A nested slotfiller cannot embody the geometry of a layout in general, because
for each set of children it can only give a linear order, which would
correspond to a simple horizontal or vertical arrangement.  Therefore, no
attempt is made in the familytree attribute to capture the geometry and each
set of children just appears in some convenient order.

Viewer interactions with objects in the tree display class are controlled not
by attribute settings but rather through callback functions.  Define a
callback function for t:

     cbf{s;d;i;p;c;v}:(s;d;i;p;c;v)
     `t has (`set;(cbf;'----------'));

Click the left mouse button twice on some nodes of t.  Observe that the first
click causes a box to appear around the node (and any box around another node
to disappear) and the second click causes a callback and that  p, the path
variable, is the symbol vector path to the node.

     _ex `f`cbf, s.reset{};
aplus-fsf-4.22/src/html/tutorials/s.tutorials/Makefile.in0000644000265000001440000001574110774512523017151 # Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ ############################################################################### ############################################################################### SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../../.. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CXX = @CXX@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ STRIP = @STRIP@ VERSION = @VERSION@ X_INCLUDES = @X_INCLUDES@ X_LIBS = @X_LIBS@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ s_tutorialsdir = $(prefix)/doc/html/tutorials/s.tutorials s_tutorials_DATA = \ buttons.html \ containers.html \ data.html \ introduction.html \ menus.html \ printing.html \ s_context_vars.html \ special_io.html EXTRA_DIST = \ buttons.html \ containers.html \ data.html \ introduction.html \ menus.html \ printing.html \ s_context_vars.html \ special_io.html subdir = src/html/tutorials/s.tutorials mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_CLEAN_FILES = DIST_SOURCES = DATA = $(s_tutorials_DATA) DIST_COMMON = Makefile.am Makefile.in all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/html/tutorials/s.tutorials/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: s_tutorialsDATA_INSTALL = $(INSTALL_DATA) install-s_tutorialsDATA: $(s_tutorials_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(s_tutorialsdir) @list='$(s_tutorials_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(s_tutorialsDATA_INSTALL) $$d$$p $(DESTDIR)$(s_tutorialsdir)/$$f"; \ $(s_tutorialsDATA_INSTALL) $$d$$p $(DESTDIR)$(s_tutorialsdir)/$$f; \ done uninstall-s_tutorialsDATA: @$(NORMAL_UNINSTALL) @list='$(s_tutorials_DATA)'; for p in $$list; do \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " rm -f $(DESTDIR)$(s_tutorialsdir)/$$f"; \ rm -f $(DESTDIR)$(s_tutorialsdir)/$$f; \ done tags: TAGS TAGS: DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = ../../../.. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: $(mkinstalldirs) $(DESTDIR)$(s_tutorialsdir) 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_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_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-generic clean-libtool mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-s_tutorialsDATA install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool uninstall-am: uninstall-info-am uninstall-s_tutorialsDATA .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-s_tutorialsDATA \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool uninstall uninstall-am \ uninstall-info-am uninstall-s_tutorialsDATA # 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: aplus-fsf-4.22/src/html/tutorials/s.tutorials/Makefile.am0000664000265000001440000000174507232077750017144 ## Process this file with automake to produce Makefile.in ############################################################################### ## ## ## Copyright (c) 2001 Morgan Stanley Dean Witter and Co. ## ## See ..../src/LICENSE for terms of distribution. ## ## ## ## ## ############################################################################### s_tutorialsdir = $(prefix)/doc/html/tutorials/s.tutorials s_tutorials_DATA = \ buttons.html \ containers.html \ data.html \ introduction.html \ menus.html \ printing.html \ s_context_vars.html \ special_io.html EXTRA_DIST = \ buttons.html \ containers.html \ data.html \ introduction.html \ menus.html \ printing.html \ s_context_vars.html \ special_io.html aplus-fsf-4.22/src/html/tutorials/s.tutorials/RCS/0000777000265000001440000000000010774505732015613 5aplus-fsf-4.22/src/html/tutorials/s.tutorials/RCS/buttons.html,v0000444000265000001440000012241610774505726020364 head 1.2; access; symbols; locks; strict; comment @# @; 1.2 date 2008.04.01.19.24.06; author jmiz; state Exp; branches; next 1.1; 1.1 date 2008.04.01.19.22.37; author jmiz; state Exp; branches; next ; desc @@ 1.2 log @*** empty log message *** @ text @  
                         Display Classes for Buttons
                         

1. The Action Display Class

	1a. Actions

		1a(i). Callbacks; Screen Position

			Attributes:	atsector
					preset
					set
					x
					y
					yx

		1a(ii). Other Actions

			Attributes:	f1, ..., f12
					fkeys
					selected

	1b. Appearance

		1b(i). Arrangement of the Buttons

			Attributes:	geometry
					verify

		1b(ii). Size

			Attributes:	C
					R
				       	xs
					ys
					yxs

		1b(iii). Displayed Characters

			Attributes:	justify
					label
					labelfont
					shelltitle
					title
					titlefont

		1b(iv). Color

			Attributes:	bg
					fg
					labelfg
					titlefg

	1c. Additional Windows

		1c(i). Kinds of Windows

			Attributes:  	iconic
					ws
			Variable:	s.WS

		1c(ii). Visibility

			Attributes:	followers
					followertree
					hide
					icon
					icontitle
					lower
					raise
					show

		1c(iii). Selection

			Mouse Pointer
			Keys:		Arrow keys
					Ctl-Shift-Tab
					Ctl-Tab
					Enter
					Shift-Tab
					Tab

	1d. More about Appearance

		1d(i). Changes in Appearance

			Attributes:	hl
					hlthickness
					shadowthickness

		1d(ii). Other Features

			Attributes:	exit
					foot
					head
					is
					leftfoot
					pin
                                        resizeable
					rightfoot

	1e. Status and its Preservation

		1e(i). Status

			Attributes:	bound
					class
					stateself
					settings

		1e(ii). Saving

			Attribute:	script
			Variable	s.WM_SAVE_YOURSELF

2. The Button Display Class

			Attributes:	margins
					naturalsize

3. The Check Display Class

4. The Radio Display Class

---------------------------------------------------


1. The Action Display Class


An object of the action display class is shown as a set of buttons.  Each
button can trigger some action when it is pressed -- i.e., when the left mouse
button is clicked while the pointer is on the button.  Only slotfiller
variables can be bound to this class.  The display has one button for each of
the slotfiller's symbolic indices, and these indices are used to label the
buttons by default.  The slotfiller's values do not appear in the display.

A simple example with an immediately obvious action is an object that moves
around the screen when its buttons are pressed.  First, label the buttons and
specify movements by creating the slotfiller:

     ac(`up `down `left `right;(100 0;100 0;0 100;0 100))

The numbers will be used as increments, in pixels, to the vertical and
horizontal positions.  Now, after loading the s context, use the is function

to bind ac to the action display class and then the show function to display
the object on the screen.  The is function is dyadic.  It takes the variable
name, in symbol form, as left argument, and the display class name, which is
always in symbol form, as right argument.  The show functions is monadic,
taking a variable name, in symbol form, as argument; it returns Null.  Since
is, in addition to displaying some messages, returns its left argument as an
explicit result, you can combine these two operations:

     $load s
     scrs.SCREEN-34 12
     br{w;m}:{w has (`yx;scr-m+`yxs of w);}
     show `ac is `action; br{`ac;0}

You should see an action object on the screen.  Click the left mouse button
while the pointer is on the object's "up" button.  You get a pretty animation
but no action, because no callback has been set on ac.


1a. Actions

1a(i). Callbacks; Screen Position

	Attributes:	atsector
			preset
			set
			x
			y
			yx

Suppose v is the unqualified name of a slotfiller variable bound to the action
display class and c is its context, both in symbol form.  Then whenever a
button is pressed, s makes the reassignment (pc%v)pc%v, where p is the
symbolic index corresponding to the button that was pressed.  These
assignments, since they involve the slotfiller's values, enable those values
to be used to select actions.

You write a function of the form f{s;d;i;p;c;v} that incorporates the actions
you want, and you set the callback f on cv in order to have them triggered.
In the callback, s is the static data (if any) you specified when you set the
callback and d (the data) is the value to which p is the path; you can use any
of them to determine an action.  The index i is null.

Since we will move ac around the screen as an example of the actions that can
be triggered by an object of this class, we first discuss attributes used to
position objects.

The "x" and "y" attributes specify the horizontal and vertical distances in
pixels between the top left corner of an object and the top left corner of
either the object that contains it (a layout, for example) or, for top-level
objects, the screen.  For a top-level object, the default value for each is
zero.

The of function is used to query attributes.  It takes a scalar or vector left
argument of attributes, which are always in symbol form, and a variable name,
in symbol form, as right argument.  In its result, it encloses the value for
each element of the left argument:

     `y`x of `ac

The value of the "yx" attribute is simply the vector composed of the y and x
attribute values.  The has function sets attributes.  It takes a variable
name, in symbol form, as left argument, and as right argument an association
list or slotfiller containing attribute names and values.  It returns its left
argument as explicit result.  Change x and see the new position and the new
attribute value:

     `ac has (`y;0; `x;300)
     `yx of `ac

As stated above, a value selected from ac by a button press is available to a
callback function, as its second argument.  The of function encloses attribute
values in its result, so Disclose or Raze must be used to obtain the attribute
values themselves.  Define a callback function to adjust the yx attribute by
the value selected from ac by the button press, limiting the movement so as to
stay well on any screen.  Then set the callback on ac:

     acbfn{s;d;i;p;c;v}:cv has (`yx;0600(`yx of cv)+d)
     `ac _scb (acbfn;'Just to illustrate')

Two alternative methods of setting the callback use the "set" attribute:

     `ac has (`set;acbfn)
     `ac has (`set;(acbfn;'Just to illustrate'))

If the former is used, the Null will be passed to acbfn as its first
argument; if the latter, 'Just to illustrate' will be passed.

No matter how the callback is imposed, by set or _scb, the value of the set
attribute is the name of the function and the static data (the Null, if no
static data was specified):

     `set of `ac

Having entered these statements in an A+ session, you can move the action
object around the screen, within the prescribed limits, by pressing its
buttons.  Try it.

There is a "preset" attribute that is similar to set.  It can be used to set
and query preset callbacks, functions that are called just before a value is
changed, rather than just after.  Execute

     pc{s;d;i;p;c;v}:{"Jump!";d}
     `ac has (`preset;pc)

Now move the object around the screen.  "Jump!" should appear in the session
log, showing that pc is being called.

To get rid of this preset callback, use a null function specification.  (Null
for set would likewise eliminate an ordinary callback.)  Enter

     `ac has (`preset;)

Since we have been discussing positioning, we might as well consider the
"atsector" attribute now.  It is used to move objects around the virtual
desktop and to determine where they are.  A position on the desktop is
specified by a vector of two indices.  The following three lines should move
ac to sector 1 1 and back.  (If you are already in sector 1 1, change the 1 1
to 0 0 in the second statement.).  Suppose you are in sector 1 0 (the
semicolon in the first line causes the result to be displayed -- see immediate
execution display of expression groups in the A+ Reference Manual):

     ;sector`atsector of `ac
     `ac has (`atsector;1 1)
     `ac has (`atsector;sector)

If your virtual-desktop window is visible, you can watch ac move around on it
as you change the value of the atsector attribute.

1a(ii). Other Actions

	Attributes:	f1, ..., f12
			fkeys
			selected

Whenever a button is pressed, the "selected" attribute is set to the symbolic
index corresponding to that button.  Press the "down" button; then:

     `selected of `ac

You can also set selected to any of the symbolic indices using an A+
statement.  Setting it does not cause a callback and an assignment of an
illicit value is simply ignored.  The domain of the selected attribute depends
upon the display class: for an object bound to the array class, for instance,
its value is an integer vector consisting of a row and a column index,
initially 1 1 to indicate no selection.

For any object, you can associate an action with a function key.  As an
example, define an action similar to the ones we have associated with the
buttons of ac:

     diag{x}:x has (`yx;600(|@@0)100+`yx of x)

For any one of the twelve function keys, the key can be connected with a
function and an argument by a statement such as the following, which uses an
association list to specify several attributes at once.  A slotfiller can be
used instead of an association list, as you will see later.

     `ac has (`f1;(diag;`ac);`yx;0 0)

Now press the F1 key while the mouse pointer is in the ac display and you will
see the display move diagonally, with jumps to avoid getting too far.

These twelve connections are listed in the "fkeys" attribute, which is for
reference only; it cannot be set.  Its value is a slotfiller such that the
first two of the following three expressions give the same result for each of
f1, f2, ... f12.  (Recall that we must Disclose or Raze the of result to
obtain the attribute value.)

     `f1 of `ac
     `f1`fkeys of `ac
     `fkeys of `ac

You may have to move to the Emacs A+ area to page up and see all of the result
of the last statement.  Then press End and move to the tutorial area.


1b. Appearance

1b(i). Arrangement of the Buttons

	Attributes:	geometry
			verify

The default arrangement of the buttons on the screen is vertical, but you can
use the "geometry" attribute to alter it.  Try these arrangements:

     `ac has (`geometry;2);          br{`ac;0}
     `ac has (`geometry;1);          br{`ac;0}
     `ac has (`geometry;`horizontal); br{`ac;0}
     `ac has (`geometry;`vertical);   br{`ac;0}
     `ac has (`geometry;2 2);         br{`ac;0}
     `ac has (`geometry;1 1 1 1);     br{`ac;0}
     `ac has (`geometry;2);           br{`ac;0}
     `ac has (`geometry;1 1 2);       br{`ac;0}

-2 is a conventional value for horizontal arrangement, and -1 for vertical.
Non-negative numbers indicate how many buttons there are to be in each row and
are used repeatedly if necessary.

Fancier arrangements are possible using a matrix value for geometry.  The
matrix partitions the action display.  Symbolic indices of the slotfiller
indicate the arrangement, with a null symbol signifying an empty section.
Alternatively, integers can be used: they must be indices of the symbolic
indices in the slotfiller, or -1 signifying an empty section.  The order of
the buttons need not correspond to the order in the slotfiller variable.
Omissions and repetitions are allowed, but the repetitions for any given
symbolic or numeric index must form a submatrix.  In the following examples,
commas and parentheses are used only to make the examples immediately
obvious.  The first statement avoids all overlap of vertical and
horizontal buttons, the second one omits the "right" button, and the
third one provides partial overlap:

     `ac has (`geometry;3 3(` `up `),(` `down `),(`left ` `right)); br{`ac;0}
     `ac has (`geometry;3 3(` `up `),(` `down `),(`left ` `)); br{`ac;0}
     `ac has (`geometry;3 4(1 0 0 1),(1 1 1 1),(2 2 3 3)); br{`ac;0}

The geometry attribute, like set and unlike f1, is persistent.  The  free
function takes a variable name, in symbol form, as its only argument and,
besides displaying a message, returns its argument as an explicit result:

     free `ac
     show `ac is `action; br{`ac;0}

The buttons are arranged as they were before and they still function as they
did, but if you put the pointer in the ac display and press the F1 function
key nothing happens.

You can also change the order of the buttons by respecifying the underlying
variable, unless geometry contains symbolic indices.  When you respecify the
value of a variable that is bound to a display class, you might inadvertently
try to change it to a value that is not allowed for that class.  The
assignment is refused, either tersely by the interpreter, when the "verify"
attribute is 0:

     `verify of `ac
     `ac has (`verify;0)
     ac'No good!'

or with an explanation by s, when the verify attribute is 1, the default:

     
     `ac has (`verify;1)
     ac'No good!'

(The "a action" in the response is presumably for faster execution.)  Be sure
to clear the suspension:

     

1b(ii). Size

	Attributes:	C
			R
			xs
			ys
			yxs

Corresponding to the position attributes there are size attributes: "ys" is
the vertical size of the object, in pixels, and "xs" is the horizontal size.
The value of "yxs" is the concatenation of the values of ys and xs.  Try these
statements:

     `ys`xs of `ac
     ;size`yxs of `ac
     `ac has (`yxs;2size); br{`ac;0}
     `ac has (`yxs;size);   br{`ac;0}

You may have noticed the asymmetry of the ac display, caused by the unequal
lengths of the labels.  When the "C" attribute is 1, the columns are required
to be of equal width; the default for C is 0.  Watch the display of ac become
symmetric when you change C to 1:

     `C of `ac
     `ac has (`C;1); br{`ac;0}

There is a similar attribute "R", also with default 0, that requires the rows
to be of equal height when it is 1.  Here is an example showing its use.
First, load some auxiliary variables that are in a separate file to avoid
cluttering the tutorial; they will all have the prefix ld_ so you will know
where they came from.

     _load{'/usr/local/aplus-fsf-4.22/doc/tutorials/s.tutorials/aux_vars.+'};
     a(`a`b`c`d`e`f`g`h`i`j`k`l`m;(;;;;;;;;;;;;))
     lb('Exit';'Refresh';'Corporate Axes'),ld_nlb
     `a has (`class`shelltitle`title`label;(`action;'nexus';'';lb));

Note the use of a slotfiller to specify several attributes at once.  The
shelltitle, title, and label attributes are discussed in the next section, and
class in a later section.

     g` ` `a`a `b`b ` ` ` `,(20`),5ҡ`c`d`e`f`g`h`i`j`k`l`m`
     `a has (`C;1; `geometry;9 10g; `show;1; `xs;600); br{`a;0}

The two empty rows take no space now.  Setting R to 1 provides the vertical
separation implied by the geometry:

     `a has (`R;1; `xs;600); br{`a;0}

     _ex `sector `size `lb `g, free `a

1b(iii). Displayed Characters

	Attributes:	justify
			label
			labelfont
			shelltitle
			title
			titlefont

The "A+" appearing at the top of the ac display is the default value for the
"shelltitle" attribute for a top-level object.  To change it, change the value
of the shelltitle attribute:

     `ac has (`shelltitle;'Move')

The "ac" below the shelltitle is the default value of the "title" attribute.
To change it:

     `ac has (`title;'')
     `ac has (`title;' ')
     `ac has (`title;'Direction')

Notice that an empty vector means no title area at all.

The symbolic index names appearing on the buttons are, again, the default.
They appear when the "label" attribute is null.  The label attribute governs
what is shown in the label areas.  (When there are also value areas, as in the
slot class, it has no effect on them.)  If its value is a character vector or
a single symbol, the same label appears on all buttons:

     `ac has (`label;'Push')
     `ac has (`label;'')

The buttons can be separately labeled using either a vector of symbols or a
nested vector of scalars or vectors:

     `ac has (`label;`u`d`l`r)
     `ac has (`label;('';'';'';''))

The label attribute is functional, the function being called once for each
button with the path as an argument:

     f{s;d;i;p;c;v}:p(`left`right`up`down;('l';'r';'u';'d'))
     `ac has (`label;f)

The fonts need not be the default, kaplgallant-19.  Try the "titlefont" and
"labelfont" attributes:

     `ac has (`titlefont;'times-19'); br{`ac;0}
     `ac has (`labelfont;'helvetica-boldoblique-19')

The labels are centered in both directions within the buttons, by default.
The "justify" attribute is used to modify their positions.  Essentially, its
argument is one of 'l' 'r' 't' 'b' 'lt' 'lb' 'rt' 'rb' `left `right `top
`bottom, and it is cumulative (the first statement below produces no visible
effect, since there is no extra vertical space):

     `ac has (`justify;`bottom)
     `ac has (`justify;`left)
     `justify of `ac
     `ac has (`justify;'r')
     `justify of `ac

In the character form, a period at the beginning of the argument makes it
non-cumulative:

     `ac has (`justify;'.rt')
     `justify of `ac

A .t or .b argument centers the labels horizontally, .r or .l vertically.  To
restore the positions to centered both ways, set justify to null:

     `ac has (`justify;)

1b(iv). Color

	Attributes:	bg
			fg
			labelfg
			titlefg

There are four attributes that govern the colors in the display.  The default
values are:

     `titlefg `labelfg `fg `bg of `ac

The foreground attributes, "...fg", refer to text and the "bg" to background.
In our example there is no text corresponding to the "fg" attribute.  In a
member of the array display class it would be the array values (see the Data
tutorial); in the slot class it would be the contents of the value areas; and
so on.  These attributes can be set to whatever colors you want, as in:

     `ac has (`titlefg;`blue);
     `ac has (`labelfg;`green);

Vectors of colors can also be used for the labels.  The colors are used
cyclically:

     `ac has (`labelfg;`blue`brown`green`red);
     `ac has (`labelfg;`blue `red);
     `ac has (`fg;`pink);
     `ac has (`bg;`yellow);

The default colors can be restored by giving null values:

     `ac has (`titlefg `labelfg `fg `bg;(;;;));


1c. Additional Windows

1c(i). Kinds of Windows

	Attributes: 	iconic
			ws
	Variable:	s.WS

A+ can, of course, display more than one window at a time.  Produce
three more windows, without stopping to make their buttons work.
Notice that they all appear originally in the top left corner, the
default position:

     b(`run `stop `cancel;(;;))
     c(`yes `no `more;(;;))
     d(`load `save;(;))
     show `b`c`d is `action
     br{`b;0 600}; br{`c;0 400}; br{`d;0 200}

You might want each of them to be sized according to its labels, the
default.  Suppose, however, that you want them to be all the same
size.  Enlarge the smaller ones:

     `c`d has <(`yxs;>`yxs of `b);br{`d;0 200}

Incidentally, the vertical justification that you took on faith can now be
demonstrated:

     `d has (`justify;`bottom);
     `d has (`justify;);

The new windows are popups, as can be seen by their having pins rather than
buttons at the top left.  (See the s-Context Variables tutorial for a way of
changing this default.)  It is possible to change them from popups and back
again, using the "iconic" attribute, which controls this property:

     `d has (`iconic;1);
     `d has (`iconic;0);

The s-context variable s.WS contains the name of the "screen workspace", which
is always a top-level object, not a popup.  (The significance of the screen
workspace is discussed in the next section.)  The default value of s.WS,
before any objects are shown, is the Null.  When an object is initially shown
and s.WS is null, that object becomes the screen workspace unless you prevent
it.

When an object is first shown, it is prevented from becoming the screen
workspace if the value of its "ws" attribute is 1, and not prevented if ws is
0.

If you change the value of s.WS, you name a new screen workspace and you
"demote" the old one to a popup:

     `d has (`shelltitle;`Popup);
     s.WS`d
     s.WS`ac
     `ac has (`shelltitle;`Move);

Notice that the value of the shelltitle is treated as related to the screen
workspace: when the screen workspace was changed, the ac display was given its
variable name as a shelltitle and d was given "A+", the default shelltitle,
and the reverse happened when the screen workspace was changed back.  The
shelltitles that had been set were lost in the process.

1c(ii). Visibility

	Attributes:	followers
			followertree
			hide
			icon
			icontitle
			lower
			raise
			show

The "hide" attribute for a pop-up window, when specified by any value other
than 0, removes it entirely from the screen.  The "show" attribute, when
specified by any value other than 0, restores the display of the window.  It
can also create the original display of a window sometimes, i.e., be used in
place of the show function, as we will soon see.  When queried, one of these
attributes is always 1 and the other 0, corresponding to the visibility of the
window:

     `d has (`hide;);
     `hide`show of `d
     `d has (`show;);
     `hide`show of `d

The hide attribute for a top-level window, when specified by any value other
than 0, changes it to an icon, generally at a different location.  Change d to
top-level and hide it, then change it to be non-iconic and see the icon
disappear:

     `d has (`iconic;1);
     `d has (`hide;);
     `d has (`iconic;0);
     `d has `show;

Note the last form: a value need not be given for an action attribute: the
value is assumed to be 1 or, what is equivalent, null.  Now keep an eye on all
the objects:

     `ac has `hide;
     `ac has `show;

Notice that when ac was changed to an icon, the other three windows vanished.
The reason is that they are "followers" of the screen workspace, as indicated
by the attribute of that name:

     `followers of `ac

Suppose that you use the followers attribute to make d a follower of c.  The
new arrangement is reflected in the reference-only attribute "followertree",
whose value is a recursive slotfiller.  Then when c is hidden, d will be
hidden also.  Although d is no longer a follower of ac, it will still follow
it into hiding because it is a follower of a follower of ac:

     `c has (`followers;`d);
     `followertree of `ac
     `c has `hide;
     `hide of `d
     `c has `show;
     `ac has `hide;

You can change the icon image and title, using the "icon" and "icontitle"
attributes.  The value for the icon attribute must be an m by n bit matrix,
with m and n each at most 64:

     `ac has (`icontitle;'Buttons');
     `ac has (`icon;64 641 0 0 0 0);
     `ac has `show;

The other way to change visibility is to put one window in front or in back of
another, i.e., have one window obscure another.  To put one in front, set its
"raise" attribute to anything; to put it in back, set its "lower" attribute to
anything.  Note that lowering a window places it in back of everything,
including the emacs session window, and that the followers attribute is for
hiding, not lowering or freeing:

     `d has (`lower;);
     `d has `raise;
     `ac has `lower;
     `ac has (`raise;0);
     `raise of `ac

Unlike hide and show, raise and lower are pure action attributes: even setting
them to 0 causes their normal actions, and no value can be shown for them; the
of function disavows them.  Now make d a follower of ac again:

     `d has (`leader;`ac);

1c(iii). Selection

	Mouse Pointer
	Keys:		Arrows
			Ctl-Shift-Tab
			Ctl-Tab
			Enter
		       	Shift-Tab
			Tab

You have already seen that when the f1 attribute is given a non-null value for
some object, the mouse pointer must be in the object's window in order for the
F1 function key to trigger the specified action.  This property of the keys'
applying to a particular window is called "keyboard focus".  It is signalled
by a brightening of the window's border.  You can give keyboard focus to any
window that is at least partially visible just by moving the pointer into any
visible part of it.

When one s window has focus, you can move the focus to another by pressing
Control-Tab or Control-Shift-Tab.  Move the mouse pointer into one of the s
windows and press Control-Tab four times.  You will see keyboard focus and the
pointer move from one window to another.  Press Control-Shift-Tab and you will
see the keyboard focus traverse the windows in the opposite order.

Within a window, you can move the selection from one field to another by
pressing Tab or, to go in the opposite order, Shift-Tab.  Move the pointer to
the ac window and press Tab four times and then Shift-Tab four times.  The
visible sign of selection is a gold border around the selected button.

One significance of selection is that you can press the selected button by
pressing the Enter key.  (Because the buttons move the ac window, you may have
to move the pointer to maintain focus after pressing Enter.)  Now move the
pointer onto a button of another object, press and hold the left mouse button,
then release it and press and hold the Enter key.  Do you see a significant
difference between the two ways of pressing the displayed button?

When you use the left mouse button, the displayed button stays depressed for
as long as you hold the mouse button down: the displayed button acts as if it
were the mouse button.  When you press and hold Enter, however, the usual
typamatic action takes place: the displayed button is pressed and released
once, and then, after a slight pause, it is rapidly pressed repeatedly until
the Enter key is released.

Moving selection within a row or column can also be done with the arrow keys.
Movement appropriate to the key occurs in a cyclic fashion.  Try the up and
down arrow keys in the various windows after selecting a button.  Notice that
two buttons are isolated from the other two in ac as far as these arrow keys
are concerned.  Then try the left and right arrow keys in the various buttons
of ac.


1d. More about Appearance

1d(i). Changes in Appearance

	Attributes:	hl
			hlthickness
			shadowthickness

Three appearance attributes are related to selection and pressing of buttons.
The "hs" attribute controls the color of the selection border; its default
value is gold.  Execute

     `d has (`hl;`mediumseagreen)

and move the pointer to give focus to d, so that you can see the green border.

The "hlthickness" attribute controls the width of the border; its default
value is 0, which means the thinnest.  Execute

     `c has (`hlthickness;5); br{`c;0 400}

and see how the object is enlarged, to allow for the wider border.  Now give
focus to c, so that you can see this border.

When an action is taken to press a displayed button, the button appears to be
physically pressed.  The button is darkened; its bottom and right edges are
highlighted, instead of its top and left; and its top and left edges are
shadowed, instead of its bottom and right.  Thickening the edges of the
buttons increases their apparent height and emphasizes this apparent action.
The thickness is controlled by the value of the "shadowthickness" attribute,
which has a default value of 2.  Execute

     `b has (`shadowthickness;6); br{`b;0 600}

and see how the object is enlarged, to allow for the thicker edges.  Now press
one of b's buttons, and notice how the shadow is switched.

When an object is placed in a container, giving it a shadowthickness of zero
is sometimes useful, so that its buttons do not seem separate from other
objects in the container:

     `b has (`shadowthickness;0)

1d(ii). Other Features

	Attributes:	exit
		       	foot
			head
			is
			leftfoot
			pin
                        resizeable
			rightfoot

In popups, the pin can be used for communication between the viewer and the
programmer.  For example, the viewer can push the pin in to say that he wants
to have the window remain visible or pull it out to indicate that he would
like to have the window removed.  Likewise, the programmer can show the pin in
or out to state his intentions.  The viewer changes the pin position by
clicking on it with the left mouse button.  In an A+ statement, the "pin"
attribute is used to set the position.  This attribute always reflects the pin
position, 1 for in and 0 for out.  Try this sequence:

     `pin of `b`c
     `b has (`pin;1)

Place the mouse pointer on the pin of c and press and release the left mouse
button.

     `pin of `b`c
     `b has (`pin;0)

Click on the pin of c again.  The c window vanished, didn't it?  The "exit"
attribute determines what happens when a viewer attempts to remove an object
from the screen.  Its default value is 1, which means hide the object.  By
changing this value to 0, say, you can have nothing happen when the pin is
pulled:

     `d has (`exit;0)
     `d has (`pin;1)

Now click on the pin of d.  The pin moves, but nothing else happens.  You can
push and pull the pin as much as you like and nothing happens.

Exit is functional: its value can be a function.  It can be set for top-level
windows as well as popups.  For example:

     no{x}:"Don't do that to the ",x," window,",sys.getusername{},"!"
     `b has (`exit;(no;`title of `b))
     `ac has (`exit;(no;`title of `ac))

Now push and pull the pin of b.  Place the tip of the mouse pointer in the
window-manager button of the ac window, press and hold the right mouse button,
move the pointer down to "Quit", and release the button.  In both instances,
the no function is called and the usual behavior does not occur, an admonition
appearing instead.  If, however, you click on the window-manager button of the
ac window or choose "Close" from its menu, the window will be hidden; then
double-clicking on its icon will bring it back.

Three otherwise unrelated attributes pass along window-manager facilities, and
cannot be changed for a window after it has been shown.  They are "head",
"foot", and "resizeable".  None applies to objects that are not top-level or
popups, since they relate to window-manager features.  The head attribute
determines whether a window has a window-manager area at the top; since that
area is not removable for top-level objects, head applies only to popups.  The
foot attribute determines whether there is an area at the bottom for
footnotes.  The resizeable attribute determines whether the window has resize
corners; that is, whether a viewer can resize the window by dragging.

These attributes are set between binding and mapping, so this is a good time
to mention the "is" attribute.  It can contain a function (and, optionally, an
argument) that is called immediately after the variable is bound.  Its default
is null.

     ed
     f{x}:(x),' is bound to ',,`class of x
     `e has (`is;(f;`e))
     `e is `action
     `e has (`resizeable `head `foot;(0;0;1))   
     show `e; br{`e;0 200}

Note that the e display has no panel at the top, so no pin or shelltitle
appears; it has a panel at the bottom that becomes lighter when the window has
focus (and that can be used for moving with the mouse); and it should have no
resize corners -- although it probably does have them, because of a window
manager bug, an interaction between resizeable and head that causes only the
one that is set later to be obeyed when they are both set to 0.

Two footnotes can appear; they are the values of the "leftfoot" and
"rightfoot" attributes.  Space is not made for them automatically, and they
are truncated if there is not enough room:

     `e has (`leftfoot;'Morgan Stanley')
     `e has (`xs;150)
     `e has (`rightfoot;'March 1994')
     `e has (`xs;250)


1e. Status and its Preservation

1e(i). Status

	Attributes:	bound
			class
			stateself
			settings

There are attributes which give you information about objects.  Some, like the
"bound" and "class" attributes, apply meaningfully to objects that are not
bound.  The class attribute for an unbound variable, for instance, is its
default display class.  You cannot set bound directly; it is a reference-only
attribute.

     prometheus'fire'
     `bound of `e `prometheus
     `class of `e `prometheus
     `prometheus has (`class;`command)
     `bound`class of `prometheus

The bound attribute is set to 1 by the is and show functions and by a non-null
specification of the class attribute; it is set to 0 by the free function and
null specification of class.  The class attribute is set by the is function to
its right argument; it is set to a default class by the free function, in
effect, and, if bound was 0, by show.

The "settings" attribute, which is for reference only, can be used to obtain a
slotfiller holding, generally speaking, the attributes that have non-default
values (except the class attribute) and the values of those attributes.

     `settings of `e

The xs attribute was not included, because its value was not known to be
non-default.  The attributes can be restricted or extended to certain ones by
naming them.  The statement above is equivalent to (`settings;) of `e.

     (`settings;`leftfoot `xs `title) of `e

The title attribute is omitted, because its value is the default.  Since a
specific request was made for xs and its value is not known to be the default,
it is included.

The "stateself" attribute, which is also for reference only, gives the same
information as `settings of, plus the value of the class attribute.  The value
of stateself will create the object when executed in the presence of the
underlying variable with a suitable value.  It is an s definition of the
object in association-list form:

     `stateself of `e

1e(ii). Saving

	Attribute:	script
	Variable:	s.WM_SAVE_YOURSELF
	Function:	s.script{}

The s.WM_SAVE_YOURSELF variable can hold the name of a function and,
optionally, an argument.  Its default value is null.  When "Save Workspace" or
"owplaces" is selected from the OLVWM Utilities Menu, the function named in
s.WM_SAVE_YOURSELF, if any, is called, allowing any vital information to be
saved or necessary actions to be taken.

The s-context niladic function s.script produces a script that will recreate
the current screen layout, given the presence of the necessary variables with
appropriate values.  There may be no need to preserve information about some
of the objects.  The default value of 1 for the "script" attribute dictates
that the s definition of the object appear in that script and a value of 0
dictates that it not appear.  Try, for example,

     `d has (`script;0)
     s.script{}

Now clean up for the next display class:

     _ex `acbfn `pc `diag `f `no, free `ac `b `c `d `e `prometheus



2. The Button Display Class

	Attributes:	margin
			naturalsize


An object of the button class looks rather like an object of the action class
with only one button and no title area.  The variable that is bound to it does
not contain symbolic indices and values, however, but rather a function array
and perhaps data.  The function must be monadic or niladic.

Specifically, let fn be a monadic function and define b as (fn;data).  Then b
can be bound to the button class, and whenever the button is pressed, fn{data}
will be executed.  A second form for defining a button is <{fn}, which is
equivalent to (fn;) for monadic functions; when the button is pressed, the
expression fn{()} or, for a niladic function, fn{} is executed.

Notice that for the button class no callback need be set; the function that is
bound is called automatically.

As an example, define a button that, when pressed, moves across the screen and
jumps back, but don't press it until after you have made the comparison set up
below:

     bf{v}:v has (`x;600|100+`x of v)
     bu(bf;`bu)
     show `bu is `button; br{`bu;0}

Just for a comparison of their appearances:

     ac(,`bu;,<1)
     `ac has (`class;`action; `title;''; `show;1); br{`ac;0 50}

     _ex free `ac

Now you can press the button.

There is no title area like the one an action object can have; the title
attribute applies to the text on the button (unlike for an action object,
which employs the label attribute for text on its buttons).  When there are no
blanks or other impermissible characters in it, a title or label can be given
as a symbol, instead of a character string.  The object is not automatically
resized for a new title:

     `bu has (`title;`Move)

The "naturalsize" attribute is an action attribute; it cannot be queried.  It
resizes an object to show it afresh, as if it, with its current text, values,
and features, were being initially displayed --

     `bu has (`naturalsize;); br{`bu;0}

-- except that in an array or matrix or suchlike the same rows and columns
might not be shown as originally, as demonstrated in the discussion of
naturalsize in the array section of the Data tutorial.

The "margin" attribute governs the minimum margin around the title on the
button; its default value is 2.  It does not affect the button size:

     `margin of `bu
     `bu has (`margin;10);
     `bu has `naturalsize; br{`bu;0}
     `bu has (`margin;200);
     `bu has `naturalsize; br{`bu;0}
     `bu has (`margin;2);
     `bu has `naturalsize; br{`bu;0}

The margin attribute also applies to the margin around the text in an object
of the label class.

     _ex free `bu



3. The Check Display Class


An object of the check class is a slotfiller variable with boolean values that
are represented by buttons.  A button is "on" if the corresponding value is 1
and "off" if it is 0.  When a button is on it has a sunken appearance and is
the color specified by the fg attribute, and when off it has a raised
appearance and is the color specified by the bg attribute.

Clicking the left mouse button on a check button toggles it between on and
off, and at the same time the corresponding value in the A+ variable is
toggled between 1 and 0.  Therefore, if a callback function is defined for the
slotfiller variable, mouse clicks cause the callback function to be executed,
the path argument p being the symbolic index of the changed value.

The slot areas that appear in the display and their arrangement can be
controlled by the setting of the geometry attribute.

This first example is a two-button moving display, in which pressing a button
moves the display to the position indicated by its buttons:

     c(`bottom`right;(0;1))
     `c is `check
     cbf{}:`c has (`yx;5001c)
     `c has (`show;1;`set;cbf;`yx;0 500)
     `c has (`fg;`mediumseagreen;`bg;`rosybrown)

Try the various button combinations.

In the second example, we show one way to set up a check display to allow one
or more categories of data to be selected.  Actually, the function we define
here for the button just lists the selected categories in the session log when
it is pressed:

     ck(`cb`ci`co`ib`i`s`sb`wb`w;(0;0;0;0;0;0;0;0;0))
     lb(`cmo_bid;`cmo_inventory;`cmo_oddlot),ld_clb
     ckfn{}:>(1ck)/`label of `ck
     `ck has (`class;`check; `set;ckfn; `geometry;9);
     `ck has (`shelltitle;`CMOView; `title;'CMO Inventory Viewer');
     `ck has (`labelfont`titlefont;2<'newcenturyschlbk-roman-16');
     `ck has (`label;lb; `show;1; `xs;1140); br{`ck;0}

Press some category buttons, adding to and deleting from the set of requests.
Observe the list that appears in the A+ session log each time.

     _ex `lb `cbf `ckfn `bf, free `c `ck



4. The Radio Display Class


The radio class is like the check class, except that
(1) it has the additional stipulation that one and only one of the values of 
the boolean-valued slotfiller is 1, 
(2) its buttons are diamond-shaped, and 
(3) pressing a button that is off turns it on and causes the button that had 
been on to be turned off (pressing a button that is on has no effect).

When a button that is off is pressed, the value of the underlying variable is
changed accordingly.  Therefore, if a callback function is defined for that
variable, it is called, the path argument p being equal to the symbolic index
of the selected button.  Note that even though there are two value changes, a
callback function associated with the variable of a radio button is called
only once, and the path argument of the callback function refers to the value
that changed from 0 to 1.

The slot areas that appear in the display and their arrangement can be
controlled by the setting of the geometry attribute.

In our first example, we make the usual moving buttons.  Execute the following
statements and press various buttons:

     r(`tl`t`tr`l``r`bl`b`br;(1;0;0;0;0;0;0;0;0))
     cbf{}:`r has (`yx;0 250 500[3 3(1r)1])
     `r has (`class;`radio; `set;cbf; `geometry;3 3 3; `show;1);

In more realistic examples, the radio object might offer a choice among four
differently formatted security definition tables and also function as a
heading for that table, or it might present a choice of security types for
listing portfolio holdings.  In our examples, the callback function merely
gives (in the session log) a waiter's response:

     _ex free `r
     rd(`ms`ba`na`bl;(0;1;0;0))
     `rd has (`class;`radio; `geometry;2; `shelltitle;'MBS'; `title;'');
     `rd has (`label;('BASIC MBS/STRIP';'BASIC ARM'),ld_rlb);
     cbf{s;d;i;p;c;v}:(>(`label of `rd)[(0rd)p]),'. Good choice.'
     show `rd has (`set;cbf); br{`rd;0}

Now the second example:
     
     `rd has (`hide;1;`shelltitle;`PH;`fg;`white;`labelfg;`white;`bg;`black);
     `rd has (`label;('Corporate';'Municipal'),ld_r1lb);
     show `rd  rd(`co`mu`mo`cm`us`ab;(1;0;0;0;0;0)); br{`rd;0}

Notice that you can click on the label or the diamond to press the button.

     _ex `cbf, free `rd
@ 1.1 log @Initial revision @ text @d438 1 a438 1 _load{'/usr/local/aplus-fsf-4.18/doc/tutorials/s.tutorials/aux_vars.+'}; @ aplus-fsf-4.22/src/html/tutorials/s.tutorials/RCS/containers.html,v0000444000265000001440000013133010774505731021022 head 1.2; access; symbols; locks; strict; comment @# @; 1.2 date 2008.04.01.19.24.06; author jmiz; state Exp; branches; next 1.1; 1.1 date 2008.04.01.19.22.37; author jmiz; state Exp; branches; next ; desc @@ 1.2 log @*** empty log message *** @ text @  
                         The Container Display Classes
                         

1. General

2. The Window Display Class

3. The Table Display Class

	3a. The Headings for the Fields

			Attribute:	titledefine

	3b. Interactions between Settings for Fields and Table

			Attributes:	font
					protected

	3c. Controlling What is Shown

			Attributes:	fields
					firstfield
					fixedfields

	3d. User Interactions

			Attributes:	field
					selectedfield
					selectfield

	3e. A Case when Refresh is Needed

4. The Graph Display Class

5. The Layout Display Class

	5a. Relations among Objects

			Attributes:	ancestors
					children
					descendents
					familytree
					leader
					parent
					shell
					state

	5b. Binding and Showing of Objects

			Attributes:	mapped
					newshow
					reparent
					reshow

	5c. Arrangement of the Children

			Attributes:	at
					build
					lockposition
					position
					structure
					vcol
					vcols
					vrow
					vrows
					X
					Y
					YX

	5d. Size of the Children

			Attributes:	b
					h
					H
					l
					locksize
					r
					resize
					t
					w
					W

	5e. Navigation and Interaction

			Attributes:	acceptfocus
					focus
					freeze
					sensitive
					tabfrom
					tablist
					tabto

6. The Hpane and Vpane Display Classes

---------------------------------------------------


1. General


As the name implies, objects of a container display class are used to contain
other objects, either to group several of them or to provide features that are
not available in the contained object's class.  The objects that are contained
in a container are called its children.

For a variable to be bound to a container class, its value must be an array of
symbols and each symbol must be either the symbolic form of the name of a
variable or null.


2. The Window Display Class


A window contains only one object.  The value of a variable that is bound to
the window class is the name of a single variable, in symbolic form.  An
object in a window can be of any display class.

Placing an object in a window has the effect of putting scrollbars on the
display of that object.  You should be sure that you really need at least one
scrollbar, because they always appear.  If the object is completely shown or
has its own scrollbars, the window's scrollbars are inoperative; try them
after these statements:

     $load s
     scrs.SCREEN-34 12
     br{w;m}:{w has (`yx;scr-m+`yxs of w);}
     a12 2
     w1`a1
     show `w1 is `window  show `a1; br{`w1;0}

Try the various scrollbars after each of these statements:

     a150 2
     a1a250 50

It makes no difference whether the scrollbars are needed at the time the
window is mapped:

     w2`a2
     show `w2 is `window; br{`w2;0}

The window display class is useful in displaying large objects belonging to
the non-container classes that never have scrollbars, namely, action, check,
label, page, radio, and slot -- and, of no interest in this regard, button.
Here is an artificial example, for the most likely class, slot:

     s(,`char97+(426)773500;`xs of `s; `shelltitle;'window');
      br{`w3;0}; free`w1`w2;}

Having the horizontal scroll bar, one might be inclined to make it useful:

     `s has (`geometry;10; `title;'slot');

Can you find the title?  The title appears at the middle of the top of the
slot and is scrolled with the rest of the slot.  Contrast its immobility when
both the title and the scrollbars are part of the same object.  Notice that
the shelltitle comes from the window object and the title from the slot.  A
title is never displayed for an object of the window display class, nor,
naturally, a shelltitle for an object contained in any container class.

     _ex `a1`a2`w1`w2, free `w3`s;


3. The Table Display Class


A table is different from other containers, in that all the objects contained
in it (its children) are of the tableField class; they are called fields of
the table.  The fields of the table can be vectors or simple character
matrices.  An object can be bound to the tableField class only by A+ and only
as a child of a table object.  The children of a table object, like all
objects shown on the screen, must be unique.

The display of a table consists of a title area and a value area.  The value
area has a title bar on top that holds the names of the fields, and the area
below the field titles consists of delineated cells, one column for each
field.  The fields appear on the screen in the same left-to-right order as
their symbols appear in the variable that is bound to the table class.  The
number of elements in the first field completely controls the rows that can be
displayed.  Examine the following example:

     var_010 4'blah'
     var_11+10
     var_2150+.01?10100000
     var_3:var_2var_1
     tb`var_0 `var_1 `var_2 `var_3
     `tb is `table;
     `tb has (`shelltitle;'shelltitle'; `title;'title'; `cols;4);
     `var_2 `var_3 has <(`out;7.2);
     show `tb; br{`tb;0}


3a. The Headings for the Fields

	Attribute:	titledefine

The title bar text for a field can be changed by using the field's title
attribute.  For a dependency, there is another alternative.  The "titledefine"
attribute provides a means of displaying the definition, rather than the name,
of the dependency.  Its effect becomes visible only when the title attribute
is set to null.  To see the immediate effect of titledefine, watch the fourth
field.  Because the last column is too wide to be shown in its entirety and s
doesn't like to display partial columns, the fourth column gets blanked out.
(Under some circumstances you can see a truncated definition.)  We force a
redrawing after setting titledefine and title:

     `var_0 has (`title;'Text');
     `var_3 has (`titledefine;1; `title;);
     `tb has (`firstcol;0; `cols;4); br{`tb;0}

The next two statements demonstrate that titledefine does not set the title,
but rather that it is consulted when the title is set to null:

     `var_3 has (`titledefine;0);
     `var_3 has (`title;);
     `var_0 has (`title;);


3b. Interactions between Settings for Fields and Table

	Attributes:	font
			protected

The "font" attribute specifies the font in which the value area appears.  In
the table display class, it can be set for both the fields and the entire
table.  The setting for the table applies to any fields for which font has not
been explicitly set.

Notice two things in the following statements.  First, when the font is
changed for the first field, the space allotted to the field is narrowed,
resulting in the truncation of the title; watch out for this if you change a
font after showing a table.  Second, the font for the table does not affect
the first field, whose font has already been specified.

     `var_0 has (`font;'courier-bold-19');
     `tb has (`font;'palatino-19');
     `tb has (`firstcol;0; `cols;4;); br{`tb;0}

The font attribute is functional.  Set it for the third field, overriding the
table setting but leaving the other fields alone (you will probably need to
scroll down to see a negative value in boldface):

     f{s;d;i;p;c;v}:if (d<0) 'helvetica-bold-19' else 'helvetica-19'
     `var_2 has (`font;f);

Try to trim the column widths:

     `var_0`var_1`var_2`var_3 has <(`space;12);
     `var_0`var_1`var_2`var_3 has <(`font;`kaplgallant; `space;12);
     `tb has `naturalsize; br{`tb;0}

Because the characters are not of fixed width, the results of the space
specifications were not what we wanted; after the font change, space was set
as intended, and the table could be trimmed to fit.

The "protected" attribute tells whether protection is on; it is for reference
only.  It is useful because protect for a table overrides protect for its
fields:

     `var_1 has (`protect;1);
     `protected of `var_1 `var_2
<  1
<  0
     `tb has (`protect;1);
     `protected of `var_2
 1
     `var_1 has (`protect;0);
     `protected of `var_1
 1


3c. Controlling What is Shown

	Attributes:	fields
			firstfield
			fixedfields

One important feature of tables is the ability to retain certain fields in
view while scrolling among others.  In a table of bond information, for
instance, you might want to have issuer, coupon, and maturity always shown, no
matter what other fields were or were not visible.  The value of the
"fixedfields" attribute is the number of fields on the left that do not
participate in horizontal scrolling:

     `tb has (`fixedfields;1);
     `tb has (`cols;2; `firstfield;`var_2);

Notice the gap; the second field is not shown.  Try some horizontal scrolling.

The "fields" attribute always has the same value as the cols attribute:
setting one for a table sets the other:

     `fields of `tb
     `tb has (`fields;3);
     `cols of `tb

The firstcol attribute is affected by fixedfields for tables.  It is the first
visible field on the left disregarding the fixed fields.  The "firstfield"
attribute differs in taking the name of a field, in symbol form, rather than a
number, but is otherwise the same as firstcol, and setting one for a table
sets the other:

     `firstfield `firstcol of `tb
     `tb has (`fixedfields;0; `fields;2; `firstfield;`var_1);
     `firstcol of `tb
     `tb has (`firstcol;0);
     `firstfield of `tb


3d. User Interactions
	Attributes:	field
			selectedfield
			selectfield

In addition to selecting a cell by clicking the left mouse button with the
pointer in it, you can select a column by clicking the button with the pointer
on a title.  When a field title is selected, the selected cell is at the
intersection of that field and the currently selected row; if no row is
currently selected, the first row (row 0) is used.  The value of the
"selectedfield" attribute is the identity of the selected cell, as row index
and, in symbolic form, field name.  This attribute identifies the same cell as
does the selected attribute, whose value is its row and column indices.
Similarly, the "field" attribute gives the (symbolic) field name of the
selected column, which is always the same column that is identified by index
number in the col attribute and that is referred to in the selectedfield and
selected attributes.

Make some selections by clicking on the titles and in the cells, executing the
following statement after each selection:

     `field `selectedfield of `tb

A callback is associated with selection of a field, and a function is
specified for it using the "selectfield" attribute.  Here we use a function
that just shows its arguments and the value of the selectedfield attribute:

     cb{s;c;v}:(s;c;v;`selectedfield of `tb)
     `tb has (`selectfield;(cb;'field selection'));

Select a field or two and see the arguments and the value of selectedfield.
Also select a cell or two directly and see that this function is not called.


3e. A Case when Refresh is Needed

The "refresh" attribute was introduced in the array section of the data
display tutorial.  Here is another example of its use.  To minimize backing
store space requirements, when a substantial amount of data is only
potentially displayed it is not always calculated in advance.  If its display
is requested through the window manager and not A+, it may be necessary to
request that A+ refresh the object:

     albl1000+100; tl`al`bl;
     show `tl is `table;
     `tl has (`ys;1750;`x;scr[1]-`xs of `tl);

Now use the scrollbar to drag the later part of the table into view. It should
be blank.  Specifying refresh causes the numbers to be calculated and shown:

     `tl has `refresh;

     _ex `cb`f,  free `tb`var_0`var_1`var_2`var_3`tl`al`bl;


4. The Graph Display Class


The graph display class resembles the table class in that its children are all
of one class, graphTrace, and only A+ can bind a variable to that class.
Because of its complexity, it is treated in a separate tutorial.

As an aside, we might mention that because all the graph features are
optional, it is possible to produce pictures using an object of the graph
class, as in this simple example:

     j100+200
     t1j(,@@0)100
     t2j(,@@0)975+(1000000-j*2)*.5
     t31 220 75
     g`t1`t2`t3
     `g is `graph;
     `g has (`title `legend `axis `zero;('';`none;`none;`none));
     `g has (`xmin;100;`xmax;100; `ymin;0;`ymax;100);
     `t1 `t2 has <(`style;`area);
     `t3 has (`style;`scatter; `symbol;`circlefilled; `symbolsize;50);
     `t1 has (`linecolor `fillcolor; 2<`cyan2);
     `t2 has (`linecolor `fillcolor; 2<`cornflowerblue);
     `t3 has (`linecolor `fillcolor; 2<`yellow);
     show `g; br{`g;0}

The area style fills in down to the axis.  Only the order of drawing prevented
the cyan from obliterating the blue.  The fill style allows fuller control of
the area covered, as in this example of three rectangular planes:

     p14 2 90 10  90 70  0 70  0 10
     p3(4 230 10)+ p2(4 230 10)+p1
     g`p1`p2`p3;  free `t1`t2`t3;
     `p1`p2`p3 has <(`style;`fill);

Reversing the order of the symbols in the definition of g reverses the order
of drawing and thereby the obscuration and apparent depth of the planes:

     g`p3 `p2 `p1;

     _ex `j`t1`t2`t3, free `g`p1`p2`p3;


5. The Layout Display Class


A layout is a container whose children can be of any classes.  Almost all of
what is said in this section applies also to the hpane and vpane classes,
which are essentially just layouts with slider bars.

When a child is placed in a layout, the context of its name is assumed to be
that of the layout's.  There is no need to qualify the child's name unless its
context differs from the layout's.


5a. Relations among Objects

	Attributes:	ancestors
			children
			descendents
			familytree
			leader
			parent
			shell
			state

The first seven attributes listed above give information about containment and
subordination of objects.  All but two are for reference only.  Knowing that
an object is called the child of its container, you can guess the meanings of
most of these attributes.  Here is a simple example illustrating their use:

     abcden3
     show `a; br{`a;0 200}
     l1`b`c; l2`d`e; l`l1`l2;
     `l`l1`l2 is `layout;
     show `l; br{`l;0}
     `children of `l
     `children of `l2

The "children" attribute is actually not just for reference:

     `l has (`children;`l1`l2`n);
     `children of `l
     l

So the children attribute of l changed value and, as had better be the case,
the value of l changed.  The display, however, did not change.  When an object
that is not being shown is added to an existing layout, the default is not to
show it there automatically.  One way to make it appear is to apply the show
function to it, before or after it is added to the layout (you will see several
other ways later on):

     show `n; br{`l;0}
     `descendents of `l
     `parent of `d
     `ancestors of `d

The "familytree" attribute applies only to containers, since it shows only the
object's descendents and not its ancestors:

     `familytree of `l
     `familytree of `l2
     `familytree of `d

The "shell" attribute contains the name of the top-level object that contains
the object in question.  The "leader" attribute, for top-level objects only,
tells what object will be followed into hiding; its default value is the
screen workspace.  A top-level object can be made its own leader; the
canonical value for the leader attribute in this situation is the Null:

     `shell of `d
     `leader of `l
     `l has (`leader;`l)
     `leader of `l

You have already seen the stateself attribute, in the Buttons tutorial.  The
"state" attribute is similar to it, but recursive.  That is, for a container
the stateself attribute gives only the definition of the container itself,
whereas the state attribute includes the value of the state attribute for each
child.  When a child appears in a layout definition more than once (to
establish the desired geometry), the state for it is given only once, for
economy.  For tableFields and graphTraces, the class does not appear in the
result, to keep it executable.

     `stateself of `l
     `state of `l
     _ex free `l`l1`l2`a`b`c`d`e`n;


5b. Binding and Showing of Objects

	Attributes:	mapped
			newshow
			reparent
			reshow

When a layout is first shown, all its children are shown.  When children are
added to it, however, they are not automatically shown in it unless they were
already shown somewhere.  A simple example:

     a'original'; b'show fn'; c'show attribute'; d'mapped'; e'newshow';
     `a`b`c`d`e is `label;
     show `b;
     l`a; show `l is `layout; br{`l;96 72}
     l`a`b`c`d

Although l has four children, only two are shown: a because it was a child
when the layout was first shown and b because it was already shown when it was
added to the layout.  If you set the show attribute of a child to 1, it will
be shown:

     `c has (`show;1);

In fact, it is enough to set the "mapped" attribute to 1:

     `d has (`mapped;1);

Setting the mapped attribute for a top-level object to 0 when it is shown
(unmapping it) has the effect of making its contents blank.This effect can be
useful when you are making several changes in a layout and do not want the
flashing that would otherwise occur:

     `c has (`mapped;0);
     `l has (`mapped;0);
     `c has (`mapped;1);
     `l has (`mapped;1);

When the "newshow" attribute is 1 for a layout, any child that is added to
that layout is shown:

     `newshow of `l
<  0
     `l has (`newshow;1;);
     l`a`b`c`d `e

Similarly, you can control what happens when a child is removed from a parent
(orphaned).  By default, the child becomes a top-level object (it is made its
own parent) and it is shown independently.  If, however, you set the "reshow"
attribute to 0, then an orphaned object still becomes top-level but is not
shown.  Furthermore, if you set the "reparent" attribute to 0, it is not made
its own parent but rather is freed, and of course is therefore not shown:

     `reshow `reparent of `l
 1 1
     l`a`b`c`d
     .e: variable reparented to popup window
     `l has (`reshow;0);
     l`a`b`c
     .d: variable reparented to popup window
     `show of `d
<  0
     `l has (`reparent;0);
     l`a`b
     .c: freed

     _ex `c, free `l`b`c`d`e;


5c. Arrangement of the Children

	Attributes:	at
			build
			lockposition
			position
			structure
			vcol
			vcols
			vrow
			vrows
			X
			Y
			YX

Starting with a null layout allows you to set attributes:

     a1a2a3a4a5a6a7a8a9a1010 12
     l()
     `l has (`class;`layout);

When a variable is to be bound to the layout class, the arrangement of the
symbols in it usually determines the geometry of the display.  (Compare the
geometry attribute, with symbolic indices, for an action display.)  A+
arranges the display when the variable is a vector:

     l`a1`a2`a3`a4`a5`a6
     show `l; br{`l;0}; `l has (`y;0);

Each item of a nested vector is taken to represent a row:

     l(`a1`a2`a3; `a4`a5`a6); br{`l;0}
     l(`a1; `a2`a3; `a4`a5`a6); br{`l;0}

As you are probably about to see (or saw), the history of a layout affects its
display when its geometry is changed.  Setting naturalsize provides the
arrangement that would appear if the layout were new:

     l(`a1`a2`a3; `a4`a5`a6)
     l(`a1; `a2`a3; `a4`a5`a6)
     `l has `naturalsize;

A matrix form for the layout variable establishes the virtual rows and columns
of the display, with the empty symbol is used to indicate a blank area.  You
will notice a lot of drawing, giving a jumpy effect; this could be avoided by
hiding or unmapping the object, making the changes, and then showing the
variable again:

     l3 2`a1`a2 `a3`a4 `a5`a6; `l has `naturalsize; br{`l;0}
     l4 3`a1`a1`a2 `a1`a1`a3 ``a4` `a5``a6; `l has `naturalsize; br{`l;0}
     {l4 5`a1`a1`a2`a2`a2 `a1`a1`a3`a3`a3 ``a4`a4`a4` `a5`a5``a6`a6;
      `l has `naturalsize; br{`l;0}}

The layout variable can be a matrix of matrices, each submatrix indicating the
arrangement within its area of the matrix:

     {`l has (`newshow;1);
      l2 2(2 1`a1`a2;1 2`a3`a4;;4 1`a5`a6`a7`a8);
      `l has (`ys;800); br{`l;0}}
     l[1;0]<1 2`a9 `a10; br{`l;0}

     free `l;

The "build" attribute for a layout allows you to arrange objects on the screen
and have the relative arrangement of those objects maintained in the layout
display.  You could get the size and position you wanted for the objects by
dragging them, but we will set their yx and yxs attributes instead in this
simple example:

     show `a1; `a1 has (`yx;350 300);
     show `a2; `a2 has (`yx;350 550);
     show `a3; `a3 has (`yx;580 300; `yxs;170 440);
     show `a4; `a4 has (`yx;350 770;`yxs;390 200);
     l(); `l is `layout; `build of `l
     `l has (`build;1);
     l`a1`a2`a3`a4; show `l;
     br{`l;0}

It would clearly be simpler to use a non-vector value for l to obtain this
particular layout, but in complicated cases build might provide the easiest
means of specification, or you might want to let a viewer decide the
arrangement.

Implied in all of these methods and explicit in the method we are about to
explore is the idea of virtual rows and columns, whose edges are established
by edges of the children and which may be spanned by children.

The "at" attribute is a four-element integer vector representing the position
and extent of an object in a layout in terms of these divisions:
    (starting virtual row, starting virtual column,
     number of virtual rows spanned, number of virtual columns spanned).
Conceptually, a layout can be placed over an imaginary grid so that the border
of each object in the layout lies on grid lines.  The position and size of
each object can then be described by the row index and column index of the
grid block containing the upper left corner of the object, and the number of
grid rows and columns that the object overlaps.  If the grid is the minimal
one, i.e., the one with the fewest possible grid lines, then these four
numbers are the value of the at attribute.  The origin for the grid
coordinates is the upper left corner of the layout.

The complexity of building a layout from screen positions may lead to
unexpected at values, but when the layout is specified by, say, a matrix
value, then at is what you would expect:

     >`at of `a1`a2`a3`a4
  0  0  7  8
  0 10  7  8
  9  0  7 18
  0 19 16  8
     l2 3 `a1`a2`a4 `a3`a3`a4
     >`at of `a1`a2`a3`a4
 0 0 1 1
 0 1 1 1
 1 0 1 2
 0 2 2 1

The "structure" attribute of a layout, which is for reference only, gives you
a slotfiller containing the values of at for all of its children:

     `structure of `l
< <  `.a1 `.a2 `.a4 `.a3
  < <  0 0 1 1
    <  0 1 1 1
    <  0 2 2 1
    <  1 0 1 2

The four elements of the at attribute value are synonymous with the attributes
"vrow", "vcol", "vrows", and "vcols"; they can be set individually to
rearrange a layout, as in the first line below.  You can specify the entire
arrangement of a layout by setting the at attribute on each of its children,
as in the four-line statement group below:

     `a3 has (`vcol;1;`vcols;1);`a1 has (`vrows;2);`l has `naturalsize
     {free `l;  l`a1`a2`a3`a4;  `l is `layout;
      `a1 has (`at;0 0 1 2);  `a2 has (`at;1 0 1 1);
      `a3 has (`at;1 1 1 1);  `a4 has (`at;2 0 1 2);
      show `l; br{`l;0 200}}

The R and C attributes that you saw in the Buttons tutorial can be used to
constrain the virtual rows or columns of a layout to be all the same size:

     l(`a1``a2;```;`a3``a4); `l has `naturalsize;
     `l has (`C`R;(1;1));

The "YX", "Y", and "X" attributes are related to the yx, y, and x attributes,
respectively.  The latter three can be set or referenced and they pertain to
the position of an object (in pixels) within its parent or, for top-level
objects, within the screen.  The former are for reference only and always
pertain to the position of the object (in pixels) within the screen:

     `YX `yx of `l
<  327 538
<  327 538
     `YX `yx of `a1
<  357 540
<  30 2

Several objects can occupy a layout in such a way that only one is visible at
a time, taking up the entire area of the layout, and any other one can be
brought into view simply by setting the value of its raise attribute to 1.
Since the objects within the layout can themselves be layouts, or other
complex objects, this provides a simple, efficient, and general way of
displaying multiple objects when only one must be visible at a time.

You use the "position" attribute to accomplish this.  This attribute must be
set before the layout is built, so start with a null layout and set position
and then give the layout its correct value:

     free `l; l();
     `l is `layout;
     `l has (`position;0)
     l`a1`a2`a3`a4`a5`a6`a7
     show `l; br{`l;0}
     `a4 has (`raise;1)

When you remove children from a layout by freeing or unmapping them, the
remaining objects may or may not retain their positions.  The "lockposition"
attribute forces them to remain in the same positions.  Consider this example
of two layouts that are identical except for the values of lockposition (and
the locations of the layouts themselves, so you can see them both at once):

     free `l;
     a1'one'; a2'two'; a3'three';a4'four'; a5'five'; a6'six';
     a7'one'; a8'two'; a9'three';a10'four'; a11'five'; a12'six';
     `a1`a2`a3`a4`a5`a6`a7`a8`a9`a10`a11`a12 is `label;
     l3 2 `a1`a2`a3`a4`a5`a6;  ll3 2`a7 `a8`a9`a10`a11`a12;
     show `l `ll is `layout; br{`l;0 130}; br{`ll;0}
     `ll has (`lockposition;1; `reparent;0);
     `l has (`reparent;0);
     free `a3 `a9;
     `a2 `a8 has <(`mapped;0);
     `a4`a6 `a10`a12 has <(`mapped;0);

The layout on the left should now have only one column, while the one on the
right, for which lockposition is 1, still has two columns, with the two
remaining labels still in their original positions.  The effect can be perhaps
even more pronounced when the layout geometry is a single column:

     free `l`ll;
     `a1`a2`a3`a4`a5`a6`a7`a8`a9`a10`a11`a12 is `label;
     l`a1`a2`a3`a4`a5`a6;  ll`a7`a8`a9`a10`a11`a12;
     show `l `ll is `layout; br{`l;0 78}; br{`ll;0}
     `ll has (`lockposition;1;`reparent;0);
     `l has (`reparent;0);
     free `a2 `a8;
     `a5 `a11 has <(`mapped;0);

     _ex `a2`a8,free `l`ll`a1`a2`a3`a4`a5`a6`a7`a8`a9`a10`a11`a12;


5d. Size of the Children

	Attributes:	b
			h
			H
			l
			locksize
			r
			resize
			t
			w
			W

If the "locksize" attribute of a layout is 1, the removal of a child should
not cause any remaining child to change size.  In Release 2.21, however, if
the "locksize" attribute of a layout is 1, the removal of a child cannot cause
the layout to change size, although remaining children may change size.  The
latter behavior is expected to be replaced by the former if there is another
release of version 2.  Here is an example of the behavior of two layouts that
are essentially the same except for this attribute; you can tell from this
example which way the release you are using behaves:

     abcdefghij14 17
     l(`a`b;`c`d;`e); ll(`f`g;`h`i;`j);
     show `l `ll is `layout; br{`l;0 412}; br{`ll;0}
     `ll has (`locksize;1; `reparent;0);
     `l has (`reparent;0);
     `ys of `l `ll
<  539
<  539
     `b`c`d `g`h`i has <(`mapped;0);
     `ys of `l `ll
<  370
<  539
     free `l`ll;

The way a child behaves when a layout is resized depends in part on its
display class.  Call a child sticky if its class is action, button, scalar,
label, slot, check, or radio and call all others non-sticky.  If a layout has
at least one row with only non-sticky children, then any row containing a
sticky child retains its vertical size when the layout is resized.  See how
all the extra vertical space is allotted to the bottom row when you execute
the next to last of these lines:

     `r is `radio  r(`w`j`z;(1;0;0));
     `ac is `action  ac(`a`c`t;(;;));
     l(`r`a;`ac`b;`c`d); show `l is `layout; br{`l;108 81}
     `l has (`yxs;1.2`yxs of `l);
     free `l;

The size of an object in a layout, which is normally affected by other objects
in its row and column or by resizing the layout, can be controlled by setting
the "H" and "W" attributes to 1.  These settings prevent resizing of an
object's height and width, respectively.  There are even stronger resize
restrictions, which apply to the entire row and column in which the object is
positioned: setting the "h" and "w" attributes to 1 means retain the height of
the row and the width of the column, respectively.  The constraints can be
seen after the layout enlargements in this example:

     l3 2`a`b`c`d`e`f; show `l is `layout; br{`l;162 121}
     sz`yxs of `l
     `a`b`c`d`e`f has <(`resize;'');
     `c has (`W;1);
     `f has (`H;1);
     `l has (`yxs;1.3sz);
     `l has (`yxs;sz);
     `c has (`w;1);
     `f has (`h;1);
     `l has (`yxs;1.3sz);
     `l has (`yxs;sz);

Setting these constraints to 0 does not remove them.  They are actually just a
way of inserting constraints in the "resize" attribute, whose value can be a
character vector containing any of 'WHwhtblr' (we will deal with the last four
in the next paragraph).  Settings of resize are cumulative unless there is a
period in the value being given for it or that value is empty.  Resize
settings of both '.' and '' remove all constraints.

If the newly allotted space for the object within the layout is larger than
the object, its position within that space is controlled by setting the "t",
"b", "l", and "r" attributes to 1.  They stand for top, bottom, left, and
right and have the obvious effect.  Now we remove all constraints and then
constrain the heights and widths of two children, enlarge the layout, and move
the constrained children within their spaces:

     `a`b`c`d`e`f has <(`resize;'');
     `c`f has <(`W`H;(1;1));
     `l has (`yxs;1.3sz);
     `c has (`t;1);
     `c has (`l;1)
     `f has (`b;1)
     `f has (`r;1)
     `resize of `c
< ltWH

In real life, of course, you would set the constraints before enlarging the
layout, so that the desired result would appear all at once, but when learning
it is better to see the steps and not just the outcome.  Before leaving this
layout, let's look at the dominance of left and top -- the nullity of b and r
in the presence of t and l -- and the change when a size constraint is
removed:

     `c has (`resize;'br');
     `c has (`resize;'WHb.r');
     `c has (`resize;'.');
     `f has (`resize;'');
     free `l;

These attributes can be used in the initial display of a layout, when they
apply to the relation between the natural size of the object and the space
allotted to it in the layout.  Consider this example:

     d'and ',c'still ',b'another ',a'array'
     `a`b`c`d is `label;
     `a has (`resize;'tr'); `b has (`resize;'Wtr'); `d has (`b;1);
     j10+k10+m10+n14 17
     l4 2`a`j `b`k `c`m `d`n
     show `l is `layout; br{`l;0}

The default label position, centered both ways, is shown by c.  Why is b at
the right but not a?  Because the latter is as wide as its space in the
layout, whereas b was not made wider than its natural size: we had set W for
it, and so it had room to move.  But then why did all the vertical movements
succeed?  Because for any object bound to the label class resize has the
default value 'hH' and we simply added to that value.  Therefore each label
has its natural height and has room to move vertically in its space in the
layout.


5e. Navigation and Interaction

	Attributes:	acceptfocus
 			focus
			freeze
			sensitive
			tabfrom
			tablist
			tabto

First, a note about function keys, which were discussed in the Buttons
tutorial.  When Fj is pressed, if it was set on the object that has focus,
then its function is executed. If it was not set on that object, then the
object's container is checked and the function executed if the key was set on
that object, and so on up to the shell, the top-level object.

The "sensitive" attribute can be set to 0 to block all user interactions with
an object and all its descendents.  Try to select from, edit, or scroll j
(with the pointer in l!)  after executing the second statement, and try to
select from, edit, or scroll any of the arrays after the third statement.  The
fourth statement shows that the display is still sensitive to changes made by
program; only the user side is blocked, all viewer input being ignored:

     `j`k has <(`selected;0 0);
     `j has (`sensitive;0);
     `l has (`sensitive;0);
     jj+1
     `l`j has <(`sensitive;1);

When the "freeze" attribute is 1, the display of the object and all its
descendents will not be updated as a result of specifying values for it or
setting attributes on it (although for the object itself some blanking may
occur).  When freeze is set to 0, the object is redrawn.  You can use freeze
to make several changes to an object without having its intermediate states
flash on the screen.  If you try editing, scrolling, and selecting after the
fifth statement in this example, you will find all these actions work,
although scrolling may just propagate the last line previously shown in the
scrolled direction.  Only the program side is blocked, the display of all
changes by the program being deferred until freeze is set to 0:

     `a has (`resize;'');
     `b has (`freeze;1);
     `b has (`resize;'');
     `b has (`freeze;0);
     `l has (`freeze;1);
     `d has (`resize;'');
     nn+1
     `l has (`freeze;0);

The remaining attributes in this set have to do with keyboard focus within a
container.  It can be given directly to any child with which the viewer can
interact (not a label, e.g.) by setting the "focus" attribute for the child to
any value.  Move the pointer into l after executing this statement to see its
effect:

     `m has `focus

To move the focus from child to child, press Meta-Tab (Alt-Tab on IBM
keyboards) or Shift-Meta-Tab (Shift-Alt-Tab on IBM keyboards) while the
pointer is in the container.  Objects of the various button and menu classes
can be excluded from this traversal by setting the "acceptfocus" attribute to
0 or included by setting it to 1.  Try traversing l before and after the
statement excluding a from the traversal, but don't have the focus on a when
you exclude it:

     free `a; a(`j`k`m`n;(1;0;0;0));
     `a has (`class;`radio; `resize;'.WH'; `mapped;1);
     l4 2`a`j `b`k `c`m `d`n
     `a has (`acceptfocus;0);

The order of traversal is given in the "tablist" attribute and can be changed
by giving a new value to tablist.  All children are listed in the default
value of tablist regardless of any ineligibility to accept focus, contingent
(as for a) or absolute (as for the labels).  The effective order of traversal
is the order of the eligible children in tablist.  When you specify tablist,
you can omit any children you want and you can include children for which
acceptfocus is 0 -- they will not actually be included in the traversal until
you change the setting of acceptfocus.  Try traversing the layout before and
after the third statement below, setting acceptfocus for a to 1:

     `tablist of `l
     `l has (`tablist;`j`m`k`n`a);
     `a has (`acceptfocus;1);

The tablist attribute (and the order of traversal) can be altered using the
"tabfrom" and "tabto" attributes, whose values are the prior and following
entries in tablist.  These two attributes can also be queried, although if
there are ineligible children listed in tablist the values of tabfrom and
tabto may not be helpful for some children;

     `tabfrom of `a
     `a has (`tabfrom;`m);
     `j has (`tabto;`k);
     `tablist of `l
<  `.j `.k `.m `.a `.n
     free `l;

Here is an example of a layout within a layout.  Start by preparing the first
two rows of the outer layout, the second row being itself a layout.  A width
is specified for the action buttons to make them a little more spacious:

     chc(`Off`On;(1;0))
     `chc has (`class;`choice;`title;'Feed is');
     hmn(`Font;,<(`font1`font2`font3;(;;)))
     `hmn is `hmenu;
     act(`Save`Sort`Add`Print`Fields`Help`Drop`Quit;(;;;;;;;))
     `act has(`class;`action; `title;''; `geometry;8; `realize;1; `xs;670);
     l1 2`hmn`act
     `l has (`class;`layout; `title;'';`h;1);

Now define a table and place it and the previous material in a layout:

     ca1 9'912827L2 '; cb17.625; cc120221115; cd1123.0314;
     ce15.933; cf112.81; cg116.23;
     tbl`ca`cb`cc`cd`ce`cf`cg
     `tbl has (`class;`table; `title;''; `cols;7);
     `ca`cb`cc`cd has (<`title), <@@0 `Cusip`Coupon`Maturity`Price;
     `ce`cf`cg has (<`title),<(`Yield;'M Dur';'$ Dur');
     `cb`cc`cd`ce`cf`cg has(<<`out),<(6.3;`mdy2;`328th;6.3;6.2;6.2);
     `ca`cb`cc`cd`ce`cf`cg has(<<`space),<(9;7;10;7;7;7;7);
     lay(`chc`l`tbl); `lay is `layout;
     `lay has (`shelltitle;'qs'; `title;''; `realize;1; `ys;300);
     show `lay; br{`lay;0}
     free `lay

Here is another example of a layout, with color attributes used to accentuate
its various parts:

     a19930000+401 505 609 714 818 922 1027 1201
     db2+.75 .6 .7 .6 .75 .9 .7 .75
     c7+1.073 .904 1.123 .904 .754 .923 .804 .474
     ef80
     t`a`b`c`d`e`f
     show `t is `table; br{`t;72 188}

Showing t is premature on several counts, as is the next statement, but doing
things in this order allows their effects to be shown better.

     `t has (`cols;4; `rows;8);
     `a has (`out;`mdy4; `space;10); `b`c`d has <(`out;8.3);
     `t has (`cols;4);
     `a`b`c`d has (<`title),`Auction`AucRate`YCR_R`ARR_R;
     `t has (`title;'MTA 5.50 2013');
     `t has (`titlefg;`white; `fg;`white; `bg;`black; `scrollbg;`grey);
     act(`tg`ex`pr;(;;))
     `act has (`class;`action; `geometry;3; `title;''; `bg;`white);
     `act has (`label;('Toggle Daycount';'Exit';'Print'));
     lbl'ActAct rates looking forward'
     `lbl has (`class;`label; `fg;`white; `bg;`black);
     l`t`act`lbl
     `l has (`class;`layout; `shelltitle;'RATE HISTORY'; `title;'');
     show `l; br{`l;0}
     _ex free `l;


6. The Hpane and Vpane Display Classes


The hpane and vpane display classes are container classes that are like
layouts except that they have movable dividers, or sashes, between their
children.  The viewer can control the proportion of the layout that children
occupy simply by moving the dividers.  Various attributes that constrain the
arrangement of children, such as position and build, are disregarded.  An
hpane object has vertical dividers and its children should be arranged
horizontally.  A vpane object has horizontal dividers and its children should
be arranged vertically.

To move a divider, simply place the mouse pointer on it, press and hold the
left mouse button, and then slide the divider left or right, or up or down.
The old and new divider lines are shown continuously and the new arrangement
is shown when you release the mouse button.  A small button is provided on one
end of each divider as a convenient place to locate the pointer.

In the following vpane example, a viewer can adjust the number of headlines
shown, with a corresponding adjustment in the space available for any selected
story.  We use some data from aux_vars.+ that there is no point in cluttering
this tutorial with.  The selected headline appears as the title of the story
section:

     _load{'/usr/local/aplus-fsf-4.22/doc/tutorials/s.tutorials/aux_vars.+'};
     `ld_vph has (`class;`view; `title;''; `bg;`white; `rows;10; `cols;74);
     t76' BT 10/01 13:14 Nortek Filing -2- Proceeds to Redeem Debt >NTK'
     `ld_vps has (`class;`view; `title;t; `bg;`white; `rows;9; `cols;76);
     vp`ld_vph `ld_vps
     `vp has (`class;`vpane; `title;''; `shelltitle;'DJ NEWS -- MS FID');
     show `vp; br{`vp;0}

Move the sash up and down.  Notice that scrollbars appear and disappear for
the two sections as needed and that you can eliminate either section from view
completely if you want.

     _ex `t,free `vp;

In the following hpane example, a viewer can adjust the number of fields shown
in two tables.  The first four lines set up the table fields, the next four
the tables, the next two the tableFields, and the last three the hpane:

     csps100
     `cs`ps has <(`title;'strikes'; `out;'f7.2');
     CBIDCASKCLSTCBvolCAvolCLvolCLDelta10Ң999999999
     PBIDPASKPLSTPBvolPAvolPLvolPLDelta10Ң999999999
     tc`cs`CBID`CASK`CLST`CBvol`CAvol`CLvol`CLDelta
     tp`ps`PBID`PASK`PLST`PBvol`PAvol`PLvol`PLDelta
     `tc has (`class;`table; `title;'Calls'; `cols;5; `rows;10);
     `tp has (`class;`table; `title;'Puts'; `cols;5);
     `cs`CBID`CASK`CLST`CBvol`CAvol`CLvol`CLDelta has<(`blank;' '; `space;7);
     `ps`PBID`PASK`PLST`PBvol`PAvol`PLvol`PLDelta has<(`blank;' '; `space;7);
     hp1 2`tc`tp
     `hp has (`class;`hpane; `shelltitle;'Ivy'; `title;'');
     show `hp; br{`hp;0}

Try moving the sash from side to side.  You can show just one table, two
columns of one and all of the other, or other combinations.

     _ex free `hp;

The dividers of an hpane layout always extend from the top to the bottom of
the layout, so care must be taken when using hpane layouts with more than one
row.  Consider

     (a;b)100+?2<5 3 100; c100+?5 4100;
     h(`a`b;`c); show `h is `hpane; br{`h;0}

The divider between objects a and b cuts through object c.  Similarly, care
must be taken when using vpane layouts with more than one column:

     _ex free `h;
     (a;b)100+?2<9 2 100; c100+?12 2100;
     v(`a`c;`b`c); show `v is `vpane; br{`v;0}

If several objects line up on a divider boundary, then movement of the divider
controls the display sizes of these objects.  Thus movement of a divider can
control the display sizes of an entire row or column of objects.  Moreover,
there can be several dividers.  Scrutinize this example and move its dividers:

     _ex free `v;
     (a;b;c;d;e;f;g)100+?7<5 9100;
     h(`a`b`c;`d`e`f;`g)
     show `h is `hpane; br{`h;0}

Where do dividers appear?  In section 5c, on the arrangement of objects in a
layout, we spoke of virtual rows and columns and the at attribute, whose value
is defined in terms of them.  Dividers appear between each adjacent pair of
virtual columns for an hpane and of virtual rows for a vpane.  Respecify h to
be an unpleasant hpane whose arrangement of objects requires that they all
span virtual columns:

     h(`a`b`c;`d`e;`g); free `f;
     >`at of `a`d`g
 0 0 1 2
 1 0 1 3
 2 0 1 6

Notice that there is no object boundary between the first and second virtual
columns or between the fifth and sixth, although there are dividers there.

     free `h;

Clearly, if we want dividers for each of the first and second rows, this is
not the way to do it.  The dividers need to be limited in length.  The right
way for this particular arrangement is to handle the virtual rows separately,
to put two hpanes and g inside a layout:

     h11 3`a`b`c; `h1 is `hpane;
     h21 2`d`e; `h2 is `hpane;
     l`h1`h2`g; `l is `layout;
     show `l; br{`l;0}
     free `l;

Likewise, dividers may need to be limited in number, and a way to do that is
to put layouts inside hpanes.  Suppose we want to allow the viewer to divide
the available space between two arrays and also to switch the variable that
appears in the lower array, with the same columns shown as for the variable
previously shown.  We want a vpane containing array, radio, array.  If we
specified the vpane in that simple manner, then there would be two dividers
and they would both have to be moved to take space from one array and give it
to the other (while the radio would be alternately stretched and squashed).
The solution is obvious: put the radio and the array it refers to inside a
layout:

     e10d10c10b10a10 8
     r(`b`c`d`e;(1;0;0;0)); `r is `radio;
     l`r`b; `l is `layout;
     v`a`l; `v is `vpane;
     cbf{s;d;i;p;c;v}:{`v has (`freeze;1);
         po1#.l; fc`firstcol of po;
         .l`r,p; free po; show p; p has (`firstcol;fc);
         `v has (`freeze;0);}
     `r has (`set;cbf; `geometry;4);
     `v`l`r`b`c`d`e has <(`title;'');
     show `v; `v has (`xs;291); br{`v;0}

Now move the divider, use the scroll bars, and press the radio buttons.

There is no direct way for a program to determine exactly where a user has
positioned a divider in an hpane or vpane layout.  Sometimes there are
indirect ways to approximate the position, such as checking the values of the
rows and cols attributes of an object to determine how many rows and columns
are currently shown.  Execute these two statements before and after moving the
divider:

     >`rows `ys of `a
     >`rows `ys of 1#l

     _ex `cbf`r`b`c`d`e`f`g, free `v;
@ 1.1 log @Initial revision @ text @d1100 1 a1100 1 _load{'/usr/local/aplus-fsf-4.18/doc/tutorials/s.tutorials/aux_vars.+'}; @ aplus-fsf-4.22/src/html/tutorials/s.tutorials/RCS/data.html,v0000444000265000001440000015362210774505731017576 head 1.2; access; symbols; locks; strict; comment @# @; 1.2 date 2008.04.01.19.24.06; author jmiz; state Exp; branches; next 1.1; 1.1 date 2008.04.01.19.22.37; author jmiz; state Exp; branches; next ; desc @@ 1.2 log @*** empty log message *** @ text @  
                          Display Classes for Data
                          

1. The Array Display Class

	1a. Preparing to Show an Object

			Attribute:	realize

	1b. Controlling What is Shown

		1b(i). What Rows and Columns are Shown

			Attributes:	cols
					firstcol
					firstrow
					naturalsize
					rows
					size

		1b(ii). Selected and Referred Rows

			Attributes:	col
					index
					refer
					row
					select

	1c. Changing the Value

		1c(i). Editing

			Attributes:	edit
					protect

		1c(ii). Insertion and Deletion

			Attributes:	delete
	       				insertabove
					insertbelow

		1c(iii). Representing Missing Values and Characters

			Attributes	blank
	       				copy
					na
					stars

		1c(iv). Evaluation

			Attributes:	active
					def
					done
					evaluate
					execute
					in
					out

	1d. Appearance

		1d(i). Separators

			Attributes:	colsep
					rowsep

		1d(ii). Size

			Attributes:	dynamic
					editspace
					hscrollsize
					respace
					space
					scrollsize
					vscrollsize

		1d(iii). Color

			Attributes:	colors
					cycle
					editbg
					editfg
					hscrollbg
					indexbg
					refresh
					rowbg
					scrollbg
					selectbg
					vscrollbg

	1e. Documentation

			Attribute:	doc

2. The Label Display Class

3. The View Display Class

	3a. Accessing the Primary Selection Buffer

			Attributes:	clear
					notify
					primary
					request

4. The Page Display Class

			Attributes:	blink
					blinkrate
					bold
					box
					boxcolor
					color
					colormap
					line
					underline

	4a. User Input

			Attributes:	cursor
					key
					keysym
					rband
					rbandbox
					3down
					3up
					2down
					2up

5. The Matrix Display Class

			Attributes:	collabelrows
					colspace

	5a. Selection

			Attributes:	colindex
					cornerindex
					rowindex
					selectcol
					selectcorner
					selectrow

	5b. Colors

			Attributes:	colindexbg
					cornerindexbg
					rowindexbg

6. The Slot Display Class

---------------------------------------------------


1. The Array Display Class


Any A+ scalar, vector, or matrix can be displayed as an object of class array.
For character arrays, each vector or row of a matrix is put in one cell.  For
all other arrays, each element is put in its own cell.  Examine these six
examples to see how various data types are displayed and check the action of
the scrollbars.  It is a bug, scheduled to be fixed in Version 3, that s has
to be jogged by naturalsize into obeying respace:

     $load s
     scrs.SCREEN-34 12
     br{w;m}:{w has (`yx;scr-m+`yxs of w);}
     ar10 10; `ar has (`class;`array; `respace;1; `show;1); br{`ar;0}
     ar1.0+10
     ar2.718+10
     ar(1 2;3 4 5;6;'abc';`def;7 8;9 10)
     ar6 5'Row 1Row 2Row 3Row 4Row 5Row 6'
     ar'This is a character vector'
     `ar has `naturalsize; br{`ar;0}
     ar2 2("Perhaps";"not";"what's";"wanted")
     `ar has (`space;12;`cols;2); br{`ar;0}
     _ex free `ar


1a. Preparing to Show an Object

	Attribute:	realize

Sometimes, when there are lengthy computations or file accesses, objects may
be placed on the screen in a halting, ragged way unless you take steps to make
the presentation smoother.  Try this contrived example, where sys.sleep is a
stand-in for a meaningful lengthy operation and b and c are specified
initially to speed the start-up:

     ar14 17
     b:{sys.sleep 5;ar}
     c:{sys.sleep 5;ar}
     cbar
     show `ar is `array; br{`ar;0}
     `b has (`class;`array; `show;1); br{`b;0 250}
     `c has (`class;`array; `show;1); br{`c;0 500}
     hide `ar

Now give ar a "new" value to mark the b and c values invalid.  When they are
shown again the display is set up in a halting, ragged way:

     ar14 17
     show `ar

Now we will hide these objects and respecify ar.  But this time we will use
the "realize" attribute before showing the objects.  Setting realize to 1
causes the objects to be calculated for showing but does not actually show
them.  Thus the delay and unevenness is not displayed on the screen, and when
the show function is executed the objects jump right up:

     hide `ar
     ar14 17
     `ar`b`c has `realize; show `ar;

Get rid of the other objects:

     _ex free `b`c


1b. Controlling What is Shown

There are a number of attributes that control what elements of an array object
are shown.  Some determine the set directly; others single out individual
elements for inclusion somewhere in the set.

1b(i). What Rows and Columns are Shown

	Attributes:	cols
			firstcol
			firstrow
			naturalsize
			rows
			size

The "rows" and "cols" attributes control how many rows and columns are shown.
The default has been used for ar, but you can change how much is shown:

     >`rows`cols of `ar
     `ar has (`rows`cols;(8;4)); br{`ar;0}

The "firstrow" and "firstcol" attributes are the indices of the first row and
first column that are shown, and thus control what portion of the array
appears on the screen:

     `ar has (`firstrow`firstcol;(6;13))

The bottom right portion of the array is shown.  Now press twice on the up
button of the vertical scrollbar, moving up two rows, and once on the left
band of the horizontal scrollbar, moving left three columns (the four that are
shown minus one for overlap).  The new position is 4, 10:

     `firstrow`firstcol of `ar
     `ar has (`firstrow`firstcol;(13;16))
     >`firstrow`firstcol of `ar

The specification was taken as a suggestion (without comment) and honored as
far as possible while still showing the same number of cells.

The "naturalsize" attribute was introduced in the button section of the
Buttons tutorial.  It is an action attribute; it cannot be queried.  Setting
naturalsize returns the array to the number of rows and columns it had when
mapped, taking into account the current text and data values and feature
attributes, but setting firstrow and firstcol to 0:

     `ar has `naturalsize

Fractional rows may be shown when the viewer changes the size of an object --
try dragging the bottom right corner down and to the right when you have a
target for a pointer -- or when a size is assigned to the object in an A+
statement.  These fractional rows show no data and are of no use.  The "size"
attributes trims them off.  When you have a 200 by 300 pixel space available
and want to use as much as possible of it, but want a good-looking display,
you can use the size attribute.  You should see 6+ rows and 3+ columns and
then an even 6 by 3 when you execute these statements:

     `ar has (`yxs;200 300)
     `ar has `size

You can combine these statements, if you list the attributes in the correct
(left to right) order.  The first line below specifies size too early; the
second is OK:

     `ar has (`naturalsize`size`yxs;(;;200 300))
     `ar has (`naturalsize`yxs`size;(;200 300;)); br{`ar;0}

1b(ii). Selecting and Choosing Rows

	Attributes:	col
			index
			refer
			row
			select

A cell can be selected in an array object.  Selecting and choosing are
discussed here because a cell is normally shown when it is selected, and so
they are another way of determining what portion of an array is shown.  The
"row" and "col" attributes contain the row and column indices of the selected
cell.  They are -1 if no cell is selected.  The "selected" attribute,
discussed in the Buttons tutorial, is just the concatenation of the row and
col attributes.  Execute these statements:

     `ar has (`firstrow`firstcol;(6;13))
     >`row`col of `ar
     `ar has (`row`col;(0;0))
     `ar has (`row`col;(0;1))
     `ar has (`row`col;(2;2))
     `ar has (`row`col;(;))
     >`row`col of `ar

Notice that Null is accepted in place of -1.  As you have just seen, a
selected cell is shown raised, and a selected row (except for the selected
cell) is shown in a different color.  Now place the mouse pointer in any cell
of ar and click the left mouse button.  That cell becomes selected.

With the pointer in the array display, the selection can be moved using the
arrow keys, Tab, Shift-Tab, Page Down, Page Up, End, and Home.  Each key is
effective until its limit is reached.  When no cell is selected, Right Arrow,
Down Arrow, Tab, and Home select cell 0 0, Page Down selects the first cell of
the last row shown and makes it the top row shown, and End selects the first
cell of the last row.  Try them.

Whenever a cell is selected, a select event occurs.  The "select" attribute
allows you to specify a function that will be called at each select event, and
optionally to specify an argument for that function.  The default selection
action still occurs.  For example, execute:

     f{s;c;v}:{acv; a has (`firstrow `firstcol;
               ġ(`row `col of a)-s1+`rows`cols of a);}
     `ar has (`select `cols;((f;.5);3))

Now use the mouse and the keyboard to select various cells in ar and see how
the select callback function f causes the selected cell to appear in the
middle of the display -- or, when it is near the edges, to appear as close to
the middle as possible.  Notice that if you scroll the display leaving the
selected cell in view and click on that cell, no select event occurs, as
evidenced by the fact that the cell does not move.  Now execute

     f{s;c;v}:>`row`col of cv
     `ar has (`select;f)
     `ar has (`row`col;(0;0))
     `ar has (`row`col;(2;3))
     `ar has (`row`col;(3;4))
     `ar has (`row`col;(4;4))
     `ar has (`selected;<1 2)
     `ar has (`selected;<1 1)

and notice that:
 
(1) When selection takes place by an A+ statement, using row and col
attributes, a select event can occur for each of them, in the order shown by
those attributes.

(2) The "selected" attribute is implemented as if the col and row attributes
had been specified, in that order.

(3) No select event occurs when the row or column selected is the same as the
one that was selected or is -1.  The automatic setting to 0 mentioned in the
second paragraph after this one does not trigger a select event, so setting
both attributes from -1 to 0 triggers only one event.

Now use the mouse and the keyboard to select cells and notice that at most one
select event occurs each time.

The row and col attributes are independent, except that (1) if one is set to
-1, the other is automatically set to -1 also and (2) if they are each -1 and
one is set to something else, the other is set to 0:

     `ar has (`firstcol`firstrow`selected;(0;0;))
     `ar has (`col;1)
     `row of `ar
     `ar has (`selected;)
     `ar has (`row;1)
     `col of `ar
     `ar has (`row;)
     `selected of `ar
     `ar has (`select;)

The "refer" attribute allows the viewer to choose a set of rows. When it is
zero, no choosing can take place. When it is nonzero, however, clicking the
left mouse button with the pointer on a cell that is selected but not chosen
causes its row to be chosen, and then clicking on it again causes the row to
be no longer chosen. Since clicking on an unselected cell causes it to be
selected, clicking twice on any unselected cell causes the chosen status of
its row to be toggled.  Pressing Enter while the pointer is in the window and
there is a selected cell has the same effect as clicking on the selected cell.

The default for refer is 0.

     `refer of `ar
     `ar has (`refer;1)
     `index of `ar

The "index" attribute is a sorted list of the indices of the chosen rows.
Choose some rows, using the left button and the Enter key; notice the change
in the color of these rows.  Remove the choice from some of them, again using
both button and key, but leaving several chosen.

     `index of `ar

If there are chosen rows and refer is set to zero, then they are remain chosen
rows and you cannot remove the choice from them:

     `ar has (`refer;0)

Now try pressing Enter with the pointer in the array window or clicking on the
selected cell.  And now remove the choice from all the chosen lines:

     `ar has (`index;)

Like a number of other attributes, refer can have one of three values: 0 for
no choosing; 1 for choosing with the default action; or a function, and,
optionally, an argument, for a callback.  If a callback function is specified,
s does nothing but call that function when a refer event occurs and
appropriately color the rows listed in index after the callback.  It is up to
the callback function to update and sort the index attribute.  Define a
function that mimics the default action and displays its argument and the new
value of index, and set refer to it and a static-data argument:

     f{s;c;v}:{acv; (r;i)`row`index of a;
               i((ir)/i;
               a has (`index;i);(s;c;v;i);}
     `ar has (`refer;(f;'stat data'))

Now choose some rows and remove the choice from some of the chosen ones,
leaving others.

     `index of `ar
     `ar has (`refer`index;(0;))


1c. Changing the Value

Aside from reassignment to the underlying variable, there are several ways the
value shown on the screen can be changed.

1c(i). Editing

	Attributes:	edit
			protect

The value in an individual cell can be edited.  To prepare for editing, a cell
must be selected, in one of the ways just demonstrated.  There are two modes
and several ways to enter them, one of which involves deletion of the entire
previous contents.  Try them, pressing Escape after each:

Replacement:

   With the pointer in the cell, click the middle mouse button.  The
replacement text cursor will appear on the character the tip of the pointer is
nearest to.

Insertion:

   With the pointer in the cell, click the right mouse button.  The insertion
text cursor will appear between characters, as near as possible to the tip of
the mouse pointer.
   With the pointer in the window, press the Insert key.  The insertion text
cursor will appear at the end of the original contents.
   With the pointer in the window, press Backspace or any character key.  The
entire cell contents will be deleted and the character will appear, unless you
pressed Backspace, followed by the insertion text cursor.

The mode, insertion or replacement, can be toggled by pressing the Insert key
or reset by using the middle or right mouse button.  The cursor can be moved
with the left and right arrow keys or by clicking at a new location in the
cell: the left button leaves the mode unchanged, the middle button forces
replacement mode, and the right button forces insertion mode.  The editor is
Emacs style.

To abort the editing of a cell and return to its original contents, press the
Escape key.  To end the editing of a cell and cause the edited contents to be
inserted in the underlying variable, press Enter or select another cell using
Tab, the up or down arrow keys, etc., or, with the pointer in another cell, a
mouse button.

Since the edited contents of a cell are inserted in the underlying variable
using Selective Specification, you must avoid illicit values, such as 34.5
when the array is integer or 34 5 when the array is simple.  When you press
Enter or try to select another cell with an illicit value in the current cell,
a message appears in the session log and editing of the cell remains open.
Remember, you can escape from an error situation by pressing the Escape key.

Try editing the ar display.

Editing can also be begun and ended from A+ code.  Assigning any nonzero value
to the "edit" attribute is like pressing the Insert key.  (If no cell is
selected, neither of these actions causes edit mode to be entered.)  Assigning
a zero value to the edit attribute is like pressing Enter in edit mode.

     `ar has (`selected `edit;(1 1;))

Now edit the cell, but leave it in input mode.  The edited contents are
accepted (assuming the value is permitted) by this statement:

     `ar has (`edit;0)

You can restrict editing to certain cells, using the "protect" attribute.  A 1
prevents editing in a column and a 0 allows it.  You can give an array
argument that will be used repetitively, in the manner of Reshape, or a
function.  The first statement allows editing of only the first and third
columns; try editing ar after you have executed it:

     `ar has (`protect;0 1 0,141)
     `protect of `ar
     f{s;d;i;p;c;v}:{(s;d;i;p;c;v);0=2|d}
     `ar has (`protect;(f;'attempt to edit'))

Now only odd values can be edited; try it.  You will see in the A+ session log
the arguments that are passed to f.

     `ar has (`protect;0)

1c(ii). Insertion and Deletion

	Attributes:	delete
			insertabove
			insertbelow

Insertion and deletion can be controlled in a manner like editing and
choosing.  You can allow a viewer to insert or delete rows in an array,
prevent a viewer from doing so, or provide functions to handle insertion or
deletion requests.  These requests are made by selecting a row and pressing a
key combination; the combinations and the corresponding attributes are
Meta-Delete ("delete"), Meta-Insert ("insertbelow"), and Meta-Shift-Insert
("insertabove").  On IBM keyboards, the corresponding key combinations are
Alt-Delete, Alt-Insert, and Alt-Shift-Insert.  The pointer must be in the
window when the keys are pressed.

Setting any of these attributes to 0 causes requests for its action to be
ignored.  Setting it to 1 causes the default action, deletion or insertion, to
be taken upon request.  Setting it to a function, or a function and an
argument, causes that function to be called when the request is made and
causes s to omit the default action.  Consider deletion first.  Try to delete
a row after each of the first two statements:

     `ar has (`delete;1)
     `ar has (`delete;0)
     f{s;c;v}:{if ((c%s)=r`row of cv){(c%s)1;(c%v)(rc%v),(r+1)c%v}
               else (c%s)r;}
     arr1
     `ar has (`delete;(f;`arr))

Now in order to delete a row you must press Meta-Delete (or, on an IBM
keyboard, Alt-Delete) twice on a selected row.  Try selecting various rows and
pressing once on each and then twice consecutively on the last.

Now consider insertion.  After the second and third statements, try each kind
of insertion at the first line:

     ar14 17; `ar has (`firstrow`firstcol `row`col;(0;0;0;0))
     `ar has (`insertabove`insertbelow;(0;1))
     `ar has (`insertabove`insertbelow;(1;0))
     f{s;c;v}:(c%v)((1+#c%v)s+>`row of cv)\c%v
     `ar has (`insertabove`insertbelow;((f;0);(f;1)))

Now insert a row below and one above the current third line.  The next section
explains the difference between the insertions performed by f and the default
ones.

     `ar has (`delete`insertabove`insertbelow;(;;)); br{`ar;0}

1c(iii). Representing Missing Values or Characters

	Attributes	blank
			copy
			na
			stars

To insert a row, the function f in the last section employed Expand, which
uses zero as the fill character for a numeric array.  Insertion by s, however,
is more flexible than by Expand.  The fill character is the value of the "na"
attribute.

     `na of `ar

This number is the default for both integer and floating-point arrays.  It is
intended to represent an improbable, if not preposterous, value.  You can set
na to any value you want.  You should generally choose a value that does not
occur in actual data, so that it will always mean missing or unavailable, and
one that will be as simple as possible to handle in your computations.  Just
to see it in action, change na to -1 and go back to the default insertion:

     `ar has (`na;1;`insertabove;1;`insertbelow;1)

Now insert a row below the second one.

You don't have to use a fill character when inserting rows.  A copy of a row
is the most convenient insertion for a viewer when only a few fields need to
be changed in the new row, most fields being the same in both rows.  To insert
a copy of the selected row rather than a row of fill elements, change the
"copy" attribute from its default value of 0 to 1:

     `ar has (`copy;1)

Now insert a row above or below the second row.

You can control how na values appear in displays.  The display for any element
that is equal to the (current) value of na is determined by the "blank"
attribute.  The default value of the blank attribute is Null:

     ()`blank of `ar  br{`ar;0}

meaning show the actual value that is in the array.  The blank attribute can
be set to any character value; watch the display of ar change when you change
it:

     `ar has (`blank;'N/A')
     `ar has (`blank;' ')
     `ar has (`blank;'missing')
     `ar has (`blank;'Fill in')

When you change na, the display of ar will also change, but only when the
displays of the relevant cells must be recalculated, for example by a
specifying of refresh:

     ar[;0]
     `ar has (`na;0; `refresh;)

You saw stars displayed in the first rows you entered.  You know that the
value of those elements in the underlying variable was -999999999, the then na
value.  What were the stars doing there?

When there is not enough room to display a formatted value in a cell, either
the cell is filled with stars or the value is shown truncated.  The latter
alternative might be preferable for a character string or a number which would
lose only digits following the decimal point.  This choice is governed by the
"stars" attribute:

     `stars of `ar
     `ar has (`blank;; `na;999999999; `space;7);
     `ar has (`stars;0)

Now let's freshen ar up a little:

     `ar has (`stars`blank`naturalsize;(;;))  ar14 17; br{`ar;0}

1c(iv). Evaluation

	Attributes:	active
			def
			done
       			evaluate
			execute
			in
			out

This section is concerned with conversions between displayed values and the
value of the underlying variable, and the timing of these conversions and
associated computations.

There is an attribute in s that corresponds to the dependency definition
function and command, _def and $def, namely "def".  It is a persistent
attribute, and a variable need never have been bound to have a value for that
attribute:

     j:ar+1
     `def of `j

When a dependency is being displayed, the dependency is evaluated and the
display updated whenever the dependency is marked invalid.  If it is not being
displayed, there is no need to evaluate it.  (It is not being displayed if the
show attribute is 0 for it or for some object in which it is contained.)  The
"active" attribute, which is for reference only, tells you whether the object
will be updated automatically or not:

     `active of `ar
     hide `ar
     `active of `ar
     show `ar

The "evaluate" attribute says whether the underlying variable (dependency or
not) is to be evaluated in order to determine the proper attribute values for
displaying it.  If you set evaluate to zero, it is up to you to set the
attributes for a proper display of the variable.  Use it with great caution.
Like def, it is persistent.

     `evaluate of `ar
     `evaluate of `j
     `evaluate of `no_such_variable

The "execute" attribute controls whether or not input will be executed to
obtain a value:

     `execute of `ar

Edit a cell, enter an A+ expression with a singleton result, such as +/10,
and see the result.

     `ar has (`execute;0);

Again edit a cell; enter an A+ expression such as +/10 or 7 and you should
get an error message like "ar: domain - edit value" in the A+ session log.
Try expressions like 7, 1e2, -7, and +7 and you should find that they are
accepted.  (Although the latter two look like functions applied to numbers,
actually the minus sign is converted to high minus and the plus sign is
dropped, so the input is just formatted, not executed.)

The "in" attribute is used to parse values as they are entered on the screen,
which is always as character vectors.  The default is in{x}:x if the type of
the underlying variable is character, and in{x}:x otherwise.  You can specify
a function to be used instead of this default, like one that will accept
commas as thousands separators or one that will accept a comma as a decimal
point.  Try entering some appropriate expressions after each of the following
specifications of in.  _scfi accepts commas as thousands separators and
parentheses as minus; e.g., _scfi"(1,234)" is -1234.  With the arguments given
here, g changes a comma to a period -- e.g., 34,5 to 34.5 -- to convert
decimal points from the European system.

     f{s;d}:_scfi d
     `ar has (`in;f);
     g{s;d}:d  ((d=s[0])/d)s[1]
     `ar has (`in;(g;',.'))  ar1.014 17;

You can specify a character matrix for the in attribute, to encode input.
Then when a character vector is entered, it is padded with trailing blanks as
necessary and then sought as a row of the matrix.  If a match is found, the
row index in the matrix is entered in the variable.  If the vector is not
found there, the value of the na attribute is entered instead:

     `ar has (`in;2 3'no yes');

Now enter "no", "yes", and "maybe" in different cells; 0, 1, and stars (for
-999999999) should be shown for them.

The "out" attribute specifies the format in which data appears in the display.
The defaults are 1x for numeric, x for character, and s.box{x} for other
data.

You can specify a character matrix for the out attribute, just as you can for
the in attribute, so that the variable will contain numbers while words or
phrases appear on the screen:

     `ar has (`out;2 3'no yes');

When the out format is changed, the display is immediately updated.  Notice
the blank cells.  When out is a character matrix, all invalid indices are
treated as na's, and the default blank attribute is the one for character
arrays, namely a vector consisting of a single blank.

     `ar has (`blank;'N/A');
     `ar has (`blank;);
     `ar has (`in;);

You can specify a function for the out attribute -- for example, a conversion
from radians to degrees:

     f{s;d}:8.2sd
     `ar has (`out;(f;3602));

Other possible values for the out attribute are valid left arguments to dyadic
Format or _sfmt, or one of the formats listed in Table 22-3 of the A+
Reference Manual:

     `ar has (`out;5.1);
     `ar has (`out;'e 7.2');
     `ar has (`out;`minsec);
     `ar has (`out;);

If you are trying to coordinate several things, you may need to perform some
action when the screen entry and refresh cycle has been completed.  The "done"
attribute allows you to specify a callback function for that purpose:

     `done of `ar
     f{s;d;i;p;c;v}:(s;d;i;p;c;v)
     `ar has (`done;(f;'done'));

Edit some cells and observe the session log.  Now clean up and prepare for the
next section:

     `ar has (`done`naturalsize`col`space`cols;(;;;7;3))  ar14 17; br{`ar;0}


1d. Appearance

1d(i). Separators

	Attributes:	colsep
			rowsep

In the display of ar, there are lines separating the rows and the columns.
These lines are controlled by the "colsep" and "rowsep" attributes, whose
default values are 1.  The value 0 means no separators:

     `ar has (`colsep`rowsep;(0;0));
     `ar has (`colsep`rowsep;(2;3));
     `ar has (`colsep`rowsep;(1;1));

1d(ii). Size

	Attributes:	dynamic
			editspace
			hscrollsize
			respace
			space
			scrollsize
			vscrollsize

The "space" attribute determines the width of the cells:

     `space of `ar
     `ar has (`space;3);
     `ar has (`space;);

The "respace" attribute controls the automatic increasing of the space
attribute.  The space attribute is increased if necessary to accommodate the
formatted values in all cells when either (1) the respace attribute is 1 and
the value of the variable is changed or (2a) respace is reset to 1 or (2b) the
out attribute is respecified.  The respecification of ar after the
illustration of case (2a) is required to fix a known bug in the updating of
the display:

     `ar has (`respace;1;`space;5);
     ar[0;0]123456789
     `ar has (`respace;0);
     ar[0;0]0
     `ar has (`space;5);
     ar[0;0]123456789
     `ar has (`respace;1); arar;
     `ar has (`respace;0);
     ar[0;0]0
     `ar has (`space;5);
     ar[0;0]123456789
     `ar has (`out;);

Now clean up.

     `ar has (`space;7)  ar[0;0]0; br{`ar;0}

If you change font or text you may want either to keep the display the same
size or to keep the same cells displayed.  The "dynamic" attribute lets you
make this choice.  If it is 1, a font change may cause a change in the size of
the display, whereas if it is 0, the display will remain the same size:

     `dynamic of `ar
     `ar has (`font;'times-24');
     `ar has (`font;'kaplgallant-19');
     `ar has (`dynamic;1);
     `ar has (`font;'times-24'); br{`ar;0}
     `ar has (`font;'kaplgallant-19'); br{`ar;0}

When the "editspace" attribute is 0, the space available for editing a cell is
the cell itself.  When editspace is 1, the space available is determined by
s.EDITSPACE, which has a default value of 256; scrolling in this space is
provided automatically.  After the first of the following statements, enter
enough characters to overflow the cell and then press Escape.  Do the same
after the second statement, but before pressing Escape use the left and right
arrow keys to see the scrolling.

     `ar has (`editspace;0);
     `ar has (`editspace;1);

The width of the scrollbars can be controlled by three attributes;
"vscrollsize" determines the width of the vertical scrollbar and "hscrollsize"
the width (height) of the horizontal.  The "scrollsize" attribute is
vscrollsize, hscrollsize:

     `scrollsize of `ar
     `ar has (`scrollsize;5 6);
     `ar has (`vscrollsize `hscrollsize;(25;28));
     `ar has (`scrollsize;15 17);

1d(iii). Color

	Attributes:	colors
			cycle
			editbg
			editfg
			hscrollbg
			indexbg
			refresh
			rowbg
			scrollbg
			selectbg
			vscrollbg

You have already encountered some color controls in the Buttons tutorial.
Here are some more.  For the background of the scrollbars, there are the
"vscrollbg", "hscrollbg", and "scrollbg" (vscrollbg, hscrollbg) attributes.
The Null indicates that the value of an s global variable is to be used, as
discussed later in the S Global Variables tutorial:

     `ar has (`vscrollbg `hscrollbg;(`cyan;`yellow));
     `ar has (`scrollbg;`lightsteelblue);
     `ar has (`scrollbg;);

The backgrounds of the selected cell, the other cells in the selected row, and
the cells in the chosen rows (the rows listed in index) are controlled by the
"selectbg", "rowbg", and "indexbg" attributes, respectively:

     `ar has (`firstrow`firstcol`row`col`index;(0;0;0;0;1 2 3));
     `ar has (`selectbg;`mediumseagreen; `rowbg;`rosybrown; `indexbg;`tan);
     `ar has (`selectbg;`red; `rowbg;`cyan; `indexbg;`bisque);
     `ar has (`row;1);
     `ar has (`selectbg`rowbg`indexbg`index;(;;;));

Notice the combinations of colors when the selected row is one of the chosen
rows.

The "editbg" and "editfg" attributes control the colors in the cell that is
being edited:

     `ar has (`editbg`editfg`edit;(`white;`purple;1));
     `ar has (`editbg`editfg;(;));
     `ar has (`edit;0;`row;;`index;);

The "colors" and "cycle" attribute are used to signal a new value.  When an
indexed specification is made to the variable, the new value appears
successively in the colors indicated by the colors attribute.  Each of these
colors is shown for the number of milliseconds required by the cycle
attribute, a scalar.  (Changing a value on the screen by editing causes an
indexed specification.)

The colors attribute can be functional, in which case it is called once for
each changed cell, with the usual arguments: static data, value, index, path,
context, unqualified variable name.  For example, colors could be determined
by the sign of the new value and could be repeated, for a flashing effect, or
they could depend upon the column.

      `ar has (`colors;`red);
     ar[1;0 1]ar[1;0 1]
     `ar has (`colors;`red1 `red2 `red3 `red4);
     ar[1;0 1]ar[1;0 1]
     f{s;d}:{if (d<0) `red `yellow `red `yellow `red `yellow,4`red
            else `cyan `blue `cyan `blue `cyan `blue,4`cyan}
     `ar has (`colors;f);
     ar[1;0 1]ar[1;0],-ar[1;1]
     `cycle of `ar
     `ar has (`cycle;400);
     ar[1;0 1]ar[1;0 1]
     `ar has (`cycle;1000);
     f{s;d;i}:if (2|1i) `red `yellow `cyan `blue else `black
     `ar has (`colors;f);
     ar[1;](1 1,151)ar[1;]

Suppose an attribute uses a function to provide its value and that function
references a global variable.  Then a respecification of the global variable
will not cause a recalculation, although as elements are changed they will
reflect its new value.  If you want the entire array to reflect the new value,
you must force a recalculation, by means of the "refresh" attribute:

     FG`blue
     fgfn{s;d;i;p;c;v}:.FG
     `ar has (`fg;fgfn);
     FG`red
     ar[;1]ar[;1]
     `ar has `refresh;

This characteristic can be useful.  If ar were being continually updated from
a real-time feed, the first four lines above would initiate the color-coding
of updated numbers.  Whenever a viewer requests it, a new cycle could be begun
by color-coding all numbers as "old" and then setting FG to code updated
numbers as "new" again:

     FG`blue; `ar has `refresh; FG`red;
     ar[1;1]ar[1;1]

See the table section of the Containers tutorial for another example of the
use of refresh.

Incidentally, a functional value for fg can be used to color-code cells by
value, as in the first two statements below:

     fgfn{s;d}:s[1+d]
     `ar has (`fg;(fgfn;`red`black`blue));
     ar(1+?14 173)?14 17200
     `ar has (`colors `fg `refresh;(;;))  ar14 17;


1e. Documentation

	Attribute:	doc

This attribute, which has no assigned meaning and no restrictions in s,
provides a way of documenting objects (but not functions):

     `ar has (`doc;("Data tutorial: example";`class of `ar;ar;ar;ar));
     `doc of `ar
     `fgfn has (`doc;"Data tutorial: functional fg; use of refresh shown");
     `doc of `fgfn

The default value for doc is the value of s.AUTODOC, which is discussed in the
s-Context Variables tutorial.

     _ex `FG `prim_buf `clear_fn `f `fgfn `read_fn `j `arr `g;


2. The Label Display Class


The label class is for displaying text that is either a simple character
scalar, vector, or matrix or else a nested scalar or vector whose items are
simple character scalars or vectors.  Labels cannot be edited and never have
titles or scrollbars.  They typically appear inside containers, where they
have no corners or frames, and so blend in.  They can be used to give
information or instructions, label arrays and windows, display character
graphics (dingbats), and so on.

     lb('s tutorial';'data display classes')
     `lb has (`class;`label; `dynamic;1; `head;0);
     show `lb; _ex free `ar; br{`lb;0}

Here are two examples of the use of labels in layouts.  (Layouts are covered
in the Containers tutorial, but you don't really need to know anything about
them here; the details are almost all concealed in the auxiliary variables
file.)

     _load{'/usr/local/aplus-fsf-4.22/doc/tutorials/s.tutorials/aux_vars.+'};
     lb'Select Trigger Issue(s)'
     `lb has (`class;`label;`bg;`white);
     `ld_lo has (`class;`layout;`title;'';`shelltitle;'bsprdaddact._ACT');
     show `ld_lo; br{`ld_lo;0}

Incidentally, you probably observed that when ld_lo was bound to the layout
class lb vanished, since it is contained in ld_lo (by the value of ld_lo,
which we have not displayed) and ld_lo was not yet shown.

     free `ld_lo;
     lb1,'4'
     `lb1 has (`class;`label;`font;'zapfdingbats-60';`bg;`gray90;`fg;`green3);
     t1' Average Life  ...'; t2'   . . .'; t3' Price variance  ...';
     lb2(20'FFIEC Tests';30'-';t1;t1;t1;t2;t3;t3;t3;t2)
     `lb2 has (`class;`label;`justify;'l';`bg;`gray90;`fg;`black,9`gray70);
     lo1 2`lb1`lb2
     `lo has (`class;`layout;`shelltitle;'FFIEC';`title;'';`bg;`gray90);
     show `lo; br{`lo;0}

Notice the fg attribute for lb2.  For a label, its value can be a vector,
which is used cyclically, with one element applying to each row.

     _ex `t1 `t2 `t3 `lb `lb1 `lb2, >free `lo;


3. The View Display Class


The view class is for simple character matrices that need scrollbars and so
are unsuitable for labels.  Only fixed-width, or monospace, fonts should be
used for horizontal scrolling.  View displays have problems with matrices
containing tabs, backspaces, linefeeds, etc.; these problems will not be fixed
soon, so avoid ASCII control-type characters in any array to be bound to the
view class.  Views cannot be edited.  Here is an example of an output area
with initial filler:

     v20 61'CMOPort '
     `v is `view;
     `v has (`shelltitle;'cmoPortfolioMgr'; `title;'Output area');
     show `v; `v has (`xs;766); br{`v;0}

     _ex free `v;


3a. Accessing the Primary Selection Buffer

	Attributes:	clear
			notify
			primary
			request

Text clipped from an Emacs or XTerm window is written in the "primary
selection buffer", and text pasted in these windows is retrieved from this
buffer.  You can use this buffer from A+.

To write to the primary selection buffer, you give the "primary" attribute a
character value. (Other types of data are quietly ignored; the value of
primary remains unchanged.) Since there is only the one buffer, the value of
the attribute changes for all objects.

To read the buffer, you specify the "request" attribute for a bound object.
If primary has been given a proper value, a "notify" event occurs and the
buffer can be read by referencing the primary attribute.

If the buffer is overwritten by another process (not by an object in this A+
process), the A+ object, if any, whose specification of the primary
attribute was overwritten will undergo a clear event. Dragging the pointer
over text in an Emacs, Xterm, or FrameMaker window, for example, will cause
a clear event. The text that is highlighted can then be retrieved through
primary, but text that Emacs demarcated by bouncing the cursor back and
forth cannot -- but can, however, after you press the "copy 0 to PRIMARY"
button in an xcutsel window.

Adapting an example from Larry Rohrs, we first define a set of functions to
set primary and request and respond to notify and clear:

     SetPrimary{s}:{
       s .has (`primary;(`row .of s)#%s);
       'Copy pressed; set `primary'}
     SetRequest{s}:{
       s .has `request;
       'Paste pressed; set `request'}
     GetPrimary{s;c;v}:{
       row0`row .of cv;
       if (1=row) 'Nowhere to paste'
       else{
         (row#c%v)(1c%v)0`primary .of cv;
         '`notify event; got `primary'}}
     Clear{s}:'`clear event for ',s

Now define a function to set up a layout with a view and two buttons and to
set callbacks:

     Define{sym}:{
       sym .is `view;
       sym .has (`notify;GetPrimary);
       sym .has (`clear;(Clear;sym));
       (sym%`Layout)((sym`CopyBtn),sym`PasteBtn;`sym);
       (sym`CopyBtn)  .is `button  (sym%`CopyBtn) (SetPrimary;sym);
       (sym`PasteBtn) .is `button  (sym%`PasteBtn)(SetRequest;sym);
       (sym`Layout)   .is `layout;
       show sym`Layout;}

Specify two variables and have Define set them up and display them:

     Define `sample1  sample15 5
     Define `sample2  sample2105 5
     br{`sample2.Layout;0}; br{`sample1.Layout;0,10+>`xs of `sample2.Layout};

Click on a line in sample1 and press its Copy button.  Then click on a line
in sample2 and press its Paste button.  Click on another line in sample2,
press its Paste button, and see the same text entered on that line.  Select
some text in an Xterm or an Emacs session and notice that a clear event took
place for sample1.  Press either Paste button; if the selected text is
highlighted, it is put in the selected row; otherwise, request is set but
there is no notify event.  Try some other experiments with these objects and
see the results on the screen and in the A+ session log.

     _ex free `sample1.Layout `sample2.Layout;
     _ex `SetPrimary`SetRequest`GetPrimary`Clear`Define;

4. The Page Display Class

	Attributes:	blink
			blinkrate
			bold
			box
			boxcolor
			color
			colormap
			line
			underline


Character matrices can be bound to the page display class, which is designed
for displaying page-based information from data services.  There are no
scrollbars, and the firstrow, firstcol, rows, and cols attributes do not apply
to page objects.

First, here is a small sample page with the default display:

     ld_pg
     show `ld_pg is `page; br{`ld_pg;0}

The "underline" attribute takes a boolean mask showing which characters are to
be underscored.  It is functional.  For page, a nonfunctional setting of any
functional attribute is treated as if it were reshaped to the shape of the
underlying character matrix.  A functional setting should always be a value
with the same shape as the underlying character matrix.

First, we define a function to produce a mask from a set of row index, column
index, extent triplets (the static data).  By making it mask out blanks, we
can underline the title by underlining the whole first row, so that no change
is needed in the attribute when we change the title:

     msk{s;d;i;p;c;v}:{u(c%v)0;
             (,u)[((u)[1]0#s)+(1#s)+ɡ2#s]1; u^(c%v)' '}
     `ld_pg has (`underline;(msk;,<0 0 58));
     ld_pg[0;]58'     Mergers and Acquisitions'

The "line" attribute allows vertical and horizontal lines to be drawn.  The
vertical lines can be used, among other things, as column dividers, with or
without a box around them.  The line attribute takes an n by 4 integer matrix.
Each row contains index of first row, index of first column, number of rows,
number of columns.  For a horizontal line the third of these is zero and for a
vertical line the fourth is zero.  Settings are not cumulative; they erase
previous settings.  The commas here are of course not necessary; they just
make the expression easier to read:

     `ld_pg has (`line;4 4 6 20 0 18,12 17 2 0,12 29 2 0,12 41 2 0);

The "colormap" attribute takes a two-column matrix of color symbols.  Each row
represents a foreground, background pair.

The "color" attribute, which is functional, allows you to color each character
on the page individually.  It can be a matrix of indices into the colormap
value.

The foreground and background colors are never set directly.  If color has not
been set, then the first pair of colors in colormap are used throughout the
page:

     `colormap of `ld_pg
     `ld_pg has (`colormap;2 2`blue`white `brown`green);
     `ld_pg has (`colormap;2 2`black`gray `red`white; `color;(msk;,<3 0 6));

The "blink" attribute also takes a mask and is functional.  The "blinkrate"
attribute is a scalar integer that tells in milliseconds the rate at which the
designated characters are to blink:

     `ld_pg has (`blink;(msk;,<3 0 6));
     `blinkrate of `ld_pg
     `ld_pg has (`blinkrate;750);

Another attribute that is functional and uses a mask is "bold"; it governs
which characters appear in boldface:

     `ld_pg has (`bold;(msk;(3 7 7;3 38 14;8 4 14;9 4 17)));

Finally, you can draw a set of boxes on the page display using the "box"
attribute, whose value is an n by 4 matrix with rows containing row index,
column index, row extent, column extent.  You can choose the colors for these
boxes by means of the "boxcolor" attribute.  Its value is a vector; if there
are fewer elements in boxcolor than there are boxes, the colors of the excess
boxes remain unchanged.  Thus the second and third statements below are
equivalent:

     `ld_pg has (`box;2 4 8 0 3 58, 12 4 2 50);
     `ld_pg has (`boxcolor;<,`green);
     `ld_pg has (`boxcolor;<`green`black);


4a. User Input

	Attributes:	cursor
			key
			keysym
			rband
			rbandbox
			3down
			3up
			2down
			2up

Page objects cannot be edited directly.  No cursor is shown for them, but
there is a "cursor" attribute, which is set to the row and column of the
pointer on the page when any mouse button is pressed.  Press various buttons
with the pointer at various locations on the page; after each button press,
press F2 with the cursor on the following statement, and see the values in the
A+ session log:

     `cursor of `ld_pg

You can simulate a cursor by means of the blink attribute.  It is up to you to
move this "cursor" based on the key press and mouse button events.  You can
use the "key" attribute to set a callback on key presses.

The "keysym" attribute is for reference only.  Its value is of the form (k;s),
where k is the ASCII code of the last character pressed, and s is a boolean
vector of eight integers indicating which modifier keys were pressed when the
key press event occurred.  The modifiers are:

  Shift, Caps Lock, Control, mod1, mod2, mod3, mod4, mod5

where mod1 is Meta, mod2 is NumLock and mod4 is Alt.

Set the key attribute, then press various key combinations (with the pointer
in the page window) and see the value of keysym in the A+ session log:

     f{}:`keysym of `ld_pg
     `ld_pg has (`key;f);

There are four attributes with callback for mouse-button presses: "3down",
"3up", "2down", and "2up".  Set the callbacks and then press and release the
middle and right mouse buttons (again, with the pointer on the page) and see
the callbacks recorded in the A+ session log:

     m{s}:s
     `ld_pg has (`2up`2down`3up`3down;((m;`2up);(m;`2dn);(m;`3up);(m;`3dn)));

You can draw a rubber-band box by placing the pointer anywhere in the page,
pressing and holding the left mouse button, moving the pointer anywhere in the
page that you want (even not moving it), and releasing the button.  A box is
shown continuously during this process, starting at the upper lefthand corner
of the character space on which you pressed the button.  When you release the
button, the row and column indices of the upper lefthand corner of the box and
the row and column extents are placed in the "rbandbox" attribute, displacing
any box specification that might have been there.  If you release it anywhere
in the same character row or column, the extent will be zero.  Try drawing
several boxes, pressing the F2 key on the following statement after each:

     `rbandbox of `ld_pg

What else happens depends when a box is drawn depends upon the "rband"
attribute, which has a default value, 0, and a default callback, specified by
the Null.  Execute the next two statements.  Then draw some more boxes, some
of them with zero area, executing the third statement after each box is drawn:

     `rband of `ld_pg
     `ld_pg has (`rband;);
     `rbandbox `box of `ld_pg

Notice that each box specification is placed in rbandbox and that the ones
that have non-zero extents in both directions are also appended to the box
attribute, reflecting the fact that these boxes remain on the page.  You can
define your own callback function for rband.  If you do so, the latest box
specification is still placed in rbandbox, but box is not automatically
changed (so the box does not remain automatically on the screen when the mouse
button is released).  As you have probably observed, there is a strong
similarity in this regard between the rband/box behavior and the refer/index
behavior.

Let's define a callback function for rband to color the delineated area
differently.  First get rid of all but the original boxes, add a color pair to
colormap, and change the value of color from a function and its static data to
a boolean mask:

     `ld_pg has (`box;2`box of `ld_pg);
     `ld_pg has (`colormap;(`colormap of `ld_pg),`blue`lightgrey);
     `ld_pg has (`color;msk{<3 0 6;;;;`;`ld_pg});

Execute these statements to specify a callback function for rband:

     rb{}:{(b1;b2;b3;b4)`rbandbox of `ld_pg;(i1;i2)ɡld_pg;
           m((i1b1)^i18)/g)`; g8 8g;
     'abcdefgh '[`a`b`c`d`e`f`g`h` g]
     `sl has (`geometry;g);
     show `sl; br{`sl;0, 10+>`xs of `s}

Now clean up:

     _ex ld_names,`f`g`mreal`rlbl`clbl,s.reset{}; _ex `ld_names;
@ 1.1 log @Initial revision @ text @d1016 1 a1016 1 _load{'/usr/local/aplus-fsf-4.18/doc/tutorials/s.tutorials/aux_vars.+'}; @ aplus-fsf-4.22/src/html/tutorials/s.tutorials/RCS/introduction.html,v0000444000265000001440000003734410774505732021411 head 1.2; access; symbols; locks; strict; comment @# @; 1.2 date 2008.04.01.19.24.06; author jmiz; state Exp; branches; next 1.1; 1.1 date 2008.04.01.19.22.37; author jmiz; state Exp; branches; next ; desc @@ 1.2 log @*** empty log message *** @ text @  
                 Introduction to Screen Management Tutorials
                 

Besides this introduction, there are eight tutorials on screen management
topics: Buttons, Data, Menus, Containers, Graphs, Special Input and Displays,
Printing, and s-Context Variables.  They are meant to be studied in the order
just given.  They treat all display classes and all attributes.

These tutorials are intended to be introductory, to enable you to learn the
rudiments of the screen management system, s, and to get started doing some
actual programming in it -- which is itself the best way to learn.
Consequently, they have been kept as simple as reasonably possible:

   Generally, each attribute is discussed in the context of only one display
   class. Some details of its use or its values may be left out.  For example,
   the matrix form for specifying the value of the label attribute is omitted.

   Some complexities are glossed over; therefore, code which behaves in a 
   certain way in an example may not behave in the way you expect under other
   circumstances.  The order in which attributes are specified within a single
   statement, for instance, may have a substantial effect on the resulting
   display.

   All or part of the response of A+ to an input is often omitted.  This
   omission makes it easier to run through an example pressing the F2 key on
   on each input line and eliminates a great deal of repetitive material.  
   You can see the response on the screen in the A+ session log when you 
   execute the examples.  You can reduce the response still further by
   executing s.QUIET1, which suppresses s information messages but not
   error reports.

   Alternate ways of doing things are often not included.  The ones discussed
   are considered common or useful, but there may often be ways that are
   simpler or otherwise more desirable than the ones mentioned here.

You should consult the  A+ Reference Manual  when you need to know whether a
certain attribute applies to a particular display class or what the full set
of its possible values is, when there seems to be some inconsistency, when you
want to do something that seems difficult or impossible from the descriptions
given here, and so on.  After you have absorbed the material in the tutorials,
it might be helpful to browse in the manual, or even read it through.

If you get an A+ error message and a star in the next prompt, perhaps because
you pressed F2 on an output line or a line of text or you entered an
erroneous statement, you should immediately clear the error by entering .  To
enter this character, press the right-bracket key while holding down the Meta
key (on Sun keyboards) or the Alt key (on IBM keyboards).  There are two
equivalent Meta keys, usually marked with diamonds and located on either side
of the space bar.  The right bracket key is the second one to the right of
"p".  ( "[ ]" are brackets, "( )" are parentheses, and "{ }" are braces.)

If your session gets messed up for some reason or other, enter $off, press F4
when the session has ended, execute the $load s, scr..., and br{...}:...
statements, and go on either from the beginning or from the spot where the
variables and functions you need in order to continue are defined; this is
often right after previously used variables have been expunged (using _ex).



Visibility

One problem in an s tutorial is maintaining the visibility of the tutorial and
the A+ session log, despite the displays.  To do this as much as possible, we
keep the displays at the bottom right.  Your Emacs session should be at the
top left of your screen, and you should have just the tutorial showing in it
initially.  Then you press F4, starting A+ if necessary and displaying the A+
buffer below the tutorial buffer.

When point in the A+ buffer (the location where the cursor would be if it were
in that buffer) is not at the end of the file, the buffer does not scroll as
you press F2 with the cursor in a line of the tutorial.  Consequently, the
current line in the A+ log will go off the bottom of the buffer and become
invisible.  To remedy this situation, move point to the end.  One way to do
this is to press R2, End, R2.  Another way is to click the left mouse button
with the pointer on the last line of the log and then to return by clicking
with the pointer in the appropriate line of the tutorial; if the end of the
log is not visible, click with the pointer anywhere in the log and press End,
then return.



Display Classes and Attributes


The A+ screen management system, called s, includes twenty-four "display
classes" in Version 2.  These classes are intended for various purposes, and
they display or use the values of various kinds of A+ variables or functions.
The immediately obvious differences among them are in appearance.

There are eight tutorials on the display classes, grouping ones that are
similar, and treating separately the most elaborate one (graphs), the
printing utility, and the variables that control defaults.  All except
the one on graphs are in the same directory as this introduction,
(Install_Directory)/doc/tutorials

By default the Install_Directory is /usr/local/aplus-fsf-x.xx 
(where x.xx is version.release)

i.e. /usr/local/aplus-fsf-4.22/doc/tutorials

Their names and their coverage are:

  * buttons, the classes showing arrays of buttons: action, button, check, and
    radio;

  * data, the classes for ordinary data display and, for some of them, input:
    array, label, matrix, page, slot, view;

  * menus, the classes showing menus, immediately or on request: choice,
    hmenu, vmenu;

  * containers, the classes which enclose other classes: hpane, layout,
    table, vpane, and window;

  * graph, an elaborate container class that deserves its own tutorial;

  * special_io, the classes for special text input of various kinds
    -- command, password, text -- and special kinds of display -- scalar,
    tree.

  * printing, the facilities that enable you to put an image of a display in a
    Postscript file, suitable for printing;

  * s_context_vars, the means for setting defaults.



Associated with a displayed variable are "attributes", which play a very
important role in s.  They are set using the  is  and  has  functions and 
queried using the  of  function, as you will see in the Buttons tutorial.

We can distinguish five typical kinds of attribute:

  * Attributes that are for reference only.  Values cannot be specified for
    them; they can only be queried.

  * At the other extreme, attributes that are only triggers for action.  Such
    an attribute triggers its action whenever any value is specified for it.
    Specifying the Null (no apparent value) or perhaps 1 for them might make
    your code as clear as possible; when you are setting only one attribute
    you can simply say  `a has `attr.  Some of the action attributes do not
    retain a value and cannot be queried.

  * Attributes that govern yes/no or on/off decisions.  They effectively
    accept just boolean values, 1 and 0.  For some of them, specifying the
    Null directs s to use the boolean value of an associated variable.

  * Attributes whose values are members of some well-defined set, such as
    left, right, top, bottom.

  * Attributes whose values lie in a range of numbers or are arbitrary text.

Furthermore, an attribute can be

  * persistent, meaning that values can be specified and are retained when a
    variable is not bound to a display class; and, independently,

  * functional, meaning that a function can be specified for the attribute,
    not just a (data) value or a variable.

Each individual attribute is discussed either in the tutorial on printing or
with the first display class for which it is truly relevant or most general or
useful for an example.


If you want to review what was said about an attribute, or if you are not new
to s and want to learn about a particular attribute, consult the following
lists.  They tell you where a discussion of it can be found: in which
tutorials and, in the third list, which sections.



In attributes for graphs, a leading x implies also X, y, and Y, or just X,
when appropriate, and a leading y implies Y when appropriate.

These attributes are discussed in the Graph tutorial:

addtexttrace        addtrace                axis              barwidth
bottom              coordinate              Coordinate        copytexttrace
copytrace           fillcolor               footnote          footnotefg
footnotefont        footnotejustify         gradient          grid
gridfg              gridstyle               gridwidth         left
legend              legendbg                legendfg          legendfont 
legendhlthickness   legendshadowthickness   legendstyle       linecolor   
linestyle           linewidth               mode              movelimit  
referpoint          right                   rule              rulewidth   
selectable          selectdistance          style             subtitle
subtitlefg          subtitlefont            subtitlejustify   symbol
symbolsize          textactivate            titlejustify      top
xaxis               xextent                 xfg               xinc
xlabel              xlabelfont              xlabelheight      xlabeljustify
xlabelout           xlabelwidth             xleft             xlegend
xmajorticksize      xmax                    xmin              xminorticks
xminorticksize      xright                  xsublabel         xsublabeljustify 
xsublabelout        xtickstyle              xtitle            xtitlefg
xtitlefont          xtitlejustify           yaxis             ybottom
ylabeljustify       ylegend                 ymode             ytitlestyle
ytop                zero                    zerofg            zerostyle
zerowidth



The attributes discussed in the Printing tutorial are:

print                 printbottom           printdisbottommargin
printdisfile          printdisfont          printdisleftmargin
printdisorientation   printdisrightmargin   printdisrulewidth
printdisstyle         printdistopmargin     printfile
printfont             printlayout           printleft
printmode             printorientation      printright
printsize             printtop



The other attributes can be found in this list.  Each is discussed in the
tutorial named with it, in the display class whose initial is given after
the name of the tutorial:

acceptfocus: Containers l  active: Data a              ancestors: Containers l
at: Containers l           atsector: Buttons a         b: Containers l
bg: Buttons a              blank: Data a               blink: Data p
blinkrate: Data p          bold: Data p                bound: Buttons a
box: Data p                boxcolor: Data p            buffer: Special c
build: Containers l        C: Buttons a                children: Containers l
class: Buttons a           clear: Data v               col: Data a
colindex: Data m           colindexbg: Data m          collabelrows: Data m
color: Data p              colormap: Data p            colors: Data a
cols: Data a               colsep: Data a              colspace: Data m
copy: Data a               cornerindex: Data m         cornerindexbg: Data m
cursor: Data c             cycle: Data a               def: Data a
delete: Data a             descendents: Containers l   doc: Data a
done: Data a               dynamic: Data a             edit: Data a
editbg: Data a             editfg: Data a              editspace: Data a
evaluate: Data a           execute: Data a             exit: Buttons a
f1 - f12: Buttons a        familytree: Containers l    fg: Buttons a
field: Containers t        fields: Containers t        fill: Special p
firstcol: Data a           firstfield: Containers t    firstrow: Data a
fixedfields: Containers t  fkeys: Buttons a            focus: Containers l
followers: Buttons a       followertree: Buttons a     font: Containers t
foot: Buttons a            freeze: Containers l        geometry: Buttons a
h: Containers l            H: Containers l             head: Buttons a
hide: Buttons a            hl: Buttons a               hlthickness: Buttons a
hscrollbg: Data a          hscrollsize: Data a         icon: Buttons a
iconic: Buttons a          icontitle: Buttons a        in: Data a
index: Data a              indexbg: Data a             insertabove: Data a
insertbelow: Data a        is: Buttons a               justify: Buttons a
key: Data c                keysym: Data p              l: Containers l
label: Buttons a           labelfg: Buttons a          labelfont: Buttons a
leader: Containers l       leftfoot: Buttons a         line: Data p
lockposition: Containers l  locksize: Containers l     lower: Buttons a
mapped: Containers l       margin: Buttons b           na: Data a
naturalsize: Buttons b, Data a                         newshow: Containers l
notify: Data v             out: Data a                 parent: Containers l
pin: Buttons a             position: Containers l      preset: Buttons a
primary: Data v            protect: Data a             protected: Containers t
r: Containers l            R: Buttons a                raise: Buttons a
rband: Data p              rbandbox: Data p            realize: Data a
refer: Data a              refresh: Data a             reparent: Containers l
request: Data v            reshow: Containers l        resize: Containers l
resizeable: Buttons a      respace: Data a             rightfoot: Buttons a
row: Data a                rowbg: Data a               rowindex: Data m
rowindexbg: Data m         rows: Data a                rowsep: Data a
save: Special t            script: Buttons a           scrollbg: Data a
scrollsize: Data a         select: Data a              selectbg: Data a
selectcol: Data m          selectcorner: Data m        selected: Buttons a
selectedfield: Containers t                          selectfield: Containers t
selectrow: Data m          sensitive: Containers l     set: Buttons a 
settings: Buttons a        shadowthickness: Buttons a  shell: Containers l
shelltitle: Buttons a      show: Buttons a             size: Data a
space: Data a              stars: Data a               state: Containers l
stateself: Buttons a       structure: Containers l     t: Containers l
tabfrom: Containers l      tablist: Containers l       tabto: Containers l
3down: Data p              3up: Data p                 title: Buttons a
titledefine: Containers t  titlefg: Buttons a          titlefont: Buttons a
2down: Data p              2up: Data p                 underline: Data p
valid: Special p           validate: Special p         vcol: Containers l
vcols: Containers l        verify: Buttons a           vrow: Containers l
vrows: Containers l        vscrollbg: Data a           vscrollsize: Data a
w: Containers l            W: Containers l             ws: Buttons a
x: Buttons a               X: Containers l             xs: Buttons a
y: Buttons a               Y: Containers l             ys: Buttons a
yx: Buttons a              YX: Containers l            yxs: Buttons a



The savewm attribute has been removed.
@ 1.1 log @Initial revision @ text @d109 1 a109 1 i.e. /usr/local/aplus-fsf-4.18/doc/tutorials @ aplus-fsf-4.22/src/html/tutorials/s.tutorials/introduction.html0000444000265000001440000003657610774505647020533  
                 Introduction to Screen Management Tutorials
                 

Besides this introduction, there are eight tutorials on screen management
topics: Buttons, Data, Menus, Containers, Graphs, Special Input and Displays,
Printing, and s-Context Variables.  They are meant to be studied in the order
just given.  They treat all display classes and all attributes.

These tutorials are intended to be introductory, to enable you to learn the
rudiments of the screen management system, s, and to get started doing some
actual programming in it -- which is itself the best way to learn.
Consequently, they have been kept as simple as reasonably possible:

   Generally, each attribute is discussed in the context of only one display
   class. Some details of its use or its values may be left out.  For example,
   the matrix form for specifying the value of the label attribute is omitted.

   Some complexities are glossed over; therefore, code which behaves in a 
   certain way in an example may not behave in the way you expect under other
   circumstances.  The order in which attributes are specified within a single
   statement, for instance, may have a substantial effect on the resulting
   display.

   All or part of the response of A+ to an input is often omitted.  This
   omission makes it easier to run through an example pressing the F2 key on
   on each input line and eliminates a great deal of repetitive material.  
   You can see the response on the screen in the A+ session log when you 
   execute the examples.  You can reduce the response still further by
   executing s.QUIET1, which suppresses s information messages but not
   error reports.

   Alternate ways of doing things are often not included.  The ones discussed
   are considered common or useful, but there may often be ways that are
   simpler or otherwise more desirable than the ones mentioned here.

You should consult the  A+ Reference Manual  when you need to know whether a
certain attribute applies to a particular display class or what the full set
of its possible values is, when there seems to be some inconsistency, when you
want to do something that seems difficult or impossible from the descriptions
given here, and so on.  After you have absorbed the material in the tutorials,
it might be helpful to browse in the manual, or even read it through.

If you get an A+ error message and a star in the next prompt, perhaps because
you pressed F2 on an output line or a line of text or you entered an
erroneous statement, you should immediately clear the error by entering .  To
enter this character, press the right-bracket key while holding down the Meta
key (on Sun keyboards) or the Alt key (on IBM keyboards).  There are two
equivalent Meta keys, usually marked with diamonds and located on either side
of the space bar.  The right bracket key is the second one to the right of
"p".  ( "[ ]" are brackets, "( )" are parentheses, and "{ }" are braces.)

If your session gets messed up for some reason or other, enter $off, press F4
when the session has ended, execute the $load s, scr..., and br{...}:...
statements, and go on either from the beginning or from the spot where the
variables and functions you need in order to continue are defined; this is
often right after previously used variables have been expunged (using _ex).



Visibility

One problem in an s tutorial is maintaining the visibility of the tutorial and
the A+ session log, despite the displays.  To do this as much as possible, we
keep the displays at the bottom right.  Your Emacs session should be at the
top left of your screen, and you should have just the tutorial showing in it
initially.  Then you press F4, starting A+ if necessary and displaying the A+
buffer below the tutorial buffer.

When point in the A+ buffer (the location where the cursor would be if it were
in that buffer) is not at the end of the file, the buffer does not scroll as
you press F2 with the cursor in a line of the tutorial.  Consequently, the
current line in the A+ log will go off the bottom of the buffer and become
invisible.  To remedy this situation, move point to the end.  One way to do
this is to press R2, End, R2.  Another way is to click the left mouse button
with the pointer on the last line of the log and then to return by clicking
with the pointer in the appropriate line of the tutorial; if the end of the
log is not visible, click with the pointer anywhere in the log and press End,
then return.



Display Classes and Attributes


The A+ screen management system, called s, includes twenty-four "display
classes" in Version 2.  These classes are intended for various purposes, and
they display or use the values of various kinds of A+ variables or functions.
The immediately obvious differences among them are in appearance.

There are eight tutorials on the display classes, grouping ones that are
similar, and treating separately the most elaborate one (graphs), the
printing utility, and the variables that control defaults.  All except
the one on graphs are in the same directory as this introduction,
(Install_Directory)/doc/tutorials

By default the Install_Directory is /usr/local/aplus-fsf-x.xx 
(where x.xx is version.release)

i.e. /usr/local/aplus-fsf-4.22/doc/tutorials

Their names and their coverage are:

  * buttons, the classes showing arrays of buttons: action, button, check, and
    radio;

  * data, the classes for ordinary data display and, for some of them, input:
    array, label, matrix, page, slot, view;

  * menus, the classes showing menus, immediately or on request: choice,
    hmenu, vmenu;

  * containers, the classes which enclose other classes: hpane, layout,
    table, vpane, and window;

  * graph, an elaborate container class that deserves its own tutorial;

  * special_io, the classes for special text input of various kinds
    -- command, password, text -- and special kinds of display -- scalar,
    tree.

  * printing, the facilities that enable you to put an image of a display in a
    Postscript file, suitable for printing;

  * s_context_vars, the means for setting defaults.



Associated with a displayed variable are "attributes", which play a very
important role in s.  They are set using the  is  and  has  functions and 
queried using the  of  function, as you will see in the Buttons tutorial.

We can distinguish five typical kinds of attribute:

  * Attributes that are for reference only.  Values cannot be specified for
    them; they can only be queried.

  * At the other extreme, attributes that are only triggers for action.  Such
    an attribute triggers its action whenever any value is specified for it.
    Specifying the Null (no apparent value) or perhaps 1 for them might make
    your code as clear as possible; when you are setting only one attribute
    you can simply say  `a has `attr.  Some of the action attributes do not
    retain a value and cannot be queried.

  * Attributes that govern yes/no or on/off decisions.  They effectively
    accept just boolean values, 1 and 0.  For some of them, specifying the
    Null directs s to use the boolean value of an associated variable.

  * Attributes whose values are members of some well-defined set, such as
    left, right, top, bottom.

  * Attributes whose values lie in a range of numbers or are arbitrary text.

Furthermore, an attribute can be

  * persistent, meaning that values can be specified and are retained when a
    variable is not bound to a display class; and, independently,

  * functional, meaning that a function can be specified for the attribute,
    not just a (data) value or a variable.

Each individual attribute is discussed either in the tutorial on printing or
with the first display class for which it is truly relevant or most general or
useful for an example.


If you want to review what was said about an attribute, or if you are not new
to s and want to learn about a particular attribute, consult the following
lists.  They tell you where a discussion of it can be found: in which
tutorials and, in the third list, which sections.



In attributes for graphs, a leading x implies also X, y, and Y, or just X,
when appropriate, and a leading y implies Y when appropriate.

These attributes are discussed in the Graph tutorial:

addtexttrace        addtrace                axis              barwidth
bottom              coordinate              Coordinate        copytexttrace
copytrace           fillcolor               footnote          footnotefg
footnotefont        footnotejustify         gradient          grid
gridfg              gridstyle               gridwidth         left
legend              legendbg                legendfg          legendfont 
legendhlthickness   legendshadowthickness   legendstyle       linecolor   
linestyle           linewidth               mode              movelimit  
referpoint          right                   rule              rulewidth   
selectable          selectdistance          style             subtitle
subtitlefg          subtitlefont            subtitlejustify   symbol
symbolsize          textactivate            titlejustify      top
xaxis               xextent                 xfg               xinc
xlabel              xlabelfont              xlabelheight      xlabeljustify
xlabelout           xlabelwidth             xleft             xlegend
xmajorticksize      xmax                    xmin              xminorticks
xminorticksize      xright                  xsublabel         xsublabeljustify 
xsublabelout        xtickstyle              xtitle            xtitlefg
xtitlefont          xtitlejustify           yaxis             ybottom
ylabeljustify       ylegend                 ymode             ytitlestyle
ytop                zero                    zerofg            zerostyle
zerowidth



The attributes discussed in the Printing tutorial are:

print                 printbottom           printdisbottommargin
printdisfile          printdisfont          printdisleftmargin
printdisorientation   printdisrightmargin   printdisrulewidth
printdisstyle         printdistopmargin     printfile
printfont             printlayout           printleft
printmode             printorientation      printright
printsize             printtop



The other attributes can be found in this list.  Each is discussed in the
tutorial named with it, in the display class whose initial is given after
the name of the tutorial:

acceptfocus: Containers l  active: Data a              ancestors: Containers l
at: Containers l           atsector: Buttons a         b: Containers l
bg: Buttons a              blank: Data a               blink: Data p
blinkrate: Data p          bold: Data p                bound: Buttons a
box: Data p                boxcolor: Data p            buffer: Special c
build: Containers l        C: Buttons a                children: Containers l
class: Buttons a           clear: Data v               col: Data a
colindex: Data m           colindexbg: Data m          collabelrows: Data m
color: Data p              colormap: Data p            colors: Data a
cols: Data a               colsep: Data a              colspace: Data m
copy: Data a               cornerindex: Data m         cornerindexbg: Data m
cursor: Data c             cycle: Data a               def: Data a
delete: Data a             descendents: Containers l   doc: Data a
done: Data a               dynamic: Data a             edit: Data a
editbg: Data a             editfg: Data a              editspace: Data a
evaluate: Data a           execute: Data a             exit: Buttons a
f1 - f12: Buttons a        familytree: Containers l    fg: Buttons a
field: Containers t        fields: Containers t        fill: Special p
firstcol: Data a           firstfield: Containers t    firstrow: Data a
fixedfields: Containers t  fkeys: Buttons a            focus: Containers l
followers: Buttons a       followertree: Buttons a     font: Containers t
foot: Buttons a            freeze: Containers l        geometry: Buttons a
h: Containers l            H: Containers l             head: Buttons a
hide: Buttons a            hl: Buttons a               hlthickness: Buttons a
hscrollbg: Data a          hscrollsize: Data a         icon: Buttons a
iconic: Buttons a          icontitle: Buttons a        in: Data a
index: Data a              indexbg: Data a             insertabove: Data a
insertbelow: Data a        is: Buttons a               justify: Buttons a
key: Data c                keysym: Data p              l: Containers l
label: Buttons a           labelfg: Buttons a          labelfont: Buttons a
leader: Containers l       leftfoot: Buttons a         line: Data p
lockposition: Containers l  locksize: Containers l     lower: Buttons a
mapped: Containers l       margin: Buttons b           na: Data a
naturalsize: Buttons b, Data a                         newshow: Containers l
notify: Data v             out: Data a                 parent: Containers l
pin: Buttons a             position: Containers l      preset: Buttons a
primary: Data v            protect: Data a             protected: Containers t
r: Containers l            R: Buttons a                raise: Buttons a
rband: Data p              rbandbox: Data p            realize: Data a
refer: Data a              refresh: Data a             reparent: Containers l
request: Data v            reshow: Containers l        resize: Containers l
resizeable: Buttons a      respace: Data a             rightfoot: Buttons a
row: Data a                rowbg: Data a               rowindex: Data m
rowindexbg: Data m         rows: Data a                rowsep: Data a
save: Special t            script: Buttons a           scrollbg: Data a
scrollsize: Data a         select: Data a              selectbg: Data a
selectcol: Data m          selectcorner: Data m        selected: Buttons a
selectedfield: Containers t                          selectfield: Containers t
selectrow: Data m          sensitive: Containers l     set: Buttons a 
settings: Buttons a        shadowthickness: Buttons a  shell: Containers l
shelltitle: Buttons a      show: Buttons a             size: Data a
space: Data a              stars: Data a               state: Containers l
stateself: Buttons a       structure: Containers l     t: Containers l
tabfrom: Containers l      tablist: Containers l       tabto: Containers l
3down: Data p              3up: Data p                 title: Buttons a
titledefine: Containers t  titlefg: Buttons a          titlefont: Buttons a
2down: Data p              2up: Data p                 underline: Data p
valid: Special p           validate: Special p         vcol: Containers l
vcols: Containers l        verify: Buttons a           vrow: Containers l
vrows: Containers l        vscrollbg: Data a           vscrollsize: Data a
w: Containers l            W: Containers l             ws: Buttons a
x: Buttons a               X: Containers l             xs: Buttons a
y: Buttons a               Y: Containers l             ys: Buttons a
yx: Buttons a              YX: Containers l            yxs: Buttons a



The savewm attribute has been removed.
aplus-fsf-4.22/src/html/tutorials/t.tutorial/0000777000265000001440000000000010774506145015001 5aplus-fsf-4.22/src/html/tutorials/t.tutorial/files/0000777000265000001440000000000007424067561016105 5aplus-fsf-4.22/src/html/tutorials/t.tutorial/files/act.act_name0000444000265000001440000000061006106725542020250 OOO G C C C CCC C C C C C CManage/AdviseRequirement AnalysisDefine SpecsLead Program/DesignDocument ProgramsDescribe LogicCode ProgramsTest ProgramsDebug ProgramsTrain UsersSupport UsersDocument Systemsaplus-fsf-4.22/src/html/tutorials/t.tutorial/files/act.act_no0000444000265000001440000000015006106725542017743  (2<FPZdxaplus-fsf-4.22/src/html/tutorials/t.tutorial/files/act.code0000444000265000001440000000020106106725543017410 H  MANAGEREQAN DEFINELEADPRDOCPR LOGIC CODE TEST DEBUG TRAIN SUPP DOCSYSaplus-fsf-4.22/src/html/tutorials/t.tutorial/files/assign.act_no0000444000265000001440000000017006106725543020463 0 10 150 150 170 170 190 230 230ZdZ <<FF<FPFPaplus-fsf-4.22/src/html/tutorials/t.tutorial/files/assign.emp_no0000444000265000001440000000017006106725543020475  aplus-fsf-4.22/src/html/tutorials/t.tutorial/files/assign.length0000444000265000001440000000027006106725543020502 ????????????????aplus-fsf-4.22/src/html/tutorials/t.tutorial/files/assign.proj_no0000444000265000001440000000023106106725544020665 `Document ProgramsDescribe LoIF1000IF1000IF1000MA2100MA2100MA2112MA2112MA2112MA2112MA2112AD3111AD3111AD3111AD3111AD3111AD3111aplus-fsf-4.22/src/html/tutorials/t.tutorial/files/dept.dept_name0000444000265000001440000000056606106725544020636 === G CCCCCCCC C CSpiffy Computer Service Div.PlanningInformation CenterDevelopment CenterSupport ServicesManufacturing SystemsAdministration SystemsOrder Processing SystemsOperationsSoftware Supportaplus-fsf-4.22/src/html/tutorials/t.tutorial/files/dept.dept_no0000444000265000001440000000012706106725544020323   A00B01C01D01E01D11D21D31E11E21aplus-fsf-4.22/src/html/tutorials/t.tutorial/files/dept.mgr0000444000265000001440000000014006106725544017453  tems";"Administration Systems"; e62<Fe6Ze6aplus-fsf-4.22/src/html/tutorials/t.tutorial/files/dept.supdept0000444000265000001440000000012706106725544020357   A00A00A00A00D01D01D01E01E01aplus-fsf-4.22/src/html/tutorials/t.tutorial/files/emp.commission0000444000265000001440000000020006106725544020670 e6e6e6e6e6e6e6e6e6e6e6e6e6e6e6EV aplus-fsf-4.22/src/html/tutorials/t.tutorial/files/emp.dept_no0000444000265000001440000000015706106725545020154 65 38250 36250 36170 35750 38A00B01C01E01D11D21E11A00C01C01D11D11D11D21D21D31D31D31aplus-fsf-4.22/src/html/tutorials/t.tutorial/files/emp.emp_name0000444000265000001440000000063406106725545020305 cccGCCCCCC C C CCC C C C CCCCHaasThompsonKwanGeyerSternPulaskiHendersonLucchessiQuintanaNichollsAdamsonYoshimuraWalkerJeffersonMarinoParkerSmithSetrightaplus-fsf-4.22/src/html/tutorials/t.tutorial/files/emp.emp_no0000444000265000001440000000020006106725545017766  2<FZn",6aplus-fsf-4.22/src/html/tutorials/t.tutorial/files/emp.hire_date0000444000265000001440000000020006106725546020436  u ' sE}A '" 8 ۤ H  T s Mv   7 ǐaplus-fsf-4.22/src/html/tutorials/t.tutorial/files/emp.salary0000444000265000001440000000020006106725546020005 "jJ\vHpOV;e6>aplus-fsf-4.22/src/html/tutorials/t.tutorial/files/emp.sex0000444000265000001440000000011306106725546017314 5 38250 36250 36170 35750 38fmfmmffmffmmmmmmmfaplus-fsf-4.22/src/html/tutorials/t.tutorial/files/proj.dept_no0000444000265000001440000000012706106725546020343   D01D21D21D21C01D01D11E01E11B01aplus-fsf-4.22/src/html/tutorials/t.tutorial/files/proj.head0000444000265000001440000000014006106725546017607  rvices";"Gen Ad Systems";"Payrol F 2Zaplus-fsf-4.22/src/html/tutorials/t.tutorial/files/proj.major_proj0000444000265000001440000000016506106725547021060 <  AD3100AD3110AD3110 MA2110 OP1000MA2100aplus-fsf-4.22/src/html/tutorials/t.tutorial/files/proj.pstaff0000444000265000001440000000021006106725547020170  @@@?@@(@@@?aplus-fsf-4.22/src/html/tutorials/t.tutorial/files/proj.proj_name0000444000265000001440000000054206106725547020667 ))) G CCCCCCCC C CAdmin ServicesGen Ad SystemsPayroll ProgrammingPersonnel ProgrammingQuery ServicesWeld Line AutomationW L ProgrammingOperation SupportOperationWeld Line Planningaplus-fsf-4.22/src/html/tutorials/t.tutorial/files/proj.proj_no0000444000265000001440000000016506106725547020364 <  AD3100AD3110AD3111AD3112IF1000MA2100MA2112OP1000OP1010PL2100aplus-fsf-4.22/src/html/tutorials/t.tutorial/files/tasks.act_no0000444000265000001440000000016006106725547020327  <FZd FF<P<aplus-fsf-4.22/src/html/tutorials/t.tutorial/files/tasks.proj_no0000444000265000001440000000021506106725550020525 TMA2100MA2100MA2112MA2112MA2112IF1000IF1000IF1000AD3110AD3111AD3111AD3111AD3111AD3112aplus-fsf-4.22/src/html/tutorials/t.tutorial/files/tasks.staff0000444000265000001440000000025006106725550020161 2100 `MA2112 `MA2112 `MA2112 `IF??@????????陙???aplus-fsf-4.22/src/html/tutorials/t.tutorial/files/Makefile.am0000444000265000001440000000306307424067522020052 ## Process this file with automake to produce Makefile.in ############################################################################### ## ## ## Copyright (c) 2001 Morgan Stanley Dean Witter and Co. ## ## See ..../src/LICENSE for terms of distribution. ## ## ## ## ## ############################################################################### SUBDIRS = files_t_tutorialsdir = $(prefix)/doc/html/tutorials/t.tutorial/files files_t_tutorials_DATA = \ act.act_name \ act.act_no \ act.code \ assign.act_no \ assign.emp_no \ assign.length \ assign.proj_no \ dept.dept_name \ dept.dept_no \ dept.mgr \ dept.supdept \ emp.commission \ emp.dept_no \ emp.emp_name \ emp.emp_no \ emp.hire_date \ emp.salary \ emp.sex \ proj.dept_no \ proj.head \ proj.major_proj \ proj.proj_name \ proj.proj_no \ proj.pstaff \ tasks.act_no \ tasks.proj_no \ tasks.staff EXTRA_DIST = \ act.act_name \ act.act_no \ act.code \ assign.act_no \ assign.emp_no \ assign.length \ assign.proj_no \ dept.dept_name \ dept.dept_no \ dept.mgr \ dept.supdept \ emp.commission \ emp.dept_no \ emp.emp_name \ emp.emp_no \ emp.hire_date \ emp.salary \ emp.sex \ proj.dept_no \ proj.head \ proj.major_proj \ proj.proj_name \ proj.proj_no \ proj.pstaff \ tasks.act_no \ tasks.proj_no \ tasks.staff aplus-fsf-4.22/src/html/tutorials/t.tutorial/README0000444000265000001440000000203206106725550015565 These files correspond to the examples in Chapter 58: The T Context of the A+ Reference manual; that chapter serves as the text for this tutorial. File Comments preamble.+ Make sure this is loaded before you do any work. If you make personal copies of these files, change the directory variable in this file to point to the source files of the tables (see files.+ below).. activities.+ This and the five files that follow create the tables assignments.+ with the same names as the file names. departments.+ employees.+ projects.+ tasks.+ model.+ Load all the tables. If you make personal copies of these files, change the table_directory variable in this file. files.+ Create the files. Use the file to create personal copies of the table source files (or simply copy them). Change the directory variable to the directory where the source files will reside. examples.+ The examples in the t context documentation. aplus-fsf-4.22/src/html/tutorials/t.tutorial/activities.+0000444000265000001440000000037006106725550017130 Activities. x(`activities;directory); y(`act_no;"0act.act_no"; `code;"0act.code"; `act_name;"1act.act_name"); x t.open y; activities.act_name¡activities.act_name on_screen{`activities;`act_no`code`act_name;8 6 21} aplus-fsf-4.22/src/html/tutorials/t.tutorial/assignments.+0000444000265000001440000000040206106725551017314 Assignments. x(`assignments;directory); y(`emp_no;"0assign.emp_no"; `proj_no;"0assign.proj_no"; `act_no;"0assign.act_no"; `length;"0assign.length"); x t.open y; on_screen{`assignments; `emp_no`proj_no`act_no`length;8 9 8 8} aplus-fsf-4.22/src/html/tutorials/t.tutorial/departments.+0000444000265000001440000000046206106725551017315 Departments. x(`departments;directory); y(`dept_no;"0dept.dept_no"; `dept_name;"1dept.dept_name"; `mgr;"0dept.mgr"; `supdept;"0dept.supdept"); x t.open y; departments.dept_name¡departments.dept_name on_screen{`departments; `dept_no`dept_name`mgr`supdept;9 29 5 9} aplus-fsf-4.22/src/html/tutorials/t.tutorial/employees.+0000444000265000001440000000064606106725552016776 Employees. x(`employees;directory); y(`emp_no;"0emp.emp_no"; `emp_name;"1emp.emp_name"; `dept_no;"0emp.dept_no"; `hire_date;"0emp.hire_date"; `sex;"0emp.sex"; `salary;"0emp.salary"; `commission;"0emp.commission"); x t.open y; employees.emp_name¡employees.emp_name on_screen{`employees; `emp_no`emp_name`dept_no`hire_date`sex`salary`commission; 10 11 9 11 5 8 12} aplus-fsf-4.22/src/html/tutorials/t.tutorial/examples.+0000444000265000001440000001215310774506055016607 Here are the examples in the The t Context document. First load a setup file, and then initialize the departments and employees base tables. _load '/usr/local/aplus-fsf-4.22/doc/tutorials/t.tutorial/preamble.+' _load '/usr/local/aplus-fsf-4.22/doc/tutorials/t.tutorial/departments.+' _load '/usr/local/aplus-fsf-4.22/doc/tutorials/t.tutorial/employees.+' Examples Restriction and Projection `employees `r_view t.only 'dept_no3 3"D11D21D31"' `employees `r_view t.send () on_screen{`r_view; `emp_no`emp_name`dept_no`hire_date`sex`salary`commission; 10 11 9 11 5 8 12} `employees `p_view t.only () `employees `p_view t.send `emp_no `emp_name `salary on_screen{`p_view; `emp_no`emp_name`salary; 10 11 8} `employees `rp_view t.only 'dept_no3 3"D11D21D31"' `employees `rp_view t.send `emp_no`emp_name`salary on_screen{`rp_view; `emp_no`emp_name`salary; 10 11 8} Break Fields and Break Functions `employees `bd_view t.break `dept_no `employees `bd_view t.send (`dept_no;(`_func`_frame;(;':@1dept_no'))) `employees `bd_view t.send (`salary;/) `employees `bd_view t.send (`emp_no;<) bd_view.dept_no bd_view.salary bd_view.emp_no Map from employees to bd_view: D{x}:((xx)=#x)/x OE{x;y}:x@1 1 0 y (<@1 (D employees.dept_no)OE employees.dept_no)/<#employees.dept_no bd_view._J Breaks by Intervals `employees `e_view t.only () `employees `e_view t.send `emp_no`emp_name`salary `e_view t.define (`min_range;(`.;'1+5000employees.salary5000'; `na;`intt.NA)) `e_view t.define (`max_range;(`.;'5000employees.salary5000'; `na;`floatt.NA)) `e_view `i_view t.break (`salary;500012) `e_view `i_view t.send (`min_range;;`max_range;; `salary_count;(`salary;#)) on_screen{`e_view; `emp_no `emp_name `min_range `max_range `salary; 10 11 8 8 8} on_screen{`i_view; `min_range`max_range`salary; 8 8 8} Join and Division `departments `employees t.link `dept_no `departments `employees t.send `dept_name `employees `query1 t.only () `employees `query1 t.send `emp_name `dept_name on_screen{`query1;`emp_name `dept_name;11 29} `employees `departments t.send (`salary;/) `departments `query2 t.only () `departments `query2 t.send `dept_name `salary on_screen{`query2;`dept_name `salary; 29 14} Map from departments to employees: departments.dept_noemployees.dept_no employees._I_departments Map from employees to departments: (<@1 departments.dept_no OE employees.dept_no)/<#employees.dept_no departments._J_employees Set Union, Intersection, and Difference `employees `salary t.only () `employees `salary t.send () `salary t.only 'salary`intt.NA' `employees `commission t.only () `employees `commission t.send () `commission t.only 'commission`intt.NA' on_screen{`salary; `emp_no`emp_name`dept_no`hire_date`sex`salary`commission; 10 11 9 11 5 8 12} on_screen{`commission; `emp_no`emp_name`dept_no`hire_date`sex`salary`commission; 10 11 9 11 5 8 12} `salary `commission t.link salary._T `salary `commission t.link () `commission `intersection t.only 'commission._I_salarysalary._N' `commission `intersection t.send () on_screen{`intersection; `emp_no`emp_name`dept_no`hire_date`sex`salary`commission; 10 11 9 11 5 8 12} `commission `comm_minus_sal t.not 'commission._I_salarysalary._N' `commission `comm_minus_sal t.send () on_screen{`comm_minus_sal; `emp_no`emp_name`dept_no`hire_date`sex`salary`commission; 10 11 9 11 5 8 12} `salary `comm_minus_sal `union t.cat () `salary `comm_minus_sal `union t.send () on_screen{`union; `emp_no`emp_name`dept_no`hire_date`sex`salary`commission; 10 11 9 11 5 8 12} `salary `sal_minus_comm t.only '~>#salary._J_commission' `salary `sal_minus_comm t.send () on_screen{`sal_minus_comm; `emp_no`emp_name`dept_no`hire_date`sex`salary`commission; 10 11 9 11 5 8 12} Outer Union `employees `salary1 t.only 'salary`intt.NA' `employees `salary1 t.send (employees._T`commission)/employees._T `employees `commission1 t.only 'commission`intt.NA' `employees `commission1 t.send (employees._T`salary)/employees._T `salary1 `commission1 t.link (salary1._T`salary)/salary1._T `salary1 `commission1 t.send `salary `commission1 `salary1 t.send (`commission;) on_screen{`salary1; `emp_no`emp_name`dept_no`hire_date`sex`salary`commission; 10 11 9 11 5 8 12} on_screen{`commission1; `emp_no`emp_name`dept_no`hire_date`sex`salary`commission; 10 11 9 11 5 8 12} Relational Product and Row Catenation `employees `v_employees t.only '1810' `employees `v_employees t.send () `departments `v_departments t.only () `departments `v_departments t.send () `v_employees t.define (`index;'18010') `v_departments t.define (`index;'10') `v_departments `v_employees t.link `index `v_departments `v_employees t.send `dept_name `mgr `supdept `v_departments `v_employees t.send (`dept_dept_no;<(`dept_no;0;;)) `v_employees `product t.only () `v_employees `product t.send (v_employees._T`index)/v_employees._T on_screen{`product;product._T;10 11 9 11 5 8 12 14 29 5 9} aplus-fsf-4.22/src/html/tutorials/t.tutorial/files.+0000444000265000001440000000774710774506077016114 directory'/usr/local/aplus-fsf-4.22/doc/tutorials/t.tutorial/files/' NA999999999 $cx activities act_no10 20 30 40 50 60 70 80 90 100 120 180 code(`MANAGE `REQAN `DEFINE `LEADPR `DOCPR `LOGIC `CODE `TEST `DEBUG `TRAIN `SUPP `DOCSYS) act_name("Manage/Advise";"Requirement Analysis";"Define Specs"; "Lead Program/Design";"Document Programs"; "Describe Logic";"Code Programs";"Test Programs"; "Debug Programs";"Train Users";"Support Users"; "Document Systems") (.directory,"act.act_no")act_no (.directory,"act.code")code (.directory,"act.act_name")sys.exp act_name $cx assignments emp_no130 130 140 10 10 150 150 170 170 190 230 230 230 230 240 240 proj_no(`IF1000 `IF1000 `IF1000 `MA2100 `MA2100 `MA2112 `MA2112 `MA2112 `MA2112 `MA2112,6`AD3111) act_no90 100 90 10 20 60 180 60 70 70 60 70 80 180 70 80 length1 0.5 0.5 0.5 1 1 1 1 1 1 1 0.5 0.5 1 1 1 (.directory,'assign.emp_no')emp_no (.directory,'assign.proj_no')proj_no (.directory,'assign.act_no')act_no (.directory,'assign.length')length $cx departments dept_no`A00 `B01 `C01 `D01 `E01 `D11 `D21 `D31 `E11 `E21 dept_name("Spiffy Computer Service Div.";"Planning"; "Information Center";"Development Center";"Support Services"; "Manufacturing Systems";"Administration Systems"; "Order Processing Systems";"Operations";"Software Support") mgr10 20 30,.NA,50 60 70,.NA,90,.NA supdept` `A00 `A00 `A00 `A00 `D01 `D01 `D01 `E01 `E01 (.directory,'dept.dept_no')dept_no (.directory,'dept.dept_name')sys.exp dept_name (.directory,'dept.mgr')mgr (.directory,'dept.supdept')supdept $cx employees emp_no(10 20 30 50 60 70 90 110 130 140 150 170 190 230 240 290 300 310) emp_name("Haas";"Thompson";"Kwan";"Geyer";"Stern";"Pulaski"; "Henderson";"Lucchessi";"Quintana";"Nicholls"; "Adamson";"Yoshimura";"Walker";"Jefferson";"Marino"; "Parker";"Smith";"Setright") dept_no(`A00 `B01 `C01 `E01 `D11 `D21 `E11 `A00 `C01 `C01 `D11 `D11 `D11 `D21 `D21 `D31 `D31 `D31) hire_date(650101 731010 750405 490817 730914 800930 700815 580516 710728 761215 720212 780915 740726 661121 791205 800530 720619 640912) sex`f `m `f `m `m `f `f `m `f `f `m `m `m `m `m `m `m `f salary(52750 41250 40175 38250 36250 36170 35750 38170 33800 35420 30280 28680 20450 22180 33760 15340,.NA,15900) commission(15.NA),4780 17750 3200 (.directory,'emp.emp_no')emp_no (.directory,'emp.emp_name')sys.exp emp_name (.directory,'emp.dept_no')dept_no (.directory,'emp.hire_date')hire_date (.directory,'emp.sex')sex (.directory,'emp.salary')salary (.directory,'emp.commission')commission $cx projects proj_no(`AD3100 `AD3110 `AD3111 `AD3112 `IF1000 `MA2100 `MA2112 `OP1000 `OP1010 `PL2100) proj_name("Admin Services";"Gen Ad Systems";"Payroll Programming"; "Personnel Programming";"Query Services"; "Weld Line Automation";"W L Programming"; "Operation Support";"Operation";"Weld Line Planning") dept_no`D01 `D21 `D21 `D21 `C01 `D01 `D11 `E01 `E11 `B01 head_no10 70 230 250 30 10 150 50 90 20 pstaff6.5 6 2 1 2 12 3 6 5 1 major_proj` `AD3100 `AD3110 `AD3110 ` ` `MA2110 ` `OP1000 `MA2100 (.directory,'proj.proj_no')proj_no (.directory,'proj.proj_name')sys.exp proj_name (.directory,'proj.dept_no')dept_no (.directory,'proj.head')head_no (.directory,'proj.pstaff')pstaff (.directory,'proj.major_proj')major_proj $cx tasks proj_no(`MA2100 `MA2100 `MA2112 `MA2112 `MA2112 `IF1000 `IF1000 `IF1000 `AD3110 `AD3111 `AD3111 `AD3111 `AD3111 `AD3112) act_no10 20 60 180 70 90 100 10 70 70 60 180 80 60 staff0.5 1 2 1 1.5 1 0.5 0.5 1.5 1.5 0.8 1 0.125 0.75 (.directory,'tasks.proj_no')proj_no (.directory,'tasks.act_no')act_no (.directory,'tasks.staff')staff aplus-fsf-4.22/src/html/tutorials/t.tutorial/model.+0000444000265000001440000000047710774506111016070 table_directory'/usr/local/aplus-fsf-4.22/doc/tutorials/t.tutorial/' _load table_directory,'preamble' _load table_directory,'activities' _load table_directory,'assignments' _load table_directory,'departments' _load table_directory,'employees' _load table_directory,'projects' _load table_directory,'tasks' aplus-fsf-4.22/src/html/tutorials/t.tutorial/preamble.+0000444000265000001440000000176110774506122016556 directory"/usr/local/aplus-fsf-4.22/doc/tutorials/t.tutorial/files/" Load t. $load t Utilities. pair{x;y}:(x;y) out_fn{s;d;i;p;c;v}:{if ((d)`int`float) { if ((dŢInf Inf)d=(d)t.NA) ' ' else 1d } else d} on_screen{table;fields;widths}:{ (%`table)tablefields; (`table) is `table; (`table) has (`titlefont;'helvetica-bold-14'); (%`table) has<(`titlefont;'helvetica-10'); (%`table) has<(`font;'helvetica-10'); (`table) has (`iconic;0); if (0#widths) (%`table) has pair{`space;widths1014}; (%`table) has pair{`title;fields}; (%`table) has <(`out;out_fn); (`table) has (`rows`cols;(25table%`_N;#%table)); show `table; } on_screen_update{table}:{ stabletable%`_T; s(~s%`table)/s; (%`table)(%`table),s; s has<(`titlefont;'helvetica10'); s has<(`font;'helvetica10'); s has <(`out;out_fn); (`table) has (`rows`cols;(25table%`_N;#%table)); show `table; } Setup. s.AUTOWS0 aplus-fsf-4.22/src/html/tutorials/t.tutorial/projects.+0000444000265000001440000000060706106725553016623 Projects. x(`projects;directory); y( `proj_no;"0proj.proj_no"; `proj_name;"1proj.proj_name"; `dept_no;"0proj.dept_no"; `head;"0proj.head"; `pstaff;"0proj.pstaff"; `major_proj;"0proj.major_proj"); x t.open y; projects.proj_name¡projects.proj_name on_screen{`projects; `proj_no`proj_name`dept_no`head`pstaff`major_proj; 9 22 9 6 8 12} aplus-fsf-4.22/src/html/tutorials/t.tutorial/tasks.+0000444000265000001440000000030106106725553016106 Tasks. x(`tasks;directory); y(`proj_no;"0tasks.proj_no"; `act_no;"0tasks.act_no"; `staff;"0tasks.staff"); x t.open y; on_screen{`tasks;`proj_no`act_no`staff; 9 8 7} aplus-fsf-4.22/src/html/tutorials/t.tutorial/Makefile.am0000444000265000001440000000200507424067646016752 ## Process this file with automake to produce Makefile.in ############################################################################### ## ## ## Copyright (c) 2001 Morgan Stanley Dean Witter and Co. ## ## See ..../src/LICENSE for terms of distribution. ## ## ## ## ## ############################################################################### SUBDIRS = files t_tutorialsdir = $(prefix)/doc/html/tutorials/t.tutorial t_tutorials_DATA = \ README \ activities.+ \ assignments.+ \ departments.+ \ employees.+ \ examples.+ \ files.+ \ model.+ \ preamble.+ \ projects.+ \ tasks.+ EXTRA_DIST = \ README \ activities.+ \ assignments.+ \ departments.+ \ employees.+ \ examples.+ \ files.+ \ model.+ \ preamble.+ \ projects.+ \ tasks.+ aplus-fsf-4.22/src/html/tutorials/t.tutorial/RCS/0000777000265000001440000000000010774506145015430 5aplus-fsf-4.22/src/html/tutorials/t.tutorial/RCS/examples.+,v0000444000265000001440000001320410774506143017474 head 1.2; access; symbols; locks; strict; comment @# @; 1.2 date 2008.04.01.19.26.27; author jmiz; state Exp; branches; next 1.1; 1.1 date 2008.04.01.19.24.58; author jmiz; state Exp; branches; next ; desc @@ 1.2 log @*** empty log message *** @ text @ Here are the examples in the The t Context document. First load a setup file, and then initialize the departments and employees base tables. _load '/usr/local/aplus-fsf-4.22/doc/tutorials/t.tutorial/preamble.+' _load '/usr/local/aplus-fsf-4.22/doc/tutorials/t.tutorial/departments.+' _load '/usr/local/aplus-fsf-4.22/doc/tutorials/t.tutorial/employees.+' Examples Restriction and Projection `employees `r_view t.only 'dept_no3 3"D11D21D31"' `employees `r_view t.send () on_screen{`r_view; `emp_no`emp_name`dept_no`hire_date`sex`salary`commission; 10 11 9 11 5 8 12} `employees `p_view t.only () `employees `p_view t.send `emp_no `emp_name `salary on_screen{`p_view; `emp_no`emp_name`salary; 10 11 8} `employees `rp_view t.only 'dept_no3 3"D11D21D31"' `employees `rp_view t.send `emp_no`emp_name`salary on_screen{`rp_view; `emp_no`emp_name`salary; 10 11 8} Break Fields and Break Functions `employees `bd_view t.break `dept_no `employees `bd_view t.send (`dept_no;(`_func`_frame;(;':@@1dept_no'))) `employees `bd_view t.send (`salary;/) `employees `bd_view t.send (`emp_no;<) bd_view.dept_no bd_view.salary bd_view.emp_no Map from employees to bd_view: D{x}:((xx)=#x)/x OE{x;y}:x@@1 1 0 y (<@@1 (D employees.dept_no)OE employees.dept_no)/<#employees.dept_no bd_view._J Breaks by Intervals `employees `e_view t.only () `employees `e_view t.send `emp_no`emp_name`salary `e_view t.define (`min_range;(`.;'1+5000employees.salary5000'; `na;`intt.NA)) `e_view t.define (`max_range;(`.;'5000employees.salary5000'; `na;`floatt.NA)) `e_view `i_view t.break (`salary;500012) `e_view `i_view t.send (`min_range;;`max_range;; `salary_count;(`salary;#)) on_screen{`e_view; `emp_no `emp_name `min_range `max_range `salary; 10 11 8 8 8} on_screen{`i_view; `min_range`max_range`salary; 8 8 8} Join and Division `departments `employees t.link `dept_no `departments `employees t.send `dept_name `employees `query1 t.only () `employees `query1 t.send `emp_name `dept_name on_screen{`query1;`emp_name `dept_name;11 29} `employees `departments t.send (`salary;/) `departments `query2 t.only () `departments `query2 t.send `dept_name `salary on_screen{`query2;`dept_name `salary; 29 14} Map from departments to employees: departments.dept_noemployees.dept_no employees._I_departments Map from employees to departments: (<@@1 departments.dept_no OE employees.dept_no)/<#employees.dept_no departments._J_employees Set Union, Intersection, and Difference `employees `salary t.only () `employees `salary t.send () `salary t.only 'salary`intt.NA' `employees `commission t.only () `employees `commission t.send () `commission t.only 'commission`intt.NA' on_screen{`salary; `emp_no`emp_name`dept_no`hire_date`sex`salary`commission; 10 11 9 11 5 8 12} on_screen{`commission; `emp_no`emp_name`dept_no`hire_date`sex`salary`commission; 10 11 9 11 5 8 12} `salary `commission t.link salary._T `salary `commission t.link () `commission `intersection t.only 'commission._I_salarysalary._N' `commission `intersection t.send () on_screen{`intersection; `emp_no`emp_name`dept_no`hire_date`sex`salary`commission; 10 11 9 11 5 8 12} `commission `comm_minus_sal t.not 'commission._I_salarysalary._N' `commission `comm_minus_sal t.send () on_screen{`comm_minus_sal; `emp_no`emp_name`dept_no`hire_date`sex`salary`commission; 10 11 9 11 5 8 12} `salary `comm_minus_sal `union t.cat () `salary `comm_minus_sal `union t.send () on_screen{`union; `emp_no`emp_name`dept_no`hire_date`sex`salary`commission; 10 11 9 11 5 8 12} `salary `sal_minus_comm t.only '~>#salary._J_commission' `salary `sal_minus_comm t.send () on_screen{`sal_minus_comm; `emp_no`emp_name`dept_no`hire_date`sex`salary`commission; 10 11 9 11 5 8 12} Outer Union `employees `salary1 t.only 'salary`intt.NA' `employees `salary1 t.send (employees._T`commission)/employees._T `employees `commission1 t.only 'commission`intt.NA' `employees `commission1 t.send (employees._T`salary)/employees._T `salary1 `commission1 t.link (salary1._T`salary)/salary1._T `salary1 `commission1 t.send `salary `commission1 `salary1 t.send (`commission;) on_screen{`salary1; `emp_no`emp_name`dept_no`hire_date`sex`salary`commission; 10 11 9 11 5 8 12} on_screen{`commission1; `emp_no`emp_name`dept_no`hire_date`sex`salary`commission; 10 11 9 11 5 8 12} Relational Product and Row Catenation `employees `v_employees t.only '1810' `employees `v_employees t.send () `departments `v_departments t.only () `departments `v_departments t.send () `v_employees t.define (`index;'18010') `v_departments t.define (`index;'10') `v_departments `v_employees t.link `index `v_departments `v_employees t.send `dept_name `mgr `supdept `v_departments `v_employees t.send (`dept_dept_no;<(`dept_no;0;;)) `v_employees `product t.only () `v_employees `product t.send (v_employees._T`index)/v_employees._T on_screen{`product;product._T;10 11 9 11 5 8 12 14 29 5 9} @ 1.1 log @Initial revision @ text @d6 2 a7 2 _load '/usr/local/aplus-fsf-4.18/doc/tutorials/t.tutorial/preamble.+' _load '/usr/local/aplus-fsf-4.18/doc/tutorials/t.tutorial/departments.+' d9 1 a9 1 _load '/usr/local/aplus-fsf-4.18/doc/tutorials/t.tutorial/employees.+' @ aplus-fsf-4.22/src/html/tutorials/t.tutorial/RCS/files.+,v0000444000265000001440000001056210774506144016765 head 1.2; access; symbols; locks; strict; comment @# @; 1.2 date 2008.04.01.19.26.27; author jmiz; state Exp; branches; next 1.1; 1.1 date 2008.04.01.19.24.58; author jmiz; state Exp; branches; next ; desc @@ 1.2 log @*** empty log message *** @ text @ directory'/usr/local/aplus-fsf-4.22/doc/tutorials/t.tutorial/files/' NA999999999 $cx activities act_no10 20 30 40 50 60 70 80 90 100 120 180 code(`MANAGE `REQAN `DEFINE `LEADPR `DOCPR `LOGIC `CODE `TEST `DEBUG `TRAIN `SUPP `DOCSYS) act_name("Manage/Advise";"Requirement Analysis";"Define Specs"; "Lead Program/Design";"Document Programs"; "Describe Logic";"Code Programs";"Test Programs"; "Debug Programs";"Train Users";"Support Users"; "Document Systems") (.directory,"act.act_no")act_no (.directory,"act.code")code (.directory,"act.act_name")sys.exp act_name $cx assignments emp_no130 130 140 10 10 150 150 170 170 190 230 230 230 230 240 240 proj_no(`IF1000 `IF1000 `IF1000 `MA2100 `MA2100 `MA2112 `MA2112 `MA2112 `MA2112 `MA2112,6`AD3111) act_no90 100 90 10 20 60 180 60 70 70 60 70 80 180 70 80 length1 0.5 0.5 0.5 1 1 1 1 1 1 1 0.5 0.5 1 1 1 (.directory,'assign.emp_no')emp_no (.directory,'assign.proj_no')proj_no (.directory,'assign.act_no')act_no (.directory,'assign.length')length $cx departments dept_no`A00 `B01 `C01 `D01 `E01 `D11 `D21 `D31 `E11 `E21 dept_name("Spiffy Computer Service Div.";"Planning"; "Information Center";"Development Center";"Support Services"; "Manufacturing Systems";"Administration Systems"; "Order Processing Systems";"Operations";"Software Support") mgr10 20 30,.NA,50 60 70,.NA,90,.NA supdept` `A00 `A00 `A00 `A00 `D01 `D01 `D01 `E01 `E01 (.directory,'dept.dept_no')dept_no (.directory,'dept.dept_name')sys.exp dept_name (.directory,'dept.mgr')mgr (.directory,'dept.supdept')supdept $cx employees emp_no(10 20 30 50 60 70 90 110 130 140 150 170 190 230 240 290 300 310) emp_name("Haas";"Thompson";"Kwan";"Geyer";"Stern";"Pulaski"; "Henderson";"Lucchessi";"Quintana";"Nicholls"; "Adamson";"Yoshimura";"Walker";"Jefferson";"Marino"; "Parker";"Smith";"Setright") dept_no(`A00 `B01 `C01 `E01 `D11 `D21 `E11 `A00 `C01 `C01 `D11 `D11 `D11 `D21 `D21 `D31 `D31 `D31) hire_date(650101 731010 750405 490817 730914 800930 700815 580516 710728 761215 720212 780915 740726 661121 791205 800530 720619 640912) sex`f `m `f `m `m `f `f `m `f `f `m `m `m `m `m `m `m `f salary(52750 41250 40175 38250 36250 36170 35750 38170 33800 35420 30280 28680 20450 22180 33760 15340,.NA,15900) commission(15.NA),4780 17750 3200 (.directory,'emp.emp_no')emp_no (.directory,'emp.emp_name')sys.exp emp_name (.directory,'emp.dept_no')dept_no (.directory,'emp.hire_date')hire_date (.directory,'emp.sex')sex (.directory,'emp.salary')salary (.directory,'emp.commission')commission $cx projects proj_no(`AD3100 `AD3110 `AD3111 `AD3112 `IF1000 `MA2100 `MA2112 `OP1000 `OP1010 `PL2100) proj_name("Admin Services";"Gen Ad Systems";"Payroll Programming"; "Personnel Programming";"Query Services"; "Weld Line Automation";"W L Programming"; "Operation Support";"Operation";"Weld Line Planning") dept_no`D01 `D21 `D21 `D21 `C01 `D01 `D11 `E01 `E11 `B01 head_no10 70 230 250 30 10 150 50 90 20 pstaff6.5 6 2 1 2 12 3 6 5 1 major_proj` `AD3100 `AD3110 `AD3110 ` ` `MA2110 ` `OP1000 `MA2100 (.directory,'proj.proj_no')proj_no (.directory,'proj.proj_name')sys.exp proj_name (.directory,'proj.dept_no')dept_no (.directory,'proj.head')head_no (.directory,'proj.pstaff')pstaff (.directory,'proj.major_proj')major_proj $cx tasks proj_no(`MA2100 `MA2100 `MA2112 `MA2112 `MA2112 `IF1000 `IF1000 `IF1000 `AD3110 `AD3111 `AD3111 `AD3111 `AD3111 `AD3112) act_no10 20 60 180 70 90 100 10 70 70 60 180 80 60 staff0.5 1 2 1 1.5 1 0.5 0.5 1.5 1.5 0.8 1 0.125 0.75 (.directory,'tasks.proj_no')proj_no (.directory,'tasks.act_no')act_no (.directory,'tasks.staff')staff @ 1.1 log @Initial revision @ text @d3 1 a3 1 directory'/usr/local/aplus-fsf-4.18/doc/tutorials/t.tutorial/files/' d135 1 a135 1 @ aplus-fsf-4.22/src/html/tutorials/t.tutorial/RCS/model.+,v0000444000265000001440000000127310774506144016762 head 1.2; access; symbols; locks; strict; comment @# @; 1.2 date 2008.04.01.19.26.27; author jmiz; state Exp; branches; next 1.1; 1.1 date 2008.04.01.19.24.58; author jmiz; state Exp; branches; next ; desc @@ 1.2 log @*** empty log message *** @ text @ table_directory'/usr/local/aplus-fsf-4.22/doc/tutorials/t.tutorial/' _load table_directory,'preamble' _load table_directory,'activities' _load table_directory,'assignments' _load table_directory,'departments' _load table_directory,'employees' _load table_directory,'projects' _load table_directory,'tasks' @ 1.1 log @Initial revision @ text @d2 1 a2 1 table_directory'/usr/local/aplus-fsf-4.18/doc/tutorials/t.tutorial/' @ aplus-fsf-4.22/src/html/tutorials/t.tutorial/RCS/preamble.+,v0000444000265000001440000000255410774506145017455 head 1.2; access; symbols; locks; strict; comment @# @; 1.2 date 2008.04.01.19.26.27; author jmiz; state Exp; branches; next 1.1; 1.1 date 2008.04.01.19.24.58; author jmiz; state Exp; branches; next ; desc @@ 1.2 log @*** empty log message *** @ text @ directory"/usr/local/aplus-fsf-4.22/doc/tutorials/t.tutorial/files/" Load t. $load t Utilities. pair{x;y}:(x;y) out_fn{s;d;i;p;c;v}:{if ((d)`int`float) { if ((dŢInf Inf)d=(d)t.NA) ' ' else 1d } else d} on_screen{table;fields;widths}:{ (%`table)tablefields; (`table) is `table; (`table) has (`titlefont;'helvetica-bold-14'); (%`table) has<(`titlefont;'helvetica-10'); (%`table) has<(`font;'helvetica-10'); (`table) has (`iconic;0); if (0#widths) (%`table) has pair{`space;widths1014}; (%`table) has pair{`title;fields}; (%`table) has <(`out;out_fn); (`table) has (`rows`cols;(25table%`_N;#%table)); show `table; } on_screen_update{table}:{ stabletable%`_T; s(~s%`table)/s; (%`table)(%`table),s; s has<(`titlefont;'helvetica10'); s has<(`font;'helvetica10'); s has <(`out;out_fn); (`table) has (`rows`cols;(25table%`_N;#%table)); show `table; } Setup. s.AUTOWS0 @ 1.1 log @Initial revision @ text @d2 1 a2 1 directory"/usr/local/aplus-fsf-4.18/doc/tutorials/t.tutorial/files/" @ aplus-fsf-4.22/src/html/view.gif0000444000265000001440000002220607215453040012212 GIF87aXpjjj,X0I8ͻ`(dihlp,tmx|pH,Ȥrl:tJv,tzJEZo9~yt~;xr ytpj nj~7QD?}\4uv -ԒDM*V YrMӪeXȵTײƢ]ڰ6jˬk+4Or=vrÄDmϠCMd.O^zάcN|)ٸs|,;Gx.sÃ~N Ι[Νڻ}'p x~&} `R`/"cH$7ٚJd1 ONVNRe`%*[~ bfgj&p)'s'wIy)h~Z(*Z}2(J(bJiV雟jj)*  :mjxzk몽i\z*l.뫳¦ Vkv k覫f kj#K'*nl'̮ 7 {njkq_qwz,2<')_ #<'Ӭ2,,$ m2 #4.;3K]O/:+7-v+fvfzblMwܝ>;m 1-n'mnmČxgy oSSK1 w?jm{z."sKY{zNw߂_}Y*y'/쏾}> }{֣?/;دU] r0#$FV La'>v dP`vxA'MKa - `H;ҹyJdt!ЇT Ix2UD ST#5W-LқGqahF*L"& Zf3byC.$ F%5IRj,d̗q,NbVը5^d(/96L]R4&r_Ps4}aV̥4nz 8IrL:iu~'JЂS MBІ:DND(F7юz G+(JW҇LgjOA2b4K9)xBwZОԧ)5*FN$ M U5?*Pzϫv*; V~bgZֱ@muhYת6_]ѹ{ZWs6 aX6]_Tޔb*5(gYϲU,HSٖ5jmKX~6=R!+oڶkԸTW_֧۬E+Rm"պ˽qW6}fҲ>M/O ״W;~6Zo;\vE`ڰ:oiKwPVnRa z3Nz$Vn1wW!^qz`3n1ޯQkdze0pI, .v]_#>-s;`ם7q[r ,uBSvlgMn/?iET3N{br:Ðu_Иg^zĠ4RZױj`{Wf2 hcU̵]i;-z{%(cnwVpӬe旿o~No]RhqƗcfZɥq8qo8ay' K6ЇNtNEOzy ;=7:[{O[ϼ7{7<"wjOWu~neOӞ/w]_ۻF?/㗯R//{OE/|T{'ގ$0ڗXN{ַJ+x8}g~G|t׀vׁ&xvxSX(2z h{63aؑVix99oJTEVfgUdmpiesi\oomtfɖdy\WIfΆsodEq}YI]9r$_-ٚ)8(^xVkIin)mgo%7ٛȉnkɘdydٔ٘pge1h)]5N.H߸69vɞxB|d  5)Xh_?yoy-z_ *NzPZcdVi8*jYHJ6_#9WyZ `Φ\f *)b2 WZņ9&paxXt)XCYZc)asGyhZpMm٨:!V vJʥ^V" N?:viX7`/9g&V2,x6mIʫ)ɏ)qis%Vګ) x&`psӪϪʺV*{Z6 vHځڅ^C&EX#Xg'pQJj I}E:tʍA)舱JǬXkO}%{%8AuF&8<۟W^#],kNۍȩpO P}ʴ *Y~ʴ긲?'5󈮽pjiRU8;el*e W{Vi+eAUH8g[t`{z*)٫oiL6&'*kjZ),ZQlIsNDoZr݄(](Omƶ9op+Fvƶ7ir`){ivƛpS֬٘y ˋ{eدb`[}[qϩU:&iq(YfHSf˨kicx) :$ jk< |l[;(ַjLi¡ƢAMkDܶ)~CNf0`9[MY]>eVܧ%= Rv%g3&r{|K,ښgLՊФlY mӸ j;dH;>L%>FJ?}H8: 1eH'-\E-Z\ʧ9b u%cj-Kɸpf-<v^|u}|s/hׂ]y]1=؈~XUؒ=Mԓ}XٜmȝDQ,ڦ}اHڪڰ}ױ]ڴmۺ}۾}m=߹Ýܼ]JxgXʍc볙<ݢ@&Ϭݾ] wm r[]*o׽];pb\,k@iy whzn, Mn-(=GYL|h Q~>;,)=L Zߵ+cQSQ+܊ X^>~t^z`NIӕ2,mlI`jz$[jklv aQNlXW}}~UG`gtk<*W=bo}ҾRd|N6veY>֎ Uv.P oP ?e ?$$(d,!+0_N|MתGT%Eu>jCzHIqy:U~VOI_ ڷDoO[_wfFtlgݽՍ|rF1^twߎzB|/g^kT~%O!ṉB<Ӵm{s\f~ƹk2 04.D@̽B#o˽ ˒ʾLo5,{ΠIxٰ> P^]⍛3{gN0jp&1 ubxi7&ˇUi}k~ &t:Z*a ."MA ( xLth`^fW;=|D{)-RQ"XS#z?A*J|}V!U{C=[~3|u]_aee]phmqsP4HEG̲O͖}+6%ٷL>2t൦8Ϙw _`x"0,XaŰ Y7.6폾})imoJ$-T.E)h e>)О%pB1g8tKNvw2ƯH}Tǒ9x GW.$\jBkIZrB^Qh L*SݤȩH|ıZ̕^I㺀՞&{rO&ڹ /k2bv=Y+^;)z7HVGY 8"f23{i(vYYf]Uډ(6aH0(h8㎎buwhD㑴!ٚ*餓+>)TV?VKUEVO6,l>YjǐTUe0: 蠄ژdLQe\&9R饖^x&@ I*w J׊)l iV*afj$Ğ,>A+.PUZxnFK_]uڛZF-.Yd\v {+ĞSo!*Ez\XL.q`QwgF,b=(,|Nޓ~e+C%x P`zjG<{󧳁 B[_ܡAG=sr7j9Z(e=􆠙(9h[v21>5:OCc H`Aݬ%l3_Ou}-C2vYkw+מ`l޵%O98k>FGzZcTB> oѨYD.8M^۷@k ߠY_#~Bu}Ge{߄\uzQc앨섊QjYt@sO5 _ oFY^nwkFe \׶in`Ȭ" (̇mFy`8nF7p/~Qh?ucaREd@sg&HbFDb?DᬨG,ЋF0fc֢40xdEla-v F|T!/Ǿ(+; xdcܝ\2ICٙ`=2z.c$eD AP_x4Iw^g2{"NIiKula6(}R EA".Ԛw4e>T6PmaT @ؑeCrTGzY(*fj.YXՒokQ^tZ+T׾2ɯ"HI'.LabiRSmuf7XªbVl)˲Mj YlJ6V,Z,Pa-nK➨x8W!gz*[S"2NJk;,7 Rgvy"pKJiާz.EĉI۬W}UNheBKI22h5ލo㤂Lb7#- jEO#.q ^WIcYLUP'?&;G]TRb}'Ye^y.d>22dž0(|~}hcȨfγOyq' eHf&L0FJU3l\ut䰸KS9i9PMj-5UQVҼgMZw^VMl^Zº.h`S̎|l8{v}%j஭ p܎vvM離;ηkԽSP.p*  đpYO{\ufmtUk0ԃ8rr<8-_'3tePAѣ㨟uխ/vYucz1>u@ 3wkϻԽkh!hzpd׻Ͼt0'a[n/:"]|Z˲ʹ.cO<=}:˓AAhH{Spm `sʾ}i<ۥMh]b~OsKc48?G҇=xHw{."W)@JWsx؀$ Xx~+Yq؁]"( ox#`P:0h\ r i:YFD (BZ?BqtCULr@g ȄTjf pU؅VeXQ9fTqB*aǁgQ*Ćp`a+z|؇~8Xx؈8ȈuZP8Xxha:UY`1X%-`Ћ8XxȘʸ،8XxؘڸhP֍8Xx蘎긎؎8OXX16x؏{xD9YyrXEha9Yy|ّ h 68m*.0$}ǐr_~3+m-)@BLAhC=m?9R9S!x%”OɒIb9 郗ȓ>P M_ dr>؋X Z(cueoYlQ99 G=wv~686ؙ9(yfP5 Y6H9YĈ9jYِى9Yy~ٜ9\ن䶝ɝ69)i噝鉞Ṟɞl)iɞIIʝ)J ڞ * DIqpUڡ ":$Z&z(*,ڢ.02:4Z6z&\'j8@B:DZFzHJ([[hRzSZw VT ^R _c*UjeJhiiЦeb l*_jZJi`wwʧdg Y*[JawȨSa]Rzک:Zzڪ:Zzګ:ZzȚ;aplus-fsf-4.22/src/html/vmenu.gif0000444000265000001440000000446707215453040012403 GIF89affff!,H̀`(dihln0rMK|pH, ƤrlN%HZX#Tp7,eZ[ 8|.<~k:[76cfCP_d`QNShc\aNTaMLK /cMDBbCŔ$]mФQJ¹OL!O[.،u0ɽ|j$KXOl\"'c-68tŘD0*(X\<6c'@$y,Jk T׳)fkthCݺx#4~Mx Lؘ!dD#KL˘3k<`@+ƍoMׄ͝ӹ6l Ӿ^3oȓ6~{ݺ+,|ruӕ#go~9g6Ë~rz[殿 4eVlaW^pg)9xف]w qrȡdaxa3^Q'#;;""c x$=ZXpS8$.c9cHz[weaEj$L ^:uRgemA"nNȥsr92Fa&F hb&vNf''V"zأ^2?Zpi|*' jg湧k$rXcM 2(fX[lRk~>Ҿ띸}ٽab 7'G\E j0hf'a)!61yf+Uww2X"\1س& pG#MY6ru%hȩ2'%If:25>ak݀6a2~o,&: 2 &$@29MtTτ/U>E%*jodܪ҇ep稁Q<7;rIK&}[70q4 y>#jQM:S0Nm[TCT~Ǫ6U+jWzRfLpֶ>rS[JW/9#׽"Gqj*%ְCY^ ؋fzeXvMm@[Ďցh]J@/ak3StĤJyviN6כ lGDSkhUlAذZTH+ߒ "ev[VKd/'ްWusyvr#=K ._nq"]*h"M/Y~TdUB. "Uq\ KpW{)SR̳ bڲ+0CbM¸y-acv *v\n{)?cdQ6iN:qaa>7 ~$BNt<]q4o PHgʥylzr^jQھfx(Η8L @Գfv;\Zz />lz.Կf|Z#q ߇w5yNp\^m#g?Fue[4q[&d-=o} bMF7u/opjH|V-@c=0Q~f{pagEܭ4w;aplus-fsf-4.22/src/html/vpane.gif0000444000265000001440000002066507215453040012360 GIF87apjjj,0I8ͻ`(di@j˾+ôZs4?JkEL.Y䡮TZen]h5_eN int)y1|{t:»Ų˷Һ-F߮Sqmue6jc^R {[TPÇ#Jԧh!Ujď CذPI{6,ȗb!8[SD6i У.v{\ky95l7g r hk5/:Zl&Tuo [8ZeDwƣKm֛|{S]ă_>Ru3I i%G|L 1^3`-R0 46! \W 7^X2 $h(,0(4h8戣 牎@)DiH&"X=>PF)TVie5'Wvid/x)dɤ<=c$)"p@fpw|% q)%y%w"zh)b FjFAzJ騤*ir ꧐(jjfy qzhubmn-+f 6fm⎋ЦN^+ߢ ++J.>? 0Z{l 1*+\pJI4l({/̯;S*lH'L7PG-TqR\wu9/+0sA,~p-tmx{om0 y5Lr=kcDzJ.GWG,9ڌl=6Ōy⒧^0[6a6ۭ%&p2GR`N7g/3o'ه/>׽3?׺=s}?i㑾/GB  bg:HL G ZF wzEԠ PD 8xv0* ]HC0$`a wH@3!W' Tp:$EbbNvBA_d)l C\h+z@ǧ5i-Bы+*Zxs xVݑe㝫%EMLD'@^ K,xƶsut0q#,)$pU)uHP^#*IV`-u %MR+#0/94>j<.Y.:2] iF@\MgBsXBFJӜ8QwfY~L 6Pz&=zN}fS@Eb2]8CG!)2~N qN%$m:"LԘꀁRTU .ƕZ SW Ved( F׺xͫ^׾j1ZY5Mb:[K Xdߚ;H^%LG3v -fGe>ҵ0*m Ej@+e+V 0-I$ȧ_gQTͶEmzPt z#ʝk#\Mk.lzJݯ s nZd%v̚ CX3+XF< >z-K$j|Z2 MԎfl)Ylv;|\6Pem?vhB[X>ss5ۜV.Rq.t ӣJMNëL pӮMmh;gu=̀s\(ʭT1`@ЇNi׽uoE{;Pc?u7e׷ _'cVmHk;Bn8c=ƞ>V{`]>$2ޥ{.x<_yqlwj^O.]^s}|0ʳ5ڧzz;Jf SsG!^rߝoscYKge=HV2.yC+q_OwTaܨF^J6W>D|'WgqO&op|Fz>W?wH#gwU<}e. x&3Jcf7r>ѷn@M4~|yG~7vyVWVLJj}278%{\ 5S7q9fnDi!U,jg`lz4#7~xAf8dcRz>L(2'qVeS GW9%{ocgg=}Rw@ׄ>TX86{/ulh?(WuH։qCj{Z犡+xeHxvZSwȘP{ʨ(wUy؂U6vxYXtdsЈYtYlx6c"#XO~'zX v][Gb X^1o9p4 ymďy%b%I숇妇Jd# a9e{Vwp`&I|LjW&InG0GLdRxv-9S&3C&1I&89Yؓk_mxaZ- yQ() )eZ(e p門?q`Ybeg$闦_VhYTdinb[Ye8y@Y^]Y_tgmشoHXsJ\ W)|'I8uL|ՆoÛٚsڦ/E(ioH<ΩIqI菂Uyyəw:n}ɁRDRiIU 6)cIN ؠҩyXsv)q,rMꝬ|Z،.ɘY`ߘ:ڣ}@7^9:C4j7srpxEyhVٞH\m Mj$%x)araɢWGfh0–mPrڔ,x|JҁʩxY ,埾'*ZۗsdΧHh$5ʙ|,* dcFB:TJw e 9l j͙lb ijL+EI2Zcfft̲-{1ZY=)ѺuDZ@;Ǹf-Ǧzٳꆲkh=|ܵlLqȠe+ʫ\\.u+){ ,FZksk˚e z;8zL͕͒Kê˭:Ȍy5,ͣ jkJZܭki)JC|"jZl 62#kI%B>IQ5yˢɋĻy„:ŻټNDҰFzyϋҊ[\>iTYc,/7ʆz8GhdF|Eӱ*JImE,̼۬x[ck՜lΉI:kzwm:dAx=S(l9e,֝̍,՜^lq\[}W Nj0뻣ӄ-ԙ-[WmD\6tmv|16 gOJL9|'y-j]*"FrJݽl܇˙k^^w]I|ϞJt[}լ| :{ }M=Ϯw$ 'CΔ̚wj {U"Nt| b%. ș#6~8:ۼ٬B>Hqm@DKsA.փzxV~XZ\^5ke7綄^jl_5H?J.֘~Yn|~nbnXJd'x>m|^vrx>]<"..Jrh}>e~t^5魞ރyn_3Ȟ[0m.Fsʦ~k3>n΍t^徾~O^a[8tNx}4S:XΞ?Gߞs /s>~*N /%p>H$_#'[HfU,o#''(?ύ~L^6T6>$N3s?-B2#P\ĕŔ$&G֭"[ę"o k\ tPBh:@ѰWH&0dW8@&#gtډ(8kEI{[j_9er<*XJUzd)i@|\iiꩿ ꪙz:x f藫}N+ ڇZZ)&Kb峑c.Kfƶjzl4oԞ[Te緆(fk^uD`"(_>ȘmXc?KT}%VE[yug~"{p1-]~lۼ5@ +;*w~QB3D5 Ԃ[)rZ0d'W]F;z180M3W r4K{ԉ3(-B?}T[/׮7pA75r: 뒏hJ6?]X?%2O,}5S6$F=TwAEq(L WЁNɧ.{!YІU>AʐdH"RF WC&"D^)ЊkNE."B8E%*rbƈ8QkLTxh!(ȍ豐!G7`@JI"&)Mѓ*Q4$QҎ$t%=KZ̒"4eVr<%0 aL/sAܘ`&D6rg8l{D7Yvb4'OzGY+f>ςӟ89PgQK=")*6XFtЈIEpB(ma:= . + 꽎= }&]4cYJo >si"Mo3.=ԂެgSeԊ"8O0ŭұ3~jheZ9љ]oD۩ƹUt[Jz~CT605fbi]a9YŊlE6΂h5 ٝ.Ѵ.,cumk3൶iHu; %)p7&\PŔ莋U+huj.b}^Wص-EujQڃMnxӢךz[ܩlmiz2W_7.n7`!T m ,pJ a3HX!a7![bvMqqeж/s%{_7Uqbػ #!5 ZN47pCߠXy^XzafI|iޘjSrf:nU~cϐ26A@_Et,%у}4ә dߐƠn`NtRM5qD-ѲӪi:YmXtsuؚ[=v} 6٘Jq 4>67lNQN =n:c[.{xvF/HOT>3 hֽ.u?^{Xί (^pzgCg&[1QDT\E8Ǹ貾<kh5ćs|ܚn5kjX8O)l^MHzh:e^fXmnM^*؟-iǁV3y:PȃKhإ]7ƿ ߵ6'm[w5zMq^0Os]Xݞ{ulÊSН}z\M:zN ~C?{- {O?r-|| X`;e`pmw;>E3lrpiV?xwx~R"eX#ga 2u $8=w̖%ȁWv.!(c1b8(A+{׃6wHJL؄ 7TXVxXXH) HP#aX`hhHlxj؆ar8s(u؆wpXyȆ{}HhXJ|<8Xx؉((x؊df^~Xx엋؋(Hh˨،(Hhňˆx8Xx蘎H" ;aplus-fsf-4.22/src/html/window.gif0000444000265000001440000001650307215453040012552 GIF87apjjj,0I8ͻ`(dihlp,tmF7C Eqc 5#OaGUN`z -kdlo0^ bnˀvham{`pvyu{q >4c~c@elj6@XPl]pS/g.*Itk=ѩ^ϓ{xX9ÉgO>sJ+ץ/d1]H$K}5}؎X Ff;c 9rȠ?3U%߉(f,0:ra4h8P<@)DiH&L6֎NF)>HXf٢Z8c`.UBBI晾p_ jfrƘvIg|gz iI(jgih2 鑉N"hdbi~z.Yijꨪvyj.J딭Z됼zBkrl . f~lRٴֆvކ˭k[.I;K[// /2+Bl o113r+Kq0,3@8<C@-DmH'M3J7Il,[PgZw`5bmXlvpKq3x۝wmt.{sሳmx8;CoS|cG(ܰ0{ zg̴˲o5ß'E3o=:i=2#|䋽>/M^ǿ\SCK󼇿o|L`x3ql} W>)aC 74 vg(4L!"hBiP0LZ e@aO/{3<|HDQaYw=Άj|QhRZ">t"8AA{dI9Z HHq,'CV*0c\%8Hihyt.wBM#bs E[-nj4R>Smo\6pnΜr':7N1:yγ>~ h?s ЂMBІ:D'JъZTȨF7Qs5HGJҒ(MJWjQTXf0}8ͩNwӞtP@`DPTJժbC-*VZT`bSx:UJֲ *W 0&UıNֺx[֭vq+KŚ5Z*UtslJZcX!݁A Қy *c9{Ԣ3rmS)OڢOUV~ֳ,CIkVMrSQ]*6Qͮv>.[ZRMzO"х,Sa&[⢗ͯz[} J-Z2]h ['xś:Ga}x[_0]3^s8 w|[*0yL"WǾ1` Z#;36,ݸX2UZֲǬR.7d63W52L:}u0-`>p#K?<^"ѐV4C҆zӠGMOԨNWM$Տ ,_Vָk^װt/ӛ&ݵcb<}Vv^Fwѵm k`nanhk_z;ޖvad_9ݵ}]@5>[`+{܂.wΛoۡW7qʰ7;pz!_8[~6,]6MqW59I8Yi bvVLWNr)F׌zN9k-r{]fyjw;ԣFyO|a>Vݸ< vz&4m}e{#Z[. f+/ϧ#?:>a{w߿@kq77PW}&poW yg^?voUt hyIucn+s(&wh}iu5oXʥ||jVhwe7G{Vqga8`Wa0؃ԦyvaC[:_G8~>xn@lE`M[O^Q|2Xt`b8dXfxhj_fbkpr<(I|6z|(ևȆ 9ihgw8Ϸf8{7gmk]u*m]hX UQ17v\Y8X{VWh|{hHSxgEz*xuՋ$5yr7Յhn8ƁӨnhyƗ&x{8R}嘍|hed7X[S,hS㸌%(uxfܸUR 7aU8Qw|iZX xRHp;WusXŏIa!bIWu&rَ7m"yus{ӗd (}nTȆu@vuEYHb'd8Y Qyl4 } }IR)T٩SuZɒ}U>jQiϚozZ w1jVJXV%IG$n֕Ūk{xZwyjUDz:'*k&БGww/jW y.i.lYz K|ځ ژ+fg@Xz WozI{J;0(j~`HU#ni׭ʵF{vH(J"'eɜ))ckJY?طH7w$msKNj[mZP4kٷ*qڪ*uICIk"ySZ ˡšF:PXʄ[˅5"%6bV:V(b!{dk㺯[\  PھˇӋ^;{ʋoFo|&<5Xl0% K׌;zY'ܲ^Rٴuf꽊y.j$yr)';ǫ]@L+tKٸ;)zr.z}YV;WukDȠRǰy,Z|e\,t%(`kƤ)쳬>)],{ H-}\RuYRC˰ yd$Ւ59y8iRG<<5j.0[Y\J\¿΢L ~?{ώR lGKOyDϣe|'ۜ̕O|Q<]<4\o+2lΪLLJ ܹu 377"x˸p ㋣6ېk{pMYͣT B 9xCq^ l+:6ws̈́`ջ؄-uW؆]̋ c=Ͷ.k٨(>!=pXbRl 2ϨS:\ͭ}X8|\,\|̋wRWȻ k+zm Ȍ*뫛ݯM-ҧ=r ]jlaՠЖA sʙ'Jȯ-TFܓ~ɴȀz; 7}=')hԏ|ޜY\/MUmHEK]撻ڬ?Øƚjk⹌*+޶- W}KP㛮ܲ Z2LQ z2-˽,W3J;. ~WF]* `?nhv5UN{ Ah؃=N{}c_a*n<.j}lM;<^RlQ] S5yKUꂮӴ _Q,s/y%ܱÞV[۝=H= uZ_R߽֚`/ o^[}f7h)X_^t>pwP;pnmJ7M 8k e~!ݎ_9E+Bnѳ?lR/ztW;|ʤ_ߨ[L>՗o9W.so~N;<μ_?To^ε5]\^"…o`60.6iV Bh*A0yʢ(n9rډ:P h:W`jXجvz`@L'4{%0+x+OOl0EmE?lu|IP.cS`dfopg}q s y{<&$}8JLORTbdBӬվ!#45j)oݧŇMd m !\(ÇHBxG~X3NC(d &SSɲE$~ⱦeZ$3%ʞy-i&l*DehIN'*ՇE1f촴+WzSY|V˪)GpT[x˷߿ K`+^KQpK9†k̙1qv;MV^=װcae)ͻ=/btrkf:(_μУKNswkν槇ߞỲ9l(MLi#.D隊HRQC8ZKޠgYrHAf8 (6q%G5)=vP N"J"َTv :Η=@gTdf&,_N: `ia>韧Ǯh9'/6()s7(񨰱M8C2[Q}[ ֱr|kj Z17NDdH"tٲ"2rxho( Cq4ϼ6r"Ccĥ,1+"#" vT7sٵeL9%CZ⟴s *?w 4_bO0 ?NQo̫ -l@ZD0ܣ\6R(L WЉEH*8̡wp;@ih .Li&:PHED?2T k8#f}JH2h,#b q$b fxcB`p, 1L>oܢh=R̤oـ, :pRL%rNKFrfGUaar>P!kb%\NF܈QFi/Ij"#1@tIr\OvmIzl:ni @JЂ}a&yL9"D'JфS %8z G 8R( ISǕ/])KcӔT7LgS?iO?:TգA5B3R28PITJժZXͪVծz` XJֲXHW~p\J׺xkYU1 ,KXbߚ*vu"KYJe5JֳcE[Y6ִ%-mbUY"ֵ,kͭnw pKL;aplus-fsf-4.22/src/contrib/0000777000265000001440000000000010774512674011346 5aplus-fsf-4.22/src/contrib/README0000444000265000001440000000143707266601275012143 This directory contains scripts contributed by A+ developers. For details on each of the scripts see the actual file. Feel free to also contribute your work to this collecton, by mailing your script to: aplus@aplusdev.org Script Contributor Description ----- ----------- ------------------------------------------- apl.+ Martin Sitte Educational for APLer's for how to implement General Inner and outer product using the A+ rank operator math.+ Martin Sitte A general collection of mathematical algorithms implement in A+. From: Greatest common denominator to: Integration by Gauss-Legendre quadrature The script is well documented and provides references for the algorithims Requires: hermroots.m, lagroots.m, and legroots.m aplus-fsf-4.22/src/contrib/Makefile.am0000444000265000001440000000147107266601235013311 ## Process this file with automake to produce Makefile.in ############################################################################### ## ## ## Copyright (c) 2001 Morgan Stanley Dean Witter and Co. All rights reserved.## ## See .../src/LICENSE for terms of distribution. ## ## ## ## ## ############################################################################### contribdir = $(prefix)/contrib contrib_DATA = \ README \ apl.+ \ math.+ \ hermroots.m \ lagroots.m \ legroots.m EXTRA_DIST = \ README \ apl.+ \ math.+ \ hermroots.m \ lagroots.m \ legroots.m aplus-fsf-4.22/src/contrib/Makefile.in0000644000265000001440000001527710774512522013333 # Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ ############################################################################### ############################################################################### SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CXX = @CXX@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ STRIP = @STRIP@ VERSION = @VERSION@ X_INCLUDES = @X_INCLUDES@ X_LIBS = @X_LIBS@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ contribdir = $(prefix)/contrib contrib_DATA = \ README \ apl.+ \ math.+ \ hermroots.m \ lagroots.m \ legroots.m EXTRA_DIST = \ README \ apl.+ \ math.+ \ hermroots.m \ lagroots.m \ legroots.m subdir = src/contrib mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_CLEAN_FILES = DIST_SOURCES = DATA = $(contrib_DATA) DIST_COMMON = README Makefile.am Makefile.in all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/contrib/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: contribDATA_INSTALL = $(INSTALL_DATA) install-contribDATA: $(contrib_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(contribdir) @list='$(contrib_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(contribDATA_INSTALL) $$d$$p $(DESTDIR)$(contribdir)/$$f"; \ $(contribDATA_INSTALL) $$d$$p $(DESTDIR)$(contribdir)/$$f; \ done uninstall-contribDATA: @$(NORMAL_UNINSTALL) @list='$(contrib_DATA)'; for p in $$list; do \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " rm -f $(DESTDIR)$(contribdir)/$$f"; \ rm -f $(DESTDIR)$(contribdir)/$$f; \ done tags: TAGS TAGS: DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = ../.. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: $(mkinstalldirs) $(DESTDIR)$(contribdir) 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_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_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-generic clean-libtool mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-contribDATA install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool uninstall-am: uninstall-contribDATA uninstall-info-am .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am info info-am install install-am install-contribDATA \ install-data install-data-am install-exec install-exec-am \ install-info install-info-am install-man install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool uninstall uninstall-am \ uninstall-contribDATA uninstall-info-am # 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: aplus-fsf-4.22/src/contrib/apl.+0000644000265000001440000000173107252205664012107 Contributed by Martin Sitte Operators General reduce, f/: (f REDUCE) x: { if (1<#x) (0#x) f f REDUCE (1x) else if (1=#x) 0#x else if (16>i(+;;*;;=;;^;-;;|;<;>;;;;)<{f}) (1x)i#7 7 1 1/1 0 Inf Inf else `domain } General scan, f\ (inherently inefficient): (f SCAN) x: r (i1+#rx) do r[i+1]f REDUCE (i+2)x Scan for associative functions (much more efficient, if applicable): (f SCANAS) x: x (i1+#x y0#x) do yx[i+1]y f x[i+1] General inner product, x f.g y: x (f DOT g) y: { if (0=0rdo ((<{f}),'/')@(y) x g@0 1 y) 1r else f REDUCE@(y) x g@0 1 y } Alternatively if ((`sym(<{f}),'/')_nl{;`apl}) ((<{f}),'/')@(y) x g@0 1 y General outer product, x .f y: x (f JOTDOT) y: x f@0 0 0 y All usable with rank, of course. Functions take{x;y}: (i#xr#y) do yx[i] @(r-i) y xy for integer list x drop{x;y}: (i#xr#y) do yx[i] @(r-i) y xy for integer list x aplus-fsf-4.22/src/contrib/math.+0000644000265000001440000005225410772771037012275 Stray math functions Data directory for .m files dotmdir"/usr/local/aplus-fsf-4.22/contrib/" Basics gcd {x;y} : { 6-10-1989 Sitte Greatest common denominator; Euclidean algorithm b0zx|y; r(~b)|x; if (/b,b) rr+(r)b\(b/,z) gcd b/(/z)x; if (^/`int=(x),y) `intr else r } lcm {x;y} : { 6-10-1989 Sitte Least common multiple; calls gcd rxyx gcd y; if (^/`int=(x),y) if ((^/,r2147483647)^^/,r2147483648) r`intr; r } gcdmult {abc} : { 5-15-1996 Sitte Greatest common denominator of a vector; Euclidean algorithm r0; while (1<#abcr,(0abc)/abc) abc(r/abc)|abc; if (`int=abc) `intr else r } lcmmult {abc} : { 5-15-1996 Sitte Least common multiple of a vector; calls gcdmult r|/abc; rrgcdmult rabc; if (`int=abc) if ((r2147483647)^r2147483648) r`intr; r } linindet {ab;c} : { 5-13-96 Sitte Linear indeterminate equation: integer solution of ax + by = c, using Euclidean algorithm c is optional, defaults to 1 if (0#c) c1; abab[sab]; r0; while (11ab) {rr,ab[2+#ab]ߢ1ab; abab,(1ab)|ab[2+#ab]; if (0=1ab) if (0=(i''Ң2ab)|c) {r0; cci; ab(2ab)i} else 0 c not divisible by gcd of a,b }; ab; rr,1 0; cc(2|r)1 1; (*i(#r)-3) do r[i]r[i+2]+/r[i+0 1]; rc2r; if (i/|rab2ab) rr-abic; r[(r)s] } lincong {a;b;m} : { 5-13-96 Sitte Linear congruence: integer solution of ax b (mod m) The result is the apv of the solution set (r[0]+r[1]r[2]) dm gcd a; if (0d|b) 0; rlinindet {(a,-m)d;bd}; ((md)|''r),(md),d } primes {n} : { 5-1-83 9-15-83 M.K. Rosenberg Generate prime numbers via the sieve of Eratosthenes By Rowe & Stoneburner, the Upjohn Company (Much faster in APL, which used boolean data type (= 1 bit)) pnb1; ns.5+n*.5; while (nsbb+1+(bp)1) pp^(b1),bn~(-b)1; 1+p/n } factorize {i} : { 12-13-1986 Sitte Factors of integer i f1 primes {i*.5}; f2f(i=lcm {i;f})/f; i`int.5+i߫/f; while (#f2(1i gcd f2)/f2) { i`int.5+i߫/f2; ff,f2 }; f[f],(i1)/i } divisors {i} : { 2-12-98 Sitte Positive divisors of i ffactorize i; ff[n(f1f,0)/f]; nn-1բ1,n; ff[mn] ; nn[m]; d(,i)1; (mn) do d,(1,f[m]*1+n[m]).d; d[d] } eulertot {n} : { 4-22-96 Sitte Euler totient function: number of integers < and relatively prime to n .1+n/1-(f10,f)/ffactorize n } convolve {p;q} : { 5-9-1987 Sitte Convolution of two vectors of probabilities or, the coefficients of the polynomial product of two polynomials +/(-#p) @0 1 (p.q) ,@1 (0 1+#p)0 } combine {m;n} : { 11-6-94 7-17-95 Sitte Returns all combinations of n taken m at a time case 1 { ((0m)m>n); 0 00; (m1,n); m!n; (m=2); ((n)/n) ,@0 (1n)աm; { c1!k#b(1+n-m)1; (m-1) do c(b/k) ,@1 (1+c)[(+/b)+b/(#c)-+\b+\b] } } } much clearer, much slower; re- and re-curses (0 ,@1 1+(m-1) combine n-1),1+m combine n-1 permute {n} : { Returns all permutations of n Courtesy of Roger Hui if (1pyth {n;m}; rho(0trips)߫/m; (((-spc)+(/m)rho+spc)(rho,spc)/1 0) \@1 trips } The n-th Fibonacci number & 2 preceding using O(log n) integer operations Roger Hui fib{n}: 1 1 0 1/,mpower {2 2;n-1} fibs {n}: { First n Fibonacci numbers Roger Hui algorithm, adapted Faster than addition mff2 21 2 2 3.0; k(i1)+3(n-1)3; fk1 1 2 3.0; while (k>ii+3) f[i+3]1 1 0 1/,ffm+.ff; if (n<47) f`intf; (3|n-1)f } First year calculus: (f LIMIT) arg : { 9-22-1984 Sitte Simple limit routine, test for monotonic convergence Argument to f is supplied in the form (x;x;params) (for the simplest case, the first two must be added to get x+x) arg is a two element nested vector (arg1;params) arg1 is a 1-, 2-, 3- or more element vector arg1[0] is the limit point x arg1[1] is the step size x to start with (optionally but not optimally supplied) arg1[2] is the factor by which x is successively decremented (.1 default) params, it any, are sent to the function as parameters, as indicated above E.g.: f FDERIV LIMIT 5 .01 .6 (to increase precision of FDERIV) (arg;params)arg; b~i0; x''arg,arg; hh+.01(x+x=0)0=h1#2arg; decdec+.10=dec2#3arg; lf (x;h;params); while (b) { hdech; gf (x;h;params); if (20)^1>c(g-l)d; dg-l; if (bb^(d0)i=1) lg }; hhdec : would give you step size which came closest to the limit l } (f FDERIV) arg : { 9-22-1984 Sitte Derivative by 4-point Lagrange interpolation (Does right-handed derivative, left-handed with negative step size) arg is a 3 element enclosed vector 0arg is x for f'(x), 1arg is the incremental step size x (optionally but not optimally supplied) If f has valence 2 or if it is ambivalent and 2 arg is not empty, then 2arg is sent to the function as left argument See LIMIT for optimization.--Abramowitz & Stegun Table 25.2 (x;h;larg)3arg; if (0h) h(x)0; hh+.0001(x+x=0)h=0; valif (0=0valdo _valence{f}) 1val else 1+~0larg; yif (1=val) f +\1 3/x~h else larg f +\1 3/x~h; (11 18 9 2+.y)6h } (f SDERIV) arg : { 9-22-1984 Sitte Second derivative by 4-point Lagrange interpolation (Does right-handed derivative, left-handed with negative step size) arg is a 3 element enclosed vector 0arg is x for f'(x) 1arg is the incremental step size x (optionally but not optimally supplied) If f has valence 2 or if it is ambivalent and 2 arg is not empty, then 2arg is sent to the function as left argument See LIMIT for optimization.--Abramowitz & Stegun Table 25.2 (x;h;larg)3arg; if (0h) h(x)0; hh+.001(x+x=0)h=0; valif (0=0valdo _valence{f}) 1val else 1+~0larg; yif (1=val) f +\1 3/x~h else larg f +\1 3/x~h; (6 15 12 3+.y)3hh } (f INTEG) abc : { 9-21-1984 Sitte Integration by Romberg algorithm with extrapolation to the limit arg is a 2 element nested vector (abc;larg) abc is a three element vector: abc[0 1] are the lower and upper limits of integration abc[2] is the desired number of significant digits in the result larg is sent to the function as left argument if the function has valence 2 or if it is ambivalent and larg is non-empty Cf. H-P Journal August '80; Davis & Rabinowitz mid.5+/2abc; rngabc[1]-abc[0]; larg3abc; k0; pp_gsv `pp; _ssv{`pp;2#abc}; valif (0=0valdo _valence{f}) 1val else 1+~0larg; v,.75yrngsif (1=val) f mid else larg f mid; while (~(yk#v)y) { kk+1; u(1+k2)+(2k2)k22*-k; if (1=val) ss++/(1-uu)f mid+.25rngu3-uu else ss++/(1-uu)larg f mid+.25rngu3-uu; v(.75rngsk2),v; (ik) do v[i+1]v[i]+(v[i]-v[i+1])ߢ1+4*i+1 }; _ssv{`pp;pp}; y } (f INTEGGAUSLEG) abnml : { 10-10-88 Sitte Integration by Gauss-Legendre quadrature (between finite limits, piecewise integrable) na is a 5 element enclosed vector: abnml[0 1] is the lower and upper limits of integration 2abnml is the number of points to sample per interval 3abnml is the number of intervals into which to subdivide the range (defaults to 1) 4abnml is optional, if present is sent to the function as left argument Requires legpolynom, legroots, binomial, gamma, loggamma (a;b;n;m;larg)abnml; if (0m) m1; valif (0=0valdo _valence{f}) 1val else 1+~0larg; rng(b-a)2m; sum(a-rng)+(2rng)1+m; xnlegroots; wts(mx)2(1-x*2)(x @0 1 (n-n)1legpolynom {n})*2; x,sum +@0 1 rngx; rngwts+. if (1=val) f x else larg f x } (f INTEGGAUSLAG) nal : { 10-10-88 Sitte Integration by Gauss-Laguerre quadrature (between finite limit and Inf) nal is a 3 element enclosed vector: 0nal is the number of points to sample 1nal (optional, defaults to 0) is the lower limit of integration 2nal is optional, if present is sent to the function as left argument Requires lagpolynom, lagroots, factorial, binomial, gamma, loggamma (n;a;larg)nal; if (0a) a0; valif (0=0valdo _valence{f}) 1val else 1+~0larg; xnlagroots; wtsx @0 1 lagpolynom {;n+1}; wtsx(wtsn+1)*2; (*-a)wts+. if (1=val) f x+a else larg f x+a } (f INTEGGAUSHERM) nhl : { 12-10-86 Sitte Integration by Gauss-Hermite quadrature (between Inf and Inf) nhl is a 3 element enclosed vector: 0nhl is the number of points to sample 1nhl (optional, defaults to 1) is the divisor in the weight function if = 1, the weight function is *-x*2 if 1, the weight function is *-(x*2)1#nhl (e.g., *-(x*2)2) 2nhl is optional, if present is sent to the function as left argument Requires hermpolynom, hermroots, factorial, binomial, gamma, loggamma (n;h;larg)nhl; hif (~0h) h*.5 else 1; valif (0=0valdo _valence{f}) 1val else 1+~0larg; xnhermroots; wtsx @0 1 hermpolynom {;n-1}; wts((1)*.5)n(factorial {n-1})wts(2*n-1)wts; hwts+. if (1=val) f hx else larg f hx } (f SECANT) arg : { 9-21-84 3-4-92 Sitte (guess1;guess2;epsilon;larg)arg; valif (0=0valdo _valence{f}) 1val else 1+~0larg; xguess1; hguess2-guess1; if (0epsilon) epsilon0; hh+.0001(x+x=0)h=bj0; epsilonepsilon+.00000001epsilon=0; if (^/,bbepsilon>|zif (1=val) f x else larg f x) (b;x) else xx+h; while ((15jj+1)>^/,bbepsilon>|yif (1=val) f x else larg f x) {h(bd0)(hy)(d=0)+dz-y; xx+h; zy}; (b;x) } (f NRAPH) arg : { 3-2-92 Sitte Solve by Newton-Raphson method: x[n+1] = x[n]-f(x[n])f'(x[n]) Result tolerance and left argument to f optional Returns (boolean of successful solve; solution) (guess;epsilon;larg)arg; valif (0=0valdo _valence{f}) 1val else 1+~0larg; bj0; rhoxguess; if (0epsilon) epsilon.0000001; while ((15jj+1)>^/,bbepsilon>|zif (1=val) f x else larg f x) { dzf FDERIV (x;;larg); if (^/b1,dz0) xx-zdz else { (x;z;dz),(x;z;dz); if (/b1) { kb1/b1; (k#x)(k#x)-(k#z)(k#dz) }; (k#x).9(k(~b1)/b1)#x; xrhox } }; (b;x) } (f CAUCHYSOLVE) arg : { 3-2-92 Sitte Solve by Cauchy (second order Newton) solve method: f(x)= 0 =f(x[n])+(f'(x[n])(x[n+1]-x[n]))+((f"(x[n])2)(x[n+1]-x[n])*2 Result tolerance and left argument to f optional Returns (boolean of successful solve; solution) (guess;epsilon;larg)arg; valif (0=0valdo _valence{f}) 1val else 1+~0larg; bj0; rhoxguess; if (0epsilon) epsilon.0000001; while ((25jj+1)>^/,bbepsilon>|zif (1=val) f x else larg f x) { dzf FDERIV (x;;larg); d2zf SDERIV (x;;larg); q(dzdz)-2d2zz; if (^/b1,dz0) { xx-2zdz+(dz)(0q)*.5; } else { (x;z;dz;d2z;q),(x;z;dz;d2z;q); if (/b1) { kb1/b1; (k#x)(k#x)-2(k#z)(k#dz)+(k#dz)(0k#q)*.5 }; if (/b2(~b1)^0d2zq0) { kb2/b2; (k#x)(k#x)-((k#dz)-((k#dz)-(0=k#dz)(k#x)k#d2z)(k#q)*.5)k#d2z }; if (/k~b1b2) { kk/k; (k#x).8k#x; }; xrhox } }; (b;x) } Matrices determinant m : { Determinant of matrix m, by partial pivoting 5-28-93 Sitte if (2#m) 'domain error'; n#m`floatm; if ((n=0)n1#m) 'domain error'; s1; (i1+n) do { if (iki+''|m[li+n-i;i]) { ((i,k)#m)(k,i)#m; s-s; } else if (0=m[i;i]) 0; m[k;l]m[k;l]-m[k1l;i].m[i;l]m[i;i] }; s/0 0m } determinant2 m : { Determinant of matrix m, by partial pivoting 5-28-93 Sitte if (2#m) 'domain error'; n#m; if ((n=0)n1#m) 'domain error'; case (#m) { 1 ; ''m; 2 ; (m[0;0]m[1;1])-m[0;1]m[1;0]; Now if we had -/, like a real APL... 3 ; (+//@1(3)m)-+//@1(-3)m; {s1; m`floatm; (i1+n) do { case (''0,k(/|m[l;i]),/|m[i;lin]) { 0 ; 0; 1 ; if (iki+(|m[l;i])0#k) {((i,k)#m)(k,i)#m; s-s}; 2 ; if (iki+(|m[i;l])1#k) {m[;i,k]m[;k,i]; s-s} }; m[k;l]m[k;l]-m[k1l;i].m[i;l]m[i;i] }; s/0 0m} } } ccd {m} : { Anscombe p. 390 8-10-1985 Sitte Complete Cholesky Decomposition if ((0m)2m) 'non-matrix'; if (~mm) 'non-symmetric'; n''t(m)0.0; (in) do { u(im[i;])-u[;0]+.u(i-n) @1 it; if (0''u) 'non-positive-definite'; t[i;i+n-i]uu[0]*.5 }; t } mpower{m;n}: { Raising matrix m to the n-th power by repeated squaring Roger Hui nnsn; zif (2|n) m else (m)(1+#m)1; while (nn2) {mm+.m; if (2|n) zz+.m}; if (s1) z else z } Gammas and factorials: gamma {x} : { Gamma function 7-21-1994 Sitte Abramowitz & Stegun 6.1.40, with error correction (Kuki CACM 15-4) rhox; b(10,10-1e-10)x,x; g(b)0.0; if (/mb=1) (m/g)gamma {1+m/x}m/x; 10 < x < 10 limit recursion, for x 10: if (0b) (m#g)gamma {1+10+1|m#x}ث/(<@0 m#x)+ɡ10-(m(b=0)/b)#x; if (2b) { bern1 1 1 1 5 691 76 30 42 30 66 2730 6m1+m21+7; (m/g)((2)*.5)(y*y-.5)*(-y)+((yy) @0 1 bern)y(m2=b)/x }; if (/b(x-1)=|x-1) (b/g).5+b/g; if (`int=x) if (^/b) if (13/x) g`intg; rhog } factorial {x} : gamma {x+1} loggamma {x} : { Log of the gamma function 6-6-1995 Sitte Abramowitz & Stegun 6.1.40, with error correction rhox; b10>x,x; lg(b)0.0; if (/b) { if (/b1b^(x-1)=|x-1) (b1/lg)ث/1աɡ(b1/x)+1=b1/x; if (/b2b^~b1) (b2/lg)gamma {b2/x} }; if (0b) { bern1 1 1 1 5 691 76 30 42 30 66 2730 6m1+m21+7; ((~b)/lg)((y)y-.5)-y-(.52)+((yy) @0 1 bern)y(~b)/x }; rholg } binomial {w;z} : { 7-21-1994 Sitte Binomial function big140/c) c`intc; rhoc } multinomial {m;n} : { 1-26-98 Sitte Number of combinations of (+/m) out of n objects in m boxes, with m[k] in the k-th box m,m; c((0m)0)mm[m]; binomial{c;n}factorial{n-c}߫/factorial (1m),n-+/m } beta {x;y} : { 9-21-84 Sitte Beta function ybinomial {x-1;x+y-1} } incompletebeta {a;b;x} : { Incomplete beta function Sitte "Best results are obtained when x < ((ab)-1)a+b-2" Handles array a,b,x (each same-sized array or scalar) Abramowitz & Stegun 26.5.8 Sitte rhoi((1-x)cm+a-1)a+b])(b-1)+m(a=1)^b=1; if (0=m) if (^/,i=''i) i''i; (a;b)<@c (,i) ,@1 1[ci] a~b; (keep scalar if scalar, vector otherwise) x(/rho)x; ii/x; (i#x)1-i#x; c((a),15)0.0; ((2m) #@1 c)-((a.+m)(a+b).+m)(a.+2m)a.+1+2m8; m1m; ((2m) #@1 c)(m @1 b.-m)(a.+2m)a.+1+2m; cx @0 1 c; p1+c[;8]1+c[;9]1+c[;10]1+c[;11]1+c[;12]1+c[;13]1+c[;14]; p1+c[;0]1+c[;1]1+c[;2]1+c[;3]1+c[;4]1+c[;5]1+c[;6]1+c[;7]p; pp(x*a)((1-x)*b)abeta{a;b}; (i#p)1-i#p; rhop } incompletegamma {a;x} : { Incomplete gamma function Abramowitz & Stegun 6.5.31 Sitte if (/(,0>x),,0a) 'domain error'; if ((1,a)^(1,x)^(,a),x) 'domain error'; rhoxa; x,rhox; a(x)a; p(x)0.0; if (#ii(b(x1)xBl9D-5$;9.c?.c?9@5$;@D-@ Y>Bl9(VM*Ckl[?ؒ>kl[?3Ί?{5??̓@@VH|@ 2ȚHS@ ֯/@}A@`@gh@&5@,v@*^@fYK"!oiSgj5"N==ScavbHt 1 n3mm*+J]l]Ful!}D[ GR*g*4ci?4ci?*g*?R?D[ G?l!}@Fu@]l]@+J@ n3mm*@ 1@Ht@avb@==Sc@5"N@Sgj@i@"!o2^CBI+ڎd1X-+r^n^3 Bfg;ډ%#JX:?2ПưԿJ<ӿF>?F>?J1g\%>,cv8'm?8'm?>,cv?u>1g\%?SI?2<k}R 7.Ox _i:oO;fJ۹avO}옣2찰 1BPKz?z?1BPK?찰 ?2?옣?vO}@J۹a@f@oO;@ _i:@x@.O@}R 7@k@d>2<@OF$ Z@a+1./@)@γPγP+)6B$߮XХyUi)cc9'ViY I< 'ؽ ɌwYL]!择0ws/9S(&S8F0Z֠T4u?֠T4u?Z?S8F0?(&?ws/9S@!择0@@L]@ ɌwY@ 'ؽ@I<@iY @c9'V@)c@i@ХyU@߮X@+)6B$@γPγPu!G\g+P"+j&itciEC[ƲK;*| 0?PB29A5iY;D` FC 5; ܷ[Ôc:W*h1H}t{ިŪ#DKp3/*[P]w6qV& PL6 YE my܆u'wu!ZX-]ٿ+9S?+9S??ZX-]?'wu!?@܆u@@my@ YE @ PL6@V&@6q@*[P]w@p3/@#DK@ިŪ@t{@h1H}@>*@γPγPB{SEP½q.I8k~iRĂb4B8JS`x"X6a2\ l,lh y(} wd3-Kv42 zt"L_WK].n@0?n@0?].?L_WK?"?zt?2 @Kv4@d3-@ w@ y(}@ l,lh@6a2\@x"X@S`@8J@4B@iRĂb@I8k~@P½q.@B{SE@γPγP _mȇ/t#fY#Nmu p2ϮE8?@?j5N@ 'f}'Bg/)[SL6Ka%c2YRxՏa-Ӯ?Տa-Ӯ?YRx?2?%c?6Ka@L@)[S@g/@}'B@ 'f@N@@?j5@E8?@@p2Ϯ@u @#Nm@#fY@/t@ȇ@ _m@γPγPa U;;>K^Na UI,< Ycv0EcIKV+ k7? >O-9yץby$+trȿ~ /$ X꬯vi^`P~?P~?i^`?꬯v?$ X? /?~@y$+tr@9yץb@O-@ >@ k7?@IKV+@Ec@0@Ycv@ @<@a UI,@@>K^N@a U;;@γPγPo8^෉G1˕?˕?G1?^෉?>8?Ј?zv@^Z@[3B@Π@K/@ £r&@ m=#p@zV#@q@]Tk@F|~~@?#`x@zW @ £rh*@ m;?7@ m? B?K9ߴ?Z@~ @F@ N@%6?5h@,z~K@3-əIr`@97̝@@5?z?㓄nl8?3ӄ@DU@e(.@`G%@#>=@*r@18)@6&D@<|k|?@B*u?mF?:?`fe@vO[@@+E:Zb0@!G7&@' %'@/V@3w{8 @9/ms@?@D\N? xe?n?`{@@rGִ@tS.@MY]H@ G͎KH@%?le@,ki@27o@6/ӽ@0@oP](@Nt @@ زe@%y6@+R@0v`h+@4Owû@8p~~m@=+@AP_Q@DZ@|@Hjţ@M]?? H ?ؽf[?"m@&2Y@[i@-M0pf@yw<1@$C ̅@)v6hM@/a;n@3 7@6J 0@;)!M@@h@B@[T@F(Xw@J( 0 W@OfH1?J`?R?THwv?Q 09)@\-5@2z;&@umt@3n@#0TC$@(`eN@-@1 @5zݺ4@9sz7@=|@A6@Dj  @G[—@K'X@P T0?7a[R?ִ__?*:?ƶ@gM@S5@^ }]@][[~@"9&c2@&x&@,QE@0* @4GLb)@7^{@<&J@@`1@B&@E+5@IyB E@M,@@Q]3h?s㦂,?ձv?X?w-@E@ mgCK}@a/=@ -n2@![Y@%At@*O4@0d=@37@6^vGW@:y@>86"'@A΁@@D, 8@GXQ"GT@K&I@OmTJ@Rc? J}?*yp?`$%07?IS%m@"Pgf@ $rK@{t-e\C@u1@ @@$ L/@)mzyEYm@.ء@2E N1X@5@9 [%@= j@@N(@CAl@F~@I0hG@LՋY@Pȫ6@So 1..?7ٝ`?W?ݨ\_+??k\J@W*@ XX,@ Z@W!@$|@#LR@(J,-@-I7 J@1kӃ@4}`^@7'XL@;}@?ƪrv@B-b%c@Dd@G@J彺 @N}iz@Q}W @T_Ιt?h1Z?" 6?猒2-?,@PՄ@ @l@a߀9@fLYwX@"U$@'B>X@,-@0.@3Kpe@6u_Z@:O gu@>1HJz@AZ@F6qC@I!ݖΎ@Ln?5|@Pe@Rb0h:@UPcL3?9ؚ?iκCǁ?6?E@@0 x@6 _@Ɋ'@2s@";Rau@&OI`@*ex@//@2~@5Q@9U@<q @@f=@3&j@B{,R4@EH3r@G@@@J{ZfR@NFUJ%@P@SGL@VAYHHaplus-fsf-4.22/src/contrib/legroots.m0000444000265000001440000003174007252205443013267 uuuyE3?yE3~?rH?~?rHm9?=??=?m9lS:i;#?;#?lS:iN(U^΋6u?΋6u?(U^?N_|b*纟׿]b?]b?纟?_|b* f~JI!)X2zO*ο뮙^役"ᗿۼ jۿPxz?Pxz?ۼ j?役"?뮙^?*>*οM/鳿bG;]g!Ao|M@1B?@1B?o|M?]g!A?bG;?M/鳿h.O ؏EOw׊ 0?0?׊ ?Ow? ؏E?O?h.~mv)f\Qpڿ馇xC 3dܴtxy,I?y,I?ܴtx? 3d?馇xC?\Qp?~mv)fݪOxnmٶM w|NlVI}6v?}6v?lVI?|N?M w?xnmٶ?O?ݪ|2摿$$!.nEgo9ƒWִb?b?9ƒWִ?Ego?.n?$!?$?|2摿,&Mxſ9fR@5D,EݤrƿŤf诿P%CtB3|Rfv?Rfv?B3|?P%Ct?Ťf?,Eݤr?@5D?9fR?,&MxſVExkcK*M=])E c ug8)zVsؑ0b$?ؑ0b$?zVs?g8)? c u?)E?*M=]?kcK?VExGϿ3 =vMv)"LݠX餄Z!$ſgj㿵д@?д@?gj?Z!$?餄?"LݠX?vMv)?3 =??GTQrXf5西SS'%o7i9ݻ8صBĆSc?ĆSc?B?ݻ8ص?7i9?'%o?SS?5?rXf?TQǵؿۧm~1As sFZ?Y?~VR(6=?=?(6?VR?Y?~?Z??sF? ?1As?ۧm~?ǵؿZ$tqt(#NϫRh$Y3z=y܋s(k&ܿn ¡UD?¡UD?n ?(k&?܋s?Y3z=y?h$?NϫR?qt(#??Z$tB@ P+&d?xX봼8l5˗>F9=Z[`?[ /Fʛ+a n'?n'?ʛ+a ?F? /??[?9=Z[`?5˗>F?봼8l??xX? P+&d?B@&c|Y.@ZZ/TR;FqNWM y4{W[AC*U]?C*U]?W[A?4{?M y?W?FqN?R;?Z/T?.@Z?c|Y?&ؒl׿0dXZv|]d=t "a.)*t{E$)ň vBOfS?fS?vBO?)ň ?E$?t{?.)*?"a?=t ?]d?XZv|?0d?ؒl׿ۚJLHԿ@ԲABT,8B*(꫏1Kؿ޿|6/oE?rrk7\ſt|?t|?7\?rrk?E??|6/o??K?꫏1?B*(?,8?@ԲABT?ۚJLHԿۚJLHڿNRO ӥh% ]'XgbͿI!rQjKE%vD ˙rؿҰ5k.ƣOP⿮Sh$o?Sh$o?ƣOP?Ұ5k.?˙r?E%vD ?jK?I!rQ?'Xgb? ]?h%?O ӥ?NR?ۚJLHڿۚJLHݿ[zm[Bz( f _VpV1yP=a@8BϿL2ut;} Հ7̿-N_?-N_?7?Հ?;} ?L2ut?@8B?=a?V1yP?f _Vp?z( ?m[B?[z?ۚJLHݿۚJLH޿fdhJNLݡd3qϽ&1'@ zG5 ҲU?5 ҲU? zG?'@?qϽ&1?>3?=?Qp?,t?.T֩?l)V?zNDj?f?qE6?ۚJLH߿ۚJLH߿z5xq)nJ̿=̀8葡TʏP Y2,gбܜ3L֒S/KòcdZZpA4?ZpA4?òcdZ?K?֒S/?ܜ3L?,gб?Y2?TʏP ?葡?̀8?=?nJ?q)?z5x?ۚJLH߿ۚJLH߿Ym4xEbuࠗHݿ;mi礷^ vAN#ޚݐPhܩ.%[\ 1|t^k?|t^k?\ 1?ܩ.%[?Ph?ޚݐ?#? vAN?礷^?;mi?ࠗH?xEbu??m4?Y?ۚJLH߿ۚJLH߿!ľU),߿K'п쮩V.v̿liHAn 1Wa7W<ΑFB8(g:8kW䢿=UW Π F~8Hę?Hę?~8?Π F?=UW ?kW?8(g:8?ΑFB?7W6LM2 ɳRI tеlQ O2JۿпޞgUܿU{r673XU+>14V?4V?>1?XU+?r673?U{??U?пޞg?O2J?lQ ?tе?I ? ɳR?6LM2? )>?ۚJLH߿ۚJLH߿_uLۢd&2؈ Ƃg'뵼*U#]ϿZfw]1Tz޺͌' ~ڿ I}j%tmpʹM9H?M9H?mpʹ?j%t? I}?~?޺͌' ??1Tz?]?Zfw?#]?뵼*U? Ƃg'?&2؈ ?Lۢd?_u?ۚJLH߿ۚJLH߿+Jv @D65˹iP5t4hg o%+©y&ΣSv^ϿԽ;3f.IAzc6gƈW'Eœ?Eœ?ƈW'?c6g?.IAz?f?3?Խ;?ΣSv^?©y&? o%+?t4hg?iP5?65˹?@D? ?+Jv?ۚJLH߿ۚJLH߿ߊ'=ȿXFE_^0\ b^(dJ⃿An#pږW׿`D!n@ 'ߙU9U,0Ն+y5 ڕSKy zl{7'?{7'?zl?SKy ? ڕ?+y5?,0Ն?U9U?@ 'ߙ?`D!n?W?#pږ?An?(dJ?\ b^?XFE_^0?=?ߊ'?ۚJLH߿ۚJLH߿eĪ:&na ?G[!տ8|^MB@8Ow|qyĿYܓa\ %JXͿÿX1ZnTkl?kl?X1ZnT?XͿ? %J?a\?Yܓ??qy?Ow|?MB@8?|^?8?[!??G?na ?&?eĪ:?ۚJLH߿ۚJLH߿?+'1G; kퟨ&'DCs5v.Ck|zd0)stŮpda/JXly& gpcBο!M?@0_xK?xK?@0_?!M??cB?gp?& ?/JXly?a?tŮpd?d0)s?.Ck|z?5v?Cs?D?ퟨ&'?k?1G; ??+'?ۚJLH߿ۚJLH߿Z,QEZο;v<c>Ћw7U-F1"BHj倫E -<jL{[ţ;.N%)g=BȪPw⿽#rY?rY?#?ȪPw?)g=B?;.N%?{[ţ?jL?<? -?倫E?F1"BHj?U-?c>Ћw7?<?;v?QEZ?>?ES?ﴑ޹b?ۚJLH߿ۚJLH߿>%C?N$Qǿ+Ožf|)؀ꥩ;&竩Lju_̿'IY77,_nJtץdQ_lMxo \ ,?\ ,?Mxo ?_l?Q?ץd?Jt?,_n?7?'IY7?u_?竩Lj?;&?ꥩ?؀?|)?žf?+O?N$Q?>%C??ۚJLH߿ۚJLH߿t4 *W E mJ:V /&N їlOοl zhNjs tBow ;7,ݔ9N$tA "_p'Q DŽ >yS;S\}?}?S;S\?DŽ >y?_p'Q ? "?N$tA?ݔ9?;7,?ow ?B?js t? zhN?l?O?l?&N ї? /?J:V?W E m?t4 *?ۚJLH߿ۚJLH߿ᆭ^_}Oڿ# ^7FA6iXEqit-?9ѾHc-hK"a&R]B y?ɿ֜.;-[.1˃ߙԿlJbNxPlU?xPlU?lJbN?˃ߙ?;-[.1?֜.????y?]B ?&R?K"a?c-h?ѾH?-?9?Eqit?FA6iX?# ^7?O?^_}?ᆭ?ۚJLH߿ۚJLH߿Y/Ja_5`ՠހk?LLbtzH%otS +j!HX=Q;;7Dͳ$mTEJ)gӥX`:|3(N MGy@םWJlnMRѥ?nMRѥ?Jl?y@םW?N MG?3(?:|?X`?)gӥ?EJ?$mT?ͳ?7D?X=Q;;?!H?S +j?ot?btzH%??LL?ՠހk?_5`?Y/Ja?ۚJLH߿ۚJLH߿bГ84r\鳿XopW{* a߿"ZU޽NR[}nڨ^Aaa,Ͽv ]˿ݽƝ›oը9AskmfR-k[Ϳ!w~?!w~?[?R-k?skmf?ը9A?›o?ݽƝ?]?v ?a,?^Aa?nڨ?R[}?U޽N?"Z? a?{*?XopW?\?84r?bГ?ۚJLH߿ۚJLH߿dzhlm8D EOJiHp9dZݿbꑗNMtUG#nbo$)׼h!'a qaд.U:"5Lֿ<7({a 'ńGT㿹ȳJD82?JD82?ȳ?ńGT?'?({a ?<7?5L?U:"?aд.?'a q?׼h!?o$)?nb?MtUG#?ꑗN?b?dZ?Hp9?EOJi?8D ?hlm?dz?ۚJLH߿ۚJLH߿ۜ:ſ(: [6-}Ѯ M^|ȿ9 铕9>m(H?!οGIpٿZFb! &p@\ܔ]5ؼ ;[mǔ[+лٟ-:rX0??rX0?:?лٟ-?ǔ[+?ؼ ;[m?ܔ]5?&p@\?b! ?ZF?GIp??!?>m(H?铕9??9 ?|?M^?Ѯ ?[6-}?(: ?ۜ:?ۚJLH߿ۚJLH߿ۙr3\;ǿ'XOOk0 /_ۿUSK!¿U7ֆmͿ苯\+ i/1#1/xk~ོ)*ἷA5'XjR5yrvd%RCTĢ%Y@Lʩ">m?">m?Lʩ?Ģ%Y@?T?d%RC?R5yrv?'Xj?ἷA5?ོ)*?xk~?1/?/1#?+ i?苯\?ֆm?U7?USK!?/_?0 ?OOk?'X?r3\;?ۙ?ۚJLH߿ۚJLH߿۞Q0 XcہfSہfZ]&!,765!6׿?hvKV.ܪ"|tvXYjnL*{|̿p ہf»οVUbHɿ9UM3O3(M\?>(M\?Lߐ?tq@?˦ |?Ѯ#nK?xy2?-8+K?ɠd?$a<&?=zZ?rLA6?/?s;Ow]?uFl?/m?.x?79?H?NZ?j?H ?ɠ]?ɠ|?r]7&%ZoK'n]Y]-6K(;?6K(;?'n]Y]-?K?%Zo?7&?r]?ځ+ҝ>?64?Ǚp-?T@w?m/A?cE: ?̉?~@?\źP?pC1? A?~?zWJ?mUV?5?6?#@?Bk38y?ۚJLH߿ۚJLH߿%/NvBk38y*vRԯ:~). RsnlzWJQ.sq( RqhsBYRyy/bȊǿ9[*v?(m,8D–5ԯ:~`ʜnfumUV:??UV:?um?ʜnf?`?ԯ:~?D–5?m,8?*v?(?9[?Ȋ?Ryy/b?sBY?qh?q( R?s?.?Q?zWJ?snl?. R?ԯ:~)?*vR?Bk38y?%/Nv?ۚJLH߿ۚJLH߿2X2ؿo-O"|6j;Fj]пMWj$grgPw N$t߿.YD̿w(tvM|o7ʿB 7VẆմ"|FjْKTB{̔҅nС n{X[a$ <? Ƌ֡Ƌ?p?퇁/I?}/\?ۚJLH߿ۚJLH߿ݣU׿ݙ$7|?$ޝT.s{ڿԛ΀D.'{# C'Ö$-տ"00%L7Ϳ"2$iwBPD! Ey7gRݜ.qB}ԛſD.()2:ѿBѿ]w\?w\?]?B?)2:?D.(?ԛ?B}?.q?7gRݜ?Ey?! ?D?wBP?$i?"2?%L7?"00?$-?'Ö?# C?D.'{?ԛ΀?.s{ڿ$ޝT?$7|?ݙ?ݣU?ۚJLHaplus-fsf-4.22/src/scripts/0000777000265000001440000000000010774512700011363 5aplus-fsf-4.22/src/scripts/README0000444000265000001440000000043607426323266012167 This directory contains general purpos A+ scripts called gadgets. Most of these gadgets have an associated doc file that describes it. These are supplied primarily as learning tools. Feel free to contribute your work to this collecton, by mailing your script to: aplus@aplusdev.org aplus-fsf-4.22/src/scripts/Makefile.am0000444000265000001440000000447710304477231013343 ## Process this file with automake to produce Makefile.in ############################################################################### ## ## ## Copyright (c) 2001 Morgan Stanley Dean Witter and Co. All rights reserved.## ## See .../src/LICENSE for terms of distribution. ## ## ## ## ## ############################################################################### scriptsdir = $(prefix)/scripts scripts_DATA = \ README \ abx.+ \ abx.doc \ act.+ \ act.doc \ afm.+ \ afm.doc \ apl.+ \ apl.doc \ bfm.+ \ bfm.doc \ blt.+ \ blt.doc \ box.+ \ bro.+ \ bro.doc \ bxt.+ \ bxt.doc \ cbr.+ \ cbr.doc \ cft.+ \ cft.doc \ client.+ \ client.doc \ dio.+ \ dio.doc \ disp.+ \ disp.doc \ dlu.+ \ dlu.doc \ doc.+ \ doc.doc \ fcp.+ \ fcp.doc \ file.+ \ files \ fit.+ \ fkt.+ \ fkt.doc \ flu.+ \ flu.doc \ fnt.+ \ fnt.doc \ gyr.+ \ gyr.doc \ manydoc.+ \ manydoc.doc \ pop.+ \ pop.doc \ qio.+ \ qio.doc \ rap.+ \ rap.doc \ rgb.+ \ rgb.doc \ scriptsDir.+ \ server.+ \ server.doc \ sst.+ \ sst.doc \ stp.+ \ stp.doc \ tbr.+ \ tbr.doc \ ted.+ \ ted.doc \ tim.+ \ tim.doc \ tl.+ \ tl.doc \ trc.+ \ trc.doc \ tss.+ \ tss.doc \ vim.+ \ vim.doc \ vlt.+ \ vlt.doc \ xyz.+ \ xyz.doc \ zgl.+ \ zgl.doc EXTRA_DIST = \ README \ abx.+ \ abx.doc \ act.+ \ act.doc \ afm.+ \ afm.doc \ apl.+ \ apl.doc \ bfm.+ \ bfm.doc \ blt.+ \ blt.doc \ box.+ \ bro.+ \ bro.doc \ bxt.+ \ bxt.doc \ cbr.+ \ cbr.doc \ cft.+ \ cft.doc \ client.+ \ client.doc \ dio.+ \ dio.doc \ disp.+ \ disp.doc \ dlu.+ \ dlu.doc \ doc.+ \ doc.doc \ fcp.+ \ fcp.doc \ file.+ \ files \ fit.+ \ fkt.+ \ fkt.doc \ flu.+ \ flu.doc \ fnt.+ \ fnt.doc \ gyr.+ \ gyr.doc \ manydoc.+ \ manydoc.doc \ pop.+ \ pop.doc \ qio.+ \ qio.doc \ rap.+ \ rap.doc \ rgb.+ \ rgb.doc \ scriptsDir.+ \ server.+ \ server.doc \ sst.+ \ sst.doc \ stp.+ \ stp.doc \ tbr.+ \ tbr.doc \ ted.+ \ ted.doc \ tim.+ \ tim.doc \ tl.+ \ tl.doc \ trc.+ \ trc.doc \ tss.+ \ tss.doc \ vim.+ \ vim.doc \ vlt.+ \ vlt.doc \ xyz.+ \ xyz.doc \ zgl.+ \ zgl.doc aplus-fsf-4.22/src/scripts/Makefile.in0000644000265000001440000002030510774512524013350 # Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ ############################################################################### ############################################################################### SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CXX = @CXX@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ STRIP = @STRIP@ VERSION = @VERSION@ X_INCLUDES = @X_INCLUDES@ X_LIBS = @X_LIBS@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ scriptsdir = $(prefix)/scripts scripts_DATA = \ README \ abx.+ \ abx.doc \ act.+ \ act.doc \ afm.+ \ afm.doc \ apl.+ \ apl.doc \ bfm.+ \ bfm.doc \ blt.+ \ blt.doc \ box.+ \ bro.+ \ bro.doc \ bxt.+ \ bxt.doc \ cbr.+ \ cbr.doc \ cft.+ \ cft.doc \ client.+ \ client.doc \ dio.+ \ dio.doc \ disp.+ \ disp.doc \ dlu.+ \ dlu.doc \ doc.+ \ doc.doc \ fcp.+ \ fcp.doc \ file.+ \ files \ fit.+ \ fkt.+ \ fkt.doc \ flu.+ \ flu.doc \ fnt.+ \ fnt.doc \ gyr.+ \ gyr.doc \ manydoc.+ \ manydoc.doc \ pop.+ \ pop.doc \ qio.+ \ qio.doc \ rap.+ \ rap.doc \ rgb.+ \ rgb.doc \ scriptsDir.+ \ server.+ \ server.doc \ sst.+ \ sst.doc \ stp.+ \ stp.doc \ tbr.+ \ tbr.doc \ ted.+ \ ted.doc \ tim.+ \ tim.doc \ tl.+ \ tl.doc \ trc.+ \ trc.doc \ tss.+ \ tss.doc \ vim.+ \ vim.doc \ vlt.+ \ vlt.doc \ xyz.+ \ xyz.doc \ zgl.+ \ zgl.doc EXTRA_DIST = \ README \ abx.+ \ abx.doc \ act.+ \ act.doc \ afm.+ \ afm.doc \ apl.+ \ apl.doc \ bfm.+ \ bfm.doc \ blt.+ \ blt.doc \ box.+ \ bro.+ \ bro.doc \ bxt.+ \ bxt.doc \ cbr.+ \ cbr.doc \ cft.+ \ cft.doc \ client.+ \ client.doc \ dio.+ \ dio.doc \ disp.+ \ disp.doc \ dlu.+ \ dlu.doc \ doc.+ \ doc.doc \ fcp.+ \ fcp.doc \ file.+ \ files \ fit.+ \ fkt.+ \ fkt.doc \ flu.+ \ flu.doc \ fnt.+ \ fnt.doc \ gyr.+ \ gyr.doc \ manydoc.+ \ manydoc.doc \ pop.+ \ pop.doc \ qio.+ \ qio.doc \ rap.+ \ rap.doc \ rgb.+ \ rgb.doc \ scriptsDir.+ \ server.+ \ server.doc \ sst.+ \ sst.doc \ stp.+ \ stp.doc \ tbr.+ \ tbr.doc \ ted.+ \ ted.doc \ tim.+ \ tim.doc \ tl.+ \ tl.doc \ trc.+ \ trc.doc \ tss.+ \ tss.doc \ vim.+ \ vim.doc \ vlt.+ \ vlt.doc \ xyz.+ \ xyz.doc \ zgl.+ \ zgl.doc subdir = src/scripts mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_CLEAN_FILES = DIST_SOURCES = DATA = $(scripts_DATA) DIST_COMMON = README Makefile.am Makefile.in all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/scripts/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: scriptsDATA_INSTALL = $(INSTALL_DATA) install-scriptsDATA: $(scripts_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(scriptsdir) @list='$(scripts_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(scriptsDATA_INSTALL) $$d$$p $(DESTDIR)$(scriptsdir)/$$f"; \ $(scriptsDATA_INSTALL) $$d$$p $(DESTDIR)$(scriptsdir)/$$f; \ done uninstall-scriptsDATA: @$(NORMAL_UNINSTALL) @list='$(scripts_DATA)'; for p in $$list; do \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " rm -f $(DESTDIR)$(scriptsdir)/$$f"; \ rm -f $(DESTDIR)$(scriptsdir)/$$f; \ done tags: TAGS TAGS: DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = ../.. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: $(mkinstalldirs) $(DESTDIR)$(scriptsdir) 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_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_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-generic clean-libtool mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-scriptsDATA install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool uninstall-am: uninstall-info-am uninstall-scriptsDATA .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-scriptsDATA install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool uninstall uninstall-am uninstall-info-am \ uninstall-scriptsDATA # 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: aplus-fsf-4.22/src/scripts/abx.+0000644000265000001440000000255210772770472012143 Copyright (c) 1990-2008 Morgan Stanley All rights reserved. See .../src/LICENSE for terms of distribution. $cx abx popup{s;d;i;p;c;v}:(c,`_ABX) .has `raise .show c,`_ABX locate{c} natural{c} sensitive{c;0} hide_msg{c;v;d} hide_msg{c;v;d}:(c,v) .has (`hide;0=#d) popdown{s;c;v}:(c%`_Z)`ok if (0=0`show .of c,`_ABX .hide c,`_ABX) sensitive{c;1} locate{c}:if (0<#l lc%`_LOCATE) if (0=0`show .of c,`_ABX) (c,`_ABX) .has (`yx;0(0`YX .of l)+.5(0`yxs .of l)-0`yxs .of c,`_ABX) natural{c}:if (c%`_SIZE) (c,`_ABX) .has `naturalsize sensitive{c;x}:if (0<#w wc%`_SHELLS) w .has<(`sensitive;x) newlines{s;d;i;p;c;v}:if (~nld nl"\n") d else >(/>#z)١z z1ա(d=nl)d((nl1d)/nl),d define{cx}: { WSs.autows{()}; (cx%`_FONT)'kaplscreen-bold'; (cx%`_Z)(); (cx%`_SIZE)1; (cx%`_SHELLS)(); (cx%`_MSG)''; (cx%`_STUFF)(); (cx%`_LOCATE)(); (cx%`_OK)<{popdown}; (cx%`_ABX)(`_MSG;`_STUFF;`_OK); (cx,`_MSG) .is `label; (cx,`_STUFF) .is `layout; (cx,`_OK) .is `button; (cx,`_ABX) .is `layout; fcx`_FONT; (cx,`_OK) s.uses (`font;f;`titlefont;f); (cx,`_MSG) s.uses (`font;f); (cx,`_OK) .has (`title;'OK';`acceptfocus;0;`dynamic;1); (cx,`_STUFF) .has (`title;'';`newshow;1;`reshow;0); (cx,`_MSG) .has (`preset;newlines;`set;popup); (cx,`_ABX) .has (`C;1;`title;'';`exit;0;`realize;1); s.autows{WS}; cx`_ABX } aplus-fsf-4.22/src/scripts/abx.doc0000444000265000001440000000420607426305436012546 abx === 0. Description. The abx gadget is a standard "alert" dialog box. 1. Operation. _ABX is a layout of a message _MSG and an "OK" button _OK. Assign _MSG to pop up ABX dialog. Press _OK to pop the dialog down and set the result _Z to `ok. Newlines in _MSG ("\n") are converted to new rows. _STUFF is an empty layout in the ABX dialog, set aside for the application. _SIZE is a boolean, which tells ABX to `naturalsize when it pops up (1) or not (0). _SHELLS is a vector of windows to make insensitive for the duration of the dialog. _LOCATE is (), or a window over which the ABX dialog is to centered. (Thanks to rloukes for idea & code.) NB: The "OK" button respects the pin-state of the dialog: if pinned, the dialog will not hide, nor will any shells in _SHELLS be returned to the sensitive state until the dialog is unpinned and "OK" pressed. 2. zdefine cx cx = target context of apply/cancel dialog z = `cx._ABX Define an abx-gadget in the specified context. 3. Variables _FONT Electric font variable _SIZE Naturalsize (1) or not (0) _ABX Outer layout _MSG Activator label _OK "OK" button _STUFF Empty application layout _SHELLS Vector of windows to make insensitive _LOCATE Scalar of window over which to pop dialog _Z Result variable 4. Restrictions ABX dialog controls `set and `preset callbacks on _MSG. pin-unpin does not hide window (`exit callback on _ABX nulled) OK action hides window regardless of pin state. The _STUFF layout can be used as a structure for application- specific operations. _STUFF has `newshow = 1 and `reshow = 0, s.t. _STUFF`object --> object will be shown _STUFF() --> object will be hidden _MSG'' causes _ABX to pop up with _MSG hidden. 5. Example $load s $load abx $cx foo abx.define `foo `foo._ABX foo._SHELLS`my.win1 `my.win2 foo._LOCATE`my.win1 foo._MSG'this is a message' dialog popup foo._Z my.win1 and my.win2 are insensitive () press "OK" - dialog pops down] foo._Z my.win1 and my.win2 are sensitive `ok foo._MSG'' pop up ABX with _MSG hidden aplus-fsf-4.22/src/scripts/act.+0000644000265000001440000000306610772770472012141 Copyright (c) 1990-2008 Morgan Stanley All rights reserved. See .../src/LICENSE for terms of distribution. $cx act popup{s;d;i;p;c;v}:(c,`_ACT) .has `raise .show c,`_ACT locate{c} natural{c} sensitive{c;0} hide_msg{c;v;d} hide_msg{c;v;d}:(c,v) .has (`hide;0=#d) popdown{s;c;v}:(c%`_Z)s if (0=0`show .of c,`_ACT .hide c,`_ACT) sensitive{c;1} locate{c}:if (0<#l lc%`_LOCATE) if (0=0`show .of c,`_ACT) (c,`_ACT) .has (`yx;0(0`YX .of l)+.5(0`yxs .of l)-0`yxs .of c,`_ACT) natural{c}:if (c%`_SIZE) (c,`_ACT) .has `naturalsize sensitive{c;x}:if (0<#w wc%`_SHELLS) w .has<(`sensitive;x) newlines{s;d;i;p;c;v}:if (~nld nl"\n") d else >(/>#z)١z z1ա(d=nl)d((nl1d)/nl),d define{cx}: { WSs.autows{()}; (cx%`_FONT)'kaplscreen-bold'; (cx%`_Z)(); (cx%`_SIZE)1; (cx%`_SHELLS)(); (cx%`_MSG)''; (cx%`_STUFF)(); (cx%`_LOCATE)(); (cx%`_APPLY)(popdown;`apply); (cx%`_CANCEL)(popdown;`cancel); (cx%`_ACT)(`_MSG;`_STUFF;`_APPLY `_CANCEL); (cx,`_MSG) .is `label; (cx,`_STUFF) .is `layout; (cx,`_APPLY) .is `button; (cx,`_CANCEL) .is `button; (cx,`_ACT) .is `layout; fcx`_FONT; (cx,`_APPLY) s.uses (`font;f;`titlefont;f); (cx,`_CANCEL) s.uses (`font;f;`titlefont;f); (cx,`_MSG) s.uses (`font;f); (cx,`_APPLY) .has (`title;'Apply';`acceptfocus;0;`dynamic;1); (cx,`_CANCEL) .has (`title;'Cancel';`acceptfocus;0;`dynamic;1); (cx,`_STUFF) .has (`title;'';`newshow;1;`reshow;0); (cx,`_MSG) .has (`preset;newlines;`set;popup); (cx,`_ACT) .has (`C;1;`title;'';`exit;0;`realize;1); s.autows{WS}; cx`_ACT } aplus-fsf-4.22/src/scripts/act.doc0000444000265000001440000000444107426305440012537 act === 0. Description. The act gadget is a standard "apply/cancel" dialog box. 1. Operation. _ACT is a layout of a message _MSG, an apply button _APPLY, and a cancel button _CANCEL. Assign _MSG to pop up ACT dialog. Press _APPLY or _CANCEL to pop the dialog down and set the result _Z to one of the symbols `apply or `cancel. Newlines in _MSG ("\n") are converted to new rows. _STUFF is an empty layout in the ACT dialog, set aside for the application. _SIZE is a boolean, which tells ABX to `naturalsize when it pops up (1) or not (0). _SHELLS is a vector of windows to make insensitive for the duration of the dialog. _LOCATE is (), or a window over which the ACT dialog is to centered. (Thanks to Rick Loukes for idea & code.) NB: "Apply" and "Cancel" respect the pin-state of the dialog: if pinned, the dialog will not hide, nor will any shells in _SHELLS be returned to the sensitive state until the dialog is unpinned and either Cancelled or Applied. 2. zdefine cx cx = target context of apply/cancel dialog z = `cx._ACT Define an act-gadget in the specified context. 3. Variables _FONT Electric font variable _SIZE Naturalsize (1) or not (0) _ACT Outer layout _MSG Activator label _CANCEL Cancel button _APPLY Apply button _STUFF Empty application layout _SHELLS Vector of windows to make insensitive _LOCATE Scalar of window over which to pop dialog _Z Result variable 4. Restrictions ACT dialog controls `set and `preset callbacks on _MSG. pin-unpin does not hide window (`exit callback on _ACT nulled) Apply/Cancel action hides window regardless of pin state. The _STUFF layout can be used as a structure for application- specific operations. _STUFF has `newshow = 1 and `reshow = 0, s.t. _STUFF`object --> object will be shown _STUFF() --> object will be hidden _MSG'' causes _ACT to pop up with _MSG hidden. 5. Example $load s $load act $cx foo act.define `foo `foo._ACT foo._SHELLS`my.win1 `my.win2 foo._LOCATE`my.win1 foo._MSG'this is a message' dialog popup foo._Z my.win1 and my.win2 are insensitive () press "Apply" - dialog pops down] foo._Z my.win1 and my.win2 are sensitive `apply foo._MSG'' pop up ACT with _MSG hidden aplus-fsf-4.22/src/scripts/afm.+0000644000265000001440000000447510772770472012142 Copyright (c) 1990-2008 Morgan Stanley All rights reserved. See .../src/LICENSE for terms of distribution. $cx afm USERNAMEsys.getusername{} set_files{s;d;i;p;c;v}: { (c%`_FILE)''; xsys.agetdents{c%`_DIR}; if (0<#s sc%`_SUFFIX) { xx; d-#s; x(-+/^\x=' ')x; xd@1(^/@1 (d@1 x)=@1 s)/x; x(~^/~\@1 ' 'x)/@1 x; x((x=' ')@10)@0 1x; }; (c%`_FILES)(x)#x; (c,`_FILES) .has (`row;1); } dltb{x}:((\x' ')^\x' ')/x select_file{s;c;v}:(c%`_FILE)if (1=r0`row .of c,v) '' else dltb{r#c%v},c%`_SUFFIX preset_mode{s;d;i;p;c;v}:if (d0c%`_MODES) d else `domain set_mode{s;d;i;p;c;v}:(dc%`_MODES)1 (1c%`_MODES)ۡd=0c%`_MODES set_modes{s;d;i;p;c;v}: { if (`symp) (); (c,`_MODE) _spcb (;); (c,`_MODE) _scb (;); (c%`_MODE)p; (c,`_MODE) _spcb (preset_mode;); (c,`_MODE) _scb (set_mode;); case (p) { `get; get_mode{c}; `put; put_mode{c}; `drop; drop_mode{c}; } } get_mode{c}:(c,`_USER) .has (`protect;0) (c%`_TRIGGER)c%`_TRIGGER (c,`_NEW) .has (`protect;1) (c%`_NEW)'' put_mode{c}:(c,`_USER) .has (`protect;1) (c%`_USER)USERNAME (c,`_NEW) .has (`protect;0) drop_mode{c}:(c,`_USER) .has (`protect;1) (c%`_USER)USERNAME (c,`_NEW) .has (`protect;1) (c%`_NEW)'' define{cx}: { WSs.autows{()}; (cx%`_FONT)'kaplscreen-bold'; (cx%`_MODE)`get; (cx%`_USER)USERNAME; (cx%`_FILE)''; (cx%`_APPL)''; (cx%`_SUFFIX)''; (cx%`_TRIGGER)0; cx"_DIR:'/u/',_USER,'/',_APPL,'/'"; (cx%`_FILES)0 0''; (cx%`_MODES)(`get `put `drop;(1;0;0)); (cx%`_NEW)''; (cx%`_AFM)(`_MODES;`_USER;`_FILES;`_NEW); (cx,`_MODES) .is `radio; (cx,`_USER) .is `scalar; (cx,`_FILES) .is `view; (cx,`_NEW) .is `scalar; (cx,`_AFM) .is `layout; (cx`_USER `_APPL `_SUFFIX `_TRIGGER) _scb<(set_files;); fcx`_FONT; (cx,`_MODES) s.uses (`font;f;`titlefont;f;`labelfont;f); (cx,`_USER) s.uses (`font;f;`titlefont;f); (cx,`_NEW) s.uses (`font;f;`titlefont;f); (cx,`_FILES) s.uses (`font;f;`titlefont;f); (cx,`_MODE) .has (`preset;preset_mode;`set;set_mode); (cx,`_MODES) .has (`title;'';`geometry;`horizontal;`label;`Get `Put `Drop;`set;set_modes;`acceptfocus;0); (cx,`_USER) .has (`title;'User:'); (cx,`_FILES) .has (`title;'Current Files';`rows;7;`select;select_file); (cx,`_NEW) .has (`title;'New:'); (cx,`_AFM) .has (`title;''); s.autows{WS}; cx`_AFM } aplus-fsf-4.22/src/scripts/afm.doc0000444000265000001440000000513107426305443012533 afm === 0. Description. The AFM gadget ("Application File Manager") is a modification of the pup utility written by daveh and modified by mkr. 1. Operation. AFM is a window for selecting files in an application directory under a "mode". The set of files to be selected from is determined by the three variables _USER, _APPL, and _SUFFIX: _DIR:'/u/',_USER,'/',_APPL _SUFFIX is a character string which is chopped from the end of any matching files. E.g., if _SUFFIX'orother.m' and if file is somethingorother.m it will be displayed as something There are three modes: get, put, and drop. A mode is selected via the radio box _MODES, or by setting the gadget variable _MODE to one of `get, `put, or `drop. Either action causes a corresponding state-change in the companion variable. E.g., setting _MODE`put causes (`put_MODES) to become 1, and vice-versa. In "get" mode, the operator can enter a user name (_USER) and pick from the files displayed in _FILES. In "put" mode, the operator can enter a new file name (_NEW), but cannot change the user name from sys.getusername. In "drop" mode, the operator can neither enter a new file name nor change the user name from sys.getusername. 2. zdefine cx cx = target context of AFM z = `cx._AFM Define an AFM-gadget in the specified context. 3. Variables _FONT Electric font variable _MODE `get, `put, `drop _USER "username" (default = sys.getusername) _FILE Selected file _APPL Application name _SUFFIX Invisible filename suffix _DIR: Implied directory _FILES File view (depends on _DIR, _SUFFIX, _TRIGGER) _TRIGGER anything (triggers file refresh) _MODES Mode radio box _NEW New filename _AFM Outer layout 4. Restrictions Set callbacks set by AFM on: _MODE _MODES _SUFFIX _APPL _USER _TRIGGER Preset callback set by AFM on _MODE. Select callback set by AFM on _FILES. Variables which may be assigned: _FONT Font of all AFM objects _MODE Mode of AFM instance _USER User _APPL Application _SUFFIX Invisible filename suffix 5. Example $load s $load act $load afm afm.define `f f._APPL'myappl' seek in directory .../myappl/ f._SUFFIX'object.m' filename = ...object.m f._MODE`get initialize in "get" mode. act.define `g g._STUFF`f._AFM attention{s;d;i;p;c;v}:{ if (d`apply) { (mode;dir;file;new)s%`_MODE `_DIR `_FILE `_NEW; case (mode) { `get; `get; `put; `put; `drop; `drop } } } `g._Z _scb (attention;`f) g._MSG'Hello Woild' aplus-fsf-4.22/src/scripts/apl.+0000644000265000001440000000360710772771353012146 Copyright (c) 1990-2008 Morgan Stanley All rights reserved. See .../src/LICENSE for terms of distribution. $cx apl if( ()scriptsDirsys.readenv{"SCRIPTS_DIR"} ) { scriptsDir"/usr/local/aplus-fsf-4.22/scripts"; } _load{scriptsDir,"/disp"} disp.LINE1 vcat{a;b}:a,b (a;b)case ((1a)-1b) {1;((1b)@1 a;b);0;(a;b);1;(a;(1a)@1 b)} in{s;d;i;p;c;v}: { (ret;msg)if (0rc (rc;z)dod) (;z) else ('';'') (c%`_OUT)vcat{c%`_OUT;vcat{(5" "),d;disp.lay{z}}}; (c,`_OUT) .has (`firstrow;1e6); (c%`_MSG)msg; ret } OPTIONS_alsf{ ( `Line; `LINE; " "; `HOR; ""; `IOTA; `Tree; `TREE; " "; `VER; ""; `SAME ) } set_check{s;d;i;p;c;v}:if (`sym=p) (`disp%pOPTIONS)d clear{s;c;v}: { (c%`_OUT)0 0''; (c%`_IN)''; (c%`_MSG)''; } refer{s;c;v}: { (c%`_IN)t t(+/^\t=' ')t t(0`row .of c,v)#c%v; (c,`_IN) .has (`edit;1;`focus;1); } set_fmt{s;d;i;p;c;v}:(`disp%s)(d' ')/d define{cx}: { WSs.autows{()}; cx'_OPTIONS:(0apl.OPTIONS;(',(1';',Ρ`disp>1OPTIONS),'))'; cx'_INT:disp.INT'; cx'_FLOAT:disp.FLOAT'; (cx%`_FORMATS)`_INT `_FLOAT; (cx%`_OUT)0 0''; (cx%`_IN)''; (cx%`_CLEAR)<{clear}; (cx%`_MSG)''; (cx%`_APL)(`_CLEAR;`_OPTIONS `_FORMATS;`_OUT;`_MSG;`_IN); (cx,`_OUT) .is `view; (cx,`_IN) .is `scalar; (cx,`_INT) .is `scalar; (cx,`_FLOAT) .is `scalar; (cx,`_CLEAR) .is `button; (cx,`_MSG) .is `label; (cx,`_OPTIONS) .is `check; (cx,`_FORMATS) .is `layout; (cx,`_APL) .is `layout; (cx,`_OUT) .has (`title;'';`refer;refer); (cx,`_FORMATS) .has (`title;'';`resize;'thH'); (cx,`_CLEAR) .has (`title;'Clear'); (cx,`_OPTIONS) .has (`acceptfocus;0;`C;1;`resize;'wW';`title;'';`set;set_check;`geometry;3); (cx,`_IN) .has (`title;': ';`in;in); (cx,`_FLOAT) .has (`title;' Float: ';`set;(set_fmt;`FLOAT)); (cx,`_INT) .has (`title;'Integer: ';`set;(set_fmt;`INT)); (cx,`_APL) .has (`title;''); s.autows{WS}; cx`_APL }aplus-fsf-4.22/src/scripts/apl.doc0000444000265000001440000000202607426305446012547 apl === 0. Description. The apl gadget is an interactive front end for the "disp.lay" utility. 1. Operation. Enter an expression in _IN; Input and evaluated, disp.layed output appended to _OUT. Reference to a line in _OUT retrieves that line for evaluation. "Clear" to zero-out "session". Consult documentation in disp.doc for parameter settings: BOX IOTA SAME VER HOR Tree TREE ( 0 1 only) Integer INT Float FLOAT 2. zdefine cx cx = target context of apl tool z = `cx._APL Define an apl-gadget in the specified context. 3. Variables _APL Outer layout _OPTIONS: Checkbox dependency on disp.lay switches _MSG Message label _INT: Integer _fmt _FLOAT: Floating point _fmt _FORMATS Format-input layout _CLEAR Clear button _OUT View of "session" _IN Scalar input 4. Restrictions apl controls: `set callback on _OPTIONS, _FLOAT, _INT `in callback on _IN `refer callback on _OUT 5. Example $load s $load apl show apl.define `f aplus-fsf-4.22/src/scripts/bfm.+0000644000265000001440000000631710772770472012140 Copyright (c) 1990-2008 Morgan Stanley All rights reserved. See .../src/LICENSE for terms of distribution. $cx bfm USERNAMEsys.getusername{} set_files{s;d;i;p;c;v}: { (c,`_FILES) .has (`freeze;1); (c%`_FILE)''; xsys.agetdents{c%`_DIR}; if (0<#s sc%`_SUFFIX) { xx; d-#s; x(-+/^\x=' ')x; xd@1 fx(^/@1 (d@1 x)=@1 s)/x; x(~^/~\@1 ' 'x)/@1 x; x((x=' ')@10)@0 1x; }; (c%`_NAMES)x; (c%`_DATES)(#x)c%`_DATES; (c%`_TIMES)(#x)c%`_TIMES; if (0<#x) { xif (0<#s) ((fx=' ')@10)@0 1 fx else c%`_NAMES; t(;9)#sys.astat{(c%`_DIR),@1 x}; ixif (c%`_SORT) t else c%`_NAMES; t>sys.ts1{ix#t}; (c%`_DATES)100@1 t[;3]; (c%`_TIMES)0 60 60@1 t[;3+3]; (c%`_NAMES)ix#c%`_NAMES; }; (c,`_FILES) .has (`row;1); (c,`_NAMES) .has (`space;1#x); (c,`_FILES) .has (`freeze;0); } dltb{x}:((\x' ')^\x' ')/x select_file{s;c;v}:(c%`_FILE)if (1=r0`row .of c,v) '' else dltb{r#c%`_NAMES},c%`_SUFFIX preset_new{s;d;i;p;c;v}:dltb{d} preset_mode{s;d;i;p;c;v}:if (d0c%`_MODES) d else `domain set_mode{s;d;i;p;c;v}:(dc%`_MODES)1 (1c%`_MODES)ۡd=0c%`_MODES set_modes{s;d;i;p;c;v}: { if (`symp) (); (c,`_MODE) _spcb (;); (c,`_MODE) _scb (;); (c%`_MODE)p; (c,`_MODE) _spcb (preset_mode;); (c,`_MODE) _scb (set_mode;); case (p) { `get; get_mode{c}; `put; put_mode{c}; `drop; drop_mode{c}; } } get_mode{c}:(c,`_USER) .has (`protect;0) (c,`_NEW) .has (`protect;1) (c%`_NEW)'' put_mode{c}:(c,`_USER) .has (`protect;1) (c%`_USER)USERNAME (c,`_NEW) .has (`protect;0) drop_mode{c}:(c,`_USER) .has (`protect;1) (c%`_USER)USERNAME (c,`_NEW) .has (`protect;1) (c%`_NEW)'' define{cx}: { WSs.autows{()}; (cx%`_FONT)'kaplscreen-bold'; (cx%`_DATEFMT)`mdy; (cx%`_TIMEFMT)`hrmin24; (cx%`_SORT)1; (cx%`_MODE)`get; (cx%`_USER)USERNAME; (cx%`_FILE)''; (cx%`_APPL)''; (cx%`_SUFFIX)''; (cx%`_TRIGGER)0; cx"_DIR:'/u/',_USER,'/',_APPL,'/'"; (cx%`_NAMES)0 0''; (cx%`_DATES)00; (cx%`_TIMES)00; (cx%`_MODES)(`get `put `drop;(1;0;0)); (cx%`_NEW)''; (cx%`_BFM)(`_MODES;`_USER;`_FILES;`_NEW); (cx,`_MODES) .is `radio; (cx,`_USER) .is `scalar; (cx%`_FILES)cx`_NAMES `_DATES `_TIMES; (cx,`_FILES) .is `table; (cx,`_NEW) .is `scalar; (cx,`_BFM) .is `layout; (cx`_USER `_APPL `_SUFFIX `_TRIGGER `_SORT) _scb<(set_files;); (f;d;t)cx`_FONT `_DATEFMT `_TIMEFMT; (cx,`_MODES) s.uses (`font;f;`titlefont;f;`labelfont;f); (cx,`_USER) s.uses (`font;f;`titlefont;f); (cx,`_NEW) s.uses (`font;f;`titlefont;f); (cx,`_FILES) s.uses (`font;f;`titlefont;f); (cx,`_DATES) s.uses (`out;d); (cx,`_TIMES) s.uses (`out;t); (cx,`_MODE) .has (`preset;preset_mode;`set;set_mode); (cx,`_MODES) .has (`title;'';`geometry;`horizontal;`label;`Get `Put `Drop;`set;set_modes;`acceptfocus;0); (cx,`_USER) .has (`title;'User:'); (cx,`_FILES) .has (`title;'';`rows;7;`cols;#cx%`_FILES;`select;select_file;`protect;1;`rowsep;0); (cx,`_NAMES) .has (`title;('Current';'Files ');`space;25); (cx,`_DATES) .has (`title;('Update';'Date ');`space;#(cx%`_DATEFMT) _sfmt 19800101); (cx,`_TIMES) .has (`title;(;'Time')); (cx,`_NEW) .has (`title;'New:';`preset;preset_new); (cx,`_BFM) .has (`title;'';`dynamic;1); s.autows{WS}; cx`_BFM } aplus-fsf-4.22/src/scripts/bfm.doc0000444000265000001440000000604507426305450012537 bfm === 0. Description. The BFM gadget ("File Manager-B") is a modification by Mike Skaff of the AFM gadget, which is a modification of the pup utility written by daveh and modified by mkr. 1. Operation. BFM is a window for selecting files in an application directory under a "mode". The set of files to be selected from is determined by the three variables _USER, _APPL, and _SUFFIX: _DIR:'/u/',_USER,'/',_APPL _SUFFIX is a character string which is chopped from the end of any matching files. E.g., if _SUFFIX'orother.m' and if file is somethingorother.m it will be displayed as something There are three modes: get, put, and drop. A mode is selected via the radio box _MODES, or by setting the gadget variable _MODE to one of `get, `put, or `drop. Either action causes a corresponding state-change in the companion variable. E.g., setting _MODE`put causes (`put_MODES) to become 1, and vice-versa. In "get" mode, the operator can enter a user name (_USER) and pick from the files displayed in _NAMES. In "put" mode, the operator can enter a new file name (_NEW), but cannot change the user name from sys.getusername. In "drop" mode, the operator can neither enter a new file name nor change the user name from sys.getusername. The table _FILES contains three fields: _NAMES, _DATES, and _TIMES. By default, these are sorted down on _DATES and _TIMES. By setting _SORT0, the table will be sorted up on _NAMES. 2. zdefine cx cx = target context of BFM z = `cx._BFM Define an BFM-gadget in the specified context. 3. Variables _FONT Electric font variable _SORT 1 ( _DATES, _TIMES) or 0 (_NAMES) _DATEFMT `mdy; _TIMEFMT `hrmin24; _MODE `get, `put, `drop _USER "username" (default = sys.getusername) _FILE Selected file _APPL Application name _SUFFIX Invisible filename suffix _DIR: Implied directory _FILES File table (depends on _DIR, _SUFFIX, _TRIGGER) _NAMES File names _DATES File last update dates _TIMES File last update times _TRIGGER anything (triggers file refresh) _MODES Mode radio box _NEW New filename _BFM Outer layout 4. Restrictions Set callbacks set by BFM on: _MODE _MODES _SUFFIX _APPL _USER _TRIGGER _SORT Preset callback set by BFM on _MODE. Select callback set by BFM on _FILES. Variables which may be assigned: _SORT 1 ( _DATES,_TIMES) or 0 (_NAMES) _FONT Font of all BFM objects _MODE Mode of BFM instance _USER User _APPL Application _SUFFIX Invisible filename suffix 5. Example $load s $load act $load bfm bfm.define `f f._APPL'myappl' seek in directory .../myappl/ f._SUFFIX'object.m' filename = ...object.m f._MODE`get initialize in "get" mode. act.define `g g._STUFF`f._BFM attention{s;d;i;p;c;v}:{ if (d`apply) { (mode;dir;file;new)s%`_MODE `_DIR `_FILE `_NEW; case (mode) { `get; `get; `put; `put; `drop; `drop } } } `g._Z _scb (attention;`f) g._MSG'Hello Woild' aplus-fsf-4.22/src/scripts/blt.+0000644000265000001440000000264710772770473012160 Copyright (c) 1990-2008 Morgan Stanley All rights reserved. See .../src/LICENSE for terms of distribution. $cx blt can_{x}:if (0=s.container_type{0`class .of x}) 0 else if (~(1#val)^0=val%x) 0 else 1 can_be{y}:((0ء`class .ofy)s.realClasses{})/y captures_{x;y}:(`y `x `ys `xs .of x) s.overlaps@1 1 >ء(<`y `x `ys `xs).ofy capture_{x;y}:if (0<#x) if (0<#ycan_be{(yx)/y}) if (can_{x}) if (1bcaptures_{x;y}) (%x)[,]b/y release_{x}:if (0<#x) if (can_{pa0`parent .of x}) x .has `naturalsize (%pa)(pvx)/pv%pa release{s;c;v}:if (0<#ob ob0`focus .of c`_BUILD) release_{ob} capture{s;c;v}:capture_{c`_BUILD;(c0#obs)/obs} obss.objects{} define{cx}: { WSs.autows{()}; (cx%`_FONT)'kaplscreen-bold'; (cx%`_CAPTURE)<{capture}; (cx%`_RELEASE)<{release}; (cx%`_CONTROL)<`_CAPTURE `_RELEASE; (cx%`_BUILD)(); (cx%`_BLT)`_CONTROL `_BUILD; (cx,`_RELEASE) .is `button; (cx,`_CAPTURE) .is `button; (cx,`_CONTROL) .is `layout; (cx,`_BUILD) .is `layout; (cx,`_BLT) .is `layout; fcx`_FONT; (cx,`_BUILD) s.uses `titlefont,f; (cx,`_CAPTURE) s.uses `titlefont,f; (cx,`_RELEASE) s.uses `titlefont,f; (cx,`_BUILD) .has (`title;'Build';`C;1;`R;1;`locksize;1;`build;1;`realize;1;`yxs;300 400); (cx,`_CAPTURE) .has (`title;'Capture';`acceptfocus;0); (cx,`_RELEASE) .has (`title;'Release';`acceptfocus;0); (cx,`_CONTROL) .has (`title;''); (cx,`_BLT) .has (`title;''); s.autows{WS}; cx`_BLT } aplus-fsf-4.22/src/scripts/blt.doc0000444000265000001440000000204707426305452012554 blt === 0. Description. The blt gadget is a tool for building layouts interactively. 1. Operation. _BLT is the outer layout. _BUILD is an empty layout with `build set to 1. _CONTROLS contains two buttons, _CAPTURE and _RELEASE. _CAPTURE finds objects overlapping _BUILD and reparents them to _BUILD, retaining their approximate geometrical relationship. _RELEASE reparents the focussed child (if any) of _BUILD to 0. 2. zdefine cx cx = target context of blt gadget z = `cx._BLT Define a blt-gadget in the specified context. 3. Variables _FONT 'kaplscreen-bold' _BUILD Empty layout _CONTROLS Layout of buttons _CAPTURE Capture window button _RELEASE Release window button _BLT Outer layout 4. Restrictions _FONT May be assigned _BUILD May be assigned, must be simple vector _CONTROLS May be assigned _CAPTURE May not be assigned _RELEASE May not be assigned _BLT May not be assigned 5. Example $load s $load blt abcdefgh5 show`a`b`c`d`e`f`g`h showblt.define `foo aplus-fsf-4.22/src/scripts/box.+0000644000265000001440000000323210772770473012156 Copyright (c) 1990-2008 Morgan Stanley All rights reserved. See .../src/LICENSE for terms of distribution. $cx box ALPHA_NUM('abcdefghijklmnopqrstuvwxyz';'ABCDEFGHIJKLMNOPQRSTUVWXYZ';'_';'0123456789';'';'$'); quoted{x}:(r1r2|+\'"'=x)r1r2|+\''''=x function_name{x}:if (0=0zdo _name{x}) 1z else x double_quote{x}:(1+x='''')/x in{x}: { if (0=#x,x) () else if (0=#z(~quoted{x})/x) zx else if (~/(1١1ա(z=' ')z' ',z)0 1 2 5#ALPHA_NUM) zx else `domain; if (0zx) z else `domain } out{x}:out_array{if (1=x) <{x} else x;1} out_array{x;y}: { one1=tsx/sxx; smp~bxd0#v,x) y,1v else if (~xi+(jv[1]-iv[0])nx) y,1v else y,(if (i=0) '' else (1i),'+'),(if (j=1) '' else (1j),''),'',1n } out_sym{x}:if (^/(zx)'.',0 1 2 3#ALPHA_NUM) '`',z else '''',z,'''' out_symVec{x}: { if (1=#x) x else if (^/b'`'=,0ءx) x else { b~b; (br;c)(1b),0;x); c(<',('),c,')'; if (1br) (br/c)(br/c),','; (b/x)c; zx; (','=1z)z } } aplus-fsf-4.22/src/scripts/bro.+0000644000265000001440000000442010772771353012146 Copyright (c) 1990-2008 Morgan Stanley All rights reserved. See .../src/LICENSE for terms of distribution. $cx bro if( ()scriptsDirsys.readenv{"SCRIPTS_DIR"} ) { scriptsDir"/usr/local/aplus-fsf-4.22/scripts"; } _load{scriptsDir,"/disp"} _load{scriptsDir,"/box"} refer_x{s;c;v}:(c%s)if (1#cs; (ridx;cidx)if (t) (many{rs;cn};one{cs}) else (one{rs};many{cs;cn}); ((ridx;cidx)#c%`_PAGE)(t(#cidx;#ridx))n; } one{x}:(.5#x)#x many{x;cn}:d+/cn,(x[0]+#x)-d dx[0]((.5#x)#x)-.5cn aplus-fsf-4.22/src/scripts/bxt.doc0000444000265000001440000000173407426305457012577 bxt === 0. Description. BXT is a box-drawing gadget. 1. Operation. Choose a symbol and paste or cut a box. 2. zdefine cx cx = target context of box drawing gadget. z = `cx._BXT 3. Variables _SYMBOLS vector of symbols to choose from _COLORS vector of colors _BOXED (symbols drawn;indices into _BOX) _BOX n4 array of y, x, #ys, #xs, indexed by _BOXED _CUT button; cut chosen symbol _OBJECTS slotfiller of symbols (choice) _OBJECT chosen object _PAGE 2035 page object (squarish) _COLOR_MAP: 2035 colormap (squarish) _BXT outer layout 4. Restrictions _PAGE controls rubber band callback _OBJECTS controls set callback _SYMBOLS controls set callback 5. Example $load s $load bxt bbxt.define ` _SYMBOLS`one `two `three `four `five `six `seven `eight show b First symbol is chosen. Draw and redraw boxes. Select another symbol. Draw and redraw boxes. etc. State of BXT is given by _BOXED and _BOX. aplus-fsf-4.22/src/scripts/cbr.+0000644000265000001440000000401310772770473012132 Copyright (c) 1990-2008 Morgan Stanley All rights reserved. See .../src/LICENSE for terms of distribution. $cx cbr out_sym{s;d;i;p;c;v}:if (`symd) '' else d sym_sort{x}:(x)#x att_select{s;c;v}:(c%evar)if (0>r0`row .of c,v (cls;evar)s) ' ' else attribute_of{r#c%v} attribute_of{a}:(a),': ',if (a0s.ATTRIBUTE_DESC) as.ATTRIBUTE_DESC else '' cls_refer{s;c;v}:if (ri (r;i;p)row_index{c;v}) show_window{c;v;p} else hide_window{c;v;p} hide_window{c;v;p}:w .has (`show;0) wc'_LAY_',p global_index{c;v;p;0} show_window{c;v;p}:w .has (`show;1;`raise;1) wdefine_class{c;p} global_index{c;v;p;1} row_index{c;v}:(r;i;p) pr#c%v (r;i)`row`index .of c,v s.call{c,v;`refer} global_index{c;v;p;b}:if (b) (c%`_CLASSES)[,]p else (c%`_CLASSES)(kp)/k kc%`_CLASSES define_class{cx;cls}: { lvar'_LAY_',cls; if (~0`bound .of cx,lvar) { WSs.autows{()}; dvar'_DESC_',cls; evar'_ADSC_',cls; avar'_ATTS_',cls; svar'_SUPC_',cls; ivar'_INDX_',cls; desc(cls),': ',clss.CLASS_DESC; eesc' '; attssym_sort{s.primitiveTo{cls}}; sclssym_sort{s.proper_flat_super{cls}}; (cx%dvar)desc; (cx%evar)eesc; (cx%avar)atts; (cx%svar)scls; cx(ivar),':(',(svar),'_CLASSES)/#',svar; (cx%lvar)(dvar;evar;avar,svar); (cx,ivar) .has (`class;`object); (cx,dvar) .has (`class;`label;`justify;'l'); (cx,evar) .has (`class;`label;`justify;'l'); (cx,avar) .has (`class;`array;`space;101#atts;`title;'Attributes';`out;out_sym;`rowsep;0;`colsep;0;`select;(att_select;cls,evar);`protect;1); (cx,svar) .has (`class;`array;`space;101#scls;`title;'Classes';`out;out_sym;`rowsep;0;`colsep;0;`refer;cls_refer;`protect;1;`.index;cxivar); (cx,lvar) .has (`class;`layout;`title;''); s.autows{WS}; }; cxlvar } define{cx}: { WSs.autows{()}; (cx%`_CLASSES)(); (cx%`_CBR)clsssym_sort{s.realClasses{}}; (cx,`_CBR) .has (`class;`array;`refer;cls_refer;`space;101#clss;`protect;1;`title;'Real Classes';`rowsep;0;`colsep;0;`out;out_sym); s.autows{WS}; cx`_CBR } aplus-fsf-4.22/src/scripts/cbr.doc0000444000265000001440000000160407426305461012537 cbr === 0. Description. The CBR gadget ("Class Browser") is a gadget for scanning the S class hierarchy. 1. Operation. Refer to a class in the CBR list to see its definition and attributes. Refer to a class in the superclass list to see its definition and attributes. 2. zdefine cx cx = target context of CBR z = `cx._CBR Define a CBR-gadget in the specified context. 3. Variables _CBR List of real classes _CLASSES Classes in view _DESC_ Description of _ADSC_ Description of selection attribute of _ATTS_ Attributes of _SUPC_ Superclass of _INDX_: Electrified index-attribute of _CBR and _SUPC_ 4. Restrictions Refer callbacks set by CBR on _SUPC_ and _CBR Select callback set by CBR on _ATTS_ 5. Example $load s $load cbr show cbr.define `f aplus-fsf-4.22/src/scripts/cft.+0000644000265000001440000000532410772770473012146 Copyright (c) 1990-2008 Morgan Stanley All rights reserved. See .../src/LICENSE for terms of distribution. $cx cft FG`black BG`grey FONT'kaplgallant-19' set_cb{c;v;z}:(c,v) .has (`preset;z) unset_cb{c;v}:z (c,v) .has (`preset;) z0`preset .of c,v refer_cf{s;c;v}:set_cb{c;2#s;cb} x_on_y{c;0#s;1#s;z} (c%2#s)z z(0`row .of c,v)#c%v cbunset_cb{c;2#s} x_on_y{c;a;b;k}: { (c,`_CFT) .has (`freeze;1); (c,`_FG_ON_BG) .has (a;k); (c,`_BG_ON_FG) .has (b;k); (c,`_CFT) .has (`freeze;0); } find{c;v;d;r}:if ((#g)=igd g(#d)@1f frc%v) 1 else k k(#g)|r+i set_cfs{s;d;i;p;c;v}:(c,v) .has (`row `firstrow;2k) k(c%v)c%s preset_cf{s;d;i;p;c;v}: { if (1=k kfind{c;2#s;d;1+00`row .of c,2#s}) () else z x_on_y{c;0#s;1#s;z} (c,2#s) .has (`row `firstrow;2k) zk#c%2#s } out_sym{s;d;i;p;c;v}:if (`sym=d) d else '' in_sym{s;d;i;p;c;v}:if (`char=d) d else ` preset_array{s;d;i;p;c;v}:if (`sym=d) d else d define{cx}: { WSs.autows{()}; (cx%`_FGS)(); (cx,`_FGS) .is `array; (cx,`_FGS) .has (`preset;preset_array;`refer;(refer_cf;`fg `bg `_FG);`font;'kaplscreen-bold';`out;out_sym;`protect;1;`space;20;`title;'Foreground';`rows;5); (cx%`_BGS)cx%`_FGS; (cx,`_BGS) .is `array; (cx,`_BGS) .has (`preset;preset_array;`refer;(refer_cf;`bg `fg `_BG);`font;'kaplscreen-bold';`out;out_sym;`protect;1;`space;20;`title;'Background';`rows;5); (cx%`_FONTS)(); (cx,`_FONTS) .is `array; (cx,`_FONTS) .has (`preset;preset_array;`refer;(refer_cf;`font `font `_FONT);`font;'kaplscreen-bold';`out;out_sym;`protect;1;`space;31;`title;'Font';`rows;5); (cx%`_FG_ON_BG)631!t' foreground on background '; (cx%`_BG_ON_FG)631!t' background on foreground '; (cx,`_FG_ON_BG) .is `label; (cx,`_BG_ON_FG) .is `label; (cx,`_FG_ON_BG) .has (`bg;FG;`fg;BG;`font;FONT); (cx,`_BG_ON_FG) .has (`bg;BG;`fg;FG;`font;FONT); (cx%`_FG)0`fg .of cx,`_FG_ON_BG; (cx%`_BG)0`bg .of cx,`_BG_ON_FG; (cx%`_FONT)0`font .of cx,`_FG_ON_BG; (cx,`_FG) .is `scalar; (cx,`_BG) .is `scalar; (cx,`_FONT) .is `scalar; (cx,`_FG) .has (`preset;(preset_cf;`fg `bg `_FGS);`title;'';`out;out_sym;`in;(in_sym;`_FGS);`font;'kaplscreen-bold'); (cx,`_BG) .has (`preset;(preset_cf;`bg `fg `_BGS);`title;'';`out;out_sym;`in;(in_sym;`_BGS);`font;'kaplscreen-bold'); (cx,`_FONT) .has (`preset;(preset_cf;`font `font `_FONTS);`title;'';`out;out_sym;`in;(in_sym;`_FONTS);`font;'kaplscreen-bold'); (cx,`_FGS) .has (`set;(set_cfs;`_FG)); (cx,`_BGS) .has (`set;(set_cfs;`_BG)); (cx,`_FONTS) .has (`set;(set_cfs;`_FONT)); (cx%`_CFT)(`_FG `_BG `_FONT;`_FGS `_BGS `_FONTS;`_FG_ON_BG `_BG_ON_FG); (cx,`_CFT) .is `layout; (cx,`_CFT) .has (`title;'';`locksize;1;`C;1;`realize;1;`yxs;400 800); s.autows{WS}; cx`_CFT } aplus-fsf-4.22/src/scripts/cft.doc0000444000265000001440000000330107426305463012543 cft === 0. Description. The cft gadget provides a simple mechanism for experimenting with colors and fonts. 1. Operation. Reference to a foreground or background color uses that color in the display labels. Reference to a font uses that font in the display labels. Reference to an attribute may be achieved in three ways: (a) refer to the list-item naming the attribute (b) enter the name of the attribute into one of the scalars _FG, _BG, _FONT. (c) assign _FG, _BG, or _FONT to the attribute name. attribute. To pick from all colors, _FGS_BGSs.COLOR_NAMES To pick from all fonts, _FONTSs.FONT_NAMES Assignment-callback or dependency on _FG, _BG, and/or _FONT is the recommended method of use. 2. zdefine cx cx = target context of color-font tool z = `cx._CFT Define a cft-gadget in the specified context. 3. Variables cx._FG selected foreground color symbol cx._BG selected background color symbol cx._FONT selected font symbol cx._FGS vector of available foreground colors* cx._BGS vector of available background colors* cx._FONTS vector of available fonts* * will also accept character matrices. cx._FG_ON_BG label of foreground on background cx._BG_ON_FG label of background on foreground cx._CFT layout of color-font tool 4. Restrictions cx._FGS, cx._BGS, cx._FONTS: may be assigned; `refer, `set, `preset not available cx._FG, cx._BG, cx.FONT: may be assigned; `in, `out, and `preset not available cx._FG_ON_BG, cx._BG_ON_FG: may be assigned any valid `label 5. Example $load s $load cft bcft.define `foo foo._FGSfoo._BGSs.COLOR_NAMES foo._FONTSs.FONT_NAMES show b aplus-fsf-4.22/src/scripts/client.+0000644000265000001440000000315010772770473012643 Copyright (c) 1990-2008 Morgan Stanley All rights reserved. See .../src/LICENSE for terms of distribution. $cx client BUFFER() preset_connect{s;d;i;p;c;v}: { if (1=c%v) close{c}; if (0d) connect{c}; d } close{c}: { adap.Close{c%`_HANDLE}; (c%`_HANDLE)0; (c,`_S) _scb (;); (c,`_S) _spcb (;); } connect{c}: { hadap.Connect{c%`_DESCRIPTOR;call}; if (h<0) `connect; (c%`_HANDLE)h; adap.SetClientData{h;c}; } call{h;e;d}: { cadap.GetClientData{h}; case (e) { `reset; reset{c}; `connected; connected{c;h}; `read; read{c;d}; `sent; sent{c;d}; error{c}; }; (c%`_EVENT)e; } read{c;d}:(c%`_R)d send{s;d;i;p;c;v}:if (`async=c%`_MODE) adap.Send{s;d} else adjust_read{c} send_sync{s;d;i;p;c;v}:d if (`sync=c%`_MODE dtag{c;d}) (BUFFER)syncXch{s;d;c} adjust_read{c}:(BUFFER)() (c%`_R `_EVENT)BUFFER tag{c;d}:((c%`_TAG)1+c%`_TAG;if (`char=d) d else _alsf{d}) syncXch{s;d;c}: { cdadap.GetClientData{s}; adap.SetClientData{s;}; zif (2=zadap.SyncXch{s;d;c%`_TIMEOUT}) z else (0z;1z); adap.SetClientData{s;cd}; if (`OK0z) (`read;1z) else z } error{c}:() sent{c}:() connected{c;h}: { (c,`_S) _scb (send;h); (c,`_S) _spcb (send_sync;h); } reset{c}:if (1=c%`_CONNECT) (c%`_CONNECT)0 define{cx}: { (cx%`_HOST)`localhost; (cx%`_PORT)12321; (cx%`_PROTOCOL)`A; (cx%`_NAME)`client; cx"_DESCRIPTOR:(`host;_HOST;`port;_PORT;`protocol;_PROTOCOL;`name;_NAME)"; (cx%`_MODE)`async; (cx%`_TIMEOUT)1000; (cx%`_CONNECT)0; (cx%`_HANDLE)0; (cx%`_S)(); (cx%`_R)(); (cx%`_EVENT)(); (cx%`_TAG)1; (cx,`_CONNECT) _spcb (preset_connect;); cx } aplus-fsf-4.22/src/scripts/client.doc0000444000265000001440000000455107426305466013260 client ====== 0. Description. CLIENT is the client-side of the client-server connection gadget. (Also see server.doc) 1. Operation. Define a CLIENT instance in context x: $load client client.define `x Optionally, define the service descriptor components: x._HOST x._PORT x._PROTOCOL x._NAME Make the connection: x._CONNECT1 or x._CONNECT2 (autoreconnect) The variable x._EVENT contains a symbol of the most recent adap event. Asynchronous mode To operate the client in asynchronous mode (the default): x._MODE`async The _S variable is the input lead for sending executable character vectors to the server: x._S'23' The _R variable is the output lead for receiving results from the server: x._R < 13 < < 0 < 5 _R is always a two element vector of (tag;(return_code;result)): (22;do '23') and _S is: (22;'23') where the tag is added in the preset callback to _S. To close the connection: x._CONNECT0 This removes all callbacks from _S and _R, and nulls them out. Synchronous mode To operate the client in synchronous mode: x._MODE`sync The execution loop now has the following structure: Suppose that the server is instantiated in context y: x._S'34' The *preset callback* on _S is invoked, adding a tag, and performing a synchronous send to the client: (tag;'34') y._R(tag;'34') y._S(tag;(0;12)) (tag;(0;12)) is buffered '34' is returned from the preset callback The set callback on _S is now invoked: The buffer is assigned to _R Note that _EVENT will contain either `OK, or an error message from the synchronous exchange. Functional messages x._S may also be assigned a slotfiller or association-list of symbolic functions and argument-lists (see server.doc). 2. zdefine cx cx = target context of CLIENT tool z = cx Define a CLIENT gadget in the specified context. 3. Variables _HOST `localhost _PORT 12321 _PROTOCOL `A _NAME `client _DESCRIPTOR: (`host;_HOST;`port;_PORT;`protocol;_PROTOCOL;`name;_NAME) _TIMEOUT 1000 _MODE `async _CONNECT 0 _HANDLE 0 _S () _R () _EVENT () _TAG 1 4. Restrictions Preset callback on _CONNECT Set and preset callbacks on _S 5. Example aplus-fsf-4.22/src/scripts/dio.+0000644000265000001440000001016310772770473012142 Copyright (c) 1990-2008 Morgan Stanley All rights reserved. See .../src/LICENSE for terms of distribution. $cx dio in{s;d;i;p;c;v}:s.in{in_;d;i;p;c;v} out{s;d;i;p;c;v}:s.out{out_;d;i;p;c;v} forms{}: { ymd`DDDDDDDD; (PARTS),<8; md`DSD `DSDD `DDSD `DDSDD; (PARTS)[,](1 1 1;1 1 2;2 1 1;2 1 2); mdy`DSDSDD `DSDDSDD `DDSDSDD `DDSDDSDD; (PARTS)[,](1 1 1 1 2;1 1 2 1 2;2 1 1 1 2;2 1 2 1 2); mdymdy,`DSDSDDDD `DSDDSDDDD `DDSDSDDDD `DDSDDSDDDD; (PARTS)[,](1 1 1 1 4;1 1 2 1 4;2 1 1 1 4;2 1 2 1 4); (PICTURES)ymd,md,mdy; (FORMS)((#ymd)`ymd),((#md)`md),((#mdy)`mdy); (WIDTHS)(`md `mdy `ymd;(5;6;6)); (CENTURIES)(`md `mdy `ymd;(0;0;1)); (FROM)1960; (TO)2100; } forms{} default{a}: { r(); (fm;yd)(`mdy;0); if (`form0a) if (`mdyfm`forma) r[,]`form; if (`max0a) if (Inf`maxa) r[,]`max; if (`min0a) if (Inf`mina) r[,]`min; if (`forms0a) if (()`formsa) r[,]`forms; if (`century0a) if ((fmCENTURIES)yd`centurya) r[,]`century; if (`na0a) if (999999999`naa) r[,]`na; if (`zero0a) if (1`zeroa) r[,]`zero; if (`width0a) if ((yd+fmWIDTHS)`widtha) r[,]`width; if (0<#r) a(<~(0a)r)/a; if (a(;)) a(); a } in_{x}: { (x;attr)if (0=x) (x;) else 2x; attr2attr; blif (`na0attr) `naattr else 999999999; if (^/x=' ' s,x) (bl;attr); tif (~`forms0attr) FORMS else if (()t`formsattr) FORMS else t; (forms;pics;parts)(<(0FORMS)t)/(FORMS;PICTURES;PARTS); lwif (`min0attr) `minattr else Inf; upif (`max0attr) `maxattr else Inf; ipicss ((s="/")/s)"S" ((s"1234567890")/s)"D" s(+/^\' '=s)s; if ((#pics)=i) `domain; (fm;pt)(i#forms;(iparts)x); (val;digs)case (fm) { `ymd; in_ymd{pt}; `mdy; in_mdy{pt}; `md; in_md{pt}; }; if ((valup) `domain; formsif (~^/FORMSforms) s.unique{forms}/forms; bttr(`form `century `min `max `forms;(fm;digs;lw;up;forms)); attrdefault{bttr,(<~(0attr)0bttr)/attr}; (`intval;attr) } in_ymd{parts}: { nparts; num0 100 100n; if ((num[0]TO) `domain; md31 28 31 30 31 30 31 31 30 31 30 31; md[1]md[1]+0=4|num[0]; if ((num[1]<1)num[1]>12) `domain; if ((num[2]<1)num[2]>(((1+12)num[1])(md,0))[0]) `domain; (n;1) } in_mdy{parts}: { (m;d;y)_sfi{0 2 4#parts}; if (((y99)(y>TO)y<0) `domain; yy+(flagy<100)10019+y<60; md31 28 31 30 31 30 31 31 30 31 30 31; md[1]md[1]+0=4|y; if ((m<1)m>12) `domain; if ((d<1)d>(((1+12)m)(md,0))[0]) `domain; (0 100 100y,m,d;4=2+2~flag) } in_md{parts}: { (m;d)_sfi{0 2#parts}; md31 29 31 30 31 30 31 31 30 31 30 31; if ((m<1)m>12) `domain; if ((d<1)d>(((1+12)m)(md,0))[0]) `domain; (0 100m,d;0) } out_{x}: { (val;attr)if (0=x) (x;) else 2x; attr2attr; fmif (`form0attr) `formattr else `mdy; zrif (`zero0attr) `zeroattr else 1; blif (`na0attr) `naattr else 999999999; yd2 4[if (`century0attr) `centuryattr else fmCENTURIES]; wdif (`width0attr) `widthattr else yd+fmWIDTHS; zif (1valbl) wd' ' else case (fm) { `ymd; ,_fmt{"i8";val}; `mdy; out_mdy{val;zr;yd}; `md; out_md{val;zr} }; if (wd#z) wdz else wd'*' } out_mdy{x;zr;yd}:(,_fmt{(zr/"z"),"i2";n[1]}),"/",(,_fmt{"zi2";n[2]}),"/",,_fmt{"zi",t;(10*t)|n[0]} tyd n0 100 100x out_md{x;zr}:(,_fmt{(zr/"z"),"i2";n[1]}),"/",,_fmt{"zi2";n[2]} n0 100 100x wday{f;x}: { b+\0 31 28 31 30 31 30 31 31 30 31 30; acx; if (~f) { x1+0 100 100,|x; x[2;]0 1212x[2;]; tx[0;].4 100 400; tt[;0]-t[;1]-t[;2]; rx[2;]+(365x[0;])+t; r366+r+b[x[1;]]; t0=4 100 400 .|x[0;]+1; tt[0;]t[1;]t[2;]; rar+(x[1;]2)^t; rr-(a+1)2>a7|r; (0ca<2)+c(2+7|r)+5r7 } else { x,|x; x2+(5|x)+7x5; r(x-365)365.2425; t r.4 100 400; tt[;0]-t[;1]-t[;2]; xx-365+(365r)+t; d(x=0)/x; tr.+0 1; t0=4 100 400.|t; et[0;;]t[1;;]t[2;;]; be[;1].+b; b[;2]((x),2)0 31; r[d]r[d]-1; x[d]x[d]+364+e[d;0]; r(r+1)~+/@1(x.+120)>b; xx-(,b)[(12x)+r[1;]-1]; ca100r,x } } ARROW'' parse{x}: { ixARROW x(x' ')/x; >0ءdio.in_{(ix;(i+1)x)} } aplus-fsf-4.22/src/scripts/dio.doc0000444000265000001440000000240407426305470012543 dio === 0. Description. Like sasha's date.in{} and date.out{}, but streamlined for scalar formatting and conversion. dio.in{} and dio.out{} do not require shadow variables. Format- state information is stored on the variable in the attribute `s.io. 1. Operation. valuedio.in{s;string;i;p;c;v} stringdio.out{s;value;i;p;c;v} so that: `a is `scalar `array `matrix `slot `tableField, where `a b and `b is `table `a has (`out;dio.out;`in;dio.in) 2. `s.io The variable attribute `s.io holds an array of slotfillers which represents the format-state of each number in a. It is always true that (a) `a _get `s.io `s.io can be examined and modified by the application. 3. dio.in{} dio.in{} uses the function: (value;slotfiller)dio.in_{(string;slotfiller)} 4. dio.out{} dio.out{} uses the function: stringdio.out_{(value;slotfiller)} 5. Slotfiller. Default attributes are: `form `mdy `zero 1 `na 999999999 `max Inf `min Inf `century (form-dependent = 0 or 1) `width (form-dependent) `forms (all) Possible values of the `form slot are: `mdy `ymd `md 6. (from;to)dio.parse{daterange_expression} 7. dio.FROM1960 dio.TO2100 aplus-fsf-4.22/src/scripts/disp.+0000644000265000001440000001236110772770473012330 Copyright (c) 1990-2008 Morgan Stanley All rights reserved. See .../src/LICENSE for terms of distribution. $cx disp Remove blank columns slice{x}:(~^/x=' ')/@1 x Center array x in y positions center{y;x}:if (y#x) x else (-.5y-#x)yx Determine matching initial sub-arrays and elide up to the first non-match same{x}: { if ((~SAME)0x) (x;0); (x;z) (#x z0) do if (^/x@(1+#x)0#x) {x0#x;zz+1} else (x;z) } ,@y / x idiom encat{y;x}:if (0=x) x else 0#@y x) do zz,@y >(i+1)#@y x Convert simple character array to character matrix with traditional APL inter-array spacing rank2{x}:if (0x) (((1Ӣ1+#x)0),0)' ' else (02-#x)zrank2_{x} rank2_{x}: { case (#x) { 0; 1 1x; 1; (1,#x)x; 2; x; & !@3 x,@2 ' ' } } Optional _fmt{} formatter quadFmt{x}: { case (x) { `int; if (0<#INT) _fmt{INT;x} else 1@1 x; `float; if (0<#FLOAT) _fmt{FLOAT;x} else 1@1 x; x } } Generate displays for simple character, integer, and float arrays char{x}:{(a;b)same{x};frame{rank2{a};x;'"';b}} int{x}:{(a;b)same{x};frame{rank2{if (IOTA) iota{a;''} else quadFmt{a}};x;'i';b}} float{x}:{(a;b)same{x};frame{rank2{if (IOTA) iota{a;'1.0'} else quadFmt{a}};x;'f';b}} iota{x;y}: { if ((,0)nx) y,'00' else if (0n) y,'0' else if (0=#n) y,1x else if (3>#v,x) y,1v else if (~xi+(jv[1]-iv[0])nx) y,1v else y,(if (i=0) '' else (1i),'+'),(if (j=1) '' else (1j),''),'',1n } Generate display for arrays of type symbol sym{x}:if (0ҡx; r(x)(1x)//@1s[;;0]; c(x)(#x)//s[;;1]; if (VER) xcenter{r;x} else xr١x; if (HOR) xcenter@1{1+c;x} else x(1+c)@1x; <1@1>encat{x;encat@1{1;x}} } Generate display for nested array box{x}: { (a;b)same{x}; zdisp{a}; zif (0=#z) >z else rank2{>(/>#z)١(/,>1աҡz)@1z} z,plane @2{z} if (1=#z) z(1,#z)z; frame{z;x;(`sym `box `funcɩx)#'`';b} } Generate display for null array null{x}:frame{0 0' ';x;'';0} Generate display for function array func{x}:if ((0#x)0i#a;i}; if (0(1+#a)#a}; zlabel{z;typ;1+#z;r}; (isam) do zif (ii#a;i} else label{z;'';0;r+#>i#a} }; z } Main disp{x}:((x)FUNCS)x lay{x}:if (TREE>0) tree{(Leaf1{disp}){,x}} else disp{x} tree diagrammer (f Leaf1)r:if (0=r)f r else f &r tree{x}:if (TREE=2) branch{(Leaf1{leaf}){x}} else top{branch2{(Leaf1{leaf2}){x}}} top{x}:x if (1b bI=(HOR(;0))#x) ((HOR(b/HOR#x;0))#x)HOR#LI,TI leaf{x}: { x(21 1,x)x; xV,@1(H,x,H),@1 V; x[0;0,1+1x](HOR#TI,LI),TR; x[1+#x;0,1+1x]BL,BR; x } branch{x}: { if (0=x) x else { if (1d0<ؽx,x) (d/x)&{d/x}; cHOR;ec#1 9;fc#9 1;dc2; x((c#ҡx)@f(#x)#v,x) y,1v else if (~xi+(jv[1]-iv[0])nx) y,1v else y,(if (i=0) '' else (1i),'+'),(if (j=1) '' else (1j),''),'',1n } E.g.: 3 +3-+ |3| +i-+ 3. Variables. BOX if 1, box diagram SAME if 1, do sub-array matching HOR if 1, center display on horizontal axis VER if 1, center display on vertical axis IOTA if 1, search for iota-form LINE if 1, use graphical line drawing characters TREE if 1, diagram is a tree with centered connectors if 2, diagram is a tree without centered connectors INT optional _fmt{} for integers FLOAT optional _fmt{} for floats 4. Example $load DISP disp.disp (`a`b`c;(1;1.1 2.2;2 2'a')aplus-fsf-4.22/src/scripts/dlu.+0000644000265000001440000000435610772770473012162 Copyright (c) 1990-2008 Morgan Stanley All rights reserved. See .../src/LICENSE for terms of distribution. $cx dlu tree{p}:prefix{p;dir_tree{p;1}} prefix{p;t}:if (2=#t) (q;&{q;1t}) q>¡(<(p),'/'),Ρ0t dir_tree{p;g}:if (g) dir_tree_0{(p;'');0} else (;) dir_tree_0{pd;st}: { if (0<#dsagetdents{p} pp,('/'1p)/'/' ppd) if (0<#i (i;st)is_dir{p;ds;st}) (¡ds;&{((<1fs) is_file{dir;mat}#mat else b/mat b/>b@1'.',sfs b(-1+>#sfs sfsΡk/0fs)@11_FILTERS)/0_FILTERS. A directory can be specified by choosing it from the directory tree _DIRS. Selecting a file in the list causes _FILE to be assigned. 2. zdefine cx cx = target context of directory-looker-upper z = `cx._DLU Define a dlu-gadget in the specified context. 3. Variables cx._GO 0/1 - trigger, defaulted to 0 cx._PATH Path, bound to a `scalar cx._FILES: Filtered file-list cx._DIRS: directory-tree, dependent on _GO cx._PANE `vpane containing _DIRS and _FILES cx._FILTERS `check or `radio of filename suffixes cx._DLU `layout containing the above cx._FILE referenced file cx._VIEW: sys.readmat _DIR,_FILE 4. Restrictions cx._PATH input to dlu, may be assigned freely. attributes controlled by dlu: `preset cx._FILTERS input to dlu, may be assigned freely. cx._DIRS dependency, may not be assigned. attributes controlled by dlu: `set cx._FILES dependency, may not be assigned. attributes controlled by dlu: `select cx._FILE last file referred to, may not be assigned 5. Example $load s $load dlu bdlu.define `foo b `foo._S foo._DIR'' foo._FILTERS(`a,'+';(1;0)) show b foo._GO1 show `foo._VIEW aplus-fsf-4.22/src/scripts/doc.+0000644000265000001440000000242410772770472012134 Copyright (c) 1990-2008 Morgan Stanley All rights reserved. See .../src/LICENSE for terms of distribution. $cx doc select{s;c;v}:if (0r0`row .of c,v) (c%`_GADGET)'/ms/dist/apluslib/PROJ/s/1.0/common/',p p(p' ')/p pr#c%v view{x}:if (()x) '' else untab{read{x,'.doc'};8} untab{x;y}: { tab`char9; nl`char10; dels(1xtab,nl)/#x; delimiters (reset the count here) ld((dels,#x)-0,dels)/0,dels; last delimiter seen ns1+y|1+ld-#x; number of spaces (if this is a tab) ((tabsx=tab)/x)' '; turn tabs to spaces (1+tabsns-1)/x and add the extra spaces } read{file}: { if (0>ssys.filesize{file}) 'read failed: (',(s),') ',file; as`char0; fdsys.open{file;0;0}; sys.read{fd;a;s}; sys.close{fd}; a } define{cx}: { WSs.autows{()}; asys.agetdents{'/ms/dist/apluslib/PROJ/s/1.0/common/'}; b0<>#_ss{<@1 a;<'.doc'}; (cx%`_GADGETS)3@1(a)#ab/a; (cx%`_GADGET)(); cx'_VIEW:doc.view{_GADGET}'; (cx%`_DOC)`_GADGETS `_VIEW; (cx,`_GADGETS) .is `view; (cx,`_VIEW) .is `text; (cx,`_DOC) .is `vpane; (cx,`_GADGETS) .has (`title;'Gadgets';`select;select); (cx,`_VIEW) .has (`title;'Doc';`protect;1); (cx,`_DOC) .has (`title;'/ms/dist/apluslib/PROJ/s/1.0/common/'); s.autows{WS}; cx`_DOC } aplus-fsf-4.22/src/scripts/doc.doc0000444000265000001440000000035007426305475012540 doc === 0. Description. 1. Operation. 2. zdefine cx cx = target context of doc tool. z = `cx._DOC 3. Variables 4. Restrictions 5. Example $load s $load doc show doc.define `foo aplus-fsf-4.22/src/scripts/fcp.+0000644000265000001440000000404310772770473012137 Copyright (c) 1990-2008 Morgan Stanley All rights reserved. See .../src/LICENSE for terms of distribution. $cx fcp set_menu{s;d;i;p;c;v}: { case (q0#1p) { `Cut; cut_field{c}; "Paste Right"; paste_field{c;1}; "Paste Left"; paste_field{c;0}; buffer{c} (c%`_TABLE)q; } } focus{}:2if (0<#ws.this{}) if (0<#t0`focus .of w) if (`table0`class .of t) (t;0`field .of t) paste_field{c;k}: { if (~()t (t;f)focus{}) { if (t0cb cbc%`_CUT_BUFFER) { fltcb; (g;fl)(0#fl;1fl); if (0=#fl) cb((/>#g)١gtitle{(0#t)tcb} adjust{c;v;r;i}:if (1<#d dc%v) (()#c%v)t ((~b)/t)(,i)#d tb\t t(ki)/d bkr k#d sel_r{s;c;v}:if (1=#0(i;r)`index `row .of c,v) (c,v) .has (`index;r) adjust{c;v;r;i} ref_r{s;c;v}:if (ir (i;r)`index `row .of c,v) (c,v) .has (`index;0) else (c,v) .has (`index;r) tables{t}:if (0<#t) t else (`table=_flat{`class .ofobs})/obs obss.objects{} edit_menu{t}:(`Fields;<(`Cut,("Paste Left"),("Paste Right"),`Buffer;(;;;(t;(#t)())))) ttables{t} define{cx}: { WSs.autows{()}; cx'_FCP:fcp.edit_menu{_TABLES} s.SYMBOLS'; cx'_BUFFER:fcp.buffer_fields{_TABLE;_CUT_BUFFER}'; (cx%`_TABLE)(); (cx%`_TABLES)(); (cx%`_CUT_BUFFER)(;); (cx,`_FCP) .is `hmenu; (cx,`_BUFFER) .is `array; (cx,`_FCP) .has (`set;set_menu;`acceptfocus;0;`font;'kaplscreen-bold';`labelfont;'kaplscreen-bold'); (cx,`_BUFFER) .has (`protect;1;`rows;5;`select;sel_r;`refer;ref_r;`title;'';`font;'kaplscreen-bold';`title;'kaplscreen-bold'); s.autows{WS}; s.SYMBOLSs.SYMBOLS; cx`_FCP } aplus-fsf-4.22/src/scripts/fcp.doc0000444000265000001440000000245107426305502012536 fcp === 0. Description. The fcp gadget manages the cutting and pasting of fields from and to tables. 1. Operation. Set _TABLES to list of tables to manage, or () for all tables. _CUT_BUFFER to (`t0 ... `tn;((`f0 ... g0);...;(`fn ... `gn))) is a slotfiller of fifo stacks of cut fields. Make sure `reparent is 0 for each table to be managed. Menu operation: Cut: Cut focussed field into buffer. Paste Left: Paste top field to left of focussed field. Paste Below: Paste top field to right of focussed field. Buffer, table: Popup cutbuffer for selected table; allow rearrangement of fields (as in SST) 2. zdefine cx cx = target context of field cut and paste tool. z = `cx._FCP Define a fcp-gadget in the specified context. 3. Variables _FCP: Menu _BUFFER: Array of cut fields for selected table _CUT_BUFFER Slotfiller of fifo stacks of cut fields _TABLE Selected table _TABLES () or all, or list of tables to be managed 4. Restrictions Assignment callback on _FCP is controlled. Select and reference callbacks on _BUFFER are controlled. 5. Example $load s $load fcp abc10 t1`a`b`c defg10 t2`d`e`f`g `t1`t2 is`table `t1`t2 has<(`reparent;0) kfcp.define `f m(k;`t1;`t2) show `m is `layout aplus-fsf-4.22/src/scripts/file.+0000644000265000001440000000524510772770475012315 Copyright (c) 1990-2008 Morgan Stanley All rights reserved. See .../src/LICENSE for terms of distribution. $cx file file.LOADED 1; See /usr/include/sys/fcntlcom.h for source of these definitions excerpts below: /* @(#)fcntlcom.h 1.12 90/01/04 SMI; from UCB fcntl.h 5.2 1/8/86 */ #define _FREAD 0x0001 /* read enabled */ #define _FWRITE 0x0002 /* write enabled */ #define _FNDELAY 0x0004 /* non blocking I/O (4.2 style) */ #define _FAPPEND 0x0008 /* append (writes guaranteed at the end) */ #define _FMARK 0x0010 /* internal; mark during gc() */ #define _FDEFER 0x0020 /* internal; defer for next gc pass */ #define _FASYNC 0x0040 /* signal pgrp when data ready */ #define _FSHLOCK 0x0080 /* BSD flock() shared lock present */ #define _FEXLOCK 0x0100 /* BSD flock() exclusive lock present */ #define _FCREAT 0x0200 /* open with file create */ #define _FTRUNC 0x0400 /* open with truncation */ #define _FEXCL 0x0800 /* error on open if file exists */ #define _FNBIO 0x1000 /* non blocking I/O (sys5 style) */ #define _FSYNC 0x2000 /* do all writes synchronously */ #define _FNONBLOCK 0x4000 /* non blocking I/O (POSIX style) */ #define _FNOCTTY 0x8000 /* don't assign a ctty on this open */ (fread;fwrite;fndelay;fappend; fmark;fdefer;fasync;fshlock; fexlock;fcreat;ftrunc;fexcl; fnbio;fsync;fnonblock;fnoctty) 11,\152; Utilities file.rstrip{x}:if (0,x) ((#x)0)'' else (-/@1+/@1^\@1 ' '=@1 x)@1 x file.read{file}:{ if (0>ssys.filesize{file}) 'read failed: ',s; as`char0; fdsys.open{file;0;0}; sys.read{fd;a;s}; sys.close{fd}; a(~a=`char9)/a; Removing TAB`s b("\n",a)="\n"; Breaking on CR`s cba; if (0=#(1+#c)c) c1c; if ((#c)>0) if ((#(i1+#c)c)>0) if ("\n"1ic) c[i]<(ic),"\n"; c1աc; d>(/>#c)١c; if (0<#d) d(~^\^/@1 d=' ')/d; Removing blank rows from end of file d } file.out{file;text;fcntl}:{ if (2text) textfile.rstrip{<@1 text},"\n"; fdsys.open{file;fcntl;8 8 810 10 10666}; if (0>sys.write{fd;text;text}) 'write failed'; sys.close{fd}; } file.write{file;text}: file.out { file;text; `O_RDWR `O_CREAT `O_TRUNC } These codes translate to 1538 file.append{file;text}: file.out { file;text; `O_RDWR `O_CREAT `O_APPEND} These codes trancslate to 522 This is an early attempt at file.append only using file.write. It is left around only for illustrative purposes. file.append_simple{file;text}: { randomfile'/tmp/.append',1100000; file.write{randomfile;text}; '$cat ',randomfile,' >>',file; '$rm ',randomfile; } aplus-fsf-4.22/src/scripts/files0000644000265000001440000000152010304464057012322 README \ abx.+ \ abx.doc \ act.+ \ act.doc \ afm.+ \ afm.doc \ apl.+ \ apl.doc \ bfm.+ \ bfm.doc \ blt.+ \ blt.doc \ box.+ \ bro.+ \ bro.doc \ bxt.+ \ bxt.doc \ cbr.+ \ cbr.doc \ cft.+ \ cft.doc \ client.+ \ client.doc \ dio.+ \ dio.doc \ disp.+ \ disp.doc \ dlu.+ \ dlu.doc \ doc.+ \ doc.doc \ fcp.+ \ fcp.doc \ file.+ \ files \ fit.+ \ fkt.+ \ fkt.doc \ flu.+ \ flu.doc \ fnt.+ \ fnt.doc \ gyr.+ \ gyr.doc \ manydoc.+ \ manydoc.doc \ pop.+ \ pop.doc \ qio.+ \ qio.doc \ rap.+ \ rap.doc \ rgb.+ \ rgb.doc \ scriptsDir.+ \ server.+ \ server.doc \ sst.+ \ sst.doc \ stp.+ \ stp.doc \ tbr.+ \ tbr.doc \ ted.+ \ ted.doc \ tim.+ \ tim.doc \ tl.+ \ tl.doc \ trc.+ \ trc.doc \ tss.+ \ tss.doc \ vim.+ \ vim.doc \ vlt.+ \ vlt.doc \ xyz.+ \ xyz.doc \ zgl.+ \ zgl.doc aplus-fsf-4.22/src/scripts/fit.+0000644000265000001440000000521710772770473012155 Copyright (c) 1990-2008 Morgan Stanley All rights reserved. See .../src/LICENSE for terms of distribution. $cx fit set_size{s;d;i;p;c;v}:(c%`_FONT)c%`_FONT in_size{s;d;i;p;c;v}:if (^/d=' ') 1 else if (0=rc (rc;z)do _sfi{d}) z out_size{s;d;i;p;c;v}:if (d=1) ' ' else 1d etom{v}:>(/#v)١v set_cb{c;v;z}:(c,v) .has (`preset;z) unset_cb{c;v}:z (c,v) .has (`preset;) z0`preset .of c,v refer_cf{s;c;v}:set_cb{c;s;cb} x_on_y{c;z} (c%s)z z(0`row .of c,v)#c%v cbunset_cb{c;s} x_on_y{c;k}: { if (1? ' )}; (cx%`_META)etom{( '<=>^ '; '?~* '; '_'' '; '|ܯ ' )}; (cx%`_METASHIFT)etom{( '! '; 'Դ '; 'Ľ켻 '; 'ͼ' )}; (cx%`_INP)''; (cx%`_SIZE)1; (cx%`_FONTS)(); (cx%`_CHARS)`_UNSHIFT `_SHIFT `_META `_METASHIFT; (cx%`_CI)`_INP `_CHARS; (cx%`_FS)(`_FONT `_SIZE;`_FONTS); (cx%`_FIT)<`_FS `_CI; (cx%`_FONT)0`font .of cx,`_INP; (cx,`_INP) .is `scalar; (cx,`_SIZE) .is `scalar; (cx,`_FONT) .is `scalar; (cx,`_FONTS) .is `array; (cx,`_UNSHIFT) .is `label; (cx,`_SHIFT) .is `label; (cx,`_META) .is `label; (cx,`_METASHIFT) .is `label; (cx,`_CHARS) .is `vpane; (cx,`_CI) .is `layout; (cx,`_FS) .is `layout; (cx,`_FIT) .is `hpane; (cx,`_FONTS) .has (`refer;(refer_cf;`_FONT);`font;'kaplscreen-bold';`out;out_sym;`protect;1;`space;31;`title;''); (cx,`_FONT) .has (`preset;(preset_cf;`_FONTS);`title;'';`out;out_sym;`in;(in_sym;`_FONTS);`font;'kaplscreen-bold'); (cx,`_FONTS) .has (`set;(set_cfs;`_FONT)); (cx,`_SIZE) .has (`title;'';`out;out_size;`in;in_size;`set;set_size;`space;5;`resize;'wW';`font;'kaplscreen-bold'); (cx,`_FS) .has (`title;''); (cx,`_CI) .has (`title;''); (cx,`_CHARS) .has (`title;''); (cx,`_INP) .has (`resize;'hH';`title;''); (cx,`_FIT) .has (`title;'';`locksize;1;`realize;1;`yxs;500 800); s.autows{WS}; cx`_FIT } aplus-fsf-4.22/src/scripts/fkt.+0000644000265000001440000000240010772770473012146 Copyright (c) 1990-2008 Morgan Stanley All rights reserved. See .../src/LICENSE for terms of distribution. $cx fkt set_fkt{s;d;i;p;c;v}:(c%`_FAMILY)p set_family{s;d;i;p;c;v}:if (~()d) (k#c%`_KINDS f(c%`_FAMILIES)d) do set_matrix{s;d;(k;f);;c;`_KIND_BY_FAMILY} set_families{s;d;i;p;c;v}:(c,`_KIND_BY_FAMILY) .has (`label;('';Ρc%`_KINDS;Ρc%v)) set_kinds{s;d;i;p;c;v}:(c,`_KIND_BY_FAMILY) .has (`label;('';Ρc%v;Ρc%`_FAMILIES)) set_matrix{s;d;i;p;c;v}: { if (i()) set_fkt{;;;c%`_FAMILY;c;} else { if (()0i) (0i)0#c%v; if (()1i) (1i)1#c%v; if (f1i f(c%`_FAMILIES)c%`_FAMILY) ((c%`_CX)%k#c%`_KINDS)(k;f)#c%v k0i } } define{cx}: { WSs.autows{()}; (cx%`_CX)cx; (cx%`_FAMILY)(); (cx,`_FAMILY) _scb (set_family;); (cx%`_FAMILIES)(); (cx%`_KINDS)(); (cx%`_KIND_BY_FAMILY)0 0(); cx'_FKT:(_FAMILIES;<@0_FAMILIES=_FAMILY)'; (cx,`_FKT) .is `choice; (cx,`_FAMILIES) .is `array; (cx,`_KINDS) .is `array; (cx,`_KIND_BY_FAMILY) .is `matrix; (cx,`_FKT) .has (`title;'Family: ';`set;set_fkt); (cx,`_FAMILIES) .has (`title;'Families';`set;set_families;); (cx,`_KINDS) .has (`title;'Kinds';`set;set_kinds;); (cx,`_KIND_BY_FAMILY) .has (`title;'Kinds Families';`set;set_matrix); s.autows{WS}; cx`_FKT } aplus-fsf-4.22/src/scripts/fkt.doc0000444000265000001440000000404107426305505012552 fkt === 0. Description. The fkt gadget is a `choice widget which implements "family/kind" selection. 1. Operation. Typically: bfkt.define `f Now define: f._FAMILIESsymbolic vector of application-defined "families" f._KINDSsymbolic vector of application-defined "kinds" f._KIND_BY_FAMILY_KINDS_FAMILIES symbolic array of values f._FAMILYselected family, _FAMILIES This has the effect of creating, in context f, a series of variables: f._KINDS[0] f._KINDS[1] : f._KINDS[1+#_KINDS] whose values are those in _KIND_BY_FAMILY[;_FAMILIES_FAMILY]. In the example below, e.g. f.one is electrically connected to the background attribute of a screen object. When a particular family is selected, f.one is reassigned, and the visible background of the object is updated. Finally: show b This allows selected family (i.e., f._FAMILY) to be specified interactively. Secondarily, the objects _KINDS, _FAMILIES, and _KIND_BY_FAMILY can be used to edit the values of the "kind" variables, or to edit the "space" of kinds and families, although no editor for this purpose is provided in fkt. (fkt.define{} does, however, bind these objects.) 2. zdefine cx cx = target context of color-font tool z = `cx._FKT Define am fkt-gadget in the specified context. 3. Variables _FKT: slotfiller dependency (`choice) _CX context of kind variables (default = FKT context) _FAMILIES symbolic vector of families (`array) _KINDS symbolic vector of kinds (`array) _FAMILY symbolic scalar _FAMILIES _KIND_BY_FAMILYsymbolic matrix of values (`matrix) 4. Restrictions fkt controls set callbacks on all objects. 5. Example $load s $load fkt bfkt.define `f f._FAMILIES`first `second `third f._KINDS`one `two `three `four `five f._KIND_BY_FAMILY((#f._KINDS),#f._FAMILIES)`red `blue `green `purple `orange f._FAMILY`first show b show `f._KIND_BY_FAMILY a10 `a is `array `a s.uses `bg `f.one `fg `f.two `editbg `f.three `selectbg `f.four `rowbg `f.five show `a aplus-fsf-4.22/src/scripts/flu.+0000644000265000001440000000571510772770473012164 Copyright (c) 1990-2008 Morgan Stanley All rights reserved. See .../src/LICENSE for terms of distribution. $cx flu r_f{x;y}:(~(2@1 z)2 2'... ')/z zsys.readmat{'/tmp/flu'} sys.system{'rsh ',a,' ls -',y,' ',b,' > /tmp/flu 2>&1'} (a;b)(ix;(i+1)x) ix':' agetdents{x}:if (~':'x) (z)#z zsys.agetdents{x} else r_f{x;'a'} is_d_entry{x;m}:if (1b0<,>#_ss{<@1 m;<(x' ')/x}) 'd'=0#,b/m else 0 is_dir{y;x}:if (~':'y) 0#(152)2#@1 sys.astat{y,@1 1 x} else is_d_entry@1 2{x;m} mr_f{y;'l'} d_d{x}:if (~':'x) ('';x) else (ix;ix) i1+x':' up{s;c;v}:if (~'./'d (y;d)d_d{c%`_DIR}) (c%`_DIR)y,(-i)d i1+(1d)'/' preset_dir{s;d;i;p;c;v}:z null_file{c} zy,if (0=#z (y;z)d_d{(d' ')/d}) './' else if ('/'=1z) z else z,'/' filtered{f;fs}:if (~'.'f) 0 else if ((<(-(f)'.')f)Ρ(>1fs)/0fs) 1 else 0 rj{x}:(-(' '=@1 x)@10)@0 1x set_cb{c}:(c,`_FILE) .has (`preset;preset_file) unset_cb{c}:(c,`_FILE) .has (`preset;) null_file{c}:set_cb{c} (c%`_FILE)'' unset_cb{c} (c,`_FILES) .has (`row;1) select_files{s;c;v}: if(~1=f0`row .of c,`_FILES) set_cb{c} (c%`_FILE)(' 'f)/f#c%`_FILES unset_cb{c} select_dirs{s;c;v}: if(~1=f0`row .of c,`_DIRS) (c%`_DIR)(c%`_DIR),f,'/' f(' 'f)/f#c%`_DIRS preset_file{s;d;i;p;c;v}:if (1=k kfind{c;,d;1+00`row .of c,`_FILES}) d (c,`_FILES) .has (`row;1) else k#c%`_FILES (c,`_FILES) .has (`firstrow `row;2k) find{c;d;r}:if ((#f)=ifd (f;d)take{c;rc%`_FILES;d}) 1 else (#f)|r+i take{c;f;d}:if (1=c%`_FIND) ((#d)@1 f;d) else (f;(1#f)d) filter{dir;fs}: { zif (0=#matagetdents{dir}) (mat;mat) else if (~/k k>1fs) (a/mat;(~a)/mat) ais_dir{dir;mat} else (a/mat;b/mat) ais_dir{dir;mat}^~'.'@1 mat b/>b@1'.',sfs b(-1+>#sfs sfsΡk/0fs)@11_FILTERS)/0_FILTERS. A directory can be specified by typing it into _DIR. An empty directory is equal to "./". The flu gadget will recognize a domain prefix to _DIR; e.g., nyfid:./ Pressing the _UP button (= "..") backs up one level. If a directory name ends in one of the filtered suffixes, then reference to it causes _FILE to be assigned to that directory name. Assignment (or entry) to _FILE finds the corresponding row in _FILES. If a directory name does not end in any of the filtered suffixes, then selecting it causes it to be appended to _DIR. Selecting a file in the list causes _FILE to be assigned. 2. zdefine cx cx = target context of file-looker-upper z = `cx._FLU Define a flu-gadget in the specified context. 3. Variables cx._DIR Directory, bound to a `scalar cx._UP `button: back up one directory level cx._FIND 1 (match initial substring) or 0 (exact match) cx._FILES: Filtered file-list cx._DIRS: Filtered directory-list cx._PANE `vpane containing _DIRS and _FILES cx._FILTERS `check or `radio of filename suffixes cx._FLU `layout containing the above cx._FILE referenced file cx._VIEW: sys.readmat _DIR,_FILE 4. Restrictions cx._FIND must be boolean cx._DIR input to flu, may be assigned freely. attributes controlled by flu: `preset cx._FILTERS input to flu, may be assigned freely. cx._DIRS dependency, may not be assigned. attributes controlled by flu: `select `protect cx._FILES dependency, may not be assigned. attributes controlled by flu: `select `protect cx._FILE last file referred to, may be assigned attributes controlled by flu: `preset cx._UP function-array, may not be assigned. cx._PANE vpane, may be assigned cx._FLU outer layout, may be assigned. 5. Example $load s $load flu bflu.define `foo b `foo._S foo._DIR'' foo._FILTERS(`a,'+';(1;0)) show b aplus-fsf-4.22/src/scripts/fnt.+0000644000265000001440000000236510772770473012163 Copyright (c) 1990-2008 Morgan Stanley All rights reserved. See .../src/LICENSE for terms of distribution. $cx fnt $wa 5 group_part{f;r}:(b1բ1,bj#k)jkkk>if (r() (f;r),(f;r)) fɡf else rf tokenize{x}:(#FIELDS)(1ա(x='-')x),(#FIELDS)<'' font_names{}: { pid1sys.getpid{}; '$xlsfonts > /tmp/fonts.temp_created_by_S_',pid; zsys.readmat{'/tmp/fonts.temp_created_by_S_',pid}; '$rm /tmp/S_fonts.temp_created_by_S_',pid; (-/(@1' '=z)@10)@1z(z[;0]='-')/z } FIELDS`Foundry `Family `Weight `Slant `Set_width `Style `Pixels `Points `Resolution_X `Resolution_Y `Spacing `Avg_width `Charset `Encoding FONTSfont_names{} font_slot{}:font_part{tokenize{<@1 FONTS};FIELDS} font_part{f;fs}: { if (0<#fs) { g>(/>#g)١g0ءf; jgroup_part{0#j)#g;(<()),&{1աj#ء1ءcx%cx%`_GYR)@11 (r;c)sh set_state{s;d;i;p;c;v}: { (i;j),2i; if (()i) i#c%v; if (()j) j1#c%v; d((#i),#j)d; (ii#i) do (jj#j) do ((((ii;jj)#d)#c%`_LIGHTS)c%'_LIGHT_',(1ii#i),'_',1jj#j)1; } traffic_system{cx;sh}: { (r;c)sh; rc!(r),@0 0 0 c; rs1աrc[;0]; cs1աrc[;1]; nssh>¡names(<'_LIGHT_'),rs,'_',cs; (ir) do (jc) do { n(i;j)#ns; (cx%n)(cx%`_LIGHTS;(1;0;0)); (cx,n) .has (`.labelfont;cx`_FONT;`.geometry;cx`_GEOMETRY;`class;`radio;`title;'';`hl;`black;`fg;cx%`_COLORS;`bg;`black;`label;```;`resize;'hHwW'); }; cx'_STATE:gyr.state{`',(cx),';_SHAPE}','',names; (cx,`_STATE) _scb (set_state;); ns } define{cx}: { WSs.autows{()}; (cx%`_SHAPE)0 0; (cx%`_FONT)'courier-10'; (cx%`_GEOMETRY)`vertical; (cx%`_LIGHTS)`r`y`g; (cx%`_COLORS)`red`gold`green; cx'_GYR:gyr.traffic_system{`',(cx),';_SHAPE}'; (cx,`_GYR) .has (`class;`layout;`title;'';`newshow;1;`reparent;0;`bg;`black); s.autows{WS}; cx`_GYR } aplus-fsf-4.22/src/scripts/gyr.doc0000444000265000001440000000145607426305513012575 gyr === 0. Description. The GYR gadget consists of a layout of radio-boxes configured to resemble traffic-lights. 1. Operation. See example below. 2. zdefine cx cx = target context of GYR z = `cx._GYR Define an GYR traffic-light system in cx. 3. Variables _SHAPE rows,cols _LIGHT_i_j radio-box configured as a traffic-light _STATE[i;j]: 0, 1, or 2, depending on whether _LIGHT_i_j is green, yellow, or red. _GEOMETRY `horizontal or `vertical _COLORS `red`gold`green _LIGHTS `r`y`g _FONT 'courier-10' _GYR: _SHAPElayout of traffic-lights 4. Restrictions `set callback on _STATE. shape of _STATE may not be changed. 5. Example $load s $load gyr bgyr.define ` _SHAPE5 6 show b _SHAPE3 4 _GEOMETRY`horizontal _STATE[]3 40 1 2 aplus-fsf-4.22/src/scripts/manydoc.+0000644000265000001440000003255210772771353013025 Copyright (c) 1990-2008 Morgan Stanley All rights reserved. See .../src/LICENSE for terms of distribution. $wa 60 $load s sankar $cx tool (f sLash)a:{ the generalized / operator i1+1a; ra[0]; i do rr f a[i+1]; r } n(f nsLash )a:{ the generalized "n g /" operator (ie: n-wise reduction va; a(-|n)!a; if (n<0) aa; f sLash @v a } a (f Cu ) b:{ fix clumsiness of A+ <(>a)f(>b) } (f sCan)a:{ generalized \ (scan operator i1+1a; r,a[0]; i do rr,r[i] f a[i+1]; r } a(f oUtprod )b:{ generalized outer product iA,a; jB,b; r(); i do j do rr,A[i]f B[j]; ((a),b)r } a(f iNprod g)b:{ generalized inner product with dimension matching if (0=a) a,a; if (0=b) b,b; if ((A1a)B1b) { cAB; if (cA) a(c-A)@1a; if (cB) b(c-B)b; }; A1a; B1b; Aif (1(f tool.sLash)r; r((v1a),w1b)r; v(v),(v)+w; do rvr; r} Without{a;b}:{APL2 dyadic ~ c~ab; c/a } eTrange{a}:{a[0]+(1a)-a[0]} Enc{a;b}:{ APL2 partioned enclose; a0,a; (11,a0,1a)b } Ifbad{expression}:{ returns 1 if expression cannot be done; `box0expression} Round{a;b}:{ rounds b to a; .001 Round 56.78879 gives 56.799; a.5+ba} Uniq{x}:{((xx)=#x)/x} Rjust{data}:{(-+/^\data=' ')data} Ljust{data}:{(+/^\data=' ')data} uNcomment{text}:{ remove comments from a text matrix; atext _ss ''; if (0=1a)text; i1+rows0#a; siz1text; colstool.eTrange (1#a),() siz; i do { text[rows[i];icols]' '}; text } $cx doc doc.readmat{fname}:{ a2044,usg.sysgetresult{'ls -l ',,fname}; ind(¡doc.pglist)fname; if (aind#doc.daterec) sys.readmat fname; (ind#doc.daterec)a; b doc.pro {fname}; (,fname),' Modified'; pdoc.pgnames(<@10b)tool.Without' '; qp<#doc.pgnames; r(q/p); (r#doc.pgrange)q/1b; .doc_data } doc.fixfmt {arg}:{ v(arg' /')/ arg; w121+((arg)12); ow - tool.oUtprod v; oo+(o<0)1e9; o1 tool.sLash o; o1|2 - tool.nsLash tool.Uniq 0,(((<@1o)ɡo1)#v),arg; (/o1)١o1arg} doc.children{funcnum}:{ ifuncnum; doc.iidoc.ii+1; per10000doc.iidoc.count; if (0=500|per)(12.lbl)12'/done=',(perper100),'%'; doc.newfil(idoc.pgfile)tool.Without ' '; if (~doc.newfildoc.oldfil){ doc.oldfildoc.newfil; doc.rawdatadoc.readmat doc.newfil}; pgmtext tool.uNcomment doc.rawdata[tool.eTrange i#doc.pgrange]; vdo {(g;h)0#pgmtext _ss ':'; pgmtext<@1 pgmtext; (gpgmtext)hgpgmtext; pgmtext>(()/ҡpgmtext)١pgmtext; }; if (00v) 0; b0; a1#@1>ҡx(ҡy(/funcno doc.childnos; aa/a; tool.Uniq a tool.Without funcno} doc.getbsslist{}:{ names();desc(); bad<' ;"',doc.tab; a1sys.readmat( (<'/tmp/manydoca.+'),1١doc.dirs); ac>ҡa1;ac[;1]/ac[;1]; a1>, tool.Cu tool.sLash ac[;1]@1a1; ac,(0#ac)/1١(<@1a1='/')/<ɢ1a1; a2a2ա<@1a1; a2a2 tool.Without bad; v((ҡa2)-(a2)ɡ'.')աa2; vv1ҡ'sa+'; vvv/vv tool.oUtprod v; Finally a use for the defined operator acvvv/ac; a2vvv/a2; a2+>namesɡ'.'; names(/,>ҡa2)١a2; desc>(names)<20' '; nnames; (names;desc;ac)n#(names;desc;ac) } doc.makelist{names;dir}:{ find functions; their line number range filesdir,names; pgmsdoc.pro files; vҡҡ0ءpgms; v(2=v)/v; pgmsv#pgms; pgnames(<@10ءpgms)tool.Without `char32; pgrange1ءpgms; pgfile2ءpgms; v/,>ҡpgfile; v<>v١pgfile; v#(pgnames;pgrange;pgfile;(pgnames)dir)} doc.pro{datafile}:{ find function headers .doc_datadatasys.readmat datafile tool.Without `char32; res(;;;;); if (0=a(/@1data=':')/1data)res; b<@1data[a]; c>bɡ':'; k''0#b; d1+>bɡ'}'; bc١b; nk^~''šb; i(n^c=d)/a; v(n^c=d)/a; if(0 0do v(v[0]0),v)res; j-2 - tool.nsLash v,1data; jj2!+\0,j; tls(b[i]ɡ'{')١b[i]; ord>40١tls; res(ord#>40١tls;ord#(-i)jj;ord#(i)`selected .of var; v((idoc.dirs),,i#doc.names) tool.Without ' '; v(1+(v)-(v)'.') v; (doc.page;j;d;jh;l)doc.pro { v}; do {doc.dataljhdoc.readmat v}; .show `doc.page; `doc.page .has (`title;doc.fixfmt v); } doc.ShowTextCB{val}:{ if ((val)=`doc.page) {doc.stackdoc.stack1()}; do{ i1,>`selected .of val; ddoc.pgnamesk1[k2]){ adoc.txt[k2;];b(k2k1); b- - tool.sLash @1ۢ2!0,b,v; cba; ib; b81((b+.1)8); doc.txt[k2]v(b١c tool.Without doc.tab); }}; vdoc.txt; v100Ģ1v; v1v; doc.textv@1doc.txt; (doc.pgmsins;doc.pgmsin)(;); do{ if (~(40١c((ddoc.childnos)#doc.pgnames)tool.Without 40١c((ddoc.parentnos)#doc.pgnames)tool.Without ,>`row .of `doc.text)/v0# doc.text _ss doc.searchtext tool.Without `char32; do `doc.text .has (`row;n) } doc.savefile{s;d;i}:{ do { if (0=data<@1 sys.readmat doc.thisfil)(); insert<@1 doc.text; data(doc.thisrange[0]data),insert,(doc.thisrange[1]data); datadata,`char10; fname'/u/',sys.getusername{},'/doctmp/',((doc.thisfil)-(doc.thisfil)'/')doc.thisfil; if (0/tmp/manydocx'}; sys.readmat '/tmp/manydocx' } doc.grep{s;d;i}:{ '$grep ',(v,doc.searchtext tool.Without ' '), ' ',(0doc.dirr),' >/tmp/manypqr'; if ((doc.dirr)>1) (i1+doc.dirr) do '$grep ',v, ' ',((i+1)doc.dirr),' >>/tmp/manypqr'; xdoc.pgfile tool.Without ' '; a<@1 sys.readmat{'/tmp/manypqr'}; o(~':'ša)/#a; (o#a)(<(0doc.dirr),':'),o#a; vv(tool.Uniq (aɡ':')١a)tool.Without' '; fnamestool.Uniq (x vv)/x; p((/ҡb)١btool.Uniq (0 ء1#ҡ((tool.eTrange<@1p# /tmp/manydoca.+'),1١,doc.dirs; doc.dirs(-(doc.dirs)ɡ'/')աdoc.dirs; '$sleep 2'; too lazy to use adap - hope this works doc.tab`char9; doc.list`doc.names`doc.desc; datdoc.getbsslist{}; doc.names0dat; doc.desc1dat; doc.dirs2dat; (a;b;c;d)doc.makelist{<@1doc.names;doc.dirs}; adoc.unqfix a; (doc.pgnames;doc.pgrange;doc.pgfile;doc.pgfiles)(a;b;c;d); doc.daterec>20ա44١,usg.sysgetresult(<'ls -l '),doc.pglist((ءdoc.dirs),<@1doc.names)tool.Without' '; doc.pgnamesxdoc.pgnames; doc.aa>/(doc.pgnames) '.'; doc.pgnamesy(1+(doc.aa/doc.pgnames)ɡ'.')աdoc.aa/doc.pgnames; doc.treeget1; if (doc.treeget) { .lbl'Wait...Building Tree',12' '; doc.countdoc.pgnames; doc.ii0; `.lbl .has (`shelltitle;'';`title;'';`fg;`red;`bg;`blue;`naturalsize;1); .show `.lbl ; doc.rawdata(2 80' ');doc.oldfil5' '; doc.childnosdoc.childrendoc.pgnames; doc.parentnosdoc.parents doc.pgnames; .free `.lbl; }; `doc.names .has (`title;"FileName"); `doc.list .is `table; `doc.list .has (`refer;(doc.ShowPageCB;`doc.list)); `doc.page .is `array; `doc.page`doc.list .has <(`protect;1); `doc.page .has (`refer;(doc.ShowTextCB;'doc.page')); `doc.page .has (`rows;10); doc.pagedoc.pgmsinsdoc.pgmsin10 20' '; doc.text30 100' '; (`doc`pgmsin`pgmsins) .is `array; `doc.text .is `array; `doc.text .has (`rows;25;`rowsep;0); doc.searchtext' '; `doc.searchtext .is `scalar; `doc.searchtext .has (`title;"text search";`set;doc.getext;`refer;doc.getext); doc.searchfunc' '; `doc.searchfunc .is `scalar; `doc.searchfunc .has (`title;"func search";`set;doc.getfunc); doc.load(doc.loadfunc;); doc.save(doc.savefile;); doc.Grep(doc.grep;); `doc.load`doc.save`doc.Grep .is `button; `doc.load`doc.save`doc.Grep .has <(`titlefont;"kaplscreen-bold"); doc.search1 5`doc`searchtext`Grep`searchfunc`load`save; `doc.search .is `layout; `doc.search .has (`title;''); `doc.text .has (`font;"kaplscreen-bold"); .show `doc.list; `doc.list`doc.page`doc.pgmsins`doc.pgmsin`doc.text`doc.searchtext`doc.searchfunc .has<(`font;"kaplscreen-bold";`titlefont;"kaplscreen-bold"); `doc.list .has (`title;'';`icontitle;"BssDoc"); doc.all((<1 4`doc.list`doc.page`doc.pgmsins`doc.pgmsin),2 1`doc.search`doc.text); `doc.all .is `layout; `doc.all .has (`title;"Script Browser ",dir,' ';`refresh;1;`font;"kaplscreen-bold";`titlefont;"kaplscreen-bold";`icontitle;"BssDoc"); .show `doc.all } .lbl' ' .show `.lbl .is `label 'eg:' ' doc.main "./manydoc.+"' ' doc.main {("./manydoc.+";"./dio.+")}' ' ' ' Use refer event (Double click) to list of functions in script files' ' Double click on any displayed function list will cause function to display' ' Grep searches for character string in the whole appln; displays list of fns' ' "Parents" and "Children" of displayed function shown; these can be double clicked' aplus-fsf-4.22/src/scripts/manydoc.doc0000444000265000001440000000251607426305516013427 A+ Script Browser ----------------- Examples of Syntax; doc.main "./manydoc.a" doc.main {("./manydoc.";"./dio.+")} (Argument is a list of script files; only files ending with .a & .+ are used in place of wild cards) First a list of script files will be displayed. Use refer event (Double click) to get list of functions in script files. Double click on the displayed function list will cause function to display. Once a function is displayed, its parents (ie: functions which contain references to the current function) and its children (ie: functions which are referred to in current function) are displayed. Any of these can be double clicked to see its listing. Grep searches for character string in the whole appln; displays list of fns. Double clicking in the search text field will cause search for the string in the displayed function. A function name typed into the func search field will cause that function to be displayed. In the displayed text of a function, blue rows contain references to other functions. Red and green lines in children and parent list will help you keep track of the path you took to reach the current function listing. Save & Load are not implemented. Dependencies and one line functions without opening braces will not be recognized. Really large applications can take a while to be read in. aplus-fsf-4.22/src/scripts/pop.+0000644000265000001440000000247310772770474012173 Copyright (c) 1990-2008 Morgan Stanley All rights reserved. See .../src/LICENSE for terms of distribution. $cx pop OPTIONS(`left `right `top `bottom;(`center `left;`center `right;`top `center;`bottom `center)) popup{s;d;i;p;c;v}:if (~d1) popdown{s;c;v} else (c,`_POP) .has `raise .show c,`_POP locate{c} natural{c} sensitive{c;0} popdown{s;c;v}:(c,`_GO) _scb (popup;) (c%`_GO)0 (c,`_GO) _scb (;) if (0=0`show .of c,`_POP .hide c,`_POP) sensitive{c;1} locate{c}:if (0<#l lc%`_LOCATE) if (0=0`show .of c,`_POP) position{c;`YX `yxs .of l;0`yxs .of c,`_POP} options{x}:if (2=#x) (x[0]`left `right)x else if (()x) `center `center else xOPTIONS natural{c}:if (c%`_SIZE) (c,`_POP) .has `naturalsize sensitive{c;x}:if (0<#w wc%`_SHELLS) w .has<(`sensitive;x) position{c;a;b}: { (v;h)options{c%`_POSITION}; ycase (v) {`center;0a[0]+.5a[2]-b[0];`top;0a[0]-b[0];`bottom;+/a[0 2]}; xcase (h) {`center;0a[1]+.5a[3]-b[1];`left;0a[1]-b[1];`right;+/a[1 3]}; (c,`_POP) .has (`yx;y,x); } define{cx}: { WSs.autows{()}; (cx%`_SIZE)1; (cx%`_SHELLS)(); (cx%`_LOCATE)(); (cx%`_POSITION)(); (cx%`_GO)0; (cx,`_GO) _scb (popup;); (cx%`_POP)(); (cx,`_POP) .is `layout; (cx,`_POP) .has (`title;'';`realize;1;`newshow;1;`reshow;0;`exit;popdown); s.autows{WS}; cx`_POP } aplus-fsf-4.22/src/scripts/pop.doc0000444000265000001440000000355207426305520012567 pop === 0. Description. The pop gadget is an empty popup window with facilities for location and sensitivity with respect to a parent window. 1. Operation. _POP is an empty layout. Any object can be parented to the _POP window: cx._POPyour.OBJECT. The _POP window can be popped up by: cx._GO1 and popped down under program control: cx._GO0 or through the window-manager pin. Four variables control _POP behavior: _SIZE is a boolean, which tells POP to `naturalsize when it pops up (1) or not (0). _SHELLS is a vector of windows to make insensitive for the duration of the dialog. _LOCATE is (), or a window relative to which the POP dialog is to located: () Center `left Center on the left margin `right Center on the right margin `top Center on the top margin `bottom Center on the bottom margin `left `top Position on left top corner `left `bottom Position on the left bottom corner `right `top Position on the right top corner `right `bottom Position on the right bottom corner 2. zdefine cx cx = target context of POP dialog z = `cx._POP Define a pop-gadget in the specified context. 3. Variables _SHELLS Vector of windows to make insensitive _LOCATE Scalar of window over which to pop dialog _POSITION () or one or two location symbols _SIZE Naturalsize (1) or not (0) _GO 1 (poopup) or 0 (popdown) _POP Outer layout 4. Restrictions `newshow of _POP set to 1 `reshow of _POP set to 0 `exit callback of _POP set by POP 5. Example $load s abc10 10 show`a`b`c $load pop $cx foo pop.define `foo `foo._POP foo._SHELLS`.b b insensitive, c sensitive foo._LOCATE`.b locate _POP relative to b foo._POSITION`top position _POP top center of b goo._POP`.a parent a to _POP foo._GO1 pop up _POP foo._GO0 pop down _POP aplus-fsf-4.22/src/scripts/qio.+0000644000265000001440000001003510772770474012156 Copyright (c) 1990-2008 Morgan Stanley All rights reserved. See .../src/LICENSE for terms of distribution. $cx qio SFI(_sfi;_scfi) in{s;d;i;p;c;v}:s.in{in_;d;i;p;c;v} out{s;d;i;p;c;v}:s.out{out_;d;i;p;c;v} forms{}: { (NUMS)"1234567890"; (FORMS)`decimal `decimal_32nd `8th_32nd `decimal_64th `integer; (DENS)1 32 32 64 1; (PRECS)3 3 3 3 0; } forms{} default{a}: { r(); (fm;pr)(`decimal;3); iFORMSfm; if (`form0a) if (`decimalfm`forma) r[,]`form; if (`max0a) if (Inf`maxa) r[,]`max; if (`min0a) if (Inf`mina) r[,]`min; if (`forms0a) if (()`formsa) r[,]`forms; if (`precision0a) if (PRECS[i]pr`precisiona) r[,]`precision; if (`comma0a) if (0`commaa) r[,]`comma; if (`fuzz0a) if (1`fuzza) r[,]`fuzz; if (`plus0a) if (0`plusa) r[,]`plus; if (`zero0a) if (1`zeroa) r[,]`zero; if (`round0a) if (0`rounda) r[,]`round; if (`width0a) if ((4+pr)`widtha) r[,]`width; if (`na0a) if (999999999.0`naa) r[,]`na; if (0<#r) a(<~(0a)r)/a; if (a(;)) a(); a } in_{x}: { (x;attr)if (0=x) (x;) else 2x; attr2attr; tif (~`forms0attr) FORMS else if (()t`formsattr) FORMS else t; (forms;dens)(1t' '=' ',s s(+/^\s=' ')s) `domain; if (i<3 i"+-"0#s) s1s s[0]" "; if (~1+/fd<4 fd"./-'"s sgn1-2i1 2) `domain; (form;den)(k) `domain; if (c cform=`8th_32nd) if (~8>101#0 1k) `domain; com','wh; sficom#SFI; valsfi{wh}; if (c) kd kk(k-dk)25.6; valval+kden; if (c) valval+kk; valsgnval+plus.5den; if ((valup) `domain; prif (form`decimal) nfrac else 1++/(\wh='.')^wh' '; if (^/FORMSforms) forms(); bttr(`form `plus `precision `forms `min `max `fuzz `comma;(form;plus;pr;forms;lw;up;fu;com)); attrdefault{bttr,(<~(0attr)0bttr)/attr}; (`floatval;attr) } out_{x}: { (val;attr)if (0=x) (x;) else 2x; attr2attr; formif (`form0attr) `formattr else `decimal; prif (`precision0attr) `precisionattr else PRECS[FORMSform]; zrif (`zero0attr) `zeroattr else 1; rnif (`round0attr) `roundattr else 1; blif (`na0attr) `naattr else 999999999.0; wdif (`width0attr) `widthattr else 4+pr; comif (`comma0attr) `commaattr else 0; if (1valbl) wd' '; if (rn>1) val(.5+rnval)rn; if ((0=pr)(~zr)^val=val) form`integer; if ((wd<2+pr)^form`integer) wd'*' else case (form) { `integer; { r,_fmt{(com/"c"),"m<->i",wd-pr+1;val}; (wd+com+/','=r)r wdr }; `decimal; { r,_fmt{(com/"c"),"m<->f",(wd),".",pr;val}; if (~zr) (((r=".")^(" "=1r),0)/r)" " ((^\r'0 ')/r)" "; r }; `decimal_32nd `decimal_64th `8th_32nd; { i`decimal_32nd `decimal_64th `8th_32ndform; (den;dnf;sep)(f",(1+wd-pr),".1";(.11=sgn)+sgnwh}),sep; rr,_fmt{"zi3";frac}; if (((pr<3)~zr)^'0'=rr[2]) rr[2]" "; if ((dnf2)=10|.5+frac) rr[2]"+"; if ('*'r rrl,rr) r[]'*'; r(-' '=1r)r; if (wd>#r) wdr else r } } } aplus-fsf-4.22/src/scripts/qio.doc0000444000265000001440000000244107426305523012560 qio === 0. Description. Like sasha's quote.in{} and quote.out{}, but streamlined for scalar formatting and conversion. qio.in{} and qio.out{} do not require shadow variables. Format- state information is stored on the variable in the attribute `s.io. 1. Operation. valueqio.in{s;string;i;p;c;v} stringqio.out{s;value;i;p;c;v} so that: `a is `scalar `array `matrix `slot `tableField, where `a b and `b is `table `a has (`out;qio.out;`in;qio.in) 2. `s.io The variable attribute `s.io holds an array of slotfillers which represents the format-state of each number in a. It is always true that (a) `a _get `s.io `s.io can be examined and modified by the application. 3. qio.in{} qio.in{} uses the function: (value;slotfiller)qio.in_{(string;slotfiller)} value is *always* of type `float. 4. qio.out{} qio.out{} uses the function: stringqio.out_{(value;slotfiller)} 5. Slotfiller. Default attributes are: `form `decimal `precision 0 if `integer, else 3 `plus 1 `width 4+precision `zero 1 `round 0 `na 999999999.0 `fuzz 1 `max Inf `min Inf `comma 0 `forms (all) Possible values of the `form slot are: `integer `decimal `decimal_32nd `decimal_64th `8th_32nd aplus-fsf-4.22/src/scripts/rap.+0000644000265000001440000000636210772770474012160 Copyright (c) 1990-2008 Morgan Stanley All rights reserved. See .../src/LICENSE for terms of distribution. $cx rap 1-1 connection gadget BUFFER() sync{c}:(c%`_MODE)`sync async{c}:(c%`_MODE)`async abort{c}:if (c%`_LISTEN) () continue{c}:() FUNCTIONS(`sync `async `abort `continue;<@0(sync;async;abort;continue)) set_send_client{s;d;i;p;c;v}:if (`async=c%`_MODE) adap.Send{s;d} else adjust_read_client{c} preset_send_client{s;d;i;p;c;v}:d if (`sync=c%`_MODE xeq_system{c;d}) exchange_client{s;d;c} adjust_read_client{c}:(BUFFER)() (c%`_EVENT `_R)BUFFER exchange_client{s;d;c}:(BUFFER)syncSend{s;d;c} syncSend{s;d;c}:(0z;1z) zadap.Syncsend{s;d;c%`_TIMEOUT} set_send_server{s;d;i;p;c;v}:if (`async=c%`_MODE) adap.Send{s;d} else adjust_read_server{c} preset_send_server{s;d;i;p;c;v}:if (`async=c%`_MODE) d else exchange_server{s;d;c} adjust_read_server{c}:xeq_system{c;c%`_R} (BUFFER)() (c%`_EVENT `_R)BUFFER exchange_server{s;d;c}: { rd; while ((`OK=rc)^~system{c;z} (rc;z)syncXch{s;r;c}) rif (~executable{z}) z else do z; (BUFFER)(rc;z); r } syncXch{s;d;c}: { cdadap.GetClientData{s}; adap.SetClientData{s;}; zif (2=zadap.SyncXch{s;d;c%`_TIMEOUT}) z else (0z;1z); adap.SetClientData{s;cd}; z } set_read{s;d;i;p;c;v}:if (`async=c%`_MODE) if (executable{d}) (c%`_S)do d else xeq_system{c;d} serverRead{c;d}:if (executable{d}) (c%`_R)d else xeq_system{c;d} clientRead{c;d}:(c%`_R)d system{c;d}:(>';`acceptfocus;0); (cx,`_RR) .has (`title;'<<';`acceptfocus;0); (cx,`_LLL) .has (`title;'';`acceptfocus;0); (cx,`_TSORT) .has (`title;' ';`acceptfocus;0); (cx,`_SST) .has (`title;'';`C;1;`reshow;0); s.autows{WS}; cx`_SST } set_list{s;d;i;p;c;v}: { spif (()d) 10 else 10(c%`_SORT)+1#if (`sym=d) d else d; n#d; (c%`_R)0; (c,`_L) .has (`space;sp;`rowsep;n); (c,`_R) .has (`space;sp;`rowsep;n); } sortspec{c}:if (1=c%`_SORT) _alsf{updown{c%`_RIGHT;¡((r<0)#c%`_DIRECTIONS),Ρz set_sort{s;d;i;p;c;v}: { (c,`_SST) .has (`freeze;1); (c%`_SST)if (d0) (`_LL `_RR;`_L `_R) else 2 4`_LL `_LLL `_RR `_TSORT `_L `_L `_R `_R; (c,`_LLL) .has (`show;d); (c,`_TSORT) .has (`show;d); (c,`_LL) .has (`title;d('>>';'')); (c%`_R)c%`_R; (c,`_SST) .has (`naturalsize;1;`freeze;0); } empty_r{c}:if (0=#c%`_L) (c,`_R) .has (`focus;1) empty_l{c}:if (0<#c%`_R) index_r{c} else (c,`_L) .has (`focus;1) (c,`_R) .has (`index;0) index_r{c}:if (0<#i i0`index .of c,`_R) if (ni n#c%`_R) (c,`_R) .has (`index;1+n) row_r_if{c}:if (0=#0`index .of c,`_R) row_r{c} row_r{c}:(c,`_R) .has (`row;1+#c%`_R) row_l{c;n}:(c,`_L) .has (`row;(c%`_L)n) adjust{c;v;r;i}:if ((^/(#d)>r,i)^(^/0r,i)^1<#d dc%v) (()#c%v)t ((~b)/t)i#d tb\t t(ki)/d bkr k#d del_l{s;c;v}:if (1`row .of c,v; if(1=(c%`_MODE)) adjust{c;v;r;c%`_CURROW}; (c%`_CURROW)r; } ref_r{s;c;v}: { if (0=c%`_MODE) {(c%`_MODE)1; (c,v) .has (`selectbg;`pink)} else {(c%`_MODE)0; (c,v) .has (`selectbg; `grey)}; } out_lr{s;d;i;p;c;v}:if (e#cs eabsolute{d} csc%`_LIST) '' else (if (s) direction_r{c;d}),if (`char=ze#cs) z else z aplus-fsf-4.22/src/scripts/sst.doc0000444000265000001440000000546107426305535012611 sst === 0. Description. The SST gadget provides a standard mechanism for moving selected items from a list _LIST back and forth between two lists _L and _R, and for manually sorting the items in list _R. SST also supports optional "select for up/down-sort" buttons. 1. Operation. _LIST `one `two `three _L _R one two three Delete item "two" in _L: _L _R one two <-- item "two" moved to _R three Delete item "two" in _R: _L _R one two <-- item "two" moved back to _L three Delete items "three", "one" in _R: _L _R two three < -- not desired order one Refer to item "one" in _R and cursor up: _L _R two one < -- indexed item moved three Refer to item "one" again: _L _R two one < -- item de-indexed three NB: _LL and _RR (">>" and "<<") are functionally equivalent to delete actions in _L and _R. 2. zdefine cx cx = target context of sort and select gadget z = `cx._SST Define a sort and select gadget in the specified context. 3. Variables _LIST Symbolic vector or character matrix of items _SORT 0 (select) or 1 (select and sort) _TSORT toggle on selected item in _R _DIRECTIONS '' (only if _SORT = 1) _INDEX 1 (retain index of _R while moving), or 0 (do not) _L: Left list (integer vector dependency) _R Right list _SST layout containing _LL, _RR, _L and _R _LL button to move item from _L to _R _RR button to move item from _R to _L _LEFT: _L#_LIST _RIGHT: _R#_LIST _UPDOWN: right argument to t.sort{} _LLL button to move item from _L to _R and sort down. 4. Restrictions _SORT may be assigned 0 or 1 _INDEX may be assigned 0 or 1 (note: for applications where items in the right list will be moved mainly though the use of the mouse (point and click), _INDEX should be 0.) _LIST the only input to SST, may be assigned freely. SST controls the set callback, and modifies the `space of _L and _R to match the maximum width of items in _LIST. _LL button, may not be assigned _RR button, may not be assigned _LLL button, may not be assigned _TSORT button, may not be assigned _L dependency, may not be assigned attributes controlled by SST: `out `delete `protect _R may be assigned attributes controlled by SST: `out `delete `refer `select `protect _SST may not be assigned 5. Example 1. Select: $load s $load sst a3 `a is `array bsst.define `foo b `foo._SST foo._LIST`one `two `three c`a,b show `c is `layout 2. Select and sort up or down: sst.define ` _LIST`one `two `three `four `five _SORT1 show `_SST Note: Elements of _RIGHT are prefixed with 0#_DIRECTIONS if 0, 1#_DIRECTIONS if < 0. aplus-fsf-4.22/src/scripts/stp.+0000644000265000001440000000616410772770474012204 Copyright (c) 1990-2008 Morgan Stanley All rights reserved. See .../src/LICENSE for terms of distribution. $cx stp STP'{^`STP;' stop{y;x}: { if (`null=tx) (); zif (k`func=t) x else x; iz':'; (c;f)if (k) _name{x} else iz; (a;b)((1+i)z;(1+i)z); if (y) {if (~STP(#STP)b) cza,STP,b,'}'} else {if (STP(#STP)b) cza,(#STP)բ1b}; if (k) <{c%f} else z } out_sym{s;d;i;p;c;v}:if (`symd) '' else d stop_scv{s;c;v}:{^`STP} stop_sdipcv{s;d;i;p;c;v}:{^`STP} select_cx{s;c;v}: { if (1=i0`row .of c,v) (); (c%`_CX)cxi#c%v; varsvariables{c}; (syms;vals)c%`_STOPPED; (syms;vals)(¡('+Field';'-Field';'+Attr';'-Attr')),`Derive;(;;;;;;;;;)); (cx%`_MSG)' '; (cx%`_DESCRIBE)DESCRIBE; cx'_FIELDS:ted.fields{`',(cx),'} _DESCRIBE'; cx'_ATTRS:ted.attrs{`',(cx),'} _FIELD'; (cx%`_WINDOW)`_ATTRS; (cx%`_HPANE)<`_FIELDS `_WINDOW; (cx%`_TED)`_ACTION `_MSG `_HPANE; (cx%`_ACT)acx; (cx%`_DIR)'./'; (cx%`_NAME)(); (cx,`_ACTION) .is `action; (cx,`_MSG) .is `label; (cx,`_FIELDS) .is `array; (cx,`_ATTRS) .is `slot; (cx,`_WINDOW) .is `window; (cx,`_HPANE) .is `hpane; (cx,`_TED) .is `layout; (cx,`_DIR) .is `scalar; (cx,`_NAME) .is `scalar; (cx,`_ACTION) .has (`title;'';`geometry;5;`set;set_action;`acceptfocus;0;`C;1); (cx,`_MSG) .has (`resize;'hH'); (cx,`_FIELDS) .has (`title;'';`rows;10;`space;30;`select;select_field;`out;out_sym;`protect;1); (cx,`_ATTRS) .has (`title;'';`stars;0;`set;set_attr;`in;in_attr;`out;out_attr;`preset;preset_attr); (cx,`_WINDOW) .has (`title;''); (cx,`_HPANE) .has (`title;''); (cx,`_TED) .has (`title;''); (cx,`_NAME) .has (`title;'';`out;out_name;`in;in_name); (cx,`_DIR) .has (`title;'';`set;set_dir); (cx,`_N) .has (`title;''); s.autows{WS}; cx`_TED } attrs{c}:if (()n nc%`_FIELD) (;) else sf_sort{nc%`_DESCRIBE} fields{c}:sym_sort{0c%`_DESCRIBE} sf_sort{sf}:if ((;)sf) sf else (<0sf)#sf msg{c;x}:(c%`_MSG)if (()x) ' ' else x err{c;x}:msg{c;'!! ',x,' !!'} warn{c;x}:msg{c;'! ',x,' !'} dir{c}:k,(('/'1k)/'/'),t.DOT_T kc%`_DIR sym_sort{x}:if (~()x) (x)#x space{c;v;s}:if (s>0`space .of c,v) (c,v) .has (`space;s;`naturalsize;1) select_field{s;c;v}: c%`_ATTRS (c%`_FIELD)if (0r r0`row .of c,v) r#c%v check_dir{z}:((1f)t.DOT_T)f fsys.agetdents{z} in_dir{s;d;i;p;c;v}: { zif (0=#z(d' ')/d) './' else z; case (s) { 0; z if (check_dir{z}) warn{c;'No Describe in that directory'}; 1; if (check_dir{z}) z else err{c;'No Describe in that directory'}; } } set_dir{s;d;i;p;c;v}:msg{c;} out_sym{s;d;i;p;c;v}:if (`sym=d) d set_attr{s;d;i;p;c;v}:if (`sym=p) if (`sym=f fc%`_FIELD) ((f,p)c%`_DESCRIBE)d preset_attr{s;d;i;p;c;v}:if (`symp) d (c,v) .has (`space;1) else if (~d<()) d in_attr{s;d;i;p;c;v}:if (('()'(d' ')/d)^/d=' ') <() else if (0=r (r;z)do box.in{'<',d}) >z msg{c;} else err{c;z} out_attr{s;d;i;p;c;v}:z space{c;v;#z} zbox.out{d} out_name{s;d;i;p;c;v}:if (()d) '' else 1',',Ρd in_name{s;d;i;p;c;v}:if (0<#z z(d' ')/d) if (/zs z,t.unique{>¡1ա(z=',')z',',z}) warn{c;'Duplicate name'} else z msg{c;} parse_def{dir;x}: { if ((1x)'[:') (;) else if (3>i i('1';'2';'3')<3x) (-1+i;t.file_string{dir;3x}) else if (''=1#2x) (0#1x;t.file_string{dir;2x}) else (0;t.file_string{dir;x}) } clear{c}: { (c%`_DESCRIBE)DESCRIBE; (c%`_FIELD)(); (c,`_FIELDS) .has (`firstrow;0;`row;1); } *** Actions Help{c}:Help_do{c} New{c}:New_do{c} Make{c}: { msg{c;}; acxc%`_ACT; (acx%`_STUFF)c`_N; (acx,`_Z) .has (`set;(Make_Z;c)); (acx%`_MSG)'Number of records to make ...'; } Save{c}:fileDir{c;c%`_DIR;0;Save_Z;'Save to directory ...'} Load{c}:fileDir{c;c%`_DIR;1;Load_Z;'Load from directory ...'} Derive{c}:fileDir{c;c%`_DIR;0;Derive_Z;'Derive from directory ...'} DelField{c}:DelField_do{c} DelAttr{c}:DelAttr_do{c} AddField{c}:add{c;c%`_FIELDS;AddField_Z;'Add Field(s), names delimited by ","'} AddAttr{c}: { if (()f fc%`_FIELD) warn{c;'No field selected'} else add{c;0c%`_ATTRS;AddAttr_Z;'Add Attribute(s), names delimited by "," ...'} } *** Action code Help_do{c}:msg{c;'Not yet implemented'} New_do{c}: { (c%`_DIR)''; clear{c}; msg{c;'New Describe'}; } Derive_do{s}: { dirdir,('/'1dir)/'/' dirs%`_DIR; fs(~fs1!(1fs)t.DOT_T)/fs fssys.agetdents{dir}; zDESCRIBE; (i#fs) do if (0=rc (rc;val)do dir,f f(f' ')/f fi#fs) { sf(t.DOT;<'0',f),(`na;<(val)t.NA),2if (2#val) (`t.width;<1val); zz,((2'.m'2f)f;1; (c,`_REPORT) .has (`colindex;if (f) d else 0;`cornerindex;~f); sort_report{c;d}; } sort_report{c;k}: { if (2=#tc%`_REPORT) (); if (k=1) { (c%`_LABELS)[](2l),i#2l i2l lc%`_LABELS; (c%`_REPORT)[]1.0(2t),i#2t tc%`_REPORT; (c%`_REPORT)[;5]0.0; } else { i(;k)#2t; t[]t[2],i#2t; t[;5]100.0,100zdiv{1t[;k];t[0;k]}; (c%`_LABELS)[](2l),i#2l lc%`_LABELS; (c%`_REPORT)1.0t; }; } COL_LABELS('Calls';'User';'System';'Elapsed';'Total CPU';'%Total') label_fmt{i}:if (i1) 6' ' else 6(12+i),'.' label_time{s;d;i;p;c;v}:if (()i) '' else if (()0i) (1i)COL_LABELS else n,m m(0i)#c%`_LABELS nlabel_fmt{0i} all{c}: { (c%`_TIMED)(); (i#cxs cxsc%`_CXS) do (c%`_TIMED)[,](i#cxs)functions{c;i#cxs}; (c,`_CXS) .has (`index;#c%`_CXS); (c,`_FNS) .has (`index;#c%`_FNS); } manual_refer{c;d}: { if (0<#d) { obs>¡(t' ')/t1ա(d=',')d',',d; cxc%`_CX; tic%`_TIMED; (cxs;fns)<@1obs; if (1bcxs=cx) { obs(~b)/obs; fnsb/fns; i0`index .of c,`_FNS; pbscxfns; bbpbsti; rembb/pbs; add(~bb)/pbs; ti(~tirem)/ti; ti[,]add; (c,`_FNS) .has (`index;(tti)/#tcxc%`_FNS); }; bobsti; remb/obs; add(~b)/obs; ti(~tirem)/ti; ti[,]add; (c%`_TIMED)ti; }; } refer_fns{s;c;v}: { (i;r)`index `row .of c,v; if (r=1) (); cxc%`_CX; if (ri) (c%`_TIMED)(tcxr#c%v)/t tc%`_TIMED i(ir)/i else (c%`_TIMED)[,]cxr#c%v ii,r; (c,v) .has (`index;i); } refer_cx{s;c;v}: { if (r=1 r0`row .of c,v) (); cxr#c%v; if (ri i0`index .of c,v) { i(ir)/i; (c%`_TIMED)(cx0#t)/t tc%`_TIMED; (c,`_FNS) .has (`index;0); } else { ii,r; fns(~j0`index .of (c,`_FNS))/fns j#fns fnsc%`_FNS; (c%`_TIMED)[,]cxfns; (c,`_FNS) .has (`index;j); }; (c,v) .has (`index;i); } select_cx{s;c;v}: { if (1=r r0`row .of c,v) (); (c%`_CX)cxr#c%v; tfns(cx=tcxs)/tfns (tcxs;tfns)<@1c%`_TIMED; fnsfunctions{c;cx}; (c,`_FNS) .has (`index;fnstfns); (c%`_FNS)fns; } set_action{s;d;i;p;c;v}: { case (p) { `Start; start{c}; `Stop; stop{c}; `Report; report{c}; `Clear; clear{c}; `All; all{c}; `File; file{c}; `Refresh; refresh{c}; } } file{c}:s.write{c%`_FILE;((-1#z)آ12١tim.COL_LABELS),z(c%`_LABELS),@1 12c%`_REPORT} start{c}:report{c} 'time ','`',Ρt (c%`_TIMED)t t(t)#t tc%`_TIMED stop{c}:report{c} 'time `' timer{}:if (0=t ttime{}) 1.02 41,t else if ((,`),0t) 1աt else t timer_matrix{s;m}: { m(+/m),m; mm,@1 0 m[;1]+m[;2]; mm,@1 0 if ((s<1m)^(s0)^s5) 100.0,100zdiv{1m[;s];m[0;s]} else 0; m } report{c}: { (l;r)if (0=t ttimer{}) (2c%`_LABELS;t) else ((2c%`_LABELS),x;m) mtimer_matrix{c%`_SORT;1.0m} (x;m)t; if ((2<#l)^`Contextsc%`_TYPES) { (ll;rr)2١(l;r); (l;r)2ա(l;r); (l;r)(+/(b)r; }; (c%`_LABELS `_REPORT)(l;r); (c%`_SORT)c%`_SORT; } clear{c}: { (c,`_CXS) .has (`index;0); (c,`_FNS) .has (`index;0); (c%`_TIMED)(); stop{c}; } zdiv{y;x}:if (x=0) (#y)0 else yx chart{c;m;n}:if (2=#m) 1 70,1#m else (k),(p) zdiv @1 0+/p pm[1+k;] knĢ1+#m contexts{}:(z)#z z` _nl `cxs valid{x}:if (0=#x) 0 else ((;0)#x)'.',3s.ALPHA_NUM functions{c;cx}: { t((>1c%`_TYPES)1)(`fns;`deps;`fns `deps;`fns `deps); z(); if (`fnst) z[,]valid{>_name{cx%r}}/r rcx _nl `fns; if (`depst) z[,]cx _nl `deps; (z)#z } refresh{c}: { clear{c}; (c%`_CXS)contexts{}; (c%`_FNS)functions{c;`}; } define{cx}: { WSs.autows{()}; (cx%`_FILE)'/tmp/tim.txt'; (cx%`_LABELS)('*Totals*'),'*Unknown*'; (cx%`_TIMED)(); (cx%`_CX)`; (cx%`_SORT)1; (cx,`_SORT) _scb (set_sort;); (cx%`_ACTION)(`Start `Stop `Report `Clear `All `File `Refresh;(;;;;;;)); (cx%`_RAISE)(`Report `Chart;(1;0)); (cx%`_TYPES)(`Functions `Dependencies `All `Contexts;(1;0;0;0)); (cx%`_CONTROLS)<`_ACTION `_RAISE `_TYPES; (cx%`_CXS)contexts{}; (cx%`_FNS)functions{cx;`}; (cx%`_OBJECTS)<`_CXS `_FNS; (cx%`_REPORT)2 60; cx'_REPORT_CHART:tim.chart{`',(cx),';_REPORT;_N}'; (cx%`_CHART)`_REPORT_CHART; (cx%`_DISPLAYS)(); (cx%`_BODY)(`_OBJECTS;`_DISPLAYS); (cx%`_N)10; (cx%`_EXP)''; (cx%`_INPUTS)<`_EXP `_N; (cx%`_TIM)(`_CONTROLS;`_BODY;`_INPUTS); (cx,`_ACTION) .is `action; (cx,`_TYPES) .is `choice; (cx,`_RAISE) .is `choice; (cx,`_CONTROLS) .is `layout; (cx,`_CXS) .is `array; (cx,`_FNS) .is `array; (cx,`_OBJECTS) .is `hpane; (cx,`_CHART) .is `graph; (cx,`_REPORT) .is `matrix; (cx,`_DISPLAYS) .is `layout; (cx,`_BODY) .is `vpane; (cx,`_N) .is `scalar; (cx,`_EXP) .is `scalar; (cx,`_INPUTS) .is `layout; (cx,`_TIM) .is `layout; (cx,`_ACTION) .has (`title;'';`geometry;`horizontal;`C;1;`set;set_action;`acceptfocus;0); (cx,`_RAISE) .has (`title;'';`set;set_raise;`resize;'wW';`shadowthickness;0;`acceptfocus;0); (cx,`_TYPES) .has (`title;'';`set;set_types;`resize;'wW';`shadowthickness;0;`acceptfocus;0); (cx,`_CONTROLS) .has (`title;'';`resize;'hH';`shadowthickness;0); (cx,`_CHART) .has (`title;'';`legend;`tr;`freeze;1;`shadowthickness;0); (cx,`_REPORT_CHART) .has (`style;`bar;`legend;COL_LABELS); (cx,`_CXS) .has (`title;'Contexts';`space;37;`out;out_sym;`protect;1;`select;select_cx;`refer;refer_cx;`shadowthickness;0); (cx,`_FNS) .has (`title;'Functions';`space;37;`out;out_sym;`protect;1;`refer;refer_fns;`shadowthickness;0); (cx,`_OBJECTS) .has (`title;'';`shadowthickness;0); (cx,`_REPORT) .has (`title;'';`protect;1;`label;label_time;`colspace;29 9 9 9 9 10 9;`selectcol;selectcol_time;`selectcorner;selectcorner_time;`cornerindex;1;`shadowthickness;0;`cols;7;`out;(4<'i9'),(<'i10'),<'f7.2'); (cx,`_BODY) .has (`title;'';`shadowthickness;0); (cx,`_DISPLAYS) .has (`title;'';`position;0;`shadowthickness;0); (cx,`_EXP) .has (`title;': ';`set;set_exp;`shadowthickness;0); (cx,`_N) .has (`title;'N: ';`resize;'wW';`shadowthickness;0); (cx,`_INPUTS) .has (`title;'';`resize;'hH'); (cx,`_TIM) .has (`title;'';`shadowthickness;0); (cx%`_DISPLAYS)`_CHART `_REPORT; s.autows{WS}; cx`_TIM } aplus-fsf-4.22/src/scripts/tim.doc0000444000265000001440000000742607426305553012574 tim === 0. Description. The tim gadget is an interface to the A+ function/dependency timer. 1. Operation. Get everything loaded you want to time. $load tim. show tim.define `foo Selecting a row in the "Contexts" list causes the functions in that context to be displayed in the "Functions" list. Referring to a row in the "Contexts" list toggles all/none indexing of the functions in that context. Referring to a row in the "Functions" list toggles yes/no indexing of that function. Pressing "All" references all functions in all contexts. Pressing "Start" sets timing on all currently indexed functions, and runs the timer. (display time{} time `f ... `g) Pressing "Stop" removes the currently indexed functions from the timer, and resets the report. (display time{} time ()) Pressing "Report" re-runs the timer on the currently indexed functions. (display time{}) Pressing "Clear" de-indexes all currently indexed functions. Pressing "Refresh" retrieves current contexts and clears. Entering an expression into the "" line causes that expression to be evaluated (under "do"), and the timer to be run on the currently indexed functions. Selecting a column-label of the timing matrix causes the matrix to be down-sorted on that column (heaviest loads to the top.) Selecting the corner-label of the timing matrix causes the matrix to be up-sorted on the function names. The last column, labelled "%Total", shows percent of total for the sorted column. (Thanks to Tuck Lee for suggesting this.) Picking "Chart" from the "Raise" choice-box raises the timing chart. Picking "Functions", "Dependencies", or "All" from the "Types" choice-box, filters on those categories. Picking "Context" from the "Types" choice-box, filters on all types, and summarizes by context. The top "N" functions are charted. E.g., Index some functions to time. Press "Start" to initialize the timer and run report. Go to "" input line and type "show 10". Updated report displayed. Go to emacs and type show 10. Report does not update. Press "Report" to see additional time spent. Press "Start" to reset the report. Press "Clear" to de-index timed functions. The _EXP input scalar accepts a "manual" form for adding and removing functions from the timing list: :a.foo, a.goo, b.hoo adds a.foo, a.goo, and b.hoo to the timing list if they are not in the list, and removes them if they are. (Note initial "escape character" colon). NB: "Total CPU" denotes "User" + "System" times. 2. zdefine cx cx = target context of timer tool z = `cx._TIM Define a tim-gadget in the specified context. 3. Variables _TIMED symbolic vector of functions to be timed _CX selected context _SORT 1 ( by name), 0 1 2 3 4 _LABELS row labels of _REPORT _FILE "/tmp/tim.txt" _ACTION tim actions _RAISE raise report or chart _TYPES type of object to time _CONTROLS layout of _ACTION and _RAISE _CXS ` _nl `cxs at define-time _FNS `_CX _nl `fns _OBJECTS hpane of _CXS and _FNS _REPORT timing matrix _REPORT_CHART: chart of percentages of time _DISPLAYS layout of _REPORT and _REPORT_CHART _BODY vpane of _OBJECTS and _DISPLAYS _EXP executable expression input scalar _N functions to be charted _INPUTS layout of `_EXP and `_N _TIM outer layout 4. Restrictions tim controls: assignment callbacks on _ACTION, _RAISE and _EXP; refer callbacks on _CXS and _FNS select callback on _CXS selectcol callback on _REPORT assignment callback on _SORT contents of _LABELS 5. Example $load s $load tim show tim.define `f Double click on the context "tim" to index all tim functions. Press "Report" repeatedly, to time tim functions. Select "Calls" label on timing matrix to downsort on calls. aplus-fsf-4.22/src/scripts/tl.+0000644000265000001440000002402510772770474012011 Copyright (c) 1990-2008 Morgan Stanley All rights reserved. See .../src/LICENSE for terms of distribution. $cx tl VERSION1.0 SCRIPT' tl.script' unroot{x}:replace{x;ROOT;`} root{x}:replace{x;`;ROOT} replace{x;y;z}:x ((x=y)/x)z paired{y;x}:r1r2|+\y=x quoted{x}:paired{'"';x}paired{'''';x} parts{y;x}:if (0<#x) 1ա((~quoted{x})^x=y)xy,x tokens{x}:parts{' ';db{x}} braced{y;x}:(y[0]=1x)^y[1]=1x ntom{x}:>(/>#x)١x dltb{x}:((\x' ')^\x' ')/x deb{x}:(quoted{x}(x' ')x1x)/x db{x}:dltb{deb{x}} dbi{x}:(/@1 x' ')/x first{x}:if (''=1x) (1x;1x) else (ix;dltb{ix}) i+/^\xALP,NUM,'.?!' field{x}:((1x)ALP)^if (1=#x) 1 else ^/(1x)ALP,NUM,'_' vname{x}:((ROOT=1x)^1=#x)field{x} split{y;x}:if ((#b)=i ib1 b(x=y)^~quoted{x} xdltb{x}) x else (ix;(1+i)x) colon{x}:split{':';x} shriek{x}:split{'!';x} semicolon{x}:split{';';x} space{x}:if (0=z zsplit{' ';x}) z else if (field{0z}) z ROOT'.' ALP'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' NUM'0123456789' load_a{d;k}:_load{if (d'') k else (d,if ('/'1d) '/'),k} get_ref{cx}:if (~()t tcx%`_TABLE) t else parse_error{"no reference table";''} set_ref{cx;t}:if ((t())1=cx%`_RESET) (cx%`_TABLE)t commands_q{cx;x}:(z)#z z((~zy)/z),y y0cx%`_COMMANDS z0COMMANDS script_q{cx;x}:cx%`_SCRIPT tables_q{cx;x}:(z)#z z,root{t.TABLES} table_q{cx;x}:root{cx%`_TABLE} fields_q{cx;x}:(z)#z zparse_s{cx;x}%cx%`_MODE open_q{cx;x}:root{0cx%`_OPEN} count_q{cx;x}:parse_s{cx;x}%`_N name_q{cx;x}:cx%`_NAME show{cx;x}:.show{t} tt.table{parse_s{cx;x}} hide{cx;x}:.hide{parse_s{cx;x},cx%`_MODE} free{cx;x}:.free{parse_s{cx;x},cx%`_MODE} fields{cx;x}:(s%`_U)parse_fields{cx;x;s} sget_ref{cx} script_name{x}:(-3'.tl'3x)x load{cx;x}:if (~SCRIPT(#SCRIPT),1r rsys.readmat{z} zparse_continue{cx;x}) _load{z} else load_tl{cx;z;dbi{r}} load_tl{cx;z;s}:(cx%`_NAME)script_name{z} (i#s) do interpret{cx;i#s} save{cx;x}:t.write{z;SCRIPT,NEWLINE,NEWLINE,(cx%`_SCRIPT),NEWLINE} zparse_continue{cx;x} drop{cx;x}:'$rm ',z zparse_file{cx;x} copy{cx;x}:'$cp ',z zparse_files{cx;x} move{cx;x}:'$mv ',z zparse_files{cx;x} name{cx;x}:(cx%`_NAME)if (0=#z zdltb{x}) `continue else script_name{z} clear{cx;x}:(cx%`_SCRIPT)() table{cx;x}:set_ref{cx;parse_table{cx;x}} all{cx;x}:t.only{get_ref{cx};} only{cx;x}:t.only{get_ref{cx};parse_select{cx;x}} also{cx;x}:t.also{get_ref{cx};parse_select{cx;x}} not{cx;x}:t.not{get_ref{cx};parse_select{cx;x}} sort{cx;x}:t.sort{get_ref{cx};parse_sort{cx;x}} sample{cx;x}:t.sample{get_ref{cx};parse_sample{cx;x}} fix{cx;x}:t.fix{t;()t%`_F} tget_ref{cx} group{cx;x}:z set_ref{cx;d} t.send{s,d;} zt.group{s,d;f} sget_ref{cx} (d;f)parse_group{cx;x} report{cx;x}:z set_ref{cx;d} t.send{s,d;fs} fs(~fs`_,f)/fs fss%`_T_ zt.report{s,d;f} sget_ref{cx} (d;f)parse_group{cx;x} to{cx;x}:if (()f (d;f)parse_link{cx;x} sget_ref{cx}) unlink{s;d} else link{s;d;cx;f} from{cx;x}:if (()f (s;f)parse_link{cx;x} dget_ref{cx}) unlink{d;s} else link{d;s;cx;f} link{s;d;cx;f}:z set_ref{cx;d} t.send{s,d;} zt.link{s,d;f} unlink{s;d}:t.link{s,d;} view{cx;x}:z set_ref{cx;0#1d} if (1=#d dparse_view{cx;x}) t.send{s,d;} zt.only{s,d;} sget_ref{cx} else t.send{d;} zt.cat{d;} d1d open{cx;x}:if ((k())_issf{k} (t;k;d)parse_open{cx;x}) set_ref{cx;t} t.open{(t;d);k} else load_a{d;k} reset{cx;x}:set_ref{cx;} t.reset{} close{cx;x}:{t.close{t;f} (t;f)parse_close{cx;x};if (()f) if (tget_ref{cx}) set_ref{cx;}} detach{cx;x}:t.close{parse_table{cx;x};} execute{cx;x}:x def{cx;f;x}:if (':'=1x) send{cx;f;1x} else t.define{get_ref{cx};(f;':',x)} send{cx;f;p}: { (y;fun)(iy;iy) i+/^\yALP,NUM,'_.' ydeb{p}; if ((#y)=i iy'.') parse_error{"expecting ";y}; tif (^/' '=t tiy) ` else parse_table{cx;iy}; gparse_field{cx;(i+1)y;t}; funif (0<#fundb{fun}) if (0=rc (rc;gun)do fun) gun else fun; t.send{t,get_ref{cx};(f;(g;fun))}; } let{cx;v;x}:if (^/x=' ') %cxv else (%cxv)x naked{cx;x}: { if (1=z zcolon{x}) if (field{0z}) def{cx;0z;dltb{1z}}; if (1=z zshriek{x}) if (field{0z}) let{cx;0z;dltb{1z}}; k~()t tcx%`_TABLE; if (k) if (1=z zspace{x}) if (field{0z}) if (at%cx%`_MODE (a;b)(0z;1z)) t.only{t;(a;b)}; if (0=z) if (vname{z}) if (tt.TABLES tunroot{z}) (cx%`_TABLE)t; if (k) t.only{t;z}; parse_error{"cannot recognize string";x}; } parse_error{x;y}:' !! ',x,': ',y parse_continue{cx;x}: { if (0=#z zdb{x}) zcx%`_NAME; parse_file{cx;z} } parse_file{cx;x}: { if (0=#z zdb{x}) parse_error{"expecting ";x}; if ('.'z) z else z,'.tl' } parse_files{cx;x}: { if (2#z ztokens{x}) parse_error{"expecting ";x}; if (~'.'0z) (0z)[,]'.tl'; if (~'.'1z) (1z)[,]'.tl'; (0z),' ',1z } parse_open_alsf{x}:if (`sym=x) (x;(#x)()) else _alsf{x} parse_open{cx;x}: { if (~11 2=#ttokens{x}) parse_error{"expecting {}";x}; sparse_name{cx;0t}; if (s0o ocx%`_OPEN) { kso; (z;d) if (1`null `sym `charũk) (k;'') else if (0=k) parse_error{"_OPEN type error";x} else if (1=#k) (;0,k) else if (2#k) parse_error{"_OPEN type error";x} else if (`char=0k) (parse_open_alsf{1k};0k) else (parse_open_alsf{k};''); (s;z;d) } else if (1=#t) (s;;'') else (s;;1t) } parse_close{cx;x}: { if (0=#x xdb{x}) (get_ref{cx};) else if ((#x)=i ix' ') (parse_table{cx;x};) else (t;f) fparse_fields{cx;(i+1)x;t} tparse_table{cx;ix} } parse_table{cx;x}: { if (~vname{x}) parse_error{"bad table name";x}; if (~zt.TABLES zunroot{x}) parse_error{"not a table";x}; z } parse_field{cx;x;t}: { if (~field{x}) parse_error{"bad field name";x}; if (~zt%cx%`_MODE zx) parse_error{"expecting a field in ",t;x}; z } parse_fields{cx;x;t}: { if (0<#z ztokens{x}) { if (~^/>field{z}) parse_error{"bad field name somewhere";x}; if (~^/zt%cx%`_MODE z>¡z) parse_error{"expecting fields in ",t;x}; }; z } parse_name{cx;x}: { if (1#z ztokens{x}) parse_error{"expecting a name";x}; if (~vname{z} z0z) parse_error{"bad name";x}; unroot{z} } parse_view{cx;x}: { if (0=#z ztokens{x}) parse_error{"expecting at least one name";''}; if (~^/>vname{z}) parse_error{"bad name somewhere";x}; zunroot{>¡z}; if (~^/(1z)t.TABLES) parse_error{"bad table name somewhere";x}; z } parse_s{cx;x}:if (~^/x=' ') parse_table{cx;x} else get_ref{cx} parse_select{cx;x}: { if (^/x=' ') ''; rtget_ref{cx}; x[,](';'1x)/';'; flag0; sym(); val(); while (0<#x) { (f;x)semicolon{x}; if (0=z zspace{f}) { if (flag=0) z else parse_error{"expecting }";x} } else { (a;b)(parse_field{cx;0z;rt};1z); sym[,]a; val[,]";x}; if (0rc (rc;z)do _sfi{z}) parse_error{"bad number";x}; if (z<0) parse_error{"must be positive";x}; `intz } parse_sort{cx;x}: { tget_ref{cx}; rtokens{x}; z(); (i#r) do zz,if ('-'=1q qir) (parse_field{cx;1q;t};1) else (parse_field{cx;q;t};0); z } parse_group{cx;x}: { if (0=z zspace{x}) parse_error{"expecting ";x}; tparse_name{cx;0z}; fparse_fields{cx;1z;get_ref{cx}}; (t;f) } parse_link{cx;x}: { if (0=#z ztokens{x}) parse_error{"expecting
";x}; tparse_name{cx;0z}; z1z; if (0=#z) (t;) else { (f;g)(;); rtget_ref{cx}; (i#z) do { (ff;gg)if (0=r rsplit{'/';iz}) (r;r) else r; f[,]parse_fields{cx;ff;rt}; g[,]parse_fields{cx;gg;rt}; }; (t;(f;g)) } } COMMANDS_alsf{ ( "?"; commands_q; - commands "tables?"; tables_q; - tables "fields?"; fields_q; - fields {
} "table?"; table_q; - reference table "script?"; script_q; - script so far "open?"; open_q; - tables in _OPEN "count?"; count_q; - count {
} "name?"; name_q; - _NAME ""; execute; A `all; all; all `table; table; table
`fields; fields; fields {} `only; only; only {} `also; also; also {} `not; not; not {} `sort; sort; sort (where f = or <-field>) `sample; sample; sample (where n is a positive integer) `fix; fix; fix `view; view; view
{} `group; group; group
`report; report; report
`to; to; to
{ {}} `from; from; from
{ {}} `save; save; save `load; load; load {} `name; name; name {} `drop; drop; drop `move; move; move `copy; copy; copy `clear; clear; clear `show; show; show {
} `hide; hide; hide {
} `free; free; free
`open; open; open
{} `close; close; close
{field ... field} `detach; detach; detach
`reset; reset reset T ) } parse{cx;x}: { if (''=1x) (); if (kbraced{'[]';x}) x1բ1x; if ('$'=1x) x1x (cx%`_RESET)0; (f;r)first{x}; ff; sfz,y z(<~(0z)0y)/z zCOMMANDS ycx%`_COMMANDS; if (f0sf) (f;(fsf){cx;r};k) else (;naked{cx;x};k) } interpret{cx;x}: { (cx%`_COMMAND)(); if (()r rparse{cx;x}) (0;x) else { (f;z;k)r; (cx%`_COMMAND)f; if (~k) (cx%`_SCRIPT)[,]' inq 'hide' OR inq 'hide
' inq 'free' OR inq 'free
' Application-specific keywords. A set of operations can be added to TL by specifying cx._COMMANDS as a slot-filler of the form: (`key1 ... `keyn;(key_func_1;...;key_func_n)) so that inq 'key ' causes execution of: (key_COMMANDS){cx;argument} Elements of (0cx._COMMANDS) override same-named elements of 0tl.COMMANDS (the set of TL primitives). Extreme care must be taken in these overrides. Normally, the command-sets will be disjoint. 2. Syntax. "<>" is syntactic (corner) quotation. E.g., "
" means that a table name is expected. Prefixed "!" prevents TL from resetting the reference-table: "*" indicates that the operation resets the reference table as a side-effect. "**" indicates that the operation resets the reference table if it can. "***" indicates that the operation voids the reference-table if it must. The abbreviation "rt" is used to designate the reference table. "." refers to the root table. E.g., inq 'table .' sets the reference table to `. In all cases, inq{} returns (rc;z), where z is the "expected" result of the corresponding T or S operation. = ... , where = or "cx" refers to the context of instantiation. ========================================================================= Keyword Syntax Effect General A parse & execute A [A] execute A but do not append to _SCRIPT {A;...;Z} parse & execute each [A] ... [Z] $A do not reset reference table during A A execute A expression !A (%cxname)A ! %cxname A A (no op) '' (no op) Queries: ? ? TL commands tables? tables? t.TABLES table? table? reference table script? script? script so far open? open? tables in universe count? count? _N of reference table count?
_N of
fields? fields? fields in reference table fields?
fields in
name? name? name of current script Commands: * table table
set reference table to
fields fields (rt%`_U)fields all all rt t.only () only only rt t.only () only rt t.only (`field;select) only ; rt t.only ( : `field1 ... `fieldn; `select1 ... `selectn ) also also rt t.also () also rt t.also (`field;select) also ; rt t.also ( : `field1 ... `fieldn; `select1 ... `selectn ) not not rt t.not () not rt t.not (`field;select) not ; rt t.not ( : `field1 ... `fieldn; `select1 ... `selectn ) sort sort rt t.sort fields sort < ... -field ...> rt t.sort ( ... ;(f;1); ...) sample sample rt t.sample n fix fix rt t.fix 0/1 (toggle fix) * view view
(rt,table) t.only () (rt,table) t.send () view
(tables,table) t.cat () (tables,table) t.send () * group group
(rt,table) t.group fields (rt,table) t.send () * report report
(rt,table) t.report fields (rt,table) t.send () * to to
(rt,table) t.linkto (lfields;rfields) (rt,table) t.send () to
(rt,table) t.link () from from
(table,rt) t.link (lfields;rfields) (table,rt) t.send () from
(table,rt) t.link() Scripts ("file" --> "file.tl"): name name {} save save {} load load {} drop drop move move copy copy clear clear S (requires S): show show .show t.table rt show
.show t.table
hide hide .hide rt,`_T hide
.hide table,`_T free free .free rt,`_T free
.free table,`_T Other: ** open open object t.open object_OPEN _load object_OPEN open (object;dir) t.open object_OPEN _load dir,object_OPEN (object;dir) t.open () *** close close rt t.close () close
table t.close () close
table t.close fields * detach detach rt t.detach () detach
table t.detach () * reset reset t.reset{} (none) rt t.define (`field;definition) rt t.only (`field;select)
set reference table to
X try: rt t.only X X 0_COMMANDS: X X Y (X_COMMANDS){cx;Y} 3. Functions. (rc;z)cx.inq{str} str = string to interpret rc = 0 or error z = result 4. Variables. _TABLE symbol of reference table _NAME symbol of current script-name (default = `continue) _MODE `_T (non-S) `_T_ (S) _SCRIPT nested array of right args to inq{} _COMMAND symbol of last command executed or () _RESULT (0 or error;result_of_inq{}) _OPEN ( `tab1 ... `tabn;( arg1; : argn ) arg_i: a. charvec: ra to _load{} b. slotfiller: ra to t.open{} c. (charvec;slotfiller) = ('dir';ra_to_t.open{}) d. 20010101' make a selection inq 'also mat<19940301' include these inq 'count?' new count ... inq 'all' select all the records inq '?' commands ... aplus-fsf-4.22/src/scripts/trc.+0000644000265000001440000000634010772771353012157 Copyright (c) 1990-2008 Morgan Stanley All rights reserved. See .../src/LICENSE for terms of distribution. $cx trc if( ()scriptsDirsys.readenv{"SCRIPTS_DIR"} ) { scriptsDir"/usr/local/aplus-fsf-4.22/scripts"; } _load{scriptsDir,"/vim.+"} trc_cb{s;e;a;b;c}: { case (b) { `enter; trc_enter{s;a}; `exit; trc_exit{s;a}; `abort; trc_abort{s;a}; } } trc_enter{c;a}:(c%`_I)1+c%`_I (c%`_T)[,]<((c%`_I)' '),a if (1 1c%`_BASIS) (c%`_BASIS)1 2sys.cpu{} trc_exit{c;a}:(c%`_I)0Ӣ1+c%`_I (c%`_J)[,]2sys.cpu{} trc_abort{c;a}:(c%`_I)0 refer_cxs{s;c;v}: { s.call_refer{s;c;v}; dbg_cxt{s;c;v}; } set_but{s;d;i;p;c;v}:dbg_cxt{s;c;v} dbg_cxt{s;c;v}: { idx0`index .of c,`_CXS; rho#c%`_CXS; case (`c%`_BUT) { 0; `cxt _dbg if (idxrho) (`all;) else (`only;idx#c%`_CXS); 1; `cxt _dbg if (idx0) (`only;) else (`not;((~rhoidx)/rho)#c%`_CXS); } } clear{c}:(c%`_I`_T`_J`_VIEW`_BASIS)(0;;0 20;0 0' ';1 1) set_buttons{s;d;i;p;c;v}:d{c} display{c}: { trace_off{c}; vim.zero{c}; } refresh{c}: { trace_off{c}; clear{c}; (c%`_CXS)cxs cxs(cxs)#cxs cxs() _nl `cxs; vim.zero{c}; } maxUser{c}:scroll_to{c;0} maxSystem{c}:scroll_to{c;1} scroll_to{c;i}:(c,`_TVIEW) .has (`firstrow `row;2t/t(c%`_TIMING)[;i]) set_trace{s;d;i;p;c;v}: { if (d=1) clear{c}; `func _dbg d; } xeq{stupid_goddamn_nameshadow}: { `func _dbg 1^~(`only;)`cxt _dbg (); do `stupid_goddamn_nameshadow; `func _dbg 0; } trace_off{c}: { `func _dbg 0; (c`_TRACE) _scb (;); (`c%`_TRACE)0; (c`_TRACE) _scb (set_trace;); } set_xeq{s;d;i;p;c;v}: { trace_off{c}; clear{c}; xeq{d}; vim.zero{c}; } timing{v;j;basis;bool}:if (0=#v) 0 20 else if (0=#j) j else >+/(bool)nj-basis,1j define{cx}: { `print _dbg 0; `func _dbg 0; `cxt _dbg (`only;`); `cb _dbg (trc_cb;cx); vim.define{cx}; (cx`_MATRIX) _scb (;); (cx`_MATRIX) _spcb (;); WSs.autows{()}; (cx%`_I)0; (cx%`_T)(); (cx%`_J)0 20; (cx%`_BASIS)1 1; cx'_MATRIX:if (()_T) 0 0"" else >(/>#_T)١_T'; cx'_TIMING:trc.timing{_VIEW;_J;_BASIS;_BOOL}'; cx'_TVIEW:_VIEW,@1 _TIMING'; (cx,`_TVIEW) .is `view; (cx,`_TVIEW) .has (`title;'';`rows;10;`cols;50;`fg;vim.fg;`rowbg;`grey40;`bg;`black); (cx%`_XEQ)''; (cx%`_CXS)cxs cxs(cxs)#cxs cxs() _nl `cxs; (cx%`_BUT)(`;<0); (cx%`_TRACE)(`;<0); (cx%`_BUTTONS)(`Display `Refresh,(' User'),' System';<@0(display;refresh;maxUser;maxSystem)); (cx%`_LEFT)(`_ACTION;`_TVIEW;`_XEQ); (cx%`_RIGHT)(`_BUT;`_CXS;`_TRACE;`_BUTTONS); (cx%`_TRC)<`_LEFT `_RIGHT; (cx,`_XEQ) .is `scalar; (cx,`_CXS) .is `view; (cx,`_BUT) .is `check; (cx,`_BUTTONS) .is `action; (cx,`_TRACE) .is `check; (cx,`_LEFT) .is `layout; (cx,`_RIGHT) .is `layout; (cx,`_TRC) .is `hpane; (cx,`_XEQ) .has (`title;':';`set;set_xeq;`done); (cx,`_CXS) .has (`title;'';`index;cxs`;`refer;refer_cxs); (cx,`_BUT) .has (`title;'';`label;'Trace all but ...';`acceptfocus;0;`set;set_but); (cx,`_TRACE) .has (`title;'';`label;'Trace';`acceptfocus;0;`set;set_trace); (cx,`_BUTTONS) .has (`title;'';`acceptfocus;0;`geometry;2;`set;set_buttons); (cx,`_LEFT) .has (`title;''); (cx,`_RIGHT) .has (`title;'';`C;1); (cx,`_VIEW) .has (`title;'Trace'); (cx,`_TRC) .has (`title;''); s.autows{WS}; cx`_TRC } aplus-fsf-4.22/src/scripts/trc.doc0000444000265000001440000000275707426305561012574 trc === 0. Description. Interactive function execution trace. 1. Operation. Desk calculator mode: Specify context(s) of trace. Enter an executable (executes from the root). Use -Level and +Level buttons to explore execution trace. Set level-indexed color array for readability. Running application mode: Have TRC running with the application. Specify contexts(s) of trace. Toggle Trace on. Do an application action (e.g. press a button). Press Display to see trace. (Trace toggle is automatically turned off.) 2. zdefine cx cx = target context of TRC tool. z = `cx._TRC 3. Variables See vim.doc. _TIMING: user/system cpu timing matrix _J: raw timings _BASIS initial time _T raw callback checkpoints _I level counter _XEQ executable input scalar _BUT "All but" check button _CXS view of contexts _TRACE "Running application" check button _BUTTONS action box _LEFT, _RIGHT layouts _TRC outer hpane 4. Restrictions TRC controls `set callback on _XEQ, _BUT, and _TRACE, and `refer callback on _CXS, 5. Example $load s $load trc show trc.define `foo Example 1: Refer to s context. Enter: show 10 Use +Level and -Level to expand and compress the trace. Example 2: In the root, define: foo{}:goo{} goo{}:hoo{} hoo{}:0 Refer only to root context (turn others off). Toggle Trace on. In emacs or in _XEQ, enter: foo{} Press the Display button (Trace will toggle off). aplus-fsf-4.22/src/scripts/tss.+0000644000265000001440000001042310772771354012176 Copyright (c) 1990-2008 Morgan Stanley All rights reserved. See .../src/LICENSE for terms of distribution. $cx tss if( ()scriptsDirsys.readenv{"SCRIPTS_DIR"} ) { scriptsDir"/usr/local/aplus-fsf-4.22/scripts"; } _load{scriptsDir,"/act"} _load{scriptsDir,"/sst"} _load{scriptsDir,"/box"} define{cx}: { scx(cx),'_sst'; sst.define{scx}; acx(cx),'_act'; act.define{acx}; (acx%`_FONT)s.FONT; (acx%`_LOCATE)cx`_TSS; (acx%`_SHELLS)cx`_TSS; (cx%`_SST)scx; (cx%`_ACT)acx; (cx%`_DO)(); (cx,`_DO) _spcb (preset_do;); (cx,`_DO) _scb (set_do;); WSs.autows{()}; (cx%`_DIR)(); (cx,`_DIR) .is `scalar; (cx,`_DIR) .has (`title;'';`out;out_dir;`in;in_dir;`preset;preset_dir;`set;set_dir); (cx%`_SOURCE)(cx),'_SOURCE'; (cx%`_TARGET)(cx),'_TARGET'; (cx%`_ACTION)(`Open `Close `Order `Sort;(;;;)); (cx%`_MSG)''; (cx%`_CMD)''; (cx%`_FIX)(`Fix;<0); (cx%`_TABLE)(); (cx%`_TSS)(`_ACTION;`_MSG;`_TABLE;`_CMD `_FIX); (cx,`_ACTION) .is `action; (cx,`_MSG) .is `label; (cx,`_CMD) .is `scalar; (cx,`_FIX) .is `check; (cx,`_TABLE) .is `layout; (cx,`_TSS) .is `layout; (cx,`_ACTION) .has (`title;'';`geometry;`horizontal;`set;set_action;`acceptfocus;0;`C;1); (cx,`_MSG) .has (`resize;'hH'); (cx,`_CMD) .has (`title;'Select:';`in;in_cmd); (cx,`_FIX) .has (`title;'';`resize;'wWr';`set;set_fix); (cx,`_TABLE) .has (`title;'';`reshow;0;`reparent;0;`newshow;1); (cx,`_TSS) .has (`title;''); s.autows{WS}; cx`_TSS } msg{c;x}:(c%`_MSG)if (()x) ' ' else x err{c;x}:msg{c;'!! ',x,' !!'} warn{c;x}:msg{c;'! ',x,' !'} paired{y;x}:r1r2|+\y=x quoted{x}:paired{'"';x}paired{'''';x} deb{x}:(quoted{x}(x' ')x1x)/x dltb{x}:((\x' ')^\x' ')/x db{x}:dltb{deb{x}} in_dir{s;d;i;p;c;v}:(d' ')/d out_dir{s;d;i;p;c;v}:if (()d) '' else d preset_dir{s;d;i;p;c;v}:if (0<#d) d set_dir{s;d;i;p;c;v}:((c%`_SST)%`_LIST)() in_cmd{s;d;i;p;c;v}: { if (()t tc%`_TARGET) d warn{c;'No table'} else if (^/d=' ') d msg{c;} else { edb{d}; (f;r)(ie;(i+1)e) ie' '; (rc;z)do case (f) { `all; t.only{t;}; `only; t.only{t;r}; `also; t.also{t;r}; `not; t.not{t;r}; t.only{t;e} }; if (rc=0) d msg{c;(1z),' records selected'} else err{c;z} } } set_fix{s;d;i;p;c;v}:if (()t tc%`_TABLE) warn{c;'No table'} else msg{c;d('Unfixed';'Fixed')} t.fix{c%`_TARGET;d} browse{c}: { if (()dir dirc%`_DIR) msg{c;} else if (rc0 (rc;z)do open{dir;c%`_SOURCE}) msg{c;z} else { r''table{dir;c%`_SOURCE;c%`_TARGET}; msg{c;'Opened'}; r } } open{dir;z}: { t.close{z;}; t.open{(dir;z);} } table{dir;z;zz}: { wss.autows{()}; t.only{z,zz;}; t.send{z,zz;}; t.table{zz}; s.autows{ws}; tzz`_T_; t .has (`title;dir;`reshow;0); t } Open{c}: { acxc%`_ACT; (acx%`_STUFF)c`_DIR; (acx,`_Z) .has (`set;(Open_Z;c)); (acx%`_MSG)'Directory to open ...'; } Close{c}:Close_do{c} Order{c}:sort_or_order{c;Order_Z;0;'Specify field order ...'} Sort{c}:sort_or_order{c;Sort_Z;1;'Specify sort order ...'} Open_Z{s;d;i;p;c;v}:if (`applyd) msg{s;} else Open_do{s} Order_Z{s;d;i;p;c;v}:if (`applyd) msg{s;} else Order_do{s} Sort_Z{s;d;i;p;c;v}:if (`applyd) msg{s;} else Sort_do{s} Open_do{s}: { if (0=#dir dirs%`_DIR) warn{s;'No directory specified'} else if (0=#sys.agetdents{dir}) warn{s;'Directory is empty'} else { (s%`_DIR)dir; (s%`_TABLE)browse{s}; msg{s;'Opened'} } } Close_do{c}:msg{c;'Closed'} t.close{c%`_SOURCE;} (c%`_DIR)() Order_do{s}:msg{s;'Ordered'} (%s%`_TABLE)(s%`_SST)%`_RIGHT Sort_do{s}:if (()o o(s%`_SST)%`_UPDOWN) warn{s;'Sort not specified'} else msg{s;'Sorted'} t.sort{s%`_TARGET;o} sort_or_order{c;func;flag;msg}: { if (()t tc%`_TABLE) warn{c;'No table'} else if (()tt tt%t) warn{c;'No fields'} else { flds(c%`_TARGET)%`_T; scxc%`_SST; (scx%`_LIST)flds; (scx%`_R)if (flag) 0 else fldstt; (scx%`_SORT)flag; acxc%`_ACT; (acx%`_STUFF)scx`_SST; (acx,`_Z) .has (`set;(func;c)); (acx%`_MSG)msg; } } preset_do{s;d;i;p;c;v}:if (~()d) if (d0c%`_ACTION) d set_do{s;d;i;p;c;v}: { case (d) { `Open; Open_do{c}; `Close; Close_do{c}; `Order; Order_do{c}; `Sort; Sort_do{c}; } } set_action{s;d;i;p;c;v}: { case (p) { `Open; Open{c}; `Close; Close{c}; `Order; Order{c}; `Sort; Sort{c}; } } aplus-fsf-4.22/src/scripts/tss.doc0000444000265000001440000000433007426305564012605 tss === 0. Description. TSS is a sort-and-select browser for T tables. 1. Operation. Bring up TSS in a context. When a directory is specified (_DIR'xyz'), either programmatically, or in response to the "Open" action, several steps occur: 1. The T context specified by _SOURCE is closed. 2. An attempt is made to t.open{} the directory _DIR into the context _SOURCE. 3. If successful, a view of _SOURCE is generated in the context _TARGET. 4. t.table{} is applied to _TARGET. 5. _TABLE_TARGET`_T_; i.e., the table is shown in TSS. Field selection ("projection") is made via an SST gadget. Field sorting is also done through SST, with _SORT1. nnn Views in _TARGET can be "fixed" through the _FIX toggle. Selections can be made against the table in _TARGET by entering selection criteria into the _CMD scalar. Permitted forms have the following structure: a monadic keyword followed by an expression a keyword an expression blank Monadic eywords are: only, also, not Niladic keywords are: all A keyword alone is equivalent to the corresponding T function with a null right argument. E.g., only _TARGET t.only () all An expression alone is equivalent to t.only{} applied to that expression. E.g., a>10 _TARGET t.only 'a>10' A blank is a no-op. Summary: Open: t.open{} from the specified directory. Close: t.close{} the open table. Order: Select and order fields to view. Sort: Sort up and down on selected fields. Fix: Toggle t.fix{} on open table. Command: Permitted forms: only also not only also not all 2. zdefine cx cx = target context of TSS tool. z = `cx._TSS Define TSS in the specified context. 3. Variables _DIR T directory, or () _SOURCE Context of source table _TARGET Context of target table _DO 0_ACTION _ACTION Actions _MSG Message scalar _CMD Command scalar _FIX Fix selection toggle _TABLE Layout _TSS Outer layout 4. Restrictions TSS controls: 5. Example $load s $load t $load tss show tss.define ` define in root aplus-fsf-4.22/src/scripts/vim.+0000644000265000001440000000432410772770475012166 Copyright (c) 1990-2008 Morgan Stanley All rights reserved. See .../src/LICENSE for terms of distribution. $cx vim blanks{x}:+/@1^\@1 x=' ' set_action{s;d;i;p;c;v}:if (`sym=p) d{c} up{c}: { n0/mblanks{c%`_VIEW}; if (n0) reset{c;1;n;m}; } max{c}: { n0/mblanks{c%`_VIEW}; if (n0) reset{c;0;n;m}; } set{c}: { (c,`_VIEW) .has (`freeze;1); (c%`_VIEW)(0=blanks{c%`_MATRIX})/c%`_MATRIX; (c,`_VIEW) .has (`firstrow;0;`row;0;`freeze;0); } reset{c;p;n;m}: { (c,`_VIEW) .has (`freeze;1); (fr;r)0ӡ`firstrow `row .of c,`_VIEW; lbif (0=#c%`_VIEW) 0 else blanks{r#c%`_VIEW}; if (p=1) lblb-lb=n else if (p=0) lb0; op1++/lb=(1+r)m; boolcase (p) { Inf; (#c%`_N)1; 0; 0=c%`_N; (n+p)c%`_N }; (c%`_VIEW)bool/c%`_MATRIX; nfr0nr-r-fr nrop#(lb=blanks{c%`_VIEW})/#c%`_VIEW; (c,`_VIEW) .has (`firstrow;nfr;`row;nr;`freeze;0); (c%`_BOOL)bool; } fg{s;d;i;p;c;v}:((#c%`_COLORS)|n)#c%`_COLORS nblanks{d} set_matrix{s;d;i;p;c;v}:zero{c} preset_matrix{s;d;i;p;c;v}:if (~i()) d else (~^/@1 d=' ')/d preset_colors{s;d;i;p;c;v}: { if (~i()) d else if (d()) s.shade{10;`cyan `magenta},1s.shade{10;`magenta `yellow} else if ((`sym=d)^1#d) ,d else if ((`char=d)^2#d) 1!d else d } file{c}:s.write{c%`_FILE;c%`_MATRIX} define{cx}: { WSs.autows{()}; (cx%`_FILE)'/tmp/vim.txt'; (cx%`_MATRIX)0 0''; cx'_N:+/@1^\@1 _MATRIX=" "'; (cx`_MATRIX) _spcb (preset_matrix;); (cx`_MATRIX) _scb (set_matrix;); cx'_BOOL:_N=0'; (cx`_COLORS) _spcb (preset_colors;); (cx%`_COLORS)(); (cx%`_VIEW)0 0''; (cx%`_ACTION)(`zero `max `up `down `file;<@0(zero;max;up;down;file)); (cx%`_VIM)(`_ACTION;`_VIEW); (cx,`_VIEW) .is `view; (cx,`_ACTION) .is `action; (cx,`_VIM) .is `layout; (cx,`_VIEW) .has (`title;'';`rows;10;`cols;50;`fg;fg;`rowbg;`grey40;`bg;`black); (cx,`_ACTION) .has (`title;'';`label;('Level=0';'Level=';'Level+1';'Level-1';'File');`acceptfocus;0;`geometry;`horizontal;`set;set_action); (cx,`_VIM) .has (`title;''); s.autows{WS}; cx`_VIM } aplus-fsf-4.22/src/scripts/vim.doc0000444000265000001440000000130207426305566012565 vim === 0. Description. Interactive function execution trace. 1. Operation. 2. zdefine cx cx = target context of VIM tool. z = `cx._VIM 3. Variables _PRINT "/tmp/vim.txt" _BOOLEAN: level boolean _N: levels _COLORS level-based color array; _MATRIX indendented matrix _VIEW view of _MATRIX _ACTION Level=0 Level= Level+1 Level-1 _VIM outer layout 4. Restrictions _MATRIX must be a character matrix, levels represented by single character indentation. VIM controls `set and `preset callbacks on _MATRIX, `set callback on _COLORS, and `set callback on _ACTION. 5. Example $load s $load vim show vim.define `foo foo._MATRIX ... aplus-fsf-4.22/src/scripts/vlt.+0000644000265000001440000000473710772770475012210 Copyright (c) 1990-2008 Morgan Stanley All rights reserved. See .../src/LICENSE for terms of distribution. $cx vlt index{v}:w wb\b/w bw'0123456789' wv trigger{c}: (c%`_TRIGGER)1 next_focus{c}:if (1z z>(ck) _get<`vlt.toggle k,c%`_VL) (z1)#k title_button{c;v}:if (^/i<#t tc%`_T iindex{v}) >(ۡi)#t else '[',(1';',1աi),']' focus{c;v}:if (0<#v0`focus .of 0`shell .of c,v) if (v,c%`_VL v1#v) if (1(c,v) _get `vlt.toggle) v at{c;v;i;j;f}:if (0<#v vfocus{c;v}) color{c;v;a} (c,v) .has (`at;a;`raise;1) a[i]if (f=1 a0`at .of c,v) ja[i]-1 else a[i]+1 color{c;v;a}:(c,v) .has (`titlefg;n#`green `yellow) n1s.overlaps@1 1{a;b} b>(kv)/b (k;b)0`structure .of c,`_VL on_off{c}:(cc%`_VL) _get@0 `vlt.toggle ats{c}:>@0(2k)k k`at .of@0cc%`_VL toggle{s;c;v}: { f1(c,v) _get `vlt.toggle; (c,v) .has (`bg;f#`black`grey;`titlefg;f#`green`black); if (~f) (c,v) .has `focus else if (0<#w wnext_focus{c}) (c,w) .has `focus; (c,v) _set (`vlt.toggle;~f); trigger{c}; } construct{c;n}: { z(); (in[0]) do (jn[1]) do { v('B'),'_',(1i),'_',1j; (c%v)<{toggle}; (c,v) .is `button; (c,v) .has (`title;title_button{c;v};`resize;'.hw';`bg;`grey;`titlefg;`black); (c,v) _set (`vlt.toggle;0); z[,]v; }; trigger{c}; nz } set_action{s;d;i;p;c;v}: { case (p) { `left; left{s;d;i;p;c;v}; `right; right{s;d;i;p;c;v}; `up; up{s;d;i;p;c;v}; `down; down{s;d;i;p;c;v}; `hpos; hpos{s;d;i;p;c;v}; `hmin; hmin{s;d;i;p;c;v}; `vpos; vpos{s;d;i;p;c;v}; `vmin; vmin{s;d;i;p;c;v}; }; trigger{c}; } left{s;d;i;p;c;v}:at{c;v;1;0;1} right{s;d;i;p;c;v}:at{c;v;1;0;1} up{s;d;i;p;c;v}:at{c;v;0;0;1} down{s;d;i;p;c;v}:at{c;v;0;0;1} vpos{s;d;i;p;c;v}:at{c;v;2;1;1} vmin{s;d;i;p;c;v}:at{c;v;2;1;1} hpos{s;d;i;p;c;v}:at{c;v;3;1;1} hmin{s;d;i;p;c;v}:at{c;v;3;1;1} define{cx}: { WSs.autows{()}; (cx%`_TRIGGER)0; (cx%`_N)0 0; (cx%`_T)0 0(); (cx%`_VL)(); cx'_VL:vlt.construct{`',(cx),';_N}'; (cx%`_A)(`left `right `up `down `hpos `hmin `vpos `vmin;8<()); (cx%`_VLT)`_A `_VL; cx'_AT:vlt.ats{`',(cx),'} _TRIGGER'; cx'_Z:vlt.on_off{`',(cx),'} _TRIGGER'; (cx,`_VL) .is `layout; (cx,`_A) .is `action; (cx,`_VLT) .is `layout; (cx,`_A) .has (`set;set_action;`geometry;4;`C;1;`title;'';`label;¡('<<';'>>';'';'';'+H';'-H';'+V';'-V');`acceptfocus;0); (cx,`_VL) .has (`C;1;`R;1;`title;'';`newshow;1;`locksize;1;`reparent;0); (cx,`_VLT) .has (`title;''); s.autows{WS}; cx`_VLT } aplus-fsf-4.22/src/scripts/vlt.doc0000444000265000001440000000211407426305570012574 vlt === 0. Description. The vlt gadget is used to specify interactively a layout of objects with position and span. 1. Operation. Set _N to determine virtual row-column space of layout. Buttons are implicitly toggles: click between "on" and "off" states. Direction buttons (top row) move object with focus. Span buttons (second row) expand and contract object with focus. _T[i;j] is a symbol or character-array title of object i,j _Z[i;j] is 0 (if object i,j is in the "off" state) or 1 (if on). _AT[i;j;] is the row, col, vspan, hspan of object i,j 2. zdefine cx cx = target context of virtual layout tool z = `cx._VLT Define a vlt-gadget in the specified context. 3. Variables _TRIGGER 0 _N rows columns _T rows columns `titles or "titles" _VL: rows columns `buttons (internally managed) _A action box _VLT outer layout _AT: ((_VL),4) row col vspan hspan _Z: (_VL) 0/1 4. Restrictions _N may be assigned _T may be assigned 5. Example $load s $load vlt bvlt.define `foo foo._N2 3 show b aplus-fsf-4.22/src/scripts/xyz.+0000644000265000001440000000410610772771354012220 Copyright (c) 1990-2008 Morgan Stanley All rights reserved. See .../src/LICENSE for terms of distribution. $cx xyz if( ()scriptsDirsys.readenv{"SCRIPTS_DIR"} ) { scriptsDir"/usr/local/aplus-fsf-4.22/scripts"; } _load{scriptsDir,"/box"} type{fs}: { if (`box=ty%0#fs) `box; (i1+#fs) do if (ty%(i+1)#fs) `box; ty } title{c;v}:if (0<#z0`title .of v) ,z else if (c=a (a;b)v) b else v out{v;x}:if (0<#z0(`out;x) .of v) ,z else box.out{x} comb{x;s}:z (i#x z() k/s) do z[,](/>#x)١x pre_go{s;d;i;p;c;v}:if (d1) d else `type go{s;d;i;p;c;v}: { if (d1) { cxc%`_CX; yy,if (0#(yy;xx;ys;xs;zs)) (); y%ys; x%xs; tytype{zs}; sz#zs; sy#yy; sx#xx; s>(#yy),#xx; (c%`_I)t.link_index{y,x;comb{yy,xx;s}}; m(sz,(/sys),/sys)if (ty=`box) <() else tyt.NA; (isz) do { if ((`boxktyk)^ty=`box kt.index{c%`_I;i#zs}) ((k1١ҡxt;`collabelrows;#0xt); } } define{cx}: { WSs.autows{()}; _scb{cx`_GO;(;)}; _spcb{cx`_GO;(;)}; (cx%`_GO)0; _scb{cx`_GO;(go;)}; _spcb{cx`_GO;(pre_go;)}; (cx%`_YY)(); (cx%`_XX)(); (cx%`_Y)(); (cx%`_X)(); (cx%`_Z)(); (cx%`_CX)(); (cx%`_I)0; (cx%`_M)0 0(); (cx%`_XYZ)`_M; (cx,`_M) .is `matrix; (cx,`_XYZ) .is `layout; (cx,`_M) .has (`title;'';`blank;''); (cx,`_XYZ) .has (`title;''); s.autows{WS}; cx`_XYZ } aplus-fsf-4.22/src/scripts/xyz.doc0000444000265000001440000000277407426305572012637 xyz === 0. Description. XYZ is a gadget for displaying detail items of a dense (table) representation in sparse (matrix) form. 1. Operation. E.g., $load s $load t $load xyz $cx p a1 2 2 0 0 b4 0 1 2 1 c0 0 0 1 1 d1 0 0 1 0 e#a f10#a g100#a $cx . `p t.open () open table in p xyz.define ` define gadget in root _CX`p context of table Conceptual ab table: _YY0 1 2 Y-axis (row) order _XX0 1 2 3 4 X-axis (col) order _Y`a Y-axis (row) field _X`b X-axis (col) field _Z`e`f Z-axis fields _GO1 re-evaluate show `._XYZ display _XYZ _Z`f`g`e redefine z-axis _GO1 trigger p.ep.e mix datatypes _GO1 trigger Conceptual (a c)(b d) table: _YY(0 1 2;0 1) Y-axis (row) orders _XX(0 1 2 3 4;0 1) X-axis (col) orders _Y`a`c Y-axis (row) fields _X`b`d X-axis (col) fields _Z`e`f Z-axis fields _GO1 re-evaluate 2. zdefine cx cx = target context of XYZ gadget z = `cx._XYZ Define an XYZ-gadget in the specified context. 3. Variables _GO 1 (evaluation trigger) _YY Y-axis orders _XX X-axis orders _Y Y-axis fields _X X-axis fields _Z Z-axis fields _CX context of table _I permutation vector _M matrix (simple or nested) _XYZ outer layout 4. Restrictions Each of _YY, _XX, _Y, _X, _Z must be non-null. XYZ uses the set- and preset-callbacks attached to _GO. aplus-fsf-4.22/src/scripts/zgl.+0000644000265000001440000000417410772770475012172 Copyright (c) 1990-2008 Morgan Stanley All rights reserved. See .../src/LICENSE for terms of distribution. $cx zgl set_geometry{s;d;i;p;c;v}: { (c,`_OBJECTS) .has (`freeze;1); p,c%`_OBJECTS; (ic%`_ROWS) do (jc%`_COLS) do if (0<#p) p1p p[0] .has (`at;i,j,1 1); (c,`_OBJECTS) .has (`freeze;0); } flip{s;c;v}: { (c%`_ZOOMED)z#o z(#o)|s+n noc%`_ZOOMED o,cc%`_OBJECTS; (c%`_ZOOMED) .has `raise; } set_zoom{s;d;i;p;c;v}: { case (`Zoomc%v) { 0; { (c,`_ROWS) .has (`protect;0); (c,`_COLS) .has (`protect;0); (c,`_FLIPF) .has (`protect;1); (c,`_FLIPB) .has (`protect;1); (c%`_ROWS)c%`_ROWS; (c%`_ZOOMED)(); }; 1; { (c,`_ROWS) .has (`protect;1); (c,`_COLS) .has (`protect;1); (c,`_FLIPF) .has (`protect;0); (c,`_FLIPB) .has (`protect;0); if (0<#o o,cc%`_OBJECTS) { (c,`_OBJECTS) .has (`freeze;1); o .has<(`at;0 0 1 1); fc0`focus .of c,`_OBJECTS; (c%`_ZOOMED)if (0=#fc) c0#o else if (fcco) fc else c0#o; (c%`_ZOOMED) .has `raise; (c,`_OBJECTS) .has (`freeze;0); } } } } define{cx}: { WSs.autows{()}; (cx%`_ZOOM)(,`Zoom;,<0); (cx%`_ZOOMED)(); (cx%`_FLIPF)(flip;1); (cx%`_FLIPB)(flip;1); (cx%`_ROWS)1; (cx%`_COLS)1; cx'_ROWS:1(#_OBJECTS)_COLS'; cx'_COLS:1(#_OBJECTS)_ROWS'; (cx%`_OBJECTS)(); (cx%`_ROWS_COLS)<`_ROWS `_COLS; (cx%`_ZGL)(`_ZOOM `_ROWS_COLS;`_OBJECTS;`_FLIPF `_FLIPB); (cx,`_ZOOM) .is `check; (cx,`_FLIPF) .is `button; (cx,`_FLIPB) .is `button; (cx,`_ROWS) .is `scalar; (cx,`_COLS) .is `scalar; (cx,`_OBJECTS) .is `layout; (cx,`_ROWS_COLS) .is `layout; (cx,`_ZGL) .is `layout; (cx,`_ZOOM) .has (`title;'';`acceptfocus;0;`set;set_zoom;`resize;'Wl'); (cx,`_FLIPF) .has (`title;'Flip +';`acceptfocus;0;`protect;1); (cx,`_FLIPB) .has (`title;'Flip -';`acceptfocus;0;`protect;1); (cx,`_ROWS_COLS) .has (`title;'';`resize;'Wr'); (cx,`_ROWS) .has (`title;'Rows';`space;5;`set;set_geometry); (cx,`_COLS) .has (`title;'Cols';`space;5;`set;set_geometry); (cx,`_OBJECTS) .has (`newshow;1;`locksize;1;`title;'';`reparent;0); (cx,`_ZGL) .has (`title;'';`C;1); s.autows{WS}; cx`_ZGL } aplus-fsf-4.22/src/scripts/zgl.doc0000444000265000001440000000302007426305574012564 zgl === 0. Description. The zgl gadget is a standard "zoom and geometry" layout. 1. Operation. _OBJECTS is a layout of objects bound to any display classes. If 0 = `Zoom_ZOOM, then the objects are displayed in _OBJECTS in the pattern described by _ROWS, _COLS. E.g., if there are 12 objects in _OBJECTS, then if _ROWS = 3 and _COLS = 4, then the objects are displayed in a 34 pattern. If 1 = `Zoom_ZOOM, then all objects in _OBJECTS are located at 0 0 with span of 1 1, and the object in _OBJECTS which has focus (or the first object, if none has focus) is raised. _FLIPF and _FLIPB are buttons which successively raise objects in the set. 2. zdefine cx cx = target context of zoom-geometry layout z = `cx._ZGL Define a zgl-gadget in the specified context. 3. Variables _ZOOM Single element check box _FLIPF Flip forward button _FLIPB Flip backward button _ROWS: Rows in layout of objects _COLS: Cols in layout of objects _ROWS_COLS Layout of _ROWS and _COLS _OBJECTS Layout of objects _ZGL Outer layout _ZOOMED Object zoomed or () 4. Restrictions _ZOOM May be pick-assigned _FLIPF May not be assigned _FLIPB May not be assigned _ROWS_COLS May not be assigned _ROWS May be assigned _COLS May be assigned _OBJECTS May be assigned; _ZGL May be assigned _ZOOMED May not be assigned (read only) 5. Example $load s $load zgl $cx foo kzgl.define `foo abcdefgh2 3 _OBJECTS`a`b`c`d`e`f`g`h _ROWS3 (`Zoom_ZOOM)1 .show k aplus-fsf-4.22/src/lisp.1/0000777000265000001440000000000010774512700011002 5aplus-fsf-4.22/src/lisp.1/Makefile.am0000644000265000001440000000144207252255521012755 ## Process this file with automake to produce Makefile.in ############################################################################### ## ## ## Copyright (c) 2001 Morgan Stanley Dean Witter and Co. All rights reserved.## ## See .../src/LICENSE for terms of distribution. ## ## ## ## ## ############################################################################### lisp1dir = $(prefix)/lisp.1 lisp1_DATA = \ .emacs \ a.el \ a-font.el \ aplus.el \ keyb.el \ xa.el EXTRA_DIST = \ .emacs \ a.el \ a-font.el \ aplus.el \ keyb.el \ xa.el aplus-fsf-4.22/src/lisp.1/Makefile.in0000644000265000001440000001517110774512524012774 # Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ ############################################################################### ############################################################################### SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CXX = @CXX@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ STRIP = @STRIP@ VERSION = @VERSION@ X_INCLUDES = @X_INCLUDES@ X_LIBS = @X_LIBS@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ lisp1dir = $(prefix)/lisp.1 lisp1_DATA = \ .emacs \ a.el \ a-font.el \ aplus.el \ keyb.el \ xa.el EXTRA_DIST = \ .emacs \ a.el \ a-font.el \ aplus.el \ keyb.el \ xa.el subdir = src/lisp.1 mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_CLEAN_FILES = DIST_SOURCES = DATA = $(lisp1_DATA) DIST_COMMON = Makefile.am Makefile.in all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/lisp.1/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: lisp1DATA_INSTALL = $(INSTALL_DATA) install-lisp1DATA: $(lisp1_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(lisp1dir) @list='$(lisp1_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(lisp1DATA_INSTALL) $$d$$p $(DESTDIR)$(lisp1dir)/$$f"; \ $(lisp1DATA_INSTALL) $$d$$p $(DESTDIR)$(lisp1dir)/$$f; \ done uninstall-lisp1DATA: @$(NORMAL_UNINSTALL) @list='$(lisp1_DATA)'; for p in $$list; do \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " rm -f $(DESTDIR)$(lisp1dir)/$$f"; \ rm -f $(DESTDIR)$(lisp1dir)/$$f; \ done tags: TAGS TAGS: DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = ../.. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: $(mkinstalldirs) $(DESTDIR)$(lisp1dir) 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_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_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-generic clean-libtool mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-lisp1DATA install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool uninstall-am: uninstall-info-am uninstall-lisp1DATA .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-lisp1DATA install-man install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool uninstall uninstall-am uninstall-info-am \ uninstall-lisp1DATA # 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: aplus-fsf-4.22/src/lisp.1/.emacs0000444000265000001440000000017107252254402012003 (load "/usr/local/aplus-fsf-4.18/lisp_new/aplus") ;(load "/ms/dev/aplus/aplus/fsf/src/aplus-fsf-4.18/src/lisp.1/aplus") aplus-fsf-4.22/src/lisp.1/a.el0000444000265000001440000012047507252244410011464 ;;; a.el -- A+ major mode and utilities. ;; Copyright (C) 1998,1999,2001 Colin Rafferty ;; Author: Colin Rafferty ;; Keywords: ;; 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. ;; A copy of the GNU General Public License can be obtained from this ;; program's author (send electronic mail to colin@xemacs.org) or from ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. ;; Send bug reports to colin@xemacs.org ;;; Code: (defvar a+-font "kaplscreen-bold" "Font used in A+ mode.") ; (defvar apr-command "/usr/local/bin/apr" "Command to print A+ code") ; (defvar apr-command "/ms/dist/aurora/bin/apr" "Command to print A+ code") (defvar old-lpr-command lpr-command) ; (defvar apr-switches (list "-2r") "Switches for apr-command") (defvar old-lpr-switches lpr-switches) (defvar a-minor nil "*t if in A minor mode") (make-variable-buffer-local 'a-minor) (setq-default a-minor nil) (defvar a-alt-parents nil "Keymap parents for A minor mode toggle") (make-variable-buffer-local 'a-alt-parents) (setq-default a-alt-parents nil) (defvar a-alt-popup nil "Popup menu for A minor mode toggle") (make-variable-buffer-local 'a-alt-popup) (setq-default a-alt-popup nil) (defvar a-mode-syntax-table nil "Syntax table in use in a-minor mode.") (defvar a-mode-saved-syntax-table nil "Saved syntax table for toggling back.") (make-variable-buffer-local 'a-mode-saved-syntax-table) (defun set-a-comment-parms () "Assigns a+ comment parameters" (setq comment-multi-line nil) (setq comment-start (char-to-string ?\343)) (setq comment-end "") (setq comment-column 1) (setq comment-start-skip "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\)+ *") (setq parse-sexp-ignore-comments t) ) (defun unset-a-comment-parms () "Undo assignation of a+ comment parameters" (setq comment-multi-line nil) (setq comment-start (char-to-string ?\343)) (setq comment-end "") (setq comment-column 1) (setq comment-start-skip "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\)+ *") (setq parse-sexp-ignore-comments t) ) (if a-mode-syntax-table () (setq a-mode-syntax-table (make-syntax-table (standard-syntax-table))) (modify-syntax-entry ?\n ">" a-mode-syntax-table) ; \n is end of comment (modify-syntax-entry ?\\ "." a-mode-syntax-table) ; \ is punctuation (modify-syntax-entry ?_ "w" a-mode-syntax-table) ; _ is word constituent (modify-syntax-entry ?' "\"" a-mode-syntax-table) ; ' is string quote (modify-syntax-entry ?\; "." a-mode-syntax-table) (modify-syntax-entry ?# "." a-mode-syntax-table) (modify-syntax-entry ?, "." a-mode-syntax-table) (modify-syntax-entry ?@ "w" a-mode-syntax-table) (modify-syntax-entry ?. "_" a-mode-syntax-table) (modify-syntax-entry ?\241 "." a-mode-syntax-table) ; dieresis (each) (modify-syntax-entry ?\242 "_" a-mode-syntax-table) ; overbar (modify-syntax-entry ?\244 "." a-mode-syntax-table) ; less than or equal (modify-syntax-entry ?\246 "." a-mode-syntax-table) ; greater than or equal (modify-syntax-entry ?\250 "." a-mode-syntax-table) ; not equal (modify-syntax-entry ?\251 "." a-mode-syntax-table) ; down caret (modify-syntax-entry ?\253 "." a-mode-syntax-table) ; times (modify-syntax-entry ?\255 "." a-mode-syntax-table) ; domino (modify-syntax-entry ?\256 "." a-mode-syntax-table) ; dotted del (modify-syntax-entry ?\257 "." a-mode-syntax-table) ; slash bar (modify-syntax-entry ?\271 "." a-mode-syntax-table) ; nor (modify-syntax-entry ?\273 "." a-mode-syntax-table) ; quad jot (modify-syntax-entry ?\274 "." a-mode-syntax-table) ; quad backslash (modify-syntax-entry ?\275 "." a-mode-syntax-table) ; equal underbar (modify-syntax-entry ?\276 "." a-mode-syntax-table) ; squad (modify-syntax-entry ?\301 "." a-mode-syntax-table) ; alpha (modify-syntax-entry ?\302 "." a-mode-syntax-table) ; base (modify-syntax-entry ?\303 "." a-mode-syntax-table) ; cap (modify-syntax-entry ?\304 "." a-mode-syntax-table) ; down stile (modify-syntax-entry ?\305 "." a-mode-syntax-table) ; epsilon (modify-syntax-entry ?\307 "." a-mode-syntax-table) ; del (modify-syntax-entry ?\310 "." a-mode-syntax-table) ; delta (modify-syntax-entry ?\311 "." a-mode-syntax-table) ; iota (modify-syntax-entry ?\312 "." a-mode-syntax-table) ; jot (modify-syntax-entry ?\314 "." a-mode-syntax-table) ; quad (modify-syntax-entry ?\316 "." a-mode-syntax-table) ; top (modify-syntax-entry ?\317 "." a-mode-syntax-table) ; circle (modify-syntax-entry ?\322 "." a-mode-syntax-table) ; rho (modify-syntax-entry ?\323 "." a-mode-syntax-table) ; up stile (modify-syntax-entry ?\325 "." a-mode-syntax-table) ; del stile (modify-syntax-entry ?\326 "." a-mode-syntax-table) ; cup (modify-syntax-entry ?\327 "." a-mode-syntax-table) ; omega (modify-syntax-entry ?\330 "." a-mode-syntax-table) ; right shoe (modify-syntax-entry ?\331 "." a-mode-syntax-table) ; take (modify-syntax-entry ?\332 "." a-mode-syntax-table) ; left shoe (modify-syntax-entry ?\333 "." a-mode-syntax-table) ; right (modify-syntax-entry ?\334 "." a-mode-syntax-table) ; backslash bar (modify-syntax-entry ?\335 "." a-mode-syntax-table) ; left (modify-syntax-entry ?\337 "." a-mode-syntax-table) ; divide (modify-syntax-entry ?\340 "." a-mode-syntax-table) ; I-beam (modify-syntax-entry ?\341 "." a-mode-syntax-table) ; circle bar (modify-syntax-entry ?\342 "." a-mode-syntax-table) ; execute (modify-syntax-entry ?\343 "<" a-mode-syntax-table) ; lamp comment (modify-syntax-entry ?\345 "." a-mode-syntax-table) ; epsilon underbar (modify-syntax-entry ?\346 "." a-mode-syntax-table) ; del tilde (modify-syntax-entry ?\347 "." a-mode-syntax-table) ; del stile (modify-syntax-entry ?\350 "." a-mode-syntax-table) ; delta stile (modify-syntax-entry ?\351 "." a-mode-syntax-table) ; iota underbar (modify-syntax-entry ?\354 "." a-mode-syntax-table) ; quote quad (modify-syntax-entry ?\356 "." a-mode-syntax-table) ; format (modify-syntax-entry ?\364 "." a-mode-syntax-table) ; flip (modify-syntax-entry ?\367 "." a-mode-syntax-table) ; rotate (modify-syntax-entry ?\373 "." a-mode-syntax-table) ; left arrow (modify-syntax-entry ?\374 "." a-mode-syntax-table) ; delta underbar (modify-syntax-entry ?\375 "." a-mode-syntax-table) ; right arrow (modify-syntax-entry ?\376 "." a-mode-syntax-table) ; diamond ) (defvar narrowed nil "Flagged of whether narrowed") (make-variable-buffer-local 'narrowed) (setq-default narrowed nil) (setq global-popup-menu '("A+ menu" ["Toggle A+ Keyboard" toggle-a-minor-mode t] ["Start A+/Goto A+ Buffer" a t] ["Print Region" lpr-region (mark)] ["Comment Region" comment-region (mark)] ["Uncomment Region" (comment-region (region-beginning) (region-end) -1) (mark)] ["Narrow-to-Region" (progn (setq narrowed t) (narrow-to-region (region-beginning) (region-end))) (mark)] ["Widen" (progn (setq narrowed nil) (widen)) narrowed] )) (defvar a-minor-popup-menu nil "Popup menu for a-minor mode.") (setq a-minor-popup-menu '("A+ Utils" "---" ["Send Line to A+" a-send-line t] ["Send Region to A+" a-send-region (mark)] ["Send Buffer to A+" a-send-buffer t] ["Send Function to A+" a-send-func t] )) (defvar a-menubar nil "A+ menubar entry.") (setq a-menubar (nconc '("A+" ["Toggle A+ Keyboard" toggle-a-minor-mode t] ["Start A+/Goto A+ Buffer" a t] ["Print Region" lpr-region (mark)] ["Comment Region" comment-region (mark)] ["Uncomment Region" (comment-region (region-beginning) (region-end) -1) (mark)] ["Narrow-to-Region" (progn (setq narrowed t) (narrow-to-region (region-beginning) (region-end))) (mark)] ["Widen" (progn (setq narrowed nil) (widen)) narrowed] ) (cdr a-minor-popup-menu)) ) (add-submenu nil a-menubar) (setq a-options-menubar (nconc '("A+Options" ["A+ Program..." (setq a-prog (read-file-name "Executable for A+ Program: " "" a-prog t a-prog)) t] ["Workspace Size..." (progn (setq a-mbytes (read-number "Enter initial workspace size in megabytes: ")) (if (lt a-mbytes 4) (setq a-mbytes 4))) t] ["Size Threshold..." (progn (setq a-mbytes-threshold (read-number "Enter incremental workspace size in megabytes: ")) (if (lt a-mbytes 16) (setq a-mbytes 16))) t] ["Log File..." (setq a-log (read-file-name "Log File for A+ Session: " "" a-log nil a-log)) t] ["Temp dir..." (setq a-tmp-dir (read-string "Temp dir for A+ xemacs operations: " a-tmp-dir )) t] ["A+ Buffer..." (setq a-buffer-name (read-string "A+ Buffer Name: " a-buffer-name)) t] ; ["apr Program..." ; (setq apr-command (read-file-name "Executable for printing A+: " "" apr-command t apr-command)) t] ; ["apr Switches..." (setq apr-switches ; (list (read-string "Switches to pass to apr program: " (car apr-switches)))) t] ["Font..." (setq a+-font (read-string "Font for A+: " "kaplscreen-bold")) t] "----" ["Host..." (setq a-host (read-string "Host on which to run A+: " a-host)) t] ["Init String..." (setq a-init-string (read-string "Init string: " a-init-string)) t] ["Load Prefix..." (setq a-load-prefix (read-string "Load prefix: " a-load-prefix)) t] ["Load Comment..." (setq a-load-comment (read-string "Load comment: " a-load-comment)) t] ["Load Sequence..." (setq a-load-sequence (read-string "Load sequence: " a-load-sequence)) t] ["Prompt Pattern..." (setq a-prompt-pattern (read-string "Prompt pattern: " a-prompt-pattern)) t] ["Quiet" (setq a-quiet (not a-quiet)) :style toggle :selected a-quiet] ["Invocation..." (setq a-invocation (read-number "A+ Invocation: " a-invocation)) t] "----" ["A+ Options File..." (setq save-a-options-file (read-file-name "Log File for A+ Session: " "" "~/.custom/a-options.el" nil save-a-options-file)) t] ["Save A+ Options" save-a-options-menu-settings t] ) ) ) (add-submenu nil a-options-menubar) ;;; The A+ Options menu (defconst a-options-menu-saved-forms ;; This is really quite a kludge, but it gets the job done. (purecopy '(a-prog ; #### - does this WORK??? a-mbytes a-mbytes-threshold a-log a-tmp-dir a-buffer-name ; apr-command ; apr-switches a+-font a-host a-init-string a-load-prefix a-load-comment a-load-sequence a-prompt-pattern a-quiet a-invocation )) "The variables to save; or forms to evaluate to get forms to write out.") (defvar save-a-options-file (concat "~" init-file-user "/.custom/a-options.el") "File to save options into.") (defun save-a-options-menu-settings () "Saves the current settings of the `A+Options' menu to your `a-options.el' file." (interactive) (let ((output-buffer (find-file-noselect (expand-file-name save-a-options-file))) output-marker) (save-excursion (set-buffer output-buffer) ;; ;; Find and delete the previously saved data, and position to write. ;; (goto-char (point-min)) (if (re-search-forward "^;; APLUS Options Menu Settings *\n" nil 'move) (let ((p (match-beginning 0))) (goto-char p) (or (re-search-forward "^;; End of APLUS Options Menu Settings *\\(\n\\|\\'\\)" nil t) (error "can't find END of saved state in a-options.el")) (delete-region p (match-end 0))) (goto-char (point-max)) (insert "\n")) (setq output-marker (point-marker)) ;; run with current-buffer unchanged so that variables are evaluated in ;; the current context, instead of in the context of the "a-options.el" buffer. (let ((print-readably t) (print-escape-newlines t) (standard-output output-marker)) (princ ";; APLUS Options Menu Settings\n") (princ ";; ============================\n") (princ "(cond\n") (princ " ((and (string-match \"XEmacs\" emacs-version)\n") (princ " (boundp 'emacs-major-version)\n") (princ " (>= emacs-major-version 19)\n") (princ " (>= emacs-minor-version 12))\n") (mapcar #'(lambda (var) (princ " ") (if (symbolp var) (prin1 (list 'setq var (let ((val (symbol-value var))) (if (or (memq val '(t nil)) (stringp val)) val (list 'quote val))))) (setq var (eval var)) (cond ((eq (car-safe var) 'progn) (while (setq var (cdr var)) (prin1 (car var)) (princ "\n") (if (cdr var) (princ " ")) )) (var (prin1 var)))) (if var (princ "\n"))) a-options-menu-saved-forms) (princ " ))\n") (princ ";; ==================================\n") (princ ";; End of APLUS Options Menu Settings\n") )) (set-marker output-marker nil) (save-excursion (set-buffer output-buffer) (save-buffer)) )) (defvar a-popup-menu nil "Popup menu for a-mode.") (setq a-popup-menu (nconc '("A+ Process Menu" ["Recall Last Input" a-recall-last-input t] ["Goto Last Input" a-goto-last-input t] "---" ["Interrupt A+" a-interrupt-process (get-buffer-process (current-buffer))] ["Quit A+" a-quit-process (get-buffer-process (current-buffer))] ["Kill A+" a-kill-process (get-buffer-process (current-buffer))] "---") a-minor-popup-menu)) (defvar a-mode-hook nil "*Hook called by a-mode.") (defun a-mode () "Starts a-mode" (interactive) (setq major-mode 'a-mode) (setq mode-name "A") (set-face-font 'default a+-font (current-buffer)) (auto-fill-mode -1) (use-local-map a-mode-map) (setq a-minor t) (set-syntax-table a-mode-syntax-table) (setq mode-popup-menu a-popup-menu) (set-a-comment-parms) ; (setq lpr-command apr-command) ; (setq lpr-switches apr-switches) (set-keymap-parents a-mode-map a-minor-map) (run-hooks 'a-mode-hook) (redraw-modeline) ) (defun toggle-a-minor-mode () "Toggles minor mode providing enhanced APL Union Keyboard." (interactive) (make-variable-buffer-local 'meta-prefix-char) (setq a-minor (not a-minor)) (if a-minor (progn (set-a-comment-parms) (setq a-alt-popup mode-popup-menu) (setq mode-popup-menu a-minor-popup-menu) (setq a-mode-saved-syntax-table (syntax-table)) (set-syntax-table a-mode-syntax-table) (setq old-lpr-command lpr-command) (setq old-lpr-switches lpr-switches) ; (setq lpr-command apr-command) ; (setq lpr-switches apr-switches) (setq meta-prefix-char -1) (set-face-font 'default a+-font (current-buffer)) (auto-fill-mode -1) (if (current-local-map) (progn (setq a-alt-parents (keymap-parents (current-local-map))) (set-keymap-parents (current-local-map) (cons a-minor-map a-alt-parents))) (use-local-map a-minor-map)) ) (progn (setq lpr-command old-lpr-command) (setq lpr-switches old-lpr-switches) (set-syntax-table a-mode-saved-syntax-table) (remove-face-property 'default 'font (current-buffer)) (setq meta-prefix-char 27) (if (equal a-minor-map (current-local-map)) (use-local-map nil) (progn (set-keymap-parents (current-local-map) a-alt-parents) (setq a-alt-parents nil) ) ))) (redraw-modeline) ) (defun a-minor-mode () "Turns on a-minor-mode minor mode providing enhanced APL Union Keyboard." (interactive) (if (not a-minor) (toggle-a-minor-mode)) ) (defun defarg (arg defval prompt) "arguments are ARG DEFVAL PROMPT: If ARG is non-null and is not equal to \"\" then ARG is returned. Otherwise prompt (with PROMPT) for a new value. If this new value is equal to \"\" then return DEFVAL." (if (and (or (null arg) (equal arg "")) (equal (setq arg (read-from-minibuffer (concat prompt "[" defval "]: "))) "")) defval arg)) (defvar a-prog "/usr/local/bin/a" "*Program to run for `a' command") (defvar a-log "~/.emacs_a" "*Log file for `a' sessions") (defvar a-tmp-dir "~" "Temp directory for A+ xemacs operations") (defvar a-init-string "$echo `date` on `hostname`\n" "*Sent to `a' on startup") (defvar a-mbytes 4 "*Default number of megabytes") (defvar a-mbytes-threshold 16 "*Max default size before prompting") (defvar a-prompt-pattern "^\\** *" "*Prompt for `a'") (defvar a-invocation 0 "Random Number of `a' invocation") (random t) (defvar a-load-sequence 0 "Sequence number used in name of temp file") (defvar a-load-prefix "$loadrm " "*Load prefix") (defvar a-load-comment "\343 Loading: " "*Load comment") (defvar a-quiet nil "*If true, shut up") (defvar a-host nil "*Host on which to run `a'") (defvar a-track-beginning-of-expression nil "*If non-nil, a-recall-last-input will leave the cursor at the beginning of the last input") (defvar a-buffer-name "*a*" "*Name of buffer in which to run the `a' process") (defvar a-plus nil "*t if A+ style command line") (defvar a-plus-without-s nil "*t if no s is desired") (defvar a-plus-rest nil "*remaining arguments to A+") (defvar a-startup-hook nil "Function to run after a-buffer initialization") (defvar a-first-output-hook nil "Function to run after first a output") (defun standard-a() (interactive) (setq a-prog "/usr/local/bin/z") (setq a-log "~/.emacs_a") (setq a-tmp-dir "~") (setq a-init-string "$echo `date` on `hostname`\n") (setq a-mbytes 4) (setq a-mbytes-threshold 16) (setq a-prompt-pattern "^\\** *") (setq a-invocation 0) (random t) (setq a-load-sequence 0) (setq a-load-prefix "$load ") (setq a-load-comment "\343 Loading: ") (setq a-quiet nil) (setq a-host nil) (message "standard `a' defaults set")) (defun setup-a() (interactive) (setq a-prog (defarg nil a-prog "a-prog")) (setq a-mbytes (string-to-int (defarg nil (int-to-string a-mbytes) "a-mbytes"))) (setq a-init-string (defarg nil a-init-string "a-init-string")) (setq a-load-prefix (defarg nil a-load-prefix "a-load-prefix")) (setq a-load-comment (defarg nil a-load-comment "a-load-comment"))) (defvar a-no-output-yet nil) (defun a (&optional mbytes loadfile newbuf) "Interactively runs an `a' session." (interactive) (let* ((process-connection-type nil) (mbytes (or mbytes a-mbytes)) (loadfile (or loadfile (getenv "ALOADFILE") (if a-plus a-plus-rest))) aproc astat) (setq newbuf (or newbuf (null (get-buffer a-buffer-name)))) (if (and (interactive-p) a-host) (message (concat "Running `a' on " a-host "..."))) (switch-to-buffer a-buffer-name) (make-variable-buffer-local 'meta-prefix-char) (setq meta-prefix-char -1) (make-variable-buffer-local 'next-line-add-newlines) (setq next-line-add-newlines t) (set-face-font 'default a+-font (current-buffer)) (setq aproc (get-buffer-process (current-buffer))) (setq astat (if aproc (process-status aproc))) (if (or (null astat) (not (memq astat '(run stop)))) (progn (setq mbytes (if (<= mbytes a-mbytes-threshold) mbytes (string-to-int (defarg (and mbytes (int-to-string mbytes)) (int-to-string mbytes) "megabytes")))) (setq modeline-process '(": %s")) (a-mode) (make-local-variable 'last-input-start) (setq last-input-start (point-max-marker)) (make-local-variable 'last-input-end) (setq last-input-end (point-max-marker)) (cond ((and a-log (= (point-min) (point-max))) (and (file-exists-p a-log) (insert-file-contents a-log)) (setq buffer-file-name a-log))) (insert "Starting...\n") (setq a-invocation (random)) (setq a-no-output-yet t) (setq aproc (apply 'start-process "`a'" (current-buffer) (append (if (and a-host (not (equal a-host (system-name)))) (append (list "rsh" a-host) (define-DISPLAY) (var-defs "PRINTER" "PLOTTER" "PATH" "XAPPLRESDIR" "XENVIRONMENT" "XFILESEARCHPATH" "XUSERFILESEARCHPATH"))) (list a-prog) (if (and a-plus a-plus-without-s) (list "-s")) (if a-plus (list "-w")) (list (int-to-string mbytes)) (if (listp loadfile) loadfile (list loadfile))))) (set-marker (process-mark aproc) (point-max)) (set-process-filter aproc 'a-proc-filter) (goto-char (point-max)) (if newbuf (run-hooks 'a-startup-hook)))))) (defun define-DISPLAY () (let ((val (getenv "DISPLAY"))) (if val (set-shell-variable "DISPLAY" (if (or (equal "unix:" (substring (concat val " ") 0 5)) (equal ":" (substring (concat val " ") 0 1))) (concat (system-name) (substring val (string-match ":" val) nil)) val))))) (defun set-shell-variable (var value) (let ((shell (getenv "SHELL"))) (if (equal "/bin/csh" shell) (list (concat "setenv " var " " value " ; ")) (list (concat var "=" value))))) (defun var-defs (&rest arg) (let (result) (while arg (let* ((var (car arg)) (val (getenv var))) (if val (setq result (append result (set-shell-variable var val))))) (setq arg (cdr arg))) result)) (defun a-proc-filter (aproc output) "If point is at end of buffer, place output in buffer and move point to new end. Otherwise, just place output in buffer." (let ((initial a-no-output-yet)) (if a-no-output-yet (progn (setq a-no-output-yet nil) (process-send-string aproc a-init-string))) (let* ((cur-win (selected-window)) (aproc-buf (process-buffer aproc)) (aproc-wins (if (equal aproc-buf (current-buffer)) (list (cons cur-win (point-marker))))) aproc-buf-point) (while (not (equal cur-win (select-window (next-window (selected-window))))) (if (equal aproc-buf (current-buffer)) (setq aproc-wins (append aproc-wins (list (cons (selected-window) (point-marker))))))) (save-excursion (set-buffer aproc-buf) (setq aproc-buf-point (point-marker)) (goto-char (process-mark aproc)) (insert-before-markers output) (set-marker (process-mark aproc) (point)) (if initial (run-hooks 'a-first-output-hook)) (goto-char aproc-buf-point)) (mapcar '(lambda (glom) (set-window-point (car glom) (cdr glom))) aproc-wins)))) (defun a-other-window (&optional mbytes loadfile) "Starts `a' interpreter in other window" (interactive) (let ((newbuf (null (get-buffer a-buffer-name)))) (pop-to-buffer a-buffer-name) (a mbytes loadfile newbuf) (add-submenu nil a-menubar) (add-submenu nil a-options-menubar))) (defun a-adjacent-window (&optional mbytes loadfile) "Starts `a' interpreter in other window but stays in current window" (interactive) (let ((cbuf (current-buffer))) (a-other-window mbytes loadfile) (pop-to-buffer cbuf))) (defun a-interrupt-process()(interactive)(interrupt-process)) (defun a-quit-process()(interactive)(quit-process)) (defun a-kill-process () (interactive) (if a-host (quit-process) (kill-process))) (defun a-goto-last-input()(interactive)(goto-char last-input-start)) (defun a-recall-last-input () (interactive) (let ((here (point))) (insert (buffer-substring last-input-start last-input-end)) (if a-track-beginning-of-expression (goto-char here)))) (defvar last-input-start nil "Marker for start of last unit of input.") (defvar last-input-end nil "Marker for end of last unit of input.") (defun a-show-output () "Display start of this batch of output at top of window. Also put cursor there." (interactive) (goto-char last-input-end) (forward-char) (recenter 0)) (defun a-kill-output () "Kill all output since last input." (interactive) (kill-region last-input-end (point-max)) (goto-char (point-max)) (insert " output flushed \n")) (defun a-send-input () "Send input to `a' process. At end of buffer, sends all text after last output as input to the process, including a newline inserted at the end. When not at end, copies current line to the end of the buffer, after first attempting to discard any prompt at the beginning of the line by matching the regexp that is the value of a-prompt-pattern if possible. This regexp should start with \"^\"." (interactive) (let* ((proc (get-buffer-process (current-buffer))) (junk (or proc (error "Current buffer has no process"))) (cur (point)) (beg (progn (beginning-of-line) (re-search-forward a-prompt-pattern nil t) (point))) (end (progn (end-of-line) (point))) (max (point-max))) (if (eobp) (progn (move-marker last-input-start (process-mark proc)) (move-marker last-input-end (point)) (insert ?\n) (process-send-region proc beg (point)) (set-marker (process-mark proc) (point))) (goto-char (point-max)) (insert (buffer-substring beg end)) (goto-char (+ max (if (> cur beg) (- cur beg) 0)))))) (defun a-send-line() (interactive) (let* ((cur-win (selected-window)) (cur-buf (current-buffer)) (aproc-buf (get-buffer a-buffer-name)) (aproc (get-buffer-process aproc-buf)) (aproc-wins (if (equal aproc-buf (current-buffer)) (list (cons cur-win (point-marker))))) s) (while (not (equal cur-win (select-window (next-window (selected-window))))) (if (equal aproc-buf (current-buffer)) (setq aproc-wins (append aproc-wins (list (cons (selected-window) (point-marker))))))) (save-excursion (setq s (concat (buffer-substring (progn (beginning-of-line) (if (equal aproc-buf (current-buffer)) (re-search-forward a-prompt-pattern nil t)) (point)) (progn (end-of-line) (point))) "\n")) (a-other-window) (goto-char (point-max)) (insert-before-markers s) (process-send-string aproc s) (pop-to-buffer cur-buf)) (mapcar '(lambda (glom) (set-window-point (car glom) (cdr glom))) aproc-wins) (next-line 1))) (defun a-send-substr(start end describe) (let* ((cbuf (current-buffer)) (fname (expand-file-name (format "%s/#emacs_a%d.%d" a-tmp-dir a-invocation (setq a-load-sequence (1+ a-load-sequence))))) (cmd (concat a-load-prefix fname "\n")) (aproc)) (write-region start end fname nil 'nomessage) (a-other-window) (setq aproc (get-buffer-process (current-buffer))) (goto-char (point-max)) (or a-quiet (insert (concat a-load-comment describe "\n"))) (set-marker (process-mark aproc) (point)) (process-send-string aproc cmd) (pop-to-buffer cbuf))) ;;(defun a-send-func () ;; (interactive) ;; (let ((pos (point))) ;; (end-of-line) ;; (let ((depth (car (parse-partial-sexp (point-min) (point)))) ;; (parse-sexp-ignore-comments t) ;; (orig (point)) ;; after-colon ;; start) ;; (if (if (> depth 0) ;; (condition-case err ;; (up-list depth) ;; (error (progn ;; (goto-char orig) ;; (setq parse-sexp-ignore-comments nil) ;; (up-list (- depth)) ;; (push-mark pos) ;; 'error)))) ;; (error "Unbalanced parentheses start here (C-x C-x to go back)") ;; (end-of-line) ;; (re-search-backward "^[^\'\"]+:" nil 'move) ;; (setq after-colon (match-end 0)) ;; (backward-list (car (parse-partial-sexp (point-min) (point)))) ;; (beginning-of-line) ;; (setq start (point)) ;; (goto-char after-colon) ;; (if (eolp) (forward-char)) ;; (end-of-line) ;; (up-list (car (parse-partial-sexp after-colon (point)))) ;; (forward-line) ;; (a-send-substr ;; start ;; (point) ;; (buffer-substring start (1- after-colon))) ;; (goto-char pos))))) ;;;; a-send-func from ik (defun a-send-func () (interactive) (let ((pos (point))) (end-of-line) (let* ((expr (parse-partial-sexp (point-min) (point))) (depth (car expr)) (instring (nth 3 expr)) (parse-sexp-ignore-comments t) (orig (point)) after-colon start) (if instring (goto-char instring)) (if (if (> depth 0) (condition-case err (up-list depth) (error (progn (goto-char orig) (setq parse-sexp-ignore-comments t) (up-list (- depth)) (push-mark pos) 'error)))) (error "Unbalanced parentheses start here (C-x C-x to go back)") (end-of-line) (re-search-backward "^[^\'\"]+:" nil 'move) (setq after-colon (match-end 0)) (backward-list (car (parse-partial-sexp (point-min) (point)))) (beginning-of-line) (setq start (point)) (goto-char after-colon) (if (eolp) (forward-char)) (end-of-line) (up-list (car (parse-partial-sexp after-colon (point)))) (forward-line) (a-send-substr start (point) (buffer-substring start (1- after-colon))) (goto-char pos))))) ;;;; !! CURRENTLY BROKEN (a-send-func) !! ;;;; ==================================================================== ;;;; a-send-func.............................................070397 NRL ;;;; ==================================================================== ;;;; This defun will try to send A+ function def block to A+ interpreter ;;;; using Emacs Lisp parser. Inevitably, there is a difference between A+ ;;;; language syntax against Emacs Lisp s-expression syntax. ;;;; For example, there are two types of strings in A+; In double quoted ;;;; strings, the '\' is an escape char. But in single quoted strings, '\' ;;;; is not. This causes problem in Emacs char syntax definition because ;;;; only one syntax class for each char. ;;;; So, there is problem for Emacs Lisp parser to deal with the following ;;;; A+ single quoted string : ;;;; 'abc''cd\' ;;;; which is an error in Emacs Lisp s-expression parse. In this case, ;;;; I print out a message "Please double check your single quoted string." ;;;; But "abc\"cd" is ok as long as we define '\' with the escape syntax ;;;; clase "\\". ;;;; ============================================================================ ;;;; change the syntax class for "\\"; add the following line to syntax table ;;;; (modify-syntax-entry ?\\ "\\" a-mode-syntax-table) ;;;; ============================================================================ ;;(defun a-send-func () ;; (interactive) ;; (let ((pos (point)) ;; where ;; func-start ;; after-colon) ;; (debug) ;; (end-of-line) ; in case the cursor is before ':' ;; (setq where (point)) ;; (re-search-backward "^[^\'\"]+:" nil 'move) ; orginal ;; (re-search-backward "^[^\'\"]+:" nil 'move) ;; (setq func-start (point)) ;; (setq after-colon (match-end 0)) ;; (let* ((s1-state (parse-partial-sexp func-start where)) ;; (func-end (point)) ;; (parse-sexp-ignore-comments t) ;; (depth (car s1-state)) ; depth of parenthesis ;; (q-char (nth 3 s1-state)) ;if non-nil, the starting strng quote char ;; (orig (point)) ;; s2-state ;; ) ;; ;; check depth and move to the end of func def ;; (if (> depth 0) ; check if cursor in unbalanced parenthesis ;; (progn ; try to parse more to balance parenthesis ;; (setq s2-state (parse-partial-sexp (point) (point-max) (- depth) nil s1-state)) ;; (setq func-end (point)) ;; (setq q-char (nth 3 s2-state)) ;; (cond ((not (null q-char)) ;; (if (char-equal q-char ?\') ;; (message ;; "PLease double check your single quoted strings."))) ;; ((= 0 (car s2-state)) t) ;depth should be zero by now. ;; (t (progn ; otherwise error for unbalanced parenthesis ;; (goto-char (nth 1 s1-state)) ;; (push-mark pos) ;; (error "Unbalanced parentheses start here (C-x C-x to goback)")))) ;; )) ;; end of progn ;; end of if depth > 0 ;; (a-send-substr ;; func-start ;; func-end ;; (point) ;; (buffer-substring func-start (1- after-colon))) ;; (goto-char pos)))) (defun a-send-region () (interactive) (a-send-substr (region-beginning) (region-end) "region")) (defun a-send-buffer () (interactive) (a-send-substr (point-min) (point-max) (concat "buffer " (buffer-name)))) (defun change-assoc (key value alist) "usage: (change-assoc KEY VALUE ALIST) If ALIST contains KEY then replace the associated value with VALUE. Otherwise, associate KEY and VALUE in the alist" (let ((tuple (assoc key alist))) (cond (tuple (setcdr tuple value)) (t (nconc alist (list (cons key value))))))) ;; +++ a-mode seems better. Also, why .z and .+? (change-assoc "\\.apl$" 'a-mode auto-mode-alist) (change-assoc "\\.a$" 'a-mode auto-mode-alist) (change-assoc "\\.\\+$" 'a-mode auto-mode-alist) ; (change-assoc "\\.z$" 'a-mode auto-mode-alist) (defvar a-prog-default "a+") (defvar a-path-default "/usr/local/lib/aplus-") ;(cond ((string-equal (getenv "SYS_FIRIS") "FID") ; (defvar a-path-default "/usr/local/a+_") ; ) ; ((string-equal (getenv "SYS_FIRIS") "IS" ) ; (defvar a-path-default "/ms/dist/aplus/PROJ/aplus/") ; ) ;) (defun toggle-a-prog (arg) (interactive "P") (message (setq a-prog (if (equal a-prog new-a-prog) old-a-prog new-a-prog))) ) (defun set-a-prog-builtin () (interactive) (let ((arg (read-from-minibuffer (concat "Change a-prog to [" a-prog-default "]: ") nil nil nil))) (if (equal (length arg) 0) (setq arg a-prog-default)) (setq a-plus t) (message (concat "Setting a-prog to \"" (setq a-prog (cond ; a+_1a 1a ((string-match "^\\(a\\+_\\)?\\([0-9]+a\\)$" arg) (build-prog-name a-path-default "/bin/a+" arg 2)) ; a+_1b1 1b1 ((string-match "^\\(a\\+_\\)?\\([0-9]+b[0-9]+\\)$" arg) (build-prog-name a-path-default "/bin/a+" arg 2)) ; a+_1.01 1.01 ((string-match "^\\(a\\+_\\)?\\([0-9]+\\.[0-9]+\\)$" arg) (build-prog-name a-path-default "/bin/a+" arg 2)) ; a aX a_82 aX_82 a_latest aX_latest ((string-match "^a\\(X\\)?\\(_[0-9a-zA-Z]+\\)?$" arg) (progn (setq a-plus nil) (concat "/usr/local/bin/a" (if (match-beginning 1) "X") (if (match-beginning 2) (substring arg (match-beginning 2) (match-end 2)))))) ; a+_m1.maus m1.maus ((string-match "^\\(a\\+_\\)?m\\([0-9]+\\)\\.\\([a-z]+\\)$" arg) (build-prog-name "/u/src/usr/local/a+_" (concat "/" (substring arg (match-beginning 3) (match-end 3)) "/" (getenv "ID_EXEC") "/bin/a+") arg 2)) ; a+_m1 m1 ((string-match "^\\(a\\+_\\)?m\\([0-9]+\\)$" arg) (build-prog-name "/u/src/usr/local/a+_" (concat "/" (getenv "ID_EXEC") "/bin/a+") arg 2)) ; a+_dev.maus dev.maus ((string-match "^\\(a\\+_\\)?dev\\.\\([a-z]+\\)$" arg) (build-prog-name "/u/aplus/" (concat "/" (getenv "ID_EXEC") "/bin/a+") arg 2)) ; a+_dev dev ((string-match "^\\(a\\+_\\)?dev$" arg) (concat "/u/aplus/" (getenv "ID_EXEC") "/bin/a+")) ; a+ a+_1 ((string-match "^a\\+\\(_[0-9]+\\)?$" arg) (concat "/usr/local/a+" (if (match-beginning 1) (substring arg (match-beginning 1) (match-end 1))) "/bin/a+")) ; 1 ((string-match "^\\([0-9]+\\)$" arg) (concat a-path-default arg "/bin/a+")) ; ont ((string-match "^ont$" arg) "/usr/local/a+_ont/bin/a+") ; default ((string-match "^default$" arg) "/ms/dist/aplus/bin/a+") ; x.latest ((string-match "^\\([0-9]+.latest\\)$" arg) (concat a-path-default arg "/bin/a+")) ; anything else (t arg ))) "\"")))) (defun build-prog-name (before after arg match) (concat before (substring arg (match-beginning match) (match-end match)) after)) (defvar a-mode-string "A") (defvar a-mode-fix-my-modeline t "Fix my modeline so that I know I use A+.") (if a-mode-fix-my-modeline (progn (setq-default mode-line-modified '("-%*%*-")) (setq-default mode-line-format (list "" 'a-mode-string 'mode-line-modified 'mode-line-buffer-identification " " 'global-mode-string " %[(" 'mode-name 'minor-mode-alist "%n" 'modeline-process ")%]----" '(-3 . "%p") "-%-")))) ;;;========================================================================= ;; The isearch needs to be fixed, but this isn't it. -- Colin ;;; isearch fix for A+ ;(setq search-exit-option nil) ; "Non-nil means random control characters terminate incremental search." ;(define-key isearch-mode-map "\M-n" nil) ;(define-key isearch-mode-map "\M-p" nil) ;(define-key isearch-mode-map [(meta right)] 'isearch-ring-advance) ;(define-key isearch-mode-map [(meta left)] 'isearch-ring-retreat) ;(define-key minibuffer-local-isearch-map "\M-n" nil) ;(define-key minibuffer-local-isearch-map "\M-p" nil) ;(define-key minibuffer-local-isearch-map [(meta right)] 'isearch-ring-advance) ;(define-key minibuffer-local-isearch-map [(meta left)] 'isearch-ring-retreat) ;(defun a-isearch-printing-char () ; "Any other A+ printing character => add it to the search string and search." ; (interactive) ; (setq xev (copy-event last-command-event)) ; (setq key (event-to-character xev t t t)) ; (setq last-command-char (aref a-key-string key)) ; (isearch-process-search-char last-command-char)) ;(put 'a-isearch-printing-char 'isearch-command t) ;;; Redefinition for A+ ;(defun isearch-maybe-frob-keyboard-macros () ; ;; ; ;; If the command about to be executed is `self-insert-command' then change ; ;; the command to `isearch-printing-char' instead, meaning add the last- ; ;; typed character to the search string. ; ;; ; ;; If `this-command' is a string or a vector (that is, a keyboard macro) ; ;; and it contains only one command, which is bound to self-insert-command, ; ;; then do the same thing as for self-inserting commands: arrange for that ; ;; character to be added to the search string. If we didn't do this, then ; ;; typing a compose sequence (a la x-compose.el) would terminate the search ; ;; and insert the character, instead of searching for that character. ; ;; ; ;; We should continue doing this, since it's pretty much the behavior one ; ;; would expect, but it will stop being so necessary once key-translation- ; ;; map exists and is used by x-compose.el and things like it, since the ; ;; translation will have been done before we see the keys. ; ;; ; (cond ((eq this-command 'self-insert-command) ; (setq this-command 'isearch-printing-char)) ; ((eq this-command 'a-self-insert) ; (setq this-command 'a-isearch-printing-char)) ; ((and (or (stringp this-command) (vectorp this-command)) ; (eq (key-binding this-command) 'self-insert-command)) ; (setq last-command-event (character-to-event (aref this-command 0)) ; last-command-char (and (stringp this-command) (aref this-command 0)) ; this-command 'isearch-printing-char)) ; )) ;;;========================================================================= ;;; gdb fix for A+ (defvar a-mode-fix-gdb t "Fix GDB because I want to use A+.") (if a-mode-fix-gdb (progn (defun gdb-patch () "Redefines GDB mode keymap to remove conflicts with A+" (interactive) (define-key gdb-mode-map "\M-i" nil) (define-key gdb-mode-map "\M-s" nil) (define-key gdb-mode-map "\M-?" nil) (define-key gdb-mode-map "\C-c\M-i" 'gdb-stepi) (define-key gdb-mode-map "\C-c\M-s" 'gdb-step) (define-key gdb-mode-map [(meta tab)] 'comint-dynamic-list-completions) ) (defvar gdb-mode-hook 'gdb-patch "Function to run after gdb-mode initialization"))) ;;;========================================================================= ;;; comint fix for A+ (defvar a-mode-fix-comint t "Fix comint because I want to use A+.") (if a-mode-fix-comint (progn (defun comint-patch () "Redefines COMINT mode keymap to remove conflicts with A+" (interactive) (define-key comint-mode-map "\M-n" nil) (define-key comint-mode-map "\M-p" nil) (define-key comint-mode-map "\M-r" nil) (define-key comint-mode-map "\M-s" nil) (define-key comint-mode-map "\M-?" nil) (define-key comint-mode-map [(meta right)] 'comint-next-matching-input-from-input) (define-key comint-mode-map [(meta left)] 'comint-previous-matching-input-from-input) (define-key comint-mode-map [(meta down)] 'comint-next-matching-input) (define-key comint-mode-map [(meta up)] 'comint-previous-matching-input) (define-key comint-mode-map [(meta tab)] 'comint-dynamic-list-completions) ) (defvar comint-mode-hook 'comint-patch "Function to run after comint-mode initialization"))) (provide 'a) ;;; -If you are looking at a read-only file and type C-x C-q to get to write ;;; mode, xemacs will also check out and lock the file without telling you. ;;; ;;; -If you try to edit an rcs file that has been removed, xemacs will check ;;; the file out read only without telling you. For example, if you try to edit ;;; /u/d/sts_ny_trader/code2/swfheader.a (which has an rcs log), xemacs will ;;; create the file by checking it out of rcs. This puts an out-of-date file ;;; into ny_trader/code2 without your even realizing it. ;;; ;; Anyway, this should be remove-hook, not setq. (defvar a-mode-fix-toggle t "Fix C-x C-q because I want to use A+.") (if a-mode-fix-toggle (progn (remove-hook 'find-file-not-found-hooks 'vc-file-not-found-hook) (define-key global-map [(control x) (control q)] 'toggle-read-only))) ;;; a.el ends here aplus-fsf-4.22/src/lisp.1/a-font.el0000444000265000001440000000412307252243271012423 ;;; a-font.el --- Font lock for APlus. ;; Copyright (C) 1998,1999,2001 Colin Rafferty ;; Author: Colin Rafferty ;; Keywords: ;; 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. ;; A copy of the GNU General Public License can be obtained from this ;; program's author (send electronic mail to colin@xemacs.org) or from ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. ;; Send bug reports to colin@xemacs.org ;;; Code: (require 'font-lock) (provide 'a-font) (defconst a-font-lock-keywords-1 nil "Helper for a-font-lock-keywords") (let ((ctoken "\\(\\sw\\|\\s_\\|[:~*&]\\)+") (ows "[ \t]*")) (setq a-font-lock-keywords-1 (list ;; Should have function names highlighted (font-lock-function-name-face) (list (concat "^\\(" "\\(" "\\(" "\\(" ctoken ows "\\)?" ; context "\\." ows "\\)?" "\\(" ctoken "\\)" ; name "\\)" ows "{" ows "\\(" "\\(" ctoken "\\)" ows ; first argument "\\)?" "\\)") ;; context and name together are the function name '(2 font-lock-function-name-face) ;; first argument is a variable name. '(9 font-lock-variable-name-face nil t) ;; any remaining arguments are also variable names. (list (concat "\\(;" ows "\\(" ctoken "\\)" ows "\\)") nil nil '(2 font-lock-variable-name-face nil t))) ;; All keywords: ;; (regexp-opt '("case" "do" "else" "if" "while") nil t) (cons "\\<\\(case\\|do\\|else\\|if\\|while\\)\\>" 'font-lock-keyword-face) ))) (defvar a-font-lock-keywords a-font-lock-keywords-1 "Default expressions to highlight in A+ modes.") (provide 'a-font) ;;; a-font.el ends here aplus-fsf-4.22/src/lisp.1/aplus.el0000444000265000001440000000310710304470600012352 ;;; aplus.el -- Loads the Aplus specific settings for xemacs ;; Copyright (C) 1998,2001 Colin Rafferty ;; Author: Colin Rafferty ;; Keywords: ;; 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. ;; A copy of the GNU General Public License can be obtained from this ;; program's author (send electronic mail to colin@xemacs.org) or from ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. ;; Send bug reports to colin@xemacs.org ;;; Code: ;; ;; (defvar aplus-set-load-path t "*Non-nil means set the load-path for the user.") (if aplus-set-load-path (setq load-path (append '("/usr/local/aplus-fsf-4.20/lisp.1") load-path ) )) ;; ;; Load Aplus and set defaults ;; (defvar aplus-setup-global-bindings t "*Non-nil means to set up the global keybindings for the user.") (if aplus-setup-global-bindings (load "xa" nil t)) (require 'a-font) (require 'keyb) (require 'a) (setq a-prog "/usr/local/bin/a+") (setq a-plus t) (cond ((file-readable-p "~/.custom/a-options.el") (load-file "~/.custom/a-options.el") ) ) (provide 'aplus) ;;; aplus.el ends here aplus-fsf-4.22/src/lisp.1/keyb.el0000444000265000001440000001466107252253517012205 ;;; keyb.el -- A+ keyboard modifications. ;; Copyright (C) 1998,2001 Colin Rafferty ;; Author: Colin Rafferty ;; Keywords: ;; 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. ;; A copy of the GNU General Public License can be obtained from this ;; program's author (send electronic mail to colin@xemacs.org) or from ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. ;; Send bug reports to colin@xemacs.org ;;; Code: (defvar a-key-string nil "Apl characters corresponding to raw keyboard input") (defun a-self-insert (n) (interactive "p") (or n (setq n 1)) (let* ((xev (copy-event last-command-event)) (key (event-to-character xev t t t))) (setq last-command-char (aref a-key-string (char-to-int key))) (self-insert-command n))) (defvar a-minor-map nil) (if a-minor-map nil (setq a-minor-map (make-sparse-keymap)) (setq a-key-string (make-string 256 ?\000)) (let ((n 32)) (while (< n 256) (aset a-key-string n n) (setq n (1+ n)))) (mapcar #'(lambda (akeydef) (let ((key (car akeydef)) (apl (cdr akeydef))) (define-key a-minor-map (list 'meta (- key 128)) 'a-self-insert) (aset a-key-string (char-to-int key) apl))) '((?\M-a . ?\301) ; A (2) (?\M-b . ?\302) ; B (?\M-c . ?\303) ; (?\M-d . ?\304) ; D (?\M-e . ?\305) ; (?\M-f . ?_) ; _ (?\M-g . ?\307) ; G (?\M-h . ?\310) ; H (?\M-i . ?\311) ; (?\M-j . ?\312) ; J (?\M-k . ?\') ; ' (?\M-l . ?\314) ; L (?\M-m . ?|) ; | (?\M-n . ?\316) ; N (?\M-o . ?\317) ; (?\M-p . ?\*) ; * (?\M-q . ?\?) ; ? (?\M-r . ?\322) ; R (?\M-s . ?\323) ; (?\M-t . ?\~) ; ~ (?\M-u . ?\325) ; (?\M-v . ?\326) ; V (?\M-w . ?\327) ; W (1) (?\M-x . ?\330) ; (?\M-y . ?\331) ; (?\M-z . ?\332) ; (?\M-1 . ?\241) ; ! (?\M-2 . ?\242) ; (?\M-3 . ?<) ; < (?\M-4 . ?\244) ; $ (?\M-5 . ?=) ; = (?\M-6 . ?\246) ; (?\M-7 . ?>) ; > (?\M-8 . ?\250) ; ( (?\M-9 . ?\251) ; ) (?\M-0 . ?^) ; ^ (?\M-- . ?\253) ; + (?\M-= . ?\337) ; (?\M-\\ . ?\334); (?\M-` . ?\376) ; ~ (?\M-, . ?\254) ; , (?\M-[ . ?\373) ; { (?\M-] . ?\375) ; } (?\M-\; . ?\333) ; [ (?\M-' . ?\335) ; (?\M-. . ?\334) ; (?\M-/ . ?\257) ; / (?\M-! . ?\340) ; ` (?\M-@ . ?\346) ; (?\M-# . ?\347) ; (?\M-$ . ?\350) ; h (?\M-% . ?\367) ; w (1) (?\M-^ . ?\364) ; t (?\M-& . ?\341) ; a (2) (?\M-* . ?\360) ; p (?\M-\( . ?\271); 9 (?\M-\) . ?\260); 0 (?\M-_ . ?!) ; ! (?\M-+ . ?\255) ; - (?\M-| . ?\374) ; | (check syntax table entry!) (?\M-O . ?\357) ; (?\M-J . ?\352) ; (?\M-F . ?\275) ; = (?\M-E . ?\345) ; e (?\M-I . ?\351) ; i (?\M-{ . ?\335) ; (?\M-} . ?\333) ; [ (?\M-S . ?\276) ; > (?\M-G . ?\347) ; (?\M-H . ?\350) ; h (?\M-L . ?\354) ; l (?\M-: . ?\274) ; (?\M-\" . ?\273); ; (?\M-C . ?\343) ; c (?\M-B . ?\342) ; b (?\M-N . ?\356) ; n (?\M-M . ?\315) ; (?\M-> . ?\256) ; . *** ??? (?\M-P . ?\263) ; 3 (?\M-Y . ?\264) ; 4 (?\M-Z . ?\372) ; z (?\M-Q . ?\277) ; (?\M-W . ?W) ; W (?\M-R . ?R) ; R (?\M-T . ?T) ; T (?\M-U . ?U) ; U (?\M-A . ?A) ; A (?\M-D . ?D) ; D (?\M-K . ?K) ; K (?\M-X . ?X) ; X (?\M-V . ?V) ; V (?\M-? . ?\?) ; ? (?\M-~ . ?~) ; ~ (?\M-< . ?<) ; < (?\M-\040 . ?\040) ) ; end of translation table ) ; end of mapcar ;; if we are running off of a tty, window-system is nil ;; in such a case, we need to handle all those events that get passed ;; as escape sequences (if window-system nil (global-unset-key "\C-h") (global-set-key "\C-h" 'backward-delete-char) (define-key esc-map "[" nil) (define-key esc-map "O" nil) (mapcar #'(lambda (akeydef) (let ((key (car akeydef)) (apl (cdr akeydef))) (define-key esc-map key apl) )) '( ("[224z" . a-send-region) ; f1 ("[225z" . a-send-line) ; f2 ("[226z" . a-send-func) ; f3 ("[227z" . a-other-window) ; f4 ("[228z" . delete-other-windows) ; f5 ("[229z" . other-window-or-pop) ; f6 ("[230z" . next-buffer) ; f7 ("[231z" . previous-buffer) ; f8 ("[232z" . enlarge-window) ; f9 ("[233z" . shrink-window) ; f10 ("[209z" . print-buffer) ; PrintScreen ("[210z" . scroll-down-in-place) ; Scroll ("[5z" . scroll-down) ; pgup ("[216z" . scroll-down) ; pgup ("[6z" . scroll-up) ; pgdn ("[222z" . scroll-up) ; pgdn ("[214z" . beginning-of-line) ; home ("[220z" . end-of-line) ; end ("[2z" . overwrite-mode) ; insert ("OA" . previous-line) ; up-arrow ("OB" . next-line) ; down-arrow ("OC" . forward-char) ; right-arrow ("OD" . backward-char) ; left-arrow ) ; end of translation table ) ; end of mapcar ) ; end of if window-system nil ) ; end of if a-minor-map (define-key a-minor-map "\C-c\C-a" 'a) (define-key a-minor-map "\C-c\C-r" 'a-send-region) (define-key a-minor-map "\C-c\C-l" 'a-send-line) (define-key a-minor-map "\C-c\C-f" 'a-send-func) (define-key a-minor-map "\C-c\C-b" 'a-send-buffer) (define-key a-minor-map '(escape) esc-map) (setq a-mode-map nil) (if a-mode-map nil (setq a-mode-map (make-sparse-keymap))) (define-key a-mode-map "\C-m" 'a-send-input) (define-key a-mode-map "\C-c\C-c" 'a-interrupt-process) (define-key a-mode-map "\C-c\C-k" 'a-kill-process) (define-key a-mode-map "\C-c\C-q" 'a-quit-process) (define-key a-mode-map "\C-c\C-s" 'a-show-output) (define-key a-mode-map "\C-c\C-o" 'a-kill-output) (define-key a-mode-map "\C-c\C-p" 'a-goto-last-input) (define-key a-mode-map "\C-c\C-m" 'a-recall-last-input) (if (not (assq 'a-minor minor-mode-alist)) (setq minor-mode-alist (cons '(a-minor " A") minor-mode-alist))) (provide 'keyb) ;;; keyb.el ends here aplus-fsf-4.22/src/lisp.1/xa.el0000444000265000001440000000410707252243272011652 (require 'keyb) (require 'a) ; Interactively set a-prog (global-set-key "\C-ca" 'set-a-prog-builtin) (global-set-key 'f1 'a-send-region) (global-set-key 'f2 'a-send-line) (global-set-key 'f3 'a-send-func) (global-set-key 'f4 'a-other-window) (global-set-key 'f5 'delete-other-windows) (global-set-key 'f6 'other-window-or-pop) (global-set-key 'f7 'next-buffer) (global-set-key 'f8 'previous-buffer) (global-set-key 'f9 'enlarge-window) (global-set-key 'f10 'shrink-window) (global-set-key 'scroll 'scroll-down-in-place) (global-set-key '(shift scroll) 'scroll-up-in-place) (global-set-key 'prsc 'print-buffer) (global-set-key 'props 'toggle-a-minor-mode) (global-set-key 'backspace 'backward-delete-char-untabify) (define-key esc-map "h" 'help-for-help) (defun other-window-or-pop() "Goto next window or if only one window pop previous buffer in other window" (interactive) (let* ((win1 (selected-window)) (win2 (progn (other-window 1) (selected-window)))) (and (eq win1 win2) (switch-to-buffer-other-window nil)))) (defun scroll-down-in-place (n) (interactive "p") (previous-line n) (scroll-down n)) (defun scroll-up-in-place (n) (interactive "p") (next-line n) (scroll-up n)) (defun previous-buffer () "Switch to previous buffer." (interactive) (switch-to-buffer (other-buffer))) (defun next-buffer () "Switch to next buffer." (interactive) (switch-to-buffer (if (eq last-command 'next-buffer) (first-normal-buffer (reverse (buffer-list))) (other-buffer)))) (defun first-normal-buffer (buflist) (if (null buflist) nil (let ((buf1 (buffer-name (car buflist)))) (if (equal " " (substring buf1 0 1)) (first-normal-buffer (cdr buflist)) buf1)))) (defun kill-current-buffer () "Kills the current buffer if no process." (interactive) (if (get-buffer-process (current-buffer)) (message "Buffer not killed -- Buffer has process") (if buffer-file-name (if (buffer-modified-p (current-buffer)) (message "Buffer not killed -- Buffer is modified") (kill-this-buffer)) (kill-this-buffer) ) ) ) aplus-fsf-4.22/src/lisp.0/0000777000265000001440000000000010774512701011002 5aplus-fsf-4.22/src/lisp.0/Makefile.am0000644000265000001440000000141010304473700012740 ## Process this file with automake to produce Makefile.in ############################################################################### ## ## ## Copyright (c) 2001 Morgan Stanley Dean Witter and Co. All rights reserved.## ## See .../src/LICENSE for terms of distribution. ## ## ## ## ## ############################################################################### lisp0dir = $(prefix)/lisp.0 lisp0_DATA = \ .emacs \ a.el \ aplus.el \ keyb.el \ xa.el EXTRA_DIST = \ .emacs \ a.el \ aplus.el \ keyb.el \ xa.el aplus-fsf-4.22/src/lisp.0/Makefile.in0000644000265000001440000001513710774512524012775 # Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ ############################################################################### ############################################################################### SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CXX = @CXX@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ STRIP = @STRIP@ VERSION = @VERSION@ X_INCLUDES = @X_INCLUDES@ X_LIBS = @X_LIBS@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ lisp0dir = $(prefix)/lisp.0 lisp0_DATA = \ .emacs \ a.el \ aplus.el \ keyb.el \ xa.el EXTRA_DIST = \ .emacs \ a.el \ aplus.el \ keyb.el \ xa.el subdir = src/lisp.0 mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_CLEAN_FILES = DIST_SOURCES = DATA = $(lisp0_DATA) DIST_COMMON = Makefile.am Makefile.in all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/lisp.0/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: lisp0DATA_INSTALL = $(INSTALL_DATA) install-lisp0DATA: $(lisp0_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(lisp0dir) @list='$(lisp0_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(lisp0DATA_INSTALL) $$d$$p $(DESTDIR)$(lisp0dir)/$$f"; \ $(lisp0DATA_INSTALL) $$d$$p $(DESTDIR)$(lisp0dir)/$$f; \ done uninstall-lisp0DATA: @$(NORMAL_UNINSTALL) @list='$(lisp0_DATA)'; for p in $$list; do \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " rm -f $(DESTDIR)$(lisp0dir)/$$f"; \ rm -f $(DESTDIR)$(lisp0dir)/$$f; \ done tags: TAGS TAGS: DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = ../.. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: $(mkinstalldirs) $(DESTDIR)$(lisp0dir) 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_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_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-generic clean-libtool mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-lisp0DATA install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool uninstall-am: uninstall-info-am uninstall-lisp0DATA .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-lisp0DATA install-man install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool uninstall uninstall-am uninstall-info-am \ uninstall-lisp0DATA # 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: aplus-fsf-4.22/src/lisp.0/.emacs0000444000265000001440000000005710304470516012003 (load "/usr/local/aplus-fsf-4.20/lisp/aplus") aplus-fsf-4.22/src/lisp.0/a.el0000444000265000001440000011472707232126713011471 ;; Copyright (c) 2001 Morgan Stanley Dean Witter and Co. All rights reserved. ;; See .../src/LICENSE for terms of distribution. (defvar a+-font "kaplscreen-bold" "Font used in A+ mode.") (defvar old-default-font (face-font-name 'default)) ; (defvar apr-command "/usr/local/bin/apr" "Command to print A+ code") ;(defvar apr-command "/ms/dist/aurora/bin/apr" "Command to print A+ code") (defvar apr-command "/usr/bin/lpr" "Command to print A+ code") (defvar lpr-command "/usr/bin/lpr" "Command to print A+ code") (defvar old-lpr-command lpr-command) (defvar apr-switches (list "-2r") "Switches for apr-command") (defvar lpr-switches (list "-2r") "Switches for apr-command") (defvar old-lpr-switches lpr-switches) (defvar a-minor nil "*t if in A minor mode") (make-variable-buffer-local 'a-minor) (setq-default a-minor nil) (defvar a-alt-parents nil "Keymap parents for A minor mode toggle") (make-variable-buffer-local 'a-alt-parents) (setq-default a-alt-parents nil) (defvar a-alt-popup nil "Popup menu for A minor mode toggle") (make-variable-buffer-local 'a-alt-popup) (setq-default a-alt-popup nil) (defvar a-mode-syntax-table nil "Syntax table in use in a-minor mode.") (defun set-a-comment-parms () "Assigns a+ comment parameters" (setq comment-multi-line nil) (setq comment-start (char-to-string ?\343)) (setq comment-end "") (setq comment-column 1) (setq parse-sexp-ignore-comments t) ) (if a-mode-syntax-table () (setq a-mode-syntax-table (make-syntax-table (standard-syntax-table))) (modify-syntax-entry ?\n ">" a-mode-syntax-table) ; \n is end of comment (modify-syntax-entry ?\\ "." a-mode-syntax-table) ; \ is punctuation (modify-syntax-entry ?_ "w" a-mode-syntax-table) ; _ is word constituent (modify-syntax-entry ?' "\"" a-mode-syntax-table) ; ' is string quote (modify-syntax-entry ?\; "." a-mode-syntax-table) (modify-syntax-entry ?# "." a-mode-syntax-table) (modify-syntax-entry ?, "." a-mode-syntax-table) (modify-syntax-entry ?@ "w" a-mode-syntax-table) (modify-syntax-entry ?. "_" a-mode-syntax-table) (modify-syntax-entry ?\241 "." a-mode-syntax-table) ; dieresis (each) (modify-syntax-entry ?\242 "_" a-mode-syntax-table) ; overbar (modify-syntax-entry ?\244 "." a-mode-syntax-table) ; less than or equal (modify-syntax-entry ?\246 "." a-mode-syntax-table) ; greater than or equal (modify-syntax-entry ?\250 "." a-mode-syntax-table) ; not equal (modify-syntax-entry ?\251 "." a-mode-syntax-table) ; down caret (modify-syntax-entry ?\253 "." a-mode-syntax-table) ; times (modify-syntax-entry ?\255 "." a-mode-syntax-table) ; domino (modify-syntax-entry ?\256 "." a-mode-syntax-table) ; dotted del (modify-syntax-entry ?\257 "." a-mode-syntax-table) ; slash bar (modify-syntax-entry ?\271 "." a-mode-syntax-table) ; nor (modify-syntax-entry ?\273 "." a-mode-syntax-table) ; quad jot (modify-syntax-entry ?\274 "." a-mode-syntax-table) ; quad backslash (modify-syntax-entry ?\275 "." a-mode-syntax-table) ; equal underbar (modify-syntax-entry ?\276 "." a-mode-syntax-table) ; squad (modify-syntax-entry ?\301 "." a-mode-syntax-table) ; alpha (modify-syntax-entry ?\302 "." a-mode-syntax-table) ; base (modify-syntax-entry ?\303 "." a-mode-syntax-table) ; cap (modify-syntax-entry ?\304 "." a-mode-syntax-table) ; down stile (modify-syntax-entry ?\305 "." a-mode-syntax-table) ; epsilon (modify-syntax-entry ?\307 "." a-mode-syntax-table) ; del (modify-syntax-entry ?\310 "." a-mode-syntax-table) ; delta (modify-syntax-entry ?\311 "." a-mode-syntax-table) ; iota (modify-syntax-entry ?\312 "." a-mode-syntax-table) ; jot (modify-syntax-entry ?\314 "." a-mode-syntax-table) ; quad (modify-syntax-entry ?\316 "." a-mode-syntax-table) ; top (modify-syntax-entry ?\317 "." a-mode-syntax-table) ; circle (modify-syntax-entry ?\322 "." a-mode-syntax-table) ; rho (modify-syntax-entry ?\323 "." a-mode-syntax-table) ; up stile (modify-syntax-entry ?\325 "." a-mode-syntax-table) ; del stile (modify-syntax-entry ?\326 "." a-mode-syntax-table) ; cup (modify-syntax-entry ?\327 "." a-mode-syntax-table) ; omega (modify-syntax-entry ?\330 "." a-mode-syntax-table) ; right shoe (modify-syntax-entry ?\331 "." a-mode-syntax-table) ; take (modify-syntax-entry ?\332 "." a-mode-syntax-table) ; left shoe (modify-syntax-entry ?\333 "." a-mode-syntax-table) ; right (modify-syntax-entry ?\334 "." a-mode-syntax-table) ; backslash bar (modify-syntax-entry ?\335 "." a-mode-syntax-table) ; left (modify-syntax-entry ?\337 "." a-mode-syntax-table) ; divide (modify-syntax-entry ?\340 "." a-mode-syntax-table) ; I-beam (modify-syntax-entry ?\341 "." a-mode-syntax-table) ; circle bar (modify-syntax-entry ?\342 "." a-mode-syntax-table) ; execute (modify-syntax-entry ?\343 "<" a-mode-syntax-table) ; lamp comment (modify-syntax-entry ?\345 "." a-mode-syntax-table) ; epsilon underbar (modify-syntax-entry ?\346 "." a-mode-syntax-table) ; del tilde (modify-syntax-entry ?\347 "." a-mode-syntax-table) ; del stile (modify-syntax-entry ?\350 "." a-mode-syntax-table) ; delta stile (modify-syntax-entry ?\351 "." a-mode-syntax-table) ; iota underbar (modify-syntax-entry ?\354 "." a-mode-syntax-table) ; quote quad (modify-syntax-entry ?\356 "." a-mode-syntax-table) ; format (modify-syntax-entry ?\364 "." a-mode-syntax-table) ; flip (modify-syntax-entry ?\367 "." a-mode-syntax-table) ; rotate (modify-syntax-entry ?\373 "." a-mode-syntax-table) ; left arrow (modify-syntax-entry ?\374 "." a-mode-syntax-table) ; delta underbar (modify-syntax-entry ?\375 "." a-mode-syntax-table) ; right arrow (modify-syntax-entry ?\376 "." a-mode-syntax-table) ; diamond ) (defvar narrowed nil "Flagged of whether narrowed") (make-variable-buffer-local 'narrowed) (setq-default narrowed nil) (setq global-popup-menu '("A+ menu" ["Toggle A+ Keyboard" toggle-a-minor-mode t] ["Start A+/Goto A+ Buffer" a t] ["Print Region" lpr-region (mark)] ["Comment Region" comment-region (mark)] ["Uncomment Region" (comment-region (region-beginning) (region-end) -1) (mark)] ["Narrow-to-Region" (progn (setq narrowed t) (narrow-to-region (region-beginning) (region-end))) (mark)] ["Widen" (progn (setq narrowed nil) (widen)) narrowed] )) (defvar a-minor-popup-menu nil "Popup menu for a-minor mode.") (setq a-minor-popup-menu '("A+ Utils" "---" ["Send Line to A+" a-send-line t] ["Send Region to A+" a-send-region (mark)] ["Send Buffer to A+" a-send-buffer t] ["Send Function to A+" a-send-func t] )) (defvar a-menubar nil "A+ menubar entry.") (setq a-menubar (nconc '("A+" ["Toggle A+ Keyboard" toggle-a-minor-mode t] ["Start A+/Goto A+ Buffer" a t] ["Print Region" lpr-region (mark)] ["Comment Region" comment-region (mark)] ["Uncomment Region" (comment-region (region-beginning) (region-end) -1) (mark)] ["Narrow-to-Region" (progn (setq narrowed t) (narrow-to-region (region-beginning) (region-end))) (mark)] ["Widen" (progn (setq narrowed nil) (widen)) narrowed] ) (cdr a-minor-popup-menu)) ) (add-submenu nil a-menubar) (setq a-options-menubar (nconc '("A+Options" ["A+ Program..." (setq a-prog (read-file-name "Executable for A+ Program: " "" a-prog t a-prog)) t] ["Workspace Size..." (progn (setq a-mbytes (read-number "Enter initial workspace size in megabytes: ")) (if (lt a-mbytes 4) (setq a-mbytes 4))) t] ["Size Threshold..." (progn (setq a-mbytes-threshold (read-number "Enter incremental workspace size in megabytes: ")) (if (lt a-mbytes 16) (setq a-mbytes 16))) t] ["Log File..." (setq a-log (read-file-name "Log File for A+ Session: " "" a-log nil a-log)) t] ["Temp dir..." (setq a-tmp-dir (read-string "Temp dir for A+ xemacs operations: " a-tmp-dir )) t] ["A+ Buffer..." (setq a-buffer-name (read-string "A+ Buffer Name: " a-buffer-name)) t] ["apr Program..." (setq apr-command (read-file-name "Executable for printing A+: " "" apr-command t apr-command)) t] ["apr Switches..." (setq apr-switches (list (read-string "Switches to pass to apr program: " (car apr-switches)))) t] ["Font..." (setq a+-font (read-string "Font for A+: " "kaplscreen-bold")) t] "----" ["Host..." (setq a-host (read-string "Host on which to run A+: " a-host)) t] ["Init String..." (setq a-init-string (read-string "Init string: " a-init-string)) t] ["Load Prefix..." (setq a-load-prefix (read-string "Load prefix: " a-load-prefix)) t] ["Load Comment..." (setq a-load-comment (read-string "Load comment: " a-load-comment)) t] ["Load Sequence..." (setq a-load-sequence (read-string "Load sequence: " a-load-sequence)) t] ["Prompt Pattern..." (setq a-prompt-pattern (read-string "Prompt pattern: " a-prompt-pattern)) t] ["Quiet" (setq a-quiet (not a-quiet)) :style toggle :selected a-quiet] ["Invocation..." (setq a-invocation (read-number "A+ Invocation: " a-invocation)) t] "----" ["A+ Options File..." (setq save-a-options-file (read-file-name "Log File for A+ Session: " "" "~/.custom/a-options.el" nil save-a-options-file)) t] ["Save A+ Options" save-a-options-menu-settings t] ) ) ) (add-submenu nil a-options-menubar) ;;; The A+ Options menu (defconst a-options-menu-saved-forms ;; This is really quite a kludge, but it gets the job done. (purecopy '(a-prog ; #### - does this WORK??? a-mbytes a-mbytes-threshold a-log a-tmp-dir a-buffer-name apr-command apr-switches a+-font a-host a-init-string a-load-prefix a-load-comment a-load-sequence a-prompt-pattern a-quiet a-invocation )) "The variables to save; or forms to evaluate to get forms to write out.") (defvar save-a-options-file (concat "~" init-file-user "/.custom/a-options.el") "File to save options into.") (defun save-a-options-menu-settings () "Saves the current settings of the `A+Options' menu to your `a-options.el' file." (interactive) (let ((output-buffer (find-file-noselect (expand-file-name save-a-options-file))) output-marker) (save-excursion (set-buffer output-buffer) ;; ;; Find and delete the previously saved data, and position to write. ;; (goto-char (point-min)) (if (re-search-forward "^;; APLUS Options Menu Settings *\n" nil 'move) (let ((p (match-beginning 0))) (goto-char p) (or (re-search-forward "^;; End of APLUS Options Menu Settings *\\(\n\\|\\'\\)" nil t) (error "can't find END of saved state in a-options.el")) (delete-region p (match-end 0))) (goto-char (point-max)) (insert "\n")) (setq output-marker (point-marker)) ;; run with current-buffer unchanged so that variables are evaluated in ;; the current context, instead of in the context of the "a-options.el" buffer. (let ((print-readably t) (print-escape-newlines t) (standard-output output-marker)) (princ ";; APLUS Options Menu Settings\n") (princ ";; ============================\n") (princ "(cond\n") (princ " ((and (string-match \"XEmacs\" emacs-version)\n") (princ " (boundp 'emacs-major-version)\n") (princ " (>= emacs-major-version 19))\n") (mapcar #'(lambda (var) (princ " ") (if (symbolp var) (prin1 (list 'setq var (let ((val (symbol-value var))) (if (or (memq val '(t nil)) (stringp val)) val (list 'quote val))))) (setq var (eval var)) (cond ((eq (car-safe var) 'progn) (while (setq var (cdr var)) (prin1 (car var)) (princ "\n") (if (cdr var) (princ " ")) )) (var (prin1 var)))) (if var (princ "\n"))) a-options-menu-saved-forms) (princ " ))\n") (princ ";; ==================================\n") (princ ";; End of APLUS Options Menu Settings\n") )) (set-marker output-marker nil) (save-excursion (set-buffer output-buffer) (save-buffer)) )) (defvar a-popup-menu nil "Popup menu for a-mode.") (setq a-popup-menu (nconc '("A+ Process Menu" ["Recall Last Input" a-recall-last-input t] ["Goto Last Input" a-goto-last-input t] "---" ["Interrupt A+" a-interrupt-process (get-buffer-process (current-buffer))] ["Quit A+" a-quit-process (get-buffer-process (current-buffer))] ["Kill A+" a-kill-process (get-buffer-process (current-buffer))] "---") a-minor-popup-menu)) (defun a-mode () "Starts a-mode" (interactive) (setq major-mode 'a-mode) (setq mode-name "A") (auto-fill-mode -1) (use-local-map a-mode-map) (setq a-minor t) (set-syntax-table a-mode-syntax-table) (setq mode-popup-menu a-popup-menu) (set-a-comment-parms) (setq lpr-command apr-command) (setq lpr-switches apr-switches) (set-keymap-parents a-mode-map a-minor-map) (redraw-modeline) ) (defun toggle-a-minor-mode () "Toggles minor mode providing enhanced APL Union Keyboard." (interactive) (make-variable-buffer-local 'meta-prefix-char) (setq a-minor (not a-minor)) (if a-minor (progn (set-a-comment-parms) (setq a-alt-popup mode-popup-menu) (setq mode-popup-menu a-minor-popup-menu) (set-syntax-table a-mode-syntax-table) (setq old-lpr-command lpr-command) (setq old-lpr-switches lpr-switches) (setq lpr-command apr-command) (setq lpr-switches apr-switches) (setq meta-prefix-char -1) (set-face-font 'default a+-font (selected-frame)) (auto-fill-mode -1) (if (current-local-map) (progn (setq a-alt-parents (keymap-parents (current-local-map))) (set-keymap-parents (current-local-map) (cons a-minor-map a-alt-parents))) (use-local-map a-minor-map)) ) (progn (setq lpr-command old-lpr-command) (setq lpr-switches old-lpr-switches) (set-face-font 'default old-default-font (selected-frame)) (setq meta-prefix-char 27) (if (equal a-minor-map (current-local-map)) (use-local-map nil) (progn (set-keymap-parents (current-local-map) a-alt-parents) (setq a-alt-parents nil) ) ))) (redraw-modeline) ) (defun a-minor-mode () "Turns on a-minor-mode minor mode providing enhanced APL Union Keyboard." (interactive) (if (not a-minor) (toggle-a-minor-mode)) (add-submenu nil a-menubar) (add-submenu nil a-options-menubar) ) (defun defarg (arg defval prompt) "arguments are ARG DEFVAL PROMPT: If ARG is non-null and is not equal to \"\" then ARG is returned. Otherwise prompt (with PROMPT) for a new value. If this new value is equal to \"\" then return DEFVAL." (if (and (or (null arg) (equal arg "")) (equal (setq arg (read-from-minibuffer (concat prompt "[" defval "]: "))) "")) defval arg)) (defvar a-prog "/usr/local/bin/a" "*Program to run for `a' command") (defvar a-log "~/.emacs_a" "*Log file for `a' sessions") (defvar a-tmp-dir "~" "Temp directory for A+ xemacs operations") (defvar a-init-string "$echo `date` on `uname -n`\n" "*Sent to `a' on startup") (defvar a-mbytes 4 "*Default number of megabytes") (defvar a-mbytes-threshold 16 "*Max default size before prompting") (defvar a-prompt-pattern "^\\** *" "*Prompt for `a'") (defvar a-invocation 0 "Random Number of `a' invocation") (random t) (defvar a-load-sequence 0 "Sequence number used in name of temp file") (defvar a-load-prefix "$loadrm " "*Load prefix") (defvar a-load-comment "\343 Loading: " "*Load comment") (defvar a-quiet nil "*If true, shut up") (defvar a-host nil "*Host on which to run `a'") (defvar a-track-beginning-of-expression nil "*If non-nil, a-recall-last-input will leave the cursor at the beginning of the last input") (defvar a-buffer-name "*a*" "*Name of buffer in which to run the `a' process") (defvar a-plus nil "*t if A+ style command line") (defvar a-plus-without-s nil "*t if no s is desired") (defvar a-plus-rest nil "*remaining arguments to A+") (defvar a-startup-hook nil "Function to run after a-buffer initialization") (defvar a-first-output-hook nil "Function to run after first a output") (defun standard-a() (interactive) (setq a-prog "/usr/local/bin/z") (setq a-log "~/.emacs_a") (setq a-tmp-dir "~") (setq a-init-string "$echo `date` on `hostname`\n") (setq a-mbytes 4) (setq a-mbytes-threshold 16) (setq a-prompt-pattern "^\\** *") (setq a-invocation 0) (random t) (setq a-load-sequence 0) (setq a-load-prefix "$load ") (setq a-load-comment "\343 Loading: ") (setq a-quiet nil) (setq a-host nil) (message "standard `a' defaults set")) (defun setup-a() (interactive) (setq a-prog (defarg nil a-prog "a-prog")) (setq a-mbytes (string-to-int (defarg nil (int-to-string a-mbytes) "a-mbytes"))) (setq a-init-string (defarg nil a-init-string "a-init-string")) (setq a-load-prefix (defarg nil a-load-prefix "a-load-prefix")) (setq a-load-comment (defarg nil a-load-comment "a-load-comment"))) (defvar a-no-output-yet nil) (defun a (&optional mbytes loadfile newbuf) "Interactively runs an `a' session." (interactive) (let* ((process-connection-type nil) (mbytes (or mbytes a-mbytes)) (loadfile (or loadfile (getenv "ALOADFILE") (if a-plus a-plus-rest))) aproc astat) (setq newbuf (or newbuf (null (get-buffer a-buffer-name)))) (if (and (interactive-p) a-host) (message (concat "Running `a' on " a-host "..."))) (switch-to-buffer a-buffer-name) (make-variable-buffer-local 'meta-prefix-char) (setq meta-prefix-char -1) (make-variable-buffer-local 'next-line-add-newlines) (setq next-line-add-newlines t) (set-face-font 'default a+-font (selected-frame)) (setq aproc (get-buffer-process (current-buffer))) (setq astat (if aproc (process-status aproc))) (if (or (null astat) (not (memq astat '(run stop)))) (progn (setq mbytes (if (<= mbytes a-mbytes-threshold) mbytes (string-to-int (defarg (and mbytes (int-to-string mbytes)) (int-to-string mbytes) "megabytes")))) (setq modeline-process '(": %s")) (a-mode) (make-local-variable 'last-input-start) (setq last-input-start (point-max-marker)) (make-local-variable 'last-input-end) (setq last-input-end (point-max-marker)) (cond ((and a-log (= (point-min) (point-max))) (and (file-exists-p a-log) (insert-file-contents a-log)) (setq buffer-file-name a-log))) (insert "Starting...\n") (setq a-invocation (random)) (setq a-no-output-yet t) (setq aproc (apply 'start-process "`a'" (current-buffer) (append (if (and a-host (not (equal a-host (system-name)))) (append (list "rsh" a-host) (define-DISPLAY) (var-defs "PRINTER" "PLOTTER" "PATH" "XAPPLRESDIR" "XENVIRONMENT" "XFILESEARCHPATH" "XUSERFILESEARCHPATH"))) (list a-prog) (if (and a-plus a-plus-without-s) (list "-s")) (if a-plus (list "-w")) (list (int-to-string mbytes)) (if (listp loadfile) loadfile (list loadfile))))) (set-marker (process-mark aproc) (point-max)) (set-process-filter aproc 'a-proc-filter) (goto-char (point-max)) (if newbuf (run-hooks 'a-startup-hook)))))) (defun define-DISPLAY () (let ((val (getenv "DISPLAY"))) (if val (set-shell-variable "DISPLAY" (if (or (equal "unix:" (substring (concat val " ") 0 5)) (equal ":" (substring (concat val " ") 0 1))) (concat (system-name) (substring val (string-match ":" val) nil)) val))))) (defun set-shell-variable (var value) (let ((shell (getenv "SHELL"))) (if (equal "/bin/csh" shell) (list (concat "setenv " var " " value " ; ")) (list (concat var "=" value))))) (defun var-defs (&rest arg) (let (result) (while arg (let* ((var (car arg)) (val (getenv var))) (if val (setq result (append result (set-shell-variable var val))))) (setq arg (cdr arg))) result)) (defun a-proc-filter (aproc output) "If point is at end of buffer, place output in buffer and move point to new end. Otherwise, just place output in buffer." (let ((initial a-no-output-yet)) (if a-no-output-yet (progn (setq a-no-output-yet nil) (process-send-string aproc a-init-string))) (let* ((cur-win (selected-window)) (aproc-buf (process-buffer aproc)) (aproc-wins (if (equal aproc-buf (current-buffer)) (list (cons cur-win (point-marker))))) aproc-buf-point) (while (not (equal cur-win (select-window (next-window (selected-window))))) (if (equal aproc-buf (current-buffer)) (setq aproc-wins (append aproc-wins (list (cons (selected-window) (point-marker))))))) (save-excursion (set-buffer aproc-buf) (setq aproc-buf-point (point-marker)) (goto-char (process-mark aproc)) (insert-before-markers output) (set-marker (process-mark aproc) (point)) (if initial (run-hooks 'a-first-output-hook)) (goto-char aproc-buf-point)) (mapcar '(lambda (glom) (set-window-point (car glom) (cdr glom))) aproc-wins)))) (defun a-other-window (&optional mbytes loadfile) "Starts `a' interpreter in other window" (interactive) (let ((newbuf (null (get-buffer a-buffer-name)))) (pop-to-buffer a-buffer-name) (a mbytes loadfile newbuf) (add-submenu nil a-menubar) (add-submenu nil a-options-menubar) ) ) (defun a-adjacent-window (&optional mbytes loadfile) "Starts `a' interpreter in other window but stays in current window" (interactive) (let ((cbuf (current-buffer))) (a-other-window mbytes loadfile) (pop-to-buffer cbuf))) (defun a-interrupt-process()(interactive)(interrupt-process)) (defun a-quit-process()(interactive)(quit-process)) (defun a-kill-process () (interactive) (if a-host (quit-process) (kill-process))) (defun a-goto-last-input()(interactive)(goto-char last-input-start)) (defun a-recall-last-input () (interactive) (let ((here (point))) (insert (buffer-substring last-input-start last-input-end)) (if a-track-beginning-of-expression (goto-char here)))) (defvar last-input-start nil "Marker for start of last unit of input.") (defvar last-input-end nil "Marker for end of last unit of input.") (defun a-show-output () "Display start of this batch of output at top of window. Also put cursor there." (interactive) (goto-char last-input-end) (forward-char) (recenter 0)) (defun a-kill-output () "Kill all output since last input." (interactive) (kill-region last-input-end (point-max)) (goto-char (point-max)) (insert " output flushed \n")) (defun a-send-input () "Send input to `a' process. At end of buffer, sends all text after last output as input to the process, including a newline inserted at the end. When not at end, copies current line to the end of the buffer, after first attempting to discard any prompt at the beginning of the line by matching the regexp that is the value of a-prompt-pattern if possible. This regexp should start with \"^\"." (interactive) (let* ((proc (get-buffer-process (current-buffer))) (junk (or proc (error "Current buffer has no process"))) (cur (point)) (beg (progn (beginning-of-line) (re-search-forward a-prompt-pattern nil t) (point))) (end (progn (end-of-line) (point))) (max (point-max))) (if (eobp) (progn (move-marker last-input-start (process-mark proc)) (move-marker last-input-end (point)) (insert ?\n) (process-send-region proc beg (point)) (set-marker (process-mark proc) (point))) (goto-char (point-max)) (insert (buffer-substring beg end)) (goto-char (+ max (if (> cur beg) (- cur beg) 0)))))) (defun a-send-line() (interactive) (let* ((cur-win (selected-window)) (cur-buf (current-buffer)) (aproc-buf (get-buffer a-buffer-name)) (aproc (get-buffer-process aproc-buf)) (aproc-wins (if (equal aproc-buf (current-buffer)) (list (cons cur-win (point-marker))))) s) (while (not (equal cur-win (select-window (next-window (selected-window))))) (if (equal aproc-buf (current-buffer)) (setq aproc-wins (append aproc-wins (list (cons (selected-window) (point-marker))))))) (save-excursion (setq s (concat (buffer-substring (progn (beginning-of-line) (if (equal aproc-buf (current-buffer)) (re-search-forward a-prompt-pattern nil t)) (point)) (progn (end-of-line) (point))) "\n")) (a-other-window) (goto-char (point-max)) (insert-before-markers s) (process-send-string aproc s) (pop-to-buffer cur-buf)) (mapcar '(lambda (glom) (set-window-point (car glom) (cdr glom))) aproc-wins) (next-line 1))) (defun a-send-substr(start end describe) (let* ((cbuf (current-buffer)) (fname (expand-file-name (format "%s/#emacs_a%d.%d" a-tmp-dir a-invocation (setq a-load-sequence (1+ a-load-sequence))))) (cmd (concat a-load-prefix fname "\n")) (aproc)) (write-region start end fname nil 'nomessage) (a-other-window) (setq aproc (get-buffer-process (current-buffer))) (goto-char (point-max)) (or a-quiet (insert (concat a-load-comment describe "\n"))) (set-marker (process-mark aproc) (point)) (process-send-string aproc cmd) (pop-to-buffer cbuf))) ;;(defun a-send-func () ;; (interactive) ;; (let ((pos (point))) ;; (end-of-line) ;; (let ((depth (car (parse-partial-sexp (point-min) (point)))) ;; (parse-sexp-ignore-comments t) ;; (orig (point)) ;; after-colon ;; start) ;; (if (if (> depth 0) ;; (condition-case err ;; (up-list depth) ;; (error (progn ;; (goto-char orig) ;; (setq parse-sexp-ignore-comments nil) ;; (up-list (- depth)) ;; (push-mark pos) ;; 'error)))) ;; (error "Unbalanced parentheses start here (C-x C-x to go back)") ;; (end-of-line) ;; (re-search-backward "^[^\'\"]+:" nil 'move) ;; (setq after-colon (match-end 0)) ;; (backward-list (car (parse-partial-sexp (point-min) (point)))) ;; (beginning-of-line) ;; (setq start (point)) ;; (goto-char after-colon) ;; (if (eolp) (forward-char)) ;; (end-of-line) ;; (up-list (car (parse-partial-sexp after-colon (point)))) ;; (forward-line) ;; (a-send-substr ;; start ;; (point) ;; (buffer-substring start (1- after-colon))) ;; (goto-char pos))))) ;;;; a-send-func from ik (defun a-send-func () (interactive) (let ((pos (point))) (end-of-line) (let* ((expr (parse-partial-sexp (point-min) (point))) (depth (car expr)) (instring (nth 3 expr)) (parse-sexp-ignore-comments t) (orig (point)) after-colon start) (if instring (goto-char instring)) (if (if (> depth 0) (condition-case err (up-list depth) (error (progn (goto-char orig) (setq parse-sexp-ignore-comments t) (up-list (- depth)) (push-mark pos) 'error)))) (error "Unbalanced parentheses start here (C-x C-x to go back)") (end-of-line) (re-search-backward "^[^\'\"]+:" nil 'move) (setq after-colon (match-end 0)) (backward-list (car (parse-partial-sexp (point-min) (point)))) (beginning-of-line) (setq start (point)) (goto-char after-colon) (if (eolp) (forward-char)) (end-of-line) (up-list (car (parse-partial-sexp after-colon (point)))) (forward-line) (a-send-substr start (point) (buffer-substring start (1- after-colon))) (goto-char pos))))) ;;;; !! CURRENTLY BROKEN (a-send-func) !! ;;;; ==================================================================== ;;;; a-send-func.............................................070397 NRL ;;;; ==================================================================== ;;;; This defun will try to send A+ function def block to A+ interpreter ;;;; using Emacs Lisp parser. Inevitably, there is a difference between A+ ;;;; language syntax against Emacs Lisp s-expression syntax. ;;;; For example, there are two types of strings in A+; In double quoted ;;;; strings, the '\' is an escape char. But in single quoted strings, '\' ;;;; is not. This causes problem in Emacs char syntax definition because ;;;; only one syntax class for each char. ;;;; So, there is problem for Emacs Lisp parser to deal with the following ;;;; A+ single quoted string : ;;;; 'abc''cd\' ;;;; which is an error in Emacs Lisp s-expression parse. In this case, ;;;; I print out a message "Please double check your single quoted string." ;;;; But "abc\"cd" is ok as long as we define '\' with the escape syntax ;;;; clase "\\". ;;;; ============================================================================ ;;;; change the syntax class for "\\"; add the following line to syntax table ;;;; (modify-syntax-entry ?\\ "\\" a-mode-syntax-table) ;;;; ============================================================================ ;;(defun a-send-func () ;; (interactive) ;; (let ((pos (point)) ;; where ;; func-start ;; after-colon) ;; (debug) ;; (end-of-line) ; in case the cursor is before ':' ;; (setq where (point)) ;; (re-search-backward "^[^\'\"]+:" nil 'move) ; orginal ;; (re-search-backward "^[^\'\"]+:" nil 'move) ;; (setq func-start (point)) ;; (setq after-colon (match-end 0)) ;; (let* ((s1-state (parse-partial-sexp func-start where)) ;; (func-end (point)) ;; (parse-sexp-ignore-comments t) ;; (depth (car s1-state)) ; depth of parenthesis ;; (q-char (nth 3 s1-state)) ;if non-nil, the starting strng quote char ;; (orig (point)) ;; s2-state ;; ) ;; ;; check depth and move to the end of func def ;; (if (> depth 0) ; check if cursor in unbalanced parenthesis ;; (progn ; try to parse more to balance parenthesis ;; (setq s2-state (parse-partial-sexp (point) (point-max) (- depth) nil s1-state)) ;; (setq func-end (point)) ;; (setq q-char (nth 3 s2-state)) ;; (cond ((not (null q-char)) ;; (if (char-equal q-char ?\') ;; (message ;; "PLease double check your single quoted strings."))) ;; ((= 0 (car s2-state)) t) ;depth should be zero by now. ;; (t (progn ; otherwise error for unbalanced parenthesis ;; (goto-char (nth 1 s1-state)) ;; (push-mark pos) ;; (error "Unbalanced parentheses start here (C-x C-x to goback)")))) ;; )) ;; end of progn ;; end of if depth > 0 ;; (a-send-substr ;; func-start ;; func-end ;; (point) ;; (buffer-substring func-start (1- after-colon))) ;; (goto-char pos)))) (defun a-send-region () (interactive) (a-send-substr (region-beginning) (region-end) "region")) (defun a-send-buffer () (interactive) (a-send-substr (point-min) (point-max) (concat "buffer " (buffer-name)))) (defun change-assoc (key value alist) "usage: (change-assoc KEY VALUE ALIST) If ALIST contains KEY then replace the associated value with VALUE. Otherwise, associate KEY and VALUE in the alist" (let ((tuple (assoc key alist))) (cond (tuple (setcdr tuple value)) (t (nconc alist (list (cons key value))))))) (change-assoc "\\.apl$" 'a-minor-mode auto-mode-alist) (change-assoc "\\.a$" 'a-minor-mode auto-mode-alist) (change-assoc "\\.\\+$" 'a-minor-mode auto-mode-alist) (change-assoc "\\.z$" 'a-minor-mode auto-mode-alist) (defvar a-prog-default "a+") (defvar a-path-default "/usr/local/lib/aplus-") ;(cond ((string-equal (getenv "SYS_FIRIS") "FID") ; (defvar a-path-default "/usr/local/a+_") ; ) ; ((string-equal (getenv "SYS_FIRIS") "IS" ) ; (defvar a-path-default "/ms/dist/aplus/PROJ/aplus/") ; ) ;) (defun toggle-a-prog (arg) (interactive "P") (message (setq a-prog (if (equal a-prog new-a-prog) old-a-prog new-a-prog))) ) (defun set-a-prog-builtin () (interactive) (let ((arg (read-from-minibuffer (concat "Change a-prog to [" a-prog-default "]: ") nil nil nil))) (if (equal (length arg) 0) (setq arg a-prog-default)) (setq a-plus t) (message (concat "Setting a-prog to \"" (setq a-prog (cond ; a+_1a 1a ((string-match "^\\(a\\+_\\)?\\([0-9]+a\\)$" arg) (build-prog-name a-path-default "/bin/a+" arg 2)) ; a+_1b1 1b1 ((string-match "^\\(a\\+_\\)?\\([0-9]+b[0-9]+\\)$" arg) (build-prog-name a-path-default "/bin/a+" arg 2)) ; a+_1.01 1.01 ((string-match "^\\(a\\+_\\)?\\([0-9]+\\.[0-9]+\\)$" arg) (build-prog-name a-path-default "/bin/a+" arg 2)) ; a aX a_82 aX_82 a_latest aX_latest ((string-match "^a\\(X\\)?\\(_[0-9a-zA-Z]+\\)?$" arg) (progn (setq a-plus nil) (concat "/usr/local/bin/a" (if (match-beginning 1) "X") (if (match-beginning 2) (substring arg (match-beginning 2) (match-end 2)))))) ; a+_m1.maus m1.maus ((string-match "^\\(a\\+_\\)?m\\([0-9]+\\)\\.\\([a-z]+\\)$" arg) (build-prog-name "/u/src/usr/local/a+_" (concat "/" (substring arg (match-beginning 3) (match-end 3)) "/" (getenv "ID_EXEC") "/bin/a+") arg 2)) ; a+_m1 m1 ((string-match "^\\(a\\+_\\)?m\\([0-9]+\\)$" arg) (build-prog-name "/u/src/usr/local/a+_" (concat "/" (getenv "ID_EXEC") "/bin/a+") arg 2)) ; a+_dev.maus dev.maus ((string-match "^\\(a\\+_\\)?dev\\.\\([a-z]+\\)$" arg) (build-prog-name "/u/aplus/" (concat "/" (getenv "ID_EXEC") "/bin/a+") arg 2)) ; a+_dev dev ((string-match "^\\(a\\+_\\)?dev$" arg) (concat "/u/aplus/" (getenv "ID_EXEC") "/bin/a+")) ; a+ a+_1 ((string-match "^a\\+\\(_[0-9]+\\)?$" arg) (concat "/usr/local/a+" (if (match-beginning 1) (substring arg (match-beginning 1) (match-end 1))) "/bin/a+")) ; 1 ((string-match "^\\([0-9]+\\)$" arg) (concat a-path-default arg "/bin/a+")) ; ont ((string-match "^ont$" arg) "/usr/local/a+_ont/bin/a+") ; default ((string-match "^default$" arg) "/ms/dist/aplus/bin/a+") ; x.latest ((string-match "^\\([0-9]+.latest\\)$" arg) (concat a-path-default arg "/bin/a+")) ; x.dev ((string-match "^\\([0-9]+.dev\\)$" arg) (concat a-path-default arg "/bin/a+")) ; anything else (t arg ))) "\"")))) (defun build-prog-name (before after arg match) (concat before (substring arg (match-beginning match) (match-end match)) after)) (defvar a-mode-string "A") (setq-default mode-line-modified '("-%*%*-")) (setq-default mode-line-format (list "" 'a-mode-string 'mode-line-modified 'mode-line-buffer-identification " " 'global-mode-string " %[(" 'mode-name 'minor-mode-alist "%n" 'modeline-process ")%]----" '(-3 . "%p") "-%-")) ;;;========================================================================= ;;; isearch fix for A+ (setq search-exit-option nil) ; "Non-nil means random control characters terminate incremental search." (define-key isearch-mode-map "\M-n" nil) (define-key isearch-mode-map "\M-p" nil) (define-key isearch-mode-map [(meta right)] 'isearch-ring-advance) (define-key isearch-mode-map [(meta left)] 'isearch-ring-retreat) (define-key minibuffer-local-isearch-map "\M-n" nil) (define-key minibuffer-local-isearch-map "\M-p" nil) (define-key minibuffer-local-isearch-map [(meta right)] 'isearch-ring-advance) (define-key minibuffer-local-isearch-map [(meta left)] 'isearch-ring-retreat) (defun a-isearch-printing-char () "Any other A+ printing character => add it to the search string and search." (interactive) (setq xev (copy-event last-command-event)) (setq key (event-to-character xev t t t)) (setq last-command-char (aref a-key-string key)) (isearch-process-search-char last-command-char)) (put 'a-isearch-printing-char 'isearch-command t) ;; Redefinition for A+ (defun isearch-maybe-frob-keyboard-macros () ;; ;; If the command about to be executed is `self-insert-command' then change ;; the command to `isearch-printing-char' instead, meaning add the last- ;; typed character to the search string. ;; ;; If `this-command' is a string or a vector (that is, a keyboard macro) ;; and it contains only one command, which is bound to self-insert-command, ;; then do the same thing as for self-inserting commands: arrange for that ;; character to be added to the search string. If we didn't do this, then ;; typing a compose sequence (a la x-compose.el) would terminate the search ;; and insert the character, instead of searching for that character. ;; ;; We should continue doing this, since it's pretty much the behavior one ;; would expect, but it will stop being so necessary once key-translation- ;; map exists and is used by x-compose.el and things like it, since the ;; translation will have been done before we see the keys. ;; (cond ((eq this-command 'self-insert-command) (setq this-command 'isearch-printing-char)) ((eq this-command 'a-self-insert) (setq this-command 'a-isearch-printing-char)) ((and (or (stringp this-command) (vectorp this-command)) (eq (key-binding this-command) 'self-insert-command)) (setq last-command-event (character-to-event (aref this-command 0)) last-command-char (and (stringp this-command) (aref this-command 0)) this-command 'isearch-printing-char)) )) ;;;========================================================================= ;;; gdb fix for A+ (defun gdb-patch () "Redefines GDB mode keymap to remove conflicts with A+" (interactive) (define-key gdb-mode-map "\M-i" nil) (define-key gdb-mode-map "\M-s" nil) (define-key gdb-mode-map "\M-?" nil) (define-key gdb-mode-map "\C-c\M-i" 'gdb-stepi) (define-key gdb-mode-map "\C-c\M-s" 'gdb-step) (define-key gdb-mode-map [(meta tab)] 'comint-dynamic-list-completions) ) (defvar gdb-mode-hook 'gdb-patch "Function to run after gdb-mode initialization") ;;;========================================================================= ;;; comint fix for A+ (defun comint-patch () "Redefines COMINT mode keymap to remove conflicts with A+" (interactive) (define-key comint-mode-map "\M-n" nil) (define-key comint-mode-map "\M-p" nil) (define-key comint-mode-map "\M-r" nil) (define-key comint-mode-map "\M-s" nil) (define-key comint-mode-map "\M-?" nil) (define-key comint-mode-map [(meta right)] 'comint-next-matching-input-from-input) (define-key comint-mode-map [(meta left)] 'comint-previous-matching-input-from-input) (define-key comint-mode-map [(meta down)] 'comint-next-matching-input) (define-key comint-mode-map [(meta up)] 'comint-previous-matching-input) (define-key comint-mode-map [(meta tab)] 'comint-dynamic-list-completions) ) (defvar comint-mode-hook 'comint-patch "Function to run after comint-mode initialization") (provide 'a) ;; -If you are looking at a read-only file and type C-x C-q to get to write ;; mode, xemacs will also check out and lock the file without telling you. ;; ;; -If you try to edit an rcs file that has been removed, xemacs will check ;; the file out read only without telling you. For example, if you try to edit ;; /u/d/sts_ny_trader/code2/swfheader.a (which has an rcs log), xemacs will ;; create the file by checking it out of rcs. This puts an out-of-date file ;; into ny_trader/code2 without your even realizing it. ;; (setq find-file-not-found-hooks nil) (define-key global-map [(control x) (control q)] 'toggle-read-only) aplus-fsf-4.22/src/lisp.0/aplus.el0000444000265000001440000000124210304471076012357 ;; Copyright (c) 2001 Morgan Stanley Dean Witter and Co. All rights reserved. ;; See .../src/LICENSE for terms of distribution. ;; Loads the Aplus specific settings for xemacs ;; (setq load-path (append '("/usr/local/aplus-fsf-4.20/lisp.0") load-path ) ) ;; ;; Load Aplus and set defaults ;; (load "xa" nil t) (setq a-prog "/usr/local/bin/a+") (setq a-plus t) ;;(setq a-plus-without-s t) ;;(setq a-plus-rest '("u" "arg0" "arg1")) ;;(setq a-mbytes 4) ;;(setq a-mbytes-threshold 256) ;; ;; ;; Load User's custom Aplus Settings ;; (cond ((file-readable-p "~/.custom/a-options.el") (load-file "~/.custom/a-options.el") ) ) aplus-fsf-4.22/src/lisp.0/keyb.el0000444000265000001440000001317207232127002012163 ;; Copyright (c) 2001 Morgan Stanley Dean Witter and Co. All rights reserved. ;; See ..../src/LICENSE for terms of distribution. (defvar a-key-string nil "Apl characters corresponding to raw keyboard input") (defvar xev nil) (defvar key nil) (defun a-self-insert (n) (interactive "p") (or n (setq n 1)) (setq xev (copy-event last-command-event)) (setq key (event-to-character xev t t t)) (setq last-command-char (aref a-key-string key)) (self-insert-command n)) (setq a-minor-map nil) (if a-minor-map nil (setq a-minor-map (make-sparse-keymap)) (setq a-key-string (make-string 256 ?\000)) (let ((n 32)) (while (< n 256) (aset a-key-string n n) (setq n (1+ n)))) (mapcar #'(lambda (akeydef) (let ((key (car akeydef)) (apl (cdr akeydef))) (define-key a-minor-map (list 'meta (- key 128)) 'a-self-insert) (aset a-key-string key apl))) '((?\M-a . ?\301) ; A (2) (?\M-b . ?\302) ; B (?\M-c . ?\303) ; (?\M-d . ?\304) ; D (?\M-e . ?\305) ; (?\M-f . ?_) ; _ (?\M-g . ?\307) ; G (?\M-h . ?\310) ; H (?\M-i . ?\311) ; (?\M-j . ?\312) ; J (?\M-k . ?\') ; ' (?\M-l . ?\314) ; L (?\M-m . ?|) ; | (?\M-n . ?\316) ; N (?\M-o . ?\317) ; (?\M-p . ?\*) ; * (?\M-q . ?\?) ; ? (?\M-r . ?\322) ; R (?\M-s . ?\323) ; (?\M-t . ?\~) ; ~ (?\M-u . ?\325) ; (?\M-v . ?\326) ; V (?\M-w . ?\327) ; W (1) (?\M-x . ?\330) ; (?\M-y . ?\331) ; (?\M-z . ?\332) ; (?\M-1 . ?\241) ; ! (?\M-2 . ?\242) ; (?\M-3 . ?<) ; < (?\M-4 . ?\244) ; $ (?\M-5 . ?=) ; = (?\M-6 . ?\246) ; (?\M-7 . ?>) ; > (?\M-8 . ?\250) ; ( (?\M-9 . ?\251) ; ) (?\M-0 . ?^) ; ^ (?\M-- . ?\253) ; + (?\M-= . ?\337) ; (?\M-\\ . ?\334); (?\M-` . ?\376) ; ~ (?\M-, . ?\254) ; , (?\M-[ . ?\373) ; { (?\M-] . ?\375) ; } (?\M-; . ?\333) ; [ (?\M-' . ?\335) ; (?\M-. . ?\334) ; (?\M-/ . ?\257) ; / (?\M-! . ?\340) ; ` (?\M-@ . ?\346) ; (?\M-# . ?\347) ; (?\M-$ . ?\350) ; h (?\M-% . ?\367) ; w (1) (?\M-^ . ?\364) ; t (?\M-& . ?\341) ; a (2) (?\M-* . ?\360) ; p (?\M-\( . ?\271); 9 (?\M-\) . ?\260); 0 (?\M-_ . ?!) ; ! (?\M-+ . ?\255) ; - (?\M-| . ?\374) ; | (check syntax table entry!) (?\M-O . ?\357) ; (?\M-J . ?\352) ; (?\M-F . ?\275) ; = (?\M-E . ?\345) ; e (?\M-I . ?\351) ; i (?\M-{ . ?\335) ; (?\M-} . ?\333) ; [ (?\M-S . ?\276) ; > (?\M-G . ?\347) ; (?\M-H . ?\350) ; h (?\M-L . ?\354) ; l (?\M-: . ?\274) ; (?\M-\" . ?\273); ; (?\M-C . ?\343) ; c (?\M-B . ?\342) ; b (?\M-N . ?\356) ; n (?\M-M . ?\315) ; (?\M-> . ?\256) ; . *** ??? (?\M-P . ?\263) ; 3 (?\M-Y . ?\264) ; 4 (?\M-Z . ?\372) ; z (?\M-Q . ?\277) ; (?\M-W . ?W) ; W (?\M-R . ?R) ; R (?\M-T . ?T) ; T (?\M-U . ?U) ; U (?\M-A . ?A) ; A (?\M-D . ?D) ; D (?\M-K . ?K) ; K (?\M-X . ?X) ; X (?\M-V . ?V) ; V (?\M-? . ?\?) ; ? (?\M-~ . ?~) ; ~ (?\M-< . ?<) ; < (?\M-\040 . ?\040) ) ; end of translation table ) ; end of mapcar ;; if we are running off of a tty, window-system is nil ;; in such a case, we need to handle all those events that get passed ;; as escape sequences (if window-system nil (global-unset-key "\C-h") (global-set-key "\C-h" 'backward-delete-char) (define-key esc-map "[" nil) (define-key esc-map "O" nil) (mapcar #'(lambda (akeydef) (let ((key (car akeydef)) (apl (cdr akeydef))) (define-key esc-map key apl) )) '( ("[224z" . a-send-region) ; f1 ("[225z" . a-send-line) ; f2 ("[226z" . a-send-func) ; f3 ("[227z" . a-other-window) ; f4 ("[228z" . delete-other-windows) ; f5 ("[229z" . other-window-or-pop) ; f6 ("[230z" . next-buffer) ; f7 ("[231z" . previous-buffer) ; f8 ("[232z" . enlarge-window) ; f9 ("[233z" . shrink-window) ; f10 ("[209z" . print-buffer) ; PrintScreen ("[210z" . scroll-down-in-place) ; Scroll ("[5z" . scroll-down) ; pgup ("[216z" . scroll-down) ; pgup ("[6z" . scroll-up) ; pgdn ("[222z" . scroll-up) ; pgdn ("[214z" . beginning-of-line) ; home ("[220z" . end-of-line) ; end ("[2z" . overwrite-mode) ; insert ("OA" . previous-line) ; up-arrow ("OB" . next-line) ; down-arrow ("OC" . forward-char) ; right-arrow ("OD" . backward-char) ; left-arrow ) ; end of translation table ) ; end of mapcar ) ; end of if window-system nil ) ; end of if a-minor-map (define-key a-minor-map "\C-c\C-a" 'a) (define-key a-minor-map "\C-c\C-r" 'a-send-region) (define-key a-minor-map "\C-c\C-l" 'a-send-line) (define-key a-minor-map "\C-c\C-f" 'a-send-func) (define-key a-minor-map "\C-c\C-b" 'a-send-buffer) (define-key a-minor-map '(escape) esc-map) (setq a-mode-map nil) (if a-mode-map nil (setq a-mode-map (make-sparse-keymap))) (define-key a-mode-map "\C-m" 'a-send-input) (define-key a-mode-map "\C-c\C-c" 'a-interrupt-process) (define-key a-mode-map "\C-c\C-k" 'a-kill-process) (define-key a-mode-map "\C-c\C-q" 'a-quit-process) (define-key a-mode-map "\C-c\C-s" 'a-show-output) (define-key a-mode-map "\C-c\C-o" 'a-kill-output) (define-key a-mode-map "\C-c\C-p" 'a-goto-last-input) (define-key a-mode-map "\C-c\C-m" 'a-recall-last-input) (if (not (assq 'a-minor minor-mode-alist)) (setq minor-mode-alist (cons '(a-minor " A") minor-mode-alist))) (provide 'keyb) aplus-fsf-4.22/src/lisp.0/xa.el0000444000265000001440000000431207232127044011643 ;; Copyright (c) 2001 Morgan Stanley Dean Witter and Co. All rights reserved. ;; See .../src/LICENSE for terms of distribution. (require 'keyb) (require 'a) ; Interactively set a-prog (global-set-key "\C-ca" 'set-a-prog-builtin) (global-set-key 'f1 'a-send-region) (global-set-key 'f2 'a-send-line) (global-set-key 'f3 'a-send-func) (global-set-key 'f4 'a-other-window) (global-set-key 'f5 'delete-other-windows) (global-set-key 'f6 'other-window-or-pop) (global-set-key 'f7 'next-buffer) (global-set-key 'f8 'previous-buffer) (global-set-key 'f9 'enlarge-window) (global-set-key 'f10 'shrink-window) (global-set-key 'scroll 'scroll-down-in-place) (global-set-key '(shift scroll) 'scroll-up-in-place) (global-set-key 'prsc 'print-buffer) (global-set-key 'props 'toggle-a-minor-mode) (global-set-key 'backspace 'backward-delete-char-untabify) (define-key esc-map "h" 'help-for-help) (defun other-window-or-pop() "Goto next window or if only one window pop previous buffer in other window" (interactive) (let* ((win1 (selected-window)) (win2 (progn (other-window 1) (selected-window)))) (and (eq win1 win2) (switch-to-buffer-other-window nil)))) (defun scroll-down-in-place (n) (interactive "p") (previous-line n) (scroll-down n)) (defun scroll-up-in-place (n) (interactive "p") (next-line n) (scroll-up n)) (defun previous-buffer () "Switch to previous buffer." (interactive) (switch-to-buffer (other-buffer))) (defun next-buffer () "Switch to next buffer." (interactive) (switch-to-buffer (if (eq last-command 'next-buffer) (first-normal-buffer (reverse (buffer-list))) (other-buffer)))) (defun first-normal-buffer (buflist) (if (null buflist) nil (let ((buf1 (buffer-name (car buflist)))) (if (equal " " (substring buf1 0 1)) (first-normal-buffer (cdr buflist)) buf1)))) (defun kill-current-buffer () "Kills the current buffer if no process." (interactive) (if (get-buffer-process (current-buffer)) (message "Buffer not killed -- Buffer has process") (if buffer-file-name (if (buffer-modified-p (current-buffer)) (message "Buffer not killed -- Buffer is modified") (kill-this-buffer)) (kill-this-buffer) ) ) ) aplus-fsf-4.22/src/fonts/0000777000265000001440000000000010774512701011026 5aplus-fsf-4.22/src/fonts/Makefile.am0000444000265000001440000000120307244572245012777 ## Process this file with automake to produce Makefile.in ############################################################################### ## ## ## Copyright (c) 2001 Morgan Stanley Dean Witter and Co. All rights reserved.## ## See .../src/LICENSE for terms of distribution. ## ## ## ## ## ############################################################################### SUBDIRS = TrueType X11 aplus-fsf-4.22/src/fonts/Makefile.in0000644000265000001440000002374310774512523013022 # Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ ############################################################################### ############################################################################### SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CXX = @CXX@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ STRIP = @STRIP@ VERSION = @VERSION@ X_INCLUDES = @X_INCLUDES@ X_LIBS = @X_LIBS@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ SUBDIRS = TrueType X11 subdir = src/fonts mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_CLEAN_FILES = DIST_SOURCES = RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ uninstall-info-recursive all-recursive install-data-recursive \ install-exec-recursive installdirs-recursive install-recursive \ uninstall-recursive check-recursive installcheck-recursive DIST_COMMON = Makefile.am Makefile.in DIST_SUBDIRS = $(SUBDIRS) all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/fonts/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ETAGS = etags ETAGSFLAGS = tags: TAGS 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; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ fi; \ done; \ 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; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = ../.. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d $(distdir)/$$subdir \ || mkdir $(distdir)/$$subdir \ || exit 1; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" \ distdir=../$(distdir)/$$subdir \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_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-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: info: info-recursive info-am: install-data-am: install-exec-am: install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool uninstall-am: uninstall-info-am uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \ clean-generic clean-libtool clean-recursive distclean \ distclean-generic distclean-libtool distclean-recursive \ distclean-tags distdir dvi dvi-am dvi-recursive info info-am \ info-recursive install install-am install-data install-data-am \ install-data-recursive install-exec install-exec-am \ install-exec-recursive install-info install-info-am \ install-info-recursive install-man install-recursive \ install-strip installcheck installcheck-am installdirs \ installdirs-am installdirs-recursive maintainer-clean \ maintainer-clean-generic maintainer-clean-recursive mostlyclean \ mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \ tags tags-recursive uninstall uninstall-am uninstall-info-am \ uninstall-info-recursive uninstall-recursive # 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: aplus-fsf-4.22/src/fonts/TrueType/0000777000265000001440000000000010774512701012607 5aplus-fsf-4.22/src/fonts/TrueType/Makefile.am0000644000265000001440000000130507232126456014561 ## Process this file with automake to produce Makefile.in ############################################################################### ## ## ## Copyright (c) 2001 Morgan Stanley Dean Witter and Co. All rights reserved.## ## See .../src/LICENSE for terms of distribution. ## ## ## ## ## ############################################################################### TrueTypedir = $(prefix)/fonts/TrueType TrueType_DATA = KAPL.TTF EXTRA_DIST = KAPL.TTF aplus-fsf-4.22/src/fonts/TrueType/Makefile.in0000644000265000001440000001515010774512523014574 # Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ ############################################################################### ############################################################################### SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../.. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CXX = @CXX@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ STRIP = @STRIP@ VERSION = @VERSION@ X_INCLUDES = @X_INCLUDES@ X_LIBS = @X_LIBS@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ TrueTypedir = $(prefix)/fonts/TrueType TrueType_DATA = KAPL.TTF EXTRA_DIST = KAPL.TTF subdir = src/fonts/TrueType mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_CLEAN_FILES = DIST_SOURCES = DATA = $(TrueType_DATA) DIST_COMMON = Makefile.am Makefile.in all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/fonts/TrueType/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: TrueTypeDATA_INSTALL = $(INSTALL_DATA) install-TrueTypeDATA: $(TrueType_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(TrueTypedir) @list='$(TrueType_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(TrueTypeDATA_INSTALL) $$d$$p $(DESTDIR)$(TrueTypedir)/$$f"; \ $(TrueTypeDATA_INSTALL) $$d$$p $(DESTDIR)$(TrueTypedir)/$$f; \ done uninstall-TrueTypeDATA: @$(NORMAL_UNINSTALL) @list='$(TrueType_DATA)'; for p in $$list; do \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " rm -f $(DESTDIR)$(TrueTypedir)/$$f"; \ rm -f $(DESTDIR)$(TrueTypedir)/$$f; \ done tags: TAGS TAGS: DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = ../../.. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: $(mkinstalldirs) $(DESTDIR)$(TrueTypedir) 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_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_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-generic clean-libtool mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-TrueTypeDATA install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool uninstall-am: uninstall-TrueTypeDATA uninstall-info-am .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am info info-am install install-TrueTypeDATA install-am \ install-data install-data-am install-exec install-exec-am \ install-info install-info-am install-man install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool uninstall uninstall-TrueTypeDATA \ uninstall-am uninstall-info-am # 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: aplus-fsf-4.22/src/fonts/TrueType/KAPL.TTF0000444000265000001440000013176007252261017013635 pOS/2SO\xVVDMXaIhTcmap.34cvt ,d H6fpgm` ggasp glyf nhead׻|h6hhea$hmtxF2,loca=`Pmaxpg nameh^CpostdprepUtzX2 MACR@ !           !"#$%&'()*+, -!.!/"0#1#2$3%4&5&6'7(8(9):*;+<+=,>-?-@.A/B/C0D1E2F2G3H4I4J5K6L7M7N8O9P9Q:R;S<T<U=V>W>X?Y@ZA[A\B]C^C_D`EaFbFcGdHeHfIgJhKiKjLkMlMmNnOoPpPqQrRsRtSuTvUwUxVyWzW{X|Y}Y~Z[\\]^^_`aabccdeffghhijkklmmnoppqrrstuuvwwxyzz{||}~  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[opqs|f^_bidhc}gak]en{`jmtlrvwxuzy~ &~ ' bcdefghijklmnopqrstuvwxyz{|}~)Hu0/~,O}nwCZiZiZi@,vE %E#ah#h`D- ,K PXY _^- , EiD`- , *!- , F%FRX#Y Id F had%F hadRX#eY/ SXi TX!@Yi TX!@eYY:-, F%FRX#Y F jad%F jadRX#Y/-,K &PXQXD@DY!! EPXD!YY-, EiD` E}iD`-,*-,K &SX@Y &SX&!#Y &SX#!#Y &SX%E@PX#!@#!%E#!#!Y!YD-,KSXED!!Y-CI$I@%%@&"  "Fv/7?//<<...10Ih"%Iha@RX87%8Y201#"'&547547&'&'&546  I14$/$*  vg!@@""@# Fv/7/QB"#>  GL'>d  0^Q\ZR^2 3lo^-Sug#@@$$@%" Fv/7/767+"'&/&'#"&547676767&'&'&547676545&5474;2% %4 ! /, >  !1   $G &+   M"% >"    6  C #\@&$$@%#   Fv/7//7&'&'&54767632( ;  ) $o) !       ^;@@   Fv/7// %"49(5J54HD244B"P)._IE0] .4F"?/M(Y;?\-SRVrlP#+X T@!!@" Fv/7?76!',' & ? "   % %1 (, )6   &?$kUj@*VV@W M&%Q87* CA21/;=FFv/7?326767054&#"#"'&547>:X* A*?    +! C! 2 $ 4 =)/   CP6 (-(\.m #4 !#  $(15+S(-k@...@/ #"%+*"Fv/7?"-   d*3 ^:n@,;;@<21%$754! +) Fv/7?72;26=4'&'0#"+&=&5476)+ H38+-T -) !;(3)(/Fv/7?A   (- ,l!!+ 1#728YIJ(1GA55Cfb@%@   Fv/7?=65 (' /:9$2,+Fv/7?//<<//<........10IhAIha@RX87A8Y2#"'&'&5476767&5476";2656&";26=4&L)& #(= ,+=  ?/%G114'139+8;$$Fv/7?//...........10IhAIha@RX87A8Y"'&'&5476323267>54'+"&547>32326541.'&!%$6&# 5FR)B%1"<,"%$1<A14<?  "R bCD0!5?:xZ(=22GN*4DMk&D@''@($ Fv/7?72#"&'&546       #y    )Yj!7O@88@9  2'&-""  Fv/7///<<........10Ih 8Iha@RX8788Y%&=47327>7&'&'&547632'2#"'.5467>@ +   ;   vR%#     &    lJ`@#@    Fv/7//.ć.......10IhIha@RX878Y632#"'%&=47    s{   Ze O@!!@"  Fv/7/323>;0327676541&'&#"1327676320#"'&'&54767676321&'&#"327&=476m   $&F%" I:3  % *(X %B'%+A .$' '?C   ? %A1>?   :53 9B 270-.O4785; L.1"   $1."MCJ ?(2K(2@A33@41*)* *+$##$ .,+((&#"*+&Fv/7?, $$%##$3NL #".TR>%$6C:8+<EC?AFv/7?67654&'&#"##"632032767>545&'&#"1&~J z> ]0 2 ,1#  /n? 74,Rg/D  0!1"2,5 E&!_1 1I3!   (#&; )5"HRe@(SS@T ; = " 0K(&54EEKFv/7?76320#"'&547454'&'0#";2767632#"'&'&54767676D/?   1 '!5/+ ?3,-$ ("/s1  %BY*H# ! %  A  $7,8*f01?7J\SK%  E?@y@@@A&%:61*  667556    ! --.,,- 667556  667556 76 54 -.-?1Fv/7?3#4c ( b9  " /oW  En8 ?f    F2@m33@40/,  ,,-++,      ,,-++,!(-,   +*$%$2(Fv/7?3#&=7#32+"&56;#"=67"2\*]2v 0nV F fA   C  9Hah@*bb@c R$ Z6,: @>=DC7620JVKJZFv/7?)>  E   8=*('&AFv/7?73#"'5467 n  n~ E  +F7n@-88@9540/0 01$10)(  7Fv/7?73#"&546 & E lo#   E'@=((@)$!    !!" !"!  'Fv/7?73#"5463 un   QnG E  ~   6EE@VFF@G+(% >98/,%!  &%%&$% %&+*+, >==>D *A?>=<-,$#54 8Fv/7?;##"&56}  - !w/   0d ^ p  f'EG     KW    #F8@K99@:.541#" 01 12 ,++,21  8&Fv/7?<3 r dm'  /m/ k KS8  E !(2  ` BH*O@++@,'!  Fv/7??</76'&W0C.3V(3 I&hR.&#$EW8M? $1H4K7his3=2Mn/.*Z ='0R)Tk"X)E#0@B11@2(! '( ()-)(   $Fv/7?;#"&54zx22\3. ," )&% *)  F>   F3'  @n? 83,#.  # %3 0a?  bB)    Gik@*jj@k F7ecXKI>" V-+QO1;31>Fv/7?jIha@RX87j8Y632+&'&'.'&+"10#"'&'#"&547676763232167>7654'.'&'&'&50547>U/9     $"!I/P8.Ia50   @ 9;B%J"  cGH 120#3P*A $(D  61>(3  '!LJ'E%@M&&@' $#    %%$$%    %Fv/7?;2++"'&5467#"&547> 7J. lc/  bZI m K$  E N!/Q hO2Y 63  b,E+n@/,,@-  ($&% (Fv/7?<7 /( ' / E p  :dE5@M66@7.+)& 32/& %$%& &'.-./ -. ./  0/%$ 5Fv/7?<721, ,,-++,  >==>   ,+,- ==><<=&?><;9.-)(  #"54&Fv/7?3  4d  i6G |  -73 E      7E(@C))@*! '&   ((''((Fv/7?;"546    #  s R8d@%@   Fv/7//<.ć........10IhIha@RX878Y#"' #"'&=476;2'      %[";@@   Fv/7/7#"&543"32654'&@ (&=+ F0Q*0, &  * 9-QI04S6u  0)9![!N .!SP!RC]@#DD@E@+*8.- >&$4>48Fv/7??<...............10Ih8DIha@RX87D8Y2'"'&'.'&#"321676;2#"'&54767632676  2' E)0" G. F@<-E6 ,&(;>     4=Q )$' > / 1z\J+ %t;M@>NN@O2 <3 <2M3 34 8FD*(4 KJ$@>0.3$;(Fv/7?:Qf624 4-w0@;11@2)& &%%&" '&%$ -,"Fv/7??3676#7 0 Lf cO1 8'w ;  Z X,9! 8Iy@2JJ@K7 9(I9 BA/.$F*=; 4*(54Fv/7?<76;26&'0#"3267    Z26JLD : <;0/%$* =65 9Fv/7?FLn   vLT     Y   !2F!j@+""@#  Fv/7?73+3#'"&567'3+"=4673#"563N  *E   1( +")  Mx-v  u  |  !  Nwj@-@     Fv/7?D+2GF<;54( 'QP8BA/.hfDFv/7?</Fv/7?73654#"32+"5474673&'&'&5432>?' 6# y &=SG.G,   %G  X3   8"     1 ;+H@,,@-"!( Fv/7??<//..10Ih,Iha@RX87,8Y2+"'&'&547676";6767654'&=]) "A[ W.%IR$=*#&BJ1-#A,BR>&;=+D@.A3B783%04/L/0-'7@;88@9 *%!* )() ! !42, )("! Fv/7??|=K+X  "|, xDD7O2293LRJf(   - /*9+($N'-1C@EDD@E0" 2"! !" C2 ;9(! A?$54,.,$(Fv/7??10$ "!!"(&  E! E:9Fv/7?0DO     '2)1 /u!0Y !A 8K(G/Q:#Y. $   " H=#    J/  ,. E.#N;@D<<@= !52  ;:;22311 ;:;22311%//32;:  ++5Fv/7?//<</.ć.......10Ih57232+32767632#"'&54?#"547>73#F *+ %'$@+GC O7}     8 I8@=99@:%541 8 1001.21  '*)#"84Fv/7?<3=<%(9A. eP .&#'W/"  C +    !` C$}@7%%@& "      $"Fv/7?763254WG >$$?!'YH0/F!GKYT/4Y]'- , PT6 0%)h <@@ Fv/7//</<<10IhIha@RX878Y.546;2)  R]   [G+>@,,@-"" Fv/7//....10Ih,Iha@RX87,8Y"32#"327676763254#"'&'&'&~##F,, J[& ?##@ $G'KO 0 7 , ,&_Z4/SY"(;1=@@ Fv/7//......10IhIha@RX878Y4#"'.#"32763232  6' 4  $2%%#v 56 " BC @  +/+/01327654&7"3276=4'&$$SEt @ ++013!27654'&'f  S  t 6Kfs@>tt@u0XVO, k[QF0!r`_c;U! _^po&7KgB@7FFv/7??<3265&'&/"#"&'46;54&5476";27&!>9    &$ $  } m3   &:; 0  0 /  ,.}   J2  /  B   1  '+ >[' #j 2 @2*  +/+0132767654'&/767654'&'&#"3!2767&'&'        |r   )BZ@[[@\C6WSNKDC;:751*)"SSTZRQR SSTZRQR IJ 77866756 67#""#  TSZLK! RQ875&$#4-?>.- Fv/7?;232+32# d i } ~  G   |  -63 {  | }  e7 7A         A [:\nd@&oo@p)e].i_PNG=*) [5%V%WV[Fv/7/32#"'&'.#"+"'&'&7656'&'&'h CL !N   M7<    B*" " 3I*><;; -#   -?!     2"   7" !i) ! #].C-@88!!// ; C;C  * +/++//+//0172?3276=4'&+7327674'&+76=&'&#"#";#"3/ @  VD  (( 8  Zd  =  Z z9   Q z S9 @ +//01%654'&'&#" &'&#6'      S,  ?@@  3 +/+/01;!327674'&'"#&#"'67276767654'&]g                )9BV@ >2 +//+01%"'.'7'&+"&#"3276767>32;6?;367'6767654'&#"J "nY  : " BK %A 9.    Nmz0      pd  U>P @H +//012767654'&'.'.'5&'54547=&'&#"327654'&'3      z             )Bse@4bbrrk __aRRT22G//G&&<G737"'&5676;2#";}; `Nz  w  j2I1.  oSo@IM _Q +//+01>767654'&'#"'.'&=676767>7>76754'&'"332326676=&'&'&#"32       D         t        8&  !       ;h@  ? +/+//0165&'&'&#"&'&'&#"#"327>7;6767>7654'&'""'.'&'>7>767>#"'&'&545476763 +"+:)        `  $0 j    >!" ,-+'?)! !!    "   -''2((R@    ++/+/01%2765&'&'#4'&+"#3      n   w-@  & - +++/+0173>76=47632276=754'&'&'&#"w  "*'"   , .  C"""@  ( # ,##-@    ++//+014'&#"32765&'&+'    o  |   ^A@ 0(  +/+/+01;27674&'&'&#"+.'&'&'726=4'&'#676767>727654'& ;9T();4C  +*   '%+%  .&&5=('  8 )   P@    +/++01%6=&'&#&#"'!;6'!&       FebP @  +/+01&'#"3!3276765.'!&   E  k@@@0 ++//01;;6767674&'&#"#"'&=>7>765&'.' /     93" #2"$ r' @ +//01+"'&'6767;676754'& $ "$BG  ?%%#'J!"$"AK< '&<6&'$-@    +++++///01!!2654'&#!"Sy r0v   )h@ ++//014'&+"6765)  R  ` Q@   ++/+/01!;32765326=4'&      n C-9@ ,# ++/+012#"'&'&'&'6767"3276767654'.$ "  ,,B*J %**&"8H !  #B*,5 &$*+'$%'+*$&8 nzB` @C  +/+01"36767>7>5454'3632;2767>754'&'&'&2+"'.'&54767676/+*    $ ),2 " &#=/.3    %  L(%'2<+ = 0   @    ++//+013276=4'&#3276'   (   } o?@  "&?? ++/+/014'&#"&'.';276=6767>767654'&#"' '  .      #       %.   vN,@ * &$ $ +++//01;67>765'4'&+#"'&'=4'&#"v ,    #'( ! /$!  ."". C"! !E  Id/@  /  +/++/01;2+332767676=4'.'&'^  C"!!"? )!  ."!1 "!((!  , o=@;6 ++//01%327654'&'.'&'&'&'4'&#";6767;26'$     4')  G"    )  4 $  Gd0@  )  +/++/01#;72765.'&'+"'&=476;27674'&/!# "( > "!D     !(' " BZ @     ++/++01>76=!327654'&'!=4'&#"BZ  w u 8c2'@##% %%% * +//+////01%;2765&'&'#&'&#"#;32767654'*    F    <<d@ Q +//+/01;!327674'&#'"3012727267>7654'.'&'&;#32767>76=4'&'&'.T  |                               m@    +++/+/01!254+3254#%";#"  R  @.4@ #   ++++01!67632#"'&'7";2767676=4'&'&'&-,:=,**+>=+,,$(&%(-'& %':%&&$j<%%%&;&$+-$$$!+'$(QAG@$//@@8 !% .%/%AA/ /* A ++++/01%5&'&5476767654'&'=4'&+"#3!27654'&'#'G/-+ , ! *  U   #&.,#" 0  1 "#--$# I  v7@ )517 ## +++//01"327654'&'&#"&'.'#"=4767632#"5<+$ X!""& #"(, b*5'  <** .$!/  _+S'@C: 220%%'0'   +/+/+//+01#"3!27674'&+;276754'&'+"'&'&'32765.'&+676767>72765."    p <9V'(=$.'  &*,+  %')%  r    0%'5>%)  8 *  0O @+ M +/+01%.'./!'32767654'&'&#""7654'&'!#"36767632327L!$5S/9N -   !I 8  \        "  Nxv);@#)##)#  !!! ++//+////01;54'&#"#3276=654'&'qmm  :hts Ht  t Nqq(;@   $!((!(! ++//+////017#327654'54'&#";32765qq/mm  .::. u  uG rr>T@22$ 44 RP +//+/+/01#;#"3!276767654'&'&+676=4'.'6?6=&'&#&#"bmSLw mJ T i Y k  k"W@     +++++/01!276554'&'!!7;2767>5&5456547&5475454767>=4'&Cj    E o   o          Q FM@&( ( 7C ; ;=3 )2)A2 <= 2 <= . ++/+/01'&'&547675327>74'&#!;3276=676=4'&'/G   )  *  *! B5  "-- qp ., AVBO\ @: +//01%67676=&'&'&'.'.#"'&'&#"32732767654/632#"'&'&54767w# ## A?" #!& !< Nz! 2c 2 5= !#)$!  $" '#& 7#$7-9 7A{$-6/@ 6222 6 &* &&6 ++++//01%676=4'&'54'&#"676=&'&'6767'U21-/\ V0///W :(&%'k<#&&$;/98NL68  98OQ76 7-,<=.,)+>=,+)AMa1@9O O5<767676 ?%"! +%"     6$'  &$5Cb^    D H  G'#&&&r +$ `$D@8/ # +//+012765&'&'.'!327654'&'!>7>765&'&   & !     U              _0-0@ /#   +/+/+01#"3!276=4'&+&'#"3!3276765.'!)      r   TE  k+1U@uVV@WOKD@=52#"   45 56+**+6567 JIJ@@AKKL??K UULKUT  JI A@6*)5;.-DFv/7?<;7#"&547>;,t+c0s0 &3 B+A  D6 1t5/I H+G Fe           QF'5T@66@7+ #+3(//3Fv/7??//.........10Ih36Iha@RX8768Y240+"'&=4'65&'&'&'&547>2#"'&546 !    (*F  3/0 .     A*+qD M@@   Fv/7?74'.32767267676;#"'&/0#"'&54767&'&'&5476#  5  (:!Of"N'#( !.:u !  4G I069*%"2)  +G, Y"D ,,2( #  &!;8>-3!$:8aJYcu@5dd@e^YK3cZ- $YKFE;:%$_^Q?_:9%I"-Fv/7///<<<//<<<..........10Ih-dIha@RX87d8Y&'&'##"="'&'&'&54767632;5&'&5476767546324'&'2765'9"  A*^+'4> 9$)+ 0, X,' 3"6 30   *<*+0E/  &4 / /    "/*/z   % $( &2@Lu@/MM@NJGA JD  >76*$03;!-'$Fv/7//////7>767>76767&'&'&#"#"#"'&'.'.'454.'&'&13276=.'&+'4767632327676=&'.'.'&'&2+"'&'&1476!   , /   !#      }          J+                         5@T @R +//01%'>76327654'&'&'7&'#"'&'&#"#"'&'&'#"327327G8 M   *2 8$ M  H  " :  gG      en     0 v`m'=@224=4 '  ++/++/01";!327654&#3!27654'&'%;!327654'&'r6  4  3     v i@     +++++013327654'&#!  r/    Tk@-94@ ++///01654'&#"3276767>7327676754&'&#"+"'&'&545475&+"#"'&545467676              |  $"      41K"J* 6< 01$!!)+1R  1;=DZ )@     ++/+/+/0154'&#"!";!>=   [  v x  ?# !1ARq @dS +//016767&'.7&545475.'.'>7>7>7"'&'&5477;67>7654'&'."      >     *%' !0)& &!*/$&7NG#  A     I    $  ($00N 8%%.+&'" `(I@  & +//+/01!;!367>7>7>767>76765&'&'&'&'.'&'.$     U         (               b+ @ +//017&54?632#"/7'n   n  !p.>K@)    +;!3;3     ++++++/+///01%!!276=54'&#!!!";27654'&327654'& zz(   v 3q'V_<ZW!d!XdXXXXXZXCXX^XXiX\XXXgXkXSX^XfXfXdXeXXXlXZXjXXXXX"XXXX9XX$X+XXXX XBXXEXXXJXOXbX:XX6X7XX[XXRXXX;XXRXX6X-XXXWX!XXNXX X;XXXX)XXIXCXXX0X<XrXX[X;XXBXSX6XjX)X[X]XSX?X9XX)XJXXoX;XRXwXX^XPXPXXX$XXQXCXnXXoXvXIXoXGXBX8X<XmX@XQVvX X0XNXNXrX"XQXAXAX)XXX+XXXrX9X7XBX8X(XqX6X5X`XiXTXDX?X VbX!Y_tWroW , v q j 9 q=U ^dd9.lh P !X!"#2#$h$%&]&'W(()m* *++,-!--.....//<0#0{1q2@223[34[5%5567u77818899u99:!:X:;K;};<7<<=A==>}>???@z@AWAB=BCVCDPDEjEFG!GvGHHHIjJ4JK1LGLM3MhNNNOOOP7@g!%):> D P ,a     "     "Adrian Smith 1995/2001KAPLRegularKAPLKAPLVersion 1.2; 2001KAPLAPL385Adrian Smithadrian@apl385.comAdrian Smith 1995/2001KAPLRegularKAPLKAPLVersion 1.2; 2001KAPLAPL385Adrian Smithadrian@apl385.com{  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdeghjikmnoqpuv{~ .nullFL00ABhFL00AEh@% EhDEhDEhDEhDEhDEhDEhDEhDEhDEhDEhDEhDEhDEhDEhDEhDEhDEhDF+F+EhDEhDaplus-fsf-4.22/src/fonts/X11/0000777000265000001440000000000010774512701011377 5aplus-fsf-4.22/src/fonts/X11/Makefile.am0000644000265000001440000000117607232126510013346 ## Process this file with automake to produce Makefile.in ############################################################################### ## ## ## Copyright (c) 2001 Morgan Stanley Dean Witter and Co. All rights reserved.## ## See .../src/LICENSE for terms of distribution. ## ## ## ## ## ############################################################################### SUBDIRS = pcf bdf aplus-fsf-4.22/src/fonts/X11/Makefile.in0000644000265000001440000002375410774512523013375 # Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ ############################################################################### ############################################################################### SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../.. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CXX = @CXX@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ STRIP = @STRIP@ VERSION = @VERSION@ X_INCLUDES = @X_INCLUDES@ X_LIBS = @X_LIBS@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ SUBDIRS = pcf bdf subdir = src/fonts/X11 mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_CLEAN_FILES = DIST_SOURCES = RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ uninstall-info-recursive all-recursive install-data-recursive \ install-exec-recursive installdirs-recursive install-recursive \ uninstall-recursive check-recursive installcheck-recursive DIST_COMMON = Makefile.am Makefile.in DIST_SUBDIRS = $(SUBDIRS) all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/fonts/X11/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ETAGS = etags ETAGSFLAGS = tags: TAGS 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; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ fi; \ done; \ 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; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = ../../.. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d $(distdir)/$$subdir \ || mkdir $(distdir)/$$subdir \ || exit 1; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" \ distdir=../$(distdir)/$$subdir \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_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-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: info: info-recursive info-am: install-data-am: install-exec-am: install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool uninstall-am: uninstall-info-am uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \ clean-generic clean-libtool clean-recursive distclean \ distclean-generic distclean-libtool distclean-recursive \ distclean-tags distdir dvi dvi-am dvi-recursive info info-am \ info-recursive install install-am install-data install-data-am \ install-data-recursive install-exec install-exec-am \ install-exec-recursive install-info install-info-am \ install-info-recursive install-man install-recursive \ install-strip installcheck installcheck-am installdirs \ installdirs-am installdirs-recursive maintainer-clean \ maintainer-clean-generic maintainer-clean-recursive mostlyclean \ mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \ tags tags-recursive uninstall uninstall-am uninstall-info-am \ uninstall-info-recursive uninstall-recursive # 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: aplus-fsf-4.22/src/fonts/X11/pcf/0000777000265000001440000000000010774512701012147 5aplus-fsf-4.22/src/fonts/X11/pcf/Makefile.am0000644000265000001440000000162707232126574014131 ## Process this file with automake to produce Makefile.in ############################################################################### ## ## ## Copyright (c) 2001 Morgan Stanley Dean Witter and Co. All rights reserved.## ## See .../src/LICENSE for terms of distribution. ## ## ## ## ## ############################################################################### fonts_pcfdir = $(prefix)/fonts/X11/pcf fonts_pcf_DATA = \ Kapl.alias \ Kaplcour-14.pcf.gz \ Kaplgallant-19.pcf.gz \ Kaplscreen-11.pcf.gz \ Kaplscreen-Bold-14.pcf.gz EXTRA_DIST = \ Kapl.alias \ Kaplcour-14.pcf.gz \ Kaplgallant-19.pcf.gz \ Kaplscreen-11.pcf.gz \ Kaplscreen-Bold-14.pcf.gz aplus-fsf-4.22/src/fonts/X11/pcf/Makefile.in0000644000265000001440000001552410774512523014141 # Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ ############################################################################### ############################################################################### SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../../.. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CXX = @CXX@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ STRIP = @STRIP@ VERSION = @VERSION@ X_INCLUDES = @X_INCLUDES@ X_LIBS = @X_LIBS@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ fonts_pcfdir = $(prefix)/fonts/X11/pcf fonts_pcf_DATA = \ Kapl.alias \ Kaplcour-14.pcf.gz \ Kaplgallant-19.pcf.gz \ Kaplscreen-11.pcf.gz \ Kaplscreen-Bold-14.pcf.gz EXTRA_DIST = \ Kapl.alias \ Kaplcour-14.pcf.gz \ Kaplgallant-19.pcf.gz \ Kaplscreen-11.pcf.gz \ Kaplscreen-Bold-14.pcf.gz subdir = src/fonts/X11/pcf mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_CLEAN_FILES = DIST_SOURCES = DATA = $(fonts_pcf_DATA) DIST_COMMON = Makefile.am Makefile.in all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/fonts/X11/pcf/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: fonts_pcfDATA_INSTALL = $(INSTALL_DATA) install-fonts_pcfDATA: $(fonts_pcf_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(fonts_pcfdir) @list='$(fonts_pcf_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(fonts_pcfDATA_INSTALL) $$d$$p $(DESTDIR)$(fonts_pcfdir)/$$f"; \ $(fonts_pcfDATA_INSTALL) $$d$$p $(DESTDIR)$(fonts_pcfdir)/$$f; \ done uninstall-fonts_pcfDATA: @$(NORMAL_UNINSTALL) @list='$(fonts_pcf_DATA)'; for p in $$list; do \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " rm -f $(DESTDIR)$(fonts_pcfdir)/$$f"; \ rm -f $(DESTDIR)$(fonts_pcfdir)/$$f; \ done tags: TAGS TAGS: DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = ../../../.. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: $(mkinstalldirs) $(DESTDIR)$(fonts_pcfdir) 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_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_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-generic clean-libtool mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-fonts_pcfDATA install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool uninstall-am: uninstall-fonts_pcfDATA uninstall-info-am .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am \ install-fonts_pcfDATA install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool uninstall uninstall-am \ uninstall-fonts_pcfDATA uninstall-info-am # 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: aplus-fsf-4.22/src/fonts/X11/pcf/Kapl.alias0000444000265000001440000000101207202066465013760 kaplcour-14 --kapl-medium-r-normal--14-140-72-72-m--iso8859-1 kaplcour --kapl-medium-r-normal--14-140-72-72-m--iso8859-1 kaplscreen-bold-14 --kapl-screen-r-normal--15-150-72-72-m--iso8859-1 kaplscreen-bold --kapl-screen-r-normal--15-150-72-72-m--iso8859-1 kaplscreen-11 --kapl-screen-r-normal--11-110-72-72-m--iso8859-1 kaplscreen --kapl-screen-r-normal--11-110-72-72-m--iso8859-1 kaplgallant-19 --kapl-gallant-r-normal--19-190-72-72-m--iso8859-1 kaplgallant --kapl-gallant-r-normal--19-190-72-72-m--iso8859-1 aplus-fsf-4.22/src/fonts/X11/pcf/Kaplcour-14.pcf.gz0000444000265000001440000000741707202066466015211 7Kaplcour-14.pcf{p]EMKP@Pʻ{hk&i&%Ii@Z j HI67M@ !:puFd2>Qgɽ眛?~6gwvsLغe4*x.^'ԃڋD2Yd/U":/X$ KEN/Dݹ0y'J Cp<#g XB,V\F#3F c"㕵7yQY0r2TѠ-l!VFc-͵k:ZV6nĥ5M;xUVo޹e53g}CUAΚvikmnVikh_X߾*le׎ۥ}cSCpU6nhhhkAֶ46ֆu-Fi[[[ؼRH +:6nUm+e% u- _kijjۤ\WpdźŐ**YZ ©ĿE5)[SQ[]X# kW}kr/"pTwNq>yErw? À~ehG< G(ig,9 xQphi7)0 i  x@ f= hD@oZ@' h# @(V(сB(:4P=i>3 L<9H< ' o(4P2idS x@NE(4Pr@H< pic@9@șH<  x@B(#@G x@A(9i< x@.@(ip@ qYW>Y$Q24ԏ"IH(G$?k%IdvdARŮU$^쾦o@U?NחEaw@]IJH4Su7 <1bzO"庎YS `fLL~g5> χb]'a-]lPDIp"2Zu]#עa_D}3[׼OfgbH#u嚝l O-uNwHݑHkQ2~3$RhGR}R.#Zi 5''ԿY/v}[Q3k.פ$Gm}dFSRioYM>7Hq!lu~e9_ tO'/4t/#/~?>q>7̷SMOl.olyΏ>:57Hm|}ߋmseL}ί0|>-n%iR; tD_CNЌe'Ǿ\# U'~+~D$b+#oJYQ7K2 Prr8}>S ۋME ϯⰄ]+j#qg8*칸g)%ueᙍwFc{/S}(_Ȅ$Rh=!I UMoQ7_8Ӈ4_Q{5D|9Qs5nҼS?|Bļ+"FߓڶigHQ?T?b5{qg133b{imM)'|bk(J$בֿwg$ Wi/gp7W öl4Jlє(:$yۘTJ9GK`/$L7pۍ\.#"b2(w]~OgnG'9\{PyqyBSH= g _/Kt.);(s0y?oYl"١Fgo_':$o&sU>Kx<~||Rw?3-yj;Lp< N`!p@5M]v\   xg.5m}*x~_?!04ǁz(2Lǂ .J\ *jle"A%* j,粜rLV2Y'Y*Y*YXXXXYYYYjXjXjXjPY ePɠA5sXa9sXa9ɡɡɡɡɡ\sYe9?s?s?s?s?s?s?s?s?s?s?s?s?s?s?sbRZJC)%ž؍SFH) Rl(U'~(sr\Α9r9G.rf\Ό˙q93.| Sr*\N˩p9.T r.r.g p9hv9.R.r.GR.ur.rnMzDCaplus-fsf-4.22/src/fonts/X11/pcf/Kaplgallant-19.pcf.gz0000444000265000001440000001146207202066466015663 7Kaplgallant-19.pcf`TE~ǿMPLrrrq㈷"z#RYr"rhl ,ZJ-Rk֦j,g-rZjjY9Kߛcɼ?y3o;[zs>'~?w¿)nv &so7*lG.H:K27q2Ms((C⹀E@J>$I*hH/N4ҰAR$)>MBFq.IIy')A'}$$M}KY&1')9R$IOz *OzHDi2 )Q'}$y$ '=$M4v|Q$I'P4~$E"OH'IRAk.FzUHzHD/>IWOH8B}$Oz &Q4^F}"˩OH $L}Kp%II،>$I*J}K0Ik')F}G_>I(IoTIL>#$#3OzHDi )='}$L[$Iŵ'Q4SHd6I 7P$I+ze{9(ET"#zM>C!͇Bқ'+H!Lz+BG IoQ>)8dt Coxh3!sy%ݿ&2=B^|(~ƀbF=uQ^cxJ>#{nou 鄚j%|^Ʊ~!^, '$2vl0s|ѳmb= 26+w`i%{ b( c C&%;|)G|59D~?W0+y2u22K3M\^"0vʗiك*a 7mZdY㕂 Hoڏ)q)/ƾn8T{q-#ȉC%Ǐ8lvtëp긎e).VmlAiGف]қO NCS<||C36`xern]r}[{@Ɩ(,\f:1Ga+^}FڎYښ-~~"eXG>rHv;)_9V6l@M>S.(ϔۧl|{[u C#]*m?=cL/L%13deRIld)gƞlqzU+jvn1kv1|峞?iCv<֮h_(82tj\k #ȅ2mĔWeve@q0-3€Zd?`os`\bk𒡬{k=Y`eÎ ӟ"0NXu/8|S̹Fׄe6ʷCS~ WZ'WņH3 o;Ig? ywiXũB4iy W;"uԟY;v ~kfMuk]NdRK^oY6x80_ƾG$I \=<6Bmߟi?9G|Ga[;dHߑ0^ע6$AE_{2m)W2/f0G@q|_$ʼnL?؞la햀Zlg_gfMd_z_A>wqq}'F ܬ~q<ӑHtBlӑyk&:nvlRG;[ؙЕض:ޝoJloڶ87%݉mykx :r}mwtu2Pws8VtZhlg='۬lBNN8ږQǾ52n]H 6')]:K%y|*V$~zs\KܦC q$.u`>8Xb%7Rw+;%_VYۦ]o&ֶmQFݣVKJgɱZm.əÒEuXkv+gcW{u7jU,\\F+(KY1m[Խjm k-!wG($tmDwmPwDdSmSkwl"fP4D~ {8gqu6PΞS8ƹ8>18c9TޟDž.1| eL@.WDLeW`2\UL0 _稦`:jPYõA#!@3a>, ,/F,f/7f܂_bM܊o6|p;c{_J܁U]V:gֆvlFt[Ѕn$۰;]܃_Ž5įc~7=z۸xxGx1GxW5qH_[W¿m;08J }-i9?x"E\b^n֫ƭw%̀z P߯ȼ{;IPj.^>Cy]}޸2=^L }=Gfn$iU?7wlG |7Dȫ>O=?gwN#nI i;rj.r/C"gx^y˯W(yQr2"s"7Է&2f&Ol_$==7+c .ȥA5yEUdCv&ϓ~a.\RI.!T2Cr YN֜c ; &Og erPcQuwѲnE~-R@&w%FrkHsUgo$X sdy5y_H)ǯux|[jRCyYV~+CȽz]C1 [y9xIF5'iQs"Tnl#Ë:yG 1"r)B!d>mdYG6{nv#;W r|@޹W|g++G?-L*Z^-j-Q+{׾9:cCeb!,C YbBBsNy>̖lIs{wιnMDAmRGZO@wO! B@h4bzDyNCT#!8TA#xx>az^CM$$o&XA9+ȁ w^=rҍ9JHL879;[Ǭ Y1:%܂` Wt~:+uexj}sSvi5(m]ڥKKVv#Ͳ_y,YWlxjkmR+EBqiVwSm(]i7vEV9jkqY4ѮںH"ZJí3ikzࡱ ᦺ9w,1\Qm[]$7RqEAփ֠(R08w.*㿥/J@ "e!iyBJ St>(^x&`2/M%:iWY3˼L 9]=~t 5%Gi&6E:L -ٔi2&e2K~<-y |OY X -zP 3]ZFXu&ʟbk|R-f:bW3kG\g/{~^'ʮ?۬'ʯe׃uT%Ey>[d\4΋./QcSs>;1/;ɾ?fC2 *屈,ꨋiDmG5aDRt-PzZl#ecchOmՕk}^3}4nHerޤ Wc:A eQz\C&Z{v^6wSv*teQa۟+{1[}5K=u{2Ly'_ǍsSl}GF|?PVwz1M/5 5N_1',le˷2uiQ~SQު<[4z9klHO}NO?dK1,j~SfybֳzW`]_oR31 B|0O 7i<5$ 'rɴ36v9j, 7H;~\H'N_EHfVZlq9]rYǥs-iѴ ܒJ&BG'4$'N',ZRh) Iɱ`,nؖN&F T3 ln*]r^:#vH6c8͘DjN&2q^7pWݜE%2>˛^'rQ l\g)Z\VE>v+5FM W,7?fARh|wfFtx=^q5Mw?r \{Ϲ{&cnzvwaf#_{TAAúr.ͣͧ7ۯc u;aEXFh1-FZJML-( cN+h%} ~x55¾[EOk =s^z6ҋ>zeY}Ux~ \:utt;ar}sw1oߣq>H[Gq'~J;Ioh'/.zޕ}=v_bn_f{78$2{~7k~k5=W}<kd^ zm?&3p| J,PD l1#`;]ap | N 2ke`6hI ^ Z6- `-n5=~P @+X;7A:{!{p4,, Br A8` ?y:JSwPZJ>`'Q 8>[`>A<i0]}p{YrO6Mjڤ6j/opeRX9aplus-fsf-4.22/src/fonts/X11/pcf/Kaplscreen-Bold-14.pcf.gz0000444000265000001440000001024607202066470016363 7Kaplscreen-Bold-14.pcfyU@* vZz NH{2,!.Su\xf&Qz0Jխ&{W]q"RU9x)>w 2O?W e6,OC,kVD*:~&ZK6l+0]^g|H]agxx'3p&zΖ8<Md FE jQ#5S u;Oӽ03n# "ApEwW_W}=quuG~^/ټ 2kx;첫OzŽUͮM۷=*k:ֵwv\.k;`O{owھuvdi]ѵRVK=+2dXsGoҥMgOhZƔݝ˙q.X{bmg }R}==J^7Էֱֹ4uk_ڦd]D`q Ì=3g9Q}>ߋ֧Y(:V zQB&W k(΋' P 3q@e( q(/7@ ^*@& P x @AB  ŴbBnE(] zBG  q@ BnB(Y8P r4@ @A(Y8P r,@qB ؂T!#K @N@(9q@$ā!v9q@Tā! @^8P Jā! @@(Nz@YB B]T!&::Խ>WHq=u1MƕE(R/V]HgrEb:wS-vW-'>7'mղi*pEjW/0gs.G"ҚI̽-o{~"㽋 8W^$</Eesk2@ݚùJ6Ԙ>fr,s֐>v-o;t\wտܬr(3=Roc݌u"ylOJӘ&۞/Zw(5.eƯ+}edf/3-W%}qnN)tؤͫ˴pxZ󸅫Ĭqq,Z[fޤZvx\yh@}bVyriC$A73GW%>/iOk.m2 %{s~f"s2;&(i+gDIg'ql{u5}µ9̙Þ]g%%̵Ӭϔ,߬E繃.쵲\3go/]g,7 ?i{>8#\OgP$o5MVϦ[3OM;O}#k-v3kq߶KZ׊8SY%C29 {NʅH_乵k>N׏cuvei#ʜҗ9O;e;-}lw/sNKu[/s~OK_U{vҧU/s~OCd=d?e/EZ]i˜]7[ryei&v]eW>1me1[Ցǽ!mwTj{Ƽ>? tFִNE42n]A|R_/ePdVd6egwio;3{䳳dErY:?S]{26zaa%o ̽dyϮ^e<$II̧HZ{{7 A e͒vsZvY{N)wL?da|c=Y{~fi;&3Yζ[rIou^v{湼ugPDZٮ?|SfIKi>3߭k݊qS s\͟\iro،H?ӳٳ89& H)bl`߈4m0E[MUF#(UҊ*-gy^J~:Ť-5(,U-Lk9[O7ԍa7h)vjum>>669DMb9MR&v R)mD \tO)xRk\:IⴑH5.xB#AMVۆJVdS쎓C3B*zk'P+se~,FB9ip9B^&GQX_1Xź{,f$')r&Wr)*9 s'(M[p<[^-`}z +IEZ嵲\ڤ]VJY%:9_:etI}铵r\(d\$ oҏyylK2}oH<{\%WfF6ގFI`}{֮!Q2,#2?.2mr3wʻy*?!~1=),wr{>_އABG(Ճ1|~\>!Oɧ3Y|׾| /W<*_C_>|CXxSwkcp1Gjuqײ*5_ق`K׭`8_?{Vw%;,|7]c#`RI޽C3.so??w?xk_¿g}oXDp8x/sw@7p9\ a}ι ___œ'i?{'FGp*84&jph ub&f \[_ax7 Oσ/G7v?_]s/o80#1` 8l ,j.o-`3x 1P]>A$x< ~< uiy|zFzM (P.\#6FQ&kdF&kdF&k\(D&5QrMk\3)Lf5Sr͔k\ Z(BʵPr-y|zFzMQΣG9rj>j~CtOOOOOOOOOOO OO4Ok5|Zç!|§>[(kPJT:o@}P߀T5U `@P-nu [G U j@Uv A@*T:`7 6U jl鯗q,(Maplus-fsf-4.22/src/fonts/X11/bdf/0000777000265000001440000000000010774512702012133 5aplus-fsf-4.22/src/fonts/X11/bdf/Makefile.am0000444000265000001440000000154307232126537014106 ## Process this file with automake to produce Makefile.in ############################################################################### ## ## ## Copyright (c) 2001 Morgan Stanley Dean Witter and Co. All rights reserved.## ## See .../src/LICENSE for terms of distribution. ## ## ## ## ## ############################################################################### fonts_bdfdir = $(prefix)/fonts/X11/bdf fonts_bdf_DATA = \ Kaplcour-14.bdf \ Kaplgallant-19.bdf \ Kaplscreen-11.bdf \ Kaplscreen-Bold-14.bdf EXTRA_DIST = \ Kaplcour-14.bdf \ Kaplgallant-19.bdf \ Kaplscreen-11.bdf \ Kaplscreen-Bold-14.bdf aplus-fsf-4.22/src/fonts/X11/bdf/Makefile.in0000644000265000001440000001544010774512523014121 # Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ ############################################################################### ############################################################################### SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../../.. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CXX = @CXX@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ STRIP = @STRIP@ VERSION = @VERSION@ X_INCLUDES = @X_INCLUDES@ X_LIBS = @X_LIBS@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ fonts_bdfdir = $(prefix)/fonts/X11/bdf fonts_bdf_DATA = \ Kaplcour-14.bdf \ Kaplgallant-19.bdf \ Kaplscreen-11.bdf \ Kaplscreen-Bold-14.bdf EXTRA_DIST = \ Kaplcour-14.bdf \ Kaplgallant-19.bdf \ Kaplscreen-11.bdf \ Kaplscreen-Bold-14.bdf subdir = src/fonts/X11/bdf mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_CLEAN_FILES = DIST_SOURCES = DATA = $(fonts_bdf_DATA) DIST_COMMON = Makefile.am Makefile.in all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/fonts/X11/bdf/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: fonts_bdfDATA_INSTALL = $(INSTALL_DATA) install-fonts_bdfDATA: $(fonts_bdf_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(fonts_bdfdir) @list='$(fonts_bdf_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(fonts_bdfDATA_INSTALL) $$d$$p $(DESTDIR)$(fonts_bdfdir)/$$f"; \ $(fonts_bdfDATA_INSTALL) $$d$$p $(DESTDIR)$(fonts_bdfdir)/$$f; \ done uninstall-fonts_bdfDATA: @$(NORMAL_UNINSTALL) @list='$(fonts_bdf_DATA)'; for p in $$list; do \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " rm -f $(DESTDIR)$(fonts_bdfdir)/$$f"; \ rm -f $(DESTDIR)$(fonts_bdfdir)/$$f; \ done tags: TAGS TAGS: DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = ../../../.. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: $(mkinstalldirs) $(DESTDIR)$(fonts_bdfdir) 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_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_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-generic clean-libtool mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-fonts_bdfDATA install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool uninstall-am: uninstall-fonts_bdfDATA uninstall-info-am .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am \ install-fonts_bdfDATA install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool uninstall uninstall-am \ uninstall-fonts_bdfDATA uninstall-info-am # 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: aplus-fsf-4.22/src/fonts/X11/bdf/Kaplcour-14.bdf0000444000265000001440000005531206441546675014546 STARTFONT 2.1 COMMENT COMMENT WARNING: This bdf file was generated from a pcf file using COMMENT pcftobdf. The resulting font is subject to the same copyright, COMMENT license, and trademark restrictions as the original font. The COMMENT authors and distributors of fstobdf disclaim all liability for COMMENT misuse of the program or its output. COMMENT FONT --Kapl-Medium-R-Normal--14-140-72-72-M--iso8859-1 SIZE 14 72 72 FONTBOUNDINGBOX 8 16 0 -5 STARTPROPERTIES 20 FONTNAME_REGISTRY "" FAMILY_NAME "Kapl" FOUNDRY "" WEIGHT_NAME "Medium" SLANT "R" SETWIDTH_NAME "Normal" ADD_STYLE_NAME "" PIXEL_SIZE 14 POINT_SIZE 140 RESOLUTION_X 72 RESOLUTION_Y 72 SPACING "M" AVERAGE_WIDTH 80 CHARSET_REGISTRY "ISO8859" CHARSET_ENCODING "1" CHARSET_COLLECTIONS "ASCII ISO8859-1" FULL_NAME "Kapl" DEFAULT_CHAR 0 FONT_ASCENT 11 FONT_DESCENT 5 ENDPROPERTIES CHARS 174 STARTCHAR C020 ENCODING 16 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 00 00 00 1f 10 10 10 10 10 10 10 10 ENDCHAR STARTCHAR C021 ENCODING 17 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 00 00 00 ff 10 10 10 10 10 10 10 10 ENDCHAR STARTCHAR C022 ENCODING 18 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 00 00 00 f0 10 10 10 10 10 10 10 10 ENDCHAR STARTCHAR C023 ENCODING 19 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 10 10 10 10 10 10 10 1f 10 10 10 10 10 10 10 10 ENDCHAR STARTCHAR C024 ENCODING 20 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 10 10 10 10 10 10 10 ff 10 10 10 10 10 10 10 10 ENDCHAR STARTCHAR C025 ENCODING 21 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 10 10 10 10 10 10 10 f0 10 10 10 10 10 10 10 10 ENDCHAR STARTCHAR C026 ENCODING 22 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 10 10 10 10 10 10 10 1f 00 00 00 00 00 00 00 00 ENDCHAR STARTCHAR C027 ENCODING 23 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 10 10 10 10 10 10 10 ff 00 00 00 00 00 00 00 00 ENDCHAR STARTCHAR C030 ENCODING 24 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 10 10 10 10 10 10 10 f0 00 00 00 00 00 00 00 00 ENDCHAR STARTCHAR C031 ENCODING 25 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 ENDCHAR STARTCHAR C032 ENCODING 26 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 00 00 00 ff 00 00 00 00 00 00 00 00 ENDCHAR STARTCHAR C040 ENCODING 32 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ENDCHAR STARTCHAR C041 ENCODING 33 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 08 08 08 08 08 08 00 00 08 08 00 00 00 00 ENDCHAR STARTCHAR C042 ENCODING 34 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 24 24 24 24 00 00 00 00 00 00 00 00 00 00 ENDCHAR STARTCHAR C043 ENCODING 35 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 24 24 24 7e 24 24 7e 24 24 24 00 00 00 00 ENDCHAR STARTCHAR C044 ENCODING 36 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 08 08 3c 4a 48 28 1c 0a 0a 4a 3c 08 00 00 00 ENDCHAR STARTCHAR C045 ENCODING 37 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 30 48 49 4a 34 08 16 29 49 09 06 00 00 00 ENDCHAR STARTCHAR C046 ENCODING 38 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 18 24 20 20 10 29 46 44 4e 39 00 00 00 00 ENDCHAR STARTCHAR C047 ENCODING 39 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 08 08 08 08 00 00 00 00 00 00 00 00 00 00 ENDCHAR STARTCHAR C050 ENCODING 40 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 04 08 10 10 20 20 20 20 20 10 10 08 04 00 00 ENDCHAR STARTCHAR C051 ENCODING 41 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 20 10 08 08 04 04 04 04 04 08 08 10 20 00 00 ENDCHAR STARTCHAR C052 ENCODING 42 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 08 08 6b 3e 1c 36 22 00 00 00 00 00 00 ENDCHAR STARTCHAR C053 ENCODING 43 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 08 08 08 7f 08 08 08 00 00 00 00 00 ENDCHAR STARTCHAR C054 ENCODING 44 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 00 00 00 00 00 00 18 18 08 10 20 00 ENDCHAR STARTCHAR C055 ENCODING 45 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 00 00 00 7e 00 00 00 00 00 00 00 00 ENDCHAR STARTCHAR C056 ENCODING 46 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 00 00 00 00 00 00 18 18 00 00 00 00 ENDCHAR STARTCHAR C057 ENCODING 47 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 01 02 02 04 04 08 08 10 10 20 20 40 00 00 00 ENDCHAR STARTCHAR C060 ENCODING 48 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 1c 22 22 22 22 22 22 22 22 1c 00 00 00 00 ENDCHAR STARTCHAR C061 ENCODING 49 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 08 18 28 08 08 08 08 08 08 3e 00 00 00 00 ENDCHAR STARTCHAR C062 ENCODING 50 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 3c 42 42 02 04 08 10 20 42 7e 00 00 00 00 ENDCHAR STARTCHAR C063 ENCODING 51 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 1c 22 02 02 1c 02 02 42 62 3c 00 00 00 00 ENDCHAR STARTCHAR C064 ENCODING 52 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 0c 14 14 24 24 44 7e 04 04 0e 00 00 00 00 ENDCHAR STARTCHAR C065 ENCODING 53 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 3e 20 20 20 3c 02 02 42 62 3c 00 00 00 00 ENDCHAR STARTCHAR C066 ENCODING 54 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 0c 30 20 40 5c 62 42 42 62 3c 00 00 00 00 ENDCHAR STARTCHAR C067 ENCODING 55 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 7e 42 02 04 04 08 08 10 10 10 00 00 00 00 ENDCHAR STARTCHAR C070 ENCODING 56 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 3c 42 42 42 3c 42 42 42 42 3c 00 00 00 00 ENDCHAR STARTCHAR C071 ENCODING 57 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 3c 46 42 42 46 3a 02 04 0c 30 00 00 00 00 ENDCHAR STARTCHAR C072 ENCODING 58 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 00 18 18 00 00 00 18 18 00 00 00 00 ENDCHAR STARTCHAR C073 ENCODING 59 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 00 18 18 00 00 00 18 18 08 10 00 00 ENDCHAR STARTCHAR C074 ENCODING 60 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 04 08 10 20 40 20 10 08 04 00 00 00 00 00 00 ENDCHAR STARTCHAR C075 ENCODING 61 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 00 7e 00 7e 00 00 00 00 00 00 00 00 ENDCHAR STARTCHAR C076 ENCODING 62 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 20 10 08 04 02 04 08 10 20 00 00 00 00 00 00 ENDCHAR STARTCHAR C077 ENCODING 63 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 3c 62 42 02 04 08 18 00 00 18 00 00 00 00 ENDCHAR STARTCHAR C100 ENCODING 64 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 18 24 42 4e 52 52 4c 40 22 1c 00 00 00 00 ENDCHAR STARTCHAR C101 ENCODING 65 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 38 08 14 14 22 22 3e 41 e3 00 00 00 00 ENDCHAR STARTCHAR C102 ENCODING 66 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 7c 22 22 22 3c 22 21 21 7e 00 00 00 00 ENDCHAR STARTCHAR C103 ENCODING 67 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 1a 26 42 40 40 40 41 22 1c 00 00 00 00 ENDCHAR STARTCHAR C104 ENCODING 68 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 7c 22 21 21 21 21 21 22 7c 00 00 00 00 ENDCHAR STARTCHAR C105 ENCODING 69 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 7f 21 20 24 3c 24 20 21 7f 00 00 00 00 ENDCHAR STARTCHAR C106 ENCODING 70 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 7f 21 20 24 3c 24 20 20 78 00 00 00 00 ENDCHAR STARTCHAR C107 ENCODING 71 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 1a 26 42 40 40 47 42 22 1c 00 00 00 00 ENDCHAR STARTCHAR C110 ENCODING 72 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 77 22 22 22 3e 22 22 22 77 00 00 00 00 ENDCHAR STARTCHAR C111 ENCODING 73 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 3e 08 08 08 08 08 08 08 3e 00 00 00 00 ENDCHAR STARTCHAR C112 ENCODING 74 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 3f 04 04 04 04 44 44 44 38 00 00 00 00 ENDCHAR STARTCHAR C113 ENCODING 75 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 73 22 24 28 38 24 24 22 73 00 00 00 00 ENDCHAR STARTCHAR C114 ENCODING 76 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 70 20 20 20 20 20 21 21 7f 00 00 00 00 ENDCHAR STARTCHAR C115 ENCODING 77 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 83 42 46 66 6a 5a 52 42 e7 00 00 00 00 ENDCHAR STARTCHAR C116 ENCODING 78 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 87 42 62 52 52 4a 4a 46 e2 00 00 00 00 ENDCHAR STARTCHAR C117 ENCODING 79 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 1c 26 42 42 42 42 42 64 38 00 00 00 00 ENDCHAR STARTCHAR C120 ENCODING 80 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 7e 21 21 21 3e 20 20 20 78 00 00 00 00 ENDCHAR STARTCHAR C121 ENCODING 81 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 1c 26 42 42 42 42 42 64 38 10 2c 03 00 ENDCHAR STARTCHAR C122 ENCODING 82 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 7c 22 22 22 3c 24 22 22 73 00 00 00 00 ENDCHAR STARTCHAR C123 ENCODING 83 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 3a 46 42 30 0c 02 42 62 5c 00 00 00 00 ENDCHAR STARTCHAR C124 ENCODING 84 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 7f 49 49 08 08 08 08 08 3e 00 00 00 00 ENDCHAR STARTCHAR C125 ENCODING 85 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 e7 42 42 42 42 42 42 24 18 00 00 00 00 ENDCHAR STARTCHAR C126 ENCODING 86 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 77 22 22 14 14 14 08 08 08 00 00 00 00 ENDCHAR STARTCHAR C127 ENCODING 87 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 e3 41 49 49 55 36 22 22 22 00 00 00 00 ENDCHAR STARTCHAR C130 ENCODING 88 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 77 22 14 14 08 14 14 22 77 00 00 00 00 ENDCHAR STARTCHAR C131 ENCODING 89 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 77 22 22 14 14 08 08 08 3e 00 00 00 00 ENDCHAR STARTCHAR C132 ENCODING 90 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 7e 42 04 08 10 20 42 42 7e 00 00 00 00 ENDCHAR STARTCHAR C133 ENCODING 91 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 3c 20 20 20 20 20 20 20 20 20 20 20 3c 00 00 ENDCHAR STARTCHAR C134 ENCODING 92 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 40 20 20 10 10 08 08 04 04 02 02 01 00 00 00 ENDCHAR STARTCHAR C135 ENCODING 93 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 3c 04 04 04 04 04 04 04 04 04 04 04 3c 00 00 ENDCHAR STARTCHAR C136 ENCODING 94 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 00 10 28 44 82 00 00 00 00 00 00 00 ENDCHAR STARTCHAR C137 ENCODING 95 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 00 00 00 00 00 00 00 00 7f 00 00 00 ENDCHAR STARTCHAR C140 ENCODING 96 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 20 10 08 04 00 00 00 00 00 00 00 00 00 00 ENDCHAR STARTCHAR C141 ENCODING 97 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 00 1c 22 02 3e 42 46 3b 00 00 00 00 ENDCHAR STARTCHAR C142 ENCODING 98 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 60 20 20 2c 32 21 21 21 32 6c 00 00 00 00 ENDCHAR STARTCHAR C143 ENCODING 99 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 00 1a 26 42 40 40 22 1c 00 00 00 00 ENDCHAR STARTCHAR C144 ENCODING 100 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 06 02 02 1a 26 42 42 42 26 1b 00 00 00 00 ENDCHAR STARTCHAR C145 ENCODING 101 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 00 1c 26 42 7e 40 22 1c 00 00 00 00 ENDCHAR STARTCHAR C146 ENCODING 102 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 0e 11 10 7c 10 10 10 10 10 7c 00 00 00 00 ENDCHAR STARTCHAR C147 ENCODING 103 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 00 1b 26 42 42 42 26 1a 02 04 38 00 ENDCHAR STARTCHAR C150 ENCODING 104 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 60 20 20 2c 32 22 22 22 22 77 00 00 00 00 ENDCHAR STARTCHAR C151 ENCODING 105 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 08 08 00 38 08 08 08 08 08 3e 00 00 00 00 ENDCHAR STARTCHAR C152 ENCODING 106 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 04 04 00 3c 04 04 04 04 04 04 04 08 70 00 ENDCHAR STARTCHAR C153 ENCODING 107 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 60 20 20 26 24 28 38 24 22 67 00 00 00 00 ENDCHAR STARTCHAR C154 ENCODING 108 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 38 08 08 08 08 08 08 08 08 3e 00 00 00 00 ENDCHAR STARTCHAR C155 ENCODING 109 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 00 92 6d 49 49 49 49 49 00 00 00 00 ENDCHAR STARTCHAR C156 ENCODING 110 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 00 6c 32 22 22 22 22 77 00 00 00 00 ENDCHAR STARTCHAR C157 ENCODING 111 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 00 1c 22 41 41 41 22 1c 00 00 00 00 ENDCHAR STARTCHAR C160 ENCODING 112 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 6c 32 21 21 21 32 2c 20 20 70 00 00 ENDCHAR STARTCHAR C161 ENCODING 113 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 00 1b 26 42 42 42 26 1a 02 02 07 00 ENDCHAR STARTCHAR C162 ENCODING 114 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 00 6e 31 20 20 20 20 78 00 00 00 00 ENDCHAR STARTCHAR C163 ENCODING 115 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 00 3e 42 40 3c 02 42 7c 00 00 00 00 ENDCHAR STARTCHAR C164 ENCODING 116 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 10 10 10 7c 10 10 10 10 12 0c 00 00 00 00 ENDCHAR STARTCHAR C165 ENCODING 117 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 00 66 22 22 22 22 26 1b 00 00 00 00 ENDCHAR STARTCHAR C166 ENCODING 118 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 00 77 22 22 14 14 08 08 00 00 00 00 ENDCHAR STARTCHAR C167 ENCODING 119 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 00 e3 41 49 5d 36 22 22 00 00 00 00 ENDCHAR STARTCHAR C170 ENCODING 120 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 00 77 22 14 08 14 22 77 00 00 00 00 ENDCHAR STARTCHAR C171 ENCODING 121 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 00 77 22 22 14 14 08 08 10 10 78 00 ENDCHAR STARTCHAR C172 ENCODING 122 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 00 7e 44 08 10 20 42 7e 00 00 00 00 ENDCHAR STARTCHAR C173 ENCODING 123 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 0e 10 10 10 10 10 60 10 10 10 10 10 0e 00 00 ENDCHAR STARTCHAR C174 ENCODING 124 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 10 10 10 10 10 10 10 10 10 10 00 00 00 00 00 ENDCHAR STARTCHAR C175 ENCODING 125 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 70 08 08 08 08 08 06 08 08 08 08 08 70 00 00 ENDCHAR STARTCHAR C176 ENCODING 126 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 00 00 30 49 06 00 00 00 00 00 00 00 ENDCHAR STARTCHAR C240 ENCODING 160 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 1c 22 22 22 3b 6e 22 22 22 1c 00 00 00 00 ENDCHAR STARTCHAR C241 ENCODING 161 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 66 66 00 00 00 00 00 00 00 00 00 00 00 00 00 ENDCHAR STARTCHAR C242 ENCODING 162 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 3c 00 00 00 00 00 00 00 00 00 00 00 00 00 ENDCHAR STARTCHAR C244 ENCODING 164 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 0c 10 20 40 20 10 0c 00 7e 00 00 00 00 00 ENDCHAR STARTCHAR C246 ENCODING 166 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 30 08 04 02 04 08 30 00 7e 00 00 00 00 00 ENDCHAR STARTCHAR C250 ENCODING 168 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 02 04 7e 08 10 7e 20 40 00 00 00 00 00 00 ENDCHAR STARTCHAR C251 ENCODING 169 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 00 82 44 28 10 00 00 00 00 00 00 00 ENDCHAR STARTCHAR C253 ENCODING 171 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 41 22 14 08 14 22 41 00 00 00 00 00 ENDCHAR STARTCHAR C254 ENCODING 172 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 00 00 00 7e 00 00 18 18 08 10 20 00 ENDCHAR STARTCHAR C255 ENCODING 173 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 7f 41 49 41 7f 41 49 49 41 7f 00 00 00 00 ENDCHAR STARTCHAR C070 ENCODING 174 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 00 66 66 00 00 00 18 18 00 00 00 00 ENDCHAR STARTCHAR C257 ENCODING 175 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 01 02 02 04 04 08 7f 10 10 20 20 40 00 00 00 ENDCHAR STARTCHAR C260 ENCODING 176 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 33 4c 00 08 14 22 41 00 00 00 00 00 00 00 ENDCHAR STARTCHAR C261 ENCODING 177 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 08 00 08 08 08 08 08 08 08 08 00 00 00 00 ENDCHAR STARTCHAR C263 ENCODING 179 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 18 24 20 20 20 78 20 20 41 fe 00 00 00 00 ENDCHAR STARTCHAR C264 ENCODING 180 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 77 22 22 14 7f 08 7f 08 3e 00 00 00 00 ENDCHAR STARTCHAR C271 ENCODING 185 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 33 4c 00 41 22 14 08 00 00 00 00 00 00 00 ENDCHAR STARTCHAR C273 ENCODING 187 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 7f 41 41 49 55 55 49 41 41 7f 00 00 00 00 ENDCHAR STARTCHAR C274 ENCODING 188 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 7f 61 51 51 49 49 45 45 43 7f 00 00 00 00 ENDCHAR STARTCHAR C275 ENCODING 189 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 00 7f 00 7f 00 7f 00 00 00 00 00 00 ENDCHAR STARTCHAR C276 ENCODING 190 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 3c 24 24 24 24 24 24 24 24 3c 00 00 00 00 ENDCHAR STARTCHAR C277 ENCODING 191 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 18 00 00 18 10 20 40 42 46 3c 00 00 00 00 ENDCHAR STARTCHAR C301 ENCODING 193 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 00 00 3a 44 44 44 44 3b 00 00 00 00 ENDCHAR STARTCHAR C302 ENCODING 194 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 08 08 08 08 08 08 7f 00 00 00 00 00 ENDCHAR STARTCHAR C303 ENCODING 195 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 3c 42 42 42 42 42 42 42 00 00 00 00 ENDCHAR STARTCHAR C304 ENCODING 196 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 20 20 20 20 20 20 20 20 20 20 3c 00 00 00 00 ENDCHAR STARTCHAR C305 ENCODING 197 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 3c 40 40 78 40 40 3e 00 00 00 00 00 00 ENDCHAR STARTCHAR C307 ENCODING 199 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 7f 41 22 14 08 00 00 00 00 00 00 00 00 ENDCHAR STARTCHAR C310 ENCODING 200 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 08 14 22 41 7f 00 00 00 00 00 00 00 ENDCHAR STARTCHAR C311 ENCODING 201 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 00 30 10 10 10 10 12 0c 00 00 00 00 ENDCHAR STARTCHAR C312 ENCODING 202 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 00 18 24 24 18 00 00 00 00 00 00 00 ENDCHAR STARTCHAR C314 ENCODING 204 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 7f 41 41 41 41 41 41 41 41 7f 00 00 00 00 ENDCHAR STARTCHAR C315 ENCODING 205 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 10 10 10 10 10 10 10 10 10 10 00 00 00 00 00 ENDCHAR STARTCHAR C316 ENCODING 206 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 7f 08 08 08 08 08 08 00 00 00 00 00 ENDCHAR STARTCHAR C317 ENCODING 207 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 00 3c 42 42 42 42 3c 00 00 00 00 00 ENDCHAR STARTCHAR C322 ENCODING 210 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 00 1c 22 42 42 42 5c 40 40 40 00 00 ENDCHAR STARTCHAR C323 ENCODING 211 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 3c 20 20 20 20 20 20 20 20 20 20 00 00 00 00 ENDCHAR STARTCHAR C325 ENCODING 213 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 08 08 08 08 08 08 08 2a 1c 08 00 00 00 00 ENDCHAR STARTCHAR C326 ENCODING 214 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 42 42 42 42 42 42 42 3c 00 00 00 00 ENDCHAR STARTCHAR C327 ENCODING 215 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 00 00 21 49 49 49 49 36 00 00 00 00 ENDCHAR STARTCHAR C330 ENCODING 216 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 7c 02 02 02 02 7c 00 00 00 00 00 00 ENDCHAR STARTCHAR C331 ENCODING 217 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 08 1c 2a 08 08 08 08 08 08 08 00 00 00 00 ENDCHAR STARTCHAR C332 ENCODING 218 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 3e 40 40 40 40 3e 00 00 00 00 00 00 ENDCHAR STARTCHAR C333 ENCODING 219 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 40 40 40 7e 40 40 40 00 00 00 00 00 ENDCHAR STARTCHAR C334 ENCODING 220 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 40 20 20 10 10 08 7f 04 04 02 02 01 00 00 00 ENDCHAR STARTCHAR C335 ENCODING 221 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 02 02 02 7e 02 02 02 00 00 00 00 00 ENDCHAR STARTCHAR C337 ENCODING 223 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 08 08 00 7f 00 08 08 00 00 00 00 00 ENDCHAR STARTCHAR C340 ENCODING 224 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 7f 08 08 08 08 08 7f 00 00 00 00 00 ENDCHAR STARTCHAR C341 ENCODING 225 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 1e 21 21 3f 21 21 1e 00 00 00 00 00 ENDCHAR STARTCHAR C342 ENCODING 226 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 08 08 1c 2a 2a 1c 08 7f 00 00 00 00 00 ENDCHAR STARTCHAR C343 ENCODING 227 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 1c 22 22 22 3e 22 22 22 00 00 00 00 ENDCHAR STARTCHAR C345 ENCODING 229 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 3c 40 40 78 40 40 3e 00 7e 00 00 00 00 ENDCHAR STARTCHAR C346 ENCODING 230 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 33 4c 00 7f 41 22 14 08 00 00 00 00 00 00 ENDCHAR STARTCHAR C347 ENCODING 231 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 08 08 7f 49 49 2a 1c 08 08 08 00 00 00 00 00 ENDCHAR STARTCHAR C350 ENCODING 232 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 08 08 08 1c 2a 49 49 7f 08 08 00 00 00 00 00 ENDCHAR STARTCHAR C351 ENCODING 233 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 30 10 10 10 10 12 0c 00 3e 00 00 00 ENDCHAR STARTCHAR C352 ENCODING 234 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 24 00 00 18 24 24 18 00 00 00 00 00 00 00 ENDCHAR STARTCHAR C354 ENCODING 236 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 7f 49 49 49 41 41 41 41 41 7f 00 00 00 00 ENDCHAR STARTCHAR C356 ENCODING 238 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 7f 08 1c 2a 2a 1c 08 08 00 00 00 00 ENDCHAR STARTCHAR C357 ENCODING 239 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 22 00 00 1c 22 22 22 1c 00 00 00 00 00 00 ENDCHAR STARTCHAR C360 ENCODING 240 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 3e 49 6b 5d 55 63 3e 00 00 00 00 00 ENDCHAR STARTCHAR C364 ENCODING 244 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 80 7c 62 52 4a 46 3e 01 00 00 00 00 ENDCHAR STARTCHAR C367 ENCODING 247 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 08 08 08 3e 49 49 49 49 3e 08 08 00 00 00 ENDCHAR STARTCHAR C372 ENCODING 250 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 08 1c 2a 28 28 2a 1c 08 00 00 00 00 ENDCHAR STARTCHAR C373 ENCODING 251 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 00 20 40 ff 40 20 00 00 00 00 00 00 ENDCHAR STARTCHAR C374 ENCODING 252 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 08 14 22 41 7f 00 7f 00 00 00 00 00 ENDCHAR STARTCHAR C375 ENCODING 253 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 00 04 02 ff 02 04 00 00 00 00 00 00 ENDCHAR STARTCHAR C376 ENCODING 254 SWIDTH 573 0 DWIDTH 8 0 BBX 8 16 0 -5 BITMAP 00 00 00 00 08 14 22 41 22 14 08 00 00 00 00 00 ENDCHAR ENDFONT aplus-fsf-4.22/src/fonts/X11/bdf/Kaplgallant-19.bdf0000444000265000001440000007613506441546675015233 STARTFONT 2.1 COMMENT COMMENT WARNING: This bdf file was generated from a pcf file using COMMENT pcftobdf. The resulting font is subject to the same copyright, COMMENT license, and trademark restrictions as the original font. The COMMENT authors and distributors of fstobdf disclaim all liability for COMMENT misuse of the program or its output. COMMENT FONT --Kapl-Gallant-R-Normal--19-190-72-72-M--iso8859-1 SIZE 19 72 72 FONTBOUNDINGBOX 12 20 0 -5 STARTPROPERTIES 20 FONTNAME_REGISTRY "" FAMILY_NAME "Kapl" FOUNDRY "" WEIGHT_NAME "Gallant" SLANT "R" SETWIDTH_NAME "Normal" ADD_STYLE_NAME "" PIXEL_SIZE 19 POINT_SIZE 190 RESOLUTION_X 72 RESOLUTION_Y 72 SPACING "M" AVERAGE_WIDTH 80 CHARSET_REGISTRY "ISO8859" CHARSET_ENCODING "1" CHARSET_COLLECTIONS "ASCII ISO8859-1" FULL_NAME "Kapl" DEFAULT_CHAR 0 FONT_ASCENT 15 FONT_DESCENT 5 ENDPROPERTIES CHARS 255 STARTCHAR ENCODING 1 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 2 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 3 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 4 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 5 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 6 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 7 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 8 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 9 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 10 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 11 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 12 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 13 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 14 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 15 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 16 SWIDTH 42 0 DWIDTH 12 0 BBX 7 11 5 -5 BITMAP fe fe c0 c0 c0 c0 c0 c0 c0 c0 c0 ENDCHAR STARTCHAR ENCODING 17 SWIDTH 42 0 DWIDTH 12 0 BBX 12 11 0 -5 BITMAP fff0 fff0 0600 0600 0600 0600 0600 0600 0600 0600 0600 ENDCHAR STARTCHAR ENCODING 18 SWIDTH 42 0 DWIDTH 12 0 BBX 7 11 0 -5 BITMAP fe fe 06 06 06 06 06 06 06 06 06 ENDCHAR STARTCHAR ENCODING 19 SWIDTH 42 0 DWIDTH 12 0 BBX 7 20 5 -5 BITMAP c0 c0 c0 c0 c0 c0 c0 c0 c0 fe fe c0 c0 c0 c0 c0 c0 c0 c0 c0 ENDCHAR STARTCHAR ENCODING 20 SWIDTH 42 0 DWIDTH 12 0 BBX 12 20 0 -5 BITMAP 0600 0600 0600 0600 0600 0600 0600 0600 0600 fff0 fff0 0600 0600 0600 0600 0600 0600 0600 0600 0600 ENDCHAR STARTCHAR ENCODING 21 SWIDTH 42 0 DWIDTH 12 0 BBX 7 20 0 -5 BITMAP 06 06 06 06 06 06 06 06 06 fe fe 06 06 06 06 06 06 06 06 06 ENDCHAR STARTCHAR ENCODING 22 SWIDTH 42 0 DWIDTH 12 0 BBX 7 11 5 4 BITMAP c0 c0 c0 c0 c0 c0 c0 c0 c0 fe fe ENDCHAR STARTCHAR ENCODING 23 SWIDTH 42 0 DWIDTH 12 0 BBX 12 11 0 4 BITMAP 0600 0600 0600 0600 0600 0600 0600 0600 0600 fff0 fff0 ENDCHAR STARTCHAR ENCODING 24 SWIDTH 42 0 DWIDTH 12 0 BBX 7 11 0 4 BITMAP 06 06 06 06 06 06 06 06 06 fe fe ENDCHAR STARTCHAR ENCODING 25 SWIDTH 42 0 DWIDTH 12 0 BBX 2 20 5 -5 BITMAP c0 c0 c0 c0 c0 c0 c0 c0 c0 c0 c0 c0 c0 c0 c0 c0 c0 c0 c0 c0 ENDCHAR STARTCHAR ENCODING 26 SWIDTH 42 0 DWIDTH 12 0 BBX 12 2 0 4 BITMAP fff0 fff0 ENDCHAR STARTCHAR ENCODING 27 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 28 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 29 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 30 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 31 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 32 SWIDTH 42 0 DWIDTH 12 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 33 SWIDTH 42 0 DWIDTH 12 0 BBX 2 14 4 0 BITMAP c0 c0 c0 c0 c0 c0 c0 c0 c0 c0 c0 00 c0 c0 ENDCHAR STARTCHAR ENCODING 34 SWIDTH 42 0 DWIDTH 12 0 BBX 7 4 3 10 BITMAP c6 c6 c6 84 ENDCHAR STARTCHAR ENCODING 35 SWIDTH 42 0 DWIDTH 12 0 BBX 11 13 0 0 BITMAP 18c0 18c0 18c0 3180 ffe0 3180 3180 ffe0 3180 6300 6300 6300 6300 ENDCHAR STARTCHAR ENCODING 36 SWIDTH 42 0 DWIDTH 12 0 BBX 9 16 1 -1 BITMAP 1400 7e00 f700 d580 d400 d400 7400 3e00 1f00 1580 1580 d580 d580 f700 7e00 1400 ENDCHAR STARTCHAR ENCODING 37 SWIDTH 42 0 DWIDTH 12 0 BBX 12 14 0 0 BITMAP 7fe0 7860 ccc0 cd80 cd00 7b00 0600 0c00 19e0 1b30 3330 6330 c1e0 c1c0 ENDCHAR STARTCHAR ENCODING 38 SWIDTH 42 0 DWIDTH 12 0 BBX 11 14 0 0 BITMAP 1e00 6100 6080 6180 6300 3e00 7c00 d8e0 cc40 cec0 c780 c3a0 67a0 3ec0 ENDCHAR STARTCHAR ENCODING 39 SWIDTH 42 0 DWIDTH 12 0 BBX 2 5 5 10 BITMAP c0 c0 c0 c0 c0 ENDCHAR STARTCHAR ENCODING 40 SWIDTH 42 0 DWIDTH 12 0 BBX 6 17 5 -2 BITMAP 04 18 30 60 60 c0 c0 c0 c0 c0 c0 c0 60 60 30 18 04 ENDCHAR STARTCHAR ENCODING 41 SWIDTH 42 0 DWIDTH 12 0 BBX 6 17 1 -2 BITMAP 80 60 30 18 18 0c 0c 0c 0c 0c 0c 0c 18 18 30 60 80 ENDCHAR STARTCHAR ENCODING 42 SWIDTH 42 0 DWIDTH 12 0 BBX 9 11 1 3 BITMAP 0800 0800 0800 0800 ff80 7f00 1c00 1c00 3600 6300 4100 ENDCHAR STARTCHAR ENCODING 43 SWIDTH 42 0 DWIDTH 12 0 BBX 10 10 1 3 BITMAP 0c00 0c00 0c00 0c00 ffc0 ffc0 0c00 0c00 0c00 0c00 ENDCHAR STARTCHAR ENCODING 44 SWIDTH 42 0 DWIDTH 12 0 BBX 4 8 3 -5 BITMAP 60 f0 f0 30 30 60 c0 80 ENDCHAR STARTCHAR ENCODING 45 SWIDTH 42 0 DWIDTH 12 0 BBX 10 2 1 7 BITMAP ffc0 ffc0 ENDCHAR STARTCHAR ENCODING 46 SWIDTH 42 0 DWIDTH 12 0 BBX 4 4 3 0 BITMAP 60 f0 f0 60 ENDCHAR STARTCHAR ENCODING 47 SWIDTH 42 0 DWIDTH 12 0 BBX 10 15 1 0 BITMAP 00c0 0180 0180 0300 0300 0600 0600 0c00 1800 1800 3000 3000 6000 6000 c000 ENDCHAR STARTCHAR ENCODING 48 SWIDTH 42 0 DWIDTH 12 0 BBX 8 15 2 0 BITMAP 1c 3e 46 43 c3 c3 c3 c3 c3 c3 c3 c2 62 7c 38 ENDCHAR STARTCHAR ENCODING 49 SWIDTH 42 0 DWIDTH 12 0 BBX 8 15 2 0 BITMAP 08 18 38 78 d8 18 18 18 18 18 18 18 18 18 ff ENDCHAR STARTCHAR ENCODING 50 SWIDTH 42 0 DWIDTH 12 0 BBX 10 15 1 0 BITMAP 3e00 7f00 c380 8180 0180 0180 0180 0300 0600 0c00 1800 3000 6040 ffc0 ffc0 ENDCHAR STARTCHAR ENCODING 51 SWIDTH 42 0 DWIDTH 12 0 BBX 10 15 1 0 BITMAP 1f00 3f80 41c0 80c0 00c0 01c0 0f80 1f80 01c0 00c0 00c0 80c0 c080 7f00 3e00 ENDCHAR STARTCHAR ENCODING 52 SWIDTH 42 0 DWIDTH 12 0 BBX 10 15 1 0 BITMAP 0300 0700 0700 0b00 0b00 1300 1300 2300 2300 4300 7fc0 ffc0 0300 0300 0300 ENDCHAR STARTCHAR ENCODING 53 SWIDTH 42 0 DWIDTH 12 0 BBX 10 15 1 0 BITMAP 1f80 1f80 2000 2000 4000 7f00 6380 01c0 00c0 00c0 00c0 80c0 c0c0 6180 3f00 ENDCHAR STARTCHAR ENCODING 54 SWIDTH 42 0 DWIDTH 12 0 BBX 10 15 1 0 BITMAP 0e00 1800 3000 6000 6000 c000 cf00 df80 e1c0 c0c0 c0c0 c0c0 e080 7f00 3e00 ENDCHAR STARTCHAR ENCODING 55 SWIDTH 42 0 DWIDTH 12 0 BBX 10 15 1 0 BITMAP 3fc0 7fc0 c080 0080 0180 0100 0100 0300 0200 0200 0600 0400 0400 0c00 0800 ENDCHAR STARTCHAR ENCODING 56 SWIDTH 42 0 DWIDTH 12 0 BBX 8 15 2 0 BITMAP 3c 46 c3 c3 c3 62 34 18 2c 46 c3 c3 c3 62 3c ENDCHAR STARTCHAR ENCODING 57 SWIDTH 42 0 DWIDTH 12 0 BBX 10 15 1 0 BITMAP 1f00 2380 41c0 c0c0 c0c0 c0c0 e1c0 7ec0 3cc0 00c0 0180 0180 0300 0e00 7800 ENDCHAR STARTCHAR ENCODING 58 SWIDTH 42 0 DWIDTH 12 0 BBX 4 9 3 -1 BITMAP 60 f0 f0 60 00 60 f0 f0 60 ENDCHAR STARTCHAR ENCODING 59 SWIDTH 42 0 DWIDTH 12 0 BBX 4 13 3 -5 BITMAP 60 f0 f0 60 00 60 f0 f0 30 30 60 c0 80 ENDCHAR STARTCHAR ENCODING 60 SWIDTH 42 0 DWIDTH 12 0 BBX 10 10 1 3 BITMAP 00c0 0380 0e00 3c00 f000 f000 3c00 0e00 0380 00c0 ENDCHAR STARTCHAR ENCODING 61 SWIDTH 42 0 DWIDTH 12 0 BBX 10 6 1 4 BITMAP ffc0 ffc0 0000 0000 ffc0 ffc0 ENDCHAR STARTCHAR ENCODING 62 SWIDTH 42 0 DWIDTH 12 0 BBX 10 10 1 3 BITMAP c000 7000 3c00 0f00 03c0 03c0 0f00 3c00 7000 c000 ENDCHAR STARTCHAR ENCODING 63 SWIDTH 42 0 DWIDTH 12 0 BBX 9 15 1 -1 BITMAP 1e00 7700 e380 c180 0180 0180 0180 0700 1e00 1800 1800 1800 0000 1800 1800 ENDCHAR STARTCHAR ENCODING 64 SWIDTH 42 0 DWIDTH 12 0 BBX 12 13 0 0 BITMAP 1f00 30c0 6060 c790 8fd0 b190 b190 b190 b190 b310 9fb0 4060 3f80 ENDCHAR STARTCHAR ENCODING 65 SWIDTH 42 0 DWIDTH 12 0 BBX 12 14 0 0 BITMAP 0600 0600 0b00 0b00 0900 1180 1180 1080 3fc0 20c0 2040 4060 4060 e0f0 ENDCHAR STARTCHAR ENCODING 66 SWIDTH 42 0 DWIDTH 12 0 BBX 11 14 0 0 BITMAP ff00 6080 60c0 60c0 60c0 6180 7f80 60c0 6060 6060 6060 6060 60c0 ff80 ENDCHAR STARTCHAR ENCODING 67 SWIDTH 42 0 DWIDTH 12 0 BBX 10 14 1 0 BITMAP 1f80 20c0 4040 4000 c000 c000 c000 c000 c000 c000 4000 6040 3080 1f00 ENDCHAR STARTCHAR ENCODING 68 SWIDTH 42 0 DWIDTH 12 0 BBX 11 14 0 0 BITMAP ff00 61c0 60c0 6060 6060 6060 6060 6060 6060 6060 6060 6040 6180 fe00 ENDCHAR STARTCHAR ENCODING 69 SWIDTH 42 0 DWIDTH 12 0 BBX 10 14 1 0 BITMAP ff80 6080 6080 6000 6000 6100 7f00 6100 6000 6000 6000 6040 6040 ffc0 ENDCHAR STARTCHAR ENCODING 70 SWIDTH 42 0 DWIDTH 12 0 BBX 9 14 1 0 BITMAP ff80 6080 6080 6000 6000 6100 7f00 6100 6000 6000 6000 6000 6000 f000 ENDCHAR STARTCHAR ENCODING 71 SWIDTH 42 0 DWIDTH 12 0 BBX 11 14 1 0 BITMAP 1f80 20c0 4040 4000 c000 c000 c000 c000 c3e0 c0c0 40c0 60c0 30c0 1f00 ENDCHAR STARTCHAR ENCODING 72 SWIDTH 42 0 DWIDTH 12 0 BBX 12 14 0 0 BITMAP f0f0 6060 6060 6060 6060 6060 7fe0 6060 6060 6060 6060 6060 6060 f0f0 ENDCHAR STARTCHAR ENCODING 73 SWIDTH 42 0 DWIDTH 12 0 BBX 6 14 3 0 BITMAP fc 30 30 30 30 30 30 30 30 30 30 30 30 fc ENDCHAR STARTCHAR ENCODING 74 SWIDTH 42 0 DWIDTH 12 0 BBX 7 19 2 -5 BITMAP 7e 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 10 e0 c0 ENDCHAR STARTCHAR ENCODING 75 SWIDTH 42 0 DWIDTH 12 0 BBX 12 14 0 0 BITMAP f0e0 6180 6300 6600 6c00 7800 7800 7c00 6e00 6700 6380 61c0 60e0 f070 ENDCHAR STARTCHAR ENCODING 76 SWIDTH 42 0 DWIDTH 12 0 BBX 10 14 1 0 BITMAP f000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6040 6040 ffc0 ENDCHAR STARTCHAR ENCODING 77 SWIDTH 42 0 DWIDTH 12 0 BBX 12 14 0 0 BITMAP e070 60e0 70e0 70e0 70e0 5960 5960 5960 4d60 4e60 4e60 4460 4460 e4f0 ENDCHAR STARTCHAR ENCODING 78 SWIDTH 42 0 DWIDTH 12 0 BBX 12 14 0 0 BITMAP c070 6020 7020 7820 5820 4c20 4620 4720 4320 41a0 40e0 40e0 4060 e030 ENDCHAR STARTCHAR ENCODING 79 SWIDTH 42 0 DWIDTH 12 0 BBX 10 14 1 0 BITMAP 1e00 2380 4180 40c0 c0c0 c0c0 c0c0 c0c0 c0c0 c0c0 4080 6080 3100 1e00 ENDCHAR STARTCHAR ENCODING 80 SWIDTH 42 0 DWIDTH 12 0 BBX 10 14 1 0 BITMAP ff00 6180 60c0 60c0 60c0 6180 6f00 6000 6000 6000 6000 6000 6000 f000 ENDCHAR STARTCHAR ENCODING 81 SWIDTH 42 0 DWIDTH 12 0 BBX 11 17 1 -3 BITMAP 1e00 2380 4180 40c0 c0c0 c0c0 c0c0 c0c0 c0c0 c0c0 6080 7080 3f00 1c00 3e00 4720 03c0 ENDCHAR STARTCHAR ENCODING 82 SWIDTH 42 0 DWIDTH 12 0 BBX 12 14 0 0 BITMAP ff00 6180 60c0 60c0 60c0 6080 7f00 7c00 6e00 6700 6380 61c0 60e0 f070 ENDCHAR STARTCHAR ENCODING 83 SWIDTH 42 0 DWIDTH 12 0 BBX 10 14 1 0 BITMAP 3fc0 60c0 c040 c040 e000 7800 3c00 0f00 0380 01c0 80c0 80c0 c180 ff00 ENDCHAR STARTCHAR ENCODING 84 SWIDTH 42 0 DWIDTH 12 0 BBX 10 14 1 0 BITMAP ffc0 8c40 0c00 0c00 0c00 0c00 0c00 0c00 0c00 0c00 0c00 0c00 0c00 3f00 ENDCHAR STARTCHAR ENCODING 85 SWIDTH 42 0 DWIDTH 12 0 BBX 12 14 0 0 BITMAP f070 6020 6020 6020 6020 6020 6020 6020 6020 6020 6020 7040 3fc0 1f80 ENDCHAR STARTCHAR ENCODING 86 SWIDTH 42 0 DWIDTH 12 0 BBX 11 14 0 0 BITMAP e0e0 6040 3080 3080 3080 1900 1900 1900 0c00 0e00 0e00 0400 0400 0400 ENDCHAR STARTCHAR ENCODING 87 SWIDTH 42 0 DWIDTH 12 0 BBX 12 14 0 0 BITMAP fef0 6620 6620 6620 7620 7740 3340 3740 3bc0 3b80 1980 1980 1980 1980 ENDCHAR STARTCHAR ENCODING 88 SWIDTH 42 0 DWIDTH 12 0 BBX 12 14 0 0 BITMAP f070 6020 3040 3880 1880 0d00 0600 0600 0b00 1180 11c0 20c0 4060 e0f0 ENDCHAR STARTCHAR ENCODING 89 SWIDTH 42 0 DWIDTH 12 0 BBX 12 14 0 0 BITMAP f070 6020 3040 1880 1880 0d00 0600 0600 0600 0600 0600 0600 0600 0f00 ENDCHAR STARTCHAR ENCODING 90 SWIDTH 42 0 DWIDTH 12 0 BBX 9 14 2 0 BITMAP ff80 8300 0300 0600 0600 0c00 0c00 1800 1800 3000 3000 6000 6080 ff80 ENDCHAR STARTCHAR ENCODING 91 SWIDTH 42 0 DWIDTH 12 0 BBX 5 15 5 0 BITMAP f8 c0 c0 c0 c0 c0 c0 c0 c0 c0 c0 c0 c0 c0 f8 ENDCHAR STARTCHAR ENCODING 92 SWIDTH 42 0 DWIDTH 12 0 BBX 9 15 1 0 BITMAP c000 c000 6000 6000 3000 3000 1800 1800 0c00 0600 0600 0300 0300 0180 0180 ENDCHAR STARTCHAR ENCODING 93 SWIDTH 42 0 DWIDTH 12 0 BBX 5 15 1 0 BITMAP f8 18 18 18 18 18 18 18 18 18 18 18 18 18 f8 ENDCHAR STARTCHAR ENCODING 94 SWIDTH 42 0 DWIDTH 12 0 BBX 11 6 0 4 BITMAP 0400 0e00 1b00 3180 60c0 c060 ENDCHAR STARTCHAR ENCODING 95 SWIDTH 42 0 DWIDTH 12 0 BBX 12 2 0 -3 BITMAP fff0 fff0 ENDCHAR STARTCHAR ENCODING 96 SWIDTH 42 0 DWIDTH 12 0 BBX 5 6 3 8 BITMAP e0 e0 f0 70 38 08 ENDCHAR STARTCHAR ENCODING 97 SWIDTH 42 0 DWIDTH 12 0 BBX 9 10 2 0 BITMAP 3e00 6300 4300 0f00 7300 c300 c300 c300 e700 7b80 ENDCHAR STARTCHAR ENCODING 98 SWIDTH 42 0 DWIDTH 12 0 BBX 11 15 0 0 BITMAP 2000 6000 e000 6000 6000 6780 6fc0 70e0 6060 6060 6060 6060 7060 78c0 4f80 ENDCHAR STARTCHAR ENCODING 99 SWIDTH 42 0 DWIDTH 12 0 BBX 9 10 1 0 BITMAP 3f00 6380 4180 c000 c000 c000 c000 e080 6180 3f00 ENDCHAR STARTCHAR ENCODING 100 SWIDTH 42 0 DWIDTH 12 0 BBX 11 15 1 0 BITMAP 00c0 01c0 00c0 00c0 00c0 1ec0 63c0 41c0 c0c0 c0c0 c0c0 c0c0 e1c0 72c0 3ce0 ENDCHAR STARTCHAR ENCODING 101 SWIDTH 42 0 DWIDTH 12 0 BBX 10 10 1 0 BITMAP 1e00 6180 c0c0 c0c0 ffc0 c000 c000 6000 30c0 1f00 ENDCHAR STARTCHAR ENCODING 102 SWIDTH 42 0 DWIDTH 12 0 BBX 7 15 3 0 BITMAP 1c 26 26 60 60 60 60 fc 60 60 60 60 60 60 f0 ENDCHAR STARTCHAR ENCODING 103 SWIDTH 42 0 DWIDTH 12 0 BBX 10 15 1 -5 BITMAP 3e40 63c0 c180 c180 c180 6300 7e00 c000 ff80 7fc0 40c0 8040 8040 ff80 7f00 ENDCHAR STARTCHAR ENCODING 104 SWIDTH 42 0 DWIDTH 12 0 BBX 10 15 1 0 BITMAP 2000 6000 e000 6000 6000 6f00 7380 6180 6180 6180 6180 6180 6180 6180 f3c0 ENDCHAR STARTCHAR ENCODING 105 SWIDTH 42 0 DWIDTH 12 0 BBX 6 14 3 0 BITMAP 30 30 00 00 f0 30 30 30 30 30 30 30 30 fc ENDCHAR STARTCHAR ENCODING 106 SWIDTH 42 0 DWIDTH 12 0 BBX 8 19 2 -5 BITMAP 03 03 00 00 0f 03 03 03 03 03 03 03 03 03 83 c3 e2 7c 38 ENDCHAR STARTCHAR ENCODING 107 SWIDTH 42 0 DWIDTH 12 0 BBX 11 15 0 0 BITMAP 6000 e000 6000 6000 6000 61c0 6300 6600 7c00 7800 7c00 6e00 6700 6380 f1e0 ENDCHAR STARTCHAR ENCODING 108 SWIDTH 42 0 DWIDTH 12 0 BBX 6 15 3 0 BITMAP f0 30 30 30 30 30 30 30 30 30 30 30 30 30 fc ENDCHAR STARTCHAR ENCODING 109 SWIDTH 42 0 DWIDTH 12 0 BBX 12 10 0 0 BITMAP ddc0 6ee0 6660 6660 6660 6660 6660 6660 6660 ef70 ENDCHAR STARTCHAR ENCODING 110 SWIDTH 42 0 DWIDTH 12 0 BBX 10 10 1 0 BITMAP 4f00 f380 6180 6180 6180 6180 6180 6180 6180 f3c0 ENDCHAR STARTCHAR ENCODING 111 SWIDTH 42 0 DWIDTH 12 0 BBX 10 10 1 0 BITMAP 1f00 2380 41c0 c0c0 c0c0 c0c0 c0c0 e080 7100 3e00 ENDCHAR STARTCHAR ENCODING 112 SWIDTH 42 0 DWIDTH 12 0 BBX 11 15 0 -5 BITMAP ef80 71c0 60e0 6060 6060 6060 6060 6040 7080 7f00 6000 6000 6000 6000 f000 ENDCHAR STARTCHAR ENCODING 113 SWIDTH 42 0 DWIDTH 12 0 BBX 11 15 1 -5 BITMAP 1e40 23c0 41c0 c0c0 c0c0 c0c0 c0c0 e0c0 71c0 3fc0 00c0 00c0 00c0 00c0 01e0 ENDCHAR STARTCHAR ENCODING 114 SWIDTH 42 0 DWIDTH 12 0 BBX 9 10 1 0 BITMAP e700 6980 7180 6000 6000 6000 6000 6000 6000 f000 ENDCHAR STARTCHAR ENCODING 115 SWIDTH 42 0 DWIDTH 12 0 BBX 8 10 2 0 BITMAP 7f c3 c1 e0 78 1e 07 83 c3 fe ENDCHAR STARTCHAR ENCODING 116 SWIDTH 42 0 DWIDTH 12 0 BBX 10 13 1 0 BITMAP 0800 0800 1800 ff80 1800 1800 1800 1800 1800 1800 1840 1c80 0f00 ENDCHAR STARTCHAR ENCODING 117 SWIDTH 42 0 DWIDTH 12 0 BBX 10 10 1 0 BITMAP f3c0 6180 6180 6180 6180 6180 6180 6180 7380 3cc0 ENDCHAR STARTCHAR ENCODING 118 SWIDTH 42 0 DWIDTH 12 0 BBX 12 10 0 0 BITMAP f070 6020 3040 3040 1880 1880 0d00 0d00 0600 0600 ENDCHAR STARTCHAR ENCODING 119 SWIDTH 42 0 DWIDTH 12 0 BBX 12 10 0 0 BITMAP ff70 6620 6620 6620 3740 3b40 3b40 1980 1980 1980 ENDCHAR STARTCHAR ENCODING 120 SWIDTH 42 0 DWIDTH 12 0 BBX 12 10 0 0 BITMAP f8f0 7040 3880 1d00 0e00 0700 0b80 11c0 20e0 f1f0 ENDCHAR STARTCHAR ENCODING 121 SWIDTH 42 0 DWIDTH 12 0 BBX 12 15 0 -5 BITMAP f0f0 6020 3040 3040 1880 1880 0d00 0d00 0600 0600 0400 0c00 0800 7800 7000 ENDCHAR STARTCHAR ENCODING 122 SWIDTH 42 0 DWIDTH 12 0 BBX 10 10 1 0 BITMAP ffc0 c1c0 8380 0700 0e00 1c00 3800 7040 e0c0 ffc0 ENDCHAR STARTCHAR ENCODING 123 SWIDTH 42 0 DWIDTH 12 0 BBX 5 15 5 0 BITMAP 38 60 60 30 30 30 60 e0 60 30 30 30 60 60 38 ENDCHAR STARTCHAR ENCODING 124 SWIDTH 42 0 DWIDTH 12 0 BBX 2 14 5 0 BITMAP c0 c0 c0 c0 c0 c0 c0 c0 c0 c0 c0 c0 c0 c0 ENDCHAR STARTCHAR ENCODING 125 SWIDTH 42 0 DWIDTH 12 0 BBX 5 15 2 0 BITMAP e0 30 30 60 60 60 30 38 30 60 60 60 30 30 e0 ENDCHAR STARTCHAR ENCODING 126 SWIDTH 42 0 DWIDTH 12 0 BBX 10 5 1 3 BITMAP 3840 7cc0 6d80 cf80 8700 ENDCHAR STARTCHAR ENCODING 127 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 128 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 129 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 130 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 131 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 132 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 133 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 134 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 135 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 136 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 137 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 138 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 139 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 140 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 141 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 142 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 143 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 144 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 145 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 146 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 147 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 148 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 149 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 150 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 151 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 152 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 153 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 154 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 155 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 156 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 157 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 158 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 159 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 160 SWIDTH 42 0 DWIDTH 12 0 BBX 12 15 0 0 BITMAP 0700 0f80 1180 10c0 30c0 30d0 7cd0 f6f0 b6e0 b3c0 30c0 3080 1880 1f00 0e00 ENDCHAR STARTCHAR ENCODING 161 SWIDTH 42 0 DWIDTH 12 0 BBX 9 3 2 11 BITMAP e380 e380 e380 ENDCHAR STARTCHAR ENCODING 162 SWIDTH 42 0 DWIDTH 12 0 BBX 8 2 2 12 BITMAP ff ff ENDCHAR STARTCHAR ENCODING 163 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 164 SWIDTH 42 0 DWIDTH 12 0 BBX 10 13 1 0 BITMAP 00c0 0380 0e00 3c00 f000 f000 3c00 0e00 0380 00c0 0000 ffc0 ffc0 ENDCHAR STARTCHAR ENCODING 165 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 166 SWIDTH 42 0 DWIDTH 12 0 BBX 10 13 1 0 BITMAP c000 7000 3c00 0f00 03c0 03c0 0f00 3c00 7000 c000 0000 ffc0 ffc0 ENDCHAR STARTCHAR ENCODING 167 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 168 SWIDTH 42 0 DWIDTH 12 0 BBX 10 14 1 0 BITMAP 00c0 00c0 0180 0180 ffc0 ffc0 0c00 0c00 ffc0 ffc0 6000 6000 c000 c000 ENDCHAR STARTCHAR ENCODING 169 SWIDTH 42 0 DWIDTH 12 0 BBX 11 6 0 4 BITMAP c060 60c0 3180 1b00 0e00 0400 ENDCHAR STARTCHAR ENCODING 170 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 171 SWIDTH 42 0 DWIDTH 12 0 BBX 10 9 1 3 BITMAP c0c0 6180 3300 1e00 0c00 1e00 3300 6180 c0c0 ENDCHAR STARTCHAR ENCODING 172 SWIDTH 42 0 DWIDTH 12 0 BBX 8 13 1 -5 BITMAP ff ff 00 00 00 18 3c 3c 0c 0c 18 30 20 ENDCHAR STARTCHAR ENCODING 173 SWIDTH 42 0 DWIDTH 12 0 BBX 10 14 1 0 BITMAP ffc0 c0c0 ccc0 ccc0 ccc0 c0c0 ffc0 ffc0 c0c0 ccc0 ccc0 ccc0 c0c0 ffc0 ENDCHAR STARTCHAR ENCODING 174 SWIDTH 42 0 DWIDTH 12 0 BBX 9 11 2 3 BITMAP e380 e380 e380 0000 0000 0000 0000 0000 1c00 1c00 1c00 ENDCHAR STARTCHAR ENCODING 175 SWIDTH 42 0 DWIDTH 12 0 BBX 10 15 1 0 BITMAP 00c0 0180 0180 0300 0300 0600 0600 ff80 ff80 1800 3000 3000 6000 6000 c000 ENDCHAR STARTCHAR ENCODING 176 SWIDTH 42 0 DWIDTH 12 0 BBX 11 11 0 4 BITMAP 3820 7c60 c7e0 8380 0000 0400 0e00 1b00 3180 60c0 c060 ENDCHAR STARTCHAR ENCODING 177 SWIDTH 42 0 DWIDTH 12 0 BBX 2 15 5 -1 BITMAP c0 c0 00 00 c0 c0 c0 c0 c0 c0 c0 c0 c0 c0 c0 ENDCHAR STARTCHAR ENCODING 178 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 179 SWIDTH 42 0 DWIDTH 12 0 BBX 10 14 0 0 BITMAP 0f00 1980 1800 1800 1800 1800 3e00 3e00 1800 1800 1800 30c0 61c0 ff80 ENDCHAR STARTCHAR ENCODING 180 SWIDTH 42 0 DWIDTH 12 0 BBX 12 14 0 0 BITMAP f070 6020 3040 1880 1880 0d00 0600 7fe0 0600 7fe0 0600 0600 0600 0f00 ENDCHAR STARTCHAR ENCODING 181 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 182 SWIDTH 42 0 DWIDTH 12 0 BBX 10 5 1 4 BITMAP ffc0 ffc0 c000 c000 c000 ENDCHAR STARTCHAR ENCODING 183 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 184 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 185 SWIDTH 42 0 DWIDTH 12 0 BBX 11 11 0 4 BITMAP 3820 7c60 c7e0 8380 0000 c060 60c0 3180 1b00 0e00 0400 ENDCHAR STARTCHAR ENCODING 186 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 187 SWIDTH 42 0 DWIDTH 12 0 BBX 10 14 1 0 BITMAP ffc0 c0c0 c0c0 c0c0 ccc0 d2c0 f3c0 f3c0 d2c0 ccc0 c0c0 c0c0 c0c0 ffc0 ENDCHAR STARTCHAR ENCODING 188 SWIDTH 42 0 DWIDTH 12 0 BBX 10 14 1 0 BITMAP ffc0 c0c0 c0c0 e0c0 d0c0 d0c0 c8c0 c4c0 c2c0 c2c0 c1c0 c0c0 c0c0 ffc0 ENDCHAR STARTCHAR ENCODING 189 SWIDTH 42 0 DWIDTH 12 0 BBX 10 10 1 3 BITMAP ffc0 ffc0 0000 0000 ffc0 ffc0 0000 0000 ffc0 ffc0 ENDCHAR STARTCHAR ENCODING 190 SWIDTH 42 0 DWIDTH 12 0 BBX 6 14 3 0 BITMAP fc cc cc cc cc cc cc cc cc cc cc cc cc fc ENDCHAR STARTCHAR ENCODING 191 SWIDTH 42 0 DWIDTH 12 0 BBX 9 15 1 -1 BITMAP 0c00 0c00 0000 0c00 0c00 0c00 1c00 7000 e000 c000 c000 e180 e180 7700 1e00 ENDCHAR STARTCHAR ENCODING 192 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 193 SWIDTH 42 0 DWIDTH 12 0 BBX 10 9 1 0 BITMAP 3e40 6380 c300 c300 c300 c300 c300 e780 7dc0 ENDCHAR STARTCHAR ENCODING 194 SWIDTH 42 0 DWIDTH 12 0 BBX 9 10 1 0 BITMAP 0800 0800 0800 0800 0800 0800 0800 0800 ff80 ff80 ENDCHAR STARTCHAR ENCODING 195 SWIDTH 42 0 DWIDTH 12 0 BBX 8 10 2 2 BITMAP 3c 66 c3 c3 c3 c3 c3 c3 c3 c3 ENDCHAR STARTCHAR ENCODING 196 SWIDTH 42 0 DWIDTH 12 0 BBX 5 15 4 0 BITMAP c0 c0 c0 c0 c0 c0 c0 c0 c0 c0 c0 c0 c0 f8 f8 ENDCHAR STARTCHAR ENCODING 197 SWIDTH 42 0 DWIDTH 12 0 BBX 8 9 2 3 BITMAP 1f 60 40 c0 fc c0 c0 40 3e ENDCHAR STARTCHAR ENCODING 198 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 199 SWIDTH 42 0 DWIDTH 12 0 BBX 10 11 1 0 BITMAP ffc0 c040 c040 6080 6080 3100 3100 1a00 1a00 0c00 0c00 ENDCHAR STARTCHAR ENCODING 200 SWIDTH 42 0 DWIDTH 12 0 BBX 10 11 1 0 BITMAP 0c00 0c00 1a00 1a00 3100 3100 6080 6080 c040 c040 ffc0 ENDCHAR STARTCHAR ENCODING 201 SWIDTH 42 0 DWIDTH 12 0 BBX 6 9 4 2 BITMAP e0 60 60 60 60 60 60 64 38 ENDCHAR STARTCHAR ENCODING 202 SWIDTH 42 0 DWIDTH 12 0 BBX 6 5 3 3 BITMAP 78 cc cc cc 78 ENDCHAR STARTCHAR ENCODING 203 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 204 SWIDTH 42 0 DWIDTH 12 0 BBX 10 14 1 0 BITMAP ffc0 c0c0 c0c0 c0c0 c0c0 c0c0 c0c0 c0c0 c0c0 c0c0 c0c0 c0c0 c0c0 ffc0 ENDCHAR STARTCHAR ENCODING 205 SWIDTH 42 0 DWIDTH 12 0 BBX 2 14 5 0 BITMAP c0 c0 c0 c0 c0 c0 c0 c0 c0 c0 c0 c0 c0 c0 ENDCHAR STARTCHAR ENCODING 206 SWIDTH 42 0 DWIDTH 12 0 BBX 9 10 1 0 BITMAP ff80 ff80 0800 0800 0800 0800 0800 0800 0800 0800 ENDCHAR STARTCHAR ENCODING 207 SWIDTH 42 0 DWIDTH 12 0 BBX 9 9 1 1 BITMAP 3e00 6300 c180 c180 c180 c180 c180 6300 3e00 ENDCHAR STARTCHAR ENCODING 208 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 209 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 210 SWIDTH 42 0 DWIDTH 12 0 BBX 10 14 1 -4 BITMAP 1f00 2380 41c0 c0c0 c0c0 c0c0 c0c0 e080 f100 fe00 c000 c000 c000 c000 ENDCHAR STARTCHAR ENCODING 211 SWIDTH 42 0 DWIDTH 12 0 BBX 5 15 4 0 BITMAP f8 f8 c0 c0 c0 c0 c0 c0 c0 c0 c0 c0 c0 c0 c0 ENDCHAR STARTCHAR ENCODING 212 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 213 SWIDTH 42 0 DWIDTH 12 0 BBX 8 15 1 -1 BITMAP 18 18 18 18 18 18 18 18 18 18 18 99 5a 3c 18 ENDCHAR STARTCHAR ENCODING 214 SWIDTH 42 0 DWIDTH 12 0 BBX 8 10 2 2 BITMAP c3 c3 c3 c3 c3 c3 c3 c3 66 3c ENDCHAR STARTCHAR ENCODING 215 SWIDTH 42 0 DWIDTH 12 0 BBX 10 9 1 0 BITMAP 2080 60c0 60c0 c0c0 c4c0 ccc0 ccc0 7f80 3300 ENDCHAR STARTCHAR ENCODING 216 SWIDTH 42 0 DWIDTH 12 0 BBX 10 9 1 4 BITMAP ff00 ff80 0180 00c0 00c0 00c0 0180 ff80 ff00 ENDCHAR STARTCHAR ENCODING 217 SWIDTH 42 0 DWIDTH 12 0 BBX 8 15 1 0 BITMAP 18 3c 5a 99 18 18 18 18 18 18 18 18 18 18 18 ENDCHAR STARTCHAR ENCODING 218 SWIDTH 42 0 DWIDTH 12 0 BBX 10 9 1 4 BITMAP 3fc0 7fc0 6000 c000 c000 c000 6000 7fc0 3fc0 ENDCHAR STARTCHAR ENCODING 219 SWIDTH 42 0 DWIDTH 12 0 BBX 10 10 1 3 BITMAP c000 c000 c000 c000 ffc0 ffc0 c000 c000 c000 c000 ENDCHAR STARTCHAR ENCODING 220 SWIDTH 42 0 DWIDTH 12 0 BBX 10 15 1 0 BITMAP c000 c000 6000 6000 3000 3000 1800 ffc0 ffc0 0600 0600 0300 0300 0180 0180 ENDCHAR STARTCHAR ENCODING 221 SWIDTH 42 0 DWIDTH 12 0 BBX 10 11 1 3 BITMAP 00c0 00c0 00c0 00c0 00c0 ffc0 ffc0 00c0 00c0 00c0 00c0 ENDCHAR STARTCHAR ENCODING 222 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 223 SWIDTH 42 0 DWIDTH 12 0 BBX 10 10 1 3 BITMAP 0c00 0c00 0000 0000 ffc0 ffc0 0000 0000 0c00 0c00 ENDCHAR STARTCHAR ENCODING 224 SWIDTH 42 0 DWIDTH 12 0 BBX 8 11 2 0 BITMAP ff ff 18 18 18 18 18 18 18 ff ff ENDCHAR STARTCHAR ENCODING 225 SWIDTH 42 0 DWIDTH 12 0 BBX 9 10 1 1 BITMAP 3e00 6300 c180 8080 ff80 ff80 8080 c180 6300 3e00 ENDCHAR STARTCHAR ENCODING 226 SWIDTH 42 0 DWIDTH 12 0 BBX 9 11 1 0 BITMAP 0800 0800 3e00 6b00 6b00 6b00 6b00 3e00 0800 ff80 ff80 ENDCHAR STARTCHAR ENCODING 227 SWIDTH 42 0 DWIDTH 12 0 BBX 8 10 2 0 BITMAP 3c 66 c3 c3 e7 ff c3 c3 c3 c3 ENDCHAR STARTCHAR ENCODING 228 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 229 SWIDTH 42 0 DWIDTH 12 0 BBX 9 12 2 0 BITMAP 1f00 6000 4000 c000 fc00 c000 c000 4000 3e00 0000 ff80 ff80 ENDCHAR STARTCHAR ENCODING 230 SWIDTH 42 0 DWIDTH 12 0 BBX 10 15 1 0 BITMAP 3840 6ec0 c780 0000 ffc0 c040 c040 6080 6080 3100 3100 1a00 1a00 0c00 0c00 ENDCHAR STARTCHAR ENCODING 231 SWIDTH 42 0 DWIDTH 12 0 BBX 10 15 1 0 BITMAP 0400 0400 0400 ffc0 c440 c440 6480 6480 3500 3500 1e00 1e00 0c00 0c00 0c00 ENDCHAR STARTCHAR ENCODING 232 SWIDTH 42 0 DWIDTH 12 0 BBX 10 16 1 -1 BITMAP 0c00 0c00 0c00 0c00 1e00 1600 3500 3500 6480 6480 c440 c440 ffc0 0400 0400 0400 ENDCHAR STARTCHAR ENCODING 233 SWIDTH 42 0 DWIDTH 12 0 BBX 10 12 2 -1 BITMAP 3800 1800 1800 1800 1800 1800 1800 1900 0e00 0000 ffc0 ffc0 ENDCHAR STARTCHAR ENCODING 234 SWIDTH 42 0 DWIDTH 12 0 BBX 6 8 3 3 BITMAP cc cc 00 78 cc cc cc 78 ENDCHAR STARTCHAR ENCODING 235 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 236 SWIDTH 42 0 DWIDTH 12 0 BBX 10 14 1 0 BITMAP ffc0 ccc0 ccc0 ccc0 ccc0 c0c0 c0c0 c0c0 c0c0 c0c0 c0c0 c0c0 c0c0 ffc0 ENDCHAR STARTCHAR ENCODING 237 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 238 SWIDTH 42 0 DWIDTH 12 0 BBX 9 11 1 0 BITMAP ff80 ff80 0800 3e00 6b00 6b00 6b00 6b00 3e00 0800 0800 ENDCHAR STARTCHAR ENCODING 239 SWIDTH 42 0 DWIDTH 12 0 BBX 9 12 1 1 BITMAP 6180 6180 0000 3e00 6300 c180 8080 8080 8080 c180 6300 3e00 ENDCHAR STARTCHAR ENCODING 240 SWIDTH 42 0 DWIDTH 12 0 BBX 9 9 1 1 BITMAP 3e00 6b00 c980 aa80 9c80 9480 f780 6300 3e00 ENDCHAR STARTCHAR ENCODING 241 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 242 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 243 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 244 SWIDTH 42 0 DWIDTH 12 0 BBX 11 11 0 0 BITMAP c000 6f00 3980 78c0 6c40 6640 6340 61c0 31c0 1f60 0020 ENDCHAR STARTCHAR ENCODING 245 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 246 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 247 SWIDTH 42 0 DWIDTH 12 0 BBX 9 15 1 -2 BITMAP 0800 0800 0800 3e00 6b00 c980 c980 c980 c980 c980 6b00 3e00 0800 0800 0800 ENDCHAR STARTCHAR ENCODING 248 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 249 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 250 SWIDTH 42 0 DWIDTH 12 0 BBX 9 15 1 -2 BITMAP 0c00 0c00 0c00 3f00 6f80 4d80 cc00 cc00 cc00 cc00 ec80 6d80 3f00 0c00 0c00 ENDCHAR STARTCHAR ENCODING 251 SWIDTH 42 0 DWIDTH 12 0 BBX 10 8 1 4 BITMAP 1000 2000 4000 ffc0 ffc0 4000 2000 1000 ENDCHAR STARTCHAR ENCODING 252 SWIDTH 42 0 DWIDTH 12 0 BBX 10 14 1 -1 BITMAP 0c00 0c00 1a00 1a00 3100 3100 6080 6080 c040 c040 ffc0 0000 ffc0 ffc0 ENDCHAR STARTCHAR ENCODING 253 SWIDTH 42 0 DWIDTH 12 0 BBX 10 8 1 4 BITMAP 0200 0100 0080 ffc0 ffc0 0080 0100 0200 ENDCHAR STARTCHAR ENCODING 254 SWIDTH 42 0 DWIDTH 12 0 BBX 11 11 0 1 BITMAP 0400 0e00 1b00 3180 60c0 c060 60c0 3180 1b00 0e00 0400 ENDCHAR STARTCHAR ENCODING 255 SWIDTH 42 0 DWIDTH 0 0 BBX 0 0 0 0 BITMAP ENDCHAR ENDFONT aplus-fsf-4.22/src/fonts/X11/bdf/Kaplscreen-11.bdf0000444000265000001440000005145606441546676015060 STARTFONT 2.1 COMMENT COMMENT WARNING: This bdf file was generated from a pcf file using COMMENT pcftobdf. The resulting font is subject to the same copyright, COMMENT license, and trademark restrictions as the original font. The COMMENT authors and distributors of fstobdf disclaim all liability for COMMENT misuse of the program or its output. COMMENT FONT --Kapl-Screen-R-Normal--11-110-72-72-M--iso8859-1 SIZE 11 72 72 FONTBOUNDINGBOX 8 11 0 -3 STARTPROPERTIES 20 FONTNAME_REGISTRY "" FAMILY_NAME "Kapl" FOUNDRY "" WEIGHT_NAME "Screen" SLANT "R" SETWIDTH_NAME "Normal" ADD_STYLE_NAME "" PIXEL_SIZE 11 POINT_SIZE 110 RESOLUTION_X 72 RESOLUTION_Y 72 SPACING "M" AVERAGE_WIDTH 80 CHARSET_REGISTRY "ISO8859" CHARSET_ENCODING "1" CHARSET_COLLECTIONS "ASCII ISO8859-1" FULL_NAME "Kapl" DEFAULT_CHAR 0 FONT_ASCENT 8 FONT_DESCENT 3 ENDPROPERTIES CHARS 174 STARTCHAR ENCODING 16 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 00 00 1f 1f 18 18 18 18 18 ENDCHAR STARTCHAR ENCODING 17 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 00 00 ff ff 18 18 18 18 18 ENDCHAR STARTCHAR ENCODING 18 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 00 00 f8 f8 18 18 18 18 18 ENDCHAR STARTCHAR ENCODING 19 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 18 18 18 18 1f 1f 18 18 18 18 18 ENDCHAR STARTCHAR ENCODING 20 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 18 18 18 18 ff ff 18 18 18 18 18 ENDCHAR STARTCHAR ENCODING 21 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 18 18 18 18 f8 f8 18 18 18 18 18 ENDCHAR STARTCHAR ENCODING 22 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 18 18 18 18 1f 1f 00 00 00 00 00 ENDCHAR STARTCHAR ENCODING 23 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 18 18 18 18 ff ff 00 00 00 00 00 ENDCHAR STARTCHAR ENCODING 24 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 18 18 18 18 f8 f8 00 00 00 00 00 ENDCHAR STARTCHAR ENCODING 25 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 18 18 18 18 18 18 18 18 18 18 18 ENDCHAR STARTCHAR ENCODING 26 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 00 00 ff ff 00 00 00 00 00 ENDCHAR STARTCHAR ENCODING 32 SWIDTH 42 0 DWIDTH 8 0 BBX 0 0 0 0 BITMAP ENDCHAR STARTCHAR ENCODING 33 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 08 08 08 08 00 08 08 00 00 00 ENDCHAR STARTCHAR ENCODING 34 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 24 24 24 00 00 00 00 00 00 00 ENDCHAR STARTCHAR ENCODING 35 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 24 24 7e 24 7e 24 24 00 00 00 ENDCHAR STARTCHAR ENCODING 36 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 10 38 54 50 38 14 54 38 10 00 00 ENDCHAR STARTCHAR ENCODING 37 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 c2 c4 08 10 20 46 86 00 00 00 ENDCHAR STARTCHAR ENCODING 38 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 30 48 30 52 4a 46 3d 00 00 00 ENDCHAR STARTCHAR ENCODING 39 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 08 08 08 00 00 00 00 00 00 00 ENDCHAR STARTCHAR ENCODING 40 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 04 08 10 10 10 08 04 00 00 00 ENDCHAR STARTCHAR ENCODING 41 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 10 08 04 04 04 08 10 00 00 00 ENDCHAR STARTCHAR ENCODING 42 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 08 2a 1c 2a 08 00 00 00 00 ENDCHAR STARTCHAR ENCODING 43 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 08 08 7f 08 08 00 00 00 00 ENDCHAR STARTCHAR ENCODING 44 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 00 00 00 00 18 10 20 00 00 ENDCHAR STARTCHAR ENCODING 45 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 00 00 3e 00 00 00 00 00 00 ENDCHAR STARTCHAR ENCODING 46 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 00 00 00 00 08 08 00 00 00 ENDCHAR STARTCHAR ENCODING 47 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 01 02 04 08 10 20 40 00 00 00 ENDCHAR STARTCHAR ENCODING 48 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 18 24 42 42 42 24 18 00 00 00 ENDCHAR STARTCHAR ENCODING 49 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 08 18 28 08 08 08 3e 00 00 00 ENDCHAR STARTCHAR ENCODING 50 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 3c 42 02 0c 30 40 7e 00 00 00 ENDCHAR STARTCHAR ENCODING 51 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 7e 04 08 1c 02 42 3c 00 00 00 ENDCHAR STARTCHAR ENCODING 52 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 0c 14 24 44 7e 04 04 00 00 00 ENDCHAR STARTCHAR ENCODING 53 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 7e 40 5c 62 02 62 3c 00 00 00 ENDCHAR STARTCHAR ENCODING 54 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 3c 42 40 7c 42 42 3c 00 00 00 ENDCHAR STARTCHAR ENCODING 55 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 7e 02 04 08 10 10 10 00 00 00 ENDCHAR STARTCHAR ENCODING 56 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 3c 42 42 3c 42 42 3c 00 00 00 ENDCHAR STARTCHAR ENCODING 57 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 3c 42 42 3e 02 42 3c 00 00 00 ENDCHAR STARTCHAR ENCODING 58 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 18 18 00 18 18 00 00 00 00 ENDCHAR STARTCHAR ENCODING 59 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 00 18 18 00 18 10 20 00 00 ENDCHAR STARTCHAR ENCODING 60 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 06 18 60 18 06 00 00 00 00 ENDCHAR STARTCHAR ENCODING 61 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 00 7f 00 7f 00 00 00 00 00 ENDCHAR STARTCHAR ENCODING 62 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 60 18 06 18 60 00 00 00 00 ENDCHAR STARTCHAR ENCODING 63 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 1c 22 04 08 08 00 08 00 00 00 ENDCHAR STARTCHAR ENCODING 64 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 3c 42 5e 52 5e 40 3e 00 00 00 ENDCHAR STARTCHAR ENCODING 65 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 18 24 42 42 7e 42 42 00 00 00 ENDCHAR STARTCHAR ENCODING 66 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 7c 22 22 3c 22 22 7c 00 00 00 ENDCHAR STARTCHAR ENCODING 67 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 1c 22 40 40 40 22 1c 00 00 00 ENDCHAR STARTCHAR ENCODING 68 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 78 24 22 22 22 24 78 00 00 00 ENDCHAR STARTCHAR ENCODING 69 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 7e 40 40 78 40 40 7e 00 00 00 ENDCHAR STARTCHAR ENCODING 70 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 7e 40 40 78 40 40 40 00 00 00 ENDCHAR STARTCHAR ENCODING 71 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 1c 22 40 40 4e 22 1c 00 00 00 ENDCHAR STARTCHAR ENCODING 72 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 42 42 42 7e 42 42 42 00 00 00 ENDCHAR STARTCHAR ENCODING 73 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 1c 08 08 08 08 08 1c 00 00 00 ENDCHAR STARTCHAR ENCODING 74 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 0e 04 04 04 04 44 38 00 00 00 ENDCHAR STARTCHAR ENCODING 75 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 44 48 50 70 48 44 42 00 00 00 ENDCHAR STARTCHAR ENCODING 76 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 40 40 40 40 40 40 7c 00 00 00 ENDCHAR STARTCHAR ENCODING 77 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 42 66 5a 42 42 42 42 00 00 00 ENDCHAR STARTCHAR ENCODING 78 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 42 62 52 4a 46 42 42 00 00 00 ENDCHAR STARTCHAR ENCODING 79 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 3c 42 42 42 42 42 3c 00 00 00 ENDCHAR STARTCHAR ENCODING 80 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 7c 42 42 7c 40 40 40 00 00 00 ENDCHAR STARTCHAR ENCODING 81 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 3c 42 42 42 4a 44 32 00 00 00 ENDCHAR STARTCHAR ENCODING 82 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 7c 42 42 7c 48 44 42 00 00 00 ENDCHAR STARTCHAR ENCODING 83 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 3c 42 40 3c 02 42 3c 00 00 00 ENDCHAR STARTCHAR ENCODING 84 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 3e 08 08 08 08 08 08 00 00 00 ENDCHAR STARTCHAR ENCODING 85 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 42 42 42 42 42 42 3c 00 00 00 ENDCHAR STARTCHAR ENCODING 86 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 22 22 22 22 14 14 08 00 00 00 ENDCHAR STARTCHAR ENCODING 87 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 42 42 42 42 5a 66 42 00 00 00 ENDCHAR STARTCHAR ENCODING 88 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 42 42 24 18 24 42 42 00 00 00 ENDCHAR STARTCHAR ENCODING 89 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 44 44 28 10 10 10 10 00 00 00 ENDCHAR STARTCHAR ENCODING 90 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 7c 04 08 10 20 40 7c 00 00 00 ENDCHAR STARTCHAR ENCODING 91 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 1e 10 10 10 10 10 10 10 1e 00 00 ENDCHAR STARTCHAR ENCODING 92 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 40 20 10 08 04 02 01 00 00 00 ENDCHAR STARTCHAR ENCODING 93 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 3c 04 04 04 04 04 04 04 3c 00 00 ENDCHAR STARTCHAR ENCODING 94 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 00 08 1c 36 63 00 00 00 00 ENDCHAR STARTCHAR ENCODING 95 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 00 00 00 00 00 00 00 ff 00 ENDCHAR STARTCHAR ENCODING 96 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 20 10 08 04 00 00 00 00 00 00 00 ENDCHAR STARTCHAR ENCODING 97 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 30 48 38 48 48 34 00 00 40 ENDCHAR STARTCHAR ENCODING 98 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 40 40 58 64 44 44 64 58 00 00 00 ENDCHAR STARTCHAR ENCODING 99 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 38 44 40 40 44 38 00 00 00 ENDCHAR STARTCHAR ENCODING 100 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 04 04 34 4c 44 44 4c 34 00 00 00 ENDCHAR STARTCHAR ENCODING 101 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 38 44 78 40 44 38 00 00 00 ENDCHAR STARTCHAR ENCODING 102 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 1c 20 78 20 20 20 20 20 00 00 00 ENDCHAR STARTCHAR ENCODING 103 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 34 4c 44 44 4c 34 04 38 00 ENDCHAR STARTCHAR ENCODING 104 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 40 40 58 64 44 44 44 44 00 00 00 ENDCHAR STARTCHAR ENCODING 105 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 10 00 70 10 10 10 10 10 00 00 00 ENDCHAR STARTCHAR ENCODING 106 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 08 08 00 38 08 08 08 08 48 30 00 ENDCHAR STARTCHAR ENCODING 107 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 40 40 48 50 60 50 48 44 00 00 00 ENDCHAR STARTCHAR ENCODING 108 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 38 08 08 08 08 08 08 08 00 00 00 ENDCHAR STARTCHAR ENCODING 109 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 6c 54 54 54 54 54 00 00 00 ENDCHAR STARTCHAR ENCODING 110 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 58 64 44 44 44 44 00 00 00 ENDCHAR STARTCHAR ENCODING 111 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 38 44 44 44 44 38 00 00 00 ENDCHAR STARTCHAR ENCODING 112 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 58 64 44 44 64 58 40 40 00 ENDCHAR STARTCHAR ENCODING 113 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 34 4c 44 44 4c 34 04 04 00 ENDCHAR STARTCHAR ENCODING 114 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 58 64 40 40 40 40 00 00 00 ENDCHAR STARTCHAR ENCODING 115 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 38 44 30 08 44 38 00 00 00 ENDCHAR STARTCHAR ENCODING 116 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 20 78 20 20 20 24 18 00 00 00 ENDCHAR STARTCHAR ENCODING 117 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 44 44 44 44 4c 34 00 00 00 ENDCHAR STARTCHAR ENCODING 118 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 44 44 28 28 10 10 00 00 00 ENDCHAR STARTCHAR ENCODING 119 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 44 44 54 54 54 28 00 00 00 ENDCHAR STARTCHAR ENCODING 120 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 44 28 10 28 44 44 00 00 00 ENDCHAR STARTCHAR ENCODING 121 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 44 44 44 44 4c 34 04 38 00 ENDCHAR STARTCHAR ENCODING 122 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 78 08 10 20 40 78 00 00 00 ENDCHAR STARTCHAR ENCODING 123 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 0c 10 10 10 30 10 10 10 0c 00 00 ENDCHAR STARTCHAR ENCODING 124 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 08 08 08 08 08 08 08 00 00 00 ENDCHAR STARTCHAR ENCODING 125 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 30 08 08 08 0c 08 08 08 30 00 00 ENDCHAR STARTCHAR ENCODING 126 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 00 31 49 46 00 00 00 00 00 ENDCHAR STARTCHAR ENCODING 160 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 1c 22 33 6b 66 22 1c 00 00 33 ENDCHAR STARTCHAR ENCODING 161 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 33 33 00 00 00 00 00 00 00 00 3e ENDCHAR STARTCHAR ENCODING 162 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 3e 00 00 00 00 00 00 00 00 00 00 ENDCHAR STARTCHAR ENCODING 164 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 06 18 60 18 06 00 7e 00 00 ENDCHAR STARTCHAR ENCODING 166 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 60 18 06 18 60 00 7e 00 00 ENDCHAR STARTCHAR ENCODING 168 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 03 06 7f 0c 7f 30 60 00 00 00 ENDCHAR STARTCHAR ENCODING 169 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 00 63 36 1c 08 00 00 00 00 ENDCHAR STARTCHAR ENCODING 171 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 63 36 1c 36 63 00 00 00 00 ENDCHAR STARTCHAR ENCODING 172 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 00 00 3c 00 18 08 10 00 00 ENDCHAR STARTCHAR ENCODING 173 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 7f 41 49 41 7f 41 49 41 7f 00 00 ENDCHAR STARTCHAR ENCODING 174 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 00 66 66 00 18 18 00 00 00 ENDCHAR STARTCHAR ENCODING 175 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 01 02 04 7f 10 20 40 00 00 31 ENDCHAR STARTCHAR ENCODING 176 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 31 49 46 00 08 1c 36 63 00 00 00 ENDCHAR STARTCHAR ENCODING 177 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 10 00 10 10 10 10 10 10 10 00 ENDCHAR STARTCHAR ENCODING 179 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 38 40 40 70 40 40 fe 00 00 00 ENDCHAR STARTCHAR ENCODING 180 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 44 44 28 7c 10 7c 10 00 00 00 ENDCHAR STARTCHAR ENCODING 185 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 31 49 46 00 63 36 1c 08 00 00 00 ENDCHAR STARTCHAR ENCODING 187 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 7f 41 5d 55 5d 41 7f 00 00 00 ENDCHAR STARTCHAR ENCODING 188 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 7f 61 51 49 45 43 7f 00 00 00 ENDCHAR STARTCHAR ENCODING 189 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 7f 00 7f 00 7f 00 00 00 00 ENDCHAR STARTCHAR ENCODING 190 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 3c 24 24 24 24 24 3c 00 00 00 ENDCHAR STARTCHAR ENCODING 191 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 10 00 10 20 40 40 44 38 00 00 ENDCHAR STARTCHAR ENCODING 193 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 3a 44 44 44 44 3a 00 00 00 ENDCHAR STARTCHAR ENCODING 194 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 08 08 08 08 7f 00 00 00 00 ENDCHAR STARTCHAR ENCODING 195 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 3c 42 42 42 42 42 00 00 00 ENDCHAR STARTCHAR ENCODING 196 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 20 20 20 20 20 20 3c 00 00 00 ENDCHAR STARTCHAR ENCODING 197 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 1e 20 3e 20 1e 00 00 00 00 ENDCHAR STARTCHAR ENCODING 199 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 7f 22 22 14 14 08 00 00 00 00 ENDCHAR STARTCHAR ENCODING 200 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 08 14 14 22 22 7f 00 00 00 ENDCHAR STARTCHAR ENCODING 201 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 30 10 10 10 10 18 00 00 00 ENDCHAR STARTCHAR ENCODING 202 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 00 0c 12 0c 00 00 00 00 00 ENDCHAR STARTCHAR ENCODING 204 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 7f 41 41 41 41 41 7f 00 00 00 ENDCHAR STARTCHAR ENCODING 205 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 08 08 08 08 08 08 08 00 00 00 ENDCHAR STARTCHAR ENCODING 206 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 7f 08 08 08 08 00 00 00 00 ENDCHAR STARTCHAR ENCODING 207 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 1e 21 21 21 1e 00 00 00 00 ENDCHAR STARTCHAR ENCODING 210 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 1c 22 22 3c 20 20 40 00 00 ENDCHAR STARTCHAR ENCODING 211 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 3c 20 20 20 20 20 20 00 00 00 ENDCHAR STARTCHAR ENCODING 213 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 08 08 08 08 2a 1c 08 00 00 00 ENDCHAR STARTCHAR ENCODING 214 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 42 42 42 42 3c 00 00 00 00 ENDCHAR STARTCHAR ENCODING 215 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 22 41 49 49 36 00 00 00 00 ENDCHAR STARTCHAR ENCODING 216 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 7c 02 02 02 7c 00 00 00 00 ENDCHAR STARTCHAR ENCODING 217 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 08 1c 2a 08 08 08 08 00 00 00 ENDCHAR STARTCHAR ENCODING 218 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 3e 40 40 40 3e 00 00 00 00 ENDCHAR STARTCHAR ENCODING 219 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 40 40 7c 40 40 00 00 00 00 00 ENDCHAR STARTCHAR ENCODING 220 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 40 20 10 7f 04 02 01 00 00 00 ENDCHAR STARTCHAR ENCODING 221 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 02 02 7e 02 02 00 00 00 00 00 ENDCHAR STARTCHAR ENCODING 223 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 18 00 7e 00 18 00 00 00 00 ENDCHAR STARTCHAR ENCODING 224 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 7f 08 08 08 08 08 7f 00 00 00 ENDCHAR STARTCHAR ENCODING 225 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 1c 22 22 7f 22 22 1c 00 00 08 ENDCHAR STARTCHAR ENCODING 226 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 08 08 1c 2a 2a 2a 1c 08 3e 00 00 ENDCHAR STARTCHAR ENCODING 227 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 1c 22 22 3e 22 22 00 00 00 ENDCHAR STARTCHAR ENCODING 229 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 1e 20 3e 20 1e 00 3e 00 00 ENDCHAR STARTCHAR ENCODING 230 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 31 49 46 00 7f 41 22 14 08 00 08 ENDCHAR STARTCHAR ENCODING 231 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 08 7f 49 2a 2a 1c 1c 08 08 00 08 ENDCHAR STARTCHAR ENCODING 232 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 08 08 1c 1c 2a 2a 49 7f 08 00 00 ENDCHAR STARTCHAR ENCODING 233 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 30 10 10 10 10 18 00 7e 00 ENDCHAR STARTCHAR ENCODING 234 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 24 00 18 24 24 18 00 00 00 00 00 ENDCHAR STARTCHAR ENCODING 236 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 7f 49 49 49 41 41 7f 00 00 00 ENDCHAR STARTCHAR ENCODING 238 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 3e 08 1c 2a 2a 2a 1c 08 08 42 ENDCHAR STARTCHAR ENCODING 239 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 42 00 3c 42 42 42 3c 00 00 00 00 ENDCHAR STARTCHAR ENCODING 240 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 1c 2a 55 49 55 22 1c 00 00 00 ENDCHAR STARTCHAR ENCODING 244 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 40 3e 51 49 45 3e 01 00 00 00 ENDCHAR STARTCHAR ENCODING 247 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 08 08 3e 49 49 49 3e 08 08 00 00 ENDCHAR STARTCHAR ENCODING 250 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 08 08 3e 48 48 3e 08 00 00 00 00 ENDCHAR STARTCHAR ENCODING 251 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 10 20 7e 20 10 00 00 00 00 ENDCHAR STARTCHAR ENCODING 252 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 08 14 14 22 22 7f 00 7f 00 ENDCHAR STARTCHAR ENCODING 253 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 00 08 04 7e 04 08 00 00 00 00 ENDCHAR STARTCHAR ENCODING 254 SWIDTH 42 0 DWIDTH 8 0 BBX 8 11 0 -3 BITMAP 00 18 24 42 24 18 00 00 00 00 00 ENDCHAR ENDFONT aplus-fsf-4.22/src/fonts/X11/bdf/Kaplscreen-Bold-14.bdf0000444000265000001440000010060606441546676015731 STARTFONT 2.1 COMMENT COMMENT WARNING: This bdf file was generated from a pcf file using COMMENT pcftobdf. The resulting font is subject to the same copyright, COMMENT license, and trademark restrictions as the original font. The COMMENT authors and distributors of fstobdf disclaim all liability for COMMENT misuse of the program or its output. COMMENT FONT --Kapl-Screen-R-Normal--15-150-72-72-M--iso8859-1 SIZE 15 72 72 FONTBOUNDINGBOX 9 16 0 -5 STARTPROPERTIES 20 FONTNAME_REGISTRY "" FAMILY_NAME "Kapl" FOUNDRY "" WEIGHT_NAME "Screen" SLANT "R" SETWIDTH_NAME "Normal" ADD_STYLE_NAME "" PIXEL_SIZE 15 POINT_SIZE 150 RESOLUTION_X 72 RESOLUTION_Y 72 SPACING "M" AVERAGE_WIDTH 80 CHARSET_REGISTRY "ISO8859" CHARSET_ENCODING "1" CHARSET_COLLECTIONS "ASCII ISO8859-1" FULL_NAME "Kapl" DEFAULT_CHAR 0 FONT_ASCENT 11 FONT_DESCENT 5 ENDPROPERTIES CHARS 201 STARTCHAR C020 ENCODING 16 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 0000 0000 0000 1f80 1f80 1800 1800 1800 1800 1800 1800 1800 ENDCHAR STARTCHAR C021 ENCODING 17 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 0000 0000 0000 ff80 ff80 1800 1800 1800 1800 1800 1800 1800 ENDCHAR STARTCHAR C022 ENCODING 18 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 0000 0000 0000 f800 f800 1800 1800 1800 1800 1800 1800 1800 ENDCHAR STARTCHAR C023 ENCODING 19 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 1800 1800 1800 1800 1800 1800 1800 1f80 1f80 1800 1800 1800 1800 1800 1800 1800 ENDCHAR STARTCHAR C024 ENCODING 20 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 1800 1800 1800 1800 1800 1800 1800 ff80 ff80 1800 1800 1800 1800 1800 1800 1800 ENDCHAR STARTCHAR C025 ENCODING 21 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 1800 1800 1800 1800 1800 1800 1800 f800 f800 1800 1800 1800 1800 1800 1800 1800 ENDCHAR STARTCHAR C026 ENCODING 22 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 1800 1800 1800 1800 1800 1800 1800 1f80 1f80 0000 0000 0000 0000 0000 0000 0000 ENDCHAR STARTCHAR C027 ENCODING 23 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 1800 1800 1800 1800 1800 1800 1800 ff80 ff80 0000 0000 0000 0000 0000 0000 0000 ENDCHAR STARTCHAR C030 ENCODING 24 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 1800 1800 1800 1800 1800 1800 1800 f800 f800 0000 0000 0000 0000 0000 0000 0000 ENDCHAR STARTCHAR C031 ENCODING 25 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 1800 1800 1800 1800 1800 1800 1800 1800 1800 1800 1800 1800 1800 1800 1800 1800 ENDCHAR STARTCHAR C032 ENCODING 26 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 0000 0000 0000 ff80 ff80 0000 0000 0000 0000 0000 0000 0000 ENDCHAR STARTCHAR C040 ENCODING 32 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 ENDCHAR STARTCHAR C041 ENCODING 33 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 1800 1800 1800 1800 1800 1800 1800 0000 1800 1800 0000 0000 0000 0000 ENDCHAR STARTCHAR C042 ENCODING 34 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 3600 3600 3600 3600 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 ENDCHAR STARTCHAR C043 ENCODING 35 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 1b00 1b00 1b00 7f80 3600 3600 ff00 6c00 6c00 6c00 0000 0000 0000 0000 ENDCHAR STARTCHAR C044 ENCODING 36 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0800 3e00 6b00 6b00 6b00 3800 0e00 6b00 6b00 6b00 3e00 0800 0000 0000 0000 ENDCHAR STARTCHAR C045 ENCODING 37 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 7600 9600 9c00 ec00 1800 1800 3700 3900 6900 6e00 0000 0000 0000 0000 ENDCHAR STARTCHAR C046 ENCODING 38 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 3800 6c00 6c00 3800 3000 7b00 de00 cc00 dc00 7700 0000 0000 0000 0000 ENDCHAR STARTCHAR C047 ENCODING 39 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0c00 0c00 1800 3000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 ENDCHAR STARTCHAR C050 ENCODING 40 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0600 0c00 1800 1800 3000 3000 3000 3000 3000 1800 1800 0c00 0600 0000 0000 ENDCHAR STARTCHAR C051 ENCODING 41 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 3000 1800 0c00 0c00 0600 0600 0600 0600 0600 0c00 0c00 1800 3000 0000 0000 ENDCHAR STARTCHAR C052 ENCODING 42 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 1800 5a00 7e00 3c00 7e00 5a00 1800 0000 0000 0000 0000 0000 0000 ENDCHAR STARTCHAR C053 ENCODING 43 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 1800 1800 1800 ff00 ff00 1800 1800 1800 0000 0000 0000 0000 ENDCHAR STARTCHAR C054 ENCODING 44 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 1800 1800 0800 1000 2000 0000 ENDCHAR STARTCHAR C055 ENCODING 45 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 0000 0000 0000 7f00 7f00 0000 0000 0000 0000 0000 0000 0000 ENDCHAR STARTCHAR C056 ENCODING 46 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 1800 1800 0000 0000 0000 0000 ENDCHAR STARTCHAR C057 ENCODING 47 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0300 0600 0600 0c00 0c00 1800 1800 3000 3000 6000 6000 c000 0000 0000 0000 ENDCHAR STARTCHAR C060 ENCODING 48 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 3e00 6300 6700 6700 6b00 6b00 7300 7300 6300 3e00 0000 0000 0000 0000 ENDCHAR STARTCHAR C061 ENCODING 49 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0c00 1c00 3c00 0c00 0c00 0c00 0c00 0c00 0c00 3f00 0000 0000 0000 0000 ENDCHAR STARTCHAR C062 ENCODING 50 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 3e00 6300 6300 0300 0600 0c00 1800 3000 6100 7f00 0000 0000 0000 0000 ENDCHAR STARTCHAR C063 ENCODING 51 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 3e00 6300 6300 0300 1e00 0700 0300 6300 6300 3e00 0000 0000 0000 0000 ENDCHAR STARTCHAR C064 ENCODING 52 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0200 0600 0e00 1e00 3600 6600 c600 ff00 0600 0600 0000 0000 0000 0000 ENDCHAR STARTCHAR C065 ENCODING 53 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 7f00 6000 6000 7e00 0300 0300 0300 6300 6300 3e00 0000 0000 0000 0000 ENDCHAR STARTCHAR C066 ENCODING 54 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 3e00 6300 6000 6000 7e00 6300 6300 6300 6300 3e00 0000 0000 0000 0000 ENDCHAR STARTCHAR C067 ENCODING 55 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 7f00 4300 4300 0600 0600 0c00 0c00 1800 1800 1800 0000 0000 0000 0000 ENDCHAR STARTCHAR C070 ENCODING 56 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 3e00 6300 6300 6300 3e00 6300 6300 6300 6300 3e00 0000 0000 0000 0000 ENDCHAR STARTCHAR C071 ENCODING 57 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 3e00 6300 6300 6300 6300 3f00 0300 0300 6300 3e00 0000 0000 0000 0000 ENDCHAR STARTCHAR C072 ENCODING 58 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 0000 1800 1800 0000 0000 0000 1800 1800 0000 0000 0000 0000 ENDCHAR STARTCHAR C073 ENCODING 59 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 0000 1800 1800 0000 0000 0000 1800 1800 0800 1000 2000 0000 ENDCHAR STARTCHAR C074 ENCODING 60 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0300 0600 0c00 1800 3000 6000 3000 1800 0c00 0600 0300 0000 0000 0000 0000 ENDCHAR STARTCHAR C075 ENCODING 61 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 0000 7f00 7f00 0000 0000 7f00 7f00 0000 0000 0000 0000 0000 ENDCHAR STARTCHAR C076 ENCODING 62 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 6000 3000 1800 0c00 0600 0300 0600 0c00 1800 3000 6000 0000 0000 0000 0000 ENDCHAR STARTCHAR C077 ENCODING 63 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 3e00 6300 6300 0300 0600 0c00 0c00 0000 0c00 0c00 0000 0000 0000 0000 ENDCHAR STARTCHAR C100 ENCODING 64 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 1c00 3600 6300 6f00 6b00 6b00 6e00 6000 3300 1e00 0000 0000 0000 0000 ENDCHAR STARTCHAR C101 ENCODING 65 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0800 1c00 1c00 3600 3600 3600 6300 7f00 6300 6300 0000 0000 0000 0000 ENDCHAR STARTCHAR C102 ENCODING 66 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 7c00 6600 6600 6600 7c00 6600 6300 6300 6300 7e00 0000 0000 0000 0000 ENDCHAR STARTCHAR C103 ENCODING 67 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 3e00 6300 6300 6000 6000 6000 6000 6300 6300 3e00 0000 0000 0000 0000 ENDCHAR STARTCHAR C104 ENCODING 68 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 7c00 6600 6300 6300 6300 6300 6300 6300 6600 7c00 0000 0000 0000 0000 ENDCHAR STARTCHAR C105 ENCODING 69 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 7f00 6000 6000 6000 7e00 6000 6000 6000 6000 7f00 0000 0000 0000 0000 ENDCHAR STARTCHAR C106 ENCODING 70 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 7f00 6000 6000 6000 7e00 6000 6000 6000 6000 6000 0000 0000 0000 0000 ENDCHAR STARTCHAR C107 ENCODING 71 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 3e00 6300 6300 6000 6000 6700 6300 6300 6700 3d00 0000 0000 0000 0000 ENDCHAR STARTCHAR C110 ENCODING 72 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 6300 6300 6300 6300 7f00 6300 6300 6300 6300 6300 0000 0000 0000 0000 ENDCHAR STARTCHAR C111 ENCODING 73 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 7e00 1800 1800 1800 1800 1800 1800 1800 1800 7e00 0000 0000 0000 0000 ENDCHAR STARTCHAR C112 ENCODING 74 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 1f00 0600 0600 0600 0600 0600 0600 6600 6600 3c00 0000 0000 0000 0000 ENDCHAR STARTCHAR C113 ENCODING 75 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 6300 6600 6c00 7800 7c00 6c00 6600 6600 6300 6300 0000 0000 0000 0000 ENDCHAR STARTCHAR C114 ENCODING 76 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 6000 6000 6000 6000 6000 6000 6000 6000 6000 7f00 0000 0000 0000 0000 ENDCHAR STARTCHAR C115 ENCODING 77 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 c300 c300 e700 e700 ff00 db00 db00 c300 c300 c300 0000 0000 0000 0000 ENDCHAR STARTCHAR C116 ENCODING 78 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 6300 6300 7300 7300 7b00 6b00 6f00 6700 6700 6300 0000 0000 0000 0000 ENDCHAR STARTCHAR C117 ENCODING 79 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 3e00 6300 6300 6300 6300 6300 6300 6300 6300 3e00 0000 0000 0000 0000 ENDCHAR STARTCHAR C120 ENCODING 80 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 7e00 6300 6300 6300 6300 7e00 6000 6000 6000 6000 0000 0000 0000 0000 ENDCHAR STARTCHAR C121 ENCODING 81 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 3e00 6300 6300 6300 6300 6300 6300 6300 6300 3e00 1800 0c00 0700 0000 ENDCHAR STARTCHAR C122 ENCODING 82 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 7e00 6300 6300 6300 7e00 6c00 6600 6600 6300 6300 0000 0000 0000 0000 ENDCHAR STARTCHAR C123 ENCODING 83 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 3e00 6300 6300 3000 1c00 0600 0300 6300 6300 3e00 0000 0000 0000 0000 ENDCHAR STARTCHAR C124 ENCODING 84 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 ff00 1800 1800 1800 1800 1800 1800 1800 1800 1800 0000 0000 0000 0000 ENDCHAR STARTCHAR C125 ENCODING 85 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 6300 6300 6300 6300 6300 6300 6300 6300 6300 3e00 0000 0000 0000 0000 ENDCHAR STARTCHAR C126 ENCODING 86 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 6300 6300 6300 3600 3600 3600 1c00 1c00 0800 0800 0000 0000 0000 0000 ENDCHAR STARTCHAR C127 ENCODING 87 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 c180 c980 c980 dd80 5d00 7700 7700 3600 2200 2200 0000 0000 0000 0000 ENDCHAR STARTCHAR C130 ENCODING 88 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 6300 6300 3600 3600 1c00 1c00 3600 3600 6300 6300 0000 0000 0000 0000 ENDCHAR STARTCHAR C131 ENCODING 89 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 c300 c300 6600 6600 3c00 1800 1800 1800 1800 1800 0000 0000 0000 0000 ENDCHAR STARTCHAR C132 ENCODING 90 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 7f00 0300 0300 0600 0c00 1800 3000 6000 6000 7f00 0000 0000 0000 0000 ENDCHAR STARTCHAR C133 ENCODING 91 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 3e00 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3e00 0000 0000 ENDCHAR STARTCHAR C134 ENCODING 92 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 c000 6000 6000 3000 3000 1800 1800 0c00 0c00 0600 0600 0300 0000 0000 0000 ENDCHAR STARTCHAR C135 ENCODING 93 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 3e00 0600 0600 0600 0600 0600 0600 0600 0600 0600 0600 0600 3e00 0000 0000 ENDCHAR STARTCHAR C136 ENCODING 94 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0800 1c00 3600 6300 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 ENDCHAR STARTCHAR C137 ENCODING 95 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 ff00 ff00 0000 0000 ENDCHAR STARTCHAR C140 ENCODING 96 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 3000 3000 1800 0c00 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 ENDCHAR STARTCHAR C141 ENCODING 97 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 0000 3c00 6600 0600 3e00 6600 6600 3f00 0000 0000 0000 0000 ENDCHAR STARTCHAR C142 ENCODING 98 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 6000 6000 6000 6e00 7300 6300 6300 6300 7300 6e00 0000 0000 0000 0000 ENDCHAR STARTCHAR C143 ENCODING 99 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 0000 3e00 6300 6000 6000 6000 6300 3e00 0000 0000 0000 0000 ENDCHAR STARTCHAR C144 ENCODING 100 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0300 0300 0300 3b00 6700 6300 6300 6300 6700 3b00 0000 0000 0000 0000 ENDCHAR STARTCHAR C145 ENCODING 101 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 0000 3e00 6300 6300 7f00 6000 6300 3e00 0000 0000 0000 0000 ENDCHAR STARTCHAR C146 ENCODING 102 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0e00 1b00 1800 1800 7e00 1800 1800 1800 1800 1800 0000 0000 0000 0000 ENDCHAR STARTCHAR C147 ENCODING 103 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 0000 3b00 6700 6300 6300 6300 6700 3b00 0300 6300 3e00 0000 ENDCHAR STARTCHAR C150 ENCODING 104 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 6000 6000 6000 6e00 7300 6300 6300 6300 6300 6300 0000 0000 0000 0000 ENDCHAR STARTCHAR C151 ENCODING 105 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0c00 0c00 0000 3c00 0c00 0c00 0c00 0c00 0c00 0c00 0000 0000 0000 0000 ENDCHAR STARTCHAR C152 ENCODING 106 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0600 0600 0000 1e00 0600 0600 0600 0600 0600 0600 0600 6600 3c00 0000 ENDCHAR STARTCHAR C153 ENCODING 107 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 6000 6000 6000 6600 6c00 7800 7800 6c00 6600 6300 0000 0000 0000 0000 ENDCHAR STARTCHAR C154 ENCODING 108 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 3c00 0c00 0c00 0c00 0c00 0c00 0c00 0c00 0c00 0c00 0000 0000 0000 0000 ENDCHAR STARTCHAR C155 ENCODING 109 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 0000 b600 db00 db00 db00 db00 db00 db00 0000 0000 0000 0000 ENDCHAR STARTCHAR C156 ENCODING 110 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 0000 5e00 7300 6300 6300 6300 6300 6300 0000 0000 0000 0000 ENDCHAR STARTCHAR C157 ENCODING 111 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 0000 3e00 6300 6300 6300 6300 6300 3e00 0000 0000 0000 0000 ENDCHAR STARTCHAR C160 ENCODING 112 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 0000 6e00 7300 6300 6300 6300 7300 6e00 6000 6000 6000 6000 ENDCHAR STARTCHAR C161 ENCODING 113 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 0000 3b00 6700 6300 6300 6300 6700 3b00 0300 0300 0300 0300 ENDCHAR STARTCHAR C162 ENCODING 114 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 0000 6e00 7b00 6000 6000 6000 6000 6000 0000 0000 0000 0000 ENDCHAR STARTCHAR C163 ENCODING 115 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 0000 3e00 6300 6000 3e00 0300 6300 3e00 0000 0000 0000 0000 ENDCHAR STARTCHAR C164 ENCODING 116 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 1800 1800 1800 7e00 1800 1800 1800 1800 1b00 0e00 0000 0000 0000 0000 ENDCHAR STARTCHAR C165 ENCODING 117 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 0000 6300 6300 6300 6300 6300 6700 3b00 0000 0000 0000 0000 ENDCHAR STARTCHAR C166 ENCODING 118 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 0000 6300 6300 3600 3600 1c00 1c00 0800 0000 0000 0000 0000 ENDCHAR STARTCHAR C167 ENCODING 119 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 0000 c300 c300 db00 db00 db00 db00 7e00 0000 0000 0000 0000 ENDCHAR STARTCHAR C170 ENCODING 120 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 0000 6600 6600 3c00 1800 3c00 6600 6600 0000 0000 0000 0000 ENDCHAR STARTCHAR C171 ENCODING 121 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 0000 6300 6300 3300 3600 1600 1c00 0c00 0c00 4800 7800 3000 ENDCHAR STARTCHAR C172 ENCODING 122 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 0000 7f00 0600 0c00 1800 3000 6000 7f00 0000 0000 0000 0000 ENDCHAR STARTCHAR C173 ENCODING 123 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0f00 1800 1800 1800 1800 1800 7000 1800 1800 1800 1800 1800 0f00 0000 0000 ENDCHAR STARTCHAR C174 ENCODING 124 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 1800 1800 1800 1800 1800 1800 0000 1800 1800 1800 1800 1800 1800 0000 0000 ENDCHAR STARTCHAR C175 ENCODING 125 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 7800 0c00 0c00 0c00 0c00 0c00 0700 0c00 0c00 0c00 0c00 0c00 7800 0000 0000 ENDCHAR STARTCHAR C176 ENCODING 126 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 3b00 7f00 6e00 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 ENDCHAR STARTCHAR C201 ENCODING 129 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0800 1c00 1c00 3600 3600 3600 6300 7f00 6300 6300 0000 7f00 7f00 0000 ENDCHAR STARTCHAR C202 ENCODING 130 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 7c00 6600 6600 6600 7c00 6600 6300 6300 6300 7e00 0000 7f00 7f00 0000 ENDCHAR STARTCHAR C203 ENCODING 131 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 3e00 6300 6300 6000 6000 6000 6000 6300 6300 3e00 0000 7f00 7f00 0000 ENDCHAR STARTCHAR C204 ENCODING 132 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 7c00 6600 6300 6300 6300 6300 6300 6300 6600 7c00 0000 7f00 7f00 0000 ENDCHAR STARTCHAR C205 ENCODING 133 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 7f00 6000 6000 6000 7e00 6000 6000 6000 6000 7f00 0000 7f00 7f00 0000 ENDCHAR STARTCHAR C206 ENCODING 134 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 7f00 6000 6000 6000 7e00 6000 6000 6000 6000 6000 0000 7f00 7f00 0000 ENDCHAR STARTCHAR C207 ENCODING 135 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 3e00 6300 6300 6000 6000 6700 6300 6300 6700 3d00 0000 7f00 7f00 0000 ENDCHAR STARTCHAR C210 ENCODING 136 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 6300 6300 6300 6300 7f00 6300 6300 6300 6300 6300 0000 7f00 7f00 0000 ENDCHAR STARTCHAR C211 ENCODING 137 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 6300 6300 6300 6300 7f00 6300 6300 6300 6300 6300 0000 7f00 7f00 0000 ENDCHAR STARTCHAR C212 ENCODING 138 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 7e00 1800 1800 1800 1800 1800 1800 1800 1800 7e00 0000 7f00 7f00 0000 ENDCHAR STARTCHAR C213 ENCODING 139 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 1f00 0600 0600 0600 0600 0600 0600 6600 6600 3c00 0000 7f00 7f00 0000 ENDCHAR STARTCHAR C214 ENCODING 140 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 6300 6600 6c00 7800 7c00 6c00 6600 6600 6300 6300 0000 7f00 7f00 0000 ENDCHAR STARTCHAR C215 ENCODING 141 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 6000 6000 6000 6000 6000 6000 6000 6000 6000 7f00 0000 7f00 7f00 0000 ENDCHAR STARTCHAR C216 ENCODING 142 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 c300 c300 e700 e700 ff00 db00 db00 c300 c300 c300 0000 ff00 ff00 0000 ENDCHAR STARTCHAR C217 ENCODING 143 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 6300 6300 7300 7300 7b00 6b00 6f00 6700 6700 6300 0000 7f00 7f00 0000 ENDCHAR STARTCHAR C220 ENCODING 144 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 3e00 6300 6300 6300 6300 6300 6300 6300 6300 3e00 0000 7f00 7f00 0000 ENDCHAR STARTCHAR C221 ENCODING 145 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 7e00 6300 6300 6300 6300 7e00 6000 6000 6000 6000 0000 7f00 7f00 0000 ENDCHAR STARTCHAR C222 ENCODING 146 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 3e00 6300 6300 6300 6300 6300 6300 6300 6300 3e00 1800 6f00 7f00 0000 ENDCHAR STARTCHAR C223 ENCODING 147 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 7e00 6300 6300 6300 7e00 6c00 6600 6600 6300 6300 0000 7f00 7f00 0000 ENDCHAR STARTCHAR C224 ENCODING 148 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 3e00 6300 6300 3000 1c00 0600 0300 6300 6300 3e00 0000 7f00 7f00 0000 ENDCHAR STARTCHAR C225 ENCODING 149 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 ff00 1800 1800 1800 1800 1800 1800 1800 1800 1800 0000 ff00 ff00 0000 ENDCHAR STARTCHAR C226 ENCODING 150 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 6300 6300 6300 6300 6300 6300 6300 6300 6300 3e00 0000 7f00 7f00 0000 ENDCHAR STARTCHAR C227 ENCODING 151 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 6300 6300 6300 3600 3600 3600 1c00 1c00 0800 0800 0000 7f00 7f00 0000 ENDCHAR STARTCHAR C230 ENCODING 152 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 c180 c980 c980 dd80 5d00 7700 7700 3600 2200 2200 0000 ff80 ff80 0000 ENDCHAR STARTCHAR C231 ENCODING 153 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 6300 6300 3600 3600 1c00 1c00 3600 3600 6300 6300 0000 7f00 7f00 0000 ENDCHAR STARTCHAR C232 ENCODING 154 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 c300 c300 6600 6600 3c00 1800 1800 1800 1800 1800 0000 ff00 ff00 0000 ENDCHAR STARTCHAR C233 ENCODING 155 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 7f00 0300 0300 0600 0c00 1800 3000 6000 6000 7f00 0000 7f00 7f00 0000 ENDCHAR STARTCHAR C240 ENCODING 160 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 3e00 6300 6300 6380 6f00 7b00 e300 6300 6300 3e00 0000 0000 0000 0000 ENDCHAR STARTCHAR C241 ENCODING 161 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 7700 7700 7700 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 ENDCHAR STARTCHAR C242 ENCODING 162 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 3e00 3e00 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 ENDCHAR STARTCHAR C244 ENCODING 164 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0e00 1c00 3000 6000 3000 1c00 0e00 0000 7f00 7f00 0000 0000 0000 0000 ENDCHAR STARTCHAR C246 ENCODING 166 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 3800 1c00 0600 0300 0600 1c00 3800 0000 7f00 7f00 0000 0000 0000 0000 ENDCHAR STARTCHAR C250 ENCODING 168 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0200 0600 7f00 7f00 0c00 1800 7f00 7f00 3000 2000 0000 0000 0000 ENDCHAR STARTCHAR C251 ENCODING 169 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 0000 c300 6600 3c00 1800 0000 0000 0000 0000 0000 0000 0000 ENDCHAR STARTCHAR C253 ENCODING 171 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 6180 3300 1e00 0c00 1e00 3300 6180 0000 0000 0000 0000 0000 ENDCHAR STARTCHAR C254 ENCODING 172 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 0000 0000 7f00 7f00 0000 0000 1800 1800 0800 1000 2000 0000 ENDCHAR STARTCHAR C255 ENCODING 173 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 7f80 7f80 6180 6d80 6180 7f80 6180 6d80 6180 7f80 7f80 0000 0000 0000 0000 ENDCHAR STARTCHAR C070 ENCODING 174 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 6600 6600 0000 0000 1800 1800 0000 0000 0000 0000 0000 0000 ENDCHAR STARTCHAR C257 ENCODING 175 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0300 0300 0600 0600 0c00 7f00 7f00 1800 3000 3000 6000 0000 0000 0000 ENDCHAR STARTCHAR C260 ENCODING 176 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 3300 7e00 cc00 0000 1800 3c00 6600 c300 0000 0000 0000 0000 0000 0000 ENDCHAR STARTCHAR C261 ENCODING 177 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0c00 0c00 0000 0c00 0c00 0c00 0c00 0c00 0c00 0c00 0000 0000 0000 0000 ENDCHAR STARTCHAR C263 ENCODING 179 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 1c00 3600 3000 3000 7c00 3000 3000 3100 7f00 fe00 0000 0000 0000 0000 ENDCHAR STARTCHAR C264 ENCODING 180 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 c300 c300 6600 6600 3c00 ff00 1800 ff00 1800 7e00 0000 0000 0000 0000 ENDCHAR STARTCHAR C271 ENCODING 185 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 3300 7e00 cc00 0000 c300 6600 3c00 1800 0000 0000 0000 0000 0000 0000 ENDCHAR STARTCHAR C273 ENCODING 187 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 7f80 7f80 6180 6180 6d80 7380 6d80 6180 6180 7f80 7f80 0000 0000 0000 0000 ENDCHAR STARTCHAR C274 ENCODING 188 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 7f80 7f80 7180 7980 6980 6d80 6580 6780 6380 7f80 7f80 0000 0000 0000 0000 ENDCHAR STARTCHAR C275 ENCODING 189 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 7f80 7f80 0000 7f80 7f80 0000 7f80 7f80 0000 0000 0000 0000 0000 ENDCHAR STARTCHAR C276 ENCODING 190 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 7c00 7c00 6c00 6c00 6c00 6c00 6c00 6c00 6c00 7c00 7c00 0000 0000 0000 0000 ENDCHAR STARTCHAR C277 ENCODING 191 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 1800 1800 0000 1800 1800 3000 6000 6300 6300 3e00 0000 0000 0000 0000 ENDCHAR STARTCHAR C301 ENCODING 193 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 0000 0000 3d00 6600 6600 6600 6700 3d80 0000 0000 0000 0000 ENDCHAR STARTCHAR C302 ENCODING 194 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 0c00 0c00 0c00 0c00 0c00 7f80 7f80 0000 0000 0000 0000 0000 ENDCHAR STARTCHAR C303 ENCODING 195 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 3e00 7f00 6300 6300 6300 6300 6300 6300 0000 0000 0000 0000 ENDCHAR STARTCHAR C304 ENCODING 196 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 3000 3000 3000 3000 3000 3000 3000 3000 3000 3e00 3e00 0000 0000 0000 0000 ENDCHAR STARTCHAR C305 ENCODING 197 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 3e00 7e00 6000 7c00 7c00 6000 7f00 3f00 0000 0000 0000 0000 0000 ENDCHAR STARTCHAR C307 ENCODING 199 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 ff80 ff80 c180 6300 6300 3600 1c00 1c00 0800 0000 0000 0000 0000 0000 ENDCHAR STARTCHAR C310 ENCODING 200 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0800 1c00 1c00 3600 6300 6300 c180 ff80 ff80 0000 0000 0000 0000 ENDCHAR STARTCHAR C311 ENCODING 201 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 0000 3000 7800 1800 1800 1800 1e00 0c00 0000 0000 0000 0000 ENDCHAR STARTCHAR C312 ENCODING 202 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 0000 3800 6c00 4400 6c00 3800 0000 0000 0000 0000 0000 0000 ENDCHAR STARTCHAR C314 ENCODING 204 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 7f80 7f80 6180 6180 6180 6180 6180 6180 6180 7f80 7f80 0000 0000 0000 0000 ENDCHAR STARTCHAR C315 ENCODING 205 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 1800 1800 1800 1800 1800 1800 1800 1800 1800 1800 0000 0000 0000 0000 0000 ENDCHAR STARTCHAR C316 ENCODING 206 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 7f80 7f80 0c00 0c00 0c00 0c00 0c00 0c00 0000 0000 0000 0000 0000 ENDCHAR STARTCHAR C317 ENCODING 207 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 3e00 7f00 6300 6300 6300 7f00 3e00 0000 0000 0000 0000 0000 ENDCHAR STARTCHAR C322 ENCODING 210 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 1e00 3f00 7300 6300 6300 6f00 6e00 6000 6000 6000 0000 0000 ENDCHAR STARTCHAR C323 ENCODING 211 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 3e00 3e00 3000 3000 3000 3000 3000 3000 3000 3000 3000 0000 0000 0000 0000 ENDCHAR STARTCHAR C325 ENCODING 213 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0c00 0c00 0c00 0c00 0c00 0c00 2d00 3f00 1e00 0c00 0000 0000 0000 0000 ENDCHAR STARTCHAR C326 ENCODING 214 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 6300 6300 6300 6300 6300 6300 6300 7f00 3e00 0000 0000 0000 0000 ENDCHAR STARTCHAR C327 ENCODING 215 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 0000 3100 6180 6d80 6d80 6d80 7f80 3f00 0000 0000 0000 0000 ENDCHAR STARTCHAR C330 ENCODING 216 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 7e00 7f00 0300 0300 0300 7f00 7e00 0000 0000 0000 0000 0000 ENDCHAR STARTCHAR C331 ENCODING 217 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0c00 1e00 3f00 2d00 0c00 0c00 0c00 0c00 0c00 0c00 0000 0000 0000 0000 ENDCHAR STARTCHAR C332 ENCODING 218 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 3f00 7f00 6000 6000 6000 7f00 3f00 0000 0000 0000 0000 0000 ENDCHAR STARTCHAR C333 ENCODING 219 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 6000 6000 6000 7f00 7f00 6000 6000 6000 0000 0000 0000 0000 0000 ENDCHAR STARTCHAR C334 ENCODING 220 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 6000 6000 3000 3000 1800 7f00 7f00 0c00 0600 0600 0300 0000 0000 0000 ENDCHAR STARTCHAR C335 ENCODING 221 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0300 0300 0300 7f00 7f00 0300 0300 0300 0000 0000 0000 0000 0000 ENDCHAR STARTCHAR C337 ENCODING 223 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0c00 0c00 0000 7f80 7f80 0000 0c00 0c00 0000 0000 0000 0000 0000 ENDCHAR STARTCHAR C340 ENCODING 224 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 7f80 7f80 0c00 0c00 0c00 0c00 7f80 7f80 0000 0000 0000 0000 0000 ENDCHAR STARTCHAR C341 ENCODING 225 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 3f00 7f80 6180 7f80 7f80 6180 7f80 3f00 0000 0000 0000 0000 0000 ENDCHAR STARTCHAR C342 ENCODING 226 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0c00 1e00 2d00 2d00 2d00 1e00 0c00 7f80 7f80 0000 0000 0000 0000 0000 ENDCHAR STARTCHAR C343 ENCODING 227 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 3e00 7f00 6300 6300 7700 7f00 6300 6300 6300 0000 0000 0000 0000 ENDCHAR STARTCHAR C345 ENCODING 229 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 3e00 7e00 6000 7c00 7c00 6000 7f00 3f00 0000 7f00 7f00 0000 0000 0000 ENDCHAR STARTCHAR C346 ENCODING 230 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 1980 3f00 6600 0000 7f80 7f80 2100 3300 1e00 0c00 0000 0000 0000 0000 0000 ENDCHAR STARTCHAR C347 ENCODING 231 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0c00 0c00 7f80 4c80 6d80 2d00 3f00 1e00 0c00 0c00 0000 0000 0000 0000 0000 ENDCHAR STARTCHAR C350 ENCODING 232 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0c00 0c00 1e00 3f00 2d00 6d80 4c80 7f80 0c00 0c00 0000 0000 0000 0000 0000 ENDCHAR STARTCHAR C351 ENCODING 233 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 3000 7800 1800 1800 1800 1e00 0c00 0000 7e00 7e00 0000 0000 0000 ENDCHAR STARTCHAR C352 ENCODING 234 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 6c00 6c00 0000 3800 6c00 4400 6c00 3800 0000 0000 0000 0000 0000 0000 ENDCHAR STARTCHAR C354 ENCODING 236 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 7f80 7f80 6d80 6d80 6d80 6180 6180 6180 6180 7f80 7f80 0000 0000 0000 0000 ENDCHAR STARTCHAR C356 ENCODING 238 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 7f80 7f80 0c00 1e00 2d00 2d00 2d00 1e00 0c00 0000 0000 0000 0000 ENDCHAR STARTCHAR C357 ENCODING 239 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 6600 6600 0000 3c00 7e00 6600 6600 7e00 3c00 0000 0000 0000 0000 0000 0000 ENDCHAR STARTCHAR C360 ENCODING 240 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 3e00 7f00 c980 eb80 dd80 d580 e380 7f00 3e00 0000 0000 0000 0000 0000 ENDCHAR STARTCHAR C364 ENCODING 244 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 c000 7e00 7f00 7300 6b00 6700 7f00 3f00 0180 0000 0000 0000 0000 ENDCHAR STARTCHAR C367 ENCODING 247 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0c00 0c00 3f00 7f80 6d80 6d80 6d80 7f80 3f00 0c00 0c00 0000 0000 0000 ENDCHAR STARTCHAR C372 ENCODING 250 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0c00 3f00 7f80 6d80 6c00 6d80 7f80 3f00 0c00 0000 0000 0000 0000 ENDCHAR STARTCHAR C373 ENCODING 251 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 3000 6000 ff80 ff80 6000 3000 0000 0000 0000 0000 0000 0000 ENDCHAR STARTCHAR C374 ENCODING 252 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0c00 1e00 3300 2100 7f80 7f80 0000 7f80 7f80 0000 0000 0000 0000 ENDCHAR STARTCHAR C375 ENCODING 253 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 0600 0300 ff80 ff80 0300 0600 0000 0000 0000 0000 0000 0000 ENDCHAR STARTCHAR C376 ENCODING 254 SWIDTH 645 0 DWIDTH 9 0 BBX 9 16 0 -5 BITMAP 0000 0000 0000 0000 0c00 1e00 3300 6180 3300 1e00 0c00 0000 0000 0000 0000 0000 ENDCHAR ENDFONT aplus-fsf-4.22/src/tutorials/0000777000265000001440000000000010774512703011725 5aplus-fsf-4.22/src/tutorials/Makefile.am0000664000265000001440000000165510774512353013707 ## Process this file with automake to produce Makefile.in ############################################################################### ## ## ## Copyright (c) 2001 Morgan Stanley Dean Witter and Co. All rights reserved.## ## See .../src/LICENSE for terms of distribution. ## ## ## ## ## ############################################################################### SUBDIRS = graphs s.tutorials tutorialsdir = $(prefix)/doc/tutorials tutorials_DATA = \ Assignment \ GettingStarted \ Introduction \ NestedArrays \ ScalarFunctions \ SimpleArrays \ Syntax EXTRA_DIST = \ Assignment \ GettingStarted \ Introduction \ NestedArrays \ ScalarFunctions \ SimpleArrays \ Syntax aplus-fsf-4.22/src/tutorials/Makefile.in0000644000265000001440000002615510774512524013720 # Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ ############################################################################### ############################################################################### SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CXX = @CXX@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ STRIP = @STRIP@ VERSION = @VERSION@ X_INCLUDES = @X_INCLUDES@ X_LIBS = @X_LIBS@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ SUBDIRS = graphs s.tutorials tutorialsdir = $(prefix)/doc/tutorials tutorials_DATA = \ Assignment \ GettingStarted \ Introduction \ NestedArrays \ ScalarFunctions \ SimpleArrays \ Syntax EXTRA_DIST = \ Assignment \ GettingStarted \ Introduction \ NestedArrays \ ScalarFunctions \ SimpleArrays \ Syntax subdir = src/tutorials mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_CLEAN_FILES = DIST_SOURCES = DATA = $(tutorials_DATA) RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ uninstall-info-recursive all-recursive install-data-recursive \ install-exec-recursive installdirs-recursive install-recursive \ uninstall-recursive check-recursive installcheck-recursive DIST_COMMON = Makefile.am Makefile.in DIST_SUBDIRS = $(SUBDIRS) all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/tutorials/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: tutorialsDATA_INSTALL = $(INSTALL_DATA) install-tutorialsDATA: $(tutorials_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(tutorialsdir) @list='$(tutorials_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(tutorialsDATA_INSTALL) $$d$$p $(DESTDIR)$(tutorialsdir)/$$f"; \ $(tutorialsDATA_INSTALL) $$d$$p $(DESTDIR)$(tutorialsdir)/$$f; \ done uninstall-tutorialsDATA: @$(NORMAL_UNINSTALL) @list='$(tutorials_DATA)'; for p in $$list; do \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " rm -f $(DESTDIR)$(tutorialsdir)/$$f"; \ rm -f $(DESTDIR)$(tutorialsdir)/$$f; \ done # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ETAGS = etags ETAGSFLAGS = tags: TAGS 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; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ fi; \ done; \ 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; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = ../.. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d $(distdir)/$$subdir \ || mkdir $(distdir)/$$subdir \ || exit 1; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" \ distdir=../$(distdir)/$$subdir \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(DATA) installdirs: installdirs-recursive installdirs-am: $(mkinstalldirs) $(DESTDIR)$(tutorialsdir) install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_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-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: info: info-recursive info-am: install-data-am: install-tutorialsDATA install-exec-am: install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool uninstall-am: uninstall-info-am uninstall-tutorialsDATA uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \ clean-generic clean-libtool clean-recursive distclean \ distclean-generic distclean-libtool distclean-recursive \ distclean-tags distdir dvi dvi-am dvi-recursive info info-am \ info-recursive install install-am install-data install-data-am \ install-data-recursive install-exec install-exec-am \ install-exec-recursive install-info install-info-am \ install-info-recursive install-man install-recursive \ install-strip install-tutorialsDATA installcheck \ installcheck-am installdirs installdirs-am \ installdirs-recursive maintainer-clean maintainer-clean-generic \ maintainer-clean-recursive mostlyclean mostlyclean-generic \ mostlyclean-libtool mostlyclean-recursive tags tags-recursive \ uninstall uninstall-am uninstall-info-am \ uninstall-info-recursive uninstall-recursive \ uninstall-tutorialsDATA # 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: aplus-fsf-4.22/src/tutorials/Assignment0000444000265000001440000004524007232116241013667 Assignment Summary 1. Introduction 2. Ordinary Assignment: ax and (a)x 3. Strand Assignment: (a;b)(x;y) 4. Value and Value in Context Assignment 4a. Value: %`var 4b. Value in Context: `ctx%`var 4c. Value and Value in Context Assignment: (%`var)x and (`ctx%`var)x 5. Bracket Index Selective Assignment: a[i;j;;k]x 5a. Repeated Indices 5b. Replace All: a[]b 5c. Append: a[,]b 6. Choose-Pick Selective Assignment: (i#pa)x 7. Primitive Functions in Selective Assignment Expressions 1. Introduction The purpose of this tutorial is to familiarize the reader with the A+ primitive function called assignment, or specification. This primitive is the one to use for initializing and modifying the values of variables. Ordinary assignment is of the form ab, where the term ordinary refers to the simple form of the construct to the left of the arrow. Selective assignment allows for more complicated constructs on the left, whereby subarrays of the values of variables are replaced. It is possible to create functions with ordinary assignment when there is a function expression to the right of the assignment arrow. Function assignment is not a topic for this tutorial, however; see the A+ Reference Manual. In addition, ordinary assignment has a special side effect when used in the left argument of a dyadic do statement. This tutorial is made up of textual descriptions and A+ examples. You should set up your emacs environment to have two visible buffers, one holding the tutorial and the other an A+ session. If you are currently reading this in emacs, simply press F4. To bring individual expressions from the tutorial into the A+ session, place the cursor on the expression and press F2; for function definitions place the cursor anywhere in the definition and press F3. It is assumed that the expressions and functions are brought into the A+ session when you first encounter them, unless there are explicit directions to the contrary. If you need more help on running emacs and A+, see the Getting Started tutorial. 2. Ordinary Assignment Ordinary assignment associates a value, i.e. an array, with a variable name. For example: a2 3 and c.b'abcdef' In the latter case the assignment is to the variable b in the context named c: $cx c Enter the context named c $vars b b is in the context c $cx . Return to the root context $vars a a is in the root context Ordinary assignment can also be expressed in the form (a)b. When used inside a function definition, any appearance of ab means that a will be a local variable, while the form (a)b can be used to assign a value to the global variable a. 3. Strand Assignment Several ordinary assignments can be incorporated into one by way of strand assignment. For example: (a;c.b)('ABC';10+3 4) Strand assignment is important when working with dependencies. See the discussion of commit and cancel for sets of dependencies in the section on Cyclic Dependencies in the A to A+ document. 4. Value and Value in Context Assignment Symbols are convenient form for managing names in A+ applications, and there is a primitive function that evaluates symbols holding the names of global variables. 4a. Value Value is the monadic primitive function denoted by % that takes a symbol holding a global variable name as its argument and produces the value of the global variable. For example, your A+ session should now be in the root context, and we can then continue the above example as follows: %`a ABC %`c.b 10 11 12 13 14 15 16 17 18 19 20 21 4b. Value in Context Value in Context is the dyadic primitive denoted by %, which permits a symbol on the left representing the context of the variable on the right. `%`a The empty symbol ` denotes the root context ABC `c%`b 10 11 12 13 14 15 16 17 18 19 20 21 4c. Value and Value in Context Assignment Both Value and Value in Context can be used on the left side of assignment. (%`a)a a CBA (`c%`b)10%`c.b c.b 100 110 120 130 140 150 160 170 180 190 200 210 Both Value and Value in Context assignment are important when working with callback functions. See the A to A+ document for discussions of callback functions. 5. Bracket Index Selective Assignment Just as bracket indexing can be used to select subarrays, it can also be used on the left side of the assignment arrow to specify subarrays. Here are a series of examples applying bracket index selective assignment to a variable x. The examples have been chosen to make it fairly easy to look at x after each assignment to verify that you understand the change that took place. x3 5 6 x[0;0;0]50 Specify the element at coordinates (0,0,0) x[0;1]100+6 Specify the rank one cell at coordinates (0,1) x[0;1;]200+6 Specify the same rank one cell in a different way x[2]1000+x[2] Specify the second item x[2;;]1000+x[2] Specify the same item in a different way Any bracket index expression that can be used to select a subarray can be used to replace that subarray. The replacement array must have the same shape as the indexed subarray, or it must have one element. In the latter case, the one element in the replacement array replaces every element of the indexed subarray. x3 5 6 Restart x[1 2;;2+2 2] 2 5 2 2 x[1 2;;2+2 2]100+x[1 2;;2+2 2] x[1 2;;2+2 2]1000 5a. Repeated Indices What about repeated elements in the bracket index expression? Let's look at a simple example: y10 y[2 2 2] 30 40 50 The question is: element y[2] is associated with three distinct elements for replacement: 30, 40, and 50. What is the value of y[2] after the above assignment? The answer is: the one with the highest index in the ravel of the right argument. y[2] 50 Another example: y[2 23 3 3 3 ]2 2 100 200 300 400 y[3] 400 Finally, note that Value, Value in Context, and Ravel can be used with bracket indexed selective assignment. z5 6 (,%`z)[4 5 6]100 200 300 5b. Replace All: a[]b This is a special form of bracket index selective assignment for replacing all the elements in the variable named on the left of the assignment arrow. Either the shape of the array on the right must be identical to the shape of the value of the variable on the left, or the array on the right must have one element. In the latter case, every element of the array on the left is replaced with the single element on the right. For example: a3 4 a[]?3 4100 or a[]5 a 3 4 The differences between ab and a[]b are: ab copies b into a new (replacement) copy of a, but a[]b copies b into the existing a; ab enforces no (prior) compatibility restraints on a and b, but a[]b is valid only if a and b have compatible types, and either identical shapes or b has one element. However, a[]b is the most efficient way to replace an entire mapped file. 5c. Append: a[,]b This is another special form of bracket index selective assignment for appending items onto the end of an array. For example: a2 5 a[,]10 20 30 40 50 a 0 1 2 3 4 5 6 7 8 9 10 20 30 40 50 Execution of a[,]b can be more efficient then aa,b because if there is enough unused space in the storage area allocated to a, then b can simply be copied into the area at the end of a. This form of specification is the most efficient way to update a mapped file. 6. Choose-Pick Selective Assignment The basic rule for bracket index selective assignment applies to Choose-Pick selective assignment as well: if the arrays i and p are such that i#px selects a subarray from x, then: (i#px)a will replace that subarray. Since # denotes the primitive Choose function and denotes the primitive Pick function, this is called Choose-Pick selective assignment. Value, Value in Context, and Ravel can be used with Choose-Pick assignment, as in: (i#,p`c%`x)a Examples: x(1 2 3;5 6;'abced') A three element boxed vector 1 2#2x bc (1 2#2x)'XY' (1 2;3 4 5)#1x 9 10 1 15 16 17 ((1 2;3 4 5)#1x)100+?2 310 Examine x to see the changes. Another example: (1 6 17 25#,1x)1000 2000 3000 4000 Examine x now and you will see that the last selective assignment did not replace a rectangle subarray of 1x, but instead modified elements scattered throughout x. This type of scattered assignment is most efficiently done to the ravel of the target array; if the array is not raveled, then Choose can only address these elements one at a time, as in: ((0;1);(1;0);(2;5);(4;1))#<1x < 1000 < 2000 < 3000 < 4000 Note the <1x is just 1#x, but the former construct was used to make the comparison with the earlier examples easier. It is left to you to make examples using Value and Value in Context. 7. Primitive Functions in Selective Assignment Expressions Some A+ primitive functions can be used in expressions on the left of the assignment arrow. They are: Take, Drop, Replicate, Expand, Ravel and Item Ravel, Reshape, Rotate and Reverse, and Transpose (monadic and dyadic.) Defined functions can also be used, but in the same ways as these primitives, and therefore are not discussed here. See the A+ Reference Manual. For example: a4 5'abcdefghijklmnopqrst' (2a)2 5'ABCDEFGHIJ' a ABCDE FGHIJ klmno pqrst (5a)5 5'abcdefghijKLMNOPQRSTUVWXY' a Ybcde fghij KLMNO PQRST The last result gives us a clue to the definition of this form of selective assignment. Let (f a)b represent the selective assignment for the monadic primitive functions listed above, where a represents a variable name. Then the definition of the assignment is as follows: first evaluate if a to get an array i, and then do the bracket index selective assignment (,a)[i]b Why does this work? The reasons are these: the elements of a are exactly all indices of ,a; ^/(,f a),a has the value 1. Make sure you understand these reasons. Applying the definition to the last example above, evaluate 5a to get the index array i: i5a i 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 0 0 0 0 Then evaluate (,a)[i]5 5'abcdefghijKLMNOPQRSTUVWXY' to get the result in the example. The fact that a[0;0] is 'Y' is explained by the rule for repeated elements in i (see Repeated Indices.) The definition for the dyadic primitives is similar. In this case the right argument a, which must be a name, is the target of the assignment and the left argument x is any conformable array for which x f a is valid. Then (x f a)b is evaluated by ix f a (,a)[i]b Note that the primitive functions listed above all have the property that the elements of the intermediate index array i are always a subset of a, which means that (,a)[i]b can never fail because of an index error (see reasons 1) and 2) above.) Value, Value in Context, Pick and Ravel can all be used with this form of selective assignment. See the A+ Reference Manual. aplus-fsf-4.22/src/tutorials/GettingStarted0000444000265000001440000005773310774504111014523 Getting Started Summary 1. Introduction 1a. Key Press Notation 2. Starting Up 3. Documentation 3a. Written Documentation 3a1. Unix 3a2. Emacs 3a3. A+ 3b. Online Documentation 3b1. Unix 3b2. Emacs 3b3. A+ 4. Exiting 4a. Ending a Workstation Session 4b. Ending an A+ Process 4c. Ending an Emacs Session 4d. Ending an Xterm Session 5. The Emacs/A+ Interactive Environment 5a. A+ Tutorials 5b. A+ Scripts 5c. A+ Sessions, Workspaces, and Log Files 5d. The A+ Buffer in Emacs 5d1. Setting the A+ Version 5d2. Setting the A+ Host Machine 5d3. Setting All Emacs Variables for A+ Mode 5e. A Sample A+ Session 1. Introduction Xterm and Emacs entries, as well as section titles, are enclosed in double quote marks when it helps to distinguish them from the surrounding text. The font in which the these tutorials appear on the screen is in fact an APL font (kaplgallant); the distinction between ordinary text and A+ expressions is usually clear from the context and the use of special symbols. It is possible that at some point, as you work through this tutorial, you will find yourself out of step with the text. Most likely, you will be in an Emacs session at the time. If that happens, exit from the Emacs session and go back to a point in the tutorial where you can start over. The tutorial is not so long that this will be burdensome, and it is definitely worthwhile to complete it successfully. 1a. Key Press Notation We will often use the notation Ctrl-, which means press and hold the Control key and, while holding, press the key specified by . For example, Ctrl-x means press and hold the Control key, and then press the x key. Similarly, Meta- means to press and hold the Meta key, which is marked with a diamond, or "Left", or "Right." If you are using an IBM keyboard, use Alt for Meta. If the dash is omitted, as in Esc x, press and release the first key (here Escape), and then press the the other key (here x). For the mouse, to "click" a button means to depress it and release it quickly. To "press" a button means to depress it and hold it until you are told to release it. To "double-click" is to click twice in quick succession. 2. Starting Up The purpose of this tutorial is to help people unfamiliar with the A+ system get up and running. We are interested in two application windows in this tutorial. One is an Xterm. This is an interactive window for executing Unix commands. If you see an "Xterm" icon on the lower left, double-click on it and an Xterm window will open. Or, move the mouse pointer to the background area, and then press and hold the right mouse-button to see the main menu of applications. Move the pointer to Xterm and release the button, and an Xterm window will open. You can start an A+ session in an Xterm session by entering: /usr/local/bin/a+ Even though A+ started in an Xterm can be used interactively, the preferred use is to run applications. Interactive use of A+ is best done in Emacs. The Emacs editor window is the other application window of interest here. Once again, bring up the main menu of applications as you did for Xterm. Only now, move the pointer to Emacs/A+ and release the button. You can also start an A+ session within Emacs. See "5. The Emacs/A+ Interactive Environment". If you now have both an Xterm and Emacs window on your screen then most likely one overlaps the other. 3. Documentation 3a. Written Documentation 3a1. Unix Unix is the operating system in which we work, and as an A+ programmer you will most likely have to know the rudiments of the system. The following reference is recommended: The UNIX Programming Environment, by Kernighan and Pike Prentice-Hall Software Series It is also possible to display online documentation for Unix; see "3b.Online Documentation". 3a2. Emacs The Emacs editor, which serves as the A+ application development environment, is described in: GNU Emacs Manual, by Richard Stallman Free Software Foundation or Learning GNU Emacs, by Cameron and Rosenblatt O'Reilly and Associates, Inc. 3a3. A+ 3b. Online Documentation 3b1. Unix There is substantial online documentation for Unix. To view the documentation on a particular topic from within an Xterm, enter the command: man topic (man stands for manual pages). For example, information on the Unix command cp (for copying files) can be viewed as follows: man cp A formatted description of the topic will be displayed in the Xterm window. Press Ctrl-c to quit the display. To learn more about manual page command, enter: man man Another way to view manual pages is in a separate window, that can be initialized from an Xterm by entering xman & (See the command Emacs & in "6c. More on Xterm" for the meaning of &.) The effect of this command is to display a new window. Click on the "Manual Page" button in that window and a manual-page display will appear, with help information in it. Press and hold down the "Options" button, drag the mouse pointer to search, and release. Enter the topic whose manual pages you want to see, and press the Enter key. This display can also be obtained by pressing the right mouse-button while the pointer is on the background area, moving the pointer to "Tools" and then to the right and then down the submenu that appears to "Manual Pages", and releasing the button. If for some reason you want a print out of the online documentation, e.g. on the Unix command cp, enter the command: man -t cp The output should automatically be printed on the default local printer in your area (see "6c. More on Xterm" regarding setting the printer name). 3b2. Emacs Emacs has an online tutorial and online help. Press Esc x, which will move the keyboard cursor to the so-called minibuffer (the last line in the Emacs window) with the prompt M-x. Enter help- and press the space bar. That is, at the point where you should press the space bar, the minibuffer should look like: M-x help- After you press the space bar you will see displayed the full names of both the tutorial and online help. Complete the name of the one you want and press the Enter key. 3b4. The Window Manager The windows on your display are under the control of a program known as a window manager. T 4. Exiting 4a. Ending a Workstation Session You can either log off the workstation, so that the next time you will have to log on again and start from scratch, or you can lock the workstation, which means that next time you simply unlock it and start where you left off. 4b. Ending an A+ Process To end an A+ process without ending the Xterm or Emacs session in which it is running, enter: $off The next time you start an A+ process, the same log file (see "4c. A+ Sessions, Workspaces, and Log Files") will be active. If you are also going to end the Xterm or Emacs session, you may want to save the log before you end the A+ process. 4c. Ending an Emacs session To end an Emacs session, press Ctrl-x followed by Ctrl-c. You will be prompted in the minibuffer to save any files that have been modified since they were last saved. In particular, if you have run A+ in this session you will most likely be asked whether or not your A+ session log should be saved: Do you want to save .emacs_a? (Y/N) You may want to answer Y to keep this log, at least for a while. If you answer N to any of these prompts, you will then be prompted as follows: Modified buffers exist, do you really want to exit? (yes or no) Answer yes. If you did not end your A+ session (see "4b. Ending an A+ Process"), you will then be prompted with: Active processes exist; kill them and exit anyway? (yes or no) Answer yes, and the Emacs window will disappear. For a fast exit with no prompting, put the mouse pointer on the title bar at top of the Emacs window and hold down the right mouse-button. Move the pointer to "Quit" and release. 4d. Ending an Xterm session To end an Xterm session, move the mouse pointer to that window, and press Ctrl-d. Or, as with Emacs, put the mouse pointer on the title bar at the top of the Xterm window and hold down the right mouse- button. Move the pointer to Quit and release. 5. The Emacs/A+ Interactive Environment The Emacs editor serves as the application development environment for A+. Bring up a new Emacs window, as described in the introduction. The line next to the bottom line contains "Emacs: *scratch*". The area above this line is called a buffer. The title of this buffer is "*scratch*". The bottom line of the window is called the minibuffer. Press the function key F4. The Emacs window should split into two buffers. The top buffer is now the scratch buffer, while the bottom one is an A+ session with the buffer title "*a*". The keyboard cursor is the solid, character-sized rectangle that indicates where the next typed character will go. The buffer containing this cursor is called the "selected" buffer. Pressing the F6 key (see "5b. More on Emacs for information on the F5, F6 and F7 keys") repeatedly will toggle back and forth between the two buffers, first selecting one and then the other. Moving the mouse pointer into a buffer and pressing the left mouse-button will also select that buffer. After you have pressed F4, the bottom buffer holds an interactive A+ session. Select this buffer and you can enter A+ expressions for evaluation. If you were developing an A+ application then typically you would select the top buffer and open an A+ script file for editing. Or, you might select an A+ tutorial instead. To open a file in the selected buffer, press Ctrl-x followed by Ctrl-f. The minibuffer will automatically be selected and will contain the prefix "Find file: ~/". To open a file from your HOME directory, simply enter its name and press the Enter key. To open a file in a subdirectory of your HOME directory, say the script "filetest.+" in the directory "versiontests", enter "versiontests/filetest.+". To open a file in any other directory, enter its full path and name, starting with /. The initial / causes Emacs not to include in the path the directory it identified in its prompt. For example, to open this tutorial, enter (Install_Directory)/doc/tutorials/GettingStarted If the file you name is found, it will be opened and displayed in the top buffer. Otherwise, the top buffer will appear to display an empty file and, in addition, the message "(New File) "will be displayed in the minibuffer. In the latter case, the file will not be created at this point; it will be created if and when you save it for the first time. Use the Home, PgUp, PgDn, arrow, and End keys to scroll through an open file. It is also possible to open a directory, in order to see the names of the files it contains. Once again, press Ctrl-x followed by Ctrl-f, but in response to the prompt Find file: ~/, enter the directory name. For example, to open the tutorial directory, enter (Install_Directory)/doc/tutorials You should then see a list of file names in the current buffer. Any file in the directory can now be opened simply by moving the keyboard cursor onto the file name and pressing the f key. Both A+ scripts and the tutorials contain executable A+ expressions and function definitions. An A+ expression that stands alone on a line can be brought into the A+ buffer and executed simply by placing the keyboard cursor on the expression and pressing F2. (Once the top buffer is selected, the keyboard cursor can be moved to the line holding the expression with the arrow keys; or you can put the mouse pointer on the expression and press the left mouse button.) Note that pressing F2 also causes the keyboard cursor to advance one line, leaving you in position to bring the next line into the A+ session with F2. To bring an entire function definition into the A+ session, place the keyboard cursor anywhere on the definition and press F3. (If the definition has only one line then F2 will do as well as F3.) Unbalanced punctuation anywhere in the buffer above the function definition, however, will prevent the function's being brought in. 5a. A+ Tutorials The A+ tutorials are located in (Install_Directory)/doc/tutorials, where, for instance, you will find the online version of this tutorial: By default the Install_Directory is /usr/local/aplus-fsf-x.xx (where x.xx is version.release) i.e. /usr/local/aplus-fsf-4.22/doc/tutorials/GettingStarted Open the file for this tutorial in the top buffer and use the down-arrow key to scroll down to this point in the file. You can then bring the following examples into your A+ session using F2. a3 5 a g{x}:x*2 g a You will notice that when the first, second, or fourth lines are executed, the result is displayed immediately below (not shown here). The third line holds a function definition, and there is no result to display when the line is executed. It is sometimes convenient to display the result of an execution in the tutorial; you shouldn't execute these lines. In general, the A+ expressions that should be executed are indented like those above. 5b. A+ Scripts A+ scripts define applications, toolkits, and utilities. They consist of global variable and function definitions, as well as expressions for initialization. Scripts are loaded into A+ sessions using the $load system command or the _load system function. For example, once an A+ session is begun, if you plan to use the screen management facilities, then load them as follows: $load s Once a script is loaded, all the functions and global variables defined in it are available, and all the executable statements it contains have been executed. Scripts can themselves include $load commands and _load statements, so that applications can load the toolkits and utilities they depend on, and need not incorporate them directly in their scripts. The effect of $load is by and large the same as if the script file were opened in a buffer, the keyboard cursor were placed on the top line, and F2 were held down until every line was brought into the A+ session. (See the A+ Reference Manual for the differences.) In particular, script files are processed line-by-line, starting at the top. When developing and maintaining an application you will usually open its A+ script in the top buffer and selectively bring parts of it into the A+ session using the F2 and F3 keys. F2 can also be used to bring a multi-line function definition into the A+ session, but line by line. This is particularly useful during debugging. Start with the keyboard cursor on the first line of a function definition and press F2 for each line. (Or, simply hold F2 down and it will automatically go from one line to the next.) As each line is brought in, its display in the A+ session has a prefix of *'s on the left, one for each level of unbalanced, nested parentheses, braces, or quotation marks (but not brackets). For example, consider the function definition penny x:{ m0.01; i1; while (m Pick: Monadic The basic buiding block for nested arrays is the Enclose primitive, denoted by monadic <. The Enclose primitive applies to any array and produces a scalar holding that array; the depth of the scalar result is 1 plus the depth of the argument, and the type of the result is always `box. <'abcde' < abcde <'abcde' Only a new line occurs, indicating an empty result. 'abcde' 0 <'abcde' 1 <<'abcde' 2 The Disclose primitive, denoted by monadic >, is a left inverse of Enclose, in that the Disclose of the Enclose of any array equals that array, unless that array was a function: the depth of a function is -1, and the minimum depth of the result of Disclose is 0. ><'abcde' abcde 'abcde'><'abcde' 1 Disclose is also permissive, in that applies to scalars of depth 0, i.e. scalars that are not a result of Enclose. >3 3 3=>3 1 Disclose also applies to arrays with more than one element, as long the all the disclosed elements have the same shape: >(1 2 3 4; 60 70 80 90) 1 2 3 4 60 70 80 90 In its simplest form, the Pick primitive, denoted by dyadic , is Choose followed by Disclose: 1('xcty';`xy_w;5 7) `xy_w >1#('xcty';`xy_w;5 7) `xy_w `xy_w1('xcty';`xy_w;5 7) 1 2('abc';5 2;`as_de;12 34 891) `as_de >2#('abc';5 2;`as_de;12 34 891) `as_de The left argument to Pick can also be a path vector that reaches as deep into the right argument as its length. For example: 0 1(('abcd';3 4 1);`xyz) 3 4 1 Ex 4 In the above examples the left arguments to Pick are composed of index expressions for the various levels of the corresponding right arguments. Note the order of these index expressions in the left arguments. Namely, if the left argument x is a vector with more than one element, and is a valid path vector for the right argument w, then xs equals (1x)(1x)w. Test this relation for the appropriate examples above; What are the conditions on x and the scalar n so that xw equals (nx)(nx)w. 4a. Slot-Filler Arrays Slot-filler arrays are two-element nested vectors that satisfy certain requirements and that, in return, are treated specially by the Pick primitive and screen display functions. Specifically, an array s is a slot-filler array if the following conditions are met: s is a two-element vector; both 0s and 1s are vectors or both are scalars, and they have the same number of elements; all the elements of 0s are symbols; the depth of 1s is at least 1. For example, the following are slot-filler arrays: (`a`b`c;(10;20;30)) (`w`xx`yyy`zzzz;(;5 3;'abcdef';(`astd;3 4 5 1))) (`qw;<10?20) The following are not: (`a`b;(10;30;30)) (`x`y`zz;2 3 4) Ex 5 Define a monadic function that returns 1 if its argument is a slot-filler array and 0 otherwise. Test your function on a variety of examples, and compare the results with those of the system function _issf. From the viewpoint of the Pick primitive, slot-filler arrays are key-value pairs. That is, if s denotes a slot-filler array, a symbol in 0s can be used as the left argument to Pick, with s the right argument, and the result is the contents of the corrseponding element of 1s. For example: `a(`a`b`c;(10;20;30)) 10 `b(`a`b`c;(10;20;30)) 20 Ex 6 If s is a slot-filler array and x is a symbol that appears in 0s, then xs equals ((0s)x)1s. Is this definition of xs correct? If not, correct it. A nested slot-filler array is one whose values in the key-value pairs may be also slot-filler arrays themselves, or even nested slot-filler arrays. For example, the following is a nested slort-filler array: s(`a`b`c;(10;(`x`y;(100;200));(`e`f;((`g`h;(1000;2000));'A+')))) when the right argument to Pick is a nested slot-filler array, the right argument can be a vector of symbols reaching into the right argument to extract a value. For example, evaluate each of the following: `as `b`xs `bs There is no need to Pick all the way to the bottom. `c`fs `c`e`gs The symbol scalar or vector on the left of Pick is called a path to the slot-filler array on the right. Ex 7 Repeat Ex 4 for nested slot-fillers. Note the order of the symbols in the left argument to Pick in the above examples. Namely, if the left argument v is a vector with more than one element, and is a valid path vector to the nested slot-filler array s, then vs equals (1v)(1v)s. Test this relation for the appropriate examples above; What are the conditions on v and the scalar n so that vs equals (nv)(nv)s. 5. Primitive Functions and Operators Specifically for Nested Arrays Some of the primitive functions discussed in the Simple Arrays tutorial apply to nested arrays, while others are restricted to simple arrays - in particular, those that are further restricted to numeric arrays. There are also primitives that are specific to nested arrays, in that their arguments, or results, or both, must be nested arrays. It is these primitives that are discussed in this section. 5a. Partition, Partition Count, and the Each Operator The primitives illustrated in this section are useful for partitioning arrays into sections. For example, suppose we want to break the following sentence into words: s"Partition Count is a dyadic function, while Partition is monadic." We begin by identifying the word breaks, namely the blanks: bs=' ' b 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 The Partition Count primitive applies to b and returns a vector whose length is the number of 1s in b, i.e. +/b, and whose ith item is 1 plus the length of the sequence of contiguous 0's following the ith 1. The argument to Partition Count must start with a non-zero element. Since the sentence s does not have a leading blank, b does not have a leading 1, so we'll prefix a 1 to b: 1,b 10 6 3 2 7 10 6 10 3 9 Be sure to compare this result to the lengths of sequences of 0's in b. The Partition function will break the sentence s up into parts (words, hopefully) based on the last result. (1,b)s < Partition < Count < is < a < dyadic < function, < while < Partition < is < monadic. As you can see, we have a nested vector of character vectors, which are (almost) words. Nested arrays are very useful here, because the character vectors are of different lengths. Let's check the lengths of words by applying the Count primitive to each element of the result (by way of the Each operator): w(1,b)s >#w 10 6 3 2 7 10 6 10 3 8 Note that these values agree with the elements in 1,b (there is no trailing blank on the last item). Each character vector has at least one unwanted character. For example, the first character vector holds the word "Partition", but the vector has 10 characters and the word has only 9. We can check that the extraneous characters are not on the front of the words by looking at the first character of each one: 1١w < P < C < i < a < d < f < w < P < i < m So, the extraneous characters are on the ends of the words. We will continue this example in the exercises. Ex 8 Use the Drop primitive and the Each operator to remove one character from the end of each word. Which of the resulting character vectors still contain extraneous characters? Suggest ways to get rid of all extraneous characters at once. Ex 9 Insert an extra space between two words in the sentence s, and call the new sentence s0. For example: s0"Partition Count is a dyadic function, while Partition is monadic." Partition s0: w0(1,s0=' ')s0 Examine w0, and explain how the extra blank in s is manifested in w0. How would you remove it from the w0? Ex 10 Partition the vector s0 of Ex 9 as follows: w1(1,s0' ,.')s0 Examine w1, and explain how the punctuation characters, as well as the extra blank, are manifested in w1. How would you remove these characters from w1? Ex 11 Suppose the leading character is a blank, i.e. form s1' ',s Describe the result of w2(1,s1' ,.')s1 Ex 12 How would you define a function to partition a sentence into words, when the punctuation characters can be commas, periods, and semicolons, and when there can be multiple blanks between words, and zero or mare blanks at the beginning and end of the sentence? 5b. Raze and Rake The primitives Raze and Rake apply to nested arrays and bring all elements up level 0 and 1, respectively. aplus-fsf-4.22/src/tutorials/ScalarFunctions0000444000265000001440000010535607232116475014673 Scalar Functions Summary 1. Introduction 2. Constants 2a. Numeric Constants 2b. Character Constants 2c. Symbol Constants 2d. Nested Constants 3. Scalar Functions 4. Arithmetic Scalar Functions 5. Operators 5a. Reduction 5b. Outer Product 5c. Scan 5d. Inner Product 6. Selection and Assignment 7. Relational Scalar Functions 8. Logical Scalar Functions 8a. Reduction Revisited 8b. Scan Revisited 9. Elementary Algebraic and Transcendental Scalar Functions 10. Miscellaneous Scalar Functions 10a. Absolute Value and Residue 10b. Signum 10c. Floor and Minimun 10d. Ceiling and Maximum 10e. Roll 11. Tables Table 1. Scalar Functions Table 2. Operators on Scalar Functions 1. Introduction This tutorial is for the reader who has little or no experience with programming in APL-like programming languages. The scalar functions exhibit many of the qualities that make A+ an effective programming language, while at the same time being generally familiar, so this is a good place to start. As you will learn, many program fragments in A+ can be stated in a few expressions that do not include explicit control statements. This expressiveness sometimes depends on using A+ primitive functions in ways that are not apparent from their definitions. So, don't expect to see all or even most uses of the A+ primitive functions in these tutorials. The tutorials are meant to introduce you to the language and some of its uses, but when you're done many surprises will still lie ahead. Who would want it otherwise? This tutorial is made up of textual descriptions and A+ examples. To execute the examples conveniently you should set up your Emacs environment to have two visible buffers, one holding the tutorial and the other an A+ session. If you are currently reading this in Emacs, simply press F4. The examples consist of indented A+ expressions and their values. Sometimes the text refers to the values, and it is helpful to have them handy, but the main reason they are displayed is to help you become familiar with A+ in the Emacs environment. In the later tutorials the values usually do not appear in the text. You should evaluate the indented expressions, and compare the results in the A+ session with those in the text. For example, when you see a display of the form 1 2+3 4 4 6 the indented expression 1 2+3 4 is the one to bring into the A+ session for evaluation. The second expression, 4 6, is the result of executing the indented expression and should not be brought into the A+ session for evaluation. To bring individual expressions from the tutorial into the A+ session, place the cursor on the expression and press F2. When an expression is brought into A+ in this way, it is automatically evaluated, and its value is displayed. The displayed value should be identical to the display in the tutorial. If you need more help on running Emacs and A+, see the "Getting Started" tutorial. If you want to try your hand at devising your own A+ expressions, see the keyboard layout diagrams in Chapter 2 and Appendix B of the A+ Reference Manual. 2. Constants 2a. Numeric Constants There are several preliminary things to discuss. First of all, a list of numeric constants can be entered on a line by separating the individual numbers with blanks, as in 3 4.5 7 3 4.5 7 This is a list of the three numbers, 3, 4.5 and 7. Secondly, negative numbers are denoted by a raised minus sign. For example: 5+2 3 Exponential notation can be used for fractional, or floating-point, numbers, as in 1.23e5 123000 which is 1.23 times 10 to the 5, or 123000. Negative exponents are denoted with the usual minus sign, not the raised minus sign, so that 2000e-2 20 is negative 2000 times 10 to the negative 2, or negative 20. 2b. Character Constants A single character is entered surrounded by quotation marks, and a list of characters is entered in exactly the same way. For example: 'axcdert' axcdert Either single quotes or double quotes can be used, but they must both be the same. For example: "axcdert" axcdert It is interesting to see how a quotation mark can be included in a list of characters. If a single quotation mark is to be included, surround the list with double quotes; if a double quote mark is to be included, surround the list single quotes. For example: 'He said, "Oh no!"' He said, "Oh no!" "I can't go." I can't go. The question then becomes, how are both quotation marks included in the list? The answer is that the one that is identical to the quotes surrounding the list must be doubled. For example: '"I can''t go either," he said.' "I can't go either," he said. 2c. Symbol Constants A symbol constant is of the form backquote,characters. An example is `ThisIsASymbol. It provides a form that enables rapid comparison and is convenient for aggregation. A vector of symbols can be written simply by juxtaposing them, with or without blanks between them: `s1 `s2`s3 `s4 `s5`s6 `s1 `s2 `s3 `s4 `s5 `s6 2d. Nested Constants In addition to numeric, character, and symbolic data, A+ has nested, or boxed, data. Nested data comes in lists, like numeric, character, and symbolic data, except that the elements are not restricted to individual numbers, characters, or symbols; they can be anything. For example: (2 3.5 7;'dfgtyuh') < 2 3.5 7 < dfgtyuh This constant has two elements. The < in the display indicates that what follows is a boxed element. An easy way of producing nested arrays is to use strand notation, as in the example. It is of the form (...;...;...) and its value is a list, or vector. The successive elements of this list are the enclosures, or boxed forms, of the successive expressions between semicolons or between a semicolon and a left or right parenthesis. 3. Scalar Functions For convenience, the scalar functions have been divided into categories that may be familiar to you. The arithmetic functions are Plus, Minus, Times and Divide. The relational functions are Equal to, Not equal to, Less than, Less than or Equal to, Greater than, and Greater Than or Equal to. The logical functions are And, Or, and Not. The elementary functions are Power, Log, and certain trigonometric and algebraic functions. Finally, there is a miscellaneous set. The names and symbols of the scalar functions are summarized in Table 1, at the end of the tutorial. The expressive power of the scalar functions in A+ is largely due to useful variations provided by operators. "5. Operators" introduces Reduction, Scan, Outer Product and Inner Product. Table 2, at the end of the tutorial, tells which of these operators apply to which scalar functions. 4. Arithmetic Scalar Functions The common arithmetic operations are examples of scalar functions in A+. They are Plus (+), Minus (-), Times (), and Divide (). They apply to individual numbers, as in: 3+4 7 and they apply to lists in an element-by-element fashion. For example: 2 5 7 + 10 12 15 3 In this example the three numbers, 2, 5, and 7, are added to 10. The result is a list of three numbers. The spaces around the symbol + are meant as an aid to readability and are not necessary. A list of numbers can appear on the right of the operation symbol as well as the left, as in the following subtraction example: 200 - 27 34.56 1.521e2 129 173 234.56 47.9 71 and there can be lists on both sides of the symbol: 2 7 9 10 3 4 20 21 36 When there are two lists, i.e., more than one element on each side, the number of elements must be the same on each side. The operation of negation is denoted by - in mathematics, and in A+ as well. For example: - 3 6.7 12 102 1e-3 3.4e3 3 6.7 12 102 0.001 3400 The use of one symbol to denote two operations, such as the - symbol for subtraction and negation, is carried over in A+ to almost all its primitive operations. For example, denotes both division and the taking of reciprocals, as in: 2 3 10 5 6 5 0.4 0.5 2 and 5 10 12 0.2 0.1 0.08333333333 The number or list of numbers that appears to the left of a symbol is called the left argument of the operation. That which appears to the right is called the right argument. The two together are referred to as the arguments of the operation. When there are two arguments, the operation is said to be dyadic. When an operation has only argument, when nothing appears to the left of its symbol that could serve as the left argument, it is said to be monadic. Symbols, such as -, that have both a monadic and dyadic use are called ambivalent. Most primitive function symbols in A+ are ambivalent. It is time to adopt some conventional A+ terminology. The common mathematical term for +, -, and is operation. Operations are examples of the general mathematical notion of function, but the term operation is quite commonly used in mathematics when the symbol for the dyadic function appears between the arguments. However, in A+ we tend to use the more general term "function", even for the arithmetic operations. This may be due to the fact that A+ also has operators, another common mathematical concept, and the use of two closely related terms can be confusing. Whatever the reason, we will adopt the A+ convention, and from now on we will refer to the arithmetic operations as functions, and in particular as scalar functions. Ex 1. A mistake that is often made concerning numeric constant lists such as 1 5 12 21 is to attach functional significance to the spaces between items. Now that we have seen how scalar functions are evaluated, we can examine this common pitfall. For example, one might expect to be able to form the list consisting of 5 plus 23, 24 minus 13, and 10 times 6 simply by putting these expressions on a line separated by blanks, as in: 5+23 24-13 106 To understand how this expression is evaluated you need to know the following (see the Syntax tutorial for a general discussion): the first thing done in evaluating this expression is to form the constant 13 10; the next thing done is to form the constant 23 24; next, the function is evaluated; then -; and finally +. Use these rules and your knowledge of scalar functions to evaluate this expression by hand. Check your answer by bringing this expression into the A+ session for evaluation with F2. The next common expectation is to be able to put each of the expressions 5 plus 23, 24 minus 13, and 10 times 6 in parentheses, and then put these three parenthesized expressions on a single line separated by blanks, as in: (5+23) (24-13) (106) But this is an invalid expresson, and an attempt to evaluate it will result in an error message: PARSE +... : var? or, in Version 3, [parse] +... : var? To put the results of individual expressions like these three together in a list, you must use the function designed for that purpose, which is called Catenate and is denoted by the comma. Use F2 to evaluate the following expression: (5+23),(24-13),(106) Ex 2. Write two expressions for a 5-element list whose first two elements are those of the list 14+4 8 and whose last three elements are those of the list 4 9 12-3 10 7. 5. Operators In mathematics, operators are objects that act on functions to produce new functions. A+ has several operators that act on scalar functions. We will introduce them here for the arithmetic functions, and return to them later as more scalar functions are introduced. 5a. Reduction The slash (/) denotes an A+ operator called reduction. For example, +/ denotes + reduction, and / denotes reduction. The function symbol always appears to the left of the slash. The functions +/ and / are called derived functions because they are derived from other functions, namely + and . A hint at how these derived functions are defined is that +/ is also called summation. +/3 5 8 12 28 3+5+8+12 28 +/1 2 3 4 5 6 7 8 9 10 55 1+2+3+4+5+6+7+8+9+10 55 That is, +/ takes the sum of all elements in a list. The reduction operator applies uniformly to all functions whose symbols are permitted to the left of the slash (see Table 2), so you should suspect that reduction takes the product of all elements in a list. /3 5 8 12 1440 35812 1440 /1 2 3 4 5 6 7 8 9 10 3628800 12345678910 3628800 5b. Outer Product The symbols . denote the operator called outer product. .+ is called the outer product of + and . is called the outer product of . The outer product operator is sometimes called the table maker, and here is an example: 1 6 2 3.+4 10 3 5 11 4 10 16 9 2 8 1 7 13 6 When you execute the above outer product expression you will see the four separate lines displayed below the expression. These four lines are the rows of a table. You will note that the numbers in these rows line up vertically. The aligned vertical lists are the columns of the table. This table contains all combinations of sums of elements from the list on the left with elements from the list on the right. For example, the number at the third row, second column of the table is 8. By definition, it is the sum of the third element of the list on the left, 2, and the second element of the list on the right, 10. Pictorially: + 4 10 3 ------------ 1 5 11 4 6 10 16 9 2 2 8 1 3 7 13 6 Like reduction, the outer product operator applies uniformly to all functions whose symbols are allowed to the right of the . (see Table 2). For example, the tables produced by . contain all combinations of products, as in: 1 6 2 3.4 10 3 4 10 3 24 60 18 8 20 6 12 30 9 5c. Scan The backslash (\) denotes the A+ operator called scan. Scan is a companion of reduction: for example, while + reduction gives the sum of a list of numbers, + scan gives the running, or partial, sums: +\1 3 5 2 6 1 4 1 1 7 +/1 1 +/1 3 4 +/1 3 5 1 +/1 3 5 2 1 +/1 3 5 2 6 7 Note that something new about reduction has come up. Namely, + reduction of a single number is that number. In fact, this is true for any reduction. This is a separate definition from the one for lists with at least two elements, because there aren't enough elements to put the function symbol between. 5d. Inner Product The fourth and last operator to be introduced here is inner product, denoted by the dot (.). Unlike the other operators, inner product applies to a pair of scalar functions. For example, the inner product of + and is denoted by +.. The function +. is dyadic, and when applied to lists, as in a+.b, is equivalent to +/ab. For example: 34 1 5 12+.3 14 10 5 78 and 34 1 5 123 14 10 5 102 14 50 60 +/ 102 14 50 60 78 Inner products also apply to tables, and when +. is applied to tables it is equivalent to the ordinary matrix product in linear algebra. 6. Selection and Assignment Variables can be assigned values by placing their names to the left of the assignment arrow and the values to the right. For example: a12 23.921 83214 No value is displayed for assignment. Enter the name alone on a line, press the Return key, and the value will be displayed: a 12 23.921 83214 Once a variable has a value individual elements can be replaced. For example: a[1]1024.7 No value is displayed for indexed assignment. a 12 1024.7 83214 Individual elements can be selected as well: a[1] 1024.7 a[2 1] 83214 1024.7 Elements can be selected in any order. Note that for the purposes of selection and assignment, the first element is element number 0, the second element is element number 1, and so on. These numbers are called the indices of the elements. For example, in the above list a: 12 is the element at index 0 1024.7 is the element at index 1, and 83214 is the element at index 2. Note that not only can elements be replaced, but the entire value can also be replaced: a'x' No value is displayed for assignment. a x 7. Relational Scalar Functions The mathematical relations (=, , <, , >, ) are ordinary scalar functions in A+. They apply to lists of numbers in the same way as the arithmetic functions. They return boolean results, i.e., the numbers 0 and 1, where 1 indicates that the relation holds, and 0 that it does not. For example: 3 10<7 4 1 0 The value 1 0 expresses the fact that 3 is less than 7 but 10 is not less than 4. Equal to and Not equal to apply to lists of characters and nested lists as well as lists of numbers. For example: 'a'='xcade' 0 0 1 0 0 'a''xcade' 1 1 0 1 1 (1 2 3;'abcdef')=(1 2 3;'fed') 1 0 The advantage of the relations' being functions is that they can then be used in ordinary, mathematical-like expressions. For example, to evaluate the sum of the positive numbers in a list named w: w1 2 4 12 0 7 14 2 3 +/(w>0)w 31 Here is how it works. The subexpression w>0 produces a list of 1's and 0's; the 1's appear wherever the elements of w are positive. Then since 1 times any number is that number and 0 times any number is 0, an element of (w>0)w is equal to the corresponding element of w when the latter is positive, and 0 when it is 0 or negative. Since 0's do not contribute to a sum, +/(w>0)w is the sum of the positive elements of w. w>0 1 1 0 1 0 0 1 1 0 (w>0)w 1 2 0 12 0 0 14 2 0 +/(w>0)w 31 Note that the last expression is equivalent to the following inner product: (w>0)+.w 31 The outer product operator also applies to relational functions as well as the arithmetic ones. For example, we can answer the following question: how many times does each character in a list occur in that list? The answer for: x'ancahac' is 3 1 2 3 1 3 2. That is, reading the list of characters from left to right, there are three a's, one n, two c's, three a's again, one h, three a's again, and two c's again. (The matter of removing repetitions from the list of character counts is discussed in the "Simple Arrays" tutorial). We can use the outer product of = to compare every character of x to every other character. x.=x 1 0 0 1 0 1 0 0 1 0 0 0 0 0 0 0 1 0 0 0 1 1 0 0 1 0 1 0 0 0 0 0 1 0 0 1 0 0 1 0 1 0 0 0 1 0 0 0 1 The following display shows how the elements of x are related to the elements of the outer product result. = a n c a h a c -- -------------- a 1 0 0 1 0 1 0 n 0 1 0 0 0 0 0 c 0 0 1 0 0 0 1 a 1 0 0 1 0 1 0 h 0 0 0 0 1 0 0 a 1 0 0 1 0 1 0 c 0 0 1 0 0 0 1 If we look down any column of the outer product table, we see 1's whenever a character in the list x matches the character at the head of the column. If we sum the 1's in that column, we get the number characters in x that match the character at the head of the column. Of course the sum of the 1's in a column is simply the sum of the column because the other elements are 0. Therefore, + reduction of the columns gives us the answer: +/x.=x 3 1 2 3 1 3 2 You may have noticed that the table is symmetric. That is, we could just as well have summed the rows of the table to get the result. However, reduction applies to the columns by default. We will see how to apply reduction to the rows of a table in the "Simple Arrays" tutorial. 8. Logical Scalar Functions The logical functions are And and Or, and are denoted by ^ and . They apply to boolean values and produce boolean values. They are defined as follows: 0^0 equals 0 00 equals 0 0^1 equals 1^0 equals 0 01 equals 10 equals 1 1^1 equals 1 11 equals 1 We say that the result of ^ is "true" (i.e., 1) if both its arguments are true; the result is "false" if at least one argument is false. Similarly, the result of is true if at least one argument is true; the result is false if both arguments are false. The logical functions are often used to form compound relational expressions. For example, the following expression tests whether or not one of the two numbers c and b is greater than 10 (first giving c and b values so that the test can be evaluated): c5 b11 (c>10)(b>10) 1 If you wanted to know whether or not both c and b are greater than 10, the test expression would be: (c>10)^(b>10) 0 Note: the way to read A+ expressions is from left to right. For example, the above expressions is "c greater than 10 and b greater than 10." If either c or b (or both) are lists the situation is more complicated because the value of the expression will be a list of boolean values stating whether the individual elements of c and b satisfy the test. For example: c5 21 7 50 b2 10 20 17 (c>10)(b>10) 0 1 1 1 (c>10)^(b>10) 0 0 0 1 Consequently, depending on the problem at hand, you will usually want to know if all the individual relations hold , or if at least one does. However, many other conditions can arise, such as knowing that at least two of the individual relations hold. Using only what we know now about A+, we can determine the number of individual relations that hold by summing the boolean lists (the sum of a boolean list is the number of 1's in the list, which is the number of individual relations that hold). To sum the individual relations in the above expressions: +/(c>10)(b>10) 3 +/(c>10)^(b>10) 1 To test whether or not at least one of the individual relations holds: 1+/(c>10)(b>10) 1 1+/(c>10)^(b>10) 1 (Reading the last expression from left to right: "1 less than or equal to the sum of the relation: c greater than 10 and b greater than 10.") To test whether or not at least two of the individual relations hold: 2+/(c>10)(b>10) 1 2+/(c>10)^(b>10) 0 Testing whether or not all the individual relations hold can be done in the same general way as above, but it's a little trickier. Besides, it's time to introduce another way to do all these tests (see "8a. Reduction Revisited".) Before continuing with the reduction examples, there is a third logical scalar function to be introduced here, which is the monadic function called Not, or logical negation, and denoted by ~. The value of ~0 is 1 and that of ~x for any nonzero integer x is 0. Both ^ and also apply to all integers, not just 0 and 1, but the extended definitions are different in Versions 2 and 3. For Version 3 they are analogous to Not. For Version 2 see the March 1994 A+ Reference Manual. 8a. Reduction Revisited The reduction operator applies to both ^ and . Like plus and times, ^ reduction can be defined by putting ^ between the consecutive elements of a list, as in: ^/1 1 0 1 0 1^1^0^1 0 reduction is similar: /1 1 0 1 1 1101 1 In order to understand ^ and reduction, consider evaluating + reduction by placing the + symbol between all pairs of consecutive elements of a list, as follows: a+b+c+d+e+f+g Compute the sum any pair of consecutive elements, and then replace the + symbol and the two summands with the result. (Any pairs can be used because all the functions that are permitted in reductions are associative.) For example, let h be d+e, so the above expression becomes: a+b+c+h+f+g We now have a list of the same form as the original, but with one fewer element and one fewer + symbol. If the process is repeated, the same thing happens, and eventually all that is left is a single element and no + symbols. That single element is the result of the + reduction. The same procedure works for evaluating ^ reduction and reduction. Using it, we can verify the following rule: The result of ^ reduction is 1 when all the elements in the list are 1, and only then. To verify this rule, consider: 1^1^1^1^1^1^1^1 1 Evaluate any one of the ^'s and you get a 1. Replace the 1^1 you evaluated with that result and you will have the same expression as before, only with one less element and one less ^. Continue evaluating and eventually you will get to 1. Now put a 0 anywhere in the original list: 1^1^1^1^0^1^1^1 0 No matter what order you evaluate the individual ^'s, eventually you must come to either 1^0 or 0^1. Either one evaluates to 0, and the 0 replaces either 1^0 or 0^1. Either way, there is still a 0 in the list, and eventually you will get to a result of 0. As an exercise, use this line of argument to verify the following rule: The result of reduction is 0 when all the elements in the list are 0, and only then. Using these rules, we can see how two of the above tests can be rewritten. Namely, the rule for reduction says that the result of reduction is 1 if any elements in the list are 1. Consequently, a test of whether or not at least one of the individual relations holds is: /(c>10)(b>10) 1 Analogously, a test of whether or not all the individual relations hold is: ^/(c>10)(b>10) 0 8b. Scan Revisited Now that we understand ^ reduction and reduction, let's look at ^ scan and scan. Starting with ^ scan, consider the following example: ^\1 1 1 0 1 1 0 1 1 1 1 0 0 0 0 0 To understand this result, look at the individual ^ reductions that make it up: ^/1 1 ^/1 1 1 ^/1 1 1 1 ^/1 1 1 0 0 ^/1 1 1 0 1 0 ^/1 1 1 0 1 1 0 ^/1 1 1 0 1 1 0 0 ^/1 1 1 0 1 1 0 1 0 Reading the elements of the scan result from the left, all the corresponding elements of the ^ scan are 1 until the first 0 in the argument is encountered. Once the first 0 is encountered in the argument list, all elements in the scan will be 0 from that point on, no matter what else occurs. As an example of the use of ^ scan, and based on the above interpretation, if x is a boolean list, then +/^\x is the index of the first 0. For example: x1 1 1 0 1 1 0 1 +/^\x 3 x[0 1 2 3] 1 1 1 0 Consequently, if x represents a list of relations, then +/^\x is the index of the first relation (reading the list from the left) that fails to hold. For example: m5 21 7 50 8 p2 10 20 17 12 p |Greater | | | | | | | | |than | | | E | |Log |Natural Log | R | |Greater | | | | | | | | |than or | | | | | | | | |Equal to | | | E | |Circle |Pi tImes | L | ^ |And | | | | |fns | | | | | | | M | |Max |Ceiling | L | |Or | | | M | |Min |Floor | L | ~ | |Not | | M | |Residue |Absolute | | | | | | | | |value | | | | | | M | ? | |Roll | | | | | | M | |Combine | | | | | | | | |Symbols | | | | | | ------------------------------------------------------------------------- Table 2: Operators on Scalar Functions ----------------------------------------------------------- |Operator |Forms | |===============|=========================================| |Reduction | +/ / ^/ / / / | |Scan | +\ \ ^\ \ \ \ | |Outer Product | .+ .- . . . . .| | | .= . .< . .> . | |Inner Product | +. .+ .+ | ----------------------------------------------------------- aplus-fsf-4.22/src/tutorials/SimpleArrays0000444000265000001440000011777007232116507014207 Simple Arrays Outline 1. Introduction 2. Creating Test Arrays The primitive functions illustrated in this section are: Reshape: Dyadic Interval: Monadic Roll and Deal: Monadic and Dyadic ? Assignment: Dyadic 3. Characteristics of Arrays The primitive functions illustrated in this section are: Shape: Monadic Indexing: [;;] Count and Choose: Monadic and Dyadic # Type: Monadic 4. Scalar Functions 5. Structural Functions and the Items of Arrays The primitive functions illustrated in this section are: Take and Drop: Dyadic and Replicate and Expand: Dyadic / and \ Reverse and Rotate:Monadic and Dyadic Catenate: Dyadic , Laminate: Dyadic ~ 6. Reduction and Scan 7. Frames and Cells 7a. The Primitive Functions Member Of and Index Of 7b. The Rank Operator 8. Idioms and Phrases 8a. A To B 8b. Bar Graph 8c. Remove Duplicate Items 8d. Append 8e. Eliminate Leading Blanks from a Vector 8f. Eliminate Trailing Blanks from a Vector 8g. Eliminate Multiple Blanks from a Vector 8h. Left Justify a Character Vector 8i. Left Justify the Rows of a Character Matrix (preparation) 8j. Left Justify the Rows of a Character Matrix Using the Rank Operator 1. Introduction These tutorials are designed not only to familiarize you with the A+ language, but to help you adopt the attitude that much can be learned about A+ from experimentation. As you work on your programming assignments you will undoubtedly encounter A+ expressions, indeed entire functions, where you have no clue as to how they work. Often it is not necessary to know how they work, since you will only have to use them as is. And often you will be too busy to figure them out at the moment. Even so, you should get in the habit of reserving time to work your way through such functions. What you will learn are new ways to say things succinctly, new ways to say things in computationally efficient ways, and - this is rare, of course - some things not to do. In that spirit, this tutorial begins with a section on creating test data. The test data created here is fairly simple, because we aren't looking at very specific things. In order to understand real applications, it's worthwhile to generate realistic test data, although it may be difficult, and you may learn something new while doing it. Following the section on test data, there are several illustrating various things about various A+ primitives. The last section presents a series of basic A+ phrases, some sample test data, and some exercises to work through as you figure out what the expressions do and how they do it. Feel free to create your own test data and explore the boundaries - shape, type, and values - of where the expressions work and where they don't work. With one exception, the A+ primitives discussed in this chapter correspond to APL\360, which is the common part of all commercial APL systems. Thus, if you have an APL background, this chapter will show you where A+ differs from what you already know about APL\360, although most times the comparisons are left to you to make. If you do not have an APL background, the material in this chapter is a good place to start. The exception referred above is the rank operator, which replaces the axis operator in APL\360, but is much more general in its application and much more effective. This tutorial is not meant to be self-contained. You may have to look things up in the A+ Reference Manual, particularly in the later sections. Also, while many of the test expressions can be executed using F2, as described in the Getting Started tutorial, others must be typed in directly. Moreover, you must type in any test expressions of your own design, and any expressions that create your own test data. Consequently, you should have a printout of the A+ keyboard showing how to type the special graphic characters (see Chapter 2 and Appendix B of the A+ Reference Manual). 2. Creating Test Arrays The primitive functions illustrated in this section are: Reshape: Dyadic Interval: Monadic Roll and Deal: Monadic and Dyadic ? Specification: Dyadic In order to experiment with expressions in A+ it is very helpful to know how to produce test data, and the primitive functions illustrated in this section are the basic tools for doing it. Examples Execute each of the following: 10 20 3 2 A 4-element vector of 10, 20, 3, and minus 2. 2 210 20 3 2 10, 20, 3, minus 2 arranged 2-by-2. 1025 A vector of 10 copies of 25. ?1025 10 random numbers between 0 and 24. 5 12 The integers 0 through 59 arranged 5-by-12. 3 9100 A 3-by-9 matrix of 27 copies of 100. ?3 9100 27 random numbers between 0 and 99 arranged 3-by-9. 20?100 20 distinct random numbers between 0 and 99. 100+52 3 100, 105, ..., 125 arranged 2-by-3. 3 510 2 31 107 A 3-by-5 matrix filled with 10, 2, 31, and 107, repeated as necessary. 'abcdefgh' A vector of 8 characters. 4 2'abcef' A 4-by-2 matrix filled with a, b, c, e, and f, repeated as necessary. 12.012 10e5 A vector of two floating point numbers. 5 7 3 The integers 0 through 104 arranged 5-by-7-by-3. a5 12 The variable a now has the array value of the expression on the right of the arrow. a Enter the name alone and its value is displayed. 3. Characteristics of Arrays The primitive functions illustrated in this section are: Shape: Monadic Indexing: [;;] Count and Choose: Monadic and Dyadic # Type: Monadic Some A+ Primitives deal with the most basic properties of arrays. Arrays have: shape, e.g. the number of rows and columns of a matrix; count, e.g. the number of rows of a matrix; type, this is, whether the elements are characters, integers, etc. Not only can the shape of arrays be determined, arrays can reshaped into any shape (see the examples of dyadic in the preceding section.) And, finally, their elements can be extracted, either one at a time, or in contiguous blocks called subarrays. Examples Execute each of the following: ?1025 ?1025 5 12 5 12 'abcdefgh' 'abcdefgh' 12.012 10e5 12.012 10e5 c'abcdefgh' Make a character vector c. c[0] The first element in c. 0#c c[7] The last element in c. 7#c c[0 7 2 1] 4 elements of c in a 4-element vector. 0 7 2 1#c c[2 3 7 2 3 3 1 5] 6 elements of c arranged 2-by-3, with element 3 repeated. #c (2 3 7 2 3 3 1 5)#c xy?4 675 Make an integer matrix xy. xy[2;3] The element at row 2, column 3. (2;3)#xy xy[2;3 0 4] The elements at row 2, columns 3, 0 and 4. (2;3 0 4)#xy xy[1 2 0;3] The elements at rows 1, 2 and 0, column 3. (1 2 0;3)#xy xy[0 2;0 2 1] The cross-section of rows 0 and 2 and columns 0, 2 and 1. (0 2;0 2 1)#xy xy[0 2 0;] Rows 0, 2 and 0 again. (0 2 0;)#xy xy[;4 1] Columns 4 and 1. (;4 1)#xy xy[0 2 1] Rows 0, 2 and 1. 0 2 1#xy The shape of an array x, as evaluated by x, is a vector. It therefore has a shape of its own, which is x. x is called the rank of x. The rank of x is the number of axes of x. Execute each of the following: xy 4 5 'abcdeftg' 1 2 6 10 4 The last example illustrates an array of rank 0, which is called a scalar. A scalar has no axes, and therefore can't be indexed with bracket indexing. The shape of a scalar is an empty vector. For example, execute: 4 and nothing prints out in your A+ session (there is a "new line", however, which puts the next prompt two lines down instead of one.) 4. Scalar Functions This tutorial assumes that you are familiar with the idea of scalar functions and how they apply to arrays (see the A+ Reference Manual or the Scalar Functions tutorial). 5. Structural Functions and the Items of Arrays The primitive functions illustrated in this section are: Take and Drop: and Replicate and Expand: / and \ Reverse and Rotate: Catenate: , Laminate: ~ The complementary notions of leading axis and items are important in understanding how many of the structural functions in A+ work (a structural function is one that rearranges the elements of arrays, but does not change their values. For example, 10x is not a structural function because it multiplies the values of the elements of x by 10.) The leading axis of an array in the first one indexed. For example, in a[i;j;k] the leading axis is the one indexed by i; in b[n;m] it is the one indexed by n; in c[v] it is the only axis. The items of an array are the subarrays obtained by indexing the array with an index expression having the following properties: the leading axis is indexed with a single, scalar value; all other axes are indexed with null. For example, all the following index expressions produce items. Execute them: m3 5 m[0;] m[2;] a5 2 7 a[3;;] a[1;;] v10 v[1] v[8] In fact, items are such an important idea in A+ that there is a special, bracket notation for producing them, no matter what their rank. Repeating the above examples: m[0] m[2] a[3] a[1] v[1] v[8] Most A+ structural primitive functions apply along the leading axes of their right arguments and rearrange the items of that argument. The following are good test values to see how items are rearranged by these primitive functions. Bring them into the A+ session with F2. Examples v10 m10 10 Ex 1. denotes the dyadic primitive function called take. For a positive left argument n, the result is the first n items of the right argument. For example, execute: 3v Since is defined in terms of the items of the right argument, what do expect 3m to be? Confirm your guess by evaluating the expression. Ex 2. Experiment with nv and nm when n is greater than 10. Describe what you see in terms of items. Will this be true for character arrays too? What is true for character arrays? Ex 3. When n is negative, na is the last -n items of a. For example, try 4v What do you expect 4m to be? Ex 4. Repeat Ex 2 when n is negative and less that 10. Ex 5. 0a is an empty array, and consequently you cannot learn much by looking at it. Still, 0a is consistent with na for nonzero n, relative to its type and shape. Use the above test data and create some of your own to compare 0a and a, as well as 0a and a. Describe what you see, and in particular describe 0a in terms of the shape of the items of a. Ex 6. denotes the dyadic primitive function called drop. For a positive left argument n, the result is all but first n items of the right argument. Both its symbol and definition suggest that it is a complementary function to take. Rephrase Ex 1 - Ex 4 for drop and then do them. Ex 7. Ex 5 deals with 0a. Without testing it, describe what you think 0a is. Now test it. Fill in the indicated expression below: 0a equals ( )a ^ What goes here? Ex 8. More generally, for n0 fill in the indicated expression: na equals ( )a ^ What goes here? Ex 9. Fill in the expression in Ex 8 so that it works for both negative integers n as well. Ex 10. Look up the definitions of replicate and expand, rotate and reverse. Be sure you understand how they apply to the items of their right arguments (or, in the case of reverse, to its only argument.) Ex 11. Repeat Ex 10 for catenate. Note that catenate has an interesting special case when one argument has rank one less than that of the other one: the argument of lesser rank must have the same shape as the items of the other argument. For example, suppose that the argument of smaller rank is a. Then the definitions of both a,b and b,a are reduced to the equal rank case by replacing a with (1,a)a. Ex 12. The primitive function called laminate, which is denoted by ~, is an interesting variation in the way it uses the concept of items. Namely, it is dyadic and applies to arrays with the same shape. It produces an array with two items, which are identical to the two arguments. For example: 1 2 3 ~ 4 5 6 When one of the arguments is a scalar, that argument is reshaped to the shape of the other. For example: 1 2 3 ~ 4 and 3 ~ 4 5 6 Test this primitive with other arrays. Try to answer the following little puzzle: for which arrays x and y are the results x,y and x~y identical? When you find the answer, you will have found the case where the general definition of catenate based on items breaks down. It is a useful special case, but one you must watch out for in expressions that apply catenate to arrays of varying rank. 6. Reduction and Scan Reduction is an example of a mathematical entity called an operator, and it is called an operator in A+ as well. The operator is denoted by /, and it applies to certain scalar functions to produce a new function, called a derived function. For example, +/ is the derived function for + and is called + reduction, or summation. If v is a numeric vector then +/v sums the items of v. E.g., +/3 5 7 is 15. That is: +/v equals v[0]+v[1]++v[1+#v] This definition holds for v of any rank because v[i] denotes the ith item of v, no matter what the rank. Scan is also an operator. For example, +\ is the derived function for + and is called partial sums. If v is a numeric vector then +\v is the partial sums of the items of v. E.g., +/3 5 7 is 3 8 15. See the Scalar Functions tutorial for an introduction to these operators. Ex 13. Make sure you understand that reduction and scan apply to the items of arrays. Test your understanding with matrices and arrays of rank two and three (e.g., 3 5 and 3 5 2.) 7. Frames and Cells Frames and cells are a more general way of partitioning arrays than leading axis and items. For example, consider: a3 8 4 The array a has three axes. In an index expression of the form a[i;j;k] This expression is not executable unless i, j, and k are given values. The axis indexed by i is called the leading axis. If i is a scalar, the subarrays a[i;;], or equivalently a[i], are the items of a. In terms of frames and cells, the leading axis is the frame of rank 1 and the items are the cells of rank 2. Similarly, the first two axes are the frame of rank 2. If both i and j are scalars then the subarrays a[i;j;], or equivalently a[i;j], are the cells of rank 1. To complete the picture: the three axes of a are the frame of rank 3 and the scalar elements are the cells of rank 0; the empty set of axes is the frame of rank 0 and the array a itself is the cell of rank 3. The rank of the frame plus the rank of the cells within that frame equals the rank of the array. Instead of always referring explicitly to the rank of the frame and the rank of the cells, it is sometimes convenient to refer to "the frame for the cells of rank n", or the "the cells within the frame of rank k." The concepts of frame and cells are useful in explaining several A+ primitives. We will look at these primitives before the main topic of this section, which is the rank operator. 7a. The Primitive Functions Called Member Of and Index Of In its simplest form, where the arguments are scalars or vectors, the result of Member Of is a boolean vector where 1's mark the elements of the left argument that appear in the right. For example: 1 5 4 10 9 9 7 5 0 1 0 0 1 More generally, the definition of the function yx is this: let N denote the rank of the items of the right argument x, and let S denote their shape. Then the left argument y must have rank at least N, and the N cells of y must have shape S. If so, yx is defined and is a boolean array; its shape equals the shape of the frame for the cells of rank N; and an element of the result is 1 if the corresponding cell is identical to at least one item of the right argument x, and 0 otherwise. Ex 14. Let's see if we understand the definition of Member Of. Define x3 4 y6 4 1 10 5 2 8 9 10 11 17 0 1 9 5 4 6 7 0 1 2 3 7 9 1 0 and look at these arrays by executing the following: x y Since the rank of y equals the rank of x, the cells of y that are relevant to yx are just the items of y. Before evaluating yx, can you predict the rank of the result? The shape? The value? Evaluate yx to check your answer. Ex 15. Replace y in the Ex 13 as follows: y3 2 4y Now, what is the rank of the cells of y that are relevant to yx. What is rank of the frame that holds these cells? What is the shape of the frame? What is the rank and shape of the result yx? What is the value? Evaluate yx to check your answer. Ex 16. Replace y in the Ex 14 as follows: y8 9 10 11 Repeat Ex 14. Ex 17. Index of is similar to Member Of. It is denoted yx. There are two basic differences in the definitions. One, the roles of the left argument and right argument are interchanged from those of Member Of. That is, in Member Of, cells of the left argument are compared to items of the right. In Index Of, however, cells of the right argument are compared to items of the left. The second difference is that the value of Index Of is an array of integers: if a cell of the right argument is identical to an item of the left argument, the corresponding element of the result is the index of that item; if it matches more than one item, the element is the smallest index among those it matches; if there is no match, the element is the number of items in the left argument. Here's a simple example: 'mxaz' 'O1zAx' 4 4 3 4 1 Make sure you understand this result. Ex 18. Form x and y as in Ex 13. Describe the result of xy in terms of the items of x and the appropriate cells of y. Ex 19. Form y as in Ex 14, and then describe the result of xy in terms of the items of x and the appropriate cells of y. Ex 20. Form y as in Ex 15, and then describe the result of xy in terms of the items of x and the appropriate cells of y. 7b. The Rank Operator By now you should appreciate the uniformity with which many of the A+ primitive functions apply to the items of their arguments. You may also be wondering whether or not this is too restrictive. For example, what does one do to catenate one matrix to another row-by-row, instead of itemwise? Well, the answer to this question lies in another operator, called the rank operator and denoted by @. The definition of the rank operator is based on the concepts of frames and cells, which were just introduced. In effect, the rank operator specifies the rank of the cells to which a monadic function is to be applied, or the ranks in the case of a dyadic function. Ex 21. One of the easiest ways to see how the rank operator applies is with reduction. For example, execute: +/3 5 8 The result shows that the leading axis disappears; it is the axis over which the reduction took place. Now execute: (+/@ 1)3 5 8 The expression +/@ 1 means that reduction will be applied to cells of rank 1 of the array 3 5 8. (The parentheses around +/@ 1 in the above expression are not necessary, but have been included for emphasis.) The cells of rank 1 are vectors along the last axis. The last result shows that the last axis is the one over which the reduction took place. Now here is the challenge: execute the following and explain what you what see: (+/@ 2)3 5 8 Hint: Answer the following questions. What are cells of 3 5 8 to which the reduction is applied? What is the result when ordinary reduction is applied to those cells? Here are two more challenges: compare 3 5 8 and (+/@ 0)3 5 8 and explain what you see; compare +/3 5 8 and (+/@ 3)3 5 8 and explain what you see. Ex 22. In the rank operator we specify the function to be applied and the rank(s) of the cells to which it applies. For example: a3 4'abcdefghujkl' b3'ABC' The expression a(,@1 0) b expresses the catenation of the rank 1 cells of a to the rank 0 cells of b. That is, each row of a is catenated to the corresponding element of b. Evaluate this expression and make sure that you understand what you see. The rule of frames is: When the Rank operator is applied dyadically, the shape of the corresponding frames must be equal, if they are of the same rank, and otherwise the shape of the frame of lower rank, say r, must equal the last r dimensions of the shape of the other frame. Define c'zyxwvut' Evaluate a(,@1 1)c and explain what you see in terms of the rule of frames. Ex 23. For each of the following expressions explain what you think the result should be. Test your understanding by evaluating the expressions: a(@,2 2) b a(@,0 0) b a(,@1 0)'MNO' a(,@0 1)'MNO' a(,@2 0)'MNO' Consult the A+ Reference Manual regarding 3-element data operands and negative elements of data operands. 8. Idioms and Phrases The purpose of this section is to illustrate the expressiveness of A+ and to help you get in the habit of experimenting with the A+ expressions you come across in order to understand them. Most topics begin with one or more A+ expressions, followed by test data in a subsection called Example(s). Use F2 to first bring in the test data, and then go back to the expressions themselves and apply F2 to them to see what they do. 8a. A To B Make a vector of integers from a to b, where a is less than or equal b. a+1+b-a Example a10 b17 Ex 24. Modify this expression using max () and min () to work whether a is less or equal b, or vice versa. Ex 25. Repeat using absolute value (monadic ) and signum (monadic ) in place of and . 8b. Bar Graph This example uses the outer product operator (denoted by .). For example, .+ is the outer product of +. It is a dyadic function. x.+y forms an array consisting of the sums of all pairs of elements consisting of one from x and one from y. See the Scalar Functions tutorial for an introduction to the outer product operator. Here is a use of another outer product: ' '[v./v] or ' '[(/v).v] Example v?2020 Ex 26. Execute the above expressions for the test data and explain what you see. In particular, what role does /v play? 8c. Remove Duplicate Items ((vv)=#v)/v Example v?3010 Ex 27. The sample data is guaranteed to have duplicates. Why? Ex 28. The key here is the expression (vv)=#v. To understand what's going on, execute vv and #v separately so that their elements line up. Explain how duplicates can be identified by examining these two rows. (If the elements do not line up, execute (vv)~#v Why does this work)? Ex 29. Try the above expression on matrices: v(3 5'abcdefghijklmno')[?83] Explain what you see. 8d. Append d(1#a)#b (d(@0 1)a),db Example a'abcdfgeh'[?4 58] b'ABCDEFGHIJK' Ex 30. Experiment with da vs. d(@0 1)a. Describe the differences. The symbol @ denotes the Rank operator. The notation @0 1 signifies "the rank of applied to scalar (rank 0) items on the left and vector (rank 1) items on the right." Ex 31. Modify the expressions in this section to apply to a matrix b? 8e. Eliminate Leading Blanks from a Vector ((v' ')1)v or (\v' ')/v or (+/^\v=' ')v Example v' abc de f' Ex 32. Experiment with the expression (v' ')1 and describe its behavior. Ex 33. Experiment with the boolean expression \v' ' and describe its behavior. Ex 34. Experiment with the boolean expression ^\v=' ' and describe its behavior. 8f. Eliminate Trailing Blanks from a Vector You will write the expressions in this exercise. Example v'std sqz dabc ' Ex 35. Use rotate (monadic ) to modify the expression (\v' ')/v so that trailing blanks are removed. Ex 36. Use rotate (monadic ) and anything else to modify the expression (\v' ')/v so that trailing blanks are removed. Ex 37. Repeat the last exercise for (+/^\v=' ')v. 8g. Eliminate Multiple Blanks from a Vector ((1z)1z1,' 'w)/w Example w' srt 5cp qrsx ' Ex 38. Examine the boolean expression (1z)1z by first evaluating 1z and then 1z. Their elements should line up in the display, so that you can compare them quite easily. Explain how this expression removes duplicate blanks. Ex 39. What is role is played by the catenation by 1 in 1,' 'w? Suppose the 1 is replaced with 0. How does this change things? 8h. Left Justify a Character Vector ((v' ')1)v or (+/^\v=' ')v Example v' abc de f' Ex 40. Compare these expressions to the ones used for eliminating leading blanks. Explain the difference between the effect of eliminating leading blanks and left justifying. Hint: in left justification, where do the blanks go? 8i. Left Justify the Rows of a Character Matrix (preparation) (m' ')1 or +/^\m=' ' Example m3 5' abcd e f ghij' m Display m for reference below. abc d e f ghij Ex 41. Test these expressions for the sample data. If the expression executes successfully, explain whether it applies to the rows or columns of m. Ex 42. If an expression applies to the columns of m, modify the expression using monadic transpose () (see the A+ Reference Manual) so that it applies to the rows. 8j. Left Justify the Rows of a Character Matrix Using the Rank Operator f{x}:((x' ')1)x (f@1) m Example m3 5' abcd e f ghij' Ex 43. Explain (f@1) m. Ex 44. Use the rank operator in the same way to extend the other expression for left justifying vectors to one that applies to matrices. Ex 45. Here is a challenge for using the rank operator. Instead of defining the function f above and applying the rank operator to it, figure out how to apply the rank operator to the primitive functions in the expression ((m' ')1)m, so that the result justifies the rows of a matrix. aplus-fsf-4.22/src/tutorials/Syntax0000444000265000001440000012414210731532422013045 The Syntax of A+ Summary 1. Introduction 2. Names and Symbols 2a. Primitive Functions 2b. User Names 2c. System Names 2d. System Commands 2e. Comments 3. Infix Notation and Ambivalence 4. Syntactic Classes 4a. Numeric Constants 4b. Character Constants 4c. Symbol Constants 4d. The Null 4e. Variables 4f. Functions 4g. Operators and Derived Functions 5. Defined Functions 6. Dependencies 7. Bracket Indexing 8. Strands 9. Precedence Rules 10. Right-to-Left Order of Execution 11. Control Statements 11a. Case Statement 11b. Do Statement 11c. If Statement 11d. If-Else Statement 11e. While Statement 12. Execution Stack References 13. Well-Formed Expressions 1. Introduction The purpose of this tutorial is to describe the syntax of A+ through a series of examples, rather than in a formal way. Some commonly understood terms are used without being formally defined. In particular, the phrase A+ expression, or simply expression, is taken to have the same general meaning it does in mathematics, namely, a well-formed sentence that produces a value. A brief discussion of well-formed expressions is presented at the end, after all the rules for the components of expressions have been presented. Not all aspects of A+ syntax are discussed here; see the chapter on syntax in the A+ Reference Manual, and the Assignment tutorial. Although this tutorial is primarily concerned with syntax, examples require some knowledge of their meaning. Each example will be fully explained, but comprehensive treatments of topics other than syntax are left to the other language tutorials. The tutorial is made up of textual descriptions and A+ examples. You should set up your Emacs environment to have two visible buffers, one holding the tutorial and the other an A+ session. If you are currently reading this in Emacs, simply press F4. To bring individual expressions from the tutorial into the A+ session, place the cursor on the expression and press F2; for function definitions place the cursor anywhere in the definition and press F3. It is assumed that the expressions and functions are brought into the A+ session when you first encounter them, unless there are explicit directions to the contrary. If you need more help on running emacs and A+, see Getting Started. If you want to try your hand at writing your own A+ expressions, see the keyboard layout diagrams in Appendix B of the A+ Language Manual. If you need more help on running Emacs and A+, see the Getting Started tutorial. 2. Names and Symbols One of the most basic things to know is how things are named. There are no exercises in this section, just information you will need later. 2a. Primitive Functions A+ uses a mathematical symbol set to denote the functions that are native to the language, which are called primitive functions. This symbol set, which is the APL character set, consists of common mathematical symbols such as + and , commonly used punctuation symbols, and specialized symbols such as and . In some cases it takes more than one symbol to represent a primitive function, as in +/, but the meaning can be deduced from the individual symbols. 2b. User Names User names fall into two categories, unqualified and qualified. A valid, unqualified name is made up of alphanumeric (alphabetic or numeric) characters and underbars (_). The first character must be alphabetic. For example, a, a1c, and a_1c are valid unqualified names, but 3xy and _xy are not. A valid qualified user name is either an unqualified user name preceded by a dot (.), or a pair of unqualified user names separated by a dot. In either case there are no intervening blanks. For example, .xw1 and w_2.r2_a are valid qualified user names. 2c. System Names System names are unqualified names preceded by an underbar, with no intervening spaces. For example, _argv is a valid system name. The use of system names is reserved by A+. 2d. System Commands System commands begin with a dollar sign, followed immediately by an unqualified name, which is the name of the command. The name is followed by a space, and then possibly by a sequence of characters whose meaning is specific to the command. For example $fns is a valid system command. 2e. Comments Comments can appear on a line by themselves or to the right of any expression. They are indicated by the symbol, and everything to the right of this symbol is the comment. For example: 23 This is the A+ notation for multiplication. 3. Infix Notation and Ambivalence A+ is a mathematical notation, and as such uses infix notation for functions with two arguments. That is, the symbol or user name for a function with two arguments appears between them. For example, a+b denotes addition, a-b subtraction, ab multiplication, and ab division. In mathematics, the symbol - can also be used with one argument, as in -b, in which case it denotes negation. This is true in A+ as well. Because the symbol denotes two functions, one with one argument and the other with two, it is called ambivalent. A+ has extended the idea of ambivalence to most of its primitive functions. For example, just as -b denotes the negative of b, b denotes the reciprocal of b. User defined functions cannot be ambivalent. Functions with one argument are called monadic, and functions with two arguments are called dyadic. For a primitive function symbol, one often refers to its monadic use or dyadic use. Ex 1. Execute each of the following using F2. After each one is executed, you will see the result displayed immediately below. 52 2 A more interesting example, perhaps, is the primitive function denoted by the down arrow (meta-u on the keyboard). The dyadic form is called Drop because it has the effect of dropping a specified number of elements from a list. For example, if x is the name of a variable containing the list of five characters a, b, c, d, and e, then 2x drops the first two characters from the list, leaving a list of the three characters c, d, and e. The monadic form of is called Print because its effect is to display its argument in the A+ session log. For example, execute the following: 5(2) and you will see 2 displayed, followed by the result of the expression. The print primitive, like all primitives, produces a result, and that result is used in further execution. Unlike most primitives, it also has a side effect, which is the display of its argument in the session log. Ex 2. What do you think the result of x is? Describe it in terms of x. 4. Syntactic Classes 4a. Numeric Constants Individual numbers can be expressed in the usual integer, decimal, and exponential formats, with one exception: negative number constants begin with a "high minus" sign () instead of the more conventional minus sign (-). Negative exponents in the exponential format are denoted by the conventional minus sign. It is also possible to express a list of numbers as a constant, simply by separating the individual numbers by one or more blank spaces. For example: 1.23 7 45 3e-5 is a numeric constant with four numbers: 1.23, negative 7, 45, and 0.00003. Ex 2. Most likely you are familiar with numeric formats, and by the end of this tutorial you should be experimenting with expressions of your own creation, so we will use numeric constants to illustrate how to deal with ill-formed expressions. The high minus sign is not used for exponents. Execute the following to see a parse error message: 1e2 Ex 3. Constants can have more than one element, as illustrated above. As a single number, 1.2.3 is ill-formed, but A+ parses this sequence as if it were a list of numbers. Execute the following and explain what you see: 1.2.3 Ex 4. Constants can be put inside parentheses, which does not effect their value, but gives us a way to illustrate syntax errors. Execute the following: 2.109) You will see a syntax error message saying that the right parenthesis has no matching left. Now execute (2.109 You will now see a *. The display of a * by the A+ in circumstances like these indicates suspended execution. The reason that this expression results in suspended execution instead of a syntax error is that it is viewed by the A+ process as incomplete. More characters could have been appended on its right side to form a complete expression, which is not true of the first expression, 2.109). Select the A+ buffer, and the keyboard cursor should then be positioned to the right of the *. Enter the closing right parenthesis and press the Return key. You will see 2.109 displayed, just as if you had entered the syntactically correct expression (2.109) all on one line. Select the tutorial buffer to continue. The A+ language processor accepts expressions that occupy more than one line. However, expressions cannot be broken in the middle of names, or numeric constants, or primitive functions that require more than one character, and their must be a reason for A+ to expect a continuation, such as open punctuation. Ex 6. This exercise is a variation of the last one. Execute the expression: (2.109 Once again you will see a *. Select the A+ buffer and enter ( instead of ). Press the Return key. You will now see two *'s. There are two points to be made here. First, the number of *'s indicates the level of suspension. It now takes two actions to clear the suspended execution, e.g. two closing parentheses. Second, suppose entering the second ( was a mistake, and you simply want to clean things up and start over. To do this you should enter a right pointing arrow (meta-] on the keyboard) next to the two *'s, and press the Return key. Do that, and then select the tutorial buffer to continue. 4b. Character Constants A character constant is expressed as a list of characters surrounded by a pair of single quote marks or a pair of double quote marks. In order to include the surrounding quote mark in the list of characters, it must be doubled. For example, both 'abc''d' and "abc'd" are constant expressions for the list of characters abc'd. Ex 5. Execute each of the following to see how ' and " are handled: 'Aed"ss' "Aed'ss" The following will cause errors: 'Aed'ss' 'Aed' 'ss' Explain the error reports. Clear any suspended executions, and return to the tutorial buffer. Ex 6. What do you think happens if you break an A+ expression in the middle of a character constant?. Execute the expression: 'abcd and you will see the suspension indicator. To the right of it enter: * 2345' The result will now be displayed. Explain what you see. For that purpose, note that the symbol # applied monadically to a list of characters yields the number of characters in the list. For example: #'sdTvw' 5 Repeat the above example using # as follows: #'abcd * 2345' 9 Explain the result. 4c. Symbol Constants A symbol is a backquote (`) followed immediately by a character string made up of the alphabetic characters, underscores (_), and dots (.). A symbol constant can be thought of as a character-based counterpart to numeric constants. Just as 1 2.34 12e3 is a list of three numbers, `a.s `12 `w_3 is a list of three symbols. 4d. The Null The Null is a special constant formed as follows: (). It is neither numeric nor character, but has a special type reserved for it alone. 4e. Variables Variables are named data objects. They receive their values through assignment, or specification, which is denoted by the left-pointing arrow (). For example, the expression abc1 2 3 assigns the three-element list consisting of 1, 2, and 3 to the variable named abc. Any valid user name can serve as a variable name. For more on assignment, see the Assignment tutorial. 4f. Functions Functions take zero or more arguments and return results. A sequence of characters that constitutes a valid reference to a function will be called a function call expression. That is, a function call expression includes a function symbol or name together with all its arguments and all necessary punctuation. In general, the arguments of a function are data objects, which may appear in function call expressions as variable names, constants, or expressions that require evaluation. In addition, for the various forms of function call expressions using braces, arguments can also be functions. A function with no parameters - which must be a user defined function - is said to be niladic. The valid function call expression for a niladic function f is f{}. Functions with one argument can be either primitive or user defined. The valid function call expressions for a function f with one argument a are f a and f{a}. In the form f a, the space is required if, when it is omitted, the result would be a valid name, as plus 2.3. Functions with two arguments can also be either primitive or user defined. The valid function call expressions for a function g with two arguments a and b are a g b and g{a;b}. a is called the left argument and b is called the right argument. The rule for required spaces in the dyadic form a g b is the same as for the monadic form f a. Functions with more than two arguments must be user defined. The valid function call expression for a function of more than two arguments a, b, ..., c is f{a;b;;c}. For function call expressions that use braces and contain at least two arguments, any of the positions between neighboring semicolons, or between the left brace and the first semicolon, or between the last semicolon and the right brace, can be left blank. For example, each of the following is a valid function call expression: f{a;}, f{;b}, f{;a;b}, f{;;b}, etc. However, if f is monadic then f{} is not valid, because f{} is a niladic function call expression. When an argument position is legitimately left blank, A+ assumes that the argument is the Null. The number of arguments of a function is called its valence. The valence of a user defined function is fixed by the form of its definition. Ex 7. Use F2 to define the following dyadic function: a f b:a-b and then evaluate the following function call expressions: 2 f 5 f{2;5} (Function definitions are discussed in Defined Functions.) Explain the meaning of -{2;5} and then execute it for verification. Ex 8. Define the following function: g{a;b;c}:(a;b;c) As will be explained later, the result of this function is a data aggregate with three elements, which are the arguments to the function. For example, execute: g{1;2;3} and you will see displayed three lines, with < 1, < 2, and < 3. The symbol < indicates that the data being displayed is part of an aggregate. Now execute: g{;2;3} g{1;;3} and you will see that wherever an argument is omitted, the corresponding output line is < followed by blanks. This indicates that the omitted arguments are taken to be the Null (however, the same display line could represent other things as well, such as a blank list of characters.) 4g. Operators and Derived Functions There are two formal, primitive operators in A+, known as Rank and Each. By a formal operator we mean an operator in the mathematical sense, i.e. a function that takes a function as an operand, or produces a function as a result, or both. The resulting function is called a derived function. The Each operator is denoted by the dieresis, . For a given function f, the function derived from the Each operator is denoted by f. The function f can be either monadic or dyadic, in which case so is f. The Rank operator is denoted by the at symbol, @. Unlike the Each operator, the Rank operator has both a function argument and a data argument. For a given function f and data value a, the function derived from the Rank operator is denoted by f@a. f can be either monadic or dyadic, in which case so is f@a. Ex 9. The Rank and Each operators modify their function argument to produce some variant of that function. For example, use F2 to execute: (2;3)+4 You should see the error message +: type, which in this case means that + does not apply to data aggregates. Following the message is a line with a *, indicating suspended execution. Clear the suspension and return to the tutorial. Now use F2 to execute: (2;3)+4 Explain the result you see. What do you think the following expressions produce? Evaluate them to confirm your guesses. (2;3)+4 5 (2;3)+(4;5) Reduction, Scan, Outer Product, and Inner Product are not operators, strictly speaking: they do not accept all functions as operands. The ones they do accept are shown in Table 2-2. Because these character sequences look so much like derived functions, however, we will use the term operator to include these four as well as the primitive Each and Rank operators and user defined operators. Ex 10. Many of the symbols in should be familiar, but some may not be. For example, (meta-d on the keyboard) and (meta-s) denote the Minimum and Maximum functions, respectively, when used dyadically. Execute the following expressions: 35 35 /1 2 3 4 5 /1 2 3 4 5 +/1 2 3 4 5 Explain how the functions /, /, and +/ are variants of the functions , , and +. Feel free to experiment with other arguments. Remember, if you make error and execution is suspended, enter the right arrow (meta-]) to get out of it. 5. Defined Functions A function definition consists of a function header, followed by a colon, followed by either an expression, or an expression block, which is a series of expressions separated by semicolons and enclosed in braces and represents a sequence of statements to be executed. Function headers take the same forms as function call expressions (see Functions above), except that no argument may be omitted. A function header has the monadic form, dyadic form, or general form. The monadic form is the function name followed by the argument name, with the two names separated by at least one space. For example, if the function name is correlate then correlate a:{...} is a function definition with the monadic form of the header. The dyadic form of function header is the function name with one argument name on each side, with the names separated by at least one blank. For example: a correlate b:{...} is a function definition with the dyadic form of the header. The third form of function header is the general form, which is the function followed by a left brace, followed by a list of argument names separated by semicolons, and terminated with a left brace. For example: correlate{a;b;c}:{...} is a function definition with the general form of the header. In this example the function has three arguments. A function with one argument can be defined with either the monadic form of function header, or the general form, and analogously, functions with two arguments can be defined with either the dyadic form or general for. Regardless of which way they are defined, they can be called either way. Ex 8 provides an example of a defined function. The result of that function is the value of the (a;b;c). 6. Dependencies A dependency definition consists of a name (the name of the dependency), followed by a colon, followed by either an A+ expression, or an expression block. 7. Bracket Indexing A+ data objects are arrays, and bracket indexing is a way to select subarrays. Bracket indexing uses special syntax, whose form is x[a;b;;c] where x represents a variable name and a, b,,c denote expressions. The space between the left bracket and the first semicolon, between successive semicolons, and between the last semicolon and the right bracket, can be empty. Ex 16. This exercise takes us into the subject matter of the other language tutorials, but it is interesting to see what it means to leave the spaces in the bracket index expression empty. Execute the following: 3 4 and you will see a matrix with three rows and four columns, populated by the numbers 0 through 11. Execute each of the following and explain what you see: (3 4)[0;0] (3 4)[2;3] (3 4)[1;1 3] (3 4)[1;3 1] (3 4)[1;] (3 4)[;2] (3 4)[;] 8. Strands Aggregate data objects can be formed by separating the individual data objects with semicolons and surrounding the collection of data objects and semicolons with a pair of parentheses. For example: (a;b;...;c) where a,b,...,c denote expressions. Any of these expressions can be function expressions. See Ex 8. 9. Precedence Rules The precedence rules in A+ are simple: all functions have equal precedence, whether primitive, defined, or derived all operators have equal precedence operators have higher precedence than functions the formation of numeric constants has higher precedence than operators. Ex 11. Execute the following: 1 2+3 4 The result indicates that the constant with the two numbers 1 and 2, and the constant with the two numbers 3 and 4, are formed before + is applied. Do you see how this is related to the above rules? 10. Right-to-Left Order of Execution The way to read A+ expressions is from left to right, like English. For the most part we also read mathematical notation from left to right, although not strictly because the notation is two-dimensional. To illustrate reading A+ expressions from left to right, consider the following examples. a+b+c Read as: "a plus the result of b plus c." x-y Read as: "x minus the reciprocal of y." As you can see, reading from left to right in the suggested style implies that execution takes place right to left. In the first example, to say "a plus the result of b plus c" means that b+c must be formed first, and then added to a. And in the second example, to say "x minus the reciprocal of y" means that y must be formed before it is subtracted from x. Of course, reading from left to right is not necessarily associated with execution from right to left. For example, the expression ab+c is read left to right in conventional mathematical notation as well as A+, but the order of evaluation is different in the two; in mathematics a divided by b is formed and added to c, while in A+, a is divided by b+c. The order of execution is controlled by the relative precedence of the functions, or operations. In mathematics, divide has higher precedence than plus, which means that in ab+c, divide is evaluated before plus. Another way to say that A+ expressions execute from right to left is that A+ has long right scope and short left scope. For example, consider: a+b-cef The arguments of the minus function are b on the left (short scope) and cef on the right (long scope.) The left argument is found by starting at the - symbol and moving to the left until the smallest possible complete subexpresson is found. In this example it is simply the name b. If the first non-blank character to the left of the symbol had been a right parenthesis, then the left argument would have included everything to the left of the right parenthesis, up to the matching left parenthesis. For example, the left argument of minus in a+(xb)-cef is xb. The right argument is found by starting at the - symbol and moving to the right, all the way to the end of the expression, or until a semicolon is encountered, or until a right parenthesis, brace, or bracket is encountered whose matching left partner is to the left of the symbol. In the above example the right argument of minus is everything to the right. If the case of a+b-(ce)f, the right argument is also everything to the right. However, for a+(b-ce)f, the right argument is ce. 11. Control Statements 11a. Case Statement The form of a case statement is the word case, followed by an expression in parentheses, followed by one of two special expression sequences. The placement of semicolons must be as illustrated below. The point of the specification in the examples is that A+ control statements are actually compound expressions with results. xcase (a) {0;"The case is 0"; 1;"The case is 1"; "The default case" } xcase (a) {0;"The case is 0"; 1;"The case is 1"; } These expression blocks are of the form {case-expression0; value-expression0; case-expression1; value-expression1; . . . } In both of the above instances, the case statement is evaluated by first evaluating the expression in parentheses. The value of that expression is compared to the value of case-expression0. If they match, value-expression0 is evaluated and its value is the result of the case statement. If they do not match, the value of the expression in parentheses is compared to the value of case-expression1. If they match, value-expression1 is evaluated and its value is the result of the case statement. This pattern continues until the case-expression, value-expression pairs are exhausted. At that point the case statement either has one remaining expression (the first example above) or none. If there is one, it is evaluated and its value is the result of the case statement. If there is none, the result of the case statement is the Null. 11b. Do Statement The monadic form of the do statement is the word do, followed by an expression or expression block. The dyadic form is like the monadic form, except that a valid left argument expression appears to the left of the word do. There are two special forms recognized for the left argument. For example, evaluate each of the following: n10 xn do n n The specification of n is simply to get the example going. The point is that when the do statement is evaluated, n already has a value. The do statement prints the value of n each time it is evaluated. You might have expected to see a series of 10's, but you saw 0 through 9. The rule is that when the left argument is simply a variable name with an integer value, say k, that variable is successively given the values 0, 1,,k-1 for the successive evaluations of the expression on the right. Finally, evaluating the last statement in the above sequence shows that n once again has its value (10) from before evaluation of the do statement. Basically the same behavior occurs when the left side of the do statement is a simple specification. For example: x(n10) do n n No other form of the left argument has this effect. For example: n20 x(n-15) do n 11c. If Statement The form of an if statement is the word if, followed by an expression in parentheses, followed by another expression or an expression block. 11d. If-Else Statement The form of an if-else statement is the word if, followed by an expression in parentheses1, followed by another expression or expression block, followed by the word else, followed by another expression or an expression block. 11e. While Statement The form of a while statement is the word while, followed by an expression in parentheses1, followed by another expression or an expression block. 12. Execution Stack References Execution stack references are &, &0, &1, etc. The symbol & can be used in a function definition to refer to that function. For example, a factorial function can be recursively defined in either of the two following ways: fact{n}: if (n>0) nfact{n-1} else 1 fact{n}: if (n>0) n&{n-1} else 1 When execution is suspended the objects on the execution stack can be referenced by &0 (top of stack), &1, etc. See the Dealing with Errors tutorial. 13. Well-Formed Expressions Basically, a well-formed expression is one that takes one of the forms described above, and in which all of the constituents are well-formed. The potential for complicated expressions is due to the fact that every one of these basic forms produces a result and can therefore be used as a constituent in other forms. In this regard A+ is very much like mathematical notation. The concept of the principal subexpression of an expression is useful for analysis. As execution of an expression proceeds in the manner described in Right-to-left Order of Execution, one can imagine that parts of the expression are executed and replaced with their results, and then some remaining parts are executed using these results, and are replaced with their results, and so on. Ultimately the execution comes to the last expression to be executed, which is called the principal subexpression. Once executed, its value is the value of the expression. If the principal subexpression is a function call expression or operator call expression, the function or derived function is called the principal function. For example, the principal subexpression of (a+bc-d)*10n is x*y, where x is the result of a+bc-d and y is the result of 10n. The power function * is the principal function. As a second example, the principal expression of (x+y;x-y) is (w;z), where w is the result x+y and z is the result of x-y. In this case we do not refer to a principal function. Knowing the principal subexpression often reveals the thrust of a complicated expression. Mathematical notation gives visual clues that usually point the reader directly to the principal subexpression. There are clues in A+ as well, but they are based largely on experience. Ex 12. In each row of Table 3-1, an expression is given together with its principal function or expression. Make sure you understand each case. Table 3-1: Well-Formed Expressions --------------------------------------------------------------- |Expression |Principal Function or Principal Expression | |===============|=============================================| |a+b-cd |+ | |(a+b)-cd |- | |f߫w | | |(x-y)[a*2] |w[z] | |(+/w-a)/z |/ | |+/w-a | | |+/w-a |+/ | | (a+.b)a.+b | | | a.+b |.+ | |f{a;ga;x-y*2} |f{a;t;s} | --------------------------------------------------------------- aplus-fsf-4.22/src/tutorials/graphs/0000777000265000001440000000000010774512702013210 5aplus-fsf-4.22/src/tutorials/graphs/Makefile.am0000644000265000001440000000137107233310460015153 ## Process this file with automake to produce Makefile.in ############################################################################### ## ## ## Copyright (c) 2001 Morgan Stanley Dean Witter and Co. All rights reserved.## ## See .../src/LICENSE for terms of distribution. ## ## ## ## ## ############################################################################### graphsdir = $(prefix)/doc/tutorials/graphs graphs_DATA = \ graph_data.m \ graph_tutorial EXTRA_DIST = \ graph_data.m \ graph_tutorial aplus-fsf-4.22/src/tutorials/graphs/Makefile.in0000644000265000001440000001517410774512524015203 # Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ ############################################################################### ############################################################################### SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../.. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CXX = @CXX@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ STRIP = @STRIP@ VERSION = @VERSION@ X_INCLUDES = @X_INCLUDES@ X_LIBS = @X_LIBS@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ graphsdir = $(prefix)/doc/tutorials/graphs graphs_DATA = \ graph_data.m \ graph_tutorial EXTRA_DIST = \ graph_data.m \ graph_tutorial subdir = src/tutorials/graphs mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_CLEAN_FILES = DIST_SOURCES = DATA = $(graphs_DATA) DIST_COMMON = Makefile.am Makefile.in all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/tutorials/graphs/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: graphsDATA_INSTALL = $(INSTALL_DATA) install-graphsDATA: $(graphs_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(graphsdir) @list='$(graphs_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(graphsDATA_INSTALL) $$d$$p $(DESTDIR)$(graphsdir)/$$f"; \ $(graphsDATA_INSTALL) $$d$$p $(DESTDIR)$(graphsdir)/$$f; \ done uninstall-graphsDATA: @$(NORMAL_UNINSTALL) @list='$(graphs_DATA)'; for p in $$list; do \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " rm -f $(DESTDIR)$(graphsdir)/$$f"; \ rm -f $(DESTDIR)$(graphsdir)/$$f; \ done tags: TAGS TAGS: DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = ../../.. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: $(mkinstalldirs) $(DESTDIR)$(graphsdir) 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_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_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-generic clean-libtool mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-graphsDATA install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool uninstall-am: uninstall-graphsDATA uninstall-info-am .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-graphsDATA \ install-info install-info-am install-man install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool uninstall uninstall-am uninstall-graphsDATA \ uninstall-info-am # 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: aplus-fsf-4.22/src/tutorials/graphs/graph_data.m0000444000265000001440000002774007232070435015401 11As:À@Z\)@Z@ZzH@ZzHAs;s@ZQ@Z=p @ZQ@Z=p As;@ZG{@Z(\@Z=p @ZQAs<@ZG{@ZQ@Z=p @ZQAs=.@Z(\@Z(\@Z=p @ZG{As=@ZQ@ZQ@Z@Z=p As>f@Z@Z=p @ZQ@ZQAs>@Z\)@Z@ZQ@Z\)As?A@Z@Z@Z@ZAs?@Z=p @Z=p @Z@ZAs@p@Z\)@Z@Z\)@ZAsA@Z=p @Z=p @Z@ZAsBB@Z=p @Z=p @Z@Z=p AsC @Z@Z=p @Z\)@ZAsC@Z\)@Z@ZzH@Z\)AsD3@ZQ@ZQ@ZzH@ZQAsD@ZzH@ZzH@Z =p@ZzHAsEn@Z =p@Z =p@Zffffg@ZffffgAsF@Z =p@ZzH@Zffffg@Z =pAsF@ZzH@ZzH@Zffffg@ZzHAsG@Z =p@ZzH@Z =p@ZzHAsG@ZQ@ZQ@Z =p@Z =pAsHg@Zffffg@Z =p@Z\(@Z =pAsSA@Z =p@ZzH@Zffffg@Z =pAsT@Zffffg@Z =p@Zffffg@ZffffgAsU@Z\(@Zffffg@Z\(@ZffffgAsU@Z =p@Z =p@Zffffg@ZffffgAsU@Z =p@Z =p@Zffffg@ZffffgAsV@Z\(@Z =p@Z\(@Z\(AsW@Zffffg@ZQ@Zffffg@ZzHAsX@Z =p@ZzH@Z =p@ZzHAsX@ZQ@ZQ@ZzH@ZQAsYR@ZzH@Z@ZzH@ZAsỲ@Z\)@Z=p @ZQ@ZAsZ}@Z=p @ZG{@Z@ZG{AsZ@ZQ@Z@ZG{@ZQAs[@Z(\@ZzG@ZQ@Zp >As\5@ZzG@ZzG@Z(\@ZAs\݀@Zp >@ZR@Zp >@ZGzAs]k@ZR@ZR@Z\(@ZGzAs]@ZR@Z\(@Z@ZAs^@Z\(@Z =q@ZQ@ZAs_$@Z =q@ZR@Z@Z =qAs_ˀ@ZGz@ZGz@Z =q@ZGzAs`U@Z =q@ZR@Z =q@Z =qAs`@ZGz@ZGz@Z =q@Z =qAsa`@ZGz@ZGz@Z@Z =qAsb"@Z@Z@Z\(@Z\(Asb@ZQ@ZR@ZzG@ZRAscN@Z\(@ZzH@ZR@ZzHAsc@ZQ@ZQ@Z =p@ZzGAsd@ZQ@Zffffg@Z33333@ZffffgAs@Z@Z33333@Z@Z\(As6@Z33333@Z33333@Z\(@Z =qAsĀ@ZGz@Z\(@Z@Z\(Asd@Z33333@ZzG@ZR@Z =pAs@Z33333@Z33333@Z =q@ZGzAs揀@Z =q@Z\(@Z@Z =qAs @Z@ZGz@Z@ZGzAs紀@Z =q@ZGz@Z@ZAsL@Z =q@ZGz@Z@Z =qAs߀@Z@ZGz@Z@ZGzAs6@Z =q@Z =q@Z\(@Z\(As@Z@Z@ZQ@ZQAsꦀ@ZzG@Z\(@ZzG@ZQAs=@Zp >@ZQ@Zp >@ZQAs놀@ZzG@Z\(@ZzG@Z\(Ash@Z@Z =q@Z\(@ZAs@Z\(@Z =q@Z\(@ZAs#@Z\(@Z@Z\(@ZAs@Z\(@Z@Z\(@ZAsT@Z\(@Z\(@ZzG@ZQAs@Z\(@Z\(@ZzG@ZzGAs@Zp >@Z@Zp >@Z\(As$@ZQ@ZR@ZQ@Z =qAsԀ@Z@Z@Z\(@ZAsȀ@Z\(@Z@Z\(@ZAs@Z\(@Z@Z\(@ZAs @Z\(@Z@Z\(@Z\(At*@Z@Z@Z\(@ZAt@Z =q@Z =q@Z@ZAtv@Z =q@ZGz@Z =q@Z =qAt@ZGz@Z\(@ZGz@ZRAt@Z\(@Z33333@ZR@Z\(At@ZR@Z33333@ZR@ZRAtր@ZGz@ZR@Z =q@ZGzAtÀ@ZR@Z\(@ZGz@ZRAtq@ZGz@ZR@ZGz@ZGzAt@ZR@ZR@ZGz@ZGzAt@Z =q@ZGz@Z =q@ZGzAt@Z =q@ZGz@Z =q@ZGzAt@ZR@ZR@ZGz@ZGzAt@ZR@Z\(@ZGz@Z\(At @Z33333@Z =p@Z\(@Z =pAt @Z33333@ZQ@Z33333@ZQAt J@ZzG@ZQ@ZzG@Z =pAt @Zffffg@Z=p @Zffffg@ZǮzHAt m@ZQ@Z\)@Zffffg@ZQAt @Z\)@Z(\@ZQ@Z˅QAt @ZG{@Z˅Q@Z\)@Z\)At @Zə@Z=p @Z\(@Z\(Auހ@Z@ZR@Z\(@ZRAud@Z\(@Z33333@ZQ@Z\(Au@Z@Z@Z@ZAuߢ@Z =q@Z =q@Z@Z =qAu%@Z@Z =q@Z\(@ZAuÀ@Z\(@Z@ZQ@ZQAu/@Z\(@Z\(@ZQ@ZQAuf@Z\(@Z\(@Z\(@Z\(Au@ZQ@Z\(@ZQ@Z\(Au@Z@Z@Z@ZAu㌀@Z\(@Z\(@ZQ@Z\(AuA@Z@Z =q@Z@Z =qAun@Z@Z =q@Z@ZAuS@Z =q@ZGz@Z@ZGzAu@ZR@ZR@ZGz@ZRAu銀@Z\(@Z\(@Z =q@ZRAu@ZGz@ZGz@ZGz@ZGzAu3@ZR@ZR@ZR@ZRAuf@ZGz@ZQ@ZGz@ZQAu|@ZQ@ZQ@ZQ@Z =pAu@Zffffg@ZǮzH@Zffffg@Z =pAuX@Zffffg@ZǮzH@Zffffg@Z =pAu=@ZǮzH@Zə@ZǮzH@ZəAu@Z\)@Z=p @Z\)@Z\)AuH@Zə@Z=p @Z\)@ZəAu@Z=p @Z=p @ZQ@Z\)Au@ZQ@Z\)@ZQ@ZQAu@Z\)@Zə@ZQ@Z\)AuV@ZQ@Z\)@Z =p@Z =pAu@ZQ@ZQ@Z =p@ZǮzHAuw@ZQ@ZQ@ZǮzH@ZQAu΀@ZǮzH@ZQ@ZǮzH@ZQAu@Z\)@Zə@ZQ@Z\)Au<@Zə@Z=p @Z\)@ZəAu@Z\)@Z=p @Z\)@Z=p AvU@ZG{@Z˅Q@Z=p @ZG{Av@Z=p @ZG{@Zə@ZəAv@Z\)@Zə@Z\)@ZəAv@Z\)@ZG{@Z\)@ZG{Av@Z˅Q@Z˅Q@Z=p @Z=p AvY@ZG{@ZG{@Z=p @Z=p Av@Zə@Z=p @Z\)@ZəAv`@Z\)@Zə@ZQ@Z\)Av@ZQ@Z\)@Zffffg@ZǮzHAvm@ZQ@Z\)@ZǮzH@ZQAvG@ZǮzH@ZG{@ZǮzH@Z\)Avۀ@Zə@Z=p @Z =p@Z =pAv@Z33333@ZzG@ZQ@ZGzAv@ZGz@ZR@Z\(@Z\(Av6@ZQ@Z\(@ZQ@Zp >Av@ZzG@Z\(@Z(\@Zp >Avb@Z@Z\(@Z(\@ZzGAv@Zp >@ZQ@Zp >@ZzGAvx@ZQ@ZQ@ZzG@ZQAv@ZzG@ZQ@Zp >@ZzGAv@Zp >@ZzG@Zp >@ZzGAvF@ZQ@Z33333@ZzG@ZRAv@Z\(@Z =p@Z\(@ZffffgAv~@Z\(@Z\)@ZzG@ZQAv @Z\)@Z@ZǮzH@ZAv@Z@ZθQ@Z˅Q@ZAv:@Z(\@Z@Z=p @Z=p Av@ZG{@Z@Z=p @ZAva@Zp >@ZУ =q@Z@ZAv@Zp >@Zp >@Z˅Q@ZAv@Z(\@Z@Z˅Q@ZAv@Zp >@Zp >@Z(\@ZAv@Z(\@Z(\@ZG{@Z˅QAv@Z(\@Z(\@Z(\@Z(\Av@Z@ZzG@Z@ZAvz@Zp >@Zp >@ZG{@Z˅QAv'@Z(\@Z\(@Z(\@ZzGAv@Zp >@ZzG@Z(\@ZAvT@Zp >@Zp >@Z@ZAv@Z(\@Z(\@Z˅Q@Z˅QAv@ZG{@Z˅Q@Z=p @ZG{Av@Z˅Q@Z˅Q@Z=p @ZG{Av@Z˅Q@Z(\@Z˅Q@Z˅QAv#@Z(\@Z(\@Z˅Q@Z˅QAv@ZG{@Z˅Q@ZG{@Z˅QAv@ZG{@Z(\@Z=p @ZG{Av@Z=p @Z=p @Zə@ZəAv@Z\)@Z=p @Z\)@Z=p AvB@ZG{@ZG{@Z=p @ZG{AvĀ@Z=p @Z˅Q@Z=p @Z˅QAvF@Z(\@Z(\@Z=p @Z=p Av@Zə@Z=p @ZQ@ZQAv@Z\)@Zə@Z\)@ZəAv@Z\)@Z\)@Z\)@Z\)Avƀ@Zə@ZG{@Z\)@ZG{Av"@Z˅Q@Z˅Q@Z=p @ZG{Av@Z=p @ZG{@ZǮzH@ZQAvr@ZǮzH@Zə@ZǮzH@Z\)Av@Zə@Z@Zə@ZAv@Zp >@Zp >@Z˅Q@Z(\AvF@Z@ZzG@Zə@Z˅QAv@Z(\@Zp >@Z˅Q@ZAvy@Zp >@Zp >@ZG{@ZG{Av@Z=p @ZG{@Z\)@ZG{Av@Z˅Q@Z(\@Zə@Z=p Av{@ZG{@ZG{@Z =p@ZəAw/U@Z@ZGz@Z\(@ZУ =qAw/@Z@ZGz@Z@ZУ =qAw0@ZGz@Z =p@ZУ =q@Z33333Aw1$@Z =p@Z\(@Zҏ\(@ZQAw1@Z\(@Z =p@ZzG@ZzGAw2F@ZQ@Z\(@Z =p@ZQAw2Ѐ@ZzG@ZQ@Z =p@Z =pAw3l@Z33333@Z =p@Zҏ\(@Zҏ\(Aw4@Z33333@Z =p@Zҏ\(@Z33333Aw4y@Z =p@ZzG@Z33333@ZzGAw5@Z =p@Z\(@Z =p@ZzGAw5@ZQ@ZQ@ZzG@ZzGAw6i@Z =p@Z =p@Z33333@Z =pAw6@Z33333@Z33333@Zҏ\(@Z33333Aw7@Z =p@ZzG@Z33333@Z =pAw8&@Z33333@Z =p@Zҏ\(@Zҏ\(Aw8@Z33333@Z =p@Z33333@Z =pAw9I@ZzG@ZQ@ZzG@ZzGAw9@ZQ@ZQ@Z =p@Z =pAw:v@Z33333@Z =p@Zҏ\(@Z =pAw;@ZzG@ZzG@Z =p@Z =pAw;@ZzG@ZzG@ZR@ZRAw<@ZGz@Z =p@ZGz@Zҏ\(Aw<@Z33333@Z33333@ZR@Zҏ\(AwG@ZR@Z33333@ZR@Zҏ\(AwHo@Z33333@Z33333@Zҏ\(@Zҏ\(AwI @ZR@ZR@Z@ZУ =qAwIz@ZGz@ZR@ZGz@ZRAwJP@Zҏ\(@Zҏ\(@ZУ =q@ZGzAwJ@ZR@ZR@ZGz@ZRAwK@ZGz@ZGz@ZУ =q@ZУ =qAwK@ZGz@ZGz@ZGz@ZGzAwL@ZУ =q@ZGz@Z@ZAwL@ZУ =q@ZУ =q@ZУ =q@ZУ =qAwM@ZGz@ZGz@ZGz@ZGzAwN@ZR@ZR@ZGz@ZGzAwN@ZR@Zҏ\(@ZR@ZRAwO@ZGz@ZR@ZGz@ZRAwO@ZGz@ZGz@ZGz@ZGzAwPL@ZR@ZR@ZGz@ZGzAwRU@ZУ =q@ZУ =q@Z@ZУ =qAwS@Z@ZGz@Z@ZGzAwS@ZR@ZR@ZУ =q@ZУ =qAwT@ZGz@Zҏ\(@ZGz@ZRAwUU@ZGz@ZGz@ZУ =q@ZУ =qAwV@Z@ZУ =q@Z@ZAwV@Z\(@Z@Z\(@Z\(AwW0@Z@Zҏ\(@Z\(@ZRAwW@ZGz@Zҏ\(@Z@ZGzAwX[@ZУ =q@ZR@Z@ZУ =qAwY7@ZGz@Z =p@ZУ =q@Z =pAw@Z=p @ZۅQ@ZQ@ZQAwج@Z\)@ZG{@ZQ@Z=p Aw9@ZG{@ZۅQ@Z\)@Z\)Aw@Zٙ@Z=p @Z\)@Z=p Awt@ZG{@ZG{@Zٙ@Z=p Aw @Zٙ@ZzG@Zٙ@Zp >Awے@Z@Zp >@ZۅQ@Zp >Aw۫@Z@Z@Z@ZAwܭ@Z(\@Z@Z(\@Z(\Aw@Z@Zp >@Z@Zp >Aw@Z@Zp >@Z(\@ZAwg@Zp >@Zp >@Z@ZAw@Z(\@Z(\@Z(\@Z(\Awt@Z@Z@Z(\@ZAw)@Zp >@ZzG@Zp >@Zp >Awી@ZzG@Z޸Q@ZzG@ZzGAwj@Z޸Q@Z޸Q@ZzG@Z޸QAw@Z\(@Z\(@ZzG@Z޸QAwi@Z\(@Z\(@ZzG@ZzGAw@@Zp >@ZzG@Z@ZAw@Zp >@Zp >@Z(\@ZAwX@Z(\@Zp >@Z(\@Zp >Aw@Z@Zp >@Z@Zp >Aw@Z@ZzG@Z@Zp >Aw@Z\(@ZR@Z޸Q@Z =qAwJ@ZGz@ZGz@Z\(@ZAw@Z =q@Z =q@Z\(@ZAwW@Z =q@Z =q@Z =q@Z =qAw@Z@Z =q@Z\(@Z =qAw@Z@ZGz@Z@ZGzAw(@Z =q@Z =q@Z\(@Z\(Aw_@Z޸Q@Z@Z޸Q@ZAw@Z =q@Z =q@Z@ZAw@Z =q@Z =q@Z =q@Z =qAw@Z@Z =q@Z@ZAw-@Z\(@Z@Z\(@ZAw@Z =q@Z =q@Z\(@Z\(Aw@Z@Z@Z\(@ZAwр@Z\(@Z@Z\(@Z\(Aw@Z@Z@Z޸Q@Z\(AwH@Z޸Q@Z޸Q@ZzG@ZzGAw@Z޸Q@Z\(@ZzG@Z޸QAwp@Z\(@Z =q@Z\(@ZAw @Z =q@ZR@Z@ZRAw@ZGz@ZR@Z@Z =qAw2@ZGz@ZGz@Z =q@ZGzAwǀ@Z =q@Z33333@Z =q@Z\(Aw_@ZR@Z33333@ZGz@ZRAw@Z\(@Z\(@Z =q@Z =qAxO@Z@ZGz@Z@ZGzAx#@Z =q@Z\(@Z =q@ZGzAx@ZR@ZR@Z\(@Zaplus-fsf-4.22/src/tutorials/graphs/graph_tutorial0000444000265000001440000022624610774506327016113 Graph Tutorial 1. Introduction 2. The Components of a Graph Attributes: xs ys 2a. Traces and Trace Sets Attributes: linecolor (*) linestyle (*) linewidth (*) 2b. Title Attributes: title titlefg titlefont titlejustify 2c. Subtitle Attributes: subtitle subtitlefg subtitlefont subtitlejustify 2d. Footnote Attributes: footnote footnotefg footnotefont footnotejustify 2e. Legend Attributes: legend legend (*) legendbg legendfg legendfont legendstyle xlegend ylegend legendhlthickness legendshadowthickness 2f. x-Axis and y-Axis Titles Attributes: x/X/y/Ytitle (**) x/X/y/Ytitlefg (**) x/X/y/Ytitlefont (**) x/X/y/Ytitlejustify (**) y/Ytitlestyle (**) 2g. Axes Attributes: axis x/X/y/Yfg (**) grid gridfg gridstyle gridwidth rule rulewidth y/Ymode (**) 2g1. Axis Ticks Attributes: x/X/y/Yinc (**) x/X/y/Ymajorticksize (**) x/X/y/Yminorticks (**) x/X/y/Yminorticksize (**) x/X/y/Ytickstyle (**) 2g2. Axis Labels Attributes: x/X/y/Ylabelfont (**) x/X/y/Ylabeljustify (**) x/X/y/Ylabelout (**) x/Xsublabel (**) x/Xsublabeljustify (**) 2g3. Controlling Tick Mark Location and Label Formatting Attributes: x/X/y/Ylabel (**) x/y/X/Yextent (**) x/y/X/Ylabelheight (**) x/X/y/Ylabelwidth (**) x/Xsublabelout (**) 2h. Alternate Axes Attributes: axis x/yaxis (*,**) 2i. Zero Axes Attributes: zero zerofg zerostyle zerowidth 3. Trace Styles Attributes: barwidth fillcolor (*) font gradient (*) style (*) symbol (*) symbolsize (*) 3a. Text Traces Attributes: title (*) titlefg (*) titlefont (*) 4. Graph Attributes Attributes: bg bottom fg left refer right top y/Ybottom (**) y/Ytop (**) x/Xleft (**) x/Xright (**) x/Xmin (**) x/Xmax (**) y/Ymin (**) y/Ymax (**) 5. User Interactions 5a. Zooming 5b. Vertical Cursor and Cross Hairs Attributes: legendstyle 5c. Referencing a Graph, Line Trace, or Trace Point Attributes: coordinate/Coordinate refer referpoint selectable selected 5d. Selecting the Legend or a Text Trace 5e. Repositioning the Legend and Traces 5f. Copying and Deleting Traces Attributes: delete 5g. Editing and Creating Text Traces Attributes: addtexttrace copytextrace delete (as callback function) mode textactivate 5h. Modifying and Creating Numeric Traces Attributes: addtrace copytrace movelimit (*) selected (*) selectdistance 6. Monitoring Performance Variable: s.QUIET (*) Trace set attributes, or trace attributes for short. All the others are graph attributes. (**) An attribute with x/X/y/Y prefixed to its name is one that is separately defined for all four axes. The four axes are: the normal x-axis at the bottom of the graph, referred to as "x"; the normal y-axis at the left of the graph, referred to as "y"; the alternate x-axis at the top of the graph, referred to as "X"; and the alternate y-axis at the right of the graph, referred to as "Y". For example, x/X/y/Ytitle means there are four attributes: xtitle, Xtitle, ytitle, and Ytitle, one for each of the axes; x/yaxis means there are two attributes, xaxis and yaxis. 1. Introduction The purpose of this tutorial is to familiarize the reader with the graph display class in the A+ screen management system. In general, only those aspects of screen management specific to graphs are discussed here. See the general screen management tutorial to learn how the more widely applicable functions apply to graphs. The tutorial is made up of descriptions and A+ examples. You should set up your Emacs environment to have two visible buffers, one holding the tutorial and the other an A+ session. If you are currently reading this in Emacs, simply press F4. To bring individual expressions from the tutorial into the A+ session, place the cursor on the expression and press F2. It is assumed that the expressions and functions are brought into the A+ session when you first encounter them. If you need more help on running Emacs and A+ see the "Getting Started" tutorial. Once you have an active A+ session, load the screen management system by entering $load s That is, place the cursor on the above expression and press F2. At various points in the exercises, you will refresh the A+ session by exiting with $off, pressing F4 to start A+ again, and then loading the screen management system. Session refreshings will be indicated as follows: $off Exit from A+ Press F4 to start A+ again, then move the cursor back to the tutorial buffer, on the next line. $load s You may make mistakes when running the tutorial and it may become difficult to get back to a place where you can continue. At that point you should simply go back to the latest session refresh sequence and start over from there. Two more things before we start. First of all, by default graphs appear in the upper left corner of the screen. To avoid having the graphs overlay the tutorial, move the Emacs screen to the lower right, or put the tutorial in the bottom Emacs buffer and the A+ session in the top (you can do this by pressing F5 and then F6; you may have to do it more than once.) Secondly, even though the default sizes of the examples may be quite small, don't resize them unless told to do so, because the resizing may change the details of the graphs. In the examples we usually display the graphs first and then set their attributes so that you can see the effects. In practice, however, you set the attributes before displaying the graph. 2. The Components of a Graph A graph is a layout composed of one or more trace sets. The simplest trace set is a vector v, whose elements are plotted as the y-coordinates with x-coordinates #v. That is, the points (i,v[i]) are plotted for all i from 0 to (#v)-1. v 53 14 27 2 31 85 30 11 67 50 g`v show `g is `graph At this point you should see a window with "A+" in the grey title bar, and a gray graph area below it. The graph area has a title area with "g" in it, an x-axis and a y-axis, a legend, and a trace. This is the default appearance of the graph. Each of these components can be modified by setting the appropriate attributes, and there are other components that do not appear in the default. And, of course, there can be more than one trace on a graph. We will look at all of these components in this section. There are two attributes that allow us to control the size of the graph. We will use these attributes for resizing to ensure that the assumptions about the appearance of the graphs are correct. `g has (`xs`ys;(300;200)) This may have no effect, i.e., this may be the default size. 2a. Traces and Trace Sets The present graph g has only one trace set, i.e., one component variable v. However, like any container, it can have more than one. For example, w(#v)*2 gg,`w You should now see two traces on the graph, and an updated legend. The more general form of a trace set is a matrix rather then a vector, because then the x-coordinates as well as the y-coordinates can be specified. The individual coordinates are arranged as rows of the matrix, with the x-coordinates along the first column and y-coordinates along the second. For example, x4 28 10 4 24 1 5 6 60 x 8 10 4 24 1 5 6 60 gg,`x You should now see three traces on the graph, and an updated legend. Note that the new trace is indicated in the legend by "x:0", instead of simply "x". The reason for this is that matrix trace sets can provide more than one trace on the graph. For example, if we catenate a new column onto x as follows: xx(,@1 0) 40 20 50 80 you will see a fourth trace and a new row in the legend, indicated by "x:1". The 3-column matrix x provides two traces to the graph, both with the same x-coordinates. One trace is defined by columns 0 and 1 of x (the one indicated by "x:0" in the legend), and the other is defined by columns 0 and 2 (and indicated by "x:1" in the legend). All traces in a trace set share the same x-coordinates, which are in column 0 of the matrix. Note that in the default case, the traces in a trace set share the same color, but are distinguished by their line styles. Both line color and line style are trace set attributes that can be set. For example: `w has (`linecolor;`yellow) `w has (`linestyle;`dot) A full list of colors can be found in the A+ reference manual. The line styles are `solid, `dash (e.g., the trace indicated by "x:1" in the legend), `dot and `dotdash. For example: `w has (`linestyle;`dotdash) (Toggle back and forth between the last two expressions to see the difference in the two line styles.) Also, `dot1 through `dot5 give various intervals between dots, with `dot1 the smallest, `dot5 the largest, and `dot3 the same as `dot. `w has (`linestyle;`dot1) `w has (`linestyle;`dot2) `w has (`linestyle;`dot3) `w has (`linestyle;`dot4) `w has (`linestyle;`dot5) Analogously, there are `dash1 through `dash5 (different length dashes) and `dotdash1 through `dotdash5. The line colors and line styles can be set individually for all traces in a trace set by specifying these attributes to have vectors of values. `x has (`linecolor;`white `dodgerblue) `x has (`linestyle;`dot `solid) The last attribute affecting the appearance of line graphs allows the line width to specified, which is useful for emphasis: `v has (`linewidth;2) Note that the width of the corresponding line segment in the legend also changed. The units of line width are pixels. The last thing to be illustrated in this section is that a trace set with multiple visible traces behaves differently in a graph with a single trace set and in a graph with multiple visible trace sets. We will use a separate graph and locate it 350 pixels to the right, for simultaneous viewing. First, return the original graph to its default values: `x has (`linecolor;; `linestyle;); `v has (`linewidth;); xx4 28 10 4 24 1 5 6 60 gg`xx show `gg is `graph; `gg has (`x;350); xxxx(,@1 0) 40 20 50 80 The two traces contributed by x to the graph g, which is a graph with multiple trace sets, have the same color, but different line styles; color is used to differentiate among trace sets. On the other hand, the two traces contributed by xx to the graph gg, which has only one trace set, have different colors, but the same line style. free `gg Most of the attributes set so far have been on the trace sets, but three (the size parameters `xs and `ys and the horizontal position parameter `x) have been on the graph itself. This distinction is sometimes made explicit by our referring to attributes as "trace attributes" or "graph attributes." There are other visual forms a trace can take besides these various line styles; see "3. Trace Styles." 2b. Title The "g" that appears at the top of the gray plot area in our current example is the title of the graph. A more meaningful title can be specified using the `title attribute: `g has (`title;"Graph Tutorial Example") Both color and the font can also be set, and the title can be justified. There may be a delay in changing the font. Wait for the change before proceeding. (A list of recommended fonts can be found in the A+ Reference Manual.) `g has (`titlefg;`yellow) `g has (`titlefont;"helvetica-bold-20") `g has (`titlejustify;`left) or `right `g has (`titlejustify;`center) The title can have more than one line: `g has (`title;("Graph Tutorial Example";"Components of a Graph")) Note that the plot area composed of the axes and traces was automatically resized to accommodate the two rows of the title. The title can be removed by setting it to the empty vector: `g has (`title;"") 2c. Subtitle One graph component that does not appear in the default form of a graph is the subtitle. The subtitle appears between the title and the plot area. Since it has color and font settings separate from those for the title, it can be used for more effective title presentations. For example, put the first row of the title back: `g has (`title;"Graph Tutorial Example") and put the second row back as the subtitle: `g has (`subtitle;"Components of a Graph") `g has (`subtitlefg;`blue) `g has (`subtitlefont;"Times-Roman-15") `g has (`subtitlejustify;`left) or `right `g has (`subtitlejustify;`center) Subtitles, like titles, can have more than one row, and are removed by setting their value to "". 2d. Footnote The footnote is another component that does not appear in the default form of a graph. `g has (`footnote;"Morgan Stanley Co.") `g has (`footnotefg;`yellow) `g has (`footnotefont;"Times-BoldItalic-15") `g has (`footnotejustify;`center) or `right `g has (`footnotejustify;`left) Footnotes are removed by setting their value to "". 2e. Legend The text in the legend can be set for each trace set: `v has (`legend;"solid red") `w has (`legend;"broken yellow") `x has (`legend;("solid blue";"broken blue")) Note that if the text for a legend entry is the empty character vector, that entry is removed. `v has (`legend;"") `v has (`legend;"solid red") At this point you may want to resize the graph window, since otherwise the legend will now take up a large portion of the plot area. `g has (`xs`ys;(600;500)) The legend box can also be repositioned within the plot area. `g has (`legend;`br) Bottom right `g has (`legend;`tc) top center `g has (`legend;`tl) top left (where we started) Other settings are `tr, `bl, and `bc. (Note that we just set the `legend attribute for the graph g, while just above are settings of the `legend attribute for trace sets.) In addition, you can specify the position of the upper left corner of the legend box, as percentages of the horizontal and vertical lengths of the graph window. They take effect when `legend has the value `xy: `g has (`xlegend `ylegend;(25;75)) the (x,y) percentages `g has (`legend;`xy) Now that the `legend attribute has been set to `xy, settings of `xlegend and `ylegend take effect immediately: `g has (`xlegend;50) Note that the legend cannot be partially hidden by the choice of `xlegend and `ylegend. For example, if these coordinates are set to (95,95) one might expect that only the upper left corner of the legend would be visible. However, this is not the case: `g has (`xlegend `ylegend;(95;95)) the (x,y) percentages The specified position is respected as far as possible, consistent with keeping the legend completely visible. The values of `xlegend and `ylegend are integers between 0 and 100 or, alternatively, fractions between 0 and 1. The legend can also be strung out horizontally: `g has (`legend;`tl) `g has (`legendstyle;`hor) The original configuration is: `g has (`legendstyle;`ver) Other attributes control the colors and font of the legend. Specifically, the background color of the legend: `g has (`legendbg;`white) the foreground color, or color of the text in the legend: `g has (`legendfg;`blue) the font of the text in the legend: `g has (`legendfont;"Times-Roman-15") and, finally, even the pixel width of the legend's highlight and shadow thicknesses (the defaults are 1): `g has (`legendshadowthickness;3) `g has (`legendhlthickness;2) The legend can be made to blend into the graph: `g has (`legendbg;0`bg of `g) `g has (`legendshadowthickness;0) `g has (`legendhlthickness;0) The legend can be removed by setting the legend position to `none: `g has (`legend;`none) 2f. x-Axis and y-Axis Titles Titles for axes are two other components that do not appear in the default form of a graph. `g has (`xtitle;"0 to 9") `g has (`ytitle;"0 to 81") Let's make them big enough to be easily seen: `g has (`xtitlefont;"Times-Roman-25") `g has (`ytitlefont;"Times-Roman-25") Note that the x-axis title is positioned below the x-axis and the y-axis title is above the y-axis. The y-axis title can be repositioned vertically along the y-axis as follows: `g has (`ytitlestyle;`ver) The axis titles can be justified: `g has (`xtitlejustify;`left) `g has (`xtitlejustify;`right) `g has (`xtitlejustify;`center) `g has (`ytitlejustify;`top) `g has (`ytitlejustify;`bottom) `g has (`ytitlejustify;`center) Return to the original position with: `g has (`ytitlestyle;`hor) The y-axis title can now be justified right and left: `g has (`ytitlejustify;`left) `g has (`ytitlejustify;`right) `g has (`ytitlejustify;`center) Notice that there seems to be no difference in right and center justification of the y-axis title. We can set the left margin so you can see the difference: `g has (`left;20) `g has (`ytitlejustify;`left) `g has (`ytitlejustify;`right) `g has (`ytitlejustify;`center) `g has (`left;0) We'll have more to say about margins later. The colors of the axis titles can be set separately: `g has (`xtitlefg;`red) `g has (`ytitlefg;`yellow) 2g. Axes Most of the settable attributes in good graphics packages deal with axes, and this one is no different. There are four parts to an axis: the rule which extends the length of the axis; the tick marks; the labels on the tick marks; and the grid lines of the graph associated with the tick marks. Each of these parts can be controlled with the appropriate attributes. In addition, there are a few attributes that affect the overall appearance of the axes. First of all, we can control the color of the axes: `g has (`xfg;`yellow) `g has (`yfg;`red) We can also control the thickness of the axis rules: `g has (`rulewidth;2) As you can see, the thickness of both axes rules and tick marks are affected. The units of the axis thickness are pixels. A rule width of 0 has special meaning. Although it looks no different from 1 on the screen, it has the effect of drawing the rules more efficiently, and more importantly, perhaps, there is a noticable difference when a graph is printed. `g has (`rulewidth;0) More interesting, perhaps, is the control one has over the style of the axes. We will go through all the possibilities. For example, we can have an x-axis only or a y-axis only. `g has (`axis;`x) `g has (`axis;`y) `g has (`axis;`xy) Vertical grid lines can be placed at the major x-axis tick marks. `g has (`grid;`x) Likewise, horizontal grid lines can be placed at the major y-axis tick marks. `g has (`grid;`y) Both horizontal and vertical grid lines are also possible: `g has (`grid;`xy) Both the widths (in pixels) and colors of the gridlines can be set: `g has (`gridwidth;2) `g has (`gridfg;`green) A grid width of 0 has the same effects as a rule width of 0: `g has (`gridwidth;0) There is a `rule attribute whose default value is `axis, meaning that any axes that appear have rules. This attribute can also be set to values like those for `grid, indicating which axes have rules. For example, we can have a graph with an ordinary y-axis and just the x-axis rule: `g has (`axis;`y) `g has (`rule;`xy) An interesting effect is obtained by removing the rule from the y-axis: `g has (`rule;`x) The graph can have ascending values or descending values: `g has (`ymode;`descend) `g has (`ymode;`ascend) 2g1. Axis Tick Marks We will use an uncluttered graph to illustrate the details of tick-mark and label attributes. $off Exit from A+ Press F4 to start A+ again, then move the cursor back to the tutorial buffer, on the next line. $load s v 53 14 27 2 31 85 30 11 67 50 g`v show `g is `graph `g has (`xs`ys;(300;200)) This may have no effect, i.e., this may be the default size. The lengths of both the major and minor tick marks can be set. The unit of length is pixels. Let's first look at the default values to get a sense of their scale. `xmajorticksize of `g < 10 A+ output `xminorticksize of `g < 6 A+ output The tick marks can be made smaller, leaving a larger plot area. For example: `g has (`xminorticksize;2) `g has (`xmajorticksize;5) The number of minor tick marks that appear between major tick marks can be specified, for the x-axis and y-axis separately. In the present example, 4 minor tick marks between major tick marks on the y-axis would put a mark at every increment of 5: `g has (`yminorticks;4) It often improves the appearance of a graph to remove the minor tick marks, which can be done by setting their number to 0. For example: `g has (`xminorticks;0) The number of major tick marks can also be specified, if somewhat indirectly, by specifying the increment between major tick marks. For example: `g has (`yinc;40) `g has (`xinc;2) And, finally, we can control the style of the tick marks: pointing away from the plot area, into the plot area, or straddling the axis: `g has (`ytickstyle;`in) The tick marks point inwards `g has (`xtickstyle;`inout) The tick marks straddle the axis `g has (`xtickstyle;`out) The tick marks point outwards The latter is the default. Graphs with tick style `in are effective because the plot area is larger, and the inward pointing ticks rarely decrease the usable plot area. 2g2. Axis Labels We have control over two aspects of the axis labels: the font in which they are set and their format. At this point it is useful to switch to an example with realistic data. $off Exit from A+ Press F4 to start A+ again, then move the cursor back to the tutorial buffer, on the next line. $load s x0 "/usr/local/aplus-fsf-4.22/doc/tutorials/graphs/graph_data.m"; This data is high, low, open, close information taken at, roughly, 5-minute intervals over a 5-day period in Tokyo. The market day is partitioned into 5-minute increments and x contains one row for each period. A timestamp, which is in column 0, is the time of the last reading for the 5-minute period in which it falls. The timestamps are Unix timestamps. The data in columns 1 through 4 of a given row are associated with the 5-minute time period in which the timestamp in column 0 lies. They represent, starting with column 1, the high value of all readings taken during the 5-minute period, the low value, the open, and the close. At this point we need only one of the traces: yx[;0 1] g`y show `g is `graph `g has (`xs`ys;(300;200)) This may have no effect, i.e., this may be the default size. You will notice that the data on the graph appears clustered in several areas, and these clusters are connected by relatively long line segments. The clusters represent periods of market activity, while the long line segments represent periods during which the market is closed. In applications, these long segments would be factored out to give the graph a uniform appearance, but that is not a concern here. Let's look at the timestamp format on the x-axis labels first. Since this is daily data, we start with the seven-day format, which uses abbreviated names for the days: `g has (`xlabelout;`day7_u) Note that the major tick marks indicate the beginning of every other day, and the minor tick marks therefore mark the remaining days. Let's look at days of the month or days of the year, which are integers indicating the number of days since the beginning of the month or year: `g has (`xlabelout;`day31_u) The minor tick marks now represent half days. `g has (`xlabelout;`day365_u) Once again, the minor tick marks represent days. The time span between major tick marks, and therefore the meaning of the minor tick marks, depends to a large extent on the sizes of the labels, because these sizes determine the number of labels the graph can accommodate. We have some indirect control over the number of labels that appear and their format, because we can specify the font for the labels. (More direct control is described below in "2g3. Controlling Tick Mark Location and Label Formatting".) For example: `g has (`xlabelout;`day7_u) Check the default label font, and then set it to a smaller pixel size. `xlabelfont of `g `g has (`xlabelfont;"Helvetica-Bold-7") You should now see a major tick for each weekday. Of course the labels are very hard to read. Another possibility is to simply choose the size of the graph appropriately. First reset the axis font: `g has (`xlabelfont;"Helvetica-Bold-12") and then resize the graph: `g has (`xs`ys;(800;300)) There are two month-only formats, one that uses names and the other the numbers 1 through 12, and there are two year-only formats using 2 digits and 4 digits. These formats are not particularly interesting for data which is all from the same month, but for completeness here they are: `g has (`xlabelout;`m_u) `g has (`xlabelout;`m12_u) `g has (`xlabelout;`y2_u) `g has (`xlabelout;`y4_u) The next format gives a text form of day, month and year, while the four that follow give various abbreviated forms: `g has (`xlabelout;`mdy_u) `g has (`xlabelout;`mdy2_u) `g has (`xlabelout;`mdy4_u) `g has (`xlabelout;`dmy2_u) `g has (`xlabelout;`dmy4_u) The remaining time formats are hours, minutes, and seconds, so to get major tick marks with these units, restrict the data to a single day, as follows: y50y The market hours are 9:30 to 11:00 and 1:30 to 3:30. Test the following formats: `g has (`xlabelout;`hrmin) `g has (`xlabelout;`hrmin24) `g has (`xlabelout;`hr) `g has (`xlabelout;`hr24) To get major tick mark labels in minutes, further restrict the data as follows: y12y This data is not fine enough to exhibit variations in seconds, but here are the remaining time formats: `g has (`xlabelout;`min) `g has (`xlabelout;`sec) `g has (`xlabelout;`minsec) `g has (`xlabelout;`hrminsec) `g has (`xlabelout;`hrminsec24) Finally, you can remove the labels altogether: `g has (`xlabelout;`) In addition to the primary x-axis labels, there are sublabels that provide a second level of text. Sublabels are useful when all the label text does not fit conveniently on one line, and we will see examples of this in the next section. For now, go back to the original graph of this section: yx[;0 1] `g has (`xs`ys;(300;200)) `g has (`xlabelout;`day31_u) `g has (`xsublabelout;`m_u) The sublabels automatically appear. One last point on x-axis formatting. The labels and sublabels can be justified relative to the tick marks: `g has (`xlabeljustify;`right) `g has (`xlabeljustify;`left) `g has (`xlabeljustify;`center) `g has (`xsublabeljustify;`right) `g has (`xsublabeljustify;`left) `g has (`xsublabeljustify;`center) The sublabels are removed in the same way as labels: `g has (`xsublabelout;`) Turning now to the y-axis, which in this example represents bond prices, there are the following formats: `g has (`ylabelout;`32nd) `g has (`ylabelout;`64th) `g has (`ylabelout;`128th) `g has (`ylabelout;`320th) `g has (`ylabelout;`328th) y-axis labels can also be justified: `g has (`ylabeljustify;`top) `g has (`ylabeljustify;`bottom) `g has (`ylabeljustify;`center) Finally, we have three generally applicable label formats. For convenience we will use the present example for illustration, even though these formats are not appropriate for the data. The first of the three displays the decimal part of the number as a fraction: `g has (`ylabelout;`frac) The last two provide conventional floating point and fixed point formats: `g has (`ylabelout;`float) `g has (`ylabelout;`fixed) The number of decimal digits that appear can be specified for the fixed format: `g has (`ylabelout;(`fixed;2)) The default label format is `float. 2g3. Controlling Tick Mark Location and Label Formatting In addition to the variety of label formats illustrated above, you can also specify your own format, much as you specify the format of any data that appears on the screen. Furthermore, you have complete control over the tick mark locations and the text of the labels for those tick marks. Let's start with a clean slate. $off Exit from A+ Press F4 to start A+ again, then move the cursor back to the tutorial buffer, on the next line. $load s The screen management system provides ways for programmers to control the formatting of tabular data on the screen. Each array on the screen can be controlled separately. The control mechanisms for data on the screen are: a formatting parameter for the dyadic primitive format function can be specified for an array, and will be applied to every displayed element; a formatting parameter for the system function _fmt can be specified, and will be applied to every displayed element; a function can be specified that will be called for every displayed element. The same rules apply to labels on tick marks, only now the data elements being formatted are tick values. For example: y98+0.01+?20100 g`y show `g is `graph `g has (`ylabelout;6.3) A valid format parameter of A second example: `g has (`ylabelout;"f10.4") A valid format parameter of _fmt `ylabelout can also be specified as a function. See the discussion of the of the `out attribute in the A+ Reference Manual. Complete control over ticks and tick labels is provided by the `ylabel attribute. We'll begin by adjusting the window of the current graph slightly, just to make sure the bottom and top ticks that are created below will appear. `g has (`ymin `ymax;(97.9;99.1)) The value of the `ylabel attribute is a four-element nested vector of the form (ticks;labels;sizes;widths) where - ticks is a numeric vector representing the tick values, or locations on the axis where the tick marks occur; - labels is either a nested vector of character vectors, where ilabels is the label for the tick value i#ticks, or a character matrix, where i#labels is the label for the tick value i#ticks; - sizes is a vector of numbers between 0 and 1, where the length of the i-th tick mark is i#ticks times the current size of the major ticks (that size is controlled by the `majorticksize attribute); - widths is a vector of integers, where i#widths is the width, in pixels, of the grid line at the ith tick mark. Continuing the previous example: ticks98+.26 labels("one";"two";"three";"four";"five";"six") size0 .2 .4 .6 .8 1 width0 1 2 3 4 5 `g has (`ylabel;(ticks;labels;size;width)) You should see tick marks at locations 98, 98.2,...,99 with labels "one" through "six". The tick marks lengths are 0, 2,...,10 pixels (10 is the value of the `majorticksize attribute). And, finally, there are grid lines of width 0, 1,...,5 pixels. As you can see, the possibilities are boundless for creating major and minor tick marks with various label and grid line strategies. In this example all four quantities have the same length, but that is not required. If more labels are given than there are tick marks, the extras are ignored. If fewer are given, the missing ones are considered to be blank. In particular, tick marks without labels are obtained by specifying one label, and making that one all blank. `g has (`ylabel;(ticks;" ";size;width)) If either size or width has fewer elements than ticks, those elements are used cyclically, in the manner of the A+ Reshape primitive. `g has (`ylabel;(ticks;labels;size[1 3 5];width[2 4])) It is not necessary to specify all four components; only ticks must be present. If labels is missing, the default format is used, or the setting of the labelout attribute if there is one. `g has (`ylabel;(ticks;size[1 3 5];width[2 4])) If only one of size and width is present, which it is can (almost) always be determined by the values: widths must be whole numbers, while sizes are 0, 1, or fractions in between. The one ambiguous case is a vector of 0's and 1's, and that is taken to be a width specification. `g has (`ylabel;(ticks;0 1)) Like `ylabelout, `ylabel can be assigned a function that will be called whenever tick marks and labels are needed for a graph, e.g., each time a graph is zoomed (see "5a. Zooming"). When called, the function must produce a four-element vector like the one described above. There are interesting interactions between xlabel settings and sublabels. Suppose the x-axis in the present example represents dates and define: `g has (`xlabel;(210;10 3"JanAprJulOct")) Each group of labels "Jan through "Oct" represents a year, and we can use the sublabel attribute to put year designations under the groups: `g has (`xsublabel;(3 11 19;3 4"199219931994")) When a graph is zoomed, a section of the view is blown up to fill the entire plot area. If `ylabel is assigned a fixed value, as in the above example, then these are the only tick marks that can be used for the zoomed view. Some of them may fall in the range of the zoomed view, but some may not. If the area of the original graph chosen for zooming contained none of these tick values, no tick marks would appear. But if `ylabel is assigned a function, that function will be called to determine new tick locations and labels for the zoomed view. There are several graph attributes that can be referenced in the `ylabel function that produce information helpful in determining tick values and labels. `yextent of `g is a three-element vector containing the minimum value along the y-axis, the maximum value, and a scale factor. As a result of the last expression you should see: < 97.9 99.1 107.5 although the third element might be different. 97.9 is the minimum value and 99.1 the maximum value along the y axis, which we set above. The scale factor is such that (99.1-97.9)107.5 is the length of the y-axis in pixels. Resize the graph, evaluate `yextent of `g again, and you should see a new scale factor. It should be easy to understand that the minimum and maximum values are necessary for determining tick values. But what is the point of the scale? Well, you don't want so many tick values that the labels overrun each other. Since you know the length of the y-axis in pixels, once you determine the number of tick marks, you know the distance between tick marks in pixels. The labelheight attributes tell you the height in pixels of all labels, and therefore you can determine whether or not they overlap. For example: `xlabelheight of `g Analogously, xlabelwidth attributes tell you the width of labels in pixels, which can be used, for example, to see that x-axis labels don't overrun one another. However, the situation is more complicated for x-axis labels, since both the label texts and font characters can have different widths. Therefore, to determine the width of a proposed label, the text of the label is part of the query: (`xlabelwidth;"testlabel") of `g It is also possible to determine the widths of several labels at once, either as the rows of a character matrix or as the elements of a nested vector of character vectors: (`xlabelwidth;3 5"one two three") of `g or (`xlabelwidth;("one";"two";"three")) of `g Now that we have specified the y-axis labels and can determine their widths, we can easily create a nice effect for these labels: `g has (`ylabeljustify;`top) `g has (`ymajorticksize;/0(`ylabelwidth;labels) of `g) `g has (`ylabeljustify;`bottom) 2h. Alternate Axes The last two graph components have to do with arranging traces with different scales on the same graph. Neither of these components appear in the default form of a graph. The components are the alternate x-axis and the alternate y-axis. We begin by demonstating how these components can be made to appear and disappear. The default axis configuration consisting of an x-axis on the bottom and a y-axis on the left can be specified as follows: `g has (`axis;`std) It is also possible to have a alternate x-xaxis at the top of the graph and an alternate y-axis to the right. In fact, any or all of these four can be used, or none. For example: `g has (`axis;`box) All four axes `g has (`axis;`xYy) Three axes; the alternate x-axis is missing. Instead of `xYy, as in the last example, any of `xyY, `Yxy, `xy, `YX, etc. can can be used, and the axis designators (x, y, X, Y) can appear in any order. `g has (`axis;`) No axes. There are also interesting effects when just the rules for certain axes are used. For example: `g has (`axis;`std) Standard x-axis and y-axis. `g has (`rule;`XY) Include rules on the top and right. or `g has (`axis;`) No axes. `g has (`rule;`box) Enclosing box made up of axis rules. In these examples the alternate axes have the same scales as the corresponding default axes, but in practice they are most useful when they have different scales. This is because it is often useful for traces with values in different scales to appear on the same graph: for example, two traces of bond prices and another of their spreads, where the prices are plotted on the y-axis and the spreads on the alternate y-axis. $off Exit from A+ Press F4 to start A+ again, then move the cursor back to the tutorial buffer, on the next line. $load s p198.8 99.6 101.3 99.1 100.7 p2101.8 101.2 99.9 100.5 99.6 sp1-p2 g`p1 `p2 `s show `g is `graph `p2 has (`linecolor;`yellow) `g has (`xs`ys;(300;200)) This may have no effect, i.e., this may be the default size. You can see that the two price traces are clustered around 100 and the spread is clustered around 0, which is to be expected. When they are all plotted on the same scale, the graph has very poor resolution. Even worse, it does not make sense to plot them on the same scale. The spread should be plotted on a separate graph, or on a separate scale on the same graph. The alternate y-axis can be used for this purpose, as follows: `s has (`yaxis;`Y) Setting the `yaxis attribute for a trace set to be the alternate y-axis modifies the graph so that the trace set is plotted on a second, independent y-axis appearing on the right of the plot area. Note that removing the spread trace set from those to be plotted on the left y-axis enabled that axis to be rescaled. The default value for the `yaxis attribute is `y, which causes the trace set to be plotted on the original left y-axis. `s has (`yaxis;`y) `s has (`yaxis;`Y) Note that specifying `yaxis to be the alternate y-axis caused that axis to appear. The automatic appearance of the alternate y-axis is due to the setting of the `axis attribute for g, which is `std, the default. For any other setting, the traces will be rescaled but alternate axes will not appear automatically. `s has (`yaxis;`y) `g has (`axis;`xy) The graph looks the same as the `std setting. `s has (`yaxis;`Y) Rescale the traces, but no alternate y-axis. `s has (`yaxis;`y) `g has (`axis;`std) `s has (`yaxis;`Y) Rescale the traces,and get alternate y-axis. The `std value for the axis attribute can be said to be passive, however. Setting axis to `std does not cause the graph to be redrawn: `g has (`axis;`xy) Active: removes the alternate y-axis. `s has (`yaxis;`y) `s has (`yaxis;`Y) Rescale the traces, but no alternate y-axis. `g has (`axis;`std) Passive: still no alternate y-axis. `p2 has (`linecolor;`yellow) Forced redrawing shows the axis. Grid lines can drawn for either the y-axis or the alternate y-axis, but not both: `g has (`grid;`y) `g has (`grid;`Y) `g has (`grid;`Yy) `g has (`grid;`yY) All attributes for the alternate y-axis are the counterparts of y-axis attributes, and therefore are not illustrated here. They are all listed at the beginning of the tutorial. The x-axis can be controlled in the same was as the y-axis. Again, we content ourselves with the listing of the attributes at the beginning of the tutorial, except to note these combined forms: `g has (`grid;`xy) `g has (`grid;`xY) `g has (`grid;`Xy) Accepted, but no vertical grid lines at `g has (`grid;`XY) this time, because no alternate x-axis. `g has (`grid;`none) 2h. Zero Axes An additional one or two axes can be included on a graph, each passing through 0 on the appropriate axis. The values of the zero attribute are `none, `x, `X, `y, `Y, `xy, `xY, `Xy, and `XY: `g has (`zero;`xY) The width, color, and style of these axes can be controlled: `g has (`zerowidth;5) `g has (`zerofg;`seagreen) `g has (`zerostyle;`dash3) The values for width are 0 through 10. Those for style are `dot1 through `dot5, `dotdash1 through `dotdash5, `dash1 through `dash5, and `solid. `g has (`zero;`none) 3. Trace Styles So far we have dealt only with graphs composed of line segments. In this section the other graph styles available will be illustrated. We will use the same data as earlier on. $off Exit from A+ Press F4 to start A+ again, then move the cursor back to the tutorial buffer, on the next line. $load s x0 "/usr/local/aplus-fsf-4.22/doc/tutorials/graphs/graph_data.m"; We can restrict our attention to a single day. x50x yx[;0 1] g`y show `g is `graph `g has (`xs`ys;(800;300)) `g has (`xlabelout;`hrmin24) `g has (`ylabelout;`32nd) The default graph style is `line. The first set of variations in style are scatter, line-scatter, and bar chart: `y has (`style;`scatter) `y has (`style;`linescatter) `ls for short is accepted `y has (`style;`step) `y has (`style;`stepscatter) `ss for short is accepted `y has (`style;`bar) Just as you saw for `line, if the trace set has more than two columns then more than one trace is drawn. For example: yx[;0 1 2] There are now two visible bar graphs, colored the same as if they were line or scatter plots. `y has (`style;`line) `y has (`style;`bar) However, in the case of bar graphs, these colors are default fill colors, not default line colors. We can set the fill colors: `y has (`fillcolor;`yellow `pink) Note that the legend samples for the two traces appear to be quite different from the traces themselves, in that fairly prominent red and green borders appear in the legend, whereas the borders in the traces, if they appear at all, may be narrow and faint. We can bring out the borders in the traces by limiting the graph to fewer points. y5y The borders should be visible now. They have the same line color characteristic that line graphs have: `y has (`fillcolor;`red `green) `y has (`linecolor;`yellow `pink) Neither of these settings may be easy to see except in the legend, but they still hold if we change the style of the graph: `y has (`style;`scatter) Note that the fillcolor setting is used for the symbols in a scatter plot; in a linescatter plot, the linecolor settings apply to the line segments and the fillcolor settings apply to the symbols. `y has (`style;`linescatter) The symbols that appear in scatter and linescatter traces can be any of the values shown in the following statements: `y has (`symbol;`square `squarefilled) `y has (`symbol;`circle `circlefilled) `y has (`symbol;`diamond `diamondfilled) `y has (`symbol;`cross `xsym) `y has (`symbol;`triangle `trianglefilled) `y has (`symbol;`star) If too few, used cyclically. The size of the symbols (in pixels) can be specified: `y has (`symbolsize;50) `y has (`symbolsize;10) The symbol can also be set to any character vector or symbol: `y has (`symbol;"Vertex") `y has (`symbol;`Open`High) This is where the font attribute of the trace set comes into play. `y has (`font;"Courier50") This may take a moment to do. `y has (`symbol;`cross`circle) Let's return to the bar graphs: `y has (`style;`bar) The border in a bar graph is only 1 pixel thick, and the thickness cannot be changed. In a graph with many bars, the border may even be eliminated: yx[;0 1] No borders y5y Borders present One last point about these trace styles. The bars and their borders in a bar chart can be individually colored using the `gradient attribute, which cycles through the specified colors, and if none were specified (i.e., a null specification) then through the colors in s.FILLCOLORS and s.LINECOLORS: `y has (`gradient;1) `y has (`fillcolor;) `y has (`linecolor;) (The borders do not show now because the default values of s.FILLCOLORS and s.LINECOLORS are the same.) The gradient attribute applies to scatter plots as well: `y has (`style;`scatter) (Of course, bars and symbols can be colored individually by making the fillcolor and linecolor attributes of the trace set functional; then the colors can be related to the data values. See "Functional Attributes" in the A+ Reference Manual). The remaining graph styles to be illustrated with this data take advantage of the full range of high, low, open, and close information in the data. We will stay with the bar chart for the moment: `y has (`style;`bar) `y has (`gradient;0) y5x `y has (`fillcolor;`red `blue `white `green) You should see four bar chart traces. The first, in red and appearing on the left in each group, is the open for time period. The second is the high and is in blue, the third is the low and is in white, and the fourth is the close and is in green. These four traces can be combined in one high-low-open-close chart: `y has (`linestyle;`solid) `y has (`linecolor;`red) `y has (`style;`ohlc) Each line extends from the low to the high and has ticks pointing left at the opening and right at the close. This style often looks better with wider lines: `y has (`linewidth;3) Note that the line width also applies to the length of the open and close tick marks on the vertical line segments. The other style that uses the complete high, low, open, and close data is candlestick. `y has (`style;`candle) Again, each one extends from low to high, but the range between open and close is indicated by a box, the candle (the rest being the wick). Since there is only one line color, if the close exceeds the open, the candle is hollow; otherwise it is filled. The fill color can be specified, but using the `linecolor attribute instead of `fillcolor: `y has (`linecolor;`red `pink `white `green) As you can see, the first color, red, is the color of the fill when the open exceeds the close, the second is the color of the vertical line segments (the wicks), the third is the border color of the filled areas, and the fourth is the color of the fill when the open is less than the close. Because the line color attribute is responsible for all color variations, it is easy to switch meaningfully among graph types. `y has (`style;`ohlc) `y has (`style;`scatter `line `linescatter `bar) When the value of `style has more than one element, it must be restricted to styles that require only one y-coordinate, i.e., one column of the trace-set matrix. If fewer than four values are supplied for these attributes, they are used cyclically. If we then set two styles on the current graph: `y has (`style;`line `bar) we see that the first and third traces are line graphs, while the second and fourth are bar graphs. Finally, we have high-low, high-low-close, and close graphs. High-low graphs naturally use three-column matrices, high-low-close four-column, and close graphs two-column. These styles can be applied to the current five-column y, however: the high-low graph will use columns 0, 2, and 3; the high-low-close graph will use columns 0, 2, 3, and 4; and the close graph will use columns 0 and 4. `y has (`style;`highlow) `hl is accepted for short `y has (`style;`highlowc) `hlc is accepted for short `y has (`style;`close) `c is accepted for short In the case of a high-low graph, the data y can also have four columns, in which case the first three are used as the x-coordinates, highs, and lows. For close graphs the data can also have three or four columns, and the first and last column are used in each case. It is often useful in complicated graphs to be able to remove some traces at certain points in an application, and then later put them back. This can accomplished by setting their style to `none, or simply ` for short. `y has (`style;`scatter `line `linescatter `bar) `y has (`style;`scatter `line `none `bar) `y has (`style;`scatter `line `linescatter `) Finally, there is a style for drawing arbitrary line segments, and two other styles related to filling in areas, and for those we will use different traces. $off Exit from A+ Press F4 to start A+ again, then move the cursor back to the tutorial buffer, on the next line. $load s There are times when you want a trace made of disconnected line segments. This can be done when the number of line segments is small by using separate traces, but even then the set of lines cannot be moved or copied as a group. The segment style solves this problem. The argument must be a two-column matrix of coordinate points. The points are grouped in pairs to form line segments: the first two rows form the first segment, the second two rows the next segment, and so on. For example: x10 20 0 1 1 0 1 1 2 0 2 1 3 0 3 1 4 0 4 1 5 x 5 2 2x Show the segments even better. g`x show `g is `graph In this view `x is an ordinary line trace. But: `x has (`style;`segment) Moving on to the styles that fill in areas: x(10)*2 `x has (`style;`fill) The fill style connects the first and last points of a trace and then fills in the resulting closed polygon with the fillcolor. `x has (`fillcolor;`blue) You should now be able to distinguish the fillcolor from the linecolor border, but even so, for this example we will set: `x has (`linecolor;`white) There is a complement to this graph, obtained by filling in underneath the curve: `x has (`style;`area) Both areas can be put on one graph. `x has (`style;`line) x(#x),x~x `x has (`style;`fill `area) `x has (`fillcolor;`red `blue) Now give both traces the `fill style: `x has (`style;`fill) Since both traces have the same values, only one shows in the graph. This is not true, however, if they are both `area graphs: `x has (`style;`area) Area graphs are cumulative; the top of the red graph actually represents the trace x[;1] plus the trace x[;2]. We can see this by making a third trace which is this sum, and displaying it as a `line graph by default. It will lie along the top of the red area: yx[;0],@0 x[;1]+x[;2] gg,`y If we made this separate trace set an area graph, it would be cumulative also: `y has (`style;`area) `y has (`style;`line) A variation of the area graph is the stack graph, which is a stacked bar chart: `x has (`style;`stack) 3a. Text Traces Some of the traces on a graph can be textual, and thereby used to annotate various aspects of a graph. $off Exit from A+ Press F4 to start A+ again, then move the cursor back to the tutorial buffer, on the next line. $load s x0 "/usr/local/aplus-fsf-4.22/doc/tutorials/graphs/graph_data.m"; yx[;0 1] g`y show `g is `graph `g has (`xs`ys;(800;300)) `g has (`xlabelout;`day7) `g has (`ylabelout;`32nd) All trace sets have titles, but only those titles associated with certain trace sets are visible: namely, trace sets whose style is `text and which have only one coordinate point. (Actually, although it would normally be pointless, the trace set can contain more than one trace and points can be added -- and ignored by A+ -- after the title is displayed.) For example: z1 2719900000 107.3 gg,`z `z has (`style;`text) Note that a text trace does not appear in the legend. The default title of a trace set is its name, and you should now see "z" on the graph. We can set the title to the name of the contract with the data y: `z has (`title;`Contract_JYU2) `z has (`title;"Contract: JYU2") The appearance of titles can be modified by specifying their font and color: `z has (`titlefont;"Helvetica-Bold-20") `z has (`titlefg;`yellow) The value of z, which is the coordinate of the title, marks the lower left corner of the text. 4. Graph Attributes The attributes illustrated here are the background color of a graph, the coordinate window, and margins. We continue with the current example. The color midnight blue is commonly used for the background color in graphics packages: `g has (`bg;`midnightblue) Now, however, the axes and legend must be recolored in order to be visible. The foreground color fg applies to all axes, axis labels, legend titles, and legend border whose colors have not been explicitly set. `g has (`fg;`white) Another interesting background color is: `g has (`bg;`green4) `g has (`fg;`black) The color name green, and many others (see the A+ Reference Manual) can be modified with the digits 1 through 4, indicating the degree of grayness in the color. green4 is the most gray of the four, and muted colors are best for graph backgrounds. `g has (`bg;`green3) `g has (`bg;`green2) `g has (`bg;`green1) `g has (`bg;`green4) `g has (`fg;`white) The margins of the area consisting of the plot area, axes and labels, and axis titles can be controlled; their values are in percentages, i.e., integers between 0 and 100, or nonnegative fractions less than 1. First put axis titles on the graph: `g has (`xtitle;"x-axis title") `g has (`ytitle;"y-axis title") `g has (`ytitlestyle;`ver) `g has (`left;20) `g has (`left;0) `g has (`right;0.2) `g has (`right;0) `g has (`bottom;20) `g has (`bottom;0) `g has (`top;0.2) `g has (`top;0) By default, the extreme values of traces touch the boundaries of plot areas; however, there is a margin around the plot area that can be specified, in percentages or fractions. For example: `g has (`xleft;5) `g has (`xright;0.05) `g has (`ybottom;5) `g has (`ytop;0.05) Note that the plot area for traces whose scales are the alternate axes can be specified separately using `Xleft, `Xright, `Ybottom, and `Ytop. The coordinate window can also be specified. This is particularly useful when lining up traces on the alternate y-axis with those on the y-axis; having more direct control, in terms of data, over the margins to accommodate new data. The lower left corner has coordinates (`xmin,`ymin) and the upper right corner has coordinates (`xmax,`ymax). (/y),/y xmin, ymin, xmax, ymax. 719746439 106.59 720372715 107.54 The output is reproduced here for convenience. These values define the default coordinate window. If we set the window to these values, the trace will once again fit tightly in the window. `g has (`rule;`box) `g has (`xmin `ymin `xmax `ymax;(719746439;106.59;720372715;107.54)) Now, move the mouse pointer to the graph and press any one of the arrow keys. As you see, the graph window moves over the graph. (If you click the key too quickly and the window keeps moving, just press any key to stop it.) This is particularly useful for time-series data. The window can be set to show only the most important part of the series, while the user can still see the rest by using the arrow keys. If only `xmin and `xmax have been set, then only horizontal motion is possible, and if only `ymin and `ymax have been set, then only vertical motion is possible. 5. User Interactions A+ graphics provides a rich set of user interactions for customizing the display, editing the traces (and thereby the data), and examining the details of the traces. $off Exit from A+ Press F4 to start A+ again, then move the cursor back to the tutorial buffer, on the next line. $load s x0 "/usr/local/aplus-fsf-4.22/doc/tutorials/graphs/graph_data.m"; yx g`y `g is `graph `g has (`xs`ys;(800;300)) `g has (`xlabelout;`hrminsec) `g has (`xsublabelout;`mdy_u) `g has (`ylabelout;`32nd) z1 2719900000 107.3 gg,`z `z has (`title;"Contract: JYU2") `z has (`style;`text) show `g 5a. Zooming In the current example, the useful data is in clusters which take up a very small total area. We can use zooming to look at the details of one of these clusters. Pick one and imagine a box around it. Move the pointer to a corner of that imaginary box and press and hold the left button. As you move the pointer a zoom box will appear, anchored to the spot where the pointer was when the button was pressed, and attached to the moving pointer. Move the pointer to a spot where the zoom box encloses a cluster of data (or almost does) and release the mouse button. The graph will be redrawn for the data within the zoom box only. In this example there is no need to zoom further because the detail of the cluster you enlarged should be apparent. When there are many points, however, you may have to zoom several times to see all the details. Or you may simply zoom again to neaten up the view, perhaps for printing. While in the zoomed state you may want to look at the details of another data cluster. One way to do this is to "unzoom" and then zoom again on the new cluster. Another way is provided, however. While zoomed, the graph window acts like a view window that can be moved over the original graph using the arrow keys. Try it. To "unzoom," i.e., to get back to the original graph, put the pointer on the graph and double-click the left button. If you start the zooming process and change your mind while manipulating the zoom box, simply move the pointer near the anchor point or outside the graph object entirely and release the button. 5b. Vertical Cursor and Cross Hairs Zooming is only one way to examine the finer structure in a graph. There are also vertical line and cross hair scans. Put the pointer on the graph, and then press and hold the middle button. You will see three new things: a vertical line running through the pointer; a modified legend box that now displays y-coordinate values, in addition to trace identifiers and trace segments; and a new box (next to the pointer) that displays the x-coordinate. As the pointer moves and the vertical line sweeps across the graph, the line passes over x-coordinates for which there are data values. As this happens the values in the boxes change to the corresponding x-coordinate and y-coordinate values. When the pointer is in an area outside the range of the x-values, the displayed x-values vary continuously and y-values are not shown. You can display this variant of the legend even when you are not in the vertical cursor mode. The displayed values in the legend will be those in the last elements or rows of all the trace sets. `g has (`legendstyle;`lastvalue) If you press the Control key and then press and hold the middle button, you will see a somewhat different display: there are cross hairs instead of a vertical line cursor; the legend is unmodified; both the x- and y-coordinates are displayed in a new box, near the intersection of the cross hairs. As the pointer moves, the intersection point of the cross-hairs cursor moves with it and the changing coordinates are displayed in the box. Both coordinates vary continuously in the appropriate scale units as the cursor moves. You can release the Control key once the cross hairs appear. If there are alternate axes in use, then at any time that the vertical or cross-hairs cursor is active, press the right button (in addition to the middle) to see the alternate coordinates displayed in the moving box as the cursor moves. 5c. Referencing a Graph, Line Trace, or Trace Point Both a graph and its traces have refer events that can have active callback functions. For example, define the following generic callback function, which simply prints out the value of its static data argument, the trace set (if any) associated with the event, and the (x-axis, y-axis) coordinates of the pointer when certain events happen: gcbf{s;c;v}:(s;`selected of c,v;`coordinate of `g) (Use "`Coordinate of `g" when it is appropriate to query the coordinate values of the alternate axes.) Set the refer attribute on the graph as follows: `g has (`refer;(gcbf;`refer)) Now put the mouse pointer anywhere within the window border of the graph and press the left mouse button. You will see `refer displayed in your A+ session, showing that the refer event callback function was called, together with the coordinates of the pointer position when the refer attribute happened. In practice, the callback function would be defined to do something meaningful. A refer event can occur on a trace if its style is line, the trace is the only one in its trace set, the trace set has two columns, meaning that the x-coordinates are explicitly specified, and when the mouse pointer is on a line segment connecting two data points, you double-click the left mouse button. But first the trace must be selectable: yx[;0 1] `y has (`selectable;1) `y has (`refer;(gcbf;`refertrace)) Now put the mouse pointer anywhere on a line segment and double-click the left mouse button. You will see `refertrace displayed in your A+ session when you have successfully selected the trace; you will also see that the pointer is now a red arrow when it is near the selected trace and cross hairs away from it. Note that a new `refer appears just above the `refertrace in your A+ session, because a refer event was caused by the first click of the double click. To revert to the unselected state, move the pointer onto the graph but outside that object, and double-click the left button. Finally, a referpoint event occurs when the mouse pointer is on a trace point and the left mouse button is pressed: yx `y has (`referpoint;(gcbf;`referpoint)) The selected attribute of the trace will hold the (row index, column index) of the referenced point. Put the mouse pointer on a trace point and press the left mouse button. Unlike refer events on traces, referpoint events occur no matter how many traces there are in a trace set, and no matter what the trace style. For example, set: `y has (`style;`ohlc) and zoom the graph until you see distinct vertical segments. Put the mouse pointer on one of the segments and and press the left mouse button to get a referpoint event. To get back to where we were, move the mouse pointer off the traces and double-click the left mouse button to undo the zooming. Then yx[;0 1] `y has (`style;`line) 5d. Selecting the Legend or a Text Trace. Before a text trace can be selected, it must be made selectable: `z has (`selectable;1) To select either the legend or a text trace, move the pointer onto it and double-click the left button. The legend or text trace will then be displayed with its background and foreground (i.e., text) colors reversed. To revert to the unselected state, move the pointer onto the graph but outside that object, and double-click the left button. A refer event does not occur when the legend is selected. Try selecting the legend and text trace and reverting to the unselected state. 5e. Repositioning the Legend and Traces It is often useful to be able to reposition a legend or text annotation that is covering an important part of a graph. There are also important instances of repositioning numeric traces, such as trendlines. To reposition an object, first select it and, with the pointer on the object, press the left button and hold it. As you move the pointer, either the object or an outline of it moves with the pointer. When you release the left button, the object will stay in its last position. Note that for any trace to be moved, it must be selectable; that is, its selectable attribute must have the value 1. For numeric traces, only a line trace that is the only trace in its trace set can be selected, and therefore only such a numeric trace can be moved. yx[;0 1] Try repositioning the legend and the traces. Note that when a trace is moved, the value of the corresponding variable changes accordingly. 5f. Copying and Deleting Trace Sets To copy a trace set, first select it, then put the pointer on it, and press and hold the Shift key and then the left mouse button. Move the pointer in order to position the copy; either the trace or an outline of it will move with the pointer. When the left button is released, a copy of the trace will appear at the last position of the pointer. (You can then release the Shift key.) If you look at the graph variable g, you will see that it now has a new element, in addition to `y and `z and any elements from previous trace copies. Execute the following to see the new element: g A+ has created a new trace set variable to accommodate the copied text trace, and chosen its name to be the first one available from a list that begins `a, `b, `c, ... . The new element of g is the symbol form of that name. To delete a trace, first activate the default delete behavior as follows: `g has (`delete;1) Now select a trace and press the Meta-Delete key (on an IBM keyboard, Alt-Delete). The trace will disappear. It has been deleted and its variable removed from g. As with repositioning, a trace must be selectable to copy or delete it. 5g. Editing and Creating Text Traces Before we begin this section, restore the graph as follows: yx[;0 1] g`y`z You can edit a text trace on the screen. Simply move the pointer onto the text, hold down the Meta (diamond) key (Alt on IBM keyboards), and press the middle mouse button. An edit window will appear around the text and you can now delete and insert characters. Press the Return key when editing is complete. If you then examine the title of the text trace you will see the modified text. Try editing the text trace in the current example and then check: `title of `z We can monitor the editing of text traces: `z has (`textactivate;(gcbf;`text_activate)) Edit the text again; when you press Return at the end of the editing process the callback function is executed. If the pointer is on the graph but not on the text of a text trace when the Meta key and middle button are pressed, an empty edit box will appear. The text entered in this box will be the title of a new text trace; the data of the new trace will be a matrix with shape 1 2 holding the user coordinates of the pointer location when the edit box was initialized. If you change your mind at any time while editing or creating a text trace, simply press the Esc key to abort the editing and restore the previous status. Try bringing up the edit box for a new text trace and entering some text. Press the Return key when entry is done. Then enter g Just as when copying text traces, you will find a new name (symbol) appended to g. Examine the title and data of the new text trace. Text traces created in this way are automatically selectable, and therefore can be moved, copied, and deleted. You can use the mode attribute to initiate the creation of a text trace at the point indicated by the coordinate attribute: `g has (`coordinate;719974911 107.45) `g has (`mode;`addtexttrace) Now enter some text in the new trace, but don't press Return. `g has (`mode;`normal) This setting of mode terminates interactive entry. The third setting is `addtrace, which begins interactive entry of a line trace. A user can terminate an interaction begun by a setting of mode, and an entry initiated by the user can be terminated by a setting of mode. You also have control over the behavior when users add, copy, and delete text traces. For example, using the generic callback function defined above we can monitor the adding and copying of text traces: `g has (`addtexttrace;(gcbf;`add_text_trace)) `g has (`copytexttrace;(gcbf;`copy_text_trace)) Now attempt to copy the text trace on the graph (see "5f. Copying and Deleting Trace Sets"). When the copy sequence is completed, you will see `copy_text_trace appear in your A+ session, indicating that the function gcbf was called, and the coordinates of the pointer at the time the copy event occurred. The copy will not be made, naturally, since the default meaning of the copy sequence has been superseded by the call to gcbf. Of course, you can redefine gcbf to put a copy of the text trace z at the coordinates given by `coordinate of `g. The same behavior occurs when you complete the procedure for creating a new text trace, as described earlier in this section. The default behavior can be restored as follows: `g has (`addtexttrace;) The control of trace deletion is similar, as in: `g has (`delete;(gcbf;`delete)) Now select the text trace and press Meta-Delete. 5h. Modifying and Creating Numeric Traces It is also possible to modify numeric traces. To do this you must place the pointer near a data point, so first zoom in on one of the clusters. Place the pointer on a data point (i.e., a vertex of the graph) and press and hold the right button. Small cross hairs under the pointer and a box containing the x- and y-coordinates of the point should appear and the connecting line segments should change color. As you move the pointer the cross hairs will move up and down vertically, remaining parallel with pointer. Release the button and the graph will be modified to show the data point moved to the location of the cross hairs when the button was released. The value of the trace set variable will have changed accordingly. The `selected attribute of the trace will hold the (row index, column index) pair of the moved point. Try modifying various points of the graph and examine the changed values of the trace set variable. There are two attributes associated with modifying numeric traces on the screen. As you may have noticed, it is not necessary to place the pointer exactly on the data point to be moved. It is only necessary to get close to the data point, and the required closeness can be specified: `g has (`selectdistance;50) The default value for this attribute is 10, and 50 is a bit large, but you can now see quite easily the general behavior of the data point selection algorithm. In effect, an imaginary region based on the value of this attribute is placed around the data point, and if the pointer falls in that region, the data point is selected. Experiment with selecting data points with this large value of the selectdistance attribute. Secondly, the contraint that only the y-coordinate is modified, which is useful for avoiding small, unwanted changes is the x-coordinates, is an attribute value: `movelimit of `y < `x This is the default If this attribute is set to `y, then only the x-coordinate can be modified, and if it is set to `none then both coordinates can be modified. The default is `x. Note that this attribute is effective for two-column trace sets only; in all other trace sets, only the y-coordinate can be modified, because either there are no explicit x-coordinates to be modified or each x-coordinate is paired with several y-coordinates and moving it would affect several points. Line traces can created on the screen. Place the mouse pointer on the graph, press and hold the Control key, and then press and hold the left mouse button. As you move the mouse pointer a line will appear with one end anchored at the spot where you first pressed the left mouse button, and the other attached to the pointer. Release the mouse button and the line segment will become fixed, with small knobs at the two ends. You can rotate the line segment and change its length by putting the mouse pointer on either knob, pressing and holding the left mouse button, and moving the knob. You can reposition it in a parallel fashion by putting the pointer on the line away from the knobs, pressing and holding the left mouse button, and moving the line. You can make more line segments by putting the mouse pointer on the knob at either end, pressing and holding the the Shift key and then the left mouse button, and then moving the pointer. Release the mouse button to get a new line segment. (Once the line segment connected to the pointer appears, the Shift key can be released.) Double-click the left mouse button to fix the line segments as a new trace. If at any time you change your mind about creating a new line trace, press the Esc key. Or, if you change your mind about adding a new line segment to a trace you are creating, but are already in the process of doing so, move the pointer so the ends of that line segment are close together, and release the button. Line traces created in this way are automatically selectable, and therefore can be moved, copied, and deleted. As with text traces, the programmer has control over how users add, copy, and delete line traces. For example, using the generic callback function defined above, we can monitor the adding and copying of line traces: `g has (`addtrace;(gcbf;`add_line_trace)) `g has (`copytrace;(gcbf;`copy_line_trace)) Deleting traces is the same as for text traces. As with text traces, in practice the callback function would be defined to carry out some action reasonable for the application at hand. 6. Monitoring Performance It may be necessary to improve the performance of your application by improving its interface to graphics. Many actions cause a graph to be completely redrawn, and some of those redrawings may be unnecessary. A different sequence of actions may reduce the amount of redrawing, Also, if the last point in a trace is modified only that modification should take place on the graph, i.e., there should not be a complete redrawing. The s.QUIET variable is a tool for monitoring performance. If it is set to 0 (the default), then whenever the graph is redrawn, updated, or printed, an A+ comment to that effect appears in the A+ session log. s.QUIET can have any of four values and four corresponding sets of messages are displayed by the screen management system: -1: None. 2: Severe errors. 1: Moderate and severe errors. 0: Information, warnings, and moderate and severe errors. Restricting the messages to the ones you need under the particular execution circumstances can greatly reduce clutter in the A+ session log. You have seen the information messages that are displayed. We will now show the error messages. We start fresh. $off Exit from A+ Press F4 to start A+ again, then move the cursor back to the tutorial buffer, on the next line. $load s y98+0.01+?20100 g`y `g is `slot Since g is not a slotfiller, this attempted binding is a severe error, whose level is recognizable by the two exclamation points. `g is `graph `g has (`unknownattribute;0) Since there is no such attribute, this attempted setting is a moderate error, whose level is recognizable by the single exclamation point. Back to performance. Now we will show the graph and then set some attributes and adjust a data point. After each action, you should see an information message, redraw: show `g `g has (`ylabelout;`float) `y has (`style;`scatter) y[1+#y]y[1+#y]+0.01 One way to reduce the number of redrawings is to set attributes before showing the graph. For example: free `g Now define g to be a graph, but do not show it: `g is `graph Set the two attributes that were set above and adjust a data point again: `g has (`ylabelout;`float) `y has (`style;`scatter) y[1+#y]y[1+#y]+0.01 Now show the graph: show `g In this sequence the graph is drawn only once, while in the first sequence it was drawn four times. This is better style as well, since the graph will not appear to go through a series of incremental changes to get to its final state. Now let's leave some room to append points to y and accordingly make the width of the graph (attribute xs) 50% larger, to accommodate the longer axis: `g has (`xmax;30; `xs;1.5 >`xs of `g) When there is room for additional points and the append form of assignment is used, then adding points does not cause the entire graph to be redrawn, but only a portion, in an append operation. We will time the first two actions, to show the efficiency of appending over redrawing, even in a simple one-trace graph: time yy,98.3 Not an append assignment; redraw. time y[,]98.4 An append assignment; no redraw. y[,]98.6 98.5 98.8 Likewise. y[,]1298.9 98.8 Run out of space; redraw. aplus-fsf-4.22/src/tutorials/s.tutorials/0000777000265000001440000000000010774512703014214 5aplus-fsf-4.22/src/tutorials/s.tutorials/Makefile.am0000664000265000001440000000165407233310564016171 ## Process this file with automake to produce Makefile.in ############################################################################### ## ## ## Copyright (c) 2001 Morgan Stanley Dean Witter and Co. All rights reserved.## ## See .../src/LICENSE for terms of distribution. ## ## ## ## ## ############################################################################### s_tutorialsdir = $(prefix)/doc/tutorials/s.tutorials s_tutorials_DATA = \ aux_vars.+ \ buttons \ containers \ data \ introduction \ menus \ printing \ s_context_vars \ special_io EXTRA_DIST = \ aux_vars.+ \ buttons \ containers \ data \ introduction \ menus \ printing \ s_context_vars \ special_io aplus-fsf-4.22/src/tutorials/s.tutorials/Makefile.in0000644000265000001440000001563010774512524016203 # Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ ############################################################################### ############################################################################### SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../.. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CXX = @CXX@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ STRIP = @STRIP@ VERSION = @VERSION@ X_INCLUDES = @X_INCLUDES@ X_LIBS = @X_LIBS@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ s_tutorialsdir = $(prefix)/doc/tutorials/s.tutorials s_tutorials_DATA = \ aux_vars.+ \ buttons \ containers \ data \ introduction \ menus \ printing \ s_context_vars \ special_io EXTRA_DIST = \ aux_vars.+ \ buttons \ containers \ data \ introduction \ menus \ printing \ s_context_vars \ special_io subdir = src/tutorials/s.tutorials mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_CLEAN_FILES = DIST_SOURCES = DATA = $(s_tutorials_DATA) DIST_COMMON = Makefile.am Makefile.in all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/tutorials/s.tutorials/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: s_tutorialsDATA_INSTALL = $(INSTALL_DATA) install-s_tutorialsDATA: $(s_tutorials_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(s_tutorialsdir) @list='$(s_tutorials_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(s_tutorialsDATA_INSTALL) $$d$$p $(DESTDIR)$(s_tutorialsdir)/$$f"; \ $(s_tutorialsDATA_INSTALL) $$d$$p $(DESTDIR)$(s_tutorialsdir)/$$f; \ done uninstall-s_tutorialsDATA: @$(NORMAL_UNINSTALL) @list='$(s_tutorials_DATA)'; for p in $$list; do \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " rm -f $(DESTDIR)$(s_tutorialsdir)/$$f"; \ rm -f $(DESTDIR)$(s_tutorialsdir)/$$f; \ done tags: TAGS TAGS: DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = ../../.. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: $(mkinstalldirs) $(DESTDIR)$(s_tutorialsdir) 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_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_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-generic clean-libtool mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-s_tutorialsDATA install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool uninstall-am: uninstall-info-am uninstall-s_tutorialsDATA .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-s_tutorialsDATA \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool uninstall uninstall-am \ uninstall-info-am uninstall-s_tutorialsDATA # 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: aplus-fsf-4.22/src/tutorials/s.tutorials/aux_vars.+0000444000265000001440000000450507232116613016031 Variables and attribute values that there is no need to see in the s tutorials, that would only clutter it or confuse the viewer. s.QUIET1 ld_nlb('Corporate Bond Message';'Discount Note Postings';'DPG Swaps Pricing') ld_nlbld_nlb,('DPG Synthetics';'Lunch Calculator';'MBS Axes';'MUNICIPALS') ld_nlbld_nlb,('Syndicate Offerings';'Treasury Axes';'Yankees/Canadian') ld_clb(`inverse_bid;`inverse;`strips;`strips_bid;`wholeloans_bid;`wholeloans) ld_rlb('NEG-AMORT ARM';'BALLOON') ld_r1lb('Mortgage';'CMO';'US Govt';'ABSY') ld_lo`lb `ld_lo1 `ld_ac ld_lo1`ld_ck `ld_sl ld_ck(`a`b;(0;1)) `ld_ck has (`class;`check;`bg;`white;`title;'';`label;( '912827N57 4.000 01/31/96';'912827N65 5.000 01/31/99')); ld_sl(`Name;,<'2s/5s') `ld_sl has (`class;`slot;`bg;`white;`title;''); ld_ac(`Apply`Cancel;(;)) `ld_ac has (`class;`action;`bg;`white;`title;'';`geometry;2;`C;1); `ld_lo1 has (`class;`layout;`title;''); ld_pg'a1'_fmt(' Acquisitions';' ';' '; 'Flash! Wassail PLC agreed to acquire General Cobble Corp.,'; 'for many millions of dollars.';' ';' ';' '; 'The Chase National Bank has agreed to acquire The Bank of'; 'The Manhattan Company. The new entity will be called Chase'; 'Manhattan Bank.';' ';' ';' ') ld_vph'BT 10/01 13:1',@1'a1'_fmt('4 SCAP Most Actives at 1:00 P.M.'; '4 Nortek Filing -2- Proceeds to Redeem Debt >NTK'; '4 Nasdaq Net Change Percentage Gainers and Losers'; '0 +Transportation Secy In Saudi Arabia To Lobby For Jet Sales'; '4 Amex Issues, 1 pm Net Change Percentage Gainers and Losers'; '1 +*Jewelmasters Qtr Ended July 31 Losses 41c/Shr Vs 36c >JEM'; '5 NYSE Stock Transactions'; '1 +*Empire Co. To Maintain 46% Stake In Wajax [sic] After Buy'; '5 Block: caterpillar Inc. 150,000 Shares At 80 1/2'; '5 CBOE Most Active Call Option Series') ld_vps'a1'_fmt( ' Washington -DJ- Nortek Inc. (NTK) filed to offer up to $190 million of'; 'senior subordinated notes, due 2003.'; ' In a filing with the Securities and Exchange Commission, the company said'; 'proceeds from the offering will be used to redeem outstanding debentures and'; 'notes.'; ' Bear Stearns & Co. Inc. and Chase Securities Inc. are underwriting,'; 'according to the filing.'; ' (END) DOW JONES NEWS 10-01-93'; ' 1:14 PM') ld_names`ld_nlb`ld_clb`ld_rlb`ld_r1lb`ld_lo`ld_lo1`ld_ck`ld_sl ld_namesld_names,`ld_ac`ld_pg`ld_vph`ld_vps s.QUIET0 aplus-fsf-4.22/src/tutorials/s.tutorials/buttons0000644000265000001440000012107210774504457015563 Display Classes for Buttons 1. The Action Display Class 1a. Actions 1a(i). Callbacks; Screen Position Attributes: atsector preset set x y yx 1a(ii). Other Actions Attributes: f1, ..., f12 fkeys selected 1b. Appearance 1b(i). Arrangement of the Buttons Attributes: geometry verify 1b(ii). Size Attributes: C R xs ys yxs 1b(iii). Displayed Characters Attributes: justify label labelfont shelltitle title titlefont 1b(iv). Color Attributes: bg fg labelfg titlefg 1c. Additional Windows 1c(i). Kinds of Windows Attributes: iconic ws Variable: s.WS 1c(ii). Visibility Attributes: followers followertree hide icon icontitle lower raise show 1c(iii). Selection Mouse Pointer Keys: Arrow keys Ctl-Shift-Tab Ctl-Tab Enter Shift-Tab Tab 1d. More about Appearance 1d(i). Changes in Appearance Attributes: hl hlthickness shadowthickness 1d(ii). Other Features Attributes: exit foot head is leftfoot pin resizeable rightfoot 1e. Status and its Preservation 1e(i). Status Attributes: bound class stateself settings 1e(ii). Saving Attribute: script Variable s.WM_SAVE_YOURSELF 2. The Button Display Class Attributes: margins naturalsize 3. The Check Display Class 4. The Radio Display Class --------------------------------------------------- 1. The Action Display Class An object of the action display class is shown as a set of buttons. Each button can trigger some action when it is pressed -- i.e., when the left mouse button is clicked while the pointer is on the button. Only slotfiller variables can be bound to this class. The display has one button for each of the slotfiller's symbolic indices, and these indices are used to label the buttons by default. The slotfiller's values do not appear in the display. A simple example with an immediately obvious action is an object that moves around the screen when its buttons are pressed. First, label the buttons and specify movements by creating the slotfiller: ac(`up `down `left `right;(100 0;100 0;0 100;0 100)) The numbers will be used as increments, in pixels, to the vertical and horizontal positions. Now, after loading the s context, use the is function to bind ac to the action display class and then the show function to display the object on the screen. The is function is dyadic. It takes the variable name, in symbol form, as left argument, and the display class name, which is always in symbol form, as right argument. The show functions is monadic, taking a variable name, in symbol form, as argument; it returns Null. Since is, in addition to displaying some messages, returns its left argument as an explicit result, you can combine these two operations: $load s scrs.SCREEN-34 12 br{w;m}:{w has (`yx;scr-m+`yxs of w);} show `ac is `action; br{`ac;0} You should see an action object on the screen. Click the left mouse button while the pointer is on the object's "up" button. You get a pretty animation but no action, because no callback has been set on ac. 1a. Actions 1a(i). Callbacks; Screen Position Attributes: atsector preset set x y yx Suppose v is the unqualified name of a slotfiller variable bound to the action display class and c is its context, both in symbol form. Then whenever a button is pressed, s makes the reassignment (pc%v)pc%v, where p is the symbolic index corresponding to the button that was pressed. These assignments, since they involve the slotfiller's values, enable those values to be used to select actions. You write a function of the form f{s;d;i;p;c;v} that incorporates the actions you want, and you set the callback f on cv in order to have them triggered. In the callback, s is the static data (if any) you specified when you set the callback and d (the data) is the value to which p is the path; you can use any of them to determine an action. The index i is null. Since we will move ac around the screen as an example of the actions that can be triggered by an object of this class, we first discuss attributes used to position objects. The "x" and "y" attributes specify the horizontal and vertical distances in pixels between the top left corner of an object and the top left corner of either the object that contains it (a layout, for example) or, for top-level objects, the screen. For a top-level object, the default value for each is zero. The of function is used to query attributes. It takes a scalar or vector left argument of attributes, which are always in symbol form, and a variable name, in symbol form, as right argument. In its result, it encloses the value for each element of the left argument: `y`x of `ac The value of the "yx" attribute is simply the vector composed of the y and x attribute values. The has function sets attributes. It takes a variable name, in symbol form, as left argument, and as right argument an association list or slotfiller containing attribute names and values. It returns its left argument as explicit result. Change x and see the new position and the new attribute value: `ac has (`y;0; `x;300) `yx of `ac As stated above, a value selected from ac by a button press is available to a callback function, as its second argument. The of function encloses attribute values in its result, so Disclose or Raze must be used to obtain the attribute values themselves. Define a callback function to adjust the yx attribute by the value selected from ac by the button press, limiting the movement so as to stay well on any screen. Then set the callback on ac: acbfn{s;d;i;p;c;v}:cv has (`yx;0600(`yx of cv)+d) `ac _scb (acbfn;'Just to illustrate') Two alternative methods of setting the callback use the "set" attribute: `ac has (`set;acbfn) `ac has (`set;(acbfn;'Just to illustrate')) If the former is used, the Null will be passed to acbfn as its first argument; if the latter, 'Just to illustrate' will be passed. No matter how the callback is imposed, by set or _scb, the value of the set attribute is the name of the function and the static data (the Null, if no static data was specified): `set of `ac Having entered these statements in an A+ session, you can move the action object around the screen, within the prescribed limits, by pressing its buttons. Try it. There is a "preset" attribute that is similar to set. It can be used to set and query preset callbacks, functions that are called just before a value is changed, rather than just after. Execute pc{s;d;i;p;c;v}:{"Jump!";d} `ac has (`preset;pc) Now move the object around the screen. "Jump!" should appear in the session log, showing that pc is being called. To get rid of this preset callback, use a null function specification. (Null for set would likewise eliminate an ordinary callback.) Enter `ac has (`preset;) Since we have been discussing positioning, we might as well consider the "atsector" attribute now. It is used to move objects around the virtual desktop and to determine where they are. A position on the desktop is specified by a vector of two indices. The following three lines should move ac to sector 1 1 and back. (If you are already in sector 1 1, change the 1 1 to 0 0 in the second statement.). Suppose you are in sector 1 0 (the semicolon in the first line causes the result to be displayed -- see immediate execution display of expression groups in the A+ Reference Manual): ;sector`atsector of `ac `ac has (`atsector;1 1) `ac has (`atsector;sector) If your virtual-desktop window is visible, you can watch ac move around on it as you change the value of the atsector attribute. 1a(ii). Other Actions Attributes: f1, ..., f12 fkeys selected Whenever a button is pressed, the "selected" attribute is set to the symbolic index corresponding to that button. Press the "down" button; then: `selected of `ac You can also set selected to any of the symbolic indices using an A+ statement. Setting it does not cause a callback and an assignment of an illicit value is simply ignored. The domain of the selected attribute depends upon the display class: for an object bound to the array class, for instance, its value is an integer vector consisting of a row and a column index, initially 1 1 to indicate no selection. For any object, you can associate an action with a function key. As an example, define an action similar to the ones we have associated with the buttons of ac: diag{x}:x has (`yx;600(|@0)100+`yx of x) For any one of the twelve function keys, the key can be connected with a function and an argument by a statement such as the following, which uses an association list to specify several attributes at once. A slotfiller can be used instead of an association list, as you will see later. `ac has (`f1;(diag;`ac);`yx;0 0) Now press the F1 key while the mouse pointer is in the ac display and you will see the display move diagonally, with jumps to avoid getting too far. These twelve connections are listed in the "fkeys" attribute, which is for reference only; it cannot be set. Its value is a slotfiller such that the first two of the following three expressions give the same result for each of f1, f2, ... f12. (Recall that we must Disclose or Raze the of result to obtain the attribute value.) `f1 of `ac `f1`fkeys of `ac `fkeys of `ac You may have to move to the Emacs A+ area to page up and see all of the result of the last statement. Then press End and move to the tutorial area. 1b. Appearance 1b(i). Arrangement of the Buttons Attributes: geometry verify The default arrangement of the buttons on the screen is vertical, but you can use the "geometry" attribute to alter it. Try these arrangements: `ac has (`geometry;2); br{`ac;0} `ac has (`geometry;1); br{`ac;0} `ac has (`geometry;`horizontal); br{`ac;0} `ac has (`geometry;`vertical); br{`ac;0} `ac has (`geometry;2 2); br{`ac;0} `ac has (`geometry;1 1 1 1); br{`ac;0} `ac has (`geometry;2); br{`ac;0} `ac has (`geometry;1 1 2); br{`ac;0} -2 is a conventional value for horizontal arrangement, and -1 for vertical. Non-negative numbers indicate how many buttons there are to be in each row and are used repeatedly if necessary. Fancier arrangements are possible using a matrix value for geometry. The matrix partitions the action display. Symbolic indices of the slotfiller indicate the arrangement, with a null symbol signifying an empty section. Alternatively, integers can be used: they must be indices of the symbolic indices in the slotfiller, or -1 signifying an empty section. The order of the buttons need not correspond to the order in the slotfiller variable. Omissions and repetitions are allowed, but the repetitions for any given symbolic or numeric index must form a submatrix. In the following examples, commas and parentheses are used only to make the examples immediately obvious. The first statement avoids all overlap of vertical and horizontal buttons, the second one omits the "right" button, and the third one provides partial overlap: `ac has (`geometry;3 3(` `up `),(` `down `),(`left ` `right)); br{`ac;0} `ac has (`geometry;3 3(` `up `),(` `down `),(`left ` `)); br{`ac;0} `ac has (`geometry;3 4(1 0 0 1),(1 1 1 1),(2 2 3 3)); br{`ac;0} The geometry attribute, like set and unlike f1, is persistent. The free function takes a variable name, in symbol form, as its only argument and, besides displaying a message, returns its argument as an explicit result: free `ac show `ac is `action; br{`ac;0} The buttons are arranged as they were before and they still function as they did, but if you put the pointer in the ac display and press the F1 function key nothing happens. You can also change the order of the buttons by respecifying the underlying variable, unless geometry contains symbolic indices. When you respecify the value of a variable that is bound to a display class, you might inadvertently try to change it to a value that is not allowed for that class. The assignment is refused, either tersely by the interpreter, when the "verify" attribute is 0: `verify of `ac `ac has (`verify;0) ac'No good!' or with an explanation by s, when the verify attribute is 1, the default: `ac has (`verify;1) ac'No good!' (The "a action" in the response is presumably for faster execution.) Be sure to clear the suspension: 1b(ii). Size Attributes: C R xs ys yxs Corresponding to the position attributes there are size attributes: "ys" is the vertical size of the object, in pixels, and "xs" is the horizontal size. The value of "yxs" is the concatenation of the values of ys and xs. Try these statements: `ys`xs of `ac ;size`yxs of `ac `ac has (`yxs;2size); br{`ac;0} `ac has (`yxs;size); br{`ac;0} You may have noticed the asymmetry of the ac display, caused by the unequal lengths of the labels. When the "C" attribute is 1, the columns are required to be of equal width; the default for C is 0. Watch the display of ac become symmetric when you change C to 1: `C of `ac `ac has (`C;1); br{`ac;0} There is a similar attribute "R", also with default 0, that requires the rows to be of equal height when it is 1. Here is an example showing its use. First, load some auxiliary variables that are in a separate file to avoid cluttering the tutorial; they will all have the prefix ld_ so you will know where they came from. _load{'/usr/local/aplus-fsf-4.22/doc/tutorials/s.tutorials/aux_vars.+'}; a(`a`b`c`d`e`f`g`h`i`j`k`l`m;(;;;;;;;;;;;;)) lb('Exit';'Refresh';'Corporate Axes'),ld_nlb `a has (`class`shelltitle`title`label;(`action;'nexus';'';lb)); Note the use of a slotfiller to specify several attributes at once. The shelltitle, title, and label attributes are discussed in the next section, and class in a later section. g` ` `a`a `b`b ` ` ` `,(20`),5ҡ`c`d`e`f`g`h`i`j`k`l`m` `a has (`C;1; `geometry;9 10g; `show;1; `xs;600); br{`a;0} The two empty rows take no space now. Setting R to 1 provides the vertical separation implied by the geometry: `a has (`R;1; `xs;600); br{`a;0} _ex `sector `size `lb `g, free `a 1b(iii). Displayed Characters Attributes: justify label labelfont shelltitle title titlefont The "A+" appearing at the top of the ac display is the default value for the "shelltitle" attribute for a top-level object. To change it, change the value of the shelltitle attribute: `ac has (`shelltitle;'Move') The "ac" below the shelltitle is the default value of the "title" attribute. To change it: `ac has (`title;'') `ac has (`title;' ') `ac has (`title;'Direction') Notice that an empty vector means no title area at all. The symbolic index names appearing on the buttons are, again, the default. They appear when the "label" attribute is null. The label attribute governs what is shown in the label areas. (When there are also value areas, as in the slot class, it has no effect on them.) If its value is a character vector or a single symbol, the same label appears on all buttons: `ac has (`label;'Push') `ac has (`label;'') The buttons can be separately labeled using either a vector of symbols or a nested vector of scalars or vectors: `ac has (`label;`u`d`l`r) `ac has (`label;('';'';'';'')) The label attribute is functional, the function being called once for each button with the path as an argument: f{s;d;i;p;c;v}:p(`left`right`up`down;('l';'r';'u';'d')) `ac has (`label;f) The fonts need not be the default, kaplgallant-19. Try the "titlefont" and "labelfont" attributes: `ac has (`titlefont;'times-19'); br{`ac;0} `ac has (`labelfont;'helvetica-boldoblique-19') The labels are centered in both directions within the buttons, by default. The "justify" attribute is used to modify their positions. Essentially, its argument is one of 'l' 'r' 't' 'b' 'lt' 'lb' 'rt' 'rb' `left `right `top `bottom, and it is cumulative (the first statement below produces no visible effect, since there is no extra vertical space): `ac has (`justify;`bottom) `ac has (`justify;`left) `justify of `ac `ac has (`justify;'r') `justify of `ac In the character form, a period at the beginning of the argument makes it non-cumulative: `ac has (`justify;'.rt') `justify of `ac A .t or .b argument centers the labels horizontally, .r or .l vertically. To restore the positions to centered both ways, set justify to null: `ac has (`justify;) 1b(iv). Color Attributes: bg fg labelfg titlefg There are four attributes that govern the colors in the display. The default values are: `titlefg `labelfg `fg `bg of `ac The foreground attributes, "...fg", refer to text and the "bg" to background. In our example there is no text corresponding to the "fg" attribute. In a member of the array display class it would be the array values (see the Data tutorial); in the slot class it would be the contents of the value areas; and so on. These attributes can be set to whatever colors you want, as in: `ac has (`titlefg;`blue); `ac has (`labelfg;`green); Vectors of colors can also be used for the labels. The colors are used cyclically: `ac has (`labelfg;`blue`brown`green`red); `ac has (`labelfg;`blue `red); `ac has (`fg;`pink); `ac has (`bg;`yellow); The default colors can be restored by giving null values: `ac has (`titlefg `labelfg `fg `bg;(;;;)); 1c. Additional Windows 1c(i). Kinds of Windows Attributes: iconic ws Variable: s.WS A+ can, of course, display more than one window at a time. Produce three more windows, without stopping to make their buttons work. Notice that they all appear originally in the top left corner, the default position: b(`run `stop `cancel;(;;)) c(`yes `no `more;(;;)) d(`load `save;(;)) show `b`c`d is `action br{`b;0 600}; br{`c;0 400}; br{`d;0 200} You might want each of them to be sized according to its labels, the default. Suppose, however, that you want them to be all the same size. Enlarge the smaller ones: `c`d has <(`yxs;>`yxs of `b);br{`d;0 200} Incidentally, the vertical justification that you took on faith can now be demonstrated: `d has (`justify;`bottom); `d has (`justify;); The new windows are popups, as can be seen by their having pins rather than buttons at the top left. (See the s-Context Variables tutorial for a way of changing this default.) It is possible to change them from popups and back again, using the "iconic" attribute, which controls this property: `d has (`iconic;1); `d has (`iconic;0); The s-context variable s.WS contains the name of the "screen workspace", which is always a top-level object, not a popup. (The significance of the screen workspace is discussed in the next section.) The default value of s.WS, before any objects are shown, is the Null. When an object is initially shown and s.WS is null, that object becomes the screen workspace unless you prevent it. When an object is first shown, it is prevented from becoming the screen workspace if the value of its "ws" attribute is 1, and not prevented if ws is 0. If you change the value of s.WS, you name a new screen workspace and you "demote" the old one to a popup: `d has (`shelltitle;`Popup); s.WS`d s.WS`ac `ac has (`shelltitle;`Move); Notice that the value of the shelltitle is treated as related to the screen workspace: when the screen workspace was changed, the ac display was given its variable name as a shelltitle and d was given "A+", the default shelltitle, and the reverse happened when the screen workspace was changed back. The shelltitles that had been set were lost in the process. 1c(ii). Visibility Attributes: followers followertree hide icon icontitle lower raise show The "hide" attribute for a pop-up window, when specified by any value other than 0, removes it entirely from the screen. The "show" attribute, when specified by any value other than 0, restores the display of the window. It can also create the original display of a window sometimes, i.e., be used in place of the show function, as we will soon see. When queried, one of these attributes is always 1 and the other 0, corresponding to the visibility of the window: `d has (`hide;); `hide`show of `d `d has (`show;); `hide`show of `d The hide attribute for a top-level window, when specified by any value other than 0, changes it to an icon, generally at a different location. Change d to top-level and hide it, then change it to be non-iconic and see the icon disappear: `d has (`iconic;1); `d has (`hide;); `d has (`iconic;0); `d has `show; Note the last form: a value need not be given for an action attribute: the value is assumed to be 1 or, what is equivalent, null. Now keep an eye on all the objects: `ac has `hide; `ac has `show; Notice that when ac was changed to an icon, the other three windows vanished. The reason is that they are "followers" of the screen workspace, as indicated by the attribute of that name: `followers of `ac Suppose that you use the followers attribute to make d a follower of c. The new arrangement is reflected in the reference-only attribute "followertree", whose value is a recursive slotfiller. Then when c is hidden, d will be hidden also. Although d is no longer a follower of ac, it will still follow it into hiding because it is a follower of a follower of ac: `c has (`followers;`d); `followertree of `ac `c has `hide; `hide of `d `c has `show; `ac has `hide; You can change the icon image and title, using the "icon" and "icontitle" attributes. The value for the icon attribute must be an m by n bit matrix, with m and n each at most 64: `ac has (`icontitle;'Buttons'); `ac has (`icon;64 641 0 0 0 0); `ac has `show; The other way to change visibility is to put one window in front or in back of another, i.e., have one window obscure another. To put one in front, set its "raise" attribute to anything; to put it in back, set its "lower" attribute to anything. Note that lowering a window places it in back of everything, including the emacs session window, and that the followers attribute is for hiding, not lowering or freeing: `d has (`lower;); `d has `raise; `ac has `lower; `ac has (`raise;0); `raise of `ac Unlike hide and show, raise and lower are pure action attributes: even setting them to 0 causes their normal actions, and no value can be shown for them; the of function disavows them. Now make d a follower of ac again: `d has (`leader;`ac); 1c(iii). Selection Mouse Pointer Keys: Arrows Ctl-Shift-Tab Ctl-Tab Enter Shift-Tab Tab You have already seen that when the f1 attribute is given a non-null value for some object, the mouse pointer must be in the object's window in order for the F1 function key to trigger the specified action. This property of the keys' applying to a particular window is called "keyboard focus". It is signalled by a brightening of the window's border. You can give keyboard focus to any window that is at least partially visible just by moving the pointer into any visible part of it. When one s window has focus, you can move the focus to another by pressing Control-Tab or Control-Shift-Tab. Move the mouse pointer into one of the s windows and press Control-Tab four times. You will see keyboard focus and the pointer move from one window to another. Press Control-Shift-Tab and you will see the keyboard focus traverse the windows in the opposite order. Within a window, you can move the selection from one field to another by pressing Tab or, to go in the opposite order, Shift-Tab. Move the pointer to the ac window and press Tab four times and then Shift-Tab four times. The visible sign of selection is a gold border around the selected button. One significance of selection is that you can press the selected button by pressing the Enter key. (Because the buttons move the ac window, you may have to move the pointer to maintain focus after pressing Enter.) Now move the pointer onto a button of another object, press and hold the left mouse button, then release it and press and hold the Enter key. Do you see a significant difference between the two ways of pressing the displayed button? When you use the left mouse button, the displayed button stays depressed for as long as you hold the mouse button down: the displayed button acts as if it were the mouse button. When you press and hold Enter, however, the usual typamatic action takes place: the displayed button is pressed and released once, and then, after a slight pause, it is rapidly pressed repeatedly until the Enter key is released. Moving selection within a row or column can also be done with the arrow keys. Movement appropriate to the key occurs in a cyclic fashion. Try the up and down arrow keys in the various windows after selecting a button. Notice that two buttons are isolated from the other two in ac as far as these arrow keys are concerned. Then try the left and right arrow keys in the various buttons of ac. 1d. More about Appearance 1d(i). Changes in Appearance Attributes: hl hlthickness shadowthickness Three appearance attributes are related to selection and pressing of buttons. The "hs" attribute controls the color of the selection border; its default value is gold. Execute `d has (`hl;`mediumseagreen) and move the pointer to give focus to d, so that you can see the green border. The "hlthickness" attribute controls the width of the border; its default value is 0, which means the thinnest. Execute `c has (`hlthickness;5); br{`c;0 400} and see how the object is enlarged, to allow for the wider border. Now give focus to c, so that you can see this border. When an action is taken to press a displayed button, the button appears to be physically pressed. The button is darkened; its bottom and right edges are highlighted, instead of its top and left; and its top and left edges are shadowed, instead of its bottom and right. Thickening the edges of the buttons increases their apparent height and emphasizes this apparent action. The thickness is controlled by the value of the "shadowthickness" attribute, which has a default value of 2. Execute `b has (`shadowthickness;6); br{`b;0 600} and see how the object is enlarged, to allow for the thicker edges. Now press one of b's buttons, and notice how the shadow is switched. When an object is placed in a container, giving it a shadowthickness of zero is sometimes useful, so that its buttons do not seem separate from other objects in the container: `b has (`shadowthickness;0) 1d(ii). Other Features Attributes: exit foot head is leftfoot pin resizeable rightfoot In popups, the pin can be used for communication between the viewer and the programmer. For example, the viewer can push the pin in to say that he wants to have the window remain visible or pull it out to indicate that he would like to have the window removed. Likewise, the programmer can show the pin in or out to state his intentions. The viewer changes the pin position by clicking on it with the left mouse button. In an A+ statement, the "pin" attribute is used to set the position. This attribute always reflects the pin position, 1 for in and 0 for out. Try this sequence: `pin of `b`c `b has (`pin;1) Place the mouse pointer on the pin of c and press and release the left mouse button. `pin of `b`c `b has (`pin;0) Click on the pin of c again. The c window vanished, didn't it? The "exit" attribute determines what happens when a viewer attempts to remove an object from the screen. Its default value is 1, which means hide the object. By changing this value to 0, say, you can have nothing happen when the pin is pulled: `d has (`exit;0) `d has (`pin;1) Now click on the pin of d. The pin moves, but nothing else happens. You can push and pull the pin as much as you like and nothing happens. Exit is functional: its value can be a function. It can be set for top-level windows as well as popups. For example: no{x}:"Don't do that to the ",x," window,",sys.getusername{},"!" `b has (`exit;(no;`title of `b)) `ac has (`exit;(no;`title of `ac)) Now push and pull the pin of b. Place the tip of the mouse pointer in the window-manager button of the ac window, press and hold the right mouse button, move the pointer down to "Quit", and release the button. In both instances, the no function is called and the usual behavior does not occur, an admonition appearing instead. If, however, you click on the window-manager button of the ac window or choose "Close" from its menu, the window will be hidden; then double-clicking on its icon will bring it back. Three otherwise unrelated attributes pass along window-manager facilities, and cannot be changed for a window after it has been shown. They are "head", "foot", and "resizeable". None applies to objects that are not top-level or popups, since they relate to window-manager features. The head attribute determines whether a window has a window-manager area at the top; since that area is not removable for top-level objects, head applies only to popups. The foot attribute determines whether there is an area at the bottom for footnotes. The resizeable attribute determines whether the window has resize corners; that is, whether a viewer can resize the window by dragging. These attributes are set between binding and mapping, so this is a good time to mention the "is" attribute. It can contain a function (and, optionally, an argument) that is called immediately after the variable is bound. Its default is null. ed f{x}:(x),' is bound to ',,`class of x `e has (`is;(f;`e)) `e is `action `e has (`resizeable `head `foot;(0;0;1)) show `e; br{`e;0 200} Note that the e display has no panel at the top, so no pin or shelltitle appears; it has a panel at the bottom that becomes lighter when the window has focus (and that can be used for moving with the mouse); and it should have no resize corners -- although it probably does have them, because of a window manager bug, an interaction between resizeable and head that causes only the one that is set later to be obeyed when they are both set to 0. Two footnotes can appear; they are the values of the "leftfoot" and "rightfoot" attributes. Space is not made for them automatically, and they are truncated if there is not enough room: `e has (`leftfoot;'Morgan Stanley') `e has (`xs;150) `e has (`rightfoot;'March 1994') `e has (`xs;250) 1e. Status and its Preservation 1e(i). Status Attributes: bound class stateself settings There are attributes which give you information about objects. Some, like the "bound" and "class" attributes, apply meaningfully to objects that are not bound. The class attribute for an unbound variable, for instance, is its default display class. You cannot set bound directly; it is a reference-only attribute. prometheus'fire' `bound of `e `prometheus `class of `e `prometheus `prometheus has (`class;`command) `bound`class of `prometheus The bound attribute is set to 1 by the is and show functions and by a non-null specification of the class attribute; it is set to 0 by the free function and null specification of class. The class attribute is set by the is function to its right argument; it is set to a default class by the free function, in effect, and, if bound was 0, by show. The "settings" attribute, which is for reference only, can be used to obtain a slotfiller holding, generally speaking, the attributes that have non-default values (except the class attribute) and the values of those attributes. `settings of `e The xs attribute was not included, because its value was not known to be non-default. The attributes can be restricted or extended to certain ones by naming them. The statement above is equivalent to (`settings;) of `e. (`settings;`leftfoot `xs `title) of `e The title attribute is omitted, because its value is the default. Since a specific request was made for xs and its value is not known to be the default, it is included. The "stateself" attribute, which is also for reference only, gives the same information as `settings of, plus the value of the class attribute. The value of stateself will create the object when executed in the presence of the underlying variable with a suitable value. It is an s definition of the object in association-list form: `stateself of `e 1e(ii). Saving Attribute: script Variable: s.WM_SAVE_YOURSELF Function: s.script{} The s.WM_SAVE_YOURSELF variable can hold the name of a function and, optionally, an argument. Its default value is null. When "Save Workspace" or "owplaces" is selected from the OLVWM Utilities Menu, the function named in s.WM_SAVE_YOURSELF, if any, is called, allowing any vital information to be saved or necessary actions to be taken. The s-context niladic function s.script produces a script that will recreate the current screen layout, given the presence of the necessary variables with appropriate values. There may be no need to preserve information about some of the objects. The default value of 1 for the "script" attribute dictates that the s definition of the object appear in that script and a value of 0 dictates that it not appear. Try, for example, `d has (`script;0) s.script{} Now clean up for the next display class: _ex `acbfn `pc `diag `f `no, free `ac `b `c `d `e `prometheus 2. The Button Display Class Attributes: margin naturalsize An object of the button class looks rather like an object of the action class with only one button and no title area. The variable that is bound to it does not contain symbolic indices and values, however, but rather a function array and perhaps data. The function must be monadic or niladic. Specifically, let fn be a monadic function and define b as (fn;data). Then b can be bound to the button class, and whenever the button is pressed, fn{data} will be executed. A second form for defining a button is <{fn}, which is equivalent to (fn;) for monadic functions; when the button is pressed, the expression fn{()} or, for a niladic function, fn{} is executed. Notice that for the button class no callback need be set; the function that is bound is called automatically. As an example, define a button that, when pressed, moves across the screen and jumps back, but don't press it until after you have made the comparison set up below: bf{v}:v has (`x;600|100+`x of v) bu(bf;`bu) show `bu is `button; br{`bu;0} Just for a comparison of their appearances: ac(,`bu;,<1) `ac has (`class;`action; `title;''; `show;1); br{`ac;0 50} _ex free `ac Now you can press the button. There is no title area like the one an action object can have; the title attribute applies to the text on the button (unlike for an action object, which employs the label attribute for text on its buttons). When there are no blanks or other impermissible characters in it, a title or label can be given as a symbol, instead of a character string. The object is not automatically resized for a new title: `bu has (`title;`Move) The "naturalsize" attribute is an action attribute; it cannot be queried. It resizes an object to show it afresh, as if it, with its current text, values, and features, were being initially displayed -- `bu has (`naturalsize;); br{`bu;0} -- except that in an array or matrix or suchlike the same rows and columns might not be shown as originally, as demonstrated in the discussion of naturalsize in the array section of the Data tutorial. The "margin" attribute governs the minimum margin around the title on the button; its default value is 2. It does not affect the button size: `margin of `bu `bu has (`margin;10); `bu has `naturalsize; br{`bu;0} `bu has (`margin;200); `bu has `naturalsize; br{`bu;0} `bu has (`margin;2); `bu has `naturalsize; br{`bu;0} The margin attribute also applies to the margin around the text in an object of the label class. _ex free `bu 3. The Check Display Class An object of the check class is a slotfiller variable with boolean values that are represented by buttons. A button is "on" if the corresponding value is 1 and "off" if it is 0. When a button is on it has a sunken appearance and is the color specified by the fg attribute, and when off it has a raised appearance and is the color specified by the bg attribute. Clicking the left mouse button on a check button toggles it between on and off, and at the same time the corresponding value in the A+ variable is toggled between 1 and 0. Therefore, if a callback function is defined for the slotfiller variable, mouse clicks cause the callback function to be executed, the path argument p being the symbolic index of the changed value. The slot areas that appear in the display and their arrangement can be controlled by the setting of the geometry attribute. This first example is a two-button moving display, in which pressing a button moves the display to the position indicated by its buttons: c(`bottom`right;(0;1)) `c is `check cbf{}:`c has (`yx;5001c) `c has (`show;1;`set;cbf;`yx;0 500) `c has (`fg;`mediumseagreen;`bg;`rosybrown) Try the various button combinations. In the second example, we show one way to set up a check display to allow one or more categories of data to be selected. Actually, the function we define here for the button just lists the selected categories in the session log when it is pressed: ck(`cb`ci`co`ib`i`s`sb`wb`w;(0;0;0;0;0;0;0;0;0)) lb(`cmo_bid;`cmo_inventory;`cmo_oddlot),ld_clb ckfn{}:>(1ck)/`label of `ck `ck has (`class;`check; `set;ckfn; `geometry;9); `ck has (`shelltitle;`CMOView; `title;'CMO Inventory Viewer'); `ck has (`labelfont`titlefont;2<'newcenturyschlbk-roman-16'); `ck has (`label;lb; `show;1; `xs;1140); br{`ck;0} Press some category buttons, adding to and deleting from the set of requests. Observe the list that appears in the A+ session log each time. _ex `lb `cbf `ckfn `bf, free `c `ck 4. The Radio Display Class The radio class is like the check class, except that (1) it has the additional stipulation that one and only one of the values of the boolean-valued slotfiller is 1, (2) its buttons are diamond-shaped, and (3) pressing a button that is off turns it on and causes the button that had been on to be turned off (pressing a button that is on has no effect). When a button that is off is pressed, the value of the underlying variable is changed accordingly. Therefore, if a callback function is defined for that variable, it is called, the path argument p being equal to the symbolic index of the selected button. Note that even though there are two value changes, a callback function associated with the variable of a radio button is called only once, and the path argument of the callback function refers to the value that changed from 0 to 1. The slot areas that appear in the display and their arrangement can be controlled by the setting of the geometry attribute. In our first example, we make the usual moving buttons. Execute the following statements and press various buttons: r(`tl`t`tr`l``r`bl`b`br;(1;0;0;0;0;0;0;0;0)) cbf{}:`r has (`yx;0 250 500[3 3(1r)1]) `r has (`class;`radio; `set;cbf; `geometry;3 3 3; `show;1); In more realistic examples, the radio object might offer a choice among four differently formatted security definition tables and also function as a heading for that table, or it might present a choice of security types for listing portfolio holdings. In our examples, the callback function merely gives (in the session log) a waiter's response: _ex free `r rd(`ms`ba`na`bl;(0;1;0;0)) `rd has (`class;`radio; `geometry;2; `shelltitle;'MBS'; `title;''); `rd has (`label;('BASIC MBS/STRIP';'BASIC ARM'),ld_rlb); cbf{s;d;i;p;c;v}:(>(`label of `rd)[(0rd)p]),'. Good choice.' show `rd has (`set;cbf); br{`rd;0} Now the second example: `rd has (`hide;1;`shelltitle;`PH;`fg;`white;`labelfg;`white;`bg;`black); `rd has (`label;('Corporate';'Municipal'),ld_r1lb); show `rd rd(`co`mu`mo`cm`us`ab;(1;0;0;0;0;0)); br{`rd;0} Notice that you can click on the label or the diamond to press the button. _ex `cbf, free `rd aplus-fsf-4.22/src/tutorials/s.tutorials/containers0000644000265000001440000013000010774504511016210 The Container Display Classes 1. General 2. The Window Display Class 3. The Table Display Class 3a. The Headings for the Fields Attribute: titledefine 3b. Interactions between Settings for Fields and Table Attributes: font protected 3c. Controlling What is Shown Attributes: fields firstfield fixedfields 3d. User Interactions Attributes: field selectedfield selectfield 3e. A Case when Refresh is Needed 4. The Graph Display Class 5. The Layout Display Class 5a. Relations among Objects Attributes: ancestors children descendents familytree leader parent shell state 5b. Binding and Showing of Objects Attributes: mapped newshow reparent reshow 5c. Arrangement of the Children Attributes: at build lockposition position structure vcol vcols vrow vrows X Y YX 5d. Size of the Children Attributes: b h H l locksize r resize t w W 5e. Navigation and Interaction Attributes: acceptfocus focus freeze sensitive tabfrom tablist tabto 6. The Hpane and Vpane Display Classes --------------------------------------------------- 1. General As the name implies, objects of a container display class are used to contain other objects, either to group several of them or to provide features that are not available in the contained object's class. The objects that are contained in a container are called its children. For a variable to be bound to a container class, its value must be an array of symbols and each symbol must be either the symbolic form of the name of a variable or null. 2. The Window Display Class A window contains only one object. The value of a variable that is bound to the window class is the name of a single variable, in symbolic form. An object in a window can be of any display class. Placing an object in a window has the effect of putting scrollbars on the display of that object. You should be sure that you really need at least one scrollbar, because they always appear. If the object is completely shown or has its own scrollbars, the window's scrollbars are inoperative; try them after these statements: $load s scrs.SCREEN-34 12 br{w;m}:{w has (`yx;scr-m+`yxs of w);} a12 2 w1`a1 show `w1 is `window show `a1; br{`w1;0} Try the various scrollbars after each of these statements: a150 2 a1a250 50 It makes no difference whether the scrollbars are needed at the time the window is mapped: w2`a2 show `w2 is `window; br{`w2;0} The window display class is useful in displaying large objects belonging to the non-container classes that never have scrollbars, namely, action, check, label, page, radio, and slot -- and, of no interest in this regard, button. Here is an artificial example, for the most likely class, slot: s(,`char97+(426)773500;`xs of `s; `shelltitle;'window'); br{`w3;0}; free`w1`w2;} Having the horizontal scroll bar, one might be inclined to make it useful: `s has (`geometry;10; `title;'slot'); Can you find the title? The title appears at the middle of the top of the slot and is scrolled with the rest of the slot. Contrast its immobility when both the title and the scrollbars are part of the same object. Notice that the shelltitle comes from the window object and the title from the slot. A title is never displayed for an object of the window display class, nor, naturally, a shelltitle for an object contained in any container class. _ex `a1`a2`w1`w2, free `w3`s; 3. The Table Display Class A table is different from other containers, in that all the objects contained in it (its children) are of the tableField class; they are called fields of the table. The fields of the table can be vectors or simple character matrices. An object can be bound to the tableField class only by A+ and only as a child of a table object. The children of a table object, like all objects shown on the screen, must be unique. The display of a table consists of a title area and a value area. The value area has a title bar on top that holds the names of the fields, and the area below the field titles consists of delineated cells, one column for each field. The fields appear on the screen in the same left-to-right order as their symbols appear in the variable that is bound to the table class. The number of elements in the first field completely controls the rows that can be displayed. Examine the following example: var_010 4'blah' var_11+10 var_2150+.01?10100000 var_3:var_2var_1 tb`var_0 `var_1 `var_2 `var_3 `tb is `table; `tb has (`shelltitle;'shelltitle'; `title;'title'; `cols;4); `var_2 `var_3 has <(`out;7.2); show `tb; br{`tb;0} 3a. The Headings for the Fields Attribute: titledefine The title bar text for a field can be changed by using the field's title attribute. For a dependency, there is another alternative. The "titledefine" attribute provides a means of displaying the definition, rather than the name, of the dependency. Its effect becomes visible only when the title attribute is set to null. To see the immediate effect of titledefine, watch the fourth field. Because the last column is too wide to be shown in its entirety and s doesn't like to display partial columns, the fourth column gets blanked out. (Under some circumstances you can see a truncated definition.) We force a redrawing after setting titledefine and title: `var_0 has (`title;'Text'); `var_3 has (`titledefine;1; `title;); `tb has (`firstcol;0; `cols;4); br{`tb;0} The next two statements demonstrate that titledefine does not set the title, but rather that it is consulted when the title is set to null: `var_3 has (`titledefine;0); `var_3 has (`title;); `var_0 has (`title;); 3b. Interactions between Settings for Fields and Table Attributes: font protected The "font" attribute specifies the font in which the value area appears. In the table display class, it can be set for both the fields and the entire table. The setting for the table applies to any fields for which font has not been explicitly set. Notice two things in the following statements. First, when the font is changed for the first field, the space allotted to the field is narrowed, resulting in the truncation of the title; watch out for this if you change a font after showing a table. Second, the font for the table does not affect the first field, whose font has already been specified. `var_0 has (`font;'courier-bold-19'); `tb has (`font;'palatino-19'); `tb has (`firstcol;0; `cols;4;); br{`tb;0} The font attribute is functional. Set it for the third field, overriding the table setting but leaving the other fields alone (you will probably need to scroll down to see a negative value in boldface): f{s;d;i;p;c;v}:if (d<0) 'helvetica-bold-19' else 'helvetica-19' `var_2 has (`font;f); Try to trim the column widths: `var_0`var_1`var_2`var_3 has <(`space;12); `var_0`var_1`var_2`var_3 has <(`font;`kaplgallant; `space;12); `tb has `naturalsize; br{`tb;0} Because the characters are not of fixed width, the results of the space specifications were not what we wanted; after the font change, space was set as intended, and the table could be trimmed to fit. The "protected" attribute tells whether protection is on; it is for reference only. It is useful because protect for a table overrides protect for its fields: `var_1 has (`protect;1); `protected of `var_1 `var_2 < 1 < 0 `tb has (`protect;1); `protected of `var_2 1 `var_1 has (`protect;0); `protected of `var_1 1 3c. Controlling What is Shown Attributes: fields firstfield fixedfields One important feature of tables is the ability to retain certain fields in view while scrolling among others. In a table of bond information, for instance, you might want to have issuer, coupon, and maturity always shown, no matter what other fields were or were not visible. The value of the "fixedfields" attribute is the number of fields on the left that do not participate in horizontal scrolling: `tb has (`fixedfields;1); `tb has (`cols;2; `firstfield;`var_2); Notice the gap; the second field is not shown. Try some horizontal scrolling. The "fields" attribute always has the same value as the cols attribute: setting one for a table sets the other: `fields of `tb `tb has (`fields;3); `cols of `tb The firstcol attribute is affected by fixedfields for tables. It is the first visible field on the left disregarding the fixed fields. The "firstfield" attribute differs in taking the name of a field, in symbol form, rather than a number, but is otherwise the same as firstcol, and setting one for a table sets the other: `firstfield `firstcol of `tb `tb has (`fixedfields;0; `fields;2; `firstfield;`var_1); `firstcol of `tb `tb has (`firstcol;0); `firstfield of `tb 3d. User Interactions Attributes: field selectedfield selectfield In addition to selecting a cell by clicking the left mouse button with the pointer in it, you can select a column by clicking the button with the pointer on a title. When a field title is selected, the selected cell is at the intersection of that field and the currently selected row; if no row is currently selected, the first row (row 0) is used. The value of the "selectedfield" attribute is the identity of the selected cell, as row index and, in symbolic form, field name. This attribute identifies the same cell as does the selected attribute, whose value is its row and column indices. Similarly, the "field" attribute gives the (symbolic) field name of the selected column, which is always the same column that is identified by index number in the col attribute and that is referred to in the selectedfield and selected attributes. Make some selections by clicking on the titles and in the cells, executing the following statement after each selection: `field `selectedfield of `tb A callback is associated with selection of a field, and a function is specified for it using the "selectfield" attribute. Here we use a function that just shows its arguments and the value of the selectedfield attribute: cb{s;c;v}:(s;c;v;`selectedfield of `tb) `tb has (`selectfield;(cb;'field selection')); Select a field or two and see the arguments and the value of selectedfield. Also select a cell or two directly and see that this function is not called. 3e. A Case when Refresh is Needed The "refresh" attribute was introduced in the array section of the data display tutorial. Here is another example of its use. To minimize backing store space requirements, when a substantial amount of data is only potentially displayed it is not always calculated in advance. If its display is requested through the window manager and not A+, it may be necessary to request that A+ refresh the object: albl1000+100; tl`al`bl; show `tl is `table; `tl has (`ys;1750;`x;scr[1]-`xs of `tl); Now use the scrollbar to drag the later part of the table into view. It should be blank. Specifying refresh causes the numbers to be calculated and shown: `tl has `refresh; _ex `cb`f, free `tb`var_0`var_1`var_2`var_3`tl`al`bl; 4. The Graph Display Class The graph display class resembles the table class in that its children are all of one class, graphTrace, and only A+ can bind a variable to that class. Because of its complexity, it is treated in a separate tutorial. As an aside, we might mention that because all the graph features are optional, it is possible to produce pictures using an object of the graph class, as in this simple example: j100+200 t1j(,@0)100 t2j(,@0)975+(1000000-j*2)*.5 t31 220 75 g`t1`t2`t3 `g is `graph; `g has (`title `legend `axis `zero;('';`none;`none;`none)); `g has (`xmin;100;`xmax;100; `ymin;0;`ymax;100); `t1 `t2 has <(`style;`area); `t3 has (`style;`scatter; `symbol;`circlefilled; `symbolsize;50); `t1 has (`linecolor `fillcolor; 2<`cyan2); `t2 has (`linecolor `fillcolor; 2<`cornflowerblue); `t3 has (`linecolor `fillcolor; 2<`yellow); show `g; br{`g;0} The area style fills in down to the axis. Only the order of drawing prevented the cyan from obliterating the blue. The fill style allows fuller control of the area covered, as in this example of three rectangular planes: p14 2 90 10 90 70 0 70 0 10 p3(4 230 10)+ p2(4 230 10)+p1 g`p1`p2`p3; free `t1`t2`t3; `p1`p2`p3 has <(`style;`fill); Reversing the order of the symbols in the definition of g reverses the order of drawing and thereby the obscuration and apparent depth of the planes: g`p3 `p2 `p1; _ex `j`t1`t2`t3, free `g`p1`p2`p3; 5. The Layout Display Class A layout is a container whose children can be of any classes. Almost all of what is said in this section applies also to the hpane and vpane classes, which are essentially just layouts with slider bars. When a child is placed in a layout, the context of its name is assumed to be that of the layout's. There is no need to qualify the child's name unless its context differs from the layout's. 5a. Relations among Objects Attributes: ancestors children descendents familytree leader parent shell state The first seven attributes listed above give information about containment and subordination of objects. All but two are for reference only. Knowing that an object is called the child of its container, you can guess the meanings of most of these attributes. Here is a simple example illustrating their use: abcden3 show `a; br{`a;0 200} l1`b`c; l2`d`e; l`l1`l2; `l`l1`l2 is `layout; show `l; br{`l;0} `children of `l `children of `l2 The "children" attribute is actually not just for reference: `l has (`children;`l1`l2`n); `children of `l l So the children attribute of l changed value and, as had better be the case, the value of l changed. The display, however, did not change. When an object that is not being shown is added to an existing layout, the default is not to show it there automatically. One way to make it appear is to apply the show function to it, before or after it is added to the layout (you will see several other ways later on): show `n; br{`l;0} `descendents of `l `parent of `d `ancestors of `d The "familytree" attribute applies only to containers, since it shows only the object's descendents and not its ancestors: `familytree of `l `familytree of `l2 `familytree of `d The "shell" attribute contains the name of the top-level object that contains the object in question. The "leader" attribute, for top-level objects only, tells what object will be followed into hiding; its default value is the screen workspace. A top-level object can be made its own leader; the canonical value for the leader attribute in this situation is the Null: `shell of `d `leader of `l `l has (`leader;`l) `leader of `l You have already seen the stateself attribute, in the Buttons tutorial. The "state" attribute is similar to it, but recursive. That is, for a container the stateself attribute gives only the definition of the container itself, whereas the state attribute includes the value of the state attribute for each child. When a child appears in a layout definition more than once (to establish the desired geometry), the state for it is given only once, for economy. For tableFields and graphTraces, the class does not appear in the result, to keep it executable. `stateself of `l `state of `l _ex free `l`l1`l2`a`b`c`d`e`n; 5b. Binding and Showing of Objects Attributes: mapped newshow reparent reshow When a layout is first shown, all its children are shown. When children are added to it, however, they are not automatically shown in it unless they were already shown somewhere. A simple example: a'original'; b'show fn'; c'show attribute'; d'mapped'; e'newshow'; `a`b`c`d`e is `label; show `b; l`a; show `l is `layout; br{`l;96 72} l`a`b`c`d Although l has four children, only two are shown: a because it was a child when the layout was first shown and b because it was already shown when it was added to the layout. If you set the show attribute of a child to 1, it will be shown: `c has (`show;1); In fact, it is enough to set the "mapped" attribute to 1: `d has (`mapped;1); Setting the mapped attribute for a top-level object to 0 when it is shown (unmapping it) has the effect of making its contents blank.This effect can be useful when you are making several changes in a layout and do not want the flashing that would otherwise occur: `c has (`mapped;0); `l has (`mapped;0); `c has (`mapped;1); `l has (`mapped;1); When the "newshow" attribute is 1 for a layout, any child that is added to that layout is shown: `newshow of `l < 0 `l has (`newshow;1;); l`a`b`c`d `e Similarly, you can control what happens when a child is removed from a parent (orphaned). By default, the child becomes a top-level object (it is made its own parent) and it is shown independently. If, however, you set the "reshow" attribute to 0, then an orphaned object still becomes top-level but is not shown. Furthermore, if you set the "reparent" attribute to 0, it is not made its own parent but rather is freed, and of course is therefore not shown: `reshow `reparent of `l 1 1 l`a`b`c`d .e: variable reparented to popup window `l has (`reshow;0); l`a`b`c .d: variable reparented to popup window `show of `d < 0 `l has (`reparent;0); l`a`b .c: freed _ex `c, free `l`b`c`d`e; 5c. Arrangement of the Children Attributes: at build lockposition position structure vcol vcols vrow vrows X Y YX Starting with a null layout allows you to set attributes: a1a2a3a4a5a6a7a8a9a1010 12 l() `l has (`class;`layout); When a variable is to be bound to the layout class, the arrangement of the symbols in it usually determines the geometry of the display. (Compare the geometry attribute, with symbolic indices, for an action display.) A+ arranges the display when the variable is a vector: l`a1`a2`a3`a4`a5`a6 show `l; br{`l;0}; `l has (`y;0); Each item of a nested vector is taken to represent a row: l(`a1`a2`a3; `a4`a5`a6); br{`l;0} l(`a1; `a2`a3; `a4`a5`a6); br{`l;0} As you are probably about to see (or saw), the history of a layout affects its display when its geometry is changed. Setting naturalsize provides the arrangement that would appear if the layout were new: l(`a1`a2`a3; `a4`a5`a6) l(`a1; `a2`a3; `a4`a5`a6) `l has `naturalsize; A matrix form for the layout variable establishes the virtual rows and columns of the display, with the empty symbol is used to indicate a blank area. You will notice a lot of drawing, giving a jumpy effect; this could be avoided by hiding or unmapping the object, making the changes, and then showing the variable again: l3 2`a1`a2 `a3`a4 `a5`a6; `l has `naturalsize; br{`l;0} l4 3`a1`a1`a2 `a1`a1`a3 ``a4` `a5``a6; `l has `naturalsize; br{`l;0} {l4 5`a1`a1`a2`a2`a2 `a1`a1`a3`a3`a3 ``a4`a4`a4` `a5`a5``a6`a6; `l has `naturalsize; br{`l;0}} The layout variable can be a matrix of matrices, each submatrix indicating the arrangement within its area of the matrix: {`l has (`newshow;1); l2 2(2 1`a1`a2;1 2`a3`a4;;4 1`a5`a6`a7`a8); `l has (`ys;800); br{`l;0}} l[1;0]<1 2`a9 `a10; br{`l;0} free `l; The "build" attribute for a layout allows you to arrange objects on the screen and have the relative arrangement of those objects maintained in the layout display. You could get the size and position you wanted for the objects by dragging them, but we will set their yx and yxs attributes instead in this simple example: show `a1; `a1 has (`yx;350 300); show `a2; `a2 has (`yx;350 550); show `a3; `a3 has (`yx;580 300; `yxs;170 440); show `a4; `a4 has (`yx;350 770;`yxs;390 200); l(); `l is `layout; `build of `l `l has (`build;1); l`a1`a2`a3`a4; show `l; br{`l;0} It would clearly be simpler to use a non-vector value for l to obtain this particular layout, but in complicated cases build might provide the easiest means of specification, or you might want to let a viewer decide the arrangement. Implied in all of these methods and explicit in the method we are about to explore is the idea of virtual rows and columns, whose edges are established by edges of the children and which may be spanned by children. The "at" attribute is a four-element integer vector representing the position and extent of an object in a layout in terms of these divisions: (starting virtual row, starting virtual column, number of virtual rows spanned, number of virtual columns spanned). Conceptually, a layout can be placed over an imaginary grid so that the border of each object in the layout lies on grid lines. The position and size of each object can then be described by the row index and column index of the grid block containing the upper left corner of the object, and the number of grid rows and columns that the object overlaps. If the grid is the minimal one, i.e., the one with the fewest possible grid lines, then these four numbers are the value of the at attribute. The origin for the grid coordinates is the upper left corner of the layout. The complexity of building a layout from screen positions may lead to unexpected at values, but when the layout is specified by, say, a matrix value, then at is what you would expect: >`at of `a1`a2`a3`a4 0 0 7 8 0 10 7 8 9 0 7 18 0 19 16 8 l2 3 `a1`a2`a4 `a3`a3`a4 >`at of `a1`a2`a3`a4 0 0 1 1 0 1 1 1 1 0 1 2 0 2 2 1 The "structure" attribute of a layout, which is for reference only, gives you a slotfiller containing the values of at for all of its children: `structure of `l < < `.a1 `.a2 `.a4 `.a3 < < 0 0 1 1 < 0 1 1 1 < 0 2 2 1 < 1 0 1 2 The four elements of the at attribute value are synonymous with the attributes "vrow", "vcol", "vrows", and "vcols"; they can be set individually to rearrange a layout, as in the first line below. You can specify the entire arrangement of a layout by setting the at attribute on each of its children, as in the four-line statement group below: `a3 has (`vcol;1;`vcols;1);`a1 has (`vrows;2);`l has `naturalsize {free `l; l`a1`a2`a3`a4; `l is `layout; `a1 has (`at;0 0 1 2); `a2 has (`at;1 0 1 1); `a3 has (`at;1 1 1 1); `a4 has (`at;2 0 1 2); show `l; br{`l;0 200}} The R and C attributes that you saw in the Buttons tutorial can be used to constrain the virtual rows or columns of a layout to be all the same size: l(`a1``a2;```;`a3``a4); `l has `naturalsize; `l has (`C`R;(1;1)); The "YX", "Y", and "X" attributes are related to the yx, y, and x attributes, respectively. The latter three can be set or referenced and they pertain to the position of an object (in pixels) within its parent or, for top-level objects, within the screen. The former are for reference only and always pertain to the position of the object (in pixels) within the screen: `YX `yx of `l < 327 538 < 327 538 `YX `yx of `a1 < 357 540 < 30 2 Several objects can occupy a layout in such a way that only one is visible at a time, taking up the entire area of the layout, and any other one can be brought into view simply by setting the value of its raise attribute to 1. Since the objects within the layout can themselves be layouts, or other complex objects, this provides a simple, efficient, and general way of displaying multiple objects when only one must be visible at a time. You use the "position" attribute to accomplish this. This attribute must be set before the layout is built, so start with a null layout and set position and then give the layout its correct value: free `l; l(); `l is `layout; `l has (`position;0) l`a1`a2`a3`a4`a5`a6`a7 show `l; br{`l;0} `a4 has (`raise;1) When you remove children from a layout by freeing or unmapping them, the remaining objects may or may not retain their positions. The "lockposition" attribute forces them to remain in the same positions. Consider this example of two layouts that are identical except for the values of lockposition (and the locations of the layouts themselves, so you can see them both at once): free `l; a1'one'; a2'two'; a3'three';a4'four'; a5'five'; a6'six'; a7'one'; a8'two'; a9'three';a10'four'; a11'five'; a12'six'; `a1`a2`a3`a4`a5`a6`a7`a8`a9`a10`a11`a12 is `label; l3 2 `a1`a2`a3`a4`a5`a6; ll3 2`a7 `a8`a9`a10`a11`a12; show `l `ll is `layout; br{`l;0 130}; br{`ll;0} `ll has (`lockposition;1; `reparent;0); `l has (`reparent;0); free `a3 `a9; `a2 `a8 has <(`mapped;0); `a4`a6 `a10`a12 has <(`mapped;0); The layout on the left should now have only one column, while the one on the right, for which lockposition is 1, still has two columns, with the two remaining labels still in their original positions. The effect can be perhaps even more pronounced when the layout geometry is a single column: free `l`ll; `a1`a2`a3`a4`a5`a6`a7`a8`a9`a10`a11`a12 is `label; l`a1`a2`a3`a4`a5`a6; ll`a7`a8`a9`a10`a11`a12; show `l `ll is `layout; br{`l;0 78}; br{`ll;0} `ll has (`lockposition;1;`reparent;0); `l has (`reparent;0); free `a2 `a8; `a5 `a11 has <(`mapped;0); _ex `a2`a8,free `l`ll`a1`a2`a3`a4`a5`a6`a7`a8`a9`a10`a11`a12; 5d. Size of the Children Attributes: b h H l locksize r resize t w W If the "locksize" attribute of a layout is 1, the removal of a child should not cause any remaining child to change size. In Release 2.21, however, if the "locksize" attribute of a layout is 1, the removal of a child cannot cause the layout to change size, although remaining children may change size. The latter behavior is expected to be replaced by the former if there is another release of version 2. Here is an example of the behavior of two layouts that are essentially the same except for this attribute; you can tell from this example which way the release you are using behaves: abcdefghij14 17 l(`a`b;`c`d;`e); ll(`f`g;`h`i;`j); show `l `ll is `layout; br{`l;0 412}; br{`ll;0} `ll has (`locksize;1; `reparent;0); `l has (`reparent;0); `ys of `l `ll < 539 < 539 `b`c`d `g`h`i has <(`mapped;0); `ys of `l `ll < 370 < 539 free `l`ll; The way a child behaves when a layout is resized depends in part on its display class. Call a child sticky if its class is action, button, scalar, label, slot, check, or radio and call all others non-sticky. If a layout has at least one row with only non-sticky children, then any row containing a sticky child retains its vertical size when the layout is resized. See how all the extra vertical space is allotted to the bottom row when you execute the next to last of these lines: `r is `radio r(`w`j`z;(1;0;0)); `ac is `action ac(`a`c`t;(;;)); l(`r`a;`ac`b;`c`d); show `l is `layout; br{`l;108 81} `l has (`yxs;1.2`yxs of `l); free `l; The size of an object in a layout, which is normally affected by other objects in its row and column or by resizing the layout, can be controlled by setting the "H" and "W" attributes to 1. These settings prevent resizing of an object's height and width, respectively. There are even stronger resize restrictions, which apply to the entire row and column in which the object is positioned: setting the "h" and "w" attributes to 1 means retain the height of the row and the width of the column, respectively. The constraints can be seen after the layout enlargements in this example: l3 2`a`b`c`d`e`f; show `l is `layout; br{`l;162 121} sz`yxs of `l `a`b`c`d`e`f has <(`resize;''); `c has (`W;1); `f has (`H;1); `l has (`yxs;1.3sz); `l has (`yxs;sz); `c has (`w;1); `f has (`h;1); `l has (`yxs;1.3sz); `l has (`yxs;sz); Setting these constraints to 0 does not remove them. They are actually just a way of inserting constraints in the "resize" attribute, whose value can be a character vector containing any of 'WHwhtblr' (we will deal with the last four in the next paragraph). Settings of resize are cumulative unless there is a period in the value being given for it or that value is empty. Resize settings of both '.' and '' remove all constraints. If the newly allotted space for the object within the layout is larger than the object, its position within that space is controlled by setting the "t", "b", "l", and "r" attributes to 1. They stand for top, bottom, left, and right and have the obvious effect. Now we remove all constraints and then constrain the heights and widths of two children, enlarge the layout, and move the constrained children within their spaces: `a`b`c`d`e`f has <(`resize;''); `c`f has <(`W`H;(1;1)); `l has (`yxs;1.3sz); `c has (`t;1); `c has (`l;1) `f has (`b;1) `f has (`r;1) `resize of `c < ltWH In real life, of course, you would set the constraints before enlarging the layout, so that the desired result would appear all at once, but when learning it is better to see the steps and not just the outcome. Before leaving this layout, let's look at the dominance of left and top -- the nullity of b and r in the presence of t and l -- and the change when a size constraint is removed: `c has (`resize;'br'); `c has (`resize;'WHb.r'); `c has (`resize;'.'); `f has (`resize;''); free `l; These attributes can be used in the initial display of a layout, when they apply to the relation between the natural size of the object and the space allotted to it in the layout. Consider this example: d'and ',c'still ',b'another ',a'array' `a`b`c`d is `label; `a has (`resize;'tr'); `b has (`resize;'Wtr'); `d has (`b;1); j10+k10+m10+n14 17 l4 2`a`j `b`k `c`m `d`n show `l is `layout; br{`l;0} The default label position, centered both ways, is shown by c. Why is b at the right but not a? Because the latter is as wide as its space in the layout, whereas b was not made wider than its natural size: we had set W for it, and so it had room to move. But then why did all the vertical movements succeed? Because for any object bound to the label class resize has the default value 'hH' and we simply added to that value. Therefore each label has its natural height and has room to move vertically in its space in the layout. 5e. Navigation and Interaction Attributes: acceptfocus focus freeze sensitive tabfrom tablist tabto First, a note about function keys, which were discussed in the Buttons tutorial. When Fj is pressed, if it was set on the object that has focus, then its function is executed. If it was not set on that object, then the object's container is checked and the function executed if the key was set on that object, and so on up to the shell, the top-level object. The "sensitive" attribute can be set to 0 to block all user interactions with an object and all its descendents. Try to select from, edit, or scroll j (with the pointer in l!) after executing the second statement, and try to select from, edit, or scroll any of the arrays after the third statement. The fourth statement shows that the display is still sensitive to changes made by program; only the user side is blocked, all viewer input being ignored: `j`k has <(`selected;0 0); `j has (`sensitive;0); `l has (`sensitive;0); jj+1 `l`j has <(`sensitive;1); When the "freeze" attribute is 1, the display of the object and all its descendents will not be updated as a result of specifying values for it or setting attributes on it (although for the object itself some blanking may occur). When freeze is set to 0, the object is redrawn. You can use freeze to make several changes to an object without having its intermediate states flash on the screen. If you try editing, scrolling, and selecting after the fifth statement in this example, you will find all these actions work, although scrolling may just propagate the last line previously shown in the scrolled direction. Only the program side is blocked, the display of all changes by the program being deferred until freeze is set to 0: `a has (`resize;''); `b has (`freeze;1); `b has (`resize;''); `b has (`freeze;0); `l has (`freeze;1); `d has (`resize;''); nn+1 `l has (`freeze;0); The remaining attributes in this set have to do with keyboard focus within a container. It can be given directly to any child with which the viewer can interact (not a label, e.g.) by setting the "focus" attribute for the child to any value. Move the pointer into l after executing this statement to see its effect: `m has `focus To move the focus from child to child, press Meta-Tab (Alt-Tab on IBM keyboards) or Shift-Meta-Tab (Shift-Alt-Tab on IBM keyboards) while the pointer is in the container. Objects of the various button and menu classes can be excluded from this traversal by setting the "acceptfocus" attribute to 0 or included by setting it to 1. Try traversing l before and after the statement excluding a from the traversal, but don't have the focus on a when you exclude it: free `a; a(`j`k`m`n;(1;0;0;0)); `a has (`class;`radio; `resize;'.WH'; `mapped;1); l4 2`a`j `b`k `c`m `d`n `a has (`acceptfocus;0); The order of traversal is given in the "tablist" attribute and can be changed by giving a new value to tablist. All children are listed in the default value of tablist regardless of any ineligibility to accept focus, contingent (as for a) or absolute (as for the labels). The effective order of traversal is the order of the eligible children in tablist. When you specify tablist, you can omit any children you want and you can include children for which acceptfocus is 0 -- they will not actually be included in the traversal until you change the setting of acceptfocus. Try traversing the layout before and after the third statement below, setting acceptfocus for a to 1: `tablist of `l `l has (`tablist;`j`m`k`n`a); `a has (`acceptfocus;1); The tablist attribute (and the order of traversal) can be altered using the "tabfrom" and "tabto" attributes, whose values are the prior and following entries in tablist. These two attributes can also be queried, although if there are ineligible children listed in tablist the values of tabfrom and tabto may not be helpful for some children; `tabfrom of `a `a has (`tabfrom;`m); `j has (`tabto;`k); `tablist of `l < `.j `.k `.m `.a `.n free `l; Here is an example of a layout within a layout. Start by preparing the first two rows of the outer layout, the second row being itself a layout. A width is specified for the action buttons to make them a little more spacious: chc(`Off`On;(1;0)) `chc has (`class;`choice;`title;'Feed is'); hmn(`Font;,<(`font1`font2`font3;(;;))) `hmn is `hmenu; act(`Save`Sort`Add`Print`Fields`Help`Drop`Quit;(;;;;;;;)) `act has(`class;`action; `title;''; `geometry;8; `realize;1; `xs;670); l1 2`hmn`act `l has (`class;`layout; `title;'';`h;1); Now define a table and place it and the previous material in a layout: ca1 9'912827L2 '; cb17.625; cc120221115; cd1123.0314; ce15.933; cf112.81; cg116.23; tbl`ca`cb`cc`cd`ce`cf`cg `tbl has (`class;`table; `title;''; `cols;7); `ca`cb`cc`cd has (<`title), <@0 `Cusip`Coupon`Maturity`Price; `ce`cf`cg has (<`title),<(`Yield;'M Dur';'$ Dur'); `cb`cc`cd`ce`cf`cg has(<<`out),<(6.3;`mdy2;`328th;6.3;6.2;6.2); `ca`cb`cc`cd`ce`cf`cg has(<<`space),<(9;7;10;7;7;7;7); lay(`chc`l`tbl); `lay is `layout; `lay has (`shelltitle;'qs'; `title;''; `realize;1; `ys;300); show `lay; br{`lay;0} free `lay Here is another example of a layout, with color attributes used to accentuate its various parts: a19930000+401 505 609 714 818 922 1027 1201 db2+.75 .6 .7 .6 .75 .9 .7 .75 c7+1.073 .904 1.123 .904 .754 .923 .804 .474 ef80 t`a`b`c`d`e`f show `t is `table; br{`t;72 188} Showing t is premature on several counts, as is the next statement, but doing things in this order allows their effects to be shown better. `t has (`cols;4; `rows;8); `a has (`out;`mdy4; `space;10); `b`c`d has <(`out;8.3); `t has (`cols;4); `a`b`c`d has (<`title),`Auction`AucRate`YCR_R`ARR_R; `t has (`title;'MTA 5.50 2013'); `t has (`titlefg;`white; `fg;`white; `bg;`black; `scrollbg;`grey); act(`tg`ex`pr;(;;)) `act has (`class;`action; `geometry;3; `title;''; `bg;`white); `act has (`label;('Toggle Daycount';'Exit';'Print')); lbl'ActAct rates looking forward' `lbl has (`class;`label; `fg;`white; `bg;`black); l`t`act`lbl `l has (`class;`layout; `shelltitle;'RATE HISTORY'; `title;''); show `l; br{`l;0} _ex free `l; 6. The Hpane and Vpane Display Classes The hpane and vpane display classes are container classes that are like layouts except that they have movable dividers, or sashes, between their children. The viewer can control the proportion of the layout that children occupy simply by moving the dividers. Various attributes that constrain the arrangement of children, such as position and build, are disregarded. An hpane object has vertical dividers and its children should be arranged horizontally. A vpane object has horizontal dividers and its children should be arranged vertically. To move a divider, simply place the mouse pointer on it, press and hold the left mouse button, and then slide the divider left or right, or up or down. The old and new divider lines are shown continuously and the new arrangement is shown when you release the mouse button. A small button is provided on one end of each divider as a convenient place to locate the pointer. In the following vpane example, a viewer can adjust the number of headlines shown, with a corresponding adjustment in the space available for any selected story. We use some data from aux_vars.+ that there is no point in cluttering this tutorial with. The selected headline appears as the title of the story section: _load{'/usr/local/aplus-fsf-4.22/doc/tutorials/s.tutorials/aux_vars.+'}; `ld_vph has (`class;`view; `title;''; `bg;`white; `rows;10; `cols;74); t76' BT 10/01 13:14 Nortek Filing -2- Proceeds to Redeem Debt >NTK' `ld_vps has (`class;`view; `title;t; `bg;`white; `rows;9; `cols;76); vp`ld_vph `ld_vps `vp has (`class;`vpane; `title;''; `shelltitle;'DJ NEWS -- MS FID'); show `vp; br{`vp;0} Move the sash up and down. Notice that scrollbars appear and disappear for the two sections as needed and that you can eliminate either section from view completely if you want. _ex `t,free `vp; In the following hpane example, a viewer can adjust the number of fields shown in two tables. The first four lines set up the table fields, the next four the tables, the next two the tableFields, and the last three the hpane: csps100 `cs`ps has <(`title;'strikes'; `out;'f7.2'); CBIDCASKCLSTCBvolCAvolCLvolCLDelta10Ң999999999 PBIDPASKPLSTPBvolPAvolPLvolPLDelta10Ң999999999 tc`cs`CBID`CASK`CLST`CBvol`CAvol`CLvol`CLDelta tp`ps`PBID`PASK`PLST`PBvol`PAvol`PLvol`PLDelta `tc has (`class;`table; `title;'Calls'; `cols;5; `rows;10); `tp has (`class;`table; `title;'Puts'; `cols;5); `cs`CBID`CASK`CLST`CBvol`CAvol`CLvol`CLDelta has<(`blank;' '; `space;7); `ps`PBID`PASK`PLST`PBvol`PAvol`PLvol`PLDelta has<(`blank;' '; `space;7); hp1 2`tc`tp `hp has (`class;`hpane; `shelltitle;'Ivy'; `title;''); show `hp; br{`hp;0} Try moving the sash from side to side. You can show just one table, two columns of one and all of the other, or other combinations. _ex free `hp; The dividers of an hpane layout always extend from the top to the bottom of the layout, so care must be taken when using hpane layouts with more than one row. Consider (a;b)100+?2<5 3 100; c100+?5 4100; h(`a`b;`c); show `h is `hpane; br{`h;0} The divider between objects a and b cuts through object c. Similarly, care must be taken when using vpane layouts with more than one column: _ex free `h; (a;b)100+?2<9 2 100; c100+?12 2100; v(`a`c;`b`c); show `v is `vpane; br{`v;0} If several objects line up on a divider boundary, then movement of the divider controls the display sizes of these objects. Thus movement of a divider can control the display sizes of an entire row or column of objects. Moreover, there can be several dividers. Scrutinize this example and move its dividers: _ex free `v; (a;b;c;d;e;f;g)100+?7<5 9100; h(`a`b`c;`d`e`f;`g) show `h is `hpane; br{`h;0} Where do dividers appear? In section 5c, on the arrangement of objects in a layout, we spoke of virtual rows and columns and the at attribute, whose value is defined in terms of them. Dividers appear between each adjacent pair of virtual columns for an hpane and of virtual rows for a vpane. Respecify h to be an unpleasant hpane whose arrangement of objects requires that they all span virtual columns: h(`a`b`c;`d`e;`g); free `f; >`at of `a`d`g 0 0 1 2 1 0 1 3 2 0 1 6 Notice that there is no object boundary between the first and second virtual columns or between the fifth and sixth, although there are dividers there. free `h; Clearly, if we want dividers for each of the first and second rows, this is not the way to do it. The dividers need to be limited in length. The right way for this particular arrangement is to handle the virtual rows separately, to put two hpanes and g inside a layout: h11 3`a`b`c; `h1 is `hpane; h21 2`d`e; `h2 is `hpane; l`h1`h2`g; `l is `layout; show `l; br{`l;0} free `l; Likewise, dividers may need to be limited in number, and a way to do that is to put layouts inside hpanes. Suppose we want to allow the viewer to divide the available space between two arrays and also to switch the variable that appears in the lower array, with the same columns shown as for the variable previously shown. We want a vpane containing array, radio, array. If we specified the vpane in that simple manner, then there would be two dividers and they would both have to be moved to take space from one array and give it to the other (while the radio would be alternately stretched and squashed). The solution is obvious: put the radio and the array it refers to inside a layout: e10d10c10b10a10 8 r(`b`c`d`e;(1;0;0;0)); `r is `radio; l`r`b; `l is `layout; v`a`l; `v is `vpane; cbf{s;d;i;p;c;v}:{`v has (`freeze;1); po1#.l; fc`firstcol of po; .l`r,p; free po; show p; p has (`firstcol;fc); `v has (`freeze;0);} `r has (`set;cbf; `geometry;4); `v`l`r`b`c`d`e has <(`title;''); show `v; `v has (`xs;291); br{`v;0} Now move the divider, use the scroll bars, and press the radio buttons. There is no direct way for a program to determine exactly where a user has positioned a divider in an hpane or vpane layout. Sometimes there are indirect ways to approximate the position, such as checking the values of the rows and cols attributes of an object to determine how many rows and columns are currently shown. Execute these two statements before and after moving the divider: >`rows `ys of `a >`rows `ys of 1#l _ex `cbf`r`b`c`d`e`f`g, free `v; aplus-fsf-4.22/src/tutorials/s.tutorials/data0000444000265000001440000015227510774506455015005 Display Classes for Data 1. The Array Display Class 1a. Preparing to Show an Object Attribute: realize 1b. Controlling What is Shown 1b(i). What Rows and Columns are Shown Attributes: cols firstcol firstrow naturalsize rows size 1b(ii). Selected and Referred Rows Attributes: col index refer row select 1c. Changing the Value 1c(i). Editing Attributes: edit protect 1c(ii). Insertion and Deletion Attributes: delete insertabove insertbelow 1c(iii). Representing Missing Values and Characters Attributes blank copy na stars 1c(iv). Evaluation Attributes: active def done evaluate execute in out 1d. Appearance 1d(i). Separators Attributes: colsep rowsep 1d(ii). Size Attributes: dynamic editspace hscrollsize respace space scrollsize vscrollsize 1d(iii). Color Attributes: colors cycle editbg editfg hscrollbg indexbg refresh rowbg scrollbg selectbg vscrollbg 1e. Documentation Attribute: doc 2. The Label Display Class 3. The View Display Class 3a. Accessing the Primary Selection Buffer Attributes: clear notify primary request 4. The Page Display Class Attributes: blink blinkrate bold box boxcolor color colormap line underline 4a. User Input Attributes: cursor key keysym rband rbandbox 3down 3up 2down 2up 5. The Matrix Display Class Attributes: collabelrows colspace 5a. Selection Attributes: colindex cornerindex rowindex selectcol selectcorner selectrow 5b. Colors Attributes: colindexbg cornerindexbg rowindexbg 6. The Slot Display Class --------------------------------------------------- 1. The Array Display Class Any A+ scalar, vector, or matrix can be displayed as an object of class array. For character arrays, each vector or row of a matrix is put in one cell. For all other arrays, each element is put in its own cell. Examine these six examples to see how various data types are displayed and check the action of the scrollbars. It is a bug, scheduled to be fixed in Version 3, that s has to be jogged by naturalsize into obeying respace: $load s scrs.SCREEN-34 12 br{w;m}:{w has (`yx;scr-m+`yxs of w);} ar10 10; `ar has (`class;`array; `respace;1; `show;1); br{`ar;0} ar1.0+10 ar2.718+10 ar(1 2;3 4 5;6;'abc';`def;7 8;9 10) ar6 5'Row 1Row 2Row 3Row 4Row 5Row 6' ar'This is a character vector' `ar has `naturalsize; br{`ar;0} ar2 2("Perhaps";"not";"what's";"wanted") `ar has (`space;12;`cols;2); br{`ar;0} _ex free `ar 1a. Preparing to Show an Object Attribute: realize Sometimes, when there are lengthy computations or file accesses, objects may be placed on the screen in a halting, ragged way unless you take steps to make the presentation smoother. Try this contrived example, where sys.sleep is a stand-in for a meaningful lengthy operation and b and c are specified initially to speed the start-up: ar14 17 b:{sys.sleep 5;ar} c:{sys.sleep 5;ar} cbar show `ar is `array; br{`ar;0} `b has (`class;`array; `show;1); br{`b;0 250} `c has (`class;`array; `show;1); br{`c;0 500} hide `ar Now give ar a "new" value to mark the b and c values invalid. When they are shown again the display is set up in a halting, ragged way: ar14 17 show `ar Now we will hide these objects and respecify ar. But this time we will use the "realize" attribute before showing the objects. Setting realize to 1 causes the objects to be calculated for showing but does not actually show them. Thus the delay and unevenness is not displayed on the screen, and when the show function is executed the objects jump right up: hide `ar ar14 17 `ar`b`c has `realize; show `ar; Get rid of the other objects: _ex free `b`c 1b. Controlling What is Shown There are a number of attributes that control what elements of an array object are shown. Some determine the set directly; others single out individual elements for inclusion somewhere in the set. 1b(i). What Rows and Columns are Shown Attributes: cols firstcol firstrow naturalsize rows size The "rows" and "cols" attributes control how many rows and columns are shown. The default has been used for ar, but you can change how much is shown: >`rows`cols of `ar `ar has (`rows`cols;(8;4)); br{`ar;0} The "firstrow" and "firstcol" attributes are the indices of the first row and first column that are shown, and thus control what portion of the array appears on the screen: `ar has (`firstrow`firstcol;(6;13)) The bottom right portion of the array is shown. Now press twice on the up button of the vertical scrollbar, moving up two rows, and once on the left band of the horizontal scrollbar, moving left three columns (the four that are shown minus one for overlap). The new position is 4, 10: `firstrow`firstcol of `ar `ar has (`firstrow`firstcol;(13;16)) >`firstrow`firstcol of `ar The specification was taken as a suggestion (without comment) and honored as far as possible while still showing the same number of cells. The "naturalsize" attribute was introduced in the button section of the Buttons tutorial. It is an action attribute; it cannot be queried. Setting naturalsize returns the array to the number of rows and columns it had when mapped, taking into account the current text and data values and feature attributes, but setting firstrow and firstcol to 0: `ar has `naturalsize Fractional rows may be shown when the viewer changes the size of an object -- try dragging the bottom right corner down and to the right when you have a target for a pointer -- or when a size is assigned to the object in an A+ statement. These fractional rows show no data and are of no use. The "size" attributes trims them off. When you have a 200 by 300 pixel space available and want to use as much as possible of it, but want a good-looking display, you can use the size attribute. You should see 6+ rows and 3+ columns and then an even 6 by 3 when you execute these statements: `ar has (`yxs;200 300) `ar has `size You can combine these statements, if you list the attributes in the correct (left to right) order. The first line below specifies size too early; the second is OK: `ar has (`naturalsize`size`yxs;(;;200 300)) `ar has (`naturalsize`yxs`size;(;200 300;)); br{`ar;0} 1b(ii). Selecting and Choosing Rows Attributes: col index refer row select A cell can be selected in an array object. Selecting and choosing are discussed here because a cell is normally shown when it is selected, and so they are another way of determining what portion of an array is shown. The "row" and "col" attributes contain the row and column indices of the selected cell. They are -1 if no cell is selected. The "selected" attribute, discussed in the Buttons tutorial, is just the concatenation of the row and col attributes. Execute these statements: `ar has (`firstrow`firstcol;(6;13)) >`row`col of `ar `ar has (`row`col;(0;0)) `ar has (`row`col;(0;1)) `ar has (`row`col;(2;2)) `ar has (`row`col;(;)) >`row`col of `ar Notice that Null is accepted in place of -1. As you have just seen, a selected cell is shown raised, and a selected row (except for the selected cell) is shown in a different color. Now place the mouse pointer in any cell of ar and click the left mouse button. That cell becomes selected. With the pointer in the array display, the selection can be moved using the arrow keys, Tab, Shift-Tab, Page Down, Page Up, End, and Home. Each key is effective until its limit is reached. When no cell is selected, Right Arrow, Down Arrow, Tab, and Home select cell 0 0, Page Down selects the first cell of the last row shown and makes it the top row shown, and End selects the first cell of the last row. Try them. Whenever a cell is selected, a select event occurs. The "select" attribute allows you to specify a function that will be called at each select event, and optionally to specify an argument for that function. The default selection action still occurs. For example, execute: f{s;c;v}:{acv; a has (`firstrow `firstcol; ġ(`row `col of a)-s1+`rows`cols of a);} `ar has (`select `cols;((f;.5);3)) Now use the mouse and the keyboard to select various cells in ar and see how the select callback function f causes the selected cell to appear in the middle of the display -- or, when it is near the edges, to appear as close to the middle as possible. Notice that if you scroll the display leaving the selected cell in view and click on that cell, no select event occurs, as evidenced by the fact that the cell does not move. Now execute f{s;c;v}:>`row`col of cv `ar has (`select;f) `ar has (`row`col;(0;0)) `ar has (`row`col;(2;3)) `ar has (`row`col;(3;4)) `ar has (`row`col;(4;4)) `ar has (`selected;<1 2) `ar has (`selected;<1 1) and notice that: (1) When selection takes place by an A+ statement, using row and col attributes, a select event can occur for each of them, in the order shown by those attributes. (2) The "selected" attribute is implemented as if the col and row attributes had been specified, in that order. (3) No select event occurs when the row or column selected is the same as the one that was selected or is -1. The automatic setting to 0 mentioned in the second paragraph after this one does not trigger a select event, so setting both attributes from -1 to 0 triggers only one event. Now use the mouse and the keyboard to select cells and notice that at most one select event occurs each time. The row and col attributes are independent, except that (1) if one is set to -1, the other is automatically set to -1 also and (2) if they are each -1 and one is set to something else, the other is set to 0: `ar has (`firstcol`firstrow`selected;(0;0;)) `ar has (`col;1) `row of `ar `ar has (`selected;) `ar has (`row;1) `col of `ar `ar has (`row;) `selected of `ar `ar has (`select;) The "refer" attribute allows the viewer to choose a set of rows. When it is zero, no choosing can take place. When it is nonzero, however, clicking the left mouse button with the pointer on a cell that is selected but not chosen causes its row to be chosen, and then clicking on it again causes the row to be no longer chosen. Since clicking on an unselected cell causes it to be selected, clicking twice on any unselected cell causes the chosen status of its row to be toggled. Pressing Enter while the pointer is in the window and there is a selected cell has the same effect as clicking on the selected cell. The default for refer is 0. `refer of `ar `ar has (`refer;1) `index of `ar The "index" attribute is a sorted list of the indices of the chosen rows. Choose some rows, using the left button and the Enter key; notice the change in the color of these rows. Remove the choice from some of them, again using both button and key, but leaving several chosen. `index of `ar If there are chosen rows and refer is set to zero, then they are remain chosen rows and you cannot remove the choice from them: `ar has (`refer;0) Now try pressing Enter with the pointer in the array window or clicking on the selected cell. And now remove the choice from all the chosen lines: `ar has (`index;) Like a number of other attributes, refer can have one of three values: 0 for no choosing; 1 for choosing with the default action; or a function, and, optionally, an argument, for a callback. If a callback function is specified, s does nothing but call that function when a refer event occurs and appropriately color the rows listed in index after the callback. It is up to the callback function to update and sort the index attribute. Define a function that mimics the default action and displays its argument and the new value of index, and set refer to it and a static-data argument: f{s;c;v}:{acv; (r;i)`row`index of a; i((ir)/i; a has (`index;i);(s;c;v;i);} `ar has (`refer;(f;'stat data')) Now choose some rows and remove the choice from some of the chosen ones, leaving others. `index of `ar `ar has (`refer`index;(0;)) 1c. Changing the Value Aside from reassignment to the underlying variable, there are several ways the value shown on the screen can be changed. 1c(i). Editing Attributes: edit protect The value in an individual cell can be edited. To prepare for editing, a cell must be selected, in one of the ways just demonstrated. There are two modes and several ways to enter them, one of which involves deletion of the entire previous contents. Try them, pressing Escape after each: Replacement: With the pointer in the cell, click the middle mouse button. The replacement text cursor will appear on the character the tip of the pointer is nearest to. Insertion: With the pointer in the cell, click the right mouse button. The insertion text cursor will appear between characters, as near as possible to the tip of the mouse pointer. With the pointer in the window, press the Insert key. The insertion text cursor will appear at the end of the original contents. With the pointer in the window, press Backspace or any character key. The entire cell contents will be deleted and the character will appear, unless you pressed Backspace, followed by the insertion text cursor. The mode, insertion or replacement, can be toggled by pressing the Insert key or reset by using the middle or right mouse button. The cursor can be moved with the left and right arrow keys or by clicking at a new location in the cell: the left button leaves the mode unchanged, the middle button forces replacement mode, and the right button forces insertion mode. The editor is Emacs style. To abort the editing of a cell and return to its original contents, press the Escape key. To end the editing of a cell and cause the edited contents to be inserted in the underlying variable, press Enter or select another cell using Tab, the up or down arrow keys, etc., or, with the pointer in another cell, a mouse button. Since the edited contents of a cell are inserted in the underlying variable using Selective Specification, you must avoid illicit values, such as 34.5 when the array is integer or 34 5 when the array is simple. When you press Enter or try to select another cell with an illicit value in the current cell, a message appears in the session log and editing of the cell remains open. Remember, you can escape from an error situation by pressing the Escape key. Try editing the ar display. Editing can also be begun and ended from A+ code. Assigning any nonzero value to the "edit" attribute is like pressing the Insert key. (If no cell is selected, neither of these actions causes edit mode to be entered.) Assigning a zero value to the edit attribute is like pressing Enter in edit mode. `ar has (`selected `edit;(1 1;)) Now edit the cell, but leave it in input mode. The edited contents are accepted (assuming the value is permitted) by this statement: `ar has (`edit;0) You can restrict editing to certain cells, using the "protect" attribute. A 1 prevents editing in a column and a 0 allows it. You can give an array argument that will be used repetitively, in the manner of Reshape, or a function. The first statement allows editing of only the first and third columns; try editing ar after you have executed it: `ar has (`protect;0 1 0,141) `protect of `ar f{s;d;i;p;c;v}:{(s;d;i;p;c;v);0=2|d} `ar has (`protect;(f;'attempt to edit')) Now only odd values can be edited; try it. You will see in the A+ session log the arguments that are passed to f. `ar has (`protect;0) 1c(ii). Insertion and Deletion Attributes: delete insertabove insertbelow Insertion and deletion can be controlled in a manner like editing and choosing. You can allow a viewer to insert or delete rows in an array, prevent a viewer from doing so, or provide functions to handle insertion or deletion requests. These requests are made by selecting a row and pressing a key combination; the combinations and the corresponding attributes are Meta-Delete ("delete"), Meta-Insert ("insertbelow"), and Meta-Shift-Insert ("insertabove"). On IBM keyboards, the corresponding key combinations are Alt-Delete, Alt-Insert, and Alt-Shift-Insert. The pointer must be in the window when the keys are pressed. Setting any of these attributes to 0 causes requests for its action to be ignored. Setting it to 1 causes the default action, deletion or insertion, to be taken upon request. Setting it to a function, or a function and an argument, causes that function to be called when the request is made and causes s to omit the default action. Consider deletion first. Try to delete a row after each of the first two statements: `ar has (`delete;1) `ar has (`delete;0) f{s;c;v}:{if ((c%s)=r`row of cv){(c%s)1;(c%v)(rc%v),(r+1)c%v} else (c%s)r;} arr1 `ar has (`delete;(f;`arr)) Now in order to delete a row you must press Meta-Delete (or, on an IBM keyboard, Alt-Delete) twice on a selected row. Try selecting various rows and pressing once on each and then twice consecutively on the last. Now consider insertion. After the second and third statements, try each kind of insertion at the first line: ar14 17; `ar has (`firstrow`firstcol `row`col;(0;0;0;0)) `ar has (`insertabove`insertbelow;(0;1)) `ar has (`insertabove`insertbelow;(1;0)) f{s;c;v}:(c%v)((1+#c%v)s+>`row of cv)\c%v `ar has (`insertabove`insertbelow;((f;0);(f;1))) Now insert a row below and one above the current third line. The next section explains the difference between the insertions performed by f and the default ones. `ar has (`delete`insertabove`insertbelow;(;;)); br{`ar;0} 1c(iii). Representing Missing Values or Characters Attributes blank copy na stars To insert a row, the function f in the last section employed Expand, which uses zero as the fill character for a numeric array. Insertion by s, however, is more flexible than by Expand. The fill character is the value of the "na" attribute. `na of `ar This number is the default for both integer and floating-point arrays. It is intended to represent an improbable, if not preposterous, value. You can set na to any value you want. You should generally choose a value that does not occur in actual data, so that it will always mean missing or unavailable, and one that will be as simple as possible to handle in your computations. Just to see it in action, change na to -1 and go back to the default insertion: `ar has (`na;1;`insertabove;1;`insertbelow;1) Now insert a row below the second one. You don't have to use a fill character when inserting rows. A copy of a row is the most convenient insertion for a viewer when only a few fields need to be changed in the new row, most fields being the same in both rows. To insert a copy of the selected row rather than a row of fill elements, change the "copy" attribute from its default value of 0 to 1: `ar has (`copy;1) Now insert a row above or below the second row. You can control how na values appear in displays. The display for any element that is equal to the (current) value of na is determined by the "blank" attribute. The default value of the blank attribute is Null: ()`blank of `ar br{`ar;0} meaning show the actual value that is in the array. The blank attribute can be set to any character value; watch the display of ar change when you change it: `ar has (`blank;'N/A') `ar has (`blank;' ') `ar has (`blank;'missing') `ar has (`blank;'Fill in') When you change na, the display of ar will also change, but only when the displays of the relevant cells must be recalculated, for example by a specifying of refresh: ar[;0] `ar has (`na;0; `refresh;) You saw stars displayed in the first rows you entered. You know that the value of those elements in the underlying variable was -999999999, the then na value. What were the stars doing there? When there is not enough room to display a formatted value in a cell, either the cell is filled with stars or the value is shown truncated. The latter alternative might be preferable for a character string or a number which would lose only digits following the decimal point. This choice is governed by the "stars" attribute: `stars of `ar `ar has (`blank;; `na;999999999; `space;7); `ar has (`stars;0) Now let's freshen ar up a little: `ar has (`stars`blank`naturalsize;(;;)) ar14 17; br{`ar;0} 1c(iv). Evaluation Attributes: active def done evaluate execute in out This section is concerned with conversions between displayed values and the value of the underlying variable, and the timing of these conversions and associated computations. There is an attribute in s that corresponds to the dependency definition function and command, _def and $def, namely "def". It is a persistent attribute, and a variable need never have been bound to have a value for that attribute: j:ar+1 `def of `j When a dependency is being displayed, the dependency is evaluated and the display updated whenever the dependency is marked invalid. If it is not being displayed, there is no need to evaluate it. (It is not being displayed if the show attribute is 0 for it or for some object in which it is contained.) The "active" attribute, which is for reference only, tells you whether the object will be updated automatically or not: `active of `ar hide `ar `active of `ar show `ar The "evaluate" attribute says whether the underlying variable (dependency or not) is to be evaluated in order to determine the proper attribute values for displaying it. If you set evaluate to zero, it is up to you to set the attributes for a proper display of the variable. Use it with great caution. Like def, it is persistent. `evaluate of `ar `evaluate of `j `evaluate of `no_such_variable The "execute" attribute controls whether or not input will be executed to obtain a value: `execute of `ar Edit a cell, enter an A+ expression with a singleton result, such as +/10, and see the result. `ar has (`execute;0); Again edit a cell; enter an A+ expression such as +/10 or 7 and you should get an error message like "ar: domain - edit value" in the A+ session log. Try expressions like 7, 1e2, -7, and +7 and you should find that they are accepted. (Although the latter two look like functions applied to numbers, actually the minus sign is converted to high minus and the plus sign is dropped, so the input is just formatted, not executed.) The "in" attribute is used to parse values as they are entered on the screen, which is always as character vectors. The default is in{x}:x if the type of the underlying variable is character, and in{x}:x otherwise. You can specify a function to be used instead of this default, like one that will accept commas as thousands separators or one that will accept a comma as a decimal point. Try entering some appropriate expressions after each of the following specifications of in. _scfi accepts commas as thousands separators and parentheses as minus; e.g., _scfi"(1,234)" is -1234. With the arguments given here, g changes a comma to a period -- e.g., 34,5 to 34.5 -- to convert decimal points from the European system. f{s;d}:_scfi d `ar has (`in;f); g{s;d}:d ((d=s[0])/d)s[1] `ar has (`in;(g;',.')) ar1.014 17; You can specify a character matrix for the in attribute, to encode input. Then when a character vector is entered, it is padded with trailing blanks as necessary and then sought as a row of the matrix. If a match is found, the row index in the matrix is entered in the variable. If the vector is not found there, the value of the na attribute is entered instead: `ar has (`in;2 3'no yes'); Now enter "no", "yes", and "maybe" in different cells; 0, 1, and stars (for -999999999) should be shown for them. The "out" attribute specifies the format in which data appears in the display. The defaults are 1x for numeric, x for character, and s.box{x} for other data. You can specify a character matrix for the out attribute, just as you can for the in attribute, so that the variable will contain numbers while words or phrases appear on the screen: `ar has (`out;2 3'no yes'); When the out format is changed, the display is immediately updated. Notice the blank cells. When out is a character matrix, all invalid indices are treated as na's, and the default blank attribute is the one for character arrays, namely a vector consisting of a single blank. `ar has (`blank;'N/A'); `ar has (`blank;); `ar has (`in;); You can specify a function for the out attribute -- for example, a conversion from radians to degrees: f{s;d}:8.2sd `ar has (`out;(f;3602)); Other possible values for the out attribute are valid left arguments to dyadic Format or _sfmt, or one of the formats listed in Table 22-3 of the A+ Reference Manual: `ar has (`out;5.1); `ar has (`out;'e 7.2'); `ar has (`out;`minsec); `ar has (`out;); If you are trying to coordinate several things, you may need to perform some action when the screen entry and refresh cycle has been completed. The "done" attribute allows you to specify a callback function for that purpose: `done of `ar f{s;d;i;p;c;v}:(s;d;i;p;c;v) `ar has (`done;(f;'done')); Edit some cells and observe the session log. Now clean up and prepare for the next section: `ar has (`done`naturalsize`col`space`cols;(;;;7;3)) ar14 17; br{`ar;0} 1d. Appearance 1d(i). Separators Attributes: colsep rowsep In the display of ar, there are lines separating the rows and the columns. These lines are controlled by the "colsep" and "rowsep" attributes, whose default values are 1. The value 0 means no separators: `ar has (`colsep`rowsep;(0;0)); `ar has (`colsep`rowsep;(2;3)); `ar has (`colsep`rowsep;(1;1)); 1d(ii). Size Attributes: dynamic editspace hscrollsize respace space scrollsize vscrollsize The "space" attribute determines the width of the cells: `space of `ar `ar has (`space;3); `ar has (`space;); The "respace" attribute controls the automatic increasing of the space attribute. The space attribute is increased if necessary to accommodate the formatted values in all cells when either (1) the respace attribute is 1 and the value of the variable is changed or (2a) respace is reset to 1 or (2b) the out attribute is respecified. The respecification of ar after the illustration of case (2a) is required to fix a known bug in the updating of the display: `ar has (`respace;1;`space;5); ar[0;0]123456789 `ar has (`respace;0); ar[0;0]0 `ar has (`space;5); ar[0;0]123456789 `ar has (`respace;1); arar; `ar has (`respace;0); ar[0;0]0 `ar has (`space;5); ar[0;0]123456789 `ar has (`out;); Now clean up. `ar has (`space;7) ar[0;0]0; br{`ar;0} If you change font or text you may want either to keep the display the same size or to keep the same cells displayed. The "dynamic" attribute lets you make this choice. If it is 1, a font change may cause a change in the size of the display, whereas if it is 0, the display will remain the same size: `dynamic of `ar `ar has (`font;'times-24'); `ar has (`font;'kaplgallant-19'); `ar has (`dynamic;1); `ar has (`font;'times-24'); br{`ar;0} `ar has (`font;'kaplgallant-19'); br{`ar;0} When the "editspace" attribute is 0, the space available for editing a cell is the cell itself. When editspace is 1, the space available is determined by s.EDITSPACE, which has a default value of 256; scrolling in this space is provided automatically. After the first of the following statements, enter enough characters to overflow the cell and then press Escape. Do the same after the second statement, but before pressing Escape use the left and right arrow keys to see the scrolling. `ar has (`editspace;0); `ar has (`editspace;1); The width of the scrollbars can be controlled by three attributes; "vscrollsize" determines the width of the vertical scrollbar and "hscrollsize" the width (height) of the horizontal. The "scrollsize" attribute is vscrollsize, hscrollsize: `scrollsize of `ar `ar has (`scrollsize;5 6); `ar has (`vscrollsize `hscrollsize;(25;28)); `ar has (`scrollsize;15 17); 1d(iii). Color Attributes: colors cycle editbg editfg hscrollbg indexbg refresh rowbg scrollbg selectbg vscrollbg You have already encountered some color controls in the Buttons tutorial. Here are some more. For the background of the scrollbars, there are the "vscrollbg", "hscrollbg", and "scrollbg" (vscrollbg, hscrollbg) attributes. The Null indicates that the value of an s global variable is to be used, as discussed later in the S Global Variables tutorial: `ar has (`vscrollbg `hscrollbg;(`cyan;`yellow)); `ar has (`scrollbg;`lightsteelblue); `ar has (`scrollbg;); The backgrounds of the selected cell, the other cells in the selected row, and the cells in the chosen rows (the rows listed in index) are controlled by the "selectbg", "rowbg", and "indexbg" attributes, respectively: `ar has (`firstrow`firstcol`row`col`index;(0;0;0;0;1 2 3)); `ar has (`selectbg;`mediumseagreen; `rowbg;`rosybrown; `indexbg;`tan); `ar has (`selectbg;`red; `rowbg;`cyan; `indexbg;`bisque); `ar has (`row;1); `ar has (`selectbg`rowbg`indexbg`index;(;;;)); Notice the combinations of colors when the selected row is one of the chosen rows. The "editbg" and "editfg" attributes control the colors in the cell that is being edited: `ar has (`editbg`editfg`edit;(`white;`purple;1)); `ar has (`editbg`editfg;(;)); `ar has (`edit;0;`row;;`index;); The "colors" and "cycle" attribute are used to signal a new value. When an indexed specification is made to the variable, the new value appears successively in the colors indicated by the colors attribute. Each of these colors is shown for the number of milliseconds required by the cycle attribute, a scalar. (Changing a value on the screen by editing causes an indexed specification.) The colors attribute can be functional, in which case it is called once for each changed cell, with the usual arguments: static data, value, index, path, context, unqualified variable name. For example, colors could be determined by the sign of the new value and could be repeated, for a flashing effect, or they could depend upon the column. `ar has (`colors;`red); ar[1;0 1]ar[1;0 1] `ar has (`colors;`red1 `red2 `red3 `red4); ar[1;0 1]ar[1;0 1] f{s;d}:{if (d<0) `red `yellow `red `yellow `red `yellow,4`red else `cyan `blue `cyan `blue `cyan `blue,4`cyan} `ar has (`colors;f); ar[1;0 1]ar[1;0],-ar[1;1] `cycle of `ar `ar has (`cycle;400); ar[1;0 1]ar[1;0 1] `ar has (`cycle;1000); f{s;d;i}:if (2|1i) `red `yellow `cyan `blue else `black `ar has (`colors;f); ar[1;](1 1,151)ar[1;] Suppose an attribute uses a function to provide its value and that function references a global variable. Then a respecification of the global variable will not cause a recalculation, although as elements are changed they will reflect its new value. If you want the entire array to reflect the new value, you must force a recalculation, by means of the "refresh" attribute: FG`blue fgfn{s;d;i;p;c;v}:.FG `ar has (`fg;fgfn); FG`red ar[;1]ar[;1] `ar has `refresh; This characteristic can be useful. If ar were being continually updated from a real-time feed, the first four lines above would initiate the color-coding of updated numbers. Whenever a viewer requests it, a new cycle could be begun by color-coding all numbers as "old" and then setting FG to code updated numbers as "new" again: FG`blue; `ar has `refresh; FG`red; ar[1;1]ar[1;1] See the table section of the Containers tutorial for another example of the use of refresh. Incidentally, a functional value for fg can be used to color-code cells by value, as in the first two statements below: fgfn{s;d}:s[1+d] `ar has (`fg;(fgfn;`red`black`blue)); ar(1+?14 173)?14 17200 `ar has (`colors `fg `refresh;(;;)) ar14 17; 1e. Documentation Attribute: doc This attribute, which has no assigned meaning and no restrictions in s, provides a way of documenting objects (but not functions): `ar has (`doc;("Data tutorial: example";`class of `ar;ar;ar;ar)); `doc of `ar `fgfn has (`doc;"Data tutorial: functional fg; use of refresh shown"); `doc of `fgfn The default value for doc is the value of s.AUTODOC, which is discussed in the s-Context Variables tutorial. _ex `FG `prim_buf `clear_fn `f `fgfn `read_fn `j `arr `g; 2. The Label Display Class The label class is for displaying text that is either a simple character scalar, vector, or matrix or else a nested scalar or vector whose items are simple character scalars or vectors. Labels cannot be edited and never have titles or scrollbars. They typically appear inside containers, where they have no corners or frames, and so blend in. They can be used to give information or instructions, label arrays and windows, display character graphics (dingbats), and so on. lb('s tutorial';'data display classes') `lb has (`class;`label; `dynamic;1; `head;0); show `lb; _ex free `ar; br{`lb;0} Here are two examples of the use of labels in layouts. (Layouts are covered in the Containers tutorial, but you don't really need to know anything about them here; the details are almost all concealed in the auxiliary variables file.) _load{'/usr/local/aplus-fsf-4.22/doc/tutorials/s.tutorials/aux_vars.+'}; lb'Select Trigger Issue(s)' `lb has (`class;`label;`bg;`white); `ld_lo has (`class;`layout;`title;'';`shelltitle;'bsprdaddact._ACT'); show `ld_lo; br{`ld_lo;0} Incidentally, you probably observed that when ld_lo was bound to the layout class lb vanished, since it is contained in ld_lo (by the value of ld_lo, which we have not displayed) and ld_lo was not yet shown. free `ld_lo; lb1,'4' `lb1 has (`class;`label;`font;'zapfdingbats-60';`bg;`gray90;`fg;`green3); t1' Average Life ...'; t2' . . .'; t3' Price variance ...'; lb2(20'FFIEC Tests';30'-';t1;t1;t1;t2;t3;t3;t3;t2) `lb2 has (`class;`label;`justify;'l';`bg;`gray90;`fg;`black,9`gray70); lo1 2`lb1`lb2 `lo has (`class;`layout;`shelltitle;'FFIEC';`title;'';`bg;`gray90); show `lo; br{`lo;0} Notice the fg attribute for lb2. For a label, its value can be a vector, which is used cyclically, with one element applying to each row. _ex `t1 `t2 `t3 `lb `lb1 `lb2, >free `lo; 3. The View Display Class The view class is for simple character matrices that need scrollbars and so are unsuitable for labels. Only fixed-width, or monospace, fonts should be used for horizontal scrolling. View displays have problems with matrices containing tabs, backspaces, linefeeds, etc.; these problems will not be fixed soon, so avoid ASCII control-type characters in any array to be bound to the view class. Views cannot be edited. Here is an example of an output area with initial filler: v20 61'CMOPort ' `v is `view; `v has (`shelltitle;'cmoPortfolioMgr'; `title;'Output area'); show `v; `v has (`xs;766); br{`v;0} _ex free `v; 3a. Accessing the Primary Selection Buffer Attributes: clear notify primary request Text clipped from an Emacs or XTerm window is written in the "primary selection buffer", and text pasted in these windows is retrieved from this buffer. You can use this buffer from A+. To write to the primary selection buffer, you give the "primary" attribute a character value. (Other types of data are quietly ignored; the value of primary remains unchanged.) Since there is only the one buffer, the value of the attribute changes for all objects. To read the buffer, you specify the "request" attribute for a bound object. If primary has been given a proper value, a "notify" event occurs and the buffer can be read by referencing the primary attribute. If the buffer is overwritten by another process (not by an object in this A+ process), the A+ object, if any, whose specification of the primary attribute was overwritten will undergo a clear event. Dragging the pointer over text in an Emacs, Xterm, or FrameMaker window, for example, will cause a clear event. The text that is highlighted can then be retrieved through primary, but text that Emacs demarcated by bouncing the cursor back and forth cannot -- but can, however, after you press the "copy 0 to PRIMARY" button in an xcutsel window. Adapting an example from Larry Rohrs, we first define a set of functions to set primary and request and respond to notify and clear: SetPrimary{s}:{ s .has (`primary;(`row .of s)#%s); 'Copy pressed; set `primary'} SetRequest{s}:{ s .has `request; 'Paste pressed; set `request'} GetPrimary{s;c;v}:{ row0`row .of cv; if (1=row) 'Nowhere to paste' else{ (row#c%v)(1c%v)0`primary .of cv; '`notify event; got `primary'}} Clear{s}:'`clear event for ',s Now define a function to set up a layout with a view and two buttons and to set callbacks: Define{sym}:{ sym .is `view; sym .has (`notify;GetPrimary); sym .has (`clear;(Clear;sym)); (sym%`Layout)((sym`CopyBtn),sym`PasteBtn;`sym); (sym`CopyBtn) .is `button (sym%`CopyBtn) (SetPrimary;sym); (sym`PasteBtn) .is `button (sym%`PasteBtn)(SetRequest;sym); (sym`Layout) .is `layout; show sym`Layout;} Specify two variables and have Define set them up and display them: Define `sample1 sample15 5 Define `sample2 sample2105 5 br{`sample2.Layout;0}; br{`sample1.Layout;0,10+>`xs of `sample2.Layout}; Click on a line in sample1 and press its Copy button. Then click on a line in sample2 and press its Paste button. Click on another line in sample2, press its Paste button, and see the same text entered on that line. Select some text in an Xterm or an Emacs session and notice that a clear event took place for sample1. Press either Paste button; if the selected text is highlighted, it is put in the selected row; otherwise, request is set but there is no notify event. Try some other experiments with these objects and see the results on the screen and in the A+ session log. _ex free `sample1.Layout `sample2.Layout; _ex `SetPrimary`SetRequest`GetPrimary`Clear`Define; 4. The Page Display Class Attributes: blink blinkrate bold box boxcolor color colormap line underline Character matrices can be bound to the page display class, which is designed for displaying page-based information from data services. There are no scrollbars, and the firstrow, firstcol, rows, and cols attributes do not apply to page objects. First, here is a small sample page with the default display: ld_pg show `ld_pg is `page; br{`ld_pg;0} The "underline" attribute takes a boolean mask showing which characters are to be underscored. It is functional. For page, a nonfunctional setting of any functional attribute is treated as if it were reshaped to the shape of the underlying character matrix. A functional setting should always be a value with the same shape as the underlying character matrix. First, we define a function to produce a mask from a set of row index, column index, extent triplets (the static data). By making it mask out blanks, we can underline the title by underlining the whole first row, so that no change is needed in the attribute when we change the title: msk{s;d;i;p;c;v}:{u(c%v)0; (,u)[((u)[1]0#s)+(1#s)+ɡ2#s]1; u^(c%v)' '} `ld_pg has (`underline;(msk;,<0 0 58)); ld_pg[0;]58' Mergers and Acquisitions' The "line" attribute allows vertical and horizontal lines to be drawn. The vertical lines can be used, among other things, as column dividers, with or without a box around them. The line attribute takes an n by 4 integer matrix. Each row contains index of first row, index of first column, number of rows, number of columns. For a horizontal line the third of these is zero and for a vertical line the fourth is zero. Settings are not cumulative; they erase previous settings. The commas here are of course not necessary; they just make the expression easier to read: `ld_pg has (`line;4 4 6 20 0 18,12 17 2 0,12 29 2 0,12 41 2 0); The "colormap" attribute takes a two-column matrix of color symbols. Each row represents a foreground, background pair. The "color" attribute, which is functional, allows you to color each character on the page individually. It can be a matrix of indices into the colormap value. The foreground and background colors are never set directly. If color has not been set, then the first pair of colors in colormap are used throughout the page: `colormap of `ld_pg `ld_pg has (`colormap;2 2`blue`white `brown`green); `ld_pg has (`colormap;2 2`black`gray `red`white; `color;(msk;,<3 0 6)); The "blink" attribute also takes a mask and is functional. The "blinkrate" attribute is a scalar integer that tells in milliseconds the rate at which the designated characters are to blink: `ld_pg has (`blink;(msk;,<3 0 6)); `blinkrate of `ld_pg `ld_pg has (`blinkrate;750); Another attribute that is functional and uses a mask is "bold"; it governs which characters appear in boldface: `ld_pg has (`bold;(msk;(3 7 7;3 38 14;8 4 14;9 4 17))); Finally, you can draw a set of boxes on the page display using the "box" attribute, whose value is an n by 4 matrix with rows containing row index, column index, row extent, column extent. You can choose the colors for these boxes by means of the "boxcolor" attribute. Its value is a vector; if there are fewer elements in boxcolor than there are boxes, the colors of the excess boxes remain unchanged. Thus the second and third statements below are equivalent: `ld_pg has (`box;2 4 8 0 3 58, 12 4 2 50); `ld_pg has (`boxcolor;<,`green); `ld_pg has (`boxcolor;<`green`black); 4a. User Input Attributes: cursor key keysym rband rbandbox 3down 3up 2down 2up Page objects cannot be edited directly. No cursor is shown for them, but there is a "cursor" attribute, which is set to the row and column of the pointer on the page when any mouse button is pressed. Press various buttons with the pointer at various locations on the page; after each button press, press F2 with the cursor on the following statement, and see the values in the A+ session log: `cursor of `ld_pg You can simulate a cursor by means of the blink attribute. It is up to you to move this "cursor" based on the key press and mouse button events. You can use the "key" attribute to set a callback on key presses. The "keysym" attribute is for reference only. Its value is of the form (k;s), where k is the ASCII code of the last character pressed, and s is a boolean vector of eight integers indicating which modifier keys were pressed when the key press event occurred. The modifiers are: Shift, Caps Lock, Control, mod1, mod2, mod3, mod4, mod5 where mod1 is Meta, mod2 is NumLock and mod4 is Alt. Set the key attribute, then press various key combinations (with the pointer in the page window) and see the value of keysym in the A+ session log: f{}:`keysym of `ld_pg `ld_pg has (`key;f); There are four attributes with callback for mouse-button presses: "3down", "3up", "2down", and "2up". Set the callbacks and then press and release the middle and right mouse buttons (again, with the pointer on the page) and see the callbacks recorded in the A+ session log: m{s}:s `ld_pg has (`2up`2down`3up`3down;((m;`2up);(m;`2dn);(m;`3up);(m;`3dn))); You can draw a rubber-band box by placing the pointer anywhere in the page, pressing and holding the left mouse button, moving the pointer anywhere in the page that you want (even not moving it), and releasing the button. A box is shown continuously during this process, starting at the upper lefthand corner of the character space on which you pressed the button. When you release the button, the row and column indices of the upper lefthand corner of the box and the row and column extents are placed in the "rbandbox" attribute, displacing any box specification that might have been there. If you release it anywhere in the same character row or column, the extent will be zero. Try drawing several boxes, pressing the F2 key on the following statement after each: `rbandbox of `ld_pg What else happens depends when a box is drawn depends upon the "rband" attribute, which has a default value, 0, and a default callback, specified by the Null. Execute the next two statements. Then draw some more boxes, some of them with zero area, executing the third statement after each box is drawn: `rband of `ld_pg `ld_pg has (`rband;); `rbandbox `box of `ld_pg Notice that each box specification is placed in rbandbox and that the ones that have non-zero extents in both directions are also appended to the box attribute, reflecting the fact that these boxes remain on the page. You can define your own callback function for rband. If you do so, the latest box specification is still placed in rbandbox, but box is not automatically changed (so the box does not remain automatically on the screen when the mouse button is released). As you have probably observed, there is a strong similarity in this regard between the rband/box behavior and the refer/index behavior. Let's define a callback function for rband to color the delineated area differently. First get rid of all but the original boxes, add a color pair to colormap, and change the value of color from a function and its static data to a boolean mask: `ld_pg has (`box;2`box of `ld_pg); `ld_pg has (`colormap;(`colormap of `ld_pg),`blue`lightgrey); `ld_pg has (`color;msk{<3 0 6;;;;`;`ld_pg}); Execute these statements to specify a callback function for rband: rb{}:{(b1;b2;b3;b4)`rbandbox of `ld_pg;(i1;i2)ɡld_pg; m((i1b1)^i18)/g)`; g8 8g; 'abcdefgh '[`a`b`c`d`e`f`g`h` g] `sl has (`geometry;g); show `sl; br{`sl;0, 10+>`xs of `s} Now clean up: _ex ld_names,`f`g`mreal`rlbl`clbl,s.reset{}; _ex `ld_names; aplus-fsf-4.22/src/tutorials/s.tutorials/introduction0000644000265000001440000003562110774504523016604 Introduction to Screen Management Tutorials Besides this introduction, there are eight tutorials on screen management topics: Buttons, Data, Menus, Containers, Graphs, Special Input and Displays, Printing, and s-Context Variables. They are meant to be studied in the order just given. They treat all display classes and all attributes. These tutorials are intended to be introductory, to enable you to learn the rudiments of the screen management system, s, and to get started doing some actual programming in it -- which is itself the best way to learn. Consequently, they have been kept as simple as reasonably possible: Generally, each attribute is discussed in the context of only one display class. Some details of its use or its values may be left out. For example, the matrix form for specifying the value of the label attribute is omitted. Some complexities are glossed over; therefore, code which behaves in a certain way in an example may not behave in the way you expect under other circumstances. The order in which attributes are specified within a single statement, for instance, may have a substantial effect on the resulting display. All or part of the response of A+ to an input is often omitted. This omisssion makes it easier to run through an example pressing the F2 key on on each input line and eliminates a great deal of repetitive material. You can see the response on the screen in the A+ session log when you execute the examples. You can reduce the response still further by executing s.QUIET1, which suppresses s information messages but not error reports. Alternate ways of doing things are often not included. The ones discussed are considered common or useful, but there may often be ways that are simpler or otherwise more desirable than the ones mentioned here. You should consult the A+ Reference Manual when you need to know whether a certain attribute applies to a particular display class or what the full set of its possible values is, when there seems to be some inconsistency, when you want to do something that seems difficult or impossible from the descriptions given here, and so on. After you have absorbed the material in the tutorials, it might be helpful to browse in the manual, or even read it through. If you get an A+ error message and a star in the next prompt, perhaps because you pressed F2 on an output line or or a line of text or you entered an erroneous statement, you should immediately clear the error by entering . To enter this character, press the right-bracket key while holding down the Meta key (on Sun keyboards) or the Alt key (on IBM keyboards). There are two equivalent Meta keys, usually marked with diamonds and located on either side of the space bar. The right bracket key is the second one to the right of "p". ( "[ ]" are brackets, "( )" are parentheses, and "{ }" are braces.) If your session gets messed up for some reason or other, enter $off, press F4 when the session has ended, execute the $load s, scr..., and br{...}:... statements, and go on either from the beginning or from the spot where the variables and functions you need in order to continue are defined; this is often right after previously used variables have been expunged (using _ex). Visibility One problem in an s tutorial is maintaining the visibility of the tutorial and the A+ session log, despite the displays. To do this as much as possible, we keep the displays at the bottom right. Your Emacs session should be at the top left of your screen, and you should have just the tutorial showing in it initially. Then you press F4, starting A+ if necessary and displaying the A+ buffer below the tutorial buffer. When point in the A+ buffer (the location where the cursor would be if it were in that buffer) is not at the end of the file, the buffer does not scroll as you press F2 with the cursor in a line of the tutorial. Consequently, the current line in the A+ log will go off the bottom of the buffer and become invisible. To remedy this situation, move point to the end. One way to do this is to press R2, End, R2. Another way is to click the left mouse button with the pointer on the last line of the log and then to return by clicking with the pointer in the appropriate line of the tutorial; if the end of the log is not visible, click with the pointer anywhere in the log and press End, then return. Display Classes and Attributes The A+ screen management system, called s, includes twenty-four "display classes" in Version 2. These classes are intended for various purposes, and they display or use the values of various kinds of A+ variables or functions. The immediately obvious differences among them are in appearance. There are eight tutorials on the display classes, grouping ones that are similar, and treating separately the most elaborate one (graphs), the printing utility, and the variables that control defaults. All except the one on graphs are in the same directory as this introduction, (Install_Directory)/doc/tutorials By default the Install_Directory is /usr/local/aplus-fsf-x.xx (where x.xx is version.release) i.e. /usr/local/aplus-fsf-4.22/doc/tutorials Their names and their coverage are: * buttons, the classes showing arrays of buttons: action, button, check, and radio; * data, the classes for ordinary data display and, for some of them, input: array, label, matrix, page, slot, view; * menus, the classes showing menus, immediately or on request: choice, hmenu, vmenu; * containers, the classes which enclose other classes: hpane, layout, table, vpane, and window; * A+_installation_dir/tutorials/graphs (a directory: see the files in it), graph, an elaborate container class that deserves its own tutorial; * special_io, the classes for special text input of various kinds -- command, password, text -- and special kinds of display -- scalar, tree. * printing, the facilities that enable you to put an image of a display in a Postscript file, suitable for printing; * s_context_vars, the means for setting defaults. Associated with a displayed variable are "attributes", which play a very important role in s. They are set using the is and has functions and queried using the of function, as you will see in the Buttons tutorial. We can distinguish five typical kinds of attribute: * Attributes that are for reference only. Values cannot be specified for them; they can only be queried. * At the other extreme, attributes that are only triggers for action. Such an attribute triggers its action whenever any value is specified for it. Specifying the Null (no apparent value) or perhaps 1 for them might make your code as clear as possible; when you are setting only one attribute you can simply say `a has `attr. Some of the action attributes do not retain a value and cannot be queried. * Attributes that govern yes/no or on/off decisions. They effectively accept just boolean values, 1 and 0. For some of them, specifying the Null directs s to use the boolean value of an associated variable. * Attributes whose values are members of some well-defined set, such as left, right, top, bottom. * Attributes whose values lie in a range of numbers or are arbitrary text. Furthermore, an attribute can be * persistent, meaning that values can be specified and are retained when a variable is not bound to a display class; and, independently, * functional, meaning that a function can be specified for the attribute, not just a (data) value or a variable. Each individual attribute is discussed either in the tutorial on printing or with the first display class for which it is truly relevant or most general or useful for an example. If you want to review what was said about an attribute, or if you are not new to s and want to learn about a particular attribute, consult the following lists. They tell you where a discussion of it can be found: in which tutorials and, in the third list, which sections. In attributes for graphs, a leading x implies also X, y, and Y, or just X, when appropriate, and a leading y implies Y when appropriate. These attributes are discussed in the Graph tutorial: addtexttrace addtrace axis barwidth bottom coordinate Coordinate copytexttrace copytrace fillcolor footnote footnotefg footnotefont footnotejustify gradient grid gridfg gridstyle gridwidth left legend legendbg legendfg legendfont legendhlthickness legendshadowthickness legendstyle linecolor linestyle linewidth mode movelimit referpoint right rule rulewidth selectable selectdistance style subtitle subtitlefg subtitlefont subtitlejustify symbol symbolsize textactivate titlejustify top xaxis xextent xfg xinc xlabel xlabelfont xlabelheight xlabeljustify xlabelout xlabelwidth xleft xlegend xmajorticksize xmax xmin xminorticks xminorticksize xright xsublabel xsublabeljustify xsublabelout xtickstyle xtitle xtitlefg xtitlefont xtitlejustify yaxis ybottom ylabeljustify ylegend ymode ytitlestyle ytop zero zerofg zerostyle zerowidth The attributes discussed in the Printing tutorial are: print printbottom printdisbottommargin printdisfile printdisfont printdisleftmargin printdisorientation printdisrightmargin printdisrulewidth printdisstyle printdistopmargin printfile printfont printlayout printleft printmode printorientation printright printsize printtop The other attributes can be found in this list. Each is discussed in the tutorial named with it, in the display class whose initial is given after the name of the tutorial: acceptfocus: Containers l active: Data a ancestors: Containers l at: Containers l atsector: Buttons a b: Containers l bg: Buttons a blank: Data a blink: Data p blinkrate: Data p bold: Data p bound: Buttons a box: Data p boxcolor: Data p buffer: Special c build: Containers l C: Buttons a children: Containers l class: Buttons a clear: Data v col: Data a colindex: Data m colindexbg: Data m collabelrows: Data m color: Data p colormap: Data p colors: Data a cols: Data a colsep: Data a colspace: Data m copy: Data a cornerindex: Data m cornerindexbg: Data m cursor: Data c cycle: Data a def: Data a delete: Data a descendents: Containers l doc: Data a done: Data a dynamic: Data a edit: Data a editbg: Data a editfg: Data a editspace: Data a evaluate: Data a execute: Data a exit: Buttons a f1 - f12: Buttons a familytree: Containers l fg: Buttons a field: Containers t fields: Containers t fill: Special p firstcol: Data a firstfield: Containers t firstrow: Data a fixedfields: Containers t fkeys: Buttons a focus: Containers l followers: Buttons a followertree: Buttons a font: Containers t foot: Buttons a freeze: Containers l geometry: Buttons a h: Containers l H: Containers l head: Buttons a hide: Buttons a hl: Buttons a hlthickness: Buttons a hscrollbg: Data a hscrollsize: Data a icon: Buttons a iconic: Buttons a icontitle: Buttons a in: Data a index: Data a indexbg: Data a insertabove: Data a insertbelow: Data a is: Buttons a justify: Buttons a key: Data c keysym: Data p l: Containers l label: Buttons a labelfg: Buttons a labelfont: Buttons a leader: Containers l leftfoot: Buttons a line: Data p lockposition: Containers l locksize: Containers l lower: Buttons a mapped: Containers l margin: Buttons b na: Data a naturalsize: Buttons b, Data a newshow: Containers l notify: Data v out: Data a parent: Containers l pin: Buttons a position: Containers l preset: Buttons a primary: Data v protect: Data a protected: Containers t r: Containers l R: Buttons a raise: Buttons a rband: Data p rbandbox: Data p realize: Data a refer: Data a refresh: Data a reparent: Containers l request: Data v reshow: Containers l resize: Containers l resizeable: Buttons a respace: Data a rightfoot: Buttons a row: Data a rowbg: Data a rowindex: Data m rowindexbg: Data m rows: Data a rowsep: Data a save: Special t script: Buttons a scrollbg: Data a scrollsize: Data a select: Data a selectbg: Data a selectcol: Data m selectcorner: Data m selected: Buttons a selectedfield: Containers t selectfield: Containers t selectrow: Data m sensitive: Containers l set: Buttons a settings: Buttons a shadowthickness: Buttons a shell: Containers l shelltitle: Buttons a show: Buttons a size: Data a space: Data a stars: Data a state: Containers l stateself: Buttons a structure: Containers l t: Containers l tabfrom: Containers l tablist: Containers l tabto: Containers l 3down: Data p 3up: Data p title: Buttons a titledefine: Containers t titlefg: Buttons a titlefont: Buttons a 2down: Data p 2up: Data p underline: Data p valid: Special p validate: Special p vcol: Containers l vcols: Containers l verify: Buttons a vrow: Containers l vrows: Containers l vscrollbg: Data a vscrollsize: Data a w: Containers l W: Containers l ws: Buttons a x: Buttons a X: Containers l xs: Buttons a y: Buttons a Y: Containers l ys: Buttons a yx: Buttons a YX: Containers l yxs: Buttons a The savewm attribute has been removed. aplus-fsf-4.22/src/tutorials/s.tutorials/menus0000444000265000001440000001761407232116735015211 The Menu Display Classes 1. The Choice Display Class 2. The Hmenu and Vmenu Display Classes --------------------------------------------------- 1. The Choice Display Class The choice class, like the radio class, is for boolean-valued slotfiller variables whose value part contains one and only one 1. The radio display may perhaps be more appropriate when the choices are few or choosing is done often, the choice display when there are many choices or choosing is seldom done. The choice representation has three parts, a title area on the left, a button in the middle invoking a pulldown menu, and a value area on the right. The pulldown menu consists of label areas, which hold either the value of the label attribute or, if that is null, the symbolic indices of the slotfiller. The value area holds the label or symbolic index for the only slotfiller value that is 1. In the following example, notice that: when the label attribute is null, the symbolic index is used; when the label attribute is given a non-null value, neither the size of the window nor the display in the value area changes; when the value part of c is respecified, the display in the value area is changed but the size of the window remains unchanged; when naturalsize is specified, the value area is enlarged and all of the label is shown. $load s scrs.SCREEN-34 12 br{w;m}:{w has (`yx;scr-m+`yxs of w);} c(`fut `opt `ind;(1;0;0)) `c has (`class;`choice; `shelltitle;'QList Products'; `title;'Type'); show `c; br{`c;100} `label of `c `c has (`label;(`Future;`Option;`Index)); (1c)(1;0;0) `c has `naturalsize; br{`c;100} If instead of respecifying the value part of c you had made a choice from the menu, the effect would have been the same. The instant you pressed the left mouse button with the pointer on the choice button, the display in the value area, but not its size, would have changed. Starting fresh and reversing the order of the last two statements, you see that specifying naturalsize increases the window size but does not change the display in the value area; that display is changed by a respecification of the underlying variable (and could have been done by a choice from the menu): _ex free `c; c(`fut `opt `ind;(1;0;0)) `c has (`class;`choice; `shelltitle;'QList Products'; `title;'Type'); show `c; br{`c;100} `c has (`label;(`Future;`Option;`Index)); `c has `naturalsize; br{`c;100} (1c)(1;0;0) What these two examples really demonstrate, of course, is that you want to set the label attribute before realizing or showing the object. Now make a selection in two different ways. For the first selection, place the pointer on the choice button, press the left mouse button, move the pointer down the menu that appears, and release the button when the pointer is on Option or Index. For the second, again place the pointer on the choice button, then click the left mouse button, use the up and down arrow keys to move around the menu, stop at Future, and press Enter. So far we have been dealing only with appearances. To provide a response to any menu selection, you must set a callback function. Selecting an item in the menu amounts to selecting a symbolic index of the slotfiller and causes a value change in the underlying variable. When an item is selected, if the value at that symbolic index is 0, then it becomes 1 and the value that was 1 becomes 0. In addition, the menu disappears and the selected symbolic index or label is displayed in the value area. Because of this value change, any callback function defined for the variable is called whenever a new item is selected; the path argument p is the symbolic index to the changed value. Although there are actually two value changes, the callback function is called only once, and its path argument refers to the value that changed from 0 to 1. Set a callback function that just displays the arguments that are passed to it: f{s;d;i;p;c;v}:{'-----------';(s;d;i;p;c;v)} `c has (`set;(f;'choice')); Make some choices and watch the responses that appear in the A+ session log. If you choose a menu item that already has the value 1, no callback occurs. On the other hand, a callback always occurs for a change made by an A+ statement, and all respecified values are included in it. Furthermore, the index and path arguments reflect the statement executed, so they are different for the third and fourth statements below although the actions called for by these statements are identical: c(`fut `opt `ind;(0;1;0)) (1c)[0 1](0;1) (1c)[1]<1 (`optc)1 _ex free `c; 2. The Hmenu and Vmenu Display Classes The hmenu and vmenu display classes are designed to represent nested slotfillers as cascaded menus. A nested slotfiller is a slotfiller some of whose values are also slotfillers, perhaps nested slotfillers. There is no limit to the level of nesting. In contrast to a choice display, the top-level menu is continuously shown, laid out horizontally in hmenu and vertically in vmenu, but without any indication of the last selection. All submenus are pulldown and are arranged vertically in both classes. The items shown in the top-level menu are the symbolic indices of the slotfiller. If a value is also a slotfiller, then its symbolic indices are shown in the corresponding submenu. If a callback function is set on the nested slotfiller, a callback occurs whenever a menu or submenu item is selected. When the function is called, only pd is given in the second argument (data), where d is the underlying slotfiller. Incidentally, these classes can be used with non-nested slotfillers to provide buttons that have no outlines unless pressed: c(`fut `opt `ind;(0;1;0)) `c has (`set;(f;'hmenu')); show `c is `hmenu; br{`c;100} Click on the symbolic indices in the hmenu window. Shadowed outlines will appear around them and callback output will appear in the session log. Do the same for this vmenu: `c has (`set;(f;'vmenu')); show `c is `vmenu; br{`c;100} Here is a more complicated example, with irregular levels of nesting: _ex free `c; c(`file`edit`charformat;( (`new`open`close`save;(;;; (`save`save_as`save_all;(;;)))); (`copy`cut`paste`undo;(;;;)); (`font`size`style;( (`kaplgallant`courier`times`palatino`helvetica;(;;;;)); (`10`12`14`17`24;(;;;;)); (`regular`italic`bold;(;;)))))) show `c is `hmenu; br{`c;150 100} When you click on an item that has an arrowhead, its submenu appears. When you click on an item without an arrowhead, a selection takes place and any displayed submenus vanish. You can also drag the pointer, holding the mouse button down. In a horizontal menu, a submenu appears whenever you are in an item that has one; in a vertical menu, a submenu appears whenever the pointer is on an arrowhead. If you place the pointer in the hmenu window, the left and right arrow keys move you from item to item in the top-level menu and the down arrow key moves you to a submenu when you are on an item that has one. In the submenus, the up and down arrow keys move you among items, the left arrow key moves you back to the parent menu, and the right arrow key moves you to a submenu when you are on an item that has one. The Escape key aborts the operation. The Enter key makes a selection if you are on an item with no submenu, and otherwise aborts the operation. Try these keys. Then set the callback function and see the results of your selections. `c has (`set;(f;'hmenu')); A vmenu is handled in the same way, except that the keys act the same for the top-level menu as for the submenus, since it is also vertical. Execute the next two statements and then try some selections. show `c is `vmenu; br{`c;150 100} `c has (`set;(f;'vmenu')); _ex free `c; aplus-fsf-4.22/src/tutorials/s.tutorials/printing0000444000265000001440000002574207232116745015716 Printing Display Objects 1. Generating a Print File Attributes: print printdisstyle printdisfile printfile 2. Size and Position 2a. Paper Size Attribute: printsize 2b. Margins 2b(i). For the Object Attributes: printbottom printleft printright printtop 2b(ii). For the Disclaimer Attributes: printdisbottommargin printdisleftmargin printdisrightmargin printdistopmargin 2c. Justification and Size of the Object Attribute: printlayout 2d. Disclaimer Rules Attribute: printdisrulewidth 3. Orientation Attributes: printdisorientation printorientation 4. Color and fonts 4a. Color Attribute: printmode 4b. Fonts Attributes: printdisfont printfont --------------------------------------------------- 1. Generating a Print File Attributes: print printdisfile printdisstyle printfile There are provisions in s for printing an object that is displayed on the screen. On request, s generates a PostScript file, which you can send to a printer. Although room is left for them, scrollbars are not shown, since they would have no use. First, load s, define a positioning function, and construct and show a layout to be used as an example throughout this tutorial: $load s scrs.SCREEN-34 12 br{w;m}:{w has (`yx;scr-m+`yxs of w);} p((2)99)100 tttp,55 >1 2 3ϡ

(d;-d)+`printdisrulewidth of `l `l has (`printdisrulewidth;10; `printlayout;`center; `print;1); `l has (`printdisrulewidth;0); 3. Orientation Attributes: printdisorientation printorientation The "printorientation" and "printdisorientation" attributes pertain to the orientation, landscape or portrait, of the object and the disclaimer, respectively. If printdisorientation is `none or if printdisstyle is `append, the disclaimer orientation is the same as the object orientation. `printorientation `printdisorientation of `l `l has (`printdisorientation;`portrait; `print;1); `l has (`printorientation;`portrait; `print;1); 4. Color and fonts 4a. Color Attribute: printmode The "printmode" attribute allows you to choose the color characteristics of the object, and only the object, in the PostScript file, although of course the actual color will depend upon the printer used. Since we specified the color option for ghostview, you will see full color here when it is specified. The possible values are `mono (black and white, the default), `reverse (black and white reversed), `colorfg (the colors specified by fg attributes, with a white background), and `color. You obtain grayscale by specifying color and printing the PostScript file on a non-color printer. `printmode of `l `l has (`printmode;`reverse; `print;1); `l has (`printmode;`colorfg; `print;1); `l has (`printmode;`color; `print;1); 4b. Fonts Attributes: printdisfont printfont The "printdisfont" attribute specifies the font used for the disclaimer: `printdisfont of `l `l has (`printdisfont;'times-roman-12'; `print;1); The "printfont" attribute specifies the printer font to be used for any display font that is unavailable on the printer, such as manfnt.85: `printfont of `l `t has (`font;'manfnt.85'); `l has `print; `l has (`printfont;'palatino-roman'; `print;1); _ex `p`s`d,free `l; To dismiss ghostview, press q with the pointer in its window. aplus-fsf-4.22/src/tutorials/s.tutorials/s_context_vars0000444000265000001440000010133007232116756017113 s-Context Variables 1. Introduction 2. Switches 2a. General Display Variables: s.AUTOEVALUATE s.AUTORESPACE s.AUTOTITLEDEFINE 2b. Input Variables: s.AUTOCOPY s.AUTOEDITSPACE s.AUTOEXECUTE 2c. Containers Variables: s.AUTOBUILD s.AUTONEWSHOW s.AUTOPOSITION 2d. Multiple Windows Variables s.AUTOREPARENT s.AUTORESHOW s.AUTOWS 2e. Saving Variable: s.AUTOSCRIPT 3. Parameters 3a. General Display Variables: s.AUTOBLANK s.BEEP s.DATASPACE s.WP s.WSNAME 3b. Input Variables: s.EDITSPACE s.NA 3c. Graphs Variables: s.FILLCOLORS s.LINECOLORS s.LINESTYLES s.TRACESYMBOLS 3d. Multiple Windows Variables: s.SHELL s.WS 3e. System Response Variables: s.ABORT s.BUSY s.CLOCK s.CONNECTED s.ERROR s.EXIT s.GRAY s.MSG s.QUIET s.VERIFY 3f. Miscellaneous Variables: s.AUTODOC s.SCREEN 4. Attribute Default Variables Variables: s.BLACK s.BLUE s.GREEN s.GRAY s.ORANGE s.PURPLE s.RED s.WHITE s.YELLOW s.FONT 5. Data Variables Variables: s.COLOR_NAMES s.COLOR_NUMBERS s.FONT_NAMES --------------------------------------------------- 1. Introduction There are some fifty global variables that are defined in the s context to provide defaults, parameters, system control, and so on. They fall into four categories: boolean switches, general parameters, system attribute default variables, and informational data variables. 2. Switches The s-context boolean switches correspond to attributes in a way that is obvious from their names: the name of the corresponding attribute is the string following s.AUTO, changed to lower case. Thus s.AUTORESPACE corresponds to respace. These switches provide defaults for their attributes. When an attribute that has a corresponding global switch is set to Null for an object or has an initial default value of Null, the value of that attribute for the object is set to the value of the corresponding switch. That value will be shown and used as the value of the attribute, but the fact that the attribute was Null is remembered, and if the switch is changed later the attribute value will be changed likewise. The switches are grouped here by function to help you survey what is available. The meaning of each of them is briefly described; more details can be found by looking up the corresponding attribute in an earlier tutorial or the reference manual. The examples given here not only show the operation of the switches but also reinforce the discussions of the attributes in the other tutorials. 2a. General Display Variables: s.AUTOEVALUATE s.AUTORESPACE s.AUTOTITLEDEFINE These switches are the defaults for attributes that dictate whether: - a variable is evaluated in order to determine appropriate attributes for its display (evaluate is effectively 1) or is not evaluated (evaluate is 0); - an object's space attribute is increased when exceeded by the result of the default out function (respace is 1) or is not (respace is 0); - a dependent object's default title (to be used when the title is set to Null) is its definition (titledefine is 1) or its name (titledefine is 0). The default for s.AUTOEVALUATE is 1; for the other two, the default is 0. As for the attributes, the default for evaluate, respace, and titledefine is Null. Thus they all take their values from the corresponding s-context variables. Let's take the last one as an easily visible example. (The shelltitle changes also, although you might not expect it to. The titledefine attribute is to be eliminated in Version 3.) $load s scrs.SCREEN-34 12 br{w;m}:{w has (`yx;scr-m+`yxs of w);} a4 4; b1+a; c:ab show `c; br{`c;0}; s.AUTOTITLEDEFINE `titledefine `title of `c Because titledefine has the default value Null, s sets it to the value of s.AUTOTITLEDEFINE. If we change that value, then s remembers that titledefine was Null, and changes its value accordingly, as shown by the result of setting the title attribute to Null and by the result of the of function for `titledefine: s.AUTOTITLEDEFINE1 `c has (`title;); `titledefine `title of `c 2b. Input Variables: s.AUTOCOPY s.AUTOEDITSPACE s.AUTOEXECUTE These switches give the defaults for attributes that specify whether: - when a row is inserted above or below an existing row the values in the new row are na's (copy is effectively 0) or are copies of the values in the existing row (copy is 1); - the space for editing in a cell is the value of s.AUTOEDITSPACE (editspace is 1) or the value of the space attribute (editspace is 0); - input expression are executed (as A+ expressions) to obtain a value (execute is 1) or not (editspace is 0). The default for s.AUTOCOPY is 0; for the other two, the default is 1. As for the attributes, the default for copy and execute is Null and for editspace 1. Thus, for a given variable, editspace has to be set to Null for s.AUTOEDIT- SPACE to be effective, whereas s.AUTOCOPY and s.AUTOEXECUTE are effective by default. To reinforce the point about the distinction between the value of an attribute, which you can see, and the source of the value, which you can't necessarily see, consider the following sequence. Recall that the execute attribute governs whether an entry in a cell is executed or not, that is, whether it can be an A+ expression, as opposed to, say, just a number. _ex >free `c; show `a`b; br{`a;0,10+>`xs of `b}; br{`b;0}; > `execute of `a`b s.AUTOEXECUTE0 > `execute of `a`b `a has (`execute;1); s.AUTOEXECUTE1; > `execute of `a`b Same value, s.AUTOEXECUTE0 but not same source, > `execute of `a`b as you can see. When an attribute name is preceded by a period in a "has" statement, what is associated with the attribute is not the present value of the variable that is named but the variable itself. The function s.usedBy reports such explicit "electrical" connections: it lists the variables (if any) that were specified for the attributes named in its left argument and the object named in its right argument. As shown in the following statements, it does not report any variables whose use was initiated implicitly by setting the attribute to Null (because that information is in the toolkit and is not available to the s processor). The first line below connects the execute attribute for both a and b to the variable s.AUTOEXECUTE, but in different ways: `a has (`execute;); `b has (`.execute;`s.AUTOEXECUTE); `execute s.usedBy `a`b _ex free `a`b; 2c. Containers Variables: s.AUTOBUILD s.AUTONEWSHOW s.AUTOPOSITION These switches provide the default values for attributes that control whether: - in a layout defined by a simple vector of symbols, the objects are placed: - in a single column (build is 0), or - in the relative positions in which they are already shown, any objects that are not on the screen being put in a pile at the top left (build is 1); - when an object is newly placed in a container, it is shown: - always (newshow is 1), or - only if the object was already shown elsewhere (newshow is 0); - in a layout whose build attribute is 0 (perhaps from s.AUTOBUILD) and which is defined by a simple vector of symbols, the objects are placed: - vertically, in a column (position is 1), or - on top of each other (position is 0). The default value for s.AUTOBUILD is 0, for s.AUTONEWSHOW 0, and for s.AUTOPOSITION 1. The default value for the build attribute is Null, for newshow 0, and for position 1. Therefore, of the three, only build will take its value from the s-context variable by default; the others must be set to Null to make the switch effective. To illustrate: abcde6 8 l`a`b`c`d`e show `l is `layout; br{`l;0} free `l; s.AUTOBUILD1 Reflected in build, because default for build is Null. show `a`b`c; br{`a;40+`yxs of `c}; br{`b;(40+`ys of `c),0}; br{`c;0} show `l is `layout; br{`l;0} `a has (`raise;1); a is under d and e; raise it (title changes from e to a). s.AUTOBUILD0; free `l; _ex `l; l`a`b`c; `l is `layout; `l has (`newshow;); Needed to make newshow reflect s.AUTONEWSHOW. show `l; `l br 0 l`a`b`c`d`e; `l br 0 d and e were not shown, so they are not shown in l. s.AUTONEWSHOW1; `l br 0 l`a`b`c l`a`b`c`d`e; `l br 0 Now d and e are shown, since newshow is 1 for l. free `l; _ex `l; l`a`b`c; `l is `layout; `l has (`position;); Make s.AUTOPOSITION effective. show `l; `l br 0 Vertically aligned. s.AUTOPOSITION0 l() Notice that a, b, and c are reparented and become top-level. l`a`b`c; `l br 0 Make the three arrays be placed in the layout afresh. `a has (`raise;1); a is at the bottom. b is under there, too; you can check. 2d. Multiple windows Variables: s.AUTOREPARENT s.AUTORESHOW s.AUTOWS These switches provide the default values for attributes that determine whether: - an orphaned child is reparented to be a top-level object (reparent is 1) or freed (reparent is 0); - a reparented child is shown if it was shown in its former parent (reshow is 1) or not shown (reshow is 0); and - an object being shown initially can be the screen workspace (ws is 1) or not (ws is 0). The default for all three variables is 1 and for all three attributes is Null. See the effect of setting them to 0, being sure to read what appears in the A+ session log after each respecification of l: s.AUTOPOSITION1; free `l; show `l is `layout; `l br 0 s.AUTORESHOW0 l`b`c; `l br 0 a is reparented but not reshown: top-level but hidden. show `a; And here is a. s.AUTOREPARENT0 l`c; `l br 0 b is freed, not reparented. s.AUTOWS0 free `l`a; show `l is `layout; `l br 0 Notice that this time, unlike previous times,l was created as a popup, as you can see from its pin. 2e. Saving Variable: s.AUTOSCRIPT This switch provides the default for the attribute that governs whether a definition appears for the object in the result of s.script{} (1) or not (0). The default is 1 and the default for the script attribute is Null. See the Buttons tutorial. 3. Parameters The s-context parameters are global variables that give default values for attributes, control certain aspects of system behavior, and so on. 3a. General Display Variables: s.AUTOBLANK s.BEEP s.DATASPACE s.WP s.WSNAME s.AUTOBLANK contains the default value to be displayed for a na -- i.e., a conventional value being used to indicate a missing value -- in an object for which the value of the blank attribute is the Null. The default value of s.AUTOBLANK is the Null, which causes na's to be displayed as is. The default value of the blank attribute is 1 0(), which also causes na values to be displayed as is and causes s.AUTOBLANK to be ignored. To have the current value of s.AUTOBLANK be used by an object, set its blank attribute to Null. s.AUTOWSs.AUTORESHOWs.AUTOREPARENT1 free `l; show `c; `c br 0 `c has ( `insertbelow;1; `space;10; `row;0); Now move the mouse pointer into the display of c, press Meta-Insert (Alt-Insert on IBM keyboards), and move the pointer back into the Emacs window. The first statement demonstrates that the default values of the attribute and the default variable have the same effect on the display. The remaining statements of this set show that s.AUTOBLANK is not electrically connected. `c has (`blank;); s.AUTOBLANK' ' `c has (`blank;); s.AUTOBLANK'Fill in' `c has (`blank;); s.AUTOBLANK() Setting s.BEEP to any value causes the display to beep. Don't think of it as a free variable to keep a value in, however: s.BEEP1 10 do s.BEEP100 s.BEEP s.DATASPACE provides the default value for the space attribute, used when the value of space is the Null. s.DATASPACE When a variable for which default formatting is in effect is bound, s.WP is used to calculate a tentative value for its space attribute: - if s.WP is 0, the result is the value of s.DATASPACE; - if it is -1, the result is the minimum width required for any cell in the entire object; - otherwise, the result is the minimum width required for any cell in just the first s.WP rows or (for a vector) cells, to save computation. The value of the space attribute is then set to the maximum of its existing value, the value just calculated, and, if the object is a vector, the width of its title. Because space is a persistent attribute, we expunge the variable before each redisplay in this example: s.WP s.WP1 _ex free `c; c6 8; c[2]81234567890; show `c is `array; `c br 0 s.WP0 _ex free `c; c6 8; c[2]81234567890; show `c is `array; `c br 0 s.WP1 _ex free `c; c6 8; c[2]81234567890; show `c is `array; `c br 0 s.WSNAME holds the default value of the shelltitle attribute for the object named in s.WS. The default value for s.WSNAME itself is 01_argv if _argv is not the Null, and 'A+' otherwise. Clearly, an application name is a good value for this variable. Its value is used when the object's shelltitle attribute is set to Null or the object is first shown (with a shelltitle attribute of Null): s.WSNAME'A+ Tutorial' No visible effect. `c has (`shelltitle;); Aha! s.WSNAME'A+ s Tutorial' No visible effect. free `c; show `c; `c br 0 Yes! s.WSNAME'A+'; _ex free `c; 3b. Input Variables: s.EDITSPACE s.NA The space available for editing in a cell is given by one of two values: the space attribute or, when the editspace attribute is effectively 1, s.EDITSPACE, whose default value is 256. If the editing space exceeds the value of the space attribute, scrolling is performed automatically. The na attribute gives a conventional value to be used to indicate missing data. When a row is inserted and the copy attribute is not effectively 1, the na value is used for each inserted element of the variable. If na is Null (its default value), its value comes from s.NA, which is a slotfiller whose symbolic indices are the type symbols. The na value used for a variable x with null na is (x)s.NA. The na values can be seen in the following example because the blank attribute and s.AUTOBLANK are null until the last statement, when the current na values are shown as "Fill in": s.NA c6 5; `c is `array; `c has (`insertbelow;1; `space;10; `cols;2); show `c; `c br 0 Click on the first row of c and press Meta-Insert (Alt-Insert on IBM keyboards). Inserted elements have the value 999999999. (`ints.NA)888888 Move pointer into c; press Meta-Insert. Inserted values: 888888. `c has (`na;0); Insert another row. Inserted values: 0. (`ints.NA)777 Insert another row. Inserted values: still 0. `c has (`na;); Insert another row. Now inserted values are 777. `c has (`blank;'Fill in'); We could have specified `c has (`na;50). For numeric matrices, scalar and vector na specifications have the same effect on the variable and the display. For character matrices, the situation is somewhat different. Scalar and vector na attributes have the same effect on the variable, but for the blank attribute the contents of each cell is checked against the value of the na attribute. Each cell contains an entire row of the variable, so only the vector form will be found: c`character`matrix `c has (`na;'-'; `blank;' '); Move the pointer into c and press Meta-Insert. Notice that the na's are not found and replaced in the display. `c has (`na;9'-'); `c has `refresh; Now the cells with na's have been found and the replacement made. The blank attribute can have a vector value, which is given to the entire cell. In fact, the na attribute can be given a vector value, and the elements of that value will be assigned to the elements of the row of the matrix: `c has (`blank;'New text:'); `c has (`na;'Insertion'); Insert another row. Its value is "insertion", its display is "New text:", and the previously inserted row no longer is na. c[1;1+7] _ex free `c; Notice that the blank attribute is used in the display of only those elements of the variable that are equal to the current value of the na attribute. 3c. Graphs Variables: s.FILLCOLORS s.LINECOLORS s.LINESTYLES s.TRACESYMBOLS These variables provide the default values for the fillcolor, linecolor, linestyle, and symbol attributes. s.FILLCOLORS s.LINECOLORS s.LINESTYLES s.TRACESYMBOLS The default for style is line. With one trace set, the default is to distinguish the traces by color and to use the same line style for all of them. You can, of course, change the default line colors, with a refresh to make the change effective: t12 41 1.25 1.5 1.75 2 2.25 2.5 2.75 g`t1; `g is `graph; show `g; `g has (`legend;`xy; `xlegend;53); `g br 0 s.LINECOLORS`deepskyblue `yellow; `g has `refresh; s.LINECOLORSs.FILLCOLORS; `g has `refresh; You can also detach the attributes from the default variables by giving them non-null values. For example, you can distinguish traces within a trace set by line style instead of color: `t1 has (`linecolor;`black); `t1 has (`linestyle;`dotdash`dot`solid); For a single trace set in the scatter style, the default is to distinguish the traces by both fill color and symbol: `t1 has (`style;`scatter); The fillcolor and symbol attributes can be set directly, and their default values can be changed: `t1 has (`fillcolor;`yellow); `t1 has (`symbol;`xsym); `t1 has (`symbol;`diamond`xsym`diamondfilled); s.TRACESYMBOLSs.TRACESYMBOLS `t1 has (`symbol;); When there is more than one trace set, color is used to distinguish among the sets and line style and symbol are used to distinguish among the traces within each set. Start by restoring the defaults and adding a second trace set; try reversing the default order of the line style: `t1 has (`linecolor`linestyle`fillcolor;3()); t2t1; t2[;0]3 4; g`t1`t2; `t1 has (`style;`line); s.LINESTYLESs.LINESTYLES; `g has `refresh; When there are several trace sets and the scatter style is used, both fill color and symbol are used to distinguish among sets. If you want to differentiate traces presently within the same set, either change their attributes directly, as in the following example, or put them in different trace sets. `t1 has (`style;`scatter); `t2 has (`style;`scatter); `t1 has (`fillcolor;`blue`yellow`orange); s.FILLCOLORS,>`fillcolor of `t1; `t1 has (`fillcolor;); _ex free `g; 3d. Multiple Windows Variables: s.SHELL s.WS s.SHELL specifies whether the default window type is pop-up (-1) or top-level (0). That is, when an object is created and its window type is not specified in some other manner, it will be determined by s.SHELL: s.SHELL s.SHELL0 abcde6 8 show `a`b`c`d; `a`b`c`d br (90 0;60 0;30 0;0); Because we changed s.SHELL from its default value of -1 to 0, all four objects were created as top-level windows. There is a way to reverse this effect for individual variables. If an underscore is inserted immediately following the backquote in the name of the class to which the object is being bound, then the window type will be the opposite of the default established by s.SHELL: free `d; show `d is `_array; `d br 0 Now we will repeat the process with the opposite default. Notice that one exception occurs: free `a`b`c`d; s.SHELL1 show `a`b`c`d; `a`b`c`d br (90 0;60 0;30 0;0); free `d; show `d is `_array; `d br 0 Why is a top-level despite the default window type of pop-up? When it was created, there was no screen workspace, and so it was made the workspace, which requires that it be top-level. s.WS names the screen workspace and its value verifies the fact that a is it. Setting s.WS to Null makes the current screen workspace no longer the workspace; the next object created will become the screen workspace. The object that is no longer the screen workspace is given the default window type. Both it and the next object created are raised above the other windows, being newer, so we have to raise the existing windows each time in this example to maintain visibility: s.WS s.WS(); `b`c`d has `raise; show `e; `e br 120 0; `a`b`c`d has `raise; s.WS _ex free `a`b`c`d`e; 3e. System response Variables: s.ABORT s.BUSY s.CLOCK s.CONNECTED s.ERROR s.EXIT s.GRAY s.MSG s.QUIET s.VERIFY Five of these variables have to do with error responses and messages: s.ABORT, s.ERROR, s.MSG, s.QUIET, and s.VERIFY. Errors are classified by s as either moderate or severe. When an s function encounters a severe error, s.ABORT controls what happens: if it is 1 (the default), execution of the s function and the functions in its calling chain is aborted, whereas if it is 0, execution of the function is suspended. When an s function encounters a moderate error, s.ERROR controls what happens: if it is 1, whatever action s.ABORT dictates is taken, whereas if it is 0 (the default), execution is continued despite the error. First we make sure the defaults are in effect: s.ABORT1; s.ERRORs.QUIET0; show `a a6 8; `a br 0 f{}:`a is `layout f{} $si s.ABORT0 f{} $si f{}:{`a has (`xlegend;3); '*** Continued ***'} f{} s.ERROR1 f{} $si s.ABORT1 f{} $si s.ERROR0 There are three categories of s messages: for severe errors, for moderate errors, and as warnings or information. As you have just seen, exclamation points -- two, one, or none -- indicate the category of a message, which is syntactically in the form of a comment. s.QUIET controls which messages are displayed: all (0), errors only (1), severe errors only (2), or none (-1). Try the following example and see the messages gradually disappear: s.QUIET is 0 free `a; show `a; `a br 0; `a has (`xlegend;3); `a is `layout; s.QUIET1 free `a; show `a; `a br 0; `a has (`xlegend;3); `a is `layout; s.QUIET2 free `a; show `a; `a br 0; `a has (`xlegend;3); `a is `layout; s.QUIET1 free `a; show `a; `a br 0; `a has (`xlegend;3); `a is `layout; s.QUIET0 The messages from s do not have to be routed to the session log. They can be routed to a variable instead, in which case the comment symbol and space at the beginning will be omitted. The messages are overwritten; the variable will contain only the last message. If the variable is a displayed object, the last message will be shown in its display. Explicit results and messages that are not from s will continue to be shown in the A+ session log. You specify the destination for the messages from s in the variable s.MSG, by giving a name in symbol form or else the Null. The name must be a valid name for a variable, but the variable need not exist. The Null is used to specify the session log: ()s.MSG a3 50' '; `a is `label; `a has `naturalsize; `a br 0 s.MSG`a `a has (`xlegend;3); `a is `layout; `a has (`xlegend;3); `a has (`bg;white) Non-s error messages appear in the A+ session log. `a has (`bg;`white) Explicit results always go to the log, also. s.MSG`m No such variable yet. `a has (`xlegend;3); `a is `layout; m m _ex >free `a; m m s.MSG() a6 8; show `a; `a br 0; `a has (`xlegend;3); `a is `layout; A variable must satisfy certain type and rank restrictions in order to be bound to a given display class. When its verify attribute is effectively 0 (the default value), verification takes place in the A+ interpreter; when it is 1, verification takes place within the s-context functions and a more meaningful message is emitted. The default value for verify is actually Null, which means that the value of s.VERIFY is to be used. (s.AUTOVERIFY might be a name more consistent with the conventions for naming s-context variables.) The default value of s.VERIFY is 0. The following example shows the two verifications and, in the latter case, by directing the message from s away from the session log, shows where the parts of the message come from (as you would expect from their form): a2 3 4 51 s.VERIFY1; `verify of `a The effective value is shown, not the actual. a2 3 4 51 s.MSG`m a2 3 4 51 m s.MSG(); s.VERIFY0; _ex `m; Three of the variables discussed in this section have to do with indications that the system is busy: s.BUSY, s.CLOCK, and s.GRAY. We will say that the pointer is "busy" -- or that the busy pointer is on -- during periods in which it is required to appear as a small clock whenever it is in an s window. The first of these variables provides a semi-automatic control for the busy pointer. It allows a function to turn the busy pointer on and, so far as that function is concerned, off. Specifically, when s.BUSY is set to 1, an internal "busy count" is incremented by 1, and when it is set to 0 the count is decremented by 1 (but not below 0). Whenever the count is non-zero, the pointer appears busy: f{}:{s.BUSY1; g{}; sys.sleep 5; s.BUSY0} g{}:{s.BUSY1; sys.sleep 5; s.BUSY0} b6 8; show `b; `b br 0,10+>`xs of `a $dbg func 1 $dbg +cxt . Now press F2 on the following statement and move the pointer into the display of a or b during its execution: f{} $dbg func 0 s.CLOCK provides an independent automatic control for the busy pointer. If s.CLOCK is 1, the pointer appears busy whenever it is in any s window during callbacks for displayed objects and during assignments to variables being displayed on the screen. If it is 0, such events do not cause the pointer to appear busy, thus avoiding flicker in, e.g., applications with fast real-time update rates. After executing the first three statements, move the pointer in the display of a and press F1; you will see the pointer go busy for two seconds. Then move the pointer back into the Emacs window, press F2 on the statement executing f{}, and move the pointer into the display of a or b. After three seconds, you will see it flash to busy and back. Notice that the shelltitle area is "grayed" each time the pointer is busy: g{}:{sys.sleep 2; 'g done'} `a has (`f1;(g;)); f{}:{sys.sleep 3; .a.a; 'f done'} f{} s.GRAY, which has a default value of 1, controls whether the shelltitle areas of the s windows are grayed whenever the pointer is busy. It is thus dependent upon s.BUSY and s.CLOCK. Press F1 in the display of a after executing each of the following two statements. You will see the busy pointer without graying and then neither a busy pointer nor graying: s.GRAY0 s.CLOCK0; s.GRAY1; s.CLOCK1 3f. Miscellaneous Variables: s.AUTODOC s.SCREEN The doc attribute allows you to provide documentation for objects. The default value for doc is s.AUTODOC. By setting it to the name of the application and perhaps your name, for example, you can provide minimal generic documentation for those objects for which you don't want to provide specific documentation. s.SCREEN is a dependency that gives the height and width of the current screens in pixels. You may have noticed that we used it for the br function, to find out where the bottom right corner was in the screen you are using to run this tutorial. s.SCREEN 4. Attribute Default Variables Variables: s.BLACK s.BLUE s.GREEN s.GREY s.ORANGE s.PURPLE s.RED s.WHITE s.YELLOW s.FONT An attribute default variable can supply an attribute value for all s objects, for objects bound to a certain class or classes, or for an individual object or objects. We will consider attribute default variables for the bg attribute, in the order of comprehensiveness just given. The s-context system attribute default variables each provide defaults for certain attributes for objects bound to all classes, except that s.FONT does not apply to the graph class. The attributes they apply to are listed in Table 56-3 of the A+ Reference Manual. Although the value of the bg attribute for the object a is given below by the of function as `grey, it is in fact Null. It gets its effective value from the system attribute default variable s.GREY, as its responsiveness to changes in that variable shows. The object b, also of the array class, sheds further light on the effect of the default variables: `bg of `a s.GREY s.GREY`purple s.GREY`grey What if we set the value of bg of a ourselves? Then we have temporarily disconnected it from s.GREY -- broken the electrical connection. Changing the variable does not in general change the background color. If, however, we make them coincide again, by changing the value of either bg or s.GREY, then we reconnect them, and when we change the variable the background changes: `a has `bg `rosybrown s.GREY`purple s.GREY`rosybrown s.GREY`grey We can change the default variable for bg for the entire array class. When we establish the new default variable in the example below, nothing happens, because its value is not the same as the bg value for a. Just as for the system default, we can establish the connection by making the values coincide. Changing s.GREY now has no effect on the bg of a, because s.GREY has been displaced by arrayGREY for bg for array objects. (We could, to be sure, make arrayGREY also be the default variable for other attributes and for other classes.) arrayGREY`mediumseagreen `array s.Has `.bg `arrayGREY arrayGREY`grey arrayGREY`mediumseagreen s.GREY`mediumseagreen s.GREY`grey We can specify a bg variable just for a. As soon as has is executed, the new variable clr is used for the background color, because we are no longer in a situation where there may be many objects and some of them may be exceptions to the general rule embodied in the default variable. Response is immediate not only to direct settings of bg but also to settings of clr: clr`rosybrown `a has `.bg `clr; clrs.BLUE `a has `bg `grey; clr`cyan So here are the present values of the attribute for a, the default variable for it for a, the default variable for it for this class, and the default variable for all other classes, typified by table, namely the system default variable: `bg of `a `.bg of `a `.bg s.Of `array `.bg s.Of `table We can remove the default variable for bg for this object by specifying it to be the Null. We thereby remove the shadow from the default variable for the array class and it acts as it did before: `a has (`.bg;); arrayGREY`cyan arrayGREY`rosybrown Removing the default variable for bg for the entire array class does not have a similar effect, because it displaced, not shadowed, the system default variable: `array s.Has (`.bg;); arrayGREY`grey s.GREY`rosybrown s.GREY`grey `.bg s.Of `array Explicitly setting the default variable for bg for array restores its effect. We must, of course, make the default variable for the class agree with the actual value of the attribute of the object to restore the connection. If this doesn't work now, it will work soon, in another release: `array s.Has (`.bg;`s.GREY); s.GREY`rosybrown s.GREY`grey `.bg s.Of `array The default for the font, labelfont, and titlefont attributes for all classes except graph is obtained from s.FONT, whose default value is "kaplgallant". (The dynamic attribute governs whether the window is resized when the font is changed.) Watch the fonts change in a when you execute these statements: s.FONT'helvetica' s.FONT'helvetica-14' s.FONT'kaplgallant' 5. Data Variables Variables: s.COLOR_NAMES s.COLOR_NUMBERS s.FONT_NAMES These variables give information about the colors and fonts that are available. The values of the two names variables are long lists of symbols; using Unpack and show is a good way to display them: _ex`a`b,free`a`b; show s.FONT_NAMES; `a br 0 The color variables can be shown together: (cn1;cn2;cn3)<@1s.COLOR_NUMBERS cnmss.COLOR_NAMES t`cn1`cn2`cn3`cnms `t has (`class;`table; `cols;4; `title;'Color numbers and names'); `cn1`cn2`cn3`cnms has (<`title),<(`R;`G;`B;'Color names'); `cn1`cn2`cn3 has <(`space;4); show `t; `t br 0 _ex`f`g`l`arrayGREY`clr,s.reset{}; aplus-fsf-4.22/src/tutorials/s.tutorials/special_io0000444000265000001440000002420307232116765016164 Special Input and Display Classes 1. Special Input 1.a The Text Display Class Attributes: buffer save 1.b The Command Display Class 1.c The Password Display Class Attributes: fill valid validate 2. Special Display 2a. The Scalar Display Class 2b. The Tree Display Class --------------------------------------------------- 1. Special Input Input to the classes described in the Data tutorial is peformed by entering an Emacs-type editor in a cell and later exiting from it. Input to the three classes described below is performed or handled in a special way. 1a. The Text Display Class Attributes: buffer save The text display class provides a note pad, a general means for text entry. The underlying variable for an object bound to this class is a character vector. A text object is always in edit mode; there are no user actions that begin or end edit mode. Keystrokes constitute text input to it whenever it has focus. New lines are created during text entry by pressing the Enter key, which appears in the character vector as the character `char10 (newline); this is the only control character that should be used in the text. APL characters can be entered. $load s scrs.SCREEN-34 12 br{w;m}:{w has (`yx;scr-m+`yxs of w);} t'Notes, 6/15/94: ' `t has (`class;`text; `shelltitle;'Shelltitle'; `title;'Title'); show `t; br{`t;0} Observe that the cursor is at the beginning of the text. It can be moved to the end by using either the Right Arrow key or the End key. Enter some text. t The text you entered should not appear in the value of t. Since there is never a signal that editing is complete, when text is entered the underlying character vector is not automatically updated. The text currently on the screen can always be obtained, however, as the value of the "buffer" attribute, which is a one-row matrix: >`buffer of `t >`buffer of `t To update the underlying variable, the viewer enters Ctl-s (when the text object has focus). If the "save" attribute has the value 0, the Ctl-s entry has no effect, but if save is 1 (the default value), then the underlying variable is set to the value of the buffer attribute. Enter Ctl-s in the text object after save is set to 0 and again after it is set to 1, and notice the behavior of the cursor each time: `t has (`save;0); t `t has (`save;1); t t >`buffer of `t The visible sign that the text has been saved in the variable is the movement of the cursor to the beginning of the text. That movement may require that End be pressed every time after Ctl-s. If, however, you want a series of notes in inverse chronological order, then you can just start entering text where you are left after each Ctl-s. In that case, you would probably not want to have any initial text, but rather put the identification -- date or other tag -- in either the title or the shelltitle. After respecification as a result of a Ctl-s, the underlying variable is still a vector and the value of the buffer attribute is still a matrix with one row, but their ravels are equal. The buffer is ready to accept additional text, in contrast to a buffer for an object of the command display class, which we turn to next. _ex >free `t; 1b. The Command Display Class The command display class is for monitoring the character-by-character input of a command line. A command display has two parts, a title area on the left and a value area on the right. Text can be entered in the value area, and the entry can be monitored one character at a time, using a callback function specified in the key attribute. The contents of the value area is initially, of course, the value of the underlying variable. It could be blank, as here, or an initial, common segment of the command, to aid the viewer. The value of the underlying variable does not change until the editing is complete, that is, until Enter is pressed. Just as for a text object, the current contents of the value area are available in the buffer attribute and the position of the cursor can be queried: c20' ' f{x}:(,>`buffer of x;>`cursor of x) `c has (`class;`command; `key;(f;`c); `title;'Enter command:'); show `c; br{`c;0} `cursor of `c >`buffer of `c The buffer is empty because edit mode has not yet been entered. Now begin editing; press a few keys and notice that there is a callback for each of them, including the arrow and shift keys, so that to determine whether a new character has been entered or one has been deleted you need to know the buffer contents, or at least its shape, at the previous callback: >`buffer of `c >`buffer of `c c c `c has (`key;); Now press some more keys, and end with Enter: >`buffer of `c c c The buffer is empty, since you are no longer in edit mode, but the contents of the value area are now reflected in the underlying variable. _ex `f, >free `c; 1c. The Password Display Class Attributes: fill valid validate The password display class provides password protection for applications. The password display has two parts, a title area on the left and a value area on the right. The underlying variable holds a user name. Text can be entered in the value area and compared to the login password of that user. You can control the size of the value area by means of the space attribute. The value area is empty initially and is cleared each time input is completed. For the underlying variable in the example, we'll use your login id, so that you'll know the correct password: pwsys.getusername{} `pw has (`class;`password; `title;'Enter password:'; `space;10); show `pw; br{`pw;0} The "validate" attribute holds the definition of a function that is to be called when input is completed, i.e., when Enter is pressed. The "valid" attribute, which is for reference only, is initially 0. It is set to 1 when input is completed if the entry in the value area is the login password for the user name in the underlying variable. It is set to 0 whenever input mode is entered. Assign to the validate attribute a callback function that displays the value of valid: f{s;c;v}:`valid of cv `pw has (`validate;f); Each character that is entered in the value area is displayed as an asterisk, which is the default value of the "fill" attribute. You can change fill to any character you want (including blank). Enter your password and observe that 1 appears in the A+ session log, then execute the following statement to change the fill character, enter text that is not your password, and see 0 in the log: `pw has (`fill;'-'); _ex `f, >free `pw; 2. Special Display There are two classes that display variables in special ways: the scalar and tree display classes. 2a. The Scalar Display Class Any A+ global variable can be bound to the scalar class. The display has two parts side by side, a title area on the left and a value area on the right. The value area contains an A+ expression that represents the value of the variable, in the sense that the evaluation of the expression is identical to the value of the variable. (This is not quite true for floating-point values; the number of decimal digits appearing in the formatted display of a floating- point value from the workspace may not be enough to exactly reproduce the source value when executed.) s1 2 3 4 5 6 show `s is `scalar; br{`s;0} There are the usual possibilities for the title area, whose default value is the variable name: `s has (`title;''); `s has (`title;' '); `s has (`title;'An A+ expression:'); `s has `naturalsize; br{`s;0} Edit the A+ expression in the value area, inserting a 0 after the 1. When the size is increased, all the extra room goes to the value area. Linear expressions are recognized: s `s has (`xs;1.3>`xs of `s); br{`s;0} s(3 4;'abcdef'; 5.3 1.4 2.7 0.863) `s has (`space;37; `naturalsize;); br{`s;0} s2 4 6 8 10 12 s(10 8 6 4 2;2.2 4.4 6.6 8.8) s(1 2 4 7 11; 2 4 8 16 32 64) s4 30 4 8 1 5 9 2 6 10 3 7 11 _ex free `s; 2b. The Tree Display Class The tree display class is for displaying nested slotfillers as trees. A layout can be represented as a nested slotfiller; in fact, the value of the familytree attribute is such a representation. Consider this layout, for example: label'Just an example' f{}:sys.ts{} button1button2button3<{f} vpane`hpane1 `hpane2 hpane11 2`array1 `array2 array1array210 8 hpane21 2`table1 `table2 table1`array3 `array4 table2`array5 `array6 array3array4array5array6100000010 s.QUIET1 {`label `vpane `hpane1 `hpane2 `table1 `table2 is `label `vpane `hpane `hpane `table `table;} `table1 has (`cols;2); `table2 has (`cols;1); `array3 `array4 `array5 `array6 has <(`space;8); layout(`label;`button1 `button2 `button3;`vpane) show `layout is `layout; br{`layout;0} Now obtain the nested slotfiller representation from the familytree attribute and show it as a tree, alongside the layout: t0`familytree of `layout t show `t is `tree; br{`t;0,10+>`xs of `layout} A nested slotfiller cannot embody the geometry of a layout in general, because for each set of children it can only give a linear order, which would correspond to a simple horizontal or vertical arrangement. Therefore, no attempt is made in the familytree attribute to capture the geometry and each set of children just appears in some convenient order. Viewer interactions with objects in the tree display class are controlled not by attribute settings but rather through callback functions. Define a callback function for t: cbf{s;d;i;p;c;v}:(s;d;i;p;c;v) `t has (`set;(cbf;'----------')); Click the left mouse button twice on some nodes of t. Observe that the first click causes a box to appear around the node (and any box around another node to disappear) and the second click causes a callback and that p, the path variable, is the symbol vector path to the node. _ex `f`cbf, s.reset{}; aplus-fsf-4.22/src/app-defaults/0000777000265000001440000000000010774512703012264 5aplus-fsf-4.22/src/app-defaults/Makefile.am0000644000265000001440000000130207233114642014224 ## Process this file with automake to produce Makefile.in ############################################################################### ## ## ## Copyright (c) 2001 Morgan Stanley Dean Witter and Co. All rights reserved.## ## See .../src/LICENSE for terms of distribution. ## ## ## ## ## ############################################################################### appdefaultsdir = $(prefix)/app-defaults appdefaults_DATA = XTerm EXTRA_DIST = XTerm aplus-fsf-4.22/src/app-defaults/Makefile.in0000644000265000001440000001522510774512521014250 # Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ ############################################################################### ############################################################################### SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CXX = @CXX@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ STRIP = @STRIP@ VERSION = @VERSION@ X_INCLUDES = @X_INCLUDES@ X_LIBS = @X_LIBS@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ appdefaultsdir = $(prefix)/app-defaults appdefaults_DATA = XTerm EXTRA_DIST = XTerm subdir = src/app-defaults mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_CLEAN_FILES = DIST_SOURCES = DATA = $(appdefaults_DATA) DIST_COMMON = Makefile.am Makefile.in all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/app-defaults/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: appdefaultsDATA_INSTALL = $(INSTALL_DATA) install-appdefaultsDATA: $(appdefaults_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(appdefaultsdir) @list='$(appdefaults_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(appdefaultsDATA_INSTALL) $$d$$p $(DESTDIR)$(appdefaultsdir)/$$f"; \ $(appdefaultsDATA_INSTALL) $$d$$p $(DESTDIR)$(appdefaultsdir)/$$f; \ done uninstall-appdefaultsDATA: @$(NORMAL_UNINSTALL) @list='$(appdefaults_DATA)'; for p in $$list; do \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " rm -f $(DESTDIR)$(appdefaultsdir)/$$f"; \ rm -f $(DESTDIR)$(appdefaultsdir)/$$f; \ done tags: TAGS TAGS: DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = ../.. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: $(mkinstalldirs) $(DESTDIR)$(appdefaultsdir) 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_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_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-generic clean-libtool mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-appdefaultsDATA install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool uninstall-am: uninstall-appdefaultsDATA uninstall-info-am .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am info info-am install install-am install-appdefaultsDATA \ install-data install-data-am install-exec install-exec-am \ install-info install-info-am install-man install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool uninstall uninstall-am \ uninstall-appdefaultsDATA uninstall-info-am # 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: aplus-fsf-4.22/src/app-defaults/XTerm0000444000265000001440000001221007234365042013153 ! contributed by Josef Sachs XTerm*fontMenu.Label: VT Fonts XTerm*fontMenu*fontdefault*Label: Default XTerm*fontMenu*font1*Label: Unreadable XTerm*VT100*font1: nil2 XTerm*fontMenu*font2*Label: Tiny XTerm*VT100*font2: 5x8 XTerm*fontMenu*font3*Label: Small XTerm*fontMenu*font4*Label: Medium XTerm*VT100*font4: kaplscreen-bold XTerm*fontMenu*font5*Label: Large XTerm*VT100*font5: kaplgallant XTerm*fontMenu*font6*Label: Huge XTerm*VT100*font6: kaplgallant-19 XTerm*fontMenu*fontescape*Label: Escape Sequence XTerm*fontMenu*fontsel*Label: Selection XTerm*VT100.Translations: #override \ @Num_LockKP_0: string(0)\n\ @Num_LockKP_1: string(1)\n\ @Num_LockKP_2: string(2)\n\ @Num_LockKP_3: string(3)\n\ @Num_LockKP_4: string(4)\n\ @Num_LockKP_5: string(5)\n\ @Num_LockKP_6: string(6)\n\ @Num_LockKP_7: string(7)\n\ @Num_LockKP_8: string(8)\n\ @Num_LockKP_9: string(9)\n\ @Num_LockKP_Add: string(+)\n\ @Num_LockKP_Decimal: string(.)\n\ @Num_LockKP_Divide: string(/)\n\ @Num_LockKP_Enter: string(\015)\n\ @Num_LockKP_Equal: string(=)\n\ @Num_LockKP_Multiply: string(*)\n\ @Num_LockKP_Subtract: string(-)\n\ KP_Add: string(+)\n\ KP_Divide: string(/)\n\ KP_Enter: string(\015)\n\ KP_Equal: string(=)\n\ KP_Multiply: string(*)\n\ KP_Subtract: string(-)\n\ Prior:scroll-back(1,page)\n\ Next:scroll-forw(1,page)\n\ F16: start-extend() select-end(PRIMARY, CUT_BUFFER0, CLIPBOARD) \n\ F18: insert-selection(PRIMARY, CLIPBOARD) \n\ F27: scroll-back(10000,page) \n\ R13: scroll-forw(10000,page) \n\ Home: scroll-back(10000,page) \n\ End: scroll-forw(10000,page) \n\ :Mod1a: string() \n\ :Mod1b: string() \n\ :Mod1c: string() \n\ :Mod1d: string() \n\ :Mod1e: string() \n\ :Mod1f: string(_) \n\ :Mod1g: string() \n\ :Mod1h: string() \n\ :Mod1i: string() \n\ :Mod1j: string() \n\ :Mod1k: string(') \n\ :Mod1l: string() \n\ :Mod1m: string(|) \n\ :Mod1n: string() \n\ :Mod1o: string() \n\ :Mod1p: string(*) \n\ :Mod1q: string(?) \n\ :Mod1r: string() \n\ :Mod1s: string() \n\ :Mod1t: string(~) \n\ :Mod1u: string() \n\ :Mod1v: string() \n\ :Mod1w: string() \n\ :Mod1x: string() \n\ :Mod1y: string() \n\ :Mod1z: string() \n\ :Mod11: string() \n\ :Mod12: string() \n\ :Mod13: string(<) \n\ :Mod14: string() \n\ :Mod15: string(=) \n\ :Mod16: string() \n\ :Mod17: string(>) \n\ :Mod18: string() \n\ :Mod19: string() \n\ :Mod10: string(^) \n\ :Mod1-: string() \n\ :Mod1=: string() \n\ :Mod1backslash: string() \n\ :Mod1quoteleft: string() \n\ Shift Mod1comma: string(<) \n\ :Mod1comma: string() \n\ :Mod1space: string(" ") \n\ :Mod1~: string(~) \n\ :Mod1?: string(?) \n\ :Mod1[: string() \n\ :Mod1]: string() \n\ :Mod1;: string() \n\ :Mod1': string() \n\ :Mod1.: string() \n\ :Mod1/: string() \n\ :Mod1!: string() \n\ :Mod1@: string() \n\ :Mod1#: string() \n\ :Mod1$: string() \n\ :Mod1%: string() \n\ :Mod1^: string() \n\ :Mod1&: string() \n\ :Mod1*: string() \n\ :Mod1(: string() \n\ :Mod1): string() \n\ :Mod1_: string(!) \n\ :Mod1 +: string() \n\ :Mod1 |: string() \n\ Shift Mod1w: string(W) \n\ Shift Mod1r: string(R) \n\ Shift Mod1t: string(T) \n\ Shift Mod1u: string(U) \n\ Shift Mod1a: string(A) \n\ Shift Mod1d: string(D) \n\ Shift Mod1k: string(K) \n\ Shift Mod1x: string(X) \n\ Shift Mod1v: string(V) \n\ Shift Mod1o: string() \n\ Shift Mod1j: string() \n\ Shift Mod1f: string() \n\ Shift Mod1e: string() \n\ Shift Mod1i: string() \n\ :Mod1 {: string() \n\ :Mod1 }: string() \n\ Shift Mod1s: string() \n\ Shift Mod1g: string() \n\ Shift Mod1h: string() \n\ Shift Mod1l: string() \n\ :Mod1 colon: string() \n\ :Mod1 quotedbl: string() \n\ Shift Mod1c: string() \n\ Shift Mod1b: string() \n\ Shift Mod1n: string() \n\ Shift Mod1m: string() \n\ :Mod1 >: string() \n\ Shift Mod1p: string() \n\ Shift Mod1y: string() \n\ Shift Mod1z: string() \n\ Shift Mod1q: string() XTerm*sunFunctionKeys: True XTerm*VT100.Font: kaplscreen XTerm*charClass: 33:48,37:48,43:48,45-47:48,64:48,126:48 XTerm*VT100.curses: True XTerm.VT100.loginShell: True XTerm*VT100.internalBorder: 4 XTerm*VT100*jumpScroll: True XTerm*VT100*multiScroll: True XTerm*VT100*saveLines: 2000 XTerm*VT100*scrollBar: True XTerm*VT100*scrollKey: True XTerm*VT100.reverseWrap: True